Issues #23363, #23364, #23365, #23366: Fixed itertools overflow tests.
Used PyMem_New to check overflow.
diff --git a/.gitignore b/.gitignore
index 49299ee..ba9ee85 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,11 +15,13 @@
 Doc/tools/pygments/
 Doc/tools/sphinx/
 Lib/lib2to3/*.pickle
+Lib/test/data/*
 Lib/_sysconfigdata.py
 Lib/plat-mac/errors.rsrc.df.rsrc
 Makefile
 Makefile.pre
 Misc/python.pc
+Misc/python-config.sh
 Modules/Setup
 Modules/Setup.config
 Modules/Setup.local
@@ -57,6 +59,8 @@
 pybuilddir.txt
 pyconfig.h
 python
+python-config
+python-config.py
 python.exe
 python-gdb.py
 python.exe-gdb.py
@@ -66,4 +70,5 @@
 TAGS
 .coverage
 coverage/
+externals/
 htmlcov/
diff --git a/.hgeol b/.hgeol
index 73a4770..2919f76 100644
--- a/.hgeol
+++ b/.hgeol
@@ -26,6 +26,7 @@
 **.psd  = BIN
 **.tar  = BIN
 **.wav  = BIN
+**.whl  = BIN
 **.xar  = BIN
 **.zip  = BIN
 
diff --git a/.hgignore b/.hgignore
index c42dd03..9e5a583 100644
--- a/.hgignore
+++ b/.hgignore
@@ -19,21 +19,20 @@
 pyconfig.h$
 python$
 python.exe$
+python-config$
+python-config.py$
 reflog.txt$
 tags$
 Lib/plat-mac/errors.rsrc.df.rsrc
-Doc/tools/sphinx/
-Doc/tools/docutils/
-Doc/tools/jinja/
-Doc/tools/jinja2/
-Doc/tools/pygments/
 Misc/python.pc
+Misc/python-config.sh$
 Modules/Setup$
 Modules/Setup.config
 Modules/Setup.local
 Modules/config.c
 Modules/ld_so_aix$
 Parser/pgen$
+^lcov-report/
 ^core
 ^python-gdb.py
 ^python.exe-gdb.py
@@ -81,11 +80,21 @@
 PCbuild/*.*sdf
 PCbuild/Win32-temp-*
 PCbuild/x64-temp-*
+PCbuild/*-pgi
+PCbuild/*-pgo
 PCbuild/amd64
+PCbuild/ipch
+Tools/unicode/build/
+Tools/unicode/MAPPINGS/
 BuildLog.htm
 __pycache__
 Modules/_freeze_importlib
 Modules/_testembed
 .coverage
 coverage/
+externals/
 htmlcov/
+*.gcda
+*.gcno
+*.gcov
+coverage.info
diff --git a/.hgtags b/.hgtags
index 4abbc71..27aa7f3 100644
--- a/.hgtags
+++ b/.hgtags
@@ -127,3 +127,18 @@
 62cf4e77f78564714e7ea3d4bf1479ca1fbd0758 v3.3.5
 51317c9786f54267975abf2e9c502e6aaaa4a249 v3.3.6rc1
 971fec30da1fc5bf2b9fb28e09812a5127014211 v3.3.6
+46535f65e7f3bcdcf176f36d34bc1fed719ffd2b v3.4.0a1
+9265a2168e2cb2a84785d8717792acc661e6b692 v3.4.0a2
+dd9cdf90a5073510877e9dd5112f8e6cf20d5e89 v3.4.0a3
+e245b0d7209bb6d0e19316e1e2af1aa9c2139104 v3.4.0a4
+3405dc9a6afaa0a06dd1f6f182ec5c998dce6f5f v3.4.0b1
+ba32913eb13ec545a46dd0ce18035b6c416f0d78 v3.4.0b2
+a97ce3ecc96af79bd2e1ac66ce48d9138e0ca749 v3.4.0b3
+5e088cea8660677969113741c1313d570d977e02 v3.4.0rc1
+a300712ed38c9a242b736c44e806caea25a6dc05 v3.4.0rc2
+8a81cdab3e9d521daaef989fade94b16455fc3b8 v3.4.0rc3
+04f714765c13824c3bc2835d7b008908862e083a v3.4.0
+c67a19e11a7191baf30f313bf55e2e0b6c6f574e v3.4.1rc1
+c0e311e010fcb5bae8d87ca22051cd0845ea0ca0 v3.4.1
+8711a09513848cfc48c689d983495ee64f4668ca v3.4.2rc1
+ab2c023a9432f16652e89c404bbc84aa91bf55af v3.4.2
diff --git a/.hgtouch b/.hgtouch
index a629de9..7e3a5e7 100644
--- a/.hgtouch
+++ b/.hgtouch
@@ -4,8 +4,7 @@
 
 Python/importlib.h: Lib/importlib/_bootstrap.py Modules/_freeze_importlib.c
 
-Include/ast.h: Parser/Python.asdl Parser/asdl.py Parser/asdl_c.py
-Include/Python-ast.h: Include/ast.h
+Include/Python-ast.h: Parser/Python.asdl Parser/asdl.py Parser/asdl_c.py
 Python/Python-ast.c: Include/Python-ast.h
 
 Python/opcode_targets.h: Python/makeopcodetargets.py Lib/opcode.py
diff --git a/Doc/Makefile b/Doc/Makefile
index 82f5bef..ea30231 100644
--- a/Doc/Makefile
+++ b/Doc/Makefile
@@ -5,24 +5,23 @@
 
 # You can set these variables from the command line.
 PYTHON       = python
-SVNROOT      = http://svn.python.org/projects
-SPHINXOPTS   =
+SPHINXBUILD  = sphinx-build
 PAPER        =
 SOURCES      =
-DISTVERSION  = $(shell $(PYTHON) tools/sphinxext/patchlevel.py)
+DISTVERSION  = $(shell $(PYTHON) tools/extensions/patchlevel.py)
 
 ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees -D latex_paper_size=$(PAPER) \
                 $(SPHINXOPTS) . build/$(BUILDER) $(SOURCES)
 
-.PHONY: help checkout update build html htmlhelp latex text changes linkcheck \
+.PHONY: help build html htmlhelp latex text changes linkcheck \
 	suspicious coverage doctest pydoc-topics htmlview clean dist check serve \
 	autobuild-dev autobuild-stable
 
 help:
 	@echo "Please use \`make <target>' where <target> is one of"
 	@echo "  clean      to remove build files"
-	@echo "  update     to update build tools"
 	@echo "  html       to make standalone HTML files"
+	@echo "  htmlview   to open the index page built by the html target in your browser"
 	@echo "  htmlhelp   to make HTML files and a HTML help project"
 	@echo "  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
 	@echo "  text       to make plain text files"
@@ -37,30 +36,8 @@
 	@echo "  check      to run a check for frequent markup errors"
 	@echo "  serve      to serve the documentation on the localhost (8000)"
 
-# Note: if you update versions here, do the same in make.bat and README.txt
-checkout:
-	@if [ ! -d tools/sphinx ]; then \
-	  echo "Checking out Sphinx..."; \
-	  svn checkout $(SVNROOT)/external/Sphinx-1.2/sphinx tools/sphinx; \
-	fi
-	@if [ ! -d tools/docutils ]; then \
-	  echo "Checking out Docutils..."; \
-	  svn checkout $(SVNROOT)/external/docutils-0.11/docutils tools/docutils; \
-	fi
-	@if [ ! -d tools/jinja2 ]; then \
-	  echo "Checking out Jinja..."; \
-	  svn checkout $(SVNROOT)/external/Jinja-2.3.1/jinja2 tools/jinja2; \
-	fi
-	@if [ ! -d tools/pygments ]; then \
-	  echo "Checking out Pygments..."; \
-	  svn checkout $(SVNROOT)/external/Pygments-1.6/pygments tools/pygments; \
-	fi
-
-update: clean checkout
-
-build: checkout
-	mkdir -p build/$(BUILDER) build/doctrees
-	$(PYTHON) tools/sphinx-build.py $(ALLSPHINXOPTS)
+build:
+	$(SPHINXBUILD) $(ALLSPHINXOPTS)
 	@echo
 
 html: BUILDER = html
@@ -91,24 +68,30 @@
 	@echo "The overview file is in build/changes."
 
 linkcheck: BUILDER = linkcheck
-linkcheck: build
-	@echo "Link check complete; look for any errors in the above output" \
-	      "or in build/$(BUILDER)/output.txt"
+linkcheck:
+	@$(MAKE) build BUILDER=$(BUILDER) || { \
+	echo "Link check complete; look for any errors in the above output" \
+	     "or in build/$(BUILDER)/output.txt"; \
+	false; }
 
 suspicious: BUILDER = suspicious
-suspicious: build
-	@echo "Suspicious check complete; look for any errors in the above output" \
-	      "or in build/$(BUILDER)/suspicious.csv.  If all issues are false" \
-	      "positives, append that file to tools/sphinxext/susp-ignored.csv."
+suspicious:
+	@$(MAKE) build BUILDER=$(BUILDER) || { \
+	echo "Suspicious check complete; look for any errors in the above output" \
+	     "or in build/$(BUILDER)/suspicious.csv.  If all issues are false" \
+	     "positives, append that file to tools/susp-ignored.csv."; \
+	false; }
 
 coverage: BUILDER = coverage
 coverage: build
 	@echo "Coverage finished; see c.txt and python.txt in build/coverage"
 
 doctest: BUILDER = doctest
-doctest: build
-	@echo "Testing of doctests in the sources finished, look at the" \
-	      "results in build/doctest/output.txt"
+doctest:
+	@$(MAKE) build BUILDER=$(BUILDER) || { \
+	echo "Testing of doctests in the sources finished, look at the" \
+	     "results in build/doctest/output.txt"; \
+	false; }
 
 pydoc-topics: BUILDER = pydoc-topics
 pydoc-topics: build
@@ -120,10 +103,6 @@
 
 clean:
 	-rm -rf build/*
-	-rm -rf tools/sphinx
-	-rm -rf tools/pygments
-	-rm -rf tools/jinja2
-	-rm -rf tools/docutils
 
 dist:
 	rm -rf dist
@@ -163,16 +142,10 @@
 	cp build/latex/docs-pdf.zip dist/python-$(DISTVERSION)-docs-pdf-letter.zip
 	cp build/latex/docs-pdf.tar.bz2 dist/python-$(DISTVERSION)-docs-pdf-letter.tar.bz2
 
-	# archive the epub build
+	# copy the epub build
 	rm -rf build/epub
 	make epub
-	mkdir -p dist/python-$(DISTVERSION)-docs-epub
-	cp -pPR build/epub/*.epub dist/python-$(DISTVERSION)-docs-epub/
-	tar -C dist -cf dist/python-$(DISTVERSION)-docs-epub.tar python-$(DISTVERSION)-docs-epub
-	bzip2 -9 -k dist/python-$(DISTVERSION)-docs-epub.tar
-	(cd dist; zip -q -r -9 python-$(DISTVERSION)-docs-epub.zip python-$(DISTVERSION)-docs-epub)
-	rm -r dist/python-$(DISTVERSION)-docs-epub
-	rm dist/python-$(DISTVERSION)-docs-epub.tar
+	cp -pPR build/epub/Python.epub dist/python-$(DISTVERSION)-docs.epub
 
 check:
 	$(PYTHON) tools/rstlint.py -i tools
@@ -184,7 +157,6 @@
 
 # for development releases: always build
 autobuild-dev:
-	make update
 	make dist SPHINXOPTS='-A daily=1 -A versionswitcher=1'
 	-make suspicious
 
@@ -192,9 +164,10 @@
 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)
+# for stable releases: only build if not in pre-release stage (alpha, beta)
+# release candidate downloads are okay, since the stable tree can be in that stage
 autobuild-stable:
-	@case $(DISTVERSION) in *[abc]*) \
+	@case $(DISTVERSION) in *[ab]*) \
 		echo "Not building; $(DISTVERSION) is not a release version."; \
 		exit 1;; \
 	esac
diff --git a/Doc/README.txt b/Doc/README.txt
index a494c89..1fc4a9f 100644
--- a/Doc/README.txt
+++ b/Doc/README.txt
@@ -3,34 +3,30 @@
 
 This directory contains the reStructuredText (reST) sources to the Python
 documentation.  You don't need to build them yourself, prebuilt versions are
-available at http://docs.python.org/download/.
+available at <https://docs.python.org/3.4/download.html>.
 
-Documentation on the authoring Python documentation, including information about
+Documentation on authoring Python documentation, including information about
 both style and markup, is available in the "Documenting Python" chapter of the
-documentation.
+developers guide <https://docs.python.org/devguide/documenting.html>.
 
 
 Building the docs
 =================
 
-You need to have Python 2 installed; the toolset used to build the
-docs is written in Python.  It is called *Sphinx*, it is not included in this
-tree, but maintained separately.  Also needed are the docutils, supplying the
-base markup that Sphinx uses, Jinja, a templating engine, and optionally
-Pygments, a code highlighter.
+You need to have Sphinx <http://sphinx-doc.org/> installed; it is the toolset
+used to build the docs.  It is not included in this tree, but maintained
+separately and available from PyPI <https://pypi.python.org/pypi/Sphinx>.
 
 
 Using make
 ----------
 
-Luckily, a Makefile has been prepared so that on Unix, provided you have
-installed Python and Subversion, you can just run ::
+A Makefile has been prepared so that on Unix, provided you have installed
+Sphinx, you can just run ::
 
    make html
 
-to check out the necessary toolset in the `tools/` subdirectory and build the
-HTML output files.  To view the generated HTML, point your favorite browser at
-the top-level index `build/html/index.html` after running "make".
+to build the HTML output files.
 
 On Windows, we try to emulate the Makefile as closely as possible with a
 ``make.bat`` file.
@@ -38,47 +34,62 @@
 To use a Python interpreter that's not called ``python``, use the standard
 way to set Makefile variables, using e.g. ::
 
-   make html PYTHON=/usr/bin/python2.5
+   make html PYTHON=python3
+
+On Windows, set the PYTHON environment variable instead.
+
+To use a specific sphinx-build (something other than ``sphinx-build``), set
+the SPHINXBUILD variable.
 
 Available make targets are:
 
- * "html", which builds standalone HTML files for offline viewing.
+* "clean", which removes all build files.
 
- * "htmlhelp", which builds HTML files and a HTML Help project file usable to
-   convert them into a single Compiled HTML (.chm) file -- these are popular
-   under Microsoft Windows, but very handy on every platform.
+* "html", which builds standalone HTML files for offline viewing.
 
-   To create the CHM file, you need to run the Microsoft HTML Help Workshop over
-   the generated project (.hhp) file.
+* "htmlview", which re-uses the "html" builder, but then opens the main page
+  in your default web browser.
 
- * "latex", which builds LaTeX source files as input to "pdflatex" to produce
-   PDF documents.
+* "htmlhelp", which builds HTML files and a HTML Help project file usable to
+  convert them into a single Compiled HTML (.chm) file -- these are popular
+  under Microsoft Windows, but very handy on every platform.
 
- * "text", which builds a plain text file for each source file.
+  To create the CHM file, you need to run the Microsoft HTML Help Workshop
+  over the generated project (.hhp) file.  The make.bat script does this for
+  you on Windows.
 
- * "epub", which builds an EPUB document, suitable to be viewed on e-book
-   readers.
+* "latex", which builds LaTeX source files as input to "pdflatex" to produce
+  PDF documents.
 
- * "linkcheck", which checks all external references to see whether they are
-   broken, redirected or malformed, and outputs this information to stdout as
-   well as a plain-text (.txt) file.
+* "text", which builds a plain text file for each source file.
 
- * "changes", which builds an overview over all versionadded/versionchanged/
-   deprecated items in the current version. This is meant as a help for the
-   writer of the "What's New" document.
+* "epub", which builds an EPUB document, suitable to be viewed on e-book
+  readers.
 
- * "coverage", which builds a coverage overview for standard library modules and
-   C API.
+* "linkcheck", which checks all external references to see whether they are
+  broken, redirected or malformed, and outputs this information to stdout as
+  well as a plain-text (.txt) file.
 
- * "pydoc-topics", which builds a Python module containing a dictionary with
-   plain text documentation for the labels defined in
-   `tools/sphinxext/pyspecific.py` -- pydoc needs these to show topic and
-   keyword help.
+* "changes", which builds an overview over all versionadded/versionchanged/
+  deprecated items in the current version. This is meant as a help for the
+  writer of the "What's New" document.
 
- * "suspicious", which checks the parsed markup for text that looks like
-   malformed and thus unconverted reST.
+* "coverage", which builds a coverage overview for standard library modules and
+  C API.
 
-A "make update" updates the Subversion checkouts in `tools/`.
+* "pydoc-topics", which builds a Python module containing a dictionary with
+  plain text documentation for the labels defined in
+  `tools/pyspecific.py` -- pydoc needs these to show topic and keyword help.
+
+* "suspicious", which checks the parsed markup for text that looks like
+  malformed and thus unconverted reST.
+
+* "check", which checks for frequent markup errors.
+
+* "serve", which serves the build/html directory on port 8000.
+
+* "dist", (Unix only) which creates distributable archives of HTML, text,
+  PDF, and EPUB builds.
 
 
 Without make
@@ -86,7 +97,7 @@
 
 Install the Sphinx package and its dependencies from PyPI.
 
-Then, from the ``Docs`` directory, run ::
+Then, from the ``Doc`` directory, run ::
 
    sphinx-build -b<builder> . build/<builder>
 
@@ -98,10 +109,10 @@
 ============
 
 Bugs in the content should be reported to the Python bug tracker at
-http://bugs.python.org.
+https://bugs.python.org.
 
 Bugs in the toolset should be reported in the Sphinx bug tracker at
-http://www.bitbucket.org/birkenfeld/sphinx/issues/.
+https://www.bitbucket.org/birkenfeld/sphinx/issues/.
 
 You can also send a mail to the Python Documentation Team at docs@python.org,
 and we will process your request as soon as possible.
diff --git a/Doc/about.rst b/Doc/about.rst
index 678168b..3ea311f 100644
--- a/Doc/about.rst
+++ b/Doc/about.rst
@@ -6,7 +6,7 @@
 These documents are generated from `reStructuredText`_ sources by `Sphinx`_, a
 document processor specifically written for the Python documentation.
 
-.. _reStructuredText: http://docutils.sf.net/rst.html
+.. _reStructuredText: http://docutils.sourceforge.net/rst.html
 .. _Sphinx: http://sphinx-doc.org/
 
 .. In the online version of these documents, you can submit comments and suggest
@@ -21,7 +21,7 @@
 
 * Fred L. Drake, Jr., the creator of the original Python documentation toolset
   and writer of much of the content;
-* the `Docutils <http://docutils.sf.net/>`_ project for creating
+* the `Docutils <http://docutils.sourceforge.net/>`_ project for creating
   reStructuredText and the Docutils suite;
 * Fredrik Lundh for his `Alternative Python Reference
   <http://effbot.org/zone/pyref.htm>`_ project from which Sphinx got many good
diff --git a/Doc/bugs.rst b/Doc/bugs.rst
index 847c010..f01ae0e 100644
--- a/Doc/bugs.rst
+++ b/Doc/bugs.rst
@@ -29,7 +29,7 @@
 ==============================
 
 Bug reports for Python itself should be submitted via the Python Bug Tracker
-(http://bugs.python.org/).  The bug tracker offers a Web form which allows
+(https://bugs.python.org/).  The bug tracker offers a Web form which allows
 pertinent information to be entered and submitted to the developers.
 
 The first step in filing a report is to determine whether the problem has
@@ -68,7 +68,7 @@
       Article which goes into some detail about how to create a useful bug report.
       This describes what kind of information is useful and why it is useful.
 
-   `Bug Writing Guidelines <http://developer.mozilla.org/en/docs/Bug_writing_guidelines>`_
+   `Bug Writing Guidelines <https://developer.mozilla.org/en-US/docs/Mozilla/QA/Bug_writing_guidelines>`_
       Information about writing a good bug report.  Some of this is specific to the
       Mozilla project, but describes general good practices.
 
@@ -82,6 +82,6 @@
 the `core-mentorship mailing list`_ is a friendly place to get answers to
 any and all questions pertaining to the process of fixing issues in Python.
 
-.. _Documentation bugs: http://bugs.python.org/issue?@filter=status&@filter=components&components=4&status=1&@columns=id,activity,title,status&@sort=-activity
-.. _Python Developer's Guide: http://docs.python.org/devguide/
+.. _Documentation bugs: https://bugs.python.org/issue?@filter=status&@filter=components&components=4&status=1&@columns=id,activity,title,status&@sort=-activity
+.. _Python Developer's Guide: https://docs.python.org/devguide/
 .. _core-mentorship mailing list: https://mail.python.org/mailman/listinfo/core-mentorship/
diff --git a/Doc/c-api/arg.rst b/Doc/c-api/arg.rst
index 28a434e..3c0f4b9 100644
--- a/Doc/c-api/arg.rst
+++ b/Doc/c-api/arg.rst
@@ -65,19 +65,20 @@
    :exc:`UnicodeError` is raised.
 
    .. note::
-      This format does not accept bytes-like objects.  If you want to accept
+      This format does not accept :term:`bytes-like objects
+      <bytes-like object>`.  If you want to accept
       filesystem paths and convert them to C character strings, it is
       preferable to use the ``O&`` format with :c:func:`PyUnicode_FSConverter`
       as *converter*.
 
-``s*`` (:class:`str`, :class:`bytes`, :class:`bytearray` or buffer compatible object) [Py_buffer]
-   This format accepts Unicode objects as well as :term:`bytes-like object`\ s.
+``s*`` (:class:`str` or :term:`bytes-like object`) [Py_buffer]
+   This format accepts Unicode objects as well as bytes-like objects.
    It fills a :c:type:`Py_buffer` structure provided by the caller.
    In this case the resulting C string may contain embedded NUL bytes.
    Unicode objects are converted to C strings using ``'utf-8'`` encoding.
 
-``s#`` (:class:`str`, :class:`bytes` or read-only buffer compatible object) [const char \*, int or :c:type:`Py_ssize_t`]
-   Like ``s*``, except that it doesn't accept mutable buffer-like objects
+``s#`` (:class:`str`, read-only :term:`bytes-like object`) [const char \*, int or :c:type:`Py_ssize_t`]
+   Like ``s*``, except that it doesn't accept mutable bytes-like objects
    such as :class:`bytearray`.  The result is stored into two C variables,
    the first one a pointer to a C string, the second one its length.
    The string may contain embedded null bytes. Unicode objects are converted
@@ -87,28 +88,28 @@
    Like ``s``, but the Python object may also be ``None``, in which case the C
    pointer is set to *NULL*.
 
-``z*`` (:class:`str`, :class:`bytes`, :class:`bytearray`, buffer compatible object or ``None``) [Py_buffer]
+``z*`` (:class:`str`, :term:`bytes-like object` or ``None``) [Py_buffer]
    Like ``s*``, but the Python object may also be ``None``, in which case the
    ``buf`` member of the :c:type:`Py_buffer` structure is set to *NULL*.
 
-``z#`` (:class:`str`, :class:`bytes`, read-only buffer compatible object or ``None``) [const char \*, int]
+``z#`` (:class:`str`, read-only :term:`bytes-like object` or ``None``) [const char \*, int]
    Like ``s#``, but the Python object may also be ``None``, in which case the C
    pointer is set to *NULL*.
 
-``y`` (:class:`bytes`) [const char \*]
+``y`` (read-only :term:`bytes-like object`) [const char \*]
    This format converts a bytes-like object to a C pointer to a character
    string; it does not accept Unicode objects.  The bytes buffer must not
    contain embedded NUL bytes; if it does, a :exc:`TypeError`
    exception is raised.
 
-``y*`` (:class:`bytes`, :class:`bytearray` or :term:`bytes-like object`) [Py_buffer]
+``y*`` (:term:`bytes-like object`) [Py_buffer]
    This variant on ``s*`` doesn't accept Unicode objects, only
-   :term:`bytes-like object`\ s.  **This is the recommended way to accept
+   bytes-like objects.  **This is the recommended way to accept
    binary data.**
 
-``y#`` (:class:`bytes`) [const char \*, int]
-   This variant on ``s#`` doesn't accept Unicode objects, only :term:`bytes-like
-   object`\ s.
+``y#`` (read-only :term:`bytes-like object`) [const char \*, int]
+   This variant on ``s#`` doesn't accept Unicode objects, only bytes-like
+   objects.
 
 ``S`` (:class:`bytes`) [PyBytesObject \*]
    Requires that the Python object is a :class:`bytes` object, without
@@ -295,6 +296,8 @@
    the object pointer is stored.  If the Python object does not have the required
    type, :exc:`TypeError` is raised.
 
+.. _o_ampersand:
+
 ``O&`` (object) [*converter*, *anything*]
    Convert a Python object to a C variable through a *converter* function.  This
    takes two arguments: the first is a function, the second is the address of a C
@@ -427,10 +430,11 @@
 
    Function used to deconstruct the argument lists of "old-style" functions ---
    these are functions which use the :const:`METH_OLDARGS` parameter parsing
-   method.  This is not recommended for use in parameter parsing in new code, and
-   most code in the standard interpreter has been modified to no longer use this
-   for that purpose.  It does remain a convenient way to decompose other tuples,
-   however, and may continue to be used for that purpose.
+   method, which has been removed in Python 3.  This is not recommended for use
+   in parameter parsing in new code, and most code in the standard interpreter
+   has been modified to no longer use this for that purpose.  It does remain a
+   convenient way to decompose other tuples, however, and may continue to be
+   used for that purpose.
 
 
 .. c:function:: int PyArg_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, ...)
diff --git a/Doc/c-api/buffer.rst b/Doc/c-api/buffer.rst
index a7de37e..e6330e7 100644
--- a/Doc/c-api/buffer.rst
+++ b/Doc/c-api/buffer.rst
@@ -198,6 +198,9 @@
       indicates that no de-referencing should occur (striding in a contiguous
       memory block).
 
+      If all suboffsets are negative (i.e. no de-referencing is needed, then
+      this field must be NULL (the default value).
+
       This type of array representation is used by the Python Imaging Library
       (PIL). See `complex arrays`_ for further information how to access elements
       of such an array.
@@ -489,8 +492,8 @@
    :c:member:`view->obj` to *NULL* and return -1;
 
    If this function is used as part of a :ref:`getbufferproc <buffer-structs>`,
-   *exporter* MUST be set to the exporting object. Otherwise, *exporter* MUST
-   be NULL.
+   *exporter* MUST be set to the exporting object and *flags* must be passed
+   unmodified. Otherwise, *exporter* MUST be NULL.
 
 
 
diff --git a/Doc/c-api/concrete.rst b/Doc/c-api/concrete.rst
index 65904ee..2d56386 100644
--- a/Doc/c-api/concrete.rst
+++ b/Doc/c-api/concrete.rst
@@ -74,26 +74,35 @@
 
 .. _mapobjects:
 
-Mapping Objects
-===============
+Container Objects
+=================
 
 .. index:: object: mapping
 
 .. toctree::
 
    dict.rst
+   set.rst
 
 
 .. _otherobjects:
 
+Function Objects
+================
+
+.. toctree::
+
+   function.rst
+   method.rst
+   cell.rst
+   code.rst
+
+
 Other Objects
 =============
 
 .. toctree::
 
-   set.rst
-   function.rst
-   method.rst
    file.rst
    module.rst
    iterator.rst
@@ -102,7 +111,6 @@
    memoryview.rst
    weakref.rst
    capsule.rst
-   cell.rst
    gen.rst
    datetime.rst
-   code.rst
+
diff --git a/Doc/c-api/dict.rst b/Doc/c-api/dict.rst
index 6bacc32..aeff640 100644
--- a/Doc/c-api/dict.rst
+++ b/Doc/c-api/dict.rst
@@ -84,7 +84,7 @@
    on failure.
 
 
-.. c:function:: int PyDict_DelItemString(PyObject *p, char *key)
+.. c:function:: int PyDict_DelItemString(PyObject *p, const char *key)
 
    Remove the entry in dictionary *p* which has a key specified by the string
    *key*.  Return ``0`` on success or ``-1`` on failure.
@@ -110,6 +110,15 @@
    :c:type:`char\*`, rather than a :c:type:`PyObject\*`.
 
 
+.. c:function:: PyObject* PyDict_SetDefault(PyObject *p, PyObject *key, PyObject *default)
+
+   This is the same as the Python-level :meth:`dict.setdefault`.  If present, it
+   returns the value corresponding to *key* from the dictionary *p*.  If the key
+   is not in the dict, it is inserted with value *defaultobj* and *defaultobj*
+   is returned.  This function evaluates the hash function of *key* only once,
+   instead of evaluating it independently for the lookup and the insertion.
+
+
 .. c:function:: PyObject* PyDict_Items(PyObject *p)
 
    Return a :c:type:`PyListObject` containing all the items from the dictionary.
@@ -192,8 +201,11 @@
 
 .. c:function:: int PyDict_Update(PyObject *a, PyObject *b)
 
-   This is the same as ``PyDict_Merge(a, b, 1)`` in C, or ``a.update(b)`` in
-   Python.  Return ``0`` on success or ``-1`` if an exception was raised.
+   This is the same as ``PyDict_Merge(a, b, 1)`` in C, and is similar to
+   ``a.update(b)`` in Python except that :c:func:`PyDict_Update` doesn't fall
+   back to the iterating over a sequence of key value pairs if the second
+   argument has no "keys" attribute.  Return ``0`` on success or ``-1`` if an
+   exception was raised.
 
 
 .. c:function:: int PyDict_MergeFromSeq2(PyObject *a, PyObject *seq2, int override)
diff --git a/Doc/c-api/exceptions.rst b/Doc/c-api/exceptions.rst
index 0aa892d..66b7752 100644
--- a/Doc/c-api/exceptions.rst
+++ b/Doc/c-api/exceptions.rst
@@ -64,7 +64,7 @@
       Do not compare the return value to a specific exception; use
       :c:func:`PyErr_ExceptionMatches` instead, shown below.  (The comparison could
       easily fail since the exception may be an instance instead of a class, in the
-      case of a class exception, or it may the a subclass of the expected exception.)
+      case of a class exception, or it may be a subclass of the expected exception.)
 
 
 .. c:function:: int PyErr_ExceptionMatches(PyObject *exc)
@@ -90,6 +90,16 @@
    the class in that case.  If the values are already normalized, nothing happens.
    The delayed normalization is implemented to improve performance.
 
+   .. note::
+
+      This function *does not* implicitly set the ``__traceback__``
+      attribute on the exception value. If setting the traceback
+      appropriately is desired, the following additional snippet is needed::
+
+         if (tb != NULL) {
+           PyException_SetTraceback(val, tb);
+         }
+
 
 .. c:function:: void PyErr_Clear()
 
@@ -226,16 +236,25 @@
 
    Similar to :c:func:`PyErr_SetFromErrno`, with the additional behavior that if
    *filenameObject* is not *NULL*, it is passed to the constructor of *type* as
-   a third parameter.  In the case of exceptions such as :exc:`IOError` and
-   :exc:`OSError`, this is used to define the :attr:`filename` attribute of the
+   a third parameter.  In the case of :exc:`OSError` exception,
+   this is used to define the :attr:`filename` attribute of the
    exception instance.
 
 
+.. c:function:: PyObject* PyErr_SetFromErrnoWithFilenameObjects(PyObject *type, PyObject *filenameObject, PyObject *filenameObject2)
+
+   Similar to :c:func:`PyErr_SetFromErrnoWithFilenameObject`, but takes a second
+   filename object, for raising errors when a function that takes two filenames
+   fails.
+
+   .. versionadded:: 3.4
+
+
 .. c:function:: PyObject* PyErr_SetFromErrnoWithFilename(PyObject *type, const char *filename)
 
    Similar to :c:func:`PyErr_SetFromErrnoWithFilenameObject`, but the filename
    is given as a C string.  *filename* is decoded from the filesystem encoding
-   (:func:`sys.getfilesystemencoding`).
+   (:func:`os.fsdecode`).
 
 
 .. c:function:: PyObject* PyErr_SetFromWindowsErr(int ierr)
@@ -256,18 +275,11 @@
    specifying the exception type to be raised. Availability: Windows.
 
 
-.. c:function:: PyObject* PyErr_SetFromWindowsErrWithFilenameObject(int ierr, PyObject *filenameObject)
-
-   Similar to :c:func:`PyErr_SetFromWindowsErr`, with the additional behavior
-   that if *filenameObject* is not *NULL*, it is passed to the constructor of
-   :exc:`WindowsError` as a third parameter.  Availability: Windows.
-
-
 .. c:function:: PyObject* PyErr_SetFromWindowsErrWithFilename(int ierr, const char *filename)
 
    Similar to :c:func:`PyErr_SetFromWindowsErrWithFilenameObject`, but the
    filename is given as a C string.  *filename* is decoded from the filesystem
-   encoding (:func:`sys.getfilesystemencoding`).  Availability: Windows.
+   encoding (:func:`os.fsdecode`).  Availability: Windows.
 
 
 .. c:function:: PyObject* PyErr_SetExcFromWindowsErrWithFilenameObject(PyObject *type, int ierr, PyObject *filename)
@@ -277,6 +289,15 @@
    Availability: Windows.
 
 
+.. c:function:: PyObject* PyErr_SetExcFromWindowsErrWithFilenameObjects(PyObject *type, int ierr, PyObject *filename, PyObject *filename2)
+
+   Similar to :c:func:`PyErr_SetExcFromWindowsErrWithFilenameObject`,
+   but accepts a second filename object.
+   Availability: Windows.
+
+   .. versionadded:: 3.4
+
+
 .. c:function:: PyObject* PyErr_SetExcFromWindowsErrWithFilename(PyObject *type, int ierr, const char *filename)
 
    Similar to :c:func:`PyErr_SetFromWindowsErrWithFilename`, with an additional
@@ -293,13 +314,20 @@
    .. versionadded:: 3.3
 
 
-.. c:function:: void PyErr_SyntaxLocationEx(char *filename, int lineno, int col_offset)
+.. c:function:: void PyErr_SyntaxLocationObject(PyObject *filename, int lineno, int col_offset)
 
    Set file, line, and offset information for the current exception.  If the
    current exception is not a :exc:`SyntaxError`, then it sets additional
    attributes, which make the exception printing subsystem think the exception
-   is a :exc:`SyntaxError`. *filename* is decoded from the filesystem encoding
-   (:func:`sys.getfilesystemencoding`).
+   is a :exc:`SyntaxError`.
+
+   .. versionadded:: 3.4
+
+
+.. c:function:: void PyErr_SyntaxLocationEx(char *filename, int lineno, int col_offset)
+
+   Like :c:func:`PyErr_SyntaxLocationObject`, but *filename* is a byte string
+   decoded from the filesystem encoding (:func:`os.fsdecode`).
 
    .. versionadded:: 3.2
 
@@ -318,7 +346,7 @@
    use.
 
 
-.. c:function:: int PyErr_WarnEx(PyObject *category, char *message, int stack_level)
+.. c:function:: int PyErr_WarnEx(PyObject *category, const char *message, Py_ssize_t stack_level)
 
    Issue a warning message.  The *category* argument is a warning category (see
    below) or *NULL*; the *message* argument is an UTF-8 encoded string.  *stack_level* is a
@@ -355,15 +383,22 @@
    documentation.  There is no C API for warning control.
 
 
-.. c:function:: int PyErr_WarnExplicit(PyObject *category, const char *message, const char *filename, int lineno, const char *module, PyObject *registry)
+.. c:function:: int PyErr_WarnExplicitObject(PyObject *category, PyObject *message, PyObject *filename, int lineno, PyObject *module, PyObject *registry)
 
    Issue a warning message with explicit control over all warning attributes.  This
    is a straightforward wrapper around the Python function
    :func:`warnings.warn_explicit`, see there for more information.  The *module*
    and *registry* arguments may be set to *NULL* to get the default effect
-   described there. *message* and *module* are UTF-8 encoded strings,
-   *filename* is decoded from the filesystem encoding
-   (:func:`sys.getfilesystemencoding`).
+   described there.
+
+   .. versionadded:: 3.4
+
+
+.. c:function:: int PyErr_WarnExplicit(PyObject *category, const char *message, const char *filename, int lineno, const char *module, PyObject *registry)
+
+   Similar to :c:func:`PyErr_WarnExplicitObject` except that *message* and
+   *module* are UTF-8 encoded strings, and *filename* is decoded from the
+   filesystem encoding (:func:`os.fsdecode`).
 
 
 .. c:function:: int PyErr_WarnFormat(PyObject *category, Py_ssize_t stack_level, const char *format, ...)
diff --git a/Doc/c-api/file.rst b/Doc/c-api/file.rst
index cc190c9..6f2ecee 100644
--- a/Doc/c-api/file.rst
+++ b/Doc/c-api/file.rst
@@ -17,7 +17,7 @@
 the :mod:`io` APIs instead.
 
 
-.. c:function:: PyFile_FromFd(int fd, char *name, char *mode, int buffering, char *encoding, char *errors, char *newline, int closefd)
+.. c:function:: PyFile_FromFd(int fd, const char *name, const char *mode, int buffering, const char *encoding, const char *errors, const char *newline, int closefd)
 
    Create a Python file object from the file descriptor of an already
    opened file *fd*.  The arguments *name*, *encoding*, *errors* and *newline*
diff --git a/Doc/c-api/import.rst b/Doc/c-api/import.rst
index 270152e..3641fc6 100644
--- a/Doc/c-api/import.rst
+++ b/Doc/c-api/import.rst
@@ -118,7 +118,7 @@
    encoded string instead of a Unicode object.
 
 
-.. c:function:: PyObject* PyImport_ExecCodeModule(char *name, PyObject *co)
+.. c:function:: PyObject* PyImport_ExecCodeModule(const char *name, PyObject *co)
 
    .. index:: builtin: compile
 
@@ -132,8 +132,14 @@
    such modules have no way to know that the module object is an unknown (and
    probably damaged with respect to the module author's intents) state.
 
+   The module's :attr:`__spec__` and :attr:`__loader__` will be set, if
+   not set already, with the appropriate values.  The spec's loader will
+   be set to the module's ``__loader__`` (if set) and to an instance of
+   :class:`SourceFileLoader` otherwise.
+
    The module's :attr:`__file__` attribute will be set to the code object's
-   :c:member:`co_filename`.
+   :c:member:`co_filename`.  If applicable, :attr:`__cached__` will also
+   be set.
 
    This function will reload the module if it was already imported.  See
    :c:func:`PyImport_ReloadModule` for the intended way to reload a module.
@@ -145,7 +151,7 @@
    :c:func:`PyImport_ExecCodeModuleWithPathnames`.
 
 
-.. c:function:: PyObject* PyImport_ExecCodeModuleEx(char *name, PyObject *co, char *pathname)
+.. c:function:: PyObject* PyImport_ExecCodeModuleEx(const char *name, PyObject *co, const char *pathname)
 
    Like :c:func:`PyImport_ExecCodeModule`, but the :attr:`__file__` attribute of
    the module object is set to *pathname* if it is non-``NULL``.
@@ -162,7 +168,7 @@
    .. versionadded:: 3.3
 
 
-.. c:function:: PyObject* PyImport_ExecCodeModuleWithPathnames(char *name, PyObject *co, char *pathname, char *cpathname)
+.. c:function:: PyObject* PyImport_ExecCodeModuleWithPathnames(const char *name, PyObject *co, const char *pathname, const char *cpathname)
 
    Like :c:func:`PyImport_ExecCodeModuleObject`, but *name*, *pathname* and
    *cpathname* are UTF-8 encoded strings. Attempts are also made to figure out
@@ -245,8 +251,11 @@
 
    .. versionadded:: 3.3
 
+   .. versionchanged:: 3.4
+      The ``__file__`` attribute is no longer set on the module.
 
-.. c:function:: int PyImport_ImportFrozenModule(char *name)
+
+.. c:function:: int PyImport_ImportFrozenModule(const char *name)
 
    Similar to :c:func:`PyImport_ImportFrozenModuleObject`, but the name is a
    UTF-8 encoded string instead of a Unicode object.
diff --git a/Doc/c-api/init.rst b/Doc/c-api/init.rst
index 4dad2c8..4d358ca 100644
--- a/Doc/c-api/init.rst
+++ b/Doc/c-api/init.rst
@@ -86,6 +86,36 @@
 =======================
 
 
+.. c:function:: int Py_SetStandardStreamEncoding(char *encoding, char *errors)
+
+   .. index::
+      single: Py_Initialize()
+      single: main()
+      triple: stdin; stdout; sdterr
+
+   This function should be called before :c:func:`Py_Initialize`, if it is
+   called at all. It specifies which encoding and error handling to use
+   with standard IO, with the same meanings as in :func:`str.encode`.
+
+   It overrides :envvar:`PYTHONIOENCODING` values, and allows embedding code
+   to control IO encoding when the environment variable does not work.
+
+   ``encoding`` and/or ``errors`` may be NULL to use
+   :envvar:`PYTHONIOENCODING` and/or default values (depending on other
+   settings).
+
+   Note that :data:`sys.stderr` always uses the "backslashreplace" error
+   handler, regardless of this (or any other) setting.
+
+   If :c:func:`Py_Finalize` is called, this function will need to be called
+   again in order to affect subsequent calls to :c:func:`Py_Initialize`.
+
+   Returns 0 if successful, a nonzero value on error (e.g. calling after the
+   interpreter has already been initialized).
+
+   .. versionadded:: 3.4
+
+
 .. c:function:: void Py_SetProgramName(wchar_t *name)
 
    .. index::
@@ -206,13 +236,18 @@
    :c:func:`Py_Initialize`, then :c:func:`Py_GetPath` won't attempt to compute a
    default search path but uses the one provided instead.  This is useful if
    Python is embedded by an application that has full knowledge of the location
-   of all modules.  The path components should be separated by semicolons.
+   of all modules.  The path components should be separated by the platform
+   dependent delimiter character, which is ``':'`` on Unix and Mac OS X, ``';'``
+   on Windows.
 
    This also causes :data:`sys.executable` to be set only to the raw program
    name (see :c:func:`Py_SetProgramName`) and for :data:`sys.prefix` and
    :data:`sys.exec_prefix` to be empty.  It is up to the caller to modify these
    if required after calling :c:func:`Py_Initialize`.
 
+   The path argument is copied internally, so the caller may free it after the
+   call completes.
+
 
 .. c:function:: const char* Py_GetVersion()
 
@@ -329,7 +364,11 @@
 
 .. c:function:: void PySys_SetArgv(int argc, wchar_t **argv)
 
-   This function works like :c:func:`PySys_SetArgvEx` with *updatepath* set to 1.
+   This function works like :c:func:`PySys_SetArgvEx` with *updatepath* set
+   to 1 unless the :program:`python` interpreter was started with the
+   :option:`-I`.
+
+   .. versionchanged:: 3.4 The *updatepath* value depends on :option:`-I`.
 
 
 .. c:function:: void Py_SetPythonHome(wchar_t *home)
@@ -658,6 +697,20 @@
    made on the main thread.  This is mainly a helper/diagnostic function.
 
 
+.. c:function:: int PyGILState_Check()
+
+   Return 1 if the current thread is holding the GIL and 0 otherwise.
+   This function can be called from any thread at any time.
+   Only if it has had its Python thread state initialized and currently is
+   holding the GIL will it return 1.
+   This is mainly a helper/diagnostic function.  It can be useful
+   for example in callback contexts or memory allocation functions when
+   knowing that the GIL is locked can allow the caller to perform sensitive
+   actions or otherwise behave differently.
+
+   .. versionadded:: 3.4
+
+
 The following macros are normally used without a trailing semicolon; look for
 example usage in the Python source distribution.
 
@@ -1129,7 +1182,7 @@
 
 .. c:function:: PyThreadState * PyInterpreterState_ThreadHead(PyInterpreterState *interp)
 
-   Return the a pointer to the first :c:type:`PyThreadState` object in the list of
+   Return the pointer to the first :c:type:`PyThreadState` object in the list of
    threads associated with the interpreter *interp*.
 
 
diff --git a/Doc/c-api/long.rst b/Doc/c-api/long.rst
index d5430fd..b348015 100644
--- a/Doc/c-api/long.rst
+++ b/Doc/c-api/long.rst
@@ -80,7 +80,7 @@
    *NULL* on failure.
 
 
-.. c:function:: PyObject* PyLong_FromString(char *str, char **pend, int base)
+.. c:function:: PyObject* PyLong_FromString(const char *str, char **pend, int base)
 
    Return a new :c:type:`PyLongObject` based on the string value in *str*, which
    is interpreted according to the radix in *base*.  If *pend* is non-*NULL*,
diff --git a/Doc/c-api/mapping.rst b/Doc/c-api/mapping.rst
index 0ef2961..2803fd0 100644
--- a/Doc/c-api/mapping.rst
+++ b/Doc/c-api/mapping.rst
@@ -22,7 +22,7 @@
    expression ``len(o)``.
 
 
-.. c:function:: int PyMapping_DelItemString(PyObject *o, char *key)
+.. c:function:: int PyMapping_DelItemString(PyObject *o, const char *key)
 
    Remove the mapping for object *key* from the object *o*. Return ``-1`` on
    failure.  This is equivalent to the Python statement ``del o[key]``.
@@ -67,13 +67,13 @@
    the Python expression ``list(o.items())``.
 
 
-.. c:function:: PyObject* PyMapping_GetItemString(PyObject *o, char *key)
+.. c:function:: PyObject* PyMapping_GetItemString(PyObject *o, const char *key)
 
    Return element of *o* corresponding to the object *key* or *NULL* on failure.
    This is the equivalent of the Python expression ``o[key]``.
 
 
-.. c:function:: int PyMapping_SetItemString(PyObject *o, char *key, PyObject *v)
+.. c:function:: int PyMapping_SetItemString(PyObject *o, const char *key, PyObject *v)
 
    Map the object *key* to the value *v* in object *o*. Returns ``-1`` on failure.
    This is the equivalent of the Python statement ``o[key] = v``.
diff --git a/Doc/c-api/memory.rst b/Doc/c-api/memory.rst
index 8afa56a..a82e1c2 100644
--- a/Doc/c-api/memory.rst
+++ b/Doc/c-api/memory.rst
@@ -84,6 +84,48 @@
 for the I/O buffer escapes completely the Python memory manager.
 
 
+Raw Memory Interface
+====================
+
+The following function sets are wrappers to the system allocator. These
+functions are thread-safe, the :term:`GIL <global interpreter lock>` does not
+need to be held.
+
+The default raw memory block allocator uses the following functions:
+:c:func:`malloc`, :c:func:`realloc` and :c:func:`free`; call ``malloc(1)`` when
+requesting zero bytes.
+
+.. versionadded:: 3.4
+
+.. c:function:: void* PyMem_RawMalloc(size_t n)
+
+   Allocates *n* bytes and returns a pointer of type :c:type:`void\*` to the
+   allocated memory, or *NULL* if the request fails. Requesting zero bytes
+   returns a distinct non-*NULL* pointer if possible, as if
+   ``PyMem_RawMalloc(1)`` had been called instead. The memory will not have
+   been initialized in any way.
+
+
+.. c:function:: void* PyMem_RawRealloc(void *p, size_t n)
+
+   Resizes the memory block pointed to by *p* to *n* bytes. The contents will
+   be unchanged to the minimum of the old and the new sizes. If *p* is *NULL*,
+   the call is equivalent to ``PyMem_RawMalloc(n)``; else if *n* is equal to
+   zero, the memory block is resized but is not freed, and the returned pointer
+   is non-*NULL*. Unless *p* is *NULL*, it must have been returned by a
+   previous call to :c:func:`PyMem_RawMalloc` or :c:func:`PyMem_RawRealloc`. If
+   the request fails, :c:func:`PyMem_RawRealloc` returns *NULL* and *p* remains
+   a valid pointer to the previous memory area.
+
+
+.. c:function:: void PyMem_RawFree(void *p)
+
+   Frees the memory block pointed to by *p*, which must have been returned by a
+   previous call to :c:func:`PyMem_RawMalloc` or :c:func:`PyMem_RawRealloc`.
+   Otherwise, or if ``PyMem_Free(p)`` has been called before, undefined
+   behavior occurs. If *p* is *NULL*, no operation is performed.
+
+
 .. _memoryinterface:
 
 Memory Interface
@@ -91,8 +133,16 @@
 
 The following function sets, modeled after the ANSI C standard, but specifying
 behavior when requesting zero bytes, are available for allocating and releasing
-memory from the Python heap:
+memory from the Python heap.
 
+The default memory block allocator uses the following functions:
+:c:func:`malloc`, :c:func:`realloc` and :c:func:`free`; call ``malloc(1)`` when
+requesting zero bytes.
+
+.. warning::
+
+   The :term:`GIL <global interpreter lock>` must be held when using these
+   functions.
 
 .. c:function:: void* PyMem_Malloc(size_t n)
 
@@ -155,6 +205,125 @@
 :c:func:`PyMem_NEW`, :c:func:`PyMem_RESIZE`, :c:func:`PyMem_DEL`.
 
 
+Customize Memory Allocators
+===========================
+
+.. versionadded:: 3.4
+
+.. c:type:: PyMemAllocator
+
+   Structure used to describe a memory block allocator. The structure has
+   four fields:
+
+   +----------------------------------------------------------+---------------------------------------+
+   | Field                                                    | Meaning                               |
+   +==========================================================+=======================================+
+   | ``void *ctx``                                            | user context passed as first argument |
+   +----------------------------------------------------------+---------------------------------------+
+   | ``void* malloc(void *ctx, size_t size)``                 | allocate a memory block               |
+   +----------------------------------------------------------+---------------------------------------+
+   | ``void* realloc(void *ctx, void *ptr, size_t new_size)`` | allocate or resize a memory block     |
+   +----------------------------------------------------------+---------------------------------------+
+   | ``void free(void *ctx, void *ptr)``                      | free a memory block                   |
+   +----------------------------------------------------------+---------------------------------------+
+
+.. c:type:: PyMemAllocatorDomain
+
+   Enum used to identify an allocator domain. Domains:
+
+   * :c:data:`PYMEM_DOMAIN_RAW`: functions :c:func:`PyMem_RawMalloc`,
+     :c:func:`PyMem_RawRealloc` and :c:func:`PyMem_RawFree`
+   * :c:data:`PYMEM_DOMAIN_MEM`: functions :c:func:`PyMem_Malloc`,
+     :c:func:`PyMem_Realloc` and :c:func:`PyMem_Free`
+   * :c:data:`PYMEM_DOMAIN_OBJ`: functions :c:func:`PyObject_Malloc`,
+     :c:func:`PyObject_Realloc` and :c:func:`PyObject_Free`
+
+
+.. c:function:: void PyMem_GetAllocator(PyMemAllocatorDomain domain, PyMemAllocator *allocator)
+
+   Get the memory block allocator of the specified domain.
+
+
+.. c:function:: void PyMem_SetAllocator(PyMemAllocatorDomain domain, PyMemAllocator *allocator)
+
+   Set the memory block allocator of the specified domain.
+
+   The new allocator must return a distinct non-NULL pointer when requesting
+   zero bytes.
+
+   For the :c:data:`PYMEM_DOMAIN_RAW` domain, the allocator must be
+   thread-safe: the :term:`GIL <global interpreter lock>` is not held when the
+   allocator is called.
+
+   If the new allocator is not a hook (does not call the previous allocator),
+   the :c:func:`PyMem_SetupDebugHooks` function must be called to reinstall the
+   debug hooks on top on the new allocator.
+
+
+.. c:function:: void PyMem_SetupDebugHooks(void)
+
+   Setup hooks to detect bugs in the following Python memory allocator
+   functions:
+
+   - :c:func:`PyMem_RawMalloc`, :c:func:`PyMem_RawRealloc`,
+     :c:func:`PyMem_RawFree`
+   - :c:func:`PyMem_Malloc`, :c:func:`PyMem_Realloc`, :c:func:`PyMem_Free`
+   - :c:func:`PyObject_Malloc`, :c:func:`PyObject_Realloc`,
+     :c:func:`PyObject_Free`
+
+   Newly allocated memory is filled with the byte ``0xCB``, freed memory is
+   filled with the byte ``0xDB``. Additionnal checks:
+
+   - detect API violations, ex: :c:func:`PyObject_Free` called on a buffer
+     allocated by :c:func:`PyMem_Malloc`
+   - detect write before the start of the buffer (buffer underflow)
+   - detect write after the end of the buffer (buffer overflow)
+
+   The function does nothing if Python is not compiled is debug mode.
+
+
+Customize PyObject Arena Allocator
+==================================
+
+Python has a *pymalloc* allocator for allocations smaller than 512 bytes. This
+allocator is optimized for small objects with a short lifetime. It uses memory
+mappings called "arenas" with a fixed size of 256 KB. It falls back to
+:c:func:`PyMem_RawMalloc` and :c:func:`PyMem_RawRealloc` for allocations larger
+than 512 bytes.  *pymalloc* is the default allocator used by
+:c:func:`PyObject_Malloc`.
+
+The default arena allocator uses the following functions:
+
+* :c:func:`VirtualAlloc` and :c:func:`VirtualFree` on Windows,
+* :c:func:`mmap` and :c:func:`munmap` if available,
+* :c:func:`malloc` and :c:func:`free` otherwise.
+
+.. versionadded:: 3.4
+
+.. c:type:: PyObjectArenaAllocator
+
+   Structure used to describe an arena allocator. The structure has
+   three fields:
+
+   +--------------------------------------------------+---------------------------------------+
+   | Field                                            | Meaning                               |
+   +==================================================+=======================================+
+   | ``void *ctx``                                    | user context passed as first argument |
+   +--------------------------------------------------+---------------------------------------+
+   | ``void* alloc(void *ctx, size_t size)``          | allocate an arena of size bytes       |
+   +--------------------------------------------------+---------------------------------------+
+   | ``void free(void *ctx, size_t size, void *ptr)`` | free an arena                         |
+   +--------------------------------------------------+---------------------------------------+
+
+.. c:function:: PyObject_GetArenaAllocator(PyObjectArenaAllocator *allocator)
+
+   Get the arena allocator.
+
+.. c:function:: PyObject_SetArenaAllocator(PyObjectArenaAllocator *allocator)
+
+   Set the arena allocator.
+
+
 .. _memoryexamples:
 
 Examples
diff --git a/Doc/c-api/module.rst b/Doc/c-api/module.rst
index bd46170..985a347 100644
--- a/Doc/c-api/module.rst
+++ b/Doc/c-api/module.rst
@@ -35,13 +35,20 @@
       single: __name__ (module attribute)
       single: __doc__ (module attribute)
       single: __file__ (module attribute)
+      single: __package__ (module attribute)
+      single: __loader__ (module attribute)
 
    Return a new module object with the :attr:`__name__` attribute set to *name*.
-   Only the module's :attr:`__doc__` and :attr:`__name__` attributes are filled in;
-   the caller is responsible for providing a :attr:`__file__` attribute.
+   The module's :attr:`__name__`, :attr:`__doc__`, :attr:`__package__`, and
+   :attr:`__loader__` attributes are filled in (all but :attr:`__name__` are set
+   to ``None``); the caller is responsible for providing a :attr:`__file__`
+   attribute.
 
    .. versionadded:: 3.3
 
+   .. versionchanged:: 3.4
+      :attr:`__package__` and :attr:`__loader__` are set to ``None``.
+
 
 .. c:function:: PyObject* PyModule_New(const char *name)
 
diff --git a/Doc/c-api/object.rst b/Doc/c-api/object.rst
index 0aba360..187ac01 100644
--- a/Doc/c-api/object.rst
+++ b/Doc/c-api/object.rst
@@ -101,7 +101,7 @@
    This is the equivalent of the Python statement ``del o.attr_name``.
 
 
-.. c:function:: PyObject* PyType_GenericGetDict(PyObject *o, void *context)
+.. c:function:: PyObject* PyObject_GenericGetDict(PyObject *o, void *context)
 
    A generic implementation for the getter of a ``__dict__`` descriptor. It
    creates the dictionary if necessary.
@@ -109,7 +109,7 @@
    .. versionadded:: 3.3
 
 
-.. c:function:: int PyType_GenericSetDict(PyObject *o, void *context)
+.. c:function:: int PyObject_GenericSetDict(PyObject *o, void *context)
 
    A generic implementation for the setter of a ``__dict__`` descriptor. This
    implementation does not allow the dictionary to be deleted.
@@ -149,6 +149,9 @@
    representation on success, *NULL* on failure.  This is the equivalent of the
    Python expression ``repr(o)``.  Called by the :func:`repr` built-in function.
 
+   .. versionchanged:: 3.4
+      This function now includes a debug assertion to help ensure that it
+      does not silently discard an active exception.
 
 .. c:function:: PyObject* PyObject_ASCII(PyObject *o)
 
@@ -170,6 +173,10 @@
    Python expression ``str(o)``.  Called by the :func:`str` built-in function
    and, therefore, by the :func:`print` function.
 
+   .. versionchanged:: 3.4
+      This function now includes a debug assertion to help ensure that it
+      does not silently discard an active exception.
+
 .. c:function:: PyObject* PyObject_Bytes(PyObject *o)
 
    .. index:: builtin: bytes
@@ -180,40 +187,45 @@
    a TypeError is raised when *o* is an integer instead of a zero-initialized
    bytes object.
 
-.. c:function:: int PyObject_IsInstance(PyObject *inst, PyObject *cls)
-
-   Returns ``1`` if *inst* is an instance of the class *cls* or a subclass of
-   *cls*, or ``0`` if not.  On error, returns ``-1`` and sets an exception.  If
-   *cls* is a type object rather than a class object, :c:func:`PyObject_IsInstance`
-   returns ``1`` if *inst* is of type *cls*.  If *cls* is a tuple, the check will
-   be done against every entry in *cls*. The result will be ``1`` when at least one
-   of the checks returns ``1``, otherwise it will be ``0``. If *inst* is not a
-   class instance and *cls* is neither a type object, nor a class object, nor a
-   tuple, *inst* must have a :attr:`~instance.__class__` attribute --- the
-   class relationship of the value of that attribute with *cls* will be used
-   to determine the result of this function.
-
-
-Subclass determination is done in a fairly straightforward way, but includes a
-wrinkle that implementors of extensions to the class system may want to be aware
-of.  If :class:`A` and :class:`B` are class objects, :class:`B` is a subclass of
-:class:`A` if it inherits from :class:`A` either directly or indirectly.  If
-either is not a class object, a more general mechanism is used to determine the
-class relationship of the two objects.  When testing if *B* is a subclass of
-*A*, if *A* is *B*, :c:func:`PyObject_IsSubclass` returns true.  If *A* and *B*
-are different objects, *B*'s :attr:`~class.__bases__` attribute is searched in
-a depth-first fashion for *A* --- the presence of the :attr:`~class.__bases__`
-attribute is considered sufficient for this determination.
-
 
 .. c:function:: int PyObject_IsSubclass(PyObject *derived, PyObject *cls)
 
-   Returns ``1`` if the class *derived* is identical to or derived from the class
-   *cls*, otherwise returns ``0``.  In case of an error, returns ``-1``. If *cls*
-   is a tuple, the check will be done against every entry in *cls*. The result will
-   be ``1`` when at least one of the checks returns ``1``, otherwise it will be
-   ``0``. If either *derived* or *cls* is not an actual class object (or tuple),
-   this function uses the generic algorithm described above.
+   Return ``1`` if the class *derived* is identical to or derived from the class
+   *cls*, otherwise return ``0``.  In case of an error, return ``-1``.
+
+   If *cls* is a tuple, the check will be done against every entry in *cls*.
+   The result will be ``1`` when at least one of the checks returns ``1``,
+   otherwise it will be ``0``.
+
+   If *cls* has a :meth:`~class.__subclasscheck__` method, it will be called to
+   determine the subclass status as described in :pep:`3119`.  Otherwise,
+   *derived* is a subclass of *cls* if it is a direct or indirect subclass,
+   i.e. contained in ``cls.__mro__``.
+
+   Normally only class objects, i.e. instances of :class:`type` or a derived
+   class, are considered classes.  However, objects can override this by haivng
+   a :attr:`__bases__` attribute (which must be a tuple of base classes).
+
+
+.. c:function:: int PyObject_IsInstance(PyObject *inst, PyObject *cls)
+
+   Return ``1`` if *inst* is an instance of the class *cls* or a subclass of
+   *cls*, or ``0`` if not.  On error, returns ``-1`` and sets an exception.
+
+   If *cls* is a tuple, the check will be done against every entry in *cls*.
+   The result will be ``1`` when at least one of the checks returns ``1``,
+   otherwise it will be ``0``.
+
+   If *cls* has a :meth:`~class.__instancecheck__` method, it will be called to
+   determine the subclass status as described in :pep:`3119`.  Otherwise, *inst*
+   is an instance of *cls* if its class is a subclass of *cls*.
+
+   An instance *inst* can override what is considered its class by having a
+   :attr:`__class__` attribute.
+
+   An object *cls* can override if it is considered a class, and what its base
+   classes are, by having a :attr:`__bases__` attribute (which must be a tuple
+   of base classes).
 
 
 .. c:function:: int PyCallable_Check(PyObject *o)
@@ -240,7 +252,7 @@
    of the Python expression ``callable_object(*args)``.
 
 
-.. c:function:: PyObject* PyObject_CallFunction(PyObject *callable, char *format, ...)
+.. c:function:: PyObject* PyObject_CallFunction(PyObject *callable, const char *format, ...)
 
    Call a callable Python object *callable*, with a variable number of C arguments.
    The C arguments are described using a :c:func:`Py_BuildValue` style format
@@ -250,8 +262,11 @@
    pass :c:type:`PyObject \*` args, :c:func:`PyObject_CallFunctionObjArgs` is a
    faster alternative.
 
+   .. versionchanged:: 3.4
+      The type of *format* was changed from ``char *``.
 
-.. c:function:: PyObject* PyObject_CallMethod(PyObject *o, char *method, char *format, ...)
+
+.. c:function:: PyObject* PyObject_CallMethod(PyObject *o, const char *method, const char *format, ...)
 
    Call the method named *method* of object *o* with a variable number of C
    arguments.  The C arguments are described by a :c:func:`Py_BuildValue` format
@@ -261,6 +276,9 @@
    Note that if you only pass :c:type:`PyObject \*` args,
    :c:func:`PyObject_CallMethodObjArgs` is a faster alternative.
 
+   .. versionchanged:: 3.4
+      The types of *method* and *format* were changed from ``char *``.
+
 
 .. c:function:: PyObject* PyObject_CallFunctionObjArgs(PyObject *callable, ..., NULL)
 
@@ -342,6 +360,16 @@
    returned.  This is the equivalent to the Python expression ``len(o)``.
 
 
+.. c:function:: Py_ssize_t PyObject_LengthHint(PyObject *o, Py_ssize_t default)
+
+   Return an estimated length for the object *o*. First try to return its
+   actual length, then an estimate using :meth:`~object.__length_hint__`, and
+   finally return the default value. On error return ``-1``. This is the
+   equivalent to the Python expression ``operator.length_hint(o, default)``.
+
+   .. versionadded:: 3.4
+
+
 .. c:function:: PyObject* PyObject_GetItem(PyObject *o, PyObject *key)
 
    Return element of *o* corresponding to the object *key* or *NULL* on failure.
diff --git a/Doc/c-api/sequence.rst b/Doc/c-api/sequence.rst
index 0297ba3..cf1e142 100644
--- a/Doc/c-api/sequence.rst
+++ b/Doc/c-api/sequence.rst
@@ -123,10 +123,10 @@
 
 .. c:function:: PyObject* PySequence_Fast(PyObject *o, const char *m)
 
-   Returns the sequence *o* as a tuple, unless it is already a tuple or list, in
-   which case *o* is returned.  Use :c:func:`PySequence_Fast_GET_ITEM` to access the
-   members of the result.  Returns *NULL* on failure.  If the object is not a
-   sequence, raises :exc:`TypeError` with *m* as the message text.
+   Return the sequence *o* as a list, unless it is already a tuple or list, in
+   which case *o* is returned.  Use :c:func:`PySequence_Fast_GET_ITEM` to access
+   the members of the result.  Returns *NULL* on failure.  If the object is not
+   a sequence, raises :exc:`TypeError` with *m* as the message text.
 
 
 .. c:function:: PyObject* PySequence_Fast_GET_ITEM(PyObject *o, Py_ssize_t i)
diff --git a/Doc/c-api/structures.rst b/Doc/c-api/structures.rst
index bb741fb..66a3443 100644
--- a/Doc/c-api/structures.rst
+++ b/Doc/c-api/structures.rst
@@ -131,7 +131,7 @@
 types, but they always return :c:type:`PyObject\*`.  If the function is not of
 the :c:type:`PyCFunction`, the compiler will require a cast in the method table.
 Even though :c:type:`PyCFunction` defines the first parameter as
-:c:type:`PyObject\*`, it is common that the method implementation uses a the
+:c:type:`PyObject\*`, it is common that the method implementation uses the
 specific C type of the *self* object.
 
 The :attr:`ml_flags` field is a bitfield which can include the following flags.
diff --git a/Doc/c-api/tuple.rst b/Doc/c-api/tuple.rst
index 184affb..3922d50 100644
--- a/Doc/c-api/tuple.rst
+++ b/Doc/c-api/tuple.rst
@@ -129,6 +129,14 @@
    Initializes a struct sequence type *type* from *desc* in place.
 
 
+.. c:function:: int PyStructSequence_InitType2(PyTypeObject *type, PyStructSequence_Desc *desc)
+
+   The same as ``PyStructSequence_InitType``, but returns ``0`` on success and ``-1`` on
+   failure.
+
+   .. versionadded:: 3.4
+
+
 .. c:type:: PyStructSequence_Desc
 
    Contains the meta information of a struct sequence type to create.
diff --git a/Doc/c-api/type.rst b/Doc/c-api/type.rst
index 5d83254..60c5e73 100644
--- a/Doc/c-api/type.rst
+++ b/Doc/c-api/type.rst
@@ -44,6 +44,7 @@
 
    .. versionadded:: 3.2
 
+
 .. c:function:: void PyType_Modified(PyTypeObject *type)
 
    Invalidate the internal lookup cache for the type and all of its
@@ -67,6 +68,11 @@
 
    Return true if *a* is a subtype of *b*.
 
+   This function only checks for actual subtypes, which means that
+   :meth:`~class.__subclasscheck__` is not called on *b*.  Call
+   :c:func:`PyObject_IsSubclass` to do the same check that :func:`issubclass`
+   would do.
+
 
 .. c:function:: PyObject* PyType_GenericAlloc(PyTypeObject *type, Py_ssize_t nitems)
 
@@ -97,3 +103,13 @@
    types. This allows the caller to reference other heap types as base types.
 
    .. versionadded:: 3.3
+
+.. c:function:: void* PyType_GetSlot(PyTypeObject *type, int slot)
+
+   Return the function pointer stored in the given slot. If the
+   result is *NULL*, this indicates that either the slot is *NULL*,
+   or that the function was called with invalid parameters.
+   Callers will typically cast the result pointer into the appropriate
+   function type.
+
+   .. versionadded:: 3.4
diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst
index f3089d0..b43622a 100644
--- a/Doc/c-api/typeobj.rst
+++ b/Doc/c-api/typeobj.rst
@@ -189,30 +189,7 @@
 
 .. c:member:: printfunc PyTypeObject.tp_print
 
-   An optional pointer to the instance print function.
-
-   The print function is only called when the instance is printed to a *real* file;
-   when it is printed to a pseudo-file (like a :class:`io.StringIO` instance), the
-   instance's :c:member:`~PyTypeObject.tp_repr` or :c:member:`~PyTypeObject.tp_str` function is called to convert it to
-   a string.  These are also called when the type's :c:member:`~PyTypeObject.tp_print` field is
-   *NULL*.  A type should never implement :c:member:`~PyTypeObject.tp_print` in a way that produces
-   different output than :c:member:`~PyTypeObject.tp_repr` or :c:member:`~PyTypeObject.tp_str` would.
-
-   The print function is called with the same signature as :c:func:`PyObject_Print`:
-   ``int tp_print(PyObject *self, FILE *file, int flags)``.  The *self* argument is
-   the instance to be printed.  The *file* argument is the stdio file to which it
-   is to be printed.  The *flags* argument is composed of flag bits. The only flag
-   bit currently defined is :const:`Py_PRINT_RAW`. When the :const:`Py_PRINT_RAW`
-   flag bit is set, the instance should be printed the same way as :c:member:`~PyTypeObject.tp_str`
-   would format it; when the :const:`Py_PRINT_RAW` flag bit is clear, the instance
-   should be printed the same way as :c:member:`~PyTypeObject.tp_repr` would format it. It should
-   return ``-1`` and set an exception condition when an error occurs.
-
-   It is possible that the :c:member:`~PyTypeObject.tp_print` field will be deprecated. In any case,
-   it is recommended not to define :c:member:`~PyTypeObject.tp_print`, but instead to rely on
-   :c:member:`~PyTypeObject.tp_repr` and :c:member:`~PyTypeObject.tp_str` for printing.
-
-   This field is inherited by subtypes.
+   Reserved slot, formerly used for print formatting in Python 2.x.
 
 
 .. c:member:: getattrfunc PyTypeObject.tp_getattr
@@ -464,6 +441,32 @@
       :const:`Py_TPFLAGS_HAVE_VERSION_TAG`.
 
 
+   .. data:: Py_TPFLAGS_LONG_SUBCLASS
+   .. data:: Py_TPFLAGS_LIST_SUBCLASS
+   .. data:: Py_TPFLAGS_TUPLE_SUBCLASS
+   .. data:: Py_TPFLAGS_BYTES_SUBCLASS
+   .. data:: Py_TPFLAGS_UNICODE_SUBCLASS
+   .. data:: Py_TPFLAGS_DICT_SUBCLASS
+   .. data:: Py_TPFLAGS_BASE_EXC_SUBCLASS
+   .. data:: Py_TPFLAGS_TYPE_SUBCLASS
+
+      These flags are used by functions such as
+      :c:func:`PyLong_Check` to quickly determine if a type is a subclass
+      of a built-in type; such specific checks are faster than a generic
+      check, like :c:func:`PyObject_IsInstance`. Custom types that inherit
+      from built-ins should have their :c:member:`~PyTypeObject.tp_flags`
+      set appropriately, or the code that interacts with such types
+      will behave differently depending on what kind of check is used.
+
+
+   .. data:: Py_TPFLAGS_HAVE_FINALIZE
+
+      This bit is set when the :c:member:`~PyTypeObject.tp_finalize` slot is present in the
+      type structure.
+
+      .. versionadded:: 3.4
+
+
 .. c:member:: char* PyTypeObject.tp_doc
 
    An optional pointer to a NUL-terminated C string giving the docstring for this
@@ -571,7 +574,9 @@
 .. c:member:: richcmpfunc PyTypeObject.tp_richcompare
 
    An optional pointer to the rich comparison function, whose signature is
-   ``PyObject *tp_richcompare(PyObject *a, PyObject *b, int op)``.
+   ``PyObject *tp_richcompare(PyObject *a, PyObject *b, int op)``. The first
+   parameter is guaranteed to be an instance of the type that is defined
+   by :c:type:`PyTypeObject`.
 
    The function should return the result of the comparison (usually ``Py_True``
    or ``Py_False``).  If the comparison is undefined, it must return
@@ -967,6 +972,47 @@
    This field is not inherited; it is calculated fresh by :c:func:`PyType_Ready`.
 
 
+.. c:member:: destructor PyTypeObject.tp_finalize
+
+   An optional pointer to an instance finalization function.  Its signature is
+   :c:type:`destructor`::
+
+      void tp_finalize(PyObject *)
+
+   If :c:member:`~PyTypeObject.tp_finalize` is set, the interpreter calls it once when
+   finalizing an instance.  It is called either from the garbage
+   collector (if the instance is part of an isolated reference cycle) or
+   just before the object is deallocated.  Either way, it is guaranteed
+   to be called before attempting to break reference cycles, ensuring
+   that it finds the object in a sane state.
+
+   :c:member:`~PyTypeObject.tp_finalize` should not mutate the current exception status;
+   therefore, a recommended way to write a non-trivial finalizer is::
+
+      static void
+      local_finalize(PyObject *self)
+      {
+          PyObject *error_type, *error_value, *error_traceback;
+
+          /* Save the current exception, if any. */
+          PyErr_Fetch(&error_type, &error_value, &error_traceback);
+
+          /* ... */
+
+          /* Restore the saved exception. */
+          PyErr_Restore(error_type, error_value, error_traceback);
+      }
+
+   For this field to be taken into account (even through inheritance),
+   you must also set the :const:`Py_TPFLAGS_HAVE_FINALIZE` flags bit.
+
+   This field is inherited by subtypes.
+
+   .. versionadded:: 3.4
+
+   .. seealso:: "Safe object finalization" (:pep:`442`)
+
+
 .. c:member:: PyObject* PyTypeObject.tp_cache
 
    Unused.  Not inherited.  Internal use only.
@@ -1150,7 +1196,8 @@
 
    This function is used by :c:func:`PySequence_Repeat` and has the same
    signature.  It is also used by the ``*`` operator, after trying numeric
-   multiplication via the :c:member:`~PyTypeObject.tp_as_number.nb_mul` slot.
+   multiplication via the :c:member:`~PyTypeObject.tp_as_number.nb_multiply`
+   slot.
 
 .. c:member:: ssizeargfunc PySequenceMethods.sq_item
 
diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst
index 3649cfb..03c284a 100644
--- a/Doc/c-api/unicode.rst
+++ b/Doc/c-api/unicode.rst
@@ -526,12 +526,23 @@
       The `"%lld"` and `"%llu"` format specifiers are only available
       when :const:`HAVE_LONG_LONG` is defined.
 
+   .. note::
+      The width formatter unit is number of characters rather than bytes.
+      The precision formatter unit is number of bytes for ``"%s"`` and
+      ``"%V"`` (if the ``PyObject*`` argument is NULL), and a number of
+      characters for ``"%A"``, ``"%U"``, ``"%S"``, ``"%R"`` and ``"%V"``
+      (if the ``PyObject*`` argument is not NULL).
+
    .. versionchanged:: 3.2
       Support for ``"%lld"`` and ``"%llu"`` added.
 
    .. versionchanged:: 3.3
       Support for ``"%li"``, ``"%lli"`` and ``"%zi"`` added.
 
+   .. versionchanged:: 3.4
+      Support width and precision formatter for ``"%s"``, ``"%A"``, ``"%U"``,
+      ``"%V"``, ``"%S"``, ``"%R"`` added.
+
 
 .. c:function:: PyObject* PyUnicode_FromFormatV(const char *format, va_list vargs)
 
@@ -545,7 +556,8 @@
    Coerce an encoded object *obj* to an Unicode object and return a reference with
    incremented refcount.
 
-   :class:`bytes`, :class:`bytearray` and other char buffer compatible objects
+   :class:`bytes`, :class:`bytearray` and other
+   :term:`bytes-like objects <bytes-like object>`
    are decoded according to the given *encoding* and using the error handling
    defined by *errors*. Both can be *NULL* to have the interface use the default
    values (see the next section for details).
@@ -1122,7 +1134,7 @@
    mark (U+FEFF). In the other two modes, no BOM mark is prepended.
 
    If *Py_UNICODE_WIDE* is not defined, surrogate pairs will be output
-   as a single codepoint.
+   as a single code point.
 
    Return *NULL* if an exception was raised by the codec.
 
@@ -1557,7 +1569,7 @@
    Unicode string.
 
 
-.. c:function:: int PyUnicode_Tailmatch(PyObject *str, PyObject *substr, \
+.. c:function:: Py_ssize_t PyUnicode_Tailmatch(PyObject *str, PyObject *substr, \
                         Py_ssize_t start, Py_ssize_t end, int direction)
 
    Return 1 if *substr* matches ``str[start:end]`` at the given tail end
@@ -1613,7 +1625,7 @@
    Compare a unicode object, *uni*, with *string* and return -1, 0, 1 for less
    than, equal, and greater than, respectively. It is best to pass only
    ASCII-encoded strings, but the function interprets the input string as
-   ISO-8859-1 if it contains non-ASCII characters".
+   ISO-8859-1 if it contains non-ASCII characters.
 
 
 .. c:function:: PyObject* PyUnicode_RichCompare(PyObject *left,  PyObject *right,  int op)
@@ -1635,7 +1647,7 @@
 .. c:function:: PyObject* PyUnicode_Format(PyObject *format, PyObject *args)
 
    Return a new string object from *format* and *args*; this is analogous to
-   ``format % args``.  The *args* argument must be a tuple.
+   ``format % args``.
 
 
 .. c:function:: int PyUnicode_Contains(PyObject *container, PyObject *element)
diff --git a/Doc/c-api/veryhigh.rst b/Doc/c-api/veryhigh.rst
index 14ef8df..f7ed4c7 100644
--- a/Doc/c-api/veryhigh.rst
+++ b/Doc/c-api/veryhigh.rst
@@ -144,6 +144,37 @@
    (:func:`sys.getfilesystemencoding`).  Returns ``0`` at EOF.
 
 
+.. c:var:: int (*PyOS_InputHook)(void)
+
+   Can be set to point to a function with the prototype
+   ``int func(void)``.  The function will be called when Python's
+   interpreter prompt is about to become idle and wait for user input
+   from the terminal.  The return value is ignored.  Overriding this
+   hook can be used to integrate the interpreter's prompt with other
+   event loops, as done in the :file:`Modules/_tkinter.c` in the
+   Python source code.
+
+
+.. c:var:: char* (*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, const char *)
+
+   Can be set to point to a function with the prototype
+   ``char *func(FILE *stdin, FILE *stdout, char *prompt)``,
+   overriding the default function used to read a single line of input
+   at the interpreter's prompt.  The function is expected to output
+   the string *prompt* if it's not *NULL*, and then read a line of
+   input from the provided standard input file, returning the
+   resulting string.  For example, The :mod:`readline` module sets
+   this hook to provide line-editing and tab-completion features.
+
+   The result must be a string allocated by :c:func:`PyMem_RawMalloc` or
+   :c:func:`PyMem_RawRealloc`, or *NULL* if an error occurred.
+
+   .. versionchanged:: 3.4
+      The result must be allocated by :c:func:`PyMem_RawMalloc` or
+      :c:func:`PyMem_RawRealloc`, instead of being allocated by
+      :c:func:`PyMem_Malloc` or :c:func:`PyMem_Realloc`.
+
+
 .. c:function:: struct _node* PyParser_SimpleParseString(const char *str, int start)
 
    This is a simplified interface to
@@ -235,16 +266,15 @@
    *optimize* set to ``-1``.
 
 
-.. c:function:: PyObject* Py_CompileStringExFlags(const char *str, const char *filename, int start, PyCompilerFlags *flags, int optimize)
+.. c:function:: PyObject* Py_CompileStringObject(const char *str, PyObject *filename, int start, PyCompilerFlags *flags, int optimize)
 
    Parse and compile the Python source code in *str*, returning the resulting code
    object.  The start token is given by *start*; this can be used to constrain the
    code which can be compiled and should be :const:`Py_eval_input`,
    :const:`Py_file_input`, or :const:`Py_single_input`.  The filename specified by
    *filename* is used to construct the code object and may appear in tracebacks or
-   :exc:`SyntaxError` exception messages, it is decoded from the filesystem
-   encoding (:func:`sys.getfilesystemencoding`).  This returns *NULL* if the
-   code cannot be parsed or compiled.
+   :exc:`SyntaxError` exception messages.  This returns *NULL* if the code
+   cannot be parsed or compiled.
 
    The integer *optimize* specifies the optimization level of the compiler; a
    value of ``-1`` selects the optimization level of the interpreter as given by
@@ -252,9 +282,16 @@
    ``__debug__`` is true), ``1`` (asserts are removed, ``__debug__`` is false)
    or ``2`` (docstrings are removed too).
 
-   .. versionadded:: 3.2
+   .. versionadded:: 3.4
 
 
+.. c:function:: PyObject* Py_CompileStringExFlags(const char *str, const char *filename, int start, PyCompilerFlags *flags, int optimize)
+
+   Like :c:func:`Py_CompileStringExFlags`, but *filename* is a byte string
+   decoded from the filesystem encoding (:func:`os.fsdecode`).
+
+   .. versionadded:: 3.2
+
 .. c:function:: PyObject* PyEval_EvalCode(PyObject *co, PyObject *globals, PyObject *locals)
 
    This is a simplified interface to :c:func:`PyEval_EvalCodeEx`, with just
@@ -285,6 +322,10 @@
    it causes an exception to immediately be thrown; this is used for the
    :meth:`~generator.throw` methods of generator objects.
 
+   .. versionchanged:: 3.4
+      This function now includes a debug assertion to help ensure that it
+      does not silently discard an active exception.
+
 
 .. c:function:: int PyEval_MergeCompilerFlags(PyCompilerFlags *cf)
 
@@ -338,4 +379,3 @@
 
    This bit can be set in *flags* to cause division operator ``/`` to be
    interpreted as "true division" according to :pep:`238`.
-
diff --git a/Doc/conf.py b/Doc/conf.py
index 5b63cad..f803de2 100644
--- a/Doc/conf.py
+++ b/Doc/conf.py
@@ -7,26 +7,18 @@
 # that aren't pickleable (module imports are okay, they're removed automatically).
 
 import sys, os, time
-sys.path.append(os.path.abspath('tools/sphinxext'))
+sys.path.append(os.path.abspath('tools/extensions'))
 
 # General configuration
 # ---------------------
 
 extensions = ['sphinx.ext.coverage', 'sphinx.ext.doctest',
               'pyspecific', 'c_annotations']
-templates_path = ['tools/sphinxext']
 
 # General substitutions.
 project = 'Python'
 copyright = '1990-%s, Python Software Foundation' % time.strftime('%Y')
 
-# The default replacements for |version| and |release|.
-#
-# The short X.Y version.
-# version = '2.6'
-# The full version, including alpha/beta/rc tags.
-# release = '2.6a0'
-
 # We look for the Include/patchlevel.h file in the current Python source tree
 # and replace the values accordingly.
 import patchlevel
@@ -38,46 +30,30 @@
 # Else, today_fmt is used as the format for a strftime call.
 today_fmt = '%B %d, %Y'
 
-# List of files that shouldn't be included in the build.
-unused_docs = [
-    'maclib/scrap',
-    'library/xmllib',
-    'library/xml.etree',
-]
-
-# Ignore .rst in Sphinx its self.
-exclude_trees = ['tools/sphinx']
-
-# Relative filename of the reference count data file.
-refcount_file = 'data/refcounts.dat'
-
-# If true, '()' will be appended to :func: etc. cross-reference text.
-add_function_parentheses = True
-
-# If true, the current module name will be prepended to all description
-# unit titles (such as .. function::).
-add_module_names = True
-
 # By default, highlight as Python 3.
 highlight_language = 'python3'
 
+# Require Sphinx 1.2 for build.
+needs_sphinx = '1.2'
+
 
 # Options for HTML output
 # -----------------------
 
+# Use our custom theme.
 html_theme = 'pydoctheme'
-html_theme_path = ['tools/sphinxext']
+html_theme_path = ['tools']
 html_theme_options = {'collapsiblesidebar': True}
 
+# Short title used e.g. for <title> HTML tags.
 html_short_title = '%s Documentation' % release
 
 # 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'
 
-# If true, SmartyPants will be used to convert quotes and dashes to
-# typographically correct entities.
-html_use_smartypants = True
+# Path to find HTML templates.
+templates_path = ['tools/templates']
 
 # Custom sidebar templates, filenames relative to this file.
 html_sidebars = {
@@ -91,10 +67,10 @@
 }
 
 # Output an OpenSearch description file.
-html_use_opensearch = 'http://docs.python.org/' + version
+html_use_opensearch = 'https://docs.python.org/' + version
 
 # Additional static files.
-html_static_path = ['tools/sphinxext/static']
+html_static_path = ['tools/static']
 
 # Output file base name for HTML help builder.
 htmlhelp_basename = 'python' + release.replace('.', '')
@@ -114,15 +90,15 @@
 
 # Grouping the document tree into LaTeX files. List of tuples
 # (source start file, target name, title, author, document class [howto/manual]).
-_stdauthor = r'Guido van Rossum\\Fred L. Drake, Jr., editor'
+_stdauthor = r'Guido van Rossum\\and the Python development team'
 latex_documents = [
     ('c-api/index', 'c-api.tex',
      'The Python/C API', _stdauthor, 'manual'),
-    ('distutils/index', 'distutils.tex',
+    ('distributing/index', 'distributing.tex',
      'Distributing Python Modules', _stdauthor, 'manual'),
     ('extending/index', 'extending.tex',
      'Extending and Embedding Python', _stdauthor, 'manual'),
-    ('install/index', 'install.tex',
+    ('installing/index', 'installing.tex',
      'Installing Python Modules', _stdauthor, 'manual'),
     ('library/index', 'library.tex',
      'The Python Library Reference', _stdauthor, 'manual'),
@@ -159,6 +135,7 @@
 # Get LaTeX to handle Unicode correctly
 latex_elements = {'inputenc': r'\usepackage[utf8x]{inputenc}', 'utf8extra': ''}
 
+
 # Options for the coverage checker
 # --------------------------------
 
@@ -194,3 +171,19 @@
 coverage_ignore_c_items = {
 #    'cfunction': [...]
 }
+
+
+# Options for the link checker
+# ----------------------------
+
+# Ignore certain URLs.
+linkcheck_ignore = [r'https://bugs.python.org/(issue)?\d+',
+                    # Ignore PEPs for now, they all have permanent redirects.
+                    r'http://www.python.org/dev/peps/pep-\d+']
+
+
+# Options for extensions
+# ----------------------
+
+# Relative filename of the reference count data file.
+refcount_file = 'data/refcounts.dat'
diff --git a/Doc/contents.rst b/Doc/contents.rst
index c0c6af3..8690de7 100644
--- a/Doc/contents.rst
+++ b/Doc/contents.rst
@@ -11,8 +11,8 @@
    library/index.rst
    extending/index.rst
    c-api/index.rst
-   distutils/index.rst
-   install/index.rst
+   distributing/index.rst
+   installing/index.rst
    howto/index.rst
    faq/index.rst
    glossary.rst
@@ -21,3 +21,11 @@
    bugs.rst
    copyright.rst
    license.rst
+
+.. to include legacy packaging docs in build
+
+.. toctree::
+   :hidden:
+
+   distutils/index.rst
+   install/index.rst
diff --git a/Doc/data/refcounts.dat b/Doc/data/refcounts.dat
index a42584c..6025617 100644
--- a/Doc/data/refcounts.dat
+++ b/Doc/data/refcounts.dat
@@ -29,7 +29,7 @@
 # reference to the item argument!
 
 # The parameter names are as they appear in the API manual, not the source
-# code. 
+# code.
 
 PyBool_FromLong:PyObject*::+1:
 PyBool_FromLong:long:v:0:
@@ -220,6 +220,11 @@
 PyDict_GetItemString:PyObject*:p:0:
 PyDict_GetItemString:const char*:key::
 
+PyDict_SetDefault:PyObject*::0:
+PyDict_SetDefault:PyObject*:p:0:
+PyDict_SetDefault:PyObject*:key:0:conditionally +1 if inserted into the dict
+PyDict_SetDefault:PyObject*:default:0:conditionally +1 if inserted into the dict
+
 PyDict_Items:PyObject*::+1:
 PyDict_Items:PyObject*:p:0:
 
@@ -503,13 +508,13 @@
 PyImport_Cleanup:void:::
 
 PyImport_ExecCodeModule:PyObject*::+1:
-PyImport_ExecCodeModule:char*:name::
+PyImport_ExecCodeModule:const char*:name::
 PyImport_ExecCodeModule:PyObject*:co:0:
 
 PyImport_ExecCodeModuleEx:PyObject*::+1:
-PyImport_ExecCodeModuleEx:char*:name::
+PyImport_ExecCodeModuleEx:const char*:name::
 PyImport_ExecCodeModuleEx:PyObject*:co:0:
-PyImport_ExecCodeModuleEx:char*:pathname::
+PyImport_ExecCodeModuleEx:const char*:pathname::
 
 PyImport_GetMagicNumber:long:::
 
@@ -519,7 +524,7 @@
 PyImport_Import:PyObject*:name:0:
 
 PyImport_ImportFrozenModule:int:::
-PyImport_ImportFrozenModule:char*:::
+PyImport_ImportFrozenModule:const char*:::
 
 PyImport_ImportModule:PyObject*::+1:
 PyImport_ImportModule:const char*:name::
@@ -668,7 +673,7 @@
 PyLong_FromUnsignedLongLong:unsigned long long:v::
 
 PyLong_FromString:PyObject*::+1:
-PyLong_FromString:char*:str::
+PyLong_FromString:const char*:str::
 PyLong_FromString:char**:pend::
 PyLong_FromString:int:base::
 
@@ -696,7 +701,7 @@
 
 PyMapping_GetItemString:PyObject*::+1:
 PyMapping_GetItemString:PyObject*:o:0:
-PyMapping_GetItemString:char*:key::
+PyMapping_GetItemString:const char*:key::
 
 PyMapping_HasKey:int:::
 PyMapping_HasKey:PyObject*:o:0:
@@ -704,7 +709,7 @@
 
 PyMapping_HasKeyString:int:::
 PyMapping_HasKeyString:PyObject*:o:0:
-PyMapping_HasKeyString:char*:key::
+PyMapping_HasKeyString:const char*:key::
 
 PyMapping_Items:PyObject*::+1:
 PyMapping_Items:PyObject*:o:0:
@@ -717,7 +722,7 @@
 
 PyMapping_SetItemString:int:::
 PyMapping_SetItemString:PyObject*:o:0:
-PyMapping_SetItemString:char*:key::
+PyMapping_SetItemString:const char*:key::
 PyMapping_SetItemString:PyObject*:v:+1:
 
 PyMapping_Values:PyObject*::+1:
@@ -730,7 +735,7 @@
 PyMarshal_ReadObjectFromFile:FILE*:file::
 
 PyMarshal_ReadObjectFromString:PyObject*::+1:
-PyMarshal_ReadObjectFromString:char*:string::
+PyMarshal_ReadObjectFromString:const char*:string::
 PyMarshal_ReadObjectFromString:int:len::
 
 PyMarshal_WriteObjectToString:PyObject*::+1:
@@ -902,7 +907,7 @@
 PyNumber_Xor:PyObject*:o1:0:
 PyNumber_Xor:PyObject*:o2:0:
 
-PyObject_AsFileDescriptor:int::: 
+PyObject_AsFileDescriptor:int:::
 PyObject_AsFileDescriptor:PyObject*:o:0:
 
 PyObject_Call:PyObject*::+1:
@@ -912,7 +917,7 @@
 
 PyObject_CallFunction:PyObject*::+1:
 PyObject_CallFunction:PyObject*:callable_object:0:
-PyObject_CallFunction:char*:format::
+PyObject_CallFunction:const char*:format::
 PyObject_CallFunction::...::
 
 PyObject_CallFunctionObjArgs:PyObject*::+1:
@@ -921,8 +926,8 @@
 
 PyObject_CallMethod:PyObject*::+1:
 PyObject_CallMethod:PyObject*:o:0:
-PyObject_CallMethod:char*:m::
-PyObject_CallMethod:char*:format::
+PyObject_CallMethod:const char*:m::
+PyObject_CallMethod:const char*:format::
 PyObject_CallMethod::...::
 
 PyObject_CallMethodObjArgs:PyObject*::+1:
diff --git a/Doc/distributing/index.rst b/Doc/distributing/index.rst
new file mode 100644
index 0000000..1774d23
--- /dev/null
+++ b/Doc/distributing/index.rst
@@ -0,0 +1,170 @@
+.. _distributing-index:
+
+###############################
+  Distributing Python Modules
+###############################
+
+:Email: distutils-sig@python.org
+
+
+As a popular open source development project, Python has an active
+supporting community of contributors and users that also make their software
+available for other Python developers to use under open source license terms.
+
+This allows Python users to share and collaborate effectively, benefiting
+from the solutions others have already created to common (and sometimes
+even rare!) problems, as well as potentially contributing their own
+solutions to the common pool.
+
+This guide covers the distribution part of the process. For a guide to
+installing other Python projects, refer to the
+:ref:`installation guide <installing-index>`.
+
+.. note::
+
+   For corporate and other institutional users, be aware that many
+   organisations have their own policies around using and contributing to
+   open source software. Please take such policies into account when making
+   use of the distribution and installation tools provided with Python.
+
+
+Key terms
+=========
+
+* the `Python Packaging Index <https://pypi.python.org/pypi>`__ is a public
+  repository of open source licensed packages made available for use by
+  other Python users
+* the `Python Packaging Authority
+  <https://packaging.python.org/en/latest/future.html>`__ are the group of
+  developers and documentation authors responsible for the maintenance and
+  evolution of the standard packaging tools and the associated metadata and
+  file format standards. They maintain a variety of tools, documentation
+  and issue trackers on both `GitHub <https://github.com/pypa>`__ and
+  `BitBucket <https://bitbucket.org/pypa/>`__.
+* :mod:`distutils` is the original build and distribution system first added
+  to the Python standard library in 1998. While direct use of :mod:`distutils`
+  is being phased out, it still laid the foundation for the current packaging
+  and distribution infrastructure, and it not only remains part of the
+  standard library, but its name lives on in other ways (such as the name
+  of the mailing list used to coordinate Python packaging standards
+  development).
+* `setuptools`_ is a (largely) drop-in replacement for :mod:`distutils` first
+  published in 2004. Its most notable addition over the unmodified
+  :mod:`distutils` tools was the ability to declare dependencies on other
+  packages. It is currently recommended as a more regularly updated
+  alternative to :mod:`distutils` that offers consistent support for more
+  recent packaging standards across a wide range of Python versions.
+* `wheel`_ (in this context) is a project that adds the ``bdist_wheel``
+  command to :mod:`distutils`/`setuptools`_. This produces a cross platform
+  binary packaging format (called "wheels" or "wheel files" and defined in
+  :pep:`427`) that allows Python libraries, even those including binary
+  extensions, to be installed on a system without needing to be built
+  locally.
+
+.. _setuptools: https://setuptools.pypa.io/en/latest/setuptools.html
+.. _wheel: http://wheel.readthedocs.org
+
+Open source licensing and collaboration
+=======================================
+
+In most parts of the world, software is automatically covered by copyright.
+This means that other developers require explicit permission to copy, use,
+modify and redistribute the software.
+
+Open source licensing is a way of explicitly granting such permission in a
+relatively consistent way, allowing developers to share and collaborate
+efficiently by making common solutions to various problems freely available.
+This leaves many developers free to spend more time focusing on the problems
+that are relatively unique to their specific situation.
+
+The distribution tools provided with Python are designed to make it
+reasonably straightforward for developers to make their own contributions
+back to that common pool of software if they choose to do so.
+
+The same distribution tools can also be used to distribute software within
+an organisation, regardless of whether that software is published as open
+source software or not.
+
+
+Installing the tools
+====================
+
+The standard library does not include build tools that support modern
+Python packaging standards, as the core development team has found that it
+is important to have standard tools that work consistently, even on older
+versions of Python.
+
+The currently recommended build and distribution tools can be installed
+by invoking the ``pip`` module at the command line::
+
+    python -m pip install setuptools wheel twine
+
+.. note::
+
+   For POSIX users (including Mac OS X and Linux users), these instructions
+   assume the use of a :term:`virtual environment`.
+
+   For Windows users, these instructions assume that the option to
+   adjust the system PATH environment variable was selected when installing
+   Python.
+
+The Python Packaging User Guide includes more details on the `currently
+recommended tools`_.
+
+.. _currently recommended tools: https://packaging.python.org/en/latest/current.html#packaging-tool-recommendations
+
+Reading the guide
+=================
+
+The Python Packaging User Guide covers the various key steps and elements
+involved in creating a project:
+
+* `Project structure`_
+* `Building and packaging the project`_
+* `Uploading the project to the Python Packaging Index`_
+
+.. _Project structure: \
+   https://packaging.python.org/en/latest/distributing.html#creating-your-own-project
+.. _Building and packaging the project: \
+   https://packaging.python.org/en/latest/distributing.html#packaging-your-project
+.. _Uploading the project to the Python Packaging Index: \
+   https://packaging.python.org/en/latest/distributing.html#uploading-your-project-to-pypi
+
+
+How do I...?
+============
+
+These are quick answers or links for some common tasks.
+
+... choose a name for my project?
+---------------------------------
+
+This isn't an easy topic, but here are a few tips:
+
+* check the Python Packaging Index to see if the name is already in use
+* check popular hosting sites like GitHub, BitBucket, etc to see if there
+  is already a project with that name
+* check what comes up in a web search for the name you're considering
+* avoid particularly common words, especially ones with multiple meanings,
+  as they can make it difficult for users to find your software when
+  searching for it
+
+
+... create and distribute binary extensions?
+--------------------------------------------
+
+This is actually quite a complex topic, with a variety of alternatives
+available depending on exactly what you're aiming to achieve. See the
+Python Packaging User Guide for more information and recommendations.
+
+.. seealso::
+
+   `Python Packaging User Guide: Binary Extensions
+   <https://packaging.python.org/en/latest/extensions.html>`__
+
+.. other topics:
+
+   Once the Development & Deployment part of PPUG is fleshed out, some of
+   those sections should be linked from new questions here (most notably,
+   we should have a question about avoiding depending on PyPI that links to
+   https://packaging.python.org/en/latest/deployment.html#pypi-mirrors-and-caches)
diff --git a/Doc/distutils/apiref.rst b/Doc/distutils/apiref.rst
index 9853f02..82bed24 100644
--- a/Doc/distutils/apiref.rst
+++ b/Doc/distutils/apiref.rst
@@ -78,7 +78,7 @@
    |                    | be built                       | :class:`distutils.core.Extension`                           |
    +--------------------+--------------------------------+-------------------------------------------------------------+
    | *classifiers*      | A list of categories for the   | a list of strings; valid classifiers are listed on `PyPI    |
-   |                    | package                        | <http://pypi.python.org/pypi?:action=list_classifiers>`_.   |
+   |                    | package                        | <https://pypi.python.org/pypi?:action=list_classifiers>`_.  |
    +--------------------+--------------------------------+-------------------------------------------------------------+
    | *distclass*        | the :class:`Distribution`      | a subclass of                                               |
    |                    | class to use                   | :class:`distutils.core.Distribution`                        |
@@ -853,17 +853,6 @@
 port of GCC (same as cygwin in no-cygwin mode).
 
 
-:mod:`distutils.emxccompiler` --- OS/2 EMX Compiler
-===================================================
-
-.. module:: distutils.emxccompiler
-   :synopsis: OS/2 EMX Compiler support
-
-
-This module provides the EMXCCompiler class, a subclass of
-:class:`UnixCCompiler` that handles the EMX port of the GNU C compiler to OS/2.
-
-
 :mod:`distutils.archive_util` ---  Archiving utilities
 ======================================================
 
@@ -975,7 +964,7 @@
 .. function:: create_tree(base_dir, files[, mode=0o777, verbose=0, dry_run=0])
 
    Create all the empty directories under *base_dir* needed to put *files* there.
-   *base_dir* is just the a name of a directory which doesn't necessarily exist
+   *base_dir* is just the name of a directory which doesn't necessarily exist
    yet; *files* is a list of filenames to be interpreted relative to *base_dir*.
    *base_dir* + the directory portion of every file in *files* will be created if
    it doesn't already exist.  *mode*, *verbose* and *dry_run* flags  are as for
@@ -1004,7 +993,7 @@
 
    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>`_.
+   <http://nfs.sourceforge.net/#section_d>`_).
 
    .. versionchanged:: 3.3.1
       NFS files are ignored.
diff --git a/Doc/distutils/builtdist.rst b/Doc/distutils/builtdist.rst
index d1ab7db..ac96c40 100644
--- a/Doc/distutils/builtdist.rst
+++ b/Doc/distutils/builtdist.rst
@@ -186,21 +186,21 @@
 +------------------------------------------+----------------------------------------------+
 | RPM :file:`.spec` file option or section | Distutils setup script option                |
 +==========================================+==============================================+
-| Name                                     | :option:`name`                               |
+| Name                                     | ``name``                                     |
 +------------------------------------------+----------------------------------------------+
-| Summary (in preamble)                    | :option:`description`                        |
+| Summary (in preamble)                    | ``description``                              |
 +------------------------------------------+----------------------------------------------+
-| Version                                  | :option:`version`                            |
+| Version                                  | ``version``                                  |
 +------------------------------------------+----------------------------------------------+
-| Vendor                                   | :option:`author` and :option:`author_email`, |
-|                                          | or  --- & :option:`maintainer` and           |
-|                                          | :option:`maintainer_email`                   |
+| Vendor                                   | ``author`` and ``author_email``,             |
+|                                          | or  --- & ``maintainer`` and                 |
+|                                          | ``maintainer_email``                         |
 +------------------------------------------+----------------------------------------------+
-| Copyright                                | :option:`license`                            |
+| Copyright                                | ``license``                                  |
 +------------------------------------------+----------------------------------------------+
-| Url                                      | :option:`url`                                |
+| Url                                      | ``url``                                      |
 +------------------------------------------+----------------------------------------------+
-| %description (section)                   | :option:`long_description`                   |
+| %description (section)                   | ``long_description``                         |
 +------------------------------------------+----------------------------------------------+
 
 Additionally, there are many options in :file:`.spec` files that don't have
@@ -211,27 +211,27 @@
 | RPM :file:`.spec` file option | :command:`bdist_rpm` option | default value           |
 | or section                    |                             |                         |
 +===============================+=============================+=========================+
-| Release                       | :option:`release`           | "1"                     |
+| Release                       | ``release``                 | "1"                     |
 +-------------------------------+-----------------------------+-------------------------+
-| Group                         | :option:`group`             | "Development/Libraries" |
+| Group                         | ``group``                   | "Development/Libraries" |
 +-------------------------------+-----------------------------+-------------------------+
-| Vendor                        | :option:`vendor`            | (see above)             |
+| Vendor                        | ``vendor``                  | (see above)             |
 +-------------------------------+-----------------------------+-------------------------+
-| Packager                      | :option:`packager`          | (none)                  |
+| Packager                      | ``packager``                | (none)                  |
 +-------------------------------+-----------------------------+-------------------------+
-| Provides                      | :option:`provides`          | (none)                  |
+| Provides                      | ``provides``                | (none)                  |
 +-------------------------------+-----------------------------+-------------------------+
-| Requires                      | :option:`requires`          | (none)                  |
+| Requires                      | ``requires``                | (none)                  |
 +-------------------------------+-----------------------------+-------------------------+
-| Conflicts                     | :option:`conflicts`         | (none)                  |
+| Conflicts                     | ``conflicts``               | (none)                  |
 +-------------------------------+-----------------------------+-------------------------+
-| Obsoletes                     | :option:`obsoletes`         | (none)                  |
+| Obsoletes                     | ``obsoletes``               | (none)                  |
 +-------------------------------+-----------------------------+-------------------------+
-| Distribution                  | :option:`distribution_name` | (none)                  |
+| Distribution                  | ``distribution_name``       | (none)                  |
 +-------------------------------+-----------------------------+-------------------------+
-| BuildRequires                 | :option:`build_requires`    | (none)                  |
+| BuildRequires                 | ``build_requires``          | (none)                  |
 +-------------------------------+-----------------------------+-------------------------+
-| Icon                          | :option:`icon`              | (none)                  |
+| Icon                          | ``icon``                    | (none)                  |
 +-------------------------------+-----------------------------+-------------------------+
 
 Obviously, supplying even a few of these options on the command-line would be
@@ -239,7 +239,8 @@
 configuration file, :file:`setup.cfg`\ ---see section :ref:`setup-config`.  If
 you distribute or package many Python module distributions, you might want to
 put options that apply to all of them in your personal Distutils configuration
-file (:file:`~/.pydistutils.cfg`).
+file (:file:`~/.pydistutils.cfg`).  If you want to temporarily disable
+this file, you can pass the :option:`--no-user-cfg` option to :file:`setup.py`.
 
 There are three steps to building a binary RPM package, all of which are
 handled automatically by the Distutils:
diff --git a/Doc/distutils/configfile.rst b/Doc/distutils/configfile.rst
index ac79671..8faffe6 100644
--- a/Doc/distutils/configfile.rst
+++ b/Doc/distutils/configfile.rst
@@ -67,7 +67,7 @@
    [...]
 
 Note that an option spelled :option:`--foo-bar` on the command-line  is spelled
-:option:`foo_bar` in configuration files.
+``foo_bar`` in configuration files.
 
 .. _distutils-build-ext-inplace:
 
@@ -114,7 +114,7 @@
                doc/
                examples/
 
-Note that the :option:`doc_files` option is simply a whitespace-separated string
+Note that the ``doc_files`` option is simply a whitespace-separated string
 split across multiple lines for readability.
 
 
diff --git a/Doc/distutils/examples.rst b/Doc/distutils/examples.rst
index 5eb654a..af9125a 100644
--- a/Doc/distutils/examples.rst
+++ b/Doc/distutils/examples.rst
@@ -11,7 +11,7 @@
 
 .. seealso::
 
-   `Distutils Cookbook <http://wiki.python.org/moin/Distutils/Cookbook>`_
+   `Distutils Cookbook <https://wiki.python.org/moin/Distutils/Cookbook>`_
       Collection of recipes showing how to achieve more control over distutils.
 
 
@@ -22,7 +22,7 @@
 
 If you're just distributing a couple of modules, especially if they don't live
 in a particular package, you can specify them individually using the
-:option:`py_modules` option in the setup script.
+``py_modules`` option in the setup script.
 
 In the simplest case, you'll have two files to worry about: a setup script and
 the single module you're distributing, :file:`foo.py` in this example::
@@ -41,12 +41,12 @@
          )
 
 Note that the name of the distribution is specified independently with the
-:option:`name` option, and there's no rule that says it has to be the same as
+``name`` option, and there's no rule that says it has to be the same as
 the name of the sole module in the distribution (although that's probably a good
 convention to follow).  However, the distribution name is used to generate
 filenames, so you should stick to letters, digits, underscores, and hyphens.
 
-Since :option:`py_modules` is a list, you can of course specify multiple
+Since ``py_modules`` is a list, you can of course specify multiple
 modules, eg. if you're distributing modules :mod:`foo` and :mod:`bar`, your
 setup might look like this::
 
@@ -130,7 +130,7 @@
          )
 
 If you want to put modules in directories not named for their package, then you
-need to use the :option:`package_dir` option again.  For example, if the
+need to use the ``package_dir`` option again.  For example, if the
 :file:`src` directory holds modules in the :mod:`foobar` package::
 
    <root>/
@@ -169,8 +169,8 @@
 
 (The empty string also stands for the current directory.)
 
-If you have sub-packages, they must be explicitly listed in :option:`packages`,
-but any entries in :option:`package_dir` automatically extend to sub-packages.
+If you have sub-packages, they must be explicitly listed in ``packages``,
+but any entries in ``package_dir`` automatically extend to sub-packages.
 (In other words, the Distutils does *not* scan your source tree, trying to
 figure out which directories correspond to Python packages by looking for
 :file:`__init__.py` files.)  Thus, if the default layout grows a sub-package::
@@ -193,17 +193,14 @@
          packages=['foobar', 'foobar.subfoo'],
          )
 
-(Again, the empty string in :option:`package_dir` stands for the current
-directory.)
-
 
 .. _single-ext:
 
 Single extension module
 =======================
 
-Extension modules are specified using the :option:`ext_modules` option.
-:option:`package_dir` has no effect on where extension source files are found;
+Extension modules are specified using the ``ext_modules`` option.
+``package_dir`` has no effect on where extension source files are found;
 it only affects the source for pure Python modules.  The simplest  case, a
 single extension module in a single C source file, is::
 
@@ -267,7 +264,7 @@
 
     desc = """\
     My description
-    =============
+    ==============
 
     This is the description of the ``foobar`` package.
     """
@@ -289,20 +286,20 @@
 
 The :func:`distutils.core.setup` function provides a command-line interface
 that allows you to query the metadata fields of a project through the
-`setup.py` script of a given project::
+``setup.py`` script of a given project::
 
     $ python setup.py --name
     distribute
 
-This call reads the `name` metadata by running the
+This call reads the ``name`` metadata by running the
 :func:`distutils.core.setup`  function. Although, when a source or binary
 distribution is created with Distutils, the metadata fields are written
 in a static file called :file:`PKG-INFO`. When a Distutils-based project is
 installed in Python, the :file:`PKG-INFO` file is copied alongside the modules
 and packages of the distribution under :file:`NAME-VERSION-pyX.X.egg-info`,
-where `NAME` is the name of the project, `VERSION` its version as defined
-in the Metadata, and `pyX.X` the major and minor version of Python like
-`2.7` or `3.2`.
+where ``NAME`` is the name of the project, ``VERSION`` its version as defined
+in the Metadata, and ``pyX.X`` the major and minor version of Python like
+``2.7`` or ``3.2``.
 
 You can read back this static file, by using the
 :class:`distutils.dist.DistributionMetadata` class and its
diff --git a/Doc/distutils/extending.rst b/Doc/distutils/extending.rst
index 5a70d03..5139c6d 100644
--- a/Doc/distutils/extending.rst
+++ b/Doc/distutils/extending.rst
@@ -61,7 +61,7 @@
 requiring modifications to the Python installation.  This is expected to allow
 third-party extensions to provide support for additional packaging systems, but
 the commands can be used for anything distutils commands can be used for.  A new
-configuration option, :option:`command_packages` (command-line option
+configuration option, ``command_packages`` (command-line option
 :option:`--command-packages`), can be used to specify additional packages to be
 searched for modules implementing commands.  Like all distutils options, this
 can be specified on the command line or in a configuration file.  This option
@@ -75,7 +75,7 @@
 packages searched for command implementations; multiple package names should be
 separated by commas.  When not specified, the search is only performed in the
 :mod:`distutils.command` package.  When :file:`setup.py` is run with the option
-:option:`--command-packages` :option:`distcmds,buildcmds`, however, the packages
+``--command-packages distcmds,buildcmds``, however, the packages
 :mod:`distutils.command`, :mod:`distcmds`, and :mod:`buildcmds` will be searched
 in that order.  New commands are expected to be implemented in modules of the
 same name as the command by classes sharing the same name.  Given the example
diff --git a/Doc/distutils/index.rst b/Doc/distutils/index.rst
index 1a6f04c..90d1c1a 100644
--- a/Doc/distutils/index.rst
+++ b/Doc/distutils/index.rst
@@ -1,8 +1,8 @@
 .. _distutils-index:
 
-###############################
-  Distributing Python Modules
-###############################
+##############################################
+  Distributing Python Modules (Legacy version)
+##############################################
 
 :Authors: Greg Ward, Anthony Baxter
 :Email: distutils-sig@python.org
diff --git a/Doc/distutils/packageindex.rst b/Doc/distutils/packageindex.rst
index dae8c54..daf9345 100644
--- a/Doc/distutils/packageindex.rst
+++ b/Doc/distutils/packageindex.rst
@@ -8,26 +8,57 @@
 The Python Package Index (PyPI)
 *******************************
 
-The `Python Package Index (PyPI)`_ holds :ref:`meta-data <meta-data>`
+The `Python Package Index (PyPI)`_ stores :ref:`meta-data <meta-data>`
 describing distributions packaged with distutils, as well as package data like
-distribution files if the package author wishes.
+distribution files if a package author wishes.
+
+Distutils provides the :command:`register` and :command:`upload` commands for
+pushing meta-data and distribution files to PyPI, respectively.  See
+:ref:`package-commands` for information on these commands.
+
+
+PyPI overview
+=============
+
+PyPI lets you submit any number of versions of your distribution to the index.
+If you alter the meta-data for a particular version, you can submit it again
+and the index will be updated.
+
+PyPI holds a record for each (name, version) combination submitted.  The first
+user to submit information for a given name is designated the Owner of that
+name.  Changes can be submitted through the :command:`register` command or
+through the web interface.  Owners can designate other users as Owners or
+Maintainers.  Maintainers can edit the package information, but not designate
+new Owners or Maintainers.
+
+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.
+
+For each version, PyPI displays a home page.  The home page is created from
+the ``long_description`` which can be submitted via the :command:`register`
+command.  See :ref:`package-display` for more information.
+
+
+.. _package-commands:
+
+Distutils commands
+==================
 
 Distutils exposes two commands for submitting package data to PyPI: the
 :ref:`register <package-register>` command for submitting meta-data to PyPI
 and the :ref:`upload <package-upload>` command for submitting distribution
-files.  Both commands read configuration data from a special file called the
-:ref:`.pypirc file <pypirc>`.  PyPI :ref:`displays a home page
-<package-display>` for each package created from the ``long_description``
-submitted by the :command:`register` command.
+files.  Both commands read configuration data from a special file called a
+:ref:`.pypirc file <pypirc>`.
 
 
 .. _package-register:
 
-Registering Packages
-====================
+The ``register`` command
+------------------------
 
 The distutils command :command:`register` is used to submit your distribution's
-meta-data to the index. It is invoked as follows::
+meta-data to an index server. It is invoked as follows::
 
     python setup.py register
 
@@ -42,7 +73,8 @@
     Your selection [default 1]:
 
 Note: if your username and password are saved locally, you will not see this
-menu.
+menu.  Also, refer to :ref:`pypirc` for how to store your credentials in a
+:file:`.pypirc` file.
 
 If you have not registered with PyPI, then you will need to do so now. You
 should choose option 2, and enter your details as required. Soon after
@@ -53,26 +85,13 @@
 prompted for your PyPI username and password, and :command:`register` will then
 submit your meta-data to the index.
 
-You may submit any number of versions of your distribution to the index. If you
-alter the meta-data for a particular version, you may submit it again and the
-index will be updated.
-
-PyPI holds a record for each (name, version) combination submitted. The first
-user to submit information for a given name is designated the Owner of that
-name. They may submit changes through the :command:`register` command or through
-the web interface. They may also designate other users as Owners or Maintainers.
-Maintainers may edit the package information, but not designate other Owners or
-Maintainers.
-
-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.
+See :ref:`package-cmdoptions` for options to the :command:`register` command.
 
 
 .. _package-upload:
 
-Uploading Packages
-==================
+The ``upload`` command
+----------------------
 
 The distutils command :command:`upload` pushes the distribution files to PyPI.
 
@@ -86,29 +105,42 @@
 invocation of :file:`setup.py`, but that only distributions named on the command
 line for the invocation including the :command:`upload` command are uploaded.
 
-The :command:`upload` command uses the username, password, and repository URL
-from the :file:`$HOME/.pypirc` file (see section :ref:`pypirc` for more on this
-file). If a :command:`register` command was previously called in the same command,
+If a :command:`register` command was previously called in the same command,
 and if the password was entered in the prompt, :command:`upload` will reuse the
-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 ``--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.
+entered password.  This is useful if you do not want to store a password in
+clear text in a :file:`.pypirc` file.
 
 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 ``--identity=name`` option.
 
-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
-``--show-response`` (which displays the full response text from the PyPI
-server for help in debugging upload problems).
+See :ref:`package-cmdoptions` for additional options to the :command:`upload`
+command.
+
+
+.. _package-cmdoptions:
+
+Additional command options
+--------------------------
+
+This section describes options common to both the :command:`register` and
+:command:`upload` commands.
+
+The ``--repository`` or ``-r`` option lets you specify a PyPI server
+different from the default.  For example::
+
+    python setup.py sdist bdist_wininst upload -r https://example.com/pypi
+
+For convenience, a name can be used in place of the URL when the
+:file:`.pypirc` file is configured to do so.  For example::
+
+    python setup.py register -r other
+
+See :ref:`pypirc` for more information on defining alternate servers.
+
+The ``--show-response`` option displays the full response text from the PyPI
+server, which is useful when debugging problems with registering and uploading.
 
 
 .. index::
@@ -117,10 +149,14 @@
 
 .. _pypirc:
 
-The .pypirc file
-================
+The ``.pypirc`` file
+--------------------
 
-The format of the :file:`.pypirc` file is as follows::
+The :command:`register` and :command:`upload` commands both check for the
+existence of a :file:`.pypirc` file at the location :file:`$HOME/.pypirc`.
+If this file exists, the command uses the username, password, and repository
+URL configured in the file.  The format of a :file:`.pypirc` file is as
+follows::
 
     [distutils]
     index-servers =
@@ -137,7 +173,7 @@
 Each section describing a repository defines three variables:
 
 - *repository*, that defines the url of the PyPI server. Defaults to
-    ``http://www.python.org/pypi``.
+    ``https://www.python.org/pypi``.
 - *username*, which is the registered username on the PyPI server.
 - *password*, that will be used to authenticate. If omitted the user
     will be prompt to type it when needed.
@@ -156,19 +192,17 @@
     password: <password>
 
     [other]
-    repository: http://example.com/pypi
+    repository: https://example.com/pypi
     username: <username>
     password: <password>
 
-:command:`register` can then be called with the -r option to point the
-repository to work with::
+This allows the :command:`register` and :command:`upload` commands to be
+called with the ``--repository`` option as described in
+:ref:`package-cmdoptions`.
 
-    python setup.py register -r http://example.com/pypi
-
-For convenience, the name of the section that describes the repository
-may also be used::
-
-    python setup.py register -r other
+Specifically, you might want to add the `PyPI Test Repository
+<https://wiki.python.org/moin/TestPyPI>`_ to your ``.pypirc`` to facilitate
+testing before doing your first upload to ``PyPI`` itself.
 
 
 .. _package-display:
@@ -210,4 +244,4 @@
 successfully.
 
 
-.. _Python Package Index (PyPI): http://pypi.python.org/
+.. _Python Package Index (PyPI): https://pypi.python.org/pypi
diff --git a/Doc/distutils/setupscript.rst b/Doc/distutils/setupscript.rst
index fbe4290..3edcf87 100644
--- a/Doc/distutils/setupscript.rst
+++ b/Doc/distutils/setupscript.rst
@@ -28,7 +28,7 @@
           description='Python Distribution Utilities',
           author='Greg Ward',
           author_email='gward@python.net',
-          url='http://www.python.org/sigs/distutils-sig/',
+          url='https://www.python.org/sigs/distutils-sig/',
           packages=['distutils', 'distutils.command'],
          )
 
@@ -62,9 +62,9 @@
 Listing whole packages
 ======================
 
-The :option:`packages` option tells the Distutils to process (build, distribute,
+The ``packages`` option tells the Distutils to process (build, distribute,
 install, etc.) all pure Python modules found in each package mentioned in the
-:option:`packages` list.  In order to do this, of course, there has to be a
+``packages`` list.  In order to do this, of course, there has to be a
 correspondence between package names and directories in the filesystem.  The
 default correspondence is the most obvious one, i.e. package :mod:`distutils` is
 found in the directory :file:`distutils` relative to the distribution root.
@@ -75,7 +75,7 @@
 Distutils will issue a warning but still process the broken package anyway.
 
 If you use a different convention to lay out your source directory, that's no
-problem: you just have to supply the :option:`package_dir` option to tell the
+problem: you just have to supply the ``package_dir`` option to tell the
 Distutils about your convention.  For example, say you keep all Python source
 under :file:`lib`, so that modules in the "root package" (i.e., not in any
 package at all) are in :file:`lib`, modules in the :mod:`foo` package are in
@@ -94,13 +94,13 @@
 
     package_dir = {'foo': 'lib'}
 
-A ``package: dir`` entry in the :option:`package_dir` dictionary implicitly
+A ``package: dir`` entry in the ``package_dir`` dictionary implicitly
 applies to all packages below *package*, so the :mod:`foo.bar` case is
 automatically handled here.  In this example, having ``packages = ['foo',
 'foo.bar']`` tells the Distutils to look for :file:`lib/__init__.py` and
-:file:`lib/bar/__init__.py`.  (Keep in mind that although :option:`package_dir`
+:file:`lib/bar/__init__.py`.  (Keep in mind that although ``package_dir``
 applies recursively, you must explicitly list all packages in
-:option:`packages`: the Distutils will *not* recursively scan your source tree
+``packages``: the Distutils will *not* recursively scan your source tree
 looking for any directory with an :file:`__init__.py` file.)
 
 
@@ -120,7 +120,7 @@
 :mod:`pkg` package.  Again, the default package/directory layout implies that
 these two modules can be found in :file:`mod1.py` and :file:`pkg/mod2.py`, and
 that :file:`pkg/__init__.py` exists as well. And again, you can override the
-package/directory correspondence using the :option:`package_dir` option.
+package/directory correspondence using the ``package_dir`` option.
 
 
 .. _describing-extensions:
@@ -138,7 +138,7 @@
 .. XXX read over this section
 
 All of this is done through another keyword argument to :func:`setup`, the
-:option:`ext_modules` option.  :option:`ext_modules` is just a list of
+``ext_modules`` option.  ``ext_modules`` is just a list of
 :class:`~distutils.core.Extension` instances, each of which describes a
 single extension module.
 Suppose your distribution includes a single extension, called :mod:`foo` and
@@ -181,7 +181,7 @@
 resulting extension lives.
 
 If you have a number of extensions all in the same package (or all under the
-same base package), use the :option:`ext_package` keyword argument to
+same base package), use the ``ext_package`` keyword argument to
 :func:`setup`.  For example, ::
 
     setup(...,
@@ -336,24 +336,24 @@
 
 There are still some other options which can be used to handle special cases.
 
-The :option:`optional` option is a boolean; if it is true,
+The ``optional`` option is a boolean; if it is true,
 a build failure in the extension will not abort the build process, but
 instead simply not install the failing extension.
 
-The :option:`extra_objects` option is a list of object files to be passed to the
+The ``extra_objects`` option is a list of object files to be passed to the
 linker. These files must not have extensions, as the default extension for the
 compiler is used.
 
-:option:`extra_compile_args` and :option:`extra_link_args` can be used to
+``extra_compile_args`` and ``extra_link_args`` can be used to
 specify additional command line options for the respective compiler and linker
 command lines.
 
-:option:`export_symbols` is only useful on Windows.  It can contain a list of
+``export_symbols`` is only useful on Windows.  It can contain a list of
 symbols (functions or variables) to be exported. This option is not needed when
 building compiled extensions: Distutils  will automatically add ``initmodule``
 to the list of exported symbols.
 
-The :option:`depends` option is a list of files that the extension depends on
+The ``depends`` option is a list of files that the extension depends on
 (for example header files). The build command will call the compiler on the
 sources to rebuild extension if any on this files has been modified since the
 previous build.
@@ -449,7 +449,7 @@
 the current interpreter location.  The :option:`--executable` (or :option:`-e`)
 option will allow the interpreter path to be explicitly overridden.
 
-The :option:`scripts` option simply is a list of files to be handled in this
+The ``scripts`` option simply is a list of files to be handled in this
 way.  From the PyXML setup script::
 
     setup(...,
@@ -514,11 +514,11 @@
 Installing Additional Files
 ===========================
 
-The :option:`data_files` option can be used to specify additional files needed
+The ``data_files`` option can be used to specify additional files needed
 by the module distribution: configuration files, message catalogs, data files,
 anything which doesn't fit in the previous categories.
 
-:option:`data_files` specifies a sequence of (*directory*, *files*) pairs in the
+``data_files`` specifies a sequence of (*directory*, *files*) pairs in the
 following way::
 
     setup(...,
@@ -539,7 +539,7 @@
 directory information from *files* is used to determine the final location of
 the installed file; only the name of the file is used.
 
-You can specify the :option:`data_files` options as a simple sequence of files
+You can specify the ``data_files`` options as a simple sequence of files
 without specifying a target directory, but this is not recommended, and the
 :command:`install` command will print a warning in this case. To install data
 files directly in the target directory, an empty string should be given as the
@@ -609,7 +609,7 @@
 (4)
     These fields should not be used if your package is to be compatible with Python
     versions prior to 2.2.3 or 2.3.  The list is available from the `PyPI website
-    <http://pypi.python.org/pypi>`_.
+    <https://pypi.python.org/pypi>`_.
 
 (5)
     The ``long_description`` field is used by PyPI when you are
@@ -628,7 +628,7 @@
 
 'long string'
     Multiple lines of plain text in reStructuredText format (see
-    http://docutils.sf.net/).
+    http://docutils.sourceforge.net/).
 
 'list of strings'
     See below.
@@ -650,7 +650,7 @@
 1.0.1a2
     the second alpha release of the first patch version of 1.0
 
-:option:`classifiers` are specified in a Python list::
+``classifiers`` are specified in a Python list::
 
     setup(...,
           classifiers=[
diff --git a/Doc/distutils/sourcedist.rst b/Doc/distutils/sourcedist.rst
index 1666436..b9f0cc8 100644
--- a/Doc/distutils/sourcedist.rst
+++ b/Doc/distutils/sourcedist.rst
@@ -26,16 +26,16 @@
 +===========+=========================+=========+
 | ``zip``   | zip file (:file:`.zip`) | (1),(3) |
 +-----------+-------------------------+---------+
-| ``gztar`` | gzip'ed tar file        | (2),(4) |
+| ``gztar`` | gzip'ed tar file        | \(2)    |
 |           | (:file:`.tar.gz`)       |         |
 +-----------+-------------------------+---------+
-| ``bztar`` | bzip2'ed tar file       | \(4)    |
+| ``bztar`` | bzip2'ed tar file       |         |
 |           | (:file:`.tar.bz2`)      |         |
 +-----------+-------------------------+---------+
 | ``ztar``  | compressed tar file     | \(4)    |
 |           | (:file:`.tar.Z`)        |         |
 +-----------+-------------------------+---------+
-| ``tar``   | tar file (:file:`.tar`) | \(4)    |
+| ``tar``   | tar file (:file:`.tar`) |         |
 +-----------+-------------------------+---------+
 
 Notes:
@@ -51,8 +51,16 @@
    of the standard Python library since Python 1.6)
 
 (4)
-   requires external utilities: :program:`tar` and possibly one of :program:`gzip`,
-   :program:`bzip2`, or :program:`compress`
+   requires the :program:`compress` program. Notice that this format is now
+   pending for deprecation and will be removed in the future versions of Python.
+
+When using any ``tar`` format (``gztar``, ``bztar``, ``ztar`` or
+``tar``), under Unix you can specify the ``owner`` and ``group`` names
+that will be set for each member of the archive.
+
+For example, if you want all files of the archive to be owned by root::
+
+    python setup.py sdist --owner=root --group=root
 
 
 .. _manifest:
@@ -64,16 +72,16 @@
 generate one), the :command:`sdist` command puts a minimal default set into the
 source distribution:
 
-* all Python source files implied by the :option:`py_modules` and
-  :option:`packages` options
+* all Python source files implied by the ``py_modules`` and
+  ``packages`` options
 
-* all C source files mentioned in the :option:`ext_modules` or
-  :option:`libraries` options (
+* all C source files mentioned in the ``ext_modules`` or
+  ``libraries`` options
 
   .. XXX getting C library sources currently broken---no
          :meth:`get_source_files` method in :file:`build_clib.py`!
 
-* scripts identified by the :option:`scripts` option
+* scripts identified by the ``scripts`` option
   See :ref:`distutils-installing-scripts`.
 
 * anything that looks like a test script: :file:`test/test\*.py` (currently, the
@@ -159,7 +167,7 @@
 
 #. include all Python source files in the :file:`distutils` and
    :file:`distutils/command` subdirectories (because packages corresponding to
-   those two directories were mentioned in the :option:`packages` option in the
+   those two directories were mentioned in the ``packages`` option in the
    setup script---see section :ref:`setup-script`)
 
 #. include :file:`README.txt`, :file:`setup.py`, and :file:`setup.cfg` (standard
diff --git a/Doc/extending/building.rst b/Doc/extending/building.rst
index 08b0cc2..06d3005 100644
--- a/Doc/extending/building.rst
+++ b/Doc/extending/building.rst
@@ -81,7 +81,7 @@
           description = 'This is a demo package',
           author = 'Martin v. Loewis',
           author_email = 'martin@v.loewis.de',
-          url = 'http://docs.python.org/extending/building',
+          url = 'https://docs.python.org/extending/building',
           long_description = '''
    This is really just a demo package.
    ''',
diff --git a/Doc/extending/embedding.rst b/Doc/extending/embedding.rst
index bd66086..6cb686a 100644
--- a/Doc/extending/embedding.rst
+++ b/Doc/extending/embedding.rst
@@ -285,14 +285,14 @@
 * ``pythonX.Y-config --cflags`` will give you the recommended flags when
   compiling::
 
-   $ /opt/bin/python3.3-config --cflags
-   -I/opt/include/python3.3m -I/opt/include/python3.3m -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes
+   $ /opt/bin/python3.4-config --cflags
+   -I/opt/include/python3.4m -I/opt/include/python3.4m -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes
 
 * ``pythonX.Y-config --ldflags`` will give you the recommended flags when
   linking::
 
-   $ /opt/bin/python3.3-config --ldflags
-   -L/opt/lib/python3.3/config-3.3m -lpthread -ldl -lutil -lm -lpython3.3m -Xlinker -export-dynamic
+   $ /opt/bin/python3.4-config --ldflags
+   -L/opt/lib/python3.4/config-3.4m -lpthread -ldl -lutil -lm -lpython3.4m -Xlinker -export-dynamic
 
 .. note::
    To avoid confusion between several Python installations (and especially
diff --git a/Doc/extending/extending.rst b/Doc/extending/extending.rst
index a3bf265..c10efa9 100644
--- a/Doc/extending/extending.rst
+++ b/Doc/extending/extending.rst
@@ -20,12 +20,17 @@
 The compilation of an extension module depends on its intended use as well as on
 your system setup; details are given in later chapters.
 
-Do note that if your use case is calling C library functions or system calls,
-you should consider using the :mod:`ctypes` module rather than writing custom
-C code. Not only does :mod:`ctypes` let you write Python code to interface
-with C code, but it is more portable between implementations of Python than
-writing and compiling an extension module which typically ties you to CPython.
+.. note::
 
+   The C extension interface is specific to CPython, and extension modules do
+   not work on other Python implementations.  In many cases, it is possible to
+   avoid writing C extensions and preserve portability to other implementations.
+   For example, if your use case is calling C library functions or system calls,
+   you should consider using the :mod:`ctypes` module or the `cffi
+   <http://cffi.readthedocs.org>`_ library rather than writing custom C code.
+   These modules let you write Python code to interface with C code and are more
+   portable between implementations of Python than writing and compiling a C
+   extension module.
 
 
 .. _extending-simpleexample:
@@ -857,11 +862,8 @@
 from the objects in the cycle, even though there are no further references to
 the cycle itself.
 
-The cycle detector is able to detect garbage cycles and can reclaim them so long
-as there are no finalizers implemented in Python (:meth:`__del__` methods).
-When there are such finalizers, the detector exposes the cycles through the
-:mod:`gc` module (specifically, the :attr:`~gc.garbage` variable in that module).
-The :mod:`gc` module also exposes a way to run the detector (the
+The cycle detector is able to detect garbage cycles and can reclaim them.
+The :mod:`gc` module exposes a way to run the detector (the
 :func:`~gc.collect` function), as well as configuration
 interfaces and the ability to disable the detector at runtime.  The cycle
 detector is considered an optional component; though it is included by default,
diff --git a/Doc/extending/index.rst b/Doc/extending/index.rst
index 44a7f92..dd43926 100644
--- a/Doc/extending/index.rst
+++ b/Doc/extending/index.rst
@@ -21,14 +21,31 @@
 For a detailed description of the whole Python/C API, see the separate
 :ref:`c-api-index`.
 
-.. note::
 
-   This guide only covers the basic tools for creating extensions provided
-   as part of this version of CPython. Third party tools may offer simpler
-   alternatives. Refer to the `binary extensions section
-   <https://python-packaging-user-guide.readthedocs.org/en/latest/extensions.html>`__
-   in the Python Packaging User Guide for more information.
+Recommended third party tools
+=============================
 
+This guide only covers the basic tools for creating extensions provided
+as part of this version of CPython. Third party tools like Cython,
+``cffi``, SWIG and Numba offer both simpler and more sophisticated
+approaches to creating C and C++ extensions for Python.
+
+.. seealso::
+
+   `Python Packaging User Guide: Binary Extensions <https://packaging.python.org/en/latest/extensions.html>`_
+      The Python Packaging User Guide not only covers several available
+      tools that simplify the creation of binary extensions, but also
+      discusses the various reasons why creating an extension module may be
+      desirable in the first place.
+
+
+Creating extensions without third party tools
+=============================================
+
+This section of the guide covers creating C and C++ extensions without
+assistance from third party tools. It is intended primarily for creators
+of those tools, rather than being a recommended way to create your own
+C extensions.
 
 .. toctree::
    :maxdepth: 2
@@ -38,4 +55,17 @@
    newtypes.rst
    building.rst
    windows.rst
+
+Embedding the CPython runtime in a larger application
+=====================================================
+
+Sometimes, rather than creating an extension that runs inside the Python
+interpreter as the main application, it is desirable to instead embed
+the CPython runtime inside a larger application. This section covers
+some of the details involved in doing that successfully.
+
+.. toctree::
+   :maxdepth: 2
+   :numbered:
+
    embedding.rst
diff --git a/Doc/extending/newtypes.rst b/Doc/extending/newtypes.rst
index f484ba4..45b5721 100644
--- a/Doc/extending/newtypes.rst
+++ b/Doc/extending/newtypes.rst
@@ -157,7 +157,8 @@
    Py_TPFLAGS_DEFAULT,        /* tp_flags */
 
 All types should include this constant in their flags.  It enables all of the
-members defined by the current version of Python.
+members defined until at least Python 3.3.  If you need further members,
+you will need to OR the corresponding flags.
 
 We provide a doc string for the type in :c:member:`~PyTypeObject.tp_doc`. ::
 
@@ -928,8 +929,9 @@
 
 This function is called when the reference count of the instance of your type is
 reduced to zero and the Python interpreter wants to reclaim it.  If your type
-has memory to free or other clean-up to perform, put it here.  The object itself
-needs to be freed here as well.  Here is an example of this function::
+has memory to free or other clean-up to perform, you can put it here.  The
+object itself needs to be freed here as well.  Here is an example of this
+function::
 
    static void
    newdatatype_dealloc(newdatatypeobject * obj)
@@ -980,6 +982,22 @@
        Py_TYPE(obj)->tp_free((PyObject*)self);
    }
 
+.. note::
+   There are limitations to what you can safely do in a deallocator function.
+   First, if your type supports garbage collection (using :c:member:`~PyTypeObject.tp_traverse`
+   and/or :c:member:`~PyTypeObject.tp_clear`), some of the object's members can have been
+   cleared or finalized by the time :c:member:`~PyTypeObject.tp_dealloc` is called.  Second, in
+   :c:member:`~PyTypeObject.tp_dealloc`, your object is in an unstable state: its reference
+   count is equal to zero.  Any call to a non-trivial object or API (as in the
+   example above) might end up calling :c:member:`~PyTypeObject.tp_dealloc` again, causing a
+   double free and a crash.
+
+   Starting with Python 3.4, it is recommended not to put any complex
+   finalization code in :c:member:`~PyTypeObject.tp_dealloc`, and instead use the new
+   :c:member:`~PyTypeObject.tp_finalize` type method.
+
+   .. seealso::
+      :pep:`442` explains the new finalization scheme.
 
 .. index::
    single: string; object representation
diff --git a/Doc/faq/design.rst b/Doc/faq/design.rst
index 49e0c6d..9fdf8cb 100644
--- a/Doc/faq/design.rst
+++ b/Doc/faq/design.rst
@@ -49,7 +49,7 @@
 Users are often surprised by results like this::
 
     >>> 1.2 - 1.0
-    0.199999999999999996
+    0.19999999999999996
 
 and think it is a bug in Python.  It's not.  This has little to do with Python,
 and much more to do with how the underlying platform handles floating-point
@@ -368,9 +368,9 @@
 
 Practical answer:
 
-`Cython <http://cython.org/>`_ and `Pyrex <http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/>`_
+`Cython <http://cython.org/>`_ and `Pyrex <http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/>`_
 compile a modified version of Python with optional annotations into C
-extensions.  `Weave <http://www.scipy.org/Weave>`_ makes it easy to
+extensions.  `Weave <http://docs.scipy.org/doc/scipy-dev/reference/tutorial/weave.html>`_ makes it easy to
 intermingle Python and C code in various ways to increase performance.
 `Nuitka <http://www.nuitka.net/>`_ is an up-and-coming compiler of Python
 into C++ code, aiming to support the full Python language.
@@ -386,13 +386,13 @@
 operations like ``x+1``.
 
 Several projects described in the Python newsgroup or at past `Python
-conferences <http://python.org/community/workshops/>`_ have shown that this
+conferences <https://www.python.org/community/workshops/>`_ have shown that this
 approach is feasible, although the speedups reached so far are only modest
 (e.g. 2x).  Jython 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 proceedings
 from the `1997 Python conference
-<http://python.org/workshops/1997-10/proceedings/>`_ for more information.)
+<http://legacy.python.org/workshops/1997-10/proceedings/>`_ for more information.)
 
 
 How does Python manage memory?
@@ -664,62 +664,6 @@
 sloppy and not write test cases at all.
 
 
-Why are default values shared between objects?
-----------------------------------------------
-
-This type of bug commonly bites neophyte programmers.  Consider this function::
-
-   def foo(mydict={}):  # Danger: shared reference to one dict for all calls
-       ... compute something ...
-       mydict[key] = value
-       return mydict
-
-The first time you call this function, ``mydict`` contains a single item.  The
-second time, ``mydict`` contains two items because when ``foo()`` begins
-executing, ``mydict`` starts out with an item already in it.
-
-It is often expected that a function call creates new objects for default
-values. This is not what happens. Default values are created exactly once, when
-the function is defined.  If that object is changed, like the dictionary in this
-example, subsequent calls to the function will refer to this changed object.
-
-By definition, immutable objects such as numbers, strings, tuples, and ``None``,
-are safe from change. Changes to mutable objects such as dictionaries, lists,
-and class instances can lead to confusion.
-
-Because of this feature, it is good programming practice to not use mutable
-objects as default values.  Instead, use ``None`` as the default value and
-inside the function, check if the parameter is ``None`` and create a new
-list/dictionary/whatever if it is.  For example, don't write::
-
-   def foo(mydict={}):
-       ...
-
-but::
-
-   def foo(mydict=None):
-       if mydict is None:
-           mydict = {}  # create a new dict for local namespace
-
-This feature can be useful.  When you have a function that's time-consuming to
-compute, a common technique is to cache the parameters and the resulting value
-of each call to the function, and return the cached value if the same value is
-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={}):
-       if (arg1, arg2) in _cache:
-           return _cache[(arg1, arg2)]
-
-       # Calculate the value
-       result = ... expensive computation ...
-       _cache[(arg1, arg2)] = result           # Store result in the cache
-       return result
-
-You could use a global variable containing a dictionary instead of the default
-value; it's a matter of taste.
-
-
 Why is there no goto?
 ---------------------
 
diff --git a/Doc/faq/extending.rst b/Doc/faq/extending.rst
index a9a234b..02bba59 100644
--- a/Doc/faq/extending.rst
+++ b/Doc/faq/extending.rst
@@ -42,7 +42,7 @@
 .. XXX make sure these all work
 
 `Cython <http://cython.org>`_ and its relative `Pyrex
-<http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/>`_ are compilers
+<http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/>`_ are compilers
 that accept a slightly modified form of Python and generate the corresponding
 C code.  Cython and Pyrex make it possible to write an extension without having
 to learn Python's C API.
@@ -50,11 +50,11 @@
 If you need to interface to some C or C++ library for which no Python extension
 currently exists, you can try wrapping the library's data types and functions
 with a tool such as `SWIG <http://www.swig.org>`_.  `SIP
-<http://www.riverbankcomputing.co.uk/software/sip/>`__, `CXX
+<http://www.riverbankcomputing.co.uk/software/sip/intro>`__, `CXX
 <http://cxx.sourceforge.net/>`_ `Boost
 <http://www.boost.org/libs/python/doc/index.html>`_, or `Weave
-<http://www.scipy.org/Weave>`_ are also alternatives for wrapping
-C++ libraries.
+<http://docs.scipy.org/doc/scipy-dev/reference/tutorial/weave.html>`_ are also
+alternatives for wrapping C++ libraries.
 
 
 How can I execute arbitrary Python statements from C?
@@ -95,8 +95,8 @@
 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 interfacing with any kind of Python sequence using calls
-like :c:func:`PySequence_Length`, :c:func:`PySequence_GetItem`, etc.) as well
-as many other useful protocols such as numbers (:c:func:`PyNumber_Index` et.
+like :c:func:`PySequence_Length`, :c:func:`PySequence_GetItem`, etc. as well
+as many other useful protocols such as numbers (:c:func:`PyNumber_Index` et
 al.) and mappings in the PyMapping APIs.
 
 
diff --git a/Doc/faq/general.rst b/Doc/faq/general.rst
index 6f4733f..e3ea962 100644
--- a/Doc/faq/general.rst
+++ b/Doc/faq/general.rst
@@ -25,7 +25,7 @@
 Windows 2000 and later.
 
 To find out more, start with :ref:`tutorial-index`.  The `Beginner's Guide to
-Python <http://wiki.python.org/moin/BeginnersGuide>`_ links to other
+Python <https://wiki.python.org/moin/BeginnersGuide>`_ links to other
 introductory tutorials and resources for learning Python.
 
 
@@ -36,11 +36,11 @@
 holds the copyright on Python versions 2.1 and newer.  The PSF's mission is to
 advance open source technology related to the Python programming language and to
 publicize the use of Python.  The PSF's home page is at
-http://www.python.org/psf/.
+https://www.python.org/psf/.
 
 Donations to the PSF are tax-exempt in the US.  If you use Python and find it
 helpful, please contribute via `the PSF donation page
-<http://www.python.org/psf/donations/>`_.
+<https://www.python.org/psf/donations/>`_.
 
 
 Are there copyright restrictions on the use of Python?
@@ -53,12 +53,12 @@
 unmodified), or to sell products that incorporate Python in some form.  We would
 still like to know about all commercial use of Python, of course.
 
-See `the PSF license page <http://python.org/psf/license/>`_ to find further
+See `the PSF license page <https://docs.python.org/3/license/>`_ to find further
 explanations and a link to the full text of the license.
 
 The Python logo is trademarked, and in certain cases permission is required to
 use it.  Consult `the Trademark Usage Policy
-<http://www.python.org/psf/trademarks/>`__ for more information.
+<https://www.python.org/psf/trademarks/>`__ for more information.
 
 
 Why was Python created in the first place?
@@ -117,7 +117,7 @@
 Python code), and operating system interfaces (system calls, filesystems, TCP/IP
 sockets).  Look at the table of contents for :ref:`library-index` to get an idea
 of what's available.  A wide variety of third-party extensions are also
-available.  Consult `the Python Package Index <http://pypi.python.org/pypi>`_ to
+available.  Consult `the Python Package Index <https://pypi.python.org/pypi>`_ to
 find packages of interest to you.
 
 
@@ -159,15 +159,16 @@
 --------------------------------------------
 
 The latest Python source distribution is always available from python.org, at
-http://www.python.org/download/.  The latest development sources can be obtained
-via anonymous Mercurial access at http://hg.python.org/cpython.
+https://www.python.org/download/.  The latest development sources can be obtained
+via anonymous Mercurial access at https://hg.python.org/cpython.
 
 The source distribution is a gzipped tar file containing the complete C source,
 Sphinx-formatted documentation, Python library modules, example programs, and
 several useful pieces of freely distributable software.  The source will compile
 and run out of the box on most UNIX platforms.
 
-Consult the `Developer FAQ <http://docs.python.org/devguide/faq>`__ for more
+Consult the `Getting Started section of the Python Developer's Guide
+<https://docs.python.org/devguide/setup.html>`__ for more
 information on getting the source code and compiling it.
 
 
@@ -177,8 +178,8 @@
 .. XXX mention py3k
 
 The standard documentation for the current stable version of Python is available
-at http://docs.python.org/.  PDF, plain text, and downloadable HTML versions are
-also available at http://docs.python.org/download.html.
+at https://docs.python.org/3/.  PDF, plain text, and downloadable HTML versions are
+also available at https://docs.python.org/3/download.html.
 
 The documentation is written in reStructuredText and processed by `the Sphinx
 documentation tool <http://sphinx-doc.org/>`__.  The reStructuredText source for
@@ -191,7 +192,7 @@
 There are numerous tutorials and books available.  The standard documentation
 includes :ref:`tutorial-index`.
 
-Consult `the Beginner's Guide <http://wiki.python.org/moin/BeginnersGuide>`_ to
+Consult `the Beginner's Guide <https://wiki.python.org/moin/BeginnersGuide>`_ to
 find information for beginning Python programmers, including lists of tutorials.
 
 
@@ -199,7 +200,7 @@
 -------------------------------------------------------
 
 There is a newsgroup, :newsgroup:`comp.lang.python`, and a mailing list,
-`python-list <http://mail.python.org/mailman/listinfo/python-list>`_.  The
+`python-list <https://mail.python.org/mailman/listinfo/python-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.
 :newsgroup:`comp.lang.python` is high-traffic, receiving hundreds of postings
@@ -208,38 +209,38 @@
 Announcements of new software releases and events can be found in
 comp.lang.python.announce, a low-traffic moderated list that receives about five
 postings per day.  It's available as `the python-announce mailing list
-<http://mail.python.org/mailman/listinfo/python-announce-list>`_.
+<https://mail.python.org/mailman/listinfo/python-announce-list>`_.
 
 More info about other mailing lists and newsgroups
-can be found at http://www.python.org/community/lists/.
+can be found at https://www.python.org/community/lists/.
 
 
 How do I get a beta test version of Python?
 -------------------------------------------
 
-Alpha and beta releases are available from http://www.python.org/download/.  All
+Alpha and beta releases are available from https://www.python.org/download/.  All
 releases are announced on the comp.lang.python and comp.lang.python.announce
-newsgroups and on the Python home page at http://www.python.org/; an RSS feed of
+newsgroups and on the Python home page at https://www.python.org/; an RSS feed of
 news is available.
 
-You can also access the development version of Python through Subversion.  See
-http://docs.python.org/devguide/faq for details.
+You can also access the development version of Python through Mercurial.  See
+https://docs.python.org/devguide/faq.html for details.
 
 
 How do I submit bug reports and patches for Python?
 ---------------------------------------------------
 
 To report a bug or submit a patch, please use the Roundup installation at
-http://bugs.python.org/.
+https://bugs.python.org/.
 
 You must have a Roundup account to report bugs; this makes it possible for us to
 contact you if we have follow-up questions.  It will also enable Roundup to send
 you updates as we act on your bug. If you had previously used SourceForge to
 report bugs to Python, you can obtain your Roundup password through Roundup's
-`password reset procedure <http://bugs.python.org/user?@template=forgotten>`_.
+`password reset procedure <https://bugs.python.org/user?@template=forgotten>`_.
 
 For more information on how Python is developed, consult `the Python Developer's
-Guide <http://docs.python.org/devguide/>`_.
+Guide <https://docs.python.org/devguide/>`_.
 
 
 Are there any published articles about Python that I can reference?
@@ -259,7 +260,7 @@
 ------------------------------
 
 Yes, there are many, and more are being published.  See the python.org wiki at
-http://wiki.python.org/moin/PythonBooks for a list.
+https://wiki.python.org/moin/PythonBooks for a list.
 
 You can also search online bookstores for "Python" and filter out the Monty
 Python references; or perhaps search for "Python" and "language".
@@ -269,11 +270,12 @@
 ---------------------------------------------
 
 The Python project's infrastructure is located all over the world.
-`www.python.org <http://www.python.org>`_ is currently in Amsterdam, graciously
-hosted by `XS4ALL <http://www.xs4all.nl>`_.  `Upfront Systems
+`www.python.org <https://www.python.org>`_ is graciously hosted by `Rackspace
+<http://www.rackspace.com>`_, with CDN caching provided by `Fastly
+<https://www.fastly.com>`_.  `Upfront Systems
 <http://www.upfrontsystems.co.za>`_ hosts `bugs.python.org
-<http://bugs.python.org>`_.  Most other Python services like `PyPI
-<https://pypi.python.org>`_ and hg.python.org are hosted by `Oregon State
+<https://bugs.python.org>`_.  Many other Python services like `the Wiki
+<https://wiki.python.org>`_ are hosted by `Oregon State
 University Open Source Lab <https://osuosl.org>`_.
 
 
@@ -282,7 +284,7 @@
 
 When he began implementing Python, Guido van Rossum was also reading the
 published scripts from `"Monty Python's Flying Circus"
-<http://pythonline.com/>`__, a BBC comedy series from the 1970s.  Van Rossum
+<http://en.wikipedia.org/wiki/Monty_Python>`__, a BBC comedy series from the 1970s.  Van Rossum
 thought he needed a name that was short, unique, and slightly mysterious, so he
 decided to call the language Python.
 
@@ -311,7 +313,7 @@
 releases.
 
 The latest stable releases can always be found on the `Python download page
-<http://python.org/download/>`_.  There are two recommended production-ready
+<https://www.python.org/download/>`_.  There are two recommended production-ready
 versions at this point in time, because at the moment there are two branches of
 stable releases: 2.x and 3.x.  Python 3.x may be less useful than 2.x, since
 currently there is more third party software available for Python 2 than for
@@ -335,9 +337,9 @@
 Have any significant projects been done in Python?
 --------------------------------------------------
 
-See http://python.org/about/success for a list of projects that use Python.
+See https://www.python.org/about/success for a list of projects that use Python.
 Consulting the proceedings for `past Python conferences
-<http://python.org/community/workshops/>`_ will reveal contributions from many
+<https://www.python.org/community/workshops/>`_ will reveal contributions from many
 different companies and organizations.
 
 High-profile Python projects include `the Mailman mailing list manager
@@ -351,14 +353,14 @@
 What new developments are expected for Python in the future?
 ------------------------------------------------------------
 
-See http://www.python.org/dev/peps/ for the Python Enhancement Proposals
+See https://www.python.org/dev/peps/ 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.  Look for a PEP
 titled "Python X.Y Release Schedule", where X.Y is a version that hasn't been
 publicly released yet.
 
 New development is discussed on `the python-dev mailing list
-<http://mail.python.org/mailman/listinfo/python-dev/>`_.
+<https://mail.python.org/mailman/listinfo/python-dev/>`_.
 
 
 Is it reasonable to propose incompatible changes to Python?
@@ -376,43 +378,6 @@
 changes while minimizing disruption for users.
 
 
-Is Python Y2K (Year 2000) Compliant?
-------------------------------------
-
-.. remove this question?
-
-As of August, 2003 no major problems have been reported and Y2K compliance seems
-to be a non-issue.
-
-Python does very few date calculations and for those it does perform relies on
-the C library functions.  Python generally represents times either as seconds
-since 1970 or as a ``(year, month, day, ...)`` tuple 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, it's possible that a particular
-application written in Python makes assumptions about 2-digit years.
-
-Because Python is available free of charge, there are no absolute guarantees.
-If there *are* unforeseen problems, liability is the user's problem rather than
-the developers', and there is nobody you can sue for damages.  The Python
-copyright notice contains the following disclaimer:
-
-    4. PSF is making Python 2.3 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 2.3 WILL NOT INFRINGE ANY THIRD PARTY
-    RIGHTS.
-
-    5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
-    2.3 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
-    A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 2.3,
-    OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
-
-The good news is that *if* you encounter a problem, you have full source
-available to track it down and fix it.  This is one advantage of an open source
-programming environment.
-
-
 Is Python a good language for beginning programmers?
 ----------------------------------------------------
 
@@ -451,14 +416,25 @@
 remember the methods for a list, they can do something like this::
 
    >>> L = []
-   >>> dir(L)
-   ['append', 'count', 'extend', 'index', 'insert', 'pop', 'remove',
+   >>> dir(L) # doctest: +NORMALIZE_WHITESPACE
+   ['__add__', '__class__', '__contains__', '__delattr__', '__delitem__',
+   '__dir__', '__doc__', '__eq__', '__format__', '__ge__',
+   '__getattribute__', '__getitem__', '__gt__', '__hash__', '__iadd__',
+   '__imul__', '__init__', '__iter__', '__le__', '__len__', '__lt__',
+   '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__',
+   '__repr__', '__reversed__', '__rmul__', '__setattr__', '__setitem__',
+   '__sizeof__', '__str__', '__subclasshook__', 'append', 'clear',
+   'copy', 'count', 'extend', 'index', 'insert', 'pop', 'remove',
    'reverse', 'sort']
+   >>> [d for d in dir(L) if '__' not in d]
+   ['append', 'clear', 'copy', 'count', 'extend', 'index', 'insert', 'pop', 'remove', 'reverse', 'sort']
+
    >>> help(L.append)
    Help on built-in function append:
-
+   <BLANKLINE>
    append(...)
-       L.append(object) -- append object to end
+       L.append(object) -> None -- append object to end
+   <BLANKLINE>
    >>> L.append(1)
    >>> L
    [1]
@@ -476,4 +452,4 @@
 
 If you want to discuss Python's use in education, you may be interested in
 joining `the edu-sig mailing list
-<http://python.org/community/sigs/current/edu-sig>`_.
+<https://www.python.org/community/sigs/current/edu-sig>`_.
diff --git a/Doc/faq/gui.rst b/Doc/faq/gui.rst
index 5827f28..f130d33 100644
--- a/Doc/faq/gui.rst
+++ b/Doc/faq/gui.rst
@@ -29,17 +29,17 @@
 Standard builds of Python include an object-oriented interface to the Tcl/Tk
 widget set, called :ref:`tkinter <Tkinter>`.  This is probably the easiest to
 install (since it comes included with most
-`binary distributions <http://www.python.org/download/>`_ of Python) and use.
+`binary distributions <https://www.python.org/download/>`_ of Python) and use.
 For more info about Tk, including pointers to the source, see the
 `Tcl/Tk home page <http://www.tcl.tk>`_.  Tcl/Tk is fully portable to the
-MacOS, Windows, and Unix platforms.
+Mac OS X, Windows, and Unix platforms.
 
 wxWidgets
 ---------
 
 wxWidgets (http://www.wxwidgets.org) is a free, portable GUI class
 library written in C++ that provides a native look and feel on a
-number of platforms, with Windows, MacOS X, GTK, X11, all listed as
+number of platforms, with Windows, Mac OS X, GTK, X11, all listed as
 current stable targets.  Language bindings are available for a number
 of languages including Python, Perl, Ruby, etc.
 
@@ -58,14 +58,14 @@
 ---
 
 There are bindings available for the Qt toolkit (using either `PyQt
-<http://www.riverbankcomputing.co.uk/software/pyqt/>`_ or `PySide
-<http://www.pyside.org/>`_) and for KDE (`PyKDE <http://www.riverbankcomputing.co.uk/software/pykde/intro>`__).
+<http://www.riverbankcomputing.co.uk/software/pyqt/intro>`_ or `PySide
+<http://www.pyside.org/>`_) and for KDE (`PyKDE <https://techbase.kde.org/Development/Languages/Python>`__).
 PyQt is currently more mature than PySide, but you must buy a PyQt license from
 `Riverbank Computing <http://www.riverbankcomputing.co.uk/software/pyqt/license>`_
 if you want to write proprietary applications.  PySide is free for all applications.
 
 Qt 4.5 upwards is licensed under the LGPL license; also, commercial licenses
-are available from `Nokia <http://qt.nokia.com/>`_.
+are available from `The Qt Company <http://www.qt.io/licensing/>`_.
 
 Gtk+
 ----
@@ -102,13 +102,9 @@
 What platform-specific GUI toolkits exist for Python?
 ========================================================
 
-`The Mac port <http://python.org/download/mac>`_ by Jack Jansen has a rich and
-ever-growing set of modules that support the native Mac toolbox calls.  The port
-supports MacOS X's Carbon libraries.
-
 By installing the `PyObjc Objective-C bridge
-<http://pyobjc.sourceforge.net>`_, Python programs can use MacOS X's
-Cocoa libraries. See the documentation that comes with the Mac port.
+<https://pythonhosted.org/pyobjc/>`_, Python programs can use Mac OS X's
+Cocoa libraries.
 
 :ref:`Pythonwin <windows-faq>` by Mark Hammond includes an interface to the
 Microsoft Foundation Classes and a Python programming environment
diff --git a/Doc/faq/installed.rst b/Doc/faq/installed.rst
index efec9bf..4229653 100644
--- a/Doc/faq/installed.rst
+++ b/Doc/faq/installed.rst
@@ -11,7 +11,7 @@
 software developers at places such as Google, NASA, and Lucasfilm Ltd.
 
 If you wish to learn more about Python, start with the `Beginner's Guide to
-Python <http://wiki.python.org/moin/BeginnersGuide>`_.
+Python <https://wiki.python.org/moin/BeginnersGuide>`_.
 
 
 Why is Python installed on my machine?
diff --git a/Doc/faq/library.rst b/Doc/faq/library.rst
index 2566932..d71a9b4 100644
--- a/Doc/faq/library.rst
+++ b/Doc/faq/library.rst
@@ -19,7 +19,7 @@
 library and will be able to skip this step.)
 
 For third-party packages, search the `Python Package Index
-<http://pypi.python.org/pypi>`_ or try `Google <http://www.google.com>`_ or
+<https://pypi.python.org/pypi>`_ or try `Google <https://www.google.com>`_ or
 another Web search engine.  Searching for "Python" plus a keyword or two for
 your topic of interest will usually find something helpful.
 
@@ -181,8 +181,8 @@
 
 The :mod:`pydoc` module can create HTML from the doc strings in your Python
 source code.  An alternative for creating API documentation purely from
-docstrings is `epydoc <http://epydoc.sf.net/>`_.  `Sphinx
-<http://sphinx.pocoo.org>`_ can also include docstring content.
+docstrings is `epydoc <http://epydoc.sourceforge.net/>`_.  `Sphinx
+<http://sphinx-doc.org>`_ can also include docstring content.
 
 
 How do I get a single keypress at a time?
@@ -211,7 +211,7 @@
            try:
                c = sys.stdin.read(1)
                print("Got character", repr(c))
-           except IOError:
+           except OSError:
                pass
    finally:
        termios.tcsetattr(fd, termios.TCSAFLUSH, oldterm)
@@ -224,7 +224,11 @@
    :func:`termios.tcsetattr` turns off stdin's echoing and disables canonical
    mode.  :func:`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 :exc:`IOError`, this error is caught and ignored.
+   results in an :exc:`OSError`, this error is caught and ignored.
+
+   .. versionchanged:: 3.3
+      *sys.stdin.read* used to raise :exc:`IOError`. Starting from Python 3.3
+      :exc:`IOError` is alias for :exc:`OSError`.
 
 
 Threads
@@ -603,7 +607,7 @@
    "expect" library.  A Python extension that interfaces to expect is called
    "expy" and available from http://expectpy.sourceforge.net.  A pure Python
    solution that works like expect is `pexpect
-   <http://pypi.python.org/pypi/pexpect/>`_.
+   <https://pypi.python.org/pypi/pexpect/>`_.
 
 
 How do I access the serial (RS232) port?
@@ -659,7 +663,7 @@
 .. XXX check if wiki page is still up to date
 
 A summary of available frameworks is maintained by Paul Boddie at
-http://wiki.python.org/moin/WebProgramming\ .
+https://wiki.python.org/moin/WebProgramming\ .
 
 Cameron Laird maintains a useful set of pages about Python web technologies at
 http://phaseit.net/claird/comp.lang.python/web_python.
@@ -702,7 +706,7 @@
 .. XXX add modern template languages
 
 You can find a collection of useful links on the `Web Programming wiki page
-<http://wiki.python.org/moin/WebProgramming>`_.
+<https://wiki.python.org/moin/WebProgramming>`_.
 
 
 How do I send mail from a Python script?
@@ -769,7 +773,7 @@
 .. note::
    The :mod:`asyncore` module presents a framework-like approach to the problem
    of writing non-blocking networking code.
-   The third-party `Twisted <http://twistedmatrix.com/>`_ library is
+   The third-party `Twisted <https://twistedmatrix.com/trac/>`_ library is
    a popular and feature-rich alternative.
 
 
@@ -788,7 +792,7 @@
 
 Support for most relational databases is available.  See the
 `DatabaseProgramming wiki page
-<http://wiki.python.org/moin/DatabaseProgramming>`_ for details.
+<https://wiki.python.org/moin/DatabaseProgramming>`_ for details.
 
 
 How do you implement persistent objects in Python?
diff --git a/Doc/faq/programming.rst b/Doc/faq/programming.rst
index 280d5e1..1a71c47 100644
--- a/Doc/faq/programming.rst
+++ b/Doc/faq/programming.rst
@@ -23,15 +23,14 @@
 
 The IDLE interactive development environment, which is part of the standard
 Python distribution (normally available as Tools/scripts/idle), includes a
-graphical debugger.  There is documentation for the IDLE debugger at
-http://www.python.org/idle/doc/idle2.html#Debugger.
+graphical debugger.
 
 PythonWin is a Python IDE that includes a GUI debugger based on pdb.  The
 Pythonwin debugger colors breakpoints and has quite a few cool features such as
 debugging non-Pythonwin programs.  Pythonwin is available as part of the `Python
 for Windows Extensions <http://sourceforge.net/projects/pywin32/>`__ project and
 as a part of the ActivePython distribution (see
-http://www.activestate.com/Products/ActivePython/index.html).
+http://www.activestate.com/activepython\ ).
 
 `Boa Constructor <http://boa-constructor.sourceforge.net/>`_ is an IDE and GUI
 builder that uses wxWidgets.  It offers visual frame creation and manipulation,
@@ -39,7 +38,7 @@
 hierarchies, doc string generated html documentation, an advanced debugger,
 integrated help, and Zope support.
 
-`Eric <http://www.die-offenbachs.de/eric/index.html>`_ is an IDE built on PyQt
+`Eric <http://eric-ide.python-projects.org/>`_ is an IDE built on PyQt
 and the Scintilla editing component.
 
 Pydb is a version of the standard Python debugger pdb, modified for use with DDD
@@ -51,7 +50,8 @@
 They include:
 
 * Wing IDE (http://wingware.com/)
-* Komodo IDE (http://www.activestate.com/Products/Komodo)
+* Komodo IDE (http://komodoide.com/)
+* PyCharm (https://www.jetbrains.com/pycharm/)
 
 
 Is there a tool to help find bugs or perform static analysis?
@@ -61,7 +61,7 @@
 
 PyChecker is a static analysis tool that finds bugs in Python source code and
 warns about code complexity and style.  You can get PyChecker from
-http://pychecker.sf.net.
+http://pychecker.sourceforge.net/.
 
 `Pylint <http://www.logilab.org/projects/pylint>`_ is another tool that checks
 if a module satisfies a coding standard, and also makes it possible to write
@@ -69,8 +69,7 @@
 PyChecker performs, Pylint offers some additional features such as checking line
 length, whether variable names are well-formed according to your coding
 standard, whether declared interfaces are fully implemented, and more.
-http://www.logilab.org/card/pylint_manual provides a full list of Pylint's
-features.
+http://docs.pylint.org/ provides a full list of Pylint's features.
 
 
 How can I create a stand-alone binary from a Python script?
@@ -101,13 +100,7 @@
 
     http://www.py2exe.org/
 
-Another is Christian Tismer's `SQFREEZE <http://starship.python.net/crew/pirx>`_
-which appends the byte code to a specially-prepared Python interpreter that can
-find the byte code in the executable.
-
-Other tools include Fredrik Lundh's `Squeeze
-<http://www.pythonware.com/products/python/squeeze>`_ and Anthony Tuininga's
-`cx_Freeze <http://starship.python.net/crew/atuining/cx_Freeze/index.html>`_.
+Another tool is Anthony Tuininga's `cx_Freeze <http://cx-freeze.sourceforge.net/>`_.
 
 
 Are there coding standards or a style guide for Python programs?
@@ -292,9 +285,8 @@
 -----------------------------------------------------------
 
 In general, don't use ``from modulename import *``.  Doing so clutters the
-importer's namespace.  Some people avoid this idiom even with the few modules
-that were designed to be imported in this manner.  Modules designed in this
-manner include :mod:`tkinter`, and :mod:`threading`.
+importer's namespace, and makes it much harder for linters to detect undefined
+names.
 
 Import modules at the top of a file.  Doing so makes it clear what other modules
 your code requires and avoids questions of whether the module name is in scope.
@@ -308,11 +300,6 @@
    directory) -- e.g. mx.DateTime, ZODB, PIL.Image, etc.
 3. locally-developed modules
 
-Never use relative package imports.  If you're writing code that's in the
-``package.sub.m1`` module and want to import ``package.sub.m2``, do not just
-write ``from . import m2``, even though it's legal.  Write ``from package.sub
-import m2`` instead.  See :pep:`328` for details.
-
 It is sometimes necessary to move imports to a function or class to avoid
 problems with circular imports.  Gordon McMillan says:
 
@@ -343,13 +330,61 @@
 couple of dictionary lookups.  Even if the module name has gone out of scope,
 the module is probably available in :data:`sys.modules`.
 
-If only instances of a specific class use 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.
+
+Why are default values shared between objects?
+----------------------------------------------
+
+This type of bug commonly bites neophyte programmers.  Consider this function::
+
+   def foo(mydict={}):  # Danger: shared reference to one dict for all calls
+       ... compute something ...
+       mydict[key] = value
+       return mydict
+
+The first time you call this function, ``mydict`` contains a single item.  The
+second time, ``mydict`` contains two items because when ``foo()`` begins
+executing, ``mydict`` starts out with an item already in it.
+
+It is often expected that a function call creates new objects for default
+values. This is not what happens. Default values are created exactly once, when
+the function is defined.  If that object is changed, like the dictionary in this
+example, subsequent calls to the function will refer to this changed object.
+
+By definition, immutable objects such as numbers, strings, tuples, and ``None``,
+are safe from change. Changes to mutable objects such as dictionaries, lists,
+and class instances can lead to confusion.
+
+Because of this feature, it is good programming practice to not use mutable
+objects as default values.  Instead, use ``None`` as the default value and
+inside the function, check if the parameter is ``None`` and create a new
+list/dictionary/whatever if it is.  For example, don't write::
+
+   def foo(mydict={}):
+       ...
+
+but::
+
+   def foo(mydict=None):
+       if mydict is None:
+           mydict = {}  # create a new dict for local namespace
+
+This feature can be useful.  When you have a function that's time-consuming to
+compute, a common technique is to cache the parameters and the resulting value
+of each call to the function, and return the cached value if the same value is
+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={}):
+       if (arg1, arg2) in _cache:
+           return _cache[(arg1, arg2)]
+
+       # Calculate the value
+       result = ... expensive computation ...
+       _cache[(arg1, arg2)] = result           # Store result in the cache
+       return result
+
+You could use a global variable containing a dictionary instead of the default
+value; it's a matter of taste.
 
 
 How can I pass optional or keyword parameters from one function to another?
@@ -392,6 +427,81 @@
 the values ``42``, ``314``, and ``somevar`` are arguments.
 
 
+Why did changing list 'y' also change list 'x'?
+------------------------------------------------
+
+If you wrote code like::
+
+   >>> x = []
+   >>> y = x
+   >>> y.append(10)
+   >>> y
+   [10]
+   >>> x
+   [10]
+
+you might be wondering why appending an element to ``y`` changed ``x`` too.
+
+There are two factors that produce this result:
+
+1) Variables are simply names that refer to objects.  Doing ``y = x`` doesn't
+   create a copy of the list -- it creates a new variable ``y`` that refers to
+   the same object ``x`` refers to.  This means that there is only one object
+   (the list), and both ``x`` and ``y`` refer to it.
+2) Lists are :term:`mutable`, which means that you can change their content.
+
+After the call to :meth:`~list.append`, the content of the mutable object has
+changed from ``[]`` to ``[10]``.  Since both the variables refer to the same
+object, using either name accesses the modified value ``[10]``.
+
+If we instead assign an immutable object to ``x``::
+
+   >>> x = 5  # ints are immutable
+   >>> y = x
+   >>> x = x + 1  # 5 can't be mutated, we are creating a new object here
+   >>> x
+   6
+   >>> y
+   5
+
+we can see that in this case ``x`` and ``y`` are not equal anymore.  This is
+because integers are :term:`immutable`, and when we do ``x = x + 1`` we are not
+mutating the int ``5`` by incrementing its value; instead, we are creating a
+new object (the int ``6``) and assigning it to ``x`` (that is, changing which
+object ``x`` refers to).  After this assignment we have two objects (the ints
+``6`` and ``5``) and two variables that refer to them (``x`` now refers to
+``6`` but ``y`` still refers to ``5``).
+
+Some operations (for example ``y.append(10)`` and ``y.sort()``) mutate the
+object, whereas superficially similar operations (for example ``y = y + [10]``
+and ``sorted(y)``) create a new object.  In general in Python (and in all cases
+in the standard library) a method that mutates an object will return ``None``
+to help avoid getting the two types of operations confused.  So if you
+mistakenly write ``y.sort()`` thinking it will give you a sorted copy of ``y``,
+you'll instead end up with ``None``, which will likely cause your program to
+generate an easily diagnosed error.
+
+However, there is one class of operations where the same operation sometimes
+has different behaviors with different types:  the augmented assignment
+operators.  For example, ``+=`` mutates lists but not tuples or ints (``a_list
++= [1, 2, 3]`` is equivalent to ``a_list.extend([1, 2, 3])`` and mutates
+``a_list``, whereas ``some_tuple += (1, 2, 3)`` and ``some_int += 1`` create
+new objects).
+
+In other words:
+
+* If we have a mutable object (:class:`list`, :class:`dict`, :class:`set`,
+  etc.), we can use some specific operations to mutate it and all the variables
+  that refer to it will see the change.
+* If we have an immutable object (:class:`str`, :class:`int`, :class:`tuple`,
+  etc.), all the variables that refer to it will always see the same value,
+  but operations that transform that value into a new value always return a new
+  object.
+
+If you want to know if two variables refer to the same object or not, you can
+use the :keyword:`is` operator, or the built-in function :func:`id`.
+
+
 How do I write a function with output parameters (call by reference)?
 ---------------------------------------------------------------------
 
@@ -711,7 +821,7 @@
 144`` and ``int('0x144')`` raises :exc:`ValueError`. ``int(string, base)`` takes
 the base to convert from as a second optional argument, so ``int('0x144', 16) ==
 324``.  If the base is specified as 0, the number is interpreted using Python's
-rules: a leading '0' indicates octal, and '0x' indicates a hex number.
+rules: a leading '0o' indicates octal, and '0x' indicates a hex number.
 
 Do not use the built-in function :func:`eval` if all you need is to convert
 strings to numbers.  :func:`eval` will be significantly slower and it presents a
@@ -732,7 +842,7 @@
 constructor :func:`str`.  If you want a hexadecimal or octal representation, use
 the built-in functions :func:`hex` or :func:`oct`.  For fancy formatting, see
 the :ref:`string-formatting` section, e.g. ``"{:04d}".format(144)`` yields
-``'0144'`` and ``"{:.3f}".format(1/3)`` yields ``'0.333'``.
+``'0144'`` and ``"{:.3f}".format(1.0/3.0)`` yields ``'0.333'``.
 
 
 How do I modify a string in place?
@@ -903,7 +1013,7 @@
   as builtins and some extension types.  For example, be sure to use
   either the :meth:`list.sort` built-in method or the related :func:`sorted`
   function to do sorting (and see the
-  `sorting mini-HOWTO <http://wiki.python.org/moin/HowTo/Sorting>`_ for examples
+  `sorting mini-HOWTO <https://wiki.python.org/moin/HowTo/Sorting>`_ for examples
   of moderately advanced usage).
 
 * Abstractions tend to create indirections and force the interpreter to work
@@ -923,7 +1033,7 @@
 
 .. seealso::
    The wiki page devoted to `performance tips
-   <http://wiki.python.org/moin/PythonSpeed/PerformanceTips>`_.
+   <https://wiki.python.org/moin/PythonSpeed/PerformanceTips>`_.
 
 .. _efficient_string_concatenation:
 
@@ -1008,7 +1118,7 @@
 
 See the Python Cookbook for a long discussion of many ways to do this:
 
-    http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52560
+   http://code.activestate.com/recipes/52560/
 
 If you don't mind reordering the list, sort it and then scan from the end of the
 list, deleting duplicates as you go::
@@ -1730,19 +1840,10 @@
 __import__('x.y.z') returns <module 'x'>; how do I get z?
 ---------------------------------------------------------
 
-Try::
+Consider using the convenience function :func:`~importlib.import_module` from
+:mod:`importlib` instead::
 
-   __import__('x.y.z').y.z
-
-For more realistic situations, you may have to do something like ::
-
-   m = __import__(s)
-   for i in s.split(".")[1:]:
-       m = getattr(m, i)
-
-See :mod:`importlib` for a convenience function called
-:func:`~importlib.import_module`.
-
+   z = importlib.import_module('x.y.z')
 
 
 When I edit an imported module and reimport it, the changes don't show up.  Why does this happen?
@@ -1751,12 +1852,12 @@
 For reasons of efficiency as well as consistency, Python only reads the module
 file on the first time a module is imported.  If it didn't, in a program
 consisting of many modules where each one imports the same basic module, the
-basic module would be parsed and re-parsed many times.  To force rereading of a
+basic module would be parsed and re-parsed many times.  To force re-reading of a
 changed module, do this::
 
-   import imp
+   import importlib
    import modname
-   imp.reload(modname)
+   importlib.reload(modname)
 
 Warning: this technique is not 100% fool-proof.  In particular, modules
 containing statements like ::
@@ -1768,10 +1869,10 @@
 updated to use the new class definition.  This can result in the following
 paradoxical behaviour:
 
-   >>> import imp
+   >>> import importlib
    >>> import cls
    >>> c = cls.C()                # Create an instance of C
-   >>> imp.reload(cls)
+   >>> importlib.reload(cls)
    <module 'cls' from 'cls.py'>
    >>> isinstance(c, cls.C)       # isinstance is false?!?
    False
diff --git a/Doc/faq/windows.rst b/Doc/faq/windows.rst
index 59f9480..7cac8a9 100644
--- a/Doc/faq/windows.rst
+++ b/Doc/faq/windows.rst
@@ -31,7 +31,7 @@
 
 .. |Python Development on XP| image:: python-video-icon.png
 .. _`Python Development on XP`:
-   http://www.showmedo.com/videos/series?name=pythonOzsvaldPyNewbieSeries
+   http://showmedo.com/videotutorials/series?name=pythonOzsvaldPyNewbieSeries
 
 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"
@@ -78,7 +78,7 @@
     >>> print("Hello")
     Hello
     >>> "Hello" * 3
-    HelloHelloHello
+    'HelloHelloHello'
 
 Many people use the interactive mode as a convenient yet highly programmable
 calculator.  When you want to end your interactive Python session, hold the Ctrl
@@ -105,7 +105,7 @@
 
 .. |Adding Python to DOS Path| image:: python-video-icon.png
 .. _`Adding Python to DOS Path`:
-   http://showmedo.com/videos/video?name=960000&fromSeriesID=96
+   http://showmedo.com/videotutorials/video?name=960000&fromSeriesID=96
 
 
 or::
diff --git a/Doc/glossary.rst b/Doc/glossary.rst
index b48eb1e..1de86ef 100644
--- a/Doc/glossary.rst
+++ b/Doc/glossary.rst
@@ -76,7 +76,7 @@
 
    BDFL
       Benevolent Dictator For Life, a.k.a. `Guido van Rossum
-      <http://www.python.org/~guido/>`_, Python's creator.
+      <https://www.python.org/~guido/>`_, Python's creator.
 
    binary file
       A :term:`file object` able to read and write
@@ -141,7 +141,7 @@
 
    CPython
       The canonical implementation of the Python programming language, as
-      distributed on `python.org <http://python.org>`_.  The term "CPython"
+      distributed on `python.org <https://www.python.org>`_.  The term "CPython"
       is used when necessary to distinguish this implementation from others
       such as Jython or IronPython.
 
@@ -292,7 +292,7 @@
    generator
       A function which returns an iterator.  It looks like a normal function
       except that it contains :keyword:`yield` statements for producing a series
-      a values usable in a for-loop or that can be retrieved one at a time with
+      of values usable in a for-loop or that can be retrieved one at a time with
       the :func:`next` function. Each :keyword:`yield` temporarily suspends
       processing, remembering the location execution state (including local
       variables and pending try-statements).  When the generator resumes, it
@@ -310,6 +310,15 @@
          >>> sum(i*i for i in range(10))         # sum of squares 0, 1, 4, ... 81
          285
 
+   generic function
+      A function composed of multiple functions implementing the same operation
+      for different types. Which implementation should be used during a call is
+      determined by the dispatch algorithm.
+
+      See also the :term:`single dispatch` glossary entry, the
+      :func:`functools.singledispatch` decorator, and :pep:`443`.
+
+
    GIL
       See :term:`global interpreter lock`.
 
@@ -346,8 +355,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 (except with themselves), and their hash value is their
-      :func:`id`.
+      compare unequal (except with themselves), and their hash value is derived
+      from their :func:`id`.
 
    IDLE
       An Integrated Development Environment for Python.  IDLE is a basic editor
@@ -521,7 +530,7 @@
    method resolution order
       Method Resolution Order is the order in which base classes are searched
       for a member during lookup. See `The Python 2.3 Method Resolution Order
-      <http://www.python.org/download/releases/2.3/mro/>`_.
+      <https://www.python.org/download/releases/2.3/mro/>`_.
 
    module
       An object that serves as an organizational unit of Python code.  Modules
@@ -530,6 +539,10 @@
 
       See also :term:`package`.
 
+   module spec
+      A namespace containing the import-related information used to load a
+      module.
+
    MRO
       See :term:`method resolution order`.
 
@@ -671,20 +684,27 @@
    positional argument
       See :term:`argument`.
 
-   provisional package
-      A provisional package is one which has been deliberately excluded from
+   provisional API
+      A provisional API is one which has been deliberately excluded from
       the standard library's backwards compatibility guarantees.  While major
-      changes to such packages are not expected, as long as they are marked
+      changes to such interfaces are not expected, as long as they are marked
       provisional, backwards incompatible changes (up to and including removal
-      of the package) may occur if deemed necessary by core developers.  Such
+      of the interface) may occur if deemed necessary by core developers.  Such
       changes will not be made gratuitously -- they will occur only if serious
-      flaws are uncovered that were missed prior to the inclusion of the
-      package.
+      fundamental flaws are uncovered that were missed prior to the inclusion
+      of the API.
+
+      Even for provisional APIs, backwards incompatible changes are seen as
+      a "solution of last resort" - every attempt will still be made to find
+      a backwards compatible resolution to any identified problems.
 
       This process allows the standard library to continue to evolve over
       time, without locking in problematic design errors for extended periods
       of time.  See :pep:`411` for more details.
 
+   provisional package
+      See :term:`provisional API`.
+
    Python 3000
       Nickname for the Python 3.x release line (coined long ago when the
       release of version 3 was something in the distant future.)  This is also
@@ -771,6 +791,10 @@
       interface can be registered explicitly using
       :func:`~abc.register`.
 
+   single dispatch
+      A form of :term:`generic function` dispatch where the implementation is
+      chosen based on the type of a single argument.
+
    slice
       An object usually containing a portion of a :term:`sequence`.  A slice is
       created using the subscript notation, ``[]`` with colons between numbers
@@ -796,10 +820,13 @@
       :meth:`~collections.somenamedtuple._asdict`. Examples of struct sequences
       include :data:`sys.float_info` and the return value of :func:`os.stat`.
 
+   text encoding
+      A codec which encodes Unicode strings to bytes.
+
    text file
       A :term:`file object` able to read and write :class:`str` objects.
       Often, a text file actually accesses a byte-oriented datastream
-      and handles the text encoding automatically.
+      and handles the :term:`text encoding` automatically.
 
       .. seealso::
          A :term:`binary file` reads and write :class:`bytes` objects.
@@ -824,7 +851,7 @@
       recognized as ending a line: the Unix end-of-line convention ``'\n'``,
       the Windows convention ``'\r\n'``, and the old Macintosh convention
       ``'\r'``.  See :pep:`278` and :pep:`3116`, as well as
-      :func:`str.splitlines` for an additional use.
+      :func:`bytes.splitlines` for an additional use.
 
    view
       The objects returned from :meth:`dict.keys`, :meth:`dict.values`, and
@@ -833,6 +860,14 @@
       dictionary view to become a full list use ``list(dictview)``.  See
       :ref:`dict-views`.
 
+   virtual environment
+      A cooperatively isolated runtime environment that allows Python users
+      and applications to install and upgrade Python distribution packages
+      without interfering with the behaviour of other Python applications
+      running on the same system.
+
+      See also :ref:`scripts-pyvenv`
+
    virtual machine
       A computer defined entirely in software.  Python's virtual machine
       executes the :term:`bytecode` emitted by the bytecode compiler.
diff --git a/Doc/howto/clinic.rst b/Doc/howto/clinic.rst
new file mode 100644
index 0000000..750ddbe
--- /dev/null
+++ b/Doc/howto/clinic.rst
@@ -0,0 +1,1686 @@
+**********************
+Argument Clinic How-To
+**********************
+
+:author: Larry Hastings
+
+
+.. topic:: Abstract
+
+  Argument Clinic is a preprocessor for CPython C files.
+  Its purpose is to automate all the boilerplate involved
+  with writing argument parsing code for "builtins".
+  This document shows you how to convert your first C
+  function to work with Argument Clinic, and then introduces
+  some advanced topics on Argument Clinic usage.
+
+  Currently Argument Clinic is considered internal-only
+  for CPython.  Its use is not supported for files outside
+  CPython, and no guarantees are made regarding backwards
+  compatibility for future versions.  In other words: if you
+  maintain an external C extension for CPython, you're welcome
+  to experiment with Argument Clinic in your own code.  But the
+  version of Argument Clinic that ships with CPython 3.5 *could*
+  be totally incompatible and break all your code.
+
+The Goals Of Argument Clinic
+============================
+
+Argument Clinic's primary goal
+is to take over responsibility for all argument parsing code
+inside CPython.  This means that, when you convert a function
+to work with Argument Clinic, that function should no longer
+do any of its own argument parsing--the code generated by
+Argument Clinic should be a "black box" to you, where CPython
+calls in at the top, and your code gets called at the bottom,
+with ``PyObject *args`` (and maybe ``PyObject *kwargs``)
+magically converted into the C variables and types you need.
+
+In order for Argument Clinic to accomplish its primary goal,
+it must be easy to use.  Currently, working with CPython's
+argument parsing library is a chore, requiring maintaining
+redundant information in a surprising number of places.
+When you use Argument Clinic, you don't have to repeat yourself.
+
+Obviously, no one would want to use Argument Clinic unless
+it's solving their problem--and without creating new problems of
+its own.
+So it's paramount that Argument Clinic generate correct code.
+It'd be nice if the code was faster, too, but at the very least
+it should not introduce a major speed regression.  (Eventually Argument
+Clinic *should* make a major speedup possible--we could
+rewrite its code generator to produce tailor-made argument
+parsing code, rather than calling the general-purpose CPython
+argument parsing library.  That would make for the fastest
+argument parsing possible!)
+
+Additionally, Argument Clinic must be flexible enough to
+work with any approach to argument parsing.  Python has
+some functions with some very strange parsing behaviors;
+Argument Clinic's goal is to support all of them.
+
+Finally, the original motivation for Argument Clinic was
+to provide introspection "signatures" for CPython builtins.
+It used to be, the introspection query functions would throw
+an exception if you passed in a builtin.  With Argument
+Clinic, that's a thing of the past!
+
+One idea you should keep in mind, as you work with
+Argument Clinic: the more information you give it, the
+better job it'll be able to do.
+Argument Clinic is admittedly relatively simple right
+now.  But as it evolves it will get more sophisticated,
+and it should be able to do many interesting and smart
+things with all the information you give it.
+
+
+Basic Concepts And Usage
+========================
+
+Argument Clinic ships with CPython; you'll find it in ``Tools/clinic/clinic.py``.
+If you run that script, specifying a C file as an argument::
+
+    % python3 Tools/clinic/clinic.py foo.c
+
+Argument Clinic will scan over the file looking for lines that
+look exactly like this::
+
+    /*[clinic input]
+
+When it finds one, it reads everything up to a line that looks
+exactly like this::
+
+    [clinic start generated code]*/
+
+Everything in between these two lines is input for Argument Clinic.
+All of these lines, including the beginning and ending comment
+lines, are collectively called an Argument Clinic "block".
+
+When Argument Clinic parses one of these blocks, it
+generates output.  This output is rewritten into the C file
+immediately after the block, followed by a comment containing a checksum.
+The Argument Clinic block now looks like this::
+
+    /*[clinic input]
+    ... clinic input goes here ...
+    [clinic start generated code]*/
+    ... clinic output goes here ...
+    /*[clinic end generated code: checksum=...]*/
+
+If you run Argument Clinic on the same file a second time, Argument Clinic
+will discard the old output and write out the new output with a fresh checksum
+line.  However, if the input hasn't changed, the output won't change either.
+
+You should never modify the output portion of an Argument Clinic block.  Instead,
+change the input until it produces the output you want.  (That's the purpose of the
+checksum--to detect if someone changed the output, as these edits would be lost
+the next time Argument Clinic writes out fresh output.)
+
+For the sake of clarity, here's the terminology we'll use with Argument Clinic:
+
+* The first line of the comment (``/*[clinic input]``) is the *start line*.
+* The last line of the initial comment (``[clinic start generated code]*/``) is the *end line*.
+* The last line (``/*[clinic end generated code: checksum=...]*/``) is the *checksum line*.
+* In between the start line and the end line is the *input*.
+* In between the end line and the checksum line is the *output*.
+* All the text collectively, from the start line to the checksum line inclusively,
+  is the *block*.  (A block that hasn't been successfully processed by Argument
+  Clinic yet doesn't have output or a checksum line, but it's still considered
+  a block.)
+
+
+Converting Your First Function
+==============================
+
+The best way to get a sense of how Argument Clinic works is to
+convert a function to work with it.  Here, then, are the bare
+minimum steps you'd need to follow to convert a function to
+work with Argument Clinic.  Note that for code you plan to
+check in to CPython, you really should take the conversion farther,
+using some of the advanced concepts you'll see later on in
+the document (like "return converters" and "self converters").
+But we'll keep it simple for this walkthrough so you can learn.
+
+Let's dive in!
+
+0. Make sure you're working with a freshly updated checkout
+   of the CPython trunk.
+
+1. Find a Python builtin that calls either :c:func:`PyArg_ParseTuple`
+   or :c:func:`PyArg_ParseTupleAndKeywords`, and hasn't been converted
+   to work with Argument Clinic yet.
+   For my example I'm using ``_pickle.Pickler.dump()``.
+
+2. If the call to the ``PyArg_Parse`` function uses any of the
+   following format units::
+
+       O&
+       O!
+       es
+       es#
+       et
+       et#
+
+   or if it has multiple calls to :c:func:`PyArg_ParseTuple`,
+   you should choose a different function.  Argument Clinic *does*
+   support all of these scenarios.  But these are advanced
+   topics--let's do something simpler for your first function.
+
+   Also, if the function has multiple calls to :c:func:`PyArg_ParseTuple`
+   or :c:func:`PyArg_ParseTupleAndKeywords` where it supports different
+   types for the same argument, or if the function uses something besides
+   PyArg_Parse functions to parse its arguments, it probably
+   isn't suitable for conversion to Argument Clinic.  Argument Clinic
+   doesn't support generic functions or polymorphic parameters.
+
+3. Add the following boilerplate above the function, creating our block::
+
+    /*[clinic input]
+    [clinic start generated code]*/
+
+4. Cut the docstring and paste it in between the ``[clinic]`` lines,
+   removing all the junk that makes it a properly quoted C string.
+   When you're done you should have just the text, based at the left
+   margin, with no line wider than 80 characters.
+   (Argument Clinic will preserve indents inside the docstring.)
+
+   If the old docstring had a first line that looked like a function
+   signature, throw that line away.  (The docstring doesn't need it
+   anymore--when you use ``help()`` on your builtin in the future,
+   the first line will be built automatically based on the function's
+   signature.)
+
+   Sample::
+
+    /*[clinic input]
+    Write a pickled representation of obj to the open file.
+    [clinic start generated code]*/
+
+5. If your docstring doesn't have a "summary" line, Argument Clinic will
+   complain.  So let's make sure it has one.  The "summary" line should
+   be a paragraph consisting of a single 80-column line
+   at the beginning of the docstring.
+
+   (Our example docstring consists solely of a summary line, so the sample
+   code doesn't have to change for this step.)
+
+6. Above the docstring, enter the name of the function, followed
+   by a blank line.  This should be the Python name of the function,
+   and should be the full dotted path
+   to the function--it should start with the name of the module,
+   include any sub-modules, and if the function is a method on
+   a class it should include the class name too.
+
+   Sample::
+
+    /*[clinic input]
+    _pickle.Pickler.dump
+
+    Write a pickled representation of obj to the open file.
+    [clinic start generated code]*/
+
+7. If this is the first time that module or class has been used with Argument
+   Clinic in this C file,
+   you must declare the module and/or class.  Proper Argument Clinic hygiene
+   prefers declaring these in a separate block somewhere near the
+   top of the C file, in the same way that include files and statics go at
+   the top.  (In our sample code we'll just show the two blocks next to
+   each other.)
+
+   The name of the class and module should be the same as the one
+   seen by Python.  Check the name defined in the :c:type:`PyModuleDef`
+   or :c:type:`PyTypeObject` as appropriate.
+
+   When you declare a class, you must also specify two aspects of its type
+   in C: the type declaration you'd use for a pointer to an instance of
+   this class, and a pointer to the :c:type:`PyTypeObject` for this class.
+
+   Sample::
+
+       /*[clinic input]
+       module _pickle
+       class _pickle.Pickler "PicklerObject *" "&Pickler_Type"
+       [clinic start generated code]*/
+
+       /*[clinic input]
+       _pickle.Pickler.dump
+
+       Write a pickled representation of obj to the open file.
+       [clinic start generated code]*/
+
+
+
+
+8. Declare each of the parameters to the function.  Each parameter
+   should get its own line.  All the parameter lines should be
+   indented from the function name and the docstring.
+
+   The general form of these parameter lines is as follows::
+
+       name_of_parameter: converter
+
+   If the parameter has a default value, add that after the
+   converter::
+
+       name_of_parameter: converter = default_value
+
+   Argument Clinic's support for "default values" is quite sophisticated;
+   please see :ref:`the section below on default values <default_values>`
+   for more information.
+
+   Add a blank line below the parameters.
+
+   What's a "converter"?  It establishes both the type
+   of the variable used in C, and the method to convert the Python
+   value into a C value at runtime.
+   For now you're going to use what's called a "legacy converter"--a
+   convenience syntax intended to make porting old code into Argument
+   Clinic easier.
+
+   For each parameter, copy the "format unit" for that
+   parameter from the ``PyArg_Parse()`` format argument and
+   specify *that* as its converter, as a quoted
+   string.  ("format unit" is the formal name for the one-to-three
+   character substring of the ``format`` parameter that tells
+   the argument parsing function what the type of the variable
+   is and how to convert it.  For more on format units please
+   see :ref:`arg-parsing`.)
+
+   For multicharacter format units like ``z#``, use the
+   entire two-or-three character string.
+
+   Sample::
+
+        /*[clinic input]
+        module _pickle
+        class _pickle.Pickler "PicklerObject *" "&Pickler_Type"
+        [clinic start generated code]*/
+
+        /*[clinic input]
+        _pickle.Pickler.dump
+
+           obj: 'O'
+
+       Write a pickled representation of obj to the open file.
+       [clinic start generated code]*/
+
+9. If your function has ``|`` in the format string, meaning some
+   parameters have default values, you can ignore it.  Argument
+   Clinic infers which parameters are optional based on whether
+   or not they have default values.
+
+   If your function has ``$`` in the format string, meaning it
+   takes keyword-only arguments, specify ``*`` on a line by
+   itself before the first keyword-only argument, indented the
+   same as the parameter lines.
+
+   (``_pickle.Pickler.dump`` has neither, so our sample is unchanged.)
+
+
+10. If the existing C function calls :c:func:`PyArg_ParseTuple`
+    (as opposed to :c:func:`PyArg_ParseTupleAndKeywords`), then all its
+    arguments are positional-only.
+
+    To mark all parameters as positional-only in Argument Clinic,
+    add a ``/`` on a line by itself after the last parameter,
+    indented the same as the parameter lines.
+
+    Currently this is all-or-nothing; either all parameters are
+    positional-only, or none of them are.  (In the future Argument
+    Clinic may relax this restriction.)
+
+    Sample::
+
+        /*[clinic input]
+        module _pickle
+        class _pickle.Pickler "PicklerObject *" "&Pickler_Type"
+        [clinic start generated code]*/
+
+        /*[clinic input]
+        _pickle.Pickler.dump
+
+            obj: 'O'
+            /
+
+        Write a pickled representation of obj to the open file.
+        [clinic start generated code]*/
+
+11. It's helpful to write a per-parameter docstring for each parameter.
+    But per-parameter docstrings are optional; you can skip this step
+    if you prefer.
+
+    Here's how to add a per-parameter docstring.  The first line
+    of the per-parameter docstring must be indented further than the
+    parameter definition.  The left margin of this first line establishes
+    the left margin for the whole per-parameter docstring; all the text
+    you write will be outdented by this amount.  You can write as much
+    text as you like, across multiple lines if you wish.
+
+    Sample::
+
+        /*[clinic input]
+        module _pickle
+        class _pickle.Pickler "PicklerObject *" "&Pickler_Type"
+        [clinic start generated code]*/
+
+        /*[clinic input]
+        _pickle.Pickler.dump
+
+            obj: 'O'
+                The object to be pickled.
+            /
+
+        Write a pickled representation of obj to the open file.
+        [clinic start generated code]*/
+
+12. Save and close the file, then run ``Tools/clinic/clinic.py`` on it.
+    With luck everything worked and your block now has output!  Reopen
+    the file in your text editor to see::
+
+       /*[clinic input]
+       module _pickle
+       class _pickle.Pickler "PicklerObject *" "&Pickler_Type"
+       [clinic start generated code]*/
+       /*[clinic end generated code: checksum=da39a3ee5e6b4b0d3255bfef95601890afd80709]*/
+
+       /*[clinic input]
+       _pickle.Pickler.dump
+
+           obj: 'O'
+               The object to be pickled.
+           /
+
+       Write a pickled representation of obj to the open file.
+       [clinic start generated code]*/
+
+       PyDoc_STRVAR(_pickle_Pickler_dump__doc__,
+       "Write a pickled representation of obj to the open file.\n"
+       "\n"
+       ...
+       static PyObject *
+       _pickle_Pickler_dump_impl(PicklerObject *self, PyObject *obj)
+       /*[clinic end generated code: checksum=3bd30745bf206a48f8b576a1da3d90f55a0a4187]*/
+
+    Obviously, if Argument Clinic didn't produce any output, it's because
+    it found an error in your input.  Keep fixing your errors and retrying
+    until Argument Clinic processes your file without complaint.
+
+13. Double-check that the argument-parsing code Argument Clinic generated
+    looks basically the same as the existing code.
+
+    First, ensure both places use the same argument-parsing function.
+    The existing code must call either
+    :c:func:`PyArg_ParseTuple` or :c:func:`PyArg_ParseTupleAndKeywords`;
+    ensure that the code generated by Argument Clinic calls the
+    *exact* same function.
+
+    Second, the format string passed in to :c:func:`PyArg_ParseTuple` or
+    :c:func:`PyArg_ParseTupleAndKeywords` should be *exactly* the same
+    as the hand-written one in the existing function, up to the colon
+    or semi-colon.
+
+    (Argument Clinic always generates its format strings
+    with a ``:`` followed by the name of the function.  If the
+    existing code's format string ends with ``;``, to provide
+    usage help, this change is harmless--don't worry about it.)
+
+    Third, for parameters whose format units require two arguments
+    (like a length variable, or an encoding string, or a pointer
+    to a conversion function), ensure that the second argument is
+    *exactly* the same between the two invocations.
+
+    Fourth, inside the output portion of the block you'll find a preprocessor
+    macro defining the appropriate static :c:type:`PyMethodDef` structure for
+    this builtin::
+
+        #define __PICKLE_PICKLER_DUMP_METHODDEF    \
+        {"dump", (PyCFunction)__pickle_Pickler_dump, METH_O, __pickle_Pickler_dump__doc__},
+
+    This static structure should be *exactly* the same as the existing static
+    :c:type:`PyMethodDef` structure for this builtin.
+
+    If any of these items differ in *any way*,
+    adjust your Argument Clinic function specification and rerun
+    ``Tools/clinic/clinic.py`` until they *are* the same.
+
+
+14. Notice that the last line of its output is the declaration
+    of your "impl" function.  This is where the builtin's implementation goes.
+    Delete the existing prototype of the function you're modifying, but leave
+    the opening curly brace.  Now delete its argument parsing code and the
+    declarations of all the variables it dumps the arguments into.
+    Notice how the Python arguments are now arguments to this impl function;
+    if the implementation used different names for these variables, fix it.
+
+    Let's reiterate, just because it's kind of weird.  Your code should now
+    look like this::
+
+        static return_type
+        your_function_impl(...)
+        /*[clinic end generated code: checksum=...]*/
+        {
+        ...
+
+    Argument Clinic generated the checksum line and the function prototype just
+    above it.  You should write the opening (and closing) curly braces for the
+    function, and the implementation inside.
+
+    Sample::
+
+        /*[clinic input]
+        module _pickle
+        class _pickle.Pickler "PicklerObject *" "&Pickler_Type"
+        [clinic start generated code]*/
+        /*[clinic end generated code: checksum=da39a3ee5e6b4b0d3255bfef95601890afd80709]*/
+
+        /*[clinic input]
+        _pickle.Pickler.dump
+
+            obj: 'O'
+                The object to be pickled.
+            /
+
+        Write a pickled representation of obj to the open file.
+        [clinic start generated code]*/
+
+        PyDoc_STRVAR(__pickle_Pickler_dump__doc__,
+        "Write a pickled representation of obj to the open file.\n"
+        "\n"
+        ...
+        static PyObject *
+        _pickle_Pickler_dump_impl(PicklerObject *self, PyObject *obj)
+        /*[clinic end generated code: checksum=3bd30745bf206a48f8b576a1da3d90f55a0a4187]*/
+        {
+            /* Check whether the Pickler was initialized correctly (issue3664).
+               Developers often forget to call __init__() in their subclasses, which
+               would trigger a segfault without this check. */
+            if (self->write == NULL) {
+                PyErr_Format(PicklingError,
+                             "Pickler.__init__() was not called by %s.__init__()",
+                             Py_TYPE(self)->tp_name);
+                return NULL;
+            }
+
+            if (_Pickler_ClearBuffer(self) < 0)
+                return NULL;
+
+            ...
+
+15. Remember the macro with the :c:type:`PyMethodDef` structure for this
+    function?  Find the existing :c:type:`PyMethodDef` structure for this
+    function and replace it with a reference to the macro.  (If the builtin
+    is at module scope, this will probably be very near the end of the file;
+    if the builtin is a class method, this will probably be below but relatively
+    near to the implementation.)
+
+    Note that the body of the macro contains a trailing comma.  So when you
+    replace the existing static :c:type:`PyMethodDef` structure with the macro,
+    *don't* add a comma to the end.
+
+    Sample::
+
+        static struct PyMethodDef Pickler_methods[] = {
+            __PICKLE_PICKLER_DUMP_METHODDEF
+            __PICKLE_PICKLER_CLEAR_MEMO_METHODDEF
+            {NULL, NULL}                /* sentinel */
+        };
+
+
+16. Compile, then run the relevant portions of the regression-test suite.
+    This change should not introduce any new compile-time warnings or errors,
+    and there should be no externally-visible change to Python's behavior.
+
+    Well, except for one difference: ``inspect.signature()`` run on your function
+    should now provide a valid signature!
+
+    Congratulations, you've ported your first function to work with Argument Clinic!
+
+Advanced Topics
+===============
+
+Now that you've had some experience working with Argument Clinic, it's time
+for some advanced topics.
+
+
+Symbolic default values
+-----------------------
+
+The default value you provide for a parameter can't be any arbitrary
+expression.  Currently the following are explicitly supported:
+
+* Numeric constants (integer and float)
+* String constants
+* ``True``, ``False``, and ``None``
+* Simple symbolic constants like ``sys.maxsize``, which must
+  start with the name of the module
+
+In case you're curious, this is implemented in  ``from_builtin()``
+in ``Lib/inspect.py``.
+
+(In the future, this may need to get even more elaborate,
+to allow full expressions like ``CONSTANT - 1``.)
+
+
+Renaming the C functions and variables generated by Argument Clinic
+-------------------------------------------------------------------
+
+Argument Clinic automatically names the functions it generates for you.
+Occasionally this may cause a problem, if the generated name collides with
+the name of an existing C function.  There's an easy solution: override the names
+used for the C functions.  Just add the keyword ``"as"``
+to your function declaration line, followed by the function name you wish to use.
+Argument Clinic will use that function name for the base (generated) function,
+then add ``"_impl"`` to the end and use that for the name of the impl function.
+
+For example, if we wanted to rename the C function names generated for
+``pickle.Pickler.dump``, it'd look like this::
+
+    /*[clinic input]
+    pickle.Pickler.dump as pickler_dumper
+
+    ...
+
+The base function would now be named ``pickler_dumper()``,
+and the impl function would now be named ``pickler_dumper_impl()``.
+
+
+Similarly, you may have a problem where you want to give a parameter
+a specific Python name, but that name may be inconvenient in C.  Argument
+Clinic allows you to give a parameter different names in Python and in C,
+using the same ``"as"`` syntax::
+
+    /*[clinic input]
+    pickle.Pickler.dump
+
+        obj: object
+        file as file_obj: object
+        protocol: object = NULL
+        *
+        fix_imports: bool = True
+
+Here, the name used in Python (in the signature and the ``keywords``
+array) would be ``file``, but the C variable would be named ``file_obj``.
+
+You can use this to rename the ``self`` parameter too!
+
+
+Converting functions using PyArg_UnpackTuple
+--------------------------------------------
+
+To convert a function parsing its arguments with :c:func:`PyArg_UnpackTuple`,
+simply write out all the arguments, specifying each as an ``object``.  You
+may specify the ``type`` argument to cast the type as appropriate.  All
+arguments should be marked positional-only (add a ``/`` on a line by itself
+after the last argument).
+
+Currently the generated code will use :c:func:`PyArg_ParseTuple`, but this
+will change soon.
+
+Optional Groups
+---------------
+
+Some legacy functions have a tricky approach to parsing their arguments:
+they count the number of positional arguments, then use a ``switch`` statement
+to call one of several different :c:func:`PyArg_ParseTuple` calls depending on
+how many positional arguments there are.  (These functions cannot accept
+keyword-only arguments.)  This approach was used to simulate optional
+arguments back before :c:func:`PyArg_ParseTupleAndKeywords` was created.
+
+While functions using this approach can often be converted to
+use :c:func:`PyArg_ParseTupleAndKeywords`, optional arguments, and default values,
+it's not always possible.  Some of these legacy functions have
+behaviors :c:func:`PyArg_ParseTupleAndKeywords` doesn't directly support.
+The most obvious example is the builtin function ``range()``, which has
+an optional argument on the *left* side of its required argument!
+Another example is ``curses.window.addch()``, which has a group of two
+arguments that must always be specified together.  (The arguments are
+called ``x`` and ``y``; if you call the function passing in ``x``,
+you must also pass in ``y``--and if you don't pass in ``x`` you may not
+pass in ``y`` either.)
+
+In any case, the goal of Argument Clinic is to support argument parsing
+for all existing CPython builtins without changing their semantics.
+Therefore Argument Clinic supports
+this alternate approach to parsing, using what are called *optional groups*.
+Optional groups are groups of arguments that must all be passed in together.
+They can be to the left or the right of the required arguments.  They
+can *only* be used with positional-only parameters.
+
+.. note:: Optional groups are *only* intended for use when converting
+          functions that make multiple calls to :c:func:`PyArg_ParseTuple`!
+          Functions that use *any* other approach for parsing arguments
+          should *almost never* be converted to Argument Clinic using
+          optional groups.  Functions using optional groups currently
+          cannot have accurate sigantures in Python, because Python just
+          doesn't understand the concept.  Please avoid using optional
+          groups wherever possible.
+
+To specify an optional group, add a ``[`` on a line by itself before
+the parameters you wish to group together, and a ``]`` on a line by itself
+after these parameters.  As an example, here's how ``curses.window.addch``
+uses optional groups to make the first two parameters and the last
+parameter optional::
+
+    /*[clinic input]
+
+    curses.window.addch
+
+        [
+        x: int
+          X-coordinate.
+        y: int
+          Y-coordinate.
+        ]
+
+        ch: object
+          Character to add.
+
+        [
+        attr: long
+          Attributes for the character.
+        ]
+        /
+
+    ...
+
+
+Notes:
+
+* For every optional group, one additional parameter will be passed into the
+  impl function representing the group.  The parameter will be an int named
+  ``group_{direction}_{number}``,
+  where ``{direction}`` is either ``right`` or ``left`` depending on whether the group
+  is before or after the required parameters, and ``{number}`` is a monotonically
+  increasing number (starting at 1) indicating how far away the group is from
+  the required parameters.  When the impl is called, this parameter will be set
+  to zero if this group was unused, and set to non-zero if this group was used.
+  (By used or unused, I mean whether or not the parameters received arguments
+  in this invocation.)
+
+* If there are no required arguments, the optional groups will behave
+  as if they're to the right of the required arguments.
+
+* In the case of ambiguity, the argument parsing code
+  favors parameters on the left (before the required parameters).
+
+* Optional groups can only contain positional-only parameters.
+
+* Optional groups are *only* intended for legacy code.  Please do not
+  use optional groups for new code.
+
+
+Using real Argument Clinic converters, instead of "legacy converters"
+---------------------------------------------------------------------
+
+To save time, and to minimize how much you need to learn
+to achieve your first port to Argument Clinic, the walkthrough above tells
+you to use "legacy converters".  "Legacy converters" are a convenience,
+designed explicitly to make porting existing code to Argument Clinic
+easier.  And to be clear, their use is acceptable when porting code for
+Python 3.4.
+
+However, in the long term we probably want all our blocks to
+use Argument Clinic's real syntax for converters.  Why?  A couple
+reasons:
+
+* The proper converters are far easier to read and clearer in their intent.
+* There are some format units that are unsupported as "legacy converters",
+  because they require arguments, and the legacy converter syntax doesn't
+  support specifying arguments.
+* In the future we may have a new argument parsing library that isn't
+  restricted to what :c:func:`PyArg_ParseTuple` supports; this flexibility
+  won't be available to parameters using legacy converters.
+
+Therefore, if you don't mind a little extra effort, please use the normal
+converters instead of legacy converters.
+
+In a nutshell, the syntax for Argument Clinic (non-legacy) converters
+looks like a Python function call.  However, if there are no explicit
+arguments to the function (all functions take their default values),
+you may omit the parentheses.  Thus ``bool`` and ``bool()`` are exactly
+the same converters.
+
+All arguments to Argument Clinic converters are keyword-only.
+All Argument Clinic converters accept the following arguments:
+
+  ``c_default``
+    The default value for this parameter when defined in C.
+    Specifically, this will be the initializer for the variable declared
+    in the "parse function".  See :ref:`the section on default values <default_values>`
+    for how to use this.
+    Specified as a string.
+
+  ``annotation``
+    The annotation value for this parameter.  Not currently supported,
+    because PEP 8 mandates that the Python library may not use
+    annotations.
+
+In addition, some converters accept additional arguments.  Here is a list
+of these arguments, along with their meanings:
+
+  ``bitwise``
+    Only supported for unsigned integers.  The native integer value of this
+    Python argument will be written to the parameter without any range checking,
+    even for negative values.
+
+  ``converter``
+    Only supported by the ``object`` converter.  Specifies the name of a
+    :ref:`C "converter function" <o_ampersand>`
+    to use to convert this object to a native type.
+
+  ``encoding``
+    Only supported for strings.  Specifies the encoding to use when converting
+    this string from a Python str (Unicode) value into a C ``char *`` value.
+
+  ``length``
+    Only supported for strings.  If true, requests that the length of the
+    string be passed in to the impl function, just after the string parameter,
+    in a parameter named ``<parameter_name>_length``.
+
+  ``nullable``
+    Only supported for strings.  If true, this parameter may also be set to
+    ``None``, in which case the C parameter will be set to ``NULL``.
+
+  ``subclass_of``
+    Only supported for the ``object`` converter.  Requires that the Python
+    value be a subclass of a Python type, as expressed in C.
+
+  ``types``
+    Only supported for the ``object`` (and ``self``) converter.  Specifies
+    the C type that will be used to declare the variable.  Default value is
+    ``"PyObject *"``.
+
+  ``types``
+    A string containing a list of Python types (and possibly pseudo-types);
+    this restricts the allowable Python argument to values of these types.
+    (This is not a general-purpose facility; as a rule it only supports
+    specific lists of types as shown in the legacy converter table.)
+
+  ``zeroes``
+    Only supported for strings.  If true, embedded NUL bytes (``'\\0'``) are
+    permitted inside the value.
+
+Please note, not every possible combination of arguments will work.
+Often these arguments are implemented internally by specific ``PyArg_ParseTuple``
+*format units*, with specific behavior.  For example, currently you cannot
+call ``str`` and pass in ``zeroes=True`` without also specifying an ``encoding``;
+although it's perfectly reasonable to think this would work, these semantics don't
+map to any existing format unit.  So Argument Clinic doesn't support it.  (Or, at
+least, not yet.)
+
+Below is a table showing the mapping of legacy converters into real
+Argument Clinic converters.  On the left is the legacy converter,
+on the right is the text you'd replace it with.
+
+=========   =================================================================================
+``'B'``     ``unsigned_char(bitwise=True)``
+``'b'``     ``unsigned_char``
+``'c'``     ``char``
+``'C'``     ``int(types='str')``
+``'d'``     ``double``
+``'D'``     ``Py_complex``
+``'es#'``   ``str(encoding='name_of_encoding', length=True, zeroes=True)``
+``'es'``    ``str(encoding='name_of_encoding')``
+``'et#'``   ``str(encoding='name_of_encoding', types='bytes bytearray str', length=True)``
+``'et'``    ``str(encoding='name_of_encoding', types='bytes bytearray str')``
+``'f'``     ``float``
+``'h'``     ``short``
+``'H'``     ``unsigned_short(bitwise=True)``
+``'i'``     ``int``
+``'I'``     ``unsigned_int(bitwise=True)``
+``'k'``     ``unsigned_long(bitwise=True)``
+``'K'``     ``unsigned_PY_LONG_LONG(bitwise=True)``
+``'L'``     ``PY_LONG_LONG``
+``'n'``     ``Py_ssize_t``
+``'O!'``    ``object(subclass_of='&PySomething_Type')``
+``'O&'``    ``object(converter='name_of_c_function')``
+``'O'``     ``object``
+``'p'``     ``bool``
+``'s#'``    ``str(length=True)``
+``'S'``     ``PyBytesObject``
+``'s'``     ``str``
+``'s*'``    ``Py_buffer(types='str bytes bytearray buffer')``
+``'u#'``    ``Py_UNICODE(length=True)``
+``'u'``     ``Py_UNICODE``
+``'U'``     ``unicode``
+``'w*'``    ``Py_buffer(types='bytearray rwbuffer')``
+``'y#'``    ``str(types='bytes', length=True)``
+``'Y'``     ``PyByteArrayObject``
+``'y'``     ``str(types='bytes')``
+``'y*'``    ``Py_buffer``
+``'Z#'``    ``Py_UNICODE(nullable=True, length=True)``
+``'z#'``    ``str(nullable=True, length=True)``
+``'Z'``     ``Py_UNICODE(nullable=True)``
+``'z'``     ``str(nullable=True)``
+``'z*'``    ``Py_buffer(types='str bytes bytearray buffer', nullable=True)``
+=========   =================================================================================
+
+As an example, here's our sample ``pickle.Pickler.dump`` using the proper
+converter::
+
+    /*[clinic input]
+    pickle.Pickler.dump
+
+        obj: object
+            The object to be pickled.
+        /
+
+    Write a pickled representation of obj to the open file.
+    [clinic start generated code]*/
+
+Argument Clinic will show you all the converters it has
+available.  For each converter it'll show you all the parameters
+it accepts, along with the default value for each parameter.
+Just run ``Tools/clinic/clinic.py --converters`` to see the full list.
+
+Py_buffer
+---------
+
+When using the ``Py_buffer`` converter
+(or the ``'s*'``, ``'w*'``, ``'*y'``, or ``'z*'`` legacy converters),
+you *must* not call :c:func:`PyBuffer_Release` on the provided buffer.
+Argument Clinic generates code that does it for you (in the parsing function).
+
+
+
+Advanced converters
+-------------------
+
+Remeber those format units you skipped for your first
+time because they were advanced?  Here's how to handle those too.
+
+The trick is, all those format units take arguments--either
+conversion functions, or types, or strings specifying an encoding.
+(But "legacy converters" don't support arguments.  That's why we
+skipped them for your first function.)  The argument you specified
+to the format unit is now an argument to the converter; this
+argument is either ``converter`` (for ``O&``), ``subclass_of`` (for ``O!``),
+or ``encoding`` (for all the format units that start with ``e``).
+
+When using ``subclass_of``, you may also want to use the other
+custom argument for ``object()``: ``type``, which lets you set the type
+actually used for the parameter.  For example, if you want to ensure
+that the object is a subclass of ``PyUnicode_Type``, you probably want
+to use the converter ``object(type='PyUnicodeObject *', subclass_of='&PyUnicode_Type')``.
+
+One possible problem with using Argument Clinic: it takes away some possible
+flexibility for the format units starting with ``e``.  When writing a
+``PyArg_Parse`` call by hand, you could theoretically decide at runtime what
+encoding string to pass in to :c:func:`PyArg_ParseTuple`.   But now this string must
+be hard-coded at Argument-Clinic-preprocessing-time.  This limitation is deliberate;
+it made supporting this format unit much easier, and may allow for future optimizations.
+This restriction doesn't seem unreasonable; CPython itself always passes in static
+hard-coded encoding strings for parameters whose format units start with ``e``.
+
+
+.. _default_values:
+
+Parameter default values
+------------------------
+
+Default values for parameters can be any of a number of values.
+At their simplest, they can be string, int, or float literals::
+
+    foo: str = "abc"
+    bar: int = 123
+    bat: float = 45.6
+
+They can also use any of Python's built-in constants::
+
+    yep:  bool = True
+    nope: bool = False
+    nada: object = None
+
+There's also special support for a default value of ``NULL``, and
+for simple expressions, documented in the following sections.
+
+
+The ``NULL`` default value
+--------------------------
+
+For string and object parameters, you can set them to ``None`` to indicate
+that there's no default.  However, that means the C variable will be
+initialized to ``Py_None``.  For convenience's sakes, there's a special
+value called ``NULL`` for just this reason: from Python's perspective it
+behaves like a default value of ``None``, but the C variable is initialized
+with ``NULL``.
+
+Expressions specified as default values
+---------------------------------------
+
+The default value for a parameter can be more than just a literal value.
+It can be an entire expression, using math operators and looking up attributes
+on objects.  However, this support isn't exactly simple, because of some
+non-obvious semantics.
+
+Consider the following example::
+
+    foo: Py_ssize_t = sys.maxsize - 1
+
+``sys.maxsize`` can have different values on different platforms.  Therefore
+Argument Clinic can't simply evaluate that expression locally and hard-code it
+in C.  So it stores the default in such a way that it will get evaluated at
+runtime, when the user asks for the function's signature.
+
+What namespace is available when the expression is evaluated?  It's evaluated
+in the context of the module the builtin came from.  So, if your module has an
+attribute called "``max_widgets``", you may simply use it::
+
+    foo: Py_ssize_t = max_widgets
+
+If the symbol isn't found in the current module, it fails over to looking in
+``sys.modules``.  That's how it can find ``sys.maxsize`` for example.  (Since you
+don't know in advance what modules the user will load into their interpreter,
+it's best to restrict yourself to modules that are preloaded by Python itself.)
+
+Evaluating default values only at runtime means Argument Clinic can't compute
+the correct equivalent C default value.  So you need to tell it explicitly.
+When you use an expression, you must also specify the equivalent expression
+in C, using the ``c_default`` parameter to the converter::
+
+    foo: Py_ssize_t(c_default="PY_SSIZE_T_MAX - 1") = sys.maxsize - 1
+
+Another complication: Argument Clinic can't know in advance whether or not the
+expression you supply is valid.  It parses it to make sure it looks legal, but
+it can't *actually* know.  You must be very careful when using expressions to
+specify values that are guaranteed to be valid at runtime!
+
+Finally, because expressions must be representable as static C values, there
+are many restrictions on legal expressions.  Here's a list of Python features
+you're not permitted to use:
+
+* Function calls.
+* Inline if statements (``3 if foo else 5``).
+* Automatic sequence unpacking (``*[1, 2, 3]``).
+* List/set/dict comprehensions and generator expressions.
+* Tuple/list/set/dict literals.
+
+
+
+Using a return converter
+------------------------
+
+By default the impl function Argument Clinic generates for you returns ``PyObject *``.
+But your C function often computes some C type, then converts it into the ``PyObject *``
+at the last moment.  Argument Clinic handles converting your inputs from Python types
+into native C types--why not have it convert your return value from a native C type
+into a Python type too?
+
+That's what a "return converter" does.  It changes your impl function to return
+some C type, then adds code to the generated (non-impl) function to handle converting
+that value into the appropriate ``PyObject *``.
+
+The syntax for return converters is similar to that of parameter converters.
+You specify the return converter like it was a return annotation on the
+function itself.  Return converters behave much the same as parameter converters;
+they take arguments, the arguments are all keyword-only, and if you're not changing
+any of the default arguments you can omit the parentheses.
+
+(If you use both ``"as"`` *and* a return converter for your function,
+the ``"as"`` should come before the return converter.)
+
+There's one additional complication when using return converters: how do you
+indicate an error has occured?  Normally, a function returns a valid (non-``NULL``)
+pointer for success, and ``NULL`` for failure.  But if you use an integer return converter,
+all integers are valid.  How can Argument Clinic detect an error?  Its solution: each return
+converter implicitly looks for a special value that indicates an error.  If you return
+that value, and an error has been set (``PyErr_Occurred()`` returns a true
+value), then the generated code will propogate the error.  Otherwise it will
+encode the value you return like normal.
+
+Currently Argument Clinic supports only a few return converters::
+
+    bool
+    int
+    unsigned int
+    long
+    unsigned int
+    size_t
+    Py_ssize_t
+    float
+    double
+    DecodeFSDefault
+
+None of these take parameters.  For the first three, return -1 to indicate
+error.  For ``DecodeFSDefault``, the return type is ``char *``; return a NULL
+pointer to indicate an error.
+
+(There's also an experimental ``NoneType`` converter, which lets you
+return ``Py_None`` on success or ``NULL`` on failure, without having
+to increment the reference count on ``Py_None``.  I'm not sure it adds
+enough clarity to be worth using.)
+
+To see all the return converters Argument Clinic supports, along with
+their parameters (if any),
+just run ``Tools/clinic/clinic.py --converters`` for the full list.
+
+
+Cloning existing functions
+--------------------------
+
+If you have a number of functions that look similar, you may be able to
+use Clinic's "clone" feature.  When you clone an existing function,
+you reuse:
+
+* its parameters, including
+
+  * their names,
+
+  * their converters, with all parameters,
+
+  * their default values,
+
+  * their per-parameter docstrings,
+
+  * their *kind* (whether they're positional only,
+    positional or keyword, or keyword only), and
+
+* its return converter.
+
+The only thing not copied from the original function is its docstring;
+the syntax allows you to specify a new docstring.
+
+Here's the syntax for cloning a function::
+
+    /*[clinic input]
+    module.class.new_function [as c_basename] = module.class.existing_function
+
+    Docstring for new_function goes here.
+    [clinic start generated code]*/
+
+(The functions can be in different modules or classes.  I wrote
+``module.class`` in the sample just to illustrate that you must
+use the full path to *both* functions.)
+
+Sorry, there's no syntax for partially-cloning a function, or cloning a function
+then modifying it.  Cloning is an all-or nothing proposition.
+
+Also, the function you are cloning from must have been previously defined
+in the current file.
+
+Calling Python code
+-------------------
+
+The rest of the advanced topics require you to write Python code
+which lives inside your C file and modifies Argument Clinic's
+runtime state.  This is simple: you simply define a Python block.
+
+A Python block uses different delimiter lines than an Argument
+Clinic function block.  It looks like this::
+
+    /*[python input]
+    # python code goes here
+    [python start generated code]*/
+
+All the code inside the Python block is executed at the
+time it's parsed.  All text written to stdout inside the block
+is redirected into the "output" after the block.
+
+As an example, here's a Python block that adds a static integer
+variable to the C code::
+
+    /*[python input]
+    print('static int __ignored_unused_variable__ = 0;')
+    [python start generated code]*/
+    static int __ignored_unused_variable__ = 0;
+    /*[python checksum:...]*/
+
+
+Using a "self converter"
+------------------------
+
+Argument Clinic automatically adds a "self" parameter for you
+using a default converter.  It automatically sets the ``type``
+of this parameter to the "pointer to an instance" you specified
+when you declared the type.  However, you can override
+Argument Clinic's converter and specify one yourself.
+Just add your own ``self`` parameter as the first parameter in a
+block, and ensure that its converter is an instance of
+``self_converter`` or a subclass thereof.
+
+What's the point?  This lets you override the type of ``self``,
+or give it a different default name.
+
+How do you specify the custom type you want to cast ``self`` to?
+If you only have one or two functions with the same type for ``self``,
+you can directly use Argument Clinic's existing ``self`` converter,
+passing in the type you want to use as the ``type`` parameter::
+
+    /*[clinic input]
+
+    _pickle.Pickler.dump
+
+      self: self(type="PicklerObject *")
+      obj: object
+      /
+
+    Write a pickled representation of the given object to the open file.
+    [clinic start generated code]*/
+
+On the other hand, if you have a lot of functions that will use the same
+type for ``self``, it's best to create your own converter, subclassing
+``self_converter`` but overwriting the ``type`` member::
+
+    /*[python input]
+    class PicklerObject_converter(self_converter):
+        type = "PicklerObject *"
+    [python start generated code]*/
+
+    /*[clinic input]
+
+    _pickle.Pickler.dump
+
+      self: PicklerObject
+      obj: object
+      /
+
+    Write a pickled representation of the given object to the open file.
+    [clinic start generated code]*/
+
+
+
+Writing a custom converter
+--------------------------
+
+As we hinted at in the previous section... you can write your own converters!
+A converter is simply a Python class that inherits from ``CConverter``.
+The main purpose of a custom converter is if you have a parameter using
+the ``O&`` format unit--parsing this parameter means calling
+a :c:func:`PyArg_ParseTuple` "converter function".
+
+Your converter class should be named ``*something*_converter``.
+If the name follows this convention, then your converter class
+will be automatically registered with Argument Clinic; its name
+will be the name of your class with the ``_converter`` suffix
+stripped off.  (This is accomplished with a metaclass.)
+
+You shouldn't subclass ``CConverter.__init__``.  Instead, you should
+write a ``converter_init()`` function.  ``converter_init()``
+always accepts a ``self`` parameter; after that, all additional
+parameters *must* be keyword-only.  Any arguments passed in to
+the converter in Argument Clinic will be passed along to your
+``converter_init()``.
+
+There are some additional members of ``CConverter`` you may wish
+to specify in your subclass.  Here's the current list:
+
+``type``
+    The C type to use for this variable.
+    ``type`` should be a Python string specifying the type, e.g. ``int``.
+    If this is a pointer type, the type string should end with ``' *'``.
+
+``default``
+    The Python default value for this parameter, as a Python value.
+    Or the magic value ``unspecified`` if there is no default.
+
+``py_default``
+    ``default`` as it should appear in Python code,
+    as a string.
+    Or ``None`` if there is no default.
+
+``c_default``
+    ``default`` as it should appear in C code,
+    as a string.
+    Or ``None`` if there is no default.
+
+``c_ignored_default``
+    The default value used to initialize the C variable when
+    there is no default, but not specifying a default may
+    result in an "uninitialized variable" warning.  This can
+    easily happen when using option groups--although
+    properly-written code will never actually use this value,
+    the variable does get passed in to the impl, and the
+    C compiler will complain about the "use" of the
+    uninitialized value.  This value should always be a
+    non-empty string.
+
+``converter``
+    The name of the C converter function, as a string.
+
+``impl_by_reference``
+    A boolean value.  If true,
+    Argument Clinic will add a ``&`` in front of the name of
+    the variable when passing it into the impl function.
+
+``parse_by_reference``
+    A boolean value.  If true,
+    Argument Clinic will add a ``&`` in front of the name of
+    the variable when passing it into :c:func:`PyArg_ParseTuple`.
+
+
+Here's the simplest example of a custom converter, from ``Modules/zlibmodule.c``::
+
+    /*[python input]
+
+    class uint_converter(CConverter):
+        type = 'unsigned int'
+        converter = 'uint_converter'
+
+    [python start generated code]*/
+    /*[python end generated code: checksum=da39a3ee5e6b4b0d3255bfef95601890afd80709]*/
+
+This block adds a converter to Argument Clinic named ``uint``.  Parameters
+declared as ``uint`` will be declared as type ``unsigned int``, and will
+be parsed by the ``'O&'`` format unit, which will call the ``uint_converter``
+converter function.
+``uint`` variables automatically support default values.
+
+More sophisticated custom converters can insert custom C code to
+handle initialization and cleanup.
+You can see more examples of custom converters in the CPython
+source tree; grep the C files for the string ``CConverter``.
+
+Writing a custom return converter
+---------------------------------
+
+Writing a custom return converter is much like writing
+a custom converter.  Except it's somewhat simpler, because return
+converters are themselves much simpler.
+
+Return converters must subclass ``CReturnConverter``.
+There are no examples yet of custom return converters,
+because they are not widely used yet.  If you wish to
+write your own return converter, please read ``Tools/clinic/clinic.py``,
+specifically the implementation of ``CReturnConverter`` and
+all its subclasses.
+
+METH_O and METH_NOARGS
+----------------------------------------------
+
+To convert a function using ``METH_O``, make sure the function's
+single argument is using the ``object`` converter, and mark the
+arguments as positional-only::
+
+    /*[clinic input]
+    meth_o_sample
+
+         argument: object
+         /
+    [clinic start generated code]*/
+
+
+To convert a function using ``METH_NOARGS``, just don't specify
+any arguments.
+
+You can still use a self converter, a return converter, and specify
+a ``type`` argument to the object converter for ``METH_O``.
+
+tp_new and tp_init functions
+----------------------------------------------
+
+You can convert ``tp_new`` and ``tp_init`` functions.  Just name
+them ``__new__`` or ``__init__`` as appropriate.  Notes:
+
+* The function name generated for ``__new__`` doesn't end in ``__new__``
+  like it would by default.  It's just the name of the class, converted
+  into a valid C identifier.
+
+* No ``PyMethodDef`` ``#define`` is generated for these functions.
+
+* ``__init__`` functions return ``int``, not ``PyObject *``.
+
+* Use the docstring as the class docstring.
+
+* Although ``__new__`` and ``__init__`` functions must always
+  accept both the ``args`` and ``kwargs`` objects, when converting
+  you may specify any signature for these functions that you like.
+  (If your function doesn't support keywords, the parsing function
+  generated will throw an exception if it receives any.)
+
+Changing and redirecting Clinic's output
+----------------------------------------
+
+It can be inconvenient to have Clinic's output interspersed with
+your conventional hand-edited C code.  Luckily, Clinic is configurable:
+you can buffer up its output for printing later (or earlier!), or write
+its output to a separate file.  You can also add a prefix or suffix to
+every line of Clinic's generated output.
+
+While changing Clinic's output in this manner can be a boon to readability,
+it may result in Clinic code using types before they are defined, or
+your code attempting to use Clinic-generated code befire it is defined.
+These problems can be easily solved by rearranging the declarations in your file,
+or moving where Clinic's generated code goes.  (This is why the default behavior
+of Clinic is to output everything into the current block; while many people
+consider this hampers readability, it will never require rearranging your
+code to fix definition-before-use problems.)
+
+Let's start with defining some terminology:
+
+*field*
+  A field, in this context, is a subsection of Clinic's output.
+  For example, the ``#define`` for the ``PyMethodDef`` structure
+  is a field, called ``methoddef_define``.  Clinic has seven
+  different fields it can output per function definition::
+
+      docstring_prototype
+      docstring_definition
+      methoddef_define
+      impl_prototype
+      parser_prototype
+      parser_definition
+      impl_definition
+
+  All the names are of the form ``"<a>_<b>"``,
+  where ``"<a>"`` is the semantic object represented (the parsing function,
+  the impl function, the docstring, or the methoddef structure) and ``"<b>"``
+  represents what kind of statement the field is.  Field names that end in
+  ``"_prototype"``
+  represent forward declarations of that thing, without the actual body/data
+  of the thing; field names that end in ``"_definition"`` represent the actual
+  definition of the thing, with the body/data of the thing.  (``"methoddef"``
+  is special, it's the only one that ends with ``"_define"``, representing that
+  it's a preprocessor #define.)
+
+*destination*
+  A destination is a place Clinic can write output to.  There are
+  five built-in destinations:
+
+  ``block``
+    The default destination: printed in the output section of
+    the current Clinic block.
+
+  ``buffer``
+    A text buffer where you can save text for later.  Text sent
+    here is appended to the end of any exsiting text.  It's an
+    error to have any text left in the buffer when Clinic finishes
+    processing a file.
+
+  ``file``
+    A separate "clinic file" that will be created automatically by Clinic.
+    The filename chosen for the file is ``{basename}.clinic{extension}``,
+    where ``basename`` and ``extension`` were assigned the output
+    from ``os.path.splitext()`` run on the current file.  (Example:
+    the ``file`` destination for ``_pickle.c`` would be written to
+    ``_pickle.clinic.c``.)
+
+    **Important: When using a** ``file`` **destination, you**
+    *must check in* **the generated file!**
+
+  ``two-pass``
+    A buffer like ``buffer``.  However, a two-pass buffer can only
+    be written once, and it prints out all text sent to it during
+    all of processing, even from Clinic blocks *after* the
+
+  ``suppress``
+    The text is suppressed--thrown away.
+
+
+Clinic defines five new directives that let you reconfigure its output.
+
+The first new directive is ``dump``::
+
+   dump <destination>
+
+This dumps the current contents of the named destination into the output of
+the current block, and empties it.  This only works with ``buffer`` and
+``two-pass`` destinations.
+
+The second new directive is ``output``.  The most basic form of ``output``
+is like this::
+
+    output <field> <destination>
+
+This tells Clinic to output *field* to *destination*.  ``output`` also
+supports a special meta-destination, called ``everything``, which tells
+Clinic to output *all* fields to that *destination*.
+
+``output`` has a number of other functions::
+
+    output push
+    output pop
+    output preset <preset>
+
+
+``output push`` and ``output pop`` allow you to push and pop
+configurations on an internal configuration stack, so that you
+can temporarily modify the output configuration, then easily restore
+the previous configuration.  Simply push before your change to save
+the current configuration, then pop when you wish to restore the
+previous configuration.
+
+``output preset`` sets Clinic's output to one of several built-in
+preset configurations, as follows:
+
+  ``block``
+    Clinic's original starting configuration.  Writes everything
+    immediately after the input block.
+
+    Suppress the ``parser_prototype``
+    and ``docstring_prototype``, write everything else to ``block``.
+
+  ``file``
+    Designed to write everything to the "clinic file" that it can.
+    You then ``#include`` this file near the top of your file.
+    You may need to rearrange your file to make this work, though
+    usually this just means creating forward declarations for various
+    ``typedef`` and ``PyTypeObject`` definitions.
+
+    Suppress the ``parser_prototype``
+    and ``docstring_prototype``, write the ``impl_definition`` to
+    ``block``, and write everything else to ``file``.
+
+    The default filename is ``"{dirname}/clinic/{basename}.h"``.
+
+  ``buffer``
+    Save up all most of the output from Clinic, to be written into
+    your file near the end.  For Python files implementing modules
+    or builtin types, it's recommended that you dump the buffer
+    just above the static structures for your module or
+    builtin type; these are normally very near the end.  Using
+    ``buffer`` may require even more editing than ``file``, if
+    your file has static ``PyMethodDef`` arrays defined in the
+    middle of the file.
+
+    Suppress the ``parser_prototype``, ``impl_prototype``,
+    and ``docstring_prototype``, write the ``impl_definition`` to
+    ``block``, and write everything else to ``file``.
+
+  ``two-pass``
+    Similar to the ``buffer`` preset, but writes forward declarations to
+    the ``two-pass`` buffer, and definitions to the ``buffer``.
+    This is similar to the ``buffer`` preset, but may require
+    less editing than ``buffer``.  Dump the ``two-pass`` buffer
+    near the top of your file, and dump the ``buffer`` near
+    the end just like you would when using the ``buffer`` preset.
+
+    Suppresses the ``impl_prototype``, write the ``impl_definition``
+    to ``block``, write ``docstring_prototype``, ``methoddef_define``,
+    and ``parser_prototype`` to ``two-pass``, write everything else
+    to ``buffer``.
+
+  ``partial-buffer``
+    Similar to the ``buffer`` preset, but writes more things to ``block``,
+    only writing the really big chunks of generated code to ``buffer``.
+    This avoids the definition-before-use problem of ``buffer`` completely,
+    at the small cost of having slightly more stuff in the block's output.
+    Dump the ``buffer`` near the end, just like you would when using
+    the ``buffer`` preset.
+
+    Suppresses the ``impl_prototype``, write the ``docstring_definition``
+    and ``parser_defintion`` to ``buffer``, write everything else to ``block``.
+
+The third new directive is ``destination``::
+
+    destination <name> <command> [...]
+
+This performs an operation on the destination named ``name``.
+
+There are two defined subcommands: ``new`` and ``clear``.
+
+The ``new`` subcommand works like this::
+
+    destination <name> new <type>
+
+This creates a new destination with name ``<name>`` and type ``<type>``.
+
+There are five destination types:
+
+    ``suppress``
+        Throws the text away.
+
+    ``block``
+        Writes the text to the current block.  This is what Clinic
+        originally did.
+
+    ``buffer``
+        A simple text buffer, like the "buffer" builtin destination above.
+
+    ``file``
+        A text file.  The file destination takes an extra argument,
+        a template to use for building the filename, like so:
+
+            destination <name> new <type> <file_template>
+
+        The template can use three strings internally that will be replaced
+        by bits of the filename:
+
+            {path}
+                The full path to the file, including directory and full filename.
+            {dirname}
+                The name of the directory the file is in.
+            {basename}
+                Just the name of the file, not including the directory.
+            {basename_root}
+                Basename with the extension clipped off
+                (everything up to but not including the last '.').
+            {basename_extension}
+                The last '.' and everything after it.  If the basename
+                does not contain a period, this will be the empty string.
+
+        If there are no periods in the filename, {basename} and {filename}
+        are the same, and {extension} is empty.  "{basename}{extension}"
+        is always exactly the same as "{filename}"."
+
+    ``two-pass``
+        A two-pass buffer, like the "two-pass" builtin destination above.
+
+
+The ``clear`` subcommand works like this::
+
+    destination <name> clear
+
+It removes all the accumulated text up to this point in the destination.
+(I don't know what you'd need this for, but I thought maybe it'd be
+useful while someone's experimenting.)
+
+The fourth new directive is ``set``::
+
+    set line_prefix "string"
+    set line_suffix "string"
+
+``set`` lets you set two internal variables in Clinic.
+``line_prefix`` is a string that will be prepended to every line of Clinic's output;
+``line_suffix`` is a string that will be appended to every line of Clinic's output.
+
+Both of these suport two format strings:
+
+  ``{block comment start}``
+    Turns into the string ``/*``, the start-comment text sequence for C files.
+
+  ``{block comment end}``
+    Turns into the string ``*/``, the end-comment text sequence for C files.
+
+The final new directive is one you shouldn't need to use directly,
+called ``preserve``::
+
+    preserve
+
+This tells Clinic that the current contents of the output should be kept, unmodifed.
+This is used internally by Clinic when dumping output into ``file`` files; wrapping
+it in a Clinic block lets Clinic use its existing checksum functionality to ensure
+the file was not modified by hand before it gets overwritten.
+
+
+The #ifdef trick
+----------------------------------------------
+
+If you're converting a function that isn't available on all platforms,
+there's a trick you can use to make life a little easier.  The existing
+code probably looks like this::
+
+    #ifdef HAVE_FUNCTIONNAME
+    static module_functionname(...)
+    {
+    ...
+    }
+    #endif /* HAVE_FUNCTIONNAME */
+
+And then in the ``PyMethodDef`` structure at the bottom the existing code
+will have::
+
+    #ifdef HAVE_FUNCTIONNAME
+    {'functionname', ... },
+    #endif /* HAVE_FUNCTIONNAME */
+
+In this scenario, you should enclose the body of your impl function inside the ``#ifdef``,
+like so::
+
+    #ifdef HAVE_FUNCTIONNAME
+    /*[clinic input]
+    module.functionname
+    ...
+    [clinic start generated code]*/
+    static module_functionname(...)
+    {
+    ...
+    }
+    #endif /* HAVE_FUNCTIONNAME */
+
+Then, remove those three lines from the ``PyMethodDef`` structure,
+replacing them with the macro Argument Clinic generated::
+
+    MODULE_FUNCTIONNAME_METHODDEF
+
+(You can find the real name for this macro inside the generated code.
+Or you can calculate it yourself: it's the name of your function as defined
+on the first line of your block, but with periods changed to underscores,
+uppercased, and ``"_METHODDEF"`` added to the end.)
+
+Perhaps you're wondering: what if ``HAVE_FUNCTIONNAME`` isn't defined?
+The ``MODULE_FUNCTIONNAME_METHODDEF`` macro won't be defined either!
+
+Here's where Argument Clinic gets very clever.  It actually detects that the
+Argument Clinic block might be deactivated by the ``#ifdef``.  When that
+happens, it generates a little extra code that looks like this::
+
+    #ifndef MODULE_FUNCTIONNAME_METHODDEF
+        #define MODULE_FUNCTIONNAME_METHODDEF
+    #endif /* !defined(MODULE_FUNCTIONNAME_METHODDEF) */
+
+That means the macro always works.  If the function is defined, this turns
+into the correct structure, including the trailing comma.  If the function is
+undefined, this turns into nothing.
+
+However, this causes one ticklish problem: where should Argument Clinic put this
+extra code when using the "block" output preset?  It can't go in the output block,
+because that could be decativated by the ``#ifdef``.  (That's the whole point!)
+
+In this situation, Argument Clinic writes the extra code to the "buffer" destination.
+This may mean that you get a complaint from Argument Clinic::
+
+    Warning in file "Modules/posixmodule.c" on line 12357:
+    Destination buffer 'buffer' not empty at end of file, emptying.
+
+When this happens, just open your file, find the ``dump buffer`` block that
+Argument Clinic added to your file (it'll be at the very bottom), then
+move it above the ``PyMethodDef`` structure where that macro is used.
+
+
+
+Using Argument Clinic in Python files
+-------------------------------------
+
+It's actually possible to use Argument Clinic to preprocess Python files.
+There's no point to using Argument Clinic blocks, of course, as the output
+wouldn't make any sense to the Python interpreter.  But using Argument Clinic
+to run Python blocks lets you use Python as a Python preprocessor!
+
+Since Python comments are different from C comments, Argument Clinic
+blocks embedded in Python files look slightly different.  They look like this::
+
+    #/*[python input]
+    #print("def foo(): pass")
+    #[python start generated code]*/
+    def foo(): pass
+    #/*[python checksum:...]*/
diff --git a/Doc/howto/cporting.rst b/Doc/howto/cporting.rst
index 1ad77d6..d7a7086 100644
--- a/Doc/howto/cporting.rst
+++ b/Doc/howto/cporting.rst
@@ -43,10 +43,9 @@
 str/unicode Unification
 -----------------------
 
-
-Python 3's :func:`str` (``PyString_*`` functions in C) type is equivalent to
-Python 2's :func:`unicode` (``PyUnicode_*``).  The old 8-bit string type has
-become :func:`bytes`.  Python 2.6 and later provide a compatibility header,
+Python 3's :func:`str` type is equivalent to Python 2's :func:`unicode`; the C
+functions are called ``PyUnicode_*`` for both.  The old 8-bit string type has become
+:func:`bytes`, with C functions called ``PyBytes_*``.  Python 2.6 and later provide a compatibility header,
 :file:`bytesobject.h`, mapping ``PyBytes`` names to ``PyString`` ones.  For best
 compatibility with Python 3, :c:type:`PyUnicode` should be used for textual data and
 :c:type:`PyBytes` for binary data.  It's also important to remember that
@@ -253,6 +252,6 @@
 =============
 
 If you are writing a new extension module, you might consider `Cython
-<http://www.cython.org>`_.  It translates a Python-like language to C.  The
+<http://cython.org/>`_.  It translates a Python-like language to C.  The
 extension modules it creates are compatible with Python 3 and Python 2.
 
diff --git a/Doc/howto/curses.rst b/Doc/howto/curses.rst
index ea62b1c..87a5cab 100644
--- a/Doc/howto/curses.rst
+++ b/Doc/howto/curses.rst
@@ -538,12 +538,12 @@
 implement, but because no one has needed them yet.  Also, Python
 doesn't yet support the menu library associated with ncurses.
 Patches adding support for these would be welcome; see
-`the Python Developer's Guide <http://docs.python.org/devguide/>`_ to
+`the Python Developer's Guide <https://docs.python.org/devguide/>`_ to
 learn more about submitting patches to Python.
 
 * `Writing Programs with NCURSES <http://invisible-island.net/ncurses/ncurses-intro.html>`_:
   a lengthy tutorial for C programmers.
-* `The ncurses man page <http://www.linuxmanpages.com/man3/ncurses.3x.php>`_
+* `The ncurses man page <http://linux.die.net/man/3/ncurses>`_
 * `The ncurses FAQ <http://invisible-island.net/ncurses/ncurses.faq.html>`_
 * `"Use curses... don't swear" <http://www.youtube.com/watch?v=eN1eZtjLEnU>`_:
   video of a PyCon 2013 talk on controlling terminals using curses or Urwid.
diff --git a/Doc/howto/descriptor.rst b/Doc/howto/descriptor.rst
index a0c6988..f018b0e 100644
--- a/Doc/howto/descriptor.rst
+++ b/Doc/howto/descriptor.rst
@@ -92,9 +92,9 @@
 transforms ``b.x`` into ``type(b).__dict__['x'].__get__(b, type(b))``.  The
 implementation works through a precedence chain that gives data descriptors
 priority over instance variables, instance variables priority over non-data
-descriptors, and assigns lowest priority to :meth:`__getattr__` if provided.  The
-full C implementation can be found in :c:func:`PyObject_GenericGetAttr()` in
-`Objects/object.c <http://svn.python.org/view/python/trunk/Objects/object.c?view=markup>`_\.
+descriptors, and assigns lowest priority to :meth:`__getattr__` if provided.
+The full C implementation can be found in :c:func:`PyObject_GenericGetAttr()` in
+:source:`Objects/object.c`.
 
 For classes, the machinery is in :meth:`type.__getattribute__` which transforms
 ``B.x`` into ``B.__dict__['x'].__get__(None, B)``.  In pure Python, it looks
@@ -124,10 +124,10 @@
 search using :meth:`object.__getattribute__`.
 
 The implementation details are in :c:func:`super_getattro()` in
-`Objects/typeobject.c <http://svn.python.org/view/python/trunk/Objects/typeobject.c?view=markup>`_
-and a pure Python equivalent can be found in `Guido's Tutorial`_.
+:source:`Objects/typeobject.c`.  and a pure Python equivalent can be found in
+`Guido's Tutorial`_.
 
-.. _`Guido's Tutorial`: http://www.python.org/2.2.3/descrintro.html#cooperation
+.. _`Guido's Tutorial`: https://www.python.org/download/releases/2.2.3/descrintro/#cooperation
 
 The details above show that the mechanism for descriptors is embedded in the
 :meth:`__getattribute__()` methods for :class:`object`, :class:`type`, and
@@ -300,10 +300,9 @@
 
 The output suggests that bound and unbound methods are two different types.
 While they could have been implemented that way, the actual C implementation of
-:c:type:`PyMethod_Type` in
-`Objects/classobject.c <http://svn.python.org/view/python/trunk/Objects/classobject.c?view=markup>`_
-is a single object with two different representations depending on whether the
-:attr:`im_self` field is set or is *NULL* (the C equivalent of *None*).
+:c:type:`PyMethod_Type` in :source:`Objects/classobject.c` is a single object
+with two different representations depending on whether the :attr:`im_self`
+field is set or is *NULL* (the C equivalent of *None*).
 
 Likewise, the effects of calling a method object depend on the :attr:`im_self`
 field. If set (meaning bound), the original function (stored in the
diff --git a/Doc/howto/functional.rst b/Doc/howto/functional.rst
index 7189c65..1969b32 100644
--- a/Doc/howto/functional.rst
+++ b/Doc/howto/functional.rst
@@ -3,7 +3,7 @@
 ********************************
 
 :Author: A. M. Kuchling
-:Release: 0.31
+:Release: 0.32
 
 In this document, we'll take a tour of Python's features suitable for
 implementing programs in a functional style.  After an introduction to the
@@ -15,9 +15,9 @@
 Introduction
 ============
 
-This section explains the basic concept of functional programming; if you're
-just interested in learning about Python language features, skip to the next
-section.
+This section explains the basic concept of functional programming; if
+you're just interested in learning about Python language features,
+skip to the next section on :ref:`functional-howto-iterators`.
 
 Programming languages support decomposing problems in several different ways:
 
@@ -173,6 +173,8 @@
 a few functions specialized for the current task.
 
 
+.. _functional-howto-iterators:
+
 Iterators
 =========
 
@@ -581,7 +583,7 @@
 
 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
-:meth:`~generator.send` method will be the only method used resume your
+:meth:`~generator.send` method will be the only method used to resume your
 generator function.
 
 In addition to :meth:`~generator.send`, there are two other methods on
@@ -670,7 +672,7 @@
 
 :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
+result.  The *key* and *reverse* arguments are passed through to the
 constructed list's :meth:`~list.sort` method. ::
 
     >>> import random
@@ -836,7 +838,8 @@
 predicate.
 
 :func:`itertools.filterfalse(predicate, iter) <itertools.filterfalse>` is the
-opposite, returning all elements for which the predicate returns false::
+opposite of :func:`filter`, returning all elements for which the predicate
+returns false::
 
     itertools.filterfalse(is_even, itertools.count()) =>
       1, 3, 5, 7, 9, 11, 13, 15, ...
@@ -864,6 +867,77 @@
     itertools.dropwhile(is_even, itertools.count()) =>
       1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ...
 
+:func:`itertools.compress(data, selectors) <itertools.compress>` takes two
+iterators and returns only those elements of *data* for which the corresponding
+element of *selectors* is true, stopping whenever either one is exhausted::
+
+    itertools.compress([1,2,3,4,5], [True, True, False, False, True]) =>
+       1, 2, 5
+
+
+Combinatoric functions
+----------------------
+
+The :func:`itertools.combinations(iterable, r) <itertools.combinations>`
+returns an iterator giving all possible *r*-tuple combinations of the
+elements contained in *iterable*.  ::
+
+    itertools.combinations([1, 2, 3, 4, 5], 2) =>
+      (1, 2), (1, 3), (1, 4), (1, 5),
+      (2, 3), (2, 4), (2, 5),
+      (3, 4), (3, 5),
+      (4, 5)
+
+    itertools.combinations([1, 2, 3, 4, 5], 3) =>
+      (1, 2, 3), (1, 2, 4), (1, 2, 5), (1, 3, 4), (1, 3, 5), (1, 4, 5),
+      (2, 3, 4), (2, 3, 5), (2, 4, 5),
+      (3, 4, 5)
+
+The elements within each tuple remain in the same order as
+*iterable* returned them.  For example, the number 1 is always before
+2, 3, 4, or 5 in the examples above.  A similar function,
+:func:`itertools.permutations(iterable, r=None) <itertools.permutations>`,
+removes this constraint on the order, returning all possible
+arrangements of length *r*::
+
+    itertools.permutations([1, 2, 3, 4, 5], 2) =>
+      (1, 2), (1, 3), (1, 4), (1, 5),
+      (2, 1), (2, 3), (2, 4), (2, 5),
+      (3, 1), (3, 2), (3, 4), (3, 5),
+      (4, 1), (4, 2), (4, 3), (4, 5),
+      (5, 1), (5, 2), (5, 3), (5, 4)
+
+    itertools.permutations([1, 2, 3, 4, 5]) =>
+      (1, 2, 3, 4, 5), (1, 2, 3, 5, 4), (1, 2, 4, 3, 5),
+      ...
+      (5, 4, 3, 2, 1)
+
+If you don't supply a value for *r* the length of the iterable is used,
+meaning that all the elements are permuted.
+
+Note that these functions produce all of the possible combinations by
+position and don't require that the contents of *iterable* are unique::
+
+    itertools.permutations('aba', 3) =>
+      ('a', 'b', 'a'), ('a', 'a', 'b'), ('b', 'a', 'a'),
+      ('b', 'a', 'a'), ('a', 'a', 'b'), ('a', 'b', 'a')
+
+The identical tuple ``('a', 'a', 'b')`` occurs twice, but the two 'a'
+strings came from different positions.
+
+The :func:`itertools.combinations_with_replacement(iterable, r) <itertools.combinations_with_replacement>`
+function relaxes a different constraint: elements can be repeated
+within a single tuple.  Conceptually an element is selected for the
+first position of each tuple and then is replaced before the second
+element is selected.  ::
+
+    itertools.combinations_with_replacement([1, 2, 3, 4, 5], 2) =>
+      (1, 1), (1, 2), (1, 3), (1, 4), (1, 5),
+      (2, 2), (2, 3), (2, 4), (2, 5),
+      (3, 3), (3, 4), (3, 5),
+      (4, 4), (4, 5),
+      (5, 5)
+
 
 Grouping elements
 -----------------
@@ -986,6 +1060,17 @@
    for i in [1,2,3]:
        product *= i
 
+A related function is `itertools.accumulate(iterable, func=operator.add) <itertools.accumulate`.
+It performs the same calculation, but instead of returning only the
+final result, :func:`accumulate` returns an iterator that also yields
+each partial result::
+
+    itertools.accumulate([1,2,3,4,5]) =>
+      1, 3, 6, 10, 15
+
+    itertools.accumulate([1,2,3,4,5], operator.mul) =>
+      1, 2, 6, 24, 120
+
 
 The operator module
 -------------------
@@ -1159,51 +1244,6 @@
 
 .. comment
 
-    Topics to place
-    -----------------------------
-
-    XXX os.walk()
-
-    XXX Need a large example.
-
-    But will an example add much?  I'll post a first draft and see
-    what the comments say.
-
-.. comment
-
-    Original outline:
-    Introduction
-            Idea of FP
-                    Programs built out of functions
-                    Functions are strictly input-output, no internal state
-            Opposed to OO programming, where objects have state
-
-            Why FP?
-                    Formal provability
-                            Assignment is difficult to reason about
-                            Not very relevant to Python
-                    Modularity
-                            Small functions that do one thing
-                    Debuggability:
-                            Easy to test due to lack of state
-                            Easy to verify output from intermediate steps
-                    Composability
-                            You assemble a toolbox of functions that can be mixed
-
-    Tackling a problem
-            Need a significant example
-
-    Iterators
-    Generators
-    The itertools module
-    List comprehensions
-    Small functions and the lambda statement
-    Built-in functions
-            map
-            filter
-
-.. comment
-
     Handy little function for printing part of an iterator -- used
     while writing this document.
 
@@ -1214,5 +1254,3 @@
              sys.stdout.write(str(elem))
              sys.stdout.write(', ')
         print(elem[-1])
-
-
diff --git a/Doc/howto/index.rst b/Doc/howto/index.rst
index 81a4f8b..2c9d699 100644
--- a/Doc/howto/index.rst
+++ b/Doc/howto/index.rst
@@ -28,4 +28,5 @@
    webservers.rst
    argparse.rst
    ipaddress.rst
+   clinic.rst
 
diff --git a/Doc/howto/logging-cookbook.rst b/Doc/howto/logging-cookbook.rst
index 563da9d..114ec09 100644
--- a/Doc/howto/logging-cookbook.rst
+++ b/Doc/howto/logging-cookbook.rst
@@ -416,7 +416,7 @@
        Simple TCP socket-based logging receiver suitable for testing.
        """
 
-       allow_reuse_address = 1
+       allow_reuse_address = True
 
        def __init__(self, host='localhost',
                     port=logging.handlers.DEFAULT_TCP_LOGGING_PORT,
@@ -649,7 +649,7 @@
 not make use of :mod:`multiprocessing` at present, though they may do so in the
 future. Note that at present, the :mod:`multiprocessing` module does not provide
 working lock functionality on all platforms (see
-http://bugs.python.org/issue3770).
+https://bugs.python.org/issue3770).
 
 .. currentmodule:: logging.handlers
 
@@ -704,9 +704,7 @@
                     break
                 logger = logging.getLogger(record.name)
                 logger.handle(record) # No level or filter logic applied - just do it!
-            except (KeyboardInterrupt, SystemExit):
-                raise
-            except:
+            except Exception:
                 import sys, traceback
                 print('Whoops! Problem:', file=sys.stderr)
                 traceback.print_exc(file=sys.stderr)
@@ -1310,7 +1308,7 @@
     }
 
 For more information about this configuration, you can see the `relevant
-section <https://docs.djangoproject.com/en/1.3/topics/logging/#configuring-logging>`_
+section <https://docs.djangoproject.com/en/1.6/topics/logging/#configuring-logging>`_
 of the Django documentation.
 
 .. _cookbook-rotator-namer:
@@ -2035,3 +2033,112 @@
   information on how logging supports using user-defined objects in its
   configuration, and see the other cookbook recipe :ref:`custom-handlers` above.
 
+
+.. _custom-format-exception:
+
+Customized exception formatting
+-------------------------------
+
+There might be times when you want to do customized exception formatting - for
+argument's sake, let's say you want exactly one line per logged event, even
+when exception information is present. You can do this with a custom formatter
+class, as shown in the following example::
+
+    import logging
+
+    class OneLineExceptionFormatter(logging.Formatter):
+        def formatException(self, exc_info):
+            """
+            Format an exception so that it prints on a single line.
+            """
+            result = super(OneLineExceptionFormatter, self).formatException(exc_info)
+            return repr(result) # or format into one line however you want to
+
+        def format(self, record):
+            s = super(OneLineExceptionFormatter, self).format(record)
+            if record.exc_text:
+                s = s.replace('\n', '') + '|'
+            return s
+
+    def configure_logging():
+        fh = logging.FileHandler('output.txt', 'w')
+        f = OneLineExceptionFormatter('%(asctime)s|%(levelname)s|%(message)s|',
+                                      '%d/%m/%Y %H:%M:%S')
+        fh.setFormatter(f)
+        root = logging.getLogger()
+        root.setLevel(logging.DEBUG)
+        root.addHandler(fh)
+
+    def main():
+        configure_logging()
+        logging.info('Sample message')
+        try:
+            x = 1 / 0
+        except ZeroDivisionError as e:
+            logging.exception('ZeroDivisionError: %s', e)
+
+    if __name__ == '__main__':
+        main()
+
+When run, this produces a file with exactly two lines::
+
+    28/01/2015 07:21:23|INFO|Sample message|
+    28/01/2015 07:21:23|ERROR|ZeroDivisionError: integer division or modulo by zero|'Traceback (most recent call last):\n  File "logtest7.py", line 30, in main\n    x = 1 / 0\nZeroDivisionError: integer division or modulo by zero'|
+
+While the above treatment is simplistic, it points the way to how exception
+information can be formatted to your liking. The :mod:`traceback` module may be
+helpful for more specialized needs.
+
+.. _spoken-messages:
+
+Speaking logging messages
+-------------------------
+
+There might be situations when it is desirable to have logging messages rendered
+in an audible rather than a visible format. This is easy to do if you have text-
+to-speech (TTS) functionality available in your system, even if it doesn't have
+a Python binding. Most TTS systems have a command line program you can run, and
+this can be invoked from a handler using :mod:`subprocess`. It's assumed here
+that TTS command line programs won't expect to interact with users or take a
+long time to complete, and that the frequency of logged messages will be not so
+high as to swamp the user with messages, and that it's acceptable to have the
+messages spoken one at a time rather than concurrently, The example implementation
+below waits for one message to be spoken before the next is processed, and this
+might cause other handlers to be kept waiting. Here is a short example showing
+the approach, which assumes that the ``espeak`` TTS package is available::
+
+    import logging
+    import subprocess
+    import sys
+
+    class TTSHandler(logging.Handler):
+        def emit(self, record):
+            msg = self.format(record)
+            # Speak slowly in a female English voice
+            cmd = ['espeak', '-s150', '-ven+f3', msg]
+            p = subprocess.Popen(cmd, stdout=subprocess.PIPE,
+                                 stderr=subprocess.STDOUT)
+            # wait for the program to finish
+            p.communicate()
+
+    def configure_logging():
+        h = TTSHandler()
+        root = logging.getLogger()
+        root.addHandler(h)
+        # the default formatter just returns the message
+        root.setLevel(logging.DEBUG)
+
+    def main():
+        logging.info('Hello')
+        logging.debug('Goodbye')
+
+    if __name__ == '__main__':
+        configure_logging()
+        sys.exit(main())
+
+When run, this script should say "Hello" and then "Goodbye" in a female voice.
+
+The above approach can, of course, be adapted to other TTS systems and even
+other systems altogether which can process messages via external programs run
+from a command line.
+
diff --git a/Doc/howto/logging.rst b/Doc/howto/logging.rst
index 55b1c86..4ce14f9 100644
--- a/Doc/howto/logging.rst
+++ b/Doc/howto/logging.rst
@@ -901,10 +901,10 @@
    disk files, rotating the log file at certain timed intervals.
 
 #. :class:`~handlers.SocketHandler` instances send messages to TCP/IP
-   sockets.
+   sockets. Since 3.4, Unix domain sockets are also supported.
 
 #. :class:`~handlers.DatagramHandler` instances send messages to UDP
-   sockets.
+   sockets. Since 3.4, Unix domain sockets are also supported.
 
 #. :class:`~handlers.SMTPHandler` instances send messages to a designated
    email address.
@@ -1027,6 +1027,15 @@
 so that if the logger's threshold is set above ``DEBUG``, the calls to
 :func:`expensive_func1` and :func:`expensive_func2` are never made.
 
+.. note:: In some cases, :meth:`~Logger.isEnabledFor` can itself be more
+   expensive than you'd like (e.g. for deeply nested loggers where an explicit
+   level is only set high up in the logger hierarchy). In such cases (or if you
+   want to avoid calling a method in tight loops), you can cache the result of a
+   call to :meth:`~Logger.isEnabledFor` in a local or instance variable, and use
+   that instead of calling the method each time. Such a cached value would only
+   need to be recomputed when the logging configuration changes dynamically
+   while the application is running (which is not all that common).
+
 There are other optimizations which can be made for specific applications which
 need more precise control over what logging information is collected. Here's a
 list of things you can do to avoid processing during logging which you don't
@@ -1036,6 +1045,12 @@
 | What you don't want to collect                | How to avoid collecting it             |
 +===============================================+========================================+
 | Information about where calls were made from. | Set ``logging._srcfile`` to ``None``.  |
+|                                               | This avoids calling                    |
+|                                               | :func:`sys._getframe`, which may help  |
+|                                               | to speed up your code in environments  |
+|                                               | like PyPy (which can't speed up code   |
+|                                               | that uses :func:`sys._getframe`), if   |
+|                                               | and when PyPy supports Python 3.x.     |
 +-----------------------------------------------+----------------------------------------+
 | Threading information.                        | Set ``logging.logThreads`` to ``0``.   |
 +-----------------------------------------------+----------------------------------------+
diff --git a/Doc/howto/pyporting.rst b/Doc/howto/pyporting.rst
index 9d7e859..bd80dfd 100644
--- a/Doc/howto/pyporting.rst
+++ b/Doc/howto/pyporting.rst
@@ -19,607 +19,374 @@
    If you would like to read one core Python developer's take on why Python 3
    came into existence, you can read Nick Coghlan's `Python 3 Q & A`_.
 
-   If you prefer to read a (free) book on porting a project to Python 3,
-   consider reading `Porting to Python 3`_ by Lennart Regebro which should cover
-   much of what is discussed in this HOWTO.
-
    For help with porting, you can email the python-porting_ mailing list with
    questions.
 
-The Short Version
-=================
+The Short Explanation
+=====================
 
-* Decide what's the oldest version of Python 2 you want to support (if at all)
-* Make sure you have a thorough test suite and use continuous integration
-  testing to make sure you stay compatible with the versions of Python you care
-  about
-* If you have dependencies, check their Python 3 status using caniusepython3
-  (`command-line tool <https://pypi.python.org/pypi/caniusepython3>`__,
-  `web app <https://caniusepython3.com/>`__)
+To make your project be single-source Python 2/3 compatible, the basic steps
+are:
 
-With that done, your options are:
+#. Update your code to drop support for Python 2.5 or older (supporting only
+   Python 2.7 is ideal)
+#. Make sure you have good test coverage (coverage.py_ can help;
+   ``pip install coverage``)
+#. Learn the differences between Python 2 & 3
+#. Use Modernize_ or Futurize_ to update your code (``pip install modernize`` or
+   ``pip install future``, respectively)
+#. Use Pylint_ to help make sure you don't regress on your Python 3 support
+   (if only supporting Python 2.7/3.4 or newer; ``pip install pylint``)
+#. Use caniusepython3_ to find out which of your dependencies are blocking your
+   use of Python 3 (``pip install caniusepython3``)
+#. Once your dependencies are no longer blocking you, use continuous integration
+   to make sure you stay compatible with Python 2 & 3 (tox_ can help test
+   against multiple versions of Python; ``pip install tox``)
 
-* If you are dropping Python 2 support, use 2to3_ to port to Python 3
-* If you are keeping Python 2 support, then start writing Python 2/3-compatible
-  code starting **TODAY**
+If you are dropping support for Python 2 entirely, then after you learn the
+differences between Python 2 & 3 you can run 2to3_ over your code and skip the
+rest of the steps outlined above.
 
-  + If you have dependencies that have not been ported, reach out to them to port
-    their project while working to make your code compatible with Python 3 so
-    you're ready when your dependencies are all ported
-  + If all your dependencies have been ported (or you have none), go ahead and
-    port to Python 3
 
-* If you are creating a new project that wants to have 2/3 compatibility,
-  code in Python 3 and then backport to Python 2
+Details
+=======
 
+A key point about supporting Python 2 & 3 simultaneously is that you can start
+**today**! Even if your dependencies are not supporting Python 3 yet that does
+not mean you can't modernize your code **now** to support Python 3. Most changes
+required to support Python 3 lead to cleaner code using newer practices even in
+Python 2.
 
-Before You Begin
-================
+Another key point is that modernizing your Python 2 code to also support
+Python 3 is largely automated for you. While you might have to make some API
+decisions thanks to Python 3 clarifying text data versus binary data, the
+lower-level work is now mostly done for you and thus can at least benefit from
+the automated changes immediately.
 
-If your project is on the Cheeseshop_/PyPI_, make sure it has the proper
-`trove classifiers`_ to signify what versions of Python it **currently**
-supports. At minimum you should specify the major version(s), e.g.
-``Programming Language :: Python :: 2`` if your project currently only supports
-Python 2. It is preferrable that you be as specific as possible by listing every
-major/minor version of Python that you support, e.g. if your project supports
-Python 2.6 and 2.7, then you want the classifiers of::
+Keep those key points in mind while you read on about the details of porting
+your code to support Python 2 & 3 simultaneously.
 
- Programming Language :: Python :: 2
- Programming Language :: Python :: 2.6
- Programming Language :: Python :: 2.7
 
-Once your project supports Python 3 you will want to go back and add the
-appropriate classifiers for Python 3 as well. This is important as setting the
-``Programming Language :: Python :: 3`` classifier will lead to your project
-being listed under the `Python 3 Packages`_ section of PyPI.
+Drop support for Python 2.5 and older (at least)
+------------------------------------------------
 
-Make sure you have a robust test suite. You need to
-make sure everything continues to work, just like when you support a new
-minor/feature release of Python. This means making sure your test suite is
-thorough and is ported properly between Python 2 & 3 (consider using coverage_
-to measure that you have effective test coverage). You will also most likely
-want to use something like tox_ to automate testing between all of your
-supported versions of Python. You will also want to **port your tests first** so
-that you can make sure that you detect breakage during the transition. Tests also
-tend to be simpler than the code they are testing so it gives you an idea of how
-easy it can be to port code.
+While you can make Python 2.5 work with Python 3, it is **much** easier if you
+only have to work with Python 2.6 or newer (and easier still if you only have
+to work with Python 2.7). If dropping Python 2.5 is not an option then the six_
+project can help you support Python 2.5 & 3 simultaneously
+(``pip install six``). Do realize, though, that nearly all the projects listed
+in this HOWTO will not be available to you.
 
-Drop support for older Python versions if possible. `Python 2.5`_
-introduced a lot of useful syntax and libraries which have become idiomatic
-in Python 3. `Python 2.6`_ introduced future statements which makes
-compatibility much easier if you are going from Python 2 to 3.
-`Python 2.7`_ continues the trend in the stdlib. Choose the newest version
-of Python which you believe can be your minimum support version
-and work from there.
+If you are able to only support Python 2.6 or newer, then the required changes
+to your code should continue to look and feel like idiomatic Python code. At
+worst you will have to use a function instead of a method in some instances or
+have to import a function instead of using a built-in one, but otherwise the
+overall transformation should not feel foreign to you.
 
-Target the newest version of Python 3 that you can. Beyond just the usual
-bugfixes, compatibility has continued to improve between Python 2 and 3 as time
-has passed. E.g. Python 3.3 added back the ``u`` prefix for
-strings, making source-compatible Python code easier to write.
+But please aim for Python 2.7. Bugfixes for that version of Python will continue
+until 2020 while Python 2.6 is no longer supported. There are also some tools
+mentioned in this HOWTO which do not support Python 2.6 (e.g., Pylint_), and
+this will become more commonplace as time goes on.
 
+Make sure you specify the proper version support in your ``setup.py`` file
+--------------------------------------------------------------------------
 
-Writing Source-Compatible Python 2/3 Code
-=========================================
+In your ``setup.py`` file you should have the proper `trove classifier`_
+specifying what versions of Python you support. As your project does not support
+Python 3 yet you should at least have
+``Programming Language :: Python :: 2 :: Only`` specified. Ideally you should
+also specify each major/minor version of Python that you do support, e.g.
+``Programming Language :: Python :: 2.7``.
 
-Over the years the Python community has discovered that the easiest way to
-support both Python 2 and 3 in parallel is to write Python code that works in
-either version. While this might sound counter-intuitive at first, it actually
-is not difficult and typically only requires following some select
-(non-idiomatic) practices and using some key projects to help make bridging
-between Python 2 and 3 easier.
+Have good test coverage
+-----------------------
 
-Projects to Consider
---------------------
+Once you have your code supporting the oldest version of Python 2 you want it
+to, you will want to make sure your test suite has good coverage. A good rule of
+thumb is that if you want to be confident enough in your test suite that any
+failures that appear after having tools rewrite your code are actual bugs in the
+tools and not in your code. If you want a number to aim for, try to get over 80%
+coverage (and don't feel bad if you can't easily get past 90%). If you
+don't already have a tool to measure test coverage then coverage.py_ is
+recommended.
 
-The lowest level library for supporting Python 2 & 3 simultaneously is six_.
-Reading through its documentation will give you an idea of where exactly the
-Python language changed between versions 2 & 3 and thus what you will want the
-library to help you continue to support.
+Learn the differences between Python 2 & 3
+-------------------------------------------
 
-To help automate porting your code over to using six, you can use
-modernize_. This project will attempt to rewrite your code to be as modern as
-possible while using six to smooth out any differences between Python 2 & 3.
+Once you have your code well-tested you are ready to begin porting your code to
+Python 3! But to fully understand how your code is going to change and what
+you want to look out for while you code, you will want to learn what changes
+Python 3 makes in terms of Python 2. Typically the two best ways of doing that
+is reading the `"What's New"`_ doc for each release of Python 3 and the
+`Porting to Python 3`_ book (which is free online). There is also a handy
+`cheat sheet`_ from the Python-Future project.
 
-If you want to write your compatible code to feel more like Python 3 there is
-the future_ project. It tries to provide backports of objects from Python 3 so
-that you can use them from Python 2-compatible code, e.g. replacing the
-``bytes`` type from Python 2 with the one from Python 3.
-It also provides a translation script like modernize (its translation code is
-actually partially based on it) to help start working with a pre-existing code
-base. It is also unique in that its translation script will also port Python 3
-code backwards as well as Python 2 code forwards.
 
+Update your code
+----------------
 
-Tips & Tricks
--------------
+Once you feel like you know what is different in Python 3 compared to Python 2,
+it's time to update your code! You have a choice between two tools in porting
+your code automatically: Modernize_ and Futurize_. Which tool you choose will
+depend on how much like Python 3 you want your code to be. Futurize_ does its
+best to make Python 3 idioms and practices exist in Python 2, e.g. backporting
+the ``bytes`` type from Python 3 so that you have semantic parity between the
+major versions of Python. Modernize_,
+on the other hand, is more conservative and targets a Python 2/3 subset of
+Python, relying on six_ to help provide compatibility.
 
-To help with writing source-compatible code using one of the projects mentioned
-in `Projects to Consider`_, consider following the below suggestions. Some of
-them are handled by the suggested projects, so if you do use one of them then
-read their documentation first to see which suggestions below will taken care of
-for you.
+Regardless of which tool you choose, they will update your code to run under
+Python 3 while staying compatible with the version of Python 2 you started with.
+Depending on how conservative you want to be, you may want to run the tool over
+your test suite first and visually inspect the diff to make sure the
+transformation is accurate. After you have transformed your test suite and
+verified that all the tests still pass as expected, then you can transform your
+application code knowing that any tests which fail is a translation failure.
 
-Support Python 2.7
-//////////////////
+Unfortunately the tools can't automate everything to make your code work under
+Python 3 and so there are a handful of things you will need to update manually
+to get full Python 3 support (which of these steps are necessary vary between
+the tools). Read the documentation for the tool you choose to use to see what it
+fixes by default and what it can do optionally to know what will (not) be fixed
+for you and what you may have to fix on your own (e.g. using ``io.open()`` over
+the built-in ``open()`` function is off by default in Modernize). Luckily,
+though, there are only a couple of things to watch out for which can be
+considered large issues that may be hard to debug if not watched for.
 
-As a first step, make sure that your project is compatible with `Python 2.7`_.
-This is just good to do as Python 2.7 is the last release of Python 2 and thus
-will be used for a rather long time. It also allows for use of the ``-3`` flag
-to Python to help discover places in your code where compatibility might be an
-issue (the ``-3`` flag is in Python 2.6 but Python 2.7 adds more warnings).
+Division
+++++++++
 
-Try to Support `Python 2.6`_ and Newer Only
-///////////////////////////////////////////
+In Python 3, ``5 / 2 == 2.5`` and not ``2``; all division between ``int`` values
+result in a ``float``. This change has actually been planned since Python 2.2
+which was released in 2002. Since then users have been encouraged to add
+``from __future__ import division`` to any and all files which use the ``/`` and
+``//`` operators or to be running the interpreter with the ``-Q`` flag. If you
+have not been doing this then you will need to go through your code and do two
+things:
 
-While not possible for all projects, if you can support `Python 2.6`_ and newer
-**only**, your life will be much easier. Various future statements, stdlib
-additions, etc. exist only in Python 2.6 and later which greatly assist in
-supporting Python 3. But if you project must keep support for `Python 2.5`_ then
-it is still possible to simultaneously support Python 3.
-
-Below are the benefits you gain if you only have to support Python 2.6 and
-newer. Some of these options are personal choice while others are
-**strongly** recommended (the ones that are more for personal choice are
-labeled as such).  If you continue to support older versions of Python then you
-at least need to watch out for situations that these solutions fix and handle
-them appropriately (which is where library help from e.g. six_ comes in handy).
-
-
-``from __future__ import print_function``
-'''''''''''''''''''''''''''''''''''''''''
-
-It will not only get you used to typing ``print()`` as a function instead of a
-statement, but it will also give you the various benefits the function has over
-the Python 2 statement (six_ provides a function if you support Python 2.5 or
-older).
-
-
-``from __future__ import unicode_literals``
-'''''''''''''''''''''''''''''''''''''''''''
-
-If you choose to use this future statement then all string literals in
-Python 2 will be assumed to be Unicode (as is already the case in Python 3).
-If you choose not to use this future statement then you should mark all of your
-text strings with a ``u`` prefix and only support Python 3.3 or newer. But you
-are **strongly** advised to do one or the other (six_ provides a function in
-case you don't want to use the future statement **and** you want to support
-Python 3.2 or older).
-
-
-Bytes/string literals
-'''''''''''''''''''''
-
-This is a **very** important one. Prefix Python 2 strings that
-are meant to contain bytes with a ``b`` prefix to very clearly delineate
-what is and is not a Python 3 text string (six_ provides a function to use for
-Python 2.5 compatibility).
-
-This point cannot be stressed enough: make sure you know what all of your string
-literals in Python 2 are meant to be in Python 3. Any string literal that
-should be treated as bytes should have the ``b`` prefix. Any string literal
-that should be Unicode/text in Python 2 should either have the ``u`` literal
-(supported, but ignored, in Python 3.3 and later) or you should have
-``from __future__ import unicode_literals`` at the top of the file. But the key
-point is you should know how Python 3 will treat every one one of your string
-literals and you should mark them as appropriate.
-
-There are some differences between byte literals in Python 2 and those in
-Python 3 thanks to the bytes type just being an alias to ``str`` in Python 2.
-See the `Handle Common "Gotchas"`_ section for what to watch out for.
-
-``from __future__ import absolute_import``
-''''''''''''''''''''''''''''''''''''''''''
-Discussed in more detail below, but you should use this future statement to
-prevent yourself from accidentally using implicit relative imports.
-
-
-Supporting `Python 2.5`_ and Newer Only
-///////////////////////////////////////
-
-If you are supporting `Python 2.5`_ and newer there are still some features of
-Python that you can utilize.
-
-
-``from __future__ import absolute_import``
-''''''''''''''''''''''''''''''''''''''''''
-
-Implicit relative imports (e.g., importing ``spam.bacon`` from within
-``spam.eggs`` with the statement ``import bacon``) do not work in Python 3.
-This future statement moves away from that and allows the use of explicit
-relative imports (e.g., ``from . import bacon``).
-
-In `Python 2.5`_ you must use
-the __future__ statement to get to use explicit relative imports and prevent
-implicit ones. In `Python 2.6`_ explicit relative imports are available without
-the statement, but you still want the __future__ statement to prevent implicit
-relative imports. In `Python 2.7`_ the __future__ statement is not needed. In
-other words, unless you are only supporting Python 2.7 or a version earlier
-than Python 2.5, use this __future__ statement.
-
-
-Mark all Unicode strings with a ``u`` prefix
-'''''''''''''''''''''''''''''''''''''''''''''
-
-While Python 2.6 has a ``__future__`` statement to automatically cause Python 2
-to treat all string literals as Unicode, Python 2.5 does not have that shortcut.
-This means you should go through and mark all string literals with a ``u``
-prefix to turn them explicitly into text strings where appropriate and only
-support Python 3.3 or newer. Otherwise use a project like six_ which provides a
-function to pass all text string literals through.
-
-
-Capturing the Currently Raised Exception
-''''''''''''''''''''''''''''''''''''''''
-
-In Python 2.5 and earlier the syntax to access the current exception is::
-
-   try:
-     raise Exception()
-   except Exception, exc:
-     # Current exception is 'exc'.
-     pass
-
-This syntax changed in Python 3 (and backported to `Python 2.6`_ and later)
-to::
-
-   try:
-     raise Exception()
-   except Exception as exc:
-     # Current exception is 'exc'.
-     # In Python 3, 'exc' is restricted to the block; in Python 2.6/2.7 it will "leak".
-     pass
-
-Because of this syntax change you must change how you capture the current
-exception in Python 2.5 and earlier to::
-
-   try:
-     raise Exception()
-   except Exception:
-     import sys
-     exc = sys.exc_info()[1]
-     # Current exception is 'exc'.
-     pass
-
-You can get more information about the raised exception from
-:func:`sys.exc_info` than simply the current exception instance, but you most
-likely don't need it.
-
-.. note::
-   In Python 3, the traceback is attached to the exception instance
-   through the ``__traceback__`` attribute. If the instance is saved in
-   a local variable that persists outside of the ``except`` block, the
-   traceback will create a reference cycle with the current frame and its
-   dictionary of local variables.  This will delay reclaiming dead
-   resources until the next cyclic :term:`garbage collection` pass.
-
-   In Python 2, this problem only occurs if you save the traceback itself
-   (e.g. the third element of the tuple returned by :func:`sys.exc_info`)
-   in a variable.
-
+#. Add ``from __future__ import division`` to your files
+#. Update any division operator as necessary to either use ``//`` to use floor
+   division or continue using ``/`` and expect a float
 
-Handle Common "Gotchas"
-///////////////////////
+The reason that ``/`` isn't simply translated to ``//`` automatically is that if
+an object defines its own ``__div__`` method but not ``__floordiv__`` then your
+code would begin to fail.
 
-These are things to watch out for no matter what version of Python 2 you are
-supporting which are not syntactic considerations.
+Text versus binary data
++++++++++++++++++++++++
 
+In Python 2 you could use the ``str`` type for both text and binary data.
+Unfortunately this confluence of two different concepts could lead to brittle
+code which sometimes worked for either kind of data, sometimes not. It also
+could lead to confusing APIs if people didn't explicitly state that something
+that accepted ``str`` accepted either text or binary data instead of one
+specific type. This complicated the situation especially for anyone supporting
+multiple languages as APIs wouldn't bother explicitly supporting ``unicode``
+when they claimed text data support.
 
-``from __future__ import division``
-'''''''''''''''''''''''''''''''''''
+To make the distinction between text and binary data clearer and more
+pronounced, Python 3 did what most languages created in the age of the internet
+have done and made text and binary data distinct types that cannot blindly be
+mixed together (Python predates widespread access to the internet). For any code
+that only deals with text or only binary data, this separation doesn't pose an
+issue. But for code that has to deal with both, it does mean you might have to
+now care about when you are using text compared to binary data, which is why
+this cannot be entirely automated.
 
-While the exact same outcome can be had by using the ``-Qnew`` argument to
-Python, using this future statement lifts the requirement that your users use
-the flag to get the expected behavior of division in Python 3
-(e.g., ``1/2 == 0.5; 1//2 == 0``).
+To start, you will need to decide which APIs take text and which take binary
+(it is **highly** recommended you don't design APIs that can take both due to
+the difficulty of keeping the code working; as stated earlier it is difficult to
+do well). In Python 2 this means making sure the APIs that take text can work
+with ``unicode`` in Python 2 and those that work with binary data work with the
+``bytes`` type from Python 3 and thus a subset of ``str`` in Python 2 (which the
+``bytes`` type in Python 2 is an alias for). Usually the biggest issue is
+realizing which methods exist for which types in Python 2 & 3 simultaneously
+(for text that's ``unicode`` in Python 2 and ``str`` in Python 3, for binary
+that's ``str``/``bytes`` in Python 2 and ``bytes`` in Python 3). The following
+table lists the **unique** methods of each data type across Python 2 & 3
+(e.g., the ``decode()`` method is usable on the equivalent binary data type in
+either Python 2 or 3, but it can't be used by the text data type consistently
+between Python 2 and 3 because ``str`` in Python 3 doesn't have the method).
 
+======================== =====================
+**Text data**            **Binary data**
+------------------------ ---------------------
+__mod__ (``%`` operator)
+------------------------ ---------------------
+\                        decode
+------------------------ ---------------------
+encode
+------------------------ ---------------------
+format
+------------------------ ---------------------
+isdecimal
+------------------------ ---------------------
+isnumeric
+======================== =====================
 
+Making the distinction easier to handle can be accomplished by encoding and
+decoding between binary data and text at the edge of your code. This means that
+when you receive text in binary data, you should immediately decode it. And if
+your code needs to send text as binary data then encode it as late as possible.
+This allows your code to work with only text internally and thus eliminates
+having to keep track of what type of data you are working with.
 
-Specify when opening a file as binary
-'''''''''''''''''''''''''''''''''''''
+The next issue is making sure you know whether the string literals in your code
+represent text or binary data. At minimum you should add a ``b`` prefix to any
+literal that presents binary data. For text you should either use the
+``from __future__ import unicode_literals`` statement or add a ``u`` prefix to
+the text literal.
 
+As part of this dichotomy you also need to be careful about opening files.
 Unless you have been working on Windows, there is a chance you have not always
 bothered to add the ``b`` mode when opening a binary file (e.g., ``rb`` for
 binary reading).  Under Python 3, binary files and text files are clearly
 distinct and mutually incompatible; see the :mod:`io` module for details.
 Therefore, you **must** make a decision of whether a file will be used for
-binary access (allowing to read and/or write bytes data) or text access
-(allowing to read and/or write unicode data).
+binary access (allowing to read and/or write binary data) or text access
+(allowing to read and/or write text data). You should also use :func:`io.open`
+for opening files instead of the built-in :func:`open` function as the :mod:`io`
+module is consistent from Python 2 to 3 while the built-in :func:`open` function
+is not (in Python 3 it's actually :func:`io.open`).
 
-Text files
-''''''''''
+The constructors of both ``str`` and ``bytes`` have different semantics for the
+same arguments between Python 2 & 3. Passing an integer to ``bytes`` in Python 2
+will give you the string representation of the integer: ``bytes(3) == '3'``.
+But in Python 3, an integer argument to ``bytes`` will give you a bytes object
+as long as the integer specified, filled with null bytes:
+``bytes(3) == b'\x00\x00\x00'``. A similar worry is necessary when passing a
+bytes object to ``str``. In Python 2 you just get the bytes object back:
+``str(b'3') == b'3'``. But in Python 3 you get the string representation of the
+bytes object: ``str(b'3') == "b'3'"``.
 
-Text files created using ``open()`` under Python 2 return byte strings,
-while under Python 3 they return unicode strings.  Depending on your porting
-strategy, this can be an issue.
+Finally, the indexing of binary data requires careful handling (slicing does
+**not** require any special handling). In Python 2,
+``b'123'[1] == b'2'`` while in Python 3 ``b'123'[1] == 50``. Because binary data
+is simply a collection of binary numbers, Python 3 returns the integer value for
+the byte you index on. But in Python 2 because ``bytes == str``, indexing
+returns a one-item slice of bytes. The six_ project has a function
+named ``six.indexbytes()`` which will return an integer like in Python 3:
+``six.indexbytes(b'123', 1)``.
 
-If you want text files to return unicode strings in Python 2, you have two
-possibilities:
+To summarize:
 
-* Under Python 2.6 and higher, use :func:`io.open`.  Since :func:`io.open`
-  is essentially the same function in both Python 2 and Python 3, it will
-  help iron out any issues that might arise.
+#. Decide which of your APIs take text and which take binary data
+#. Make sure that your code that works with text also works with ``unicode`` and
+   code for binary data works with ``bytes`` in Python 2 (see the table above
+   for what methods you cannot use for each type)
+#. Mark all binary literals with a ``b`` prefix, use a ``u`` prefix or
+   :mod:`__future__` import statement for text literals
+#. Decode binary data to text as soon as possible, encode text as binary data as
+   late as possible
+#. Open files using :func:`io.open` and make sure to specify the ``b`` mode when
+   appropriate
+#. Be careful when indexing binary data
 
-* If pre-2.6 compatibility is needed, then you should use :func:`codecs.open`
-  instead.  This will make sure that you get back unicode strings in Python 2.
+Prevent compatibility regressions
+---------------------------------
 
-Subclass ``object``
-'''''''''''''''''''
+Once you have fully translated your code to be compatible with Python 3, you
+will want to make sure your code doesn't regress and stop working under
+Python 3. This is especially true if you have a dependency which is blocking you
+from actually running under Python 3 at the moment.
 
-New-style classes have been around since `Python 2.2`_. You need to make sure
-you are subclassing from ``object`` to avoid odd edge cases involving method
-resolution order, etc. This continues to be totally valid in Python 3 (although
-unneeded as all classes implicitly inherit from ``object``).
+To help with staying compatible, any new modules you create should have
+at least the following block of code at the top of it::
 
+    from __future__ import absolute_import
+    from __future__ import division
+    from __future__ import print_function
+    from __future__ import unicode_literals
 
-Deal With the Bytes/String Dichotomy
-''''''''''''''''''''''''''''''''''''
+You can also run Python 2 with the ``-3`` flag to be warned about various
+compatibility issues your code triggers during execution. If you turn warnings
+into errors with ``-Werror`` then you can make sure that you don't accidentally
+miss a warning.
 
-One of the biggest issues people have when porting code to Python 3 is handling
-the bytes/string dichotomy. Because Python 2 allowed the ``str`` type to hold
-textual data, people have over the years been rather loose in their delineation
-of what ``str`` instances held text compared to bytes. In Python 3 you cannot
-be so care-free anymore and need to properly handle the difference. The key to
-handling this issue is to make sure that **every** string literal in your
-Python 2 code is either syntactically or functionally marked as either bytes or
-text data. After this is done you then need to make sure your APIs are designed
-to either handle a specific type or made to be properly polymorphic.
 
+You can also use the Pylint_ project and its ``--py3k`` flag to lint your code
+to receive warnings when your code begins to deviate from Python 3
+compatibility. This also prevents you from having to run Modernize_ or Futurize_
+over your code regularly to catch compatibility regressions. This does require
+you only support Python 2.7 and Python 3.4 or newer as that is Pylint's
+minimum Python version support.
 
-Mark Up Python 2 String Literals
-********************************
 
-First thing you must do is designate every single string literal in Python 2
-as either textual or bytes data. If you are only supporting Python 2.6 or
-newer, this can be accomplished by marking bytes literals with a ``b`` prefix
-and then designating textual data with a ``u`` prefix or using the
-``unicode_literals`` future statement.
+Check which dependencies block your transition
+----------------------------------------------
 
-If your project supports versions of Python predating 2.6, then you should use
-the six_ project and its ``b()`` function to denote bytes literals. For text
-literals you can either use six's ``u()`` function or use a ``u`` prefix.
+**After** you have made your code compatible with Python 3 you should begin to
+care about whether your dependencies have also been ported. The caniusepython3_
+project was created to help you determine which projects
+-- directly or indirectly -- are blocking you from supporting Python 3. There
+is both a command-line tool as well as a web interface at
+https://caniusepython3.com .
 
+The project also provides code which you can integrate into your test suite so
+that you will have a failing test when you no longer have dependencies blocking
+you from using Python 3. This allows you to avoid having to manually check your
+dependencies and to be notified quickly when you can start running on Python 3.
 
-Decide what APIs Will Accept
-****************************
+Update your ``setup.py`` file to denote Python 3 compatibility
+--------------------------------------------------------------
 
-In Python 2 it was very easy to accidentally create an API that accepted both
-bytes and textual data. But in Python 3, thanks to the more strict handling of
-disparate types, this loose usage of bytes and text together tends to fail.
+Once your code works under Python 3, you should update the classifiers in
+your ``setup.py`` to contain ``Programming Language :: Python :: 3`` and to not
+specify sole Python 2 support. This will tell
+anyone using your code that you support Python 2 **and** 3. Ideally you will
+also want to add classifiers for each major/minor version of Python you now
+support.
 
-Take the dict ``{b'a': 'bytes', u'a': 'text'}`` in Python 2.6. It creates the
-dict ``{u'a': 'text'}`` since ``b'a' == u'a'``. But in Python 3 the equivalent
-dict creates ``{b'a': 'bytes', 'a': 'text'}``, i.e., no lost data. Similar
-issues can crop up when transitioning Python 2 code to Python 3.
+Use continuous integration to stay compatible
+---------------------------------------------
 
-This means you need to choose what an API is going to accept and create and
-consistently stick to that API in both Python 2 and 3.
+Once you are able to fully run under Python 3 you will want to make sure your
+code always works under both Python 2 & 3. Probably the best tool for running
+your tests under multiple Python interpreters is tox_. You can then integrate
+tox with your continuous integration system so that you never accidentally break
+Python 2 or 3 support.
 
+You may also want to use use the ``-bb`` flag with the Python 3 interpreter to
+trigger an exception when you are comparing bytes to strings. Usually it's
+simply ``False``, but if you made a mistake in your separation of text/binary
+data handling you may be accidentally comparing text and binary data. This flag
+will raise an exception when that occurs to help track down such cases.
 
-Bytes / Unicode Comparison
-**************************
+And that's mostly it! At this point your code base is compatible with both
+Python 2 and 3 simultaneously. Your testing will also be set up so that you
+don't accidentally break Python 2 or 3 compatibility regardless of which version
+you typically run your tests under while developing.
 
-In Python 3, mixing bytes and unicode is forbidden in most situations; it
-will raise a :class:`TypeError` where Python 2 would have attempted an implicit
-coercion between types.  However, there is one case where it doesn't and
-it can be very misleading::
 
-   >>> b"" == ""
-   False
+Dropping Python 2 support completely
+====================================
 
-This is because an equality comparison is required by the language to always
-succeed (and return ``False`` for incompatible types).  However, this also
-means that code incorrectly ported to Python 3 can display buggy behaviour
-if such comparisons are silently executed.  To detect such situations,
-Python 3 has a ``-b`` flag that will display a warning::
+If you are able to fully drop support for Python 2, then the steps required
+to transition to Python 3 simplify greatly.
 
-   $ python3 -b
-   >>> b"" == ""
-   __main__:1: BytesWarning: Comparison between bytes and string
-   False
+#. Update your code to only support Python 2.7
+#. Make sure you have good test coverage (coverage.py_ can help)
+#. Learn the differences between Python 2 & 3
+#. Use 2to3_ to rewrite your code to run only under Python 3
 
-To turn the warning into an exception, use the ``-bb`` flag instead::
+After this your code will be fully Python 3 compliant but in a way that is not
+supported by Python 2. You should also update the classifiers in your
+``setup.py`` to contain ``Programming Language :: Python :: 3 :: Only``.
 
-   $ python3 -bb
-   >>> b"" == ""
-   Traceback (most recent call last):
-     File "<stdin>", line 1, in <module>
-   BytesWarning: Comparison between bytes and string
 
-
-Indexing bytes objects
-''''''''''''''''''''''
-
-Another potentially surprising change is the indexing behaviour of bytes
-objects in Python 3::
-
-   >>> b"xyz"[0]
-   120
-
-Indeed, Python 3 bytes objects (as well as :class:`bytearray` objects)
-are sequences of integers.  But code converted from Python 2 will often
-assume that indexing a bytestring produces another bytestring, not an
-integer.  To reconcile both behaviours, use slicing::
-
-   >>> b"xyz"[0:1]
-   b'x'
-   >>> n = 1
-   >>> b"xyz"[n:n+1]
-   b'y'
-
-The only remaining gotcha is that an out-of-bounds slice returns an empty
-bytes object instead of raising ``IndexError``:
-
-   >>> b"xyz"[3]
-   Traceback (most recent call last):
-     File "<stdin>", line 1, in <module>
-   IndexError: index out of range
-   >>> b"xyz"[3:4]
-   b''
-
-
-``__str__()``/``__unicode__()``
-'''''''''''''''''''''''''''''''
-
-In Python 2, objects can specify both a string and unicode representation of
-themselves. In Python 3, though, there is only a string representation. This
-becomes an issue as people can inadvertently do things in their ``__str__()``
-methods which have unpredictable results (e.g., infinite recursion if you
-happen to use the ``unicode(self).encode('utf8')`` idiom as the body of your
-``__str__()`` method).
-
-You can use a mixin class to work around this. This allows you to only define a
-``__unicode__()`` method for your class and let the mixin derive
-``__str__()`` for you (code from
-http://lucumr.pocoo.org/2011/1/22/forwards-compatible-python/)::
-
-   import sys
-
-   class UnicodeMixin(object):
-
-     """Mixin class to handle defining the proper __str__/__unicode__
-     methods in Python 2 or 3."""
-
-     if sys.version_info[0] >= 3: # Python 3
-         def __str__(self):
-             return self.__unicode__()
-     else:  # Python 2
-         def __str__(self):
-             return self.__unicode__().encode('utf8')
-
-
-   class Spam(UnicodeMixin):
-
-     def __unicode__(self):
-         return u'spam-spam-bacon-spam'  # 2to3 will remove the 'u' prefix
-
-
-Don't Index on Exceptions
-'''''''''''''''''''''''''
-
-In Python 2, the following worked::
-
-   >>> exc = Exception(1, 2, 3)
-   >>> exc.args[1]
-   2
-   >>> exc[1]  # Python 2 only!
-   2
-
-But in Python 3, indexing directly on an exception is an error. You need to
-make sure to only index on the :attr:`BaseException.args` attribute which is a
-sequence containing all arguments passed to the :meth:`__init__` method.
-
-Even better is to use the documented attributes the exception provides.
-
-
-Don't use ``__getslice__`` & Friends
-''''''''''''''''''''''''''''''''''''
-
-Been deprecated for a while, but Python 3 finally drops support for
-``__getslice__()``, etc. Move completely over to :meth:`__getitem__` and
-friends.
-
-
-Updating doctests
-'''''''''''''''''
-
-Don't forget to make them Python 2/3 compatible as well. If you wrote a
-monolithic set of doctests (e.g., a single docstring containing all of your
-doctests), you should at least consider breaking the doctests up into smaller
-pieces to make it more manageable to fix. Otherwise it might very well be worth
-your time and effort to port your tests to :mod:`unittest`.
-
-
-Update ``map`` for imbalanced input sequences
-'''''''''''''''''''''''''''''''''''''''''''''
-
-With Python 2, when ``map`` was given more than one input sequence it would pad
-the shorter sequences with `None` values, returning a sequence as long as the
-longest input sequence.
-
-With Python 3, if the input sequences to ``map`` are of unequal length, ``map``
-will stop at the termination of the shortest of the sequences. For full
-compatibility with ``map`` from Python 2.x, wrap the sequence arguments in
-:func:`itertools.zip_longest`, e.g. ``map(func, *sequences)`` becomes
-``list(map(func, itertools.zip_longest(*sequences)))``.
-
-Eliminate ``-3`` Warnings
--------------------------
-
-When you run your application's test suite, run it using the ``-3`` flag passed
-to Python. This will cause various warnings to be raised during execution about
-things that are semantic changes between Python 2 and 3. Try to eliminate those
-warnings to make your code even more portable to Python 3.
-
-
-Alternative Approaches
-======================
-
-While supporting Python 2 & 3 simultaneously is typically the preferred choice
-by people so that they can continue to improve code and have it work for the
-most number of users, your life may be easier if you only have to support one
-major version of Python going forward.
-
-Supporting Only Python 3 Going Forward From Python 2 Code
----------------------------------------------------------
-
-If you have Python 2 code but going forward only want to improve it as Python 3
-code, then you can use 2to3_ to translate your Python 2 code to Python 3 code.
-This is only recommended, though, if your current version of your project is
-going into maintenance mode and you want all new features to be exclusive to
-Python 3.
-
-
-Backporting Python 3 code to Python 2
--------------------------------------
-
-If you have Python 3 code and have little interest in supporting Python 2 you
-can use 3to2_ to translate from Python 3 code to Python 2 code. This is only
-recommended if you don't plan to heavily support Python 2 users. Otherwise
-write your code for Python 3 and then backport as far back as you want. This
-is typically easier than going from Python 2 to 3 as you will have worked out
-any difficulties with e.g. bytes/strings, etc.
-
-
-Other Resources
-===============
-
-The authors of the following blog posts, wiki pages, and books deserve special
-thanks for making public their tips for porting Python 2 code to Python 3 (and
-thus helping provide information for this document and its various revisions
-over the years):
-
-* http://wiki.python.org/moin/PortingPythonToPy3k
-* http://python3porting.com/
-* http://docs.pythonsprints.com/python3_porting/py-porting.html
-* http://techspot.zzzeek.org/2011/01/24/zzzeek-s-guide-to-python-3-porting/
-* http://dabeaz.blogspot.com/2011/01/porting-py65-and-my-superboard-to.html
-* http://lucumr.pocoo.org/2011/1/22/forwards-compatible-python/
-* http://lucumr.pocoo.org/2010/2/11/porting-to-python-3-a-guide/
-* https://wiki.ubuntu.com/Python/3
-
-If you feel there is something missing from this document that should be added,
-please email the python-porting_ mailing list.
-
-
-
-.. _2to3: http://docs.python.org/2/library/2to3.html
-.. _3to2: https://pypi.python.org/pypi/3to2
-.. _Cheeseshop: PyPI_
-.. _coverage: https://pypi.python.org/pypi/coverage
-.. _future: http://python-future.org/
-.. _modernize: https://github.com/mitsuhiko/python-modernize
+.. _2to3: https://docs.python.org/3/library/2to3.html
+.. _caniusepython3: https://pypi.python.org/pypi/caniusepython3
+.. _cheat sheet: http://python-future.org/compatible_idioms.html
+.. _coverage.py: https://pypi.python.org/pypi/coverage
+.. _Futurize: http://python-future.org/automatic_conversion.html
+.. _Modernize: http://python-modernize.readthedocs.org/en/latest/
 .. _Porting to Python 3: http://python3porting.com/
-.. _PyPI: http://pypi.python.org/
-.. _Python 2.2: http://www.python.org/2.2.x
-.. _Python 2.5: http://www.python.org/2.5.x
-.. _Python 2.6: http://www.python.org/2.6.x
-.. _Python 2.7: http://www.python.org/2.7.x
-.. _Python 2.5: http://www.python.org/2.5.x
-.. _Python 3.3: http://www.python.org/3.3.x
-.. _Python 3 Packages: https://pypi.python.org/pypi?:action=browse&c=533&show=all
+.. _Pylint: https://pypi.python.org/pypi/pylint
 .. _Python 3 Q & A: http://ncoghlan-devs-python-notes.readthedocs.org/en/latest/python3/questions_and_answers.html
-.. _python-porting: http://mail.python.org/mailman/listinfo/python-porting
+
+.. _python-future: http://python-future.org/
+.. _python-porting: https://mail.python.org/mailman/listinfo/python-porting
 .. _six: https://pypi.python.org/pypi/six
 .. _tox: https://pypi.python.org/pypi/tox
-.. _trove classifiers: https://pypi.python.org/pypi?%3Aaction=list_classifiers
-
+.. _trove classifier: https://pypi.python.org/pypi?%3Aaction=list_classifiers
+.. _"What's New": https://docs.python.org/3/whatsnew/index.html
diff --git a/Doc/howto/regex.rst b/Doc/howto/regex.rst
index 5203e53..fbe763b 100644
--- a/Doc/howto/regex.rst
+++ b/Doc/howto/regex.rst
@@ -271,8 +271,8 @@
 
    >>> import re
    >>> p = re.compile('ab*')
-   >>> p  #doctest: +ELLIPSIS
-   <_sre.SRE_Pattern object at 0x...>
+   >>> p
+   re.compile('ab*')
 
 :func:`re.compile` also accepts an optional *flags* argument, used to enable
 various special features and syntax variations.  We'll go over the available
@@ -383,8 +383,8 @@
 
    >>> import re
    >>> p = re.compile('[a-z]+')
-   >>> p  #doctest: +ELLIPSIS
-   <_sre.SRE_Pattern object at 0x...>
+   >>> p
+   re.compile('[a-z]+')
 
 Now, you can try matching various strings against the RE ``[a-z]+``.  An empty
 string shouldn't match at all, since ``+`` means 'one or more repetitions'.
@@ -402,7 +402,7 @@
 
    >>> m = p.match('tempo')
    >>> m  #doctest: +ELLIPSIS
-   <_sre.SRE_Match object at 0x...>
+   <_sre.SRE_Match object; span=(0, 5), match='tempo'>
 
 Now you can query the :ref:`match object <match-objects>` for information
 about the matching string.  :ref:`match object <match-objects>` instances
@@ -441,7 +441,7 @@
    >>> print(p.match('::: message'))
    None
    >>> m = p.search('::: message'); print(m)  #doctest: +ELLIPSIS
-   <_sre.SRE_Match object at 0x...>
+   <_sre.SRE_Match object; span=(4, 11), match='message'>
    >>> m.group()
    'message'
    >>> m.span()
@@ -493,7 +493,7 @@
    >>> print(re.match(r'From\s+', 'Fromage amk'))
    None
    >>> re.match(r'From\s+', 'From amk Thu May 14 19:12:10 1998')  #doctest: +ELLIPSIS
-   <_sre.SRE_Match object at 0x...>
+   <_sre.SRE_Match object; span=(0, 5), match='From '>
 
 Under the hood, these functions simply create a pattern object for you
 and call the appropriate method on it.  They also store the compiled
@@ -685,7 +685,7 @@
    line, the RE to use is ``^From``. ::
 
       >>> print(re.search('^From', 'From Here to Eternity'))  #doctest: +ELLIPSIS
-      <_sre.SRE_Match object at 0x...>
+      <_sre.SRE_Match object; span=(0, 4), match='From'>
       >>> print(re.search('^From', 'Reciting From Memory'))
       None
 
@@ -697,11 +697,11 @@
    or any location followed by a newline character.     ::
 
       >>> print(re.search('}$', '{block}'))  #doctest: +ELLIPSIS
-      <_sre.SRE_Match object at 0x...>
+      <_sre.SRE_Match object; span=(6, 7), match='}'>
       >>> print(re.search('}$', '{block} '))
       None
       >>> print(re.search('}$', '{block}\n'))  #doctest: +ELLIPSIS
-      <_sre.SRE_Match object at 0x...>
+      <_sre.SRE_Match object; span=(6, 7), match='}'>
 
    To match a literal ``'$'``, use ``\$`` or enclose it inside a character class,
    as in  ``[$]``.
@@ -726,7 +726,7 @@
 
       >>> p = re.compile(r'\bclass\b')
       >>> print(p.search('no class at all'))  #doctest: +ELLIPSIS
-      <_sre.SRE_Match object at 0x...>
+      <_sre.SRE_Match object; span=(3, 8), match='class'>
       >>> print(p.search('the declassified algorithm'))
       None
       >>> print(p.search('one subclass is'))
@@ -744,7 +744,7 @@
       >>> print(p.search('no class at all'))
       None
       >>> print(p.search('\b' + 'class' + '\b'))  #doctest: +ELLIPSIS
-      <_sre.SRE_Match object at 0x...>
+      <_sre.SRE_Match object; span=(0, 7), match='\x08class\x08'>
 
    Second, inside a character class, where there's no use for this assertion,
    ``\b`` represents the backspace character, for compatibility with Python's
diff --git a/Doc/howto/sockets.rst b/Doc/howto/sockets.rst
index 7a9b0ed..d5aff90 100644
--- a/Doc/howto/sockets.rst
+++ b/Doc/howto/sockets.rst
@@ -180,7 +180,7 @@
 Assuming you don't want to end the connection, the simplest solution is a fixed
 length message::
 
-   class mysocket:
+   class MySocket:
        """demonstration class only
          - coded for clarity, not efficiency
        """
@@ -189,8 +189,8 @@
            if sock is None:
                self.sock = socket.socket(
                                socket.AF_INET, socket.SOCK_STREAM)
-               else:
-                   self.sock = sock
+           else:
+               self.sock = sock
 
        def connect(self, host, port):
            self.sock.connect((host, port))
@@ -204,13 +204,15 @@
                totalsent = totalsent + sent
 
        def myreceive(self):
-           msg = b''
-           while len(msg) < MSGLEN:
-               chunk = self.sock.recv(MSGLEN-len(msg))
+           chunks = []
+           bytes_recd = 0
+           while bytes_recd < MSGLEN:
+               chunk = self.sock.recv(min(MSGLEN - bytes_recd, 2048))
                if chunk == b'':
                    raise RuntimeError("socket connection broken")
-               msg = msg + chunk
-           return msg
+               chunks.append(chunk)
+               bytes_recd = bytes_recd + len(chunk)
+           return b''.join(chunks)
 
 The sending code here is usable for almost any messaging scheme - in Python you
 send strings, and you can use ``len()`` to determine its length (even if it has
diff --git a/Doc/howto/unicode.rst b/Doc/howto/unicode.rst
index 9d48a78..b49ac39 100644
--- a/Doc/howto/unicode.rst
+++ b/Doc/howto/unicode.rst
@@ -32,11 +32,11 @@
 In the mid-1980s an Apple II BASIC program written by a French speaker
 might have lines like these::
 
-   PRINT "FICHIER EST COMPLETE."
-   PRINT "CARACTERE NON ACCEPTE."
+   PRINT "MISE A JOUR TERMINEE"
+   PRINT "PARAMETRES ENREGISTRES"
 
-Those messages should contain accents (completé, caractère, accepté),
-and they just look wrong to someone who can read French.
+Those messages should contain accents (terminée, paramètre, enregistrés) and
+they just look wrong to someone who can read French.
 
 In the 1980s, almost all personal computers were 8-bit, meaning that bytes could
 hold values ranging from 0 to 255.  ASCII codes only went up to 127, so some
@@ -49,7 +49,7 @@
 
 255 characters aren't very many.  For example, you can't fit both the accented
 characters used in Western Europe and the Cyrillic alphabet used for Russian
-into the 128--255 range because there are more than 127 such characters.
+into the 128--255 range because there are more than 128 such characters.
 
 You could write files using different codes (all your Russian files in a coding
 system called KOI8, all your French files in a different coding system called
@@ -246,7 +246,7 @@
    try:
        with open('/tmp/input.txt', 'r') as f:
            ...
-   except IOError:
+   except OSError:
        # 'File not found' error message.
        print("Fichier non trouvé")
 
@@ -493,10 +493,11 @@
 
 The documentation for the :mod:`codecs` module.
 
-Marc-André Lemburg gave `a presentation titled "Python and Unicode" (PDF slides) <http://downloads.egenix.com/python/Unicode-EPC2002-Talk.pdf>`_ at
-EuroPython 2002.  The slides are an excellent overview of the design
-of Python 2's Unicode features (where the Unicode string type is
-called ``unicode`` and literals start with ``u``).
+Marc-André Lemburg gave `a presentation titled "Python and Unicode" (PDF slides)
+<https://downloads.egenix.com/python/Unicode-EPC2002-Talk.pdf>`_ at
+EuroPython 2002.  The slides are an excellent overview of the design of Python
+2's Unicode features (where the Unicode string type is called ``unicode`` and
+literals start with ``u``).
 
 
 Reading and Writing Unicode Data
@@ -696,13 +697,20 @@
 References
 ----------
 
-One section of `Mastering Python 3 Input/Output <http://pyvideo.org/video/289/pycon-2010--mastering-python-3-i-o>`_,  a PyCon 2010 talk by David Beazley, discusses text processing and binary data handling.
+One section of `Mastering Python 3 Input/Output
+<http://pyvideo.org/video/289/pycon-2010--mastering-python-3-i-o>`_,
+a PyCon 2010 talk by David Beazley, discusses text processing and binary data handling.
 
-The `PDF slides for Marc-André Lemburg's presentation "Writing Unicode-aware Applications in Python" <http://downloads.egenix.com/python/LSM2005-Developing-Unicode-aware-applications-in-Python.pdf>`_
+The `PDF slides for Marc-André Lemburg's presentation "Writing Unicode-aware
+Applications in Python"
+<https://downloads.egenix.com/python/LSM2005-Developing-Unicode-aware-applications-in-Python.pdf>`_
 discuss questions of character encodings as well as how to internationalize
 and localize an application.  These slides cover Python 2.x only.
 
-`The Guts of Unicode in Python <http://pyvideo.org/video/1768/the-guts-of-unicode-in-python>`_ is a PyCon 2013 talk by Benjamin Peterson that discusses the internal Unicode representation in Python 3.3.
+`The Guts of Unicode in Python
+<http://pyvideo.org/video/1768/the-guts-of-unicode-in-python>`_
+is a PyCon 2013 talk by Benjamin Peterson that discusses the internal Unicode
+representation in Python 3.3.
 
 
 Acknowledgements
diff --git a/Doc/howto/urllib2.rst b/Doc/howto/urllib2.rst
index 5a22660..abec053 100644
--- a/Doc/howto/urllib2.rst
+++ b/Doc/howto/urllib2.rst
@@ -26,7 +26,7 @@
 
         A tutorial on *Basic Authentication*, with examples in Python.
 
-**urllib.request** is a `Python <http://www.python.org>`_ module for fetching URLs
+**urllib.request** is a Python module for fetching URLs
 (Uniform Resource Locators). It offers a very simple interface, in the form of
 the *urlopen* function. This is capable of fetching URLs using a variety of
 different protocols. It also offers a slightly more complex interface for
@@ -97,7 +97,7 @@
 ----
 
 Sometimes you want to send data to a URL (often the URL will refer to a CGI
-(Common Gateway Interface) script [#]_ or other web application). With HTTP,
+(Common Gateway Interface) script or other web application). With HTTP,
 this is often done using what's known as a **POST** request. This is often what
 your browser does when you submit a HTML form that you filled in on the web. Not
 all POSTs have to come from forms: you can use a POST to transmit arbitrary data
@@ -507,7 +507,7 @@
     -- ``ProxyHandler`` (if a proxy setting such as an :envvar:`http_proxy`
     environment variable is set), ``UnknownHandler``, ``HTTPHandler``,
     ``HTTPDefaultErrorHandler``, ``HTTPRedirectHandler``, ``FTPHandler``,
-    ``FileHandler``, ``HTTPErrorProcessor``.
+    ``FileHandler``, ``DataHandler``, ``HTTPErrorProcessor``.
 
 ``top_level_url`` is in fact *either* a full URL (including the 'http:' scheme
 component and the hostname and optionally the port number)
@@ -572,12 +572,8 @@
 
 This document was reviewed and revised by John Lee.
 
-.. [#] For an introduction to the CGI protocol see
-       `Writing Web Applications in Python <http://www.pyzine.com/Issue008/Section_Articles/article_CGIOne.html>`_.
 .. [#] Like Google for example. The *proper* way to use google from a program
-       is to use `PyGoogle <http://pygoogle.sourceforge.net>`_ of course. See
-       `Voidspace Google <http://www.voidspace.org.uk/python/recipebook.shtml#google>`_
-       for some examples of using the Google API.
+       is to use `PyGoogle <http://pygoogle.sourceforge.net>`_ of course.
 .. [#] Browser sniffing is a very bad practise for website design - building
        sites using web standards is much more sensible. Unfortunately a lot of
        sites still send different versions to different browsers.
@@ -591,5 +587,5 @@
        scripts with a localhost server, I have to prevent urllib from using
        the proxy.
 .. [#] urllib opener for SSL proxy (CONNECT method): `ASPN Cookbook Recipe
-       <http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/456195>`_.
+       <http://code.activestate.com/recipes/456195/>`_.
 
diff --git a/Doc/howto/webservers.rst b/Doc/howto/webservers.rst
index 72ccd1f..9e9b69d 100644
--- a/Doc/howto/webservers.rst
+++ b/Doc/howto/webservers.rst
@@ -26,7 +26,7 @@
    While this HOWTO tries to give an overview of Python in the web, it cannot
    always be as up to date as desired.  Web development in Python is rapidly
    moving forward, so the wiki page on `Web Programming
-   <http://wiki.python.org/moin/WebProgramming>`_ may be more in sync with
+   <https://wiki.python.org/moin/WebProgramming>`_ may be more in sync with
    recent development.
 
 
@@ -86,7 +86,7 @@
      applications, instead of presenting a "500 Internal Server Error" message
 
    The Python wiki features a page on `CGI scripts
-   <http://wiki.python.org/moin/CgiScripts>`_ with some additional information
+   <https://wiki.python.org/moin/CgiScripts>`_ with some additional information
    about CGI in Python.
 
 
@@ -146,7 +146,7 @@
   tutorial also describes the most common gotchas that might arise.
 
 * On lighttpd you need to use the `CGI module
-  <http://redmine.lighttpd.net/wiki/lighttpd/Docs:ModCGI>`_\ , which can be configured
+  <http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_ModCGI>`_\ , which can be configured
   in a straightforward way.  It boils down to setting ``cgi.assign`` properly.
 
 
@@ -210,7 +210,7 @@
 ----------
 
 People coming from PHP often find it hard to grasp how to use Python in the web.
-Their first thought is mostly `mod_python <http://www.modpython.org/>`_\ ,
+Their first thought is mostly `mod_python <http://modpython.org/>`_\ ,
 because they think that this is the equivalent to ``mod_php``.  Actually, there
 are many differences.  What ``mod_python`` does is embed the interpreter into
 the Apache process, thus speeding up requests by not having to start a Python
@@ -260,13 +260,6 @@
 These days, FastCGI is never used directly.  Just like ``mod_python``, it is only
 used for the deployment of WSGI applications.
 
-.. seealso::
-
-   * `FastCGI, SCGI, and Apache: Background and Future
-     <http://www.vmunix.com/mark/blog/archives/2006/01/02/fastcgi-scgi-and-apache-background-and-future/>`_
-     is a discussion on why the concept of FastCGI and SCGI is better than that
-     of mod_python.
-
 
 Setting up FastCGI
 ^^^^^^^^^^^^^^^^^^
@@ -280,8 +273,8 @@
   to be loaded by Apache.
 
 * lighttpd ships its own `FastCGI module
-  <http://redmine.lighttpd.net/wiki/lighttpd/Docs:ModFastCGI>`_ as well as an
-  `SCGI module <http://redmine.lighttpd.net/wiki/lighttpd/Docs:ModSCGI>`_.
+  <http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_ModFastCGI>`_ as well as an
+  `SCGI module <http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_ModSCGI>`_.
 
 * `nginx <http://nginx.org/>`_ also supports `FastCGI
   <http://wiki.nginx.org/NginxSimplePythonFCGI>`_.
@@ -309,13 +302,13 @@
     WSGIServer(app).run()
 
 This is a simple WSGI application, but you need to install `flup
-<http://pypi.python.org/pypi/flup/1.0>`_ first, as flup handles the low level
+<https://pypi.python.org/pypi/flup/1.0>`_ first, as flup handles the low level
 FastCGI access.
 
 .. seealso::
 
    There is some documentation on `setting up Django with FastCGI
-   <http://docs.djangoproject.com/en/dev/howto/deployment/fastcgi/>`_, most of
+   <https://docs.djangoproject.com/en/dev/howto/deployment/fastcgi/>`_, most of
    which can be reused for other WSGI-compliant frameworks and libraries.
    Only the ``manage.py`` part has to be changed, the example used here can be
    used instead.  Django does more or less the exact same thing.
@@ -486,7 +479,7 @@
 
    There are far more components than can be presented here.  The Python wiki
    has a page about these components, called
-   `Web Components <http://wiki.python.org/moin/WebComponents>`_.
+   `Web Components <https://wiki.python.org/moin/WebComponents>`_.
 
 
 Templates
@@ -522,13 +515,13 @@
 
    * `Mako <http://www.makotemplates.org/>`_
    * `Genshi <http://genshi.edgewall.org/>`_
-   * `Jinja <http://jinja.pocoo.org/2/>`_
+   * `Jinja <http://jinja.pocoo.org/>`_
 
 .. seealso::
 
    There are many template engines competing for attention, because it is
    pretty easy to create them in Python.  The page `Templating
-   <http://wiki.python.org/moin/Templating>`_ in the wiki lists a big,
+   <https://wiki.python.org/moin/Templating>`_ in the wiki lists a big,
    ever-growing number of these.  The three listed above are considered "second
    generation" template engines and are a good place to start.
 
@@ -578,11 +571,11 @@
 
 .. seealso::
 
-   * `Persistence Tools <http://wiki.python.org/moin/PersistenceTools>`_ lists
+   * `Persistence Tools <https://wiki.python.org/moin/PersistenceTools>`_ lists
      possibilities on how to save data in the file system.  Some of these
      modules are part of the standard library
 
-   * `Database Programming <http://wiki.python.org/moin/DatabaseProgramming>`_
+   * `Database Programming <https://wiki.python.org/moin/DatabaseProgramming>`_
      helps with choosing a method for saving data
 
    * `SQLAlchemy <http://www.sqlalchemy.org/>`_, the most powerful OR-Mapper
@@ -644,7 +637,7 @@
 Django
 ^^^^^^
 
-`Django <http://www.djangoproject.com/>`_ is a framework consisting of several
+`Django <https://www.djangoproject.com/>`_ is a framework consisting of several
 tightly coupled elements which were written from scratch and work together very
 well.  It includes an ORM which is quite powerful while being simple to use,
 and has a great online administration interface which makes it possible to edit
@@ -657,7 +650,7 @@
 It has a big, international community, the members of which have created many
 web sites.  There are also a lot of add-on projects which extend Django's normal
 functionality.  This is partly due to Django's well written `online
-documentation <http://docs.djangoproject.com/>`_ and the `Django book
+documentation <https://docs.djangoproject.com/>`_ and the `Django book
 <http://www.djangobook.com/>`_.
 
 
@@ -665,7 +658,7 @@
 
    Although Django is an MVC-style framework, it names the elements
    differently, which is described in the `Django FAQ
-   <http://docs.djangoproject.com/en/dev/faq/general/#django-appears-to-be-a-mvc-framework-but-you-call-the-controller-the-view-and-the-view-the-template-how-come-you-don-t-use-the-standard-names>`_.
+   <https://docs.djangoproject.com/en/dev/faq/general/#django-appears-to-be-a-mvc-framework-but-you-call-the-controller-the-view-and-the-view-the-template-how-come-you-don-t-use-the-standard-names>`_.
 
 
 TurboGears
@@ -687,7 +680,7 @@
 The newest version of TurboGears, version 2.0, moves even further in direction
 of WSGI support and a component-based architecture.  TurboGears 2 is based on
 the WSGI stack of another popular component-based web framework, `Pylons
-<http://pylonshq.com/>`_.
+<http://www.pylonsproject.org/>`_.
 
 
 Zope
@@ -708,7 +701,7 @@
 separate framework based on the Zope components: `Grok
 <http://grok.zope.org/>`_.
 
-Zope is also the infrastructure used by the `Plone <http://plone.org/>`_ content
+Zope is also the infrastructure used by the `Plone <https://plone.org/>`_ content
 management system, one of the most powerful and popular content management
 systems available.
 
@@ -732,9 +725,7 @@
 .. seealso::
 
    The Python wiki contains an extensive list of `web frameworks
-   <http://wiki.python.org/moin/WebFrameworks>`_.
+   <https://wiki.python.org/moin/WebFrameworks>`_.
 
    Most frameworks also have their own mailing lists and IRC channels, look out
-   for these on the projects' web sites.  There is also a general "Python in the
-   Web" IRC channel on freenode called `#python.web
-   <http://wiki.python.org/moin/PoundPythonWeb>`_.
+   for these on the projects' web sites.
diff --git a/Doc/includes/email-alternative-new-api.py b/Doc/includes/email-alternative-new-api.py
new file mode 100644
index 0000000..c1255a6
--- /dev/null
+++ b/Doc/includes/email-alternative-new-api.py
@@ -0,0 +1,56 @@
+#!/usr/bin/env python3
+
+import smtplib
+
+from email.message import EmailMessage
+from email.headerregistry import Address
+from email.utils import make_msgid
+
+# Create the base text message.
+msg = EmailMessage()
+msg['Subject'] = "Ayons asperges pour le déjeuner"
+msg['From'] = Address("Pepé Le Pew", "pepe@example.com")
+msg['To'] = (Address("Penelope Pussycat", "penelope@example.com"),
+             Address("Fabrette Pussycat", "fabrette@example.com"))
+msg.set_content("""\
+Salut!
+
+Cela ressemble à un excellent recipie[1] déjeuner.
+
+[1] http://www.yummly.com/recipe/Roasted-Asparagus-Epicurious-203718
+
+--Pepé
+""")
+
+# Add the html version.  This converts the message into a multipart/alternative
+# container, with the original text message as the first part and the new html
+# message as the second part.
+asparagus_cid = make_msgid()
+msg.add_alternative("""\
+<html>
+  <head></head>
+  <body>
+    <p>Salut!<\p>
+    <p>Cela ressemble à un excellent
+        <a href="http://www.yummly.com/recipe/Roasted-Asparagus-Epicurious-203718>
+            recipie
+        </a> déjeuner.
+    </p>
+    <img src="cid:{asparagus_cid}" \>
+  </body>
+</html>
+""".format(asparagus_cid=asparagus_cid[1:-1]), subtype='html')
+# note that we needed to peel the <> off the msgid for use in the html.
+
+# Now add the related image to the html part.
+with open("roasted-asparagus.jpg", 'rb') as img:
+    msg.get_payload()[1].add_related(img.read(), 'image', 'jpeg',
+                                     cid=asparagus_cid)
+
+# Make a local copy of what we are going to send.
+with open('outgoing.msg', 'wb') as f:
+    f.write(bytes(msg))
+
+# Send the message via local SMTP server.
+with smtplib.SMTP('localhost') as s:
+    s.send_message(msg)
diff --git a/Doc/includes/email-alternative.py b/Doc/includes/email-alternative.py
old mode 100644
new mode 100755
index 33c430a..85070f3
--- a/Doc/includes/email-alternative.py
+++ b/Doc/includes/email-alternative.py
@@ -17,14 +17,14 @@
 msg['To'] = you
 
 # Create the body of the message (a plain-text and an HTML version).
-text = "Hi!\nHow are you?\nHere is the link you wanted:\nhttp://www.python.org"
+text = "Hi!\nHow are you?\nHere is the link you wanted:\nhttps://www.python.org"
 html = """\
 <html>
   <head></head>
   <body>
     <p>Hi!<br>
        How are you?<br>
-       Here is the <a href="http://www.python.org">link</a> you wanted.
+       Here is the <a href="https://www.python.org">link</a> you wanted.
     </p>
   </body>
 </html>
diff --git a/Doc/includes/email-dir.py b/Doc/includes/email-dir.py
index cc5529e..3c7c770 100644
--- a/Doc/includes/email-dir.py
+++ b/Doc/includes/email-dir.py
@@ -8,7 +8,7 @@
 # For guessing MIME type based on file name extension
 import mimetypes
 
-from optparse import OptionParser
+from argparse import ArgumentParser
 
 from email import encoders
 from email.message import Message
@@ -22,44 +22,36 @@
 
 
 def main():
-    parser = OptionParser(usage="""\
+    parser = ArgumentParser(description="""\
 Send the contents of a directory as a MIME message.
-
-Usage: %prog [options]
-
 Unless the -o option is given, the email is sent by forwarding to your local
 SMTP server, which then does the normal delivery process.  Your local machine
 must be running an SMTP server.
 """)
-    parser.add_option('-d', '--directory',
-                      type='string', action='store',
-                      help="""Mail the contents of the specified directory,
-                      otherwise use the current directory.  Only the regular
-                      files in the directory are sent, and we don't recurse to
-                      subdirectories.""")
-    parser.add_option('-o', '--output',
-                      type='string', action='store', metavar='FILE',
-                      help="""Print the composed message to FILE instead of
-                      sending the message to the SMTP server.""")
-    parser.add_option('-s', '--sender',
-                      type='string', action='store', metavar='SENDER',
-                      help='The value of the From: header (required)')
-    parser.add_option('-r', '--recipient',
-                      type='string', action='append', metavar='RECIPIENT',
-                      default=[], dest='recipients',
-                      help='A To: header value (at least one required)')
-    opts, args = parser.parse_args()
-    if not opts.sender or not opts.recipients:
-        parser.print_help()
-        sys.exit(1)
-    directory = opts.directory
+    parser.add_argument('-d', '--directory',
+                        help="""Mail the contents of the specified directory,
+                        otherwise use the current directory.  Only the regular
+                        files in the directory are sent, and we don't recurse to
+                        subdirectories.""")
+    parser.add_argument('-o', '--output',
+                        metavar='FILE',
+                        help="""Print the composed message to FILE instead of
+                        sending the message to the SMTP server.""")
+    parser.add_argument('-s', '--sender', required=True,
+                        help='The value of the From: header (required)')
+    parser.add_argument('-r', '--recipient', required=True,
+                        action='append', metavar='RECIPIENT',
+                        default=[], dest='recipients',
+                        help='A To: header value (at least one required)')
+    args = parser.parse_args()
+    directory = args.directory
     if not directory:
         directory = '.'
     # Create the enclosing (outer) message
     outer = MIMEMultipart()
     outer['Subject'] = 'Contents of directory %s' % os.path.abspath(directory)
-    outer['To'] = COMMASPACE.join(opts.recipients)
-    outer['From'] = opts.sender
+    outer['To'] = COMMASPACE.join(args.recipients)
+    outer['From'] = args.sender
     outer.preamble = 'You will not see this in a MIME-aware mail reader.\n'
 
     for filename in os.listdir(directory):
@@ -76,23 +68,19 @@
             ctype = 'application/octet-stream'
         maintype, subtype = ctype.split('/', 1)
         if maintype == 'text':
-            fp = open(path)
-            # Note: we should handle calculating the charset
-            msg = MIMEText(fp.read(), _subtype=subtype)
-            fp.close()
+            with open(path) as fp:
+                # Note: we should handle calculating the charset
+                msg = MIMEText(fp.read(), _subtype=subtype)
         elif maintype == 'image':
-            fp = open(path, 'rb')
-            msg = MIMEImage(fp.read(), _subtype=subtype)
-            fp.close()
+            with open(path, 'rb') as fp:
+                msg = MIMEImage(fp.read(), _subtype=subtype)
         elif maintype == 'audio':
-            fp = open(path, 'rb')
-            msg = MIMEAudio(fp.read(), _subtype=subtype)
-            fp.close()
+            with open(path, 'rb') as fp:
+                msg = MIMEAudio(fp.read(), _subtype=subtype)
         else:
-            fp = open(path, 'rb')
-            msg = MIMEBase(maintype, subtype)
-            msg.set_payload(fp.read())
-            fp.close()
+            with open(path, 'rb') as fp:
+                msg = MIMEBase(maintype, subtype)
+                msg.set_payload(fp.read())
             # Encode the payload using Base64
             encoders.encode_base64(msg)
         # Set the filename parameter
@@ -100,14 +88,12 @@
         outer.attach(msg)
     # Now send or store the message
     composed = outer.as_string()
-    if opts.output:
-        fp = open(opts.output, 'w')
-        fp.write(composed)
-        fp.close()
+    if args.output:
+        with open(args.output, 'w') as fp:
+            fp.write(composed)
     else:
-        s = smtplib.SMTP('localhost')
-        s.sendmail(opts.sender, opts.recipients, composed)
-        s.quit()
+        with smtplib.SMTP('localhost') as s:
+            s.sendmail(args.sender, args.recipients, composed)
 
 
 if __name__ == '__main__':
diff --git a/Doc/includes/email-read-alternative-new-api.py b/Doc/includes/email-read-alternative-new-api.py
new file mode 100644
index 0000000..8ab4e9f
--- /dev/null
+++ b/Doc/includes/email-read-alternative-new-api.py
@@ -0,0 +1,74 @@
+import os
+import sys
+import tempfile
+import mimetypes
+import webbrowser
+
+# Import the email modules we'll need
+from email import policy
+from email.parser import BytesParser
+
+# An imaginary module that would make this work and be safe.
+from imaginary import magic_html_parser
+
+# In a real program you'd get the filename from the arguments.
+msg = BytesParser(policy=policy.default).parse(open('outgoing.msg', 'rb'))
+
+# Now the header items can be accessed as a dictionary, and any non-ASCII will
+# be converted to unicode:
+print('To:', msg['to'])
+print('From:', msg['from'])
+print('Subject:', msg['subject'])
+
+# If we want to print a priview of the message content, we can extract whatever
+# the least formatted payload is and print the first three lines.  Of course,
+# if the message has no plain text part printing the first three lines of html
+# is probably useless, but this is just a conceptual example.
+simplest = msg.get_body(preferencelist=('plain', 'html'))
+print()
+print(''.join(simplest.get_content().splitlines(keepends=True)[:3]))
+
+ans = input("View full message?")
+if ans.lower()[0] == 'n':
+    sys.exit()
+
+# We can extract the richest alternative in order to display it:
+richest = msg.get_body()
+partfiles = {}
+if richest['content-type'].maintype == 'text':
+    if richest['content-type'].subtype == 'plain':
+        for line in richest.get_content().splitlines():
+            print(line)
+        sys.exit()
+    elif richest['content-type'].subtype == 'html':
+        body = richest
+    else:
+        print("Don't know how to display {}".format(richest.get_content_type()))
+        sys.exit()
+elif richest['content-type'].content_type == 'multipart/related':
+    body = richest.get_body(preferencelist=('html'))
+    for part in richest.iter_attachments():
+        fn = part.get_filename()
+        if fn:
+            extension = os.path.splitext(part.get_filename())[1]
+        else:
+            extension = mimetypes.guess_extension(part.get_content_type())
+        with tempfile.NamedTemporaryFile(suffix=extension, delete=False) as f:
+            f.write(part.get_content())
+            # again strip the <> to go from email form of cid to html form.
+            partfiles[part['content-id'][1:-1]] = f.name
+else:
+    print("Don't know how to display {}".format(richest.get_content_type()))
+    sys.exit()
+with tempfile.NamedTemporaryFile(mode='w', delete=False) as f:
+    # The magic_html_parser has to rewrite the href="cid:...." attributes to
+    # point to the filenames in partfiles.  It also has to do a safety-sanitize
+    # of the html.  It could be written using html.parser.
+    f.write(magic_html_parser(body.get_content(), partfiles))
+webbrowser.open(f.name)
+os.remove(f.name)
+for fn in partfiles.values():
+    os.remove(fn)
+
+# Of course, there are lots of email messages that could break this simple
+# minded program, but it will handle the most common ones.
diff --git a/Doc/includes/email-unpack.py b/Doc/includes/email-unpack.py
index 3653543..574a0b6 100644
--- a/Doc/includes/email-unpack.py
+++ b/Doc/includes/email-unpack.py
@@ -8,41 +8,27 @@
 import errno
 import mimetypes
 
-from optparse import OptionParser
+from argparse import ArgumentParser
 
 
 def main():
-    parser = OptionParser(usage="""\
+    parser = ArgumentParser(description="""\
 Unpack a MIME message into a directory of files.
-
-Usage: %prog [options] msgfile
 """)
-    parser.add_option('-d', '--directory',
-                      type='string', action='store',
-                      help="""Unpack the MIME message into the named
-                      directory, which will be created if it doesn't already
-                      exist.""")
-    opts, args = parser.parse_args()
-    if not opts.directory:
-        parser.print_help()
-        sys.exit(1)
+    parser.add_argument('-d', '--directory', required=True,
+                        help="""Unpack the MIME message into the named
+                        directory, which will be created if it doesn't already
+                        exist.""")
+    parser.add_argument('msgfile')
+    args = parser.parse_args()
+
+    with open(args.msgfile) as fp:
+        msg = email.message_from_file(fp)
 
     try:
-        msgfile = args[0]
-    except IndexError:
-        parser.print_help()
-        sys.exit(1)
-
-    try:
-        os.mkdir(opts.directory)
-    except OSError as e:
-        # Ignore directory exists error
-        if e.errno != errno.EEXIST:
-            raise
-
-    fp = open(msgfile)
-    msg = email.message_from_file(fp)
-    fp.close()
+        os.mkdir(args.directory)
+    except FileExistsError:
+        pass
 
     counter = 1
     for part in msg.walk():
@@ -59,9 +45,8 @@
                 ext = '.bin'
             filename = 'part-%03d%s' % (counter, ext)
         counter += 1
-        fp = open(os.path.join(opts.directory, filename), 'wb')
-        fp.write(part.get_payload(decode=True))
-        fp.close()
+        with open(os.path.join(args.directory, filename), 'wb') as fp:
+            fp.write(part.get_payload(decode=True))
 
 
 if __name__ == '__main__':
diff --git a/Doc/includes/mp_benchmarks.py b/Doc/includes/mp_benchmarks.py
deleted file mode 100644
index 3763ea9..0000000
--- a/Doc/includes/mp_benchmarks.py
+++ /dev/null
@@ -1,239 +0,0 @@
-#
-# Simple benchmarks for the multiprocessing package
-#
-# Copyright (c) 2006-2008, R Oudkerk
-# All rights reserved.
-#
-
-import time
-import multiprocessing
-import threading
-import queue
-import gc
-
-_timer = time.perf_counter
-
-delta = 1
-
-
-#### TEST_QUEUESPEED
-
-def queuespeed_func(q, c, iterations):
-    a = '0' * 256
-    c.acquire()
-    c.notify()
-    c.release()
-
-    for i in range(iterations):
-        q.put(a)
-
-    q.put('STOP')
-
-def test_queuespeed(Process, q, c):
-    elapsed = 0
-    iterations = 1
-
-    while elapsed < delta:
-        iterations *= 2
-
-        p = Process(target=queuespeed_func, args=(q, c, iterations))
-        c.acquire()
-        p.start()
-        c.wait()
-        c.release()
-
-        result = None
-        t = _timer()
-
-        while result != 'STOP':
-            result = q.get()
-
-        elapsed = _timer() - t
-
-        p.join()
-
-    print(iterations, 'objects passed through the queue in', elapsed, 'seconds')
-    print('average number/sec:', iterations/elapsed)
-
-
-#### TEST_PIPESPEED
-
-def pipe_func(c, cond, iterations):
-    a = '0' * 256
-    cond.acquire()
-    cond.notify()
-    cond.release()
-
-    for i in range(iterations):
-        c.send(a)
-
-    c.send('STOP')
-
-def test_pipespeed():
-    c, d = multiprocessing.Pipe()
-    cond = multiprocessing.Condition()
-    elapsed = 0
-    iterations = 1
-
-    while elapsed < delta:
-        iterations *= 2
-
-        p = multiprocessing.Process(target=pipe_func,
-                                    args=(d, cond, iterations))
-        cond.acquire()
-        p.start()
-        cond.wait()
-        cond.release()
-
-        result = None
-        t = _timer()
-
-        while result != 'STOP':
-            result = c.recv()
-
-        elapsed = _timer() - t
-        p.join()
-
-    print(iterations, 'objects passed through connection in',elapsed,'seconds')
-    print('average number/sec:', iterations/elapsed)
-
-
-#### TEST_SEQSPEED
-
-def test_seqspeed(seq):
-    elapsed = 0
-    iterations = 1
-
-    while elapsed < delta:
-        iterations *= 2
-
-        t = _timer()
-
-        for i in range(iterations):
-            a = seq[5]
-
-        elapsed = _timer() - t
-
-    print(iterations, 'iterations in', elapsed, 'seconds')
-    print('average number/sec:', iterations/elapsed)
-
-
-#### TEST_LOCK
-
-def test_lockspeed(l):
-    elapsed = 0
-    iterations = 1
-
-    while elapsed < delta:
-        iterations *= 2
-
-        t = _timer()
-
-        for i in range(iterations):
-            l.acquire()
-            l.release()
-
-        elapsed = _timer() - t
-
-    print(iterations, 'iterations in', elapsed, 'seconds')
-    print('average number/sec:', iterations/elapsed)
-
-
-#### TEST_CONDITION
-
-def conditionspeed_func(c, N):
-    c.acquire()
-    c.notify()
-
-    for i in range(N):
-        c.wait()
-        c.notify()
-
-    c.release()
-
-def test_conditionspeed(Process, c):
-    elapsed = 0
-    iterations = 1
-
-    while elapsed < delta:
-        iterations *= 2
-
-        c.acquire()
-        p = Process(target=conditionspeed_func, args=(c, iterations))
-        p.start()
-
-        c.wait()
-
-        t = _timer()
-
-        for i in range(iterations):
-            c.notify()
-            c.wait()
-
-        elapsed = _timer() - t
-
-        c.release()
-        p.join()
-
-    print(iterations * 2, 'waits in', elapsed, 'seconds')
-    print('average number/sec:', iterations * 2 / elapsed)
-
-####
-
-def test():
-    manager = multiprocessing.Manager()
-
-    gc.disable()
-
-    print('\n\t######## testing Queue.Queue\n')
-    test_queuespeed(threading.Thread, queue.Queue(),
-                    threading.Condition())
-    print('\n\t######## testing multiprocessing.Queue\n')
-    test_queuespeed(multiprocessing.Process, multiprocessing.Queue(),
-                    multiprocessing.Condition())
-    print('\n\t######## testing Queue managed by server process\n')
-    test_queuespeed(multiprocessing.Process, manager.Queue(),
-                    manager.Condition())
-    print('\n\t######## testing multiprocessing.Pipe\n')
-    test_pipespeed()
-
-    print()
-
-    print('\n\t######## testing list\n')
-    test_seqspeed(list(range(10)))
-    print('\n\t######## testing list managed by server process\n')
-    test_seqspeed(manager.list(list(range(10))))
-    print('\n\t######## testing Array("i", ..., lock=False)\n')
-    test_seqspeed(multiprocessing.Array('i', list(range(10)), lock=False))
-    print('\n\t######## testing Array("i", ..., lock=True)\n')
-    test_seqspeed(multiprocessing.Array('i', list(range(10)), lock=True))
-
-    print()
-
-    print('\n\t######## testing threading.Lock\n')
-    test_lockspeed(threading.Lock())
-    print('\n\t######## testing threading.RLock\n')
-    test_lockspeed(threading.RLock())
-    print('\n\t######## testing multiprocessing.Lock\n')
-    test_lockspeed(multiprocessing.Lock())
-    print('\n\t######## testing multiprocessing.RLock\n')
-    test_lockspeed(multiprocessing.RLock())
-    print('\n\t######## testing lock managed by server process\n')
-    test_lockspeed(manager.Lock())
-    print('\n\t######## testing rlock managed by server process\n')
-    test_lockspeed(manager.RLock())
-
-    print()
-
-    print('\n\t######## testing threading.Condition\n')
-    test_conditionspeed(threading.Thread, threading.Condition())
-    print('\n\t######## testing multiprocessing.Condition\n')
-    test_conditionspeed(multiprocessing.Process, multiprocessing.Condition())
-    print('\n\t######## testing condition managed by a server process\n')
-    test_conditionspeed(multiprocessing.Process, manager.Condition())
-
-    gc.enable()
-
-if __name__ == '__main__':
-    multiprocessing.freeze_support()
-    test()
diff --git a/Doc/includes/mp_newtype.py b/Doc/includes/mp_newtype.py
index 7291743..1c796a5 100644
--- a/Doc/includes/mp_newtype.py
+++ b/Doc/includes/mp_newtype.py
@@ -1,11 +1,3 @@
-#
-# This module shows how to use arbitrary callables with a subclass of
-# `BaseManager`.
-#
-# Copyright (c) 2006-2008, R Oudkerk
-# All rights reserved.
-#
-
 from multiprocessing import freeze_support
 from multiprocessing.managers import BaseManager, BaseProxy
 import operator
@@ -27,12 +19,10 @@
 
 # Proxy type for generator objects
 class GeneratorProxy(BaseProxy):
-    _exposed_ = ('next', '__next__')
+    _exposed_ = ['__next__']
     def __iter__(self):
         return self
     def __next__(self):
-        return self._callmethod('next')
-    def __next__(self):
         return self._callmethod('__next__')
 
 # Function to return the operator module
@@ -90,8 +80,6 @@
     op = manager.operator()
     print('op.add(23, 45) =', op.add(23, 45))
     print('op.pow(2, 94) =', op.pow(2, 94))
-    print('op.getslice(range(10), 2, 6) =', op.getslice(list(range(10)), 2, 6))
-    print('op.repeat(range(5), 3) =', op.repeat(list(range(5)), 3))
     print('op._exposed_ =', op._exposed_)
 
 ##
diff --git a/Doc/includes/mp_pool.py b/Doc/includes/mp_pool.py
index 1578498..11101e1 100644
--- a/Doc/includes/mp_pool.py
+++ b/Doc/includes/mp_pool.py
@@ -1,10 +1,3 @@
-#
-# A test of `multiprocessing.Pool` class
-#
-# Copyright (c) 2006-2008, R Oudkerk
-# All rights reserved.
-#
-
 import multiprocessing
 import time
 import random
@@ -46,269 +39,115 @@
 #
 
 def test():
-    print('cpu_count() = %d\n' % multiprocessing.cpu_count())
-
-    #
-    # Create pool
-    #
-
     PROCESSES = 4
     print('Creating pool with %d processes\n' % PROCESSES)
-    pool = multiprocessing.Pool(PROCESSES)
-    print('pool = %s' % pool)
-    print()
 
-    #
-    # Tests
-    #
+    with multiprocessing.Pool(PROCESSES) as pool:
+        #
+        # Tests
+        #
 
-    TASKS = [(mul, (i, 7)) for i in range(10)] + \
-            [(plus, (i, 8)) for i in range(10)]
+        TASKS = [(mul, (i, 7)) for i in range(10)] + \
+                [(plus, (i, 8)) for i in range(10)]
 
-    results = [pool.apply_async(calculate, t) for t in TASKS]
-    imap_it = pool.imap(calculatestar, TASKS)
-    imap_unordered_it = pool.imap_unordered(calculatestar, TASKS)
+        results = [pool.apply_async(calculate, t) for t in TASKS]
+        imap_it = pool.imap(calculatestar, TASKS)
+        imap_unordered_it = pool.imap_unordered(calculatestar, TASKS)
 
-    print('Ordered results using pool.apply_async():')
-    for r in results:
-        print('\t', r.get())
-    print()
+        print('Ordered results using pool.apply_async():')
+        for r in results:
+            print('\t', r.get())
+        print()
 
-    print('Ordered results using pool.imap():')
-    for x in imap_it:
-        print('\t', x)
-    print()
+        print('Ordered results using pool.imap():')
+        for x in imap_it:
+            print('\t', x)
+        print()
 
-    print('Unordered results using pool.imap_unordered():')
-    for x in imap_unordered_it:
-        print('\t', x)
-    print()
+        print('Unordered results using pool.imap_unordered():')
+        for x in imap_unordered_it:
+            print('\t', x)
+        print()
 
-    print('Ordered results using pool.map() --- will block till complete:')
-    for x in pool.map(calculatestar, TASKS):
-        print('\t', x)
-    print()
+        print('Ordered results using pool.map() --- will block till complete:')
+        for x in pool.map(calculatestar, TASKS):
+            print('\t', x)
+        print()
 
-    #
-    # Simple benchmarks
-    #
+        #
+        # Test error handling
+        #
 
-    N = 100000
-    print('def pow3(x): return x**3')
+        print('Testing error handling:')
 
-    t = time.time()
-    A = list(map(pow3, range(N)))
-    print('\tmap(pow3, range(%d)):\n\t\t%s seconds' % \
-          (N, time.time() - t))
-
-    t = time.time()
-    B = pool.map(pow3, range(N))
-    print('\tpool.map(pow3, range(%d)):\n\t\t%s seconds' % \
-          (N, time.time() - t))
-
-    t = time.time()
-    C = list(pool.imap(pow3, range(N), chunksize=N//8))
-    print('\tlist(pool.imap(pow3, range(%d), chunksize=%d)):\n\t\t%s' \
-          ' seconds' % (N, N//8, time.time() - t))
-
-    assert A == B == C, (len(A), len(B), len(C))
-    print()
-
-    L = [None] * 1000000
-    print('def noop(x): pass')
-    print('L = [None] * 1000000')
-
-    t = time.time()
-    A = list(map(noop, L))
-    print('\tmap(noop, L):\n\t\t%s seconds' % \
-          (time.time() - t))
-
-    t = time.time()
-    B = pool.map(noop, L)
-    print('\tpool.map(noop, L):\n\t\t%s seconds' % \
-          (time.time() - t))
-
-    t = time.time()
-    C = list(pool.imap(noop, L, chunksize=len(L)//8))
-    print('\tlist(pool.imap(noop, L, chunksize=%d)):\n\t\t%s seconds' % \
-          (len(L)//8, time.time() - t))
-
-    assert A == B == C, (len(A), len(B), len(C))
-    print()
-
-    del A, B, C, L
-
-    #
-    # Test error handling
-    #
-
-    print('Testing error handling:')
-
-    try:
-        print(pool.apply(f, (5,)))
-    except ZeroDivisionError:
-        print('\tGot ZeroDivisionError as expected from pool.apply()')
-    else:
-        raise AssertionError('expected ZeroDivisionError')
-
-    try:
-        print(pool.map(f, list(range(10))))
-    except ZeroDivisionError:
-        print('\tGot ZeroDivisionError as expected from pool.map()')
-    else:
-        raise AssertionError('expected ZeroDivisionError')
-
-    try:
-        print(list(pool.imap(f, list(range(10)))))
-    except ZeroDivisionError:
-        print('\tGot ZeroDivisionError as expected from list(pool.imap())')
-    else:
-        raise AssertionError('expected ZeroDivisionError')
-
-    it = pool.imap(f, list(range(10)))
-    for i in range(10):
         try:
-            x = next(it)
+            print(pool.apply(f, (5,)))
         except ZeroDivisionError:
-            if i == 5:
-                pass
-        except StopIteration:
-            break
+            print('\tGot ZeroDivisionError as expected from pool.apply()')
         else:
-            if i == 5:
-                raise AssertionError('expected ZeroDivisionError')
+            raise AssertionError('expected ZeroDivisionError')
 
-    assert i == 9
-    print('\tGot ZeroDivisionError as expected from IMapIterator.next()')
-    print()
-
-    #
-    # Testing timeouts
-    #
-
-    print('Testing ApplyResult.get() with timeout:', end=' ')
-    res = pool.apply_async(calculate, TASKS[0])
-    while 1:
-        sys.stdout.flush()
         try:
-            sys.stdout.write('\n\t%s' % res.get(0.02))
-            break
-        except multiprocessing.TimeoutError:
-            sys.stdout.write('.')
-    print()
-    print()
+            print(pool.map(f, list(range(10))))
+        except ZeroDivisionError:
+            print('\tGot ZeroDivisionError as expected from pool.map()')
+        else:
+            raise AssertionError('expected ZeroDivisionError')
 
-    print('Testing IMapIterator.next() with timeout:', end=' ')
-    it = pool.imap(calculatestar, TASKS)
-    while 1:
-        sys.stdout.flush()
         try:
-            sys.stdout.write('\n\t%s' % it.next(0.02))
-        except StopIteration:
-            break
-        except multiprocessing.TimeoutError:
-            sys.stdout.write('.')
-    print()
-    print()
+            print(list(pool.imap(f, list(range(10)))))
+        except ZeroDivisionError:
+            print('\tGot ZeroDivisionError as expected from list(pool.imap())')
+        else:
+            raise AssertionError('expected ZeroDivisionError')
 
-    #
-    # Testing callback
-    #
+        it = pool.imap(f, list(range(10)))
+        for i in range(10):
+            try:
+                x = next(it)
+            except ZeroDivisionError:
+                if i == 5:
+                    pass
+            except StopIteration:
+                break
+            else:
+                if i == 5:
+                    raise AssertionError('expected ZeroDivisionError')
 
-    print('Testing callback:')
+        assert i == 9
+        print('\tGot ZeroDivisionError as expected from IMapIterator.next()')
+        print()
 
-    A = []
-    B = [56, 0, 1, 8, 27, 64, 125, 216, 343, 512, 729]
+        #
+        # Testing timeouts
+        #
 
-    r = pool.apply_async(mul, (7, 8), callback=A.append)
-    r.wait()
+        print('Testing ApplyResult.get() with timeout:', end=' ')
+        res = pool.apply_async(calculate, TASKS[0])
+        while 1:
+            sys.stdout.flush()
+            try:
+                sys.stdout.write('\n\t%s' % res.get(0.02))
+                break
+            except multiprocessing.TimeoutError:
+                sys.stdout.write('.')
+        print()
+        print()
 
-    r = pool.map_async(pow3, list(range(10)), callback=A.extend)
-    r.wait()
-
-    if A == B:
-        print('\tcallbacks succeeded\n')
-    else:
-        print('\t*** callbacks failed\n\t\t%s != %s\n' % (A, B))
-
-    #
-    # Check there are no outstanding tasks
-    #
-
-    assert not pool._cache, 'cache = %r' % pool._cache
-
-    #
-    # Check close() methods
-    #
-
-    print('Testing close():')
-
-    for worker in pool._pool:
-        assert worker.is_alive()
-
-    result = pool.apply_async(time.sleep, [0.5])
-    pool.close()
-    pool.join()
-
-    assert result.get() is None
-
-    for worker in pool._pool:
-        assert not worker.is_alive()
-
-    print('\tclose() succeeded\n')
-
-    #
-    # Check terminate() method
-    #
-
-    print('Testing terminate():')
-
-    pool = multiprocessing.Pool(2)
-    DELTA = 0.1
-    ignore = pool.apply(pow3, [2])
-    results = [pool.apply_async(time.sleep, [DELTA]) for i in range(100)]
-    pool.terminate()
-    pool.join()
-
-    for worker in pool._pool:
-        assert not worker.is_alive()
-
-    print('\tterminate() succeeded\n')
-
-    #
-    # Check garbage collection
-    #
-
-    print('Testing garbage collection:')
-
-    pool = multiprocessing.Pool(2)
-    DELTA = 0.1
-    processes = pool._pool
-    ignore = pool.apply(pow3, [2])
-    results = [pool.apply_async(time.sleep, [DELTA]) for i in range(100)]
-
-    results = pool = None
-
-    time.sleep(DELTA * 2)
-
-    for worker in processes:
-        assert not worker.is_alive()
-
-    print('\tgarbage collection succeeded\n')
+        print('Testing IMapIterator.next() with timeout:', end=' ')
+        it = pool.imap(calculatestar, TASKS)
+        while 1:
+            sys.stdout.flush()
+            try:
+                sys.stdout.write('\n\t%s' % it.next(0.02))
+            except StopIteration:
+                break
+            except multiprocessing.TimeoutError:
+                sys.stdout.write('.')
+        print()
+        print()
 
 
 if __name__ == '__main__':
     multiprocessing.freeze_support()
-
-    assert len(sys.argv) in (1, 2)
-
-    if len(sys.argv) == 1 or sys.argv[1] == 'processes':
-        print(' Using processes '.center(79, '-'))
-    elif sys.argv[1] == 'threads':
-        print(' Using threads '.center(79, '-'))
-        import multiprocessing.dummy as multiprocessing
-    else:
-        print('Usage:\n\t%s [processes | threads]' % sys.argv[0])
-        raise SystemExit(2)
-
     test()
diff --git a/Doc/includes/mp_synchronize.py b/Doc/includes/mp_synchronize.py
deleted file mode 100644
index 81dbc38..0000000
--- a/Doc/includes/mp_synchronize.py
+++ /dev/null
@@ -1,278 +0,0 @@
-#
-# A test file for the `multiprocessing` package
-#
-# Copyright (c) 2006-2008, R Oudkerk
-# All rights reserved.
-#
-
-import time
-import sys
-import random
-from queue import Empty
-
-import multiprocessing               # may get overwritten
-
-
-#### TEST_VALUE
-
-def value_func(running, mutex):
-    random.seed()
-    time.sleep(random.random()*4)
-
-    mutex.acquire()
-    print('\n\t\t\t' + str(multiprocessing.current_process()) + ' has finished')
-    running.value -= 1
-    mutex.release()
-
-def test_value():
-    TASKS = 10
-    running = multiprocessing.Value('i', TASKS)
-    mutex = multiprocessing.Lock()
-
-    for i in range(TASKS):
-        p = multiprocessing.Process(target=value_func, args=(running, mutex))
-        p.start()
-
-    while running.value > 0:
-        time.sleep(0.08)
-        mutex.acquire()
-        print(running.value, end=' ')
-        sys.stdout.flush()
-        mutex.release()
-
-    print()
-    print('No more running processes')
-
-
-#### TEST_QUEUE
-
-def queue_func(queue):
-    for i in range(30):
-        time.sleep(0.5 * random.random())
-        queue.put(i*i)
-    queue.put('STOP')
-
-def test_queue():
-    q = multiprocessing.Queue()
-
-    p = multiprocessing.Process(target=queue_func, args=(q,))
-    p.start()
-
-    o = None
-    while o != 'STOP':
-        try:
-            o = q.get(timeout=0.3)
-            print(o, end=' ')
-            sys.stdout.flush()
-        except Empty:
-            print('TIMEOUT')
-
-    print()
-
-
-#### TEST_CONDITION
-
-def condition_func(cond):
-    cond.acquire()
-    print('\t' + str(cond))
-    time.sleep(2)
-    print('\tchild is notifying')
-    print('\t' + str(cond))
-    cond.notify()
-    cond.release()
-
-def test_condition():
-    cond = multiprocessing.Condition()
-
-    p = multiprocessing.Process(target=condition_func, args=(cond,))
-    print(cond)
-
-    cond.acquire()
-    print(cond)
-    cond.acquire()
-    print(cond)
-
-    p.start()
-
-    print('main is waiting')
-    cond.wait()
-    print('main has woken up')
-
-    print(cond)
-    cond.release()
-    print(cond)
-    cond.release()
-
-    p.join()
-    print(cond)
-
-
-#### TEST_SEMAPHORE
-
-def semaphore_func(sema, mutex, running):
-    sema.acquire()
-
-    mutex.acquire()
-    running.value += 1
-    print(running.value, 'tasks are running')
-    mutex.release()
-
-    random.seed()
-    time.sleep(random.random()*2)
-
-    mutex.acquire()
-    running.value -= 1
-    print('%s has finished' % multiprocessing.current_process())
-    mutex.release()
-
-    sema.release()
-
-def test_semaphore():
-    sema = multiprocessing.Semaphore(3)
-    mutex = multiprocessing.RLock()
-    running = multiprocessing.Value('i', 0)
-
-    processes = [
-        multiprocessing.Process(target=semaphore_func,
-                                args=(sema, mutex, running))
-        for i in range(10)
-        ]
-
-    for p in processes:
-        p.start()
-
-    for p in processes:
-        p.join()
-
-
-#### TEST_JOIN_TIMEOUT
-
-def join_timeout_func():
-    print('\tchild sleeping')
-    time.sleep(5.5)
-    print('\n\tchild terminating')
-
-def test_join_timeout():
-    p = multiprocessing.Process(target=join_timeout_func)
-    p.start()
-
-    print('waiting for process to finish')
-
-    while 1:
-        p.join(timeout=1)
-        if not p.is_alive():
-            break
-        print('.', end=' ')
-        sys.stdout.flush()
-
-
-#### TEST_EVENT
-
-def event_func(event):
-    print('\t%r is waiting' % multiprocessing.current_process())
-    event.wait()
-    print('\t%r has woken up' % multiprocessing.current_process())
-
-def test_event():
-    event = multiprocessing.Event()
-
-    processes = [multiprocessing.Process(target=event_func, args=(event,))
-                 for i in range(5)]
-
-    for p in processes:
-        p.start()
-
-    print('main is sleeping')
-    time.sleep(2)
-
-    print('main is setting event')
-    event.set()
-
-    for p in processes:
-        p.join()
-
-
-#### TEST_SHAREDVALUES
-
-def sharedvalues_func(values, arrays, shared_values, shared_arrays):
-    for i in range(len(values)):
-        v = values[i][1]
-        sv = shared_values[i].value
-        assert v == sv
-
-    for i in range(len(values)):
-        a = arrays[i][1]
-        sa = list(shared_arrays[i][:])
-        assert a == sa
-
-    print('Tests passed')
-
-def test_sharedvalues():
-    values = [
-        ('i', 10),
-        ('h', -2),
-        ('d', 1.25)
-        ]
-    arrays = [
-        ('i', list(range(100))),
-        ('d', [0.25 * i for i in range(100)]),
-        ('H', list(range(1000)))
-        ]
-
-    shared_values = [multiprocessing.Value(id, v) for id, v in values]
-    shared_arrays = [multiprocessing.Array(id, a) for id, a in arrays]
-
-    p = multiprocessing.Process(
-        target=sharedvalues_func,
-        args=(values, arrays, shared_values, shared_arrays)
-        )
-    p.start()
-    p.join()
-
-    assert p.exitcode == 0
-
-
-####
-
-def test(namespace=multiprocessing):
-    global multiprocessing
-
-    multiprocessing = namespace
-
-    for func in [test_value, test_queue, test_condition,
-                 test_semaphore, test_join_timeout, test_event,
-                 test_sharedvalues]:
-
-        print('\n\t######## %s\n' % func.__name__)
-        func()
-
-    ignore = multiprocessing.active_children()      # cleanup any old processes
-    if hasattr(multiprocessing, '_debug_info'):
-        info = multiprocessing._debug_info()
-        if info:
-            print(info)
-            raise ValueError('there should be no positive refcounts left')
-
-
-if __name__ == '__main__':
-    multiprocessing.freeze_support()
-
-    assert len(sys.argv) in (1, 2)
-
-    if len(sys.argv) == 1 or sys.argv[1] == 'processes':
-        print(' Using processes '.center(79, '-'))
-        namespace = multiprocessing
-    elif sys.argv[1] == 'manager':
-        print(' Using processes and a manager '.center(79, '-'))
-        namespace = multiprocessing.Manager()
-        namespace.Process = multiprocessing.Process
-        namespace.current_process = multiprocessing.current_process
-        namespace.active_children = multiprocessing.active_children
-    elif sys.argv[1] == 'threads':
-        print(' Using threads '.center(79, '-'))
-        import multiprocessing.dummy as namespace
-    else:
-        print('Usage:\n\t%s [processes | manager | threads]' % sys.argv[0])
-        raise SystemExit(2)
-
-    test(namespace)
diff --git a/Doc/includes/mp_webserver.py b/Doc/includes/mp_webserver.py
deleted file mode 100644
index 651024d..0000000
--- a/Doc/includes/mp_webserver.py
+++ /dev/null
@@ -1,70 +0,0 @@
-#
-# Example where a pool of http servers share a single listening socket
-#
-# On Windows this module depends on the ability to pickle a socket
-# object so that the worker processes can inherit a copy of the server
-# object.  (We import `multiprocessing.reduction` to enable this pickling.)
-#
-# Not sure if we should synchronize access to `socket.accept()` method by
-# using a process-shared lock -- does not seem to be necessary.
-#
-# Copyright (c) 2006-2008, R Oudkerk
-# All rights reserved.
-#
-
-import os
-import sys
-
-from multiprocessing import Process, current_process, freeze_support
-from http.server import HTTPServer
-from http.server import SimpleHTTPRequestHandler
-
-if sys.platform == 'win32':
-    import multiprocessing.reduction    # make sockets pickable/inheritable
-
-
-def note(format, *args):
-    sys.stderr.write('[%s]\t%s\n' % (current_process().name, format % args))
-
-
-class RequestHandler(SimpleHTTPRequestHandler):
-    # we override log_message() to show which process is handling the request
-    def log_message(self, format, *args):
-        note(format, *args)
-
-def serve_forever(server):
-    note('starting server')
-    try:
-        server.serve_forever()
-    except KeyboardInterrupt:
-        pass
-
-
-def runpool(address, number_of_processes):
-    # create a single server object -- children will each inherit a copy
-    server = HTTPServer(address, RequestHandler)
-
-    # create child processes to act as workers
-    for i in range(number_of_processes - 1):
-        Process(target=serve_forever, args=(server,)).start()
-
-    # main process also acts as a worker
-    serve_forever(server)
-
-
-def test():
-    DIR = os.path.join(os.path.dirname(__file__), '..')
-    ADDRESS = ('localhost', 8000)
-    NUMBER_OF_PROCESSES = 4
-
-    print('Serving at http://%s:%d using %d worker processes' % \
-          (ADDRESS[0], ADDRESS[1], NUMBER_OF_PROCESSES))
-    print('To exit press Ctrl-' + ['C', 'Break'][sys.platform=='win32'])
-
-    os.chdir(DIR)
-    runpool(ADDRESS, NUMBER_OF_PROCESSES)
-
-
-if __name__ == '__main__':
-    freeze_support()
-    test()
diff --git a/Doc/includes/mp_workers.py b/Doc/includes/mp_workers.py
index e66d97b..3b92269 100644
--- a/Doc/includes/mp_workers.py
+++ b/Doc/includes/mp_workers.py
@@ -1,16 +1,3 @@
-#
-# Simple example which uses a pool of workers to carry out some tasks.
-#
-# Notice that the results will probably not come out of the output
-# queue in the same in the same order as the corresponding tasks were
-# put on the input queue.  If it is important to get the results back
-# in the original order then consider using `Pool.map()` or
-# `Pool.imap()` (which will save on the amount of code needed anyway).
-#
-# Copyright (c) 2006-2008, R Oudkerk
-# All rights reserved.
-#
-
 import time
 import random
 
diff --git a/Doc/includes/typestruct.h b/Doc/includes/typestruct.h
index 32647c0..fcb846a 100644
--- a/Doc/includes/typestruct.h
+++ b/Doc/includes/typestruct.h
@@ -70,4 +70,11 @@
     PyObject *tp_subclasses;
     PyObject *tp_weaklist;
 
+    destructor tp_del;
+
+    /* Type attribute cache version tag. Added in version 2.6 */
+    unsigned int tp_version_tag;
+
+    destructor tp_finalize;
+
 } PyTypeObject;
diff --git a/Doc/install/index.rst b/Doc/install/index.rst
index 0c9a9f2..8f3ad72 100644
--- a/Doc/install/index.rst
+++ b/Doc/install/index.rst
@@ -2,9 +2,9 @@
 
 .. _install-index:
 
-*****************************
-  Installing Python Modules
-*****************************
+********************************************
+  Installing Python Modules (Legacy version)
+********************************************
 
 :Author: Greg Ward
 
@@ -1012,7 +1012,7 @@
 
 .. seealso::
 
-   `C++Builder Compiler <http://www.codegear.com/downloads/free/cppbuilder>`_
+   `C++Builder Compiler <http://www.embarcadero.com/downloads>`_
       Information about the free C++ compiler from Borland, including links to the
       download pages.
 
@@ -1084,7 +1084,7 @@
 
 .. seealso::
 
-   `Building Python modules on MS Windows platform with MinGW <http://www.zope.org/Members/als/tips/win32_mingw_modules>`_
+   `Building Python modules on MS Windows platform with MinGW <http://old.zope.org/Members/als/tips/win32_mingw_modules>`_
       Information about building the required libraries for the MinGW environment.
 
 
@@ -1093,7 +1093,7 @@
 .. [#] This also means you could replace all existing COFF-libraries with OMF-libraries
    of the same name.
 
-.. [#] Check http://sources.redhat.com/cygwin/ and http://www.mingw.org/ for more
+.. [#] Check http://www.sourceware.org/cygwin/ and http://www.mingw.org/ for more
    information
 
 .. [#] Then you have no POSIX emulation available, but you also don't need
diff --git a/Doc/installing/index.rst b/Doc/installing/index.rst
new file mode 100644
index 0000000..973c689
--- /dev/null
+++ b/Doc/installing/index.rst
@@ -0,0 +1,220 @@
+.. highlightlang:: none
+
+.. _installing-index:
+
+*****************************
+  Installing Python Modules
+*****************************
+
+:Email: distutils-sig@python.org
+
+As a popular open source development project, Python has an active
+supporting community of contributors and users that also make their software
+available for other Python developers to use under open source license terms.
+
+This allows Python users to share and collaborate effectively, benefiting
+from the solutions others have already created to common (and sometimes
+even rare!) problems, as well as potentially contributing their own
+solutions to the common pool.
+
+This guide covers the installation part of the process. For a guide to
+creating and sharing your own Python projects, refer to the
+:ref:`distribution guide <distributing-index>`.
+
+.. note::
+
+   For corporate and other institutional users, be aware that many
+   organisations have their own policies around using and contributing to
+   open source software. Please take such policies into account when making
+   use of the distribution and installation tools provided with Python.
+
+
+Key terms
+=========
+
+* ``pip`` is the preferred installer program. Starting with Python 3.4, it
+  is included by default with the Python binary installers.
+* a virtual environment is a semi-isolated Python environment that allows
+  packages to be installed for use by a particular application, rather than
+  being installed system wide
+* ``pyvenv`` is the standard tool for creating virtual environments, and has
+  been part of Python since Python 3.3. Starting with Python 3.4, it
+  defaults to installing ``pip`` into all created virtual environments
+* ``virtualenv`` is a third party alternative (and predecessor) to
+  ``pyvenv``. It allows virtual environments to be used on versions of
+  Python prior to 3.4, which either don't provide ``pyvenv`` at all, or
+  aren't able to automatically install ``pip`` into created environments.
+* the `Python Packaging Index <https://pypi.python.org/pypi>`__ is a public
+  repository of open source licensed packages made available for use by
+  other Python users
+* the `Python Packaging Authority
+  <https://packaging.python.org/en/latest/future.html>`__ are the group of
+  developers and documentation authors responsible for the maintenance and
+  evolution of the standard packaging tools and the associated metadata and
+  file format standards. They maintain a variety of tools, documentation
+  and issue trackers on both `GitHub <https://github.com/pypa>`__ and
+  `BitBucket <https://bitbucket.org/pypa/>`__.
+* ``distutils`` is the original build and distribution system first added to
+  the Python standard library in 1998. While direct use of ``distutils`` is
+  being phased out, it still laid the foundation for the current packaging
+  and distribution infrastructure, and it not only remains part of the
+  standard library, but its name lives on in other ways (such as the name
+  of the mailing list used to coordinate Python packaging standards
+  development).
+
+
+Basic usage
+===========
+
+The standard packaging tools are all designed to be used from the command
+line.
+
+The following command will install the latest version of a module and its
+dependencies from the Python Packaging Index::
+
+    python -m pip install SomePackage
+
+.. note::
+
+   For POSIX users (including Mac OS X and Linux users), the examples in
+   this guide assume the use of a :term:`virtual environment`.
+
+   For Windows users, the examples in this guide assume that the option to
+   adjust the system PATH environment variable was selected when installing
+   Python.
+
+It's also possible to specify an exact or minimum version directly on the
+command line::
+
+    python -m pip install SomePackage==1.0.4    # specific version
+    python -m pip install 'SomePackage>=1.0.4'  # minimum version
+
+Normally, if a suitable module is already installed, attempting to install
+it again will have no effect. Upgrading existing modules must be requested
+explicitly::
+
+    python -m pip install --upgrade SomePackage
+
+More information and resources regarding ``pip`` and its capabilities can be
+found in the `Python Packaging User Guide <https://packaging.python.org>`__.
+
+``pyvenv`` has its own documentation at :ref:`scripts-pyvenv`. Installing
+into an active virtual environment uses the commands shown above.
+
+.. seealso::
+
+    `Python Packaging User Guide: Installing Python Distribution Packages
+    <https://packaging.python.org/en/latest/installing.html#installing-python-distribution-packages>`__
+
+
+How do I ...?
+=============
+
+These are quick answers or links for some common tasks.
+
+... install ``pip`` in versions of Python prior to Python 3.4?
+--------------------------------------------------------------
+
+Python only started bundling ``pip`` with Python 3.4. For earlier versions,
+``pip`` needs to be "bootstrapped" as described in the Python Packaging
+User Guide.
+
+.. seealso::
+
+   `Python Packaging User Guide: Setup for Installing Distribution Packages
+   <https://packaging.python.org/en/latest/installing.html#setup-for-installing-distribution-packages>`__
+
+
+.. installing-per-user-installation:
+
+... install packages just for the current user?
+-----------------------------------------------
+
+Passing the ``--user`` option to ``python -m pip install`` will install a
+package just for the current user, rather than for all users of the system.
+
+
+... install scientific Python packages?
+---------------------------------------
+
+A number of scientific Python packages have complex binary dependencies, and
+aren't currently easy to install using ``pip`` directly. At this point in
+time, it will often be easier for users to install these packages by
+`other means
+<https://packaging.python.org/en/latest/science.html>`__
+rather than attempting to install them with ``pip``.
+
+.. seealso::
+
+   `Python Packaging User Guide: Installing Scientific Packages
+   <https://packaging.python.org/en/latest/science.html>`__
+
+
+... work with multiple versions of Python installed in parallel?
+----------------------------------------------------------------
+
+On Linux, Mac OS X and other POSIX systems, use the versioned Python commands
+in combination with the ``-m`` switch to run the appropriate copy of
+``pip``::
+
+   python2   -m pip install SomePackage  # default Python 2
+   python2.7 -m pip install SomePackage  # specifically Python 2.7
+   python3   -m pip install SomePackage  # default Python 3
+   python3.4 -m pip install SomePackage  # specifically Python 3.4
+
+(appropriately versioned ``pip`` commands may also be available)
+
+On Windows, use the ``py`` Python launcher in combination with the ``-m``
+switch::
+
+   py -2   -m pip install SomePackage  # default Python 2
+   py -2.7 -m pip install SomePackage  # specifically Python 2.7
+   py -3   -m pip install SomePackage  # default Python 3
+   py -3.4 -m pip install SomePackage  # specifically Python 3.4
+
+.. other questions:
+
+   Once the Development & Deployment part of PPUG is fleshed out, some of
+   those sections should be linked from new questions here (most notably,
+   we should have a question about avoiding depending on PyPI that links to
+   https://packaging.python.org/en/latest/deployment.html#pypi-mirrors-and-caches)
+
+
+Common installation issues
+==========================
+
+Installing into the system Python on Linux
+------------------------------------------
+
+On Linux systems, a Python installation will typically be included as part
+of the distribution. Installing into this Python installation requires
+root access to the system, and may interfere with the operation of the
+system package manager and other components of the system if a component
+is unexpectedly upgraded using ``pip``.
+
+On such systems, it is often better to use a virtual environment or a
+per-user installation when installing packages with ``pip``.
+
+
+Installing binary extensions
+----------------------------
+
+Python has typically relied heavily on source based distribution, with end
+users being expected to compile extension modules from source as part of
+the installation process.
+
+With the introduction of support for the binary ``wheel`` format, and the
+ability to publish wheels for at least Windows and Mac OS X through the
+Python Packaging Index, this problem is expected to diminish over time,
+as users are more regularly able to install pre-built extensions rather
+than needing to build them themselves.
+
+Some of the solutions for installing `scientific software
+<https://packaging.python.org/en/latest/science.html>`__
+that is not yet available as pre-built ``wheel`` files may also help with
+obtaining other binary extensions without needing to build them locally.
+
+.. seealso::
+
+   `Python Packaging User Guide: Binary Extensions
+   <https://packaging.python.org/en/latest/extensions.html>`__
diff --git a/Doc/library/2to3.rst b/Doc/library/2to3.rst
index 1e5f42d..6473861 100644
--- a/Doc/library/2to3.rst
+++ b/Doc/library/2to3.rst
@@ -142,6 +142,39 @@
    Removes usage of :func:`apply`.  For example ``apply(function, *args,
    **kwargs)`` is converted to ``function(*args, **kwargs)``.
 
+.. 2to3fixer:: asserts
+
+   Replaces deprecated :mod:`unittest` method names with the correct ones.
+
+   ================================  ==========================================
+   From                              To
+   ================================  ==========================================
+   ``failUnlessEqual(a, b)``         :meth:`assertEqual(a, b)
+                                     <unittest.TestCase.assertEqual>`
+   ``assertEquals(a, b)``            :meth:`assertEqual(a, b)
+                                     <unittest.TestCase.assertEqual>`
+   ``failIfEqual(a, b)``             :meth:`assertNotEqual(a, b)
+                                     <unittest.TestCase.assertNotEqual>`
+   ``assertNotEquals(a, b)``         :meth:`assertNotEqual(a, b)
+                                     <unittest.TestCase.assertNotEqual>`
+   ``failUnless(a)``                 :meth:`assertTrue(a)
+                                     <unittest.TestCase.assertTrue>`
+   ``assert_(a)``                    :meth:`assertTrue(a)
+                                     <unittest.TestCase.assertTrue>`
+   ``failIf(a)``                     :meth:`assertFalse(a)
+                                     <unittest.TestCase.assertFalse>`
+   ``failUnlessRaises(exc, cal)``    :meth:`assertRaises(exc, cal)
+                                     <unittest.TestCase.assertRaises>`
+   ``failUnlessAlmostEqual(a, b)``   :meth:`assertAlmostEqual(a, b)
+                                     <unittest.TestCase.assertAlmostEqual>`
+   ``assertAlmostEquals(a, b)``      :meth:`assertAlmostEqual(a, b)
+                                     <unittest.TestCase.assertAlmostEqual>`
+   ``failIfAlmostEqual(a, b)``       :meth:`assertNotAlmostEqual(a, b)
+                                     <unittest.TestCase.assertNotAlmostEqual>`
+   ``assertNotAlmostEquals(a, b)``   :meth:`assertNotAlmostEqual(a, b)
+                                     <unittest.TestCase.assertNotAlmostEqual>`
+   ================================  ==========================================
+
 .. 2to3fixer:: basestring
 
    Converts :class:`basestring` to :class:`str`.
@@ -342,6 +375,10 @@
 
    Handles the move of :func:`reduce` to :func:`functools.reduce`.
 
+.. 2to3fixer:: reload
+
+   Converts :func:`reload` to :func:`imp.reload`.
+
 .. 2to3fixer:: renames
 
    Changes :data:`sys.maxint` to :data:`sys.maxsize`.
@@ -355,7 +392,7 @@
    Replaces use of the :class:`set` constructor with set literals.  This fixer
    is optional.
 
-.. 2to3fixer:: standard_error
+.. 2to3fixer:: standarderror
 
    Renames :exc:`StandardError` to :exc:`Exception`.
 
diff --git a/Doc/library/__main__.rst b/Doc/library/__main__.rst
index a1d3c24..a46993d 100644
--- a/Doc/library/__main__.rst
+++ b/Doc/library/__main__.rst
@@ -5,13 +5,19 @@
 .. module:: __main__
    :synopsis: The environment where the top-level script is run.
 
+``'__main__'`` is the name of the scope in which top-level code executes.
+A module's __name__ is set equal to ``'__main__'`` when read from
+standard input, a script, or from an interactive prompt.
 
-This module represents the (otherwise anonymous) scope in which the
-interpreter's main program executes --- commands read either from standard
-input, from a script file, or from an interactive prompt.  It is this
-environment in which the idiomatic "conditional script" stanza causes a script
-to run::
+A module can discover whether or not it is running in the main scope by
+checking its own ``__name__``, which allows a common idiom for conditionally
+executing code in a module when it is run as a script or with ``python
+-m`` but not when it is imported::
 
    if __name__ == "__main__":
+       # execute only if run as a script
        main()
 
+For a package, the same effect can be achieved by including a
+``__main__.py`` module, the contents of which will be executed when the
+module is run with ``-m``.
diff --git a/Doc/library/_thread.rst b/Doc/library/_thread.rst
index 2e130c1..a787e2f 100644
--- a/Doc/library/_thread.rst
+++ b/Doc/library/_thread.rst
@@ -176,10 +176,6 @@
 * Calling :func:`sys.exit` or raising the :exc:`SystemExit` exception is
   equivalent to calling :func:`_thread.exit`.
 
-* Not all built-in functions that may block waiting for I/O allow other threads
-  to run.  (The most popular ones (:func:`time.sleep`, :meth:`io.FileIO.read`,
-  :func:`select.select`) work as expected.)
-
 * It is not possible to interrupt the :meth:`acquire` method on a lock --- the
   :exc:`KeyboardInterrupt` exception will happen after the lock has been acquired.
 
diff --git a/Doc/library/abc.rst b/Doc/library/abc.rst
index 9299124..7a73704 100644
--- a/Doc/library/abc.rst
+++ b/Doc/library/abc.rst
@@ -12,9 +12,9 @@
 --------------
 
 This module provides the infrastructure for defining :term:`abstract base
-classes <abstract base class>` (ABCs) in Python, as outlined in :pep:`3119`; see the PEP for why this
-was added to Python. (See also :pep:`3141` and the :mod:`numbers` module
-regarding a type hierarchy for numbers based on ABCs.)
+classes <abstract base class>` (ABCs) in Python, as outlined in :pep:`3119`;
+see the PEP for why this was added to Python. (See also :pep:`3141` and the
+:mod:`numbers` module regarding a type hierarchy for numbers based on ABCs.)
 
 The :mod:`collections` module has some concrete classes that derive from
 ABCs; these can, of course, be further derived. In addition the
@@ -23,7 +23,7 @@
 hashable or a mapping.
 
 
-This module provides the following class:
+This module provides the following classes:
 
 .. class:: ABCMeta
 
@@ -58,6 +58,10 @@
       .. versionchanged:: 3.3
          Returns the registered subclass, to allow usage as a class decorator.
 
+      .. versionchanged:: 3.4
+         To detect calls to :meth:`register`, you can use the
+         :func:`get_cache_token` function.
+
    You can also override this method in an abstract base class:
 
    .. method:: __subclasshook__(subclass)
@@ -127,6 +131,19 @@
    available as a method of ``Foo``, so it is provided separately.
 
 
+.. class:: ABC
+
+   A helper class that has :class:`ABCMeta` as its metaclass.  With this class,
+   an abstract base class can be created by simply deriving from :class:`ABC`,
+   avoiding sometimes confusing metaclass usage.
+
+   Note that the type of :class:`ABC` is still :class:`ABCMeta`, therefore
+   inheriting from :class:`ABC` requires the usual precautions regarding metaclass
+   usage, as multiple inheritance may lead to metaclass conflicts.
+
+   .. versionadded:: 3.4
+
+
 The :mod:`abc` module also provides the following decorators:
 
 .. decorator:: abstractmethod
@@ -295,6 +312,19 @@
        :func:`abstractmethod`, making this decorator redundant.
 
 
+The :mod:`abc` module also provides the following functions:
+
+.. function:: get_cache_token()
+
+   Returns the current abstract base class cache token.
+
+   The token is an opaque object (that supports equality testing) identifying
+   the current version of the abstract base class cache for virtual subclasses.
+   The token changes with every call to :meth:`ABCMeta.register` on any ABC.
+
+   .. versionadded:: 3.4
+
+
 .. rubric:: Footnotes
 
 .. [#] C++ programmers should note that Python's virtual base class
diff --git a/Doc/library/aifc.rst b/Doc/library/aifc.rst
index 8a3541b..6fbcf28 100644
--- a/Doc/library/aifc.rst
+++ b/Doc/library/aifc.rst
@@ -30,8 +30,8 @@
 sampled.  The number of channels indicate if the audio is mono, stereo, or
 quadro.  Each frame consists of one sample per channel.  The sample size is the
 size in bytes of each sample.  Thus a frame consists of
-*nchannels*\*\ *samplesize* bytes, and a second's worth of audio consists of
-*nchannels*\*\ *samplesize*\*\ *framerate* bytes.
+``nchannels * samplesize`` bytes, and a second's worth of audio consists of
+``nchannels * samplesize * framerate`` bytes.
 
 For example, CD quality audio has a sample size of two bytes (16 bits), uses two
 channels (stereo) and has a frame rate of 44,100 frames/second.  This gives a
@@ -51,6 +51,11 @@
    used for writing, the file object should be seekable, unless you know ahead of
    time how many samples you are going to write in total and use
    :meth:`writeframesraw` and :meth:`setnframes`.
+   The :func:`.open` function may be used in a :keyword:`with` statement.  When
+   the :keyword:`with` block completes, the :meth:`~aifc.close` method is called.
+
+   .. versionchanged:: 3.4
+      Support for the :keyword:`with` statement was added.
 
 Objects returned by :func:`.open` when a file is opened for reading have the
 following methods:
@@ -92,7 +97,9 @@
 
 .. method:: aifc.getparams()
 
-   Return a tuple consisting of all of the above values in the above order.
+   Returns a :func:`~collections.namedtuple` ``(nchannels, sampwidth,
+   framerate, nframes, comptype, compname)``, equivalent to output of the
+   :meth:`get\*` methods.
 
 
 .. method:: aifc.getmarkers()
@@ -218,12 +225,18 @@
    Write data to the output file.  This method can only be called after the audio
    file parameters have been set.
 
+   .. versionchanged:: 3.4
+      Any :term:`bytes-like object` is now accepted.
+
 
 .. method:: aifc.writeframesraw(data)
 
    Like :meth:`writeframes`, except that the header of the audio file is not
    updated.
 
+   .. versionchanged:: 3.4
+      Any :term:`bytes-like object` is now accepted.
+
 
 .. method:: aifc.close()
 
diff --git a/Doc/library/allos.rst b/Doc/library/allos.rst
index bf91717..f7105d8 100644
--- a/Doc/library/allos.rst
+++ b/Doc/library/allos.rst
@@ -16,7 +16,6 @@
    io.rst
    time.rst
    argparse.rst
-   optparse.rst
    getopt.rst
    logging.rst
    logging.config.rst
diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst
index dc9c27f..73f9480 100644
--- a/Doc/library/argparse.rst
+++ b/Doc/library/argparse.rst
@@ -968,9 +968,9 @@
 ``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
-writable file::
+factory FileType which takes the ``mode=``, ``bufsize=``, ``encoding=`` and
+``errors=`` arguments of the :func:`open` function.  For example,
+``FileType('w')`` can be used to create a writable file::
 
    >>> parser = argparse.ArgumentParser()
    >>> parser.add_argument('bar', type=argparse.FileType('w'))
@@ -1235,16 +1235,16 @@
 Action classes implement the Action API, a callable which returns a callable
 which processes arguments from the command-line. Any object which follows
 this API may be passed as the ``action`` parameter to
-:method:`add_argument`.
+:meth:`add_argument`.
 
-.. class:: Action(option_strings, dest, nargs=None, const=None, default=None,
-                  type=None, choices=None, required=False, help=None,
+.. class:: Action(option_strings, dest, nargs=None, const=None, default=None, \
+                  type=None, choices=None, required=False, help=None, \
                   metavar=None)
 
 Action objects are used by an ArgumentParser to represent the information
 needed to parse a single argument from one or more strings from the
 command line. The Action class must accept the two positional arguments
-plus any keyword arguments passed to :method:`ArgumentParser.add_argument`
+plus any keyword arguments passed to :meth:`ArgumentParser.add_argument`
 except for the ``action`` itself.
 
 Instances of Action (or return value of any callable to the ``action``
@@ -1521,12 +1521,15 @@
    * parser_class - class which will be used to create sub-parser instances, by
      default the class of the current parser (e.g. ArgumentParser)
 
-   * dest - name of the attribute under which sub-command name will be
+   * action_ - the basic type of action to be taken when this argument is
+     encountered at the command line
+
+   * dest_ - name of the attribute under which sub-command name will be
      stored; by default None and no value is stored
 
-   * help - help for sub-parser group in help output, by default None
+   * help_ - help for sub-parser group in help output, by default None
 
-   * metavar - string presenting available sub-commands in help; by default it
+   * metavar_ - string presenting available sub-commands in help; by default it
      is None and presents sub-commands in form {cmd1, cmd2, ..}
 
    Some example usage::
@@ -1682,17 +1685,19 @@
 FileType objects
 ^^^^^^^^^^^^^^^^
 
-.. class:: FileType(mode='r', bufsize=None)
+.. class:: FileType(mode='r', bufsize=-1, encoding=None, errors=None)
 
    The :class:`FileType` factory creates objects that can be passed to the type
    argument of :meth:`ArgumentParser.add_argument`.  Arguments that have
-   :class:`FileType` objects as their type will open command-line arguments as files
-   with the requested modes and buffer sizes::
+   :class:`FileType` objects as their type will open command-line arguments as
+   files with the requested modes, buffer sizes, encodings and error handling
+   (see the :func:`open` function for more details)::
 
       >>> parser = argparse.ArgumentParser()
-      >>> parser.add_argument('--output', type=argparse.FileType('wb', 0))
-      >>> parser.parse_args(['--output', 'out'])
-      Namespace(output=<_io.BufferedWriter name='out'>)
+      >>> parser.add_argument('--raw', type=argparse.FileType('wb', 0))
+      >>> parser.add_argument('out', type=argparse.FileType('w', encoding='UTF-8'))
+      >>> parser.parse_args(['--raw', 'raw.dat', 'file.txt'])
+      Namespace(out=<_io.TextIOWrapper name='file.txt' mode='w' encoding='UTF-8'>, raw=<_io.FileIO name='raw.dat' mode='wb'>)
 
    FileType objects understand the pseudo-argument ``'-'`` and automatically
    convert this into ``sys.stdin`` for readable :class:`FileType` objects and
@@ -1703,6 +1708,9 @@
       >>> parser.parse_args(['-'])
       Namespace(infile=<_io.TextIOWrapper name='<stdin>' encoding='UTF-8'>)
 
+   .. versionadded:: 3.4
+      The *encodings* and *errors* keyword arguments.
+
 
 Argument groups
 ^^^^^^^^^^^^^^^
@@ -1944,6 +1952,16 @@
 :mod:`optparse` had either been copy-pasted over or monkey-patched, it no
 longer seemed practical to try to maintain the backwards compatibility.
 
+The :mod:`argparse` module improves on the standard library :mod:`optparse`
+module in a number of ways including:
+
+* Handling positional arguments.
+* Supporting sub-commands.
+* Allowing alternative option prefixes like ``+`` and ``/``.
+* Handling zero-or-more and one-or-more style arguments.
+* Producing more informative usage messages.
+* Providing a much simpler interface for custom ``type`` and ``action``.
+
 A partial upgrade path from :mod:`optparse` to :mod:`argparse`:
 
 * Replace all :meth:`optparse.OptionParser.add_option` calls with
diff --git a/Doc/library/ast.rst b/Doc/library/ast.rst
index daf28de..1ee5110 100644
--- a/Doc/library/ast.rst
+++ b/Doc/library/ast.rst
@@ -115,13 +115,15 @@
 
 .. function:: literal_eval(node_or_string)
 
-   Safely evaluate an expression node or a string containing a Python
-   expression.  The string or node provided may only consist of the following
-   Python literal structures: strings, bytes, numbers, tuples, lists, dicts,
-   sets, booleans, and ``None``.
+   Safely evaluate an expression node or a string containing a Python literal or
+   container display.  The string or node provided may only consist of the
+   following Python literal structures: strings, bytes, numbers, tuples, lists,
+   dicts, sets, booleans, and ``None``.
 
-   This can be used for safely evaluating strings containing Python expressions
-   from untrusted sources without the need to parse the values oneself.
+   This can be used for safely evaluating strings containing Python values from
+   untrusted sources without the need to parse the values oneself.  It is not
+   capable of evaluating arbitrarily complex expressions, for example involving
+   operators or indexing.
 
    .. versionchanged:: 3.2
       Now allows bytes and set literals.
diff --git a/Doc/library/asynchat.rst b/Doc/library/asynchat.rst
index adbd3be..c6fa061 100644
--- a/Doc/library/asynchat.rst
+++ b/Doc/library/asynchat.rst
@@ -10,6 +10,11 @@
 
 --------------
 
+.. note::
+
+   This module exists for backwards compatibility only.  For new code we
+   recommend using :mod:`asyncio`.
+
 This module builds on the :mod:`asyncore` infrastructure, simplifying
 asynchronous clients and servers and making it easier to handle protocols
 whose elements are terminated by arbitrary strings, or are of variable length.
diff --git a/Doc/library/asyncio-dev.rst b/Doc/library/asyncio-dev.rst
new file mode 100644
index 0000000..ce1275b
--- /dev/null
+++ b/Doc/library/asyncio-dev.rst
@@ -0,0 +1,385 @@
+.. currentmodule:: asyncio
+
+.. _asyncio-dev:
+
+Develop with asyncio
+====================
+
+Asynchronous programming is different than classical "sequential" programming.
+This page lists common traps and explains how to avoid them.
+
+
+.. _asyncio-debug-mode:
+
+Debug mode of asyncio
+---------------------
+
+To enable the debug mode globally, set the environment variable
+:envvar:`PYTHONASYNCIODEBUG` to ``1``. To see debug traces, set the log level
+of the :ref:`asyncio logger <asyncio-logger>` to :py:data:`logging.DEBUG`.  The
+simplest configuration is::
+
+   import logging
+   # ...
+   logging.basicConfig(level=logging.DEBUG)
+
+Examples of effects of the debug mode:
+
+* Log :ref:`coroutines defined but never "yielded from"
+  <asyncio-coroutine-not-scheduled>`
+* :meth:`~BaseEventLoop.call_soon` and :meth:`~BaseEventLoop.call_at` methods
+  raise an exception if they are called from the wrong thread.
+* Log the execution time of the selector
+* Log callbacks taking more than 100 ms to be executed. The
+  :attr:`BaseEventLoop.slow_callback_duration` attribute is the minimum
+  duration in seconds of "slow" callbacks.
+
+.. seealso::
+
+   The :meth:`BaseEventLoop.set_debug` method and the :ref:`asyncio logger
+   <asyncio-logger>`.
+
+
+Cancellation
+------------
+
+Cancellation of tasks is not common in classic programming. In asynchronous
+programming, not only it is something common, but you have to prepare your
+code to handle it.
+
+Futures and tasks can be cancelled explicitly with their :meth:`Future.cancel`
+method. The :func:`wait_for` function cancels the waited task when the timeout
+occurs. There are many other cases where a task can be cancelled indirectly.
+
+Don't call :meth:`~Future.set_result` or :meth:`~Future.set_exception` method
+of :class:`Future` if the future is cancelled: it would fail with an exception.
+For example, write::
+
+    if not fut.cancelled():
+        fut.set_result('done')
+
+Don't schedule directly a call to the :meth:`~Future.set_result` or the
+:meth:`~Future.set_exception` method of a future with
+:meth:`BaseEventLoop.call_soon`: the future can be cancelled before its method
+is called.
+
+If you wait for a future, you should check early if the future was cancelled to
+avoid useless operations. Example::
+
+    @coroutine
+    def slow_operation(fut):
+        if fut.cancelled():
+            return
+        # ... slow computation ...
+        yield from fut
+        # ...
+
+The :func:`shield` function can also be used to ignore cancellation.
+
+
+.. _asyncio-multithreading:
+
+Concurrency and multithreading
+------------------------------
+
+An event loop runs in a thread and executes all callbacks and tasks in the same
+thread. While a task is running in the event loop, no other task is running in
+the same thread. But when the task uses ``yield from``, the task is suspended
+and the event loop executes the next task.
+
+To schedule a callback from a different thread, the
+:meth:`BaseEventLoop.call_soon_threadsafe` method should be used. Example to
+schedule a coroutine from a different thread::
+
+    loop.call_soon_threadsafe(asyncio.async, coro_func())
+
+Most asyncio objects are not thread safe. You should only worry if you access
+objects outside the event loop. For example, to cancel a future, don't call
+directly its :meth:`Future.cancel` method, but::
+
+    loop.call_soon_threadsafe(fut.cancel)
+
+To handle signals and to execute subprocesses, the event loop must be run in
+the main thread.
+
+The :meth:`BaseEventLoop.run_in_executor` method can be used with a thread pool
+executor to execute a callback in different thread to not block the thread of
+the event loop.
+
+.. seealso::
+
+   The :ref:`Synchronization primitives <asyncio-sync>` section describes ways
+   to synchronize tasks.
+
+   The :ref:`Subprocess and threads <asyncio-subprocess-threads>` section lists
+   asyncio limitations to run subprocesses from different threads.
+
+
+
+
+.. _asyncio-handle-blocking:
+
+Handle blocking functions correctly
+-----------------------------------
+
+Blocking functions should not be called directly. For example, if a function
+blocks for 1 second, other tasks are delayed by 1 second which can have an
+important impact on reactivity.
+
+For networking and subprocesses, the :mod:`asyncio` module provides high-level
+APIs like :ref:`protocols <asyncio-protocol>`.
+
+An executor can be used to run a task in a different thread or even in a
+different process, to not block the thread of the event loop. See the
+:meth:`BaseEventLoop.run_in_executor` method.
+
+.. seealso::
+
+   The :ref:`Delayed calls <asyncio-delayed-calls>` section details how the
+   event loop handles time.
+
+
+.. _asyncio-logger:
+
+Logging
+-------
+
+The :mod:`asyncio` module logs information with the :mod:`logging` module in
+the logger ``'asyncio'``.
+
+
+.. _asyncio-coroutine-not-scheduled:
+
+Detect coroutine objects never scheduled
+----------------------------------------
+
+When a coroutine function is called and its result is not passed to
+:func:`async` or to the :meth:`BaseEventLoop.create_task` method, the execution
+of the coroutine object will never be scheduled which is probably a bug.
+:ref:`Enable the debug mode of asyncio <asyncio-debug-mode>` to :ref:`log a
+warning <asyncio-logger>` to detect it.
+
+Example with the bug::
+
+    import asyncio
+
+    @asyncio.coroutine
+    def test():
+        print("never scheduled")
+
+    test()
+
+Output in debug mode::
+
+    Coroutine test() at test.py:3 was never yielded from
+    Coroutine object created at (most recent call last):
+      File "test.py", line 7, in <module>
+        test()
+
+The fix is to call the :func:`async` function or the
+:meth:`BaseEventLoop.create_task` method with the coroutine object.
+
+.. seealso::
+
+   :ref:`Pending task destroyed <asyncio-pending-task-destroyed>`.
+
+
+Detect exceptions never consumed
+--------------------------------
+
+Python usually calls :func:`sys.displayhook` on unhandled exceptions. If
+:meth:`Future.set_exception` is called, but the exception is never consumed,
+:func:`sys.displayhook` is not called. Instead, :ref:`a log is emitted
+<asyncio-logger>` when the future is deleted by the garbage collector, with the
+traceback where the exception was raised.
+
+Example of unhandled exception::
+
+    import asyncio
+
+    @asyncio.coroutine
+    def bug():
+        raise Exception("not consumed")
+
+    loop = asyncio.get_event_loop()
+    asyncio.async(bug())
+    loop.run_forever()
+
+Output::
+
+    Task exception was never retrieved
+    future: <Task finished coro=<coro() done, defined at asyncio/coroutines.py:139> exception=Exception('not consumed',)>
+    Traceback (most recent call last):
+      File "asyncio/tasks.py", line 237, in _step
+        result = next(coro)
+      File "asyncio/coroutines.py", line 141, in coro
+        res = func(*args, **kw)
+      File "test.py", line 5, in bug
+        raise Exception("not consumed")
+    Exception: not consumed
+
+:ref:`Enable the debug mode of asyncio <asyncio-debug-mode>` to get the
+traceback where the task was created. Output in debug mode::
+
+    Task exception was never retrieved
+    future: <Task finished coro=<bug() done, defined at test.py:3> exception=Exception('not consumed',) created at test.py:8>
+    source_traceback: Object created at (most recent call last):
+      File "test.py", line 8, in <module>
+        asyncio.async(bug())
+    Traceback (most recent call last):
+      File "asyncio/tasks.py", line 237, in _step
+        result = next(coro)
+      File "asyncio/coroutines.py", line 79, in __next__
+        return next(self.gen)
+      File "asyncio/coroutines.py", line 141, in coro
+        res = func(*args, **kw)
+      File "test.py", line 5, in bug
+        raise Exception("not consumed")
+    Exception: not consumed
+
+There are different options to fix this issue. The first option is to chain the
+coroutine in another coroutine and use classic try/except::
+
+    @asyncio.coroutine
+    def handle_exception():
+        try:
+            yield from bug()
+        except Exception:
+            print("exception consumed")
+
+    loop = asyncio.get_event_loop()
+    asyncio.async(handle_exception())
+    loop.run_forever()
+
+Another option is to use the :meth:`BaseEventLoop.run_until_complete`
+function::
+
+    task = asyncio.async(bug())
+    try:
+        loop.run_until_complete(task)
+    except Exception:
+        print("exception consumed")
+
+.. seealso::
+
+   The :meth:`Future.exception` method.
+
+
+Chain coroutines correctly
+--------------------------
+
+When a coroutine function calls other coroutine functions and tasks, they
+should be chained explicitly with ``yield from``. Otherwise, the execution is
+not guaranteed to be sequential.
+
+Example with different bugs using :func:`asyncio.sleep` to simulate slow
+operations::
+
+    import asyncio
+
+    @asyncio.coroutine
+    def create():
+        yield from asyncio.sleep(3.0)
+        print("(1) create file")
+
+    @asyncio.coroutine
+    def write():
+        yield from asyncio.sleep(1.0)
+        print("(2) write into file")
+
+    @asyncio.coroutine
+    def close():
+        print("(3) close file")
+
+    @asyncio.coroutine
+    def test():
+        asyncio.async(create())
+        asyncio.async(write())
+        asyncio.async(close())
+        yield from asyncio.sleep(2.0)
+        loop.stop()
+
+    loop = asyncio.get_event_loop()
+    asyncio.async(test())
+    loop.run_forever()
+    print("Pending tasks at exit: %s" % asyncio.Task.all_tasks(loop))
+    loop.close()
+
+Expected output::
+
+    (1) create file
+    (2) write into file
+    (3) close file
+    Pending tasks at exit: set()
+
+Actual output::
+
+    (3) close file
+    (2) write into file
+    Pending tasks at exit: {<Task pending create() at test.py:7 wait_for=<Future pending cb=[Task._wakeup()]>>}
+    Task was destroyed but it is pending!
+    task: <Task pending create() done at test.py:5 wait_for=<Future pending cb=[Task._wakeup()]>>
+
+The loop stopped before the ``create()`` finished, ``close()`` has been called
+before ``write()``, whereas coroutine functions were called in this order:
+``create()``, ``write()``, ``close()``.
+
+To fix the example, tasks must be marked with ``yield from``::
+
+    @asyncio.coroutine
+    def test():
+        yield from asyncio.async(create())
+        yield from asyncio.async(write())
+        yield from asyncio.async(close())
+        yield from asyncio.sleep(2.0)
+        loop.stop()
+
+Or without ``asyncio.async()``::
+
+    @asyncio.coroutine
+    def test():
+        yield from create()
+        yield from write()
+        yield from close()
+        yield from asyncio.sleep(2.0)
+        loop.stop()
+
+
+.. _asyncio-pending-task-destroyed:
+
+Pending task destroyed
+----------------------
+
+If a pending task is destroyed, the execution of its wrapped :ref:`coroutine
+<coroutine>` did not complete. It is probably a bug and so a warning is logged.
+
+Example of log::
+
+    Task was destroyed but it is pending!
+    task: <Task pending coro=<kill_me() done, defined at test.py:5> wait_for=<Future pending cb=[Task._wakeup()]>>
+
+:ref:`Enable the debug mode of asyncio <asyncio-debug-mode>` to get the
+traceback where the task was created. Example of log in debug mode::
+
+    Task was destroyed but it is pending!
+    source_traceback: Object created at (most recent call last):
+      File "test.py", line 15, in <module>
+        task = asyncio.async(coro, loop=loop)
+    task: <Task pending coro=<kill_me() done, defined at test.py:5> wait_for=<Future pending cb=[Task._wakeup()] created at test.py:7> created at test.py:15>
+
+
+.. seealso::
+
+   :ref:`Detect coroutine objects never scheduled <asyncio-coroutine-not-scheduled>`.
+
+
+Close transports
+----------------
+
+When a transport is no more needed, call its ``close()`` method to release
+resources.
+
+If a transport (or an event loop) is not closed explicitly, a
+:exc:`ResourceWarning` warning will be emitted in its destructor. The
+:exc:`ResourceWarning` warnings are hidden by default: use the ``-Wd`` command
+line option of Python to show them.
diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst
new file mode 100644
index 0000000..4f7fdfe
--- /dev/null
+++ b/Doc/library/asyncio-eventloop.rst
@@ -0,0 +1,830 @@
+.. currentmodule:: asyncio
+
+.. _asyncio-event-loop:
+
+Base Event Loop
+===============
+
+The event loop is the central execution device provided by :mod:`asyncio`.
+It provides multiple facilities, amongst which:
+
+* Registering, executing and cancelling delayed calls (timeouts).
+
+* Creating client and server :ref:`transports <asyncio-transport>` for various
+  kinds of communication.
+
+* Launching subprocesses and the associated :ref:`transports
+  <asyncio-transport>` for communication with an external program.
+
+* Delegating costly function calls to a pool of threads.
+
+.. class:: BaseEventLoop
+
+   Base class of event loops.
+
+Run an event loop
+-----------------
+
+.. method:: BaseEventLoop.run_forever()
+
+   Run until :meth:`stop` is called.
+
+.. method:: BaseEventLoop.run_until_complete(future)
+
+   Run until the :class:`Future` is done.
+
+   If the argument is a :ref:`coroutine object <coroutine>`, it is wrapped by
+   :func:`async`.
+
+   Return the Future's result, or raise its exception.
+
+.. method:: BaseEventLoop.is_running()
+
+   Returns running status of event loop.
+
+.. method:: BaseEventLoop.stop()
+
+   Stop running the event loop.
+
+   Every callback scheduled before :meth:`stop` is called will run.
+   Callbacks scheduled after :meth:`stop` is called will not run.
+   However, those callbacks will run if :meth:`run_forever` is called
+   again later.
+
+.. method:: BaseEventLoop.is_closed()
+
+   Returns ``True`` if the event loop was closed.
+
+   .. versionadded:: 3.4.2
+
+.. method:: BaseEventLoop.close()
+
+   Close the event loop. The loop must not be running.
+
+   This clears the queues and shuts down the executor, but does not wait for
+   the executor to finish.
+
+   This is idempotent and irreversible. No other methods should be called after
+   this one.
+
+.. _asyncio-pass-keywords:
+
+Calls
+-----
+
+Most :mod:`asyncio` functions don't accept keywords. If you want to pass
+keywords to your callback, use :func:`functools.partial`. For example,
+``loop.call_soon(functools.partial(print, "Hello", flush=True))`` will call
+``print("Hello", flush=True)``.
+
+.. note::
+   :func:`functools.partial` is better than ``lambda`` functions, because
+   :mod:`asyncio` can inspect :func:`functools.partial` object to display
+   parameters in debug mode, whereas ``lambda`` functions have a poor
+   representation.
+
+.. method:: BaseEventLoop.call_soon(callback, \*args)
+
+   Arrange for a callback to be called as soon as possible.  The callback is
+   called after :meth:`call_soon` returns, when control returns to the event
+   loop.
+
+   This operates as a FIFO queue, callbacks are called in the order in
+   which they are registered.  Each callback will be called exactly once.
+
+   Any positional arguments after the callback will be passed to the
+   callback when it is called.
+
+   An instance of :class:`asyncio.Handle` is returned.
+
+   :ref:`Use functools.partial to pass keywords to the callback
+   <asyncio-pass-keywords>`.
+
+.. method:: BaseEventLoop.call_soon_threadsafe(callback, \*args)
+
+   Like :meth:`call_soon`, but thread safe.
+
+
+.. _asyncio-delayed-calls:
+
+Delayed calls
+-------------
+
+The event loop has its own internal clock for computing timeouts.
+Which clock is used depends on the (platform-specific) event loop
+implementation; ideally it is a monotonic clock.  This will generally be
+a different clock than :func:`time.time`.
+
+.. note::
+
+   Timeouts (relative *delay* or absolute *when*) should not exceed one day.
+
+
+.. method:: BaseEventLoop.call_later(delay, callback, *args)
+
+   Arrange for the *callback* to be called after the given *delay*
+   seconds (either an int or float).
+
+   An instance of :class:`asyncio.Handle` is returned.
+
+   *callback* will be called exactly once per call to :meth:`call_later`.
+   If two callbacks are scheduled for exactly the same time, it is
+   undefined which will be called first.
+
+   The optional positional *args* will be passed to the callback when it
+   is called. If you want the callback to be called with some named
+   arguments, use a closure or :func:`functools.partial`.
+
+   :ref:`Use functools.partial to pass keywords to the callback
+   <asyncio-pass-keywords>`.
+
+.. method:: BaseEventLoop.call_at(when, callback, *args)
+
+   Arrange for the *callback* to be called at the given absolute timestamp
+   *when* (an int or float), using the same time reference as
+   :meth:`BaseEventLoop.time`.
+
+   This method's behavior is the same as :meth:`call_later`.
+
+   :ref:`Use functools.partial to pass keywords to the callback
+   <asyncio-pass-keywords>`.
+
+.. method:: BaseEventLoop.time()
+
+   Return the current time, as a :class:`float` value, according to the
+   event loop's internal clock.
+
+.. seealso::
+
+   The :func:`asyncio.sleep` function.
+
+
+Coroutines
+----------
+
+.. method:: BaseEventLoop.create_task(coro)
+
+   Schedule the execution of a :ref:`coroutine object <coroutine>`: wrap it in
+   a future. Return a :class:`Task` object.
+
+   Third-party event loops can use their own subclass of :class:`Task` for
+   interoperability. In this case, the result type is a subclass of
+   :class:`Task`.
+
+   This method was added in Python 3.4.2. Use the :func:`async` function to
+   support also older Python versions.
+
+   .. versionadded:: 3.4.2
+
+
+Creating connections
+--------------------
+
+.. method:: BaseEventLoop.create_connection(protocol_factory, host=None, port=None, \*, ssl=None, family=0, proto=0, flags=0, sock=None, local_addr=None, server_hostname=None)
+
+   Create a streaming transport connection to a given Internet *host* and
+   *port*: socket family :py:data:`~socket.AF_INET` or
+   :py:data:`~socket.AF_INET6` depending on *host* (or *family* if specified),
+   socket type :py:data:`~socket.SOCK_STREAM`.  *protocol_factory* must be a
+   callable returning a :ref:`protocol <asyncio-protocol>` instance.
+
+   This method is a :ref:`coroutine <coroutine>` which will try to
+   establish the connection in the background.  When successful, the
+   coroutine returns a ``(transport, protocol)`` pair.
+
+   The chronological synopsis of the underlying operation is as follows:
+
+   #. The connection is established, and a :ref:`transport <asyncio-transport>`
+      is created to represent it.
+
+   #. *protocol_factory* is called without arguments and must return a
+      :ref:`protocol <asyncio-protocol>` instance.
+
+   #. The protocol instance is tied to the transport, and its
+      :meth:`connection_made` method is called.
+
+   #. The coroutine returns successfully with the ``(transport, protocol)``
+      pair.
+
+   The created transport is an implementation-dependent bidirectional stream.
+
+   .. note::
+      *protocol_factory* can be any kind of callable, not necessarily
+      a class.  For example, if you want to use a pre-created
+      protocol instance, you can pass ``lambda: my_protocol``.
+
+   Options allowing to change how the connection is created:
+
+   * *ssl*: if given and not false, a SSL/TLS transport is created
+     (by default a plain TCP transport is created).  If *ssl* is
+     a :class:`ssl.SSLContext` object, this context is used to create
+     the transport; if *ssl* is :const:`True`, a context with some
+     unspecified default settings is used.
+
+     .. seealso:: :ref:`SSL/TLS security considerations <ssl-security>`
+
+   * *server_hostname*, is only for use together with *ssl*,
+     and sets or overrides the hostname that the target server's certificate
+     will be matched against.  By default the value of the *host* argument
+     is used.  If *host* is empty, there is no default and you must pass a
+     value for *server_hostname*.  If *server_hostname* is an empty
+     string, hostname matching is disabled (which is a serious security
+     risk, allowing for man-in-the-middle-attacks).
+
+   * *family*, *proto*, *flags* are the optional address family, protocol
+     and flags to be passed through to getaddrinfo() for *host* resolution.
+     If given, these should all be integers from the corresponding
+     :mod:`socket` module constants.
+
+   * *sock*, if given, should be an existing, already connected
+     :class:`socket.socket` object to be used by the transport.
+     If *sock* is given, none of *host*, *port*, *family*, *proto*, *flags*
+     and *local_addr* should be specified.
+
+   * *local_addr*, if given, is a ``(local_host, local_port)`` tuple used
+     to bind the socket to locally.  The *local_host* and *local_port*
+     are looked up using getaddrinfo(), similarly to *host* and *port*.
+
+   On Windows with :class:`ProactorEventLoop`, SSL/TLS is not supported.
+
+   .. seealso::
+
+      The :func:`open_connection` function can be used to get a pair of
+      (:class:`StreamReader`, :class:`StreamWriter`) instead of a protocol.
+
+
+.. method:: BaseEventLoop.create_datagram_endpoint(protocol_factory, local_addr=None, remote_addr=None, \*, family=0, proto=0, flags=0)
+
+   Create datagram connection: socket family :py:data:`~socket.AF_INET` or
+   :py:data:`~socket.AF_INET6` depending on *host* (or *family* if specified),
+   socket type :py:data:`~socket.SOCK_DGRAM`.
+
+   This method is a :ref:`coroutine <coroutine>` which will try to
+   establish the connection in the background.  When successful, the
+   coroutine returns a ``(transport, protocol)`` pair.
+
+   See the :meth:`BaseEventLoop.create_connection` method for parameters.
+
+   On Windows with :class:`ProactorEventLoop`, this method is not supported.
+
+   See :ref:`UDP echo client protocol <asyncio-udp-echo-client-protocol>` and
+   :ref:`UDP echo server protocol <asyncio-udp-echo-server-protocol>` examples.
+
+
+.. method:: BaseEventLoop.create_unix_connection(protocol_factory, path, \*, ssl=None, sock=None, server_hostname=None)
+
+   Create UNIX connection: socket family :py:data:`~socket.AF_UNIX`, socket
+   type :py:data:`~socket.SOCK_STREAM`. The :py:data:`~socket.AF_UNIX` socket
+   family is used to communicate between processes on the same machine
+   efficiently.
+
+   This method is a :ref:`coroutine <coroutine>` which will try to
+   establish the connection in the background.  When successful, the
+   coroutine returns a ``(transport, protocol)`` pair.
+
+   See the :meth:`BaseEventLoop.create_connection` method for parameters.
+
+   Availability: UNIX.
+
+
+Creating listening connections
+------------------------------
+
+.. method:: BaseEventLoop.create_server(protocol_factory, host=None, port=None, \*, family=socket.AF_UNSPEC, flags=socket.AI_PASSIVE, sock=None, backlog=100, ssl=None, reuse_address=None)
+
+   Create a TCP server (socket type :data:`~socket.SOCK_STREAM`) bound to
+   *host* and *port*.
+
+   Return a :class:`Server` object, its :attr:`~Server.sockets` attribute
+   contains created sockets. Use the :meth:`Server.close` method to stop the
+   server: close listening sockets.
+
+   Parameters:
+
+   * If *host* is an empty string or ``None``, all interfaces are assumed
+     and a list of multiple sockets will be returned (most likely
+     one for IPv4 and another one for IPv6).
+
+   * *family* can be set to either :data:`socket.AF_INET` or
+     :data:`~socket.AF_INET6` to force the socket to use IPv4 or IPv6. If not set
+     it will be determined from host (defaults to :data:`socket.AF_UNSPEC`).
+
+   * *flags* is a bitmask for :meth:`getaddrinfo`.
+
+   * *sock* can optionally be specified in order to use a preexisting
+     socket object. If specified, *host* and *port* should be omitted (must be
+     :const:`None`).
+
+   * *backlog* is the maximum number of queued connections passed to
+     :meth:`~socket.socket.listen` (defaults to 100).
+
+   * *ssl* can be set to an :class:`~ssl.SSLContext` to enable SSL over the
+     accepted connections.
+
+   * *reuse_address* tells the kernel to reuse a local socket in
+     TIME_WAIT state, without waiting for its natural timeout to
+     expire. If not specified will automatically be set to True on
+     UNIX.
+
+   This method is a :ref:`coroutine <coroutine>`.
+
+   On Windows with :class:`ProactorEventLoop`, SSL/TLS is not supported.
+
+   .. seealso::
+
+      The function :func:`start_server` creates a (:class:`StreamReader`,
+      :class:`StreamWriter`) pair and calls back a function with this pair.
+
+
+.. method:: BaseEventLoop.create_unix_server(protocol_factory, path=None, \*, sock=None, backlog=100, ssl=None)
+
+   Similar to :meth:`BaseEventLoop.create_server`, but specific to the
+   socket family :py:data:`~socket.AF_UNIX`.
+
+   Availability: UNIX.
+
+
+Watch file descriptors
+----------------------
+
+On Windows with :class:`SelectorEventLoop`, only socket handles are supported
+(ex: pipe file descriptors are not supported).
+
+On Windows with :class:`ProactorEventLoop`, these methods are not supported.
+
+.. method:: BaseEventLoop.add_reader(fd, callback, \*args)
+
+   Start watching the file descriptor for read availability and then call the
+   *callback* with specified arguments.
+
+   :ref:`Use functools.partial to pass keywords to the callback
+   <asyncio-pass-keywords>`.
+
+.. method:: BaseEventLoop.remove_reader(fd)
+
+   Stop watching the file descriptor for read availability.
+
+.. method:: BaseEventLoop.add_writer(fd, callback, \*args)
+
+   Start watching the file descriptor for write availability and then call the
+   *callback* with specified arguments.
+
+   :ref:`Use functools.partial to pass keywords to the callback
+   <asyncio-pass-keywords>`.
+
+.. method:: BaseEventLoop.remove_writer(fd)
+
+   Stop watching the file descriptor for write availability.
+
+The :ref:`watch a file descriptor for read events <asyncio-watch-read-event>`
+example uses the low-level :meth:`BaseEventLoop.add_reader` method to register
+the file descriptor of a socket.
+
+
+Low-level socket operations
+---------------------------
+
+.. method:: BaseEventLoop.sock_recv(sock, nbytes)
+
+   Receive data from the socket.  The return value is a bytes object
+   representing the data received.  The maximum amount of data to be received
+   at once is specified by *nbytes*.
+
+   With :class:`SelectorEventLoop` event loop, the socket *sock* must be
+   non-blocking.
+
+   This method is a :ref:`coroutine <coroutine>`.
+
+   .. seealso::
+
+      The :meth:`socket.socket.recv` method.
+
+.. method:: BaseEventLoop.sock_sendall(sock, data)
+
+   Send data to the socket.  The socket must be connected to a remote socket.
+   This method continues to send data from *data* until either all data has
+   been sent or an error occurs.  ``None`` is returned on success.  On error,
+   an exception is raised, and there is no way to determine how much data, if
+   any, was successfully processed by the receiving end of the connection.
+
+   With :class:`SelectorEventLoop` event loop, the socket *sock* must be
+   non-blocking.
+
+   This method is a :ref:`coroutine <coroutine>`.
+
+   .. seealso::
+
+      The :meth:`socket.socket.sendall` method.
+
+.. method:: BaseEventLoop.sock_connect(sock, address)
+
+   Connect to a remote socket at *address*.
+
+   The *address* must be already resolved to avoid the trap of hanging the
+   entire event loop when the address requires doing a DNS lookup.  For
+   example, it must be an IP address, not an hostname, for
+   :py:data:`~socket.AF_INET` and :py:data:`~socket.AF_INET6` address families.
+   Use :meth:`getaddrinfo` to resolve the hostname asynchronously.
+
+   With :class:`SelectorEventLoop` event loop, the socket *sock* must be
+   non-blocking.
+
+   This method is a :ref:`coroutine <coroutine>`.
+
+   .. seealso::
+
+      The :meth:`BaseEventLoop.create_connection` method, the
+      :func:`open_connection` function and the :meth:`socket.socket.connect`
+      method.
+
+
+.. method:: BaseEventLoop.sock_accept(sock)
+
+   Accept a connection. The socket must be bound to an address and listening
+   for connections. The return value is a pair ``(conn, address)`` where *conn*
+   is a *new* socket object usable to send and receive data on the connection,
+   and *address* is the address bound to the socket on the other end of the
+   connection.
+
+   The socket *sock* must be non-blocking.
+
+   This method is a :ref:`coroutine <coroutine>`.
+
+   .. seealso::
+
+      The :meth:`BaseEventLoop.create_server` method, the :func:`start_server`
+      function and the :meth:`socket.socket.accept` method.
+
+
+Resolve host name
+-----------------
+
+.. method:: BaseEventLoop.getaddrinfo(host, port, \*, family=0, type=0, proto=0, flags=0)
+
+   This method is a :ref:`coroutine <coroutine>`, similar to
+   :meth:`socket.getaddrinfo` function but non-blocking.
+
+.. method:: BaseEventLoop.getnameinfo(sockaddr, flags=0)
+
+   This method is a :ref:`coroutine <coroutine>`, similar to
+   :meth:`socket.getnameinfo` function but non-blocking.
+
+
+Connect pipes
+-------------
+
+On Windows with :class:`SelectorEventLoop`, these methods are not supported.
+Use :class:`ProactorEventLoop` to support pipes on Windows.
+
+.. method:: BaseEventLoop.connect_read_pipe(protocol_factory, pipe)
+
+   Register read pipe in eventloop.
+
+   *protocol_factory* should instantiate object with :class:`Protocol`
+   interface.  *pipe* is a :term:`file-like object <file object>`.
+   Return pair ``(transport, protocol)``, where *transport* supports the
+   :class:`ReadTransport` interface.
+
+   With :class:`SelectorEventLoop` event loop, the *pipe* is set to
+   non-blocking mode.
+
+   This method is a :ref:`coroutine <coroutine>`.
+
+.. method:: BaseEventLoop.connect_write_pipe(protocol_factory, pipe)
+
+   Register write pipe in eventloop.
+
+   *protocol_factory* should instantiate object with :class:`BaseProtocol`
+   interface. *pipe* is :term:`file-like object <file object>`.
+   Return pair ``(transport, protocol)``, where *transport* supports
+   :class:`WriteTransport` interface.
+
+   With :class:`SelectorEventLoop` event loop, the *pipe* is set to
+   non-blocking mode.
+
+   This method is a :ref:`coroutine <coroutine>`.
+
+.. seealso::
+
+   The :meth:`BaseEventLoop.subprocess_exec` and
+   :meth:`BaseEventLoop.subprocess_shell` methods.
+
+
+UNIX signals
+------------
+
+Availability: UNIX only.
+
+.. method:: BaseEventLoop.add_signal_handler(signum, callback, \*args)
+
+   Add a handler for a signal.
+
+   Raise :exc:`ValueError` if the signal number is invalid or uncatchable.
+   Raise :exc:`RuntimeError` if there is a problem setting up the handler.
+
+   :ref:`Use functools.partial to pass keywords to the callback
+   <asyncio-pass-keywords>`.
+
+.. method:: BaseEventLoop.remove_signal_handler(sig)
+
+   Remove a handler for a signal.
+
+   Return ``True`` if a signal handler was removed, ``False`` if not.
+
+.. seealso::
+
+   The :mod:`signal` module.
+
+
+Executor
+--------
+
+Call a function in an :class:`~concurrent.futures.Executor` (pool of threads or
+pool of processes). By default, an event loop uses a thread pool executor
+(:class:`~concurrent.futures.ThreadPoolExecutor`).
+
+.. method:: BaseEventLoop.run_in_executor(executor, callback, \*args)
+
+   Arrange for a callback to be called in the specified executor.
+
+   The *executor* argument should be an :class:`~concurrent.futures.Executor`
+   instance. The default executor is used if *executor* is ``None``.
+
+   :ref:`Use functools.partial to pass keywords to the callback
+   <asyncio-pass-keywords>`.
+
+   This method is a :ref:`coroutine <coroutine>`.
+
+.. method:: BaseEventLoop.set_default_executor(executor)
+
+   Set the default executor used by :meth:`run_in_executor`.
+
+
+Error Handling API
+------------------
+
+Allows to customize how exceptions are handled in the event loop.
+
+.. method:: BaseEventLoop.set_exception_handler(handler)
+
+   Set *handler* as the new event loop exception handler.
+
+   If *handler* is ``None``, the default exception handler will
+   be set.
+
+   If *handler* is a callable object, it should have a
+   matching signature to ``(loop, context)``, where ``loop``
+   will be a reference to the active event loop, ``context``
+   will be a ``dict`` object (see :meth:`call_exception_handler`
+   documentation for details about context).
+
+.. method:: BaseEventLoop.default_exception_handler(context)
+
+   Default exception handler.
+
+   This is called when an exception occurs and no exception
+   handler is set, and can be called by a custom exception
+   handler that wants to defer to the default behavior.
+
+   *context* parameter has the same meaning as in
+   :meth:`call_exception_handler`.
+
+.. method:: BaseEventLoop.call_exception_handler(context)
+
+   Call the current event loop exception handler.
+
+   *context* is a ``dict`` object containing the following keys
+   (new keys may be introduced later):
+
+   * 'message': Error message;
+   * 'exception' (optional): Exception object;
+   * 'future' (optional): :class:`asyncio.Future` instance;
+   * 'handle' (optional): :class:`asyncio.Handle` instance;
+   * 'protocol' (optional): :ref:`Protocol <asyncio-protocol>` instance;
+   * 'transport' (optional): :ref:`Transport <asyncio-transport>` instance;
+   * 'socket' (optional): :class:`socket.socket` instance.
+
+   .. note::
+
+       Note: this method should not be overloaded in subclassed
+       event loops.  For any custom exception handling, use
+       :meth:`set_exception_handler()` method.
+
+Debug mode
+----------
+
+.. method:: BaseEventLoop.get_debug()
+
+   Get the debug mode (:class:`bool`) of the event loop.
+
+   The default value is ``True`` if the environment variable
+   :envvar:`PYTHONASYNCIODEBUG` is set to a non-empty string, ``False``
+   otherwise.
+
+   .. versionadded:: 3.4.2
+
+.. method:: BaseEventLoop.set_debug(enabled: bool)
+
+   Set the debug mode of the event loop.
+
+   .. versionadded:: 3.4.2
+
+.. seealso::
+
+   The :ref:`debug mode of asyncio <asyncio-debug-mode>`.
+
+Server
+------
+
+.. class:: Server
+
+   Server listening on sockets.
+
+   Object created by the :meth:`BaseEventLoop.create_server` method and the
+   :func:`start_server` function. Don't instantiate the class directly.
+
+   .. method:: close()
+
+      Stop serving: close listening sockets and set the :attr:`sockets`
+      attribute to ``None``.
+
+      The sockets that represent existing incoming client connections are
+      leaved open.
+
+      The server is closed asynchonously, use the :meth:`wait_closed` coroutine
+      to wait until the server is closed.
+
+   .. method:: wait_closed()
+
+      Wait until the :meth:`close` method completes.
+
+      This method is a :ref:`coroutine <coroutine>`.
+
+   .. attribute:: sockets
+
+      List of :class:`socket.socket` objects the server is listening to, or
+      ``None`` if the server is closed.
+
+
+Handle
+------
+
+.. class:: Handle
+
+   A callback wrapper object returned by :func:`BaseEventLoop.call_soon`,
+   :func:`BaseEventLoop.call_soon_threadsafe`, :func:`BaseEventLoop.call_later`,
+   and :func:`BaseEventLoop.call_at`.
+
+   .. method:: cancel()
+
+      Cancel the call.
+
+
+Event loop examples
+-------------------
+
+.. _asyncio-hello-world-callback:
+
+Hello World with call_soon()
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Example using the :meth:`BaseEventLoop.call_soon` method to schedule a
+callback. The callback displays ``"Hello World"`` and then stops the event
+loop::
+
+    import asyncio
+
+    def hello_world(loop):
+        print('Hello World')
+        loop.stop()
+
+    loop = asyncio.get_event_loop()
+
+    # Schedule a call to hello_world()
+    loop.call_soon(hello_world, loop)
+
+    # Blocking call interrupted by loop.stop()
+    loop.run_forever()
+    loop.close()
+
+.. seealso::
+
+   The :ref:`Hello World coroutine <asyncio-hello-world-coroutine>` example
+   uses a :ref:`coroutine <coroutine>`.
+
+
+.. _asyncio-date-callback:
+
+Display the current date with call_later()
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Example of callback displaying the current date every second. The callback uses
+the :meth:`BaseEventLoop.call_later` method to reschedule itself during 5
+seconds, and then stops the event loop::
+
+    import asyncio
+    import datetime
+
+    def display_date(end_time, loop):
+        print(datetime.datetime.now())
+        if (loop.time() + 1.0) < end_time:
+            loop.call_later(1, display_date, end_time, loop)
+        else:
+            loop.stop()
+
+    loop = asyncio.get_event_loop()
+
+    # Schedule the first call to display_date()
+    end_time = loop.time() + 5.0
+    loop.call_soon(display_date, end_time, loop)
+
+    # Blocking call interrupted by loop.stop()
+    loop.run_forever()
+    loop.close()
+
+.. seealso::
+
+   The :ref:`coroutine displaying the current date
+   <asyncio-date-coroutine>` example uses a :ref:`coroutine
+   <coroutine>`.
+
+
+.. _asyncio-watch-read-event:
+
+Watch a file descriptor for read events
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Wait until a file descriptor received some data using the
+:meth:`BaseEventLoop.add_reader` method and then close the event loop::
+
+    import asyncio
+    try:
+        from socket import socketpair
+    except ImportError:
+        from asyncio.windows_utils import socketpair
+
+    # Create a pair of connected file descriptors
+    rsock, wsock = socketpair()
+    loop = asyncio.get_event_loop()
+
+    def reader():
+        data = rsock.recv(100)
+        print("Received:", data.decode())
+        # We are done: unregister the file descriptor
+        loop.remove_reader(rsock)
+        # Stop the event loop
+        loop.stop()
+
+    # Register the file descriptor for read event
+    loop.add_reader(rsock, reader)
+
+    # Simulate the reception of data from the network
+    loop.call_soon(wsock.send, 'abc'.encode())
+
+    # Run the event loop
+    loop.run_forever()
+
+    # We are done, close sockets and the event loop
+    rsock.close()
+    wsock.close()
+    loop.close()
+
+.. seealso::
+
+   The :ref:`register an open socket to wait for data using a protocol
+   <asyncio-register-socket>` example uses a low-level protocol created by the
+   :meth:`BaseEventLoop.create_connection` method.
+
+   The :ref:`register an open socket to wait for data using streams
+   <asyncio-register-socket-streams>` example uses high-level streams
+   created by the :func:`open_connection` function in a coroutine.
+
+
+Set signal handlers for SIGINT and SIGTERM
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Register handlers for signals :py:data:`SIGINT` and :py:data:`SIGTERM` using
+the :meth:`BaseEventLoop.add_signal_handler` method::
+
+    import asyncio
+    import functools
+    import os
+    import signal
+
+    def ask_exit(signame):
+        print("got signal %s: exit" % signame)
+        loop.stop()
+
+    loop = asyncio.get_event_loop()
+    for signame in ('SIGINT', 'SIGTERM'):
+        loop.add_signal_handler(getattr(signal, signame),
+                                functools.partial(ask_exit, signame))
+
+    print("Event loop running forever, press CTRL+c to interrupt.")
+    print("pid %s: send SIGINT or SIGTERM to exit." % os.getpid())
+    try:
+        loop.run_forever()
+    finally:
+        loop.close()
+
+This example only works on UNIX.
diff --git a/Doc/library/asyncio-eventloops.rst b/Doc/library/asyncio-eventloops.rst
new file mode 100644
index 0000000..afb8b9f
--- /dev/null
+++ b/Doc/library/asyncio-eventloops.rst
@@ -0,0 +1,199 @@
+.. currentmodule:: asyncio
+
+Event loops
+===========
+
+Event loop functions
+--------------------
+
+The following functions are convenient shortcuts to accessing the methods of the
+global policy. Note that this provides access to the default policy, unless an
+alternative policy was set by calling :func:`set_event_loop_policy` earlier in
+the execution of the process.
+
+.. function:: get_event_loop()
+
+   Equivalent to calling ``get_event_loop_policy().get_event_loop()``.
+
+.. function:: set_event_loop(loop)
+
+   Equivalent to calling ``get_event_loop_policy().set_event_loop(loop)``.
+
+.. function:: new_event_loop()
+
+   Equivalent to calling ``get_event_loop_policy().new_event_loop()``.
+
+
+.. _asyncio-event-loops:
+
+Available event loops
+---------------------
+
+asyncio currently provides two implementations of event loops:
+:class:`SelectorEventLoop` and :class:`ProactorEventLoop`.
+
+.. class:: SelectorEventLoop
+
+   Event loop based on the :mod:`selectors` module. Subclass of
+   :class:`BaseEventLoop`.
+
+   Use the most efficient selector available on the platform.
+
+   On Windows, only sockets are supported (ex: pipes are not supported):
+   see the `MSDN documentation of select
+   <http://msdn.microsoft.com/en-us/library/windows/desktop/ms740141%28v=vs.85%29.aspx>`_.
+
+.. class:: ProactorEventLoop
+
+   Proactor event loop for Windows using "I/O Completion Ports" aka IOCP.
+   Subclass of :class:`BaseEventLoop`.
+
+   Availability: Windows.
+
+   .. seealso::
+
+      `MSDN documentation on I/O Completion Ports
+      <http://msdn.microsoft.com/en-us/library/windows/desktop/aa365198%28v=vs.85%29.aspx>`_.
+
+Example to use a :class:`ProactorEventLoop` on Windows::
+
+    import asyncio, os
+
+    if os.name == 'nt':
+        loop = asyncio.ProactorEventLoop()
+        asyncio.set_event_loop(loop)
+
+.. _asyncio-platform-support:
+
+Platform support
+----------------
+
+The :mod:`asyncio` module has been designed to be portable, but each platform
+still has subtle differences and may not support all :mod:`asyncio` features.
+
+Windows
+^^^^^^^
+
+Common limits of Windows event loops:
+
+- :meth:`~BaseEventLoop.create_unix_connection` and
+  :meth:`~BaseEventLoop.create_unix_server` are not supported: the socket
+  family :data:`socket.AF_UNIX` is specific to UNIX
+- :meth:`~BaseEventLoop.add_signal_handler` and
+  :meth:`~BaseEventLoop.remove_signal_handler` are not supported
+- :meth:`EventLoopPolicy.set_child_watcher` is not supported.
+  :class:`ProactorEventLoop` supports subprocesses. It has only one
+  implementation to watch child processes, there is no need to configure it.
+
+:class:`SelectorEventLoop` specific limits:
+
+- :class:`~selectors.SelectSelector` is used which only supports sockets
+  and is limited to 512 sockets.
+- :meth:`~BaseEventLoop.add_reader` and :meth:`~BaseEventLoop.add_writer` only
+  accept file descriptors of sockets
+- Pipes are not supported
+  (ex: :meth:`~BaseEventLoop.connect_read_pipe`,
+  :meth:`~BaseEventLoop.connect_write_pipe`)
+- :ref:`Subprocesses <asyncio-subprocess>` are not supported
+  (ex: :meth:`~BaseEventLoop.subprocess_exec`,
+  :meth:`~BaseEventLoop.subprocess_shell`)
+
+:class:`ProactorEventLoop` specific limits:
+
+- SSL is not supported: :meth:`~BaseEventLoop.create_connection` and
+  :meth:`~BaseEventLoop.create_server` cannot be used with SSL for example
+- :meth:`~BaseEventLoop.create_datagram_endpoint` (UDP) is not supported
+- :meth:`~BaseEventLoop.add_reader` and :meth:`~BaseEventLoop.add_writer` are
+  not supported
+
+The resolution of the monotonic clock on Windows is usually around 15.6 msec.
+The best resolution is 0.5 msec. The resolution depends on the hardware
+(availability of `HPET
+<http://fr.wikipedia.org/wiki/High_Precision_Event_Timer>`_) and on the Windows
+configuration. See :ref:`asyncio delayed calls <asyncio-delayed-calls>`.
+
+
+Mac OS X
+^^^^^^^^
+
+Character devices like PTY are only well supported since Mavericks (Mac OS
+10.9). They are not supported at all on Mac OS 10.5 and older.
+
+On Mac OS 10.6, 10.7 and 10.8, the default event loop is
+:class:`SelectorEventLoop` which uses :class:`selectors.KqueueSelector`.
+:class:`selectors.KqueueSelector` does not support character devices on these
+versions.  The :class:`SelectorEventLoop` can be used with
+:class:`~selectors.SelectSelector` or :class:`~selectors.PollSelector` to
+support character devices on these versions of Mac OS X. Example::
+
+    import asyncio
+    import selectors
+
+    selector = selectors.SelectSelector()
+    loop = asyncio.SelectorEventLoop(selector)
+    asyncio.set_event_loop(loop)
+
+
+Event loop policies and the default policy
+------------------------------------------
+
+Event loop management is abstracted with a *policy* pattern, to provide maximal
+flexibility for custom platforms and frameworks. Throughout the execution of a
+process, a single global policy object manages the event loops available to the
+process based on the calling context. A policy is an object implementing the
+:class:`AbstractEventLoopPolicy` interface.
+
+For most users of :mod:`asyncio`, policies never have to be dealt with
+explicitly, since the default global policy is sufficient.
+
+The default policy defines context as the current thread, and manages an event
+loop per thread that interacts with :mod:`asyncio`. The module-level functions
+:func:`get_event_loop` and :func:`set_event_loop` provide convenient access to
+event loops managed by the default policy.
+
+
+Event loop policy interface
+---------------------------
+
+An event loop policy must implement the following interface:
+
+.. class:: AbstractEventLoopPolicy
+
+   Event loop policy.
+
+   .. method:: get_event_loop()
+
+      Get the event loop for the current context.
+
+      Returns an event loop object implementing the :class:`BaseEventLoop`
+      interface.
+
+      Raises an exception in case no event loop has been set for the current
+      context and the current policy does not specify to create one. It must
+      never return ``None``.
+
+   .. method:: set_event_loop(loop)
+
+      Set the event loop for the current context to *loop*.
+
+   .. method:: new_event_loop()
+
+      Create and return a new event loop object according to this policy's
+      rules.
+
+      If there's need to set this loop as the event loop for the current
+      context, :meth:`set_event_loop` must be called explicitly.
+
+
+Access to the global loop policy
+--------------------------------
+
+.. function:: get_event_loop_policy()
+
+   Get the current event loop policy.
+
+.. function:: set_event_loop_policy(policy)
+
+   Set the current event loop policy. If *policy* is ``None``, the default
+   policy is restored.
+
diff --git a/Doc/library/asyncio-protocol.rst b/Doc/library/asyncio-protocol.rst
new file mode 100644
index 0000000..b6fcc48
--- /dev/null
+++ b/Doc/library/asyncio-protocol.rst
@@ -0,0 +1,704 @@
+.. currentmodule:: asyncio
+
++++++++++++++++++++++++++++++++++++++++++
+Transports  and protocols (low-level API)
++++++++++++++++++++++++++++++++++++++++++
+
+.. _asyncio-transport:
+
+Transports
+==========
+
+Transports are classes provided by :mod:`asyncio` in order to abstract
+various kinds of communication channels.  You generally won't instantiate
+a transport yourself; instead, you will call a :class:`BaseEventLoop` method
+which will create the transport and try to initiate the underlying
+communication channel, calling you back when it succeeds.
+
+Once the communication channel is established, a transport is always
+paired with a :ref:`protocol <asyncio-protocol>` instance.  The protocol can
+then call the transport's methods for various purposes.
+
+:mod:`asyncio` currently implements transports for TCP, UDP, SSL, and
+subprocess pipes.  The methods available on a transport depend on
+the transport's kind.
+
+
+BaseTransport
+-------------
+
+.. class:: BaseTransport
+
+   Base class for transports.
+
+   .. method:: close(self)
+
+      Close the transport.  If the transport has a buffer for outgoing
+      data, buffered data will be flushed asynchronously.  No more data
+      will be received.  After all buffered data is flushed, the
+      protocol's :meth:`connection_lost` method will be called with
+      :const:`None` as its argument.
+
+
+   .. method:: get_extra_info(name, default=None)
+
+      Return optional transport information.  *name* is a string representing
+      the piece of transport-specific information to get, *default* is the
+      value to return if the information doesn't exist.
+
+      This method allows transport implementations to easily expose
+      channel-specific information.
+
+      * socket:
+
+        - ``'peername'``: the remote address to which the socket is connected,
+          result of :meth:`socket.socket.getpeername` (``None`` on error)
+        - ``'socket'``: :class:`socket.socket` instance
+        - ``'sockname'``: the socket's own address,
+          result of :meth:`socket.socket.getsockname`
+
+      * SSL socket:
+
+        - ``'compression'``: the compression algorithm being used as a string,
+          or ``None`` if the connection isn't compressed; result of
+          :meth:`ssl.SSLSocket.compression`
+        - ``'cipher'``: a three-value tuple containing the name of the cipher
+          being used, the version of the SSL protocol that defines its use, and
+          the number of secret bits being used; result of
+          :meth:`ssl.SSLSocket.cipher`
+        - ``'peercert'``: peer certificate; result of
+          :meth:`ssl.SSLSocket.getpeercert`
+        - ``'sslcontext'``: :class:`ssl.SSLContext` instance
+
+      * pipe:
+
+        - ``'pipe'``: pipe object
+
+      * subprocess:
+
+        - ``'subprocess'``: :class:`subprocess.Popen` instance
+
+
+ReadTransport
+-------------
+
+.. class:: ReadTransport
+
+   Interface for read-only transports.
+
+   .. method:: pause_reading()
+
+      Pause the receiving end of the transport.  No data will be passed to
+      the protocol's :meth:`data_received` method until :meth:`resume_reading`
+      is called.
+
+   .. method:: resume_reading()
+
+      Resume the receiving end.  The protocol's :meth:`data_received` method
+      will be called once again if some data is available for reading.
+
+
+WriteTransport
+--------------
+
+.. class:: WriteTransport
+
+   Interface for write-only transports.
+
+   .. method:: abort()
+
+      Close the transport immediately, without waiting for pending operations
+      to complete.  Buffered data will be lost.  No more data will be received.
+      The protocol's :meth:`connection_lost` method will eventually be
+      called with :const:`None` as its argument.
+
+   .. method:: can_write_eof()
+
+      Return :const:`True` if the transport supports :meth:`write_eof`,
+      :const:`False` if not.
+
+   .. method:: get_write_buffer_size()
+
+      Return the current size of the output buffer used by the transport.
+
+   .. method:: get_write_buffer_limits()
+
+      Get the *high*- and *low*-water limits for write flow control. Return a
+      tuple ``(low, high)`` where *low* and *high* are positive number of
+      bytes.
+
+      Use :meth:`set_write_buffer_limits` to set the limits.
+
+      .. versionadded:: 3.4.2
+
+   .. method:: set_write_buffer_limits(high=None, low=None)
+
+      Set the *high*- and *low*-water limits for write flow control.
+
+      These two values control when call the protocol's
+      :meth:`pause_writing` and :meth:`resume_writing` methods are called.
+      If specified, the low-water limit must be less than or equal to the
+      high-water limit.  Neither *high* nor *low* can be negative.
+
+      The defaults are implementation-specific.  If only the
+      high-water limit is given, the low-water limit defaults to a
+      implementation-specific value less than or equal to the
+      high-water limit.  Setting *high* to zero forces *low* to zero as
+      well, and causes :meth:`pause_writing` to be called whenever the
+      buffer becomes non-empty.  Setting *low* to zero causes
+      :meth:`resume_writing` to be called only once the buffer is empty.
+      Use of zero for either limit is generally sub-optimal as it
+      reduces opportunities for doing I/O and computation
+      concurrently.
+
+      Use :meth:`get_write_buffer_limits` to get the limits.
+
+   .. method:: write(data)
+
+      Write some *data* bytes to the transport.
+
+      This method does not block; it buffers the data and arranges for it
+      to be sent out asynchronously.
+
+   .. method:: writelines(list_of_data)
+
+      Write a list (or any iterable) of data bytes to the transport.
+      This is functionally equivalent to calling :meth:`write` on each
+      element yielded by the iterable, but may be implemented more efficiently.
+
+   .. method:: write_eof()
+
+      Close the write end of the transport after flushing buffered data.
+      Data may still be received.
+
+      This method can raise :exc:`NotImplementedError` if the transport
+      (e.g. SSL) doesn't support half-closes.
+
+
+DatagramTransport
+-----------------
+
+.. method:: DatagramTransport.sendto(data, addr=None)
+
+   Send the *data* bytes to the remote peer given by *addr* (a
+   transport-dependent target address).  If *addr* is :const:`None`, the
+   data is sent to the target address given on transport creation.
+
+   This method does not block; it buffers the data and arranges for it
+   to be sent out asynchronously.
+
+.. method:: DatagramTransport.abort()
+
+   Close the transport immediately, without waiting for pending operations
+   to complete.  Buffered data will be lost.  No more data will be received.
+   The protocol's :meth:`connection_lost` method will eventually be
+   called with :const:`None` as its argument.
+
+
+BaseSubprocessTransport
+-----------------------
+
+.. class:: BaseSubprocessTransport
+
+   .. method:: get_pid()
+
+      Return the subprocess process id as an integer.
+
+   .. method:: get_pipe_transport(fd)
+
+      Return the transport for the communication pipe corresponding to the
+      integer file descriptor *fd*:
+
+      * ``0``: readable streaming transport of the standard input (*stdin*),
+        or :const:`None` if the subprocess was not created with ``stdin=PIPE``
+      * ``1``: writable streaming transport of the standard output (*stdout*),
+        or :const:`None` if the subprocess was not created with ``stdout=PIPE``
+      * ``2``: writable streaming transport of the standard error (*stderr*),
+        or :const:`None` if the subprocess was not created with ``stderr=PIPE``
+      * other *fd*: :const:`None`
+
+   .. method:: get_returncode()
+
+      Return the subprocess returncode as an integer or :const:`None`
+      if it hasn't returned, similarly to the
+      :attr:`subprocess.Popen.returncode` attribute.
+
+   .. method:: kill(self)
+
+      Kill the subprocess, as in :meth:`subprocess.Popen.kill`
+
+      On POSIX systems, the function sends SIGKILL to the subprocess.
+      On Windows, this method is an alias for :meth:`terminate`.
+
+   .. method:: send_signal(signal)
+
+      Send the *signal* number to the subprocess, as in
+      :meth:`subprocess.Popen.send_signal`.
+
+   .. method:: terminate()
+
+      Ask the subprocess to stop, as in :meth:`subprocess.Popen.terminate`.
+      This method is an alias for the :meth:`close` method.
+
+      On POSIX systems, this method sends SIGTERM to the subprocess.
+      On Windows, the Windows API function TerminateProcess() is called to
+      stop the subprocess.
+
+   .. method:: close()
+
+      Ask the subprocess to stop by calling the :meth:`terminate` method if the
+      subprocess hasn't returned yet, and close transports of all pipes
+      (*stdin*, *stdout* and *stderr*).
+
+
+.. _asyncio-protocol:
+
+Protocols
+=========
+
+:mod:`asyncio` provides base classes that you can subclass to implement
+your network protocols.  Those classes are used in conjunction with
+:ref:`transports <asyncio-transport>` (see below): the protocol parses incoming
+data and asks for the writing of outgoing data, while the transport is
+responsible for the actual I/O and buffering.
+
+When subclassing a protocol class, it is recommended you override certain
+methods.  Those methods are callbacks: they will be called by the transport
+on certain events (for example when some data is received); you shouldn't
+call them yourself, unless you are implementing a transport.
+
+.. note::
+   All callbacks have default implementations, which are empty.  Therefore,
+   you only need to implement the callbacks for the events in which you
+   are interested.
+
+
+Protocol classes
+----------------
+
+.. class:: Protocol
+
+   The base class for implementing streaming protocols (for use with
+   e.g. TCP and SSL transports).
+
+.. class:: DatagramProtocol
+
+   The base class for implementing datagram protocols (for use with
+   e.g. UDP transports).
+
+.. class:: SubprocessProtocol
+
+   The base class for implementing protocols communicating with child
+   processes (through a set of unidirectional pipes).
+
+
+Connection callbacks
+--------------------
+
+These callbacks may be called on :class:`Protocol`, :class:`DatagramProtocol`
+and :class:`SubprocessProtocol` instances:
+
+.. method:: BaseProtocol.connection_made(transport)
+
+   Called when a connection is made.
+
+   The *transport* argument is the transport representing the
+   connection.  You are responsible for storing it somewhere
+   (e.g. as an attribute) if you need to.
+
+.. method:: BaseProtocol.connection_lost(exc)
+
+   Called when the connection is lost or closed.
+
+   The argument is either an exception object or :const:`None`.
+   The latter means a regular EOF is received, or the connection was
+   aborted or closed by this side of the connection.
+
+:meth:`~BaseProtocol.connection_made` and :meth:`~BaseProtocol.connection_lost`
+are called exactly once per successful connection.  All other callbacks will be
+called between those two methods, which allows for easier resource management
+in your protocol implementation.
+
+The following callbacks may be called only on :class:`SubprocessProtocol`
+instances:
+
+.. method:: SubprocessProtocol.pipe_data_received(fd, data)
+
+   Called when the child process writes data into its stdout or stderr pipe.
+   *fd* is the integer file descriptor of the pipe.  *data* is a non-empty
+   bytes object containing the data.
+
+.. method:: SubprocessProtocol.pipe_connection_lost(fd, exc)
+
+   Called when one of the pipes communicating with the child process
+   is closed.  *fd* is the integer file descriptor that was closed.
+
+.. method:: SubprocessProtocol.process_exited()
+
+   Called when the child process has exited.
+
+
+Streaming protocols
+-------------------
+
+The following callbacks are called on :class:`Protocol` instances:
+
+.. method:: Protocol.data_received(data)
+
+   Called when some data is received.  *data* is a non-empty bytes object
+   containing the incoming data.
+
+   .. note::
+      Whether the data is buffered, chunked or reassembled depends on
+      the transport.  In general, you shouldn't rely on specific semantics
+      and instead make your parsing generic and flexible enough.  However,
+      data is always received in the correct order.
+
+.. method:: Protocol.eof_received()
+
+   Calls when the other end signals it won't send any more data
+   (for example by calling :meth:`write_eof`, if the other end also uses
+   asyncio).
+
+   This method may return a false value (including None), in which case
+   the transport will close itself.  Conversely, if this method returns a
+   true value, closing the transport is up to the protocol.  Since the
+   default implementation returns None, it implicitly closes the connection.
+
+   .. note::
+      Some transports such as SSL don't support half-closed connections,
+      in which case returning true from this method will not prevent closing
+      the connection.
+
+:meth:`data_received` can be called an arbitrary number of times during
+a connection.  However, :meth:`eof_received` is called at most once
+and, if called, :meth:`data_received` won't be called after it.
+
+State machine:
+
+    start -> :meth:`~BaseProtocol.connection_made`
+    [-> :meth:`~Protocol.data_received` \*]
+    [-> :meth:`~Protocol.eof_received` ?]
+    -> :meth:`~BaseProtocol.connection_lost` -> end
+
+
+Datagram protocols
+------------------
+
+The following callbacks are called on :class:`DatagramProtocol` instances.
+
+.. method:: DatagramProtocol.datagram_received(data, addr)
+
+   Called when a datagram is received.  *data* is a bytes object containing
+   the incoming data.  *addr* is the address of the peer sending the data;
+   the exact format depends on the transport.
+
+.. method:: DatagramProtocol.error_received(exc)
+
+   Called when a previous send or receive operation raises an
+   :class:`OSError`.  *exc* is the :class:`OSError` instance.
+
+   This method is called in rare conditions, when the transport (e.g. UDP)
+   detects that a datagram couldn't be delivered to its recipient.
+   In many conditions though, undeliverable datagrams will be silently
+   dropped.
+
+
+Flow control callbacks
+----------------------
+
+These callbacks may be called on :class:`Protocol`,
+:class:`DatagramProtocol` and :class:`SubprocessProtocol` instances:
+
+.. method:: BaseProtocol.pause_writing()
+
+   Called when the transport's buffer goes over the high-water mark.
+
+.. method:: BaseProtocol.resume_writing()
+
+   Called when the transport's buffer drains below the low-water mark.
+
+
+:meth:`pause_writing` and :meth:`resume_writing` calls are paired --
+:meth:`pause_writing` is called once when the buffer goes strictly over
+the high-water mark (even if subsequent writes increases the buffer size
+even more), and eventually :meth:`resume_writing` is called once when the
+buffer size reaches the low-water mark.
+
+.. note::
+   If the buffer size equals the high-water mark,
+   :meth:`pause_writing` is not called -- it must go strictly over.
+   Conversely, :meth:`resume_writing` is called when the buffer size is
+   equal or lower than the low-water mark.  These end conditions
+   are important to ensure that things go as expected when either
+   mark is zero.
+
+.. note::
+   On BSD systems (OS X, FreeBSD, etc.) flow control is not supported
+   for :class:`DatagramProtocol`, because send failures caused by
+   writing too many packets cannot be detected easily.  The socket
+   always appears 'ready' and excess packets are dropped; an
+   :class:`OSError` with errno set to :const:`errno.ENOBUFS` may or
+   may not be raised; if it is raised, it will be reported to
+   :meth:`DatagramProtocol.error_received` but otherwise ignored.
+
+
+Coroutines and protocols
+------------------------
+
+Coroutines can be scheduled in a protocol method using :func:`async`, but there
+is no guarantee made about the execution order.  Protocols are not aware of
+coroutines created in protocol methods and so will not wait for them.
+
+To have a reliable execution order, use :ref:`stream objects <asyncio-streams>` in a
+coroutine with ``yield from``. For example, the :meth:`StreamWriter.drain`
+coroutine can be used to wait until the write buffer is flushed.
+
+
+Protocol examples
+=================
+
+.. _asyncio-tcp-echo-client-protocol:
+
+TCP echo client protocol
+------------------------
+
+TCP echo client  using the :meth:`BaseEventLoop.create_connection` method, send
+data and wait until the connection is closed::
+
+    import asyncio
+
+    class EchoClientProtocol(asyncio.Protocol):
+        def __init__(self, message, loop):
+            self.message = message
+            self.loop = loop
+
+        def connection_made(self, transport):
+            transport.write(self.message.encode())
+            print('Data sent: {!r}'.format(self.message))
+
+        def data_received(self, data):
+            print('Data received: {!r}'.format(data.decode()))
+
+        def connection_lost(self, exc):
+            print('The server closed the connection')
+            print('Stop the event lop')
+            self.loop.stop()
+
+    loop = asyncio.get_event_loop()
+    message = 'Hello World!'
+    coro = loop.create_connection(lambda: EchoClientProtocol(message, loop),
+                                  '127.0.0.1', 8888)
+    loop.run_until_complete(coro)
+    loop.run_forever()
+    loop.close()
+
+The event loop is running twice. The
+:meth:`~BaseEventLoop.run_until_complete` method is preferred in this short
+example to raise an exception if the server is not listening, instead of
+having to write a short coroutine to handle the exception and stop the
+running loop. At :meth:`~BaseEventLoop.run_until_complete` exit, the loop is
+no longer running, so there is no need to stop the loop in case of an error.
+
+.. seealso::
+
+   The :ref:`TCP echo client using streams <asyncio-tcp-echo-client-streams>`
+   example uses the :func:`asyncio.open_connection` function.
+
+
+.. _asyncio-tcp-echo-server-protocol:
+
+TCP echo server protocol
+------------------------
+
+TCP echo server using the :meth:`BaseEventLoop.create_server` method, send back
+received data and close the connection::
+
+    import asyncio
+
+    class EchoServerClientProtocol(asyncio.Protocol):
+        def connection_made(self, transport):
+            peername = transport.get_extra_info('peername')
+            print('Connection from {}'.format(peername))
+            self.transport = transport
+
+        def data_received(self, data):
+            message = data.decode()
+            print('Data received: {!r}'.format(message))
+
+            print('Send: {!r}'.format(message))
+            self.transport.write(data)
+
+            print('Close the client socket')
+            self.transport.close()
+
+    loop = asyncio.get_event_loop()
+    # Each client connection will create a new protocol instance
+    coro = loop.create_server(EchoServerClientProtocol, '127.0.0.1', 8888)
+    server = loop.run_until_complete(coro)
+
+    # Serve requests until CTRL+c is pressed
+    print('Serving on {}'.format(server.sockets[0].getsockname()))
+    try:
+        loop.run_forever()
+    except KeyboardInterrupt:
+        pass
+
+    # Close the server
+    server.close()
+    loop.run_until_complete(server.wait_closed())
+    loop.close()
+
+:meth:`Transport.close` can be called immediately after
+:meth:`WriteTransport.write` even if data are not sent yet on the socket: both
+methods are asynchronous. ``yield from`` is not needed because these transport
+methods are not coroutines.
+
+.. seealso::
+
+   The :ref:`TCP echo server using streams <asyncio-tcp-echo-server-streams>`
+   example uses the :func:`asyncio.start_server` function.
+
+
+.. _asyncio-udp-echo-client-protocol:
+
+UDP echo client protocol
+------------------------
+
+UDP echo client using the :meth:`BaseEventLoop.create_datagram_endpoint`
+method, send data and close the transport when we received the answer::
+
+    import asyncio
+
+    class EchoClientProtocol:
+        def __init__(self, message, loop):
+            self.message = message
+            self.loop = loop
+            self.transport = None
+
+        def connection_made(self, transport):
+            self.transport = transport
+            print('Send:', self.message)
+            self.transport.sendto(self.message.encode())
+
+        def datagram_received(self, data, addr):
+            print("Received:", data.decode())
+
+            print("Close the socket")
+            self.transport.close()
+
+        def error_received(self, exc):
+            print('Error received:', exc)
+
+        def connection_lost(self, exc):
+            print("Socket closed, stop the event loop")
+            loop = asyncio.get_event_loop()
+            loop.stop()
+
+    loop = asyncio.get_event_loop()
+    message = "Hello World!"
+    connect = loop.create_datagram_endpoint(
+        lambda: EchoClientProtocol(message, loop),
+        remote_addr=('127.0.0.1', 9999))
+    transport, protocol = loop.run_until_complete(connect)
+    loop.run_forever()
+    transport.close()
+    loop.close()
+
+
+.. _asyncio-udp-echo-server-protocol:
+
+UDP echo server protocol
+------------------------
+
+UDP echo server using the :meth:`BaseEventLoop.create_datagram_endpoint`
+method, send back received data::
+
+    import asyncio
+
+    class EchoServerProtocol:
+        def connection_made(self, transport):
+            self.transport = transport
+
+        def datagram_received(self, data, addr):
+            message = data.decode()
+            print('Received %r from %s' % (message, addr))
+            print('Send %r to %s' % (message, addr))
+            self.transport.sendto(data, addr)
+
+    loop = asyncio.get_event_loop()
+    print("Starting UDP server")
+    # One protocol instance will be created to serve all client requests
+    listen = loop.create_datagram_endpoint(
+        EchoServerProtocol, local_addr=('127.0.0.1', 9999))
+    transport, protocol = loop.run_until_complete(listen)
+
+    try:
+        loop.run_forever()
+    except KeyboardInterrupt:
+        pass
+
+    transport.close()
+    loop.close()
+
+
+.. _asyncio-register-socket:
+
+Register an open socket to wait for data using a protocol
+---------------------------------------------------------
+
+Wait until a socket receives data using the
+:meth:`BaseEventLoop.create_connection` method with a protocol, and then close
+the event loop ::
+
+    import asyncio
+    try:
+        from socket import socketpair
+    except ImportError:
+        from asyncio.windows_utils import socketpair
+
+    # Create a pair of connected sockets
+    rsock, wsock = socketpair()
+    loop = asyncio.get_event_loop()
+
+    class MyProtocol(asyncio.Protocol):
+        transport = None
+
+        def connection_made(self, transport):
+            self.transport = transport
+
+        def data_received(self, data):
+            print("Received:", data.decode())
+
+            # We are done: close the transport (it will call connection_lost())
+            self.transport.close()
+
+        def connection_lost(self, exc):
+            # The socket has been closed, stop the event loop
+            loop.stop()
+
+    # Register the socket to wait for data
+    connect_coro = loop.create_connection(MyProtocol, sock=rsock)
+    transport, protocol = loop.run_until_complete(connect_coro)
+
+    # Simulate the reception of data from the network
+    loop.call_soon(wsock.send, 'abc'.encode())
+
+    # Run the event loop
+    loop.run_forever()
+
+    # We are done, close sockets and the event loop
+    rsock.close()
+    wsock.close()
+    loop.close()
+
+.. seealso::
+
+   The :ref:`watch a file descriptor for read events
+   <asyncio-watch-read-event>` example uses the low-level
+   :meth:`BaseEventLoop.add_reader` method to register the file descriptor of a
+   socket.
+
+   The :ref:`register an open socket to wait for data using streams
+   <asyncio-register-socket-streams>` example uses high-level streams
+   created by the :func:`open_connection` function in a coroutine.
diff --git a/Doc/library/asyncio-stream.rst b/Doc/library/asyncio-stream.rst
new file mode 100644
index 0000000..3809d94
--- /dev/null
+++ b/Doc/library/asyncio-stream.rst
@@ -0,0 +1,424 @@
+.. currentmodule:: asyncio
+
+.. _asyncio-streams:
+
+++++++++++++++++++++++++
+Streams (high-level API)
+++++++++++++++++++++++++
+
+Stream functions
+================
+
+.. function:: open_connection(host=None, port=None, \*, loop=None, limit=None, **kwds)
+
+   A wrapper for :meth:`~BaseEventLoop.create_connection()` returning a (reader,
+   writer) pair.
+
+   The reader returned is a :class:`StreamReader` instance; the writer is
+   a :class:`StreamWriter` instance.
+
+   The arguments are all the usual arguments to
+   :meth:`BaseEventLoop.create_connection` except *protocol_factory*; most
+   common are positional host and port, with various optional keyword arguments
+   following.
+
+   Additional optional keyword arguments are *loop* (to set the event loop
+   instance to use) and *limit* (to set the buffer limit passed to the
+   :class:`StreamReader`).
+
+   (If you want to customize the :class:`StreamReader` and/or
+   :class:`StreamReaderProtocol` classes, just copy the code -- there's really
+   nothing special here except some convenience.)
+
+   This function is a :ref:`coroutine <coroutine>`.
+
+.. function:: start_server(client_connected_cb, host=None, port=None, \*, loop=None, limit=None, **kwds)
+
+   Start a socket server, with a callback for each client connected. The return
+   value is the same as :meth:`~BaseEventLoop.create_server()`.
+
+   The *client_connected_cb* parameter is called with two parameters:
+   *client_reader*, *client_writer*.  *client_reader* is a
+   :class:`StreamReader` object, while *client_writer* is a
+   :class:`StreamWriter` object.  The *client_connected_cb* parameter can
+   either be a plain callback function or a :ref:`coroutine function
+   <coroutine>`; if it is a coroutine function, it will be automatically
+   converted into a :class:`Task`.
+
+   The rest of the arguments are all the usual arguments to
+   :meth:`~BaseEventLoop.create_server()` except *protocol_factory*; most
+   common are positional *host* and *port*, with various optional keyword
+   arguments following.
+
+   Additional optional keyword arguments are *loop* (to set the event loop
+   instance to use) and *limit* (to set the buffer limit passed to the
+   :class:`StreamReader`).
+
+   This function is a :ref:`coroutine <coroutine>`.
+
+.. function:: open_unix_connection(path=None, \*, loop=None, limit=None, **kwds)
+
+   A wrapper for :meth:`~BaseEventLoop.create_unix_connection()` returning
+   a (reader, writer) pair.
+
+   See :func:`open_connection` for information about return value and other
+   details.
+
+   This function is a :ref:`coroutine <coroutine>`.
+
+   Availability: UNIX.
+
+.. function:: start_unix_server(client_connected_cb, path=None, \*, loop=None, limit=None, **kwds)
+
+   Start a UNIX Domain Socket server, with a callback for each client connected.
+
+   See :func:`start_server` for information about return value and other
+   details.
+
+   This function is a :ref:`coroutine <coroutine>`.
+
+   Availability: UNIX.
+
+
+StreamReader
+============
+
+.. class:: StreamReader(limit=None, loop=None)
+
+   .. method:: exception()
+
+      Get the exception.
+
+   .. method:: feed_eof()
+
+      Acknowledge the EOF.
+
+   .. method:: feed_data(data)
+
+      Feed *data* bytes in the internal buffer.  Any operations waiting
+      for the data will be resumed.
+
+   .. method:: set_exception(exc)
+
+      Set the exception.
+
+   .. method:: set_transport(transport)
+
+      Set the transport.
+
+   .. method:: read(n=-1)
+
+      Read up to *n* bytes.  If *n* is not provided, or set to ``-1``,
+      read until EOF and return all read bytes.
+
+      If the EOF was received and the internal buffer is empty,
+      return an empty ``bytes`` object.
+
+      This method is a :ref:`coroutine <coroutine>`.
+
+   .. method:: readline()
+
+      Read one line, where "line" is a sequence of bytes ending with ``\n``.
+
+      If EOF is received, and ``\n`` was not found, the method will
+      return the partial read bytes.
+
+      If the EOF was received and the internal buffer is empty,
+      return an empty ``bytes`` object.
+
+      This method is a :ref:`coroutine <coroutine>`.
+
+   .. method:: readexactly(n)
+
+      Read exactly *n* bytes. Raise an :exc:`IncompleteReadError` if the end of
+      the stream is reached before *n* can be read, the
+      :attr:`IncompleteReadError.partial` attribute of the exception contains
+      the partial read bytes.
+
+      This method is a :ref:`coroutine <coroutine>`.
+
+   .. method:: at_eof()
+
+      Return ``True`` if the buffer is empty and :meth:`feed_eof` was called.
+
+
+StreamWriter
+============
+
+.. class:: StreamWriter(transport, protocol, reader, loop)
+
+   Wraps a Transport.
+
+   This exposes :meth:`write`, :meth:`writelines`, :meth:`can_write_eof()`,
+   :meth:`write_eof`, :meth:`get_extra_info` and :meth:`close`.  It adds
+   :meth:`drain` which returns an optional :class:`Future` on which you can
+   wait for flow control.  It also adds a transport attribute which references
+   the :class:`Transport` directly.
+
+   .. attribute:: transport
+
+      Transport.
+
+   .. method:: can_write_eof()
+
+      Return :const:`True` if the transport supports :meth:`write_eof`,
+      :const:`False` if not. See :meth:`WriteTransport.can_write_eof`.
+
+   .. method:: close()
+
+      Close the transport: see :meth:`BaseTransport.close`.
+
+   .. method:: drain()
+
+      Let the write buffer of the underlying transport a chance to be flushed.
+
+      The intended use is to write::
+
+          w.write(data)
+          yield from w.drain()
+
+      When the size of the transport buffer reaches the high-water limit (the
+      protocol is paused), block until the size of the buffer is drained down
+      to the low-water limit and the protocol is resumed. When there is nothing
+      to wait for, the yield-from continues immediately.
+
+      Yielding from :meth:`drain` gives the opportunity for the loop to
+      schedule the write operation and flush the buffer. It should especially
+      be used when a possibly large amount of data is written to the transport,
+      and the coroutine does not yield-from between calls to :meth:`write`.
+
+      This method is a :ref:`coroutine <coroutine>`.
+
+   .. method:: get_extra_info(name, default=None)
+
+      Return optional transport information: see
+      :meth:`BaseTransport.get_extra_info`.
+
+   .. method:: write(data)
+
+      Write some *data* bytes to the transport: see
+      :meth:`WriteTransport.write`.
+
+   .. method:: writelines(data)
+
+      Write a list (or any iterable) of data bytes to the transport:
+      see :meth:`WriteTransport.writelines`.
+
+   .. method:: write_eof()
+
+      Close the write end of the transport after flushing buffered data:
+      see :meth:`WriteTransport.write_eof`.
+
+
+StreamReaderProtocol
+====================
+
+.. class:: StreamReaderProtocol(stream_reader, client_connected_cb=None, loop=None)
+
+    Trivial helper class to adapt between :class:`Protocol` and
+    :class:`StreamReader`. Sublclass of :class:`Protocol`.
+
+    *stream_reader* is a :class:`StreamReader` instance, *client_connected_cb*
+    is an optional function called with (stream_reader, stream_writer) when a
+    connection is made, *loop* is the event loop instance to use.
+
+    (This is a helper class instead of making :class:`StreamReader` itself a
+    :class:`Protocol` subclass, because the :class:`StreamReader` has other
+    potential uses, and to prevent the user of the :class:`StreamReader` to
+    accidentally call inappropriate methods of the protocol.)
+
+
+IncompleteReadError
+===================
+
+.. exception:: IncompleteReadError
+
+    Incomplete read error, subclass of :exc:`EOFError`.
+
+   .. attribute:: expected
+
+      Total number of expected bytes (:class:`int`).
+
+   .. attribute:: partial
+
+      Read bytes string before the end of stream was reached (:class:`bytes`).
+
+
+Stream examples
+===============
+
+.. _asyncio-tcp-echo-client-streams:
+
+TCP echo client using streams
+-----------------------------
+
+TCP echo client using the :func:`asyncio.open_connection` function::
+
+    import asyncio
+
+    @asyncio.coroutine
+    def tcp_echo_client(message, loop):
+        reader, writer = yield from asyncio.open_connection('127.0.0.1', 8888,
+                                                            loop=loop)
+
+        print('Send: %r' % message)
+        writer.write(message.encode())
+
+        data = yield from reader.read(100)
+        print('Received: %r' % data.decode())
+
+        print('Close the socket')
+        writer.close()
+
+    message = 'Hello World!'
+    loop = asyncio.get_event_loop()
+    loop.run_until_complete(tcp_echo_client(message, loop))
+    loop.close()
+
+.. seealso::
+
+   The :ref:`TCP echo client protocol <asyncio-tcp-echo-client-protocol>`
+   example uses the :meth:`BaseEventLoop.create_connection` method.
+
+
+.. _asyncio-tcp-echo-server-streams:
+
+TCP echo server using streams
+-----------------------------
+
+TCP echo server using the :func:`asyncio.start_server` function::
+
+    import asyncio
+
+    @asyncio.coroutine
+    def handle_echo(reader, writer):
+        data = yield from reader.read(100)
+        message = data.decode()
+        addr = writer.get_extra_info('peername')
+        print("Received %r from %r" % (message, addr))
+
+        print("Send: %r" % message)
+        writer.write(data)
+        yield from writer.drain()
+
+        print("Close the client socket")
+        writer.close()
+
+    loop = asyncio.get_event_loop()
+    coro = asyncio.start_server(handle_echo, '127.0.0.1', 8888, loop=loop)
+    server = loop.run_until_complete(coro)
+
+    # Serve requests until CTRL+c is pressed
+    print('Serving on {}'.format(server.sockets[0].getsockname()))
+    try:
+        loop.run_forever()
+    except KeyboardInterrupt:
+        pass
+
+    # Close the server
+    server.close()
+    loop.run_until_complete(server.wait_closed())
+    loop.close()
+
+.. seealso::
+
+   The :ref:`TCP echo server protocol <asyncio-tcp-echo-server-protocol>`
+   example uses the :meth:`BaseEventLoop.create_server` method.
+
+
+Get HTTP headers
+----------------
+
+Simple example querying HTTP headers of the URL passed on the command line::
+
+    import asyncio
+    import urllib.parse
+    import sys
+
+    @asyncio.coroutine
+    def print_http_headers(url):
+        url = urllib.parse.urlsplit(url)
+        if url.scheme == 'https':
+            connect = asyncio.open_connection(url.hostname, 443, ssl=True)
+        else:
+            connect = asyncio.open_connection(url.hostname, 80)
+        reader, writer = yield from connect
+        query = ('HEAD {path} HTTP/1.0\r\n'
+                 'Host: {hostname}\r\n'
+                 '\r\n').format(path=url.path or '/', hostname=url.hostname)
+        writer.write(query.encode('latin-1'))
+        while True:
+            line = yield from reader.readline()
+            if not line:
+                break
+            line = line.decode('latin1').rstrip()
+            if line:
+                print('HTTP header> %s' % line)
+
+        # Ignore the body, close the socket
+        writer.close()
+
+    url = sys.argv[1]
+    loop = asyncio.get_event_loop()
+    task = asyncio.async(print_http_headers(url))
+    loop.run_until_complete(task)
+    loop.close()
+
+Usage::
+
+    python example.py http://example.com/path/page.html
+
+or with HTTPS::
+
+    python example.py https://example.com/path/page.html
+
+.. _asyncio-register-socket-streams:
+
+Register an open socket to wait for data using streams
+------------------------------------------------------
+
+Coroutine waiting until a socket receives data using the
+:func:`open_connection` function::
+
+    import asyncio
+    try:
+        from socket import socketpair
+    except ImportError:
+        from asyncio.windows_utils import socketpair
+
+    @asyncio.coroutine
+    def wait_for_data(loop):
+        # Create a pair of connected sockets
+        rsock, wsock = socketpair()
+
+        # Register the open socket to wait for data
+        reader, writer = yield from asyncio.open_connection(sock=rsock, loop=loop)
+
+        # Simulate the reception of data from the network
+        loop.call_soon(wsock.send, 'abc'.encode())
+
+        # Wait for data
+        data = yield from reader.read(100)
+
+        # Got data, we are done: close the socket
+        print("Received:", data.decode())
+        writer.close()
+
+        # Close the second socket
+        wsock.close()
+
+    loop = asyncio.get_event_loop()
+    loop.run_until_complete(wait_for_data(loop))
+    loop.close()
+
+.. seealso::
+
+   The :ref:`register an open socket to wait for data using a protocol
+   <asyncio-register-socket>` example uses a low-level protocol created by the
+   :meth:`BaseEventLoop.create_connection` method.
+
+   The :ref:`watch a file descriptor for read events
+   <asyncio-watch-read-event>` example uses the low-level
+   :meth:`BaseEventLoop.add_reader` method to register the file descriptor of a
+   socket.
+
diff --git a/Doc/library/asyncio-subprocess.rst b/Doc/library/asyncio-subprocess.rst
new file mode 100644
index 0000000..570107e
--- /dev/null
+++ b/Doc/library/asyncio-subprocess.rst
@@ -0,0 +1,414 @@
+.. currentmodule:: asyncio
+
+.. _asyncio-subprocess:
+
+Subprocess
+==========
+
+Windows event loop
+------------------
+
+On Windows, the default event loop is :class:`SelectorEventLoop` which does not
+support subprocesses. :class:`ProactorEventLoop` should be used instead.
+Example to use it on Windows::
+
+    import asyncio, os
+
+    if os.name == 'nt':
+        loop = asyncio.ProactorEventLoop()
+        asyncio.set_event_loop(loop)
+
+.. seealso::
+
+   :ref:`Available event loops <asyncio-event-loops>` and :ref:`Platform
+   support <asyncio-platform-support>`.
+
+
+Create a subprocess: high-level API using Process
+-------------------------------------------------
+
+.. function:: create_subprocess_exec(\*args, stdin=None, stdout=None, stderr=None, loop=None, limit=None, \*\*kwds)
+
+   Create a subprocess.
+
+   The *limit* parameter sets the buffer limit passed to the
+   :class:`StreamReader`. See :meth:`BaseEventLoop.subprocess_exec` for other
+   parameters.
+
+   Return a :class:`~asyncio.subprocess.Process` instance.
+
+   This function is a :ref:`coroutine <coroutine>`.
+
+.. function:: create_subprocess_shell(cmd, stdin=None, stdout=None, stderr=None, loop=None, limit=None, \*\*kwds)
+
+   Run the shell command *cmd*.
+
+   The *limit* parameter sets the buffer limit passed to the
+   :class:`StreamReader`. See :meth:`BaseEventLoop.subprocess_shell` for other
+   parameters.
+
+   Return a :class:`~asyncio.subprocess.Process` instance.
+
+   It is the application's responsibility to ensure that all whitespace and
+   metacharacters are quoted appropriately to avoid `shell injection
+   <http://en.wikipedia.org/wiki/Shell_injection#Shell_injection>`_
+   vulnerabilities. The :func:`shlex.quote` function can be used to properly
+   escape whitespace and shell metacharacters in strings that are going to be
+   used to construct shell commands.
+
+   This function is a :ref:`coroutine <coroutine>`.
+
+Use the :meth:`BaseEventLoop.connect_read_pipe` and
+:meth:`BaseEventLoop.connect_write_pipe` methods to connect pipes.
+
+
+Create a subprocess: low-level API using subprocess.Popen
+---------------------------------------------------------
+
+Run subprocesses asynchronously using the :mod:`subprocess` module.
+
+.. method:: BaseEventLoop.subprocess_exec(protocol_factory, \*args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, \*\*kwargs)
+
+   Create a subprocess from one or more string arguments (character strings or
+   bytes strings encoded to the :ref:`filesystem encoding
+   <filesystem-encoding>`), where the first string
+   specifies the program to execute, and the remaining strings specify the
+   program's arguments. (Thus, together the string arguments form the
+   ``sys.argv`` value of the program, assuming it is a Python script.) This is
+   similar to the standard library :class:`subprocess.Popen` class called with
+   shell=False and the list of strings passed as the first argument;
+   however, where :class:`~subprocess.Popen` takes a single argument which is
+   list of strings, :func:`subprocess_exec` takes multiple string arguments.
+
+   The *protocol_factory* must instanciate a subclass of the
+   :class:`asyncio.SubprocessProtocol` class.
+
+   Other parameters:
+
+   * *stdin*: Either a file-like object representing the pipe to be connected
+     to the subprocess's standard input stream using
+     :meth:`~BaseEventLoop.connect_write_pipe`, or the constant
+     :const:`subprocess.PIPE` (the default). By default a new pipe will be
+     created and connected.
+
+   * *stdout*: Either a file-like object representing the pipe to be connected
+     to the subprocess's standard output stream using
+     :meth:`~BaseEventLoop.connect_read_pipe`, or the constant
+     :const:`subprocess.PIPE` (the default). By default a new pipe will be
+     created and connected.
+
+   * *stderr*: Either a file-like object representing the pipe to be connected
+     to the subprocess's standard error stream using
+     :meth:`~BaseEventLoop.connect_read_pipe`, or one of the constants
+     :const:`subprocess.PIPE` (the default) or :const:`subprocess.STDOUT`.
+     By default a new pipe will be created and connected. When
+     :const:`subprocess.STDOUT` is specified, the subprocess's standard error
+     stream will be connected to the same pipe as the standard output stream.
+
+   * All other keyword arguments are passed to :class:`subprocess.Popen`
+     without interpretation, except for *bufsize*, *universal_newlines* and
+     *shell*, which should not be specified at all.
+
+   Returns a pair of ``(transport, protocol)``, where *transport* is an
+   instance of :class:`BaseSubprocessTransport`.
+
+   This method is a :ref:`coroutine <coroutine>`.
+
+   See the constructor of the :class:`subprocess.Popen` class for parameters.
+
+.. method:: BaseEventLoop.subprocess_shell(protocol_factory, cmd, \*, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, \*\*kwargs)
+
+   Create a subprocess from *cmd*, which is a character string or a bytes
+   string encoded to the :ref:`filesystem encoding <filesystem-encoding>`,
+   using the platform's "shell" syntax. This is similar to the standard library
+   :class:`subprocess.Popen` class called with ``shell=True``.
+
+   The *protocol_factory* must instanciate a subclass of the
+   :class:`asyncio.SubprocessProtocol` class.
+
+   See :meth:`~BaseEventLoop.subprocess_exec` for more details about
+   the remaining arguments.
+
+   Returns a pair of ``(transport, protocol)``, where *transport* is an
+   instance of :class:`BaseSubprocessTransport`.
+
+   It is the application's responsibility to ensure that all whitespace and
+   metacharacters are quoted appropriately to avoid `shell injection
+   <http://en.wikipedia.org/wiki/Shell_injection#Shell_injection>`_
+   vulnerabilities. The :func:`shlex.quote` function can be used to properly
+   escape whitespace and shell metacharacters in strings that are going to be
+   used to construct shell commands.
+
+   This method is a :ref:`coroutine <coroutine>`.
+
+.. seealso::
+
+   The :meth:`BaseEventLoop.connect_read_pipe` and
+   :meth:`BaseEventLoop.connect_write_pipe` methods.
+
+
+Constants
+---------
+
+.. data:: asyncio.subprocess.PIPE
+
+   Special value that can be used as the *stdin*, *stdout* or *stderr* argument
+   to :func:`create_subprocess_shell` and :func:`create_subprocess_exec` and
+   indicates that a pipe to the standard stream should be opened.
+
+.. data:: asyncio.subprocess.STDOUT
+
+   Special value that can be used as the *stderr* argument to
+   :func:`create_subprocess_shell` and :func:`create_subprocess_exec` and
+   indicates that standard error should go into the same handle as standard
+   output.
+
+.. data:: asyncio.subprocess.DEVNULL
+
+   Special value that can be used as the *stdin*, *stdout* or *stderr* argument
+   to :func:`create_subprocess_shell` and :func:`create_subprocess_exec` and
+   indicates that the special file :data:`os.devnull` will be used.
+
+
+Process
+-------
+
+.. class:: asyncio.subprocess.Process
+
+   A subprocess created by the :func:`create_subprocess_exec` or the
+   :func:`create_subprocess_shell` function.
+
+   The API of the :class:`~asyncio.subprocess.Process` class was designed to be
+   closed the API of the :class:`subprocess.Popen` class, but they are some
+   differences:
+
+   * There is no explicit :meth:`~subprocess.Popen.poll` method
+   * The :meth:`~subprocess.Popen.communicate` and
+     :meth:`~subprocess.Popen.wait` methods don't take a *timeout* parameter:
+     use the :func:`wait_for` function
+   * The *universal_newlines* parameter is not supported (only bytes strings
+     are supported)
+   * The :meth:`~asyncio.subprocess.Process.wait` method of
+     the :class:`~asyncio.subprocess.Process` class is asynchronous whereas the
+     :meth:`~subprocess.Popen.wait` method of the :class:`~subprocess.Popen`
+     class is implemented as a busy loop.
+
+   .. method:: wait()
+
+      Wait for child process to terminate.  Set and return :attr:`returncode`
+      attribute.
+
+      This method is a :ref:`coroutine <coroutine>`.
+
+      .. note::
+
+         This will deadlock when using ``stdout=PIPE`` or ``stderr=PIPE`` and
+         the child process generates enough output to a pipe such that it
+         blocks waiting for the OS pipe buffer to accept more data. Use the
+         :meth:`communicate` method when using pipes to avoid that.
+
+   .. method:: communicate(input=None)
+
+      Interact with process: Send data to stdin.  Read data from stdout and
+      stderr, until end-of-file is reached.  Wait for process to terminate.
+      The optional *input* argument should be data to be sent to the child
+      process, or ``None``, if no data should be sent to the child.  The type
+      of *input* must be bytes.
+
+      :meth:`communicate` returns a tuple ``(stdout_data, stderr_data)``.
+
+      If a :exc:`BrokenPipeError` or :exc:`ConnectionResetError` exception is
+      raised when writing *input* into stdin, the exception is ignored. It
+      occurs when the process exits before all data are written into stdin.
+
+      Note that if you want to send data to the process's stdin, you need to
+      create the Process object with ``stdin=PIPE``.  Similarly, to get anything
+      other than ``None`` in the result tuple, you need to give ``stdout=PIPE``
+      and/or ``stderr=PIPE`` too.
+
+      This method is a :ref:`coroutine <coroutine>`.
+
+      .. note::
+
+         The data read is buffered in memory, so do not use this method if the
+         data size is large or unlimited.
+
+      .. versionchanged:: 3.4.2
+         The method now ignores :exc:`BrokenPipeError` and
+         :exc:`ConnectionResetError`.
+
+   .. method:: send_signal(signal)
+
+      Sends the signal *signal* to the child process.
+
+      .. note::
+
+         On Windows, :py:data:`SIGTERM` is an alias for :meth:`terminate`.
+         ``CTRL_C_EVENT`` and ``CTRL_BREAK_EVENT`` can be sent to processes
+         started with a *creationflags* parameter which includes
+         ``CREATE_NEW_PROCESS_GROUP``.
+
+   .. method:: terminate()
+
+      Stop the child. On Posix OSs the method sends :py:data:`signal.SIGTERM`
+      to the child. On Windows the Win32 API function
+      :c:func:`TerminateProcess` is called to stop the child.
+
+   .. method:: kill()
+
+      Kills the child. On Posix OSs the function sends :py:data:`SIGKILL` to
+      the child.  On Windows :meth:`kill` is an alias for :meth:`terminate`.
+
+   .. attribute:: stdin
+
+      Standard input stream (:class:`StreamWriter`), ``None`` if the process
+      was created with ``stdin=None``.
+
+   .. attribute:: stdout
+
+      Standard output stream (:class:`StreamReader`), ``None`` if the process
+      was created with ``stdout=None``.
+
+   .. attribute:: stderr
+
+      Standard error stream (:class:`StreamReader`), ``None`` if the process
+      was created with ``stderr=None``.
+
+   .. warning::
+
+      Use the :meth:`communicate` method rather than :attr:`.stdin.write
+      <stdin>`, :attr:`.stdout.read <stdout>` or :attr:`.stderr.read <stderr>`
+      to avoid deadlocks due to streams pausing reading or writing and blocking
+      the child process.
+
+   .. attribute:: pid
+
+      The identifier of the process.
+
+      Note that for processes created by the :func:`create_subprocess_shell`
+      function, this attribute is the process identifier of the spawned shell.
+
+   .. attribute:: returncode
+
+      Return code of the process when it exited.  A ``None`` value indicates
+      that the process has not terminated yet.
+
+      A negative value ``-N`` indicates that the child was terminated by signal
+      ``N`` (Unix only).
+
+
+.. _asyncio-subprocess-threads:
+
+Subprocess and threads
+======================
+
+asyncio supports running subprocesses from different threads, but there
+are limits:
+
+* An event loop must run in the main thread
+* The child watcher must be instantiated in the main thread, before executing
+  subprocesses from other threads. Call the :func:`get_child_watcher`
+  function in the main thread to instantiate the child watcher.
+
+.. seealso::
+
+   The :ref:`Concurrency and multithreading in asyncio
+   <asyncio-multithreading>` section.
+
+
+Subprocess examples
+===================
+
+Subprocess using transport and protocol
+---------------------------------------
+
+Example of a subprocess protocol using to get the output of a subprocess and to
+wait for the subprocess exit. The subprocess is created by the
+:meth:`BaseEventLoop.subprocess_exec` method::
+
+    import asyncio
+    import sys
+
+    class DateProtocol(asyncio.SubprocessProtocol):
+        def __init__(self, exit_future):
+            self.exit_future = exit_future
+            self.output = bytearray()
+
+        def pipe_data_received(self, fd, data):
+            self.output.extend(data)
+
+        def process_exited(self):
+            self.exit_future.set_result(True)
+
+    @asyncio.coroutine
+    def get_date(loop):
+        code = 'import datetime; print(datetime.datetime.now())'
+        exit_future = asyncio.Future(loop=loop)
+
+        # Create the subprocess controlled by the protocol DateProtocol,
+        # redirect the standard output into a pipe
+        create = loop.subprocess_exec(lambda: DateProtocol(exit_future),
+                                      sys.executable, '-c', code,
+                                      stdin=None, stderr=None)
+        transport, protocol = yield from create
+
+        # Wait for the subprocess exit using the process_exited() method
+        # of the protocol
+        yield from exit_future
+
+        # Close the stdout pipe
+        transport.close()
+
+        # Read the output which was collected by the pipe_data_received()
+        # method of the protocol
+        data = bytes(protocol.output)
+        return data.decode('ascii').rstrip()
+
+    if sys.platform == "win32":
+        loop = asyncio.ProactorEventLoop()
+        asyncio.set_event_loop(loop)
+    else:
+        loop = asyncio.get_event_loop()
+
+    date = loop.run_until_complete(get_date(loop))
+    print("Current date: %s" % date)
+    loop.close()
+
+
+Subprocess using streams
+------------------------
+
+Example using the :class:`~asyncio.subprocess.Process` class to control the
+subprocess and the :class:`StreamReader` class to read from the standard
+output.  The subprocess is created by the :func:`create_subprocess_exec`
+function::
+
+    import asyncio.subprocess
+    import sys
+
+    @asyncio.coroutine
+    def get_date():
+        code = 'import datetime; print(datetime.datetime.now())'
+
+        # Create the subprocess, redirect the standard output into a pipe
+        create = asyncio.create_subprocess_exec(sys.executable, '-c', code,
+                                                stdout=asyncio.subprocess.PIPE)
+        proc = yield from create
+
+        # Read one line of output
+        data = yield from proc.stdout.readline()
+        line = data.decode('ascii').rstrip()
+
+        # Wait for the subprocess exit
+        yield from proc.wait()
+        return line
+
+    if sys.platform == "win32":
+        loop = asyncio.ProactorEventLoop()
+        asyncio.set_event_loop(loop)
+    else:
+        loop = asyncio.get_event_loop()
+
+    date = loop.run_until_complete(get_date())
+    print("Current date: %s" % date)
+    loop.close()
diff --git a/Doc/library/asyncio-sync.rst b/Doc/library/asyncio-sync.rst
new file mode 100644
index 0000000..4cc9a96
--- /dev/null
+++ b/Doc/library/asyncio-sync.rst
@@ -0,0 +1,440 @@
+.. currentmodule:: asyncio
+.. _asyncio-sync:
+
+Synchronization primitives
+==========================
+
+Locks:
+
+* :class:`Lock`
+* :class:`Event`
+* :class:`Condition`
+* :class:`Semaphore`
+* :class:`BoundedSemaphore`
+
+Queues:
+
+* :class:`Queue`
+* :class:`PriorityQueue`
+* :class:`LifoQueue`
+* :class:`JoinableQueue`
+
+asyncio locks and queues API were designed to be close to classes of the
+:mod:`threading` module (:class:`~threading.Lock`, :class:`~threading.Event`,
+:class:`~threading.Condition`, :class:`~threading.Semaphore`,
+:class:`~threading.BoundedSemaphore`) and the :mod:`queue` module
+(:class:`~queue.Queue`, :class:`~queue.PriorityQueue`,
+:class:`~queue.LifoQueue`), but they have no *timeout* parameter. The
+:func:`asyncio.wait_for` function can be used to cancel a task after a timeout.
+
+Locks
+-----
+
+Lock
+^^^^
+
+.. class:: Lock(\*, loop=None)
+
+   Primitive lock objects.
+
+   A primitive lock is a synchronization primitive that is not owned by a
+   particular coroutine when locked.  A primitive lock is in one of two states,
+   'locked' or 'unlocked'.
+
+   It is created in the unlocked state.  It has two basic methods, :meth:`acquire`
+   and :meth:`release`.  When the state is unlocked, acquire() changes the state to
+   locked and returns immediately.  When the state is locked, acquire() blocks
+   until a call to release() in another coroutine changes it to unlocked, then
+   the acquire() call resets it to locked and returns.  The release() method
+   should only be called in the locked state; it changes the state to unlocked
+   and returns immediately.  If an attempt is made to release an unlocked lock,
+   a :exc:`RuntimeError` will be raised.
+
+   When more than one coroutine is blocked in acquire() waiting for the state
+   to turn to unlocked, only one coroutine proceeds when a release() call
+   resets the state to unlocked; first coroutine which is blocked in acquire()
+   is being processed.
+
+   :meth:`acquire` is a coroutine and should be called with ``yield from``.
+
+   Locks also support the context management protocol.  ``(yield from lock)``
+   should be used as context manager expression.
+
+   Usage::
+
+       lock = Lock()
+       ...
+       yield from lock
+       try:
+           ...
+       finally:
+           lock.release()
+
+   Context manager usage::
+
+       lock = Lock()
+       ...
+       with (yield from lock):
+            ...
+
+   Lock objects can be tested for locking state::
+
+       if not lock.locked():
+          yield from lock
+       else:
+          # lock is acquired
+           ...
+
+   .. method:: locked()
+
+      Return ``True`` if the lock is acquired.
+
+   .. method:: acquire()
+
+      Acquire a lock.
+
+      This method blocks until the lock is unlocked, then sets it to locked and
+      returns ``True``.
+
+      This method is a :ref:`coroutine <coroutine>`.
+
+   .. method:: release()
+
+      Release a lock.
+
+      When the lock is locked, reset it to unlocked, and return.  If any other
+      coroutines 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.
+
+
+Event
+^^^^^
+
+.. class:: Event(\*, loop=None)
+
+   An Event implementation, asynchronous equivalent to :class:`threading.Event`.
+
+   Class implementing event objects. An event manages a flag that can be set to
+   true with the :meth:`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.
+
+   .. method:: clear()
+
+      Reset the internal flag to false. Subsequently, coroutines calling
+      :meth:`wait` will block until :meth:`set` is called to set the internal
+      flag to true again.
+
+   .. method:: is_set()
+
+      Return ``True`` if and only if the internal flag is true.
+
+   .. method:: set()
+
+      Set the internal flag to true. All coroutines waiting for it to become
+      true are awakened. Coroutine that call :meth:`wait` once the flag is true
+      will not block at all.
+
+   .. method:: wait()
+
+      Block until the internal flag is true.
+
+      If the internal flag is true on entry, return ``True`` immediately.
+      Otherwise, block until another coroutine calls :meth:`set` to set the
+      flag to true, then return ``True``.
+
+      This method is a :ref:`coroutine <coroutine>`.
+
+
+Condition
+^^^^^^^^^
+
+.. class:: Condition(lock=None, \*, loop=None)
+
+   A Condition implementation, asynchronous equivalent to
+   :class:`threading.Condition`.
+
+   This class implements condition variable objects. A condition variable
+   allows one or more coroutines to wait until they are notified by another
+   coroutine.
+
+   If the *lock* argument is given and not ``None``, it must be a :class:`Lock`
+   object, and it is used as the underlying lock.  Otherwise,
+   a new :class:`Lock` object is created and used as the underlying lock.
+
+   .. method:: acquire()
+
+      Acquire the underlying lock.
+
+      This method blocks until the lock is unlocked, then sets it to locked and
+      returns ``True``.
+
+      This method is a :ref:`coroutine <coroutine>`.
+
+   .. method:: notify(n=1)
+
+      By default, wake up one coroutine waiting on this condition, if any.
+      If the calling coroutine has not acquired the lock when this method is
+      called, a :exc:`RuntimeError` is raised.
+
+      This method wakes up at most *n* of the coroutines waiting for the
+      condition variable; it is a no-op if no coroutines are waiting.
+
+      .. note::
+
+         An awakened coroutine does not actually return from its :meth:`wait`
+         call until it can reacquire the lock. Since :meth:`notify` does not
+         release the lock, its caller should.
+
+   .. method:: locked()
+
+      Return ``True`` if the underlying lock is acquired.
+
+   .. method:: notify_all()
+
+      Wake up all threads waiting on this condition. This method acts like
+      :meth:`notify`, but wakes up all waiting threads instead of one. If the
+      calling thread has not acquired the lock when this method is called, a
+      :exc:`RuntimeError` is raised.
+
+   .. method:: release()
+
+      Release the underlying lock.
+
+      When the lock is locked, reset it to unlocked, and return. If any other
+      coroutines 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.
+
+   .. method:: wait()
+
+      Wait until notified.
+
+      If the calling coroutine has not acquired the lock when this method is
+      called, a :exc:`RuntimeError` is raised.
+
+      This method releases the underlying lock, and then blocks until it is
+      awakened by a :meth:`notify` or :meth:`notify_all` call for the same
+      condition variable in another coroutine.  Once awakened, it re-acquires
+      the lock and returns ``True``.
+
+      This method is a :ref:`coroutine <coroutine>`.
+
+   .. method:: wait_for(predicate)
+
+      Wait until a predicate becomes true.
+
+      The predicate should be a callable which result will be interpreted as a
+      boolean value. The final predicate value is the return value.
+
+      This method is a :ref:`coroutine <coroutine>`.
+
+
+Semaphores
+----------
+
+Semaphore
+^^^^^^^^^
+
+.. class:: Semaphore(value=1, \*, loop=None)
+
+   A Semaphore implementation.
+
+   A semaphore manages an internal counter which is decremented by each
+   :meth:`acquire` call and incremented by each :meth:`release` call. The
+   counter can never go below zero; when :meth:`acquire` finds that it is zero,
+   it blocks, waiting until some other thread calls :meth:`release`.
+
+   Semaphores also support the context management protocol.
+
+   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.
+
+   .. method:: acquire()
+
+      Acquire a semaphore.
+
+      If the internal counter is larger than zero on entry, decrement it by one
+      and return ``True`` immediately.  If it is zero on entry, block, waiting
+      until some other coroutine has called :meth:`release` to make it larger
+      than ``0``, and then return ``True``.
+
+      This method is a :ref:`coroutine <coroutine>`.
+
+   .. method:: locked()
+
+      Returns ``True`` if semaphore can not be acquired immediately.
+
+   .. method:: release()
+
+      Release a semaphore, incrementing the internal counter by one. When it
+      was zero on entry and another coroutine is waiting for it to become
+      larger than zero again, wake up that coroutine.
+
+
+BoundedSemaphore
+^^^^^^^^^^^^^^^^
+
+.. class:: BoundedSemaphore(value=1, \*, loop=None)
+
+    A bounded semaphore implementation. Inherit from :class:`Semaphore`.
+
+    This raises :exc:`ValueError` in :meth:`~Semaphore.release` if it would
+    increase the value above the initial value.
+
+
+Queues
+------
+
+Queue
+^^^^^
+
+.. class:: Queue(maxsize=0, \*, loop=None)
+
+   A queue, useful for coordinating producer and consumer coroutines.
+
+   If *maxsize* is less than or equal to zero, the queue size is infinite. If
+   it is an integer greater than ``0``, then ``yield from put()`` will block
+   when the queue reaches *maxsize*, until an item is removed by :meth:`get`.
+
+   Unlike the standard library :mod:`queue`, you can reliably know this Queue's
+   size with :meth:`qsize`, since your single-threaded asyncio application won't
+   be interrupted between calling :meth:`qsize` and doing an operation on the
+   Queue.
+
+   .. method:: empty()
+
+      Return ``True`` if the queue is empty, ``False`` otherwise.
+
+   .. method:: full()
+
+      Return ``True`` if there are :attr:`maxsize` items in the queue.
+
+      .. note::
+
+         If the Queue was initialized with ``maxsize=0`` (the default), then
+         :meth:`full()` is never ``True``.
+
+   .. method:: get()
+
+      Remove and return an item from the queue. If queue is empty, wait until
+      an item is available.
+
+      This method is a :ref:`coroutine <coroutine>`.
+
+      .. seealso::
+
+         The :meth:`empty` method.
+
+   .. method:: get_nowait()
+
+      Remove and return an item from the queue.
+
+      Return an item if one is immediately available, else raise
+      :exc:`QueueEmpty`.
+
+   .. method:: put(item)
+
+      Put an item into the queue. If the queue is full, wait until a free slot
+      is available before adding item.
+
+      This method is a :ref:`coroutine <coroutine>`.
+
+      .. seealso::
+
+         The :meth:`full` method.
+
+   .. method:: put_nowait(item)
+
+      Put an item into the queue without blocking.
+
+      If no free slot is immediately available, raise :exc:`QueueFull`.
+
+   .. method:: qsize()
+
+      Number of items in the queue.
+
+   .. attribute:: maxsize
+
+      Number of items allowed in the queue.
+
+
+PriorityQueue
+^^^^^^^^^^^^^
+
+.. class:: PriorityQueue
+
+   A subclass of :class:`Queue`; retrieves entries in priority order (lowest
+   first).
+
+   Entries are typically tuples of the form: (priority number, data).
+
+
+LifoQueue
+^^^^^^^^^
+
+.. class:: LifoQueue
+
+    A subclass of :class:`Queue` that retrieves most recently added entries
+    first.
+
+
+JoinableQueue
+^^^^^^^^^^^^^
+
+.. class:: JoinableQueue
+
+   A subclass of :class:`Queue` with :meth:`task_done` and :meth:`join`
+   methods.
+
+   .. method:: join()
+
+      Block until all items in the queue have been gotten and processed.
+
+      The count of unfinished tasks goes up whenever an item is added to the
+      queue. The count goes down whenever a consumer thread calls
+      :meth:`task_done` to indicate that the item was retrieved and all work on
+      it is complete.  When the count of unfinished tasks drops to zero,
+      :meth:`join` unblocks.
+
+      This method is a :ref:`coroutine <coroutine>`.
+
+   .. method:: task_done()
+
+      Indicate that a formerly enqueued task is complete.
+
+      Used by queue consumers. For each :meth:`~Queue.get` used to fetch a task, a
+      subsequent call to :meth:`task_done` tells the queue that the processing
+      on the task is complete.
+
+      If a :meth:`join` is currently blocking, it will resume when all items
+      have been processed (meaning that a :meth:`task_done` call was received
+      for every item that had been :meth:`~Queue.put` into the queue).
+
+      Raises :exc:`ValueError` if called more times than there were items
+      placed in the queue.
+
+
+Exceptions
+^^^^^^^^^^
+
+.. exception:: QueueEmpty
+
+   Exception raised when non-blocking :meth:`~Queue.get` (or
+   :meth:`~Queue.get_nowait`) is called
+   on a :class:`Queue` object which is empty.
+
+
+.. exception:: QueueFull
+
+   Exception raised when non-blocking :meth:`~Queue.put` (or
+   :meth:`~Queue.put_nowait`) is called
+   on a :class:`Queue` object which is full.
diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst
new file mode 100644
index 0000000..3008c86
--- /dev/null
+++ b/Doc/library/asyncio-task.rst
@@ -0,0 +1,644 @@
+.. currentmodule:: asyncio
+
+Tasks and coroutines
+====================
+
+.. _coroutine:
+
+Coroutines
+----------
+
+A coroutine is a generator that follows certain conventions.  For
+documentation purposes, all coroutines should be decorated with
+``@asyncio.coroutine``, but this cannot be strictly enforced.
+
+Coroutines use the ``yield from`` syntax introduced in :pep:`380`,
+instead of the original ``yield`` syntax.
+
+The word "coroutine", like the word "generator", is used for two
+different (though related) concepts:
+
+- The function that defines a coroutine (a function definition
+  decorated with ``@asyncio.coroutine``).  If disambiguation is needed
+  we will call this a *coroutine function* (:func:`iscoroutinefunction`
+  returns ``True``).
+
+- The object obtained by calling a coroutine function.  This object
+  represents a computation or an I/O operation (usually a combination)
+  that will complete eventually.  If disambiguation is needed we will
+  call it a *coroutine object* (:func:`iscoroutine` returns ``True``).
+
+Things a coroutine can do:
+
+- ``result = yield from future`` -- suspends the coroutine until the
+  future is done, then returns the future's result, or raises an
+  exception, which will be propagated.  (If the future is cancelled,
+  it will raise a ``CancelledError`` exception.)  Note that tasks are
+  futures, and everything said about futures also applies to tasks.
+
+- ``result = yield from coroutine`` -- wait for another coroutine to
+  produce a result (or raise an exception, which will be propagated).
+  The ``coroutine`` expression must be a *call* to another coroutine.
+
+- ``return expression`` -- produce a result to the coroutine that is
+  waiting for this one using ``yield from``.
+
+- ``raise exception`` -- raise an exception in the coroutine that is
+  waiting for this one using ``yield from``.
+
+Calling a coroutine does not start its code running -- it is just a
+generator, and the coroutine object returned by the call is really a
+generator object, which doesn't do anything until you iterate over it.
+In the case of a coroutine object, there are two basic ways to start
+it running: call ``yield from coroutine`` from another coroutine
+(assuming the other coroutine is already running!), or schedule its execution
+using the :func:`async` function or the :meth:`BaseEventLoop.create_task`
+method.
+
+
+Coroutines (and tasks) can only run when the event loop is running.
+
+.. decorator:: coroutine
+
+    Decorator to mark coroutines.
+
+    If the coroutine is not yielded from before it is destroyed, an error
+    message is logged. See :ref:`Detect coroutines never scheduled
+    <asyncio-coroutine-not-scheduled>`.
+
+.. note::
+
+    In this documentation, some methods are documented as coroutines,
+    even if they are plain Python functions returning a :class:`Future`.
+    This is intentional to have a freedom of tweaking the implementation
+    of these functions in the future. If such a function is needed to be
+    used in a callback-style code, wrap its result with :func:`async`.
+
+
+.. _asyncio-hello-world-coroutine:
+
+Example: Hello World coroutine
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Example of coroutine displaying ``"Hello World"``::
+
+    import asyncio
+
+    @asyncio.coroutine
+    def hello_world():
+        print("Hello World!")
+
+    loop = asyncio.get_event_loop()
+    # Blocking call which returns when the hello_world() coroutine is done
+    loop.run_until_complete(hello_world())
+    loop.close()
+
+.. seealso::
+
+   The :ref:`Hello World with call_soon() <asyncio-hello-world-callback>`
+   example uses the :meth:`BaseEventLoop.call_soon` method to schedule a
+   callback.
+
+
+.. _asyncio-date-coroutine:
+
+Example: Coroutine displaying the current date
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Example of coroutine displaying the current date every second during 5 seconds
+using the :meth:`sleep` function::
+
+    import asyncio
+    import datetime
+
+    @asyncio.coroutine
+    def display_date(loop):
+        end_time = loop.time() + 5.0
+        while True:
+            print(datetime.datetime.now())
+            if (loop.time() + 1.0) >= end_time:
+                break
+            yield from asyncio.sleep(1)
+
+    loop = asyncio.get_event_loop()
+    # Blocking call which returns when the display_date() coroutine is done
+    loop.run_until_complete(display_date(loop))
+    loop.close()
+
+.. seealso::
+
+   The :ref:`display the current date with call_later()
+   <asyncio-date-callback>` example uses a callback with the
+   :meth:`BaseEventLoop.call_later` method.
+
+
+Example: Chain coroutines
+^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Example chaining coroutines::
+
+    import asyncio
+
+    @asyncio.coroutine
+    def compute(x, y):
+        print("Compute %s + %s ..." % (x, y))
+        yield from asyncio.sleep(1.0)
+        return x + y
+
+    @asyncio.coroutine
+    def print_sum(x, y):
+        result = yield from compute(x, y)
+        print("%s + %s = %s" % (x, y, result))
+
+    loop = asyncio.get_event_loop()
+    loop.run_until_complete(print_sum(1, 2))
+    loop.close()
+
+``compute()`` is chained to ``print_sum()``: ``print_sum()`` coroutine waits
+until ``compute()`` is completed before returning its result.
+
+Sequence diagram of the example:
+
+.. image:: tulip_coro.png
+   :align: center
+
+The "Task" is created by the :meth:`BaseEventLoop.run_until_complete` method
+when it gets a coroutine object instead of a task.
+
+The diagram shows the control flow, it does not describe exactly how things
+work internally. For example, the sleep coroutine creates an internal future
+which uses :meth:`BaseEventLoop.call_later` to wake up the task in 1 second.
+
+
+InvalidStateError
+-----------------
+
+.. exception:: InvalidStateError
+
+   The operation is not allowed in this state.
+
+
+TimeoutError
+------------
+
+.. exception:: TimeoutError
+
+   The operation exceeded the given deadline.
+
+.. note::
+
+   This exception is different from the builtin :exc:`TimeoutError` exception!
+
+
+Future
+------
+
+.. class:: Future(\*, loop=None)
+
+   This class is *almost* compatible with :class:`concurrent.futures.Future`.
+
+   Differences:
+
+   - :meth:`result` and :meth:`exception` do not take a timeout argument and
+     raise an exception when the future isn't done yet.
+
+   - Callbacks registered with :meth:`add_done_callback` are always called
+     via the event loop's :meth:`~BaseEventLoop.call_soon_threadsafe`.
+
+   - This class is not compatible with the :func:`~concurrent.futures.wait` and
+     :func:`~concurrent.futures.as_completed` functions in the
+     :mod:`concurrent.futures` package.
+
+   .. method:: cancel()
+
+      Cancel the future and schedule callbacks.
+
+      If the future is already done or cancelled, return ``False``. Otherwise,
+      change the future's state to cancelled, schedule the callbacks and return
+      ``True``.
+
+   .. method:: cancelled()
+
+      Return ``True`` if the future was cancelled.
+
+   .. method:: done()
+
+      Return True if the future is done.
+
+      Done means either that a result / exception are available, or that the
+      future was cancelled.
+
+   .. method:: result()
+
+      Return the result this future represents.
+
+      If the future has been cancelled, raises :exc:`CancelledError`. If the
+      future's result isn't yet available, raises :exc:`InvalidStateError`. If
+      the future is done and has an exception set, this exception is raised.
+
+   .. method:: exception()
+
+      Return the exception that was set on this future.
+
+      The exception (or ``None`` if no exception was set) is returned only if
+      the future is done. If the future has been cancelled, raises
+      :exc:`CancelledError`. If the future isn't done yet, raises
+      :exc:`InvalidStateError`.
+
+   .. method:: add_done_callback(fn)
+
+      Add a callback to be run when the future becomes done.
+
+      The callback is called with a single argument - the future object. If the
+      future is already done when this is called, the callback is scheduled
+      with :meth:`~BaseEventLoop.call_soon`.
+
+      :ref:`Use functools.partial to pass parameters to the callback
+      <asyncio-pass-keywords>`. For example,
+      ``fut.add_done_callback(functools.partial(print, "Future:",
+      flush=True))`` will call ``print("Future:", fut, flush=True)``.
+
+   .. method:: remove_done_callback(fn)
+
+      Remove all instances of a callback from the "call when done" list.
+
+      Returns the number of callbacks removed.
+
+   .. method:: set_result(result)
+
+      Mark the future done and set its result.
+
+      If the future is already done when this method is called, raises
+      :exc:`InvalidStateError`.
+
+   .. method:: set_exception(exception)
+
+      Mark the future done and set an exception.
+
+      If the future is already done when this method is called, raises
+      :exc:`InvalidStateError`.
+
+
+Example: Future with run_until_complete()
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Example combining a :class:`Future` and a :ref:`coroutine function
+<coroutine>`::
+
+    import asyncio
+
+    @asyncio.coroutine
+    def slow_operation(future):
+        yield from asyncio.sleep(1)
+        future.set_result('Future is done!')
+
+    loop = asyncio.get_event_loop()
+    future = asyncio.Future()
+    asyncio.async(slow_operation(future))
+    loop.run_until_complete(future)
+    print(future.result())
+    loop.close()
+
+The coroutine function is responsible for the computation (which takes 1 second)
+and it stores the result into the future. The
+:meth:`~BaseEventLoop.run_until_complete` method waits for the completion of
+the future.
+
+.. note::
+   The :meth:`~BaseEventLoop.run_until_complete` method uses internally the
+   :meth:`~Future.add_done_callback` method to be notified when the future is
+   done.
+
+
+Example: Future with run_forever()
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The previous example can be written differently using the
+:meth:`Future.add_done_callback` method to describe explicitly the control
+flow::
+
+    import asyncio
+
+    @asyncio.coroutine
+    def slow_operation(future):
+        yield from asyncio.sleep(1)
+        future.set_result('Future is done!')
+
+    def got_result(future):
+        print(future.result())
+        loop.stop()
+
+    loop = asyncio.get_event_loop()
+    future = asyncio.Future()
+    asyncio.async(slow_operation(future))
+    future.add_done_callback(got_result)
+    try:
+        loop.run_forever()
+    finally:
+        loop.close()
+
+In this example, the future is used to link ``slow_operation()`` to
+``got_result()``: when ``slow_operation()`` is done, ``got_result()`` is called
+with the result.
+
+
+Task
+----
+
+.. class:: Task(coro, \*, loop=None)
+
+   Schedule the execution of a :ref:`coroutine <coroutine>`: wrap it in a
+   future. A task is a subclass of :class:`Future`.
+
+   A task is responsible for executing a coroutine object in an event loop.  If
+   the wrapped coroutine yields from a future, the task suspends the execution
+   of the wrapped coroutine and waits for the completition of the future. When
+   the future is done, the execution of the wrapped coroutine restarts with the
+   result or the exception of the future.
+
+   Event loops use cooperative scheduling: an event loop only runs one task at
+   a time. Other tasks may run in parallel if other event loops are
+   running in different threads. While a task waits for the completion of a
+   future, the event loop executes a new task.
+
+   The cancellation of a task is different from the cancelation of a future. Calling
+   :meth:`cancel` will throw a :exc:`~concurrent.futures.CancelledError` to the
+   wrapped coroutine. :meth:`~Future.cancelled` only returns ``True`` if the
+   wrapped coroutine did not catch the
+   :exc:`~concurrent.futures.CancelledError` exception, or raised a
+   :exc:`~concurrent.futures.CancelledError` exception.
+
+   If a pending task is destroyed, the execution of its wrapped :ref:`coroutine
+   <coroutine>` did not complete. It is probably a bug and a warning is
+   logged: see :ref:`Pending task destroyed <asyncio-pending-task-destroyed>`.
+
+   Don't directly create :class:`Task` instances: use the :func:`async`
+   function or the :meth:`BaseEventLoop.create_task` method.
+
+   .. classmethod:: all_tasks(loop=None)
+
+      Return a set of all tasks for an event loop.
+
+      By default all tasks for the current event loop are returned.
+
+   .. classmethod:: current_task(loop=None)
+
+      Return the currently running task in an event loop or ``None``.
+
+      By default the current task for the current event loop is returned.
+
+      ``None`` is returned when called not in the context of a :class:`Task`.
+
+   .. method:: cancel()
+
+      Request that this task cancel itself.
+
+      This arranges for a :exc:`~concurrent.futures.CancelledError` to be
+      thrown into the wrapped coroutine on the next cycle through the event
+      loop. The coroutine then has a chance to clean up or even deny the
+      request using try/except/finally.
+
+      Unlike :meth:`Future.cancel`, this does not guarantee that the task
+      will be cancelled: the exception might be caught and acted upon, delaying
+      cancellation of the task or preventing cancellation completely. The task
+      may also return a value or raise a different exception.
+
+      Immediately after this method is called, :meth:`~Future.cancelled` will
+      not return ``True`` (unless the task was already cancelled). A task will
+      be marked as cancelled when the wrapped coroutine terminates with a
+      :exc:`~concurrent.futures.CancelledError` exception (even if
+      :meth:`cancel` was not called).
+
+   .. method:: get_stack(\*, limit=None)
+
+      Return the list of stack frames for this task's coroutine.
+
+      If the coroutine is not done, this returns the stack where it is suspended.
+      If the coroutine has completed successfully or was cancelled, this
+      returns an empty list.  If the coroutine was terminated by an exception,
+      this returns the list of traceback frames.
+
+      The frames are always ordered from oldest to newest.
+
+      The optional limit gives the maximum number of frames to return; by
+      default all available frames are returned.  Its meaning differs depending
+      on whether a stack or a traceback is returned: the newest frames of a
+      stack are returned, but the oldest frames of a traceback are returned.
+      (This matches the behavior of the traceback module.)
+
+      For reasons beyond our control, only one stack frame is returned for a
+      suspended coroutine.
+
+   .. method:: print_stack(\*, limit=None, file=None)
+
+      Print the stack or traceback for this task's coroutine.
+
+      This produces output similar to that of the traceback module, for the
+      frames retrieved by get_stack().  The limit argument is passed to
+      get_stack().  The file argument is an I/O stream to which the output
+      is written; by default output is written to sys.stderr.
+
+
+Example: Parallel execution of tasks
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Example executing 3 tasks (A, B, C) in parallel::
+
+    import asyncio
+
+    @asyncio.coroutine
+    def factorial(name, number):
+        f = 1
+        for i in range(2, number+1):
+            print("Task %s: Compute factorial(%s)..." % (name, i))
+            yield from asyncio.sleep(1)
+            f *= i
+        print("Task %s: factorial(%s) = %s" % (name, number, f))
+
+    loop = asyncio.get_event_loop()
+    tasks = [
+        asyncio.async(factorial("A", 2)),
+        asyncio.async(factorial("B", 3)),
+        asyncio.async(factorial("C", 4))]
+    loop.run_until_complete(asyncio.wait(tasks))
+    loop.close()
+
+Output::
+
+    Task A: Compute factorial(2)...
+    Task B: Compute factorial(2)...
+    Task C: Compute factorial(2)...
+    Task A: factorial(2) = 2
+    Task B: Compute factorial(3)...
+    Task C: Compute factorial(3)...
+    Task B: factorial(3) = 6
+    Task C: Compute factorial(4)...
+    Task C: factorial(4) = 24
+
+A task is automatically scheduled for execution when it is created. The event
+loop stops when all tasks are done.
+
+
+Task functions
+--------------
+
+.. note::
+
+   In the functions below, the optional *loop* argument allows to explicitly set
+   the event loop object used by the underlying task or coroutine.  If it's
+   not provided, the default event loop is used.
+
+.. function:: as_completed(fs, \*, loop=None, timeout=None)
+
+   Return an iterator whose values, when waited for, are :class:`Future`
+   instances.
+
+   Raises :exc:`asyncio.TimeoutError` if the timeout occurs before all Futures
+   are done.
+
+   Example::
+
+       for f in as_completed(fs):
+           result = yield from f  # The 'yield from' may raise
+           # Use result
+
+   .. note::
+
+      The futures ``f`` are not necessarily members of fs.
+
+.. function:: async(coro_or_future, \*, loop=None)
+
+   Schedule the execution of a :ref:`coroutine object <coroutine>`: wrap it in
+   a future. Return a :class:`Task` object.
+
+   If the argument is a :class:`Future`, it is returned directly.
+
+   .. seealso::
+
+      The :meth:`BaseEventLoop.create_task` method.
+
+.. function:: gather(\*coros_or_futures, loop=None, return_exceptions=False)
+
+   Return a future aggregating results from the given coroutine objects or
+   futures.
+
+   All futures must share the same event loop.  If all the tasks are done
+   successfully, the returned future's result is the list of results (in the
+   order of the original sequence, not necessarily the order of results
+   arrival).  If *return_exceptions* is True, exceptions in the tasks are
+   treated the same as successful results, and gathered in the result list;
+   otherwise, the first raised exception will be immediately propagated to the
+   returned future.
+
+   Cancellation: if the outer Future is cancelled, all children (that have not
+   completed yet) are also cancelled.  If any child is cancelled, this is
+   treated as if it raised :exc:`~concurrent.futures.CancelledError` -- the
+   outer Future is *not* cancelled in this case.  (This is to prevent the
+   cancellation of one child to cause other children to be cancelled.)
+
+.. function:: iscoroutine(obj)
+
+   Return ``True`` if *obj* is a :ref:`coroutine object <coroutine>`.
+
+.. function:: iscoroutinefunction(obj)
+
+   Return ``True`` if *func* is a decorated :ref:`coroutine function
+   <coroutine>`.
+
+.. function:: sleep(delay, result=None, \*, loop=None)
+
+   Create a :ref:`coroutine <coroutine>` that completes after a given
+   time (in seconds).  If *result* is provided, it is produced to the caller
+   when the coroutine completes.
+
+   The resolution of the sleep depends on the :ref:`granularity of the event
+   loop <asyncio-delayed-calls>`.
+
+.. function:: shield(arg, \*, loop=None)
+
+   Wait for a future, shielding it from cancellation.
+
+   The statement::
+
+       res = yield from shield(something())
+
+   is exactly equivalent to the statement::
+
+       res = yield from something()
+
+   *except* that if the coroutine containing it is cancelled, the task running
+   in ``something()`` is not cancelled.  From the point of view of
+   ``something()``, the cancellation did not happen.  But its caller is still
+   cancelled, so the yield-from expression still raises
+   :exc:`~concurrent.futures.CancelledError`.  Note: If ``something()`` is
+   cancelled by other means this will still cancel ``shield()``.
+
+   If you want to completely ignore cancellation (not recommended) you can
+   combine ``shield()`` with a try/except clause, as follows::
+
+       try:
+           res = yield from shield(something())
+       except CancelledError:
+           res = None
+
+.. function:: wait(futures, \*, loop=None, timeout=None, return_when=ALL_COMPLETED)
+
+   Wait for the Futures and coroutine objects given by the sequence *futures*
+   to complete.  Coroutines will be wrapped in Tasks. Returns two sets of
+   :class:`Future`: (done, pending).
+
+   The sequence *futures* must not be empty.
+
+   *timeout* can be used to control the maximum number of seconds to wait before
+   returning.  *timeout* can be an int or float.  If *timeout* is not specified
+   or ``None``, there is no limit to the wait time.
+
+   *return_when* indicates when this function should return.  It must be one of
+   the following constants of the :mod:`concurrent.futures` module:
+
+   .. tabularcolumns:: |l|L|
+
+   +-----------------------------+----------------------------------------+
+   | Constant                    | Description                            |
+   +=============================+========================================+
+   | :const:`FIRST_COMPLETED`    | The function will return when any      |
+   |                             | future finishes or is cancelled.       |
+   +-----------------------------+----------------------------------------+
+   | :const:`FIRST_EXCEPTION`    | The function will return when any      |
+   |                             | future finishes by raising an          |
+   |                             | exception.  If no future raises an     |
+   |                             | exception then it is equivalent to     |
+   |                             | :const:`ALL_COMPLETED`.                |
+   +-----------------------------+----------------------------------------+
+   | :const:`ALL_COMPLETED`      | The function will return when all      |
+   |                             | futures finish or are cancelled.       |
+   +-----------------------------+----------------------------------------+
+
+   This function is a :ref:`coroutine <coroutine>`.
+
+   Usage::
+
+        done, pending = yield from asyncio.wait(fs)
+
+   .. note::
+
+      This does not raise :exc:`asyncio.TimeoutError`! Futures that aren't done
+      when the timeout occurs are returned in the second set.
+
+
+.. function:: wait_for(fut, timeout, \*, loop=None)
+
+   Wait for the single :class:`Future` or :ref:`coroutine object <coroutine>`
+   to complete with timeout. If *timeout* is ``None``, block until the future
+   completes.
+
+   Coroutine will be wrapped in :class:`Task`.
+
+   Returns result of the Future or coroutine.  When a timeout occurs, it
+   cancels the task and raises :exc:`asyncio.TimeoutError`. To avoid the task
+   cancellation, wrap it in :func:`shield`.
+
+   This function is a :ref:`coroutine <coroutine>`, usage::
+
+       result = yield from asyncio.wait_for(fut, 60.0)
+
diff --git a/Doc/library/asyncio.rst b/Doc/library/asyncio.rst
new file mode 100644
index 0000000..6900198
--- /dev/null
+++ b/Doc/library/asyncio.rst
@@ -0,0 +1,67 @@
+:mod:`asyncio` -- Asynchronous I/O, event loop, coroutines and tasks
+====================================================================
+
+.. module:: asyncio
+   :synopsis: Asynchronous I/O, event loop, coroutines and tasks.
+
+.. note::
+
+   The asyncio package has been included in the standard library on a
+   :term:`provisional basis <provisional package>`. Backwards incompatible
+   changes (up to and including removal of the module) may occur if deemed
+   necessary by the core developers.
+
+.. versionadded:: 3.4
+
+**Source code:** :source:`Lib/asyncio/`
+
+--------------
+
+This module provides infrastructure for writing single-threaded concurrent
+code using coroutines, multiplexing I/O access over sockets and other
+resources, running network clients and servers, and other related primitives.
+Here is a more detailed list of the package contents:
+
+* a pluggable :ref:`event loop <asyncio-event-loop>` with various system-specific
+  implementations;
+
+* :ref:`transport <asyncio-transport>` and :ref:`protocol <asyncio-protocol>` abstractions
+  (similar to those in `Twisted <https://twistedmatrix.com/trac/>`_);
+
+* concrete support for TCP, UDP, SSL, subprocess pipes, delayed calls, and
+  others (some may be system-dependent);
+
+* a :class:`Future` class that mimics the one in the :mod:`concurrent.futures`
+  module, but adapted for use with the event loop;
+
+* coroutines and tasks based on ``yield from`` (:PEP:`380`), to help write
+  concurrent code in a sequential fashion;
+
+* cancellation support for :class:`Future`\s and coroutines;
+
+* :ref:`synchronization primitives <asyncio-sync>` for use between coroutines in
+  a single thread, mimicking those in the :mod:`threading` module;
+
+* an interface for passing work off to a threadpool, for times when
+  you absolutely, positively have to use a library that makes blocking
+  I/O calls.
+
+Table of contents:
+
+.. toctree::
+   :maxdepth: 3
+
+   asyncio-eventloop.rst
+   asyncio-eventloops.rst
+   asyncio-task.rst
+   asyncio-protocol.rst
+   asyncio-stream.rst
+   asyncio-subprocess.rst
+   asyncio-sync.rst
+   asyncio-dev.rst
+
+.. seealso::
+
+   The :mod:`asyncio` module was designed in :PEP:`3156`. For a
+   motivational primer on transports and protocols, see :PEP:`3153`.
+
diff --git a/Doc/library/asyncore.rst b/Doc/library/asyncore.rst
index 1521e72..917d044 100644
--- a/Doc/library/asyncore.rst
+++ b/Doc/library/asyncore.rst
@@ -13,6 +13,11 @@
 
 --------------
 
+.. note::
+
+   This module exists for backwards compatibility only.  For new code we
+   recommend using :mod:`asyncio`.
+
 This module provides the basic infrastructure for writing asynchronous  socket
 service clients and servers.
 
@@ -211,6 +216,10 @@
       empty bytes object implies that the channel has been closed from the
       other end.
 
+      Note that :meth:`recv` may raise :exc:`BlockingIOError` , even though
+      :func:`select.select` or :func:`select.poll` has reported the socket
+      ready for reading.
+
 
    .. method:: listen(backlog)
 
diff --git a/Doc/library/audioop.rst b/Doc/library/audioop.rst
index edb3870..ce127aa 100644
--- a/Doc/library/audioop.rst
+++ b/Doc/library/audioop.rst
@@ -6,9 +6,14 @@
 
 
 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 bytes objects.  All scalar items are integers, unless
-specified otherwise.
+It operates on sound fragments consisting of signed integer samples 8, 16, 24
+or 32 bits wide, stored in :term:`bytes-like object`\ s.  All scalar items are
+integers, unless specified otherwise.
+
+.. versionchanged:: 3.4
+   Support for 24-bit samples was added.
+   All functions now accept any :term:`bytes-like object`.
+   String input now results in an immediate error.
 
 .. index::
    single: Intel/DVI ADPCM
@@ -35,7 +40,7 @@
 .. function:: add(fragment1, fragment2, width)
 
    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
+   *width* is the sample width in bytes, either ``1``, ``2``, ``3`` or ``4``.  Both
    fragments should have the same length.  Samples are truncated in case of overflow.
 
 
@@ -70,6 +75,14 @@
    sample.  Samples wrap around in case of overflow.
 
 
+.. function:: byteswap(fragment, width)
+
+   "Byteswap" all samples in a fragment and returns the modified fragment.
+   Converts big-endian samples to little-endian and vice versa.
+
+   .. versionadded:: 3.4
+
+
 .. function:: cross(fragment, width)
 
    Return the number of zero crossings in the fragment passed as an argument.
@@ -133,19 +146,19 @@
 
 .. function:: lin2lin(fragment, width, newwidth)
 
-   Convert samples between 1-, 2- and 4-byte formats.
+   Convert samples between 1-, 2-, 3- and 4-byte formats.
 
    .. note::
 
-      In some audio formats, such as .WAV files, 16 and 32 bit samples are
+      In some audio formats, such as .WAV files, 16, 24 and 32 bit samples are
       signed, but 8 bit samples are unsigned.  So when converting to 8 bit wide
       samples for these formats, you need to also add 128 to the result::
 
          new_frames = audioop.lin2lin(frames, old_width, 1)
          new_frames = audioop.bias(new_frames, 1, 128)
 
-      The same, in reverse, has to be applied when converting from 8 to 16 or 32
-      bit width samples.
+      The same, in reverse, has to be applied when converting from 8 to 16, 24
+      or 32 bit width samples.
 
 
 .. function:: lin2ulaw(fragment, width)
diff --git a/Doc/library/base64.rst b/Doc/library/base64.rst
index f0d11b0..3d23dfc 100644
--- a/Doc/library/base64.rst
+++ b/Doc/library/base64.rst
@@ -1,32 +1,42 @@
-:mod:`base64` --- RFC 3548: Base16, Base32, Base64 Data Encodings
-=================================================================
+:mod:`base64` --- Base16, Base32, Base64, Base85 Data Encodings
+===============================================================
 
 .. module:: base64
-   :synopsis: RFC 3548: Base16, Base32, Base64 Data Encodings
+   :synopsis: RFC 3548: Base16, Base32, Base64 Data Encodings;
+              Base85 and Ascii85
 
 
 .. index::
    pair: base64; encoding
    single: MIME; base64 encoding
 
-This module provides data encoding and decoding as specified in :rfc:`3548`.
-This standard defines the Base16, Base32, and Base64 algorithms for encoding
-and decoding arbitrary binary strings into ASCII-only byte strings that can be
+This module provides functions for encoding binary data to printable
+ASCII characters and decoding such encodings back to binary data.
+It provides encoding and decoding functions for the encodings specified in
+:rfc:`3548`, which defines the Base16, Base32, and Base64 algorithms,
+and for the de-facto standard Ascii85 and Base85 encodings.
+
+The :rfc:`3548` encodings are suitable for encoding binary data so that it can
 safely sent by email, used as parts of URLs, or included as part of an HTTP
 POST request.  The encoding algorithm is not the same as the
 :program:`uuencode` program.
 
-There are two interfaces provided by this module.  The modern interface
-supports encoding and decoding ASCII byte string objects using all three
-alphabets. Additionally, the decoding functions of the modern interface also
-accept Unicode strings containing only ASCII characters. The legacy interface
-provides for encoding and decoding to and from file-like objects as well as
-byte strings, but only using the Base64 standard alphabet.
+There are two :rfc:`3548` interfaces provided by this module.  The modern
+interface supports encoding and decoding ASCII byte string objects using all
+three :rfc:`3548` defined alphabets (normal, URL-safe, and filesystem-safe).
+Additionally, the decoding functions of the modern interface also accept
+Unicode strings containing only ASCII characters. The legacy interface provides
+for encoding and decoding to and from file-like objects as well as byte
+strings, but only using the Base64 standard alphabet.
 
 .. versionchanged:: 3.3
    ASCII-only Unicode strings are now accepted by the decoding functions of
    the modern interface.
 
+.. versionchanged:: 3.4
+   Any :term:`bytes-like object`\ s are now accepted by all
+   encoding and decoding functions in this module.  Ascii85/Base85 support added.
+
 The modern interface provides:
 
 .. function:: b64encode(s, altchars=None)
@@ -128,6 +138,76 @@
    string.
 
 
+.. function:: a85encode(s, *, foldspaces=False, wrapcol=0, pad=False, adobe=False)
+
+   Encode a byte string using Ascii85.
+
+   *s* is the string to encode. The encoded byte string is returned.
+
+   *foldspaces* is an optional flag that uses the special short sequence 'y'
+   instead of 4 consecutive spaces (ASCII 0x20) as supported by 'btoa'. This
+   feature is not supported by the "standard" Ascii85 encoding.
+
+   *wrapcol* controls whether the output should have newline ('\n')
+   characters added to it. If this is non-zero, each output line will be
+   at most this many characters long.
+
+   *pad* controls whether the input string is padded to a multiple of 4
+   before encoding. Note that the ``btoa`` implementation always pads.
+
+   *adobe* controls whether the encoded byte sequence is framed with ``<~``
+   and ``~>``, which is used by the Adobe implementation.
+
+   .. versionadded:: 3.4
+
+
+.. function:: a85decode(s, *, foldspaces=False, adobe=False, ignorechars=b' \t\n\r\v')
+
+   Decode an Ascii85 encoded byte string.
+
+   *s* is the byte string to decode.
+
+   *foldspaces* is a flag that specifies whether the 'y' short sequence
+   should be accepted as shorthand for 4 consecutive spaces (ASCII 0x20).
+   This feature is not supported by the "standard" Ascii85 encoding.
+
+   *adobe* controls whether the input sequence is in Adobe Ascii85 format
+   (i.e. is framed with <~ and ~>).
+
+   *ignorechars* should be a byte string containing characters to ignore
+   from the input. This should only contain whitespace characters, and by
+   default contains all whitespace characters in ASCII.
+
+   .. versionadded:: 3.4
+
+
+.. function:: b85encode(s, pad=False)
+
+   Encode a byte string using base85, as used in e.g. git-style binary
+   diffs.
+
+   If *pad* is true, the input is padded with "\\0" so its length is a
+   multiple of 4 characters before encoding.
+
+   .. versionadded:: 3.4
+
+
+.. function:: b85decode(b)
+
+   Decode base85-encoded byte string.  Padding is implicitly removed, if
+   necessary.
+
+   .. versionadded:: 3.4
+
+
+.. note::
+   Both Base85 and Ascii85 have an expansion factor of 5 to 4 (5 Base85 or
+   Ascii85 characters can encode 4 binary bytes), while the better-known
+   Base64 has an expansion factor of 6 to 4.  They are therefore more
+   efficient when space expensive.  They differ by details such as the
+   character map used for encoding.
+
+
 The legacy interface:
 
 .. function:: decode(input, output)
diff --git a/Doc/library/bz2.rst b/Doc/library/bz2.rst
index b79bccd..488cda5 100644
--- a/Doc/library/bz2.rst
+++ b/Doc/library/bz2.rst
@@ -37,8 +37,8 @@
    file object to read from or write to.
 
    The *mode* argument can be any of ``'r'``, ``'rb'``, ``'w'``, ``'wb'``,
-   ``'a'``, or ``'ab'`` for binary mode, or ``'rt'``, ``'wt'``, or ``'at'`` for
-   text mode. The default is ``'rb'``.
+   ``'x'``, ``'xb'``, ``'a'`` or ``'ab'`` for binary mode, or ``'rt'``,
+   ``'wt'``, ``'xt'``, or ``'at'`` for text mode. The default is ``'rb'``.
 
    The *compresslevel* argument is an integer from 1 to 9, as for the
    :class:`BZ2File` constructor.
@@ -54,6 +54,9 @@
 
    .. versionadded:: 3.3
 
+   .. versionchanged:: 3.4
+      The ``'x'`` (exclusive creation) mode was added.
+
 
 .. class:: BZ2File(filename, mode='r', buffering=None, compresslevel=9)
 
@@ -64,8 +67,9 @@
    be used to read or write the compressed data.
 
    The *mode* argument can be either ``'r'`` for reading (default), ``'w'`` for
-   overwriting, or ``'a'`` for appending. These can equivalently be given as
-   ``'rb'``, ``'wb'``, and ``'ab'`` respectively.
+   overwriting, ``'x'`` for exclusive creation, or ``'a'`` for appending. These
+   can equivalently be given as ``'rb'``, ``'wb'``, ``'xb'`` and ``'ab'``
+   respectively.
 
    If *filename* is a file object (rather than an actual file name), a mode of
    ``'w'`` does not truncate the file, and is instead equivalent to ``'a'``.
@@ -113,6 +117,9 @@
       The ``'a'`` (append) mode was added, along with support for reading
       multi-stream files.
 
+   .. versionchanged:: 3.4
+      The ``'x'`` (exclusive creation) mode was added.
+
 
 Incremental (de)compression
 ---------------------------
diff --git a/Doc/library/cgi.rst b/Doc/library/cgi.rst
index c4e7c60..fa13145 100644
--- a/Doc/library/cgi.rst
+++ b/Doc/library/cgi.rst
@@ -142,9 +142,11 @@
 method reads the entire file in memory as bytes.  This may not be what you
 want.  You can test for an uploaded file by testing either the
 :attr:`~FieldStorage.filename` attribute or the :attr:`~FieldStorage.file`
-attribute.  You can then read the data at leisure from the :attr:`!file`
-attribute (the :func:`~io.RawIOBase.read` and :func:`~io.IOBase.readline`
-methods will return bytes)::
+attribute.  You can then read the data from the :attr:`!file`
+attribute before it is automatically closed as part of the garbage collection of
+the :class:`FieldStorage` instance
+(the :func:`~io.RawIOBase.read` and :func:`~io.IOBase.readline` methods will
+return bytes)::
 
    fileitem = form["userfile"]
    if fileitem.file:
@@ -176,6 +178,11 @@
 A form submitted via POST that also has a query string will contain both
 :class:`FieldStorage` and :class:`MiniFieldStorage` items.
 
+.. versionchanged:: 3.4
+   The :attr:`~FieldStorage.file` attribute is automatically closed upon the
+   garbage collection of the creating :class:`FieldStorage` instance.
+
+
 Higher Level Interface
 ----------------------
 
diff --git a/Doc/library/cmath.rst b/Doc/library/cmath.rst
index d7778df..a981d94 100644
--- a/Doc/library/cmath.rst
+++ b/Doc/library/cmath.rst
@@ -149,13 +149,13 @@
 
 .. function:: acosh(x)
 
-   Return the hyperbolic arc cosine of *x*. There is one branch cut, extending left
-   from 1 along the real axis to -∞, continuous from above.
+   Return the inverse hyperbolic cosine of *x*. There is one branch cut,
+   extending left from 1 along the real axis to -∞, continuous from above.
 
 
 .. function:: asinh(x)
 
-   Return the hyperbolic arc sine of *x*. There are two branch cuts:
+   Return the inverse hyperbolic sine of *x*. There are two branch cuts:
    One extends from ``1j`` along the imaginary axis to ``∞j``,
    continuous from the right.  The other extends from ``-1j`` along
    the imaginary axis to ``-∞j``, continuous from the left.
@@ -163,7 +163,7 @@
 
 .. function:: atanh(x)
 
-   Return the hyperbolic arc tangent of *x*. There are two branch cuts: One
+   Return the inverse hyperbolic tangent of *x*. There are two branch cuts: One
    extends from ``1`` along the real axis to ``∞``, continuous from below. The
    other extends from ``-1`` along the real axis to ``-∞``, continuous from
    above.
diff --git a/Doc/library/cmd.rst b/Doc/library/cmd.rst
index 9722928..80d2a5d 100644
--- a/Doc/library/cmd.rst
+++ b/Doc/library/cmd.rst
@@ -148,8 +148,8 @@
    Hook method executed once when :meth:`cmdloop` is about to return. This method
    is a stub in :class:`Cmd`; it exists to be overridden by subclasses.
 
-Instances of :class:`Cmd` subclasses have some public instance variables:
 
+Instances of :class:`Cmd` subclasses have some public instance variables:
 
 .. attribute:: Cmd.prompt
 
@@ -166,6 +166,13 @@
    The last nonempty command prefix seen.
 
 
+.. attribute:: Cmd.cmdqueue
+
+   A list of queued input lines.  The cmdqueue list is checked in
+   :meth:`cmdloop` when new input is needed; if it is nonempty, its elements
+   will be processed in order, as if entered at the prompt.
+
+
 .. attribute:: Cmd.intro
 
    A string to issue as an intro or banner.  May be overridden by giving the
diff --git a/Doc/library/code.rst b/Doc/library/code.rst
index e869004..5b5d7cc 100644
--- a/Doc/library/code.rst
+++ b/Doc/library/code.rst
@@ -132,12 +132,15 @@
 
 .. method:: InteractiveConsole.interact(banner=None)
 
-   Closely emulate the interactive Python console. The optional banner argument
+   Closely emulate the interactive Python console. The optional *banner* argument
    specify the banner to print before the first interaction; by default it prints a
    banner similar to the one printed by the standard Python interpreter, followed
    by the class name of the console object in parentheses (so as not to confuse
    this with the real interpreter -- since it's so close!).
 
+   .. versionchanged:: 3.4
+      To suppress printing any banner, pass an empty string.
+
 
 .. method:: InteractiveConsole.push(line)
 
diff --git a/Doc/library/codecs.rst b/Doc/library/codecs.rst
index 009ae26..dd44cb2 100644
--- a/Doc/library/codecs.rst
+++ b/Doc/library/codecs.rst
@@ -17,110 +17,92 @@
    pair: stackable; streams
 
 This module defines base classes for standard Python codecs (encoders and
-decoders) and provides access to the internal Python codec registry which
-manages the codec and error handling lookup process.
+decoders) and provides access to the internal Python codec registry, which
+manages the codec and error handling lookup process. Most standard codecs
+are :term:`text encodings <text encoding>`, which encode text to bytes,
+but there are also codecs provided that encode text to text, and bytes to
+bytes. Custom codecs may encode and decode between arbitrary types, but some
+module features are restricted to use specifically with
+:term:`text encodings <text encoding>`, or with codecs that encode to
+:class:`bytes`.
 
-It defines the following functions:
+The module defines the following functions for encoding and decoding with
+any codec:
 
-.. function:: encode(obj, encoding='utf-8', errors='strict')
+.. function:: encode(obj, [encoding[, errors]])
 
-   Encodes *obj* using the codec registered for *encoding*.
+   Encodes *obj* using the codec registered for *encoding*. The default
+   encoding is ``utf-8``.
 
    *Errors* may be given to set the desired error handling scheme. The
-   default error handler is ``strict`` meaning that encoding errors raise
+   default error handler is ``'strict'`` meaning that encoding errors raise
    :exc:`ValueError` (or a more codec specific subclass, such as
    :exc:`UnicodeEncodeError`). Refer to :ref:`codec-base-classes` for more
    information on codec error handling.
 
-.. function:: decode(obj, encoding='utf-8', errors='strict')
+.. function:: decode(obj, [encoding[, errors]])
 
-   Decodes *obj* using the codec registered for *encoding*.
+   Decodes *obj* using the codec registered for *encoding*. The default
+   encoding is ``utf-8``.
 
    *Errors* may be given to set the desired error handling scheme. The
-   default error handler is ``strict`` meaning that decoding errors raise
+   default error handler is ``'strict'`` meaning that decoding errors raise
    :exc:`ValueError` (or a more codec specific subclass, such as
    :exc:`UnicodeDecodeError`). Refer to :ref:`codec-base-classes` for more
    information on codec error handling.
 
-.. function:: register(search_function)
-
-   Register a codec search function. Search functions are expected to take one
-   argument, the encoding name in all lower case letters, and return a
-   :class:`CodecInfo` object having the following attributes:
-
-   * ``name`` The name of the encoding;
-
-   * ``encode`` The stateless encoding function;
-
-   * ``decode`` The stateless decoding function;
-
-   * ``incrementalencoder`` An incremental encoder class or factory function;
-
-   * ``incrementaldecoder`` An incremental decoder class or factory function;
-
-   * ``streamwriter`` A stream writer class or factory function;
-
-   * ``streamreader`` A stream reader class or factory function.
-
-   The various functions or classes take the following arguments:
-
-   *encode* and *decode*: These must be functions or methods which have the same
-   interface as the :meth:`~Codec.encode`/:meth:`~Codec.decode` methods of Codec
-   instances (see :ref:`Codec Interface <codec-objects>`). The functions/methods
-   are expected to work in a stateless mode.
-
-   *incrementalencoder* and *incrementaldecoder*: These have to be factory
-   functions providing the following interface:
-
-      ``factory(errors='strict')``
-
-   The factory functions must return objects providing the interfaces defined by
-   the base classes :class:`IncrementalEncoder` and :class:`IncrementalDecoder`,
-   respectively. Incremental codecs can maintain state.
-
-   *streamreader* and *streamwriter*: These have to be factory functions providing
-   the following interface:
-
-      ``factory(stream, errors='strict')``
-
-   The factory functions must return objects providing the interfaces defined by
-   the base classes :class:`StreamReader` and :class:`StreamWriter`, respectively.
-   Stream codecs can maintain state.
-
-   Possible values for errors are
-
-   * ``'strict'``: raise an exception in case of an encoding error
-   * ``'replace'``: replace malformed data with a suitable replacement marker,
-     such as ``'?'`` or ``'\ufffd'``
-   * ``'ignore'``: ignore malformed data and continue without further notice
-   * ``'xmlcharrefreplace'``: replace with the appropriate XML character
-     reference (for encoding only)
-   * ``'backslashreplace'``: replace with backslashed escape sequences (for
-     encoding only)
-   * ``'surrogateescape'``: on decoding, replace with code points in the Unicode
-     Private Use Area ranging from U+DC80 to U+DCFF.  These private code
-     points will then be turned back into the same bytes when the
-     ``surrogateescape`` error handler is used when encoding the data.
-     (See :pep:`383` for more.)
-
-   as well as any other error handling name defined via :func:`register_error`.
-
-   In case a search function cannot find a given encoding, it should return
-   ``None``.
-
+The full details for each codec can also be looked up directly:
 
 .. function:: lookup(encoding)
 
    Looks up the codec info in the Python codec registry and returns a
-   :class:`CodecInfo` object as defined above.
+   :class:`CodecInfo` object as defined below.
 
    Encodings are first looked up in the registry's cache. If not found, the list of
    registered search functions is scanned. If no :class:`CodecInfo` object is
    found, a :exc:`LookupError` is raised. Otherwise, the :class:`CodecInfo` object
    is stored in the cache and returned to the caller.
 
-To simplify access to the various codecs, the module provides these additional
-functions which use :func:`lookup` for the codec lookup:
+.. class:: CodecInfo(encode, decode, streamreader=None, streamwriter=None, incrementalencoder=None, incrementaldecoder=None, name=None)
+
+   Codec details when looking up the codec registry. The constructor
+   arguments are stored in attributes of the same name:
+
+
+   .. attribute:: name
+
+      The name of the encoding.
+
+
+   .. attribute:: encode
+                  decode
+
+      The stateless encoding and decoding functions. These must be
+      functions or methods which have the same interface as
+      the :meth:`~Codec.encode` and :meth:`~Codec.decode` methods of Codec
+      instances (see :ref:`Codec Interface <codec-objects>`).
+      The functions or methods are expected to work in a stateless mode.
+
+
+   .. attribute:: incrementalencoder
+                  incrementaldecoder
+
+      Incremental encoder and decoder classes or factory functions.
+      These have to provide the interface defined by the base classes
+      :class:`IncrementalEncoder` and :class:`IncrementalDecoder`,
+      respectively. Incremental codecs can maintain state.
+
+
+   .. attribute:: streamwriter
+                  streamreader
+
+      Stream writer and reader classes or factory functions. These have to
+      provide the interface defined by the base classes
+      :class:`StreamWriter` and :class:`StreamReader`, respectively.
+      Stream codecs can maintain state.
+
+To simplify access to the various codec components, the module provides
+these additional functions which use :func:`lookup` for the codec lookup:
 
 
 .. function:: getencoder(encoding)
@@ -170,90 +152,43 @@
 
    Raises a :exc:`LookupError` in case the encoding cannot be found.
 
+Custom codecs are made available by registering a suitable codec search
+function:
 
-.. function:: register_error(name, error_handler)
+.. function:: register(search_function)
 
-   Register the error handling function *error_handler* under the name *name*.
-   *error_handler* will be called during encoding and decoding in case of an error,
-   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 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
-   replacement from the error handler will be put into the output directly.
-
-
-.. function:: lookup_error(name)
-
-   Return the error handler previously registered under the name *name*.
-
-   Raises a :exc:`LookupError` in case the handler cannot be found.
-
-
-.. function:: strict_errors(exception)
-
-   Implements the ``strict`` error handling: each encoding or decoding error
-   raises a :exc:`UnicodeError`.
-
-
-.. function:: replace_errors(exception)
-
-   Implements the ``replace`` error handling: malformed data is replaced with a
-   suitable replacement character such as ``'?'`` in bytestrings and
-   ``'\ufffd'`` in Unicode strings.
-
-
-.. function:: ignore_errors(exception)
-
-   Implements the ``ignore`` error handling: malformed data is ignored and
-   encoding or decoding is continued without further notice.
-
-
-.. function:: xmlcharrefreplace_errors(exception)
-
-   Implements the ``xmlcharrefreplace`` error handling (for encoding only): the
-   unencodable character is replaced by an appropriate XML character reference.
-
-
-.. function:: backslashreplace_errors(exception)
-
-   Implements the ``backslashreplace`` error handling (for encoding only): the
-   unencodable character is replaced by a backslashed escape sequence.
-
-To simplify working with encoded files or stream, the module also defines these
-utility functions:
-
-
-.. function:: open(filename, mode[, encoding[, errors[, buffering]]])
-
-   Open an encoded file using the given *mode* and return a wrapped version
-   providing transparent encoding/decoding.  The default file mode is ``'r'``
-   meaning to open the file in read mode.
+   Register a codec search function. Search functions are expected to take one
+   argument, being the encoding name in all lower case letters, and return a
+   :class:`CodecInfo` object. In case a search function cannot find
+   a given encoding, it should return ``None``.
 
    .. note::
 
-      The wrapped version's methods will accept and return strings only.  Bytes
-      arguments will be rejected.
+      Search function registration is not currently reversible,
+      which may cause problems in some cases, such as unit testing or
+      module reloading.
+
+While the builtin :func:`open` and the associated :mod:`io` module are the
+recommended approach for working with encoded text files, this module
+provides additional utility functions and classes that allow the use of a
+wider range of codecs when working with binary files:
+
+.. function:: open(filename, mode='r', encoding=None, errors='strict', buffering=1)
+
+   Open an encoded file using the given *mode* and return an instance of
+   :class:`StreamReaderWriter`, providing transparent encoding/decoding.
+   The default file mode is ``'r'``, meaning to open the file in read mode.
 
    .. note::
 
-      Files are always opened in binary mode, even if no binary mode was
-      specified.  This is done to avoid data loss due to encodings using 8-bit
-      values.  This means that no automatic conversion of ``b'\n'`` is done
-      on reading and writing.
+      Underlying encoded files are always opened in binary mode.
+      No automatic conversion of ``'\n'`` is done on reading and writing.
+      The *mode* argument may be any binary mode acceptable to the built-in
+      :func:`open` function; the ``'b'`` is automatically added.
 
    *encoding* specifies the encoding which is to be used for the file.
+   Any encoding that encodes to and decodes from bytes is allowed, and
+   the data types supported by the file methods depend on the codec used.
 
    *errors* may be given to define the error handling. It defaults to ``'strict'``
    which causes a :exc:`ValueError` to be raised in case an encoding error occurs.
@@ -264,12 +199,15 @@
 
 .. function:: EncodedFile(file, data_encoding, file_encoding=None, errors='strict')
 
-   Return a wrapped version of file which provides transparent encoding
-   translation.
+   Return a :class:`StreamRecoder` instance, a wrapped version of *file*
+   which provides transparent transcoding. The original file is closed
+   when the wrapped version is closed.
 
-   Bytes written to the wrapped file are interpreted according to the given
-   *data_encoding* and then written to the original file as bytes using the
-   *file_encoding*.
+   Data written to the wrapped file is decoded according to the given
+   *data_encoding* and then written to the original file as bytes using
+   *file_encoding*. Bytes read from the original file are decoded
+   according to *file_encoding*, and the result is encoded
+   using *data_encoding*.
 
    If *file_encoding* is not given, it defaults to *data_encoding*.
 
@@ -281,14 +219,16 @@
 .. function:: iterencode(iterator, encoding, errors='strict', **kwargs)
 
    Uses an incremental encoder to iteratively encode the input provided by
-   *iterator*. This function is a :term:`generator`.  *errors* (as well as any
+   *iterator*. This function is a :term:`generator`.
+   The *errors* argument (as well as any
    other keyword argument) is passed through to the incremental encoder.
 
 
 .. function:: iterdecode(iterator, encoding, errors='strict', **kwargs)
 
    Uses an incremental decoder to iteratively decode the input provided by
-   *iterator*. This function is a :term:`generator`.  *errors* (as well as any
+   *iterator*. This function is a :term:`generator`.
+   The *errors* argument (as well as any
    other keyword argument) is passed through to the incremental decoder.
 
 
@@ -307,9 +247,10 @@
           BOM_UTF32_BE
           BOM_UTF32_LE
 
-   These constants define various encodings of the Unicode byte order mark (BOM)
-   used in UTF-16 and UTF-32 data streams to indicate the byte order used in the
-   stream or file and in UTF-8 as a Unicode signature. :const:`BOM_UTF16` is either
+   These constants define various byte sequences,
+   being Unicode byte order marks (BOMs) for several encodings. They are
+   used in UTF-16 and UTF-32 data streams to indicate the byte order used,
+   and in UTF-8 as a Unicode signature. :const:`BOM_UTF16` is either
    :const:`BOM_UTF16_BE` or :const:`BOM_UTF16_LE` depending on the platform's
    native byte order, :const:`BOM` is an alias for :const:`BOM_UTF16`,
    :const:`BOM_LE` for :const:`BOM_UTF16_LE` and :const:`BOM_BE` for
@@ -323,20 +264,25 @@
 ------------------
 
 The :mod:`codecs` module defines a set of base classes which define the
-interface and can also be used to easily write your own codecs for use in
-Python.
+interfaces for working with codec objects, and can also be used as the basis
+for custom codec implementations.
 
 Each codec has to define four interfaces to make it usable as codec in Python:
 stateless encoder, stateless decoder, stream reader and stream writer. The
 stream reader and writers typically reuse the stateless encoder/decoder to
-implement the file protocols.
+implement the file protocols. Codec authors also need to define how the
+codec will handle encoding and decoding errors.
 
-The :class:`Codec` class defines the interface for stateless encoders/decoders.
 
-To simplify and standardize error handling, the :meth:`~Codec.encode` and
-:meth:`~Codec.decode` methods may implement different error handling schemes by
-providing the *errors* string argument.  The following string values are defined
-and implemented by all standard Python codecs:
+.. _error-handlers:
+
+Error Handlers
+^^^^^^^^^^^^^^
+
+To simplify and standardize error handling,
+codecs may implement different error handling schemes by
+accepting the *errors* string argument.  The following string values are
+defined and implemented by all standard Python codecs:
 
 .. tabularcolumns:: |l|L|
 
@@ -344,59 +290,150 @@
 | Value                   | Meaning                                       |
 +=========================+===============================================+
 | ``'strict'``            | Raise :exc:`UnicodeError` (or a subclass);    |
-|                         | this is the default.                          |
+|                         | this is the default.  Implemented in          |
+|                         | :func:`strict_errors`.                        |
 +-------------------------+-----------------------------------------------+
-| ``'ignore'``            | Ignore the character and continue with the    |
-|                         | next.                                         |
+| ``'ignore'``            | Ignore the malformed data and continue        |
+|                         | without further notice.  Implemented in       |
+|                         | :func:`ignore_errors`.                        |
 +-------------------------+-----------------------------------------------+
+
+The following error handlers are only applicable to
+:term:`text encodings <text encoding>`:
+
++-------------------------+-----------------------------------------------+
+| Value                   | Meaning                                       |
++=========================+===============================================+
 | ``'replace'``           | Replace with a suitable replacement           |
-|                         | character; Python will use the official       |
-|                         | U+FFFD REPLACEMENT CHARACTER for the built-in |
-|                         | Unicode codecs on decoding and '?' on         |
-|                         | encoding.                                     |
+|                         | marker; Python will use the official          |
+|                         | ``U+FFFD`` REPLACEMENT CHARACTER for the      |
+|                         | built-in codecs on decoding, and '?' on       |
+|                         | encoding.  Implemented in                     |
+|                         | :func:`replace_errors`.                       |
 +-------------------------+-----------------------------------------------+
 | ``'xmlcharrefreplace'`` | Replace with the appropriate XML character    |
-|                         | reference (only for encoding).                |
+|                         | reference (only for encoding).  Implemented   |
+|                         | in :func:`xmlcharrefreplace_errors`.          |
 +-------------------------+-----------------------------------------------+
 | ``'backslashreplace'``  | Replace with backslashed escape sequences     |
-|                         | (only for encoding).                          |
+|                         | (only for encoding).  Implemented in          |
+|                         | :func:`backslashreplace_errors`.              |
 +-------------------------+-----------------------------------------------+
-| ``'surrogateescape'``   | Replace byte with surrogate U+DCxx, as defined|
-|                         | in :pep:`383`.                                |
+| ``'surrogateescape'``   | On decoding, replace byte with individual     |
+|                         | surrogate code ranging from ``U+DC80`` to     |
+|                         | ``U+DCFF``.  This code will then be turned    |
+|                         | back into the same byte when the              |
+|                         | ``'surrogateescape'`` error handler is used   |
+|                         | when encoding the data.  (See :pep:`383` for  |
+|                         | more.)                                        |
 +-------------------------+-----------------------------------------------+
 
-In addition, the following error handlers are specific to a single codec:
+In addition, the following error handler is specific to the given codecs:
 
-+-------------------+---------+-------------------------------------------+
-| Value             | Codec   | Meaning                                   |
-+===================+=========+===========================================+
-|``'surrogatepass'``| utf-8   | Allow encoding and decoding of surrogate  |
-|                   |         | codes in UTF-8.                           |
-+-------------------+---------+-------------------------------------------+
++-------------------+------------------------+-------------------------------------------+
+| Value             | Codecs                 | Meaning                                   |
++===================+========================+===========================================+
+|``'surrogatepass'``| utf-8, utf-16, utf-32, | Allow encoding and decoding of surrogate  |
+|                   | utf-16-be, utf-16-le,  | codes.  These codecs normally treat the   |
+|                   | utf-32-be, utf-32-le   | presence of surrogates as an error.       |
++-------------------+------------------------+-------------------------------------------+
 
 .. versionadded:: 3.1
    The ``'surrogateescape'`` and ``'surrogatepass'`` error handlers.
 
-The set of allowed values can be extended via :meth:`register_error`.
+.. versionchanged:: 3.4
+   The ``'surrogatepass'`` error handlers now works with utf-16\* and utf-32\* codecs.
+
+The set of allowed values can be extended by registering a new named error
+handler:
+
+.. function:: register_error(name, error_handler)
+
+   Register the error handling function *error_handler* under the name *name*.
+   The *error_handler* argument will be called during encoding and decoding
+   in case of an error, 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 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 similarly, except :exc:`UnicodeDecodeError` or
+   :exc:`UnicodeTranslateError` will be passed to the handler and that the
+   replacement from the error handler will be put into the output directly.
+
+
+Previously registered error handlers (including the standard error handlers)
+can be looked up by name:
+
+.. function:: lookup_error(name)
+
+   Return the error handler previously registered under the name *name*.
+
+   Raises a :exc:`LookupError` in case the handler cannot be found.
+
+The following standard error handlers are also made available as module level
+functions:
+
+.. function:: strict_errors(exception)
+
+   Implements the ``'strict'`` error handling: each encoding or
+   decoding error raises a :exc:`UnicodeError`.
+
+
+.. function:: replace_errors(exception)
+
+   Implements the ``'replace'`` error handling (for :term:`text encodings
+   <text encoding>` only): substitutes ``'?'`` for encoding errors
+   (to be encoded by the codec), and ``'\ufffd'`` (the Unicode replacement
+   character, ``'�'``) for decoding errors.
+
+
+.. function:: ignore_errors(exception)
+
+   Implements the ``'ignore'`` error handling: malformed data is ignored and
+   encoding or decoding is continued without further notice.
+
+
+.. function:: xmlcharrefreplace_errors(exception)
+
+   Implements the ``'xmlcharrefreplace'`` error handling (for encoding with
+   :term:`text encodings <text encoding>` only): the
+   unencodable character is replaced by an appropriate XML character reference.
+
+
+.. function:: backslashreplace_errors(exception)
+
+   Implements the ``'backslashreplace'`` error handling (for encoding with
+   :term:`text encodings <text encoding>` only): the
+   unencodable character is replaced by a backslashed escape sequence.
 
 
 .. _codec-objects:
 
-Codec Objects
-^^^^^^^^^^^^^
+Stateless Encoding and Decoding
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-The :class:`Codec` class defines these methods which also define the function
-interfaces of the stateless encoder and decoder:
+The base :class:`Codec` class defines these methods which also define the
+function interfaces of the stateless encoder and decoder:
 
 
 .. method:: Codec.encode(input[, errors])
 
    Encodes the object *input* and returns a tuple (output object, length consumed).
-   Encoding converts a string object to a bytes object using a particular
+   For instance, :term:`text encoding` converts
+   a string object to a bytes object using a particular
    character set encoding (e.g., ``cp1252`` or ``iso-8859-1``).
 
-   *errors* defines the error handling to apply. It defaults to ``'strict'``
-   handling.
+   The *errors* argument defines the error handling to apply.
+   It defaults to ``'strict'`` handling.
 
    The method may not store state in the :class:`Codec` instance. Use
    :class:`StreamCodec` for codecs which have to keep state in order to make
@@ -409,14 +446,16 @@
 .. method:: Codec.decode(input[, errors])
 
    Decodes the object *input* and returns a tuple (output object, length
-   consumed).  Decoding converts a bytes object encoded using a particular
+   consumed).  For instance, for a :term:`text encoding`, decoding converts
+   a bytes object encoded using a particular
    character set encoding to a string object.
 
-   *input* must be a bytes object or one which provides the read-only character
+   For text encodings and bytes-to-bytes codecs,
+   *input* must be a bytes object or one which provides the read-only
    buffer interface -- for example, buffer objects and memory mapped files.
 
-   *errors* defines the error handling to apply. It defaults to ``'strict'``
-   handling.
+   The *errors* argument defines the error handling to apply.
+   It defaults to ``'strict'`` handling.
 
    The method may not store state in the :class:`Codec` instance. Use
    :class:`StreamCodec` for codecs which have to keep state in order to make
@@ -425,6 +464,10 @@
    The decoder must be able to handle zero length input and return an empty object
    of the output object type in this situation.
 
+
+Incremental Encoding and Decoding
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
 The :class:`IncrementalEncoder` and :class:`IncrementalDecoder` classes provide
 the basic interface for incremental encoding and decoding. Encoding/decoding the
 input isn't done with one call to the stateless encoder/decoder function, but
@@ -442,14 +485,14 @@
 .. _incremental-encoder-objects:
 
 IncrementalEncoder Objects
-^^^^^^^^^^^^^^^^^^^^^^^^^^
+~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 The :class:`IncrementalEncoder` class is used for encoding an input in multiple
 steps. It defines the following methods which every incremental encoder must
 define in order to be compatible with the Python codec registry.
 
 
-.. class:: IncrementalEncoder([errors])
+.. class:: IncrementalEncoder(errors='strict')
 
    Constructor for an :class:`IncrementalEncoder` instance.
 
@@ -458,26 +501,14 @@
    the Python codec registry.
 
    The :class:`IncrementalEncoder` may implement different error handling schemes
-   by providing the *errors* keyword argument. These parameters are predefined:
-
-   * ``'strict'`` Raise :exc:`ValueError` (or a subclass); this is the default.
-
-   * ``'ignore'`` Ignore the character and continue with the next.
-
-   * ``'replace'`` Replace with a suitable replacement character
-
-   * ``'xmlcharrefreplace'`` Replace with the appropriate XML character reference
-
-   * ``'backslashreplace'`` Replace with backslashed escape sequences.
+   by providing the *errors* keyword argument. See :ref:`error-handlers` for
+   possible values.
 
    The *errors* argument will be assigned to an attribute of the same name.
    Assigning to this attribute makes it possible to switch between different error
    handling strategies during the lifetime of the :class:`IncrementalEncoder`
    object.
 
-   The set of allowed values for the *errors* argument can be extended with
-   :func:`register_error`.
-
 
    .. method:: encode(object[, final])
 
@@ -489,7 +520,8 @@
    .. method:: reset()
 
       Reset the encoder to the initial state. The output is discarded: call
-      ``.encode('', final=True)`` to reset the encoder and to get the output.
+      ``.encode(object, final=True)``, passing an empty byte or text string
+      if necessary, to reset the encoder and to get the output.
 
 
 .. method:: IncrementalEncoder.getstate()
@@ -510,14 +542,14 @@
 .. _incremental-decoder-objects:
 
 IncrementalDecoder Objects
-^^^^^^^^^^^^^^^^^^^^^^^^^^
+~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 The :class:`IncrementalDecoder` class is used for decoding an input in multiple
 steps. It defines the following methods which every incremental decoder must
 define in order to be compatible with the Python codec registry.
 
 
-.. class:: IncrementalDecoder([errors])
+.. class:: IncrementalDecoder(errors='strict')
 
    Constructor for an :class:`IncrementalDecoder` instance.
 
@@ -526,22 +558,14 @@
    the Python codec registry.
 
    The :class:`IncrementalDecoder` may implement different error handling schemes
-   by providing the *errors* keyword argument. These parameters are predefined:
-
-   * ``'strict'`` Raise :exc:`ValueError` (or a subclass); this is the default.
-
-   * ``'ignore'`` Ignore the character and continue with the next.
-
-   * ``'replace'`` Replace with a suitable replacement character.
+   by providing the *errors* keyword argument. See :ref:`error-handlers` for
+   possible values.
 
    The *errors* argument will be assigned to an attribute of the same name.
    Assigning to this attribute makes it possible to switch between different error
    handling strategies during the lifetime of the :class:`IncrementalDecoder`
    object.
 
-   The set of allowed values for the *errors* argument can be extended with
-   :func:`register_error`.
-
 
    .. method:: decode(object[, final])
 
@@ -580,6 +604,10 @@
       returned by :meth:`getstate`.
 
 
+Stream Encoding and Decoding
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+
 The :class:`StreamWriter` and :class:`StreamReader` classes provide generic
 working interfaces which can be used to implement new encoding submodules very
 easily. See :mod:`encodings.utf_8` for an example of how this is done.
@@ -588,14 +616,14 @@
 .. _stream-writer-objects:
 
 StreamWriter Objects
-^^^^^^^^^^^^^^^^^^^^
+~~~~~~~~~~~~~~~~~~~~
 
 The :class:`StreamWriter` class is a subclass of :class:`Codec` and defines the
 following methods which every stream writer must define in order to be
 compatible with the Python codec registry.
 
 
-.. class:: StreamWriter(stream[, errors])
+.. class:: StreamWriter(stream, errors='strict')
 
    Constructor for a :class:`StreamWriter` instance.
 
@@ -603,29 +631,17 @@
    additional keyword arguments, but only the ones defined here are used by the
    Python codec registry.
 
-   *stream* must be a file-like object open for writing binary data.
+   The *stream* argument must be a file-like object open for writing
+   text or binary data, as appropriate for the specific codec.
 
    The :class:`StreamWriter` may implement different error handling schemes by
-   providing the *errors* keyword argument. These parameters are predefined:
-
-   * ``'strict'`` Raise :exc:`ValueError` (or a subclass); this is the default.
-
-   * ``'ignore'`` Ignore the character and continue with the next.
-
-   * ``'replace'`` Replace with a suitable replacement character
-
-   * ``'xmlcharrefreplace'`` Replace with the appropriate XML character reference
-
-   * ``'backslashreplace'`` Replace with backslashed escape sequences.
+   providing the *errors* keyword argument. See :ref:`error-handlers` for
+   the standard error handlers the underlying stream codec may support.
 
    The *errors* argument will be assigned to an attribute of the same name.
    Assigning to this attribute makes it possible to switch between different error
    handling strategies during the lifetime of the :class:`StreamWriter` object.
 
-   The set of allowed values for the *errors* argument can be extended with
-   :func:`register_error`.
-
-
    .. method:: write(object)
 
       Writes the object's contents encoded to the stream.
@@ -634,7 +650,8 @@
    .. method:: writelines(list)
 
       Writes the concatenated list of strings to the stream (possibly by reusing
-      the :meth:`write` method).
+      the :meth:`write` method). The standard bytes-to-bytes codecs
+      do not support this method.
 
 
    .. method:: reset()
@@ -653,14 +670,14 @@
 .. _stream-reader-objects:
 
 StreamReader Objects
-^^^^^^^^^^^^^^^^^^^^
+~~~~~~~~~~~~~~~~~~~~
 
 The :class:`StreamReader` class is a subclass of :class:`Codec` and defines the
 following methods which every stream reader must define in order to be
 compatible with the Python codec registry.
 
 
-.. class:: StreamReader(stream[, errors])
+.. class:: StreamReader(stream, errors='strict')
 
    Constructor for a :class:`StreamReader` instance.
 
@@ -668,16 +685,12 @@
    additional keyword arguments, but only the ones defined here are used by the
    Python codec registry.
 
-   *stream* must be a file-like object open for reading (binary) data.
+   The *stream* argument must be a file-like object open for reading
+   text or binary data, as appropriate for the specific codec.
 
    The :class:`StreamReader` may implement different error handling schemes by
-   providing the *errors* keyword argument. These parameters are defined:
-
-   * ``'strict'`` Raise :exc:`ValueError` (or a subclass); this is the default.
-
-   * ``'ignore'`` Ignore the character and continue with the next.
-
-   * ``'replace'`` Replace with a suitable replacement character.
+   providing the *errors* keyword argument. See :ref:`error-handlers` for
+   the standard error handlers the underlying stream codec may support.
 
    The *errors* argument will be assigned to an attribute of the same name.
    Assigning to this attribute makes it possible to switch between different error
@@ -691,17 +704,20 @@
 
       Decodes data from the stream and returns the resulting object.
 
-      *chars* indicates the number of characters to read from the
-      stream. :func:`read` will never return more than *chars* characters, but
-      it might return less, if there are not enough characters available.
+      The *chars* argument indicates the number of decoded
+      code points or bytes to return. The :func:`read` method will
+      never return more data than requested, but it might return less,
+      if there is not enough available.
 
-      *size* indicates the approximate maximum number of bytes to read from the
-      stream for decoding purposes. The decoder can modify this setting as
+      The *size* argument indicates the approximate maximum
+      number of encoded bytes or code points to read
+      for decoding. The decoder can modify this setting as
       appropriate. The default value -1 indicates to read and decode as much as
-      possible.  *size* is intended to prevent having to decode huge files in
-      one step.
+      possible.  This parameter is intended to
+      prevent having to decode huge files in one step.
 
-      *firstline* indicates that it would be sufficient to only return the first
+      The *firstline* flag indicates that
+      it would be sufficient to only return the first
       line, if there are decoding errors on later lines.
 
       The method should use a greedy read strategy meaning that it should read
@@ -744,17 +760,13 @@
 In addition to the above methods, the :class:`StreamReader` must also inherit
 all other methods and attributes from the underlying stream.
 
-The next two base classes are included for convenience. They are not needed by
-the codec registry, but may provide useful in practice.
-
-
 .. _stream-reader-writer:
 
 StreamReaderWriter Objects
-^^^^^^^^^^^^^^^^^^^^^^^^^^
+~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-The :class:`StreamReaderWriter` allows wrapping streams which work in both read
-and write modes.
+The :class:`StreamReaderWriter` is a convenience class that allows wrapping
+streams which work in both read and write modes.
 
 The design is such that one can use the factory functions returned by the
 :func:`lookup` function to construct the instance.
@@ -775,9 +787,9 @@
 .. _stream-recoder-objects:
 
 StreamRecoder Objects
-^^^^^^^^^^^^^^^^^^^^^
+~~~~~~~~~~~~~~~~~~~~~
 
-The :class:`StreamRecoder` provide a frontend - backend view of encoding data
+The :class:`StreamRecoder` translates data from one encoding to another,
 which is sometimes useful when dealing with different encoding environments.
 
 The design is such that one can use the factory functions returned by the
@@ -787,22 +799,20 @@
 .. class:: StreamRecoder(stream, encode, decode, Reader, Writer, errors)
 
    Creates a :class:`StreamRecoder` instance which implements a two-way conversion:
-   *encode* and *decode* work on the frontend (the input to :meth:`read` and output
-   of :meth:`write`) while *Reader* and *Writer* work on the backend (reading and
-   writing to the stream).
+   *encode* and *decode* work on the frontend — the data visible to
+   code calling :meth:`read` and :meth:`write`, while *Reader* and *Writer*
+   work on the backend — the data in *stream*.
 
-   You can use these objects to do transparent direct recodings from e.g. Latin-1
+   You can use these objects to do transparent transcodings from e.g. Latin-1
    to UTF-8 and back.
 
-   *stream* must be a file-like object.
+   The *stream* argument must be a file-like object.
 
-   *encode*, *decode* must adhere to the :class:`Codec` interface. *Reader*,
+   The *encode* and *decode* arguments must
+   adhere to the :class:`Codec` interface. *Reader* and
    *Writer* must be factory functions or classes providing objects of the
    :class:`StreamReader` and :class:`StreamWriter` interface respectively.
 
-   *encode* and *decode* are needed for the frontend translation, *Reader* and
-   *Writer* for the backend translation.
-
    Error handling is done in the same way as defined for the stream readers and
    writers.
 
@@ -817,31 +827,34 @@
 Encodings and Unicode
 ---------------------
 
-Strings are stored internally as sequences of codepoints in range ``0 - 10FFFF``
-(see :pep:`393` for more details about the implementation).
-Once a string object is used outside of CPU and memory, CPU endianness
-and how these arrays are stored as bytes become an issue.  Transforming a
-string object into a sequence of bytes is called encoding and recreating the
-string object from the sequence of bytes is known as decoding.  There are many
-different methods for how this transformation can be done (these methods are
-also called encodings). The simplest method is to map the codepoints 0-255 to
-the bytes ``0x0``-``0xff``. This means that a string object that contains
-codepoints above ``U+00FF`` can't be encoded with this method (which is called
-``'latin-1'`` or ``'iso-8859-1'``). :func:`str.encode` will raise a
-:exc:`UnicodeEncodeError` that looks like this: ``UnicodeEncodeError: 'latin-1'
-codec can't encode character '\u1234' in position 3: ordinal not in
-range(256)``.
+Strings are stored internally as sequences of code points in
+range ``0x0``-``0x10FFFF``.  (See :pep:`393` for
+more details about the implementation.)
+Once a string object is used outside of CPU and memory, endianness
+and how these arrays are stored as bytes become an issue.  As with other
+codecs, serialising a string into a sequence of bytes is known as *encoding*,
+and recreating the string from the sequence of bytes is known as *decoding*.
+There are a variety of different text serialisation codecs, which are
+collectivity referred to as :term:`text encodings <text encoding>`.
+
+The simplest text encoding (called ``'latin-1'`` or ``'iso-8859-1'``) maps
+the code points 0-255 to the bytes ``0x0``-``0xff``, which means that a string
+object that contains code points above ``U+00FF`` can't be encoded with this
+codec. Doing so will raise a :exc:`UnicodeEncodeError` that looks
+like the following (although the details of the error message may differ):
+``UnicodeEncodeError: 'latin-1' codec can't encode character '\u1234' in
+position 3: ordinal not in range(256)``.
 
 There's another group of encodings (the so called charmap encodings) that choose
-a different subset of all Unicode code points and how these codepoints are
+a different subset of all Unicode code points and how these code points are
 mapped to the bytes ``0x0``-``0xff``. To see how this is done simply open
 e.g. :file:`encodings/cp1252.py` (which is an encoding that is used primarily on
 Windows). There's a string constant with 256 characters that shows you which
 character is mapped to which byte value.
 
-All of these encodings can only encode 256 of the 1114112 codepoints
+All of these encodings can only encode 256 of the 1114112 code points
 defined in Unicode. A simple and straightforward way that can store each Unicode
-code point, is to store each codepoint as four consecutive bytes. There are two
+code point, is to store each code point as four consecutive bytes. There are two
 possibilities: store the bytes in big endian or in little endian order. These
 two encodings are called ``UTF-32-BE`` and ``UTF-32-LE`` respectively. Their
 disadvantage is that if e.g. you use ``UTF-32-BE`` on a little endian machine you
@@ -966,6 +979,10 @@
 +-----------------+--------------------------------+--------------------------------+
 | cp037           | IBM037, IBM039                 | English                        |
 +-----------------+--------------------------------+--------------------------------+
+| cp273           | 273, IBM273, csIBM273          | German                         |
+|                 |                                |                                |
+|                 |                                | .. versionadded:: 3.4          |
++-----------------+--------------------------------+--------------------------------+
 | cp424           | EBCDIC-CP-HE, IBM424           | Hebrew                         |
 +-----------------+--------------------------------+--------------------------------+
 | cp437           | 437, IBM437                    | English                        |
@@ -1022,6 +1039,10 @@
 +-----------------+--------------------------------+--------------------------------+
 | cp1026          | ibm1026                        | Turkish                        |
 +-----------------+--------------------------------+--------------------------------+
+| cp1125          | 1125, ibm1125, cp866u, ruscii  | Ukrainian                      |
+|                 |                                |                                |
+|                 |                                | .. versionadded:: 3.4          |
++-----------------+--------------------------------+--------------------------------+
 | cp1140          | ibm1140                        | Western Europe                 |
 +-----------------+--------------------------------+--------------------------------+
 | cp1250          | windows-1250                   | Central and Eastern Europe     |
@@ -1167,6 +1188,13 @@
 | utf_8_sig       |                                | all languages                  |
 +-----------------+--------------------------------+--------------------------------+
 
+.. versionchanged:: 3.4
+   The utf-16\* and utf-32\* encoders no longer allow surrogate code points
+   (``U+D800``--``U+DFFF``) to be encoded.
+   The utf-32\* decoders no longer decode
+   byte sequences that correspond to surrogate code points.
+
+
 Python Specific Encodings
 -------------------------
 
@@ -1177,6 +1205,9 @@
 arbitrary data transforms rather than just text encodings).  For asymmetric
 codecs, the stated purpose describes the encoding direction.
 
+Text Encodings
+^^^^^^^^^^^^^^
+
 The following codecs provide :class:`str` to :class:`bytes` encoding and
 :term:`bytes-like object` to :class:`str` decoding, similar to the Unicode text
 encodings.
@@ -1188,7 +1219,9 @@
 +====================+=========+===========================+
 | idna               |         | Implements :rfc:`3490`,   |
 |                    |         | see also                  |
-|                    |         | :mod:`encodings.idna`     |
+|                    |         | :mod:`encodings.idna`.    |
+|                    |         | Only ``errors='strict'``  |
+|                    |         | is supported.             |
 +--------------------+---------+---------------------------+
 | mbcs               | dbcs    | Windows only: Encode      |
 |                    |         | operand according to the  |
@@ -1196,84 +1229,125 @@
 +--------------------+---------+---------------------------+
 | palmos             |         | Encoding of PalmOS 3.5    |
 +--------------------+---------+---------------------------+
-| punycode           |         | Implements :rfc:`3492`    |
+| punycode           |         | Implements :rfc:`3492`.   |
+|                    |         | Stateful codecs are not   |
+|                    |         | supported.                |
 +--------------------+---------+---------------------------+
-| raw_unicode_escape |         | Produce a string that is  |
-|                    |         | suitable as raw Unicode   |
-|                    |         | literal in Python source  |
-|                    |         | code                      |
+| raw_unicode_escape |         | Latin-1 encoding with     |
+|                    |         | ``\uXXXX`` and            |
+|                    |         | ``\UXXXXXXXX`` for other  |
+|                    |         | code points. Existing     |
+|                    |         | backslashes are not       |
+|                    |         | escaped in any way.       |
+|                    |         | It is used in the Python  |
+|                    |         | pickle protocol.          |
 +--------------------+---------+---------------------------+
 | undefined          |         | Raise an exception for    |
-|                    |         | all conversions. Can be   |
-|                    |         | used as the system        |
-|                    |         | encoding if no automatic  |
-|                    |         | coercion between byte and |
-|                    |         | Unicode strings is        |
-|                    |         | desired.                  |
+|                    |         | all conversions, even     |
+|                    |         | empty strings. The error  |
+|                    |         | handler is ignored.       |
 +--------------------+---------+---------------------------+
-| unicode_escape     |         | Produce a string that is  |
-|                    |         | suitable as Unicode       |
-|                    |         | literal in Python source  |
-|                    |         | code                      |
+| unicode_escape     |         | Encoding suitable as the  |
+|                    |         | contents of a Unicode     |
+|                    |         | literal in ASCII-encoded  |
+|                    |         | Python source code,       |
+|                    |         | except that quotes are    |
+|                    |         | not escaped. Decodes from |
+|                    |         | Latin-1 source code.      |
+|                    |         | Beware that Python source |
+|                    |         | code actually uses UTF-8  |
+|                    |         | by default.               |
 +--------------------+---------+---------------------------+
 | unicode_internal   |         | Return the internal       |
 |                    |         | representation of the     |
-|                    |         | operand                   |
+|                    |         | operand. Stateful codecs  |
+|                    |         | are not supported.        |
 |                    |         |                           |
 |                    |         | .. deprecated:: 3.3       |
+|                    |         |    This representation is |
+|                    |         |    obsoleted by           |
+|                    |         |    :pep:`393`.            |
 +--------------------+---------+---------------------------+
 
-The following codecs provide :term:`bytes-like object` to :class:`bytes`
-mappings.
+.. _binary-transforms:
+
+Binary Transforms
+^^^^^^^^^^^^^^^^^
+
+The following codecs provide binary transforms: :term:`bytes-like object`
+to :class:`bytes` mappings.  They are not supported by :meth:`bytes.decode`
+(which only produces :class:`str` output).
 
 
-.. tabularcolumns:: |l|L|L|
+.. tabularcolumns:: |l|L|L|L|
 
-+----------------------+---------------------------+------------------------------+
-| Codec                | Purpose                   | Encoder/decoder              |
-+======================+===========================+==============================+
-| base64_codec [#b64]_ | Convert operand to MIME   | :meth:`base64.b64encode`,    |
-|                      | base64 (the result always | :meth:`base64.b64decode`     |
-|                      | includes a trailing       |                              |
-|                      | ``'\n'``)                 |                              |
-+----------------------+---------------------------+------------------------------+
-| bz2_codec            | Compress the operand      | :meth:`bz2.compress`,        |
-|                      | using bz2                 | :meth:`bz2.decompress`       |
-+----------------------+---------------------------+------------------------------+
-| hex_codec            | Convert operand to        | :meth:`base64.b16encode`,    |
-|                      | hexadecimal               | :meth:`base64.b16decode`     |
-|                      | representation, with two  |                              |
-|                      | digits per byte           |                              |
-+----------------------+---------------------------+------------------------------+
-| quopri_codec         | Convert operand to MIME   | :meth:`quopri.encodestring`, |
-|                      | quoted printable          | :meth:`quopri.decodestring`  |
-+----------------------+---------------------------+------------------------------+
-| uu_codec             | Convert the operand using | :meth:`uu.encode`,           |
-|                      | uuencode                  | :meth:`uu.decode`            |
-+----------------------+---------------------------+------------------------------+
-| zlib_codec           | Compress the operand      | :meth:`zlib.compress`,       |
-|                      | using gzip                | :meth:`zlib.decompress`      |
-+----------------------+---------------------------+------------------------------+
++----------------------+------------------+------------------------------+------------------------------+
+| Codec                | Aliases          | Purpose                      | Encoder / decoder            |
++======================+==================+==============================+==============================+
+| base64_codec [#b64]_ | base64, base_64  | Convert operand to MIME      | :meth:`base64.b64encode` /   |
+|                      |                  | base64 (the result always    | :meth:`base64.b64decode`     |
+|                      |                  | includes a trailing          |                              |
+|                      |                  | ``'\n'``)                    |                              |
+|                      |                  |                              |                              |
+|                      |                  | .. versionchanged:: 3.4      |                              |
+|                      |                  |    accepts any               |                              |
+|                      |                  |    :term:`bytes-like object` |                              |
+|                      |                  |    as input for encoding and |                              |
+|                      |                  |    decoding                  |                              |
++----------------------+------------------+------------------------------+------------------------------+
+| bz2_codec            | bz2              | Compress the operand         | :meth:`bz2.compress` /       |
+|                      |                  | using bz2                    | :meth:`bz2.decompress`       |
++----------------------+------------------+------------------------------+------------------------------+
+| hex_codec            | hex              | Convert operand to           | :meth:`base64.b16encode` /   |
+|                      |                  | hexadecimal                  | :meth:`base64.b16decode`     |
+|                      |                  | representation, with two     |                              |
+|                      |                  | digits per byte              |                              |
++----------------------+------------------+------------------------------+------------------------------+
+| quopri_codec         | quopri,          | Convert operand to MIME      | :meth:`quopri.encodestring` /|
+|                      | quotedprintable, | quoted printable             | :meth:`quopri.decodestring`  |
+|                      | quoted_printable |                              |                              |
++----------------------+------------------+------------------------------+------------------------------+
+| uu_codec             | uu               | Convert the operand using    | :meth:`uu.encode` /          |
+|                      |                  | uuencode                     | :meth:`uu.decode`            |
++----------------------+------------------+------------------------------+------------------------------+
+| zlib_codec           | zip, zlib        | Compress the operand         | :meth:`zlib.compress` /      |
+|                      |                  | using gzip                   | :meth:`zlib.decompress`      |
++----------------------+------------------+------------------------------+------------------------------+
 
-.. [#b64] Rather than accepting any :term:`bytes-like object`,
-   ``'base64_codec'`` accepts only :class:`bytes` and :class:`bytearray` for
-   encoding and only :class:`bytes`, :class:`bytearray`, and ASCII-only
-   instances of :class:`str` for decoding
-
-
-The following codecs provide :class:`str` to :class:`str` mappings.
-
-.. tabularcolumns:: |l|L|
-
-+--------------------+---------------------------+
-| Codec              | Purpose                   |
-+====================+===========================+
-| rot_13             | Returns the Caesar-cypher |
-|                    | encryption of the operand |
-+--------------------+---------------------------+
+.. [#b64] In addition to :term:`bytes-like objects <bytes-like object>`,
+   ``'base64_codec'`` also accepts ASCII-only instances of :class:`str` for
+   decoding
 
 .. versionadded:: 3.2
-   bytes-to-bytes and str-to-str codecs.
+   Restoration of the binary transforms.
+
+.. versionchanged:: 3.4
+   Restoration of the aliases for the binary transforms.
+
+
+.. _text-transforms:
+
+Text Transforms
+^^^^^^^^^^^^^^^
+
+The following codec provides a text transform: a :class:`str` to :class:`str`
+mapping.  It is not supported by :meth:`str.encode` (which only produces
+:class:`bytes` output).
+
+.. tabularcolumns:: |l|l|L|
+
++--------------------+---------+---------------------------+
+| Codec              | Aliases | Purpose                   |
++====================+=========+===========================+
+| rot_13             | rot13   | Returns the Caesar-cypher |
+|                    |         | encryption of the operand |
++--------------------+---------+---------------------------+
+
+.. versionadded:: 3.2
+   Restoration of the ``rot_13`` text transform.
+
+.. versionchanged:: 3.4
+   Restoration of the ``rot13`` alias.
 
 
 :mod:`encodings.idna` --- Internationalized Domain Names in Applications
diff --git a/Doc/library/collections.abc.rst b/Doc/library/collections.abc.rst
index 4b21932..599e9fa 100644
--- a/Doc/library/collections.abc.rst
+++ b/Doc/library/collections.abc.rst
@@ -15,7 +15,7 @@
    import itertools
    __name__ = '<doctest>'
 
-**Source code:** :source:`Lib/collections/abc.py`
+**Source code:** :source:`Lib/_collections_abc.py`
 
 --------------
 
@@ -134,7 +134,7 @@
 
 Several of the ABCs are also useful as mixins that make it easier to develop
 classes supporting container APIs.  For example, to write a class supporting
-the full :class:`Set` API, it only necessary to supply the three underlying
+the full :class:`Set` API, it is only necessary to supply the three underlying
 abstract methods: :meth:`__contains__`, :meth:`__iter__`, and :meth:`__len__`.
 The ABC supplies the remaining methods such as :meth:`__and__` and
 :meth:`isdisjoint`::
@@ -173,7 +173,7 @@
 
 (2)
    To override the comparisons (presumably for speed, as the
-   semantics are fixed), redefine :meth:`__le__` and
+   semantics are fixed), redefine :meth:`__le__` and :meth:`__ge__`,
    then the other operations will automatically follow suit.
 
 (3)
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst
index 4def1dc..0acde12 100644
--- a/Doc/library/collections.rst
+++ b/Doc/library/collections.rst
@@ -76,14 +76,19 @@
         be modified to change which mappings are searched.  The list should
         always contain at least one mapping.
 
-    .. method:: new_child()
+    .. method:: new_child(m=None)
 
-        Returns a new :class:`ChainMap` containing a new :class:`dict` followed by
-        all of the maps in the current instance.  A call to ``d.new_child()`` is
-        equivalent to: ``ChainMap({}, *d.maps)``.  This method is used for
+        Returns a new :class:`ChainMap` containing a new map followed by
+        all of the maps in the current instance.  If ``m`` is specified,
+        it becomes the new map at the front of the list of mappings; if not
+        specified, an empty dict is used, so that a call to ``d.new_child()``
+        is equivalent to: ``ChainMap({}, *d.maps)``.  This method is used for
         creating subcontexts that can be updated without altering values in any
         of the parent mappings.
 
+        .. versionchanged:: 3.4
+           The optional ``m`` parameter was added.
+
     .. attribute:: parents
 
         Property returning a new :class:`ChainMap` containing all of the maps in
@@ -104,7 +109,7 @@
       writing to any mapping in the chain.
 
     * Django's `Context class
-      <http://code.djangoproject.com/browser/django/trunk/django/template/context.py>`_
+      <https://github.com/django/django/blob/master/django/template/context.py>`_
       for templating is a read-only chain of mappings.  It also features
       pushing and popping of contexts similar to the
       :meth:`~collections.ChainMap.new_child` method and the
@@ -369,10 +374,6 @@
 
 .. seealso::
 
-    * `Counter class <http://code.activestate.com/recipes/576611/>`_
-      adapted for Python 2.5 and an early `Bag recipe
-      <http://code.activestate.com/recipes/259174/>`_ for Python 2.4.
-
     * `Bag class <http://www.gnu.org/software/smalltalk/manual-base/html_node/Bag.html>`_
       in Smalltalk.
 
@@ -907,19 +908,18 @@
     >>> janes_account = default_account._replace(owner='Jane')
 
 Enumerated constants can be implemented with named tuples, but it is simpler
-and more efficient to use a simple class declaration:
+and more efficient to use a simple :class:`~enum.Enum`:
 
     >>> Status = namedtuple('Status', 'open pending closed')._make(range(3))
     >>> Status.open, Status.pending, Status.closed
     (0, 1, 2)
-    >>> class Status:
-        open, pending, closed = range(3)
+    >>> from enum import Enum
+    >>> class Status(Enum):
+    ...     open, pending, closed = range(3)
+
 
 .. seealso::
 
-    * `Named tuple recipe <http://code.activestate.com/recipes/500261/>`_
-      adapted for Python 2.4.
-
     * `Recipe for named tuple abstract base class with a metaclass mix-in
       <http://code.activestate.com/recipes/577629-namedtupleabc-abstract-base-class-mix-in-for-named/>`_
       by Jan Kaliszewski.  Besides providing an :term:`abstract base class` for
@@ -982,10 +982,6 @@
 keyword arguments, but their order is lost because Python's function call
 semantics pass-in keyword arguments using a regular unordered dictionary.
 
-.. seealso::
-
-    `Equivalent OrderedDict recipe <http://code.activestate.com/recipes/576693/>`_
-    that runs on Python 2.4 or later.
 
 :class:`OrderedDict` Examples and Recipes
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/Doc/library/compileall.rst b/Doc/library/compileall.rst
index b12c217..9712de2 100644
--- a/Doc/library/compileall.rst
+++ b/Doc/library/compileall.rst
@@ -4,6 +4,10 @@
 .. module:: compileall
    :synopsis: Tools for byte-compiling all Python source files in a directory tree.
 
+**Source code:** :source:`Lib/compileall.py`
+
+--------------
+
 
 This module provides some utility functions to support installing Python
 libraries.  These functions compile Python source files in a directory tree.
@@ -20,7 +24,8 @@
 
 .. program:: compileall
 
-.. cmdoption:: [directory|file]...
+.. cmdoption:: directory ...
+               file ...
 
    Positional arguments are files to compile or directories that contain
    source files, traversed recursively.  If no argument is given, behave as if
diff --git a/Doc/library/concurrency.rst b/Doc/library/concurrency.rst
index f2a512f..0de281b 100644
--- a/Doc/library/concurrency.rst
+++ b/Doc/library/concurrency.rst
@@ -20,7 +20,6 @@
    subprocess.rst
    sched.rst
    queue.rst
-   select.rst
 
 
 The following are support modules for some of the above services:
diff --git a/Doc/library/concurrent.futures.rst b/Doc/library/concurrent.futures.rst
index 575b1ea..bd56696 100644
--- a/Doc/library/concurrent.futures.rst
+++ b/Doc/library/concurrent.futures.rst
@@ -164,6 +164,9 @@
 allows it to side-step the :term:`Global Interpreter Lock` but also means that
 only picklable objects can be executed and returned.
 
+The ``__main__`` module must be importable by worker subprocesses. This means
+that :class:`ProcessPoolExecutor` will not work in the interactive interpreter.
+
 Calling :class:`Executor` or :class:`Future` methods from a callable submitted
 to a :class:`ProcessPoolExecutor` will result in deadlock.
 
@@ -388,6 +391,8 @@
 Exception classes
 -----------------
 
+.. currentmodule:: concurrent.futures.process
+
 .. exception:: BrokenProcessPool
 
    Derived from :exc:`RuntimeError`, this exception class is raised when
diff --git a/Doc/library/constants.rst b/Doc/library/constants.rst
index 059a21d..42b5af2 100644
--- a/Doc/library/constants.rst
+++ b/Doc/library/constants.rst
@@ -26,9 +26,24 @@
 
 .. data:: NotImplemented
 
-   Special value which can be returned by the "rich comparison" special methods
-   (:meth:`__eq__`, :meth:`__lt__`, and friends), to indicate that the comparison
-   is not implemented with respect to the other type.
+   Special value which should be returned by the binary special methods
+   (e.g. :meth:`__eq__`, :meth:`__lt__`, :meth:`__add__`, :meth:`__rsub__`,
+   etc.) to indicate that the operation is not implemented with respect to
+   the other type; may be returned by the in-place binary special methods
+   (e.g. :meth:`__imul__`, :meth:`__iand__`, etc.) for the same purpose.
+   Its truth value is true.
+
+.. note::
+
+   When ``NotImplemented`` is returned, the interpreter will then try the
+   reflected operation on the other type, or some other fallback, depending
+   on the operator.  If all attempted operations return ``NotImplemented``, the
+   interpreter will raise an appropriate exception.
+
+   See
+   :ref:`implementing-the-arithmetic-operations`
+   for more details.
+
 
 
 .. data:: Ellipsis
diff --git a/Doc/library/contextlib.rst b/Doc/library/contextlib.rst
index fba48f4..6f36864 100644
--- a/Doc/library/contextlib.rst
+++ b/Doc/library/contextlib.rst
@@ -95,6 +95,83 @@
    ``page.close()`` will be called when the :keyword:`with` block is exited.
 
 
+.. function:: suppress(*exceptions)
+
+   Return a context manager that suppresses any of the specified exceptions
+   if they occur in the body of a with statement and then resumes execution
+   with the first statement following the end of the with statement.
+
+   As with any other mechanism that completely suppresses exceptions, this
+   context manager should be used only to cover very specific errors where
+   silently continuing with program execution is known to be the right
+   thing to do.
+
+   For example::
+
+       from contextlib import suppress
+
+       with suppress(FileNotFoundError):
+           os.remove('somefile.tmp')
+
+       with suppress(FileNotFoundError):
+           os.remove('someotherfile.tmp')
+
+   This code is equivalent to::
+
+       try:
+           os.remove('somefile.tmp')
+       except FileNotFoundError:
+           pass
+
+       try:
+           os.remove('someotherfile.tmp')
+       except FileNotFoundError:
+           pass
+
+   This context manager is :ref:`reentrant <reentrant-cms>`.
+
+   .. versionadded:: 3.4
+
+
+.. function:: redirect_stdout(new_target)
+
+   Context manager for temporarily redirecting :data:`sys.stdout` to
+   another file or file-like object.
+
+   This tool adds flexibility to existing functions or classes whose output
+   is hardwired to stdout.
+
+   For example, the output of :func:`help` normally is sent to *sys.stdout*.
+   You can capture that output in a string by redirecting the output to a
+   :class:`io.StringIO` object::
+
+        f = io.StringIO()
+        with redirect_stdout(f):
+            help(pow)
+        s = f.getvalue()
+
+   To send the output of :func:`help` to a file on disk, redirect the output
+   to a regular file::
+
+        with open('help.txt', 'w') as f:
+            with redirect_stdout(f):
+                help(pow)
+
+   To send the output of :func:`help` to *sys.stderr*::
+
+        with redirect_stdout(sys.stderr):
+            help(pow)
+
+   Note that the global side effect on :data:`sys.stdout` means that this
+   context manager is not suitable for use in library code and most threaded
+   applications. It also has no effect on the output of subprocesses.
+   However, it is still a useful approach for many utility scripts.
+
+   This context manager is :ref:`reentrant <reentrant-cms>`.
+
+   .. versionadded:: 3.4
+
+
 .. class:: ContextDecorator()
 
    A base class that enables a context manager to also be used as a decorator.
@@ -294,7 +371,7 @@
     with ExitStack() as stack:
         for resource in resources:
             stack.enter_context(resource)
-        if need_special resource:
+        if need_special_resource():
             special = acquire_special_resource()
             stack.callback(release_special_resource, special)
         # Perform operations that use the acquired resources
@@ -491,10 +568,10 @@
             self.name = name
 
         def __enter__(self):
-            logging.info('Entering: {}'.format(name))
+            logging.info('Entering: {}'.format(self.name))
 
         def __exit__(self, exc_type, exc, exc_tb):
-            logging.info('Exiting: {}'.format(name))
+            logging.info('Exiting: {}'.format(self.name))
 
 Instances of this class can be used as both a context manager::
 
@@ -520,3 +597,153 @@
       The specification, background, and examples for the Python :keyword:`with`
       statement.
 
+.. _single-use-reusable-and-reentrant-cms:
+
+Single use, reusable and reentrant context managers
+---------------------------------------------------
+
+Most context managers are written in a way that means they can only be
+used effectively in a :keyword:`with` statement once. These single use
+context managers must be created afresh each time they're used -
+attempting to use them a second time will trigger an exception or
+otherwise not work correctly.
+
+This common limitation means that it is generally advisable to create
+context managers directly in the header of the :keyword:`with` statement
+where they are used (as shown in all of the usage examples above).
+
+Files are an example of effectively single use context managers, since
+the first :keyword:`with` statement will close the file, preventing any
+further IO operations using that file object.
+
+Context managers created using :func:`contextmanager` are also single use
+context managers, and will complain about the underlying generator failing
+to yield if an attempt is made to use them a second time::
+
+    >>> from contextlib import contextmanager
+    >>> @contextmanager
+    ... def singleuse():
+    ...     print("Before")
+    ...     yield
+    ...     print("After")
+    ...
+    >>> cm = singleuse()
+    >>> with cm:
+    ...     pass
+    ...
+    Before
+    After
+    >>> with cm:
+    ...    pass
+    ...
+    Traceback (most recent call last):
+        ...
+    RuntimeError: generator didn't yield
+
+
+.. _reentrant-cms:
+
+Reentrant context managers
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+More sophisticated context managers may be "reentrant". These context
+managers can not only be used in multiple :keyword:`with` statements,
+but may also be used *inside* a :keyword:`with` statement that is already
+using the same context manager.
+
+:class:`threading.RLock` is an example of a reentrant context manager, as are
+:func:`suppress` and :func:`redirect_stdout`. Here's a very simple example of
+reentrant use::
+
+    >>> from contextlib import redirect_stdout
+    >>> from io import StringIO
+    >>> stream = StringIO()
+    >>> write_to_stream = redirect_stdout(stream)
+    >>> with write_to_stream:
+    ...     print("This is written to the stream rather than stdout")
+    ...     with write_to_stream:
+    ...         print("This is also written to the stream")
+    ...
+    >>> print("This is written directly to stdout")
+    This is written directly to stdout
+    >>> print(stream.getvalue())
+    This is written to the stream rather than stdout
+    This is also written to the stream
+
+Real world examples of reentrancy are more likely to involve multiple
+functions calling each other and hence be far more complicated than this
+example.
+
+Note also that being reentrant is *not* the same thing as being thread safe.
+:func:`redirect_stdout`, for example, is definitely not thread safe, as it
+makes a global modification to the system state by binding :data:`sys.stdout`
+to a different stream.
+
+
+.. _reusable-cms:
+
+Reusable context managers
+^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Distinct from both single use and reentrant context managers are "reusable"
+context managers (or, to be completely explicit, "reusable, but not
+reentrant" context managers, since reentrant context managers are also
+reusable). These context managers support being used multiple times, but
+will fail (or otherwise not work correctly) if the specific context manager
+instance has already been used in a containing with statement.
+
+:class:`threading.Lock` is an example of a reusable, but not reentrant,
+context manager (for a reentrant lock, it is necessary to use
+:class:`threading.RLock` instead).
+
+Another example of a reusable, but not reentrant, context manager is
+:class:`ExitStack`, as it invokes *all* currently registered callbacks
+when leaving any with statement, regardless of where those callbacks
+were added::
+
+    >>> from contextlib import ExitStack
+    >>> stack = ExitStack()
+    >>> with stack:
+    ...     stack.callback(print, "Callback: from first context")
+    ...     print("Leaving first context")
+    ...
+    Leaving first context
+    Callback: from first context
+    >>> with stack:
+    ...     stack.callback(print, "Callback: from second context")
+    ...     print("Leaving second context")
+    ...
+    Leaving second context
+    Callback: from second context
+    >>> with stack:
+    ...     stack.callback(print, "Callback: from outer context")
+    ...     with stack:
+    ...         stack.callback(print, "Callback: from inner context")
+    ...         print("Leaving inner context")
+    ...     print("Leaving outer context")
+    ...
+    Leaving inner context
+    Callback: from inner context
+    Callback: from outer context
+    Leaving outer context
+
+As the output from the example shows, reusing a single stack object across
+multiple with statements works correctly, but attempting to nest them
+will cause the stack to be cleared at the end of the innermost with
+statement, which is unlikely to be desirable behaviour.
+
+Using separate :class:`ExitStack` instances instead of reusing a single
+instance avoids that problem::
+
+    >>> from contextlib import ExitStack
+    >>> with ExitStack() as outer_stack:
+    ...     outer_stack.callback(print, "Callback: from outer context")
+    ...     with ExitStack() as inner_stack:
+    ...         inner_stack.callback(print, "Callback: from inner context")
+    ...         print("Leaving inner context")
+    ...     print("Leaving outer context")
+    ...
+    Leaving inner context
+    Callback: from inner context
+    Leaving outer context
+    Callback: from outer context
diff --git a/Doc/library/crypto.rst b/Doc/library/crypto.rst
index 469ede4..8ad24c8 100644
--- a/Doc/library/crypto.rst
+++ b/Doc/library/crypto.rst
@@ -25,6 +25,5 @@
 Hardcore cypherpunks will probably find the cryptographic modules written by
 A.M. Kuchling of further interest; the package contains modules for various
 encryption algorithms, most notably AES.  These modules are not distributed with
-Python but available separately.  See the URL
-http://www.pycrypto.org  for more information.
-
+Python but available separately.  See the URL http://www.pycrypto.org/ for more
+information.
diff --git a/Doc/library/csv.rst b/Doc/library/csv.rst
index ccc9dc6..9f7b58a 100644
--- a/Doc/library/csv.rst
+++ b/Doc/library/csv.rst
@@ -158,6 +158,18 @@
    the optional *restval* parameter.  Any other optional or keyword arguments
    are passed to the underlying :class:`reader` instance.
 
+   A short usage example::
+
+       >>> import csv
+       >>> with open('names.csv') as csvfile:
+       ...     reader = csv.DictReader(csvfile)
+       ...     for row in reader:
+       ...         print(row['first_name'], row['last_name'])
+       ...
+       Baked Beans
+       Lovely Spam
+       Wonderful Spam
+
 
 .. class:: DictWriter(csvfile, fieldnames, restval='', extrasaction='raise', \
                       dialect='excel', *args, **kwds)
@@ -180,6 +192,19 @@
    objects are not ordered, there is not enough information available to deduce
    the order in which the row should be written to the *csvfile*.
 
+   A short usage example::
+
+       import csv
+
+       with open('names.csv', 'w') as csvfile:
+           fieldnames = ['first_name', 'last_name']
+           writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
+
+           writer.writeheader()
+           writer.writerow({'first_name': 'Baked', 'last_name': 'Beans'})
+           writer.writerow({'first_name': 'Lovely', 'last_name': 'Spam'})
+           writer.writerow({'first_name': 'Wonderful', 'last_name': 'Spam'})
+
 
 .. class:: Dialect
 
diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst
index f46da85..588ac7c 100644
--- a/Doc/library/ctypes.rst
+++ b/Doc/library/ctypes.rst
@@ -1032,7 +1032,7 @@
    outside of Python's control (e.g. by the foreign code that calls the
    callback), ctypes creates a new dummy Python thread on every invocation. This
    behavior is correct for most purposes, but it means that values stored with
-   `threading.local` will *not* survive across different callbacks, even when
+   :class:`threading.local` will *not* survive across different callbacks, even when
    those calls are made from the same C thread.
 
 .. _ctypes-accessing-values-exported-from-dlls:
@@ -1386,11 +1386,16 @@
    The default mode which is used to load shared libraries.  On OSX 10.3, this is
    *RTLD_GLOBAL*, otherwise it is the same as *RTLD_LOCAL*.
 
-Instances of these classes have no public methods, however :meth:`__getattr__`
-and :meth:`__getitem__` have special behavior: functions exported by the shared
-library can be accessed as attributes of by index.  Please note that both
-:meth:`__getattr__` and :meth:`__getitem__` cache their result, so calling them
-repeatedly returns the same object each time.
+Instances of these classes have no public methods.  Functions exported by the
+shared library can be accessed as attributes or by index.  Please note that
+accessing the function through an attribute caches the result and therefore
+accessing it repeatedly returns the same object each time.  On the other hand,
+accessing it through an index returns a new object each time:
+
+   >>> libc.time == libc.time
+   True
+   >>> libc['time'] == libc['time']
+   False
 
 The following public attributes are available, their name starts with an
 underscore to not clash with exported function names:
@@ -1828,7 +1833,7 @@
 .. function:: find_msvcrt()
    :module: ctypes.util
 
-   Windows only: return the filename of the VC runtype library used by Python,
+   Windows only: return the filename of the VC runtime library used by Python,
    and by the extension modules.  If the name of the library cannot be
    determined, ``None`` is returned.
 
@@ -2330,11 +2335,6 @@
       and so on).  Later assignments to the :attr:`_fields_` class variable will
       raise an AttributeError.
 
-      Structure and union subclass constructors accept both positional and named
-      arguments.  Positional arguments are used to initialize the fields in the
-      same order as they appear in the :attr:`_fields_` definition, named
-      arguments are used to initialize the fields with the corresponding name.
-
       It is possible to defined sub-subclasses of structure types, they inherit
       the fields of the base class plus the :attr:`_fields_` defined in the
       sub-subclass, if any.
diff --git a/Doc/library/curses.rst b/Doc/library/curses.rst
index 314636e..f3e60b4 100644
--- a/Doc/library/curses.rst
+++ b/Doc/library/curses.rst
@@ -12,7 +12,7 @@
 de-facto standard for portable advanced terminal handling.
 
 While curses is most widely used in the Unix environment, versions are available
-for DOS, OS/2, and possibly other systems as well.  This extension module is
+for Windows, DOS, and possibly other systems as well.  This extension module is
 designed to match the API of ncurses, an open-source curses library hosted on
 Linux and the BSD variants of Unix.
 
diff --git a/Doc/library/datatypes.rst b/Doc/library/datatypes.rst
index d0382e0..48af082 100644
--- a/Doc/library/datatypes.rst
+++ b/Doc/library/datatypes.rst
@@ -30,3 +30,4 @@
    copy.rst
    pprint.rst
    reprlib.rst
+   enum.rst
diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst
index 065e850..7dd8613 100644
--- a/Doc/library/datetime.rst
+++ b/Doc/library/datetime.rst
@@ -170,10 +170,12 @@
    * ``0 <= seconds < 3600*24`` (the number of seconds in one day)
    * ``-999999999 <= days <= 999999999``
 
-   If any argument is a float and there are fractional microseconds, the fractional
-   microseconds left over from all arguments are combined and their sum is rounded
-   to the nearest microsecond.  If no argument is a float, the conversion and
-   normalization processes are exact (no information is lost).
+   If any argument is a float and there are fractional microseconds,
+   the fractional microseconds left over from all arguments are
+   combined and their sum is rounded to the nearest microsecond using
+   round-half-to-even tiebreaker.  If no argument is a float, the
+   conversion and normalization processes are exact (no information is
+   lost).
 
    If the normalized value of days lies outside the indicated range,
    :exc:`OverflowError` is raised.
@@ -556,7 +558,7 @@
    Return a 3-tuple, (ISO year, ISO week number, ISO weekday).
 
    The ISO calendar is a widely used variant of the Gregorian calendar. See
-   http://www.phys.uu.nl/~vgent/calendar/isocalendar.htm for a good
+   http://www.staff.science.uu.nl/~gent0113/calendar/isocalendar.htm for a good
    explanation.
 
    The ISO year consists of 52 or 53 full weeks, and where a week starts on a
@@ -1684,12 +1686,12 @@
 
 .. seealso::
 
-   `pytz <http://pypi.python.org/pypi/pytz/>`_
-      The standard library has no :class:`tzinfo` instances except for UTC, but
-      there exists a third-party library which brings the *IANA timezone
-      database* (also known as the Olson database) to Python: *pytz*.
+   `pytz <https://pypi.python.org/pypi/pytz/>`_
+      The standard library has :class:`timezone` class for handling arbitrary
+      fixed offsets from UTC and :attr:`timezone.utc` as UTC timezone instance.
 
-      *pytz* contains up-to-date information and its usage is recommended.
+      *pytz* library brings the *IANA timezone database* (also known as the
+      Olson database) to Python and its usage is recommended.
 
    `IANA timezone database <http://www.iana.org/time-zones>`_
       The Time Zone Database (often called tz or zoneinfo) contains code and
@@ -1726,6 +1728,8 @@
   *offset*, HH and MM are two digits of ``offset.hours`` and
   ``offset.minutes`` respectively.
 
+  .. versionadded:: 3.2
+
 .. method:: timezone.utcoffset(dt)
 
   Return the fixed value specified when the :class:`timezone` instance is
diff --git a/Doc/library/dbm.rst b/Doc/library/dbm.rst
index bd88f41..e6a82d6 100644
--- a/Doc/library/dbm.rst
+++ b/Doc/library/dbm.rst
@@ -73,33 +73,39 @@
 strings are used they are implicitly converted to the default encoding before
 being stored.
 
+These objects also support being used in a :keyword:`with` statement, which
+will automatically close them when done.
+
+.. versionchanged:: 3.4
+   Added native support for the context management protocol to the objects
+   returned by :func:`.open`.
+
 The following example records some hostnames and a corresponding title,  and
 then prints out the contents of the database::
 
    import dbm
 
    # Open database, creating it if necessary.
-   db = dbm.open('cache', 'c')
+   with dbm.open('cache', 'c') as db:
 
-   # Record some values
-   db[b'hello'] = b'there'
-   db['www.python.org'] = 'Python Website'
-   db['www.cnn.com'] = 'Cable News Network'
+       # Record some values
+       db[b'hello'] = b'there'
+       db['www.python.org'] = 'Python Website'
+       db['www.cnn.com'] = 'Cable News Network'
 
-   # Note that the keys are considered bytes now.
-   assert db[b'www.python.org'] == b'Python Website'
-   # Notice how the value is now in bytes.
-   assert db['www.cnn.com'] == b'Cable News Network'
+       # Note that the keys are considered bytes now.
+       assert db[b'www.python.org'] == b'Python Website'
+       # Notice how the value is now in bytes.
+       assert db['www.cnn.com'] == b'Cable News Network'
 
-   # Often-used methods of the dict interface work too.
-   print(db.get('python.org', b'not present'))
+       # Often-used methods of the dict interface work too.
+       print(db.get('python.org', b'not present'))
 
-   # Storing a non-string key or value will raise an exception (most
-   # likely a TypeError).
-   db['www.yahoo.com'] = 4
+       # Storing a non-string key or value will raise an exception (most
+       # likely a TypeError).
+       db['www.yahoo.com'] = 4
 
-   # Close when done.
-   db.close()
+   # db is automatically closed when leaving the with statement.
 
 
 .. seealso::
diff --git a/Doc/library/debug.rst b/Doc/library/debug.rst
index c69fb1c..88a2fa6 100644
--- a/Doc/library/debug.rst
+++ b/Doc/library/debug.rst
@@ -15,3 +15,4 @@
    profile.rst
    timeit.rst
    trace.rst
+   tracemalloc.rst
diff --git a/Doc/library/development.rst b/Doc/library/development.rst
index 2368769..06e7048 100644
--- a/Doc/library/development.rst
+++ b/Doc/library/development.rst
@@ -23,4 +23,3 @@
    unittest.mock-examples.rst
    2to3.rst
    test.rst
-   venv.rst
diff --git a/Doc/library/difflib.rst b/Doc/library/difflib.rst
index 81dc0f1..5f72ea6 100644
--- a/Doc/library/difflib.rst
+++ b/Doc/library/difflib.rst
@@ -226,8 +226,8 @@
 
    :file:`Tools/scripts/ndiff.py` is a command-line front-end to this function.
 
-      >>> diff = ndiff('one\ntwo\nthree\n'.splitlines(1),
-      ...              'ore\ntree\nemu\n'.splitlines(1))
+      >>> diff = ndiff('one\ntwo\nthree\n'.splitlines(keepends=True),
+      ...              'ore\ntree\nemu\n'.splitlines(keepends=True))
       >>> print(''.join(diff), end="")
       - one
       ?  ^
@@ -250,8 +250,8 @@
 
    Example:
 
-      >>> diff = ndiff('one\ntwo\nthree\n'.splitlines(1),
-      ...              'ore\ntree\nemu\n'.splitlines(1))
+      >>> diff = ndiff('one\ntwo\nthree\n'.splitlines(keepends=True),
+      ...              'ore\ntree\nemu\n'.splitlines(keepends=True))
       >>> diff = list(diff) # materialize the generated delta into a list
       >>> print(''.join(restore(diff, 1)), end="")
       one
@@ -323,9 +323,9 @@
 
 .. seealso::
 
-   `Pattern Matching: The Gestalt Approach <http://www.ddj.com/184407970?pgno=5>`_
+   `Pattern Matching: The Gestalt Approach <http://www.drdobbs.com/database/pattern-matching-the-gestalt-approach/184407970>`_
       Discussion of a similar algorithm by John W. Ratcliff and D. E. Metzener. This
-      was published in `Dr. Dobb's Journal <http://www.ddj.com/>`_ in July, 1988.
+      was published in `Dr. Dobb's Journal <http://www.drdobbs.com/>`_ in July, 1988.
 
 
 .. _sequence-matcher:
@@ -650,7 +650,7 @@
    ...   2. Explicit is better than implicit.
    ...   3. Simple is better than complex.
    ...   4. Complex is better than complicated.
-   ... '''.splitlines(1)
+   ... '''.splitlines(keepends=True)
    >>> len(text1)
    4
    >>> text1[0][-1]
@@ -659,7 +659,7 @@
    ...   3.   Simple is better than complex.
    ...   4. Complicated is better than complex.
    ...   5. Flat is better than nested.
-   ... '''.splitlines(1)
+   ... '''.splitlines(keepends=True)
 
 Next we instantiate a Differ object:
 
diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst
index ec7112d..1b7cfe1 100644
--- a/Doc/library/dis.rst
+++ b/Doc/library/dis.rst
@@ -26,7 +26,8 @@
    def myfunc(alist):
        return len(alist)
 
-the following command can be used to get the disassembly of :func:`myfunc`::
+the following command can be used to display the disassembly of
+:func:`myfunc`::
 
    >>> dis.dis(myfunc)
      2           0 LOAD_GLOBAL              0 (len)
@@ -36,8 +37,77 @@
 
 (The "2" is a line number).
 
-The :mod:`dis` module defines the following functions and constants:
+Bytecode analysis
+-----------------
 
+.. versionadded:: 3.4
+
+The bytecode analysis API allows pieces of Python code to be wrapped in a
+:class:`Bytecode` object that provides easy access to details of the
+compiled code.
+
+.. class:: Bytecode(x, *, first_line=None, current_offset=None)
+
+   Analyse the bytecode corresponding to a function, method, string of
+   source code, or a code object (as returned by :func:`compile`).
+
+   This is a convenience wrapper around many of the functions listed below,
+   most notably :func:`get_instructions`, as iterating over a
+   :class:`Bytecode` instance yields the bytecode operations as
+   :class:`Instruction` instances.
+
+   If *first_line* is not None, it indicates the line number that should
+   be reported for the first source line in the disassembled code.
+   Otherwise, the source line information (if any) is taken directly from
+   the disassembled code object.
+
+   If *current_offset* is not None, it refers to an instruction offset
+   in the disassembled code. Setting this means :meth:`dis` will display
+   a "current instruction" marker against the specified opcode.
+
+   .. classmethod:: from_traceback(tb)
+
+      Construct a :class:`Bytecode` instance from the given traceback,
+      setting *current_offset* to the instruction responsible for the
+      exception.
+
+   .. data:: codeobj
+
+      The compiled code object.
+
+   .. data:: first_line
+
+      The first source line of the code object (if available)
+
+   .. method:: dis()
+
+      Return a formatted view of the bytecode operations (the same as
+      printed by :func:`dis`, but returned as a multi-line string).
+
+   .. method:: info()
+
+      Return a formatted multi-line string with detailed information about the
+      code object, like :func:`code_info`.
+
+Example::
+
+    >>> bytecode = dis.Bytecode(myfunc)
+    >>> for instr in bytecode:
+    ...     print(instr.opname)
+    ...
+    LOAD_GLOBAL
+    LOAD_FAST
+    CALL_FUNCTION
+    RETURN_VALUE
+
+
+Analysis functions
+------------------
+
+The :mod:`dis` module also defines the following analysis functions that
+convert the input directly to the desired output. They can be useful if
+only a single operation is being performed, so the intermediate analysis
+object isn't useful:
 
 .. function:: code_info(x)
 
@@ -51,17 +121,22 @@
    .. versionadded:: 3.2
 
 
-.. function:: show_code(x)
+.. function:: show_code(x, *, file=None)
 
    Print detailed code object information for the supplied function, method,
-   source code string or code object to stdout.
+   source code string or code object to *file* (or ``sys.stdout`` if *file*
+   is not specified).
 
-   This is a convenient shorthand for ``print(code_info(x))``, intended for
-   interactive exploration at the interpreter prompt.
+   This is a convenient shorthand for ``print(code_info(x), file=file)``,
+   intended for interactive exploration at the interpreter prompt.
 
    .. versionadded:: 3.2
 
-.. function:: dis(x=None)
+   .. versionchanged:: 3.4
+      Added *file* parameter.
+
+
+.. function:: dis(x=None, *, file=None)
 
    Disassemble the *x* object.  *x* can denote either a module, a class, a
    method, a function, a code object, a string of source code or a byte sequence
@@ -72,16 +147,28 @@
    disassembled.  If no object is provided, this function disassembles the last
    traceback.
 
+   The disassembly is written as text to the supplied *file* argument if
+   provided and to ``sys.stdout`` otherwise.
 
-.. function:: distb(tb=None)
+   .. versionchanged:: 3.4
+      Added *file* parameter.
+
+
+.. function:: distb(tb=None, *, file=None)
 
    Disassemble the top-of-stack function of a traceback, using the last
    traceback if none was passed.  The instruction causing the exception is
    indicated.
 
+   The disassembly is written as text to the supplied *file* argument if
+   provided and to ``sys.stdout`` otherwise.
 
-.. function:: disassemble(code, lasti=-1)
-              disco(code, lasti=-1)
+   .. versionchanged:: 3.4
+      Added *file* parameter.
+
+
+.. function:: disassemble(code, lasti=-1, *, file=None)
+              disco(code, lasti=-1, *, file=None)
 
    Disassemble a code object, indicating the last instruction if *lasti* was
    provided.  The output is divided in the following columns:
@@ -97,6 +184,28 @@
    The parameter interpretation recognizes local and global variable names,
    constant values, branch targets, and compare operators.
 
+   The disassembly is written as text to the supplied *file* argument if
+   provided and to ``sys.stdout`` otherwise.
+
+   .. versionchanged:: 3.4
+      Added *file* parameter.
+
+
+.. function:: get_instructions(x, *, first_line=None)
+
+   Return an iterator over the instructions in the supplied function, method,
+   source code string or code object.
+
+   The iterator generates a series of :class:`Instruction` named tuples
+   giving the details of each operation in the supplied code.
+
+   If *first_line* is not None, it indicates the line number that should
+   be reported for the first source line in the disassembled code.
+   Otherwise, the source line information (if any) is taken directly from
+   the disassembled code object.
+
+   .. versionadded:: 3.4
+
 
 .. function:: findlinestarts(code)
 
@@ -111,61 +220,67 @@
    return a list of these offsets.
 
 
-.. data:: opname
+.. function:: stack_effect(opcode, [oparg])
 
-   Sequence of operation names, indexable using the bytecode.
+   Compute the stack effect of *opcode* with argument *oparg*.
 
-
-.. data:: opmap
-
-   Dictionary mapping operation names to bytecodes.
-
-
-.. data:: cmp_op
-
-   Sequence of all compare operation names.
-
-
-.. data:: hasconst
-
-   Sequence of bytecodes that have a constant parameter.
-
-
-.. data:: hasfree
-
-   Sequence of bytecodes that access a free variable.
-
-
-.. data:: hasname
-
-   Sequence of bytecodes that access an attribute by name.
-
-
-.. data:: hasjrel
-
-   Sequence of bytecodes that have a relative jump target.
-
-
-.. data:: hasjabs
-
-   Sequence of bytecodes that have an absolute jump target.
-
-
-.. data:: haslocal
-
-   Sequence of bytecodes that access a local variable.
-
-
-.. data:: hascompare
-
-   Sequence of bytecodes of Boolean operations.
-
+   .. versionadded:: 3.4
 
 .. _bytecodes:
 
 Python Bytecode Instructions
 ----------------------------
 
+The :func:`get_instructions` function and :class:`Bytecode` class provide
+details of bytecode instructions as :class:`Instruction` instances:
+
+.. class:: Instruction
+
+   Details for a bytecode operation
+
+   .. data:: opcode
+
+      numeric code for operation, corresponding to the opcode values listed
+      below and the bytecode values in the :ref:`opcode_collections`.
+
+
+   .. data:: opname
+
+      human readable name for operation
+
+
+   .. data:: arg
+
+      numeric argument to operation (if any), otherwise None
+
+
+   .. data:: argval
+
+      resolved arg value (if known), otherwise same as arg
+
+
+   .. data:: argrepr
+
+      human readable description of operation argument
+
+
+   .. data:: offset
+
+      start index of operation within bytecode sequence
+
+
+   .. data:: starts_line
+
+      line started by this opcode (if any), otherwise None
+
+
+   .. data:: is_jump_target
+
+      ``True`` if other code jumps to here, otherwise ``False``
+
+   .. versionadded:: 3.4
+
+
 The Python compiler currently generates the following bytecode instructions.
 
 
@@ -387,7 +502,7 @@
 
    Implements the expression statement for the interactive mode.  TOS is removed
    from the stack and printed.  In non-interactive mode, an expression statement is
-   terminated with ``POP_STACK``.
+   terminated with :opcode:`POP_TOP`.
 
 
 .. opcode:: BREAK_LOOP
@@ -398,7 +513,7 @@
 .. opcode:: CONTINUE_LOOP (target)
 
    Continues a loop due to a :keyword:`continue` statement.  *target* is the
-   address to jump to (which should be a ``FOR_ITER`` instruction).
+   address to jump to (which should be a :opcode:`FOR_ITER` instruction).
 
 
 .. opcode:: SET_ADD (i)
@@ -416,7 +531,8 @@
    Calls ``dict.setitem(TOS1[-i], TOS, TOS1)``.  Used to implement dict
    comprehensions.
 
-For all of the SET_ADD, LIST_APPEND and MAP_ADD instructions, while the
+For all of the :opcode:`SET_ADD`, :opcode:`LIST_APPEND` and :opcode:`MAP_ADD`
+instructions, while the
 added value or key/value pair is popped off, the container object remains on
 the stack so that it is available for further iterations of the loop.
 
@@ -469,7 +585,7 @@
 .. opcode:: LOAD_BUILD_CLASS
 
    Pushes :func:`builtins.__build_class__` onto the stack.  It is later called
-   by ``CALL_FUNCTION`` to construct a class.
+   by :opcode:`CALL_FUNCTION` to construct a class.
 
 
 .. opcode:: SETUP_WITH (delta)
@@ -500,26 +616,20 @@
 
    If the stack represents an exception, *and* the function call returns
    a 'true' value, this information is "zapped" and replaced with a single
-   ``WHY_SILENCED`` to prevent ``END_FINALLY`` from re-raising the exception.
+   ``WHY_SILENCED`` to prevent :opcode:`END_FINALLY` from re-raising the exception.
    (But non-local gotos will still be resumed.)
 
    .. XXX explain the WHY stuff!
 
 
-.. opcode:: STORE_LOCALS
-
-   Pops TOS from the stack and stores it as the current frame's ``f_locals``.
-   This is used in class construction.
-
-
 All of the following opcodes expect arguments.  An argument is two bytes, with
 the more significant byte last.
 
 .. opcode:: STORE_NAME (namei)
 
    Implements ``name = TOS``. *namei* is the index of *name* in the attribute
-   :attr:`co_names` of the code object. The compiler tries to use ``STORE_FAST``
-   or ``STORE_GLOBAL`` if possible.
+   :attr:`co_names` of the code object. The compiler tries to use :opcode:`STORE_FAST`
+   or :opcode:`STORE_GLOBAL` if possible.
 
 
 .. opcode:: DELETE_NAME (namei)
@@ -559,12 +669,12 @@
 
 .. opcode:: STORE_GLOBAL (namei)
 
-   Works as ``STORE_NAME``, but stores the name as a global.
+   Works as :opcode:`STORE_NAME`, but stores the name as a global.
 
 
 .. opcode:: DELETE_GLOBAL (namei)
 
-   Works as ``DELETE_NAME``, but deletes a global name.
+   Works as :opcode:`DELETE_NAME`, but deletes a global name.
 
 
 .. opcode:: LOAD_CONST (consti)
@@ -585,12 +695,12 @@
 
 .. opcode:: BUILD_LIST (count)
 
-   Works as ``BUILD_TUPLE``, but creates a list.
+   Works as :opcode:`BUILD_TUPLE`, but creates a list.
 
 
 .. opcode:: BUILD_SET (count)
 
-   Works as ``BUILD_TUPLE``, but creates a set.
+   Works as :opcode:`BUILD_TUPLE`, but creates a set.
 
 
 .. opcode:: BUILD_MAP (count)
@@ -615,7 +725,7 @@
    Imports the module ``co_names[namei]``.  TOS and TOS1 are popped and provide
    the *fromlist* and *level* arguments of :func:`__import__`.  The module
    object is pushed onto the stack.  The current namespace is not affected:
-   for a proper import statement, a subsequent ``STORE_FAST`` instruction
+   for a proper import statement, a subsequent :opcode:`STORE_FAST` instruction
    modifies the namespace.
 
 
@@ -623,7 +733,7 @@
 
    Loads the attribute ``co_names[namei]`` from the module found in TOS. The
    resulting object is pushed onto the stack, to be subsequently stored by a
-   ``STORE_FAST`` instruction.
+   :opcode:`STORE_FAST` instruction.
 
 
 .. opcode:: JUMP_FORWARD (delta)
@@ -722,6 +832,13 @@
    Pushes a reference to the object the cell contains on the stack.
 
 
+.. opcode:: LOAD_CLASSDEREF (i)
+
+   Much like :opcode:`LOAD_DEREF` but first checks the locals dictionary before
+   consulting the cell.  This is used for loading free variables in class
+   bodies.
+
+
 .. opcode:: STORE_DEREF (i)
 
    Stores TOS into the cell contained in slot *i* of the cell and free variable
@@ -795,21 +912,21 @@
 
 .. opcode:: CALL_FUNCTION_VAR (argc)
 
-   Calls a function. *argc* is interpreted as in ``CALL_FUNCTION``. The top element
+   Calls a function. *argc* is interpreted as in :opcode:`CALL_FUNCTION`. The top element
    on the stack contains the variable argument list, followed by keyword and
    positional arguments.
 
 
 .. opcode:: CALL_FUNCTION_KW (argc)
 
-   Calls a function. *argc* is interpreted as in ``CALL_FUNCTION``. The top element
+   Calls a function. *argc* is interpreted as in :opcode:`CALL_FUNCTION`. The top element
    on the stack contains the keyword arguments dictionary,  followed by explicit
    keyword and positional arguments.
 
 
 .. opcode:: CALL_FUNCTION_VAR_KW (argc)
 
-   Calls a function. *argc* is interpreted as in ``CALL_FUNCTION``.  The top
+   Calls a function. *argc* is interpreted as in :opcode:`CALL_FUNCTION`.  The top
    element on the stack contains the keyword arguments dictionary, followed by the
    variable-arguments tuple, followed by explicit keyword and positional arguments.
 
@@ -820,3 +937,62 @@
    which don't take arguments ``< HAVE_ARGUMENT`` and those which do ``>=
    HAVE_ARGUMENT``.
 
+.. _opcode_collections:
+
+Opcode collections
+------------------
+
+These collections are provided for automatic introspection of bytecode
+instructions:
+
+.. data:: opname
+
+   Sequence of operation names, indexable using the bytecode.
+
+
+.. data:: opmap
+
+   Dictionary mapping operation names to bytecodes.
+
+
+.. data:: cmp_op
+
+   Sequence of all compare operation names.
+
+
+.. data:: hasconst
+
+   Sequence of bytecodes that have a constant parameter.
+
+
+.. data:: hasfree
+
+   Sequence of bytecodes that access a free variable (note that 'free' in
+   this context refers to names in the current scope that are referenced by
+   inner scopes or names in outer scopes that are referenced from this scope.
+   It does *not* include references to global or builtin scopes).
+
+
+.. data:: hasname
+
+   Sequence of bytecodes that access an attribute by name.
+
+
+.. data:: hasjrel
+
+   Sequence of bytecodes that have a relative jump target.
+
+
+.. data:: hasjabs
+
+   Sequence of bytecodes that have an absolute jump target.
+
+
+.. data:: haslocal
+
+   Sequence of bytecodes that access a local variable.
+
+
+.. data:: hascompare
+
+   Sequence of bytecodes of Boolean operations.
diff --git a/Doc/library/distribution.rst b/Doc/library/distribution.rst
new file mode 100644
index 0000000..c4954d1
--- /dev/null
+++ b/Doc/library/distribution.rst
@@ -0,0 +1,14 @@
+***********************************
+Software Packaging and Distribution
+***********************************
+
+These libraries help you with publishing and installing Python software.
+While these modules are designed to work in conjunction with the
+`Python Package Index <https://pypi.python.org/pypi>`__, they can also be used
+with a local index server, or without any index server at all.
+
+.. toctree::
+
+   distutils.rst
+   ensurepip.rst
+   venv.rst
diff --git a/Doc/library/distutils.rst b/Doc/library/distutils.rst
index 6666a9b..e3d1314 100644
--- a/Doc/library/distutils.rst
+++ b/Doc/library/distutils.rst
@@ -12,14 +12,31 @@
 100%-pure Python, or may be extension modules written in C, or may be
 collections of Python packages which include modules coded in both Python and C.
 
+Most Python users will *not* want to use this module directly, but instead
+use the cross-version tools maintained by the Python Packaging Authority. In
+particular,
+`setuptools <https://setuptools.pypa.io/en/latest/setuptools.html>`__ is an
+enhanced alternative to :mod:`distutils` that provides:
 
-User documentation and API reference are provided in another document:
+* support for declaring project dependencies
+* additional mechanisms for configuring which files to include in source
+  releases (including plugins for integration with version control systems)
+* the ability to declare project "entry points", which can be used as the
+  basis for application plugin systems
+* the ability to automatically generate Windows command line executables at
+  installation time rather than needing to prebuild them
+* consistent behaviour across all supported Python versions
 
-.. seealso::
+The recommended `pip <https://pip.pypa.io/>`__ installer runs all
+``setup.py`` scripts with ``setuptools``, even if the script itself only
+imports ``distutils``. Refer to the
+`Python Packaging User Guide <https://packaging.python.org>`_ for more
+information.
 
-   :ref:`distutils-index`
-      The manual for developers and packagers of Python modules.  This describes
-      how to prepare :mod:`distutils`\ -based packages so that they may be
-      easily installed into an existing Python installation.  It also contains
-      instructions for end-users wanting to install a distutils-based package,
-      :ref:`install-index`.
+For the benefits of packaging tool authors and users seeking a deeper
+understanding of the details of the current packaging and distribution
+system, the legacy :mod:`distutils` based user documentation and API
+reference remain available:
+
+* :ref:`install-index`
+* :ref:`distutils-index`
diff --git a/Doc/library/doctest.rst b/Doc/library/doctest.rst
index 222c719..2e372de 100644
--- a/Doc/library/doctest.rst
+++ b/Doc/library/doctest.rst
@@ -278,6 +278,10 @@
 Any classes found are recursively searched similarly, to test docstrings in
 their contained methods and nested classes.
 
+.. impl-detail::
+   Prior to version 3.4, extension modules written in C were not fully
+   searched by doctest.
+
 
 .. _doctest-finding-examples:
 
@@ -495,7 +499,11 @@
 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
-:ref:`doctest directives <doctest-directives>`.
+:ref:`doctest directives <doctest-directives>`, and may be passed to the
+doctest command line interface via the ``-o`` option.
+
+.. versionadded:: 3.4
+   The ``-o`` command line option.
 
 The first group of options define test semantics, controlling aspects of how
 doctest decides whether actual output matches an example's expected output:
@@ -633,6 +641,19 @@
    the output is suppressed.
 
 
+.. data:: FAIL_FAST
+
+   When specified, exit after the first failing example and don't attempt to run
+   the remaining examples. Thus, the number of failures reported will be at most
+   1.  This flag may be useful during debugging, since examples after the first
+   failure won't even produce debugging output.
+
+   The doctest command line accepts the option ``-f`` as a shorthand for ``-o
+   FAIL_FAST``.
+
+   .. versionadded:: 3.4
+
+
 .. data:: REPORTING_FLAGS
 
    A bitmask or'ing together all the reporting flags above.
@@ -844,8 +865,8 @@
    nothing at the end.  In verbose mode, the summary is detailed, else the summary
    is very brief (in fact, empty if all tests passed).
 
-   Optional argument *optionflags* or's together option flags.  See section
-   :ref:`doctest-options`.
+   Optional argument *optionflags* (default value 0) takes the bitwise-or of
+   option flags.  See section :ref:`doctest-options`.
 
    Optional argument *raise_on_error* defaults to false.  If true, an exception is
    raised upon the first failure or unexpected exception in an example.  This
@@ -1076,7 +1097,7 @@
 
    Set the :mod:`doctest` reporting flags to use.
 
-   Argument *flags* or's together option flags.  See section
+   Argument *flags* takes the bitwise-or of option flags.  See section
    :ref:`doctest-options`.  Only "reporting flags" can be used.
 
    This is a module-global setting, and affects all future doctests run by module
@@ -1269,9 +1290,8 @@
 
    A processing class used to extract the :class:`DocTest`\ s that are relevant to
    a given object, from its docstring and the docstrings of its contained objects.
-   :class:`DocTest`\ s can currently be extracted from the following object types:
-   modules, functions, classes, methods, staticmethods, classmethods, and
-   properties.
+   :class:`DocTest`\ s can be extracted from modules, classes, functions,
+   methods, staticmethods, classmethods, and properties.
 
    The optional argument *verbose* can be used to display the objects searched by
    the finder.  It defaults to ``False`` (no output).
diff --git a/Doc/library/email-examples.rst b/Doc/library/email-examples.rst
index 32cecf3..cbbcb78 100644
--- a/Doc/library/email-examples.rst
+++ b/Doc/library/email-examples.rst
@@ -40,6 +40,36 @@
 .. literalinclude:: ../includes/email-alternative.py
 
 
+.. _email-contentmanager-api-examples:
+
+Examples using the Provisional API
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Here is a reworking of the last example using the provisional API.  To make
+things a bit more interesting, we include a related image in the html part, and
+we save a copy of what we are going to send to disk, as well as sending it.
+
+This example also shows how easy it is to include non-ASCII, and simplifies the
+sending of the message using the :meth:`.send_message` method of the
+:mod:`smtplib` module.
+
+.. literalinclude:: ../includes/email-alternative-new-api.py
+
+If we were instead sent the message from the last example, here is one
+way we could process it:
+
+.. literalinclude:: ../includes/email-read-alternative-new-api.py
+
+Up to the prompt, the output from the above is::
+
+    To: Penelope Pussycat <"penelope@example.com">, Fabrette Pussycat <"fabrette@example.com">
+    From: Pepé Le Pew <pepe@example.com>
+    Subject: Ayons asperges pour le déjeuner
+
+    Salut!
+
+    Cela ressemble à un excellent recipie[1] déjeuner.
+
+
 .. rubric:: Footnotes
 
 .. [1] Thanks to Matthew Dixon Cowles for the original inspiration and examples.
diff --git a/Doc/library/email.contentmanager.rst b/Doc/library/email.contentmanager.rst
new file mode 100644
index 0000000..8f33a14
--- /dev/null
+++ b/Doc/library/email.contentmanager.rst
@@ -0,0 +1,434 @@
+:mod:`email.contentmanager`: Managing MIME Content
+--------------------------------------------------
+
+.. module:: email.contentmanager
+   :synopsis: Storing and Retrieving Content from MIME Parts
+
+.. moduleauthor:: R. David Murray <rdmurray@bitdance.com>
+.. sectionauthor:: R. David Murray <rdmurray@bitdance.com>
+
+
+.. note::
+
+   The contentmanager module has been included in the standard library on a
+   :term:`provisional basis <provisional package>`. Backwards incompatible
+   changes (up to and including removal of the module) may occur if deemed
+   necessary by the core developers.
+
+.. versionadded:: 3.4
+   as a :term:`provisional module <provisional package>`.
+
+The :mod:`~email.message` module provides a class that can represent an
+arbitrary email message.  That basic message model has a useful and flexible
+API, but it provides only a lower-level API for interacting with the generic
+parts of a message (the headers, generic header parameters, and the payload,
+which may be a list of sub-parts).  This module provides classes and tools
+that provide an enhanced and extensible API for dealing with various specific
+types of content, including the ability to retrieve the content of the message
+as a specialized object type rather than as a simple bytes object.  The module
+automatically takes care of the RFC-specified MIME details (required headers
+and parameters, etc.) for the certain common content types content properties,
+and support for additional types can be added by an application using the
+extension mechanisms.
+
+This module defines the eponymous "Content Manager" classes.  The base
+:class:`.ContentManager` class defines an API for registering content
+management functions which extract data from ``Message`` objects or insert data
+and headers into ``Message`` objects, thus providing a way of converting
+between ``Message`` objects containing data and other representations of that
+data (Python data types, specialized Python objects, external files, etc).  The
+module also defines one concrete content manager: :data:`raw_data_manager`
+converts between MIME content types and ``str`` or ``bytes`` data.  It also
+provides a convenient API for managing the MIME parameters when inserting
+content into ``Message``\ s.  It also handles inserting and extracting
+``Message`` objects when dealing with the ``message/rfc822`` content type.
+
+Another part of the enhanced interface is subclasses of
+:class:`~email.message.Message` that provide new convenience API functions,
+including convenience methods for calling the Content Managers derived from
+this module.
+
+.. note::
+
+   Although :class:`.EmailMessage` and :class:`.MIMEPart` are currently
+   documented in this module because of the provisional nature of the code, the
+   implementation lives in the :mod:`email.message` module.
+
+.. currentmodule:: email.message
+
+.. class:: EmailMessage(policy=default)
+
+   If *policy* is specified (it must be an instance of a :mod:`~email.policy`
+   class) use the rules it specifies to udpate and serialize the representation
+   of the message.  If *policy* is not set, use the
+   :class:`~email.policy.default` policy, which follows the rules of the email
+   RFCs except for line endings (instead of the RFC mandated ``\r\n``, it uses
+   the Python standard ``\n`` line endings).  For more information see the
+   :mod:`~email.policy` documentation.
+
+   This class is a subclass of :class:`~email.message.Message`.  It adds
+   the following methods:
+
+
+   .. method:: is_attachment
+
+      Return ``True`` if there is a :mailheader:`Content-Disposition` header
+      and its (case insensitive) value is ``attachment``, ``False`` otherwise.
+
+      .. versionchanged:: 3.4.2
+         is_attachment is now a method instead of a property, for consistency
+         with :meth:`~email.message.Message.is_multipart`.
+
+
+   .. method:: get_body(preferencelist=('related', 'html', 'plain'))
+
+      Return the MIME part that is the best candidate to be the "body" of the
+      message.
+
+      *preferencelist* must be a sequence of strings from the set ``related``,
+      ``html``, and ``plain``, and indicates the order of preference for the
+      content type of the part returned.
+
+      Start looking for candidate matches with the object on which the
+      ``get_body`` method is called.
+
+      If ``related`` is not included in *preferencelist*, consider the root
+      part (or subpart of the root part) of any related encountered as a
+      candidate if the (sub-)part matches a preference.
+
+      When encountering a ``multipart/related``, check the ``start`` parameter
+      and if a part with a matching :mailheader:`Content-ID` is found, consider
+      only it when looking for candidate matches.  Otherwise consider only the
+      first (default root) part of the ``multipart/related``.
+
+      If a part has a :mailheader:`Content-Disposition` header, only consider
+      the part a candidate match if the value of the header is ``inline``.
+
+      If none of the candidates matches any of the preferences in
+      *preferneclist*, return ``None``.
+
+      Notes: (1) For most applications the only *preferencelist* combinations
+      that really make sense are ``('plain',)``, ``('html', 'plain')``, and the
+      default, ``('related', 'html', 'plain')``.  (2) Because matching starts
+      with the object on which ``get_body`` is called, calling ``get_body`` on
+      a ``multipart/related`` will return the object itself unless
+      *preferencelist* has a non-default value. (3) Messages (or message parts)
+      that do not specify a :mailheader:`Content-Type` or whose
+      :mailheader:`Content-Type` header is invalid will be treated as if they
+      are of type ``text/plain``, which may occasionally cause ``get_body`` to
+      return unexpected results.
+
+
+   .. method:: iter_attachments()
+
+      Return an iterator over all of the parts of the message that are not
+      candidate "body" parts.  That is, skip the first occurrence of each of
+      ``text/plain``, ``text/html``, ``multipart/related``, or
+      ``multipart/alternative`` (unless they are explicitly marked as
+      attachments via :mailheader:`Content-Disposition: attachment`), and
+      return all remaining parts.  When applied directly to a
+      ``multipart/related``, return an iterator over the all the related parts
+      except the root part (ie: the part pointed to by the ``start`` parameter,
+      or the first part if there is no ``start`` parameter or the ``start``
+      parameter doesn't match the :mailheader:`Content-ID` of any of the
+      parts).  When applied directly to a ``multipart/alternative`` or a
+      non-``multipart``, return an empty iterator.
+
+
+   .. method:: iter_parts()
+
+      Return an iterator over all of the immediate sub-parts of the message,
+      which will be empty for a non-``multipart``.  (See also
+      :meth:`~email.message.walk`.)
+
+
+   .. method:: get_content(*args, content_manager=None, **kw)
+
+      Call the ``get_content`` method of the *content_manager*, passing self
+      as the message object, and passing along any other arguments or keywords
+      as additional arguments.  If *content_manager* is not specified, use
+      the ``content_manager`` specified by the current :mod:`~email.policy`.
+
+
+   .. method:: set_content(*args, content_manager=None, **kw)
+
+      Call the ``set_content`` method of the *content_manager*, passing self
+      as the message object, and passing along any other arguments or keywords
+      as additional arguments.  If *content_manager* is not specified, use
+      the ``content_manager`` specified by the current :mod:`~email.policy`.
+
+
+   .. method:: make_related(boundary=None)
+
+      Convert a non-``multipart`` message into a ``multipart/related`` message,
+      moving any existing :mailheader:`Content-` headers and payload into a
+      (new) first part of the ``multipart``.  If *boundary* is specified, use
+      it as the boundary string in the multipart, otherwise leave the boundary
+      to be automatically created when it is needed (for example, when the
+      message is serialized).
+
+
+   .. method:: make_alternative(boundary=None)
+
+      Convert a non-``multipart`` or a ``multipart/related`` into a
+      ``multipart/alternative``, moving any existing :mailheader:`Content-`
+      headers and payload into a (new) first part of the ``multipart``.  If
+      *boundary* is specified, use it as the boundary string in the multipart,
+      otherwise leave the boundary to be automatically created when it is
+      needed (for example, when the message is serialized).
+
+
+   .. method:: make_mixed(boundary=None)
+
+      Convert a non-``multipart``, a ``multipart/related``, or a
+      ``multipart-alternative`` into a ``multipart/mixed``, moving any existing
+      :mailheader:`Content-` headers and payload into a (new) first part of the
+      ``multipart``.  If *boundary* is specified, use it as the boundary string
+      in the multipart, otherwise leave the boundary to be automatically
+      created when it is needed (for example, when the message is serialized).
+
+
+   .. method:: add_related(*args, content_manager=None, **kw)
+
+      If the message is a ``multipart/related``, create a new message
+      object, pass all of the arguments to its :meth:`set_content` method,
+      and :meth:`~email.message.Message.attach` it to the ``multipart``.  If
+      the message is a non-``multipart``, call :meth:`make_related` and then
+      proceed as above.  If the message is any other type of ``multipart``,
+      raise a :exc:`TypeError`. If *content_manager* is not specified, use
+      the ``content_manager`` specified by the current :mod:`~email.policy`.
+      If the added part has no :mailheader:`Content-Disposition` header,
+      add one with the value ``inline``.
+
+
+   .. method:: add_alternative(*args, content_manager=None, **kw)
+
+      If the message is a ``multipart/alternative``, create a new message
+      object, pass all of the arguments to its :meth:`set_content` method, and
+      :meth:`~email.message.Message.attach` it to the ``multipart``.  If the
+      message is a non-``multipart`` or ``multipart/related``, call
+      :meth:`make_alternative` and then proceed as above.  If the message is
+      any other type of ``multipart``, raise a :exc:`TypeError`. If
+      *content_manager* is not specified, use the ``content_manager`` specified
+      by the current :mod:`~email.policy`.
+
+
+   .. method:: add_attachment(*args, content_manager=None, **kw)
+
+      If the message is a ``multipart/mixed``, create a new message object,
+      pass all of the arguments to its :meth:`set_content` method, and
+      :meth:`~email.message.Message.attach` it to the ``multipart``.  If the
+      message is a non-``multipart``, ``multipart/related``, or
+      ``multipart/alternative``, call :meth:`make_mixed` and then proceed as
+      above. If *content_manager* is not specified, use the ``content_manager``
+      specified by the current :mod:`~email.policy`.  If the added part
+      has no :mailheader:`Content-Disposition` header, add one with the value
+      ``attachment``.  This method can be used both for explicit attachments
+      (:mailheader:`Content-Disposition: attachment` and ``inline`` attachments
+      (:mailheader:`Content-Disposition: inline`), by passing appropriate
+      options to the ``content_manager``.
+
+
+   .. method:: clear()
+
+      Remove the payload and all of the headers.
+
+
+   .. method:: clear_content()
+
+      Remove the payload and all of the :exc:`Content-` headers, leaving
+      all other headers intact and in their original order.
+
+
+.. class:: MIMEPart(policy=default)
+
+    This class represents a subpart of a MIME message.  It is identical to
+    :class:`EmailMessage`, except that no :mailheader:`MIME-Version` headers are
+    added when :meth:`~EmailMessage.set_content` is called, since sub-parts do
+    not need their own :mailheader:`MIME-Version` headers.
+
+
+.. currentmodule:: email.contentmanager
+
+.. class:: ContentManager()
+
+   Base class for content managers.  Provides the standard registry mechanisms
+   to register converters between MIME content and other representations, as
+   well as the ``get_content`` and ``set_content`` dispatch methods.
+
+
+   .. method:: get_content(msg, *args, **kw)
+
+      Look up a handler function based on the ``mimetype`` of *msg* (see next
+      paragraph), call it, passing through all arguments, and return the result
+      of the call.  The expectation is that the handler will extract the
+      payload from *msg* and return an object that encodes information about
+      the extracted data.
+
+      To find the handler, look for the following keys in the registry,
+      stopping with the first one found:
+
+            * the string representing the full MIME type (``maintype/subtype``)
+            * the string representing the ``maintype``
+            * the empty string
+
+      If none of these keys produce a handler, raise a :exc:`KeyError` for the
+      full MIME type.
+
+
+   .. method:: set_content(msg, obj, *args, **kw)
+
+      If the ``maintype`` is ``multipart``, raise a :exc:`TypeError`; otherwise
+      look up a handler function based on the type of *obj* (see next
+      paragraph), call :meth:`~email.message.EmailMessage.clear_content` on the
+      *msg*, and call the handler function, passing through all arguments.  The
+      expectation is that the handler will transform and store *obj* into
+      *msg*, possibly making other changes to *msg* as well, such as adding
+      various MIME headers to encode information needed to interpret the stored
+      data.
+
+      To find the handler, obtain the type of *obj* (``typ = type(obj)``), and
+      look for the following keys in the registry, stopping with the first one
+      found:
+
+           * the type itself (``typ``)
+           * the type's fully qualified name (``typ.__module__ + '.' +
+             typ.__qualname__``).
+           * the type's qualname (``typ.__qualname__``)
+           * the type's name (``typ.__name__``).
+
+      If none of the above match, repeat all of the checks above for each of
+      the types in the :term:`MRO` (``typ.__mro__``).  Finally, if no other key
+      yields a handler, check for a handler for the key ``None``.  If there is
+      no handler for ``None``, raise a :exc:`KeyError` for the fully
+      qualified name of the type.
+
+      Also add a :mailheader:`MIME-Version` header if one is not present (see
+      also :class:`.MIMEPart`).
+
+
+   .. method:: add_get_handler(key, handler)
+
+      Record the function *handler* as the handler for *key*.  For the possible
+      values of *key*, see :meth:`get_content`.
+
+
+   .. method:: add_set_handler(typekey, handler)
+
+      Record *handler* as the function to call when an object of a type
+      matching *typekey* is passed to :meth:`set_content`.  For the possible
+      values of *typekey*, see :meth:`set_content`.
+
+
+Content Manager Instances
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Currently the email package provides only one concrete content manager,
+:data:`raw_data_manager`, although more may be added in the future.
+:data:`raw_data_manager` is the
+:attr:`~email.policy.EmailPolicy.content_manager` provided by
+:attr:`~email.policy.EmailPolicy` and its derivatives.
+
+
+.. data:: raw_data_manager
+
+   This content manager provides only a minimum interface beyond that provided
+   by :class:`~email.message.Message` itself:  it deals only with text, raw
+   byte strings, and :class:`~email.message.Message` objects.  Nevertheless, it
+   provides significant advantages compared to the base API: ``get_content`` on
+   a text part will return a unicode string without the application needing to
+   manually decode it, ``set_content`` provides a rich set of options for
+   controlling the headers added to a part and controlling the content transfer
+   encoding, and it enables the use of the various ``add_`` methods, thereby
+   simplifying the creation of multipart messages.
+
+   .. method:: get_content(msg, errors='replace')
+
+      Return the payload of the part as either a string (for ``text`` parts), a
+      :class:`~email.message.EmailMessage` object (for ``message/rfc822``
+      parts), or a ``bytes`` object (for all other non-multipart types).  Raise
+      a :exc:`KeyError` if called on a ``multipart``.  If the part is a
+      ``text`` part and *errors* is specified, use it as the error handler when
+      decoding the payload to unicode.  The default error handler is
+      ``replace``.
+
+   .. method:: set_content(msg, <'str'>, subtype="plain", charset='utf-8' \
+                           cte=None, \
+                           disposition=None, filename=None, cid=None, \
+                           params=None, headers=None)
+               set_content(msg, <'bytes'>, maintype, subtype, cte="base64", \
+                           disposition=None, filename=None, cid=None, \
+                           params=None, headers=None)
+               set_content(msg, <'Message'>, cte=None, \
+                           disposition=None, filename=None, cid=None, \
+                           params=None, headers=None)
+               set_content(msg, <'list'>, subtype='mixed', \
+                           disposition=None, filename=None, cid=None, \
+                           params=None, headers=None)
+
+       Add headers and payload to *msg*:
+
+       Add a :mailheader:`Content-Type` header with a ``maintype/subtype``
+       value.
+
+           * For ``str``, set the MIME ``maintype`` to ``text``, and set the
+             subtype to *subtype* if it is specified, or ``plain`` if it is not.
+           * For ``bytes``, use the specified *maintype* and *subtype*, or
+             raise a :exc:`TypeError` if they are not specified.
+           * For :class:`~email.message.Message` objects, set the maintype to
+             ``message``, and set the subtype to *subtype* if it is specified
+             or ``rfc822`` if it is not.  If *subtype* is ``partial``, raise an
+             error (``bytes`` objects must be used to construct
+             ``message/partial`` parts).
+           * For *<'list'>*, which should be a list of
+             :class:`~email.message.Message` objects, set the ``maintype`` to
+             ``multipart``, and the ``subtype`` to *subtype* if it is
+             specified, and ``mixed`` if it is not.  If the message parts in
+             the *<'list'>* have :mailheader:`MIME-Version` headers, remove
+             them.
+
+       If *charset* is provided (which is valid only for ``str``), encode the
+       string to bytes using the specified character set.  The default is
+       ``utf-8``.  If the specified *charset* is a known alias for a standard
+       MIME charset name, use the standard charset instead.
+
+       If *cte* is set, encode the payload using the specified content transfer
+       encoding, and set the :mailheader:`Content-Transfer-Endcoding` header to
+       that value.  For ``str`` objects, if it is not set use heuristics to
+       determine the most compact encoding.  Possible values for *cte* are
+       ``quoted-printable``, ``base64``, ``7bit``, ``8bit``, and ``binary``.
+       If the input cannot be encoded in the specified encoding (eg: ``7bit``),
+       raise a :exc:`ValueError`.  For :class:`~email.message.Message`, per
+       :rfc:`2046`, raise an error if a *cte* of ``quoted-printable`` or
+       ``base64`` is requested for *subtype* ``rfc822``, and for any *cte*
+       other than ``7bit`` for *subtype* ``external-body``.  For
+       ``message/rfc822``, use ``8bit`` if *cte* is not specified.  For all
+       other values of *subtype*, use ``7bit``.
+
+       .. note:: A *cte* of ``binary`` does not actually work correctly yet.
+          The ``Message`` object as modified by ``set_content`` is correct, but
+          :class:`~email.generator.BytesGenerator` does not serialize it
+          correctly.
+
+       If *disposition* is set, use it as the value of the
+       :mailheader:`Content-Disposition` header.  If not specified, and
+       *filename* is specified, add the header with the value ``attachment``.
+       If it is not specified and *filename* is also not specified, do not add
+       the header.  The only valid values for *disposition* are ``attachment``
+       and ``inline``.
+
+       If *filename* is specified, use it as the value of the ``filename``
+       parameter of the :mailheader:`Content-Disposition` header.  There is no
+       default.
+
+       If *cid* is specified, add a :mailheader:`Content-ID` header with
+       *cid* as its value.
+
+       If *params* is specified, iterate its ``items`` method and use the
+       resulting ``(key, value)`` pairs to set additional paramters on the
+       :mailheader:`Content-Type` header.
+
+       If *headers* is specified and is a list of strings of the form
+       ``headername: headervalue`` or a list of ``header`` objects
+       (distinguised from strings by having a ``name`` attribute), add the
+       headers to *msg*.
diff --git a/Doc/library/email.generator.rst b/Doc/library/email.generator.rst
index c172acb..48d41e1 100644
--- a/Doc/library/email.generator.rst
+++ b/Doc/library/email.generator.rst
@@ -112,7 +112,7 @@
 :mod:`email.message`.
 
 .. class:: BytesGenerator(outfp, mangle_from_=True, maxheaderlen=78, *, \
-                          policy=policy.default)
+                          policy=None)
 
    The constructor for the :class:`BytesGenerator` class takes a binary
    :term:`file-like object` called *outfp* for an argument.  *outfp* must
@@ -134,9 +134,11 @@
    wrapping.  The default is 78, as recommended (but not required) by
    :rfc:`2822`.
 
+
    The *policy* keyword specifies a :mod:`~email.policy` object that controls a
-   number of aspects of the generator's operation.  The default policy
-   maintains backward compatibility.
+   number of aspects of the generator's operation.  If no *policy* is specified,
+   then the *policy* attached to the message object passed to :attr:`flatten`
+   is used.
 
    .. versionchanged:: 3.3 Added the *policy* keyword.
 
@@ -174,7 +176,7 @@
 
       Optional *linesep* specifies the line separator character used to
       terminate lines in the output.  If specified it overrides the value
-      specified by the ``Generator``\ 's ``policy``.
+      specified by the ``Generator``\ or *msg*\ 's ``policy``.
 
    .. method:: clone(fp)
 
diff --git a/Doc/library/email.message.rst b/Doc/library/email.message.rst
index 3075e86..aeea942 100644
--- a/Doc/library/email.message.rst
+++ b/Doc/library/email.message.rst
@@ -33,23 +33,31 @@
 
 .. class:: Message(policy=compat32)
 
-   The *policy* argument determiens the :mod:`~email.policy` that will be used
-   to update the message model.  The default value, :class:`compat32
-   <email.policy.Compat32>` maintains backward compatibility with the
-   Python 3.2 version of the email package.  For more information see the
+   If *policy* is specified (it must be an instance of a :mod:`~email.policy`
+   class) use the rules it specifies to update and serialize the representation
+   of the message.  If *policy* is not set, use the :class:`compat32
+   <email.policy.Compat32>` policy, which maintains backward compatibility with
+   the Python 3.2 version of the email package.  For more information see the
    :mod:`~email.policy` documentation.
 
    .. versionchanged:: 3.3 The *policy* keyword argument was added.
 
 
-   .. method:: as_string(unixfrom=False, maxheaderlen=0)
+   .. method:: as_string(unixfrom=False, maxheaderlen=0, policy=None)
 
       Return the entire message flattened as a string.  When optional *unixfrom*
-      is ``True``, the envelope header is included in the returned string.
-      *unixfrom* defaults to ``False``.  Flattening the message may trigger
-      changes to the :class:`Message` if defaults need to be filled in to
-      complete the transformation to a string (for example, MIME boundaries may
-      be generated or modified).
+      is true, the envelope header is included in the returned string.
+      *unixfrom* defaults to ``False``.  For backward compabitility reasons,
+      *maxheaderlen* defaults to ``0``, so if you want a different value you
+      must override it explicitly (the value specified for *max_line_length* in
+      the policy will be ignored by this method).  The *policy* argument may be
+      used to override the default policy obtained from the message instance.
+      This can be used to control some of the formatting produced by the
+      method, since the specified *policy* will be passed to the ``Generator``.
+
+      Flattening the message may trigger changes to the :class:`Message` if
+      defaults need to be filled in to complete the transformation to a string
+      (for example, MIME boundaries may be generated or modified).
 
       Note that this method is provided as a convenience and may not always
       format the message the way you want.  For example, by default it does
@@ -65,17 +73,69 @@
          g.flatten(msg)
          text = fp.getvalue()
 
+      If the message object contains binary data that is not encoded according
+      to RFC standards, the non-compliant data will be replaced by unicode
+      "unknown character" code points.  (See also :meth:`.as_bytes` and
+      :class:`~email.generator.BytesGenerator`.)
+
+      .. versionchanged:: 3.4 the *policy* keyword argument was added.
+
 
    .. method:: __str__()
 
-      Equivalent to ``as_string(unixfrom=True)``.
+      Equivalent to :meth:`.as_string()`.  Allows ``str(msg)`` to produce a
+      string containing the formatted message.
+
+
+   .. method:: as_bytes(unixfrom=False, policy=None)
+
+      Return the entire message flattened as a bytes object.  When optional
+      *unixfrom* is true, the envelope header is included in the returned
+      string.  *unixfrom* defaults to ``False``.  The *policy* argument may be
+      used to override the default policy obtained from the message instance.
+      This can be used to control some of the formatting produced by the
+      method, since the specified *policy* will be passed to the
+      ``BytesGenerator``.
+
+      Flattening the message may trigger changes to the :class:`Message` if
+      defaults need to be filled in to complete the transformation to a string
+      (for example, MIME boundaries may be generated or modified).
+
+      Note that this method is provided as a convenience and may not always
+      format the message the way you want.  For example, by default it does
+      not do the mangling of lines that begin with ``From`` that is
+      required by the unix mbox format.  For more flexibility, instantiate a
+      :class:`~email.generator.BytesGenerator` instance and use its
+      :meth:`~email.generator.BytesGenerator.flatten` method directly.
+      For example::
+
+         from io import BytesIO
+         from email.generator import BytesGenerator
+         fp = BytesIO()
+         g = BytesGenerator(fp, mangle_from_=True, maxheaderlen=60)
+         g.flatten(msg)
+         text = fp.getvalue()
+
+      .. versionadded:: 3.4
+
+
+   .. method:: __bytes__()
+
+      Equivalent to :meth:`.as_bytes()`.  Allows ``bytes(msg)`` to produce a
+      bytes object containing the formatted message.
+
+      .. versionadded:: 3.4
 
 
    .. method:: is_multipart()
 
       Return ``True`` if the message's payload is a list of sub-\
       :class:`Message` objects, otherwise return ``False``.  When
-      :meth:`is_multipart` returns ``False``, the payload should be a string object.
+      :meth:`is_multipart` returns ``False``, the payload should be a string
+      object.  (Note that :meth:`is_multipart` returning ``True`` does not
+      necessarily mean that "msg.get_content_maintype() == 'multipart'" will
+      return the ``True``.   For example, ``is_multipart`` will return ``True``
+      when the :class:`Message` is of type ``message/rfc822``.)
 
 
    .. method:: set_unixfrom(unixfrom)
@@ -410,7 +470,8 @@
       to ``False``.
 
 
-   .. method:: set_param(param, value, header='Content-Type', requote=True, charset=None, language='')
+   .. method:: set_param(param, value, header='Content-Type', requote=True, \
+                         charset=None, language='', replace=False)
 
       Set a parameter in the :mailheader:`Content-Type` header.  If the
       parameter already exists in the header, its value will be replaced with
@@ -427,6 +488,12 @@
       language, defaulting to the empty string.  Both *charset* and *language*
       should be strings.
 
+      If *replace* is ``False`` (the default) the header is moved to the
+      end of the list of headers.  If *replace* is ``True``, the header
+      will be updated in place.
+
+      .. versionchanged:: 3.4 ``replace`` keyword was added.
+
 
    .. method:: del_param(param, header='content-type', requote=True)
 
@@ -521,23 +588,56 @@
       Here's an example that prints the MIME type of every part of a multipart
       message structure:
 
-       .. testsetup::
+      .. testsetup::
 
-            >>> from email import message_from_binary_file
-            >>> with open('Lib/test/test_email/data/msg_16.txt', 'rb') as f:
-            ...     msg = message_from_binary_file(f)
+         >>> from email import message_from_binary_file
+         >>> with open('Lib/test/test_email/data/msg_16.txt', 'rb') as f:
+         ...     msg = message_from_binary_file(f)
+         >>> from email.iterators import _structure
 
-       .. doctest::
+      .. doctest::
 
-            >>> for part in msg.walk():
-            ...     print(part.get_content_type())
-            multipart/report
-            text/plain
-            message/delivery-status
-            text/plain
-            text/plain
-            message/rfc822
-            text/plain
+         >>> for part in msg.walk():
+         ...     print(part.get_content_type())
+         multipart/report
+         text/plain
+         message/delivery-status
+         text/plain
+         text/plain
+         message/rfc822
+         text/plain
+
+      ``walk`` iterates over the subparts of any part where
+      :meth:`is_multipart` returns ``True``, even though
+      ``msg.get_content_maintype() == 'multipart'`` may return ``False``.  We
+      can see this in our example by making use of the ``_structure`` debug
+      helper function:
+
+      .. doctest::
+
+         >>> for part in msg.walk():
+         ...     print(part.get_content_maintype() == 'multipart'),
+         ...           part.is_multipart())
+         True True
+         False False
+         False True
+         False False
+         False False
+         False True
+         False False
+         >>> _structure(msg)
+         multipart/report
+             text/plain
+         message/delivery-status
+             text/plain
+             text/plain
+         message/rfc822
+             text/plain
+
+      Here the ``message`` parts are not ``multiparts``, but they do contain
+      subparts. ``is_multipart()`` returns ``True`` and ``walk`` descends
+      into the subparts.
+
 
    :class:`Message` objects can also optionally contain two instance attributes,
    which can be used when generating the plain text of a MIME message.
diff --git a/Doc/library/email.mime.rst b/Doc/library/email.mime.rst
index 4cdb322..1d70225 100644
--- a/Doc/library/email.mime.rst
+++ b/Doc/library/email.mime.rst
@@ -194,7 +194,7 @@
    minor type and defaults to :mimetype:`plain`.  *_charset* is the character
    set of the text and is passed as an argument to the
    :class:`~email.mime.nonmultipart.MIMENonMultipart` constructor; it defaults
-   to ``us-ascii`` if the string contains only ``ascii`` codepoints, and
+   to ``us-ascii`` if the string contains only ``ascii`` code points, and
    ``utf-8`` otherwise.
 
    Unless the *_charset* argument is explicitly set to ``None``, the
diff --git a/Doc/library/email.parser.rst b/Doc/library/email.parser.rst
index ee6af3f..ec74fe0 100644
--- a/Doc/library/email.parser.rst
+++ b/Doc/library/email.parser.rst
@@ -60,15 +60,18 @@
 Here is the API for the :class:`FeedParser`:
 
 
-.. class:: FeedParser(_factory=email.message.Message, *, policy=policy.default)
+.. class:: FeedParser(_factory=email.message.Message, *, policy=policy.compat32)
 
    Create a :class:`FeedParser` instance.  Optional *_factory* is a no-argument
    callable that will be called whenever a new message object is needed.  It
    defaults to the :class:`email.message.Message` class.
 
-   The *policy* keyword specifies a :mod:`~email.policy` object that controls a
-   number of aspects of the parser's operation.  The default policy maintains
-   backward compatibility.
+   If *policy* is specified (it must be an instance of a :mod:`~email.policy`
+   class) use the rules it specifies to update the representation of the
+   message.  If *policy* is not set, use the :class:`compat32
+   <email.policy.Compat32>` policy, which maintains backward compatibility with
+   the Python 3.2 version of the email package.  For more information see the
+   :mod:`~email.policy` documentation.
 
    .. versionchanged:: 3.3 Added the *policy* keyword.
 
@@ -113,7 +116,7 @@
    The BytesHeaderParser class.
 
 
-.. class:: Parser(_class=email.message.Message, *, policy=policy.default)
+.. class:: Parser(_class=email.message.Message, *, policy=policy.compat32)
 
    The constructor for the :class:`Parser` class takes an optional argument
    *_class*.  This must be a callable factory (such as a function or a class), and
@@ -121,9 +124,12 @@
    :class:`~email.message.Message` (see :mod:`email.message`).  The factory will
    be called without arguments.
 
-   The *policy* keyword specifies a :mod:`~email.policy` object that controls a
-   number of aspects of the parser's operation.  The default policy maintains
-   backward compatibility.
+   If *policy* is specified (it must be an instance of a :mod:`~email.policy`
+   class) use the rules it specifies to update the representation of the
+   message.  If *policy* is not set, use the :class:`compat32
+   <email.policy.Compat32>` policy, which maintains backward compatibility with
+   the Python 3.2 version of the email package.  For more information see the
+   :mod:`~email.policy` documentation.
 
    .. versionchanged:: 3.3
       Removed the *strict* argument that was deprecated in 2.4.  Added the
@@ -159,20 +165,23 @@
       Optional *headersonly* is as with the :meth:`parse` method.
 
 
-.. class:: BytesParser(_class=email.message.Message, *, policy=policy.default)
+.. class:: BytesParser(_class=email.message.Message, *, policy=policy.compat32)
 
    This class is exactly parallel to :class:`Parser`, but handles bytes input.
    The *_class* and *strict* arguments are interpreted in the same way as for
    the :class:`Parser` constructor.
 
-   The *policy* keyword specifies a :mod:`~email.policy` object that
-   controls a number of aspects of the parser's operation.  The default
-   policy maintains backward compatibility.
+   If *policy* is specified (it must be an instance of a :mod:`~email.policy`
+   class) use the rules it specifies to update the representation of the
+   message.  If *policy* is not set, use the :class:`compat32
+   <email.policy.Compat32>` policy, which maintains backward compatibility with
+   the Python 3.2 version of the email package.  For more information see the
+   :mod:`~email.policy` documentation.
 
    .. versionchanged:: 3.3
       Removed the *strict* argument.  Added the *policy* keyword.
 
-   .. method:: parse(fp, headeronly=False)
+   .. method:: parse(fp, headersonly=False)
 
       Read all the data from the binary file-like object *fp*, parse the
       resulting bytes, and return the message object.  *fp* must support
@@ -209,7 +218,7 @@
 .. currentmodule:: email
 
 .. function:: message_from_string(s, _class=email.message.Message, *, \
-                                  policy=policy.default)
+                                  policy=policy.compat32)
 
    Return a message object structure from a string.  This is exactly equivalent to
    ``Parser().parsestr(s)``.  *_class* and *policy* are interpreted as
@@ -219,7 +228,7 @@
       Removed the *strict* argument.  Added the *policy* keyword.
 
 .. function:: message_from_bytes(s, _class=email.message.Message, *, \
-                                 policy=policy.default)
+                                 policy=policy.compat32)
 
    Return a message object structure from a byte string.  This is exactly
    equivalent to ``BytesParser().parsebytes(s)``.  Optional *_class* and
@@ -231,7 +240,7 @@
       Removed the *strict* argument.  Added the *policy* keyword.
 
 .. function:: message_from_file(fp, _class=email.message.Message, *, \
-                                policy=policy.default)
+                                policy=policy.compat32)
 
    Return a message object structure tree from an open :term:`file object`.
    This is exactly equivalent to ``Parser().parse(fp)``.  *_class*
@@ -242,7 +251,7 @@
       Removed the *strict* argument.  Added the *policy* keyword.
 
 .. function:: message_from_binary_file(fp, _class=email.message.Message, *, \
-                                       policy=policy.default)
+                                       policy=policy.compat32)
 
    Return a message object structure tree from an open binary :term:`file
    object`.  This is exactly equivalent to ``BytesParser().parse(fp)``.
diff --git a/Doc/library/email.policy.rst b/Doc/library/email.policy.rst
index cb2023c..d4e3fc1 100644
--- a/Doc/library/email.policy.rst
+++ b/Doc/library/email.policy.rst
@@ -97,6 +97,17 @@
 ``sendmail's`` ``stdin``, where the default policy would use ``\n`` line
 separators.
 
+Some email package methods accept a *policy* keyword argument, allowing the
+policy to be overridden for that method.  For example, the following code uses
+the :meth:`~email.message.Message.as_bytes` method of the *msg* object from
+the previous example and writes the message to a file using the native line
+separators for the platform on which it is running::
+
+   >>> import os
+   >>> with open('converted.txt', 'wb') as f:
+   ...     f.write(msg.as_bytes(policy=msg.policy.clone(linesep=os.linesep)))
+   17
+
 Policy objects can also be combined using the addition operator, producing a
 policy object whose settings are a combination of the non-default values of the
 summed objects::
@@ -360,7 +371,7 @@
    to) :rfc:`5322`, :rfc:`2047`, and the current MIME RFCs.
 
    This policy adds new header parsing and folding algorithms.  Instead of
-   simple strings, headers are custom objects with custom attributes depending
+   simple strings, headers are ``str`` subclasses with attributes that depend
    on the type of the field.  The parsing and folding algorithm fully implement
    :rfc:`2047` and :rfc:`5322`.
 
@@ -397,6 +408,20 @@
       fields are treated as unstructured.  This list will be completed before
       the extension is marked stable.)
 
+   .. attribute:: content_manager
+
+      An object with at least two methods: get_content and set_content.  When
+      the :meth:`~email.message.Message.get_content` or
+      :meth:`~email.message.Message.set_content` method of a
+      :class:`~email.message.Message` object is called, it calls the
+      corresponding method of this object, passing it the message object as its
+      first argument, and any arguments or keywords that were passed to it as
+      additional arguments.  By default ``content_manager`` is set to
+      :data:`~email.contentmanager.raw_data_manager`.
+
+      .. versionadded:: 3.4
+
+
    The class provides the following concrete implementations of the abstract
    methods of :class:`Policy`:
 
@@ -416,7 +441,7 @@
       The name is returned unchanged.  If the input value has a ``name``
       attribute and it matches *name* ignoring case, the value is returned
       unchanged.  Otherwise the *name* and *value* are passed to
-      ``header_factory``, and the resulting custom header object is returned as
+      ``header_factory``, and the resulting header object is returned as
       the value.  In this case a ``ValueError`` is raised if the input value
       contains CR or LF characters.
 
@@ -424,7 +449,7 @@
 
       If the value has a ``name`` attribute, it is returned to unmodified.
       Otherwise the *name*, and the *value* with any CR or LF characters
-      removed, are passed to the ``header_factory``, and the resulting custom
+      removed, are passed to the ``header_factory``, and the resulting
       header object is returned.  Any surrogateescaped bytes get turned into
       the unicode unknown-character glyph.
 
@@ -434,9 +459,9 @@
       A value is considered to be a 'source value' if and only if it does not
       have a ``name`` attribute (having a ``name`` attribute means it is a
       header object of some sort).  If a source value needs to be refolded
-      according to the policy, it is converted into a custom header object by
+      according to the policy, it is converted into a header object by
       passing the *name* and the *value* with any CR and LF characters removed
-      to the ``header_factory``.  Folding of a custom header object is done by
+      to the ``header_factory``.  Folding of a header object is done by
       calling its ``fold`` method with the current policy.
 
       Source values are split into lines using :meth:`~str.splitlines`.  If
@@ -491,23 +516,23 @@
 the email package is changed from the Python 3.2 API in the following ways:
 
    * Setting a header on a :class:`~email.message.Message` results in that
-     header being parsed and a custom header object created.
+     header being parsed and a header object created.
 
    * Fetching a header value from a :class:`~email.message.Message` results
-     in that header being parsed and a custom header object created and
+     in that header being parsed and a header object created and
      returned.
 
-   * Any custom header object, or any header that is refolded due to the
+   * Any header object, or any header that is refolded due to the
      policy settings, is folded using an algorithm that fully implements the
      RFC folding algorithms, including knowing where encoded words are required
      and allowed.
 
 From the application view, this means that any header obtained through the
-:class:`~email.message.Message` is a custom header object with custom
+:class:`~email.message.Message` is a header object with extra
 attributes, whose string value is the fully decoded unicode value of the
 header.  Likewise, a header may be assigned a new value, or a new header
 created, using a unicode string, and the policy will take care of converting
 the unicode string into the correct RFC encoded form.
 
-The custom header objects and their attributes are described in
+The header objects and their attributes are described in
 :mod:`~email.headerregistry`.
diff --git a/Doc/library/email.rst b/Doc/library/email.rst
index a6cbbce..95c0a2f 100644
--- a/Doc/library/email.rst
+++ b/Doc/library/email.rst
@@ -53,6 +53,7 @@
    email.generator.rst
    email.policy.rst
    email.headerregistry.rst
+   email.contentmanager.rst
    email.mime.rst
    email.header.rst
    email.charset.rst
@@ -90,15 +91,19 @@
 +---------------+------------------------------+-----------------------+
 | :const:`2.5`  | Python 2.2.2+ and Python 2.3 | Python 2.1 to 2.5     |
 +---------------+------------------------------+-----------------------+
-| :const:`3.0`  | Python 2.4                   | Python 2.3 to 2.5     |
+| :const:`3.0`  | Python 2.4 and Python 2.5    | Python 2.3 to 2.6     |
 +---------------+------------------------------+-----------------------+
-| :const:`4.0`  | Python 2.5                   | Python 2.3 to 2.5     |
+| :const:`4.0`  | Python 2.5 to Python 2.7     | Python 2.3 to 2.7     |
 +---------------+------------------------------+-----------------------+
 | :const:`5.0`  | Python 3.0 and Python 3.1    | Python 3.0 to 3.2     |
 +---------------+------------------------------+-----------------------+
-| :const:`5.1`  | Python 3.2                   | Python 3.0 to 3.2     |
+| :const:`5.1`  | Python 3.2                   | Python 3.2            |
 +---------------+------------------------------+-----------------------+
 
+After Version 5.1 (Python 3.2), the email package no longer has a version that
+is separate from the Python version.  (See the :ref:`whatsnew-index` documents
+for the respective Python versions for details on changes.)
+
 Here are the major differences between :mod:`email` version 5.1 and
 version 5.0:
 
@@ -257,7 +262,7 @@
 -------------------------------
 
 The :mod:`email` package was originally prototyped as a separate library called
-`mimelib <http://mimelib.sf.net/>`_. Changes have been made so that method names
+`mimelib <http://mimelib.sourceforge.net/>`_. Changes have been made so that method names
 are more consistent, and some methods or modules have either been added or
 removed.  The semantics of some of the methods have also changed.  For the most
 part, any functionality available in :mod:`mimelib` is still available in the
diff --git a/Doc/library/email.util.rst b/Doc/library/email.util.rst
index f75975e..219e284 100644
--- a/Doc/library/email.util.rst
+++ b/Doc/library/email.util.rst
@@ -98,12 +98,9 @@
 
 .. function:: mktime_tz(tuple)
 
-   Turn a 10-tuple as returned by :func:`parsedate_tz` into a UTC timestamp.  It
-   the timezone item in the tuple is ``None``, assume local time.  Minor
-   deficiency: :func:`mktime_tz` interprets the first 8 elements of *tuple* as a
-   local time and then compensates for the timezone difference.  This may yield a
-   slight error around changes in daylight savings time, though not worth worrying
-   about for common use.
+   Turn a 10-tuple as returned by :func:`parsedate_tz` into a UTC
+   timestamp (seconds since the Epoch).  If the timezone item in the
+   tuple is ``None``, assume local time.
 
 
 .. function:: formatdate(timeval=None, localtime=False, usegmt=False)
@@ -210,4 +207,3 @@
 .. [#] Note that the sign of the timezone offset is the opposite of the sign of the
    ``time.timezone`` variable for the same timezone; the latter variable follows
    the POSIX standard while this module follows :rfc:`2822`.
-
diff --git a/Doc/library/ensurepip.rst b/Doc/library/ensurepip.rst
new file mode 100644
index 0000000..d589f1c
--- /dev/null
+++ b/Doc/library/ensurepip.rst
@@ -0,0 +1,131 @@
+:mod:`ensurepip` --- Bootstrapping the ``pip`` installer
+========================================================
+
+.. module:: ensurepip
+   :synopsis: Bootstrapping the "pip" installer into an existing Python
+              installation or virtual environment.
+
+.. versionadded:: 3.4
+
+The :mod:`ensurepip` package provides support for bootstrapping the ``pip``
+installer into an existing Python installation or virtual environment. This
+bootstrapping approach reflects the fact that ``pip`` is an independent
+project with its own release cycle, and the latest available stable version
+is bundled with maintenance and feature releases of the CPython reference
+interpreter.
+
+In most cases, end users of Python shouldn't need to invoke this module
+directly (as ``pip`` should be bootstrapped by default), but it may be
+needed if installing ``pip`` was skipped when installing Python (or
+when creating a virtual environment) or after explicitly uninstalling
+``pip``.
+
+.. note::
+
+   This module *does not* access the internet. All of the components
+   needed to bootstrap ``pip`` are included as internal parts of the
+   package.
+
+.. seealso::
+
+   :ref:`installing-index`
+      The end user guide for installing Python packages
+
+   :pep:`453`: Explicit bootstrapping of pip in Python installations
+      The original rationale and specification for this module.
+
+
+Command line interface
+----------------------
+
+The command line interface is invoked using the interpreter's ``-m`` switch.
+
+The simplest possible invocation is::
+
+    python -m ensurepip
+
+This invocation will install ``pip`` if it is not already installed,
+but otherwise does nothing. To ensure the installed version of ``pip``
+is at least as recent as the one bundled with ``ensurepip``, pass the
+``--upgrade`` option::
+
+    python -m ensurepip --upgrade
+
+By default, ``pip`` is installed into the current virtual environment
+(if one is active) or into the system site packages (if there is no
+active virtual environment). The installation location can be controlled
+through two additional command line options:
+
+* ``--root <dir>``: Installs ``pip`` relative to the given root directory
+  rather than the root of the currently active virtual environment (if any)
+  or the default root for the current Python installation.
+* ``--user``: Installs ``pip`` into the user site packages directory rather
+  than globally for the current Python installation (this option is not
+  permitted inside an active virtual environment).
+
+By default, the scripts ``pipX`` and ``pipX.Y`` will be installed (where
+X.Y stands for the version of Python used to invoke ``ensurepip``). The
+scripts installed can be controlled through two additional command line
+options:
+
+* ``--altinstall``: if an alternate installation is requested, the ``pipX``
+  script will *not* be installed.
+
+* ``--default-pip``: if a "default pip" installation is requested, the
+   ``pip`` script will be installed in addition to the two regular scripts.
+
+Providing both of the script selection options will trigger an exception.
+
+
+Module API
+----------
+
+:mod:`ensurepip` exposes two functions for programmatic use:
+
+.. function:: version()
+
+   Returns a string specifying the bundled version of pip that will be
+   installed when bootstrapping an environment.
+
+.. function:: bootstrap(root=None, upgrade=False, user=False, \
+                        altinstall=False, default_pip=False, \
+                        verbosity=0)
+
+   Bootstraps ``pip`` into the current or designated environment.
+
+   *root* specifies an alternative root directory to install relative to.
+   If *root* is None, then installation uses the default install location
+   for the current environment.
+
+   *upgrade* indicates whether or not to upgrade an existing installation
+   of an earlier version of ``pip`` to the bundled version.
+
+   *user* indicates whether to use the user scheme rather than installing
+   globally.
+
+   By default, the scripts ``pipX`` and ``pipX.Y`` will be installed (where
+   X.Y stands for the current version of Python).
+
+   If *altinstall* is set, then ``pipX`` will *not* be installed.
+
+   If *default_pip* is set, then ``pip`` will be installed in addition to
+   the two regular scripts.
+
+   Setting both *altinstall* and *default_pip* will trigger
+   :exc:`ValueError`.
+
+   *verbosity* controls the level of output to :data:`sys.stdout` from the
+   bootstrapping operation.
+
+   .. note::
+
+      The bootstrapping process has side effects on both ``sys.path`` and
+      ``os.environ``. Invoking the command line interface in a subprocess
+      instead allows these side effects to be avoided.
+
+   .. note::
+
+      The bootstrapping process may install additional modules required by
+      ``pip``, but other software should not assume those dependencies will
+      always be present by default (as the dependencies may be removed in a
+      future version of ``pip``).
diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst
new file mode 100644
index 0000000..cf09559
--- /dev/null
+++ b/Doc/library/enum.rst
@@ -0,0 +1,756 @@
+:mod:`enum` --- Support for enumerations
+========================================
+
+.. module:: enum
+   :synopsis: Implementation of an enumeration class.
+
+.. :moduleauthor:: Ethan Furman <ethan@stoneleaf.us>
+.. :sectionauthor:: Barry Warsaw <barry@python.org>,
+.. :sectionauthor:: Eli Bendersky <eliben@gmail.com>,
+.. :sectionauthor:: Ethan Furman <ethan@stoneleaf.us>
+
+.. versionadded:: 3.4
+
+**Source code:** :source:`Lib/enum.py`
+
+----------------
+
+An enumeration is a set of symbolic names (members) bound to unique,
+constant values.  Within an enumeration, the members can be compared
+by identity, and the enumeration itself can be iterated over.
+
+
+Module Contents
+---------------
+
+This module defines two enumeration classes that can be used to define unique
+sets of names and values: :class:`Enum` and :class:`IntEnum`.  It also defines
+one decorator, :func:`unique`.
+
+.. class:: Enum
+
+    Base class for creating enumerated constants.  See section
+    `Functional API`_ for an alternate construction syntax.
+
+.. class:: IntEnum
+
+    Base class for creating enumerated constants that are also
+    subclasses of :class:`int`.
+
+.. function:: unique
+
+    Enum class decorator that ensures only one name is bound to any one value.
+
+
+Creating an Enum
+----------------
+
+Enumerations are created using the :keyword:`class` syntax, which makes them
+easy to read and write.  An alternative creation method is described in
+`Functional API`_.  To define an enumeration, subclass :class:`Enum` as
+follows::
+
+    >>> from enum import Enum
+    >>> class Color(Enum):
+    ...     red = 1
+    ...     green = 2
+    ...     blue = 3
+    ...
+
+.. note:: Nomenclature
+
+  - The class :class:`Color` is an *enumeration* (or *enum*)
+  - The attributes :attr:`Color.red`, :attr:`Color.green`, etc., are
+    *enumeration members* (or *enum members*).
+  - The enum members have *names* and *values* (the name of
+    :attr:`Color.red` is ``red``, the value of :attr:`Color.blue` is
+    ``3``, etc.)
+
+.. note::
+
+    Even though we use the :keyword:`class` syntax to create Enums, Enums
+    are not normal Python classes.  See `How are Enums different?`_ for
+    more details.
+
+Enumeration members have human readable string representations::
+
+    >>> print(Color.red)
+    Color.red
+
+...while their ``repr`` has more information::
+
+    >>> print(repr(Color.red))
+    <Color.red: 1>
+
+The *type* of an enumeration member is the enumeration it belongs to::
+
+    >>> type(Color.red)
+    <enum 'Color'>
+    >>> isinstance(Color.green, Color)
+    True
+    >>>
+
+Enum members also have a property that contains just their item name::
+
+    >>> print(Color.red.name)
+    red
+
+Enumerations support iteration, in definition order::
+
+    >>> class Shake(Enum):
+    ...     vanilla = 7
+    ...     chocolate = 4
+    ...     cookies = 9
+    ...     mint = 3
+    ...
+    >>> for shake in Shake:
+    ...     print(shake)
+    ...
+    Shake.vanilla
+    Shake.chocolate
+    Shake.cookies
+    Shake.mint
+
+Enumeration members are hashable, so they can be used in dictionaries and sets::
+
+    >>> apples = {}
+    >>> apples[Color.red] = 'red delicious'
+    >>> apples[Color.green] = 'granny smith'
+    >>> apples == {Color.red: 'red delicious', Color.green: 'granny smith'}
+    True
+
+
+Programmatic access to enumeration members and their attributes
+---------------------------------------------------------------
+
+Sometimes it's useful to access members in enumerations programmatically (i.e.
+situations where ``Color.red`` won't do because the exact color is not known
+at program-writing time).  ``Enum`` allows such access::
+
+    >>> Color(1)
+    <Color.red: 1>
+    >>> Color(3)
+    <Color.blue: 3>
+
+If you want to access enum members by *name*, use item access::
+
+    >>> Color['red']
+    <Color.red: 1>
+    >>> Color['green']
+    <Color.green: 2>
+
+If you have an enum member and need its :attr:`name` or :attr:`value`::
+
+    >>> member = Color.red
+    >>> member.name
+    'red'
+    >>> member.value
+    1
+
+
+Duplicating enum members and values
+-----------------------------------
+
+Having two enum members with the same name is invalid::
+
+    >>> class Shape(Enum):
+    ...     square = 2
+    ...     square = 3
+    ...
+    Traceback (most recent call last):
+    ...
+    TypeError: Attempted to reuse key: 'square'
+
+However, two enum members are allowed to have the same value.  Given two members
+A and B with the same value (and A defined first), B is an alias to A.  By-value
+lookup of the value of A and B will return A.  By-name lookup of B will also
+return A::
+
+    >>> class Shape(Enum):
+    ...     square = 2
+    ...     diamond = 1
+    ...     circle = 3
+    ...     alias_for_square = 2
+    ...
+    >>> Shape.square
+    <Shape.square: 2>
+    >>> Shape.alias_for_square
+    <Shape.square: 2>
+    >>> Shape(2)
+    <Shape.square: 2>
+
+.. note::
+
+    Attempting to create a member with the same name as an already
+    defined attribute (another member, a method, etc.) or attempting to create
+    an attribute with the same name as a member is not allowed.
+
+
+Ensuring unique enumeration values
+----------------------------------
+
+By default, enumerations allow multiple names as aliases for the same value.
+When this behavior isn't desired, the following decorator can be used to
+ensure each value is used only once in the enumeration:
+
+.. decorator:: unique
+
+A :keyword:`class` decorator specifically for enumerations.  It searches an
+enumeration's :attr:`__members__` gathering any aliases it finds; if any are
+found :exc:`ValueError` is raised with the details::
+
+    >>> from enum import Enum, unique
+    >>> @unique
+    ... class Mistake(Enum):
+    ...     one = 1
+    ...     two = 2
+    ...     three = 3
+    ...     four = 3
+    ...
+    Traceback (most recent call last):
+    ...
+    ValueError: duplicate values found in <enum 'Mistake'>: four -> three
+
+
+Iteration
+---------
+
+Iterating over the members of an enum does not provide the aliases::
+
+    >>> list(Shape)
+    [<Shape.square: 2>, <Shape.diamond: 1>, <Shape.circle: 3>]
+
+The special attribute ``__members__`` is an ordered dictionary mapping names
+to members.  It includes all names defined in the enumeration, including the
+aliases::
+
+    >>> for name, member in Shape.__members__.items():
+    ...     name, member
+    ...
+    ('square', <Shape.square: 2>)
+    ('diamond', <Shape.diamond: 1>)
+    ('circle', <Shape.circle: 3>)
+    ('alias_for_square', <Shape.square: 2>)
+
+The ``__members__`` attribute can be used for detailed programmatic access to
+the enumeration members.  For example, finding all the aliases::
+
+    >>> [name for name, member in Shape.__members__.items() if member.name != name]
+    ['alias_for_square']
+
+
+Comparisons
+-----------
+
+Enumeration members are compared by identity::
+
+    >>> Color.red is Color.red
+    True
+    >>> Color.red is Color.blue
+    False
+    >>> Color.red is not Color.blue
+    True
+
+Ordered comparisons between enumeration values are *not* supported.  Enum
+members are not integers (but see `IntEnum`_ below)::
+
+    >>> Color.red < Color.blue
+    Traceback (most recent call last):
+      File "<stdin>", line 1, in <module>
+    TypeError: unorderable types: Color() < Color()
+
+Equality comparisons are defined though::
+
+    >>> Color.blue == Color.red
+    False
+    >>> Color.blue != Color.red
+    True
+    >>> Color.blue == Color.blue
+    True
+
+Comparisons against non-enumeration values will always compare not equal
+(again, :class:`IntEnum` was explicitly designed to behave differently, see
+below)::
+
+    >>> Color.blue == 2
+    False
+
+
+Allowed members and attributes of enumerations
+----------------------------------------------
+
+The examples above use integers for enumeration values.  Using integers is
+short and handy (and provided by default by the `Functional API`_), but not
+strictly enforced.  In the vast majority of use-cases, one doesn't care what
+the actual value of an enumeration is.  But if the value *is* important,
+enumerations can have arbitrary values.
+
+Enumerations are Python classes, and can have methods and special methods as
+usual.  If we have this enumeration::
+
+    >>> class Mood(Enum):
+    ...     funky = 1
+    ...     happy = 3
+    ...
+    ...     def describe(self):
+    ...         # self is the member here
+    ...         return self.name, self.value
+    ...
+    ...     def __str__(self):
+    ...         return 'my custom str! {0}'.format(self.value)
+    ...
+    ...     @classmethod
+    ...     def favorite_mood(cls):
+    ...         # cls here is the enumeration
+    ...         return cls.happy
+    ...
+
+Then::
+
+    >>> Mood.favorite_mood()
+    <Mood.happy: 3>
+    >>> Mood.happy.describe()
+    ('happy', 3)
+    >>> str(Mood.funky)
+    'my custom str! 1'
+
+The rules for what is allowed are as follows: _sunder_ names (starting and
+ending with a single underscore) are reserved by enum and cannot be used;
+all other attributes defined within an enumeration will become members of this
+enumeration, with the exception of *__dunder__* names and descriptors (methods
+are also descriptors).
+
+Note:  if your enumeration defines :meth:`__new__` and/or :meth:`__init__` then
+whatever value(s) were given to the enum member will be passed into those
+methods.  See `Planet`_ for an example.
+
+
+Restricted subclassing of enumerations
+--------------------------------------
+
+Subclassing an enumeration is allowed only if the enumeration does not define
+any members.  So this is forbidden::
+
+    >>> class MoreColor(Color):
+    ...     pink = 17
+    ...
+    Traceback (most recent call last):
+    ...
+    TypeError: Cannot extend enumerations
+
+But this is allowed::
+
+    >>> class Foo(Enum):
+    ...     def some_behavior(self):
+    ...         pass
+    ...
+    >>> class Bar(Foo):
+    ...     happy = 1
+    ...     sad = 2
+    ...
+
+Allowing subclassing of enums that define members would lead to a violation of
+some important invariants of types and instances.  On the other hand, it makes
+sense to allow sharing some common behavior between a group of enumerations.
+(See `OrderedEnum`_ for an example.)
+
+
+Pickling
+--------
+
+Enumerations can be pickled and unpickled::
+
+    >>> from test.test_enum import Fruit
+    >>> from pickle import dumps, loads
+    >>> Fruit.tomato is loads(dumps(Fruit.tomato))
+    True
+
+The usual restrictions for pickling apply: picklable enums must be defined in
+the top level of a module, since unpickling requires them to be importable
+from that module.
+
+.. note::
+
+    With pickle protocol version 4 it is possible to easily pickle enums
+    nested in other classes.
+
+It is possible to modify how Enum members are pickled/unpickled by defining
+:meth:`__reduce_ex__` in the enumeration class.
+
+
+Functional API
+--------------
+
+The :class:`Enum` class is callable, providing the following functional API::
+
+    >>> Animal = Enum('Animal', 'ant bee cat dog')
+    >>> Animal
+    <enum 'Animal'>
+    >>> Animal.ant
+    <Animal.ant: 1>
+    >>> Animal.ant.value
+    1
+    >>> list(Animal)
+    [<Animal.ant: 1>, <Animal.bee: 2>, <Animal.cat: 3>, <Animal.dog: 4>]
+
+The semantics of this API resemble :class:`~collections.namedtuple`. The first
+argument of the call to :class:`Enum` is the name of the enumeration.
+
+The second argument is the *source* of enumeration member names.  It can be a
+whitespace-separated string of names, a sequence of names, a sequence of
+2-tuples with key/value pairs, or a mapping (e.g. dictionary) of names to
+values.  The last two options enable assigning arbitrary values to
+enumerations; the others auto-assign increasing integers starting with 1.  A
+new class derived from :class:`Enum` is returned.  In other words, the above
+assignment to :class:`Animal` is equivalent to::
+
+    >>> class Animal(Enum):
+    ...     ant = 1
+    ...     bee = 2
+    ...     cat = 3
+    ...     dog = 4
+    ...
+
+The reason for defaulting to ``1`` as the starting number and not ``0`` is
+that ``0`` is ``False`` in a boolean sense, but enum members all evaluate
+to ``True``.
+
+Pickling enums created with the functional API can be tricky as frame stack
+implementation details are used to try and figure out which module the
+enumeration is being created in (e.g. it will fail if you use a utility
+function in separate module, and also may not work on IronPython or Jython).
+The solution is to specify the module name explicitly as follows::
+
+    >>> Animal = Enum('Animal', 'ant bee cat dog', module=__name__)
+
+.. warning::
+
+    If ``module`` is not supplied, and Enum cannot determine what it is,
+    the new Enum members will not be unpicklable; to keep errors closer to
+    the source, pickling will be disabled.
+
+The new pickle protocol 4 also, in some circumstances, relies on
+:attr:`__qualname__` being set to the location where pickle will be able
+to find the class.  For example, if the class was made available in class
+SomeData in the global scope::
+
+    >>> Animal = Enum('Animal', 'ant bee cat dog', qualname='SomeData.Animal')
+
+The complete signature is::
+
+    Enum(value='NewEnumName', names=<...>, *, module='...', qualname='...', type=<mixed-in class>)
+
+:value: What the new Enum class will record as its name.
+
+:names: The Enum members.  This can be a whitespace or comma separated string
+  (values will start at 1)::
+
+    'red green blue' | 'red,green,blue' | 'red, green, blue'
+
+  or an iterator of names::
+
+    ['red', 'green', 'blue']
+
+  or an iterator of (name, value) pairs::
+
+    [('cyan', 4), ('magenta', 5), ('yellow', 6)]
+
+  or a mapping::
+
+    {'chartreuse': 7, 'sea_green': 11, 'rosemary': 42}
+
+:module: name of module where new Enum class can be found.
+
+:qualname: where in module new Enum class can be found.
+
+:type: type to mix in to new Enum class.
+
+
+Derived Enumerations
+--------------------
+
+IntEnum
+^^^^^^^
+
+A variation of :class:`Enum` is provided which is also a subclass of
+:class:`int`.  Members of an :class:`IntEnum` can be compared to integers;
+by extension, integer enumerations of different types can also be compared
+to each other::
+
+    >>> from enum import IntEnum
+    >>> class Shape(IntEnum):
+    ...     circle = 1
+    ...     square = 2
+    ...
+    >>> class Request(IntEnum):
+    ...     post = 1
+    ...     get = 2
+    ...
+    >>> Shape == 1
+    False
+    >>> Shape.circle == 1
+    True
+    >>> Shape.circle == Request.post
+    True
+
+However, they still can't be compared to standard :class:`Enum` enumerations::
+
+    >>> class Shape(IntEnum):
+    ...     circle = 1
+    ...     square = 2
+    ...
+    >>> class Color(Enum):
+    ...     red = 1
+    ...     green = 2
+    ...
+    >>> Shape.circle == Color.red
+    False
+
+:class:`IntEnum` values behave like integers in other ways you'd expect::
+
+    >>> int(Shape.circle)
+    1
+    >>> ['a', 'b', 'c'][Shape.circle]
+    'b'
+    >>> [i for i in range(Shape.square)]
+    [0, 1]
+
+For the vast majority of code, :class:`Enum` is strongly recommended,
+since :class:`IntEnum` breaks some semantic promises of an enumeration (by
+being comparable to integers, and thus by transitivity to other
+unrelated enumerations).  It should be used only in special cases where
+there's no other choice; for example, when integer constants are
+replaced with enumerations and backwards compatibility is required with code
+that still expects integers.
+
+
+Others
+^^^^^^
+
+While :class:`IntEnum` is part of the :mod:`enum` module, it would be very
+simple to implement independently::
+
+    class IntEnum(int, Enum):
+        pass
+
+This demonstrates how similar derived enumerations can be defined; for example
+a :class:`StrEnum` that mixes in :class:`str` instead of :class:`int`.
+
+Some rules:
+
+1. When subclassing :class:`Enum`, mix-in types must appear before
+   :class:`Enum` itself in the sequence of bases, as in the :class:`IntEnum`
+   example above.
+2. While :class:`Enum` can have members of any type, once you mix in an
+   additional type, all the members must have values of that type, e.g.
+   :class:`int` above.  This restriction does not apply to mix-ins which only
+   add methods and don't specify another data type such as :class:`int` or
+   :class:`str`.
+3. When another data type is mixed in, the :attr:`value` attribute is *not the
+   same* as the enum member itself, although it is equivalent and will compare
+   equal.
+4. %-style formatting:  `%s` and `%r` call :class:`Enum`'s :meth:`__str__` and
+   :meth:`__repr__` respectively; other codes (such as `%i` or `%h` for
+   IntEnum) treat the enum member as its mixed-in type.
+5. :meth:`str.__format__` (or :func:`format`) will use the mixed-in
+   type's :meth:`__format__`.  If the :class:`Enum`'s :func:`str` or
+   :func:`repr` is desired use the `!s` or `!r` :class:`str` format codes.
+
+
+Interesting examples
+--------------------
+
+While :class:`Enum` and :class:`IntEnum` are expected to cover the majority of
+use-cases, they cannot cover them all.  Here are recipes for some different
+types of enumerations that can be used directly, or as examples for creating
+one's own.
+
+
+AutoNumber
+^^^^^^^^^^
+
+Avoids having to specify the value for each enumeration member::
+
+    >>> class AutoNumber(Enum):
+    ...     def __new__(cls):
+    ...         value = len(cls.__members__) + 1
+    ...         obj = object.__new__(cls)
+    ...         obj._value_ = value
+    ...         return obj
+    ...
+    >>> class Color(AutoNumber):
+    ...     red = ()
+    ...     green = ()
+    ...     blue = ()
+    ...
+    >>> Color.green.value == 2
+    True
+
+.. note::
+
+    The :meth:`__new__` method, if defined, is used during creation of the Enum
+    members; it is then replaced by Enum's :meth:`__new__` which is used after
+    class creation for lookup of existing members.
+
+
+OrderedEnum
+^^^^^^^^^^^
+
+An ordered enumeration that is not based on :class:`IntEnum` and so maintains
+the normal :class:`Enum` invariants (such as not being comparable to other
+enumerations)::
+
+    >>> class OrderedEnum(Enum):
+    ...     def __ge__(self, other):
+    ...         if self.__class__ is other.__class__:
+    ...             return self.value >= other.value
+    ...         return NotImplemented
+    ...     def __gt__(self, other):
+    ...         if self.__class__ is other.__class__:
+    ...             return self.value > other.value
+    ...         return NotImplemented
+    ...     def __le__(self, other):
+    ...         if self.__class__ is other.__class__:
+    ...             return self.value <= other.value
+    ...         return NotImplemented
+    ...     def __lt__(self, other):
+    ...         if self.__class__ is other.__class__:
+    ...             return self.value < other.value
+    ...         return NotImplemented
+    ...
+    >>> class Grade(OrderedEnum):
+    ...     A = 5
+    ...     B = 4
+    ...     C = 3
+    ...     D = 2
+    ...     F = 1
+    ...
+    >>> Grade.C < Grade.A
+    True
+
+
+DuplicateFreeEnum
+^^^^^^^^^^^^^^^^^
+
+Raises an error if a duplicate member name is found instead of creating an
+alias::
+
+    >>> class DuplicateFreeEnum(Enum):
+    ...     def __init__(self, *args):
+    ...         cls = self.__class__
+    ...         if any(self.value == e.value for e in cls):
+    ...             a = self.name
+    ...             e = cls(self.value).name
+    ...             raise ValueError(
+    ...                 "aliases not allowed in DuplicateFreeEnum:  %r --> %r"
+    ...                 % (a, e))
+    ...
+    >>> class Color(DuplicateFreeEnum):
+    ...     red = 1
+    ...     green = 2
+    ...     blue = 3
+    ...     grene = 2
+    ...
+    Traceback (most recent call last):
+    ...
+    ValueError: aliases not allowed in DuplicateFreeEnum:  'grene' --> 'green'
+
+.. note::
+
+    This is a useful example for subclassing Enum to add or change other
+    behaviors as well as disallowing aliases.  If the only desired change is
+    disallowing aliases, the :func:`unique` decorator can be used instead.
+
+
+Planet
+^^^^^^
+
+If :meth:`__new__` or :meth:`__init__` is defined the value of the enum member
+will be passed to those methods::
+
+    >>> class Planet(Enum):
+    ...     MERCURY = (3.303e+23, 2.4397e6)
+    ...     VENUS   = (4.869e+24, 6.0518e6)
+    ...     EARTH   = (5.976e+24, 6.37814e6)
+    ...     MARS    = (6.421e+23, 3.3972e6)
+    ...     JUPITER = (1.9e+27,   7.1492e7)
+    ...     SATURN  = (5.688e+26, 6.0268e7)
+    ...     URANUS  = (8.686e+25, 2.5559e7)
+    ...     NEPTUNE = (1.024e+26, 2.4746e7)
+    ...     def __init__(self, mass, radius):
+    ...         self.mass = mass       # in kilograms
+    ...         self.radius = radius   # in meters
+    ...     @property
+    ...     def surface_gravity(self):
+    ...         # universal gravitational constant  (m3 kg-1 s-2)
+    ...         G = 6.67300E-11
+    ...         return G * self.mass / (self.radius * self.radius)
+    ...
+    >>> Planet.EARTH.value
+    (5.976e+24, 6378140.0)
+    >>> Planet.EARTH.surface_gravity
+    9.802652743337129
+
+
+How are Enums different?
+------------------------
+
+Enums have a custom metaclass that affects many aspects of both derived Enum
+classes and their instances (members).
+
+
+Enum Classes
+^^^^^^^^^^^^
+
+The :class:`EnumMeta` metaclass is responsible for providing the
+:meth:`__contains__`, :meth:`__dir__`, :meth:`__iter__` and other methods that
+allow one to do things with an :class:`Enum` class that fail on a typical
+class, such as `list(Color)` or `some_var in Color`.  :class:`EnumMeta` is
+responsible for ensuring that various other methods on the final :class:`Enum`
+class are correct (such as :meth:`__new__`, :meth:`__getnewargs__`,
+:meth:`__str__` and :meth:`__repr__`)
+
+
+Enum Members (aka instances)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The most interesting thing about Enum members is that they are singletons.
+:class:`EnumMeta` creates them all while it is creating the :class:`Enum`
+class itself, and then puts a custom :meth:`__new__` in place to ensure
+that no new ones are ever instantiated by returning only the existing
+member instances.
+
+
+Finer Points
+^^^^^^^^^^^^
+
+Enum members are instances of an Enum class, and even though they are
+accessible as `EnumClass.member`, they are not accessible directly from
+the member::
+
+    >>> Color.red
+    <Color.red: 1>
+    >>> Color.red.blue
+    Traceback (most recent call last):
+    ...
+    AttributeError: 'Color' object has no attribute 'blue'
+
+Likewise, the :attr:`__members__` is only available on the class.
+
+If you give your :class:`Enum` subclass extra methods, like the `Planet`_
+class above, those methods will show up in a :func:`dir` of the member,
+but not of the class::
+
+    >>> dir(Planet)
+    ['EARTH', 'JUPITER', 'MARS', 'MERCURY', 'NEPTUNE', 'SATURN', 'URANUS', 'VENUS', '__class__', '__doc__', '__members__', '__module__']
+    >>> dir(Planet.EARTH)
+    ['__class__', '__doc__', '__module__', 'name', 'surface_gravity', 'value']
+
+The :meth:`__new__` method will only be used for the creation of the
+:class:`Enum` members -- after that it is replaced.  Any custom :meth:`__new__`
+method must create the object and set the :attr:`_value_` attribute
+appropriately.
+
+If you wish to change how :class:`Enum` members are looked up you should either
+write a helper function or a :func:`classmethod` for the :class:`Enum`
+subclass.
diff --git a/Doc/library/exceptions.rst b/Doc/library/exceptions.rst
index 6e4559c..5892154 100644
--- a/Doc/library/exceptions.rst
+++ b/Doc/library/exceptions.rst
@@ -28,13 +28,14 @@
 interpreter raises the same exception; but beware that there is nothing to
 prevent user code from raising an inappropriate error.
 
-The built-in exception classes can be sub-classed to define new exceptions;
-programmers are encouraged to at least derive new exceptions from the
-:exc:`Exception` class and not :exc:`BaseException`.  More information on
-defining exceptions is available in the Python Tutorial under
+The built-in exception classes can be subclassed to define new exceptions;
+programmers are encouraged to derive new exceptions from the :exc:`Exception`
+class or one of its subclasses, and not from :exc:`BaseException`.  More
+information on defining exceptions is available in the Python Tutorial under
 :ref:`tut-userexceptions`.
 
-When raising (or re-raising) an exception in an :keyword:`except` clause
+When raising (or re-raising) an exception in an :keyword:`except` or
+:keyword:`finally` clause
 :attr:`__context__` is automatically set to the last exception caught; if the
 new exception is not handled the traceback that is eventually displayed will
 include the originating exception(s) and the final exception.
@@ -82,7 +83,7 @@
    .. attribute:: args
 
       The tuple of arguments given to the exception constructor.  Some built-in
-      exceptions (like :exc:`IOError`) expect a certain number of arguments and
+      exceptions (like :exc:`OSError`) expect a certain number of arguments and
       assign a special meaning to the elements of this tuple, while others are
       usually called only with a single string giving an error message.
 
@@ -161,7 +162,7 @@
 
 .. exception:: GeneratorExit
 
-   Raise when a :term:`generator`\'s :meth:`close` method is called.  It
+   Raised when a :term:`generator`\'s :meth:`close` method is called.  It
    directly inherits from :exc:`BaseException` instead of :exc:`Exception` since
    it is technically not an error.
 
@@ -253,20 +254,31 @@
    For exceptions that involve a file system path (such as :func:`open` or
    :func:`os.unlink`), the exception instance will contain an additional
    attribute, :attr:`filename`, which is the file name passed to the function.
+   For functions that involve two file system paths (such as
+   :func:`os.rename`), the exception instance will contain a second
+   :attr:`filename2` attribute corresponding to the second file name passed
+   to the function.
+
 
    .. versionchanged:: 3.3
       :exc:`EnvironmentError`, :exc:`IOError`, :exc:`WindowsError`,
       :exc:`VMSError`, :exc:`socket.error`, :exc:`select.error` and
       :exc:`mmap.error` have been merged into :exc:`OSError`.
 
+   .. versionchanged:: 3.4
+      The :attr:`filename` attribute is now the original file name passed to
+      the function, instead of the name encoded to or decoded from the
+      filesystem encoding.  Also, the :attr:`filename2` attribute was added.
+
 
 .. exception:: OverflowError
 
    Raised when the result of an arithmetic operation is too large to be
    represented.  This cannot occur for integers (which would rather raise
-   :exc:`MemoryError` than give up).  Because of the lack of standardization of
-   floating point exception handling in C, most floating point operations also
-   aren't checked.
+   :exc:`MemoryError` than give up).  However, for historical reasons,
+   OverflowError is sometimes raised for integers that are outside a required
+   range.   Because of the lack of standardization of floating point exception
+   handling in C, most floating point operations are not checked.
 
 
 .. exception:: ReferenceError
@@ -447,10 +459,6 @@
 
 .. exception:: IOError
 
-.. exception:: VMSError
-
-   Only available on VMS.
-
 .. exception:: WindowsError
 
    Only available on Windows.
diff --git a/Doc/library/faulthandler.rst b/Doc/library/faulthandler.rst
index 3c33621..eb2016a 100644
--- a/Doc/library/faulthandler.rst
+++ b/Doc/library/faulthandler.rst
@@ -4,12 +4,14 @@
 .. module:: faulthandler
    :synopsis: Dump the Python traceback.
 
+.. versionadded:: 3.3
+
 This module contains functions to dump Python tracebacks explicitly, on a 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.
+variable or by using the :option:`-X` ``faulthandler`` command line option.
 
 The fault handler is compatible with system fault handlers like Apport or the
 Windows fault handler. The module uses an alternative stack for signal handlers
@@ -27,6 +29,7 @@
 * Only the filename, the function name and the line number are
   displayed. (no source code)
 * It is limited to 100 frames and 100 threads.
+* The order is reversed: the most recent call is shown first.
 
 By default, the Python traceback is written to :data:`sys.stderr`. To see
 tracebacks, applications must be run in the terminal. A log file can
@@ -35,11 +38,9 @@
 The module is implemented in C, so tracebacks can be dumped on a crash or when
 Python is deadlocked.
 
-.. versionadded:: 3.3
 
-
-Dump the traceback
-------------------
+Dumping the traceback
+---------------------
 
 .. function:: dump_traceback(file=sys.stderr, all_threads=True)
 
@@ -68,8 +69,8 @@
    Check if the fault handler is enabled.
 
 
-Dump the tracebacks after a timeout
------------------------------------
+Dumping the tracebacks after a timeout
+--------------------------------------
 
 .. function:: dump_traceback_later(timeout, repeat=False, file=sys.stderr, exit=False)
 
@@ -89,8 +90,8 @@
    Cancel the last call to :func:`dump_traceback_later`.
 
 
-Dump the traceback on a user signal
------------------------------------
+Dumping the traceback on a user signal
+--------------------------------------
 
 .. function:: register(signum, file=sys.stderr, all_threads=True, chain=False)
 
@@ -109,8 +110,8 @@
    Not available on Windows.
 
 
-File descriptor issue
----------------------
+Issue with file descriptors
+---------------------------
 
 :func:`enable`, :func:`dump_traceback_later` and :func:`register` keep the
 file descriptor of their *file* argument. If the file is closed and its file
@@ -122,14 +123,20 @@
 Example
 -------
 
-Example of a segmentation fault on Linux: ::
+.. highlight:: sh
 
-    $ python -q -X faulthandler
+Example of a segmentation fault on Linux with and without enabling the fault
+handler::
+
+    $ python3 -c "import ctypes; ctypes.string_at(0)"
+    Segmentation fault
+
+    $ python3 -q -X faulthandler
     >>> import ctypes
     >>> ctypes.string_at(0)
     Fatal Python error: Segmentation fault
 
-    Current thread 0x00007fb899f39700:
+    Current thread 0x00007fb899f39700 (most recent call first):
       File "/home/python/cpython/Lib/ctypes/__init__.py", line 486 in string_at
       File "<stdin>", line 1 in <module>
     Segmentation fault
diff --git a/Doc/library/filecmp.rst b/Doc/library/filecmp.rst
index 8a88f8c..06d3f21 100644
--- a/Doc/library/filecmp.rst
+++ b/Doc/library/filecmp.rst
@@ -27,6 +27,10 @@
    Note that no external programs are called from this function, giving it
    portability and efficiency.
 
+   This function uses a cache for past comparisons and the results,
+   with cache entries invalidated if the :func:`os.stat` information for the
+   file changes.  The entire cache may be cleared using :func:`clear_cache`.
+
 
 .. function:: cmpfiles(dir1, dir2, common, shallow=True)
 
@@ -48,6 +52,15 @@
    one of the three returned lists.
 
 
+.. function:: clear_cache()
+
+   Clear the filecmp cache. This may be useful if a file is compared so quickly
+   after it is modified that it is within the mtime resolution of
+   the underlying filesystem.
+
+   .. versionadded:: 3.4
+
+
 .. _dircmp-objects:
 
 The :class:`dircmp` class
@@ -55,28 +68,25 @@
 
 .. class:: dircmp(a, b, ignore=None, hide=None)
 
-   Construct a new directory comparison object, to compare the directories *a* and
-   *b*. *ignore* is a list of names to ignore, and defaults to ``['RCS', 'CVS',
-   'tags']``. *hide* is a list of names to hide, and defaults to ``[os.curdir,
-   os.pardir]``.
+   Construct a new directory comparison object, to compare the directories *a*
+   and *b*.  *ignore* is a list of names to ignore, and defaults to
+   :attr:`filecmp.DEFAULT_IGNORES`.  *hide* is a list of names to hide, and
+   defaults to ``[os.curdir, os.pardir]``.
 
    The :class:`dircmp` class compares files by doing *shallow* comparisons
    as described for :func:`filecmp.cmp`.
 
    The :class:`dircmp` class provides the following methods:
 
-
    .. method:: report()
 
       Print (to :data:`sys.stdout`) a comparison between *a* and *b*.
 
-
    .. method:: report_partial_closure()
 
       Print a comparison between *a* and *b* and common immediate
       subdirectories.
 
-
    .. method:: report_full_closure()
 
       Print a comparison between *a* and *b* and common subdirectories
@@ -133,7 +143,7 @@
 
    .. attribute:: common_files
 
-      Files in both *a* and *b*
+      Files in both *a* and *b*.
 
 
    .. attribute:: common_funny
@@ -164,6 +174,12 @@
       A dictionary mapping names in :attr:`common_dirs` to :class:`dircmp`
       objects.
 
+.. attribute:: DEFAULT_IGNORES
+
+   .. versionadded:: 3.4
+
+   List of directories ignored by :class:`dircmp` by default.
+
 
 Here is a simplified example of using the ``subdirs`` attribute to search
 recursively through two directories to show common different files::
diff --git a/Doc/library/fileinput.rst b/Doc/library/fileinput.rst
index d5a4875..ee06830 100644
--- a/Doc/library/fileinput.rst
+++ b/Doc/library/fileinput.rst
@@ -160,6 +160,9 @@
    .. versionchanged:: 3.2
       Can be used as a context manager.
 
+   .. deprecated:: 3.4
+        The ``'rU'`` and ``'U'`` modes.
+
 
 **Optional in-place filtering:** if the keyword argument ``inplace=True`` is
 passed to :func:`fileinput.input` or to the :class:`FileInput` constructor, the
diff --git a/Doc/library/filesys.rst b/Doc/library/filesys.rst
index 58998a8..03e085b 100644
--- a/Doc/library/filesys.rst
+++ b/Doc/library/filesys.rst
@@ -12,6 +12,7 @@
 
 .. toctree::
 
+   pathlib.rst
    os.path.rst
    fileinput.rst
    stat.rst
diff --git a/Doc/library/fnmatch.rst b/Doc/library/fnmatch.rst
index e0434b0..ef93f05 100644
--- a/Doc/library/fnmatch.rst
+++ b/Doc/library/fnmatch.rst
@@ -86,7 +86,7 @@
       '.*\\.txt$'
       >>> reobj = re.compile(regex)
       >>> reobj.match('foobar.txt')
-      <_sre.SRE_Match object at 0x...>
+      <_sre.SRE_Match object; span=(0, 10), match='foobar.txt'>
 
 
 .. seealso::
diff --git a/Doc/library/formatter.rst b/Doc/library/formatter.rst
index 88be11c..1847a80 100644
--- a/Doc/library/formatter.rst
+++ b/Doc/library/formatter.rst
@@ -3,6 +3,11 @@
 
 .. module:: formatter
    :synopsis: Generic output formatter and device interface.
+   :deprecated:
+
+.. deprecated:: 3.4
+   Due to lack of usage, the formatter module has been deprecated and is slated
+   for removal in Python 3.6.
 
 
 This module supports two interface definitions, each with multiple
diff --git a/Doc/library/ftplib.rst b/Doc/library/ftplib.rst
index dcb2ac4..3b9f50c 100644
--- a/Doc/library/ftplib.rst
+++ b/Doc/library/ftplib.rst
@@ -80,40 +80,34 @@
    :rfc:`4217`.
    Connect as usual to port 21 implicitly securing the FTP control connection
    before authenticating. Securing the data connection requires the user to
-   explicitly ask for it by calling the :meth:`prot_p` method.
-   *keyfile* and *certfile* are optional -- they can contain a PEM formatted
-   private key and certificate chain file name for the SSL connection.
-   *context* parameter is a :class:`ssl.SSLContext` object which allows
-   bundling SSL configuration options, certificates and private keys into a
-   single (potentially long-lived) structure. *source_address* is a 2-tuple
-   ``(host, port)`` for the socket to bind to as its source address before
-   connecting.
+   explicitly ask for it by calling the :meth:`prot_p` method.  *context*
+   is a :class:`ssl.SSLContext` object which allows bundling SSL configuration
+   options, certificates and private keys into a single (potentially
+   long-lived) structure.  Please read :ref:`ssl-security` for best practices.
+
+   *keyfile* and *certfile* are a legacy alternative to *context* -- they
+   can point to PEM-formatted private key and certificate chain files
+   (respectively) for the SSL connection.
 
    .. versionadded:: 3.2
 
    .. versionchanged:: 3.3
       *source_address* parameter was added.
 
-   Here's a sample session using the :class:`FTP_TLS` class:
+   .. versionchanged:: 3.4
+      The class now supports hostname check with
+      :attr:`ssl.SSLContext.check_hostname` and *Server Name Indication* (see
+      :data:`ssl.HAS_SNI`).
 
-   >>> from ftplib import FTP_TLS
-   >>> ftps = FTP_TLS('ftp.python.org')
-   >>> ftps.login()           # login anonymously before securing control channel
-   >>> ftps.prot_p()          # switch to secure data connection
-   >>> ftps.retrlines('LIST') # list directory content securely
-   total 9
-   drwxr-xr-x   8 root     wheel        1024 Jan  3  1994 .
-   drwxr-xr-x   8 root     wheel        1024 Jan  3  1994 ..
-   drwxr-xr-x   2 root     wheel        1024 Jan  3  1994 bin
-   drwxr-xr-x   2 root     wheel        1024 Jan  3  1994 etc
-   d-wxrwxr-x   2 ftp      wheel        1024 Sep  5 13:43 incoming
-   drwxr-xr-x   2 root     wheel        1024 Nov 17  1993 lib
-   drwxr-xr-x   6 1094     wheel        1024 Sep 13 19:07 pub
-   drwxr-xr-x   3 root     wheel        1024 Jan  3  1994 usr
-   -rw-r--r--   1 root     root          312 Aug  1  1994 welcome.msg
-   '226 Transfer complete.'
-   >>> ftps.quit()
-   >>>
+   Here's a sample session using the :class:`FTP_TLS` class::
+
+      >>> ftps = FTP_TLS('ftp.pureftpd.org')
+      >>> ftps.login()
+      '230 Anonymous user logged in'
+      >>> ftps.prot_p()
+      '200 Data protection level set to "private"'
+      >>> ftps.nlst()
+      ['6jack', 'OpenBSD', 'antilink', 'blogbench', 'bsdcam', 'clockspeed', 'djbdns-jedi', 'docs', 'eaccelerator-jedi', 'favicon.ico', 'francotone', 'fugu', 'ignore', 'libpuzzle', 'metalog', 'minidentd', 'misc', 'mysql-udf-global-user-variables', 'php-jenkins-hash', 'php-skein-hash', 'php-webdav', 'phpaudit', 'phpbench', 'pincaster', 'ping', 'posto', 'pub', 'public', 'public_keys', 'pure-ftpd', 'qscan', 'qtc', 'sharedance', 'skycache', 'sound', 'tmp', 'ucarp']
 
 
 .. exception:: error_reply
@@ -268,10 +262,10 @@
    Passive mode is on by default.
 
 
-.. method:: FTP.storbinary(cmd, file, blocksize=8192, callback=None, rest=None)
+.. method:: FTP.storbinary(cmd, fp, blocksize=8192, callback=None, rest=None)
 
    Store a file in binary transfer mode.  *cmd* should be an appropriate
-   ``STOR`` command: ``"STOR filename"``. *file* is a :term:`file object`
+   ``STOR`` command: ``"STOR filename"``. *fp* is a :term:`file object`
    (opened in binary mode) which is read until EOF using its :meth:`~io.IOBase.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
@@ -282,11 +276,11 @@
       *rest* parameter added.
 
 
-.. method:: FTP.storlines(cmd, file, callback=None)
+.. method:: FTP.storlines(cmd, fp, callback=None)
 
    Store a file in ASCII transfer mode.  *cmd* should be an appropriate
    ``STOR`` command (see :meth:`storbinary`).  Lines are read until EOF from the
-   :term:`file object` *file* (opened in binary mode) using its :meth:`~io.IOBase.readline`
+   :term:`file object` *fp* (opened in binary mode) using its :meth:`~io.IOBase.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.
 
@@ -420,13 +414,18 @@
 
 .. attribute:: FTP_TLS.ssl_version
 
-   The SSL version to use (defaults to *TLSv1*).
+   The SSL version to use (defaults to :attr:`ssl.PROTOCOL_SSLv23`).
 
 .. method:: FTP_TLS.auth()
 
    Set up secure control connection by using TLS or SSL, depending on what
    specified in :meth:`ssl_version` attribute.
 
+   .. versionchanged:: 3.4
+      The method now supports hostname check with
+      :attr:`ssl.SSLContext.check_hostname` and *Server Name Indication* (see
+      :data:`ssl.HAS_SNI`).
+
 .. method:: FTP_TLS.ccc()
 
    Revert control channel back to plaintext.  This can be useful to take
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index 7ed25c1..d9e5cfb 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -85,22 +85,22 @@
    :meth:`__index__` method that returns an integer.
 
 
-.. function:: bool([x])
+.. class:: bool([x])
 
-   Convert a value to a Boolean, using the standard :ref:`truth testing
-   procedure <truth>`.  If *x* is false or omitted, this returns ``False``;
-   otherwise it returns ``True``. :class:`bool` is also a class, which is a
-   subclass of :class:`int` (see :ref:`typesnumeric`).  Class :class:`bool`
-   cannot be subclassed further.  Its only instances are ``False`` and
+   Return a Boolean value, i.e. one of ``True`` or ``False``.  *x* is converted
+   using the standard :ref:`truth testing procedure <truth>`.  If *x* is false
+   or omitted, this returns ``False``; otherwise it returns ``True``.  The
+   :class:`bool` class is a subclass of :class:`int` (see :ref:`typesnumeric`).
+   It cannot be subclassed further.  Its only instances are ``False`` and
    ``True`` (see :ref:`bltin-boolean-values`).
 
    .. index:: pair: Boolean; type
 
 
 .. _func-bytearray:
-.. function:: bytearray([source[, encoding[, errors]]])
+.. class:: bytearray([source[, encoding[, errors]]])
 
-   Return a new array of bytes.  The :class:`bytearray` type is a mutable
+   Return a new array of bytes.  The :class:`bytearray` class is a mutable
    sequence of integers in the range 0 <= x < 256.  It has most of the usual
    methods of mutable sequences, described in :ref:`typesseq-mutable`, as well
    as most methods that the :class:`bytes` type has, see :ref:`bytes-methods`.
@@ -127,7 +127,7 @@
 
 
 .. _func-bytes:
-.. function:: bytes([source[, encoding[, errors]]])
+.. class:: bytes([source[, encoding[, errors]]])
 
    Return a new "bytes" object, which is an immutable sequence of integers in
    the range ``0 <= x < 256``.  :class:`bytes` is an immutable version of
@@ -156,7 +156,7 @@
 
 .. function:: chr(i)
 
-   Return the string representing a character whose Unicode codepoint is the integer
+   Return the string representing a character whose Unicode code point is the integer
    *i*.  For example, ``chr(97)`` returns the string ``'a'``. This is the
    inverse of :func:`ord`.  The valid range for the argument is from 0 through
    1,114,111 (0x10FFFF in base 16).  :exc:`ValueError` will be raised if *i* is
@@ -210,7 +210,7 @@
    The optional arguments *flags* and *dont_inherit* control which future
    statements (see :pep:`236`) affect the compilation of *source*.  If neither
    is present (or both are zero) the code is compiled with those future
-   statements that are in effect in the code that is calling compile.  If the
+   statements that are in effect in the code that is calling :func:`compile`.  If the
    *flags* argument is given and *dont_inherit* is not (or is zero) then the
    future statements specified by the *flags* argument are used in addition to
    those that would be used anyway. If *dont_inherit* is a non-zero integer then
@@ -231,6 +231,9 @@
    This function raises :exc:`SyntaxError` if the compiled source is invalid,
    and :exc:`TypeError` if the source contains null bytes.
 
+   If you want to parse Python code into its AST representation, see
+   :func:`ast.parse`.
+
    .. note::
 
       When compiling a string with multi-line code in ``'single'`` or
@@ -243,15 +246,16 @@
       does not have to end in a newline anymore.  Added the *optimize* parameter.
 
 
-.. function:: complex([real[, imag]])
+.. class:: complex([real[, imag]])
 
-   Create a complex number with the value *real* + *imag*\*j or convert a string or
-   number to a complex number.  If the first parameter is a string, it will be
-   interpreted as a complex number and the function must be called without a second
-   parameter.  The second parameter can never be a string. Each argument may be any
-   numeric type (including complex). If *imag* is omitted, it defaults to zero and
-   the function serves as a numeric conversion function like :func:`int`
-   and :func:`float`.  If both arguments are omitted, returns ``0j``.
+   Return a complex number with the value *real* + *imag*\*j or convert a string
+   or number to a complex number.  If the first parameter is a string, it will
+   be interpreted as a complex number and the function must be called without a
+   second parameter.  The second parameter can never be a string. Each argument
+   may be any numeric type (including complex).  If *imag* is omitted, it
+   defaults to zero and the constructor serves as a numeric conversion like
+   :class:`int` and :class:`float`.  If both arguments are omitted, returns
+   ``0j``.
 
    .. note::
 
@@ -272,14 +276,13 @@
 
 
 .. _func-dict:
-.. function:: dict(**kwarg)
-              dict(mapping, **kwarg)
-              dict(iterable, **kwarg)
+.. class:: dict(**kwarg)
+           dict(mapping, **kwarg)
+           dict(iterable, **kwarg)
    :noindex:
 
    Create a new dictionary.  The :class:`dict` object is the dictionary class.
-   See :class:`dict` and :ref:`typesmapping` for documentation about this
-   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, as well as the :mod:`collections` module.
@@ -410,6 +413,7 @@
    See :func:`ast.literal_eval` for a function that can safely evaluate strings
    with expressions containing only literals.
 
+.. index:: builtin: exec
 
 .. function:: exec(object[, globals[, locals]])
 
@@ -469,13 +473,13 @@
    elements of *iterable* for which *function* returns false.
 
 
-.. function:: float([x])
+.. class:: float([x])
 
    .. index::
       single: NaN
       single: Infinity
 
-   Convert a string or a number to floating point.
+   Return a floating point number constructed from a number or string *x*.
 
    If the argument is a string, it should contain a decimal number, optionally
    preceded by a sign, and optionally embedded in whitespace.  The optional
@@ -538,14 +542,19 @@
    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
+   ``type(value).__format__(value, format_spec)`` which bypasses the instance
    dictionary when searching for the value's :meth:`__format__` method.  A
-   :exc:`TypeError` exception is raised if the method is not found or if either
-   the *format_spec* or the return value are not strings.
+   :exc:`TypeError` exception is raised if the method search reaches
+   :mod:`object` and the *format_spec* is non-empty, or if either the
+   *format_spec* or the return value are not strings.
+
+   .. versionchanged:: 3.4
+      ``object().__format__(format_spec)`` raises :exc:`TypeError`
+      if *format_spec* is not an empty string.
 
 
 .. _func-frozenset:
-.. function:: frozenset([iterable])
+.. class:: frozenset([iterable])
    :noindex:
 
    Return a new :class:`frozenset` object, optionally with elements taken from
@@ -605,6 +614,10 @@
 
    This function is added to the built-in namespace by the :mod:`site` module.
 
+   .. versionchanged:: 3.4
+      Changes to :mod:`pydoc` and :mod:`inspect` mean that the reported
+      signatures for callables are now more comprehensive and consistent.
+
 
 .. function:: hex(x)
 
@@ -654,12 +667,13 @@
    to provide elaborate line editing and history features.
 
 
-.. function:: int(x=0)
-              int(x, base=10)
+.. class:: int(x=0)
+           int(x, base=10)
 
-   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.
+   Return an integer object constructed from a number or string *x*, 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
@@ -676,6 +690,12 @@
 
    The integer type is described in :ref:`typesnumeric`.
 
+   .. versionchanged:: 3.4
+      If *base* is not an instance of :class:`int` and the *base* object has a
+      :meth:`base.__index__ <object.__index__>` method, that method is called
+      to obtain an integer for the base.  Previous versions used
+      :meth:`base.__int__ <object.__int__>` instead of :meth:`base.__index__
+      <object.__index__>`.
 
 .. function:: isinstance(object, classinfo)
 
@@ -727,11 +747,12 @@
 .. function:: len(s)
 
    Return the length (the number of items) of an object.  The argument may be a
-   sequence (string, tuple or list) or a mapping (dictionary).
+   sequence (such as a string, bytes, tuple, list, or range) or a collection
+   (such as a dictionary, set, or frozen set).
 
 
 .. _func-list:
-.. function:: list([iterable])
+.. class:: list([iterable])
    :noindex:
 
    Rather than being a function, :class:`list` is actually a mutable
@@ -758,25 +779,31 @@
    already arranged into argument tuples, see :func:`itertools.starmap`\.
 
 
-.. function:: max(iterable, *[, key])
+.. function:: max(iterable, *[, key, default])
               max(arg1, arg2, *args[, key])
 
    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.
+   If one positional argument is provided, it should be an :term:`iterable`.
+   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`.
+   There are two optional keyword-only arguments. The *key* argument specifies
+   a one-argument ordering function like that used for :meth:`list.sort`. The
+   *default* argument specifies an object to return if the provided iterable is
+   empty. If the iterable is empty and *default* is not provided, a
+   :exc:`ValueError` is raised.
 
    If multiple items are maximal, the function returns the first one
    encountered.  This is consistent with other sort-stability preserving tools
    such as ``sorted(iterable, key=keyfunc, reverse=True)[0]`` and
    ``heapq.nlargest(1, iterable, key=keyfunc)``.
 
+   .. versionadded:: 3.4
+      The *default* keyword-only argument.
+
 
 .. _func-memoryview:
 .. function:: memoryview(obj)
@@ -786,25 +813,32 @@
    :ref:`typememoryview` for more information.
 
 
-.. function:: min(iterable, *[, key])
+.. function:: min(iterable, *[, key, default])
               min(arg1, arg2, *args[, key])
 
    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.
+   If one positional argument is provided, it should be an :term:`iterable`.
+   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`.
+   There are two optional keyword-only arguments. The *key* argument specifies
+   a one-argument ordering function like that used for :meth:`list.sort`. The
+   *default* argument specifies an object to return if the provided iterable is
+   empty. If the iterable is empty and *default* is not provided, a
+   :exc:`ValueError` is raised.
 
    If multiple items are minimal, the function returns the first one
    encountered.  This is consistent with other sort-stability preserving tools
    such as ``sorted(iterable, key=keyfunc)[0]`` and ``heapq.nsmallest(1,
    iterable, key=keyfunc)``.
 
+   .. versionadded:: 3.4
+      The *default* keyword-only argument.
+
+
 .. function:: next(iterator[, default])
 
    Retrieve the next item from the *iterator* by calling its
@@ -812,7 +846,7 @@
    if the iterator is exhausted, otherwise :exc:`StopIteration` is raised.
 
 
-.. function:: object()
+.. class:: object()
 
    Return a new featureless object.  :class:`object` is a base for all classes.
    It has the methods that are common to all instances of Python classes.  This
@@ -866,8 +900,7 @@
    ``'b'``   binary mode
    ``'t'``   text mode (default)
    ``'+'``   open a disk file for updating (reading and writing)
-   ``'U'``   universal newlines mode (for backwards compatibility; should
-             not be used in new code)
+   ``'U'``   :term:`universal newlines` mode (deprecated)
    ========= ===============================================================
 
    The default mode is ``'r'`` (open for reading text, synonym of ``'rt'``).
@@ -906,15 +939,17 @@
    *encoding* is the name of the encoding used to decode or encode the file.
    This should only be used in text mode.  The default encoding is platform
    dependent (whatever :func:`locale.getpreferredencoding` returns), but any
-   encoding supported by Python can be used.  See the :mod:`codecs` module for
+   :term:`text encoding` supported by Python
+   can be used.  See the :mod:`codecs` module for
    the list of supported encodings.
 
    *errors* is an optional string that specifies how encoding and decoding
    errors are to be handled--this cannot be used in binary mode.
-   A variety of standard error handlers are available, though any
+   A variety of standard error handlers are available
+   (listed under :ref:`error-handlers`), though any
    error handling name that has been registered with
    :func:`codecs.register_error` is also valid.  The standard names
-   are:
+   include:
 
    * ``'strict'`` to raise a :exc:`ValueError` exception if there is
      an encoding error.  The default value of ``None`` has the same
@@ -973,6 +1008,8 @@
    :mod:`os.open` as *opener* results in functionality similar to passing
    ``None``).
 
+   The newly created file is :ref:`non-inheritable <fd_inheritance>`.
+
    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::
 
@@ -986,10 +1023,6 @@
       ...
       >>> os.close(dir_fd)  # don't leak a file descriptor
 
-   .. versionchanged:: 3.3
-      The *opener* parameter was added.
-      The ``'x'`` mode was added.
-
    The type of :term:`file object` returned by the :func:`open` function
    depends on the mode.  When :func:`open` is used to open a file in a text
    mode (``'w'``, ``'r'``, ``'wt'``, ``'rt'``, etc.), it returns a subclass of
@@ -1016,10 +1049,19 @@
    and :mod:`shutil`.
 
    .. versionchanged:: 3.3
+      The *opener* parameter was added.
+      The ``'x'`` mode was added.
       :exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`.
       :exc:`FileExistsError` is now raised if the file opened in exclusive
       creation mode (``'x'``) already exists.
 
+   .. versionchanged:: 3.4
+      The file is now non-inheritable.
+
+   .. deprecated-removed:: 3.4 4.0
+
+      The ``'U'`` mode.
+
 
 .. XXX works for bytes too, but should it?
 .. function:: ord(c)
@@ -1048,8 +1090,8 @@
 
 .. function:: print(*objects, sep=' ', end='\\n', file=sys.stdout, flush=False)
 
-   Print *objects* to the stream *file*, separated by *sep* and followed by
-   *end*.  *sep*, *end* and *file*, if present, must be given as keyword
+   Print *objects* to the text 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
@@ -1059,21 +1101,26 @@
    *end*.
 
    The *file* argument must be an object with a ``write(string)`` method; if it
-   is not present or ``None``, :data:`sys.stdout` will be used.  Whether output
-   is buffered is usually determined by *file*, but if the  *flush* keyword
-   argument is true, the stream is forcibly flushed.
+   is not present or ``None``, :data:`sys.stdout` will be used.  Since printed
+   arguments are converted to text strings, :func:`print` cannot be used with
+   binary mode file objects.  For these, use ``file.write(...)`` instead.
+
+   Whether output is buffered is usually determined by *file*, but if the
+   *flush* keyword argument is true, the stream is forcibly flushed.
 
    .. versionchanged:: 3.3
       Added the *flush* keyword argument.
 
 
-.. function:: property(fget=None, fset=None, fdel=None, doc=None)
+.. class:: property(fget=None, fset=None, fdel=None, doc=None)
 
    Return a property attribute.
 
-   *fget* is a function for getting an attribute value, likewise *fset* is a
-   function for setting, and *fdel* a function for del'ing, an attribute.  Typical
-   use is to define a managed attribute ``x``::
+   *fget* is a function for getting an attribute value.  *fset* is a function
+   for setting an attribute value. *fdel* is a function for deleting an attribute
+   value.  And *doc* creates a docstring for the attribute.
+
+   A typical use is to define a managed attribute ``x``::
 
       class C:
           def __init__(self):
@@ -1081,13 +1128,16 @@
 
           def getx(self):
               return self._x
+
           def setx(self, value):
               self._x = value
+
           def delx(self):
               del self._x
+
           x = property(getx, setx, delx, "I'm the 'x' property.")
 
-   If then *c* is an instance of *C*, ``c.x`` will invoke the getter,
+   If *c* is an instance of *C*, ``c.x`` will invoke the getter,
    ``c.x = value`` will invoke the setter and ``del c.x`` the deleter.
 
    If given, *doc* will be the docstring of the property attribute. Otherwise, the
@@ -1103,8 +1153,9 @@
               """Get the current voltage."""
               return self._voltage
 
-   turns the :meth:`voltage` method into a "getter" for a read-only attribute
-   with the same name.
+   The ``@property`` decorator turns the :meth:`voltage` method into a "getter"
+   for a read-only attribute with the same name, and it sets the docstring for
+   *voltage* to "Get the current voltage."
 
    A property object has :attr:`~property.getter`, :attr:`~property.setter`,
    and :attr:`~property.deleter` methods usable as decorators that create a
@@ -1132,7 +1183,7 @@
    additional functions the same name as the original property (``x`` in this
    case.)
 
-   The returned property also has the attributes ``fget``, ``fset``, and
+   The returned property object also has the attributes ``fget``, ``fset``, and
    ``fdel`` corresponding to the constructor arguments.
 
 
@@ -1187,7 +1238,7 @@
 
 
 .. _func-set:
-.. function:: set([iterable])
+.. class:: set([iterable])
    :noindex:
 
    Return a new :class:`set` object, optionally with elements taken from
@@ -1208,8 +1259,8 @@
    ``x.foobar = 123``.
 
 
-.. function:: slice(stop)
-              slice(start, stop[, step])
+.. class:: slice(stop)
+           slice(start, stop[, step])
 
    .. index:: single: Numerical Python
 
@@ -1240,8 +1291,13 @@
    Use :func:`functools.cmp_to_key` to convert an old-style *cmp* function to a
    *key* function.
 
+   The built-in :func:`sorted` function is guaranteed to be stable. A sort is
+   stable if it guarantees not to change the relative order of elements that
+   compare equal --- this is helpful for sorting in multiple passes (for
+   example, sort by department, then by salary grade).
+
    For sorting examples and a brief sorting tutorial, see `Sorting HowTo
-   <http://wiki.python.org/moin/HowTo/Sorting/>`_\.
+   <https://wiki.python.org/moin/HowTo/Sorting/>`_\.
 
 .. function:: staticmethod(function)
 
@@ -1272,8 +1328,8 @@
 
 
 .. _func-str:
-.. function:: str(object='')
-              str(object=b'', encoding='utf-8', errors='strict')
+.. class:: str(object='')
+           str(object=b'', encoding='utf-8', errors='strict')
    :noindex:
 
    Return a :class:`str` version of *object*.  See :func:`str` for details.
@@ -1360,12 +1416,11 @@
    sequence type, as documented in :ref:`typesseq-tuple` and :ref:`typesseq`.
 
 
-.. function:: type(object)
-              type(name, bases, dict)
+.. class:: type(object)
+           type(name, bases, dict)
 
    .. index:: object: type
 
-
    With one argument, return the type of an *object*.  The return value is a
    type object and generally the same object as returned by
    :attr:`object.__class__ <instance.__class__>`.
diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst
index 3c946e3..46aa887 100644
--- a/Doc/library/functools.rst
+++ b/Doc/library/functools.rst
@@ -6,6 +6,7 @@
 .. moduleauthor:: Peter Harris <scav@blueyonder.co.uk>
 .. moduleauthor:: Raymond Hettinger <python@rcn.com>
 .. moduleauthor:: Nick Coghlan <ncoghlan@gmail.com>
+.. moduleauthor:: Łukasz Langa <lukasz@langa.pl>
 .. sectionauthor:: Peter Harris <scav@blueyonder.co.uk>
 
 **Source code:** :source:`Lib/functools.py`
@@ -20,8 +21,8 @@
 
 .. function:: cmp_to_key(func)
 
-   Transform an old-style comparison function to a key function.  Used with
-   tools that accept key functions (such as :func:`sorted`, :func:`min`,
+   Transform an old-style comparison function to a :term:`key function`.  Used
+   with tools that accept key functions (such as :func:`sorted`, :func:`min`,
    :func:`max`, :func:`heapq.nlargest`, :func:`heapq.nsmallest`,
    :func:`itertools.groupby`).  This function is primarily used as a transition
    tool for programs being converted from Python 2 which supported the use of
@@ -30,13 +31,14 @@
    A comparison function is any callable that accept two arguments, compares them,
    and returns a negative number for less-than, zero for equality, or a positive
    number for greater-than.  A key function is a callable that accepts one
-   argument and returns another value indicating the position in the desired
-   collation sequence.
+   argument and returns another value to be used as the sort key.
 
    Example::
 
        sorted(iterable, key=cmp_to_key(locale.strcoll))  # locale-aware sort order
 
+   For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`.
+
    .. versionadded:: 3.2
 
 
@@ -71,7 +73,7 @@
    bypassing the cache, or for rewrapping the function with a different cache.
 
    An `LRU (least recently used) cache
-   <http://en.wikipedia.org/wiki/Cache_algorithms#Least_Recently_Used>`_ works
+   <http://en.wikipedia.org/wiki/Cache_algorithms#Examples>`_ works
    best when the most recent calls are the best predictors of upcoming calls (for
    example, the most popular articles on a news server tend to change each day).
    The cache's size limit assures that the cache does not grow without bound on
@@ -133,15 +135,34 @@
 
        @total_ordering
        class Student:
+           def _is_valid_operand(self, other):
+               return (hasattr(other, "lastname") and
+                       hasattr(other, "firstname"))
            def __eq__(self, other):
+               if not self._is_valid_operand(other):
+                   return NotImplemented
                return ((self.lastname.lower(), self.firstname.lower()) ==
                        (other.lastname.lower(), other.firstname.lower()))
            def __lt__(self, other):
+               if not self._is_valid_operand(other):
+                   return NotImplemented
                return ((self.lastname.lower(), self.firstname.lower()) <
                        (other.lastname.lower(), other.firstname.lower()))
 
+   .. note::
+
+      While this decorator makes it easy to create well behaved totally
+      ordered types, it *does* come at the cost of slower execution and
+      more complex stack traces for the derived comparison methods. If
+      performance benchmarking indicates this is a bottleneck for a given
+      application, implementing all six rich comparison methods instead is
+      likely to provide an easy speed boost.
+
    .. versionadded:: 3.2
 
+   .. versionchanged:: 3.4
+      Returning NotImplemented from the underlying comparison function for
+      unrecognised types is now supported.
 
 .. function:: partial(func, *args, **keywords)
 
@@ -174,6 +195,50 @@
       18
 
 
+.. class:: partialmethod(func, *args, **keywords)
+
+   Return a new :class:`partialmethod` descriptor which behaves
+   like :class:`partial` except that it is designed to be used as a method
+   definition rather than being directly callable.
+
+   *func* must be a :term:`descriptor` or a callable (objects which are both,
+   like normal functions, are handled as descriptors).
+
+   When *func* is a descriptor (such as a normal Python function,
+   :func:`classmethod`, :func:`staticmethod`, :func:`abstractmethod` or
+   another instance of :class:`partialmethod`), calls to ``__get__`` are
+   delegated to the underlying descriptor, and an appropriate
+   :class:`partial` object returned as the result.
+
+   When *func* is a non-descriptor callable, an appropriate bound method is
+   created dynamically. This behaves like a normal Python function when
+   used as a method: the *self* argument will be inserted as the first
+   positional argument, even before the *args* and *keywords* supplied to
+   the :class:`partialmethod` constructor.
+
+   Example::
+
+      >>> class Cell(object):
+      ...     def __init__(self):
+      ...         self._alive = False
+      ...     @property
+      ...     def alive(self):
+      ...         return self._alive
+      ...     def set_state(self, state):
+      ...         self._alive = bool(state)
+      ...     set_alive = partialmethod(set_state, True)
+      ...     set_dead = partialmethod(set_state, False)
+      ...
+      >>> c = Cell()
+      >>> c.alive
+      False
+      >>> c.set_alive()
+      >>> c.alive
+      True
+
+   .. versionadded:: 3.4
+
+
 .. function:: reduce(function, iterable[, initializer])
 
    Apply *function* of two arguments cumulatively to the items of *sequence*, from
@@ -185,7 +250,7 @@
    a default when the sequence is empty.  If *initializer* is not given and
    *sequence* contains only one item, the first item is returned.
 
-   Equivalent to::
+   Roughly equivalent to::
 
       def reduce(function, iterable, initializer=None):
           it = iter(iterable)
@@ -198,6 +263,111 @@
           return value
 
 
+.. decorator:: singledispatch(default)
+
+   Transforms a function into a :term:`single-dispatch <single
+   dispatch>` :term:`generic function`.
+
+   To define a generic function, decorate it with the ``@singledispatch``
+   decorator. Note that the dispatch happens on the type of the first argument,
+   create your function accordingly::
+
+     >>> from functools import singledispatch
+     >>> @singledispatch
+     ... def fun(arg, verbose=False):
+     ...     if verbose:
+     ...         print("Let me just say,", end=" ")
+     ...     print(arg)
+
+   To add overloaded implementations to the function, use the :func:`register`
+   attribute of the generic function.  It is a decorator, taking a type
+   parameter and decorating a function implementing the operation for that
+   type::
+
+     >>> @fun.register(int)
+     ... def _(arg, verbose=False):
+     ...     if verbose:
+     ...         print("Strength in numbers, eh?", end=" ")
+     ...     print(arg)
+     ...
+     >>> @fun.register(list)
+     ... def _(arg, verbose=False):
+     ...     if verbose:
+     ...         print("Enumerate this:")
+     ...     for i, elem in enumerate(arg):
+     ...         print(i, elem)
+
+   To enable registering lambdas and pre-existing functions, the
+   :func:`register` attribute can be used in a functional form::
+
+     >>> def nothing(arg, verbose=False):
+     ...     print("Nothing.")
+     ...
+     >>> fun.register(type(None), nothing)
+
+   The :func:`register` attribute returns the undecorated function which
+   enables decorator stacking, pickling, as well as creating unit tests for
+   each variant independently::
+
+     >>> @fun.register(float)
+     ... @fun.register(Decimal)
+     ... def fun_num(arg, verbose=False):
+     ...     if verbose:
+     ...         print("Half of your number:", end=" ")
+     ...     print(arg / 2)
+     ...
+     >>> fun_num is fun
+     False
+
+   When called, the generic function dispatches on the type of the first
+   argument::
+
+     >>> fun("Hello, world.")
+     Hello, world.
+     >>> fun("test.", verbose=True)
+     Let me just say, test.
+     >>> fun(42, verbose=True)
+     Strength in numbers, eh? 42
+     >>> fun(['spam', 'spam', 'eggs', 'spam'], verbose=True)
+     Enumerate this:
+     0 spam
+     1 spam
+     2 eggs
+     3 spam
+     >>> fun(None)
+     Nothing.
+     >>> fun(1.23)
+     0.615
+
+   Where there is no registered implementation for a specific type, its
+   method resolution order is used to find a more generic implementation.
+   The original function decorated with ``@singledispatch`` is registered
+   for the base ``object`` type, which means it is used if no better
+   implementation is found.
+
+   To check which implementation will the generic function choose for
+   a given type, use the ``dispatch()`` attribute::
+
+     >>> fun.dispatch(float)
+     <function fun_num at 0x1035a2840>
+     >>> fun.dispatch(dict)    # note: default implementation
+     <function fun at 0x103fe0000>
+
+   To access all registered implementations, use the read-only ``registry``
+   attribute::
+
+    >>> fun.registry.keys()
+    dict_keys([<class 'NoneType'>, <class 'int'>, <class 'object'>,
+              <class 'decimal.Decimal'>, <class 'list'>,
+              <class 'float'>])
+    >>> fun.registry[float]
+    <function fun_num at 0x1035a2840>
+    >>> fun.registry[object]
+    <function fun at 0x103fe0000>
+
+   .. versionadded:: 3.4
+
+
 .. function:: update_wrapper(wrapper, wrapped, assigned=WRAPPER_ASSIGNMENTS, updated=WRAPPER_UPDATES)
 
    Update a *wrapper* function to look like the *wrapped* function. The optional
@@ -212,8 +382,8 @@
 
    To allow access to the original function for introspection and other purposes
    (e.g. bypassing a caching decorator such as :func:`lru_cache`), this function
-   automatically adds a __wrapped__ attribute to the wrapper that refers to
-   the original function.
+   automatically adds a ``__wrapped__`` attribute to the wrapper that refers to
+   the function being wrapped.
 
    The main intended use for this function is in :term:`decorator` functions which
    wrap the decorated function and return the wrapper. If the wrapper function is
@@ -236,12 +406,18 @@
    .. versionchanged:: 3.2
       Missing attributes no longer trigger an :exc:`AttributeError`.
 
+   .. versionchanged:: 3.4
+      The ``__wrapped__`` attribute now always refers to the wrapped
+      function, even if that function defined a ``__wrapped__`` attribute.
+      (see :issue:`17482`)
+
 
 .. decorator:: 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
-   when defining a wrapper function. For example:
+   This is a convenience function for invoking :func:`update_wrapper` as a
+   function decorator when defining a wrapper function.  It is equivalent to
+   ``partial(update_wrapper, wrapped=wrapped, assigned=assigned, updated=updated)``.
+   For example::
 
       >>> from functools import wraps
       >>> def my_decorator(f):
@@ -301,4 +477,3 @@
 are not created automatically.  Also, :class:`partial` objects defined in
 classes behave like static methods and do not transform into bound methods
 during instance attribute look-up.
-
diff --git a/Doc/library/gc.rst b/Doc/library/gc.rst
index 71449a3..8135542 100644
--- a/Doc/library/gc.rst
+++ b/Doc/library/gc.rst
@@ -67,6 +67,25 @@
    returned.
 
 
+.. function:: get_stats()
+
+   Return a list of three per-generation dictionaries containing collection
+   statistics since interpreter start.  The number of keys may change
+   in the future, but currently each dictionary will contain the following
+   items:
+
+   * ``collections`` is the number of times this generation was collected;
+
+   * ``collected`` is the total number of objects collected inside this
+     generation;
+
+   * ``uncollectable`` is the total number of objects which were found
+     to be uncollectable (and were therefore moved to the :data:`garbage`
+     list) inside this generation.
+
+   .. versionadded:: 3.4
+
+
 .. function:: set_threshold(threshold0[, threshold1[, threshold2]])
 
    Set the garbage collection thresholds (the collection frequency). Setting
@@ -158,24 +177,13 @@
 
 .. data:: garbage
 
-   A list of objects which the collector found to be unreachable but could not be
-   freed (uncollectable objects).  By default, this list contains only objects with
-   :meth:`__del__` methods. Objects that have :meth:`__del__` methods and are
-   part of a reference cycle cause the entire reference cycle to be uncollectable,
-   including objects not necessarily in the cycle but reachable only from it.
-   Python doesn't collect such cycles automatically because, in general, it isn't
-   possible for Python to guess a safe order in which to run the :meth:`__del__`
-   methods.  If you know a safe order, you can force the issue by examining the
-   *garbage* list, and explicitly breaking cycles due to your objects within the
-   list.  Note that these objects are kept alive even so by virtue of being in the
-   *garbage* list, so they should be removed from *garbage* too.  For example,
-   after breaking cycles, do ``del gc.garbage[:]`` to empty the list.  It's
-   generally better to avoid the issue by not creating cycles containing objects
-   with :meth:`__del__` methods, and *garbage* can be examined in that case to
-   verify that no such cycles are being created.
+   A list of objects which the collector found to be unreachable but could
+   not be freed (uncollectable objects).  Starting with Python 3.4, this
+   list should be empty most of the time, except when using instances of
+   C extension types with a non-NULL ``tp_del`` slot.
 
-   If :const:`DEBUG_SAVEALL` is set, then all unreachable objects will be added
-   to this list rather than freed.
+   If :const:`DEBUG_SAVEALL` is set, then all unreachable objects will be
+   added to this list rather than freed.
 
    .. versionchanged:: 3.2
       If this list is non-empty at interpreter shutdown, a
@@ -183,6 +191,10 @@
       :const:`DEBUG_UNCOLLECTABLE` is set, in addition all uncollectable objects
       are printed.
 
+   .. versionchanged:: 3.4
+      Following :pep:`442`, objects with a :meth:`__del__` method don't end
+      up in :attr:`gc.garbage` anymore.
+
 .. data:: callbacks
 
    A list of callbacks that will be invoked by the garbage collector before and
diff --git a/Doc/library/getpass.rst b/Doc/library/getpass.rst
index ffe2b12..211563e 100644
--- a/Doc/library/getpass.rst
+++ b/Doc/library/getpass.rst
@@ -13,10 +13,11 @@
 .. function:: getpass(prompt='Password: ', stream=None)
 
    Prompt the user for a password without echoing.  The user is prompted using
-   the string *prompt*, which defaults to ``'Password: '``.  On Unix, the prompt
-   is written to the file-like object *stream*.  *stream* defaults to the
-   controlling terminal (:file:`/dev/tty`) or if that is unavailable to
-   ``sys.stderr`` (this argument is ignored on Windows).
+   the string *prompt*, which defaults to ``'Password: '``.  On Unix, the
+   prompt is written to the file-like object *stream* using the replace error
+   handler if needed.  *stream* defaults to the controlling terminal
+   (:file:`/dev/tty`) or if that is unavailable to ``sys.stderr`` (this
+   argument is ignored on Windows).
 
    If echo free input is unavailable getpass() falls back to printing
    a warning message to *stream* and reading from ``sys.stdin`` and
diff --git a/Doc/library/gettext.rst b/Doc/library/gettext.rst
index 982780f..ff23b59 100644
--- a/Doc/library/gettext.rst
+++ b/Doc/library/gettext.rst
@@ -460,7 +460,7 @@
 internationalization library that includes a :file:`pybabel` script to
 extract and compile message catalogs.  François Pinard's program
 called :program:`xpot` does a similar job and is available as part of
-his `po-utils package <http://po-utils.progiciels-bpi.ca/>`__.
+his `po-utils package <https://github.com/pinard/po-utils>`__.
 
 (Python also includes pure-Python versions of these programs, called
 :program:`pygettext.py` and :program:`msgfmt.py`; some Python distributions
diff --git a/Doc/library/glob.rst b/Doc/library/glob.rst
index eff138b..abcbf38 100644
--- a/Doc/library/glob.rst
+++ b/Doc/library/glob.rst
@@ -25,6 +25,10 @@
 For example, ``'[?]'`` matches the character ``'?'``.
 
 
+.. seealso::
+   The :mod:`pathlib` module offers high-level path objects.
+
+
 .. function:: glob(pathname)
 
    Return a possibly-empty list of path names that match *pathname*, which must be
@@ -40,6 +44,17 @@
    without actually storing them all simultaneously.
 
 
+.. function:: escape(pathname)
+
+   Escape all special characters (``'?'``, ``'*'`` and ``'['``).
+   This is useful if you want to match an arbitrary literal string that may
+   have special characters in it.  Special characters in drive/UNC
+   sharepoints are not escaped, e.g. on Windows
+   ``escape('//?/c:/Quo vadis?.txt')`` returns ``'//?/c:/Quo vadis[?].txt'``.
+
+   .. versionadded:: 3.4
+
+
 For example, consider a directory containing only the following files:
 :file:`1.gif`, :file:`2.txt`, and :file:`card.gif`.  :func:`glob` will produce
 the following results.  Notice how any leading components of the path are
diff --git a/Doc/library/gzip.rst b/Doc/library/gzip.rst
index 354deed..78536fa 100644
--- a/Doc/library/gzip.rst
+++ b/Doc/library/gzip.rst
@@ -35,8 +35,8 @@
    :class:`bytes` object), or an existing file object to read from or write to.
 
    The *mode* argument can be any of ``'r'``, ``'rb'``, ``'a'``, ``'ab'``,
-   ``'w'``, or ``'wb'`` for binary mode, or ``'rt'``, ``'at'``, or ``'wt'`` for
-   text mode. The default is ``'rb'``.
+   ``'w'``, ``'wb'``, ``'x'`` or ``'xb'`` for binary mode, or ``'rt'``,
+   ``'at'``, ``'wt'``, or ``'xt'`` for text mode. The default is ``'rb'``.
 
    The *compresslevel* argument is an integer from 0 to 9, as for the
    :class:`GzipFile` constructor.
@@ -53,6 +53,9 @@
       Added support for *filename* being a file object, support for text mode,
       and the *encoding*, *errors* and *newline* arguments.
 
+   .. versionchanged:: 3.4
+      Added support for the ``'x'``, ``'xb'`` and ``'xt'`` modes.
+
 
 .. class:: GzipFile(filename=None, mode=None, compresslevel=9, fileobj=None, mtime=None)
 
@@ -73,8 +76,9 @@
    original filename is not included in the header.
 
    The *mode* argument can be any of ``'r'``, ``'rb'``, ``'a'``, ``'ab'``, ``'w'``,
-   or ``'wb'``, depending on whether the file will be read or written.  The default
-   is the mode of *fileobj* if discernible; otherwise, the default is ``'rb'``.
+   ``'wb'``, ``'x'``, or ``'xb'``, depending on whether the file will be read or
+   written.  The default is the mode of *fileobj* if discernible; otherwise, the
+   default is ``'rb'``.
 
    Note that the file is always opened in binary mode. To open a compressed file
    in text mode, use :func:`.open` (or wrap your :class:`GzipFile` with an
@@ -130,6 +134,9 @@
    .. versionchanged:: 3.3
       The :meth:`io.BufferedIOBase.read1` method is now implemented.
 
+   .. versionchanged:: 3.4
+      Added support for the ``'x'`` and ``'xb'`` modes.
+
 
 .. function:: compress(data, compresslevel=9)
 
diff --git a/Doc/library/hashlib.rst b/Doc/library/hashlib.rst
index a693f7e..e0a877a 100644
--- a/Doc/library/hashlib.rst
+++ b/Doc/library/hashlib.rst
@@ -32,6 +32,12 @@
    Some algorithms have known hash collision weaknesses, refer to the "See
    also" section at the end.
 
+
+.. _hash-algorithms:
+
+Hash algorithms
+---------------
+
 There is one constructor method named for each type of :dfn:`hash`.  All return
 a hash object with the same simple interface. For example: use :func:`sha1` to
 create a SHA1 hash object. You can now feed this object with :term:`bytes-like
@@ -53,9 +59,9 @@
 .. index:: single: OpenSSL; (use in module hashlib)
 
 Constructors for hash algorithms that are always present in this module are
-:func:`md5`, :func:`sha1`, :func:`sha224`, :func:`sha256`, :func:`sha384`, and
-:func:`sha512`.  Additional algorithms may also be available depending upon the
-OpenSSL library that Python uses on your platform.
+:func:`md5`, :func:`sha1`, :func:`sha224`, :func:`sha256`, :func:`sha384`,
+and :func:`sha512`. Additional algorithms may also be available depending upon
+the OpenSSL library that Python uses on your platform.
 
 For example, to obtain the digest of the byte string ``b'Nobody inspects the
 spammish repetition'``::
@@ -122,6 +128,18 @@
 
    The internal block size of the hash algorithm in bytes.
 
+A hash object has the following attributes:
+
+.. attribute:: hash.name
+
+   The canonical name of this hash, always lowercase and always suitable as a
+   parameter to :func:`new` to create another hash of this type.
+
+   .. versionchanged:: 3.4
+      The name attribute has been present in CPython since its inception, but
+      until Python 3.4 was not formally specified, so may not exist on some
+      platforms.
+
 A hash object has the following methods:
 
 
@@ -158,6 +176,46 @@
    compute the digests of data sharing a common initial substring.
 
 
+Key Derivation Function
+-----------------------
+
+Key derivation and key stretching algorithms are designed for secure password
+hashing. Naive algorithms such as ``sha1(password)`` are not resistant against
+brute-force attacks. A good password hashing function must be tunable, slow, and
+include a `salt <https://en.wikipedia.org/wiki/Salt_%28cryptography%29>`_.
+
+
+.. function:: pbkdf2_hmac(name, password, salt, rounds, dklen=None)
+
+   The function provides PKCS#5 password-based key derivation function 2. It
+   uses HMAC as pseudorandom function.
+
+   The string *name* is the desired name of the hash digest algorithm for
+   HMAC, e.g. 'sha1' or 'sha256'. *password* and *salt* are interpreted as
+   buffers of bytes. Applications and libraries should limit *password* to
+   a sensible value (e.g. 1024). *salt* should be about 16 or more bytes from
+   a proper source, e.g. :func:`os.urandom`.
+
+   The number of *rounds* should be chosen based on the hash algorithm and
+   computing power. As of 2013, at least 100,000 rounds of SHA-256 is suggested.
+
+   *dklen* is the length of the derived key. If *dklen* is ``None`` then the
+   digest size of the hash algorithm *name* is used, e.g. 64 for SHA-512.
+
+   >>> import hashlib, binascii
+   >>> dk = hashlib.pbkdf2_hmac('sha256', b'password', b'salt', 100000)
+   >>> binascii.hexlify(dk)
+   b'0394a2ede332c9a13eb82e9b24631604c31df978b4e2f0fbd2c549944f9d79a5'
+
+   .. versionadded:: 3.4
+
+   .. note::
+
+      A fast implementation of *pbkdf2_hmac* is available with OpenSSL.  The
+      Python implementation uses an inline version of :mod:`hmac`. It is about
+      three times slower and doesn't release the GIL.
+
+
 .. seealso::
 
    Module :mod:`hmac`
@@ -173,3 +231,5 @@
       Wikipedia article with information on which algorithms have known issues and
       what that means regarding their use.
 
+   http://www.ietf.org/rfc/rfc2898.txt
+      PKCS #5: Password-Based Cryptography Specification Version 2.0
diff --git a/Doc/library/heapq.rst b/Doc/library/heapq.rst
index 4f1a682..43088ad 100644
--- a/Doc/library/heapq.rst
+++ b/Doc/library/heapq.rst
@@ -123,7 +123,6 @@
 time::
 
    >>> def heapsort(iterable):
-   ...     'Equivalent to sorted(iterable)'
    ...     h = []
    ...     for value in iterable:
    ...         heappush(h, value)
@@ -132,6 +131,9 @@
    >>> heapsort([1, 3, 5, 7, 9, 2, 4, 6, 8, 0])
    [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
 
+This is similar to ``sorted(iterable)``, but unlike :func:`sorted`, this
+implementation is not stable.
+
 Heap elements can be tuples.  This is useful for assigning comparison values
 (such as task priorities) alongside the main record being tracked::
 
@@ -258,11 +260,11 @@
 the worst cases might be terrible.
 
 Heaps are also very useful in big disk sorts.  You most probably all know that a
-big sort implies producing "runs" (which are pre-sorted sequences, which size is
+big sort implies producing "runs" (which are pre-sorted sequences, whose size is
 usually related to the amount of CPU memory), followed by a merging passes for
 these runs, which merging is often very cleverly organised [#]_. It is very
 important that the initial sort produces the longest runs possible.  Tournaments
-are a good way to that.  If, using all the memory available to hold a
+are a good way to achieve that.  If, using all the memory available to hold a
 tournament, you replace and percolate items that happen to fit the current run,
 you'll produce runs which are twice the size of the memory for random input, and
 much better for input fuzzily ordered.
diff --git a/Doc/library/hmac.rst b/Doc/library/hmac.rst
index 9575693..b2e377f 100644
--- a/Doc/library/hmac.rst
+++ b/Doc/library/hmac.rst
@@ -16,20 +16,32 @@
 
 .. function:: new(key, msg=None, digestmod=None)
 
-   Return a new hmac object.  *key* is a bytes object giving the secret key.  If
-   *msg* is present, the method call ``update(msg)`` is made.  *digestmod* is
-   the digest constructor or module for the HMAC object to use. It defaults to
-   the :data:`hashlib.md5` constructor.
+   Return a new hmac object.  *key* is a bytes or bytearray object giving the
+   secret key.  If *msg* is present, the method call ``update(msg)`` is made.
+   *digestmod* is the digest name, digest constructor or module for the HMAC
+   object to use. It supports any name suitable to :func:`hashlib.new` and
+   defaults to the :data:`hashlib.md5` constructor.
+
+   .. versionchanged:: 3.4
+      Parameter *key* can be a bytes or bytearray object.
+      Parameter *msg* can be of any type supported by :mod:`hashlib`.
+      Parameter *digestmod* can be the name of a hash algorithm.
+
+   .. deprecated:: 3.4
+      MD5 as implicit default digest for *digestmod* is deprecated.
 
 
 An HMAC object has the following methods:
 
 .. method:: HMAC.update(msg)
 
-   Update the hmac object with the bytes object *msg*.  Repeated calls are
-   equivalent to a single call with the concatenation of all the arguments:
+   Update the hmac object with *msg*.  Repeated calls are equivalent to a
+   single call with the concatenation of all the arguments:
    ``m.update(a); m.update(b)`` is equivalent to ``m.update(a + b)``.
 
+   .. versionchanged:: 3.4
+      Parameter *msg* can be of any type supported by :mod:`hashlib`.
+
 
 .. method:: HMAC.digest()
 
@@ -66,6 +78,25 @@
    compute the digests of strings that share a common initial substring.
 
 
+A hash object has the following attributes:
+
+.. attribute:: HMAC.digest_size
+
+   The size of the resulting HMAC digest in bytes.
+
+.. attribute:: HMAC.block_size
+
+   The internal block size of the hash algorithm in bytes.
+
+   .. versionadded:: 3.4
+
+.. attribute:: HMAC.name
+
+   The canonical name of this HMAC, always lowercase, e.g. ``hmac-md5``.
+
+   .. versionadded:: 3.4
+
+
 This module also provides the following helper function:
 
 .. function:: compare_digest(a, b)
diff --git a/Doc/library/html.entities.rst b/Doc/library/html.entities.rst
index 0aabbad..e10e46e 100644
--- a/Doc/library/html.entities.rst
+++ b/Doc/library/html.entities.rst
@@ -20,6 +20,7 @@
    Note that the trailing semicolon is included in the name (e.g. ``'gt;'``),
    however some of the names are accepted by the standard even without the
    semicolon: in this case the name is present with and without the ``';'``.
+   See also :func:`html.unescape`.
 
    .. versionadded:: 3.3
 
@@ -32,12 +33,12 @@
 
 .. data:: name2codepoint
 
-   A dictionary that maps HTML entity names to the Unicode codepoints.
+   A dictionary that maps HTML entity names to the Unicode code points.
 
 
 .. data:: codepoint2name
 
-   A dictionary that maps Unicode codepoints to HTML entity names.
+   A dictionary that maps Unicode code points to HTML entity names.
 
 
 .. rubric:: Footnotes
diff --git a/Doc/library/html.parser.rst b/Doc/library/html.parser.rst
index e4154ef..44b7d6e 100644
--- a/Doc/library/html.parser.rst
+++ b/Doc/library/html.parser.rst
@@ -16,14 +16,21 @@
 This module defines a class :class:`HTMLParser` which serves as the basis for
 parsing text files formatted in HTML (HyperText Mark-up Language) and XHTML.
 
-.. class:: HTMLParser(strict=False)
+.. class:: HTMLParser(strict=False, *, convert_charrefs=False)
 
-   Create a parser instance.  If *strict* is ``False`` (the default), the parser
-   will accept and parse invalid markup.  If *strict* is ``True`` the parser
-   will raise an :exc:`~html.parser.HTMLParseError` exception instead [#]_ when
-   it's not able to parse the markup.
-   The use of ``strict=True`` is discouraged and the *strict* argument is
-   deprecated.
+   Create a parser instance.
+
+   If *convert_charrefs* is ``True`` (default: ``False``), all character
+   references (except the ones in ``script``/``style`` elements) are
+   automatically converted to the corresponding Unicode characters.
+   The use of ``convert_charrefs=True`` is encouraged and will become
+   the default in Python 3.5.
+
+   If *strict* is ``False`` (the default), the parser will accept and parse
+   invalid markup.  If *strict* is ``True`` the parser will raise an
+   :exc:`~html.parser.HTMLParseError` exception instead [#]_ when it's not
+   able to parse the markup.  The use of ``strict=True`` is discouraged and
+   the *strict* argument is deprecated.
 
    An :class:`.HTMLParser` instance is fed HTML data and calls handler methods
    when start tags, end tags, text, comments, and other markup elements are
@@ -34,12 +41,15 @@
    handler for elements which are closed implicitly by closing an outer element.
 
    .. versionchanged:: 3.2
-      *strict* keyword added.
+      *strict* argument added.
 
    .. deprecated-removed:: 3.3 3.5
       The *strict* argument and the strict mode have been deprecated.
       The parser is now able to accept and parse invalid markup too.
 
+   .. versionchanged:: 3.4
+      *convert_charrefs* keyword argument added.
+
 An exception is defined as well:
 
 
@@ -74,7 +84,7 @@
        def handle_data(self, data):
            print("Encountered some data  :", data)
 
-   parser = MyHTMLParser(strict=False)
+   parser = MyHTMLParser()
    parser.feed('<html><head><title>Test</title></head>'
                '<body><h1>Parse me!</h1></body></html>')
 
@@ -181,7 +191,8 @@
 
    This method is called to process a named character reference of the form
    ``&name;`` (e.g. ``&gt;``), where *name* is a general entity reference
-   (e.g. ``'gt'``).
+   (e.g. ``'gt'``).  This method is never called if *convert_charrefs* is
+   ``True``.
 
 
 .. method:: HTMLParser.handle_charref(name)
@@ -189,7 +200,8 @@
    This method is called to process decimal and hexadecimal numeric character
    references of the form ``&#NNN;`` and ``&#xNNN;``.  For example, the decimal
    equivalent for ``&gt;`` is ``&#62;``, whereas the hexadecimal is ``&#x3E;``;
-   in this case the method will receive ``'62'`` or ``'x3E'``.
+   in this case the method will receive ``'62'`` or ``'x3E'``.  This method
+   is never called if *convert_charrefs* is ``True``.
 
 
 .. method:: HTMLParser.handle_comment(data)
@@ -272,7 +284,7 @@
        def handle_decl(self, data):
            print("Decl     :", data)
 
-   parser = MyHTMLParser(strict=False)
+   parser = MyHTMLParser()
 
 Parsing a doctype::
 
@@ -324,7 +336,8 @@
    Num ent  : >
 
 Feeding incomplete chunks to :meth:`~HTMLParser.feed` works, but
-:meth:`~HTMLParser.handle_data` might be called more than once::
+:meth:`~HTMLParser.handle_data` might be called more than once
+(unless *convert_charrefs* is set to ``True``)::
 
    >>> for chunk in ['<sp', 'an>buff', 'ered ', 'text</s', 'pan>']:
    ...     parser.feed(chunk)
diff --git a/Doc/library/html.rst b/Doc/library/html.rst
index 1107ca9..d0706bc 100644
--- a/Doc/library/html.rst
+++ b/Doc/library/html.rst
@@ -20,6 +20,17 @@
 
    .. versionadded:: 3.2
 
+
+.. function:: unescape(s)
+
+   Convert all named and numeric character references (e.g. ``&gt;``,
+   ``&#62;``, ``&x3e;``) in the string *s* to the corresponding unicode
+   characters.  This function uses the rules defined by the HTML 5 standard
+   for both valid and invalid character references, and the :data:`list of
+   HTML 5 named character references <html.entities.html5>`.
+
+   .. versionadded:: 3.4
+
 --------------
 
 Submodules in the ``html`` package are:
diff --git a/Doc/library/http.client.rst b/Doc/library/http.client.rst
index bb30f24..a3f2e35 100644
--- a/Doc/library/http.client.rst
+++ b/Doc/library/http.client.rst
@@ -27,7 +27,7 @@
 The module provides the following classes:
 
 
-.. class:: HTTPConnection(host, port=None[, strict][, timeout], \
+.. class:: HTTPConnection(host, port=None[, timeout], \
                           source_address=None)
 
    An :class:`HTTPConnection` instance represents one transaction with an HTTP
@@ -43,44 +43,37 @@
    For example, the following calls all create instances that connect to the server
    at the same host and port::
 
-      >>> h1 = http.client.HTTPConnection('www.cwi.nl')
-      >>> h2 = http.client.HTTPConnection('www.cwi.nl:80')
-      >>> h3 = http.client.HTTPConnection('www.cwi.nl', 80)
-      >>> h3 = http.client.HTTPConnection('www.cwi.nl', 80, timeout=10)
+      >>> h1 = http.client.HTTPConnection('www.python.org')
+      >>> h2 = http.client.HTTPConnection('www.python.org:80')
+      >>> h3 = http.client.HTTPConnection('www.python.org', 80)
+      >>> h4 = http.client.HTTPConnection('www.python.org', 80, timeout=10)
 
    .. versionchanged:: 3.2
       *source_address* was added.
 
-   .. deprecated-removed:: 3.2 3.4
-      The *strict* parameter is deprecated.  HTTP 0.9-style "Simple Responses"
-      are not supported anymore.
+   .. versionchanged:: 3.4
+      The  *strict* parameter was removed. HTTP 0.9-style "Simple Responses" are
+      not longer supported.
 
 
 .. class:: HTTPSConnection(host, port=None, key_file=None, \
-                           cert_file=None[, strict][, timeout], \
+                           cert_file=None[, 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
    must be a :class:`ssl.SSLContext` instance describing the various SSL
-   options.  If *context* is specified and has a :attr:`~ssl.SSLContext.verify_mode`
-   of either :data:`~ssl.CERT_OPTIONAL` or :data:`~ssl.CERT_REQUIRED`, then
-   by default *host* is matched against the host name(s) allowed by the
-   server's certificate.  If you want to change that behaviour, you can
-   explicitly set *check_hostname* to False.
+   options.
 
    *key_file* and *cert_file* are deprecated, please use
-   :meth:`ssl.SSLContext.load_cert_chain` instead.
+   :meth:`ssl.SSLContext.load_cert_chain` instead, or let
+   :func:`ssl.create_default_context` select the system's trusted CA
+   certificates for you.  The *check_hostname* parameter is also deprecated; the
+   :attr:`ssl.SSLContext.check_hostname` attribute of *context* should be used
+   instead.
 
-   If you access arbitrary hosts on the Internet, it is recommended to
-   require certificate checking and feed the *context* with a set of
-   trusted CA certificates::
-
-      context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-      context.verify_mode = ssl.CERT_REQUIRED
-      context.load_verify_locations('/etc/pki/tls/certs/ca-bundle.crt')
-      h = client.HTTPSConnection('svn.python.org', 443, context=context)
+   Please read :ref:`ssl-security` for more information on best practices.
 
    .. versionchanged:: 3.2
       *source_address*, *context* and *check_hostname* were added.
@@ -89,19 +82,25 @@
       This class now supports HTTPS virtual hosts if possible (that is,
       if :data:`ssl.HAS_SNI` is true).
 
-   .. deprecated-removed:: 3.2 3.4
-      The *strict* parameter is deprecated.  HTTP 0.9-style "Simple Responses"
-      are not supported anymore.
+   .. versionchanged:: 3.4
+      The *strict* parameter was removed. HTTP 0.9-style "Simple Responses" are
+      no longer supported.
+
+   .. versionchanged:: 3.4.3
+      This class now performs all the necessary certificate and hostname checks
+      by default. To revert to the previous, unverified, behavior
+      :func:`ssl._create_unverified_context` can be passed to the *context*
+      parameter.
 
 
-.. class:: HTTPResponse(sock, debuglevel=0[, strict], method=None, url=None)
+.. class:: HTTPResponse(sock, debuglevel=0, method=None, url=None)
 
    Class whose instances are returned upon successful connection.  Not
    instantiated directly by user.
 
-   .. deprecated-removed:: 3.2 3.4
-      The *strict* parameter is deprecated.  HTTP 0.9-style "Simple Responses"
-      are not supported anymore.
+   .. versionchanged:: 3.4
+      The *strict* parameter was removed. HTTP 0.9 style "Simple Responses" are
+      no longer supported.
 
 
 The following exceptions are raised as appropriate:
@@ -656,7 +655,7 @@
 
     >>> # This creates an HTTP message
     >>> # with the content of BODY as the enclosed representation
-    >>> # for the resource http://localhost:8080/foobar
+    >>> # for the resource http://localhost:8080/file
     ...
     >>> import http.client
     >>> BODY = "***filecontents***"
diff --git a/Doc/library/http.cookiejar.rst b/Doc/library/http.cookiejar.rst
index 2fae47c..1f6b1ba 100644
--- a/Doc/library/http.cookiejar.rst
+++ b/Doc/library/http.cookiejar.rst
@@ -115,7 +115,7 @@
       :mod:`http.cookiejar` and :mod:`http.cookies` modules do not depend on each
       other.
 
-   http://wp.netscape.com/newsref/std/cookie_spec.html
+   http://curl.haxx.se/rfc/cookie_spec.html
       The specification of the original Netscape cookie protocol.  Though this is
       still the dominant protocol, the 'Netscape cookie protocol' implemented by all
       the major browsers (and :mod:`http.cookiejar`) only bears a passing resemblance to
diff --git a/Doc/library/http.server.rst b/Doc/library/http.server.rst
index 5aeb719..0d8e7fe 100644
--- a/Doc/library/http.server.rst
+++ b/Doc/library/http.server.rst
@@ -81,7 +81,10 @@
 
       Holds an instance of the class specified by the :attr:`MessageClass` class
       variable. This instance parses and manages the headers in the HTTP
-      request.
+      request. The :func:`~http.client.parse_headers` function from
+      :mod:`http.client` is used to parse the headers and it requires that the
+      HTTP request provide a valid :rfc:`2822` style header.
+
 
    .. attribute:: rfile
 
@@ -116,7 +119,7 @@
       HTTP error code value. *message* should be a string containing a
       (detailed) error message of what occurred, and *explain* should be an
       explanation of the error code number. Default *message* and *explain*
-      values can found in the *responses* class variable.
+      values can found in the :attr:`responses` class variable.
 
    .. attribute:: error_content_type
 
@@ -170,12 +173,22 @@
 
       .. versionadded:: 3.2
 
-   .. method:: send_error(code, message=None)
+   .. method:: send_error(code, message=None, explain=None)
 
       Sends and logs a complete error reply to the client. The numeric *code*
-      specifies the HTTP error code, with *message* as optional, more specific text. A
-      complete set of headers is sent, followed by text composed using the
-      :attr:`error_message_format` class variable.
+      specifies the HTTP error code, with *message* as an optional, short, human
+      readable description of the error.  The *explain* argument can be used to
+      provide more detailed information about the error; it will be formatted
+      using the :attr:`error_message_format` class variable and emitted, after
+      a complete set of headers, as the response body.  The :attr:`responses`
+      class variable holds the default values for *message* and *explain* that
+      will be used if no value is provided; for unknown codes the default value
+      for both is the string ``???``.
+
+      .. versionchanged:: 3.4
+         The error response includes a Content-Length header.
+         Added the *explain* argument.
+
 
    .. method:: send_response(code, message=None)
 
@@ -341,7 +354,7 @@
 
 The :class:`SimpleHTTPRequestHandler` class can be used in the following
 manner in order to create a very basic webserver serving files relative to
-the current directory. ::
+the current directory::
 
    import http.server
    import socketserver
@@ -355,12 +368,23 @@
    print("serving at port", PORT)
    httpd.serve_forever()
 
+.. _http-server-cli:
+
 :mod:`http.server` can also be invoked directly using the :option:`-m`
 switch of the interpreter with a ``port number`` argument.  Similar to
-the previous example, this serves files relative to the current directory. ::
+the previous example, this serves files relative to the current directory::
 
         python -m http.server 8000
 
+By default, server binds itself to all interfaces.  The option ``-b/--bind``
+specifies a specific address to which it should bind.  For example, the
+following command causes the server to bind to localhost only::
+
+        python -m http.server 8000 --bind 127.0.0.1
+
+.. versionadded:: 3.4
+    ``--bind`` argument was introduced.
+
 
 .. class:: CGIHTTPRequestHandler(request, client_address, server)
 
@@ -403,7 +427,7 @@
    reasons.  Problems with the CGI script will be translated to error 403.
 
 :class:`CGIHTTPRequestHandler` can be enabled in the command line by passing
-the ``--cgi`` option.::
+the ``--cgi`` option::
 
         python -m http.server --cgi 8000
 
diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst
index 36d78b0..bc4a791 100644
--- a/Doc/library/idle.rst
+++ b/Doc/library/idle.rst
@@ -1,202 +1,293 @@
 .. _idle:
 
-IDLE
-====
-
-.. moduleauthor:: Guido van Rossum <guido@Python.org>
-
 .. index::
    single: IDLE
    single: Python Editor
    single: Integrated Development Environment
 
+IDLE
+====
+
+.. moduleauthor:: Guido van Rossum <guido@Python.org>
+
 IDLE is the Python IDE built with the :mod:`tkinter` GUI toolkit.
 
 IDLE has the following features:
 
 * coded in 100% pure Python, using the :mod:`tkinter` GUI toolkit
 
-* cross-platform: works on Windows and Unix
+* cross-platform: works on Windows, Unix, and Mac OS X
 
-* multi-window text editor with multiple undo, Python colorizing and many other
-  features, e.g. smart indent and call tips
+* multi-window text editor with multiple undo, Python colorizing,
+  smart indent, call tips, and many other features
 
 * Python shell window (a.k.a. interactive interpreter)
 
-* debugger (not complete, but you can set breakpoints, view  and step)
+* debugger (not complete, but you can set breakpoints, view and step)
 
 
 Menus
 -----
 
+IDLE has two main window types, the Shell window and the Editor window.  It is
+possible to have multiple editor windows simultaneously.  Output windows, such
+as used for Edit / Find in Files, are a subtype of edit window.  They currently
+have the same top menu as Editor windows but a different default title and
+context menu.
 
-File menu
-^^^^^^^^^
+IDLE's menus dynamically change based on which window is currently selected.
+Each menu documented below indicates which window type it is associated with.
+Click on the dotted line at the top of a menu to "tear it off": a separate
+window containing the menu is created (for Unix and Windows only).
 
-New file
-   create a new file editing window
+File menu (Shell and Editor)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+New File
+   Create a new file editing window.
 
 Open...
-   open an existing file
+   Open an existing file with an Open dialog.
 
-Open module...
-   open an existing module (searches sys.path)
+Recent Files
+   Open a list of recent files.  Click one to open it.
 
-Class browser
-   show classes and methods in current file
-
-Path browser
-   show sys.path directories, modules, classes and methods
+Open Module...
+   Open an existing module (searches sys.path).
 
 .. index::
    single: Class browser
    single: Path browser
 
+Class Browser
+   Show functions, classes, and methods in the current Editor file in a
+   tree structure.  In the shell, open a module first.
+
+Path Browser
+   Show sys.path directories, modules, functions, classes and methods in a
+   tree structure.
+
 Save
-   save current window to the associated file (unsaved windows have a \* before and
-   after the window title)
+   Save the current window to the associated file, if there is one.  Windows
+   that have been changed since being opened or last saved have a \* before
+   and after the window title.  If there is no associated file,
+   do Save As instead.
 
 Save As...
-   save current window to new file, which becomes the associated file
+   Save the current window with a Save As dialog.  The file saved becomes the
+   new associated file for the window.
 
 Save Copy As...
-   save current window to different file without changing the associated file
+   Save the current window to different file without changing the associated
+   file.
+
+Print Window
+   Print the current window to the default printer.
 
 Close
-   close current window (asks to save if unsaved)
+   Close the current window (ask to save if unsaved).
 
 Exit
-   close all windows and quit IDLE (asks to save if unsaved)
+   Close all windows and quit IDLE (ask to save unsaved windows).
 
-
-Edit menu
-^^^^^^^^^
+Edit menu (Shell and Editor)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 Undo
-   Undo last change to current window (max 1000 changes)
+   Undo the last change to the current window.  A maximum of 1000 changes may
+   be undone.
 
 Redo
-   Redo last undone change to current window
+   Redo the last undone change to the current window.
 
 Cut
-   Copy selection into system-wide clipboard; then delete selection
+   Copy selection into the system-wide clipboard; then delete the selection.
 
 Copy
-   Copy selection into system-wide clipboard
+   Copy selection into the system-wide clipboard.
 
 Paste
-   Insert system-wide clipboard into window
+   Insert contents of the system-wide clipboard into the current window.
+
+The clipboard functions are also available in context menus.
 
 Select All
-   Select the entire contents of the edit buffer
+   Select the entire contents of the current window.
 
 Find...
-   Open a search dialog box with many options
+   Open a search dialog with many options
 
-Find again
-   Repeat last search
+Find Again
+   Repeat the last search, if there is one.
 
-Find selection
-   Search for the string in the selection
+Find Selection
+   Search for the currently selected string, if there is one.
 
 Find in Files...
-   Open a search dialog box for searching files
+   Open a file search dialog.  Put results in an new output window.
 
 Replace...
-   Open a search-and-replace dialog box
+   Open a search-and-replace dialog.
 
-Go to line
-   Ask for a line number and show that line
+Go to Line
+   Move cursor to the line number requested and make that line visible.
 
-Indent region
-   Shift selected lines right 4 spaces
+Show Completions
+   Open a scrollable list allowing selection of keywords and attributes. See
+   Completions in the Tips sections below.
 
-Dedent region
-   Shift selected lines left 4 spaces
+Expand Word
+   Expand a prefix you have typed to match a full word in the same window;
+   repeat to get a different expansion.
 
-Comment out region
-   Insert ## in front of selected lines
+Show call tip
+   After an unclosed parenthesis for a function, open a small window with
+   function parameter hints.
 
-Uncomment region
-   Remove leading # or ## from selected lines
+Show surrounding parens
+   Highlight the surrounding parenthesis.
 
-Tabify region
-   Turns *leading* stretches of spaces into tabs
+Format menu (Editor window only)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-Untabify region
-   Turn *all* tabs into the right number of spaces
+Indent Region
+   Shift selected lines right by the indent width (default 4 spaces).
 
-Expand word
-   Expand the word you have typed to match another word in the same buffer; repeat
-   to get a different expansion
+Dedent Region
+   Shift selected lines left by the indent width (default 4 spaces).
+
+Comment Out Region
+   Insert ## in front of selected lines.
+
+Uncomment Region
+   Remove leading # or ## from selected lines.
+
+Tabify Region
+   Turn *leading* stretches of spaces into tabs. (Note: We recommend using
+   4 space blocks to indent Python code.)
+
+Untabify Region
+   Turn *all* tabs into the correct number of spaces.
+
+Toggle Tabs
+   Open a dialog to switch between indenting with spaces and tabs.
+
+New Indent Width
+   Open a dialog to change indent width. The accepted default by the Python
+   community is 4 spaces.
 
 Format Paragraph
-   Reformat the current blank-line-separated paragraph
+   Reformat the current blank-line-delimited paragraph in comment block or
+   multiline string or selected line in a string.  All lines in the
+   paragraph will be formatted to less than N columns, where N defaults to 72.
 
-Import module
-   Import or reload the current module
-
-Run script
-   Execute the current file in the __main__ namespace
+Strip trailing whitespace
+   Remove any space characters after the last non-space character of a line.
 
 .. index::
-   single: Import module
    single: Run script
 
+Run menu (Editor window only)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-Windows menu
-^^^^^^^^^^^^
+Python Shell
+   Open or wake up the Python Shell window.
+
+Check Module
+   Check the syntax of the module currently open in the Editor window. If the
+   module has not been saved IDLE will either prompt the user to save or
+   autosave, as selected in the General tab of the Idle Settings dialog.  If
+   there is a syntax error, the approximate location is indicated in the
+   Editor window.
+
+Run Module
+   Do Check Module (above).  If no error, restart the shell to clean the
+   environment, then execute the module.
+
+Shell menu (Shell window only)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+View Last Restart
+  Scroll the shell window to the last Shell restart.
+
+Restart Shell
+  Restart the shell to clean the environment.
+
+Debug menu (Shell window only)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Go to File/Line
+   Look on the current line. with the cursor, and the line above for a filename
+   and line number.  If found, open the file if not already open, and show the
+   line.  Use this to view source lines referenced in an exception traceback
+   and lines found by Find in Files. Also available in the context menu of
+   the Shell window and Output windows.
+
+.. index::
+   single: debugger
+   single: stack viewer
+
+Debugger (toggle)
+   When actived, code entered in the Shell or run from an Editor will run
+   under the debugger.  In the Editor, breakpoints can be set with the context
+   menu.  This feature is still incomplete and somewhat experimental.
+
+Stack Viewer
+   Show the stack traceback of the last exception in a tree widget, with
+   access to locals and globals.
+
+Auto-open Stack Viewer
+   Toggle automatically opening the stack viewer on an unhandled exception.
+
+Options menu (Shell and Editor)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Configure IDLE
+   Open a configuration dialog.  Fonts, indentation, keybindings, and color
+   themes may be altered.  Startup Preferences may be set, and additional
+   help sources can be specified.  Non-default user setting are saved in a
+   .idlerc directory in the user's home directory.  Problems caused by bad user
+   configuration files are solved by editing or deleting one or more of the
+   files in .idlerc.
+
+Configure Extensions
+   Open a configuration dialog for setting preferences for extensions
+   (discussed below).  See note above about the location of user settings.
+
+Code Context (toggle)(Editor Window only)
+   Open a pane at the top of the edit window which shows the block context
+   of the code which has scrolled above the top of the window.
+
+Window menu (Shell and Editor)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 Zoom Height
-   toggles the window between normal size (24x80) and maximum height.
+   Toggles the window between normal size and maximum height. The initial size
+   defaults to 40 lines by 80 chars unless changed on the General tab of the
+   Configure IDLE dialog.
 
 The rest of this menu lists the names of all open windows; select one to bring
 it to the foreground (deiconifying it if necessary).
 
+Help menu (Shell and Editor)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-Debug menu
-^^^^^^^^^^
+About IDLE
+   Display version, copyright, license, credits, and more.
 
-* in the Python Shell window only
+IDLE Help
+   Display a help file for IDLE detailing the menu options, basic editing and
+   navigation, and other tips.
 
-Go to file/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.
+Python Docs
+   Access local Python documentation, if installed, or start a web browser
+   and open docs.python.org showing the latest Python documentation.
 
-Debugger
-   Run commands in the shell under the debugger.
+Turtle Demo
+   Run the turtledemo module with example python code and turtle drawings.
 
-Stack viewer
-   Show the stack traceback of the last exception.
-
-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.
+Additional help sources may be added here with the Configure IDLE dialog under
+the General tab.
 
 .. index::
    single: Cut
@@ -206,38 +297,78 @@
    single: Clear Breakpoint
    single: breakpoints
 
+Context Menus
+^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-Shell context menu
-^^^^^^^^^^^^^^^^^^
-
-* Right-click in Python Shell window (Control-click on OS X)
+Open a context menu by right-clicking in a window (Control-click on OS X).
+Context menus have the standard clipboard functions also on the Edit menu.
 
 Cut
-   Copy selection into system-wide clipboard; then delete selection
+   Copy selection into the system-wide clipboard; then delete the selection.
 
 Copy
-   Copy selection into system-wide clipboard
+   Copy selection into the system-wide clipboard.
 
 Paste
-   Insert system-wide clipboard into window
+   Insert contents of the system-wide clipboard into the current window.
+
+Editor windows also have breakpoint functions.  Lines with a breakpoint set are
+specially marked.  Breakpoints only have an effect when running under the
+debugger.  Breakpoints for a file are saved in the user's .idlerc directory.
+
+Set Breakpoint
+   Set a breakpoint on the current line.
+
+Clear Breakpoint
+   Clear the breakpoint on that line.
+
+Shell and Output windows have the following.
 
 Go to file/line
    Same as in Debug menu.
 
 
-Basic editing and navigation
-----------------------------
+Editing and navigation
+----------------------
+
+In this section, 'C' refers to the Control key on Windows and Unix and
+the Command key on Mac OSX.
 
 * :kbd:`Backspace` deletes to the left; :kbd:`Del` deletes to the right
 
+* :kbd:`C-Backspace` delete word left; :kbd:`C-Del` delete word to the right
+
 * Arrow keys and :kbd:`Page Up`/:kbd:`Page Down` to move around
 
+* :kbd:`C-LeftArrow` and :kbd:`C-RightArrow` moves by words
+
 * :kbd:`Home`/:kbd:`End` go to begin/end of line
 
 * :kbd:`C-Home`/:kbd:`C-End` go to begin/end of file
 
-* Some :program:`Emacs` bindings may also work, including :kbd:`C-B`,
-  :kbd:`C-P`, :kbd:`C-A`, :kbd:`C-E`, :kbd:`C-D`, :kbd:`C-L`
+* Some useful Emacs bindings are inherited from Tcl/Tk:
+
+   * :kbd:`C-a` beginning of line
+
+   * :kbd:`C-e` end of line
+
+   * :kbd:`C-k` kill line (but doesn't put it in clipboard)
+
+   * :kbd:`C-l` center window around the insertion point
+
+   * :kbd:`C-b` go backwards one character without deleting (usually you can
+     also use the cursor key for this)
+
+   * :kbd:`C-f` go forward one character without deleting (usually you can
+     also use the cursor key for this)
+
+   * :kbd:`C-p` go up one line (usually you can also use the cursor key for
+     this)
+
+   * :kbd:`C-d` delete next character
+
+Standard keybindings (like :kbd:`C-c` to copy and :kbd:`C-v` to paste)
+may work.  Keybindings are selected in the Configure IDLE dialog.
 
 
 Automatic indentation
@@ -246,27 +377,75 @@
 After a block-opening statement, the next line is indented by 4 spaces (in the
 Python Shell window by one tab).  After certain keywords (break, return etc.)
 the next line is dedented.  In leading indentation, :kbd:`Backspace` deletes up
-to 4 spaces if they are there. :kbd:`Tab` inserts 1-4 spaces (in the Python
-Shell window one tab). See also the indent/dedent region commands in the edit
-menu.
+to 4 spaces if they are there. :kbd:`Tab` inserts spaces (in the Python
+Shell window one tab), number depends on Indent width. Currently tabs
+are restricted to four spaces due to Tcl/Tk limitations.
 
+See also the indent/dedent region commands in the edit menu.
+
+Completions
+^^^^^^^^^^^
+
+Completions are supplied for functions, classes, and attributes of classes,
+both built-in and user-defined. Completions are also provided for
+filenames.
+
+The AutoCompleteWindow (ACW) will open after a predefined delay (default is
+two seconds) after a '.' or (in a string) an os.sep is typed. If after one
+of those characters (plus zero or more other characters) a tab is typed
+the ACW will open immediately if a possible continuation is found.
+
+If there is only one possible completion for the characters entered, a
+:kbd:`Tab` will supply that completion without opening the ACW.
+
+'Show Completions' will force open a completions window, by default the
+:kbd:`C-space` will open a completions window. In an empty
+string, this will contain the files in the current directory. On a
+blank line, it will contain the built-in and user-defined functions and
+classes in the current name spaces, plus any modules imported. If some
+characters have been entered, the ACW will attempt to be more specific.
+
+If a string of characters is typed, the ACW selection will jump to the
+entry most closely matching those characters.  Entering a :kbd:`tab` will
+cause the longest non-ambiguous match to be entered in the Editor window or
+Shell.  Two :kbd:`tab` in a row will supply the current ACW selection, as
+will return or a double click.  Cursor keys, Page Up/Down, mouse selection,
+and the scroll wheel all operate on the ACW.
+
+"Hidden" attributes can be accessed by typing the beginning of hidden
+name after a '.', e.g. '_'. This allows access to modules with
+``__all__`` set, or to class-private attributes.
+
+Completions and the 'Expand Word' facility can save a lot of typing!
+
+Completions are currently limited to those in the namespaces. Names in
+an Editor window which are not via ``__main__`` and :data:`sys.modules` will
+not be found.  Run the module once with your imports to correct this situation.
+Note that IDLE itself places quite a few modules in sys.modules, so
+much can be found by default, e.g. the re module.
+
+If you don't like the ACW popping up unbidden, simply make the delay
+longer or disable the extension.  Or another option is the delay could
+be set to zero. Another alternative to preventing ACW popups is to
+disable the call tips extension.
 
 Python Shell window
 ^^^^^^^^^^^^^^^^^^^
 
-* :kbd:`C-C` interrupts executing command
+* :kbd:`C-c` interrupts executing command
 
-* :kbd:`C-D` sends end-of-file; closes window if typed at a ``>>>`` prompt
+* :kbd:`C-d` sends end-of-file; closes window if typed at a ``>>>`` prompt
 
-* :kbd:`Alt-p` retrieves previous command matching what you have typed
+* :kbd:`Alt-/` (Expand word) is also useful to reduce typing
 
-* :kbd:`Alt-n` retrieves next
+  Command history
 
-* :kbd:`Return` while on any previous command retrieves that command
+  * :kbd:`Alt-p` retrieves previous command matching what you have typed. On
+    OS X use :kbd:`C-p`.
 
-* :kbd:`Alt-/` (Expand word) is also useful here
+  * :kbd:`Alt-n` retrieves next. On OS X use :kbd:`C-n`.
 
-.. index:: single: indentation
+  * :kbd:`Return` while on any previous command retrieves that command
 
 
 Syntax colors
@@ -308,17 +487,17 @@
 
 Upon startup with the ``-s`` option, IDLE will execute the file referenced by
 the environment variables :envvar:`IDLESTARTUP` or :envvar:`PYTHONSTARTUP`.
-Idle first checks for ``IDLESTARTUP``; if ``IDLESTARTUP`` is present the file
-referenced is run.  If ``IDLESTARTUP`` is not present, Idle checks for
+IDLE first checks for ``IDLESTARTUP``; if ``IDLESTARTUP`` is present the file
+referenced is run.  If ``IDLESTARTUP`` is not present, IDLE checks for
 ``PYTHONSTARTUP``.  Files referenced by these environment variables are
-convenient places to store functions that are used frequently from the Idle
+convenient places to store functions that are used frequently from the IDLE
 shell, or for executing import statements to import common modules.
 
 In addition, ``Tk`` also loads a startup file if it is present.  Note that the
 Tk file is loaded unconditionally.  This additional file is ``.Idle.py`` and is
 looked for in the user's home directory.  Statements in this file will be
-executed in the Tk namespace, so this file is not useful for importing functions
-to be used from Idle's Python shell.
+executed in the Tk namespace, so this file is not useful for importing
+functions to be used from IDLE's Python shell.
 
 
 Command line usage
@@ -344,8 +523,71 @@
 
 #. Otherwise, if neither ``-e`` nor ``-c`` is used, the first
    argument is a script which is executed with the remaining arguments in
-   ``sys.argv[1:...]``  and ``sys.argv[0]`` set to the script name.  If the script
-   name is '-', no script is executed but an interactive Python session is started;
-   the arguments are still available in ``sys.argv``.
+   ``sys.argv[1:...]``  and ``sys.argv[0]`` set to the script name.  If the
+   script name is '-', no script is executed but an interactive Python session
+   is started;    the arguments are still available in ``sys.argv``.
+
+Running without a subprocess
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+If IDLE is started with the -n command line switch it will run in a
+single process and will not create the subprocess which runs the RPC
+Python execution server.  This can be useful if Python cannot create
+the subprocess or the RPC socket interface on your platform.  However,
+in this mode user code is not isolated from IDLE itself.  Also, the
+environment is not restarted when Run/Run Module (F5) is selected.  If
+your code has been modified, you must reload() the affected modules and
+re-import any specific items (e.g. from foo import baz) if the changes
+are to take effect.  For these reasons, it is preferable to run IDLE
+with the default subprocess if at all possible.
+
+.. deprecated:: 3.4
 
 
+Help and preferences
+--------------------
+
+Additional help sources
+^^^^^^^^^^^^^^^^^^^^^^^
+
+IDLE includes a help menu entry called "Python Docs" that will open the
+extensive sources of help, including tutorials, available at docs.python.org.
+Selected URLs can be added or removed from the help menu at any time using the
+Configure IDLE dialog. See the IDLE help option in the help menu of IDLE for
+more information.
+
+
+Setting preferences
+^^^^^^^^^^^^^^^^^^^
+
+The font preferences, highlighting, keys, and general preferences can be
+changed via Configure IDLE on the Option menu.  Keys can be user defined;
+IDLE ships with four built in key sets. In addition a user can create a
+custom key set in the Configure IDLE dialog under the keys tab.
+
+
+Extensions
+^^^^^^^^^^
+
+IDLE contains an extension facility.  Peferences for extensions can be
+changed with Configure Extensions. See the beginning of config-extensions.def
+in the idlelib directory for further information.  The default extensions
+are currently:
+
+* FormatParagraph
+
+* AutoExpand
+
+* ZoomHeight
+
+* ScriptBinding
+
+* CallTips
+
+* ParenMatch
+
+* AutoComplete
+
+* CodeContext
+
+* RstripExtension
diff --git a/Doc/library/imaplib.rst b/Doc/library/imaplib.rst
index 01236fb..fa736fe 100644
--- a/Doc/library/imaplib.rst
+++ b/Doc/library/imaplib.rst
@@ -69,17 +69,25 @@
    This is a subclass derived from :class:`IMAP4` that connects over an SSL
    encrypted socket (to use this class you need a socket module that was compiled
    with SSL support).  If *host* is not specified, ``''`` (the local host) is used.
-   If *port* is omitted, the standard IMAP4-over-SSL port (993) is used.  *keyfile*
-   and *certfile* are also optional - they can contain a PEM formatted private key
-   and certificate chain file for the SSL connection. *ssl_context* parameter is a
-   :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 raised if *keyfile*/*certfile* is provided along with *ssl_context*.
+   If *port* is omitted, the standard IMAP4-over-SSL port (993) is used.
+   *ssl_context* is a :class:`ssl.SSLContext` object which allows bundling
+   SSL configuration options, certificates and private keys into a single
+   (potentially long-lived) structure.  Please read :ref:`ssl-security` for
+   best practices.
+
+   *keyfile* and *certfile* are a legacy alternative to *ssl_context* - they
+   can point to PEM-formatted private key and certificate chain files for
+   the SSL connection.  Note that the *keyfile*/*certfile* parameters are
+   mutually exclusive with *ssl_context*, a :class:`ValueError` is raised
+   if *keyfile*/*certfile* is provided along with *ssl_context*.
 
    .. versionchanged:: 3.3
       *ssl_context* parameter added.
 
+   .. versionchanged:: 3.4
+      The class now supports hostname check with
+      :attr:`ssl.SSLContext.check_hostname` and *Server Name Indication* (see
+      :data:`ssl.HAS_SNI`).
 
 The second subclass allows for connections created by a child process:
 
@@ -433,10 +441,16 @@
 
    Send a ``STARTTLS`` command.  The *ssl_context* argument is optional
    and should be a :class:`ssl.SSLContext` object.  This will enable
-   encryption on the IMAP connection.
+   encryption on the IMAP connection.  Please read :ref:`ssl-security` for
+   best practices.
 
    .. versionadded:: 3.2
 
+   .. versionchanged:: 3.4
+      The method now supports hostname check with
+      :attr:`ssl.SSLContext.check_hostname` and *Server Name Indication* (see
+      :data:`ssl.HAS_SNI`).
+
 
 .. method:: IMAP4.status(mailbox, names)
 
diff --git a/Doc/library/imp.rst b/Doc/library/imp.rst
index 364d81e..c2dbdc5 100644
--- a/Doc/library/imp.rst
+++ b/Doc/library/imp.rst
@@ -3,7 +3,10 @@
 
 .. module:: imp
    :synopsis: Access the implementation of the import statement.
+   :deprecated:
 
+.. deprecated:: 3.4
+   The :mod:`imp` package is pending deprecation in favor of :mod:`importlib`.
 
 .. index:: statement: import
 
@@ -11,10 +14,6 @@
 :keyword:`import` statement.  It defines the following constants and functions:
 
 
-.. note::
-   New programs should use :mod:`importlib` rather than this module.
-
-
 .. function:: get_magic()
 
    .. index:: pair: file; byte-code
@@ -22,6 +21,9 @@
    Return the magic string value used to recognize byte-compiled code files
    (:file:`.pyc` files).  (This value may be different for each Python version.)
 
+   .. deprecated:: 3.4
+       Use :attr:`importlib.util.MAGIC_NUMBER` instead.
+
 
 .. function:: get_suffixes()
 
@@ -77,7 +79,9 @@
    When *P* itself has a dotted name, apply this recipe recursively.
 
    .. deprecated:: 3.3
-      Use :func:`importlib.find_loader` instead.
+      Use :func:`importlib.util.find_spec` instead unless Python 3.3
+      compatibility is required, in which case use
+      :func:`importlib.find_loader`.
 
 
 .. function:: load_module(name, file, pathname, description)
@@ -101,8 +105,12 @@
    using a :keyword:`try` ... :keyword:`finally` statement.
 
    .. deprecated:: 3.3
-      Unneeded as loaders should be used to load modules and
-      :func:`find_module` is deprecated.
+      If previously used in conjunction with :func:`imp.find_module` then
+      consider using :func:`importlib.import_module`, otherwise use the loader
+      returned by the replacement you chose for :func:`imp.find_module`. If you
+      called :func:`imp.load_module` and related functions directly then use the
+      classes in :mod:`importlib.machinery`, e.g.
+      ``importlib.machinery.SourceFileLoader(name, path).load_module()``.
 
 
 .. function:: new_module(name)
@@ -110,6 +118,9 @@
    Return a new empty module object called *name*.  This object is *not* inserted
    in ``sys.modules``.
 
+   .. deprecated:: 3.4
+      Use :class:`types.ModuleType` instead.
+
 
 .. function:: reload(module)
 
@@ -176,6 +187,9 @@
       Relies on both ``__name__`` and ``__loader__`` being defined on the module
       being reloaded instead of just ``__name__``.
 
+   .. deprecated:: 3.4
+      Use :func:`importlib.reload` instead.
+
 
 The following functions are conveniences for handling :pep:`3147` byte-compiled
 file paths.
@@ -201,6 +215,9 @@
       If :attr:`sys.implementation.cache_tag` is ``None``, then
       :exc:`NotImplementedError` is raised.
 
+   .. deprecated:: 3.4
+      Use :func:`importlib.util.cache_from_source` instead.
+
 
 .. function:: source_from_cache(path)
 
@@ -216,14 +233,17 @@
       Raise :exc:`NotImplementedError` when
       :attr:`sys.implementation.cache_tag` is not defined.
 
+   .. deprecated:: 3.4
+      Use :func:`importlib.util.source_from_cache` instead.
+
 
 .. function:: get_tag()
 
    Return the :pep:`3147` magic tag string matching this version of Python's
    magic number, as returned by :func:`get_magic`.
 
-   .. note::
-      You may use :attr:`sys.implementation.cache_tag` directly starting
+   .. deprecated:: 3.4
+      Use :attr:`sys.implementation.cache_tag` directly starting
       in Python 3.3.
 
 
@@ -246,10 +266,12 @@
    exception is made for circular imports, which by construction have to
    expose an incomplete module object at some point.
 
-.. versionchanged:: 3.3
-   The locking scheme has changed to per-module locks for
-   the most part.  A global import lock is kept for some critical tasks,
-   such as initializing the per-module locks.
+   .. versionchanged:: 3.3
+      The locking scheme has changed to per-module locks for
+      the most part.  A global import lock is kept for some critical tasks,
+      such as initializing the per-module locks.
+
+   .. deprecated:: 3.4
 
 
 .. function:: acquire_lock()
@@ -264,10 +286,12 @@
 
    On platforms without threads, this function does nothing.
 
-.. versionchanged:: 3.3
-   The locking scheme has changed to per-module locks for
-   the most part.  A global import lock is kept for some critical tasks,
-   such as initializing the per-module locks.
+   .. versionchanged:: 3.3
+      The locking scheme has changed to per-module locks for
+      the most part.  A global import lock is kept for some critical tasks,
+      such as initializing the per-module locks.
+
+   .. deprecated:: 3.4
 
 
 .. function:: release_lock()
@@ -275,10 +299,12 @@
    Release the interpreter's global import lock. On platforms without
    threads, this function does nothing.
 
-.. versionchanged:: 3.3
-   The locking scheme has changed to per-module locks for
-   the most part.  A global import lock is kept for some critical tasks,
-   such as initializing the per-module locks.
+   .. versionchanged:: 3.3
+      The locking scheme has changed to per-module locks for
+      the most part.  A global import lock is kept for some critical tasks,
+      such as initializing the per-module locks.
+
+   .. deprecated:: 3.4
 
 
 The following constants with integer values, defined in this module, are used
@@ -345,6 +371,9 @@
       ``None`` is inserted into ``sys.path_importer_cache`` instead of an
       instance of :class:`NullImporter`.
 
+   .. deprecated:: 3.4
+      Insert ``None`` into ``sys.path_importer_cache`` instead.
+
 
 .. _examples-imp:
 
diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst
index 5f740a2..91328af 100644
--- a/Doc/library/importlib.rst
+++ b/Doc/library/importlib.rst
@@ -29,7 +29,7 @@
     :ref:`import`
         The language reference for the :keyword:`import` statement.
 
-    `Packages specification <http://www.python.org/doc/essays/packages.html>`__
+    `Packages specification <http://legacy.python.org/doc/essays/packages.html>`__
         Original specification of packages. Some semantics have changed since
         the writing of this document (e.g. redirecting based on ``None``
         in :data:`sys.modules`).
@@ -95,7 +95,7 @@
 
    Find the loader for a module, optionally within the specified *path*. If the
    module is in :attr:`sys.modules`, then ``sys.modules[name].__loader__`` is
-   returned (unless the loader would be ``None``, in which case
+   returned (unless the loader would be ``None`` or is not set, in which case
    :exc:`ValueError` is raised). Otherwise a search using :attr:`sys.meta_path`
    is done. ``None`` is returned if no loader is found.
 
@@ -104,6 +104,15 @@
    will need to import all parent packages of the submodule and use the correct
    argument to *path*.
 
+   .. versionadded:: 3.3
+
+   .. versionchanged:: 3.4
+      If ``__loader__`` is not set, raise :exc:`ValueError`, just like when the
+      attribute is set to ``None``.
+
+   .. deprecated:: 3.4
+      Use :func:`importlib.util.find_spec` instead.
+
 .. function:: invalidate_caches()
 
    Invalidate the internal caches of finders stored at
@@ -114,6 +123,74 @@
 
    .. versionadded:: 3.3
 
+.. function:: reload(module)
+
+   Reload a previously imported *module*.  The argument must be a module object,
+   so it must have been successfully imported before.  This is useful if you
+   have edited the module source file using an external editor and want to try
+   out the new version without leaving the Python interpreter.  The return value
+   is the module object (which can be different if re-importing causes a
+   different object to be placed in :data:`sys.modules`).
+
+   When :func:`reload` is executed:
+
+   * Python module's code is recompiled and the module-level code re-executed,
+     defining a new set of objects which are bound to names in the module's
+     dictionary by reusing the :term:`loader` which originally loaded the
+     module.  The ``init`` function of extension modules is not called a second
+     time.
+
+   * As with all other objects in Python the old objects are only reclaimed
+     after their reference counts drop to zero.
+
+   * The names in the module namespace are updated to point to any new or
+     changed objects.
+
+   * Other references to the old objects (such as names external to the module) are
+     not rebound to refer to the new objects and must be updated in each namespace
+     where they occur if that is desired.
+
+   There are a number of other caveats:
+
+   If a module is syntactically correct but its initialization fails, the first
+   :keyword:`import` statement for it does not bind its name locally, but does
+   store a (partially initialized) module object in ``sys.modules``.  To reload
+   the module you must first :keyword:`import` it again (this will bind the name
+   to the partially initialized module object) before you can :func:`reload` it.
+
+   When a module is reloaded, its dictionary (containing the module's global
+   variables) is retained.  Redefinitions of names will override the old
+   definitions, so this is generally not a problem.  If the new version of a
+   module does not define a name that was defined by the old version, the old
+   definition remains.  This feature can be used to the module's advantage if it
+   maintains a global table or cache of objects --- with a :keyword:`try`
+   statement it can test for the table's presence and skip its initialization if
+   desired::
+
+      try:
+          cache
+      except NameError:
+          cache = {}
+
+   It is legal though generally not very useful to reload built-in or
+   dynamically loaded modules (this is not true for e.g. :mod:`sys`,
+   :mod:`__main__`, :mod:`builtins` and other key modules where reloading is
+   frowned upon). In many cases, however, extension modules are not designed to
+   be initialized more than once, and may fail in arbitrary ways when reloaded.
+
+   If a module imports objects from another module using :keyword:`from` ...
+   :keyword:`import` ..., calling :func:`reload` for the other module does not
+   redefine the objects imported from it --- one way around this is to
+   re-execute the :keyword:`from` statement, another is to use :keyword:`import`
+   and qualified names (*module.name*) instead.
+
+   If a module instantiates instances of a class, reloading the module that
+   defines the class does not affect the method definitions of the instances ---
+   they continue to use the old class definition.  The same is true for derived
+   classes.
+
+   .. versionadded:: 3.4
+
 
 :mod:`importlib.abc` -- Abstract base classes related to import
 ---------------------------------------------------------------
@@ -137,8 +214,6 @@
                +-- ExecutionLoader --+
                                      +-- FileLoader
                                      +-- SourceLoader
-                                          +-- PyLoader (deprecated)
-                                          +-- PyPycLoader (deprecated)
 
 
 .. class:: Finder
@@ -154,6 +229,10 @@
       module.  Originally specified in :pep:`302`, this method was meant
       for use in :data:`sys.meta_path` and in the path-based import subsystem.
 
+      .. versionchanged:: 3.4
+         Returns ``None`` when called instead of raising
+         :exc:`NotImplementedError`.
+
 
 .. class:: MetaPathFinder
 
@@ -162,20 +241,46 @@
 
    .. versionadded:: 3.3
 
+   .. method:: find_spec(fullname, path, target=None)
+
+      An abstract method for finding a :term:`spec <module spec>` for
+      the specified module.  If this is a top-level import, *path* will
+      be ``None``.  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 spec cannot be found, ``None`` is returned.
+      When passed in, ``target`` is a module object that the finder may
+      use to make a more educated about what spec to return.
+
+      .. versionadded:: 3.4
+
    .. method:: find_module(fullname, path)
 
-      An abstract method for finding a :term:`loader` for the specified
+      A legacy method for finding a :term:`loader` for the specified
       module.  If this is a top-level import, *path* will be ``None``.
       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.
 
+      If :meth:`find_spec` is defined, backwards-compatible functionality is
+      provided.
+
+      .. versionchanged:: 3.4
+         Returns ``None`` when called instead of raising
+         :exc:`NotImplementedError`. Can use :meth:`find_spec` to provide
+         functionality.
+
+      .. deprecated:: 3.4
+         Use :meth:`find_spec` instead.
+
    .. method:: invalidate_caches()
 
       An optional method which, when called, should invalidate any internal
       cache used by the finder. Used by :func:`importlib.invalidate_caches`
       when invalidating the caches of all finders on :data:`sys.meta_path`.
 
+      .. versionchanged:: 3.4
+         Returns ``None`` when called instead of ``NotImplemented``.
+
 
 .. class:: PathEntryFinder
 
@@ -183,27 +288,51 @@
    it bears some similarities to :class:`MetaPathFinder`, ``PathEntryFinder``
    is meant for use only within the path-based import subsystem provided
    by :class:`PathFinder`. This ABC is a subclass of :class:`Finder` for
-   compatibility.
+   compatibility reasons only.
 
    .. versionadded:: 3.3
 
+   .. method:: find_spec(fullname, target=None)
+
+      An abstract method for finding a :term:`spec <module spec>` for
+      the specified module.  The finder will search for the module only
+      within the :term:`path entry` to which it is assigned.  If a spec
+      cannot be found, ``None`` is returned.  When passed in, ``target``
+      is a module object that the finder may use to make a more educated
+      about what spec to return.
+
+      .. versionadded:: 3.4
+
    .. method:: find_loader(fullname)
 
-      An abstract method for finding a :term:`loader` for the specified
+      A legacy method for finding a :term:`loader` for the specified
       module.  Returns a 2-tuple of ``(loader, portion)`` where ``portion``
       is a sequence of file system locations contributing to part of a namespace
       package. The loader may be ``None`` while specifying ``portion`` to
       signify the contribution of the file system locations to a namespace
       package. An empty list can be used for ``portion`` to signify the loader
-      is not part of a package. If ``loader`` is ``None`` and ``portion`` is
-      the empty list then no loader or location for a namespace package were
-      found (i.e. failure to find anything for the module).
+      is not part of a namespace package. If ``loader`` is ``None`` and
+      ``portion`` is the empty list then no loader or location for a namespace
+      package were found (i.e. failure to find anything for the module).
+
+      If :meth:`find_spec` is defined then backwards-compatible functionality is
+      provided.
+
+      .. versionchanged:: 3.4
+         Returns ``(None, [])`` instead of raising :exc:`NotImplementedError`.
+         Uses :meth:`find_spec` when available to provide functionality.
+
+      .. deprecated:: 3.4
+         Use :meth:`find_spec` instead.
 
    .. method:: find_module(fullname)
 
       A concrete implementation of :meth:`Finder.find_module` which is
       equivalent to ``self.find_loader(fullname)[0]``.
 
+      .. deprecated:: 3.4
+         Use :meth:`find_spec` instead.
+
    .. method:: invalidate_caches()
 
       An optional method which, when called, should invalidate any internal
@@ -216,9 +345,26 @@
     An abstract base class for a :term:`loader`.
     See :pep:`302` for the exact definition for a loader.
 
+    .. method:: create_module(spec)
+
+       An optional method that returns the module object to use when
+       importing a module.  create_module() may also return ``None``,
+       indicating that the default module creation should take place
+       instead.
+
+       .. versionadded:: 3.4
+
+    .. method:: exec_module(module)
+
+       An abstract method that executes the module in its own namespace
+       when a module is imported or reloaded.  The module should already
+       be initialized when exec_module() is called.
+
+       .. versionadded:: 3.4
+
     .. method:: load_module(fullname)
 
-        An abstract method for loading a module. If the module cannot be
+        A legacy method for loading a module. If the module cannot be
         loaded, :exc:`ImportError` is raised, otherwise the loaded module is
         returned.
 
@@ -229,12 +375,11 @@
         from the import. If the loader inserted a module and the load fails, it
         must be removed by the loader from :data:`sys.modules`; modules already
         in :data:`sys.modules` before the loader began execution should be left
-        alone. The :func:`importlib.util.module_for_loader` decorator handles
-        all of these details.
+        alone (see :func:`importlib.util.module_for_loader`).
 
         The loader should set several attributes on the module.
         (Note that some of these attributes can change when a module is
-        reloaded.)
+        reloaded):
 
         - :attr:`__name__`
             The name of the module.
@@ -254,20 +399,42 @@
         - :attr:`__package__`
             The parent package for the module/package. If the module is
             top-level then it has a value of the empty string. The
-            :func:`importlib.util.set_package` decorator can handle the details
-            for :attr:`__package__`.
+            :func:`importlib.util.module_for_loader` decorator can handle the
+            details for :attr:`__package__`.
 
         - :attr:`__loader__`
-            The loader used to load the module.
-            (This is not set by the built-in import machinery,
-            but it should be set whenever a :term:`loader` is used.)
+            The loader used to load the module. The
+            :func:`importlib.util.module_for_loader` decorator can handle the
+            details for :attr:`__package__`.
+
+        When :meth:`exec_module` is available then backwards-compatible
+        functionality is provided.
+
+        .. versionchanged:: 3.4
+           Raise :exc:`ImportError` when called instead of
+           :exc:`NotImplementedError`. Functionality provided when
+           :meth:`exec_module` is available.
+
+        .. deprecated:: 3.4
+           The recommended API for loading a module is :meth:`exec_module`
+           (and optionally :meth:`create_module`).  Loaders should implement
+           it instead of load_module().  The import machinery takes care of
+           all the other responsibilities of load_module() when exec_module()
+           is implemented.
 
     .. method:: module_repr(module)
 
-        An abstract method which when implemented calculates and returns the
-        given module's repr, as a string.
+        A legacy method which when implemented calculates and returns the
+        given module's repr, as a string. The module type's default repr() will
+        use the result of this method as appropriate.
 
-        .. versionadded: 3.3
+        .. versionadded:: 3.3
+
+        .. versionchanged:: 3.4
+           Made optional instead of an abstractmethod.
+
+        .. deprecated:: 3.4
+           The import machinery now takes care of this automatically.
 
 
 .. class:: ResourceLoader
@@ -282,10 +449,13 @@
         Loaders that have a file-like storage back-end
         that allows storing arbitrary data
         can implement this abstract method to give direct access
-        to the data stored. :exc:`IOError` is to be raised if the *path* cannot
+        to the data stored. :exc:`OSError` is to be raised if the *path* cannot
         be found. The *path* is expected to be constructed using a module's
         :attr:`__file__` attribute or an item from a package's :attr:`__path__`.
 
+        .. versionchanged:: 3.4
+           Raises :exc:`OSError` instead of :exc:`NotImplementedError`.
+
 
 .. class:: InspectLoader
 
@@ -294,14 +464,21 @@
 
     .. method:: get_code(fullname)
 
-        An abstract method to return the :class:`code` object for a module.
-        ``None`` is returned if the module does not have a code object
-        (e.g. built-in module).  :exc:`ImportError` is raised if loader cannot
-        find the requested module.
+        Return the code object for a module, or ``None`` if the module does not
+        have a code object (as would be the case, for example, for a built-in
+        module).  Raise an :exc:`ImportError` if loader cannot find the
+        requested module.
+
+        .. note::
+           While the method has a default implementation, it is suggested that
+           it be overridden if possible for performance.
 
         .. index::
            single: universal newlines; importlib.abc.InspectLoader.get_source method
 
+        .. versionchanged:: 3.4
+           No longer abstract and a concrete implementation is provided.
+
     .. method:: get_source(fullname)
 
         An abstract method to return the source of a module. It is returned as
@@ -310,12 +487,42 @@
         if no source is available (e.g. a built-in module). Raises
         :exc:`ImportError` if the loader cannot find the module specified.
 
+        .. versionchanged:: 3.4
+           Raises :exc:`ImportError` instead of :exc:`NotImplementedError`.
+
     .. method:: is_package(fullname)
 
         An abstract method to return a true value if the module is a package, a
         false value otherwise. :exc:`ImportError` is raised if the
         :term:`loader` cannot find the module.
 
+        .. versionchanged:: 3.4
+           Raises :exc:`ImportError` instead of :exc:`NotImplementedError`.
+
+    .. method:: source_to_code(data, path='<string>')
+
+        Create a code object from Python source.
+
+        The *data* argument can be whatever the :func:`compile` function
+        supports (i.e. string or bytes). The *path* argument should be
+        the "path" to where the source code originated from, which can be an
+        abstract concept (e.g. location in a zip file).
+
+        .. versionadded:: 3.4
+
+    .. method:: exec_module(module)
+
+       Implementation of :meth:`Loader.exec_module`.
+
+       .. versionadded:: 3.4
+
+    .. method:: load_module(fullname)
+
+       Implementation of :meth:`Loader.load_module`.
+
+       .. deprecated:: 3.4
+          use :meth:`exec_module` instead.
+
 
 .. class:: ExecutionLoader
 
@@ -333,6 +540,9 @@
         the source file, regardless of whether a bytecode was used to load the
         module.
 
+        .. versionchanged:: 3.4
+           Raises :exc:`ImportError` instead of :exc:`NotImplementedError`.
+
 
 .. class:: FileLoader(fullname, path)
 
@@ -357,13 +567,16 @@
 
       Calls super's ``load_module()``.
 
+      .. deprecated:: 3.4
+         Use :meth:`Loader.exec_module` instead.
+
    .. method:: get_filename(fullname)
 
       Returns :attr:`path`.
 
    .. method:: get_data(path)
 
-      Returns the open, binary file for *path*.
+      Reads *path* as a binary file and returns the bytes from it.
 
 
 .. class:: SourceLoader
@@ -378,7 +591,8 @@
           loading is not supported.
 
     The abstract methods defined by this class are to add optional bytecode
-    file support. Not implementing these optional methods causes the loader to
+    file support. Not implementing these optional methods (or causing them to
+    raise :exc:`NotImplementedError`) causes the loader to
     only work with source code. Implementing the methods allows the loader to
     work with source *and* bytecode files; it does not allow for *sourceless*
     loading where only bytecode is provided.  Bytecode files are an
@@ -395,10 +609,13 @@
         - ``'size'`` (optional): the size in bytes of the source code.
 
         Any other keys in the dictionary are ignored, to allow for future
-        extensions.
+        extensions. If the path cannot be handled, :exc:`OSError` is raised.
 
         .. versionadded:: 3.3
 
+        .. versionchanged:: 3.4
+           Raise :exc:`OSError` instead of :exc:`NotImplementedError`.
+
     .. method:: path_mtime(path)
 
         Optional abstract method which returns the modification time for the
@@ -407,7 +624,10 @@
         .. deprecated:: 3.3
            This method is deprecated in favour of :meth:`path_stats`.  You don't
            have to implement it, but it is still available for compatibility
-           purposes.
+           purposes. Raise :exc:`OSError` if the path cannot be handled.
+
+        .. versionchanged:: 3.4
+           Raise :exc:`OSError` instead of :exc:`NotImplementedError`.
 
     .. method:: set_data(path, data)
 
@@ -419,13 +639,25 @@
         (:attr:`errno.EACCES`/:exc:`PermissionError`), do not propagate the
         exception.
 
+        .. versionchanged:: 3.4
+           No longer raises :exc:`NotImplementedError` when called.
+
     .. method:: get_code(fullname)
 
         Concrete implementation of :meth:`InspectLoader.get_code`.
 
+    .. method:: exec_module(module)
+
+       Concrete implementation of :meth:`Loader.exec_module`.
+
+      .. versionadded:: 3.4
+
     .. method:: load_module(fullname)
 
-        Concrete implementation of :meth:`Loader.load_module`.
+       Concrete implementation of :meth:`Loader.load_module`.
+
+       .. deprecated:: 3.4
+          Use :meth:`exec_module` instead.
 
     .. method:: get_source(fullname)
 
@@ -440,142 +672,6 @@
         itself does not end in ``__init__``.
 
 
-.. class:: PyLoader
-
-    An abstract base class inheriting from
-    :class:`ExecutionLoader` and
-    :class:`ResourceLoader` designed to ease the loading of
-    Python source modules (bytecode is not handled; see
-    :class:`SourceLoader` for a source/bytecode ABC). A subclass
-    implementing this ABC will only need to worry about exposing how the source
-    code is stored; all other details for loading Python source code will be
-    handled by the concrete implementations of key methods.
-
-    .. deprecated:: 3.2
-        This class has been deprecated in favor of :class:`SourceLoader` and is
-        slated for removal in Python 3.4. See below for how to create a
-        subclass that is compatible with Python 3.1 onwards.
-
-    If compatibility with Python 3.1 is required, then use the following idiom
-    to implement a subclass that will work with Python 3.1 onwards (make sure
-    to implement :meth:`ExecutionLoader.get_filename`)::
-
-        try:
-            from importlib.abc import SourceLoader
-        except ImportError:
-            from importlib.abc import PyLoader as SourceLoader
-
-
-        class CustomLoader(SourceLoader):
-            def get_filename(self, fullname):
-                """Return the path to the source file."""
-                # Implement ...
-
-            def source_path(self, fullname):
-                """Implement source_path in terms of get_filename."""
-                try:
-                    return self.get_filename(fullname)
-                except ImportError:
-                    return None
-
-            def is_package(self, fullname):
-                """Implement is_package by looking for an __init__ file
-                name as returned by get_filename."""
-                filename = os.path.basename(self.get_filename(fullname))
-                return os.path.splitext(filename)[0] == '__init__'
-
-
-    .. method:: source_path(fullname)
-
-        An abstract method that returns the path to the source code for a
-        module. Should return ``None`` if there is no source code.
-        Raises :exc:`ImportError` if the loader knows it cannot handle the
-        module.
-
-    .. method:: get_filename(fullname)
-
-        A concrete implementation of
-        :meth:`importlib.abc.ExecutionLoader.get_filename` that
-        relies on :meth:`source_path`. If :meth:`source_path` returns
-        ``None``, then :exc:`ImportError` is raised.
-
-    .. method:: load_module(fullname)
-
-        A concrete implementation of :meth:`importlib.abc.Loader.load_module`
-        that loads Python source code. All needed information comes from the
-        abstract methods required by this ABC. The only pertinent assumption
-        made by this method is that when loading a package
-        :attr:`__path__` is set to ``[os.path.dirname(__file__)]``.
-
-    .. method:: get_code(fullname)
-
-        A concrete implementation of
-        :meth:`importlib.abc.InspectLoader.get_code` that creates code objects
-        from Python source code, by requesting the source code (using
-        :meth:`source_path` and :meth:`get_data`) and compiling it with the
-        built-in :func:`compile` function.
-
-    .. method:: get_source(fullname)
-
-        A concrete implementation of
-        :meth:`importlib.abc.InspectLoader.get_source`. Uses
-        :meth:`importlib.abc.ResourceLoader.get_data` and :meth:`source_path`
-        to get the source code.  It tries to guess the source encoding using
-        :func:`tokenize.detect_encoding`.
-
-
-.. class:: PyPycLoader
-
-    An abstract base class inheriting from :class:`PyLoader`.
-    This ABC is meant to help in creating loaders that support both Python
-    source and bytecode.
-
-    .. deprecated:: 3.2
-        This class has been deprecated in favor of :class:`SourceLoader` and to
-        properly support :pep:`3147`. If compatibility is required with
-        Python 3.1, implement both :class:`SourceLoader` and :class:`PyLoader`;
-        instructions on how to do so are included in the documentation for
-        :class:`PyLoader`. Do note that this solution will not support
-        sourceless/bytecode-only loading; only source *and* bytecode loading.
-
-    .. versionchanged:: 3.3
-       Updated to parse (but not use) the new source size field in bytecode
-       files when reading and to write out the field properly when writing.
-
-    .. method:: source_mtime(fullname)
-
-        An abstract method which returns the modification time for the source
-        code of the specified module. The modification time should be an
-        integer. If there is no source code, return ``None``. If the
-        module cannot be found then :exc:`ImportError` is raised.
-
-    .. method:: bytecode_path(fullname)
-
-        An abstract method which returns the path to the bytecode for the
-        specified module, if it exists. It returns ``None``
-        if no bytecode exists (yet).
-        Raises :exc:`ImportError` if the loader knows it cannot handle the
-        module.
-
-    .. method:: get_filename(fullname)
-
-        A concrete implementation of
-        :meth:`ExecutionLoader.get_filename` that relies on
-        :meth:`PyLoader.source_path` and :meth:`bytecode_path`.
-        If :meth:`source_path` returns a path, then that value is returned.
-        Else if :meth:`bytecode_path` returns a path, that path will be
-        returned. If a path is not available from both methods,
-        :exc:`ImportError` is raised.
-
-    .. method:: write_bytecode(fullname, bytecode)
-
-        An abstract method which has the loader write *bytecode* for future
-        use. If the bytecode is written, return ``True``. Return
-        ``False`` if the bytecode could not be written. This method
-        should not be called if :data:`sys.dont_write_bytecode` is true.
-        The *bytecode* argument should be a bytes string or bytes array.
-
-
 :mod:`importlib.machinery` -- Importers and path hooks
 ------------------------------------------------------
 
@@ -642,6 +738,10 @@
     Only class methods are defined by this class to alleviate the need for
     instantiation.
 
+    .. note::
+       Due to limitations in the extension module C-API, for now
+       BuiltinImporter does not implement :meth:`Loader.exec_module`.
+
 
 .. class:: FrozenImporter
 
@@ -672,24 +772,37 @@
    Only class methods are defined by this class to alleviate the need for
    instantiation.
 
+   .. classmethod:: find_spec(fullname, path=None, target=None)
+
+      Class method that attempts to find a :term:`spec <module spec>`
+      for the module specified by *fullname* on :data:`sys.path` or, if
+      defined, on *path*. For each path entry that is searched,
+      :data:`sys.path_importer_cache` is checked. If a non-false object
+      is found then it is used as the :term:`path entry finder` to look
+      for the module being searched for. If no entry is found in
+      :data:`sys.path_importer_cache`, then :data:`sys.path_hooks` is
+      searched for a finder for the path entry and, if found, is stored
+      in :data:`sys.path_importer_cache` along with being queried about
+      the module. If no finder is ever found then ``None`` is both
+      stored in the cache and returned.
+
+      .. versionadded:: 3.4
+
    .. classmethod:: find_module(fullname, path=None)
 
-     Class method that attempts to find a :term:`loader` for the module
-     specified by *fullname* on :data:`sys.path` or, if defined, on
-     *path*. For each path entry that is searched,
-     :data:`sys.path_importer_cache` is checked. If a non-false object is
-     found then it is used as the :term:`path entry finder` to look for the
-     module being searched for. If no entry is found in
-     :data:`sys.path_importer_cache`, then :data:`sys.path_hooks` is
-     searched for a finder for the path entry and, if found, is stored in
-     :data:`sys.path_importer_cache` along with being queried about the
-     module. If no finder is ever found then ``None`` is both stored in
-     the cache and returned.
+      A legacy wrapper around :meth:`find_spec`.
+
+      .. deprecated:: 3.4
+         Use :meth:`find_spec` instead.
 
    .. classmethod:: invalidate_caches()
 
-     Calls :meth:`importlib.abc.PathEntryFinder.invalidate_caches` on all
-     finders stored in :attr:`sys.path_importer_cache`.
+      Calls :meth:`importlib.abc.PathEntryFinder.invalidate_caches` on all
+      finders stored in :attr:`sys.path_importer_cache`.
+
+   .. versionchanged:: 3.4
+      Calls objects in :data:`sys.path_hooks` with the current working
+      directory for ``''`` (i.e. the empty string).
 
 
 .. class:: FileFinder(path, \*loader_details)
@@ -721,6 +834,12 @@
 
       The path the finder will search in.
 
+   .. method:: find_spec(fullname, target=None)
+
+      Attempt to find the spec to handle *fullname* within :attr:`path`.
+
+      .. versionadded:: 3.4
+
    .. method:: find_loader(fullname)
 
       Attempt to find the loader to handle *fullname* within :attr:`path`.
@@ -768,6 +887,11 @@
 
       Concrete implementation of :meth:`importlib.abc.SourceLoader.set_data`.
 
+   .. method:: load_module(name=None)
+
+      Concrete implementation of :meth:`importlib.abc.Loader.load_module` where
+      specifying the name of the module to load is optional.
+
 
 .. class:: SourcelessFileLoader(fullname, path)
 
@@ -802,10 +926,15 @@
       Returns ``None`` as bytecode files have no source when this loader is
       used.
 
+   .. method:: load_module(name=None)
+
+   Concrete implementation of :meth:`importlib.abc.Loader.load_module` where
+   specifying the name of the module to load is optional.
+
 
 .. class:: ExtensionFileLoader(fullname, path)
 
-   A concrete implementation of :class:`importlib.abc.InspectLoader` for
+   A concrete implementation of :class:`importlib.abc.ExecutionLoader` for
    extension modules.
 
    The *fullname* argument specifies the name of the module the loader is to
@@ -821,11 +950,15 @@
 
       Path to the extension module.
 
-   .. method:: load_module(fullname)
+   .. method:: load_module(name=None)
 
       Loads the extension module if and only if *fullname* is the same as
       :attr:`name` or is ``None``.
 
+      .. note::
+         Due to limitations in the extension module C-API, for now
+         ExtensionFileLoader does not implement :meth:`Loader.exec_module`.
+
    .. method:: is_package(fullname)
 
       Returns ``True`` if the file path points to a package's ``__init__``
@@ -839,6 +972,70 @@
 
       Returns ``None`` as extension modules do not have source code.
 
+   .. method:: get_filename(fullname)
+
+      Returns :attr:`path`.
+
+      .. versionadded:: 3.4
+
+
+.. class:: ModuleSpec(name, loader, *, origin=None, loader_state=None, is_package=None)
+
+   A specification for a module's import-system-related state.
+
+   .. versionadded:: 3.4
+
+   .. attribute:: name
+
+   (``__name__``)
+
+   A string for the fully-qualified name of the module.
+
+   .. attribute:: loader
+
+   (``__loader__``)
+
+   The loader to use for loading.  For namespace packages this should be
+   set to None.
+
+   .. attribute:: origin
+
+   (``__file__``)
+
+   Name of the place from which the module is loaded, e.g. "builtin" for
+   built-in modules and the filename for modules loaded from source.
+   Normally "origin" should be set, but it may be None (the default)
+   which indicates it is unspecified.
+
+   .. attribute:: submodule_search_locations
+
+   (``__path__``)
+
+   List of strings for where to find submodules, if a package (None
+   otherwise).
+
+   .. attribute:: loader_state
+
+   Container of extra module-specific data for use during loading (or
+   None).
+
+   .. attribute:: cached
+
+   (``__cached__``)
+
+   String for where the compiled module should be stored (or None).
+
+   .. attribute:: parent
+
+   (``__package__``)
+
+   (Read-only) Fully-qualified name of the package to which the module
+   belongs as a submodule (or None).
+
+   .. attribute:: has_location
+
+   Boolean indicating whether or not the module's "origin"
+   attribute refers to a loadable location.
 
 :mod:`importlib.util` -- Utility code for importers
 ---------------------------------------------------
@@ -849,6 +1046,51 @@
 This module contains the various objects that help in the construction of
 an :term:`importer`.
 
+.. attribute:: MAGIC_NUMBER
+
+   The bytes which represent the bytecode version number. If you need help with
+   loading/writing bytecode then consider :class:`importlib.abc.SourceLoader`.
+
+   .. versionadded:: 3.4
+
+.. function:: cache_from_source(path, debug_override=None)
+
+   Return the :pep:`3147` path to the byte-compiled file associated with the
+   source *path*.  For example, if *path* is ``/foo/bar/baz.py`` the return
+   value would be ``/foo/bar/__pycache__/baz.cpython-32.pyc`` for Python 3.2.
+   The ``cpython-32`` string comes from the current magic tag (see
+   :func:`get_tag`; if :attr:`sys.implementation.cache_tag` is not defined then
+   :exc:`NotImplementedError` will be raised).  The returned path will end in
+   ``.pyc`` when ``__debug__`` is ``True`` or ``.pyo`` for an optimized Python
+   (i.e. ``__debug__`` is ``False``).  By passing in ``True`` or ``False`` for
+   *debug_override* you can override the system's value for ``__debug__`` for
+   extension selection.
+
+   *path* need not exist.
+
+   .. versionadded:: 3.4
+
+
+.. function:: source_from_cache(path)
+
+   Given the *path* to a :pep:`3147` file name, return the associated source code
+   file path.  For example, if *path* is
+   ``/foo/bar/__pycache__/baz.cpython-32.pyc`` the returned path would be
+   ``/foo/bar/baz.py``.  *path* need not exist, however if it does not conform
+   to :pep:`3147` format, a ``ValueError`` is raised. If
+   :attr:`sys.implementation.cache_tag` is not defined,
+   :exc:`NotImplementedError` is raised.
+
+   .. versionadded:: 3.4
+
+.. function:: decode_source(source_bytes)
+
+   Decode the given bytes representing source code and return it as a string
+   with universal newlines (as required by
+   :meth:`importlib.abc.InspectLoader.get_source`).
+
+   .. versionadded:: 3.4
+
 .. function:: resolve_name(name, package)
 
    Resolve a relative module name to an absolute one.
@@ -865,9 +1107,25 @@
 
    .. versionadded:: 3.3
 
+.. function:: find_spec(name, package=None)
+
+   Find the :term:`spec <module spec>` for a module, optionally relative to
+   the specified **package** name. If the module is in :attr:`sys.modules`,
+   then ``sys.modules[name].__spec__`` is returned (unless the spec would be
+   ``None`` or is not set, in which case :exc:`ValueError` is raised).
+   Otherwise a search using :attr:`sys.meta_path` is done. ``None`` is
+   returned if no spec is found.
+
+   If **name** is for a submodule (contains a dot), the parent module is
+   automatically imported.
+
+   **name** and **package** work the same as for :func:`import_module`.
+
+   .. versionadded:: 3.4
+
 .. decorator:: module_for_loader
 
-    A :term:`decorator` for a :term:`loader` method,
+    A :term:`decorator` for :meth:`importlib.abc.Loader.load_module`
     to handle selecting the proper
     module object to load with. The decorated method is expected to have a call
     signature taking two positional arguments
@@ -878,55 +1136,68 @@
 
     The decorated method will take in the **name** of the module to be loaded
     as expected for a :term:`loader`. If the module is not found in
-    :data:`sys.modules` then a new one is constructed with its
-    :attr:`__name__` attribute set to **name**, :attr:`__loader__` set to
-    **self**, and :attr:`__package__` set if
-    :meth:`importlib.abc.InspectLoader.is_package` is defined for **self** and
-    does not raise :exc:`ImportError` for **name**. If a new module is not
-    needed then the module found in :data:`sys.modules` will be passed into the
-    method.
+    :data:`sys.modules` then a new one is constructed. Regardless of where the
+    module came from, :attr:`__loader__` set to **self** and :attr:`__package__`
+    is set based on what :meth:`importlib.abc.InspectLoader.is_package` returns
+    (if available). These attributes are set unconditionally to support
+    reloading.
 
     If an exception is raised by the decorated method and a module was added to
-    :data:`sys.modules` it will be removed to prevent a partially initialized
-    module from being in left in :data:`sys.modules`. If the module was already
-    in :data:`sys.modules` then it is left alone.
-
-    Use of this decorator handles all the details of which module object a
-    loader should initialize as specified by :pep:`302` as best as possible.
+    :data:`sys.modules`, then the module will be removed to prevent a partially
+    initialized module from being in left in :data:`sys.modules`. If the module
+    was already in :data:`sys.modules` then it is left alone.
 
     .. versionchanged:: 3.3
        :attr:`__loader__` and :attr:`__package__` are automatically set
        (when possible).
 
+    .. versionchanged:: 3.4
+       Set :attr:`__name__`, :attr:`__loader__` :attr:`__package__`
+       unconditionally to support reloading.
+
+    .. deprecated:: 3.4
+       The import machinery now directly performs all the functionality
+       provided by this function.
+
 .. decorator:: set_loader
 
-    A :term:`decorator` for a :term:`loader` method,
-    to set the :attr:`__loader__`
-    attribute on loaded modules. If the attribute is already set the decorator
-    does nothing. It is assumed that the first positional argument to the
-    wrapped method (i.e. ``self``) is what :attr:`__loader__` should be set to.
+   A :term:`decorator` for :meth:`importlib.abc.Loader.load_module`
+   to set the :attr:`__loader__`
+   attribute on the returned module. If the attribute is already set the
+   decorator does nothing. It is assumed that the first positional argument to
+   the wrapped method (i.e. ``self``) is what :attr:`__loader__` should be set
+   to.
 
-   .. note::
+   .. versionchanged:: 3.4
+      Set ``__loader__`` if set to ``None``, as if the attribute does not
+      exist.
 
-      It is recommended that :func:`module_for_loader` be used over this
-      decorator as it subsumes this functionality.
-
+   .. deprecated:: 3.4
+      The import machinery takes care of this automatically.
 
 .. decorator:: set_package
 
-    A :term:`decorator` for a :term:`loader` to set the :attr:`__package__`
-    attribute on the module returned by the loader. If :attr:`__package__` is
-    set and has a value other than ``None`` it will not be changed.
-    Note that the module returned by the loader is what has the attribute
-    set on and not the module found in :data:`sys.modules`.
+   A :term:`decorator` for :meth:`importlib.abc.Loader.load_module` to set the :attr:`__package__` attribute on the returned module. If :attr:`__package__`
+   is set and has a value other than ``None`` it will not be changed.
 
-    Reliance on this decorator is discouraged when it is possible to set
-    :attr:`__package__` before importing. By
-    setting it beforehand the code for the module is executed with the
-    attribute set and thus can be used by global level code during
-    initialization.
+   .. deprecated:: 3.4
+      The import machinery takes care of this automatically.
 
-   .. note::
+.. function:: spec_from_loader(name, loader, *, origin=None, is_package=None)
 
-      It is recommended that :func:`module_for_loader` be used over this
-      decorator as it subsumes this functionality.
+   A factory function for creating a :class:`ModuleSpec` instance based
+   on a loader.  The parameters have the same meaning as they do for
+   ModuleSpec.  The function uses available :term:`loader` APIs, such as
+   :meth:`InspectLoader.is_package`, to fill in any missing
+   information on the spec.
+
+   .. versionadded:: 3.4
+
+.. function:: spec_from_file_location(name, location, *, loader=None, submodule_search_locations=None)
+
+   A factory function for creating a :class:`ModuleSpec` instance based
+   on the path to a file.  Missing information will be filled in on the
+   spec by making use of loader APIs and by the implication that the
+   module will be file-based.
+
+   .. versionadded:: 3.4
diff --git a/Doc/library/index.rst b/Doc/library/index.rst
index 1b25c6e..ac7ab91 100644
--- a/Doc/library/index.rst
+++ b/Doc/library/index.rst
@@ -30,7 +30,7 @@
 In addition to the standard library, there is a growing collection of
 several thousand components (from individual programs and modules to
 packages and entire application development frameworks), available from
-the `Python Package Index <http://pypi.python.org/pypi>`_.
+the `Python Package Index <https://pypi.python.org/pypi>`_.
 
 
 .. toctree::
@@ -65,6 +65,7 @@
    tk.rst
    development.rst
    debug.rst
+   distribution.rst
    python.rst
    custominterp.rst
    modules.rst
@@ -72,4 +73,5 @@
    misc.rst
    windows.rst
    unix.rst
+   superseded.rst
    undoc.rst
diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst
index d4cf905..c540b11 100644
--- a/Doc/library/inspect.rst
+++ b/Doc/library/inspect.rst
@@ -69,7 +69,12 @@
 |           |                 | :term:`bytecode`          |
 +-----------+-----------------+---------------------------+
 |           | __defaults__    | tuple of any default      |
-|           |                 | values for arguments      |
+|           |                 | values for positional or  |
+|           |                 | keyword parameters        |
++-----------+-----------------+---------------------------+
+|           | __kwdefaults__  | mapping of any default    |
+|           |                 | values for keyword-only   |
+|           |                 | parameters                |
 +-----------+-----------------+---------------------------+
 |           | __globals__     | global namespace in which |
 |           |                 | this function was defined |
@@ -173,8 +178,9 @@
 
    .. note::
 
-      :func:`getmembers` does not return metaclass attributes when the argument
-      is a class (this behavior is inherited from the :func:`dir` function).
+      :func:`getmembers` will only return class attributes defined in the
+      metaclass when the argument is a class and those attributes have been
+      listed in the metaclass' custom :meth:`__dir__`.
 
 
 .. function:: getmoduleinfo(path)
@@ -428,11 +434,14 @@
    Accepts a wide range of python callables, from plain functions and classes to
    :func:`functools.partial` objects.
 
+   Raises :exc:`ValueError` if no signature can be provided, and
+   :exc:`TypeError` if that type of object is not supported.
+
    .. note::
 
       Some callables may not be introspectable in certain implementations of
-      Python.  For example, in CPython, built-in functions defined in C provide
-      no metadata about their arguments.
+      Python.  For example, in CPython, some built-in functions defined in
+      C provide no metadata about their arguments.
 
 
 .. class:: Signature(parameters=None, \*, return_annotation=Signature.empty)
@@ -510,9 +519,8 @@
 
    .. attribute:: Parameter.name
 
-      The name of the parameter as a string.  Must be a valid python identifier
-      name (with the exception of ``POSITIONAL_ONLY`` parameters, which can have
-      it set to ``None``).
+      The name of the parameter as a string.  The name must be a valid
+      Python identifier.
 
    .. attribute:: Parameter.default
 
@@ -596,6 +604,10 @@
          >>> str(param.replace(default=Parameter.empty, annotation='spam'))
          "foo:'spam'"
 
+    .. versionchanged:: 3.4
+        In Python 3.3 Parameter objects were allowed to have ``name`` set
+        to ``None`` if their ``kind`` was set to ``POSITIONAL_ONLY``.
+        This is no longer permitted.
 
 .. class:: BoundArguments
 
@@ -630,7 +642,8 @@
         ((5,), {})
 
         >>> for param in sig.parameters.values():
-        ...     if param.name not in ba.arguments:
+        ...     if (param.name not in ba.arguments
+        ...             and param.default is not param.empty):
         ...         ba.arguments[param.name] = param.default
 
         >>> ba.args, ba.kwargs
@@ -717,6 +730,11 @@
       Consider using the new :ref:`Signature Object <inspect-signature-object>`
       interface, which provides a better way of introspecting functions.
 
+   .. versionchanged:: 3.4
+      This function is now based on :func:`signature`, but still ignores
+      ``__wrapped__`` attributes and includes the already bound first
+      parameter in the signature output for bound methods.
+
 
 .. function:: getargvalues(frame)
 
@@ -733,17 +751,20 @@
    :func:`getargspec` or :func:`getfullargspec`.
 
    The first seven arguments are (``args``, ``varargs``, ``varkw``,
-   ``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. For example::
+   ``defaults``, ``kwonlyargs``, ``kwonlydefaults``, ``annotations``).
 
-    >>> from inspect import formatargspec, getfullargspec
-    >>> def f(a: int, b: float):
-    ...     pass
-    ...
-    >>> formatargspec(*getfullargspec(f))
-    '(a: int, b: float)'
+   The other six arguments are functions that are called to turn argument names,
+   ``*`` argument name, ``**`` argument name, default values, return annotation
+   and individual annotations into strings, respectively.
+
+   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])
@@ -806,6 +827,23 @@
    .. versionadded:: 3.3
 
 
+.. function:: unwrap(func, *, stop=None)
+
+   Get the object wrapped by *func*. It follows the chain of :attr:`__wrapped__`
+   attributes returning the last object in the chain.
+
+   *stop* is an optional callback accepting an object in the wrapper chain
+   as its sole argument that allows the unwrapping to be terminated early if
+   the callback returns a true value. If the callback never returns a true
+   value, the last object in the chain is returned as usual. For example,
+   :func:`signature` uses this to stop unwrapping if any object in the
+   chain has a ``__signature__`` attribute defined.
+
+   :exc:`ValueError` is raised if a cycle is encountered.
+
+   .. versionadded:: 3.4
+
+
 .. _inspect-stack:
 
 The interpreter stack
@@ -838,6 +876,10 @@
           finally:
               del frame
 
+   If you want to keep the frame around (for example to print a traceback
+   later), you can also break reference cycles by using the
+   :meth:`frame.clear` method.
+
 The optional *context* argument supported by most of these functions specifies
 the number of lines of context to return, which are centered around the current
 line.
@@ -994,3 +1036,22 @@
       return an empty dictionary.
 
    .. versionadded:: 3.3
+
+
+.. _inspect-module-cli:
+
+Command Line Interface
+----------------------
+
+The :mod:`inspect` module also provides a basic introspection capability
+from the command line.
+
+.. program:: inspect
+
+By default, accepts the name of a module and prints the source of that
+module. A class or function within the module can be printed instead by
+appended a colon and the qualified name of the target object.
+
+.. cmdoption:: --details
+
+   Print information about the specified object rather than the source code
diff --git a/Doc/library/intro.rst b/Doc/library/intro.rst
index a0f2d63..e3283ca 100644
--- a/Doc/library/intro.rst
+++ b/Doc/library/intro.rst
@@ -30,10 +30,8 @@
 option was chosen at the time when Python was compiled and installed.
 
 This manual is organized "from the inside out:" it first describes the built-in
-data types, then the built-in functions and exceptions, and finally the modules,
-grouped in chapters of related modules.  The ordering of the chapters as well as
-the ordering of the modules within each chapter is roughly from most relevant to
-least important.
+functions, data types and exceptions, and finally the modules, grouped in
+chapters of related modules.
 
 This means that if you start reading this manual from the start, and skip to the
 next chapter when you get bored, you will get a reasonable overview of the
diff --git a/Doc/library/io.rst b/Doc/library/io.rst
index 716767f..b8dc688 100644
--- a/Doc/library/io.rst
+++ b/Doc/library/io.rst
@@ -283,13 +283,13 @@
       Return ``True`` if the stream can be read from.  If ``False``, :meth:`read`
       will raise :exc:`OSError`.
 
-   .. method:: readline(limit=-1)
+   .. method:: readline(size=-1)
 
-      Read and return one line from the stream.  If *limit* is specified, at
-      most *limit* bytes will be read.
+      Read and return one line from the stream.  If *size* is specified, at
+      most *size* bytes will be read.
 
       The line terminator is always ``b'\n'`` for binary files; for text files,
-      the *newlines* argument to :func:`open` can be used to select the line
+      the *newline* argument to :func:`open` can be used to select the line
       terminator(s) recognized.
 
    .. method:: readlines(hint=-1)
@@ -353,6 +353,12 @@
       is usual for each of the lines provided to have a line separator at the
       end.
 
+   .. method:: __del__()
+
+      Prepare for object destruction. :class:`IOBase` provides a default
+      implementation of this method that calls the instance's
+      :meth:`~IOBase.close` method.
+
 
 .. class:: RawIOBase
 
@@ -366,14 +372,14 @@
    In addition to the attributes and methods from :class:`IOBase`,
    :class:`RawIOBase` provides the following methods:
 
-   .. method:: read(n=-1)
+   .. method:: read(size=-1)
 
-      Read up to *n* bytes from the object and return them.  As a convenience,
-      if *n* is unspecified or -1, :meth:`readall` is called.  Otherwise,
-      only one system call is ever made.  Fewer than *n* bytes may be
-      returned if the operating system call returns fewer than *n* bytes.
+      Read up to *size* bytes from the object and return them.  As a convenience,
+      if *size* is unspecified or -1, :meth:`readall` is called.  Otherwise,
+      only one system call is ever made.  Fewer than *size* bytes may be
+      returned if the operating system call returns fewer than *size* bytes.
 
-      If 0 bytes are returned, and *n* was not 0, this indicates end of file.
+      If 0 bytes are returned, and *size* was not 0, this indicates end of file.
       If the object is in non-blocking mode and no bytes are available,
       ``None`` is returned.
 
@@ -442,10 +448,10 @@
 
       .. versionadded:: 3.1
 
-   .. method:: read(n=-1)
+   .. method:: read(size=-1)
 
-      Read and return up to *n* bytes.  If the argument is omitted, ``None``, or
-      negative, data is read and returned until EOF is reached.  An empty
+      Read and return up to *size* bytes.  If the argument is omitted, ``None``,
+      or negative, data is read and returned until EOF is reached.  An empty
       :class:`bytes` object is returned if the stream is already at EOF.
 
       If the argument is positive, and the underlying raw stream is not
@@ -457,9 +463,9 @@
       A :exc:`BlockingIOError` is raised if the underlying raw stream is in
       non blocking-mode, and has no data available at the moment.
 
-   .. method:: read1(n=-1)
+   .. method:: read1(size=-1)
 
-      Read and return up to *n* bytes, with at most one call to the underlying
+      Read and return up to *size* bytes, with at most one call to the underlying
       raw stream's :meth:`~RawIOBase.read` method.  This can be useful if you
       are implementing your own buffering on top of a :class:`BufferedIOBase`
       object.
@@ -522,6 +528,8 @@
    :mod:`os.open` as *opener* results in functionality similar to passing
    ``None``).
 
+   The newly created file is :ref:`non-inheritable <fd_inheritance>`.
+
    See the :func:`open` built-in function for examples on using the *opener*
    parameter.
 
@@ -529,6 +537,9 @@
       The *opener* parameter was added.
       The ``'x'`` mode was added.
 
+   .. versionchanged:: 3.4
+      The file is now non-inheritable.
+
    In addition to the attributes and methods from :class:`IOBase` and
    :class:`RawIOBase`, :class:`FileIO` provides the following data
    attributes:
@@ -601,21 +612,21 @@
    :class:`BufferedReader` provides or overrides these methods in addition to
    those from :class:`BufferedIOBase` and :class:`IOBase`:
 
-   .. method:: peek([n])
+   .. method:: peek([size])
 
       Return bytes from the stream without advancing the position.  At most one
       single read on the raw stream is done to satisfy the call. The number of
       bytes returned may be less or more than requested.
 
-   .. method:: read([n])
+   .. method:: read([size])
 
-      Read and return *n* bytes, or if *n* is not given or negative, until EOF
-      or if the read call would block in non-blocking mode.
+      Read and return *size* bytes, or if *size* is not given or negative, until
+      EOF or if the read call would block in non-blocking mode.
 
-   .. method:: read1(n)
+   .. method:: read1(size)
 
-      Read and return up to *n* bytes with only one call on the raw stream.  If
-      at least one byte is buffered, only buffered bytes are returned.
+      Read and return up to *size* bytes with only one call on the raw stream.
+      If at least one byte is buffered, only buffered bytes are returned.
       Otherwise, one raw stream read call is made.
 
 
@@ -735,17 +746,17 @@
 
       .. versionadded:: 3.1
 
-   .. method:: read(n)
+   .. method:: read(size)
 
-      Read and return at most *n* characters from the stream as a single
-      :class:`str`.  If *n* is negative or ``None``, reads until EOF.
+      Read and return at most *size* characters from the stream as a single
+      :class:`str`.  If *size* is negative or ``None``, reads until EOF.
 
-   .. method:: readline(limit=-1)
+   .. method:: readline(size=-1)
 
       Read until newline or EOF and return a single ``str``.  If the stream is
       already at EOF, an empty string is returned.
 
-      If *limit* is specified, at most *limit* characters will be read.
+      If *size* is specified, at most *size* characters will be read.
 
    .. method:: seek(offset, whence=SEEK_SET)
 
diff --git a/Doc/library/ipaddress.rst b/Doc/library/ipaddress.rst
index 8eac92f..ca87980 100644
--- a/Doc/library/ipaddress.rst
+++ b/Doc/library/ipaddress.rst
@@ -9,13 +9,6 @@
 
 --------------
 
-.. note::
-
-   The ``ipaddress`` module has been included in the standard library on a
-   :term:`provisional basis <provisional package>`. Backwards incompatible
-   changes (up to and including removal of the package) may occur if deemed
-   necessary by the core developers.
-
 :mod:`ipaddress` provides the capabilities to create, manipulate and
 operate on IPv4 and IPv6 addresses and networks.
 
@@ -25,8 +18,8 @@
 subnet, checking whether or not a string represents a valid IP address or
 network definition, and so on.
 
-This is the full module API reference - for an overview and introduction,
-see :ref:`ipaddress-howto`.
+This is the full module API reference—for an overview and introduction, see
+:ref:`ipaddress-howto`.
 
 .. versionadded:: 3.3
 
@@ -161,7 +154,16 @@
    .. attribute:: is_private
 
       ``True`` if the address is allocated for private networks.  See
-      :RFC:`1918` (for IPv4) or :RFC:`4193` (for IPv6).
+      iana-ipv4-special-registry_ (for IPv4) or iana-ipv6-special-registry_
+      (for IPv6).
+
+   .. attribute:: is_global
+
+      ``True`` if the address is allocated for public networks.  See
+      iana-ipv4-special-registry_ (for IPv4) or iana-ipv6-special-registry_
+      (for IPv6).
+
+      .. versionadded:: 3.4
 
    .. attribute:: is_unspecified
 
@@ -182,6 +184,9 @@
       ``True`` if the address is reserved for link-local usage.  See
       :RFC:`3927`.
 
+.. _iana-ipv4-special-registry: http://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml
+.. _iana-ipv6-special-registry: http://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml
+
 
 .. class:: IPv6Address(address)
 
@@ -216,18 +221,23 @@
    The long form of the address representation, with all leading zeroes and
    groups consisting entirely of zeroes included.
 
+
+   For the following attributes, see the corresponding documention of the
+   :class:`IPv4Address` class:
+
    .. attribute:: packed
    .. attribute:: version
    .. attribute:: max_prefixlen
    .. attribute:: is_multicast
    .. attribute:: is_private
+   .. attribute:: is_global
    .. attribute:: is_unspecified
    .. attribute:: is_reserved
    .. attribute:: is_loopback
    .. attribute:: is_link_local
 
-      Refer to the corresponding attribute documentation in
-      :class:`IPv4Address`
+      .. versionadded:: 3.4
+         is_global
 
    .. attribute:: is_site_local
 
diff --git a/Doc/library/ipc.rst b/Doc/library/ipc.rst
index 91ec693..6b17563 100644
--- a/Doc/library/ipc.rst
+++ b/Doc/library/ipc.rst
@@ -9,7 +9,7 @@
 
 Some modules only work for two processes that are on the same machine, e.g.
 :mod:`signal` and :mod:`mmap`.  Other modules support networking protocols
-that two or more processes can used to communicate across machines.
+that two or more processes can use to communicate across machines.
 
 The list of modules described in this chapter is:
 
@@ -18,6 +18,9 @@
 
    socket.rst
    ssl.rst
+   select.rst
+   selectors.rst
+   asyncio.rst
    asyncore.rst
    asynchat.rst
    signal.rst
diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst
index 5d3e50a..f489535 100644
--- a/Doc/library/itertools.rst
+++ b/Doc/library/itertools.rst
@@ -784,6 +784,19 @@
        except exception:
            pass
 
+   def first_true(iterable, default=False, pred=None):
+       """Returns the first true value in the iterable.
+
+       If no true value is found, returns *default*
+
+       If *pred* is not None, returns the first item
+       for which pred(item) is true.
+
+       """
+       # first_true([a,b,c], x) --> a or b or c or x
+       # first_true([a,b], x, f) --> a if f(a) else b if f(b) else x
+       return next(filter(pred, iterable), default)
+
    def random_product(*args, repeat=1):
        "Random selection from itertools.product(*args, **kwds)"
        pools = [tuple(pool) for pool in args] * repeat
diff --git a/Doc/library/json.rst b/Doc/library/json.rst
index f652039..6f5f8b1 100644
--- a/Doc/library/json.rst
+++ b/Doc/library/json.rst
@@ -7,9 +7,11 @@
 .. sectionauthor:: Bob Ippolito <bob@redivi.com>
 
 `JSON (JavaScript Object Notation) <http://json.org>`_, specified by
-:rfc:`4627`, is a lightweight data interchange format based on a subset of
-`JavaScript <http://en.wikipedia.org/wiki/JavaScript>`_ syntax (`ECMA-262 3rd
-edition <http://www.ecma-international.org/publications/files/ECMA-ST-ARCH/ECMA-262,%203rd%20edition,%20December%201999.pdf>`_).
+:rfc:`7159` (which obsoletes :rfc:`4627`) and by
+`ECMA-404 <http://www.ecma-international.org/publications/standards/Ecma-404.htm>`_,
+is a lightweight data interchange format inspired by
+`JavaScript <http://en.wikipedia.org/wiki/JavaScript>`_ object literal syntax
+(although it is not a strict subset of JavaScript [#rfc-errata]_ ).
 
 :mod:`json` exposes an API familiar to users of the standard library
 :mod:`marshal` and :mod:`pickle` modules.
@@ -42,8 +44,7 @@
 Pretty printing::
 
     >>> import json
-    >>> print(json.dumps({'4': 5, '6': 7}, sort_keys=True,
-    ...                  indent=4, separators=(',', ': ')))
+    >>> print(json.dumps({'4': 5, '6': 7}, sort_keys=True, indent=4))
     {
         "4": 5,
         "6": 7
@@ -98,11 +99,11 @@
 
 Using json.tool from the shell to validate and pretty-print::
 
-    $ echo '{"json":"obj"}' | python -mjson.tool
+    $ echo '{"json":"obj"}' | python -m json.tool
     {
         "json": "obj"
     }
-    $ echo '{1.2:3.4}' | python -mjson.tool
+    $ echo '{1.2:3.4}' | python -m json.tool
     Expecting property name enclosed in double quotes: line 1 column 2 (char 1)
 
 .. highlight:: python3
@@ -158,15 +159,13 @@
    .. versionchanged:: 3.2
       Allow strings for *indent* in addition to integers.
 
-   .. note::
+   If specified, *separators* should be an ``(item_separator, key_separator)``
+   tuple.  The default is ``(', ', ': ')`` if *indent* is ``None`` and
+   ``(',', ': ')`` otherwise.  To get the most compact JSON representation,
+   you should specify ``(',', ':')`` to eliminate whitespace.
 
-      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.
+   .. versionchanged:: 3.4
+      Use ``(',', ': ')`` as default if *indent* is not ``None``.
 
    *default(obj)* is a function that should return a serializable version of
    *obj* or raise :exc:`TypeError`.  The default simply raises :exc:`TypeError`.
@@ -248,6 +247,8 @@
    kwarg; otherwise :class:`JSONDecoder` is used.  Additional keyword arguments
    will be passed to the constructor of the class.
 
+   If the data being deserialized is not a valid JSON document, a
+   :exc:`ValueError` will be raised.
 
 .. function:: loads(s, encoding=None, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, **kw)
 
@@ -257,6 +258,8 @@
    The other arguments have the same meaning as in :func:`load`, except
    *encoding* which is ignored and deprecated.
 
+   If the data being deserialized is not a valid JSON document, a
+   :exc:`ValueError` will be raised.
 
 Encoders and Decoders
 ---------------------
@@ -354,23 +357,26 @@
 
    .. _py-to-json-table:
 
-   +-------------------+---------------+
-   | Python            | JSON          |
-   +===================+===============+
-   | dict              | object        |
-   +-------------------+---------------+
-   | list, tuple       | array         |
-   +-------------------+---------------+
-   | str               | string        |
-   +-------------------+---------------+
-   | int, float        | number        |
-   +-------------------+---------------+
-   | True              | true          |
-   +-------------------+---------------+
-   | False             | false         |
-   +-------------------+---------------+
-   | None              | null          |
-   +-------------------+---------------+
+   +----------------------------------------+---------------+
+   | Python                                 | JSON          |
+   +========================================+===============+
+   | dict                                   | object        |
+   +----------------------------------------+---------------+
+   | list, tuple                            | array         |
+   +----------------------------------------+---------------+
+   | str                                    | string        |
+   +----------------------------------------+---------------+
+   | int, float, int- & float-derived Enums | number        |
+   +----------------------------------------+---------------+
+   | True                                   | true          |
+   +----------------------------------------+---------------+
+   | False                                  | false         |
+   +----------------------------------------+---------------+
+   | None                                   | null          |
+   +----------------------------------------+---------------+
+
+   .. versionchanged:: 3.4
+      Added support for int- and float-derived Enum classes.
 
    To extend this to recognize other objects, subclass and implement a
    :meth:`default` method with another method that returns a serializable object
@@ -410,15 +416,13 @@
    .. 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
-   representation, you should specify ``(',', ':')`` to eliminate whitespace.
+   tuple.  The default is ``(', ', ': ')`` if *indent* is ``None`` and
+   ``(',', ': ')`` otherwise.  To get the most compact JSON representation,
+   you should specify ``(',', ':')`` to eliminate whitespace.
+
+   .. versionchanged:: 3.4
+      Use ``(',', ': ')`` as default if *indent* is not ``None``.
 
    If specified, *default* is a function that gets called for objects that can't
    otherwise be serialized.  It should return a JSON encodable version of the
@@ -463,18 +467,18 @@
                 mysocket.write(chunk)
 
 
-Standard Compliance
--------------------
+Standard Compliance and Interoperability
+----------------------------------------
 
-The JSON format is specified by :rfc:`4627`.  This section details this
-module's level of compliance with the RFC.  For simplicity,
-:class:`JSONEncoder` and :class:`JSONDecoder` subclasses, and parameters other
-than those explicitly mentioned, are not considered.
+The JSON format is specified by :rfc:`7159` and by
+`ECMA-404 <http://www.ecma-international.org/publications/standards/Ecma-404.htm>`_.
+This section details this module's level of compliance with the RFC.
+For simplicity, :class:`JSONEncoder` and :class:`JSONDecoder` subclasses, and
+parameters other than those explicitly mentioned, are not considered.
 
 This module does not comply with the RFC in a strict fashion, implementing some
 extensions that are valid JavaScript but not valid JSON.  In particular:
 
-- Top-level non-object, non-array values are accepted and output;
 - Infinite and NaN number values are accepted and output;
 - Repeated names within an object are accepted, and only the value of the last
   name-value pair is used.
@@ -486,8 +490,8 @@
 Character Encodings
 ^^^^^^^^^^^^^^^^^^^
 
-The RFC recommends that JSON be represented using either UTF-8, UTF-16, or
-UTF-32, with UTF-8 being the default.
+The RFC requires that JSON be represented using either UTF-8, UTF-16, or
+UTF-32, with UTF-8 being the recommended default for maximum interoperability.
 
 As permitted, though not required, by the RFC, this module's serializer sets
 *ensure_ascii=True* by default, thus escaping the output so that the resulting
@@ -495,34 +499,20 @@
 
 Other than the *ensure_ascii* parameter, this module is defined strictly in
 terms of conversion between Python objects and
-:class:`Unicode strings <str>`, and thus does not otherwise address the issue
-of character encodings.
+:class:`Unicode strings <str>`, and thus does not otherwise directly address
+the issue of character encodings.
 
+The RFC prohibits adding a byte order mark (BOM) to the start of a JSON text,
+and this module's serializer does not add a BOM to its output.
+The RFC permits, but does not require, JSON deserializers to ignore an initial
+BOM in their input.  This module's deserializer raises a :exc:`ValueError`
+when an initial BOM is present.
 
-Top-level Non-Object, Non-Array Values
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-The RFC specifies that the top-level value of a JSON text must be either a
-JSON object or array (Python :class:`dict` or :class:`list`).  This module's
-deserializer also accepts input texts consisting solely of a
-JSON null, boolean, number, or string value::
-
-   >>> just_a_json_string = '"spam and eggs"'  # Not by itself a valid JSON text
-   >>> json.loads(just_a_json_string)
-   'spam and eggs'
-
-This module itself does not include a way to request that such input texts be
-regarded as illegal.  Likewise, this module's serializer also accepts single
-Python :data:`None`, :class:`bool`, numeric, and :class:`str`
-values as input and will generate output texts consisting solely of a top-level
-JSON null, boolean, number, or string value without raising an exception::
-
-   >>> neither_a_list_nor_a_dict = "spam and eggs"
-   >>> json.dumps(neither_a_list_nor_a_dict)  # The result is not a valid JSON text
-   '"spam and eggs"'
-
-This module's serializer does not itself include a way to enforce the
-aforementioned constraint.
+The RFC does not explicitly forbid JSON strings which contain byte sequences
+that don't correspond to valid Unicode characters (e.g. unpaired UTF-16
+surrogates), but it does note that they may cause interoperability problems.
+By default, this module accepts and outputs (when present in the original
+:class:`str`) code points for such sequences.
 
 
 Infinite and NaN Number Values
@@ -552,7 +542,7 @@
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 The RFC specifies that the names within a JSON object should be unique, but
-does not specify how repeated names in JSON objects should be handled.  By
+does not mandate how repeated names in JSON objects should be handled.  By
 default, this module does not raise an exception; instead, it ignores all but
 the last name-value pair for a given name::
 
@@ -561,3 +551,48 @@
    {'x': 3}
 
 The *object_pairs_hook* parameter can be used to alter this behavior.
+
+
+Top-level Non-Object, Non-Array Values
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The old version of JSON specified by the obsolete :rfc:`4627` required that
+the top-level value of a JSON text must be either a JSON object or array
+(Python :class:`dict` or :class:`list`), and could not be a JSON null,
+boolean, number, or string value.  :rfc:`7159` removed that restriction, and
+this module does not and has never implemented that restriction in either its
+serializer or its deserializer.
+
+Regardless, for maximum interoperability, you may wish to voluntarily adhere
+to the restriction yourself.
+
+
+Implementation Limitations
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Some JSON deserializer implementations may set limits on:
+
+* the size of accepted JSON texts
+* the maximum level of nesting of JSON objects and arrays
+* the range and precision of JSON numbers
+* the content and maximum length of JSON strings
+
+This module does not impose any such limits beyond those of the relevant
+Python datatypes themselves or the Python interpreter itself.
+
+When serializing to JSON, beware any such limitations in applications that may
+consume your JSON.  In particular, it is common for JSON numbers to be
+deserialized into IEEE 754 double precision numbers and thus subject to that
+representation's range and precision limitations.  This is especially relevant
+when serializing Python :class:`int` values of extremely large magnitude, or
+when serializing instances of "exotic" numerical types such as
+:class:`decimal.Decimal`.
+
+
+.. rubric:: Footnotes
+
+.. [#rfc-errata] As noted in `the errata for RFC 7159
+   <http://www.rfc-editor.org/errata_search.php?rfc=7159>`_,
+   JSON permits literal U+2028 (LINE SEPARATOR) and
+   U+2029 (PARAGRAPH SEPARATOR) characters in strings, whereas JavaScript
+   (as of ECMAScript Edition 5.1) does not.
diff --git a/Doc/library/logging.config.rst b/Doc/library/logging.config.rst
index 303b4d8..180569b 100644
--- a/Doc/library/logging.config.rst
+++ b/Doc/library/logging.config.rst
@@ -80,27 +80,49 @@
 
 .. function:: fileConfig(fname, defaults=None, disable_existing_loggers=True)
 
-   Reads the logging configuration from a :mod:`configparser`\-format file
-   named *fname*. The format of the file should be as described in
-   :ref:`logging-config-fileformat`. This function can be called several times
-   from an application, allowing an end user to select from various pre-canned
-   configurations (if the developer provides a mechanism to present the choices
-   and load the chosen configuration).
+   Reads the logging configuration from a :mod:`configparser`\-format file. The
+   format of the file should be as described in
+   :ref:`logging-config-fileformat`.
+   This function can be called several times from an application, allowing an
+   end user to select from various pre-canned configurations (if the developer
+   provides a mechanism to present the choices and load the chosen
+   configuration).
+
+   :param fname: A filename, or a file-like object, or an instance derived
+                 from :class:`~configparser.RawConfigParser`. If a
+                 ``RawConfigParser``-derived instance is passed, it is used as
+                 is. Otherwise, a :class:`~configparser.Configparser` is
+                 instantiated, and the configuration read by it from the
+                 object passed in ``fname``. If that has a :meth:`readline`
+                 method, it is assumed to be a file-like object and read using
+                 :meth:`~configparser.ConfigParser.read_file`; otherwise,
+                 it is assumed to be a filename and passed to
+                 :meth:`~configparser.ConfigParser.read`.
+
 
    :param defaults: Defaults to be passed to the ConfigParser can be specified
                     in this argument.
 
    :param disable_existing_loggers: If specified as ``False``, loggers which
                                     exist when this call is made are left
-                                    alone. The default is ``True`` because this
+                                    enabled. The default is ``True`` because this
                                     enables old behaviour in a backward-
                                     compatible way. This behaviour is to
                                     disable any existing loggers unless they or
                                     their ancestors are explicitly named in the
                                     logging configuration.
 
+   .. versionchanged:: 3.4
+      An instance of a subclass of :class:`~configparser.RawConfigParser` is
+      now accepted as a value for ``fname``. This facilitates:
 
-.. function:: listen(port=DEFAULT_LOGGING_CONFIG_PORT)
+      * Use of a configuration file where logging configuration is just part
+        of the overall application configuration.
+      * Use of a configuration read from a file, and then modified by the using
+        application (e.g. based on command-line parameters or other aspects
+        of the runtime environment) before being passed to ``fileConfig``.
+
+.. function:: listen(port=DEFAULT_LOGGING_CONFIG_PORT, verify=None)
 
    Starts up a socket server on the specified port, and listens for new
    configurations. If no port is specified, the module's default
@@ -111,6 +133,17 @@
    :meth:`~threading.Thread.join` when appropriate. To stop the server,
    call :func:`stopListening`.
 
+   The ``verify`` argument, if specified, should be a callable which should
+   verify whether bytes received across the socket are valid and should be
+   processed. This could be done by encrypting and/or signing what is sent
+   across the socket, such that the ``verify`` callable can perform
+   signature verification and/or decryption. The ``verify`` callable is called
+   with a single argument - the bytes received across the socket - and should
+   return the bytes to be processed, or None to indicate that the bytes should
+   be discarded. The returned bytes could be the same as the passed in bytes
+   (e.g. when only verification is done), or they could be completely different
+   (perhaps if decryption were performed).
+
    To send a configuration to the socket, read in the configuration file and
    send it to the socket as a string of bytes preceded by a four-byte length
    string packed in binary using ``struct.pack('>L', n)``.
@@ -129,7 +162,12 @@
       :func:`listen` socket and sending a configuration which runs whatever
       code the attacker wants to have executed in the victim's process. This is
       especially easy to do if the default port is used, but not hard even if a
-      different port is used).
+      different port is used). To avoid the risk of this happening, use the
+      ``verify`` argument to :func:`listen` to prevent unrecognised
+      configurations from being applied.
+
+   .. versionchanged:: 3.4.
+      The ``verify`` argument was added.
 
 .. function:: stopListening()
 
diff --git a/Doc/library/logging.handlers.rst b/Doc/library/logging.handlers.rst
index 415e397..63aba1e 100644
--- a/Doc/library/logging.handlers.rst
+++ b/Doc/library/logging.handlers.rst
@@ -269,15 +269,16 @@
    You can use the *maxBytes* and *backupCount* values to allow the file to
    :dfn:`rollover` at a predetermined size. When the size is about to be exceeded,
    the file is closed and a new file is silently opened for output. Rollover occurs
-   whenever the current log file is nearly *maxBytes* in length; if *maxBytes* is
-   zero, rollover never occurs.  If *backupCount* is non-zero, the system will save
-   old log files by appending the extensions '.1', '.2' etc., to the filename. For
-   example, with a *backupCount* of 5 and a base file name of :file:`app.log`, you
-   would get :file:`app.log`, :file:`app.log.1`, :file:`app.log.2`, up to
-   :file:`app.log.5`. The file being written to is always :file:`app.log`.  When
-   this file is filled, it is closed and renamed to :file:`app.log.1`, and if files
-   :file:`app.log.1`, :file:`app.log.2`, etc.  exist, then they are renamed to
-   :file:`app.log.2`, :file:`app.log.3` etc.  respectively.
+   whenever the current log file is nearly *maxBytes* in length; if either of
+   *maxBytes* or *backupCount* is zero, rollover never occurs.  If *backupCount*
+   is non-zero, the system will save old log files by appending the extensions
+   '.1', '.2' etc., to the filename. For example, with a *backupCount* of 5 and
+   a base file name of :file:`app.log`, you would get :file:`app.log`,
+   :file:`app.log.1`, :file:`app.log.2`, up to :file:`app.log.5`. The file being
+   written to is always :file:`app.log`.  When this file is filled, it is closed
+   and renamed to :file:`app.log.1`, and if files :file:`app.log.1`,
+   :file:`app.log.2`, etc.  exist, then they are renamed to :file:`app.log.2`,
+   :file:`app.log.3` etc.  respectively.
 
 
    .. method:: doRollover()
@@ -300,7 +301,7 @@
 timed intervals.
 
 
-.. class:: TimedRotatingFileHandler(filename, when='h', interval=1, backupCount=0, encoding=None, delay=False, utc=False)
+.. class:: TimedRotatingFileHandler(filename, when='h', interval=1, backupCount=0, encoding=None, delay=False, utc=False, atTime=None)
 
    Returns a new instance of the :class:`TimedRotatingFileHandler` class. The
    specified file is opened and used as the stream for logging. On rotating it also
@@ -350,6 +351,12 @@
    If *delay* is true, then file opening is deferred until the first call to
    :meth:`emit`.
 
+   If *atTime* is not ``None``, it must be a ``datetime.time`` instance which
+   specifies the time of day when rollover occurs, for the cases where rollover
+   is set to happen "at midnight" or "on a particular weekday".
+
+   .. versionchanged:: 3.4
+      *atTime* parameter was added.
 
    .. method:: doRollover()
 
@@ -375,6 +382,9 @@
    Returns a new instance of the :class:`SocketHandler` class intended to
    communicate with a remote machine whose address is given by *host* and *port*.
 
+   .. versionchanged:: 3.4
+      If ``port`` is specified as ``None``, a Unix domain socket is created
+      using the value in ``host`` - otherwise, a TCP socket is created.
 
    .. method:: close()
 
@@ -460,6 +470,9 @@
    Returns a new instance of the :class:`DatagramHandler` class intended to
    communicate with a remote machine whose address is given by *host* and *port*.
 
+   .. versionchanged:: 3.4
+      If ``port`` is specified as ``None``, a Unix domain socket is created
+      using the value in ``host`` - otherwise, a TCP socket is created.
 
    .. method:: emit()
 
@@ -827,21 +840,43 @@
 ``POST`` semantics.
 
 
-.. class:: HTTPHandler(host, url, method='GET', secure=False, credentials=None)
+.. class:: HTTPHandler(host, url, method='GET', secure=False, credentials=None, context=None)
 
    Returns a new instance of the :class:`HTTPHandler` class. The *host* can be
-   of the form ``host:port``, should you need to use a specific port number.
-   If no *method* is specified, ``GET`` is used. If *secure* is true, an HTTPS
-   connection will be used. If *credentials* is specified, it should be a
-   2-tuple consisting of userid and password, which will be placed in an HTTP
+   of the form ``host:port``, should you need to use a specific port number.  If
+   no *method* is specified, ``GET`` is used. If *secure* is true, a HTTPS
+   connection will be used. The *context* parameter may be set to a
+   :class:`ssl.SSLContext` instance to configure the SSL settings used for the
+   HTTPS connection. If *credentials* is specified, it should be a 2-tuple
+   consisting of userid and password, which will be placed in a HTTP
    'Authorization' header using Basic authentication. If you specify
    credentials, you should also specify secure=True so that your userid and
    password are not passed in cleartext across the wire.
 
+   .. versionchanged:: 3.4.3
+      The *context* parameter was added.
+
+   .. method:: mapLogRecord(record)
+
+      Provides a dictionary, based on ``record``, which is to be URL-encoded
+      and sent to the web server. The default implementation just returns
+      ``record.__dict__``. This method can be overridden if e.g. only a
+      subset of :class:`~logging.LogRecord` is to be sent to the web server, or
+      if more specific customization of what's sent to the server is required.
 
    .. method:: emit(record)
 
-      Sends the record to the Web server as a percent-encoded dictionary.
+      Sends the record to the Web server as an URL-encoded dictionary. The
+      :meth:`mapLogRecord` method is used to convert the record to the
+      dictionary to be sent.
+
+   .. note:: Since preparing a record for sending it to a Web server is not
+      the same as a generic formatting operation, using
+      :meth:`~logging.Handler.setFormatter` to specify a
+      :class:`~logging.Formatter` for a :class:`HTTPHandler` has no effect.
+      Instead of calling :meth:`~logging.Handler.format`, this handler calls
+      :meth:`mapLogRecord` and then :func:`urllib.parse.urlencode` to encode the
+      dictionary in a form suitable for sending to a Web server.
 
 
 .. _queue-handler:
diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst
index 8d093e1..96861a7 100644
--- a/Doc/library/logging.rst
+++ b/Doc/library/logging.rst
@@ -118,7 +118,9 @@
    .. versionchanged:: 3.2
       The *lvl* parameter now accepts a string representation of the
       level such as 'INFO' as an alternative to the integer constants
-      such as :const:`INFO`.
+      such as :const:`INFO`. Note, however, that levels are internally stored
+      as integers, and methods such as e.g. :meth:`getEffectiveLevel` and
+      :meth:`isEnabledFor` will return/expect to be passed integers.
 
 
 .. method:: Logger.isEnabledFor(lvl)
@@ -134,7 +136,9 @@
    Indicates the effective level for this logger. If a value other than
    :const:`NOTSET` has been set using :meth:`setLevel`, it is returned. Otherwise,
    the hierarchy is traversed towards the root until a value other than
-   :const:`NOTSET` is found, and that value is returned.
+   :const:`NOTSET` is found, and that value is returned. The value returned is
+   an integer, typically one of :const:`logging.DEBUG`, :const:`logging.INFO`
+   etc.
 
 
 .. method:: Logger.getChild(suffix)
@@ -250,7 +254,7 @@
    interpreted as for :meth:`debug`.
 
 
-.. method:: Logger.exception(msg, *args)
+.. method:: Logger.exception(msg, *args, **kwargs)
 
    Logs a message with level :const:`ERROR` on this logger. The arguments are
    interpreted as for :meth:`debug`. Exception info is added to the logging
@@ -992,7 +996,7 @@
    are interpreted as for :func:`debug`.
 
 
-.. function:: exception(msg, *args)
+.. function:: exception(msg, *args, **kwargs)
 
    Logs a message with level :const:`ERROR` on the root logger. The arguments are
    interpreted as for :func:`debug`. Exception info is added to the logging
@@ -1049,6 +1053,16 @@
    of the defined levels is passed in, the corresponding string representation is
    returned. Otherwise, the string 'Level %s' % lvl is returned.
 
+   .. note:: Levels are internally integers (as they need to be compared in the
+      logging logic). This function is used to convert between an integer level
+      and the level name displayed in the formatted log output by means of the
+      ``%(levelname)s`` format specifier (see :ref:`logrecord-attributes`).
+
+   .. versionchanged:: 3.4
+      In Python versions earlier than 3.4, this function could also be passed a
+      text level, and would return the corresponding numeric value of the level.
+      This undocumented behaviour was considered a mistake, and was removed in
+      Python 3.4, but reinstated in 3.4.2 due to retain backward compatibility.
 
 .. function:: makeLogRecord(attrdict)
 
diff --git a/Doc/library/lzma.rst b/Doc/library/lzma.rst
index 07b69eb..b71051d 100644
--- a/Doc/library/lzma.rst
+++ b/Doc/library/lzma.rst
@@ -39,8 +39,8 @@
    opened, or it can be an existing file object to read from or write to.
 
    The *mode* argument can be any of ``"r"``, ``"rb"``, ``"w"``, ``"wb"``,
-   ``"a"`` or ``"ab"`` for binary mode, or ``"rt"``, ``"wt"``, or ``"at"`` for
-   text mode. The default is ``"rb"``.
+   ``"x"``, ``"xb"``, ``"a"`` or ``"ab"`` for binary mode, or ``"rt"``,
+   ``"wt"``, ``"xt"``, or ``"at"`` for text mode. The default is ``"rb"``.
 
    When opening a file for reading, the *format* and *filters* arguments have
    the same meanings as for :class:`LZMADecompressor`. In this case, the *check*
@@ -57,6 +57,9 @@
    :class:`io.TextIOWrapper` instance with the specified encoding, error
    handling behavior, and line ending(s).
 
+   .. versionchanged:: 3.4
+      Added support for the ``"x"``, ``"xb"`` and ``"xt"`` modes.
+
 
 .. class:: LZMAFile(filename=None, mode="r", \*, format=None, check=-1, preset=None, filters=None)
 
@@ -69,8 +72,9 @@
    file will not be closed when the :class:`LZMAFile` is closed.
 
    The *mode* argument can be either ``"r"`` for reading (default), ``"w"`` for
-   overwriting, or ``"a"`` for appending. These can equivalently be given as
-   ``"rb"``, ``"wb"``, and ``"ab"`` respectively.
+   overwriting, ``"x"`` for exclusive creation, or ``"a"`` for appending. These
+   can equivalently be given as ``"rb"``, ``"wb"``, ``"xb"`` and ``"ab"``
+   respectively.
 
    If *filename* is a file object (rather than an actual file name), a mode of
    ``"w"`` does not truncate the file, and is instead equivalent to ``"a"``.
@@ -103,6 +107,9 @@
          file object (e.g. if the :class:`LZMAFile` was constructed by passing a
          file object for *filename*).
 
+   .. versionchanged:: 3.4
+      Added support for the ``"x"`` and ``"xb"`` modes.
+
 
 Compressing and decompressing data in memory
 --------------------------------------------
diff --git a/Doc/library/mailbox.rst b/Doc/library/mailbox.rst
index 0478ed1..6334bd6 100644
--- a/Doc/library/mailbox.rst
+++ b/Doc/library/mailbox.rst
@@ -202,7 +202,7 @@
       .. versionchanged:: 3.2
          The file object really is a binary file; previously it was incorrectly
          returned in text mode.  Also, the file-like object now supports the
-         context manager protocol: you can use a :keyword:`with` statement to
+         context management protocol: you can use a :keyword:`with` statement to
          automatically close it.
 
       .. note::
@@ -487,7 +487,7 @@
    `Configuring Netscape Mail on Unix: Why The Content-Length Format is Bad <http://www.jwz.org/doc/content-length.html>`_
       An argument for using the original mbox format rather than a variation.
 
-   `"mbox" is a family of several mutually incompatible mailbox formats <http://homepages.tesco.net./~J.deBoynePollard/FGA/mail-mbox-formats.html>`_
+   `"mbox" is a family of several mutually incompatible mailbox formats <http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/mail-mbox-formats.html>`_
       A history of mbox variations.
 
 
diff --git a/Doc/library/marshal.rst b/Doc/library/marshal.rst
index 3b9e3d2..af43944 100644
--- a/Doc/library/marshal.rst
+++ b/Doc/library/marshal.rst
@@ -40,10 +40,11 @@
 point numbers, complex numbers, strings, bytes, bytearrays, tuples, lists, sets,
 frozensets, dictionaries, and code objects, where it should be understood that
 tuples, lists, sets, frozensets and dictionaries are only supported as long as
-the values contained therein are themselves supported; and recursive lists, sets
-and dictionaries should not be written (they will cause infinite loops).  The
+the values contained therein are themselves supported.
 singletons :const:`None`, :const:`Ellipsis` and :exc:`StopIteration` can also be
 marshalled and unmarshalled.
+For format *version* lower than 3, recursive lists, sets and dictionaries cannot
+be written (see below).
 
 There are functions that read/write files as well as functions operating on
 strings.
@@ -103,7 +104,9 @@
 
    Indicates the format that the module uses. Version 0 is the historical
    format, version 1 shares interned strings and version 2 uses a binary format
-   for floating point numbers. The current version is 2.
+   for floating point numbers.
+   Version 3 adds support for object instancing and recursion.
+   The current version is 4.
 
 
 .. rubric:: Footnotes
diff --git a/Doc/library/mimetypes.rst b/Doc/library/mimetypes.rst
index 12c9eca..f836243 100644
--- a/Doc/library/mimetypes.rst
+++ b/Doc/library/mimetypes.rst
@@ -44,7 +44,7 @@
 
    The optional *strict* argument is a flag specifying whether the list of known MIME types
    is limited to only the official types `registered with IANA
-   <http://www.iana.org/assignments/media-types/>`_.
+   <http://www.iana.org/assignments/media-types/media-types.xhtml>`_.
    When *strict* is ``True`` (the default), only the IANA types are supported; when
    *strict* is ``False``, some additional non-standard but commonly used MIME types
    are also recognized.
diff --git a/Doc/library/modules.rst b/Doc/library/modules.rst
index d89ef10..6b2a40a 100644
--- a/Doc/library/modules.rst
+++ b/Doc/library/modules.rst
@@ -12,7 +12,6 @@
 
 .. toctree::
 
-   imp.rst
    zipimport.rst
    pkgutil.rst
    modulefinder.rst
diff --git a/Doc/library/msilib.rst b/Doc/library/msilib.rst
index d3451c8..4145c8e 100644
--- a/Doc/library/msilib.rst
+++ b/Doc/library/msilib.rst
@@ -120,9 +120,9 @@
 
 .. seealso::
 
-   `FCICreateFile <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/devnotes/winprog/fcicreate.asp>`_
-   `UuidCreate <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rpc/rpc/uuidcreate.asp>`_
-   `UuidToString <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rpc/rpc/uuidtostring.asp>`_
+   `FCICreateFile <http://msdn.microsoft.com/library?url=/library/en-us/devnotes/winprog/fcicreate.asp>`_
+   `UuidCreate <http://msdn.microsoft.com/library?url=/library/en-us/rpc/rpc/uuidcreate.asp>`_
+   `UuidToString <http://msdn.microsoft.com/library?url=/library/en-us/rpc/rpc/uuidtostring.asp>`_
 
 .. _database-objects:
 
@@ -151,9 +151,9 @@
 
 .. seealso::
 
-   `MSIDatabaseOpenView <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msidatabaseopenview.asp>`_
-   `MSIDatabaseCommit <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msidatabasecommit.asp>`_
-   `MSIGetSummaryInformation <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msigetsummaryinformation.asp>`_
+   `MSIDatabaseOpenView <http://msdn.microsoft.com/library?url=/library/en-us/msi/setup/msidatabaseopenview.asp>`_
+   `MSIDatabaseCommit <http://msdn.microsoft.com/library?url=/library/en-us/msi/setup/msidatabasecommit.asp>`_
+   `MSIGetSummaryInformation <http://msdn.microsoft.com/library?url=/library/en-us/msi/setup/msigetsummaryinformation.asp>`_
 
 .. _view-objects:
 
@@ -199,11 +199,11 @@
 
 .. seealso::
 
-   `MsiViewExecute <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msiviewexecute.asp>`_
-   `MSIViewGetColumnInfo <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msiviewgetcolumninfo.asp>`_
-   `MsiViewFetch <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msiviewfetch.asp>`_
-   `MsiViewModify <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msiviewmodify.asp>`_
-   `MsiViewClose <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msiviewclose.asp>`_
+   `MsiViewExecute <http://msdn.microsoft.com/library?url=/library/en-us/msi/setup/msiviewexecute.asp>`_
+   `MSIViewGetColumnInfo <http://msdn.microsoft.com/library?url=/library/en-us/msi/setup/msiviewgetcolumninfo.asp>`_
+   `MsiViewFetch <http://msdn.microsoft.com/library?url=/library/en-us/msi/setup/msiviewfetch.asp>`_
+   `MsiViewModify <http://msdn.microsoft.com/library?url=/library/en-us/msi/setup/msiviewmodify.asp>`_
+   `MsiViewClose <http://msdn.microsoft.com/library?url=/library/en-us/msi/setup/msiviewclose.asp>`_
 
 .. _summary-objects:
 
@@ -243,10 +243,10 @@
 
 .. seealso::
 
-   `MsiSummaryInfoGetProperty <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msisummaryinfogetproperty.asp>`_
-   `MsiSummaryInfoGetPropertyCount <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msisummaryinfogetpropertycount.asp>`_
-   `MsiSummaryInfoSetProperty <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msisummaryinfosetproperty.asp>`_
-   `MsiSummaryInfoPersist <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msisummaryinfopersist.asp>`_
+   `MsiSummaryInfoGetProperty <http://msdn.microsoft.com/library?url=/library/en-us/msi/setup/msisummaryinfogetproperty.asp>`_
+   `MsiSummaryInfoGetPropertyCount <http://msdn.microsoft.com/library?url=/library/en-us/msi/setup/msisummaryinfogetpropertycount.asp>`_
+   `MsiSummaryInfoSetProperty <http://msdn.microsoft.com/library?url=/library/en-us/msi/setup/msisummaryinfosetproperty.asp>`_
+   `MsiSummaryInfoPersist <http://msdn.microsoft.com/library?url=/library/en-us/msi/setup/msisummaryinfopersist.asp>`_
 
 .. _record-objects:
 
@@ -297,11 +297,11 @@
 
 .. seealso::
 
-   `MsiRecordGetFieldCount <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msirecordgetfieldcount.asp>`_
-   `MsiRecordSetString <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msirecordsetstring.asp>`_
-   `MsiRecordSetStream <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msirecordsetstream.asp>`_
-   `MsiRecordSetInteger <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msirecordsetinteger.asp>`_
-   `MsiRecordClear <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msirecordclear.asp>`_
+   `MsiRecordGetFieldCount <http://msdn.microsoft.com/library?url=/library/en-us/msi/setup/msirecordgetfieldcount.asp>`_
+   `MsiRecordSetString <http://msdn.microsoft.com/library?url=/library/en-us/msi/setup/msirecordsetstring.asp>`_
+   `MsiRecordSetStream <http://msdn.microsoft.com/library?url=/library/en-us/msi/setup/msirecordsetstream.asp>`_
+   `MsiRecordSetInteger <http://msdn.microsoft.com/library?url=/library/en-us/msi/setup/msirecordsetinteger.asp>`_
+   `MsiRecordClear <http://msdn.microsoft.com/library?url=/library/en-us/msi/setup/msirecordclear.asp>`_
 
 .. _msi-errors:
 
@@ -393,10 +393,10 @@
 
 .. seealso::
 
-   `Directory Table <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/directory_table.asp>`_
-   `File Table <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/file_table.asp>`_
-   `Component Table <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/component_table.asp>`_
-   `FeatureComponents Table <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/featurecomponents_table.asp>`_
+   `Directory Table <http://msdn.microsoft.com/library?url=/library/en-us/msi/setup/directory_table.asp>`_
+   `File Table <http://msdn.microsoft.com/library?url=/library/en-us/msi/setup/file_table.asp>`_
+   `Component Table <http://msdn.microsoft.com/library?url=/library/en-us/msi/setup/component_table.asp>`_
+   `FeatureComponents Table <http://msdn.microsoft.com/library?url=/library/en-us/msi/setup/featurecomponents_table.asp>`_
 
 .. _features:
 
@@ -421,7 +421,7 @@
 
 .. seealso::
 
-   `Feature Table <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/feature_table.asp>`_
+   `Feature Table <http://msdn.microsoft.com/library?url=/library/en-us/msi/setup/feature_table.asp>`_
 
 .. _msi-gui:
 
@@ -516,13 +516,13 @@
 
 .. seealso::
 
-   `Dialog Table <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/dialog_table.asp>`_
-   `Control Table <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/control_table.asp>`_
-   `Control Types <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/controls.asp>`_
-   `ControlCondition Table <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/controlcondition_table.asp>`_
-   `ControlEvent Table <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/controlevent_table.asp>`_
-   `EventMapping Table <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/eventmapping_table.asp>`_
-   `RadioButton Table <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/radiobutton_table.asp>`_
+   `Dialog Table <http://msdn.microsoft.com/library?url=/library/en-us/msi/setup/dialog_table.asp>`_
+   `Control Table <http://msdn.microsoft.com/library?url=/library/en-us/msi/setup/control_table.asp>`_
+   `Control Types <http://msdn.microsoft.com/library?url=/library/en-us/msi/setup/controls.asp>`_
+   `ControlCondition Table <http://msdn.microsoft.com/library?url=/library/en-us/msi/setup/controlcondition_table.asp>`_
+   `ControlEvent Table <http://msdn.microsoft.com/library?url=/library/en-us/msi/setup/controlevent_table.asp>`_
+   `EventMapping Table <http://msdn.microsoft.com/library?url=/library/en-us/msi/setup/eventmapping_table.asp>`_
+   `RadioButton Table <http://msdn.microsoft.com/library?url=/library/en-us/msi/setup/radiobutton_table.asp>`_
 
 .. _msi-tables:
 
diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst
index 5f50cf1..ecac5b0 100644
--- a/Doc/library/multiprocessing.rst
+++ b/Doc/library/multiprocessing.rst
@@ -16,41 +16,27 @@
 leverage multiple processors on a given machine.  It runs on both Unix and
 Windows.
 
-.. note::
+The :mod:`multiprocessing` module also introduces APIs which do not have
+analogs in the :mod:`threading` module.  A prime example of this is the
+:class:`~multiprocessing.pool.Pool` object which offers a convenient means of
+parallelizing the execution of a function across multiple input values,
+distributing the input data across processes (data parallelism).  The following
+example demonstrates the common practice of defining such functions in a module
+so that child processes can successfully import that module.  This basic example
+of data parallelism using :class:`~multiprocessing.pool.Pool`, ::
 
-    Some of this package's functionality requires a functioning shared semaphore
-    implementation on the host operating system. Without one, the
-    :mod:`multiprocessing.synchronize` module will be disabled, and attempts to
-    import it will result in an :exc:`ImportError`. See
-    :issue:`3770` for additional information.
+   from multiprocessing import Pool
 
-.. note::
+   def f(x):
+       return x*x
 
-    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.Pool` examples will not work in the
-    interactive interpreter. For example::
+   if __name__ == '__main__':
+       with Pool(5) as p:
+           print(p.map(f, [1, 2, 3]))
 
-        >>> from multiprocessing import Pool
-        >>> p = Pool(5)
-        >>> def f(x):
-        ...     return x*x
-        ...
-        >>> p.map(f, [1,2,3])
-        Process PoolWorker-1:
-        Process PoolWorker-2:
-        Process PoolWorker-3:
-        Traceback (most recent call last):
-        Traceback (most recent call last):
-        Traceback (most recent call last):
-        AttributeError: 'module' object has no attribute 'f'
-        AttributeError: 'module' object has no attribute 'f'
-        AttributeError: 'module' object has no attribute 'f'
+will print to standard output ::
 
-    (If you try this it will actually output three full tracebacks
-    interleaved in a semi-random fashion, and then you may have to
-    stop the master process somehow.)
+   [1, 4, 9]
 
 
 The :class:`Process` class
@@ -93,11 +79,112 @@
         p.start()
         p.join()
 
-For an explanation of why (on Windows) the ``if __name__ == '__main__'`` part is
+For an explanation of why the ``if __name__ == '__main__'`` part is
 necessary, see :ref:`multiprocessing-programming`.
 
 
 
+Contexts and start methods
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. _multiprocessing-start-methods:
+
+Depending on the platform, :mod:`multiprocessing` supports three ways
+to start a process.  These *start methods* are
+
+  *spawn*
+    The parent process starts a fresh python interpreter process.  The
+    child process will only inherit those resources necessary to run
+    the process objects :meth:`~Process.run` method.  In particular,
+    unnecessary file descriptors and handles from the parent process
+    will not be inherited.  Starting a process using this method is
+    rather slow compared to using *fork* or *forkserver*.
+
+    Available on Unix and Windows.  The default on Windows.
+
+  *fork*
+    The parent process uses :func:`os.fork` to fork the Python
+    interpreter.  The child process, when it begins, is effectively
+    identical to the parent process.  All resources of the parent are
+    inherited by the child process.  Note that safely forking a
+    multithreaded process is problematic.
+
+    Available on Unix only.  The default on Unix.
+
+  *forkserver*
+    When the program starts and selects the *forkserver* start method,
+    a server process is started.  From then on, whenever a new process
+    is needed, the parent process connects to the server and requests
+    that it fork a new process.  The fork server process is single
+    threaded so it is safe for it to use :func:`os.fork`.  No
+    unnecessary resources are inherited.
+
+    Available on Unix platforms which support passing file descriptors
+    over Unix pipes.
+
+.. versionchanged:: 3.4
+   *spawn* added on all unix platforms, and *forkserver* added for
+   some unix platforms.
+   Child processes no longer inherit all of the parents inheritable
+   handles on Windows.
+
+On Unix using the *spawn* or *forkserver* start methods will also
+start a *semaphore tracker* process which tracks the unlinked named
+semaphores created by processes of the program.  When all processes
+have exited the semaphore tracker unlinks any remaining semaphores.
+Usually there should be none, but if a process was killed by a signal
+there may some "leaked" semaphores.  (Unlinking the named semaphores
+is a serious matter since the system allows only a limited number, and
+they will not be automatically unlinked until the next reboot.)
+
+To select a start method you use the :func:`set_start_method` in
+the ``if __name__ == '__main__'`` clause of the main module.  For
+example::
+
+       import multiprocessing as mp
+
+       def foo(q):
+           q.put('hello')
+
+       if __name__ == '__main__':
+           mp.set_start_method('spawn')
+           q = mp.Queue()
+           p = mp.Process(target=foo, args=(q,))
+           p.start()
+           print(q.get())
+           p.join()
+
+:func:`set_start_method` should not be used more than once in the
+program.
+
+Alternatively, you can use :func:`get_context` to obtain a context
+object.  Context objects have the same API as the multiprocessing
+module, and allow one to use multiple start methods in the same
+program. ::
+
+       import multiprocessing as mp
+
+       def foo(q):
+           q.put('hello')
+
+       if __name__ == '__main__':
+           ctx = mp.get_context('spawn')
+           q = ctx.Queue()
+           p = ctx.Process(target=foo, args=(q,))
+           p.start()
+           print(q.get())
+           p.join()
+
+Note that objects related to one context may not be compatible with
+processes for a different context.  In particular, locks created using
+the *fork* context cannot be passed to a processes started using the
+*spawn* or *forkserver* start methods.
+
+A library which wants to use a particular start method should probably
+use :func:`get_context` to avoid interfering with the choice of the
+library user.
+
+
 Exchanging objects between processes
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -161,8 +248,10 @@
 
    def f(l, i):
        l.acquire()
-       print('hello world', i)
-       l.release()
+       try:
+           print('hello world', i)
+       finally:
+           l.release()
 
    if __name__ == '__main__':
        lock = Lock()
@@ -173,6 +262,14 @@
 Without using the lock output from the different processes is liable to get all
 mixed up.
 
+.. note::
+
+   Some of this package's functionality requires a functioning shared semaphore
+   implementation on the host operating system. Without one, the
+   :mod:`multiprocessing.synchronize` module will be disabled, and attempts to
+   import it will result in an :exc:`ImportError`. See
+   :issue:`3770` for additional information.
+
 
 Sharing state between processes
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -274,19 +371,63 @@
 For example::
 
    from multiprocessing import Pool
+   from time import sleep
 
    def f(x):
        return x*x
 
    if __name__ == '__main__':
-       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]"
+       # start 4 worker processes
+       with Pool(processes=4) as pool:
+
+           # print "[0, 1, 4,..., 81]"
+           print(pool.map(f, range(10)))
+
+           # print same numbers in arbitrary order
+           for i in pool.imap_unordered(f, range(10)):
+               print(i)
+
+           # evaluate "f(10)" asynchronously
+           res = pool.apply_async(f, [10])
+           print(res.get(timeout=1))             # prints "100"
+
+           # make worker sleep for 10 secs
+           res = pool.apply_async(sleep, [10])
+           print(res.get(timeout=1))             # raises multiprocessing.TimeoutError
+
+       # exiting the 'with'-block has stopped the pool
 
 Note that the methods of a pool should only ever be used by the
 process which created it.
 
+.. note::
+
+   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.Pool` examples will not work in the
+   interactive interpreter. For example::
+
+      >>> from multiprocessing import Pool
+      >>> p = Pool(5)
+      >>> def f(x):
+      ...     return x*x
+      ...
+      >>> p.map(f, [1,2,3])
+      Process PoolWorker-1:
+      Process PoolWorker-2:
+      Process PoolWorker-3:
+      Traceback (most recent call last):
+      Traceback (most recent call last):
+      Traceback (most recent call last):
+      AttributeError: 'module' object has no attribute 'f'
+      AttributeError: 'module' object has no attribute 'f'
+      AttributeError: 'module' object has no attribute 'f'
+
+   (If you try this it will actually output three full tracebacks
+   interleaved in a semi-random fashion, and then you may have to
+   stop the master process somehow.)
+
 
 Reference
 ---------
@@ -723,7 +864,7 @@
 
    Return list of all live children of the current process.
 
-   Calling this has the side affect of "joining" any processes which have
+   Calling this has the side effect of "joining" any processes which have
    already finished.
 
 .. function:: cpu_count()
@@ -731,6 +872,9 @@
    Return the number of CPUs in the system.  May raise
    :exc:`NotImplementedError`.
 
+   .. seealso::
+      :func:`os.cpu_count`
+
 .. function:: current_process()
 
    Return the :class:`Process` object corresponding to the current process.
@@ -761,6 +905,43 @@
    If the module is being run normally by the Python interpreter then
    :func:`freeze_support` has no effect.
 
+.. function:: get_all_start_methods()
+
+   Returns a list of the supported start methods, the first of which
+   is the default.  The possible start methods are ``'fork'``,
+   ``'spawn'`` and ``'forkserver'``.  On Windows only ``'spawn'`` is
+   available.  On Unix ``'fork'`` and ``'spawn'`` are always
+   supported, with ``'fork'`` being the default.
+
+   .. versionadded:: 3.4
+
+.. function:: get_context(method=None)
+
+   Return a context object which has the same attributes as the
+   :mod:`multiprocessing` module.
+
+   If *method* is *None* then the default context is returned.
+   Otherwise *method* should be ``'fork'``, ``'spawn'``,
+   ``'forkserver'``.  :exc:`ValueError` is raised if the specified
+   start method is not available.
+
+   .. versionadded:: 3.4
+
+.. function:: get_start_method(allow_none=False)
+
+   Return the name of start method used for starting processes.
+
+   If the start method has not been fixed and *allow_none* is false,
+   then the start method is fixed to the default and the name is
+   returned.  If the start method has not been fixed and *allow_none*
+   is true then *None* is returned.
+
+   The return value can be ``'fork'``, ``'spawn'``, ``'forkserver'``
+   or *None*.  ``'fork'`` is the default on Unix, while ``'spawn'`` is
+   the default on Windows.
+
+   .. versionadded:: 3.4
+
 .. function:: set_executable()
 
    Sets the path of the Python interpreter to use when starting a child process.
@@ -769,8 +950,21 @@
 
       set_executable(os.path.join(sys.exec_prefix, 'pythonw.exe'))
 
-   before they can create child processes.  (Windows only)
+   before they can create child processes.
 
+   .. versionchanged:: 3.4
+      Now supported on Unix when the ``'spawn'`` start method is used.
+
+.. function:: set_start_method(method)
+
+   Set the method which should be used to start child processes.
+   *method* can be ``'fork'``, ``'spawn'`` or ``'forkserver'``.
+
+   Note that this should be called at most once, and it should be
+   protected inside the ``if __name__ == '__main__'`` clause of the
+   main module.
+
+   .. versionadded:: 3.4
 
 .. note::
 
@@ -874,7 +1068,7 @@
       using :meth:`Connection.send` and :meth:`Connection.recv`.
 
    .. versionadded:: 3.3
-      Connection objects now support the context manager protocol -- see
+      Connection objects now support the context management protocol -- see
       :ref:`typecontextmanager`.  :meth:`~contextmanager.__enter__` returns the
       connection object, and :meth:`~contextmanager.__exit__` calls :meth:`close`.
 
@@ -1331,7 +1525,7 @@
       The address used by the manager.
 
    .. versionchanged:: 3.3
-      Manager objects support the context manager protocol -- see
+      Manager objects support the context management protocol -- see
       :ref:`typecontextmanager`.  :meth:`~contextmanager.__enter__` starts the
       server process (if it has not already started) and then returns the
       manager object.  :meth:`~contextmanager.__exit__` calls :meth:`shutdown`.
@@ -1678,25 +1872,37 @@
 One can create a pool of processes which will carry out tasks submitted to it
 with the :class:`Pool` class.
 
-.. class:: Pool([processes[, initializer[, initargs[, maxtasksperchild]]]])
+.. class:: Pool([processes[, initializer[, initargs[, maxtasksperchild [, context]]]]])
 
    A process pool object which controls a pool of worker processes to which jobs
    can be submitted.  It supports asynchronous results with timeouts and
    callbacks and has a parallel map implementation.
 
    *processes* is the number of worker processes to use.  If *processes* is
-   ``None`` then the number returned by :func:`cpu_count` is used.  If
-   *initializer* is not ``None`` then each worker process will call
+   ``None`` then the number returned by :func:`os.cpu_count` is used.
+
+   If *initializer* is not ``None`` then each worker process will call
    ``initializer(*initargs)`` when it starts.
 
+   *maxtasksperchild* is the number of tasks a worker process can complete
+   before it will exit and be replaced with a fresh worker process, to enable
+   unused resources to be freed. The default *maxtasksperchild* is None, which
+   means worker processes will live as long as the pool.
+
+   *context* can be used to specify the context used for starting
+   the worker processes.  Usually a pool is created using the
+   function :func:`multiprocessing.Pool` or the :meth:`Pool` method
+   of a context object.  In both cases *context* is set
+   appropriately.
+
    Note that the methods of the pool object should only be called by
    the process which created the pool.
 
    .. versionadded:: 3.2
-      *maxtasksperchild* is the number of tasks a worker process can complete
-      before it will exit and be replaced with a fresh worker process, to enable
-      unused resources to be freed. The default *maxtasksperchild* is None, which
-      means worker processes will live as long as the pool.
+      *maxtasksperchild*
+
+   .. versionadded:: 3.4
+      *context*
 
    .. note::
 
@@ -1778,18 +1984,18 @@
 
    .. method:: starmap(func, iterable[, chunksize])
 
-      Like :meth:`map` except that the elements of the `iterable` are expected
+      Like :meth:`map` except that the elements of the *iterable* are expected
       to be iterables that are unpacked as arguments.
 
-      Hence an `iterable` of `[(1,2), (3, 4)]` results in `[func(1,2),
-      func(3,4)]`.
+      Hence an *iterable* of ``[(1,2), (3, 4)]`` results in ``[func(1,2),
+      func(3,4)]``.
 
       .. versionadded:: 3.3
 
    .. method:: starmap_async(func, iterable[, chunksize[, callback[, error_back]]])
 
       A combination of :meth:`starmap` and :meth:`map_async` that iterates over
-      `iterable` of iterables and calls `func` with the iterables unpacked.
+      *iterable* of iterables and calls *func* with the iterables unpacked.
       Returns a result object.
 
       .. versionadded:: 3.3
@@ -1811,7 +2017,7 @@
       :meth:`terminate` before using :meth:`join`.
 
    .. versionadded:: 3.3
-      Pool objects now support the context manager protocol -- see
+      Pool objects now support the context management protocol -- see
       :ref:`typecontextmanager`.  :meth:`~contextmanager.__enter__` returns the
       pool object, and :meth:`~contextmanager.__exit__` calls :meth:`terminate`.
 
@@ -1984,7 +2190,7 @@
       unavailable then it is ``None``.
 
    .. versionadded:: 3.3
-      Listener objects now support the context manager protocol -- see
+      Listener objects now support the context management protocol -- see
       :ref:`typecontextmanager`.  :meth:`~contextmanager.__enter__` returns the
       listener object, and :meth:`~contextmanager.__exit__` calls :meth:`close`.
 
@@ -2189,43 +2395,8 @@
     [INFO/MainProcess] sending shutdown message to manager
     [INFO/SyncManager-...] manager exiting with exitcode 0
 
-In addition to having these two logging functions, the multiprocessing also
-exposes two additional logging level attributes. These are  :const:`SUBWARNING`
-and :const:`SUBDEBUG`. The table below illustrates where theses fit in the
-normal level hierarchy.
-
-+----------------+----------------+
-| Level          | Numeric value  |
-+================+================+
-| ``SUBWARNING`` | 25             |
-+----------------+----------------+
-| ``SUBDEBUG``   | 5              |
-+----------------+----------------+
-
 For a full table of logging levels, see the :mod:`logging` module.
 
-These additional logging levels are used primarily for certain debug messages
-within the multiprocessing module. Below is the same example as above, except
-with :const:`SUBDEBUG` enabled::
-
-    >>> import multiprocessing, logging
-    >>> logger = multiprocessing.log_to_stderr()
-    >>> logger.setLevel(multiprocessing.SUBDEBUG)
-    >>> logger.warning('doomed')
-    [WARNING/MainProcess] doomed
-    >>> m = multiprocessing.Manager()
-    [INFO/SyncManager-...] child process calling self.run()
-    [INFO/SyncManager-...] created temp directory /.../pymp-...
-    [INFO/SyncManager-...] manager serving at '/.../pymp-djGBXN/listener-...'
-    >>> del m
-    [SUBDEBUG/MainProcess] finalizer calling ...
-    [INFO/MainProcess] sending shutdown message to manager
-    [DEBUG/SyncManager-...] manager received shutdown message
-    [SUBDEBUG/SyncManager-...] calling <Finalize object, callback=unlink, ...
-    [SUBDEBUG/SyncManager-...] finalizer calling <built-in function unlink> ...
-    [SUBDEBUG/SyncManager-...] calling <Finalize object, dead>
-    [SUBDEBUG/SyncManager-...] finalizer calling <function rmtree at 0x5aa730> ...
-    [INFO/SyncManager-...] manager exiting with exitcode 0
 
 The :mod:`multiprocessing.dummy` module
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -2246,8 +2417,10 @@
 :mod:`multiprocessing`.
 
 
-All platforms
-~~~~~~~~~~~~~
+All start methods
+~~~~~~~~~~~~~~~~~
+
+The following applies to all start methods.
 
 Avoid shared state
 
@@ -2281,11 +2454,13 @@
 
 Better to inherit than pickle/unpickle
 
-    On Windows many types from :mod:`multiprocessing` need to be picklable so
-    that child processes can use them.  However, one should generally avoid
-    sending shared objects to other processes using pipes or queues.  Instead
-    you should arrange the program so that a process which needs access to a
-    shared resource created elsewhere can inherit it from an ancestor process.
+    When using the *spawn* or *forkserver* start methods many types
+    from :mod:`multiprocessing` need to be picklable so that child
+    processes can use them.  However, one should generally avoid
+    sending shared objects to other processes using pipes or queues.
+    Instead you should arrange the program so that a process which
+    needs access to a shared resource created elsewhere can inherit it
+    from an ancestor process.
 
 Avoid terminating processes
 
@@ -2311,7 +2486,7 @@
     items which have been put on the queue will eventually be removed before the
     process is joined.  Otherwise you cannot be sure that processes which have
     put items on the queue will terminate.  Remember also that non-daemonic
-    processes will be automatically be joined.
+    processes will be joined automatically.
 
     An example which will deadlock is the following::
 
@@ -2327,20 +2502,22 @@
             p.join()                    # this deadlocks
             obj = queue.get()
 
-    A fix here would be to swap the last two lines round (or simply remove the
+    A fix here would be to swap the last two lines (or simply remove the
     ``p.join()`` line).
 
 Explicitly pass resources to child processes
 
-    On Unix a child process can make use of a shared resource created in a
-    parent process using a global resource.  However, it is better to pass the
-    object as an argument to the constructor for the child process.
+    On Unix using the *fork* start method, a child process can make
+    use of a shared resource created in a parent process using a
+    global resource.  However, it is better to pass the object as an
+    argument to the constructor for the child process.
 
-    Apart from making the code (potentially) compatible with Windows this also
-    ensures that as long as the child process is still alive the object will not
-    be garbage collected in the parent process.  This might be important if some
-    resource is freed when the object is garbage collected in the parent
-    process.
+    Apart from making the code (potentially) compatible with Windows
+    and the other start methods this also ensures that as long as the
+    child process is still alive the object will not be garbage
+    collected in the parent process.  This might be important if some
+    resource is freed when the object is garbage collected in the
+    parent process.
 
     So for instance ::
 
@@ -2399,17 +2576,19 @@
 
     For more information, see :issue:`5155`, :issue:`5313` and :issue:`5331`
 
-Windows
-~~~~~~~
+The *spawn* and *forkserver* start methods
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-Since Windows lacks :func:`os.fork` it has a few extra restrictions:
+There are a few extra restriction which don't apply to the *fork*
+start method.
 
 More picklability
 
-    Ensure that all arguments to :meth:`Process.__init__` are picklable.  This
-    means, in particular, that bound or unbound methods cannot be used directly
-    as the ``target`` argument on Windows --- just define a function and use
-    that instead.
+    Ensure that all arguments to :meth:`Process.__init__` are
+    picklable.  This means, in particular, that bound or unbound
+    methods cannot be used directly as the ``target`` (unless you use
+    the *fork* start method) --- just define a function and use that
+    instead.
 
     Also, if you subclass :class:`~multiprocessing.Process` then make sure that
     instances will be picklable when the :meth:`Process.start
@@ -2431,7 +2610,8 @@
     interpreter without causing unintended side effects (such a starting a new
     process).
 
-    For example, under Windows running the following module would fail with a
+    For example, using the *spawn* or *forkserver* start method
+    running the following module would fail with a
     :exc:`RuntimeError`::
 
         from multiprocessing import Process
@@ -2445,13 +2625,14 @@
     Instead one should protect the "entry point" of the program by using ``if
     __name__ == '__main__':`` as follows::
 
-       from multiprocessing import Process, freeze_support
+       from multiprocessing import Process, freeze_support, set_start_method
 
        def foo():
            print('hello')
 
        if __name__ == '__main__':
            freeze_support()
+           set_start_method('spawn')
            p = Process(target=foo)
            p.start()
 
@@ -2482,26 +2663,7 @@
    :language: python3
 
 
-Synchronization types like locks, conditions and queues:
-
-.. literalinclude:: ../includes/mp_synchronize.py
-   :language: python3
-
-
 An example showing how to use queues to feed tasks to a collection of worker
 processes and collect the results:
 
 .. literalinclude:: ../includes/mp_workers.py
-
-
-An example of how a pool of worker processes can each run a
-:class:`~http.server.SimpleHTTPRequestHandler` instance while sharing a single
-listening socket.
-
-.. literalinclude:: ../includes/mp_webserver.py
-
-
-Some simple benchmarks comparing :mod:`multiprocessing` with :mod:`threading`:
-
-.. literalinclude:: ../includes/mp_benchmarks.py
-
diff --git a/Doc/library/netrc.rst b/Doc/library/netrc.rst
index 564f101..23ffed6 100644
--- a/Doc/library/netrc.rst
+++ b/Doc/library/netrc.rst
@@ -29,7 +29,7 @@
    This implements security behavior equivalent to that of ftp and other
    programs that use :file:`.netrc`.
 
-   .. versionchanged:: 3.3.3 Added the POSIX permission check.
+   .. versionchanged:: 3.4 Added the POSIX permission check.
 
 
 .. exception:: NetrcParseError
diff --git a/Doc/library/nntplib.rst b/Doc/library/nntplib.rst
index a15d7f7..3943f2c 100644
--- a/Doc/library/nntplib.rst
+++ b/Doc/library/nntplib.rst
@@ -1,4 +1,3 @@
-
 :mod:`nntplib` --- NNTP protocol client
 =======================================
 
@@ -71,7 +70,7 @@
    reader-specific commands, such as ``group``.  If you get unexpected
    :exc:`NNTPPermanentError`\ s, you might need to set *readermode*.
    :class:`NNTP` class supports the :keyword:`with` statement to
-   unconditionally consume :exc:`socket.error` exceptions and to close the NNTP
+   unconditionally consume :exc:`OSError` exceptions and to close the NNTP
    connection when done. Here is a sample on how using it:
 
     >>> from nntplib import NNTP
@@ -95,6 +94,7 @@
    port *port*.  :class:`NNTP_SSL` objects have the same methods as
    :class:`NNTP` objects.  If *port* is omitted, port 563 (NNTPS) is used.
    *ssl_context* is also optional, and is a :class:`~ssl.SSLContext` object.
+   Please read :ref:`ssl-security` for best practices.
    All other parameters behave the same as for :class:`NNTP`.
 
    Note that SSL-on-563 is discouraged per :rfc:`4642`, in favor of
@@ -103,6 +103,10 @@
 
    .. versionadded:: 3.2
 
+   .. versionchanged:: 3.4
+      The class now supports hostname check with
+      :attr:`ssl.SSLContext.check_hostname` and *Server Name Indication* (see
+      :data:`ssl.HAS_SNI`).
 
 .. exception:: NNTPError
 
@@ -231,9 +235,10 @@
 
 .. method:: NNTP.starttls(ssl_context=None)
 
-   Send a ``STARTTLS`` command.  The *ssl_context* argument is optional
-   and should be a :class:`ssl.SSLContext` object.  This will enable
-   encryption on the NNTP connection.
+   Send a ``STARTTLS`` command.  This will enable encryption on the NNTP
+   connection.  The *ssl_context* argument is optional and should be a
+   :class:`ssl.SSLContext` object.  Please read :ref:`ssl-security` for best
+   practices.
 
    Note that this may not be done after authentication information has
    been transmitted, and authentication occurs by default if possible during a
@@ -242,6 +247,10 @@
 
    .. versionadded:: 3.2
 
+   .. versionchanged:: 3.4
+      The method now supports hostname check with
+      :attr:`ssl.SSLContext.check_hostname` and *Server Name Indication* (see
+      :data:`ssl.HAS_SNI`).
 
 .. method:: NNTP.newgroups(date, *, file=None)
 
diff --git a/Doc/library/numbers.rst b/Doc/library/numbers.rst
index fec04ed..8ab07d0 100644
--- a/Doc/library/numbers.rst
+++ b/Doc/library/numbers.rst
@@ -110,6 +110,8 @@
     MyFoo.register(Real)
 
 
+.. _implementing-the-arithmetic-operations:
+
 Implementing the arithmetic operations
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
diff --git a/Doc/library/numeric.rst b/Doc/library/numeric.rst
index 2732a84..7c76a47 100644
--- a/Doc/library/numeric.rst
+++ b/Doc/library/numeric.rst
@@ -23,3 +23,4 @@
    decimal.rst
    fractions.rst
    random.rst
+   statistics.rst
diff --git a/Doc/library/operator.rst b/Doc/library/operator.rst
index 24becf9..f9e2a3d 100644
--- a/Doc/library/operator.rst
+++ b/Doc/library/operator.rst
@@ -11,6 +11,9 @@
    import operator
    from operator import itemgetter, iadd
 
+**Source code:** :source:`Lib/operator.py`
+
+--------------
 
 The :mod:`operator` module exports a set of efficient functions corresponding to
 the intrinsic operators of Python.  For example, ``operator.add(x, y)`` is
@@ -225,15 +228,14 @@
 
    Set the value of *a* at index *b* to *c*.
 
-Example: Build a dictionary that maps the ordinals from ``0`` to ``255`` to
-their character equivalents.
 
-   >>> d = {}
-   >>> keys = range(256)
-   >>> vals = map(chr, keys)
-   >>> map(operator.setitem, [d]*len(keys), keys, vals)   # doctest: +SKIP
+.. function:: length_hint(obj, default=0)
 
-.. XXX: find a better, readable, example
+   Return an estimated length for the object *o*. First try to return its
+   actual length, then an estimate using :meth:`object.__length_hint__`, and
+   finally return the default value.
+
+   .. versionadded:: 3.4
 
 The :mod:`operator` module also defines tools for generalized attribute and item
 lookups.  These are useful for making fast field extractors as arguments for
diff --git a/Doc/library/optparse.rst b/Doc/library/optparse.rst
index 13395b6..72145aa 100644
--- a/Doc/library/optparse.rst
+++ b/Doc/library/optparse.rst
@@ -8,8 +8,8 @@
 .. sectionauthor:: Greg Ward <gward@python.net>
 
 .. deprecated:: 3.2
-  The :mod:`optparse` module is deprecated and will not be developed further;
-  development will continue with the :mod:`argparse` module.
+   The :mod:`optparse` module is deprecated and will not be developed further;
+   development will continue with the :mod:`argparse` module.
 
 **Source code:** :source:`Lib/optparse.py`
 
diff --git a/Doc/library/os.path.rst b/Doc/library/os.path.rst
index 57a6bca..92631b2 100644
--- a/Doc/library/os.path.rst
+++ b/Doc/library/os.path.rst
@@ -22,6 +22,11 @@
 explicitly when an application desires shell-like path expansion.  (See also
 the :mod:`glob` module.)
 
+
+.. seealso::
+   The :mod:`pathlib` module offers high-level path objects.
+
+
 .. note::
 
    All of these functions accept either only bytes or only string objects as
@@ -42,7 +47,6 @@
    * :mod:`posixpath` for UNIX-style paths
    * :mod:`ntpath` for Windows paths
    * :mod:`macpath` for old-style MacOS paths
-   * :mod:`os2emxpath` for OS/2 EMX paths
 
 
 .. function:: abspath(path)
@@ -184,29 +188,40 @@
 .. function:: islink(path)
 
    Return ``True`` if *path* refers to a directory entry that is a symbolic link.
-   Always ``False`` if symbolic links are not supported.
+   Always ``False`` if symbolic links are not supported by the python runtime.
 
 
 .. function:: ismount(path)
 
-   Return ``True`` if pathname *path* is a :dfn:`mount point`: a point in a file
-   system where a different file system has been mounted.  The function checks
-   whether *path*'s parent, :file:`path/..`, is on a different device than *path*,
-   or whether :file:`path/..` and *path* point to the same i-node on the same
-   device --- this should detect mount points for all Unix and POSIX variants.
+   Return ``True`` if pathname *path* is a :dfn:`mount point`: a point in a
+   file system where a different file system has been mounted.  On POSIX, the
+   function checks whether *path*'s parent, :file:`path/..`, is on a different
+   device than *path*, or whether :file:`path/..` and *path* point to the same
+   i-node on the same device --- this should detect mount points for all Unix
+   and POSIX variants.  On Windows, a drive letter root and a share UNC are
+   always mount points, and for any other path ``GetVolumePathName`` is called
+   to see if it is different from the input path.
+
+   .. versionadded:: 3.4
+      Support for detecting non-root mount points on Windows.
 
 
-.. function:: join(path1[, path2[, ...]])
+.. function:: join(path, *paths)
 
-   Join one or more path components intelligently.  If any component is an absolute
-   path, all previous components (on Windows, including the previous drive letter,
-   if there was one) are thrown away, and joining continues.  The return value is
-   the concatenation of *path1*, and optionally *path2*, etc., with exactly one
-   directory separator (``os.sep``) following each non-empty part except the last.
-   (This means that an empty last part will result in a path that ends with a
-   separator.)  Note that on Windows, since there is a current directory for
-   each drive, ``os.path.join("c:", "foo")`` represents a path relative to the
-   current directory on drive :file:`C:` (:file:`c:foo`), not :file:`c:\\foo`.
+   Join one or more path components intelligently.  The return value is the
+   concatenation of *path* and any members of *\*paths* with exactly one
+   directory separator (``os.sep``) following each non-empty part except the
+   last, meaning that the result will only end in a separator if the last
+   part is empty.  If a component is an absolute path, all previous
+   components are thrown away and joining continues from the absolute path
+   component.
+
+   On Windows, the drive letter is not reset when an absolute path component
+   (e.g., ``r'\foo'``) is encountered.  If a component contains a drive
+   letter, all previous components are thrown away and the drive letter is
+   reset.  Note that since there is a current directory for each drive,
+   ``os.path.join("c:", "foo")`` represents a path relative to the current
+   directory on drive :file:`C:` (:file:`c:foo`), not :file:`c:\\foo`.
 
 
 .. function:: normcase(path)
@@ -232,7 +247,7 @@
    links encountered in the path (if they are supported by the operating system).
 
 
-.. function:: relpath(path, start=None)
+.. function:: relpath(path, start=os.curdir)
 
    Return a relative filepath to *path* either from the current directory or
    from an optional *start* directory.  This is a path computation:  the
@@ -247,18 +262,17 @@
 .. function:: samefile(path1, path2)
 
    Return ``True`` if both pathname arguments refer to the same file or directory.
-   On Unix, this is determined by the device number and i-node number and raises an
+   This is determined by the device number and i-node number and raises an
    exception if a :func:`os.stat` call on either pathname fails.
 
-   On Windows, two files are the same if they resolve to the same final path
-   name using the Windows API call GetFinalPathNameByHandle. This function
-   raises an exception if handles cannot be obtained to either file.
-
    Availability: Unix, Windows.
 
    .. versionchanged:: 3.2
       Added Windows support.
 
+   .. versionchanged:: 3.4
+      Windows now uses the same implementation as all other platforms.
+
 
 .. function:: sameopenfile(fp1, fp2)
 
@@ -277,7 +291,10 @@
    :func:`os.lstat`, or :func:`os.stat`.  This function implements the
    underlying comparison used by :func:`samefile` and :func:`sameopenfile`.
 
-   Availability: Unix.
+   Availability: Unix, Windows.
+
+   .. versionchanged:: 3.4
+      Added Windows support.
 
 
 .. function:: split(path)
diff --git a/Doc/library/os.rst b/Doc/library/os.rst
index d7b9829..f217a36 100644
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -53,8 +53,8 @@
 .. data:: name
 
    The name of the operating system dependent module imported.  The following
-   names have currently been registered: ``'posix'``, ``'nt'``, ``'mac'``,
-   ``'os2'``, ``'ce'``, ``'java'``.
+   names have currently been registered: ``'posix'``, ``'nt'``,
+   ``'ce'``, ``'java'``.
 
    .. seealso::
       :attr:`sys.platform` has a finer granularity.  :func:`os.uname` gives
@@ -65,6 +65,7 @@
 
 
 .. _os-filenames:
+.. _filesystem-encoding:
 
 File Names, Command Line Arguments, and Environment Variables
 -------------------------------------------------------------
@@ -280,10 +281,10 @@
 .. function:: getlogin()
 
    Return the name of the user logged in on the controlling terminal of the
-   process.  For most purposes, it is more useful to use the environment variables
-   :envvar:`LOGNAME` or :envvar:`USERNAME` to find out who the user is, or
-   ``pwd.getpwuid(os.getuid())[0]`` to get the login name of the currently
-   effective user id.
+   process.  For most purposes, it is more useful to use the environment
+   variables :envvar:`LOGNAME` or :envvar:`USERNAME` to find out who the user
+   is, or ``pwd.getpwuid(os.getuid())[0]`` to get the login name of the current
+   real user id.
 
    Availability: Unix, Windows.
 
@@ -379,7 +380,7 @@
 
    .. index:: single: user; id
 
-   Return the current process's user id.
+   Return the current process's real user id.
 
    Availability: Unix.
 
@@ -687,17 +688,30 @@
 
 .. function:: dup(fd)
 
-   Return a duplicate of file descriptor *fd*.
+   Return a duplicate of file descriptor *fd*. The new file descriptor is
+   :ref:`non-inheritable <fd_inheritance>`.
+
+   On Windows, when duplicating a standard stream (0: stdin, 1: stdout,
+   2: stderr), the new file descriptor is :ref:`inheritable
+   <fd_inheritance>`.
 
    Availability: Unix, Windows.
 
+   .. versionchanged:: 3.4
+      The new file descriptor is now non-inheritable.
 
-.. function:: dup2(fd, fd2)
+
+.. function:: dup2(fd, fd2, inheritable=True)
 
    Duplicate file descriptor *fd* to *fd2*, closing the latter first if necessary.
+   The file descriptor *fd2* is :ref:`inheritable <fd_inheritance>` by default,
+   or non-inheritable if *inheritable* is ``False``.
 
    Availability: Unix, Windows.
 
+   .. versionchanged:: 3.4
+      Add the optional *inheritable* parameter.
+
 
 .. function:: fchmod(fd, mode)
 
@@ -751,8 +765,14 @@
 
 .. function:: fstat(fd)
 
-   Return status for file descriptor *fd*, like :func:`~os.stat`.  As of Python
-   3.3, this is equivalent to ``os.stat(fd)``.
+   Get the status of the file descriptor *fd*. Return a :class:`stat_result`
+   object.
+
+   As of Python 3.3, this is equivalent to ``os.stat(fd)``.
+
+   .. seealso::
+
+      The :func:`stat` function.
 
    Availability: Unix, Windows.
 
@@ -848,17 +868,21 @@
    Open the file *file* and set various flags according to *flags* and possibly
    its mode according to *mode*.  When computing *mode*, the current umask value
    is first masked out.  Return the file descriptor for the newly opened file.
+   The new file descriptor is :ref:`non-inheritable <fd_inheritance>`.
 
    For a description of the flag and mode values, see the C run-time documentation;
    flag constants (like :const:`O_RDONLY` and :const:`O_WRONLY`) are defined in
-   this module too (see :ref:`open-constants`).  In particular, on Windows adding
+   the :mod:`os` module.  In particular, on Windows adding
    :const:`O_BINARY` is needed to open files in binary mode.
 
    This function can support :ref:`paths relative to directory descriptors
-   <dir_fd>`.
+   <dir_fd>` with the *dir_fd* parameter.
 
    Availability: Unix, Windows.
 
+   .. versionchanged:: 3.4
+      The new file descriptor is now non-inheritable.
+
    .. note::
 
       This function is intended for low-level I/O.  For normal usage, use the
@@ -869,25 +893,93 @@
    .. versionadded:: 3.3
       The *dir_fd* argument.
 
+The following constants are options for the *flags* parameter to the
+:func:`~os.open` function.  They can be combined using the bitwise OR operator
+``|``.  Some of them are not available on all platforms.  For descriptions of
+their availability and use, consult the :manpage:`open(2)` manual page on Unix
+or `the MSDN <http://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx>`_ on Windows.
+
+
+.. data:: O_RDONLY
+          O_WRONLY
+          O_RDWR
+          O_APPEND
+          O_CREAT
+          O_EXCL
+          O_TRUNC
+
+   These constants are available on Unix and Windows.
+
+
+.. data:: O_DSYNC
+          O_RSYNC
+          O_SYNC
+          O_NDELAY
+          O_NONBLOCK
+          O_NOCTTY
+          O_SHLOCK
+          O_EXLOCK
+          O_CLOEXEC
+
+   These constants are only available on Unix.
+
+   .. versionchanged:: 3.3
+      Add :data:`O_CLOEXEC` constant.
+
+.. data:: O_BINARY
+          O_NOINHERIT
+          O_SHORT_LIVED
+          O_TEMPORARY
+          O_RANDOM
+          O_SEQUENTIAL
+          O_TEXT
+
+   These constants are only available on Windows.
+
+
+.. data:: O_ASYNC
+          O_DIRECT
+          O_DIRECTORY
+          O_NOFOLLOW
+          O_NOATIME
+          O_PATH
+          O_TMPFILE
+
+   These constants are GNU extensions and not present if they are not defined by
+   the C library.
+
+   .. versionchanged:: 3.4
+      Add :data:`O_PATH` on systems that support it.
+      Add :data:`O_TMPFILE`, only available on Linux Kernel 3.11
+        or newer.
+
 
 .. function:: openpty()
 
    .. index:: module: pty
 
-   Open a new pseudo-terminal pair. Return a pair of file descriptors ``(master,
-   slave)`` for the pty and the tty, respectively. For a (slightly) more portable
-   approach, use the :mod:`pty` module.
+   Open a new pseudo-terminal pair. Return a pair of file descriptors
+   ``(master, slave)`` for the pty and the tty, respectively. The new file
+   descriptors are :ref:`non-inheritable <fd_inheritance>`. For a (slightly) more
+   portable approach, use the :mod:`pty` module.
 
    Availability: some flavors of Unix.
 
+   .. versionchanged:: 3.4
+      The new file descriptors are now non-inheritable.
+
 
 .. function:: pipe()
 
-   Create a pipe.  Return a pair of file descriptors ``(r, w)`` usable for reading
-   and writing, respectively.
+   Create a pipe.  Return a pair of file descriptors ``(r, w)`` usable for
+   reading and writing, respectively. The new file descriptor is
+   :ref:`non-inheritable <fd_inheritance>`.
 
    Availability: Unix, Windows.
 
+   .. versionchanged:: 3.4
+      The new file descriptors are now non-inheritable.
+
 
 .. function:: pipe2(flags)
 
@@ -952,10 +1044,10 @@
    .. versionadded:: 3.3
 
 
-.. function:: pwrite(fd, string, offset)
+.. function:: pwrite(fd, str, offset)
 
-   Write *string* to a file descriptor, *fd*, from *offset*, leaving the file
-   offset unchanged.
+   Write *bytestring* to a file descriptor, *fd*, from *offset*,
+   leaving the file offset unchanged.
 
    Availability: Unix.
 
@@ -1002,8 +1094,16 @@
    All platforms support sockets as *out* file descriptor, and some platforms
    allow other types (e.g. regular file, pipe) as well.
 
+   Cross-platform applications should not use *headers*, *trailers* and *flags*
+   arguments.
+
    Availability: Unix.
 
+   .. note::
+
+      For a higher-level wrapper of :func:`sendfile`, see
+      :mod:`socket.socket.sendfile`.
+
    .. versionadded:: 3.3
 
 
@@ -1027,7 +1127,7 @@
    sequence to hold the rest of the data. :func:`~os.readv` returns the total
    number of bytes read (which may be less than the total capacity of all the
    objects).
-          
+
    Availability: Unix.
 
    .. versionadded:: 3.3
@@ -1080,84 +1180,12 @@
    sequence of :term:`bytes-like objects <bytes-like object>`.
    :func:`~os.writev` writes the contents of each object to the file descriptor
    and returns the total number of bytes written.
-   
+
    Availability: Unix.
 
    .. versionadded:: 3.3
 
 
-.. _open-constants:
-
-``open()`` flag constants
-~~~~~~~~~~~~~~~~~~~~~~~~~
-
-The following constants are options for the *flags* parameter to the
-:func:`~os.open` function.  They can be combined using the bitwise OR operator
-``|``.  Some of them are not available on all platforms.  For descriptions of
-their availability and use, consult the :manpage:`open(2)` manual page on Unix
-or `the MSDN <http://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx>`_ on Windows.
-
-
-.. data:: O_RDONLY
-          O_WRONLY
-          O_RDWR
-          O_APPEND
-          O_CREAT
-          O_EXCL
-          O_TRUNC
-
-   These constants are available on Unix and Windows.
-
-
-.. data:: O_DSYNC
-          O_RSYNC
-          O_SYNC
-          O_NDELAY
-          O_NONBLOCK
-          O_NOCTTY
-          O_SHLOCK
-          O_EXLOCK
-          O_CLOEXEC
-
-   These constants are only available on Unix.
-
-   .. versionchanged:: 3.3
-      Add :data:`O_CLOEXEC` constant.
-
-.. data:: O_BINARY
-          O_NOINHERIT
-          O_SHORT_LIVED
-          O_TEMPORARY
-          O_RANDOM
-          O_SEQUENTIAL
-          O_TEXT
-
-   These constants are only available on Windows.
-
-
-.. data:: O_ASYNC
-          O_DIRECT
-          O_DIRECTORY
-          O_NOFOLLOW
-          O_NOATIME
-
-   These constants are GNU extensions and not present if they are not defined by
-   the C library.
-
-
-.. data:: RTLD_LAZY
-          RTLD_NOW
-          RTLD_GLOBAL
-          RTLD_LOCAL
-          RTLD_NODELETE
-          RTLD_NOLOAD
-          RTLD_DEEPBIND
-
-   See the Unix manual page :manpage:`dlopen(3)`.
-
-   .. versionadded:: 3.3
-
-
 .. _terminal-size:
 
 Querying the size of a terminal
@@ -1195,6 +1223,49 @@
       Height of the terminal window in characters.
 
 
+.. _fd_inheritance:
+
+Inheritance of File Descriptors
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. versionadded:: 3.4
+
+A file descriptor has an "inheritable" flag which indicates if the file descriptor
+can be inherited by child processes.  Since Python 3.4, file descriptors
+created by Python are non-inheritable by default.
+
+On UNIX, non-inheritable file descriptors are closed in child processes at the
+execution of a new program, other file descriptors are inherited.
+
+On Windows, non-inheritable handles and file descriptors are closed in child
+processes, except for standard streams (file descriptors 0, 1 and 2: stdin, stdout
+and stderr), which are always inherited.  Using :func:`spawn\* <spawnl>` functions,
+all inheritable handles and all inheritable file descriptors are inherited.
+Using the :mod:`subprocess` module, all file descriptors except standard
+streams are closed, and inheritable handles are only inherited if the
+*close_fds* parameter is ``False``.
+
+.. function:: get_inheritable(fd)
+
+   Get the "inheritable" flag of the specified file descriptor (a boolean).
+
+.. function:: set_inheritable(fd, inheritable)
+
+   Set the "inheritable" flag of the specified file descriptor.
+
+.. function:: get_handle_inheritable(handle)
+
+   Get the "inheritable" flag of the specified handle (a boolean).
+
+   Availability: Windows.
+
+.. function:: set_handle_inheritable(handle, inheritable)
+
+   Set the "inheritable" flag of the specified handle.
+
+   Availability: Windows.
+
+
 .. _os-file-dir:
 
 Files and Directories
@@ -1513,17 +1584,25 @@
       Added support for specifying an open file descriptor for *path*.
 
 
-.. function:: lstat(path, *, dir_fd=None)
+.. function:: lstat(path, \*, dir_fd=None)
 
    Perform the equivalent of an :c:func:`lstat` system call on the given path.
-   Similar to :func:`~os.stat`, but does not follow symbolic links.  On
-   platforms that do not support symbolic links, this is an alias for
-   :func:`~os.stat`.  As of Python 3.3, this is equivalent to ``os.stat(path,
-   dir_fd=dir_fd, follow_symlinks=False)``.
+   Similar to :func:`~os.stat`, but does not follow symbolic links. Return a
+   :class:`stat_result` object.
+
+   On platforms that do not support symbolic links, this is an alias for
+   :func:`~os.stat`.
+
+   As of Python 3.3, this is equivalent to ``os.stat(path, dir_fd=dir_fd,
+   follow_symlinks=False)``.
 
    This function can also support :ref:`paths relative to directory descriptors
    <dir_fd>`.
 
+   .. seealso::
+
+      The :func:`stat` function.
+
    .. versionchanged:: 3.2
       Added support for Windows 6.0 (Vista) symbolic links.
 
@@ -1551,7 +1630,7 @@
       The *dir_fd* argument.
 
 
-.. function:: makedirs(path, mode=0o777, exist_ok=False)
+.. function:: makedirs(name, mode=0o777, exist_ok=False)
 
    .. index::
       single: directory; creating
@@ -1576,12 +1655,12 @@
    .. versionadded:: 3.2
       The *exist_ok* parameter.
 
-   .. versionchanged:: 3.3.6
+   .. versionchanged:: 3.4.1
 
-      Before Python 3.3.6, if *exist_ok* was ``True`` and the directory existed,
+      Before Python 3.4.1, if *exist_ok* was ``True`` and the directory existed,
       :func:`makedirs` would still raise an error if *mode* did not match the
       mode of the existing directory. Since this behavior was impossible to
-      implement safely, it was removed in Python 3.3.6. See :issue:`21082`.
+      implement safely, it was removed in Python 3.4.1. See :issue:`21082`.
 
 
 .. function:: mkfifo(path, mode=0o666, *, dir_fd=None)
@@ -1711,7 +1790,7 @@
       The *dir_fd* argument.
 
 
-.. function:: removedirs(path)
+.. function:: removedirs(name)
 
    .. index:: single: directory; deleting
 
@@ -1790,55 +1869,116 @@
       The *dir_fd* parameter.
 
 
-.. function:: stat(path, *, dir_fd=None, follow_symlinks=True)
+.. function:: stat(path, \*, dir_fd=None, follow_symlinks=True)
 
-   Perform the equivalent of a :c:func:`stat` system call on the given path.
-   *path* may be specified as either a string or as an open file descriptor.
-   (This function normally follows symlinks; to stat a symlink add the argument
-   ``follow_symlinks=False``, or use :func:`lstat`.)
+   Get the status of a file or a file descriptor. Perform the equivalent of a
+   :c:func:`stat` system call on the given path. *path* may be specified as
+   either a string or as an open file descriptor. Return a :class:`stat_result`
+   object.
 
-   The return value is an object whose attributes correspond roughly
-   to the members of the :c:type:`stat` structure, namely:
+   This function normally follows symlinks; to stat a symlink add the argument
+   ``follow_symlinks=False``, or use :func:`lstat`.
 
-   * :attr:`st_mode` - protection bits,
-   * :attr:`st_ino` - inode number,
-   * :attr:`st_dev` - device,
-   * :attr:`st_nlink` - number of hard links,
-   * :attr:`st_uid` - user id of owner,
-   * :attr:`st_gid` - group id of owner,
-   * :attr:`st_size` - size of file, in bytes,
-   * :attr:`st_atime` - time of most recent access expressed in seconds,
-   * :attr:`st_mtime` - time of most recent content modification
-     expressed in seconds,
-   * :attr:`st_ctime` - platform dependent; time of most recent metadata
-     change on Unix, or the time of creation on Windows, expressed in seconds
-   * :attr:`st_atime_ns` - time of most recent access
-     expressed in nanoseconds as an integer,
-   * :attr:`st_mtime_ns` - time of most recent content modification
-     expressed in nanoseconds as an integer,
-   * :attr:`st_ctime_ns` - platform dependent; time of most recent metadata
-     change on Unix, or the time of creation on Windows,
-     expressed in nanoseconds as an integer
+   This function can support :ref:`specifying a file descriptor <path_fd>` and
+   :ref:`not following symlinks <follow_symlinks>`.
 
-   On some Unix systems (such as Linux), the following attributes may also be
-   available:
+   .. index:: module: stat
 
-   * :attr:`st_blocks` - number of 512-byte blocks allocated for file
-   * :attr:`st_blksize` - filesystem blocksize for efficient file system I/O
-   * :attr:`st_rdev` - type of device if an inode device
-   * :attr:`st_flags` - user defined flags for file
+   Example::
 
-   On other Unix systems (such as FreeBSD), the following attributes may be
-   available (but may be only filled out if root tries to use them):
+      >>> import os
+      >>> statinfo = os.stat('somefile.txt')
+      >>> statinfo
+      os.stat_result(st_mode=33188, st_ino=7876932, st_dev=234881026,
+      st_nlink=1, st_uid=501, st_gid=501, st_size=264, st_atime=1297230295,
+      st_mtime=1297230027, st_ctime=1297230027)
+      >>> statinfo.st_size
+      264
 
-   * :attr:`st_gen` - file generation number
-   * :attr:`st_birthtime` - time of file creation
+   Availability: Unix, Windows.
 
-   On Mac OS systems, the following attributes may also be available:
+   .. seealso::
 
-   * :attr:`st_rsize`
-   * :attr:`st_creator`
-   * :attr:`st_type`
+      :func:`fstat` and :func:`lstat` functions.
+
+   .. versionadded:: 3.3
+      Added the *dir_fd* and *follow_symlinks* arguments, specifying a file
+      descriptor instead of a path.
+
+
+.. class:: stat_result
+
+   Object whose attributes correspond roughly to the members of the
+   :c:type:`stat` structure. It is used for the result of :func:`os.stat`,
+   :func:`os.fstat` and :func:`os.lstat`.
+
+   Attributes:
+
+   .. attribute:: st_mode
+
+      File mode: file type and file mode bits (permissions).
+
+   .. attribute:: st_ino
+
+      Inode number.
+
+   .. attribute:: st_dev
+
+      Identifier of the device on which this file resides.
+
+   .. attribute:: st_nlink
+
+      Number of hard links.
+
+   .. attribute:: st_uid
+
+      User identifier of the file owner.
+
+   .. attribute:: st_gid
+
+      Group identifier of the file owner.
+
+   .. attribute:: st_size
+
+      Size of the file in bytes, if it is a regular file or a symbolic link.
+      The size of a symbolic link is the length of the pathname it contains,
+      without a terminating null byte.
+
+   Timestamps:
+
+   .. attribute:: st_atime
+
+      Time of most recent access expressed in seconds.
+
+   .. attribute:: st_mtime
+
+      Time of most recent content modification expressed in seconds.
+
+   .. attribute:: st_ctime
+
+      Platform dependent:
+
+      * the time of most recent metadata change on Unix,
+      * the time of creation on Windows, expressed in seconds.
+
+   .. attribute:: st_atime_ns
+
+      Time of most recent access expressed in nanoseconds as an integer.
+
+   .. attribute:: st_mtime_ns
+
+      Time of most recent content modification expressed in nanoseconds as an
+      integer.
+
+   .. attribute:: st_ctime_ns
+
+      Platform dependent:
+
+      * the time of most recent metadata change on Unix,
+      * the time of creation on Windows, expressed in nanoseconds as an
+        integer.
+
+   See also the :func:`stat_float_times` function.
 
    .. note::
 
@@ -1848,6 +1988,7 @@
       or FAT32 file systems, :attr:`st_mtime` has 2-second resolution, and
       :attr:`st_atime` has only 1-day resolution.  See your operating system
       documentation for details.
+
       Similarly, although :attr:`st_atime_ns`, :attr:`st_mtime_ns`,
       and :attr:`st_ctime_ns` are always expressed in nanoseconds, many
       systems do not provide nanosecond precision.  On systems that do
@@ -1857,41 +1998,68 @@
       If you need the exact timestamps you should always use
       :attr:`st_atime_ns`, :attr:`st_mtime_ns`, and :attr:`st_ctime_ns`.
 
-   For backward compatibility, the return value of :func:`~os.stat` is also
+   On some Unix systems (such as Linux), the following attributes may also be
+   available:
+
+   .. attribute:: st_blocks
+
+      Number of 512-byte blocks allocated for file.
+      This may be smaller than :attr:`st_size`/512 when the file has holes.
+
+   .. attribute:: st_blksize
+
+      "Preferred" blocksize for efficient file system I/O. Writing to a file in
+      smaller chunks may cause an inefficient read-modify-rewrite.
+
+   .. attribute:: st_rdev
+
+      Type of device if an inode device.
+
+   .. attribute:: st_flags
+
+      User defined flags for file.
+
+   On other Unix systems (such as FreeBSD), the following attributes may be
+   available (but may be only filled out if root tries to use them):
+
+   .. attribute:: st_gen
+
+      File generation number.
+
+   .. attribute:: st_birthtime
+
+      Time of file creation.
+
+   On Mac OS systems, the following attributes may also be available:
+
+   .. attribute:: st_rsize
+
+      Real size of the file.
+
+   .. attribute:: st_creator
+
+      Creator of the file.
+
+   .. attribute:: st_type
+
+      File type.
+
+   The standard module :mod:`stat` defines functions and constants that are
+   useful for extracting information from a :c:type:`stat` structure. (On
+   Windows, some items are filled with dummy values.)
+
+   For backward compatibility, a :class:`stat_result` instance is also
    accessible as a tuple of at least 10 integers giving the most important (and
    portable) members of the :c:type:`stat` structure, in the order
    :attr:`st_mode`, :attr:`st_ino`, :attr:`st_dev`, :attr:`st_nlink`,
    :attr:`st_uid`, :attr:`st_gid`, :attr:`st_size`, :attr:`st_atime`,
    :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>` and
-   :ref:`not following symlinks <follow_symlinks>`.
-
-   .. index:: module: stat
-
-   The standard module :mod:`stat` defines functions and constants that are useful
-   for extracting information from a :c:type:`stat` structure. (On Windows, some
-   items are filled with dummy values.)
-
-   Example::
-
-      >>> import os
-      >>> statinfo = os.stat('somefile.txt')
-      >>> statinfo
-      posix.stat_result(st_mode=33188, st_ino=7876932, st_dev=234881026,
-      st_nlink=1, st_uid=501, st_gid=501, st_size=264, st_atime=1297230295,
-      st_mtime=1297230027, st_ctime=1297230027)
-      >>> statinfo.st_size
-      264
-
-   Availability: Unix, Windows.
+   some implementations. For compatibility with older Python versions,
+   accessing :class:`stat_result` as a tuple always returns integers.
 
    .. versionadded:: 3.3
-      Added the *dir_fd* and *follow_symlinks* arguments,
-      specifying a file descriptor instead of a path,
-      and the :attr:`st_atime_ns`, :attr:`st_mtime_ns`,
-      and :attr:`st_ctime_ns` members.
+      Added the :attr:`st_atime_ns`, :attr:`st_mtime_ns`, and
+      :attr:`st_ctime_ns` members.
 
 
 .. function:: stat_float_times([newvalue])
@@ -1935,11 +2103,26 @@
    read-only, and if :const:`ST_NOSUID` is set, the semantics of
    setuid/setgid bits are disabled or not supported.
 
+   Additional module-level constants are defined for GNU/glibc based systems.
+   These are :const:`ST_NODEV` (disallow access to device special files),
+   :const:`ST_NOEXEC` (disallow program execution), :const:`ST_SYNCHRONOUS`
+   (writes are synced at once), :const:`ST_MANDLOCK` (allow mandatory locks on an FS),
+   :const:`ST_WRITE` (write on file/directory/symlink), :const:`ST_APPEND`
+   (append-only file), :const:`ST_IMMUTABLE` (immutable file), :const:`ST_NOATIME`
+   (do not update access times), :const:`ST_NODIRATIME` (do not update directory access
+   times), :const:`ST_RELATIME` (update atime relative to mtime/ctime).
+
    This function can support :ref:`specifying a file descriptor <path_fd>`.
 
    .. versionchanged:: 3.2
       The :const:`ST_RDONLY` and :const:`ST_NOSUID` constants were added.
 
+   .. versionchanged:: 3.4
+      The :const:`ST_NODEV`, :const:`ST_NOEXEC`, :const:`ST_SYNCHRONOUS`,
+      :const:`ST_MANDLOCK`, :const:`ST_WRITE`, :const:`ST_APPEND`,
+      :const:`ST_IMMUTABLE`, :const:`ST_NOATIME`, :const:`ST_NODIRATIME`,
+      and :const:`ST_RELATIME` constants were added.
+
    Availability: Unix.
 
    .. versionadded:: 3.3
@@ -2157,9 +2340,11 @@
 
    If optional argument *topdown* is ``True`` or not specified, the triple for a
    directory is generated before the triples for any of its subdirectories
-   (directories are generated top-down).  If *topdown* is ``False``, the triple for a
-   directory is generated after the triples for all of its subdirectories
-   (directories are generated bottom-up).
+   (directories are generated top-down).  If *topdown* is ``False``, the triple
+   for a directory is generated after the triples for all of its subdirectories
+   (directories are generated bottom-up). No matter the value of *topdown*, the
+   list of subdirectories is retrieved before the tuples for the directory and
+   its subdirectories are generated.
 
    When *topdown* is ``True``, the caller can modify the *dirnames* list in-place
    (perhaps using :keyword:`del` or slice assignment), and :func:`walk` will only
@@ -2589,7 +2774,7 @@
    Fork a child process.  Return ``0`` in the child and the child's process id in the
    parent.  If an error occurs :exc:`OSError` is raised.
 
-   Note that some platforms including FreeBSD <= 6.3, Cygwin and OS/2 EMX have
+   Note that some platforms including FreeBSD <= 6.3 and Cygwin have
    known issues when using fork() from a thread.
 
    .. warning::
@@ -2659,10 +2844,27 @@
    Availability: Unix.
 
 
-.. function:: popen(...)
+.. function:: popen(command, mode='r', buffering=-1)
 
-   Run child processes, returning opened pipes for communications.  These functions
-   are described in section :ref:`os-newstreams`.
+   Open a pipe to or from *command*.  The return value is an open file object
+   connected to the pipe, which can be read or written depending on whether *mode*
+   is ``'r'`` (default) or ``'w'``. The *buffering* argument has the same meaning as
+   the corresponding argument to the built-in :func:`open` function. The
+   returned file object reads or writes text strings rather than bytes.
+
+   The ``close`` method returns :const:`None` if the subprocess exited
+   successfully, or the subprocess's return code if there was an
+   error. On POSIX systems, if the return code is positive it
+   represents the return value of the process left-shifted by one
+   byte.  If the return code is negative, the process was terminated
+   by the signal given by the negated value of the return code.  (For
+   example, the return value might be ``- signal.SIGKILL`` if the
+   subprocess was killed.)  On Windows systems, the return value
+   contains the signed integer return code from the child process.
+
+   This is implemented using :class:`subprocess.Popen`; see that class's
+   documentation for more powerful ways to manage and communicate with
+   subprocesses.
 
 
 .. function:: spawnl(mode, path, ...)
@@ -2835,7 +3037,6 @@
    :manpage:`times(2)` or the corresponding Windows Platform API documentation.
    On Windows, only :attr:`user` and :attr:`system` are known; the other
    attributes are zero.
-   On OS/2, only :attr:`elapsed` is known; the other attributes are zero.
 
    Availability: Unix, Windows.
 
@@ -3057,7 +3258,7 @@
 
 .. versionadded:: 3.3
 
-The following scheduling policies are exposed if they are a supported by the
+The following scheduling policies are exposed if they are supported by the
 operating system.
 
 .. data:: SCHED_OTHER
@@ -3166,10 +3367,6 @@
    Return the set of CPUs the process with PID *pid* (or the current process
    if zero) is restricted to.
 
-   .. seealso::
-      :func:`multiprocessing.cpu_count` returns the number of CPUs in the
-      system.
-
 
 .. _os-path:
 
@@ -3207,6 +3404,13 @@
    Availability: Unix.
 
 
+.. function:: cpu_count()
+
+   Return the number of CPUs in the system. Returns None if undetermined.
+
+   .. versionadded:: 3.4
+
+
 .. function:: getloadavg()
 
    Return the number of processes in the system run queue averaged over the last
@@ -3305,6 +3509,19 @@
    The file path of the null device. For example: ``'/dev/null'`` for
    POSIX, ``'nul'`` for Windows.  Also available via :mod:`os.path`.
 
+.. data:: RTLD_LAZY
+          RTLD_NOW
+          RTLD_GLOBAL
+          RTLD_LOCAL
+          RTLD_NODELETE
+          RTLD_NOLOAD
+          RTLD_DEEPBIND
+
+   Flags for use with the :func:`~sys.setdlopenflags` and
+   :func:`~sys.getdlopenflags` functions.  See the Unix manual page
+   :manpage:`dlopen(3)` for what the different flags mean.
+
+   .. versionadded:: 3.3
 
 .. _os-miscfunc:
 
diff --git a/Doc/library/ossaudiodev.rst b/Doc/library/ossaudiodev.rst
index 80551aa..bb5081a 100644
--- a/Doc/library/ossaudiodev.rst
+++ b/Doc/library/ossaudiodev.rst
@@ -165,7 +165,7 @@
    data written is always equal to the amount of data supplied.
 
 .. versionchanged:: 3.2
-   Audio device objects also support the context manager protocol, i.e. they can
+   Audio device objects also support the context management protocol, i.e. they can
    be used in a :keyword:`with` statement.
 
 
@@ -357,7 +357,7 @@
    Returns the file handle number of the open mixer device file.
 
 .. versionchanged:: 3.2
-   Mixer objects also support the context manager protocol.
+   Mixer objects also support the context management protocol.
 
 
 The remaining methods are specific to audio mixing:
@@ -407,7 +407,7 @@
    (silent) to 100 (full volume).  If the control is monophonic, a 2-tuple is still
    returned, but both volumes are the same.
 
-   Raises :exc:`OSSAudioError` if an invalid control was is specified, or
+   Raises :exc:`OSSAudioError` if an invalid control is specified, or
    :exc:`OSError` if an unsupported control is specified.
 
 
diff --git a/Doc/library/othergui.rst b/Doc/library/othergui.rst
index eb49b99..efb7cff 100644
--- a/Doc/library/othergui.rst
+++ b/Doc/library/othergui.rst
@@ -10,7 +10,7 @@
 
    `PyGObject <https://live.gnome.org/PyGObject>`_
       provides introspection bindings for C libraries using
-      `GObject <http://developer.gnome.org/gobject/stable/>`_.  One of
+      `GObject <https://developer.gnome.org/gobject/stable/>`_.  One of
       these libraries is the `GTK+ 3 <http://www.gtk.org/>`_ widget set.
       GTK+ comes with many more widgets than Tkinter provides.  An online
       `Python GTK+ 3 Tutorial <http://python-gtk-3-tutorial.readthedocs.org/en/latest/>`_
@@ -22,7 +22,7 @@
       `GNOME <http://www.gnome.org>`_.  An online `tutorial
       <http://www.pygtk.org/pygtk2tutorial/index.html>`_ is available.
 
-   `PyQt <http://www.riverbankcomputing.co.uk/software/pyqt/>`_
+   `PyQt <http://www.riverbankcomputing.co.uk/software/pyqt/intro>`_
       PyQt is a :program:`sip`\ -wrapped binding to the Qt toolkit.  Qt is an
       extensive C++ GUI application development framework that is
       available for Unix, Windows and Mac OS X. :program:`sip` is a tool
@@ -34,7 +34,7 @@
       with Python and Qt <http://www.qtrac.eu/pyqtbook.html>`_, by Mark
       Summerfield.
 
-   `PySide <http://www.pyside.org/>`_
+   `PySide <http://qt-project.org/wiki/PySide>`_
       is a newer binding to the Qt toolkit, provided by Nokia.
       Compared to PyQt, its licensing scheme is friendlier to non-open source
       applications.
@@ -56,7 +56,7 @@
 PyGTK, PyQt, and wxPython, all have a modern look and feel and more
 widgets than Tkinter. In addition, there are many other GUI toolkits for
 Python, both cross-platform, and platform-specific. See the `GUI Programming
-<http://wiki.python.org/moin/GuiProgramming>`_ page in the Python Wiki for a
+<https://wiki.python.org/moin/GuiProgramming>`_ page in the Python Wiki for a
 much more complete list, and also for links to documents where the
 different GUI toolkits are compared.
 
diff --git a/Doc/library/pathlib-inheritance.png b/Doc/library/pathlib-inheritance.png
new file mode 100644
index 0000000..b81c3de
--- /dev/null
+++ b/Doc/library/pathlib-inheritance.png
Binary files differ
diff --git a/Doc/library/pathlib-inheritance.svg b/Doc/library/pathlib-inheritance.svg
new file mode 100644
index 0000000..9f42005
--- /dev/null
+++ b/Doc/library/pathlib-inheritance.svg
@@ -0,0 +1,4 @@
+<?xml version="1.0" standalone="yes"?>
+
+<svg version="1.1" viewBox="0.0 0.0 538.0 496.0" fill="none" stroke="none" stroke-linecap="square" stroke-miterlimit="10" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><clipPath id="p.0"><path d="m0 0l538.0 0l0 496.0l-538.0 0l0 -496.0z" clip-rule="nonzero"></path></clipPath><g clip-path="url(#p.0)"><path fill="#000000" fill-opacity="0.0" d="m0 0l538.916 0l0 496.08398l-538.916 0z" fill-rule="nonzero"></path><path fill="#ffffff" d="m176.0 24.0l187.43307 0l0 80.53543l-187.43307 0z" fill-rule="nonzero"></path><path stroke="#000000" stroke-width="1.0" stroke-linejoin="round" stroke-linecap="butt" d="m176.0 24.0l187.43307 0l0 80.53543l-187.43307 0z" fill-rule="nonzero"></path><path fill="#000000" d="m235.18527 66.877716l0 1.640625l1.625 0q0.578125 0 0.8125 0.234375q0.25 0.21875 0.25 0.578125q0 0.34375 -0.25 0.578125q-0.234375 0.21875 -0.8125 0.21875l-3.46875 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.234375 -0.25 -0.59375q0 -0.34375 0.25 -0.5625q0.25 -0.234375 0.828125 -0.234375l0.25 0l0 -6.265625l-0.25 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.21875 -0.25 -0.578125q0 -0.359375 0.25 -0.578125q0.25 -0.234375 0.828125 -0.234375l3.6875 0.015625q1.625 0 2.5625 0.890625q0.953125 0.875 0.953125 2.15625q0 0.703125 -0.3125 1.328125q-0.25 0.46875 -0.8125 0.921875q-0.5625 0.453125 -1.15625 0.6875q-0.59375 0.234375 -1.5625 0.234375l-1.515625 0zm0 -1.609375l1.484375 0q1.046875 0 1.65625 -0.46875q0.625 -0.46875 0.625 -1.140625q0 -0.5625 -0.5 -0.984375q-0.5 -0.421875 -1.421875 -0.421875l-1.84375 0l0 3.015625zm13.9296875 -2.234375l0 5.484375q0.515625 0 0.75 0.234375q0.25 0.21875 0.25 0.578125q0 0.34375 -0.25 0.578125q-0.25 0.21875 -0.828125 0.21875l-1.515625 0l0 -0.375q-0.6875 0.3125 -1.3125 0.46875q-0.625 0.171875 -1.1875 0.171875q-0.796875 0 -1.375 -0.328125q-0.578125 -0.34375 -0.90625 -0.9375q-0.25 -0.421875 -0.25 -1.046875l0 -3.453125l-0.265625 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.21875 -0.25 -0.578125q0 -0.359375 0.25 -0.578125q0.25 -0.21875 0.828125 -0.21875l1.875 0l0 4.765625q0 0.5 0.234375 0.75q0.25 0.234375 0.765625 0.234375q0.484375 0 1.03125 -0.1875q0.5625 -0.203125 1.390625 -0.703125l0 -3.265625l-0.578125 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.21875 -0.25 -0.578125q0 -0.359375 0.25 -0.578125q0.25 -0.21875 0.828125 -0.21875l2.171875 0zm5.8671875 0l0 1.0q1.015625 -0.734375 1.59375 -0.96875q0.578125 -0.25 1.09375 -0.25q0.78125 0 1.515625 0.578125q0.5 0.390625 0.5 0.796875q0 0.34375 -0.25 0.59375q-0.234375 0.234375 -0.5625 0.234375q-0.296875 0 -0.625 -0.296875q-0.328125 -0.296875 -0.59375 -0.296875q-0.328125 0 -1.0 0.421875q-0.671875 0.421875 -1.671875 1.265625l0 2.40625l2.28125 0q0.578125 0 0.828125 0.234375q0.25 0.21875 0.25 0.578125q0 0.34375 -0.25 0.578125q-0.25 0.21875 -0.828125 0.21875l-4.828125 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.234375 -0.25 -0.59375q0 -0.34375 0.25 -0.5625q0.25 -0.234375 0.828125 -0.234375l0.953125 0l0 -3.890625l-0.578125 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.21875 -0.25 -0.578125q0 -0.359375 0.25 -0.578125q0.25 -0.21875 0.828125 -0.21875l2.171875 0zm13.9609375 4.359375l-6.578125 0q0.25 0.625 0.890625 1.015625q0.640625 0.375 1.71875 0.375q0.890625 0 2.375 -0.390625q0.609375 -0.15625 0.84375 -0.15625q0.3125 0 0.53125 0.234375q0.21875 0.21875 0.21875 0.5625q0 0.3125 -0.234375 0.53125q-0.3125 0.296875 -1.53125 0.5625q-1.203125 0.265625 -2.3125 0.265625q-1.921875 0 -3.078125 -1.09375q-1.15625 -1.09375 -1.15625 -2.671875q0 -1.6875 1.25 -2.75q1.25 -1.0625 2.875 -1.0625q0.96875 0 1.78125 0.34375q0.828125 0.34375 1.21875 0.75q0.5625 0.578125 0.9375 1.421875q0.25 0.59375 0.25 1.375l0 0.6875zm-1.78125 -1.609375q-0.359375 -0.6875 -0.953125 -1.015625q-0.59375 -0.34375 -1.421875 -0.34375q-0.8125 0 -1.40625 0.34375q-0.59375 0.328125 -0.96875 1.015625l4.75 0zm6.4296875 1.09375l0 1.640625l1.625 0q0.578125 0 0.8125 0.234375q0.25 0.21875 0.25 0.578125q0 0.34375 -0.25 0.578125q-0.234375 0.21875 -0.8125 0.21875l-3.46875 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.234375 -0.25 -0.59375q0 -0.34375 0.25 -0.5625q0.25 -0.234375 0.828125 -0.234375l0.25 0l0 -6.265625l-0.25 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.21875 -0.25 -0.578125q0 -0.359375 0.25 -0.578125q0.25 -0.234375 0.828125 -0.234375l3.6875 0.015625q1.625 0 2.5625 0.890625q0.953125 0.875 0.953125 2.15625q0 0.703125 -0.3125 1.328125q-0.25 0.46875 -0.8125 0.921875q-0.5625 0.453125 -1.15625 0.6875q-0.59375 0.234375 -1.5625 0.234375l-1.515625 0zm0 -1.609375l1.484375 0q1.046875 0 1.65625 -0.46875q0.625 -0.46875 0.625 -1.140625q0 -0.5625 -0.5 -0.984375q-0.5 -0.421875 -1.421875 -0.421875l-1.84375 0l0 3.015625zm11.9765625 4.859375l0 -0.375q-0.609375 0.3125 -1.34375 0.46875q-0.71875 0.171875 -1.3125 0.171875q-1.28125 0 -2.09375 -0.6875q-0.796875 -0.6875 -0.796875 -1.515625q0 -1.0 1.015625 -1.859375q1.03125 -0.875 2.84375 -0.875q0.734375 0 1.6875 0.15625l0 -0.375q0 -0.359375 -0.3125 -0.578125q-0.3125 -0.234375 -1.171875 -0.234375q-0.71875 0 -1.84375 0.28125q-0.421875 0.09375 -0.65625 0.09375q-0.328125 0 -0.546875 -0.21875q-0.21875 -0.234375 -0.21875 -0.59375q0 -0.203125 0.078125 -0.34375q0.078125 -0.15625 0.21875 -0.25q0.140625 -0.09375 0.578125 -0.21875q0.59375 -0.15625 1.203125 -0.25q0.625 -0.109375 1.125 -0.109375q1.5 0 2.3125 0.65625q0.828125 0.640625 0.828125 1.75l0 3.296875l0.28125 0q0.578125 0 0.8125 0.234375q0.25 0.21875 0.25 0.578125q0 0.34375 -0.25 0.578125q-0.234375 0.21875 -0.8125 0.21875l-1.875 0zm0 -2.875q-0.96875 -0.1875 -1.78125 -0.1875q-0.96875 0 -1.671875 0.484375q-0.4375 0.296875 -0.4375 0.609375q0 0.234375 0.203125 0.375q0.390625 0.25 1.078125 0.25q0.578125 0 1.296875 -0.21875q0.734375 -0.234375 1.3125 -0.625l0 -0.6875zm7.7578125 -2.625l0 3.21875q0 0.515625 0.21875 0.671875q0.328125 0.265625 1.171875 0.265625q1.21875 0 2.265625 -0.53125q0.390625 -0.203125 0.625 -0.203125q0.3125 0 0.53125 0.234375q0.234375 0.234375 0.234375 0.578125q0 0.3125 -0.25 0.53125q-0.375 0.375 -1.515625 0.6875q-1.125 0.3125 -1.890625 0.3125q-1.5 0 -2.25 -0.640625q-0.734375 -0.65625 -0.734375 -1.59375l0 -3.53125l-0.578125 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.21875 -0.25 -0.578125q0 -0.359375 0.25 -0.578125q0.25 -0.21875 0.828125 -0.21875l0.578125 0l0 -1.453125q0 -0.578125 0.21875 -0.8125q0.21875 -0.25 0.578125 -0.25q0.359375 0 0.578125 0.25q0.21875 0.234375 0.21875 0.8125l0 1.453125l2.96875 0q0.578125 0 0.8125 0.21875q0.25 0.21875 0.25 0.578125q0 0.359375 -0.25 0.578125q-0.234375 0.21875 -0.8125 0.21875l-2.96875 0zm8.3515625 -4.640625l0 3.421875q0.5 -0.296875 1.0 -0.4375q0.515625 -0.15625 1.046875 -0.15625q0.828125 0 1.46875 0.28125q0.65625 0.28125 1.078125 0.890625q0.421875 0.609375 0.421875 1.53125l0 3.0q0.609375 0 0.796875 0.125q0.375 0.234375 0.375 0.6875q0 0.34375 -0.25 0.578125q-0.234375 0.21875 -0.8125 0.21875l-1.828125 0q-0.5625 0 -0.8125 -0.21875q-0.25 -0.234375 -0.25 -0.59375q0 -0.4375 0.375 -0.671875q0.203125 -0.125 0.796875 -0.125l0 -2.890625q0 -0.625 -0.28125 -0.875q-0.359375 -0.328125 -1.078125 -0.328125q-0.53125 0 -0.953125 0.203125q-0.40625 0.203125 -1.09375 0.890625l0 3.0q0.609375 0 0.796875 0.125q0.375 0.234375 0.375 0.6875q0 0.34375 -0.25 0.578125q-0.234375 0.21875 -0.8125 0.21875l-1.828125 0q-0.578125 0 -0.828125 -0.21875q-0.234375 -0.234375 -0.234375 -0.59375q0 -0.4375 0.375 -0.671875q0.1875 -0.125 0.796875 -0.125l0 -6.921875l-0.265625 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.234375 -0.25 -0.59375q0 -0.34375 0.25 -0.5625q0.25 -0.234375 0.828125 -0.234375l1.875 0z" fill-rule="nonzero"></path><path fill="#ffffff" d="m16.0 144.0l187.43306 0l0 80.53543l-187.43306 0z" fill-rule="nonzero"></path><path stroke="#000000" stroke-width="1.0" stroke-linejoin="round" stroke-linecap="butt" d="m16.0 144.0l187.43306 0l0 80.53543l-187.43306 0z" fill-rule="nonzero"></path><path fill="#000000" d="m51.181374 186.87772l0 1.640625l1.625 0q0.578125 0 0.8125 0.234375q0.25 0.21875 0.25 0.578125q0 0.34375 -0.25 0.578125q-0.234375 0.21875 -0.8125 0.21875l-3.46875 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.234375 -0.25 -0.59375q0 -0.34375 0.25 -0.5625q0.25 -0.234375 0.828125 -0.234375l0.25 0l0 -6.265625l-0.25 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.21875 -0.25 -0.578125q0 -0.359375 0.25 -0.578125q0.25 -0.234375 0.828125 -0.234375l3.6875 0.015625q1.625 0 2.5625 0.890625q0.953125 0.875 0.953125 2.15625q0 0.703125 -0.3125 1.328125q-0.25 0.46875 -0.8125 0.921875q-0.5625 0.453125 -1.15625 0.6875q-0.59375 0.234375 -1.5625 0.234375l-1.515625 0zm0 -1.609375l1.484375 0q1.046875 0 1.65625 -0.46875q0.625 -0.46875 0.625 -1.140625q0 -0.5625 -0.5 -0.984375q-0.5 -0.421875 -1.421875 -0.421875l-1.84375 0l0 3.015625zm13.9296875 -2.234375l0 5.484375q0.515625 0 0.75 0.234375q0.25 0.21875 0.25 0.578125q0 0.34375 -0.25 0.578125q-0.25 0.21875 -0.828125 0.21875l-1.515625 0l0 -0.375q-0.6875 0.3125 -1.3125 0.46875q-0.625 0.171875 -1.1875 0.171875q-0.796875 0 -1.375 -0.328125q-0.578125 -0.34375 -0.90625 -0.9375q-0.25 -0.421875 -0.25 -1.046875l0 -3.453125l-0.265625 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.21875 -0.25 -0.578125q0 -0.359375 0.25 -0.578125q0.25 -0.21875 0.828125 -0.21875l1.875 0l0 4.765625q0 0.5 0.234375 0.75q0.25 0.234375 0.765625 0.234375q0.484375 0 1.03125 -0.1875q0.5625 -0.203125 1.390625 -0.703125l0 -3.265625l-0.578125 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.21875 -0.25 -0.578125q0 -0.359375 0.25 -0.578125q0.25 -0.21875 0.828125 -0.21875l2.171875 0zm5.8671875 0l0 1.0q1.015625 -0.734375 1.59375 -0.96875q0.578125 -0.25 1.09375 -0.25q0.78125 0 1.515625 0.578125q0.5 0.390625 0.5 0.796875q0 0.34375 -0.25 0.59375q-0.234375 0.234375 -0.5625 0.234375q-0.296875 0 -0.625 -0.296875q-0.328125 -0.296875 -0.59375 -0.296875q-0.328125 0 -1.0 0.421875q-0.671875 0.421875 -1.671875 1.265625l0 2.40625l2.28125 0q0.578125 0 0.828125 0.234375q0.25 0.21875 0.25 0.578125q0 0.34375 -0.25 0.578125q-0.25 0.21875 -0.828125 0.21875l-4.828125 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.234375 -0.25 -0.59375q0 -0.34375 0.25 -0.5625q0.25 -0.234375 0.828125 -0.234375l0.953125 0l0 -3.890625l-0.578125 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.21875 -0.25 -0.578125q0 -0.359375 0.25 -0.578125q0.25 -0.21875 0.828125 -0.21875l2.171875 0zm13.9609375 4.359375l-6.578125 0q0.25 0.625 0.890625 1.015625q0.640625 0.375 1.71875 0.375q0.890625 0 2.375 -0.390625q0.609375 -0.15625 0.84375 -0.15625q0.3125 0 0.53125 0.234375q0.21875 0.21875 0.21875 0.5625q0 0.3125 -0.234375 0.53125q-0.3125 0.296875 -1.53125 0.5625q-1.203125 0.265625 -2.3125 0.265625q-1.921875 0 -3.078125 -1.09375q-1.15625 -1.09375 -1.15625 -2.671875q0 -1.6875 1.25 -2.75q1.25 -1.0625 2.875 -1.0625q0.96875 0 1.78125 0.34375q0.828125 0.34375 1.21875 0.75q0.5625 0.578125 0.9375 1.421875q0.25 0.59375 0.25 1.375l0 0.6875zm-1.78125 -1.609375q-0.359375 -0.6875 -0.953125 -1.015625q-0.59375 -0.34375 -1.421875 -0.34375q-0.8125 0 -1.40625 0.34375q-0.59375 0.328125 -0.96875 1.015625l4.75 0zm6.4296875 1.09375l0 1.640625l1.625 0q0.578125 0 0.8125 0.234375q0.25 0.21875 0.25 0.578125q0 0.34375 -0.25 0.578125q-0.234375 0.21875 -0.8125 0.21875l-3.46875 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.234375 -0.25 -0.59375q0 -0.34375 0.25 -0.5625q0.25 -0.234375 0.828125 -0.234375l0.25 0l0 -6.265625l-0.25 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.21875 -0.25 -0.578125q0 -0.359375 0.25 -0.578125q0.25 -0.234375 0.828125 -0.234375l3.6875 0.015625q1.625 0 2.5625 0.890625q0.953125 0.875 0.953125 2.15625q0 0.703125 -0.3125 1.328125q-0.25 0.46875 -0.8125 0.921875q-0.5625 0.453125 -1.15625 0.6875q-0.59375 0.234375 -1.5625 0.234375l-1.515625 0zm0 -1.609375l1.484375 0q1.046875 0 1.65625 -0.46875q0.625 -0.46875 0.625 -1.140625q0 -0.5625 -0.5 -0.984375q-0.5 -0.421875 -1.421875 -0.421875l-1.84375 0l0 3.015625zm14.6953125 1.4375q0 0.921875 -0.515625 1.796875q-0.515625 0.859375 -1.53125 1.375q-1.0 0.515625 -2.109375 0.515625q-1.09375 0 -2.09375 -0.5q-1.0 -0.515625 -1.53125 -1.375q-0.515625 -0.875 -0.515625 -1.828125q0 -0.953125 0.53125 -1.875q0.53125 -0.9375 1.53125 -1.46875q1.0 -0.53125 2.078125 -0.53125q1.09375 0 2.109375 0.546875q1.015625 0.546875 1.53125 1.46875q0.515625 0.90625 0.515625 1.875zm-1.609375 0.015625q0 -0.78125 -0.546875 -1.421875q-0.765625 -0.875 -2.0 -0.875q-1.078125 0 -1.8125 0.703125q-0.71875 0.6875 -0.71875 1.59375q0 0.75 0.734375 1.40625q0.734375 0.65625 1.796875 0.65625q1.078125 0 1.8125 -0.65625q0.734375 -0.65625 0.734375 -1.40625zm8.7734375 -1.8125q-0.390625 -0.25 -0.828125 -0.359375q-0.421875 -0.125 -0.890625 -0.125q-0.921875 0 -1.46875 0.296875q-0.25 0.140625 -0.25 0.296875q0 0.171875 0.328125 0.34375q0.25 0.125 1.125 0.25q1.59375 0.21875 2.21875 0.4375q0.8125 0.28125 1.25 0.859375q0.453125 0.5625 0.453125 1.203125q0 0.859375 -0.75 1.4375q-1.09375 0.84375 -2.828125 0.84375q-0.6875 0 -1.28125 -0.125q-0.59375 -0.125 -1.078125 -0.359375q-0.125 0.09375 -0.265625 0.15625q-0.125 0.046875 -0.265625 0.046875q-0.375 0 -0.59375 -0.234375q-0.21875 -0.25 -0.21875 -0.828125l0 -0.546875q0 -0.578125 0.21875 -0.8125q0.21875 -0.25 0.578125 -0.25q0.296875 0 0.484375 0.15625q0.203125 0.15625 0.3125 0.546875q0.359375 0.3125 0.875 0.484375q0.515625 0.15625 1.1875 0.15625q1.109375 0 1.71875 -0.34375q0.28125 -0.171875 0.28125 -0.359375q0 -0.3125 -0.40625 -0.515625q-0.421875 -0.203125 -1.71875 -0.34375q-1.921875 -0.203125 -2.578125 -0.78125q-0.640625 -0.578125 -0.640625 -1.40625q0 -0.859375 0.71875 -1.4375q0.984375 -0.78125 2.578125 -0.78125q0.5625 0 1.0625 0.109375q0.515625 0.109375 0.984375 0.328125q0.15625 -0.109375 0.28125 -0.15625q0.125 -0.0625 0.234375 -0.0625q0.328125 0 0.546875 0.25q0.21875 0.234375 0.21875 0.8125l0 0.390625q0 0.53125 -0.125 0.71875q-0.25 0.359375 -0.671875 0.359375q-0.296875 0 -0.515625 -0.171875q-0.21875 -0.1875 -0.28125 -0.484375zm8.4453125 -4.921875l0 1.703125l-1.90625 0l0 -1.703125l1.90625 0zm0.21875 3.046875l0 5.484375l1.921875 0q0.578125 0 0.828125 0.234375q0.25 0.21875 0.25 0.578125q0 0.34375 -0.25 0.578125q-0.25 0.21875 -0.828125 0.21875l-5.4375 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.234375 -0.25 -0.59375q0 -0.34375 0.25 -0.5625q0.25 -0.234375 0.828125 -0.234375l1.921875 0l0 -3.890625l-1.296875 0q-0.5625 0 -0.8125 -0.21875q-0.25 -0.21875 -0.25 -0.578125q0 -0.359375 0.234375 -0.578125q0.25 -0.21875 0.828125 -0.21875l2.890625 0zm10.007805 3.40625l2.4375 2.078125q0.4375 0.03125 0.65625 0.25q0.21875 0.21875 0.21875 0.5625q0 0.34375 -0.25 0.578125q-0.25 0.21875 -0.828125 0.21875l-1.8125 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.234375 -0.25 -0.59375q0 -0.28125 0.171875 -0.5q0.1875 -0.21875 0.484375 -0.296875l-1.1875 -1.03125l-1.2187424 1.03125q0.35936737 0.09375 0.5156174 0.296875q0.171875 0.1875 0.171875 0.5q0 0.359375 -0.25 0.59375q-0.23436737 0.21875 -0.8124924 0.21875l-1.8125 0q-0.578125 0 -0.828125 -0.21875q-0.234375 -0.234375 -0.234375 -0.59375q0 -0.328125 0.21875 -0.546875q0.21875 -0.21875 0.65625 -0.25l2.375 -2.09375l-2.109375 -1.796875q-0.40625 -0.03125 -0.625 -0.25q-0.21875 -0.21875 -0.21875 -0.546875q0 -0.359375 0.25 -0.578125q0.25 -0.21875 0.828125 -0.21875l1.5 0q0.578125 0 0.8124924 0.21875q0.25 0.21875 0.25 0.5625q0 0.46875 -0.43749237 0.75l0.9687424 0.8125l0.953125 -0.828125q-0.421875 -0.296875 -0.421875 -0.703125q0 -0.375 0.234375 -0.59375q0.25 -0.21875 0.828125 -0.21875l1.484375 0q0.578125 0 0.828125 0.21875q0.25 0.21875 0.25 0.578125q0 0.328125 -0.21875 0.546875q-0.21875 0.21875 -0.640625 0.25l-2.109375 1.8125zm7.4765625 0.4375l0 1.640625l1.625 0q0.578125 0 0.8125 0.234375q0.25 0.21875 0.25 0.578125q0 0.34375 -0.25 0.578125q-0.234375 0.21875 -0.8125 0.21875l-3.46875 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.234375 -0.25 -0.59375q0 -0.34375 0.25 -0.5625q0.25 -0.234375 0.828125 -0.234375l0.25 0l0 -6.265625l-0.25 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.21875 -0.25 -0.578125q0 -0.359375 0.25 -0.578125q0.25 -0.234375 0.828125 -0.234375l3.6875 0.015625q1.625 0 2.5625 0.890625q0.953125 0.875 0.953125 2.15625q0 0.703125 -0.3125 1.328125q-0.25 0.46875 -0.8125 0.921875q-0.5625 0.453125 -1.15625 0.6875q-0.59375 0.234375 -1.5625 0.234375l-1.515625 0zm0 -1.609375l1.484375 0q1.046875 0 1.65625 -0.46875q0.625 -0.46875 0.625 -1.140625q0 -0.5625 -0.5 -0.984375q-0.5 -0.421875 -1.421875 -0.421875l-1.84375 0l0 3.015625zm11.9765625 4.859375l0 -0.375q-0.609375 0.3125 -1.34375 0.46875q-0.71875 0.171875 -1.3125 0.171875q-1.28125 0 -2.09375 -0.6875q-0.796875 -0.6875 -0.796875 -1.515625q0 -1.0 1.015625 -1.859375q1.03125 -0.875 2.84375 -0.875q0.734375 0 1.6875 0.15625l0 -0.375q0 -0.359375 -0.3125 -0.578125q-0.3125 -0.234375 -1.171875 -0.234375q-0.71875 0 -1.84375 0.28125q-0.421875 0.09375 -0.65625 0.09375q-0.328125 0 -0.546875 -0.21875q-0.21875 -0.234375 -0.21875 -0.59375q0 -0.203125 0.078125 -0.34375q0.078125 -0.15625 0.21875 -0.25q0.140625 -0.09375 0.578125 -0.21875q0.59375 -0.15625 1.203125 -0.25q0.625 -0.109375 1.125 -0.109375q1.5 0 2.3125 0.65625q0.828125 0.640625 0.828125 1.75l0 3.296875l0.28125 0q0.578125 0 0.8125 0.234375q0.25 0.21875 0.25 0.578125q0 0.34375 -0.25 0.578125q-0.234375 0.21875 -0.8125 0.21875l-1.875 0zm0 -2.875q-0.96875 -0.1875 -1.78125 -0.1875q-0.96875 0 -1.671875 0.484375q-0.4375 0.296875 -0.4375 0.609375q0 0.234375 0.203125 0.375q0.390625 0.25 1.078125 0.25q0.578125 0 1.296875 -0.21875q0.734375 -0.234375 1.3125 -0.625l0 -0.6875zm7.7578125 -2.625l0 3.21875q0 0.515625 0.21875 0.671875q0.328125 0.265625 1.171875 0.265625q1.21875 0 2.265625 -0.53125q0.390625 -0.203125 0.625 -0.203125q0.3125 0 0.53125 0.234375q0.234375 0.234375 0.234375 0.578125q0 0.3125 -0.25 0.53125q-0.375 0.375 -1.515625 0.6875q-1.125 0.3125 -1.890625 0.3125q-1.5 0 -2.25 -0.640625q-0.734375 -0.65625 -0.734375 -1.59375l0 -3.53125l-0.578125 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.21875 -0.25 -0.578125q0 -0.359375 0.25 -0.578125q0.25 -0.21875 0.828125 -0.21875l0.578125 0l0 -1.453125q0 -0.578125 0.21875 -0.8125q0.21875 -0.25 0.578125 -0.25q0.359375 0 0.578125 0.25q0.21875 0.234375 0.21875 0.8125l0 1.453125l2.96875 0q0.578125 0 0.8125 0.21875q0.25 0.21875 0.25 0.578125q0 0.359375 -0.25 0.578125q-0.234375 0.21875 -0.8125 0.21875l-2.96875 0zm8.3515625 -4.640625l0 3.421875q0.5 -0.296875 1.0 -0.4375q0.515625 -0.15625 1.046875 -0.15625q0.828125 0 1.46875 0.28125q0.65625 0.28125 1.078125 0.890625q0.421875 0.609375 0.421875 1.53125l0 3.0q0.609375 0 0.796875 0.125q0.375 0.234375 0.375 0.6875q0 0.34375 -0.25 0.578125q-0.234375 0.21875 -0.8125 0.21875l-1.828125 0q-0.5625 0 -0.8125 -0.21875q-0.25 -0.234375 -0.25 -0.59375q0 -0.4375 0.375 -0.671875q0.203125 -0.125 0.796875 -0.125l0 -2.890625q0 -0.625 -0.28125 -0.875q-0.359375 -0.328125 -1.078125 -0.328125q-0.53125 0 -0.953125 0.203125q-0.40625 0.203125 -1.09375 0.890625l0 3.0q0.609375 0 0.796875 0.125q0.375 0.234375 0.375 0.6875q0 0.34375 -0.25 0.578125q-0.234375 0.21875 -0.8125 0.21875l-1.828125 0q-0.578125 0 -0.828125 -0.21875q-0.234375 -0.234375 -0.234375 -0.59375q0 -0.4375 0.375 -0.671875q0.1875 -0.125 0.796875 -0.125l0 -6.921875l-0.265625 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.234375 -0.25 -0.59375q0 -0.34375 0.25 -0.5625q0.25 -0.234375 0.828125 -0.234375l1.875 0z" fill-rule="nonzero"></path><path fill="#ffffff" d="m336.0 143.46457l187.43304 0l0 80.53543l-187.43304 0z" fill-rule="nonzero"></path><path stroke="#000000" stroke-width="1.0" stroke-linejoin="round" stroke-linecap="butt" d="m336.0 143.46457l187.43304 0l0 80.53543l-187.43304 0z" fill-rule="nonzero"></path><path fill="#000000" d="m361.5798 186.34229l0 1.640625l1.625 0q0.578125 0 0.8125 0.234375q0.25 0.21875 0.25 0.578125q0 0.34375 -0.25 0.578125q-0.234375 0.21875 -0.8125 0.21875l-3.46875 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.234375 -0.25 -0.59375q0 -0.34375 0.25 -0.5625q0.25 -0.234375 0.828125 -0.234375l0.25 0l0 -6.265625l-0.25 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.21875 -0.25 -0.578125q0 -0.359375 0.25 -0.578125q0.25 -0.234375 0.828125 -0.234375l3.6875 0.015625q1.625 0 2.5625 0.890625q0.953125 0.875 0.953125 2.15625q0 0.703125 -0.3125 1.328125q-0.25 0.46875 -0.8125 0.921875q-0.5625 0.453125 -1.15625 0.6875q-0.59375 0.234375 -1.5625 0.234375l-1.515625 0zm0 -1.609375l1.484375 0q1.046875 0 1.65625 -0.46875q0.625 -0.46875 0.625 -1.140625q0 -0.5625 -0.5 -0.984375q-0.5 -0.421875 -1.421875 -0.421875l-1.84375 0l0 3.015625zm13.9296875 -2.234375l0 5.484375q0.515625 0 0.75 0.234375q0.25 0.21875 0.25 0.578125q0 0.34375 -0.25 0.578125q-0.25 0.21875 -0.828125 0.21875l-1.515625 0l0 -0.375q-0.6875 0.3125 -1.3125 0.46875q-0.625 0.171875 -1.1875 0.171875q-0.796875 0 -1.375 -0.328125q-0.578125 -0.34375 -0.90625 -0.9375q-0.25 -0.421875 -0.25 -1.046875l0 -3.453125l-0.265625 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.21875 -0.25 -0.578125q0 -0.359375 0.25 -0.578125q0.25 -0.21875 0.828125 -0.21875l1.875 0l0 4.765625q0 0.5 0.234375 0.75q0.25 0.234375 0.765625 0.234375q0.484375 0 1.03125 -0.1875q0.5625 -0.203125 1.390625 -0.703125l0 -3.265625l-0.578125 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.21875 -0.25 -0.578125q0 -0.359375 0.25 -0.578125q0.25 -0.21875 0.828125 -0.21875l2.171875 0zm5.8671875 0l0 1.0q1.015625 -0.734375 1.59375 -0.96875q0.578125 -0.25 1.09375 -0.25q0.78125 0 1.515625 0.578125q0.5 0.390625 0.5 0.796875q0 0.34375 -0.25 0.59375q-0.234375 0.234375 -0.5625 0.234375q-0.296875 0 -0.625 -0.296875q-0.328125 -0.296875 -0.59375 -0.296875q-0.328125 0 -1.0 0.421875q-0.671875 0.421875 -1.671875 1.265625l0 2.40625l2.28125 0q0.578125 0 0.828125 0.234375q0.25 0.21875 0.25 0.578125q0 0.34375 -0.25 0.578125q-0.25 0.21875 -0.828125 0.21875l-4.828125 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.234375 -0.25 -0.59375q0 -0.34375 0.25 -0.5625q0.25 -0.234375 0.828125 -0.234375l0.953125 0l0 -3.890625l-0.578125 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.21875 -0.25 -0.578125q0 -0.359375 0.25 -0.578125q0.25 -0.21875 0.828125 -0.21875l2.171875 0zm13.9609375 4.359375l-6.578125 0q0.25 0.625 0.890625 1.015625q0.640625 0.375 1.71875 0.375q0.890625 0 2.375 -0.390625q0.609375 -0.15625 0.84375 -0.15625q0.3125 0 0.53125 0.234375q0.21875 0.21875 0.21875 0.5625q0 0.3125 -0.234375 0.53125q-0.3125 0.296875 -1.53125 0.5625q-1.203125 0.265625 -2.3125 0.265625q-1.921875 0 -3.078125 -1.09375q-1.15625 -1.09375 -1.15625 -2.671875q0 -1.6875 1.25 -2.75q1.25 -1.0625 2.875 -1.0625q0.96875 0 1.78125 0.34375q0.828125 0.34375 1.21875 0.75q0.5625 0.578125 0.9375 1.421875q0.25 0.59375 0.25 1.375l0 0.6875zm-1.78125 -1.609375q-0.359375 -0.6875 -0.953125 -1.015625q-0.59375 -0.34375 -1.421875 -0.34375q-0.8125 0 -1.40625 0.34375q-0.59375 0.328125 -0.96875 1.015625l4.75 0zm7.3671875 -0.203125l-1.484375 4.546875l-1.796875 0l-0.953125 -7.875q-0.375 -0.046875 -0.5625 -0.25q-0.1875 -0.203125 -0.1875 -0.53125q0 -0.375 0.25 -0.59375q0.25 -0.234375 0.828125 -0.234375l2.125 0.015625q0.578125 0 0.828125 0.21875q0.25 0.21875 0.25 0.578125q0 0.359375 -0.25 0.578125q-0.25 0.21875 -0.828125 0.21875l-0.828125 0l0.53125 4.484375l1.25 -3.734375l1.671875 0l1.25 3.734375l0.53125 -4.484375l-0.84375 0q-0.578125 0 -0.828125 -0.21875q-0.234375 -0.21875 -0.234375 -0.578125q0 -0.359375 0.234375 -0.578125q0.25 -0.234375 0.828125 -0.234375l2.125 0.015625q0.578125 0 0.828125 0.21875q0.25 0.21875 0.25 0.578125q0 0.296875 -0.203125 0.515625q-0.1875 0.21875 -0.5625 0.28125l-0.921875 7.875l-1.765625 0l-1.53125 -4.546875zm10.1640625 -5.59375l0 1.703125l-1.90625 0l0 -1.703125l1.90625 0zm0.21875 3.046875l0 5.484375l1.921875 0q0.578125 0 0.828125 0.234375q0.25 0.21875 0.25 0.578125q0 0.34375 -0.25 0.578125q-0.25 0.21875 -0.828125 0.21875l-5.4375 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.234375 -0.25 -0.59375q0 -0.34375 0.25 -0.5625q0.25 -0.234375 0.828125 -0.234375l1.921875 0l0 -3.890625l-1.296875 0q-0.5625 0 -0.8125 -0.21875q-0.25 -0.21875 -0.25 -0.578125q0 -0.359375 0.234375 -0.578125q0.25 -0.21875 0.828125 -0.21875l2.890625 0zm7.1953125 0l0 0.53125q0.4375 -0.375 0.953125 -0.5625q0.53125 -0.1875 1.15625 -0.1875q1.421875 0 2.25 0.890625q0.65625 0.703125 0.65625 1.84375l0 2.96875q0.5 0 0.734375 0.234375q0.25 0.21875 0.25 0.578125q0 0.34375 -0.25 0.578125q-0.234375 0.21875 -0.8125 0.21875l-1.453125 0q-0.578125 0 -0.828125 -0.21875q-0.234375 -0.234375 -0.234375 -0.59375q0 -0.34375 0.234375 -0.5625q0.25 -0.234375 0.75 -0.234375l0 -3.015625q0 -0.53125 -0.28125 -0.765625q-0.359375 -0.3125 -1.09375 -0.3125q-0.5625 0 -0.984375 0.21875q-0.40625 0.203125 -1.046875 0.90625l0 2.96875q0.609375 0 0.796875 0.125q0.375 0.234375 0.375 0.6875q0 0.34375 -0.25 0.578125q-0.234375 0.21875 -0.8125 0.21875l-1.828125 0q-0.578125 0 -0.828125 -0.21875q-0.234375 -0.234375 -0.234375 -0.59375q0 -0.4375 0.375 -0.671875q0.1875 -0.125 0.796875 -0.125l0 -3.890625q-0.5 0 -0.75 -0.21875q-0.234375 -0.234375 -0.234375 -0.578125q0 -0.359375 0.234375 -0.578125q0.25 -0.21875 0.828125 -0.21875l1.53125 0zm14.8984375 -3.046875l0 8.53125l0.265625 0q0.578125 0 0.828125 0.234375q0.25 0.21875 0.25 0.578125q0 0.34375 -0.25 0.578125q-0.25 0.21875 -0.828125 0.21875l-1.875 0l0 -0.390625q-0.546875 0.3125 -1.140625 0.484375q-0.59375 0.171875 -1.234375 0.171875q-1.8125 0 -2.921875 -1.046875q-1.09375 -1.046875 -1.09375 -2.609375q0 -1.625 1.15625 -2.765625q1.15625 -1.15625 2.828125 -1.15625q0.625 0 1.21875 0.203125q0.609375 0.1875 1.1875 0.5625l0 -1.984375l-0.265625 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.234375 -0.25 -0.578125q0 -0.359375 0.25 -0.578125q0.25 -0.234375 0.828125 -0.234375l1.875 0zm-1.609375 6.796875q0 -0.984375 -0.703125 -1.671875q-0.6875 -0.6875 -1.6875 -0.6875q-1.0 0 -1.703125 0.6875q-0.6875 0.6875 -0.6875 1.65625q0 0.875 0.625 1.453125q0.625 0.5625 1.765625 0.5625q1.125 0 1.75 -0.5625q0.640625 -0.578125 0.640625 -1.4375zm11.6953125 -0.078125q0 0.921875 -0.515625 1.796875q-0.515625 0.859375 -1.53125 1.375q-1.0 0.515625 -2.109375 0.515625q-1.09375 0 -2.09375 -0.5q-1.0 -0.515625 -1.53125 -1.375q-0.515625 -0.875 -0.515625 -1.828125q0 -0.953125 0.53125 -1.875q0.53125 -0.9375 1.53125 -1.46875q1.0 -0.53125 2.078125 -0.53125q1.09375 0 2.109375 0.546875q1.015625 0.546875 1.53125 1.46875q0.515625 0.90625 0.515625 1.875zm-1.609375 0.015625q0 -0.78125 -0.546875 -1.421875q-0.765625 -0.875 -2.0 -0.875q-1.078125 0 -1.8125 0.703125q-0.71875 0.6875 -0.71875 1.59375q0 0.75 0.734375 1.40625q0.734375 0.65625 1.796875 0.65625q1.078125 0 1.8125 -0.65625q0.734375 -0.65625 0.734375 -1.40625zm7.0546875 0.453125l-1.109375 2.953125l-1.5 0l-1.34375 -5.5q-0.4375 -0.015625 -0.671875 -0.234375q-0.21875 -0.234375 -0.21875 -0.5625q0 -0.359375 0.25 -0.578125q0.25 -0.21875 0.828125 -0.21875l1.484375 0q0.578125 0 0.828125 0.21875q0.25 0.21875 0.25 0.578125q0 0.359375 -0.28125 0.609375q-0.21875 0.1875 -0.828125 0.1875l0.609375 2.546875l0.984375 -2.609375l1.421875 0l1.0 2.609375l0.625 -2.546875q-0.59375 0 -0.78125 -0.109375q-0.375 -0.25 -0.375 -0.6875q0 -0.359375 0.25 -0.578125q0.25 -0.21875 0.828125 -0.21875l1.5 0q0.578125 0 0.828125 0.21875q0.25 0.21875 0.25 0.578125q0 0.328125 -0.21875 0.546875q-0.21875 0.21875 -0.640625 0.25l-1.3125 5.5l-1.484375 0l-1.171875 -2.953125zm11.3203125 -2.265625q-0.390625 -0.25 -0.828125 -0.359375q-0.421875 -0.125 -0.890625 -0.125q-0.921875 0 -1.46875 0.296875q-0.25 0.140625 -0.25 0.296875q0 0.171875 0.328125 0.34375q0.25 0.125 1.125 0.25q1.59375 0.21875 2.21875 0.4375q0.8125 0.28125 1.25 0.859375q0.453125 0.5625 0.453125 1.203125q0 0.859375 -0.75 1.4375q-1.09375 0.84375 -2.828125 0.84375q-0.6875 0 -1.28125 -0.125q-0.59375 -0.125 -1.078125 -0.359375q-0.125 0.09375 -0.265625 0.15625q-0.125 0.046875 -0.265625 0.046875q-0.375 0 -0.59375 -0.234375q-0.21875 -0.25 -0.21875 -0.828125l0 -0.546875q0 -0.578125 0.21875 -0.8125q0.21875 -0.25 0.578125 -0.25q0.296875 0 0.484375 0.15625q0.203125 0.15625 0.3125 0.546875q0.359375 0.3125 0.875 0.484375q0.515625 0.15625 1.1875 0.15625q1.109375 0 1.71875 -0.34375q0.28125 -0.171875 0.28125 -0.359375q0 -0.3125 -0.40625 -0.515625q-0.421875 -0.203125 -1.71875 -0.34375q-1.921875 -0.203125 -2.578125 -0.78125q-0.640625 -0.578125 -0.640625 -1.40625q0 -0.859375 0.71875 -1.4375q0.984375 -0.78125 2.578125 -0.78125q0.5625 0 1.0625 0.109375q0.515625 0.109375 0.984375 0.328125q0.15625 -0.109375 0.28125 -0.15625q0.125 -0.0625 0.234375 -0.0625q0.328125 0 0.546875 0.25q0.21875 0.234375 0.21875 0.8125l0 0.390625q0 0.53125 -0.125 0.71875q-0.25 0.359375 -0.671875 0.359375q-0.296875 0 -0.515625 -0.171875q-0.21875 -0.1875 -0.28125 -0.484375zm6.9453125 1.96875l0 1.640625l1.625 0q0.578125 0 0.8125 0.234375q0.25 0.21875 0.25 0.578125q0 0.34375 -0.25 0.578125q-0.234375 0.21875 -0.8125 0.21875l-3.46875 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.234375 -0.25 -0.59375q0 -0.34375 0.25 -0.5625q0.25 -0.234375 0.828125 -0.234375l0.25 0l0 -6.265625l-0.25 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.21875 -0.25 -0.578125q0 -0.359375 0.25 -0.578125q0.25 -0.234375 0.828125 -0.234375l3.6875 0.015625q1.625 0 2.5625 0.890625q0.953125 0.875 0.953125 2.15625q0 0.703125 -0.3125 1.328125q-0.25 0.46875 -0.8125 0.921875q-0.5625 0.453125 -1.15625 0.6875q-0.59375 0.234375 -1.5625 0.234375l-1.515625 0zm0 -1.609375l1.484375 0q1.046875 0 1.65625 -0.46875q0.625 -0.46875 0.625 -1.140625q0 -0.5625 -0.5 -0.984375q-0.5 -0.421875 -1.421875 -0.421875l-1.84375 0l0 3.015625zm11.9765625 4.859375l0 -0.375q-0.609375 0.3125 -1.34375 0.46875q-0.71875 0.171875 -1.3125 0.171875q-1.28125 0 -2.09375 -0.6875q-0.796875 -0.6875 -0.796875 -1.515625q0 -1.0 1.015625 -1.859375q1.03125 -0.875 2.84375 -0.875q0.734375 0 1.6875 0.15625l0 -0.375q0 -0.359375 -0.3125 -0.578125q-0.3125 -0.234375 -1.171875 -0.234375q-0.71875 0 -1.84375 0.28125q-0.421875 0.09375 -0.65625 0.09375q-0.328125 0 -0.546875 -0.21875q-0.21875 -0.234375 -0.21875 -0.59375q0 -0.203125 0.078125 -0.34375q0.078125 -0.15625 0.21875 -0.25q0.140625 -0.09375 0.578125 -0.21875q0.59375 -0.15625 1.203125 -0.25q0.625 -0.109375 1.125 -0.109375q1.5 0 2.3125 0.65625q0.828125 0.640625 0.828125 1.75l0 3.296875l0.28125 0q0.578125 0 0.8125 0.234375q0.25 0.21875 0.25 0.578125q0 0.34375 -0.25 0.578125q-0.234375 0.21875 -0.8125 0.21875l-1.875 0zm0 -2.875q-0.96875 -0.1875 -1.78125 -0.1875q-0.96875 0 -1.671875 0.484375q-0.4375 0.296875 -0.4375 0.609375q0 0.234375 0.203125 0.375q0.390625 0.25 1.078125 0.25q0.578125 0 1.296875 -0.21875q0.734375 -0.234375 1.3125 -0.625l0 -0.6875zm7.7578125 -2.625l0 3.21875q0 0.515625 0.21875 0.671875q0.328125 0.265625 1.171875 0.265625q1.21875 0 2.265625 -0.53125q0.390625 -0.203125 0.625 -0.203125q0.3125 0 0.53125 0.234375q0.234375 0.234375 0.234375 0.578125q0 0.3125 -0.25 0.53125q-0.375 0.375 -1.515625 0.6875q-1.125 0.3125 -1.890625 0.3125q-1.5 0 -2.25 -0.640625q-0.734375 -0.65625 -0.734375 -1.59375l0 -3.53125l-0.578125 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.21875 -0.25 -0.578125q0 -0.359375 0.25 -0.578125q0.25 -0.21875 0.828125 -0.21875l0.578125 0l0 -1.453125q0 -0.578125 0.21875 -0.8125q0.21875 -0.25 0.578125 -0.25q0.359375 0 0.578125 0.25q0.21875 0.234375 0.21875 0.8125l0 1.453125l2.96875 0q0.578125 0 0.8125 0.21875q0.25 0.21875 0.25 0.578125q0 0.359375 -0.25 0.578125q-0.234375 0.21875 -0.8125 0.21875l-2.96875 0zm8.3515625 -4.640625l0 3.421875q0.5 -0.296875 1.0 -0.4375q0.515625 -0.15625 1.046875 -0.15625q0.828125 0 1.46875 0.28125q0.65625 0.28125 1.078125 0.890625q0.421875 0.609375 0.421875 1.53125l0 3.0q0.609375 0 0.796875 0.125q0.375 0.234375 0.375 0.6875q0 0.34375 -0.25 0.578125q-0.234375 0.21875 -0.8125 0.21875l-1.828125 0q-0.5625 0 -0.8125 -0.21875q-0.25 -0.234375 -0.25 -0.59375q0 -0.4375 0.375 -0.671875q0.203125 -0.125 0.796875 -0.125l0 -2.890625q0 -0.625 -0.28125 -0.875q-0.359375 -0.328125 -1.078125 -0.328125q-0.53125 0 -0.953125 0.203125q-0.40625 0.203125 -1.09375 0.890625l0 3.0q0.609375 0 0.796875 0.125q0.375 0.234375 0.375 0.6875q0 0.34375 -0.25 0.578125q-0.234375 0.21875 -0.8125 0.21875l-1.828125 0q-0.578125 0 -0.828125 -0.21875q-0.234375 -0.234375 -0.234375 -0.59375q0 -0.4375 0.375 -0.671875q0.1875 -0.125 0.796875 -0.125l0 -6.921875l-0.265625 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.234375 -0.25 -0.59375q0 -0.34375 0.25 -0.5625q0.25 -0.234375 0.828125 -0.234375l1.875 0z" fill-rule="nonzero"></path><path fill="#ffffff" d="m176.0 271.46457l187.43307 0l0 80.53543l-187.43307 0z" fill-rule="nonzero"></path><path stroke="#000000" stroke-width="1.0" stroke-linejoin="round" stroke-linecap="butt" d="m176.0 271.46457l187.43307 0l0 80.53543l-187.43307 0z" fill-rule="nonzero"></path><path fill="#000000" d="m254.3884 314.3423l0 1.640625l1.625 0q0.578125 0 0.8125 0.234375q0.25 0.21875 0.25 0.578125q0 0.34375 -0.25 0.578125q-0.234375 0.21875 -0.8125 0.21875l-3.46875 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.234375 -0.25 -0.59375q0 -0.34375 0.25 -0.5625q0.25 -0.234375 0.828125 -0.234375l0.25 0l0 -6.265625l-0.25 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.21875 -0.25 -0.578125q0 -0.359375 0.25 -0.578125q0.25 -0.234375 0.828125 -0.234375l3.6875 0.015625q1.625 0 2.5625 0.890625q0.953125 0.875 0.953125 2.15625q0 0.703125 -0.3125 1.328125q-0.25 0.46875 -0.8125 0.921875q-0.5625 0.453125 -1.15625 0.6875q-0.59375 0.234375 -1.5625 0.234375l-1.515625 0zm0 -1.609375l1.484375 0q1.046875 0 1.65625 -0.46875q0.625 -0.46875 0.625 -1.140625q0 -0.5625 -0.5 -0.984375q-0.5 -0.421875 -1.421875 -0.421875l-1.84375 0l0 3.015625zm11.9765625 4.859375l0 -0.375q-0.609375 0.3125 -1.34375 0.46875q-0.71875 0.171875 -1.3125 0.171875q-1.28125 0 -2.09375 -0.6875q-0.796875 -0.6875 -0.796875 -1.515625q0 -1.0 1.015625 -1.859375q1.03125 -0.875 2.84375 -0.875q0.734375 0 1.6875 0.15625l0 -0.375q0 -0.359375 -0.3125 -0.578125q-0.3125 -0.234375 -1.171875 -0.234375q-0.71875 0 -1.84375 0.28125q-0.421875 0.09375 -0.65625 0.09375q-0.328125 0 -0.546875 -0.21875q-0.21875 -0.234375 -0.21875 -0.59375q0 -0.203125 0.078125 -0.34375q0.078125 -0.15625 0.21875 -0.25q0.140625 -0.09375 0.578125 -0.21875q0.59375 -0.15625 1.203125 -0.25q0.625 -0.109375 1.125 -0.109375q1.5 0 2.3125 0.65625q0.828125 0.640625 0.828125 1.75l0 3.296875l0.28125 0q0.578125 0 0.8125 0.234375q0.25 0.21875 0.25 0.578125q0 0.34375 -0.25 0.578125q-0.234375 0.21875 -0.8125 0.21875l-1.875 0zm0 -2.875q-0.96875 -0.1875 -1.78125 -0.1875q-0.96875 0 -1.671875 0.484375q-0.4375 0.296875 -0.4375 0.609375q0 0.234375 0.203125 0.375q0.390625 0.25 1.078125 0.25q0.578125 0 1.296875 -0.21875q0.734375 -0.234375 1.3125 -0.625l0 -0.6875zm7.7578125 -2.625l0 3.21875q0 0.515625 0.21875 0.671875q0.328125 0.265625 1.171875 0.265625q1.21875 0 2.265625 -0.53125q0.390625 -0.203125 0.625 -0.203125q0.3125 0 0.53125 0.234375q0.234375 0.234375 0.234375 0.578125q0 0.3125 -0.25 0.53125q-0.375 0.375 -1.515625 0.6875q-1.125 0.3125 -1.890625 0.3125q-1.5 0 -2.25 -0.640625q-0.734375 -0.65625 -0.734375 -1.59375l0 -3.53125l-0.578125 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.21875 -0.25 -0.578125q0 -0.359375 0.25 -0.578125q0.25 -0.21875 0.828125 -0.21875l0.578125 0l0 -1.453125q0 -0.578125 0.21875 -0.8125q0.21875 -0.25 0.578125 -0.25q0.359375 0 0.578125 0.25q0.21875 0.234375 0.21875 0.8125l0 1.453125l2.96875 0q0.578125 0 0.8125 0.21875q0.25 0.21875 0.25 0.578125q0 0.359375 -0.25 0.578125q-0.234375 0.21875 -0.8125 0.21875l-2.96875 0zm8.3515625 -4.640625l0 3.421875q0.5 -0.296875 1.0 -0.4375q0.515625 -0.15625 1.046875 -0.15625q0.828125 0 1.46875 0.28125q0.65625 0.28125 1.078125 0.890625q0.421875 0.609375 0.421875 1.53125l0 3.0q0.609375 0 0.796875 0.125q0.375 0.234375 0.375 0.6875q0 0.34375 -0.25 0.578125q-0.234375 0.21875 -0.8125 0.21875l-1.828125 0q-0.5625 0 -0.8125 -0.21875q-0.25 -0.234375 -0.25 -0.59375q0 -0.4375 0.375 -0.671875q0.203125 -0.125 0.796875 -0.125l0 -2.890625q0 -0.625 -0.28125 -0.875q-0.359375 -0.328125 -1.078125 -0.328125q-0.53125 0 -0.953125 0.203125q-0.40625 0.203125 -1.09375 0.890625l0 3.0q0.609375 0 0.796875 0.125q0.375 0.234375 0.375 0.6875q0 0.34375 -0.25 0.578125q-0.234375 0.21875 -0.8125 0.21875l-1.828125 0q-0.578125 0 -0.828125 -0.21875q-0.234375 -0.234375 -0.234375 -0.59375q0 -0.4375 0.375 -0.671875q0.1875 -0.125 0.796875 -0.125l0 -6.921875l-0.265625 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.234375 -0.25 -0.59375q0 -0.34375 0.25 -0.5625q0.25 -0.234375 0.828125 -0.234375l1.875 0z" fill-rule="nonzero"></path><path fill="#ffffff" d="m16.0 400.0l187.43306 0l0 80.53543l-187.43306 0z" fill-rule="nonzero"></path><path stroke="#000000" stroke-width="1.0" stroke-linejoin="round" stroke-linecap="butt" d="m16.0 400.0l187.43306 0l0 80.53543l-187.43306 0z" fill-rule="nonzero"></path><path fill="#000000" d="m70.3845 442.87772l0 1.640625l1.625 0q0.578125 0 0.8125 0.234375q0.25 0.21875 0.25 0.578125q0 0.34375 -0.25 0.578125q-0.234375 0.21875 -0.8125 0.21875l-3.46875 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.234375 -0.25 -0.59375q0 -0.34375 0.25 -0.5625q0.25 -0.234375 0.828125 -0.234375l0.25 0l0 -6.265625l-0.25 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.21875 -0.25 -0.578125q0 -0.359375 0.25 -0.578125q0.25 -0.234375 0.828125 -0.234375l3.6875 0.015625q1.625 0 2.5625 0.890625q0.953125 0.875 0.953125 2.15625q0 0.703125 -0.3125 1.328125q-0.25 0.46875 -0.8125 0.921875q-0.5625 0.453125 -1.15625 0.6875q-0.59375 0.234375 -1.5625 0.234375l-1.515625 0zm0 -1.609375l1.484375 0q1.046875 0 1.65625 -0.46875q0.625 -0.46875 0.625 -1.140625q0 -0.5625 -0.5 -0.984375q-0.5 -0.421875 -1.421875 -0.421875l-1.84375 0l0 3.015625zm14.6953125 1.4375q0 0.921875 -0.515625 1.796875q-0.515625 0.859375 -1.53125 1.375q-1.0 0.515625 -2.109375 0.515625q-1.09375 0 -2.09375 -0.5q-1.0 -0.515625 -1.53125 -1.375q-0.515625 -0.875 -0.515625 -1.828125q0 -0.953125 0.53125 -1.875q0.53125 -0.9375 1.53125 -1.46875q1.0 -0.53125 2.078125 -0.53125q1.09375 0 2.109375 0.546875q1.015625 0.546875 1.53125 1.46875q0.515625 0.90625 0.515625 1.875zm-1.609375 0.015625q0 -0.78125 -0.546875 -1.421875q-0.765625 -0.875 -2.0 -0.875q-1.078125 0 -1.8125 0.703125q-0.71875 0.6875 -0.71875 1.59375q0 0.75 0.734375 1.40625q0.734375 0.65625 1.796875 0.65625q1.078125 0 1.8125 -0.65625q0.734375 -0.65625 0.734375 -1.40625zm8.7734375 -1.8125q-0.390625 -0.25 -0.828125 -0.359375q-0.421875 -0.125 -0.890625 -0.125q-0.921875 0 -1.46875 0.296875q-0.25 0.140625 -0.25 0.296875q0 0.171875 0.328125 0.34375q0.25 0.125 1.125 0.25q1.59375 0.21875 2.21875 0.4375q0.8125 0.28125 1.25 0.859375q0.453125 0.5625 0.453125 1.203125q0 0.859375 -0.75 1.4375q-1.09375 0.84375 -2.828125 0.84375q-0.6875 0 -1.28125 -0.125q-0.59375 -0.125 -1.078125 -0.359375q-0.125 0.09375 -0.265625 0.15625q-0.125 0.046875 -0.265625 0.046875q-0.375 0 -0.59375 -0.234375q-0.21875 -0.25 -0.21875 -0.828125l0 -0.546875q0 -0.578125 0.21875 -0.8125q0.21875 -0.25 0.578125 -0.25q0.296875 0 0.484375 0.15625q0.203125 0.15625 0.3125 0.546875q0.359375 0.3125 0.875 0.484375q0.515625 0.15625 1.1875 0.15625q1.109375 0 1.71875 -0.34375q0.28125 -0.171875 0.28125 -0.359375q0 -0.3125 -0.40625 -0.515625q-0.421875 -0.203125 -1.71875 -0.34375q-1.921875 -0.203125 -2.578125 -0.78125q-0.640625 -0.578125 -0.640625 -1.40625q0 -0.859375 0.71875 -1.4375q0.984375 -0.78125 2.578125 -0.78125q0.5625 0 1.0625 0.109375q0.515625 0.109375 0.984375 0.328125q0.15625 -0.109375 0.28125 -0.15625q0.125 -0.0625 0.234375 -0.0625q0.328125 0 0.546875 0.25q0.21875 0.234375 0.21875 0.8125l0 0.390625q0 0.53125 -0.125 0.71875q-0.25 0.359375 -0.671875 0.359375q-0.296875 0 -0.515625 -0.171875q-0.21875 -0.1875 -0.28125 -0.484375zm8.4453125 -4.921875l0 1.703125l-1.90625 0l0 -1.703125l1.90625 0zm0.21875 3.046875l0 5.484375l1.921875 0q0.578125 0 0.828125 0.234375q0.25 0.21875 0.25 0.578125q0 0.34375 -0.25 0.578125q-0.25 0.21875 -0.828125 0.21875l-5.4375 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.234375 -0.25 -0.59375q0 -0.34375 0.25 -0.5625q0.25 -0.234375 0.828125 -0.234375l1.921875 0l0 -3.890625l-1.296875 0q-0.5625 0 -0.8125 -0.21875q-0.25 -0.21875 -0.25 -0.578125q0 -0.359375 0.234375 -0.578125q0.25 -0.21875 0.828125 -0.21875l2.890625 0zm10.0078125 3.40625l2.4375 2.078125q0.4375 0.03125 0.65625 0.25q0.21875 0.21875 0.21875 0.5625q0 0.34375 -0.25 0.578125q-0.25 0.21875 -0.828125 0.21875l-1.8125 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.234375 -0.25 -0.59375q0 -0.28125 0.171875 -0.5q0.1875 -0.21875 0.484375 -0.296875l-1.1875 -1.03125l-1.21875 1.03125q0.359375 0.09375 0.515625 0.296875q0.171875 0.1875 0.171875 0.5q0 0.359375 -0.25 0.59375q-0.234375 0.21875 -0.8125 0.21875l-1.8125 0q-0.578125 0 -0.828125 -0.21875q-0.234375 -0.234375 -0.234375 -0.59375q0 -0.328125 0.21875 -0.546875q0.21875 -0.21875 0.65625 -0.25l2.375 -2.09375l-2.109375 -1.796875q-0.40625 -0.03125 -0.625 -0.25q-0.21875 -0.21875 -0.21875 -0.546875q0 -0.359375 0.25 -0.578125q0.25 -0.21875 0.828125 -0.21875l1.5 0q0.578125 0 0.8125 0.21875q0.25 0.21875 0.25 0.5625q0 0.46875 -0.4375 0.75l0.96875 0.8125l0.953125 -0.828125q-0.421875 -0.296875 -0.421875 -0.703125q0 -0.375 0.234375 -0.59375q0.25 -0.21875 0.828125 -0.21875l1.484375 0q0.578125 0 0.828125 0.21875q0.25 0.21875 0.25 0.578125q0 0.328125 -0.21875 0.546875q-0.21875 0.21875 -0.640625 0.25l-2.109375 1.8125zm7.4765625 0.4375l0 1.640625l1.625 0q0.578125 0 0.8125 0.234375q0.25 0.21875 0.25 0.578125q0 0.34375 -0.25 0.578125q-0.234375 0.21875 -0.8125 0.21875l-3.46875 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.234375 -0.25 -0.59375q0 -0.34375 0.25 -0.5625q0.25 -0.234375 0.828125 -0.234375l0.25 0l0 -6.265625l-0.25 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.21875 -0.25 -0.578125q0 -0.359375 0.25 -0.578125q0.25 -0.234375 0.828125 -0.234375l3.6875 0.015625q1.625 0 2.5625 0.890625q0.953125 0.875 0.953125 2.15625q0 0.703125 -0.3125 1.328125q-0.25 0.46875 -0.8125 0.921875q-0.5625 0.453125 -1.15625 0.6875q-0.59375 0.234375 -1.5625 0.234375l-1.515625 0zm0 -1.609375l1.484375 0q1.046875 0 1.65625 -0.46875q0.625 -0.46875 0.625 -1.140625q0 -0.5625 -0.5 -0.984375q-0.5 -0.421875 -1.421875 -0.421875l-1.84375 0l0 3.015625zm11.976555 4.859375l0 -0.375q-0.609375 0.3125 -1.34375 0.46875q-0.71875 0.171875 -1.3124924 0.171875q-1.28125 0 -2.09375 -0.6875q-0.796875 -0.6875 -0.796875 -1.515625q0 -1.0 1.015625 -1.859375q1.03125 -0.875 2.8437424 -0.875q0.734375 0 1.6875 0.15625l0 -0.375q0 -0.359375 -0.3125 -0.578125q-0.3125 -0.234375 -1.171875 -0.234375q-0.71875 0 -1.8437424 0.28125q-0.421875 0.09375 -0.65625 0.09375q-0.328125 0 -0.546875 -0.21875q-0.21875 -0.234375 -0.21875 -0.59375q0 -0.203125 0.078125 -0.34375q0.078125 -0.15625 0.21875 -0.25q0.140625 -0.09375 0.578125 -0.21875q0.59375 -0.15625 1.203125 -0.25q0.6249924 -0.109375 1.1249924 -0.109375q1.5 0 2.3125 0.65625q0.828125 0.640625 0.828125 1.75l0 3.296875l0.28125 0q0.578125 0 0.8125 0.234375q0.25 0.21875 0.25 0.578125q0 0.34375 -0.25 0.578125q-0.234375 0.21875 -0.8125 0.21875l-1.875 0zm0 -2.875q-0.96875 -0.1875 -1.78125 -0.1875q-0.9687424 0 -1.6718674 0.484375q-0.4375 0.296875 -0.4375 0.609375q0 0.234375 0.203125 0.375q0.390625 0.25 1.078125 0.25q0.5781174 0 1.2968674 -0.21875q0.734375 -0.234375 1.3125 -0.625l0 -0.6875zm7.7578125 -2.625l0 3.21875q0 0.515625 0.21875 0.671875q0.328125 0.265625 1.171875 0.265625q1.21875 0 2.265625 -0.53125q0.390625 -0.203125 0.625 -0.203125q0.3125 0 0.53125 0.234375q0.234375 0.234375 0.234375 0.578125q0 0.3125 -0.25 0.53125q-0.375 0.375 -1.515625 0.6875q-1.125 0.3125 -1.890625 0.3125q-1.5 0 -2.25 -0.640625q-0.734375 -0.65625 -0.734375 -1.59375l0 -3.53125l-0.578125 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.21875 -0.25 -0.578125q0 -0.359375 0.25 -0.578125q0.25 -0.21875 0.828125 -0.21875l0.578125 0l0 -1.453125q0 -0.578125 0.21875 -0.8125q0.21875 -0.25 0.578125 -0.25q0.359375 0 0.578125 0.25q0.21875 0.234375 0.21875 0.8125l0 1.453125l2.96875 0q0.578125 0 0.8125 0.21875q0.25 0.21875 0.25 0.578125q0 0.359375 -0.25 0.578125q-0.234375 0.21875 -0.8125 0.21875l-2.96875 0zm8.3515625 -4.640625l0 3.421875q0.5 -0.296875 1.0 -0.4375q0.515625 -0.15625 1.046875 -0.15625q0.828125 0 1.46875 0.28125q0.65625 0.28125 1.078125 0.890625q0.421875 0.609375 0.421875 1.53125l0 3.0q0.609375 0 0.796875 0.125q0.375 0.234375 0.375 0.6875q0 0.34375 -0.25 0.578125q-0.234375 0.21875 -0.8125 0.21875l-1.828125 0q-0.5625 0 -0.8125 -0.21875q-0.25 -0.234375 -0.25 -0.59375q0 -0.4375 0.375 -0.671875q0.203125 -0.125 0.796875 -0.125l0 -2.890625q0 -0.625 -0.28125 -0.875q-0.359375 -0.328125 -1.078125 -0.328125q-0.53125 0 -0.953125 0.203125q-0.40625 0.203125 -1.09375 0.890625l0 3.0q0.609375 0 0.796875 0.125q0.375 0.234375 0.375 0.6875q0 0.34375 -0.25 0.578125q-0.234375 0.21875 -0.8125 0.21875l-1.828125 0q-0.578125 0 -0.828125 -0.21875q-0.234375 -0.234375 -0.234375 -0.59375q0 -0.4375 0.375 -0.671875q0.1875 -0.125 0.796875 -0.125l0 -6.921875l-0.265625 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.234375 -0.25 -0.59375q0 -0.34375 0.25 -0.5625q0.25 -0.234375 0.828125 -0.234375l1.875 0z" fill-rule="nonzero"></path><path fill="#ffffff" d="m336.0 400.0l187.43304 0l0 80.53543l-187.43304 0z" fill-rule="nonzero"></path><path stroke="#000000" stroke-width="1.0" stroke-linejoin="round" stroke-linecap="butt" d="m336.0 400.0l187.43304 0l0 80.53543l-187.43304 0z" fill-rule="nonzero"></path><path fill="#000000" d="m381.72043 441.58084l-1.484375 4.546875l-1.796875 0l-0.953125 -7.875q-0.375 -0.046875 -0.5625 -0.25q-0.1875 -0.203125 -0.1875 -0.53125q0 -0.375 0.25 -0.59375q0.25 -0.234375 0.828125 -0.234375l2.125 0.015625q0.578125 0 0.828125 0.21875q0.25 0.21875 0.25 0.578125q0 0.359375 -0.25 0.578125q-0.25 0.21875 -0.828125 0.21875l-0.828125 0l0.53125 4.484375l1.25 -3.734375l1.671875 0l1.25 3.734375l0.53125 -4.484375l-0.84375 0q-0.578125 0 -0.828125 -0.21875q-0.234375 -0.21875 -0.234375 -0.578125q0 -0.359375 0.234375 -0.578125q0.25 -0.234375 0.828125 -0.234375l2.125 0.015625q0.578125 0 0.828125 0.21875q0.25 0.21875 0.25 0.578125q0 0.296875 -0.203125 0.515625q-0.1875 0.21875 -0.5625 0.28125l-0.921875 7.875l-1.765625 0l-1.53125 -4.546875zm10.1640625 -5.59375l0 1.703125l-1.90625 0l0 -1.703125l1.90625 0zm0.21875 3.046875l0 5.484375l1.921875 0q0.578125 0 0.828125 0.234375q0.25 0.21875 0.25 0.578125q0 0.34375 -0.25 0.578125q-0.25 0.21875 -0.828125 0.21875l-5.4375 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.234375 -0.25 -0.59375q0 -0.34375 0.25 -0.5625q0.25 -0.234375 0.828125 -0.234375l1.921875 0l0 -3.890625l-1.296875 0q-0.5625 0 -0.8125 -0.21875q-0.25 -0.21875 -0.25 -0.578125q0 -0.359375 0.234375 -0.578125q0.25 -0.21875 0.828125 -0.21875l2.890625 0zm7.1953125 0l0 0.53125q0.4375 -0.375 0.953125 -0.5625q0.53125 -0.1875 1.15625 -0.1875q1.421875 0 2.25 0.890625q0.65625 0.703125 0.65625 1.84375l0 2.96875q0.5 0 0.734375 0.234375q0.25 0.21875 0.25 0.578125q0 0.34375 -0.25 0.578125q-0.234375 0.21875 -0.8125 0.21875l-1.453125 0q-0.578125 0 -0.828125 -0.21875q-0.234375 -0.234375 -0.234375 -0.59375q0 -0.34375 0.234375 -0.5625q0.25 -0.234375 0.75 -0.234375l0 -3.015625q0 -0.53125 -0.28125 -0.765625q-0.359375 -0.3125 -1.09375 -0.3125q-0.5625 0 -0.984375 0.21875q-0.40625 0.203125 -1.046875 0.90625l0 2.96875q0.609375 0 0.796875 0.125q0.375 0.234375 0.375 0.6875q0 0.34375 -0.25 0.578125q-0.234375 0.21875 -0.8125 0.21875l-1.828125 0q-0.578125 0 -0.828125 -0.21875q-0.234375 -0.234375 -0.234375 -0.59375q0 -0.4375 0.375 -0.671875q0.1875 -0.125 0.796875 -0.125l0 -3.890625q-0.5 0 -0.75 -0.21875q-0.234375 -0.234375 -0.234375 -0.578125q0 -0.359375 0.234375 -0.578125q0.25 -0.21875 0.828125 -0.21875l1.53125 0zm14.8984375 -3.046875l0 8.53125l0.265625 0q0.578125 0 0.828125 0.234375q0.25 0.21875 0.25 0.578125q0 0.34375 -0.25 0.578125q-0.25 0.21875 -0.828125 0.21875l-1.875 0l0 -0.390625q-0.546875 0.3125 -1.140625 0.484375q-0.59375 0.171875 -1.234375 0.171875q-1.8125 0 -2.921875 -1.046875q-1.09375 -1.046875 -1.09375 -2.609375q0 -1.625 1.15625 -2.765625q1.15625 -1.15625 2.828125 -1.15625q0.625 0 1.21875 0.203125q0.609375 0.1875 1.1875 0.5625l0 -1.984375l-0.265625 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.234375 -0.25 -0.578125q0 -0.359375 0.25 -0.578125q0.25 -0.234375 0.828125 -0.234375l1.875 0zm-1.609375 6.796875q0 -0.984375 -0.703125 -1.671875q-0.6875 -0.6875 -1.6875 -0.6875q-1.0 0 -1.703125 0.6875q-0.6875 0.6875 -0.6875 1.65625q0 0.875 0.625 1.453125q0.625 0.5625 1.765625 0.5625q1.125 0 1.75 -0.5625q0.640625 -0.578125 0.640625 -1.4375zm11.6953125 -0.078125q0 0.921875 -0.515625 1.796875q-0.515625 0.859375 -1.53125 1.375q-1.0 0.515625 -2.109375 0.515625q-1.09375 0 -2.09375 -0.5q-1.0 -0.515625 -1.53125 -1.375q-0.515625 -0.875 -0.515625 -1.828125q0 -0.953125 0.53125 -1.875q0.53125 -0.9375 1.53125 -1.46875q1.0 -0.53125 2.078125 -0.53125q1.09375 0 2.109375 0.546875q1.015625 0.546875 1.53125 1.46875q0.515625 0.90625 0.515625 1.875zm-1.609375 0.015625q0 -0.78125 -0.546875 -1.421875q-0.765625 -0.875 -2.0 -0.875q-1.078125 0 -1.8125 0.703125q-0.71875 0.6875 -0.71875 1.59375q0 0.75 0.734375 1.40625q0.734375 0.65625 1.796875 0.65625q1.078125 0 1.8125 -0.65625q0.734375 -0.65625 0.734375 -1.40625zm7.0546875 0.453125l-1.109375 2.953125l-1.5 0l-1.34375 -5.5q-0.4375 -0.015625 -0.671875 -0.234375q-0.21875 -0.234375 -0.21875 -0.5625q0 -0.359375 0.25 -0.578125q0.25 -0.21875 0.828125 -0.21875l1.484375 0q0.578125 0 0.828125 0.21875q0.25 0.21875 0.25 0.578125q0 0.359375 -0.28125 0.609375q-0.21875 0.1875 -0.828125 0.1875l0.609375 2.546875l0.984375 -2.609375l1.421875 0l1.0 2.609375l0.625 -2.546875q-0.59375 0 -0.78125 -0.109375q-0.375 -0.25 -0.375 -0.6875q0 -0.359375 0.25 -0.578125q0.25 -0.21875 0.828125 -0.21875l1.5 0q0.578125 0 0.828125 0.21875q0.25 0.21875 0.25 0.578125q0 0.328125 -0.21875 0.546875q-0.21875 0.21875 -0.640625 0.25l-1.3125 5.5l-1.484375 0l-1.171875 -2.953125zm11.3203125 -2.265625q-0.390625 -0.25 -0.828125 -0.359375q-0.421875 -0.125 -0.890625 -0.125q-0.921875 0 -1.46875 0.296875q-0.25 0.140625 -0.25 0.296875q0 0.171875 0.328125 0.34375q0.25 0.125 1.125 0.25q1.59375 0.21875 2.21875 0.4375q0.8125 0.28125 1.25 0.859375q0.453125 0.5625 0.453125 1.203125q0 0.859375 -0.75 1.4375q-1.09375 0.84375 -2.828125 0.84375q-0.6875 0 -1.28125 -0.125q-0.59375 -0.125 -1.078125 -0.359375q-0.125 0.09375 -0.265625 0.15625q-0.125 0.046875 -0.265625 0.046875q-0.375 0 -0.59375 -0.234375q-0.21875 -0.25 -0.21875 -0.828125l0 -0.546875q0 -0.578125 0.21875 -0.8125q0.21875 -0.25 0.578125 -0.25q0.296875 0 0.484375 0.15625q0.203125 0.15625 0.3125 0.546875q0.359375 0.3125 0.875 0.484375q0.515625 0.15625 1.1875 0.15625q1.109375 0 1.71875 -0.34375q0.28125 -0.171875 0.28125 -0.359375q0 -0.3125 -0.40625 -0.515625q-0.421875 -0.203125 -1.71875 -0.34375q-1.921875 -0.203125 -2.578125 -0.78125q-0.640625 -0.578125 -0.640625 -1.40625q0 -0.859375 0.71875 -1.4375q0.984375 -0.78125 2.578125 -0.78125q0.5625 0 1.0625 0.109375q0.515625 0.109375 0.984375 0.328125q0.15625 -0.109375 0.28125 -0.15625q0.125 -0.0625 0.234375 -0.0625q0.328125 0 0.546875 0.25q0.21875 0.234375 0.21875 0.8125l0 0.390625q0 0.53125 -0.125 0.71875q-0.25 0.359375 -0.671875 0.359375q-0.296875 0 -0.515625 -0.171875q-0.21875 -0.1875 -0.28125 -0.484375zm6.9453125 1.96875l0 1.640625l1.625 0q0.578125 0 0.8125 0.234375q0.25 0.21875 0.25 0.578125q0 0.34375 -0.25 0.578125q-0.234375 0.21875 -0.8125 0.21875l-3.46875 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.234375 -0.25 -0.59375q0 -0.34375 0.25 -0.5625q0.25 -0.234375 0.828125 -0.234375l0.25 0l0 -6.265625l-0.25 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.21875 -0.25 -0.578125q0 -0.359375 0.25 -0.578125q0.25 -0.234375 0.828125 -0.234375l3.6875 0.015625q1.625 0 2.5625 0.890625q0.953125 0.875 0.953125 2.15625q0 0.703125 -0.3125 1.328125q-0.25 0.46875 -0.8125 0.921875q-0.5625 0.453125 -1.15625 0.6875q-0.59375 0.234375 -1.5625 0.234375l-1.515625 0zm0 -1.609375l1.484375 0q1.046875 0 1.65625 -0.46875q0.625 -0.46875 0.625 -1.140625q0 -0.5625 -0.5 -0.984375q-0.5 -0.421875 -1.421875 -0.421875l-1.84375 0l0 3.015625zm11.9765625 4.859375l0 -0.375q-0.609375 0.3125 -1.34375 0.46875q-0.71875 0.171875 -1.3125 0.171875q-1.28125 0 -2.09375 -0.6875q-0.796875 -0.6875 -0.796875 -1.515625q0 -1.0 1.015625 -1.859375q1.03125 -0.875 2.84375 -0.875q0.734375 0 1.6875 0.15625l0 -0.375q0 -0.359375 -0.3125 -0.578125q-0.3125 -0.234375 -1.171875 -0.234375q-0.71875 0 -1.84375 0.28125q-0.421875 0.09375 -0.65625 0.09375q-0.328125 0 -0.546875 -0.21875q-0.21875 -0.234375 -0.21875 -0.59375q0 -0.203125 0.078125 -0.34375q0.078125 -0.15625 0.21875 -0.25q0.140625 -0.09375 0.578125 -0.21875q0.59375 -0.15625 1.203125 -0.25q0.625 -0.109375 1.125 -0.109375q1.5 0 2.3125 0.65625q0.828125 0.640625 0.828125 1.75l0 3.296875l0.28125 0q0.578125 0 0.8125 0.234375q0.25 0.21875 0.25 0.578125q0 0.34375 -0.25 0.578125q-0.234375 0.21875 -0.8125 0.21875l-1.875 0zm0 -2.875q-0.96875 -0.1875 -1.78125 -0.1875q-0.96875 0 -1.671875 0.484375q-0.4375 0.296875 -0.4375 0.609375q0 0.234375 0.203125 0.375q0.390625 0.25 1.078125 0.25q0.578125 0 1.296875 -0.21875q0.734375 -0.234375 1.3125 -0.625l0 -0.6875zm7.7578125 -2.625l0 3.21875q0 0.515625 0.21875 0.671875q0.328125 0.265625 1.171875 0.265625q1.21875 0 2.265625 -0.53125q0.390625 -0.203125 0.625 -0.203125q0.3125 0 0.53125 0.234375q0.234375 0.234375 0.234375 0.578125q0 0.3125 -0.25 0.53125q-0.375 0.375 -1.515625 0.6875q-1.125 0.3125 -1.890625 0.3125q-1.5 0 -2.25 -0.640625q-0.734375 -0.65625 -0.734375 -1.59375l0 -3.53125l-0.578125 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.21875 -0.25 -0.578125q0 -0.359375 0.25 -0.578125q0.25 -0.21875 0.828125 -0.21875l0.578125 0l0 -1.453125q0 -0.578125 0.21875 -0.8125q0.21875 -0.25 0.578125 -0.25q0.359375 0 0.578125 0.25q0.21875 0.234375 0.21875 0.8125l0 1.453125l2.96875 0q0.578125 0 0.8125 0.21875q0.25 0.21875 0.25 0.578125q0 0.359375 -0.25 0.578125q-0.234375 0.21875 -0.8125 0.21875l-2.96875 0zm8.3515625 -4.640625l0 3.421875q0.5 -0.296875 1.0 -0.4375q0.515625 -0.15625 1.046875 -0.15625q0.828125 0 1.46875 0.28125q0.65625 0.28125 1.078125 0.890625q0.421875 0.609375 0.421875 1.53125l0 3.0q0.609375 0 0.796875 0.125q0.375 0.234375 0.375 0.6875q0 0.34375 -0.25 0.578125q-0.234375 0.21875 -0.8125 0.21875l-1.828125 0q-0.5625 0 -0.8125 -0.21875q-0.25 -0.234375 -0.25 -0.59375q0 -0.4375 0.375 -0.671875q0.203125 -0.125 0.796875 -0.125l0 -2.890625q0 -0.625 -0.28125 -0.875q-0.359375 -0.328125 -1.078125 -0.328125q-0.53125 0 -0.953125 0.203125q-0.40625 0.203125 -1.09375 0.890625l0 3.0q0.609375 0 0.796875 0.125q0.375 0.234375 0.375 0.6875q0 0.34375 -0.25 0.578125q-0.234375 0.21875 -0.8125 0.21875l-1.828125 0q-0.578125 0 -0.828125 -0.21875q-0.234375 -0.234375 -0.234375 -0.59375q0 -0.4375 0.375 -0.671875q0.1875 -0.125 0.796875 -0.125l0 -6.921875l-0.265625 0q-0.578125 0 -0.828125 -0.21875q-0.25 -0.234375 -0.25 -0.59375q0 -0.34375 0.25 -0.5625q0.25 -0.234375 0.828125 -0.234375l1.875 0z" fill-rule="nonzero"></path><path fill="#000000" fill-opacity="0.0" d="m96.0 144.0l0 -80.0l80.0 0" fill-rule="nonzero"></path><path stroke="#000000" stroke-width="2.0" stroke-linejoin="round" stroke-linecap="butt" d="m96.0 144.0l0 -80.0l68.0 0" fill-rule="evenodd"></path><path stroke="#000000" stroke-width="2.0" stroke-linecap="butt" d="m164.0 67.30347l9.076202 -3.3034668l-9.076202 -3.303463z" fill-rule="evenodd"></path><path fill="#000000" fill-opacity="0.0" d="m431.5013 143.08398l0 -78.99999l-68.0 0" fill-rule="nonzero"></path><path stroke="#000000" stroke-width="2.0" stroke-linejoin="round" stroke-linecap="butt" d="m431.5013 143.08398l0 -78.99999l-56.0 0" fill-rule="evenodd"></path><path stroke="#000000" stroke-width="2.0" stroke-linecap="butt" d="m375.5013 60.780525l-9.076202 3.3034668l9.076202 3.3034592z" fill-rule="evenodd"></path><path fill="#000000" fill-opacity="0.0" d="m269.71652 104.53543l0 166.92914" fill-rule="nonzero"></path><path stroke="#000000" stroke-width="2.0" stroke-linejoin="round" stroke-linecap="butt" d="m269.71652 116.53543l0 154.92914" fill-rule="evenodd"></path><path stroke="#000000" stroke-width="2.0" stroke-linecap="butt" d="m273.02 116.53543l-3.3034668 -9.076195l-3.3034668 9.076195z" fill-rule="evenodd"></path><path fill="#000000" fill-opacity="0.0" d="m65.0 223.08398l-1.0078735 176.91339" fill-rule="nonzero"></path><path stroke="#000000" stroke-width="2.0" stroke-linejoin="round" stroke-linecap="butt" d="m64.93163 235.08379l-0.93950653 164.91359" fill-rule="evenodd"></path><path stroke="#000000" stroke-width="2.0" stroke-linecap="butt" d="m68.23505 235.10262l-3.2517014 -9.094864l-3.3551178 9.05722z" fill-rule="evenodd"></path><path fill="#000000" fill-opacity="0.0" d="m471.0 224.38058l-1.0078735 176.91336" fill-rule="nonzero"></path><path stroke="#000000" stroke-width="2.0" stroke-linejoin="round" stroke-linecap="butt" d="m470.93164 236.38037l-0.93951416 164.9136" fill-rule="evenodd"></path><path stroke="#000000" stroke-width="2.0" stroke-linecap="butt" d="m474.23505 236.3992l-3.251709 -9.094864l-3.3551025 9.05722z" fill-rule="evenodd"></path><path fill="#000000" fill-opacity="0.0" d="m128.50131 400.00266l0 -86.168l47.496002 0" fill-rule="nonzero"></path><path stroke="#000000" stroke-width="2.0" stroke-linejoin="round" stroke-linecap="butt" d="m128.50131 400.00266l0 -86.168l35.496002 0" fill-rule="evenodd"></path><path stroke="#000000" stroke-width="2.0" stroke-linecap="butt" d="m163.99731 317.13812l9.076202 -3.3034668l-9.076202 -3.3034668z" fill-rule="evenodd"></path><path fill="#000000" fill-opacity="0.0" d="m414.71902 400.00266l0 -86.168l-51.216003 0" fill-rule="nonzero"></path><path stroke="#000000" stroke-width="2.0" stroke-linejoin="round" stroke-linecap="butt" d="m414.71902 400.00266l0 -86.168l-39.216003 0" fill-rule="evenodd"></path><path stroke="#000000" stroke-width="2.0" stroke-linecap="butt" d="m375.50302 310.5312l-9.076172 3.3034668l9.076172 3.3034668z" fill-rule="evenodd"></path></g></svg>
+
diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst
new file mode 100644
index 0000000..ec1dc4f
--- /dev/null
+++ b/Doc/library/pathlib.rst
@@ -0,0 +1,919 @@
+
+:mod:`pathlib` --- Object-oriented filesystem paths
+===================================================
+
+.. module:: pathlib
+   :synopsis: Object-oriented filesystem paths
+
+.. index:: single: path; operations
+
+.. versionadded:: 3.4
+
+This module offers classes representing filesystem paths with semantics
+appropriate for different operating systems.  Path classes are divided
+between :ref:`pure paths <pure-paths>`, which provide purely computational
+operations without I/O, and :ref:`concrete paths <concrete-paths>`, which
+inherit from pure paths but also provide I/O operations.
+
+.. image:: pathlib-inheritance.png
+   :align: center
+
+If you've never used this module before or just aren't sure which class is
+right for your task, :class:`Path` is most likely what you need. It instantiates
+a :ref:`concrete path <concrete-paths>` for the platform the code is running on.
+
+Pure paths are useful in some special cases; for example:
+
+#. If you want to manipulate Windows paths on a Unix machine (or vice versa).
+   You cannot instantiate a :class:`WindowsPath` when running on Unix, but you
+   can instantiate :class:`PureWindowsPath`.
+#. You want to make sure that your code only manipulates paths without actually
+   accessing the OS. In this case, instantiating one of the pure classes may be
+   useful since those simply don't have any OS-accessing operations.
+
+.. note::
+   This module has been included in the standard library on a
+   :term:`provisional basis <provisional package>`. Backwards incompatible
+   changes (up to and including removal of the package) may occur if deemed
+   necessary by the core developers.
+
+.. seealso::
+   :pep:`428`: The pathlib module -- object-oriented filesystem paths.
+
+.. seealso::
+   For low-level path manipulation on strings, you can also use the
+   :mod:`os.path` module.
+
+
+Basic use
+---------
+
+Importing the main class::
+
+   >>> from pathlib import Path
+
+Listing subdirectories::
+
+   >>> p = Path('.')
+   >>> [x for x in p.iterdir() if x.is_dir()]
+   [PosixPath('.hg'), PosixPath('docs'), PosixPath('dist'),
+    PosixPath('__pycache__'), PosixPath('build')]
+
+Listing Python source files in this directory tree::
+
+   >>> list(p.glob('**/*.py'))
+   [PosixPath('test_pathlib.py'), PosixPath('setup.py'),
+    PosixPath('pathlib.py'), PosixPath('docs/conf.py'),
+    PosixPath('build/lib/pathlib.py')]
+
+Navigating inside a directory tree::
+
+   >>> p = Path('/etc')
+   >>> q = p / 'init.d' / 'reboot'
+   >>> q
+   PosixPath('/etc/init.d/reboot')
+   >>> q.resolve()
+   PosixPath('/etc/rc.d/init.d/halt')
+
+Querying path properties::
+
+   >>> q.exists()
+   True
+   >>> q.is_dir()
+   False
+
+Opening a file::
+
+   >>> with q.open() as f: f.readline()
+   ...
+   '#!/bin/bash\n'
+
+
+.. _pure-paths:
+
+Pure paths
+----------
+
+Pure path objects provide path-handling operations which don't actually
+access a filesystem.  There are three ways to access these classes, which
+we also call *flavours*:
+
+.. class:: PurePath(*pathsegments)
+
+   A generic class that represents the system's path flavour (instantiating
+   it creates either a :class:`PurePosixPath` or a :class:`PureWindowsPath`)::
+
+      >>> PurePath('setup.py')      # Running on a Unix machine
+      PurePosixPath('setup.py')
+
+   Each element of *pathsegments* can be either a string or bytes object
+   representing a path segment; it can also be another path object::
+
+      >>> PurePath('foo', 'some/path', 'bar')
+      PurePosixPath('foo/some/path/bar')
+      >>> PurePath(Path('foo'), Path('bar'))
+      PurePosixPath('foo/bar')
+
+   When *pathsegments* is empty, the current directory is assumed::
+
+      >>> PurePath()
+      PurePosixPath('.')
+
+   When several absolute paths are given, the last is taken as an anchor
+   (mimicking :func:`os.path.join`'s behaviour)::
+
+      >>> PurePath('/etc', '/usr', 'lib64')
+      PurePosixPath('/usr/lib64')
+      >>> PureWindowsPath('c:/Windows', 'd:bar')
+      PureWindowsPath('d:bar')
+
+   However, in a Windows path, changing the local root doesn't discard the
+   previous drive setting::
+
+      >>> PureWindowsPath('c:/Windows', '/Program Files')
+      PureWindowsPath('c:/Program Files')
+
+   Spurious slashes and single dots are collapsed, but double dots (``'..'``)
+   are not, since this would change the meaning of a path in the face of
+   symbolic links::
+
+      >>> PurePath('foo//bar')
+      PurePosixPath('foo/bar')
+      >>> PurePath('foo/./bar')
+      PurePosixPath('foo/bar')
+      >>> PurePath('foo/../bar')
+      PurePosixPath('foo/../bar')
+
+   (a naïve approach would make ``PurePosixPath('foo/../bar')`` equivalent
+   to ``PurePosixPath('bar')``, which is wrong if ``foo`` is a symbolic link
+   to another directory)
+
+.. class:: PurePosixPath(*pathsegments)
+
+   A subclass of :class:`PurePath`, this path flavour represents non-Windows
+   filesystem paths::
+
+      >>> PurePosixPath('/etc')
+      PurePosixPath('/etc')
+
+   *pathsegments* is specified similarly to :class:`PurePath`.
+
+.. class:: PureWindowsPath(*pathsegments)
+
+   A subclass of :class:`PurePath`, this path flavour represents Windows
+   filesystem paths::
+
+      >>> PureWindowsPath('c:/Program Files/')
+      PureWindowsPath('c:/Program Files')
+
+   *pathsegments* is specified similarly to :class:`PurePath`.
+
+Regardless of the system you're running on, you can instantiate all of
+these classes, since they don't provide any operation that does system calls.
+
+
+General properties
+^^^^^^^^^^^^^^^^^^
+
+Paths are immutable and hashable.  Paths of a same flavour are comparable
+and orderable.  These properties respect the flavour's case-folding
+semantics::
+
+   >>> PurePosixPath('foo') == PurePosixPath('FOO')
+   False
+   >>> PureWindowsPath('foo') == PureWindowsPath('FOO')
+   True
+   >>> PureWindowsPath('FOO') in { PureWindowsPath('foo') }
+   True
+   >>> PureWindowsPath('C:') < PureWindowsPath('d:')
+   True
+
+Paths of a different flavour compare unequal and cannot be ordered::
+
+   >>> PureWindowsPath('foo') == PurePosixPath('foo')
+   False
+   >>> PureWindowsPath('foo') < PurePosixPath('foo')
+   Traceback (most recent call last):
+     File "<stdin>", line 1, in <module>
+   TypeError: unorderable types: PureWindowsPath() < PurePosixPath()
+
+
+Operators
+^^^^^^^^^
+
+The slash operator helps create child paths, similarly to :func:`os.path.join`::
+
+   >>> p = PurePath('/etc')
+   >>> p
+   PurePosixPath('/etc')
+   >>> p / 'init.d' / 'apache2'
+   PurePosixPath('/etc/init.d/apache2')
+   >>> q = PurePath('bin')
+   >>> '/usr' / q
+   PurePosixPath('/usr/bin')
+
+The string representation of a path is the raw filesystem path itself
+(in native form, e.g. with backslashes under Windows), which you can
+pass to any function taking a file path as a string::
+
+   >>> p = PurePath('/etc')
+   >>> str(p)
+   '/etc'
+   >>> p = PureWindowsPath('c:/Program Files')
+   >>> str(p)
+   'c:\\Program Files'
+
+Similarly, calling :class:`bytes` on a path gives the raw filesystem path as a
+bytes object, as encoded by :func:`os.fsencode`::
+
+   >>> bytes(p)
+   b'/etc'
+
+.. note::
+   Calling :class:`bytes` is only recommended under Unix.  Under Windows,
+   the unicode form is the canonical representation of filesystem paths.
+
+
+Accessing individual parts
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+To access the individual "parts" (components) of a path, use the following
+property:
+
+.. data:: PurePath.parts
+
+   A tuple giving access to the path's various components::
+
+      >>> p = PurePath('/usr/bin/python3')
+      >>> p.parts
+      ('/', 'usr', 'bin', 'python3')
+
+      >>> p = PureWindowsPath('c:/Program Files/PSF')
+      >>> p.parts
+      ('c:\\', 'Program Files', 'PSF')
+
+   (note how the drive and local root are regrouped in a single part)
+
+
+Methods and properties
+^^^^^^^^^^^^^^^^^^^^^^
+
+Pure paths provide the following methods and properties:
+
+.. data:: PurePath.drive
+
+   A string representing the drive letter or name, if any::
+
+      >>> PureWindowsPath('c:/Program Files/').drive
+      'c:'
+      >>> PureWindowsPath('/Program Files/').drive
+      ''
+      >>> PurePosixPath('/etc').drive
+      ''
+
+   UNC shares are also considered drives::
+
+      >>> PureWindowsPath('//host/share/foo.txt').drive
+      '\\\\host\\share'
+
+.. data:: PurePath.root
+
+   A string representing the (local or global) root, if any::
+
+      >>> PureWindowsPath('c:/Program Files/').root
+      '\\'
+      >>> PureWindowsPath('c:Program Files/').root
+      ''
+      >>> PurePosixPath('/etc').root
+      '/'
+
+   UNC shares always have a root::
+
+      >>> PureWindowsPath('//host/share').root
+      '\\'
+
+.. data:: PurePath.anchor
+
+   The concatenation of the drive and root::
+
+      >>> PureWindowsPath('c:/Program Files/').anchor
+      'c:\\'
+      >>> PureWindowsPath('c:Program Files/').anchor
+      'c:'
+      >>> PurePosixPath('/etc').anchor
+      '/'
+      >>> PureWindowsPath('//host/share').anchor
+      '\\\\host\\share\\'
+
+
+.. data:: PurePath.parents
+
+   An immutable sequence providing access to the logical ancestors of
+   the path::
+
+      >>> p = PureWindowsPath('c:/foo/bar/setup.py')
+      >>> p.parents[0]
+      PureWindowsPath('c:/foo/bar')
+      >>> p.parents[1]
+      PureWindowsPath('c:/foo')
+      >>> p.parents[2]
+      PureWindowsPath('c:/')
+
+
+.. data:: PurePath.parent
+
+   The logical parent of the path::
+
+      >>> p = PurePosixPath('/a/b/c/d')
+      >>> p.parent
+      PurePosixPath('/a/b/c')
+
+   You cannot go past an anchor, or empty path::
+
+      >>> p = PurePosixPath('/')
+      >>> p.parent
+      PurePosixPath('/')
+      >>> p = PurePosixPath('.')
+      >>> p.parent
+      PurePosixPath('.')
+
+   .. note::
+      This is a purely lexical operation, hence the following behaviour::
+
+         >>> p = PurePosixPath('foo/..')
+         >>> p.parent
+         PurePosixPath('foo')
+
+      If you want to walk an arbitrary filesystem path upwards, it is
+      recommended to first call :meth:`Path.resolve` so as to resolve
+      symlinks and eliminate `".."` components.
+
+
+.. data:: PurePath.name
+
+   A string representing the final path component, excluding the drive and
+   root, if any::
+
+      >>> PurePosixPath('my/library/setup.py').name
+      'setup.py'
+
+   UNC drive names are not considered::
+
+      >>> PureWindowsPath('//some/share/setup.py').name
+      'setup.py'
+      >>> PureWindowsPath('//some/share').name
+      ''
+
+
+.. data:: PurePath.suffix
+
+   The file extension of the final component, if any::
+
+      >>> PurePosixPath('my/library/setup.py').suffix
+      '.py'
+      >>> PurePosixPath('my/library.tar.gz').suffix
+      '.gz'
+      >>> PurePosixPath('my/library').suffix
+      ''
+
+
+.. data:: PurePath.suffixes
+
+   A list of the path's file extensions::
+
+      >>> PurePosixPath('my/library.tar.gar').suffixes
+      ['.tar', '.gar']
+      >>> PurePosixPath('my/library.tar.gz').suffixes
+      ['.tar', '.gz']
+      >>> PurePosixPath('my/library').suffixes
+      []
+
+
+.. data:: PurePath.stem
+
+   The final path component, without its suffix::
+
+      >>> PurePosixPath('my/library.tar.gz').stem
+      'library.tar'
+      >>> PurePosixPath('my/library.tar').stem
+      'library'
+      >>> PurePosixPath('my/library').stem
+      'library'
+
+
+.. method:: PurePath.as_posix()
+
+   Return a string representation of the path with forward slashes (``/``)::
+
+      >>> p = PureWindowsPath('c:\\windows')
+      >>> str(p)
+      'c:\\windows'
+      >>> p.as_posix()
+      'c:/windows'
+
+
+.. method:: PurePath.as_uri()
+
+   Represent the path as a ``file`` URI.  :exc:`ValueError` is raised if
+   the path isn't absolute.
+
+      >>> p = PurePosixPath('/etc/passwd')
+      >>> p.as_uri()
+      'file:///etc/passwd'
+      >>> p = PureWindowsPath('c:/Windows')
+      >>> p.as_uri()
+      'file:///c:/Windows'
+
+
+.. method:: PurePath.is_absolute()
+
+   Return whether the path is absolute or not.  A path is considered absolute
+   if it has both a root and (if the flavour allows) a drive::
+
+      >>> PurePosixPath('/a/b').is_absolute()
+      True
+      >>> PurePosixPath('a/b').is_absolute()
+      False
+
+      >>> PureWindowsPath('c:/a/b').is_absolute()
+      True
+      >>> PureWindowsPath('/a/b').is_absolute()
+      False
+      >>> PureWindowsPath('c:').is_absolute()
+      False
+      >>> PureWindowsPath('//some/share').is_absolute()
+      True
+
+
+.. method:: PurePath.is_reserved()
+
+   With :class:`PureWindowsPath`, return ``True`` if the path is considered
+   reserved under Windows, ``False`` otherwise.  With :class:`PurePosixPath`,
+   ``False`` is always returned.
+
+      >>> PureWindowsPath('nul').is_reserved()
+      True
+      >>> PurePosixPath('nul').is_reserved()
+      False
+
+   File system calls on reserved paths can fail mysteriously or have
+   unintended effects.
+
+
+.. method:: PurePath.joinpath(*other)
+
+   Calling this method is equivalent to combining the path with each of
+   the *other* arguments in turn::
+
+      >>> PurePosixPath('/etc').joinpath('passwd')
+      PurePosixPath('/etc/passwd')
+      >>> PurePosixPath('/etc').joinpath(PurePosixPath('passwd'))
+      PurePosixPath('/etc/passwd')
+      >>> PurePosixPath('/etc').joinpath('init.d', 'apache2')
+      PurePosixPath('/etc/init.d/apache2')
+      >>> PureWindowsPath('c:').joinpath('/Program Files')
+      PureWindowsPath('c:/Program Files')
+
+
+.. method:: PurePath.match(pattern)
+
+   Match this path against the provided glob-style pattern.  Return ``True``
+   if matching is successful, ``False`` otherwise.
+
+   If *pattern* is relative, the path can be either relative or absolute,
+   and matching is done from the right::
+
+      >>> PurePath('a/b.py').match('*.py')
+      True
+      >>> PurePath('/a/b/c.py').match('b/*.py')
+      True
+      >>> PurePath('/a/b/c.py').match('a/*.py')
+      False
+
+   If *pattern* is absolute, the path must be absolute, and the whole path
+   must match::
+
+      >>> PurePath('/a.py').match('/*.py')
+      True
+      >>> PurePath('a/b.py').match('/*.py')
+      False
+
+   As with other methods, case-sensitivity is observed::
+
+      >>> PureWindowsPath('b.py').match('*.PY')
+      True
+
+
+.. method:: PurePath.relative_to(*other)
+
+   Compute a version of this path relative to the path represented by
+   *other*.  If it's impossible, ValueError is raised::
+
+      >>> p = PurePosixPath('/etc/passwd')
+      >>> p.relative_to('/')
+      PurePosixPath('etc/passwd')
+      >>> p.relative_to('/etc')
+      PurePosixPath('passwd')
+      >>> p.relative_to('/usr')
+      Traceback (most recent call last):
+        File "<stdin>", line 1, in <module>
+        File "pathlib.py", line 694, in relative_to
+          .format(str(self), str(formatted)))
+      ValueError: '/etc/passwd' does not start with '/usr'
+
+
+.. method:: PurePath.with_name(name)
+
+   Return a new path with the :attr:`name` changed.  If the original path
+   doesn't have a name, ValueError is raised::
+
+      >>> p = PureWindowsPath('c:/Downloads/pathlib.tar.gz')
+      >>> p.with_name('setup.py')
+      PureWindowsPath('c:/Downloads/setup.py')
+      >>> p = PureWindowsPath('c:/')
+      >>> p.with_name('setup.py')
+      Traceback (most recent call last):
+        File "<stdin>", line 1, in <module>
+        File "/home/antoine/cpython/default/Lib/pathlib.py", line 751, in with_name
+          raise ValueError("%r has an empty name" % (self,))
+      ValueError: PureWindowsPath('c:/') has an empty name
+
+
+.. method:: PurePath.with_suffix(suffix)
+
+   Return a new path with the :attr:`suffix` changed.  If the original path
+   doesn't have a suffix, the new *suffix* is appended instead::
+
+      >>> p = PureWindowsPath('c:/Downloads/pathlib.tar.gz')
+      >>> p.with_suffix('.bz2')
+      PureWindowsPath('c:/Downloads/pathlib.tar.bz2')
+      >>> p = PureWindowsPath('README')
+      >>> p.with_suffix('.txt')
+      PureWindowsPath('README.txt')
+
+
+.. _concrete-paths:
+
+
+Concrete paths
+--------------
+
+Concrete paths are subclasses of the pure path classes.  In addition to
+operations provided by the latter, they also provide methods to do system
+calls on path objects.  There are three ways to instantiate concrete paths:
+
+.. class:: Path(*pathsegments)
+
+   A subclass of :class:`PurePath`, this class represents concrete paths of
+   the system's path flavour (instantiating it creates either a
+   :class:`PosixPath` or a :class:`WindowsPath`)::
+
+      >>> Path('setup.py')
+      PosixPath('setup.py')
+
+   *pathsegments* is specified similarly to :class:`PurePath`.
+
+.. class:: PosixPath(*pathsegments)
+
+   A subclass of :class:`Path` and :class:`PurePosixPath`, this class
+   represents concrete non-Windows filesystem paths::
+
+      >>> PosixPath('/etc')
+      PosixPath('/etc')
+
+   *pathsegments* is specified similarly to :class:`PurePath`.
+
+.. class:: WindowsPath(*pathsegments)
+
+   A subclass of :class:`Path` and :class:`PureWindowsPath`, this class
+   represents concrete Windows filesystem paths::
+
+      >>> WindowsPath('c:/Program Files/')
+      WindowsPath('c:/Program Files')
+
+   *pathsegments* is specified similarly to :class:`PurePath`.
+
+You can only instantiate the class flavour that corresponds to your system
+(allowing system calls on non-compatible path flavours could lead to
+bugs or failures in your application)::
+
+   >>> import os
+   >>> os.name
+   'posix'
+   >>> Path('setup.py')
+   PosixPath('setup.py')
+   >>> PosixPath('setup.py')
+   PosixPath('setup.py')
+   >>> WindowsPath('setup.py')
+   Traceback (most recent call last):
+     File "<stdin>", line 1, in <module>
+     File "pathlib.py", line 798, in __new__
+       % (cls.__name__,))
+   NotImplementedError: cannot instantiate 'WindowsPath' on your system
+
+
+Methods
+^^^^^^^
+
+Concrete paths provide the following methods in addition to pure paths
+methods.  Many of these methods can raise an :exc:`OSError` if a system
+call fails (for example because the path doesn't exist):
+
+.. classmethod:: Path.cwd()
+
+   Return a new path object representing the current directory (as returned
+   by :func:`os.getcwd`)::
+
+      >>> Path.cwd()
+      PosixPath('/home/antoine/pathlib')
+
+
+.. method:: Path.stat()
+
+   Return information about this path (similarly to :func:`os.stat`).
+   The result is looked up at each call to this method.
+
+      >>> p = Path('setup.py')
+      >>> p.stat().st_size
+      956
+      >>> p.stat().st_mtime
+      1327883547.852554
+
+
+.. method:: Path.chmod(mode)
+
+   Change the file mode and permissions, like :func:`os.chmod`::
+
+      >>> p = Path('setup.py')
+      >>> p.stat().st_mode
+      33277
+      >>> p.chmod(0o444)
+      >>> p.stat().st_mode
+      33060
+
+
+.. method:: Path.exists()
+
+   Whether the path points to an existing file or directory::
+
+      >>> Path('.').exists()
+      True
+      >>> Path('setup.py').exists()
+      True
+      >>> Path('/etc').exists()
+      True
+      >>> Path('nonexistentfile').exists()
+      False
+
+   .. note::
+      If the path points to a symlink, :meth:`exists` returns whether the
+      symlink *points to* an existing file or directory.
+
+
+.. method:: Path.glob(pattern)
+
+   Glob the given *pattern* in the directory represented by this path,
+   yielding all matching files (of any kind)::
+
+      >>> sorted(Path('.').glob('*.py'))
+      [PosixPath('pathlib.py'), PosixPath('setup.py'), PosixPath('test_pathlib.py')]
+      >>> sorted(Path('.').glob('*/*.py'))
+      [PosixPath('docs/conf.py')]
+
+   The "``**``" pattern means "this directory and all subdirectories,
+   recursively".  In other words, it enables recursive globbing::
+
+      >>> sorted(Path('.').glob('**/*.py'))
+      [PosixPath('build/lib/pathlib.py'),
+       PosixPath('docs/conf.py'),
+       PosixPath('pathlib.py'),
+       PosixPath('setup.py'),
+       PosixPath('test_pathlib.py')]
+
+   .. note::
+      Using the "``**``" pattern in large directory trees may consume
+      an inordinate amount of time.
+
+
+.. method:: Path.group()
+
+   Return the name of the group owning the file.  :exc:`KeyError` is raised
+   if the file's gid isn't found in the system database.
+
+
+.. method:: Path.is_dir()
+
+   Return ``True`` if the path points to a directory (or a symbolic link
+   pointing to a directory), ``False`` if it points to another kind of file.
+
+   ``False`` is also returned if the path doesn't exist or is a broken symlink;
+   other errors (such as permission errors) are propagated.
+
+
+.. method:: Path.is_file()
+
+   Return ``True`` if the path points to a regular file (or a symbolic link
+   pointing to a regular file), ``False`` if it points to another kind of file.
+
+   ``False`` is also returned if the path doesn't exist or is a broken symlink;
+   other errors (such as permission errors) are propagated.
+
+
+.. method:: Path.is_symlink()
+
+   Return ``True`` if the path points to a symbolic link, ``False`` otherwise.
+
+   ``False`` is also returned if the path doesn't exist; other errors (such
+   as permission errors) are propagated.
+
+
+.. method:: Path.is_socket()
+
+   Return ``True`` if the path points to a Unix socket (or a symbolic link
+   pointing to a Unix socket), ``False`` if it points to another kind of file.
+
+   ``False`` is also returned if the path doesn't exist or is a broken symlink;
+   other errors (such as permission errors) are propagated.
+
+
+.. method:: Path.is_fifo()
+
+   Return ``True`` if the path points to a FIFO (or a symbolic link
+   pointing to a FIFO), ``False`` if it points to another kind of file.
+
+   ``False`` is also returned if the path doesn't exist or is a broken symlink;
+   other errors (such as permission errors) are propagated.
+
+
+.. method:: Path.is_block_device()
+
+   Return ``True`` if the path points to a block device (or a symbolic link
+   pointing to a block device), ``False`` if it points to another kind of file.
+
+   ``False`` is also returned if the path doesn't exist or is a broken symlink;
+   other errors (such as permission errors) are propagated.
+
+
+.. method:: Path.is_char_device()
+
+   Return ``True`` if the path points to a character device (or a symbolic link
+   pointing to a character device), ``False`` if it points to another kind of file.
+
+   ``False`` is also returned if the path doesn't exist or is a broken symlink;
+   other errors (such as permission errors) are propagated.
+
+
+.. method:: Path.iterdir()
+
+   When the path points to a directory, yield path objects of the directory
+   contents::
+
+      >>> p = Path('docs')
+      >>> for child in p.iterdir(): child
+      ...
+      PosixPath('docs/conf.py')
+      PosixPath('docs/_templates')
+      PosixPath('docs/make.bat')
+      PosixPath('docs/index.rst')
+      PosixPath('docs/_build')
+      PosixPath('docs/_static')
+      PosixPath('docs/Makefile')
+
+.. method:: Path.lchmod(mode)
+
+   Like :meth:`Path.chmod` but, if the path points to a symbolic link, the
+   symbolic link's mode is changed rather than its target's.
+
+
+.. method:: Path.lstat()
+
+   Like :meth:`Path.stat` but, if the path points to a symbolic link, return
+   the symbolic link's information rather than its target's.
+
+
+.. method:: Path.mkdir(mode=0o777, parents=False)
+
+   Create a new directory at this given path.  If *mode* is given, it is
+   combined with the process' ``umask`` value to determine the file mode
+   and access flags.  If the path already exists, :exc:`FileExistsError`
+   is raised.
+
+   If *parents* is true, any missing parents of this path are created
+   as needed; they are created with the default permissions without taking
+   *mode* into account (mimicking the POSIX ``mkdir -p`` command).
+
+   If *parents* is false (the default), a missing parent raises
+   :exc:`FileNotFoundError`.
+
+
+.. method:: Path.open(mode='r', buffering=-1, encoding=None, errors=None, newline=None)
+
+   Open the file pointed to by the path, like the built-in :func:`open`
+   function does::
+
+      >>> p = Path('setup.py')
+      >>> with p.open() as f:
+      ...     f.readline()
+      ...
+      '#!/usr/bin/env python3\n'
+
+
+.. method:: Path.owner()
+
+   Return the name of the user owning the file.  :exc:`KeyError` is raised
+   if the file's uid isn't found in the system database.
+
+
+.. method:: Path.rename(target)
+
+   Rename this file or directory to the given *target*.  *target* can be
+   either a string or another path object::
+
+      >>> p = Path('foo')
+      >>> p.open('w').write('some text')
+      9
+      >>> target = Path('bar')
+      >>> p.rename(target)
+      >>> target.open().read()
+      'some text'
+
+
+.. method:: Path.replace(target)
+
+   Rename this file or directory to the given *target*.  If *target* points
+   to an existing file or directory, it will be unconditionally replaced.
+
+
+.. method:: Path.resolve()
+
+   Make the path absolute, resolving any symlinks.  A new path object is
+   returned::
+
+      >>> p = Path()
+      >>> p
+      PosixPath('.')
+      >>> p.resolve()
+      PosixPath('/home/antoine/pathlib')
+
+   `".."` components are also eliminated (this is the only method to do so)::
+
+      >>> p = Path('docs/../setup.py')
+      >>> p.resolve()
+      PosixPath('/home/antoine/pathlib/setup.py')
+
+   If the path doesn't exist, :exc:`FileNotFoundError` is raised.  If an
+   infinite loop is encountered along the resolution path,
+   :exc:`RuntimeError` is raised.
+
+
+.. method:: Path.rglob(pattern)
+
+   This is like calling :meth:`glob` with "``**``" added in front of the
+   given *pattern*:
+
+      >>> sorted(Path().rglob("*.py"))
+      [PosixPath('build/lib/pathlib.py'),
+       PosixPath('docs/conf.py'),
+       PosixPath('pathlib.py'),
+       PosixPath('setup.py'),
+       PosixPath('test_pathlib.py')]
+
+
+.. method:: Path.rmdir()
+
+   Remove this directory.  The directory must be empty.
+
+
+.. method:: Path.symlink_to(target, target_is_directory=False)
+
+   Make this path a symbolic link to *target*.  Under Windows,
+   *target_is_directory* must be true (default ``False``) if the link's target
+   is a directory.  Under POSIX, *target_is_directory*'s value is ignored.
+
+      >>> p = Path('mylink')
+      >>> p.symlink_to('setup.py')
+      >>> p.resolve()
+      PosixPath('/home/antoine/pathlib/setup.py')
+      >>> p.stat().st_size
+      956
+      >>> p.lstat().st_size
+      8
+
+   .. note::
+      The order of arguments (link, target) is the reverse
+      of :func:`os.symlink`'s.
+
+
+.. method:: Path.touch(mode=0o777, exist_ok=True)
+
+   Create a file at this given path.  If *mode* is given, it is combined
+   with the process' ``umask`` value to determine the file mode and access
+   flags.  If the file already exists, the function succeeds if *exist_ok*
+   is true (and its modification time is updated to the current time),
+   otherwise :exc:`FileExistsError` is raised.
+
+
+.. method:: Path.unlink()
+
+   Remove this file or symbolic link.  If the path points to a directory,
+   use :func:`Path.rmdir` instead.
diff --git a/Doc/library/pdb.rst b/Doc/library/pdb.rst
index f4e37ac..6e526f4 100644
--- a/Doc/library/pdb.rst
+++ b/Doc/library/pdb.rst
@@ -6,6 +6,9 @@
 .. module:: pdb
    :synopsis: The Python debugger for interactive interpreters.
 
+**Source code:** :source:`Lib/pdb.py`
+
+--------------
 
 .. index:: single: debugging
 
@@ -41,7 +44,7 @@
 .. versionchanged:: 3.3
    Tab-completion via the :mod:`readline` module is available for commands and
    command arguments, e.g. the current global and local names are offered as
-   arguments of the ``print`` command.
+   arguments of the ``p`` command.
 
 :file:`pdb.py` can also be invoked as a script to debug other scripts.  For
 example::
@@ -309,7 +312,7 @@
    ``end`` to terminate the commands. An example::
 
       (Pdb) commands 1
-      (com) print some_variable
+      (com) p some_variable
       (com) end
       (Pdb)
 
@@ -403,13 +406,19 @@
 
    Print the argument list of the current function.
 
-.. pdbcommand:: p(rint) expression
+.. pdbcommand:: p expression
 
    Evaluate the *expression* in the current context and print its value.
 
+   .. note::
+
+      ``print()`` can also be used, but is not a debugger command --- this executes the
+      Python :func:`print` function.
+
+
 .. pdbcommand:: pp expression
 
-   Like the :pdbcmd:`print` command, except the value of the expression is
+   Like the :pdbcmd:`p` command, except the value of the expression is
    pretty-printed using the :mod:`pprint` module.
 
 .. pdbcommand:: whatis expression
diff --git a/Doc/library/pickle.rst b/Doc/library/pickle.rst
index 273fb34..47356f9 100644
--- a/Doc/library/pickle.rst
+++ b/Doc/library/pickle.rst
@@ -94,6 +94,9 @@
    The :mod:`json` module: a standard library module allowing JSON
    serialization and deserialization.
 
+
+.. _pickle-protocols:
+
 Data stream format
 ------------------
 
@@ -113,7 +116,9 @@
 generated by :mod:`pickle`.  :mod:`pickletools` source code has extensive
 comments about opcodes used by pickle protocols.
 
-There are currently 4 different protocols which can be used for pickling.
+There are currently 5 different protocols which can be used for pickling.
+The higher the protocol used, the more recent the version of Python needed
+to read the pickle produced.
 
 * Protocol version 0 is the original "human-readable" protocol and is
   backwards compatible with earlier versions of Python.
@@ -125,10 +130,15 @@
   efficient pickling of :term:`new-style class`\es.  Refer to :pep:`307` for
   information about improvements brought by protocol 2.
 
-* Protocol version 3 was added in Python 3.  It has explicit support for
+* Protocol version 3 was added in Python 3.0.  It has explicit support for
   :class:`bytes` objects and cannot be unpickled by Python 2.x.  This is
-  the default as well as the current recommended protocol; use it whenever
-  possible.
+  the default protocol, and the recommended protocol when compatibility with
+  other Python 3 versions is required.
+
+* Protocol version 4 was added in Python 3.4.  It adds support for very large
+  objects, pickling more kinds of objects, and some data format
+  optimizations.  Refer to :pep:`3154` for information about improvements
+  brought by protocol 4.
 
 .. note::
    Serialization is a more primitive notion than persistence; although
@@ -156,13 +166,16 @@
 
 .. data:: HIGHEST_PROTOCOL
 
-   The highest protocol version available.  This value can be passed as a
-   *protocol* value.
+   An integer, the highest :ref:`protocol version <pickle-protocols>`
+   available.  This value can be passed as a *protocol* value to functions
+   :func:`dump` and :func:`dumps` as well as the :class:`Pickler`
+   constructor.
 
 .. data:: DEFAULT_PROTOCOL
 
-   The default protocol used for pickling.  May be less than HIGHEST_PROTOCOL.
-   Currently the default protocol is 3, a new protocol designed for Python 3.0.
+   An integer, the default :ref:`protocol version <pickle-protocols>` used
+   for pickling.  May be less than :data:`HIGHEST_PROTOCOL`.  Currently the
+   default protocol is 3, a new protocol designed for Python 3.
 
 
 The :mod:`pickle` module provides the following functions to make the pickling
@@ -173,13 +186,10 @@
    Write a pickled representation of *obj* to the open :term:`file object` *file*.
    This is equivalent to ``Pickler(file, protocol).dump(obj)``.
 
-   The optional *protocol* argument tells the pickler to use the given protocol;
-   supported protocols are 0, 1, 2, 3.  The default protocol is 3; a
-   backward-incompatible protocol designed for Python 3.0.
-
-   Specifying a negative protocol version selects the highest protocol version
-   supported.  The higher the protocol used, the more recent the version of
-   Python needed to read the pickle produced.
+   The optional *protocol* argument, an integer, tells the pickler to use
+   the given protocol; supported protocols are 0 to :data:`HIGHEST_PROTOCOL`.
+   If not specified, the default is :data:`DEFAULT_PROTOCOL`.  If a negative
+   number is specified, :data:`HIGHEST_PROTOCOL` is selected.
 
    The *file* argument must have a write() method that accepts a single bytes
    argument.  It can thus be an on-disk file opened for binary writing, a
@@ -187,64 +197,57 @@
    interface.
 
    If *fix_imports* is true and *protocol* is less than 3, pickle will try to
-   map the new Python 3.x names to the old module names used in Python 2.x,
-   so that the pickle data stream is readable with Python 2.x.
+   map the new Python 3 names to the old module names used in Python 2, so
+   that the pickle data stream is readable with Python 2.
 
 .. function:: dumps(obj, protocol=None, \*, fix_imports=True)
 
-   Return the pickled representation of the object as a :class:`bytes`
-   object, instead of writing it to a file.
+   Return the pickled representation of the object as a :class:`bytes` object,
+   instead of writing it to a file.
 
-   The optional *protocol* argument tells the pickler to use the given protocol;
-   supported protocols are 0, 1, 2, 3.  The default protocol is 3; a
-   backward-incompatible protocol designed for Python 3.0.
-
-   Specifying a negative protocol version selects the highest protocol version
-   supported.  The higher the protocol used, the more recent the version of
-   Python needed to read the pickle produced.
-
-   If *fix_imports* is true and *protocol* is less than 3, pickle will try to
-   map the new Python 3.x names to the old module names used in Python 2.x,
-   so that the pickle data stream is readable with Python 2.x.
+   Arguments *protocol* and *fix_imports* have the same meaning as in
+   :func:`dump`.
 
 .. function:: load(file, \*, fix_imports=True, encoding="ASCII", errors="strict")
 
-   Read a pickled object representation from the open :term:`file object` *file*
-   and return the reconstituted object hierarchy specified therein.  This is
-   equivalent to ``Unpickler(file).load()``.
+   Read a pickled object representation from the open :term:`file object`
+   *file* and return the reconstituted object hierarchy specified therein.
+   This is equivalent to ``Unpickler(file).load()``.
 
-   The protocol version of the pickle is detected automatically, so no protocol
-   argument is needed.  Bytes past the pickled object's representation are
-   ignored.
+   The protocol version of the pickle is detected automatically, so no
+   protocol argument is needed.  Bytes past the pickled object's
+   representation are ignored.
 
    The argument *file* must have two methods, a read() method that takes an
    integer argument, and a readline() method that requires no arguments.  Both
-   methods should return bytes.  Thus *file* can be an on-disk file opened
-   for binary reading, a :class:`io.BytesIO` object, or any other custom object
+   methods should return bytes.  Thus *file* can be an on-disk file opened for
+   binary reading, a :class:`io.BytesIO` object, or any other custom object
    that meets this interface.
 
    Optional keyword arguments are *fix_imports*, *encoding* and *errors*,
    which are used to control compatibility support for pickle stream generated
-   by Python 2.x.  If *fix_imports* is true, pickle will try to map the old
-   Python 2.x names to the new names used in Python 3.x.  The *encoding* and
+   by Python 2.  If *fix_imports* is true, pickle will try to map the old
+   Python 2 names to the new names used in Python 3.  The *encoding* and
    *errors* tell pickle how to decode 8-bit string instances pickled by Python
-   2.x; these default to 'ASCII' and 'strict', respectively.
+   2; these default to 'ASCII' and 'strict', respectively.  The *encoding* can
+   be 'bytes' to read these 8-bit string instances as bytes objects.
 
 .. function:: loads(bytes_object, \*, fix_imports=True, encoding="ASCII", errors="strict")
 
    Read a pickled object hierarchy from a :class:`bytes` object and return the
    reconstituted object hierarchy specified therein
 
-   The protocol version of the pickle is detected automatically, so no protocol
-   argument is needed.  Bytes past the pickled object's representation are
-   ignored.
+   The protocol version of the pickle is detected automatically, so no
+   protocol argument is needed.  Bytes past the pickled object's
+   representation are ignored.
 
    Optional keyword arguments are *fix_imports*, *encoding* and *errors*,
    which are used to control compatibility support for pickle stream generated
-   by Python 2.x.  If *fix_imports* is true, pickle will try to map the old
-   Python 2.x names to the new names used in Python 3.x.  The *encoding* and
+   by Python 2.  If *fix_imports* is true, pickle will try to map the old
+   Python 2 names to the new names used in Python 3.  The *encoding* and
    *errors* tell pickle how to decode 8-bit string instances pickled by Python
-   2.x; these default to 'ASCII' and 'strict', respectively.
+   2; these default to 'ASCII' and 'strict', respectively.  The *encoding* can
+   be 'bytes' to read these 8-bit string instances as bytes objects.
 
 
 The :mod:`pickle` module defines three exceptions:
@@ -279,21 +282,19 @@
 
    This takes a binary file for writing a pickle data stream.
 
-   The optional *protocol* argument tells the pickler to use the given protocol;
-   supported protocols are 0, 1, 2, 3.  The default protocol is 3; a
-   backward-incompatible protocol designed for Python 3.0.
-
-   Specifying a negative protocol version selects the highest protocol version
-   supported.  The higher the protocol used, the more recent the version of
-   Python needed to read the pickle produced.
+   The optional *protocol* argument, an integer, tells the pickler to use
+   the given protocol; supported protocols are 0 to :data:`HIGHEST_PROTOCOL`.
+   If not specified, the default is :data:`DEFAULT_PROTOCOL`.  If a negative
+   number is specified, :data:`HIGHEST_PROTOCOL` is selected.
 
    The *file* argument must have a write() method that accepts a single bytes
    argument.  It can thus be an on-disk file opened for binary writing, a
-   :class:`io.BytesIO` instance, or any other custom object that meets this interface.
+   :class:`io.BytesIO` instance, or any other custom object that meets this
+   interface.
 
    If *fix_imports* is true and *protocol* is less than 3, pickle will try to
-   map the new Python 3.x names to the old module names used in Python 2.x,
-   so that the pickle data stream is readable with Python 2.x.
+   map the new Python 3 names to the old module names used in Python 2, so
+   that the pickle data stream is readable with Python 2.
 
    .. method:: dump(obj)
 
@@ -355,16 +356,17 @@
 
    The argument *file* must have two methods, a read() method that takes an
    integer argument, and a readline() method that requires no arguments.  Both
-   methods should return bytes.  Thus *file* can be an on-disk file object opened
-   for binary reading, a :class:`io.BytesIO` object, or any other custom object
-   that meets this interface.
+   methods should return bytes.  Thus *file* can be an on-disk file object
+   opened for binary reading, a :class:`io.BytesIO` object, or any other
+   custom object that meets this interface.
 
    Optional keyword arguments are *fix_imports*, *encoding* and *errors*,
    which are used to control compatibility support for pickle stream generated
-   by Python 2.x.  If *fix_imports* is true, pickle will try to map the old
-   Python 2.x names to the new names used in Python 3.x.  The *encoding* and
+   by Python 2.  If *fix_imports* is true, pickle will try to map the old
+   Python 2 names to the new names used in Python 3.  The *encoding* and
    *errors* tell pickle how to decode 8-bit string instances pickled by Python
-   2.x; these default to 'ASCII' and 'strict', respectively.
+   2; these default to 'ASCII' and 'strict', respectively.  The *encoding* can
+   be 'bytes' to read these ß8-bit string instances as bytes objects.
 
    .. method:: load()
 
@@ -409,7 +411,8 @@
 
 * tuples, lists, sets, and dictionaries containing only picklable objects
 
-* functions defined at the top level of a module
+* functions defined at the top level of a module (using :keyword:`def`, not
+  :keyword:`lambda`)
 
 * built-in functions defined at the top level of a module
 
@@ -427,7 +430,7 @@
 :func:`sys.setrecursionlimit`.
 
 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
+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
 defining module must be importable in the unpickling environment, and the module
@@ -483,12 +486,29 @@
 Classes can alter the default behaviour by providing one or several special
 methods:
 
+.. method:: object.__getnewargs_ex__()
+
+   In protocols 4 and newer, classes that implements the
+   :meth:`__getnewargs_ex__` method can dictate the values passed to the
+   :meth:`__new__` method upon unpickling.  The method must return a pair
+   ``(args, kwargs)`` where *args* is a tuple of positional arguments
+   and *kwargs* a dictionary of named arguments for constructing the
+   object.  Those will be passed to the :meth:`__new__` method upon
+   unpickling.
+
+   You should implement this method if the :meth:`__new__` method of your
+   class requires keyword-only arguments.  Otherwise, it is recommended for
+   compatibility to implement :meth:`__getnewargs__`.
+
+
 .. method:: object.__getnewargs__()
 
-   In protocol 2 and newer, classes that implements the :meth:`__getnewargs__`
-   method can dictate the values passed to the :meth:`__new__` method upon
-   unpickling.  This is often needed for classes whose :meth:`__new__` method
-   requires arguments.
+   This method serve a similar purpose as :meth:`__getnewargs_ex__` but
+   for protocols 2 and newer.  It must return a tuple of arguments ``args``
+   which will be passed to the :meth:`__new__` method upon unpickling.
+
+   In protocols 4 and newer, :meth:`__getnewargs__` will not be called if
+   :meth:`__getnewargs_ex__` is defined.
 
 
 .. method:: object.__getstate__()
@@ -520,10 +540,10 @@
 
    At unpickling time, some methods like :meth:`__getattr__`,
    :meth:`__getattribute__`, or :meth:`__setattr__` may be called upon the
-   instance.  In case those methods rely on some internal invariant being true,
-   the type should implement :meth:`__getnewargs__` to establish such an
-   invariant; otherwise, neither :meth:`__new__` nor :meth:`__init__` will be
-   called.
+   instance.  In case those methods rely on some internal invariant being
+   true, the type should implement :meth:`__getnewargs__` or
+   :meth:`__getnewargs_ex__` to establish such an invariant; otherwise,
+   neither :meth:`__new__` nor :meth:`__init__` will be called.
 
 .. index:: pair: copy; protocol
 
@@ -535,7 +555,7 @@
 
 Although powerful, implementing :meth:`__reduce__` directly in your classes is
 error prone.  For this reason, class designers should use the high-level
-interface (i.e., :meth:`__getnewargs__`, :meth:`__getstate__` and
+interface (i.e., :meth:`__getnewargs_ex__`, :meth:`__getstate__` and
 :meth:`__setstate__`) whenever possible.  We will show, however, cases where
 using :meth:`__reduce__` is the only option or leads to more efficient pickling
 or both.
@@ -883,6 +903,9 @@
 
 .. [#] Don't confuse this with the :mod:`marshal` module
 
+.. [#] This is why :keyword:`lambda` functions cannot be pickled:  all
+    :keyword:`lambda` functions share the same name:  ``<lambda>``.
+
 .. [#] The exception raised will likely be an :exc:`ImportError` or an
    :exc:`AttributeError` but it could be something else.
 
diff --git a/Doc/library/pkgutil.rst b/Doc/library/pkgutil.rst
index 7c4f912..13ea7b9 100644
--- a/Doc/library/pkgutil.rst
+++ b/Doc/library/pkgutil.rst
@@ -74,15 +74,17 @@
 
    Retrieve a :pep:`302` module loader for the given *fullname*.
 
-   This is a convenience wrapper around :func:`importlib.find_loader` that
-   sets the *path* argument correctly when searching for submodules, and
-   also ensures parent packages (if any) are imported before searching for
-   submodules.
+   This is a backwards compatibility wrapper around
+   :func:`importlib.util.find_spec` that converts most failures to
+   :exc:`ImportError` and only returns the loader rather than the full
+   :class:`ModuleSpec`.
 
    .. versionchanged:: 3.3
       Updated to be based directly on :mod:`importlib` rather than relying
       on the package internal PEP 302 import emulation.
 
+   .. versionchanged:: 3.4
+      Updated to be based on :pep:`451`
 
 .. function:: get_importer(path_item)
 
@@ -109,14 +111,13 @@
    not already imported, its containing package (if any) is imported, in order
    to establish the package ``__path__``.
 
-   This function uses :func:`iter_importers`, and is thus subject to the same
-   limitations regarding platform-specific special import locations such as the
-   Windows registry.
-
    .. versionchanged:: 3.3
       Updated to be based directly on :mod:`importlib` rather than relying
       on the package internal PEP 302 import emulation.
 
+   .. versionchanged:: 3.4
+      Updated to be based on :pep:`451`
+
 
 .. function:: iter_importers(fullname='')
 
diff --git a/Doc/library/plistlib.rst b/Doc/library/plistlib.rst
index a267368..2bef120 100644
--- a/Doc/library/plistlib.rst
+++ b/Doc/library/plistlib.rst
@@ -16,66 +16,174 @@
 --------------
 
 This module provides an interface for reading and writing the "property list"
-XML files used mainly by Mac OS X.
+files used mainly by Mac OS X and supports both binary and XML plist files.
 
-The property list (``.plist``) file format is a simple XML pickle supporting
+The property list (``.plist``) file format is a simple serialization supporting
 basic object types, like dictionaries, lists, numbers and strings.  Usually the
 top level object is a dictionary.
 
-To write out and to parse a plist file, use the :func:`writePlist` and
-:func:`readPlist` functions.
+To write out and to parse a plist file, use the :func:`dump` and
+:func:`load` functions.
 
-To work with plist data in bytes objects, use :func:`writePlistToBytes`
-and :func:`readPlistFromBytes`.
+To work with plist data in bytes objects, use :func:`dumps`
+and :func:`loads`.
 
 Values can be strings, integers, floats, booleans, tuples, lists, dictionaries
-(but only with string keys), :class:`Data` or :class:`datetime.datetime`
-objects.  String values (including dictionary keys) have to be unicode strings --
-they will be written out as UTF-8.
+(but only with string keys), :class:`Data`, :class:`bytes`, :class:`bytesarray`
+or :class:`datetime.datetime` objects.
 
-The ``<data>`` plist type is supported through the :class:`Data` class.  This is
-a thin wrapper around a Python bytes object.  Use :class:`Data` if your strings
-contain control characters.
+.. versionchanged:: 3.4
+   New API, old API deprecated.  Support for binary format plists added.
 
 .. seealso::
 
-   `PList manual page <http://developer.apple.com/documentation/Darwin/Reference/ManPages/man5/plist.5.html>`_
+   `PList manual page <https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man5/plist.5.html>`_
       Apple's documentation of the file format.
 
 
 This module defines the following functions:
 
-.. function:: readPlist(pathOrFile)
+.. function:: load(fp, \*, fmt=None, use_builtin_types=True, dict_type=dict)
 
-   Read a plist file. *pathOrFile* may either be a file name or a (readable and
-   binary) file object.  Return the unpacked root object (which usually is a
+   Read a plist file. *fp* should be a readable and binary file object.
+   Return the unpacked root object (which usually is a
    dictionary).
 
-   The XML data is parsed using the Expat parser from :mod:`xml.parsers.expat`
-   -- see its documentation for possible exceptions on ill-formed XML.
-   Unknown elements will simply be ignored by the plist parser.
+   The *fmt* is the format of the file and the following values are valid:
+
+   * :data:`None`: Autodetect the file format
+
+   * :data:`FMT_XML`: XML file format
+
+   * :data:`FMT_BINARY`: Binary plist format
+
+   If *use_builtin_types* is true (the default) binary data will be returned
+   as instances of :class:`bytes`, otherwise it is returned as instances of
+   :class:`Data`.
+
+   The *dict_type* is the type used for dictionaries that are read from the
+   plist file. The exact structure of the plist can be recovered by using
+   :class:`collections.OrderedDict` (although the order of keys shouldn't be
+   important in plist files).
+
+   XML data for the :data:`FMT_XML` format is parsed using the Expat parser
+   from :mod:`xml.parsers.expat` -- see its documentation for possible
+   exceptions on ill-formed XML.  Unknown elements will simply be ignored
+   by the plist parser.
+
+   The parser for the binary format raises :exc:`InvalidFileException`
+   when the file cannot be parsed.
+
+   .. versionadded:: 3.4
+
+
+.. function:: loads(data, \*, fmt=None, use_builtin_types=True, dict_type=dict)
+
+   Load a plist from a bytes object. See :func:`load` for an explanation of
+   the keyword arguments.
+
+   .. versionadded:: 3.4
+
+
+.. function:: dump(value, fp, \*, fmt=FMT_XML, sort_keys=True, skipkeys=False)
+
+   Write *value* to a plist file. *Fp* should be a writable, binary
+   file object.
+
+   The *fmt* argument specifies the format of the plist file and can be
+   one of the following values:
+
+   * :data:`FMT_XML`: XML formatted plist file
+
+   * :data:`FMT_BINARY`: Binary formatted plist file
+
+   When *sort_keys* is true (the default) the keys for dictionaries will be
+   written to the plist in sorted order, otherwise they will be written in
+   the iteration order of the dictionary.
+
+   When *skipkeys* is false (the default) the function raises :exc:`TypeError`
+   when a key of a dictionary is not a string, otherwise such keys are skipped.
+
+   A :exc:`TypeError` will be raised if the object is of an unsupported type or
+   a container that contains objects of unsupported types.
+
+   An :exc:`OverflowError` will be raised for integer values that cannot
+   be represented in (binary) plist files.
+
+   .. versionadded:: 3.4
+
+
+.. function:: dumps(value, \*, fmt=FMT_XML, sort_keys=True, skipkeys=False)
+
+   Return *value* as a plist-formatted bytes object. See
+   the documentation for :func:`dump` for an explanation of the keyword
+   arguments of this function.
+
+   .. versionadded:: 3.4
+
+The following functions are deprecated:
+
+.. function:: readPlist(pathOrFile)
+
+   Read a plist file. *pathOrFile* may be either a file name or a (readable
+   and binary) file object. Returns the unpacked root object (which usually
+   is a dictionary).
+
+   This function calls :func:`load` to do the actual work, the the documentation
+   of :func:`that function <load>` for an explanation of the keyword arguments.
+
+   .. note::
+
+      Dict values in the result have a ``__getattr__`` method that defers
+      to ``__getitem_``. This means that you can use attribute access to
+      access items of these dictionaries.
+
+   .. deprecated:: 3.4 Use :func:`load` instead.
 
 
 .. function:: writePlist(rootObject, pathOrFile)
 
-    Write *rootObject* to a plist file. *pathOrFile* may either be a file name
-    or a (writable and binary) file object.
+   Write *rootObject* to an XML plist file. *pathOrFile* may be either a file name
+   or a (writable and binary) file object
 
-    A :exc:`TypeError` will be raised if the object is of an unsupported type or
-    a container that contains objects of unsupported types.
+   .. deprecated:: 3.4 Use :func:`dump` instead.
 
 
 .. function:: readPlistFromBytes(data)
 
    Read a plist data from a bytes object.  Return the root object.
 
+   See :func:`load` for a description of the keyword arguments.
+
+   .. note::
+
+      Dict values in the result have a ``__getattr__`` method that defers
+      to ``__getitem_``. This means that you can use attribute access to
+      access items of these dictionaries.
+
+   .. deprecated:: 3.4 Use :func:`loads` instead.
+
 
 .. function:: writePlistToBytes(rootObject)
 
-   Return *rootObject* as a plist-formatted bytes object.
+   Return *rootObject* as an XML plist-formatted bytes object.
+
+   .. deprecated:: 3.4 Use :func:`dumps` instead.
 
 
-The following class is available:
+The following classes are available:
+
+.. class:: Dict([dict]):
+
+   Return an extended mapping object with the same value as dictionary
+   *dict*.
+
+   This class is a subclass of :class:`dict` where attribute access can
+   be used to access items. That is, ``aDict.key`` is the same as
+   ``aDict['key']`` for getting, setting and deleting items in the mapping.
+
+   .. deprecated:: 3.0
+
 
 .. class:: Data(data)
 
@@ -86,6 +194,24 @@
    It has one attribute, :attr:`data`, that can be used to retrieve the Python
    bytes object stored in it.
 
+   .. deprecated:: 3.4 Use a :class:`bytes` object instead
+
+
+The following constants are available:
+
+.. data:: FMT_XML
+
+   The XML format for plist files.
+
+   .. versionadded:: 3.4
+
+
+.. data:: FMT_BINARY
+
+   The binary format for plist files
+
+   .. versionadded:: 3.4
+
 
 Examples
 --------
@@ -103,13 +229,15 @@
             aTrueValue = True,
             aFalseValue = False,
         ),
-        someData = Data(b"<binary gunk>"),
-        someMoreData = Data(b"<lots of binary gunk>" * 10),
+        someData = b"<binary gunk>",
+        someMoreData = b"<lots of binary gunk>" * 10,
         aDate = datetime.datetime.fromtimestamp(time.mktime(time.gmtime())),
     )
-    writePlist(pl, fileName)
+    with open(fileName, 'wb') as fp:
+        dump(pl, fp)
 
 Parsing a plist::
 
-    pl = readPlist(pathOrFile)
+    with open(fileName, 'rb') as fp:
+        pl = load(fp)
     print(pl["aKey"])
diff --git a/Doc/library/poplib.rst b/Doc/library/poplib.rst
index b4080d6..45baad9 100644
--- a/Doc/library/poplib.rst
+++ b/Doc/library/poplib.rst
@@ -13,8 +13,11 @@
 --------------
 
 This module defines a class, :class:`POP3`, which encapsulates a connection to a
-POP3 server and implements the protocol as defined in :rfc:`1725`.  The
-:class:`POP3` class supports both the minimal and optional command sets.
+POP3 server and implements the protocol as defined in :rfc:`1939`. The
+:class:`POP3` class supports both the minimal and optional command sets from
+:rfc:`1939`. The :class:`POP3` class also supports the ``STLS`` command introduced
+in :rfc:`2595` to enable encrypted communication on an already established connection.
+
 Additionally, this module provides a class :class:`POP3_SSL`, which provides
 support for connecting to POP3 servers that use SSL as an underlying protocol
 layer.
@@ -40,16 +43,23 @@
 
    This is a subclass of :class:`POP3` that connects to the server over an SSL
    encrypted socket.  If *port* is not specified, 995, the standard POP3-over-SSL
-   port is used.  *keyfile* and *certfile* are also optional - they can contain a
-   PEM formatted private key and certificate chain file for the SSL connection.
-   *timeout* works as in the :class:`POP3` constructor. *context* parameter is a
-   :class:`ssl.SSLContext` object which allows bundling SSL configuration
-   options, certificates and private keys into a single (potentially long-lived)
-   structure.
+   port is used.  *timeout* works as in the :class:`POP3` constructor.
+   *context* is an optional :class:`ssl.SSLContext` object which allows
+   bundling SSL configuration options, certificates and private keys into a
+   single (potentially long-lived) structure.  Please read :ref:`ssl-security`
+   for best practices.
+
+   *keyfile* and *certfile* are a legacy alternative to *context* - they can
+   point to PEM-formatted private key and certificate chain files,
+   respectively, for the SSL connection.
 
    .. versionchanged:: 3.2
       *context* parameter added.
 
+   .. versionchanged:: 3.4
+      The class now supports hostname check with
+      :attr:`ssl.SSLContext.check_hostname` and *Server Name Indication* (see
+      :data:`ssl.HAS_SNI`).
 
 One exception is defined as an attribute of the :mod:`poplib` module:
 
@@ -97,6 +107,14 @@
    Returns the greeting string sent by the POP3 server.
 
 
+.. method:: POP3.capa()
+
+   Query the server's capabilities as specified in :rfc:`2449`.
+   Returns a dictionary in the form ``{'name': ['param'...]}``.
+
+   .. versionadded:: 3.4
+
+
 .. method:: POP3.user(username)
 
    Send user command, response should indicate that a password is required.
@@ -176,6 +194,23 @@
    the unique id for that message in the form ``'response mesgnum uid``, otherwise
    result is list ``(response, ['mesgnum uid', ...], octets)``.
 
+.. method:: POP3.stls(context=None)
+
+   Start a TLS session on the active connection as specified in :rfc:`2595`.
+   This is only allowed before user authentication
+
+   *context* parameter is a :class:`ssl.SSLContext` object which allows
+   bundling SSL configuration options, certificates and private keys into
+   a single (potentially long-lived) structure.  Please read :ref:`ssl-security`
+   for best practices.
+
+   This method supports hostname checking via
+   :attr:`ssl.SSLContext.check_hostname` and *Server Name Indication* (see
+   :data:`ssl.HAS_SNI`).
+
+   .. versionadded:: 3.4
+
+
 Instances of :class:`POP3_SSL` have no additional methods. The interface of this
 subclass is identical to its parent.
 
diff --git a/Doc/library/pprint.rst b/Doc/library/pprint.rst
index 3a86331..c0589a3 100644
--- a/Doc/library/pprint.rst
+++ b/Doc/library/pprint.rst
@@ -14,8 +14,8 @@
 Python data structures in a form which can be used as input to the interpreter.
 If the formatted structures include objects which are not fundamental Python
 types, the representation may not be loadable.  This may be the case if objects
-such as files, sockets, classes, or instances are included, as well as many
-other built-in objects which are not representable as Python constants.
+such as files, sockets or classes are included, as well as many other
+objects which are not representable as Python literals.
 
 The formatted representation keeps objects on a single line if it can, and
 breaks them onto multiple lines if they don't fit within the allowed width.
@@ -29,14 +29,14 @@
 .. First the implementation class:
 
 
-.. class:: PrettyPrinter(indent=1, width=80, depth=None, stream=None)
+.. class:: PrettyPrinter(indent=1, width=80, depth=None, stream=None, *, \
+                         compact=False)
 
    Construct a :class:`PrettyPrinter` instance.  This constructor understands
    several keyword parameters.  An output stream may be set using the *stream*
    keyword; the only method used on the stream object is the file protocol's
    :meth:`write` method.  If not specified, the :class:`PrettyPrinter` adopts
-   ``sys.stdout``.  Three additional parameters may be used to control the
-   formatted representation.  The keywords are *indent*, *depth*, and *width*.  The
+   ``sys.stdout``.  The
    amount of indentation added for each recursive level is specified by *indent*;
    the default is one.  Other values can cause output to look a little odd, but can
    make nesting easier to spot.  The number of levels which may be printed is
@@ -45,7 +45,12 @@
    the depth of the objects being formatted.  The desired output width is
    constrained using the *width* parameter; the default is 80 characters.  If a
    structure cannot be formatted within the constrained width, a best effort will
-   be made.
+   be made.  If *compact* is false (the default) each item of a long sequence
+   will be formatted on a separate line.  If *compact* is true, as many items
+   as will fit within the *width* will be formatted on each output line.
+
+   .. versionchanged:: 3.4
+      Added the *compact* parameter.
 
       >>> import pprint
       >>> stuff = ['spam', 'eggs', 'lumberjack', 'knights', 'ni']
@@ -58,6 +63,12 @@
           'lumberjack',
           'knights',
           'ni']
+      >>> pp = pprint.PrettyPrinter(width=41, compact=True)
+      >>> pp.pprint(stuff)
+      [['spam', 'eggs', 'lumberjack',
+        'knights', 'ni'],
+       'spam', 'eggs', 'lumberjack', 'knights',
+       'ni']
       >>> tup = ('spam', ('eggs', ('lumberjack', ('knights', ('ni', ('dead',
       ... ('parrot', ('fresh fruit',))))))))
       >>> pp = pprint.PrettyPrinter(depth=6)
@@ -65,23 +76,30 @@
       ('spam', ('eggs', ('lumberjack', ('knights', ('ni', ('dead', (...)))))))
 
 
-The :class:`PrettyPrinter` class supports several derivative functions:
+The :mod:`pprint` module also provides several shortcut functions:
 
-.. function:: pformat(object, indent=1, width=80, depth=None)
+.. function:: pformat(object, indent=1, width=80, depth=None, *, compact=False)
 
-   Return the formatted representation of *object* as a string.  *indent*, *width*
-   and *depth* will be passed to the :class:`PrettyPrinter` constructor as
-   formatting parameters.
+   Return the formatted representation of *object* as a string.  *indent*,
+   *width*, *depth* and *compact* will be passed to the :class:`PrettyPrinter`
+   constructor as formatting parameters.
+
+   .. versionchanged:: 3.4
+      Added the *compact* parameter.
 
 
-.. function:: pprint(object, stream=None, indent=1, width=80, depth=None)
+.. function:: pprint(object, stream=None, indent=1, width=80, depth=None, *, \
+                     compact=False)
 
    Prints the formatted representation of *object* on *stream*, followed by a
    newline.  If *stream* is ``None``, ``sys.stdout`` is used.  This may be used
    in the interactive interpreter instead of the :func:`print` function for
    inspecting values (you can even reassign ``print = pprint.pprint`` for use
-   within a scope).  *indent*, *width* and *depth* will be passed to the
-   :class:`PrettyPrinter` constructor as formatting parameters.
+   within a scope).  *indent*, *width*, *depth* and *compact* will be passed
+   to the :class:`PrettyPrinter` constructor as formatting parameters.
+
+   .. versionchanged:: 3.4
+      Added the *compact* parameter.
 
       >>> import pprint
       >>> stuff = ['spam', 'eggs', 'lumberjack', 'knights', 'ni']
@@ -193,101 +211,141 @@
 -------
 
 To demonstrate several uses of the :func:`pprint` function and its parameters,
-let's fetch information about a project from PyPI::
+let's fetch information about a project from `PyPI <https://pypi.python.org/pypi>`_::
 
    >>> import json
    >>> import pprint
    >>> from urllib.request import urlopen
-   >>> with urlopen('http://pypi.python.org/pypi/configparser/json') as url:
+   >>> with urlopen('http://pypi.python.org/pypi/Twisted/json') as url:
    ...     http_info = url.info()
    ...     raw_data = url.read().decode(http_info.get_content_charset())
    >>> project_info = json.loads(raw_data)
-   >>> result = {'headers': http_info.items(), 'body': project_info}
 
 In its basic form, :func:`pprint` shows the whole object::
 
-   >>> pprint.pprint(result)
-   {'body': {'info': {'_pypi_hidden': False,
-                      '_pypi_ordering': 12,
-                      'classifiers': ['Development Status :: 4 - Beta',
-                                      'Intended Audience :: Developers',
-                                      'License :: OSI Approved :: MIT License',
-                                      'Natural Language :: English',
-                                      'Operating System :: OS Independent',
-                                      'Programming Language :: Python',
-                                      'Programming Language :: Python :: 2',
-                                      'Programming Language :: Python :: 2.6',
-                                      'Programming Language :: Python :: 2.7',
-                                      'Topic :: Software Development :: Libraries',
-                                      'Topic :: Software Development :: Libraries :: Python Modules'],
-                      'download_url': 'UNKNOWN',
-                      'home_page': 'http://docs.python.org/py3k/library/configparser.html',
-                      'keywords': 'configparser ini parsing conf cfg configuration file',
-                      'license': 'MIT',
-                      'name': 'configparser',
-                      'package_url': 'http://pypi.python.org/pypi/configparser',
-                      'platform': 'any',
-                      'release_url': 'http://pypi.python.org/pypi/configparser/3.2.0r3',
-                      'requires_python': None,
-                      'stable_version': None,
-                      'summary': 'This library brings the updated configparser from Python 3.2+ to Python 2.6-2.7.',
-                      'version': '3.2.0r3'},
-           'urls': [{'comment_text': '',
-                     'downloads': 47,
-                     'filename': 'configparser-3.2.0r3.tar.gz',
-                     'has_sig': False,
-                     'md5_digest': '8500fd87c61ac0de328fc996fce69b96',
-                     'packagetype': 'sdist',
-                     'python_version': 'source',
-                     'size': 32281,
-                     'upload_time': '2011-05-10T16:28:50',
-                     'url': 'http://pypi.python.org/packages/source/c/configparser/configparser-3.2.0r3.tar.gz'}]},
-   'headers': [('Date', 'Sat, 14 May 2011 12:48:52 GMT'),
-               ('Server', 'Apache/2.2.16 (Debian)'),
-               ('Content-Disposition', 'inline'),
-               ('Connection', 'close'),
-               ('Transfer-Encoding', 'chunked'),
-               ('Content-Type', 'application/json; charset="UTF-8"')]}
+   >>> pprint.pprint(project_info)
+   {'info': {'_pypi_hidden': False,
+             '_pypi_ordering': 125,
+             'author': 'Glyph Lefkowitz',
+             'author_email': 'glyph@twistedmatrix.com',
+             'bugtrack_url': '',
+             'cheesecake_code_kwalitee_id': None,
+             'cheesecake_documentation_id': None,
+             'cheesecake_installability_id': None,
+             'classifiers': ['Programming Language :: Python :: 2.6',
+                             'Programming Language :: Python :: 2.7',
+                             'Programming Language :: Python :: 2 :: Only'],
+             'description': 'An extensible framework for Python programming, '
+                            'with special focus\r\n'
+                            'on event-based network programming and '
+                            'multiprotocol integration.',
+             'docs_url': '',
+             'download_url': 'UNKNOWN',
+             'home_page': 'http://twistedmatrix.com/',
+             'keywords': '',
+             'license': 'MIT',
+             'maintainer': '',
+             'maintainer_email': '',
+             'name': 'Twisted',
+             'package_url': 'http://pypi.python.org/pypi/Twisted',
+             'platform': 'UNKNOWN',
+             'release_url': 'http://pypi.python.org/pypi/Twisted/12.3.0',
+             'requires_python': None,
+             'stable_version': None,
+             'summary': 'An asynchronous networking framework written in Python',
+             'version': '12.3.0'},
+    'urls': [{'comment_text': '',
+              'downloads': 71844,
+              'filename': 'Twisted-12.3.0.tar.bz2',
+              'has_sig': False,
+              'md5_digest': '6e289825f3bf5591cfd670874cc0862d',
+              'packagetype': 'sdist',
+              'python_version': 'source',
+              'size': 2615733,
+              'upload_time': '2012-12-26T12:47:03',
+              'url': 'https://pypi.python.org/packages/source/T/Twisted/Twisted-12.3.0.tar.bz2'},
+             {'comment_text': '',
+              'downloads': 5224,
+              'filename': 'Twisted-12.3.0.win32-py2.7.msi',
+              'has_sig': False,
+              'md5_digest': '6b778f5201b622a5519a2aca1a2fe512',
+              'packagetype': 'bdist_msi',
+              'python_version': '2.7',
+              'size': 2916352,
+              'upload_time': '2012-12-26T12:48:15',
+              'url': 'https://pypi.python.org/packages/2.7/T/Twisted/Twisted-12.3.0.win32-py2.7.msi'}]}
 
 The result can be limited to a certain *depth* (ellipsis is used for deeper
 contents)::
 
-   >>> pprint.pprint(result, depth=3)
-   {'body': {'info': {'_pypi_hidden': False,
-                      '_pypi_ordering': 12,
-                      'classifiers': [...],
-                      'download_url': 'UNKNOWN',
-                      'home_page': 'http://docs.python.org/py3k/library/configparser.html',
-                      'keywords': 'configparser ini parsing conf cfg configuration file',
-                      'license': 'MIT',
-                      'name': 'configparser',
-                      'package_url': 'http://pypi.python.org/pypi/configparser',
-                      'platform': 'any',
-                      'release_url': 'http://pypi.python.org/pypi/configparser/3.2.0r3',
-                      'requires_python': None,
-                      'stable_version': None,
-                      'summary': 'This library brings the updated configparser from Python 3.2+ to Python 2.6-2.7.',
-                      'version': '3.2.0r3'},
-           'urls': [{...}]},
-   'headers': [('Date', 'Sat, 14 May 2011 12:48:52 GMT'),
-               ('Server', 'Apache/2.2.16 (Debian)'),
-               ('Content-Disposition', 'inline'),
-               ('Connection', 'close'),
-               ('Transfer-Encoding', 'chunked'),
-               ('Content-Type', 'application/json; charset="UTF-8"')]}
+   >>> pprint.pprint(project_info, depth=2)
+   {'info': {'_pypi_hidden': False,
+             '_pypi_ordering': 125,
+             'author': 'Glyph Lefkowitz',
+             'author_email': 'glyph@twistedmatrix.com',
+             'bugtrack_url': '',
+             'cheesecake_code_kwalitee_id': None,
+             'cheesecake_documentation_id': None,
+             'cheesecake_installability_id': None,
+             'classifiers': [...],
+             'description': 'An extensible framework for Python programming, '
+                            'with special focus\r\n'
+                            'on event-based network programming and '
+                            'multiprotocol integration.',
+             'docs_url': '',
+             'download_url': 'UNKNOWN',
+             'home_page': 'http://twistedmatrix.com/',
+             'keywords': '',
+             'license': 'MIT',
+             'maintainer': '',
+             'maintainer_email': '',
+             'name': 'Twisted',
+             'package_url': 'http://pypi.python.org/pypi/Twisted',
+             'platform': 'UNKNOWN',
+             'release_url': 'http://pypi.python.org/pypi/Twisted/12.3.0',
+             'requires_python': None,
+             'stable_version': None,
+             'summary': 'An asynchronous networking framework written in Python',
+             'version': '12.3.0'},
+    'urls': [{...}, {...}]}
 
-Additionally, maximum *width* can be suggested. If a long object cannot be
-split, the specified width will be exceeded::
+Additionally, maximum character *width* can be suggested. If a long object
+cannot be split, the specified width will be exceeded::
 
-   >>> pprint.pprint(result['headers'], width=30)
-   [('Date',
-     'Sat, 14 May 2011 12:48:52 GMT'),
-    ('Server',
-     'Apache/2.2.16 (Debian)'),
-    ('Content-Disposition',
-     'inline'),
-    ('Connection', 'close'),
-    ('Transfer-Encoding',
-     'chunked'),
-    ('Content-Type',
-     'application/json; charset="UTF-8"')]
+   >>> pprint.pprint(project_info, depth=2, width=50)
+   {'info': {'_pypi_hidden': False,
+             '_pypi_ordering': 125,
+             'author': 'Glyph Lefkowitz',
+             'author_email': 'glyph@twistedmatrix.com',
+             'bugtrack_url': '',
+             'cheesecake_code_kwalitee_id': None,
+             'cheesecake_documentation_id': None,
+             'cheesecake_installability_id': None,
+             'classifiers': [...],
+             'description': 'An extensible '
+                            'framework for '
+                            'Python programming, '
+                            'with special '
+                            'focus\r\n'
+                            'on event-based '
+                            'network programming '
+                            'and multiprotocol '
+                            'integration.',
+             'docs_url': '',
+             'download_url': 'UNKNOWN',
+             'home_page': 'http://twistedmatrix.com/',
+             'keywords': '',
+             'license': 'MIT',
+             'maintainer': '',
+             'maintainer_email': '',
+             'name': 'Twisted',
+             'package_url': 'http://pypi.python.org/pypi/Twisted',
+             'platform': 'UNKNOWN',
+             'release_url': 'http://pypi.python.org/pypi/Twisted/12.3.0',
+             'requires_python': None,
+             'stable_version': None,
+             'summary': 'An asynchronous '
+                        'networking framework '
+                        'written in Python',
+             'version': '12.3.0'},
+    'urls': [{...}, {...}]}
diff --git a/Doc/library/pty.rst b/Doc/library/pty.rst
index 2b9385b..90baec5 100644
--- a/Doc/library/pty.rst
+++ b/Doc/library/pty.rst
@@ -45,6 +45,9 @@
    a file descriptor. The defaults try to read 1024 bytes each time they are
    called.
 
+   .. versionchanged:: 3.4
+      :func:`spawn` now returns the status value from :func:`os.waitpid`
+      on the child process.
 
 Example
 -------
diff --git a/Doc/library/py_compile.rst b/Doc/library/py_compile.rst
index 07ddc25..bae8450 100644
--- a/Doc/library/py_compile.rst
+++ b/Doc/library/py_compile.rst
@@ -28,7 +28,7 @@
 
 .. function:: compile(file, cfile=None, dfile=None, doraise=False, optimize=-1)
 
-   Compile a source file to byte-code and write out the byte-code cache  file.
+   Compile a source file to byte-code and write out the byte-code cache file.
    The source code is loaded from the file name *file*.  The  byte-code is
    written to *cfile*, which defaults to the :PEP:`3147` path, ending in
    ``.pyc`` (``.pyo`` if optimization is enabled in the current interpreter).
@@ -41,6 +41,13 @@
    is raised.  This function returns the path to byte-compiled file, i.e.
    whatever *cfile* value was used.
 
+   If the path that *cfile* becomes (either explicitly specified or computed)
+   is a symlink or non-regular file, :exc:`FileExistsError` will be raised.
+   This is to act as a warning that import will turn those paths into regular
+   files if it is allowed to write byte-compiled files to those paths. This is
+   a side-effect of import using file renaming to place the final byte-compiled
+   file into place to prevent concurrent file writing issues.
+
    *optimize* controls the optimization level and is passed to the built-in
    :func:`compile` function.  The default of ``-1`` selects the optimization
    level of the current interpreter.
@@ -50,6 +57,13 @@
       default was *file* + ``'c'`` (``'o'`` if optimization was enabled).
       Also added the *optimize* parameter.
 
+   .. versionchanged:: 3.4
+      Changed code to use :mod:`importlib` for the byte-code cache file writing.
+      This means file creation/writing semantics now match what :mod:`importlib`
+      does, e.g. permissions, write-and-move semantics, etc. Also added the
+      caveat that :exc:`FileExistsError` is raised if *cfile* is a symlink or
+      non-regular file.
+
 
 .. function:: main(args=None)
 
diff --git a/Doc/library/pydoc.rst b/Doc/library/pydoc.rst
index e100865..b5e3233 100644
--- a/Doc/library/pydoc.rst
+++ b/Doc/library/pydoc.rst
@@ -20,6 +20,13 @@
 modules.  The documentation can be presented as pages of text on the console,
 served to a Web browser, or saved to HTML files.
 
+For modules, classes, functions and methods, the displayed documentation is
+derived from the docstring (i.e. the :attr:`__doc__` attribute) of the object,
+and recursively of its documentable members.  If there is no docstring,
+:mod:`pydoc` tries to obtain a description from the block of comment lines just
+above the definition of the class, function or method in the source file, or at
+the top of the module (see :func:`inspect.getcomments`).
+
 The built-in function :func:`help` invokes the online help system in the
 interactive interpreter, which uses :mod:`pydoc` to generate its documentation
 as text on the console.  The same text documentation can also be viewed from
@@ -44,6 +51,10 @@
    executed on that occasion.  Use an ``if __name__ == '__main__':`` guard to
    only execute code when a file is invoked as a script and not just imported.
 
+When printing output to the console, :program:`pydoc` attempts to paginate the
+output for easier reading.  If the :envvar:`PAGER` environment variable is set,
+:program:`pydoc` will use its value as a pagination program.
+
 Specifying a ``-w`` flag before the argument will cause HTML documentation
 to be written out to a file in the current directory, instead of displaying text
 on the console.
@@ -59,11 +70,6 @@
 documentation at ``http://localhost:1234/`` in your preferred Web browser.
 Specifying ``0`` as the port number will select an arbitrary unused port.
 
-:program:`pydoc -g` will start the server and additionally bring up a
-small :mod:`tkinter`\ -based graphical interface to help you search for
-documentation pages.  The ``-g`` option is deprecated, since the server can
-now be controlled directly from HTTP clients.
-
 :program:`pydoc -b` will start the server and additionally open a web
 browser to a module index page.  Each served page has a navigation bar at the
 top where you can *Get* help on an individual item, *Search* all modules with a
@@ -76,11 +82,19 @@
 Python interpreter and typed ``import spam``.
 
 Module docs for core modules are assumed to reside in
-``http://docs.python.org/X.Y/library/`` where ``X`` and ``Y`` are the
+``https://docs.python.org/X.Y/library/`` where ``X`` and ``Y`` are the
 major and minor version numbers of the Python interpreter.  This can
 be overridden by setting the :envvar:`PYTHONDOCS` environment variable
 to a different URL or to a local directory containing the Library
 Reference Manual pages.
 
 .. versionchanged:: 3.2
-   Added the ``-b`` option, deprecated the ``-g`` option.
+   Added the ``-b`` option.
+
+.. versionchanged:: 3.3
+   The ``-g`` command line option was removed.
+
+.. versionchanged:: 3.4
+   :mod:`pydoc` now uses :func:`inspect.signature` rather than
+   :func:`inspect.getfullargspec` to extract signature information from
+   callables.
diff --git a/Doc/library/pyexpat.rst b/Doc/library/pyexpat.rst
index 3d88d85..78aa99c 100644
--- a/Doc/library/pyexpat.rst
+++ b/Doc/library/pyexpat.rst
@@ -100,6 +100,11 @@
       http://www.python.org/ns/ elem1
       elem2
 
+   Due to limitations in the ``Expat`` library used by :mod:`pyexpat`,
+   the :class:`xmlparser` instance returned can only be used to parse a single
+   XML document.  Call ``ParserCreate`` for each document to provide unique
+   parser instances.
+
 
 .. seealso::
 
@@ -119,7 +124,9 @@
 
    Parses the contents of the string *data*, calling the appropriate handler
    functions to process the parsed data.  *isfinal* must be true on the final call
-   to this method.  *data* can be the empty string at any time.
+   to this method; it allows the parsing of a single file in fragments,
+   not the submission of multiple files.
+   *data* can be the empty string at any time.
 
 
 .. method:: xmlparser.ParseFile(file)
@@ -861,5 +868,5 @@
 .. [#] The encoding string included in XML output should conform to the
    appropriate standards. For example, "UTF-8" is valid, but "UTF8" is
    not. See http://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EncodingDecl
-   and http://www.iana.org/assignments/character-sets\ .
+   and http://www.iana.org/assignments/character-sets/character-sets.xhtml.
 
diff --git a/Doc/library/python.rst b/Doc/library/python.rst
index b67fbfc..f307d7d 100644
--- a/Doc/library/python.rst
+++ b/Doc/library/python.rst
@@ -25,4 +25,3 @@
    inspect.rst
    site.rst
    fpectl.rst
-   distutils.rst
diff --git a/Doc/library/quopri.rst b/Doc/library/quopri.rst
index 755811a..3a74cf8 100644
--- a/Doc/library/quopri.rst
+++ b/Doc/library/quopri.rst
@@ -24,9 +24,8 @@
 .. function:: decode(input, output, header=False)
 
    Decode the contents of the *input* file and write the resulting decoded binary
-   data to the *output* file. *input* and *output* must be :term:`file objects
-   <file object>`.  *input* will be read until ``input.readline()`` returns an
-   empty string. If the optional argument *header* is present and true, underscore
+   data to the *output* file. *input* and *output* must be :term:`binary file objects
+   <file object>`.  If the optional argument *header* is present and true, underscore
    will be decoded as space. This is used to decode "Q"-encoded headers as
    described in :rfc:`1522`: "MIME (Multipurpose Internet Mail Extensions)
    Part Two: Message Header Extensions for Non-ASCII Text".
@@ -34,27 +33,28 @@
 
 .. function:: encode(input, output, quotetabs, header=False)
 
-   Encode the contents of the *input* file and write the resulting quoted-printable
-   data to the *output* file. *input* and *output* must be :term:`file objects
-   <file object>`.  *input* will be read until ``input.readline()`` returns an
-   empty string. *quotetabs* is a flag which controls whether to encode embedded
-   spaces and tabs; when true it encodes such embedded whitespace, and when
-   false it leaves them unencoded.  Note that spaces and tabs appearing at the
-   end of lines are always encoded, as per :rfc:`1521`.  *header* is a flag
-   which controls if spaces are encoded as underscores as per :rfc:`1522`.
+   Encode the contents of the *input* file and write the resulting quoted-
+   printable data to the *output* file. *input* and *output* must be
+   :term:`binary file objects <file object>`. *quotetabs*, a flag which controls
+   whether to encode embedded spaces and tabs must be provideda and when true it
+   encodes such embedded whitespace, and when false it leaves them unencoded.
+   Note that spaces and tabs appearing at the end of lines are always encoded,
+   as per :rfc:`1521`.  *header* is a flag which controls if spaces are encoded
+   as underscores as per :rfc:`1522`.
 
 
 .. function:: decodestring(s, header=False)
 
-   Like :func:`decode`, except that it accepts a source string and returns the
-   corresponding decoded string.
+   Like :func:`decode`, except that it accepts a source :class:`bytes` and
+   returns the corresponding decoded :class:`bytes`.
 
 
 .. function:: encodestring(s, quotetabs=False, header=False)
 
-   Like :func:`encode`, except that it accepts a source string and returns the
-   corresponding encoded string.  *quotetabs* and *header* are optional
-   (defaulting to ``False``), and are passed straight through to :func:`encode`.
+   Like :func:`encode`, except that it accepts a source :class:`bytes` and
+   returns the corresponding encoded :class:`bytes`. By default, it sends a
+   False value to *quotetabs* parameter of the :func:`encode` function.
+
 
 
 .. seealso::
diff --git a/Doc/library/re.rst b/Doc/library/re.rst
index dd790e7..dfc25ea 100644
--- a/Doc/library/re.rst
+++ b/Doc/library/re.rst
@@ -38,13 +38,6 @@
 that don't require you to compile a regex object first, but miss some
 fine-tuning parameters.
 
-.. seealso::
-
-   Mastering Regular Expressions
-      Book on regular expressions by Jeffrey Friedl, published by O'Reilly.  The
-      second edition of the book no longer covers Python at all, but the first
-      edition covered writing good regular expression patterns in great detail.
-
 
 .. _re-syntax:
 
@@ -443,6 +436,14 @@
    The ``'\u'`` and ``'\U'`` escape sequences have been added.
 
 
+.. seealso::
+
+   Mastering Regular Expressions
+      Book on regular expressions by Jeffrey Friedl, published by O'Reilly.  The
+      second edition of the book no longer covers Python at all, but the first
+      edition covered writing good regular expression patterns in great detail.
+
+
 
 .. _contents-of-module-re:
 
@@ -458,8 +459,8 @@
 .. function:: compile(pattern, flags=0)
 
    Compile a regular expression pattern into a regular expression object, which
-   can be used for matching using its :func:`match` and :func:`search` methods,
-   described below.
+   can be used for matching using its :func:`~regex.match` and
+   :func:`~regex.search` methods, described below.
 
    The expression's behaviour can be modified by specifying a *flags* value.
    Values can be any of the following variables, combined using bitwise OR (the
@@ -481,7 +482,7 @@
    .. note::
 
       The compiled versions of the most recent patterns passed to
-      :func:`re.match`, :func:`re.search` or :func:`re.compile` are cached, so
+      :func:`re.compile` and the module-level matching functions are cached, so
       programs that use only a few regular expressions at a time needn't worry
       about compiling regular expressions.
 
@@ -563,7 +564,7 @@
 
 .. function:: search(pattern, string, flags=0)
 
-   Scan through *string* looking for a location where the regular expression
+   Scan through *string* looking for the first location where the regular expression
    *pattern* produces a match, and return a corresponding :ref:`match object
    <match-objects>`.  Return ``None`` if no position in the string matches the
    pattern; note that this is different from finding a zero-length match at some
@@ -584,6 +585,16 @@
    instead (see also :ref:`search-vs-match`).
 
 
+.. function:: fullmatch(pattern, string, flags=0)
+
+   If the whole *string* matches the regular expression *pattern*, return a
+   corresponding :ref:`match object <match-objects>`.  Return ``None`` if the
+   string does not match the pattern; note that this is different from a
+   zero-length match.
+
+   .. versionadded:: 3.4
+
+
 .. function:: split(pattern, string, maxsplit=0, flags=0)
 
    Split *string* by the occurrences of *pattern*.  If capturing parentheses are
@@ -755,7 +766,7 @@
 
    >>> pattern = re.compile("d")
    >>> pattern.search("dog")     # Match at index 0
-   <_sre.SRE_Match object at ...>
+   <_sre.SRE_Match object; span=(0, 1), match='d'>
    >>> pattern.search("dog", 1)  # No match; search doesn't include the "d"
 
 
@@ -772,12 +783,30 @@
    >>> pattern = re.compile("o")
    >>> pattern.match("dog")      # No match as "o" is not at the start of "dog".
    >>> pattern.match("dog", 1)   # Match as "o" is the 2nd character of "dog".
-   <_sre.SRE_Match object at ...>
+   <_sre.SRE_Match object; span=(1, 2), match='o'>
 
    If you want to locate a match anywhere in *string*, use
    :meth:`~regex.search` instead (see also :ref:`search-vs-match`).
 
 
+.. method:: regex.fullmatch(string[, pos[, endpos]])
+
+   If the whole *string* matches this regular expression, return a corresponding
+   :ref:`match object <match-objects>`.  Return ``None`` if the string does not
+   match the pattern; note that this is different from a zero-length match.
+
+   The optional *pos* and *endpos* parameters have the same meaning as for the
+   :meth:`~regex.search` method.
+
+   >>> pattern = re.compile("o[gh]")
+   >>> pattern.fullmatch("dog")      # No match as "o" is not at the start of "dog".
+   >>> pattern.fullmatch("ogre")     # No match as not the full string matches.
+   >>> pattern.fullmatch("doggie", 1, 3)   # Matches within given limits.
+   <_sre.SRE_Match object; span=(1, 3), match='og'>
+
+   .. versionadded:: 3.4
+
+
 .. method:: regex.split(string, maxsplit=0)
 
    Identical to the :func:`split` function, using the compiled pattern.
@@ -1139,7 +1168,7 @@
 
    >>> re.match("c", "abcdef")  # No match
    >>> re.search("c", "abcdef") # Match
-   <_sre.SRE_Match object at ...>
+   <_sre.SRE_Match object; span=(2, 3), match='c'>
 
 Regular expressions beginning with ``'^'`` can be used with :func:`search` to
 restrict the match at the beginning of the string::
@@ -1147,7 +1176,7 @@
    >>> re.match("c", "abcdef")  # No match
    >>> re.search("^c", "abcdef") # No match
    >>> re.search("^a", "abcdef")  # Match
-   <_sre.SRE_Match object at ...>
+   <_sre.SRE_Match object; span=(0, 1), match='a'>
 
 Note however that in :const:`MULTILINE` mode :func:`match` only matches at the
 beginning of the string, whereas using :func:`search` with a regular expression
@@ -1155,7 +1184,7 @@
 
    >>> re.match('X', 'A\nB\nX', re.MULTILINE)  # No match
    >>> re.search('^X', 'A\nB\nX', re.MULTILINE)  # Match
-   <_sre.SRE_Match object at ...>
+   <_sre.SRE_Match object; span=(4, 5), match='X'>
 
 
 Making a Phonebook
@@ -1274,9 +1303,9 @@
 functionally identical:
 
    >>> re.match(r"\W(.)\1\W", " ff ")
-   <_sre.SRE_Match object at ...>
+   <_sre.SRE_Match object; span=(0, 4), match=' ff '>
    >>> re.match("\\W(.)\\1\\W", " ff ")
-   <_sre.SRE_Match object at ...>
+   <_sre.SRE_Match object; span=(0, 4), match=' ff '>
 
 When one wants to match a literal backslash, it must be escaped in the regular
 expression.  With raw string notation, this means ``r"\\"``.  Without raw string
@@ -1284,9 +1313,9 @@
 functionally identical:
 
    >>> re.match(r"\\", r"\\")
-   <_sre.SRE_Match object at ...>
+   <_sre.SRE_Match object; span=(0, 1), match='\\'>
    >>> re.match("\\\\", r"\\")
-   <_sre.SRE_Match object at ...>
+   <_sre.SRE_Match object; span=(0, 1), match='\\'>
 
 
 Writing a Tokenizer
@@ -1305,36 +1334,36 @@
 
     Token = collections.namedtuple('Token', ['typ', 'value', 'line', 'column'])
 
-    def tokenize(s):
+    def tokenize(code):
         keywords = {'IF', 'THEN', 'ENDIF', 'FOR', 'NEXT', 'GOSUB', 'RETURN'}
         token_specification = [
             ('NUMBER',  r'\d+(\.\d*)?'), # Integer or decimal number
             ('ASSIGN',  r':='),          # Assignment operator
             ('END',     r';'),           # Statement terminator
             ('ID',      r'[A-Za-z]+'),   # Identifiers
-            ('OP',      r'[+*\/\-]'),    # Arithmetic operators
+            ('OP',      r'[+\-*/]'),     # Arithmetic operators
             ('NEWLINE', r'\n'),          # Line endings
-            ('SKIP',    r'[ \t]'),       # Skip over spaces and tabs
+            ('SKIP',    r'[ \t]+'),      # Skip over spaces and tabs
+            ('MISMATCH',r'.'),           # Any other character
         ]
         tok_regex = '|'.join('(?P<%s>%s)' % pair for pair in token_specification)
-        get_token = re.compile(tok_regex).match
-        line = 1
-        pos = line_start = 0
-        mo = get_token(s)
-        while mo is not None:
-            typ = mo.lastgroup
-            if typ == 'NEWLINE':
-                line_start = pos
-                line += 1
-            elif typ != 'SKIP':
-                val = mo.group(typ)
-                if typ == 'ID' and val in keywords:
-                    typ = val
-                yield Token(typ, val, line, mo.start()-line_start)
-            pos = mo.end()
-            mo = get_token(s, pos)
-        if pos != len(s):
-            raise RuntimeError('Unexpected character %r on line %d' %(s[pos], line))
+        line_num = 1
+        line_start = 0
+        for mo in re.finditer(tok_regex, code):
+            kind = mo.lastgroup
+            value = mo.group(kind)
+            if kind == 'NEWLINE':
+                line_start = mo.end()
+                line_num += 1
+            elif kind == 'SKIP':
+                pass
+            elif kind == 'MISMATCH':
+                raise RuntimeError('%r unexpected on line %d' % (value, line_num))
+            else:
+                if kind == 'ID' and value in keywords:
+                    kind = value
+                column = mo.start() - line_start
+                yield Token(kind, value, line_num, column)
 
     statements = '''
         IF quantity THEN
@@ -1348,22 +1377,22 @@
 
 The tokenizer produces the following output::
 
-    Token(typ='IF', value='IF', line=2, column=5)
-    Token(typ='ID', value='quantity', line=2, column=8)
-    Token(typ='THEN', value='THEN', line=2, column=17)
-    Token(typ='ID', value='total', line=3, column=9)
-    Token(typ='ASSIGN', value=':=', line=3, column=15)
-    Token(typ='ID', value='total', line=3, column=18)
-    Token(typ='OP', value='+', line=3, column=24)
-    Token(typ='ID', value='price', line=3, column=26)
-    Token(typ='OP', value='*', line=3, column=32)
-    Token(typ='ID', value='quantity', line=3, column=34)
-    Token(typ='END', value=';', line=3, column=42)
-    Token(typ='ID', value='tax', line=4, column=9)
-    Token(typ='ASSIGN', value=':=', line=4, column=13)
-    Token(typ='ID', value='price', line=4, column=16)
-    Token(typ='OP', value='*', line=4, column=22)
-    Token(typ='NUMBER', value='0.05', line=4, column=24)
-    Token(typ='END', value=';', line=4, column=28)
-    Token(typ='ENDIF', value='ENDIF', line=5, column=5)
-    Token(typ='END', value=';', line=5, column=10)
+    Token(typ='IF', value='IF', line=2, column=4)
+    Token(typ='ID', value='quantity', line=2, column=7)
+    Token(typ='THEN', value='THEN', line=2, column=16)
+    Token(typ='ID', value='total', line=3, column=8)
+    Token(typ='ASSIGN', value=':=', line=3, column=14)
+    Token(typ='ID', value='total', line=3, column=17)
+    Token(typ='OP', value='+', line=3, column=23)
+    Token(typ='ID', value='price', line=3, column=25)
+    Token(typ='OP', value='*', line=3, column=31)
+    Token(typ='ID', value='quantity', line=3, column=33)
+    Token(typ='END', value=';', line=3, column=41)
+    Token(typ='ID', value='tax', line=4, column=8)
+    Token(typ='ASSIGN', value=':=', line=4, column=12)
+    Token(typ='ID', value='price', line=4, column=15)
+    Token(typ='OP', value='*', line=4, column=21)
+    Token(typ='NUMBER', value='0.05', line=4, column=23)
+    Token(typ='END', value=';', line=4, column=27)
+    Token(typ='ENDIF', value='ENDIF', line=5, column=4)
+    Token(typ='END', value=';', line=5, column=9)
diff --git a/Doc/library/readline.rst b/Doc/library/readline.rst
index 1134619..692310b 100644
--- a/Doc/library/readline.rst
+++ b/Doc/library/readline.rst
@@ -190,28 +190,32 @@
 
 The following example demonstrates how to use the :mod:`readline` module's
 history reading and writing functions to automatically load and save a history
-file named :file:`.pyhist` from the user's home directory.  The code below would
-normally be executed automatically during interactive sessions from the user's
-:envvar:`PYTHONSTARTUP` file. ::
+file named :file:`.python_history` from the user's home directory.  The code
+below would normally be executed automatically during interactive sessions
+from the user's :envvar:`PYTHONSTARTUP` file. ::
 
+   import atexit
    import os
    import readline
-   histfile = os.path.join(os.path.expanduser("~"), ".pyhist")
+
+   histfile = os.path.join(os.path.expanduser("~"), ".python_history")
    try:
        readline.read_history_file(histfile)
    except FileNotFoundError:
        pass
-   import atexit
+
    atexit.register(readline.write_history_file, histfile)
-   del os, histfile
+
+This code is actually automatically run when Python is run in
+:ref:`interactive mode <tut-interactive>` (see :ref:`rlcompleter-config`).
 
 The following example extends the :class:`code.InteractiveConsole` class to
 support history save/restore. ::
 
-   import code
-   import readline
    import atexit
+   import code
    import os
+   import readline
 
    class HistoryConsole(code.InteractiveConsole):
        def __init__(self, locals=None, filename="<console>",
diff --git a/Doc/library/reprlib.rst b/Doc/library/reprlib.rst
index 24a8e52..ee9a10d 100644
--- a/Doc/library/reprlib.rst
+++ b/Doc/library/reprlib.rst
@@ -49,8 +49,8 @@
 
         >>> class MyList(list):
         ...     @recursive_repr()
-        ...      def __repr__(self):
-        ...          return '<' + '|'.join(map(repr, self)) + '>'
+        ...     def __repr__(self):
+        ...         return '<' + '|'.join(map(repr, self)) + '>'
         ...
         >>> m = MyList('abc')
         >>> m.append(m)
@@ -129,9 +129,9 @@
 
    Formatting methods for specific types are implemented as methods with a name
    based on the type name.  In the method name, **TYPE** is replaced by
-   ``string.join(string.split(type(obj).__name__, '_'))``. Dispatch to these
-   methods is handled by :meth:`repr1`. Type-specific methods which need to
-   recursively format a value should call ``self.repr1(subobj, level - 1)``.
+   ``'_'.join(type(obj).__name__.split())``. Dispatch to these methods is
+   handled by :meth:`repr1`. Type-specific methods which need to recursively
+   format a value should call ``self.repr1(subobj, level - 1)``.
 
 
 .. _subclassing-reprs:
@@ -148,12 +148,11 @@
    import sys
 
    class MyRepr(reprlib.Repr):
-       def repr_file(self, obj, level):
-           if obj.name in ['<stdin>', '<stdout>', '<stderr>']:
+
+       def repr_TextIOWrapper(self, obj, level):
+           if obj.name in {'<stdin>', '<stdout>', '<stderr>'}:
                return obj.name
-           else:
-               return repr(obj)
+           return repr(obj)
 
    aRepr = MyRepr()
    print(aRepr.repr(sys.stdin))         # prints '<stdin>'
-
diff --git a/Doc/library/resource.rst b/Doc/library/resource.rst
index ed85850..f8112cc 100644
--- a/Doc/library/resource.rst
+++ b/Doc/library/resource.rst
@@ -74,6 +74,27 @@
    ``setrlimit`` may also raise :exc:`error` if the underlying system call
    fails.
 
+.. function:: prlimit(pid, resource[, limits])
+
+   Combines :func:`setrlimit` and :func:`getrlimit` in one function and
+   supports to get and set the resources limits of an arbitrary process. If
+   *pid* is 0, then the call applies to the current process. *resource* and
+   *limits* have the same meaning as in :func:`setrlimit`, except that
+   *limits* is optional.
+
+   When *limits* is not given the function returns the *resource* limit of the
+   process *pid*. When *limits* is given the *resource* limit of the process is
+   set and the former resource limit is returned.
+
+   Raises :exc:`ProcessLookupError` when *pid* can't be found and
+   :exc:`PermissionError` when the user doesn't have ``CAP_SYS_RESOURCE`` for
+   the process.
+
+   Availability: Linux 2.6.36 or later with glibc 2.13 or later
+
+   .. versionadded:: 3.4
+
+
 These symbols define resources whose consumption can be controlled using the
 :func:`setrlimit` and :func:`getrlimit` functions described below. The values of
 these symbols are exactly the constants used by C programs.
@@ -151,6 +172,80 @@
    The maximum area (in bytes) of address space which may be taken by the process.
 
 
+.. data:: RLIMIT_MSGQUEUE
+
+   The number of bytes that can be allocated for POSIX message queues.
+
+   Availability: Linux 2.6.8 or later.
+
+   .. versionadded:: 3.4
+
+
+.. data:: RLIMIT_NICE
+
+   The ceiling for the process's nice level (calculated as 20 - rlim_cur).
+
+   Availability: Linux 2.6.12 or later.
+
+   .. versionadded:: 3.4
+
+
+.. data:: RLIMIT_RTPRIO
+
+   The ceiling of the real-time priority.
+
+   Availability: Linux 2.6.12 or later.
+
+   .. versionadded:: 3.4
+
+
+.. data:: RLIMIT_RTTIME
+
+   The time limit (in microseconds) on CPU time that a process can spend
+   under real-time scheduling without making a blocking syscall.
+
+   Availability: Linux 2.6.25 or later.
+
+   .. versionadded:: 3.4
+
+
+.. data:: RLIMIT_SIGPENDING
+
+   The number of signals which the process may queue.
+
+   Availability: Linux 2.6.8 or later.
+
+   .. versionadded:: 3.4
+
+.. data:: RLIMIT_SBSIZE
+
+   The maximum size (in bytes) of socket buffer usage for this user.
+   This limits the amount of network memory, and hence the amount of mbufs,
+   that this user may hold at any time.
+
+   Availability: FreeBSD 9 or later.
+
+   .. versionadded:: 3.4
+
+.. data:: RLIMIT_SWAP
+
+   The maximum size (in bytes) of the swap space that may be reserved or
+   used by all of this user id's processes.
+   This limit is enforced only if bit 1 of the vm.overcommit sysctl is set.
+   Please see :manpage:`tuning(7)` for a complete description of this sysctl.
+
+   Availability: FreeBSD 9 or later.
+
+   .. versionadded:: 3.4
+
+.. data:: RLIMIT_NPTS
+
+   The maximum number of pseudo-terminals created by this user id.
+
+   Availability: FreeBSD 9 or later.
+
+   .. versionadded:: 3.4
+
 Resource Usage
 --------------
 
diff --git a/Doc/library/rlcompleter.rst b/Doc/library/rlcompleter.rst
index 633088d..9ed01c7 100644
--- a/Doc/library/rlcompleter.rst
+++ b/Doc/library/rlcompleter.rst
@@ -27,18 +27,10 @@
    readline.__name__         readline.parse_and_bind(
    >>> readline.
 
-The :mod:`rlcompleter` module is designed for use with Python's interactive
-mode.  A user can add the following lines to his or her initialization file
-(identified by the :envvar:`PYTHONSTARTUP` environment variable) to get
-automatic :kbd:`Tab` completion::
-
-   try:
-       import readline
-   except ImportError:
-       print("Module readline not available.")
-   else:
-       import rlcompleter
-       readline.parse_and_bind("tab: complete")
+The :mod:`rlcompleter` module is designed for use with Python's
+:ref:`interactive mode <tut-interactive>`.  Unless Python is run with the
+:option:`-S` option, the module is automatically imported and configured
+(see :ref:`rlcompleter-config`).
 
 On platforms without :mod:`readline`, the :class:`Completer` class defined by
 this module can still be used for custom purposes.
diff --git a/Doc/library/runpy.rst b/Doc/library/runpy.rst
index 6919bc0..7293f15 100644
--- a/Doc/library/runpy.rst
+++ b/Doc/library/runpy.rst
@@ -28,6 +28,9 @@
 
 .. function:: run_module(mod_name, init_globals=None, run_name=None, alter_sys=False)
 
+   .. index::
+      module: __main__
+
    Execute the code of the specified module and return the resulting module
    globals dictionary. The module's code is first located using the standard
    import mechanism (refer to :pep:`302` for details) and then executed in a
@@ -44,28 +47,22 @@
    below are defined in the supplied dictionary, those definitions are
    overridden by :func:`run_module`.
 
-   The special global variables ``__name__``, ``__file__``, ``__cached__``,
-   ``__loader__``
-   and ``__package__`` are set in the globals dictionary before the module
-   code is executed (Note that this is a minimal set of variables - other
-   variables may be set implicitly as an interpreter implementation detail).
+   The special global variables ``__name__``, ``__spec__``, ``__file__``,
+   ``__cached__``, ``__loader__`` and ``__package__`` are set in the globals
+   dictionary before the module code is executed (Note that this is a
+   minimal set of variables - other variables may be set implicitly as an
+   interpreter implementation detail).
 
    ``__name__`` is set to *run_name* if this optional argument is not
    :const:`None`, to ``mod_name + '.__main__'`` if the named module is a
    package and to the *mod_name* argument otherwise.
 
-   ``__file__`` is set to the name provided by the module loader. If the
-   loader does not make filename information available, this variable is set
-   to :const:`None`.
+   ``__spec__`` will be set appropriately for the *actually* imported
+   module (that is, ``__spec__.name`` will always be *mod_name* or
+   ``mod_name + '.__main__``, never *run_name*).
 
-   ``__cached__`` will be set to ``None``.
-
-   ``__loader__`` is set to the :pep:`302` module loader used to retrieve the
-   code for the module (This loader may be a wrapper around the standard
-   import mechanism).
-
-   ``__package__`` is set to *mod_name* if the named module is a package and
-   to ``mod_name.rpartition('.')[0]`` otherwise.
+   ``__file__``, ``__cached__``, ``__loader__`` and ``__package__`` are
+   :ref:`set as normal <import-mod-attrs>` based on the module spec.
 
    If the argument *alter_sys* is supplied and evaluates to :const:`True`,
    then ``sys.argv[0]`` is updated with the value of ``__file__`` and
@@ -78,16 +75,27 @@
    arguments. It is recommended that the :mod:`sys` module be left alone when
    invoking this function from threaded code.
 
+   .. seealso::
+      The :option:`-m` option offering equivalent functionality from the
+      command line.
 
    .. versionchanged:: 3.1
       Added ability to execute packages by looking for a ``__main__`` submodule.
 
    .. versionchanged:: 3.2
-      Added ``__cached__`` global variable (see :PEP:`3147`).
+      Added ``__cached__`` global variable (see :pep:`3147`).
 
+   .. versionchanged:: 3.4
+      Updated to take advantage of the module spec feature added by
+      :pep:`451`. This allows ``__cached__`` to be set correctly for modules
+      run this way, as well as ensuring the real module name is always
+      accessible as ``__spec__.name``.
 
 .. function:: run_path(file_path, init_globals=None, run_name=None)
 
+   .. index::
+      module: __main__
+
    Execute the code at the named filesystem location and return the resulting
    module globals dictionary. As with a script name supplied to the CPython
    command line, the supplied path may refer to a Python source file, a
@@ -108,23 +116,25 @@
    below are defined in the supplied dictionary, those definitions are
    overridden by :func:`run_path`.
 
-   The special global variables ``__name__``, ``__file__``, ``__loader__``
-   and ``__package__`` are set in the globals dictionary before the module
-   code is executed (Note that this is a minimal set of variables - other
-   variables may be set implicitly as an interpreter implementation detail).
+   The special global variables ``__name__``, ``__spec__``, ``__file__``,
+   ``__cached__``, ``__loader__`` and ``__package__`` are set in the globals
+   dictionary before the module code is executed (Note that this is a
+   minimal set of variables - other variables may be set implicitly as an
+   interpreter implementation detail).
 
    ``__name__`` is set to *run_name* if this optional argument is not
    :const:`None` and to ``'<run_path>'`` otherwise.
 
-   ``__file__`` is set to the name provided by the module loader. If the
-   loader does not make filename information available, this variable is set
-   to :const:`None`. For a simple script, this will be set to ``file_path``.
+   If the supplied path directly references a script file (whether as source
+   or as precompiled byte code), then ``__file__`` will be set to the
+   supplied path, and ``__spec__``, ``__cached__``, ``__loader__`` and
+   ``__package__`` will all be set to :const:`None`.
 
-   ``__loader__`` is set to the :pep:`302` module loader used to retrieve the
-   code for the module (This loader may be a wrapper around the standard
-   import mechanism). For a simple script, this will be set to :const:`None`.
-
-   ``__package__`` is set to ``__name__.rpartition('.')[0]``.
+   If the supplied path is a reference to a valid sys.path entry, then
+   ``__spec__`` will be set appropriately for the imported ``__main__``
+   module (that is, ``__spec__.name`` will always be ``__main__``).
+   ``__file__``, ``__cached__``, ``__loader__`` and ``__package__`` will be
+   :ref:`set as normal <import-mod-attrs>` based on the module spec.
 
    A number of alterations are also made to the :mod:`sys` module. Firstly,
    ``sys.path`` may be altered as described above. ``sys.argv[0]`` is updated
@@ -139,16 +149,29 @@
    limitations still apply, use of this function in threaded code should be
    either serialised with the import lock or delegated to a separate process.
 
+   .. seealso::
+      :ref:`using-on-interface-options` for equivalent functionality on the
+      command line (``python path/to/script``).
+
    .. versionadded:: 3.2
 
+   .. versionchanged:: 3.4
+      Updated to take advantage of the module spec feature added by
+      :pep:`451`. This allows ``__cached__`` to be set correctly in the
+      case where ``__main__`` is imported from a valid sys.path entry rather
+      than being executed directly.
+
 .. seealso::
 
-   :pep:`338` - Executing modules as scripts
+   :pep:`338` -- Executing modules as scripts
       PEP written and implemented by Nick Coghlan.
 
-   :pep:`366` - Main module explicit relative imports
+   :pep:`366` -- Main module explicit relative imports
       PEP written and implemented by Nick Coghlan.
 
+   :pep:`451` -- A ModuleSpec Type for the Import System
+      PEP written and implemented by Eric Snow
+
    :ref:`using-on-general` - CPython command line details
 
    The :func:`importlib.import_module` function
diff --git a/Doc/library/select.rst b/Doc/library/select.rst
index b1fd3a8..734e426 100644
--- a/Doc/library/select.rst
+++ b/Doc/library/select.rst
@@ -14,6 +14,14 @@
 It cannot be used on regular files to determine whether a file has grown since
 it was last read.
 
+.. note::
+
+   The :mod:`selectors` module allows high-level and efficient I/O
+   multiplexing, built upon the :mod:`select` module primitives. Users are
+   encouraged to use the :mod:`selectors` module instead, unless they want
+   precise control over the OS-level primitives used.
+
+
 The module defines the following:
 
 
@@ -37,21 +45,37 @@
    increases this value, :c:func:`devpoll` may return an
    incomplete list of active file descriptors.
 
+   The new file descriptor is :ref:`non-inheritable <fd_inheritance>`.
+
    .. versionadded:: 3.3
 
+   .. versionchanged:: 3.4
+      The new file descriptor is now non-inheritable.
+
 .. function:: epoll(sizehint=-1, flags=0)
 
    (Only supported on Linux 2.5.44 and newer.) Return an edge polling object,
    which can be used as Edge or Level Triggered interface for I/O
    events. *sizehint* is deprecated and completely ignored. *flags* can be set
    to :const:`EPOLL_CLOEXEC`, which causes the epoll descriptor to be closed
-   automatically when :func:`os.execve` is called. See section
-   :ref:`epoll-objects` below for the methods supported by epolling objects.
+   automatically when :func:`os.execve` is called.
 
+   See the :ref:`epoll-objects` section below for the methods supported by
+   epolling objects.
+
+   ``epoll`` objects support the context management protocol: when used in a
+   :keyword:`with` statement, the new file descriptor is automatically closed
+   at the end of the block.
+
+   The new file descriptor is :ref:`non-inheritable <fd_inheritance>`.
 
    .. versionchanged:: 3.3
       Added the *flags* parameter.
 
+   .. versionchanged:: 3.4
+      Support for the :keyword:`with` statement was added.
+      The new file descriptor is now non-inheritable.
+
 
 .. function:: poll()
 
@@ -66,6 +90,11 @@
    (Only supported on BSD.)  Returns a kernel queue object; see section
    :ref:`kqueue-objects` below for the methods supported by kqueue objects.
 
+   The new file descriptor is :ref:`non-inheritable <fd_inheritance>`.
+
+   .. versionchanged:: 3.4
+      The new file descriptor is now non-inheritable.
+
 
 .. function:: kevent(ident, filter=KQ_FILTER_READ, flags=KQ_EV_ADD, fflags=0, data=0, udata=0)
 
@@ -131,10 +160,7 @@
 .. _devpoll-objects:
 
 ``/dev/poll`` Polling Objects
-----------------------------------------------
-
-   http://developers.sun.com/solaris/articles/using_devpoll.html
-   http://developers.sun.com/solaris/articles/polling_efficient.html
+-----------------------------
 
 Solaris and derivatives have ``/dev/poll``. While :c:func:`select` is
 O(highest file descriptor) and :c:func:`poll` is O(number of file
@@ -144,6 +170,27 @@
 object.
 
 
+.. method:: devpoll.close()
+
+   Close the file descriptor of the polling object.
+
+   .. versionadded:: 3.4
+
+
+.. attribute:: devpoll.closed
+
+   ``True`` if the polling object is closed.
+
+   .. versionadded:: 3.4
+
+
+.. method:: devpoll.fileno()
+
+   Return the file descriptor number of the polling object.
+
+   .. versionadded:: 3.4
+
+
 .. method:: devpoll.register(fd[, eventmask])
 
    Register a file descriptor with the polling object.  Future calls to the
@@ -241,6 +288,11 @@
    Close the control file descriptor of the epoll object.
 
 
+.. attribute:: epoll.closed
+
+   ``True`` if the epoll object is closed.
+
+
 .. method:: epoll.fileno()
 
    Return the file descriptor number of the control fd.
@@ -258,7 +310,7 @@
 
 .. method:: epoll.modify(fd, eventmask)
 
-   Modify a register file descriptor.
+   Modify a registered file descriptor.
 
 
 .. method:: epoll.unregister(fd)
@@ -322,7 +374,7 @@
 
    Modifies an already registered fd. This has the same effect as
    ``register(fd, eventmask)``.  Attempting to modify a file descriptor
-   that was never registered causes an :exc:`IOError` exception with errno
+   that was never registered causes an :exc:`OSError` exception with errno
    :const:`ENOENT` to be raised.
 
 
@@ -360,6 +412,11 @@
    Close the control file descriptor of the kqueue object.
 
 
+.. attribute:: kqueue.closed
+
+   ``True`` if the kqueue object is closed.
+
+
 .. method:: kqueue.fileno()
 
    Return the file descriptor number of the control fd.
diff --git a/Doc/library/selectors.rst b/Doc/library/selectors.rst
new file mode 100644
index 0000000..98377c8
--- /dev/null
+++ b/Doc/library/selectors.rst
@@ -0,0 +1,257 @@
+:mod:`selectors` -- High-level I/O multiplexing
+===============================================
+
+.. module:: selectors
+   :synopsis: High-level I/O multiplexing.
+
+.. versionadded:: 3.4
+
+
+Introduction
+------------
+
+This module allows high-level and efficient I/O multiplexing, built upon the
+:mod:`select` module primitives. Users are encouraged to use this module
+instead, unless they want precise control over the OS-level primitives used.
+
+It defines a :class:`BaseSelector` abstract base class, along with several
+concrete implementations (:class:`KqueueSelector`, :class:`EpollSelector`...),
+that can be used to wait for I/O readiness notification on multiple file
+objects. In the following, "file object" refers to any object with a
+:meth:`fileno()` method, or a raw file descriptor. See :term:`file object`.
+
+:class:`DefaultSelector` is an alias to the most efficient implementation
+available on the current platform: this should be the default choice for most
+users.
+
+.. note::
+   The type of file objects supported depends on the platform: on Windows,
+   sockets are supported, but not pipes, whereas on Unix, both are supported
+   (some other types may be supported as well, such as fifos or special file
+   devices).
+
+.. seealso::
+
+   :mod:`select`
+      Low-level I/O multiplexing module.
+
+
+Classes
+-------
+
+Classes hierarchy::
+
+   BaseSelector
+   +-- SelectSelector
+   +-- PollSelector
+   +-- EpollSelector
+   +-- KqueueSelector
+
+
+In the following, *events* is a bitwise mask indicating which I/O events should
+be waited for on a given file object. It can be a combination of the constants
+below:
+
+   +-----------------------+-----------------------------------------------+
+   | Constant              | Meaning                                       |
+   +=======================+===============================================+
+   | :const:`EVENT_READ`   | Available for read                            |
+   +-----------------------+-----------------------------------------------+
+   | :const:`EVENT_WRITE`  | Available for write                           |
+   +-----------------------+-----------------------------------------------+
+
+
+.. class:: SelectorKey
+
+   A :class:`SelectorKey` is a :class:`~collections.namedtuple` used to
+   associate a file object to its underlying file decriptor, selected event
+   mask and attached data. It is returned by several :class:`BaseSelector`
+   methods.
+
+   .. attribute:: fileobj
+
+      File object registered.
+
+   .. attribute:: fd
+
+      Underlying file descriptor.
+
+   .. attribute:: events
+
+      Events that must be waited for on this file object.
+
+   .. attribute:: data
+
+      Optional opaque data associated to this file object: for example, this
+      could be used to store a per-client session ID.
+
+
+.. class:: BaseSelector
+
+   A :class:`BaseSelector` is used to wait for I/O event readiness on multiple
+   file objects. It supports file stream registration, unregistration, and a
+   method to wait for I/O events on those streams, with an optional timeout.
+   It's an abstract base class, so cannot be instantiated. Use
+   :class:`DefaultSelector` instead, or one of :class:`SelectSelector`,
+   :class:`KqueueSelector` etc. if you want to specifically use an
+   implementation, and your platform supports it.
+   :class:`BaseSelector` and its concrete implementations support the
+   :term:`context manager` protocol.
+
+   .. method:: register(fileobj, events, data=None)
+
+      Register a file object for selection, monitoring it for I/O events.
+
+      *fileobj* is the file object to monitor.  It may either be an integer
+      file descriptor or an object with a ``fileno()`` method.
+      *events* is a bitwise mask of events to monitor.
+      *data* is an opaque object.
+
+      This returns a new :class:`SelectorKey` instance, or raises a
+      :exc:`ValueError` in case of invalid event mask or file descriptor, or
+      :exc:`KeyError` if the file object is already registered.
+
+   .. method:: unregister(fileobj)
+
+      Unregister a file object from selection, removing it from monitoring. A
+      file object shall be unregistered prior to being closed.
+
+      *fileobj* must be a file object previously registered.
+
+      This returns the associated :class:`SelectorKey` instance, or raises a
+      :exc:`KeyError` if *fileobj* is not registered.  It will raise
+      :exc:`ValueError` if *fileobj* is invalid (e.g. it has no ``fileno()``
+      method or its ``fileno()`` method has an invalid return value).
+
+   .. method:: modify(fileobj, events, data=None)
+
+      Change a registered file object's monitored events or attached data.
+
+      This is equivalent to :meth:`BaseSelector.unregister(fileobj)` followed
+      by :meth:`BaseSelector.register(fileobj, events, data)`, except that it
+      can be implemented more efficiently.
+
+      This returns a new :class:`SelectorKey` instance, or raises a
+      :exc:`ValueError` in case of invalid event mask or file descriptor, or
+      :exc:`KeyError` if the file object is not registered.
+
+   .. method:: select(timeout=None)
+
+      Wait until some registered file objects become ready, or the timeout
+      expires.
+
+      If ``timeout > 0``, this specifies the maximum wait time, in seconds.
+      If ``timeout <= 0``, the call won't block, and will report the currently
+      ready file objects.
+      If *timeout* is ``None``, the call will block until a monitored file object
+      becomes ready.
+
+      This returns a list of ``(key, events)`` tuples, one for each ready file
+      object.
+
+      *key* is the :class:`SelectorKey` instance corresponding to a ready file
+      object.
+      *events* is a bitmask of events ready on this file object.
+
+      .. note::
+          This method can return before any file object becomes ready or the
+          timeout has elapsed if the current process receives a signal: in this
+          case, an empty list will be returned.
+
+   .. method:: close()
+
+      Close the selector.
+
+      This must be called to make sure that any underlying resource is freed.
+      The selector shall not be used once it has been closed.
+
+   .. method:: get_key(fileobj)
+
+      Return the key associated with a registered file object.
+
+      This returns the :class:`SelectorKey` instance associated to this file
+      object, or raises :exc:`KeyError` if the file object is not registered.
+
+   .. method:: get_map()
+
+      Return a mapping of file objects to selector keys.
+
+      This returns a :class:`~collections.abc.Mapping` instance mapping
+      registered file objects to their associated :class:`SelectorKey`
+      instance.
+
+
+.. class:: DefaultSelector()
+
+   The default selector class, using the most efficient implementation
+   available on the current platform. This should be the default choice for
+   most users.
+
+
+.. class:: SelectSelector()
+
+   :func:`select.select`-based selector.
+
+
+.. class:: PollSelector()
+
+   :func:`select.poll`-based selector.
+
+
+.. class:: EpollSelector()
+
+   :func:`select.epoll`-based selector.
+
+   .. method:: fileno()
+
+      This returns the file descriptor used by the underlying
+      :func:`select.epoll` object.
+
+
+.. class:: KqueueSelector()
+
+   :func:`select.kqueue`-based selector.
+
+   .. method:: fileno()
+
+      This returns the file descriptor used by the underlying
+      :func:`select.kqueue` object.
+
+
+Examples
+--------
+
+Here is a simple echo server implementation::
+
+   import selectors
+   import socket
+
+   sel = selectors.DefaultSelector()
+
+   def accept(sock, mask):
+       conn, addr = sock.accept()  # Should be ready
+       print('accepted', conn, 'from', addr)
+       conn.setblocking(False)
+       sel.register(conn, selectors.EVENT_READ, read)
+
+   def read(conn, mask):
+       data = conn.recv(1000)  # Should be ready
+       if data:
+           print('echoing', repr(data), 'to', conn)
+           conn.send(data)  # Hope it won't block
+       else:
+           print('closing', conn)
+           sel.unregister(conn)
+           conn.close()
+
+   sock = socket.socket()
+   sock.bind(('localhost', 1234))
+   sock.listen(100)
+   sock.setblocking(False)
+   sel.register(sock, selectors.EVENT_READ, accept)
+
+   while True:
+       events = sel.select()
+       for key, mask in events:
+           callback = key.data
+           callback(key.fileobj, mask)
diff --git a/Doc/library/shelve.rst b/Doc/library/shelve.rst
index 048f80a..22e202d 100644
--- a/Doc/library/shelve.rst
+++ b/Doc/library/shelve.rst
@@ -44,8 +44,11 @@
    .. note::
 
       Do not rely on the shelf being closed automatically; always call
-      :meth:`close` explicitly when you don't need it any more, or use a
-      :keyword:`with` statement with :func:`contextlib.closing`.
+      :meth:`~Shelf.close` explicitly when you don't need it any more, or
+      use :func:`shelve.open` as a context manager::
+
+          with shelve.open('spam') as db:
+              db['eggs'] = 'eggs'
 
 .. warning::
 
@@ -118,10 +121,16 @@
    The *keyencoding* parameter is the encoding used to encode keys before they
    are used with the underlying dict.
 
-   .. versionadded:: 3.2
-      The *keyencoding* parameter; previously, keys were always encoded in
+   A :class:`Shelf` object can also be used as a context manager, in which
+   case it will be automatically closed when the :keyword:`with` block ends.
+
+   .. versionchanged:: 3.2
+      Added the *keyencoding* parameter; previously, keys were always encoded in
       UTF-8.
 
+   .. versionchanged:: 3.4
+      Added context manager support.
+
 
 .. class:: BsdDbShelf(dict, protocol=None, writeback=False, keyencoding='utf-8')
 
diff --git a/Doc/library/shutil.rst b/Doc/library/shutil.rst
index a1457d0..d96fd71 100644
--- a/Doc/library/shutil.rst
+++ b/Doc/library/shutil.rst
@@ -53,7 +53,7 @@
    *dst* and return *dst*.  *src* and *dst* are path names given as strings.
    *dst* must be the complete target file name; look at :func:`shutil.copy`
    for a copy that accepts a target directory path.  If *src* and *dst*
-   specify the same file, :exc:`Error` is raised.
+   specify the same file, :exc:`SameFileError` is raised.
 
    The destination location must be writable; otherwise, an :exc:`OSError`
    exception will be raised. If *dst* already exists, it will be replaced.
@@ -69,6 +69,19 @@
       Added *follow_symlinks* argument.
       Now returns *dst*.
 
+   .. versionchanged:: 3.4
+      Raise :exc:`SameFileError` instead of :exc:`Error`.  Since the former is
+      a subclass of the latter, this change is backward compatible.
+
+
+.. exception:: SameFileError
+
+   This exception is raised if source and destination in :func:`copyfile`
+   are the same file.
+
+   .. versionadded:: 3.4
+
+
 .. function:: copymode(src, dst, *, follow_symlinks=True)
 
    Copy the permission bits from *src* to *dst*.  The file contents, owner, and
@@ -380,11 +393,10 @@
                errors.extend(err.args[0])
        try:
            copystat(src, dst)
-       except WindowsError:
-           # can't copy file access times on Windows
-           pass
        except OSError as why:
-           errors.extend((src, dst, str(why)))
+           # can't copy file access times on Windows
+           if why.winerror is None:
+               errors.extend((src, dst, str(why)))
        if errors:
            raise Error(errors)
 
@@ -437,12 +449,17 @@
 
    *root_dir* and *base_dir* both default to the current directory.
 
+   If *dry_run* is true, no archive is created, but the operations that would be
+   executed are logged to *logger*.
+
    *owner* and *group* are used when creating a tar archive. By default,
    uses the current owner and group.
 
    *logger* must be an object compatible with :pep:`282`, usually an instance of
    :class:`logging.Logger`.
 
+   The *verbose* argument is unused and deprecated.
+
 
 .. function:: get_archive_formats()
 
@@ -462,14 +479,19 @@
 
 .. function:: register_archive_format(name, function, [extra_args, [description]])
 
-   Register an archiver for the format *name*. *function* is a callable that
-   will be used to invoke the archiver.
+   Register an archiver for the format *name*.
+
+   *function* is the callable that will be used to unpack archives. The callable
+   will receive the *base_name* of the file to create, followed by the
+   *base_dir* (which defaults to :data:`os.curdir`) to start archiving from.
+   Further arguments are passed as keyword arguments: *owner*, *group*,
+   *dry_run* and *logger* (as passed in :func:`make_archive`).
 
    If given, *extra_args* is a sequence of ``(name, value)`` pairs that will be
    used as extra keywords arguments when the archiver callable is used.
 
    *description* is used by :func:`get_archive_formats` which returns the
-   list of archivers. Defaults to an empty list.
+   list of archivers.  Defaults to an empty string.
 
 
 .. function:: unregister_archive_format(name)
diff --git a/Doc/library/site.rst b/Doc/library/site.rst
index 36b80c3..e57b8cc 100644
--- a/Doc/library/site.rst
+++ b/Doc/library/site.rst
@@ -38,6 +38,9 @@
 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.
 
+.. deprecated:: 3.4
+   Support for the "site-python" directory will be removed in 3.5.
+
 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
@@ -96,7 +99,11 @@
 :mod:`sitecustomize`, which can perform arbitrary site-specific customizations.
 It is typically created by a system administrator in the site-packages
 directory.  If this import fails with an :exc:`ImportError` exception, it is
-silently ignored.
+silently ignored.  If Python is started without output streams available, as
+with :file:`pythonw.exe` on Windows (which is used by default to start IDLE),
+attempted output from :mod:`sitecustomize` is ignored. Any exception other
+than :exc:`ImportError` causes a silent and perhaps mysterious failure of the
+process.
 
 .. index:: module: usercustomize
 
@@ -111,6 +118,27 @@
 :mod:`sitecustomize` and :mod:`usercustomize` is still attempted.
 
 
+.. _rlcompleter-config:
+
+Readline configuration
+----------------------
+
+On systems that support :mod:`readline`, this module will also import and
+configure the :mod:`rlcompleter` module, if Python is started in
+:ref:`interactive mode <tut-interactive>` and without the :option:`-S` option.
+The default behavior is enable tab-completion and to use
+:file:`~/.python_history` as the history save file.  To disable it, delete (or
+override) the :data:`sys.__interactivehook__` attribute in your
+:mod:`sitecustomize` or :mod:`usercustomize` module or your
+:envvar:`PYTHONSTARTUP` file.
+
+.. versionchanged:: 3.4
+   Activation of rlcompleter and history was made automatic.
+
+
+Module contents
+---------------
+
 .. data:: PREFIXES
 
    A list of prefixes for site-packages directories.
@@ -153,8 +181,7 @@
 
    Adds all the standard site-specific directories to the module search
    path.  This function is called automatically when this module is imported,
-   unless the :program:`python` interpreter was started with the :option:`-S`
-   flag.
+   unless the Python interpreter was started with the :option:`-S` flag.
 
    .. versionchanged:: 3.3
       This function used to be called unconditionnally.
diff --git a/Doc/library/smtpd.rst b/Doc/library/smtpd.rst
index f305818..3ebed06 100644
--- a/Doc/library/smtpd.rst
+++ b/Doc/library/smtpd.rst
@@ -27,7 +27,8 @@
 ------------------
 
 
-.. class:: SMTPServer(localaddr, remoteaddr, data_size_limit=33554432)
+.. class:: SMTPServer(localaddr, remoteaddr, data_size_limit=33554432,\
+                      map=None)
 
    Create a new :class:`SMTPServer` object, which binds to local address
    *localaddr*.  It will treat *remoteaddr* as an upstream SMTP relayer.  It
@@ -38,6 +39,8 @@
    accepted in a ``DATA`` command.  A value of ``None`` or ``0`` means no
    limit.
 
+   A dictionary can be specified in *map* to avoid using a global socket map.
+
    .. method:: process_message(peer, mailfrom, rcpttos, data)
 
       Raise :exc:`NotImplementedError` exception. Override this in subclasses to
@@ -53,6 +56,9 @@
       Override this in subclasses to use a custom :class:`SMTPChannel` for
       managing SMTP clients.
 
+   .. versionchanged:: 3.4
+      The *map* argument was added.
+
 
 DebuggingServer Objects
 -----------------------
@@ -90,11 +96,20 @@
 SMTPChannel Objects
 -------------------
 
-.. class:: SMTPChannel(server, conn, addr)
+.. class:: SMTPChannel(server, conn, addr, data_size_limit=33554432,\
+                       map=None))
 
    Create a new :class:`SMTPChannel` object which manages the communication
    between the server and a single SMTP client.
 
+   *conn* and *addr* are as per the instance variables described below.
+
+   *data_size_limit* specifies the maximum number of bytes that will be
+   accepted in a ``DATA`` command.  A value of ``None`` or ``0`` means no
+   limit.
+
+   A dictionary can be specified in *map* to avoid using a global socket map.
+
    To use a custom SMTPChannel implementation you need to override the
    :attr:`SMTPServer.channel_class` of your :class:`SMTPServer`.
 
diff --git a/Doc/library/smtplib.rst b/Doc/library/smtplib.rst
index addc6be..8e1bfb5 100644
--- a/Doc/library/smtplib.rst
+++ b/Doc/library/smtplib.rst
@@ -32,7 +32,8 @@
    than a success code, an :exc:`SMTPConnectError` is raised. The optional
    *timeout* parameter specifies a timeout in seconds for blocking operations
    like the connection attempt (if not specified, the global default timeout
-   setting will be used). The optional source_address parameter allows to bind
+   setting will be used).  If the timeout expires, :exc:`socket.timeout` is
+   raised.  The optional source_address parameter allows to bind
    to some specific source address in a machine with multiple network
    interfaces, and/or to some specific source TCP port. It takes a 2-tuple
    (host, port), for the socket to bind to as its source address before
@@ -69,20 +70,15 @@
    required from the beginning of the connection and using :meth:`starttls` is
    not appropriate. If *host* is not specified, the local host is used. If
    *port* is zero, the standard SMTP-over-SSL port (465) is used.  The optional
-   arguments *local_hostname* and *source_address* have the same meaning as
-   they do in the :class:`SMTP` class.  *keyfile* and *certfile* are also
-   optional, and can contain a PEM formatted private key and certificate chain
-   file for the SSL connection. *context* also optional, can contain a
-   SSLContext, and is an alternative to keyfile and certfile; If it is
-   specified both keyfile and certfile must be None.  The optional *timeout*
-   parameter specifies a timeout in seconds for blocking operations like the
-   connection attempt (if not specified, the global default timeout setting
-   will be used). The optional source_address parameter allows to bind to some
-   specific source address in a machine with multiple network interfaces,
-   and/or to some specific source tcp port. It takes a 2-tuple (host, port),
-   for the socket to bind to as its source address before connecting. If
-   omitted (or if host or port are ``''`` and/or 0 respectively) the OS default
-   behavior will be used.
+   arguments *local_hostname*, *timeout* and *source_address* have the same
+   meaning as they do in the :class:`SMTP` class.  *context*, also optional,
+   can contain a :class:`~ssl.SSLContext` and allows to configure various
+   aspects of the secure connection.  Please read :ref:`ssl-security` for
+   best practices.
+
+   *keyfile* and *certfile* are a legacy alternative to *context*, and can
+   point to a PEM formatted private key and certificate chain file for the
+   SSL connection.
 
    .. versionchanged:: 3.3
       *context* was added.
@@ -90,6 +86,10 @@
    .. versionchanged:: 3.3
       source_address argument was added.
 
+   .. versionchanged:: 3.4
+      The class now supports hostname check with
+      :attr:`ssl.SSLContext.check_hostname` and *Server Name Indication* (see
+      :data:`ssl.HAS_SNI`).
 
 .. class:: LMTP(host='', port=LMTP_PORT, local_hostname=None, source_address=None)
 
@@ -110,8 +110,11 @@
 
 .. exception:: SMTPException
 
-   The base exception class for all the other exceptions provided by this
-   module.
+   Subclass of :exc:`OSError` that is the base exception class for all
+   the other exceptions provided by this module.
+
+   .. versionchanged:: 3.4
+      SMTPException became subclass of :exc:`OSError`
 
 
 .. exception:: SMTPServerDisconnected
@@ -316,6 +319,11 @@
    .. versionchanged:: 3.3
       *context* was added.
 
+   .. versionchanged:: 3.4
+      The method now supports hostname check with
+      :attr:`SSLContext.check_hostname` and *Server Name Indicator* (see
+      :data:`~ssl.HAS_SNI`).
+
 
 .. method:: SMTP.sendmail(from_addr, to_addrs, msg, mail_options=[], rcpt_options=[])
 
diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst
index 3a49eed..b703e9e 100644
--- a/Doc/library/socket.rst
+++ b/Doc/library/socket.rst
@@ -6,8 +6,7 @@
 
 
 This module provides access to the BSD *socket* interface. It is available on
-all modern Unix systems, Windows, MacOS, OS/2, and probably additional
-platforms.
+all modern Unix systems, Windows, MacOS, and probably additional platforms.
 
 .. note::
 
@@ -91,9 +90,6 @@
     If *addr_type* is :const:`TIPC_ADDR_ID`, then *v1* is the node, *v2* is the
     reference, and *v3* should be set to 0.
 
-    If *addr_type* is :const:`TIPC_ADDR_ID`, then *v1* is the node, *v2* is the
-    reference, and *v3* should be set to 0.
-
 - A tuple ``(interface, )`` is used for the :const:`AF_CAN` address family,
   where *interface* is a string representing a network interface name like
   ``'can0'``. The network interface name ``''`` can be used to receive packets
@@ -107,8 +103,8 @@
 
   .. versionadded:: 3.3
 
-- Certain other address families (:const:`AF_BLUETOOTH`, :const:`AF_PACKET`)
-  support specific representations.
+- Certain other address families (:const:`AF_BLUETOOTH`, :const:`AF_PACKET`,
+  :const:`AF_CAN`) support specific representations.
 
   .. XXX document them!
 
@@ -193,6 +189,11 @@
 Constants
 ^^^^^^^^^
 
+   The AF_* and SOCK_* constants are now :class:`AddressFamily` and
+   :class:`SocketKind` :class:`.IntEnum` collections.
+
+   .. versionadded:: 3.4
+
 .. data:: AF_UNIX
           AF_INET
           AF_INET6
@@ -264,6 +265,16 @@
 
    .. versionadded:: 3.3
 
+.. data:: CAN_BCM
+          CAN_BCM_*
+
+   CAN_BCM, in the CAN protocol family, is the broadcast manager (BCM) protocol.
+   Broadcast manager constants, documented in the Linux documentation, are also
+   defined in the socket module.
+
+   Availability: Linux >= 2.6.25.
+
+   .. versionadded:: 3.4
 
 .. data:: AF_RDS
           PF_RDS
@@ -290,6 +301,11 @@
    TIPC related constants, matching the ones exported by the C socket API. See
    the TIPC documentation for more information.
 
+.. data:: AF_LINK
+
+  Availability: BSD, OSX.
+
+  .. versionadded:: 3.4
 
 .. data:: has_ipv6
 
@@ -306,20 +322,29 @@
 The following functions all create :ref:`socket objects <socket-objects>`.
 
 
-.. function:: socket([family[, type[, proto]]])
+.. function:: socket(family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None)
 
    Create a new socket using the given address family, socket type and protocol
    number.  The address family should be :const:`AF_INET` (the default),
    :const:`AF_INET6`, :const:`AF_UNIX`, :const:`AF_CAN` or :const:`AF_RDS`. The
    socket type should be :const:`SOCK_STREAM` (the default),
    :const:`SOCK_DGRAM`, :const:`SOCK_RAW` or perhaps one of the other ``SOCK_``
-   constants. The protocol number is usually zero and may be omitted in that
-   case or :const:`CAN_RAW` in case the address family is :const:`AF_CAN`.
+   constants. The protocol number is usually zero and may be omitted or in the
+   case where the address family is :const:`AF_CAN` the protocol should be one
+   of :const:`CAN_RAW` or :const:`CAN_BCM`.
+
+   The newly created socket is :ref:`non-inheritable <fd_inheritance>`.
 
    .. versionchanged:: 3.3
       The AF_CAN family was added.
       The AF_RDS family was added.
 
+   .. versionchanged:: 3.4
+       The CAN_BCM protocol was added.
+
+   .. versionchanged:: 3.4
+      The returned socket is now non-inheritable.
+
 
 .. function:: socketpair([family[, type[, proto]]])
 
@@ -329,10 +354,15 @@
    if defined on the platform; otherwise, the default is :const:`AF_INET`.
    Availability: Unix.
 
+   The newly created sockets are :ref:`non-inheritable <fd_inheritance>`.
+
    .. versionchanged:: 3.2
       The returned socket objects now support the whole socket API, rather
       than a subset.
 
+   .. versionchanged:: 3.4
+      The returned sockets are now non-inheritable.
+
 
 .. function:: create_connection(address[, timeout[, source_address]])
 
@@ -360,7 +390,7 @@
       support for the :keyword:`with` statement was added.
 
 
-.. function:: fromfd(fd, family, type[, proto])
+.. function:: fromfd(fd, family, type, proto=0)
 
    Duplicate the file descriptor *fd* (an integer as returned by a file object's
    :meth:`fileno` method) and build a socket object from the result.  Address
@@ -371,6 +401,11 @@
    a socket passed to a program as standard input or output (such as a server
    started by the Unix inet daemon).  The socket is assumed to be in blocking mode.
 
+   The newly created socket is :ref:`non-inheritable <fd_inheritance>`.
+
+   .. versionchanged:: 3.4
+      The returned socket is now non-inheritable.
+
 
 .. function:: fromshare(data)
 
@@ -429,7 +464,7 @@
    connection to ``www.python.org`` on port 80 (results may differ on your
    system if IPv6 isn't enabled)::
 
-      >>> socket.getaddrinfo("www.python.org", 80, proto=socket.SOL_TCP)
+      >>> socket.getaddrinfo("www.python.org", 80, proto=socket.IPPROTO_TCP)
       [(2, 1, 6, '', ('82.94.164.162', 80)),
        (10, 1, 6, '', ('2001:888:2000:d::a2', 80, 0, 0))]
 
@@ -598,7 +633,10 @@
    both the value of *address_family* and the underlying implementation of
    :c:func:`inet_pton`.
 
-   Availability: Unix (maybe not all platforms).
+   Availability: Unix (maybe not all platforms), Windows.
+
+   .. versionchanged:: 3.4
+      Windows support added
 
 
 .. function:: inet_ntop(address_family, packed_ip)
@@ -614,7 +652,10 @@
    specified address family, :exc:`ValueError` will be raised.  A
    :exc:`OSError` is raised for errors from the call to :func:`inet_ntop`.
 
-   Availability: Unix (maybe not all platforms).
+   Availability: Unix (maybe not all platforms), Windows.
+
+   .. versionchanged:: 3.4
+      Windows support added
 
 
 ..
@@ -735,6 +776,11 @@
    *new* socket object usable to send and receive data on the connection, and
    *address* is the address bound to the socket on the other end of the connection.
 
+   The newly created socket is :ref:`non-inheritable <fd_inheritance>`.
+
+   .. versionchanged:: 3.4
+      The socket is now non-inheritable.
+
 
 .. method:: socket.bind(address)
 
@@ -787,6 +833,16 @@
    .. versionadded:: 3.2
 
 
+.. method:: socket.dup()
+
+   Duplicate the socket.
+
+   The newly created socket is :ref:`non-inheritable <fd_inheritance>`.
+
+   .. versionchanged:: 3.4
+      The socket is now non-inheritable.
+
+
 .. method:: socket.fileno()
 
    Return the socket's file descriptor (a small integer).  This is useful with
@@ -797,6 +853,15 @@
    this limitation.
 
 
+.. method:: socket.get_inheritable()
+
+   Get the :ref:`inheritable flag <fd_inheritance>` of the socket's file
+   descriptor or socket's handle: ``True`` if the socket can be inherited in
+   child processes, ``False`` if it cannot.
+
+   .. versionadded:: 3.4
+
+
 .. method:: socket.getpeername()
 
    Return the remote address to which the socket is connected.  This is useful to
@@ -1053,7 +1118,8 @@
    Send normal and ancillary data to the socket, gathering the
    non-ancillary data from a series of buffers and concatenating it
    into a single message.  The *buffers* argument specifies the
-   non-ancillary data as an iterable of buffer-compatible objects
+   non-ancillary data as an iterable of
+   :term:`bytes-like objects <bytes-like object>`
    (e.g. :class:`bytes` objects); the operating system may set a limit
    (:func:`~os.sysconf` value ``SC_IOV_MAX``) on the number of buffers
    that can be used.  The *ancdata* argument specifies the ancillary
@@ -1061,7 +1127,7 @@
    ``(cmsg_level, cmsg_type, cmsg_data)``, where *cmsg_level* and
    *cmsg_type* are integers specifying the protocol level and
    protocol-specific type respectively, and *cmsg_data* is a
-   buffer-compatible object holding the associated data.  Note that
+   bytes-like object holding the associated data.  Note that
    some systems (in particular, systems without :func:`CMSG_SPACE`)
    might support sending only one control message per call.  The
    *flags* argument defaults to 0 and has the same meaning as for
@@ -1083,6 +1149,14 @@
    .. versionadded:: 3.3
 
 
+.. method:: socket.set_inheritable(inheritable)
+
+   Set the :ref:`inheritable flag <fd_inheritance>` of the socket's file
+   descriptor or socket's handle.
+
+   .. versionadded:: 3.4
+
+
 .. method:: socket.setblocking(flag)
 
    Set blocking or non-blocking mode of the socket: if *flag* is false, the
@@ -1364,7 +1438,16 @@
    s.ioctl(socket.SIO_RCVALL, socket.RCVALL_OFF)
 
 The last example shows how to use the socket interface to communicate to a CAN
-network. This example might require special priviledge::
+network using the raw socket protocol. To use CAN with the broadcast
+manager protocol instead, open a socket with::
+
+    socket.socket(socket.AF_CAN, socket.SOCK_DGRAM, socket.CAN_BCM)
+
+After binding (:const:`CAN_RAW`) or connecting (:const:`CAN_BCM`) the socket, you
+can use the :meth:`socket.send`, and the :meth:`socket.recv` operations (and
+their counterparts) on the socket object as usual.
+
+This example might require special priviledge::
 
    import socket
    import struct
diff --git a/Doc/library/spwd.rst b/Doc/library/spwd.rst
index add611f..58be78f 100644
--- a/Doc/library/spwd.rst
+++ b/Doc/library/spwd.rst
@@ -19,9 +19,9 @@
 +-------+---------------+---------------------------------+
 | Index | Attribute     | Meaning                         |
 +=======+===============+=================================+
-| 0     | ``sp_nam``    | Login name                      |
+| 0     | ``sp_namp``   | Login name                      |
 +-------+---------------+---------------------------------+
-| 1     | ``sp_pwd``    | Encrypted password              |
+| 1     | ``sp_pwdp``   | Encrypted password              |
 +-------+---------------+---------------------------------+
 | 2     | ``sp_lstchg`` | Date of last change             |
 +-------+---------------+---------------------------------+
@@ -36,15 +36,15 @@
 +-------+---------------+---------------------------------+
 | 6     | ``sp_inact``  | Number of days after password   |
 |       |               | expires until account is        |
-|       |               | blocked                         |
+|       |               | disabled                        |
 +-------+---------------+---------------------------------+
 | 7     | ``sp_expire`` | Number of days since 1970-01-01 |
-|       |               | until account is disabled       |
+|       |               | when account expires            |
 +-------+---------------+---------------------------------+
 | 8     | ``sp_flag``   | Reserved                        |
 +-------+---------------+---------------------------------+
 
-The sp_nam and sp_pwd items are strings, all others are integers.
+The sp_namp and sp_pwdp items are strings, all others are integers.
 :exc:`KeyError` is raised if the entry asked for cannot be found.
 
 The following functions are defined:
diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst
index 8a50f87..6097e7a 100644
--- a/Doc/library/sqlite3.rst
+++ b/Doc/library/sqlite3.rst
@@ -13,8 +13,8 @@
 application using SQLite and then port the code to a larger database such as
 PostgreSQL or Oracle.
 
-sqlite3 was written by Gerhard Häring and provides a SQL interface compliant
-with the DB-API 2.0 specification described by :pep:`249`.
+The sqlite3 module was written by Gerhard Häring.  It provides a SQL interface
+compliant with the DB-API 2.0 specification described by :pep:`249`.
 
 To use the module, you must first create a :class:`Connection` object that
 represents the database.  Here the data will be stored in the
@@ -31,23 +31,29 @@
    c = conn.cursor()
 
    # Create table
-   c.execute('''create table stocks
-   (date text, trans text, symbol text,
-    qty real, price real)''')
+   c.execute('''CREATE TABLE stocks
+                (date text, trans text, symbol text, qty real, price real)''')
 
    # Insert a row of data
-   c.execute("""insert into stocks
-             values ('2006-01-05','BUY','RHAT',100,35.14)""")
+   c.execute("INSERT INTO stocks VALUES ('2006-01-05','BUY','RHAT',100,35.14)")
 
    # Save (commit) the changes
    conn.commit()
 
-   # We can also close the cursor if we are done with it
-   c.close()
+   # We can also close the connection if we are done with it.
+   # Just be sure any changes have been committed or they will be lost.
+   conn.close()
+
+The data you've saved is persistent and is available in subsequent sessions::
+
+   import sqlite3
+   conn = sqlite3.connect('example.db')
+   c = conn.cursor()
 
 Usually your SQL operations will need to use values from Python variables.  You
 shouldn't assemble your query using Python's string operations because doing so
-is insecure; it makes your program vulnerable to an SQL injection attack.
+is insecure; it makes your program vulnerable to an SQL injection attack
+(see http://xkcd.com/327/ for humorous example of what can go wrong).
 
 Instead, use the DB-API's parameter substitution.  Put ``?`` as a placeholder
 wherever you want to use a value, and then provide a tuple of values as the
@@ -56,19 +62,20 @@
 example::
 
    # Never do this -- insecure!
-   symbol = 'IBM'
-   c.execute("select * from stocks where symbol = '%s'" % symbol)
+   symbol = 'RHAT'
+   c.execute("SELECT * FROM stocks WHERE symbol = '%s'" % symbol)
 
    # Do this instead
-   t = ('IBM',)
-   c.execute('select * from stocks where symbol=?', t)
+   t = ('RHAT',)
+   c.execute('SELECT * FROM stocks WHERE symbol=?', t)
+   print(c.fetchone())
 
-   # Larger example
-   for t in [('2006-03-28', 'BUY', 'IBM', 1000, 45.00),
-             ('2006-04-05', 'BUY', 'MSFT', 1000, 72.00),
-             ('2006-04-06', 'SELL', 'IBM', 500, 53.00),
-            ]:
-       c.execute('insert into stocks values (?,?,?,?,?)', t)
+   # Larger example that inserts many records at a time
+   purchases = [('2006-03-28', 'BUY', 'IBM', 1000, 45.00),
+                ('2006-04-05', 'BUY', 'MSFT', 1000, 72.00),
+                ('2006-04-06', 'SELL', 'IBM', 500, 53.00),
+               ]
+   c.executemany('INSERT INTO stocks VALUES (?,?,?,?,?)', purchases)
 
 To retrieve data after executing a SELECT statement, you can either treat the
 cursor as an :term:`iterator`, call the cursor's :meth:`~Cursor.fetchone` method to
@@ -77,16 +84,13 @@
 
 This example uses the iterator form::
 
-   >>> c = conn.cursor()
-   >>> c.execute('select * from stocks order by price')
-   >>> for row in c:
-   ...     print(row)
-   ...
+   >>> for row in c.execute('SELECT * FROM stocks ORDER BY price'):
+           print(row)
+
    ('2006-01-05', 'BUY', 'RHAT', 100, 35.14)
    ('2006-03-28', 'BUY', 'IBM', 1000, 45.0)
    ('2006-04-06', 'SELL', 'IBM', 500, 53.0)
-   ('2006-04-05', 'BUY', 'MSOFT', 1000, 72.0)
-   >>>
+   ('2006-04-05', 'BUY', 'MSFT', 1000, 72.0)
 
 
 .. seealso::
@@ -99,6 +103,9 @@
       The SQLite web page; the documentation describes the syntax and the
       available data types for the supported SQL dialect.
 
+   http://www.w3schools.com/sql/
+      Tutorial, reference and examples for learning SQL syntax.
+
    :pep:`249` - Database API Specification 2.0
       PEP written by Marc-André Lemburg.
 
@@ -159,7 +166,7 @@
    first blank for the column name: the column name would simply be "x".
 
 
-.. function:: connect(database[, timeout, detect_types, isolation_level, check_same_thread, factory, cached_statements])
+.. function:: connect(database[, timeout, detect_types, isolation_level, check_same_thread, factory, cached_statements, uri])
 
    Opens a connection to the SQLite database file *database*. You can use
    ``":memory:"`` to open a database connection to a database that resides in RAM
@@ -195,6 +202,18 @@
    for the connection, you can set the *cached_statements* parameter. The currently
    implemented default is to cache 100 statements.
 
+   If *uri* is true, *database* is interpreted as a URI. This allows you
+   to specify options. For example, to open a database in read-only mode
+   you can use::
+
+       db = sqlite3.connect('file:path/to/database?mode=ro', uri=True)
+
+   More information about this feature, including a list of recognized options, can
+   be found in the `SQLite URI documentation <http://www.sqlite.org/uri.html>`_.
+
+   .. versionchanged:: 3.4
+      Added the *uri* parameter.
+
 
 .. function:: register_converter(typename, callable)
 
@@ -505,7 +524,7 @@
 
    .. method:: execute(sql, [parameters])
 
-      Executes an SQL statement. The SQL statement may be parametrized (i. e.
+      Executes an SQL statement. The SQL statement may be parameterized (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).
@@ -627,7 +646,7 @@
 
    .. method:: keys
 
-      This method returns a tuple of column names. Immediately after a query,
+      This method returns a list of column names. Immediately after a query,
       it is the first member of each tuple in :attr:`Cursor.description`.
 
 Let's assume we initialize a table as in the example given above::
@@ -702,19 +721,20 @@
 
 This is how SQLite types are converted to Python types by default:
 
-+-------------+---------------------------------------------+
-| SQLite type | Python type                                 |
-+=============+=============================================+
-| ``NULL``    | :const:`None`                               |
-+-------------+---------------------------------------------+
-| ``INTEGER`` | :class:`int`                                |
-+-------------+---------------------------------------------+
-| ``REAL``    | :class:`float`                              |
-+-------------+---------------------------------------------+
-| ``TEXT``    | depends on text_factory, str by default     |
-+-------------+---------------------------------------------+
-| ``BLOB``    | :class:`bytes`                              |
-+-------------+---------------------------------------------+
++-------------+----------------------------------------------+
+| SQLite type | Python type                                  |
++=============+==============================================+
+| ``NULL``    | :const:`None`                                |
++-------------+----------------------------------------------+
+| ``INTEGER`` | :class:`int`                                 |
++-------------+----------------------------------------------+
+| ``REAL``    | :class:`float`                               |
++-------------+----------------------------------------------+
+| ``TEXT``    | depends on :attr:`~Connection.text_factory`, |
+|             | :class:`str` by default                      |
++-------------+----------------------------------------------+
+| ``BLOB``    | :class:`bytes`                               |
++-------------+----------------------------------------------+
 
 The type system of the :mod:`sqlite3` module is extensible in two ways: you can
 store additional Python types in a SQLite database via object adaptation, and
@@ -730,9 +750,6 @@
 sqlite3 module's supported types for SQLite: one of NoneType, int, float,
 str, bytes.
 
-The :mod:`sqlite3` module uses Python object adaptation, as described in
-:pep:`246` for this.  The protocol to use is :class:`PrepareProtocol`.
-
 There are two ways to enable the :mod:`sqlite3` module to adapt a custom Python
 type to one of the supported ones.
 
@@ -788,8 +805,8 @@
 
 .. note::
 
-   Converter functions **always** get called with a string, no matter under which
-   data type you sent the value to SQLite.
+   Converter functions **always** get called with a :class:`bytes` object, no
+   matter under which data type you sent the value to SQLite.
 
 ::
 
diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst
index aa5a52f..015e0db 100644
--- a/Doc/library/ssl.rst
+++ b/Doc/library/ssl.rst
@@ -26,7 +26,8 @@
 
    Some behavior may be platform dependent, since calls are made to the
    operating system socket APIs.  The installed version of OpenSSL may also
-   cause variations in behavior.
+   cause variations in behavior. For example, TLSv1.1 and TLSv1.2 come with
+   openssl version 1.0.1.
 
 .. warning::
    Don't use this module without reading the :ref:`ssl-security`.  Doing so
@@ -186,25 +187,22 @@
 
      .. table::
 
-       ========================  =========  =========  ==========  =========
-        *client* / **server**    **SSLv2**  **SSLv3**  **SSLv23**  **TLSv1**
-       ------------------------  ---------  ---------  ----------  ---------
-        *SSLv2*                    yes        no         yes         no
-        *SSLv3*                    no         yes        yes         no
-        *SSLv23*                   yes        no         yes         no
-        *TLSv1*                    no         no         yes         yes
-       ========================  =========  =========  ==========  =========
+       ========================  =========  =========  ==========  =========  ===========  ===========
+        *client* / **server**    **SSLv2**  **SSLv3**  **SSLv23**  **TLSv1**  **TLSv1.1**  **TLSv1.2**
+       ------------------------  ---------  ---------  ----------  ---------  -----------  -----------
+        *SSLv2*                    yes        no         yes         no         no         no
+        *SSLv3*                    no         yes        yes         no         no         no
+        *SSLv23*                   no         yes        yes         yes        yes        yes
+        *TLSv1*                    no         no         yes         yes        no         no
+        *TLSv1.1*                  no         no         yes         no         yes        no
+        *TLSv1.2*                  no         no         yes         no         no         yes
+       ========================  =========  =========  ==========  =========  ===========  ===========
 
    .. note::
 
       Which connections succeed will vary depending on the version of
-      OpenSSL.  For instance, in some older versions of OpenSSL (such
-      as 0.9.7l on OS X 10.4), an SSLv2 client could not connect to an
-      SSLv23 server.  Another example: beginning with OpenSSL 1.0.0,
-      an SSLv23 client will not actually attempt SSLv2 connections
-      unless you explicitly enable SSLv2 ciphers; for example, you
-      might specify ``"ALL"`` or ``"SSLv2"`` as the *ciphers* parameter
-      to enable them.
+      OpenSSL.  For example, before OpenSSL 1.0.0, an SSLv23 client
+      would always attempt SSLv2 connections.
 
    The *ciphers* parameter sets the available ciphers for this SSL object.
    It should be a string in the `OpenSSL cipher list format
@@ -227,6 +225,58 @@
    .. versionchanged:: 3.2
       New optional argument *ciphers*.
 
+
+Context creation
+^^^^^^^^^^^^^^^^
+
+A convenience function helps create :class:`SSLContext` objects for common
+purposes.
+
+.. function:: create_default_context(purpose=Purpose.SERVER_AUTH, cafile=None, capath=None, cadata=None)
+
+   Return a new :class:`SSLContext` object with default settings for
+   the given *purpose*.  The settings are chosen by the :mod:`ssl` module,
+   and usually represent a higher security level than when calling the
+   :class:`SSLContext` constructor directly.
+
+   *cafile*, *capath*, *cadata* represent optional CA certificates to
+   trust for certificate verification, as in
+   :meth:`SSLContext.load_verify_locations`.  If all three are
+   :const:`None`, this function can choose to trust the system's default
+   CA certificates instead.
+
+   The settings in Python 3.4 are: :data:`PROTOCOL_SSLv23`, :data:`OP_NO_SSLv2`,
+   and :data:`OP_NO_SSLv3` with high encryption cipher suites without RC4 and
+   without unauthenticated cipher suites. Passing :data:`~Purpose.SERVER_AUTH`
+   as *purpose* sets :data:`~SSLContext.verify_mode` to :data:`CERT_REQUIRED`
+   and either loads CA certificates (when at least one of *cafile*, *capath* or
+   *cadata* is given) or uses :meth:`SSLContext.load_default_certs` to load
+   default CA certificates.
+
+   .. note::
+      The protocol, options, cipher and other settings may change to more
+      restrictive values anytime without prior deprecation.  The values
+      represent a fair balance between compatibility and security.
+
+      If your application needs specific settings, you should create a
+      :class:`SSLContext` and apply the settings yourself.
+
+   .. note::
+      If you find that when certain older clients or servers attempt to connect
+      with a :class:`SSLContext` created by this function that they get an
+      error stating "Protocol or cipher suite mismatch", it may be that they
+      only support SSL3.0 which this function excludes using the
+      :data:`OP_NO_SSLv3`. SSL3.0 has problematic security due to a number of
+      poor implementations and it's reliance on MD5 within the protocol. If you
+      wish to continue to use this function but still allow SSL 3.0 connections
+      you can re-enable them using::
+
+         ctx = ssl.create_default_context(Purpose.CLIENT_AUTH)
+         ctx.options &= ~ssl.OP_NO_SSLv3
+
+   .. versionadded:: 3.4
+
+
 Random generation
 ^^^^^^^^^^^^^^^^^
 
@@ -356,6 +406,61 @@
    Given a certificate as an ASCII PEM string, returns a DER-encoded sequence of
    bytes for that same certificate.
 
+.. function:: get_default_verify_paths()
+
+   Returns a named tuple with paths to OpenSSL's default cafile and capath.
+   The paths are the same as used by
+   :meth:`SSLContext.set_default_verify_paths`. The return value is a
+   :term:`named tuple` ``DefaultVerifyPaths``:
+
+   * :attr:`cafile` - resolved path to cafile or None if the file doesn't exist,
+   * :attr:`capath` - resolved path to capath or None if the directory doesn't exist,
+   * :attr:`openssl_cafile_env` - OpenSSL's environment key that points to a cafile,
+   * :attr:`openssl_cafile` - hard coded path to a cafile,
+   * :attr:`openssl_capath_env` - OpenSSL's environment key that points to a capath,
+   * :attr:`openssl_capath` - hard coded path to a capath directory
+
+   .. versionadded:: 3.4
+
+.. function:: enum_certificates(store_name)
+
+   Retrieve certificates from Windows' system cert store. *store_name* may be
+   one of ``CA``, ``ROOT`` or ``MY``. Windows may provide additional cert
+   stores, too.
+
+   The function returns a list of (cert_bytes, encoding_type, trust) tuples.
+   The encoding_type specifies the encoding of cert_bytes. It is either
+   :const:`x509_asn` for X.509 ASN.1 data or :const:`pkcs_7_asn` for
+   PKCS#7 ASN.1 data. Trust specifies the purpose of the certificate as a set
+   of OIDS or exactly ``True`` if the certificate is trustworthy for all
+   purposes.
+
+   Example::
+
+      >>> ssl.enum_certificates("CA")
+      [(b'data...', 'x509_asn', {'1.3.6.1.5.5.7.3.1', '1.3.6.1.5.5.7.3.2'}),
+       (b'data...', 'x509_asn', True)]
+
+   Availability: Windows.
+
+   .. versionadded:: 3.4
+
+.. function:: enum_crls(store_name)
+
+   Retrieve CRLs from Windows' system cert store. *store_name* may be
+   one of ``CA``, ``ROOT`` or ``MY``. Windows may provide additional cert
+   stores, too.
+
+   The function returns a list of (cert_bytes, encoding_type, trust) tuples.
+   The encoding_type specifies the encoding of cert_bytes. It is either
+   :const:`x509_asn` for X.509 ASN.1 data or :const:`pkcs_7_asn` for
+   PKCS#7 ASN.1 data.
+
+   Availability: Windows.
+
+   .. versionadded:: 3.4
+
+
 Constants
 ^^^^^^^^^
 
@@ -392,34 +497,83 @@
    be passed, either to :meth:`SSLContext.load_verify_locations` or as a
    value of the ``ca_certs`` parameter to :func:`wrap_socket`.
 
+.. data:: VERIFY_DEFAULT
+
+   Possible value for :attr:`SSLContext.verify_flags`. In this mode,
+   certificate revocation lists (CRLs) are not checked. By default OpenSSL
+   does neither require nor verify CRLs.
+
+   .. versionadded:: 3.4
+
+.. data:: VERIFY_CRL_CHECK_LEAF
+
+   Possible value for :attr:`SSLContext.verify_flags`. In this mode, only the
+   peer cert is check but non of the intermediate CA certificates. The mode
+   requires a valid CRL that is signed by the peer cert's issuer (its direct
+   ancestor CA). If no proper has been loaded
+   :attr:`SSLContext.load_verify_locations`, validation will fail.
+
+   .. versionadded:: 3.4
+
+.. data:: VERIFY_CRL_CHECK_CHAIN
+
+   Possible value for :attr:`SSLContext.verify_flags`. In this mode, CRLs of
+   all certificates in the peer cert chain are checked.
+
+   .. versionadded:: 3.4
+
+.. data:: VERIFY_X509_STRICT
+
+   Possible value for :attr:`SSLContext.verify_flags` to disable workarounds
+   for broken X.509 certificates.
+
+   .. versionadded:: 3.4
+
+.. data:: PROTOCOL_SSLv23
+
+   Selects the highest protocol version that both the client and server support.
+   Despite the name, this option can select "TLS" protocols as well as "SSL".
+
 .. data:: PROTOCOL_SSLv2
 
    Selects SSL version 2 as the channel encryption protocol.
 
-   This protocol is not available if OpenSSL is compiled with OPENSSL_NO_SSL2
-   flag.
+   This protocol is not available if OpenSSL is compiled with the
+   ``OPENSSL_NO_SSL2`` flag.
 
    .. warning::
 
       SSL version 2 is insecure.  Its use is highly discouraged.
 
-.. data:: PROTOCOL_SSLv23
-
-   Selects SSL version 2 or 3 as the channel encryption protocol.  This is a
-   setting to use with servers for maximum compatibility with the other end of
-   an SSL connection, but it may cause the specific ciphers chosen for the
-   encryption to be of fairly low quality.
-
 .. data:: PROTOCOL_SSLv3
 
-   Selects SSL version 3 as the channel encryption protocol.  For clients, this
-   is the maximally compatible SSL variant.
+   Selects SSL version 3 as the channel encryption protocol.
+
+   This protocol is not be available if OpenSSL is compiled with the
+   ``OPENSSL_NO_SSLv3`` flag.
+
+   .. warning::
+
+      SSL version 3 is insecure.  Its use is highly discouraged.
 
 .. data:: PROTOCOL_TLSv1
 
-   Selects TLS version 1 as the channel encryption protocol.  This is the most
-   modern version, and probably the best choice for maximum protection, if both
-   sides can speak it.
+   Selects TLS version 1.0 as the channel encryption protocol.
+
+.. data:: PROTOCOL_TLSv1_1
+
+   Selects TLS version 1.1 as the channel encryption protocol.
+   Available only with openssl version 1.0.1+.
+
+   .. versionadded:: 3.4
+
+.. data:: PROTOCOL_TLSv1_2
+
+   Selects TLS version 1.2 as the channel encryption protocol. This is the
+   most modern version, and probably the best choice for maximum protection,
+   if both sides can speak it.  Available only with openssl version 1.0.1+.
+
+   .. versionadded:: 3.4
 
 .. data:: OP_ALL
 
@@ -453,6 +607,22 @@
 
    .. versionadded:: 3.2
 
+.. data:: OP_NO_TLSv1_1
+
+   Prevents a TLSv1.1 connection. This option is only applicable in conjunction
+   with :const:`PROTOCOL_SSLv23`. It prevents the peers from choosing TLSv1.1 as
+   the protocol version. Available only with openssl version 1.0.1+.
+
+   .. versionadded:: 3.4
+
+.. data:: OP_NO_TLSv1_2
+
+   Prevents a TLSv1.2 connection. This option is only applicable in conjunction
+   with :const:`PROTOCOL_SSLv23`. It prevents the peers from choosing TLSv1.2 as
+   the protocol version. Available only with openssl version 1.0.1+.
+
+   .. versionadded:: 3.4
+
 .. data:: OP_CIPHER_SERVER_PREFERENCE
 
    Use the server's cipher ordering preference, rather than the client's.
@@ -496,9 +666,7 @@
 .. data:: HAS_SNI
 
    Whether the OpenSSL library has built-in support for the *Server Name
-   Indication* extension to the SSLv3 and TLSv1 protocols (as defined in
-   :rfc:`4366`).  When true, you can use the *server_hostname* argument to
-   :meth:`SSLContext.wrap_socket`.
+   Indication* extension (as defined in :rfc:`4366`).
 
    .. versionadded:: 3.2
 
@@ -549,45 +717,122 @@
 
    .. versionadded:: 3.2
 
+.. data:: ALERT_DESCRIPTION_HANDSHAKE_FAILURE
+          ALERT_DESCRIPTION_INTERNAL_ERROR
+          ALERT_DESCRIPTION_*
+
+   Alert Descriptions from :rfc:`5246` and others. The `IANA TLS Alert Registry
+   <http://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-parameters-6>`_
+   contains this list and references to the RFCs where their meaning is defined.
+
+   Used as the return value of the callback function in
+   :meth:`SSLContext.set_servername_callback`.
+
+   .. versionadded:: 3.4
+
+.. data:: Purpose.SERVER_AUTH
+
+   Option for :func:`create_default_context` and
+   :meth:`SSLContext.load_default_certs`.  This value indicates that the
+   context may be used to authenticate Web servers (therefore, it will
+   be used to create client-side sockets).
+
+   .. versionadded:: 3.4
+
+.. data:: Purpose.CLIENT_AUTH
+
+   Option for :func:`create_default_context` and
+   :meth:`SSLContext.load_default_certs`.  This value indicates that the
+   context may be used to authenticate Web clients (therefore, it will
+   be used to create server-side sockets).
+
+   .. versionadded:: 3.4
+
 
 SSL Sockets
 -----------
 
-SSL sockets provide the following methods of :ref:`socket-objects`:
+.. class:: SSLSocket(socket.socket)
 
-- :meth:`~socket.socket.accept()`
-- :meth:`~socket.socket.bind()`
-- :meth:`~socket.socket.close()`
-- :meth:`~socket.socket.connect()`
-- :meth:`~socket.socket.detach()`
-- :meth:`~socket.socket.fileno()`
-- :meth:`~socket.socket.getpeername()`, :meth:`~socket.socket.getsockname()`
-- :meth:`~socket.socket.getsockopt()`, :meth:`~socket.socket.setsockopt()`
-- :meth:`~socket.socket.gettimeout()`, :meth:`~socket.socket.settimeout()`,
-  :meth:`~socket.socket.setblocking()`
-- :meth:`~socket.socket.listen()`
-- :meth:`~socket.socket.makefile()`
-- :meth:`~socket.socket.recv()`, :meth:`~socket.socket.recv_into()`
-  (but passing a non-zero ``flags`` argument is not allowed)
-- :meth:`~socket.socket.send()`, :meth:`~socket.socket.sendall()` (with
-  the same limitation)
-- :meth:`~socket.socket.shutdown()`
+   SSL sockets provide the following methods of :ref:`socket-objects`:
 
-However, since the SSL (and TLS) protocol has its own framing atop
-of TCP, the SSL sockets abstraction can, in certain respects, diverge from
-the specification of normal, OS-level sockets.  See especially the
-:ref:`notes on non-blocking sockets <ssl-nonblocking>`.
+   - :meth:`~socket.socket.accept()`
+   - :meth:`~socket.socket.bind()`
+   - :meth:`~socket.socket.close()`
+   - :meth:`~socket.socket.connect()`
+   - :meth:`~socket.socket.detach()`
+   - :meth:`~socket.socket.fileno()`
+   - :meth:`~socket.socket.getpeername()`, :meth:`~socket.socket.getsockname()`
+   - :meth:`~socket.socket.getsockopt()`, :meth:`~socket.socket.setsockopt()`
+   - :meth:`~socket.socket.gettimeout()`, :meth:`~socket.socket.settimeout()`,
+     :meth:`~socket.socket.setblocking()`
+   - :meth:`~socket.socket.listen()`
+   - :meth:`~socket.socket.makefile()`
+   - :meth:`~socket.socket.recv()`, :meth:`~socket.socket.recv_into()`
+     (but passing a non-zero ``flags`` argument is not allowed)
+   - :meth:`~socket.socket.send()`, :meth:`~socket.socket.sendall()` (with
+     the same limitation)
+   - :meth:`~socket.socket.shutdown()`
+
+   However, since the SSL (and TLS) protocol has its own framing atop
+   of TCP, the SSL sockets abstraction can, in certain respects, diverge from
+   the specification of normal, OS-level sockets.  See especially the
+   :ref:`notes on non-blocking sockets <ssl-nonblocking>`.
+
+   Usually, :class:`SSLSocket` are not created directly, but using the
+   :func:`wrap_socket` function or the :meth:`SSLContext.wrap_socket` method.
 
 SSL sockets also have the following additional methods and attributes:
 
+.. method:: SSLSocket.read(len=0, buffer=None)
+
+   Read up to *len* bytes of data from the SSL socket and return the result as
+   a ``bytes`` instance. If *buffer* is specified, then read into the buffer
+   instead, and return the number of bytes read.
+
+   Raise :exc:`SSLWantReadError` or :exc:`SSLWantWriteError` if the socket is
+   :ref:`non-blocking <ssl-nonblocking>` and the read would block.
+
+   As at any time a re-negotiation is possible, a call to :meth:`read` can also
+   cause write operations.
+
+.. method:: SSLSocket.write(buf)
+
+   Write *buf* to the SSL socket and return the number of bytes written. The
+   *buf* argument must be an object supporting the buffer interface.
+
+   Raise :exc:`SSLWantReadError` or :exc:`SSLWantWriteError` if the socket is
+   :ref:`non-blocking <ssl-nonblocking>` and the write would block.
+
+   As at any time a re-negotiation is possible, a call to :meth:`write` can
+   also cause read operations.
+
+.. note::
+
+   The :meth:`~SSLSocket.read` and :meth:`~SSLSocket.write` methods are the
+   low-level methods that read and write unencrypted, application-level data
+   and and decrypt/encrypt it to encrypted, wire-level data. These methods
+   require an active SSL connection, i.e. the handshake was completed and
+   :meth:`SSLSocket.unwrap` was not called.
+
+   Normally you should use the socket API methods like
+   :meth:`~socket.socket.recv` and :meth:`~socket.socket.send` instead of these
+   methods.
+
 .. method:: SSLSocket.do_handshake()
 
    Perform the SSL setup handshake.
 
+   .. versionchanged:: 3.4
+      The handshake method also performs :func:`match_hostname` when the
+      :attr:`~SSLContext.check_hostname` attribute of the socket's
+      :attr:`~SSLSocket.context` is true.
+
 .. method:: SSLSocket.getpeercert(binary_form=False)
 
    If there is no certificate for the peer on the other end of the connection,
-   returns ``None``.
+   return ``None``.  If the SSL handshake hasn't been done yet, raise
+   :exc:`ValueError`.
 
    If the ``binary_form`` parameter is :const:`False`, and a certificate was
    received from the peer, this method returns a :class:`dict` instance.  If the
@@ -645,6 +890,11 @@
       The returned dictionary includes additional items such as ``issuer``
       and ``notBefore``.
 
+   .. versionchanged:: 3.4
+      :exc:`ValueError` is raised when the handshake isn't done.
+      The returned dictionary includes additional X509v3 extension items
+        such as ``crlDistributionPoints``, ``caIssuers`` and ``OCSP`` URIs.
+
 .. method:: SSLSocket.cipher()
 
    Returns a three-value tuple containing the name of the cipher being used, the
@@ -691,6 +941,11 @@
    returned socket should always be used for further communication with the
    other side of the connection, rather than the original socket.
 
+.. method:: SSLSocket.pending()
+
+   Returns the number of already decrypted bytes available for read, pending on
+   the connection.
+
 .. attribute:: SSLSocket.context
 
    The :class:`SSLContext` object this SSL socket is tied to.  If the SSL
@@ -700,6 +955,20 @@
 
    .. versionadded:: 3.2
 
+.. attribute:: SSLSocket.server_side
+
+   A boolean which is ``True`` for server-side sockets and ``False`` for
+   client-side sockets.
+
+   .. versionadded:: 3.2
+
+.. attribute:: SSLSocket.server_hostname
+
+   Hostname of the server: :class:`str` type, or ``None`` for server-side
+   socket or if the hostname was not specified in the constructor.
+
+   .. versionadded:: 3.2
+
 
 SSL Contexts
 ------------
@@ -715,11 +984,30 @@
 
    Create a new SSL context.  You must pass *protocol* which must be one
    of the ``PROTOCOL_*`` constants defined in this module.
-   :data:`PROTOCOL_SSLv23` is recommended for maximum interoperability.
+   :data:`PROTOCOL_SSLv23` is currently recommended for maximum
+   interoperability.
+
+   .. seealso::
+      :func:`create_default_context` lets the :mod:`ssl` module choose
+      security settings for a given purpose.
 
 
 :class:`SSLContext` objects have the following methods and attributes:
 
+.. method:: SSLContext.cert_store_stats()
+
+   Get statistics about quantities of loaded X.509 certificates, count of
+   X.509 certificates flagged as CA certificates and certificate revocation
+   lists as dictionary.
+
+   Example for a context with one CA cert and one other cert::
+
+      >>> context.cert_store_stats()
+      {'crl': 0, 'x509_ca': 1, 'x509': 2}
+
+   .. versionadded:: 3.4
+
+
 .. method:: SSLContext.load_cert_chain(certfile, keyfile=None, password=None)
 
    Load a private key and the corresponding certificate.  The *certfile*
@@ -750,12 +1038,32 @@
    .. versionchanged:: 3.3
       New optional argument *password*.
 
-.. method:: SSLContext.load_verify_locations(cafile=None, capath=None)
+.. method:: SSLContext.load_default_certs(purpose=Purpose.SERVER_AUTH)
+
+   Load a set of default "certification authority" (CA) certificates from
+   default locations. On Windows it loads CA certs from the ``CA`` and
+   ``ROOT`` system stores. On other systems it calls
+   :meth:`SSLContext.set_default_verify_paths`. In the future the method may
+   load CA certificates from other locations, too.
+
+   The *purpose* flag specifies what kind of CA certificates are loaded. The
+   default settings :data:`Purpose.SERVER_AUTH` loads certificates, that are
+   flagged and trusted for TLS web server authentication (client side
+   sockets). :data:`Purpose.CLIENT_AUTH` loads CA certificates for client
+   certificate verification on the server side.
+
+   .. versionadded:: 3.4
+
+.. method:: SSLContext.load_verify_locations(cafile=None, capath=None, cadata=None)
 
    Load a set of "certification authority" (CA) certificates used to validate
    other peers' certificates when :data:`verify_mode` is other than
    :data:`CERT_NONE`.  At least one of *cafile* or *capath* must be specified.
 
+   This method can also load certification revocation lists (CRLs) in PEM or
+   DER format. In order to make use of CRLs, :attr:`SSLContext.verify_flags`
+   must be configured properly.
+
    The *cafile* string, if present, is the path to a file of concatenated
    CA certificates in PEM format. See the discussion of
    :ref:`ssl-certificates` for more information about how to arrange the
@@ -766,6 +1074,25 @@
    following an `OpenSSL specific layout
    <http://www.openssl.org/docs/ssl/SSL_CTX_load_verify_locations.html>`_.
 
+   The *cadata* object, if present, is either an ASCII string of one or more
+   PEM-encoded certificates or a :term:`bytes-like object` of DER-encoded
+   certificates. Like with *capath* extra lines around PEM-encoded
+   certificates are ignored but at least one certificate must be present.
+
+   .. versionchanged:: 3.4
+      New optional argument *cadata*
+
+.. method:: SSLContext.get_ca_certs(binary_form=False)
+
+   Get a list of loaded "certification authority" (CA) certificates. If the
+   ``binary_form`` parameter is :const:`False` each list
+   entry is a dict like the output of :meth:`SSLSocket.getpeercert`. Otherwise
+   the method returns a list of DER-encoded certificates. The returned list
+   does not contain certificates from *capath* unless a certificate was
+   requested and loaded by a SSL connection.
+
+   .. versionadded:: 3.4
+
 .. method:: SSLContext.set_default_verify_paths()
 
    Load a set of default "certification authority" (CA) certificates from
@@ -803,6 +1130,56 @@
 
    .. versionadded:: 3.3
 
+.. method:: SSLContext.set_servername_callback(server_name_callback)
+
+   Register a callback function that will be called after the TLS Client Hello
+   handshake message has been received by the SSL/TLS server when the TLS client
+   specifies a server name indication. The server name indication mechanism
+   is specified in :rfc:`6066` section 3 - Server Name Indication.
+
+   Only one callback can be set per ``SSLContext``.  If *server_name_callback*
+   is ``None`` then the callback is disabled. Calling this function a
+   subsequent time will disable the previously registered callback.
+
+   The callback function, *server_name_callback*, will be called with three
+   arguments; the first being the :class:`ssl.SSLSocket`, the second is a string
+   that represents the server name that the client is intending to communicate
+   (or :const:`None` if the TLS Client Hello does not contain a server name)
+   and the third argument is the original :class:`SSLContext`. The server name
+   argument is the IDNA decoded server name.
+
+   A typical use of this callback is to change the :class:`ssl.SSLSocket`'s
+   :attr:`SSLSocket.context` attribute to a new object of type
+   :class:`SSLContext` representing a certificate chain that matches the server
+   name.
+
+   Due to the early negotiation phase of the TLS connection, only limited
+   methods and attributes are usable like
+   :meth:`SSLSocket.selected_npn_protocol` and :attr:`SSLSocket.context`.
+   :meth:`SSLSocket.getpeercert`, :meth:`SSLSocket.getpeercert`,
+   :meth:`SSLSocket.cipher` and :meth:`SSLSocket.compress` methods require that
+   the TLS connection has progressed beyond the TLS Client Hello and therefore
+   will not contain return meaningful values nor can they be called safely.
+
+   The *server_name_callback* function must return ``None`` to allow the
+   TLS negotiation to continue.  If a TLS failure is required, a constant
+   :const:`ALERT_DESCRIPTION_* <ALERT_DESCRIPTION_INTERNAL_ERROR>` can be
+   returned.  Other return values will result in a TLS fatal error with
+   :const:`ALERT_DESCRIPTION_INTERNAL_ERROR`.
+
+   If there is an IDNA decoding error on the server name, the TLS connection
+   will terminate with an :const:`ALERT_DESCRIPTION_INTERNAL_ERROR` fatal TLS
+   alert message to the client.
+
+   If an exception is raised from the *server_name_callback* function the TLS
+   connection will terminate with a fatal TLS alert message
+   :const:`ALERT_DESCRIPTION_HANDSHAKE_FAILURE`.
+
+   This method will raise :exc:`NotImplementedError` if the OpenSSL library
+   had OPENSSL_NO_TLSEXT defined when it was built.
+
+   .. versionadded:: 3.4
+
 .. method:: SSLContext.load_dh_params(dhfile)
 
    Load the key generation parameters for Diffie-Helman (DH) key exchange.
@@ -851,11 +1228,12 @@
    On client connections, the optional parameter *server_hostname* specifies
    the hostname of the service which we are connecting to.  This allows a
    single server to host multiple SSL-based services with distinct certificates,
-   quite similarly to HTTP virtual hosts.  Specifying *server_hostname*
-   will raise a :exc:`ValueError` if the OpenSSL library doesn't have support
-   for it (that is, if :data:`HAS_SNI` is :const:`False`).  Specifying
-   *server_hostname* will also raise a :exc:`ValueError` if *server_side*
-   is true.
+   quite similarly to HTTP virtual hosts. Specifying *server_hostname* will
+   raise a :exc:`ValueError` if *server_side* is true.
+
+   .. versionchanged:: 3.4.3
+      Always allow a server_hostname to be passed, even if OpenSSL does not
+      have SNI.
 
 .. method:: SSLContext.session_stats()
 
@@ -869,6 +1247,45 @@
       >>> stats['hits'], stats['misses']
       (0, 0)
 
+.. method:: SSLContext.get_ca_certs(binary_form=False)
+
+   Returns a list of dicts with information of loaded CA certs. If the
+   optional argument is true, returns a DER-encoded copy of the CA
+   certificate.
+
+   .. note::
+      Certificates in a capath directory aren't loaded unless they have
+      been used at least once.
+
+   .. versionadded:: 3.4
+
+.. attribute:: SSLContext.check_hostname
+
+   Wether to match the peer cert's hostname with :func:`match_hostname` in
+   :meth:`SSLSocket.do_handshake`. The context's
+   :attr:`~SSLContext.verify_mode` must be set to :data:`CERT_OPTIONAL` or
+   :data:`CERT_REQUIRED`, and you must pass *server_hostname* to
+   :meth:`~SSLContext.wrap_socket` in order to match the hostname.
+
+   Example::
+
+      import socket, ssl
+
+      context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+      context.verify_mode = ssl.CERT_REQUIRED
+      context.check_hostname = True
+      context.load_default_certs()
+
+      s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+      ssl_sock = context.wrap_socket(s, server_hostname='www.verisign.com')
+      ssl_sock.connect(('www.verisign.com', 443))
+
+   .. versionadded:: 3.4
+
+   .. note::
+
+     This features requires OpenSSL 0.9.8f or newer.
+
 .. attribute:: SSLContext.options
 
    An integer representing the set of SSL options enabled on this context.
@@ -885,6 +1302,15 @@
    The protocol version chosen when constructing the context.  This attribute
    is read-only.
 
+.. attribute:: SSLContext.verify_flags
+
+   The flags for certificate verification operations. You can set flags like
+   :data:`VERIFY_CRL_CHECK_LEAF` by ORing them together. By default OpenSSL
+   does neither require nor verify certificate revocation lists (CRLs).
+   Available only with openssl version 0.9.8+.
+
+   .. versionadded:: 3.4
+
 .. attribute:: SSLContext.verify_mode
 
    Whether to try to verify other peers' certificates and how to behave
@@ -970,20 +1396,9 @@
 certificate, you need to provide a "CA certs" file, filled with the certificate
 chains for each issuer you are willing to trust.  Again, this file just contains
 these chains concatenated together.  For validation, Python will use the first
-chain it finds in the file which matches.  Some "standard" root certificates are
-available from various certification authorities: `CACert.org
-<http://www.cacert.org/index.php?id=3>`_, `Thawte
-<http://www.thawte.com/roots/>`_, `Verisign
-<http://www.verisign.com/support/roots.html>`_, `Positive SSL
-<http://www.PositiveSSL.com/ssl-certificate-support/cert_installation/UTN-USERFirst-Hardware.crt>`_
-(used by python.org), `Equifax and GeoTrust
-<http://www.geotrust.com/resources/root_certificates/index.asp>`_.
-
-In general, if you are using SSL3 or TLS1, you don't need to put the full chain
-in your "CA certs" file; you only need the root certificates, and the remote
-peer is supposed to furnish the other certificates necessary to chain from its
-certificate to a root certificate.  See :rfc:`4158` for more discussion of the
-way in which certification chains can be built.
+chain it finds in the file which matches.  The platform's certificates file can
+be used by calling :meth:`SSLContext.load_default_certs`, this is done
+automatically with :func:`.create_default_context`.
 
 Combined key and certificate
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -1057,118 +1472,100 @@
 Client-side operation
 ^^^^^^^^^^^^^^^^^^^^^
 
-This example connects to an SSL server and prints the server's certificate::
+This example creates a SSL context with the recommended security settings
+for client sockets, including automatic certificate verification::
 
-   import socket, ssl, pprint
+   >>> context = ssl.create_default_context()
 
-   s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-   # require a certificate from the server
-   ssl_sock = ssl.wrap_socket(s,
-                              ca_certs="/etc/ca_certs_file",
-                              cert_reqs=ssl.CERT_REQUIRED)
-   ssl_sock.connect(('www.verisign.com', 443))
-
-   pprint.pprint(ssl_sock.getpeercert())
-   # note that closing the SSLSocket will also close the underlying socket
-   ssl_sock.close()
-
-As of January 6, 2012, the certificate printed by this program looks like
-this::
-
-   {'issuer': ((('countryName', 'US'),),
-               (('organizationName', 'VeriSign, Inc.'),),
-               (('organizationalUnitName', 'VeriSign Trust Network'),),
-               (('organizationalUnitName',
-                 'Terms of use at https://www.verisign.com/rpa (c)06'),),
-               (('commonName',
-                 'VeriSign Class 3 Extended Validation SSL SGC CA'),)),
-    'notAfter': 'May 25 23:59:59 2012 GMT',
-    'notBefore': 'May 26 00:00:00 2010 GMT',
-    'serialNumber': '53D2BEF924A7245E83CA01E46CAA2477',
-    'subject': ((('1.3.6.1.4.1.311.60.2.1.3', 'US'),),
-                (('1.3.6.1.4.1.311.60.2.1.2', 'Delaware'),),
-                (('businessCategory', 'V1.0, Clause 5.(b)'),),
-                (('serialNumber', '2497886'),),
-                (('countryName', 'US'),),
-                (('postalCode', '94043'),),
-                (('stateOrProvinceName', 'California'),),
-                (('localityName', 'Mountain View'),),
-                (('streetAddress', '487 East Middlefield Road'),),
-                (('organizationName', 'VeriSign, Inc.'),),
-                (('organizationalUnitName', ' Production Security Services'),),
-                (('commonName', 'www.verisign.com'),)),
-    'subjectAltName': (('DNS', 'www.verisign.com'),
-                       ('DNS', 'verisign.com'),
-                       ('DNS', 'www.verisign.net'),
-                       ('DNS', 'verisign.net'),
-                       ('DNS', 'www.verisign.mobi'),
-                       ('DNS', 'verisign.mobi'),
-                       ('DNS', 'www.verisign.eu'),
-                       ('DNS', 'verisign.eu')),
-    'version': 3}
-
-This other example first creates an SSL context, instructs it to verify
-certificates sent by peers, and feeds it a set of recognized certificate
-authorities (CA)::
+If you prefer to tune security settings yourself, you might create
+a context from scratch (but beware that you might not get the settings
+right)::
 
    >>> context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
    >>> context.verify_mode = ssl.CERT_REQUIRED
+   >>> context.check_hostname = True
    >>> context.load_verify_locations("/etc/ssl/certs/ca-bundle.crt")
 
-(it is assumed your operating system places a bundle of all CA certificates
-in ``/etc/ssl/certs/ca-bundle.crt``; if not, you'll get an error and have
-to adjust the location)
+(this snippet assumes your operating system places a bundle of all CA
+certificates in ``/etc/ssl/certs/ca-bundle.crt``; if not, you'll get an
+error and have to adjust the location)
 
 When you use the context to connect to a server, :const:`CERT_REQUIRED`
 validates the server certificate: it ensures that the server certificate
 was signed with one of the CA certificates, and checks the signature for
 correctness::
 
-   >>> conn = context.wrap_socket(socket.socket(socket.AF_INET))
-   >>> conn.connect(("linuxfr.org", 443))
+   >>> conn = context.wrap_socket(socket.socket(socket.AF_INET),
+   ...                            server_hostname="www.python.org")
+   >>> conn.connect(("www.python.org", 443))
 
-You should then fetch the certificate and check its fields for conformity::
+You may then fetch the certificate::
 
    >>> cert = conn.getpeercert()
-   >>> ssl.match_hostname(cert, "linuxfr.org")
 
 Visual inspection shows that the certificate does identify the desired service
-(that is, the HTTPS host ``linuxfr.org``)::
+(that is, the HTTPS host ``www.python.org``)::
 
    >>> pprint.pprint(cert)
-   {'issuer': ((('organizationName', 'CAcert Inc.'),),
-               (('organizationalUnitName', 'http://www.CAcert.org'),),
-               (('commonName', 'CAcert Class 3 Root'),)),
-    'notAfter': 'Jun  7 21:02:24 2013 GMT',
-    'notBefore': 'Jun  8 21:02:24 2011 GMT',
-    'serialNumber': 'D3E9',
-    'subject': ((('commonName', 'linuxfr.org'),),),
-    'subjectAltName': (('DNS', 'linuxfr.org'),
-                       ('othername', '<unsupported>'),
-                       ('DNS', 'linuxfr.org'),
-                       ('othername', '<unsupported>'),
-                       ('DNS', 'dev.linuxfr.org'),
-                       ('othername', '<unsupported>'),
-                       ('DNS', 'prod.linuxfr.org'),
-                       ('othername', '<unsupported>'),
-                       ('DNS', 'alpha.linuxfr.org'),
-                       ('othername', '<unsupported>'),
-                       ('DNS', '*.linuxfr.org'),
-                       ('othername', '<unsupported>')),
+   {'OCSP': ('http://ocsp.digicert.com',),
+    'caIssuers': ('http://cacerts.digicert.com/DigiCertSHA2ExtendedValidationServerCA.crt',),
+    'crlDistributionPoints': ('http://crl3.digicert.com/sha2-ev-server-g1.crl',
+                              'http://crl4.digicert.com/sha2-ev-server-g1.crl'),
+    'issuer': ((('countryName', 'US'),),
+               (('organizationName', 'DigiCert Inc'),),
+               (('organizationalUnitName', 'www.digicert.com'),),
+               (('commonName', 'DigiCert SHA2 Extended Validation Server CA'),)),
+    'notAfter': 'Sep  9 12:00:00 2016 GMT',
+    'notBefore': 'Sep  5 00:00:00 2014 GMT',
+    'serialNumber': '01BB6F00122B177F36CAB49CEA8B6B26',
+    'subject': ((('businessCategory', 'Private Organization'),),
+                (('1.3.6.1.4.1.311.60.2.1.3', 'US'),),
+                (('1.3.6.1.4.1.311.60.2.1.2', 'Delaware'),),
+                (('serialNumber', '3359300'),),
+                (('streetAddress', '16 Allen Rd'),),
+                (('postalCode', '03894-4801'),),
+                (('countryName', 'US'),),
+                (('stateOrProvinceName', 'NH'),),
+                (('localityName', 'Wolfeboro,'),),
+                (('organizationName', 'Python Software Foundation'),),
+                (('commonName', 'www.python.org'),)),
+    'subjectAltName': (('DNS', 'www.python.org'),
+                       ('DNS', 'python.org'),
+                       ('DNS', 'pypi.python.org'),
+                       ('DNS', 'docs.python.org'),
+                       ('DNS', 'testpypi.python.org'),
+                       ('DNS', 'bugs.python.org'),
+                       ('DNS', 'wiki.python.org'),
+                       ('DNS', 'hg.python.org'),
+                       ('DNS', 'mail.python.org'),
+                       ('DNS', 'packaging.python.org'),
+                       ('DNS', 'pythonhosted.org'),
+                       ('DNS', 'www.pythonhosted.org'),
+                       ('DNS', 'test.pythonhosted.org'),
+                       ('DNS', 'us.pycon.org'),
+                       ('DNS', 'id.python.org')),
     'version': 3}
 
-Now that you are assured of its authenticity, you can proceed to talk with
-the server::
+Now the SSL channel is established and the certificate verified, you can
+proceed to talk with the server::
 
    >>> conn.sendall(b"HEAD / HTTP/1.0\r\nHost: linuxfr.org\r\n\r\n")
    >>> pprint.pprint(conn.recv(1024).split(b"\r\n"))
-   [b'HTTP/1.1 302 Found',
-    b'Date: Sun, 16 May 2010 13:43:28 GMT',
-    b'Server: Apache/2.2',
-    b'Location: https://linuxfr.org/pub/',
-    b'Vary: Accept-Encoding',
+   [b'HTTP/1.1 200 OK',
+    b'Date: Sat, 18 Oct 2014 18:27:20 GMT',
+    b'Server: nginx',
+    b'Content-Type: text/html; charset=utf-8',
+    b'X-Frame-Options: SAMEORIGIN',
+    b'Content-Length: 45679',
+    b'Accept-Ranges: bytes',
+    b'Via: 1.1 varnish',
+    b'Age: 2188',
+    b'X-Served-By: cache-lcy1134-LCY',
+    b'X-Cache: HIT',
+    b'X-Cache-Hits: 11',
+    b'Vary: Cookie',
+    b'Strict-Transport-Security: max-age=63072000; includeSubDomains',
     b'Connection: close',
-    b'Content-Type: text/html; charset=iso-8859-1',
     b'',
     b'']
 
@@ -1186,7 +1583,7 @@
 
    import socket, ssl
 
-   context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+   context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
    context.load_cert_chain(certfile="mycertfile", keyfile="mykeyfile")
 
    bindsocket = socket.socket()
@@ -1230,8 +1627,19 @@
 Notes on non-blocking sockets
 -----------------------------
 
-When working with non-blocking sockets, there are several things you need
-to be aware of:
+SSL sockets behave slightly different than regular sockets in
+non-blocking mode. When working with non-blocking sockets, there are
+thus several things you need to be aware of:
+
+- Most :class:`SSLSocket` methods will raise either
+  :exc:`SSLWantWriteError` or :exc:`SSLWantReadError` instead of
+  :exc:`BlockingIOError` if an I/O operation would
+  block. :exc:`SSLWantReadError` will be raised if a read operation on
+  the underlying socket is necessary, and :exc:`SSLWantWriteError` for
+  a write operation on the underlying socket. Note that attempts to
+  *write* to an SSL socket may require *reading* from the underlying
+  socket first, and attempts to *read* from the SSL socket may require
+  a prior *write* to the underlying socket.
 
 - Calling :func:`~select.select` tells you that the OS-level socket can be
   read from (or written to), but it does not imply that there is sufficient
@@ -1240,8 +1648,14 @@
   and :meth:`SSLSocket.send` failures, and retry after another call to
   :func:`~select.select`.
 
+- Conversely, since the SSL layer has its own framing, a SSL socket may
+  still have data available for reading without :func:`~select.select`
+  being aware of it.  Therefore, you should first call
+  :meth:`SSLSocket.recv` to drain any potentially available data, and then
+  only block on a :func:`~select.select` call if still necessary.
+
   (of course, similar provisions apply when using other primitives such as
-  :func:`~select.poll`)
+  :func:`~select.poll`, or those in the :mod:`selectors` module)
 
 - The SSL handshake itself will be non-blocking: the
   :meth:`SSLSocket.do_handshake` method has to be retried until it returns
@@ -1257,15 +1671,54 @@
         except ssl.SSLWantWriteError:
             select.select([], [sock], [])
 
+.. seealso::
+
+   The :mod:`asyncio` module supports non-blocking SSL sockets and provides a
+   higher level API. It polls for events using the :mod:`selectors` module and
+   handles :exc:`SSLWantWriteError`, :exc:`SSLWantReadError` and
+   :exc:`BlockingIOError` exceptions. It runs the SSL handshake asynchronously
+   as well.
+
 
 .. _ssl-security:
 
 Security considerations
 -----------------------
 
-Verifying certificates
-^^^^^^^^^^^^^^^^^^^^^^
+Best defaults
+^^^^^^^^^^^^^
 
+For **client use**, if you don't have any special requirements for your
+security policy, it is highly recommended that you use the
+:func:`create_default_context` function to create your SSL context.
+It will load the system's trusted CA certificates, enable certificate
+validation and hostname checking, and try to choose reasonably secure
+protocol and cipher settings.
+
+For example, here is how you would use the :class:`smtplib.SMTP` class to
+create a trusted, secure connection to a SMTP server::
+
+   >>> import ssl, smtplib
+   >>> smtp = smtplib.SMTP("mail.python.org", port=587)
+   >>> context = ssl.create_default_context()
+   >>> smtp.starttls(context=context)
+   (220, b'2.0.0 Ready to start TLS')
+
+If a client certificate is needed for the connection, it can be added with
+:meth:`SSLContext.load_cert_chain`.
+
+By contrast, if you create the SSL context by calling the :class:`SSLContext`
+constructor yourself, it will not have certificate validation nor hostname
+checking enabled by default.  If you do so, please read the paragraphs below
+to achieve a good security level.
+
+Manual settings
+^^^^^^^^^^^^^^^
+
+Verifying certificates
+''''''''''''''''''''''
+
+When calling the :class:`SSLContext` constructor directly,
 :const:`CERT_NONE` is the default.  Since it does not authenticate the other
 peer, it can be insecure, especially in client mode where most of time you
 would like to ensure the authenticity of the server you're talking to.
@@ -1274,7 +1727,9 @@
 have to check that the server certificate, which can be obtained by calling
 :meth:`SSLSocket.getpeercert`, matches the desired service.  For many
 protocols and applications, the service can be identified by the hostname;
-in this case, the :func:`match_hostname` function can be used.
+in this case, the :func:`match_hostname` function can be used.  This common
+check is automatically performed when :attr:`SSLContext.check_hostname` is
+enabled.
 
 In server mode, if you want to authenticate your clients using the SSL layer
 (rather than using a higher-level authentication mechanism), you'll also have
@@ -1287,37 +1742,32 @@
       by default).
 
 Protocol versions
-^^^^^^^^^^^^^^^^^
+'''''''''''''''''
 
-SSL version 2 is considered insecure and is therefore dangerous to use.  If
-you want maximum compatibility between clients and servers, it is recommended
-to use :const:`PROTOCOL_SSLv23` as the protocol version and then disable
-SSLv2 explicitly using the :data:`SSLContext.options` attribute::
+SSL versions 2 and 3 are considered insecure and are therefore dangerous to
+use.  If you want maximum compatibility between clients and servers, it is
+recommended to use :const:`PROTOCOL_SSLv23` as the protocol version and then
+disable SSLv2 and SSLv3 explicitly using the :data:`SSLContext.options`
+attribute::
 
    context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
    context.options |= ssl.OP_NO_SSLv2
+   context.options |= ssl.OP_NO_SSLv3
 
-The SSL context created above will allow SSLv3 and TLSv1 connections, but
-not SSLv2.
+The SSL context created above will only allow TLSv1 and later (if
+supported by your system) connections.
 
 Cipher selection
-^^^^^^^^^^^^^^^^
+''''''''''''''''
 
 If you have advanced security requirements, fine-tuning of the ciphers
 enabled when negotiating a SSL session is possible through the
 :meth:`SSLContext.set_ciphers` method.  Starting from Python 3.2.3, the
 ssl module disables certain weak ciphers by default, but you may want
-to further restrict the cipher choice.  For example::
-
-   context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-   context.set_ciphers('HIGH:!aNULL:!eNULL')
-
-The ``!aNULL:!eNULL`` part of the cipher spec is necessary to disable ciphers
-which don't provide both encryption and authentication.  Be sure to read
-OpenSSL's documentation about the `cipher list
-format <http://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT>`_.
-If you want to check which ciphers are enabled by a given cipher list,
-use the ``openssl ciphers`` command on your system.
+to further restrict the cipher choice. Be sure to read OpenSSL's documentation
+about the `cipher list format <http://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT>`_.
+If you want to check which ciphers are enabled by a given cipher list, use the
+``openssl ciphers`` command on your system.
 
 Multi-processing
 ^^^^^^^^^^^^^^^^
@@ -1350,3 +1800,12 @@
 
    `RFC 4366: Transport Layer Security (TLS) Extensions <http://www.ietf.org/rfc/rfc4366>`_
        Blake-Wilson et. al.
+
+   `RFC 5246: The Transport Layer Security (TLS) Protocol Version 1.2 <http://tools.ietf.org/html/rfc5246>`_
+       T. Dierks et. al.
+
+   `RFC 6066: Transport Layer Security (TLS) Extensions <http://tools.ietf.org/html/rfc6066>`_
+       D. Eastlake
+
+   `IANA TLS: Transport Layer Security (TLS) Parameters <http://www.iana.org/assignments/tls-parameters/tls-parameters.xml>`_
+       IANA
diff --git a/Doc/library/stat.rst b/Doc/library/stat.rst
index 6c20aa2..24769f6 100644
--- a/Doc/library/stat.rst
+++ b/Doc/library/stat.rst
@@ -6,7 +6,8 @@
               os.lstat() and os.fstat().
 .. sectionauthor:: Skip Montanaro <skip@automatrix.com>
 
-**Source code:** :source:`Lib/stat.py`
+**Source code:** :source:`Modules/_stat.c`
+                 :source:`Lib/stat.py`
 
 --------------
 
@@ -15,6 +16,9 @@
 exist).  For complete details about the :c:func:`stat`, :c:func:`fstat` and
 :c:func:`lstat` calls, consult the documentation for your system.
 
+.. versionchanged:: 3.4
+   The stat module is backed by a C implementation.
+
 The :mod:`stat` module defines the following functions to test for specific file
 types:
 
@@ -53,6 +57,24 @@
 
    Return non-zero if the mode is from a socket.
 
+.. function:: S_ISDOOR(mode)
+
+   Return non-zero if the mode is from a door.
+
+   .. versionadded:: 3.4
+
+.. function:: S_ISPORT(mode)
+
+   Return non-zero if the mode is from an event port.
+
+   .. versionadded:: 3.4
+
+.. function:: S_ISWHT(mode)
+
+   Return non-zero if the mode is from a whiteout.
+
+   .. versionadded:: 3.4
+
 Two additional functions are defined for more general manipulation of the file's
 mode:
 
@@ -113,6 +135,10 @@
 
    .. versionadded:: 3.3
 
+   .. versionchanged:: 3.4
+      The function supports :data:`S_IFDOOR`, :data:`S_IFPORT` and
+      :data:`S_IFWHT`.
+
 
 All the variables below are simply symbolic indexes into the 10-tuple returned
 by :func:`os.stat`, :func:`os.fstat` or :func:`os.lstat`.
@@ -210,6 +236,29 @@
 
    FIFO.
 
+.. data:: S_IFDOOR
+
+   Door.
+
+   .. versionadded:: 3.4
+
+.. data:: S_IFPORT
+
+   Event port.
+
+   .. versionadded:: 3.4
+
+.. data:: S_IFWHT
+
+   Whiteout.
+
+   .. versionadded:: 3.4
+
+.. note::
+
+   :data:`S_IFDOOR`, :data:`S_IFPORT` or :data:`S_IFWHT` are defined as
+   0 when the platform does not have support for the file types.
+
 The following flags can also be used in the *mode* argument of :func:`os.chmod`:
 
 .. data:: S_ISUID
diff --git a/Doc/library/statistics.rst b/Doc/library/statistics.rst
new file mode 100644
index 0000000..0c9d88c
--- /dev/null
+++ b/Doc/library/statistics.rst
@@ -0,0 +1,418 @@
+:mod:`statistics` --- Mathematical statistics functions
+=======================================================
+
+.. module:: statistics
+   :synopsis: mathematical statistics functions
+.. moduleauthor:: Steven D'Aprano <steve+python@pearwood.info>
+.. sectionauthor:: Steven D'Aprano <steve+python@pearwood.info>
+
+.. versionadded:: 3.4
+
+.. testsetup:: *
+
+   from statistics import *
+   __name__ = '<doctest>'
+
+**Source code:** :source:`Lib/statistics.py`
+
+--------------
+
+This module provides functions for calculating mathematical statistics of
+numeric (:class:`Real`-valued) data.
+
+.. note::
+
+   Unless explicitly noted otherwise, these functions support :class:`int`,
+   :class:`float`, :class:`decimal.Decimal` and :class:`fractions.Fraction`.
+   Behaviour with other types (whether in the numeric tower or not) is
+   currently unsupported.  Mixed types are also undefined and
+   implementation-dependent.  If your input data consists of mixed types,
+   you may be able to use :func:`map` to ensure a consistent result, e.g.
+   ``map(float, input_data)``.
+
+Averages and measures of central location
+-----------------------------------------
+
+These functions calculate an average or typical value from a population
+or sample.
+
+=======================  =============================================
+:func:`mean`             Arithmetic mean ("average") of data.
+:func:`median`           Median (middle value) of data.
+:func:`median_low`       Low median of data.
+:func:`median_high`      High median of data.
+:func:`median_grouped`   Median, or 50th percentile, of grouped data.
+:func:`mode`             Mode (most common value) of discrete data.
+=======================  =============================================
+
+Measures of spread
+------------------
+
+These functions calculate a measure of how much the population or sample
+tends to deviate from the typical or average values.
+
+=======================  =============================================
+:func:`pstdev`           Population standard deviation of data.
+:func:`pvariance`        Population variance of data.
+:func:`stdev`            Sample standard deviation of data.
+:func:`variance`         Sample variance of data.
+=======================  =============================================
+
+
+Function details
+----------------
+
+Note: The functions do not require the data given to them to be sorted.
+However, for reading convenience, most of the examples show sorted sequences.
+
+.. function:: mean(data)
+
+   Return the sample arithmetic mean of *data*, a sequence or iterator of
+   real-valued numbers.
+
+   The arithmetic mean is the sum of the data divided by the number of data
+   points.  It is commonly called "the average", although it is only one of many
+   different mathematical averages.  It is a measure of the central location of
+   the data.
+
+   If *data* is empty, :exc:`StatisticsError` will be raised.
+
+   Some examples of use:
+
+   .. doctest::
+
+      >>> mean([1, 2, 3, 4, 4])
+      2.8
+      >>> mean([-1.0, 2.5, 3.25, 5.75])
+      2.625
+
+      >>> from fractions import Fraction as F
+      >>> mean([F(3, 7), F(1, 21), F(5, 3), F(1, 3)])
+      Fraction(13, 21)
+
+      >>> from decimal import Decimal as D
+      >>> mean([D("0.5"), D("0.75"), D("0.625"), D("0.375")])
+      Decimal('0.5625')
+
+   .. note::
+
+      The mean is strongly affected by outliers and is not a robust estimator
+      for central location: the mean is not necessarily a typical example of the
+      data points.  For more robust, although less efficient, measures of
+      central location, see :func:`median` and :func:`mode`.  (In this case,
+      "efficient" refers to statistical efficiency rather than computational
+      efficiency.)
+
+      The sample mean gives an unbiased estimate of the true population mean,
+      which means that, taken on average over all the possible samples,
+      ``mean(sample)`` converges on the true mean of the entire population.  If
+      *data* represents the entire population rather than a sample, then
+      ``mean(data)`` is equivalent to calculating the true population mean μ.
+
+
+.. function:: median(data)
+
+   Return the median (middle value) of numeric data, using the common "mean of
+   middle two" method.  If *data* is empty, :exc:`StatisticsError` is raised.
+
+   The median is a robust measure of central location, and is less affected by
+   the presence of outliers in your data.  When the number of data points is
+   odd, the middle data point is returned:
+
+   .. doctest::
+
+      >>> median([1, 3, 5])
+      3
+
+   When the number of data points is even, the median is interpolated by taking
+   the average of the two middle values:
+
+   .. doctest::
+
+      >>> median([1, 3, 5, 7])
+      4.0
+
+   This is suited for when your data is discrete, and you don't mind that the
+   median may not be an actual data point.
+
+   .. seealso:: :func:`median_low`, :func:`median_high`, :func:`median_grouped`
+
+
+.. function:: median_low(data)
+
+   Return the low median of numeric data.  If *data* is empty,
+   :exc:`StatisticsError` is raised.
+
+   The low median is always a member of the data set.  When the number of data
+   points is odd, the middle value is returned.  When it is even, the smaller of
+   the two middle values is returned.
+
+   .. doctest::
+
+      >>> median_low([1, 3, 5])
+      3
+      >>> median_low([1, 3, 5, 7])
+      3
+
+   Use the low median when your data are discrete and you prefer the median to
+   be an actual data point rather than interpolated.
+
+
+.. function:: median_high(data)
+
+   Return the high median of data.  If *data* is empty, :exc:`StatisticsError`
+   is raised.
+
+   The high median is always a member of the data set.  When the number of data
+   points is odd, the middle value is returned.  When it is even, the larger of
+   the two middle values is returned.
+
+   .. doctest::
+
+      >>> median_high([1, 3, 5])
+      3
+      >>> median_high([1, 3, 5, 7])
+      5
+
+   Use the high median when your data are discrete and you prefer the median to
+   be an actual data point rather than interpolated.
+
+
+.. function:: median_grouped(data, interval=1)
+
+   Return the median of grouped continuous data, calculated as the 50th
+   percentile, using interpolation.  If *data* is empty, :exc:`StatisticsError`
+   is raised.
+
+   .. doctest::
+
+      >>> median_grouped([52, 52, 53, 54])
+      52.5
+
+   In the following example, the data are rounded, so that each value represents
+   the midpoint of data classes, e.g. 1 is the midpoint of the class 0.5-1.5, 2
+   is the midpoint of 1.5-2.5, 3 is the midpoint of 2.5-3.5, etc.  With the data
+   given, the middle value falls somewhere in the class 3.5-4.5, and
+   interpolation is used to estimate it:
+
+   .. doctest::
+
+      >>> median_grouped([1, 2, 2, 3, 4, 4, 4, 4, 4, 5])
+      3.7
+
+   Optional argument *interval* represents the class interval, and defaults
+   to 1.  Changing the class interval naturally will change the interpolation:
+
+   .. doctest::
+
+      >>> median_grouped([1, 3, 3, 5, 7], interval=1)
+      3.25
+      >>> median_grouped([1, 3, 3, 5, 7], interval=2)
+      3.5
+
+   This function does not check whether the data points are at least
+   *interval* apart.
+
+   .. impl-detail::
+
+      Under some circumstances, :func:`median_grouped` may coerce data points to
+      floats.  This behaviour is likely to change in the future.
+
+   .. seealso::
+
+      * "Statistics for the Behavioral Sciences", Frederick J Gravetter and
+        Larry B Wallnau (8th Edition).
+
+      * Calculating the `median <http://www.ualberta.ca/~opscan/median.html>`_.
+
+      * The `SSMEDIAN
+        <https://help.gnome.org/users/gnumeric/stable/gnumeric.html#gnumeric-function-SSMEDIAN>`_
+        function in the Gnome Gnumeric spreadsheet, including `this discussion
+        <https://mail.gnome.org/archives/gnumeric-list/2011-April/msg00018.html>`_.
+
+
+.. function:: mode(data)
+
+   Return the most common data point from discrete or nominal *data*.  The mode
+   (when it exists) is the most typical value, and is a robust measure of
+   central location.
+
+   If *data* is empty, or if there is not exactly one most common value,
+   :exc:`StatisticsError` is raised.
+
+   ``mode`` assumes discrete data, and returns a single value. This is the
+   standard treatment of the mode as commonly taught in schools:
+
+   .. doctest::
+
+      >>> mode([1, 1, 2, 3, 3, 3, 3, 4])
+      3
+
+   The mode is unique in that it is the only statistic which also applies
+   to nominal (non-numeric) data:
+
+   .. doctest::
+
+      >>> mode(["red", "blue", "blue", "red", "green", "red", "red"])
+      'red'
+
+
+.. function:: pstdev(data, mu=None)
+
+   Return the population standard deviation (the square root of the population
+   variance).  See :func:`pvariance` for arguments and other details.
+
+   .. doctest::
+
+      >>> pstdev([1.5, 2.5, 2.5, 2.75, 3.25, 4.75])
+      0.986893273527251
+
+
+.. function:: pvariance(data, mu=None)
+
+   Return the population variance of *data*, a non-empty iterable of real-valued
+   numbers.  Variance, or second moment about the mean, is a measure of the
+   variability (spread or dispersion) of data.  A large variance indicates that
+   the data is spread out; a small variance indicates it is clustered closely
+   around the mean.
+
+   If the optional second argument *mu* is given, it should be the mean of
+   *data*.  If it is missing or ``None`` (the default), the mean is
+   automatically calculated.
+
+   Use this function to calculate the variance from the entire population.  To
+   estimate the variance from a sample, the :func:`variance` function is usually
+   a better choice.
+
+   Raises :exc:`StatisticsError` if *data* is empty.
+
+   Examples:
+
+   .. doctest::
+
+      >>> data = [0.0, 0.25, 0.25, 1.25, 1.5, 1.75, 2.75, 3.25]
+      >>> pvariance(data)
+      1.25
+
+   If you have already calculated the mean of your data, you can pass it as the
+   optional second argument *mu* to avoid recalculation:
+
+   .. doctest::
+
+      >>> mu = mean(data)
+      >>> pvariance(data, mu)
+      1.25
+
+   This function does not attempt to verify that you have passed the actual mean
+   as *mu*.  Using arbitrary values for *mu* may lead to invalid or impossible
+   results.
+
+   Decimals and Fractions are supported:
+
+   .. doctest::
+
+      >>> from decimal import Decimal as D
+      >>> pvariance([D("27.5"), D("30.25"), D("30.25"), D("34.5"), D("41.75")])
+      Decimal('24.815')
+
+      >>> from fractions import Fraction as F
+      >>> pvariance([F(1, 4), F(5, 4), F(1, 2)])
+      Fraction(13, 72)
+
+   .. note::
+
+      When called with the entire population, this gives the population variance
+      σ².  When called on a sample instead, this is the biased sample variance
+      s², also known as variance with N degrees of freedom.
+
+      If you somehow know the true population mean μ, you may use this function
+      to calculate the variance of a sample, giving the known population mean as
+      the second argument.  Provided the data points are representative
+      (e.g. independent and identically distributed), the result will be an
+      unbiased estimate of the population variance.
+
+
+.. function:: stdev(data, xbar=None)
+
+   Return the sample standard deviation (the square root of the sample
+   variance).  See :func:`variance` for arguments and other details.
+
+   .. doctest::
+
+      >>> stdev([1.5, 2.5, 2.5, 2.75, 3.25, 4.75])
+      1.0810874155219827
+
+
+.. function:: variance(data, xbar=None)
+
+   Return the sample variance of *data*, an iterable of at least two real-valued
+   numbers.  Variance, or second moment about the mean, is a measure of the
+   variability (spread or dispersion) of data.  A large variance indicates that
+   the data is spread out; a small variance indicates it is clustered closely
+   around the mean.
+
+   If the optional second argument *xbar* is given, it should be the mean of
+   *data*.  If it is missing or ``None`` (the default), the mean is
+   automatically calculated.
+
+   Use this function when your data is a sample from a population. To calculate
+   the variance from the entire population, see :func:`pvariance`.
+
+   Raises :exc:`StatisticsError` if *data* has fewer than two values.
+
+   Examples:
+
+   .. doctest::
+
+      >>> data = [2.75, 1.75, 1.25, 0.25, 0.5, 1.25, 3.5]
+      >>> variance(data)
+      1.3720238095238095
+
+   If you have already calculated the mean of your data, you can pass it as the
+   optional second argument *xbar* to avoid recalculation:
+
+   .. doctest::
+
+      >>> m = mean(data)
+      >>> variance(data, m)
+      1.3720238095238095
+
+   This function does not attempt to verify that you have passed the actual mean
+   as *xbar*.  Using arbitrary values for *xbar* can lead to invalid or
+   impossible results.
+
+   Decimal and Fraction values are supported:
+
+   .. doctest::
+
+      >>> from decimal import Decimal as D
+      >>> variance([D("27.5"), D("30.25"), D("30.25"), D("34.5"), D("41.75")])
+      Decimal('31.01875')
+
+      >>> from fractions import Fraction as F
+      >>> variance([F(1, 6), F(1, 2), F(5, 3)])
+      Fraction(67, 108)
+
+   .. note::
+
+      This is the sample variance s² with Bessel's correction, also known as
+      variance with N-1 degrees of freedom.  Provided that the data points are
+      representative (e.g. independent and identically distributed), the result
+      should be an unbiased estimate of the true population variance.
+
+      If you somehow know the actual population mean μ you should pass it to the
+      :func:`pvariance` function as the *mu* parameter to get the variance of a
+      sample.
+
+Exceptions
+----------
+
+A single exception is defined:
+
+.. exception:: StatisticsError
+
+   Subclass of :exc:`ValueError` for statistics-related exceptions.
+
+..
+   # This modelines must appear within the last ten lines of the file.
+   kate: indent-width 3; remove-trailing-space on; replace-tabs on; encoding utf-8;
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
index ab78cdc..e0f8cfa 100644
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -269,8 +269,8 @@
 :func:`complex` can be used to produce numbers of a specific type.
 
 All numeric types (except complex) support the following operations, sorted by
-ascending priority (operations in the same box have the same priority; all
-numeric operations have a higher priority than comparison operations):
+ascending priority (all numeric operations have a higher priority than
+comparison operations):
 
 +---------------------+---------------------------------+---------+--------------------+
 | Operation           | Result                          | Notes   | Full documentation |
@@ -354,7 +354,7 @@
    The numeric literals accepted include the digits ``0`` to ``9`` or any
    Unicode equivalent (code points with the ``Nd`` property).
 
-   See http://www.unicode.org/Public/6.0.0/ucd/extracted/DerivedNumericType.txt
+   See http://www.unicode.org/Public/6.3.0/ucd/extracted/DerivedNumericType.txt
    for a complete list of code points with the ``Nd`` property.
 
 
@@ -404,8 +404,7 @@
 operations and higher than the comparisons; the unary operation ``~`` has the
 same priority as the other unary numeric operations (``+`` and ``-``).
 
-This table lists the bitwise operations sorted in ascending priority
-(operations in the same box have the same priority):
+This table lists the bitwise operations sorted in ascending priority:
 
 +------------+--------------------------------+----------+
 | Operation  | Result                         | Notes    |
@@ -444,7 +443,7 @@
 -----------------------------------
 
 The int type implements the :class:`numbers.Integral` :term:`abstract base
-class`. In addition, it provides one more method:
+class`. In addition, it provides a few more methods:
 
 .. method:: int.bit_length()
 
@@ -820,10 +819,10 @@
 provided to make it easier to correctly implement these operations on
 custom sequence types.
 
-This table lists the sequence operations sorted in ascending priority
-(operations in the same box have the same priority).  In the table, *s* and *t*
-are sequences of the same type, *n*, *i*, *j* and *k* are integers and *x* is
-an arbitrary object that meets any type and value restrictions imposed by *s*.
+This table lists the sequence operations sorted in ascending priority.  In the
+table, *s* and *t* are sequences of the same type, *n*, *i*, *j* and *k* are
+integers and *x* is an arbitrary object that meets any type and value
+restrictions imposed by *s*.
 
 The ``in`` and ``not in`` operations have the same priorities as the
 comparison operations. The ``+`` (concatenation) and ``*`` (repetition)
@@ -1493,7 +1492,9 @@
 .. method:: str.center(width[, fillchar])
 
    Return centered in a string of length *width*. Padding is done using the
-   specified *fillchar* (default is a space).
+   specified *fillchar* (default is an ASCII space). The original string is
+   returned if *width* is less than or equal to ``len(s)``.
+
 
 
 .. method:: str.count(sub[, start[, end]])
@@ -1511,7 +1512,7 @@
    a :exc:`UnicodeError`. Other possible
    values are ``'ignore'``, ``'replace'``, ``'xmlcharrefreplace'``,
    ``'backslashreplace'`` and any other name registered via
-   :func:`codecs.register_error`, see section :ref:`codec-base-classes`. For a
+   :func:`codecs.register_error`, see section :ref:`error-handlers`. For a
    list of possible encodings, see section :ref:`standard-encodings`.
 
    .. versionchanged:: 3.1
@@ -1526,7 +1527,7 @@
    at that position.
 
 
-.. method:: str.expandtabs([tabsize])
+.. method:: str.expandtabs(tabsize=8)
 
    Return a copy of the string where all tab characters are replaced by one or
    more spaces, depending on the current column and the given tab size.  Tab
@@ -1598,7 +1599,8 @@
 
 .. method:: str.index(sub[, start[, end]])
 
-   Like :meth:`find`, but raise :exc:`ValueError` when the substring is not found.
+   Like :meth:`~str.find`, but raise :exc:`ValueError` when the substring is
+   not found.
 
 
 .. method:: str.isalnum()
@@ -1701,9 +1703,9 @@
 
 .. method:: str.ljust(width[, fillchar])
 
-   Return the string left justified in a string of length *width*. Padding is done
-   using the specified *fillchar* (default is a space).  The original string is
-   returned if *width* is less than or equal to ``len(s)``.
+   Return the string left justified in a string of length *width*. Padding is
+   done using the specified *fillchar* (default is an ASCII space). The
+   original string is returned if *width* is less than or equal to ``len(s)``.
 
 
 .. method:: str.lower()
@@ -1720,7 +1722,7 @@
    Return a copy of the string with leading characters removed.  The *chars*
    argument is a string specifying the set of characters to be removed.  If omitted
    or ``None``, the *chars* argument defaults to removing whitespace.  The *chars*
-   argument is not a prefix; rather, all combinations of its values are stripped:
+   argument is not a prefix; rather, all combinations of its values are stripped::
 
       >>> '   spacious   '.lstrip()
       'spacious   '
@@ -1773,9 +1775,9 @@
 
 .. method:: str.rjust(width[, fillchar])
 
-   Return the string right justified in a string of length *width*. Padding is done
-   using the specified *fillchar* (default is a space). The original string is
-   returned if *width* is less than or equal to ``len(s)``.
+   Return the string right justified in a string of length *width*. Padding is
+   done using the specified *fillchar* (default is an ASCII space). The
+   original string is returned if *width* is less than or equal to ``len(s)``.
 
 
 .. method:: str.rpartition(sep)
@@ -1800,7 +1802,7 @@
    Return a copy of the string with trailing characters removed.  The *chars*
    argument is a string specifying the set of characters to be removed.  If omitted
    or ``None``, the *chars* argument defaults to removing whitespace.  The *chars*
-   argument is not a suffix; rather, all combinations of its values are stripped:
+   argument is not a suffix; rather, all combinations of its values are stripped::
 
       >>> '   spacious   '.rstrip()
       '   spacious'
@@ -1822,6 +1824,15 @@
    (for example, ``'1<>2<>3'.split('<>')`` returns ``['1', '2', '3']``).
    Splitting an empty string with a specified separator returns ``['']``.
 
+   For example::
+
+      >>> '1,2,3'.split(',')
+      ['1', '2', '3']
+      >>> '1,2,3'.split(',', maxsplit=1)
+      ['1', '2,3']
+      >>> '1,2,,3,'.split(',')
+      ['1', '2', '', '3', '']
+
    If *sep* is not specified or is ``None``, a different splitting algorithm is
    applied: runs of consecutive whitespace are regarded as a single separator,
    and the result will contain no empty strings at the start or end if the
@@ -1829,8 +1840,14 @@
    string or a string consisting of just whitespace with a ``None`` separator
    returns ``[]``.
 
-   For example, ``' 1  2   3  '.split()`` returns ``['1', '2', '3']``, and
-   ``'  1  2   3  '.split(None, 1)`` returns ``['1', '2   3  ']``.
+   For example::
+
+      >>> '1 2 3'.split()
+      ['1', '2', '3']
+      >>> '1 2 3'.split(maxsplit=1)
+      ['1', '2 3']
+      >>> '   1   2   3   '.split()
+      ['1', '2', '3']
 
 
 .. index::
@@ -1843,13 +1860,28 @@
    Line breaks are not included in the resulting list unless *keepends* is
    given and true.
 
-   For example, ``'ab c\n\nde fg\rkl\r\n'.splitlines()`` returns
-   ``['ab c', '', 'de fg', 'kl']``, while the same call with ``splitlines(True)``
-   returns ``['ab c\n', '\n', 'de fg\r', 'kl\r\n']``.
+   For example::
+
+      >>> 'ab c\n\nde fg\rkl\r\n'.splitlines()
+      ['ab c', '', 'de fg', 'kl']
+      >>> 'ab c\n\nde fg\rkl\r\n'.splitlines(keepends=True)
+      ['ab c\n', '\n', 'de fg\r', 'kl\r\n']
 
    Unlike :meth:`~str.split` when a delimiter string *sep* is given, this
    method returns an empty list for the empty string, and a terminal line
-   break does not result in an extra line.
+   break does not result in an extra line::
+
+      >>> "".splitlines()
+      []
+      >>> "One line\n".splitlines()
+      ['One line']
+
+   For comparison, ``split('\n')`` gives::
+
+      >>> ''.split('\n')
+      ['']
+      >>> 'Two lines\n'.split('\n')
+      ['Two lines', '']
 
 
 .. method:: str.startswith(prefix[, start[, end]])
@@ -1866,7 +1898,7 @@
    The *chars* argument is a string specifying the set of characters to be removed.
    If omitted or ``None``, the *chars* argument defaults to removing whitespace.
    The *chars* argument is not a prefix or suffix; rather, all combinations of its
-   values are stripped:
+   values are stripped::
 
       >>> '   spacious   '.strip()
       'spacious'
@@ -1886,6 +1918,11 @@
    Return a titlecased version of the string where words start with an uppercase
    character and the remaining characters are lowercase.
 
+   For example::
+
+      >>> 'Hello world'.title()
+      'Hello World'
+
    The algorithm uses a simple language-independent definition of a word as
    groups of consecutive letters.  The definition works in many contexts but
    it means that apostrophes in contractions and possessives form word
@@ -1938,9 +1975,18 @@
 
 .. method:: str.zfill(width)
 
-   Return the numeric string left filled with zeros in a string of length
-   *width*.  A sign prefix is handled correctly.  The original string is
-   returned if *width* is less than or equal to ``len(s)``.
+   Return a copy of the string left filled with ASCII ``'0'`` digits to
+   make a string of length *width*. A leading sign prefix (``'+'``/``'-'``
+   is handled by inserting the padding *after* the sign character rather
+   than before. The original string is returned if *width* is less than
+   or equal to ``len(s)``.
+
+   For example::
+
+      >>> "42".zfill(5)
+      '00042'
+      >>> "-42".zfill(5)
+      '-0042'
 
 
 
@@ -2198,16 +2244,28 @@
 
 Also see the :ref:`bytes <func-bytes>` built-in.
 
-Since bytes objects are sequences of integers, for a bytes object *b*,
-``b[0]`` will be an integer, while ``b[0:1]`` will be a bytes object of
-length 1.  (This contrasts with text strings, where both indexing and
-slicing will produce a string of length 1)
+Since 2 hexadecimal digits correspond precisely to a single byte, hexadecimal
+numbers are a commonly used format for describing binary data. Accordingly,
+the bytes type has an additional class method to read data in that format:
+
+.. classmethod:: bytes.fromhex(string)
+
+   This :class:`bytes` class method returns a bytes object, decoding the
+   given string object.  The string must contain two hexadecimal digits per
+   byte, with ASCII spaces being ignored.
+
+   >>> bytes.fromhex('2Ef0 F1f2  ')
+   b'.\xf0\xf1\xf2'
+
+Since bytes objects are sequences of integers (akin to a tuple), for a bytes
+object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be a bytes
+object of length 1.  (This contrasts with text strings, where both indexing
+and slicing will produce a string of length 1)
 
 The representation of bytes objects uses the literal format (``b'...'``)
 since it is often more useful than e.g. ``bytes([46, 46, 46])``.  You can
 always convert a bytes object into a list of integers using ``list(b)``.
 
-
 .. note::
    For Python 2.x users: In the Python 2.x series, a variety of implicit
    conversions between 8-bit strings (the closest thing 2.x offers to a
@@ -2241,6 +2299,29 @@
 
 Also see the :ref:`bytearray <func-bytearray>` built-in.
 
+Since 2 hexadecimal digits correspond precisely to a single byte, hexadecimal
+numbers are a commonly used format for describing binary data. Accordingly,
+the bytearray type has an additional class method to read data in that format:
+
+.. classmethod:: bytearray.fromhex(string)
+
+   This :class:`bytearray` class method returns bytearray object, decoding
+   the given string object.  The string must contain two hexadecimal digits
+   per byte, with ASCII spaces being ignored.
+
+   >>> bytearray.fromhex('2Ef0 F1f2  ')
+   bytearray(b'.\xf0\xf1\xf2')
+
+Since bytearray objects are sequences of integers (akin to a list), for a
+bytearray object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be
+a bytearray object of length 1.  (This contrasts with text strings, where
+both indexing and slicing will produce a string of length 1)
+
+The representation of bytearray objects uses the bytes literal format
+(``bytearray(b'...')``) since it is often more useful than e.g.
+``bytearray([46, 46, 46])``.  You can always convert a bytearray object into
+a list of integers using ``list(b)``.
+
 
 .. _bytes-methods:
 
@@ -2252,25 +2333,10 @@
 
 Both bytes and bytearray objects support the :ref:`common <typesseq-common>`
 sequence operations. They interoperate not just with operands of the same
-type, but with any object that supports the
-:ref:`buffer protocol <bufferobjects>`. Due to this flexibility, they can be
+type, but with any :term:`bytes-like object`. Due to this flexibility, they can be
 freely mixed in operations without causing errors. However, the return type
 of the result may depend on the order of operands.
 
-Due to the common use of ASCII text as the basis for binary protocols, bytes
-and bytearray objects provide almost all methods found on text strings, with
-the exceptions of:
-
-* :meth:`str.encode` (which converts text strings to bytes objects)
-* :meth:`str.format` and :meth:`str.format_map` (which are used to format
-  text for display to users)
-* :meth:`str.isidentifier`, :meth:`str.isnumeric`, :meth:`str.isdecimal`,
-  :meth:`str.isprintable` (which are used to check various properties of
-  text strings which are not typically applicable to binary protocols).
-
-All other string methods are supported, although sometimes with slight
-differences in functionality and semantics (as described below).
-
 .. note::
 
    The methods on bytes and bytearray objects don't accept strings as their
@@ -2285,25 +2351,30 @@
       a = b"abc"
       b = a.replace(b"a", b"f")
 
-Whenever a bytes or bytearray method needs to interpret the bytes as
-characters (e.g. the :meth:`is...` methods, :meth:`split`, :meth:`strip`),
-the ASCII character set is assumed (text strings use Unicode semantics).
+Some bytes and bytearray operations assume the use of ASCII compatible
+binary formats, and hence should be avoided when working with arbitrary
+binary data. These restrictions are covered below.
 
 .. note::
-   Using these ASCII based methods to manipulate binary data that is not
+   Using these ASCII based operations to manipulate binary data that is not
    stored in an ASCII based format may lead to data corruption.
 
-The search operations (:keyword:`in`, :meth:`count`, :meth:`find`,
-:meth:`index`, :meth:`rfind` and :meth:`rindex`) all accept both integers
-in the range 0 to 255 (inclusive) as well as bytes and byte array sequences.
+The following methods on bytes and bytearray objects can be used with
+arbitrary binary data.
 
-.. versionchanged:: 3.3
-   All of the search methods also accept an integer in the range 0 to 255
-   (inclusive) as their first argument.
+.. method:: bytes.count(sub[, start[, end]])
+            bytearray.count(sub[, start[, end]])
 
+   Return the number of non-overlapping occurrences of subsequence *sub* in
+   the range [*start*, *end*].  Optional arguments *start* and *end* are
+   interpreted as in slice notation.
 
-Each bytes and bytearray instance provides a :meth:`~bytes.decode` convenience
-method that is the inverse of :meth:`str.encode`:
+   The subsequence to search for may be any :term:`bytes-like object` or an
+   integer in the range 0 to 255.
+
+   .. versionchanged:: 3.3
+      Also accept an integer in the range 0 to 255 as the subsequence.
+
 
 .. method:: bytes.decode(encoding="utf-8", errors="strict")
             bytearray.decode(encoding="utf-8", errors="strict")
@@ -2313,40 +2384,178 @@
    error handling scheme.  The default for *errors* is ``'strict'``, meaning
    that encoding errors raise a :exc:`UnicodeError`.  Other possible values are
    ``'ignore'``, ``'replace'`` and any other name registered via
-   :func:`codecs.register_error`, see section :ref:`codec-base-classes`. For a
+   :func:`codecs.register_error`, see section :ref:`error-handlers`. For a
    list of possible encodings, see section :ref:`standard-encodings`.
 
+   .. note::
+
+      Passing the *encoding* argument to :class:`str` allows decoding any
+      :term:`bytes-like object` directly, without needing to make a temporary
+      bytes or bytearray object.
+
    .. versionchanged:: 3.1
       Added support for keyword arguments.
 
-Since 2 hexadecimal digits correspond precisely to a single byte, hexadecimal
-numbers are a commonly used format for describing binary data. Accordingly,
-the bytes and bytearray types have an additional class method to read data in
-that format:
 
-.. classmethod:: bytes.fromhex(string)
-                 bytearray.fromhex(string)
+.. method:: bytes.endswith(suffix[, start[, end]])
+            bytearray.endswith(suffix[, start[, end]])
 
-   This :class:`bytes` class method returns a bytes or bytearray object,
-   decoding the given string object.  The string must contain two hexadecimal
-   digits per byte, spaces are ignored.
+   Return ``True`` if the binary data ends with the specified *suffix*,
+   otherwise return ``False``.  *suffix* can also be a tuple of suffixes to
+   look for.  With optional *start*, test beginning at that position.  With
+   optional *end*, stop comparing at that position.
 
-   >>> bytes.fromhex('2Ef0 F1f2  ')
-   b'.\xf0\xf1\xf2'
+   The suffix(es) to search for may be any :term:`bytes-like object`.
 
 
-The maketrans and translate methods differ in semantics from the versions
-available on strings:
+.. method:: bytes.find(sub[, start[, end]])
+            bytearray.find(sub[, start[, end]])
+
+   Return the lowest index in the data where the subsequence *sub* is found,
+   such that *sub* is contained in the slice ``s[start:end]``.  Optional
+   arguments *start* and *end* are interpreted as in slice notation.  Return
+   ``-1`` if *sub* is not found.
+
+   The subsequence to search for may be any :term:`bytes-like object` or an
+   integer in the range 0 to 255.
+
+   .. note::
+
+      The :meth:`~bytes.find` method should be used only if you need to know the
+      position of *sub*.  To check if *sub* is a substring or not, use the
+      :keyword:`in` operator::
+
+         >>> b'Py' in b'Python'
+         True
+
+   .. versionchanged:: 3.3
+      Also accept an integer in the range 0 to 255 as the subsequence.
+
+
+.. method:: bytes.index(sub[, start[, end]])
+            bytearray.index(sub[, start[, end]])
+
+   Like :meth:`~bytes.find`, but raise :exc:`ValueError` when the
+   subsequence is not found.
+
+   The subsequence to search for may be any :term:`bytes-like object` or an
+   integer in the range 0 to 255.
+
+   .. versionchanged:: 3.3
+      Also accept an integer in the range 0 to 255 as the subsequence.
+
+
+.. method:: bytes.join(iterable)
+            bytearray.join(iterable)
+
+   Return a bytes or bytearray object which is the concatenation of the
+   binary data sequences in the :term:`iterable` *iterable*.  A
+   :exc:`TypeError` will be raised if there are any values in *iterable*
+   that are note :term:`bytes-like objects <bytes-like object>`, including
+   :class:`str` objects.  The separator between elements is the contents
+   of the bytes or bytearray object providing this method.
+
+
+.. staticmethod:: bytes.maketrans(from, to)
+                  bytearray.maketrans(from, to)
+
+   This static method returns a translation table usable for
+   :meth:`bytes.translate` that will map each character in *from* into the
+   character at the same position in *to*; *from* and *to* must both be
+   :term:`bytes-like objects <bytes-like object>` and have the same length.
+
+   .. versionadded:: 3.1
+
+
+.. method:: bytes.partition(sep)
+            bytearray.partition(sep)
+
+   Split the sequence at the first occurrence of *sep*, and return a 3-tuple
+   containing the part before the separator, the separator, and the part
+   after the separator.  If the separator is not found, return a 3-tuple
+   containing a copy of the original sequence, followed by two empty bytes or
+   bytearray objects.
+
+   The separator to search for may be any :term:`bytes-like object`.
+
+
+.. method:: bytes.replace(old, new[, count])
+            bytearray.replace(old, new[, count])
+
+   Return a copy of the sequence with all occurrences of subsequence *old*
+   replaced by *new*.  If the optional argument *count* is given, only the
+   first *count* occurrences are replaced.
+
+   The subsequence to search for and its replacement may be any
+   :term:`bytes-like object`.
+
+   .. note::
+
+      The bytearray version of this method does *not* operate in place - it
+      always produces a new object, even if no changes were made.
+
+
+.. method:: bytes.rfind(sub[, start[, end]])
+            bytearray.rfind(sub[, start[, end]])
+
+   Return the highest index in the sequence where the subsequence *sub* is
+   found, such that *sub* is contained within ``s[start:end]``.  Optional
+   arguments *start* and *end* are interpreted as in slice notation. Return
+   ``-1`` on failure.
+
+   The subsequence to search for may be any :term:`bytes-like object` or an
+   integer in the range 0 to 255.
+
+   .. versionchanged:: 3.3
+      Also accept an integer in the range 0 to 255 as the subsequence.
+
+
+.. method:: bytes.rindex(sub[, start[, end]])
+            bytearray.rindex(sub[, start[, end]])
+
+   Like :meth:`~bytes.rfind` but raises :exc:`ValueError` when the
+   subsequence *sub* is not found.
+
+   The subsequence to search for may be any :term:`bytes-like object` or an
+   integer in the range 0 to 255.
+
+   .. versionchanged:: 3.3
+      Also accept an integer in the range 0 to 255 as the subsequence.
+
+
+.. method:: bytes.rpartition(sep)
+            bytearray.rpartition(sep)
+
+   Split the sequence at the last occurrence of *sep*, and return a 3-tuple
+   containing the part before the separator, the separator, and the part
+   after the separator.  If the separator is not found, return a 3-tuple
+   containing a copy of the original sequence, followed by two empty bytes or
+   bytearray objects.
+
+   The separator to search for may be any :term:`bytes-like object`.
+
+
+.. method:: bytes.startswith(prefix[, start[, end]])
+            bytearray.startswith(prefix[, start[, end]])
+
+   Return ``True`` if the binary data starts with the specified *prefix*,
+   otherwise return ``False``.  *prefix* can also be a tuple of prefixes to
+   look for.  With optional *start*, test beginning at that position.  With
+   optional *end*, stop comparing at that position.
+
+   The prefix(es) to search for may be any :term:`bytes-like object`.
+
 
 .. method:: bytes.translate(table[, delete])
             bytearray.translate(table[, delete])
 
    Return a copy of the bytes or bytearray object where all bytes occurring in
-   the optional argument *delete* are removed, and the remaining bytes have been
-   mapped through the given translation table, which must be a bytes object of
-   length 256.
+   the optional argument *delete* are removed, and the remaining bytes have
+   been mapped through the given translation table, which must be a bytes
+   object of length 256.
 
-   You can use the :func:`bytes.maketrans` method to create a translation table.
+   You can use the :func:`bytes.maketrans` method to create a translation
+   table.
 
    Set the *table* argument to ``None`` for translations that only delete
    characters::
@@ -2355,15 +2564,497 @@
       b'rd ths shrt txt'
 
 
-.. staticmethod:: bytes.maketrans(from, to)
-                  bytearray.maketrans(from, to)
+The following methods on bytes and bytearray objects have default behaviours
+that assume the use of ASCII compatible binary formats, but can still be used
+with arbitrary binary data by passing appropriate arguments. Note that all of
+the bytearray methods in this section do *not* operate in place, and instead
+produce new objects.
 
-   This static method returns a translation table usable for
-   :meth:`bytes.translate` that will map each character in *from* into the
-   character at the same position in *to*; *from* and *to* must be bytes objects
-   and have the same length.
+.. method:: bytes.center(width[, fillbyte])
+            bytearray.center(width[, fillbyte])
 
-   .. versionadded:: 3.1
+   Return a copy of the object centered in a sequence of length *width*.
+   Padding is done using the specified *fillbyte* (default is an ASCII
+   space). For :class:`bytes` objects, the original sequence is returned if
+   *width* is less than or equal to ``len(s)``.
+
+   .. note::
+
+      The bytearray version of this method does *not* operate in place -
+      it always produces a new object, even if no changes were made.
+
+
+.. method:: bytes.ljust(width[, fillbyte])
+            bytearray.ljust(width[, fillbyte])
+
+   Return a copy of the object left justified in a sequence of length *width*.
+   Padding is done using the specified *fillbyte* (default is an ASCII
+   space). For :class:`bytes` objects, the original sequence is returned if
+   *width* is less than or equal to ``len(s)``.
+
+   .. note::
+
+      The bytearray version of this method does *not* operate in place -
+      it always produces a new object, even if no changes were made.
+
+
+.. method:: bytes.lstrip([chars])
+            bytearray.lstrip([chars])
+
+   Return a copy of the sequence with specified leading bytes removed.  The
+   *chars* argument is a binary sequence specifying the set of byte values to
+   be removed - the name refers to the fact this method is usually used with
+   ASCII characters.  If omitted or ``None``, the *chars* argument defaults
+   to removing ASCII whitespace.  The *chars* argument is not a prefix;
+   rather, all combinations of its values are stripped::
+
+      >>> b'   spacious   '.lstrip()
+      b'spacious   '
+      >>> b'www.example.com'.lstrip(b'cmowz.')
+      b'example.com'
+
+   The binary sequence of byte values to remove may be any
+   :term:`bytes-like object`.
+
+   .. note::
+
+      The bytearray version of this method does *not* operate in place -
+      it always produces a new object, even if no changes were made.
+
+
+.. method:: bytes.rjust(width[, fillbyte])
+            bytearray.rjust(width[, fillbyte])
+
+   Return a copy of the object right justified in a sequence of length *width*.
+   Padding is done using the specified *fillbyte* (default is an ASCII
+   space). For :class:`bytes` objects, the original sequence is returned if
+   *width* is less than or equal to ``len(s)``.
+
+   .. note::
+
+      The bytearray version of this method does *not* operate in place -
+      it always produces a new object, even if no changes were made.
+
+
+.. method:: bytes.rsplit(sep=None, maxsplit=-1)
+            bytearray.rsplit(sep=None, maxsplit=-1)
+
+   Split the binary sequence into subsequences of the same type, using *sep*
+   as the delimiter string. If *maxsplit* is given, at most *maxsplit* splits
+   are done, the *rightmost* ones.  If *sep* is not specified or ``None``,
+   any subsequence consisting solely of ASCII whitespace is a separator.
+   Except for splitting from the right, :meth:`rsplit` behaves like
+   :meth:`split` which is described in detail below.
+
+
+.. method:: bytes.rstrip([chars])
+            bytearray.rstrip([chars])
+
+   Return a copy of the sequence with specified trailing bytes removed.  The
+   *chars* argument is a binary sequence specifying the set of byte values to
+   be removed - the name refers to the fact this method is usually used with
+   ASCII characters.  If omitted or ``None``, the *chars* argument defaults to
+   removing ASCII whitespace.  The *chars* argument is not a suffix; rather,
+   all combinations of its values are stripped::
+
+      >>> b'   spacious   '.rstrip()
+      b'   spacious'
+      >>> b'mississippi'.rstrip(b'ipz')
+      b'mississ'
+
+   The binary sequence of byte values to remove may be any
+   :term:`bytes-like object`.
+
+   .. note::
+
+      The bytearray version of this method does *not* operate in place -
+      it always produces a new object, even if no changes were made.
+
+
+.. method:: bytes.split(sep=None, maxsplit=-1)
+            bytearray.split(sep=None, maxsplit=-1)
+
+   Split the binary sequence into subsequences of the same type, using *sep*
+   as the delimiter string. If *maxsplit* is given and non-negative, at most
+   *maxsplit* splits are done (thus, the list will have at most ``maxsplit+1``
+   elements).  If *maxsplit* is not specified or is ``-1``, then there is no
+   limit on the number of splits (all possible splits are made).
+
+   If *sep* is given, consecutive delimiters are not grouped together and are
+   deemed to delimit empty subsequences (for example, ``b'1,,2'.split(b',')``
+   returns ``[b'1', b'', b'2']``).  The *sep* argument may consist of a
+   multibyte sequence (for example, ``b'1<>2<>3'.split(b'<>')`` returns
+   ``[b'1', b'2', b'3']``). Splitting an empty sequence with a specified
+   separator returns ``[b'']`` or ``[bytearray(b'')]`` depending on the type
+   of object being split.  The *sep* argument may be any
+   :term:`bytes-like object`.
+
+   For example::
+
+      >>> b'1,2,3'.split(b',')
+      [b'1', b'2', b'3']
+      >>> b'1,2,3'.split(b',', maxsplit=1)
+      [b'1', b'2,3']
+      >>> b'1,2,,3,'.split(b',')
+      [b'1', b'2', b'', b'3', b'']
+
+   If *sep* is not specified or is ``None``, a different splitting algorithm
+   is applied: runs of consecutive ASCII whitespace are regarded as a single
+   separator, and the result will contain no empty strings at the start or
+   end if the sequence has leading or trailing whitespace.  Consequently,
+   splitting an empty sequence or a sequence consisting solely of ASCII
+   whitespace without a specified separator returns ``[]``.
+
+   For example::
+
+
+      >>> b'1 2 3'.split()
+      [b'1', b'2', b'3']
+      >>> b'1 2 3'.split(maxsplit=1)
+      [b'1', b'2 3']
+      >>> b'   1   2   3   '.split()
+      [b'1', b'2', b'3']
+
+
+.. method:: bytes.strip([chars])
+            bytearray.strip([chars])
+
+   Return a copy of the sequence with specified leading and trailing bytes
+   removed. The *chars* argument is a binary sequence specifying the set of
+   byte values to be removed - the name refers to the fact this method is
+   usually used with ASCII characters.  If omitted or ``None``, the *chars*
+   argument defaults to removing ASCII whitespace. The *chars* argument is
+   not a prefix or suffix; rather, all combinations of its values are
+   stripped::
+
+      >>> b'   spacious   '.strip()
+      b'spacious'
+      >>> b'www.example.com'.strip(b'cmowz.')
+      b'example'
+
+   The binary sequence of byte values to remove may be any
+   :term:`bytes-like object`.
+
+   .. note::
+
+      The bytearray version of this method does *not* operate in place -
+      it always produces a new object, even if no changes were made.
+
+
+The following methods on bytes and bytearray objects assume the use of ASCII
+compatible binary formats and should not be applied to arbitrary binary data.
+Note that all of the bytearray methods in this section do *not* operate in
+place, and instead produce new objects.
+
+.. method:: bytes.capitalize()
+            bytearray.capitalize()
+
+   Return a copy of the sequence with each byte interpreted as an ASCII
+   character, and the first byte capitalized and the rest lowercased.
+   Non-ASCII byte values are passed through unchanged.
+
+   .. note::
+
+      The bytearray version of this method does *not* operate in place - it
+      always produces a new object, even if no changes were made.
+
+
+.. method:: bytes.expandtabs(tabsize=8)
+            bytearray.expandtabs(tabsize=8)
+
+   Return a copy of the sequence where all ASCII tab characters are replaced
+   by one or more ASCII spaces, depending on the current column and the given
+   tab size.  Tab positions occur every *tabsize* bytes (default is 8,
+   giving tab positions at columns 0, 8, 16 and so on).  To expand the
+   sequence, the current column is set to zero and the sequence is examined
+   byte by byte.  If the byte is an ASCII tab character (``b'\t'``), one or
+   more space characters are inserted in the result until the current column
+   is equal to the next tab position. (The tab character itself is not
+   copied.)  If the current byte is an ASCII newline (``b'\n'``) or
+   carriage return (``b'\r'``), it is copied and the current column is reset
+   to zero.  Any other byte value is copied unchanged and the current column
+   is incremented by one regardless of how the byte value is represented when
+   printed::
+
+      >>> b'01\t012\t0123\t01234'.expandtabs()
+      b'01      012     0123    01234'
+      >>> b'01\t012\t0123\t01234'.expandtabs(4)
+      b'01  012 0123    01234'
+
+   .. note::
+
+      The bytearray version of this method does *not* operate in place - it
+      always produces a new object, even if no changes were made.
+
+
+.. method:: bytes.isalnum()
+            bytearray.isalnum()
+
+   Return true if all bytes in the sequence are alphabetical ASCII characters
+   or ASCII decimal digits and the sequence is not empty, false otherwise.
+   Alphabetic ASCII characters are those byte values in the sequence
+   ``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'``. ASCII decimal
+   digits are those byte values in the sequence ``b'0123456789'``.
+
+   For example::
+
+      >>> b'ABCabc1'.isalnum()
+      True
+      >>> b'ABC abc1'.isalnum()
+      False
+
+
+.. method:: bytes.isalpha()
+            bytearray.isalpha()
+
+   Return true if all bytes in the sequence are alphabetic ASCII characters
+   and the sequence is not empty, false otherwise.  Alphabetic ASCII
+   characters are those byte values in the sequence
+   ``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'``.
+
+   For example::
+
+      >>> b'ABCabc'.isalpha()
+      True
+      >>> b'ABCabc1'.isalpha()
+      False
+
+
+.. method:: bytes.isdigit()
+            bytearray.isdigit()
+
+   Return true if all bytes in the sequence are ASCII decimal digits
+   and the sequence is not empty, false otherwise. ASCII decimal digits are
+   those byte values in the sequence ``b'0123456789'``.
+
+   For example::
+
+      >>> b'1234'.isdigit()
+      True
+      >>> b'1.23'.isdigit()
+      False
+
+
+.. method:: bytes.islower()
+            bytearray.islower()
+
+   Return true if there is at least one lowercase ASCII character
+   in the sequence and no uppercase ASCII characters, false otherwise.
+
+   For example::
+
+      >>> b'hello world'.islower()
+      True
+      >>> b'Hello world'.islower()
+      False
+
+   Lowercase ASCII characters are those byte values in the sequence
+   ``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters
+   are those byte values in the sequence ``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``.
+
+
+.. method:: bytes.isspace()
+            bytearray.isspace()
+
+   Return true if all bytes in the sequence are ASCII whitespace and the
+   sequence is not empty, false otherwise.  ASCII whitespace characters are
+   those byte values in the sequence b' \t\n\r\x0b\f' (space, tab, newline,
+   carriage return, vertical tab, form feed).
+
+
+.. method:: bytes.istitle()
+            bytearray.istitle()
+
+   Return true if the sequence is ASCII titlecase and the sequence is not
+   empty, false otherwise. See :meth:`bytes.title` for more details on the
+   definition of "titlecase".
+
+   For example::
+
+      >>> b'Hello World'.istitle()
+      True
+      >>> b'Hello world'.istitle()
+      False
+
+
+.. method:: bytes.isupper()
+            bytearray.isupper()
+
+   Return true if there is at least one lowercase alphabetic ASCII character
+   in the sequence and no uppercase ASCII characters, false otherwise.
+
+   For example::
+
+      >>> b'HELLO WORLD'.isupper()
+      True
+      >>> b'Hello world'.isupper()
+      False
+
+   Lowercase ASCII characters are those byte values in the sequence
+   ``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters
+   are those byte values in the sequence ``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``.
+
+
+.. method:: bytes.lower()
+            bytearray.lower()
+
+   Return a copy of the sequence with all the uppercase ASCII characters
+   converted to their corresponding lowercase counterpart.
+
+   For example::
+
+      >>> b'Hello World'.lower()
+      b'hello world'
+
+   Lowercase ASCII characters are those byte values in the sequence
+   ``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters
+   are those byte values in the sequence ``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``.
+
+   .. note::
+
+      The bytearray version of this method does *not* operate in place - it
+      always produces a new object, even if no changes were made.
+
+
+.. index::
+   single: universal newlines; bytes.splitlines method
+   single: universal newlines; bytearray.splitlines method
+
+.. method:: bytes.splitlines(keepends=False)
+            bytearray.splitlines(keepends=False)
+
+   Return a list of the lines in the binary sequence, breaking at ASCII
+   line boundaries. This method uses the :term:`universal newlines` approach
+   to splitting lines. Line breaks are not included in the resulting list
+   unless *keepends* is given and true.
+
+   For example::
+
+      >>> b'ab c\n\nde fg\rkl\r\n'.splitlines()
+      [b'ab c', b'', b'de fg', b'kl']
+      >>> b'ab c\n\nde fg\rkl\r\n'.splitlines(keepends=True)
+      [b'ab c\n', b'\n', b'de fg\r', b'kl\r\n']
+
+   Unlike :meth:`~bytes.split` when a delimiter string *sep* is given, this
+   method returns an empty list for the empty string, and a terminal line
+   break does not result in an extra line::
+
+      >>> b"".split(b'\n'), b"Two lines\n".split(b'\n')
+      ([b''], [b'Two lines', b''])
+      >>> b"".splitlines(), b"One line\n".splitlines()
+      ([], [b'One line'])
+
+
+.. method:: bytes.swapcase()
+            bytearray.swapcase()
+
+   Return a copy of the sequence with all the lowercase ASCII characters
+   converted to their corresponding uppercase counterpart and vice-versa.
+
+   For example::
+
+      >>> b'Hello World'.swapcase()
+      b'hELLO wORLD'
+
+   Lowercase ASCII characters are those byte values in the sequence
+   ``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters
+   are those byte values in the sequence ``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``.
+
+   Unlike :func:`str.swapcase()`, it is always the case that
+   ``bin.swapcase().swapcase() == bin`` for the binary versions. Case
+   conversions are symmetrical in ASCII, even though that is not generally
+   true for arbitrary Unicode code points.
+
+   .. note::
+
+      The bytearray version of this method does *not* operate in place - it
+      always produces a new object, even if no changes were made.
+
+
+.. method:: bytes.title()
+            bytearray.title()
+
+   Return a titlecased version of the binary sequence where words start with
+   an uppercase ASCII character and the remaining characters are lowercase.
+   Uncased byte values are left unmodified.
+
+   For example::
+
+      >>> b'Hello world'.title()
+      b'Hello World'
+
+   Lowercase ASCII characters are those byte values in the sequence
+   ``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters
+   are those byte values in the sequence ``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``.
+   All other byte values are uncased.
+
+   The algorithm uses a simple language-independent definition of a word as
+   groups of consecutive letters.  The definition works in many contexts but
+   it means that apostrophes in contractions and possessives form word
+   boundaries, which may not be the desired result::
+
+        >>> b"they're bill's friends from the UK".title()
+        b"They'Re Bill'S Friends From The Uk"
+
+   A workaround for apostrophes can be constructed using regular expressions::
+
+        >>> import re
+        >>> def titlecase(s):
+        ...     return re.sub(rb"[A-Za-z]+('[A-Za-z]+)?",
+        ...                   lambda mo: mo.group(0)[0:1].upper() +
+        ...                              mo.group(0)[1:].lower(),
+        ...                   s)
+        ...
+        >>> titlecase(b"they're bill's friends.")
+        b"They're Bill's Friends."
+
+   .. note::
+
+      The bytearray version of this method does *not* operate in place - it
+      always produces a new object, even if no changes were made.
+
+
+.. method:: bytes.upper()
+            bytearray.upper()
+
+   Return a copy of the sequence with all the lowercase ASCII characters
+   converted to their corresponding uppercase counterpart.
+
+   For example::
+
+      >>> b'Hello World'.upper()
+      b'HELLO WORLD'
+
+   Lowercase ASCII characters are those byte values in the sequence
+   ``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters
+   are those byte values in the sequence ``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``.
+
+   .. note::
+
+      The bytearray version of this method does *not* operate in place - it
+      always produces a new object, even if no changes were made.
+
+
+.. method:: bytes.zfill(width)
+            bytearray.zfill(width)
+
+   Return a copy of the sequence left filled with ASCII ``b'0'`` digits to
+   make a sequence of length *width*. A leading sign prefix (``b'+'``/
+   ``b'-'`` is handled by inserting the padding *after* the sign character
+   rather than before. For :class:`bytes` objects, the original sequence is
+   returned if *width* is less than or equal to ``len(seq)``.
+
+   For example::
+
+      >>> b"42".zfill(5)
+      b'00042'
+      >>> b"-42".zfill(5)
+      b'-0042'
+
+   .. note::
+
+      The bytearray version of this method does *not* operate in place - it
+      always produces a new object, even if no changes were made.
 
 
 .. _typememoryview:
@@ -2462,6 +3153,10 @@
    .. versionchanged:: 3.3
       One-dimensional memoryviews with formats 'B', 'b' or 'c' are now hashable.
 
+   .. versionchanged:: 3.4
+      memoryview is now registered automatically with
+      :class:`collections.abc.Sequence`
+
    :class:`memoryview` has several methods:
 
    .. method:: __eq__(exporter)
@@ -3027,8 +3722,8 @@
    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
+   the positional argument must be an :term:`iterable` object.  Each item in
+   the iterable must itself be an iterable 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
@@ -3066,11 +3761,13 @@
       Return the item of *d* with key *key*.  Raises a :exc:`KeyError` if *key* is
       not in the map.
 
-      If a subclass of dict defines a method :meth:`__missing__`, if the key *key*
+      .. index:: __missing__()
+
+      If a subclass of dict defines a method :meth:`__missing__` and *key*
       is not present, the ``d[key]`` operation calls that method with the key *key*
       as argument.  The ``d[key]`` operation then returns or raises whatever is
-      returned or raised by the ``__missing__(key)`` call if the key is not
-      present. No other operations or methods invoke :meth:`__missing__`. If
+      returned or raised by the ``__missing__(key)`` call.
+      No other operations or methods invoke :meth:`__missing__`. If
       :meth:`__missing__` is not defined, :exc:`KeyError` is raised.
       :meth:`__missing__` must be a method; it cannot be an instance variable::
 
@@ -3084,8 +3781,9 @@
           >>> c['red']
           1
 
-      See :class:`collections.Counter` for a complete implementation including
-      other methods helpful for accumulating and managing tallies.
+      The example above shows part of the implementation of
+      :class:`collections.Counter`.  A different ``__missing__`` method is used
+      by :class:`collections.defaultdict`.
 
    .. describe:: d[key] = value
 
@@ -3310,8 +4008,8 @@
    The exception passed in should never be reraised explicitly - instead, this
    method should return a false value to indicate that the method completed
    successfully and does not want to suppress the raised exception. This allows
-   context management code (such as ``contextlib.nested``) to easily detect whether
-   or not an :meth:`__exit__` method has actually failed.
+   context management code to easily detect whether or not an :meth:`__exit__`
+   method has actually failed.
 
 Python defines several context managers to support easy thread synchronisation,
 prompt closure of files or other objects, and simpler manipulation of the active
diff --git a/Doc/library/string.rst b/Doc/library/string.rst
index e5bab68..f9da5fa 100644
--- a/Doc/library/string.rst
+++ b/Doc/library/string.rst
@@ -478,10 +478,12 @@
    | ``'%'`` | Percentage. Multiplies the number by 100 and displays    |
    |         | in fixed (``'f'``) format, followed by a percent sign.   |
    +---------+----------------------------------------------------------+
-   | None    | Similar to ``'g'``, except with at least one digit past  |
-   |         | the decimal point and a default precision of 12. This is |
-   |         | intended to match :func:`str`, except you can add the    |
-   |         | other format modifiers.                                  |
+   | None    | Similar to ``'g'``, except that fixed-point notation,    |
+   |         | when used, has at least one digit past the decimal point.|
+   |         | The default precision is as high as needed to represent  |
+   |         | the particular value. The overall effect is to match the |
+   |         | output of :func:`str` as altered by the other format     |
+   |         | modifiers.                                               |
    +---------+----------------------------------------------------------+
 
 
diff --git a/Doc/library/struct.rst b/Doc/library/struct.rst
index dde32b9..12d4fbc 100644
--- a/Doc/library/struct.rst
+++ b/Doc/library/struct.rst
@@ -24,6 +24,14 @@
    or omit implicit pad bytes, use ``standard`` size and alignment instead of
    ``native`` size and alignment: see :ref:`struct-alignment` for details.
 
+Several :mod:`struct` functions (and methods of :class:`Struct`) take a *buffer*
+argument.  This refers to objects that implement the :ref:`bufferobjects` and
+provide either a readable or read-writable buffer.  The most common types used
+for that purpose are :class:`bytes` and :class:`bytearray`, but many other types
+that can be viewed as an array of bytes implement the buffer protocol, so that
+they can be read/filled without additional copying from a :class:`bytes` object.
+
+
 Functions and Exceptions
 ------------------------
 
@@ -47,7 +55,7 @@
 
    Pack the values *v1*, *v2*, ... according to the format string *fmt* and
    write the packed bytes into the writable buffer *buffer* starting at
-   position *offset*. Note that *offset* is a required argument.
+   position *offset*.  Note that *offset* is a required argument.
 
 
 .. function:: unpack(fmt, buffer)
@@ -66,6 +74,19 @@
    format (``len(buffer[offset:])`` must be at least ``calcsize(fmt)``).
 
 
+.. function:: iter_unpack(fmt, buffer)
+
+   Iteratively unpack from the buffer *buffer* according to the format
+   string *fmt*.  This function returns an iterator which will read
+   equally-sized chunks from the buffer until all its contents have been
+   consumed.  The buffer's size in bytes must be a multiple of the amount
+   of data required by the format, as reflected by :func:`calcsize`.
+
+   Each iteration yields a tuple as specified by the format string.
+
+   .. versionadded:: 3.4
+
+
 .. function:: calcsize(fmt)
 
    Return the size of the struct (and hence of the bytes object produced by
@@ -388,6 +409,13 @@
       (``len(buffer[offset:])`` must be at least :attr:`self.size`).
 
 
+   .. method:: iter_unpack(buffer)
+
+      Identical to the :func:`iter_unpack` function, using the compiled format.
+      (``len(buffer)`` must be a multiple of :attr:`self.size`).
+
+      .. versionadded:: 3.4
+
    .. attribute:: format
 
       The format string used to construct this Struct object.
diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst
index a9ee970..36cbf3c 100644
--- a/Doc/library/subprocess.rst
+++ b/Doc/library/subprocess.rst
@@ -54,18 +54,12 @@
       >>> subprocess.call("exit 1", shell=True)
       1
 
-   .. warning::
-
-      Invoking the system shell with ``shell=True`` can be a security hazard
-      if combined with untrusted input. See the warning under
-      :ref:`frequently-used-arguments` for details.
-
    .. note::
 
-      Do not use ``stdout=PIPE`` or ``stderr=PIPE`` with this function. As
-      the pipes are not being read in the current process, the child
-      process may block if it generates enough output to a pipe to fill up
-      the OS pipe buffer.
+      Do not use ``stdout=PIPE`` or ``stderr=PIPE`` with this
+      function.  The child process will block if it generates enough
+      output to a pipe to fill up the OS pipe buffer as the pipes are
+      not being read from.
 
    .. versionchanged:: 3.3
       *timeout* was added.
@@ -99,24 +93,18 @@
          ...
       subprocess.CalledProcessError: Command 'exit 1' returned non-zero exit status 1
 
-   .. warning::
-
-      Invoking the system shell with ``shell=True`` can be a security hazard
-      if combined with untrusted input. See the warning under
-      :ref:`frequently-used-arguments` for details.
-
    .. note::
 
-      Do not use ``stdout=PIPE`` or ``stderr=PIPE`` with this function. As
-      the pipes are not being read in the current process, the child
-      process may block if it generates enough output to a pipe to fill up
-      the OS pipe buffer.
+      Do not use ``stdout=PIPE`` or ``stderr=PIPE`` with this
+      function.  The child process will block if it generates enough
+      output to a pipe to fill up the OS pipe buffer as the pipes are
+      not being read from.
 
    .. versionchanged:: 3.3
       *timeout* was added.
 
 
-.. function:: check_output(args, *, stdin=None, stderr=None, shell=False, universal_newlines=False, timeout=None)
+.. function:: check_output(args, *, input=None, stdin=None, stderr=None, shell=False, universal_newlines=False, timeout=None)
 
    Run command with arguments and return its output.
 
@@ -129,15 +117,21 @@
    in :ref:`frequently-used-arguments` (hence the use of keyword-only notation
    in the abbreviated signature). The full function signature is largely the
    same as that of the :class:`Popen` constructor - this functions passes all
-   supplied arguments other than *timeout* directly through to that interface.
-   In addition, *stdout* is not permitted as an argument, as it is used
-   internally to collect the output from the subprocess.
+   supplied arguments other than *input* and *timeout* directly through to
+   that interface.  In addition, *stdout* is not permitted as an argument, as
+   it is used internally to collect the output from the subprocess.
 
    The *timeout* argument is passed to :meth:`Popen.wait`. If the timeout
    expires, the child process will be killed and then waited for again.  The
    :exc:`TimeoutExpired` exception will be re-raised after the child process
    has terminated.
 
+   The *input* argument is passed to :meth:`Popen.communicate` and thus to the
+   subprocess's stdin.  If used it must be a byte sequence, or a string if
+   ``universal_newlines=True``.  When used, the internal :class:`Popen` object
+   is automatically created with ``stdin=PIPE``, and the *stdin* argument may
+   not be used as well.
+
    Examples::
 
       >>> subprocess.check_output(["echo", "Hello World!"])
@@ -146,6 +140,10 @@
       >>> subprocess.check_output(["echo", "Hello World!"], universal_newlines=True)
       'Hello World!\n'
 
+      >>> subprocess.check_output(["sed", "-e", "s/foo/bar/"],
+      ...                         input=b"when in the course of fooman events\n")
+      b'when in the course of barman events\n'
+
       >>> subprocess.check_output("exit 1", shell=True)
       Traceback (most recent call last):
          ...
@@ -167,25 +165,20 @@
       ...     shell=True)
       'ls: non_existent_file: No such file or directory\n'
 
-   .. versionadded:: 3.1
-
-   ..
-
-   .. warning::
-
-      Invoking the system shell with ``shell=True`` can be a security hazard
-      if combined with untrusted input. See the warning under
-      :ref:`frequently-used-arguments` for details.
-
    .. note::
 
-      Do not use ``stderr=PIPE`` with this function. As the pipe is not being
-      read in the current process, the child process may block if it
-      generates enough output to the pipe to fill up the OS pipe buffer.
+      Do not use ``stdout=PIPE`` or ``stderr=PIPE`` with this
+      function.  The child process will block if it generates enough
+      output to a pipe to fill up the OS pipe buffer as the pipes are
+      not being read from.
+
+   .. versionadded:: 3.1
 
    .. versionchanged:: 3.3
       *timeout* was added.
 
+   .. versionchanged:: 3.4
+      *input* was added.
 
 .. data:: DEVNULL
 
@@ -200,7 +193,7 @@
 
    Special value that can be used as the *stdin*, *stdout* or *stderr* argument
    to :class:`Popen` and indicates that a pipe to the standard stream should be
-   opened.
+   opened.  Most useful with :meth:`Popen.communicate`.
 
 
 .. data:: STDOUT
@@ -326,28 +319,9 @@
       instead of ``locale.getpreferredencoding()``.  See the
       :class:`io.TextIOWrapper` class for more information on this change.
 
-   .. warning::
+   .. note::
 
-      Executing shell commands that incorporate unsanitized input from an
-      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::
-
-         >>> from subprocess import call
-         >>> filename = input("What file would you like to display?\n")
-         What file would you like to display?
-         non_existent; rm -rf / #
-         >>> call("cat " + filename, shell=True) # Uh-oh. This will end badly...
-
-      ``shell=False`` disables all shell based features, but does not suffer
-      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.
+      Read the `Security Considerations`_ section before using ``shell=True``.
 
 These options, along with all of the other options, are described in more
 detail in the :class:`Popen` constructor documentation.
@@ -368,7 +342,7 @@
                  startupinfo=None, creationflags=0, restore_signals=True, \
                  start_new_session=False, pass_fds=())
 
-   Execute a child program in a new process.  On Unix, the class uses
+   Execute a child program in a new process.  On POSIX, 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.
@@ -380,7 +354,7 @@
    arguments for additional differences from the default behavior.  Unless
    otherwise stated, it is recommended to pass *args* as a sequence.
 
-   On Unix, if *args* is a string, the string is interpreted as the name or
+   On POSIX, 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.
 
@@ -411,7 +385,7 @@
    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
+   On POSIX 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
@@ -428,18 +402,22 @@
    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::
+   .. note::
 
-      Passing ``shell=True`` can be a security hazard if combined with
-      untrusted input.  See the warning under :ref:`frequently-used-arguments`
-      for details.
+      Read the `Security Considerations`_ section before using ``shell=True``.
 
-   *bufsize* will be supplied as the corresponding argument to the :func:`open`
-   function when creating the stdin/stdout/stderr pipe file objects: :const:`0`
-   means unbuffered (read and write are one system call and can return short),
-   :const:`1` means line buffered, any other positive value means use a buffer
-   of approximately that size.  A negative bufsize (the default) means the
-   system default of io.DEFAULT_BUFFER_SIZE will be used.
+   *bufsize* will be supplied as the corresponding argument to the
+   :func:`open` function when creating the stdin/stdout/stderr pipe
+   file objects:
+
+   - :const:`0` means unbuffered (read and write are one
+     system call and can return short)
+   - :const:`1` means line buffered
+     (only usable if ``universal_newlines=True`` i.e., in a text mode)
+   - any other positive value means use a buffer of approximately that
+     size
+   - negative bufsize (the default) means the system default of
+     io.DEFAULT_BUFFER_SIZE will be used.
 
    .. versionchanged:: 3.3.1
       *bufsize* now defaults to -1 to enable buffering by default to match the
@@ -453,9 +431,9 @@
    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
+   actually executed.  On POSIX, the *args* name
    becomes the display name for the executable in utilities such as
-   :program:`ps`.  If ``shell=True``, on Unix the *executable* argument
+   :program:`ps`.  If ``shell=True``, on POSIX the *executable* argument
    specifies a replacement shell for the default :file:`/bin/sh`.
 
    *stdin*, *stdout* and *stderr* specify the executed program's standard input,
@@ -471,7 +449,7 @@
 
    If *preexec_fn* is set to a callable object, this object will be called in the
    child process just before the child is executed.
-   (Unix only)
+   (POSIX only)
 
    .. warning::
 
@@ -489,8 +467,8 @@
       common use of *preexec_fn* to call os.setsid() in the child.
 
    If *close_fds* is true, all file descriptors except :const:`0`, :const:`1` and
-   :const:`2` will be closed before the child process is executed. (Unix only).
-   The default varies by platform:  Always true on Unix.  On Windows it is
+   :const:`2` will be closed before the child process is executed. (POSIX only).
+   The default varies by platform:  Always true on POSIX.  On Windows it is
    true when *stdin*/*stdout*/*stderr* are :const:`None`, false otherwise.
    On Windows, if *close_fds* is true then no handles will be inherited by the
    child process.  Note that on Windows, you cannot set *close_fds* to true and
@@ -502,7 +480,7 @@
 
    *pass_fds* is an optional sequence of file descriptors to keep open
    between the parent and child.  Providing any *pass_fds* forces
-   *close_fds* to be :const:`True`.  (Unix only)
+   *close_fds* to be :const:`True`.  (POSIX only)
 
    .. versionadded:: 3.2
       The *pass_fds* parameter was added.
@@ -515,13 +493,13 @@
    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.
    Currently this includes the SIGPIPE, SIGXFZ and SIGXFSZ signals.
-   (Unix only)
+   (POSIX only)
 
    .. versionchanged:: 3.2
       *restore_signals* was added.
 
    If *start_new_session* is true the setsid() system call will be made in the
-   child process prior to the execution of the subprocess.  (Unix only)
+   child process prior to the execution of the subprocess.  (POSIX only)
 
    .. versionchanged:: 3.2
       *start_new_session* was added.
@@ -588,14 +566,21 @@
       The :exc:`SubprocessError` base class was added.
 
 
-Security
-^^^^^^^^
+Security Considerations
+-----------------------
 
-Unlike some other popen functions, this implementation will never call a
-system shell implicitly.  This means that all characters, including shell
-metacharacters, can safely be passed to child processes. Obviously, if the
-shell is invoked explicitly, then it is the application's responsibility to
-ensure that all whitespace and metacharacters are quoted appropriately.
+Unlike some other popen functions, this implementation will never
+implicitly call a system shell.  This means that all characters,
+including shell metacharacters, can safely be passed to child processes.
+If the shell is invoked explicitly, via ``shell=True``, it is the application's
+responsibility to ensure that all whitespace and metacharacters are
+quoted appropriately to avoid
+`shell injection <http://en.wikipedia.org/wiki/Shell_injection#Shell_injection>`_
+vulnerabilities.
+
+When using ``shell=True``, the :func:`shlex.quote` function can be
+used to properly escape whitespace and shell metacharacters in strings
+that are going to be used to construct shell commands.
 
 
 Popen Objects
@@ -619,16 +604,27 @@
    :exc:`TimeoutExpired` exception.  It is safe to catch this exception and
    retry the wait.
 
-   .. warning::
+   .. note::
 
-      This will deadlock when using ``stdout=PIPE`` and/or
-      ``stderr=PIPE`` and the child process generates enough output to
-      a pipe such that it blocks waiting for the OS pipe buffer to
-      accept more data.  Use :meth:`communicate` to avoid that.
+      This will deadlock when using ``stdout=PIPE`` or ``stderr=PIPE``
+      and the child process generates enough output to a pipe such that
+      it blocks waiting for the OS pipe buffer to accept more data.
+      Use :meth:`Popen.communicate` when using pipes to avoid that.
+
+   .. note::
+
+      The function is implemented using a busy loop (non-blocking call and
+      short sleeps). Use the :mod:`asyncio` module for an asynchronous wait:
+      see :class:`asyncio.create_subprocess_exec`.
 
    .. versionchanged:: 3.3
       *timeout* was added.
 
+   .. deprecated:: 3.4
+
+      Do not use the *endtime* parameter.  It is was unintentionally
+      exposed in 3.3 but was left undocumented as it was intended to be
+      private for internal use.  Use *timeout* instead.
 
 .. method:: Popen.communicate(input=None, timeout=None)
 
@@ -638,7 +634,7 @@
    ``None``, if no data should be sent to the child.  The type of *input*
    must be bytes or, if *universal_newlines* was ``True``, a string.
 
-   :meth:`communicate` returns a tuple ``(stdoutdata, stderrdata)``.
+   :meth:`communicate` returns a tuple ``(stdout_data, stderr_data)``.
 
    Note that if you want to send data to the process's stdin, you need to create
    the Popen object with ``stdin=PIPE``.  Similarly, to get anything other than
@@ -695,13 +691,6 @@
 
 The following attributes are also available:
 
-.. warning::
-
-   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.
-
 .. attribute:: Popen.args
 
    The *args* argument as it was passed to :class:`Popen` -- a
@@ -735,6 +724,13 @@
    ``True``, the stream is a text stream, otherwise it is a byte stream. If the
    *stderr* argument was not :data:`PIPE`, this attribute is ``None``.
 
+.. warning::
+
+   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.
+
 
 .. attribute:: Popen.pid
 
@@ -751,7 +747,7 @@
    hasn't terminated yet.
 
    A negative value ``-N`` indicates that the child was terminated by signal
-   ``N`` (Unix only).
+   ``N`` (POSIX only).
 
 
 Windows Popen Helpers
@@ -847,8 +843,6 @@
    The new process has a new console, instead of inheriting its parent's
    console (the default).
 
-   This flag is always set when :class:`Popen` is created with ``shell=True``.
-
 .. data:: CREATE_NEW_PROCESS_GROUP
 
    A :class:`Popen` ``creationflags`` parameter to specify that a new process
@@ -1025,7 +1019,7 @@
 
    (child_stdout, child_stdin) = popen2.popen2("somestring", bufsize, mode)
    ==>
-   p = Popen(["somestring"], shell=True, bufsize=bufsize,
+   p = Popen("somestring", shell=True, bufsize=bufsize,
              stdin=PIPE, stdout=PIPE, close_fds=True)
    (child_stdout, child_stdin) = (p.stdout, p.stdin)
 
@@ -1063,9 +1057,9 @@
 
    Return ``(status, output)`` of executing *cmd* in a shell.
 
-   Execute the string *cmd* in a shell with :class:`Popen` and return a 2-tuple
-   ``(status, output)`` via :func:`Popen.communicate`. Universal newlines mode
-   is used; see the notes on :ref:`frequently-used-arguments` for more details.
+   Execute the string *cmd* in a shell with :meth:`Popen.check_output` and
+   return a 2-tuple ``(status, output)``. Universal newlines mode is used;
+   see the notes on :ref:`frequently-used-arguments` for more details.
 
    A trailing newline is stripped from the output.
    The exit status for the command can be interpreted
@@ -1078,7 +1072,7 @@
       >>> subprocess.getstatusoutput('/bin/junk')
       (256, 'sh: /bin/junk: not found')
 
-   Availability: Unix & Windows
+   Availability: POSIX & Windows
 
    .. versionchanged:: 3.3.4
       Windows support added
@@ -1094,7 +1088,7 @@
       >>> subprocess.getoutput('ls /bin/ls')
       '/bin/ls'
 
-   Availability: Unix & Windows
+   Availability: POSIX & Windows
 
    .. versionchanged:: 3.3.4
       Windows support added
diff --git a/Doc/library/sunau.rst b/Doc/library/sunau.rst
index 4bdb99b..a94ae08 100644
--- a/Doc/library/sunau.rst
+++ b/Doc/library/sunau.rst
@@ -150,8 +150,9 @@
 
 .. method:: AU_read.getparams()
 
-   Returns a tuple ``(nchannels, sampwidth, framerate, nframes, comptype,
-   compname)``, equivalent to output of the :meth:`get\*` methods.
+   Returns a :func:`~collections.namedtuple` ``(nchannels, sampwidth,
+   framerate, nframes, comptype, compname)``, equivalent to output of the
+   :meth:`get\*` methods.
 
 
 .. method:: AU_read.readframes(n)
@@ -211,6 +212,9 @@
 
    Set the sample width (in bytes.)
 
+   .. versionchanged:: 3.4
+      Added support for 24-bit samples.
+
 
 .. method:: AU_write.setframerate(n)
 
@@ -246,11 +250,17 @@
 
    Write audio frames, without correcting *nframes*.
 
+   .. versionchanged:: 3.4
+      Any :term:`bytes-like object` is now accepted.
+
 
 .. method:: AU_write.writeframes(data)
 
    Write audio frames and make sure *nframes* is correct.
 
+   .. versionchanged:: 3.4
+      Any :term:`bytes-like object` is now accepted.
+
 
 .. method:: AU_write.close()
 
diff --git a/Doc/library/superseded.rst b/Doc/library/superseded.rst
new file mode 100644
index 0000000..50a5983
--- /dev/null
+++ b/Doc/library/superseded.rst
@@ -0,0 +1,14 @@
+.. _superseded:
+
+******************
+Superseded Modules
+******************
+
+The modules described in this chapter are deprecated and only kept for
+backwards compatibility. They have been superseded by other modules.
+
+
+.. toctree::
+
+   optparse.rst
+   imp.rst
diff --git a/Doc/library/symtable.rst b/Doc/library/symtable.rst
index 472a9d6..c04e22e 100644
--- a/Doc/library/symtable.rst
+++ b/Doc/library/symtable.rst
@@ -4,6 +4,10 @@
 .. module:: symtable
    :synopsis: Interface to the compiler's internal symbol tables.
 
+**Source code:** :source:`Lib/symtable.py`
+
+--------------
+
 .. moduleauthor:: Jeremy Hylton <jeremy@alum.mit.edu>
 .. sectionauthor:: Benjamin Peterson <benjamin@python.org>
 
diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst
index 36c608c..3024086 100644
--- a/Doc/library/sys.rst
+++ b/Doc/library/sys.rst
@@ -12,11 +12,12 @@
 
 .. data:: abiflags
 
-   On POSIX systems where Python is build with the standard ``configure``
+   On POSIX systems where Python was built with the standard ``configure``
    script, this contains the ABI flags as specified by :pep:`3149`.
 
    .. versionadded:: 3.2
 
+
 .. data:: argv
 
    The list of command line arguments passed to a Python script. ``argv[0]`` is the
@@ -382,6 +383,21 @@
    .. versionadded:: 3.1
 
 
+.. function:: getallocatedblocks()
+
+   Return the number of memory blocks currently allocated by the interpreter,
+   regardless of their size.  This function is mainly useful for tracking
+   and debugging memory leaks.  Because of the interpreter's internal
+   caches, the result can vary from call to call; you may have to call
+   :func:`_clear_type_cache()` and :func:`gc.collect()` to get more
+   predictable results.
+
+   If a Python build or implementation cannot reasonably compute this
+   information, :func:`getallocatedblocks()` is allowed to return 0 instead.
+
+   .. versionadded:: 3.4
+
+
 .. function:: getcheckinterval()
 
    Return the interpreter's "check interval"; see :func:`setcheckinterval`.
@@ -398,9 +414,10 @@
 
 .. function:: getdlopenflags()
 
-   Return the current value of the flags that are used for :c:func:`dlopen` calls.
-   The flag constants are defined in the :mod:`ctypes` and :mod:`DLFCN` modules.
-   Availability: Unix.
+   Return the current value of the flags that are used for
+   :c:func:`dlopen` calls.  Symbolic names for the flag values can be
+   found in the :mod:`os` module (``RTLD_xxx`` constants, e.g.
+   :data:`os.RTLD_LAZY`).  Availability: Unix.
 
 
 .. function:: getfilesystemencoding()
@@ -579,9 +596,20 @@
    | :const:`imag`       | multiplier used for the imaginary part of a      |
    |                     | complex number                                   |
    +---------------------+--------------------------------------------------+
+   | :const:`algorithm`  | name of the algorithm for hashing of str, bytes, |
+   |                     | and memoryview                                   |
+   +---------------------+--------------------------------------------------+
+   | :const:`hash_bits`  | internal output size of the hash algorithm       |
+   +---------------------+--------------------------------------------------+
+   | :const:`seed_bits`  | size of the seed key of the hash algorithm       |
+   +---------------------+--------------------------------------------------+
+
 
    .. versionadded:: 3.2
 
+   .. versionchanged:: 3.4
+      Added *algorithm*, *hash_bits* and *seed_bits*
+
 
 .. data:: hexversion
 
@@ -639,7 +667,7 @@
    an underscore, and are not described here.  Regardless of its contents,
    :data:`sys.implementation` will not change during a run of the interpreter,
    nor between implementation versions.  (It may change between Python
-   language versions, however.)  See `PEP 421` for more information.
+   language versions, however.)  See :pep:`421` for more information.
 
    .. versionadded:: 3.3
 
@@ -665,6 +693,17 @@
    .. versionadded:: 3.1
 
 
+.. data:: __interactivehook__
+
+   When this attribute exists, its value is automatically called (with no
+   arguments) when the interpreter is launched in :ref:`interactive mode
+   <tut-interactive>`.  This is done after the :envvar:`PYTHONSTARTUP` file is
+   read, so that you can set this hook there.  The :mod:`site` module
+   :ref:`sets this <rlcompleter-config>`.
+
+   .. versionadded:: 3.4
+
+
 .. function:: intern(string)
 
    Enter *string* in the table of "interned" strings and return the interned string
@@ -812,8 +851,6 @@
    Windows          ``'win32'``
    Windows/Cygwin   ``'cygwin'``
    Mac OS X         ``'darwin'``
-   OS/2             ``'os2'``
-   OS/2 EMX         ``'os2emx'``
    ================ ===========================
 
    .. versionchanged:: 3.3
@@ -884,7 +921,7 @@
    the interpreter loads extension modules.  Among other things, this will enable a
    lazy resolving of symbols when importing a module, if called as
    ``sys.setdlopenflags(0)``.  To share symbols across extension modules, call as
-   ``sys.setdlopenflags(os.RTLD_GLOBAL)``.  Symbolic names for the flag modules
+   ``sys.setdlopenflags(os.RTLD_GLOBAL)``.  Symbolic names for the flag values
    can be found in the :mod:`os` module (``RTLD_xxx`` constants, e.g.
    :data:`os.RTLD_LAZY`).
 
@@ -1029,8 +1066,9 @@
      statements and for the prompts of :func:`input`;
    * The interpreter's own prompts and its error messages go to ``stderr``.
 
-   By default, these streams are regular text streams as returned by the
-   :func:`open` function.  Their parameters are chosen as follows:
+   These streams are regular :term:`text files <text file>` like those
+   returned by the :func:`open` function.  Their parameters are chosen as
+   follows:
 
    * The character encoding is platform-dependent.  Under Windows, if the stream
      is interactive (that is, if its :meth:`isatty` method returns ``True``), the
@@ -1038,26 +1076,22 @@
      platforms, the locale encoding is used (see :meth:`locale.getpreferredencoding`).
 
      Under all platforms though, you can override this value by setting the
-     :envvar:`PYTHONIOENCODING` environment variable.
+     :envvar:`PYTHONIOENCODING` environment variable before starting Python.
 
    * When interactive, standard streams are line-buffered.  Otherwise, they
      are block-buffered like regular text files.  You can override this
      value with the :option:`-u` command-line option.
 
-   To write or read binary data from/to the standard streams, use the
-   underlying binary :data:`~io.TextIOBase.buffer`.  For example, to write
-   bytes to :data:`stdout`, use ``sys.stdout.buffer.write(b'abc')``.  Using
-   :meth:`io.TextIOBase.detach`, streams can be made binary by default.  This
-   function sets :data:`stdin` and :data:`stdout` to binary::
+   .. note::
 
-      def make_streams_binary():
-          sys.stdin = sys.stdin.detach()
-          sys.stdout = sys.stdout.detach()
+      To write or read binary data from/to the standard streams, use the
+      underlying binary :data:`~io.TextIOBase.buffer` object.  For example, to
+      write bytes to :data:`stdout`, use ``sys.stdout.buffer.write(b'abc')``.
 
-   Note that the streams may be replaced with objects (like :class:`io.StringIO`)
-   that do not support the :attr:`~io.BufferedIOBase.buffer` attribute or the
-   :meth:`~io.BufferedIOBase.detach` method and can raise :exc:`AttributeError`
-   or :exc:`io.UnsupportedOperation`.
+      However, if you are writing a library (and do not control in which
+      context its code will be executed), be aware that the standard streams
+      may be replaced with file-like objects like :class:`io.StringIO` which
+      do not support the :attr:`~io.BufferedIOBase.buffer` attribute.
 
 
 .. data:: __stdin__
@@ -1094,7 +1128,6 @@
    | :const:`name`    | Name of the thread implementation:                      |
    |                  |                                                         |
    |                  |  * ``'nt'``: Windows threads                            |
-   |                  |  * ``'os2'``: OS/2 threads                              |
    |                  |  * ``'pthread'``: POSIX threads                         |
    |                  |  * ``'solaris'``: Solaris threads                       |
    +------------------+---------------------------------------------------------+
diff --git a/Doc/library/sysconfig.rst b/Doc/library/sysconfig.rst
index c47dcce..535ac54 100644
--- a/Doc/library/sysconfig.rst
+++ b/Doc/library/sysconfig.rst
@@ -83,8 +83,6 @@
   located under the user home directory.
 - *nt*: scheme for NT platforms like Windows.
 - *nt_user*: scheme for NT platforms, when the *user* option is used.
-- *os2*: scheme for OS/2 platforms.
-- *os2_home*: scheme for OS/2 patforms, when the *user* option is used.
 
 Each scheme is itself composed of a series of paths and each path has a unique
 identifier.  Python currently uses eight paths:
diff --git a/Doc/library/tarfile.rst b/Doc/library/tarfile.rst
index 1ead71c..4536eca 100644
--- a/Doc/library/tarfile.rst
+++ b/Doc/library/tarfile.rst
@@ -19,7 +19,8 @@
 
 Some facts and figures:
 
-* reads and writes :mod:`gzip`, :mod:`bz2` and :mod:`lzma` compressed archives.
+* reads and writes :mod:`gzip`, :mod:`bz2` and :mod:`lzma` compressed archives
+  if the respective modules are available.
 
 * read/write support for the POSIX.1-1988 (ustar) format.
 
@@ -81,6 +82,10 @@
    If *fileobj* is specified, it is used as an alternative to a :term:`file object`
    opened in binary mode for *name*. It is supposed to be at position 0.
 
+   For modes ``'w:gz'``, ``'r:gz'``, ``'w:bz2'``, ``'r:bz2'``, :func:`tarfile.open`
+   accepts the keyword argument *compresslevel* to specify the compression level of
+   the file.
+
    For special purposes, there is a second format for *mode*:
    ``'filemode|[compression]'``.  :func:`tarfile.open` will return a :class:`TarFile`
    object that processes its data as a stream of blocks.  No random seeking will
@@ -172,6 +177,13 @@
    Is raised by :meth:`TarInfo.frombuf` if the buffer it gets is invalid.
 
 
+The following constants are available at the module level:
+
+.. data:: ENCODING
+
+   The default character encoding: ``'utf-8'`` on Windows, the value returned by
+   :func:`sys.getfilesystemencoding` otherwise.
+
 
 Each of the following constants defines a tar archive format that the
 :mod:`tarfile` module is able to create. See section :ref:`tar-formats` for
@@ -198,20 +210,15 @@
    The default format for creating archives. This is currently :const:`GNU_FORMAT`.
 
 
-The following variables are available on module level:
-
-
-.. data:: ENCODING
-
-   The default character encoding: ``'utf-8'`` on Windows,
-   :func:`sys.getfilesystemencoding` otherwise.
-
-
 .. seealso::
 
    Module :mod:`zipfile`
       Documentation of the :mod:`zipfile` standard module.
 
+   :ref:`archiving-operations`
+      Documentation of the higher-level archiving facilities provided by the
+      standard :mod:`shutil` module.
+
    `GNU tar manual, Basic Tar Format <http://www.gnu.org/software/tar/manual/html_node/Standard.html>`_
       Documentation for tar archive files, including GNU tar extensions.
 
@@ -234,7 +241,7 @@
 :ref:`tar-examples` section for a use case.
 
 .. versionadded:: 3.2
-   Added support for the context manager protocol.
+   Added support for the context management protocol.
 
 .. class:: TarFile(name=None, mode='r', fileobj=None, format=DEFAULT_FORMAT, tarinfo=TarInfo, dereference=False, ignore_zeros=False, encoding=ENCODING, errors='surrogateescape', pax_headers=None, debug=0, errorlevel=0)
 
@@ -292,7 +299,7 @@
    will be added as a pax global header if *format* is :const:`PAX_FORMAT`.
 
 
-.. method:: TarFile.open(...)
+.. classmethod:: TarFile.open(...)
 
    Alternative constructor. The :func:`tarfile.open` function is actually a
    shortcut to this classmethod.
@@ -509,7 +516,7 @@
    :const:`AREGTYPE`, :const:`LNKTYPE`, :const:`SYMTYPE`, :const:`DIRTYPE`,
    :const:`FIFOTYPE`, :const:`CONTTYPE`, :const:`CHRTYPE`, :const:`BLKTYPE`,
    :const:`GNUTYPE_SPARSE`.  To determine the type of a :class:`TarInfo` object
-   more conveniently, use the ``is_*()`` methods below.
+   more conveniently, use the ``is*()`` methods below.
 
 
 .. attribute:: TarInfo.linkname
@@ -591,6 +598,67 @@
    Return :const:`True` if it is one of character device, block device or FIFO.
 
 
+.. _tarfile-commandline:
+
+Command Line Interface
+----------------------
+
+.. versionadded:: 3.4
+
+The :mod:`tarfile` module provides a simple command line interface to interact
+with tar archives.
+
+If you want to create a new tar archive, specify its name after the :option:`-c`
+option and then list the filename(s) that should be included::
+
+    $ python -m tarfile -c monty.tar  spam.txt eggs.txt
+
+Passing a directory is also acceptable::
+
+    $ python -m tarfile -c monty.tar life-of-brian_1979/
+
+If you want to extract a tar archive into the current directory, use
+the :option:`-e` option::
+
+    $ python -m tarfile -e monty.tar
+
+You can also extract a tar archive into a different directory by passing the
+directory's name::
+
+    $ python -m tarfile -e monty.tar  other-dir/
+
+For a list of the files in a tar archive, use the :option:`-l` option::
+
+    $ python -m tarfile -l monty.tar
+
+
+Command line options
+~~~~~~~~~~~~~~~~~~~~
+
+.. cmdoption:: -l <tarfile>
+               --list <tarfile>
+
+   List files in a tarfile.
+
+.. cmdoption:: -c <tarfile> <source1> <sourceN>
+               --create <tarfile> <source1> <sourceN>
+
+   Create tarfile from source files.
+
+.. cmdoption:: -e <tarfile> [<output_dir>]
+               --extract <tarfile> [<output_dir>]
+
+   Extract tarfile into the current directory if *output_dir* is not specified.
+
+.. cmdoption:: -t <tarfile>
+               --test <tarfile>
+
+   Test whether the tarfile is valid or not.
+
+.. cmdoption:: -v, --verbose
+
+   Verbose output
+
 .. _tar-examples:
 
 Examples
@@ -726,7 +794,7 @@
 appropriately, this conversion may fail.
 
 The *errors* argument defines how characters are treated that cannot be
-converted. Possible values are listed in section :ref:`codec-base-classes`.
+converted. Possible values are listed in section :ref:`error-handlers`.
 The default scheme is ``'surrogateescape'`` which Python also uses for its
 file system calls, see :ref:`os-filenames`.
 
diff --git a/Doc/library/tempfile.rst b/Doc/library/tempfile.rst
index d78159d..44d025d 100644
--- a/Doc/library/tempfile.rst
+++ b/Doc/library/tempfile.rst
@@ -192,7 +192,7 @@
          >>> os.path.exists(f.name)
          False
 
-The module uses two global variables that tell it how to construct a
+The module uses a global variable that tell it how to construct a
 temporary name.  They are initialized at the first call to any of the
 functions above.  The caller may change them, but this is discouraged; use
 the appropriate function arguments, instead.
diff --git a/Doc/library/test.rst b/Doc/library/test.rst
index c28536d..974909e 100644
--- a/Doc/library/test.rst
+++ b/Doc/library/test.rst
@@ -85,7 +85,7 @@
 
 This code pattern allows the testing suite to be run by :mod:`test.regrtest`,
 on its own as a script that supports the :mod:`unittest` CLI, or via the
-`python -m unittest` CLI.
+``python -m unittest`` CLI.
 
 The goal for regression testing is to try to break code. This leads to a few
 guidelines to be followed:
@@ -141,9 +141,9 @@
          arg = (1, 2, 3)
 
   When using this pattern, remember that all classes that inherit from
-  `unittest.TestCase` are run as tests.  The `Mixin` class in the example above
+  :class:`unittest.TestCase` are run as tests.  The :class:`Mixin` class in the example above
   does not have any data and so can't be run by itself, thus it does not
-  inherit from `unittest.TestCase`.
+  inherit from :class:`unittest.TestCase`.
 
 
 .. seealso::
@@ -443,13 +443,6 @@
    A decorator for running tests that require support for symbolic links.
 
 
-.. function:: suppress_crash_popup()
-
-   A context manager that disables Windows Error Reporting dialogs using
-   `SetErrorMode <http://msdn.microsoft.com/en-us/library/windows/desktop/ms680621%28v=vs.85%29.aspx>`_.
-   On other platforms it's a no-op.
-
-
 .. decorator:: anticipate_failure(condition)
 
    A decorator to conditionally mark tests with
@@ -468,7 +461,7 @@
 .. function:: make_bad_fd()
 
    Create an invalid file descriptor by opening and closing a temporary file,
-   and returning its descripor.
+   and returning its descriptor.
 
 
 .. function:: import_module(name, deprecated=False)
@@ -561,6 +554,21 @@
    run simultaneously, which is a problem for buildbots.
 
 
+.. function:: load_package_tests(pkg_dir, loader, standard_tests, pattern)
+
+   Generic implementation of the :mod:`unittest` ``load_tests`` protocol for
+   use in test packages.  *pkg_dir* is the root directory of the package;
+   *loader*, *standard_tests*, and *pattern* are the arguments expected by
+   ``load_tests``.  In simple cases, the test package's ``__init__.py``
+   can be the following::
+
+      import os
+      from test.support import load_package_tests
+
+      def load_tests(*args):
+          return load_package_tests(os.path.dirname(__file__), *args)
+
+
 The :mod:`test.support` module defines the following classes:
 
 .. class:: TransientResource(exc, **kwargs)
@@ -594,6 +602,21 @@
    Temporarily unset the environment variable ``envvar``.
 
 
+.. class:: SuppressCrashReport()
+
+   A context manager used to try to prevent crash dialog popups on tests that
+   are expected to crash a subprocess.
+
+   On Windows, it disables Windows Error Reporting dialogs using
+   `SetErrorMode <http://msdn.microsoft.com/en-us/library/windows/desktop/ms680621.aspx>`_.
+
+   On UNIX, :func:`resource.setrlimit` is used to set
+   :attr:`resource.RLIMIT_CORE`'s soft limit to 0 to prevent coredump file
+   creation.
+
+   On both platforms, the old value is restored by :meth:`__exit__`.
+
+
 .. class:: WarningsRecorder()
 
    Class used to record warnings for unit tests. See documentation of
diff --git a/Doc/library/textwrap.rst b/Doc/library/textwrap.rst
index c625254..9fe7a35 100644
--- a/Doc/library/textwrap.rst
+++ b/Doc/library/textwrap.rst
@@ -10,11 +10,11 @@
 
 --------------
 
-The :mod:`textwrap` module provides two convenience functions, :func:`wrap` and
-:func:`fill`, as well as :class:`TextWrapper`, the class that does all the work,
-and two utility functions, :func:`dedent` and :func:`indent`.  If you're just wrapping or filling one
-or two  text strings, the convenience functions should be good enough;
-otherwise,  you should use an instance of :class:`TextWrapper` for efficiency.
+The :mod:`textwrap` module provides some convenience functions,
+as well as :class:`TextWrapper`, the class that does all the work.
+If you're just wrapping or filling one or two text strings, the convenience
+functions should be good enough; otherwise, you should use an instance of
+:class:`TextWrapper` for efficiency.
 
 .. function:: wrap(text, width=70, **kwargs)
 
@@ -39,19 +39,31 @@
    In particular, :func:`fill` accepts exactly the same keyword arguments as
    :func:`wrap`.
 
-Both :func:`wrap` and :func:`fill` work by creating a :class:`TextWrapper`
-instance and calling a single method on it.  That instance is not reused, so for
-applications that wrap/fill many text strings, it will be more efficient for you
-to create your own :class:`TextWrapper` object.
 
-Text is preferably wrapped on whitespaces and right after the hyphens in
-hyphenated words; only then will long words be broken if necessary, unless
-:attr:`TextWrapper.break_long_words` is set to false.
+.. function:: shorten(text, width, **kwargs)
 
-Two additional utility function, :func:`dedent` and :func:`indent`, are
-provided to remove indentation from strings that have unwanted whitespace
-to the left of the text and to add an arbitrary prefix to selected lines
-in a block of text.
+   Collapse and truncate the given *text* to fit in the given *width*.
+
+   First the whitespace in *text* is collapsed (all whitespace is replaced by
+   single spaces).  If the result fits in the *width*, it is returned.
+   Otherwise, enough words are dropped from the end so that the remaining words
+   plus the :attr:`placeholder` fit within :attr:`width`::
+
+      >>> textwrap.shorten("Hello  world!", width=12)
+      'Hello world!'
+      >>> textwrap.shorten("Hello  world!", width=11)
+      'Hello [...]'
+      >>> textwrap.shorten("Hello world", width=10, placeholder="...")
+      'Hello...'
+
+   Optional keyword arguments correspond to the instance attributes of
+   :class:`TextWrapper`, documented below.  Note that the whitespace is
+   collapsed before the text is passed to the :class:`TextWrapper` :meth:`fill`
+   function, so changing the value of :attr:`.tabsize`, :attr:`.expand_tabs`,
+   :attr:`.drop_whitespace`, and :attr:`.replace_whitespace` will have no effect.
+
+   .. versionadded:: 3.4
+
 
 .. function:: dedent(text)
 
@@ -101,6 +113,18 @@
       +
       + world
 
+   .. versionadded:: 3.3
+
+
+:func:`wrap`, :func:`fill` and :func:`shorten` work by creating a
+:class:`TextWrapper` instance and calling a single method on it.  That
+instance is not reused, so for applications that process many text
+strings using :func:`wrap` and/or :func:`fill`, it may be more efficient to
+create your own :class:`TextWrapper` object.
+
+Text is preferably wrapped on whitespaces and right after the hyphens in
+hyphenated words; only then will long words be broken if necessary, unless
+:attr:`TextWrapper.break_long_words` is set to false.
 
 .. class:: TextWrapper(**kwargs)
 
@@ -235,7 +259,23 @@
       was to always allow breaking hyphenated words.
 
 
-   :class:`TextWrapper` also provides two public methods, analogous to the
+   .. attribute:: max_lines
+
+      (default: ``None``) If not ``None``, then the output will contain at most
+      *max_lines* lines, with *placeholder* appearing at the end of the output.
+
+      .. versionadded:: 3.4
+
+
+   .. attribute:: placeholder
+
+      (default: ``' [...]'``) String that will appear at the end of the output
+      text if it has been truncated.
+
+      .. versionadded:: 3.4
+
+
+   :class:`TextWrapper` also provides some public methods, analogous to the
    module-level convenience functions:
 
    .. method:: wrap(text)
@@ -251,4 +291,3 @@
 
       Wraps the single paragraph in *text*, and returns a single string
       containing the wrapped paragraph.
-
diff --git a/Doc/library/threading.rst b/Doc/library/threading.rst
index 7c326d1..f59ffe5 100644
--- a/Doc/library/threading.rst
+++ b/Doc/library/threading.rst
@@ -57,6 +57,15 @@
    and threads that have not yet been started.
 
 
+.. function:: main_thread()
+
+   Return the main :class:`Thread` object.  In normal conditions, the
+   main thread is the thread from which the Python interpreter was
+   started.
+
+   .. versionadded:: 3.4
+
+
 .. function:: settrace(func)
 
    .. index:: single: trace function
@@ -345,7 +354,7 @@
 immediately. If an attempt is made to release an unlocked lock, a
 :exc:`RuntimeError` will be raised.
 
-Locks also support the :ref:`context manager protocol <with-locks>`.
+Locks also support the :ref:`context management protocol <with-locks>`.
 
 When more than one thread is blocked in :meth:`~Lock.acquire` waiting for the
 state to turn to unlocked, only one thread proceeds when a :meth:`~Lock.release`
@@ -424,7 +433,7 @@
 :meth:`~Lock.release` of the outermost pair) resets the lock to unlocked and
 allows another thread blocked in :meth:`~Lock.acquire` to proceed.
 
-Reentrant locks also support the :ref:`context manager protocol <with-locks>`.
+Reentrant locks also support the :ref:`context management protocol <with-locks>`.
 
 
 .. class:: RLock()
@@ -492,7 +501,7 @@
 several condition variables must share the same lock.  The lock is part of
 the condition object: you don't have to track it separately.
 
-A condition variable obeys the :ref:`context manager protocol <with-locks>`:
+A condition variable obeys the :ref:`context management protocol <with-locks>`:
 using the ``with`` statement acquires the associated lock for the duration of
 the enclosed block.  The :meth:`~Condition.acquire` and
 :meth:`~Condition.release` methods also call the corresponding methods of
@@ -668,7 +677,7 @@
 finds that it is zero, it blocks, waiting until some other thread calls
 :meth:`~Semaphore.release`.
 
-Semaphores also support the :ref:`context manager protocol <with-locks>`.
+Semaphores also support the :ref:`context management protocol <with-locks>`.
 
 
 .. class:: Semaphore(value=1)
diff --git a/Doc/library/time.rst b/Doc/library/time.rst
index 64b5e04..8d8b7d4 100644
--- a/Doc/library/time.rst
+++ b/Doc/library/time.rst
@@ -133,8 +133,7 @@
 
    On Unix, return the current processor time as a floating point number expressed
    in seconds.  The precision, and in fact the very definition of the meaning of
-   "processor time", depends on that of the C function of the same name, but in any
-   case, this is the function to use for benchmarking Python or timing algorithms.
+   "processor time", depends on that of the C function of the same name.
 
    On Windows, this function returns wall-clock seconds elapsed since the first
    call to this function, as a floating point number, based on the Win32 function
@@ -343,12 +342,13 @@
 
 .. function:: sleep(secs)
 
-   Suspend execution for the given number of seconds.  The argument may be a
-   floating point number to indicate a more precise sleep time. The actual
-   suspension time may be less than that requested because any caught signal will
-   terminate the :func:`sleep` following execution of that signal's catching
-   routine.  Also, the suspension time may be longer than requested by an arbitrary
-   amount because of the scheduling of other activity in the system.
+   Suspend execution of the calling thread for the given number of seconds.
+   The argument may be a floating point number to indicate a more precise sleep
+   time. The actual suspension time may be less than that requested because any
+   caught signal will terminate the :func:`sleep` following execution of that
+   signal's catching routine.  Also, the suspension time may be longer than
+   requested by an arbitrary amount because of the scheduling of other activity
+   in the system.
 
 
 .. function:: strftime(format[, t])
diff --git a/Doc/library/timeit.rst b/Doc/library/timeit.rst
index a487917..503a705 100644
--- a/Doc/library/timeit.rst
+++ b/Doc/library/timeit.rst
@@ -28,22 +28,23 @@
 
 .. 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
+   $ python3 -m timeit '"-".join(str(n) for n in range(100))'
+   10000 loops, best of 3: 30.2 usec per loop
+   $ python3 -m timeit '"-".join([str(n) for n in range(100)])'
+   10000 loops, best of 3: 27.5 usec per loop
+   $ python3 -m timeit '"-".join(map(str, range(100)))'
+   10000 loops, best of 3: 23.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
+   0.3018611848820001
    >>> timeit.timeit('"-".join([str(n) for n in range(100)])', number=10000)
-   0.7288308143615723
+   0.2727368790656328
    >>> timeit.timeit('"-".join(map(str, range(100)))', number=10000)
-   0.5858950614929199
+   0.23702679807320237
+
 
 Note however that :mod:`timeit` will automatically determine the number of
 repetitions only when the command-line interface is used.  In the
@@ -151,7 +152,7 @@
          t = Timer(...)       # outside the try/except
          try:
              t.timeit(...)    # or t.repeat(...)
-         except:
+         except Exception:
              t.print_exc()
 
       The advantage over the standard traceback is that source lines in the
diff --git a/Doc/library/tkinter.rst b/Doc/library/tkinter.rst
index eeb1f80..40e97bf 100644
--- a/Doc/library/tkinter.rst
+++ b/Doc/library/tkinter.rst
@@ -15,14 +15,14 @@
 
 .. seealso::
 
-   `Python Tkinter Resources <http://www.python.org/topics/tkinter/>`_
+   `Python Tkinter Resources <https://wiki.python.org/moin/TkInter>`_
       The Python Tkinter Topic Guide provides a great deal of information on using Tk
       from Python and links to other sources of information on Tk.
 
    `TKDocs <http://www.tkdocs.com/>`_
       Extensive tutorial plus friendlier widget pages for some of the widgets.
 
-   `Tkinter reference: a GUI for Python <http://infohost.nmt.edu/tcc/help/pubs/tkinter/>`_
+   `Tkinter reference: a GUI for Python <http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/index.html>`_
       On-line reference material.
 
    `Tkinter docs from effbot <http://effbot.org/tkinterbook/>`_
@@ -747,32 +747,6 @@
    displayed.  You can use these :mod:`tkinter` functions to access these special
    points in text widgets:
 
-.. function:: AtEnd()
-      refers to the last position in the text
-
-   .. deprecated:: 3.3
-
-.. function:: AtInsert()
-      refers to the point where the text cursor is
-
-   .. deprecated:: 3.3
-
-.. function:: AtSelFirst()
-      indicates the beginning point of the selected text
-
-   .. deprecated:: 3.3
-
-.. function:: AtSelLast()
-      denotes the last point of the selected text and finally
-
-   .. deprecated:: 3.3
-
-.. function:: At(x[, y])
-      refers to the character at pixel location *x*, *y* (with *y* not used in the
-      case of a text entry widget, which contains a single line of text).
-
-   .. deprecated:: 3.3
-
 Text widget indexes
    The index notation for Text widgets is very rich and is best described in the Tk
    man pages.
diff --git a/Doc/library/tokenize.rst b/Doc/library/tokenize.rst
index 37d9f41..bd6b121 100644
--- a/Doc/library/tokenize.rst
+++ b/Doc/library/tokenize.rst
@@ -131,6 +131,24 @@
 
    .. versionadded:: 3.2
 
+.. exception:: TokenError
+
+   Raised when either a docstring or expression that may be split over several
+   lines is not completed anywhere in the file, for example::
+
+      """Beginning of
+      docstring
+
+   or::
+
+      [1,
+       2,
+       3
+
+Note that unclosed single-quoted strings do not cause an error to be
+raised. They are tokenized as ``ERRORTOKEN``, followed by the tokenization of
+their contents.
+
 
 .. _tokenize-cli:
 
diff --git a/Doc/library/traceback.rst b/Doc/library/traceback.rst
index 32e5733..15fbedc 100644
--- a/Doc/library/traceback.rst
+++ b/Doc/library/traceback.rst
@@ -72,7 +72,7 @@
    Return a list of up to *limit* "pre-processed" stack trace entries extracted
    from the traceback object *traceback*.  It is useful for alternate formatting of
    stack traces.  If *limit* is omitted or ``None``, all entries are extracted.  A
-   "pre-processed" stack trace entry is a quadruple (*filename*, *line number*,
+   "pre-processed" stack trace entry is a 4-tuple (*filename*, *line number*,
    *function name*, *text*) representing the information that is usually printed
    for a stack trace.  The *text* is a string with leading and trailing whitespace
    stripped; if the source is not available it is ``None``.
@@ -129,6 +129,13 @@
 
    A shorthand for ``format_list(extract_stack(f, limit))``.
 
+.. function:: clear_frames(tb)
+
+   Clears the local variables of all the stack frames in a traceback *tb*
+   by calling the :meth:`clear` method of each frame object.
+
+   .. versionadded:: 3.4
+
 
 .. _traceback-example:
 
@@ -146,7 +153,7 @@
        source = input(">>> ")
        try:
            exec(source, envdir)
-       except:
+       except Exception:
            print("Exception in user code:")
            print("-"*60)
            traceback.print_exc(file=sys.stdout)
diff --git a/Doc/library/tracemalloc.rst b/Doc/library/tracemalloc.rst
new file mode 100644
index 0000000..552e84b
--- /dev/null
+++ b/Doc/library/tracemalloc.rst
@@ -0,0 +1,634 @@
+:mod:`tracemalloc` --- Trace memory allocations
+===============================================
+
+.. module:: tracemalloc
+   :synopsis: Trace memory allocations.
+
+.. versionadded:: 3.4
+
+The tracemalloc module is a debug tool to trace memory blocks allocated by
+Python. It provides the following information:
+
+* Traceback where an object was allocated
+* Statistics on allocated memory blocks per filename and per line number:
+  total size, number and average size of allocated memory blocks
+* Compute the differences between two snapshots to detect memory leaks
+
+To trace most memory blocks allocated by Python, the module should be started
+as early as possible by setting the :envvar:`PYTHONTRACEMALLOC` environment
+variable to ``1``, or by using :option:`-X` ``tracemalloc`` command line
+option. The :func:`tracemalloc.start` function can be called at runtime to
+start tracing Python memory allocations.
+
+By default, a trace of an allocated memory block only stores the most recent
+frame (1 frame). To store 25 frames at startup: set the
+:envvar:`PYTHONTRACEMALLOC` environment variable to ``25``, or use the
+:option:`-X` ``tracemalloc=25`` command line option.
+
+
+Examples
+--------
+
+Display the top 10
+^^^^^^^^^^^^^^^^^^
+
+Display the 10 files allocating the most memory::
+
+    import tracemalloc
+
+    tracemalloc.start()
+
+    # ... run your application ...
+
+    snapshot = tracemalloc.take_snapshot()
+    top_stats = snapshot.statistics('lineno')
+
+    print("[ Top 10 ]")
+    for stat in top_stats[:10]:
+        print(stat)
+
+
+Example of output of the Python test suite::
+
+    [ Top 10 ]
+    <frozen importlib._bootstrap>:716: size=4855 KiB, count=39328, average=126 B
+    <frozen importlib._bootstrap>:284: size=521 KiB, count=3199, average=167 B
+    /usr/lib/python3.4/collections/__init__.py:368: size=244 KiB, count=2315, average=108 B
+    /usr/lib/python3.4/unittest/case.py:381: size=185 KiB, count=779, average=243 B
+    /usr/lib/python3.4/unittest/case.py:402: size=154 KiB, count=378, average=416 B
+    /usr/lib/python3.4/abc.py:133: size=88.7 KiB, count=347, average=262 B
+    <frozen importlib._bootstrap>:1446: size=70.4 KiB, count=911, average=79 B
+    <frozen importlib._bootstrap>:1454: size=52.0 KiB, count=25, average=2131 B
+    <string>:5: size=49.7 KiB, count=148, average=344 B
+    /usr/lib/python3.4/sysconfig.py:411: size=48.0 KiB, count=1, average=48.0 KiB
+
+We can see that Python loaded ``4.8 MiB`` data (bytecode and constants) from
+modules and that the :mod:`collections` module allocated ``244 KiB`` to build
+:class:`~collections.namedtuple` types.
+
+See :meth:`Snapshot.statistics` for more options.
+
+
+Compute differences
+^^^^^^^^^^^^^^^^^^^
+
+Take two snapshots and display the differences::
+
+    import tracemalloc
+    tracemalloc.start()
+    # ... start your application ...
+
+    snapshot1 = tracemalloc.take_snapshot()
+    # ... call the function leaking memory ...
+    snapshot2 = tracemalloc.take_snapshot()
+
+    top_stats = snapshot2.compare_to(snapshot1, 'lineno')
+
+    print("[ Top 10 differences ]")
+    for stat in top_stats[:10]:
+        print(stat)
+
+Example of output before/after running some tests of the Python test suite::
+
+    [ Top 10 differences ]
+    <frozen importlib._bootstrap>:716: size=8173 KiB (+4428 KiB), count=71332 (+39369), average=117 B
+    /usr/lib/python3.4/linecache.py:127: size=940 KiB (+940 KiB), count=8106 (+8106), average=119 B
+    /usr/lib/python3.4/unittest/case.py:571: size=298 KiB (+298 KiB), count=589 (+589), average=519 B
+    <frozen importlib._bootstrap>:284: size=1005 KiB (+166 KiB), count=7423 (+1526), average=139 B
+    /usr/lib/python3.4/mimetypes.py:217: size=112 KiB (+112 KiB), count=1334 (+1334), average=86 B
+    /usr/lib/python3.4/http/server.py:848: size=96.0 KiB (+96.0 KiB), count=1 (+1), average=96.0 KiB
+    /usr/lib/python3.4/inspect.py:1465: size=83.5 KiB (+83.5 KiB), count=109 (+109), average=784 B
+    /usr/lib/python3.4/unittest/mock.py:491: size=77.7 KiB (+77.7 KiB), count=143 (+143), average=557 B
+    /usr/lib/python3.4/urllib/parse.py:476: size=71.8 KiB (+71.8 KiB), count=969 (+969), average=76 B
+    /usr/lib/python3.4/contextlib.py:38: size=67.2 KiB (+67.2 KiB), count=126 (+126), average=546 B
+
+We can see that Python has loaded ``8.2 MiB`` of module data (bytecode and
+constants), and that this is ``4.4 MiB`` more than had been loaded before the
+tests, when the previous snapshot was taken. Similarly, the :mod:`linecache`
+module has cached ``940 KiB`` of Python source code to format tracebacks, all
+of it since the previous snapshot.
+
+If the system has little free memory, snapshots can be written on disk using
+the :meth:`Snapshot.dump` method to analyze the snapshot offline. Then use the
+:meth:`Snapshot.load` method reload the snapshot.
+
+
+Get the traceback of a memory block
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Code to display the traceback of the biggest memory block::
+
+    import tracemalloc
+
+    # Store 25 frames
+    tracemalloc.start(25)
+
+    # ... run your application ...
+
+    snapshot = tracemalloc.take_snapshot()
+    top_stats = snapshot.statistics('traceback')
+
+    # pick the biggest memory block
+    stat = top_stats[0]
+    print("%s memory blocks: %.1f KiB" % (stat.count, stat.size / 1024))
+    for line in stat.traceback.format():
+        print(line)
+
+Example of output of the Python test suite (traceback limited to 25 frames)::
+
+    903 memory blocks: 870.1 KiB
+      File "<frozen importlib._bootstrap>", line 716
+      File "<frozen importlib._bootstrap>", line 1036
+      File "<frozen importlib._bootstrap>", line 934
+      File "<frozen importlib._bootstrap>", line 1068
+      File "<frozen importlib._bootstrap>", line 619
+      File "<frozen importlib._bootstrap>", line 1581
+      File "<frozen importlib._bootstrap>", line 1614
+      File "/usr/lib/python3.4/doctest.py", line 101
+        import pdb
+      File "<frozen importlib._bootstrap>", line 284
+      File "<frozen importlib._bootstrap>", line 938
+      File "<frozen importlib._bootstrap>", line 1068
+      File "<frozen importlib._bootstrap>", line 619
+      File "<frozen importlib._bootstrap>", line 1581
+      File "<frozen importlib._bootstrap>", line 1614
+      File "/usr/lib/python3.4/test/support/__init__.py", line 1728
+        import doctest
+      File "/usr/lib/python3.4/test/test_pickletools.py", line 21
+        support.run_doctest(pickletools)
+      File "/usr/lib/python3.4/test/regrtest.py", line 1276
+        test_runner()
+      File "/usr/lib/python3.4/test/regrtest.py", line 976
+        display_failure=not verbose)
+      File "/usr/lib/python3.4/test/regrtest.py", line 761
+        match_tests=ns.match_tests)
+      File "/usr/lib/python3.4/test/regrtest.py", line 1563
+        main()
+      File "/usr/lib/python3.4/test/__main__.py", line 3
+        regrtest.main_in_temp_cwd()
+      File "/usr/lib/python3.4/runpy.py", line 73
+        exec(code, run_globals)
+      File "/usr/lib/python3.4/runpy.py", line 160
+        "__main__", fname, loader, pkg_name)
+
+We can see that the most memory was allocated in the :mod:`importlib` module to
+load data (bytecode and constants) from modules: ``870 KiB``. The traceback is
+where the :mod:`importlib` loaded data most recently: on the ``import pdb``
+line of the :mod:`doctest` module. The traceback may change if a new module is
+loaded.
+
+
+Pretty top
+^^^^^^^^^^
+
+Code to display the 10 lines allocating the most memory with a pretty output,
+ignoring ``<frozen importlib._bootstrap>`` and ``<unknown>`` files::
+
+    import linecache
+    import os
+    import tracemalloc
+
+    def display_top(snapshot, group_by='lineno', limit=10):
+        snapshot = snapshot.filter_traces((
+            tracemalloc.Filter(False, "<frozen importlib._bootstrap>"),
+            tracemalloc.Filter(False, "<unknown>"),
+        ))
+        top_stats = snapshot.statistics(group_by)
+
+        print("Top %s lines" % limit)
+        for index, stat in enumerate(top_stats[:limit], 1):
+            frame = stat.traceback[0]
+            # replace "/path/to/module/file.py" with "module/file.py"
+            filename = os.sep.join(frame.filename.split(os.sep)[-2:])
+            print("#%s: %s:%s: %.1f KiB"
+                  % (index, filename, frame.lineno, stat.size / 1024))
+            line = linecache.getline(frame.filename, frame.lineno).strip()
+            if line:
+                print('    %s' % line)
+
+        other = top_stats[limit:]
+        if other:
+            size = sum(stat.size for stat in other)
+            print("%s other: %.1f KiB" % (len(other), size / 1024))
+        total = sum(stat.size for stat in top_stats)
+        print("Total allocated size: %.1f KiB" % (total / 1024))
+
+    tracemalloc.start()
+
+    # ... run your application ...
+
+    snapshot = tracemalloc.take_snapshot()
+    display_top(snapshot)
+
+Example of output of the Python test suite::
+
+    Top 10 lines
+    #1: Lib/base64.py:414: 419.8 KiB
+        _b85chars2 = [(a + b) for a in _b85chars for b in _b85chars]
+    #2: Lib/base64.py:306: 419.8 KiB
+        _a85chars2 = [(a + b) for a in _a85chars for b in _a85chars]
+    #3: collections/__init__.py:368: 293.6 KiB
+        exec(class_definition, namespace)
+    #4: Lib/abc.py:133: 115.2 KiB
+        cls = super().__new__(mcls, name, bases, namespace)
+    #5: unittest/case.py:574: 103.1 KiB
+        testMethod()
+    #6: Lib/linecache.py:127: 95.4 KiB
+        lines = fp.readlines()
+    #7: urllib/parse.py:476: 71.8 KiB
+        for a in _hexdig for b in _hexdig}
+    #8: <string>:5: 62.0 KiB
+    #9: Lib/_weakrefset.py:37: 60.0 KiB
+        self.data = set()
+    #10: Lib/base64.py:142: 59.8 KiB
+        _b32tab2 = [a + b for a in _b32tab for b in _b32tab]
+    6220 other: 3602.8 KiB
+    Total allocated size: 5303.1 KiB
+
+See :meth:`Snapshot.statistics` for more options.
+
+
+API
+---
+
+Functions
+^^^^^^^^^
+
+.. function:: clear_traces()
+
+   Clear traces of memory blocks allocated by Python.
+
+   See also :func:`stop`.
+
+
+.. function:: get_object_traceback(obj)
+
+   Get the traceback where the Python object *obj* was allocated.
+   Return a :class:`Traceback` instance, or ``None`` if the :mod:`tracemalloc`
+   module is not tracing memory allocations or did not trace the allocation of
+   the object.
+
+   See also :func:`gc.get_referrers` and :func:`sys.getsizeof` functions.
+
+
+.. function:: get_traceback_limit()
+
+   Get the maximum number of frames stored in the traceback of a trace.
+
+   The :mod:`tracemalloc` module must be tracing memory allocations to
+   get the limit, otherwise an exception is raised.
+
+   The limit is set by the :func:`start` function.
+
+
+.. function:: get_traced_memory()
+
+   Get the current size and peak size of memory blocks traced by the
+   :mod:`tracemalloc` module as a tuple: ``(current: int, peak: int)``.
+
+
+.. function:: get_tracemalloc_memory()
+
+   Get the memory usage in bytes of the :mod:`tracemalloc` module used to store
+   traces of memory blocks.
+   Return an :class:`int`.
+
+
+.. function:: is_tracing()
+
+    ``True`` if the :mod:`tracemalloc` module is tracing Python memory
+    allocations, ``False`` otherwise.
+
+    See also :func:`start` and :func:`stop` functions.
+
+
+.. function:: start(nframe: int=1)
+
+   Start tracing Python memory allocations: install hooks on Python memory
+   allocators. Collected tracebacks of traces will be limited to *nframe*
+   frames. By default, a trace of a memory block only stores the most recent
+   frame: the limit is ``1``. *nframe* must be greater or equal to ``1``.
+
+   Storing more than ``1`` frame is only useful to compute statistics grouped
+   by ``'traceback'`` or to compute cumulative statistics: see the
+   :meth:`Snapshot.compare_to` and :meth:`Snapshot.statistics` methods.
+
+   Storing more frames increases the memory and CPU overhead of the
+   :mod:`tracemalloc` module. Use the :func:`get_tracemalloc_memory` function
+   to measure how much memory is used by the :mod:`tracemalloc` module.
+
+   The :envvar:`PYTHONTRACEMALLOC` environment variable
+   (``PYTHONTRACEMALLOC=NFRAME``) and the :option:`-X` ``tracemalloc=NFRAME``
+   command line option can be used to start tracing at startup.
+
+   See also :func:`stop`, :func:`is_tracing` and :func:`get_traceback_limit`
+   functions.
+
+
+.. function:: stop()
+
+   Stop tracing Python memory allocations: uninstall hooks on Python memory
+   allocators. Also clears all previously collected traces of memory blocks
+   allocated by Python.
+
+   Call :func:`take_snapshot` function to take a snapshot of traces before
+   clearing them.
+
+   See also :func:`start`, :func:`is_tracing` and :func:`clear_traces`
+   functions.
+
+
+.. function:: take_snapshot()
+
+   Take a snapshot of traces of memory blocks allocated by Python. Return a new
+   :class:`Snapshot` instance.
+
+   The snapshot does not include memory blocks allocated before the
+   :mod:`tracemalloc` module started to trace memory allocations.
+
+   Tracebacks of traces are limited to :func:`get_traceback_limit` frames. Use
+   the *nframe* parameter of the :func:`start` function to store more frames.
+
+   The :mod:`tracemalloc` module must be tracing memory allocations to take a
+   snapshot, see the the :func:`start` function.
+
+   See also the :func:`get_object_traceback` function.
+
+
+Filter
+^^^^^^
+
+.. class:: Filter(inclusive: bool, filename_pattern: str, lineno: int=None, all_frames: bool=False)
+
+   Filter on traces of memory blocks.
+
+   See the :func:`fnmatch.fnmatch` function for the syntax of
+   *filename_pattern*. The ``'.pyc'`` and ``'.pyo'`` file extensions are
+   replaced with ``'.py'``.
+
+   Examples:
+
+   * ``Filter(True, subprocess.__file__)`` only includes traces of the
+     :mod:`subprocess` module
+   * ``Filter(False, tracemalloc.__file__)`` excludes traces of the
+     :mod:`tracemalloc` module
+   * ``Filter(False, "<unknown>")`` excludes empty tracebacks
+
+   .. attribute:: inclusive
+
+      If *inclusive* is ``True`` (include), only trace memory blocks allocated
+      in a file with a name matching :attr:`filename_pattern` at line number
+      :attr:`lineno`.
+
+      If *inclusive* is ``False`` (exclude), ignore memory blocks allocated in
+      a file with a name matching :attr:`filename_pattern` at line number
+      :attr:`lineno`.
+
+   .. attribute:: lineno
+
+      Line number (``int``) of the filter. If *lineno* is ``None``, the filter
+      matches any line number.
+
+   .. attribute:: filename_pattern
+
+      Filename pattern of the filter (``str``).
+
+   .. attribute:: all_frames
+
+      If *all_frames* is ``True``, all frames of the traceback are checked. If
+      *all_frames* is ``False``, only the most recent frame is checked.
+
+      This attribute has no effect if the traceback limit is ``1``.  See the
+      :func:`get_traceback_limit` function and :attr:`Snapshot.traceback_limit`
+      attribute.
+
+
+Frame
+^^^^^
+
+.. class:: Frame
+
+   Frame of a traceback.
+
+   The :class:`Traceback` class is a sequence of :class:`Frame` instances.
+
+   .. attribute:: filename
+
+      Filename (``str``).
+
+   .. attribute:: lineno
+
+      Line number (``int``).
+
+
+Snapshot
+^^^^^^^^
+
+.. class:: Snapshot
+
+   Snapshot of traces of memory blocks allocated by Python.
+
+   The :func:`take_snapshot` function creates a snapshot instance.
+
+   .. method:: compare_to(old_snapshot: Snapshot, group_by: str, cumulative: bool=False)
+
+      Compute the differences with an old snapshot. Get statistics as a sorted
+      list of :class:`StatisticDiff` instances grouped by *group_by*.
+
+      See the :meth:`Snapshot.statistics` method for *group_by* and *cumulative*
+      parameters.
+
+      The result is sorted from the biggest to the smallest by: absolute value
+      of :attr:`StatisticDiff.size_diff`, :attr:`StatisticDiff.size`, absolute
+      value of :attr:`StatisticDiff.count_diff`, :attr:`Statistic.count` and
+      then by :attr:`StatisticDiff.traceback`.
+
+
+   .. method:: dump(filename)
+
+      Write the snapshot into a file.
+
+      Use :meth:`load` to reload the snapshot.
+
+
+   .. method:: filter_traces(filters)
+
+      Create a new :class:`Snapshot` instance with a filtered :attr:`traces`
+      sequence, *filters* is a list of :class:`Filter` instances.  If *filters*
+      is an empty list, return a new :class:`Snapshot` instance with a copy of
+      the traces.
+
+      All inclusive filters are applied at once, a trace is ignored if no
+      inclusive filters match it. A trace is ignored if at least one exclusive
+      filter matchs it.
+
+
+   .. classmethod:: load(filename)
+
+      Load a snapshot from a file.
+
+      See also :meth:`dump`.
+
+
+   .. method:: statistics(group_by: str, cumulative: bool=False)
+
+      Get statistics as a sorted list of :class:`Statistic` instances grouped
+      by *group_by*:
+
+      =====================  ========================
+      group_by               description
+      =====================  ========================
+      ``'filename'``         filename
+      ``'lineno'``           filename and line number
+      ``'traceback'``        traceback
+      =====================  ========================
+
+      If *cumulative* is ``True``, cumulate size and count of memory blocks of
+      all frames of the traceback of a trace, not only the most recent frame.
+      The cumulative mode can only be used with *group_by* equals to
+      ``'filename'`` and ``'lineno'``.
+
+      The result is sorted from the biggest to the smallest by:
+      :attr:`Statistic.size`, :attr:`Statistic.count` and then by
+      :attr:`Statistic.traceback`.
+
+
+   .. attribute:: traceback_limit
+
+      Maximum number of frames stored in the traceback of :attr:`traces`:
+      result of the :func:`get_traceback_limit` when the snapshot was taken.
+
+   .. attribute:: traces
+
+      Traces of all memory blocks allocated by Python: sequence of
+      :class:`Trace` instances.
+
+      The sequence has an undefined order. Use the :meth:`Snapshot.statistics`
+      method to get a sorted list of statistics.
+
+
+Statistic
+^^^^^^^^^
+
+.. class:: Statistic
+
+   Statistic on memory allocations.
+
+   :func:`Snapshot.statistics` returns a list of :class:`Statistic` instances.
+
+   See also the :class:`StatisticDiff` class.
+
+   .. attribute:: count
+
+      Number of memory blocks (``int``).
+
+   .. attribute:: size
+
+      Total size of memory blocks in bytes (``int``).
+
+   .. attribute:: traceback
+
+      Traceback where the memory block was allocated, :class:`Traceback`
+      instance.
+
+
+StatisticDiff
+^^^^^^^^^^^^^
+
+.. class:: StatisticDiff
+
+   Statistic difference on memory allocations between an old and a new
+   :class:`Snapshot` instance.
+
+   :func:`Snapshot.compare_to` returns a list of :class:`StatisticDiff`
+   instances. See also the :class:`Statistic` class.
+
+   .. attribute:: count
+
+      Number of memory blocks in the new snapshot (``int``): ``0`` if
+      the memory blocks have been released in the new snapshot.
+
+   .. attribute:: count_diff
+
+      Difference of number of memory blocks between the old and the new
+      snapshots (``int``): ``0`` if the memory blocks have been allocated in
+      the new snapshot.
+
+   .. attribute:: size
+
+      Total size of memory blocks in bytes in the new snapshot (``int``):
+      ``0`` if the memory blocks have been released in the new snapshot.
+
+   .. attribute:: size_diff
+
+      Difference of total size of memory blocks in bytes between the old and
+      the new snapshots (``int``): ``0`` if the memory blocks have been
+      allocated in the new snapshot.
+
+   .. attribute:: traceback
+
+      Traceback where the memory blocks were allocated, :class:`Traceback`
+      instance.
+
+
+Trace
+^^^^^
+
+.. class:: Trace
+
+   Trace of a memory block.
+
+   The :attr:`Snapshot.traces` attribute is a sequence of :class:`Trace`
+   instances.
+
+   .. attribute:: size
+
+      Size of the memory block in bytes (``int``).
+
+   .. attribute:: traceback
+
+      Traceback where the memory block was allocated, :class:`Traceback`
+      instance.
+
+
+Traceback
+^^^^^^^^^
+
+.. class:: Traceback
+
+   Sequence of :class:`Frame` instances sorted from the most recent frame to
+   the oldest frame.
+
+   A traceback contains at least ``1`` frame. If the ``tracemalloc`` module
+   failed to get a frame, the filename ``"<unknown>"`` at line number ``0`` is
+   used.
+
+   When a snapshot is taken, tracebacks of traces are limited to
+   :func:`get_traceback_limit` frames. See the :func:`take_snapshot` function.
+
+   The :attr:`Trace.traceback` attribute is an instance of :class:`Traceback`
+   instance.
+
+   .. method:: format(limit=None)
+
+      Format the traceback as a list of lines with newlines.  Use the
+      :mod:`linecache` module to retrieve lines from the source code.  If
+      *limit* is set, only format the *limit* most recent frames.
+
+      Similar to the :func:`traceback.format_tb` function, except that
+      :meth:`format` does not include newlines.
+
+      Example::
+
+          print("Traceback (most recent call first):")
+          for line in traceback:
+              print(line)
+
+      Output::
+
+          Traceback (most recent call first):
+            File "test.py", line 9
+              obj = Object()
+            File "test.py", line 12
+              tb = tracemalloc.get_object_traceback(f())
+
diff --git a/Doc/library/tulip_coro.dia b/Doc/library/tulip_coro.dia
new file mode 100644
index 0000000..eccf4fa
--- /dev/null
+++ b/Doc/library/tulip_coro.dia
Binary files differ
diff --git a/Doc/library/tulip_coro.png b/Doc/library/tulip_coro.png
new file mode 100644
index 0000000..65b6951
--- /dev/null
+++ b/Doc/library/tulip_coro.png
Binary files differ
diff --git a/Doc/library/turtle.rst b/Doc/library/turtle.rst
index b015530..5899f3d 100644
--- a/Doc/library/turtle.rst
+++ b/Doc/library/turtle.rst
@@ -1981,7 +1981,7 @@
    :param startx: if positive, starting position in pixels from the left
                   edge of the screen, if negative from the right edge, if None,
                   center window horizontally
-   :param startx: if positive, starting position in pixels from the top
+   :param starty: if positive, starting position in pixels from the top
                   edge of the screen, if negative from the bottom edge, if None,
                   center window vertically
 
@@ -2274,10 +2274,13 @@
 not from within the demo-viewer).
 
 
-Demo scripts
-============
+:mod:`turtledemo` --- Demo scripts
+==================================
 
-There is a set of demo scripts in the :mod:`turtledemo` package.  These
+.. module:: turtledemo
+   :synopsis: A viewer for example turtle scripts
+
+The :mod:`turtledemo` package includes a set of demo scripts.  These
 scripts can be run and viewed using the supplied demo viewer as follows::
 
    python -m turtledemo
@@ -2288,16 +2291,13 @@
 
 The :mod:`turtledemo` package directory contains:
 
-- a set of 15 demo scripts demonstrating different features of the new module
-  :mod:`turtle`;
-- a demo viewer :file:`__main__.py` which can be used to view the sourcecode
-  of the scripts and run them at the same time. 14 of the examples can be
-  accessed via the Examples menu; all of them can also be run standalone.
-- The example :mod:`turtledemo.two_canvases` demonstrates the simultaneous
-  use of two canvases with the turtle module.  Therefore it only can be run
-  standalone.
-- There is a :file:`turtle.cfg` file in this directory, which serves as an
-  example for how to write and use such files.
+- A demo viewer :file:`__main__.py` which can be used to view the sourcecode
+  of the scripts and run them at the same time.
+- Multiple scripts demonstrating different features of the :mod:`turtle`
+  module.  Examples can be accessed via the Examples menu.  They can also
+  be run standalone.
+- A :file:`turtle.cfg` file which serves as an example of how to write
+  and use such files.
 
 The demo scripts are:
 
@@ -2320,6 +2320,8 @@
 +----------------+------------------------------+-----------------------+
 | colormixer     | experiment with r, g, b      | :func:`ondrag`        |
 +----------------+------------------------------+-----------------------+
+| forest         | 3 breadth-first trees        | randomization         |
++----------------+------------------------------+-----------------------+
 | fractalcurves  | Hilbert & Koch curves        | recursion             |
 +----------------+------------------------------+-----------------------+
 | lindenmayer    | ethnomathematics             | L-System              |
@@ -2352,6 +2354,9 @@
 | tree           | a (graphical) breadth        | :func:`clone`         |
 |                | first tree (using generators)|                       |
 +----------------+------------------------------+-----------------------+
+| two_canvases   | simple design                | turtles on two        |
+|                |                              | canvases              |
++----------------+------------------------------+-----------------------+
 | wikipedia      | a pattern from the wikipedia | :func:`clone`,        |
 |                | article on turtle graphics   | :func:`undo`          |
 +----------------+------------------------------+-----------------------+
diff --git a/Doc/library/types.rst b/Doc/library/types.rst
index 695480f..abdb939 100644
--- a/Doc/library/types.rst
+++ b/Doc/library/types.rst
@@ -15,6 +15,9 @@
 Python interpreter, but not exposed as builtins like :class:`int` or
 :class:`str` are.
 
+Finally, it provides some additional type-related utility classes and functions
+that are not fundamental enough to be builtins.
+
 
 Dynamic Type Creation
 ---------------------
@@ -107,9 +110,35 @@
    C".)
 
 
-.. data:: ModuleType
+.. class:: ModuleType(name, doc=None)
 
-   The type of modules.
+   The type of :term:`modules <module>`. Constructor takes the name of the
+   module to be created and optionally its :term:`docstring`.
+
+   .. attribute:: __doc__
+
+      The :term:`docstring` of the module. Defaults to ``None``.
+
+   .. attribute:: __loader__
+
+      The :term:`loader` which loaded the module. Defaults to ``None``.
+
+      .. versionchanged:: 3.4
+         Defaults to ``None``. Previously the attribute was optional.
+
+   .. attribute:: __name__
+
+      The name of the module.
+
+   .. attribute:: __package__
+
+      Which :term:`package` a module belongs to. If the module is top-level
+      (i.e. not a part of any specific package) then the attribute should be set
+      to ``''``, else it should be set to the name of the package (which can be
+      :attr:`__name__` if the module is a package itself). Defaults to ``None``.
+
+      .. versionchanged:: 3.4
+         Defaults to ``None``. Previously the attribute was optional.
 
 
 .. data:: TracebackType
@@ -194,6 +223,9 @@
       Return a new view of the underlying mapping's values.
 
 
+Additional Utility Classes and Functions
+----------------------------------------
+
 .. class:: SimpleNamespace
 
    A simple :class:`object` subclass that provides attribute access to its
@@ -212,9 +244,26 @@
                keys = sorted(self.__dict__)
                items = ("{}={!r}".format(k, self.__dict__[k]) for k in keys)
                return "{}({})".format(type(self).__name__, ", ".join(items))
+           def __eq__(self, other):
+               return self.__dict__ == other.__dict__
 
    ``SimpleNamespace`` may be useful as a replacement for ``class NS: pass``.
    However, for a structured record type use :func:`~collections.namedtuple`
    instead.
 
    .. versionadded:: 3.3
+
+
+.. function:: DynamicClassAttribute(fget=None, fset=None, fdel=None, doc=None)
+
+   Route attribute access on a class to __getattr__.
+
+   This is a descriptor, used to define attributes that act differently when
+   accessed through an instance and through a class.  Instance access remains
+   normal, but access to an attribute through a class will be routed to the
+   class's __getattr__ method; this is done by raising AttributeError.
+
+   This allows one to have properties active on an instance, and have virtual
+   attributes on the class with the same name (see Enum for an example).
+
+   .. versionadded:: 3.4
diff --git a/Doc/library/undoc.rst b/Doc/library/undoc.rst
index 80386d2..20830e2 100644
--- a/Doc/library/undoc.rst
+++ b/Doc/library/undoc.rst
@@ -20,7 +20,7 @@
 documented beyond this mention.  There's little need to document these.
 
 :mod:`ntpath`
-   --- Implementation of :mod:`os.path` on Win32, Win64, WinCE, and OS/2 platforms.
+   --- Implementation of :mod:`os.path` on Win32, Win64, and WinCE platforms.
 
 :mod:`posixpath`
    --- Implementation of :mod:`os.path` on POSIX.
diff --git a/Doc/library/unicodedata.rst b/Doc/library/unicodedata.rst
index ad70dd9..3b3d3a0 100644
--- a/Doc/library/unicodedata.rst
+++ b/Doc/library/unicodedata.rst
@@ -15,8 +15,8 @@
 
 This module provides access to the Unicode Character Database (UCD) which
 defines character properties for all Unicode characters. The data contained in
-this database is compiled from the `UCD version 6.1.0
-<http://www.unicode.org/Public/6.1.0/ucd>`_.
+this database is compiled from the `UCD version 6.3.0
+<http://www.unicode.org/Public/6.3.0/ucd>`_.
 
 The module uses the same names and symbols as defined by Unicode
 Standard Annex #44, `"Unicode Character Database"
@@ -166,6 +166,6 @@
 
 .. rubric:: Footnotes
 
-.. [#] http://www.unicode.org/Public/6.1.0/ucd/NameAliases.txt
+.. [#] http://www.unicode.org/Public/6.3.0/ucd/NameAliases.txt
 
-.. [#] http://www.unicode.org/Public/6.1.0/ucd/NamedSequences.txt
+.. [#] http://www.unicode.org/Public/6.3.0/ucd/NamedSequences.txt
diff --git a/Doc/library/unittest.mock-examples.rst b/Doc/library/unittest.mock-examples.rst
index 554ef11..055abe0 100644
--- a/Doc/library/unittest.mock-examples.rst
+++ b/Doc/library/unittest.mock-examples.rst
@@ -28,22 +28,22 @@
     >>> real.method(3, 4, 5, key='value')
     <MagicMock name='method()' id='...'>
 
-Once our mock has been used (`real.method` in this example) it has methods
+Once our mock has been used (``real.method`` in this example) it has methods
 and attributes that allow you to make assertions about how it has been used.
 
 .. note::
 
     In most of these examples the :class:`Mock` and :class:`MagicMock` classes
-    are interchangeable. As the `MagicMock` is the more capable class it makes
+    are interchangeable. As the ``MagicMock`` is the more capable class it makes
     a sensible one to use by default.
 
 Once the mock has been called its :attr:`~Mock.called` attribute is set to
-`True`. More importantly we can use the :meth:`~Mock.assert_called_with` or
+``True``. More importantly we can use the :meth:`~Mock.assert_called_with` or
 :meth:`~Mock.assert_called_once_with` method to check that it was called with
 the correct arguments.
 
-This example tests that calling `ProductionClass().method` results in a call to
-the `something` method:
+This example tests that calling ``ProductionClass().method`` results in a call to
+the ``something`` method:
 
     >>> class ProductionClass:
     ...     def method(self):
@@ -66,15 +66,15 @@
 method (or some part of the system under test) and then check that it is used
 in the correct way.
 
-The simple `ProductionClass` below has a `closer` method. If it is called with
-an object then it calls `close` on it.
+The simple ``ProductionClass`` below has a ``closer`` method. If it is called with
+an object then it calls ``close`` on it.
 
     >>> class ProductionClass:
     ...     def closer(self, something):
     ...         something.close()
     ...
 
-So to test it we need to pass in an object with a `close` method and check
+So to test it we need to pass in an object with a ``close`` method and check
 that it was called correctly.
 
     >>> real = ProductionClass()
@@ -96,9 +96,9 @@
 are created by *calling the class*. This means you access the "mock instance"
 by looking at the return value of the mocked class.
 
-In the example below we have a function `some_function` that instantiates `Foo`
-and calls a method on it. The call to `patch` replaces the class `Foo` with a
-mock. The `Foo` instance is the result of calling the mock, so it is configured
+In the example below we have a function ``some_function`` that instantiates ``Foo``
+and calls a method on it. The call to :func:`patch` replaces the class ``Foo`` with a
+mock. The ``Foo`` instance is the result of calling the mock, so it is configured
 by modifying the mock :attr:`~Mock.return_value`.
 
     >>> def some_function():
@@ -141,13 +141,13 @@
     >>> mock.mock_calls
     [call.method(), call.attribute.method(10, x=53)]
 
-If you make an assertion about `mock_calls` and any unexpected methods
+If you make an assertion about ``mock_calls`` and any unexpected methods
 have been called, then the assertion will fail. This is useful because as well
 as asserting that the calls you expected have been made, you are also checking
 that they were made in the right order and with no additional calls:
 
 You use the :data:`call` object to construct lists for comparing with
-`mock_calls`:
+``mock_calls``:
 
     >>> expected = [call.method(), call.attribute.method(10, x=53)]
     >>> mock.mock_calls == expected
@@ -185,7 +185,7 @@
     3
 
 Sometimes you want to mock up a more complex situation, like for example
-`mock.connection.cursor().execute("SELECT 1")`. If we wanted this call to
+``mock.connection.cursor().execute("SELECT 1")``. If we wanted this call to
 return a list, then we have to configure the result of the nested call.
 
 We can use :data:`call` to construct the set of calls in a "chained call" like
@@ -202,7 +202,7 @@
     >>> mock.mock_calls == expected
     True
 
-It is the call to `.call_list()` that turns our call object into a list of
+It is the call to ``.call_list()`` that turns our call object into a list of
 calls representing the chained calls.
 
 
@@ -223,10 +223,10 @@
 Side effect functions and iterables
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-`side_effect` can also be set to a function or an iterable. The use case for
-`side_effect` as an iterable is where your mock is going to be called several
+``side_effect`` can also be set to a function or an iterable. The use case for
+``side_effect`` as an iterable is where your mock is going to be called several
 times, and you want each call to return a different value. When you set
-`side_effect` to an iterable every call to the mock returns the next value
+``side_effect`` to an iterable every call to the mock returns the next value
 from the iterable:
 
     >>> mock = MagicMock(side_effect=[4, 5, 6])
@@ -239,7 +239,7 @@
 
 
 For more advanced use cases, like dynamically varying the return values
-depending on what the mock is called with, `side_effect` can be a function.
+depending on what the mock is called with, ``side_effect`` can be a function.
 The function will be called with the same arguments as the mock. Whatever the
 function returns is what the call returns:
 
@@ -259,13 +259,13 @@
 
 One problem with over use of mocking is that it couples your tests to the
 implementation of your mocks rather than your real code. Suppose you have a
-class that implements `some_method`. In a test for another class, you
-provide a mock of this object that *also* provides `some_method`. If later
-you refactor the first class, so that it no longer has `some_method` - then
+class that implements ``some_method``. In a test for another class, you
+provide a mock of this object that *also* provides ``some_method``. If later
+you refactor the first class, so that it no longer has ``some_method`` - then
 your tests will continue to pass even though your code is now broken!
 
-`Mock` allows you to provide an object as a specification for the mock,
-using the `spec` keyword argument. Accessing methods / attributes on the
+:class:`Mock` allows you to provide an object as a specification for the mock,
+using the *spec* keyword argument. Accessing methods / attributes on the
 mock that don't exist on your specification object will immediately raise an
 attribute error. If you change the implementation of your specification, then
 tests that use that class will start failing immediately without you having to
@@ -277,9 +277,23 @@
        ...
     AttributeError: object has no attribute 'old_method'
 
+Using a specification also enables a smarter matching of calls made to the
+mock, regardless of whether some parameters were passed as positional or
+named arguments::
+
+   >>> def f(a, b, c): pass
+   ...
+   >>> mock = Mock(spec=f)
+   >>> mock(1, 2, 3)
+   <Mock name='mock()' id='140161580456576'>
+   >>> mock.assert_called_with(a=1, b=2, c=3)
+
+If you want this smarter matching to also work with method calls on the mock,
+you can use :ref:`auto-speccing <auto-speccing>`.
+
 If you want a stronger form of specification that prevents the setting
 of arbitrary attributes as well as the getting of them then you can use
-`spec_set` instead of `spec`.
+*spec_set* instead of *spec*.
 
 
 
@@ -288,8 +302,8 @@
 
 .. note::
 
-   With `patch` it matters that you patch objects in the namespace where they
-   are looked up. This is normally straightforward, but for a quick guide
+   With :func:`patch` it matters that you patch objects in the namespace where
+   they are looked up. This is normally straightforward, but for a quick guide
    read :ref:`where to patch <where-to-patch>`.
 
 
@@ -299,15 +313,15 @@
 them has to be undone after the test or the patch will persist into other
 tests and cause hard to diagnose problems.
 
-mock provides three convenient decorators for this: `patch`, `patch.object` and
-`patch.dict`. `patch` takes a single string, of the form
-`package.module.Class.attribute` to specify the attribute you are patching. It
+mock provides three convenient decorators for this: :func:`patch`, :func:`patch.object` and
+:func:`patch.dict`. ``patch`` takes a single string, of the form
+``package.module.Class.attribute`` to specify the attribute you are patching. It
 also optionally takes a value that you want the attribute (or class or
 whatever) to be replaced with. 'patch.object' takes an object and the name of
 the attribute you would like patched, plus optionally the value to patch it
 with.
 
-`patch.object`:
+``patch.object``:
 
     >>> original = SomeClass.attribute
     >>> @patch.object(SomeClass, 'attribute', sentinel.attribute)
@@ -324,8 +338,8 @@
     ...
     >>> test()
 
-If you are patching a module (including :mod:`builtins`) then use `patch`
-instead of `patch.object`:
+If you are patching a module (including :mod:`builtins`) then use :func:`patch`
+instead of :func:`patch.object`:
 
     >>> mock = MagicMock(return_value=sentinel.file_handle)
     >>> with patch('builtins.open', mock):
@@ -334,7 +348,7 @@
     >>> mock.assert_called_with('filename', 'r')
     >>> assert handle == sentinel.file_handle, "incorrect file handle returned"
 
-The module name can be 'dotted', in the form `package.module` if needed:
+The module name can be 'dotted', in the form ``package.module`` if needed:
 
     >>> @patch('package.module.ClassName.attribute', sentinel.attribute)
     ... def test():
@@ -354,8 +368,8 @@
     >>> MyTest('test_something').test_something()
     >>> assert SomeClass.attribute == original
 
-If you want to patch with a Mock, you can use `patch` with only one argument
-(or `patch.object` with two arguments). The mock will be created for you and
+If you want to patch with a Mock, you can use :func:`patch` with only one argument
+(or :func:`patch.object` with two arguments). The mock will be created for you and
 passed into the test function / method:
 
     >>> class MyTest(unittest2.TestCase):
@@ -380,7 +394,7 @@
 When you nest patch decorators the mocks are passed in to the decorated
 function in the same order they applied (the normal *python* order that
 decorators are applied). This means from the bottom up, so in the example
-above the mock for `test_module.ClassName2` is passed in first.
+above the mock for ``test_module.ClassName2`` is passed in first.
 
 There is also :func:`patch.dict` for setting values in a dictionary just
 during a scope and restoring the dictionary to its original state when the test
@@ -393,9 +407,9 @@
    ...
    >>> assert foo == original
 
-`patch`, `patch.object` and `patch.dict` can all be used as context managers.
+``patch``, ``patch.object`` and ``patch.dict`` can all be used as context managers.
 
-Where you use `patch` to create a mock for you, you can get a reference to the
+Where you use :func:`patch` to create a mock for you, you can get a reference to the
 mock using the "as" form of the with statement:
 
     >>> class ProductionClass:
@@ -410,7 +424,7 @@
     >>> mock_method.assert_called_with(1, 2, 3)
 
 
-As an alternative `patch`, `patch.object` and `patch.dict` can be used as
+As an alternative ``patch``, ``patch.object`` and ``patch.dict`` can be used as
 class decorators. When used in this way it is the same as applying the
 decorator individually to every method whose name starts with "test".
 
@@ -429,11 +443,11 @@
 
 Mocking chained calls is actually straightforward with mock once you
 understand the :attr:`~Mock.return_value` attribute. When a mock is called for
-the first time, or you fetch its `return_value` before it has been called, a
-new `Mock` is created.
+the first time, or you fetch its ``return_value`` before it has been called, a
+new :class:`Mock` is created.
 
 This means that you can see how the object returned from a call to a mocked
-object has been used by interrogating the `return_value` mock:
+object has been used by interrogating the ``return_value`` mock:
 
     >>> mock = Mock()
     >>> mock().foo(a=2, b=3)
@@ -453,22 +467,22 @@
     ...         response = self.backend.get_endpoint('foobar').create_call('spam', 'eggs').start_call()
     ...         # more code
 
-Assuming that `BackendProvider` is already well tested, how do we test
-`method()`? Specifically, we want to test that the code section `# more
-code` uses the response object in the correct way.
+Assuming that ``BackendProvider`` is already well tested, how do we test
+``method()``? Specifically, we want to test that the code section ``# more
+code`` uses the response object in the correct way.
 
 As this chain of calls is made from an instance attribute we can monkey patch
-the `backend` attribute on a `Something` instance. In this particular case
+the ``backend`` attribute on a ``Something`` instance. In this particular case
 we are only interested in the return value from the final call to
-`start_call` so we don't have much configuration to do. Let's assume the
+``start_call`` so we don't have much configuration to do. Let's assume the
 object it returns is 'file-like', so we'll ensure that our response object
-uses the builtin `open` as its `spec`.
+uses the builtin :func:`open` as its ``spec``.
 
 To do this we create a mock instance as our mock backend and create a mock
 response object for it. To set the response as the return value for that final
-`start_call` we could do this:
+``start_call`` we could do this::
 
-    `mock_backend.get_endpoint.return_value.create_call.return_value.start_call.return_value = mock_response`.
+    mock_backend.get_endpoint.return_value.create_call.return_value.start_call.return_value = mock_response
 
 We can do that in a slightly nicer way using the :meth:`~Mock.configure_mock`
 method to directly set the return value for us:
@@ -487,7 +501,7 @@
 
 Using :attr:`~Mock.mock_calls` we can check the chained call with a single
 assert. A chained call is several calls in one line of code, so there will be
-several entries in `mock_calls`. We can use :meth:`call.call_list` to create
+several entries in ``mock_calls``. We can use :meth:`call.call_list` to create
 this list of calls for us:
 
     >>> chained = call.get_endpoint('foobar').create_call('spam', 'eggs').start_call()
@@ -498,21 +512,20 @@
 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
-a known date, but I didn't want to prevent the code under test from
-creating new date objects. Unfortunately `datetime.date` is written in C, and
-so I couldn't just monkey-patch out the static `date.today` method.
+In some tests I wanted to mock out a call to :meth:`datetime.date.today`
+to return a known date, but I didn't want to prevent the code under test from
+creating new date objects. Unfortunately :class:`datetime.date` is written in C, and
+so I couldn't just monkey-patch out the static :meth:`date.today` method.
 
 I found a simple way of doing this that involved effectively wrapping the date
 class with a mock, but passing through calls to the constructor to the real
 class (and returning real instances).
 
 The :func:`patch decorator <patch>` is used here to
-mock out the `date` class in the module under test. The :attr:`side_effect`
+mock out the ``date`` class in the module under test. The :attr:`side_effect`
 attribute on the mock date class is then set to a lambda function that returns
 a real date. When the mock date class is called a real date will be
-constructed and returned by `side_effect`.
+constructed and returned by ``side_effect``.
 
     >>> from datetime import date
     >>> with patch('mymodule.date') as mock_date:
@@ -523,34 +536,32 @@
     ...     assert mymodule.date(2009, 6, 8) == date(2009, 6, 8)
     ...
 
-Note that we don't patch `datetime.date` globally, we patch `date` in the
+Note that we don't patch :class:`datetime.date` globally, we patch ``date`` in the
 module that *uses* it. See :ref:`where to patch <where-to-patch>`.
 
-When `date.today()` is called a known date is returned, but calls to the
-`date(...)` constructor still return normal dates. Without this you can find
+When ``date.today()`` is called a known date is returned, but calls to the
+``date(...)`` constructor still return normal dates. Without this you can find
 yourself having to calculate an expected result using exactly the same
 algorithm as the code under test, which is a classic testing anti-pattern.
 
-Calls to the date constructor are recorded in the `mock_date` attributes
-(`call_count` and friends) which may also be useful for your tests.
+Calls to the date constructor are recorded in the ``mock_date`` attributes
+(``call_count`` and friends) which may also be useful for your tests.
 
 An alternative way of dealing with mocking dates, or other builtin classes,
 is discussed in `this blog entry
-<http://williamjohnbert.com/2011/07/how-to-unit-testing-in-django-with-mocking-and-patching/>`_.
+<http://www.williamjohnbert.com/2011/07/how-to-unit-testing-in-django-with-mocking-and-patching/>`_.
 
 
 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
-return a series of values when iterated over [#]_.
+A Python generator is a function or method that uses the :keyword:`yield` statement
+to return a series of values when iterated over [#]_.
 
 A generator method / function is called to return the generator object. It is
 the generator object that is then iterated over. The protocol method for
-iteration is `__iter__
-<http://docs.python.org/library/stdtypes.html#container.__iter__>`_, so we can
-mock this using a `MagicMock`.
+iteration is :meth:`~container.__iter__`, so we can
+mock this using a :class:`MagicMock`.
 
 Here's an example class with an "iter" method implemented as a generator:
 
@@ -567,7 +578,7 @@
 How would we mock this class, and in particular its "iter" method?
 
 To configure the values returned from the iteration (implicit in the call to
-`list`), we need to configure the object returned by the call to `foo.iter()`.
+:class:`list`), we need to configure the object returned by the call to ``foo.iter()``.
 
     >>> mock_foo = MagicMock()
     >>> mock_foo.iter.return_value = iter([1, 2, 3])
@@ -586,10 +597,10 @@
 
 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
-repetition. For Python 2.6 or more recent you can use `patch` (in all its
+repetition. For Python 2.6 or more recent you can use :func:`patch` (in all its
 various forms) as a class decorator. This applies the patches to all test
 methods on the class. A test method is identified by methods whose names start
-with `test`:
+with ``test``:
 
     >>> @patch('mymodule.SomeClass')
     ... class MyTest(TestCase):
@@ -609,7 +620,7 @@
     'something'
 
 An alternative way of managing patches is to use the :ref:`start-and-stop`.
-These allow you to move the patching into your `setUp` and `tearDown` methods.
+These allow you to move the patching into your ``setUp`` and ``tearDown`` methods.
 
     >>> class MyTest(TestCase):
     ...     def setUp(self):
@@ -625,7 +636,7 @@
     >>> MyTest('test_foo').run()
 
 If you use this technique you must ensure that the patching is "undone" by
-calling `stop`. This can be fiddlier than you might think, because if an
+calling ``stop``. This can be fiddlier than you might think, because if an
 exception is raised in the setUp then tearDown is not called.
 :meth:`unittest.TestCase.addCleanup` makes this easier:
 
@@ -655,13 +666,13 @@
 patch out methods with a mock that having to create a real function becomes a
 nuisance.
 
-If you pass `autospec=True` to patch then it does the patching with a
+If you pass ``autospec=True`` to patch then it does the patching with a
 *real* function object. This function object has the same signature as the one
 it is replacing, but delegates to a mock under the hood. You still get your
 mock auto-created in exactly the same way as before. What it means though, is
 that if you use it to patch out an unbound method on a class the mocked
 function will be turned into a bound method if it is fetched from an instance.
-It will have `self` passed in as the first argument, which is exactly what I
+It will have ``self`` passed in as the first argument, which is exactly what I
 wanted:
 
     >>> class Foo:
@@ -676,8 +687,8 @@
     'foo'
     >>> mock_foo.assert_called_once_with(foo)
 
-If we don't use `autospec=True` then the unbound method is patched out
-with a Mock instance instead, and isn't called with `self`.
+If we don't use ``autospec=True`` then the unbound method is patched out
+with a Mock instance instead, and isn't called with ``self``.
 
 
 Checking multiple calls with mock
@@ -701,7 +712,7 @@
         ...
     AssertionError: Expected to be called once. Called 2 times.
 
-Both `assert_called_with` and `assert_called_once_with` make assertions about
+Both ``assert_called_with`` and ``assert_called_once_with`` make assertions about
 the *most recent* call. If your mock is going to be called several times, and
 you want to make assertions about *all* those calls you can use
 :attr:`~Mock.call_args_list`:
@@ -714,8 +725,8 @@
     [call(1, 2, 3), call(4, 5, 6), call()]
 
 The :data:`call` helper makes it easy to make assertions about these calls. You
-can build up a list of expected calls and compare it to `call_args_list`. This
-looks remarkably similar to the repr of the `call_args_list`:
+can build up a list of expected calls and compare it to ``call_args_list``. This
+looks remarkably similar to the repr of the ``call_args_list``:
 
     >>> expected = [call(1, 2, 3), call(4, 5, 6), call()]
     >>> mock.call_args_list == expected
@@ -726,7 +737,7 @@
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 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
+mutable arguments. ``call_args`` and ``call_args_list`` store *references* to the
 arguments. If the arguments are mutated by the code under test then you can no
 longer make assertions about what the values were when the mock was called.
 
@@ -741,28 +752,28 @@
         frob(val)
         val.clear()
 
-When we try to test that `grob` calls `frob` with the correct argument look
+When we try to test that ``grob`` calls ``frob`` with the correct argument look
 what happens:
 
     >>> with patch('mymodule.frob') as mock_frob:
-    ...     val = set([6])
+    ...     val = {6}
     ...     mymodule.grob(val)
     ...
     >>> val
-    set([])
-    >>> mock_frob.assert_called_with(set([6]))
+    set()
+    >>> mock_frob.assert_called_with({6})
     Traceback (most recent call last):
         ...
-    AssertionError: Expected: ((set([6]),), {})
-    Called with: ((set([]),), {})
+    AssertionError: Expected: (({6},), {})
+    Called with: ((set(),), {})
 
 One possibility would be for mock to copy the arguments you pass in. This
 could then cause problems if you do assertions that rely on object identity
 for equality.
 
 Here's one solution that uses the :attr:`side_effect`
-functionality. If you provide a `side_effect` function for a mock then
-`side_effect` will be called with the same args as the mock. This gives us an
+functionality. If you provide a ``side_effect`` function for a mock then
+``side_effect`` will be called with the same args as the mock. This gives us an
 opportunity to copy the arguments and store them for later assertions. In this
 example I'm using *another* mock to store the arguments so that I can use the
 mock methods for doing the assertion. Again a helper function sets this up for
@@ -782,35 +793,35 @@
     ...
     >>> with patch('mymodule.frob') as mock_frob:
     ...     new_mock = copy_call_args(mock_frob)
-    ...     val = set([6])
+    ...     val = {6}
     ...     mymodule.grob(val)
     ...
-    >>> new_mock.assert_called_with(set([6]))
+    >>> new_mock.assert_called_with({6})
     >>> new_mock.call_args
-    call(set([6]))
+    call({6})
 
-`copy_call_args` is called with the mock that will be called. It returns a new
-mock that we do the assertion on. The `side_effect` function makes a copy of
-the args and calls our `new_mock` with the copy.
+``copy_call_args`` is called with the mock that will be called. It returns a new
+mock that we do the assertion on. The ``side_effect`` function makes a copy of
+the args and calls our ``new_mock`` with the copy.
 
 .. note::
 
     If your mock is only going to be used once there is an easier way of
     checking arguments at the point they are called. You can simply do the
-    checking inside a `side_effect` function.
+    checking inside a ``side_effect`` function.
 
         >>> def side_effect(arg):
-        ...     assert arg == set([6])
+        ...     assert arg == {6}
         ...
         >>> mock = Mock(side_effect=side_effect)
-        >>> mock(set([6]))
+        >>> mock({6})
         >>> mock(set())
         Traceback (most recent call last):
             ...
         AssertionError
 
-An alternative approach is to create a subclass of `Mock` or `MagicMock` that
-copies (using :func:`copy.deepcopy`) the arguments.
+An alternative approach is to create a subclass of :class:`Mock` or
+:class:`MagicMock` that copies (using :func:`copy.deepcopy`) the arguments.
 Here's an example implementation:
 
     >>> from copy import deepcopy
@@ -828,14 +839,14 @@
     >>> c.assert_called_with(arg)
     Traceback (most recent call last):
         ...
-    AssertionError: Expected call: mock(set([1]))
-    Actual call: mock(set([]))
+    AssertionError: Expected call: mock({1})
+    Actual call: mock(set())
     >>> c.foo
     <CopyingMock name='mock.foo' id='...'>
 
-When you subclass `Mock` or `MagicMock` all dynamically created attributes,
-and the `return_value` will use your subclass automatically. That means all
-children of a `CopyingMock` will also have the type `CopyingMock`.
+When you subclass ``Mock`` or ``MagicMock`` all dynamically created attributes,
+and the ``return_value`` will use your subclass automatically. That means all
+children of a ``CopyingMock`` will also have the type ``CopyingMock``.
 
 
 Nesting Patches
@@ -859,9 +870,9 @@
     >>> MyTest('test_foo').test_foo()
     >>> assert mymodule.Foo is original
 
-With unittest `cleanup` functions and the :ref:`start-and-stop` we can
+With unittest ``cleanup`` functions and the :ref:`start-and-stop` we can
 achieve the same effect without the nested indentation. A simple helper
-method, `create_patch`, puts the patch in place and returns the created mock
+method, ``create_patch``, puts the patch in place and returns the created mock
 for us:
 
     >>> class MyTest(TestCase):
@@ -896,11 +907,11 @@
 and using :data:`~Mock.side_effect` to delegate dictionary access to a real
 underlying dictionary that is under our control.
 
-When the `__getitem__` and `__setitem__` methods of our `MagicMock` are called
-(normal dictionary access) then `side_effect` is called with the key (and in
-the case of `__setitem__` the value too). We can also control what is returned.
+When the :meth:`__getitem__` and :meth:`__setitem__` methods of our ``MagicMock`` are called
+(normal dictionary access) then ``side_effect`` is called with the key (and in
+the case of ``__setitem__`` the value too). We can also control what is returned.
 
-After the `MagicMock` has been used we can use attributes like
+After the ``MagicMock`` has been used we can use attributes like
 :data:`~Mock.call_args_list` to assert about how the dictionary was used:
 
     >>> my_dict = {'a': 1, 'b': 2, 'c': 3}
@@ -916,23 +927,23 @@
 
 .. note::
 
-    An alternative to using `MagicMock` is to use `Mock` and *only* provide
+    An alternative to using ``MagicMock`` is to use ``Mock`` and *only* provide
     the magic methods you specifically want:
 
         >>> mock = Mock()
-        >>> mock.__setitem__ = Mock(side_effect=getitem)
-        >>> mock.__getitem__ = Mock(side_effect=setitem)
+        >>> mock.__getitem__ = Mock(side_effect=getitem)
+        >>> mock.__setitem__ = Mock(side_effect=setitem)
 
-    A *third* option is to use `MagicMock` but passing in `dict` as the `spec`
-    (or `spec_set`) argument so that the `MagicMock` created only has
+    A *third* option is to use ``MagicMock`` but passing in ``dict`` as the *spec*
+    (or *spec_set*) argument so that the ``MagicMock`` created only has
     dictionary magic methods available:
 
         >>> mock = MagicMock(spec_set=dict)
         >>> mock.__getitem__.side_effect = getitem
         >>> mock.__setitem__.side_effect = setitem
 
-With these side effect functions in place, the `mock` will behave like a normal
-dictionary but recording the access. It even raises a `KeyError` if you try
+With these side effect functions in place, the ``mock`` will behave like a normal
+dictionary but recording the access. It even raises a :exc:`KeyError` if you try
 to access a key that doesn't exist.
 
     >>> mock['a']
@@ -964,8 +975,8 @@
 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:
+There are various reasons why you might want to subclass :class:`Mock`. One
+reason might be to add helper methods. Here's a silly example:
 
     >>> class MyMock(MagicMock):
     ...     def has_been_called(self):
@@ -980,9 +991,9 @@
     >>> mymock.has_been_called()
     True
 
-The standard behaviour for `Mock` instances is that attributes and the return
+The standard behaviour for ``Mock`` instances is that attributes and the return
 value mocks are of the same type as the mock they are accessed on. This ensures
-that `Mock` attributes are `Mocks` and `MagicMock` attributes are `MagicMocks`
+that ``Mock`` attributes are ``Mocks`` and ``MagicMock`` attributes are ``MagicMocks``
 [#]_. So if you're subclassing to add helper methods then they'll also be
 available on the attributes and return value mock of instances of your
 subclass.
@@ -1002,10 +1013,10 @@
 <http://twistedmatrix.com/documents/11.0.0/api/twisted.python.components.html>`_.
 Having this applied to attributes too actually causes errors.
 
-`Mock` (in all its flavours) uses a method called `_get_child_mock` to create
+``Mock`` (in all its flavours) uses a method called ``_get_child_mock`` to create
 these "sub-mocks" for attributes and return values. You can prevent your
 subclass being used for attributes by overriding this method. The signature is
-that it takes arbitrary keyword arguments (`**kwargs`) which are then passed
+that it takes arbitrary keyword arguments (``**kwargs``) which are then passed
 onto the mock constructor:
 
     >>> class Subclass(MagicMock):
@@ -1038,17 +1049,17 @@
 import (store the module as a class or module attribute and only do the import
 on first use).
 
-That aside there is a way to use `mock` to affect the results of an import.
-Importing fetches an *object* from the `sys.modules` dictionary. Note that it
+That aside there is a way to use ``mock`` to affect the results of an import.
+Importing fetches an *object* from the :data:`sys.modules` dictionary. Note that it
 fetches an *object*, which need not be a module. Importing a module for the
 first time results in a module object being put in `sys.modules`, so usually
 when you import something you get a module back. This need not be the case
 however.
 
 This means you can use :func:`patch.dict` to *temporarily* put a mock in place
-in `sys.modules`. Any imports whilst this patch is active will fetch the mock.
+in :data:`sys.modules`. Any imports whilst this patch is active will fetch the mock.
 When the patch is complete (the decorated function exits, the with statement
-body is complete or `patcher.stop()` is called) then whatever was there
+body is complete or ``patcher.stop()`` is called) then whatever was there
 previously will be restored safely.
 
 Here's an example that mocks out the 'fooble' module.
@@ -1062,10 +1073,10 @@
     >>> assert 'fooble' not in sys.modules
     >>> mock.blob.assert_called_once_with()
 
-As you can see the `import fooble` succeeds, but on exit there is no 'fooble'
-left in `sys.modules`.
+As you can see the ``import fooble`` succeeds, but on exit there is no 'fooble'
+left in :data:`sys.modules`.
 
-This also works for the `from module import name` form:
+This also works for the ``from module import name`` form:
 
     >>> mock = Mock()
     >>> with patch.dict('sys.modules', {'fooble': mock}):
@@ -1095,10 +1106,10 @@
 doesn't allow you to track the order of calls between separate mock objects,
 however we can use :attr:`~Mock.mock_calls` to achieve the same effect.
 
-Because mocks track calls to child mocks in `mock_calls`, and accessing an
+Because mocks track calls to child mocks in ``mock_calls``, and accessing an
 arbitrary attribute of a mock creates a child mock, we can create our separate
 mocks from a parent one. Calls to those child mock will then all be recorded,
-in order, in the `mock_calls` of the parent:
+in order, in the ``mock_calls`` of the parent:
 
     >>> manager = Mock()
     >>> mock_foo = manager.foo
@@ -1113,15 +1124,15 @@
     [call.foo.something(), call.bar.other.thing()]
 
 We can then assert about the calls, including the order, by comparing with
-the `mock_calls` attribute on the manager mock:
+the ``mock_calls`` attribute on the manager mock:
 
     >>> expected_calls = [call.foo.something(), call.bar.other.thing()]
     >>> manager.mock_calls == expected_calls
     True
 
-If `patch` is creating, and putting in place, your mocks then you can attach
+If ``patch`` is creating, and putting in place, your mocks then you can attach
 them to a manager mock using the :meth:`~Mock.attach_mock` method. After
-attaching calls will be recorded in `mock_calls` of the manager.
+attaching calls will be recorded in ``mock_calls`` of the manager.
 
     >>> manager = MagicMock()
     >>> with patch('mymodule.Class1') as MockClass1:
@@ -1153,12 +1164,12 @@
     >>> calls = call.one().two().three().call_list()
     >>> m.assert_has_calls(calls)
 
-Even though the chained call `m.one().two().three()` aren't the only calls that
+Even though the chained call ``m.one().two().three()`` aren't the only calls that
 have been made to the mock, the assert still succeeds.
 
 Sometimes a mock may have several calls made to it, and you are only interested
 in asserting about *some* of those calls. You may not even care about the
-order. In this case you can pass `any_order=True` to `assert_has_calls`:
+order. In this case you can pass ``any_order=True`` to ``assert_has_calls``:
 
     >>> m = MagicMock()
     >>> m(1), m.two(2, 3), m.seven(7), m.fifty('50')
@@ -1180,7 +1191,7 @@
 of this object then we can create a matcher that will check these attributes
 for us.
 
-You can see in this example how a 'standard' call to `assert_called_with` isn't
+You can see in this example how a 'standard' call to ``assert_called_with`` isn't
 sufficient:
 
     >>> class Foo:
@@ -1195,7 +1206,7 @@
     AssertionError: Expected: call(<__main__.Foo object at 0x...>)
     Actual call: call(<__main__.Foo object at 0x...>)
 
-A comparison function for our `Foo` class might look something like this:
+A comparison function for our ``Foo`` class might look something like this:
 
     >>> def compare(self, other):
     ...     if not type(self) == type(other):
@@ -1223,11 +1234,11 @@
     >>> match_foo = Matcher(compare, Foo(1, 2))
     >>> mock.assert_called_with(match_foo)
 
-The `Matcher` is instantiated with our compare function and the `Foo` object
-we want to compare against. In `assert_called_with` the `Matcher` equality
+The ``Matcher`` is instantiated with our compare function and the ``Foo`` object
+we want to compare against. In ``assert_called_with`` the ``Matcher`` equality
 method will be called, which compares the object the mock was called with
 against the one we created our matcher with. If they match then
-`assert_called_with` passes, and if they don't an `AssertionError` is raised:
+``assert_called_with`` passes, and if they don't an :exc:`AssertionError` is raised:
 
     >>> match_wrong = Matcher(compare, Foo(3, 4))
     >>> mock.assert_called_with(match_wrong)
@@ -1237,10 +1248,10 @@
     Called with: ((<Foo object at 0x...>,), {})
 
 With a bit of tweaking you could have the comparison function raise the
-`AssertionError` directly and provide a more useful failure message.
+:exc:`AssertionError` directly and provide a more useful failure message.
 
 As of version 1.5, the Python testing library `PyHamcrest
-<http://pypi.python.org/pypi/PyHamcrest>`_ provides similar functionality,
+<https://pypi.python.org/pypi/PyHamcrest>`_ provides similar functionality,
 that may be useful here, in the form of its equality matcher
 (`hamcrest.library.integration.match_equality
-<http://packages.python.org/PyHamcrest/integration.html#hamcrest.library.integration.match_equality>`_).
+<http://pythonhosted.org/PyHamcrest/integration.html#hamcrest.library.integration.match_equality.match_equality>`_).
diff --git a/Doc/library/unittest.mock.rst b/Doc/library/unittest.mock.rst
index f805df3..845e0c4 100644
--- a/Doc/library/unittest.mock.rst
+++ b/Doc/library/unittest.mock.rst
@@ -13,7 +13,7 @@
 replace parts of your system under test with mock objects and make assertions
 about how they have been used.
 
-`unittest.mock` provides a core :class:`Mock` class removing the need to
+:mod:`unittest.mock` provides a core :class:`Mock` class removing the need to
 create a host of stubs throughout your test suite. After performing an
 action, you can make assertions about which methods / attributes were used
 and arguments they were called with. You can also specify return values and
@@ -26,11 +26,11 @@
 :func:`patch`.
 
 Mock is very easy to use and is designed for use with :mod:`unittest`. Mock
-is based on the 'action -> assertion' pattern instead of `'record -> replay'`
+is based on the 'action -> assertion' pattern instead of 'record -> replay'
 used by many mocking frameworks.
 
-There is a backport of `unittest.mock` for earlier versions of Python,
-available as `mock on PyPI <http://pypi.python.org/pypi/mock>`_.
+There is a backport of :mod:`unittest.mock` for earlier versions of Python,
+available as `mock on PyPI <https://pypi.python.org/pypi/mock>`_.
 
 **Source code:** :source:`Lib/unittest/mock.py`
 
@@ -71,9 +71,9 @@
    (5, 4, 3)
 
 Mock has many other ways you can configure it and control its behaviour. For
-example the `spec` argument configures the mock to take its specification
+example the *spec* argument configures the mock to take its specification
 from another object. Attempting to access attributes or methods on the mock
-that don't exist on the spec will fail with an `AttributeError`.
+that don't exist on the spec will fail with an :exc:`AttributeError`.
 
 The :func:`patch` decorator / context manager makes it easy to mock classes or
 objects in a module under test. The object you specify will be replaced with a
@@ -97,13 +97,13 @@
    When you nest patch decorators the mocks are passed in to the decorated
    function in the same order they applied (the normal *python* order that
    decorators are applied). This means from the bottom up, so in the example
-   above the mock for `module.ClassName1` is passed in first.
+   above the mock for ``module.ClassName1`` is passed in first.
 
-   With `patch` it matters that you patch objects in the namespace where they
+   With :func:`patch` it matters that you patch objects in the namespace where they
    are looked up. This is normally straightforward, but for a quick guide
    read :ref:`where to patch <where-to-patch>`.
 
-As well as a decorator `patch` can be used as a context manager in a with
+As well as a decorator :func:`patch` can be used as a context manager in a with
 statement:
 
     >>> with patch.object(ProductionClass, 'method', return_value=None) as mock_method:
@@ -135,7 +135,7 @@
     >>> mock.__str__.assert_called_with()
 
 Mock allows you to assign functions (or other Mock instances) to magic methods
-and they will be called appropriately. The `MagicMock` class is just a Mock
+and they will be called appropriately. The :class:`MagicMock` class is just a Mock
 variant that has all of the magic methods pre-created for you (well, all the
 useful ones anyway).
 
@@ -149,7 +149,7 @@
 
 For ensuring that the mock objects in your tests have the same api as the
 objects they are replacing, you can use :ref:`auto-speccing <auto-speccing>`.
-Auto-speccing can be done through the `autospec` argument to patch, or the
+Auto-speccing can be done through the *autospec* argument to patch, or the
 :func:`create_autospec` function. Auto-speccing creates mock objects that
 have the same attributes and methods as the objects they are replacing, and
 any functions and methods (including constructors) have the same call
@@ -171,9 +171,9 @@
     ...
    TypeError: <lambda>() takes exactly 3 arguments (1 given)
 
-`create_autospec` can also be used on classes, where it copies the signature of
-the `__init__` method, and on callable objects where it copies the signature of
-the `__call__` method.
+:func:`create_autospec` can also be used on classes, where it copies the signature of
+the ``__init__`` method, and on callable objects where it copies the signature of
+the ``__call__`` method.
 
 
 
@@ -264,7 +264,6 @@
             <Mock name='mock.method()' id='...'>
             >>> mock.method.assert_called_with(1, 2, 3, test='wow')
 
-
     .. method:: assert_called_once_with(*args, **kwargs)
 
        Assert that the mock was called exactly once and with the specified
@@ -297,13 +296,13 @@
     .. method:: assert_has_calls(calls, any_order=False)
 
         assert the mock has been called with the specified calls.
-        The `mock_calls` list is checked for the calls.
+        The :attr:`mock_calls` list is checked for the calls.
 
-        If `any_order` is false (the default) then the calls must be
+        If *any_order* is false (the default) then the calls must be
         sequential. There can be extra calls before or after the
         specified calls.
 
-        If `any_order` is true then the calls can be in any order, but
+        If *any_order* is true then the calls can be in any order, but
         they must all appear in :attr:`mock_calls`.
 
             >>> mock = Mock(return_value=None)
@@ -330,7 +329,7 @@
             False
 
         This can be useful where you want to make a series of assertions that
-        reuse the same object. Note that `reset_mock` *doesn't* clear the
+        reuse the same object. Note that :meth:`reset_mock` *doesn't* clear the
         return value, :attr:`side_effect` or any child attributes you have
         set using normal assignment. Child mocks and the return value mock
         (if any) are reset as well.
@@ -338,11 +337,11 @@
 
     .. method:: mock_add_spec(spec, spec_set=False)
 
-        Add a spec to a mock. `spec` can either be an object or a
-        list of strings. Only attributes on the `spec` can be fetched as
+        Add a spec to a mock. *spec* can either be an object or a
+        list of strings. Only attributes on the *spec* can be fetched as
         attributes from the mock.
 
-        If `spec_set` is `True` then only attributes on the spec can be set.
+        If *spec_set* is true then only attributes on the spec can be set.
 
 
     .. method:: attach_mock(mock, attribute)
@@ -383,14 +382,14 @@
               ...
             KeyError
 
-        `configure_mock` exists to make it easier to do configuration
+        :meth:`configure_mock` exists to make it easier to do configuration
         after the mock has been created.
 
 
     .. method:: __dir__()
 
-        `Mock` objects limit the results of `dir(some_mock)` to useful results.
-        For mocks with a `spec` this includes all the permitted attributes
+        :class:`Mock` objects limit the results of ``dir(some_mock)`` to useful results.
+        For mocks with a *spec* this includes all the permitted attributes
         for the mock.
 
         See :data:`FILTER_DIR` for what this filtering does, and how to
@@ -450,7 +449,7 @@
             <Mock name='mock()()' id='...'>
             >>> mock.return_value.assert_called_with()
 
-        `return_value` can also be set in the constructor:
+        :attr:`return_value` can also be set in the constructor:
 
             >>> mock = Mock(return_value=3)
             >>> mock.return_value
@@ -462,7 +461,7 @@
     .. attribute:: side_effect
 
         This can either be a function to be called when the mock is called,
-        or an exception (class or instance) to be raised.
+        an iterable or an exception (class or instance) to be raised.
 
         If you pass in a function it will be called with same arguments as the
         mock and unless the function returns the :data:`DEFAULT` singleton the
@@ -470,6 +469,11 @@
         function returns :data:`DEFAULT` then the mock will return its normal
         value (from the :attr:`return_value`).
 
+        If you pass in an iterable, it is used to retrieve an iterator which
+        must yield a value on every call.  This value can either be an exception
+        instance to be raised, or a value to be returned from the call to the
+        mock (:data:`DEFAULT` handling is identical to the function case).
+
         An example of a mock that raises an exception (to test exception
         handling of an API):
 
@@ -480,18 +484,14 @@
               ...
             Exception: Boom!
 
-        Using `side_effect` to return a sequence of values:
+        Using :attr:`side_effect` to return a sequence of values:
 
             >>> mock = Mock()
             >>> mock.side_effect = [3, 2, 1]
             >>> mock(), mock(), mock()
             (3, 2, 1)
 
-        The `side_effect` function is called with the same arguments as the
-        mock (so it is wise for it to take arbitrary args and keyword
-        arguments) and whatever it returns is used as the return value for
-        the call. The exception is if `side_effect` returns :data:`DEFAULT`,
-        in which case the normal :attr:`return_value` is used.
+        Using a callable:
 
             >>> mock = Mock(return_value=3)
             >>> def side_effect(*args, **kwargs):
@@ -501,7 +501,7 @@
             >>> mock()
             3
 
-        `side_effect` can be set in the constructor. Here's an example that
+        :attr:`side_effect` can be set in the constructor. Here's an example that
         adds one to the value the mock is called with and returns it:
 
             >>> side_effect = lambda value: value + 1
@@ -511,7 +511,7 @@
             >>> mock(-8)
             -7
 
-        Setting `side_effect` to `None` clears it:
+        Setting :attr:`side_effect` to ``None`` clears it:
 
             >>> m = Mock(side_effect=KeyError, return_value=3)
             >>> m()
@@ -525,7 +525,7 @@
 
     .. attribute:: call_args
 
-        This is either `None` (if the mock hasn't been called), or the
+        This is either ``None`` (if the mock hasn't been called), or the
         arguments that the mock was last called with. This will be in the
         form of a tuple: the first member is any ordered arguments the mock
         was called with (or an empty tuple) and the second member is any
@@ -548,7 +548,7 @@
             >>> mock.call_args
             call(3, 4, 5, key='fish', next='w00t!')
 
-        `call_args`, along with members of the lists :attr:`call_args_list`,
+        :attr:`call_args`, along with members of the lists :attr:`call_args_list`,
         :attr:`method_calls` and :attr:`mock_calls` are :data:`call` objects.
         These are tuples, so they can be unpacked to get at the individual
         arguments and make more complex assertions. See
@@ -561,7 +561,7 @@
         (so the length of the list is the number of times it has been
         called). Before any calls have been made it is an empty list. The
         :data:`call` object can be used for conveniently constructing lists of
-        calls to compare with `call_args_list`.
+        calls to compare with :attr:`call_args_list`.
 
             >>> mock = Mock(return_value=None)
             >>> mock()
@@ -573,7 +573,7 @@
             >>> mock.call_args_list == expected
             True
 
-        Members of `call_args_list` are :data:`call` objects. These can be
+        Members of :attr:`call_args_list` are :data:`call` objects. These can be
         unpacked as tuples to get at the individual arguments. See
         :ref:`calls as tuples <calls-as-tuples>`.
 
@@ -591,15 +591,15 @@
             >>> mock.method_calls
             [call.method(), call.property.method.attribute()]
 
-        Members of `method_calls` are :data:`call` objects. These can be
+        Members of :attr:`method_calls` are :data:`call` objects. These can be
         unpacked as tuples to get at the individual arguments. See
         :ref:`calls as tuples <calls-as-tuples>`.
 
 
     .. attribute:: mock_calls
 
-        `mock_calls` records *all* calls to the mock object, its methods, magic
-        methods *and* return value mocks.
+        :attr:`mock_calls` records *all* calls to the mock object, its methods,
+        magic methods *and* return value mocks.
 
             >>> mock = MagicMock()
             >>> result = mock(1, 2, 3)
@@ -616,24 +616,24 @@
             >>> mock.mock_calls == expected
             True
 
-        Members of `mock_calls` are :data:`call` objects. These can be
+        Members of :attr:`mock_calls` are :data:`call` objects. These can be
         unpacked as tuples to get at the individual arguments. See
         :ref:`calls as tuples <calls-as-tuples>`.
 
 
     .. attribute:: __class__
 
-        Normally the `__class__` attribute of an object will return its type.
-        For a mock object with a `spec` `__class__` returns the spec class
-        instead. This allows mock objects to pass `isinstance` tests for the
+        Normally the :attr:`__class__` attribute of an object will return its type.
+        For a mock object with a :attr:`spec`, ``__class__`` returns the spec class
+        instead. This allows mock objects to pass :func:`isinstance` tests for the
         object they are replacing / masquerading as:
 
             >>> mock = Mock(spec=3)
             >>> isinstance(mock, int)
             True
 
-        `__class__` is assignable to, this allows a mock to pass an
-        `isinstance` check without forcing you to use a spec:
+        :attr:`__class__` is assignable to, this allows a mock to pass an
+        :func:`isinstance` check without forcing you to use a spec:
 
             >>> mock = Mock()
             >>> mock.__class__ = dict
@@ -642,12 +642,12 @@
 
 .. class:: NonCallableMock(spec=None, wraps=None, name=None, spec_set=None, **kwargs)
 
-    A non-callable version of `Mock`. The constructor parameters have the same
-    meaning of `Mock`, with the exception of `return_value` and `side_effect`
+    A non-callable version of :class:`Mock`. The constructor parameters have the same
+    meaning of :class:`Mock`, with the exception of *return_value* and *side_effect*
     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 `isinstance` tests:
+Mock objects that use a class or an instance as a :attr:`spec` or
+:attr:`spec_set` are able to pass :func:`isinstance` tests:
 
     >>> mock = Mock(spec=SomeClass)
     >>> isinstance(mock, SomeClass)
@@ -656,11 +656,11 @@
     >>> isinstance(mock, SomeClass)
     True
 
-The `Mock` classes have support for mocking magic methods. See :ref:`magic
+The :class:`Mock` classes have support for mocking magic methods. See :ref:`magic
 methods <magic-methods>` for the full details.
 
 The mock classes and the :func:`patch` decorators all take arbitrary keyword
-arguments for configuration. For the `patch` decorators the keywords are
+arguments for configuration. For the :func:`patch` decorators the keywords are
 passed to the constructor of the mock being created. The keyword arguments
 are for configuring attributes of the mock:
 
@@ -672,7 +672,7 @@
 
 The return value and side effect of child mocks can be set in the same way,
 using dotted notation. As you can't use dotted names directly in a call you
-have to create a dictionary and unpack it using `**`:
+have to create a dictionary and unpack it using ``**``:
 
     >>> attrs = {'method.return_value': 3, 'other.side_effect': KeyError}
     >>> mock = Mock(some_attribute='eggs', **attrs)
@@ -685,14 +685,35 @@
       ...
     KeyError
 
+A callable mock which was created with a *spec* (or a *spec_set*) will
+introspect the specification object's signature when matching calls to
+the mock.  Therefore, it can match the actual call's arguments regardless
+of whether they were passed positionally or by name::
+
+   >>> def f(a, b, c): pass
+   ...
+   >>> mock = Mock(spec=f)
+   >>> mock(1, 2, c=3)
+   <Mock name='mock()' id='140161580456576'>
+   >>> mock.assert_called_with(1, 2, 3)
+   >>> mock.assert_called_with(a=1, b=2, c=3)
+
+This applies to :meth:`~Mock.assert_called_with`,
+:meth:`~Mock.assert_called_once_with`, :meth:`~Mock.assert_has_calls` and
+:meth:`~Mock.assert_any_call`.  When :ref:`auto-speccing`, it will also
+apply to method calls on the mock object.
+
+   .. versionchanged:: 3.4
+      Added signature introspection on specced and autospecced mock objects.
+
 
 .. class:: PropertyMock(*args, **kwargs)
 
    A mock intended to be used as a property, or other descriptor, on a class.
-   `PropertyMock` provides `__get__` and `__set__` methods so you can specify
-   a return value when it is fetched.
+   :class:`PropertyMock` provides :meth:`__get__` and :meth:`__set__` methods
+   so you can specify a return value when it is fetched.
 
-   Fetching a `PropertyMock` instance from an object calls the mock, with
+   Fetching a :class:`PropertyMock` instance from an object calls the mock, with
    no args. Setting it calls the mock with the value being set.
 
         >>> class Foo:
@@ -714,7 +735,7 @@
         [call(), call(6)]
 
 Because of the way mock attributes are stored you can't directly attach a
-`PropertyMock` to a mock object. Instead you can attach it to the mock type
+:class:`PropertyMock` to a mock object. Instead you can attach it to the mock type
 object::
 
     >>> m = MagicMock()
@@ -738,7 +759,7 @@
 like :attr:`~Mock.call_args` and :attr:`~Mock.call_args_list`.
 
 If :attr:`~Mock.side_effect` is set then it will be called after the call has
-been recorded, so if `side_effect` raises an exception the call is still
+been recorded, so if :attr:`side_effect` raises an exception the call is still
 recorded.
 
 The simplest way to make a mock raise an exception when called is to make
@@ -759,8 +780,8 @@
         >>> m.mock_calls
         [call(1, 2, 3), call('two', 'three', 'four')]
 
-If `side_effect` is a function then whatever that function returns is what
-calls to the mock return. The `side_effect` function is called with the
+If :attr:`side_effect` is a function then whatever that function returns is what
+calls to the mock return. The :attr:`side_effect` function is called with the
 same arguments as the mock. This allows you to vary the return value of the
 call dynamically, based on the input:
 
@@ -777,7 +798,7 @@
 
 If you want the mock to still return the default return value (a new mock), or
 any set return value, then there are two ways of doing this. Either return
-`mock.return_value` from inside `side_effect`, or return :data:`DEFAULT`:
+:attr:`mock.return_value` from inside :attr:`side_effect`, or return :data:`DEFAULT`:
 
         >>> m = MagicMock()
         >>> def side_effect(*args, **kwargs):
@@ -794,8 +815,8 @@
         >>> m()
         3
 
-To remove a `side_effect`, and return to the default behaviour, set the
-`side_effect` to `None`:
+To remove a :attr:`side_effect`, and return to the default behaviour, set the
+:attr:`side_effect` to ``None``:
 
         >>> m = MagicMock(return_value=6)
         >>> def side_effect(*args, **kwargs):
@@ -808,9 +829,9 @@
         >>> m()
         6
 
-The `side_effect` can also be any iterable object. Repeated calls to the mock
+The :attr:`side_effect` can also be any iterable object. Repeated calls to the mock
 will return values from the iterable (until the iterable is exhausted and
-a `StopIteration` is raised):
+a :exc:`StopIteration` is raised):
 
         >>> m = MagicMock(side_effect=[1, 2, 3])
         >>> m()
@@ -847,12 +868,12 @@
 Mock objects create attributes on demand. This allows them to pretend to be
 objects of any type.
 
-You may want a mock object to return `False` to a `hasattr` call, or raise an
-`AttributeError` when an attribute is fetched. You can do this by providing
-an object as a `spec` for a mock, but that isn't always convenient.
+You may want a mock object to return ``False`` to a :func:`hasattr` call, or raise an
+:exc:`AttributeError` when an attribute is fetched. You can do this by providing
+an object as a :attr:`spec` for a mock, but that isn't always convenient.
 
 You "block" attributes by deleting them. Once deleted, accessing an attribute
-will raise an `AttributeError`.
+will raise an :exc:`AttributeError`.
 
     >>> mock = MagicMock()
     >>> hasattr(mock, 'm')
@@ -938,7 +959,7 @@
 
 .. [#] The only exceptions are magic methods and attributes (those that have
        leading and trailing double underscores). Mock doesn't create these but
-       instead raises an ``AttributeError``. This is because the interpreter
+       instead raises an :exc:`AttributeError`. This is because the interpreter
        will often implicitly request these methods, and gets *very* confused to
        get a new Mock object when it expects a magic method. If you need magic
        method support see :ref:`magic methods <magic-methods>`.
@@ -958,53 +979,53 @@
 
 .. note::
 
-    `patch` is straightforward to use. The key is to do the patching in the
+    :func:`patch` is straightforward to use. The key is to do the patching in the
     right namespace. See the section `where to patch`_.
 
 .. function:: patch(target, new=DEFAULT, spec=None, create=False, spec_set=None, autospec=None, new_callable=None, **kwargs)
 
-    `patch` acts as a function decorator, class decorator or a context
-    manager. Inside the body of the function or with statement, the `target`
-    is patched with a `new` object. When the function/with statement exits
+    :func:`patch` acts as a function decorator, class decorator or a context
+    manager. Inside the body of the function or with statement, the *target*
+    is patched with a *new* object. When the function/with statement exits
     the patch is undone.
 
-    If `new` is omitted, then the target is replaced with a
-    :class:`MagicMock`. If `patch` is used as a decorator and `new` is
+    If *new* is omitted, then the target is replaced with a
+    :class:`MagicMock`. If :func:`patch` is used as a decorator and *new* is
     omitted, the created mock is passed in as an extra argument to the
-    decorated function. If `patch` is used as a context manager the created
+    decorated function. If :func:`patch` is used as a context manager the created
     mock is returned by the context manager.
 
-    `target` should be a string in the form `'package.module.ClassName'`. The
-    `target` is imported and the specified object replaced with the `new`
-    object, so the `target` must be importable from the environment you are
-    calling `patch` from. The target is imported when the decorated function
+    *target* should be a string in the form ``'package.module.ClassName'``. The
+    *target* is imported and the specified object replaced with the *new*
+    object, so the *target* must be importable from the environment you are
+    calling :func:`patch` from. The target is imported when the decorated function
     is executed, not at decoration time.
 
-    The `spec` and `spec_set` keyword arguments are passed to the `MagicMock`
+    The *spec* and *spec_set* keyword arguments are passed to the :class:`MagicMock`
     if patch is creating one for you.
 
-    In addition you can pass `spec=True` or `spec_set=True`, which causes
+    In addition you can pass ``spec=True`` or ``spec_set=True``, which causes
     patch to pass in the object being mocked as the spec/spec_set object.
 
-    `new_callable` allows you to specify a different class, or callable object,
-    that will be called to create the `new` object. By default `MagicMock` is
+    *new_callable* allows you to specify a different class, or callable object,
+    that will be called to create the *new* object. By default :class:`MagicMock` is
     used.
 
-    A more powerful form of `spec` is `autospec`. If you set `autospec=True`
-    then the mock with be created with a spec from the object being replaced.
+    A more powerful form of *spec* is *autospec*. If you set ``autospec=True``
+    then the mock will be created with a spec from the object being replaced.
     All attributes of the mock will also have the spec of the corresponding
     attribute of the object being replaced. Methods and functions being mocked
-    will have their arguments checked and will raise a `TypeError` if they are
+    will have their arguments checked and will raise a :exc:`TypeError` if they are
     called with the wrong signature. For mocks
     replacing a class, their return value (the 'instance') will have the same
     spec as the class. See the :func:`create_autospec` function and
     :ref:`auto-speccing`.
 
-    Instead of `autospec=True` you can pass `autospec=some_object` to use an
+    Instead of ``autospec=True`` you can pass ``autospec=some_object`` to use an
     arbitrary object as the spec instead of the one being replaced.
 
-    By default `patch` will fail to replace attributes that don't exist. If
-    you pass in `create=True`, and the attribute doesn't exist, patch will
+    By default :func:`patch` will fail to replace attributes that don't exist. If
+    you pass in ``create=True``, and the attribute doesn't exist, patch will
     create the attribute for you when the patched function is called, and
     delete it again afterwards. This is useful for writing tests against
     attributes that your production code creates at runtime. It is off by
@@ -1039,16 +1060,16 @@
     >>> function(None)
     True
 
-Patching a class replaces the class with a `MagicMock` *instance*. If the
+Patching a class replaces the class with a :class:`MagicMock` *instance*. If the
 class is instantiated in the code under test then it will be the
 :attr:`~Mock.return_value` of the mock that will be used.
 
 If the class is instantiated multiple times you could use
 :attr:`~Mock.side_effect` to return a new mock each time. Alternatively you
-can set the `return_value` to be anything you want.
+can set the *return_value* to be anything you want.
 
 To configure return values on methods of *instances* on the patched class
-you must do this on the `return_value`. For example:
+you must do this on the :attr:`return_value`. For example:
 
     >>> class Class:
     ...     def method(self):
@@ -1061,7 +1082,7 @@
     ...     assert Class().method() == 'foo'
     ...
 
-If you use `spec` or `spec_set` and `patch` is replacing a *class*, then the
+If you use *spec* or *spec_set* and :func:`patch` is replacing a *class*, then the
 return value of the created mock will have the same spec.
 
     >>> Original = Class
@@ -1071,7 +1092,7 @@
     >>> assert isinstance(instance, Original)
     >>> patcher.stop()
 
-The `new_callable` argument is useful where you want to use an alternative
+The *new_callable* argument is useful where you want to use an alternative
 class to the default :class:`MagicMock` for the created mock. For example, if
 you wanted a :class:`NonCallableMock` to be used:
 
@@ -1084,7 +1105,7 @@
       ...
     TypeError: 'NonCallableMock' object is not callable
 
-Another use case might be to replace an object with a `io.StringIO` instance:
+Another use case might be to replace an object with a :class:`io.StringIO` instance:
 
     >>> from io import StringIO
     >>> def foo():
@@ -1097,7 +1118,7 @@
     ...
     >>> test()
 
-When `patch` is creating a mock for you, it is common that the first thing
+When :func:`patch` is creating a mock for you, it is common that the first thing
 you need to do is to configure the mock. Some of that configuration can be done
 in the call to patch. Any arbitrary keywords you pass into the call will be
 used to set attributes on the created mock:
@@ -1113,7 +1134,7 @@
 :attr:`~Mock.return_value` and :attr:`~Mock.side_effect`, of child mocks can
 also be configured. These aren't syntactically valid to pass in directly as
 keyword arguments, but a dictionary with these as keys can still be expanded
-into a `patch` call using `**`:
+into a :func:`patch` call using ``**``:
 
     >>> config = {'method.return_value': 3, 'other.side_effect': KeyError}
     >>> patcher = patch('__main__.thing', **config)
@@ -1131,19 +1152,19 @@
 
 .. function:: patch.object(target, attribute, new=DEFAULT, spec=None, create=False, spec_set=None, autospec=None, new_callable=None, **kwargs)
 
-    patch the named member (`attribute`) on an object (`target`) with a mock
+    patch the named member (*attribute*) on an object (*target*) with a mock
     object.
 
-    `patch.object` can be used as a decorator, class decorator or a context
-    manager. Arguments `new`, `spec`, `create`, `spec_set`, `autospec` and
-    `new_callable` have the same meaning as for `patch`. Like `patch`,
-    `patch.object` takes arbitrary keyword arguments for configuring the mock
+    :func:`patch.object` can be used as a decorator, class decorator or a context
+    manager. Arguments *new*, *spec*, *create*, *spec_set*, *autospec* and
+    *new_callable* have the same meaning as for :func:`patch`. Like :func:`patch`,
+    :func:`patch.object` takes arbitrary keyword arguments for configuring the mock
     object it creates.
 
-    When used as a class decorator `patch.object` honours `patch.TEST_PREFIX`
+    When used as a class decorator :func:`patch.object` honours ``patch.TEST_PREFIX``
     for choosing which methods to wrap.
 
-You can either call `patch.object` with three arguments or two arguments. The
+You can either call :func:`patch.object` with three arguments or two arguments. The
 three argument form takes the object to be patched, the attribute name and the
 object to replace the attribute with.
 
@@ -1158,8 +1179,8 @@
     ...
     >>> test()
 
-`spec`, `create` and the other arguments to `patch.object` have the same
-meaning as they do for `patch`.
+*spec*, *create* and the other arguments to :func:`patch.object` have the same
+meaning as they do for :func:`patch`.
 
 
 patch.dict
@@ -1170,27 +1191,27 @@
     Patch a dictionary, or dictionary like object, and restore the dictionary
     to its original state after the test.
 
-    `in_dict` can be a dictionary or a mapping like container. If it is a
+    *in_dict* can be a dictionary or a mapping like container. If it is a
     mapping then it must at least support getting, setting and deleting items
     plus iterating over keys.
 
-    `in_dict` can also be a string specifying the name of the dictionary, which
+    *in_dict* can also be a string specifying the name of the dictionary, which
     will then be fetched by importing it.
 
-    `values` can be a dictionary of values to set in the dictionary. `values`
-    can also be an iterable of `(key, value)` pairs.
+    *values* can be a dictionary of values to set in the dictionary. *values*
+    can also be an iterable of ``(key, value)`` pairs.
 
-    If `clear` is true then the dictionary will be cleared before the new
+    If *clear* is true then the dictionary will be cleared before the new
     values are set.
 
-    `patch.dict` can also be called with arbitrary keyword arguments to set
+    :func:`patch.dict` can also be called with arbitrary keyword arguments to set
     values in the dictionary.
 
-    `patch.dict` can be used as a context manager, decorator or class
-    decorator. When used as a class decorator `patch.dict` honours
-    `patch.TEST_PREFIX` for choosing which methods to wrap.
+    :func:`patch.dict` can be used as a context manager, decorator or class
+    decorator. When used as a class decorator :func:`patch.dict` honours
+    ``patch.TEST_PREFIX`` for choosing which methods to wrap.
 
-`patch.dict` can be used to add members to a dictionary, or simply let a test
+:func:`patch.dict` can be used to add members to a dictionary, or simply let a test
 change a dictionary, and ensure the dictionary is restored when the test
 ends.
 
@@ -1207,7 +1228,7 @@
     newvalue
     >>> assert 'newkey' not in os.environ
 
-Keywords can be used in the `patch.dict` call to set values in the dictionary:
+Keywords can be used in the :func:`patch.dict` call to set values in the dictionary:
 
     >>> mymodule = MagicMock()
     >>> mymodule.function.return_value = 'fish'
@@ -1217,11 +1238,11 @@
     ...
     'fish'
 
-`patch.dict` can be used with dictionary like objects that aren't actually
+:func:`patch.dict` can be used with dictionary like objects that aren't actually
 dictionaries. At the very minimum they must support item getting, setting,
 deleting and either iteration or membership test. This corresponds to the
-magic methods `__getitem__`, `__setitem__`, `__delitem__` and either
-`__iter__` or `__contains__`.
+magic methods :meth:`__getitem__`, :meth:`__setitem__`, :meth:`__delitem__` and either
+:meth:`__iter__` or :meth:`__contains__`.
 
     >>> class Container:
     ...     def __init__(self):
@@ -1257,21 +1278,21 @@
         with patch.multiple(settings, FIRST_PATCH='one', SECOND_PATCH='two'):
             ...
 
-    Use :data:`DEFAULT` as the value if you want `patch.multiple` to create
+    Use :data:`DEFAULT` as the value if you want :func:`patch.multiple` to create
     mocks for you. In this case the created mocks are passed into a decorated
-    function by keyword, and a dictionary is returned when `patch.multiple` is
+    function by keyword, and a dictionary is returned when :func:`patch.multiple` is
     used as a context manager.
 
-    `patch.multiple` can be used as a decorator, class decorator or a context
-    manager. The arguments `spec`, `spec_set`, `create`, `autospec` and
-    `new_callable` have the same meaning as for `patch`. These arguments will
-    be applied to *all* patches done by `patch.multiple`.
+    :func:`patch.multiple` can be used as a decorator, class decorator or a context
+    manager. The arguments *spec*, *spec_set*, *create*, *autospec* and
+    *new_callable* have the same meaning as for :func:`patch`. These arguments will
+    be applied to *all* patches done by :func:`patch.multiple`.
 
-    When used as a class decorator `patch.multiple` honours `patch.TEST_PREFIX`
+    When used as a class decorator :func:`patch.multiple` honours ``patch.TEST_PREFIX``
     for choosing which methods to wrap.
 
-If you want `patch.multiple` to create mocks for you, then you can use
-:data:`DEFAULT` as the value. If you use `patch.multiple` as a decorator
+If you want :func:`patch.multiple` to create mocks for you, then you can use
+:data:`DEFAULT` as the value. If you use :func:`patch.multiple` as a decorator
 then the created mocks are passed into the decorated function by keyword.
 
     >>> thing = object()
@@ -1284,8 +1305,8 @@
     ...
     >>> test_function()
 
-`patch.multiple` can be nested with other `patch` decorators, but put arguments
-passed by keyword *after* any of the standard arguments created by `patch`:
+:func:`patch.multiple` can be nested with other ``patch`` decorators, but put arguments
+passed by keyword *after* any of the standard arguments created by :func:`patch`:
 
     >>> @patch('sys.exit')
     ... @patch.multiple('__main__', thing=DEFAULT, other=DEFAULT)
@@ -1296,7 +1317,7 @@
     ...
     >>> test_function()
 
-If `patch.multiple` is used as a context manager, the value returned by the
+If :func:`patch.multiple` is used as a context manager, the value returned by the
 context manger is a dictionary where created mocks are keyed by name:
 
     >>> with patch.multiple('__main__', thing=DEFAULT, other=DEFAULT) as values:
@@ -1312,16 +1333,16 @@
 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
+All the patchers have :meth:`start` and :meth:`stop` methods. These make it simpler to do
+patching in ``setUp`` methods or where you want to do multiple patches without
 nesting decorators or with statements.
 
-To use them call `patch`, `patch.object` or `patch.dict` as normal and keep a
-reference to the returned `patcher` object. You can then call `start` to put
-the patch in place and `stop` to undo it.
+To use them call :func:`patch`, :func:`patch.object` or :func:`patch.dict` as
+normal and keep a reference to the returned ``patcher`` object. You can then
+call :meth:`start` to put the patch in place and :meth:`stop` to undo it.
 
-If you are using `patch` to create a mock for you then it will be returned by
-the call to `patcher.start`.
+If you are using :func:`patch` to create a mock for you then it will be returned by
+the call to ``patcher.start``.
 
     >>> patcher = patch('package.module.ClassName')
     >>> from package import module
@@ -1334,8 +1355,8 @@
     >>> assert module.ClassName is not new_mock
 
 
-A typical use case for this might be for doing multiple patches in the `setUp`
-method of a `TestCase`:
+A typical use case for this might be for doing multiple patches in the ``setUp``
+method of a :class:`TestCase`:
 
     >>> class MyTest(TestCase):
     ...     def setUp(self):
@@ -1357,7 +1378,7 @@
 .. caution::
 
     If you use this technique you must ensure that the patching is "undone" by
-    calling `stop`. This can be fiddlier than you might think, because if an
+    calling ``stop``. This can be fiddlier than you might think, because if an
     exception is raised in the ``setUp`` then ``tearDown`` is not called.
     :meth:`unittest.TestCase.addCleanup` makes this easier:
 
@@ -1387,11 +1408,11 @@
 
 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
-start with `test` as being test methods. This is the same way that the
+start with ``'test'`` as being test methods. This is the same way that the
 :class:`unittest.TestLoader` finds test methods by default.
 
 It is possible that you want to use a different prefix for your tests. You can
-inform the patchers of the different prefix by setting `patch.TEST_PREFIX`:
+inform the patchers of the different prefix by setting ``patch.TEST_PREFIX``:
 
     >>> patch.TEST_PREFIX = 'foo'
     >>> value = 3
@@ -1444,7 +1465,7 @@
 Where to patch
 ~~~~~~~~~~~~~~
 
-`patch` works by (temporarily) changing the object that a *name* points to with
+:func:`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
 for patching to work you must ensure that you patch the name used by the system
 under test.
@@ -1462,23 +1483,23 @@
         -> from a import SomeClass
         -> some_function instantiates SomeClass
 
-Now we want to test `some_function` but we want to mock out `SomeClass` using
-`patch`. The problem is that when we import module b, which we will have to
-do then it imports `SomeClass` from module a. If we use `patch` to mock out
-`a.SomeClass` then it will have no effect on our test; module b already has a
-reference to the *real* `SomeClass` and it looks like our patching had no
+Now we want to test ``some_function`` but we want to mock out ``SomeClass`` using
+:func:`patch`. The problem is that when we import module b, which we will have to
+do then it imports ``SomeClass`` from module a. If we use :func:`patch` to mock out
+``a.SomeClass`` then it will have no effect on our test; module b already has a
+reference to the *real* ``SomeClass`` and it looks like our patching had no
 effect.
 
-The key is to patch out `SomeClass` where it is used (or where it is looked up
-). In this case `some_function` will actually look up `SomeClass` in module b,
+The key is to patch out ``SomeClass`` where it is used (or where it is looked up
+). In this case ``some_function`` will actually look up ``SomeClass`` in module b,
 where we have imported it. The patching should look like::
 
     @patch('b.SomeClass')
 
-However, consider the alternative scenario where instead of `from a import
-SomeClass` module b does `import a` and `some_function` uses `a.SomeClass`. Both
+However, consider the alternative scenario where instead of ``from a import
+SomeClass`` module b does ``import a`` and ``some_function`` uses ``a.SomeClass``. Both
 of these import forms are common. In this case the class we want to patch is
-being looked up on the a module and so we have to patch `a.SomeClass` instead::
+being looked up in the module and so we have to patch ``a.SomeClass`` instead::
 
     @patch('a.SomeClass')
 
@@ -1534,7 +1555,7 @@
    []
 
 One use case for this is for mocking objects used as context managers in a
-`with` statement:
+:keyword:`with` statement:
 
    >>> mock = Mock()
    >>> mock.__enter__ = Mock(return_value='foo')
@@ -1550,8 +1571,8 @@
 
 .. note::
 
-   If you use the `spec` keyword argument to create a mock then attempting to
-   set a magic method that isn't in the spec will raise an `AttributeError`.
+   If you use the *spec* keyword argument to create a mock then attempting to
+   set a magic method that isn't in the spec will raise an :exc:`AttributeError`.
 
 The full list of supported magic methods is:
 
@@ -1587,7 +1608,7 @@
 Magic Mock
 ~~~~~~~~~~
 
-There are two `MagicMock` variants: `MagicMock` and `NonCallableMagicMock`.
+There are two ``MagicMock`` variants: :class:`MagicMock` and :class:`NonCallableMagicMock`.
 
 
 .. class:: MagicMock(*args, **kw)
@@ -1598,19 +1619,19 @@
 
    The constructor parameters have the same meaning as for :class:`Mock`.
 
-   If you use the `spec` or `spec_set` arguments then *only* magic methods
+   If you use the *spec* or *spec_set* arguments then *only* magic methods
    that exist in the spec will be created.
 
 
 .. class:: NonCallableMagicMock(*args, **kw)
 
-    A non-callable version of `MagicMock`.
+    A non-callable version of :class:`MagicMock`.
 
     The constructor parameters have the same meaning as for
-    :class:`MagicMock`, with the exception of `return_value` and
-    `side_effect` which have no meaning on a non-callable mock.
+    :class:`MagicMock`, with the exception of *return_value* and
+    *side_effect* which have no meaning on a non-callable mock.
 
-The magic methods are setup with `MagicMock` objects, so you can configure them
+The magic methods are setup with :class:`MagicMock` objects, so you can configure them
 and use them in the usual way:
 
    >>> mock = MagicMock()
@@ -1657,9 +1678,10 @@
    >>> object() in mock
    False
 
-The two equality method, `__eq__` and `__ne__`, are special.
-They do the default equality comparison on identity, using a side
-effect, unless you change their return value to return something else:
+The two equality methods, :meth:`__eq__` and :meth:`__ne__`, are special.
+They do the default equality comparison on identity, using the
+:attr:`~Mock.side_effect` attribute, unless you change their return value to
+return something else::
 
    >>> MagicMock() == 3
    False
@@ -1670,7 +1692,7 @@
    >>> mock == 3
    True
 
-The return value of `MagicMock.__iter__` can be any iterable object and isn't
+The return value of :meth:`MagicMock.__iter__` can be any iterable object and isn't
 required to be an iterator:
 
    >>> mock = MagicMock()
@@ -1730,10 +1752,10 @@
 
 Sometimes when testing you need to test that a specific object is passed as an
 argument to another method, or returned. It can be common to create named
-sentinel objects to test this. `sentinel` provides a convenient way of
+sentinel objects to test this. :data:`sentinel` provides a convenient way of
 creating and testing the identity of objects like this.
 
-In this example we monkey patch `method` to return `sentinel.some_object`:
+In this example we monkey patch ``method`` to return ``sentinel.some_object``:
 
     >>> real = ProductionClass()
     >>> real.method = Mock(name="method")
@@ -1750,8 +1772,8 @@
 
 .. data:: DEFAULT
 
-    The `DEFAULT` object is a pre-created sentinel (actually
-    `sentinel.DEFAULT`). It can be used by :attr:`~Mock.side_effect`
+    The :data:`DEFAULT` object is a pre-created sentinel (actually
+    ``sentinel.DEFAULT``). It can be used by :attr:`~Mock.side_effect`
     functions to indicate that the normal return value should be used.
 
 
@@ -1760,9 +1782,9 @@
 
 .. function:: call(*args, **kwargs)
 
-    `call` is a helper object for making simpler assertions, for comparing with
+    :func:`call` is a helper object for making simpler assertions, for comparing with
     :attr:`~Mock.call_args`, :attr:`~Mock.call_args_list`,
-    :attr:`~Mock.mock_calls` and :attr:`~Mock.method_calls`. `call` can also be
+    :attr:`~Mock.mock_calls` and :attr:`~Mock.method_calls`. :func:`call` can also be
     used with :meth:`~Mock.assert_has_calls`.
 
         >>> m = MagicMock(return_value=None)
@@ -1773,11 +1795,11 @@
 
 .. method:: call.call_list()
 
-    For a call object that represents multiple calls, `call_list`
+    For a call object that represents multiple calls, :meth:`call_list`
     returns a list of all the intermediate calls as well as the
     final call.
 
-`call_list` is particularly useful for making assertions on "chained calls". A
+``call_list`` is particularly useful for making assertions on "chained calls". A
 chained call is multiple calls on a single line of code. This results in
 multiple entries in :attr:`~Mock.mock_calls` on a mock. Manually constructing
 the sequence of calls can be tedious.
@@ -1799,15 +1821,15 @@
 
 .. _calls-as-tuples:
 
-A `call` object is either a tuple of (positional args, keyword args) or
+A ``call`` object is either a tuple of (positional args, keyword args) or
 (name, positional args, keyword args) depending on how it was constructed. When
-you construct them yourself this isn't particularly interesting, but the `call`
+you construct them yourself this isn't particularly interesting, but the ``call``
 objects that are in the :attr:`Mock.call_args`, :attr:`Mock.call_args_list` and
 :attr:`Mock.mock_calls` attributes can be introspected to get at the individual
 arguments they contain.
 
-The `call` objects in :attr:`Mock.call_args` and :attr:`Mock.call_args_list`
-are two-tuples of (positional args, keyword args) whereas the `call` objects
+The ``call`` objects in :attr:`Mock.call_args` and :attr:`Mock.call_args_list`
+are two-tuples of (positional args, keyword args) whereas the ``call`` objects
 in :attr:`Mock.mock_calls`, along with ones you construct yourself, are
 three-tuples of (name, positional args, keyword args).
 
@@ -1850,25 +1872,25 @@
 .. function:: create_autospec(spec, spec_set=False, instance=False, **kwargs)
 
     Create a mock object using another object as a spec. Attributes on the
-    mock will use the corresponding attribute on the `spec` object as their
+    mock will use the corresponding attribute on the *spec* object as their
     spec.
 
     Functions or methods being mocked will have their arguments checked to
     ensure that they are called with the correct signature.
 
-    If `spec_set` is `True` then attempting to set attributes that don't exist
-    on the spec object will raise an `AttributeError`.
+    If *spec_set* is ``True`` then attempting to set attributes that don't exist
+    on the spec object will raise an :exc:`AttributeError`.
 
     If a class is used as a spec then the return value of the mock (the
     instance of the class) will have the same spec. You can use a class as the
-    spec for an instance object by passing `instance=True`. The returned mock
+    spec for an instance object by passing ``instance=True``. The returned mock
     will only be callable if instances of the mock are callable.
 
-    `create_autospec` also takes arbitrary keyword arguments that are passed to
+    :func:`create_autospec` also takes arbitrary keyword arguments that are passed to
     the constructor of the created mock.
 
 See :ref:`auto-speccing` for examples of how to use auto-speccing with
-`create_autospec` and the `autospec` argument to :func:`patch`.
+:func:`create_autospec` and the *autospec* argument to :func:`patch`.
 
 
 ANY
@@ -1890,7 +1912,7 @@
     >>> mock('foo', bar=object())
     >>> mock.assert_called_once_with('foo', bar=ANY)
 
-`ANY` can also be used in comparisons with call lists like
+:data:`ANY` can also be used in comparisons with call lists like
 :attr:`~Mock.mock_calls`:
 
     >>> m = MagicMock(return_value=None)
@@ -1907,15 +1929,15 @@
 
 .. data:: FILTER_DIR
 
-`FILTER_DIR` is a module level variable that controls the way mock objects
-respond to `dir` (only for Python 2.6 or more recent). The default is `True`,
+:data:`FILTER_DIR` is a module level variable that controls the way mock objects
+respond to :func:`dir` (only for Python 2.6 or more recent). The default is ``True``,
 which uses the filtering described below, to only show useful members. If you
 dislike this filtering, or need to switch it off for diagnostic purposes, then
-set `mock.FILTER_DIR = False`.
+set ``mock.FILTER_DIR = False``.
 
-With filtering on, `dir(some_mock)` shows only useful attributes and will
+With filtering on, ``dir(some_mock)`` shows only useful attributes and will
 include any dynamically created attributes that wouldn't normally be shown.
-If the mock was created with a `spec` (or `autospec` of course) then all the
+If the mock was created with a *spec* (or *autospec* of course) then all the
 attributes from the original are shown, even if they haven't been accessed
 yet:
 
@@ -1934,11 +1956,11 @@
      'BaseHandler',
      ...
 
-Many of the not-very-useful (private to `Mock` rather than the thing being
+Many of the not-very-useful (private to :class:`Mock` rather than the thing being
 mocked) underscore and double underscore prefixed attributes have been
-filtered from the result of calling `dir` on a `Mock`. If you dislike this
+filtered from the result of calling :func:`dir` on a :class:`Mock`. If you dislike this
 behaviour you can switch it off by setting the module level switch
-`FILTER_DIR`:
+:data:`FILTER_DIR`:
 
     >>> from unittest import mock
     >>> mock.FILTER_DIR = False
@@ -1952,9 +1974,9 @@
      '__class__',
      ...
 
-Alternatively you can just use `vars(my_mock)` (instance members) and
-`dir(type(my_mock))` (type members) to bypass the filtering irrespective of
-`mock.FILTER_DIR`.
+Alternatively you can just use ``vars(my_mock)`` (instance members) and
+``dir(type(my_mock))`` (type members) to bypass the filtering irrespective of
+:data:`mock.FILTER_DIR`.
 
 
 mock_open
@@ -1962,25 +1984,30 @@
 
 .. function:: mock_open(mock=None, read_data=None)
 
-    A helper function to create a mock to replace the use of `open`. It works
-    for `open` called directly or used as a context manager.
+    A helper function to create a mock to replace the use of :func:`open`. It works
+    for :func:`open` called directly or used as a context manager.
 
-    The `mock` argument is the mock object to configure. If `None` (the
-    default) then a `MagicMock` will be created for you, with the API limited
+    The *mock* argument is the mock object to configure. If ``None`` (the
+    default) then a :class:`MagicMock` will be created for you, with the API limited
     to methods or attributes available on standard file handles.
 
-    `read_data` is a string for the `~io.IOBase.read` method of the file handle
-    to return.  This is an empty string by default.
+    *read_data* is a string for the :meth:`~io.IOBase.read`,
+    :meth:`~io.IOBase.readline`, and :meth:`~io.IOBase.readlines` methods
+    of the file handle to return.  Calls to those methods will take data from
+    *read_data* until it is depleted.  The mock of these methods is pretty
+    simplistic.  If you need more control over the data that you are feeding to
+    the tested code you will need to customize this mock for yourself.
+    *read_data* is an empty string by default.
 
-Using `open` as a context manager is a great way to ensure your file handles
+Using :func:`open` as a context manager is a great way to ensure your file handles
 are closed properly and is becoming common::
 
     with open('/some/path', 'w') as f:
         f.write('something')
 
-The issue is that even if you mock out the call to `open` it is the
-*returned object* that is used as a context manager (and has `__enter__` and
-`__exit__` called).
+The issue is that even if you mock out the call to :func:`open` it is the
+*returned object* that is used as a context manager (and has :meth:`__enter__` and
+:meth:`__exit__` called).
 
 Mocking context managers with a :class:`MagicMock` is common enough and fiddly
 enough that a helper function is useful.
@@ -2014,21 +2041,21 @@
 Autospeccing
 ~~~~~~~~~~~~
 
-Autospeccing is based on the existing `spec` feature of mock. It limits the
+Autospeccing is based on the existing :attr:`spec` feature of mock. It limits the
 api of mocks to the api of an original object (the spec), but it is recursive
 (implemented lazily) so that attributes of mocks only have the same api as
 the attributes of the spec. In addition mocked functions / methods have the
-same call signature as the original so they raise a `TypeError` if they are
+same call signature as the original so they raise a :exc:`TypeError` if they are
 called incorrectly.
 
 Before I explain how auto-speccing works, here's why it is needed.
 
-`Mock` is a very powerful and flexible object, but it suffers from two flaws
+:class:`Mock` is a very powerful and flexible object, but it suffers from two flaws
 when used to mock out objects from a system under test. One of these flaws is
-specific to the `Mock` api and the other is a more general problem with using
+specific to the :class:`Mock` api and the other is a more general problem with using
 mock objects.
 
-First the problem specific to `Mock`. `Mock` has two assert methods that are
+First the problem specific to :class:`Mock`. :class:`Mock` has two assert methods that are
 extremely handy: :meth:`~Mock.assert_called_with` and
 :meth:`~Mock.assert_called_once_with`.
 
@@ -2063,8 +2090,8 @@
 don't test how your units are "wired together" there is still lots of room
 for bugs that tests might have caught.
 
-`mock` already provides a feature to help with this, called speccing. If you
-use a class or instance as the `spec` for a mock then you can only access
+:mod:`mock` already provides a feature to help with this, called speccing. If you
+use a class or instance as the :attr:`spec` for a mock then you can only access
 attributes on the mock that exist on the real class:
 
     >>> from urllib import request
@@ -2083,9 +2110,9 @@
     <mock.Mock object at 0x...>
     >>> mock.has_data.assret_called_with()
 
-Auto-speccing solves this problem. You can either pass `autospec=True` to
-`patch` / `patch.object` or use the `create_autospec` function to create a
-mock with a spec. If you use the `autospec=True` argument to `patch` then the
+Auto-speccing solves this problem. You can either pass ``autospec=True`` to
+:func:`patch` / :func:`patch.object` or use the :func:`create_autospec` function to create a
+mock with a spec. If you use the ``autospec=True`` argument to :func:`patch` then the
 object that is being replaced will be used as the spec object. Because the
 speccing is done "lazily" (the spec is created as attributes on the mock are
 accessed) you can use it with very complex or deeply nested objects (like
@@ -2102,8 +2129,8 @@
     >>> mock_request.Request
     <MagicMock name='request.Request' spec='Request' id='...'>
 
-You can see that `request.Request` has a spec. `request.Request` takes two
-arguments in the constructor (one of which is `self`). Here's what happens if
+You can see that :class:`request.Request` has a spec. :class:`request.Request` takes two
+arguments in the constructor (one of which is *self*). Here's what happens if
 we try to call it incorrectly:
 
     >>> req = request.Request()
@@ -2118,8 +2145,8 @@
     >>> req
     <NonCallableMagicMock name='request.Request()' spec='Request' id='...'>
 
-`Request` objects are not callable, so the return value of instantiating our
-mocked out `request.Request` is a non-callable mock. With the spec in place
+:class:`Request` objects are not callable, so the return value of instantiating our
+mocked out :class:`request.Request` is a non-callable mock. With the spec in place
 any typos in our asserts will raise the correct error:
 
     >>> req.add_header('spam', 'eggs')
@@ -2130,11 +2157,11 @@
     AttributeError: Mock object has no attribute 'assret_called_with'
     >>> req.add_header.assert_called_with('spam', 'eggs')
 
-In many cases you will just be able to add `autospec=True` to your existing
-`patch` calls and then be protected against bugs due to typos and api
+In many cases you will just be able to add ``autospec=True`` to your existing
+:func:`patch` calls and then be protected against bugs due to typos and api
 changes.
 
-As well as using `autospec` through `patch` there is a
+As well as using *autospec* through :func:`patch` there is a
 :func:`create_autospec` for creating autospecced mocks directly:
 
     >>> from urllib import request
@@ -2152,8 +2179,8 @@
 objects so that introspection is safe [#]_.
 
 A more serious problem is that it is common for instance attributes to be
-created in the `__init__` method and not to exist on the class at all.
-`autospec` can't know about any dynamically created attributes and restricts
+created in the :meth:`__init__` method and not to exist on the class at all.
+*autospec* can't know about any dynamically created attributes and restricts
 the api to visible attributes.
 
     >>> class Something:
@@ -2170,7 +2197,7 @@
 
 There are a few different ways of resolving this problem. The easiest, but
 not necessarily the least annoying, way is to simply set the required
-attributes on the mock after creation. Just because `autospec` doesn't allow
+attributes on the mock after creation. Just because *autospec* doesn't allow
 you to fetch attributes that don't exist on the spec it doesn't prevent you
 setting them:
 
@@ -2179,7 +2206,7 @@
     ...   thing.a = 33
     ...
 
-There is a more aggressive version of both `spec` and `autospec` that *does*
+There is a more aggressive version of both *spec* and *autospec* that *does*
 prevent you setting non-existent attributes. This is useful if you want to
 ensure your code only *sets* valid attributes too, but obviously it prevents
 this particular scenario:
@@ -2193,8 +2220,8 @@
     AttributeError: Mock object has no attribute 'a'
 
 Probably the best way of solving the problem is to add class attributes as
-default values for instance members initialised in `__init__`. Note that if
-you are only setting default attributes in `__init__` then providing them via
+default values for instance members initialised in :meth:`__init__`. Note that if
+you are only setting default attributes in :meth:`__init__` then providing them via
 class attributes (shared between instances of course) is faster too. e.g.
 
 .. code-block:: python
@@ -2203,12 +2230,12 @@
         a = 33
 
 This brings up another issue. It is relatively common to provide a default
-value of `None` for members that will later be an object of a different type.
-`None` would be useless as a spec because it wouldn't let you access *any*
-attributes or methods on it. As `None` is *never* going to be useful as a
+value of ``None`` for members that will later be an object of a different type.
+``None`` would be useless as a spec because it wouldn't let you access *any*
+attributes or methods on it. As ``None`` is *never* going to be useful as a
 spec, and probably indicates a member that will normally of some other type,
-`autospec` doesn't use a spec for members that are set to `None`. These will
-just be ordinary mocks (well - `MagicMocks`):
+autospec doesn't use a spec for members that are set to ``None``. These will
+just be ordinary mocks (well - MagicMocks):
 
     >>> class Something:
     ...     member = None
@@ -2222,8 +2249,8 @@
 spec rather than the class. The other is to create a subclass of the
 production class and add the defaults to the subclass without affecting the
 production class. Both of these require you to use an alternative object as
-the spec. Thankfully `patch` supports this - you can simply pass the
-alternative object as the `autospec` argument:
+the spec. Thankfully :func:`patch` supports this - you can simply pass the
+alternative object as the *autospec* argument:
 
     >>> class Something:
     ...   def __init__(self):
@@ -2240,5 +2267,5 @@
 
 .. [#] This only applies to classes or already instantiated objects. Calling
    a mocked class to create a mock instance *does not* create a real instance.
-   It is only attribute lookups - along with calls to `dir` - that are done.
+   It is only attribute lookups - along with calls to :func:`dir` - that are done.
 
diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst
index fdc9409..c65a99d 100644
--- a/Doc/library/unittest.rst
+++ b/Doc/library/unittest.rst
@@ -51,11 +51,11 @@
       Kent Beck's original paper on testing frameworks using the pattern shared
       by :mod:`unittest`.
 
-   `Nose <http://code.google.com/p/python-nose/>`_ and `py.test <http://pytest.org>`_
+   `Nose <https://nose.readthedocs.org/en/latest/>`_ and `py.test <http://pytest.org>`_
       Third-party unittest frameworks with a lighter-weight syntax for writing
       tests.  For example, ``assert func(10) == 42``.
 
-   `The Python Testing Tools Taxonomy <http://wiki.python.org/moin/PythonTestingToolsTaxonomy>`_
+   `The Python Testing Tools Taxonomy <https://wiki.python.org/moin/PythonTestingToolsTaxonomy>`_
       An extensive list of Python testing tools including functional testing
       frameworks and mock object libraries.
 
@@ -67,7 +67,7 @@
    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
-   `Buildbot <http://buildbot.net/trac>`_, `Jenkins <http://jenkins-ci.org>`_
+   `Buildbot <http://buildbot.net/>`_, `Jenkins <http://jenkins-ci.org/>`_
    or  `Hudson <http://hudson-ci.org/>`_.
 
 
@@ -239,9 +239,10 @@
 
 Unittest supports simple test discovery. In order to be compatible with test
 discovery, all of the test files must be :ref:`modules <tut-modules>` or
-:ref:`packages <tut-packages>` importable from the top-level directory of
-the project (this means that their filenames must be valid
-:ref:`identifiers <identifiers>`).
+:ref:`packages <tut-packages>` (including :term:`namespace packages
+<namespace package>`) importable from the top-level directory of
+the project (this means that their filenames must be valid :ref:`identifiers
+<identifiers>`).
 
 Test discovery is implemented in :meth:`TestLoader.discover`, but can also be
 used from the command line. The basic command-line usage is::
@@ -306,6 +307,9 @@
 Test modules and packages can customize test loading and discovery by through
 the `load_tests protocol`_.
 
+.. versionchanged:: 3.4
+   Test discovery supports :term:`namespace packages <namespace package>`.
+
 
 .. _organizing-tests:
 
@@ -559,8 +563,71 @@
    Usually you can use :meth:`TestCase.skipTest` or one of the skipping
    decorators instead of raising this directly.
 
-Skipped tests will not have :meth:`setUp` or :meth:`tearDown` run around them.
-Skipped classes will not have :meth:`setUpClass` or :meth:`tearDownClass` run.
+Skipped tests will not have :meth:`~TestCase.setUp` or :meth:`~TestCase.tearDown` run around them.
+Skipped classes will not have :meth:`~TestCase.setUpClass` or :meth:`~TestCase.tearDownClass` run.
+Skipped modules will not have :func:`setUpModule` or :func:`tearDownModule` run.
+
+
+.. _subtests:
+
+Distinguishing test iterations using subtests
+---------------------------------------------
+
+.. versionadded:: 3.4
+
+When some of your tests differ only by a some very small differences, for
+instance some parameters, unittest allows you to distinguish them inside
+the body of a test method using the :meth:`~TestCase.subTest` context manager.
+
+For example, the following test::
+
+   class NumbersTest(unittest.TestCase):
+
+       def test_even(self):
+           """
+           Test that numbers between 0 and 5 are all even.
+           """
+           for i in range(0, 6):
+               with self.subTest(i=i):
+                   self.assertEqual(i % 2, 0)
+
+will produce the following output::
+
+   ======================================================================
+   FAIL: test_even (__main__.NumbersTest) (i=1)
+   ----------------------------------------------------------------------
+   Traceback (most recent call last):
+     File "subtests.py", line 32, in test_even
+       self.assertEqual(i % 2, 0)
+   AssertionError: 1 != 0
+
+   ======================================================================
+   FAIL: test_even (__main__.NumbersTest) (i=3)
+   ----------------------------------------------------------------------
+   Traceback (most recent call last):
+     File "subtests.py", line 32, in test_even
+       self.assertEqual(i % 2, 0)
+   AssertionError: 1 != 0
+
+   ======================================================================
+   FAIL: test_even (__main__.NumbersTest) (i=5)
+   ----------------------------------------------------------------------
+   Traceback (most recent call last):
+     File "subtests.py", line 32, in test_even
+       self.assertEqual(i % 2, 0)
+   AssertionError: 1 != 0
+
+Without using a subtest, execution would stop after the first failure,
+and the error would be less easy to diagnose because the value of ``i``
+wouldn't be displayed::
+
+   ======================================================================
+   FAIL: test_even (__main__.NumbersTest)
+   ----------------------------------------------------------------------
+   Traceback (most recent call last):
+     File "subtests.py", line 32, in test_even
+       self.assertEqual(i % 2, 0)
+   AssertionError: 1 != 0
 
 
 .. _unittest-contents:
@@ -607,9 +674,9 @@
    .. method:: setUp()
 
       Method called to prepare the test fixture.  This is called immediately
-      before calling the test method; any exception raised by this method will
-      be considered an error rather than a test failure. The default
-      implementation does nothing.
+      before calling the test method; other than :exc:`AssertionError` or :exc:`SkipTest`,
+      any exception raised by this method will be considered an error rather than
+      a test failure. The default implementation does nothing.
 
 
    .. method:: tearDown()
@@ -617,10 +684,10 @@
       Method called immediately after the test method has been called and the
       result recorded.  This is called even if the test method raised an
       exception, so the implementation in subclasses may need to be particularly
-      careful about checking internal state.  Any exception raised by this
-      method will be considered an error rather than a test failure.  This
-      method will only be called if the :meth:`setUp` succeeds, regardless of
-      the outcome of the test method. The default implementation does nothing.
+      careful about checking internal state.  Any exception, other than :exc:`AssertionError`
+      or :exc:`SkipTest`, raised by this method will be considered an error rather than a
+      test failure.  This method will only be called if the :meth:`setUp` succeeds,
+      regardless of the outcome of the test method. The default implementation does nothing.
 
 
    .. method:: setUpClass()
@@ -676,6 +743,21 @@
       .. versionadded:: 3.1
 
 
+   .. method:: subTest(msg=None, **params)
+
+      Return a context manager which executes the enclosed code block as a
+      subtest.  *msg* and *params* are optional, arbitrary values which are
+      displayed whenever a subtest fails, allowing you to identify them
+      clearly.
+
+      A test case can contain any number of subtest declarations, and
+      they can be arbitrarily nested.
+
+      See :ref:`subtests` for more information.
+
+      .. versionadded:: 3.4
+
+
    .. method:: debug()
 
       Run the test without collecting the result.  This allows exceptions raised
@@ -806,8 +888,8 @@
 
 
 
-   It is also possible to check that exceptions and warnings are raised using
-   the following methods:
+   It is also possible to check the production of exceptions, warnings and
+   log messages using the following methods:
 
    +---------------------------------------------------------+--------------------------------------+------------+
    | Method                                                  | Checks that                          | New in     |
@@ -824,6 +906,9 @@
    | :meth:`assertWarnsRegex(warn, r, fun, *args, **kwds)    | ``fun(*args, **kwds)`` raises *warn* | 3.2        |
    | <TestCase.assertWarnsRegex>`                            | and the message matches regex *r*    |            |
    +---------------------------------------------------------+--------------------------------------+------------+
+   | :meth:`assertLogs(logger, level)                        | The ``with`` block logs on *logger*  | 3.4        |
+   | <TestCase.assertLogs>`                                  | with minimum *level*                 |            |
+   +---------------------------------------------------------+--------------------------------------+------------+
 
    .. method:: assertRaises(exception, callable, *args, **kwds)
                assertRaises(exception, msg=None)
@@ -954,6 +1039,47 @@
       .. versionchanged:: 3.3
          Added the *msg* keyword argument when used as a context manager.
 
+   .. method:: assertLogs(logger=None, level=None)
+
+      A context manager to test that at least one message is logged on
+      the *logger* or one of its children, with at least the given
+      *level*.
+
+      If given, *logger* should be a :class:`logging.Logger` object or a
+      :class:`str` giving the name of a logger.  The default is the root
+      logger, which will catch all messages.
+
+      If given, *level* should be either a numeric logging level or
+      its string equivalent (for example either ``"ERROR"`` or
+      :attr:`logging.ERROR`).  The default is :attr:`logging.INFO`.
+
+      The test passes if at least one message emitted inside the ``with``
+      block matches the *logger* and *level* conditions, otherwise it fails.
+
+      The object returned by the context manager is a recording helper
+      which keeps tracks of the matching log messages.  It has two
+      attributes:
+
+      .. attribute:: records
+
+         A list of :class:`logging.LogRecord` objects of the matching
+         log messages.
+
+      .. attribute:: output
+
+         A list of :class:`str` objects with the formatted output of
+         matching messages.
+
+      Example::
+
+         with self.assertLogs('foo', level='INFO') as cm:
+            logging.getLogger('foo').info('first message')
+            logging.getLogger('foo.bar').error('second message')
+         self.assertEqual(cm.output, ['INFO:foo:first message',
+                                      'ERROR:foo.bar:second message'])
+
+      .. versionadded:: 3.4
+
 
    There are also other methods used to perform more specific checks, such as:
 
@@ -1393,15 +1519,24 @@
 
       Tests grouped by a :class:`TestSuite` are always accessed by iteration.
       Subclasses can lazily provide tests by overriding :meth:`__iter__`. Note
-      that this method maybe called several times on a single suite
-      (for example when counting tests or comparing for equality)
-      so the tests returned must be the same for repeated iterations.
+      that this method may be called several times on a single suite (for
+      example when counting tests or comparing for equality) so the tests
+      returned by repeated iterations before :meth:`TestSuite.run` must be the
+      same for each call iteration. After :meth:`TestSuite.run`, callers should
+      not rely on the tests returned by this method unless the caller uses a
+      subclass that overrides :meth:`TestSuite._removeTestAtIndex` to preserve
+      test references.
 
       .. versionchanged:: 3.2
          In earlier versions the :class:`TestSuite` accessed tests directly rather
          than through iteration, so overriding :meth:`__iter__` wasn't sufficient
          for providing tests.
 
+      .. versionchanged:: 3.4
+         In earlier versions the :class:`TestSuite` held references to each
+         :class:`TestCase` after :meth:`TestSuite.run`. Subclasses can restore
+         that behavior by overriding :meth:`TestSuite._removeTestAtIndex`.
+
    In the typical usage of a :class:`TestSuite` object, the :meth:`run` method
    is invoked by a :class:`TestRunner` rather than by the end-user test harness.
 
@@ -1500,14 +1635,16 @@
       directory must be specified separately.
 
       If importing a module fails, for example due to a syntax error, then this
-      will be recorded as a single error and discovery will continue.
+      will be recorded as a single error and discovery will continue.  If the
+      import failure is due to :exc:`SkipTest` being raised, it will be recorded
+      as a skip instead of an error.
 
       If a test package name (directory with :file:`__init__.py`) matches the
       pattern then the package will be checked for a ``load_tests``
       function. If this exists then it will be called with *loader*, *tests*,
       *pattern*.
 
-      If load_tests exists then discovery does *not* recurse into the package,
+      If ``load_tests`` exists then discovery does *not* recurse into the package,
       ``load_tests`` is responsible for loading all tests in the package.
 
       The pattern is deliberately not stored as a loader attribute so that
@@ -1519,6 +1656,14 @@
 
       .. versionadded:: 3.2
 
+      .. versionchanged:: 3.4
+         Modules that raise :exc:`SkipTest` on import are recorded as skips,
+           not errors.
+         Discovery works for :term:`namespace packages <namespace package>`.
+         Paths are sorted before being imported so that execution order is
+           the same even if the underlying file system's ordering is not
+           dependent on file name.
+
 
    The following attributes of a :class:`TestLoader` can be configured either by
    subclassing or assignment on an instance:
@@ -1630,6 +1775,10 @@
       Return ``True`` if all tests run so far have passed, otherwise returns
       ``False``.
 
+      .. versionchanged:: 3.4
+         Returns ``False`` if there were any :attr:`unexpectedSuccesses`
+         from tests marked with the :func:`expectedFailure` decorator.
+
 
    .. method:: stop()
 
@@ -1658,14 +1807,14 @@
       Called after the test case *test* has been executed, regardless of the
       outcome.
 
-   .. method:: startTestRun(test)
+   .. method:: startTestRun()
 
       Called once before any tests are executed.
 
       .. versionadded:: 3.1
 
 
-   .. method:: stopTestRun(test)
+   .. method:: stopTestRun()
 
       Called once after all tests are executed.
 
@@ -1728,6 +1877,22 @@
       :attr:`unexpectedSuccesses` attribute.
 
 
+   .. method:: addSubTest(test, subtest, outcome)
+
+      Called when a subtest finishes.  *test* is the test case
+      corresponding to the test method.  *subtest* is a custom
+      :class:`TestCase` instance describing the subtest.
+
+      If *outcome* is :const:`None`, the subtest succeeded.  Otherwise,
+      it failed with an exception where *outcome* is a tuple of the form
+      returned by :func:`sys.exc_info`: ``(type, value, traceback)``.
+
+      The default implementation does nothing when the outcome is a
+      success, and records subtest failures as normal failures.
+
+      .. versionadded:: 3.4
+
+
 .. class:: TextTestResult(stream, descriptions, verbosity)
 
    A concrete implementation of :class:`TestResult` used by the
@@ -1783,6 +1948,14 @@
 
         stream, descriptions, verbosity
 
+   .. method:: run(test)
+
+      This method is the main public interface to the `TextTestRunner`. This
+      method takes a :class:`TestSuite` or :class:`TestCase` instance. A
+      :class:`TestResult` is created by calling
+      :func:`_makeResult` and the test(s) are run and the
+      results printed to stdout.
+
 
 .. function:: main(module='__main__', defaultTest=None, argv=None, testRunner=None, \
                    testLoader=unittest.defaultTestLoader, exit=True, verbosity=1, \
@@ -1802,9 +1975,10 @@
       if __name__ == '__main__':
           unittest.main(verbosity=2)
 
-   The *defaultTest* argument is the name of the test to run if no test names
-   are specified via *argv*.  If not specified or ``None`` and no test names are
-   provided via *argv*, all tests found in *module* are run.
+   The *defaultTest* argument is either the name of a single test or an
+   iterable of test names to run if no test names are specified via *argv*.  If
+   not specified or ``None`` and no test names are provided via *argv*, all
+   tests found in *module* are run.
 
    The *argv* argument can be a list of options passed to the program, with the
    first element being the program name.  If not specified or ``None``,
@@ -1842,6 +2016,10 @@
       The *verbosity*, *failfast*, *catchbreak*, *buffer*
       and *warnings* parameters were added.
 
+   .. versionchanged:: 3.4
+      The *defaultTest* parameter was changed to also accept an iterable of
+      test names.
+
 
 load_tests Protocol
 ###################
diff --git a/Doc/library/urllib.error.rst b/Doc/library/urllib.error.rst
index 25c13bd..f7f0c97 100644
--- a/Doc/library/urllib.error.rst
+++ b/Doc/library/urllib.error.rst
@@ -46,6 +46,13 @@
 
       This is usually a string explaining the reason for this error.
 
+   .. attribute:: headers
+
+      The HTTP response headers for the HTTP request that caused the
+      :exc:`HTTPError`.
+
+      .. versionadded:: 3.4
+
 .. exception:: ContentTooShortError(msg, content)
 
    This exception is raised when the :func:`~urllib.request.urlretrieve`
diff --git a/Doc/library/urllib.parse.rst b/Doc/library/urllib.parse.rst
index b951420..154a521 100644
--- a/Doc/library/urllib.parse.rst
+++ b/Doc/library/urllib.parse.rst
@@ -81,7 +81,8 @@
    this argument is the empty string.
 
    If the *allow_fragments* argument is false, fragment identifiers are not
-   allowed.  The default value for this argument is :const:`True`.
+   recognized and parsed as part of the preceding component.  The default value
+   for this argument is :const:`True`.
 
    The return value is actually an instance of a subclass of :class:`tuple`.  This
    class has the following additional read-only convenience attributes:
@@ -516,7 +517,7 @@
 .. function:: urlencode(query, doseq=False, safe='', encoding=None, errors=None)
 
    Convert a mapping object or a sequence of two-element tuples, which may
-   either be a :class:`str` or a :class:`bytes`,  to a "percent-encoded"
+   contain :class:`str` or :class:`bytes` objects, to a "percent-encoded"
    string.  If the resultant string is to be used as a *data* for POST
    operation with :func:`~urllib.request.urlopen` function, then it should be
    properly encoded to bytes, otherwise it would result in a :exc:`TypeError`.
@@ -531,8 +532,9 @@
    the value sequence for the key.  The order of parameters in the encoded
    string will match the order of parameter tuples in the sequence.
 
-   When *query* parameter is a :class:`str`, the *safe*, *encoding* and *error*
-   parameters are passed down to :func:`quote_plus` for encoding.
+   The *safe*, *encoding*, and *errors* parameters are passed down to
+   :func:`quote_plus` (the *encoding* and *errors* parameters are only passed
+   when a query element is a :class:`str`).
 
    To reverse this encoding process, :func:`parse_qs` and :func:`parse_qsl` are
    provided in this module to parse query strings into Python data structures.
diff --git a/Doc/library/urllib.request.rst b/Doc/library/urllib.request.rst
index 6493a29..249396e 100644
--- a/Doc/library/urllib.request.rst
+++ b/Doc/library/urllib.request.rst
@@ -16,7 +16,7 @@
 The :mod:`urllib.request` module defines the following functions:
 
 
-.. function:: urlopen(url, data=None[, timeout], *, cafile=None, capath=None, cadefault=False)
+.. function:: urlopen(url, data=None[, timeout], *, cafile=None, capath=None, cadefault=False, context=None)
 
    Open the URL *url*, which can be either a string or a
    :class:`Request` object.
@@ -47,21 +47,17 @@
    the global default timeout setting will be used).  This actually
    only works for HTTP, HTTPS and FTP connections.
 
+   If *context* is specified, it must be a :class:`ssl.SSLContext` instance
+   describing the various SSL options. See :class:`~http.client.HTTPSConnection`
+   for more details.
+
    The optional *cafile* and *capath* parameters specify a set of trusted
    CA certificates for HTTPS requests.  *cafile* should point to a single
    file containing a bundle of CA certificates, whereas *capath* should
    point to a directory of hashed certificate files.  More information can
    be found in :meth:`ssl.SSLContext.load_verify_locations`.
 
-   The *cadefault* parameter specifies whether to fall back to loading a
-   default certificate store defined by the underlying OpenSSL library if the
-   *cafile* and *capath* parameters are omitted.  This will only work on
-   some non-Windows platforms.
-
-   .. warning::
-      If neither *cafile* nor *capath* is specified, and *cadefault* is ``False``,
-      an HTTPS request will not do any verification of the server's
-      certificate.
+   The *cadefault* parameter is ignored.
 
    For http and https urls, this function returns a
    :class:`http.client.HTTPResponse` object which has the following
@@ -111,6 +107,9 @@
    .. versionchanged:: 3.3
       *cadefault* was added.
 
+   .. versionchanged:: 3.4.3
+      *context* was added.
+
 .. function:: install_opener(opener)
 
    Install an :class:`OpenerDirector` instance as the default global opener.
@@ -218,12 +217,17 @@
    fetching of the image, this should be true.
 
    *method* should be a string that indicates the HTTP request method that
-   will be used (e.g. ``'HEAD'``).  Its value is stored in the
+   will be used (e.g. ``'HEAD'``).  If provided, its value is stored in the
    :attr:`~Request.method` attribute and is used by :meth:`get_method()`.
+   Subclasses may indicate a default method by setting the
+   :attr:`~Request.method` attribute in the class itself.
 
    .. versionchanged:: 3.3
       :attr:`Request.method` argument is added to the Request class.
 
+   .. versionchanged:: 3.4
+      Default :attr:`Request.method` may be indicated at the class level.
+
 
 .. class:: OpenerDirector()
 
@@ -356,6 +360,11 @@
 
    Open local files.
 
+.. class:: DataHandler()
+
+   Open data URLs.
+
+   .. versionadded:: 3.4
 
 .. class:: FTPHandler()
 
@@ -391,6 +400,12 @@
 
    The original URL passed to the constructor.
 
+   .. versionchanged:: 3.4
+
+   Request.full_url is a property with setter, getter and a deleter. Getting
+   :attr:`~Request.full_url` returns the original request URL with the
+   fragment, if it was present.
+
 .. attribute:: Request.type
 
    The URI scheme.
@@ -413,6 +428,10 @@
 
    The entity body for the request, or None if not specified.
 
+   .. versionchanged:: 3.4
+      Changing value of :attr:`Request.data` now deletes "Content-Length"
+      header if it was previously set or calculated.
+
 .. attribute:: Request.unverifiable
 
    boolean, indicates whether the request is unverifiable as defined
@@ -420,13 +439,20 @@
 
 .. attribute:: Request.method
 
-   The HTTP request method to use.  This value is used by
-   :meth:`~Request.get_method` to override the computed HTTP request
-   method that would otherwise be returned.  This attribute is initialized with
-   the value of the *method* argument passed to the constructor.
+   The HTTP request method to use.  By default its value is :const:`None`,
+   which means that :meth:`~Request.get_method` will do its normal computation
+   of the method to be used.  Its value can be set (thus overriding the default
+   computation in :meth:`~Request.get_method`) either by providing a default
+   value by setting it at the class level in a :class:`Request` subclass, or by
+   passing a value in to the :class:`Request` constructor via the *method*
+   argument.
 
    .. versionadded:: 3.3
 
+   .. versionchanged:: 3.4
+      A default value can now be set in subclasses; previously it could only
+      be set via the constructor argument.
+
 
 .. method:: Request.get_method()
 
@@ -461,10 +487,22 @@
    unredirected).
 
 
+.. method:: Request.remove_header(header)
+
+   Remove named header from the request instance (both from regular and
+   unredirected headers).
+
+   .. versionadded:: 3.4
+
+
 .. method:: Request.get_full_url()
 
    Return the URL given in the constructor.
 
+   .. versionchanged:: 3.4
+
+   Returns :attr:`Request.full_url`
+
 
 .. method:: Request.set_proxy(host, type)
 
@@ -473,54 +511,6 @@
    URL given in the constructor.
 
 
-.. method:: Request.add_data(data)
-
-   Set the :class:`Request` data to *data*.  This is ignored by all handlers except
-   HTTP handlers --- and there it should be a byte string, and will change the
-   request to be ``POST`` rather than ``GET``.  Deprecated in 3.3, use
-   :attr:`Request.data`.
-
-   .. deprecated-removed:: 3.3 3.4
-
-
-.. method:: Request.has_data()
-
-   Return whether the instance has a non-\ ``None`` data. Deprecated in 3.3,
-   use :attr:`Request.data`.
-
-   .. deprecated-removed:: 3.3 3.4
-
-
-.. method:: Request.get_data()
-
-   Return the instance's data.  Deprecated in 3.3, use :attr:`Request.data`.
-
-   .. deprecated-removed:: 3.3 3.4
-
-
-.. method:: Request.get_type()
-
-   Return the type of the URL --- also known as the scheme.  Deprecated in 3.3,
-   use :attr:`Request.type`.
-
-   .. deprecated-removed:: 3.3 3.4
-
-
-.. method:: Request.get_host()
-
-   Return the host to which a connection will be made. Deprecated in 3.3, use
-   :attr:`Request.host`.
-
-   .. deprecated-removed:: 3.3 3.4
-
-
-.. method:: Request.get_selector()
-
-   Return the selector --- the part of the URL that is sent to the server.
-   Deprecated in 3.3, use :attr:`Request.selector`.
-
-   .. deprecated-removed:: 3.3 3.4
-
 .. method:: Request.get_header(header_name, default=None)
 
    Return the value of the given header. If the header is not present, return
@@ -531,25 +521,10 @@
 
    Return a list of tuples (header_name, header_value) of the Request headers.
 
-
-.. method:: Request.set_proxy(host, type)
-
-.. method:: Request.get_origin_req_host()
-
-   Return the request-host of the origin transaction, as defined by
-   :rfc:`2965`.  See the documentation for the :class:`Request` constructor.
-   Deprecated in 3.3, use :attr:`Request.origin_req_host`.
-
-   .. deprecated-removed:: 3.3 3.4
-
-
-.. method:: Request.is_unverifiable()
-
-   Return whether the request is unverifiable, as defined by RFC 2965. See the
-   documentation for the :class:`Request` constructor.  Deprecated in 3.3, use
-   :attr:`Request.unverifiable`.
-
-   .. deprecated-removed:: 3.3 3.4
+.. versionchanged:: 3.4
+   The request methods add_data, has_data, get_data, get_type, get_host,
+   get_selector, get_origin_req_host and is_unverifiable that were deprecated
+   since 3.3 have been removed.
 
 
 .. _opener-director-objects:
@@ -983,6 +958,21 @@
       hostname is given, an :exc:`~urllib.error.URLError` is raised.
 
 
+.. _data-handler-objects:
+
+DataHandler Objects
+-------------------
+
+.. method:: DataHandler.data_open(req)
+
+   Read a data URL. This kind of URL contains the content encoded in the URL
+   itself. The data URL syntax is specified in :rfc:`2397`. This implementation
+   ignores white spaces in base64 encoded data URLs so the URL may be wrapped
+   in whatever source file it comes from. But even though some browsers don't
+   mind about a missing padding at the end of a base64 encoded data URL, this
+   implementation will raise an :exc:`ValueError` in that case.
+
+
 .. _ftp-handler-objects:
 
 FTPHandler Objects
@@ -1398,7 +1388,9 @@
      pair: FTP; protocol
 
 * Currently, only the following protocols are supported: HTTP (versions 0.9 and
-  1.0), FTP, and local files.
+  1.0), FTP, local files, and data URLs.
+
+  .. versionchanged:: 3.4 Added support for data URLs.
 
 * The caching feature of :func:`urlretrieve` has been disabled until someone
   finds the time to hack proper processing of Expiration time headers.
diff --git a/Doc/library/venv.rst b/Doc/library/venv.rst
index be0cad4..e9ede8b 100644
--- a/Doc/library/venv.rst
+++ b/Doc/library/venv.rst
@@ -76,6 +76,8 @@
    without there needing to be any reference to its venv in ``PATH``.
 
 
+.. _venv-api:
+
 API
 ---
 
@@ -85,7 +87,8 @@
 mechanisms for third-party virtual environment creators to customize environment
 creation according to their needs, the :class:`EnvBuilder` class.
 
-.. class:: EnvBuilder(system_site_packages=False, clear=False, symlinks=False, upgrade=False)
+.. class:: EnvBuilder(system_site_packages=False, clear=False, \
+                      symlinks=False, upgrade=False, with_pip=False)
 
     The :class:`EnvBuilder` class accepts the following keyword arguments on
     instantiation:
@@ -93,8 +96,8 @@
     * ``system_site_packages`` -- a Boolean value indicating that the system Python
       site-packages should be available to the environment (defaults to ``False``).
 
-    * ``clear`` -- a Boolean value which, if true, will delete any existing target
-      directory instead of raising an exception (defaults to ``False``).
+    * ``clear`` -- a Boolean value which, if true, will delete the contents of
+      any existing target directory, before creating the environment.
 
     * ``symlinks`` -- a Boolean value indicating whether to attempt to symlink the
       Python binary (and any necessary DLLs or other binaries,
@@ -105,6 +108,12 @@
       environment with the running Python - for use when that Python has been
       upgraded in-place (defaults to ``False``).
 
+    * ``with_pip`` -- a Boolean value which, if true, ensures pip is
+      installed in the virtual environment. This uses :mod:`ensurepip` with
+      the ``--default-pip`` option.
+
+    .. versionchanged:: 3.4
+       Added the ``with_pip`` parameter
 
 
     Creators of third-party virtual environment tools will be free to use the
@@ -188,6 +197,9 @@
         * ``__VENV_NAME__`` is replaced with the environment name (final path
           segment of environment directory).
 
+        * ``__VENV_PROMPT__`` is replaced with the prompt (the environment
+          name surrounded by parentheses and with a following space)
+
         * ``__VENV_BIN_NAME__`` is replaced with the name of the bin directory
           (either ``bin`` or ``Scripts``).
 
@@ -199,11 +211,15 @@
 
 There is also a module-level convenience function:
 
-.. function:: create(env_dir, system_site_packages=False, clear=False, symlinks=False)
+.. function:: create(env_dir, system_site_packages=False, clear=False, \
+                     symlinks=False, with_pip=False)
 
     Create an :class:`EnvBuilder` with the given keyword arguments, and call its
     :meth:`~EnvBuilder.create` method with the *env_dir* argument.
 
+    .. versionchanged:: 3.4
+       Added the ``with_pip`` parameter
+
 An example of extending ``EnvBuilder``
 --------------------------------------
 
diff --git a/Doc/library/wave.rst b/Doc/library/wave.rst
index afafb45..ab64978 100644
--- a/Doc/library/wave.rst
+++ b/Doc/library/wave.rst
@@ -19,26 +19,32 @@
 .. function:: open(file, mode=None)
 
    If *file* is a string, open the file by that name, otherwise treat it as a
-   seekable file-like object.  *mode* can be any of
+   file-like object.  *mode* can be:
 
-   ``'r'``, ``'rb'``
+   ``'rb'``
       Read only mode.
 
-   ``'w'``, ``'wb'``
+   ``'wb'``
       Write only mode.
 
    Note that it does not allow read/write WAV files.
 
-   A *mode* of ``'r'`` or ``'rb'`` returns a :class:`Wave_read` object, while a
-   *mode* of ``'w'`` or ``'wb'`` returns a :class:`Wave_write` object.  If
-   *mode* is omitted and a file-like object is passed as *file*, ``file.mode``
-   is used as the default value for *mode* (the ``'b'`` flag is still added if
-   necessary).
+   A *mode* of ``'rb'`` returns a :class:`Wave_read` object, while a *mode* of
+   ``'wb'`` returns a :class:`Wave_write` object.  If *mode* is omitted and a
+   file-like object is passed as *file*, ``file.mode`` is used as the default
+   value for *mode*.
 
    If you pass in a file-like object, the wave object will not close it when its
    :meth:`close` method is called; it is the caller's responsibility to close
    the file object.
 
+   The :func:`.open` function may be used in a :keyword:`with` statement.  When
+   the :keyword:`with` block completes, the :meth:`Wave_read.close()
+   <wave.Wave_read.close>` or :meth:`Wave_write.close()
+   <wave.Wave_write.close()>` method is called.
+
+   .. versionchanged:: 3.4
+      Added support for unseekable files.
 
 .. function:: openfp(file, mode)
 
@@ -98,8 +104,9 @@
 
 .. method:: Wave_read.getparams()
 
-   Returns a tuple ``(nchannels, sampwidth, framerate, nframes, comptype,
-   compname)``, equivalent to output of the :meth:`get\*` methods.
+   Returns a :func:`~collections.namedtuple` ``(nchannels, sampwidth,
+   framerate, nframes, comptype, compname)``, equivalent to output of the
+   :meth:`get\*` methods.
 
 
 .. method:: Wave_read.readframes(n)
@@ -143,13 +150,30 @@
 Wave_write Objects
 ------------------
 
+For seekable output streams, the ``wave`` header will automatically be updated
+to reflect the number of frames actually written.  For unseekable streams, the
+*nframes* value must be accurate when the first frame data is written.  An
+accurate *nframes* value can be achieved either by calling
+:meth:`~Wave_write.setnframes` or :meth:`~Wave_write.setparams` with the number
+of frames that will be written before :meth:`~Wave_write.close` is called and
+then using :meth:`~Wave_write.writeframesraw` to write the frame data, or by
+calling :meth:`~Wave_write.writeframes` with all of the frame data to be
+written.  In the latter case :meth:`~Wave_write.writeframes` will calculate
+the number of frames in the data and set *nframes* accordingly before writing
+the frame data.
+
 Wave_write objects, as returned by :func:`.open`, have the following methods:
 
+.. versionchanged:: 3.4
+   Added support for unseekable files.
+
 
 .. method:: Wave_write.close()
 
    Make sure *nframes* is correct, and close the file if it was opened by
-   :mod:`wave`.  This method is called upon object collection.
+   :mod:`wave`.  This method is called upon object collection.  It will raise
+   an exception if the output stream is not seekable and *nframes* does not
+   match the number of frames actually written.
 
 
 .. method:: Wave_write.setnchannels(n)
@@ -173,8 +197,9 @@
 
 .. method:: Wave_write.setnframes(n)
 
-   Set the number of frames to *n*. This will be changed later if more frames are
-   written.
+   Set the number of frames to *n*.  This will be changed later if the number
+   of frames actually written is different (this update attempt will
+   raise an error if the output stream is not seekable).
 
 
 .. method:: Wave_write.setcomptype(type, name)
@@ -200,10 +225,19 @@
 
    Write audio frames, without correcting *nframes*.
 
+   .. versionchanged:: 3.4
+      Any :term:`bytes-like object` is now accepted.
+
 
 .. method:: Wave_write.writeframes(data)
 
-   Write audio frames and make sure *nframes* is correct.
+   Write audio frames and make sure *nframes* is correct.  It will raise an
+   error if the output stream is not seekable and the total number of frames
+   that have been written after *data* has been written does not match the
+   previously set value for *nframes*.
+
+   .. versionchanged:: 3.4
+      Any :term:`bytes-like object` is now accepted.
 
 
 Note that it is invalid to set any parameters after calling :meth:`writeframes`
diff --git a/Doc/library/weakref.rst b/Doc/library/weakref.rst
index 224f442..9ca60a9 100644
--- a/Doc/library/weakref.rst
+++ b/Doc/library/weakref.rst
@@ -51,10 +51,16 @@
 but keeps weak references to its elements, just like a
 :class:`WeakKeyDictionary` does.
 
-Most programs should find that using one of these weak container types is all
-they need -- it's not usually necessary to create your own weak references
-directly.  The low-level machinery used by the weak dictionary implementations
-is exposed by the :mod:`weakref` module for the benefit of advanced uses.
+:class:`finalize` provides a straight forward way to register a
+cleanup function to be called when an object is garbage collected.
+This is simpler to use than setting up a callback function on a raw
+weak reference, since the module automatically ensures that the finalizer
+remains alive until the object is collected.
+
+Most programs should find that using one of these weak container types
+or :class:`finalize` is all they need -- it's not usually necessary to
+create your own weak references directly.  The low-level machinery is
+exposed by the :mod:`weakref` module for the benefit of advanced uses.
 
 Not all objects can be weakly referenced; those objects which can include class
 instances, functions written in Python (but not in C), instance methods, sets,
@@ -111,6 +117,15 @@
 
    This is a subclassable type rather than a factory function.
 
+   .. attribute:: __callback__
+
+      This read-only attribute returns the callback currently associated to the
+      weakref.  If there is no callback or if the referent of the weakref is
+      no longer alive then this attribute will have value ``None``.
+
+   .. versionchanged:: 3.4
+      Added the :attr:`__callback__` attribute.
+
 
 .. function:: proxy(object[, callback])
 
@@ -192,6 +207,98 @@
    discarded when no strong reference to it exists any more.
 
 
+.. class:: WeakMethod(method)
+
+   A custom :class:`ref` subclass which simulates a weak reference to a bound
+   method (i.e., a method defined on a class and looked up on an instance).
+   Since a bound method is ephemeral, a standard weak reference cannot keep
+   hold of it.  :class:`WeakMethod` has special code to recreate the bound
+   method until either the object or the original function dies::
+
+      >>> class C:
+      ...     def method(self):
+      ...         print("method called!")
+      ...
+      >>> c = C()
+      >>> r = weakref.ref(c.method)
+      >>> r()
+      >>> r = weakref.WeakMethod(c.method)
+      >>> r()
+      <bound method C.method of <__main__.C object at 0x7fc859830220>>
+      >>> r()()
+      method called!
+      >>> del c
+      >>> gc.collect()
+      0
+      >>> r()
+      >>>
+
+   .. versionadded:: 3.4
+
+.. class:: finalize(obj, func, *args, **kwargs)
+
+   Return a callable finalizer object which will be called when *obj*
+   is garbage collected. Unlike an ordinary weak reference, a finalizer
+   will always survive until the reference object is collected, greatly
+   simplifying lifecycle management.
+
+   A finalizer is considered *alive* until it is called (either explicitly
+   or at garbage collection), and after that it is *dead*.  Calling a live
+   finalizer returns the result of evaluating ``func(*arg, **kwargs)``,
+   whereas calling a dead finalizer returns :const:`None`.
+
+   Exceptions raised by finalizer callbacks during garbage collection
+   will be shown on the standard error output, but cannot be
+   propagated.  They are handled in the same way as exceptions raised
+   from an object's :meth:`__del__` method or a weak reference's
+   callback.
+
+   When the program exits, each remaining live finalizer is called
+   unless its :attr:`atexit` attribute has been set to false.  They
+   are called in reverse order of creation.
+
+   A finalizer will never invoke its callback during the later part of
+   the interpreter shutdown when module globals are liable to have
+   been replaced by :const:`None`.
+
+   .. method:: __call__()
+
+      If *self* is alive then mark it as dead and return the result of
+      calling ``func(*args, **kwargs)``.  If *self* is dead then return
+      :const:`None`.
+
+   .. method:: detach()
+
+      If *self* is alive then mark it as dead and return the tuple
+      ``(obj, func, args, kwargs)``.  If *self* is dead then return
+      :const:`None`.
+
+   .. method:: peek()
+
+      If *self* is alive then return the tuple ``(obj, func, args,
+      kwargs)``.  If *self* is dead then return :const:`None`.
+
+   .. attribute:: alive
+
+      Property which is true if the finalizer is alive, false otherwise.
+
+   .. attribute:: atexit
+
+      A writable boolean property which by default is true.  When the
+      program exits, it calls all remaining live finalizers for which
+      :attr:`.atexit` is true.  They are called in reverse order of
+      creation.
+
+   .. note::
+
+      It is important to ensure that *func*, *args* and *kwargs* do
+      not own any references to *obj*, either directly or indirectly,
+      since otherwise *obj* will never be garbage collected.  In
+      particular, *func* should not be a bound method of *obj*.
+
+   .. versionadded:: 3.4
+
+
 .. data:: ReferenceType
 
    The type object for weak references objects.
@@ -232,8 +339,9 @@
 Weak Reference Objects
 ----------------------
 
-Weak reference objects have no attributes or methods, but do allow the referent
-to be obtained, if it still exists, by calling it:
+Weak reference objects have no methods and no attributes besides
+:attr:`ref.__callback__`. A weak reference object allows the referent to be
+obtained, if it still exists, by calling it:
 
    >>> import weakref
    >>> class Object:
@@ -326,3 +434,140 @@
    def id2obj(oid):
        return _id2obj_dict[oid]
 
+
+.. _finalize-examples:
+
+Finalizer Objects
+-----------------
+
+The main benefit of using :class:`finalize` is that it makes it simple
+to register a callback without needing to preserve the returned finalizer
+object.  For instance
+
+    >>> import weakref
+    >>> class Object:
+    ...     pass
+    ...
+    >>> kenny = Object()
+    >>> weakref.finalize(kenny, print, "You killed Kenny!")  #doctest:+ELLIPSIS
+    <finalize object at ...; for 'Object' at ...>
+    >>> del kenny
+    You killed Kenny!
+
+The finalizer can be called directly as well.  However the finalizer
+will invoke the callback at most once.
+
+    >>> def callback(x, y, z):
+    ...     print("CALLBACK")
+    ...     return x + y + z
+    ...
+    >>> obj = Object()
+    >>> f = weakref.finalize(obj, callback, 1, 2, z=3)
+    >>> assert f.alive
+    >>> assert f() == 6
+    CALLBACK
+    >>> assert not f.alive
+    >>> f()                     # callback not called because finalizer dead
+    >>> del obj                 # callback not called because finalizer dead
+
+You can unregister a finalizer using its :meth:`~finalize.detach`
+method.  This kills the finalizer and returns the arguments passed to
+the constructor when it was created.
+
+    >>> obj = Object()
+    >>> f = weakref.finalize(obj, callback, 1, 2, z=3)
+    >>> f.detach()                                           #doctest:+ELLIPSIS
+    (<__main__.Object object ...>, <function callback ...>, (1, 2), {'z': 3})
+    >>> newobj, func, args, kwargs = _
+    >>> assert not f.alive
+    >>> assert newobj is obj
+    >>> assert func(*args, **kwargs) == 6
+    CALLBACK
+
+Unless you set the :attr:`~finalize.atexit` attribute to
+:const:`False`, a finalizer will be called when the program exits if it
+is still alive.  For instance
+
+    >>> obj = Object()
+    >>> weakref.finalize(obj, print, "obj dead or exiting")  #doctest:+ELLIPSIS
+    <finalize object at ...; for 'Object' at ...>
+    >>> exit()                                               #doctest:+SKIP
+    obj dead or exiting
+
+
+Comparing finalizers with :meth:`__del__` methods
+-------------------------------------------------
+
+Suppose we want to create a class whose instances represent temporary
+directories.  The directories should be deleted with their contents
+when the first of the following events occurs:
+
+* the object is garbage collected,
+* the object's :meth:`remove` method is called, or
+* the program exits.
+
+We might try to implement the class using a :meth:`__del__` method as
+follows::
+
+    class TempDir:
+        def __init__(self):
+            self.name = tempfile.mkdtemp()
+
+        def remove(self):
+            if self.name is not None:
+                shutil.rmtree(self.name)
+                self.name = None
+
+        @property
+        def removed(self):
+            return self.name is None
+
+        def __del__(self):
+            self.remove()
+
+Starting with Python 3.4, :meth:`__del__` methods no longer prevent
+reference cycles from being garbage collected, and module globals are
+no longer forced to :const:`None` during interpreter shutdown. So this
+code should work without any issues on CPython.
+
+However, handling of :meth:`__del__` methods is notoriously implementation
+specific, since it depends on internal details of the interpreter's garbage
+collector implementation.
+
+A more robust alternative can be to define a finalizer which only references
+the specific functions and objects that it needs, rather than having access
+to the full state of the object::
+
+    class TempDir:
+        def __init__(self):
+            self.name = tempfile.mkdtemp()
+            self._finalizer = weakref.finalize(self, shutil.rmtree, self.name)
+
+        def remove(self):
+            self._finalizer()
+
+        @property
+        def removed(self):
+            return not self._finalizer.alive
+
+Defined like this, our finalizer only receives a reference to the details
+it needs to clean up the directory appropriately. If the object never gets
+garbage collected the finalizer will still be called at exit.
+
+The other advantage of weakref based finalizers is that they can be used to
+register finalizers for classes where the definition is controlled by a
+third party, such as running code when a module is unloaded::
+
+    import weakref, sys
+    def unloading_module():
+        # implicit reference to the module globals from the function body
+    weakref.finalize(sys.modules[__name__], unloading_module)
+
+
+.. note::
+
+   If you create a finalizer object in a daemonic thread just as the
+   the program exits then there is the possibility that the finalizer
+   does not get called at exit.  However, in a daemonic thread
+   :func:`atexit.register`, ``try: ... finally: ...`` and ``with: ...``
+   do not guarantee that cleanup occurs either.
diff --git a/Doc/library/webbrowser.rst b/Doc/library/webbrowser.rst
index 9c2b3ab..ef63769 100644
--- a/Doc/library/webbrowser.rst
+++ b/Doc/library/webbrowser.rst
@@ -19,12 +19,12 @@
 available.  If text-mode browsers are used, the calling process will block until
 the user exits the browser.
 
-If the environment variable :envvar:`BROWSER` exists, it is interpreted to
-override the platform default list of browsers, as a :data:`os.pathsep`-separated
-list of browsers to try in order.  When the value of a list part contains the
-string ``%s``, then it is  interpreted as a literal browser command line to be
-used with the argument URL substituted for ``%s``; if the part does not contain
-``%s``, it is simply interpreted as the name of the browser to launch. [1]_
+If the environment variable :envvar:`BROWSER` exists, it is interpreted as the
+:data:`os.pathsep`-separated list of browsers to try ahead of the the platform
+defaults.  When the value of a list part contains the string ``%s``, then it is
+interpreted as a literal browser command line to be used with the argument URL
+substituted for ``%s``; if the part does not contain ``%s``, it is simply
+interpreted as the name of the browser to launch. [1]_
 
 For non-Unix platforms, or when a remote browser is available on Unix, the
 controlling process will not wait for the user to finish with the browser, but
diff --git a/Doc/library/winreg.rst b/Doc/library/winreg.rst
index 06bcb86..6c920b4 100644
--- a/Doc/library/winreg.rst
+++ b/Doc/library/winreg.rst
@@ -322,7 +322,7 @@
    +-------+---------------------------------------------+
    | ``2`` | An integer giving when the key was last     |
    |       | modified (if available) as 100's of         |
-   |       | nanoseconds since Jan 1, 1600.              |
+   |       | nanoseconds since Jan 1, 1601.              |
    +-------+---------------------------------------------+
 
 
diff --git a/Doc/library/xml.dom.minidom.rst b/Doc/library/xml.dom.minidom.rst
index 89c660a..ff5c270 100644
--- a/Doc/library/xml.dom.minidom.rst
+++ b/Doc/library/xml.dom.minidom.rst
@@ -252,4 +252,4 @@
    "UTF8" is not valid in an XML document's declaration, even though
    Python accepts it as an encoding name.
    See http://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EncodingDecl
-   and http://www.iana.org/assignments/character-sets\ .
+   and http://www.iana.org/assignments/character-sets/character-sets.xhtml.
diff --git a/Doc/library/xml.etree.elementtree.rst b/Doc/library/xml.etree.elementtree.rst
index 3f2dcbb..3263dc2a 100644
--- a/Doc/library/xml.etree.elementtree.rst
+++ b/Doc/library/xml.etree.elementtree.rst
@@ -105,6 +105,59 @@
    >>> root[0][1].text
    '2008'
 
+
+.. note::
+
+   Not all elements of the XML input will end up as elements of the
+   parsed tree. Currently, this module skips over any XML comments,
+   processing instructions, and document type declarations in the
+   input. Nevertheless, trees built using this module's API rather
+   than parsing from XML text can have comments and processing
+   instructions in them; they will be included when generating XML
+   output. A document type declaration may be accessed by passing a
+   custom :class:`TreeBuilder` instance to the :class:`XMLParser`
+   constructor.
+
+
+.. _elementtree-pull-parsing:
+
+Pull API for non-blocking parsing
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Most parsing functions provided by this module require the whole document
+to be read at once before returning any result.  It is possible to use an
+:class:`XMLParser` and feed data into it incrementally, but it is a push API that
+calls methods on a callback target, which is too low-level and inconvenient for
+most needs.  Sometimes what the user really wants is to be able to parse XML
+incrementally, without blocking operations, while enjoying the convenience of
+fully constructed :class:`Element` objects.
+
+The most powerful tool for doing this is :class:`XMLPullParser`.  It does not
+require a blocking read to obtain the XML data, and is instead fed with data
+incrementally with :meth:`XMLPullParser.feed` calls.  To get the parsed XML
+elements, call :meth:`XMLPullParser.read_events`.  Here is an example::
+
+   >>> parser = ET.XMLPullParser(['start', 'end'])
+   >>> parser.feed('<mytag>sometext')
+   >>> list(parser.read_events())
+   [('start', <Element 'mytag' at 0x7fa66db2be58>)]
+   >>> parser.feed(' more text</mytag>')
+   >>> for event, elem in parser.read_events():
+   ...   print(event)
+   ...   print(elem.tag, 'text=', elem.text)
+   ...
+   end
+
+The obvious use case is applications that operate in a non-blocking fashion
+where the XML data is being received from a socket or read incrementally from
+some storage device.  In such cases, blocking reads are unacceptable.
+
+Because it's so flexible, :class:`XMLPullParser` can be inconvenient to use for
+simpler use-cases.  If you don't mind your application blocking on reading XML
+data but would still like to have incremental parsing capabilities, take a look
+at :func:`iterparse`.  It can be useful when you're reading a large XML document
+and don't want to hold it wholly in memory.
+
 Finding interesting elements
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
@@ -285,7 +338,7 @@
 +=======================+======================================================+
 | ``tag``               | Selects all child elements with the given tag.       |
 |                       | For example, ``spam`` selects all child elements     |
-|                       | named ``spam``, ``spam/egg`` selects all             |
+|                       | named ``spam``, and ``spam/egg`` selects all         |
 |                       | grandchildren named ``egg`` in all children named    |
 |                       | ``spam``.                                            |
 +-----------------------+------------------------------------------------------+
@@ -341,6 +394,10 @@
    string containing the comment string.  Returns an element instance
    representing a comment.
 
+   Note that :class:`XMLParser` skips over comments in the input
+   instead of creating comment objects for them. An :class:`ElementTree` will
+   only contain comment nodes if they have been inserted into to
+   the tree using one of the :class:`Element` methods.
 
 .. function:: dump(elem)
 
@@ -379,25 +436,32 @@
 
    Parses an XML section into an element tree incrementally, and reports what's
    going on to the user.  *source* is a filename or :term:`file object`
-   containing XML data.  *events* is a tuple 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
+   containing XML data.  *events* is a sequence 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
-   :class:`XMLParser` parser is used.  *parser* can only use the default
-   :class:`TreeBuilder` as a target.  Returns an :term:`iterator` providing
-   ``(event, elem)`` pairs.
+   :class:`XMLParser` parser is used.  *parser* must be a subclass of
+   :class:`XMLParser` and can only use the default :class:`TreeBuilder` as a
+   target.  Returns an :term:`iterator` providing ``(event, elem)`` pairs.
+
+   Note that while :func:`iterparse` builds the tree incrementally, it issues
+   blocking reads on *source* (or the file it names).  As such, it's unsuitable
+   for applications where blocking reads can't be made.  For fully non-blocking
+   parsing, see :class:`XMLPullParser`.
 
    .. note::
 
-      :func:`iterparse` only guarantees that it has seen the ">"
-      character of a starting tag when it emits a "start" event, so the
-      attributes are defined, but the contents of the text and tail attributes
-      are undefined at that point.  The same applies to the element children;
-      they may or may not be present.
+      :func:`iterparse` only guarantees that it has seen the ">" character of a
+      starting tag when it emits a "start" event, so the attributes are defined,
+      but the contents of the text and tail attributes are undefined at that
+      point.  The same applies to the element children; they may or may not be
+      present.
 
       If you need a fully populated element, look for "end" events instead.
 
+   .. deprecated:: 3.4
+      The *parser* argument.
 
 .. function:: parse(source, parser=None)
 
@@ -414,6 +478,11 @@
    containing the PI target.  *text* is a string containing the PI contents, if
    given.  Returns an element instance, representing a processing instruction.
 
+   Note that :class:`XMLParser` skips over processing instructions
+   in the input instead of creating comment objects for them. An
+   :class:`ElementTree` will only contain processing instruction nodes if
+   they have been inserted into to the tree using one of the
+   :class:`Element` methods.
 
 .. function:: register_namespace(prefix, uri)
 
@@ -438,29 +507,39 @@
    arguments.  Returns an element instance.
 
 
-.. function:: tostring(element, encoding="us-ascii", method="xml")
+.. function:: tostring(element, encoding="us-ascii", method="xml", *, \
+                       short_empty_elements=True)
 
    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 (otherwise, a bytestring is generated).  *method*
    is either ``"xml"``, ``"html"`` or ``"text"`` (default is ``"xml"``).
+   *short_empty_elements* has the same meaning as in :meth:`ElementTree.write`.
    Returns an (optionally) encoded string containing the XML data.
 
+   .. versionadded:: 3.4
+      The *short_empty_elements* parameter.
 
-.. function:: tostringlist(element, encoding="us-ascii", method="xml")
+
+.. function:: tostringlist(element, encoding="us-ascii", method="xml", *, \
+                           short_empty_elements=True)
 
    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 (otherwise, a bytestring is generated).  *method*
    is either ``"xml"``, ``"html"`` or ``"text"`` (default is ``"xml"``).
+   *short_empty_elements* has the same meaning as in :meth:`ElementTree.write`.
    Returns a list of (optionally) encoded strings containing the XML data.
    It does not guarantee any specific sequence, except that
    ``b"".join(tostringlist(element)) == tostring(element)``.
 
    .. versionadded:: 3.2
 
+   .. versionadded:: 3.4
+      The *short_empty_elements* parameter.
+
 
 .. function:: XML(text, parser=None)
 
@@ -753,7 +832,8 @@
 
 
    .. method:: write(file, encoding="us-ascii", xml_declaration=None, \
-                     default_namespace=None, method="xml")
+                     default_namespace=None, method="xml", *, \
+                     short_empty_elements=True)
 
       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
@@ -764,6 +844,10 @@
       *default_namespace* sets the default XML namespace (for "xmlns").
       *method* is either ``"xml"``, ``"html"`` or ``"text"`` (default is
       ``"xml"``).
+      The keyword-only *short_empty_elements* parameter controls the formatting
+      of elements that contain no content.  If *True* (the default), they are
+      emitted as a single self-closed tag, otherwise they are emitted as a pair
+      of start/end tags.
 
       The output is either a string (:class:`str`) or binary (:class:`bytes`).
       This is controlled by the *encoding* argument.  If *encoding* is
@@ -772,6 +856,9 @@
       :term:`file object`; make sure you do not try to write a string to a
       binary stream and vice versa.
 
+      .. versionadded:: 3.4
+         The *short_empty_elements* parameter.
+
 
 This is the XML file that is going to be manipulated::
 
@@ -817,6 +904,7 @@
    :class:`QName` instances are opaque.
 
 
+
 .. _elementtree-treebuilder-objects:
 
 TreeBuilder Objects
@@ -876,13 +964,18 @@
 
 .. class:: XMLParser(html=0, target=None, encoding=None)
 
-   :class:`Element` structure builder for XML source data, based on the expat
-   parser.  *html* are predefined HTML entities.  This flag is not supported by
-   the current implementation.  *target* is the target object.  If omitted, the
-   builder uses an instance of the standard :class:`TreeBuilder` class.
-   *encoding* [1]_ is optional.  If given, the value overrides the encoding
+   This class is the low-level building block of the module.  It uses
+   :mod:`xml.parsers.expat` for efficient, event-based parsing of XML.  It can
+   be fed XML data incrementall with the :meth:`feed` method, and parsing events
+   are translated to a push API - by invoking callbacks on the *target* object.
+   If *target* is omitted, the standard :class:`TreeBuilder` is used.  The
+   *html* argument was historically used for backwards compatibility and is now
+   deprecated.  If *encoding* [1]_ is given, the value overrides the encoding
    specified in the XML file.
 
+   .. deprecated:: 3.4
+      The *html* argument.  The remaining arguments should be passed via
+      keywword to prepare for the removal of the *html* argument.
 
    .. method:: close()
 
@@ -902,12 +995,12 @@
 
       Feeds data to the parser.  *data* is encoded data.
 
-   :meth:`XMLParser.feed` calls *target*\'s ``start()`` method
-   for each opening tag, its ``end()`` method for each closing tag,
-   and data is processed by method ``data()``.  :meth:`XMLParser.close`
-   calls *target*\'s method ``close()``.
-   :class:`XMLParser` can be used not only for building a tree structure.
-   This is an example of counting the maximum depth of an XML file::
+   :meth:`XMLParser.feed` calls *target*\'s ``start(tag, attrs_dict)`` method
+   for each opening tag, its ``end(tag)`` method for each closing tag, and data
+   is processed by method ``data(data)``.  :meth:`XMLParser.close` calls
+   *target*\'s method ``close()``. :class:`XMLParser` can be used not only for
+   building a tree structure. This is an example of counting the maximum depth
+   of an XML file::
 
     >>> from xml.etree.ElementTree import XMLParser
     >>> class MaxDepth:                     # The target object of the parser
@@ -941,6 +1034,60 @@
     >>> parser.close()
     4
 
+
+.. _elementtree-xmlpullparser-objects:
+
+XMLPullParser Objects
+^^^^^^^^^^^^^^^^^^^^^
+
+.. class:: XMLPullParser(events=None)
+
+   A pull parser suitable for non-blocking applications.  Its input-side API is
+   similar to that of :class:`XMLParser`, but instead of pushing calls to a
+   callback target, :class:`XMLPullParser` collects an internal list of parsing
+   events and lets the user read from it. *events* is a sequence 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.
+
+   .. method:: feed(data)
+
+      Feed the given bytes data to the parser.
+
+   .. method:: close()
+
+      Signal the parser that the data stream is terminated. Unlike
+      :meth:`XMLParser.close`, this method always returns :const:`None`.
+      Any events not yet retrieved when the parser is closed can still be
+      read with :meth:`read_events`.
+
+   .. method:: read_events()
+
+      Return an iterator over the events which have been encountered in the
+      data fed to the
+      parser.  The iterator yields ``(event, elem)`` pairs, where *event* is a
+      string representing the type of event (e.g. ``"end"``) and *elem* is the
+      encountered :class:`Element` object.
+
+      Events provided in a previous call to :meth:`read_events` will not be
+      yielded again.  Events are consumed from the internal queue only when
+      they are retrieved from the iterator, so multiple readers iterating in
+      parallel over iterators obtained from :meth:`read_events` will have
+      unpredictable results.
+
+   .. note::
+
+      :class:`XMLPullParser` only guarantees that it has seen the ">"
+      character of a starting tag when it emits a "start" event, so the
+      attributes are defined, but the contents of the text and tail attributes
+      are undefined at that point.  The same applies to the element children;
+      they may or may not be present.
+
+      If you need a fully populated element, look for "end" events instead.
+
+   .. versionadded:: 3.4
+
 Exceptions
 ^^^^^^^^^^
 
@@ -965,4 +1112,4 @@
 .. [#] The encoding string included in XML output should conform to the
    appropriate standards.  For example, "UTF-8" is valid, but "UTF8" is
    not.  See http://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EncodingDecl
-   and http://www.iana.org/assignments/character-sets.
+   and http://www.iana.org/assignments/character-sets/character-sets.xhtml.
diff --git a/Doc/library/xmlrpc.client.rst b/Doc/library/xmlrpc.client.rst
index d6360df..cc5e83a 100644
--- a/Doc/library/xmlrpc.client.rst
+++ b/Doc/library/xmlrpc.client.rst
@@ -27,15 +27,14 @@
    constructed data.  If you need to parse untrusted or unauthenticated data see
    :ref:`xml-vulnerabilities`.
 
-.. warning::
+.. versionchanged:: 3.4.3
 
-   In the case of https URIs, :mod:`xmlrpc.client` does not do any verification
-   of the server's certificate.
-
+   For https URIs, :mod:`xmlrpc.client` now performs all the necessary
+   certificate and hostname checks by default
 
 .. class:: ServerProxy(uri, transport=None, encoding=None, verbose=False, \
                        allow_none=False, use_datetime=False, \
-                       use_builtin_types=False)
+                       use_builtin_types=False, *, context=None)
 
    .. versionchanged:: 3.3
       The *use_builtin_types* flag was added.
@@ -64,7 +63,9 @@
    portion will be base64-encoded as an HTTP 'Authorization' header, and sent to
    the remote server as part of the connection process when invoking an XML-RPC
    method.  You only need to use this if the remote server requires a Basic
-   Authentication user and password.
+   Authentication user and password. If an HTTPS url is provided, *context* may
+   be :class:`ssl.SSLContext` and configures the SSL settings of the underlying
+   HTTPS connection.
 
    The returned instance is a proxy object with methods that can be used to invoke
    corresponding RPC calls on the remote server.  If the remote server supports the
@@ -128,6 +129,9 @@
    :class:`Server` is retained as an alias for :class:`ServerProxy` for backwards
    compatibility.  New code should use :class:`ServerProxy`.
 
+   .. versionchanged:: 3.4.3
+      Added the *context* argument.
+
 
 .. seealso::
 
diff --git a/Doc/library/xmlrpc.server.rst b/Doc/library/xmlrpc.server.rst
index aca4f36..37d1393 100644
--- a/Doc/library/xmlrpc.server.rst
+++ b/Doc/library/xmlrpc.server.rst
@@ -184,8 +184,8 @@
    # Print list of available methods
    print(s.system.listMethods())
 
-The following example included in `Lib/xmlrpc/server.py` module shows a server
-allowing dotted names and registering a multicall function.
+The following example included in the :file:`Lib/xmlrpc/server.py` module shows
+a server allowing dotted names and registering a multicall function.
 
 .. warning::
 
diff --git a/Doc/library/zipfile.rst b/Doc/library/zipfile.rst
index 7a6482b..1d23a7c 100644
--- a/Doc/library/zipfile.rst
+++ b/Doc/library/zipfile.rst
@@ -130,7 +130,7 @@
 ---------------
 
 
-.. class:: ZipFile(file, mode='r', compression=ZIP_STORED, allowZip64=False)
+.. class:: ZipFile(file, mode='r', compression=ZIP_STORED, allowZip64=True)
 
    Open a ZIP file, where *file* can be either a path to a file (a string) or a
    file-like object.  The *mode* parameter should be ``'r'`` to read an existing
@@ -144,15 +144,12 @@
    and should be :const:`ZIP_STORED`, :const:`ZIP_DEFLATED`,
    :const:`ZIP_BZIP2` or :const:`ZIP_LZMA`; unrecognized
    values will cause :exc:`RuntimeError` to be raised.  If :const:`ZIP_DEFLATED`,
-   :const:`ZIP_BZIP2` or :const:`ZIP_LZMA` is specified but the corresponded module
+   :const:`ZIP_BZIP2` or :const:`ZIP_LZMA` is specified but the corresponding module
    (: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 GiB. If it is  false (the default) :mod:`zipfile`
+   ``True`` (the default) zipfile will create ZIP files that use the ZIP64
+   extensions when the zipfile is larger than 2 GiB. If it is  false :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:`closed <close>` without adding any files to the archive, the appropriate
@@ -171,6 +168,9 @@
    .. versionchanged:: 3.3
       Added support for :mod:`bzip2 <bz2>` and :mod:`lzma` compression.
 
+   .. versionchanged:: 3.4
+      ZIP64 extensions are enabled by default.
+
 
 .. method:: ZipFile.close()
 
@@ -234,6 +234,9 @@
       or a :class:`ZipInfo` object.  You will appreciate this when trying to read a
       ZIP file that contains members with duplicate names.
 
+   .. deprecated-removed:: 3.4 3.6
+      The ``'U'`` or  ``'rU'`` mode.  Use :class:`io.TextIOWrapper` for reading
+      compressed text files in :term:`universal newlines` mode.
 
 .. method:: ZipFile.extract(member, path=None, pwd=None)
 
@@ -266,10 +269,8 @@
       Never extract archives from untrusted sources without prior inspection.
       It is possible that files are created outside of *path*, e.g. members
       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.
+      dots ``".."``.  This module attempts to prevent that.
+      See :meth:`extract` note.
 
 
 .. method:: ZipFile.printdir()
@@ -376,15 +377,18 @@
 The :class:`PyZipFile` constructor takes the same parameters as the
 :class:`ZipFile` constructor, and one additional parameter, *optimize*.
 
-.. class:: PyZipFile(file, mode='r', compression=ZIP_STORED, allowZip64=False, \
+.. class:: PyZipFile(file, mode='r', compression=ZIP_STORED, allowZip64=True, \
                      optimize=-1)
 
    .. versionadded:: 3.2
       The *optimize* parameter.
 
+   .. versionchanged:: 3.4
+      ZIP64 extensions are enabled by default.
+
    Instances have one method in addition to those of :class:`ZipFile` objects:
 
-   .. method:: PyZipFile.writepy(pathname, basename='')
+   .. method:: PyZipFile.writepy(pathname, basename='', filterfunc=None)
 
       Search for files :file:`\*.py` and add the corresponding file to the
       archive.
@@ -397,16 +401,33 @@
       ``2``, only files with that optimization level (see :func:`compile`) are
       added to the archive, compiling if necessary.
 
-      If the pathname is a file, the filename must end with :file:`.py`, and
+      If *pathname* is a file, the filename must end with :file:`.py`, and
       just the (corresponding :file:`\*.py[co]`) file is added at the top level
-      (no path information).  If the pathname is a file that does not end with
+      (no path information).  If *pathname* is a file that does not end with
       :file:`.py`, a :exc:`RuntimeError` will be raised.  If it is a directory,
       and the directory is not a package directory, then all the files
       :file:`\*.py[co]` are added at the top level.  If the directory is a
       package directory, then all :file:`\*.py[co]` are added under the package
       name as a file path, and if any subdirectories are package directories,
-      all of these are added recursively.  *basename* is intended for internal
-      use only.  The :meth:`writepy` method makes archives with file names like
+      all of these are added recursively.
+
+      *basename* is intended for internal use only.
+
+      *filterfunc*, if given, must be a function taking a single string
+      argument.  It will be passed each path (including each individual full
+      file path) before it is added to the archive.  If *filterfunc* returns a
+      false value, the path will not be added, and if it is a directory its
+      contents will be ignored.  For example, if our test files are all either
+      in ``test`` directories or start with the string ``test_``, we can use a
+      *filterfunc* to exclude them::
+
+          >>> zf = PyZipFile('myprog.zip')
+          >>> def notests(s):
+          ...     fn = os.path.basename(s)
+          ...     return (not (fn == 'test' or fn.startswith('test_')))
+          >>> zf.writepy('myprog', filterfunc=notests)
+
+      The :meth:`writepy` method makes archives with file names like
       this::
 
          string.pyc                   # Top level name
@@ -415,6 +436,9 @@
          test/bogus/__init__.pyc      # Subpackage directory
          test/bogus/myfile.pyc        # Submodule test.bogus.myfile
 
+      .. versionadded:: 3.4
+         The *filterfunc* parameter.
+
 
 .. _zipinfo-objects:
 
diff --git a/Doc/license.rst b/Doc/license.rst
index 492b80f..53a1c4d 100644
--- a/Doc/license.rst
+++ b/Doc/license.rst
@@ -23,11 +23,11 @@
 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
+https://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
+All Python releases are Open Source (see http://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.
 
@@ -84,9 +84,9 @@
    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-2015 Python Software Foundation; All Rights
-   Reserved" are retained in Python |release| alone or in any derivative version
-   prepared by Licensee.
+   copyright, i.e., "Copyright © 2001-2015 Python Software Foundation; All
+   Rights Reserved" are retained in Python |release| alone or in any derivative
+   version prepared by Licensee.
 
 #. In the event Licensee prepares a derivative work that is based on or
    incorporates Python |release| or any part thereof, and wants to make the
@@ -590,6 +590,35 @@
   SUCH DAMAGE.
 
 
+SipHash24
+---------
+
+The file :file:`Python/pyhash.c` contains Marek Majkowski' implementation of
+Dan Bernstein's SipHash24 algorithm. The contains the following note::
+
+  <MIT License>
+  Copyright (c) 2013  Marek Majkowski <marek@popcount.org>
+
+  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.
+  </MIT License>
+
+  Original location:
+     https://github.com/majek/csiphash/
+
+  Solution inspired by code from:
+     Samuel Neves (supercop/crypto_auth/siphash24/little)
+     djb (supercop/crypto_auth/siphash24/little2)
+     Jean-Philippe Aumasson (https://131002.net/siphash/siphash24.c)
+
+
 strtod and dtoa
 ---------------
 
@@ -625,9 +654,9 @@
 
 The modules :mod:`hashlib`, :mod:`posix`, :mod:`ssl`, :mod:`crypt` use
 the OpenSSL library for added performance if made available by the
-operating system. Additionally, the Windows installers for Python
-include a copy of the OpenSSL libraries, so we include a copy of the
-OpenSSL license here::
+operating system. Additionally, the Windows and Mac OS X installers for
+Python may include a copy of the OpenSSL libraries, so we include a copy
+of the OpenSSL license here::
 
 
   LICENSE ISSUES
@@ -846,6 +875,47 @@
   jloup@gzip.org          madler@alumni.caltech.edu
 
 
+cfuhash
+-------
+
+The implementation of the hash table used by the :mod:`tracemalloc` is based
+on the cfuhash project::
+
+   Copyright (c) 2005 Don Owens
+   All rights reserved.
+
+   This code is released under the BSD 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.
+
+     * 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.
+
+     * Neither the name of the author 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.
+
+
 libmpdec
 --------
 
diff --git a/Doc/make.bat b/Doc/make.bat
index d6f7074..c8f6082 100644
--- a/Doc/make.bat
+++ b/Doc/make.bat
@@ -1,59 +1,124 @@
-@@echo off
+@echo off
 setlocal
 
-set SVNROOT=http://svn.python.org/projects
-if "%PYTHON%" EQU "" set PYTHON=py -2
-if "%HTMLHELP%" EQU "" set HTMLHELP=%ProgramFiles%\HTML Help Workshop\hhc.exe
-if "%DISTVERSION%" EQU "" for /f "usebackq" %%v in (`%PYTHON% tools/sphinxext/patchlevel.py`) do set DISTVERSION=%%v
+pushd %~dp0
 
+set this=%~n0
+
+if "%SPHINXBUILD%" EQU "" set SPHINXBUILD=sphinx-build
+if "%PYTHON%" EQU "" set PYTHON=py
+
+if DEFINED ProgramFiles(x86) set _PRGMFLS=%ProgramFiles(x86)%
+if NOT DEFINED ProgramFiles(x86) set _PRGMFLS=%ProgramFiles%
+if "%HTMLHELP%" EQU "" set HTMLHELP=%_PRGMFLS%\HTML Help Workshop\hhc.exe
+
+if "%DISTVERSION%" EQU "" for /f "usebackq" %%v in (`%PYTHON% tools/patchlevel.py`) do set DISTVERSION=%%v
+
+if "%BUILDDIR%" EQU "" set BUILDDIR=build
+
+rem Targets that don't require sphinx-build
 if "%1" EQU "" goto help
-if "%1" EQU "html" goto build
-if "%1" EQU "htmlhelp" goto build
-if "%1" EQU "latex" goto build
-if "%1" EQU "text" goto build
-if "%1" EQU "suspicious" goto build
-if "%1" EQU "linkcheck" goto build
-if "%1" EQU "changes" goto build
-if "%1" EQU "checkout" goto checkout
-if "%1" EQU "update" goto update
+if "%1" EQU "help" goto help
+if "%1" EQU "check" goto check
+if "%1" EQU "serve" goto serve
+if "%1" == "clean" (
+    rmdir /q /s %BUILDDIR%
+    goto end
+)
+
+%SPHINXBUILD% 2> nul
+if errorlevel 9009 (
+    echo.
+    echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
+    echo.installed, then set the SPHINXBUILD environment variable to point
+    echo.to the full path of the 'sphinx-build' executable. Alternatively you
+    echo.may add the Sphinx directory to PATH.
+    echo.
+    echo.If you don't have Sphinx installed, grab it from
+    echo.http://sphinx-doc.org/
+    goto end
+)
+
+rem Targets that do require sphinx-build and have their own label
+if "%1" EQU "htmlview" goto htmlview
+
+rem Everything else
+goto build
 
 :help
-set this=%~n0
-echo HELP
+echo.usage: %this% BUILDER [filename ...]
 echo.
-echo %this% checkout
-echo %this% update
-echo %this% html
-echo %this% htmlhelp
-echo %this% latex
-echo %this% text
-echo %this% suspicious
-echo %this% linkcheck
-echo %this% changes
+echo.Call %this% with the desired Sphinx builder as the first argument, e.g.
+echo.``%this% html`` or ``%this% doctest``.  Interesting targets that are
+echo.always available include:
 echo.
-goto end
-
-:checkout
-svn co %SVNROOT%/external/Sphinx-1.2/sphinx tools/sphinx
-svn co %SVNROOT%/external/docutils-0.11/docutils tools/docutils
-svn co %SVNROOT%/external/Jinja-2.3.1/jinja2 tools/jinja2
-svn co %SVNROOT%/external/Pygments-1.6/pygments tools/pygments
-goto end
-
-:update
-svn update tools/sphinx
-svn update tools/docutils
-svn update tools/jinja2
-svn update tools/pygments
+echo.   Provided by Sphinx:
+echo.      html, htmlhelp, latex, text
+echo.      suspicious, linkcheck, changes, doctest
+echo.   Provided by this script:
+echo.      clean, check, serve, htmlview
+echo.
+echo.All arguments past the first one are passed through to sphinx-build as
+echo.filenames to build or are ignored.  See README.txt in this directory or
+echo.the documentation for your version of Sphinx for more exhaustive lists
+echo.of available targets and descriptions of each.
+echo.
+echo.This script assumes that the SPHINXBUILD environment variable contains
+echo.a legitimate command for calling sphinx-build, or that sphinx-build is
+echo.on your PATH if SPHINXBUILD is not set.  Options for sphinx-build can
+echo.be passed by setting the SPHINXOPTS environment variable.
 goto end
 
 :build
-if not exist build mkdir build
-if not exist build\%1 mkdir build\%1
-if not exist build\doctrees mkdir build\doctrees
-cmd /C %PYTHON% --version
-cmd /C %PYTHON% tools\sphinx-build.py -b%1 -dbuild\doctrees . build\%*
-if "%1" EQU "htmlhelp" "%HTMLHELP%" build\htmlhelp\python%DISTVERSION:.=%.hhp
+if NOT "%PAPER%" == "" (
+    set SPHINXOPTS=-D latex_paper_size=%PAPER% %SPHINXOPTS%
+)
+cmd /C %SPHINXBUILD% %SPHINXOPTS% -b%1 -dbuild\doctrees . %BUILDDIR%\%*
+
+if "%1" EQU "htmlhelp" (
+    if  not exist "%HTMLHELP%" (
+        echo.
+        echo.The HTML Help Workshop was not found.  Set the HTMLHELP variable
+        echo.to the path to hhc.exe or download and install it from
+        echo.http://msdn.microsoft.com/en-us/library/ms669985
+        rem Set errorlevel to 1 and exit
+        cmd /C exit /b 1
+        goto end
+    )
+    cmd /C "%HTMLHELP%" build\htmlhelp\python%DISTVERSION:.=%.hhp
+    rem hhc.exe seems to always exit with code 1, reset to 0 for less than 2
+    if not errorlevel 2 cmd /C exit /b 0
+)
+
+echo.
+if errorlevel 1 (
+    echo.Build failed (exit code %ERRORLEVEL%^), check for error messages
+    echo.above.  Any output will be found in %BUILDDIR%\%1
+) else (
+    echo.Build succeeded. All output should be in %BUILDDIR%\%1
+)
+goto end
+
+:htmlview
+if NOT "%2" EQU "" (
+    echo.Can't specify filenames to build with htmlview target, ignoring.
+)
+cmd /C %this% html
+
+if EXIST %BUILDDIR%\html\index.html (
+    echo.Opening %BUILDDIR%\html\index.html in the default web browser...
+    start %BUILDDIR%\html\index.html
+)
+
+goto end
+
+:check
+cmd /C %PYTHON% tools\rstlint.py -i tools
+goto end
+
+:serve
+cmd /C %PYTHON% ..\Tools\scripts\serve.py %BUILDDIR%\html
 goto end
 
 :end
+popd
diff --git a/Doc/reference/compound_stmts.rst b/Doc/reference/compound_stmts.rst
index 8afc69e..5dd17eb 100644
--- a/Doc/reference/compound_stmts.rst
+++ b/Doc/reference/compound_stmts.rst
@@ -22,14 +22,14 @@
    single: clause
    single: suite
 
-Compound statements consist of one or more 'clauses.'  A clause consists of a
+A compound statement consists of one or more 'clauses.'  A clause consists of a
 header and a 'suite.'  The clause headers of a particular compound statement are
 all at the same indentation level. Each clause header begins with a uniquely
 identifying keyword and ends with a colon.  A suite is a group of statements
 controlled by a clause.  A suite can be one or more semicolon-separated simple
 statements on the same line as the header, following the header's colon, or it
 can be one or more indented statements on subsequent lines.  Only the latter
-form of suite can contain nested compound statements; the following is illegal,
+form of a suite can contain nested compound statements; the following is illegal,
 mostly because it wouldn't be clear to which :keyword:`if` clause a following
 :keyword:`else` clause would belong::
 
@@ -156,8 +156,8 @@
 
 The expression list is evaluated once; it should yield an iterable object.  An
 iterator is created for the result of the ``expression_list``.  The suite is
-then executed once for each item provided by the iterator, in the order of
-ascending indices.  Each item in turn is assigned to the target list using the
+then executed once for each item provided by the iterator, in the order returned
+by the iterator.  Each item in turn is assigned to the target list using the
 standard rules for assignments (see :ref:`assignment`), and then the suite is
 executed.  When the items are exhausted (which is immediately when the sequence
 is empty or an iterator raises a :exc:`StopIteration` exception), the suite in
@@ -170,17 +170,25 @@
 A :keyword:`break` statement executed in the first suite terminates the loop
 without executing the :keyword:`else` clause's suite.  A :keyword:`continue`
 statement executed in the first suite skips the rest of the suite and continues
-with the next item, or with the :keyword:`else` clause if there was no next
+with the next item, or with the :keyword:`else` clause if there is no next
 item.
 
-The suite may assign to the variable(s) in the target list; this does not affect
-the next item assigned to it.
+The for-loop makes assignments to the variables(s) in the target list.
+This overwrites all previous assignments to those variables including
+those made in the suite of the for-loop::
+
+   for i in range(10):
+       print(i)
+       i = 5             # this will not affect the for-loop
+                         # because i will be overwritten with the next
+                         # index in the range
+
 
 .. index::
    builtin: range
 
 Names in the target list are not deleted when the loop is finished, but if the
-sequence is empty, it will not have been assigned to at all by the loop.  Hint:
+sequence is empty, they will not have been assigned to at all by the loop.  Hint:
 the built-in function :func:`range` returns an iterator of integers suitable to
 emulate the effect of Pascal's ``for i := a to b do``; e.g., ``list(range(3))``
 returns the list ``[0, 1, 2]``.
@@ -226,7 +234,7 @@
 .. productionlist::
    try_stmt: try1_stmt | try2_stmt
    try1_stmt: "try" ":" `suite`
-            : ("except" [`expression` ["as" `target`]] ":" `suite`)+
+            : ("except" [`expression` ["as" `identifier`]] ":" `suite`)+
             : ["else" ":" `suite`]
             : ["finally" ":" `suite`]
    try2_stmt: "try" ":" `suite`
@@ -284,7 +292,7 @@
    object: traceback
 
 Before an except clause's suite is executed, details about the exception are
-stored in the :mod:`sys` module and can be access via :func:`sys.exc_info`.
+stored in the :mod:`sys` module and can be accessed via :func:`sys.exc_info`.
 :func:`sys.exc_info` returns a 3-tuple consisting of the exception class, the
 exception instance and a traceback object (see section :ref:`types`) identifying
 the point in the program where the exception occurred.  :func:`sys.exc_info`
@@ -313,14 +321,14 @@
 If the :keyword:`finally` clause executes a :keyword:`return` or :keyword:`break`
 statement, the saved exception is discarded::
 
-    def f():
-        try:
-            1/0
-        finally:
-            return 42
-
-    >>> f()
-    42
+   >>> def f():
+   ...     try:
+   ...         1/0
+   ...     finally:
+   ...         return 42
+   ...
+   >>> f()
+   42
 
 The exception information is not available to the program during execution of
 the :keyword:`finally` clause.
@@ -337,6 +345,20 @@
 reason is a problem with the current implementation --- this restriction may be
 lifted in the future).
 
+The return value of a function is determined by the last :keyword:`return`
+statement executed.  Since the :keyword:`finally` clause always executes, a
+:keyword:`return` statement executed in the :keyword:`finally` clause will
+always be the last one executed::
+
+   >>> def foo():
+   ...     try:
+   ...         return 'try'
+   ...     finally:
+   ...         return 'finally'
+   ...
+   >>> foo()
+   'finally'
+
 Additional information on exceptions can be found in section :ref:`exceptions`,
 and information on using the :keyword:`raise` statement to generate exceptions
 may be found in section :ref:`raise`.
@@ -348,7 +370,9 @@
 The :keyword:`with` statement
 =============================
 
-.. index:: statement: with
+.. index::
+    statement: with
+    single: as; with statement
 
 The :keyword:`with` statement is used to wrap the execution of a block with
 methods defined by a context manager (see section :ref:`context-managers`).
@@ -445,7 +469,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`]
@@ -493,14 +517,15 @@
 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.
 
-**Default parameter values are evaluated when the function definition is
-executed.** This means that the expression is evaluated once, when the function
-is defined, and that the same "pre-computed" value is used for each call.  This
-is especially important to understand when a default parameter is a mutable
-object, such as a list or a dictionary: if the function modifies the object
-(e.g. by appending an item to a list), the default value is in effect modified.
-This is generally not what was intended.  A way around this is to use ``None``
-as the default, and explicitly test for it in the body of the function, e.g.::
+**Default parameter values are evaluated from left to right when the function
+definition is executed.** This means that the expression is evaluated once, when
+the function is defined, and that the same "pre-computed" value is used for each
+call.  This is especially important to understand when a default parameter is a
+mutable object, such as a list or a dictionary: if the function modifies the
+object (e.g. by appending an item to a list), the default value is in effect
+modified.  This is generally not what was intended.  A way around this is to use
+``None`` as the default, and explicitly test for it in the body of the function,
+e.g.::
 
    def whats_on_the_telly(penguin=None):
        if penguin is None:
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst
index e5e53c1..e3646f8 100644
--- a/Doc/reference/datamodel.rst
+++ b/Doc/reference/datamodel.rst
@@ -77,7 +77,7 @@
    module for information on controlling the collection of cyclic garbage.
    Other implementations act differently and CPython may change.
    Do not depend on immediate finalization of objects when they become
-   unreachable (ex: always close files).
+   unreachable (so you should always close files explicitly).
 
 Note that the use of the implementation's tracing or debugging facilities may
 keep objects alive that would normally be collectable. Also note that catching
@@ -154,11 +154,16 @@
 
    This type has a single value.  There is a single object with this value. This
    object is accessed through the built-in name ``NotImplemented``. Numeric methods
-   and rich comparison methods may return this value if they do not implement the
+   and rich comparison methods should return this value if they do not implement the
    operation for the operands provided.  (The interpreter will then try the
    reflected operation, or some other fallback, depending on the operator.)  Its
    truth value is true.
 
+   See
+   :ref:`implementing-the-arithmetic-operations`
+   for more details.
+
+
 Ellipsis
    .. index:: object: Ellipsis
 
@@ -222,7 +227,7 @@
       at the mercy of the underlying machine architecture (and C or Java
       implementation) for the accepted range and handling of overflow. Python does not
       support single-precision floating point numbers; the savings in processor and
-      memory usage that are usually the reason for using these is dwarfed by the
+      memory usage that are usually the reason for using these are dwarfed by the
       overhead of using objects in Python, so there is no reason to complicate the
       language with two kinds of floating point numbers.
 
@@ -285,16 +290,17 @@
             single: integer
             single: Unicode
 
-         A string is a sequence of values that represent Unicode codepoints.
-         All the codepoints in range ``U+0000 - U+10FFFF`` can be represented
-         in a string.  Python doesn't have a :c:type:`chr` type, and
-         every character in the string is represented as a string object
-         with length ``1``.  The built-in function :func:`ord` converts a
-         character to its codepoint (as an integer); :func:`chr` converts
-         an integer in range ``0 - 10FFFF`` to the corresponding character.
+         A string is a sequence of values that represent Unicode code points.
+         All the code points in the range ``U+0000 - U+10FFFF`` can be
+         represented in a string.  Python doesn't have a :c:type:`char` type;
+         instead, every code point in the string is represented as a string
+         object with length ``1``.  The built-in function :func:`ord`
+         converts a code point from its string form to an integer in the
+         range ``0 - 10FFFF``; :func:`chr` converts an integer in the range
+         ``0 - 10FFFF`` to the corresponding length ``1`` string object.
          :meth:`str.encode` can be used to convert a :class:`str` to
-         :class:`bytes` using the given encoding, and :meth:`bytes.decode` can
-         be used to achieve the opposite.
+         :class:`bytes` using the given text encoding, and
+         :meth:`bytes.decode` can be used to achieve the opposite.
 
       Tuples
          .. index::
@@ -323,8 +329,6 @@
          object: mutable sequence
          object: mutable
          pair: assignment; statement
-         single: delete
-         statement: del
          single: subscription
          single: slicing
 
@@ -455,7 +459,8 @@
       +=========================+===============================+===========+
       | :attr:`__doc__`         | The function's documentation  | Writable  |
       |                         | string, or ``None`` if        |           |
-      |                         | unavailable                   |           |
+      |                         | unavailable; not inherited by |           |
+      |                         | subclasses                    |           |
       +-------------------------+-------------------------------+-----------+
       | :attr:`__name__`        | The function's name           | Writable  |
       +-------------------------+-------------------------------+-----------+
@@ -709,7 +714,7 @@
    where there are multiple inheritance paths leading back to a common ancestor.
    Additional details on the C3 MRO used by Python can be found in the
    documentation accompanying the 2.3 release at
-   http://www.python.org/download/releases/2.3/mro/.
+   https://www.python.org/download/releases/2.3/mro/.
 
    .. XXX: Could we add that MRO doc as an appendix to the language ref?
 
@@ -934,6 +939,20 @@
       frame).  A debugger can implement a Jump command (aka Set Next Statement)
       by writing to f_lineno.
 
+      Frame objects support one method:
+
+      .. method:: frame.clear()
+
+         This method clears all references to local variables held by the
+         frame.  Also, if the frame belonged to a generator, the generator
+         is finalized.  This helps break reference cycles involving frame
+         objects (for example when catching an exception and storing its
+         traceback for later use).
+
+         :exc:`RuntimeError` is raised if the frame is currently executing.
+
+         .. versionadded:: 3.4
+
    Traceback objects
       .. index::
          object: traceback
@@ -1123,14 +1142,14 @@
       reference to the object on the stack frame that raised an unhandled
       exception in interactive mode (the traceback stored in
       ``sys.last_traceback`` keeps the stack frame alive).  The first situation
-      can only be remedied by explicitly breaking the cycles; the latter two
-      situations can be resolved by storing ``None`` in ``sys.last_traceback``.
-      Circular references which are garbage are detected when the option cycle
-      detector is enabled (it's on by default), but can only be cleaned up if
-      there are no Python- level :meth:`__del__` methods involved. Refer to the
-      documentation for the :mod:`gc` module for more information about how
-      :meth:`__del__` methods are handled by the cycle detector, particularly
-      the description of the ``garbage`` value.
+      can only be remedied by explicitly breaking the cycles; the second can be
+      resolved by freeing the reference to the traceback object when it is no
+      longer useful, and the third can be resolved by storing ``None`` in
+      ``sys.last_traceback``.
+      Circular references which are garbage are detected and cleaned up when
+      the cyclic garbage collector is enabled (it's on by default). Refer to the
+      documentation for the :mod:`gc` module for more information about this
+      topic.
 
    .. warning::
 
@@ -1218,6 +1237,10 @@
 
    The return value must be a string object.
 
+   .. versionchanged:: 3.4
+      The __format__ method of ``object`` itself raises a :exc:`TypeError`
+      if passed any non-empty string.
+
 
 .. _richcmpfuncs:
 .. method:: object.__lt__(self, other)
@@ -1455,6 +1478,14 @@
    Called to delete the attribute on an instance *instance* of the owner class.
 
 
+The attribute :attr:`__objclass__` is interpreted by the :mod:`inspect` module
+as specifying the class where this object was defined (setting this
+appropriately can assist in runtime introspection of dynamic class attributes).
+For callables, it may indicate that an instance of the given type (or a
+subclass) is expected or required as the first positional argument (for example,
+CPython sets this attribute for unbound methods that are implemented in C).
+
+
 .. _descriptor-invocation:
 
 Invoking Descriptors
@@ -1536,9 +1567,9 @@
 .. data:: object.__slots__
 
    This class variable can be assigned a string, iterable, or sequence of
-   strings with variable names used by instances.  If defined in a
-   class, *__slots__* reserves space for the declared variables and prevents the
-   automatic creation of *__dict__* and *__weakref__* for each instance.
+   strings with variable names used by instances.  *__slots__* reserves space
+   for the declared variables and prevents the automatic creation of *__dict__*
+   and *__weakref__* for each instance.
 
 
 Notes on using *__slots__*
@@ -1635,6 +1666,8 @@
 that criterion, then the class definition will fail with ``TypeError``.
 
 
+.. _prepare:
+
 Preparing the class namespace
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
@@ -1702,7 +1735,7 @@
 locking/synchronization.
 
 Here is an example of a metaclass that uses an :class:`collections.OrderedDict`
-to remember the order that class members were defined::
+to remember the order that class variables are defined::
 
     class OrderedClass(type):
 
@@ -1834,6 +1867,15 @@
    considered to be false in a Boolean context.
 
 
+.. method:: object.__length_hint__(self)
+
+   Called to implement :func:`operator.length_hint`. Should return an estimated
+   length for the object (which may be greater or less than the actual length).
+   The length must be an integer ``>=`` 0. This method is purely an
+   optimization and is never required for correctness.
+
+   .. versionadded:: 3.4
+
 .. note::
 
    Slicing is done exclusively with the following three methods.  A call like ::
@@ -1866,6 +1908,12 @@
       indexes to allow proper detection of the end of the sequence.
 
 
+.. method:: object.__missing__(self, key)
+
+   Called by :class:`dict`\ .\ :meth:`__getitem__` to implement ``self[key]`` for dict subclasses
+   when key is not in the dictionary.
+
+
 .. method:: object.__setitem__(self, key, value)
 
    Called to implement assignment to ``self[key]``.  Same note as for
@@ -1888,8 +1936,7 @@
 
    This method is called when an iterator is required for a container. This method
    should return a new iterator object that can iterate over all the objects in the
-   container.  For mappings, it should iterate over the keys of the container, and
-   should also be made available as the method :meth:`keys`.
+   container.  For mappings, it should iterate over the keys of the container.
 
    Iterator objects also need to implement this method; they are required to return
    themselves.  For more information on iterator objects, see :ref:`typeiter`.
@@ -2065,9 +2112,17 @@
 
 .. method:: object.__index__(self)
 
-   Called to implement :func:`operator.index`.  Also called whenever Python needs
-   an integer object (such as in slicing, or in the built-in :func:`bin`,
-   :func:`hex` and :func:`oct` functions). Must return an integer.
+   Called to implement :func:`operator.index`, and whenever Python needs to
+   losslessly convert the numeric object to an integer object (such as in
+   slicing, or in the built-in :func:`bin`, :func:`hex` and :func:`oct`
+   functions). Presence of this method indicates that the numeric object is
+   an integer type.  Must return an integer.
+
+   .. note::
+
+      In order to have a coherent integer type class, when :meth:`__index__` is
+      defined :meth:`__int__` should also be defined, and both should return
+      the same value.
 
 
 .. _context-managers:
diff --git a/Doc/reference/executionmodel.rst b/Doc/reference/executionmodel.rst
index 82e37a2..a3948e3 100644
--- a/Doc/reference/executionmodel.rst
+++ b/Doc/reference/executionmodel.rst
@@ -31,11 +31,11 @@
 A :dfn:`block` is a piece of Python program text that is executed as a unit.
 The following are blocks: a module, a function body, and a class definition.
 Each command typed interactively is a block.  A script file (a file given as
-standard input to the interpreter or specified on the interpreter command line
-the first argument) is a code block.  A script command (a command specified on
-the interpreter command line with the '**-c**' option) is a code block.  The
-string argument passed to the built-in functions :func:`eval` and :func:`exec`
-is a code block.
+standard input to the interpreter or specified as a command line argument to the
+interpreter) is a code block.  A script command (a command specified on the
+interpreter command line with the '**-c**' option) is a code block.  The string
+argument passed to the built-in functions :func:`eval` and :func:`exec` is a
+code block.
 
 .. index:: pair: execution; frame
 
@@ -77,7 +77,7 @@
    single: UnboundLocalError
 
 When a name is not found at all, a :exc:`NameError` exception is raised.  If the
-name refers to a local variable that has not been bound, a
+name refers to a local variable that has not been bound, an
 :exc:`UnboundLocalError` exception is raised.  :exc:`UnboundLocalError` is a
 subclass of :exc:`NameError`.
 
@@ -111,8 +111,9 @@
 namespace.  Names are resolved in the top-level namespace by searching the
 global namespace, i.e. the namespace of the module containing the code block,
 and the builtins namespace, the namespace of the module :mod:`builtins`.  The
-global namespace is searched first.  If the name is not found there, the builtins
-namespace is searched.  The global statement must precede all uses of the name.
+global namespace is searched first.  If the name is not found there, the
+builtins namespace is searched.  The :keyword:`global` statement must precede
+all uses of the name.
 
 .. XXX document "nonlocal" semantics here
 
diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst
index 06baba0..d0682ca 100644
--- a/Doc/reference/expressions.rst
+++ b/Doc/reference/expressions.rst
@@ -29,7 +29,7 @@
 
 When a description of an arithmetic operator below uses the phrase "the numeric
 arguments are converted to a common type," this means that the operator
-implementation for built-in types works that way:
+implementation for built-in types works as follows:
 
 * If either argument is a complex number, the other is converted to complex;
 
@@ -38,8 +38,9 @@
 
 * otherwise, both must be integers and no conversion is necessary.
 
-Some additional rules apply for certain operators (e.g., a string left argument
-to the '%' operator).  Extensions must define their own conversion behavior.
+Some additional rules apply for certain operators (e.g., a string as a left
+argument to the '%' operator).  Extensions must define their own conversion
+behavior.
 
 
 .. _atoms:
@@ -183,7 +184,7 @@
 each time the innermost block is reached.
 
 Note that the comprehension is executed in a separate scope, so names assigned
-to in the target list don't "leak" in the enclosing scope.
+to in the target list don't "leak" into the enclosing scope.
 
 
 .. _lists:
@@ -293,7 +294,7 @@
 brackets or curly braces.
 
 Variables used in the generator expression are evaluated lazily when the
-:meth:`~generator.__next__` method is called for generator object (in the same
+:meth:`~generator.__next__` method is called for the 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.
@@ -302,7 +303,7 @@
 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.
+:ref:`calls` for details.
 
 
 .. _yieldexpr:
@@ -327,12 +328,13 @@
 generator.  That generator then controls the execution of a generator function.
 The execution starts when one of the generator's methods is called.  At that
 time, the execution proceeds to the first yield expression, where it is
-suspended again, returning the value of :token:`expression_list` to generator's
+suspended again, returning the value of :token:`expression_list` to the generator's
 caller.  By suspended, we mean that all local state is retained, including the
-current bindings of local variables, the instruction pointer, and the internal
-evaluation stack.  When the execution is resumed by calling one of the
+current bindings of local variables, the instruction pointer, the internal
+evaluation stack, and the state of any exception handling.  When the execution
+is resumed by calling one of the
 generator's methods, the function can proceed exactly as if the yield expression
-was just another external call.  The value of the yield expression after
+were just another external call.  The value of the yield expression after
 resuming depends on the method which resumed the execution.  If
 :meth:`~generator.__next__` is used (typically via either a :keyword:`for` or
 the :func:`next` builtin) then the result is :const:`None`.  Otherwise, if
@@ -344,11 +346,11 @@
 All of this makes generator functions quite similar to coroutines; they yield
 multiple times, they have more than one entry point and their execution can be
 suspended.  The only difference is that a generator function cannot control
-where should the execution continue after it yields; the control is always
+where the execution should continue after it yields; the control is always
 transferred to the generator's caller.
 
-yield expressions are allowed in the :keyword:`try` clause of a :keyword:`try`
-...  :keyword:`finally` construct.  If the generator is not resumed before it is
+Yield expressions are allowed anywhere in a :keyword:`try` construct.  If the
+generator is not resumed before it is
 finalized (by reaching a zero reference count or by being garbage collected),
 the generator-iterator's :meth:`~generator.close` method will be called,
 allowing any pending :keyword:`finally` clauses to execute.
@@ -399,7 +401,6 @@
 is already executing raises a :exc:`ValueError` exception.
 
 .. index:: exception: StopIteration
-.. class:: generator
 
 
 .. method:: generator.__next__()
@@ -409,7 +410,7 @@
    :meth:`~generator.__next__` method, the current yield expression always
    evaluates to :const:`None`.  The execution then continues to the next 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
+   :token:`expression_list` is returned to :meth:`__next__`'s caller.  If the
    generator exits without yielding another value, a :exc:`StopIteration`
    exception is raised.
 
@@ -430,7 +431,7 @@
 
 .. method:: generator.throw(type[, value[, traceback]])
 
-   Raises an exception of type ``type`` at the point where generator was paused,
+   Raises an exception of type ``type`` at the point where the generator was paused,
    and returns the next value yielded by the generator function.  If the generator
    exits without yielding another value, a :exc:`StopIteration` exception is
    raised.  If the generator function does not catch the passed-in exception, or
@@ -449,8 +450,6 @@
    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.
 
-.. class:: .
-
 .. index:: single: yield; examples
 
 Examples
@@ -520,11 +519,11 @@
 
 The primary must evaluate to an object of a type that supports attribute
 references, which most objects do.  This object is then asked to produce the
-attribute whose name is the identifier (which can be customized by overriding
-the :meth:`__getattr__` method).  If this attribute is not available, the
-exception :exc:`AttributeError` is raised.  Otherwise, the type and value of the
-object produced is determined by the object.  Multiple evaluations of the same
-attribute reference may yield different objects.
+attribute whose name is the identifier.  This production can be customized by
+overriding the :meth:`__getattr__` method.  If this attribute is not available,
+the exception :exc:`AttributeError` is raised.  Otherwise, the type and value of
+the object produced is determined by the object.  Multiple evaluations of the
+same attribute reference may yield different objects.
 
 
 .. _subscriptions:
@@ -549,9 +548,9 @@
 .. productionlist::
    subscription: `primary` "[" `expression_list` "]"
 
-The primary must evaluate to an object that supports subscription, e.g. a list
-or dictionary.  User-defined objects can support subscription by defining a
-:meth:`__getitem__` method.
+The primary must evaluate to an object that supports subscription (lists or
+dictionaries for example).  User-defined objects can support subscription by
+defining a :meth:`__getitem__` method.
 
 For built-in objects, there are two types of objects that support subscription:
 
@@ -621,8 +620,8 @@
    single: stop (slice object attribute)
    single: step (slice object attribute)
 
-The semantics for a slicing are as follows.  The primary must evaluate to a
-mapping object, and it is indexed (using the same :meth:`__getitem__` method as
+The semantics for a slicing are as follows.  The primary is indexed (using the
+same :meth:`__getitem__` method as
 normal subscription) with a key that is constructed from the slice list, as
 follows.  If the slice list contains at least one comma, the key is a tuple
 containing the conversion of the slice items; otherwise, the conversion of the
@@ -660,8 +659,8 @@
    keyword_arguments: `keyword_item` ("," `keyword_item`)*
    keyword_item: `identifier` "=" `expression`
 
-A trailing comma may be present after the positional and keyword arguments but
-does not affect the semantics.
+An optional trailing comma may be present after the positional and keyword arguments
+but does not affect the semantics.
 
 .. index::
    single: parameter; call semantics
@@ -943,9 +942,9 @@
 .. index:: single: addition
 
 The ``+`` (addition) operator yields the sum of its arguments.  The arguments
-must either both be numbers or both sequences of the same type.  In the former
-case, the numbers are converted to a common type and then added together.  In
-the latter case, the sequences are concatenated.
+must either both be numbers or both be sequences of the same type.  In the
+former case, the numbers are converted to a common type and then added together.
+In the latter case, the sequences are concatenated.
 
 .. index:: single: subtraction
 
@@ -1106,7 +1105,7 @@
   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
+Comparison of objects of 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``.
@@ -1116,7 +1115,7 @@
 The operators :keyword:`in` and :keyword:`not in` test for membership.  ``x in
 s`` evaluates to true if *x* is a member of *s*, and false otherwise.  ``x not
 in s`` returns the negation of ``x in s``.  All built-in sequences and set types
-support this as well as dictionary, for which :keyword:`in` tests whether a the
+support this as well as dictionary, for which :keyword:`in` tests whether the
 dictionary has a given key. For container types such as list, tuple, set,
 frozenset, dict, or collections.deque, the expression ``x in y`` is equivalent
 to ``any(x is e or x == e for e in y)``.
@@ -1202,9 +1201,9 @@
 they return to ``False`` and ``True``, but rather return the last evaluated
 argument.  This is sometimes useful, e.g., if ``s`` is a string that should be
 replaced by a default value if it is empty, the expression ``s or 'foo'`` yields
-the desired value.  Because :keyword:`not` has to invent a value anyway, it does
-not bother to return a value of the same type as its argument, so e.g., ``not
-'foo'`` yields ``False``, not ``''``.)
+the desired value.  Because :keyword:`not` has to create a new value, it
+returns a boolean value regardless of the type of its argument
+(for example, ``not 'foo'`` produces ``False`` rather than ``''``.)
 
 
 Conditional expressions
@@ -1222,8 +1221,8 @@
 Conditional expressions (sometimes called a "ternary operator") have the lowest
 priority of all Python operations.
 
-The expression ``x if C else y`` first evaluates the condition, *C* (*not* *x*);
-if *C* is true, *x* is evaluated and its value is returned; otherwise, *y* is
+The expression ``x if C else y`` first evaluates the condition, *C* rather than *x*.
+If *C* is true, *x* is evaluated and its value is returned; otherwise, *y* is
 evaluated and its value is returned.
 
 See :pep:`308` for more details about conditional expressions.
@@ -1244,10 +1243,9 @@
    lambda_expr: "lambda" [`parameter_list`]: `expression`
    lambda_expr_nocond: "lambda" [`parameter_list`]: `expression_nocond`
 
-Lambda expressions (sometimes called lambda forms) have the same syntactic position as
-expressions.  They are a shorthand to create anonymous functions; the expression
-``lambda arguments: expression`` yields a function object.  The unnamed object
-behaves like a function object defined with ::
+Lambda expressions (sometimes called lambda forms) are used to create anonymous
+functions. The expression ``lambda arguments: expression`` yields a function
+object.  The unnamed object behaves like a function object defined with ::
 
    def <lambda>(arguments):
        return expression
@@ -1310,13 +1308,15 @@
 
 .. index:: pair: operator; precedence
 
-The following table summarizes the operator precedences in Python, from lowest
+The following table summarizes the operator precedence in Python, from lowest
 precedence (least binding) to highest precedence (most binding).  Operators in
 the same box have the same precedence.  Unless the syntax is explicitly given,
 operators are binary.  Operators in the same box group left to right (except for
-comparisons, including tests, which all have the same precedence and chain from
-left to right --- see section :ref:`comparisons` --- and exponentiation, which
-groups from right to left).
+exponentiation, which groups from right to left).
+
+Note that comparisons, membership tests, and identity tests, all have the same
+precedence and have a left-to-right chaining feature as described in the
+:ref:`comparisons` section.
 
 
 +-----------------------------------------------+-------------------------------------+
diff --git a/Doc/reference/import.rst b/Doc/reference/import.rst
index eb497a1..e9b7e53 100644
--- a/Doc/reference/import.rst
+++ b/Doc/reference/import.rst
@@ -210,6 +210,7 @@
 .. index::
     single: finder
     single: loader
+    single: module spec
 
 If the named module is not found in :data:`sys.modules`, then Python's import
 protocol is invoked to find and load the module.  This protocol consists of
@@ -230,13 +231,17 @@
 range and scope of module searching.
 
 Finders do not actually load modules.  If they can find the named module, they
-return a :term:`loader`, which the import machinery then invokes to load the
-module and create the corresponding module object.
+return a :dfn:`module spec`, an encapsulation of the module's import-related
+information, which the import machinery then uses when loading the module.
 
 The following sections describe the protocol for finders and loaders in more
 detail, including how you can create and register new ones to extend the
 import machinery.
 
+.. versionchanged:: 3.4
+   In previous versions of Python, finders returned :term:`loaders <loader>`
+   directly, whereas now they return module specs which *contain* loaders.
+   Loaders are still used during import but have fewer responsibilities.
 
 Import hooks
 ------------
@@ -270,41 +275,43 @@
 
 .. index::
     single: sys.meta_path
-    pair: finder; find_module
-    pair: finder; find_loader
+    pair: finder; find_spec
 
 When the named module is not found in :data:`sys.modules`, Python next
 searches :data:`sys.meta_path`, which contains a list of meta path finder
 objects.  These finders are queried in order to see if they know how to handle
 the named module.  Meta path finders must implement a method called
-:meth:`find_module()` which takes two arguments, a name and an import path.
-The meta path finder can use any strategy it wants to determine whether it can
-handle the named module or not.
+:meth:`~importlib.abc.MetaPathFinder.find_spec()` which takes three arguments:
+a name, an import path, and (optionally) a target module.  The meta path
+finder can use any strategy it wants to determine whether it can handle
+the named module or not.
 
 If the meta path finder knows how to handle the named module, it returns a
-loader object.  If it cannot handle the named module, it returns ``None``.  If
+spec object.  If it cannot handle the named module, it returns ``None``.  If
 :data:`sys.meta_path` processing reaches the end of its list without returning
-a loader, then an :exc:`ImportError` is raised.  Any other exceptions raised
+a spec, then an :exc:`ImportError` is raised.  Any other exceptions raised
 are simply propagated up, aborting the import process.
 
-The :meth:`find_module()` method of meta path finders is called with two
-arguments.  The first is the fully qualified name of the module being
-imported, for example ``foo.bar.baz``.  The second argument is the path
-entries to use for the module search.  For top-level modules, the second
-argument is ``None``, but for submodules or subpackages, the second
-argument is the value of the parent package's ``__path__`` attribute. If
-the appropriate ``__path__`` attribute cannot be accessed, an
-:exc:`ImportError` is raised.
+The :meth:`~importlib.abc.MetaPathFinder.find_spec()` method of meta path
+finders is called with two or three arguments.  The first is the fully
+qualified name of the module being imported, for example ``foo.bar.baz``.
+The second argument is the path entries to use for the module search.  For
+top-level modules, the second argument is ``None``, but for submodules or
+subpackages, the second argument is the value of the parent package's
+``__path__`` attribute. If the appropriate ``__path__`` attribute cannot
+be accessed, an :exc:`ImportError` is raised.  The third argument is an
+existing module object that will be the target of loading later.  The
+import system passes in a target module only during reload.
 
 The meta path may be traversed multiple times for a single import request.
 For example, assuming none of the modules involved has already been cached,
 importing ``foo.bar.baz`` will first perform a top level import, calling
-``mpf.find_module("foo", None)`` on each meta path finder (``mpf``). After
+``mpf.find_spec("foo", None, None)`` on each meta path finder (``mpf``). After
 ``foo`` has been imported, ``foo.bar`` will be imported by traversing the
 meta path a second time, calling
-``mpf.find_module("foo.bar", foo.__path__)``. Once ``foo.bar`` has been
+``mpf.find_spec("foo.bar", foo.__path__, None)``. Once ``foo.bar`` has been
 imported, the final traversal will call
-``mpf.find_module("foo.bar.baz", foo.bar.__path__)``.
+``mpf.find_spec("foo.bar.baz", foo.bar.__path__, None)``.
 
 Some meta path finders only support top level imports. These importers will
 always return ``None`` when anything other than ``None`` is passed as the
@@ -315,129 +322,239 @@
 modules, and one that knows how to import modules from an :term:`import path`
 (i.e. the :term:`path based finder`).
 
+.. versionchanged:: 3.4
+   The :meth:`~importlib.abc.MetaPathFinder.find_spec` method of meta path
+   finders replaced :meth:`~importlib.abc.MetaPathFinder.find_module`, which
+   is now deprecated.  While it will continue to work without change, the
+   import machinery will try it only if the finder does not implement
+   ``find_spec()``.
 
-Loaders
+
+Loading
 =======
 
-If and when a module loader is found its
-:meth:`~importlib.abc.Loader.load_module` method is called, with a single
-argument, the fully qualified name of the module being imported.  This method
-has several responsibilities, and should return the module object it has
-loaded [#fnlo]_.  If it cannot load the module, it should raise an
-:exc:`ImportError`, although any other exception raised during
-:meth:`load_module()` will be propagated.
+If and when a module spec is found, the import machinery will use it (and
+the loader it contains) when loading the module.  Here is an approximation
+of what happens during the loading portion of import::
 
-In many cases, the finder and loader can be the same object; in such cases the
-:meth:`finder.find_module()` would just return ``self``.
+    module = None
+    if spec.loader is not None and hasattr(spec.loader, 'create_module'):
+        module = spec.loader.create_module(spec)
+    if module is None:
+        module = ModuleType(spec.name)
+    # The import-related module attributes get set here:
+    _init_module_attrs(spec, module)
 
-Loaders must satisfy the following requirements:
+    if spec.loader is None:
+        if spec.submodule_search_locations is not None:
+            # namespace package
+            sys.modules[spec.name] = module
+        else:
+            # unsupported
+            raise ImportError
+    elif not hasattr(spec.loader, 'exec_module'):
+        module = spec.loader.load_module(spec.name)
+        # Set __loader__ and __package__ if missing.
+    else:
+        sys.modules[spec.name] = module
+        try:
+            spec.loader.exec_module(module)
+        except BaseException:
+            try:
+                del sys.modules[spec.name]
+            except KeyError:
+                pass
+            raise
+    return sys.modules[spec.name]
+
+Note the following details:
 
  * If there is an existing module object with the given name in
-   :data:`sys.modules`, the loader must use that existing module.  (Otherwise,
-   :func:`imp.reload` will not work correctly.)  If the named module does
-   not exist in :data:`sys.modules`, the loader must create a new module
-   object and add it to :data:`sys.modules`.
+   :data:`sys.modules`, import will have already returned it.
 
-   Note that the module *must* exist in :data:`sys.modules` before the loader
+ * The module will exist in :data:`sys.modules` before the loader
    executes the module code.  This is crucial because the module code may
    (directly or indirectly) import itself; adding it to :data:`sys.modules`
    beforehand prevents unbounded recursion in the worst case and multiple
    loading in the best.
 
-   If loading fails, the loader must remove any modules it has inserted into
-   :data:`sys.modules`, but it must remove **only** the failing module, and
-   only if the loader itself has loaded it explicitly.  Any module already in
-   the :data:`sys.modules` cache, and any module that was successfully loaded
-   as a side-effect, must remain in the cache.
+ * If loading fails, the failing module -- and only the failing module --
+   gets removed from :data:`sys.modules`.  Any module already in the
+   :data:`sys.modules` cache, and any module that was successfully loaded
+   as a side-effect, must remain in the cache.  This contrasts with
+   reloading where even the failing module is left in :data:`sys.modules`.
 
- * The loader may set the ``__file__`` attribute of the module.  If set, this
-   attribute's value must be a string.  The loader may opt to leave
-   ``__file__`` unset if it has no semantic meaning (e.g. a module loaded from
-   a database). If ``__file__`` is set, it may also be appropriate to set the
-   ``__cached__`` attribute which is the path to any compiled version of the
-   code (e.g. byte-compiled file). The file does not need to exist to set this
-   attribute; the path can simply point to whether the compiled file would
-   exist (see :pep:`3147`).
+ * After the module is created but before execution, the import machinery
+   sets the import-related module attributes ("_init_module_attrs" in
+   the pseudo-code example above), as summarized in a
+   :ref:`later section <import-mod-attrs>`.
 
- * The loader may set the ``__name__`` attribute of the module.  While not
-   required, setting this attribute is highly recommended so that the
-   :meth:`repr()` of the module is more informative.
+ * Module execution is the key moment of loading in which the module's
+   namespace gets populated.  Execution is entirely delegated to the
+   loader, which gets to decide what gets populated and how.
 
- * If the module is a package (either regular or namespace), the loader must
-   set the module object's ``__path__`` attribute.  The value must be
-   iterable, but may be empty if ``__path__`` has no further significance
-   to the loader. If ``__path__`` is not empty, it must produce strings
-   when iterated over. More details on the semantics of ``__path__`` are
-   given :ref:`below <package-path-rules>`.
+ * The module created during loading and passed to exec_module() may
+   not be the one returned at the end of import [#fnlo]_.
 
- * The ``__loader__`` attribute must be set to the loader object that loaded
-   the module.  This is mostly for introspection and reloading, but can be
-   used for additional loader-specific functionality, for example getting
-   data associated with a loader.
+.. versionchanged:: 3.4
+   The import system has taken over the boilerplate responsibilities of
+   loaders.  These were previously performed by the
+   :meth:`importlib.abc.Loader.load_module` method.
 
- * The module's ``__package__`` attribute should be set.  Its value must be a
-   string, but it can be the same value as its ``__name__``.  If the attribute
-   is set to ``None`` or is missing, the import system will fill it in with a
-   more appropriate value.  When the module is a package, its ``__package__``
-   value should be set to its ``__name__``.  When the module is not a package,
-   ``__package__`` should be set to the empty string for top-level modules, or
-   for submodules, to the parent package's name.  See :pep:`366` for further
-   details.
+Loaders
+-------
 
-   This attribute is used instead of ``__name__`` to calculate explicit
-   relative imports for main modules, as defined in :pep:`366`.
+Module loaders provide the critical function of loading: module execution.
+The import machinery calls the :meth:`importlib.abc.Loader.exec_module`
+method with a single argument, the module object to execute.  Any value
+returned from :meth:`~importlib.abc.Loader.exec_module` is ignored.
+
+Loaders must satisfy the following requirements:
 
  * If the module is a Python module (as opposed to a built-in module or a
    dynamically loaded extension), the loader should execute the module's code
    in the module's global name space (``module.__dict__``).
 
+ * If the loader cannot execute the module, it should raise an
+   :exc:`ImportError`, although any other exception raised during
+   :meth:`~importlib.abc.Loader.exec_module` will be propagated.
 
-Module reprs
-------------
+In many cases, the finder and loader can be the same object; in such cases the
+:meth:`~importlib.abc.MetaPathFinder.find_spec` method would just return a
+spec with the loader set to ``self``.
 
-By default, all modules have a usable repr, however depending on the
-attributes set above, and hooks in the loader, you can more explicitly control
-the repr of module objects.
+Module loaders may opt in to creating the module object during loading
+by implementing a :meth:`~importlib.abc.Loader.create_module` method.
+It takes one argument, the module spec, and returns the new module object
+to use during loading.  ``create_module()`` does not need to set any attributes
+on the module object.  If the loader does not define ``create_module()``, the
+import machinery will create the new module itself.
 
-Loaders may implement a :meth:`module_repr()` method which takes a single
-argument, the module object.  When ``repr(module)`` is called for a module
-with a loader supporting this protocol, whatever is returned from
-``module.__loader__.module_repr(module)`` is returned as the module's repr
-without further processing.  This return value must be a string.
+.. versionadded:: 3.4
+   The create_module() method of loaders.
 
-If the module has no ``__loader__`` attribute, or the loader has no
-:meth:`module_repr()` method, then the module object implementation itself
-will craft a default repr using whatever information is available.  It will
-try to use the ``module.__name__``, ``module.__file__``, and
-``module.__loader__`` as input into the repr, with defaults for whatever
-information is missing.
+.. versionchanged:: 3.4
+   The :meth:`~importlib.abc.Loader.load_module` method was replaced by
+   :meth:`~importlib.abc.Loader.exec_module` and the import
+   machinery assumed all the boilerplate responsibilities of loading.
 
-Here are the exact rules used:
+   For compatibility with existing loaders, the import machinery will use
+   the ``load_module()`` method of loaders if it exists and the loader does
+   not also implement ``exec_module()``.  However, ``load_module()`` has been
+   deprecated and loaders should implement ``exec_module()`` instead.
 
- * If the module has a ``__loader__`` and that loader has a
-   :meth:`module_repr()` method, call it with a single argument, which is the
-   module object.  The value returned is used as the module's repr.
+   The ``load_module()`` method must implement all the boilerplate loading
+   functionality described above in addition to executing the module.  All
+   the same constraints apply, with some additional clarification:
 
- * If an exception occurs in :meth:`module_repr()`, the exception is caught
-   and discarded, and the calculation of the module's repr continues as if
-   :meth:`module_repr()` did not exist.
+    * If there is an existing module object with the given name in
+      :data:`sys.modules`, the loader must use that existing module.
+      (Otherwise, :func:`importlib.reload` will not work correctly.)  If the
+      named module does not exist in :data:`sys.modules`, the loader
+      must create a new module object and add it to :data:`sys.modules`.
 
- * If the module has a ``__file__`` attribute, this is used as part of the
-   module's repr.
+    * The module *must* exist in :data:`sys.modules` before the loader
+      executes the module code, to prevent unbounded recursion or multiple
+      loading.
 
- * If the module has no ``__file__`` but does have a ``__loader__``, then the
-   loader's repr is used as part of the module's repr.
+    * If loading fails, the loader must remove any modules it has inserted
+      into :data:`sys.modules`, but it must remove **only** the failing
+      module, and only if the loader itself has loaded it explicitly.
 
- * Otherwise, just use the module's ``__name__`` in the repr.
+Module spec
+-----------
 
-This example, from :pep:`420` shows how a loader can craft its own module
-repr::
+The import machinery uses a variety of information about each module
+during import, especially before loading.  Most of the information is
+common to all modules.  The purpose of a module's spec is to encapsulate
+this import-related information on a per-module basis.
 
-    class NamespaceLoader:
-        @classmethod
-        def module_repr(cls, module):
-            return "<module '{}' (namespace)>".format(module.__name__)
+Using a spec during import allows state to be transferred between import
+system components, e.g. between the finder that creates the module spec
+and the loader that executes it.  Most importantly, it allows the
+import machinery to perform the boilerplate operations of loading,
+whereas without a module spec the loader had that responsibility.
 
+See :class:`~importlib.machinery.ModuleSpec` for more specifics on what
+information a module's spec may hold.
+
+.. versionadded:: 3.4
+
+.. _import-mod-attrs:
+
+Import-related module attributes
+--------------------------------
+
+The import machinery fills in these attributes on each module object
+during loading, based on the module's spec, before the loader executes
+the module.
+
+.. attribute:: __name__
+
+   The ``__name__`` attribute must be set to the fully-qualified name of
+   the module.  This name is used to uniquely identify the module in
+   the import system.
+
+.. attribute:: __loader__
+
+   The ``__loader__`` attribute must be set to the loader object that
+   the import machinery used when loading the module.  This is mostly
+   for introspection, but can be used for additional loader-specific
+   functionality, for example getting data associated with a loader.
+
+.. attribute:: __package__
+
+   The module's ``__package__`` attribute must be set.  Its value must
+   be a string, but it can be the same value as its ``__name__``.  When
+   the module is a package, its ``__package__`` value should be set to
+   its ``__name__``.  When the module is not a package, ``__package__``
+   should be set to the empty string for top-level modules, or for
+   submodules, to the parent package's name.  See :pep:`366` for further
+   details.
+
+   This attribute is used instead of ``__name__`` to calculate explicit
+   relative imports for main modules, as defined in :pep:`366`.
+
+.. attribute:: __spec__
+
+   The ``__spec__`` attribute must be set to the module spec that was
+   used when importing the module.  This is used primarily for
+   introspection and during reloading.  Setting ``__spec__``
+   appropriately applies equally to :ref:`modules initialized during
+   interpreter startup <programs>`.  The one exception is ``__main__``,
+   where ``__spec__`` is :ref:`set to None in some cases <main_spec>`.
+
+   .. versionadded:: 3.4
+
+.. attribute:: __path__
+
+   If the module is a package (either regular or namespace), the module
+   object's ``__path__`` attribute must be set.  The value must be
+   iterable, but may be empty if ``__path__`` has no further significance.
+   If ``__path__`` is not empty, it must produce strings when iterated
+   over. More details on the semantics of ``__path__`` are given
+   :ref:`below <package-path-rules>`.
+
+   Non-package modules should not have a ``__path__`` attribute.
+
+.. attribute:: __file__
+.. attribute:: __cached__
+
+   ``__file__`` is optional. If set, this attribute's value must be a
+   string.  The import system may opt to leave ``__file__`` unset if it
+   has no semantic meaning (e.g. a module loaded from a database).
+
+   If ``__file__`` is set, it may also be appropriate to set the
+   ``__cached__`` attribute which is the path to any compiled version of
+   the code (e.g. byte-compiled file). The file does not need to exist
+   to set this attribute; the path can simply point to where the
+   compiled file would exist (see :pep:`3147`).
+
+   It is also appropriate to set ``__cached__`` when ``__file__`` is not
+   set.  However, that scenario is quite atypical.  Ultimately, the
+   loader is what makes use of ``__file__`` and/or ``__cached__``.  So
+   if a loader can load from a cached module but otherwise does not load
+   from a file, that atypical scenario may be appropriate.
 
 .. _package-path-rules:
 
@@ -462,9 +579,47 @@
 attribute, and this was typically the way namespace packages were implemented
 prior to :pep:`420`.  With the adoption of :pep:`420`, namespace packages no
 longer need to supply ``__init__.py`` files containing only ``__path__``
-manipulation code; the namespace loader automatically sets ``__path__``
+manipulation code; the import machinery automatically sets ``__path__``
 correctly for the namespace package.
 
+Module reprs
+------------
+
+By default, all modules have a usable repr, however depending on the
+attributes set above, and in the module's spec, you can more explicitly
+control the repr of module objects.
+
+If the module has a spec (``__spec__``), the import machinery will try
+to generate a repr from it.  If that fails or there is no spec, the import
+system will craft a default repr using whatever information is available
+on the module.  It will try to use the ``module.__name__``,
+``module.__file__``, and ``module.__loader__`` as input into the repr,
+with defaults for whatever information is missing.
+
+Here are the exact rules used:
+
+ * If the module has a ``__spec__`` attribute, the information in the spec
+   is used to generate the repr.  The "name", "loader", "origin", and
+   "has_location" attributes are consulted.
+
+ * If the module has a ``__file__`` attribute, this is used as part of the
+   module's repr.
+
+ * If the module has no ``__file__`` but does have a ``__loader__`` that is not
+   ``None``, then the loader's repr is used as part of the module's repr.
+
+ * Otherwise, just use the module's ``__name__`` in the repr.
+
+.. versionchanged:: 3.4
+   Use of :meth:`loader.module_repr() <importlib.abc.Loader.module_repr>`
+   has been deprecated and the module spec is now used by the import
+   machinery to generate a module repr.
+
+   For backward compatibility with Python 3.3, the module repr will be
+   generated by calling the loader's
+   :meth:`~importlib.abc.Loader.module_repr` method, if defined, before
+   trying either approach described above.  However, the method is deprecated.
+
 
 The Path Based Finder
 =====================
@@ -473,8 +628,9 @@
     single: path based finder
 
 As mentioned previously, Python comes with several default meta path finders.
-One of these, called the :term:`path based finder`, searches an :term:`import
-path`, which contains a list of :term:`path entries <path entry>`.  Each path
+One of these, called the :term:`path based finder`
+(:class:`~importlib.machinery.PathFinder`), searches an :term:`import path`,
+which contains a list of :term:`path entries <path entry>`.  Each path
 entry names a location to search for modules.
 
 The path based finder itself doesn't know how to import anything. Instead, it
@@ -523,15 +679,15 @@
     single: sys.path_importer_cache
     single: PYTHONPATH
 
-The :term:`path based finder` is responsible for finding and loading Python
-modules and packages whose location is specified with a string :term:`path
-entry`.  Most path entries name locations in the file system, but they need
-not be limited to this.
+The :term:`path based finder` is responsible for finding and loading
+Python modules and packages whose location is specified with a string
+:term:`path entry`.  Most path entries name locations in the file system,
+but they need not be limited to this.
 
 As a meta path finder, the :term:`path based finder` implements the
-:meth:`find_module()` protocol previously described, however it exposes
-additional hooks that can be used to customize how modules are found and
-loaded from the :term:`import path`.
+:meth:`~importlib.abc.MetaPathFinder.find_spec` protocol previously
+described, however it exposes additional hooks that can be used to
+customize how modules are found and loaded from the :term:`import path`.
 
 Three variables are used by the :term:`path based finder`, :data:`sys.path`,
 :data:`sys.path_hooks` and :data:`sys.path_importer_cache`.  The ``__path__``
@@ -551,14 +707,16 @@
 
 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
-based finder's :meth:`find_module()` method as described previously.  When
-the ``path`` argument to :meth:`find_module()` is given, it will be a
+based finder's :meth:`~importlib.machinery.PathFinder.find_spec` method as
+described previously.  When the ``path`` argument to
+:meth:`~importlib.machinery.PathFinder.find_spec` is given, it will be a
 list of string paths to traverse - typically a package's ``__path__``
-attribute for an import within that package.  If the ``path`` argument
-is ``None``, this indicates a top level import and :data:`sys.path` is used.
+attribute for an import within that package.  If the ``path`` argument is
+``None``, this indicates a top level import and :data:`sys.path` is used.
 
 The path based finder iterates over every entry in the search path, and
-for each of these, looks for an appropriate :term:`path entry finder` for the
+for each of these, looks for an appropriate :term:`path entry finder`
+(:class:`~importlib.abc.PathEntryFinder`) for the
 path entry.  Because this can be an expensive operation (e.g. there may be
 `stat()` call overheads for this search), the path based finder maintains
 a cache mapping path entries to path entry finders.  This cache is maintained
@@ -575,59 +733,82 @@
 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`.
+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
-will store ``None`` in :data:`sys.path_importer_cache` (to indicate that
-there is no finder for this path entry) and return ``None``, indicating that
-this :term:`meta path finder` could not find the module.
+being returned, then the path based finder's
+:meth:`~importlib.machinery.PathFinder.find_spec` method will store ``None``
+in :data:`sys.path_importer_cache` (to indicate that there is no finder for
+this path entry) and return ``None``, indicating that this
+:term:`meta path finder` could not find the module.
 
 If a :term:`path entry finder` *is* returned by one of the :term:`path entry
 hook` callables on :data:`sys.path_hooks`, then the following protocol is used
-to ask the finder for a module loader, which is then used to load the module.
-
+to ask the finder for a module spec, which is then used when loading the
+module.
 
 Path entry finder protocol
 --------------------------
 
 In order to support imports of modules and initialized packages and also to
 contribute portions to namespace packages, path entry finders must implement
-the :meth:`find_loader()` method.
+the :meth:`~importlib.abc.PathEntryFinder.find_spec` method.
 
-:meth:`find_loader()` takes one argument, the fully qualified name of the
-module being imported.  :meth:`find_loader()` returns a 2-tuple where the
-first item is the loader and the second item is a namespace :term:`portion`.
-When the first item (i.e. the loader) is ``None``, this means that while the
-path entry finder does not have a loader for the named module, it knows that the
-path entry contributes to a namespace portion for the named module.  This will
-almost always be the case where Python is asked to import a namespace package
-that has no physical presence on the file system.  When a path entry finder
-returns ``None`` for the loader, the second item of the 2-tuple return value
-must be a sequence, although it can be empty.
+:meth:`~importlib.abc.PathEntryFinder.find_spec` takes two argument, the
+fully qualified name of the module being imported, and the (optional) target
+module.  ``find_spec()`` returns a fully populated spec for the module.
+This spec will always have "loader" set (with one exception).
 
-If :meth:`find_loader()` returns a non-``None`` loader value, the portion is
-ignored and the loader is returned from the path based finder, terminating
-the search through the path entries.
+To indicate to the import machinery that the spec represents a namespace
+:term:`portion`. the path entry finder sets "loader" on the spec to
+``None`` and "submodule_search_locations" to a list containing the
+portion.
 
-For backwards compatibility with other implementations of the import
-protocol, many path entry finders also support the same,
-traditional :meth:`find_module()` method that meta path finders support.
-However path entry finder :meth:`find_module()` methods are never called
-with a ``path`` argument (they are expected to record the appropriate
-path information from the initial call to the path hook).
+.. versionchanged:: 3.4
+   :meth:`~importlib.abc.PathEntryFinder.find_spec` replaced
+   :meth:`~importlib.abc.PathEntryFinder.find_loader` and
+   :meth:`~importlib.abc.PathEntryFinder.find_module`, both of which
+   are now deprecated, but will be used if ``find_spec()`` is not defined.
 
-The :meth:`find_module()` method on path entry finders is deprecated,
-as it does not allow the path entry finder to contribute portions to
-namespace packages. Instead path entry finders should implement the
-:meth:`find_loader()` method as described above. If it exists on the path
-entry finder, the import system will always call :meth:`find_loader()`
-in preference to :meth:`find_module()`.
+   Older path entry finders may implement one of these two deprecated methods
+   instead of ``find_spec()``.  The methods are still respected for the
+   sake of backward compatibility.  Howevever, if ``find_spec()`` is
+   implemented on the path entry finder, the legacy methods are ignored.
+
+   :meth:`~importlib.abc.PathEntryFinder.find_loader` takes one argument, the
+   fully qualified name of the module being imported.  ``find_loader()``
+   returns a 2-tuple where the first item is the loader and the second item
+   is a namespace :term:`portion`.  When the first item (i.e. the loader) is
+   ``None``, this means that while the path entry finder does not have a
+   loader for the named module, it knows that the path entry contributes to
+   a namespace portion for the named module.  This will almost always be the
+   case where Python is asked to import a namespace package that has no
+   physical presence on the file system.  When a path entry finder returns
+   ``None`` for the loader, the second item of the 2-tuple return value must
+   be a sequence, although it can be empty.
+
+   If ``find_loader()`` returns a non-``None`` loader value, the portion is
+   ignored and the loader is returned from the path based finder, terminating
+   the search through the path entries.
+
+   For backwards compatibility with other implementations of the import
+   protocol, many path entry finders also support the same,
+   traditional ``find_module()`` method that meta path finders support.
+   However path entry finder ``find_module()`` methods are never called
+   with a ``path`` argument (they are expected to record the appropriate
+   path information from the initial call to the path hook).
+
+   The ``find_module()`` method on path entry finders is deprecated,
+   as it does not allow the path entry finder to contribute portions to
+   namespace packages.  If both ``find_loader()`` and ``find_module()``
+   exist on a path entry finder, the import system will always call
+   ``find_loader()`` in preference to ``find_module()``.
 
 
 Replacing the standard import system
@@ -646,9 +827,54 @@
 To selectively prevent import of some modules from a hook early on the
 meta path (rather than disabling the standard import system entirely),
 it is sufficient to raise :exc:`ImportError` directly from
-:meth:`find_module` instead of returning ``None``. The latter indicates
-that the meta path search should continue. while raising an exception
-terminates it immediately.
+:meth:`~importlib.abc.MetaPathFinder.find_spec` instead of returning
+``None``. The latter indicates that the meta path search should continue,
+while raising an exception terminates it immediately.
+
+
+Special considerations for __main__
+===================================
+
+The :mod:`__main__` module is a special case relative to Python's import
+system.  As noted :ref:`elsewhere <programs>`, the ``__main__`` module
+is directly initialized at interpreter startup, much like :mod:`sys` and
+:mod:`builtins`.  However, unlike those two, it doesn't strictly
+qualify as a built-in module.  This is because the manner in which
+``__main__`` is initialized depends on the flags and other options with
+which the interpreter is invoked.
+
+.. _main_spec:
+
+__main__.__spec__
+-----------------
+
+Depending on how :mod:`__main__` is initialized, ``__main__.__spec__``
+gets set appropriately or to ``None``.
+
+When Python is started with the :option:`-m` option, ``__spec__`` is set
+to the module spec of the corresponding module or package. ``__spec__`` is
+also populated when the ``__main__`` module is loaded as part of executing a
+directory, zipfile or other :data:`sys.path` entry.
+
+In :ref:`the remaining cases <using-on-interface-options>`
+``__main__.__spec__`` is set to ``None``, as the code used to populate the
+:mod:`__main__` does not correspond directly with an importable module:
+
+- interactive prompt
+- -c switch
+- running from stdin
+- running directly from a source or bytecode file
+
+Note that ``__main__.__spec__`` is always ``None`` in the last case,
+*even if* the file could technically be imported directly as a module
+instead. Use the :option:`-m` switch if valid module metadata is desired
+in :mod:`__main__`.
+
+Note also that even when ``__main__`` corresponds with an importable module
+and ``__main__.__spec__`` is set accordingly, they're still considered
+*distinct* modules. This is due to the fact that blocks guarded by
+``if __name__ == "__main__":`` checks only execute when the module is used
+to populate the ``__main__`` namespace, and not during normal import.
 
 
 Open issues
@@ -663,13 +889,19 @@
 XXX runpy, pkgutil, et al in the library manual should all get "See Also"
 links at the top pointing to the new import system section.
 
+XXX Add more explanation regarding the different ways in which
+``__main__`` is initialized?
+
+XXX Add more info on ``__main__`` quirks/pitfalls (i.e. copy from
+:pep:`395`).
+
 
 References
 ==========
 
 The import machinery has evolved considerably since Python's early days.  The
 original `specification for packages
-<http://www.python.org/doc/essays/packages.html>`_ is still available to read,
+<http://legacy.python.org/doc/essays/packages.html>`_ is still available to read,
 although some details have changed since the writing of that document.
 
 The original specification for :data:`sys.meta_path` was :pep:`302`, with
@@ -688,6 +920,11 @@
 
 :pep:`338` defines executing modules as scripts.
 
+:pep:`451` adds the encapsulation of per-module import state in spec
+objects.  It also off-loads most of the boilerplate responsibilities of
+loaders back onto the import machinery.  These changes allow the
+deprecation of several APIs in the import system and also addition of new
+methods to finders and loaders.
 
 .. rubric:: Footnotes
 
diff --git a/Doc/reference/introduction.rst b/Doc/reference/introduction.rst
index 0ac5794..5633ae3 100644
--- a/Doc/reference/introduction.rst
+++ b/Doc/reference/introduction.rst
@@ -66,7 +66,7 @@
    An alternate Python for .NET.  Unlike Python.NET, this is a complete Python
    implementation that generates IL, and compiles Python code directly to .NET
    assemblies.  It was created by Jim Hugunin, the original creator of Jython.  For
-   more information, see `the IronPython website <http://www.ironpython.net/>`_.
+   more information, see `the IronPython website <http://ironpython.net/>`_.
 
 PyPy
    An implementation of Python written completely in Python. It supports several
diff --git a/Doc/reference/lexical_analysis.rst b/Doc/reference/lexical_analysis.rst
index 0ed3d3b..2bf66b1 100644
--- a/Doc/reference/lexical_analysis.rst
+++ b/Doc/reference/lexical_analysis.rst
@@ -76,7 +76,7 @@
 Encoding declarations
 ---------------------
 
-.. index:: source character set, encodings
+.. index:: source character set, encoding declarations (source file)
 
 If a comment in the first or second line of the Python script matches the
 regular expression ``coding[=:]\s*([-\w.]+)``, this comment is processed as an
@@ -310,7 +310,9 @@
 * *Mc* - spacing combining marks
 * *Nd* - decimal numbers
 * *Pc* - connector punctuations
-* *Other_ID_Start* - explicit list of characters in `PropList.txt <http://unicode.org/Public/UNIDATA/PropList.txt>`_ to support backwards compatibility
+* *Other_ID_Start* - explicit list of characters in `PropList.txt
+  <http://www.unicode.org/Public/6.3.0/ucd/PropList.txt>`_ to support backwards
+  compatibility
 * *Other_ID_Continue* - likewise
 
 All identifiers are converted into the normal form NFKC while parsing; comparison
@@ -441,7 +443,7 @@
 may only contain ASCII characters; bytes with a numeric value of 128 or greater
 must be expressed with escapes.
 
-As of Python 3.3 it is possible again to prefix unicode strings with a
+As of Python 3.3 it is possible again to prefix string literals with a
 ``u`` prefix to simplify maintenance of dual 2.x and 3.x codebases.
 
 Both string and bytes literals may optionally be prefixed with a letter ``'r'``
@@ -451,24 +453,24 @@
 unicode literals behave differently than Python 3.x's the ``'ur'`` syntax
 is not supported.
 
-   .. versionadded:: 3.3
-      The ``'rb'`` prefix of raw bytes literals has been added as a synonym
-      of ``'br'``.
+.. versionadded:: 3.3
+   The ``'rb'`` prefix of raw bytes literals has been added as a synonym
+   of ``'br'``.
 
-   .. versionadded:: 3.3
-      Support for the unicode legacy literal (``u'value'``) was reintroduced
-      to simplify the maintenance of dual Python 2.x and 3.x codebases.
-      See :pep:`414` for more information.
+.. versionadded:: 3.3
+   Support for the unicode legacy literal (``u'value'``) was reintroduced
+   to simplify the maintenance of dual Python 2.x and 3.x codebases.
+   See :pep:`414` for more information.
 
-In triple-quoted strings, unescaped newlines and quotes are allowed (and are
-retained), except that three unescaped quotes in a row terminate the string.  (A
-"quote" is the character used to open the string, i.e. either ``'`` or ``"``.)
+In triple-quoted literals, unescaped newlines and quotes are allowed (and are
+retained), except that three unescaped quotes in a row terminate the literal.  (A
+"quote" is the character used to open the literal, i.e. either ``'`` or ``"``.)
 
 .. index:: physical line, escape sequence, Standard C, C
 
-Unless an ``'r'`` or ``'R'`` prefix is present, escape sequences in strings are
-interpreted according to rules similar to those used by Standard C.  The
-recognized escape sequences are:
+Unless an ``'r'`` or ``'R'`` prefix is present, escape sequences in string and
+bytes literals are interpreted according to rules similar to those used by
+Standard C.  The recognized escape sequences are:
 
 +-----------------+---------------------------------+-------+
 | Escape Sequence | Meaning                         | Notes |
@@ -545,20 +547,20 @@
 .. index:: unrecognized escape sequence
 
 Unlike Standard C, all unrecognized escape sequences are left in the string
-unchanged, i.e., *the backslash is left in the string*.  (This behavior is
+unchanged, i.e., *the backslash is left in the result*.  (This behavior is
 useful when debugging: if an escape sequence is mistyped, the resulting output
 is more easily recognized as broken.)  It is also important to note that the
 escape sequences only recognized in string literals fall into the category of
 unrecognized escapes for bytes literals.
 
-Even in a raw string, string quotes can be escaped with a backslash, but the
-backslash remains in the string; for example, ``r"\""`` is a valid string
+Even in a raw literal, quotes can be escaped with a backslash, but the
+backslash remains in the result; for example, ``r"\""`` is a valid string
 literal consisting of two characters: a backslash and a double quote; ``r"\"``
 is not a valid string literal (even a raw string cannot end in an odd number of
-backslashes).  Specifically, *a raw string cannot end in a single backslash*
+backslashes).  Specifically, *a raw literal cannot end in a single backslash*
 (since the backslash would escape the following quote character).  Note also
 that a single backslash followed by a newline is interpreted as those two
-characters as part of the string, *not* as a line continuation.
+characters as part of the literal, *not* as a line continuation.
 
 
 .. _string-catenation:
@@ -726,4 +728,4 @@
 
 .. rubric:: Footnotes
 
-.. [#] http://www.unicode.org/Public/6.1.0/ucd/NameAliases.txt
+.. [#] http://www.unicode.org/Public/6.3.0/ucd/NameAliases.txt
diff --git a/Doc/reference/simple_stmts.rst b/Doc/reference/simple_stmts.rst
index 40bbc39..8946b4f 100644
--- a/Doc/reference/simple_stmts.rst
+++ b/Doc/reference/simple_stmts.rst
@@ -7,7 +7,7 @@
 
 .. index:: pair: simple; statement
 
-Simple statements are comprised within a single logical line. Several simple
+A simple statement is comprised within a single logical line. Several simple
 statements may occur on a single line separated by semicolons.  The syntax for
 simple statements is:
 
@@ -70,6 +70,7 @@
 =====================
 
 .. index::
+   single: =; assignment statement
    pair: assignment; statement
    pair: binding; name
    pair: rebinding; name
@@ -90,8 +91,8 @@
          : | `slicing`
          : | "*" `target`
 
-(See section :ref:`primaries` for the syntax definitions for the last three
-symbols.)
+(See section :ref:`primaries` for the syntax definitions for *attributeref*,
+*subscription*, and *slicing*.)
 
 An assignment statement evaluates the expression list (remember that this can be
 a single expression or a comma-separated list, the latter yielding a tuple) and
@@ -227,7 +228,7 @@
   inclusive.  Finally, the sequence object is asked to replace the slice with
   the items of the assigned sequence.  The length of the slice may be different
   from the length of the assigned sequence, thus changing the length of the
-  target sequence, if the object allows it.
+  target sequence, if the target sequence allows it.
 
 .. impl-detail::
 
@@ -235,14 +236,15 @@
    as for expressions, and invalid syntax is rejected during the code generation
    phase, causing less detailed error messages.
 
-WARNING: Although the definition of assignment implies that overlaps between the
-left-hand side and the right-hand side are 'safe' (for example ``a, b = b, a``
-swaps two variables), overlaps *within* the collection of assigned-to variables
-are not safe!  For instance, the following program prints ``[0, 2]``::
+Although the definition of assignment implies that overlaps between the
+left-hand side and the right-hand side are 'simultanenous' (for example ``a, b =
+b, a`` swaps two variables), overlaps *within* the collection of assigned-to
+variables occur left-to-right, sometimes resulting in confusion.  For instance,
+the following program prints ``[0, 2]``::
 
    x = [0, 1]
    i = 0
-   i, x[i] = 1, 2
+   i, x[i] = 1, 2         # i is updated, then x[i] is updated
    print(x)
 
 
@@ -260,6 +262,18 @@
 .. index::
    pair: augmented; assignment
    single: statement; assignment, augmented
+   single: +=; augmented assignment
+   single: -=; augmented assignment
+   single: *=; augmented assignment
+   single: /=; augmented assignment
+   single: %=; augmented assignment
+   single: &=; augmented assignment
+   single: ^=; augmented assignment
+   single: |=; augmented assignment
+   single: **=; augmented assignment
+   single: //=; augmented assignment
+   single: >>=; augmented assignment
+   single: <<=; augmented assignment
 
 Augmented assignment is the combination, in a single statement, of a binary
 operation and an assignment statement:
@@ -270,7 +284,7 @@
    augop: "+=" | "-=" | "*=" | "/=" | "//=" | "%=" | "**="
         : | ">>=" | "<<=" | "&=" | "^=" | "|="
 
-(See section :ref:`primaries` for the syntax definitions for the last three
+(See section :ref:`primaries` for the syntax definitions of the last three
 symbols.)
 
 An augmented assignment evaluates the target (which, unlike normal assignment
@@ -284,6 +298,11 @@
 is performed *in-place*, meaning that rather than creating a new object and
 assigning that to the target, the old object is modified instead.
 
+Unlike normal assignments, augmented assignments evaluate the left-hand side
+*before* evaluating the right-hand side.  For example, ``a[i] += f(x)`` first
+looks-up ``a[i]``, then it evaluates ``f(x)`` and performs the addition, and
+lastly, it writes the result back to ``a[i]``.
+
 With the exception of assigning to tuples and multiple targets in a single
 statement, the assignment done by augmented assignment statements is handled the
 same way as normal assignments. Similarly, with the exception of the possible
@@ -529,8 +548,8 @@
    RuntimeError: Something bad happened
 
 A similar mechanism works implicitly if an exception is raised inside an
-exception handler: the previous exception is then attached as the new
-exception's :attr:`__context__` attribute::
+exception handler or a :keyword:`finally` clause: the previous exception is then
+attached as the new exception's :attr:`__context__` attribute::
 
    >>> try:
    ...     print(1 / 0)
@@ -645,7 +664,7 @@
 as though the clauses had been separated out into individiual import
 statements.
 
-The details of the first step, finding and loading modules is described in
+The details of the first step, finding and loading modules are described in
 greater detail in the section on the :ref:`import system <importsystem>`,
 which also describes the various types of packages and modules that can
 be imported, as well as all the hooks that can be used to customize
@@ -656,6 +675,8 @@
 If the requested module is retrieved successfully, it will be made
 available in the local namespace in one of three ways:
 
+.. index:: single: as; import statement
+
 * If the module name is followed by :keyword:`as`, then the name
   following :keyword:`as` is bound directly to the imported module.
 * If no other name is specified, and the module being imported is a top
@@ -674,7 +695,7 @@
 
 The :keyword:`from` form uses a slightly more complex process:
 
-#. find the module specified in the :keyword:`from` clause loading and
+#. find the module specified in the :keyword:`from` clause, loading and
    initializing it if necessary;
 #. for each of the identifiers specified in the :keyword:`import` clauses:
 
@@ -682,7 +703,7 @@
    #. if not, attempt to import a submodule with that name and then
       check the imported module again for that attribute
    #. if the attribute is not found, :exc:`ImportError` is raised.
-   #. otherwise, a reference to that value is bound in the local namespace,
+   #. otherwise, a reference to that value is stored in the local namespace,
       using the name in the :keyword:`as` clause if it is present,
       otherwise using the attribute name
 
@@ -710,10 +731,9 @@
 to avoid accidentally exporting items that are not part of the API (such as
 library modules which were imported and used within the module).
 
-The :keyword:`from` form with ``*`` may only occur in a module scope.  The wild
-card form of import --- ``import *`` --- is only allowed at the module level.
-Attempting to use it in class or function definitions will raise a
-:exc:`SyntaxError`.
+The wild card form of import --- ``from module import *`` --- is only allowed at
+the module level.  Attempting to use it in class or function definitions will
+raise a :exc:`SyntaxError`.
 
 .. index::
     single: relative; import
@@ -732,7 +752,7 @@
 The specification for relative imports is contained within :pep:`328`.
 
 :func:`importlib.import_module` is provided to support applications that
-determine which modules need to be loaded dynamically.
+determine dynamically the modules to be loaded.
 
 
 .. _future:
@@ -744,10 +764,12 @@
 
 A :dfn:`future statement` is a directive to the compiler that a particular
 module should be compiled using syntax or semantics that will be available in a
-specified future release of Python.  The future statement is intended to ease
-migration to future versions of Python that introduce incompatible changes to
-the language.  It allows use of the new features on a per-module basis before
-the release in which the feature becomes standard.
+specified future release of Python where the feature becomes standard.
+
+The future statement is intended to ease migration to future versions of Python
+that introduce incompatible changes to the language.  It allows use of the new
+features on a per-module basis before the release in which the feature becomes
+standard.
 
 .. productionlist:: *
    future_statement: "from" "__future__" "import" feature ["as" name]
@@ -842,7 +864,7 @@
 
 .. impl-detail::
 
-   The current implementation does not enforce the latter two restrictions, but
+   The current implementation does not enforce the two restrictions, but
    programs should not abuse this freedom, as future implementations may enforce
    them or silently change the meaning of the program.
 
@@ -875,16 +897,16 @@
                 : | "nonlocal" identifier augop expression_list
 
 The :keyword:`nonlocal` statement causes the listed identifiers to refer to
-previously bound variables in the nearest enclosing scope.  This is important
-because the default behavior for binding is to search the local namespace
-first.  The statement allows encapsulated code to rebind variables outside of
-the local scope besides the global (module) scope.
+previously bound variables in the nearest enclosing scope excluding globals.
+This is important because the default behavior for binding is to search the
+local namespace first.  The statement allows encapsulated code to rebind
+variables outside of the local scope besides the global (module) scope.
 
 .. XXX not implemented
    The :keyword:`nonlocal` statement may prepend an assignment or augmented
    assignment, but not an expression.
 
-Names listed in a :keyword:`nonlocal` statement, unlike to those listed in a
+Names listed in a :keyword:`nonlocal` statement, unlike those listed in a
 :keyword:`global` statement, must refer to pre-existing bindings in an
 enclosing scope (the scope in which a new binding should be created cannot
 be determined unambiguously).
diff --git a/Doc/reference/toplevel_components.rst b/Doc/reference/toplevel_components.rst
index f4bc71f..e1687ff 100644
--- a/Doc/reference/toplevel_components.rst
+++ b/Doc/reference/toplevel_components.rst
@@ -97,20 +97,10 @@
 ================
 
 .. index:: single: input
-
 .. index:: builtin: eval
 
-There are two forms of expression input.  Both ignore leading whitespace. The
+:func:`eval` is used for expression input.  It ignores leading whitespace. The
 string argument to :func:`eval` must have the following form:
 
 .. productionlist::
    eval_input: `expression_list` NEWLINE*
-
-.. index::
-   object: file
-   single: input; raw
-   single: readline() (file method)
-
-Note: to read 'raw' input line without interpretation, you can use the
-:meth:`readline` method of file objects, including ``sys.stdin``.
-
diff --git a/Doc/tools/sphinxext/c_annotations.py b/Doc/tools/extensions/c_annotations.py
similarity index 93%
rename from Doc/tools/sphinxext/c_annotations.py
rename to Doc/tools/extensions/c_annotations.py
index 8b5167a..baa39f3 100644
--- a/Doc/tools/sphinxext/c_annotations.py
+++ b/Doc/tools/extensions/c_annotations.py
@@ -13,7 +13,7 @@
     Usage: Set the `refcount_file` config value to the path to the reference
     count data file.
 
-    :copyright: Copyright 2007-2013 by Georg Brandl.
+    :copyright: Copyright 2007-2014 by Georg Brandl.
     :license: Python license.
 """
 
@@ -81,7 +81,10 @@
                 continue
             if not par[0].has_key('names') or not par[0]['names']:
                 continue
-            entry = self.get(par[0]['names'][0])
+            name = par[0]['names'][0]
+            if name.startswith("c."):
+                name = name[2:]
+            entry = self.get(name)
             if not entry:
                 continue
             elif entry.result_type not in ("PyObject*", "PyVarObject*"):
@@ -115,3 +118,4 @@
         signode.parent['stableabi'] = 'stableabi' in self.options
         return old_handle_signature(self, sig, signode)
     CObject.handle_signature = new_handle_signature
+    return {'version': '1.0', 'parallel_read_safe': True}
diff --git a/Doc/tools/sphinxext/patchlevel.py b/Doc/tools/extensions/patchlevel.py
similarity index 100%
rename from Doc/tools/sphinxext/patchlevel.py
rename to Doc/tools/extensions/patchlevel.py
diff --git a/Doc/tools/sphinxext/pyspecific.py b/Doc/tools/extensions/pyspecific.py
similarity index 88%
rename from Doc/tools/sphinxext/pyspecific.py
rename to Doc/tools/extensions/pyspecific.py
index f2d3ca1..7baacc4 100644
--- a/Doc/tools/sphinxext/pyspecific.py
+++ b/Doc/tools/extensions/pyspecific.py
@@ -9,17 +9,32 @@
     :license: Python license.
 """
 
-ISSUE_URI = 'http://bugs.python.org/issue%s'
-SOURCE_URI = 'http://hg.python.org/cpython/file/3.3/%s'
+import re
+import codecs
+from os import path
+from time import asctime
+from pprint import pformat
+from docutils.io import StringOutput
+from docutils.utils import new_document
 
 from docutils import nodes, utils
 
-import sphinx
+from sphinx import addnodes
+from sphinx.builders import Builder
 from sphinx.util.nodes import split_explicit_title
 from sphinx.util.compat import Directive
 from sphinx.writers.html import HTMLTranslator
+from sphinx.writers.text import TextWriter
 from sphinx.writers.latex import LaTeXTranslator
-from sphinx.locale import versionlabels
+from sphinx.domains.python import PyModulelevel, PyClassmember
+
+# Support for checking for suspicious markup
+
+import suspicious
+
+
+ISSUE_URI = 'https://bugs.python.org/issue%s'
+SOURCE_URI = 'https://hg.python.org/cpython/file/3.4/%s'
 
 # monkey-patch reST parser to disable alphabetic and roman enumerated lists
 from docutils.parsers.rst.states import Body
@@ -28,23 +43,12 @@
     Body.enum.converters['lowerroman'] = \
     Body.enum.converters['upperroman'] = lambda x: None
 
-SPHINX11 = sphinx.__version__[:3] < '1.2'
-
-if SPHINX11:
-    # monkey-patch HTML translator to give versionmodified paragraphs a class
-    def new_visit_versionmodified(self, node):
-        self.body.append(self.starttag(node, 'p', CLASS=node['type']))
-        text = versionlabels[node['type']] % node['version']
-        if len(node):
-            text += ':'
-        else:
-            text += '.'
-        self.body.append('<span class="versionmodified">%s</span> ' % text)
-    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
+orig_depart_literal_block = LaTeXTranslator.depart_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
@@ -55,9 +59,7 @@
     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
@@ -68,8 +70,11 @@
     finally:
         self.highlighter.trim_doctest_flags = old_trim_doctest_flags
 
+
+HTMLTranslator.visit_literal_block = new_visit_literal_block
 LaTeXTranslator.depart_literal_block = new_depart_literal_block
 
+
 # Support for marking up and linking to bugs.python.org issues
 
 def issue_role(typ, rawtext, text, lineno, inliner, options={}, content=[]):
@@ -117,9 +122,6 @@
 
 # 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)
@@ -129,12 +131,14 @@
     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'
@@ -168,35 +172,31 @@
             messages = []
         if self.content:
             self.state.nested_parse(self.content, self.content_offset, node)
+        if len(node):
             if isinstance(node[0], nodes.paragraph) and node[0].rawsource:
                 content = nodes.inline(node[0].rawsource, translatable=True)
                 content.source = node[0].source
                 content.line = node[0].line
                 content += node[0].children
                 node[0].replace_self(nodes.paragraph('', '', content))
-            if not SPHINX11:
-                node[0].insert(0, nodes.inline('', '%s: ' % text,
-                                               classes=['versionmodified']))
-        elif not SPHINX11:
+            node[0].insert(0, nodes.inline('', '%s: ' % text,
+                                           classes=['versionmodified']))
+        else:
             para = nodes.paragraph('', '',
-                nodes.inline('', '%s.' % text, classes=['versionmodified']))
+                                   nodes.inline('', '%s.' % text,
+                                                classes=['versionmodified']))
             node.append(para)
         env = self.state.document.settings.env
         env.note_versionchange('deprecated', version[0], node, self.lineno)
         return [node] + messages
 
-# for Sphinx < 1.2
-versionlabels['deprecated-removed'] = DeprecatedRemoved._label
-
 
 # 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
@@ -221,7 +221,7 @@
             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 = issue_re.sub(r'`\1ssue #\2 <https://bugs.python.org/\2>`__',
                                content)
         content = whatsnew_re.sub(r'\1', content)
         # remove first 3 lines as they are the main heading
@@ -250,15 +250,6 @@
     'typesseq', 'typesseq-mutable', 'unary', 'while', 'with', 'yield'
 ]
 
-from os import path
-from time import asctime
-from pprint import pformat
-from docutils.io import StringOutput
-from docutils.utils import new_document
-
-from sphinx.builders import Builder
-from sphinx.writers.text import TextWriter
-
 
 class PydocTopicsBuilder(Builder):
     name = 'pydoc-topics'
@@ -286,29 +277,23 @@
             document.append(doctree.ids[labelid])
             destination = StringOutput(encoding='utf-8')
             writer.write(document, destination)
-            self.topics[label] = writer.output.encode('utf-8')
+            self.topics[label] = writer.output
 
     def finish(self):
-        f = open(path.join(self.outdir, 'topics.py'), 'w')
+        f = open(path.join(self.outdir, 'topics.py'), 'wb')
         try:
-            f.write('# -*- coding: utf-8 -*-\n')
-            f.write('# Autogenerated by Sphinx on %s\n' % asctime())
-            f.write('topics = ' + pformat(self.topics) + '\n')
+            f.write('# -*- coding: utf-8 -*-\n'.encode('utf-8'))
+            f.write(('# Autogenerated by Sphinx on %s\n' % asctime()).encode('utf-8'))
+            f.write(('topics = ' + pformat(self.topics) + '\n').encode('utf-8'))
         finally:
             f.close()
 
 
-# Support for checking for suspicious markup
-
-import suspicious
-
-
 # Support for documenting Opcodes
 
-import re
-
 opcode_sig_re = re.compile(r'(\w+(?:\+\d)?)(?:\s*\((.*)\))?')
 
+
 def parse_opcode_signature(env, sig, signode):
     """Transform an opcode signature into RST nodes."""
     m = opcode_sig_re.match(sig)
@@ -328,12 +313,13 @@
 pdbcmd_sig_re = re.compile(r'([a-z()!]+)\s*(.*)')
 
 # later...
-#pdbargs_tokens_re = re.compile(r'''[a-zA-Z]+  |  # identifiers
+# pdbargs_tokens_re = re.compile(r'''[a-zA-Z]+  |  # identifiers
 #                                   [.,:]+     |  # punctuation
 #                                   [\[\]()]   |  # parens
 #                                   \s+           # whitespace
 #                                   ''', re.X)
 
+
 def parse_pdb_command(env, sig, signode):
     """Transform a pdb command signature into RST nodes."""
     m = pdbcmd_sig_re.match(sig)
@@ -362,3 +348,4 @@
     app.add_directive_to_domain('py', 'decorator', PyDecoratorFunction)
     app.add_directive_to_domain('py', 'decoratormethod', PyDecoratorMethod)
     app.add_directive('miscnews', MiscNews)
+    return {'version': '1.0', 'parallel_read_safe': True}
diff --git a/Doc/tools/sphinxext/suspicious.py b/Doc/tools/extensions/suspicious.py
similarity index 98%
rename from Doc/tools/sphinxext/suspicious.py
rename to Doc/tools/extensions/suspicious.py
index ee87733..d3ed849 100644
--- a/Doc/tools/sphinxext/suspicious.py
+++ b/Doc/tools/extensions/suspicious.py
@@ -91,7 +91,7 @@
         self.log_file_name = os.path.join(self.outdir, 'suspicious.csv')
         open(self.log_file_name, 'w').close()
         # load database of previously ignored issues
-        self.load_rules(os.path.join(os.path.dirname(__file__),
+        self.load_rules(os.path.join(os.path.dirname(__file__), '..',
                                      'susp-ignored.csv'))
 
     def get_outdated_docs(self):
diff --git a/Doc/tools/sphinxext/pydoctheme/static/pydoctheme.css b/Doc/tools/pydoctheme/static/pydoctheme.css
similarity index 92%
rename from Doc/tools/sphinxext/pydoctheme/static/pydoctheme.css
rename to Doc/tools/pydoctheme/static/pydoctheme.css
index 3d995d8..50835bb 100644
--- a/Doc/tools/sphinxext/pydoctheme/static/pydoctheme.css
+++ b/Doc/tools/pydoctheme/static/pydoctheme.css
@@ -94,31 +94,31 @@
 }
 
 div.body a {
-    color: #00608f;
+    color: #0072aa;
 }
 
 div.body a:visited {
-    color: #30306f;
+    color: #6363bb;
 }
 
 div.body a:hover {
     color: #00B0E4;
 }
 
-tt, pre {
+tt, code, pre {
     font-family: monospace, sans-serif;
     font-size: 96.5%;
 }
 
-div.body tt {
+div.body tt, div.body code {
     border-radius: 3px;
 }
 
-div.body tt.descname {
+div.body tt.descname, div.body code.descname {
     font-size: 120%;
 }
 
-div.body tt.xref, div.body a tt {
+div.body tt.xref, div.body a tt, div.body code.xref, div.body a code {
     font-weight: normal;
 }
 
diff --git a/Doc/tools/sphinxext/pydoctheme/theme.conf b/Doc/tools/pydoctheme/theme.conf
similarity index 100%
rename from Doc/tools/sphinxext/pydoctheme/theme.conf
rename to Doc/tools/pydoctheme/theme.conf
diff --git a/Doc/tools/roman.py b/Doc/tools/roman.py
deleted file mode 100644
index 89ef617..0000000
--- a/Doc/tools/roman.py
+++ /dev/null
@@ -1,80 +0,0 @@
-"""Convert to and from Roman numerals"""
-
-__author__ = "Mark Pilgrim (f8dy@diveintopython.org)"
-__version__ = "1.4"
-__date__ = "8 August 2001"
-__copyright__ = """Copyright (c) 2001 Mark Pilgrim
-
-This program is part of "Dive Into Python", a free Python tutorial for
-experienced programmers.  Visit http://diveintopython.org/ for the
-latest version.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the Python 2.1.1 license, available at
-http://www.python.org/2.1.1/license.html
-"""
-
-import re
-
-#Define exceptions
-class RomanError(Exception): pass
-class OutOfRangeError(RomanError): pass
-class NotIntegerError(RomanError): pass
-class InvalidRomanNumeralError(RomanError): pass
-
-#Define digit mapping
-romanNumeralMap = (('M',  1000),
-                   ('CM', 900),
-                   ('D',  500),
-                   ('CD', 400),
-                   ('C',  100),
-                   ('XC', 90),
-                   ('L',  50),
-                   ('XL', 40),
-                   ('X',  10),
-                   ('IX', 9),
-                   ('V',  5),
-                   ('IV', 4),
-                   ('I',  1))
-
-def toRoman(n):
-    """convert integer to Roman numeral"""
-    if not (0 < n < 5000):
-        raise OutOfRangeError("number out of range (must be 1..4999)")
-    if int(n) != n:
-        raise NotIntegerError("decimals can not be converted")
-
-    result = ""
-    for numeral, integer in romanNumeralMap:
-        while n >= integer:
-            result += numeral
-            n -= integer
-    return result
-
-#Define pattern to detect valid Roman numerals
-romanNumeralPattern = re.compile("""
-    ^                   # beginning of string
-    M{0,4}              # thousands - 0 to 4 M's
-    (CM|CD|D?C{0,3})    # hundreds - 900 (CM), 400 (CD), 0-300 (0 to 3 C's),
-                        #            or 500-800 (D, followed by 0 to 3 C's)
-    (XC|XL|L?X{0,3})    # tens - 90 (XC), 40 (XL), 0-30 (0 to 3 X's),
-                        #        or 50-80 (L, followed by 0 to 3 X's)
-    (IX|IV|V?I{0,3})    # ones - 9 (IX), 4 (IV), 0-3 (0 to 3 I's),
-                        #        or 5-8 (V, followed by 0 to 3 I's)
-    $                   # end of string
-    """ ,re.VERBOSE)
-
-def fromRoman(s):
-    """convert Roman numeral to integer"""
-    if not s:
-        raise InvalidRomanNumeralError('Input can not be blank')
-    if not romanNumeralPattern.search(s):
-        raise InvalidRomanNumeralError('Invalid Roman numeral: %s' % s)
-
-    result = 0
-    index = 0
-    for numeral, integer in romanNumeralMap:
-        while s[index:index+len(numeral)] == numeral:
-            result += integer
-            index += len(numeral)
-    return result
diff --git a/Doc/tools/rstlint.py b/Doc/tools/rstlint.py
index 2cc3d12..be19ec8 100755
--- a/Doc/tools/rstlint.py
+++ b/Doc/tools/rstlint.py
@@ -15,7 +15,6 @@
 import re
 import sys
 import getopt
-import subprocess
 from os.path import join, splitext, abspath, exists
 from collections import defaultdict
 
@@ -28,14 +27,16 @@
     'parsed-literal', 'pull-quote', 'raw', 'replace',
     'restructuredtext-test-directive', 'role', 'rubric', 'sectnum', 'sidebar',
     'table', 'target-notes', 'tip', 'title', 'topic', 'unicode', 'warning',
-    # Sphinx custom ones
+    # Sphinx and Python docs custom ones
     'acks', 'attribute', 'autoattribute', 'autoclass', 'autodata',
     'autoexception', 'autofunction', 'automethod', 'automodule', 'centered',
     'cfunction', 'class', 'classmethod', 'cmacro', 'cmdoption', 'cmember',
     'code-block', 'confval', 'cssclass', 'ctype', 'currentmodule', 'cvar',
-    'data', 'deprecated', 'describe', 'directive', 'doctest', 'envvar', 'event',
-    'exception', 'function', 'glossary', 'highlight', 'highlightlang', 'index',
-    'literalinclude', 'method', 'module', 'moduleauthor', 'productionlist',
+    'data', 'decorator', 'decoratormethod', 'deprecated-removed',
+    'deprecated(?!-removed)', 'describe', 'directive', 'doctest', 'envvar',
+    'event', 'exception', 'function', 'glossary', 'highlight', 'highlightlang',
+    'impl-detail', 'index', 'literalinclude', 'method', 'miscnews', 'module',
+    'moduleauthor', 'opcode', 'pdbcommand', 'productionlist',
     'program', 'role', 'sectionauthor', 'seealso', 'sourcecode', 'staticmethod',
     'tabularcolumns', 'testcode', 'testoutput', 'testsetup', 'toctree', 'todo',
     'todolist', 'versionadded', 'versionchanged'
@@ -44,13 +45,14 @@
 all_directives = '(' + '|'.join(directives) + ')'
 seems_directive_re = re.compile(r'\.\. %s([^a-z:]|:(?!:))' % all_directives)
 default_role_re = re.compile(r'(^| )`\w([^`]*?\w)?`($| )')
-leaked_markup_re = re.compile(r'[a-z]::[^=]|:[a-z]+:|`|\.\.\s*\w+:')
+leaked_markup_re = re.compile(r'[a-z]::\s|`|\.\.\s*\w+:')
 
 
 checkers = {}
 
 checker_props = {'severity': 1, 'falsepositives': False}
 
+
 def checker(*suffixes, **kwds):
     """Decorator to register a function as a checker."""
     def deco(func):
@@ -171,10 +173,6 @@
     count = defaultdict(int)
 
     for root, dirs, files in os.walk(path):
-        # ignore subdirs controlled by svn
-        if '.svn' in dirs:
-            dirs.remove('.svn')
-
         # ignore subdirs in ignore list
         if abspath(root) in ignore:
             del dirs[:]
diff --git a/Doc/tools/sphinx-build.py b/Doc/tools/sphinx-build.py
deleted file mode 100644
index d3fe702..0000000
--- a/Doc/tools/sphinx-build.py
+++ /dev/null
@@ -1,28 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
-    Sphinx - Python documentation toolchain
-    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-    :copyright: 2007-2010 by Georg Brandl.
-    :license: Python license.
-"""
-
-import sys
-import warnings
-
-# Get rid of UserWarnings reported by pkg_resources.
-warnings.filterwarnings('ignore', category=UserWarning, module='jinja2')
-
-if __name__ == '__main__':
-
-    if sys.version_info[:3] < (2, 4, 0) or sys.version_info[:3] > (3, 0, 0):
-        sys.stderr.write("""\
-Error: Sphinx needs to be executed with Python 2.4 or newer (not 3.x though).
-(If you run this from the Makefile, you can set the PYTHON variable
-to the path of an alternative interpreter executable, e.g.,
-``make html PYTHON=python2.5``).
-""")
-        sys.exit(1)
-
-    from sphinx import main
-    sys.exit(main(sys.argv))
diff --git a/Doc/tools/sphinxext/indexsidebar.html b/Doc/tools/sphinxext/indexsidebar.html
deleted file mode 100644
index a0ec32f..0000000
--- a/Doc/tools/sphinxext/indexsidebar.html
+++ /dev/null
@@ -1,17 +0,0 @@
-            <h3>Download</h3>
-            <p><a href="{{ pathto('download') }}">Download these documents</a></p>
-	    <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.4/">Python 3.4 (in development)</a></li>
-              <li><a href="http://www.python.org/doc/versions/">Old versions</a></li>
-            </ul>
-
-            <h3>Other resources</h3>
-            <ul>
-              {# XXX: many of these should probably be merged in the main docs #}
-              <li><a href="http://www.python.org/dev/peps/">PEP Index</a></li>
-              <li><a href="http://wiki.python.org/moin/BeginnersGuide">Beginner's Guide</a></li>
-              <li><a href="http://wiki.python.org/moin/PythonBooks">Book List</a></li>
-              <li><a href="http://www.python.org/doc/av/">Audio/Visual Talks</a></li>
-            </ul>
diff --git a/Doc/tools/sphinxext/opensearch.xml b/Doc/tools/sphinxext/opensearch.xml
deleted file mode 100644
index 69cec80..0000000
--- a/Doc/tools/sphinxext/opensearch.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-{% extends "!opensearch.xml" %}
-{% block extra -%}
-<Image height="16" width="16" type="image/x-icon">http://www.python.org/images/favicon16x16.ico</Image>
-{%- endblock %}
diff --git a/Doc/tools/sphinxext/static/basic.css b/Doc/tools/sphinxext/static/basic.css
deleted file mode 100644
index 3242a81..0000000
--- a/Doc/tools/sphinxext/static/basic.css
+++ /dev/null
@@ -1,445 +0,0 @@
-/**
- * Sphinx stylesheet -- basic theme
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- */
-
-/* -- main layout ----------------------------------------------------------- */
-
-div.clearer {
-    clear: both;
-}
-
-/* -- relbar ---------------------------------------------------------------- */
-
-div.related {
-    width: 100%;
-    font-size: 90%;
-}
-
-div.related h3 {
-    display: none;
-}
-
-div.related ul {
-    margin: 0;
-    padding: 0 0 0 10px;
-    list-style: none;
-}
-
-div.related li {
-    display: inline;
-}
-
-div.related li.right {
-    float: right;
-    margin-right: 5px;
-}
-
-/* -- sidebar --------------------------------------------------------------- */
-
-div.sphinxsidebarwrapper {
-    position: relative;
-    top: 0;
-    padding: 10px 5px 0 10px;
-    word-wrap: break-word;
-}
-
-div.sphinxsidebar {
-    float: left;
-    width: 230px;
-    margin-left: -100%;
-    font-size: 90%;
-}
-
-div.sphinxsidebar ul {
-    list-style: none;
-}
-
-div.sphinxsidebar ul ul,
-div.sphinxsidebar ul.want-points {
-    margin-left: 20px;
-    list-style: square;
-}
-
-div.sphinxsidebar ul ul {
-    margin-top: 0;
-    margin-bottom: 0;
-}
-
-div.sphinxsidebar form {
-    margin-top: 10px;
-}
-
-div.sphinxsidebar input {
-    border: 1px solid #98dbcc;
-    font-family: sans-serif;
-    font-size: 1em;
-}
-
-img {
-    border: 0;
-}
-
-/* -- search page ----------------------------------------------------------- */
-
-ul.search {
-    margin: 10px 0 0 20px;
-    padding: 0;
-}
-
-ul.search li {
-    padding: 5px 0 5px 20px;
-    background-image: url(file.png);
-    background-repeat: no-repeat;
-    background-position: 0 7px;
-}
-
-ul.search li a {
-    font-weight: bold;
-}
-
-ul.search li div.context {
-    color: #888;
-    margin: 2px 0 0 30px;
-    text-align: left;
-}
-
-ul.keywordmatches li.goodmatch a {
-    font-weight: bold;
-}
-
-/* -- index page ------------------------------------------------------------ */
-
-table.contentstable {
-    width: 90%;
-}
-
-table.contentstable p.biglink {
-    line-height: 150%;
-}
-
-a.biglink {
-    font-size: 1.3em;
-}
-
-span.linkdescr {
-    font-style: italic;
-    padding-top: 5px;
-    font-size: 90%;
-}
-
-/* -- general index --------------------------------------------------------- */
-
-table.indextable td {
-    text-align: left;
-    vertical-align: top;
-}
-
-table.indextable dl, table.indextable dd {
-    margin-top: 0;
-    margin-bottom: 0;
-}
-
-table.indextable tr.pcap {
-    height: 10px;
-}
-
-table.indextable tr.cap {
-    margin-top: 10px;
-    background-color: #f2f2f2;
-}
-
-img.toggler {
-    margin-right: 3px;
-    margin-top: 3px;
-    cursor: pointer;
-}
-
-/* -- general body styles --------------------------------------------------- */
-
-a.headerlink {
-    visibility: hidden;
-}
-
-h1:hover > a.headerlink,
-h2:hover > a.headerlink,
-h3:hover > a.headerlink,
-h4:hover > a.headerlink,
-h5:hover > a.headerlink,
-h6:hover > a.headerlink,
-dt:hover > a.headerlink {
-    visibility: visible;
-}
-
-div.body p.caption {
-    text-align: inherit;
-}
-
-div.body td {
-    text-align: left;
-}
-
-.field-list ul {
-    padding-left: 1em;
-}
-
-.first {
-    margin-top: 0 !important;
-}
-
-p.rubric {
-    margin-top: 30px;
-    font-weight: bold;
-}
-
-/* -- sidebars -------------------------------------------------------------- */
-
-div.sidebar {
-    margin: 0 0 0.5em 1em;
-    border: 1px solid #ddb;
-    padding: 7px 7px 0 7px;
-    background-color: #ffe;
-    width: 40%;
-    float: right;
-}
-
-p.sidebar-title {
-    font-weight: bold;
-}
-
-/* -- topics ---------------------------------------------------------------- */
-
-div.topic {
-    border: 1px solid #ccc;
-    padding: 7px 7px 0 7px;
-    margin: 10px 0 10px 0;
-}
-
-p.topic-title {
-    font-size: 1.1em;
-    font-weight: bold;
-    margin-top: 10px;
-}
-
-/* -- admonitions ----------------------------------------------------------- */
-
-div.admonition {
-    margin-top: 10px;
-    margin-bottom: 10px;
-    padding: 7px;
-}
-
-div.admonition dt {
-    font-weight: bold;
-}
-
-div.admonition dl {
-    margin-bottom: 0;
-}
-
-p.admonition-title {
-    margin: 0px 10px 5px 0px;
-    font-weight: bold;
-}
-
-div.body p.centered {
-    text-align: center;
-    margin-top: 25px;
-}
-
-/* -- tables ---------------------------------------------------------------- */
-
-table.docutils {
-    border: 0 solid #dce;
-    border-collapse: collapse;
-}
-
-table.docutils td, table.docutils th {
-    padding: 2px 5px 2px 5px;
-    border-left: 0;
-    background-color: #eef;
-}
-
-table.docutils td p.last, table.docutils th p.last {
-    margin-bottom: 0;
-}
-
-table.field-list td, table.field-list th {
-    border: 0 !important;
-}
-
-table.footnote td, table.footnote th {
-    border: 0 !important;
-}
-
-table.docutils th {
-    border-top: 1px solid #cac;
-    background-color: #ede;
-}
-
-th {
-    text-align: left;
-    padding-right: 5px;
-}
-
-th.head {
-    text-align: center;
-}
-
-/* -- other body styles ----------------------------------------------------- */
-
-dl {
-    margin-bottom: 15px;
-}
-
-dd p {
-    margin-top: 0px;
-}
-
-dd ul, dd table {
-    margin-bottom: 10px;
-}
-
-dd {
-    margin-top: 3px;
-    margin-bottom: 10px;
-    margin-left: 30px;
-}
-
-dt:target, .highlight {
-    background-color: #fbe54e;
-}
-
-dl.glossary dt {
-    font-weight: bold;
-    font-size: 1.1em;
-}
-
-.field-list ul {
-    margin: 0;
-    padding-left: 1em;
-}
-
-.field-list p {
-    margin: 0;
-}
-
-.refcount {
-    color: #060;
-}
-
-.optional {
-    font-size: 1.3em;
-}
-
-.versionmodified {
-    font-style: italic;
-}
-
-.deprecated, .deprecated-removed {
-    background-color: #ffe4e4;
-    border: 1px solid #f66;
-    padding: 7px;
-}
-
-div.deprecated p, div.deprecated-removed p {
-    margin-bottom: 0;
-}
-
-.system-message {
-    background-color: #fda;
-    padding: 5px;
-    border: 3px solid red;
-}
-
-.footnote:target  {
-    background-color: #ffa;
-}
-
-.impl-detail {
-    margin-top: 10px;
-    margin-bottom: 10px;
-    padding: 7px;
-    border: 1px solid #ccc;
-}
-
-.impl-detail .compound-first {
-    margin-top: 0;
-}
-
-.impl-detail .compound-last {
-    margin-bottom: 0;
-}
-
-/* -- code displays --------------------------------------------------------- */
-
-pre {
-    overflow: auto;
-    overflow-y: hidden;
-}
-
-td.linenos pre {
-    padding: 5px 0px;
-    border: 0;
-    background-color: transparent;
-    color: #aaa;
-}
-
-table.highlighttable {
-    margin-left: 0.5em;
-}
-
-table.highlighttable td {
-    padding: 0 0.5em 0 0.5em;
-}
-
-tt.descname {
-    background-color: transparent;
-    font-weight: bold;
-    font-size: 1.2em;
-}
-
-tt.descclassname {
-    background-color: transparent;
-}
-
-tt.xref, a tt {
-    background-color: transparent;
-    font-weight: bold;
-}
-
-h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt {
-    background-color: transparent;
-}
-
-/* -- math display ---------------------------------------------------------- */
-
-img.math {
-    vertical-align: middle;
-}
-
-div.body div.math p {
-    text-align: center;
-}
-
-span.eqno {
-    float: right;
-}
-
-/* -- printout stylesheet --------------------------------------------------- */
-
-@media print {
-    div.document,
-    div.documentwrapper,
-    div.bodywrapper {
-        margin: 0 !important;
-        width: 100%;
-    }
-
-    div.sphinxsidebar,
-    div.related,
-    div.footer,
-    #top-link {
-        display: none;
-    }
-}
diff --git a/Doc/tools/sphinxext/static/copybutton.js b/Doc/tools/static/copybutton.js
similarity index 100%
rename from Doc/tools/sphinxext/static/copybutton.js
rename to Doc/tools/static/copybutton.js
diff --git a/Doc/tools/sphinxext/static/py.png b/Doc/tools/static/py.png
similarity index 100%
rename from Doc/tools/sphinxext/static/py.png
rename to Doc/tools/static/py.png
Binary files differ
diff --git a/Doc/tools/sphinxext/static/sidebar.js b/Doc/tools/static/sidebar.js
similarity index 100%
rename from Doc/tools/sphinxext/static/sidebar.js
rename to Doc/tools/static/sidebar.js
diff --git a/Doc/tools/sphinxext/static/version_switch.js b/Doc/tools/static/version_switch.js
similarity index 95%
rename from Doc/tools/sphinxext/static/version_switch.js
rename to Doc/tools/static/version_switch.js
index e5528eb..edb025b 100644
--- a/Doc/tools/sphinxext/static/version_switch.js
+++ b/Doc/tools/static/version_switch.js
@@ -50,7 +50,7 @@
            window.location.href = new_url;
         },
         error: function() {
-           window.location.href = 'http://docs.python.org/' + selected;
+           window.location.href = 'https://docs.python.org/' + selected;
         }
       });
     }
diff --git a/Doc/tools/sphinxext/susp-ignored.csv b/Doc/tools/susp-ignored.csv
similarity index 89%
rename from Doc/tools/sphinxext/susp-ignored.csv
rename to Doc/tools/susp-ignored.csv
index abc3ca8..48653af8 100644
--- a/Doc/tools/sphinxext/susp-ignored.csv
+++ b/Doc/tools/susp-ignored.csv
@@ -79,9 +79,8 @@
 howto/logging,,:This,DEBUG:root:This message should go to the log file
 howto/logging,,:This,DEBUG:This message should appear on the console
 howto/logging,,:Watch,WARNING:root:Watch out!
-howto/pyporting,75,::,# make sure to use :: Python *and* :: Python :: 3 so
-howto/pyporting,75,::,"'Programming Language :: Python',"
-howto/pyporting,75,::,'Programming Language :: Python :: 3'
+howto/pyporting,,::,Programming Language :: Python :: 2
+howto/pyporting,,::,Programming Language :: Python :: 3
 howto/regex,,::,
 howto/regex,,:foo,(?:foo)
 howto/urllib2,,:example,"for example ""joe@password:example.com"""
@@ -141,15 +140,8 @@
 library/logging.handlers,,:port,host:port
 library/mmap,,:i2,obj[i1:i2]
 library/multiprocessing,,`,# Add more tasks using `put()`
-library/multiprocessing,,`,# A test file for the `multiprocessing` package
-library/multiprocessing,,`,# A test of `multiprocessing.Pool` class
-library/multiprocessing,,`,# `BaseManager`.
-library/multiprocessing,,`,# in the original order then consider using `Pool.map()` or
 library/multiprocessing,,`,">>> l._callmethod('__getitem__', (20,))     # equiv to `l[20]`"
 library/multiprocessing,,`,">>> l._callmethod('__getslice__', (2, 7))   # equiv to `l[2:7]`"
-library/multiprocessing,,`,# Not sure if we should synchronize access to `socket.accept()` method by
-library/multiprocessing,,`,# object.  (We import `multiprocessing.reduction` to enable this pickling.)
-library/multiprocessing,,`,# `Pool.imap()` (which will save on the amount of code needed anyway).
 library/multiprocessing,,:queue,">>> QueueManager.register('get_queue', callable=lambda:queue)"
 library/multiprocessing,,`,# register the Foo class; make `f()` and `g()` accessible via proxy
 library/multiprocessing,,`,# register the Foo class; make `g()` and `_h()` accessible via proxy
@@ -158,20 +150,16 @@
 library/nntplib,,:lines,:lines
 library/optparse,,:len,"del parser.rargs[:len(value)]"
 library/os.path,,:foo,c:foo
+library/pathlib,,:bar,">>> PureWindowsPath('c:/Windows', 'd:bar')"
+library/pathlib,,:bar,PureWindowsPath('d:bar')
+library/pathlib,,:Program,>>> PureWindowsPath('c:Program Files/').root
+library/pathlib,,:Program,>>> PureWindowsPath('c:Program Files/').anchor
 library/pdb,,:lineno,filename:lineno
 library/pickle,,:memory,"conn = sqlite3.connect("":memory:"")"
 library/posix,,`,"CFLAGS=""`getconf LFS_CFLAGS`"" OPT=""-g -O2 $CFLAGS"""
-library/pprint,209,::,"'classifiers': ['Development Status :: 4 - Beta',"
-library/pprint,209,::,"'Intended Audience :: Developers',"
-library/pprint,209,::,"'License :: OSI Approved :: MIT License',"
-library/pprint,209,::,"'Natural Language :: English',"
-library/pprint,209,::,"'Operating System :: OS Independent',"
-library/pprint,209,::,"'Programming Language :: Python',"
-library/pprint,209,::,"'Programming Language :: Python :: 2',"
-library/pprint,209,::,"'Programming Language :: Python :: 2.6',"
-library/pprint,209,::,"'Programming Language :: Python :: 2.7',"
-library/pprint,209,::,"'Topic :: Software Development :: Libraries',"
-library/pprint,209,::,"'Topic :: Software Development :: Libraries :: Python Modules'],"
+library/pprint,,::,"'Programming Language :: Python :: 2 :: Only'],"
+library/pprint,,::,"'Programming Language :: Python :: 2.6',"
+library/pprint,,::,"'Programming Language :: Python :: 2.7',"
 library/profile,,:lineno,filename:lineno(function)
 library/pyexpat,,:elem1,<py:elem1 />
 library/pyexpat,,:py,"xmlns:py = ""http://www.python.org/ns/"">"
@@ -183,6 +171,7 @@
 library/sqlite3,,:age,"cur.execute(""select * from people where name_last=:who and age=:age"", {""who"": who, ""age"": age})"
 library/sqlite3,,:memory,
 library/sqlite3,,:who,"cur.execute(""select * from people where name_last=:who and age=:age"", {""who"": who, ""age"": age})"
+library/sqlite3,,:path,"db = sqlite3.connect('file:path/to/database?mode=ro', uri=True)"
 library/ssl,,:My,"Organizational Unit Name (eg, section) []:My Group"
 library/ssl,,:My,"Organization Name (eg, company) [Internet Widgits Pty Ltd]:My Organization, Inc."
 library/ssl,,:myserver,"Common Name (eg, YOUR name) []:myserver.mygroup.myorganization.com"
@@ -207,7 +196,12 @@
 library/tarfile,,:xz,'w:xz'
 library/time,,:mm,
 library/time,,:ss,
+library/tracemalloc,,:limit,"for index, stat in enumerate(top_stats[:limit], 1):"
 library/turtle,,::,Example::
+library/unittest,1412,:foo,"self.assertEqual(cm.output, ['INFO:foo:first message',"
+library/unittest,1412,:first,"self.assertEqual(cm.output, ['INFO:foo:first message',"
+library/unittest,1412,:foo,'ERROR:foo.bar:second message'])
+library/unittest,1412,:second,'ERROR:foo.bar:second message'])
 library/urllib.request,,:close,Connection:close
 library/urllib.request,,:lang,"xmlns=""http://www.w3.org/1999/xhtml"" xml:lang=""en"" lang=""en"">\n\n<head>\n"
 library/urllib.request,,:password,"""joe:password@python.org"""
@@ -262,11 +256,6 @@
 whatsnew/2.5,,:memory,:memory:
 whatsnew/2.5,,:step,[start:stop:step]
 whatsnew/2.5,,:stop,[start:stop:step]
-whatsnew/2.7,1619,::,"ParseResult(scheme='http', netloc='[1080::8:800:200C:417A]',"
-whatsnew/2.7,1619,::,>>> urlparse.urlparse('http://[1080::8:800:200C:417A]/foo')
-whatsnew/2.7,735,:Sunday,'2009:4:Sunday'
-whatsnew/2.7,862,:Cookie,"export PYTHONWARNINGS=all,error:::Cookie:0"
-whatsnew/2.7,862,::,"export PYTHONWARNINGS=all,error:::Cookie:0"
 whatsnew/3.2,,:affe,"netloc='[dead:beef:cafe:5417:affe:8FA3:deaf:feed]',"
 whatsnew/3.2,,:affe,>>> urllib.parse.urlparse('http://[dead:beef:cafe:5417:affe:8FA3:deaf:feed]/foo/')
 whatsnew/3.2,,:beef,"netloc='[dead:beef:cafe:5417:affe:8FA3:deaf:feed]',"
@@ -283,8 +272,13 @@
 whatsnew/3.2,,:location,zope9-location = ${zope9:location}
 whatsnew/3.2,,:prefix,zope-conf = ${custom:prefix}/etc/zope.conf
 whatsnew/changelog,,:platform,:platform:
+whatsnew/changelog,,:gz,": TarFile opened with external fileobj and ""w:gz"" mode didn't"
 whatsnew/changelog,,:PythonCmd,"With Tk < 8.5 _tkinter.c:PythonCmd() raised UnicodeDecodeError, caused"
 whatsnew/changelog,,::,": Fix FTP tests for IPv6, bind to ""::1"" instead of ""localhost""."
 whatsnew/changelog,,::,": Use ""127.0.0.1"" or ""::1"" instead of ""localhost"" as much as"
 whatsnew/changelog,,:password,user:password
-whatsnew/changelog,,:gz,w:gz
+whatsnew/2.7,780,:Sunday,'2009:4:Sunday'
+whatsnew/2.7,907,::,"export PYTHONWARNINGS=all,error:::Cookie:0"
+whatsnew/2.7,907,:Cookie,"export PYTHONWARNINGS=all,error:::Cookie:0"
+whatsnew/2.7,1657,::,>>> urlparse.urlparse('http://[1080::8:800:200C:417A]/foo')
+whatsnew/2.7,1657,::,"ParseResult(scheme='http', netloc='[1080::8:800:200C:417A]',"
diff --git a/Doc/tools/sphinxext/download.html b/Doc/tools/templates/download.html
similarity index 87%
rename from Doc/tools/sphinxext/download.html
rename to Doc/tools/templates/download.html
index 31a53cf..de84ae3 100644
--- a/Doc/tools/sphinxext/download.html
+++ b/Doc/tools/templates/download.html
@@ -3,7 +3,7 @@
 {% if daily is defined %}
   {% set dlbase = pathto('archives', 1) %}
 {% else %}
-  {% set dlbase = 'http://docs.python.org/ftp/python/doc/' + release %}
+  {% set dlbase = 'https://docs.python.org/ftp/python/doc/' + release %}
 {% endif %}
 
 {% block body %}
@@ -34,15 +34,15 @@
     <td><a href="{{ dlbase }}/python-{{ release }}-docs-text.tar.bz2">Download</a> (ca. 1.5 MB)</td>
   </tr>
  <tr><td>EPUB</td>
-    <td><a href="{{ dlbase }}/python-{{ release }}-docs-epub.zip">Download</a> (ca. 3.5 MB)</td>
-    <td><a href="{{ dlbase }}/python-{{ release }}-docs-epub.tar.bz2">Download</a> (ca. 3.5 MB)</td>
+    <td><a href="{{ dlbase }}/python-{{ release }}-docs.epub">Download</a> (ca. 4.5 MB)</td>
+    <td></td>
   </tr>
 </table>
 
 <p>These archives contain all the content in the documentation.</p>
 
 <p>HTML Help (<tt>.chm</tt>) files are made available in the "Windows" section
-on the <a href="http://python.org/download/releases/{{ release[:5] }}/">Python
+on the <a href="https://www.python.org/download/releases/{{ release[:5] }}/">Python
 download page</a>.</p>
 
 
diff --git a/Doc/tools/sphinxext/indexcontent.html b/Doc/tools/templates/indexcontent.html
similarity index 92%
rename from Doc/tools/sphinxext/indexcontent.html
rename to Doc/tools/templates/indexcontent.html
index 7f85470..969099a 100644
--- a/Doc/tools/sphinxext/indexcontent.html
+++ b/Doc/tools/templates/indexcontent.html
@@ -16,14 +16,14 @@
       <p class="biglink"><a class="biglink" href="{{ pathto("howto/index") }}">Python HOWTOs</a><br/>
          <span class="linkdescr">in-depth documents on specific topics</span></p>
     </td><td width="50%">
+      <p class="biglink"><a class="biglink" href="{{ pathto("installing/index") }}">Installing Python Modules</a><br/>
+         <span class="linkdescr">installing from the Python Package Index &amp; other sources</span></p>
+      <p class="biglink"><a class="biglink" href="{{ pathto("distributing/index") }}">Distributing Python Modules</a><br/>
+         <span class="linkdescr">publishing modules for installation by others</span></p>
       <p class="biglink"><a class="biglink" href="{{ pathto("extending/index") }}">Extending and Embedding</a><br/>
          <span class="linkdescr">tutorial for C/C++ programmers</span></p>
       <p class="biglink"><a class="biglink" href="{{ pathto("c-api/index") }}">Python/C API</a><br/>
          <span class="linkdescr">reference for C/C++ programmers</span></p>
-      <p class="biglink"><a class="biglink" href="{{ pathto("install/index") }}">Installing Python Modules</a><br/>
-         <span class="linkdescr">information for installers &amp; sys-admins</span></p>
-      <p class="biglink"><a class="biglink" href="{{ pathto("distutils/index") }}">Distributing Python Modules</a><br/>
-         <span class="linkdescr">sharing modules with others</span></p>
       <p class="biglink"><a class="biglink" href="{{ pathto("faq/index") }}">FAQs</a><br/>
          <span class="linkdescr">frequently asked questions (with answers!)</span></p>
     </td></tr>
diff --git a/Doc/tools/templates/indexsidebar.html b/Doc/tools/templates/indexsidebar.html
new file mode 100644
index 0000000..abdf070
--- /dev/null
+++ b/Doc/tools/templates/indexsidebar.html
@@ -0,0 +1,18 @@
+<h3>Download</h3>
+<p><a href="{{ pathto('download') }}">Download these documents</a></p>
+<h3>Docs for other versions</h3>
+<ul>
+  <li><a href="https://docs.python.org/2.7/">Python 2.7 (stable)</a></li>
+  <li><a href="https://docs.python.org/3.3/">Python 3.3 (stable)</a></li>
+  <li><a href="https://docs.python.org/3.5/">Python 3.5 (in development)</a></li>
+  <li><a href="https://www.python.org/doc/versions/">Old versions</a></li>
+</ul>
+
+<h3>Other resources</h3>
+<ul>
+  {# XXX: many of these should probably be merged in the main docs #}
+  <li><a href="https://www.python.org/dev/peps/">PEP Index</a></li>
+  <li><a href="https://wiki.python.org/moin/BeginnersGuide">Beginner's Guide</a></li>
+  <li><a href="https://wiki.python.org/moin/PythonBooks">Book List</a></li>
+  <li><a href="https://www.python.org/doc/av/">Audio/Visual Talks</a></li>
+</ul>
diff --git a/Doc/tools/sphinxext/layout.html b/Doc/tools/templates/layout.html
similarity index 92%
rename from Doc/tools/sphinxext/layout.html
rename to Doc/tools/templates/layout.html
index 16a9212..5abff1b 100644
--- a/Doc/tools/sphinxext/layout.html
+++ b/Doc/tools/templates/layout.html
@@ -2,7 +2,7 @@
 {% block rootrellink %}
         <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="https://www.python.org/">Python</a>{{ reldelim1 }}</li>
         <li>
           {%- if versionswitcher is defined %}
           <span class="version_switcher_placeholder">{{ release }}</span>
@@ -12,6 +12,8 @@
           {%- endif %}
         </li>
 {% endblock %}
+{% block relbar1 %} {% if builder != 'qthelp' %} {{ relbar() }} {% endif %} {% endblock %}
+{% block relbar2 %} {% if builder != 'qthelp' %} {{ relbar() }} {% endif %} {% 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 %}
@@ -80,7 +82,7 @@
     &copy; <a href="{{ pathto('copyright') }}">Copyright</a> {{ copyright|e }}.
     <br />
     The Python Software Foundation is a non-profit corporation.
-    <a href="http://www.python.org/psf/donations/">Please donate.</a>
+    <a href="https://www.python.org/psf/donations/">Please donate.</a>
     <br />
     Last updated on {{ last_updated|e }}.
     <a href="{{ pathto('bugs') }}">Found a bug</a>?
diff --git a/Doc/tools/templates/opensearch.xml b/Doc/tools/templates/opensearch.xml
new file mode 100644
index 0000000..7a5cddd
--- /dev/null
+++ b/Doc/tools/templates/opensearch.xml
@@ -0,0 +1,4 @@
+{% extends "!opensearch.xml" %}
+{% block extra -%}
+<Image height="16" width="16" type="image/x-icon">https://www.python.org/images/favicon16x16.ico</Image>
+{%- endblock %}
diff --git a/Doc/tutorial/appendix.rst b/Doc/tutorial/appendix.rst
new file mode 100644
index 0000000..8670efc
--- /dev/null
+++ b/Doc/tutorial/appendix.rst
@@ -0,0 +1,124 @@
+.. _tut-appendix:
+
+********
+Appendix
+********
+
+
+.. _tut-interac:
+
+Interactive Mode
+================
+
+.. _tut-error:
+
+Error Handling
+--------------
+
+When an error occurs, the interpreter prints an error message and a stack trace.
+In interactive mode, it then returns to the primary prompt; when input came from
+a file, it exits with a nonzero exit status after printing the stack trace.
+(Exceptions handled by an :keyword:`except` clause in a :keyword:`try` statement
+are not errors in this context.)  Some errors are unconditionally fatal and
+cause an exit with a nonzero exit; this applies to internal inconsistencies and
+some cases of running out of memory.  All error messages are written to the
+standard error stream; normal output from executed commands is written to
+standard output.
+
+Typing the interrupt character (usually Control-C or DEL) to the primary or
+secondary prompt cancels the input and returns to the primary prompt. [#]_
+Typing an interrupt while a command is executing raises the
+:exc:`KeyboardInterrupt` exception, which may be handled by a :keyword:`try`
+statement.
+
+
+.. _tut-scripts:
+
+Executable Python Scripts
+-------------------------
+
+On BSD'ish Unix systems, Python scripts can be made directly executable, like
+shell scripts, by putting the line ::
+
+   #!/usr/bin/env python3.4
+
+(assuming that the interpreter is on the user's :envvar:`PATH`) at the beginning
+of the script and giving the file an executable mode.  The ``#!`` must be the
+first two characters of the file.  On some platforms, this first line must end
+with a Unix-style line ending (``'\n'``), not a Windows (``'\r\n'``) line
+ending.  Note that the hash, or pound, character, ``'#'``, is used to start a
+comment in Python.
+
+The script can be given an executable mode, or permission, using the
+:program:`chmod` command.
+
+.. code-block:: bash
+
+   $ chmod +x myscript.py
+
+On Windows systems, there is no notion of an "executable mode".  The Python
+installer automatically associates ``.py`` files with ``python.exe`` so that
+a double-click on a Python file will run it as a script.  The extension can
+also be ``.pyw``, in that case, the console window that normally appears is
+suppressed.
+
+
+.. _tut-startup:
+
+The Interactive Startup File
+----------------------------
+
+When you use Python interactively, it is frequently handy to have some standard
+commands executed every time the interpreter is started.  You can do this by
+setting an environment variable named :envvar:`PYTHONSTARTUP` to the name of a
+file containing your start-up commands.  This is similar to the :file:`.profile`
+feature of the Unix shells.
+
+This file is only read in interactive sessions, not when Python reads commands
+from a script, and not when :file:`/dev/tty` is given as the explicit source of
+commands (which otherwise behaves like an interactive session).  It is executed
+in the same namespace where interactive commands are executed, so that objects
+that it defines or imports can be used without qualification in the interactive
+session. You can also change the prompts ``sys.ps1`` and ``sys.ps2`` in this
+file.
+
+If you want to read an additional start-up file from the current directory, you
+can program this in the global start-up file using code like ``if
+os.path.isfile('.pythonrc.py'): exec(open('.pythonrc.py').read())``.
+If you want to use the startup file in a script, you must do this explicitly
+in the script::
+
+   import os
+   filename = os.environ.get('PYTHONSTARTUP')
+   if filename and os.path.isfile(filename):
+       with open(filename) as fobj:
+          startup_file = fobj.read()
+       exec(startup_file)
+
+
+.. _tut-customize:
+
+The Customization Modules
+-------------------------
+
+Python provides two hooks to let you customize it: :mod:`sitecustomize` and
+:mod:`usercustomize`.  To see how it works, you need first to find the location
+of your user site-packages directory.  Start Python and run this code::
+
+   >>> import site
+   >>> site.getusersitepackages()
+   '/home/user/.local/lib/python3.4/site-packages'
+
+Now you can create a file named :file:`usercustomize.py` in that directory and
+put anything you want in it.  It will affect every invocation of Python, unless
+it is started with the :option:`-s` option to disable the automatic import.
+
+:mod:`sitecustomize` works in the same way, but is typically created by an
+administrator of the computer in the global site-packages directory, and is
+imported before :mod:`usercustomize`.  See the documentation of the :mod:`site`
+module for more details.
+
+
+.. rubric:: Footnotes
+
+.. [#] A problem with the GNU Readline package may prevent this.
diff --git a/Doc/tutorial/classes.rst b/Doc/tutorial/classes.rst
index 08072a3..7e014ef 100644
--- a/Doc/tutorial/classes.rst
+++ b/Doc/tutorial/classes.rst
@@ -387,6 +387,77 @@
 argument list.
 
 
+.. _tut-class-and-instance-variables:
+
+Class and Instance Variables
+----------------------------
+
+Generally speaking, instance variables are for data unique to each instance
+and class variables are for attributes and methods shared by all instances
+of the class::
+
+    class Dog:
+
+        kind = 'canine'         # class variable shared by all instances
+
+        def __init__(self, name):
+            self.name = name    # instance variable unique to each instance
+
+    >>> d = Dog('Fido')
+    >>> e = Dog('Buddy')
+    >>> d.kind                  # shared by all dogs
+    'canine'
+    >>> e.kind                  # shared by all dogs
+    'canine'
+    >>> d.name                  # unique to d
+    'Fido'
+    >>> e.name                  # unique to e
+    'Buddy'
+
+As discussed in :ref:`tut-object`, shared data can have possibly surprising
+effects with involving :term:`mutable` objects such as lists and dictionaries.
+For example, the *tricks* list in the following code should not be used as a
+class variable because just a single list would be shared by all *Dog*
+instances::
+
+    class Dog:
+
+        tricks = []             # mistaken use of a class variable
+
+        def __init__(self, name):
+            self.name = name
+
+        def add_trick(self, trick):
+            self.tricks.append(trick)
+
+    >>> d = Dog('Fido')
+    >>> e = Dog('Buddy')
+    >>> d.add_trick('roll over')
+    >>> e.add_trick('play dead')
+    >>> d.tricks                # unexpectedly shared by all dogs
+    ['roll over', 'play dead']
+
+Correct design of the class should use an instance variable instead::
+
+    class Dog:
+
+        def __init__(self, name):
+            self.name = name
+            self.tricks = []    # creates a new empty list for each dog
+
+        def add_trick(self, trick):
+            self.tricks.append(trick)
+
+    >>> d = Dog('Fido')
+    >>> e = Dog('Buddy')
+    >>> d.add_trick('roll over')
+    >>> e.add_trick('play dead')
+    >>> d.tricks
+    ['roll over']
+    >>> e.tricks
+    ['play dead']
+
+
 .. _tut-remarks:
 
 Random Remarks
@@ -572,7 +643,7 @@
 class can be subclassed without affecting the precedence order of its parents).
 Taken together, these properties make it possible to design reliable and
 extensible classes with multiple inheritance.  For more detail, see
-http://www.python.org/download/releases/2.3/mro/.
+https://www.python.org/download/releases/2.3/mro/.
 
 
 .. _tut-private:
@@ -731,7 +802,7 @@
    for char in "123":
        print(char)
    for line in open("myfile.txt"):
-       print(line)
+       print(line, end='')
 
 This style of access is clear, concise, and convenient.  The use of iterators
 pervades and unifies Python.  Behind the scenes, the :keyword:`for` statement
@@ -798,7 +869,7 @@
 :term:`Generator`\s are a simple and powerful tool for creating iterators.  They
 are written like regular functions but use the :keyword:`yield` statement
 whenever they want to return data.  Each time :func:`next` is called on it, the
-generator resumes where it left-off (it remembers all the data values and which
+generator resumes where it left off (it remembers all the data values and which
 statement was last executed).  An example shows that generators can be trivially
 easy to create::
 
@@ -816,7 +887,7 @@
    o
    g
 
-Anything that can be done with generators can also be done with class based
+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:`~generator.__next__` methods
 are created automatically.
diff --git a/Doc/tutorial/controlflow.rst b/Doc/tutorial/controlflow.rst
index 97aea4f..ef50731 100644
--- a/Doc/tutorial/controlflow.rst
+++ b/Doc/tutorial/controlflow.rst
@@ -370,7 +370,7 @@
                return False
            retries = retries - 1
            if retries < 0:
-               raise IOError('uncooperative user')
+               raise OSError('uncooperative user')
            print(complaint)
 
 This function can be called in several ways:
diff --git a/Doc/tutorial/datastructures.rst b/Doc/tutorial/datastructures.rst
index 24d2d2e..1ea299f 100644
--- a/Doc/tutorial/datastructures.rst
+++ b/Doc/tutorial/datastructures.rst
@@ -111,10 +111,15 @@
    >>> a.sort()
    >>> a
    [-1, 1, 66.25, 333, 333, 1234.5]
+   >>> a.pop()
+   1234.5
+   >>> a
+   [-1, 1, 66.25, 333, 333]
 
 You might have noticed that methods like ``insert``, ``remove`` or ``sort`` that
-modify the list have no return value printed -- they return ``None``. [1]_  This
-is a design principle for all mutable data structures in Python.
+only modify the list have no return value printed -- they return the default
+``None``. [1]_  This is a design principle for all mutable data structures in
+Python.
 
 
 .. _tut-lists-as-stacks:
@@ -194,12 +199,17 @@
    >>> squares
    [0, 1, 4, 9, 16, 25, 36, 49, 64, 81]
 
-We can obtain the same result with::
+Note that this creates (or overwrites) a variable named ``x`` that still exists
+after the loop completes.  We can calculate the list of squares without any
+side effects using::
+
+   squares = list(map(lambda x: x**2, range(10)))
+
+or, equivalently::
 
    squares = [x**2 for x in range(10)]
 
-This is also equivalent to ``squares = list(map(lambda x: x**2, range(10)))``,
-but it's more concise and readable.
+which is more concise and readable.
 
 A list comprehension consists of brackets containing an expression followed
 by a :keyword:`for` clause, then zero or more :keyword:`for` or :keyword:`if`
@@ -674,7 +684,7 @@
 all items of two sequences compare equal, the sequences are considered equal.
 If one sequence is an initial sub-sequence of the other, the shorter sequence is
 the smaller (lesser) one.  Lexicographical ordering for strings uses the Unicode
-codepoint number to order individual characters.  Some examples of comparisons
+code point number to order individual characters.  Some examples of comparisons
 between sequences of the same type::
 
    (1, 2, 3)              < (1, 2, 4)
diff --git a/Doc/tutorial/errors.rst b/Doc/tutorial/errors.rst
index 4282151..d048ae9 100644
--- a/Doc/tutorial/errors.rst
+++ b/Doc/tutorial/errors.rst
@@ -131,8 +131,8 @@
        f = open('myfile.txt')
        s = f.readline()
        i = int(s.strip())
-   except IOError as err:
-       print("I/O error: {0}".format(err))
+   except OSError as err:
+       print("OS error: {0}".format(err))
    except ValueError:
        print("Could not convert data to an integer.")
    except:
diff --git a/Doc/tutorial/index.rst b/Doc/tutorial/index.rst
index 604cff8..c14b1d6 100644
--- a/Doc/tutorial/index.rst
+++ b/Doc/tutorial/index.rst
@@ -12,7 +12,7 @@
 
 The Python interpreter and the extensive standard library are freely available
 in source or binary form for all major platforms from the Python Web site,
-http://www.python.org/, and may be freely distributed. The same site also
+https://www.python.org/, and may be freely distributed. The same site also
 contains distributions of and pointers to many free third party Python modules,
 programs and tools, and additional documentation.
 
@@ -56,3 +56,4 @@
    whatnow.rst
    interactive.rst
    floatingpoint.rst
+   appendix.rst
diff --git a/Doc/tutorial/inputoutput.rst b/Doc/tutorial/inputoutput.rst
index b3bf0ef..6f9c99d 100644
--- a/Doc/tutorial/inputoutput.rst
+++ b/Doc/tutorial/inputoutput.rst
@@ -323,8 +323,8 @@
    18
 
 ``f.tell()`` returns an integer giving the file object's current position in the file
-represented as number of bytes from the beginning of the file when in `binary mode` and
-an opaque number when in `text mode`.
+represented as number of bytes from the beginning of the file when in binary mode and
+an opaque number when in text mode.
 
 To change the file object's position, use ``f.seek(offset, from_what)``.  The position is computed
 from adding *offset* to a reference point; the reference point is selected by
diff --git a/Doc/tutorial/interactive.rst b/Doc/tutorial/interactive.rst
index 36acb06..abf30f0 100644
--- a/Doc/tutorial/interactive.rst
+++ b/Doc/tutorial/interactive.rst
@@ -7,140 +7,27 @@
 Some versions of the Python interpreter support editing of the current input
 line and history substitution, similar to facilities found in the Korn shell and
 the GNU Bash shell.  This is implemented using the `GNU Readline`_ library,
-which supports Emacs-style and vi-style editing.  This library has its own
-documentation which I won't duplicate here; however, the basics are easily
-explained.  The interactive editing and history described here are optionally
-available in the Unix and Cygwin versions of the interpreter.
-
-This chapter does *not* document the editing facilities of Mark Hammond's
-PythonWin package or the Tk-based environment, IDLE, distributed with Python.
-The command line history recall which operates within DOS boxes on NT and some
-other DOS and Windows flavors  is yet another beast.
-
-
-.. _tut-lineediting:
-
-Line Editing
-============
-
-If supported, input line editing is active whenever the interpreter prints a
-primary or secondary prompt.  The current line can be edited using the
-conventional Emacs control characters.  The most important of these are:
-:kbd:`C-A` (Control-A) moves the cursor to the beginning of the line, :kbd:`C-E`
-to the end, :kbd:`C-B` moves it one position to the left, :kbd:`C-F` to the
-right.  Backspace erases the character to the left of the cursor, :kbd:`C-D` the
-character to its right. :kbd:`C-K` kills (erases) the rest of the line to the
-right of the cursor, :kbd:`C-Y` yanks back the last killed string.
-:kbd:`C-underscore` undoes the last change you made; it can be repeated for
-cumulative effect.
-
-
-.. _tut-history:
-
-History Substitution
-====================
-
-History substitution works as follows.  All non-empty input lines issued are
-saved in a history buffer, and when a new prompt is given you are positioned on
-a new line at the bottom of this buffer. :kbd:`C-P` moves one line up (back) in
-the history buffer, :kbd:`C-N` moves one down.  Any line in the history buffer
-can be edited; an asterisk appears in front of the prompt to mark a line as
-modified.  Pressing the :kbd:`Return` key passes the current line to the
-interpreter.  :kbd:`C-R` starts an incremental reverse search; :kbd:`C-S` starts
-a forward search.
+which supports various styles of editing.  This library has its own
+documentation which we won't duplicate here.
 
 
 .. _tut-keybindings:
 
-Key Bindings
-============
+Tab Completion and History Editing
+==================================
 
-The key bindings and some other parameters of the Readline library can be
-customized by placing commands in an initialization file called
-:file:`~/.inputrc`.  Key bindings have the form ::
-
-   key-name: function-name
-
-or ::
-
-   "string": function-name
-
-and options can be set with ::
-
-   set option-name value
-
-For example::
-
-   # I prefer vi-style editing:
-   set editing-mode vi
-
-   # Edit using a single line:
-   set horizontal-scroll-mode On
-
-   # Rebind some keys:
-   Meta-h: backward-kill-word
-   "\C-u": universal-argument
-   "\C-x\C-r": re-read-init-file
-
-Note that the default binding for :kbd:`Tab` in Python is to insert a :kbd:`Tab`
-character instead of Readline's default filename completion function.  If you
-insist, you can override this by putting ::
-
-   Tab: complete
-
-in your :file:`~/.inputrc`.  (Of course, this makes it harder to type indented
-continuation lines if you're accustomed to using :kbd:`Tab` for that purpose.)
-
-.. index::
-   module: rlcompleter
-   module: readline
-
-Automatic completion of variable and module names is optionally available.  To
-enable it in the interpreter's interactive mode, add the following to your
-startup file: [#]_  ::
-
-   import rlcompleter, readline
-   readline.parse_and_bind('tab: complete')
-
-This binds the :kbd:`Tab` key to the completion function, so hitting the
-:kbd:`Tab` key twice suggests completions; it looks at Python statement names,
-the current local variables, and the available module names.  For dotted
-expressions such as ``string.a``, it will evaluate the expression up to the
-final ``'.'`` and then suggest completions from the attributes of the resulting
-object.  Note that this may execute application-defined code if an object with a
-:meth:`__getattr__` method is part of the expression.
-
-A more capable startup file might look like this example.  Note that this
-deletes the names it creates once they are no longer needed; this is done since
-the startup file is executed in the same namespace as the interactive commands,
-and removing the names avoids creating side effects in the interactive
-environment.  You may find it convenient to keep some of the imported modules,
-such as :mod:`os`, which turn out to be needed in most sessions with the
-interpreter. ::
-
-   # Add auto-completion and a stored history file of commands to your Python
-   # interactive interpreter. Requires Python 2.0+, readline. Autocomplete is
-   # bound to the Esc key by default (you can change it - see readline docs).
-   #
-   # Store the file in ~/.pystartup, and set an environment variable to point
-   # to it:  "export PYTHONSTARTUP=~/.pystartup" in bash.
-
-   import atexit
-   import os
-   import readline
-   import rlcompleter
-
-   historyPath = os.path.expanduser("~/.pyhistory")
-
-   def save_history(historyPath=historyPath):
-       import readline
-       readline.write_history_file(historyPath)
-
-   if os.path.exists(historyPath):
-       readline.read_history_file(historyPath)
-
-   atexit.register(save_history)
-   del os, atexit, readline, rlcompleter, save_history, historyPath
+Completion of variable and module names is
+:ref:`automatically enabled <rlcompleter-config>` at interpreter startup so
+that the :kbd:`Tab` key invokes the completion function; it looks at
+Python statement names, the current local variables, and the available
+module names.  For dotted expressions such as ``string.a``, it will evaluate
+the expression up to the final ``'.'`` and then suggest completions from
+the attributes of the resulting object.  Note that this may execute
+application-defined code if an object with a :meth:`__getattr__` method
+is part of the expression.  The default configuration also saves your
+history into a file named :file:`.python_history` in your user directory.
+The history will be available again during the next interactive interpreter
+session.
 
 
 .. _tut-commentary:
@@ -162,14 +49,6 @@
 bpython_.
 
 
-.. rubric:: Footnotes
-
-.. [#] Python will execute the contents of a file identified by the
-   :envvar:`PYTHONSTARTUP` environment variable when you start an interactive
-   interpreter.  To customize Python even for non-interactive mode, see
-   :ref:`tut-customize`.
-
-
 .. _GNU Readline: http://tiswww.case.edu/php/chet/readline/rltop.html
 .. _IPython: http://ipython.scipy.org/
 .. _bpython: http://www.bpython-interpreter.org/
diff --git a/Doc/tutorial/interpreter.rst b/Doc/tutorial/interpreter.rst
index cdc2bf2..8051634 100644
--- a/Doc/tutorial/interpreter.rst
+++ b/Doc/tutorial/interpreter.rst
@@ -10,13 +10,13 @@
 Invoking the Interpreter
 ========================
 
-The Python interpreter is usually installed as :file:`/usr/local/bin/python3.3`
+The Python interpreter is usually installed as :file:`/usr/local/bin/python3.4`
 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:
 
 .. code-block:: text
 
-   python3.3
+   python3.4
 
 to the shell. [#]_ Since the choice of the directory where the interpreter lives
 is an installation option, other places are possible; check with your local
@@ -24,26 +24,25 @@
 popular alternative location.)
 
 On Windows machines, the Python installation is usually placed in
-:file:`C:\\Python33`, though you can change this when you're running the
+:file:`C:\\Python34`, though you can change this when you're running the
 installer.  To add this directory to your path,  you can type the following
 command into the command prompt in a DOS box::
 
-   set path=%path%;C:\python33
+   set path=%path%;C:\python34
 
 Typing an end-of-file character (:kbd:`Control-D` on Unix, :kbd:`Control-Z` on
 Windows) at the primary prompt causes the interpreter to exit with a zero exit
 status.  If that doesn't work, you can exit the interpreter by typing the
 following command: ``quit()``.
 
-The interpreter's line-editing features usually aren't very sophisticated.  On
-Unix, whoever installed the interpreter may have enabled support for the GNU
-readline library, which adds more elaborate interactive editing and history
-features. Perhaps the quickest check to see whether command line editing is
-supported is typing Control-P to the first Python prompt you get.  If it beeps,
-you have command line editing; see Appendix :ref:`tut-interacting` for an
-introduction to the keys.  If nothing appears to happen, or if ``^P`` is echoed,
-command line editing isn't available; you'll only be able to use backspace to
-remove characters from the current line.
+The interpreter's line-editing features include interactive editing, history
+substitution and code completion on systems that support readline.  Perhaps the
+quickest check to see whether command line editing is supported is typing
+Control-P to the first Python prompt you get.  If it beeps, you have command
+line editing; see Appendix :ref:`tut-interacting` for an introduction to the
+keys.  If nothing appears to happen, or if ``^P`` is echoed, command line
+editing isn't available; you'll only be able to use backspace to remove
+characters from the current line.
 
 The interpreter operates somewhat like the Unix shell: when called with standard
 input connected to a tty device, it reads and executes commands interactively;
@@ -64,6 +63,8 @@
 and enter interactive mode afterwards.  This can be done by passing :option:`-i`
 before the script.
 
+All command line options are described in :ref:`using-on-general`.
+
 
 .. _tut-argpassing:
 
@@ -95,9 +96,9 @@
 prints a welcome message stating its version number and a copyright notice
 before printing the first prompt::
 
-   $ python3.3
-   Python 3.3 (default, Sep 24 2012, 09:25:04)
-   [GCC 4.6.3] on linux2
+   $ python3.4
+   Python 3.4 (default, Mar 16 2014, 09:25:04)
+   [GCC 4.8.2] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>>
 
@@ -106,70 +107,22 @@
 Continuation lines are needed when entering a multi-line construct. As an
 example, take a look at this :keyword:`if` statement::
 
-   >>> the_world_is_flat = 1
+   >>> the_world_is_flat = True
    >>> if the_world_is_flat:
    ...     print("Be careful not to fall off!")
    ...
    Be careful not to fall off!
 
 
+For more on interactive mode, see :ref:`tut-interac`.
+
+
 .. _tut-interp:
 
 The Interpreter and Its Environment
 ===================================
 
 
-.. _tut-error:
-
-Error Handling
---------------
-
-When an error occurs, the interpreter prints an error message and a stack trace.
-In interactive mode, it then returns to the primary prompt; when input came from
-a file, it exits with a nonzero exit status after printing the stack trace.
-(Exceptions handled by an :keyword:`except` clause in a :keyword:`try` statement
-are not errors in this context.)  Some errors are unconditionally fatal and
-cause an exit with a nonzero exit; this applies to internal inconsistencies and
-some cases of running out of memory.  All error messages are written to the
-standard error stream; normal output from executed commands is written to
-standard output.
-
-Typing the interrupt character (usually Control-C or DEL) to the primary or
-secondary prompt cancels the input and returns to the primary prompt. [#]_
-Typing an interrupt while a command is executing raises the
-:exc:`KeyboardInterrupt` exception, which may be handled by a :keyword:`try`
-statement.
-
-
-.. _tut-scripts:
-
-Executable Python Scripts
--------------------------
-
-On BSD'ish Unix systems, Python scripts can be made directly executable, like
-shell scripts, by putting the line ::
-
-   #! /usr/bin/env python3.3
-
-(assuming that the interpreter is on the user's :envvar:`PATH`) at the beginning
-of the script and giving the file an executable mode.  The ``#!`` must be the
-first two characters of the file.  On some platforms, this first line must end
-with a Unix-style line ending (``'\n'``), not a Windows (``'\r\n'``) line
-ending.  Note that the hash, or pound, character, ``'#'``, is used to start a
-comment in Python.
-
-The script can be given an executable mode, or permission, using the
-:program:`chmod` command::
-
-   $ chmod +x myscript.py
-
-On Windows systems, there is no notion of an "executable mode".  The Python
-installer automatically associates ``.py`` files with ``python.exe`` so that
-a double-click on a Python file will run it as a script.  The extension can
-also be ``.pyw``, in that case, the console window that normally appears is
-suppressed.
-
-
 .. _tut-source-encoding:
 
 Source Code Encoding
@@ -203,67 +156,8 @@
 within the file.
 
 
-.. _tut-startup:
-
-The Interactive Startup File
-----------------------------
-
-When you use Python interactively, it is frequently handy to have some standard
-commands executed every time the interpreter is started.  You can do this by
-setting an environment variable named :envvar:`PYTHONSTARTUP` to the name of a
-file containing your start-up commands.  This is similar to the :file:`.profile`
-feature of the Unix shells.
-
-.. XXX This should probably be dumped in an appendix, since most people
-   don't use Python interactively in non-trivial ways.
-
-This file is only read in interactive sessions, not when Python reads commands
-from a script, and not when :file:`/dev/tty` is given as the explicit source of
-commands (which otherwise behaves like an interactive session).  It is executed
-in the same namespace where interactive commands are executed, so that objects
-that it defines or imports can be used without qualification in the interactive
-session. You can also change the prompts ``sys.ps1`` and ``sys.ps2`` in this
-file.
-
-If you want to read an additional start-up file from the current directory, you
-can program this in the global start-up file using code like ``if
-os.path.isfile('.pythonrc.py'): exec(open('.pythonrc.py').read())``.
-If you want to use the startup file in a script, you must do this explicitly
-in the script::
-
-   import os
-   filename = os.environ.get('PYTHONSTARTUP')
-   if filename and os.path.isfile(filename):
-       exec(open(filename).read())
-
-
-.. _tut-customize:
-
-The Customization Modules
--------------------------
-
-Python provides two hooks to let you customize it: :mod:`sitecustomize` and
-:mod:`usercustomize`.  To see how it works, you need first to find the location
-of your user site-packages directory.  Start Python and run this code:
-
-   >>> import site
-   >>> site.getusersitepackages()
-   '/home/user/.local/lib/python3.2/site-packages'
-
-Now you can create a file named :file:`usercustomize.py` in that directory and
-put anything you want in it.  It will affect every invocation of Python, unless
-it is started with the :option:`-s` option to disable the automatic import.
-
-:mod:`sitecustomize` works in the same way, but is typically created by an
-administrator of the computer in the global site-packages directory, and is
-imported before :mod:`usercustomize`.  See the documentation of the :mod:`site`
-module for more details.
-
-
 .. rubric:: Footnotes
 
 .. [#] On Unix, the Python 3.x interpreter is by default not installed with the
    executable named ``python``, so that it does not conflict with a
    simultaneously installed Python 2.x executable.
-
-.. [#] A problem with the GNU Readline package may prevent this.
diff --git a/Doc/tutorial/introduction.rst b/Doc/tutorial/introduction.rst
index 9efd1ac..c073816 100644
--- a/Doc/tutorial/introduction.rst
+++ b/Doc/tutorial/introduction.rst
@@ -305,7 +305,7 @@
 
 Attempting to use a index that is too large will result in an error::
 
-   >>> word[42]  # the word only has 7 characters
+   >>> word[42]  # the word only has 6 characters
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    IndexError: string index out of range
@@ -391,7 +391,7 @@
    >>> squares[:]
    [1, 4, 9, 16, 25]
 
-Lists also supports operations like concatenation::
+Lists also support operations like concatenation::
 
    >>> squares + [36, 49, 64, 81, 100]
    [1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
diff --git a/Doc/tutorial/modules.rst b/Doc/tutorial/modules.rst
index 1902964..fd361ae 100644
--- a/Doc/tutorial/modules.rst
+++ b/Doc/tutorial/modules.rst
@@ -165,10 +165,16 @@
 named :file:`spam.py` in a list of directories given by the variable
 :data:`sys.path`.  :data:`sys.path` is initialized from these locations:
 
-* the directory containing the input script (or the current directory).
+* The directory containing the input script (or the current directory when no
+  file is specified).
 * :envvar:`PYTHONPATH` (a list of directory names, with the same syntax as the
   shell variable :envvar:`PATH`).
-* the installation-dependent default.
+* The installation-dependent default.
+
+.. note::
+   On file systems which support symlinks, the directory containing the input
+   script is calculated after the symlink is followed. In other words the
+   directory containing the symlink is **not** added to the module search path.
 
 After initialization, Python programs can modify :data:`sys.path`.  The
 directory containing the script being run is placed at the beginning of the
@@ -278,24 +284,23 @@
    >>> dir(fibo)
    ['__name__', 'fib', 'fib2']
    >>> 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', 'setcheckinterval', 'setdlopenflags',
-    'setprofile', 'setrecursionlimit', 'setswitchinterval', 'settrace',
-    'stderr', 'stdin', 'stdout', 'thread_info', 'version', 'version_info',
-    'warnoptions']
+   ['__displayhook__', '__doc__', '__excepthook__', '__loader__', '__name__',
+    '__package__', '__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',
+    '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::
 
diff --git a/Doc/tutorial/stdlib.rst b/Doc/tutorial/stdlib.rst
index 7e7a154..cd73bc2 100644
--- a/Doc/tutorial/stdlib.rst
+++ b/Doc/tutorial/stdlib.rst
@@ -15,7 +15,7 @@
 
    >>> import os
    >>> os.getcwd()      # Return the current working directory
-   'C:\\Python33'
+   'C:\\Python34'
    >>> os.chdir('/server/accesslogs')   # Change current working directory
    >>> os.system('mkdir today')   # Run the command mkdir in the system shell
    0
@@ -40,7 +40,9 @@
 
    >>> import shutil
    >>> shutil.copyfile('data.db', 'archive.db')
+   'archive.db'
    >>> shutil.move('/build/executables', 'installdir')
+   'installdir'
 
 
 .. _tut-file-wildcards:
diff --git a/Doc/tutorial/stdlib2.rst b/Doc/tutorial/stdlib2.rst
index c1dd69a..c0197ea 100644
--- a/Doc/tutorial/stdlib2.rst
+++ b/Doc/tutorial/stdlib2.rst
@@ -277,7 +277,7 @@
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
        d['primary']                # entry was automatically removed
-     File "C:/python33/lib/weakref.py", line 46, in __getitem__
+     File "C:/python34/lib/weakref.py", line 46, in __getitem__
        o = self.data[key]()
    KeyError: 'primary'
 
diff --git a/Doc/tutorial/whatnow.rst b/Doc/tutorial/whatnow.rst
index 7fcbdc3f..6b03cb5 100644
--- a/Doc/tutorial/whatnow.rst
+++ b/Doc/tutorial/whatnow.rst
@@ -21,8 +21,8 @@
   and many other tasks. Skimming through the Library Reference will give you an
   idea of what's available.
 
-* :ref:`install-index` explains how to install external modules written by other
-  Python users.
+* :ref:`installing-index` explains how to install additional modules written
+  by other Python users.
 
 * :ref:`reference-index`: A detailed explanation of Python's syntax and
   semantics.  It's heavy reading, but is useful as a complete guide to the
@@ -30,20 +30,20 @@
 
 More Python resources:
 
-* http://www.python.org:  The major Python Web site.  It contains code,
+* https://www.python.org:  The major Python Web site.  It contains code,
   documentation, and pointers to Python-related pages around the Web.  This Web
   site is mirrored in various places around the world, such as Europe, Japan, and
   Australia; a mirror may be faster than the main site, depending on your
   geographical location.
 
-* http://docs.python.org:  Fast access to Python's  documentation.
+* https://docs.python.org:  Fast access to Python's  documentation.
 
-* http://pypi.python.org: The Python Package Index, previously also nicknamed
+* https://pypi.python.org/pypi: The Python Package Index, previously also nicknamed
   the Cheese Shop, is an index of user-created Python modules that are available
   for download.  Once you begin releasing code, you can register it here so that
   others can find it.
 
-* http://aspn.activestate.com/ASPN/Python/Cookbook/: The Python Cookbook is a
+* http://code.activestate.com/recipes/langs/python/: The Python Cookbook is a
   sizable collection of code examples, larger modules, and useful scripts.
   Particularly notable contributions are collected in a book also titled Python
   Cookbook (O'Reilly & Associates, ISBN 0-596-00797-3.)
@@ -61,7 +61,7 @@
 answering) questions, suggesting new features, and announcing new modules.
 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/.
+Mailing list archives are available at https://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.
 
diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst
index 4e7168f..4017ce8 100644
--- a/Doc/using/cmdline.rst
+++ b/Doc/using/cmdline.rst
@@ -1,7 +1,7 @@
-.. highlightlang:: none
+.. highlightlang:: sh
 
 .. ATTENTION: You probably should update Misc/python.man, too, if you modify
-.. this file.
+   this file.
 
 .. _using-on-general:
 
@@ -24,7 +24,7 @@
 
 When invoking Python, you may specify any of these options::
 
-    python [-bBdEhiOqsSuvVWx?] [-c command | -m module-name | script | - ] [args]
+    python [-bBdEhiIOqsSuvVWx?] [-c command | -m module-name | script | - ] [args]
 
 The most common use case is, of course, a simple invocation of a script::
 
@@ -81,7 +81,8 @@
    the implementation may not always enforce this (e.g. it may allow you to
    use a name that includes a hyphen).
 
-   Package names are also permitted. When a package name is supplied instead
+   Package names (including namespace packages) are also permitted. When a
+   package name is supplied instead
    of a normal module, the interpreter will execute ``<pkg>.__main__`` as
    the main module. This behaviour is deliberately similar to the handling
    of directories and zipfiles that are passed to the interpreter as the
@@ -115,6 +116,9 @@
    .. versionchanged:: 3.1
       Supply the package name to run a ``__main__`` submodule.
 
+   .. versionchanged:: 3.4
+      namespace packages are also supported
+
 
 .. describe:: -
 
@@ -144,13 +148,22 @@
    added to the start of :data:`sys.path` and the ``__main__.py`` file in
    that location is executed as the :mod:`__main__` module.
 
+   .. seealso::
+      :func:`runpy.run_path`
+         Equivalent functionality directly available to Python code
+
 
 If no interface option is given, :option:`-i` is implied, ``sys.argv[0]`` is
 an empty string (``""``) and the current directory will be added to the
-start of :data:`sys.path`.
+start of :data:`sys.path`.  Also, tab-completion and history editing is
+automatically enabled, if available on your platform (see
+:ref:`rlcompleter-config`).
 
 .. seealso::  :ref:`tut-invoking`
 
+.. versionchanged:: 3.4
+   Automatic enabling of tab-completion and history editing.
+
 
 Generic options
 ~~~~~~~~~~~~~~~
@@ -170,6 +183,8 @@
        Python 3.0
 
 
+.. _using-on-misc-options:
+
 Miscellaneous options
 ~~~~~~~~~~~~~~~~~~~~~
 
@@ -208,6 +223,17 @@
    raises an exception.  See also :envvar:`PYTHONINSPECT`.
 
 
+.. cmdoption:: -I
+
+   Run Python in isolated mode. This also implies -E and -s.
+   In isolated mode :data:`sys.path` contains neither the script's directory nor
+   the user's site-packages directory. All :envvar:`PYTHON*` environment
+   variables are ignored, too. Further restrictions may be imposed to prevent
+   the user from injecting malicious code.
+
+   .. versionadded:: 3.4
+
+
 .. cmdoption:: -O
 
    Turn on basic optimizations.  This changes the filename extension for
@@ -358,9 +384,19 @@
 .. cmdoption:: -X
 
    Reserved for various implementation-specific options.  CPython currently
-   defines just one, you can use ``-X faulthandler`` to enable
-   :mod:`faulthandler`. It also allows to pass arbitrary values and retrieve
-   them through the :data:`sys._xoptions` dictionary.
+   defines the following possible values:
+
+   * ``-X faulthandler`` to enable :mod:`faulthandler`;
+   * ``-X showrefcount`` to enable the output of the total reference count
+     and memory blocks (only works on debug builds);
+   * ``-X tracemalloc`` to start tracing Python memory allocations using the
+     :mod:`tracemalloc` module. By default, only the most recent frame is
+     stored in a traceback of a trace. Use ``-X tracemalloc=NFRAME`` to start
+     tracing with a traceback limit of *NFRAME* frames. See the
+     :func:`tracemalloc.start` for more information.
+
+   It also allows to pass arbitrary values and retrieve them through the
+   :data:`sys._xoptions` dictionary.
 
    .. versionchanged:: 3.2
       It is now allowed to pass :option:`-X` with CPython.
@@ -368,6 +404,9 @@
    .. versionadded:: 3.3
       The ``-X faulthandler`` option.
 
+   .. versionadded:: 3.4
+      The ``-X showrefcount`` and ``-X tracemalloc`` options.
+
 
 Options you shouldn't use
 ~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -376,7 +415,7 @@
 
    Reserved for use by Jython_.
 
-.. _Jython: http://jython.org
+.. _Jython: http://www.jython.org/
 
 
 .. _using-on-envvars:
@@ -385,7 +424,7 @@
 ---------------------
 
 These environment variables influence Python's behavior, they are processed
-before the command-line switches other than -E.  It is customary that
+before the command-line switches other than -E or -I.  It is customary that
 command-line switches override environmental variables where there is a
 conflict.
 
@@ -430,15 +469,7 @@
    is executed in the same namespace where interactive commands are executed so
    that objects defined or imported in it can be used without qualification in
    the interactive session.  You can also change the prompts :data:`sys.ps1` and
-   :data:`sys.ps2` in this file.
-
-
-.. envvar:: PYTHONY2K
-
-   Set this to a non-empty string to cause the :mod:`time` module to require
-   dates specified as strings to include 4-digit years, otherwise 2-digit years
-   are converted based on rules described in the :mod:`time` module
-   documentation.
+   :data:`sys.ps2` and the hook :data:`sys.__interactivehook__` in this file.
 
 
 .. envvar:: PYTHONOPTIMIZE
@@ -485,9 +516,9 @@
 
 .. envvar:: PYTHONDONTWRITEBYTECODE
 
-   If this is set, Python won't try to write ``.pyc`` or ``.pyo`` files on the
-   import of source modules.  This is equivalent to specifying the :option:`-B`
-   option.
+   If this is set to a non-empty string, Python won't try to write ``.pyc`` or
+   ``.pyo`` files on the import of source modules.  This is equivalent to
+   specifying the :option:`-B` option.
 
 
 .. envvar:: PYTHONHASHSEED
@@ -512,13 +543,16 @@
 .. envvar:: PYTHONIOENCODING
 
    If this is set before running the interpreter, it overrides the encoding used
-   for stdin/stdout/stderr, in the syntax ``encodingname:errorhandler``. The
-   ``:errorhandler`` part is optional and has the same meaning as in
-   :func:`str.encode`.
+   for stdin/stdout/stderr, in the syntax ``encodingname:errorhandler``.  Both
+   the ``encodingname`` and the ``:errorhandler`` parts are optional and have
+   the same meaning as in :func:`str.encode`.
 
    For stderr, the ``:errorhandler`` part is ignored; the handler will always be
    ``'backslashreplace'``.
 
+   .. versionchanged:: 3.4
+      The ``encodingname`` part is now optional.
+
 
 .. envvar:: PYTHONNOUSERSITE
 
@@ -556,15 +590,34 @@
 
 .. envvar:: PYTHONFAULTHANDLER
 
-   If this environment variable is set, :func:`faulthandler.enable` is called
-   at startup: install a handler for :const:`SIGSEGV`, :const:`SIGFPE`,
-   :const:`SIGABRT`, :const:`SIGBUS` and :const:`SIGILL` signals to dump the
-   Python traceback.  This is equivalent to :option:`-X` ``faulthandler``
-   option.
+   If this environment variable is set to a non-empty string,
+   :func:`faulthandler.enable` is called at startup: install a handler for
+   :const:`SIGSEGV`, :const:`SIGFPE`, :const:`SIGABRT`, :const:`SIGBUS` and
+   :const:`SIGILL` signals to dump the Python traceback.  This is equivalent to
+   :option:`-X` ``faulthandler`` option.
 
    .. versionadded:: 3.3
 
 
+.. envvar:: PYTHONTRACEMALLOC
+
+   If this environment variable is set to a non-empty string, start tracing
+   Python memory allocations using the :mod:`tracemalloc` module. The value of
+   the variable is the maximum number of frames stored in a traceback of a
+   trace. For example, ``PYTHONTRACEMALLOC=1`` stores only the most recent
+   frame. See the :func:`tracemalloc.start` for more information.
+
+   .. versionadded:: 3.4
+
+
+.. envvar:: PYTHONASYNCIODEBUG
+
+   If this environment variable is set to a non-empty string, enable the
+   :ref:`debug mode <asyncio-debug-mode>` of the :mod:`asyncio` module.
+
+   .. versionadded:: 3.4
+
+
 Debug-mode variables
 ~~~~~~~~~~~~~~~~~~~~
 
diff --git a/Doc/using/mac.rst b/Doc/using/mac.rst
index 3e1b74d..ede864d 100644
--- a/Doc/using/mac.rst
+++ b/Doc/using/mac.rst
@@ -19,13 +19,13 @@
 
 Mac OS X 10.8 comes with Python 2.7 pre-installed by Apple.  If you wish, you
 are invited to install the most recent version of Python 3 from the Python
-website (http://www.python.org).  A current "universal binary" build of Python,
+website (https://www.python.org).  A current "universal binary" build of Python,
 which runs natively on the Mac's new Intel and legacy PPC CPU's, is available
 there.
 
 What you get after installing is a number of things:
 
-* A :file:`MacPython 3.3` folder in your :file:`Applications` folder. In here
+* A :file:`MacPython 3.4` folder in your :file:`Applications` folder. In here
   you find IDLE, the development environment that is a standard part of official
   Python distributions; PythonLauncher, which handles double-clicking Python
   scripts from the Finder; and the "Build Applet" tool, which allows you to
@@ -64,7 +64,7 @@
 number of standard Unix command line editors, :program:`vim` and
 :program:`emacs` among them. If you want a more Mac-like editor,
 :program:`BBEdit` or :program:`TextWrangler` from Bare Bones Software (see
-http://www.barebones.com/products/bbedit/index.shtml) are good choices, as is
+http://www.barebones.com/products/bbedit/index.html) are good choices, as is
 :program:`TextMate` (see http://macromates.com/). Other editors include
 :program:`Gvim` (http://macvim.org) and :program:`Aquamacs`
 (http://aquamacs.org/).
@@ -93,7 +93,7 @@
 anything that has a GUI) need to be run in a special way. Use :program:`pythonw`
 instead of :program:`python` to start such scripts.
 
-With Python 3.3, you can use either :program:`python` or :program:`pythonw`.
+With Python 3.4, you can use either :program:`python` or :program:`pythonw`.
 
 
 Configuration
@@ -116,7 +116,7 @@
 
 MacPython ships with the standard IDLE development environment. A good
 introduction to using IDLE can be found at
-http://hkn.eecs.berkeley.edu/~dyoo/python/idle_intro/index.html.
+https://hkn.eecs.berkeley.edu/~dyoo/python/idle_intro/index.html.
 
 
 .. _mac-package-manager:
@@ -130,7 +130,7 @@
   setup.py install``).
 
 * Many packages can also be installed via the :program:`setuptools` extension
-  or :program:`pip` wrapper, see http://www.pip-installer.org/.
+  or :program:`pip` wrapper, see https://pip.pypa.io/.
 
 
 GUI Programming on the Mac
@@ -140,7 +140,7 @@
 
 *PyObjC* is a Python binding to Apple's Objective-C/Cocoa framework, which is
 the foundation of most modern Mac development. Information on PyObjC is
-available from http://pyobjc.sourceforge.net.
+available from https://pythonhosted.org/pyobjc/.
 
 The standard Python GUI toolkit is :mod:`tkinter`, based on the cross-platform
 Tk toolkit (http://www.tcl.tk). An Aqua-native version of Tk is bundled with OS
@@ -158,7 +158,7 @@
 Distributing Python Applications on the Mac
 ===========================================
 
-The "Build Applet" tool that is placed in the MacPython 3.3 folder is fine for
+The "Build Applet" tool that is placed in the MacPython 3.4 folder is fine for
 packaging small Python scripts on your own machine to run as a standard Mac
 application. This tool, however, is not robust enough to distribute Python
 applications to other users.
@@ -174,9 +174,9 @@
 The MacPython mailing list is an excellent support resource for Python users and
 developers on the Mac:
 
-http://www.python.org/community/sigs/current/pythonmac-sig/
+https://www.python.org/community/sigs/current/pythonmac-sig/
 
 Another useful resource is the MacPython wiki:
 
-http://wiki.python.org/moin/MacPython
+https://wiki.python.org/moin/MacPython
 
diff --git a/Doc/using/unix.rst b/Doc/using/unix.rst
index 40635c6..5da1f23 100644
--- a/Doc/using/unix.rst
+++ b/Doc/using/unix.rst
@@ -55,18 +55,19 @@
 On OpenSolaris
 --------------
 
-To install the newest Python versions on OpenSolaris, install `blastwave
-<http://www.blastwave.org/howto.html>`_ and type ``pkg_get -i python`` at the
-prompt.
+You can get Python from `OpenCSW <http://www.opencsw.org/>`_.  Various versions
+of Python are available and can be installed with e.g. ``pkgutil -i python27``.
 
 
+.. _building-python-on-unix:
+
 Building Python
 ===============
 
 If you want to compile CPython yourself, first thing you should do is get the
-`source <http://python.org/download/source/>`_. You can download either the
+`source <https://www.python.org/download/source/>`_. You can download either the
 latest release's source or just grab a fresh `clone
-<http://docs.python.org/devguide/setup#getting-the-source-code>`_.  (If you want
+<https://docs.python.org/devguide/setup.html#getting-the-source-code>`_.  (If you want
 to contribute patches, you will need a clone.)
 
 The build process consists in the usual ::
@@ -144,5 +145,4 @@
 information, read: http://www.geany.org/
 
 Komodo edit is another extremely good IDE.  It also has support for a lot of
-languages. For more information, read:
-http://www.activestate.com/store/productdetail.aspx?prdGuid=20f4ed15-6684-4118-a78b-d37ff4058c5f
+languages. For more information, read http://komodoide.com/.
diff --git a/Doc/using/venv-create.inc b/Doc/using/venv-create.inc
index 5fdbc9b..5fc46d2 100644
--- a/Doc/using/venv-create.inc
+++ b/Doc/using/venv-create.inc
@@ -11,6 +11,11 @@
 Windows).  It also creates an (initially empty) ``lib/pythonX.Y/site-packages``
 subdirectory (on Windows, this is ``Lib\site-packages``).
 
+.. seealso::
+
+   `Python Packaging User Guide: Creating and using virtual environments
+   <https://packaging.python.org/en/latest/installing.html#virtual-environments>`__
+
 .. highlight:: none
 
 On Windows, you may have to invoke the ``pyvenv`` script as follows, if you
@@ -25,7 +30,7 @@
 The command, if run with ``-h``, will show the available options::
 
     usage: pyvenv [-h] [--system-site-packages] [--symlinks] [--clear]
-                  [--upgrade] ENV_DIR [ENV_DIR ...]
+                  [--upgrade] [--without-pip] ENV_DIR [ENV_DIR ...]
 
     Creates virtual Python environments in one or more target directories.
 
@@ -38,38 +43,53 @@
                              virtual environment.
       --symlinks             Try to use symlinks rather than copies, when symlinks
                              are not the default for the platform.
+      --copies               Try to use copies rather than symlinks, even when
+                             symlinks are the default for the platform.
       --clear                Delete the environment directory if it already exists.
                              If not specified and the directory exists, an error is
                              raised.
       --upgrade              Upgrade the environment directory to use this version
                              of Python, assuming Python has been upgraded in-place.
+      --without-pip          Skips installing or upgrading pip in the virtual
+                             environment (pip is bootstrapped by default)
 
-If the target directory already exists an error will be raised, unless
-the ``--clear`` or ``--upgrade`` option was provided.
+.. versionchanged:: 3.4
+   Installs pip by default, added the ``--without-pip``  and ``--copies``
+   options
+
+.. versionchanged:: 3.4
+   In earlier versions, if the target directory already existed, an error was
+   raised, unless the ``--clear`` or ``--upgrade`` option was provided. Now,
+   if an existing directory is specified, its contents are removed and
+   the directory is processed as if it had been newly created.
 
 The created ``pyvenv.cfg`` file also includes the
 ``include-system-site-packages`` key, set to ``true`` if ``venv`` is
 run with the ``--system-site-packages`` option, ``false`` otherwise.
 
+Unless the ``--without-pip`` option is given, :mod:`ensurepip` will be
+invoked to bootstrap ``pip`` into the virtual environment.
+
 Multiple paths can be given to ``pyvenv``, in which case an identical
 virtualenv will be created, according to the given options, at each
 provided path.
 
 Once a venv has been created, it can be "activated" using a script in the
-venv's binary directory. The invocation of the script is platform-specific: on
-a Posix platform, you would typically do::
+venv's binary directory. The invocation of the script is platform-specific:
 
-    $ source <venv>/bin/activate
-
-whereas on Windows, you might do::
-
-    C:\> <venv>/Scripts/activate
-
-if you are using the ``cmd.exe`` shell, or perhaps::
-
-    PS C:\> <venv>/Scripts/Activate.ps1
-
-if you use PowerShell.
++-------------+-----------------+-----------------------------------------+
+| Platform    | Shell           | Command to activate virtual environment |
++=============+=================+=========================================+
+| Posix       | bash/zsh        | $ source <venv>/bin/activate            |
++-------------+-----------------+-----------------------------------------+
+|             | fish            | $ . <venv>/bin/activate.fish            |
++-------------+-----------------+-----------------------------------------+
+|             | csh/tcsh        | $ source <venv>/bin/activate.csh        |
++-------------+-----------------+-----------------------------------------+
+| Windows     | cmd.exe         | C:\> <venv>/Scripts/activate.bat        |
++-------------+-----------------+-----------------------------------------+
+|             | PowerShell      | PS C:\> <venv>/Scripts/Activate.ps1     |
++-------------+-----------------+-----------------------------------------+
 
 You don't specifically *need* to activate an environment; activation just
 prepends the venv's binary directory to your path, so that "python" invokes the
@@ -83,3 +103,5 @@
 ``deactivate.bat`` and ``Deactivate.ps1`` which are installed when the venv is
 created.
 
+.. versionadded:: 3.4
+   ``fish`` and ``csh`` activation scripts.
diff --git a/Doc/using/windows.rst b/Doc/using/windows.rst
index 6c4d16e..c05f72a 100644
--- a/Doc/using/windows.rst
+++ b/Doc/using/windows.rst
@@ -11,6 +11,10 @@
 This document aims to give an overview of Windows-specific behaviour you should
 know about when using Python on Microsoft Windows.
 
+.. XXX (ncoghlan)
+
+   This looks rather stale to me...
+
 
 Installing Python
 =================
@@ -18,21 +22,20 @@
 Unlike most Unix systems and services, Windows does not require Python natively
 and thus does not pre-install a version of Python.  However, the CPython team
 has compiled Windows installers (MSI packages) with every `release
-<http://www.python.org/download/releases/>`_ for many years.
+<https://www.python.org/download/releases/>`_ for many years.
 
 With ongoing development of Python, some platforms that used to be supported
 earlier are no longer supported (due to the lack of users or developers).
 Check :pep:`11` for details on all unsupported platforms.
 
 * `Windows CE <http://pythonce.sourceforge.net/>`_ is still supported.
-* The `Cygwin <http://cygwin.com/>`_ installer offers to install the `Python
-  interpreter <http://cygwin.com/packages/python>`_ as well; it is located under
-  "Interpreters." (cf. `Cygwin package source
+* The `Cygwin <http://cygwin.com/>`_ installer offers to install the Python
+  interpreter as well (cf. `Cygwin package source
   <ftp://ftp.uni-erlangen.de/pub/pc/gnuwin32/cygwin/mirrors/cygnus/
   release/python>`_, `Maintainer releases
   <http://www.tishler.net/jason/software/python/>`_)
 
-See `Python for Windows <http://www.python.org/download/windows/>`_
+See `Python for Windows <https://www.python.org/download/windows/>`_
 for detailed information about platforms with pre-compiled installers.
 
 .. seealso::
@@ -41,15 +44,15 @@
       "7 Minutes to "Hello World!""
       by Richard Dooling, 2006
 
-   `Installing on Windows <http://diveintopython.net/installing_python/windows.html>`_
+   `Installing on Windows <http://www.diveintopython.net/installing_python/windows.html>`_
       in "`Dive into Python: Python from novice to pro
-      <http://diveintopython.net/index.html>`_"
+      <http://www.diveintopython.net/>`_"
       by Mark Pilgrim, 2004,
       ISBN 1-59059-356-1
 
-   `For Windows users <http://swaroopch.com/text/Byte_of_Python:Installing_Python#For_Windows_users>`_
+   `For Windows users <http://www.swaroopch.com/notes/python/#install_windows>`_
       in "Installing Python"
-      in "`A Byte of Python <http://www.byteofpython.info>`_"
+      in "`A Byte of Python <http://www.swaroopch.com/notes/python/>`_"
       by Swaroop C H, 2003
 
 
@@ -63,7 +66,7 @@
 `ActivePython <http://www.activestate.com/activepython/>`_
     Installer with multi-platform compatibility, documentation, PyWin32
 
-`Enthought Python Distribution <http://www.enthought.com/products/epd.php>`_
+`Enthought Python Distribution <https://www.enthought.com/products/epd/>`_
     Popular modules (such as PyWin32) with their respective documentation, tool
     suite for building extensible Python applications
 
@@ -511,7 +514,7 @@
   user interfaces
 
 `PythonWin <http://web.archive.org/web/20060524042422/
-http://www.python.org/windows/pythonwin/>`_ is a sample MFC application
+https://www.python.org/windows/pythonwin/>`_ is a sample MFC application
 shipped with PyWin32.  It is an embeddable IDE with a built-in debugger.
 
 .. seealso::
@@ -549,9 +552,9 @@
 ===========================
 
 If you want to compile CPython yourself, first thing you should do is get the
-`source <http://python.org/download/source/>`_. You can download either the
+`source <https://www.python.org/download/source/>`_. You can download either the
 latest release's source or just grab a fresh `checkout
-<http://docs.python.org/devguide/setup#checking-out-the-code>`_.
+<https://docs.python.org/devguide/setup.html#getting-the-source-code>`_.
 
 The source tree contains a build solution and project files for Microsoft
 Visual C++, which is the compiler used to build the official Python releases.
@@ -560,12 +563,6 @@
 +--------------------+--------------+-----------------------+
 | Directory          | MSVC version | Visual Studio version |
 +====================+==============+=======================+
-| :file:`PC/VC6/`    | 6.0          | 97                    |
-+--------------------+--------------+-----------------------+
-| :file:`PC/VS7.1/`  | 7.1          | 2003                  |
-+--------------------+--------------+-----------------------+
-| :file:`PC/VS8.0/`  | 8.0          | 2005                  |
-+--------------------+--------------+-----------------------+
 | :file:`PC/VS9.0/`  | 9.0          | 2008                  |
 +--------------------+--------------+-----------------------+
 | :file:`PCbuild/`   | 10.0         | 2010                  |
@@ -596,7 +593,7 @@
 
 .. seealso::
 
-   `Python Programming On Win32 <http://www.oreilly.com/catalog/pythonwin32/>`_
+   `Python Programming On Win32 <http://shop.oreilly.com/product/9781565926219.do>`_
       "Help for Windows Programmers"
       by Mark Hammond and Andy Robinson, O'Reilly Media, 2000,
       ISBN 1-56592-621-8
diff --git a/Doc/whatsnew/2.0.rst b/Doc/whatsnew/2.0.rst
index 64b908b..2c952ac 100644
--- a/Doc/whatsnew/2.0.rst
+++ b/Doc/whatsnew/2.0.rst
@@ -130,7 +130,7 @@
 Read the rest of PEP 1 for the details of the PEP editorial process, style, and
 format.  PEPs are kept in the Python CVS tree on SourceForge, though they're not
 part of the Python 2.0 distribution, and are also available in HTML form from
-http://www.python.org/peps/.  As of September 2000, there are 25 PEPS, ranging
+https://www.python.org/peps/.  As of September 2000, there are 25 PEPS, ranging
 from PEP 201, "Lockstep Iteration", to PEP 225, "Elementwise/Objectwise
 Operators".
 
@@ -566,7 +566,7 @@
 simply be silently swallowed.
 
 .. Starting URL:
-.. http://www.python.org/pipermail/python-dev/2000-April/004834.html
+.. https://www.python.org/pipermail/python-dev/2000-April/004834.html
 
 Work has been done on porting Python to 64-bit Windows on the Itanium processor,
 mostly by Trent Mick of ActiveState.  (Confusingly, ``sys.platform`` is still
@@ -1003,7 +1003,7 @@
 
 The XML Special Interest Group has been working on XML-related Python code for a
 while.  Its code distribution, called PyXML, is available from the SIG's Web
-pages at http://www.python.org/sigs/xml-sig/. The PyXML distribution also used
+pages at https://www.python.org/community/sigs/current/xml-sig. The PyXML distribution also used
 the package name ``xml``.  If you've written programs that used PyXML, you're
 probably wondering about its compatibility with the 2.0 :mod:`xml` package.
 
diff --git a/Doc/whatsnew/2.1.rst b/Doc/whatsnew/2.1.rst
index b1ab48e..5058bf1 100644
--- a/Doc/whatsnew/2.1.rst
+++ b/Doc/whatsnew/2.1.rst
@@ -555,14 +555,14 @@
 and experiment with them.  With the result experience, perhaps it'll be possible
 to design a really good catalog and then build support for it into Python 2.2.
 For example, the Distutils :command:`sdist` and :command:`bdist_\*` commands
-could support a :option:`upload` option that would automatically upload your
+could support a ``upload`` option that would automatically upload your
 package to a catalog server.
 
 You can start creating packages containing :file:`PKG-INFO` even if you're not
 using Python 2.1, since a new release of the Distutils will be made for users of
 earlier Python versions.  Version 1.0.2 of the Distutils includes the changes
 described in PEP 241, as well as various bugfixes and enhancements.  It will be
-available from  the Distutils SIG at http://www.python.org/sigs/distutils-sig/.
+available from  the Distutils SIG at https://www.python.org/sigs/distutils-sig/.
 
 
 .. seealso::
@@ -731,7 +731,7 @@
          ...
 
   For a fuller discussion of the line I/O changes, see the python-dev summary for
-  January 1-15, 2001 at http://www.python.org/dev/summary/2001-01-1/.
+  January 1-15, 2001 at https://www.python.org/dev/summary/2001-01-1/.
 
 * A new method, :meth:`popitem`, was added to dictionaries to enable
   destructively iterating through the contents of a dictionary; this can be faster
diff --git a/Doc/whatsnew/2.2.rst b/Doc/whatsnew/2.2.rst
index 31b6df4..f3c4a91 100644
--- a/Doc/whatsnew/2.2.rst
+++ b/Doc/whatsnew/2.2.rst
@@ -24,8 +24,8 @@
 This article doesn't attempt to provide a complete specification of the new
 features, but instead provides a convenient overview.  For full details, you
 should refer to the documentation for Python 2.2, such as the `Python Library
-Reference <http://www.python.org/doc/2.2/lib/lib.html>`_ and the `Python
-Reference Manual <http://www.python.org/doc/2.2/ref/ref.html>`_.  If you want to
+Reference <https://www.python.org/doc/2.2/lib/lib.html>`_ and the `Python
+Reference Manual <https://www.python.org/doc/2.2/ref/ref.html>`_.  If you want to
 understand the complete implementation and design rationale for a change, refer
 to the PEP for a particular new feature.
 
@@ -395,7 +395,7 @@
 of an explanation to start you programming, but many details have been
 simplified or ignored.  Where should you go to get a more complete picture?
 
-http://www.python.org/2.2/descrintro.html is a lengthy tutorial introduction to
+https://www.python.org/2.2/descrintro.html is a lengthy tutorial introduction to
 the descriptor features, written by Guido van Rossum. If my description has
 whetted your appetite, go read this tutorial next, because it goes into much
 more detail about the new features while still remaining quite easy to read.
diff --git a/Doc/whatsnew/2.3.rst b/Doc/whatsnew/2.3.rst
index f0e48d9..f478c09 100644
--- a/Doc/whatsnew/2.3.rst
+++ b/Doc/whatsnew/2.3.rst
@@ -657,7 +657,7 @@
 Running ``python setup.py register`` will collect the metadata describing a
 package, such as its name, version, maintainer, description, &c., and send it to
 a central catalog server.  The resulting catalog is available from
-http://www.python.org/pypi.
+https://pypi.python.org/pypi.
 
 To make the catalog a bit more useful, a new optional *classifiers* keyword
 argument has been added to the Distutils :func:`setup` function.  A list of
@@ -1082,9 +1082,9 @@
   C3 algorithm as described in the paper `"A Monotonic Superclass Linearization
   for Dylan" <http://www.webcom.com/haahr/dylan/linearization-oopsla96.html>`_. To
   understand the motivation for this change,  read Michele Simionato's article
-  `"Python 2.3 Method Resolution Order" <http://www.python.org/2.3/mro.html>`_, or
+  `"Python 2.3 Method Resolution Order" <https://www.python.org/2.3/mro.html>`_, or
   read the thread on python-dev starting with the message at
-  http://mail.python.org/pipermail/python-dev/2002-October/029035.html. Samuele
+  https://mail.python.org/pipermail/python-dev/2002-October/029035.html. Samuele
   Pedroni first pointed out the problem and also implemented the fix by coding the
   C3 algorithm.
 
@@ -1330,7 +1330,7 @@
   (Contributed by Kevin O'Connor.)
 
 * The IDLE integrated development environment has been updated using the code
-  from the IDLEfork project (http://idlefork.sf.net).  The most notable feature is
+  from the IDLEfork project (http://idlefork.sourceforge.net).  The most notable feature is
   that the code being developed is now executed in a subprocess, meaning that
   there's no longer any need for manual ``reload()`` operations. IDLE's core code
   has been incorporated into the standard library as the :mod:`idlelib` package.
@@ -1564,7 +1564,7 @@
   to the correct thread, and waiting for the results.  Other interfaces can't be
   handled automatically but :mod:`Tkinter` will now raise an exception on such an
   access so that you can at least find out about the problem.  See
-  http://mail.python.org/pipermail/python-dev/2002-December/031107.html for a more
+  https://mail.python.org/pipermail/python-dev/2002-December/031107.html for a more
   detailed explanation of this change.  (Implemented by Martin von Löwis.)
 
 * Calling Tcl methods through :mod:`_tkinter` no longer  returns only strings.
@@ -1858,7 +1858,7 @@
 
 .. seealso::
 
-   http://svn.python.org/view/python/trunk/Objects/obmalloc.c
+   https://svn.python.org/view/python/trunk/Objects/obmalloc.c
       For the full details of the pymalloc implementation, see the comments at
       the top of the file :file:`Objects/obmalloc.c` in the Python source code.
       The above link points to the file within the python.org SVN browser.
diff --git a/Doc/whatsnew/2.4.rst b/Doc/whatsnew/2.4.rst
index 5973f3b..569e5e9 100644
--- a/Doc/whatsnew/2.4.rst
+++ b/Doc/whatsnew/2.4.rst
@@ -337,7 +337,7 @@
       wrote patches implementing function decorators, but the one that was actually
       checked in was patch #979728, written by Mark Russell.
 
-   http://www.python.org/moin/PythonDecoratorLibrary
+   https://www.python.org/moin/PythonDecoratorLibrary
       This Wiki page contains several examples of decorators.
 
 .. ======================================================================
diff --git a/Doc/whatsnew/2.5.rst b/Doc/whatsnew/2.5.rst
index 683630a..f8f7ca0 100644
--- a/Doc/whatsnew/2.5.rst
+++ b/Doc/whatsnew/2.5.rst
@@ -39,7 +39,7 @@
 This article doesn't try to be a complete specification of the new features;
 instead changes are briefly introduced using helpful examples.  For full
 details, you should always refer to the documentation for Python 2.5 at
-http://docs.python.org. If you want to understand the complete implementation
+https://docs.python.org. If you want to understand the complete implementation
 and design rationale, refer to the PEP for a particular new feature.
 
 Comments, suggestions, and error reports for this document are welcome; please
@@ -229,7 +229,7 @@
         )
 
 Another new enhancement to the Python package index at
-http://cheeseshop.python.org is storing source and binary archives for a
+https://pypi.python.org is storing source and binary archives for a
 package.  The new :command:`upload` Distutils command will upload a package to
 the repository.
 
@@ -2130,7 +2130,7 @@
   such as PyCon.
 
   .. List of names taken from Jeremy's python-dev post at
-  .. http://mail.python.org/pipermail/python-dev/2005-October/057500.html
+  .. https://mail.python.org/pipermail/python-dev/2005-October/057500.html
 
 * Evan Jones's patch to obmalloc, first described in a talk at PyCon DC 2005,
   was applied.  Python 2.4 allocated small objects in 256K-sized arenas, but never
diff --git a/Doc/whatsnew/2.6.rst b/Doc/whatsnew/2.6.rst
index 3ae6c77..e763265 100644
--- a/Doc/whatsnew/2.6.rst
+++ b/Doc/whatsnew/2.6.rst
@@ -164,7 +164,7 @@
 to administer it and a server to host it.
 
 After posting a call for volunteers, a new Roundup installation was
-set up at http://bugs.python.org.  One installation of Roundup can
+set up at https://bugs.python.org.  One installation of Roundup can
 host multiple trackers, and this server now also hosts issue trackers
 for Jython and for the Python web site.  It will surely find
 other uses in the future.  Where possible,
@@ -181,7 +181,7 @@
 
 .. seealso::
 
-  http://bugs.python.org
+  https://bugs.python.org
     The Python bug tracker.
 
   http://bugs.jython.org:
@@ -227,18 +227,18 @@
 
 Sphinx is a standalone package that can be used for writing, and
 almost two dozen other projects
-(`listed on the Sphinx web site <http://sphinx.pocoo.org/examples.html>`__)
+(`listed on the Sphinx web site <http://sphinx-doc.org/examples.html>`__)
 have adopted Sphinx as their documentation tool.
 
 .. seealso::
 
-   `Documenting Python <http://docs.python.org/devguide/documenting.html>`__
+   `Documenting Python <https://docs.python.org/devguide/documenting.html>`__
        Describes how to write for Python's documentation.
 
-   `Sphinx <http://sphinx.pocoo.org/>`__
+   `Sphinx <http://sphinx-doc.org/>`__
      Documentation and code for the Sphinx toolchain.
 
-   `Docutils <http://docutils.sf.net>`__
+   `Docutils <http://docutils.sourceforge.net>`__
      The underlying reStructuredText parser and toolset.
 
 
@@ -2363,7 +2363,7 @@
   negotiation itself.  (Patch contributed by Bill Fenner;
   :issue:`829951`.)
 
-* The :mod:`socket` module now supports TIPC (http://tipc.sf.net),
+* The :mod:`socket` module now supports TIPC (http://tipc.sourceforge.net/),
   a high-performance non-IP-based protocol designed for use in clustered
   environments.  TIPC addresses are 4- or 5-tuples.
   (Contributed by Alberto Bertogli; :issue:`1646`.)
diff --git a/Doc/whatsnew/2.7.rst b/Doc/whatsnew/2.7.rst
index b26c9b2..ed1446c 100644
--- a/Doc/whatsnew/2.7.rst
+++ b/Doc/whatsnew/2.7.rst
@@ -7,7 +7,6 @@
 ..  hyperlink all the methods & functions.
 
 .. T_STRING_INPLACE not described in main docs
-.. "Format String Syntax" in string.rst could use many more examples.
 
 .. $Id$
    Rules for maintenance:
@@ -50,17 +49,16 @@
    This saves the maintainer some effort going through the SVN logs
    when researching a change.
 
-This article explains the new features in Python 2.7.  The final
-release of 2.7 is currently scheduled for July 2010; the detailed
-schedule is described in :pep:`373`.
+This article explains the new features in Python 2.7.  Python 2.7 was released
+on July 3, 2010.
 
 Numeric handling has been improved in many ways, for both
-floating-point numbers and for the :class:`Decimal` class.  There are
-some useful additions to the standard library, such as a greatly
-enhanced :mod:`unittest` module, the :mod:`argparse` module for
-parsing command-line options, convenient ordered-dictionary and
-:class:`Counter` classes in the :mod:`collections` module, and many
-other improvements.
+floating-point numbers and for the :class:`~decimal.Decimal` class.
+There are some useful additions to the standard library, such as a
+greatly enhanced :mod:`unittest` module, the :mod:`argparse` module
+for parsing command-line options, convenient :class:`~collections.OrderedDict`
+and :class:`~collections.Counter` classes in the :mod:`collections` module,
+and many other improvements.
 
 Python 2.7 is planned to be the last of the 2.x releases, so we worked
 on making it a good release for the long term.  To help with porting
@@ -70,9 +68,9 @@
 This article doesn't attempt to provide a complete specification of
 the new features, but instead provides a convenient overview.  For
 full details, you should refer to the documentation for Python 2.7 at
-http://docs.python.org. If you want to understand the rationale for
+https://docs.python.org. If you want to understand the rationale for
 the design and implementation, refer to the PEP for a particular new
-feature or the issue on http://bugs.python.org in which a change was
+feature or the issue on https://bugs.python.org in which a change was
 discussed.  Whenever possible, "What's New in Python" links to the
 bug/patch item for each change.
 
@@ -81,45 +79,91 @@
 The Future for Python 2.x
 =========================
 
-Python 2.7 is intended to be the last major release in the 2.x series.
-The Python maintainers are planning to focus their future efforts on
-the Python 3.x series.
+Python 2.7 is the last major release in the 2.x series, as the Python
+maintainers have shifted the focus of their new feature development efforts
+to the Python 3.x series. This means that while Python 2 continues to
+receive bug fixes, and to be updated to build correctly on new hardware and
+versions of supported operated systems, there will be no new full feature
+releases for the language or standard library.
 
-This means that 2.7 will remain in place for a long time, running
-production systems that have not been ported to Python 3.x.
-Two consequences of the long-term significance of 2.7 are:
+However, while there is a large common subset between Python 2.7 and Python
+3, and many of the changes involved in migrating to that common subset, or
+directly to Python 3, can be safely automated, some other changes (notably
+those associated with Unicode handling) may require careful consideration,
+and preferably robust automated regression test suites, to migrate
+effectively.
 
-* It's very likely the 2.7 release will have a longer period of
-  maintenance compared to earlier 2.x versions.  Python 2.7 will
-  continue to be maintained while the transition to 3.x continues, and
-  the developers are planning to support Python 2.7 with bug-fix
-  releases beyond the typical two years.
+This means that Python 2.7 will remain in place for a long time, providing a
+stable and supported base platform for production systems that have not yet
+been ported to Python 3. The full expected lifecycle of the Python 2.7
+series is detailed in :pep:`373`.
 
-* A policy decision was made to silence warnings only of interest to
-  developers.  :exc:`DeprecationWarning` and its
-  descendants are now ignored unless otherwise requested, preventing
-  users from seeing warnings triggered by an application.  This change
-  was also made in the branch that will become Python 3.2. (Discussed
-  on stdlib-sig and carried out in :issue:`7319`.)
+Some key consequences of the long-term significance of 2.7 are:
 
-  In previous releases, :exc:`DeprecationWarning` messages were
-  enabled by default, providing Python developers with a clear
-  indication of where their code may break in a future major version
-  of Python.
+* As noted above, the 2.7 release has a much longer period of maintenance
+  when compared to earlier 2.x versions. Python 2.7 is currently expected to
+  remain supported by the core development team (receiving security updates
+  and other bug fixes) until at least 2020 (10 years after its initial
+  release, compared to the more typical support period of 18-24 months).
 
-  However, there are increasingly many users of Python-based
-  applications who are not directly involved in the development of
-  those applications.  :exc:`DeprecationWarning` messages are
-  irrelevant to such users, making them worry about an application
-  that's actually working correctly and burdening application developers
-  with responding to these concerns.
+* As the Python 2.7 standard library ages, making effective use of the
+  Python Package Index (either directly or via a redistributor) becomes
+  more important for Python 2 users. In addition to a wide variety of third
+  party packages for various tasks, the available packages include backports
+  of new modules and features from the Python 3 standard library that are
+  compatible with Python 2, as well as various tools and libraries that can
+  make it easier to migrate to Python 3. The `Python Packaging User Guide
+  <https://packaging.python.org>`__ provides guidance on downloading and
+  installing software from the Python Package Index.
 
-  You can re-enable display of :exc:`DeprecationWarning` messages by
-  running Python with the :option:`-Wdefault` (short form:
-  :option:`-Wd`) switch, or by setting the :envvar:`PYTHONWARNINGS`
-  environment variable to ``"default"`` (or ``"d"``) before running
-  Python.  Python code can also re-enable them
-  by calling ``warnings.simplefilter('default')``.
+* While the preferred approach to enhancing Python 2 is now the publication
+  of new packages on the Python Package Index, this approach doesn't
+  necessarily work in all cases, especially those related to network
+  security. In exceptional cases that cannot be handled adequately by
+  publishing new or updated packages on PyPI, the Python Enhancement
+  Proposal process may be used to make the case for adding new features
+  directly to the Python 2 standard library. Any such additions, and the
+  maintenance releases where they were added, will be noted in the
+  :ref:`py27-maintenance-enhancements` section below.
+
+For projects wishing to migrate from Python 2 to Python 3, or for library
+and framework developers wishing to support users on both Python 2 and
+Python 3, there are a variety of tools and guides available to help decide
+on a suitable approach and manage some of the technical details involved.
+The recommended starting point is the :ref:`pyporting-howto` HOWTO guide.
+
+
+Changes to the Handling of Deprecation Warnings
+===============================================
+
+For Python 2.7, a policy decision was made to silence warnings only of
+interest to developers by default.  :exc:`DeprecationWarning` and its
+descendants are now ignored unless otherwise requested, preventing
+users from seeing warnings triggered by an application.  This change
+was also made in the branch that became Python 3.2. (Discussed
+on stdlib-sig and carried out in :issue:`7319`.)
+
+In previous releases, :exc:`DeprecationWarning` messages were
+enabled by default, providing Python developers with a clear
+indication of where their code may break in a future major version
+of Python.
+
+However, there are increasingly many users of Python-based
+applications who are not directly involved in the development of
+those applications.  :exc:`DeprecationWarning` messages are
+irrelevant to such users, making them worry about an application
+that's actually working correctly and burdening application developers
+with responding to these concerns.
+
+You can re-enable display of :exc:`DeprecationWarning` messages by
+running Python with the :option:`-Wdefault <-W>` (short form:
+:option:`-Wd <-W>`) switch, or by setting the :envvar:`PYTHONWARNINGS`
+environment variable to ``"default"`` (or ``"d"``) before running
+Python.  Python code can also re-enable them
+by calling ``warnings.simplefilter('default')``.
+
+The ``unittest`` module also automatically reenables deprecation warnings
+when running tests.
 
 
 Python 3.1 Features
@@ -133,7 +177,7 @@
 A partial list of 3.1 features that were backported to 2.7:
 
 * The syntax for set literals (``{1,2,3}`` is a mutable set).
-* Dictionary and set comprehensions (``{ i: i*2 for i in range(3)}``).
+* Dictionary and set comprehensions (``{i: i*2 for i in range(3)}``).
 * Multiple context managers in a single :keyword:`with` statement.
 * A new version of the :mod:`io` library, rewritten in C for performance.
 * The ordered-dictionary type described in :ref:`pep-0372`.
@@ -155,7 +199,7 @@
 * :func:`operator.isCallable` and :func:`operator.sequenceIncludes`,
   which are not supported in 3.x, now trigger warnings.
 * The :option:`-3` switch now automatically
-  enables the :option:`-Qwarn` switch that causes warnings
+  enables the :option:`-Qwarn <-Q>` switch that causes warnings
   about using classic division with integers and long integers.
 
 
@@ -390,9 +434,10 @@
 
 .. seealso::
 
-   `argparse module documentation <http://docs.python.org/dev/library/argparse.html>`__
+   :mod:`argparse` documentation
+     The documentation page of the argparse module.
 
-   `Upgrading optparse code to use argparse <http://docs.python.org/dev/library/argparse.html#upgrading-optparse-code>`__
+   :ref:`upgrading-optparse-code`
      Part of the Python documentation, describing how to convert
      code that uses :mod:`optparse`.
 
@@ -402,8 +447,6 @@
 PEP 391: Dictionary-Based Configuration For Logging
 ====================================================
 
-.. XXX not documented in library reference yet; add link here once it's added.
-
 The :mod:`logging` module is very flexible; applications can define
 a tree of logging subsystems, and each logger in this tree can filter
 out certain messages, format them differently, and direct messages to
@@ -412,21 +455,21 @@
 All this flexibility can require a lot of configuration.  You can
 write Python statements to create objects and set their properties,
 but a complex set-up requires verbose but boring code.
-:mod:`logging` also supports a :func:`~logging.config.fileConfig`
+:mod:`logging` also supports a :func:`~logging.fileConfig`
 function that parses a file, but the file format doesn't support
 configuring filters, and it's messier to generate programmatically.
 
-Python 2.7 adds a :func:`~logging.config.dictConfig` function that
+Python 2.7 adds a :func:`~logging.dictConfig` function that
 uses a dictionary to configure logging.  There are many ways to
 produce a dictionary from different sources: construct one with code;
 parse a file containing JSON; or use a YAML parsing library if one is
-installed.
+installed.  For more information see :ref:`logging-config-api`.
 
 The following example configures two loggers, the root logger and a
-logger named "network".   Messages sent to the root logger will be
+logger named "network".  Messages sent to the root logger will be
 sent to the system log using the syslog protocol, and messages
 to the "network" logger will be written to a :file:`network.log` file
-that will be rotated once the log reaches 1Mb.
+that will be rotated once the log reaches 1MB.
 
 ::
 
@@ -445,7 +488,7 @@
                          'filename': '/logs/network.log',
                          'formatter': 'standard',
                          'level': 'INFO',
-                         'maxBytes': 1024*1024},
+                         'maxBytes': 1000000},
                   'syslog': {'class': 'logging.handlers.SysLogHandler',
                              'formatter': 'standard',
                              'level': 'ERROR'}},
@@ -483,16 +526,19 @@
   for UDP or :const:`socket.SOCK_STREAM` for TCP.  The default
   protocol remains UDP.
 
-* :class:`Logger` instances gained a :meth:`getChild` method that retrieves a
-  descendant logger using a relative path.  For example,
-  once you retrieve a logger by doing ``log = getLogger('app')``,
+* :class:`~logging.Logger` instances gained a :meth:`~logging.Logger.getChild`
+  method that retrieves a descendant logger using a relative path.
+  For example, once you retrieve a logger by doing ``log = getLogger('app')``,
   calling ``log.getChild('network.listen')`` is equivalent to
   ``getLogger('app.network.listen')``.
 
-* The :class:`LoggerAdapter` class gained a :meth:`isEnabledFor` method
-  that takes a *level* and returns whether the underlying logger would
+* The :class:`~logging.LoggerAdapter` class gained a
+  :meth:`~logging.LoggerAdapter.isEnabledFor` method that takes a
+  *level* and returns whether the underlying logger would
   process a message of that level of importance.
 
+.. XXX: Logger objects don't have a class declaration so the link don't work
+
 .. seealso::
 
    :pep:`391` - Dictionary-Based Configuration For Logging
@@ -501,14 +547,15 @@
 PEP 3106: Dictionary Views
 ====================================================
 
-The dictionary methods :meth:`keys`, :meth:`values`, and :meth:`items`
-are different in Python 3.x.  They return an object called a :dfn:`view`
-instead of a fully materialized list.
+The dictionary methods :meth:`~dict.keys`, :meth:`~dict.values`, and
+:meth:`~dict.items` are different in Python 3.x.  They return an object
+called a :dfn:`view` instead of a fully materialized list.
 
-It's not possible to change the return values of :meth:`keys`,
-:meth:`values`, and :meth:`items` in Python 2.7 because too much code
-would break.  Instead the 3.x versions were added under the new names
-:meth:`viewkeys`, :meth:`viewvalues`, and :meth:`viewitems`.
+It's not possible to change the return values of :meth:`~dict.keys`,
+:meth:`~dict.values`, and :meth:`~dict.items` in Python 2.7 because
+too much code would break.  Instead the 3.x versions were added
+under the new names :meth:`~dict.viewkeys`, :meth:`~dict.viewvalues`,
+and :meth:`~dict.viewitems`.
 
 ::
 
@@ -550,8 +597,8 @@
     RuntimeError: dictionary changed size during iteration
 
 You can use the view methods in Python 2.x code, and the 2to3
-converter will change them to the standard :meth:`keys`,
-:meth:`values`, and :meth:`items` methods.
+converter will change them to the standard :meth:`~dict.keys`,
+:meth:`~dict.values`, and :meth:`~dict.items` methods.
 
 .. seealso::
 
@@ -624,7 +671,7 @@
   ``{}`` continues to represent an empty dictionary; use
   ``set()`` for an empty set.
 
-    >>> {1,2,3,4,5}
+    >>> {1, 2, 3, 4, 5}
     set([1, 2, 3, 4, 5])
     >>> set() # empty set
     set([])
@@ -661,7 +708,7 @@
   The :func:`contextlib.nested` function provides a very similar
   function, so it's no longer necessary and has been deprecated.
 
-  (Proposed in http://codereview.appspot.com/53094; implemented by
+  (Proposed in https://codereview.appspot.com/53094; implemented by
   Georg Brandl.)
 
 * Conversions between floating-point numbers and strings are
@@ -794,7 +841,7 @@
   ``None`` as its first argument.  (Fixed by Georg Brandl;
   :issue:`4759`.)
 
-  .. bytearray doesn't seem to be documented
+  .. XXX bytearray doesn't seem to be documented
 
 * When using ``@classmethod`` and ``@staticmethod`` to wrap
   methods as class or static methods, the wrapper object now
@@ -867,12 +914,6 @@
 
 Several performance enhancements have been added:
 
-.. * A new :program:`configure` option, :option:`--with-computed-gotos`,
-   compiles the main bytecode interpreter loop using a new dispatch
-   mechanism that gives speedups of up to 20%, depending on the system
-   and benchmark.  The new mechanism is only supported on certain
-   compilers, such as gcc, SunPro, and icc.
-
 * A new opcode was added to perform the initial setup for
   :keyword:`with` statements, looking up the :meth:`__enter__` and
   :meth:`__exit__` methods.  (Contributed by Benjamin Peterson.)
@@ -1054,7 +1095,7 @@
   :meth:`~collections.deque.count` method that returns the number of
   contained elements equal to the supplied argument *x*, and a
   :meth:`~collections.deque.reverse` method that reverses the elements
-  of the deque in-place.  :class:`deque` also exposes its maximum
+  of the deque in-place.  :class:`~collections.deque` also exposes its maximum
   length as the read-only :attr:`~collections.deque.maxlen` attribute.
   (Both features added by Raymond Hettinger.)
 
@@ -1135,15 +1176,14 @@
   ``Decimal('0.1000000000000000055511151231257827021181583404541015625')``.
   (Implemented by Raymond Hettinger; :issue:`4796`.)
 
-  Comparing instances of :class:`Decimal` with floating-point
+  Comparing instances of :class:`~decimal.Decimal` with floating-point
   numbers now produces sensible results based on the numeric values
   of the operands.  Previously such comparisons would fall back to
   Python's default rules for comparing objects, which produced arbitrary
   results based on their type.  Note that you still cannot combine
   :class:`Decimal` and floating-point in other operations such as addition,
   since you should be explicitly choosing how to convert between float and
-  :class:`Decimal`.
-  (Fixed by Mark Dickinson; :issue:`2531`.)
+  :class:`~decimal.Decimal`.  (Fixed by Mark Dickinson; :issue:`2531`.)
 
   The constructor for :class:`~decimal.Decimal` now accepts
   floating-point numbers (added by Raymond Hettinger; :issue:`8257`)
@@ -1195,8 +1235,8 @@
 
   Ordering comparisons (``<``, ``<=``, ``>``, ``>=``) between
   fractions and complex numbers now raise a :exc:`TypeError`.
-  This fixes an oversight, making the :class:`Fraction` match the other
-  numeric types.
+  This fixes an oversight, making the :class:`~fractions.Fraction`
+  match the other numeric types.
 
   .. revision 79455
 
@@ -1210,7 +1250,7 @@
   uploads thanks to an added *rest* parameter (patch by Pablo Mouzo;
   :issue:`6845`.)
 
-* New class decorator: :func:`total_ordering` in the :mod:`functools`
+* New class decorator: :func:`~functools.total_ordering` in the :mod:`functools`
   module takes a class that defines an :meth:`__eq__` method and one of
   :meth:`__lt__`, :meth:`__le__`, :meth:`__gt__`, or :meth:`__ge__`,
   and generates the missing comparison methods.  Since the
@@ -1218,7 +1258,7 @@
   this decorator makes it easier to define ordered classes.
   (Added by Raymond Hettinger; :issue:`5479`.)
 
-  New function: :func:`cmp_to_key` will take an old-style comparison
+  New function: :func:`~functools.cmp_to_key` will take an old-style comparison
   function that expects two arguments and return a new callable that
   can be used as the *key* parameter to functions such as
   :func:`sorted`, :func:`min` and :func:`max`, etc.  The primary
@@ -1345,7 +1385,7 @@
   with any object literal that decodes to a list of pairs.
   (Contributed by Raymond Hettinger; :issue:`5381`.)
 
-* The :mod:`mailbox` module's :class:`Maildir` class now records the
+* The :mod:`mailbox` module's :class:`~mailbox.Maildir` class now records the
   timestamp on the directories it reads, and only re-reads them if the
   modification time has subsequently changed.  This improves
   performance by avoiding unneeded directory scans.  (Fixed by
@@ -1432,7 +1472,7 @@
 * The :mod:`signal` module no longer re-installs the signal handler
   unless this is truly necessary, which fixes a bug that could make it
   impossible to catch the EINTR signal robustly.  (Fixed by
-  Charles-François Natali; :issue:`8354`.)
+  Charles-Francois Natali; :issue:`8354`.)
 
 * New functions: in the :mod:`site` module, three new functions
   return various site- and user-specific paths.
@@ -1466,10 +1506,10 @@
   defaults to False; if overridden to be True,
   new request connections will have the TCP_NODELAY option set to
   prevent buffering many small sends into a single TCP packet.
-  The :attr:`~SocketServer.TCPServer.timeout` class attribute can hold
+  The :attr:`~SocketServer.BaseServer.timeout` class attribute can hold
   a timeout in seconds that will be applied to the request socket; if
-  no request is received within that time, :meth:`handle_timeout`
-  will be called and :meth:`handle_request` will return.
+  no request is received within that time, :meth:`~SocketServer.BaseServer.handle_timeout`
+  will be called and :meth:`~SocketServer.BaseServer.handle_request` will return.
   (Contributed by Kristján Valur Jónsson; :issue:`6192` and :issue:`6267`.)
 
 * Updated module: the :mod:`sqlite3` module has been updated to
@@ -1479,7 +1519,7 @@
   and then call :meth:`~sqlite3.Connection.load_extension` to load a particular shared library.
   (Updated by Gerhard Häring.)
 
-* The :mod:`ssl` module's :class:`ssl.SSLSocket` objects now support the
+* The :mod:`ssl` module's :class:`~ssl.SSLSocket` objects now support the
   buffer API, which fixed a test suite failure (fix by Antoine Pitrou;
   :issue:`7133`) and automatically set
   OpenSSL's :c:macro:`SSL_MODE_AUTO_RETRY`, which will prevent an error
@@ -1535,7 +1575,7 @@
   on receiving an :const:`EINTR` signal.  (Reported by several people; final
   patch by Gregory P. Smith in :issue:`1068268`.)
 
-* New function: :func:`~symtable.is_declared_global` in the :mod:`symtable` module
+* New function: :func:`~symtable.Symbol.is_declared_global` in the :mod:`symtable` module
   returns true for variables that are explicitly declared to be global,
   false for ones that are implicitly global.
   (Contributed by Jeremy Hylton.)
@@ -1572,7 +1612,7 @@
   resulting archive.  This is more powerful than the existing
   *exclude* argument, which has therefore been deprecated.
   (Added by Lars Gustäbel; :issue:`6856`.)
-  The :class:`~tarfile.TarFile` class also now supports the context manager protocol.
+  The :class:`~tarfile.TarFile` class also now supports the context management protocol.
   (Added by Lars Gustäbel; :issue:`7232`.)
 
 * The :meth:`~threading.Event.wait` method of the :class:`threading.Event` class
@@ -1716,7 +1756,7 @@
   Makefile and the :file:`pyconfig.h` file.
 * :func:`~sysconfig.get_config_vars` returns a dictionary containing
   all of the configuration variables.
-* :func:`~sysconfig.getpath` returns the configured path for
+* :func:`~sysconfig.get_path` returns the configured path for
   a particular type of module: the standard library,
   site-specific modules, platform-specific modules, etc.
 * :func:`~sysconfig.is_python_build` returns true if you're running a
@@ -1727,7 +1767,7 @@
 
 The Distutils package and :mod:`sysconfig` are now maintained by Tarek
 Ziadé, who has also started a Distutils2 package (source repository at
-http://hg.python.org/distutils2/) for developing a next-generation
+https://hg.python.org/distutils2/) for developing a next-generation
 version of Distutils.
 
 
@@ -1764,7 +1804,7 @@
 by Michael Foord, unless otherwise noted.  The enhanced version of
 the module is downloadable separately for use with Python versions 2.4 to 2.6,
 packaged as the :mod:`unittest2` package, from
-http://pypi.python.org/pypi/unittest2.
+https://pypi.python.org/pypi/unittest2.
 
 When used from the command line, the module can automatically discover
 tests.  It's not as fancy as `py.test <http://pytest.org>`__ or
@@ -1778,7 +1818,7 @@
 Consult the :mod:`unittest` module documentation for more details.
 (Developed in :issue:`6001`.)
 
-The :func:`main` function supports some other new options:
+The :func:`~unittest.main` function supports some other new options:
 
 * :option:`-b` or :option:`--buffer` will buffer the standard output
   and standard error streams during each test.  If the test passes,
@@ -1796,7 +1836,7 @@
   being tested or the tests being run have defined a signal handler of
   their own, by noticing that a signal handler was already set and
   calling it.  If this doesn't work for you, there's a
-  :func:`removeHandler` decorator that can be used to mark tests that
+  :func:`~unittest.removeHandler` decorator that can be used to mark tests that
   should have the control-C handling disabled.
 
 * :option:`-f` or :option:`--failfast` makes
@@ -1923,7 +1963,7 @@
 
 :func:`unittest.main` now takes an optional ``exit`` argument.  If
 False, :func:`~unittest.main` doesn't call :func:`sys.exit`, allowing
-:func:`main` to be used from the interactive interpreter.
+:func:`~unittest.main` to be used from the interactive interpreter.
 (Contributed by J. Pablo Fernández; :issue:`3379`.)
 
 :class:`~unittest.TestResult` has new :meth:`~unittest.TestResult.startTestRun` and
@@ -2120,7 +2160,7 @@
   :c:macro:`Py_ISSPACE`,
   :c:macro:`Py_ISUPPER`,
   :c:macro:`Py_ISXDIGIT`,
-  and :c:macro:`Py_TOLOWER`, :c:macro:`Py_TOUPPER`.
+  :c:macro:`Py_TOLOWER`, and :c:macro:`Py_TOUPPER`.
   All of these functions are analogous to the C
   standard macros for classifying characters, but ignore the current
   locale setting, because in
@@ -2266,11 +2306,11 @@
   (Contributed by David Cournapeau; :issue:`4365`.)
 
 * The :mod:`_winreg` module for accessing the registry now implements
-  the :func:`CreateKeyEx` and :func:`DeleteKeyEx` functions, extended
-  versions of previously-supported functions that take several extra
-  arguments.  The :func:`DisableReflectionKey`,
-  :func:`EnableReflectionKey`, and :func:`QueryReflectionKey` were also
-  tested and documented.
+  the :func:`~_winreg.CreateKeyEx` and :func:`~_winreg.DeleteKeyEx`
+  functions, extended versions of previously-supported functions that
+  take several extra arguments.  The :func:`~_winreg.DisableReflectionKey`,
+  :func:`~_winreg.EnableReflectionKey`, and :func:`~_winreg.QueryReflectionKey`
+  were also tested and documented.
   (Implemented by Brian Curtin: :issue:`7347`.)
 
 * The new :c:func:`_beginthreadex` API is used to start threads, and
@@ -2329,7 +2369,7 @@
   attributes of the resulting code objects are overwritten when the
   original filename is obsolete.  This can happen if the file has been
   renamed, moved, or is accessed through different paths.  (Patch by
-  Žiga Seilnacht and Jean-Paul Calderone; :issue:`1180193`.)
+  Ziga Seilnacht and Jean-Paul Calderone; :issue:`1180193`.)
 
 * The :file:`regrtest.py` script now takes a :option:`--randseed=`
   switch that takes an integer that will be used as the random seed
@@ -2387,20 +2427,20 @@
 
 In the standard library:
 
-* Operations with :class:`datetime` instances that resulted in a year
+* Operations with :class:`~datetime.datetime` instances that resulted in a year
   falling outside the supported range didn't always raise
   :exc:`OverflowError`.  Such errors are now checked more carefully
   and will now raise the exception. (Reported by Mark Leander, patch
   by Anand B. Pillai and Alexander Belopolsky; :issue:`7150`.)
 
-* When using :class:`Decimal` instances with a string's
+* When using :class:`~decimal.Decimal` instances with a string's
   :meth:`format` method, the default alignment was previously
   left-alignment.  This has been changed to right-alignment, which might
   change the output of your programs.
   (Changed by Mark Dickinson; :issue:`6857`.)
 
   Comparisons involving a signaling NaN value (or ``sNAN``) now signal
-  :const:`InvalidOperation` instead of silently returning a true or
+  :const:`~decimal.InvalidOperation` instead of silently returning a true or
   false value depending on the comparison operator.  Quiet NaN values
   (or ``NaN``) are now hashable.  (Fixed by Mark Dickinson;
   :issue:`7279`.)
@@ -2411,7 +2451,7 @@
   or comment (which looks like `<!-- comment -->`).
   (Patch by Neil Muller; :issue:`2746`.)
 
-* The :meth:`readline` method of :class:`StringIO` objects now does
+* The :meth:`~StringIO.StringIO.readline` method of :class:`~StringIO.StringIO` objects now does
   nothing when a negative length is requested, as other file-like
   objects do.  (:issue:`7348`).
 
@@ -2470,6 +2510,73 @@
 .. ======================================================================
 
 
+.. _py27-maintenance-enhancements:
+
+New Features Added to Python 2.7 Maintenance Releases
+=====================================================
+
+New features may be added to Python 2.7 maintenance releases when the
+situation genuinely calls for it. Any such additions must go through
+the Python Enhancement Proposal process, and make a compelling case for why
+they can't be adequately addressed by either adding the new feature solely to
+Python 3, or else by publishing it on the Python Package Index.
+
+In addition to the specific proposals listed below, there is a general
+exemption allowing new ``-3`` warnings to be added in any Python 2.7
+maintenance release.
+
+
+PEP 434: IDLE Enhancement Exception for All Branches
+----------------------------------------------------
+
+:pep:`434` describes a general exemption for changes made to the IDLE
+development environment shipped along with Python. This exemption makes it
+possible for the IDLE developers to provide a more consistent user
+experience across all supported versions of Python 2 and 3.
+
+For details of any IDLE changes, refer to the NEWS file for the specific
+release.
+
+
+PEP 466: Network Security Enhancements for Python 2.7
+-----------------------------------------------------
+
+:pep:`466` describes a number of network security enhancement proposals
+that have been approved for inclusion in Python 2.7 maintenance releases,
+with the first of those changes appearing in the Python 2.7.7 release.
+
+:pep:`466` related features added in Python 2.7.7:
+
+* :func:`hmac.compare_digest` was backported from Python 3 to make a timing
+  attack resistant comparison operation available to Python 2 applications.
+  (Contributed by Alex Gaynor; :issue:`21306`.)
+
+* OpenSSL 1.0.1g was upgraded in the official Windows installers published on
+  python.org. (Contributed by Zachary Ware; :issue:`21462`.)
+
+:pep:`466` related features added in Python 2.7.8:
+
+* :func:`hashlib.pbkdf2_hmac` was backported from Python 3 to make a hashing
+  algorithm suitable for secure password storage broadly available to Python
+  2 applications. (Contributed by Alex Gaynor; :issue:`21304`.)
+
+* OpenSSL 1.0.1h was upgraded for the official Windows installers published on
+  python.org. (contributed by Zachary Ware in :issue:`21671` for CVE-2014-0224)
+
+:pep:`466` related features added in Python 2.7.9:
+
+* Most of Python 3.4's :mod:`ssl` module was backported. This means :mod:`ssl`
+  now supports Server Name Indication, TLS1.x settings, access to the platform
+  certificate store, the :class:`~ssl.SSLContext` class, and other
+  features. (Contributed by Alex Gaynor and David Reid; :issue:`21308`.)
+
+* :func:`os.urandom` was changed to cache a file descriptor to ``/dev/urandom``
+  instead of reopening ``/dev/urandom`` on every call. (Contributed by Alex
+  Gaynor; :issue:`21305`.)
+
+
+.. ======================================================================
+
 .. _acks27:
 
 Acknowledgements
diff --git a/Doc/whatsnew/3.0.rst b/Doc/whatsnew/3.0.rst
index 71b87b8..9941130 100644
--- a/Doc/whatsnew/3.0.rst
+++ b/Doc/whatsnew/3.0.rst
@@ -164,7 +164,7 @@
 
   If the input sequences are not of equal length, :func:`map` will
   stop at the termination of the shortest of the sequences. For full
-  compatibility with `map` from Python 2.x, also wrap the sequences in
+  compatibility with :func:`map` from Python 2.x, also wrap the sequences in
   :func:`itertools.zip_longest`, e.g. ``map(func, *sequences)`` becomes
   ``list(map(func, itertools.zip_longest(*sequences)))``.
 
diff --git a/Doc/whatsnew/3.1.rst b/Doc/whatsnew/3.1.rst
index ab327f5..f272da4 100644
--- a/Doc/whatsnew/3.1.rst
+++ b/Doc/whatsnew/3.1.rst
@@ -172,7 +172,7 @@
   needed and is now deprecated.
 
   (Contributed by Georg Brandl and Mattias Brändström;
-  `appspot issue 53094 <http://codereview.appspot.com/53094>`_.)
+  `appspot issue 53094 <https://codereview.appspot.com/53094>`_.)
 
 * ``round(x, n)`` now returns an integer if *x* is an integer.
   Previously it returned a float::
@@ -238,7 +238,7 @@
   (Contributed by Guilherme Polo; :issue:`2983`.)
 
 * The :class:`gzip.GzipFile` and :class:`bz2.BZ2File` classes now support
-  the context manager protocol::
+  the context management protocol::
 
         >>> # Automatically close file after writing
         >>> with gzip.GzipFile(filename, "wb") as f:
diff --git a/Doc/whatsnew/3.2.rst b/Doc/whatsnew/3.2.rst
index aa69df2..5171f3c 100644
--- a/Doc/whatsnew/3.2.rst
+++ b/Doc/whatsnew/3.2.rst
@@ -50,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
-`Misc/NEWS <http://hg.python.org/cpython/file/3.2/Misc/NEWS>`_ file.
+`Misc/NEWS <https://hg.python.org/cpython/file/3.2/Misc/NEWS>`_ file.
 
 .. seealso::
 
@@ -522,7 +522,7 @@
   (Proposed and implemented by Mark Dickinson; :issue:`9337`.)
 
 * :class:`memoryview` objects now have a :meth:`~memoryview.release()` method
-  and they also now support the context manager protocol.  This allows timely
+  and they also now support the context management protocol.  This allows timely
   release of any resources that were acquired when requesting a buffer from the
   original object.
 
@@ -816,7 +816,7 @@
   >>> sorted(iterable, key=cmp_to_key(locale.strcoll))
 
   For sorting examples and a brief sorting tutorial, see the `Sorting HowTo
-  <http://wiki.python.org/moin/HowTo/Sorting/>`_ tutorial.
+  <https://wiki.python.org/moin/HowTo/Sorting/>`_ tutorial.
 
   (Contributed by Raymond Hettinger.)
 
@@ -1020,7 +1020,7 @@
 :issue:`5094`, :issue:`6641`, :issue:`2706`, :issue:`1777412`, :issue:`8013`,
 and :issue:`10827`.)
 
-.. XXX http://bugs.python.org/issue?%40search_text=datetime&%40sort=-activity
+.. XXX https://bugs.python.org/issue?%40search_text=datetime&%40sort=-activity
 
 math
 ----
@@ -1315,7 +1315,7 @@
 ftp
 ---
 
-The :class:`ftplib.FTP` class now supports the context manager protocol to
+The :class:`ftplib.FTP` class now supports the context management protocol to
 unconditionally consume :exc:`socket.error` exceptions and to close the FTP
 connection when done::
 
@@ -1595,7 +1595,7 @@
   descriptor.  The latter can then be reused for other purposes.
   (Added by Antoine Pitrou; :issue:`8524`.)
 
-* :func:`socket.create_connection` now supports the context manager protocol
+* :func:`socket.create_connection` now supports the context management protocol
   to unconditionally consume :exc:`socket.error` exceptions and to close the
   socket when done.
   (Contributed by Giampaolo Rodolà; :issue:`9794`.)
@@ -2283,7 +2283,7 @@
 
   Additional details about the implementation can be read from a `python-dev
   mailing-list message
-  <http://mail.python.org/pipermail/python-dev/2009-October/093321.html>`_
+  <https://mail.python.org/pipermail/python-dev/2009-October/093321.html>`_
   (however, "priority requests" as exposed in this message have not been kept
   for inclusion).
 
@@ -2469,7 +2469,7 @@
 
 In addition to the existing Subversion code repository at http://svn.python.org
 there is now a `Mercurial <http://mercurial.selenic.com/>`_ repository at
-http://hg.python.org/\ .
+https://hg.python.org/\ .
 
 After the 3.2 release, there are plans to switch to Mercurial as the primary
 repository.  This distributed version control system should make it easier for
@@ -2478,7 +2478,7 @@
 
 To learn to use the new version control system, see the `tutorial by Joel
 Spolsky <http://hginit.com>`_ or the `Guide to Mercurial Workflows
-<http://mercurial.selenic.com/guide/>`_.
+<http://mercurial.selenic.com/guide>`_.
 
 
 Build and C API Changes
@@ -2560,7 +2560,7 @@
 build, there is a known problem with the default Tcl/Tk on Mac OS X 10.6.
 Accordingly, we recommend installing an updated alternative such as
 `ActiveState Tcl/Tk 8.5.9 <http://www.activestate.com/activetcl/downloads>`_\.
-See http://www.python.org/download/mac/tcltk/ for additional details.
+See https://www.python.org/download/mac/tcltk/ for additional details.
 
 Porting to Python 3.2
 =====================
@@ -2649,7 +2649,7 @@
                 outfile.write(line)
 
   (Contributed by Georg Brandl and Mattias Brändström;
-  `appspot issue 53094 <http://codereview.appspot.com/53094>`_.)
+  `appspot issue 53094 <https://codereview.appspot.com/53094>`_.)
 
 * :func:`struct.pack` now only allows bytes for the ``s`` string pack code.
   Formerly, it would accept text arguments and implicitly encode them to bytes
diff --git a/Doc/whatsnew/3.3.rst b/Doc/whatsnew/3.3.rst
index cda63e4..1fdb365 100644
--- a/Doc/whatsnew/3.3.rst
+++ b/Doc/whatsnew/3.3.rst
@@ -44,7 +44,7 @@
 
 This article explains the new features in Python 3.3, compared to 3.2.
 Python 3.3 was released on September 29, 2012.  For full details,
-see the `changelog <http://docs.python.org/3.3/whatsnew/changelog.html>`_.
+see the `changelog <https://docs.python.org/3.3/whatsnew/changelog.html>`_.
 
 .. seealso::
 
@@ -171,7 +171,7 @@
 * Multi-dimensional comparisons are supported for any array type.
 
 * One-dimensional memoryviews of hashable (read-only) types with formats B,
-  b or c are now hashable. (Contributed by Antoine Pitrou in :issue:`13411`)
+  b or c are now hashable.  (Contributed by Antoine Pitrou in :issue:`13411`.)
 
 * Arbitrary slicing of any 1-D arrays type is supported. For example, it
   is now possible to reverse a memoryview in O(1) by using a negative step.
@@ -196,7 +196,7 @@
 
 * For further changes see `Build and C API Changes`_ and `Porting C code`_.
 
-(Contributed by Stefan Krah in :issue:`10181`)
+(Contributed by Stefan Krah in :issue:`10181`.)
 
 .. seealso::
 
@@ -228,7 +228,7 @@
 
 Changes introduced by :pep:`393` are the following:
 
-* Python now always supports the full range of Unicode codepoints, including
+* Python now always supports the full range of Unicode code points, including
   non-BMP ones (i.e. from ``U+0000`` to ``U+10FFFF``).  The distinction between
   narrow and wide builds no longer exists and Python now behaves like a wide
   build, even under Windows.
@@ -246,7 +246,7 @@
     so ``'\U0010FFFF'[0]`` now returns ``'\U0010FFFF'`` and not ``'\uDBFF'``;
 
   * all other functions in the standard library now correctly handle
-    non-BMP codepoints.
+    non-BMP code points.
 
 * The value of :data:`sys.maxunicode` is now always ``1114111`` (``0x10FFFF``
   in hexadecimal).  The :c:func:`PyUnicode_GetMax` function still returns
@@ -258,13 +258,13 @@
 Performance and resource usage
 ------------------------------
 
-The storage of Unicode strings now depends on the highest codepoint in the string:
+The storage of Unicode strings now depends on the highest code point in the string:
 
-* pure ASCII and Latin1 strings (``U+0000-U+00FF``) use 1 byte per codepoint;
+* pure ASCII and Latin1 strings (``U+0000-U+00FF``) use 1 byte per code point;
 
-* BMP strings (``U+0000-U+FFFF``) use 2 bytes per codepoint;
+* BMP strings (``U+0000-U+FFFF``) use 2 bytes per code point;
 
-* non-BMP strings (``U+10000-U+10FFFF``) use 4 bytes per codepoint.
+* non-BMP strings (``U+10000-U+10FFFF``) use 4 bytes per code point.
 
 The net effect is that for most applications, memory usage of string
 storage should decrease significantly - especially compared to former
@@ -307,8 +307,8 @@
 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`).
+option to add the newly installed Python to the system PATH.  (Contributed
+by Brian Curtin in :issue:`3561`.)
 
 .. seealso::
 
@@ -781,7 +781,7 @@
   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`)
+  (Contributed by Ezio Melotti in :issue:`12753`.)
 
 * Unicode database updated to UCD version 6.1.0
 
@@ -793,7 +793,7 @@
   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`)
+  (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``
@@ -854,7 +854,7 @@
 * 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`)
+  (:issue:`4966`).
 
 
 New Modules
@@ -891,7 +891,7 @@
 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`)
+(Contributed by Google and Peter Moody in :pep:`3144`.)
 
 lzma
 ----
@@ -900,7 +900,7 @@
 using the LZMA algorithm, including support for the ``.xz`` and ``.lzma``
 file formats.
 
-(Contributed by Nadeem Vawda and Per Øyvind Karlsen in :issue:`6715`)
+(Contributed by Nadeem Vawda and Per Øyvind Karlsen in :issue:`6715`.)
 
 
 Improved Modules
@@ -921,7 +921,7 @@
   * :class:`abc.abstractstaticmethod` has been deprecated, use
     :class:`staticmethod` with :func:`abc.abstractmethod` instead.
 
-(Contributed by Darren Dale in :issue:`11610`)
+(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`).
@@ -933,7 +933,7 @@
 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`)
+(Contributed by Oren Tirosh and Hirokazu Yamamoto in :issue:`1172711`.)
 
 
 base64
@@ -964,14 +964,14 @@
 * :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`)
+  (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`)
+  (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.
@@ -1018,7 +1018,7 @@
 
 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`)
+: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
@@ -1069,7 +1069,7 @@
    push a wide character so the next :meth:`~curses.window.get_wch` will return
    it
 
-(Contributed by Iñigo Serna in :issue:`6755`)
+(Contributed by Iñigo Serna in :issue:`6755`.)
 
 datetime
 --------
@@ -1376,11 +1376,11 @@
   :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`)
+  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`)
+  :meth:`ftplib.FTP.dir`.  (Contributed by Giampaolo Rodolà in :issue:`11072`.)
 
 
 functools
@@ -1404,7 +1404,7 @@
 
 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`)
+Coghlan and Christian Heimes in :issue:`15061`.)
 
 
 http
@@ -1436,13 +1436,13 @@
 (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`)
+: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`)
+Melotti in :issue:`11113` and :issue:`15156`.)
 
 
 imaplib
@@ -1451,7 +1451,7 @@
 The :class:`~imaplib.IMAP4_SSL` constructor now accepts an SSLContext
 parameter to control parameters of the secure channel.
 
-(Contributed by Sijin Joseph in :issue:`8808`)
+(Contributed by Sijin Joseph in :issue:`8808`.)
 
 
 inspect
@@ -1462,14 +1462,14 @@
 where those names were resolved, making it easier to verify correct internal
 state when testing code that relies on stateful closures.
 
-(Contributed by Meador Inge and Nick Coghlan in :issue:`13062`)
+(Contributed by Meador Inge and Nick Coghlan in :issue:`13062`.)
 
 A new :func:`~inspect.getgeneratorlocals` function has been added. This
 function reports the current binding of local variables in the generator's
 stack frame, making it easier to verify correct internal state when testing
 generators.
 
-(Contributed by Meador Inge in :issue:`15153`)
+(Contributed by Meador Inge in :issue:`15153`.)
 
 io
 --
@@ -1478,7 +1478,7 @@
 exclusively create a new file, and raise a :exc:`FileExistsError` if the file
 already exists. It is based on the C11 'x' mode to fopen().
 
-(Contributed by David Townshend in :issue:`12760`)
+(Contributed by David Townshend in :issue:`12760`.)
 
 The constructor of the :class:`~io.TextIOWrapper` class has a new
 *write_through* optional argument. If *write_through* is ``True``, calls to
@@ -1513,7 +1513,7 @@
 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`).
+(Written by Mark Dickinson in :issue:`11888`.)
 
 
 mmap
@@ -1540,7 +1540,7 @@
 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
+New 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).
@@ -1556,7 +1556,7 @@
 nntplib
 -------
 
-The :class:`nntplib.NNTP` class now supports the context manager protocol to
+The :class:`nntplib.NNTP` class now supports the context management protocol to
 unconditionally consume :exc:`socket.error` exceptions and to close the NNTP
 connection when done::
 
@@ -1567,7 +1567,7 @@
   ('211 1755 1 1755 gmane.comp.python.committers', 1755, 1, 1755, 'gmane.comp.python.committers')
   >>>
 
-(Contributed by Giampaolo Rodolà in :issue:`9795`)
+(Contributed by Giampaolo Rodolà in :issue:`9795`.)
 
 
 os
@@ -1744,24 +1744,24 @@
   set to False makes the method execute the scheduled events due to expire
   soonest (if any) and then return immediately.
   This is useful in case you want to use the :class:`~sched.scheduler` in
-  non-blocking applications.  (Contributed by Giampaolo Rodolà in :issue:`13449`)
+  non-blocking applications.  (Contributed by Giampaolo Rodolà in :issue:`13449`.)
 
 * :class:`~sched.scheduler` class can now be safely used in multi-threaded
   environments.  (Contributed by Josiah Carlson and Giampaolo Rodolà in
-  :issue:`8684`)
+  :issue:`8684`.)
 
 * *timefunc* and *delayfunct* parameters of :class:`~sched.scheduler` class
   constructor are now optional and defaults to :func:`time.time` and
   :func:`time.sleep` respectively.  (Contributed by Chris Clark in
-  :issue:`13245`)
+  :issue:`13245`.)
 
 * :meth:`~sched.scheduler.enter` and :meth:`~sched.scheduler.enterabs`
   *argument* parameter is now optional.  (Contributed by Chris Clark in
-  :issue:`13245`)
+  :issue:`13245`.)
 
 * :meth:`~sched.scheduler.enter` and :meth:`~sched.scheduler.enterabs`
   now accept a *kwargs* parameter.  (Contributed by Chris Clark in
-  :issue:`13245`)
+  :issue:`13245`.)
 
 
 select
@@ -1787,10 +1787,10 @@
 * New functions:
 
   * :func:`~shutil.disk_usage`: provides total, used and free disk space
-    statistics. (Contributed by Giampaolo Rodolà in :issue:`12442`)
+    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`)
+    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`.)
@@ -1813,7 +1813,7 @@
 
 * :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
+  :func:`os.unlink`.  (Contributed by Martin von Löwis and Hynek Schlawack
   in :issue:`4489`.)
 
 
@@ -1861,13 +1861,13 @@
 when creating the outgoing socket.  (Contributed by Paulo Scardine in
 :issue:`11281`.)
 
-:class:`~smtplib.SMTP` now supports the context manager protocol, allowing an
+:class:`~smtplib.SMTP` now supports the context management 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
@@ -1887,11 +1887,11 @@
   (http://en.wikipedia.org/wiki/Socketcan), on Linux
   (http://lwn.net/Articles/253425).
 
-  (Contributed by Matthias Fuchs, updated by Tiago Gonçalves in :issue:`10141`)
+  (Contributed by Matthias Fuchs, updated by Tiago Gonçalves in :issue:`10141`.)
 
 * The :class:`~socket.socket` class now supports the PF_RDS protocol family
   (http://en.wikipedia.org/wiki/Reliable_Datagram_Sockets and
-  http://oss.oracle.com/projects/rds/).
+  https://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`.)
@@ -1929,37 +1929,37 @@
     pseudo-random bytes.
   * :func:`~ssl.RAND_pseudo_bytes`: generate pseudo-random bytes.
 
-  (Contributed by Victor Stinner in :issue:`12049`)
+  (Contributed by Victor Stinner in :issue:`12049`.)
 
 * 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`)
+  (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`)
+  (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`)
+  (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.  The new attribute
   :attr:`~ssl.OP_NO_COMPRESSION` can be used to disable compression.
-  (Contributed by Antoine Pitrou in :issue:`13634`)
+  (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`)
+  (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`)
+  (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`.)
@@ -1976,7 +1976,7 @@
 :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`)
+(Contributed by Giampaolo Rodolà in :issue:`14807`.)
 
 
 struct
@@ -2035,8 +2035,8 @@
 :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`).
+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
@@ -2066,7 +2066,7 @@
 
 * :func:`~time.clock_getres`, :func:`~time.clock_gettime` and
   :func:`~time.clock_settime` functions with ``CLOCK_xxx`` constants.
-  (Contributed by Victor Stinner in :issue:`10278`)
+  (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
@@ -2080,7 +2080,7 @@
 (:issue:`14386`)
 
 
-The new functions `types.new_class` and `types.prepare_class` provide support
+The new functions :func:`types.new_class` and :func:`types.prepare_class` provide support
 for PEP 3115 compliant dynamic type creation. (:issue:`14588`)
 
 
@@ -2090,7 +2090,7 @@
 :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`)
+:issue:`10775`.)
 
 :meth:`unittest.TestCase.run` now returns the :class:`~unittest.TestResult`
 object.
@@ -2103,7 +2103,7 @@
 used by :meth:`~urllib.request.Request.get_method` to determine what HTTP method
 should be used.  For example, this will send a ``'HEAD'`` request::
 
-   >>> urlopen(Request('http://www.python.org', method='HEAD'))
+   >>> urlopen(Request('https://www.python.org', method='HEAD'))
 
 (:issue:`1673007`)
 
@@ -2117,7 +2117,7 @@
 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`)
+by Matthias Klose in :issue:`14493`.)
 
 
 xml.etree.ElementTree
@@ -2160,7 +2160,7 @@
 
 * UTF-8 is now 2x to 4x faster.  UTF-16 encoding is now up to 10x faster.
 
-  (contributed by Serhiy Storchaka, :issue:`14624`, :issue:`14738` and
+  (Contributed by Serhiy Storchaka, :issue:`14624`, :issue:`14738` and
   :issue:`15026`.)
 
 
diff --git a/Doc/whatsnew/3.4.rst b/Doc/whatsnew/3.4.rst
new file mode 100644
index 0000000..bc3a6cc
--- /dev/null
+++ b/Doc/whatsnew/3.4.rst
@@ -0,0 +1,2535 @@
+****************************
+  What's New In Python 3.4
+****************************
+
+:Author: R. David Murray <rdmurray@bitdance.com> (Editor)
+
+.. Rules for maintenance:
+
+   * Anyone can add text to this document, but the maintainer reserves the
+   right to rewrite any additions. In particular, for obscure or esoteric
+   features, the maintainer may reduce any addition to a simple reference to
+   the new documentation rather than explaining the feature inline.
+
+   * While the maintainer will periodically go through Misc/NEWS
+   and add changes, it's best not to rely on this. We know from experience
+   that any changes that aren't in the What's New documentation around the
+   time of the original release will remain largely unknown to the community
+   for years, even if they're added later. We also know from experience that
+   other priorities can arise, and the maintainer will run out of time to do
+   updates -- in such cases, end users will be much better served by partial
+   notifications that at least give a hint about new features to
+   investigate.
+
+   * This is not a complete list of every single change; completeness
+   is the purpose of Misc/NEWS. The What's New should focus on changes that
+   are visible to Python *users* and that *require* a feature release (i.e.
+   most bug fixes should only be recorded in Misc/NEWS)
+
+   * PEPs should not be marked Final until they have an entry in What's New.
+   A placeholder entry that is just a section header and a link to the PEP
+   (e.g ":pep:`397` has been implemented") is acceptable. If a PEP has been
+   implemented and noted in What's New, don't forget to mark it as Final!
+
+   * If you want to draw your new text to the attention of the
+   maintainer, add 'XXX' to the beginning of the paragraph or
+   section.
+
+   * It's OK to add just a very brief note about a change.  For
+   example: "The :ref:`~socket.transmogrify()` function was added to the
+   :mod:`socket` module."  The maintainer will research the change and
+   write the necessary text (if appropriate). The advantage of doing this
+   is that even if no more descriptive text is ever added, readers will at
+   least have a notification that the new feature exists and a link to the
+   relevant documentation.
+
+   * You can comment out your additions if you like, but it's not
+   necessary (especially when a final release is some months away).
+
+   * Credit the author of a patch or bugfix.   Just the name is
+   sufficient; the e-mail address isn't necessary.
+
+   * It's helpful to add the bug/patch number as a comment:
+
+   The :ref:`~socket.transmogrify()` function was added to the
+   :mod:`socket` module.  (Contributed by P.Y. Developer in :issue:`12345`.)
+
+   This saves the maintainer the effort of going through the Mercurial log
+   when researching a change.
+
+   * Cross referencing tip: :ref:`mod.attr` will display as ``mod.attr``,
+   while :ref:`~mod.attr` will display as ``attr``.
+
+This article explains the new features in Python 3.4, compared to 3.3.
+Python 3.4 was released on March 16, 2014.  For full details, see the
+`changelog <https://docs.python.org/3.4/whatsnew/changelog.html>`_.
+
+
+.. seealso::
+
+   :pep:`429` -- Python 3.4 Release Schedule
+
+
+
+Summary -- Release Highlights
+=============================
+
+.. This section singles out the most important changes in Python 3.4.
+   Brevity is key.
+
+New syntax features:
+
+* No new syntax features were added in Python 3.4.
+
+Other new features:
+
+* :ref:`pip should always be available <whatsnew-pep-453>` (:pep:`453`).
+* :ref:`Newly created file descriptors are non-inheritable <whatsnew-pep-446>`
+  (:pep:`446`).
+* command line option for :ref:`isolated mode <whatsnew-isolated-mode>`
+  (:issue:`16499`).
+* :ref:`improvements in the handling of codecs <codec-handling-improvements>`
+  that are not text encodings (multiple issues).
+* :ref:`A ModuleSpec Type <whatsnew-pep-451>` for the Import System
+  (:pep:`451`).  (Affects importer authors.)
+* The :mod:`marshal` format has been made :ref:`more compact and efficient
+  <whatsnew-marshal-3>` (:issue:`16475`).
+
+New library modules:
+
+* :mod:`asyncio`: :ref:`New provisional API for asynchronous IO
+  <whatsnew-asyncio>` (:pep:`3156`).
+* :mod:`ensurepip`: :ref:`Bootstrapping the pip installer <whatsnew-ensurepip>`
+  (:pep:`453`).
+* :mod:`enum`: :ref:`Support for enumeration types <whatsnew-enum>`
+  (:pep:`435`).
+* :mod:`pathlib`: :ref:`Object-oriented filesystem paths <whatsnew-pathlib>`
+  (:pep:`428`).
+* :mod:`selectors`: :ref:`High-level and efficient I/O multiplexing
+  <whatsnew-selectors>`, built upon the :mod:`select` module primitives (part
+  of :pep:`3156`).
+* :mod:`statistics`: A basic :ref:`numerically stable statistics library
+  <whatsnew-statistics>` (:pep:`450`).
+* :mod:`tracemalloc`: :ref:`Trace Python memory allocations
+  <whatsnew-tracemalloc>` (:pep:`454`).
+
+Significantly improved library modules:
+
+* :ref:`Single-dispatch generic functions <whatsnew-singledispatch>` in
+  :mod:`functools` (:pep:`443`).
+* New :mod:`pickle` :ref:`protocol 4 <whatsnew-protocol-4>` (:pep:`3154`).
+* :mod:`multiprocessing` now has :ref:`an option to avoid using os.fork
+  on Unix <whatsnew-multiprocessing-no-fork>` (:issue:`8713`).
+* :mod:`email` has a new submodule, :mod:`~email.contentmanager`, and
+  a new :mod:`~email.message.Message` subclass
+  (:class:`~email.contentmanager.EmailMessage`) that :ref:`simplify MIME
+  handling <whatsnew_email_contentmanager>` (:issue:`18891`).
+* The :mod:`inspect` and :mod:`pydoc` modules are now capable of
+  correct introspection of a much wider variety of callable objects,
+  which improves the output of the Python :func:`help` system.
+* The :mod:`ipaddress` module API has been declared stable
+
+Security improvements:
+
+* :ref:`Secure and interchangeable hash algorithm <whatsnew-pep-456>`
+  (:pep:`456`).
+* :ref:`Make newly created file descriptors non-inheritable <whatsnew-pep-446>`
+  (:pep:`446`) to avoid leaking file descriptors to child processes.
+* New command line option for :ref:`isolated mode <whatsnew-isolated-mode>`,
+  (:issue:`16499`).
+* :mod:`multiprocessing` now has :ref:`an option to avoid using os.fork
+  on Unix <whatsnew-multiprocessing-no-fork>`.  *spawn* and *forkserver* are
+  more secure because they avoid sharing data with child processes.
+* :mod:`multiprocessing` child processes on Windows no longer inherit
+  all of the parent's inheritable handles, only the necessary ones.
+* A new :func:`hashlib.pbkdf2_hmac` function provides
+  the `PKCS#5 password-based key derivation function 2
+  <http://en.wikipedia.org/wiki/PBKDF2>`_.
+* :ref:`TLSv1.1 and TLSv1.2 support <whatsnew-tls-11-12>` for :mod:`ssl`.
+* :ref:`Retrieving certificates from the Windows system cert store support
+  <whatsnew34-win-cert-store>` for :mod:`ssl`.
+* :ref:`Server-side SNI (Server Name Indication) support
+  <whatsnew34-sni>` for :mod:`ssl`.
+* The :class:`ssl.SSLContext` class has a :ref:`lot of improvements
+  <whatsnew34-sslcontext>`.
+* All modules in the standard library that support SSL now support server
+  certificate verification, including hostname matching
+  (:func:`ssl.match_hostname`) and CRLs (Certificate Revocation lists, see
+  :func:`ssl.SSLContext.load_verify_locations`).
+
+CPython implementation improvements:
+
+* :ref:`Safe object finalization <whatsnew-pep-442>` (:pep:`442`).
+* Leveraging :pep:`442`, in most cases :ref:`module globals are no longer set
+  to None during finalization <whatsnew-pep-442>` (:issue:`18214`).
+* :ref:`Configurable memory allocators <whatsnew-pep-445>` (:pep:`445`).
+* :ref:`Argument Clinic <whatsnew-pep-436>` (:pep:`436`).
+
+Please read on for a comprehensive list of user-facing changes, including many
+other smaller improvements, CPython optimizations, deprecations, and potential
+porting issues.
+
+
+
+New Features
+============
+
+.. _whatsnew-pep-453:
+
+PEP 453: Explicit Bootstrapping of PIP in Python Installations
+--------------------------------------------------------------
+
+Bootstrapping pip By Default
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The new :mod:`ensurepip` module (defined in :pep:`453`) provides a standard
+cross-platform mechanism to bootstrap the pip installer into Python
+installations and virtual environments. The version of ``pip`` included
+with Python 3.4.0 is ``pip`` 1.5.4, and future 3.4.x maintenance releases
+will update the bundled version to the latest version of ``pip`` that is
+available at the time of creating the release candidate.
+
+By default, the commands ``pipX`` and ``pipX.Y`` will be installed on all
+platforms (where X.Y stands for the version of the Python installation),
+along with the ``pip`` Python package and its dependencies. On Windows and
+in virtual environments on all platforms, the unversioned ``pip`` command
+will also be installed. On other platforms, the system wide unversioned
+``pip`` command typically refers to the separately installed Python 2
+version.
+
+The :ref:`pyvenv <scripts-pyvenv>` command line utility and the :mod:`venv`
+module make use of the :mod:`ensurepip` module to make ``pip`` readily
+available in virtual environments. When using the command line utility,
+``pip`` is installed by default, while when using the :mod:`venv` module
+:ref:`venv-api` installation of ``pip`` must be requested explicitly.
+
+For CPython :ref:`source builds on POSIX systems <building-python-on-unix>`,
+the ``make install`` and ``make altinstall`` commands bootstrap ``pip`` by
+default.  This behaviour can be controlled through configure options, and
+overridden through Makefile options.
+
+On Windows and Mac OS X, the CPython installers now default to installing
+``pip`` along with CPython itself (users may opt out of installing it
+during the installation process). Window users will need to opt in to the
+automatic ``PATH`` modifications to have ``pip`` available from the command
+line by default, otherwise it can still be accessed through the Python
+launcher for Windows as ``py -m pip``.
+
+As `discussed in the PEP`__, platform packagers may choose not to install
+these commands by default, as long as, when invoked, they provide clear and
+simple directions on how to install them on that platform (usually using
+the system package manager).
+
+__ https://www.python.org/dev/peps/pep-0453/#recommendations-for-downstream-distributors
+
+.. note::
+
+   To avoid conflicts between parallel Python 2 and Python 3 installations,
+   only the versioned ``pip3`` and ``pip3.4`` commands are bootstrapped by
+   default when ``ensurepip`` is invoked directly - the ``--default-pip``
+   option is needed to also request the unversioned ``pip`` command.
+   ``pyvenv`` and the Windows installer ensure that the unqualified ``pip``
+   command is made available in those environments, and ``pip`` can always be
+   invoked via the ``-m`` switch rather than directly to avoid ambiguity on
+   systems with multiple Python installations.
+
+
+Documentation Changes
+~~~~~~~~~~~~~~~~~~~~~
+
+As part of this change, the :ref:`installing-index` and
+:ref:`distributing-index` sections of the documentation have been
+completely redesigned as short getting started and FAQ documents. Most
+packaging documentation has now been moved out to the Python Packaging
+Authority maintained `Python Packaging User Guide
+<https://packaging.python.org>`__ and the documentation of the individual
+projects.
+
+However, as this migration is currently still incomplete, the legacy
+versions of those guides remaining available as :ref:`install-index`
+and :ref:`distutils-index`.
+
+.. seealso::
+
+   :pep:`453` -- Explicit bootstrapping of pip in Python installations
+      PEP written by Donald Stufft and Nick Coghlan, implemented by
+      Donald Stufft, Nick Coghlan, Martin von Löwis and Ned Deily.
+
+
+.. _whatsnew-pep-446:
+
+PEP 446: Newly Created File Descriptors Are Non-Inheritable
+-----------------------------------------------------------
+
+:pep:`446` makes newly created file descriptors :ref:`non-inheritable
+<fd_inheritance>`.  In general, this is the behavior an application will
+want: when launching a new process, having currently open files also
+open in the new process can lead to all sorts of hard to find bugs,
+and potentially to security issues.
+
+However, there are occasions when inheritance is desired.  To support
+these cases, the following new functions and methods are available:
+
+* :func:`os.get_inheritable`, :func:`os.set_inheritable`
+* :func:`os.get_handle_inheritable`, :func:`os.set_handle_inheritable`
+* :meth:`socket.socket.get_inheritable`, :meth:`socket.socket.set_inheritable`
+
+.. seealso::
+
+   :pep:`446` -- Make newly created file descriptors non-inheritable
+      PEP written and implemented by Victor Stinner.
+
+
+.. _codec-handling-improvements:
+
+Improvements to Codec Handling
+------------------------------
+
+Since it was first introduced, the :mod:`codecs` module has always been
+intended to operate as a type-neutral dynamic encoding and decoding
+system. However, its close coupling with the Python text model, especially
+the type restricted convenience methods on the builtin :class:`str`,
+:class:`bytes` and :class:`bytearray` types, has historically obscured that
+fact.
+
+As a key step in clarifying the situation, the :meth:`codecs.encode` and
+:meth:`codecs.decode` convenience functions are now properly documented in
+Python 2.7, 3.3 and 3.4. These functions have existed in the :mod:`codecs`
+module (and have been covered by the regression test suite) since Python 2.4,
+but were previously only discoverable through runtime introspection.
+
+Unlike the convenience methods on :class:`str`, :class:`bytes` and
+:class:`bytearray`, the :mod:`codecs` convenience functions support arbitrary
+codecs in both Python 2 and Python 3, rather than being limited to Unicode text
+encodings (in Python 3) or ``basestring`` <-> ``basestring`` conversions (in
+Python 2).
+
+In Python 3.4, the interpreter is able to identify the known non-text
+encodings provided in the standard library and direct users towards these
+general purpose convenience functions when appropriate::
+
+    >>> b"abcdef".decode("hex")
+    Traceback (most recent call last):
+      File "<stdin>", line 1, in <module>
+    LookupError: 'hex' is not a text encoding; use codecs.decode() to handle arbitrary codecs
+
+    >>> "hello".encode("rot13")
+    Traceback (most recent call last):
+      File "<stdin>", line 1, in <module>
+    LookupError: 'rot13' is not a text encoding; use codecs.encode() to handle arbitrary codecs
+
+    >>> open("foo.txt", encoding="hex")
+    Traceback (most recent call last):
+      File "<stdin>", line 1, in <module>
+    LookupError: 'hex' is not a text encoding; use codecs.open() to handle arbitrary codecs
+
+In a related change, whenever it is feasible without breaking backwards
+compatibility, exceptions raised during encoding and decoding operations
+are wrapped in a chained exception of the same type that mentions the
+name of the codec responsible for producing the error::
+
+    >>> import codecs
+
+    >>> codecs.decode(b"abcdefgh", "hex")
+    Traceback (most recent call last):
+      File "/usr/lib/python3.4/encodings/hex_codec.py", line 20, in hex_decode
+        return (binascii.a2b_hex(input), len(input))
+    binascii.Error: Non-hexadecimal digit found
+
+    The above exception was the direct cause of the following exception:
+
+    Traceback (most recent call last):
+      File "<stdin>", line 1, in <module>
+    binascii.Error: decoding with 'hex' codec failed (Error: Non-hexadecimal digit found)
+
+    >>> codecs.encode("hello", "bz2")
+    Traceback (most recent call last):
+      File "/usr/lib/python3.4/encodings/bz2_codec.py", line 17, in bz2_encode
+        return (bz2.compress(input), len(input))
+      File "/usr/lib/python3.4/bz2.py", line 498, in compress
+        return comp.compress(data) + comp.flush()
+    TypeError: 'str' does not support the buffer interface
+
+    The above exception was the direct cause of the following exception:
+
+    Traceback (most recent call last):
+      File "<stdin>", line 1, in <module>
+    TypeError: encoding with 'bz2' codec failed (TypeError: 'str' does not support the buffer interface)
+
+Finally, as the examples above show, these improvements have permitted
+the restoration of the convenience aliases for the non-Unicode codecs that
+were themselves restored in Python 3.2. This means that encoding binary data
+to and from its hexadecimal representation (for example) can now be written
+as::
+
+    >>> from codecs import encode, decode
+    >>> encode(b"hello", "hex")
+    b'68656c6c6f'
+    >>> decode(b"68656c6c6f", "hex")
+    b'hello'
+
+The binary and text transforms provided in the standard library are detailed
+in :ref:`binary-transforms` and :ref:`text-transforms`.
+
+(Contributed by Nick Coghlan in :issue:`7475`, :issue:`17827`,
+:issue:`17828` and :issue:`19619`.)
+
+
+.. _whatsnew-pep-451:
+
+PEP 451: A ModuleSpec Type for the Import System
+------------------------------------------------
+
+:pep:`451` provides an encapsulation of the information about a module that the
+import machinery will use to load it (that is, a module specification).  This
+helps simplify both the import implementation and several import-related APIs.
+The change is also a stepping stone for `several future import-related
+improvements`__.
+
+__ https://mail.python.org/pipermail/python-dev/2013-November/130111.html
+
+The public-facing changes from the PEP are entirely backward-compatible.
+Furthermore, they should be transparent to everyone but importer authors.  Key
+finder and loader methods have been deprecated, but they will continue working.
+New importers should use the new methods described in the PEP.  Existing
+importers should be updated to implement the new methods.  See the
+:ref:`deprecated-3.4` section for a list of methods that should be replaced and
+their replacements.
+
+
+Other Language Changes
+----------------------
+
+Some smaller changes made to the core Python language are:
+
+* Unicode database updated to UCD version 6.3.
+
+* :func:`min` and :func:`max` now accept a *default* keyword-only argument that
+  can be used to specify the value they return if the iterable they are
+  evaluating has no elements.  (Contributed by Julian Berman in
+  :issue:`18111`.)
+
+* Module objects are now :mod:`weakref`'able.
+
+* Module ``__file__`` attributes (and related values) should now always
+  contain absolute paths by default, with the sole exception of
+  ``__main__.__file__`` when a script has been executed directly using
+  a relative path.  (Contributed by Brett Cannon in :issue:`18416`.)
+
+* All the UTF-\* codecs (except UTF-7) now reject surrogates during both
+  encoding and decoding unless the ``surrogatepass`` error handler is used,
+  with the exception of the UTF-16 decoder (which accepts valid surrogate pairs)
+  and the UTF-16 encoder (which produces them while encoding non-BMP characters).
+  (Contributed by Victor Stinner, Kang-Hao (Kenny) Lu and Serhiy Storchaka in
+  :issue:`12892`.)
+
+* New German EBCDIC :ref:`codec <standard-encodings>` ``cp273``.  (Contributed
+  by Michael Bierenfeld and Andrew Kuchling in :issue:`1097797`.)
+
+* New Ukrainian :ref:`codec <standard-encodings>` ``cp1125``.  (Contributed by
+  Serhiy Storchaka in :issue:`19668`.)
+
+* :class:`bytes`.join() and :class:`bytearray`.join() now accept arbitrary
+  buffer objects as arguments.  (Contributed by Antoine Pitrou in
+  :issue:`15958`.)
+
+* The :class:`int` constructor now accepts any object that has an ``__index__``
+  method for its *base* argument.  (Contributed by Mark Dickinson in
+  :issue:`16772`.)
+
+* Frame objects now have a :func:`~frame.clear` method that clears all
+  references to local variables from the frame.  (Contributed by Antoine Pitrou
+  in :issue:`17934`.)
+
+* :class:`memoryview` is now registered as a :class:`Sequence <collections.abc>`,
+  and supports the :func:`reversed` builtin.  (Contributed by Nick Coghlan
+  and Claudiu Popa in :issue:`18690` and :issue:`19078`.)
+
+* Signatures reported by :func:`help` have been modified and improved in
+  several cases as a result of the introduction of Argument Clinic and other
+  changes to the :mod:`inspect` and :mod:`pydoc` modules.
+
+* :meth:`~object.__length_hint__` is now part of the formal language
+  specification (see :pep:`424`).  (Contributed by Armin Ronacher in
+  :issue:`16148`.)
+
+
+New Modules
+===========
+
+
+.. _whatsnew-asyncio:
+
+asyncio
+-------
+
+The new :mod:`asyncio` module (defined in :pep:`3156`) provides a standard
+pluggable event loop model for Python, providing solid asynchronous IO
+support in the standard library, and making it easier for other event loop
+implementations to interoperate with the standard library and each other.
+
+For Python 3.4, this module is considered a :term:`provisional API`.
+
+.. seealso::
+
+   :pep:`3156` -- Asynchronous IO Support Rebooted: the "asyncio" Module
+      PEP written and implementation led by Guido van Rossum.
+
+
+.. _whatsnew-ensurepip:
+
+ensurepip
+---------
+
+The new :mod:`ensurepip` module is the primary infrastructure for the
+:pep:`453` implementation.  In the normal course of events end users will not
+need to interact with this module, but it can be used to manually bootstrap
+``pip`` if the automated bootstrapping into an installation or virtual
+environment was declined.
+
+:mod:`ensurepip` includes a bundled copy of ``pip``, up-to-date as of the first
+release candidate of the release of CPython with which it ships (this applies
+to both maintenance releases and feature releases).  ``ensurepip`` does not
+access the internet.  If the installation has Internet access, after
+``ensurepip`` is run the bundled ``pip`` can be used to upgrade ``pip`` to a
+more recent release than the bundled one.  (Note that such an upgraded version
+of ``pip`` is considered to be a separately installed package and will not be
+removed if Python is uninstalled.)
+
+The module is named *ensure*\ pip because if called when ``pip`` is already
+installed, it does nothing.  It also has an ``--upgrade`` option that will
+cause it to install the bundled copy of ``pip`` if the existing installed
+version of ``pip`` is older than the bundled copy.
+
+
+.. _whatsnew-enum:
+
+enum
+----
+
+The new :mod:`enum` module (defined in :pep:`435`) provides a standard
+implementation of enumeration types, allowing other modules (such as
+:mod:`socket`) to provide more informative error messages and better
+debugging support by replacing opaque integer constants with backwards
+compatible enumeration values.
+
+.. seealso::
+
+   :pep:`435` -- Adding an Enum type to the Python standard library
+      PEP written by Barry Warsaw, Eli Bendersky and Ethan Furman,
+      implemented by Ethan Furman.
+
+
+.. _whatsnew-pathlib:
+
+pathlib
+-------
+
+The new :mod:`pathlib` module offers classes representing filesystem paths
+with semantics appropriate for different operating systems.  Path classes are
+divided between *pure paths*, which provide purely computational operations
+without I/O, and *concrete paths*, which inherit from pure paths but also
+provide I/O operations.
+
+For Python 3.4, this module is considered a :term:`provisional API`.
+
+.. seealso::
+
+   :pep:`428` -- The pathlib module -- object-oriented filesystem paths
+      PEP written and implemented by Antoine Pitrou.
+
+
+.. _whatsnew-selectors:
+
+selectors
+---------
+
+The new :mod:`selectors` module (created as part of implementing :pep:`3156`)
+allows high-level and efficient I/O multiplexing, built upon the
+:mod:`select` module primitives.
+
+
+.. _whatsnew-statistics:
+
+statistics
+----------
+
+The new :mod:`statistics` module (defined in :pep:`450`) offers some core
+statistics functionality directly in the standard library. This module
+supports calculation of the mean, median, mode, variance and standard
+deviation of a data series.
+
+.. seealso::
+
+   :pep:`450` -- Adding A Statistics Module To The Standard Library
+      PEP written and implemented by Steven D'Aprano
+
+.. _whatsnew-tracemalloc:
+
+
+tracemalloc
+-----------
+
+The new :mod:`tracemalloc` module (defined in :pep:`454`) is a debug tool to
+trace memory blocks allocated by Python. It provides the following information:
+
+* Trace where an object was allocated
+* Statistics on allocated memory blocks per filename and per line number:
+  total size, number and average size of allocated memory blocks
+* Compute the differences between two snapshots to detect memory leaks
+
+.. seealso::
+
+   :pep:`454` -- Add a new tracemalloc module to trace Python memory allocations
+      PEP written and implemented by Victor Stinner
+
+
+
+Improved Modules
+================
+
+
+abc
+---
+
+New function :func:`abc.get_cache_token` can be used to know when to invalidate
+caches that are affected by changes in the object graph.  (Contributed
+by Łukasz Langa in :issue:`16832`.)
+
+New class :class:`~abc.ABC` has :class:`~abc.ABCMeta` as its meta class.
+Using ``ABC`` as a base class has essentially the same effect as specifying
+``metaclass=abc.ABCMeta``, but is simpler to type and easier to read.
+(Contributed by Bruno Dupuis in :issue:`16049`.)
+
+
+aifc
+----
+
+The :meth:`~aifc.aifc.getparams` method now returns a namedtuple rather than a
+plain tuple.  (Contributed by Claudiu Popa in :issue:`17818`.)
+
+:func:`aifc.open` now supports the context management protocol: when used in a
+:keyword:`with` block, the :meth:`~aifc.aifc.close` method of the returned
+object will be called automatically at the end of the block.  (Contributed by
+Serhiy Storchacha in :issue:`16486`.)
+
+The :meth:`~aifc.aifc.writeframesraw` and :meth:`~aifc.aifc.writeframes`
+methods now accept any :term:`bytes-like object`.  (Contributed by Serhiy
+Storchaka in :issue:`8311`.)
+
+
+argparse
+--------
+
+The :class:`~argparse.FileType` class now accepts *encoding* and
+*errors* arguments, which are passed through to :func:`open`.  (Contributed
+by Lucas Maystre in :issue:`11175`.)
+
+
+audioop
+-------
+
+:mod:`audioop` now supports 24-bit samples.  (Contributed by Serhiy Storchaka
+in :issue:`12866`.)
+
+New :func:`~audioop.byteswap` function converts big-endian samples to
+little-endian and vice versa.  (Contributed by Serhiy Storchaka in
+:issue:`19641`.)
+
+All :mod:`audioop` functions now accept any :term:`bytes-like object`.  Strings
+are not accepted: they didn't work before, now they raise an error right away.
+(Contributed by Serhiy Storchaka in :issue:`16685`.)
+
+
+base64
+------
+
+The encoding and decoding functions in :mod:`base64` now accept any
+:term:`bytes-like object` in cases where it previously required a
+:class:`bytes` or :class:`bytearray` instance.  (Contributed by Nick Coghlan in
+:issue:`17839`.)
+
+New functions :func:`~base64.a85encode`, :func:`~base64.a85decode`,
+:func:`~base64.b85encode`, and :func:`~base64.b85decode` provide the ability to
+encode and decode binary data from and to ``Ascii85`` and the git/mercurial
+``Base85`` formats, respectively.  The ``a85`` functions have options that can
+be used to make them compatible with the variants of the ``Ascii85`` encoding,
+including the Adobe variant.  (Contributed by Martin Morrison, the Mercurial
+project, Serhiy Storchaka, and Antoine Pitrou in :issue:`17618`.)
+
+
+collections
+-----------
+
+The :meth:`.ChainMap.new_child` method now accepts an *m* argument specifying
+the child map to add to the chain.  This allows an existing mapping and/or a
+custom mapping type to be used for the child.  (Contributed by Vinay Sajip in
+:issue:`16613`.)
+
+
+colorsys
+--------
+
+The number of digits in the coefficients for the RGB --- YIQ conversions have
+been expanded so that they match the FCC NTSC versions.  The change in
+results should be less than 1% and may better match results found elsewhere.
+(Contributed by Brian Landers and Serhiy Storchaka in :issue:`14323`.)
+
+
+contextlib
+----------
+
+The new :class:`contextlib.suppress` context manager helps to clarify the
+intent of code that deliberately suppresses exceptions from a single
+statement.  (Contributed by Raymond Hettinger in :issue:`15806` and
+Zero Piraeus in :issue:`19266`.)
+
+The new :func:`contextlib.redirect_stdout` context manager makes it easier
+for utility scripts to handle inflexible APIs that write their output to
+:data:`sys.stdout` and don't provide any options to redirect it.  Using the
+context manager, the :data:`sys.stdout` output can be redirected to any
+other stream or, in conjunction with :class:`io.StringIO`, to a string.
+The latter can be especially useful, for example, to capture output
+from a function that was written to implement a command line interface.
+It is recommended only for utility scripts because it affects the
+global state of :data:`sys.stdout`.  (Contributed by Raymond Hettinger
+in :issue:`15805`.)
+
+The :mod:`contextlib` documentation has also been updated to include a
+:ref:`discussion <single-use-reusable-and-reentrant-cms>` of the
+differences between single use, reusable and reentrant context managers.
+
+
+dbm
+---
+
+:func:`dbm.open` objects now support the context management protocol.  When
+used in a :keyword:`with` statement, the ``close`` method of the database
+object will be called automatically at the end of the block.  (Contributed by
+Claudiu Popa and Nick Coghlan in :issue:`19282`.)
+
+
+dis
+---
+
+Functions :func:`~dis.show_code`, :func:`~dis.dis`, :func:`~dis.distb`, and
+:func:`~dis.disassemble` now accept a keyword-only *file* argument that
+controls where they write their output.
+
+The :mod:`dis` module is now built around an :class:`~dis.Instruction` class
+that provides object oriented access to the details of each individual bytecode
+operation.
+
+A new method, :func:`~dis.get_instructions`, provides an iterator that emits
+the Instruction stream for a given piece of Python code.  Thus it is now
+possible to write a program that inspects and manipulates a bytecode
+object in ways different from those provided by the :mod:`~dis` module
+itself.  For example::
+
+    >>> import dis
+    >>> for instr in dis.get_instructions(lambda x: x + 1):
+    ...     print(instr.opname)
+    LOAD_FAST
+    LOAD_CONST
+    BINARY_ADD
+    RETURN_VALUE
+
+The various display tools in the :mod:`dis` module have been rewritten to use
+these new components.
+
+In addition, a new application-friendly class :class:`~dis.Bytecode` provides
+an object-oriented API for inspecting bytecode in both in human-readable form
+and for iterating over instructions.  The :class:`~dis.Bytecode` constructor
+takes the same arguments that :func:`~dis.get_instruction` does (plus an
+optional *current_offset*), and the resulting object can be iterated to produce
+:class:`~dis.Instruction` objects.  But it also has a :mod:`~dis.Bytecode.dis`
+method, equivalent to calling :mod:`~dis.dis` on the constructor argument, but
+returned as a multi-line string::
+
+    >>> bytecode = dis.Bytecode(lambda x: x +1, current_offset=3)
+    >>> for instr in bytecode:
+    ...     print('{} ({})'.format(instr.opname, instr.opcode))
+    LOAD_FAST (124)
+    LOAD_CONST (100)
+    BINARY_ADD (23)
+    RETURN_VALUE (83)
+    >>> bytecode.dis().splitlines()       # doctest: +NORMALIZE_WHITESPACE
+    ['  1           0 LOAD_FAST                0 (x)',
+     '      -->     3 LOAD_CONST               1 (1)',
+     '              6 BINARY_ADD',
+     '              7 RETURN_VALUE']
+
+:class:`~dis.Bytecode` also has a class method,
+:meth:`~dis.Bytecode.from_traceback`, that provides the ability to manipulate a
+traceback (that is, ``print(Bytecode.from_traceback(tb).dis())`` is equivalent
+to ``distb(tb)``).
+
+(Contributed by Nick Coghlan, Ryan Kelly and Thomas Kluyver in :issue:`11816`
+and Claudiu Popa in :issue:`17916`.)
+
+New function :func:`~dis.stack_effect` computes the effect on the Python stack
+of a given opcode and argument, information that is not otherwise available.
+(Contributed by Larry Hastings in :issue:`19722`.)
+
+
+doctest
+-------
+
+A new :ref:`option flag <doctest-options>`, :data:`~doctest.FAIL_FAST`, halts
+test running as soon as the first failure is detected.  (Contributed by R.
+David Murray and Daniel Urban in :issue:`16522`.)
+
+The :mod:`doctest` command line interface now uses :mod:`argparse`, and has two
+new options, ``-o`` and ``-f``.  ``-o`` allows :ref:`doctest options
+<doctest-options>` to be specified on the command line, and ``-f`` is a
+shorthand for ``-o FAIL_FAST`` (to parallel the similar option supported by the
+:mod:`unittest` CLI).  (Contributed by R. David Murray in :issue:`11390`.)
+
+:mod:`doctest` will now find doctests in extension module ``__doc__`` strings.
+(Contributed by Zachary Ware in :issue:`3158`.)
+
+
+email
+-----
+
+:meth:`~email.message.Message.as_string` now accepts a *policy* argument to
+override the default policy of the message when generating a string
+representation of it.  This means that ``as_string`` can now be used in more
+circumstances, instead of having to create and use a :mod:`~email.generator` in
+order to pass formatting parameters to its ``flatten`` method.  (Contributed by
+R. David Murray in :issue:`18600`.)
+
+New method :meth:`~email.message.Message.as_bytes` added to produce a bytes
+representation of the message in a fashion similar to how ``as_string``
+produces a string representation.  It does not accept the *maxheaderlen*
+argument, but does accept the *unixfrom* and *policy* arguments. The
+:class:`~email.message.Message` :meth:`~email.message.Message.__bytes__` method
+calls it, meaning that ``bytes(mymsg)`` will now produce the intuitive
+result:  a bytes object containing the fully formatted message.  (Contributed
+by R. David Murray in :issue:`18600`.)
+
+The :meth:`.Message.set_param` message now accepts a *replace* keyword argument.
+When specified, the associated header will be updated without changing
+its location in the list of headers.  For backward compatibility, the default
+is ``False``.  (Contributed by R. David Murray in :issue:`18891`.)
+
+
+.. _whatsnew_email_contentmanager:
+
+A pair of new subclasses of :class:`~email.message.Message` have been added
+(:class:`.EmailMessage` and :class:`.MIMEPart`), along with a new sub-module,
+:mod:`~email.contentmanager` and a new :mod:`~email.policy` attribute
+:attr:`~email.policy.EmailPolicy.content_manager`.  All documentation is
+currently in the new module, which is being added as part of email's new
+:term:`provisional API`.  These classes provide a number of new methods that
+make extracting content from and inserting content into email messages much
+easier.  For details, see the :mod:`~email.contentmanager` documentation and
+the :ref:`email-contentmanager-api-examples`.  These API additions complete the
+bulk of the work that was planned as part of the email6 project.  The currently
+provisional API is scheduled to become final in Python 3.5 (possibly with a few
+minor additions in the area of error handling).  (Contributed by R. David
+Murray in :issue:`18891`.)
+
+
+filecmp
+-------
+
+A new :func:`~filecmp.clear_cache` function provides the ability to clear the
+:mod:`filecmp` comparison cache, which uses :func:`os.stat` information to
+determine if the file has changed since the last compare.  This can be used,
+for example, if the file might have been changed and re-checked in less time
+than the resolution of a particular filesystem's file modification time field.
+(Contributed by Mark Levitt in :issue:`18149`.)
+
+New module attribute :data:`~filecmp.DEFAULT_IGNORES` provides the list of
+directories that are used as the default value for the *ignore* parameter of
+the :func:`~filecmp.dircmp` function.  (Contributed by Eli Bendersky in
+:issue:`15442`.)
+
+
+functools
+---------
+
+The new :func:`~functools.partialmethod` descriptor brings partial argument
+application to descriptors, just as :func:`~functools.partial` provides
+for normal callables. The new descriptor also makes it easier to get
+arbitrary callables (including :func:`~functools.partial` instances)
+to behave like normal instance methods when included in a class definition.
+(Contributed by Alon Horev and Nick Coghlan in :issue:`4331`.)
+
+.. _whatsnew-singledispatch:
+
+The new :func:`~functools.singledispatch` decorator brings support for
+single-dispatch generic functions to the Python standard library. Where
+object oriented programming focuses on grouping multiple operations on a
+common set of data into a class, a generic function focuses on grouping
+multiple implementations of an operation that allows it to work with
+*different* kinds of data.
+
+.. seealso::
+
+   :pep:`443` -- Single-dispatch generic functions
+      PEP written and implemented by Łukasz Langa.
+
+:func:`~functools.total_ordering` now supports a return value of
+:const:`NotImplemented` from the underlying comparison function.  (Contributed
+by Katie Miller in :issue:`10042`.)
+
+A pure-python version of the :func:`~functools.partial` function is now in the
+stdlib; in CPython it is overridden by the C accelerated version, but it is
+available for other implementations to use.  (Contributed by Brian Thorne in
+:issue:`12428`.)
+
+
+gc
+--
+
+New function :func:`~gc.get_stats` returns a list of three per-generation
+dictionaries containing the collections statistics since interpreter startup.
+(Contributed by Antoine Pitrou in :issue:`16351`.)
+
+
+glob
+----
+
+A new function :func:`~glob.escape` provides a way to escape special characters
+in a filename so that they do not become part of the globbing expansion but are
+instead matched literally.  (Contributed by Serhiy Storchaka in :issue:`8402`.)
+
+
+hashlib
+-------
+
+A new :func:`hashlib.pbkdf2_hmac` function provides
+the `PKCS#5 password-based key derivation function 2
+<http://en.wikipedia.org/wiki/PBKDF2>`_.  (Contributed by Christian
+Heimes in :issue:`18582`.)
+
+The :attr:`~hashlib.hash.name` attribute of :mod:`hashlib` hash objects is now
+a formally supported interface.  It has always existed in CPython's
+:mod:`hashlib` (although it did not return lower case names for all supported
+hashes), but it was not a public interface and so some other Python
+implementations have not previously supported it.  (Contributed by Jason R.
+Coombs in :issue:`18532`.)
+
+
+hmac
+----
+
+:mod:`hmac` now accepts ``bytearray`` as well as ``bytes`` for the *key*
+argument to the :func:`~hmac.new` function, and the *msg* parameter to both the
+:func:`~hmac.new` function and the :meth:`~hmac.HMAC.update` method now
+accepts any type supported by the :mod:`hashlib` module.  (Contributed
+by Jonas Borgström in :issue:`18240`.)
+
+The *digestmod* argument to the :func:`hmac.new` function may now be any hash
+digest name recognized by :mod:`hashlib`.  In addition, the current behavior in
+which the value of *digestmod* defaults to ``MD5`` is deprecated: in a
+future version of Python there will be no default value.  (Contributed by
+Christian Heimes in :issue:`17276`.)
+
+With the addition of :attr:`~hmac.HMAC.block_size` and :attr:`~hmac.HMAC.name`
+attributes (and the formal documentation of the :attr:`~hmac.HMAC.digest_size`
+attribute), the :mod:`hmac` module now conforms fully to the :pep:`247` API.
+(Contributed by Christian Heimes in :issue:`18775`.)
+
+
+html
+----
+
+New function :func:`~html.unescape` function converts HTML5 character references to
+the corresponding Unicode characters.  (Contributed by Ezio Melotti in
+:issue:`2927`.)
+
+:class:`~html.parser.HTMLParser` accepts a new keyword argument
+*convert_charrefs* that, when ``True``, automatically converts all character
+references.  For backward-compatibility, its value defaults to ``False``, but
+it will change to ``True`` in a future version of Python, so you are invited to
+set it explicitly and update your code to use this new feature.  (Contributed
+by Ezio Melotti in :issue:`13633`.)
+
+The *strict* argument of :class:`~html.parser.HTMLParser` is now deprecated.
+(Contributed by Ezio Melotti in :issue:`15114`.)
+
+
+http
+----
+
+:meth:`~http.server.BaseHTTPRequestHandler.send_error` now accepts an
+optional additional *explain* parameter which can be used to provide an
+extended error description, overriding the hardcoded default if there is one.
+This extended error description will be formatted using the
+:attr:`~http.server.HTTP.error_message_format` attribute and sent as the body
+of the error response.  (Contributed by Karl Cow in :issue:`12921`.)
+
+The :mod:`http.server` :ref:`command line interface <http-server-cli>` now has
+a ``-b/--bind`` option that causes the server to listen on a specific address.
+(Contributed by Malte Swart in :issue:`17764`.)
+
+
+importlib
+---------
+
+The :class:`~importlib.abc.InspectLoader` ABC defines a new method,
+:meth:`~importlib.abc.InspectLoader.source_to_code` that accepts source
+data and a path and returns a code object.  The default implementation
+is equivalent to ``compile(data, path, 'exec', dont_inherit=True)``.
+(Contributed by Eric Snow and Brett Cannon in :issue:`15627`.)
+
+:class:`~importlib.abc.InspectLoader` also now has a default implementation
+for the :meth:`~importlib.abc.InspectLoader.get_code` method.  However,
+it will normally be desirable to override the default implementation
+for performance reasons.  (Contributed by Brett Cannon in :issue:`18072`.)
+
+The :func:`~importlib.reload` function has been moved from :mod:`imp` to
+:mod:`importlib` as part of the :mod:`imp` module deprecation.  (Contributed by
+Berker Peksag in :issue:`18193`.)
+
+:mod:`importlib.util` now has a :data:`~importlib.util.MAGIC_NUMBER` attribute
+providing access to the bytecode version number.  This replaces the
+:func:`~imp.get_magic` function in the deprecated :mod:`imp` module.
+(Contributed by Brett Cannon in :issue:`18192`.)
+
+New :mod:`importlib.util` functions :func:`~importlib.util.cache_from_source`
+and :func:`~importlib.util.source_from_cache` replace the same-named functions
+in the deprecated :mod:`imp` module.  (Contributed by Brett Cannon in
+:issue:`18194`.)
+
+The :mod:`importlib` bootstrap :class:`.NamespaceLoader` now conforms to
+the :class:`.InspectLoader` ABC, which means that ``runpy`` and
+``python -m`` can now be used with namespace packages.  (Contributed
+by Brett Cannon in :issue:`18058`.)
+
+:mod:`importlib.util` has a new function :func:`~importlib.util.decode_source`
+that decodes source from bytes using universal newline processing.  This is
+useful for implementing :meth:`.InspectLoader.get_source` methods.
+
+:class:`importlib.machinery.ExtensionFileLoader` now has a
+:meth:`~importlib.machinery.ExtensionFileLoader.get_filename` method.  This was
+inadvertently omitted in the original implementation.  (Contributed by Eric
+Snow in :issue:`19152`.)
+
+
+inspect
+-------
+
+The :mod:`inspect` module now offers a basic :ref:`command line interface
+<inspect-module-cli>` to quickly display source code and other
+information for modules, classes and functions.  (Contributed by Claudiu Popa
+and Nick Coghlan in :issue:`18626`.)
+
+:func:`~inspect.unwrap` makes it easy to unravel wrapper function chains
+created by :func:`functools.wraps` (and any other API that sets the
+``__wrapped__`` attribute on a wrapper function).  (Contributed by
+Daniel Urban, Aaron Iles and Nick Coghlan in :issue:`13266`.)
+
+As part of the implementation of the new :mod:`enum` module, the
+:mod:`inspect` module now has substantially better support for custom
+``__dir__`` methods and dynamic class attributes provided through
+metaclasses.  (Contributed by Ethan Furman in :issue:`18929` and
+:issue:`19030`.)
+
+:func:`~inspect.getfullargspec` and :func:`~inspect.getargspec`
+now use the :func:`~inspect.signature` API. This allows them to
+support a much broader range of callables, including those with
+``__signature__`` attributes, those with metadata provided by argument
+clinic, :func:`functools.partial` objects and more. Note that, unlike
+:func:`~inspect.signature`, these functions still ignore ``__wrapped__``
+attributes, and report the already bound first argument for bound methods,
+so it is still necessary to update your code to use
+:func:`~inspect.signature` directly if those features are desired.
+(Contributed by Yury Selivanov in :issue:`17481`.)
+
+:func:`~inspect.signature` now supports duck types of CPython functions,
+which adds support for functions compiled with Cython.  (Contributed
+by Stefan Behnel and Yury Selivanov in :issue:`17159`.)
+
+
+ipaddress
+---------
+
+:mod:`ipaddress` was added to the standard library in Python 3.3 as a
+:term:`provisional API`. With the release of Python 3.4, this qualification
+has been removed: :mod:`ipaddress` is now considered a stable API, covered
+by the normal standard library requirements to maintain backwards
+compatibility.
+
+A new :attr:`~ipaddress.IPv4Address.is_global` property is ``True`` if
+an address is globally routeable.  (Contributed by Peter Moody in
+:issue:`17400`.)
+
+
+logging
+-------
+
+The :class:`~logging.handlers.TimedRotatingFileHandler` has a new *atTime*
+parameter that can be used to specify the time of day when rollover should
+happen.  (Contributed by Ronald Oussoren in :issue:`9556`.)
+
+:class:`~logging.handlers.SocketHandler` and
+:class:`~logging.handlers.DatagramHandler` now support Unix domain sockets (by
+setting *port* to ``None``).  (Contributed by Vinay Sajip in commit
+ce46195b56a9.)
+
+:func:`~logging.config.fileConfig` now accepts a
+:class:`configparser.RawConfigParser` subclass instance for the *fname*
+parameter.  This facilitates using a configuration file when logging
+configuration is just a part of the overall application configuration, or where
+the application modifies the configuration before passing it to
+:func:`~logging.config.fileConfig`.  (Contributed by Vinay Sajip in
+:issue:`16110`.)
+
+Logging configuration data received from a socket via the
+:func:`logging.config.listen` function can now be validated before being
+processed by supplying a verification function as the argument to the new
+*verify* keyword argument.  (Contributed by Vinay Sajip in :issue:`15452`.)
+
+
+.. _whatsnew-marshal-3:
+
+marshal
+-------
+
+The default :mod:`marshal` version has been bumped to 3.  The code implementing
+the new version restores the Python2 behavior of recording only one copy of
+interned strings and preserving the interning on deserialization, and extends
+this "one copy" ability to any object type (including handling recursive
+references).  This reduces both the size of ``.pyc`` files and the amount of
+memory a module occupies in memory when it is loaded from a ``.pyc`` (or
+``.pyo``) file.  (Contributed by Kristján Valur Jónsson in :issue:`16475`,
+with additional speedups by Antoine Pitrou in :issue:`19219`.)
+
+
+mmap
+----
+
+mmap objects can now be :mod:`weakref`\ ed.  (Contributed by Valerie Lambert in
+:issue:`4885`.)
+
+
+multiprocessing
+---------------
+
+.. _whatsnew-multiprocessing-no-fork:
+
+On Unix two new :ref:`start methods <multiprocessing-start-methods>`,
+(``spawn`` and ``forkserver``, have been added for starting processes using
+:mod:`multiprocessing`.  These make the mixing of processes with threads more
+robust, and the ``spawn`` method matches the semantics that multiprocessing has
+always used on Windows.  New function
+:func:`~multiprocessing.get_all_start_methods` reports all start methods
+available on the platform, :func:`~multiprocessing.get_start_method` reports
+the current start method, and :func:`~multiprocessing.set_start_method` sets
+the start method.  (Contributed by Richard Oudkerk in :issue:`8713`.)
+
+:mod:`multiprocessing` also now has the concept of a ``context``, which
+determines how child processes are created.  New function
+:func:`~multiprocessing.get_context` returns a context that uses a specified
+start method.  It has the same API as the :mod:`multiprocessing` module itself,
+so you can use it to create :class:`~multiprocessing.pool.Pool`\ s and other
+objects that will operate within that context.  This allows a framework and an
+application or different parts of the same application to use multiprocessing
+without interfering with each other.  (Contributed by Richard Oudkerk in
+:issue:`18999`.)
+
+Except when using the old *fork* start method, child processes no longer
+inherit unneeded handles/file descriptors from their parents (part of
+:issue:`8713`).
+
+:mod:`multiprocessing` now relies on :mod:`runpy` (which implements the
+``-m`` switch) to initialise ``__main__`` appropriately in child processes
+when using the ``spawn`` or ``forkserver`` start methods. This resolves some
+edge cases where combining multiprocessing, the ``-m`` command line switch,
+and explicit relative imports could cause obscure failures in child
+processes.  (Contributed by Nick Coghlan in :issue:`19946`.)
+
+
+operator
+--------
+
+New function :func:`~operator.length_hint` provides an implementation of the
+specification for how the :meth:`~object.__length_hint__` special method should
+be used, as part of the :pep:`424` formal specification of this language
+feature.  (Contributed by Armin Ronacher in :issue:`16148`.)
+
+There is now a pure-python version of the :mod:`operator` module available for
+reference and for use by alternate implementations of Python.  (Contributed by
+Zachary Ware in :issue:`16694`.)
+
+
+os
+--
+
+There are new functions to get and set the :ref:`inheritable flag
+<fd_inheritance>` of a file descriptor (:func:`os.get_inheritable`,
+:func:`os.set_inheritable`) or a Windows handle
+(:func:`os.get_handle_inheritable`, :func:`os.set_handle_inheritable`).
+
+New function :func:`~os.cpu_count` reports the number of CPUs available on the
+platform on which Python is running (or ``None`` if the count can't be
+determined).  The :func:`multiprocessing.cpu_count` function is now implemented
+in terms of this function).  (Contributed by Trent Nelson, Yogesh Chaudhari,
+Victor Stinner, and Charles-François Natali in :issue:`17914`.)
+
+:func:`os.path.samestat` is now available on the Windows platform (and the
+:func:`os.path.samefile` implementation is now shared between Unix and
+Windows).  (Contributed by Brian Curtin in :issue:`11939`.)
+
+:func:`os.path.ismount` now recognizes volumes mounted below a drive
+root on Windows.  (Contributed by Tim Golden in :issue:`9035`.)
+
+:func:`os.open` supports two new flags on platforms that provide them,
+:data:`~os.O_PATH` (un-opened file descriptor), and :data:`~os.O_TMPFILE`
+(unnamed temporary file; as of 3.4.0 release available only on Linux systems
+with a kernel version of 3.11 or newer that have uapi headers).  (Contributed
+by Christian Heimes in :issue:`18673` and Benjamin Peterson, respectively.)
+
+
+pdb
+---
+
+:mod:`pdb` has been enhanced to handle generators, :keyword:`yield`, and
+``yield from`` in a more useful fashion.  This is especially helpful when
+debugging :mod:`asyncio` based programs.  (Contributed by Andrew Svetlov and
+Xavier de Gaye in :issue:`16596`.)
+
+The ``print`` command has been removed from :mod:`pdb`, restoring access to the
+Python :func:`print` function from the pdb command line.  Python2's ``pdb`` did
+not have a ``print`` command; instead, entering ``print`` executed the
+``print`` statement.  In Python3 ``print`` was mistakenly made an alias for the
+pdb :pdbcmd:`p` command.  ``p``, however, prints the ``repr`` of its argument,
+not the ``str`` like the Python2 ``print`` command did.  Worse, the Python3
+``pdb print`` command shadowed the Python3 ``print`` function, making it
+inaccessible at the ``pdb`` prompt.  (Contributed by Connor Osborn in
+:issue:`18764`.)
+
+
+.. _whatsnew-protocol-4:
+
+pickle
+------
+
+:mod:`pickle` now supports (but does not use by default) a new pickle protocol,
+protocol 4.  This new protocol addresses a number of issues that were present
+in previous protocols, such as the serialization of nested classes, very large
+strings and containers, and classes whose :meth:`__new__` method takes
+keyword-only arguments.  It also provides some efficiency improvements.
+
+.. seealso::
+
+   :pep:`3154` -- Pickle protocol 4
+      PEP written by Antoine Pitrou and implemented by Alexandre Vassalotti.
+
+
+plistlib
+--------
+
+:mod:`plistlib` now has an API that is similar to the standard pattern for
+stdlib serialization protocols, with new :func:`~plistlib.load`,
+:func:`~plistlib.dump`, :func:`~plistlib.loads`, and :func:`~plistlib.dumps`
+functions.  (The older API is now deprecated.)  In addition to the already
+supported XML plist format (:data:`~plistlib.FMT_XML`), it also now supports
+the binary plist format (:data:`~plistlib.FMT_BINARY`).  (Contributed by Ronald
+Oussoren and others in :issue:`14455`.)
+
+
+poplib
+------
+
+Two new methods have been added to :mod:`poplib`: :meth:`~poplib.POP3.capa`,
+which returns the list of capabilities advertised by the POP server, and
+:meth:`~poplib.POP3.stls`, which switches a clear-text POP3 session into an
+encrypted POP3 session if the POP server supports it.  (Contributed by Lorenzo
+Catucci in :issue:`4473`.)
+
+
+pprint
+------
+
+The :mod:`pprint` module's :class:`~pprint.PrettyPrinter` class and its
+:func:`~pprint.pformat`, and :func:`~pprint.pprint` functions have a new
+option, *compact*, that controls how the output is formatted.  Currently
+setting *compact* to ``True`` means that sequences will be printed with as many
+sequence elements as will fit within *width* on each (indented) line.
+(Contributed by Serhiy Storchaka in :issue:`19132`.)
+
+Long strings are now wrapped using Python's normal line continuation
+syntax.  (Contributed by Antoine Pitrou in :issue:`17150`.)
+
+
+pty
+---
+
+:func:`pty.spawn` now returns the status value from :func:`os.waitpid` on
+the child process, instead of ``None``.  (Contributed by Gregory P. Smith.)
+
+
+pydoc
+-----
+
+The :mod:`pydoc` module is now based directly on the :func:`inspect.signature`
+introspection API, allowing it to provide signature information for a wider
+variety of callable objects. This change also means that ``__wrapped__``
+attributes are now taken into account when displaying help information.
+(Contributed by Larry Hastings in :issue:`19674`.)
+
+The :mod:`pydoc` module no longer displays the ``self`` parameter for
+already bound methods. Instead, it aims to always display the exact current
+signature of the supplied callable.  (Contributed by Larry Hastings in
+:issue:`20710`.)
+
+In addition to the changes that have been made to :mod:`pydoc` directly,
+its handling of custom ``__dir__`` methods and various descriptor
+behaviours has also been improved substantially by the underlying changes in
+the :mod:`inspect` module.
+
+As the :func:`help` builtin is based on :mod:`pydoc`, the above changes also
+affect the behaviour of :func:`help`.
+
+
+re
+--
+
+New :func:`~re.fullmatch` function and :meth:`.regex.fullmatch` method anchor
+the pattern at both ends of the string to match.  This provides a way to be
+explicit about the goal of the match, which avoids a class of subtle bugs where
+``$`` characters get lost during code changes or the addition of alternatives
+to an existing regular expression.  (Contributed by Matthew Barnett in
+:issue:`16203`.)
+
+The repr of :ref:`regex objects <re-objects>` now includes the pattern
+and the flags; the repr of :ref:`match objects <match-objects>` now
+includes the start, end, and the part of the string that matched.  (Contributed
+by Hugo Lopes Tavares and Serhiy Storchaka in :issue:`13592` and
+:issue:`17087`.)
+
+
+resource
+--------
+
+New :func:`~resource.prlimit` function, available on Linux platforms with a
+kernel version of 2.6.36 or later and glibc of 2.13 or later, provides the
+ability to query or set the resource limits for processes other than the one
+making the call.  (Contributed by Christian Heimes in :issue:`16595`.)
+
+On Linux kernel version 2.6.36 or later, there are there are also some new
+Linux specific constants: :attr:`~resource.RLIMIT_MSGQUEUE`,
+:attr:`~resource.RLIMIT_NICE`, :attr:`~resource.RLIMIT_RTPRIO`,
+:attr:`~resource.RLIMIT_RTTIME`, and :attr:`~resource.RLIMIT_SIGPENDING`.
+(Contributed by Christian Heimes in :issue:`19324`.)
+
+On FreeBSD version 9 and later, there some new FreeBSD specific constants:
+:attr:`~resource.RLIMIT_SBSIZE`, :attr:`~resource.RLIMIT_SWAP`, and
+:attr:`~resource.RLIMIT_NPTS`.  (Contributed by Claudiu Popa in
+:issue:`19343`.)
+
+
+select
+------
+
+:class:`~select.epoll` objects now support the context management protocol.
+When used in a :keyword:`with` statement, the :meth:`~select.epoll.close`
+method will be called automatically at the end of the block.  (Contributed
+by Serhiy Storchaka in :issue:`16488`.)
+
+:class:`~select.devpoll` objects now have :meth:`~select.devpoll.fileno` and
+:meth:`~select.devpoll.close` methods, as well as a new attribute
+:attr:`~select.devpoll.closed`.  (Contributed by Victor Stinner in
+:issue:`18794`.)
+
+
+shelve
+------
+
+:class:`~shelve.Shelf` instances may now be used in :keyword:`with` statements,
+and will be automatically closed at the end of the :keyword:`with` block.
+(Contributed by Filip Gruszczyński in :issue:`13896`.)
+
+
+shutil
+------
+
+:func:`~shutil.copyfile` now raises a specific :exc:`~shutil.Error` subclass,
+:exc:`~shutil.SameFileError`, when the source and destination are the same
+file, which allows an application to take appropriate action on this specific
+error.  (Contributed by Atsuo Ishimoto and Hynek Schlawack in
+:issue:`1492704`.)
+
+
+smtpd
+-----
+
+The :class:`~smtpd.SMTPServer` and :class:`~smtpd.SMTPChannel` classes now
+accept a *map* keyword argument which, if specified, is passed in to
+:class:`asynchat.async_chat` as its *map* argument.  This allows an application
+to avoid affecting the global socket map.  (Contributed by Vinay Sajip in
+:issue:`11959`.)
+
+
+smtplib
+-------
+
+:exc:`~smtplib.SMTPException` is now a subclass of :exc:`OSError`, which allows
+both socket level errors and SMTP protocol level errors to be caught in one
+try/except statement by code that only cares whether or not an error occurred.
+(Contributed by Ned Jackson Lovely in :issue:`2118`.)
+
+
+socket
+------
+
+The socket module now supports the :data:`~socket.CAN_BCM` protocol on
+platforms that support it.  (Contributed by Brian Thorne in :issue:`15359`.)
+
+Socket objects have new methods to get or set their :ref:`inheritable flag
+<fd_inheritance>`, :meth:`~socket.socket.get_inheritable` and
+:meth:`~socket.socket.set_inheritable`.
+
+The ``socket.AF_*`` and ``socket.SOCK_*`` constants are now enumeration values
+using the new :mod:`enum` module.  This allows meaningful names to be printed
+during debugging, instead of integer "magic numbers".
+
+The :data:`~socket.AF_LINK` constant is now available on BSD and OSX.
+
+:func:`~socket.inet_pton` and :func:`~socket.inet_ntop` are now supported
+on Windows.  (Contributed by Atsuo Ishimoto in :issue:`7171`.)
+
+
+sqlite3
+-------
+
+A new boolean parameter to the :func:`~sqlite3.connect` function, *uri*, can be
+used to indicate that the *database* parameter is a ``uri`` (see the `SQLite
+URI documentation <http://www.sqlite.org/uri.html>`_).  (Contributed by poq in
+:issue:`13773`.)
+
+
+ssl
+---
+
+.. _whatsnew-tls-11-12:
+
+:data:`~ssl.PROTOCOL_TLSv1_1` and :data:`~ssl.PROTOCOL_TLSv1_2` (TLSv1.1 and
+TLSv1.2 support) have been added; support for these protocols is only available if
+Python is linked with OpenSSL 1.0.1 or later.  (Contributed by Michele Orrù and
+Antoine Pitrou in :issue:`16692`.)
+
+.. _whatsnew34-sslcontext:
+
+New function :func:`~ssl.create_default_context` provides a standard way to
+obtain an :class:`~ssl.SSLContext` whose settings are intended to be a
+reasonable balance between compatibility and security.  These settings are
+more stringent than the defaults provided by the :class:`~ssl.SSLContext`
+constructor, and may be adjusted in the future, without prior deprecation, if
+best-practice security requirements change.  The new recommended best
+practice for using stdlib libraries that support SSL is to use
+:func:`~ssl.create_default_context` to obtain an :class:`~ssl.SSLContext`
+object, modify it if needed, and then pass it as the *context* argument
+of the appropriate stdlib API.  (Contributed by Christian Heimes
+in :issue:`19689`.)
+
+:class:`~ssl.SSLContext` method :meth:`~ssl.SSLContext.load_verify_locations`
+accepts a new optional argument *cadata*, which can be used to provide PEM or
+DER encoded certificates directly via strings or bytes, respectively.
+(Contributed by Christian Heimes in :issue:`18138`.)
+
+New function :func:`~ssl.get_default_verify_paths` returns
+a named tuple of the paths and environment variables that the
+:meth:`~ssl.SSLContext.set_default_verify_paths` method uses to set
+OpenSSL's default ``cafile`` and ``capath``.  This can be an aid in
+debugging default verification issues.  (Contributed by Christian Heimes
+in :issue:`18143`.)
+
+:class:`~ssl.SSLContext` has a new method,
+:meth:`~ssl.SSLContext.cert_store_stats`, that reports the number of loaded
+``X.509`` certs, ``X.509 CA`` certs, and certificate revocation lists (``crl``\
+s), as well as a :meth:`~ssl.SSLContext.get_ca_certs` method that returns a
+list of the loaded ``CA`` certificates.  (Contributed by Christian Heimes in
+:issue:`18147`.)
+
+If OpenSSL 0.9.8 or later is available, :class:`~ssl.SSLContext` has an new
+attribute :attr:`~ssl.SSLContext.verify_flags` that can be used to control the
+certificate verification process by setting it to some combination of the new
+constants :data:`~ssl.VERIFY_DEFAULT`, :data:`~ssl.VERIFY_CRL_CHECK_LEAF`,
+:data:`~ssl.VERIFY_CRL_CHECK_CHAIN`, or :data:`~ssl.VERIFY_X509_STRICT`.
+OpenSSL does not do any CRL verification by default.  (Contributed by
+Christien Heimes in :issue:`8813`.)
+
+New :class:`~ssl.SSLContext` method :meth:`~ssl.SSLContext.load_default_certs`
+loads a set of default "certificate authority" (CA) certificates from default
+locations, which vary according to the platform.  It can be used to load both
+TLS web server authentication certificates
+(``purpose=``:data:`~ssl.Purpose.SERVER_AUTH`) for a client to use to verify a
+server, and certificates for a server to use in verifying client certificates
+(``purpose=``:data:`~ssl.Purpose.CLIENT_AUTH`).  (Contributed by Christian
+Heimes in :issue:`19292`.)
+
+.. _whatsnew34-win-cert-store:
+
+Two new windows-only functions, :func:`~ssl.enum_certificates` and
+:func:`~ssl.enum_crls` provide the ability to retrieve certificates,
+certificate information, and CRLs from the Windows cert store.  (Contributed
+by Christian Heimes in :issue:`17134`.)
+
+.. _whatsnew34-sni:
+
+Support for server-side SNI (Server Name Indication) using the new
+:meth:`ssl.SSLContext.set_servername_callback` method.
+(Contributed by Daniel Black in :issue:`8109`.)
+
+The dictionary returned by :meth:`.SSLSocket.getpeercert` contains additional
+``X509v3`` extension items: ``crlDistributionPoints``, ``calIssuers``, and
+``OCSP`` URIs.  (Contributed by Christian Heimes in :issue:`18379`.)
+
+
+stat
+----
+
+The :mod:`stat` module is now backed by a C implementation in :mod:`_stat`. A C
+implementation is required as most of the values aren't standardized and
+are platform-dependent.  (Contributed by Christian Heimes in :issue:`11016`.)
+
+The module supports new :mod:`~stat.ST_MODE` flags, :mod:`~stat.S_IFDOOR`,
+:attr:`~stat.S_IFPORT`, and :attr:`~stat.S_IFWHT`.  (Contributed by
+Christian Hiemes in :issue:`11016`.)
+
+
+struct
+------
+
+New function :mod:`~struct.iter_unpack` and a new
+:meth:`struct.Struct.iter_unpack` method on compiled formats provide streamed
+unpacking of a buffer containing repeated instances of a given format of data.
+(Contributed by Antoine Pitrou in :issue:`17804`.)
+
+
+subprocess
+----------
+
+:func:`~subprocess.check_output` now accepts an *input* argument that can
+be used to provide the contents of ``stdin`` for the command that is run.
+(Contributed by Zack Weinberg in :issue:`16624`.)
+
+:func:`~subprocess.getstatus` and :func:`~subprocess.getstatusoutput` now
+work on Windows.  This change was actually inadvertently made in 3.3.4.
+(Contributed by Tim Golden in :issue:`10197`.)
+
+
+sunau
+-----
+
+The :meth:`~sunau.getparams` method now returns a namedtuple rather than a
+plain tuple.  (Contributed by Claudiu Popa in :issue:`18901`.)
+
+:meth:`sunau.open` now supports the context management protocol: when used in a
+:keyword:`with` block, the ``close`` method of the returned object will be
+called automatically at the end of the block.  (Contributed by Serhiy Storchaka
+in :issue:`18878`.)
+
+:meth:`.AU_write.setsampwidth` now supports 24 bit samples, thus adding
+support for writing 24 sample using the module.  (Contributed by
+Serhiy Storchaka in :issue:`19261`.)
+
+The :meth:`~sunau.AU_write.writeframesraw` and
+:meth:`~sunau.AU_write.writeframes` methods now accept any :term:`bytes-like
+object`.  (Contributed by Serhiy Storchaka in :issue:`8311`.)
+
+
+sys
+---
+
+New function :func:`sys.getallocatedblocks` returns the current number of
+blocks allocated by the interpreter.  (In CPython with the default
+``--with-pymalloc`` setting, this is allocations made through the
+:c:func:`PyObject_Malloc` API.)  This can be useful for tracking memory leaks,
+especially if automated via a test suite.  (Contributed by Antoine Pitrou
+in :issue:`13390`.)
+
+When the Python interpreter starts in :ref:`interactive mode
+<tut-interactive>`, it checks for an :data:`~sys.__interactivehook__` attribute
+on the :mod:`sys` module.  If the attribute exists, its value is called with no
+arguments just before interactive mode is started.  The check is made after the
+:envvar:`PYTHONSTARTUP` file is read, so it can be set there.  The :mod:`site`
+module :ref:`sets it <rlcompleter-config>` to a function that enables tab
+completion and history saving (in :file:`~/.python-history`) if the platform
+supports :mod:`readline`.  If you do not want this (new) behavior, you can
+override it in :envvar:`PYTHONSTARTUP`, :mod:`sitecustomize`, or
+:mod:`usercustomize` by deleting this attribute from :mod:`sys` (or setting it
+to some other callable).  (Contributed by Éric Araujo and Antoine Pitrou in
+:issue:`5845`.)
+
+
+tarfile
+-------
+
+The :mod:`tarfile` module now supports a simple :ref:`tarfile-commandline` when
+called as a script directly or via ``-m``.  This can be used to create and
+extract tarfile archives.  (Contributed by Berker Peksag in :issue:`13477`.)
+
+
+textwrap
+--------
+
+The :class:`~textwrap.TextWrapper` class has two new attributes/constructor
+arguments: :attr:`~textwrap.TextWrapper.max_lines`, which limits the number of
+lines in the output, and :attr:`~textwrap.TextWrapper.placeholder`, which is a
+string that will appear at the end of the output if it has been truncated
+because of *max_lines*.  Building on these capabilities, a new convenience
+function :func:`~textwrap.shorten` collapses all of the whitespace in the input
+to single spaces and produces a single line of a given *width* that ends with
+the *placeholder* (by default, ``[...]``).  (Contributed by Antoine Pitrou and
+Serhiy Storchaka in :issue:`18585` and :issue:`18725`.)
+
+
+threading
+---------
+
+The :class:`~threading.Thread` object representing the main thread can be
+obtained from the new :func:`~threading.main_thread` function.  In normal
+conditions this will be the thread from which the Python interpreter was
+started.  (Contributed by Andrew Svetlov in :issue:`18882`.)
+
+
+traceback
+---------
+
+A new :func:`traceback.clear_frames` function takes a traceback object
+and clears the local variables in all of the frames it references,
+reducing the amount of memory consumed.  (Contributed by Andrew Kuchling in
+:issue:`1565525`.)
+
+
+types
+-----
+
+A new :func:`~types.DynamicClassAttribute` descriptor provides a way to define
+an attribute that acts normally when looked up through an instance object, but
+which is routed to the *class* ``__getattr__`` when looked up through the
+class.  This allows one to have properties active on a class, and have virtual
+attributes on the class with the same name (see :mod:`Enum` for an example).
+(Contributed by Ethan Furman in :issue:`19030`.)
+
+
+urllib
+------
+
+:mod:`urllib.request` now supports ``data:`` URLs via the
+:class:`~urllib.request.DataHandler` class.  (Contributed by Mathias Panzenböck
+in :issue:`16423`.)
+
+The http method that will be used by a :class:`~urllib.request.Request` class
+can now be specified by setting a :class:`~urllib.request.Request.method`
+class attribute on the subclass.  (Contributed by Jason R Coombs in
+:issue:`18978`.)
+
+:class:`~urllib.request.Request` objects are now reusable: if the
+:attr:`~urllib.request.Request.full_url` or :attr:`~urllib.request.Request.data`
+attributes are modified, all relevant internal properties are updated.  This
+means, for example, that it is now possible to use the same
+:class:`~urllib.request.Request` object in more than one
+:meth:`.OpenerDirector.open` call with different *data* arguments, or to
+modify a :class:`~urllib.request.Request`\ 's ``url`` rather than recomputing it
+from scratch.  There is also a new
+:meth:`~urllib.request.Request.remove_header` method that can be used to remove
+headers from a :class:`~urllib.request.Request`.  (Contributed by Alexey
+Kachayev in :issue:`16464`, Daniel Wozniak in :issue:`17485`, and Damien Brecht
+and Senthil Kumaran in :issue:`17272`.)
+
+:class:`~urllib.error.HTTPError` objects now have a
+:attr:`~urllib.error.HTTPError.headers` attribute that provides access to the
+HTTP response headers associated with the error.  (Contributed by
+Berker Peksag in :issue:`15701`.)
+
+
+unittest
+--------
+
+The :class:`~unittest.TestCase` class has a new method,
+:meth:`~unittest.TestCase.subTest`, that produces a context manager whose
+:keyword:`with` block becomes a "sub-test".  This context manager allows a test
+method to dynamically generate subtests  by, say, calling the ``subTest``
+context manager inside a loop.  A single test method can thereby produce an
+indefinite number of separately-identified and separately-counted tests, all of
+which will run even if one or more of them fail.  For example::
+
+    class NumbersTest(unittest.TestCase):
+        def test_even(self):
+            for i in range(6):
+                with self.subTest(i=i):
+                    self.assertEqual(i % 2, 0)
+
+will result in six subtests, each identified in the unittest verbose output
+with a label consisting of the variable name ``i`` and a particular value for
+that variable (``i=0``, ``i=1``, etc).  See :ref:`subtests` for the full
+version of this example.  (Contributed by Antoine Pitrou in :issue:`16997`.)
+
+:func:`unittest.main` now accepts an iterable of test names for
+*defaultTest*, where previously it only accepted a single test name as a
+string.  (Contributed by Jyrki Pulliainen in :issue:`15132`.)
+
+If :class:`~unittest.SkipTest` is raised during test discovery (that is, at the
+module level in the test file), it is now reported as a skip instead of an
+error.  (Contributed by Zach Ware in :issue:`16935`.)
+
+:meth:`~unittest.TestLoader.discover` now sorts the discovered files to provide
+consistent test ordering.  (Contributed by Martin Melin and Jeff Ramnani in
+:issue:`16709`.)
+
+:class:`~unittest.TestSuite` now drops references to tests as soon as the test
+has been run, if the test is successful.  On Python interpreters that do
+garbage collection, this allows the tests to be garbage collected if nothing
+else is holding a reference to the test.  It is possible to override this
+behavior by creating a :class:`~unittest.TestSuite` subclass that defines a
+custom ``_removeTestAtIndex`` method.  (Contributed by Tom Wardill, Matt
+McClure, and Andrew Svetlov in :issue:`11798`.)
+
+A new test assertion context-manager, :meth:`~unittest.TestCase.assertLogs`,
+will ensure that a given block of code emits a log message using the
+:mod:`logging` module.  By default the message can come from any logger and
+have a priority of ``INFO`` or higher, but both the logger name and an
+alternative minimum logging level may be specified.  The object returned by the
+context manager can be queried for the :class:`~logging.LogRecord`\ s and/or
+formatted messages that were logged.  (Contributed by Antoine Pitrou in
+:issue:`18937`.)
+
+Test discovery now works with namespace packages (Contributed by Claudiu Popa
+in :issue:`17457`.)
+
+:mod:`unittest.mock` objects now inspect their specification signatures when
+matching calls, which means an argument can now be matched by either position
+or name, instead of only by position.  (Contributed by Antoine Pitrou in
+:issue:`17015`.)
+
+:func:`~mock.mock_open` objects now have ``readline`` and ``readlines``
+methods.  (Contributed by Toshio Kuratomi in :issue:`17467`.)
+
+
+venv
+----
+
+:mod:`venv` now includes activation scripts for the ``csh`` and ``fish``
+shells.  (Contributed by Andrew Svetlov in :issue:`15417`.)
+
+:class:`~venv.EnvBuilder` and the :func:`~venv.create` convenience function
+take a new keyword argument *with_pip*, which defaults to ``False``, that
+controls whether or not :class:`~venv.EnvBuilder` ensures that ``pip`` is
+installed in the virtual environment.  (Contributed by Nick Coghlan in
+:issue:`19552` as part of the :pep:`453` implementation.)
+
+
+wave
+----
+
+The :meth:`~wave.getparams` method now returns a namedtuple rather than a
+plain tuple.  (Contributed by Claudiu Popa in :issue:`17487`.)
+
+:meth:`wave.open` now supports the context management protocol.  (Contributed
+by Claudiu Popa in :issue:`17616`.)
+
+:mod:`wave` can now :ref:`write output to unseekable files
+<wave-write-objects>`.  (Contributed by David Jones, Guilherme Polo, and Serhiy
+Storchaka in :issue:`5202`.)
+
+The :meth:`~wave.Wave_write.writeframesraw` and
+:meth:`~wave.Wave_write.writeframes` methods now accept any :term:`bytes-like
+object`.  (Contributed by Serhiy Storchaka in :issue:`8311`.)
+
+
+weakref
+-------
+
+New :class:`~weakref.WeakMethod` class simulates weak references to bound
+methods.  (Contributed by Antoine Pitrou in :issue:`14631`.)
+
+New :class:`~weakref.finalize` class makes it possible to register a callback
+to be invoked when an object is garbage collected, without needing to
+carefully manage the lifecycle of the weak reference itself.  (Contributed by
+Richard Oudkerk in :issue:`15528`.)
+
+The callback, if any, associated with a :class:`~weakref.ref` is now
+exposed via the :attr:`~weakref.ref.__callback__` attribute.  (Contributed
+by Mark Dickinson in :issue:`17643`.)
+
+
+xml.etree
+---------
+
+A new parser, :class:`~xml.etree.ElementTree.XMLPullParser`, allows a
+non-blocking applications to parse XML documents.  An example can be
+seen at :ref:`elementtree-pull-parsing`.  (Contributed by Antoine
+Pitrou in :issue:`17741`.)
+
+The :mod:`xml.etree.ElementTree` :func:`~xml.etree.ElementTree.tostring` and
+:func:`~xml.etree.ElementTree.tostringlist` functions, and the
+:class:`~xml.etree.ElementTree.ElementTree`
+:meth:`~xml.etree.ElementTree.ElementTree.write` method, now have a
+*short_empty_elements* :ref:`keyword-only parameter <keyword-only_parameter>`
+providing control over whether elements with no content are written in
+abbreviated (``<tag />``) or expanded (``<tag></tag>``) form.  (Contributed by
+Ariel Poliak and Serhiy Storchaka in :issue:`14377`.)
+
+
+zipfile
+-------
+
+The :meth:`~zipfile.PyZipFile.writepy` method of the
+:class:`~zipfile.PyZipFile` class has a new *filterfunc* option that can be
+used to control which directories and files are added to the archive.  For
+example, this could be used to exclude test files from the archive.
+(Contributed by Christian Tismer in :issue:`19274`.)
+
+The *allowZip64* parameter to :class:`~zipfile.ZipFile` and
+:class:`~zipfile.PyZipfile` is now ``True`` by default.  (Contributed by
+William Mallard in :issue:`17201`.)
+
+
+
+CPython Implementation Changes
+==============================
+
+
+.. _whatsnew-pep-445:
+
+PEP 445: Customization of CPython Memory Allocators
+---------------------------------------------------
+
+:pep:`445` adds new C level interfaces to customize memory allocation in
+the CPython interpreter.
+
+.. seealso::
+
+   :pep:`445` -- Add new APIs to customize Python memory allocators
+      PEP written and implemented by Victor Stinner.
+
+
+.. _whatsnew-pep-442:
+
+PEP 442: Safe Object Finalization
+---------------------------------
+
+:pep:`442` removes the current limitations and quirks of object finalization
+in CPython. With it, objects with :meth:`__del__` methods, as well as
+generators with :keyword:`finally` clauses, can be finalized when they are
+part of a reference cycle.
+
+As part of this change, module globals are no longer forcibly set to
+:const:`None` during interpreter shutdown in most cases, instead relying
+on the normal operation of the cyclic garbage collector.  This avoids a
+whole class of interpreter-shutdown-time errors, usually involving
+``__del__`` methods, that have plagued Python since the cyclic GC
+was first introduced.
+
+.. seealso::
+
+   :pep:`442` -- Safe object finalization
+      PEP written and implemented by Antoine Pitrou.
+
+
+.. _whatsnew-pep-456:
+
+PEP 456: Secure and Interchangeable Hash Algorithm
+--------------------------------------------------
+
+:pep:`456` follows up on earlier security fix work done on Python's hash
+algorithm to address certain DOS attacks to which public facing APIs backed by
+dictionary lookups may be subject.  (See :issue:`14621` for the start of the
+current round of improvements.)  The PEP unifies CPython's hash code to make it
+easier for a packager to substitute a different hash algorithm, and switches
+Python's default implementation to a SipHash implementation on platforms that
+have a 64 bit data type.  Any performance differences in comparison with the
+older FNV algorithm are trivial.
+
+The PEP adds additional fields to the :attr:`sys.hash_info` struct sequence to
+describe the hash algorithm in use by the currently executing binary.  Otherwise,
+the PEP does not alter any existing CPython APIs.
+
+
+.. _whatsnew-pep-436:
+
+PEP 436: Argument Clinic
+------------------------
+
+"Argument Clinic" (:pep:`436`) is now part of the CPython build process
+and can be used to simplify the process of defining and maintaining
+accurate signatures for builtins and standard library extension modules
+implemented in C.
+
+Some standard library extension modules have been converted to use Argument
+Clinic in Python 3.4, and :mod:`pydoc` and :mod:`inspect` have been updated
+accordingly.
+
+It is expected that signature metadata for programmatic introspection will
+be added to additional callables implemented in C as part of Python 3.4
+maintenance releases.
+
+.. note::
+   The Argument Clinic PEP is not fully up to date with the state of the
+   implementation. This has been deemed acceptable by the release manager
+   and core development team in this case, as Argument Clinic will not
+   be made available as a public API for third party use in Python 3.4.
+
+.. seealso::
+
+   :pep:`436` -- The Argument Clinic DSL
+       PEP written and implemented by Larry Hastings.
+
+
+Other Build and C API Changes
+-----------------------------
+
+* The new :c:func:`PyType_GetSlot` function has been added to the stable ABI,
+  allowing retrieval of function pointers from named type slots when using
+  the limited API.  (Contributed by Martin von Löwis in :issue:`17162`.)
+
+* The new :c:func:`Py_SetStandardStreamEncoding` pre-initialization API
+  allows applications embedding the CPython interpreter to reliably force
+  a particular encoding and error handler for the standard streams.
+  (Contributed by Bastien Montagne and Nick Coghlan in :issue:`16129`.)
+
+* Most Python C APIs that don't mutate string arguments are now correctly
+  marked as accepting ``const char *`` rather than ``char *``.  (Contributed
+  by Serhiy Storchaka in :issue:`1772673`.)
+
+* A new shell version of ``python-config`` can be used even when a python
+  interpreter is not available (for example, in cross compilation scenarios).
+
+* :c:func:`PyUnicode_FromFormat` now supports width and precision
+  specifications for ``%s``, ``%A``, ``%U``, ``%V``, ``%S``, and ``%R``.
+  (Contributed by Ysj Ray and Victor Stinner in :issue:`7330`.)
+
+* New function :c:func:`PyStructSequence_InitType2` supplements the
+  existing :c:func:`PyStructSequence_InitType` function.  The difference
+  is that it returns ``0`` on success and ``-1`` on failure.
+
+* The CPython source can now be compiled using the address sanity checking
+  features of recent versions of GCC and clang:  the false alarms in the small
+  object allocator have been silenced.  (Contributed by Dhiru Kholia in
+  :issue:`18596`.)
+
+* The Windows build now uses `Address Space Layout Randomization
+  <http://en.wikipedia.org/wiki/ASLR>`_ and `Data Execution Prevention
+  <http://en.wikipedia.org/wiki/Data_Execution_Prevention>`_.  (Contributed by
+  Christian Heimes in :issue:`16632`.)
+
+* New function :c:func:`PyObject_LengthHint` is the C API equivalent
+  of :func:`operator.length_hint`.  (Contributed by Armin Ronacher in
+  :issue:`16148`.)
+
+
+.. _other-improvements-3.4:
+
+Other Improvements
+------------------
+
+.. _whatsnew-isolated-mode:
+
+* The :ref:`python <using-on-cmdline>` command has a new :ref:`option
+  <using-on-misc-options>`, ``-I``, which causes it to run in "isolated mode",
+  which means that :data:`sys.path` contains neither the script's directory nor
+  the user's ``site-packages`` directory, and all :envvar:`PYTHON*` environment
+  variables are ignored (it implies both ``-s`` and ``-E``).  Other
+  restrictions may also be applied in the future, with the goal being to
+  isolate the execution of a script from the user's environment.  This is
+  appropriate, for example, when Python is used to run a system script.  On
+  most POSIX systems it can and should be used in the ``#!`` line of system
+  scripts.  (Contributed by Christian Heimes in :issue:`16499`.)
+
+* Tab-completion is now enabled by default in the interactive interpreter
+  on systems that support :mod:`readline`.  History is also enabled by default,
+  and is written to (and read from) the file :file:`~/.python-history`.
+  (Contributed by Antoine Pitrou and Éric Araujo in :issue:`5845`.)
+
+* Invoking the Python interpreter with ``--version`` now outputs the version to
+  standard output instead of standard error (:issue:`18338`). Similar changes
+  were made to :mod:`argparse` (:issue:`18920`) and other modules that have
+  script-like invocation capabilities (:issue:`18922`).
+
+* The CPython Windows installer now adds ``.py`` to the :envvar:`PATHEXT`
+  variable when extensions are registered, allowing users to run a python
+  script at the windows command prompt by just typing its name without the
+  ``.py`` extension.  (Contributed by Paul Moore in :issue:`18569`.)
+
+* A new ``make`` target `coverage-report
+  <https://docs.python.org/devguide/coverage.html#measuring-coverage-of-c-code-with-gcov-and-lcov>`_
+  will build python, run the test suite, and generate an HTML coverage report
+  for the C codebase using ``gcov`` and `lcov
+  <http://ltp.sourceforge.net/coverage/lcov.php>`_.
+
+* The ``-R`` option to the :ref:`python regression test suite <regrtest>` now
+  also checks for memory allocation leaks, using
+  :func:`sys.getallocatedblocks()`.  (Contributed by Antoine Pitrou in
+  :issue:`13390`.)
+
+* ``python -m`` now works with namespace packages.
+
+* The :mod:`stat` module is now implemented in C, which means it gets the
+  values for its constants from the C header files, instead of having the
+  values hard-coded in the python module as was previously the case.
+
+* Loading multiple python modules from a single OS module (``.so``, ``.dll``)
+  now works correctly (previously it silently returned the first python
+  module in the file).  (Contributed by Václav Šmilauer in :issue:`16421`.)
+
+* A new opcode, :opcode:`LOAD_CLASSDEREF`, has been added to fix a bug in the
+  loading of free variables in class bodies that could be triggered by certain
+  uses of :ref:`__prepare__ <prepare>`.  (Contributed by Benjamin Peterson in
+  :issue:`17853`.)
+
+* A number of MemoryError-related crashes were identified and fixed by Victor
+  Stinner using his :pep:`445`-based ``pyfailmalloc`` tool (:issue:`18408`,
+  :issue:`18520`).
+
+* The :ref:`pyvenv <scripts-pyvenv>` command now accepts a ``--copies`` option
+  to use copies rather than symlinks even on systems where symlinks are the
+  default.  (Contributed by Vinay Sajip in :issue:`18807`.)
+
+* The :ref:`pyvenv <scripts-pyvenv>` command also accepts a ``--without-pip``
+  option to suppress the otherwise-automatic bootstrapping of pip into
+  the virtual environment.  (Contributed by Nick Coghlan in :issue:`19552`
+  as part of the :pep:`453` implementation.)
+
+* The encoding name is now optional in the value set for the
+  :envvar:`PYTHONIOENCODING` environment variable.  This makes it possible to
+  set just the error handler, without changing the default encoding.
+  (Contributed by Serhiy Storchaka in :issue:`18818`.)
+
+* The :mod:`bz2`, :mod:`lzma`, and :mod:`gzip` module ``open`` functions now
+  support ``x`` (exclusive creation) mode.  (Contributed by Tim Heaney and
+  Vajrasky Kok in :issue:`19201`, :issue:`19222`, and :issue:`19223`.)
+
+
+Significant Optimizations
+-------------------------
+
+* The UTF-32 decoder is now 3x to 4x faster.  (Contributed by Serhiy Storchaka
+  in :issue:`14625`.)
+
+* The cost of hash collisions for sets is now reduced.  Each hash table
+  probe now checks a series of consecutive, adjacent key/hash pairs before
+  continuing to make random probes through the hash table.  This exploits
+  cache locality to make collision resolution less expensive.
+  The collision resolution scheme can be described as a hybrid of linear
+  probing and open addressing.  The number of additional linear probes
+  defaults to nine.  This can be changed at compile-time by defining
+  LINEAR_PROBES to be any value.  Set LINEAR_PROBES=0 to turn-off
+  linear probing entirely.  (Contributed by Raymond Hettinger in
+  :issue:`18771`.)
+
+* The interpreter starts about 30% faster. A couple of measures lead to the
+  speedup. The interpreter loads fewer modules on startup, e.g. the :mod:`re`,
+  :mod:`collections` and :mod:`locale` modules and their dependencies are no
+  longer imported by default. The marshal module has been improved to load
+  compiled Python code faster.  (Contributed by Antoine Pitrou, Christian
+  Heimes and Victor Stinner in :issue:`19219`, :issue:`19218`, :issue:`19209`,
+  :issue:`19205` and :issue:`9548`.)
+
+* :class:`bz2.BZ2File` is now as fast or faster than the Python2 version for
+  most cases.  :class:`lzma.LZMAFile` has also been optimized.  (Contributed by
+  Serhiy Storchaka and Nadeem Vawda in :issue:`16034`.)
+
+* :func:`random.getrandbits` is 20%-40% faster for small integers (the most
+  common use case).  (Contributed by Serhiy Storchaka in :issue:`16674`.)
+
+* By taking advantage of the new storage format for strings, pickling of
+  strings is now significantly faster.  (Contributed by Victor Stinner and
+  Antoine Pitrou in :issue:`15596`.)
+
+* A performance issue in :meth:`io.FileIO.readall` has been solved.  This
+  particularly affects Windows, and significantly speeds up the case of piping
+  significant amounts of data through :mod:`subprocess`.  (Contributed
+  by Richard Oudkerk in :issue:`15758`.)
+
+* :func:`html.escape` is now 10x faster.  (Contributed by Matt Bryant in
+  :issue:`18020`.)
+
+* On Windows, the native ``VirtualAlloc`` is now used instead of the CRT
+  ``malloc`` in ``obmalloc``.  Artificial benchmarks show about a 3% memory
+  savings.
+
+* :func:`os.urandom` now uses a lazily-opened persistent file descriptor
+  so as to avoid using many file descriptors when run in parallel from
+  multiple threads.  (Contributed by Antoine Pitrou in :issue:`18756`.)
+
+
+.. _deprecated-3.4:
+
+Deprecated
+==========
+
+This section covers various APIs and other features that have been deprecated
+in Python 3.4, and will be removed in Python 3.5 or later.  In most (but not
+all) cases, using the deprecated APIs will produce a :exc:`DeprecationWarning`
+when the interpreter is run with deprecation warnings enabled (for example, by
+using ``-Wd``).
+
+
+Deprecations in the Python API
+------------------------------
+
+* As mentioned in :ref:`whatsnew-pep-451`, a number of :mod:`importilb`
+  methods and functions are deprecated: :meth:`importlib.find_loader` is
+  replaced by :func:`importlib.util.find_spec`;
+  :meth:`importlib.machinery.PathFinder.find_module` is replaced by
+  :meth:`importlib.machinery.PathFinder.find_spec`;
+  :meth:`importlib.abc.MetaPathFinder.find_module` is replaced by
+  :meth:`importlib.abc.MetaPathFinder.find_spec`;
+  :meth:`importlib.abc.PathEntryFinder.find_loader` and
+  :meth:`~importlib.abc.PathEntryFinder.find_module` are replaced by
+  :meth:`importlib.abc.PathEntryFinder.find_spec`; all of the ``xxxLoader`` ABC
+  ``load_module`` methods (:meth:`importlib.abc.Loader.load_module`,
+  :meth:`importlib.abc.InspectLoader.load_module`,
+  :meth:`importlib.abc.FileLoader.load_module`,
+  :meth:`importlib.abc.SourceLoader.load_module`) should no longer be
+  implemented, instead loaders should implement an
+  ``exec_module`` method
+  (:meth:`importlib.abc.Loader.exec_module`,
+  :meth:`importlib.abc.InspectLoader.exec_module`
+  :meth:`importlib.abc.SourceLoader.exec_module`) and let the import system
+  take care of the rest; and
+  :meth:`importlib.abc.Loader.module_repr`,
+  :meth:`importlib.util.module_for_loader`, :meth:`importlib.util.set_loader`,
+  and :meth:`importlib.util.set_package` are no longer needed because their
+  functions are now handled automatically by the import system.
+
+* The :mod:`imp` module is pending deprecation. To keep compatibility with
+  Python 2/3 code bases, the module's removal is currently not scheduled.
+
+* The :mod:`formatter` module is pending deprecation and is slated for removal
+  in Python 3.6.
+
+* ``MD5`` as the default *digestmod* for the :func:`hmac.new` function is
+  deprecated.  Python 3.6 will require an explicit digest name or constructor as
+  *digestmod* argument.
+
+* The internal ``Netrc`` class in the :mod:`ftplib` module has been documented
+  as deprecated in its docstring for quite some time.  It now emits a
+  :exc:`DeprecationWarning` and will be removed completely in Python 3.5.
+
+* The undocumented *endtime* argument to :meth:`subprocess.Popen.wait` should
+  not have been exposed and is hopefully not in use; it is deprecated and
+  will mostly likely be removed in Python 3.5.
+
+* The *strict* argument of :class:`~html.parser.HTMLParser` is deprecated.
+
+* The :mod:`plistlib` :func:`~plistlib.readPlist`,
+  :func:`~plistlib.writePlist`, :func:`~plistlib.readPlistFromBytes`, and
+  :func:`~plistlib.writePlistToBytes` functions are deprecated in favor of the
+  corresponding new functions :func:`~plistlib.load`, :func:`~plistlib.dump`,
+  :func:`~plistlib.loads`, and :func:`~plistlib.dumps`.  :func:`~plistlib.Data`
+  is deprecated in favor of just using the :class:`bytes` constructor.
+
+* The :mod:`sysconfig` key ``SO`` is deprecated, it has been replaced by
+  ``EXT_SUFFIX``.
+
+* The ``U`` mode accepted by various ``open`` functions is deprecated.
+  In Python3 it does not do anything useful, and should be replaced by
+  appropriate uses of :class:`io.TextIOWrapper` (if needed) and its *newline*
+  argument.
+
+* The *parser* argument of :func:`xml.etree.ElementTree.iterparse` has
+  been deprecated, as has the *html* argument of
+  :func:`~xml.etree.ElementTree.XMLParser`.  To prepare for the removal of the
+  latter, all arguments to ``XMLParser`` should be passed by keyword.
+
+
+Deprecated Features
+-------------------
+
+* Running :ref:`idle` with the ``-n`` flag (no subprocess) is deprecated.
+  However, the feature will not be removed until :issue:`18823` is resolved.
+
+* The site module adding a "site-python" directory to sys.path, if it
+  exists, is deprecated (:issue:`19375`).
+
+
+
+Removed
+=======
+
+
+Operating Systems No Longer Supported
+-------------------------------------
+
+Support for the following operating systems has been removed from the source
+and build tools:
+
+* OS/2 (:issue:`16135`).
+* Windows 2000 (changeset e52df05b496a).
+* Windows systems where ``COMSPEC`` points to ``command.com`` (:issue:`14470`).
+* VMS (:issue:`16136`).
+
+
+API and Feature Removals
+------------------------
+
+The following obsolete and previously deprecated APIs and features have been
+removed:
+
+* The unmaintained ``Misc/TextMate`` and ``Misc/vim`` directories have been
+  removed (see the `devguide <https://docs.python.org/devguide>`_
+  for suggestions on what to use instead).
+
+* The ``SO`` makefile macro is removed (it was replaced by the
+  ``SHLIB_SUFFIX`` and ``EXT_SUFFIX`` macros) (:issue:`16754`).
+
+* The ``PyThreadState.tick_counter`` field has been removed; its value has
+  been meaningless since Python 3.2, when the "new GIL" was introduced
+  (:issue:`19199`).
+
+* ``PyLoader`` and ``PyPycLoader`` have been removed from :mod:`importlib`.
+  (Contributed by Taras Lyapun in :issue:`15641`.)
+
+* The *strict* argument to :class:`~http.client.HTTPConnection` and
+  :class:`~http.client.HTTPSConnection` has been removed.  HTTP 0.9-style
+  "Simple Responses" are no longer supported.
+
+* The deprecated :mod:`urllib.request.Request` getter and setter methods
+  ``add_data``, ``has_data``, ``get_data``, ``get_type``, ``get_host``,
+  ``get_selector``, ``set_proxy``, ``get_origin_req_host``, and
+  ``is_unverifiable`` have been removed (use direct attribute access instead).
+
+* Support for loading the deprecated ``TYPE_INT64`` has been removed from
+  :mod:`marshal`.  (Contributed by Dan Riti in :issue:`15480`.)
+
+* :class:`inspect.Signature`: positional-only parameters are now required
+  to have a valid name.
+
+* :meth:`object.__format__` no longer accepts non-empty format strings, it now
+  raises a :exc:`TypeError` instead.  Using a non-empty string has been
+  deprecated since Python 3.2.  This change has been made to prevent a
+  situation where previously working (but incorrect) code would start failing
+  if an object gained a __format__ method, which means that your code may now
+  raise a :exc:`TypeError` if you are using an ``'s'`` format code with objects
+  that do not have a __format__ method that handles it.  See :issue:`7994` for
+  background.
+
+* :meth:`difflib.SequenceMatcher.isbjunk` and
+  :meth:`difflib.SequenceMatcher.isbpopular` were deprecated in 3.2, and have
+  now been removed: use ``x in sm.bjunk`` and
+  ``x in sm.bpopular``, where *sm* is a :class:`~difflib.SequenceMatcher` object
+  (:issue:`13248`).
+
+
+Code Cleanups
+-------------
+
+* The unused and undocumented internal ``Scanner`` class has been removed from
+  the :mod:`pydoc` module.
+
+* The private and effectively unused ``_gestalt`` module has been removed,
+  along with the private :mod:`platform` functions ``_mac_ver_lookup``,
+  ``_mac_ver_gstalt``, and ``_bcd2str``, which would only have ever been called
+  on badly broken OSX systems (see :issue:`18393`).
+
+* The hardcoded copies of certain :mod:`stat` constants that were included in
+  the :mod:`tarfile` module namespace have been removed.
+
+
+
+Porting to Python 3.4
+=====================
+
+This section lists previously described changes and other bugfixes
+that may require changes to your code.
+
+
+Changes in 'python' Command Behavior
+------------------------------------
+
+* In a posix shell, setting the :envvar:`PATH` environment variable to
+  an empty value is equivalent to not setting it at all.  However, setting
+  :envvar:`PYTHONPATH` to an empty value was *not* equivalent to not setting it
+  at all: setting :envvar:`PYTHONPATH` to an empty value was equivalent to
+  setting it to ``.``, which leads to confusion when reasoning by analogy to
+  how :envvar:`PATH` works.  The behavior now conforms to the posix convention
+  for :envvar:`PATH`.
+
+* The [X refs, Y blocks] output of a debug (``--with-pydebug``) build of the
+  CPython interpreter is now off by default.  It can be re-enabled using the
+  ``-X showrefcount`` option.  (Contributed by Ezio Melotti in :issue:`17323`.)
+
+* The python command and most stdlib scripts (as well as :mod:`argparse`) now
+  output ``--version`` information to ``stdout`` instead of ``stderr`` (for
+  issue list see :ref:`other-improvements-3.4` above).
+
+
+Changes in the Python API
+-------------------------
+
+* The ABCs defined in :mod:`importlib.abc` now either raise the appropriate
+  exception or return a default value instead of raising
+  :exc:`NotImplementedError` blindly. This will only affect code calling
+  :func:`super` and falling through all the way to the ABCs. For compatibility,
+  catch both :exc:`NotImplementedError` or the appropriate exception as needed.
+
+* The module type now initializes the :attr:`__package__` and :attr:`__loader__`
+  attributes to ``None`` by default. To determine if these attributes were set
+  in a backwards-compatible fashion, use e.g.
+  ``getattr(module, '__loader__', None) is not None``.  (:issue:`17115`.)
+
+* :meth:`importlib.util.module_for_loader` now sets ``__loader__`` and
+  ``__package__`` unconditionally to properly support reloading. If this is not
+  desired then you will need to set these attributes manually. You can use
+  :func:`importlib.util.module_to_load` for module management.
+
+* Import now resets relevant attributes (e.g. ``__name__``, ``__loader__``,
+  ``__package__``, ``__file__``, ``__cached__``) unconditionally when reloading.
+  Note that this restores a pre-3.3 behavior in that it means a module is
+  re-found when re-loaded (:issue:`19413`).
+
+* Frozen packages no longer set ``__path__`` to a list containing the package
+  name, they now set it to an empty list.  The previous behavior could cause
+  the import system to do the wrong thing on submodule imports if there was
+  also a directory with the same name as the frozen package.  The correct way
+  to determine if a module is a package or not is to use ``hasattr(module,
+  '__path__')`` (:issue:`18065`).
+
+* Frozen modules no longer define a ``__file__`` attribute. It's semantically
+  incorrect for frozen modules to set the attribute as they are not loaded from
+  any explicit location. If you must know that a module comes from frozen code
+  then you can see if the module's ``__spec__.location`` is set to ``'frozen'``,
+  check if the loader is a subclass of
+  :class:`importlib.machinery.FrozenImporter`,
+  or if Python 2 compatibility is necessary you can use :func:`imp.is_frozen`.
+
+* :func:`py_compile.compile` now raises :exc:`FileExistsError` if the file path
+  it would write to is a symlink or a non-regular file. This is to act as a
+  warning that import will overwrite those files with a regular file regardless
+  of what type of file path they were originally.
+
+* :meth:`importlib.abc.SourceLoader.get_source` no longer raises
+  :exc:`ImportError` when the source code being loaded triggers a
+  :exc:`SyntaxError` or :exc:`UnicodeDecodeError`. As :exc:`ImportError` is
+  meant to be raised only when source code cannot be found but it should, it was
+  felt to be over-reaching/overloading of that meaning when the source code is
+  found but improperly structured. If you were catching ImportError before and
+  wish to continue to ignore syntax or decoding issues, catch all three
+  exceptions now.
+
+* :func:`functools.update_wrapper` and :func:`functools.wraps` now correctly
+  set the ``__wrapped__`` attribute to the function being wrapped, even if
+  that function also had its ``__wrapped__`` attribute set. This means
+  ``__wrapped__`` attributes now correctly link a stack of decorated
+  functions rather than every ``__wrapped__`` attribute in the chain
+  referring to the innermost function. Introspection libraries that
+  assumed the previous behaviour was intentional can use
+  :func:`inspect.unwrap` to access the first function in the chain that has
+  no ``__wrapped__`` attribute.
+
+* :func:`inspect.getfullargspec` has been reimplemented on top of
+  :func:`inspect.signature` and hence handles a much wider variety of callable
+  objects than it did in the past. It is expected that additional builtin and
+  extension module callables will gain signature metadata over the course of
+  the Python 3.4 series. Code that assumes that
+  :func:`inspect.getfullargspec` will fail on non-Python callables may need
+  to be adjusted accordingly.
+
+* :class:`importlib.machinery.PathFinder` now passes on the current working
+  directory to objects in :data:`sys.path_hooks` for the empty string. This
+  results in :data:`sys.path_importer_cache` never containing ``''``, thus
+  iterating through :data:`sys.path_importer_cache` based on :data:`sys.path`
+  will not find all keys. A module's ``__file__`` when imported in the current
+  working directory will also now have an absolute path, including when using
+  ``-m`` with the interpreter (except for ``__main__.__file__`` when a script
+  has been executed directly using a relative path) (Contributed by Brett
+  Cannon in :issue:`18416`).  is specified on the command-line)
+  (:issue:`18416`).
+
+* The removal of the *strict* argument to :class:`~http.client.HTTPConnection`
+  and :class:`~http.client.HTTPSConnection` changes the meaning of the
+  remaining arguments if you are specifying them positionally rather than by
+  keyword.  If you've been paying attention to deprecation warnings your code
+  should already be specifying any additional arguments via keywords.
+
+* Strings between ``from __future__ import ...`` statements now *always* raise
+  a :exc:`SyntaxError`.  Previously if there was no leading docstring, an
+  interstitial string would sometimes be ignored.  This brings CPython into
+  compliance with the language spec; Jython and PyPy already were.
+  (:issue:`17434`).
+
+* :meth:`ssl.SSLSocket.getpeercert` and :meth:`ssl.SSLSocket.do_handshake`
+  now raise an :exc:`OSError` with ``ENOTCONN`` when the ``SSLSocket`` is not
+  connected, instead of the previous behavior of raising an
+  :exc:`AttributeError`.  In addition, :meth:`~ssl.SSLSocket.getpeercert`
+  will raise a :exc:`ValueError` if the handshake has not yet been done.
+
+* :func:`base64.b32decode` now raises a :exc:`binascii.Error` when the
+  input string contains non-b32-alphabet characters, instead of a
+  :exc:`TypeError`.  This particular :exc:`TypeError` was missed when the other
+  :exc:`TypeError`\ s were converted.  (Contributed by Serhiy Storchaka in
+  :issue:`18011`.)  Note: this change was also inadvertently applied in Python
+  3.3.3.
+
+* The :attr:`~cgi.FieldStorage.file` attribute is now automatically closed when
+  the creating :class:`cgi.FieldStorage` instance is garbage collected. If you
+  were pulling the file object out separately from the :class:`cgi.FieldStorage`
+  instance and not keeping the instance alive, then you should either store the
+  entire :class:`cgi.FieldStorage` instance or read the contents of the file
+  before the :class:`cgi.FieldStorage` instance is garbage collected.
+
+* Calling ``read`` or ``write`` on a closed SSL socket now raises an
+  informative :exc:`ValueError` rather than the previous more mysterious
+  :exc:`AttributeError` (:issue:`9177`).
+
+* :meth:`slice.indices` no longer produces an :exc:`OverflowError` for huge
+  values.  As a consequence of this fix, :meth:`slice.indices` now raises a
+  :exc:`ValueError` if given a negative length; previously it returned nonsense
+  values (:issue:`14794`).
+
+* The :class:`complex` constructor, unlike the :mod:`cmath` functions, was
+  incorrectly accepting :class:`float` values if an object's ``__complex__``
+  special method returned one.  This now raises a :exc:`TypeError`.
+  (:issue:`16290`.)
+
+* The :class:`int` constructor in 3.2 and 3.3 erroneously accepts :class:`float`
+  values for the *base* parameter.  It is unlikely anyone was doing this, but
+  if so, it will now raise a :exc:`TypeError` (:issue:`16772`).
+
+* Defaults for keyword-only arguments are now evaluated *after* defaults for
+  regular keyword arguments, instead of before.  Hopefully no one wrote any
+  code that depends on the previous buggy behavior (:issue:`16967`).
+
+* Stale thread states are now cleared after :func:`~os.fork`.  This may cause
+  some system resources to be released that previously were incorrectly kept
+  perpetually alive (for example, database connections kept in thread-local
+  storage).  (:issue:`17094`.)
+
+* Parameter names in ``__annotations__`` dicts are now mangled properly,
+  similarly to ``__kwdefaults__``.  (Contributed by Yury Selivanov in
+  :issue:`20625`.)
+
+* :attr:`hashlib.hash.name` now always returns the identifier in lower case.
+  Previously some builtin hashes had uppercase names, but now that it is a
+  formal public interface the naming has been made consistent (:issue:`18532`).
+
+* Because :mod:`unittest.TestSuite` now drops references to tests after they
+  are run, test harnesses that re-use a :class:`~unittest.TestSuite` to re-run
+  a set of tests may fail.   Test suites should not be re-used in this fashion
+  since it means state is retained between test runs, breaking the test
+  isolation that :mod:`unittest` is designed to provide.  However, if the lack
+  of isolation is considered acceptable, the old behavior can be restored by
+  creating a :mod:`~unittest.TestSuite` subclass that defines a
+  ``_removeTestAtIndex`` method that does nothing (see
+  :meth:`.TestSuite.__iter__`) (:issue:`11798`).
+
+* :mod:`unittest` now uses :mod:`argparse` for command line parsing.  There are
+  certain invalid command forms that used to work that are no longer allowed;
+  in theory this should not cause backward compatibility issues since the
+  disallowed command forms didn't make any sense and are unlikely to be in use.
+
+* The :func:`re.split`, :func:`re.findall`, and :func:`re.sub` functions, and
+  the :meth:`~re.match.group` and :meth:`~re.match.groups` methods of
+  ``match`` objects now always return a *bytes* object when the string
+  to be matched is a :term:`bytes-like object`.  Previously the return type
+  matched the input type, so if your code was depending on the return value
+  being, say, a ``bytearray``, you will need to change your code.
+
+* :mod:`audioop` functions now raise an error immediately if passed string
+  input, instead of failing randomly later on (:issue:`16685`).
+
+* The new *convert_charrefs* argument to :class:`~html.parser.HTMLParser`
+  currently defaults to ``False`` for backward compatibility, but will
+  eventually be changed to default to ``True``.  It is recommended that you add
+  this keyword, with the appropriate value, to any
+  :class:`~html.parser.HTMLParser` calls in your code (:issue:`13633`).
+
+* Since the *digestmod* argument to the :func:`hmac.new` function will in the
+  future have no default, all calls to :func:`hmac.new` should be changed to
+  explicitly specify a *digestmod* (:issue:`17276`).
+
+* Calling :func:`sysconfig.get_config_var` with the ``SO`` key, or looking
+  ``SO`` up in the results of a call to :func:`sysconfig.get_config_vars`
+  is deprecated.  This key should be replaced by ``EXT_SUFFIX`` or
+  ``SHLIB_SUFFIX``, depending on the context (:issue:`19555`).
+
+* Any calls to ``open`` functions that specify ``U`` should be modified.
+  ``U`` is ineffective in Python3 and will eventually raise an error if used.
+  Depending on the function, the equivalent of its old Python2 behavior can be
+  achieved using either a *newline* argument, or if necessary by wrapping the
+  stream in :mod:`~io.TextIOWrapper` to use its *newline* argument
+  (:issue:`15204`).
+
+* If you use :ref:`pyvenv <scripts-pyvenv>` in a script and desire that pip
+  *not* be installed, you must add ``--without-pip`` to your command
+  invocation.
+
+* The default behavior of :func:`json.dump` and :func:`json.dumps` when
+  an indent is specified has changed: it no longer produces trailing
+  spaces after the item separating commas at the ends of lines.  This
+  will matter only if you have tests that are doing white-space-sensitive
+  comparisons of such output (:issue:`16333`).
+
+* :mod:`doctest` now looks for doctests in extension module ``__doc__``
+  strings, so if your doctest test discovery includes extension modules that
+  have things that look like doctests in them you may see test failures you've
+  never seen before when running your tests (:issue:`3158`).
+
+* The :mod:`collections.abc` module has been slightly refactored as
+  part of the Python startup improvements.  As a consequence of this, it is no
+  longer the case that importing :mod:`collections` automatically imports
+  :mod:`collections.abc`.  If your program depended on the (undocumented)
+  implicit import, you will need to add an explicit ``import collections.abc``
+  (:issue:`20784`).
+
+
+Changes in the C API
+--------------------
+
+* :c:func:`PyEval_EvalFrameEx`, :c:func:`PyObject_Repr`, and
+  :c:func:`PyObject_Str`, along with some other internal C APIs, now include
+  a debugging assertion that ensures they are not used in situations where
+  they may silently discard a currently active exception. In cases where
+  discarding the active exception is expected and desired (for example,
+  because it has already been saved locally with :c:func:`PyErr_Fetch` or
+  is being deliberately replaced with a different exception), an explicit
+  :c:func:`PyErr_Clear` call will be needed to avoid triggering the
+  assertion when invoking these operations (directly or indirectly) and
+  running against a version of Python that is compiled with assertions
+  enabled.
+
+* :c:func:`PyErr_SetImportError` now sets :exc:`TypeError` when its **msg**
+  argument is not set. Previously only ``NULL`` was returned with no exception
+  set.
+
+* The result of the :c:data:`PyOS_ReadlineFunctionPointer` callback must
+  now be a string allocated by :c:func:`PyMem_RawMalloc` or
+  :c:func:`PyMem_RawRealloc`, or *NULL* if an error occurred, instead of a
+  string allocated by :c:func:`PyMem_Malloc` or :c:func:`PyMem_Realloc`
+  (:issue:`16742`)
+
+* :c:func:`PyThread_set_key_value` now always set the value. In Python
+  3.3, the function did nothing if the key already exists (if the current
+  value is a non-NULL pointer).
+
+* The ``f_tstate`` (thread state) field of the :c:type:`PyFrameObject`
+  structure has been removed to fix a bug: see :issue:`14432` for the
+  rationale.
+
+Changed in 3.4.3
+================
+
+.. _pep-476:
+
+PEP 476: Enabling certificate verification by default for stdlib http clients
+-----------------------------------------------------------------------------
+
+:mod:`http.client` and modules which use it, such as :mod:`urllib.request` and
+:mod:`xmlrpc.client`, will now verify that the server presents a certificate
+which is signed by a CA in the platform trust store and whose hostname matches
+the hostname being requested by default, significantly improving security for
+many applications.
+
+For applications which require the old previous behavior, they can pass an
+alternate context::
+
+    import urllib.request
+    import ssl
+
+    # This disables all verification
+    context = ssl._create_unverified_context()
+
+    # This allows using a specific certificate for the host, which doesn't need
+    # to be in the trust store
+    context = ssl.create_default_context(cafile="/path/to/file.crt")
+
+    urllib.request.urlopen("https://invalid-cert", context=context)
diff --git a/Doc/whatsnew/changelog.rst b/Doc/whatsnew/changelog.rst
index 57e2dab..07f9094 100644
--- a/Doc/whatsnew/changelog.rst
+++ b/Doc/whatsnew/changelog.rst
@@ -3,4 +3,3 @@
 +++++++++
 
 .. miscnews:: ../../Misc/NEWS
-
diff --git a/Doc/whatsnew/index.rst b/Doc/whatsnew/index.rst
index bc1206b..29902e4 100644
--- a/Doc/whatsnew/index.rst
+++ b/Doc/whatsnew/index.rst
@@ -11,6 +11,7 @@
 .. toctree::
    :maxdepth: 2
 
+   3.4.rst
    3.3.rst
    3.2.rst
    3.1.rst
diff --git a/Include/Python-ast.h b/Include/Python-ast.h
index 00e92d0..67d677b 100644
--- a/Include/Python-ast.h
+++ b/Include/Python-ast.h
@@ -182,8 +182,9 @@
                   SetComp_kind=9, DictComp_kind=10, GeneratorExp_kind=11,
                   Yield_kind=12, YieldFrom_kind=13, Compare_kind=14,
                   Call_kind=15, Num_kind=16, Str_kind=17, Bytes_kind=18,
-                  Ellipsis_kind=19, Attribute_kind=20, Subscript_kind=21,
-                  Starred_kind=22, Name_kind=23, List_kind=24, Tuple_kind=25};
+                  NameConstant_kind=19, Ellipsis_kind=20, Attribute_kind=21,
+                  Subscript_kind=22, Starred_kind=23, Name_kind=24,
+                  List_kind=25, Tuple_kind=26};
 struct _expr {
     enum _expr_kind kind;
     union {
@@ -279,6 +280,10 @@
         } Bytes;
         
         struct {
+            singleton value;
+        } NameConstant;
+        
+        struct {
             expr_ty value;
             identifier attr;
             expr_context_ty ctx;
@@ -359,18 +364,18 @@
 
 struct _arguments {
     asdl_seq *args;
-    identifier vararg;
-    expr_ty varargannotation;
+    arg_ty vararg;
     asdl_seq *kwonlyargs;
-    identifier kwarg;
-    expr_ty kwargannotation;
-    asdl_seq *defaults;
     asdl_seq *kw_defaults;
+    arg_ty kwarg;
+    asdl_seq *defaults;
 };
 
 struct _arg {
     identifier arg;
     expr_ty annotation;
+    int lineno;
+    int col_offset;
 };
 
 struct _keyword {
@@ -509,6 +514,9 @@
 expr_ty _Py_Str(string s, int lineno, int col_offset, PyArena *arena);
 #define Bytes(a0, a1, a2, a3) _Py_Bytes(a0, a1, a2, a3)
 expr_ty _Py_Bytes(bytes s, int lineno, int col_offset, PyArena *arena);
+#define NameConstant(a0, a1, a2, a3) _Py_NameConstant(a0, a1, a2, a3)
+expr_ty _Py_NameConstant(singleton value, int lineno, int col_offset, PyArena
+                         *arena);
 #define Ellipsis(a0, a1, a2) _Py_Ellipsis(a0, a1, a2)
 expr_ty _Py_Ellipsis(int lineno, int col_offset, PyArena *arena);
 #define Attribute(a0, a1, a2, a3, a4, a5) _Py_Attribute(a0, a1, a2, a3, a4, a5)
@@ -542,11 +550,10 @@
 excepthandler_ty _Py_ExceptHandler(expr_ty type, identifier name, asdl_seq *
                                    body, int lineno, int col_offset, PyArena
                                    *arena);
-#define arguments(a0, a1, a2, a3, a4, a5, a6, a7, a8) _Py_arguments(a0, a1, a2, a3, a4, a5, a6, a7, a8)
-arguments_ty _Py_arguments(asdl_seq * args, identifier vararg, expr_ty
-                           varargannotation, asdl_seq * kwonlyargs, identifier
-                           kwarg, expr_ty kwargannotation, asdl_seq * defaults,
-                           asdl_seq * kw_defaults, PyArena *arena);
+#define arguments(a0, a1, a2, a3, a4, a5, a6) _Py_arguments(a0, a1, a2, a3, a4, a5, a6)
+arguments_ty _Py_arguments(asdl_seq * args, arg_ty vararg, asdl_seq *
+                           kwonlyargs, asdl_seq * kw_defaults, arg_ty kwarg,
+                           asdl_seq * defaults, PyArena *arena);
 #define arg(a0, a1, a2) _Py_arg(a0, a1, a2)
 arg_ty _Py_arg(identifier arg, expr_ty annotation, PyArena *arena);
 #define keyword(a0, a1, a2) _Py_keyword(a0, a1, a2)
diff --git a/Include/Python.h b/Include/Python.h
index a78a721..2dd8290 100644
--- a/Include/Python.h
+++ b/Include/Python.h
@@ -68,6 +68,7 @@
 #include "object.h"
 #include "objimpl.h"
 #include "typeslots.h"
+#include "pyhash.h"
 
 #include "pydebug.h"
 
diff --git a/Include/abstract.h b/Include/abstract.h
index c9624f3..6e850b8 100644
--- a/Include/abstract.h
+++ b/Include/abstract.h
@@ -144,7 +144,7 @@
 
      /* Implemented elsewhere:
 
-     int PyObject_HasAttrString(PyObject *o, char *attr_name);
+     int PyObject_HasAttrString(PyObject *o, const char *attr_name);
 
      Returns 1 if o has the attribute attr_name, and 0 otherwise.
      This is equivalent to the Python expression:
@@ -156,7 +156,7 @@
 
      /* Implemented elsewhere:
 
-     PyObject* PyObject_GetAttrString(PyObject *o, char *attr_name);
+     PyObject* PyObject_GetAttrString(PyObject *o, const char *attr_name);
 
      Retrieve an attributed named attr_name form object o.
      Returns the attribute value on success, or NULL on failure.
@@ -189,7 +189,7 @@
 
      /* Implemented elsewhere:
 
-     int PyObject_SetAttrString(PyObject *o, char *attr_name, PyObject *v);
+     int PyObject_SetAttrString(PyObject *o, const char *attr_name, PyObject *v);
 
      Set the value of the attribute named attr_name, for object o,
      to the value, v. Returns -1 on failure.  This is
@@ -209,7 +209,7 @@
 
      /* implemented as a macro:
 
-     int PyObject_DelAttrString(PyObject *o, char *attr_name);
+     int PyObject_DelAttrString(PyObject *o, const char *attr_name);
 
      Delete attribute named attr_name, for object o. Returns
      -1 on failure.  This is the equivalent of the Python
@@ -284,7 +284,7 @@
        */
 
      PyAPI_FUNC(PyObject *) PyObject_CallFunction(PyObject *callable_object,
-                                                  char *format, ...);
+                                                  const char *format, ...);
 
        /*
      Call a callable Python object, callable_object, with a
@@ -296,8 +296,9 @@
        */
 
 
-     PyAPI_FUNC(PyObject *) PyObject_CallMethod(PyObject *o, char *method,
-                                                char *format, ...);
+     PyAPI_FUNC(PyObject *) PyObject_CallMethod(PyObject *o,
+                                                const char *method,
+                                                const char *format, ...);
 
        /*
      Call the method named m of object o with a variable number of
@@ -308,8 +309,9 @@
      Python expression: o.method(args).
        */
 
-     PyAPI_FUNC(PyObject *) _PyObject_CallMethodId(PyObject *o, _Py_Identifier *method,
-                                                  char *format, ...);
+     PyAPI_FUNC(PyObject *) _PyObject_CallMethodId(PyObject *o,
+                                                   _Py_Identifier *method,
+                                                   const char *format, ...);
 
        /*
          Like PyObject_CallMethod, but expect a _Py_Identifier* as the
@@ -317,13 +319,16 @@
        */
 
      PyAPI_FUNC(PyObject *) _PyObject_CallFunction_SizeT(PyObject *callable,
-                                                         char *format, ...);
+                                                         const char *format,
+                                                         ...);
      PyAPI_FUNC(PyObject *) _PyObject_CallMethod_SizeT(PyObject *o,
-                                                       char *name,
-                                                       char *format, ...);
+                                                       const char *name,
+                                                       const char *format,
+                                                       ...);
      PyAPI_FUNC(PyObject *) _PyObject_CallMethodId_SizeT(PyObject *o,
                                                        _Py_Identifier *name,
-                                                       char *format, ...);
+                                                       const char *format,
+                                                       ...);
 
      PyAPI_FUNC(PyObject *) PyObject_CallFunctionObjArgs(PyObject *callable,
                                                          ...);
@@ -339,11 +344,10 @@
 
      PyAPI_FUNC(PyObject *) PyObject_CallMethodObjArgs(PyObject *o,
                                                        PyObject *method, ...);
-     PyAPI_FUNC(PyObject *) _PyObject_CallMethodObjIdArgs(PyObject *o,
+     PyAPI_FUNC(PyObject *) _PyObject_CallMethodIdObjArgs(PyObject *o,
                                                struct _Py_Identifier *method,
                                                ...);
 
-
        /*
      Call the method named m of object o with a variable number of
      C arguments.  The C arguments are provided as PyObject *
@@ -404,7 +408,8 @@
 #define PyObject_Length PyObject_Size
 
 #ifndef Py_LIMITED_API
-     PyAPI_FUNC(Py_ssize_t) _PyObject_LengthHint(PyObject *o, Py_ssize_t);
+     PyAPI_FUNC(int) _PyObject_HasLen(PyObject *o);
+     PyAPI_FUNC(Py_ssize_t) PyObject_LengthHint(PyObject *o, Py_ssize_t);
 #endif
 
        /*
@@ -429,7 +434,7 @@
      statement: o[key]=v.
        */
 
-     PyAPI_FUNC(int) PyObject_DelItemString(PyObject *o, char *key);
+     PyAPI_FUNC(int) PyObject_DelItemString(PyObject *o, const char *key);
 
        /*
      Remove the mapping for object, key, from the object *o.
@@ -1016,7 +1021,7 @@
 
      PyAPI_FUNC(PyObject *) PySequence_Fast(PyObject *o, const char* m);
        /*
-     Returns the sequence, o, as a list, unless it's already a
+     Return the sequence, o, as a list, unless it's already a
      tuple or list.  Use PySequence_Fast_GET_ITEM to access the
      members of this list, and PySequence_Fast_GET_SIZE to get its length.
 
@@ -1151,7 +1156,7 @@
 
      /* implemented as a macro:
 
-     int PyMapping_DelItemString(PyObject *o, char *key);
+     int PyMapping_DelItemString(PyObject *o, const char *key);
 
      Remove the mapping for object, key, from the object *o.
      Returns -1 on failure.  This is equivalent to
@@ -1169,7 +1174,7 @@
        */
 #define PyMapping_DelItem(O,K) PyObject_DelItem((O),(K))
 
-     PyAPI_FUNC(int) PyMapping_HasKeyString(PyObject *o, char *key);
+     PyAPI_FUNC(int) PyMapping_HasKeyString(PyObject *o, const char *key);
 
        /*
      On success, return 1 if the mapping object has the key, key,
@@ -1213,7 +1218,8 @@
 
        */
 
-     PyAPI_FUNC(PyObject *) PyMapping_GetItemString(PyObject *o, char *key);
+     PyAPI_FUNC(PyObject *) PyMapping_GetItemString(PyObject *o,
+                                                    const char *key);
 
        /*
      Return element of o corresponding to the object, key, or NULL
@@ -1221,7 +1227,7 @@
      o[key].
        */
 
-     PyAPI_FUNC(int) PyMapping_SetItemString(PyObject *o, char *key,
+     PyAPI_FUNC(int) PyMapping_SetItemString(PyObject *o, const char *key,
                                             PyObject *value);
 
        /*
diff --git a/Include/asdl.h b/Include/asdl.h
index 6bf618f..495153c 100644
--- a/Include/asdl.h
+++ b/Include/asdl.h
@@ -5,6 +5,7 @@
 typedef PyObject * string;
 typedef PyObject * bytes;
 typedef PyObject * object;
+typedef PyObject * singleton;
 
 /* It would be nice if the code generated by asdl_c.py was completely
    independent of Python, but it is a goal the requires too much work
@@ -24,17 +25,19 @@
     int elements[1];
 } asdl_int_seq;
 
-asdl_seq *asdl_seq_new(Py_ssize_t size, PyArena *arena);
-asdl_int_seq *asdl_int_seq_new(Py_ssize_t size, PyArena *arena);
+asdl_seq *_Py_asdl_seq_new(Py_ssize_t size, PyArena *arena);
+asdl_int_seq *_Py_asdl_int_seq_new(Py_ssize_t size, PyArena *arena);
 
 #define asdl_seq_GET(S, I) (S)->elements[(I)]
 #define asdl_seq_LEN(S) ((S) == NULL ? 0 : (S)->size)
 #ifdef Py_DEBUG
-#define asdl_seq_SET(S, I, V) { \
-        int _asdl_i = (I); \
-        assert((S) && _asdl_i < (S)->size); \
+#define asdl_seq_SET(S, I, V) \
+    do { \
+        Py_ssize_t _asdl_i = (I); \
+        assert((S) != NULL); \
+        assert(_asdl_i < (S)->size); \
         (S)->elements[_asdl_i] = (V); \
-}
+    } while (0)
 #else
 #define asdl_seq_SET(S, I, V) (S)->elements[I] = (V)
 #endif
diff --git a/Include/ast.h b/Include/ast.h
index 055e8dc..6a8c816 100644
--- a/Include/ast.h
+++ b/Include/ast.h
@@ -10,6 +10,11 @@
     PyCompilerFlags *flags,
     const char *filename,       /* decoded from the filesystem encoding */
     PyArena *arena);
+PyAPI_FUNC(mod_ty) PyAST_FromNodeObject(
+    const node *n,
+    PyCompilerFlags *flags,
+    PyObject *filename,
+    PyArena *arena);
 
 #ifdef __cplusplus
 }
diff --git a/Include/bytearrayobject.h b/Include/bytearrayobject.h
index eccd44c..a757b88 100644
--- a/Include/bytearrayobject.h
+++ b/Include/bytearrayobject.h
@@ -22,10 +22,11 @@
 #ifndef Py_LIMITED_API
 typedef struct {
     PyObject_VAR_HEAD
+    Py_ssize_t ob_alloc; /* How many bytes allocated in ob_bytes */
+    char *ob_bytes;      /* Physical backing buffer */
+    char *ob_start;      /* Logical start inside ob_bytes */
     /* XXX(nnorwitz): should ob_exports be Py_ssize_t? */
-    int ob_exports; /* how many buffer exports */
-    Py_ssize_t ob_alloc; /* How many bytes allocated */
-    char *ob_bytes;
+    int ob_exports;      /* How many buffer exports */
 } PyByteArrayObject;
 #endif
 
@@ -49,8 +50,8 @@
 #ifndef Py_LIMITED_API
 #define PyByteArray_AS_STRING(self) \
     (assert(PyByteArray_Check(self)), \
-     Py_SIZE(self) ? ((PyByteArrayObject *)(self))->ob_bytes : _PyByteArray_empty_string)
-#define PyByteArray_GET_SIZE(self)  (assert(PyByteArray_Check(self)),Py_SIZE(self))
+     Py_SIZE(self) ? ((PyByteArrayObject *)(self))->ob_start : _PyByteArray_empty_string)
+#define PyByteArray_GET_SIZE(self) (assert(PyByteArray_Check(self)), Py_SIZE(self))
 
 PyAPI_DATA(char) _PyByteArray_empty_string[];
 #endif
diff --git a/Include/bytesobject.h b/Include/bytesobject.h
index d7c7ffd..0ee8d36 100644
--- a/Include/bytesobject.h
+++ b/Include/bytesobject.h
@@ -86,11 +86,11 @@
    0-terminated (passing a string with embedded NULL characters will
    cause an exception).  */
 PyAPI_FUNC(int) PyBytes_AsStringAndSize(
-    register PyObject *obj,	/* string or Unicode object */
-    register char **s,		/* pointer to buffer variable */
-    register Py_ssize_t *len	/* pointer to length variable or NULL
-				   (only possible for 0-terminated
-				   strings) */
+    PyObject *obj,      /* string or Unicode object */
+    char **s,           /* pointer to buffer variable */
+    Py_ssize_t *len     /* pointer to length variable or NULL
+                           (only possible for 0-terminated
+                           strings) */
     );
 
 /* Using the current locale, insert the thousands grouping
diff --git a/Include/codecs.h b/Include/codecs.h
index 611964c..b3088e4 100644
--- a/Include/codecs.h
+++ b/Include/codecs.h
@@ -49,6 +49,10 @@
 PyAPI_FUNC(PyObject *) _PyCodec_Lookup(
        const char *encoding
        );
+
+PyAPI_FUNC(int) _PyCodec_Forget(
+       const char *encoding
+       );
 #endif
 
 /* Codec registry encoding check API.
diff --git a/Include/compile.h b/Include/compile.h
index ac2636d..c6650d7 100644
--- a/Include/compile.h
+++ b/Include/compile.h
@@ -36,11 +36,27 @@
     PyCompilerFlags *flags,
     int optimize,
     PyArena *arena);
-PyAPI_FUNC(PyFutureFeatures *) PyFuture_FromAST(struct _mod *, const char *);
+PyAPI_FUNC(PyCodeObject *) PyAST_CompileObject(
+    struct _mod *mod,
+    PyObject *filename,
+    PyCompilerFlags *flags,
+    int optimize,
+    PyArena *arena);
+PyAPI_FUNC(PyFutureFeatures *) PyFuture_FromAST(
+    struct _mod * mod,
+    const char *filename        /* decoded from the filesystem encoding */
+    );
+PyAPI_FUNC(PyFutureFeatures *) PyFuture_FromASTObject(
+    struct _mod * mod,
+    PyObject *filename
+    );
 
 /* _Py_Mangle is defined in compile.c */
 PyAPI_FUNC(PyObject*) _Py_Mangle(PyObject *p, PyObject *name);
 
+#define PY_INVALID_STACK_EFFECT INT_MAX
+PyAPI_FUNC(int) PyCompile_OpcodeStackEffect(int opcode, int oparg);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/Include/dictobject.h b/Include/dictobject.h
index d89aac8..ef122bd 100644
--- a/Include/dictobject.h
+++ b/Include/dictobject.h
@@ -53,6 +53,10 @@
 PyAPI_FUNC(PyObject *) PyDict_GetItemWithError(PyObject *mp, PyObject *key);
 PyAPI_FUNC(PyObject *) _PyDict_GetItemIdWithError(PyObject *dp,
                                                   struct _Py_Identifier *key);
+#ifndef Py_LIMITED_API
+PyAPI_FUNC(PyObject *) PyDict_SetDefault(
+    PyObject *mp, PyObject *key, PyObject *defaultobj);
+#endif
 PyAPI_FUNC(int) PyDict_SetItem(PyObject *mp, PyObject *key, PyObject *item);
 PyAPI_FUNC(int) PyDict_DelItem(PyObject *mp, PyObject *key);
 PyAPI_FUNC(void) PyDict_Clear(PyObject *mp);
@@ -109,9 +113,11 @@
 PyAPI_FUNC(int) PyDict_DelItemString(PyObject *dp, const char *key);
 
 #ifndef Py_LIMITED_API
+PyAPI_FUNC(int) _PyDict_DelItemId(PyObject *mp, struct _Py_Identifier *key);
+PyAPI_FUNC(void) _PyDict_DebugMallocStats(FILE *out);
+
 int _PyObjectDict_SetItem(PyTypeObject *tp, PyObject **dictptr, PyObject *name, PyObject *value);
 PyObject *_PyDict_LoadGlobal(PyDictObject *, PyDictObject *, PyObject *);
-PyAPI_FUNC(void) _PyDict_DebugMallocStats(FILE *out);
 #endif
 
 #ifdef __cplusplus
diff --git a/Include/dynamic_annotations.h b/Include/dynamic_annotations.h
index d63c5db..0bd1a83 100644
--- a/Include/dynamic_annotations.h
+++ b/Include/dynamic_annotations.h
@@ -150,7 +150,7 @@
 
   /* Report that a new memory at "address" of size "size" has been allocated.
      This might be used when the memory has been retrieved from a free list and
-     is about to be reused, or when a the locking discipline for a variable
+     is about to be reused, or when the locking discipline for a variable
      changes. */
 #define _Py_ANNOTATE_NEW_MEMORY(address, size) \
     AnnotateNewMemory(__FILE__, __LINE__, address, size)
diff --git a/Include/fileobject.h b/Include/fileobject.h
index a99c94d..0939744 100644
--- a/Include/fileobject.h
+++ b/Include/fileobject.h
@@ -8,8 +8,9 @@
 
 #define PY_STDIOTEXTMODE "b"
 
-PyAPI_FUNC(PyObject *) PyFile_FromFd(int, char *, char *, int, char *, char *,
-				     char *, int);
+PyAPI_FUNC(PyObject *) PyFile_FromFd(int, const char *, const char *, int,
+                                     const char *, const char *,
+                                     const char *, int);
 PyAPI_FUNC(PyObject *) PyFile_GetLine(PyObject *, int);
 PyAPI_FUNC(int) PyFile_WriteObject(PyObject *, PyObject *, int);
 PyAPI_FUNC(int) PyFile_WriteString(const char *, PyObject *);
diff --git a/Include/fileutils.h b/Include/fileutils.h
index 7c18cf2..e9bad80 100644
--- a/Include/fileutils.h
+++ b/Include/fileutils.h
@@ -27,11 +27,21 @@
     struct stat *statbuf);
 #endif
 
+#ifndef Py_LIMITED_API
+PyAPI_FUNC(int) _Py_open(
+    const char *pathname,
+    int flags);
+#endif
+
 PyAPI_FUNC(FILE *) _Py_wfopen(
     const wchar_t *path,
     const wchar_t *mode);
 
 PyAPI_FUNC(FILE*) _Py_fopen(
+    const char *pathname,
+    const char *mode);
+
+PyAPI_FUNC(FILE*) _Py_fopen_obj(
     PyObject *path,
     const char *mode);
 
@@ -53,6 +63,15 @@
     wchar_t *buf,
     size_t size);
 
+#ifndef Py_LIMITED_API
+PyAPI_FUNC(int) _Py_get_inheritable(int fd);
+
+PyAPI_FUNC(int) _Py_set_inheritable(int fd, int inheritable,
+                                    int *atomic_flag_works);
+
+PyAPI_FUNC(int) _Py_dup(int fd);
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/Include/frameobject.h b/Include/frameobject.h
index 33f73af..966ff1f 100644
--- a/Include/frameobject.h
+++ b/Include/frameobject.h
@@ -36,8 +36,9 @@
            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;
+    /* Borrowed reference to a generator, or NULL */
+    PyObject *f_gen;
 
-    PyThreadState *f_tstate;
     int f_lasti;                /* Last instruction if called */
     /* Call PyFrame_GetLineNumber() instead of reading this field
        directly.  As of 2.3 f_lineno is only valid when tracing is
@@ -46,6 +47,7 @@
        bytecode index. */
     int f_lineno;               /* Current line number */
     int f_iblock;               /* index in f_blockstack */
+    char f_executing;           /* whether the frame is still executing */
     PyTryBlock f_blockstack[CO_MAXBLOCKS]; /* for try and loop blocks */
     PyObject *f_localsplus[1];  /* locals+stack, dynamically sized */
 } PyFrameObject;
@@ -75,6 +77,8 @@
 /* Conversions between "fast locals" and locals in dictionary */
 
 PyAPI_FUNC(void) PyFrame_LocalsToFast(PyFrameObject *, int);
+
+PyAPI_FUNC(int) PyFrame_FastToLocalsWithError(PyFrameObject *f);
 PyAPI_FUNC(void) PyFrame_FastToLocals(PyFrameObject *);
 
 PyAPI_FUNC(int) PyFrame_ClearFreeList(void);
diff --git a/Include/genobject.h b/Include/genobject.h
index ed451ba..65f1ecf 100644
--- a/Include/genobject.h
+++ b/Include/genobject.h
@@ -36,6 +36,8 @@
 PyAPI_FUNC(int) PyGen_NeedsFinalizing(PyGenObject *);
 PyAPI_FUNC(int) _PyGen_FetchStopIterationValue(PyObject **);
 PyObject *_PyGen_Send(PyGenObject *, PyObject *);
+PyAPI_FUNC(void) _PyGen_Finalize(PyObject *self);
+
 
 #ifdef __cplusplus
 }
diff --git a/Include/grammar.h b/Include/grammar.h
index 8426da3..ba7d19d 100644
--- a/Include/grammar.h
+++ b/Include/grammar.h
@@ -69,14 +69,14 @@
 /* FUNCTIONS */
 
 grammar *newgrammar(int start);
-dfa *adddfa(grammar *g, int type, char *name);
+dfa *adddfa(grammar *g, int type, const char *name);
 int addstate(dfa *d);
 void addarc(dfa *d, int from, int to, int lbl);
 dfa *PyGrammar_FindDFA(grammar *g, int type);
 
-int addlabel(labellist *ll, int type, char *str);
-int findlabel(labellist *ll, int type, char *str);
-char *PyGrammar_LabelRepr(label *lb);
+int addlabel(labellist *ll, int type, const char *str);
+int findlabel(labellist *ll, int type, const char *str);
+const char *PyGrammar_LabelRepr(label *lb);
 void translatelabels(grammar *g);
 
 void addfirstsets(grammar *g);
diff --git a/Include/import.h b/Include/import.h
index 73c86ee..afdfac2 100644
--- a/Include/import.h
+++ b/Include/import.h
@@ -13,19 +13,19 @@
 PyAPI_FUNC(long) PyImport_GetMagicNumber(void);
 PyAPI_FUNC(const char *) PyImport_GetMagicTag(void);
 PyAPI_FUNC(PyObject *) PyImport_ExecCodeModule(
-    char *name,                 /* UTF-8 encoded string */
+    const char *name,           /* UTF-8 encoded string */
     PyObject *co
     );
 PyAPI_FUNC(PyObject *) PyImport_ExecCodeModuleEx(
-    char *name,                 /* UTF-8 encoded string */
+    const char *name,           /* UTF-8 encoded string */
     PyObject *co,
-    char *pathname              /* decoded from the filesystem encoding */
+    const char *pathname        /* decoded from the filesystem encoding */
     );
 PyAPI_FUNC(PyObject *) PyImport_ExecCodeModuleWithPathnames(
-    char *name,                 /* UTF-8 encoded string */
+    const char *name,           /* UTF-8 encoded string */
     PyObject *co,
-    char *pathname,             /* decoded from the filesystem encoding */
-    char *cpathname             /* decoded from the filesystem encoding */
+    const char *pathname,       /* decoded from the filesystem encoding */
+    const char *cpathname       /* decoded from the filesystem encoding */
     );
 PyAPI_FUNC(PyObject *) PyImport_ExecCodeModuleObject(
     PyObject *name,
@@ -72,7 +72,7 @@
     PyObject *name
     );
 PyAPI_FUNC(int) PyImport_ImportFrozenModule(
-    char *name                  /* UTF-8 encoded string */
+    const char *name            /* UTF-8 encoded string */
     );
 
 #ifndef Py_LIMITED_API
@@ -92,12 +92,12 @@
 PyAPI_FUNC(PyObject *) _PyImport_FindExtensionObject(PyObject *, PyObject *);
 PyAPI_FUNC(int) _PyImport_FixupBuiltin(
     PyObject *mod,
-    char *name                  /* UTF-8 encoded string */
+    const char *name            /* UTF-8 encoded string */
     );
 PyAPI_FUNC(int) _PyImport_FixupExtensionObject(PyObject*, PyObject *, PyObject *);
 
 struct _inittab {
-    char *name;                 /* ASCII encoded string */
+    const char *name;           /* ASCII encoded string */
     PyObject* (*initfunc)(void);
 };
 PyAPI_DATA(struct _inittab *) PyImport_Inittab;
@@ -113,15 +113,15 @@
 
 #ifndef Py_LIMITED_API
 struct _frozen {
-    char *name;                 /* ASCII encoded string */
-    unsigned char *code;
+    const char *name;                 /* ASCII encoded string */
+    const unsigned char *code;
     int size;
 };
 
 /* Embedding apps may change this pointer to point to their favorite
    collection of frozen modules: */
 
-PyAPI_DATA(struct _frozen *) PyImport_FrozenModules;
+PyAPI_DATA(const struct _frozen *) PyImport_FrozenModules;
 #endif
 
 #ifdef __cplusplus
diff --git a/Include/listobject.h b/Include/listobject.h
index dc62aee..74cf46f 100644
--- a/Include/listobject.h
+++ b/Include/listobject.h
@@ -46,7 +46,7 @@
 PyAPI_DATA(PyTypeObject) PySortWrapper_Type;
 
 #define PyList_Check(op) \
-		PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LIST_SUBCLASS)
+    PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LIST_SUBCLASS)
 #define PyList_CheckExact(op) (Py_TYPE(op) == &PyList_Type)
 
 PyAPI_FUNC(PyObject *) PyList_New(Py_ssize_t size);
diff --git a/Include/longobject.h b/Include/longobject.h
index 1c1c5de..ff43309 100644
--- a/Include/longobject.h
+++ b/Include/longobject.h
@@ -52,6 +52,19 @@
 #error "sizeof(pid_t) is neither sizeof(int), sizeof(long) or sizeof(long long)"
 #endif /* SIZEOF_PID_T */
 
+#if SIZEOF_VOID_P == SIZEOF_INT
+#  define _Py_PARSE_INTPTR "i"
+#  define _Py_PARSE_UINTPTR "I"
+#elif SIZEOF_VOID_P == SIZEOF_LONG
+#  define _Py_PARSE_INTPTR "l"
+#  define _Py_PARSE_UINTPTR "k"
+#elif defined(SIZEOF_LONG_LONG) && SIZEOF_VOID_P == SIZEOF_LONG_LONG
+#  define _Py_PARSE_INTPTR "L"
+#  define _Py_PARSE_UINTPTR "K"
+#else
+#  error "void* different in size from int, long and long long"
+#endif /* SIZEOF_VOID_P */
+
 /* Used by Python/mystrtoul.c. */
 #ifndef Py_LIMITED_API
 PyAPI_DATA(unsigned char) _PyLong_DigitValue[256];
@@ -80,7 +93,7 @@
 PyAPI_FUNC(PY_LONG_LONG) PyLong_AsLongLongAndOverflow(PyObject *, int *);
 #endif /* HAVE_LONG_LONG */
 
-PyAPI_FUNC(PyObject *) PyLong_FromString(char *, char **, int);
+PyAPI_FUNC(PyObject *) PyLong_FromString(const char *, char **, int);
 #ifndef Py_LIMITED_API
 PyAPI_FUNC(PyObject *) PyLong_FromUnicode(Py_UNICODE*, Py_ssize_t, int);
 PyAPI_FUNC(PyObject *) PyLong_FromUnicodeObject(PyObject *u, int base);
@@ -182,8 +195,8 @@
 /* These aren't really part of the int object, but they're handy. The
    functions are in Python/mystrtoul.c.
  */
-PyAPI_FUNC(unsigned long) PyOS_strtoul(char *, char **, int);
-PyAPI_FUNC(long) PyOS_strtol(char *, char **, int);
+PyAPI_FUNC(unsigned long) PyOS_strtoul(const char *, char **, int);
+PyAPI_FUNC(long) PyOS_strtol(const char *, char **, int);
 
 #ifdef __cplusplus
 }
diff --git a/Include/marshal.h b/Include/marshal.h
index e96d062..09d9337 100644
--- a/Include/marshal.h
+++ b/Include/marshal.h
@@ -7,7 +7,7 @@
 extern "C" {
 #endif
 
-#define Py_MARSHAL_VERSION 2
+#define Py_MARSHAL_VERSION 4
 
 PyAPI_FUNC(void) PyMarshal_WriteLongToFile(long, FILE *, int);
 PyAPI_FUNC(void) PyMarshal_WriteObjectToFile(PyObject *, FILE *, int);
@@ -19,7 +19,8 @@
 PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromFile(FILE *);
 PyAPI_FUNC(PyObject *) PyMarshal_ReadLastObjectFromFile(FILE *);
 #endif
-PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromString(char *, Py_ssize_t);
+PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromString(const char *,
+                                                      Py_ssize_t);
 
 #ifdef __cplusplus
 }
diff --git a/Include/memoryobject.h b/Include/memoryobject.h
index c2e1194..382ca92 100644
--- a/Include/memoryobject.h
+++ b/Include/memoryobject.h
@@ -45,7 +45,7 @@
 } _PyManagedBufferObject;
 
 
-/* static storage used for casting between formats */
+/* deprecated, removed in 3.5 */
 #define _Py_MEMORYVIEW_MAX_FORMAT 3 /* must be >= 3 */
 
 /* memoryview state flags */
@@ -62,7 +62,7 @@
     int flags;                    /* state flags */
     Py_ssize_t exports;           /* number of buffer re-exports */
     Py_buffer view;               /* private copy of the exporter's view */
-    char format[_Py_MEMORYVIEW_MAX_FORMAT]; /* used for casting */
+    char format[_Py_MEMORYVIEW_MAX_FORMAT]; /* deprecated, removed in 3.5 */
     PyObject *weakreflist;
     Py_ssize_t ob_array[1];       /* shape, strides, suboffsets */
 } PyMemoryViewObject;
diff --git a/Include/modsupport.h b/Include/modsupport.h
index ecf1dcc..5de0458 100644
--- a/Include/modsupport.h
+++ b/Include/modsupport.h
@@ -26,7 +26,7 @@
 /* Due to a glitch in 3.2, the _SizeT versions weren't exported from the DLL. */
 #if !defined(PY_SSIZE_T_CLEAN) || !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
 PyAPI_FUNC(int) PyArg_Parse(PyObject *, const char *, ...);
-PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...) Py_FORMAT_PARSETUPLE(PyArg_ParseTuple, 2, 3);
+PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...);
 PyAPI_FUNC(int) PyArg_ParseTupleAndKeywords(PyObject *, PyObject *,
                                                   const char *, char **, ...);
 PyAPI_FUNC(int) PyArg_ValidateKeywordArguments(PyObject *);
@@ -36,6 +36,7 @@
 #endif
 #ifndef Py_LIMITED_API
 PyAPI_FUNC(int) _PyArg_NoKeywords(const char *funcname, PyObject *kw);
+PyAPI_FUNC(int) _PyArg_NoPositional(const char *funcname, PyObject *args);
 
 PyAPI_FUNC(int) PyArg_VaParse(PyObject *, const char *, va_list);
 PyAPI_FUNC(int) PyArg_VaParseTupleAndKeywords(PyObject *, PyObject *,
diff --git a/Include/moduleobject.h b/Include/moduleobject.h
index 8013dd9..f119364 100644
--- a/Include/moduleobject.h
+++ b/Include/moduleobject.h
@@ -25,6 +25,7 @@
 PyAPI_FUNC(PyObject *) PyModule_GetFilenameObject(PyObject *);
 #ifndef Py_LIMITED_API
 PyAPI_FUNC(void) _PyModule_Clear(PyObject *);
+PyAPI_FUNC(void) _PyModule_ClearDict(PyObject *);
 #endif
 PyAPI_FUNC(struct PyModuleDef*) PyModule_GetDef(PyObject*);
 PyAPI_FUNC(void*) PyModule_GetState(PyObject*);
diff --git a/Include/node.h b/Include/node.h
index 99c13f7..2e4e2ba 100644
--- a/Include/node.h
+++ b/Include/node.h
@@ -21,7 +21,7 @@
                                       char *str, int lineno, int col_offset);
 PyAPI_FUNC(void) PyNode_Free(node *n);
 #ifndef Py_LIMITED_API
-Py_ssize_t _PyNode_SizeOf(node *n);
+PyAPI_FUNC(Py_ssize_t) _PyNode_SizeOf(node *n);
 #endif
 
 /* Node access functions */
diff --git a/Include/object.h b/Include/object.h
index cdeb06c..9306288 100644
--- a/Include/object.h
+++ b/Include/object.h
@@ -143,7 +143,8 @@
     PyObject *object;
 } _Py_Identifier;
 
-#define _Py_static_string(varname, value)  static _Py_Identifier varname = { 0, value, 0 }
+#define _Py_static_string_init(value) { 0, value, 0 }
+#define _Py_static_string(varname, value)  static _Py_Identifier varname = _Py_static_string_init(value)
 #define _Py_IDENTIFIER(varname) _Py_static_string(PyId_##varname, #varname)
 
 /*
@@ -362,7 +363,7 @@
     PyBufferProcs *tp_as_buffer;
 
     /* Flags to define presence of optional/expanded features */
-    long tp_flags;
+    unsigned long tp_flags;
 
     const char *tp_doc; /* Documentation string */
 
@@ -408,6 +409,8 @@
     /* Type attribute cache version tag. Added in version 2.6 */
     unsigned int tp_version_tag;
 
+    destructor tp_finalize;
+
 #ifdef COUNT_ALLOCS
     /* these must be last and never explicitly initialized */
     Py_ssize_t tp_allocs;
@@ -428,7 +431,7 @@
     const char* name;
     int basicsize;
     int itemsize;
-    int flags;
+    unsigned int flags;
     PyType_Slot *slots; /* terminated by slot==0. */
 } PyType_Spec;
 
@@ -436,6 +439,9 @@
 #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
 PyAPI_FUNC(PyObject*) PyType_FromSpecWithBases(PyType_Spec*, PyObject*);
 #endif
+#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03040000
+PyAPI_FUNC(void*) PyType_GetSlot(PyTypeObject*, int);
+#endif
 
 #ifndef Py_LIMITED_API
 /* The *real* layout of a type object when allocated on the heap */
@@ -470,7 +476,7 @@
 PyAPI_DATA(PyTypeObject) PyBaseObject_Type; /* built-in 'object' */
 PyAPI_DATA(PyTypeObject) PySuper_Type; /* built-in 'super' */
 
-PyAPI_FUNC(long) PyType_GetFlags(PyTypeObject*);
+PyAPI_FUNC(unsigned long) PyType_GetFlags(PyTypeObject*);
 
 #define PyType_Check(op) \
     PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_TYPE_SUBCLASS)
@@ -489,6 +495,11 @@
 PyAPI_FUNC(unsigned int) PyType_ClearCache(void);
 PyAPI_FUNC(void) PyType_Modified(PyTypeObject *);
 
+#ifndef Py_LIMITED_API
+PyAPI_FUNC(PyObject *) _PyType_GetDocFromInternalDoc(const char *, const char *);
+PyAPI_FUNC(PyObject *) _PyType_GetTextSignatureFromInternalDoc(const char *, const char *);
+#endif
+
 /* Generic operations on objects */
 struct _Py_Identifier;
 #ifndef Py_LIMITED_API
@@ -530,6 +541,10 @@
 PyAPI_FUNC(int) PyCallable_Check(PyObject *);
 
 PyAPI_FUNC(void) PyObject_ClearWeakRefs(PyObject *);
+#ifndef Py_LIMITED_API
+PyAPI_FUNC(void) PyObject_CallFinalizer(PyObject *);
+PyAPI_FUNC(int) PyObject_CallFinalizerFromDealloc(PyObject *);
+#endif
 
 /* Same as PyObject_Generic{Get,Set}Attr, but passing the attributes
    dict as the last parameter. */
@@ -557,26 +572,13 @@
 PyAPI_FUNC(int) Py_ReprEnter(PyObject *);
 PyAPI_FUNC(void) Py_ReprLeave(PyObject *);
 
-/* Helpers for hash functions */
 #ifndef Py_LIMITED_API
-PyAPI_FUNC(Py_hash_t) _Py_HashDouble(double);
-PyAPI_FUNC(Py_hash_t) _Py_HashPointer(void*);
-PyAPI_FUNC(Py_hash_t) _Py_HashBytes(unsigned char*, Py_ssize_t);
+/* Helper for passing objects to printf and the like.
+   Leaks refcounts.  Don't use it!
+*/
+#define PyObject_REPR(obj) PyUnicode_AsUTF8(PyObject_Repr(obj))
 #endif
 
-typedef struct {
-    Py_hash_t prefix;
-    Py_hash_t suffix;
-} _Py_HashSecret_t;
-PyAPI_DATA(_Py_HashSecret_t) _Py_HashSecret;
-
-#ifdef Py_DEBUG
-PyAPI_DATA(int) _Py_HashSecret_Initialized;
-#endif
-
-/* Helper for passing objects to printf and the like */
-#define PyObject_REPR(obj) _PyUnicode_AsString(PyObject_Repr(obj))
-
 /* Flag bits for printing: */
 #define Py_PRINT_RAW    1       /* No string quotes etc. */
 
@@ -604,50 +606,55 @@
 */
 
 /* Set if the type object is dynamically allocated */
-#define Py_TPFLAGS_HEAPTYPE (1L<<9)
+#define Py_TPFLAGS_HEAPTYPE (1UL << 9)
 
 /* Set if the type allows subclassing */
-#define Py_TPFLAGS_BASETYPE (1L<<10)
+#define Py_TPFLAGS_BASETYPE (1UL << 10)
 
 /* Set if the type is 'ready' -- fully initialized */
-#define Py_TPFLAGS_READY (1L<<12)
+#define Py_TPFLAGS_READY (1UL << 12)
 
 /* Set while the type is being 'readied', to prevent recursive ready calls */
-#define Py_TPFLAGS_READYING (1L<<13)
+#define Py_TPFLAGS_READYING (1UL << 13)
 
 /* Objects support garbage collection (see objimp.h) */
-#define Py_TPFLAGS_HAVE_GC (1L<<14)
+#define Py_TPFLAGS_HAVE_GC (1UL << 14)
 
 /* These two bits are preserved for Stackless Python, next after this is 17 */
 #ifdef STACKLESS
-#define Py_TPFLAGS_HAVE_STACKLESS_EXTENSION (3L<<15)
+#define Py_TPFLAGS_HAVE_STACKLESS_EXTENSION (3UL << 15)
 #else
 #define Py_TPFLAGS_HAVE_STACKLESS_EXTENSION 0
 #endif
 
 /* Objects support type attribute cache */
-#define Py_TPFLAGS_HAVE_VERSION_TAG   (1L<<18)
-#define Py_TPFLAGS_VALID_VERSION_TAG  (1L<<19)
+#define Py_TPFLAGS_HAVE_VERSION_TAG   (1UL << 18)
+#define Py_TPFLAGS_VALID_VERSION_TAG  (1UL << 19)
 
 /* Type is abstract and cannot be instantiated */
-#define Py_TPFLAGS_IS_ABSTRACT (1L<<20)
+#define Py_TPFLAGS_IS_ABSTRACT (1UL << 20)
 
 /* These flags are used to determine if a type is a subclass. */
-#define Py_TPFLAGS_INT_SUBCLASS         (1L<<23)
-#define Py_TPFLAGS_LONG_SUBCLASS        (1L<<24)
-#define Py_TPFLAGS_LIST_SUBCLASS        (1L<<25)
-#define Py_TPFLAGS_TUPLE_SUBCLASS       (1L<<26)
-#define Py_TPFLAGS_BYTES_SUBCLASS       (1L<<27)
-#define Py_TPFLAGS_UNICODE_SUBCLASS     (1L<<28)
-#define Py_TPFLAGS_DICT_SUBCLASS        (1L<<29)
-#define Py_TPFLAGS_BASE_EXC_SUBCLASS    (1L<<30)
-#define Py_TPFLAGS_TYPE_SUBCLASS        (1L<<31)
+#define Py_TPFLAGS_LONG_SUBCLASS        (1UL << 24)
+#define Py_TPFLAGS_LIST_SUBCLASS        (1UL << 25)
+#define Py_TPFLAGS_TUPLE_SUBCLASS       (1UL << 26)
+#define Py_TPFLAGS_BYTES_SUBCLASS       (1UL << 27)
+#define Py_TPFLAGS_UNICODE_SUBCLASS     (1UL << 28)
+#define Py_TPFLAGS_DICT_SUBCLASS        (1UL << 29)
+#define Py_TPFLAGS_BASE_EXC_SUBCLASS    (1UL << 30)
+#define Py_TPFLAGS_TYPE_SUBCLASS        (1UL << 31)
 
 #define Py_TPFLAGS_DEFAULT  ( \
                  Py_TPFLAGS_HAVE_STACKLESS_EXTENSION | \
                  Py_TPFLAGS_HAVE_VERSION_TAG | \
                 0)
 
+/* NOTE: The following flags reuse lower bits (removed as part of the
+ * Python 3.0 transition). */
+
+/* Type structure has tp_finalize member (3.4) */
+#define Py_TPFLAGS_HAVE_FINALIZE (1UL << 0)
+
 #ifdef Py_LIMITED_API
 #define PyType_HasFeature(t,f)  ((PyType_GetFlags(t) & (f)) != 0)
 #else
@@ -682,12 +689,6 @@
 complications in the deallocation function.  (This is actually a
 decision that's up to the implementer of each new type so if you want,
 you can count such references to the type object.)
-
-*** WARNING*** The Py_DECREF macro must have a side-effect-free argument
-since it may evaluate its argument multiple times.  (The alternative
-would be to mace it a proper function or assign it to a global temporary
-variable first, both of which are slower; and in a multi-threaded
-environment the global variable trick is not safe.)
 */
 
 /* First define a pile of simple helper macros, one set per special
@@ -704,7 +705,6 @@
 PyAPI_FUNC(void) _Py_NegativeRefcount(const char *fname,
                                             int lineno, PyObject *op);
 PyAPI_FUNC(PyObject *) _PyDict_Dummy(void);
-PyAPI_FUNC(PyObject *) _PySet_Dummy(void);
 PyAPI_FUNC(Py_ssize_t) _Py_GetRefTotal(void);
 #define _Py_INC_REFTOTAL        _Py_RefTotal++
 #define _Py_DEC_REFTOTAL        _Py_RefTotal--
@@ -766,15 +766,16 @@
 
 #define Py_INCREF(op) (                         \
     _Py_INC_REFTOTAL  _Py_REF_DEBUG_COMMA       \
-    ((PyObject*)(op))->ob_refcnt++)
+    ((PyObject *)(op))->ob_refcnt++)
 
 #define Py_DECREF(op)                                   \
     do {                                                \
+        PyObject *_py_decref_tmp = (PyObject *)(op);    \
         if (_Py_DEC_REFTOTAL  _Py_REF_DEBUG_COMMA       \
-        --((PyObject*)(op))->ob_refcnt != 0)            \
-            _Py_CHECK_REFCNT(op)                        \
+        --(_py_decref_tmp)->ob_refcnt != 0)             \
+            _Py_CHECK_REFCNT(_py_decref_tmp)            \
         else                                            \
-        _Py_Dealloc((PyObject *)(op));                  \
+        _Py_Dealloc(_py_decref_tmp);                    \
     } while (0)
 
 /* Safely decref `op` and set `op` to NULL, especially useful in tp_clear
@@ -813,16 +814,27 @@
  */
 #define Py_CLEAR(op)                            \
     do {                                        \
-        if (op) {                               \
-            PyObject *_py_tmp = (PyObject *)(op);               \
+        PyObject *_py_tmp = (PyObject *)(op);   \
+        if (_py_tmp != NULL) {                  \
             (op) = NULL;                        \
             Py_DECREF(_py_tmp);                 \
         }                                       \
     } while (0)
 
 /* Macros to use in case the object pointer may be NULL: */
-#define Py_XINCREF(op) do { if ((op) == NULL) ; else Py_INCREF(op); } while (0)
-#define Py_XDECREF(op) do { if ((op) == NULL) ; else Py_DECREF(op); } while (0)
+#define Py_XINCREF(op)                                \
+    do {                                              \
+        PyObject *_py_xincref_tmp = (PyObject *)(op); \
+        if (_py_xincref_tmp != NULL)                  \
+            Py_INCREF(_py_xincref_tmp);               \
+    } while (0)
+
+#define Py_XDECREF(op)                                \
+    do {                                              \
+        PyObject *_py_xdecref_tmp = (PyObject *)(op); \
+        if (_py_xdecref_tmp != NULL)                  \
+            Py_DECREF(_py_xdecref_tmp);               \
+    } while (0)
 
 /*
 These are provided as conveniences to Python runtime embedders, so that
diff --git a/Include/objimpl.h b/Include/objimpl.h
index c6b7df4..3f21b70 100644
--- a/Include/objimpl.h
+++ b/Include/objimpl.h
@@ -94,51 +94,27 @@
    the object gets initialized via PyObject_{Init, InitVar} after obtaining
    the raw memory.
 */
-PyAPI_FUNC(void *) PyObject_Malloc(size_t);
-PyAPI_FUNC(void *) PyObject_Realloc(void *, size_t);
-PyAPI_FUNC(void) PyObject_Free(void *);
+PyAPI_FUNC(void *) PyObject_Malloc(size_t size);
+PyAPI_FUNC(void *) PyObject_Realloc(void *ptr, size_t new_size);
+PyAPI_FUNC(void) PyObject_Free(void *ptr);
 
+/* This function returns the number of allocated memory blocks, regardless of size */
+PyAPI_FUNC(Py_ssize_t) _Py_GetAllocatedBlocks(void);
 
 /* Macros */
 #ifdef WITH_PYMALLOC
 #ifndef Py_LIMITED_API
 PyAPI_FUNC(void) _PyObject_DebugMallocStats(FILE *out);
 #endif /* #ifndef Py_LIMITED_API */
-#ifdef PYMALLOC_DEBUG   /* WITH_PYMALLOC && PYMALLOC_DEBUG */
-PyAPI_FUNC(void *) _PyObject_DebugMalloc(size_t nbytes);
-PyAPI_FUNC(void *) _PyObject_DebugRealloc(void *p, size_t nbytes);
-PyAPI_FUNC(void) _PyObject_DebugFree(void *p);
-PyAPI_FUNC(void) _PyObject_DebugDumpAddress(const void *p);
-PyAPI_FUNC(void) _PyObject_DebugCheckAddress(const void *p);
-PyAPI_FUNC(void *) _PyObject_DebugMallocApi(char api, size_t nbytes);
-PyAPI_FUNC(void *) _PyObject_DebugReallocApi(char api, void *p, size_t nbytes);
-PyAPI_FUNC(void) _PyObject_DebugFreeApi(char api, void *p);
-PyAPI_FUNC(void) _PyObject_DebugCheckAddressApi(char api, const void *p);
-PyAPI_FUNC(void *) _PyMem_DebugMalloc(size_t nbytes);
-PyAPI_FUNC(void *) _PyMem_DebugRealloc(void *p, size_t nbytes);
-PyAPI_FUNC(void) _PyMem_DebugFree(void *p);
-#define PyObject_MALLOC         _PyObject_DebugMalloc
-#define PyObject_Malloc         _PyObject_DebugMalloc
-#define PyObject_REALLOC        _PyObject_DebugRealloc
-#define PyObject_Realloc        _PyObject_DebugRealloc
-#define PyObject_FREE           _PyObject_DebugFree
-#define PyObject_Free           _PyObject_DebugFree
+#endif
 
-#else   /* WITH_PYMALLOC && ! PYMALLOC_DEBUG */
+/* Macros */
 #define PyObject_MALLOC         PyObject_Malloc
 #define PyObject_REALLOC        PyObject_Realloc
 #define PyObject_FREE           PyObject_Free
-#endif
-
-#else   /* ! WITH_PYMALLOC */
-#define PyObject_MALLOC         PyMem_MALLOC
-#define PyObject_REALLOC        PyMem_REALLOC
-#define PyObject_FREE           PyMem_FREE
-
-#endif  /* WITH_PYMALLOC */
-
 #define PyObject_Del            PyObject_Free
-#define PyObject_DEL            PyObject_FREE
+#define PyObject_DEL            PyObject_Free
+
 
 /*
  * Generic object allocator interface
@@ -222,6 +198,26 @@
    constructor you would start directly with PyObject_Init/InitVar
 */
 
+#ifndef Py_LIMITED_API
+typedef struct {
+    /* user context passed as the first argument to the 2 functions */
+    void *ctx;
+
+    /* allocate an arena of size bytes */
+    void* (*alloc) (void *ctx, size_t size);
+
+    /* free an arena */
+    void (*free) (void *ctx, void *ptr, size_t size);
+} PyObjectArenaAllocator;
+
+/* Get the arena allocator. */
+PyAPI_FUNC(void) PyObject_GetArenaAllocator(PyObjectArenaAllocator *allocator);
+
+/* Set the arena allocator. */
+PyAPI_FUNC(void) PyObject_SetArenaAllocator(PyObjectArenaAllocator *allocator);
+#endif
+
+
 /*
  * Garbage Collection Support
  * ==========================
@@ -230,6 +226,10 @@
 /* C equivalent of gc.collect(). */
 PyAPI_FUNC(Py_ssize_t) PyGC_Collect(void);
 
+#ifndef Py_LIMITED_API
+PyAPI_FUNC(Py_ssize_t) _PyGC_CollectNoFail(void);
+#endif
+
 /* Test if a type has a GC head */
 #define PyType_IS_GC(t) PyType_HasFeature((t), Py_TPFLAGS_HAVE_GC)
 
@@ -249,13 +249,37 @@
         union _gc_head *gc_prev;
         Py_ssize_t gc_refs;
     } gc;
-    long double dummy;  /* force worst-case alignment */
+    double dummy;  /* force worst-case alignment */
 } PyGC_Head;
 
 extern PyGC_Head *_PyGC_generation0;
 
 #define _Py_AS_GC(o) ((PyGC_Head *)(o)-1)
 
+/* Bit 0 is set when tp_finalize is called */
+#define _PyGC_REFS_MASK_FINALIZED  (1 << 0)
+/* The (N-1) most significant bits contain the gc state / refcount */
+#define _PyGC_REFS_SHIFT           (1)
+#define _PyGC_REFS_MASK            (((size_t) -1) << _PyGC_REFS_SHIFT)
+
+#define _PyGCHead_REFS(g) ((g)->gc.gc_refs >> _PyGC_REFS_SHIFT)
+#define _PyGCHead_SET_REFS(g, v) do { \
+    (g)->gc.gc_refs = ((g)->gc.gc_refs & ~_PyGC_REFS_MASK) \
+        | (((size_t)(v)) << _PyGC_REFS_SHIFT);             \
+    } while (0)
+#define _PyGCHead_DECREF(g) ((g)->gc.gc_refs -= 1 << _PyGC_REFS_SHIFT)
+
+#define _PyGCHead_FINALIZED(g) (((g)->gc.gc_refs & _PyGC_REFS_MASK_FINALIZED) != 0)
+#define _PyGCHead_SET_FINALIZED(g, v) do {  \
+    (g)->gc.gc_refs = ((g)->gc.gc_refs & ~_PyGC_REFS_MASK_FINALIZED) \
+        | (v != 0); \
+    } while (0)
+
+#define _PyGC_FINALIZED(o) _PyGCHead_FINALIZED(_Py_AS_GC(o))
+#define _PyGC_SET_FINALIZED(o, v) _PyGCHead_SET_FINALIZED(_Py_AS_GC(o), v)
+
+#define _PyGC_REFS(o) _PyGCHead_REFS(_Py_AS_GC(o))
+
 #define _PyGC_REFS_UNTRACKED                    (-2)
 #define _PyGC_REFS_REACHABLE                    (-3)
 #define _PyGC_REFS_TENTATIVELY_UNREACHABLE      (-4)
@@ -264,9 +288,9 @@
  * collector it must be safe to call the ob_traverse method. */
 #define _PyObject_GC_TRACK(o) do { \
     PyGC_Head *g = _Py_AS_GC(o); \
-    if (g->gc.gc_refs != _PyGC_REFS_UNTRACKED) \
+    if (_PyGCHead_REFS(g) != _PyGC_REFS_UNTRACKED) \
         Py_FatalError("GC object already tracked"); \
-    g->gc.gc_refs = _PyGC_REFS_REACHABLE; \
+    _PyGCHead_SET_REFS(g, _PyGC_REFS_REACHABLE); \
     g->gc.gc_next = _PyGC_generation0; \
     g->gc.gc_prev = _PyGC_generation0->gc.gc_prev; \
     g->gc.gc_prev->gc.gc_next = g; \
@@ -279,8 +303,8 @@
  */
 #define _PyObject_GC_UNTRACK(o) do { \
     PyGC_Head *g = _Py_AS_GC(o); \
-    assert(g->gc.gc_refs != _PyGC_REFS_UNTRACKED); \
-    g->gc.gc_refs = _PyGC_REFS_UNTRACKED; \
+    assert(_PyGCHead_REFS(g) != _PyGC_REFS_UNTRACKED); \
+    _PyGCHead_SET_REFS(g, _PyGC_REFS_UNTRACKED); \
     g->gc.gc_prev->gc.gc_next = g->gc.gc_next; \
     g->gc.gc_next->gc.gc_prev = g->gc.gc_prev; \
     g->gc.gc_next = NULL; \
@@ -288,7 +312,7 @@
 
 /* True if the object is currently tracked by the GC. */
 #define _PyObject_GC_IS_TRACKED(o) \
-    ((_Py_AS_GC(o))->gc.gc_refs != _PyGC_REFS_UNTRACKED)
+    (_PyGC_REFS(o) != _PyGC_REFS_UNTRACKED)
 
 /* True if the object may be tracked by the GC in the future, or already is.
    This can be useful to implement some optimizations. */
diff --git a/Include/opcode.h b/Include/opcode.h
index a90184d..0936f2d 100644
--- a/Include/opcode.h
+++ b/Include/opcode.h
@@ -49,7 +49,6 @@
 #define BINARY_OR       66
 #define INPLACE_POWER   67
 #define GET_ITER        68
-#define STORE_LOCALS    69
 #define PRINT_EXPR      70
 #define LOAD_BUILD_CLASS 71
 #define YIELD_FROM      72
@@ -140,6 +139,7 @@
 #define SET_ADD         146
 #define MAP_ADD         147
 
+#define LOAD_CLASSDEREF   148
 
 /* EXCEPT_HANDLER is a special, implicit block type which is created when
    entering an except handler. It is not an opcode but we define it here
diff --git a/Include/osdefs.h b/Include/osdefs.h
index 05c0c8e..0c2e34b 100644
--- a/Include/osdefs.h
+++ b/Include/osdefs.h
@@ -9,16 +9,10 @@
 
 /* Mod by chrish: QNX has WATCOM, but isn't DOS */
 #if !defined(__QNX__)
-#if defined(MS_WINDOWS) || defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__DJGPP__) || defined(PYOS_OS2)
-#if defined(PYOS_OS2) && defined(PYCC_GCC)
-#define MAXPATHLEN 260
-#define SEP L'/'
-#define ALTSEP L'\\'
-#else
+#if defined(MS_WINDOWS) || defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__DJGPP__)
 #define SEP L'\\'
 #define ALTSEP L'/'
 #define MAXPATHLEN 256
-#endif
 #define DELIM L';'
 #endif
 #endif
diff --git a/Include/parsetok.h b/Include/parsetok.h
index 911dfc1..2acb854 100644
--- a/Include/parsetok.h
+++ b/Include/parsetok.h
@@ -38,29 +38,49 @@
 PyAPI_FUNC(node *) PyParser_ParseString(const char *, grammar *, int,
                                               perrdetail *);
 PyAPI_FUNC(node *) PyParser_ParseFile (FILE *, const char *, grammar *, int,
-                                             char *, char *, perrdetail *);
+                                             const char *, const char *,
+                                             perrdetail *);
 
 PyAPI_FUNC(node *) PyParser_ParseStringFlags(const char *, grammar *, int,
                                               perrdetail *, int);
-PyAPI_FUNC(node *) PyParser_ParseFileFlags(FILE *, const char *,
-					   const char*, grammar *,
-						 int, char *, char *,
-						 perrdetail *, int);
+PyAPI_FUNC(node *) PyParser_ParseFileFlags(
+    FILE *fp,
+    const char *filename,       /* decoded from the filesystem encoding */
+    const char *enc,
+    grammar *g,
+    int start,
+    const char *ps1,
+    const char *ps2,
+    perrdetail *err_ret,
+    int flags);
 PyAPI_FUNC(node *) PyParser_ParseFileFlagsEx(
     FILE *fp,
     const char *filename,       /* decoded from the filesystem encoding */
     const char *enc,
     grammar *g,
     int start,
-    char *ps1,
-    char *ps2,
+    const char *ps1,
+    const char *ps2,
+    perrdetail *err_ret,
+    int *flags);
+PyAPI_FUNC(node *) PyParser_ParseFileObject(
+    FILE *fp,
+    PyObject *filename,
+    const char *enc,
+    grammar *g,
+    int start,
+    const char *ps1,
+    const char *ps2,
     perrdetail *err_ret,
     int *flags);
 
-PyAPI_FUNC(node *) PyParser_ParseStringFlagsFilename(const char *,
-					      const char *,
-					      grammar *, int,
-                                              perrdetail *, int);
+PyAPI_FUNC(node *) PyParser_ParseStringFlagsFilename(
+    const char *s,
+    const char *filename,       /* decoded from the filesystem encoding */
+    grammar *g,
+    int start,
+    perrdetail *err_ret,
+    int flags);
 PyAPI_FUNC(node *) PyParser_ParseStringFlagsFilenameEx(
     const char *s,
     const char *filename,       /* decoded from the filesystem encoding */
@@ -68,6 +88,13 @@
     int start,
     perrdetail *err_ret,
     int *flags);
+PyAPI_FUNC(node *) PyParser_ParseStringObject(
+    const char *s,
+    PyObject *filename,
+    grammar *g,
+    int start,
+    perrdetail *err_ret,
+    int *flags);
 
 /* Note that the following functions are defined in pythonrun.c,
    not in parsetok.c */
diff --git a/Include/patchlevel.h b/Include/patchlevel.h
index 721666c..ee45177 100644
--- a/Include/patchlevel.h
+++ b/Include/patchlevel.h
@@ -17,13 +17,13 @@
 /* Version parsed out into numeric values */
 /*--start constants--*/
 #define PY_MAJOR_VERSION	3
-#define PY_MINOR_VERSION	3
-#define PY_MICRO_VERSION	6
+#define PY_MINOR_VERSION	4
+#define PY_MICRO_VERSION	2
 #define PY_RELEASE_LEVEL	PY_RELEASE_LEVEL_FINAL
 #define PY_RELEASE_SERIAL	0
 
 /* Version as a string */
-#define PY_VERSION      	"3.3.6"
+#define PY_VERSION      	"3.4.2+"
 /*--end constants--*/
 
 /* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2.
diff --git a/Include/pydebug.h b/Include/pydebug.h
index 97c2f8c..8fe9818 100644
--- a/Include/pydebug.h
+++ b/Include/pydebug.h
@@ -20,6 +20,7 @@
 PyAPI_DATA(int) Py_NoUserSiteDirectory;
 PyAPI_DATA(int) Py_UnbufferedStdioFlag;
 PyAPI_DATA(int) Py_HashRandomizationFlag;
+PyAPI_DATA(int) Py_IsolatedFlag;
 
 /* this is a wrapper around getenv() that pays attention to
    Py_IgnoreEnvironmentFlag.  It should be used for getting variables like
diff --git a/Include/pyerrors.h b/Include/pyerrors.h
index e385123..02f65d6 100644
--- a/Include/pyerrors.h
+++ b/Include/pyerrors.h
@@ -53,6 +53,7 @@
     PyObject *myerrno;
     PyObject *strerror;
     PyObject *filename;
+    PyObject *filename2;
 #ifdef MS_WINDOWS
     PyObject *winerror;
 #endif
@@ -75,6 +76,9 @@
 
 PyAPI_FUNC(void) PyErr_SetNone(PyObject *);
 PyAPI_FUNC(void) PyErr_SetObject(PyObject *, PyObject *);
+#ifndef Py_LIMITED_API
+PyAPI_FUNC(void) _PyErr_SetKeyError(PyObject *);
+#endif
 PyAPI_FUNC(void) PyErr_SetString(
     PyObject *exception,
     const char *string   /* decoded from utf-8 */
@@ -119,7 +123,9 @@
 /* Context manipulation (PEP 3134) */
 PyAPI_FUNC(PyObject *) PyException_GetContext(PyObject *);
 PyAPI_FUNC(void) PyException_SetContext(PyObject *, PyObject *);
-
+#ifndef Py_LIMITED_API
+PyAPI_FUNC(void) _PyErr_ChainExceptions(PyObject *, PyObject *, PyObject *);
+#endif
 
 /* */
 
@@ -198,9 +204,6 @@
 #ifdef MS_WINDOWS
 PyAPI_DATA(PyObject *) PyExc_WindowsError;
 #endif
-#ifdef __VMS
-PyAPI_DATA(PyObject *) PyExc_VMSError;
-#endif
 
 PyAPI_DATA(PyObject *) PyExc_RecursionErrorInst;
 
@@ -225,6 +228,8 @@
 PyAPI_FUNC(PyObject *) PyErr_SetFromErrno(PyObject *);
 PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilenameObject(
     PyObject *, PyObject *);
+PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilenameObjects(
+    PyObject *, PyObject *, PyObject *);
 PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilename(
     PyObject *exc,
     const char *filename   /* decoded from the filesystem encoding */
@@ -253,6 +258,8 @@
 PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErr(int);
 PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilenameObject(
     PyObject *,int, PyObject *);
+PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilenameObjects(
+    PyObject *,int, PyObject *, PyObject *);
 PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilename(
     PyObject *exc,
     int ierr,
@@ -284,6 +291,28 @@
     const char *name, const char *doc, PyObject *base, PyObject *dict);
 PyAPI_FUNC(void) PyErr_WriteUnraisable(PyObject *);
 
+/* In exceptions.c */
+#ifndef Py_LIMITED_API
+/* Helper that attempts to replace the current exception with one of the
+ * same type but with a prefix added to the exception text. The resulting
+ * exception description looks like:
+ *
+ *     prefix (exc_type: original_exc_str)
+ *
+ * Only some exceptions can be safely replaced. If the function determines
+ * it isn't safe to perform the replacement, it will leave the original
+ * unmodified exception in place.
+ *
+ * Returns a borrowed reference to the new exception (if any), NULL if the
+ * existing exception was left in place.
+ */
+PyAPI_FUNC(PyObject *) _PyErr_TrySetFromCause(
+    const char *prefix_format,   /* ASCII-encoded string  */
+    ...
+    );
+#endif
+
+
 /* In sigcheck.c or signalmodule.c */
 PyAPI_FUNC(int) PyErr_CheckSignals(void);
 PyAPI_FUNC(void) PyErr_SetInterrupt(void);
@@ -301,9 +330,20 @@
     const char *filename,       /* decoded from the filesystem encoding */
     int lineno,
     int col_offset);
+#ifndef Py_LIMITED_API
+PyAPI_FUNC(void) PyErr_SyntaxLocationObject(
+    PyObject *filename,
+    int lineno,
+    int col_offset);
+#endif
 PyAPI_FUNC(PyObject *) PyErr_ProgramText(
     const char *filename,       /* decoded from the filesystem encoding */
     int lineno);
+#ifndef Py_LIMITED_API
+PyAPI_FUNC(PyObject *) PyErr_ProgramTextObject(
+    PyObject *filename,
+    int lineno);
+#endif
 
 /* The following functions are used to create and modify unicode
    exceptions from C */
diff --git a/Include/pyhash.h b/Include/pyhash.h
new file mode 100644
index 0000000..a7ca937
--- /dev/null
+++ b/Include/pyhash.h
@@ -0,0 +1,149 @@
+#ifndef Py_HASH_H
+
+#define Py_HASH_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Helpers for hash functions */
+#ifndef Py_LIMITED_API
+PyAPI_FUNC(Py_hash_t) _Py_HashDouble(double);
+PyAPI_FUNC(Py_hash_t) _Py_HashPointer(void*);
+PyAPI_FUNC(Py_hash_t) _Py_HashBytes(const void*, Py_ssize_t);
+#endif
+
+/* Prime multiplier used in string and various other hashes. */
+#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
+   reduction modulo the prime 2**_PyHASH_BITS - 1. */
+
+#if SIZEOF_VOID_P >= 8
+#  define _PyHASH_BITS 61
+#else
+#  define _PyHASH_BITS 31
+#endif
+
+#define _PyHASH_MODULUS (((size_t)1 << _PyHASH_BITS) - 1)
+#define _PyHASH_INF 314159
+#define _PyHASH_NAN 0
+#define _PyHASH_IMAG _PyHASH_MULTIPLIER
+
+
+/* hash secret
+ *
+ * memory layout on 64 bit systems
+ *   cccccccc cccccccc cccccccc  uc -- unsigned char[24]
+ *   pppppppp ssssssss ........  fnv -- two Py_hash_t
+ *   k0k0k0k0 k1k1k1k1 ........  siphash -- two PY_UINT64_T
+ *   ........ ........ ssssssss  djbx33a -- 16 bytes padding + one Py_hash_t
+ *   ........ ........ eeeeeeee  pyexpat XML hash salt
+ *
+ * memory layout on 32 bit systems
+ *   cccccccc cccccccc cccccccc  uc
+ *   ppppssss ........ ........  fnv -- two Py_hash_t
+ *   k0k0k0k0 k1k1k1k1 ........  siphash -- two PY_UINT64_T (*)
+ *   ........ ........ ssss....  djbx33a -- 16 bytes padding + one Py_hash_t
+ *   ........ ........ eeee....  pyexpat XML hash salt
+ *
+ * (*) The siphash member may not be available on 32 bit platforms without
+ *     an unsigned int64 data type.
+ */
+#ifndef Py_LIMITED_API
+typedef union {
+    /* ensure 24 bytes */
+    unsigned char uc[24];
+    /* two Py_hash_t for FNV */
+    struct {
+        Py_hash_t prefix;
+        Py_hash_t suffix;
+    } fnv;
+#ifdef PY_UINT64_T
+    /* two uint64 for SipHash24 */
+    struct {
+        PY_UINT64_T k0;
+        PY_UINT64_T k1;
+    } siphash;
+#endif
+    /* a different (!) Py_hash_t for small string optimization */
+    struct {
+        unsigned char padding[16];
+        Py_hash_t suffix;
+    } djbx33a;
+    struct {
+        unsigned char padding[16];
+        Py_hash_t hashsalt;
+    } expat;
+} _Py_HashSecret_t;
+PyAPI_DATA(_Py_HashSecret_t) _Py_HashSecret;
+#endif
+
+#ifdef Py_DEBUG
+PyAPI_DATA(int) _Py_HashSecret_Initialized;
+#endif
+
+
+/* hash function definition */
+#ifndef Py_LIMITED_API
+typedef struct {
+    Py_hash_t (*const hash)(const void *, Py_ssize_t);
+    const char *name;
+    const int hash_bits;
+    const int seed_bits;
+} PyHash_FuncDef;
+
+PyAPI_FUNC(PyHash_FuncDef*) PyHash_GetFuncDef(void);
+#endif
+
+
+/* cutoff for small string DJBX33A optimization in range [1, cutoff).
+ *
+ * About 50% of the strings in a typical Python application are smaller than
+ * 6 to 7 chars. However DJBX33A is vulnerable to hash collision attacks.
+ * NEVER use DJBX33A for long strings!
+ *
+ * A Py_HASH_CUTOFF of 0 disables small string optimization. 32 bit platforms
+ * should use a smaller cutoff because it is easier to create colliding
+ * strings. A cutoff of 7 on 64bit platforms and 5 on 32bit platforms should
+ * provide a decent safety margin.
+ */
+#ifndef Py_HASH_CUTOFF
+#  define Py_HASH_CUTOFF 0
+#elif (Py_HASH_CUTOFF > 7 || Py_HASH_CUTOFF < 0)
+#  error Py_HASH_CUTOFF must in range 0...7.
+#endif /* Py_HASH_CUTOFF */
+
+
+/* hash algorithm selection
+ *
+ * The values for Py_HASH_SIPHASH24 and Py_HASH_FNV are hard-coded in the
+ * configure script.
+ *
+ * - FNV is available on all platforms and architectures.
+ * - SIPHASH24 only works on plaforms that provide PY_UINT64_T and doesn't
+ *   require aligned memory for integers.
+ * - With EXTERNAL embedders can provide an alternative implementation with::
+ *
+ *     PyHash_FuncDef PyHash_Func = {...};
+ *
+ * XXX: Figure out __declspec() for extern PyHash_FuncDef.
+ */
+#define Py_HASH_EXTERNAL 0
+#define Py_HASH_SIPHASH24 1
+#define Py_HASH_FNV 2
+
+#ifndef Py_HASH_ALGORITHM
+#  if (defined(PY_UINT64_T) && defined(PY_UINT32_T) \
+       && !defined(HAVE_ALIGNED_REQUIRED))
+#    define Py_HASH_ALGORITHM Py_HASH_SIPHASH24
+#  else
+#    define Py_HASH_ALGORITHM Py_HASH_FNV
+#  endif /* uint64_t && uint32_t && aligned */
+#endif /* Py_HASH_ALGORITHM */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !Py_HASH_H */
diff --git a/Include/pymacro.h b/Include/pymacro.h
index 793f67d..7997c55 100644
--- a/Include/pymacro.h
+++ b/Include/pymacro.h
@@ -69,4 +69,10 @@
 /* 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)))
 
+#ifdef __GNUC__
+#define Py_UNUSED(name) _unused_ ## name __attribute__((unused))
+#else
+#define Py_UNUSED(name) _unused_ ## name
+#endif
+
 #endif /* Py_PYMACRO_H */
diff --git a/Include/pymem.h b/Include/pymem.h
index 10b5bea..2372b86 100644
--- a/Include/pymem.h
+++ b/Include/pymem.h
@@ -11,6 +11,13 @@
 extern "C" {
 #endif
 
+#ifndef Py_LIMITED_API
+PyAPI_FUNC(void *) PyMem_RawMalloc(size_t size);
+PyAPI_FUNC(void *) PyMem_RawRealloc(void *ptr, size_t new_size);
+PyAPI_FUNC(void) PyMem_RawFree(void *ptr);
+#endif
+
+
 /* BEWARE:
 
    Each interface exports both functions and macros.  Extension modules should
@@ -49,21 +56,16 @@
    performed on failure (no exception is set, no warning is printed, etc).
 */
 
-PyAPI_FUNC(void *) PyMem_Malloc(size_t);
-PyAPI_FUNC(void *) PyMem_Realloc(void *, size_t);
-PyAPI_FUNC(void) PyMem_Free(void *);
+PyAPI_FUNC(void *) PyMem_Malloc(size_t size);
+PyAPI_FUNC(void *) PyMem_Realloc(void *ptr, size_t new_size);
+PyAPI_FUNC(void) PyMem_Free(void *ptr);
 
-/* Starting from Python 1.6, the wrappers Py_{Malloc,Realloc,Free} are
-   no longer supported. They used to call PyErr_NoMemory() on failure. */
+#ifndef Py_LIMITED_API
+PyAPI_FUNC(char *) _PyMem_RawStrdup(const char *str);
+PyAPI_FUNC(char *) _PyMem_Strdup(const char *str);
+#endif
 
 /* Macros. */
-#ifdef PYMALLOC_DEBUG
-/* Redirect all memory operations to Python's debugging allocator. */
-#define PyMem_MALLOC		_PyMem_DebugMalloc
-#define PyMem_REALLOC		_PyMem_DebugRealloc
-#define PyMem_FREE		_PyMem_DebugFree
-
-#else	/* ! PYMALLOC_DEBUG */
 
 /* PyMem_MALLOC(0) means malloc(1). Some systems would return NULL
    for malloc(0), which would be treated as an error. Some platforms
@@ -71,13 +73,9 @@
    pymalloc. To solve these problems, allocate an extra byte. */
 /* Returns NULL to indicate error if a negative size or size larger than
    Py_ssize_t can represent is supplied.  Helps prevents security holes. */
-#define PyMem_MALLOC(n)		((size_t)(n) > (size_t)PY_SSIZE_T_MAX ? NULL \
-				: malloc((n) ? (n) : 1))
-#define PyMem_REALLOC(p, n)	((size_t)(n) > (size_t)PY_SSIZE_T_MAX  ? NULL \
-				: realloc((p), (n) ? (n) : 1))
-#define PyMem_FREE		free
-
-#endif	/* PYMALLOC_DEBUG */
+#define PyMem_MALLOC(n)         PyMem_Malloc(n)
+#define PyMem_REALLOC(p, n)     PyMem_Realloc(p, n)
+#define PyMem_FREE(p)           PyMem_Free(p)
 
 /*
  * Type-oriented memory interface
@@ -115,6 +113,69 @@
 #define PyMem_Del		PyMem_Free
 #define PyMem_DEL		PyMem_FREE
 
+#ifndef Py_LIMITED_API
+typedef enum {
+    /* PyMem_RawMalloc(), PyMem_RawRealloc() and PyMem_RawFree() */
+    PYMEM_DOMAIN_RAW,
+
+    /* PyMem_Malloc(), PyMem_Realloc() and PyMem_Free() */
+    PYMEM_DOMAIN_MEM,
+
+    /* PyObject_Malloc(), PyObject_Realloc() and PyObject_Free() */
+    PYMEM_DOMAIN_OBJ
+} PyMemAllocatorDomain;
+
+typedef struct {
+    /* user context passed as the first argument to the 3 functions */
+    void *ctx;
+
+    /* allocate a memory block */
+    void* (*malloc) (void *ctx, size_t size);
+
+    /* allocate or resize a memory block */
+    void* (*realloc) (void *ctx, void *ptr, size_t new_size);
+
+    /* release a memory block */
+    void (*free) (void *ctx, void *ptr);
+} PyMemAllocator;
+
+/* Get the memory block allocator of the specified domain. */
+PyAPI_FUNC(void) PyMem_GetAllocator(PyMemAllocatorDomain domain,
+                                    PyMemAllocator *allocator);
+
+/* Set the memory block allocator of the specified domain.
+
+   The new allocator must return a distinct non-NULL pointer when requesting
+   zero bytes.
+
+   For the PYMEM_DOMAIN_RAW domain, the allocator must be thread-safe: the GIL
+   is not held when the allocator is called.
+
+   If the new allocator is not a hook (don't call the previous allocator), the
+   PyMem_SetupDebugHooks() function must be called to reinstall the debug hooks
+   on top on the new allocator. */
+PyAPI_FUNC(void) PyMem_SetAllocator(PyMemAllocatorDomain domain,
+                                    PyMemAllocator *allocator);
+
+/* Setup hooks to detect bugs in the following Python memory allocator
+   functions:
+
+   - PyMem_RawMalloc(), PyMem_RawRealloc(), PyMem_RawFree()
+   - PyMem_Malloc(), PyMem_Realloc(), PyMem_Free()
+   - PyObject_Malloc(), PyObject_Realloc() and PyObject_Free()
+
+   Newly allocated memory is filled with the byte 0xCB, freed memory is filled
+   with the byte 0xDB. Additionnal checks:
+
+   - detect API violations, ex: PyObject_Free() called on a buffer allocated
+     by PyMem_Malloc()
+   - detect write before the start of the buffer (buffer underflow)
+   - detect write after the end of the buffer (buffer overflow)
+
+   The function does nothing if Python is not compiled is debug mode. */
+PyAPI_FUNC(void) PyMem_SetupDebugHooks(void);
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/Include/pyport.h b/Include/pyport.h
index a5edea9..c706213 100644
--- a/Include/pyport.h
+++ b/Include/pyport.h
@@ -144,23 +144,6 @@
 #endif
 #endif
 
-/* Prime multiplier used in string and various other hashes. */
-#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
-   reduction modulo the prime 2**_PyHASH_BITS - 1. */
-
-#if SIZEOF_VOID_P >= 8
-#define _PyHASH_BITS 61
-#else
-#define _PyHASH_BITS 31
-#endif
-#define _PyHASH_MODULUS (((size_t)1 << _PyHASH_BITS) - 1)
-#define _PyHASH_INF 314159
-#define _PyHASH_NAN 0
-#define _PyHASH_IMAG _PyHASH_MULTIPLIER
-
 /* uintptr_t is the C9X name for an unsigned integral type such that a
  * legitimate void* can be cast to uintptr_t and then back to void* again
  * without loss of information.  Similarly for intptr_t, wrt a signed
@@ -199,10 +182,19 @@
 #endif
 
 /* Py_hash_t is the same size as a pointer. */
+#define SIZEOF_PY_HASH_T SIZEOF_SIZE_T
 typedef Py_ssize_t Py_hash_t;
 /* Py_uhash_t is the unsigned equivalent needed to calculate numeric hash. */
+#define SIZEOF_PY_UHASH_T SIZEOF_SIZE_T
 typedef size_t Py_uhash_t;
 
+/* Only used for compatibility with code that may not be PY_SSIZE_T_CLEAN. */
+#ifdef PY_SSIZE_T_CLEAN
+typedef Py_ssize_t Py_ssize_clean_t;
+#else
+typedef int Py_ssize_clean_t;
+#endif
+
 /* Largest possible value of size_t.
    SIZE_MAX is part of C99, so it might be defined on some
    platforms. If it is not defined, (size_t)-1 is a portable
@@ -219,10 +211,6 @@
 /* Smallest negative value of type Py_ssize_t. */
 #define PY_SSIZE_T_MIN (-PY_SSIZE_T_MAX-1)
 
-#if SIZEOF_PID_T > SIZEOF_LONG
-#   error "Python doesn't support sizeof(pid_t) > sizeof(long)"
-#endif
-
 /* PY_FORMAT_SIZE_T is a platform-specific modifier for use in a printf
  * format to convert an argument with the width of a size_t or Py_ssize_t.
  * C99 introduced "z" for this purpose, but not all platforms support that;
@@ -267,7 +255,7 @@
  */
 #ifdef HAVE_LONG_LONG
 #   ifndef PY_FORMAT_LONG_LONG
-#       if defined(MS_WIN64) || defined(MS_WINDOWS)
+#       ifdef MS_WINDOWS
 #           define PY_FORMAT_LONG_LONG "I64"
 #       else
 #           error "This platform's pyconfig.h needs to define PY_FORMAT_LONG_LONG"
@@ -392,17 +380,20 @@
 #endif
 
 #ifdef HAVE_SYS_STAT_H
-#if defined(PYOS_OS2) && defined(PYCC_GCC)
-#include <sys/types.h>
-#endif
 #include <sys/stat.h>
 #elif defined(HAVE_STAT_H)
 #include <stat.h>
 #endif
 
-#if defined(PYCC_VACPP)
+#ifndef S_IFMT
 /* VisualAge C/C++ Failed to Define MountType Field in sys/stat.h */
-#define S_IFMT (S_IFDIR|S_IFCHR|S_IFREG)
+#define S_IFMT 0170000
+#endif
+
+#ifndef S_IFLNK
+/* Windows doesn't define S_IFLNK but posixmodule.c maps
+ * IO_REPARSE_TAG_SYMLINK to S_IFLNK */
+#  define S_IFLNK 0120000
 #endif
 
 #ifndef S_ISREG
@@ -413,6 +404,9 @@
 #define S_ISDIR(x) (((x) & S_IFMT) == S_IFDIR)
 #endif
 
+#ifndef S_ISCHR
+#define S_ISCHR(x) (((x) & S_IFMT) == S_IFCHR)
+#endif
 
 #ifdef __cplusplus
 /* Move this down here since some C++ #include's don't like to be included
@@ -835,15 +829,6 @@
 #endif
 
 /*
- * Add PyArg_ParseTuple format where available.
- */
-#ifdef HAVE_ATTRIBUTE_FORMAT_PARSETUPLE
-#define Py_FORMAT_PARSETUPLE(func,p1,p2) __attribute__((format(func,p1,p2)))
-#else
-#define Py_FORMAT_PARSETUPLE(func,p1,p2)
-#endif
-
-/*
  * Specify alignment on compilers that support it.
  */
 #if defined(__GNUC__) && __GNUC__ >= 3
@@ -881,4 +866,18 @@
 #endif
 #endif
 
+/*
+ * Convenient macros to deal with endianness of the platform. WORDS_BIGENDIAN is
+ * detected by configure and defined in pyconfig.h. The code in pyconfig.h
+ * also takes care of Apple's universal builds.
+ */
+
+#ifdef WORDS_BIGENDIAN
+#define PY_BIG_ENDIAN 1
+#define PY_LITTLE_ENDIAN 0
+#else
+#define PY_BIG_ENDIAN 0
+#define PY_LITTLE_ENDIAN 1
+#endif
+
 #endif /* Py_PYPORT_H */
diff --git a/Include/pystate.h b/Include/pystate.h
index 2017b02..4992c22 100644
--- a/Include/pystate.h
+++ b/Include/pystate.h
@@ -33,7 +33,6 @@
     int codecs_initialized;
     int fscodec_initialized;
 
-
 #ifdef HAVE_DLOPEN
     int dlopenflags;
 #endif
@@ -41,6 +40,7 @@
     int tscdump;
 #endif
 
+    PyObject *builtins_copy;
 } PyInterpreterState;
 #endif
 
@@ -69,6 +69,7 @@
 typedef struct _ts {
     /* See Python/ceval.c for comments explaining most fields */
 
+    struct _ts *prev;
     struct _ts *next;
     PyInterpreterState *interp;
 
@@ -99,16 +100,6 @@
 
     PyObject *dict;  /* Stores per-thread state */
 
-    /* XXX doesn't mean anything anymore (the comment below is obsolete)
-       => deprecate or remove? */
-    /* tick_counter is incremented whenever the check_interval ticker
-     * reaches zero. The purpose is to give a useful measure of the number
-     * of interpreted bytecode instructions in a given thread.  This
-     * extremely lightweight statistic collector may be of interest to
-     * profilers (like psyco.jit()), although nothing in the core uses it.
-     */
-    int tick_counter;
-
     int gilstate_counter;
 
     PyObject *async_exc; /* Asynchronous exception to raise */
@@ -117,6 +108,32 @@
     int trash_delete_nesting;
     PyObject *trash_delete_later;
 
+    /* Called when a thread state is deleted normally, but not when it
+     * is destroyed after fork().
+     * Pain:  to prevent rare but fatal shutdown errors (issue 18808),
+     * Thread.join() must wait for the join'ed thread's tstate to be unlinked
+     * from the tstate chain.  That happens at the end of a thread's life,
+     * in pystate.c.
+     * The obvious way doesn't quite work:  create a lock which the tstate
+     * unlinking code releases, and have Thread.join() wait to acquire that
+     * lock.  The problem is that we _are_ at the end of the thread's life:
+     * if the thread holds the last reference to the lock, decref'ing the
+     * lock will delete the lock, and that may trigger arbitrary Python code
+     * if there's a weakref, with a callback, to the lock.  But by this time
+     * _PyThreadState_Current is already NULL, so only the simplest of C code
+     * can be allowed to run (in particular it must not be possible to
+     * release the GIL).
+     * So instead of holding the lock directly, the tstate holds a weakref to
+     * the lock:  that's the value of on_delete_data below.  Decref'ing a
+     * weakref is harmless.
+     * on_delete points to _threadmodule.c's static release_sentinel() function.
+     * After the tstate is unlinked, release_sentinel is called with the
+     * weakref-to-lock (on_delete_data) argument, and release_sentinel releases
+     * the indirectly held lock.
+     */
+    void (*on_delete)(void *);
+    void *on_delete_data;
+
     /* XXX signal handlers should also be here */
 
 } PyThreadState;
@@ -133,12 +150,16 @@
 PyAPI_FUNC(int) PyState_RemoveModule(struct PyModuleDef*);
 #endif
 PyAPI_FUNC(PyObject*) PyState_FindModule(struct PyModuleDef*);
+#ifndef Py_LIMITED_API
+PyAPI_FUNC(void) _PyState_ClearModules(void);
+#endif
 
 PyAPI_FUNC(PyThreadState *) PyThreadState_New(PyInterpreterState *);
 PyAPI_FUNC(PyThreadState *) _PyThreadState_Prealloc(PyInterpreterState *);
 PyAPI_FUNC(void) _PyThreadState_Init(PyThreadState *);
 PyAPI_FUNC(void) PyThreadState_Clear(PyThreadState *);
 PyAPI_FUNC(void) PyThreadState_Delete(PyThreadState *);
+PyAPI_FUNC(void) _PyThreadState_DeleteExcept(PyThreadState *tstate);
 #ifdef WITH_THREAD
 PyAPI_FUNC(void) PyThreadState_DeleteCurrent(void);
 PyAPI_FUNC(void) _PyGILState_Reinit(void);
@@ -212,6 +233,13 @@
 */
 PyAPI_FUNC(PyThreadState *) PyGILState_GetThisThreadState(void);
 
+/* Helper/diagnostic function - return 1 if the current thread
+ * currently holds the GIL, 0 otherwise
+ */
+#ifndef Py_LIMITED_API
+PyAPI_FUNC(int) PyGILState_Check(void);
+#endif
+
 #endif   /* #ifdef WITH_THREAD */
 
 /* The implementation of sys._current_frames()  Returns a dict mapping
diff --git a/Include/pythonrun.h b/Include/pythonrun.h
index e8a582d..2fc5578 100644
--- a/Include/pythonrun.h
+++ b/Include/pythonrun.h
@@ -28,6 +28,14 @@
 PyAPI_FUNC(void) Py_SetPythonHome(wchar_t *);
 PyAPI_FUNC(wchar_t *) Py_GetPythonHome(void);
 
+#ifndef Py_LIMITED_API
+/* Only used by applications that embed the interpreter and need to
+ * override the standard encoding determination mechanism
+ */
+PyAPI_FUNC(int) Py_SetStandardStreamEncoding(const char *encoding,
+                                             const char *errors);
+#endif
+
 PyAPI_FUNC(void) Py_Initialize(void);
 PyAPI_FUNC(void) Py_InitializeEx(int);
 #ifndef Py_LIMITED_API
@@ -55,6 +63,10 @@
     FILE *fp,
     const char *filename,       /* decoded from the filesystem encoding */
     PyCompilerFlags *flags);
+PyAPI_FUNC(int) PyRun_InteractiveOneObject(
+    FILE *fp,
+    PyObject *filename,
+    PyCompilerFlags *flags);
 PyAPI_FUNC(int) PyRun_InteractiveLoopFlags(
     FILE *fp,
     const char *filename,       /* decoded from the filesystem encoding */
@@ -66,6 +78,12 @@
     int start,
     PyCompilerFlags *flags,
     PyArena *arena);
+PyAPI_FUNC(struct _mod *) PyParser_ASTFromStringObject(
+    const char *s,
+    PyObject *filename,
+    int start,
+    PyCompilerFlags *flags,
+    PyArena *arena);
 PyAPI_FUNC(struct _mod *) PyParser_ASTFromFile(
     FILE *fp,
     const char *filename,       /* decoded from the filesystem encoding */
@@ -76,6 +94,16 @@
     PyCompilerFlags *flags,
     int *errcode,
     PyArena *arena);
+PyAPI_FUNC(struct _mod *) PyParser_ASTFromFileObject(
+    FILE *fp,
+    PyObject *filename,
+    const char* enc,
+    int start,
+    char *ps1,
+    char *ps2,
+    PyCompilerFlags *flags,
+    int *errcode,
+    PyArena *arena);
 #endif
 
 #ifndef PyParser_SimpleParseString
@@ -117,11 +145,22 @@
     int start,
     PyCompilerFlags *flags,
     int optimize);
+PyAPI_FUNC(PyObject *) Py_CompileStringObject(
+    const char *str,
+    PyObject *filename, int start,
+    PyCompilerFlags *flags,
+    int optimize);
 #endif
 PyAPI_FUNC(struct symtable *) Py_SymtableString(
     const char *str,
     const char *filename,       /* decoded from the filesystem encoding */
     int start);
+#ifndef Py_LIMITED_API
+PyAPI_FUNC(struct symtable *) Py_SymtableStringObject(
+    const char *str,
+    PyObject *filename,
+    int start);
+#endif
 
 PyAPI_FUNC(void) PyErr_Print(void);
 PyAPI_FUNC(void) PyErr_PrintEx(int);
@@ -197,7 +236,7 @@
 PyAPI_FUNC(void) _PyExc_Init(PyObject * bltinmod);
 PyAPI_FUNC(void) _PyImportHooks_Init(void);
 PyAPI_FUNC(int) _PyFrame_Init(void);
-PyAPI_FUNC(void) _PyFloat_Init(void);
+PyAPI_FUNC(int) _PyFloat_Init(void);
 PyAPI_FUNC(int) PyByteArray_Init(void);
 PyAPI_FUNC(void) _PyRandom_Init(void);
 #endif
@@ -217,19 +256,21 @@
 PyAPI_FUNC(void) PyByteArray_Fini(void);
 PyAPI_FUNC(void) PyFloat_Fini(void);
 PyAPI_FUNC(void) PyOS_FiniInterrupts(void);
+PyAPI_FUNC(void) _PyGC_DumpShutdownStats(void);
 PyAPI_FUNC(void) _PyGC_Fini(void);
 PyAPI_FUNC(void) PySlice_Fini(void);
 PyAPI_FUNC(void) _PyType_Fini(void);
+PyAPI_FUNC(void) _PyRandom_Fini(void);
 
 PyAPI_DATA(PyThreadState *) _Py_Finalizing;
 #endif
 
 /* Stuff with no proper home (yet) */
 #ifndef Py_LIMITED_API
-PyAPI_FUNC(char *) PyOS_Readline(FILE *, FILE *, char *);
+PyAPI_FUNC(char *) PyOS_Readline(FILE *, FILE *, const char *);
 #endif
 PyAPI_DATA(int) (*PyOS_InputHook)(void);
-PyAPI_DATA(char) *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, char *);
+PyAPI_DATA(char) *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, const char *);
 #ifndef Py_LIMITED_API
 PyAPI_DATA(PyThreadState*) _PyOS_ReadlineTState;
 #endif
diff --git a/Include/pytime.h b/Include/pytime.h
index 52902f5..b0fc6d0 100644
--- a/Include/pytime.h
+++ b/Include/pytime.h
@@ -53,10 +53,19 @@
      (tv_end.tv_usec - tv_start.tv_usec) * 0.000001)
 
 #ifndef Py_LIMITED_API
+
+typedef enum {
+    /* Round towards zero. */
+    _PyTime_ROUND_DOWN=0,
+    /* Round away from zero. */
+    _PyTime_ROUND_UP
+} _PyTime_round_t;
+
 /* Convert a number of seconds, int or float, to time_t. */
 PyAPI_FUNC(int) _PyTime_ObjectToTime_t(
     PyObject *obj,
-    time_t *sec);
+    time_t *sec,
+    _PyTime_round_t);
 
 /* Convert a time_t to a PyLong. */
 PyAPI_FUNC(PyObject *) _PyLong_FromTime_t(
@@ -72,7 +81,8 @@
 PyAPI_FUNC(int) _PyTime_ObjectToTimeval(
     PyObject *obj,
     time_t *sec,
-    long *usec);
+    long *usec,
+    _PyTime_round_t);
 
 /* Convert a number of seconds, int or float, to a timespec structure.
    nsec is in the range [0; 999999999] and rounded towards zero.
@@ -80,7 +90,8 @@
 PyAPI_FUNC(int) _PyTime_ObjectToTimespec(
     PyObject *obj,
     time_t *sec,
-    long *nsec);
+    long *nsec,
+    _PyTime_round_t);
 #endif
 
 /* Dummy to force linking. */
diff --git a/Include/setobject.h b/Include/setobject.h
index a14874b..ae3f556 100644
--- a/Include/setobject.h
+++ b/Include/setobject.h
@@ -23,8 +23,8 @@
 
 typedef struct {
     /* Cached hash code of the key. */
-    Py_hash_t hash;
     PyObject *key;
+    Py_hash_t hash;
 } setentry;
 
 
@@ -51,9 +51,9 @@
      */
     setentry *table;
     setentry *(*lookup)(PySetObject *so, PyObject *key, Py_hash_t hash);
+    Py_hash_t hash;             /* only used by frozenset objects */
     setentry smalltable[PySet_MINSIZE];
 
-    Py_hash_t hash;                  /* only used by frozenset objects */
     PyObject *weakreflist;      /* List of weak references */
 };
 #endif /* Py_LIMITED_API */
@@ -61,6 +61,10 @@
 PyAPI_DATA(PyTypeObject) PySet_Type;
 PyAPI_DATA(PyTypeObject) PyFrozenSet_Type;
 PyAPI_DATA(PyTypeObject) PySetIter_Type;
+#ifndef Py_LIMITED_API
+PyAPI_DATA(PyObject *) _PySet_Dummy;
+#endif
+
 
 /* Invariants for frozensets:
  *     data is immutable.
@@ -101,7 +105,6 @@
 PyAPI_FUNC(int) _PySet_Update(PyObject *set, PyObject *iterable);
 
 PyAPI_FUNC(int) PySet_ClearFreeList(void);
-PyAPI_FUNC(void) _PySet_DebugMallocStats(FILE *out);
 #endif
 
 #ifdef __cplusplus
diff --git a/Include/sliceobject.h b/Include/sliceobject.h
index 8bec179..f7ee90c 100644
--- a/Include/sliceobject.h
+++ b/Include/sliceobject.h
@@ -34,6 +34,9 @@
                                   PyObject* step);
 #ifndef Py_LIMITED_API
 PyAPI_FUNC(PyObject *) _PySlice_FromIndices(Py_ssize_t start, Py_ssize_t stop);
+PyAPI_FUNC(int) _PySlice_GetLongIndices(PySliceObject *self, PyObject *length,
+                                 PyObject **start_ptr, PyObject **stop_ptr,
+                                 PyObject **step_ptr);
 #endif
 PyAPI_FUNC(int) PySlice_GetIndices(PyObject *r, Py_ssize_t length,
                                   Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step);
diff --git a/Include/structseq.h b/Include/structseq.h
index 30c52ac..af22716 100644
--- a/Include/structseq.h
+++ b/Include/structseq.h
@@ -24,6 +24,8 @@
 #ifndef Py_LIMITED_API
 PyAPI_FUNC(void) PyStructSequence_InitType(PyTypeObject *type,
                                            PyStructSequence_Desc *desc);
+PyAPI_FUNC(int) PyStructSequence_InitType2(PyTypeObject *type,
+                                           PyStructSequence_Desc *desc);
 #endif
 PyAPI_FUNC(PyTypeObject*) PyStructSequence_NewType(PyStructSequence_Desc *desc);
 
diff --git a/Include/symtable.h b/Include/symtable.h
index 6ed3a2b..1cfd884 100644
--- a/Include/symtable.h
+++ b/Include/symtable.h
@@ -16,7 +16,7 @@
 struct _symtable_entry;
 
 struct symtable {
-    const char *st_filename;        /* name of file being compiled,
+    PyObject *st_filename;          /* name of file being compiled,
                                        decoded from the filesystem encoding */
     struct _symtable_entry *st_cur; /* current symbol table entry */
     struct _symtable_entry *st_top; /* symbol table entry for module */
@@ -41,6 +41,7 @@
     PyObject *ste_name;      /* string: name of current block */
     PyObject *ste_varnames;  /* list of function parameters */
     PyObject *ste_children;  /* list of child blocks */
+    PyObject *ste_directives;/* locations of global and nonlocal statements */
     _Py_block_ty ste_type;   /* module, class, or function */
     int ste_unoptimized;     /* false if namespace is optimized */
     int ste_nested;      /* true if block is nested */
@@ -52,6 +53,9 @@
     unsigned ste_varkeywords : 1; /* true if block has varkeywords */
     unsigned ste_returns_value : 1;  /* true if namespace uses return with
                                         an argument */
+    unsigned ste_needs_class_closure : 1; /* for class scopes, true if a
+                                             closure over __class__
+                                             should be created */
     int ste_lineno;          /* first line of block */
     int ste_col_offset;      /* offset of first line of block */
     int ste_opt_lineno;      /* lineno of last exec or import * */
@@ -70,6 +74,10 @@
     mod_ty mod,
     const char *filename,       /* decoded from the filesystem encoding */
     PyFutureFeatures *future);
+PyAPI_FUNC(struct symtable *) PySymtable_BuildObject(
+    mod_ty mod,
+    PyObject *filename,
+    PyFutureFeatures *future);
 PyAPI_FUNC(PySTEntryObject *) PySymtable_Lookup(struct symtable *, void *);
 
 PyAPI_FUNC(void) PySymtable_Free(struct symtable *);
diff --git a/Include/sysmodule.h b/Include/sysmodule.h
index 0cabf6f..cde10ac 100644
--- a/Include/sysmodule.h
+++ b/Include/sysmodule.h
@@ -8,7 +8,12 @@
 #endif
 
 PyAPI_FUNC(PyObject *) PySys_GetObject(const char *);
+#ifndef Py_LIMITED_API
+PyAPI_FUNC(PyObject *) _PySys_GetObjectId(_Py_Identifier *key);
+#endif
 PyAPI_FUNC(int) PySys_SetObject(const char *, PyObject *);
+PyAPI_FUNC(int) _PySys_SetObjectId(_Py_Identifier *key, PyObject *);
+
 PyAPI_FUNC(void) PySys_SetArgv(int, wchar_t **);
 PyAPI_FUNC(void) PySys_SetArgvEx(int, wchar_t **, int);
 PyAPI_FUNC(void) PySys_SetPath(const wchar_t *);
@@ -28,6 +33,10 @@
 PyAPI_FUNC(void) PySys_AddXOption(const wchar_t *);
 PyAPI_FUNC(PyObject *) PySys_GetXOptions(void);
 
+#ifndef Py_LIMITED_API
+PyAPI_FUNC(size_t) _PySys_GetSizeOf(PyObject *);
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/Include/token.h b/Include/token.h
index f7f6504..905022b 100644
--- a/Include/token.h
+++ b/Include/token.h
@@ -75,7 +75,7 @@
 #define ISEOF(x)		((x) == ENDMARKER)
 
 
-PyAPI_DATA(char *) _PyParser_TokenNames[]; /* Token names */
+PyAPI_DATA(const char *) _PyParser_TokenNames[]; /* Token names */
 PyAPI_FUNC(int) PyToken_OneChar(int);
 PyAPI_FUNC(int) PyToken_TwoChars(int, int);
 PyAPI_FUNC(int) PyToken_ThreeChars(int, int, int);
diff --git a/Include/traceback.h b/Include/traceback.h
index 7734707..12d467a 100644
--- a/Include/traceback.h
+++ b/Include/traceback.h
@@ -24,6 +24,7 @@
 PyAPI_FUNC(int) PyTraceBack_Print(PyObject *, PyObject *);
 #ifndef Py_LIMITED_API
 PyAPI_FUNC(int) _Py_DisplaySourceLine(PyObject *, PyObject *, int, int);
+PyAPI_FUNC(void) _PyTraceback_Add(char *, char *, int);
 #endif
 
 /* Reveal traceback type so we can typecheck traceback objects */
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h
index a8f5b5d..729f584 100644
--- a/Include/unicodeobject.h
+++ b/Include/unicodeobject.h
@@ -180,9 +180,9 @@
     } while (0)
 
 /* macros to work with surrogates */
-#define Py_UNICODE_IS_SURROGATE(ch) (0xD800 <= ch && ch <= 0xDFFF)
-#define Py_UNICODE_IS_HIGH_SURROGATE(ch) (0xD800 <= ch && ch <= 0xDBFF)
-#define Py_UNICODE_IS_LOW_SURROGATE(ch) (0xDC00 <= ch && ch <= 0xDFFF)
+#define Py_UNICODE_IS_SURROGATE(ch) (0xD800 <= (ch) && (ch) <= 0xDFFF)
+#define Py_UNICODE_IS_HIGH_SURROGATE(ch) (0xD800 <= (ch) && (ch) <= 0xDBFF)
+#define Py_UNICODE_IS_LOW_SURROGATE(ch) (0xDC00 <= (ch) && (ch) <= 0xDFFF)
 /* Join two surrogate characters and return a single Py_UCS4 value. */
 #define Py_UNICODE_JOIN_SURROGATES(high, low)  \
     (((((Py_UCS4)(high) & 0x03FF) << 10) |      \
@@ -343,6 +343,9 @@
            the data pointer is filled out. The bit is redundant, and helps
            to minimize the test in PyUnicode_IS_READY(). */
         unsigned int ready:1;
+        /* Padding to ensure that PyUnicode_DATA() is always aligned to
+           4 bytes (see issue #19537 on m68k). */
+        unsigned int :24;
     } state;
     wchar_t *wstr;              /* wchar_t representation (null-terminated) */
 } PyASCIIObject;
@@ -602,7 +605,7 @@
     );
 #endif
 
-/* Initializes the canonical string representation from a the deprecated
+/* Initializes the canonical string representation from the deprecated
    wstr/Py_UNICODE representation. This function is used to convert Unicode
    objects which were created using the old API to the new flexible format
    introduced with PEP 393.
@@ -846,7 +849,7 @@
 
    Coercion is done in the following way:
 
-   1. bytes, bytearray and other char buffer compatible objects are decoded
+   1. bytes, bytearray and other bytes-like objects are decoded
       under the assumptions that they contain data using the UTF-8
       encoding. Decoding is done in "strict" mode.
 
@@ -859,7 +862,7 @@
 */
 
 PyAPI_FUNC(PyObject*) PyUnicode_FromEncodedObject(
-    register PyObject *obj,     /* Object */
+    PyObject *obj,              /* Object */
     const char *encoding,       /* encoding */
     const char *errors          /* error handling */
     );
@@ -878,7 +881,7 @@
 */
 
 PyAPI_FUNC(PyObject*) PyUnicode_FromObject(
-    register PyObject *obj      /* Object */
+    PyObject *obj      /* Object */
     );
 
 PyAPI_FUNC(PyObject *) PyUnicode_FromFormatV(
@@ -898,22 +901,28 @@
     Py_UCS4 maxchar;
     Py_ssize_t size;
     Py_ssize_t pos;
-    /* minimum length of the buffer when overallocation is enabled,
-       see _PyUnicodeWriter_Init() */
+
+    /* minimum number of allocated characters (default: 0) */
     Py_ssize_t min_length;
+
+    /* minimum character (default: 127, ASCII) */
+    Py_UCS4 min_char;
+
+    /* If non-zero, overallocate the buffer by 25% (default: 0). */
     unsigned char overallocate;
+
     /* If readonly is 1, buffer is a shared string (cannot be modified)
        and size is set to 0. */
     unsigned char readonly;
 } _PyUnicodeWriter ;
 
 /* Initialize a Unicode writer.
-
-   If min_length is greater than zero, _PyUnicodeWriter_Prepare()
-   overallocates the buffer and min_length is the minimum length in characters
-   of the buffer. */
+ *
+ * By default, the minimum buffer size is 0 character and overallocation is
+ * disabled. Set min_length, min_char and overallocate attributes to control
+ * the allocation of the buffer. */
 PyAPI_FUNC(void)
-_PyUnicodeWriter_Init(_PyUnicodeWriter *writer, Py_ssize_t min_length);
+_PyUnicodeWriter_Init(_PyUnicodeWriter *writer);
 
 /* Prepare the buffer to write 'length' characters
    with the specified maximum character.
@@ -933,12 +942,52 @@
 _PyUnicodeWriter_PrepareInternal(_PyUnicodeWriter *writer,
                                  Py_ssize_t length, Py_UCS4 maxchar);
 
+/* Append a Unicode character.
+   Return 0 on success, raise an exception and return -1 on error. */
 PyAPI_FUNC(int)
-_PyUnicodeWriter_WriteStr(_PyUnicodeWriter *writer, PyObject *str);
+_PyUnicodeWriter_WriteChar(_PyUnicodeWriter *writer,
+    Py_UCS4 ch
+    );
 
+/* Append a Unicode string.
+   Return 0 on success, raise an exception and return -1 on error. */
+PyAPI_FUNC(int)
+_PyUnicodeWriter_WriteStr(_PyUnicodeWriter *writer,
+    PyObject *str               /* Unicode string */
+    );
+
+/* Append a substring of a Unicode string.
+   Return 0 on success, raise an exception and return -1 on error. */
+PyAPI_FUNC(int)
+_PyUnicodeWriter_WriteSubstring(_PyUnicodeWriter *writer,
+    PyObject *str,              /* Unicode string */
+    Py_ssize_t start,
+    Py_ssize_t end
+    );
+
+/* Append a ASCII-encoded byte string.
+   Return 0 on success, raise an exception and return -1 on error. */
+PyAPI_FUNC(int)
+_PyUnicodeWriter_WriteASCIIString(_PyUnicodeWriter *writer,
+    const char *str,           /* ASCII-encoded byte string */
+    Py_ssize_t len             /* number of bytes, or -1 if unknown */
+    );
+
+/* Append a latin1-encoded byte string.
+   Return 0 on success, raise an exception and return -1 on error. */
+PyAPI_FUNC(int)
+_PyUnicodeWriter_WriteLatin1String(_PyUnicodeWriter *writer,
+    const char *str,           /* latin1-encoded byte string */
+    Py_ssize_t len             /* length in bytes */
+    );
+
+/* Get the value of the writer as an Unicode string. Clear the
+   buffer of the writer. Raise an exception and return NULL
+   on error. */
 PyAPI_FUNC(PyObject *)
 _PyUnicodeWriter_Finish(_PyUnicodeWriter *writer);
 
+/* Deallocate memory of a writer (clear its internal buffer). */
 PyAPI_FUNC(void)
 _PyUnicodeWriter_Dealloc(_PyUnicodeWriter *writer);
 #endif
@@ -977,7 +1026,7 @@
    The buffer is copied into the new object. */
 
 PyAPI_FUNC(PyObject*) PyUnicode_FromWideChar(
-    register const wchar_t *w,  /* wchar_t buffer */
+    const wchar_t *w,           /* wchar_t buffer */
     Py_ssize_t size             /* size of buffer */
     );
 
@@ -995,7 +1044,7 @@
 
 PyAPI_FUNC(Py_ssize_t) PyUnicode_AsWideChar(
     PyObject *unicode,          /* Unicode object */
-    register wchar_t *w,        /* wchar_t buffer */
+    wchar_t *w,                 /* wchar_t buffer */
     Py_ssize_t size             /* size of buffer */
     );
 
@@ -1726,7 +1775,7 @@
 /* Encode a Unicode object to the current locale encoding. The encoder is
    strict is *surrogateescape* is equal to zero, otherwise the
    "surrogateescape" error handler is used. Return a bytes object. The string
-   cannot contain embedded null characters.. */
+   cannot contain embedded null characters. */
 
 PyAPI_FUNC(PyObject*) PyUnicode_EncodeLocale(
     PyObject *unicode,
@@ -1950,13 +1999,21 @@
     );
 
 /* Compare two strings and return -1, 0, 1 for less than, equal,
-   greater than resp. */
+   greater than resp.
+   Raise an exception and return -1 on error. */
 
 PyAPI_FUNC(int) PyUnicode_Compare(
     PyObject *left,             /* Left string */
     PyObject *right             /* Right string */
     );
 
+#ifndef Py_LIMITED_API
+PyAPI_FUNC(int) _PyUnicode_CompareWithId(
+    PyObject *left,             /* Left string */
+    _Py_Identifier *right       /* Right identifier */
+    );
+#endif
+
 PyAPI_FUNC(int) PyUnicode_CompareWithASCIIString(
     PyObject *left,
     const char *right           /* ASCII-encoded string */
diff --git a/Include/warnings.h b/Include/warnings.h
index b7db681..effb9fad 100644
--- a/Include/warnings.h
+++ b/Include/warnings.h
@@ -17,6 +17,15 @@
     Py_ssize_t stack_level,
     const char *format,         /* ASCII-encoded string  */
     ...);
+#ifndef Py_LIMITED_API
+PyAPI_FUNC(int) PyErr_WarnExplicitObject(
+    PyObject *category,
+    PyObject *message,
+    PyObject *filename,
+    int lineno,
+    PyObject *module,
+    PyObject *registry);
+#endif
 PyAPI_FUNC(int) PyErr_WarnExplicit(
     PyObject *category,
     const char *message,        /* UTF-8 encoded string */
@@ -25,6 +34,14 @@
     const char *module,         /* UTF-8 encoded string */
     PyObject *registry);
 
+#ifndef Py_LIMITED_API
+PyAPI_FUNC(int)
+PyErr_WarnExplicitFormat(PyObject *category,
+                         const char *filename, int lineno,
+                         const char *module, PyObject *registry,
+                         const char *format, ...);
+#endif
+
 /* DEPRECATED: Use PyErr_WarnEx() instead. */
 #ifndef Py_LIMITED_API
 #define PyErr_Warn(category, msg) PyErr_WarnEx(category, msg, 1)
diff --git a/Lib/_bootlocale.py b/Lib/_bootlocale.py
new file mode 100644
index 0000000..4bccac1
--- /dev/null
+++ b/Lib/_bootlocale.py
@@ -0,0 +1,34 @@
+"""A minimal subset of the locale module used at interpreter startup
+(imported by the _io module), in order to reduce startup time.
+
+Don't import directly from third-party code; use the `locale` module instead!
+"""
+
+import sys
+import _locale
+
+if sys.platform.startswith("win"):
+    def getpreferredencoding(do_setlocale=True):
+        return _locale._getdefaultlocale()[1]
+else:
+    try:
+        _locale.CODESET
+    except AttributeError:
+        def getpreferredencoding(do_setlocale=True):
+            # This path for legacy systems needs the more complex
+            # getdefaultlocale() function, import the full locale module.
+            import locale
+            return locale.getpreferredencoding(do_setlocale)
+    else:
+        def getpreferredencoding(do_setlocale=True):
+            assert not do_setlocale
+            result = _locale.nl_langinfo(_locale.CODESET)
+            if not result and sys.platform == 'darwin':
+                # nl_langinfo can return an empty string
+                # when the setting has an invalid value.
+                # Default to UTF-8 in that case because
+                # UTF-8 is the default charset on OSX and
+                # returning nothing will crash the
+                # interpreter.
+                result = 'UTF-8'
+            return result
diff --git a/Lib/_collections_abc.py b/Lib/_collections_abc.py
new file mode 100644
index 0000000..33b59ab
--- /dev/null
+++ b/Lib/_collections_abc.py
@@ -0,0 +1,748 @@
+# Copyright 2007 Google, Inc. All Rights Reserved.
+# Licensed to PSF under a Contributor Agreement.
+
+"""Abstract Base Classes (ABCs) for collections, according to PEP 3119.
+
+Unit tests are in test_collections.
+"""
+
+from abc import ABCMeta, abstractmethod
+import sys
+
+__all__ = ["Hashable", "Iterable", "Iterator",
+           "Sized", "Container", "Callable",
+           "Set", "MutableSet",
+           "Mapping", "MutableMapping",
+           "MappingView", "KeysView", "ItemsView", "ValuesView",
+           "Sequence", "MutableSequence",
+           "ByteString",
+           ]
+
+# This module has been renamed from collections.abc to _collections_abc to
+# speed up interpreter startup. Some of the types such as MutableMapping are
+# required early but collections module imports a lot of other modules.
+# See issue #19218
+__name__ = "collections.abc"
+
+# Private list of types that we want to register with the various ABCs
+# so that they will pass tests like:
+#       it = iter(somebytearray)
+#       assert isinstance(it, Iterable)
+# Note:  in other implementations, these types many not be distinct
+# and they make have their own implementation specific types that
+# are not included on this list.
+bytes_iterator = type(iter(b''))
+bytearray_iterator = type(iter(bytearray()))
+#callable_iterator = ???
+dict_keyiterator = type(iter({}.keys()))
+dict_valueiterator = type(iter({}.values()))
+dict_itemiterator = type(iter({}.items()))
+list_iterator = type(iter([]))
+list_reverseiterator = type(iter(reversed([])))
+range_iterator = type(iter(range(0)))
+set_iterator = type(iter(set()))
+str_iterator = type(iter(""))
+tuple_iterator = type(iter(()))
+zip_iterator = type(iter(zip()))
+## views ##
+dict_keys = type({}.keys())
+dict_values = type({}.values())
+dict_items = type({}.items())
+## misc ##
+mappingproxy = type(type.__dict__)
+
+
+### ONE-TRICK PONIES ###
+
+class Hashable(metaclass=ABCMeta):
+
+    __slots__ = ()
+
+    @abstractmethod
+    def __hash__(self):
+        return 0
+
+    @classmethod
+    def __subclasshook__(cls, C):
+        if cls is Hashable:
+            for B in C.__mro__:
+                if "__hash__" in B.__dict__:
+                    if B.__dict__["__hash__"]:
+                        return True
+                    break
+        return NotImplemented
+
+
+class Iterable(metaclass=ABCMeta):
+
+    __slots__ = ()
+
+    @abstractmethod
+    def __iter__(self):
+        while False:
+            yield None
+
+    @classmethod
+    def __subclasshook__(cls, C):
+        if cls is Iterable:
+            if any("__iter__" in B.__dict__ for B in C.__mro__):
+                return True
+        return NotImplemented
+
+
+class Iterator(Iterable):
+
+    __slots__ = ()
+
+    @abstractmethod
+    def __next__(self):
+        'Return the next item from the iterator. When exhausted, raise StopIteration'
+        raise StopIteration
+
+    def __iter__(self):
+        return self
+
+    @classmethod
+    def __subclasshook__(cls, C):
+        if cls is Iterator:
+            if (any("__next__" in B.__dict__ for B in C.__mro__) and
+                any("__iter__" in B.__dict__ for B in C.__mro__)):
+                return True
+        return NotImplemented
+
+Iterator.register(bytes_iterator)
+Iterator.register(bytearray_iterator)
+#Iterator.register(callable_iterator)
+Iterator.register(dict_keyiterator)
+Iterator.register(dict_valueiterator)
+Iterator.register(dict_itemiterator)
+Iterator.register(list_iterator)
+Iterator.register(list_reverseiterator)
+Iterator.register(range_iterator)
+Iterator.register(set_iterator)
+Iterator.register(str_iterator)
+Iterator.register(tuple_iterator)
+Iterator.register(zip_iterator)
+
+class Sized(metaclass=ABCMeta):
+
+    __slots__ = ()
+
+    @abstractmethod
+    def __len__(self):
+        return 0
+
+    @classmethod
+    def __subclasshook__(cls, C):
+        if cls is Sized:
+            if any("__len__" in B.__dict__ for B in C.__mro__):
+                return True
+        return NotImplemented
+
+
+class Container(metaclass=ABCMeta):
+
+    __slots__ = ()
+
+    @abstractmethod
+    def __contains__(self, x):
+        return False
+
+    @classmethod
+    def __subclasshook__(cls, C):
+        if cls is Container:
+            if any("__contains__" in B.__dict__ for B in C.__mro__):
+                return True
+        return NotImplemented
+
+
+class Callable(metaclass=ABCMeta):
+
+    __slots__ = ()
+
+    @abstractmethod
+    def __call__(self, *args, **kwds):
+        return False
+
+    @classmethod
+    def __subclasshook__(cls, C):
+        if cls is Callable:
+            if any("__call__" in B.__dict__ for B in C.__mro__):
+                return True
+        return NotImplemented
+
+
+### SETS ###
+
+
+class Set(Sized, Iterable, Container):
+
+    """A set is a finite, iterable container.
+
+    This class provides concrete generic implementations of all
+    methods except for __contains__, __iter__ and __len__.
+
+    To override the comparisons (presumably for speed, as the
+    semantics are fixed), redefine __le__ and __ge__,
+    then the other operations will automatically follow suit.
+    """
+
+    __slots__ = ()
+
+    def __le__(self, other):
+        if not isinstance(other, Set):
+            return NotImplemented
+        if len(self) > len(other):
+            return False
+        for elem in self:
+            if elem not in other:
+                return False
+        return True
+
+    def __lt__(self, other):
+        if not isinstance(other, Set):
+            return NotImplemented
+        return len(self) < len(other) and self.__le__(other)
+
+    def __gt__(self, other):
+        if not isinstance(other, Set):
+            return NotImplemented
+        return len(self) > len(other) and self.__ge__(other)
+
+    def __ge__(self, other):
+        if not isinstance(other, Set):
+            return NotImplemented
+        if len(self) < len(other):
+            return False
+        for elem in other:
+            if elem not in self:
+                return False
+        return True
+
+    def __eq__(self, other):
+        if not isinstance(other, Set):
+            return NotImplemented
+        return len(self) == len(other) and self.__le__(other)
+
+    @classmethod
+    def _from_iterable(cls, it):
+        '''Construct an instance of the class from any iterable input.
+
+        Must override this method if the class constructor signature
+        does not accept an iterable for an input.
+        '''
+        return cls(it)
+
+    def __and__(self, other):
+        if not isinstance(other, Iterable):
+            return NotImplemented
+        return self._from_iterable(value for value in other if value in self)
+
+    __rand__ = __and__
+
+    def isdisjoint(self, other):
+        'Return True if two sets have a null intersection.'
+        for value in other:
+            if value in self:
+                return False
+        return True
+
+    def __or__(self, other):
+        if not isinstance(other, Iterable):
+            return NotImplemented
+        chain = (e for s in (self, other) for e in s)
+        return self._from_iterable(chain)
+
+    __ror__ = __or__
+
+    def __sub__(self, other):
+        if not isinstance(other, Set):
+            if not isinstance(other, Iterable):
+                return NotImplemented
+            other = self._from_iterable(other)
+        return self._from_iterable(value for value in self
+                                   if value not in other)
+
+    def __rsub__(self, other):
+        if not isinstance(other, Set):
+            if not isinstance(other, Iterable):
+                return NotImplemented
+            other = self._from_iterable(other)
+        return self._from_iterable(value for value in other
+                                   if value not in self)
+
+    def __xor__(self, other):
+        if not isinstance(other, Set):
+            if not isinstance(other, Iterable):
+                return NotImplemented
+            other = self._from_iterable(other)
+        return (self - other) | (other - self)
+
+    __rxor__ = __xor__
+
+    def _hash(self):
+        """Compute the hash value of a set.
+
+        Note that we don't define __hash__: not all sets are hashable.
+        But if you define a hashable set type, its __hash__ should
+        call this function.
+
+        This must be compatible __eq__.
+
+        All sets ought to compare equal if they contain the same
+        elements, regardless of how they are implemented, and
+        regardless of the order of the elements; so there's not much
+        freedom for __eq__ or __hash__.  We match the algorithm used
+        by the built-in frozenset type.
+        """
+        MAX = sys.maxsize
+        MASK = 2 * MAX + 1
+        n = len(self)
+        h = 1927868237 * (n + 1)
+        h &= MASK
+        for x in self:
+            hx = hash(x)
+            h ^= (hx ^ (hx << 16) ^ 89869747)  * 3644798167
+            h &= MASK
+        h = h * 69069 + 907133923
+        h &= MASK
+        if h > MAX:
+            h -= MASK + 1
+        if h == -1:
+            h = 590923713
+        return h
+
+Set.register(frozenset)
+
+
+class MutableSet(Set):
+    """A mutable set is a finite, iterable container.
+
+    This class provides concrete generic implementations of all
+    methods except for __contains__, __iter__, __len__,
+    add(), and discard().
+
+    To override the comparisons (presumably for speed, as the
+    semantics are fixed), all you have to do is redefine __le__ and
+    then the other operations will automatically follow suit.
+    """
+
+    __slots__ = ()
+
+    @abstractmethod
+    def add(self, value):
+        """Add an element."""
+        raise NotImplementedError
+
+    @abstractmethod
+    def discard(self, value):
+        """Remove an element.  Do not raise an exception if absent."""
+        raise NotImplementedError
+
+    def remove(self, value):
+        """Remove an element. If not a member, raise a KeyError."""
+        if value not in self:
+            raise KeyError(value)
+        self.discard(value)
+
+    def pop(self):
+        """Return the popped value.  Raise KeyError if empty."""
+        it = iter(self)
+        try:
+            value = next(it)
+        except StopIteration:
+            raise KeyError
+        self.discard(value)
+        return value
+
+    def clear(self):
+        """This is slow (creates N new iterators!) but effective."""
+        try:
+            while True:
+                self.pop()
+        except KeyError:
+            pass
+
+    def __ior__(self, it):
+        for value in it:
+            self.add(value)
+        return self
+
+    def __iand__(self, it):
+        for value in (self - it):
+            self.discard(value)
+        return self
+
+    def __ixor__(self, it):
+        if it is self:
+            self.clear()
+        else:
+            if not isinstance(it, Set):
+                it = self._from_iterable(it)
+            for value in it:
+                if value in self:
+                    self.discard(value)
+                else:
+                    self.add(value)
+        return self
+
+    def __isub__(self, it):
+        if it is self:
+            self.clear()
+        else:
+            for value in it:
+                self.discard(value)
+        return self
+
+MutableSet.register(set)
+
+
+### MAPPINGS ###
+
+
+class Mapping(Sized, Iterable, Container):
+
+    __slots__ = ()
+
+    """A Mapping is a generic container for associating key/value
+    pairs.
+
+    This class provides concrete generic implementations of all
+    methods except for __getitem__, __iter__, and __len__.
+
+    """
+
+    @abstractmethod
+    def __getitem__(self, key):
+        raise KeyError
+
+    def get(self, key, default=None):
+        'D.get(k[,d]) -> D[k] if k in D, else d.  d defaults to None.'
+        try:
+            return self[key]
+        except KeyError:
+            return default
+
+    def __contains__(self, key):
+        try:
+            self[key]
+        except KeyError:
+            return False
+        else:
+            return True
+
+    def keys(self):
+        "D.keys() -> a set-like object providing a view on D's keys"
+        return KeysView(self)
+
+    def items(self):
+        "D.items() -> a set-like object providing a view on D's items"
+        return ItemsView(self)
+
+    def values(self):
+        "D.values() -> an object providing a view on D's values"
+        return ValuesView(self)
+
+    def __eq__(self, other):
+        if not isinstance(other, Mapping):
+            return NotImplemented
+        return dict(self.items()) == dict(other.items())
+
+Mapping.register(mappingproxy)
+
+
+class MappingView(Sized):
+
+    def __init__(self, mapping):
+        self._mapping = mapping
+
+    def __len__(self):
+        return len(self._mapping)
+
+    def __repr__(self):
+        return '{0.__class__.__name__}({0._mapping!r})'.format(self)
+
+
+class KeysView(MappingView, Set):
+
+    @classmethod
+    def _from_iterable(self, it):
+        return set(it)
+
+    def __contains__(self, key):
+        return key in self._mapping
+
+    def __iter__(self):
+        yield from self._mapping
+
+KeysView.register(dict_keys)
+
+
+class ItemsView(MappingView, Set):
+
+    @classmethod
+    def _from_iterable(self, it):
+        return set(it)
+
+    def __contains__(self, item):
+        key, value = item
+        try:
+            v = self._mapping[key]
+        except KeyError:
+            return False
+        else:
+            return v == value
+
+    def __iter__(self):
+        for key in self._mapping:
+            yield (key, self._mapping[key])
+
+ItemsView.register(dict_items)
+
+
+class ValuesView(MappingView):
+
+    def __contains__(self, value):
+        for key in self._mapping:
+            if value == self._mapping[key]:
+                return True
+        return False
+
+    def __iter__(self):
+        for key in self._mapping:
+            yield self._mapping[key]
+
+ValuesView.register(dict_values)
+
+
+class MutableMapping(Mapping):
+
+    __slots__ = ()
+
+    """A MutableMapping is a generic container for associating
+    key/value pairs.
+
+    This class provides concrete generic implementations of all
+    methods except for __getitem__, __setitem__, __delitem__,
+    __iter__, and __len__.
+
+    """
+
+    @abstractmethod
+    def __setitem__(self, key, value):
+        raise KeyError
+
+    @abstractmethod
+    def __delitem__(self, key):
+        raise KeyError
+
+    __marker = object()
+
+    def pop(self, key, default=__marker):
+        '''D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
+          If key is not found, d is returned if given, otherwise KeyError is raised.
+        '''
+        try:
+            value = self[key]
+        except KeyError:
+            if default is self.__marker:
+                raise
+            return default
+        else:
+            del self[key]
+            return value
+
+    def popitem(self):
+        '''D.popitem() -> (k, v), remove and return some (key, value) pair
+           as a 2-tuple; but raise KeyError if D is empty.
+        '''
+        try:
+            key = next(iter(self))
+        except StopIteration:
+            raise KeyError
+        value = self[key]
+        del self[key]
+        return key, value
+
+    def clear(self):
+        'D.clear() -> None.  Remove all items from D.'
+        try:
+            while True:
+                self.popitem()
+        except KeyError:
+            pass
+
+    def update(*args, **kwds):
+        ''' D.update([E, ]**F) -> None.  Update D from mapping/iterable E and F.
+            If E present and has a .keys() method, does:     for k in E: D[k] = E[k]
+            If E present and lacks .keys() method, does:     for (k, v) in E: D[k] = v
+            In either case, this is followed by: for k, v in F.items(): D[k] = v
+        '''
+        if not args:
+            raise TypeError("descriptor 'update' of 'MutableMapping' object "
+                            "needs an argument")
+        self, *args = args
+        if len(args) > 1:
+            raise TypeError('update expected at most 1 arguments, got %d' %
+                            len(args))
+        if args:
+            other = args[0]
+            if isinstance(other, Mapping):
+                for key in other:
+                    self[key] = other[key]
+            elif hasattr(other, "keys"):
+                for key in other.keys():
+                    self[key] = other[key]
+            else:
+                for key, value in other:
+                    self[key] = value
+        for key, value in kwds.items():
+            self[key] = value
+
+    def setdefault(self, key, default=None):
+        'D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D'
+        try:
+            return self[key]
+        except KeyError:
+            self[key] = default
+        return default
+
+MutableMapping.register(dict)
+
+
+### SEQUENCES ###
+
+
+class Sequence(Sized, Iterable, Container):
+
+    """All the operations on a read-only sequence.
+
+    Concrete subclasses must override __new__ or __init__,
+    __getitem__, and __len__.
+    """
+
+    __slots__ = ()
+
+    @abstractmethod
+    def __getitem__(self, index):
+        raise IndexError
+
+    def __iter__(self):
+        i = 0
+        try:
+            while True:
+                v = self[i]
+                yield v
+                i += 1
+        except IndexError:
+            return
+
+    def __contains__(self, value):
+        for v in self:
+            if v == value:
+                return True
+        return False
+
+    def __reversed__(self):
+        for i in reversed(range(len(self))):
+            yield self[i]
+
+    def index(self, value):
+        '''S.index(value) -> integer -- return first index of value.
+           Raises ValueError if the value is not present.
+        '''
+        for i, v in enumerate(self):
+            if v == value:
+                return i
+        raise ValueError
+
+    def count(self, value):
+        'S.count(value) -> integer -- return number of occurrences of value'
+        return sum(1 for v in self if v == value)
+
+Sequence.register(tuple)
+Sequence.register(str)
+Sequence.register(range)
+Sequence.register(memoryview)
+
+
+class ByteString(Sequence):
+
+    """This unifies bytes and bytearray.
+
+    XXX Should add all their methods.
+    """
+
+    __slots__ = ()
+
+ByteString.register(bytes)
+ByteString.register(bytearray)
+
+
+class MutableSequence(Sequence):
+
+    __slots__ = ()
+
+    """All the operations on a read-write sequence.
+
+    Concrete subclasses must provide __new__ or __init__,
+    __getitem__, __setitem__, __delitem__, __len__, and insert().
+
+    """
+
+    @abstractmethod
+    def __setitem__(self, index, value):
+        raise IndexError
+
+    @abstractmethod
+    def __delitem__(self, index):
+        raise IndexError
+
+    @abstractmethod
+    def insert(self, index, value):
+        'S.insert(index, value) -- insert value before index'
+        raise IndexError
+
+    def append(self, value):
+        'S.append(value) -- append value to the end of the sequence'
+        self.insert(len(self), value)
+
+    def clear(self):
+        'S.clear() -> None -- remove all items from S'
+        try:
+            while True:
+                self.pop()
+        except IndexError:
+            pass
+
+    def reverse(self):
+        'S.reverse() -- reverse *IN PLACE*'
+        n = len(self)
+        for i in range(n//2):
+            self[i], self[n-i-1] = self[n-i-1], self[i]
+
+    def extend(self, values):
+        'S.extend(iterable) -- extend sequence by appending elements from the iterable'
+        for v in values:
+            self.append(v)
+
+    def pop(self, index=-1):
+        '''S.pop([index]) -> item -- remove and return item at index (default last).
+           Raise IndexError if list is empty or index is out of range.
+        '''
+        v = self[index]
+        del self[index]
+        return v
+
+    def remove(self, value):
+        '''S.remove(value) -- remove first occurrence of value.
+           Raise ValueError if the value is not present.
+        '''
+        del self[self.index(value)]
+
+    def __iadd__(self, values):
+        self.extend(values)
+        return self
+
+MutableSequence.register(list)
+MutableSequence.register(bytearray)  # Multiply inheriting, see ByteString
diff --git a/Lib/_dummy_thread.py b/Lib/_dummy_thread.py
index 13b1f26..b67cfb9 100644
--- a/Lib/_dummy_thread.py
+++ b/Lib/_dummy_thread.py
@@ -81,6 +81,10 @@
         raise error("setting thread stack size not supported")
     return 0
 
+def _set_sentinel():
+    """Dummy implementation of _thread._set_sentinel()."""
+    return LockType()
+
 class LockType(object):
     """Class implementing dummy implementation of _thread.LockType.
 
diff --git a/Lib/_osx_support.py b/Lib/_osx_support.py
index 50b2d17..b07e75d 100644
--- a/Lib/_osx_support.py
+++ b/Lib/_osx_support.py
@@ -38,7 +38,7 @@
     paths = path.split(os.pathsep)
     base, ext = os.path.splitext(executable)
 
-    if (sys.platform == 'win32' or os.name == 'os2') and (ext != '.exe'):
+    if (sys.platform == 'win32') and (ext != '.exe'):
         executable = executable + '.exe'
 
     if not os.path.isfile(executable):
@@ -94,7 +94,7 @@
         _SYSTEM_VERSION = ''
         try:
             f = open('/System/Library/CoreServices/SystemVersion.plist')
-        except IOError:
+        except OSError:
             # We're on a plain darwin box, fall back to the default
             # behaviour.
             pass
@@ -182,7 +182,7 @@
         # Compiler is GCC, check if it is LLVM-GCC
         data = _read_output("'%s' --version"
                              % (cc.replace("'", "'\"'\"'"),))
-        if 'llvm-gcc' in data:
+        if data and 'llvm-gcc' in data:
             # Found LLVM-GCC, fall back to clang
             cc = _find_build_tool('clang')
 
@@ -450,8 +450,16 @@
         # case and disallow installs.
         cflags = _config_vars.get(_INITPRE+'CFLAGS',
                                     _config_vars.get('CFLAGS', ''))
-        if ((macrelease + '.') >= '10.4.' and
-            '-arch' in cflags.strip()):
+        if macrelease:
+            try:
+                macrelease = tuple(int(i) for i in macrelease.split('.')[0:2])
+            except ValueError:
+                macrelease = (10, 0)
+        else:
+            # assume no universal support
+            macrelease = (10, 0)
+
+        if (macrelease >= (10, 4)) and '-arch' in cflags.strip():
             # The universal build will build fat binaries, but not on
             # systems before 10.4
 
diff --git a/Lib/_pyio.py b/Lib/_pyio.py
index a0c4b25..01683f8 100644
--- a/Lib/_pyio.py
+++ b/Lib/_pyio.py
@@ -34,7 +34,7 @@
 def open(file, mode="r", buffering=-1, encoding=None, errors=None,
          newline=None, closefd=True, opener=None):
 
-    r"""Open file and return a stream.  Raise IOError upon failure.
+    r"""Open file and return a stream.  Raise OSError upon failure.
 
     file is either a text or byte string giving the name (and the path
     if the file isn't in the current working directory) of the file to
@@ -62,8 +62,7 @@
     'b'       binary mode
     't'       text mode (default)
     '+'       open a disk file for updating (reading and writing)
-    'U'       universal newline mode (for backwards compatibility; unneeded
-              for new code)
+    'U'       universal newline mode (deprecated)
     ========= ===============================================================
 
     The default mode is 'rt' (open for reading text). For binary random
@@ -79,6 +78,10 @@
     returned as strings, the bytes having been first decoded using a
     platform-dependent encoding or using the specified encoding if given.
 
+    'U' mode is deprecated and will raise an exception in future versions
+    of Python.  It has no effect in Python 3.  Use newline to control
+    universal newlines mode.
+
     buffering is an optional integer used to set the buffering policy.
     Pass 0 to switch buffering off (only allowed in binary mode), 1 to select
     line buffering (only usable in text mode), and an integer > 1 to indicate
@@ -129,6 +132,8 @@
     be kept open when the file is closed. This does not work when a file name is
     given and must be True in that case.
 
+    The newly created file is non-inheritable.
+
     A custom opener can be used by passing a callable as *opener*. The
     underlying file descriptor for the file object is then obtained by calling
     *opener* with (*file*, *flags*). *opener* must return an open file
@@ -172,6 +177,9 @@
     if "U" in modes:
         if creating or writing or appending:
             raise ValueError("can't use U and writing mode at once")
+        import warnings
+        warnings.warn("'U' mode is deprecated",
+                      DeprecationWarning, 2)
         reading = True
     if text and binary:
         raise ValueError("can't have text and binary mode at once")
@@ -192,38 +200,45 @@
                  (appending and "a" or "") +
                  (updating and "+" or ""),
                  closefd, opener=opener)
-    line_buffering = False
-    if buffering == 1 or buffering < 0 and raw.isatty():
-        buffering = -1
-        line_buffering = True
-    if buffering < 0:
-        buffering = DEFAULT_BUFFER_SIZE
-        try:
-            bs = os.fstat(raw.fileno()).st_blksize
-        except (os.error, AttributeError):
-            pass
+    result = raw
+    try:
+        line_buffering = False
+        if buffering == 1 or buffering < 0 and raw.isatty():
+            buffering = -1
+            line_buffering = True
+        if buffering < 0:
+            buffering = DEFAULT_BUFFER_SIZE
+            try:
+                bs = os.fstat(raw.fileno()).st_blksize
+            except (OSError, AttributeError):
+                pass
+            else:
+                if bs > 1:
+                    buffering = bs
+        if buffering < 0:
+            raise ValueError("invalid buffering size")
+        if buffering == 0:
+            if binary:
+                return result
+            raise ValueError("can't have unbuffered text I/O")
+        if updating:
+            buffer = BufferedRandom(raw, buffering)
+        elif creating or writing or appending:
+            buffer = BufferedWriter(raw, buffering)
+        elif reading:
+            buffer = BufferedReader(raw, buffering)
         else:
-            if bs > 1:
-                buffering = bs
-    if buffering < 0:
-        raise ValueError("invalid buffering size")
-    if buffering == 0:
+            raise ValueError("unknown mode: %r" % mode)
+        result = buffer
         if binary:
-            return raw
-        raise ValueError("can't have unbuffered text I/O")
-    if updating:
-        buffer = BufferedRandom(raw, buffering)
-    elif creating or writing or appending:
-        buffer = BufferedWriter(raw, buffering)
-    elif reading:
-        buffer = BufferedReader(raw, buffering)
-    else:
-        raise ValueError("unknown mode: %r" % mode)
-    if binary:
-        return buffer
-    text = TextIOWrapper(buffer, encoding, errors, newline, line_buffering)
-    text.mode = mode
-    return text
+            return result
+        text = TextIOWrapper(buffer, encoding, errors, newline, line_buffering)
+        result = text
+        text.mode = mode
+        return result
+    except:
+        result.close()
+        raise
 
 
 class DocDescriptor:
@@ -254,7 +269,7 @@
 try:
     UnsupportedOperation = io.UnsupportedOperation
 except AttributeError:
-    class UnsupportedOperation(ValueError, IOError):
+    class UnsupportedOperation(ValueError, OSError):
         pass
 
 
@@ -278,7 +293,7 @@
     readinto) needed. Text I/O classes work with str data.
 
     Note that calling any method (even inquiries) on a closed stream is
-    undefined. Implementations may raise IOError in this case.
+    undefined. Implementations may raise OSError in this case.
 
     IOBase (and its subclasses) support the iterator protocol, meaning
     that an IOBase object can be iterated over yielding the lines in a
@@ -294,7 +309,7 @@
     ### Internal ###
 
     def _unsupported(self, name):
-        """Internal: raise an IOError exception for unsupported operations."""
+        """Internal: raise an OSError exception for unsupported operations."""
         raise UnsupportedOperation("%s.%s() not supported" %
                                    (self.__class__.__name__, name))
 
@@ -441,7 +456,7 @@
     def fileno(self):
         """Returns underlying file descriptor (an int) if one exists.
 
-        An IOError is raised if the IO object does not use a file descriptor.
+        An OSError is raised if the IO object does not use a file descriptor.
         """
         self._unsupported("fileno")
 
@@ -455,11 +470,11 @@
 
     ### Readline[s] and writelines ###
 
-    def readline(self, limit=-1):
+    def readline(self, size=-1):
         r"""Read and return a line of bytes from the stream.
 
-        If limit is specified, at most limit bytes will be read.
-        Limit should be an int.
+        If size is specified, at most size bytes will be read.
+        Size should be an int.
 
         The line terminator is always b'\n' for binary files; for text
         files, the newlines argument to open can be used to select the line
@@ -472,18 +487,18 @@
                 if not readahead:
                     return 1
                 n = (readahead.find(b"\n") + 1) or len(readahead)
-                if limit >= 0:
-                    n = min(n, limit)
+                if size >= 0:
+                    n = min(n, size)
                 return n
         else:
             def nreadahead():
                 return 1
-        if limit is None:
-            limit = -1
-        elif not isinstance(limit, int):
-            raise TypeError("limit must be an integer")
+        if size is None:
+            size = -1
+        elif not isinstance(size, int):
+            raise TypeError("size must be an integer")
         res = bytearray()
-        while limit < 0 or len(res) < limit:
+        while size < 0 or len(res) < size:
             b = self.read(nreadahead())
             if not b:
                 break
@@ -542,17 +557,17 @@
     # primitive operation, but that would lead to nasty recursion in case
     # a subclass doesn't implement either.)
 
-    def read(self, n=-1):
-        """Read and return up to n bytes, where n is an int.
+    def read(self, size=-1):
+        """Read and return up to size bytes, where size is an int.
 
         Returns an empty bytes object on EOF, or None if the object is
         set not to block and has no data to read.
         """
-        if n is None:
-            n = -1
-        if n < 0:
+        if size is None:
+            size = -1
+        if size < 0:
             return self.readall()
-        b = bytearray(n.__index__())
+        b = bytearray(size.__index__())
         n = self.readinto(b)
         if n is None:
             return None
@@ -610,8 +625,8 @@
     implementation, but wrap one.
     """
 
-    def read(self, n=None):
-        """Read and return up to n bytes, where n is an int.
+    def read(self, size=None):
+        """Read and return up to size bytes, where size is an int.
 
         If the argument is omitted, None, or negative, reads and
         returns all data until EOF.
@@ -630,9 +645,9 @@
         """
         self._unsupported("read")
 
-    def read1(self, n=None):
-        """Read up to n bytes with at most one read() system call,
-        where n is an int.
+    def read1(self, size=None):
+        """Read up to size bytes with at most one read() system call,
+        where size is an int.
         """
         self._unsupported("read1")
 
@@ -699,13 +714,13 @@
     def seek(self, pos, whence=0):
         new_position = self.raw.seek(pos, whence)
         if new_position < 0:
-            raise IOError("seek() returned an invalid position")
+            raise OSError("seek() returned an invalid position")
         return new_position
 
     def tell(self):
         pos = self.raw.tell()
         if pos < 0:
-            raise IOError("tell() returned an invalid position")
+            raise OSError("tell() returned an invalid position")
         return pos
 
     def truncate(self, pos=None):
@@ -778,7 +793,7 @@
         clsname = self.__class__.__name__
         try:
             name = self.name
-        except AttributeError:
+        except Exception:
             return "<_pyio.{0}>".format(clsname)
         else:
             return "<_pyio.{0} name={1!r}>".format(clsname, name)
@@ -820,24 +835,24 @@
         """
         return memoryview(self._buffer)
 
-    def read(self, n=None):
+    def read(self, size=None):
         if self.closed:
             raise ValueError("read from closed file")
-        if n is None:
-            n = -1
-        if n < 0:
-            n = len(self._buffer)
+        if size is None:
+            size = -1
+        if size < 0:
+            size = len(self._buffer)
         if len(self._buffer) <= self._pos:
             return b""
-        newpos = min(len(self._buffer), self._pos + n)
+        newpos = min(len(self._buffer), self._pos + size)
         b = self._buffer[self._pos : newpos]
         self._pos = newpos
         return bytes(b)
 
-    def read1(self, n):
+    def read1(self, size):
         """This is the same as read.
         """
-        return self.read(n)
+        return self.read(size)
 
     def write(self, b):
         if self.closed:
@@ -927,7 +942,7 @@
         """Create a new buffered reader using the given readable raw IO object.
         """
         if not raw.readable():
-            raise IOError('"raw" argument must be readable.')
+            raise OSError('"raw" argument must be readable.')
 
         _BufferedIOMixin.__init__(self, raw)
         if buffer_size <= 0:
@@ -940,18 +955,18 @@
         self._read_buf = b""
         self._read_pos = 0
 
-    def read(self, n=None):
-        """Read n bytes.
+    def read(self, size=None):
+        """Read size bytes.
 
-        Returns exactly n bytes of data unless the underlying raw IO
+        Returns exactly size bytes of data unless the underlying raw IO
         stream reaches EOF or if the call would block in non-blocking
-        mode. If n is negative, read until EOF or until read() would
+        mode. If size is negative, read until EOF or until read() would
         block.
         """
-        if n is not None and n < -1:
+        if size is not None and size < -1:
             raise ValueError("invalid number of bytes to read")
         with self._read_lock:
-            return self._read_unlocked(n)
+            return self._read_unlocked(size)
 
     def _read_unlocked(self, n=None):
         nodata_val = b""
@@ -1011,7 +1026,7 @@
         self._read_pos = 0
         return out[:n] if out else nodata_val
 
-    def peek(self, n=0):
+    def peek(self, size=0):
         """Returns buffered bytes without advancing the position.
 
         The argument indicates a desired minimal number of bytes; we
@@ -1019,7 +1034,7 @@
         than self.buffer_size.
         """
         with self._read_lock:
-            return self._peek_unlocked(n)
+            return self._peek_unlocked(size)
 
     def _peek_unlocked(self, n=0):
         want = min(n, self.buffer_size)
@@ -1037,18 +1052,18 @@
                 self._read_pos = 0
         return self._read_buf[self._read_pos:]
 
-    def read1(self, n):
-        """Reads up to n bytes, with at most one read() system call."""
-        # Returns up to n bytes.  If at least one byte is buffered, we
+    def read1(self, size):
+        """Reads up to size bytes, with at most one read() system call."""
+        # Returns up to size bytes.  If at least one byte is buffered, we
         # only return buffered bytes.  Otherwise, we do one raw read.
-        if n < 0:
+        if size < 0:
             raise ValueError("number of bytes to read must be positive")
-        if n == 0:
+        if size == 0:
             return b""
         with self._read_lock:
             self._peek_unlocked(1)
             return self._read_unlocked(
-                min(n, len(self._read_buf) - self._read_pos))
+                min(size, len(self._read_buf) - self._read_pos))
 
     def tell(self):
         return _BufferedIOMixin.tell(self) - len(self._read_buf) + self._read_pos
@@ -1074,7 +1089,7 @@
 
     def __init__(self, raw, buffer_size=DEFAULT_BUFFER_SIZE):
         if not raw.writable():
-            raise IOError('"raw" argument must be writable.')
+            raise OSError('"raw" argument must be writable.')
 
         _BufferedIOMixin.__init__(self, raw)
         if buffer_size <= 0:
@@ -1138,7 +1153,7 @@
                     errno.EAGAIN,
                     "write could not complete without blocking", 0)
             if n > len(self._write_buf) or n < 0:
-                raise IOError("write() returned incorrect number of bytes")
+                raise OSError("write() returned incorrect number of bytes")
             del self._write_buf[:n]
 
     def tell(self):
@@ -1174,18 +1189,18 @@
         The arguments are two RawIO instances.
         """
         if not reader.readable():
-            raise IOError('"reader" argument must be readable.')
+            raise OSError('"reader" argument must be readable.')
 
         if not writer.writable():
-            raise IOError('"writer" argument must be writable.')
+            raise OSError('"writer" argument must be writable.')
 
         self.reader = BufferedReader(reader, buffer_size)
         self.writer = BufferedWriter(writer, buffer_size)
 
-    def read(self, n=None):
-        if n is None:
-            n = -1
-        return self.reader.read(n)
+    def read(self, size=None):
+        if size is None:
+            size = -1
+        return self.reader.read(size)
 
     def readinto(self, b):
         return self.reader.readinto(b)
@@ -1193,11 +1208,11 @@
     def write(self, b):
         return self.writer.write(b)
 
-    def peek(self, n=0):
-        return self.reader.peek(n)
+    def peek(self, size=0):
+        return self.reader.peek(size)
 
-    def read1(self, n):
-        return self.reader.read1(n)
+    def read1(self, size):
+        return self.reader.read1(size)
 
     def readable(self):
         return self.reader.readable()
@@ -1248,7 +1263,7 @@
         with self._read_lock:
             self._reset_read_buf()
         if pos < 0:
-            raise IOError("seek() returned invalid position")
+            raise OSError("seek() returned invalid position")
         return pos
 
     def tell(self):
@@ -1263,23 +1278,23 @@
         # Use seek to flush the read buffer.
         return BufferedWriter.truncate(self, pos)
 
-    def read(self, n=None):
-        if n is None:
-            n = -1
+    def read(self, size=None):
+        if size is None:
+            size = -1
         self.flush()
-        return BufferedReader.read(self, n)
+        return BufferedReader.read(self, size)
 
     def readinto(self, b):
         self.flush()
         return BufferedReader.readinto(self, b)
 
-    def peek(self, n=0):
+    def peek(self, size=0):
         self.flush()
-        return BufferedReader.peek(self, n)
+        return BufferedReader.peek(self, size)
 
-    def read1(self, n):
+    def read1(self, size):
         self.flush()
-        return BufferedReader.read1(self, n)
+        return BufferedReader.read1(self, size)
 
     def write(self, b):
         if self._read_buf:
@@ -1299,11 +1314,11 @@
     are immutable. There is no public constructor.
     """
 
-    def read(self, n=-1):
-        """Read at most n characters from stream, where n is an int.
+    def read(self, size=-1):
+        """Read at most size characters from stream, where size is an int.
 
-        Read from underlying buffer until we have n characters or we hit EOF.
-        If n is negative or omitted, read until EOF.
+        Read from underlying buffer until we have size characters or we hit EOF.
+        If size is negative or omitted, read until EOF.
 
         Returns a string.
         """
@@ -1546,13 +1561,13 @@
         result = "<_pyio.TextIOWrapper"
         try:
             name = self.name
-        except AttributeError:
+        except Exception:
             pass
         else:
             result += " name={0!r}".format(name)
         try:
             mode = self.mode
-        except AttributeError:
+        except Exception:
             pass
         else:
             result += " mode={0!r}".format(mode)
@@ -1732,7 +1747,7 @@
         if not self._seekable:
             raise UnsupportedOperation("underlying stream is not seekable")
         if not self._telling:
-            raise IOError("telling position disabled by next() call")
+            raise OSError("telling position disabled by next() call")
         self.flush()
         position = self.buffer.tell()
         decoder = self._decoder
@@ -1819,7 +1834,7 @@
                 chars_decoded += len(decoder.decode(b'', final=True))
                 need_eof = 1
                 if chars_decoded < chars_to_skip:
-                    raise IOError("can't reconstruct logical file position")
+                    raise OSError("can't reconstruct logical file position")
 
             # The returned cookie corresponds to the last safe start point.
             return self._pack_cookie(
@@ -1896,7 +1911,7 @@
 
             # Skip chars_to_skip of the decoded characters.
             if len(self._decoded_chars) < chars_to_skip:
-                raise IOError("can't restore logical file position")
+                raise OSError("can't restore logical file position")
             self._decoded_chars_used = chars_to_skip
 
         # Finally, reset the encoder (merely useful for proper BOM handling)
@@ -1912,16 +1927,16 @@
                 encoder.reset()
         return cookie
 
-    def read(self, n=None):
+    def read(self, size=None):
         self._checkReadable()
-        if n is None:
-            n = -1
+        if size is None:
+            size = -1
         decoder = self._decoder or self._get_decoder()
         try:
-            n.__index__
+            size.__index__
         except AttributeError as err:
             raise TypeError("an integer is required") from err
-        if n < 0:
+        if size < 0:
             # Read everything.
             result = (self._get_decoded_chars() +
                       decoder.decode(self.buffer.read(), final=True))
@@ -1929,12 +1944,12 @@
             self._snapshot = None
             return result
         else:
-            # Keep reading chunks until we have n characters to return.
+            # Keep reading chunks until we have size characters to return.
             eof = False
-            result = self._get_decoded_chars(n)
-            while len(result) < n and not eof:
+            result = self._get_decoded_chars(size)
+            while len(result) < size and not eof:
                 eof = not self._read_chunk()
-                result += self._get_decoded_chars(n - len(result))
+                result += self._get_decoded_chars(size - len(result))
             return result
 
     def __next__(self):
@@ -1946,13 +1961,13 @@
             raise StopIteration
         return line
 
-    def readline(self, limit=None):
+    def readline(self, size=None):
         if self.closed:
             raise ValueError("read from closed file")
-        if limit is None:
-            limit = -1
-        elif not isinstance(limit, int):
-            raise TypeError("limit must be an integer")
+        if size is None:
+            size = -1
+        elif not isinstance(size, int):
+            raise TypeError("size must be an integer")
 
         # Grab all the decoded text (we will rewind any extra bits later).
         line = self._get_decoded_chars()
@@ -2011,8 +2026,8 @@
                     endpos = pos + len(self._readnl)
                     break
 
-            if limit >= 0 and len(line) >= limit:
-                endpos = limit  # reached length limit
+            if size >= 0 and len(line) >= size:
+                endpos = size  # reached length size
                 break
 
             # No line ending seen yet - get more data'
@@ -2027,8 +2042,8 @@
                 self._snapshot = None
                 return line
 
-        if limit >= 0 and endpos > limit:
-            endpos = limit  # don't exceed limit
+        if size >= 0 and endpos > size:
+            endpos = size  # don't exceed size
 
         # Rewind _decoded_chars to just after the line ending we found.
         self._rewind_decoded_chars(len(line) - endpos)
@@ -2059,7 +2074,6 @@
             if not isinstance(initial_value, str):
                 raise TypeError("initial_value must be str or None, not {0}"
                                 .format(type(initial_value).__name__))
-                initial_value = str(initial_value)
             self.write(initial_value)
             self.seek(0)
 
diff --git a/Lib/_sitebuiltins.py b/Lib/_sitebuiltins.py
new file mode 100644
index 0000000..c29cf4b
--- /dev/null
+++ b/Lib/_sitebuiltins.py
@@ -0,0 +1,103 @@
+"""
+The objects used by the site module to add custom builtins.
+"""
+
+# Those objects are almost immortal and they keep a reference to their module
+# globals.  Defining them in the site module would keep too many references
+# alive.
+# Note this means this module should also avoid keep things alive in its
+# globals.
+
+import sys
+
+class Quitter(object):
+    def __init__(self, name, eof):
+        self.name = name
+        self.eof = eof
+    def __repr__(self):
+        return 'Use %s() or %s to exit' % (self.name, self.eof)
+    def __call__(self, code=None):
+        # Shells like IDLE catch the SystemExit, but listen when their
+        # stdin wrapper is closed.
+        try:
+            sys.stdin.close()
+        except:
+            pass
+        raise SystemExit(code)
+
+
+class _Printer(object):
+    """interactive prompt objects for printing the license text, a list of
+    contributors and the copyright notice."""
+
+    MAXLINES = 23
+
+    def __init__(self, name, data, files=(), dirs=()):
+        import os
+        self.__name = name
+        self.__data = data
+        self.__lines = None
+        self.__filenames = [os.path.join(dir, filename)
+                            for dir in dirs
+                            for filename in files]
+
+    def __setup(self):
+        if self.__lines:
+            return
+        data = None
+        for filename in self.__filenames:
+            try:
+                with open(filename, "r") as fp:
+                    data = fp.read()
+                break
+            except OSError:
+                pass
+        if not data:
+            data = self.__data
+        self.__lines = data.split('\n')
+        self.__linecnt = len(self.__lines)
+
+    def __repr__(self):
+        self.__setup()
+        if len(self.__lines) <= self.MAXLINES:
+            return "\n".join(self.__lines)
+        else:
+            return "Type %s() to see the full %s text" % ((self.__name,)*2)
+
+    def __call__(self):
+        self.__setup()
+        prompt = 'Hit Return for more, or q (and Return) to quit: '
+        lineno = 0
+        while 1:
+            try:
+                for i in range(lineno, lineno + self.MAXLINES):
+                    print(self.__lines[i])
+            except IndexError:
+                break
+            else:
+                lineno += self.MAXLINES
+                key = None
+                while key is None:
+                    key = input(prompt)
+                    if key not in ('', 'q'):
+                        key = None
+                if key == 'q':
+                    break
+
+
+class _Helper(object):
+    """Define the builtin 'help'.
+
+    This is a wrapper around pydoc.help that provides a helpful message
+    when 'help' is typed at the Python interactive prompt.
+
+    Calling help() at the Python prompt starts an interactive help session.
+    Calling help(thing) prints help for the python object 'thing'.
+    """
+
+    def __repr__(self):
+        return "Type help() for interactive help, " \
+               "or help(object) for help about object."
+    def __call__(self, *args, **kwds):
+        import pydoc
+        return pydoc.help(*args, **kwds)
diff --git a/Lib/_strptime.py b/Lib/_strptime.py
index 9058a69..53bd34b 100644
--- a/Lib/_strptime.py
+++ b/Lib/_strptime.py
@@ -14,14 +14,14 @@
 import locale
 import calendar
 from re import compile as re_compile
-from re import IGNORECASE, ASCII
+from re import IGNORECASE
 from re import escape as re_escape
 from datetime import (date as datetime_date,
                       timedelta as datetime_timedelta,
                       timezone as datetime_timezone)
 try:
     from _thread import allocate_lock as _thread_allocate_lock
-except:
+except ImportError:
     from _dummy_thread import allocate_lock as _thread_allocate_lock
 
 __all__ = []
diff --git a/Lib/abc.py b/Lib/abc.py
index 09778e8..0358a46 100644
--- a/Lib/abc.py
+++ b/Lib/abc.py
@@ -5,6 +5,7 @@
 
 from _weakrefset import WeakSet
 
+
 def abstractmethod(funcobj):
     """A decorator indicating abstract methods.
 
@@ -124,6 +125,8 @@
     # A global counter that is incremented each time a class is
     # registered as a virtual subclass of anything.  It forces the
     # negative cache to be cleared before its next use.
+    # Note: this counter is private. Use `abc.get_cache_token()` for
+    #       external code.
     _abc_invalidation_counter = 0
 
     def __new__(mcls, name, bases, namespace):
@@ -226,3 +229,20 @@
         # No dice; update negative cache
         cls._abc_negative_cache.add(subclass)
         return False
+
+
+class ABC(metaclass=ABCMeta):
+    """Helper class that provides a standard way to create an ABC using
+    inheritance.
+    """
+    pass
+
+
+def get_cache_token():
+    """Returns the current ABC cache token.
+
+    The token is an opaque object (supporting equality testing) identifying the
+    current version of the ABC cache for virtual subclasses. The token changes
+    with every call to ``register()`` on any ABC.
+    """
+    return ABCMeta._abc_invalidation_counter
diff --git a/Lib/aifc.py b/Lib/aifc.py
index db0924a..9e64de9 100644
--- a/Lib/aifc.py
+++ b/Lib/aifc.py
@@ -69,7 +69,7 @@
   getcomptype()   -- returns compression type ('NONE' for AIFF files)
   getcompname()   -- returns human-readable version of
              compression type ('not compressed' for AIFF files)
-  getparams() -- returns a tuple consisting of all of the
+  getparams() -- returns a namedtuple consisting of all of the
              above in the above order
   getmarkers()    -- get the list of marks in the audio file or None
              if there are no marks
@@ -252,6 +252,11 @@
     _write_ulong(f, lomant)
 
 from chunk import Chunk
+from collections import namedtuple
+
+_aifc_params = namedtuple('_aifc_params',
+                          'nchannels sampwidth framerate nframes comptype compname')
+
 
 class Aifc_read:
     # Variables used in this class:
@@ -334,6 +339,12 @@
         # else, assume it is an open file object already
         self.initfp(f)
 
+    def __enter__(self):
+        return self
+
+    def __exit__(self, *args):
+        self.close()
+
     #
     # User visible methods.
     #
@@ -372,9 +383,9 @@
 ##      return self._version
 
     def getparams(self):
-        return self.getnchannels(), self.getsampwidth(), \
-              self.getframerate(), self.getnframes(), \
-              self.getcomptype(), self.getcompname()
+        return _aifc_params(self.getnchannels(), self.getsampwidth(),
+                            self.getframerate(), self.getnframes(),
+                            self.getcomptype(), self.getcompname())
 
     def getmarkers(self):
         if len(self._markers) == 0:
@@ -551,6 +562,12 @@
     def __del__(self):
         self.close()
 
+    def __enter__(self):
+        return self
+
+    def __exit__(self, *args):
+        self.close()
+
     #
     # User visible methods.
     #
@@ -644,8 +661,8 @@
     def getparams(self):
         if not self._nchannels or not self._sampwidth or not self._framerate:
             raise Error('not all parameters set')
-        return self._nchannels, self._sampwidth, self._framerate, \
-              self._nframes, self._comptype, self._compname
+        return _aifc_params(self._nchannels, self._sampwidth, self._framerate,
+                            self._nframes, self._comptype, self._compname)
 
     def setmark(self, id, pos, name):
         if id <= 0:
@@ -675,6 +692,8 @@
         return self._nframeswritten
 
     def writeframesraw(self, data):
+        if not isinstance(data, (bytes, bytearray)):
+            data = memoryview(data).cast('B')
         self._ensure_header_written(len(data))
         nframes = len(data) // (self._sampwidth * self._nchannels)
         if self._convert:
@@ -878,8 +897,7 @@
     if not sys.argv[1:]:
         sys.argv.append('/usr/demos/data/audio/bach.aiff')
     fn = sys.argv[1]
-    f = open(fn, 'r')
-    try:
+    with open(fn, 'r') as f:
         print("Reading", fn)
         print("nchannels =", f.getnchannels())
         print("nframes   =", f.getnframes())
@@ -890,16 +908,11 @@
         if sys.argv[2:]:
             gn = sys.argv[2]
             print("Writing", gn)
-            g = open(gn, 'w')
-            try:
+            with open(gn, 'w') as g:
                 g.setparams(f.getparams())
                 while 1:
                     data = f.readframes(1024)
                     if not data:
                         break
                     g.writeframes(data)
-            finally:
-                g.close()
             print("Done.")
-    finally:
-        f.close()
diff --git a/Lib/argparse.py b/Lib/argparse.py
index bc2ba13..be276bb 100644
--- a/Lib/argparse.py
+++ b/Lib/argparse.py
@@ -490,7 +490,7 @@
         action_width = help_position - self._current_indent - 2
         action_header = self._format_action_invocation(action)
 
-        # ho nelp; start on same line and add a final newline
+        # no help; start on same line and add a final newline
         if not action.help:
             tup = self._current_indent, '', action_header
             action_header = '%*s%s\n' % tup
@@ -608,8 +608,7 @@
             pass
         else:
             self._indent()
-            for subaction in get_subactions():
-                yield subaction
+            yield from get_subactions()
             self._dedent()
 
     def _split_lines(self, text, width):
@@ -1040,7 +1039,8 @@
             version = parser.version
         formatter = parser._get_formatter()
         formatter.add_text(version)
-        parser.exit(message=formatter.format_help())
+        parser._print_message(formatter.format_help(), _sys.stdout)
+        parser.exit()
 
 
 class _SubParsersAction(Action):
@@ -1122,7 +1122,14 @@
         # parse all the remaining options into the namespace
         # store any unrecognized options on the object, so that the top
         # level parser can decide what to do with them
-        namespace, arg_strings = parser.parse_known_args(arg_strings, namespace)
+
+        # In case this subparser defines new defaults, we parse them
+        # in a new namespace object and then update the original
+        # namespace for the relevant parts.
+        subnamespace, arg_strings = parser.parse_known_args(arg_strings, None)
+        for key, value in vars(subnamespace).items():
+            setattr(namespace, key, value)
+
         if arg_strings:
             vars(namespace).setdefault(_UNRECOGNIZED_ARGS_ATTR, [])
             getattr(namespace, _UNRECOGNIZED_ARGS_ATTR).extend(arg_strings)
@@ -1143,11 +1150,17 @@
             same values as the builtin open() function.
         - bufsize -- The file's desired buffer size. Accepts the same values as
             the builtin open() function.
+        - encoding -- The file's encoding. Accepts the same values as the
+            builtin open() function.
+        - errors -- A string indicating how encoding and decoding errors are to
+            be handled. Accepts the same value as the builtin open() function.
     """
 
-    def __init__(self, mode='r', bufsize=-1):
+    def __init__(self, mode='r', bufsize=-1, encoding=None, errors=None):
         self._mode = mode
         self._bufsize = bufsize
+        self._encoding = encoding
+        self._errors = errors
 
     def __call__(self, string):
         # the special argument "-" means sys.std{in,out}
@@ -1162,14 +1175,18 @@
 
         # all other arguments are used as file names
         try:
-            return open(string, self._mode, self._bufsize)
-        except IOError as e:
+            return open(string, self._mode, self._bufsize, self._encoding,
+                        self._errors)
+        except OSError as e:
             message = _("can't open '%s': %s")
             raise ArgumentTypeError(message % (string, e))
 
     def __repr__(self):
         args = self._mode, self._bufsize
-        args_str = ', '.join(repr(arg) for arg in args if arg != -1)
+        kwargs = [('encoding', self._encoding), ('errors', self._errors)]
+        args_str = ', '.join([repr(arg) for arg in args if arg != -1] +
+                             ['%s=%r' % (kw, arg) for kw, arg in kwargs
+                              if arg is not None])
         return '%s(%s)' % (type(self).__name__, args_str)
 
 # ===========================
@@ -1188,9 +1205,13 @@
             setattr(self, name, kwargs[name])
 
     def __eq__(self, other):
+        if not isinstance(other, Namespace):
+            return NotImplemented
         return vars(self) == vars(other)
 
     def __ne__(self, other):
+        if not isinstance(other, Namespace):
+            return NotImplemented
         return not (self == other)
 
     def __contains__(self, key):
@@ -2003,17 +2024,14 @@
             # replace arguments referencing files with the file content
             else:
                 try:
-                    args_file = open(arg_string[1:])
-                    try:
+                    with open(arg_string[1:]) as args_file:
                         arg_strings = []
                         for arg_line in args_file.read().splitlines():
                             for arg in self.convert_arg_line_to_args(arg_line):
                                 arg_strings.append(arg)
                         arg_strings = self._read_args_from_files(arg_strings)
                         new_arg_strings.extend(arg_strings)
-                    finally:
-                        args_file.close()
-                except IOError:
+                except OSError:
                     err = _sys.exc_info()[1]
                     self.error(str(err))
 
diff --git a/Lib/ast.py b/Lib/ast.py
index 13f59f9..02c3b28 100644
--- a/Lib/ast.py
+++ b/Lib/ast.py
@@ -42,7 +42,6 @@
     Python literal structures: strings, bytes, numbers, tuples, lists, dicts,
     sets, booleans, and None.
     """
-    _safe_names = {'None': None, 'True': True, 'False': False}
     if isinstance(node_or_string, str):
         node_or_string = parse(node_or_string, mode='eval')
     if isinstance(node_or_string, Expression):
@@ -61,9 +60,8 @@
         elif isinstance(node, Dict):
             return dict((_convert(k), _convert(v)) for k, v
                         in zip(node.keys, node.values))
-        elif isinstance(node, Name):
-            if node.id in _safe_names:
-                return _safe_names[node.id]
+        elif isinstance(node, NameConstant):
+            return node.value
         elif isinstance(node, UnaryOp) and \
              isinstance(node.op, (UAdd, USub)) and \
              isinstance(node.operand, (Num, UnaryOp, BinOp)):
diff --git a/Lib/asynchat.py b/Lib/asynchat.py
index eea3418..14c152f 100644
--- a/Lib/asynchat.py
+++ b/Lib/asynchat.py
@@ -45,27 +45,26 @@
 method) up to the terminator, and then control will be returned to
 you - by calling your self.found_terminator() method.
 """
-import socket
 import asyncore
 from collections import deque
 
 
-class async_chat (asyncore.dispatcher):
+class async_chat(asyncore.dispatcher):
     """This is an abstract class.  You must derive from this class, and add
     the two methods collect_incoming_data() and found_terminator()"""
 
     # these are overridable defaults
 
-    ac_in_buffer_size       = 4096
-    ac_out_buffer_size      = 4096
+    ac_in_buffer_size = 65536
+    ac_out_buffer_size = 65536
 
     # we don't want to enable the use of encoding by default, because that is a
     # sign of an application bug that we don't want to pass silently
 
-    use_encoding            = 0
-    encoding                = 'latin-1'
+    use_encoding = 0
+    encoding = 'latin-1'
 
-    def __init__ (self, sock=None, map=None):
+    def __init__(self, sock=None, map=None):
         # for string terminator matching
         self.ac_in_buffer = b''
 
@@ -77,7 +76,7 @@
         # we toss the use of the "simple producer" and replace it with
         # a pure deque, which the original fifo was a wrapping of
         self.producer_fifo = deque()
-        asyncore.dispatcher.__init__ (self, sock, map)
+        asyncore.dispatcher.__init__(self, sock, map)
 
     def collect_incoming_data(self, data):
         raise NotImplementedError("must be implemented in subclass")
@@ -93,13 +92,18 @@
     def found_terminator(self):
         raise NotImplementedError("must be implemented in subclass")
 
-    def set_terminator (self, term):
-        "Set the input delimiter.  Can be a fixed string of any length, an integer, or None"
+    def set_terminator(self, term):
+        """Set the input delimiter.
+
+        Can be a fixed string of any length, an integer, or None.
+        """
         if isinstance(term, str) and self.use_encoding:
             term = bytes(term, self.encoding)
+        elif isinstance(term, int) and term < 0:
+            raise ValueError('the number of received bytes must be positive')
         self.terminator = term
 
-    def get_terminator (self):
+    def get_terminator(self):
         return self.terminator
 
     # grab some more data from the socket,
@@ -107,11 +111,13 @@
     # check for the terminator,
     # if found, transition to the next state.
 
-    def handle_read (self):
+    def handle_read(self):
 
         try:
-            data = self.recv (self.ac_in_buffer_size)
-        except socket.error as why:
+            data = self.recv(self.ac_in_buffer_size)
+        except BlockingIOError:
+            return
+        except OSError as why:
             self.handle_error()
             return
 
@@ -129,17 +135,17 @@
             terminator = self.get_terminator()
             if not terminator:
                 # no terminator, collect it all
-                self.collect_incoming_data (self.ac_in_buffer)
+                self.collect_incoming_data(self.ac_in_buffer)
                 self.ac_in_buffer = b''
             elif isinstance(terminator, int):
                 # numeric terminator
                 n = terminator
                 if lb < n:
-                    self.collect_incoming_data (self.ac_in_buffer)
+                    self.collect_incoming_data(self.ac_in_buffer)
                     self.ac_in_buffer = b''
                     self.terminator = self.terminator - lb
                 else:
-                    self.collect_incoming_data (self.ac_in_buffer[:n])
+                    self.collect_incoming_data(self.ac_in_buffer[:n])
                     self.ac_in_buffer = self.ac_in_buffer[n:]
                     self.terminator = 0
                     self.found_terminator()
@@ -156,32 +162,37 @@
                 if index != -1:
                     # we found the terminator
                     if index > 0:
-                        # don't bother reporting the empty string (source of subtle bugs)
-                        self.collect_incoming_data (self.ac_in_buffer[:index])
+                        # don't bother reporting the empty string
+                        # (source of subtle bugs)
+                        self.collect_incoming_data(self.ac_in_buffer[:index])
                     self.ac_in_buffer = self.ac_in_buffer[index+terminator_len:]
-                    # This does the Right Thing if the terminator is changed here.
+                    # This does the Right Thing if the terminator
+                    # is changed here.
                     self.found_terminator()
                 else:
                     # check for a prefix of the terminator
-                    index = find_prefix_at_end (self.ac_in_buffer, terminator)
+                    index = find_prefix_at_end(self.ac_in_buffer, terminator)
                     if index:
                         if index != lb:
                             # we found a prefix, collect up to the prefix
-                            self.collect_incoming_data (self.ac_in_buffer[:-index])
+                            self.collect_incoming_data(self.ac_in_buffer[:-index])
                             self.ac_in_buffer = self.ac_in_buffer[-index:]
                         break
                     else:
                         # no prefix, collect it all
-                        self.collect_incoming_data (self.ac_in_buffer)
+                        self.collect_incoming_data(self.ac_in_buffer)
                         self.ac_in_buffer = b''
 
-    def handle_write (self):
+    def handle_write(self):
         self.initiate_send()
 
-    def handle_close (self):
+    def handle_close(self):
         self.close()
 
-    def push (self, data):
+    def push(self, data):
+        if not isinstance(data, (bytes, bytearray, memoryview)):
+            raise TypeError('data argument must be byte-ish (%r)',
+                            type(data))
         sabs = self.ac_out_buffer_size
         if len(data) > sabs:
             for i in range(0, len(data), sabs):
@@ -190,11 +201,11 @@
             self.producer_fifo.append(data)
         self.initiate_send()
 
-    def push_with_producer (self, producer):
+    def push_with_producer(self, producer):
         self.producer_fifo.append(producer)
         self.initiate_send()
 
-    def readable (self):
+    def readable(self):
         "predicate for inclusion in the readable for select()"
         # cannot use the old predicate, it violates the claim of the
         # set_terminator method.
@@ -202,11 +213,11 @@
         # return (len(self.ac_in_buffer) <= self.ac_in_buffer_size)
         return 1
 
-    def writable (self):
+    def writable(self):
         "predicate for inclusion in the writable for select()"
         return self.producer_fifo or (not self.connected)
 
-    def close_when_done (self):
+    def close_when_done(self):
         "automatically close this channel once the outgoing queue is empty"
         self.producer_fifo.append(None)
 
@@ -217,10 +228,8 @@
             if not first:
                 del self.producer_fifo[0]
                 if first is None:
-                    ## print("first is None")
                     self.handle_close()
                     return
-                ## print("first is not None")
 
             # handle classic producer behavior
             obs = self.ac_out_buffer_size
@@ -240,7 +249,7 @@
             # send the data
             try:
                 num_sent = self.send(data)
-            except socket.error:
+            except OSError:
                 self.handle_error()
                 return
 
@@ -252,20 +261,21 @@
             # we tried to send some actual data
             return
 
-    def discard_buffers (self):
+    def discard_buffers(self):
         # Emergencies only!
         self.ac_in_buffer = b''
         del self.incoming[:]
         self.producer_fifo.clear()
 
+
 class simple_producer:
 
-    def __init__ (self, data, buffer_size=512):
+    def __init__(self, data, buffer_size=512):
         self.data = data
         self.buffer_size = buffer_size
 
-    def more (self):
-        if len (self.data) > self.buffer_size:
+    def more(self):
+        if len(self.data) > self.buffer_size:
             result = self.data[:self.buffer_size]
             self.data = self.data[self.buffer_size:]
             return result
@@ -274,38 +284,40 @@
             self.data = b''
             return result
 
+
 class fifo:
-    def __init__ (self, list=None):
+    def __init__(self, list=None):
         if not list:
             self.list = deque()
         else:
             self.list = deque(list)
 
-    def __len__ (self):
+    def __len__(self):
         return len(self.list)
 
-    def is_empty (self):
+    def is_empty(self):
         return not self.list
 
-    def first (self):
+    def first(self):
         return self.list[0]
 
-    def push (self, data):
+    def push(self, data):
         self.list.append(data)
 
-    def pop (self):
+    def pop(self):
         if self.list:
             return (1, self.list.popleft())
         else:
             return (0, None)
 
+
 # Given 'haystack', see if any prefix of 'needle' is at its end.  This
 # assumes an exact match has already been checked.  Return the number of
 # characters matched.
 # for example:
-# f_p_a_e ("qwerty\r", "\r\n") => 1
-# f_p_a_e ("qwertydkjf", "\r\n") => 0
-# f_p_a_e ("qwerty\r\n", "\r\n") => <undefined>
+# f_p_a_e("qwerty\r", "\r\n") => 1
+# f_p_a_e("qwertydkjf", "\r\n") => 0
+# f_p_a_e("qwerty\r\n", "\r\n") => <undefined>
 
 # this could maybe be made faster with a computed regex?
 # [answer: no; circa Python-2.0, Jan 2001]
@@ -314,7 +326,7 @@
 # re:        12820/s
 # regex:     14035/s
 
-def find_prefix_at_end (haystack, needle):
+def find_prefix_at_end(haystack, needle):
     l = len(needle) - 1
     while l and not haystack.endswith(needle[:l]):
         l -= 1
diff --git a/Lib/asyncio/__init__.py b/Lib/asyncio/__init__.py
new file mode 100644
index 0000000..011466b
--- /dev/null
+++ b/Lib/asyncio/__init__.py
@@ -0,0 +1,50 @@
+"""The asyncio package, tracking PEP 3156."""
+
+import sys
+
+# The selectors module is in the stdlib in Python 3.4 but not in 3.3.
+# Do this first, so the other submodules can use "from . import selectors".
+# Prefer asyncio/selectors.py over the stdlib one, as ours may be newer.
+try:
+    from . import selectors
+except ImportError:
+    import selectors  # Will also be exported.
+
+if sys.platform == 'win32':
+    # Similar thing for _overlapped.
+    try:
+        from . import _overlapped
+    except ImportError:
+        import _overlapped  # Will also be exported.
+
+# This relies on each of the submodules having an __all__ variable.
+from .base_events import *
+from .coroutines import *
+from .events import *
+from .futures import *
+from .locks import *
+from .protocols import *
+from .queues import *
+from .streams import *
+from .subprocess import *
+from .tasks import *
+from .transports import *
+
+__all__ = (base_events.__all__ +
+           coroutines.__all__ +
+           events.__all__ +
+           futures.__all__ +
+           locks.__all__ +
+           protocols.__all__ +
+           queues.__all__ +
+           streams.__all__ +
+           subprocess.__all__ +
+           tasks.__all__ +
+           transports.__all__)
+
+if sys.platform == 'win32':  # pragma: no cover
+    from .windows_events import *
+    __all__ += windows_events.__all__
+else:
+    from .unix_events import *  # pragma: no cover
+    __all__ += unix_events.__all__
diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py
new file mode 100644
index 0000000..7108f25
--- /dev/null
+++ b/Lib/asyncio/base_events.py
@@ -0,0 +1,1163 @@
+"""Base implementation of event loop.
+
+The event loop can be broken up into a multiplexer (the part
+responsible for notifying us of I/O events) and the event loop proper,
+which wraps a multiplexer with functionality for scheduling callbacks,
+immediately or at a given time in the future.
+
+Whenever a public API takes a callback, subsequent positional
+arguments will be passed to the callback if/when it is called.  This
+avoids the proliferation of trivial lambdas implementing closures.
+Keyword arguments for the callback are not supported; this is a
+conscious design decision, leaving the door open for keyword arguments
+to modify the meaning of the API call itself.
+"""
+
+
+import collections
+import concurrent.futures
+import heapq
+import inspect
+import logging
+import os
+import socket
+import subprocess
+import threading
+import time
+import traceback
+import sys
+import warnings
+
+from . import coroutines
+from . import events
+from . import futures
+from . import tasks
+from .coroutines import coroutine
+from .log import logger
+
+
+__all__ = ['BaseEventLoop']
+
+
+# Argument for default thread pool executor creation.
+_MAX_WORKERS = 5
+
+# Minimum number of _scheduled timer handles before cleanup of
+# cancelled handles is performed.
+_MIN_SCHEDULED_TIMER_HANDLES = 100
+
+# Minimum fraction of _scheduled timer handles that are cancelled
+# before cleanup of cancelled handles is performed.
+_MIN_CANCELLED_TIMER_HANDLES_FRACTION = 0.5
+
+def _format_handle(handle):
+    cb = handle._callback
+    if inspect.ismethod(cb) and isinstance(cb.__self__, tasks.Task):
+        # format the task
+        return repr(cb.__self__)
+    else:
+        return str(handle)
+
+
+def _format_pipe(fd):
+    if fd == subprocess.PIPE:
+        return '<pipe>'
+    elif fd == subprocess.STDOUT:
+        return '<stdout>'
+    else:
+        return repr(fd)
+
+
+class _StopError(BaseException):
+    """Raised to stop the event loop."""
+
+
+def _check_resolved_address(sock, address):
+    # Ensure that the address is already resolved to avoid the trap of hanging
+    # the entire event loop when the address requires doing a DNS lookup.
+    family = sock.family
+    if family == socket.AF_INET:
+        host, port = address
+    elif family == socket.AF_INET6:
+        host, port = address[:2]
+    else:
+        return
+
+    type_mask = 0
+    if hasattr(socket, 'SOCK_NONBLOCK'):
+        type_mask |= socket.SOCK_NONBLOCK
+    if hasattr(socket, 'SOCK_CLOEXEC'):
+        type_mask |= socket.SOCK_CLOEXEC
+    # Use getaddrinfo(flags=AI_NUMERICHOST) to ensure that the address is
+    # already resolved.
+    try:
+        socket.getaddrinfo(host, port,
+                           family=family,
+                           type=(sock.type & ~type_mask),
+                           proto=sock.proto,
+                           flags=socket.AI_NUMERICHOST)
+    except socket.gaierror as err:
+        raise ValueError("address must be resolved (IP address), got %r: %s"
+                         % (address, err))
+
+def _raise_stop_error(*args):
+    raise _StopError
+
+
+def _run_until_complete_cb(fut):
+    exc = fut._exception
+    if (isinstance(exc, BaseException)
+    and not isinstance(exc, Exception)):
+        # Issue #22429: run_forever() already finished, no need to
+        # stop it.
+        return
+    _raise_stop_error()
+
+
+class Server(events.AbstractServer):
+
+    def __init__(self, loop, sockets):
+        self._loop = loop
+        self.sockets = sockets
+        self._active_count = 0
+        self._waiters = []
+
+    def __repr__(self):
+        return '<%s sockets=%r>' % (self.__class__.__name__, self.sockets)
+
+    def _attach(self):
+        assert self.sockets is not None
+        self._active_count += 1
+
+    def _detach(self):
+        assert self._active_count > 0
+        self._active_count -= 1
+        if self._active_count == 0 and self.sockets is None:
+            self._wakeup()
+
+    def close(self):
+        sockets = self.sockets
+        if sockets is None:
+            return
+        self.sockets = None
+        for sock in sockets:
+            self._loop._stop_serving(sock)
+        if self._active_count == 0:
+            self._wakeup()
+
+    def _wakeup(self):
+        waiters = self._waiters
+        self._waiters = None
+        for waiter in waiters:
+            if not waiter.done():
+                waiter.set_result(waiter)
+
+    @coroutine
+    def wait_closed(self):
+        if self.sockets is None or self._waiters is None:
+            return
+        waiter = futures.Future(loop=self._loop)
+        self._waiters.append(waiter)
+        yield from waiter
+
+
+class BaseEventLoop(events.AbstractEventLoop):
+
+    def __init__(self):
+        self._timer_cancelled_count = 0
+        self._closed = False
+        self._ready = collections.deque()
+        self._scheduled = []
+        self._default_executor = None
+        self._internal_fds = 0
+        # Identifier of the thread running the event loop, or None if the
+        # event loop is not running
+        self._owner = None
+        self._clock_resolution = time.get_clock_info('monotonic').resolution
+        self._exception_handler = None
+        self._debug = (not sys.flags.ignore_environment
+                       and bool(os.environ.get('PYTHONASYNCIODEBUG')))
+        # In debug mode, if the execution of a callback or a step of a task
+        # exceed this duration in seconds, the slow callback/task is logged.
+        self.slow_callback_duration = 0.1
+        self._current_handle = None
+
+    def __repr__(self):
+        return ('<%s running=%s closed=%s debug=%s>'
+                % (self.__class__.__name__, self.is_running(),
+                   self.is_closed(), self.get_debug()))
+
+    def create_task(self, coro):
+        """Schedule a coroutine object.
+
+        Return a task object.
+        """
+        self._check_closed()
+        task = tasks.Task(coro, loop=self)
+        if task._source_traceback:
+            del task._source_traceback[-1]
+        return task
+
+    def _make_socket_transport(self, sock, protocol, waiter=None, *,
+                               extra=None, server=None):
+        """Create socket transport."""
+        raise NotImplementedError
+
+    def _make_ssl_transport(self, rawsock, protocol, sslcontext, waiter=None,
+                            *, server_side=False, server_hostname=None,
+                            extra=None, server=None):
+        """Create SSL transport."""
+        raise NotImplementedError
+
+    def _make_datagram_transport(self, sock, protocol,
+                                 address=None, waiter=None, extra=None):
+        """Create datagram transport."""
+        raise NotImplementedError
+
+    def _make_read_pipe_transport(self, pipe, protocol, waiter=None,
+                                  extra=None):
+        """Create read pipe transport."""
+        raise NotImplementedError
+
+    def _make_write_pipe_transport(self, pipe, protocol, waiter=None,
+                                   extra=None):
+        """Create write pipe transport."""
+        raise NotImplementedError
+
+    @coroutine
+    def _make_subprocess_transport(self, protocol, args, shell,
+                                   stdin, stdout, stderr, bufsize,
+                                   extra=None, **kwargs):
+        """Create subprocess transport."""
+        raise NotImplementedError
+
+    def _write_to_self(self):
+        """Write a byte to self-pipe, to wake up the event loop.
+
+        This may be called from a different thread.
+
+        The subclass is responsible for implementing the self-pipe.
+        """
+        raise NotImplementedError
+
+    def _process_events(self, event_list):
+        """Process selector events."""
+        raise NotImplementedError
+
+    def _check_closed(self):
+        if self._closed:
+            raise RuntimeError('Event loop is closed')
+
+    def run_forever(self):
+        """Run until stop() is called."""
+        self._check_closed()
+        if self.is_running():
+            raise RuntimeError('Event loop is running.')
+        self._owner = threading.get_ident()
+        try:
+            while True:
+                try:
+                    self._run_once()
+                except _StopError:
+                    break
+        finally:
+            self._owner = None
+
+    def run_until_complete(self, future):
+        """Run until the Future is done.
+
+        If the argument is a coroutine, it is wrapped in a Task.
+
+        WARNING: It would be disastrous to call run_until_complete()
+        with the same coroutine twice -- it would wrap it in two
+        different Tasks and that can't be good.
+
+        Return the Future's result, or raise its exception.
+        """
+        self._check_closed()
+
+        new_task = not isinstance(future, futures.Future)
+        future = tasks.async(future, loop=self)
+        if new_task:
+            # An exception is raised if the future didn't complete, so there
+            # is no need to log the "destroy pending task" message
+            future._log_destroy_pending = False
+
+        future.add_done_callback(_run_until_complete_cb)
+        try:
+            self.run_forever()
+        except:
+            if new_task and future.done() and not future.cancelled():
+                # The coroutine raised a BaseException. Consume the exception
+                # to not log a warning, the caller doesn't have access to the
+                # local task.
+                future.exception()
+            raise
+        future.remove_done_callback(_run_until_complete_cb)
+        if not future.done():
+            raise RuntimeError('Event loop stopped before Future completed.')
+
+        return future.result()
+
+    def stop(self):
+        """Stop running the event loop.
+
+        Every callback scheduled before stop() is called will run. Callbacks
+        scheduled after stop() is called will not run. However, those callbacks
+        will run if run_forever is called again later.
+        """
+        self.call_soon(_raise_stop_error)
+
+    def close(self):
+        """Close the event loop.
+
+        This clears the queues and shuts down the executor,
+        but does not wait for the executor to finish.
+
+        The event loop must not be running.
+        """
+        if self.is_running():
+            raise RuntimeError("Cannot close a running event loop")
+        if self._closed:
+            return
+        if self._debug:
+            logger.debug("Close %r", self)
+        self._closed = True
+        self._ready.clear()
+        self._scheduled.clear()
+        executor = self._default_executor
+        if executor is not None:
+            self._default_executor = None
+            executor.shutdown(wait=False)
+
+    def is_closed(self):
+        """Returns True if the event loop was closed."""
+        return self._closed
+
+    # On Python 3.3 and older, objects with a destructor part of a reference
+    # cycle are never destroyed. It's not more the case on Python 3.4 thanks
+    # to the PEP 442.
+    if sys.version_info >= (3, 4):
+        def __del__(self):
+            if not self.is_closed():
+                warnings.warn("unclosed event loop %r" % self, ResourceWarning)
+                if not self.is_running():
+                    self.close()
+
+    def is_running(self):
+        """Returns True if the event loop is running."""
+        return (self._owner is not None)
+
+    def time(self):
+        """Return the time according to the event loop's clock.
+
+        This is a float expressed in seconds since an epoch, but the
+        epoch, precision, accuracy and drift are unspecified and may
+        differ per event loop.
+        """
+        return time.monotonic()
+
+    def call_later(self, delay, callback, *args):
+        """Arrange for a callback to be called at a given time.
+
+        Return a Handle: an opaque object with a cancel() method that
+        can be used to cancel the call.
+
+        The delay can be an int or float, expressed in seconds.  It is
+        always relative to the current time.
+
+        Each callback will be called exactly once.  If two callbacks
+        are scheduled for exactly the same time, it undefined which
+        will be called first.
+
+        Any positional arguments after the callback will be passed to
+        the callback when it is called.
+        """
+        timer = self.call_at(self.time() + delay, callback, *args)
+        if timer._source_traceback:
+            del timer._source_traceback[-1]
+        return timer
+
+    def call_at(self, when, callback, *args):
+        """Like call_later(), but uses an absolute time.
+
+        Absolute time corresponds to the event loop's time() method.
+        """
+        if (coroutines.iscoroutine(callback)
+        or coroutines.iscoroutinefunction(callback)):
+            raise TypeError("coroutines cannot be used with call_at()")
+        self._check_closed()
+        if self._debug:
+            self._check_thread()
+        timer = events.TimerHandle(when, callback, args, self)
+        if timer._source_traceback:
+            del timer._source_traceback[-1]
+        heapq.heappush(self._scheduled, timer)
+        timer._scheduled = True
+        return timer
+
+    def call_soon(self, callback, *args):
+        """Arrange for a callback to be called as soon as possible.
+
+        This operates as a FIFO queue: callbacks are called in the
+        order in which they are registered.  Each callback will be
+        called exactly once.
+
+        Any positional arguments after the callback will be passed to
+        the callback when it is called.
+        """
+        if self._debug:
+            self._check_thread()
+        handle = self._call_soon(callback, args)
+        if handle._source_traceback:
+            del handle._source_traceback[-1]
+        return handle
+
+    def _call_soon(self, callback, args):
+        if (coroutines.iscoroutine(callback)
+        or coroutines.iscoroutinefunction(callback)):
+            raise TypeError("coroutines cannot be used with call_soon()")
+        self._check_closed()
+        handle = events.Handle(callback, args, self)
+        if handle._source_traceback:
+            del handle._source_traceback[-1]
+        self._ready.append(handle)
+        return handle
+
+    def _check_thread(self):
+        """Check that the current thread is the thread running the event loop.
+
+        Non-thread-safe methods of this class make this assumption and will
+        likely behave incorrectly when the assumption is violated.
+
+        Should only be called when (self._debug == True).  The caller is
+        responsible for checking this condition for performance reasons.
+        """
+        if self._owner is None:
+            return
+        thread_id = threading.get_ident()
+        if thread_id != self._owner:
+            raise RuntimeError(
+                "Non-thread-safe operation invoked on an event loop other "
+                "than the current one")
+
+    def call_soon_threadsafe(self, callback, *args):
+        """Like call_soon(), but thread-safe."""
+        handle = self._call_soon(callback, args)
+        if handle._source_traceback:
+            del handle._source_traceback[-1]
+        self._write_to_self()
+        return handle
+
+    def run_in_executor(self, executor, callback, *args):
+        if (coroutines.iscoroutine(callback)
+        or coroutines.iscoroutinefunction(callback)):
+            raise TypeError("coroutines cannot be used with run_in_executor()")
+        self._check_closed()
+        if isinstance(callback, events.Handle):
+            assert not args
+            assert not isinstance(callback, events.TimerHandle)
+            if callback._cancelled:
+                f = futures.Future(loop=self)
+                f.set_result(None)
+                return f
+            callback, args = callback._callback, callback._args
+        if executor is None:
+            executor = self._default_executor
+            if executor is None:
+                executor = concurrent.futures.ThreadPoolExecutor(_MAX_WORKERS)
+                self._default_executor = executor
+        return futures.wrap_future(executor.submit(callback, *args), loop=self)
+
+    def set_default_executor(self, executor):
+        self._default_executor = executor
+
+    def _getaddrinfo_debug(self, host, port, family, type, proto, flags):
+        msg = ["%s:%r" % (host, port)]
+        if family:
+            msg.append('family=%r' % family)
+        if type:
+            msg.append('type=%r' % type)
+        if proto:
+            msg.append('proto=%r' % proto)
+        if flags:
+            msg.append('flags=%r' % flags)
+        msg = ', '.join(msg)
+        logger.debug('Get address info %s', msg)
+
+        t0 = self.time()
+        addrinfo = socket.getaddrinfo(host, port, family, type, proto, flags)
+        dt = self.time() - t0
+
+        msg = ('Getting address info %s took %.3f ms: %r'
+               % (msg, dt * 1e3, addrinfo))
+        if dt >= self.slow_callback_duration:
+            logger.info(msg)
+        else:
+            logger.debug(msg)
+        return addrinfo
+
+    def getaddrinfo(self, host, port, *,
+                    family=0, type=0, proto=0, flags=0):
+        if self._debug:
+            return self.run_in_executor(None, self._getaddrinfo_debug,
+                                        host, port, family, type, proto, flags)
+        else:
+            return self.run_in_executor(None, socket.getaddrinfo,
+                                        host, port, family, type, proto, flags)
+
+    def getnameinfo(self, sockaddr, flags=0):
+        return self.run_in_executor(None, socket.getnameinfo, sockaddr, flags)
+
+    @coroutine
+    def create_connection(self, protocol_factory, host=None, port=None, *,
+                          ssl=None, family=0, proto=0, flags=0, sock=None,
+                          local_addr=None, server_hostname=None):
+        """Connect to a TCP server.
+
+        Create a streaming transport connection to a given Internet host and
+        port: socket family AF_INET or socket.AF_INET6 depending on host (or
+        family if specified), socket type SOCK_STREAM. protocol_factory must be
+        a callable returning a protocol instance.
+
+        This method is a coroutine which will try to establish the connection
+        in the background.  When successful, the coroutine returns a
+        (transport, protocol) pair.
+        """
+        if server_hostname is not None and not ssl:
+            raise ValueError('server_hostname is only meaningful with ssl')
+
+        if server_hostname is None and ssl:
+            # Use host as default for server_hostname.  It is an error
+            # if host is empty or not set, e.g. when an
+            # already-connected socket was passed or when only a port
+            # is given.  To avoid this error, you can pass
+            # server_hostname='' -- this will bypass the hostname
+            # check.  (This also means that if host is a numeric
+            # IP/IPv6 address, we will attempt to verify that exact
+            # address; this will probably fail, but it is possible to
+            # create a certificate for a specific IP address, so we
+            # don't judge it here.)
+            if not host:
+                raise ValueError('You must set server_hostname '
+                                 'when using ssl without a host')
+            server_hostname = host
+
+        if host is not None or port is not None:
+            if sock is not None:
+                raise ValueError(
+                    'host/port and sock can not be specified at the same time')
+
+            f1 = self.getaddrinfo(
+                host, port, family=family,
+                type=socket.SOCK_STREAM, proto=proto, flags=flags)
+            fs = [f1]
+            if local_addr is not None:
+                f2 = self.getaddrinfo(
+                    *local_addr, family=family,
+                    type=socket.SOCK_STREAM, proto=proto, flags=flags)
+                fs.append(f2)
+            else:
+                f2 = None
+
+            yield from tasks.wait(fs, loop=self)
+
+            infos = f1.result()
+            if not infos:
+                raise OSError('getaddrinfo() returned empty list')
+            if f2 is not None:
+                laddr_infos = f2.result()
+                if not laddr_infos:
+                    raise OSError('getaddrinfo() returned empty list')
+
+            exceptions = []
+            for family, type, proto, cname, address in infos:
+                try:
+                    sock = socket.socket(family=family, type=type, proto=proto)
+                    sock.setblocking(False)
+                    if f2 is not None:
+                        for _, _, _, _, laddr in laddr_infos:
+                            try:
+                                sock.bind(laddr)
+                                break
+                            except OSError as exc:
+                                exc = OSError(
+                                    exc.errno, 'error while '
+                                    'attempting to bind on address '
+                                    '{!r}: {}'.format(
+                                        laddr, exc.strerror.lower()))
+                                exceptions.append(exc)
+                        else:
+                            sock.close()
+                            sock = None
+                            continue
+                    if self._debug:
+                        logger.debug("connect %r to %r", sock, address)
+                    yield from self.sock_connect(sock, address)
+                except OSError as exc:
+                    if sock is not None:
+                        sock.close()
+                    exceptions.append(exc)
+                except:
+                    if sock is not None:
+                        sock.close()
+                    raise
+                else:
+                    break
+            else:
+                if len(exceptions) == 1:
+                    raise exceptions[0]
+                else:
+                    # If they all have the same str(), raise one.
+                    model = str(exceptions[0])
+                    if all(str(exc) == model for exc in exceptions):
+                        raise exceptions[0]
+                    # Raise a combined exception so the user can see all
+                    # the various error messages.
+                    raise OSError('Multiple exceptions: {}'.format(
+                        ', '.join(str(exc) for exc in exceptions)))
+
+        elif sock is None:
+            raise ValueError(
+                'host and port was not specified and no sock specified')
+
+        sock.setblocking(False)
+
+        transport, protocol = yield from self._create_connection_transport(
+            sock, protocol_factory, ssl, server_hostname)
+        if self._debug:
+            # Get the socket from the transport because SSL transport closes
+            # the old socket and creates a new SSL socket
+            sock = transport.get_extra_info('socket')
+            logger.debug("%r connected to %s:%r: (%r, %r)",
+                         sock, host, port, transport, protocol)
+        return transport, protocol
+
+    @coroutine
+    def _create_connection_transport(self, sock, protocol_factory, ssl,
+                                     server_hostname):
+        protocol = protocol_factory()
+        waiter = futures.Future(loop=self)
+        if ssl:
+            sslcontext = None if isinstance(ssl, bool) else ssl
+            transport = self._make_ssl_transport(
+                sock, protocol, sslcontext, waiter,
+                server_side=False, server_hostname=server_hostname)
+        else:
+            transport = self._make_socket_transport(sock, protocol, waiter)
+
+        try:
+            yield from waiter
+        except:
+            transport.close()
+            raise
+
+        return transport, protocol
+
+    @coroutine
+    def create_datagram_endpoint(self, protocol_factory,
+                                 local_addr=None, remote_addr=None, *,
+                                 family=0, proto=0, flags=0):
+        """Create datagram connection."""
+        if not (local_addr or remote_addr):
+            if family == 0:
+                raise ValueError('unexpected address family')
+            addr_pairs_info = (((family, proto), (None, None)),)
+        else:
+            # join address by (family, protocol)
+            addr_infos = collections.OrderedDict()
+            for idx, addr in ((0, local_addr), (1, remote_addr)):
+                if addr is not None:
+                    assert isinstance(addr, tuple) and len(addr) == 2, (
+                        '2-tuple is expected')
+
+                    infos = yield from self.getaddrinfo(
+                        *addr, family=family, type=socket.SOCK_DGRAM,
+                        proto=proto, flags=flags)
+                    if not infos:
+                        raise OSError('getaddrinfo() returned empty list')
+
+                    for fam, _, pro, _, address in infos:
+                        key = (fam, pro)
+                        if key not in addr_infos:
+                            addr_infos[key] = [None, None]
+                        addr_infos[key][idx] = address
+
+            # each addr has to have info for each (family, proto) pair
+            addr_pairs_info = [
+                (key, addr_pair) for key, addr_pair in addr_infos.items()
+                if not ((local_addr and addr_pair[0] is None) or
+                        (remote_addr and addr_pair[1] is None))]
+
+            if not addr_pairs_info:
+                raise ValueError('can not get address information')
+
+        exceptions = []
+
+        for ((family, proto),
+             (local_address, remote_address)) in addr_pairs_info:
+            sock = None
+            r_addr = None
+            try:
+                sock = socket.socket(
+                    family=family, type=socket.SOCK_DGRAM, proto=proto)
+                sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
+                sock.setblocking(False)
+
+                if local_addr:
+                    sock.bind(local_address)
+                if remote_addr:
+                    yield from self.sock_connect(sock, remote_address)
+                    r_addr = remote_address
+            except OSError as exc:
+                if sock is not None:
+                    sock.close()
+                exceptions.append(exc)
+            except:
+                if sock is not None:
+                    sock.close()
+                raise
+            else:
+                break
+        else:
+            raise exceptions[0]
+
+        protocol = protocol_factory()
+        waiter = futures.Future(loop=self)
+        transport = self._make_datagram_transport(sock, protocol, r_addr,
+                                                  waiter)
+        if self._debug:
+            if local_addr:
+                logger.info("Datagram endpoint local_addr=%r remote_addr=%r "
+                            "created: (%r, %r)",
+                            local_addr, remote_addr, transport, protocol)
+            else:
+                logger.debug("Datagram endpoint remote_addr=%r created: "
+                             "(%r, %r)",
+                             remote_addr, transport, protocol)
+
+        try:
+            yield from waiter
+        except:
+            transport.close()
+            raise
+
+        return transport, protocol
+
+    @coroutine
+    def create_server(self, protocol_factory, host=None, port=None,
+                      *,
+                      family=socket.AF_UNSPEC,
+                      flags=socket.AI_PASSIVE,
+                      sock=None,
+                      backlog=100,
+                      ssl=None,
+                      reuse_address=None):
+        """Create a TCP server bound to host and port.
+
+        Return a Server object which can be used to stop the service.
+
+        This method is a coroutine.
+        """
+        if isinstance(ssl, bool):
+            raise TypeError('ssl argument must be an SSLContext or None')
+        if host is not None or port is not None:
+            if sock is not None:
+                raise ValueError(
+                    'host/port and sock can not be specified at the same time')
+
+            AF_INET6 = getattr(socket, 'AF_INET6', 0)
+            if reuse_address is None:
+                reuse_address = os.name == 'posix' and sys.platform != 'cygwin'
+            sockets = []
+            if host == '':
+                host = None
+
+            infos = yield from self.getaddrinfo(
+                host, port, family=family,
+                type=socket.SOCK_STREAM, proto=0, flags=flags)
+            if not infos:
+                raise OSError('getaddrinfo() returned empty list')
+
+            completed = False
+            try:
+                for res in infos:
+                    af, socktype, proto, canonname, sa = res
+                    try:
+                        sock = socket.socket(af, socktype, proto)
+                    except socket.error:
+                        # Assume it's a bad family/type/protocol combination.
+                        if self._debug:
+                            logger.warning('create_server() failed to create '
+                                           'socket.socket(%r, %r, %r)',
+                                           af, socktype, proto, exc_info=True)
+                        continue
+                    sockets.append(sock)
+                    if reuse_address:
+                        sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR,
+                                        True)
+                    # Disable IPv4/IPv6 dual stack support (enabled by
+                    # default on Linux) which makes a single socket
+                    # listen on both address families.
+                    if af == AF_INET6 and hasattr(socket, 'IPPROTO_IPV6'):
+                        sock.setsockopt(socket.IPPROTO_IPV6,
+                                        socket.IPV6_V6ONLY,
+                                        True)
+                    try:
+                        sock.bind(sa)
+                    except OSError as err:
+                        raise OSError(err.errno, 'error while attempting '
+                                      'to bind on address %r: %s'
+                                      % (sa, err.strerror.lower()))
+                completed = True
+            finally:
+                if not completed:
+                    for sock in sockets:
+                        sock.close()
+        else:
+            if sock is None:
+                raise ValueError('Neither host/port nor sock were specified')
+            sockets = [sock]
+
+        server = Server(self, sockets)
+        for sock in sockets:
+            sock.listen(backlog)
+            sock.setblocking(False)
+            self._start_serving(protocol_factory, sock, ssl, server)
+        if self._debug:
+            logger.info("%r is serving", server)
+        return server
+
+    @coroutine
+    def connect_read_pipe(self, protocol_factory, pipe):
+        protocol = protocol_factory()
+        waiter = futures.Future(loop=self)
+        transport = self._make_read_pipe_transport(pipe, protocol, waiter)
+
+        try:
+            yield from waiter
+        except:
+            transport.close()
+            raise
+
+        if self._debug:
+            logger.debug('Read pipe %r connected: (%r, %r)',
+                         pipe.fileno(), transport, protocol)
+        return transport, protocol
+
+    @coroutine
+    def connect_write_pipe(self, protocol_factory, pipe):
+        protocol = protocol_factory()
+        waiter = futures.Future(loop=self)
+        transport = self._make_write_pipe_transport(pipe, protocol, waiter)
+
+        try:
+            yield from waiter
+        except:
+            transport.close()
+            raise
+
+        if self._debug:
+            logger.debug('Write pipe %r connected: (%r, %r)',
+                         pipe.fileno(), transport, protocol)
+        return transport, protocol
+
+    def _log_subprocess(self, msg, stdin, stdout, stderr):
+        info = [msg]
+        if stdin is not None:
+            info.append('stdin=%s' % _format_pipe(stdin))
+        if stdout is not None and stderr == subprocess.STDOUT:
+            info.append('stdout=stderr=%s' % _format_pipe(stdout))
+        else:
+            if stdout is not None:
+                info.append('stdout=%s' % _format_pipe(stdout))
+            if stderr is not None:
+                info.append('stderr=%s' % _format_pipe(stderr))
+        logger.debug(' '.join(info))
+
+    @coroutine
+    def subprocess_shell(self, protocol_factory, cmd, *, stdin=subprocess.PIPE,
+                         stdout=subprocess.PIPE, stderr=subprocess.PIPE,
+                         universal_newlines=False, shell=True, bufsize=0,
+                         **kwargs):
+        if not isinstance(cmd, (bytes, str)):
+            raise ValueError("cmd must be a string")
+        if universal_newlines:
+            raise ValueError("universal_newlines must be False")
+        if not shell:
+            raise ValueError("shell must be True")
+        if bufsize != 0:
+            raise ValueError("bufsize must be 0")
+        protocol = protocol_factory()
+        if self._debug:
+            # don't log parameters: they may contain sensitive information
+            # (password) and may be too long
+            debug_log = 'run shell command %r' % cmd
+            self._log_subprocess(debug_log, stdin, stdout, stderr)
+        transport = yield from self._make_subprocess_transport(
+            protocol, cmd, True, stdin, stdout, stderr, bufsize, **kwargs)
+        if self._debug:
+            logger.info('%s: %r' % (debug_log, transport))
+        return transport, protocol
+
+    @coroutine
+    def subprocess_exec(self, protocol_factory, program, *args,
+                        stdin=subprocess.PIPE, stdout=subprocess.PIPE,
+                        stderr=subprocess.PIPE, universal_newlines=False,
+                        shell=False, bufsize=0, **kwargs):
+        if universal_newlines:
+            raise ValueError("universal_newlines must be False")
+        if shell:
+            raise ValueError("shell must be False")
+        if bufsize != 0:
+            raise ValueError("bufsize must be 0")
+        popen_args = (program,) + args
+        for arg in popen_args:
+            if not isinstance(arg, (str, bytes)):
+                raise TypeError("program arguments must be "
+                                "a bytes or text string, not %s"
+                                % type(arg).__name__)
+        protocol = protocol_factory()
+        if self._debug:
+            # don't log parameters: they may contain sensitive information
+            # (password) and may be too long
+            debug_log = 'execute program %r' % program
+            self._log_subprocess(debug_log, stdin, stdout, stderr)
+        transport = yield from self._make_subprocess_transport(
+            protocol, popen_args, False, stdin, stdout, stderr,
+            bufsize, **kwargs)
+        if self._debug:
+            logger.info('%s: %r' % (debug_log, transport))
+        return transport, protocol
+
+    def set_exception_handler(self, handler):
+        """Set handler as the new event loop exception handler.
+
+        If handler is None, the default exception handler will
+        be set.
+
+        If handler is a callable object, it should have a
+        signature matching '(loop, context)', where 'loop'
+        will be a reference to the active event loop, 'context'
+        will be a dict object (see `call_exception_handler()`
+        documentation for details about context).
+        """
+        if handler is not None and not callable(handler):
+            raise TypeError('A callable object or None is expected, '
+                            'got {!r}'.format(handler))
+        self._exception_handler = handler
+
+    def default_exception_handler(self, context):
+        """Default exception handler.
+
+        This is called when an exception occurs and no exception
+        handler is set, and can be called by a custom exception
+        handler that wants to defer to the default behavior.
+
+        The context parameter has the same meaning as in
+        `call_exception_handler()`.
+        """
+        message = context.get('message')
+        if not message:
+            message = 'Unhandled exception in event loop'
+
+        exception = context.get('exception')
+        if exception is not None:
+            exc_info = (type(exception), exception, exception.__traceback__)
+        else:
+            exc_info = False
+
+        if ('source_traceback' not in context
+        and self._current_handle is not None
+        and self._current_handle._source_traceback):
+            context['handle_traceback'] = self._current_handle._source_traceback
+
+        log_lines = [message]
+        for key in sorted(context):
+            if key in {'message', 'exception'}:
+                continue
+            value = context[key]
+            if key == 'source_traceback':
+                tb = ''.join(traceback.format_list(value))
+                value = 'Object created at (most recent call last):\n'
+                value += tb.rstrip()
+            elif key == 'handle_traceback':
+                tb = ''.join(traceback.format_list(value))
+                value = 'Handle created at (most recent call last):\n'
+                value += tb.rstrip()
+            else:
+                value = repr(value)
+            log_lines.append('{}: {}'.format(key, value))
+
+        logger.error('\n'.join(log_lines), exc_info=exc_info)
+
+    def call_exception_handler(self, context):
+        """Call the current event loop's exception handler.
+
+        The context argument is a dict containing the following keys:
+
+        - 'message': Error message;
+        - 'exception' (optional): Exception object;
+        - 'future' (optional): Future instance;
+        - 'handle' (optional): Handle instance;
+        - 'protocol' (optional): Protocol instance;
+        - 'transport' (optional): Transport instance;
+        - 'socket' (optional): Socket instance.
+
+        New keys maybe introduced in the future.
+
+        Note: do not overload this method in an event loop subclass.
+        For custom exception handling, use the
+        `set_exception_handler()` method.
+        """
+        if self._exception_handler is None:
+            try:
+                self.default_exception_handler(context)
+            except Exception:
+                # Second protection layer for unexpected errors
+                # in the default implementation, as well as for subclassed
+                # event loops with overloaded "default_exception_handler".
+                logger.error('Exception in default exception handler',
+                             exc_info=True)
+        else:
+            try:
+                self._exception_handler(self, context)
+            except Exception as exc:
+                # Exception in the user set custom exception handler.
+                try:
+                    # Let's try default handler.
+                    self.default_exception_handler({
+                        'message': 'Unhandled error in exception handler',
+                        'exception': exc,
+                        'context': context,
+                    })
+                except Exception:
+                    # Guard 'default_exception_handler' in case it is
+                    # overloaded.
+                    logger.error('Exception in default exception handler '
+                                 'while handling an unexpected error '
+                                 'in custom exception handler',
+                                 exc_info=True)
+
+    def _add_callback(self, handle):
+        """Add a Handle to _scheduled (TimerHandle) or _ready."""
+        assert isinstance(handle, events.Handle), 'A Handle is required here'
+        if handle._cancelled:
+            return
+        assert not isinstance(handle, events.TimerHandle)
+        self._ready.append(handle)
+
+    def _add_callback_signalsafe(self, handle):
+        """Like _add_callback() but called from a signal handler."""
+        self._add_callback(handle)
+        self._write_to_self()
+
+    def _timer_handle_cancelled(self, handle):
+        """Notification that a TimerHandle has been cancelled."""
+        if handle._scheduled:
+            self._timer_cancelled_count += 1
+
+    def _run_once(self):
+        """Run one full iteration of the event loop.
+
+        This calls all currently ready callbacks, polls for I/O,
+        schedules the resulting callbacks, and finally schedules
+        'call_later' callbacks.
+        """
+
+        sched_count = len(self._scheduled)
+        if (sched_count > _MIN_SCHEDULED_TIMER_HANDLES and
+            self._timer_cancelled_count / sched_count >
+                _MIN_CANCELLED_TIMER_HANDLES_FRACTION):
+            # Remove delayed calls that were cancelled if their number
+            # is too high
+            new_scheduled = []
+            for handle in self._scheduled:
+                if handle._cancelled:
+                    handle._scheduled = False
+                else:
+                    new_scheduled.append(handle)
+
+            heapq.heapify(new_scheduled)
+            self._scheduled = new_scheduled
+            self._timer_cancelled_count = 0
+        else:
+            # Remove delayed calls that were cancelled from head of queue.
+            while self._scheduled and self._scheduled[0]._cancelled:
+                self._timer_cancelled_count -= 1
+                handle = heapq.heappop(self._scheduled)
+                handle._scheduled = False
+
+        timeout = None
+        if self._ready:
+            timeout = 0
+        elif self._scheduled:
+            # Compute the desired timeout.
+            when = self._scheduled[0]._when
+            timeout = max(0, when - self.time())
+
+        if self._debug and timeout != 0:
+            t0 = self.time()
+            event_list = self._selector.select(timeout)
+            dt = self.time() - t0
+            if dt >= 1.0:
+                level = logging.INFO
+            else:
+                level = logging.DEBUG
+            nevent = len(event_list)
+            if timeout is None:
+                logger.log(level, 'poll took %.3f ms: %s events',
+                           dt * 1e3, nevent)
+            elif nevent:
+                logger.log(level,
+                           'poll %.3f ms took %.3f ms: %s events',
+                           timeout * 1e3, dt * 1e3, nevent)
+            elif dt >= 1.0:
+                logger.log(level,
+                           'poll %.3f ms took %.3f ms: timeout',
+                           timeout * 1e3, dt * 1e3)
+        else:
+            event_list = self._selector.select(timeout)
+        self._process_events(event_list)
+
+        # Handle 'later' callbacks that are ready.
+        end_time = self.time() + self._clock_resolution
+        while self._scheduled:
+            handle = self._scheduled[0]
+            if handle._when >= end_time:
+                break
+            handle = heapq.heappop(self._scheduled)
+            handle._scheduled = False
+            self._ready.append(handle)
+
+        # This is the only place where callbacks are actually *called*.
+        # All other places just add them to ready.
+        # Note: We run all currently scheduled callbacks, but not any
+        # callbacks scheduled by callbacks run this time around --
+        # they will be run the next time (after another I/O poll).
+        # Use an idiom that is thread-safe without using locks.
+        ntodo = len(self._ready)
+        for i in range(ntodo):
+            handle = self._ready.popleft()
+            if handle._cancelled:
+                continue
+            if self._debug:
+                try:
+                    self._current_handle = handle
+                    t0 = self.time()
+                    handle._run()
+                    dt = self.time() - t0
+                    if dt >= self.slow_callback_duration:
+                        logger.warning('Executing %s took %.3f seconds',
+                                       _format_handle(handle), dt)
+                finally:
+                    self._current_handle = None
+            else:
+                handle._run()
+        handle = None  # Needed to break cycles when an exception occurs.
+
+    def get_debug(self):
+        return self._debug
+
+    def set_debug(self, enabled):
+        self._debug = enabled
diff --git a/Lib/asyncio/base_subprocess.py b/Lib/asyncio/base_subprocess.py
new file mode 100644
index 0000000..02b9e89
--- /dev/null
+++ b/Lib/asyncio/base_subprocess.py
@@ -0,0 +1,270 @@
+import collections
+import subprocess
+import sys
+import warnings
+
+from . import futures
+from . import protocols
+from . import transports
+from .coroutines import coroutine
+from .log import logger
+
+
+class BaseSubprocessTransport(transports.SubprocessTransport):
+
+    def __init__(self, loop, protocol, args, shell,
+                 stdin, stdout, stderr, bufsize,
+                 waiter=None, extra=None, **kwargs):
+        super().__init__(extra)
+        self._closed = False
+        self._protocol = protocol
+        self._loop = loop
+        self._proc = None
+        self._pid = None
+        self._returncode = None
+        self._exit_waiters = []
+        self._pending_calls = collections.deque()
+        self._pipes = {}
+        self._finished = False
+
+        if stdin == subprocess.PIPE:
+            self._pipes[0] = None
+        if stdout == subprocess.PIPE:
+            self._pipes[1] = None
+        if stderr == subprocess.PIPE:
+            self._pipes[2] = None
+
+        # Create the child process: set the _proc attribute
+        self._start(args=args, shell=shell, stdin=stdin, stdout=stdout,
+                    stderr=stderr, bufsize=bufsize, **kwargs)
+        self._pid = self._proc.pid
+        self._extra['subprocess'] = self._proc
+
+        if self._loop.get_debug():
+            if isinstance(args, (bytes, str)):
+                program = args
+            else:
+                program = args[0]
+            logger.debug('process %r created: pid %s',
+                         program, self._pid)
+
+        self._loop.create_task(self._connect_pipes(waiter))
+
+    def __repr__(self):
+        info = [self.__class__.__name__]
+        if self._closed:
+            info.append('closed')
+        info.append('pid=%s' % self._pid)
+        if self._returncode is not None:
+            info.append('returncode=%s' % self._returncode)
+
+        stdin = self._pipes.get(0)
+        if stdin is not None:
+            info.append('stdin=%s' % stdin.pipe)
+
+        stdout = self._pipes.get(1)
+        stderr = self._pipes.get(2)
+        if stdout is not None and stderr is stdout:
+            info.append('stdout=stderr=%s' % stdout.pipe)
+        else:
+            if stdout is not None:
+                info.append('stdout=%s' % stdout.pipe)
+            if stderr is not None:
+                info.append('stderr=%s' % stderr.pipe)
+
+        return '<%s>' % ' '.join(info)
+
+    def _start(self, args, shell, stdin, stdout, stderr, bufsize, **kwargs):
+        raise NotImplementedError
+
+    def _make_write_subprocess_pipe_proto(self, fd):
+        raise NotImplementedError
+
+    def _make_read_subprocess_pipe_proto(self, fd):
+        raise NotImplementedError
+
+    def close(self):
+        if self._closed:
+            return
+        self._closed = True
+
+        for proto in self._pipes.values():
+            if proto is None:
+                continue
+            proto.pipe.close()
+
+        if self._proc is not None and self._returncode is None:
+            if self._loop.get_debug():
+                logger.warning('Close running child process: kill %r', self)
+
+            try:
+                self._proc.kill()
+            except ProcessLookupError:
+                pass
+
+            # Don't clear the _proc reference yet: _post_init() may still run
+
+    # On Python 3.3 and older, objects with a destructor part of a reference
+    # cycle are never destroyed. It's not more the case on Python 3.4 thanks
+    # to the PEP 442.
+    if sys.version_info >= (3, 4):
+        def __del__(self):
+            if not self._closed:
+                warnings.warn("unclosed transport %r" % self, ResourceWarning)
+                self.close()
+
+    def get_pid(self):
+        return self._pid
+
+    def get_returncode(self):
+        return self._returncode
+
+    def get_pipe_transport(self, fd):
+        if fd in self._pipes:
+            return self._pipes[fd].pipe
+        else:
+            return None
+
+    def _check_proc(self):
+        if self._proc is None:
+            raise ProcessLookupError()
+
+    def send_signal(self, signal):
+        self._check_proc()
+        self._proc.send_signal(signal)
+
+    def terminate(self):
+        self._check_proc()
+        self._proc.terminate()
+
+    def kill(self):
+        self._check_proc()
+        self._proc.kill()
+
+    @coroutine
+    def _connect_pipes(self, waiter):
+        try:
+            proc = self._proc
+            loop = self._loop
+
+            if proc.stdin is not None:
+                _, pipe = yield from loop.connect_write_pipe(
+                    lambda: WriteSubprocessPipeProto(self, 0),
+                    proc.stdin)
+                self._pipes[0] = pipe
+
+            if proc.stdout is not None:
+                _, pipe = yield from loop.connect_read_pipe(
+                    lambda: ReadSubprocessPipeProto(self, 1),
+                    proc.stdout)
+                self._pipes[1] = pipe
+
+            if proc.stderr is not None:
+                _, pipe = yield from loop.connect_read_pipe(
+                    lambda: ReadSubprocessPipeProto(self, 2),
+                    proc.stderr)
+                self._pipes[2] = pipe
+
+            assert self._pending_calls is not None
+
+            loop.call_soon(self._protocol.connection_made, self)
+            for callback, data in self._pending_calls:
+                loop.call_soon(callback, *data)
+            self._pending_calls = None
+        except Exception as exc:
+            if waiter is not None and not waiter.cancelled():
+                waiter.set_exception(exc)
+        else:
+            if waiter is not None and not waiter.cancelled():
+                waiter.set_result(None)
+
+    def _call(self, cb, *data):
+        if self._pending_calls is not None:
+            self._pending_calls.append((cb, data))
+        else:
+            self._loop.call_soon(cb, *data)
+
+    def _pipe_connection_lost(self, fd, exc):
+        self._call(self._protocol.pipe_connection_lost, fd, exc)
+        self._try_finish()
+
+    def _pipe_data_received(self, fd, data):
+        self._call(self._protocol.pipe_data_received, fd, data)
+
+    def _process_exited(self, returncode):
+        assert returncode is not None, returncode
+        assert self._returncode is None, self._returncode
+        if self._loop.get_debug():
+            logger.info('%r exited with return code %r',
+                        self, returncode)
+        self._returncode = returncode
+        self._call(self._protocol.process_exited)
+        self._try_finish()
+
+        # wake up futures waiting for wait()
+        for waiter in self._exit_waiters:
+            if not waiter.cancelled():
+                waiter.set_result(returncode)
+        self._exit_waiters = None
+
+    def _wait(self):
+        """Wait until the process exit and return the process return code.
+
+        This method is a coroutine."""
+        if self._returncode is not None:
+            return self._returncode
+
+        waiter = futures.Future(loop=self._loop)
+        self._exit_waiters.append(waiter)
+        return (yield from waiter)
+
+    def _try_finish(self):
+        assert not self._finished
+        if self._returncode is None:
+            return
+        if all(p is not None and p.disconnected
+               for p in self._pipes.values()):
+            self._finished = True
+            self._call(self._call_connection_lost, None)
+
+    def _call_connection_lost(self, exc):
+        try:
+            self._protocol.connection_lost(exc)
+        finally:
+            self._loop = None
+            self._proc = None
+            self._protocol = None
+
+
+class WriteSubprocessPipeProto(protocols.BaseProtocol):
+
+    def __init__(self, proc, fd):
+        self.proc = proc
+        self.fd = fd
+        self.pipe = None
+        self.disconnected = False
+
+    def connection_made(self, transport):
+        self.pipe = transport
+
+    def __repr__(self):
+        return ('<%s fd=%s pipe=%r>'
+                % (self.__class__.__name__, self.fd, self.pipe))
+
+    def connection_lost(self, exc):
+        self.disconnected = True
+        self.proc._pipe_connection_lost(self.fd, exc)
+        self.proc = None
+
+    def pause_writing(self):
+        self.proc._protocol.pause_writing()
+
+    def resume_writing(self):
+        self.proc._protocol.resume_writing()
+
+
+class ReadSubprocessPipeProto(WriteSubprocessPipeProto,
+                              protocols.Protocol):
+
+    def data_received(self, data):
+        self.proc._pipe_data_received(self.fd, data)
diff --git a/Lib/asyncio/constants.py b/Lib/asyncio/constants.py
new file mode 100644
index 0000000..f9e1232
--- /dev/null
+++ b/Lib/asyncio/constants.py
@@ -0,0 +1,7 @@
+"""Constants."""
+
+# After the connection is lost, log warnings after this many write()s.
+LOG_THRESHOLD_FOR_CONNLOST_WRITES = 5
+
+# Seconds to wait before retrying accept().
+ACCEPT_RETRY_DELAY = 1
diff --git a/Lib/asyncio/coroutines.py b/Lib/asyncio/coroutines.py
new file mode 100644
index 0000000..a1b2875
--- /dev/null
+++ b/Lib/asyncio/coroutines.py
@@ -0,0 +1,199 @@
+__all__ = ['coroutine',
+           'iscoroutinefunction', 'iscoroutine']
+
+import functools
+import inspect
+import opcode
+import os
+import sys
+import traceback
+import types
+
+from . import events
+from . import futures
+from .log import logger
+
+
+# Opcode of "yield from" instruction
+_YIELD_FROM = opcode.opmap['YIELD_FROM']
+
+# If you set _DEBUG to true, @coroutine will wrap the resulting
+# generator objects in a CoroWrapper instance (defined below).  That
+# instance will log a message when the generator is never iterated
+# over, which may happen when you forget to use "yield from" with a
+# coroutine call.  Note that the value of the _DEBUG flag is taken
+# when the decorator is used, so to be of any use it must be set
+# before you define your coroutines.  A downside of using this feature
+# is that tracebacks show entries for the CoroWrapper.__next__ method
+# when _DEBUG is true.
+_DEBUG = (not sys.flags.ignore_environment
+          and bool(os.environ.get('PYTHONASYNCIODEBUG')))
+
+
+# Check for CPython issue #21209
+def has_yield_from_bug():
+    class MyGen:
+        def __init__(self):
+            self.send_args = None
+        def __iter__(self):
+            return self
+        def __next__(self):
+            return 42
+        def send(self, *what):
+            self.send_args = what
+            return None
+    def yield_from_gen(gen):
+        yield from gen
+    value = (1, 2, 3)
+    gen = MyGen()
+    coro = yield_from_gen(gen)
+    next(coro)
+    coro.send(value)
+    return gen.send_args != (value,)
+_YIELD_FROM_BUG = has_yield_from_bug()
+del has_yield_from_bug
+
+
+class CoroWrapper:
+    # Wrapper for coroutine object in _DEBUG mode.
+
+    def __init__(self, gen, func):
+        assert inspect.isgenerator(gen), gen
+        self.gen = gen
+        self.func = func
+        self._source_traceback = traceback.extract_stack(sys._getframe(1))
+        # __name__, __qualname__, __doc__ attributes are set by the coroutine()
+        # decorator
+
+    def __repr__(self):
+        coro_repr = _format_coroutine(self)
+        if self._source_traceback:
+            frame = self._source_traceback[-1]
+            coro_repr += ', created at %s:%s' % (frame[0], frame[1])
+        return '<%s %s>' % (self.__class__.__name__, coro_repr)
+
+    def __iter__(self):
+        return self
+
+    def __next__(self):
+        return next(self.gen)
+
+    if _YIELD_FROM_BUG:
+        # For for CPython issue #21209: using "yield from" and a custom
+        # generator, generator.send(tuple) unpacks the tuple instead of passing
+        # the tuple unchanged. Check if the caller is a generator using "yield
+        # from" to decide if the parameter should be unpacked or not.
+        def send(self, *value):
+            frame = sys._getframe()
+            caller = frame.f_back
+            assert caller.f_lasti >= 0
+            if caller.f_code.co_code[caller.f_lasti] != _YIELD_FROM:
+                value = value[0]
+            return self.gen.send(value)
+    else:
+        def send(self, value):
+            return self.gen.send(value)
+
+    def throw(self, exc):
+        return self.gen.throw(exc)
+
+    def close(self):
+        return self.gen.close()
+
+    @property
+    def gi_frame(self):
+        return self.gen.gi_frame
+
+    @property
+    def gi_running(self):
+        return self.gen.gi_running
+
+    @property
+    def gi_code(self):
+        return self.gen.gi_code
+
+    def __del__(self):
+        # Be careful accessing self.gen.frame -- self.gen might not exist.
+        gen = getattr(self, 'gen', None)
+        frame = getattr(gen, 'gi_frame', None)
+        if frame is not None and frame.f_lasti == -1:
+            msg = '%r was never yielded from' % self
+            tb = getattr(self, '_source_traceback', ())
+            if tb:
+                tb = ''.join(traceback.format_list(tb))
+                msg += ('\nCoroutine object created at '
+                        '(most recent call last):\n')
+                msg += tb.rstrip()
+            logger.error(msg)
+
+
+def coroutine(func):
+    """Decorator to mark coroutines.
+
+    If the coroutine is not yielded from before it is destroyed,
+    an error message is logged.
+    """
+    if inspect.isgeneratorfunction(func):
+        coro = func
+    else:
+        @functools.wraps(func)
+        def coro(*args, **kw):
+            res = func(*args, **kw)
+            if isinstance(res, futures.Future) or inspect.isgenerator(res):
+                res = yield from res
+            return res
+
+    if not _DEBUG:
+        wrapper = coro
+    else:
+        @functools.wraps(func)
+        def wrapper(*args, **kwds):
+            w = CoroWrapper(coro(*args, **kwds), func)
+            if w._source_traceback:
+                del w._source_traceback[-1]
+            w.__name__ = func.__name__
+            if hasattr(func, '__qualname__'):
+                w.__qualname__ = func.__qualname__
+            w.__doc__ = func.__doc__
+            return w
+
+    wrapper._is_coroutine = True  # For iscoroutinefunction().
+    return wrapper
+
+
+def iscoroutinefunction(func):
+    """Return True if func is a decorated coroutine function."""
+    return getattr(func, '_is_coroutine', False)
+
+
+_COROUTINE_TYPES = (types.GeneratorType, CoroWrapper)
+
+def iscoroutine(obj):
+    """Return True if obj is a coroutine object."""
+    return isinstance(obj, _COROUTINE_TYPES)
+
+
+def _format_coroutine(coro):
+    assert iscoroutine(coro)
+    coro_name = getattr(coro, '__qualname__', coro.__name__)
+
+    filename = coro.gi_code.co_filename
+    if (isinstance(coro, CoroWrapper)
+    and not inspect.isgeneratorfunction(coro.func)):
+        filename, lineno = events._get_function_source(coro.func)
+        if coro.gi_frame is None:
+            coro_repr = ('%s() done, defined at %s:%s'
+                         % (coro_name, filename, lineno))
+        else:
+            coro_repr = ('%s() running, defined at %s:%s'
+                         % (coro_name, filename, lineno))
+    elif coro.gi_frame is not None:
+        lineno = coro.gi_frame.f_lineno
+        coro_repr = ('%s() running at %s:%s'
+                     % (coro_name, filename, lineno))
+    else:
+        lineno = coro.gi_code.co_firstlineno
+        coro_repr = ('%s() done, defined at %s:%s'
+                     % (coro_name, filename, lineno))
+
+    return coro_repr
diff --git a/Lib/asyncio/events.py b/Lib/asyncio/events.py
new file mode 100644
index 0000000..8a7bb81
--- /dev/null
+++ b/Lib/asyncio/events.py
@@ -0,0 +1,597 @@
+"""Event loop and event loop policy."""
+
+__all__ = ['AbstractEventLoopPolicy',
+           'AbstractEventLoop', 'AbstractServer',
+           'Handle', 'TimerHandle',
+           'get_event_loop_policy', 'set_event_loop_policy',
+           'get_event_loop', 'set_event_loop', 'new_event_loop',
+           'get_child_watcher', 'set_child_watcher',
+           ]
+
+import functools
+import inspect
+import reprlib
+import socket
+import subprocess
+import sys
+import threading
+import traceback
+
+
+_PY34 = sys.version_info >= (3, 4)
+
+
+def _get_function_source(func):
+    if _PY34:
+        func = inspect.unwrap(func)
+    elif hasattr(func, '__wrapped__'):
+        func = func.__wrapped__
+    if inspect.isfunction(func):
+        code = func.__code__
+        return (code.co_filename, code.co_firstlineno)
+    if isinstance(func, functools.partial):
+        return _get_function_source(func.func)
+    if _PY34 and isinstance(func, functools.partialmethod):
+        return _get_function_source(func.func)
+    return None
+
+
+def _format_args(args):
+    """Format function arguments.
+
+    Special case for a single parameter: ('hello',) is formatted as ('hello').
+    """
+    # use reprlib to limit the length of the output
+    args_repr = reprlib.repr(args)
+    if len(args) == 1 and args_repr.endswith(',)'):
+        args_repr = args_repr[:-2] + ')'
+    return args_repr
+
+
+def _format_callback(func, args, suffix=''):
+    if isinstance(func, functools.partial):
+        if args is not None:
+            suffix = _format_args(args) + suffix
+        return _format_callback(func.func, func.args, suffix)
+
+    func_repr = getattr(func, '__qualname__', None)
+    if not func_repr:
+        func_repr = repr(func)
+
+    if args is not None:
+        func_repr += _format_args(args)
+    if suffix:
+        func_repr += suffix
+
+    source = _get_function_source(func)
+    if source:
+        func_repr += ' at %s:%s' % source
+    return func_repr
+
+
+class Handle:
+    """Object returned by callback registration methods."""
+
+    __slots__ = ('_callback', '_args', '_cancelled', '_loop',
+                 '_source_traceback', '_repr', '__weakref__')
+
+    def __init__(self, callback, args, loop):
+        assert not isinstance(callback, Handle), 'A Handle is not a callback'
+        self._loop = loop
+        self._callback = callback
+        self._args = args
+        self._cancelled = False
+        self._repr = None
+        if self._loop.get_debug():
+            self._source_traceback = traceback.extract_stack(sys._getframe(1))
+        else:
+            self._source_traceback = None
+
+    def _repr_info(self):
+        info = [self.__class__.__name__]
+        if self._cancelled:
+            info.append('cancelled')
+        if self._callback is not None:
+            info.append(_format_callback(self._callback, self._args))
+        if self._source_traceback:
+            frame = self._source_traceback[-1]
+            info.append('created at %s:%s' % (frame[0], frame[1]))
+        return info
+
+    def __repr__(self):
+        if self._repr is not None:
+            return self._repr
+        info = self._repr_info()
+        return '<%s>' % ' '.join(info)
+
+    def cancel(self):
+        if not self._cancelled:
+            self._cancelled = True
+            if self._loop.get_debug():
+                # Keep a representation in debug mode to keep callback and
+                # parameters. For example, to log the warning
+                # "Executing <Handle...> took 2.5 second"
+                self._repr = repr(self)
+            self._callback = None
+            self._args = None
+
+    def _run(self):
+        try:
+            self._callback(*self._args)
+        except Exception as exc:
+            cb = _format_callback(self._callback, self._args)
+            msg = 'Exception in callback {}'.format(cb)
+            context = {
+                'message': msg,
+                'exception': exc,
+                'handle': self,
+            }
+            if self._source_traceback:
+                context['source_traceback'] = self._source_traceback
+            self._loop.call_exception_handler(context)
+        self = None  # Needed to break cycles when an exception occurs.
+
+
+class TimerHandle(Handle):
+    """Object returned by timed callback registration methods."""
+
+    __slots__ = ['_scheduled', '_when']
+
+    def __init__(self, when, callback, args, loop):
+        assert when is not None
+        super().__init__(callback, args, loop)
+        if self._source_traceback:
+            del self._source_traceback[-1]
+        self._when = when
+        self._scheduled = False
+
+    def _repr_info(self):
+        info = super()._repr_info()
+        pos = 2 if self._cancelled else 1
+        info.insert(pos, 'when=%s' % self._when)
+        return info
+
+    def __hash__(self):
+        return hash(self._when)
+
+    def __lt__(self, other):
+        return self._when < other._when
+
+    def __le__(self, other):
+        if self._when < other._when:
+            return True
+        return self.__eq__(other)
+
+    def __gt__(self, other):
+        return self._when > other._when
+
+    def __ge__(self, other):
+        if self._when > other._when:
+            return True
+        return self.__eq__(other)
+
+    def __eq__(self, other):
+        if isinstance(other, TimerHandle):
+            return (self._when == other._when and
+                    self._callback == other._callback and
+                    self._args == other._args and
+                    self._cancelled == other._cancelled)
+        return NotImplemented
+
+    def __ne__(self, other):
+        equal = self.__eq__(other)
+        return NotImplemented if equal is NotImplemented else not equal
+
+    def cancel(self):
+        if not self._cancelled:
+            self._loop._timer_handle_cancelled(self)
+        super().cancel()
+
+
+class AbstractServer:
+    """Abstract server returned by create_server()."""
+
+    def close(self):
+        """Stop serving.  This leaves existing connections open."""
+        return NotImplemented
+
+    def wait_closed(self):
+        """Coroutine to wait until service is closed."""
+        return NotImplemented
+
+
+class AbstractEventLoop:
+    """Abstract event loop."""
+
+    # Running and stopping the event loop.
+
+    def run_forever(self):
+        """Run the event loop until stop() is called."""
+        raise NotImplementedError
+
+    def run_until_complete(self, future):
+        """Run the event loop until a Future is done.
+
+        Return the Future's result, or raise its exception.
+        """
+        raise NotImplementedError
+
+    def stop(self):
+        """Stop the event loop as soon as reasonable.
+
+        Exactly how soon that is may depend on the implementation, but
+        no more I/O callbacks should be scheduled.
+        """
+        raise NotImplementedError
+
+    def is_running(self):
+        """Return whether the event loop is currently running."""
+        raise NotImplementedError
+
+    def is_closed(self):
+        """Returns True if the event loop was closed."""
+        raise NotImplementedError
+
+    def close(self):
+        """Close the loop.
+
+        The loop should not be running.
+
+        This is idempotent and irreversible.
+
+        No other methods should be called after this one.
+        """
+        raise NotImplementedError
+
+    # Methods scheduling callbacks.  All these return Handles.
+
+    def _timer_handle_cancelled(self, handle):
+        """Notification that a TimerHandle has been cancelled."""
+        raise NotImplementedError
+
+    def call_soon(self, callback, *args):
+        return self.call_later(0, callback, *args)
+
+    def call_later(self, delay, callback, *args):
+        raise NotImplementedError
+
+    def call_at(self, when, callback, *args):
+        raise NotImplementedError
+
+    def time(self):
+        raise NotImplementedError
+
+    # Method scheduling a coroutine object: create a task.
+
+    def create_task(self, coro):
+        raise NotImplementedError
+
+    # Methods for interacting with threads.
+
+    def call_soon_threadsafe(self, callback, *args):
+        raise NotImplementedError
+
+    def run_in_executor(self, executor, callback, *args):
+        raise NotImplementedError
+
+    def set_default_executor(self, executor):
+        raise NotImplementedError
+
+    # Network I/O methods returning Futures.
+
+    def getaddrinfo(self, host, port, *, family=0, type=0, proto=0, flags=0):
+        raise NotImplementedError
+
+    def getnameinfo(self, sockaddr, flags=0):
+        raise NotImplementedError
+
+    def create_connection(self, protocol_factory, host=None, port=None, *,
+                          ssl=None, family=0, proto=0, flags=0, sock=None,
+                          local_addr=None, server_hostname=None):
+        raise NotImplementedError
+
+    def create_server(self, protocol_factory, host=None, port=None, *,
+                      family=socket.AF_UNSPEC, flags=socket.AI_PASSIVE,
+                      sock=None, backlog=100, ssl=None, reuse_address=None):
+        """A coroutine which creates a TCP server bound to host and port.
+
+        The return value is a Server object which can be used to stop
+        the service.
+
+        If host is an empty string or None all interfaces are assumed
+        and a list of multiple sockets will be returned (most likely
+        one for IPv4 and another one for IPv6).
+
+        family can be set to either AF_INET or AF_INET6 to force the
+        socket to use IPv4 or IPv6. If not set it will be determined
+        from host (defaults to AF_UNSPEC).
+
+        flags is a bitmask for getaddrinfo().
+
+        sock can optionally be specified in order to use a preexisting
+        socket object.
+
+        backlog is the maximum number of queued connections passed to
+        listen() (defaults to 100).
+
+        ssl can be set to an SSLContext to enable SSL over the
+        accepted connections.
+
+        reuse_address tells the kernel to reuse a local socket in
+        TIME_WAIT state, without waiting for its natural timeout to
+        expire. If not specified will automatically be set to True on
+        UNIX.
+        """
+        raise NotImplementedError
+
+    def create_unix_connection(self, protocol_factory, path, *,
+                               ssl=None, sock=None,
+                               server_hostname=None):
+        raise NotImplementedError
+
+    def create_unix_server(self, protocol_factory, path, *,
+                           sock=None, backlog=100, ssl=None):
+        """A coroutine which creates a UNIX Domain Socket server.
+
+        The return value is a Server object, which can be used to stop
+        the service.
+
+        path is a str, representing a file systsem path to bind the
+        server socket to.
+
+        sock can optionally be specified in order to use a preexisting
+        socket object.
+
+        backlog is the maximum number of queued connections passed to
+        listen() (defaults to 100).
+
+        ssl can be set to an SSLContext to enable SSL over the
+        accepted connections.
+        """
+        raise NotImplementedError
+
+    def create_datagram_endpoint(self, protocol_factory,
+                                 local_addr=None, remote_addr=None, *,
+                                 family=0, proto=0, flags=0):
+        raise NotImplementedError
+
+    # Pipes and subprocesses.
+
+    def connect_read_pipe(self, protocol_factory, pipe):
+        """Register read pipe in event loop. Set the pipe to non-blocking mode.
+
+        protocol_factory should instantiate object with Protocol interface.
+        pipe is a file-like object.
+        Return pair (transport, protocol), where transport supports the
+        ReadTransport interface."""
+        # The reason to accept file-like object instead of just file descriptor
+        # is: we need to own pipe and close it at transport finishing
+        # Can got complicated errors if pass f.fileno(),
+        # close fd in pipe transport then close f and vise versa.
+        raise NotImplementedError
+
+    def connect_write_pipe(self, protocol_factory, pipe):
+        """Register write pipe in event loop.
+
+        protocol_factory should instantiate object with BaseProtocol interface.
+        Pipe is file-like object already switched to nonblocking.
+        Return pair (transport, protocol), where transport support
+        WriteTransport interface."""
+        # The reason to accept file-like object instead of just file descriptor
+        # is: we need to own pipe and close it at transport finishing
+        # Can got complicated errors if pass f.fileno(),
+        # close fd in pipe transport then close f and vise versa.
+        raise NotImplementedError
+
+    def subprocess_shell(self, protocol_factory, cmd, *, stdin=subprocess.PIPE,
+                         stdout=subprocess.PIPE, stderr=subprocess.PIPE,
+                         **kwargs):
+        raise NotImplementedError
+
+    def subprocess_exec(self, protocol_factory, *args, stdin=subprocess.PIPE,
+                        stdout=subprocess.PIPE, stderr=subprocess.PIPE,
+                        **kwargs):
+        raise NotImplementedError
+
+    # Ready-based callback registration methods.
+    # The add_*() methods return None.
+    # The remove_*() methods return True if something was removed,
+    # False if there was nothing to delete.
+
+    def add_reader(self, fd, callback, *args):
+        raise NotImplementedError
+
+    def remove_reader(self, fd):
+        raise NotImplementedError
+
+    def add_writer(self, fd, callback, *args):
+        raise NotImplementedError
+
+    def remove_writer(self, fd):
+        raise NotImplementedError
+
+    # Completion based I/O methods returning Futures.
+
+    def sock_recv(self, sock, nbytes):
+        raise NotImplementedError
+
+    def sock_sendall(self, sock, data):
+        raise NotImplementedError
+
+    def sock_connect(self, sock, address):
+        raise NotImplementedError
+
+    def sock_accept(self, sock):
+        raise NotImplementedError
+
+    # Signal handling.
+
+    def add_signal_handler(self, sig, callback, *args):
+        raise NotImplementedError
+
+    def remove_signal_handler(self, sig):
+        raise NotImplementedError
+
+    # Error handlers.
+
+    def set_exception_handler(self, handler):
+        raise NotImplementedError
+
+    def default_exception_handler(self, context):
+        raise NotImplementedError
+
+    def call_exception_handler(self, context):
+        raise NotImplementedError
+
+    # Debug flag management.
+
+    def get_debug(self):
+        raise NotImplementedError
+
+    def set_debug(self, enabled):
+        raise NotImplementedError
+
+
+class AbstractEventLoopPolicy:
+    """Abstract policy for accessing the event loop."""
+
+    def get_event_loop(self):
+        """Get the event loop for the current context.
+
+        Returns an event loop object implementing the BaseEventLoop interface,
+        or raises an exception in case no event loop has been set for the
+        current context and the current policy does not specify to create one.
+
+        It should never return None."""
+        raise NotImplementedError
+
+    def set_event_loop(self, loop):
+        """Set the event loop for the current context to loop."""
+        raise NotImplementedError
+
+    def new_event_loop(self):
+        """Create and return a new event loop object according to this
+        policy's rules. If there's need to set this loop as the event loop for
+        the current context, set_event_loop must be called explicitly."""
+        raise NotImplementedError
+
+    # Child processes handling (Unix only).
+
+    def get_child_watcher(self):
+        "Get the watcher for child processes."
+        raise NotImplementedError
+
+    def set_child_watcher(self, watcher):
+        """Set the watcher for child processes."""
+        raise NotImplementedError
+
+
+class BaseDefaultEventLoopPolicy(AbstractEventLoopPolicy):
+    """Default policy implementation for accessing the event loop.
+
+    In this policy, each thread has its own event loop.  However, we
+    only automatically create an event loop by default for the main
+    thread; other threads by default have no event loop.
+
+    Other policies may have different rules (e.g. a single global
+    event loop, or automatically creating an event loop per thread, or
+    using some other notion of context to which an event loop is
+    associated).
+    """
+
+    _loop_factory = None
+
+    class _Local(threading.local):
+        _loop = None
+        _set_called = False
+
+    def __init__(self):
+        self._local = self._Local()
+
+    def get_event_loop(self):
+        """Get the event loop.
+
+        This may be None or an instance of EventLoop.
+        """
+        if (self._local._loop is None and
+            not self._local._set_called and
+            isinstance(threading.current_thread(), threading._MainThread)):
+            self.set_event_loop(self.new_event_loop())
+        if self._local._loop is None:
+            raise RuntimeError('There is no current event loop in thread %r.'
+                               % threading.current_thread().name)
+        return self._local._loop
+
+    def set_event_loop(self, loop):
+        """Set the event loop."""
+        self._local._set_called = True
+        assert loop is None or isinstance(loop, AbstractEventLoop)
+        self._local._loop = loop
+
+    def new_event_loop(self):
+        """Create a new event loop.
+
+        You must call set_event_loop() to make this the current event
+        loop.
+        """
+        return self._loop_factory()
+
+
+# Event loop policy.  The policy itself is always global, even if the
+# policy's rules say that there is an event loop per thread (or other
+# notion of context).  The default policy is installed by the first
+# call to get_event_loop_policy().
+_event_loop_policy = None
+
+# Lock for protecting the on-the-fly creation of the event loop policy.
+_lock = threading.Lock()
+
+
+def _init_event_loop_policy():
+    global _event_loop_policy
+    with _lock:
+        if _event_loop_policy is None:  # pragma: no branch
+            from . import DefaultEventLoopPolicy
+            _event_loop_policy = DefaultEventLoopPolicy()
+
+
+def get_event_loop_policy():
+    """Get the current event loop policy."""
+    if _event_loop_policy is None:
+        _init_event_loop_policy()
+    return _event_loop_policy
+
+
+def set_event_loop_policy(policy):
+    """Set the current event loop policy.
+
+    If policy is None, the default policy is restored."""
+    global _event_loop_policy
+    assert policy is None or isinstance(policy, AbstractEventLoopPolicy)
+    _event_loop_policy = policy
+
+
+def get_event_loop():
+    """Equivalent to calling get_event_loop_policy().get_event_loop()."""
+    return get_event_loop_policy().get_event_loop()
+
+
+def set_event_loop(loop):
+    """Equivalent to calling get_event_loop_policy().set_event_loop(loop)."""
+    get_event_loop_policy().set_event_loop(loop)
+
+
+def new_event_loop():
+    """Equivalent to calling get_event_loop_policy().new_event_loop()."""
+    return get_event_loop_policy().new_event_loop()
+
+
+def get_child_watcher():
+    """Equivalent to calling get_event_loop_policy().get_child_watcher()."""
+    return get_event_loop_policy().get_child_watcher()
+
+
+def set_child_watcher(watcher):
+    """Equivalent to calling
+    get_event_loop_policy().set_child_watcher(watcher)."""
+    return get_event_loop_policy().set_child_watcher(watcher)
diff --git a/Lib/asyncio/futures.py b/Lib/asyncio/futures.py
new file mode 100644
index 0000000..2c741fd
--- /dev/null
+++ b/Lib/asyncio/futures.py
@@ -0,0 +1,409 @@
+"""A Future class similar to the one in PEP 3148."""
+
+__all__ = ['CancelledError', 'TimeoutError',
+           'InvalidStateError',
+           'Future', 'wrap_future',
+           ]
+
+import concurrent.futures._base
+import logging
+import reprlib
+import sys
+import traceback
+
+from . import events
+
+# States for Future.
+_PENDING = 'PENDING'
+_CANCELLED = 'CANCELLED'
+_FINISHED = 'FINISHED'
+
+_PY34 = sys.version_info >= (3, 4)
+
+Error = concurrent.futures._base.Error
+CancelledError = concurrent.futures.CancelledError
+TimeoutError = concurrent.futures.TimeoutError
+
+STACK_DEBUG = logging.DEBUG - 1  # heavy-duty debugging
+
+
+class InvalidStateError(Error):
+    """The operation is not allowed in this state."""
+
+
+class _TracebackLogger:
+    """Helper to log a traceback upon destruction if not cleared.
+
+    This solves a nasty problem with Futures and Tasks that have an
+    exception set: if nobody asks for the exception, the exception is
+    never logged.  This violates the Zen of Python: 'Errors should
+    never pass silently.  Unless explicitly silenced.'
+
+    However, we don't want to log the exception as soon as
+    set_exception() is called: if the calling code is written
+    properly, it will get the exception and handle it properly.  But
+    we *do* want to log it if result() or exception() was never called
+    -- otherwise developers waste a lot of time wondering why their
+    buggy code fails silently.
+
+    An earlier attempt added a __del__() method to the Future class
+    itself, but this backfired because the presence of __del__()
+    prevents garbage collection from breaking cycles.  A way out of
+    this catch-22 is to avoid having a __del__() method on the Future
+    class itself, but instead to have a reference to a helper object
+    with a __del__() method that logs the traceback, where we ensure
+    that the helper object doesn't participate in cycles, and only the
+    Future has a reference to it.
+
+    The helper object is added when set_exception() is called.  When
+    the Future is collected, and the helper is present, the helper
+    object is also collected, and its __del__() method will log the
+    traceback.  When the Future's result() or exception() method is
+    called (and a helper object is present), it removes the helper
+    object, after calling its clear() method to prevent it from
+    logging.
+
+    One downside is that we do a fair amount of work to extract the
+    traceback from the exception, even when it is never logged.  It
+    would seem cheaper to just store the exception object, but that
+    references the traceback, which references stack frames, which may
+    reference the Future, which references the _TracebackLogger, and
+    then the _TracebackLogger would be included in a cycle, which is
+    what we're trying to avoid!  As an optimization, we don't
+    immediately format the exception; we only do the work when
+    activate() is called, which call is delayed until after all the
+    Future's callbacks have run.  Since usually a Future has at least
+    one callback (typically set by 'yield from') and usually that
+    callback extracts the callback, thereby removing the need to
+    format the exception.
+
+    PS. I don't claim credit for this solution.  I first heard of it
+    in a discussion about closing files when they are collected.
+    """
+
+    __slots__ = ('loop', 'source_traceback', 'exc', 'tb')
+
+    def __init__(self, future, exc):
+        self.loop = future._loop
+        self.source_traceback = future._source_traceback
+        self.exc = exc
+        self.tb = None
+
+    def activate(self):
+        exc = self.exc
+        if exc is not None:
+            self.exc = None
+            self.tb = traceback.format_exception(exc.__class__, exc,
+                                                 exc.__traceback__)
+
+    def clear(self):
+        self.exc = None
+        self.tb = None
+
+    def __del__(self):
+        if self.tb:
+            msg = 'Future/Task exception was never retrieved\n'
+            if self.source_traceback:
+                src = ''.join(traceback.format_list(self.source_traceback))
+                msg += 'Future/Task created at (most recent call last):\n'
+                msg += '%s\n' % src.rstrip()
+            msg += ''.join(self.tb).rstrip()
+            self.loop.call_exception_handler({'message': msg})
+
+
+class Future:
+    """This class is *almost* compatible with concurrent.futures.Future.
+
+    Differences:
+
+    - result() and exception() do not take a timeout argument and
+      raise an exception when the future isn't done yet.
+
+    - Callbacks registered with add_done_callback() are always called
+      via the event loop's call_soon_threadsafe().
+
+    - This class is not compatible with the wait() and as_completed()
+      methods in the concurrent.futures package.
+
+    (In Python 3.4 or later we may be able to unify the implementations.)
+    """
+
+    # Class variables serving as defaults for instance variables.
+    _state = _PENDING
+    _result = None
+    _exception = None
+    _loop = None
+    _source_traceback = None
+
+    _blocking = False  # proper use of future (yield vs yield from)
+
+    _log_traceback = False   # Used for Python 3.4 and later
+    _tb_logger = None        # Used for Python 3.3 only
+
+    def __init__(self, *, loop=None):
+        """Initialize the future.
+
+        The optional event_loop argument allows to explicitly set the event
+        loop object used by the future. If it's not provided, the future uses
+        the default event loop.
+        """
+        if loop is None:
+            self._loop = events.get_event_loop()
+        else:
+            self._loop = loop
+        self._callbacks = []
+        if self._loop.get_debug():
+            self._source_traceback = traceback.extract_stack(sys._getframe(1))
+
+    def _format_callbacks(self):
+        cb = self._callbacks
+        size = len(cb)
+        if not size:
+            cb = ''
+
+        def format_cb(callback):
+            return events._format_callback(callback, ())
+
+        if size == 1:
+            cb = format_cb(cb[0])
+        elif size == 2:
+            cb = '{}, {}'.format(format_cb(cb[0]), format_cb(cb[1]))
+        elif size > 2:
+            cb = '{}, <{} more>, {}'.format(format_cb(cb[0]),
+                                            size-2,
+                                            format_cb(cb[-1]))
+        return 'cb=[%s]' % cb
+
+    def _repr_info(self):
+        info = [self._state.lower()]
+        if self._state == _FINISHED:
+            if self._exception is not None:
+                info.append('exception={!r}'.format(self._exception))
+            else:
+                # use reprlib to limit the length of the output, especially
+                # for very long strings
+                result = reprlib.repr(self._result)
+                info.append('result={}'.format(result))
+        if self._callbacks:
+            info.append(self._format_callbacks())
+        if self._source_traceback:
+            frame = self._source_traceback[-1]
+            info.append('created at %s:%s' % (frame[0], frame[1]))
+        return info
+
+    def __repr__(self):
+        info = self._repr_info()
+        return '<%s %s>' % (self.__class__.__name__, ' '.join(info))
+
+    # On Python 3.3 and older, objects with a destructor part of a reference
+    # cycle are never destroyed. It's not more the case on Python 3.4 thanks
+    # to the PEP 442.
+    if _PY34:
+        def __del__(self):
+            if not self._log_traceback:
+                # set_exception() was not called, or result() or exception()
+                # has consumed the exception
+                return
+            exc = self._exception
+            context = {
+                'message': ('%s exception was never retrieved'
+                            % self.__class__.__name__),
+                'exception': exc,
+                'future': self,
+            }
+            if self._source_traceback:
+                context['source_traceback'] = self._source_traceback
+            self._loop.call_exception_handler(context)
+
+    def cancel(self):
+        """Cancel the future and schedule callbacks.
+
+        If the future is already done or cancelled, return False.  Otherwise,
+        change the future's state to cancelled, schedule the callbacks and
+        return True.
+        """
+        if self._state != _PENDING:
+            return False
+        self._state = _CANCELLED
+        self._schedule_callbacks()
+        return True
+
+    def _schedule_callbacks(self):
+        """Internal: Ask the event loop to call all callbacks.
+
+        The callbacks are scheduled to be called as soon as possible. Also
+        clears the callback list.
+        """
+        callbacks = self._callbacks[:]
+        if not callbacks:
+            return
+
+        self._callbacks[:] = []
+        for callback in callbacks:
+            self._loop.call_soon(callback, self)
+
+    def cancelled(self):
+        """Return True if the future was cancelled."""
+        return self._state == _CANCELLED
+
+    # Don't implement running(); see http://bugs.python.org/issue18699
+
+    def done(self):
+        """Return True if the future is done.
+
+        Done means either that a result / exception are available, or that the
+        future was cancelled.
+        """
+        return self._state != _PENDING
+
+    def result(self):
+        """Return the result this future represents.
+
+        If the future has been cancelled, raises CancelledError.  If the
+        future's result isn't yet available, raises InvalidStateError.  If
+        the future is done and has an exception set, this exception is raised.
+        """
+        if self._state == _CANCELLED:
+            raise CancelledError
+        if self._state != _FINISHED:
+            raise InvalidStateError('Result is not ready.')
+        self._log_traceback = False
+        if self._tb_logger is not None:
+            self._tb_logger.clear()
+            self._tb_logger = None
+        if self._exception is not None:
+            raise self._exception
+        return self._result
+
+    def exception(self):
+        """Return the exception that was set on this future.
+
+        The exception (or None if no exception was set) is returned only if
+        the future is done.  If the future has been cancelled, raises
+        CancelledError.  If the future isn't done yet, raises
+        InvalidStateError.
+        """
+        if self._state == _CANCELLED:
+            raise CancelledError
+        if self._state != _FINISHED:
+            raise InvalidStateError('Exception is not set.')
+        self._log_traceback = False
+        if self._tb_logger is not None:
+            self._tb_logger.clear()
+            self._tb_logger = None
+        return self._exception
+
+    def add_done_callback(self, fn):
+        """Add a callback to be run when the future becomes done.
+
+        The callback is called with a single argument - the future object. If
+        the future is already done when this is called, the callback is
+        scheduled with call_soon.
+        """
+        if self._state != _PENDING:
+            self._loop.call_soon(fn, self)
+        else:
+            self._callbacks.append(fn)
+
+    # New method not in PEP 3148.
+
+    def remove_done_callback(self, fn):
+        """Remove all instances of a callback from the "call when done" list.
+
+        Returns the number of callbacks removed.
+        """
+        filtered_callbacks = [f for f in self._callbacks if f != fn]
+        removed_count = len(self._callbacks) - len(filtered_callbacks)
+        if removed_count:
+            self._callbacks[:] = filtered_callbacks
+        return removed_count
+
+    # So-called internal methods (note: no set_running_or_notify_cancel()).
+
+    def _set_result_unless_cancelled(self, result):
+        """Helper setting the result only if the future was not cancelled."""
+        if self.cancelled():
+            return
+        self.set_result(result)
+
+    def set_result(self, result):
+        """Mark the future done and set its result.
+
+        If the future is already done when this method is called, raises
+        InvalidStateError.
+        """
+        if self._state != _PENDING:
+            raise InvalidStateError('{}: {!r}'.format(self._state, self))
+        self._result = result
+        self._state = _FINISHED
+        self._schedule_callbacks()
+
+    def set_exception(self, exception):
+        """Mark the future done and set an exception.
+
+        If the future is already done when this method is called, raises
+        InvalidStateError.
+        """
+        if self._state != _PENDING:
+            raise InvalidStateError('{}: {!r}'.format(self._state, self))
+        if isinstance(exception, type):
+            exception = exception()
+        self._exception = exception
+        self._state = _FINISHED
+        self._schedule_callbacks()
+        if _PY34:
+            self._log_traceback = True
+        else:
+            self._tb_logger = _TracebackLogger(self, exception)
+            # Arrange for the logger to be activated after all callbacks
+            # have had a chance to call result() or exception().
+            self._loop.call_soon(self._tb_logger.activate)
+
+    # Truly internal methods.
+
+    def _copy_state(self, other):
+        """Internal helper to copy state from another Future.
+
+        The other Future may be a concurrent.futures.Future.
+        """
+        assert other.done()
+        if self.cancelled():
+            return
+        assert not self.done()
+        if other.cancelled():
+            self.cancel()
+        else:
+            exception = other.exception()
+            if exception is not None:
+                self.set_exception(exception)
+            else:
+                result = other.result()
+                self.set_result(result)
+
+    def __iter__(self):
+        if not self.done():
+            self._blocking = True
+            yield self  # This tells Task to wait for completion.
+        assert self.done(), "yield from wasn't used with future"
+        return self.result()  # May raise too.
+
+
+def wrap_future(fut, *, loop=None):
+    """Wrap concurrent.futures.Future object."""
+    if isinstance(fut, Future):
+        return fut
+    assert isinstance(fut, concurrent.futures.Future), \
+        'concurrent.futures.Future is expected, got {!r}'.format(fut)
+    if loop is None:
+        loop = events.get_event_loop()
+    new_future = Future(loop=loop)
+
+    def _check_cancel_other(f):
+        if f.cancelled():
+            fut.cancel()
+
+    new_future.add_done_callback(_check_cancel_other)
+    fut.add_done_callback(
+        lambda future: loop.call_soon_threadsafe(
+            new_future._copy_state, future))
+    return new_future
diff --git a/Lib/asyncio/locks.py b/Lib/asyncio/locks.py
new file mode 100644
index 0000000..b943e9d
--- /dev/null
+++ b/Lib/asyncio/locks.py
@@ -0,0 +1,469 @@
+"""Synchronization primitives."""
+
+__all__ = ['Lock', 'Event', 'Condition', 'Semaphore', 'BoundedSemaphore']
+
+import collections
+
+from . import events
+from . import futures
+from .coroutines import coroutine
+
+
+class _ContextManager:
+    """Context manager.
+
+    This enables the following idiom for acquiring and releasing a
+    lock around a block:
+
+        with (yield from lock):
+            <block>
+
+    while failing loudly when accidentally using:
+
+        with lock:
+            <block>
+    """
+
+    def __init__(self, lock):
+        self._lock = lock
+
+    def __enter__(self):
+        # We have no use for the "as ..."  clause in the with
+        # statement for locks.
+        return None
+
+    def __exit__(self, *args):
+        try:
+            self._lock.release()
+        finally:
+            self._lock = None  # Crudely prevent reuse.
+
+
+class Lock:
+    """Primitive lock objects.
+
+    A primitive lock is a synchronization primitive that is not owned
+    by a particular coroutine when locked.  A primitive lock is in one
+    of two states, 'locked' or 'unlocked'.
+
+    It is created in the unlocked state.  It has two basic methods,
+    acquire() and release().  When the state is unlocked, acquire()
+    changes the state to locked and returns immediately.  When the
+    state is locked, acquire() blocks until a call to release() in
+    another coroutine changes it to unlocked, then the acquire() call
+    resets it to locked and returns.  The release() method should only
+    be called in the locked state; it changes the state to unlocked
+    and returns immediately.  If an attempt is made to release an
+    unlocked lock, a RuntimeError will be raised.
+
+    When more than one coroutine is blocked in acquire() waiting for
+    the state to turn to unlocked, only one coroutine proceeds when a
+    release() call resets the state to unlocked; first coroutine which
+    is blocked in acquire() is being processed.
+
+    acquire() is a coroutine and should be called with 'yield from'.
+
+    Locks also support the context management protocol.  '(yield from lock)'
+    should be used as context manager expression.
+
+    Usage:
+
+        lock = Lock()
+        ...
+        yield from lock
+        try:
+            ...
+        finally:
+            lock.release()
+
+    Context manager usage:
+
+        lock = Lock()
+        ...
+        with (yield from lock):
+             ...
+
+    Lock objects can be tested for locking state:
+
+        if not lock.locked():
+           yield from lock
+        else:
+           # lock is acquired
+           ...
+
+    """
+
+    def __init__(self, *, loop=None):
+        self._waiters = collections.deque()
+        self._locked = False
+        if loop is not None:
+            self._loop = loop
+        else:
+            self._loop = events.get_event_loop()
+
+    def __repr__(self):
+        res = super().__repr__()
+        extra = 'locked' if self._locked else 'unlocked'
+        if self._waiters:
+            extra = '{},waiters:{}'.format(extra, len(self._waiters))
+        return '<{} [{}]>'.format(res[1:-1], extra)
+
+    def locked(self):
+        """Return True if lock is acquired."""
+        return self._locked
+
+    @coroutine
+    def acquire(self):
+        """Acquire a lock.
+
+        This method blocks until the lock is unlocked, then sets it to
+        locked and returns True.
+        """
+        if not self._waiters and not self._locked:
+            self._locked = True
+            return True
+
+        fut = futures.Future(loop=self._loop)
+        self._waiters.append(fut)
+        try:
+            yield from fut
+            self._locked = True
+            return True
+        finally:
+            self._waiters.remove(fut)
+
+    def release(self):
+        """Release a lock.
+
+        When the lock is locked, reset it to unlocked, and return.
+        If any other coroutines are blocked waiting for the lock to become
+        unlocked, allow exactly one of them to proceed.
+
+        When invoked on an unlocked lock, a RuntimeError is raised.
+
+        There is no return value.
+        """
+        if self._locked:
+            self._locked = False
+            # Wake up the first waiter who isn't cancelled.
+            for fut in self._waiters:
+                if not fut.done():
+                    fut.set_result(True)
+                    break
+        else:
+            raise RuntimeError('Lock is not acquired.')
+
+    def __enter__(self):
+        raise RuntimeError(
+            '"yield from" should be used as context manager expression')
+
+    def __exit__(self, *args):
+        # This must exist because __enter__ exists, even though that
+        # always raises; that's how the with-statement works.
+        pass
+
+    def __iter__(self):
+        # This is not a coroutine.  It is meant to enable the idiom:
+        #
+        #     with (yield from lock):
+        #         <block>
+        #
+        # as an alternative to:
+        #
+        #     yield from lock.acquire()
+        #     try:
+        #         <block>
+        #     finally:
+        #         lock.release()
+        yield from self.acquire()
+        return _ContextManager(self)
+
+
+class Event:
+    """Asynchronous equivalent to threading.Event.
+
+    Class implementing event objects. An event manages a flag that can be set
+    to true with the set() method and reset to false with the clear() method.
+    The wait() method blocks until the flag is true. The flag is initially
+    false.
+    """
+
+    def __init__(self, *, loop=None):
+        self._waiters = collections.deque()
+        self._value = False
+        if loop is not None:
+            self._loop = loop
+        else:
+            self._loop = events.get_event_loop()
+
+    def __repr__(self):
+        res = super().__repr__()
+        extra = 'set' if self._value else 'unset'
+        if self._waiters:
+            extra = '{},waiters:{}'.format(extra, len(self._waiters))
+        return '<{} [{}]>'.format(res[1:-1], extra)
+
+    def is_set(self):
+        """Return True if and only if the internal flag is true."""
+        return self._value
+
+    def set(self):
+        """Set the internal flag to true. All coroutines waiting for it to
+        become true are awakened. Coroutine that call wait() once the flag is
+        true will not block at all.
+        """
+        if not self._value:
+            self._value = True
+
+            for fut in self._waiters:
+                if not fut.done():
+                    fut.set_result(True)
+
+    def clear(self):
+        """Reset the internal flag to false. Subsequently, coroutines calling
+        wait() will block until set() is called to set the internal flag
+        to true again."""
+        self._value = False
+
+    @coroutine
+    def wait(self):
+        """Block until the internal flag is true.
+
+        If the internal flag is true on entry, return True
+        immediately.  Otherwise, block until another coroutine calls
+        set() to set the flag to true, then return True.
+        """
+        if self._value:
+            return True
+
+        fut = futures.Future(loop=self._loop)
+        self._waiters.append(fut)
+        try:
+            yield from fut
+            return True
+        finally:
+            self._waiters.remove(fut)
+
+
+class Condition:
+    """Asynchronous equivalent to threading.Condition.
+
+    This class implements condition variable objects. A condition variable
+    allows one or more coroutines to wait until they are notified by another
+    coroutine.
+
+    A new Lock object is created and used as the underlying lock.
+    """
+
+    def __init__(self, lock=None, *, loop=None):
+        if loop is not None:
+            self._loop = loop
+        else:
+            self._loop = events.get_event_loop()
+
+        if lock is None:
+            lock = Lock(loop=self._loop)
+        elif lock._loop is not self._loop:
+            raise ValueError("loop argument must agree with lock")
+
+        self._lock = lock
+        # Export the lock's locked(), acquire() and release() methods.
+        self.locked = lock.locked
+        self.acquire = lock.acquire
+        self.release = lock.release
+
+        self._waiters = collections.deque()
+
+    def __repr__(self):
+        res = super().__repr__()
+        extra = 'locked' if self.locked() else 'unlocked'
+        if self._waiters:
+            extra = '{},waiters:{}'.format(extra, len(self._waiters))
+        return '<{} [{}]>'.format(res[1:-1], extra)
+
+    @coroutine
+    def wait(self):
+        """Wait until notified.
+
+        If the calling coroutine has not acquired the lock when this
+        method is called, a RuntimeError is raised.
+
+        This method releases the underlying lock, and then blocks
+        until it is awakened by a notify() or notify_all() call for
+        the same condition variable in another coroutine.  Once
+        awakened, it re-acquires the lock and returns True.
+        """
+        if not self.locked():
+            raise RuntimeError('cannot wait on un-acquired lock')
+
+        self.release()
+        try:
+            fut = futures.Future(loop=self._loop)
+            self._waiters.append(fut)
+            try:
+                yield from fut
+                return True
+            finally:
+                self._waiters.remove(fut)
+
+        finally:
+            yield from self.acquire()
+
+    @coroutine
+    def wait_for(self, predicate):
+        """Wait until a predicate becomes true.
+
+        The predicate should be a callable which result will be
+        interpreted as a boolean value.  The final predicate value is
+        the return value.
+        """
+        result = predicate()
+        while not result:
+            yield from self.wait()
+            result = predicate()
+        return result
+
+    def notify(self, n=1):
+        """By default, wake up one coroutine waiting on this condition, if any.
+        If the calling coroutine has not acquired the lock when this method
+        is called, a RuntimeError is raised.
+
+        This method wakes up at most n of the coroutines waiting for the
+        condition variable; it is a no-op if no coroutines are waiting.
+
+        Note: an awakened coroutine does not actually return from its
+        wait() call until it can reacquire the lock. Since notify() does
+        not release the lock, its caller should.
+        """
+        if not self.locked():
+            raise RuntimeError('cannot notify on un-acquired lock')
+
+        idx = 0
+        for fut in self._waiters:
+            if idx >= n:
+                break
+
+            if not fut.done():
+                idx += 1
+                fut.set_result(False)
+
+    def notify_all(self):
+        """Wake up all threads waiting on this condition. This method acts
+        like notify(), but wakes up all waiting threads instead of one. If the
+        calling thread has not acquired the lock when this method is called,
+        a RuntimeError is raised.
+        """
+        self.notify(len(self._waiters))
+
+    def __enter__(self):
+        raise RuntimeError(
+            '"yield from" should be used as context manager expression')
+
+    def __exit__(self, *args):
+        pass
+
+    def __iter__(self):
+        # See comment in Lock.__iter__().
+        yield from self.acquire()
+        return _ContextManager(self)
+
+
+class Semaphore:
+    """A Semaphore implementation.
+
+    A semaphore manages an internal counter which is decremented by each
+    acquire() call and incremented by each release() call. The counter
+    can never go below zero; when acquire() finds that it is zero, it blocks,
+    waiting until some other thread calls release().
+
+    Semaphores also support the context management protocol.
+
+    The optional argument gives the initial value for the internal
+    counter; it defaults to 1. If the value given is less than 0,
+    ValueError is raised.
+    """
+
+    def __init__(self, value=1, *, loop=None):
+        if value < 0:
+            raise ValueError("Semaphore initial value must be >= 0")
+        self._value = value
+        self._waiters = collections.deque()
+        if loop is not None:
+            self._loop = loop
+        else:
+            self._loop = events.get_event_loop()
+
+    def __repr__(self):
+        res = super().__repr__()
+        extra = 'locked' if self.locked() else 'unlocked,value:{}'.format(
+            self._value)
+        if self._waiters:
+            extra = '{},waiters:{}'.format(extra, len(self._waiters))
+        return '<{} [{}]>'.format(res[1:-1], extra)
+
+    def locked(self):
+        """Returns True if semaphore can not be acquired immediately."""
+        return self._value == 0
+
+    @coroutine
+    def acquire(self):
+        """Acquire a semaphore.
+
+        If the internal counter is larger than zero on entry,
+        decrement it by one and return True immediately.  If it is
+        zero on entry, block, waiting until some other coroutine has
+        called release() to make it larger than 0, and then return
+        True.
+        """
+        if not self._waiters and self._value > 0:
+            self._value -= 1
+            return True
+
+        fut = futures.Future(loop=self._loop)
+        self._waiters.append(fut)
+        try:
+            yield from fut
+            self._value -= 1
+            return True
+        finally:
+            self._waiters.remove(fut)
+
+    def release(self):
+        """Release a semaphore, incrementing the internal counter by one.
+        When it was zero on entry and another coroutine is waiting for it to
+        become larger than zero again, wake up that coroutine.
+        """
+        self._value += 1
+        for waiter in self._waiters:
+            if not waiter.done():
+                waiter.set_result(True)
+                break
+
+    def __enter__(self):
+        raise RuntimeError(
+            '"yield from" should be used as context manager expression')
+
+    def __exit__(self, *args):
+        pass
+
+    def __iter__(self):
+        # See comment in Lock.__iter__().
+        yield from self.acquire()
+        return _ContextManager(self)
+
+
+class BoundedSemaphore(Semaphore):
+    """A bounded semaphore implementation.
+
+    This raises ValueError in release() if it would increase the value
+    above the initial value.
+    """
+
+    def __init__(self, value=1, *, loop=None):
+        self._bound_value = value
+        super().__init__(value, loop=loop)
+
+    def release(self):
+        if self._value >= self._bound_value:
+            raise ValueError('BoundedSemaphore released too many times')
+        super().release()
diff --git a/Lib/asyncio/log.py b/Lib/asyncio/log.py
new file mode 100644
index 0000000..23a7074
--- /dev/null
+++ b/Lib/asyncio/log.py
@@ -0,0 +1,7 @@
+"""Logging configuration."""
+
+import logging
+
+
+# Name the logger after the package.
+logger = logging.getLogger(__package__)
diff --git a/Lib/asyncio/proactor_events.py b/Lib/asyncio/proactor_events.py
new file mode 100644
index 0000000..65de926
--- /dev/null
+++ b/Lib/asyncio/proactor_events.py
@@ -0,0 +1,546 @@
+"""Event loop using a proactor and related classes.
+
+A proactor is a "notify-on-completion" multiplexer.  Currently a
+proactor is only implemented on Windows with IOCP.
+"""
+
+__all__ = ['BaseProactorEventLoop']
+
+import socket
+import sys
+import warnings
+
+from . import base_events
+from . import constants
+from . import futures
+from . import sslproto
+from . import transports
+from .log import logger
+
+
+class _ProactorBasePipeTransport(transports._FlowControlMixin,
+                                 transports.BaseTransport):
+    """Base class for pipe and socket transports."""
+
+    def __init__(self, loop, sock, protocol, waiter=None,
+                 extra=None, server=None):
+        super().__init__(extra, loop)
+        self._set_extra(sock)
+        self._sock = sock
+        self._protocol = protocol
+        self._server = server
+        self._buffer = None  # None or bytearray.
+        self._read_fut = None
+        self._write_fut = None
+        self._pending_write = 0
+        self._conn_lost = 0
+        self._closing = False  # Set when close() called.
+        self._eof_written = False
+        if self._server is not None:
+            self._server._attach()
+        self._loop.call_soon(self._protocol.connection_made, self)
+        if waiter is not None:
+            # only wake up the waiter when connection_made() has been called
+            self._loop.call_soon(waiter._set_result_unless_cancelled, None)
+
+    def __repr__(self):
+        info = [self.__class__.__name__]
+        if self._sock is None:
+            info.append('closed')
+        elif self._closing:
+            info.append('closing')
+        if self._sock is not None:
+            info.append('fd=%s' % self._sock.fileno())
+        if self._read_fut is not None:
+            info.append('read=%s' % self._read_fut)
+        if self._write_fut is not None:
+            info.append("write=%r" % self._write_fut)
+        if self._buffer:
+            bufsize = len(self._buffer)
+            info.append('write_bufsize=%s' % bufsize)
+        if self._eof_written:
+            info.append('EOF written')
+        return '<%s>' % ' '.join(info)
+
+    def _set_extra(self, sock):
+        self._extra['pipe'] = sock
+
+    def close(self):
+        if self._closing:
+            return
+        self._closing = True
+        self._conn_lost += 1
+        if not self._buffer and self._write_fut is None:
+            self._loop.call_soon(self._call_connection_lost, None)
+        if self._read_fut is not None:
+            self._read_fut.cancel()
+            self._read_fut = None
+
+    # On Python 3.3 and older, objects with a destructor part of a reference
+    # cycle are never destroyed. It's not more the case on Python 3.4 thanks
+    # to the PEP 442.
+    if sys.version_info >= (3, 4):
+        def __del__(self):
+            if self._sock is not None:
+                warnings.warn("unclosed transport %r" % self, ResourceWarning)
+                self.close()
+
+    def _fatal_error(self, exc, message='Fatal error on pipe transport'):
+        if isinstance(exc, (BrokenPipeError, ConnectionResetError)):
+            if self._loop.get_debug():
+                logger.debug("%r: %s", self, message, exc_info=True)
+        else:
+            self._loop.call_exception_handler({
+                'message': message,
+                'exception': exc,
+                'transport': self,
+                'protocol': self._protocol,
+            })
+        self._force_close(exc)
+
+    def _force_close(self, exc):
+        if self._closing:
+            return
+        self._closing = True
+        self._conn_lost += 1
+        if self._write_fut:
+            self._write_fut.cancel()
+            self._write_fut = None
+        if self._read_fut:
+            self._read_fut.cancel()
+            self._read_fut = None
+        self._pending_write = 0
+        self._buffer = None
+        self._loop.call_soon(self._call_connection_lost, exc)
+
+    def _call_connection_lost(self, exc):
+        try:
+            self._protocol.connection_lost(exc)
+        finally:
+            # XXX If there is a pending overlapped read on the other
+            # end then it may fail with ERROR_NETNAME_DELETED if we
+            # just close our end.  First calling shutdown() seems to
+            # cure it, but maybe using DisconnectEx() would be better.
+            if hasattr(self._sock, 'shutdown'):
+                self._sock.shutdown(socket.SHUT_RDWR)
+            self._sock.close()
+            self._sock = None
+            server = self._server
+            if server is not None:
+                server._detach()
+                self._server = None
+
+    def get_write_buffer_size(self):
+        size = self._pending_write
+        if self._buffer is not None:
+            size += len(self._buffer)
+        return size
+
+
+class _ProactorReadPipeTransport(_ProactorBasePipeTransport,
+                                 transports.ReadTransport):
+    """Transport for read pipes."""
+
+    def __init__(self, loop, sock, protocol, waiter=None,
+                 extra=None, server=None):
+        super().__init__(loop, sock, protocol, waiter, extra, server)
+        self._paused = False
+        self._loop.call_soon(self._loop_reading)
+
+    def pause_reading(self):
+        if self._closing:
+            raise RuntimeError('Cannot pause_reading() when closing')
+        if self._paused:
+            raise RuntimeError('Already paused')
+        self._paused = True
+        if self._loop.get_debug():
+            logger.debug("%r pauses reading", self)
+
+    def resume_reading(self):
+        if not self._paused:
+            raise RuntimeError('Not paused')
+        self._paused = False
+        if self._closing:
+            return
+        self._loop.call_soon(self._loop_reading, self._read_fut)
+        if self._loop.get_debug():
+            logger.debug("%r resumes reading", self)
+
+    def _loop_reading(self, fut=None):
+        if self._paused:
+            return
+        data = None
+
+        try:
+            if fut is not None:
+                assert self._read_fut is fut or (self._read_fut is None and
+                                                 self._closing)
+                self._read_fut = None
+                data = fut.result()  # deliver data later in "finally" clause
+
+            if self._closing:
+                # since close() has been called we ignore any read data
+                data = None
+                return
+
+            if data == b'':
+                # we got end-of-file so no need to reschedule a new read
+                return
+
+            # reschedule a new read
+            self._read_fut = self._loop._proactor.recv(self._sock, 4096)
+        except ConnectionAbortedError as exc:
+            if not self._closing:
+                self._fatal_error(exc, 'Fatal read error on pipe transport')
+            elif self._loop.get_debug():
+                logger.debug("Read error on pipe transport while closing",
+                             exc_info=True)
+        except ConnectionResetError as exc:
+            self._force_close(exc)
+        except OSError as exc:
+            self._fatal_error(exc, 'Fatal read error on pipe transport')
+        except futures.CancelledError:
+            if not self._closing:
+                raise
+        else:
+            self._read_fut.add_done_callback(self._loop_reading)
+        finally:
+            if data:
+                self._protocol.data_received(data)
+            elif data is not None:
+                if self._loop.get_debug():
+                    logger.debug("%r received EOF", self)
+                keep_open = self._protocol.eof_received()
+                if not keep_open:
+                    self.close()
+
+
+class _ProactorBaseWritePipeTransport(_ProactorBasePipeTransport,
+                                      transports.WriteTransport):
+    """Transport for write pipes."""
+
+    def write(self, data):
+        if not isinstance(data, (bytes, bytearray, memoryview)):
+            raise TypeError('data argument must be byte-ish (%r)',
+                            type(data))
+        if self._eof_written:
+            raise RuntimeError('write_eof() already called')
+
+        if not data:
+            return
+
+        if self._conn_lost:
+            if self._conn_lost >= constants.LOG_THRESHOLD_FOR_CONNLOST_WRITES:
+                logger.warning('socket.send() raised exception.')
+            self._conn_lost += 1
+            return
+
+        # Observable states:
+        # 1. IDLE: _write_fut and _buffer both None
+        # 2. WRITING: _write_fut set; _buffer None
+        # 3. BACKED UP: _write_fut set; _buffer a bytearray
+        # We always copy the data, so the caller can't modify it
+        # while we're still waiting for the I/O to happen.
+        if self._write_fut is None:  # IDLE -> WRITING
+            assert self._buffer is None
+            # Pass a copy, except if it's already immutable.
+            self._loop_writing(data=bytes(data))
+        elif not self._buffer:  # WRITING -> BACKED UP
+            # Make a mutable copy which we can extend.
+            self._buffer = bytearray(data)
+            self._maybe_pause_protocol()
+        else:  # BACKED UP
+            # Append to buffer (also copies).
+            self._buffer.extend(data)
+            self._maybe_pause_protocol()
+
+    def _loop_writing(self, f=None, data=None):
+        try:
+            assert f is self._write_fut
+            self._write_fut = None
+            self._pending_write = 0
+            if f:
+                f.result()
+            if data is None:
+                data = self._buffer
+                self._buffer = None
+            if not data:
+                if self._closing:
+                    self._loop.call_soon(self._call_connection_lost, None)
+                if self._eof_written:
+                    self._sock.shutdown(socket.SHUT_WR)
+                # Now that we've reduced the buffer size, tell the
+                # protocol to resume writing if it was paused.  Note that
+                # we do this last since the callback is called immediately
+                # and it may add more data to the buffer (even causing the
+                # protocol to be paused again).
+                self._maybe_resume_protocol()
+            else:
+                self._write_fut = self._loop._proactor.send(self._sock, data)
+                if not self._write_fut.done():
+                    assert self._pending_write == 0
+                    self._pending_write = len(data)
+                    self._write_fut.add_done_callback(self._loop_writing)
+                    self._maybe_pause_protocol()
+                else:
+                    self._write_fut.add_done_callback(self._loop_writing)
+        except ConnectionResetError as exc:
+            self._force_close(exc)
+        except OSError as exc:
+            self._fatal_error(exc, 'Fatal write error on pipe transport')
+
+    def can_write_eof(self):
+        return True
+
+    def write_eof(self):
+        self.close()
+
+    def abort(self):
+        self._force_close(None)
+
+
+class _ProactorWritePipeTransport(_ProactorBaseWritePipeTransport):
+    def __init__(self, *args, **kw):
+        super().__init__(*args, **kw)
+        self._read_fut = self._loop._proactor.recv(self._sock, 16)
+        self._read_fut.add_done_callback(self._pipe_closed)
+
+    def _pipe_closed(self, fut):
+        if fut.cancelled():
+            # the transport has been closed
+            return
+        assert fut.result() == b''
+        if self._closing:
+            assert self._read_fut is None
+            return
+        assert fut is self._read_fut, (fut, self._read_fut)
+        self._read_fut = None
+        if self._write_fut is not None:
+            self._force_close(BrokenPipeError())
+        else:
+            self.close()
+
+
+class _ProactorDuplexPipeTransport(_ProactorReadPipeTransport,
+                                   _ProactorBaseWritePipeTransport,
+                                   transports.Transport):
+    """Transport for duplex pipes."""
+
+    def can_write_eof(self):
+        return False
+
+    def write_eof(self):
+        raise NotImplementedError
+
+
+class _ProactorSocketTransport(_ProactorReadPipeTransport,
+                               _ProactorBaseWritePipeTransport,
+                               transports.Transport):
+    """Transport for connected sockets."""
+
+    def _set_extra(self, sock):
+        self._extra['socket'] = sock
+        try:
+            self._extra['sockname'] = sock.getsockname()
+        except (socket.error, AttributeError):
+            if self._loop.get_debug():
+                logger.warning("getsockname() failed on %r",
+                             sock, exc_info=True)
+        if 'peername' not in self._extra:
+            try:
+                self._extra['peername'] = sock.getpeername()
+            except (socket.error, AttributeError):
+                if self._loop.get_debug():
+                    logger.warning("getpeername() failed on %r",
+                                   sock, exc_info=True)
+
+    def can_write_eof(self):
+        return True
+
+    def write_eof(self):
+        if self._closing or self._eof_written:
+            return
+        self._eof_written = True
+        if self._write_fut is None:
+            self._sock.shutdown(socket.SHUT_WR)
+
+
+class BaseProactorEventLoop(base_events.BaseEventLoop):
+
+    def __init__(self, proactor):
+        super().__init__()
+        logger.debug('Using proactor: %s', proactor.__class__.__name__)
+        self._proactor = proactor
+        self._selector = proactor   # convenient alias
+        self._self_reading_future = None
+        self._accept_futures = {}   # socket file descriptor => Future
+        proactor.set_loop(self)
+        self._make_self_pipe()
+
+    def _make_socket_transport(self, sock, protocol, waiter=None,
+                               extra=None, server=None):
+        return _ProactorSocketTransport(self, sock, protocol, waiter,
+                                        extra, server)
+
+    def _make_ssl_transport(self, rawsock, protocol, sslcontext, waiter=None,
+                            *, server_side=False, server_hostname=None,
+                            extra=None, server=None):
+        if not sslproto._is_sslproto_available():
+            raise NotImplementedError("Proactor event loop requires Python 3.5"
+                                      " or newer (ssl.MemoryBIO) to support "
+                                      "SSL")
+
+        ssl_protocol = sslproto.SSLProtocol(self, protocol, sslcontext, waiter,
+                                            server_side, server_hostname)
+        _ProactorSocketTransport(self, rawsock, ssl_protocol,
+                                 extra=extra, server=server)
+        return ssl_protocol._app_transport
+
+    def _make_duplex_pipe_transport(self, sock, protocol, waiter=None,
+                                    extra=None):
+        return _ProactorDuplexPipeTransport(self,
+                                            sock, protocol, waiter, extra)
+
+    def _make_read_pipe_transport(self, sock, protocol, waiter=None,
+                                  extra=None):
+        return _ProactorReadPipeTransport(self, sock, protocol, waiter, extra)
+
+    def _make_write_pipe_transport(self, sock, protocol, waiter=None,
+                                   extra=None):
+        # We want connection_lost() to be called when other end closes
+        return _ProactorWritePipeTransport(self,
+                                           sock, protocol, waiter, extra)
+
+    def close(self):
+        if self.is_running():
+            raise RuntimeError("Cannot close a running event loop")
+        if self.is_closed():
+            return
+
+        # Call these methods before closing the event loop (before calling
+        # BaseEventLoop.close), because they can schedule callbacks with
+        # call_soon(), which is forbidden when the event loop is closed.
+        self._stop_accept_futures()
+        self._close_self_pipe()
+        self._proactor.close()
+        self._proactor = None
+        self._selector = None
+
+        # Close the event loop
+        super().close()
+
+    def sock_recv(self, sock, n):
+        return self._proactor.recv(sock, n)
+
+    def sock_sendall(self, sock, data):
+        return self._proactor.send(sock, data)
+
+    def sock_connect(self, sock, address):
+        try:
+            base_events._check_resolved_address(sock, address)
+        except ValueError as err:
+            fut = futures.Future(loop=self)
+            fut.set_exception(err)
+            return fut
+        else:
+            return self._proactor.connect(sock, address)
+
+    def sock_accept(self, sock):
+        return self._proactor.accept(sock)
+
+    def _socketpair(self):
+        raise NotImplementedError
+
+    def _close_self_pipe(self):
+        if self._self_reading_future is not None:
+            self._self_reading_future.cancel()
+            self._self_reading_future = None
+        self._ssock.close()
+        self._ssock = None
+        self._csock.close()
+        self._csock = None
+        self._internal_fds -= 1
+
+    def _make_self_pipe(self):
+        # A self-socket, really. :-)
+        self._ssock, self._csock = self._socketpair()
+        self._ssock.setblocking(False)
+        self._csock.setblocking(False)
+        self._internal_fds += 1
+        self.call_soon(self._loop_self_reading)
+
+    def _loop_self_reading(self, f=None):
+        try:
+            if f is not None:
+                f.result()  # may raise
+            f = self._proactor.recv(self._ssock, 4096)
+        except futures.CancelledError:
+            # _close_self_pipe() has been called, stop waiting for data
+            return
+        except Exception as exc:
+            self.call_exception_handler({
+                'message': 'Error on reading from the event loop self pipe',
+                'exception': exc,
+                'loop': self,
+            })
+        else:
+            self._self_reading_future = f
+            f.add_done_callback(self._loop_self_reading)
+
+    def _write_to_self(self):
+        self._csock.send(b'\0')
+
+    def _start_serving(self, protocol_factory, sock,
+                       sslcontext=None, server=None):
+
+        def loop(f=None):
+            try:
+                if f is not None:
+                    conn, addr = f.result()
+                    if self._debug:
+                        logger.debug("%r got a new connection from %r: %r",
+                                     server, addr, conn)
+                    protocol = protocol_factory()
+                    if sslcontext is not None:
+                        self._make_ssl_transport(
+                            conn, protocol, sslcontext, server_side=True,
+                            extra={'peername': addr}, server=server)
+                    else:
+                        self._make_socket_transport(
+                            conn, protocol,
+                            extra={'peername': addr}, server=server)
+                if self.is_closed():
+                    return
+                f = self._proactor.accept(sock)
+            except OSError as exc:
+                if sock.fileno() != -1:
+                    self.call_exception_handler({
+                        'message': 'Accept failed on a socket',
+                        'exception': exc,
+                        'socket': sock,
+                    })
+                    sock.close()
+                elif self._debug:
+                    logger.debug("Accept failed on socket %r",
+                                 sock, exc_info=True)
+            except futures.CancelledError:
+                sock.close()
+            else:
+                self._accept_futures[sock.fileno()] = f
+                f.add_done_callback(loop)
+
+        self.call_soon(loop)
+
+    def _process_events(self, event_list):
+        # Events are processed in the IocpProactor._poll() method
+        pass
+
+    def _stop_accept_futures(self):
+        for future in self._accept_futures.values():
+            future.cancel()
+        self._accept_futures.clear()
+
+    def _stop_serving(self, sock):
+        self._stop_accept_futures()
+        self._proactor._stop_serving(sock)
+        sock.close()
diff --git a/Lib/asyncio/protocols.py b/Lib/asyncio/protocols.py
new file mode 100644
index 0000000..80fcac9
--- /dev/null
+++ b/Lib/asyncio/protocols.py
@@ -0,0 +1,134 @@
+"""Abstract Protocol class."""
+
+__all__ = ['BaseProtocol', 'Protocol', 'DatagramProtocol',
+           'SubprocessProtocol']
+
+
+class BaseProtocol:
+    """Common base class for protocol interfaces.
+
+    Usually user implements protocols that derived from BaseProtocol
+    like Protocol or ProcessProtocol.
+
+    The only case when BaseProtocol should be implemented directly is
+    write-only transport like write pipe
+    """
+
+    def connection_made(self, transport):
+        """Called when a connection is made.
+
+        The argument is the transport representing the pipe connection.
+        To receive data, wait for data_received() calls.
+        When the connection is closed, connection_lost() is called.
+        """
+
+    def connection_lost(self, exc):
+        """Called when the connection is lost or closed.
+
+        The argument is an exception object or None (the latter
+        meaning a regular EOF is received or the connection was
+        aborted or closed).
+        """
+
+    def pause_writing(self):
+        """Called when the transport's buffer goes over the high-water mark.
+
+        Pause and resume calls are paired -- pause_writing() is called
+        once when the buffer goes strictly over the high-water mark
+        (even if subsequent writes increases the buffer size even
+        more), and eventually resume_writing() is called once when the
+        buffer size reaches the low-water mark.
+
+        Note that if the buffer size equals the high-water mark,
+        pause_writing() is not called -- it must go strictly over.
+        Conversely, resume_writing() is called when the buffer size is
+        equal or lower than the low-water mark.  These end conditions
+        are important to ensure that things go as expected when either
+        mark is zero.
+
+        NOTE: This is the only Protocol callback that is not called
+        through EventLoop.call_soon() -- if it were, it would have no
+        effect when it's most needed (when the app keeps writing
+        without yielding until pause_writing() is called).
+        """
+
+    def resume_writing(self):
+        """Called when the transport's buffer drains below the low-water mark.
+
+        See pause_writing() for details.
+        """
+
+
+class Protocol(BaseProtocol):
+    """Interface for stream protocol.
+
+    The user should implement this interface.  They can inherit from
+    this class but don't need to.  The implementations here do
+    nothing (they don't raise exceptions).
+
+    When the user wants to requests a transport, they pass a protocol
+    factory to a utility function (e.g., EventLoop.create_connection()).
+
+    When the connection is made successfully, connection_made() is
+    called with a suitable transport object.  Then data_received()
+    will be called 0 or more times with data (bytes) received from the
+    transport; finally, connection_lost() will be called exactly once
+    with either an exception object or None as an argument.
+
+    State machine of calls:
+
+      start -> CM [-> DR*] [-> ER?] -> CL -> end
+
+    * CM: connection_made()
+    * DR: data_received()
+    * ER: eof_received()
+    * CL: connection_lost()
+    """
+
+    def data_received(self, data):
+        """Called when some data is received.
+
+        The argument is a bytes object.
+        """
+
+    def eof_received(self):
+        """Called when the other end calls write_eof() or equivalent.
+
+        If this returns a false value (including None), the transport
+        will close itself.  If it returns a true value, closing the
+        transport is up to the protocol.
+        """
+
+
+class DatagramProtocol(BaseProtocol):
+    """Interface for datagram protocol."""
+
+    def datagram_received(self, data, addr):
+        """Called when some datagram is received."""
+
+    def error_received(self, exc):
+        """Called when a send or receive operation raises an OSError.
+
+        (Other than BlockingIOError or InterruptedError.)
+        """
+
+
+class SubprocessProtocol(BaseProtocol):
+    """Interface for protocol for subprocess calls."""
+
+    def pipe_data_received(self, fd, data):
+        """Called when the subprocess writes data into stdout/stderr pipe.
+
+        fd is int file descriptor.
+        data is bytes object.
+        """
+
+    def pipe_connection_lost(self, fd, exc):
+        """Called when a file descriptor associated with the child process is
+        closed.
+
+        fd is the int file descriptor that was closed.
+        """
+
+    def process_exited(self):
+        """Called when subprocess has exited."""
diff --git a/Lib/asyncio/queues.py b/Lib/asyncio/queues.py
new file mode 100644
index 0000000..dce0d53
--- /dev/null
+++ b/Lib/asyncio/queues.py
@@ -0,0 +1,298 @@
+"""Queues"""
+
+__all__ = ['Queue', 'PriorityQueue', 'LifoQueue', 'JoinableQueue',
+           'QueueFull', 'QueueEmpty']
+
+import collections
+import heapq
+
+from . import events
+from . import futures
+from . import locks
+from .tasks import coroutine
+
+
+class QueueEmpty(Exception):
+    'Exception raised by Queue.get(block=0)/get_nowait().'
+    pass
+
+
+class QueueFull(Exception):
+    'Exception raised by Queue.put(block=0)/put_nowait().'
+    pass
+
+
+class Queue:
+    """A queue, useful for coordinating producer and consumer coroutines.
+
+    If maxsize is less than or equal to zero, the queue size is infinite. If it
+    is an integer greater than 0, then "yield from put()" will block when the
+    queue reaches maxsize, until an item is removed by get().
+
+    Unlike the standard library Queue, you can reliably know this Queue's size
+    with qsize(), since your single-threaded asyncio application won't be
+    interrupted between calling qsize() and doing an operation on the Queue.
+    """
+
+    def __init__(self, maxsize=0, *, loop=None):
+        if loop is None:
+            self._loop = events.get_event_loop()
+        else:
+            self._loop = loop
+        self._maxsize = maxsize
+
+        # Futures.
+        self._getters = collections.deque()
+        # Pairs of (item, Future).
+        self._putters = collections.deque()
+        self._init(maxsize)
+
+    def _init(self, maxsize):
+        self._queue = collections.deque()
+
+    def _get(self):
+        return self._queue.popleft()
+
+    def _put(self, item):
+        self._queue.append(item)
+
+    def __repr__(self):
+        return '<{} at {:#x} {}>'.format(
+            type(self).__name__, id(self), self._format())
+
+    def __str__(self):
+        return '<{} {}>'.format(type(self).__name__, self._format())
+
+    def _format(self):
+        result = 'maxsize={!r}'.format(self._maxsize)
+        if getattr(self, '_queue', None):
+            result += ' _queue={!r}'.format(list(self._queue))
+        if self._getters:
+            result += ' _getters[{}]'.format(len(self._getters))
+        if self._putters:
+            result += ' _putters[{}]'.format(len(self._putters))
+        return result
+
+    def _consume_done_getters(self):
+        # Delete waiters at the head of the get() queue who've timed out.
+        while self._getters and self._getters[0].done():
+            self._getters.popleft()
+
+    def _consume_done_putters(self):
+        # Delete waiters at the head of the put() queue who've timed out.
+        while self._putters and self._putters[0][1].done():
+            self._putters.popleft()
+
+    def qsize(self):
+        """Number of items in the queue."""
+        return len(self._queue)
+
+    @property
+    def maxsize(self):
+        """Number of items allowed in the queue."""
+        return self._maxsize
+
+    def empty(self):
+        """Return True if the queue is empty, False otherwise."""
+        return not self._queue
+
+    def full(self):
+        """Return True if there are maxsize items in the queue.
+
+        Note: if the Queue was initialized with maxsize=0 (the default),
+        then full() is never True.
+        """
+        if self._maxsize <= 0:
+            return False
+        else:
+            return self.qsize() >= self._maxsize
+
+    @coroutine
+    def put(self, item):
+        """Put an item into the queue.
+
+        Put an item into the queue. If the queue is full, wait until a free
+        slot is available before adding item.
+
+        This method is a coroutine.
+        """
+        self._consume_done_getters()
+        if self._getters:
+            assert not self._queue, (
+                'queue non-empty, why are getters waiting?')
+
+            getter = self._getters.popleft()
+
+            # Use _put and _get instead of passing item straight to getter, in
+            # case a subclass has logic that must run (e.g. JoinableQueue).
+            self._put(item)
+
+            # getter cannot be cancelled, we just removed done getters
+            getter.set_result(self._get())
+
+        elif self._maxsize > 0 and self._maxsize <= self.qsize():
+            waiter = futures.Future(loop=self._loop)
+
+            self._putters.append((item, waiter))
+            yield from waiter
+
+        else:
+            self._put(item)
+
+    def put_nowait(self, item):
+        """Put an item into the queue without blocking.
+
+        If no free slot is immediately available, raise QueueFull.
+        """
+        self._consume_done_getters()
+        if self._getters:
+            assert not self._queue, (
+                'queue non-empty, why are getters waiting?')
+
+            getter = self._getters.popleft()
+
+            # Use _put and _get instead of passing item straight to getter, in
+            # case a subclass has logic that must run (e.g. JoinableQueue).
+            self._put(item)
+
+            # getter cannot be cancelled, we just removed done getters
+            getter.set_result(self._get())
+
+        elif self._maxsize > 0 and self._maxsize <= self.qsize():
+            raise QueueFull
+        else:
+            self._put(item)
+
+    @coroutine
+    def get(self):
+        """Remove and return an item from the queue.
+
+        If queue is empty, wait until an item is available.
+
+        This method is a coroutine.
+        """
+        self._consume_done_putters()
+        if self._putters:
+            assert self.full(), 'queue not full, why are putters waiting?'
+            item, putter = self._putters.popleft()
+            self._put(item)
+
+            # When a getter runs and frees up a slot so this putter can
+            # run, we need to defer the put for a tick to ensure that
+            # getters and putters alternate perfectly. See
+            # ChannelTest.test_wait.
+            self._loop.call_soon(putter._set_result_unless_cancelled, None)
+
+            return self._get()
+
+        elif self.qsize():
+            return self._get()
+        else:
+            waiter = futures.Future(loop=self._loop)
+
+            self._getters.append(waiter)
+            return (yield from waiter)
+
+    def get_nowait(self):
+        """Remove and return an item from the queue.
+
+        Return an item if one is immediately available, else raise QueueEmpty.
+        """
+        self._consume_done_putters()
+        if self._putters:
+            assert self.full(), 'queue not full, why are putters waiting?'
+            item, putter = self._putters.popleft()
+            self._put(item)
+            # Wake putter on next tick.
+
+            # getter cannot be cancelled, we just removed done putters
+            putter.set_result(None)
+
+            return self._get()
+
+        elif self.qsize():
+            return self._get()
+        else:
+            raise QueueEmpty
+
+
+class PriorityQueue(Queue):
+    """A subclass of Queue; retrieves entries in priority order (lowest first).
+
+    Entries are typically tuples of the form: (priority number, data).
+    """
+
+    def _init(self, maxsize):
+        self._queue = []
+
+    def _put(self, item, heappush=heapq.heappush):
+        heappush(self._queue, item)
+
+    def _get(self, heappop=heapq.heappop):
+        return heappop(self._queue)
+
+
+class LifoQueue(Queue):
+    """A subclass of Queue that retrieves most recently added entries first."""
+
+    def _init(self, maxsize):
+        self._queue = []
+
+    def _put(self, item):
+        self._queue.append(item)
+
+    def _get(self):
+        return self._queue.pop()
+
+
+class JoinableQueue(Queue):
+    """A subclass of Queue with task_done() and join() methods."""
+
+    def __init__(self, maxsize=0, *, loop=None):
+        super().__init__(maxsize=maxsize, loop=loop)
+        self._unfinished_tasks = 0
+        self._finished = locks.Event(loop=self._loop)
+        self._finished.set()
+
+    def _format(self):
+        result = Queue._format(self)
+        if self._unfinished_tasks:
+            result += ' tasks={}'.format(self._unfinished_tasks)
+        return result
+
+    def _put(self, item):
+        super()._put(item)
+        self._unfinished_tasks += 1
+        self._finished.clear()
+
+    def task_done(self):
+        """Indicate that a formerly enqueued task is complete.
+
+        Used by queue consumers. For each get() used to fetch a task,
+        a subsequent call to task_done() tells the queue that the processing
+        on the task is complete.
+
+        If a join() is currently blocking, it will resume when all items have
+        been processed (meaning that a task_done() call was received for every
+        item that had been put() into the queue).
+
+        Raises ValueError if called more times than there were items placed in
+        the queue.
+        """
+        if self._unfinished_tasks <= 0:
+            raise ValueError('task_done() called too many times')
+        self._unfinished_tasks -= 1
+        if self._unfinished_tasks == 0:
+            self._finished.set()
+
+    @coroutine
+    def join(self):
+        """Block until all items in the queue have been gotten and processed.
+
+        The count of unfinished tasks goes up whenever an item is added to the
+        queue. The count goes down whenever a consumer thread calls task_done()
+        to indicate that the item was retrieved and all work on it is complete.
+        When the count of unfinished tasks drops to zero, join() unblocks.
+        """
+        if self._unfinished_tasks > 0:
+            yield from self._finished.wait()
diff --git a/Lib/asyncio/selector_events.py b/Lib/asyncio/selector_events.py
new file mode 100644
index 0000000..4bd6dc8
--- /dev/null
+++ b/Lib/asyncio/selector_events.py
@@ -0,0 +1,1069 @@
+"""Event loop using a selector and related classes.
+
+A selector is a "notify-when-ready" multiplexer.  For a subclass which
+also includes support for signal handling, see the unix_events sub-module.
+"""
+
+__all__ = ['BaseSelectorEventLoop']
+
+import collections
+import errno
+import functools
+import socket
+import sys
+import warnings
+try:
+    import ssl
+except ImportError:  # pragma: no cover
+    ssl = None
+
+from . import base_events
+from . import constants
+from . import events
+from . import futures
+from . import selectors
+from . import transports
+from . import sslproto
+from .coroutines import coroutine
+from .log import logger
+
+
+def _test_selector_event(selector, fd, event):
+    # Test if the selector is monitoring 'event' events
+    # for the file descriptor 'fd'.
+    try:
+        key = selector.get_key(fd)
+    except KeyError:
+        return False
+    else:
+        return bool(key.events & event)
+
+
+class BaseSelectorEventLoop(base_events.BaseEventLoop):
+    """Selector event loop.
+
+    See events.EventLoop for API specification.
+    """
+
+    def __init__(self, selector=None):
+        super().__init__()
+
+        if selector is None:
+            selector = selectors.DefaultSelector()
+        logger.debug('Using selector: %s', selector.__class__.__name__)
+        self._selector = selector
+        self._make_self_pipe()
+
+    def _make_socket_transport(self, sock, protocol, waiter=None, *,
+                               extra=None, server=None):
+        return _SelectorSocketTransport(self, sock, protocol, waiter,
+                                        extra, server)
+
+    def _make_ssl_transport(self, rawsock, protocol, sslcontext, waiter=None,
+                            *, server_side=False, server_hostname=None,
+                            extra=None, server=None):
+        if not sslproto._is_sslproto_available():
+            return self._make_legacy_ssl_transport(
+                rawsock, protocol, sslcontext, waiter,
+                server_side=server_side, server_hostname=server_hostname,
+                extra=extra, server=server)
+
+        ssl_protocol = sslproto.SSLProtocol(self, protocol, sslcontext, waiter,
+                                            server_side, server_hostname)
+        _SelectorSocketTransport(self, rawsock, ssl_protocol,
+                                 extra=extra, server=server)
+        return ssl_protocol._app_transport
+
+    def _make_legacy_ssl_transport(self, rawsock, protocol, sslcontext,
+                                   waiter, *,
+                                   server_side=False, server_hostname=None,
+                                   extra=None, server=None):
+        # Use the legacy API: SSL_write, SSL_read, etc. The legacy API is used
+        # on Python 3.4 and older, when ssl.MemoryBIO is not available.
+        return _SelectorSslTransport(
+            self, rawsock, protocol, sslcontext, waiter,
+            server_side, server_hostname, extra, server)
+
+    def _make_datagram_transport(self, sock, protocol,
+                                 address=None, waiter=None, extra=None):
+        return _SelectorDatagramTransport(self, sock, protocol,
+                                          address, waiter, extra)
+
+    def close(self):
+        if self.is_running():
+            raise RuntimeError("Cannot close a running event loop")
+        if self.is_closed():
+            return
+        self._close_self_pipe()
+        super().close()
+        if self._selector is not None:
+            self._selector.close()
+            self._selector = None
+
+    def _socketpair(self):
+        raise NotImplementedError
+
+    def _close_self_pipe(self):
+        self.remove_reader(self._ssock.fileno())
+        self._ssock.close()
+        self._ssock = None
+        self._csock.close()
+        self._csock = None
+        self._internal_fds -= 1
+
+    def _make_self_pipe(self):
+        # A self-socket, really. :-)
+        self._ssock, self._csock = self._socketpair()
+        self._ssock.setblocking(False)
+        self._csock.setblocking(False)
+        self._internal_fds += 1
+        self.add_reader(self._ssock.fileno(), self._read_from_self)
+
+    def _process_self_data(self, data):
+        pass
+
+    def _read_from_self(self):
+        while True:
+            try:
+                data = self._ssock.recv(4096)
+                if not data:
+                    break
+                self._process_self_data(data)
+            except InterruptedError:
+                continue
+            except BlockingIOError:
+                break
+
+    def _write_to_self(self):
+        # This may be called from a different thread, possibly after
+        # _close_self_pipe() has been called or even while it is
+        # running.  Guard for self._csock being None or closed.  When
+        # a socket is closed, send() raises OSError (with errno set to
+        # EBADF, but let's not rely on the exact error code).
+        csock = self._csock
+        if csock is not None:
+            try:
+                csock.send(b'\0')
+            except OSError:
+                if self._debug:
+                    logger.debug("Fail to write a null byte into the "
+                                 "self-pipe socket",
+                                 exc_info=True)
+
+    def _start_serving(self, protocol_factory, sock,
+                       sslcontext=None, server=None):
+        self.add_reader(sock.fileno(), self._accept_connection,
+                        protocol_factory, sock, sslcontext, server)
+
+    def _accept_connection(self, protocol_factory, sock,
+                           sslcontext=None, server=None):
+        try:
+            conn, addr = sock.accept()
+            if self._debug:
+                logger.debug("%r got a new connection from %r: %r",
+                             server, addr, conn)
+            conn.setblocking(False)
+        except (BlockingIOError, InterruptedError, ConnectionAbortedError):
+            pass  # False alarm.
+        except OSError as exc:
+            # There's nowhere to send the error, so just log it.
+            if exc.errno in (errno.EMFILE, errno.ENFILE,
+                             errno.ENOBUFS, errno.ENOMEM):
+                # Some platforms (e.g. Linux keep reporting the FD as
+                # ready, so we remove the read handler temporarily.
+                # We'll try again in a while.
+                self.call_exception_handler({
+                    'message': 'socket.accept() out of system resource',
+                    'exception': exc,
+                    'socket': sock,
+                })
+                self.remove_reader(sock.fileno())
+                self.call_later(constants.ACCEPT_RETRY_DELAY,
+                                self._start_serving,
+                                protocol_factory, sock, sslcontext, server)
+            else:
+                raise  # The event loop will catch, log and ignore it.
+        else:
+            extra = {'peername': addr}
+            accept = self._accept_connection2(protocol_factory, conn, extra,
+                                              sslcontext, server)
+            self.create_task(accept)
+
+    @coroutine
+    def _accept_connection2(self, protocol_factory, conn, extra,
+                            sslcontext=None, server=None):
+        protocol = None
+        transport = None
+        try:
+            protocol = protocol_factory()
+            waiter = futures.Future(loop=self)
+            if sslcontext:
+                transport = self._make_ssl_transport(
+                    conn, protocol, sslcontext, waiter=waiter,
+                    server_side=True, extra=extra, server=server)
+            else:
+                transport = self._make_socket_transport(
+                    conn, protocol, waiter=waiter, extra=extra,
+                    server=server)
+
+            try:
+                yield from waiter
+            except:
+                transport.close()
+                raise
+
+            # It's now up to the protocol to handle the connection.
+        except Exception as exc:
+            if self.get_debug():
+                context = {
+                    'message': ('Error on transport creation '
+                                'for incoming connection'),
+                    'exception': exc,
+                }
+                if protocol is not None:
+                    context['protocol'] = protocol
+                if transport is not None:
+                    context['transport'] = transport
+                self.call_exception_handler(context)
+
+    def add_reader(self, fd, callback, *args):
+        """Add a reader callback."""
+        self._check_closed()
+        handle = events.Handle(callback, args, self)
+        try:
+            key = self._selector.get_key(fd)
+        except KeyError:
+            self._selector.register(fd, selectors.EVENT_READ,
+                                    (handle, None))
+        else:
+            mask, (reader, writer) = key.events, key.data
+            self._selector.modify(fd, mask | selectors.EVENT_READ,
+                                  (handle, writer))
+            if reader is not None:
+                reader.cancel()
+
+    def remove_reader(self, fd):
+        """Remove a reader callback."""
+        if self.is_closed():
+            return False
+        try:
+            key = self._selector.get_key(fd)
+        except KeyError:
+            return False
+        else:
+            mask, (reader, writer) = key.events, key.data
+            mask &= ~selectors.EVENT_READ
+            if not mask:
+                self._selector.unregister(fd)
+            else:
+                self._selector.modify(fd, mask, (None, writer))
+
+            if reader is not None:
+                reader.cancel()
+                return True
+            else:
+                return False
+
+    def add_writer(self, fd, callback, *args):
+        """Add a writer callback.."""
+        self._check_closed()
+        handle = events.Handle(callback, args, self)
+        try:
+            key = self._selector.get_key(fd)
+        except KeyError:
+            self._selector.register(fd, selectors.EVENT_WRITE,
+                                    (None, handle))
+        else:
+            mask, (reader, writer) = key.events, key.data
+            self._selector.modify(fd, mask | selectors.EVENT_WRITE,
+                                  (reader, handle))
+            if writer is not None:
+                writer.cancel()
+
+    def remove_writer(self, fd):
+        """Remove a writer callback."""
+        if self.is_closed():
+            return False
+        try:
+            key = self._selector.get_key(fd)
+        except KeyError:
+            return False
+        else:
+            mask, (reader, writer) = key.events, key.data
+            # Remove both writer and connector.
+            mask &= ~selectors.EVENT_WRITE
+            if not mask:
+                self._selector.unregister(fd)
+            else:
+                self._selector.modify(fd, mask, (reader, None))
+
+            if writer is not None:
+                writer.cancel()
+                return True
+            else:
+                return False
+
+    def sock_recv(self, sock, n):
+        """Receive data from the socket.
+
+        The return value is a bytes object representing the data received.
+        The maximum amount of data to be received at once is specified by
+        nbytes.
+
+        This method is a coroutine.
+        """
+        if self.get_debug() and sock.gettimeout() != 0:
+            raise ValueError("the socket must be non-blocking")
+        fut = futures.Future(loop=self)
+        self._sock_recv(fut, False, sock, n)
+        return fut
+
+    def _sock_recv(self, fut, registered, sock, n):
+        # _sock_recv() can add itself as an I/O callback if the operation can't
+        # be done immediately. Don't use it directly, call sock_recv().
+        fd = sock.fileno()
+        if registered:
+            # Remove the callback early.  It should be rare that the
+            # selector says the fd is ready but the call still returns
+            # EAGAIN, and I am willing to take a hit in that case in
+            # order to simplify the common case.
+            self.remove_reader(fd)
+        if fut.cancelled():
+            return
+        try:
+            data = sock.recv(n)
+        except (BlockingIOError, InterruptedError):
+            self.add_reader(fd, self._sock_recv, fut, True, sock, n)
+        except Exception as exc:
+            fut.set_exception(exc)
+        else:
+            fut.set_result(data)
+
+    def sock_sendall(self, sock, data):
+        """Send data to the socket.
+
+        The socket must be connected to a remote socket. This method continues
+        to send data from data until either all data has been sent or an
+        error occurs. None is returned on success. On error, an exception is
+        raised, and there is no way to determine how much data, if any, was
+        successfully processed by the receiving end of the connection.
+
+        This method is a coroutine.
+        """
+        if self.get_debug() and sock.gettimeout() != 0:
+            raise ValueError("the socket must be non-blocking")
+        fut = futures.Future(loop=self)
+        if data:
+            self._sock_sendall(fut, False, sock, data)
+        else:
+            fut.set_result(None)
+        return fut
+
+    def _sock_sendall(self, fut, registered, sock, data):
+        fd = sock.fileno()
+
+        if registered:
+            self.remove_writer(fd)
+        if fut.cancelled():
+            return
+
+        try:
+            n = sock.send(data)
+        except (BlockingIOError, InterruptedError):
+            n = 0
+        except Exception as exc:
+            fut.set_exception(exc)
+            return
+
+        if n == len(data):
+            fut.set_result(None)
+        else:
+            if n:
+                data = data[n:]
+            self.add_writer(fd, self._sock_sendall, fut, True, sock, data)
+
+    def sock_connect(self, sock, address):
+        """Connect to a remote socket at address.
+
+        The address must be already resolved to avoid the trap of hanging the
+        entire event loop when the address requires doing a DNS lookup. For
+        example, it must be an IP address, not an hostname, for AF_INET and
+        AF_INET6 address families. Use getaddrinfo() to resolve the hostname
+        asynchronously.
+
+        This method is a coroutine.
+        """
+        if self.get_debug() and sock.gettimeout() != 0:
+            raise ValueError("the socket must be non-blocking")
+        fut = futures.Future(loop=self)
+        try:
+            base_events._check_resolved_address(sock, address)
+        except ValueError as err:
+            fut.set_exception(err)
+        else:
+            self._sock_connect(fut, sock, address)
+        return fut
+
+    def _sock_connect(self, fut, sock, address):
+        fd = sock.fileno()
+        try:
+            while True:
+                try:
+                    sock.connect(address)
+                except InterruptedError:
+                    continue
+                else:
+                    break
+        except BlockingIOError:
+            fut.add_done_callback(functools.partial(self._sock_connect_done,
+                                                    fd))
+            self.add_writer(fd, self._sock_connect_cb, fut, sock, address)
+        except Exception as exc:
+            fut.set_exception(exc)
+        else:
+            fut.set_result(None)
+
+    def _sock_connect_done(self, fd, fut):
+        self.remove_writer(fd)
+
+    def _sock_connect_cb(self, fut, sock, address):
+        if fut.cancelled():
+            return
+
+        try:
+            err = sock.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR)
+            if err != 0:
+                # Jump to any except clause below.
+                raise OSError(err, 'Connect call failed %s' % (address,))
+        except (BlockingIOError, InterruptedError):
+            # socket is still registered, the callback will be retried later
+            pass
+        except Exception as exc:
+            fut.set_exception(exc)
+        else:
+            fut.set_result(None)
+
+    def sock_accept(self, sock):
+        """Accept a connection.
+
+        The socket must be bound to an address and listening for connections.
+        The return value is a pair (conn, address) where conn is a new socket
+        object usable to send and receive data on the connection, and address
+        is the address bound to the socket on the other end of the connection.
+
+        This method is a coroutine.
+        """
+        if self.get_debug() and sock.gettimeout() != 0:
+            raise ValueError("the socket must be non-blocking")
+        fut = futures.Future(loop=self)
+        self._sock_accept(fut, False, sock)
+        return fut
+
+    def _sock_accept(self, fut, registered, sock):
+        fd = sock.fileno()
+        if registered:
+            self.remove_reader(fd)
+        if fut.cancelled():
+            return
+        try:
+            conn, address = sock.accept()
+            conn.setblocking(False)
+        except (BlockingIOError, InterruptedError):
+            self.add_reader(fd, self._sock_accept, fut, True, sock)
+        except Exception as exc:
+            fut.set_exception(exc)
+        else:
+            fut.set_result((conn, address))
+
+    def _process_events(self, event_list):
+        for key, mask in event_list:
+            fileobj, (reader, writer) = key.fileobj, key.data
+            if mask & selectors.EVENT_READ and reader is not None:
+                if reader._cancelled:
+                    self.remove_reader(fileobj)
+                else:
+                    self._add_callback(reader)
+            if mask & selectors.EVENT_WRITE and writer is not None:
+                if writer._cancelled:
+                    self.remove_writer(fileobj)
+                else:
+                    self._add_callback(writer)
+
+    def _stop_serving(self, sock):
+        self.remove_reader(sock.fileno())
+        sock.close()
+
+
+class _SelectorTransport(transports._FlowControlMixin,
+                         transports.Transport):
+
+    max_size = 256 * 1024  # Buffer size passed to recv().
+
+    _buffer_factory = bytearray  # Constructs initial value for self._buffer.
+
+    # Attribute used in the destructor: it must be set even if the constructor
+    # is not called (see _SelectorSslTransport which may start by raising an
+    # exception)
+    _sock = None
+
+    def __init__(self, loop, sock, protocol, extra=None, server=None):
+        super().__init__(extra, loop)
+        self._extra['socket'] = sock
+        self._extra['sockname'] = sock.getsockname()
+        if 'peername' not in self._extra:
+            try:
+                self._extra['peername'] = sock.getpeername()
+            except socket.error:
+                self._extra['peername'] = None
+        self._sock = sock
+        self._sock_fd = sock.fileno()
+        self._protocol = protocol
+        self._protocol_connected = True
+        self._server = server
+        self._buffer = self._buffer_factory()
+        self._conn_lost = 0  # Set when call to connection_lost scheduled.
+        self._closing = False  # Set when close() called.
+        if self._server is not None:
+            self._server._attach()
+
+    def __repr__(self):
+        info = [self.__class__.__name__]
+        if self._sock is None:
+            info.append('closed')
+        elif self._closing:
+            info.append('closing')
+        info.append('fd=%s' % self._sock_fd)
+        # test if the transport was closed
+        if self._loop is not None:
+            polling = _test_selector_event(self._loop._selector,
+                                           self._sock_fd, selectors.EVENT_READ)
+            if polling:
+                info.append('read=polling')
+            else:
+                info.append('read=idle')
+
+            polling = _test_selector_event(self._loop._selector,
+                                           self._sock_fd,
+                                           selectors.EVENT_WRITE)
+            if polling:
+                state = 'polling'
+            else:
+                state = 'idle'
+
+            bufsize = self.get_write_buffer_size()
+            info.append('write=<%s, bufsize=%s>' % (state, bufsize))
+        return '<%s>' % ' '.join(info)
+
+    def abort(self):
+        self._force_close(None)
+
+    def close(self):
+        if self._closing:
+            return
+        self._closing = True
+        self._loop.remove_reader(self._sock_fd)
+        if not self._buffer:
+            self._conn_lost += 1
+            self._loop.call_soon(self._call_connection_lost, None)
+
+    # On Python 3.3 and older, objects with a destructor part of a reference
+    # cycle are never destroyed. It's not more the case on Python 3.4 thanks
+    # to the PEP 442.
+    if sys.version_info >= (3, 4):
+        def __del__(self):
+            if self._sock is not None:
+                warnings.warn("unclosed transport %r" % self, ResourceWarning)
+                self._sock.close()
+
+    def _fatal_error(self, exc, message='Fatal error on transport'):
+        # Should be called from exception handler only.
+        if isinstance(exc, (BrokenPipeError,
+                            ConnectionResetError, ConnectionAbortedError)):
+            if self._loop.get_debug():
+                logger.debug("%r: %s", self, message, exc_info=True)
+        else:
+            self._loop.call_exception_handler({
+                'message': message,
+                'exception': exc,
+                'transport': self,
+                'protocol': self._protocol,
+            })
+        self._force_close(exc)
+
+    def _force_close(self, exc):
+        if self._conn_lost:
+            return
+        if self._buffer:
+            self._buffer.clear()
+            self._loop.remove_writer(self._sock_fd)
+        if not self._closing:
+            self._closing = True
+            self._loop.remove_reader(self._sock_fd)
+        self._conn_lost += 1
+        self._loop.call_soon(self._call_connection_lost, exc)
+
+    def _call_connection_lost(self, exc):
+        try:
+            if self._protocol_connected:
+                self._protocol.connection_lost(exc)
+        finally:
+            self._sock.close()
+            self._sock = None
+            self._protocol = None
+            self._loop = None
+            server = self._server
+            if server is not None:
+                server._detach()
+                self._server = None
+
+    def get_write_buffer_size(self):
+        return len(self._buffer)
+
+
+class _SelectorSocketTransport(_SelectorTransport):
+
+    def __init__(self, loop, sock, protocol, waiter=None,
+                 extra=None, server=None):
+        super().__init__(loop, sock, protocol, extra, server)
+        self._eof = False
+        self._paused = False
+
+        self._loop.call_soon(self._protocol.connection_made, self)
+        # only start reading when connection_made() has been called
+        self._loop.call_soon(self._loop.add_reader,
+                             self._sock_fd, self._read_ready)
+        if waiter is not None:
+            # only wake up the waiter when connection_made() has been called
+            self._loop.call_soon(waiter._set_result_unless_cancelled, None)
+
+    def pause_reading(self):
+        if self._closing:
+            raise RuntimeError('Cannot pause_reading() when closing')
+        if self._paused:
+            raise RuntimeError('Already paused')
+        self._paused = True
+        self._loop.remove_reader(self._sock_fd)
+        if self._loop.get_debug():
+            logger.debug("%r pauses reading", self)
+
+    def resume_reading(self):
+        if not self._paused:
+            raise RuntimeError('Not paused')
+        self._paused = False
+        if self._closing:
+            return
+        self._loop.add_reader(self._sock_fd, self._read_ready)
+        if self._loop.get_debug():
+            logger.debug("%r resumes reading", self)
+
+    def _read_ready(self):
+        try:
+            data = self._sock.recv(self.max_size)
+        except (BlockingIOError, InterruptedError):
+            pass
+        except Exception as exc:
+            self._fatal_error(exc, 'Fatal read error on socket transport')
+        else:
+            if data:
+                self._protocol.data_received(data)
+            else:
+                if self._loop.get_debug():
+                    logger.debug("%r received EOF", self)
+                keep_open = self._protocol.eof_received()
+                if keep_open:
+                    # We're keeping the connection open so the
+                    # protocol can write more, but we still can't
+                    # receive more, so remove the reader callback.
+                    self._loop.remove_reader(self._sock_fd)
+                else:
+                    self.close()
+
+    def write(self, data):
+        if not isinstance(data, (bytes, bytearray, memoryview)):
+            raise TypeError('data argument must be byte-ish (%r)',
+                            type(data))
+        if self._eof:
+            raise RuntimeError('Cannot call write() after write_eof()')
+        if not data:
+            return
+
+        if self._conn_lost:
+            if self._conn_lost >= constants.LOG_THRESHOLD_FOR_CONNLOST_WRITES:
+                logger.warning('socket.send() raised exception.')
+            self._conn_lost += 1
+            return
+
+        if not self._buffer:
+            # Optimization: try to send now.
+            try:
+                n = self._sock.send(data)
+            except (BlockingIOError, InterruptedError):
+                pass
+            except Exception as exc:
+                self._fatal_error(exc, 'Fatal write error on socket transport')
+                return
+            else:
+                data = data[n:]
+                if not data:
+                    return
+            # Not all was written; register write handler.
+            self._loop.add_writer(self._sock_fd, self._write_ready)
+
+        # Add it to the buffer.
+        self._buffer.extend(data)
+        self._maybe_pause_protocol()
+
+    def _write_ready(self):
+        assert self._buffer, 'Data should not be empty'
+
+        try:
+            n = self._sock.send(self._buffer)
+        except (BlockingIOError, InterruptedError):
+            pass
+        except Exception as exc:
+            self._loop.remove_writer(self._sock_fd)
+            self._buffer.clear()
+            self._fatal_error(exc, 'Fatal write error on socket transport')
+        else:
+            if n:
+                del self._buffer[:n]
+            self._maybe_resume_protocol()  # May append to buffer.
+            if not self._buffer:
+                self._loop.remove_writer(self._sock_fd)
+                if self._closing:
+                    self._call_connection_lost(None)
+                elif self._eof:
+                    self._sock.shutdown(socket.SHUT_WR)
+
+    def write_eof(self):
+        if self._eof:
+            return
+        self._eof = True
+        if not self._buffer:
+            self._sock.shutdown(socket.SHUT_WR)
+
+    def can_write_eof(self):
+        return True
+
+
+class _SelectorSslTransport(_SelectorTransport):
+
+    _buffer_factory = bytearray
+
+    def __init__(self, loop, rawsock, protocol, sslcontext, waiter=None,
+                 server_side=False, server_hostname=None,
+                 extra=None, server=None):
+        if ssl is None:
+            raise RuntimeError('stdlib ssl module not available')
+
+        if not sslcontext:
+            sslcontext = sslproto._create_transport_context(server_side, server_hostname)
+
+        wrap_kwargs = {
+            'server_side': server_side,
+            'do_handshake_on_connect': False,
+        }
+        if server_hostname and not server_side:
+            wrap_kwargs['server_hostname'] = server_hostname
+        sslsock = sslcontext.wrap_socket(rawsock, **wrap_kwargs)
+
+        super().__init__(loop, sslsock, protocol, extra, server)
+        # the protocol connection is only made after the SSL handshake
+        self._protocol_connected = False
+
+        self._server_hostname = server_hostname
+        self._waiter = waiter
+        self._sslcontext = sslcontext
+        self._paused = False
+
+        # SSL-specific extra info.  (peercert is set later)
+        self._extra.update(sslcontext=sslcontext)
+
+        if self._loop.get_debug():
+            logger.debug("%r starts SSL handshake", self)
+            start_time = self._loop.time()
+        else:
+            start_time = None
+        self._on_handshake(start_time)
+
+    def _wakeup_waiter(self, exc=None):
+        if self._waiter is None:
+            return
+        if not self._waiter.cancelled():
+            if exc is not None:
+                self._waiter.set_exception(exc)
+            else:
+                self._waiter.set_result(None)
+        self._waiter = None
+
+    def _on_handshake(self, start_time):
+        try:
+            self._sock.do_handshake()
+        except ssl.SSLWantReadError:
+            self._loop.add_reader(self._sock_fd,
+                                  self._on_handshake, start_time)
+            return
+        except ssl.SSLWantWriteError:
+            self._loop.add_writer(self._sock_fd,
+                                  self._on_handshake, start_time)
+            return
+        except BaseException as exc:
+            if self._loop.get_debug():
+                logger.warning("%r: SSL handshake failed",
+                               self, exc_info=True)
+            self._loop.remove_reader(self._sock_fd)
+            self._loop.remove_writer(self._sock_fd)
+            self._sock.close()
+            self._wakeup_waiter(exc)
+            if isinstance(exc, Exception):
+                return
+            else:
+                raise
+
+        self._loop.remove_reader(self._sock_fd)
+        self._loop.remove_writer(self._sock_fd)
+
+        peercert = self._sock.getpeercert()
+        if not hasattr(self._sslcontext, 'check_hostname'):
+            # Verify hostname if requested, Python 3.4+ uses check_hostname
+            # and checks the hostname in do_handshake()
+            if (self._server_hostname and
+                self._sslcontext.verify_mode != ssl.CERT_NONE):
+                try:
+                    ssl.match_hostname(peercert, self._server_hostname)
+                except Exception as exc:
+                    if self._loop.get_debug():
+                        logger.warning("%r: SSL handshake failed "
+                                       "on matching the hostname",
+                                       self, exc_info=True)
+                    self._sock.close()
+                    self._wakeup_waiter(exc)
+                    return
+
+        # Add extra info that becomes available after handshake.
+        self._extra.update(peercert=peercert,
+                           cipher=self._sock.cipher(),
+                           compression=self._sock.compression(),
+                           )
+
+        self._read_wants_write = False
+        self._write_wants_read = False
+        self._loop.add_reader(self._sock_fd, self._read_ready)
+        self._protocol_connected = True
+        self._loop.call_soon(self._protocol.connection_made, self)
+        # only wake up the waiter when connection_made() has been called
+        self._loop.call_soon(self._wakeup_waiter)
+
+        if self._loop.get_debug():
+            dt = self._loop.time() - start_time
+            logger.debug("%r: SSL handshake took %.1f ms", self, dt * 1e3)
+
+    def pause_reading(self):
+        # XXX This is a bit icky, given the comment at the top of
+        # _read_ready().  Is it possible to evoke a deadlock?  I don't
+        # know, although it doesn't look like it; write() will still
+        # accept more data for the buffer and eventually the app will
+        # call resume_reading() again, and things will flow again.
+
+        if self._closing:
+            raise RuntimeError('Cannot pause_reading() when closing')
+        if self._paused:
+            raise RuntimeError('Already paused')
+        self._paused = True
+        self._loop.remove_reader(self._sock_fd)
+        if self._loop.get_debug():
+            logger.debug("%r pauses reading", self)
+
+    def resume_reading(self):
+        if not self._paused:
+            raise RuntimeError('Not paused')
+        self._paused = False
+        if self._closing:
+            return
+        self._loop.add_reader(self._sock_fd, self._read_ready)
+        if self._loop.get_debug():
+            logger.debug("%r resumes reading", self)
+
+    def _read_ready(self):
+        if self._write_wants_read:
+            self._write_wants_read = False
+            self._write_ready()
+
+            if self._buffer:
+                self._loop.add_writer(self._sock_fd, self._write_ready)
+
+        try:
+            data = self._sock.recv(self.max_size)
+        except (BlockingIOError, InterruptedError, ssl.SSLWantReadError):
+            pass
+        except ssl.SSLWantWriteError:
+            self._read_wants_write = True
+            self._loop.remove_reader(self._sock_fd)
+            self._loop.add_writer(self._sock_fd, self._write_ready)
+        except Exception as exc:
+            self._fatal_error(exc, 'Fatal read error on SSL transport')
+        else:
+            if data:
+                self._protocol.data_received(data)
+            else:
+                try:
+                    if self._loop.get_debug():
+                        logger.debug("%r received EOF", self)
+                    keep_open = self._protocol.eof_received()
+                    if keep_open:
+                        logger.warning('returning true from eof_received() '
+                                       'has no effect when using ssl')
+                finally:
+                    self.close()
+
+    def _write_ready(self):
+        if self._read_wants_write:
+            self._read_wants_write = False
+            self._read_ready()
+
+            if not (self._paused or self._closing):
+                self._loop.add_reader(self._sock_fd, self._read_ready)
+
+        if self._buffer:
+            try:
+                n = self._sock.send(self._buffer)
+            except (BlockingIOError, InterruptedError, ssl.SSLWantWriteError):
+                n = 0
+            except ssl.SSLWantReadError:
+                n = 0
+                self._loop.remove_writer(self._sock_fd)
+                self._write_wants_read = True
+            except Exception as exc:
+                self._loop.remove_writer(self._sock_fd)
+                self._buffer.clear()
+                self._fatal_error(exc, 'Fatal write error on SSL transport')
+                return
+
+            if n:
+                del self._buffer[:n]
+
+        self._maybe_resume_protocol()  # May append to buffer.
+
+        if not self._buffer:
+            self._loop.remove_writer(self._sock_fd)
+            if self._closing:
+                self._call_connection_lost(None)
+
+    def write(self, data):
+        if not isinstance(data, (bytes, bytearray, memoryview)):
+            raise TypeError('data argument must be byte-ish (%r)',
+                            type(data))
+        if not data:
+            return
+
+        if self._conn_lost:
+            if self._conn_lost >= constants.LOG_THRESHOLD_FOR_CONNLOST_WRITES:
+                logger.warning('socket.send() raised exception.')
+            self._conn_lost += 1
+            return
+
+        if not self._buffer:
+            self._loop.add_writer(self._sock_fd, self._write_ready)
+
+        # Add it to the buffer.
+        self._buffer.extend(data)
+        self._maybe_pause_protocol()
+
+    def can_write_eof(self):
+        return False
+
+
+class _SelectorDatagramTransport(_SelectorTransport):
+
+    _buffer_factory = collections.deque
+
+    def __init__(self, loop, sock, protocol, address=None,
+                 waiter=None, extra=None):
+        super().__init__(loop, sock, protocol, extra)
+        self._address = address
+        self._loop.call_soon(self._protocol.connection_made, self)
+        # only start reading when connection_made() has been called
+        self._loop.call_soon(self._loop.add_reader,
+                             self._sock_fd, self._read_ready)
+        if waiter is not None:
+            # only wake up the waiter when connection_made() has been called
+            self._loop.call_soon(waiter._set_result_unless_cancelled, None)
+
+    def get_write_buffer_size(self):
+        return sum(len(data) for data, _ in self._buffer)
+
+    def _read_ready(self):
+        try:
+            data, addr = self._sock.recvfrom(self.max_size)
+        except (BlockingIOError, InterruptedError):
+            pass
+        except OSError as exc:
+            self._protocol.error_received(exc)
+        except Exception as exc:
+            self._fatal_error(exc, 'Fatal read error on datagram transport')
+        else:
+            self._protocol.datagram_received(data, addr)
+
+    def sendto(self, data, addr=None):
+        if not isinstance(data, (bytes, bytearray, memoryview)):
+            raise TypeError('data argument must be byte-ish (%r)',
+                            type(data))
+        if not data:
+            return
+
+        if self._address and addr not in (None, self._address):
+            raise ValueError('Invalid address: must be None or %s' %
+                             (self._address,))
+
+        if self._conn_lost and self._address:
+            if self._conn_lost >= constants.LOG_THRESHOLD_FOR_CONNLOST_WRITES:
+                logger.warning('socket.send() raised exception.')
+            self._conn_lost += 1
+            return
+
+        if not self._buffer:
+            # Attempt to send it right away first.
+            try:
+                if self._address:
+                    self._sock.send(data)
+                else:
+                    self._sock.sendto(data, addr)
+                return
+            except (BlockingIOError, InterruptedError):
+                self._loop.add_writer(self._sock_fd, self._sendto_ready)
+            except OSError as exc:
+                self._protocol.error_received(exc)
+                return
+            except Exception as exc:
+                self._fatal_error(exc,
+                                  'Fatal write error on datagram transport')
+                return
+
+        # Ensure that what we buffer is immutable.
+        self._buffer.append((bytes(data), addr))
+        self._maybe_pause_protocol()
+
+    def _sendto_ready(self):
+        while self._buffer:
+            data, addr = self._buffer.popleft()
+            try:
+                if self._address:
+                    self._sock.send(data)
+                else:
+                    self._sock.sendto(data, addr)
+            except (BlockingIOError, InterruptedError):
+                self._buffer.appendleft((data, addr))  # Try again later.
+                break
+            except OSError as exc:
+                self._protocol.error_received(exc)
+                return
+            except Exception as exc:
+                self._fatal_error(exc,
+                                  'Fatal write error on datagram transport')
+                return
+
+        self._maybe_resume_protocol()  # May append to buffer.
+        if not self._buffer:
+            self._loop.remove_writer(self._sock_fd)
+            if self._closing:
+                self._call_connection_lost(None)
diff --git a/Lib/asyncio/sslproto.py b/Lib/asyncio/sslproto.py
new file mode 100644
index 0000000..235855e
--- /dev/null
+++ b/Lib/asyncio/sslproto.py
@@ -0,0 +1,668 @@
+import collections
+import sys
+import warnings
+try:
+    import ssl
+except ImportError:  # pragma: no cover
+    ssl = None
+
+from . import protocols
+from . import transports
+from .log import logger
+
+
+def _create_transport_context(server_side, server_hostname):
+    if server_side:
+        raise ValueError('Server side SSL needs a valid SSLContext')
+
+    # Client side may pass ssl=True to use a default
+    # context; in that case the sslcontext passed is None.
+    # The default is secure for client connections.
+    if hasattr(ssl, 'create_default_context'):
+        # Python 3.4+: use up-to-date strong settings.
+        sslcontext = ssl.create_default_context()
+        if not server_hostname:
+            sslcontext.check_hostname = False
+    else:
+        # Fallback for Python 3.3.
+        sslcontext = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+        sslcontext.options |= ssl.OP_NO_SSLv2
+        sslcontext.options |= ssl.OP_NO_SSLv3
+        sslcontext.set_default_verify_paths()
+        sslcontext.verify_mode = ssl.CERT_REQUIRED
+    return sslcontext
+
+
+def _is_sslproto_available():
+    return hasattr(ssl, "MemoryBIO")
+
+
+# States of an _SSLPipe.
+_UNWRAPPED = "UNWRAPPED"
+_DO_HANDSHAKE = "DO_HANDSHAKE"
+_WRAPPED = "WRAPPED"
+_SHUTDOWN = "SHUTDOWN"
+
+
+class _SSLPipe(object):
+    """An SSL "Pipe".
+
+    An SSL pipe allows you to communicate with an SSL/TLS protocol instance
+    through memory buffers. It can be used to implement a security layer for an
+    existing connection where you don't have access to the connection's file
+    descriptor, or for some reason you don't want to use it.
+
+    An SSL pipe can be in "wrapped" and "unwrapped" mode. In unwrapped mode,
+    data is passed through untransformed. In wrapped mode, application level
+    data is encrypted to SSL record level data and vice versa. The SSL record
+    level is the lowest level in the SSL protocol suite and is what travels
+    as-is over the wire.
+
+    An SslPipe initially is in "unwrapped" mode. To start SSL, call
+    do_handshake(). To shutdown SSL again, call unwrap().
+    """
+
+    max_size = 256 * 1024   # Buffer size passed to read()
+
+    def __init__(self, context, server_side, server_hostname=None):
+        """
+        The *context* argument specifies the ssl.SSLContext to use.
+
+        The *server_side* argument indicates whether this is a server side or
+        client side transport.
+
+        The optional *server_hostname* argument can be used to specify the
+        hostname you are connecting to. You may only specify this parameter if
+        the _ssl module supports Server Name Indication (SNI).
+        """
+        self._context = context
+        self._server_side = server_side
+        self._server_hostname = server_hostname
+        self._state = _UNWRAPPED
+        self._incoming = ssl.MemoryBIO()
+        self._outgoing = ssl.MemoryBIO()
+        self._sslobj = None
+        self._need_ssldata = False
+        self._handshake_cb = None
+        self._shutdown_cb = None
+
+    @property
+    def context(self):
+        """The SSL context passed to the constructor."""
+        return self._context
+
+    @property
+    def ssl_object(self):
+        """The internal ssl.SSLObject instance.
+
+        Return None if the pipe is not wrapped.
+        """
+        return self._sslobj
+
+    @property
+    def need_ssldata(self):
+        """Whether more record level data is needed to complete a handshake
+        that is currently in progress."""
+        return self._need_ssldata
+
+    @property
+    def wrapped(self):
+        """
+        Whether a security layer is currently in effect.
+
+        Return False during handshake.
+        """
+        return self._state == _WRAPPED
+
+    def do_handshake(self, callback=None):
+        """Start the SSL handshake.
+
+        Return a list of ssldata. A ssldata element is a list of buffers
+
+        The optional *callback* argument can be used to install a callback that
+        will be called when the handshake is complete. The callback will be
+        called with None if successful, else an exception instance.
+        """
+        if self._state != _UNWRAPPED:
+            raise RuntimeError('handshake in progress or completed')
+        self._sslobj = self._context.wrap_bio(
+            self._incoming, self._outgoing,
+            server_side=self._server_side,
+            server_hostname=self._server_hostname)
+        self._state = _DO_HANDSHAKE
+        self._handshake_cb = callback
+        ssldata, appdata = self.feed_ssldata(b'', only_handshake=True)
+        assert len(appdata) == 0
+        return ssldata
+
+    def shutdown(self, callback=None):
+        """Start the SSL shutdown sequence.
+
+        Return a list of ssldata. A ssldata element is a list of buffers
+
+        The optional *callback* argument can be used to install a callback that
+        will be called when the shutdown is complete. The callback will be
+        called without arguments.
+        """
+        if self._state == _UNWRAPPED:
+            raise RuntimeError('no security layer present')
+        if self._state == _SHUTDOWN:
+            raise RuntimeError('shutdown in progress')
+        assert self._state in (_WRAPPED, _DO_HANDSHAKE)
+        self._state = _SHUTDOWN
+        self._shutdown_cb = callback
+        ssldata, appdata = self.feed_ssldata(b'')
+        assert appdata == [] or appdata == [b'']
+        return ssldata
+
+    def feed_eof(self):
+        """Send a potentially "ragged" EOF.
+
+        This method will raise an SSL_ERROR_EOF exception if the EOF is
+        unexpected.
+        """
+        self._incoming.write_eof()
+        ssldata, appdata = self.feed_ssldata(b'')
+        assert appdata == [] or appdata == [b'']
+
+    def feed_ssldata(self, data, only_handshake=False):
+        """Feed SSL record level data into the pipe.
+
+        The data must be a bytes instance. It is OK to send an empty bytes
+        instance. This can be used to get ssldata for a handshake initiated by
+        this endpoint.
+
+        Return a (ssldata, appdata) tuple. The ssldata element is a list of
+        buffers containing SSL data that needs to be sent to the remote SSL.
+
+        The appdata element is a list of buffers containing plaintext data that
+        needs to be forwarded to the application. The appdata list may contain
+        an empty buffer indicating an SSL "close_notify" alert. This alert must
+        be acknowledged by calling shutdown().
+        """
+        if self._state == _UNWRAPPED:
+            # If unwrapped, pass plaintext data straight through.
+            if data:
+                appdata = [data]
+            else:
+                appdata = []
+            return ([], appdata)
+
+        self._need_ssldata = False
+        if data:
+            self._incoming.write(data)
+
+        ssldata = []
+        appdata = []
+        try:
+            if self._state == _DO_HANDSHAKE:
+                # Call do_handshake() until it doesn't raise anymore.
+                self._sslobj.do_handshake()
+                self._state = _WRAPPED
+                if self._handshake_cb:
+                    self._handshake_cb(None)
+                if only_handshake:
+                    return (ssldata, appdata)
+                # Handshake done: execute the wrapped block
+
+            if self._state == _WRAPPED:
+                # Main state: read data from SSL until close_notify
+                while True:
+                    chunk = self._sslobj.read(self.max_size)
+                    appdata.append(chunk)
+                    if not chunk:  # close_notify
+                        break
+
+            elif self._state == _SHUTDOWN:
+                # Call shutdown() until it doesn't raise anymore.
+                self._sslobj.unwrap()
+                self._sslobj = None
+                self._state = _UNWRAPPED
+                if self._shutdown_cb:
+                    self._shutdown_cb()
+
+            elif self._state == _UNWRAPPED:
+                # Drain possible plaintext data after close_notify.
+                appdata.append(self._incoming.read())
+        except (ssl.SSLError, ssl.CertificateError) as exc:
+            if getattr(exc, 'errno', None) not in (
+                    ssl.SSL_ERROR_WANT_READ, ssl.SSL_ERROR_WANT_WRITE,
+                    ssl.SSL_ERROR_SYSCALL):
+                if self._state == _DO_HANDSHAKE and self._handshake_cb:
+                    self._handshake_cb(exc)
+                raise
+            self._need_ssldata = (exc.errno == ssl.SSL_ERROR_WANT_READ)
+
+        # Check for record level data that needs to be sent back.
+        # Happens for the initial handshake and renegotiations.
+        if self._outgoing.pending:
+            ssldata.append(self._outgoing.read())
+        return (ssldata, appdata)
+
+    def feed_appdata(self, data, offset=0):
+        """Feed plaintext data into the pipe.
+
+        Return an (ssldata, offset) tuple. The ssldata element is a list of
+        buffers containing record level data that needs to be sent to the
+        remote SSL instance. The offset is the number of plaintext bytes that
+        were processed, which may be less than the length of data.
+
+        NOTE: In case of short writes, this call MUST be retried with the SAME
+        buffer passed into the *data* argument (i.e. the id() must be the
+        same). This is an OpenSSL requirement. A further particularity is that
+        a short write will always have offset == 0, because the _ssl module
+        does not enable partial writes. And even though the offset is zero,
+        there will still be encrypted data in ssldata.
+        """
+        assert 0 <= offset <= len(data)
+        if self._state == _UNWRAPPED:
+            # pass through data in unwrapped mode
+            if offset < len(data):
+                ssldata = [data[offset:]]
+            else:
+                ssldata = []
+            return (ssldata, len(data))
+
+        ssldata = []
+        view = memoryview(data)
+        while True:
+            self._need_ssldata = False
+            try:
+                if offset < len(view):
+                    offset += self._sslobj.write(view[offset:])
+            except ssl.SSLError as exc:
+                # It is not allowed to call write() after unwrap() until the
+                # close_notify is acknowledged. We return the condition to the
+                # caller as a short write.
+                if exc.reason == 'PROTOCOL_IS_SHUTDOWN':
+                    exc.errno = ssl.SSL_ERROR_WANT_READ
+                if exc.errno not in (ssl.SSL_ERROR_WANT_READ,
+                                     ssl.SSL_ERROR_WANT_WRITE,
+                                     ssl.SSL_ERROR_SYSCALL):
+                    raise
+                self._need_ssldata = (exc.errno == ssl.SSL_ERROR_WANT_READ)
+
+            # See if there's any record level data back for us.
+            if self._outgoing.pending:
+                ssldata.append(self._outgoing.read())
+            if offset == len(view) or self._need_ssldata:
+                break
+        return (ssldata, offset)
+
+
+class _SSLProtocolTransport(transports._FlowControlMixin,
+                            transports.Transport):
+
+    def __init__(self, loop, ssl_protocol, app_protocol):
+        self._loop = loop
+        self._ssl_protocol = ssl_protocol
+        self._app_protocol = app_protocol
+        self._closed = False
+
+    def get_extra_info(self, name, default=None):
+        """Get optional transport information."""
+        return self._ssl_protocol._get_extra_info(name, default)
+
+    def close(self):
+        """Close the transport.
+
+        Buffered data will be flushed asynchronously.  No more data
+        will be received.  After all buffered data is flushed, the
+        protocol's connection_lost() method will (eventually) called
+        with None as its argument.
+        """
+        self._closed = True
+        self._ssl_protocol._start_shutdown()
+
+    # On Python 3.3 and older, objects with a destructor part of a reference
+    # cycle are never destroyed. It's not more the case on Python 3.4 thanks
+    # to the PEP 442.
+    if sys.version_info >= (3, 4):
+        def __del__(self):
+            if not self._closed:
+                warnings.warn("unclosed transport %r" % self, ResourceWarning)
+                self.close()
+
+    def pause_reading(self):
+        """Pause the receiving end.
+
+        No data will be passed to the protocol's data_received()
+        method until resume_reading() is called.
+        """
+        self._ssl_protocol._transport.pause_reading()
+
+    def resume_reading(self):
+        """Resume the receiving end.
+
+        Data received will once again be passed to the protocol's
+        data_received() method.
+        """
+        self._ssl_protocol._transport.resume_reading()
+
+    def set_write_buffer_limits(self, high=None, low=None):
+        """Set the high- and low-water limits for write flow control.
+
+        These two values control when to call the protocol's
+        pause_writing() and resume_writing() methods.  If specified,
+        the low-water limit must be less than or equal to the
+        high-water limit.  Neither value can be negative.
+
+        The defaults are implementation-specific.  If only the
+        high-water limit is given, the low-water limit defaults to a
+        implementation-specific value less than or equal to the
+        high-water limit.  Setting high to zero forces low to zero as
+        well, and causes pause_writing() to be called whenever the
+        buffer becomes non-empty.  Setting low to zero causes
+        resume_writing() to be called only once the buffer is empty.
+        Use of zero for either limit is generally sub-optimal as it
+        reduces opportunities for doing I/O and computation
+        concurrently.
+        """
+        self._ssl_protocol._transport.set_write_buffer_limits(high, low)
+
+    def get_write_buffer_size(self):
+        """Return the current size of the write buffer."""
+        return self._ssl_protocol._transport.get_write_buffer_size()
+
+    def write(self, data):
+        """Write some data bytes to the transport.
+
+        This does not block; it buffers the data and arranges for it
+        to be sent out asynchronously.
+        """
+        if not isinstance(data, (bytes, bytearray, memoryview)):
+            raise TypeError("data: expecting a bytes-like instance, got {!r}"
+                                .format(type(data).__name__))
+        if not data:
+            return
+        self._ssl_protocol._write_appdata(data)
+
+    def can_write_eof(self):
+        """Return True if this transport supports write_eof(), False if not."""
+        return False
+
+    def abort(self):
+        """Close the transport immediately.
+
+        Buffered data will be lost.  No more data will be received.
+        The protocol's connection_lost() method will (eventually) be
+        called with None as its argument.
+        """
+        self._ssl_protocol._abort()
+
+
+class SSLProtocol(protocols.Protocol):
+    """SSL protocol.
+
+    Implementation of SSL on top of a socket using incoming and outgoing
+    buffers which are ssl.MemoryBIO objects.
+    """
+
+    def __init__(self, loop, app_protocol, sslcontext, waiter,
+                 server_side=False, server_hostname=None):
+        if ssl is None:
+            raise RuntimeError('stdlib ssl module not available')
+
+        if not sslcontext:
+            sslcontext = _create_transport_context(server_side, server_hostname)
+
+        self._server_side = server_side
+        if server_hostname and not server_side:
+            self._server_hostname = server_hostname
+        else:
+            self._server_hostname = None
+        self._sslcontext = sslcontext
+        # SSL-specific extra info. More info are set when the handshake
+        # completes.
+        self._extra = dict(sslcontext=sslcontext)
+
+        # App data write buffering
+        self._write_backlog = collections.deque()
+        self._write_buffer_size = 0
+
+        self._waiter = waiter
+        self._loop = loop
+        self._app_protocol = app_protocol
+        self._app_transport = _SSLProtocolTransport(self._loop,
+                                                    self, self._app_protocol)
+        self._sslpipe = None
+        self._session_established = False
+        self._in_handshake = False
+        self._in_shutdown = False
+        self._transport = None
+
+    def _wakeup_waiter(self, exc=None):
+        if self._waiter is None:
+            return
+        if not self._waiter.cancelled():
+            if exc is not None:
+                self._waiter.set_exception(exc)
+            else:
+                self._waiter.set_result(None)
+        self._waiter = None
+
+    def connection_made(self, transport):
+        """Called when the low-level connection is made.
+
+        Start the SSL handshake.
+        """
+        self._transport = transport
+        self._sslpipe = _SSLPipe(self._sslcontext,
+                                 self._server_side,
+                                 self._server_hostname)
+        self._start_handshake()
+
+    def connection_lost(self, exc):
+        """Called when the low-level connection is lost or closed.
+
+        The argument is an exception object or None (the latter
+        meaning a regular EOF is received or the connection was
+        aborted or closed).
+        """
+        if self._session_established:
+            self._session_established = False
+            self._loop.call_soon(self._app_protocol.connection_lost, exc)
+        self._transport = None
+        self._app_transport = None
+
+    def pause_writing(self):
+        """Called when the low-level transport's buffer goes over
+        the high-water mark.
+        """
+        self._app_protocol.pause_writing()
+
+    def resume_writing(self):
+        """Called when the low-level transport's buffer drains below
+        the low-water mark.
+        """
+        self._app_protocol.resume_writing()
+
+    def data_received(self, data):
+        """Called when some SSL data is received.
+
+        The argument is a bytes object.
+        """
+        try:
+            ssldata, appdata = self._sslpipe.feed_ssldata(data)
+        except ssl.SSLError as e:
+            if self._loop.get_debug():
+                logger.warning('%r: SSL error %s (reason %s)',
+                               self, e.errno, e.reason)
+            self._abort()
+            return
+
+        for chunk in ssldata:
+            self._transport.write(chunk)
+
+        for chunk in appdata:
+            if chunk:
+                self._app_protocol.data_received(chunk)
+            else:
+                self._start_shutdown()
+                break
+
+    def eof_received(self):
+        """Called when the other end of the low-level stream
+        is half-closed.
+
+        If this returns a false value (including None), the transport
+        will close itself.  If it returns a true value, closing the
+        transport is up to the protocol.
+        """
+        try:
+            if self._loop.get_debug():
+                logger.debug("%r received EOF", self)
+
+            self._wakeup_waiter(ConnectionResetError)
+
+            if not self._in_handshake:
+                keep_open = self._app_protocol.eof_received()
+                if keep_open:
+                    logger.warning('returning true from eof_received() '
+                                   'has no effect when using ssl')
+        finally:
+            self._transport.close()
+
+    def _get_extra_info(self, name, default=None):
+        if name in self._extra:
+            return self._extra[name]
+        else:
+            return self._transport.get_extra_info(name, default)
+
+    def _start_shutdown(self):
+        if self._in_shutdown:
+            return
+        self._in_shutdown = True
+        self._write_appdata(b'')
+
+    def _write_appdata(self, data):
+        self._write_backlog.append((data, 0))
+        self._write_buffer_size += len(data)
+        self._process_write_backlog()
+
+    def _start_handshake(self):
+        if self._loop.get_debug():
+            logger.debug("%r starts SSL handshake", self)
+            self._handshake_start_time = self._loop.time()
+        else:
+            self._handshake_start_time = None
+        self._in_handshake = True
+        # (b'', 1) is a special value in _process_write_backlog() to do
+        # the SSL handshake
+        self._write_backlog.append((b'', 1))
+        self._loop.call_soon(self._process_write_backlog)
+
+    def _on_handshake_complete(self, handshake_exc):
+        self._in_handshake = False
+
+        sslobj = self._sslpipe.ssl_object
+        try:
+            if handshake_exc is not None:
+                raise handshake_exc
+
+            peercert = sslobj.getpeercert()
+            if not hasattr(self._sslcontext, 'check_hostname'):
+                # Verify hostname if requested, Python 3.4+ uses check_hostname
+                # and checks the hostname in do_handshake()
+                if (self._server_hostname
+                and self._sslcontext.verify_mode != ssl.CERT_NONE):
+                    ssl.match_hostname(peercert, self._server_hostname)
+        except BaseException as exc:
+            if self._loop.get_debug():
+                if isinstance(exc, ssl.CertificateError):
+                    logger.warning("%r: SSL handshake failed "
+                                   "on verifying the certificate",
+                                   self, exc_info=True)
+                else:
+                    logger.warning("%r: SSL handshake failed",
+                                   self, exc_info=True)
+            self._transport.close()
+            if isinstance(exc, Exception):
+                self._wakeup_waiter(exc)
+                return
+            else:
+                raise
+
+        if self._loop.get_debug():
+            dt = self._loop.time() - self._handshake_start_time
+            logger.debug("%r: SSL handshake took %.1f ms", self, dt * 1e3)
+
+        # Add extra info that becomes available after handshake.
+        self._extra.update(peercert=peercert,
+                           cipher=sslobj.cipher(),
+                           compression=sslobj.compression(),
+                           )
+        self._app_protocol.connection_made(self._app_transport)
+        self._wakeup_waiter()
+        self._session_established = True
+        # In case transport.write() was already called. Don't call
+        # immediatly _process_write_backlog(), but schedule it:
+        # _on_handshake_complete() can be called indirectly from
+        # _process_write_backlog(), and _process_write_backlog() is not
+        # reentrant.
+        self._loop.call_soon(self._process_write_backlog)
+
+    def _process_write_backlog(self):
+        # Try to make progress on the write backlog.
+        if self._transport is None:
+            return
+
+        try:
+            for i in range(len(self._write_backlog)):
+                data, offset = self._write_backlog[0]
+                if data:
+                    ssldata, offset = self._sslpipe.feed_appdata(data, offset)
+                elif offset:
+                    ssldata = self._sslpipe.do_handshake(self._on_handshake_complete)
+                    offset = 1
+                else:
+                    ssldata = self._sslpipe.shutdown(self._finalize)
+                    offset = 1
+
+                for chunk in ssldata:
+                    self._transport.write(chunk)
+
+                if offset < len(data):
+                    self._write_backlog[0] = (data, offset)
+                    # A short write means that a write is blocked on a read
+                    # We need to enable reading if it is paused!
+                    assert self._sslpipe.need_ssldata
+                    if self._transport._paused:
+                        self._transport.resume_reading()
+                    break
+
+                # An entire chunk from the backlog was processed. We can
+                # delete it and reduce the outstanding buffer size.
+                del self._write_backlog[0]
+                self._write_buffer_size -= len(data)
+        except BaseException as exc:
+            if self._in_handshake:
+                self._on_handshake_complete(exc)
+            else:
+                self._fatal_error(exc, 'Fatal error on SSL transport')
+
+    def _fatal_error(self, exc, message='Fatal error on transport'):
+        # Should be called from exception handler only.
+        if isinstance(exc, (BrokenPipeError, ConnectionResetError)):
+            if self._loop.get_debug():
+                logger.debug("%r: %s", self, message, exc_info=True)
+        else:
+            self._loop.call_exception_handler({
+                'message': message,
+                'exception': exc,
+                'transport': self._transport,
+                'protocol': self,
+            })
+        if self._transport:
+            self._transport._force_close(exc)
+
+    def _finalize(self):
+        if self._transport is not None:
+            self._transport.close()
+
+    def _abort(self):
+        if self._transport is not None:
+            try:
+                self._transport.abort()
+            finally:
+                self._finalize()
diff --git a/Lib/asyncio/streams.py b/Lib/asyncio/streams.py
new file mode 100644
index 0000000..7ff16a4
--- /dev/null
+++ b/Lib/asyncio/streams.py
@@ -0,0 +1,486 @@
+"""Stream-related things."""
+
+__all__ = ['StreamReader', 'StreamWriter', 'StreamReaderProtocol',
+           'open_connection', 'start_server',
+           'IncompleteReadError',
+           ]
+
+import socket
+
+if hasattr(socket, 'AF_UNIX'):
+    __all__.extend(['open_unix_connection', 'start_unix_server'])
+
+from . import coroutines
+from . import events
+from . import futures
+from . import protocols
+from .coroutines import coroutine
+from .log import logger
+
+
+_DEFAULT_LIMIT = 2**16
+
+
+class IncompleteReadError(EOFError):
+    """
+    Incomplete read error. Attributes:
+
+    - partial: read bytes string before the end of stream was reached
+    - expected: total number of expected bytes
+    """
+    def __init__(self, partial, expected):
+        EOFError.__init__(self, "%s bytes read on a total of %s expected bytes"
+                                % (len(partial), expected))
+        self.partial = partial
+        self.expected = expected
+
+
+@coroutine
+def open_connection(host=None, port=None, *,
+                    loop=None, limit=_DEFAULT_LIMIT, **kwds):
+    """A wrapper for create_connection() returning a (reader, writer) pair.
+
+    The reader returned is a StreamReader instance; the writer is a
+    StreamWriter instance.
+
+    The arguments are all the usual arguments to create_connection()
+    except protocol_factory; most common are positional host and port,
+    with various optional keyword arguments following.
+
+    Additional optional keyword arguments are loop (to set the event loop
+    instance to use) and limit (to set the buffer limit passed to the
+    StreamReader).
+
+    (If you want to customize the StreamReader and/or
+    StreamReaderProtocol classes, just copy the code -- there's
+    really nothing special here except some convenience.)
+    """
+    if loop is None:
+        loop = events.get_event_loop()
+    reader = StreamReader(limit=limit, loop=loop)
+    protocol = StreamReaderProtocol(reader, loop=loop)
+    transport, _ = yield from loop.create_connection(
+        lambda: protocol, host, port, **kwds)
+    writer = StreamWriter(transport, protocol, reader, loop)
+    return reader, writer
+
+
+@coroutine
+def start_server(client_connected_cb, host=None, port=None, *,
+                 loop=None, limit=_DEFAULT_LIMIT, **kwds):
+    """Start a socket server, call back for each client connected.
+
+    The first parameter, `client_connected_cb`, takes two parameters:
+    client_reader, client_writer.  client_reader is a StreamReader
+    object, while client_writer is a StreamWriter object.  This
+    parameter can either be a plain callback function or a coroutine;
+    if it is a coroutine, it will be automatically converted into a
+    Task.
+
+    The rest of the arguments are all the usual arguments to
+    loop.create_server() except protocol_factory; most common are
+    positional host and port, with various optional keyword arguments
+    following.  The return value is the same as loop.create_server().
+
+    Additional optional keyword arguments are loop (to set the event loop
+    instance to use) and limit (to set the buffer limit passed to the
+    StreamReader).
+
+    The return value is the same as loop.create_server(), i.e. a
+    Server object which can be used to stop the service.
+    """
+    if loop is None:
+        loop = events.get_event_loop()
+
+    def factory():
+        reader = StreamReader(limit=limit, loop=loop)
+        protocol = StreamReaderProtocol(reader, client_connected_cb,
+                                        loop=loop)
+        return protocol
+
+    return (yield from loop.create_server(factory, host, port, **kwds))
+
+
+if hasattr(socket, 'AF_UNIX'):
+    # UNIX Domain Sockets are supported on this platform
+
+    @coroutine
+    def open_unix_connection(path=None, *,
+                             loop=None, limit=_DEFAULT_LIMIT, **kwds):
+        """Similar to `open_connection` but works with UNIX Domain Sockets."""
+        if loop is None:
+            loop = events.get_event_loop()
+        reader = StreamReader(limit=limit, loop=loop)
+        protocol = StreamReaderProtocol(reader, loop=loop)
+        transport, _ = yield from loop.create_unix_connection(
+            lambda: protocol, path, **kwds)
+        writer = StreamWriter(transport, protocol, reader, loop)
+        return reader, writer
+
+
+    @coroutine
+    def start_unix_server(client_connected_cb, path=None, *,
+                          loop=None, limit=_DEFAULT_LIMIT, **kwds):
+        """Similar to `start_server` but works with UNIX Domain Sockets."""
+        if loop is None:
+            loop = events.get_event_loop()
+
+        def factory():
+            reader = StreamReader(limit=limit, loop=loop)
+            protocol = StreamReaderProtocol(reader, client_connected_cb,
+                                            loop=loop)
+            return protocol
+
+        return (yield from loop.create_unix_server(factory, path, **kwds))
+
+
+class FlowControlMixin(protocols.Protocol):
+    """Reusable flow control logic for StreamWriter.drain().
+
+    This implements the protocol methods pause_writing(),
+    resume_reading() and connection_lost().  If the subclass overrides
+    these it must call the super methods.
+
+    StreamWriter.drain() must wait for _drain_helper() coroutine.
+    """
+
+    def __init__(self, loop=None):
+        if loop is None:
+            self._loop = events.get_event_loop()
+        else:
+            self._loop = loop
+        self._paused = False
+        self._drain_waiter = None
+        self._connection_lost = False
+
+    def pause_writing(self):
+        assert not self._paused
+        self._paused = True
+        if self._loop.get_debug():
+            logger.debug("%r pauses writing", self)
+
+    def resume_writing(self):
+        assert self._paused
+        self._paused = False
+        if self._loop.get_debug():
+            logger.debug("%r resumes writing", self)
+
+        waiter = self._drain_waiter
+        if waiter is not None:
+            self._drain_waiter = None
+            if not waiter.done():
+                waiter.set_result(None)
+
+    def connection_lost(self, exc):
+        self._connection_lost = True
+        # Wake up the writer if currently paused.
+        if not self._paused:
+            return
+        waiter = self._drain_waiter
+        if waiter is None:
+            return
+        self._drain_waiter = None
+        if waiter.done():
+            return
+        if exc is None:
+            waiter.set_result(None)
+        else:
+            waiter.set_exception(exc)
+
+    @coroutine
+    def _drain_helper(self):
+        if self._connection_lost:
+            raise ConnectionResetError('Connection lost')
+        if not self._paused:
+            return
+        waiter = self._drain_waiter
+        assert waiter is None or waiter.cancelled()
+        waiter = futures.Future(loop=self._loop)
+        self._drain_waiter = waiter
+        yield from waiter
+
+
+class StreamReaderProtocol(FlowControlMixin, protocols.Protocol):
+    """Helper class to adapt between Protocol and StreamReader.
+
+    (This is a helper class instead of making StreamReader itself a
+    Protocol subclass, because the StreamReader has other potential
+    uses, and to prevent the user of the StreamReader to accidentally
+    call inappropriate methods of the protocol.)
+    """
+
+    def __init__(self, stream_reader, client_connected_cb=None, loop=None):
+        super().__init__(loop=loop)
+        self._stream_reader = stream_reader
+        self._stream_writer = None
+        self._client_connected_cb = client_connected_cb
+
+    def connection_made(self, transport):
+        self._stream_reader.set_transport(transport)
+        if self._client_connected_cb is not None:
+            self._stream_writer = StreamWriter(transport, self,
+                                               self._stream_reader,
+                                               self._loop)
+            res = self._client_connected_cb(self._stream_reader,
+                                            self._stream_writer)
+            if coroutines.iscoroutine(res):
+                self._loop.create_task(res)
+
+    def connection_lost(self, exc):
+        if exc is None:
+            self._stream_reader.feed_eof()
+        else:
+            self._stream_reader.set_exception(exc)
+        super().connection_lost(exc)
+
+    def data_received(self, data):
+        self._stream_reader.feed_data(data)
+
+    def eof_received(self):
+        self._stream_reader.feed_eof()
+
+
+class StreamWriter:
+    """Wraps a Transport.
+
+    This exposes write(), writelines(), [can_]write_eof(),
+    get_extra_info() and close().  It adds drain() which returns an
+    optional Future on which you can wait for flow control.  It also
+    adds a transport property which references the Transport
+    directly.
+    """
+
+    def __init__(self, transport, protocol, reader, loop):
+        self._transport = transport
+        self._protocol = protocol
+        # drain() expects that the reader has a exception() method
+        assert reader is None or isinstance(reader, StreamReader)
+        self._reader = reader
+        self._loop = loop
+
+    def __repr__(self):
+        info = [self.__class__.__name__, 'transport=%r' % self._transport]
+        if self._reader is not None:
+            info.append('reader=%r' % self._reader)
+        return '<%s>' % ' '.join(info)
+
+    @property
+    def transport(self):
+        return self._transport
+
+    def write(self, data):
+        self._transport.write(data)
+
+    def writelines(self, data):
+        self._transport.writelines(data)
+
+    def write_eof(self):
+        return self._transport.write_eof()
+
+    def can_write_eof(self):
+        return self._transport.can_write_eof()
+
+    def close(self):
+        return self._transport.close()
+
+    def get_extra_info(self, name, default=None):
+        return self._transport.get_extra_info(name, default)
+
+    @coroutine
+    def drain(self):
+        """Flush the write buffer.
+
+        The intended use is to write
+
+          w.write(data)
+          yield from w.drain()
+        """
+        if self._reader is not None:
+            exc = self._reader.exception()
+            if exc is not None:
+                raise exc
+        yield from self._protocol._drain_helper()
+
+
+class StreamReader:
+
+    def __init__(self, limit=_DEFAULT_LIMIT, loop=None):
+        # The line length limit is  a security feature;
+        # it also doubles as half the buffer limit.
+        self._limit = limit
+        if loop is None:
+            self._loop = events.get_event_loop()
+        else:
+            self._loop = loop
+        self._buffer = bytearray()
+        self._eof = False    # Whether we're done.
+        self._waiter = None  # A future used by _wait_for_data()
+        self._exception = None
+        self._transport = None
+        self._paused = False
+
+    def exception(self):
+        return self._exception
+
+    def set_exception(self, exc):
+        self._exception = exc
+
+        waiter = self._waiter
+        if waiter is not None:
+            self._waiter = None
+            if not waiter.cancelled():
+                waiter.set_exception(exc)
+
+    def _wakeup_waiter(self):
+        """Wakeup read() or readline() function waiting for data or EOF."""
+        waiter = self._waiter
+        if waiter is not None:
+            self._waiter = None
+            if not waiter.cancelled():
+                waiter.set_result(None)
+
+    def set_transport(self, transport):
+        assert self._transport is None, 'Transport already set'
+        self._transport = transport
+
+    def _maybe_resume_transport(self):
+        if self._paused and len(self._buffer) <= self._limit:
+            self._paused = False
+            self._transport.resume_reading()
+
+    def feed_eof(self):
+        self._eof = True
+        self._wakeup_waiter()
+
+    def at_eof(self):
+        """Return True if the buffer is empty and 'feed_eof' was called."""
+        return self._eof and not self._buffer
+
+    def feed_data(self, data):
+        assert not self._eof, 'feed_data after feed_eof'
+
+        if not data:
+            return
+
+        self._buffer.extend(data)
+        self._wakeup_waiter()
+
+        if (self._transport is not None and
+            not self._paused and
+            len(self._buffer) > 2*self._limit):
+            try:
+                self._transport.pause_reading()
+            except NotImplementedError:
+                # The transport can't be paused.
+                # We'll just have to buffer all data.
+                # Forget the transport so we don't keep trying.
+                self._transport = None
+            else:
+                self._paused = True
+
+    def _wait_for_data(self, func_name):
+        """Wait until feed_data() or feed_eof() is called."""
+        # StreamReader uses a future to link the protocol feed_data() method
+        # to a read coroutine. Running two read coroutines at the same time
+        # would have an unexpected behaviour. It would not possible to know
+        # which coroutine would get the next data.
+        if self._waiter is not None:
+            raise RuntimeError('%s() called while another coroutine is '
+                               'already waiting for incoming data' % func_name)
+
+        self._waiter = futures.Future(loop=self._loop)
+        try:
+            yield from self._waiter
+        finally:
+            self._waiter = None
+
+    @coroutine
+    def readline(self):
+        if self._exception is not None:
+            raise self._exception
+
+        line = bytearray()
+        not_enough = True
+
+        while not_enough:
+            while self._buffer and not_enough:
+                ichar = self._buffer.find(b'\n')
+                if ichar < 0:
+                    line.extend(self._buffer)
+                    self._buffer.clear()
+                else:
+                    ichar += 1
+                    line.extend(self._buffer[:ichar])
+                    del self._buffer[:ichar]
+                    not_enough = False
+
+                if len(line) > self._limit:
+                    self._maybe_resume_transport()
+                    raise ValueError('Line is too long')
+
+            if self._eof:
+                break
+
+            if not_enough:
+                yield from self._wait_for_data('readline')
+
+        self._maybe_resume_transport()
+        return bytes(line)
+
+    @coroutine
+    def read(self, n=-1):
+        if self._exception is not None:
+            raise self._exception
+
+        if not n:
+            return b''
+
+        if n < 0:
+            # This used to just loop creating a new waiter hoping to
+            # collect everything in self._buffer, but that would
+            # deadlock if the subprocess sends more than self.limit
+            # bytes.  So just call self.read(self._limit) until EOF.
+            blocks = []
+            while True:
+                block = yield from self.read(self._limit)
+                if not block:
+                    break
+                blocks.append(block)
+            return b''.join(blocks)
+        else:
+            if not self._buffer and not self._eof:
+                yield from self._wait_for_data('read')
+
+        if n < 0 or len(self._buffer) <= n:
+            data = bytes(self._buffer)
+            self._buffer.clear()
+        else:
+            # n > 0 and len(self._buffer) > n
+            data = bytes(self._buffer[:n])
+            del self._buffer[:n]
+
+        self._maybe_resume_transport()
+        return data
+
+    @coroutine
+    def readexactly(self, n):
+        if self._exception is not None:
+            raise self._exception
+
+        # There used to be "optimized" code here.  It created its own
+        # Future and waited until self._buffer had at least the n
+        # bytes, then called read(n).  Unfortunately, this could pause
+        # the transport if the argument was larger than the pause
+        # limit (which is twice self._limit).  So now we just read()
+        # into a local buffer.
+
+        blocks = []
+        while n > 0:
+            block = yield from self.read(n)
+            if not block:
+                partial = b''.join(blocks)
+                raise IncompleteReadError(partial, len(partial) + n)
+            blocks.append(block)
+            n -= len(block)
+
+        return b''.join(blocks)
diff --git a/Lib/asyncio/subprocess.py b/Lib/asyncio/subprocess.py
new file mode 100644
index 0000000..4600a9f
--- /dev/null
+++ b/Lib/asyncio/subprocess.py
@@ -0,0 +1,215 @@
+__all__ = ['create_subprocess_exec', 'create_subprocess_shell']
+
+import collections
+import subprocess
+
+from . import events
+from . import futures
+from . import protocols
+from . import streams
+from . import tasks
+from .coroutines import coroutine
+from .log import logger
+
+
+PIPE = subprocess.PIPE
+STDOUT = subprocess.STDOUT
+DEVNULL = subprocess.DEVNULL
+
+
+class SubprocessStreamProtocol(streams.FlowControlMixin,
+                               protocols.SubprocessProtocol):
+    """Like StreamReaderProtocol, but for a subprocess."""
+
+    def __init__(self, limit, loop):
+        super().__init__(loop=loop)
+        self._limit = limit
+        self.stdin = self.stdout = self.stderr = None
+        self._transport = None
+
+    def __repr__(self):
+        info = [self.__class__.__name__]
+        if self.stdin is not None:
+            info.append('stdin=%r' % self.stdin)
+        if self.stdout is not None:
+            info.append('stdout=%r' % self.stdout)
+        if self.stderr is not None:
+            info.append('stderr=%r' % self.stderr)
+        return '<%s>' % ' '.join(info)
+
+    def connection_made(self, transport):
+        self._transport = transport
+
+        stdout_transport = transport.get_pipe_transport(1)
+        if stdout_transport is not None:
+            self.stdout = streams.StreamReader(limit=self._limit,
+                                               loop=self._loop)
+            self.stdout.set_transport(stdout_transport)
+
+        stderr_transport = transport.get_pipe_transport(2)
+        if stderr_transport is not None:
+            self.stderr = streams.StreamReader(limit=self._limit,
+                                               loop=self._loop)
+            self.stderr.set_transport(stderr_transport)
+
+        stdin_transport = transport.get_pipe_transport(0)
+        if stdin_transport is not None:
+            self.stdin = streams.StreamWriter(stdin_transport,
+                                              protocol=self,
+                                              reader=None,
+                                              loop=self._loop)
+
+    def pipe_data_received(self, fd, data):
+        if fd == 1:
+            reader = self.stdout
+        elif fd == 2:
+            reader = self.stderr
+        else:
+            reader = None
+        if reader is not None:
+            reader.feed_data(data)
+
+    def pipe_connection_lost(self, fd, exc):
+        if fd == 0:
+            pipe = self.stdin
+            if pipe is not None:
+                pipe.close()
+            self.connection_lost(exc)
+            return
+        if fd == 1:
+            reader = self.stdout
+        elif fd == 2:
+            reader = self.stderr
+        else:
+            reader = None
+        if reader != None:
+            if exc is None:
+                reader.feed_eof()
+            else:
+                reader.set_exception(exc)
+
+    def process_exited(self):
+        self._transport.close()
+        self._transport = None
+
+
+class Process:
+    def __init__(self, transport, protocol, loop):
+        self._transport = transport
+        self._protocol = protocol
+        self._loop = loop
+        self.stdin = protocol.stdin
+        self.stdout = protocol.stdout
+        self.stderr = protocol.stderr
+        self.pid = transport.get_pid()
+
+    def __repr__(self):
+        return '<%s %s>' % (self.__class__.__name__, self.pid)
+
+    @property
+    def returncode(self):
+        return self._transport.get_returncode()
+
+    @coroutine
+    def wait(self):
+        """Wait until the process exit and return the process return code.
+
+        This method is a coroutine."""
+        return (yield from self._transport._wait())
+
+    def send_signal(self, signal):
+        self._transport.send_signal(signal)
+
+    def terminate(self):
+        self._transport.terminate()
+
+    def kill(self):
+        self._transport.kill()
+
+    @coroutine
+    def _feed_stdin(self, input):
+        debug = self._loop.get_debug()
+        self.stdin.write(input)
+        if debug:
+            logger.debug('%r communicate: feed stdin (%s bytes)',
+                        self, len(input))
+        try:
+            yield from self.stdin.drain()
+        except (BrokenPipeError, ConnectionResetError) as exc:
+            # communicate() ignores BrokenPipeError and ConnectionResetError
+            if debug:
+                logger.debug('%r communicate: stdin got %r', self, exc)
+
+        if debug:
+            logger.debug('%r communicate: close stdin', self)
+        self.stdin.close()
+
+    @coroutine
+    def _noop(self):
+        return None
+
+    @coroutine
+    def _read_stream(self, fd):
+        transport = self._transport.get_pipe_transport(fd)
+        if fd == 2:
+            stream = self.stderr
+        else:
+            assert fd == 1
+            stream = self.stdout
+        if self._loop.get_debug():
+            name = 'stdout' if fd == 1 else 'stderr'
+            logger.debug('%r communicate: read %s', self, name)
+        output = yield from stream.read()
+        if self._loop.get_debug():
+            name = 'stdout' if fd == 1 else 'stderr'
+            logger.debug('%r communicate: close %s', self, name)
+        transport.close()
+        return output
+
+    @coroutine
+    def communicate(self, input=None):
+        if input:
+            stdin = self._feed_stdin(input)
+        else:
+            stdin = self._noop()
+        if self.stdout is not None:
+            stdout = self._read_stream(1)
+        else:
+            stdout = self._noop()
+        if self.stderr is not None:
+            stderr = self._read_stream(2)
+        else:
+            stderr = self._noop()
+        stdin, stdout, stderr = yield from tasks.gather(stdin, stdout, stderr,
+                                                        loop=self._loop)
+        yield from self.wait()
+        return (stdout, stderr)
+
+
+@coroutine
+def create_subprocess_shell(cmd, stdin=None, stdout=None, stderr=None,
+                            loop=None, limit=streams._DEFAULT_LIMIT, **kwds):
+    if loop is None:
+        loop = events.get_event_loop()
+    protocol_factory = lambda: SubprocessStreamProtocol(limit=limit,
+                                                        loop=loop)
+    transport, protocol = yield from loop.subprocess_shell(
+                                            protocol_factory,
+                                            cmd, stdin=stdin, stdout=stdout,
+                                            stderr=stderr, **kwds)
+    return Process(transport, protocol, loop)
+
+@coroutine
+def create_subprocess_exec(program, *args, stdin=None, stdout=None,
+                           stderr=None, loop=None,
+                           limit=streams._DEFAULT_LIMIT, **kwds):
+    if loop is None:
+        loop = events.get_event_loop()
+    protocol_factory = lambda: SubprocessStreamProtocol(limit=limit,
+                                                        loop=loop)
+    transport, protocol = yield from loop.subprocess_exec(
+                                            protocol_factory,
+                                            program, *args,
+                                            stdin=stdin, stdout=stdout,
+                                            stderr=stderr, **kwds)
+    return Process(transport, protocol, loop)
diff --git a/Lib/asyncio/tasks.py b/Lib/asyncio/tasks.py
new file mode 100644
index 0000000..4f19a25
--- /dev/null
+++ b/Lib/asyncio/tasks.py
@@ -0,0 +1,667 @@
+"""Support for tasks, coroutines and the scheduler."""
+
+__all__ = ['Task',
+           'FIRST_COMPLETED', 'FIRST_EXCEPTION', 'ALL_COMPLETED',
+           'wait', 'wait_for', 'as_completed', 'sleep', 'async',
+           'gather', 'shield',
+           ]
+
+import concurrent.futures
+import functools
+import inspect
+import linecache
+import sys
+import traceback
+import weakref
+
+from . import coroutines
+from . import events
+from . import futures
+from .coroutines import coroutine
+
+_PY34 = (sys.version_info >= (3, 4))
+
+
+class Task(futures.Future):
+    """A coroutine wrapped in a Future."""
+
+    # An important invariant maintained while a Task not done:
+    #
+    # - Either _fut_waiter is None, and _step() is scheduled;
+    # - or _fut_waiter is some Future, and _step() is *not* scheduled.
+    #
+    # The only transition from the latter to the former is through
+    # _wakeup().  When _fut_waiter is not None, one of its callbacks
+    # must be _wakeup().
+
+    # Weak set containing all tasks alive.
+    _all_tasks = weakref.WeakSet()
+
+    # Dictionary containing tasks that are currently active in
+    # all running event loops.  {EventLoop: Task}
+    _current_tasks = {}
+
+    # If False, don't log a message if the task is destroyed whereas its
+    # status is still pending
+    _log_destroy_pending = True
+
+    @classmethod
+    def current_task(cls, loop=None):
+        """Return the currently running task in an event loop or None.
+
+        By default the current task for the current event loop is returned.
+
+        None is returned when called not in the context of a Task.
+        """
+        if loop is None:
+            loop = events.get_event_loop()
+        return cls._current_tasks.get(loop)
+
+    @classmethod
+    def all_tasks(cls, loop=None):
+        """Return a set of all tasks for an event loop.
+
+        By default all tasks for the current event loop are returned.
+        """
+        if loop is None:
+            loop = events.get_event_loop()
+        return {t for t in cls._all_tasks if t._loop is loop}
+
+    def __init__(self, coro, *, loop=None):
+        assert coroutines.iscoroutine(coro), repr(coro)
+        super().__init__(loop=loop)
+        if self._source_traceback:
+            del self._source_traceback[-1]
+        self._coro = iter(coro)  # Use the iterator just in case.
+        self._fut_waiter = None
+        self._must_cancel = False
+        self._loop.call_soon(self._step)
+        self.__class__._all_tasks.add(self)
+
+    # On Python 3.3 or older, objects with a destructor that are part of a
+    # reference cycle are never destroyed. That's not the case any more on
+    # Python 3.4 thanks to the PEP 442.
+    if _PY34:
+        def __del__(self):
+            if self._state == futures._PENDING and self._log_destroy_pending:
+                context = {
+                    'task': self,
+                    'message': 'Task was destroyed but it is pending!',
+                }
+                if self._source_traceback:
+                    context['source_traceback'] = self._source_traceback
+                self._loop.call_exception_handler(context)
+            futures.Future.__del__(self)
+
+    def _repr_info(self):
+        info = super()._repr_info()
+
+        if self._must_cancel:
+            # replace status
+            info[0] = 'cancelling'
+
+        coro = coroutines._format_coroutine(self._coro)
+        info.insert(1, 'coro=<%s>' % coro)
+
+        if self._fut_waiter is not None:
+            info.insert(2, 'wait_for=%r' % self._fut_waiter)
+        return info
+
+    def get_stack(self, *, limit=None):
+        """Return the list of stack frames for this task's coroutine.
+
+        If the coroutine is not done, this returns the stack where it is
+        suspended.  If the coroutine has completed successfully or was
+        cancelled, this returns an empty list.  If the coroutine was
+        terminated by an exception, this returns the list of traceback
+        frames.
+
+        The frames are always ordered from oldest to newest.
+
+        The optional limit gives the maximum number of frames to
+        return; by default all available frames are returned.  Its
+        meaning differs depending on whether a stack or a traceback is
+        returned: the newest frames of a stack are returned, but the
+        oldest frames of a traceback are returned.  (This matches the
+        behavior of the traceback module.)
+
+        For reasons beyond our control, only one stack frame is
+        returned for a suspended coroutine.
+        """
+        frames = []
+        f = self._coro.gi_frame
+        if f is not None:
+            while f is not None:
+                if limit is not None:
+                    if limit <= 0:
+                        break
+                    limit -= 1
+                frames.append(f)
+                f = f.f_back
+            frames.reverse()
+        elif self._exception is not None:
+            tb = self._exception.__traceback__
+            while tb is not None:
+                if limit is not None:
+                    if limit <= 0:
+                        break
+                    limit -= 1
+                frames.append(tb.tb_frame)
+                tb = tb.tb_next
+        return frames
+
+    def print_stack(self, *, limit=None, file=None):
+        """Print the stack or traceback for this task's coroutine.
+
+        This produces output similar to that of the traceback module,
+        for the frames retrieved by get_stack().  The limit argument
+        is passed to get_stack().  The file argument is an I/O stream
+        to which the output is written; by default output is written
+        to sys.stderr.
+        """
+        extracted_list = []
+        checked = set()
+        for f in self.get_stack(limit=limit):
+            lineno = f.f_lineno
+            co = f.f_code
+            filename = co.co_filename
+            name = co.co_name
+            if filename not in checked:
+                checked.add(filename)
+                linecache.checkcache(filename)
+            line = linecache.getline(filename, lineno, f.f_globals)
+            extracted_list.append((filename, lineno, name, line))
+        exc = self._exception
+        if not extracted_list:
+            print('No stack for %r' % self, file=file)
+        elif exc is not None:
+            print('Traceback for %r (most recent call last):' % self,
+                  file=file)
+        else:
+            print('Stack for %r (most recent call last):' % self,
+                  file=file)
+        traceback.print_list(extracted_list, file=file)
+        if exc is not None:
+            for line in traceback.format_exception_only(exc.__class__, exc):
+                print(line, file=file, end='')
+
+    def cancel(self):
+        """Request that this task cancel itself.
+
+        This arranges for a CancelledError to be thrown into the
+        wrapped coroutine on the next cycle through the event loop.
+        The coroutine then has a chance to clean up or even deny
+        the request using try/except/finally.
+
+        Unlike Future.cancel, this does not guarantee that the
+        task will be cancelled: the exception might be caught and
+        acted upon, delaying cancellation of the task or preventing
+        cancellation completely.  The task may also return a value or
+        raise a different exception.
+
+        Immediately after this method is called, Task.cancelled() will
+        not return True (unless the task was already cancelled).  A
+        task will be marked as cancelled when the wrapped coroutine
+        terminates with a CancelledError exception (even if cancel()
+        was not called).
+        """
+        if self.done():
+            return False
+        if self._fut_waiter is not None:
+            if self._fut_waiter.cancel():
+                # Leave self._fut_waiter; it may be a Task that
+                # catches and ignores the cancellation so we may have
+                # to cancel it again later.
+                return True
+        # It must be the case that self._step is already scheduled.
+        self._must_cancel = True
+        return True
+
+    def _step(self, value=None, exc=None):
+        assert not self.done(), \
+            '_step(): already done: {!r}, {!r}, {!r}'.format(self, value, exc)
+        if self._must_cancel:
+            if not isinstance(exc, futures.CancelledError):
+                exc = futures.CancelledError()
+            self._must_cancel = False
+        coro = self._coro
+        self._fut_waiter = None
+
+        self.__class__._current_tasks[self._loop] = self
+        # Call either coro.throw(exc) or coro.send(value).
+        try:
+            if exc is not None:
+                result = coro.throw(exc)
+            elif value is not None:
+                result = coro.send(value)
+            else:
+                result = next(coro)
+        except StopIteration as exc:
+            self.set_result(exc.value)
+        except futures.CancelledError as exc:
+            super().cancel()  # I.e., Future.cancel(self).
+        except Exception as exc:
+            self.set_exception(exc)
+        except BaseException as exc:
+            self.set_exception(exc)
+            raise
+        else:
+            if isinstance(result, futures.Future):
+                # Yielded Future must come from Future.__iter__().
+                if result._blocking:
+                    result._blocking = False
+                    result.add_done_callback(self._wakeup)
+                    self._fut_waiter = result
+                    if self._must_cancel:
+                        if self._fut_waiter.cancel():
+                            self._must_cancel = False
+                else:
+                    self._loop.call_soon(
+                        self._step, None,
+                        RuntimeError(
+                            'yield was used instead of yield from '
+                            'in task {!r} with {!r}'.format(self, result)))
+            elif result is None:
+                # Bare yield relinquishes control for one event loop iteration.
+                self._loop.call_soon(self._step)
+            elif inspect.isgenerator(result):
+                # Yielding a generator is just wrong.
+                self._loop.call_soon(
+                    self._step, None,
+                    RuntimeError(
+                        'yield was used instead of yield from for '
+                        'generator in task {!r} with {}'.format(
+                            self, result)))
+            else:
+                # Yielding something else is an error.
+                self._loop.call_soon(
+                    self._step, None,
+                    RuntimeError(
+                        'Task got bad yield: {!r}'.format(result)))
+        finally:
+            self.__class__._current_tasks.pop(self._loop)
+            self = None  # Needed to break cycles when an exception occurs.
+
+    def _wakeup(self, future):
+        try:
+            value = future.result()
+        except Exception as exc:
+            # This may also be a cancellation.
+            self._step(None, exc)
+        else:
+            self._step(value, None)
+        self = None  # Needed to break cycles when an exception occurs.
+
+
+# wait() and as_completed() similar to those in PEP 3148.
+
+FIRST_COMPLETED = concurrent.futures.FIRST_COMPLETED
+FIRST_EXCEPTION = concurrent.futures.FIRST_EXCEPTION
+ALL_COMPLETED = concurrent.futures.ALL_COMPLETED
+
+
+@coroutine
+def wait(fs, *, loop=None, timeout=None, return_when=ALL_COMPLETED):
+    """Wait for the Futures and coroutines given by fs to complete.
+
+    The sequence futures must not be empty.
+
+    Coroutines will be wrapped in Tasks.
+
+    Returns two sets of Future: (done, pending).
+
+    Usage:
+
+        done, pending = yield from asyncio.wait(fs)
+
+    Note: This does not raise TimeoutError! Futures that aren't done
+    when the timeout occurs are returned in the second set.
+    """
+    if isinstance(fs, futures.Future) or coroutines.iscoroutine(fs):
+        raise TypeError("expect a list of futures, not %s" % type(fs).__name__)
+    if not fs:
+        raise ValueError('Set of coroutines/Futures is empty.')
+    if return_when not in (FIRST_COMPLETED, FIRST_EXCEPTION, ALL_COMPLETED):
+        raise ValueError('Invalid return_when value: {}'.format(return_when))
+
+    if loop is None:
+        loop = events.get_event_loop()
+
+    fs = {async(f, loop=loop) for f in set(fs)}
+
+    return (yield from _wait(fs, timeout, return_when, loop))
+
+
+def _release_waiter(waiter, *args):
+    if not waiter.done():
+        waiter.set_result(None)
+
+
+@coroutine
+def wait_for(fut, timeout, *, loop=None):
+    """Wait for the single Future or coroutine to complete, with timeout.
+
+    Coroutine will be wrapped in Task.
+
+    Returns result of the Future or coroutine.  When a timeout occurs,
+    it cancels the task and raises TimeoutError.  To avoid the task
+    cancellation, wrap it in shield().
+
+    If the wait is cancelled, the task is also cancelled.
+
+    This function is a coroutine.
+    """
+    if loop is None:
+        loop = events.get_event_loop()
+
+    if timeout is None:
+        return (yield from fut)
+
+    waiter = futures.Future(loop=loop)
+    timeout_handle = loop.call_later(timeout, _release_waiter, waiter)
+    cb = functools.partial(_release_waiter, waiter)
+
+    fut = async(fut, loop=loop)
+    fut.add_done_callback(cb)
+
+    try:
+        # wait until the future completes or the timeout
+        try:
+            yield from waiter
+        except futures.CancelledError:
+            fut.remove_done_callback(cb)
+            fut.cancel()
+            raise
+
+        if fut.done():
+            return fut.result()
+        else:
+            fut.remove_done_callback(cb)
+            fut.cancel()
+            raise futures.TimeoutError()
+    finally:
+        timeout_handle.cancel()
+
+
+@coroutine
+def _wait(fs, timeout, return_when, loop):
+    """Internal helper for wait() and _wait_for().
+
+    The fs argument must be a collection of Futures.
+    """
+    assert fs, 'Set of Futures is empty.'
+    waiter = futures.Future(loop=loop)
+    timeout_handle = None
+    if timeout is not None:
+        timeout_handle = loop.call_later(timeout, _release_waiter, waiter)
+    counter = len(fs)
+
+    def _on_completion(f):
+        nonlocal counter
+        counter -= 1
+        if (counter <= 0 or
+            return_when == FIRST_COMPLETED or
+            return_when == FIRST_EXCEPTION and (not f.cancelled() and
+                                                f.exception() is not None)):
+            if timeout_handle is not None:
+                timeout_handle.cancel()
+            if not waiter.done():
+                waiter.set_result(None)
+
+    for f in fs:
+        f.add_done_callback(_on_completion)
+
+    try:
+        yield from waiter
+    finally:
+        if timeout_handle is not None:
+            timeout_handle.cancel()
+
+    done, pending = set(), set()
+    for f in fs:
+        f.remove_done_callback(_on_completion)
+        if f.done():
+            done.add(f)
+        else:
+            pending.add(f)
+    return done, pending
+
+
+# This is *not* a @coroutine!  It is just an iterator (yielding Futures).
+def as_completed(fs, *, loop=None, timeout=None):
+    """Return an iterator whose values are coroutines.
+
+    When waiting for the yielded coroutines you'll get the results (or
+    exceptions!) of the original Futures (or coroutines), in the order
+    in which and as soon as they complete.
+
+    This differs from PEP 3148; the proper way to use this is:
+
+        for f in as_completed(fs):
+            result = yield from f  # The 'yield from' may raise.
+            # Use result.
+
+    If a timeout is specified, the 'yield from' will raise
+    TimeoutError when the timeout occurs before all Futures are done.
+
+    Note: The futures 'f' are not necessarily members of fs.
+    """
+    if isinstance(fs, futures.Future) or coroutines.iscoroutine(fs):
+        raise TypeError("expect a list of futures, not %s" % type(fs).__name__)
+    loop = loop if loop is not None else events.get_event_loop()
+    todo = {async(f, loop=loop) for f in set(fs)}
+    from .queues import Queue  # Import here to avoid circular import problem.
+    done = Queue(loop=loop)
+    timeout_handle = None
+
+    def _on_timeout():
+        for f in todo:
+            f.remove_done_callback(_on_completion)
+            done.put_nowait(None)  # Queue a dummy value for _wait_for_one().
+        todo.clear()  # Can't do todo.remove(f) in the loop.
+
+    def _on_completion(f):
+        if not todo:
+            return  # _on_timeout() was here first.
+        todo.remove(f)
+        done.put_nowait(f)
+        if not todo and timeout_handle is not None:
+            timeout_handle.cancel()
+
+    @coroutine
+    def _wait_for_one():
+        f = yield from done.get()
+        if f is None:
+            # Dummy value from _on_timeout().
+            raise futures.TimeoutError
+        return f.result()  # May raise f.exception().
+
+    for f in todo:
+        f.add_done_callback(_on_completion)
+    if todo and timeout is not None:
+        timeout_handle = loop.call_later(timeout, _on_timeout)
+    for _ in range(len(todo)):
+        yield _wait_for_one()
+
+
+@coroutine
+def sleep(delay, result=None, *, loop=None):
+    """Coroutine that completes after a given time (in seconds)."""
+    future = futures.Future(loop=loop)
+    h = future._loop.call_later(delay,
+                                future._set_result_unless_cancelled, result)
+    try:
+        return (yield from future)
+    finally:
+        h.cancel()
+
+
+def async(coro_or_future, *, loop=None):
+    """Wrap a coroutine in a future.
+
+    If the argument is a Future, it is returned directly.
+    """
+    if isinstance(coro_or_future, futures.Future):
+        if loop is not None and loop is not coro_or_future._loop:
+            raise ValueError('loop argument must agree with Future')
+        return coro_or_future
+    elif coroutines.iscoroutine(coro_or_future):
+        if loop is None:
+            loop = events.get_event_loop()
+        task = loop.create_task(coro_or_future)
+        if task._source_traceback:
+            del task._source_traceback[-1]
+        return task
+    else:
+        raise TypeError('A Future or coroutine is required')
+
+
+class _GatheringFuture(futures.Future):
+    """Helper for gather().
+
+    This overrides cancel() to cancel all the children and act more
+    like Task.cancel(), which doesn't immediately mark itself as
+    cancelled.
+    """
+
+    def __init__(self, children, *, loop=None):
+        super().__init__(loop=loop)
+        self._children = children
+
+    def cancel(self):
+        if self.done():
+            return False
+        for child in self._children:
+            child.cancel()
+        return True
+
+
+def gather(*coros_or_futures, loop=None, return_exceptions=False):
+    """Return a future aggregating results from the given coroutines
+    or futures.
+
+    All futures must share the same event loop.  If all the tasks are
+    done successfully, the returned future's result is the list of
+    results (in the order of the original sequence, not necessarily
+    the order of results arrival).  If *return_exceptions* is True,
+    exceptions in the tasks are treated the same as successful
+    results, and gathered in the result list; otherwise, the first
+    raised exception will be immediately propagated to the returned
+    future.
+
+    Cancellation: if the outer Future is cancelled, all children (that
+    have not completed yet) are also cancelled.  If any child is
+    cancelled, this is treated as if it raised CancelledError --
+    the outer Future is *not* cancelled in this case.  (This is to
+    prevent the cancellation of one child to cause other children to
+    be cancelled.)
+    """
+    if not coros_or_futures:
+        outer = futures.Future(loop=loop)
+        outer.set_result([])
+        return outer
+
+    arg_to_fut = {}
+    for arg in set(coros_or_futures):
+        if not isinstance(arg, futures.Future):
+            fut = async(arg, loop=loop)
+            if loop is None:
+                loop = fut._loop
+            # The caller cannot control this future, the "destroy pending task"
+            # warning should not be emitted.
+            fut._log_destroy_pending = False
+        else:
+            fut = arg
+            if loop is None:
+                loop = fut._loop
+            elif fut._loop is not loop:
+                raise ValueError("futures are tied to different event loops")
+        arg_to_fut[arg] = fut
+
+    children = [arg_to_fut[arg] for arg in coros_or_futures]
+    nchildren = len(children)
+    outer = _GatheringFuture(children, loop=loop)
+    nfinished = 0
+    results = [None] * nchildren
+
+    def _done_callback(i, fut):
+        nonlocal nfinished
+        if outer.done():
+            if not fut.cancelled():
+                # Mark exception retrieved.
+                fut.exception()
+            return
+
+        if fut.cancelled():
+            res = futures.CancelledError()
+            if not return_exceptions:
+                outer.set_exception(res)
+                return
+        elif fut._exception is not None:
+            res = fut.exception()  # Mark exception retrieved.
+            if not return_exceptions:
+                outer.set_exception(res)
+                return
+        else:
+            res = fut._result
+        results[i] = res
+        nfinished += 1
+        if nfinished == nchildren:
+            outer.set_result(results)
+
+    for i, fut in enumerate(children):
+        fut.add_done_callback(functools.partial(_done_callback, i))
+    return outer
+
+
+def shield(arg, *, loop=None):
+    """Wait for a future, shielding it from cancellation.
+
+    The statement
+
+        res = yield from shield(something())
+
+    is exactly equivalent to the statement
+
+        res = yield from something()
+
+    *except* that if the coroutine containing it is cancelled, the
+    task running in something() is not cancelled.  From the POV of
+    something(), the cancellation did not happen.  But its caller is
+    still cancelled, so the yield-from expression still raises
+    CancelledError.  Note: If something() is cancelled by other means
+    this will still cancel shield().
+
+    If you want to completely ignore cancellation (not recommended)
+    you can combine shield() with a try/except clause, as follows:
+
+        try:
+            res = yield from shield(something())
+        except CancelledError:
+            res = None
+    """
+    inner = async(arg, loop=loop)
+    if inner.done():
+        # Shortcut.
+        return inner
+    loop = inner._loop
+    outer = futures.Future(loop=loop)
+
+    def _done_callback(inner):
+        if outer.cancelled():
+            if not inner.cancelled():
+                # Mark inner's result as retrieved.
+                inner.exception()
+            return
+
+        if inner.cancelled():
+            outer.cancel()
+        else:
+            exc = inner.exception()
+            if exc is not None:
+                outer.set_exception(exc)
+            else:
+                outer.set_result(inner.result())
+
+    inner.add_done_callback(_done_callback)
+    return outer
diff --git a/Lib/asyncio/test_utils.py b/Lib/asyncio/test_utils.py
new file mode 100644
index 0000000..8cee95b
--- /dev/null
+++ b/Lib/asyncio/test_utils.py
@@ -0,0 +1,446 @@
+"""Utilities shared by tests."""
+
+import collections
+import contextlib
+import io
+import logging
+import os
+import re
+import socket
+import socketserver
+import sys
+import tempfile
+import threading
+import time
+import unittest
+from unittest import mock
+
+from http.server import HTTPServer
+from wsgiref.simple_server import WSGIRequestHandler, WSGIServer
+
+try:
+    import ssl
+except ImportError:  # pragma: no cover
+    ssl = None
+
+from . import base_events
+from . import events
+from . import futures
+from . import selectors
+from . import tasks
+from .coroutines import coroutine
+from .log import logger
+
+
+if sys.platform == 'win32':  # pragma: no cover
+    from .windows_utils import socketpair
+else:
+    from socket import socketpair  # pragma: no cover
+
+
+def dummy_ssl_context():
+    if ssl is None:
+        return None
+    else:
+        return ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+
+
+def run_briefly(loop):
+    @coroutine
+    def once():
+        pass
+    gen = once()
+    t = loop.create_task(gen)
+    # Don't log a warning if the task is not done after run_until_complete().
+    # It occurs if the loop is stopped or if a task raises a BaseException.
+    t._log_destroy_pending = False
+    try:
+        loop.run_until_complete(t)
+    finally:
+        gen.close()
+
+
+def run_until(loop, pred, timeout=30):
+    deadline = time.time() + timeout
+    while not pred():
+        if timeout is not None:
+            timeout = deadline - time.time()
+            if timeout <= 0:
+                raise futures.TimeoutError()
+        loop.run_until_complete(tasks.sleep(0.001, loop=loop))
+
+
+def run_once(loop):
+    """loop.stop() schedules _raise_stop_error()
+    and run_forever() runs until _raise_stop_error() callback.
+    this wont work if test waits for some IO events, because
+    _raise_stop_error() runs before any of io events callbacks.
+    """
+    loop.stop()
+    loop.run_forever()
+
+
+class SilentWSGIRequestHandler(WSGIRequestHandler):
+
+    def get_stderr(self):
+        return io.StringIO()
+
+    def log_message(self, format, *args):
+        pass
+
+
+class SilentWSGIServer(WSGIServer):
+
+    request_timeout = 2
+
+    def get_request(self):
+        request, client_addr = super().get_request()
+        request.settimeout(self.request_timeout)
+        return request, client_addr
+
+    def handle_error(self, request, client_address):
+        pass
+
+
+class SSLWSGIServerMixin:
+
+    def finish_request(self, request, client_address):
+        # The relative location of our test directory (which
+        # contains the ssl key and certificate files) differs
+        # between the stdlib and stand-alone asyncio.
+        # Prefer our own if we can find it.
+        here = os.path.join(os.path.dirname(__file__), '..', 'tests')
+        if not os.path.isdir(here):
+            here = os.path.join(os.path.dirname(os.__file__),
+                                'test', 'test_asyncio')
+        keyfile = os.path.join(here, 'ssl_key.pem')
+        certfile = os.path.join(here, 'ssl_cert.pem')
+        ssock = ssl.wrap_socket(request,
+                                keyfile=keyfile,
+                                certfile=certfile,
+                                server_side=True)
+        try:
+            self.RequestHandlerClass(ssock, client_address, self)
+            ssock.close()
+        except OSError:
+            # maybe socket has been closed by peer
+            pass
+
+
+class SSLWSGIServer(SSLWSGIServerMixin, SilentWSGIServer):
+    pass
+
+
+def _run_test_server(*, address, use_ssl=False, server_cls, server_ssl_cls):
+
+    def app(environ, start_response):
+        status = '200 OK'
+        headers = [('Content-type', 'text/plain')]
+        start_response(status, headers)
+        return [b'Test message']
+
+    # Run the test WSGI server in a separate thread in order not to
+    # interfere with event handling in the main thread
+    server_class = server_ssl_cls if use_ssl else server_cls
+    httpd = server_class(address, SilentWSGIRequestHandler)
+    httpd.set_app(app)
+    httpd.address = httpd.server_address
+    server_thread = threading.Thread(
+        target=lambda: httpd.serve_forever(poll_interval=0.05))
+    server_thread.start()
+    try:
+        yield httpd
+    finally:
+        httpd.shutdown()
+        httpd.server_close()
+        server_thread.join()
+
+
+if hasattr(socket, 'AF_UNIX'):
+
+    class UnixHTTPServer(socketserver.UnixStreamServer, HTTPServer):
+
+        def server_bind(self):
+            socketserver.UnixStreamServer.server_bind(self)
+            self.server_name = '127.0.0.1'
+            self.server_port = 80
+
+
+    class UnixWSGIServer(UnixHTTPServer, WSGIServer):
+
+        request_timeout = 2
+
+        def server_bind(self):
+            UnixHTTPServer.server_bind(self)
+            self.setup_environ()
+
+        def get_request(self):
+            request, client_addr = super().get_request()
+            request.settimeout(self.request_timeout)
+            # Code in the stdlib expects that get_request
+            # will return a socket and a tuple (host, port).
+            # However, this isn't true for UNIX sockets,
+            # as the second return value will be a path;
+            # hence we return some fake data sufficient
+            # to get the tests going
+            return request, ('127.0.0.1', '')
+
+
+    class SilentUnixWSGIServer(UnixWSGIServer):
+
+        def handle_error(self, request, client_address):
+            pass
+
+
+    class UnixSSLWSGIServer(SSLWSGIServerMixin, SilentUnixWSGIServer):
+        pass
+
+
+    def gen_unix_socket_path():
+        with tempfile.NamedTemporaryFile() as file:
+            return file.name
+
+
+    @contextlib.contextmanager
+    def unix_socket_path():
+        path = gen_unix_socket_path()
+        try:
+            yield path
+        finally:
+            try:
+                os.unlink(path)
+            except OSError:
+                pass
+
+
+    @contextlib.contextmanager
+    def run_test_unix_server(*, use_ssl=False):
+        with unix_socket_path() as path:
+            yield from _run_test_server(address=path, use_ssl=use_ssl,
+                                        server_cls=SilentUnixWSGIServer,
+                                        server_ssl_cls=UnixSSLWSGIServer)
+
+
+@contextlib.contextmanager
+def run_test_server(*, host='127.0.0.1', port=0, use_ssl=False):
+    yield from _run_test_server(address=(host, port), use_ssl=use_ssl,
+                                server_cls=SilentWSGIServer,
+                                server_ssl_cls=SSLWSGIServer)
+
+
+def make_test_protocol(base):
+    dct = {}
+    for name in dir(base):
+        if name.startswith('__') and name.endswith('__'):
+            # skip magic names
+            continue
+        dct[name] = MockCallback(return_value=None)
+    return type('TestProtocol', (base,) + base.__bases__, dct)()
+
+
+class TestSelector(selectors.BaseSelector):
+
+    def __init__(self):
+        self.keys = {}
+
+    def register(self, fileobj, events, data=None):
+        key = selectors.SelectorKey(fileobj, 0, events, data)
+        self.keys[fileobj] = key
+        return key
+
+    def unregister(self, fileobj):
+        return self.keys.pop(fileobj)
+
+    def select(self, timeout):
+        return []
+
+    def get_map(self):
+        return self.keys
+
+
+class TestLoop(base_events.BaseEventLoop):
+    """Loop for unittests.
+
+    It manages self time directly.
+    If something scheduled to be executed later then
+    on next loop iteration after all ready handlers done
+    generator passed to __init__ is calling.
+
+    Generator should be like this:
+
+        def gen():
+            ...
+            when = yield ...
+            ... = yield time_advance
+
+    Value returned by yield is absolute time of next scheduled handler.
+    Value passed to yield is time advance to move loop's time forward.
+    """
+
+    def __init__(self, gen=None):
+        super().__init__()
+
+        if gen is None:
+            def gen():
+                yield
+            self._check_on_close = False
+        else:
+            self._check_on_close = True
+
+        self._gen = gen()
+        next(self._gen)
+        self._time = 0
+        self._clock_resolution = 1e-9
+        self._timers = []
+        self._selector = TestSelector()
+
+        self.readers = {}
+        self.writers = {}
+        self.reset_counters()
+
+    def time(self):
+        return self._time
+
+    def advance_time(self, advance):
+        """Move test time forward."""
+        if advance:
+            self._time += advance
+
+    def close(self):
+        super().close()
+        if self._check_on_close:
+            try:
+                self._gen.send(0)
+            except StopIteration:
+                pass
+            else:  # pragma: no cover
+                raise AssertionError("Time generator is not finished")
+
+    def add_reader(self, fd, callback, *args):
+        self.readers[fd] = events.Handle(callback, args, self)
+
+    def remove_reader(self, fd):
+        self.remove_reader_count[fd] += 1
+        if fd in self.readers:
+            del self.readers[fd]
+            return True
+        else:
+            return False
+
+    def assert_reader(self, fd, callback, *args):
+        assert fd in self.readers, 'fd {} is not registered'.format(fd)
+        handle = self.readers[fd]
+        assert handle._callback == callback, '{!r} != {!r}'.format(
+            handle._callback, callback)
+        assert handle._args == args, '{!r} != {!r}'.format(
+            handle._args, args)
+
+    def add_writer(self, fd, callback, *args):
+        self.writers[fd] = events.Handle(callback, args, self)
+
+    def remove_writer(self, fd):
+        self.remove_writer_count[fd] += 1
+        if fd in self.writers:
+            del self.writers[fd]
+            return True
+        else:
+            return False
+
+    def assert_writer(self, fd, callback, *args):
+        assert fd in self.writers, 'fd {} is not registered'.format(fd)
+        handle = self.writers[fd]
+        assert handle._callback == callback, '{!r} != {!r}'.format(
+            handle._callback, callback)
+        assert handle._args == args, '{!r} != {!r}'.format(
+            handle._args, args)
+
+    def reset_counters(self):
+        self.remove_reader_count = collections.defaultdict(int)
+        self.remove_writer_count = collections.defaultdict(int)
+
+    def _run_once(self):
+        super()._run_once()
+        for when in self._timers:
+            advance = self._gen.send(when)
+            self.advance_time(advance)
+        self._timers = []
+
+    def call_at(self, when, callback, *args):
+        self._timers.append(when)
+        return super().call_at(when, callback, *args)
+
+    def _process_events(self, event_list):
+        return
+
+    def _write_to_self(self):
+        pass
+
+
+def MockCallback(**kwargs):
+    return mock.Mock(spec=['__call__'], **kwargs)
+
+
+class MockPattern(str):
+    """A regex based str with a fuzzy __eq__.
+
+    Use this helper with 'mock.assert_called_with', or anywhere
+    where a regex comparison between strings is needed.
+
+    For instance:
+       mock_call.assert_called_with(MockPattern('spam.*ham'))
+    """
+    def __eq__(self, other):
+        return bool(re.search(str(self), other, re.S))
+
+
+def get_function_source(func):
+    source = events._get_function_source(func)
+    if source is None:
+        raise ValueError("unable to get the source of %r" % (func,))
+    return source
+
+
+class TestCase(unittest.TestCase):
+    def set_event_loop(self, loop, *, cleanup=True):
+        assert loop is not None
+        # ensure that the event loop is passed explicitly in asyncio
+        events.set_event_loop(None)
+        if cleanup:
+            self.addCleanup(loop.close)
+
+    def new_test_loop(self, gen=None):
+        loop = TestLoop(gen)
+        self.set_event_loop(loop)
+        return loop
+
+    def tearDown(self):
+        events.set_event_loop(None)
+
+        # Detect CPython bug #23353: ensure that yield/yield-from is not used
+        # in an except block of a generator
+        self.assertEqual(sys.exc_info(), (None, None, None))
+
+
+@contextlib.contextmanager
+def disable_logger():
+    """Context manager to disable asyncio logger.
+
+    For example, it can be used to ignore warnings in debug mode.
+    """
+    old_level = logger.level
+    try:
+        logger.setLevel(logging.CRITICAL+1)
+        yield
+    finally:
+        logger.setLevel(old_level)
+
+def mock_nonblocking_socket():
+    """Create a mock of a non-blocking socket."""
+    sock = mock.Mock(socket.socket)
+    sock.gettimeout.return_value = 0.0
+    return sock
+
+
+def force_legacy_ssl_support():
+    return mock.patch('asyncio.sslproto._is_sslproto_available',
+                      return_value=False)
diff --git a/Lib/asyncio/transports.py b/Lib/asyncio/transports.py
new file mode 100644
index 0000000..22df3c7
--- /dev/null
+++ b/Lib/asyncio/transports.py
@@ -0,0 +1,300 @@
+"""Abstract Transport class."""
+
+import sys
+
+_PY34 = sys.version_info >= (3, 4)
+
+__all__ = ['BaseTransport', 'ReadTransport', 'WriteTransport',
+           'Transport', 'DatagramTransport', 'SubprocessTransport',
+           ]
+
+
+class BaseTransport:
+    """Base class for transports."""
+
+    def __init__(self, extra=None):
+        if extra is None:
+            extra = {}
+        self._extra = extra
+
+    def get_extra_info(self, name, default=None):
+        """Get optional transport information."""
+        return self._extra.get(name, default)
+
+    def close(self):
+        """Close the transport.
+
+        Buffered data will be flushed asynchronously.  No more data
+        will be received.  After all buffered data is flushed, the
+        protocol's connection_lost() method will (eventually) called
+        with None as its argument.
+        """
+        raise NotImplementedError
+
+
+class ReadTransport(BaseTransport):
+    """Interface for read-only transports."""
+
+    def pause_reading(self):
+        """Pause the receiving end.
+
+        No data will be passed to the protocol's data_received()
+        method until resume_reading() is called.
+        """
+        raise NotImplementedError
+
+    def resume_reading(self):
+        """Resume the receiving end.
+
+        Data received will once again be passed to the protocol's
+        data_received() method.
+        """
+        raise NotImplementedError
+
+
+class WriteTransport(BaseTransport):
+    """Interface for write-only transports."""
+
+    def set_write_buffer_limits(self, high=None, low=None):
+        """Set the high- and low-water limits for write flow control.
+
+        These two values control when to call the protocol's
+        pause_writing() and resume_writing() methods.  If specified,
+        the low-water limit must be less than or equal to the
+        high-water limit.  Neither value can be negative.
+
+        The defaults are implementation-specific.  If only the
+        high-water limit is given, the low-water limit defaults to a
+        implementation-specific value less than or equal to the
+        high-water limit.  Setting high to zero forces low to zero as
+        well, and causes pause_writing() to be called whenever the
+        buffer becomes non-empty.  Setting low to zero causes
+        resume_writing() to be called only once the buffer is empty.
+        Use of zero for either limit is generally sub-optimal as it
+        reduces opportunities for doing I/O and computation
+        concurrently.
+        """
+        raise NotImplementedError
+
+    def get_write_buffer_size(self):
+        """Return the current size of the write buffer."""
+        raise NotImplementedError
+
+    def write(self, data):
+        """Write some data bytes to the transport.
+
+        This does not block; it buffers the data and arranges for it
+        to be sent out asynchronously.
+        """
+        raise NotImplementedError
+
+    def writelines(self, list_of_data):
+        """Write a list (or any iterable) of data bytes to the transport.
+
+        The default implementation concatenates the arguments and
+        calls write() on the result.
+        """
+        if not _PY34:
+            # In Python 3.3, bytes.join() doesn't handle memoryview.
+            list_of_data = (
+                bytes(data) if isinstance(data, memoryview) else data
+                for data in list_of_data)
+        self.write(b''.join(list_of_data))
+
+    def write_eof(self):
+        """Close the write end after flushing buffered data.
+
+        (This is like typing ^D into a UNIX program reading from stdin.)
+
+        Data may still be received.
+        """
+        raise NotImplementedError
+
+    def can_write_eof(self):
+        """Return True if this transport supports write_eof(), False if not."""
+        raise NotImplementedError
+
+    def abort(self):
+        """Close the transport immediately.
+
+        Buffered data will be lost.  No more data will be received.
+        The protocol's connection_lost() method will (eventually) be
+        called with None as its argument.
+        """
+        raise NotImplementedError
+
+
+class Transport(ReadTransport, WriteTransport):
+    """Interface representing a bidirectional transport.
+
+    There may be several implementations, but typically, the user does
+    not implement new transports; rather, the platform provides some
+    useful transports that are implemented using the platform's best
+    practices.
+
+    The user never instantiates a transport directly; they call a
+    utility function, passing it a protocol factory and other
+    information necessary to create the transport and protocol.  (E.g.
+    EventLoop.create_connection() or EventLoop.create_server().)
+
+    The utility function will asynchronously create a transport and a
+    protocol and hook them up by calling the protocol's
+    connection_made() method, passing it the transport.
+
+    The implementation here raises NotImplemented for every method
+    except writelines(), which calls write() in a loop.
+    """
+
+
+class DatagramTransport(BaseTransport):
+    """Interface for datagram (UDP) transports."""
+
+    def sendto(self, data, addr=None):
+        """Send data to the transport.
+
+        This does not block; it buffers the data and arranges for it
+        to be sent out asynchronously.
+        addr is target socket address.
+        If addr is None use target address pointed on transport creation.
+        """
+        raise NotImplementedError
+
+    def abort(self):
+        """Close the transport immediately.
+
+        Buffered data will be lost.  No more data will be received.
+        The protocol's connection_lost() method will (eventually) be
+        called with None as its argument.
+        """
+        raise NotImplementedError
+
+
+class SubprocessTransport(BaseTransport):
+
+    def get_pid(self):
+        """Get subprocess id."""
+        raise NotImplementedError
+
+    def get_returncode(self):
+        """Get subprocess returncode.
+
+        See also
+        http://docs.python.org/3/library/subprocess#subprocess.Popen.returncode
+        """
+        raise NotImplementedError
+
+    def get_pipe_transport(self, fd):
+        """Get transport for pipe with number fd."""
+        raise NotImplementedError
+
+    def send_signal(self, signal):
+        """Send signal to subprocess.
+
+        See also:
+        docs.python.org/3/library/subprocess#subprocess.Popen.send_signal
+        """
+        raise NotImplementedError
+
+    def terminate(self):
+        """Stop the subprocess.
+
+        Alias for close() method.
+
+        On Posix OSs the method sends SIGTERM to the subprocess.
+        On Windows the Win32 API function TerminateProcess()
+         is called to stop the subprocess.
+
+        See also:
+        http://docs.python.org/3/library/subprocess#subprocess.Popen.terminate
+        """
+        raise NotImplementedError
+
+    def kill(self):
+        """Kill the subprocess.
+
+        On Posix OSs the function sends SIGKILL to the subprocess.
+        On Windows kill() is an alias for terminate().
+
+        See also:
+        http://docs.python.org/3/library/subprocess#subprocess.Popen.kill
+        """
+        raise NotImplementedError
+
+
+class _FlowControlMixin(Transport):
+    """All the logic for (write) flow control in a mix-in base class.
+
+    The subclass must implement get_write_buffer_size().  It must call
+    _maybe_pause_protocol() whenever the write buffer size increases,
+    and _maybe_resume_protocol() whenever it decreases.  It may also
+    override set_write_buffer_limits() (e.g. to specify different
+    defaults).
+
+    The subclass constructor must call super().__init__(extra).  This
+    will call set_write_buffer_limits().
+
+    The user may call set_write_buffer_limits() and
+    get_write_buffer_size(), and their protocol's pause_writing() and
+    resume_writing() may be called.
+    """
+
+    def __init__(self, extra=None, loop=None):
+        super().__init__(extra)
+        assert loop is not None
+        self._loop = loop
+        self._protocol_paused = False
+        self._set_write_buffer_limits()
+
+    def _maybe_pause_protocol(self):
+        size = self.get_write_buffer_size()
+        if size <= self._high_water:
+            return
+        if not self._protocol_paused:
+            self._protocol_paused = True
+            try:
+                self._protocol.pause_writing()
+            except Exception as exc:
+                self._loop.call_exception_handler({
+                    'message': 'protocol.pause_writing() failed',
+                    'exception': exc,
+                    'transport': self,
+                    'protocol': self._protocol,
+                })
+
+    def _maybe_resume_protocol(self):
+        if (self._protocol_paused and
+            self.get_write_buffer_size() <= self._low_water):
+            self._protocol_paused = False
+            try:
+                self._protocol.resume_writing()
+            except Exception as exc:
+                self._loop.call_exception_handler({
+                    'message': 'protocol.resume_writing() failed',
+                    'exception': exc,
+                    'transport': self,
+                    'protocol': self._protocol,
+                })
+
+    def get_write_buffer_limits(self):
+        return (self._low_water, self._high_water)
+
+    def _set_write_buffer_limits(self, high=None, low=None):
+        if high is None:
+            if low is None:
+                high = 64*1024
+            else:
+                high = 4*low
+        if low is None:
+            low = high // 4
+        if not high >= low >= 0:
+            raise ValueError('high (%r) must be >= low (%r) must be >= 0' %
+                             (high, low))
+        self._high_water = high
+        self._low_water = low
+
+    def set_write_buffer_limits(self, high=None, low=None):
+        self._set_write_buffer_limits(high=high, low=low)
+        self._maybe_pause_protocol()
+
+    def get_write_buffer_size(self):
+        raise NotImplementedError
diff --git a/Lib/asyncio/unix_events.py b/Lib/asyncio/unix_events.py
new file mode 100644
index 0000000..75e7c9c
--- /dev/null
+++ b/Lib/asyncio/unix_events.py
@@ -0,0 +1,998 @@
+"""Selector event loop for Unix with signal handling."""
+
+import errno
+import os
+import signal
+import socket
+import stat
+import subprocess
+import sys
+import threading
+import warnings
+
+
+from . import base_events
+from . import base_subprocess
+from . import constants
+from . import coroutines
+from . import events
+from . import futures
+from . import selector_events
+from . import selectors
+from . import transports
+from .coroutines import coroutine
+from .log import logger
+
+
+__all__ = ['SelectorEventLoop',
+           'AbstractChildWatcher', 'SafeChildWatcher',
+           'FastChildWatcher', 'DefaultEventLoopPolicy',
+           ]
+
+if sys.platform == 'win32':  # pragma: no cover
+    raise ImportError('Signals are not really supported on Windows')
+
+
+def _sighandler_noop(signum, frame):
+    """Dummy signal handler."""
+    pass
+
+
+class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop):
+    """Unix event loop.
+
+    Adds signal handling and UNIX Domain Socket support to SelectorEventLoop.
+    """
+
+    def __init__(self, selector=None):
+        super().__init__(selector)
+        self._signal_handlers = {}
+
+    def _socketpair(self):
+        return socket.socketpair()
+
+    def close(self):
+        super().close()
+        for sig in list(self._signal_handlers):
+            self.remove_signal_handler(sig)
+
+    def _process_self_data(self, data):
+        for signum in data:
+            if not signum:
+                # ignore null bytes written by _write_to_self()
+                continue
+            self._handle_signal(signum)
+
+    def add_signal_handler(self, sig, callback, *args):
+        """Add a handler for a signal.  UNIX only.
+
+        Raise ValueError if the signal number is invalid or uncatchable.
+        Raise RuntimeError if there is a problem setting up the handler.
+        """
+        if (coroutines.iscoroutine(callback)
+        or coroutines.iscoroutinefunction(callback)):
+            raise TypeError("coroutines cannot be used "
+                            "with add_signal_handler()")
+        self._check_signal(sig)
+        self._check_closed()
+        try:
+            # set_wakeup_fd() raises ValueError if this is not the
+            # main thread.  By calling it early we ensure that an
+            # event loop running in another thread cannot add a signal
+            # handler.
+            signal.set_wakeup_fd(self._csock.fileno())
+        except (ValueError, OSError) as exc:
+            raise RuntimeError(str(exc))
+
+        handle = events.Handle(callback, args, self)
+        self._signal_handlers[sig] = handle
+
+        try:
+            # Register a dummy signal handler to ask Python to write the signal
+            # number in the wakup file descriptor. _process_self_data() will
+            # read signal numbers from this file descriptor to handle signals.
+            signal.signal(sig, _sighandler_noop)
+
+            # Set SA_RESTART to limit EINTR occurrences.
+            signal.siginterrupt(sig, False)
+        except OSError as exc:
+            del self._signal_handlers[sig]
+            if not self._signal_handlers:
+                try:
+                    signal.set_wakeup_fd(-1)
+                except (ValueError, OSError) as nexc:
+                    logger.info('set_wakeup_fd(-1) failed: %s', nexc)
+
+            if exc.errno == errno.EINVAL:
+                raise RuntimeError('sig {} cannot be caught'.format(sig))
+            else:
+                raise
+
+    def _handle_signal(self, sig):
+        """Internal helper that is the actual signal handler."""
+        handle = self._signal_handlers.get(sig)
+        if handle is None:
+            return  # Assume it's some race condition.
+        if handle._cancelled:
+            self.remove_signal_handler(sig)  # Remove it properly.
+        else:
+            self._add_callback_signalsafe(handle)
+
+    def remove_signal_handler(self, sig):
+        """Remove a handler for a signal.  UNIX only.
+
+        Return True if a signal handler was removed, False if not.
+        """
+        self._check_signal(sig)
+        try:
+            del self._signal_handlers[sig]
+        except KeyError:
+            return False
+
+        if sig == signal.SIGINT:
+            handler = signal.default_int_handler
+        else:
+            handler = signal.SIG_DFL
+
+        try:
+            signal.signal(sig, handler)
+        except OSError as exc:
+            if exc.errno == errno.EINVAL:
+                raise RuntimeError('sig {} cannot be caught'.format(sig))
+            else:
+                raise
+
+        if not self._signal_handlers:
+            try:
+                signal.set_wakeup_fd(-1)
+            except (ValueError, OSError) as exc:
+                logger.info('set_wakeup_fd(-1) failed: %s', exc)
+
+        return True
+
+    def _check_signal(self, sig):
+        """Internal helper to validate a signal.
+
+        Raise ValueError if the signal number is invalid or uncatchable.
+        Raise RuntimeError if there is a problem setting up the handler.
+        """
+        if not isinstance(sig, int):
+            raise TypeError('sig must be an int, not {!r}'.format(sig))
+
+        if not (1 <= sig < signal.NSIG):
+            raise ValueError(
+                'sig {} out of range(1, {})'.format(sig, signal.NSIG))
+
+    def _make_read_pipe_transport(self, pipe, protocol, waiter=None,
+                                  extra=None):
+        return _UnixReadPipeTransport(self, pipe, protocol, waiter, extra)
+
+    def _make_write_pipe_transport(self, pipe, protocol, waiter=None,
+                                   extra=None):
+        return _UnixWritePipeTransport(self, pipe, protocol, waiter, extra)
+
+    @coroutine
+    def _make_subprocess_transport(self, protocol, args, shell,
+                                   stdin, stdout, stderr, bufsize,
+                                   extra=None, **kwargs):
+        with events.get_child_watcher() as watcher:
+            waiter = futures.Future(loop=self)
+            transp = _UnixSubprocessTransport(self, protocol, args, shell,
+                                              stdin, stdout, stderr, bufsize,
+                                              waiter=waiter, extra=extra,
+                                              **kwargs)
+
+            watcher.add_child_handler(transp.get_pid(),
+                                      self._child_watcher_callback, transp)
+            try:
+                yield from waiter
+            except Exception as exc:
+                # Workaround CPython bug #23353: using yield/yield-from in an
+                # except block of a generator doesn't clear properly
+                # sys.exc_info()
+                err = exc
+            else:
+                err = None
+
+            if err is not None:
+                transp.close()
+                yield from transp._wait()
+                raise err
+
+        return transp
+
+    def _child_watcher_callback(self, pid, returncode, transp):
+        self.call_soon_threadsafe(transp._process_exited, returncode)
+
+    @coroutine
+    def create_unix_connection(self, protocol_factory, path, *,
+                               ssl=None, sock=None,
+                               server_hostname=None):
+        assert server_hostname is None or isinstance(server_hostname, str)
+        if ssl:
+            if server_hostname is None:
+                raise ValueError(
+                    'you have to pass server_hostname when using ssl')
+        else:
+            if server_hostname is not None:
+                raise ValueError('server_hostname is only meaningful with ssl')
+
+        if path is not None:
+            if sock is not None:
+                raise ValueError(
+                    'path and sock can not be specified at the same time')
+
+            sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM, 0)
+            try:
+                sock.setblocking(False)
+                yield from self.sock_connect(sock, path)
+            except:
+                sock.close()
+                raise
+
+        else:
+            if sock is None:
+                raise ValueError('no path and sock were specified')
+            sock.setblocking(False)
+
+        transport, protocol = yield from self._create_connection_transport(
+            sock, protocol_factory, ssl, server_hostname)
+        return transport, protocol
+
+    @coroutine
+    def create_unix_server(self, protocol_factory, path=None, *,
+                           sock=None, backlog=100, ssl=None):
+        if isinstance(ssl, bool):
+            raise TypeError('ssl argument must be an SSLContext or None')
+
+        if path is not None:
+            if sock is not None:
+                raise ValueError(
+                    'path and sock can not be specified at the same time')
+
+            sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
+
+            try:
+                sock.bind(path)
+            except OSError as exc:
+                sock.close()
+                if exc.errno == errno.EADDRINUSE:
+                    # Let's improve the error message by adding
+                    # with what exact address it occurs.
+                    msg = 'Address {!r} is already in use'.format(path)
+                    raise OSError(errno.EADDRINUSE, msg) from None
+                else:
+                    raise
+            except:
+                sock.close()
+                raise
+        else:
+            if sock is None:
+                raise ValueError(
+                    'path was not specified, and no sock specified')
+
+            if sock.family != socket.AF_UNIX:
+                raise ValueError(
+                    'A UNIX Domain Socket was expected, got {!r}'.format(sock))
+
+        server = base_events.Server(self, [sock])
+        sock.listen(backlog)
+        sock.setblocking(False)
+        self._start_serving(protocol_factory, sock, ssl, server)
+        return server
+
+
+if hasattr(os, 'set_blocking'):
+    def _set_nonblocking(fd):
+        os.set_blocking(fd, False)
+else:
+    import fcntl
+
+    def _set_nonblocking(fd):
+        flags = fcntl.fcntl(fd, fcntl.F_GETFL)
+        flags = flags | os.O_NONBLOCK
+        fcntl.fcntl(fd, fcntl.F_SETFL, flags)
+
+
+class _UnixReadPipeTransport(transports.ReadTransport):
+
+    max_size = 256 * 1024  # max bytes we read in one event loop iteration
+
+    def __init__(self, loop, pipe, protocol, waiter=None, extra=None):
+        super().__init__(extra)
+        self._extra['pipe'] = pipe
+        self._loop = loop
+        self._pipe = pipe
+        self._fileno = pipe.fileno()
+        mode = os.fstat(self._fileno).st_mode
+        if not (stat.S_ISFIFO(mode) or
+                stat.S_ISSOCK(mode) or
+                stat.S_ISCHR(mode)):
+            raise ValueError("Pipe transport is for pipes/sockets only.")
+        _set_nonblocking(self._fileno)
+        self._protocol = protocol
+        self._closing = False
+        self._loop.call_soon(self._protocol.connection_made, self)
+        # only start reading when connection_made() has been called
+        self._loop.call_soon(self._loop.add_reader,
+                             self._fileno, self._read_ready)
+        if waiter is not None:
+            # only wake up the waiter when connection_made() has been called
+            self._loop.call_soon(waiter._set_result_unless_cancelled, None)
+
+    def __repr__(self):
+        info = [self.__class__.__name__]
+        if self._pipe is None:
+            info.append('closed')
+        elif self._closing:
+            info.append('closing')
+        info.append('fd=%s' % self._fileno)
+        if self._pipe is not None:
+            polling = selector_events._test_selector_event(
+                          self._loop._selector,
+                          self._fileno, selectors.EVENT_READ)
+            if polling:
+                info.append('polling')
+            else:
+                info.append('idle')
+        else:
+            info.append('closed')
+        return '<%s>' % ' '.join(info)
+
+    def _read_ready(self):
+        try:
+            data = os.read(self._fileno, self.max_size)
+        except (BlockingIOError, InterruptedError):
+            pass
+        except OSError as exc:
+            self._fatal_error(exc, 'Fatal read error on pipe transport')
+        else:
+            if data:
+                self._protocol.data_received(data)
+            else:
+                if self._loop.get_debug():
+                    logger.info("%r was closed by peer", self)
+                self._closing = True
+                self._loop.remove_reader(self._fileno)
+                self._loop.call_soon(self._protocol.eof_received)
+                self._loop.call_soon(self._call_connection_lost, None)
+
+    def pause_reading(self):
+        self._loop.remove_reader(self._fileno)
+
+    def resume_reading(self):
+        self._loop.add_reader(self._fileno, self._read_ready)
+
+    def close(self):
+        if not self._closing:
+            self._close(None)
+
+    # On Python 3.3 and older, objects with a destructor part of a reference
+    # cycle are never destroyed. It's not more the case on Python 3.4 thanks
+    # to the PEP 442.
+    if sys.version_info >= (3, 4):
+        def __del__(self):
+            if self._pipe is not None:
+                warnings.warn("unclosed transport %r" % self, ResourceWarning)
+                self._pipe.close()
+
+    def _fatal_error(self, exc, message='Fatal error on pipe transport'):
+        # should be called by exception handler only
+        if (isinstance(exc, OSError) and exc.errno == errno.EIO):
+            if self._loop.get_debug():
+                logger.debug("%r: %s", self, message, exc_info=True)
+        else:
+            self._loop.call_exception_handler({
+                'message': message,
+                'exception': exc,
+                'transport': self,
+                'protocol': self._protocol,
+            })
+        self._close(exc)
+
+    def _close(self, exc):
+        self._closing = True
+        self._loop.remove_reader(self._fileno)
+        self._loop.call_soon(self._call_connection_lost, exc)
+
+    def _call_connection_lost(self, exc):
+        try:
+            self._protocol.connection_lost(exc)
+        finally:
+            self._pipe.close()
+            self._pipe = None
+            self._protocol = None
+            self._loop = None
+
+
+class _UnixWritePipeTransport(transports._FlowControlMixin,
+                              transports.WriteTransport):
+
+    def __init__(self, loop, pipe, protocol, waiter=None, extra=None):
+        super().__init__(extra, loop)
+        self._extra['pipe'] = pipe
+        self._pipe = pipe
+        self._fileno = pipe.fileno()
+        mode = os.fstat(self._fileno).st_mode
+        is_socket = stat.S_ISSOCK(mode)
+        if not (is_socket or
+                stat.S_ISFIFO(mode) or
+                stat.S_ISCHR(mode)):
+            raise ValueError("Pipe transport is only for "
+                             "pipes, sockets and character devices")
+        _set_nonblocking(self._fileno)
+        self._protocol = protocol
+        self._buffer = []
+        self._conn_lost = 0
+        self._closing = False  # Set when close() or write_eof() called.
+
+        self._loop.call_soon(self._protocol.connection_made, self)
+
+        # On AIX, the reader trick (to be notified when the read end of the
+        # socket is closed) only works for sockets. On other platforms it
+        # works for pipes and sockets. (Exception: OS X 10.4?  Issue #19294.)
+        if is_socket or not sys.platform.startswith("aix"):
+            # only start reading when connection_made() has been called
+            self._loop.call_soon(self._loop.add_reader,
+                                 self._fileno, self._read_ready)
+
+        if waiter is not None:
+            # only wake up the waiter when connection_made() has been called
+            self._loop.call_soon(waiter._set_result_unless_cancelled, None)
+
+    def __repr__(self):
+        info = [self.__class__.__name__]
+        if self._pipe is None:
+            info.append('closed')
+        elif self._closing:
+            info.append('closing')
+        info.append('fd=%s' % self._fileno)
+        if self._pipe is not None:
+            polling = selector_events._test_selector_event(
+                          self._loop._selector,
+                          self._fileno, selectors.EVENT_WRITE)
+            if polling:
+                info.append('polling')
+            else:
+                info.append('idle')
+
+            bufsize = self.get_write_buffer_size()
+            info.append('bufsize=%s' % bufsize)
+        else:
+            info.append('closed')
+        return '<%s>' % ' '.join(info)
+
+    def get_write_buffer_size(self):
+        return sum(len(data) for data in self._buffer)
+
+    def _read_ready(self):
+        # Pipe was closed by peer.
+        if self._loop.get_debug():
+            logger.info("%r was closed by peer", self)
+        if self._buffer:
+            self._close(BrokenPipeError())
+        else:
+            self._close()
+
+    def write(self, data):
+        assert isinstance(data, (bytes, bytearray, memoryview)), repr(data)
+        if isinstance(data, bytearray):
+            data = memoryview(data)
+        if not data:
+            return
+
+        if self._conn_lost or self._closing:
+            if self._conn_lost >= constants.LOG_THRESHOLD_FOR_CONNLOST_WRITES:
+                logger.warning('pipe closed by peer or '
+                               'os.write(pipe, data) raised exception.')
+            self._conn_lost += 1
+            return
+
+        if not self._buffer:
+            # Attempt to send it right away first.
+            try:
+                n = os.write(self._fileno, data)
+            except (BlockingIOError, InterruptedError):
+                n = 0
+            except Exception as exc:
+                self._conn_lost += 1
+                self._fatal_error(exc, 'Fatal write error on pipe transport')
+                return
+            if n == len(data):
+                return
+            elif n > 0:
+                data = data[n:]
+            self._loop.add_writer(self._fileno, self._write_ready)
+
+        self._buffer.append(data)
+        self._maybe_pause_protocol()
+
+    def _write_ready(self):
+        data = b''.join(self._buffer)
+        assert data, 'Data should not be empty'
+
+        self._buffer.clear()
+        try:
+            n = os.write(self._fileno, data)
+        except (BlockingIOError, InterruptedError):
+            self._buffer.append(data)
+        except Exception as exc:
+            self._conn_lost += 1
+            # Remove writer here, _fatal_error() doesn't it
+            # because _buffer is empty.
+            self._loop.remove_writer(self._fileno)
+            self._fatal_error(exc, 'Fatal write error on pipe transport')
+        else:
+            if n == len(data):
+                self._loop.remove_writer(self._fileno)
+                self._maybe_resume_protocol()  # May append to buffer.
+                if not self._buffer and self._closing:
+                    self._loop.remove_reader(self._fileno)
+                    self._call_connection_lost(None)
+                return
+            elif n > 0:
+                data = data[n:]
+
+            self._buffer.append(data)  # Try again later.
+
+    def can_write_eof(self):
+        return True
+
+    def write_eof(self):
+        if self._closing:
+            return
+        assert self._pipe
+        self._closing = True
+        if not self._buffer:
+            self._loop.remove_reader(self._fileno)
+            self._loop.call_soon(self._call_connection_lost, None)
+
+    def close(self):
+        if self._pipe is not None and not self._closing:
+            # write_eof is all what we needed to close the write pipe
+            self.write_eof()
+
+    # On Python 3.3 and older, objects with a destructor part of a reference
+    # cycle are never destroyed. It's not more the case on Python 3.4 thanks
+    # to the PEP 442.
+    if sys.version_info >= (3, 4):
+        def __del__(self):
+            if self._pipe is not None:
+                warnings.warn("unclosed transport %r" % self, ResourceWarning)
+                self._pipe.close()
+
+    def abort(self):
+        self._close(None)
+
+    def _fatal_error(self, exc, message='Fatal error on pipe transport'):
+        # should be called by exception handler only
+        if isinstance(exc, (BrokenPipeError, ConnectionResetError)):
+            if self._loop.get_debug():
+                logger.debug("%r: %s", self, message, exc_info=True)
+        else:
+            self._loop.call_exception_handler({
+                'message': message,
+                'exception': exc,
+                'transport': self,
+                'protocol': self._protocol,
+            })
+        self._close(exc)
+
+    def _close(self, exc=None):
+        self._closing = True
+        if self._buffer:
+            self._loop.remove_writer(self._fileno)
+        self._buffer.clear()
+        self._loop.remove_reader(self._fileno)
+        self._loop.call_soon(self._call_connection_lost, exc)
+
+    def _call_connection_lost(self, exc):
+        try:
+            self._protocol.connection_lost(exc)
+        finally:
+            self._pipe.close()
+            self._pipe = None
+            self._protocol = None
+            self._loop = None
+
+
+if hasattr(os, 'set_inheritable'):
+    # Python 3.4 and newer
+    _set_inheritable = os.set_inheritable
+else:
+    import fcntl
+
+    def _set_inheritable(fd, inheritable):
+        cloexec_flag = getattr(fcntl, 'FD_CLOEXEC', 1)
+
+        old = fcntl.fcntl(fd, fcntl.F_GETFD)
+        if not inheritable:
+            fcntl.fcntl(fd, fcntl.F_SETFD, old | cloexec_flag)
+        else:
+            fcntl.fcntl(fd, fcntl.F_SETFD, old & ~cloexec_flag)
+
+
+class _UnixSubprocessTransport(base_subprocess.BaseSubprocessTransport):
+
+    def _start(self, args, shell, stdin, stdout, stderr, bufsize, **kwargs):
+        stdin_w = None
+        if stdin == subprocess.PIPE:
+            # Use a socket pair for stdin, since not all platforms
+            # support selecting read events on the write end of a
+            # socket (which we use in order to detect closing of the
+            # other end).  Notably this is needed on AIX, and works
+            # just fine on other platforms.
+            stdin, stdin_w = self._loop._socketpair()
+
+            # Mark the write end of the stdin pipe as non-inheritable,
+            # needed by close_fds=False on Python 3.3 and older
+            # (Python 3.4 implements the PEP 446, socketpair returns
+            # non-inheritable sockets)
+            _set_inheritable(stdin_w.fileno(), False)
+        self._proc = subprocess.Popen(
+            args, shell=shell, stdin=stdin, stdout=stdout, stderr=stderr,
+            universal_newlines=False, bufsize=bufsize, **kwargs)
+        if stdin_w is not None:
+            stdin.close()
+            self._proc.stdin = open(stdin_w.detach(), 'wb', buffering=bufsize)
+
+
+class AbstractChildWatcher:
+    """Abstract base class for monitoring child processes.
+
+    Objects derived from this class monitor a collection of subprocesses and
+    report their termination or interruption by a signal.
+
+    New callbacks are registered with .add_child_handler(). Starting a new
+    process must be done within a 'with' block to allow the watcher to suspend
+    its activity until the new process if fully registered (this is needed to
+    prevent a race condition in some implementations).
+
+    Example:
+        with watcher:
+            proc = subprocess.Popen("sleep 1")
+            watcher.add_child_handler(proc.pid, callback)
+
+    Notes:
+        Implementations of this class must be thread-safe.
+
+        Since child watcher objects may catch the SIGCHLD signal and call
+        waitpid(-1), there should be only one active object per process.
+    """
+
+    def add_child_handler(self, pid, callback, *args):
+        """Register a new child handler.
+
+        Arrange for callback(pid, returncode, *args) to be called when
+        process 'pid' terminates. Specifying another callback for the same
+        process replaces the previous handler.
+
+        Note: callback() must be thread-safe.
+        """
+        raise NotImplementedError()
+
+    def remove_child_handler(self, pid):
+        """Removes the handler for process 'pid'.
+
+        The function returns True if the handler was successfully removed,
+        False if there was nothing to remove."""
+
+        raise NotImplementedError()
+
+    def attach_loop(self, loop):
+        """Attach the watcher to an event loop.
+
+        If the watcher was previously attached to an event loop, then it is
+        first detached before attaching to the new loop.
+
+        Note: loop may be None.
+        """
+        raise NotImplementedError()
+
+    def close(self):
+        """Close the watcher.
+
+        This must be called to make sure that any underlying resource is freed.
+        """
+        raise NotImplementedError()
+
+    def __enter__(self):
+        """Enter the watcher's context and allow starting new processes
+
+        This function must return self"""
+        raise NotImplementedError()
+
+    def __exit__(self, a, b, c):
+        """Exit the watcher's context"""
+        raise NotImplementedError()
+
+
+class BaseChildWatcher(AbstractChildWatcher):
+
+    def __init__(self):
+        self._loop = None
+
+    def close(self):
+        self.attach_loop(None)
+
+    def _do_waitpid(self, expected_pid):
+        raise NotImplementedError()
+
+    def _do_waitpid_all(self):
+        raise NotImplementedError()
+
+    def attach_loop(self, loop):
+        assert loop is None or isinstance(loop, events.AbstractEventLoop)
+
+        if self._loop is not None:
+            self._loop.remove_signal_handler(signal.SIGCHLD)
+
+        self._loop = loop
+        if loop is not None:
+            loop.add_signal_handler(signal.SIGCHLD, self._sig_chld)
+
+            # Prevent a race condition in case a child terminated
+            # during the switch.
+            self._do_waitpid_all()
+
+    def _sig_chld(self):
+        try:
+            self._do_waitpid_all()
+        except Exception as exc:
+            # self._loop should always be available here
+            # as '_sig_chld' is added as a signal handler
+            # in 'attach_loop'
+            self._loop.call_exception_handler({
+                'message': 'Unknown exception in SIGCHLD handler',
+                'exception': exc,
+            })
+
+    def _compute_returncode(self, status):
+        if os.WIFSIGNALED(status):
+            # The child process died because of a signal.
+            return -os.WTERMSIG(status)
+        elif os.WIFEXITED(status):
+            # The child process exited (e.g sys.exit()).
+            return os.WEXITSTATUS(status)
+        else:
+            # The child exited, but we don't understand its status.
+            # This shouldn't happen, but if it does, let's just
+            # return that status; perhaps that helps debug it.
+            return status
+
+
+class SafeChildWatcher(BaseChildWatcher):
+    """'Safe' child watcher implementation.
+
+    This implementation avoids disrupting other code spawning processes by
+    polling explicitly each process in the SIGCHLD handler instead of calling
+    os.waitpid(-1).
+
+    This is a safe solution but it has a significant overhead when handling a
+    big number of children (O(n) each time SIGCHLD is raised)
+    """
+
+    def __init__(self):
+        super().__init__()
+        self._callbacks = {}
+
+    def close(self):
+        self._callbacks.clear()
+        super().close()
+
+    def __enter__(self):
+        return self
+
+    def __exit__(self, a, b, c):
+        pass
+
+    def add_child_handler(self, pid, callback, *args):
+        self._callbacks[pid] = (callback, args)
+
+        # Prevent a race condition in case the child is already terminated.
+        self._do_waitpid(pid)
+
+    def remove_child_handler(self, pid):
+        try:
+            del self._callbacks[pid]
+            return True
+        except KeyError:
+            return False
+
+    def _do_waitpid_all(self):
+
+        for pid in list(self._callbacks):
+            self._do_waitpid(pid)
+
+    def _do_waitpid(self, expected_pid):
+        assert expected_pid > 0
+
+        try:
+            pid, status = os.waitpid(expected_pid, os.WNOHANG)
+        except ChildProcessError:
+            # The child process is already reaped
+            # (may happen if waitpid() is called elsewhere).
+            pid = expected_pid
+            returncode = 255
+            logger.warning(
+                "Unknown child process pid %d, will report returncode 255",
+                pid)
+        else:
+            if pid == 0:
+                # The child process is still alive.
+                return
+
+            returncode = self._compute_returncode(status)
+            if self._loop.get_debug():
+                logger.debug('process %s exited with returncode %s',
+                             expected_pid, returncode)
+
+        try:
+            callback, args = self._callbacks.pop(pid)
+        except KeyError:  # pragma: no cover
+            # May happen if .remove_child_handler() is called
+            # after os.waitpid() returns.
+            if self._loop.get_debug():
+                logger.warning("Child watcher got an unexpected pid: %r",
+                               pid, exc_info=True)
+        else:
+            callback(pid, returncode, *args)
+
+
+class FastChildWatcher(BaseChildWatcher):
+    """'Fast' child watcher implementation.
+
+    This implementation reaps every terminated processes by calling
+    os.waitpid(-1) directly, possibly breaking other code spawning processes
+    and waiting for their termination.
+
+    There is no noticeable overhead when handling a big number of children
+    (O(1) each time a child terminates).
+    """
+    def __init__(self):
+        super().__init__()
+        self._callbacks = {}
+        self._lock = threading.Lock()
+        self._zombies = {}
+        self._forks = 0
+
+    def close(self):
+        self._callbacks.clear()
+        self._zombies.clear()
+        super().close()
+
+    def __enter__(self):
+        with self._lock:
+            self._forks += 1
+
+            return self
+
+    def __exit__(self, a, b, c):
+        with self._lock:
+            self._forks -= 1
+
+            if self._forks or not self._zombies:
+                return
+
+            collateral_victims = str(self._zombies)
+            self._zombies.clear()
+
+        logger.warning(
+            "Caught subprocesses termination from unknown pids: %s",
+            collateral_victims)
+
+    def add_child_handler(self, pid, callback, *args):
+        assert self._forks, "Must use the context manager"
+        with self._lock:
+            try:
+                returncode = self._zombies.pop(pid)
+            except KeyError:
+                # The child is running.
+                self._callbacks[pid] = callback, args
+                return
+
+        # The child is dead already. We can fire the callback.
+        callback(pid, returncode, *args)
+
+    def remove_child_handler(self, pid):
+        try:
+            del self._callbacks[pid]
+            return True
+        except KeyError:
+            return False
+
+    def _do_waitpid_all(self):
+        # Because of signal coalescing, we must keep calling waitpid() as
+        # long as we're able to reap a child.
+        while True:
+            try:
+                pid, status = os.waitpid(-1, os.WNOHANG)
+            except ChildProcessError:
+                # No more child processes exist.
+                return
+            else:
+                if pid == 0:
+                    # A child process is still alive.
+                    return
+
+                returncode = self._compute_returncode(status)
+
+            with self._lock:
+                try:
+                    callback, args = self._callbacks.pop(pid)
+                except KeyError:
+                    # unknown child
+                    if self._forks:
+                        # It may not be registered yet.
+                        self._zombies[pid] = returncode
+                        if self._loop.get_debug():
+                            logger.debug('unknown process %s exited '
+                                         'with returncode %s',
+                                         pid, returncode)
+                        continue
+                    callback = None
+                else:
+                    if self._loop.get_debug():
+                        logger.debug('process %s exited with returncode %s',
+                                     pid, returncode)
+
+            if callback is None:
+                logger.warning(
+                    "Caught subprocess termination from unknown pid: "
+                    "%d -> %d", pid, returncode)
+            else:
+                callback(pid, returncode, *args)
+
+
+class _UnixDefaultEventLoopPolicy(events.BaseDefaultEventLoopPolicy):
+    """UNIX event loop policy with a watcher for child processes."""
+    _loop_factory = _UnixSelectorEventLoop
+
+    def __init__(self):
+        super().__init__()
+        self._watcher = None
+
+    def _init_watcher(self):
+        with events._lock:
+            if self._watcher is None:  # pragma: no branch
+                self._watcher = SafeChildWatcher()
+                if isinstance(threading.current_thread(),
+                              threading._MainThread):
+                    self._watcher.attach_loop(self._local._loop)
+
+    def set_event_loop(self, loop):
+        """Set the event loop.
+
+        As a side effect, if a child watcher was set before, then calling
+        .set_event_loop() from the main thread will call .attach_loop(loop) on
+        the child watcher.
+        """
+
+        super().set_event_loop(loop)
+
+        if self._watcher is not None and \
+            isinstance(threading.current_thread(), threading._MainThread):
+            self._watcher.attach_loop(loop)
+
+    def get_child_watcher(self):
+        """Get the watcher for child processes.
+
+        If not yet set, a SafeChildWatcher object is automatically created.
+        """
+        if self._watcher is None:
+            self._init_watcher()
+
+        return self._watcher
+
+    def set_child_watcher(self, watcher):
+        """Set the watcher for child processes."""
+
+        assert watcher is None or isinstance(watcher, AbstractChildWatcher)
+
+        if self._watcher is not None:
+            self._watcher.close()
+
+        self._watcher = watcher
+
+SelectorEventLoop = _UnixSelectorEventLoop
+DefaultEventLoopPolicy = _UnixDefaultEventLoopPolicy
diff --git a/Lib/asyncio/windows_events.py b/Lib/asyncio/windows_events.py
new file mode 100644
index 0000000..f311e46
--- /dev/null
+++ b/Lib/asyncio/windows_events.py
@@ -0,0 +1,774 @@
+"""Selector and proactor event loops for Windows."""
+
+import _winapi
+import errno
+import math
+import socket
+import struct
+import weakref
+
+from . import events
+from . import base_subprocess
+from . import futures
+from . import proactor_events
+from . import selector_events
+from . import tasks
+from . import windows_utils
+from . import _overlapped
+from .coroutines import coroutine
+from .log import logger
+
+
+__all__ = ['SelectorEventLoop', 'ProactorEventLoop', 'IocpProactor',
+           'DefaultEventLoopPolicy',
+           ]
+
+
+NULL = 0
+INFINITE = 0xffffffff
+ERROR_CONNECTION_REFUSED = 1225
+ERROR_CONNECTION_ABORTED = 1236
+
+# Initial delay in seconds for connect_pipe() before retrying to connect
+CONNECT_PIPE_INIT_DELAY = 0.001
+
+# Maximum delay in seconds for connect_pipe() before retrying to connect
+CONNECT_PIPE_MAX_DELAY = 0.100
+
+
+class _OverlappedFuture(futures.Future):
+    """Subclass of Future which represents an overlapped operation.
+
+    Cancelling it will immediately cancel the overlapped operation.
+    """
+
+    def __init__(self, ov, *, loop=None):
+        super().__init__(loop=loop)
+        if self._source_traceback:
+            del self._source_traceback[-1]
+        self._ov = ov
+
+    def _repr_info(self):
+        info = super()._repr_info()
+        if self._ov is not None:
+            state = 'pending' if self._ov.pending else 'completed'
+            info.insert(1, 'overlapped=<%s, %#x>' % (state, self._ov.address))
+        return info
+
+    def _cancel_overlapped(self):
+        if self._ov is None:
+            return
+        try:
+            self._ov.cancel()
+        except OSError as exc:
+            context = {
+                'message': 'Cancelling an overlapped future failed',
+                'exception': exc,
+                'future': self,
+            }
+            if self._source_traceback:
+                context['source_traceback'] = self._source_traceback
+            self._loop.call_exception_handler(context)
+        self._ov = None
+
+    def cancel(self):
+        self._cancel_overlapped()
+        return super().cancel()
+
+    def set_exception(self, exception):
+        super().set_exception(exception)
+        self._cancel_overlapped()
+
+    def set_result(self, result):
+        super().set_result(result)
+        self._ov = None
+
+
+class _BaseWaitHandleFuture(futures.Future):
+    """Subclass of Future which represents a wait handle."""
+
+    def __init__(self, ov, handle, wait_handle, *, loop=None):
+        super().__init__(loop=loop)
+        if self._source_traceback:
+            del self._source_traceback[-1]
+        # Keep a reference to the Overlapped object to keep it alive until the
+        # wait is unregistered
+        self._ov = ov
+        self._handle = handle
+        self._wait_handle = wait_handle
+
+        # Should we call UnregisterWaitEx() if the wait completes
+        # or is cancelled?
+        self._registered = True
+
+    def _poll(self):
+        # non-blocking wait: use a timeout of 0 millisecond
+        return (_winapi.WaitForSingleObject(self._handle, 0) ==
+                _winapi.WAIT_OBJECT_0)
+
+    def _repr_info(self):
+        info = super()._repr_info()
+        info.append('handle=%#x' % self._handle)
+        if self._handle is not None:
+            state = 'signaled' if self._poll() else 'waiting'
+            info.append(state)
+        if self._wait_handle is not None:
+            info.append('wait_handle=%#x' % self._wait_handle)
+        return info
+
+    def _unregister_wait_cb(self, fut):
+        # The wait was unregistered: it's not safe to destroy the Overlapped
+        # object
+        self._ov = None
+
+    def _unregister_wait(self):
+        if not self._registered:
+            return
+        self._registered = False
+
+        wait_handle = self._wait_handle
+        self._wait_handle = None
+        try:
+            _overlapped.UnregisterWait(wait_handle)
+        except OSError as exc:
+            if exc.winerror != _overlapped.ERROR_IO_PENDING:
+                context = {
+                    'message': 'Failed to unregister the wait handle',
+                    'exception': exc,
+                    'future': self,
+                }
+                if self._source_traceback:
+                    context['source_traceback'] = self._source_traceback
+                self._loop.call_exception_handler(context)
+                return
+            # ERROR_IO_PENDING means that the unregister is pending
+
+        self._unregister_wait_cb(None)
+
+    def cancel(self):
+        self._unregister_wait()
+        return super().cancel()
+
+    def set_exception(self, exception):
+        self._unregister_wait()
+        super().set_exception(exception)
+
+    def set_result(self, result):
+        self._unregister_wait()
+        super().set_result(result)
+
+
+class _WaitCancelFuture(_BaseWaitHandleFuture):
+    """Subclass of Future which represents a wait for the cancellation of a
+    _WaitHandleFuture using an event.
+    """
+
+    def __init__(self, ov, event, wait_handle, *, loop=None):
+        super().__init__(ov, event, wait_handle, loop=loop)
+
+        self._done_callback = None
+
+    def cancel(self):
+        raise RuntimeError("_WaitCancelFuture must not be cancelled")
+
+    def _schedule_callbacks(self):
+        super(_WaitCancelFuture, self)._schedule_callbacks()
+        if self._done_callback is not None:
+            self._done_callback(self)
+
+
+class _WaitHandleFuture(_BaseWaitHandleFuture):
+    def __init__(self, ov, handle, wait_handle, proactor, *, loop=None):
+        super().__init__(ov, handle, wait_handle, loop=loop)
+        self._proactor = proactor
+        self._unregister_proactor = True
+        self._event = _overlapped.CreateEvent(None, True, False, None)
+        self._event_fut = None
+
+    def _unregister_wait_cb(self, fut):
+        if self._event is not None:
+            _winapi.CloseHandle(self._event)
+            self._event = None
+            self._event_fut = None
+
+        # If the wait was cancelled, the wait may never be signalled, so
+        # it's required to unregister it. Otherwise, IocpProactor.close() will
+        # wait forever for an event which will never come.
+        #
+        # If the IocpProactor already received the event, it's safe to call
+        # _unregister() because we kept a reference to the Overlapped object
+        # which is used as an unique key.
+        self._proactor._unregister(self._ov)
+        self._proactor = None
+
+        super()._unregister_wait_cb(fut)
+
+    def _unregister_wait(self):
+        if not self._registered:
+            return
+        self._registered = False
+
+        wait_handle = self._wait_handle
+        self._wait_handle = None
+        try:
+            _overlapped.UnregisterWaitEx(wait_handle, self._event)
+        except OSError as exc:
+            if exc.winerror != _overlapped.ERROR_IO_PENDING:
+                context = {
+                    'message': 'Failed to unregister the wait handle',
+                    'exception': exc,
+                    'future': self,
+                }
+                if self._source_traceback:
+                    context['source_traceback'] = self._source_traceback
+                self._loop.call_exception_handler(context)
+                return
+            # ERROR_IO_PENDING is not an error, the wait was unregistered
+
+        self._event_fut = self._proactor._wait_cancel(self._event,
+                                                      self._unregister_wait_cb)
+
+
+class PipeServer(object):
+    """Class representing a pipe server.
+
+    This is much like a bound, listening socket.
+    """
+    def __init__(self, address):
+        self._address = address
+        self._free_instances = weakref.WeakSet()
+        # initialize the pipe attribute before calling _server_pipe_handle()
+        # because this function can raise an exception and the destructor calls
+        # the close() method
+        self._pipe = None
+        self._accept_pipe_future = None
+        self._pipe = self._server_pipe_handle(True)
+
+    def _get_unconnected_pipe(self):
+        # Create new instance and return previous one.  This ensures
+        # that (until the server is closed) there is always at least
+        # one pipe handle for address.  Therefore if a client attempt
+        # to connect it will not fail with FileNotFoundError.
+        tmp, self._pipe = self._pipe, self._server_pipe_handle(False)
+        return tmp
+
+    def _server_pipe_handle(self, first):
+        # Return a wrapper for a new pipe handle.
+        if self.closed():
+            return None
+        flags = _winapi.PIPE_ACCESS_DUPLEX | _winapi.FILE_FLAG_OVERLAPPED
+        if first:
+            flags |= _winapi.FILE_FLAG_FIRST_PIPE_INSTANCE
+        h = _winapi.CreateNamedPipe(
+            self._address, flags,
+            _winapi.PIPE_TYPE_MESSAGE | _winapi.PIPE_READMODE_MESSAGE |
+            _winapi.PIPE_WAIT,
+            _winapi.PIPE_UNLIMITED_INSTANCES,
+            windows_utils.BUFSIZE, windows_utils.BUFSIZE,
+            _winapi.NMPWAIT_WAIT_FOREVER, _winapi.NULL)
+        pipe = windows_utils.PipeHandle(h)
+        self._free_instances.add(pipe)
+        return pipe
+
+    def closed(self):
+        return (self._address is None)
+
+    def close(self):
+        if self._accept_pipe_future is not None:
+            self._accept_pipe_future.cancel()
+            self._accept_pipe_future = None
+        # Close all instances which have not been connected to by a client.
+        if self._address is not None:
+            for pipe in self._free_instances:
+                pipe.close()
+            self._pipe = None
+            self._address = None
+            self._free_instances.clear()
+
+    __del__ = close
+
+
+class _WindowsSelectorEventLoop(selector_events.BaseSelectorEventLoop):
+    """Windows version of selector event loop."""
+
+    def _socketpair(self):
+        return windows_utils.socketpair()
+
+
+class ProactorEventLoop(proactor_events.BaseProactorEventLoop):
+    """Windows version of proactor event loop using IOCP."""
+
+    def __init__(self, proactor=None):
+        if proactor is None:
+            proactor = IocpProactor()
+        super().__init__(proactor)
+
+    def _socketpair(self):
+        return windows_utils.socketpair()
+
+    @coroutine
+    def create_pipe_connection(self, protocol_factory, address):
+        f = self._proactor.connect_pipe(address)
+        pipe = yield from f
+        protocol = protocol_factory()
+        trans = self._make_duplex_pipe_transport(pipe, protocol,
+                                                 extra={'addr': address})
+        return trans, protocol
+
+    @coroutine
+    def start_serving_pipe(self, protocol_factory, address):
+        server = PipeServer(address)
+
+        def loop_accept_pipe(f=None):
+            pipe = None
+            try:
+                if f:
+                    pipe = f.result()
+                    server._free_instances.discard(pipe)
+
+                    if server.closed():
+                        # A client connected before the server was closed:
+                        # drop the client (close the pipe) and exit
+                        pipe.close()
+                        return
+
+                    protocol = protocol_factory()
+                    self._make_duplex_pipe_transport(
+                        pipe, protocol, extra={'addr': address})
+
+                pipe = server._get_unconnected_pipe()
+                if pipe is None:
+                    return
+
+                f = self._proactor.accept_pipe(pipe)
+            except OSError as exc:
+                if pipe and pipe.fileno() != -1:
+                    self.call_exception_handler({
+                        'message': 'Pipe accept failed',
+                        'exception': exc,
+                        'pipe': pipe,
+                    })
+                    pipe.close()
+                elif self._debug:
+                    logger.warning("Accept pipe failed on pipe %r",
+                                   pipe, exc_info=True)
+            except futures.CancelledError:
+                if pipe:
+                    pipe.close()
+            else:
+                server._accept_pipe_future = f
+                f.add_done_callback(loop_accept_pipe)
+
+        self.call_soon(loop_accept_pipe)
+        return [server]
+
+    @coroutine
+    def _make_subprocess_transport(self, protocol, args, shell,
+                                   stdin, stdout, stderr, bufsize,
+                                   extra=None, **kwargs):
+        waiter = futures.Future(loop=self)
+        transp = _WindowsSubprocessTransport(self, protocol, args, shell,
+                                             stdin, stdout, stderr, bufsize,
+                                             waiter=waiter, extra=extra,
+                                             **kwargs)
+        try:
+            yield from waiter
+        except Exception as exc:
+            # Workaround CPython bug #23353: using yield/yield-from in an
+            # except block of a generator doesn't clear properly sys.exc_info()
+            err = exc
+        else:
+            err = None
+
+        if err is not None:
+            transp.close()
+            yield from transp._wait()
+            raise err
+
+        return transp
+
+
+class IocpProactor:
+    """Proactor implementation using IOCP."""
+
+    def __init__(self, concurrency=0xffffffff):
+        self._loop = None
+        self._results = []
+        self._iocp = _overlapped.CreateIoCompletionPort(
+            _overlapped.INVALID_HANDLE_VALUE, NULL, 0, concurrency)
+        self._cache = {}
+        self._registered = weakref.WeakSet()
+        self._unregistered = []
+        self._stopped_serving = weakref.WeakSet()
+
+    def __repr__(self):
+        return ('<%s overlapped#=%s result#=%s>'
+                % (self.__class__.__name__, len(self._cache),
+                   len(self._results)))
+
+    def set_loop(self, loop):
+        self._loop = loop
+
+    def select(self, timeout=None):
+        if not self._results:
+            self._poll(timeout)
+        tmp = self._results
+        self._results = []
+        return tmp
+
+    def _result(self, value):
+        fut = futures.Future(loop=self._loop)
+        fut.set_result(value)
+        return fut
+
+    def recv(self, conn, nbytes, flags=0):
+        self._register_with_iocp(conn)
+        ov = _overlapped.Overlapped(NULL)
+        try:
+            if isinstance(conn, socket.socket):
+                ov.WSARecv(conn.fileno(), nbytes, flags)
+            else:
+                ov.ReadFile(conn.fileno(), nbytes)
+        except BrokenPipeError:
+            return self._result(b'')
+
+        def finish_recv(trans, key, ov):
+            try:
+                return ov.getresult()
+            except OSError as exc:
+                if exc.winerror == _overlapped.ERROR_NETNAME_DELETED:
+                    raise ConnectionResetError(*exc.args)
+                else:
+                    raise
+
+        return self._register(ov, conn, finish_recv)
+
+    def send(self, conn, buf, flags=0):
+        self._register_with_iocp(conn)
+        ov = _overlapped.Overlapped(NULL)
+        if isinstance(conn, socket.socket):
+            ov.WSASend(conn.fileno(), buf, flags)
+        else:
+            ov.WriteFile(conn.fileno(), buf)
+
+        def finish_send(trans, key, ov):
+            try:
+                return ov.getresult()
+            except OSError as exc:
+                if exc.winerror == _overlapped.ERROR_NETNAME_DELETED:
+                    raise ConnectionResetError(*exc.args)
+                else:
+                    raise
+
+        return self._register(ov, conn, finish_send)
+
+    def accept(self, listener):
+        self._register_with_iocp(listener)
+        conn = self._get_accept_socket(listener.family)
+        ov = _overlapped.Overlapped(NULL)
+        ov.AcceptEx(listener.fileno(), conn.fileno())
+
+        def finish_accept(trans, key, ov):
+            ov.getresult()
+            # Use SO_UPDATE_ACCEPT_CONTEXT so getsockname() etc work.
+            buf = struct.pack('@P', listener.fileno())
+            conn.setsockopt(socket.SOL_SOCKET,
+                            _overlapped.SO_UPDATE_ACCEPT_CONTEXT, buf)
+            conn.settimeout(listener.gettimeout())
+            return conn, conn.getpeername()
+
+        @coroutine
+        def accept_coro(future, conn):
+            # Coroutine closing the accept socket if the future is cancelled
+            try:
+                yield from future
+            except futures.CancelledError:
+                conn.close()
+                raise
+
+        future = self._register(ov, listener, finish_accept)
+        coro = accept_coro(future, conn)
+        tasks.async(coro, loop=self._loop)
+        return future
+
+    def connect(self, conn, address):
+        self._register_with_iocp(conn)
+        # The socket needs to be locally bound before we call ConnectEx().
+        try:
+            _overlapped.BindLocal(conn.fileno(), conn.family)
+        except OSError as e:
+            if e.winerror != errno.WSAEINVAL:
+                raise
+            # Probably already locally bound; check using getsockname().
+            if conn.getsockname()[1] == 0:
+                raise
+        ov = _overlapped.Overlapped(NULL)
+        ov.ConnectEx(conn.fileno(), address)
+
+        def finish_connect(trans, key, ov):
+            ov.getresult()
+            # Use SO_UPDATE_CONNECT_CONTEXT so getsockname() etc work.
+            conn.setsockopt(socket.SOL_SOCKET,
+                            _overlapped.SO_UPDATE_CONNECT_CONTEXT, 0)
+            return conn
+
+        return self._register(ov, conn, finish_connect)
+
+    def accept_pipe(self, pipe):
+        self._register_with_iocp(pipe)
+        ov = _overlapped.Overlapped(NULL)
+        connected = ov.ConnectNamedPipe(pipe.fileno())
+
+        if connected:
+            # ConnectNamePipe() failed with ERROR_PIPE_CONNECTED which means
+            # that the pipe is connected. There is no need to wait for the
+            # completion of the connection.
+            return self._result(pipe)
+
+        def finish_accept_pipe(trans, key, ov):
+            ov.getresult()
+            return pipe
+
+        return self._register(ov, pipe, finish_accept_pipe)
+
+    @coroutine
+    def connect_pipe(self, address):
+        delay = CONNECT_PIPE_INIT_DELAY
+        while True:
+            # Unfortunately there is no way to do an overlapped connect to a pipe.
+            # Call CreateFile() in a loop until it doesn't fail with
+            # ERROR_PIPE_BUSY
+            try:
+                handle = _overlapped.ConnectPipe(address)
+                break
+            except OSError as exc:
+                if exc.winerror != _overlapped.ERROR_PIPE_BUSY:
+                    raise
+
+            # ConnectPipe() failed with ERROR_PIPE_BUSY: retry later
+            delay = min(delay * 2, CONNECT_PIPE_MAX_DELAY)
+            yield from tasks.sleep(delay, loop=self._loop)
+
+        return windows_utils.PipeHandle(handle)
+
+    def wait_for_handle(self, handle, timeout=None):
+        """Wait for a handle.
+
+        Return a Future object. The result of the future is True if the wait
+        completed, or False if the wait did not complete (on timeout).
+        """
+        return self._wait_for_handle(handle, timeout, False)
+
+    def _wait_cancel(self, event, done_callback):
+        fut = self._wait_for_handle(event, None, True)
+        # add_done_callback() cannot be used because the wait may only complete
+        # in IocpProactor.close(), while the event loop is not running.
+        fut._done_callback = done_callback
+        return fut
+
+    def _wait_for_handle(self, handle, timeout, _is_cancel):
+        if timeout is None:
+            ms = _winapi.INFINITE
+        else:
+            # RegisterWaitForSingleObject() has a resolution of 1 millisecond,
+            # round away from zero to wait *at least* timeout seconds.
+            ms = math.ceil(timeout * 1e3)
+
+        # We only create ov so we can use ov.address as a key for the cache.
+        ov = _overlapped.Overlapped(NULL)
+        wait_handle = _overlapped.RegisterWaitWithQueue(
+            handle, self._iocp, ov.address, ms)
+        if _is_cancel:
+            f = _WaitCancelFuture(ov, handle, wait_handle, loop=self._loop)
+        else:
+            f = _WaitHandleFuture(ov, handle, wait_handle, self,
+                                  loop=self._loop)
+        if f._source_traceback:
+            del f._source_traceback[-1]
+
+        def finish_wait_for_handle(trans, key, ov):
+            # Note that this second wait means that we should only use
+            # this with handles types where a successful wait has no
+            # effect.  So events or processes are all right, but locks
+            # or semaphores are not.  Also note if the handle is
+            # signalled and then quickly reset, then we may return
+            # False even though we have not timed out.
+            return f._poll()
+
+        self._cache[ov.address] = (f, ov, 0, finish_wait_for_handle)
+        return f
+
+    def _register_with_iocp(self, obj):
+        # To get notifications of finished ops on this objects sent to the
+        # completion port, were must register the handle.
+        if obj not in self._registered:
+            self._registered.add(obj)
+            _overlapped.CreateIoCompletionPort(obj.fileno(), self._iocp, 0, 0)
+            # XXX We could also use SetFileCompletionNotificationModes()
+            # to avoid sending notifications to completion port of ops
+            # that succeed immediately.
+
+    def _register(self, ov, obj, callback):
+        # Return a future which will be set with the result of the
+        # operation when it completes.  The future's value is actually
+        # the value returned by callback().
+        f = _OverlappedFuture(ov, loop=self._loop)
+        if f._source_traceback:
+            del f._source_traceback[-1]
+        if not ov.pending:
+            # The operation has completed, so no need to postpone the
+            # work.  We cannot take this short cut if we need the
+            # NumberOfBytes, CompletionKey values returned by
+            # PostQueuedCompletionStatus().
+            try:
+                value = callback(None, None, ov)
+            except OSError as e:
+                f.set_exception(e)
+            else:
+                f.set_result(value)
+            # Even if GetOverlappedResult() was called, we have to wait for the
+            # notification of the completion in GetQueuedCompletionStatus().
+            # Register the overlapped operation to keep a reference to the
+            # OVERLAPPED object, otherwise the memory is freed and Windows may
+            # read uninitialized memory.
+
+        # Register the overlapped operation for later.  Note that
+        # we only store obj to prevent it from being garbage
+        # collected too early.
+        self._cache[ov.address] = (f, ov, obj, callback)
+        return f
+
+    def _unregister(self, ov):
+        """Unregister an overlapped object.
+
+        Call this method when its future has been cancelled. The event can
+        already be signalled (pending in the proactor event queue). It is also
+        safe if the event is never signalled (because it was cancelled).
+        """
+        self._unregistered.append(ov)
+
+    def _get_accept_socket(self, family):
+        s = socket.socket(family)
+        s.settimeout(0)
+        return s
+
+    def _poll(self, timeout=None):
+        if timeout is None:
+            ms = INFINITE
+        elif timeout < 0:
+            raise ValueError("negative timeout")
+        else:
+            # GetQueuedCompletionStatus() has a resolution of 1 millisecond,
+            # round away from zero to wait *at least* timeout seconds.
+            ms = math.ceil(timeout * 1e3)
+            if ms >= INFINITE:
+                raise ValueError("timeout too big")
+
+        while True:
+            status = _overlapped.GetQueuedCompletionStatus(self._iocp, ms)
+            if status is None:
+                break
+            ms = 0
+
+            err, transferred, key, address = status
+            try:
+                f, ov, obj, callback = self._cache.pop(address)
+            except KeyError:
+                if self._loop.get_debug():
+                    self._loop.call_exception_handler({
+                        'message': ('GetQueuedCompletionStatus() returned an '
+                                    'unexpected event'),
+                        'status': ('err=%s transferred=%s key=%#x address=%#x'
+                                   % (err, transferred, key, address)),
+                    })
+
+                # key is either zero, or it is used to return a pipe
+                # handle which should be closed to avoid a leak.
+                if key not in (0, _overlapped.INVALID_HANDLE_VALUE):
+                    _winapi.CloseHandle(key)
+                continue
+
+            if obj in self._stopped_serving:
+                f.cancel()
+            # Don't call the callback if _register() already read the result or
+            # if the overlapped has been cancelled
+            elif not f.done():
+                try:
+                    value = callback(transferred, key, ov)
+                except OSError as e:
+                    f.set_exception(e)
+                    self._results.append(f)
+                else:
+                    f.set_result(value)
+                    self._results.append(f)
+
+        # Remove unregisted futures
+        for ov in self._unregistered:
+            self._cache.pop(ov.address, None)
+        self._unregistered.clear()
+
+    def _stop_serving(self, obj):
+        # obj is a socket or pipe handle.  It will be closed in
+        # BaseProactorEventLoop._stop_serving() which will make any
+        # pending operations fail quickly.
+        self._stopped_serving.add(obj)
+
+    def close(self):
+        # Cancel remaining registered operations.
+        for address, (fut, ov, obj, callback) in list(self._cache.items()):
+            if fut.cancelled():
+                # Nothing to do with cancelled futures
+                pass
+            elif isinstance(fut, _WaitCancelFuture):
+                # _WaitCancelFuture must not be cancelled
+                pass
+            else:
+                try:
+                    fut.cancel()
+                except OSError as exc:
+                    if self._loop is not None:
+                        context = {
+                            'message': 'Cancelling a future failed',
+                            'exception': exc,
+                            'future': fut,
+                        }
+                        if fut._source_traceback:
+                            context['source_traceback'] = fut._source_traceback
+                        self._loop.call_exception_handler(context)
+
+        while self._cache:
+            if not self._poll(1):
+                logger.debug('taking long time to close proactor')
+
+        self._results = []
+        if self._iocp is not None:
+            _winapi.CloseHandle(self._iocp)
+            self._iocp = None
+
+    def __del__(self):
+        self.close()
+
+
+class _WindowsSubprocessTransport(base_subprocess.BaseSubprocessTransport):
+
+    def _start(self, args, shell, stdin, stdout, stderr, bufsize, **kwargs):
+        self._proc = windows_utils.Popen(
+            args, shell=shell, stdin=stdin, stdout=stdout, stderr=stderr,
+            bufsize=bufsize, **kwargs)
+
+        def callback(f):
+            returncode = self._proc.poll()
+            self._process_exited(returncode)
+
+        f = self._loop._proactor.wait_for_handle(int(self._proc._handle))
+        f.add_done_callback(callback)
+
+
+SelectorEventLoop = _WindowsSelectorEventLoop
+
+
+class _WindowsDefaultEventLoopPolicy(events.BaseDefaultEventLoopPolicy):
+    _loop_factory = SelectorEventLoop
+
+
+DefaultEventLoopPolicy = _WindowsDefaultEventLoopPolicy
diff --git a/Lib/asyncio/windows_utils.py b/Lib/asyncio/windows_utils.py
new file mode 100644
index 0000000..870cd13
--- /dev/null
+++ b/Lib/asyncio/windows_utils.py
@@ -0,0 +1,223 @@
+"""
+Various Windows specific bits and pieces
+"""
+
+import sys
+
+if sys.platform != 'win32':  # pragma: no cover
+    raise ImportError('win32 only')
+
+import _winapi
+import itertools
+import msvcrt
+import os
+import socket
+import subprocess
+import tempfile
+import warnings
+
+
+__all__ = ['socketpair', 'pipe', 'Popen', 'PIPE', 'PipeHandle']
+
+
+# Constants/globals
+
+
+BUFSIZE = 8192
+PIPE = subprocess.PIPE
+STDOUT = subprocess.STDOUT
+_mmap_counter = itertools.count()
+
+
+if hasattr(socket, 'socketpair'):
+    # Since Python 3.5, socket.socketpair() is now also available on Windows
+    socketpair = socket.socketpair
+else:
+    # Replacement for socket.socketpair()
+    def socketpair(family=socket.AF_INET, type=socket.SOCK_STREAM, proto=0):
+        """A socket pair usable as a self-pipe, for Windows.
+
+        Origin: https://gist.github.com/4325783, by Geert Jansen.
+        Public domain.
+        """
+        if family == socket.AF_INET:
+            host = '127.0.0.1'
+        elif family == socket.AF_INET6:
+            host = '::1'
+        else:
+            raise ValueError("Only AF_INET and AF_INET6 socket address "
+                             "families are supported")
+        if type != socket.SOCK_STREAM:
+            raise ValueError("Only SOCK_STREAM socket type is supported")
+        if proto != 0:
+            raise ValueError("Only protocol zero is supported")
+
+        # We create a connected TCP socket. Note the trick with setblocking(0)
+        # that prevents us from having to create a thread.
+        lsock = socket.socket(family, type, proto)
+        try:
+            lsock.bind((host, 0))
+            lsock.listen(1)
+            # On IPv6, ignore flow_info and scope_id
+            addr, port = lsock.getsockname()[:2]
+            csock = socket.socket(family, type, proto)
+            try:
+                csock.setblocking(False)
+                try:
+                    csock.connect((addr, port))
+                except (BlockingIOError, InterruptedError):
+                    pass
+                csock.setblocking(True)
+                ssock, _ = lsock.accept()
+            except:
+                csock.close()
+                raise
+        finally:
+            lsock.close()
+        return (ssock, csock)
+
+
+# Replacement for os.pipe() using handles instead of fds
+
+
+def pipe(*, duplex=False, overlapped=(True, True), bufsize=BUFSIZE):
+    """Like os.pipe() but with overlapped support and using handles not fds."""
+    address = tempfile.mktemp(prefix=r'\\.\pipe\python-pipe-%d-%d-' %
+                              (os.getpid(), next(_mmap_counter)))
+
+    if duplex:
+        openmode = _winapi.PIPE_ACCESS_DUPLEX
+        access = _winapi.GENERIC_READ | _winapi.GENERIC_WRITE
+        obsize, ibsize = bufsize, bufsize
+    else:
+        openmode = _winapi.PIPE_ACCESS_INBOUND
+        access = _winapi.GENERIC_WRITE
+        obsize, ibsize = 0, bufsize
+
+    openmode |= _winapi.FILE_FLAG_FIRST_PIPE_INSTANCE
+
+    if overlapped[0]:
+        openmode |= _winapi.FILE_FLAG_OVERLAPPED
+
+    if overlapped[1]:
+        flags_and_attribs = _winapi.FILE_FLAG_OVERLAPPED
+    else:
+        flags_and_attribs = 0
+
+    h1 = h2 = None
+    try:
+        h1 = _winapi.CreateNamedPipe(
+            address, openmode, _winapi.PIPE_WAIT,
+            1, obsize, ibsize, _winapi.NMPWAIT_WAIT_FOREVER, _winapi.NULL)
+
+        h2 = _winapi.CreateFile(
+            address, access, 0, _winapi.NULL, _winapi.OPEN_EXISTING,
+            flags_and_attribs, _winapi.NULL)
+
+        ov = _winapi.ConnectNamedPipe(h1, overlapped=True)
+        ov.GetOverlappedResult(True)
+        return h1, h2
+    except:
+        if h1 is not None:
+            _winapi.CloseHandle(h1)
+        if h2 is not None:
+            _winapi.CloseHandle(h2)
+        raise
+
+
+# Wrapper for a pipe handle
+
+
+class PipeHandle:
+    """Wrapper for an overlapped pipe handle which is vaguely file-object like.
+
+    The IOCP event loop can use these instead of socket objects.
+    """
+    def __init__(self, handle):
+        self._handle = handle
+
+    def __repr__(self):
+        if self._handle is not None:
+            handle = 'handle=%r' % self._handle
+        else:
+            handle = 'closed'
+        return '<%s %s>' % (self.__class__.__name__, handle)
+
+    @property
+    def handle(self):
+        return self._handle
+
+    def fileno(self):
+        if self._handle is None:
+            raise ValueError("I/O operatioon on closed pipe")
+        return self._handle
+
+    def close(self, *, CloseHandle=_winapi.CloseHandle):
+        if self._handle is not None:
+            CloseHandle(self._handle)
+            self._handle = None
+
+    def __del__(self):
+        if self._handle is not None:
+            warnings.warn("unclosed %r" % self, ResourceWarning)
+            self.close()
+
+    def __enter__(self):
+        return self
+
+    def __exit__(self, t, v, tb):
+        self.close()
+
+
+# Replacement for subprocess.Popen using overlapped pipe handles
+
+
+class Popen(subprocess.Popen):
+    """Replacement for subprocess.Popen using overlapped pipe handles.
+
+    The stdin, stdout, stderr are None or instances of PipeHandle.
+    """
+    def __init__(self, args, stdin=None, stdout=None, stderr=None, **kwds):
+        assert not kwds.get('universal_newlines')
+        assert kwds.get('bufsize', 0) == 0
+        stdin_rfd = stdout_wfd = stderr_wfd = None
+        stdin_wh = stdout_rh = stderr_rh = None
+        if stdin == PIPE:
+            stdin_rh, stdin_wh = pipe(overlapped=(False, True), duplex=True)
+            stdin_rfd = msvcrt.open_osfhandle(stdin_rh, os.O_RDONLY)
+        else:
+            stdin_rfd = stdin
+        if stdout == PIPE:
+            stdout_rh, stdout_wh = pipe(overlapped=(True, False))
+            stdout_wfd = msvcrt.open_osfhandle(stdout_wh, 0)
+        else:
+            stdout_wfd = stdout
+        if stderr == PIPE:
+            stderr_rh, stderr_wh = pipe(overlapped=(True, False))
+            stderr_wfd = msvcrt.open_osfhandle(stderr_wh, 0)
+        elif stderr == STDOUT:
+            stderr_wfd = stdout_wfd
+        else:
+            stderr_wfd = stderr
+        try:
+            super().__init__(args, stdin=stdin_rfd, stdout=stdout_wfd,
+                             stderr=stderr_wfd, **kwds)
+        except:
+            for h in (stdin_wh, stdout_rh, stderr_rh):
+                if h is not None:
+                    _winapi.CloseHandle(h)
+            raise
+        else:
+            if stdin_wh is not None:
+                self.stdin = PipeHandle(stdin_wh)
+            if stdout_rh is not None:
+                self.stdout = PipeHandle(stdout_rh)
+            if stderr_rh is not None:
+                self.stderr = PipeHandle(stderr_rh)
+        finally:
+            if stdin == PIPE:
+                os.close(stdin_rfd)
+            if stdout == PIPE:
+                os.close(stdout_wfd)
+            if stderr == PIPE:
+                os.close(stderr_wfd)
diff --git a/Lib/asyncore.py b/Lib/asyncore.py
index 909d9f6..00a6396 100644
--- a/Lib/asyncore.py
+++ b/Lib/asyncore.py
@@ -112,7 +112,7 @@
             obj.handle_expt_event()
         if flags & (select.POLLHUP | select.POLLERR | select.POLLNVAL):
             obj.handle_close()
-    except socket.error as e:
+    except OSError as e:
         if e.args[0] not in _DISCONNECTED:
             obj.handle_error()
         else:
@@ -240,7 +240,7 @@
             # passed be connected.
             try:
                 self.addr = sock.getpeername()
-            except socket.error as err:
+            except OSError as err:
                 if err.args[0] in (ENOTCONN, EINVAL):
                     # To handle the case where we got an unconnected
                     # socket.
@@ -304,7 +304,7 @@
                 self.socket.getsockopt(socket.SOL_SOCKET,
                                        socket.SO_REUSEADDR) | 1
                 )
-        except socket.error:
+        except OSError:
             pass
 
     # ==================================================
@@ -345,7 +345,7 @@
             self.addr = address
             self.handle_connect_event()
         else:
-            raise socket.error(err, errorcode[err])
+            raise OSError(err, errorcode[err])
 
     def accept(self):
         # XXX can return either an address pair or None
@@ -353,7 +353,7 @@
             conn, addr = self.socket.accept()
         except TypeError:
             return None
-        except socket.error as why:
+        except OSError as why:
             if why.args[0] in (EWOULDBLOCK, ECONNABORTED, EAGAIN):
                 return None
             else:
@@ -365,7 +365,7 @@
         try:
             result = self.socket.send(data)
             return result
-        except socket.error as why:
+        except OSError as why:
             if why.args[0] == EWOULDBLOCK:
                 return 0
             elif why.args[0] in _DISCONNECTED:
@@ -384,7 +384,7 @@
                 return b''
             else:
                 return data
-        except socket.error as why:
+        except OSError as why:
             # winsock sometimes raises ENOTCONN
             if why.args[0] in _DISCONNECTED:
                 self.handle_close()
@@ -397,11 +397,12 @@
         self.accepting = False
         self.connecting = False
         self.del_channel()
-        try:
-            self.socket.close()
-        except socket.error as why:
-            if why.args[0] not in (ENOTCONN, EBADF):
-                raise
+        if self.socket is not None:
+            try:
+                self.socket.close()
+            except OSError as why:
+                if why.args[0] not in (ENOTCONN, EBADF):
+                    raise
 
     # cheap inheritance, used to pass all other attribute
     # references to the underlying socket object.
@@ -443,7 +444,7 @@
     def handle_connect_event(self):
         err = self.socket.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR)
         if err != 0:
-            raise socket.error(err, _strerror(err))
+            raise OSError(err, _strerror(err))
         self.handle_connect()
         self.connected = True
         self.connecting = False
@@ -532,7 +533,7 @@
 
     def initiate_send(self):
         num_sent = 0
-        num_sent = dispatcher.send(self, self.out_buffer[:512])
+        num_sent = dispatcher.send(self, self.out_buffer[:65536])
         self.out_buffer = self.out_buffer[num_sent:]
 
     def handle_write(self):
@@ -613,6 +614,11 @@
         def __init__(self, fd):
             self.fd = os.dup(fd)
 
+        def __del__(self):
+            if self.fd >= 0:
+                warnings.warn("unclosed file %r" % self, ResourceWarning)
+            self.close()
+
         def recv(self, *args):
             return os.read(self.fd, *args)
 
@@ -631,7 +637,10 @@
         write = send
 
         def close(self):
+            if self.fd < 0:
+                return
             os.close(self.fd)
+            self.fd = -1
 
         def fileno(self):
             return self.fd
diff --git a/Lib/base64.py b/Lib/base64.py
index b6e82b6..36c68a6 100755
--- a/Lib/base64.py
+++ b/Lib/base64.py
@@ -1,6 +1,6 @@
 #! /usr/bin/env python3
 
-"""RFC 3548: Base16, Base32, Base64 Data Encodings"""
+"""Base16, Base32, Base64 (RFC 3548), Base85 and Ascii85 data encodings"""
 
 # Modified 04-Oct-1995 by Jack Jansen to use binascii module
 # Modified 30-Dec-2003 by Barry Warsaw to add full RFC 3548 support
@@ -17,6 +17,8 @@
     # Generalized interface for other encodings
     'b64encode', 'b64decode', 'b32encode', 'b32decode',
     'b16encode', 'b16decode',
+    # Base85 and Ascii85 encodings
+    'b85encode', 'b85decode', 'a85encode', 'a85decode',
     # Standard Base64 encoding
     'standard_b64encode', 'standard_b64decode',
     # Some common Base64 alternatives.  As referenced by RFC 3458, see thread
@@ -35,11 +37,13 @@
             return s.encode('ascii')
         except UnicodeEncodeError:
             raise ValueError('string argument should contain only ASCII characters')
-    elif isinstance(s, bytes_types):
+    if isinstance(s, bytes_types):
         return s
-    else:
-        raise TypeError("argument should be bytes or ASCII string, not %s" % s.__class__.__name__)
-
+    try:
+        return memoryview(s).tobytes()
+    except TypeError:
+        raise TypeError("argument should be a bytes-like object or ASCII "
+                        "string, not %r" % s.__class__.__name__) from None
 
 
 # Base64 encoding/decoding uses binascii
@@ -54,14 +58,9 @@
 
     The encoded byte string is returned.
     """
-    if not isinstance(s, bytes_types):
-        raise TypeError("expected bytes, not %s" % s.__class__.__name__)
     # Strip off the trailing newline
     encoded = binascii.b2a_base64(s)[:-1]
     if altchars is not None:
-        if not isinstance(altchars, bytes_types):
-            raise TypeError("expected bytes, not %s"
-                            % altchars.__class__.__name__)
         assert len(altchars) == 2, repr(altchars)
         return encoded.translate(bytes.maketrans(b'+/', altchars))
     return encoded
@@ -138,53 +137,39 @@
 
 
 # Base32 encoding/decoding must be done in Python
-_b32alphabet = {
-    0: b'A',  9: b'J', 18: b'S', 27: b'3',
-    1: b'B', 10: b'K', 19: b'T', 28: b'4',
-    2: b'C', 11: b'L', 20: b'U', 29: b'5',
-    3: b'D', 12: b'M', 21: b'V', 30: b'6',
-    4: b'E', 13: b'N', 22: b'W', 31: b'7',
-    5: b'F', 14: b'O', 23: b'X',
-    6: b'G', 15: b'P', 24: b'Y',
-    7: b'H', 16: b'Q', 25: b'Z',
-    8: b'I', 17: b'R', 26: b'2',
-    }
-
-_b32tab = [v[0] for k, v in sorted(_b32alphabet.items())]
-_b32rev = dict([(v[0], k) for k, v in _b32alphabet.items()])
-
+_b32alphabet = b'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'
+_b32tab2 = None
+_b32rev = None
 
 def b32encode(s):
     """Encode a byte string using Base32.
 
     s is the byte string to encode.  The encoded byte string is returned.
     """
+    global _b32tab2
+    # Delay the initialization of the table to not waste memory
+    # if the function is never called
+    if _b32tab2 is None:
+        b32tab = [bytes((i,)) for i in _b32alphabet]
+        _b32tab2 = [a + b for a in b32tab for b in b32tab]
+        b32tab = None
+
     if not isinstance(s, bytes_types):
-        raise TypeError("expected bytes, not %s" % s.__class__.__name__)
-    quanta, leftover = divmod(len(s), 5)
+        s = memoryview(s).tobytes()
+    leftover = len(s) % 5
     # Pad the last quantum with zero bits if necessary
     if leftover:
         s = s + bytes(5 - leftover)  # Don't use += !
-        quanta += 1
     encoded = bytearray()
-    for i in range(quanta):
-        # c1 and c2 are 16 bits wide, c3 is 8 bits wide.  The intent of this
-        # code is to process the 40 bits in units of 5 bits.  So we take the 1
-        # leftover bit of c1 and tack it onto c2.  Then we take the 2 leftover
-        # bits of c2 and tack them onto c3.  The shifts and masks are intended
-        # to give us values of exactly 5 bits in width.
-        c1, c2, c3 = struct.unpack('!HHB', s[i*5:(i+1)*5])
-        c2 += (c1 & 1) << 16 # 17 bits wide
-        c3 += (c2 & 3) << 8  # 10 bits wide
-        encoded += bytes([_b32tab[c1 >> 11],         # bits 1 - 5
-                          _b32tab[(c1 >> 6) & 0x1f], # bits 6 - 10
-                          _b32tab[(c1 >> 1) & 0x1f], # bits 11 - 15
-                          _b32tab[c2 >> 12],         # bits 16 - 20 (1 - 5)
-                          _b32tab[(c2 >> 7) & 0x1f], # bits 21 - 25 (6 - 10)
-                          _b32tab[(c2 >> 2) & 0x1f], # bits 26 - 30 (11 - 15)
-                          _b32tab[c3 >> 5],          # bits 31 - 35 (1 - 5)
-                          _b32tab[c3 & 0x1f],        # bits 36 - 40 (1 - 5)
-                          ])
+    from_bytes = int.from_bytes
+    b32tab2 = _b32tab2
+    for i in range(0, len(s), 5):
+        c = from_bytes(s[i: i + 5], 'big')
+        encoded += (b32tab2[c >> 30] +           # bits 1 - 10
+                    b32tab2[(c >> 20) & 0x3ff] + # bits 11 - 20
+                    b32tab2[(c >> 10) & 0x3ff] + # bits 21 - 30
+                    b32tab2[c & 0x3ff]           # bits 31 - 40
+                   )
     # Adjust for any leftover partial quanta
     if leftover == 1:
         encoded[-6:] = b'======'
@@ -196,7 +181,6 @@
         encoded[-1:] = b'='
     return bytes(encoded)
 
-
 def b32decode(s, casefold=False, map01=None):
     """Decode a Base32 encoded byte string.
 
@@ -216,9 +200,13 @@
     the input is incorrectly padded or if there are non-alphabet
     characters present in the input.
     """
+    global _b32rev
+    # Delay the initialization of the table to not waste memory
+    # if the function is never called
+    if _b32rev is None:
+        _b32rev = {v: k for k, v in enumerate(_b32alphabet)}
     s = _bytes_from_decode_data(s)
-    quanta, leftover = divmod(len(s), 8)
-    if leftover:
+    if len(s) % 8:
         raise binascii.Error('Incorrect padding')
     # Handle section 2.4 zero and one mapping.  The flag map01 will be either
     # False, or the character to map the digit 1 (one) to.  It should be
@@ -232,42 +220,36 @@
     # Strip off pad characters from the right.  We need to count the pad
     # characters because this will tell us how many null bytes to remove from
     # the end of the decoded string.
-    padchars = 0
-    mo = re.search(b'(?P<pad>[=]*)$', s)
-    if mo:
-        padchars = len(mo.group('pad'))
-        if padchars > 0:
-            s = s[:-padchars]
+    l = len(s)
+    s = s.rstrip(b'=')
+    padchars = l - len(s)
     # Now decode the full quanta
-    parts = []
-    acc = 0
-    shift = 35
-    for c in s:
-        val = _b32rev.get(c)
-        if val is None:
-            raise binascii.Error('Non-base32 digit found')
-        acc += _b32rev[c] << shift
-        shift -= 5
-        if shift < 0:
-            parts.append(binascii.unhexlify(bytes('%010x' % acc, "ascii")))
-            acc = 0
-            shift = 35
+    decoded = bytearray()
+    b32rev = _b32rev
+    for i in range(0, len(s), 8):
+        quanta = s[i: i + 8]
+        acc = 0
+        try:
+            for c in quanta:
+                acc = (acc << 5) + b32rev[c]
+        except KeyError:
+            raise binascii.Error('Non-base32 digit found') from None
+        decoded += acc.to_bytes(5, 'big')
     # Process the last, partial quanta
-    last = binascii.unhexlify(bytes('%010x' % acc, "ascii"))
-    if padchars == 0:
-        last = b''                      # No characters
-    elif padchars == 1:
-        last = last[:-1]
-    elif padchars == 3:
-        last = last[:-2]
-    elif padchars == 4:
-        last = last[:-3]
-    elif padchars == 6:
-        last = last[:-4]
-    else:
-        raise binascii.Error('Incorrect padding')
-    parts.append(last)
-    return b''.join(parts)
+    if padchars:
+        acc <<= 5 * padchars
+        last = acc.to_bytes(5, 'big')
+        if padchars == 1:
+            decoded[-5:] = last[:-1]
+        elif padchars == 3:
+            decoded[-5:] = last[:-2]
+        elif padchars == 4:
+            decoded[-5:] = last[:-3]
+        elif padchars == 6:
+            decoded[-5:] = last[:-4]
+        else:
+            raise binascii.Error('Incorrect padding')
+    return bytes(decoded)
 
 
 
@@ -279,8 +261,6 @@
 
     s is the byte string to encode.  The encoded byte string is returned.
     """
-    if not isinstance(s, bytes_types):
-        raise TypeError("expected bytes, not %s" % s.__class__.__name__)
     return binascii.hexlify(s).upper()
 
 
@@ -302,7 +282,206 @@
         raise binascii.Error('Non-base16 digit found')
     return binascii.unhexlify(s)
 
+#
+# Ascii85 encoding/decoding
+#
 
+_a85chars = None
+_a85chars2 = None
+_A85START = b"<~"
+_A85END = b"~>"
+
+def _85encode(b, chars, chars2, pad=False, foldnuls=False, foldspaces=False):
+    # Helper function for a85encode and b85encode
+    if not isinstance(b, bytes_types):
+        b = memoryview(b).tobytes()
+
+    padding = (-len(b)) % 4
+    if padding:
+        b = b + b'\0' * padding
+    words = struct.Struct('!%dI' % (len(b) // 4)).unpack(b)
+
+    chunks = [b'z' if foldnuls and not word else
+              b'y' if foldspaces and word == 0x20202020 else
+              (chars2[word // 614125] +
+               chars2[word // 85 % 7225] +
+               chars[word % 85])
+              for word in words]
+
+    if padding and not pad:
+        if chunks[-1] == b'z':
+            chunks[-1] = chars[0] * 5
+        chunks[-1] = chunks[-1][:-padding]
+
+    return b''.join(chunks)
+
+def a85encode(b, *, foldspaces=False, wrapcol=0, pad=False, adobe=False):
+    """Encode a byte string using Ascii85.
+
+    b is the byte string to encode. The encoded byte string is returned.
+
+    foldspaces is an optional flag that uses the special short sequence 'y'
+    instead of 4 consecutive spaces (ASCII 0x20) as supported by 'btoa'. This
+    feature is not supported by the "standard" Adobe encoding.
+
+    wrapcol controls whether the output should have newline ('\n') characters
+    added to it. If this is non-zero, each output line will be at most this
+    many characters long.
+
+    pad controls whether the input string is padded to a multiple of 4 before
+    encoding. Note that the btoa implementation always pads.
+
+    adobe controls whether the encoded byte sequence is framed with <~ and ~>,
+    which is used by the Adobe implementation.
+    """
+    global _a85chars, _a85chars2
+    # Delay the initialization of tables to not waste memory
+    # if the function is never called
+    if _a85chars is None:
+        _a85chars = [bytes((i,)) for i in range(33, 118)]
+        _a85chars2 = [(a + b) for a in _a85chars for b in _a85chars]
+
+    result = _85encode(b, _a85chars, _a85chars2, pad, True, foldspaces)
+
+    if adobe:
+        result = _A85START + result
+    if wrapcol:
+        wrapcol = max(2 if adobe else 1, wrapcol)
+        chunks = [result[i: i + wrapcol]
+                  for i in range(0, len(result), wrapcol)]
+        if adobe:
+            if len(chunks[-1]) + 2 > wrapcol:
+                chunks.append(b'')
+        result = b'\n'.join(chunks)
+    if adobe:
+        result += _A85END
+
+    return result
+
+def a85decode(b, *, foldspaces=False, adobe=False, ignorechars=b' \t\n\r\v'):
+    """Decode an Ascii85 encoded byte string.
+
+    s is the byte string to decode.
+
+    foldspaces is a flag that specifies whether the 'y' short sequence should be
+    accepted as shorthand for 4 consecutive spaces (ASCII 0x20). This feature is
+    not supported by the "standard" Adobe encoding.
+
+    adobe controls whether the input sequence is in Adobe Ascii85 format (i.e.
+    is framed with <~ and ~>).
+
+    ignorechars should be a byte string containing characters to ignore from the
+    input. This should only contain whitespace characters, and by default
+    contains all whitespace characters in ASCII.
+    """
+    b = _bytes_from_decode_data(b)
+    if adobe:
+        if not (b.startswith(_A85START) and b.endswith(_A85END)):
+            raise ValueError("Ascii85 encoded byte sequences must be bracketed "
+                             "by {!r} and {!r}".format(_A85START, _A85END))
+        b = b[2:-2] # Strip off start/end markers
+    #
+    # We have to go through this stepwise, so as to ignore spaces and handle
+    # special short sequences
+    #
+    packI = struct.Struct('!I').pack
+    decoded = []
+    decoded_append = decoded.append
+    curr = []
+    curr_append = curr.append
+    curr_clear = curr.clear
+    for x in b + b'u' * 4:
+        if b'!'[0] <= x <= b'u'[0]:
+            curr_append(x)
+            if len(curr) == 5:
+                acc = 0
+                for x in curr:
+                    acc = 85 * acc + (x - 33)
+                try:
+                    decoded_append(packI(acc))
+                except struct.error:
+                    raise ValueError('Ascii85 overflow') from None
+                curr_clear()
+        elif x == b'z'[0]:
+            if curr:
+                raise ValueError('z inside Ascii85 5-tuple')
+            decoded_append(b'\0\0\0\0')
+        elif foldspaces and x == b'y'[0]:
+            if curr:
+                raise ValueError('y inside Ascii85 5-tuple')
+            decoded_append(b'\x20\x20\x20\x20')
+        elif x in ignorechars:
+            # Skip whitespace
+            continue
+        else:
+            raise ValueError('Non-Ascii85 digit found: %c' % x)
+
+    result = b''.join(decoded)
+    padding = 4 - len(curr)
+    if padding:
+        # Throw away the extra padding
+        result = result[:-padding]
+    return result
+
+# The following code is originally taken (with permission) from Mercurial
+
+_b85alphabet = (b"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+                b"abcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~")
+_b85chars = None
+_b85chars2 = None
+_b85dec = None
+
+def b85encode(b, pad=False):
+    """Encode an ASCII-encoded byte array in base85 format.
+
+    If pad is true, the input is padded with "\0" so its length is a multiple of
+    4 characters before encoding.
+    """
+    global _b85chars, _b85chars2
+    # Delay the initialization of tables to not waste memory
+    # if the function is never called
+    if _b85chars is None:
+        _b85chars = [bytes((i,)) for i in _b85alphabet]
+        _b85chars2 = [(a + b) for a in _b85chars for b in _b85chars]
+    return _85encode(b, _b85chars, _b85chars2, pad)
+
+def b85decode(b):
+    """Decode base85-encoded byte array"""
+    global _b85dec
+    # Delay the initialization of tables to not waste memory
+    # if the function is never called
+    if _b85dec is None:
+        _b85dec = [None] * 256
+        for i, c in enumerate(_b85alphabet):
+            _b85dec[c] = i
+
+    b = _bytes_from_decode_data(b)
+    padding = (-len(b)) % 5
+    b = b + b'~' * padding
+    out = []
+    packI = struct.Struct('!I').pack
+    for i in range(0, len(b), 5):
+        chunk = b[i:i + 5]
+        acc = 0
+        try:
+            for c in chunk:
+                acc = acc * 85 + _b85dec[c]
+        except TypeError:
+            for j, c in enumerate(chunk):
+                if _b85dec[c] is None:
+                    raise ValueError('bad base85 character at position %d'
+                                    % (i + j)) from None
+            raise
+        try:
+            out.append(packI(acc))
+        except struct.error:
+            raise ValueError('base85 overflow in hunk starting at byte %d'
+                             % i) from None
+
+    result = b''.join(out)
+    if padding:
+        result = result[:-padding]
+    return result
 
 # Legacy interface.  This code could be cleaned up since I don't believe
 # binascii has any line length limitations.  It just doesn't seem worth it
@@ -335,12 +514,26 @@
         s = binascii.a2b_base64(line)
         output.write(s)
 
+def _input_type_check(s):
+    try:
+        m = memoryview(s)
+    except TypeError as err:
+        msg = "expected bytes-like object, not %s" % s.__class__.__name__
+        raise TypeError(msg) from err
+    if m.format not in ('c', 'b', 'B'):
+        msg = ("expected single byte elements, not %r from %s" %
+                                          (m.format, s.__class__.__name__))
+        raise TypeError(msg)
+    if m.ndim != 1:
+        msg = ("expected 1-D data, not %d-D data from %s" %
+                                          (m.ndim, s.__class__.__name__))
+        raise TypeError(msg)
+
 
 def encodebytes(s):
     """Encode a bytestring into a bytestring containing multiple lines
     of base-64 data."""
-    if not isinstance(s, bytes_types):
-        raise TypeError("expected bytes, not %s" % s.__class__.__name__)
+    _input_type_check(s)
     pieces = []
     for i in range(0, len(s), MAXBINSIZE):
         chunk = s[i : i + MAXBINSIZE]
@@ -357,8 +550,7 @@
 
 def decodebytes(s):
     """Decode a bytestring of base-64 data into a bytestring."""
-    if not isinstance(s, bytes_types):
-        raise TypeError("expected bytes, not %s" % s.__class__.__name__)
+    _input_type_check(s)
     return binascii.a2b_base64(s)
 
 def decodestring(s):
diff --git a/Lib/bdb.py b/Lib/bdb.py
index dd1f428..67a0846 100644
--- a/Lib/bdb.py
+++ b/Lib/bdb.py
@@ -3,6 +3,7 @@
 import fnmatch
 import sys
 import os
+from inspect import CO_GENERATOR
 
 __all__ = ["BdbQuit", "Bdb", "Breakpoint"]
 
@@ -75,24 +76,48 @@
         if not (self.stop_here(frame) or self.break_anywhere(frame)):
             # No need to trace this function
             return # None
+        # Ignore call events in generator except when stepping.
+        if self.stopframe and frame.f_code.co_flags & CO_GENERATOR:
+            return self.trace_dispatch
         self.user_call(frame, arg)
         if self.quitting: raise BdbQuit
         return self.trace_dispatch
 
     def dispatch_return(self, frame, arg):
         if self.stop_here(frame) or frame == self.returnframe:
+            # Ignore return events in generator except when stepping.
+            if self.stopframe and frame.f_code.co_flags & CO_GENERATOR:
+                return self.trace_dispatch
             try:
                 self.frame_returning = frame
                 self.user_return(frame, arg)
             finally:
                 self.frame_returning = None
             if self.quitting: raise BdbQuit
+            # The user issued a 'next' or 'until' command.
+            if self.stopframe is frame and self.stoplineno != -1:
+                self._set_stopinfo(None, None)
         return self.trace_dispatch
 
     def dispatch_exception(self, frame, arg):
         if self.stop_here(frame):
+            # When stepping with next/until/return in a generator frame, skip
+            # the internal StopIteration exception (with no traceback)
+            # triggered by a subiterator run with the 'yield from' statement.
+            if not (frame.f_code.co_flags & CO_GENERATOR
+                    and arg[0] is StopIteration and arg[2] is None):
+                self.user_exception(frame, arg)
+                if self.quitting: raise BdbQuit
+        # Stop at the StopIteration or GeneratorExit exception when the user
+        # has set stopframe in a generator by issuing a return command, or a
+        # next/until command at the last statement in the generator before the
+        # exception.
+        elif (self.stopframe and frame is not self.stopframe
+                and self.stopframe.f_code.co_flags & CO_GENERATOR
+                and arg[0] in (StopIteration, GeneratorExit)):
             self.user_exception(frame, arg)
             if self.quitting: raise BdbQuit
+
         return self.trace_dispatch
 
     # Normally derived classes don't override the following
@@ -115,10 +140,8 @@
             if self.stoplineno == -1:
                 return False
             return frame.f_lineno >= self.stoplineno
-        while frame is not None and frame is not self.stopframe:
-            if frame is self.botframe:
-                return True
-            frame = frame.f_back
+        if not self.stopframe:
+            return True
         return False
 
     def break_here(self, frame):
@@ -207,7 +230,10 @@
 
     def set_return(self, frame):
         """Stop when returning from the given frame."""
-        self._set_stopinfo(frame.f_back, frame)
+        if frame.f_code.co_flags & CO_GENERATOR:
+            self._set_stopinfo(frame, None, -1)
+        else:
+            self._set_stopinfo(frame.f_back, frame)
 
     def set_trace(self, frame=None):
         """Start debugging from `frame`.
diff --git a/Lib/bz2.py b/Lib/bz2.py
index 1de8f3c..6f47bfa 100644
--- a/Lib/bz2.py
+++ b/Lib/bz2.py
@@ -9,7 +9,6 @@
 
 __author__ = "Nadeem Vawda <nadeem.vawda@gmail.com>"
 
-import builtins
 import io
 import warnings
 
@@ -28,6 +27,8 @@
 
 _BUFFER_SIZE = 8192
 
+_builtin_open = open
+
 
 class BZ2File(io.BufferedIOBase):
 
@@ -43,16 +44,17 @@
     def __init__(self, filename, mode="r", buffering=None, compresslevel=9):
         """Open a bzip2-compressed file.
 
-        If filename is a str or bytes object, is gives the name of the file to
-        be opened. Otherwise, it should be a file object, which will be used to
-        read or write the compressed data.
+        If filename is a str or bytes object, it gives the name
+        of the file to be opened. Otherwise, it should be a file object,
+        which will be used to read or write the compressed data.
 
-        mode can be 'r' for reading (default), 'w' for (over)writing, or 'a' for
-        appending. These can equivalently be given as 'rb', 'wb', and 'ab'.
+        mode can be 'r' for reading (default), 'w' for (over)writing,
+        'x' for creating exclusively, or 'a' for appending. These can
+        equivalently be given as 'rb', 'wb', 'xb', and 'ab'.
 
         buffering is ignored. Its use is deprecated.
 
-        If mode is 'w' or 'a', compresslevel can be a number between 1
+        If mode is 'w', 'x' or 'a', compresslevel can be a number between 1
         and 9 specifying the level of compression: 1 produces the least
         compression, and 9 (default) produces the most compression.
 
@@ -85,15 +87,19 @@
             mode = "wb"
             mode_code = _MODE_WRITE
             self._compressor = BZ2Compressor(compresslevel)
+        elif mode in ("x", "xb"):
+            mode = "xb"
+            mode_code = _MODE_WRITE
+            self._compressor = BZ2Compressor(compresslevel)
         elif mode in ("a", "ab"):
             mode = "ab"
             mode_code = _MODE_WRITE
             self._compressor = BZ2Compressor(compresslevel)
         else:
-            raise ValueError("Invalid mode: {!r}".format(mode))
+            raise ValueError("Invalid mode: %r" % (mode,))
 
         if isinstance(filename, (str, bytes)):
-            self._fp = builtins.open(filename, mode)
+            self._fp = _builtin_open(filename, mode)
             self._closefp = True
             self._mode = mode_code
         elif hasattr(filename, "read") or hasattr(filename, "write"):
@@ -189,15 +195,17 @@
 
             if not rawblock:
                 if self._decompressor.eof:
+                    # End-of-stream marker and end of file. We're good.
                     self._mode = _MODE_READ_EOF
                     self._size = self._pos
                     return False
                 else:
+                    # Problem - we were expecting more compressed data.
                     raise EOFError("Compressed file ended before the "
                                    "end-of-stream marker was reached")
 
-            # Continue to next stream.
             if self._decompressor.eof:
+                # Continue to next stream.
                 self._decompressor = BZ2Decompressor()
                 try:
                     self._buffer = self._decompressor.decompress(rawblock)
@@ -419,7 +427,7 @@
                     self._read_all(return_data=False)
                 offset = self._size + offset
             else:
-                raise ValueError("Invalid value for whence: {}".format(whence))
+                raise ValueError("Invalid value for whence: %s" % (whence,))
 
             # Make it so that offset is the number of bytes to skip forward.
             if offset < self._pos:
@@ -443,20 +451,20 @@
          encoding=None, errors=None, newline=None):
     """Open a bzip2-compressed file in binary or text mode.
 
-    The filename argument can be an actual filename (a str or bytes object), or
-    an existing file object to read from or write to.
+    The filename argument can be an actual filename (a str or bytes
+    object), or an existing file object to read from or write to.
 
-    The mode argument can be "r", "rb", "w", "wb", "a" or "ab" for binary mode,
-    or "rt", "wt" or "at" for text mode. The default mode is "rb", and the
-    default compresslevel is 9.
+    The mode argument can be "r", "rb", "w", "wb", "x", "xb", "a" or
+    "ab" for binary mode, or "rt", "wt", "xt" or "at" for text mode.
+    The default mode is "rb", and the default compresslevel is 9.
 
-    For binary mode, this function is equivalent to the BZ2File constructor:
-    BZ2File(filename, mode, compresslevel). In this case, the encoding, errors
-    and newline arguments must not be provided.
+    For binary mode, this function is equivalent to the BZ2File
+    constructor: BZ2File(filename, mode, compresslevel). In this case,
+    the encoding, errors and newline arguments must not be provided.
 
     For text mode, a BZ2File object is created, and wrapped in an
-    io.TextIOWrapper instance with the specified encoding, error handling
-    behavior, and line ending(s).
+    io.TextIOWrapper instance with the specified encoding, error
+    handling behavior, and line ending(s).
 
     """
     if "t" in mode:
diff --git a/Lib/cProfile.py b/Lib/cProfile.py
index c24d45b..1184385 100755
--- a/Lib/cProfile.py
+++ b/Lib/cProfile.py
@@ -7,54 +7,20 @@
 __all__ = ["run", "runctx", "Profile"]
 
 import _lsprof
+import profile as _pyprofile
 
 # ____________________________________________________________
 # Simple interface
 
 def run(statement, filename=None, sort=-1):
-    """Run statement under profiler optionally saving results in filename
-
-    This function takes a single argument that can be passed to the
-    "exec" statement, and an optional file name.  In all cases this
-    routine attempts to "exec" its first argument and gather profiling
-    statistics from the execution. If no file name is present, then this
-    function automatically prints a simple profiling report, sorted by the
-    standard name string (file/line/function-name) that is presented in
-    each line.
-    """
-    prof = Profile()
-    result = None
-    try:
-        try:
-            prof = prof.run(statement)
-        except SystemExit:
-            pass
-    finally:
-        if filename is not None:
-            prof.dump_stats(filename)
-        else:
-            result = prof.print_stats(sort)
-    return result
+    return _pyprofile._Utils(Profile).run(statement, filename, sort)
 
 def runctx(statement, globals, locals, filename=None, sort=-1):
-    """Run statement under profiler, supplying your own globals and locals,
-    optionally saving results in filename.
+    return _pyprofile._Utils(Profile).runctx(statement, globals, locals,
+                                             filename, sort)
 
-    statement and filename have the same semantics as profile.run
-    """
-    prof = Profile()
-    result = None
-    try:
-        try:
-            prof = prof.runctx(statement, globals, locals)
-        except SystemExit:
-            pass
-    finally:
-        if filename is not None:
-            prof.dump_stats(filename)
-        else:
-            result = prof.print_stats(sort)
-    return result
+run.__doc__ = _pyprofile.run.__doc__
+runctx.__doc__ = _pyprofile.runctx.__doc__
 
 # ____________________________________________________________
 
@@ -77,10 +43,9 @@
 
     def dump_stats(self, file):
         import marshal
-        f = open(file, 'wb')
-        self.create_stats()
-        marshal.dump(self.stats, f)
-        f.close()
+        with open(file, 'wb') as f:
+            self.create_stats()
+            marshal.dump(self.stats, f)
 
     def create_stats(self):
         self.disable()
diff --git a/Lib/cgi.py b/Lib/cgi.py
index 0f50d0e..1ef780c 100755
--- a/Lib/cgi.py
+++ b/Lib/cgi.py
@@ -82,7 +82,7 @@
     if logfile and not logfp:
         try:
             logfp = open(logfile, "a")
-        except IOError:
+        except OSError:
             pass
     if not logfp:
         log = nolog
@@ -560,6 +560,12 @@
         else:
             self.read_single()
 
+    def __del__(self):
+        try:
+            self.file.close()
+        except AttributeError:
+            pass
+
     def __repr__(self):
         """Return a printable representation."""
         return "FieldStorage(%r, %r, %r)" % (
@@ -680,7 +686,6 @@
                 encoding=self.encoding, errors=self.errors)
             for key, value in query:
                 self.list.append(MiniFieldStorage(key, value))
-            FieldStorageClass = None
 
         klass = self.FieldStorageClass or self.__class__
         first_line = self.fp.readline() # bytes
@@ -968,8 +973,8 @@
     print("<H3>Current Working Directory:</H3>")
     try:
         pwd = os.getcwd()
-    except os.error as msg:
-        print("os.error:", html.escape(str(msg)))
+    except OSError as msg:
+        print("OSError:", html.escape(str(msg)))
     else:
         print(html.escape(pwd))
     print()
@@ -1040,7 +1045,7 @@
     return s
 
 
-def valid_boundary(s, _vb_pattern=None):
+def valid_boundary(s):
     import re
     if isinstance(s, bytes):
         _vb_pattern = b"^[ -~]{0,200}[!-~]$"
diff --git a/Lib/chunk.py b/Lib/chunk.py
index 5863ed0..dc90a75 100644
--- a/Lib/chunk.py
+++ b/Lib/chunk.py
@@ -70,7 +70,7 @@
         self.size_read = 0
         try:
             self.offset = self.file.tell()
-        except (AttributeError, IOError):
+        except (AttributeError, OSError):
             self.seekable = False
         else:
             self.seekable = True
@@ -102,7 +102,7 @@
         if self.closed:
             raise ValueError("I/O operation on closed file")
         if not self.seekable:
-            raise IOError("cannot seek")
+            raise OSError("cannot seek")
         if whence == 1:
             pos = pos + self.size_read
         elif whence == 2:
@@ -158,7 +158,7 @@
                 self.file.seek(n, 1)
                 self.size_read = self.size_read + n
                 return
-            except IOError:
+            except OSError:
                 pass
         while self.size_read < self.chunksize:
             n = min(8192, self.chunksize - self.size_read)
diff --git a/Lib/code.py b/Lib/code.py
index 9020aab..f8184b6 100644
--- a/Lib/code.py
+++ b/Lib/code.py
@@ -216,7 +216,7 @@
             self.write("Python %s on %s\n%s\n(%s)\n" %
                        (sys.version, sys.platform, cprt,
                         self.__class__.__name__))
-        else:
+        elif banner:
             self.write("%s\n" % str(banner))
         more = 0
         while 1:
diff --git a/Lib/codecs.py b/Lib/codecs.py
index c2065da..145bf12 100644
--- a/Lib/codecs.py
+++ b/Lib/codecs.py
@@ -20,8 +20,14 @@
            "BOM_LE", "BOM32_BE", "BOM32_LE", "BOM64_BE", "BOM64_LE",
            "BOM_UTF8", "BOM_UTF16", "BOM_UTF16_LE", "BOM_UTF16_BE",
            "BOM_UTF32", "BOM_UTF32_LE", "BOM_UTF32_BE",
+           "CodecInfo", "Codec", "IncrementalEncoder", "IncrementalDecoder",
+           "StreamReader", "StreamWriter",
+           "StreamReaderWriter", "StreamRecoder",
+           "getencoder", "getdecoder", "getincrementalencoder",
+           "getincrementaldecoder", "getreader", "getwriter",
+           "encode", "decode", "iterencode", "iterdecode",
            "strict_errors", "ignore_errors", "replace_errors",
-           "xmlcharrefreplace_errors",
+           "xmlcharrefreplace_errors", "backslashreplace_errors",
            "register_error", "lookup_error"]
 
 ### Constants
@@ -117,7 +123,7 @@
                     Python will use the official U+FFFD REPLACEMENT
                     CHARACTER for the builtin Unicode codecs on
                     decoding and '?' on encoding.
-         'surrogateescape' - replace with private codepoints U+DCnn.
+         'surrogateescape' - replace with private code points U+DCnn.
          'xmlcharrefreplace' - Replace with the appropriate XML
                                character reference (only for encoding).
          'backslashreplace'  - Replace with backslashed escape sequences
@@ -340,8 +346,7 @@
 
         """ Creates a StreamWriter instance.
 
-            stream must be a file-like object open for writing
-            (binary) data.
+            stream must be a file-like object open for writing.
 
             The StreamWriter may use different error handling
             schemes by providing the errors keyword argument. These
@@ -415,8 +420,7 @@
 
         """ Creates a StreamReader instance.
 
-            stream must be a file-like object open for reading
-            (binary) data.
+            stream must be a file-like object open for reading.
 
             The StreamReader may use different error handling
             schemes by providing the errors keyword argument. These
@@ -444,13 +448,12 @@
         """ Decodes data from the stream self.stream and returns the
             resulting object.
 
-            chars indicates the number of characters to read from the
-            stream. read() will never return more than chars
-            characters, but it might return less, if there are not enough
-            characters available.
+            chars indicates the number of decoded code points or bytes to
+            return. read() will never return more data than requested,
+            but it might return less, if there is not enough available.
 
-            size indicates the approximate maximum number of bytes to
-            read from the stream for decoding purposes. The decoder
+            size indicates the approximate maximum number of decoded
+            bytes or code points to read for decoding. The decoder
             can modify this setting as appropriate. The default value
             -1 indicates to read and decode as much as possible.  size
             is intended to prevent having to decode huge files in one
@@ -461,7 +464,7 @@
             will be returned, the rest of the input will be kept until the
             next call to read().
 
-            The method should use a greedy read strategy meaning that
+            The method should use a greedy read strategy, meaning that
             it should read as much data as is allowed within the
             definition of the encoding and the given size, e.g.  if
             optional encoding endings or state markers are available
@@ -596,7 +599,7 @@
     def readlines(self, sizehint=None, keepends=True):
 
         """ Read all lines available on the input stream
-            and return them as list of lines.
+            and return them as a list.
 
             Line breaks are implemented using the codec's decoder
             method and are included in the list entries.
@@ -744,19 +747,18 @@
 
 class StreamRecoder:
 
-    """ StreamRecoder instances provide a frontend - backend
-        view of encoding data.
+    """ StreamRecoder instances translate data from one encoding to another.
 
         They use the complete set of APIs returned by the
         codecs.lookup() function to implement their task.
 
-        Data written to the stream is first decoded into an
-        intermediate format (which is dependent on the given codec
-        combination) and then written to the stream using an instance
-        of the provided Writer class.
+        Data written to the StreamRecoder is first decoded into an
+        intermediate format (depending on the "decode" codec) and then
+        written to the underlying stream using an instance of the provided
+        Writer class.
 
-        In the other direction, data is read from the stream using a
-        Reader instance and then return encoded data to the caller.
+        In the other direction, data is read from the underlying stream using
+        a Reader instance and then encoded and returned to the caller.
 
     """
     # Optional attributes set by the file wrappers below
@@ -768,22 +770,17 @@
 
         """ Creates a StreamRecoder instance which implements a two-way
             conversion: encode and decode work on the frontend (the
-            input to .read() and output of .write()) while
-            Reader and Writer work on the backend (reading and
-            writing to the stream).
+            data visible to .read() and .write()) while Reader and Writer
+            work on the backend (the data in stream).
 
-            You can use these objects to do transparent direct
-            recodings from e.g. latin-1 to utf-8 and back.
+            You can use these objects to do transparent
+            transcodings from e.g. latin-1 to utf-8 and back.
 
             stream must be a file-like object.
 
-            encode, decode must adhere to the Codec interface, Reader,
+            encode and decode must adhere to the Codec interface; Reader and
             Writer must be factory functions or classes providing the
-            StreamReader, StreamWriter interface resp.
-
-            encode and decode are needed for the frontend translation,
-            Reader and Writer for the backend translation. Unicode is
-            used as intermediate encoding.
+            StreamReader and StreamWriter interfaces resp.
 
             Error handling is done in the same way as defined for the
             StreamWriter/Readers.
@@ -858,7 +855,7 @@
 
 ### Shortcuts
 
-def open(filename, mode='rb', encoding=None, errors='strict', buffering=1):
+def open(filename, mode='r', encoding=None, errors='strict', buffering=1):
 
     """ Open an encoded file using the given mode and return
         a wrapped version providing transparent encoding/decoding.
@@ -868,10 +865,8 @@
         codecs. Output is also codec dependent and will usually be
         Unicode as well.
 
-        Files are always opened in binary mode, even if no binary mode
-        was specified. This is done to avoid data loss due to encodings
-        using 8-bit values. The default file mode is 'rb' meaning to
-        open the file in binary read mode.
+        Underlying encoded files are always opened in binary mode.
+        The default file mode is 'r', meaning to open the file in read mode.
 
         encoding specifies the encoding which is to be used for the
         file.
@@ -907,13 +902,13 @@
     """ Return a wrapped version of file which provides transparent
         encoding translation.
 
-        Strings written to the wrapped file are interpreted according
-        to the given data_encoding and then written to the original
-        file as string using file_encoding. The intermediate encoding
+        Data written to the wrapped file is decoded according
+        to the given data_encoding and then encoded to the underlying
+        file using file_encoding. The intermediate data type
         will usually be Unicode but depends on the specified codecs.
 
-        Strings are read from the file using file_encoding and then
-        passed back to the caller as string using data_encoding.
+        Bytes read from the file are decoded using file_encoding and then
+        passed back to the caller encoded using data_encoding.
 
         If file_encoding is not given, it defaults to data_encoding.
 
diff --git a/Lib/collections/__init__.py b/Lib/collections/__init__.py
index d737295..565ae86 100644
--- a/Lib/collections/__init__.py
+++ b/Lib/collections/__init__.py
@@ -3,16 +3,16 @@
 
 # For backwards compatibility, continue to make the collections ABCs
 # available through the collections module.
-from collections.abc import *
-import collections.abc
-__all__ += collections.abc.__all__
+from _collections_abc import *
+import _collections_abc
+__all__ += _collections_abc.__all__
 
 from _collections import deque, defaultdict
 from operator import itemgetter as _itemgetter, eq as _eq
 from keyword import iskeyword as _iskeyword
 import sys as _sys
 import heapq as _heapq
-from weakref import proxy as _proxy
+from _weakref import proxy as _proxy
 from itertools import repeat as _repeat, chain as _chain, starmap as _starmap
 from reprlib import recursive_repr as _recursive_repr
 
@@ -38,12 +38,16 @@
     # Individual links are kept alive by the hard reference in self.__map.
     # Those hard references disappear when a key is deleted from an OrderedDict.
 
-    def __init__(self, *args, **kwds):
+    def __init__(*args, **kwds):
         '''Initialize an ordered dictionary.  The signature is the same as
         regular dictionaries, but keyword arguments are not recommended because
         their insertion order is arbitrary.
 
         '''
+        if not args:
+            raise TypeError("descriptor '__init__' of 'OrderedDict' object "
+                            "needs an argument")
+        self, *args = args
         if len(args) > 1:
             raise TypeError('expected at most 1 arguments, got %d' % len(args))
         try:
@@ -199,13 +203,10 @@
 
     def __reduce__(self):
         'Return state information for pickling'
-        items = [[k, self[k]] for k in self]
         inst_dict = vars(self).copy()
         for k in vars(OrderedDict()):
             inst_dict.pop(k, None)
-        if inst_dict:
-            return (self.__class__, (items,), inst_dict)
-        return self.__class__, (items,)
+        return self.__class__, (), inst_dict or None, None, iter(self.items())
 
     def copy(self):
         'od.copy() -> a shallow copy of od'
@@ -277,9 +278,7 @@
         return OrderedDict(zip(self._fields, self))
 
     def _asdict(self):
-        '''Return a new OrderedDict which maps field names to their values.
-           This method is obsolete.  Use vars(nt) or nt.__dict__ instead.
-        '''
+        'Return a new OrderedDict which maps field names to their values.'
         return self.__dict__
 
     def __getnewargs__(self):
@@ -328,6 +327,7 @@
     if isinstance(field_names, str):
         field_names = field_names.replace(',', ' ').split()
     field_names = list(map(str, field_names))
+    typename = str(typename)
     if rename:
         seen = set()
         for index, name in enumerate(field_names):
@@ -338,6 +338,8 @@
                 field_names[index] = '_%d' % index
             seen.add(name)
     for name in [typename] + field_names:
+        if type(name) != str:
+            raise TypeError('Type names and field names must be strings')
         if not name.isidentifier():
             raise ValueError('Type names and field names must be valid '
                              'identifiers: %r' % name)
@@ -452,7 +454,7 @@
     #   http://code.activestate.com/recipes/259174/
     #   Knuth, TAOCP Vol. II section 4.6.3
 
-    def __init__(self, iterable=None, **kwds):
+    def __init__(*args, **kwds):
         '''Create a new, empty Counter object.  And if given, count elements
         from an input iterable.  Or, initialize the count from another mapping
         of elements to their counts.
@@ -463,8 +465,14 @@
         >>> c = Counter(a=4, b=2)                   # a new counter from keyword args
 
         '''
-        super().__init__()
-        self.update(iterable, **kwds)
+        if not args:
+            raise TypeError("descriptor '__init__' of 'Counter' object "
+                            "needs an argument")
+        self, *args = args
+        if len(args) > 1:
+            raise TypeError('expected at most 1 arguments, got %d' % len(args))
+        super(Counter, self).__init__()
+        self.update(*args, **kwds)
 
     def __missing__(self, key):
         'The count of elements not in the Counter is zero.'
@@ -515,7 +523,7 @@
         raise NotImplementedError(
             'Counter.fromkeys() is undefined.  Use Counter(iterable) instead.')
 
-    def update(self, iterable=None, **kwds):
+    def update(*args, **kwds):
         '''Like dict.update() but add counts instead of replacing them.
 
         Source can be an iterable, a dictionary, or another Counter instance.
@@ -535,6 +543,13 @@
         # contexts.  Instead, we implement straight-addition.  Both the inputs
         # and outputs are allowed to contain zero and negative counts.
 
+        if not args:
+            raise TypeError("descriptor 'update' of 'Counter' object "
+                            "needs an argument")
+        self, *args = args
+        if len(args) > 1:
+            raise TypeError('expected at most 1 arguments, got %d' % len(args))
+        iterable = args[0] if args else None
         if iterable is not None:
             if isinstance(iterable, Mapping):
                 if self:
@@ -542,13 +557,13 @@
                     for elem, count in iterable.items():
                         self[elem] = count + self_get(elem, 0)
                 else:
-                    super().update(iterable) # fast path when counter is empty
+                    super(Counter, self).update(iterable) # fast path when counter is empty
             else:
                 _count_elements(self, iterable)
         if kwds:
             self.update(kwds)
 
-    def subtract(self, iterable=None, **kwds):
+    def subtract(*args, **kwds):
         '''Like dict.update() but subtracts counts instead of replacing them.
         Counts can be reduced below zero.  Both the inputs and outputs are
         allowed to contain zero and negative counts.
@@ -564,6 +579,13 @@
         -1
 
         '''
+        if not args:
+            raise TypeError("descriptor 'subtract' of 'Counter' object "
+                            "needs an argument")
+        self, *args = args
+        if len(args) > 1:
+            raise TypeError('expected at most 1 arguments, got %d' % len(args))
+        iterable = args[0] if args else None
         if iterable is not None:
             self_get = self.get
             if isinstance(iterable, Mapping):
@@ -822,9 +844,14 @@
 
     __copy__ = copy
 
-    def new_child(self):                        # like Django's Context.push()
-        'New ChainMap with a new dict followed by all previous maps.'
-        return self.__class__({}, *self.maps)
+    def new_child(self, m=None):                # like Django's Context.push()
+        '''
+        New ChainMap with a new map followed by all previous maps. If no
+        map is provided, an empty dict is used.
+        '''
+        if m is None:
+            m = {}
+        return self.__class__(m, *self.maps)
 
     @property
     def parents(self):                          # like Django's Context.pop()
diff --git a/Lib/collections/abc.py b/Lib/collections/abc.py
index 7939268..891600d 100644
--- a/Lib/collections/abc.py
+++ b/Lib/collections/abc.py
@@ -1,728 +1,2 @@
-# Copyright 2007 Google, Inc. All Rights Reserved.
-# Licensed to PSF under a Contributor Agreement.
-
-"""Abstract Base Classes (ABCs) for collections, according to PEP 3119.
-
-Unit tests are in test_collections.
-"""
-
-from abc import ABCMeta, abstractmethod
-import sys
-
-__all__ = ["Hashable", "Iterable", "Iterator",
-           "Sized", "Container", "Callable",
-           "Set", "MutableSet",
-           "Mapping", "MutableMapping",
-           "MappingView", "KeysView", "ItemsView", "ValuesView",
-           "Sequence", "MutableSequence",
-           "ByteString",
-           ]
-
-# Private list of types that we want to register with the various ABCs
-# so that they will pass tests like:
-#       it = iter(somebytearray)
-#       assert isinstance(it, Iterable)
-# Note:  in other implementations, these types many not be distinct
-# and they make have their own implementation specific types that
-# are not included on this list.
-bytes_iterator = type(iter(b''))
-bytearray_iterator = type(iter(bytearray()))
-#callable_iterator = ???
-dict_keyiterator = type(iter({}.keys()))
-dict_valueiterator = type(iter({}.values()))
-dict_itemiterator = type(iter({}.items()))
-list_iterator = type(iter([]))
-list_reverseiterator = type(iter(reversed([])))
-range_iterator = type(iter(range(0)))
-set_iterator = type(iter(set()))
-str_iterator = type(iter(""))
-tuple_iterator = type(iter(()))
-zip_iterator = type(iter(zip()))
-## views ##
-dict_keys = type({}.keys())
-dict_values = type({}.values())
-dict_items = type({}.items())
-## misc ##
-mappingproxy = type(type.__dict__)
-
-
-### ONE-TRICK PONIES ###
-
-class Hashable(metaclass=ABCMeta):
-
-    __slots__ = ()
-
-    @abstractmethod
-    def __hash__(self):
-        return 0
-
-    @classmethod
-    def __subclasshook__(cls, C):
-        if cls is Hashable:
-            for B in C.__mro__:
-                if "__hash__" in B.__dict__:
-                    if B.__dict__["__hash__"]:
-                        return True
-                    break
-        return NotImplemented
-
-
-class Iterable(metaclass=ABCMeta):
-
-    __slots__ = ()
-
-    @abstractmethod
-    def __iter__(self):
-        while False:
-            yield None
-
-    @classmethod
-    def __subclasshook__(cls, C):
-        if cls is Iterable:
-            if any("__iter__" in B.__dict__ for B in C.__mro__):
-                return True
-        return NotImplemented
-
-
-class Iterator(Iterable):
-
-    __slots__ = ()
-
-    @abstractmethod
-    def __next__(self):
-        'Return the next item from the iterator. When exhausted, raise StopIteration'
-        raise StopIteration
-
-    def __iter__(self):
-        return self
-
-    @classmethod
-    def __subclasshook__(cls, C):
-        if cls is Iterator:
-            if (any("__next__" in B.__dict__ for B in C.__mro__) and
-                any("__iter__" in B.__dict__ for B in C.__mro__)):
-                return True
-        return NotImplemented
-
-Iterator.register(bytes_iterator)
-Iterator.register(bytearray_iterator)
-#Iterator.register(callable_iterator)
-Iterator.register(dict_keyiterator)
-Iterator.register(dict_valueiterator)
-Iterator.register(dict_itemiterator)
-Iterator.register(list_iterator)
-Iterator.register(list_reverseiterator)
-Iterator.register(range_iterator)
-Iterator.register(set_iterator)
-Iterator.register(str_iterator)
-Iterator.register(tuple_iterator)
-Iterator.register(zip_iterator)
-
-class Sized(metaclass=ABCMeta):
-
-    __slots__ = ()
-
-    @abstractmethod
-    def __len__(self):
-        return 0
-
-    @classmethod
-    def __subclasshook__(cls, C):
-        if cls is Sized:
-            if any("__len__" in B.__dict__ for B in C.__mro__):
-                return True
-        return NotImplemented
-
-
-class Container(metaclass=ABCMeta):
-
-    __slots__ = ()
-
-    @abstractmethod
-    def __contains__(self, x):
-        return False
-
-    @classmethod
-    def __subclasshook__(cls, C):
-        if cls is Container:
-            if any("__contains__" in B.__dict__ for B in C.__mro__):
-                return True
-        return NotImplemented
-
-
-class Callable(metaclass=ABCMeta):
-
-    __slots__ = ()
-
-    @abstractmethod
-    def __call__(self, *args, **kwds):
-        return False
-
-    @classmethod
-    def __subclasshook__(cls, C):
-        if cls is Callable:
-            if any("__call__" in B.__dict__ for B in C.__mro__):
-                return True
-        return NotImplemented
-
-
-### SETS ###
-
-
-class Set(Sized, Iterable, Container):
-
-    """A set is a finite, iterable container.
-
-    This class provides concrete generic implementations of all
-    methods except for __contains__, __iter__ and __len__.
-
-    To override the comparisons (presumably for speed, as the
-    semantics are fixed), all you have to do is redefine __le__ and
-    then the other operations will automatically follow suit.
-    """
-
-    __slots__ = ()
-
-    def __le__(self, other):
-        if not isinstance(other, Set):
-            return NotImplemented
-        if len(self) > len(other):
-            return False
-        for elem in self:
-            if elem not in other:
-                return False
-        return True
-
-    def __lt__(self, other):
-        if not isinstance(other, Set):
-            return NotImplemented
-        return len(self) < len(other) and self.__le__(other)
-
-    def __gt__(self, other):
-        if not isinstance(other, Set):
-            return NotImplemented
-        return other.__lt__(self)
-
-    def __ge__(self, other):
-        if not isinstance(other, Set):
-            return NotImplemented
-        return other.__le__(self)
-
-    def __eq__(self, other):
-        if not isinstance(other, Set):
-            return NotImplemented
-        return len(self) == len(other) and self.__le__(other)
-
-    def __ne__(self, other):
-        return not (self == other)
-
-    @classmethod
-    def _from_iterable(cls, it):
-        '''Construct an instance of the class from any iterable input.
-
-        Must override this method if the class constructor signature
-        does not accept an iterable for an input.
-        '''
-        return cls(it)
-
-    def __and__(self, other):
-        if not isinstance(other, Iterable):
-            return NotImplemented
-        return self._from_iterable(value for value in other if value in self)
-
-    def isdisjoint(self, other):
-        'Return True if two sets have a null intersection.'
-        for value in other:
-            if value in self:
-                return False
-        return True
-
-    def __or__(self, other):
-        if not isinstance(other, Iterable):
-            return NotImplemented
-        chain = (e for s in (self, other) for e in s)
-        return self._from_iterable(chain)
-
-    def __sub__(self, other):
-        if not isinstance(other, Set):
-            if not isinstance(other, Iterable):
-                return NotImplemented
-            other = self._from_iterable(other)
-        return self._from_iterable(value for value in self
-                                   if value not in other)
-
-    def __xor__(self, other):
-        if not isinstance(other, Set):
-            if not isinstance(other, Iterable):
-                return NotImplemented
-            other = self._from_iterable(other)
-        return (self - other) | (other - self)
-
-    def _hash(self):
-        """Compute the hash value of a set.
-
-        Note that we don't define __hash__: not all sets are hashable.
-        But if you define a hashable set type, its __hash__ should
-        call this function.
-
-        This must be compatible __eq__.
-
-        All sets ought to compare equal if they contain the same
-        elements, regardless of how they are implemented, and
-        regardless of the order of the elements; so there's not much
-        freedom for __eq__ or __hash__.  We match the algorithm used
-        by the built-in frozenset type.
-        """
-        MAX = sys.maxsize
-        MASK = 2 * MAX + 1
-        n = len(self)
-        h = 1927868237 * (n + 1)
-        h &= MASK
-        for x in self:
-            hx = hash(x)
-            h ^= (hx ^ (hx << 16) ^ 89869747)  * 3644798167
-            h &= MASK
-        h = h * 69069 + 907133923
-        h &= MASK
-        if h > MAX:
-            h -= MASK + 1
-        if h == -1:
-            h = 590923713
-        return h
-
-Set.register(frozenset)
-
-
-class MutableSet(Set):
-    """A mutable set is a finite, iterable container.
-
-    This class provides concrete generic implementations of all
-    methods except for __contains__, __iter__, __len__,
-    add(), and discard().
-
-    To override the comparisons (presumably for speed, as the
-    semantics are fixed), all you have to do is redefine __le__ and
-    then the other operations will automatically follow suit.
-    """
-
-    __slots__ = ()
-
-    @abstractmethod
-    def add(self, value):
-        """Add an element."""
-        raise NotImplementedError
-
-    @abstractmethod
-    def discard(self, value):
-        """Remove an element.  Do not raise an exception if absent."""
-        raise NotImplementedError
-
-    def remove(self, value):
-        """Remove an element. If not a member, raise a KeyError."""
-        if value not in self:
-            raise KeyError(value)
-        self.discard(value)
-
-    def pop(self):
-        """Return the popped value.  Raise KeyError if empty."""
-        it = iter(self)
-        try:
-            value = next(it)
-        except StopIteration:
-            raise KeyError
-        self.discard(value)
-        return value
-
-    def clear(self):
-        """This is slow (creates N new iterators!) but effective."""
-        try:
-            while True:
-                self.pop()
-        except KeyError:
-            pass
-
-    def __ior__(self, it):
-        for value in it:
-            self.add(value)
-        return self
-
-    def __iand__(self, it):
-        for value in (self - it):
-            self.discard(value)
-        return self
-
-    def __ixor__(self, it):
-        if it is self:
-            self.clear()
-        else:
-            if not isinstance(it, Set):
-                it = self._from_iterable(it)
-            for value in it:
-                if value in self:
-                    self.discard(value)
-                else:
-                    self.add(value)
-        return self
-
-    def __isub__(self, it):
-        if it is self:
-            self.clear()
-        else:
-            for value in it:
-                self.discard(value)
-        return self
-
-MutableSet.register(set)
-
-
-### MAPPINGS ###
-
-
-class Mapping(Sized, Iterable, Container):
-
-    __slots__ = ()
-
-    """A Mapping is a generic container for associating key/value
-    pairs.
-
-    This class provides concrete generic implementations of all
-    methods except for __getitem__, __iter__, and __len__.
-
-    """
-
-    @abstractmethod
-    def __getitem__(self, key):
-        raise KeyError
-
-    def get(self, key, default=None):
-        'D.get(k[,d]) -> D[k] if k in D, else d.  d defaults to None.'
-        try:
-            return self[key]
-        except KeyError:
-            return default
-
-    def __contains__(self, key):
-        try:
-            self[key]
-        except KeyError:
-            return False
-        else:
-            return True
-
-    def keys(self):
-        "D.keys() -> a set-like object providing a view on D's keys"
-        return KeysView(self)
-
-    def items(self):
-        "D.items() -> a set-like object providing a view on D's items"
-        return ItemsView(self)
-
-    def values(self):
-        "D.values() -> an object providing a view on D's values"
-        return ValuesView(self)
-
-    def __eq__(self, other):
-        if not isinstance(other, Mapping):
-            return NotImplemented
-        return dict(self.items()) == dict(other.items())
-
-    def __ne__(self, other):
-        return not (self == other)
-
-Mapping.register(mappingproxy)
-
-
-class MappingView(Sized):
-
-    def __init__(self, mapping):
-        self._mapping = mapping
-
-    def __len__(self):
-        return len(self._mapping)
-
-    def __repr__(self):
-        return '{0.__class__.__name__}({0._mapping!r})'.format(self)
-
-
-class KeysView(MappingView, Set):
-
-    @classmethod
-    def _from_iterable(self, it):
-        return set(it)
-
-    def __contains__(self, key):
-        return key in self._mapping
-
-    def __iter__(self):
-        for key in self._mapping:
-            yield key
-
-KeysView.register(dict_keys)
-
-
-class ItemsView(MappingView, Set):
-
-    @classmethod
-    def _from_iterable(self, it):
-        return set(it)
-
-    def __contains__(self, item):
-        key, value = item
-        try:
-            v = self._mapping[key]
-        except KeyError:
-            return False
-        else:
-            return v == value
-
-    def __iter__(self):
-        for key in self._mapping:
-            yield (key, self._mapping[key])
-
-ItemsView.register(dict_items)
-
-
-class ValuesView(MappingView):
-
-    def __contains__(self, value):
-        for key in self._mapping:
-            if value == self._mapping[key]:
-                return True
-        return False
-
-    def __iter__(self):
-        for key in self._mapping:
-            yield self._mapping[key]
-
-ValuesView.register(dict_values)
-
-
-class MutableMapping(Mapping):
-
-    __slots__ = ()
-
-    """A MutableMapping is a generic container for associating
-    key/value pairs.
-
-    This class provides concrete generic implementations of all
-    methods except for __getitem__, __setitem__, __delitem__,
-    __iter__, and __len__.
-
-    """
-
-    @abstractmethod
-    def __setitem__(self, key, value):
-        raise KeyError
-
-    @abstractmethod
-    def __delitem__(self, key):
-        raise KeyError
-
-    __marker = object()
-
-    def pop(self, key, default=__marker):
-        '''D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
-          If key is not found, d is returned if given, otherwise KeyError is raised.
-        '''
-        try:
-            value = self[key]
-        except KeyError:
-            if default is self.__marker:
-                raise
-            return default
-        else:
-            del self[key]
-            return value
-
-    def popitem(self):
-        '''D.popitem() -> (k, v), remove and return some (key, value) pair
-           as a 2-tuple; but raise KeyError if D is empty.
-        '''
-        try:
-            key = next(iter(self))
-        except StopIteration:
-            raise KeyError
-        value = self[key]
-        del self[key]
-        return key, value
-
-    def clear(self):
-        'D.clear() -> None.  Remove all items from D.'
-        try:
-            while True:
-                self.popitem()
-        except KeyError:
-            pass
-
-    def update(*args, **kwds):
-        ''' D.update([E, ]**F) -> None.  Update D from mapping/iterable E and F.
-            If E present and has a .keys() method, does:     for k in E: D[k] = E[k]
-            If E present and lacks .keys() method, does:     for (k, v) in E: D[k] = v
-            In either case, this is followed by: for k, v in F.items(): D[k] = v
-        '''
-        if len(args) > 2:
-            raise TypeError("update() takes at most 2 positional "
-                            "arguments ({} given)".format(len(args)))
-        elif not args:
-            raise TypeError("update() takes at least 1 argument (0 given)")
-        self = args[0]
-        other = args[1] if len(args) >= 2 else ()
-
-        if isinstance(other, Mapping):
-            for key in other:
-                self[key] = other[key]
-        elif hasattr(other, "keys"):
-            for key in other.keys():
-                self[key] = other[key]
-        else:
-            for key, value in other:
-                self[key] = value
-        for key, value in kwds.items():
-            self[key] = value
-
-    def setdefault(self, key, default=None):
-        'D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D'
-        try:
-            return self[key]
-        except KeyError:
-            self[key] = default
-        return default
-
-MutableMapping.register(dict)
-
-
-### SEQUENCES ###
-
-
-class Sequence(Sized, Iterable, Container):
-
-    """All the operations on a read-only sequence.
-
-    Concrete subclasses must override __new__ or __init__,
-    __getitem__, and __len__.
-    """
-
-    __slots__ = ()
-
-    @abstractmethod
-    def __getitem__(self, index):
-        raise IndexError
-
-    def __iter__(self):
-        i = 0
-        try:
-            while True:
-                v = self[i]
-                yield v
-                i += 1
-        except IndexError:
-            return
-
-    def __contains__(self, value):
-        for v in self:
-            if v == value:
-                return True
-        return False
-
-    def __reversed__(self):
-        for i in reversed(range(len(self))):
-            yield self[i]
-
-    def index(self, value):
-        '''S.index(value) -> integer -- return first index of value.
-           Raises ValueError if the value is not present.
-        '''
-        for i, v in enumerate(self):
-            if v == value:
-                return i
-        raise ValueError
-
-    def count(self, value):
-        'S.count(value) -> integer -- return number of occurrences of value'
-        return sum(1 for v in self if v == value)
-
-Sequence.register(tuple)
-Sequence.register(str)
-Sequence.register(range)
-
-
-class ByteString(Sequence):
-
-    """This unifies bytes and bytearray.
-
-    XXX Should add all their methods.
-    """
-
-    __slots__ = ()
-
-ByteString.register(bytes)
-ByteString.register(bytearray)
-
-
-class MutableSequence(Sequence):
-
-    __slots__ = ()
-
-    """All the operations on a read-only sequence.
-
-    Concrete subclasses must provide __new__ or __init__,
-    __getitem__, __setitem__, __delitem__, __len__, and insert().
-
-    """
-
-    @abstractmethod
-    def __setitem__(self, index, value):
-        raise IndexError
-
-    @abstractmethod
-    def __delitem__(self, index):
-        raise IndexError
-
-    @abstractmethod
-    def insert(self, index, value):
-        'S.insert(index, value) -- insert value before index'
-        raise IndexError
-
-    def append(self, value):
-        'S.append(value) -- append value to the end of the sequence'
-        self.insert(len(self), value)
-
-    def clear(self):
-        'S.clear() -> None -- remove all items from S'
-        try:
-            while True:
-                self.pop()
-        except IndexError:
-            pass
-
-    def reverse(self):
-        'S.reverse() -- reverse *IN PLACE*'
-        n = len(self)
-        for i in range(n//2):
-            self[i], self[n-i-1] = self[n-i-1], self[i]
-
-    def extend(self, values):
-        'S.extend(iterable) -- extend sequence by appending elements from the iterable'
-        for v in values:
-            self.append(v)
-
-    def pop(self, index=-1):
-        '''S.pop([index]) -> item -- remove and return item at index (default last).
-           Raise IndexError if list is empty or index is out of range.
-        '''
-        v = self[index]
-        del self[index]
-        return v
-
-    def remove(self, value):
-        '''S.remove(value) -- remove first occurrence of value.
-           Raise ValueError if the value is not present.
-        '''
-        del self[self.index(value)]
-
-    def __iadd__(self, values):
-        self.extend(values)
-        return self
-
-MutableSequence.register(list)
-MutableSequence.register(bytearray)  # Multiply inheriting, see ByteString
+from _collections_abc import *
+from _collections_abc import __all__
diff --git a/Lib/colorsys.py b/Lib/colorsys.py
index a6c0cf6..b93e384 100644
--- a/Lib/colorsys.py
+++ b/Lib/colorsys.py
@@ -33,17 +33,25 @@
 # YIQ: used by composite video signals (linear combinations of RGB)
 # Y: perceived grey level (0.0 == black, 1.0 == white)
 # I, Q: color components
+#
+# There are a great many versions of the constants used in these formulae.
+# The ones in this library uses constants from the FCC version of NTSC.
 
 def rgb_to_yiq(r, g, b):
     y = 0.30*r + 0.59*g + 0.11*b
-    i = 0.60*r - 0.28*g - 0.32*b
-    q = 0.21*r - 0.52*g + 0.31*b
+    i = 0.74*(r-y) - 0.27*(b-y)
+    q = 0.48*(r-y) + 0.41*(b-y)
     return (y, i, q)
 
 def yiq_to_rgb(y, i, q):
-    r = y + 0.948262*i + 0.624013*q
-    g = y - 0.276066*i - 0.639810*q
-    b = y - 1.105450*i + 1.729860*q
+    # r = y + (0.27*q + 0.41*i) / (0.74*0.41 + 0.27*0.48)
+    # b = y + (0.74*q - 0.48*i) / (0.74*0.41 + 0.27*0.48)
+    # g = y - (0.30*(r-y) + 0.11*(b-y)) / 0.59
+
+    r = y + 0.9468822170900693*i + 0.6235565819861433*q
+    g = y - 0.27478764629897834*i - 0.6356910791873801*q
+    b = y - 1.1085450346420322*i + 1.7090069284064666*q
+
     if r < 0.0:
         r = 0.0
     if g < 0.0:
diff --git a/Lib/compileall.py b/Lib/compileall.py
index 693eda9..d957ee5 100644
--- a/Lib/compileall.py
+++ b/Lib/compileall.py
@@ -12,8 +12,7 @@
 """
 import os
 import sys
-import errno
-import imp
+import importlib.util
 import py_compile
 import struct
 
@@ -38,7 +37,7 @@
         print('Listing {!r}...'.format(dir))
     try:
         names = os.listdir(dir)
-    except os.error:
+    except OSError:
         print("Can't list {!r}".format(dir))
         names = []
     names.sort()
@@ -91,22 +90,23 @@
             cfile = fullname + ('c' if __debug__ else 'o')
         else:
             if optimize >= 0:
-                cfile = imp.cache_from_source(fullname,
-                                              debug_override=not optimize)
+                cfile = importlib.util.cache_from_source(
+                                fullname, debug_override=not optimize)
             else:
-                cfile = imp.cache_from_source(fullname)
+                cfile = importlib.util.cache_from_source(fullname)
             cache_dir = os.path.dirname(cfile)
         head, tail = name[:-3], name[-3:]
         if tail == '.py':
             if not force:
                 try:
                     mtime = int(os.stat(fullname).st_mtime)
-                    expect = struct.pack('<4sl', imp.get_magic(), mtime)
+                    expect = struct.pack('<4sl', importlib.util.MAGIC_NUMBER,
+                                         mtime)
                     with open(cfile, 'rb') as chandle:
                         actual = chandle.read(8)
                     if expect == actual:
                         return success
-                except IOError:
+                except OSError:
                     pass
             if not quiet:
                 print('Compiling {!r}...'.format(fullname))
@@ -124,7 +124,7 @@
                 msg = msg.decode(sys.stdout.encoding)
                 print(msg)
                 success = 0
-            except (SyntaxError, UnicodeError, IOError) as e:
+            except (SyntaxError, UnicodeError, OSError) as e:
                 if quiet:
                     print('*** Error compiling {!r}...'.format(fullname))
                 else:
@@ -209,7 +209,7 @@
             with (sys.stdin if args.flist=='-' else open(args.flist)) as f:
                 for line in f:
                     compile_dests.append(line.strip())
-        except EnvironmentError:
+        except OSError:
             print("Error reading file list {}".format(args.flist))
             return False
 
diff --git a/Lib/concurrent/futures/_base.py b/Lib/concurrent/futures/_base.py
index d45a404..acd05d0 100644
--- a/Lib/concurrent/futures/_base.py
+++ b/Lib/concurrent/futures/_base.py
@@ -200,8 +200,7 @@
         waiter = _create_and_install_waiters(fs, _AS_COMPLETED)
 
     try:
-        for future in finished:
-            yield future
+        yield from finished
 
         while pending:
             if timeout is None:
@@ -226,7 +225,8 @@
 
     finally:
         for f in fs:
-            f._waiters.remove(waiter)
+            with f._condition:
+                f._waiters.remove(waiter)
 
 DoneAndNotDoneFutures = collections.namedtuple(
         'DoneAndNotDoneFutures', 'done not_done')
@@ -273,7 +273,8 @@
 
     waiter.event.wait(timeout)
     for f in fs:
-        f._waiters.remove(waiter)
+        with f._condition:
+            f._waiters.remove(waiter)
 
     done.update(waiter.finished_futures)
     return DoneAndNotDoneFutures(done, set(fs) - done)
diff --git a/Lib/concurrent/futures/process.py b/Lib/concurrent/futures/process.py
index adf2ab4..07b5225 100644
--- a/Lib/concurrent/futures/process.py
+++ b/Lib/concurrent/futures/process.py
@@ -40,7 +40,7 @@
 
 Process #1..n:
 - reads _CallItems from "Call Q", executes the calls, and puts the resulting
-  _ResultItems in "Request Q"
+  _ResultItems in "Result Q"
 """
 
 __author__ = 'Brian Quinlan (brian@sweetapp.com)'
@@ -49,8 +49,9 @@
 import os
 from concurrent.futures import _base
 import queue
+from queue import Full
 import multiprocessing
-from multiprocessing.queues import SimpleQueue, Full
+from multiprocessing import SimpleQueue
 from multiprocessing.connection import wait
 import threading
 import weakref
@@ -240,6 +241,8 @@
                         "terminated abruptly while the future was "
                         "running or pending."
                     ))
+                # Delete references to object. See issue16284
+                del work_item
             pending_work_items.clear()
             # Terminate remaining workers forcibly: the queues or their
             # locks may be in a dirty state and block forever.
@@ -264,6 +267,8 @@
                     work_item.future.set_exception(result_item.exception)
                 else:
                     work_item.future.set_result(result_item.result)
+                # Delete references to object. See issue16284
+                del work_item
         # Check whether we should start shutting down.
         executor = executor_reference()
         # No more work items can be added if:
@@ -327,7 +332,7 @@
         _check_system_limits()
 
         if max_workers is None:
-            self._max_workers = multiprocessing.cpu_count()
+            self._max_workers = os.cpu_count() or 1
         else:
             self._max_workers = max_workers
 
diff --git a/Lib/concurrent/futures/thread.py b/Lib/concurrent/futures/thread.py
index 95bb682..f9beb0f 100644
--- a/Lib/concurrent/futures/thread.py
+++ b/Lib/concurrent/futures/thread.py
@@ -63,6 +63,8 @@
             work_item = work_queue.get(block=True)
             if work_item is not None:
                 work_item.run()
+                # Delete references to object. See issue16284
+                del work_item
                 continue
             executor = executor_reference()
             # Exit if:
diff --git a/Lib/configparser.py b/Lib/configparser.py
index aebf8a0..4ee8307 100644
--- a/Lib/configparser.py
+++ b/Lib/configparser.py
@@ -670,7 +670,7 @@
             try:
                 with open(filename, encoding=encoding) as fp:
                     self._read(fp, filename)
-            except IOError:
+            except OSError:
                 continue
             read_ok.append(filename)
         return read_ok
diff --git a/Lib/contextlib.py b/Lib/contextlib.py
index b03f828..82ee955 100644
--- a/Lib/contextlib.py
+++ b/Lib/contextlib.py
@@ -4,7 +4,8 @@
 from collections import deque
 from functools import wraps
 
-__all__ = ["contextmanager", "closing", "ContextDecorator", "ExitStack"]
+__all__ = ["contextmanager", "closing", "ContextDecorator", "ExitStack",
+           "redirect_stdout", "suppress"]
 
 
 class ContextDecorator(object):
@@ -36,6 +37,16 @@
     def __init__(self, func, *args, **kwds):
         self.gen = func(*args, **kwds)
         self.func, self.args, self.kwds = func, args, kwds
+        # Issue 19330: ensure context manager instances have good docstrings
+        doc = getattr(func, "__doc__", None)
+        if doc is None:
+            doc = type(self).__doc__
+        self.__doc__ = doc
+        # Unfortunately, this still doesn't provide good help output when
+        # inspecting the created context manager instances, since pydoc
+        # currently bypasses the instance docstring and shows the docstring
+        # for the class instead.
+        # See http://bugs.python.org/issue19404 for more details.
 
     def _recreate_cm(self):
         # _GCM instances are one-shot context managers, so the
@@ -47,7 +58,7 @@
         try:
             return next(self.gen)
         except StopIteration:
-            raise RuntimeError("generator didn't yield")
+            raise RuntimeError("generator didn't yield") from None
 
     def __exit__(self, type, value, traceback):
         if type is None:
@@ -140,6 +151,62 @@
     def __exit__(self, *exc_info):
         self.thing.close()
 
+class redirect_stdout:
+    """Context manager for temporarily redirecting stdout to another file
+
+        # How to send help() to stderr
+        with redirect_stdout(sys.stderr):
+            help(dir)
+
+        # How to write help() to a file
+        with open('help.txt', 'w') as f:
+            with redirect_stdout(f):
+                help(pow)
+    """
+
+    def __init__(self, new_target):
+        self._new_target = new_target
+        # We use a list of old targets to make this CM re-entrant
+        self._old_targets = []
+
+    def __enter__(self):
+        self._old_targets.append(sys.stdout)
+        sys.stdout = self._new_target
+        return self._new_target
+
+    def __exit__(self, exctype, excinst, exctb):
+        sys.stdout = self._old_targets.pop()
+
+
+class suppress:
+    """Context manager to suppress specified exceptions
+
+    After the exception is suppressed, execution proceeds with the next
+    statement following the with statement.
+
+         with suppress(FileNotFoundError):
+             os.remove(somefile)
+         # Execution still resumes here if the file was already removed
+    """
+
+    def __init__(self, *exceptions):
+        self._exceptions = exceptions
+
+    def __enter__(self):
+        pass
+
+    def __exit__(self, exctype, excinst, exctb):
+        # Unlike isinstance and issubclass, CPython exception handling
+        # currently only looks at the concrete type hierarchy (ignoring
+        # the instance and subclass checking hooks). While Guido considers
+        # that a bug rather than a feature, it's a fairly hard one to fix
+        # due to various internal implementation details. suppress provides
+        # the simpler issubclass based semantics, rather than trying to
+        # exactly reproduce the limitations of the CPython interpreter.
+        #
+        # See http://bugs.python.org/issue12029 for more details
+        return exctype is not None and issubclass(exctype, self._exceptions)
+
 
 # Inspired by discussions on http://bugs.python.org/issue13585
 class ExitStack(object):
diff --git a/Lib/copyreg.py b/Lib/copyreg.py
index 66c0f8a..67f5bb0 100644
--- a/Lib/copyreg.py
+++ b/Lib/copyreg.py
@@ -87,6 +87,12 @@
 def __newobj__(cls, *args):
     return cls.__new__(cls, *args)
 
+def __newobj_ex__(cls, args, kwargs):
+    """Used by pickle protocol 4, instead of __newobj__ to allow classes with
+    keyword-only arguments to be pickled correctly.
+    """
+    return cls.__new__(cls, *args, **kwargs)
+
 def _slotnames(cls):
     """Return a list of slot names for a given class.
 
diff --git a/Lib/ctypes/__init__.py b/Lib/ctypes/__init__.py
index c92e130..5c803ff 100644
--- a/Lib/ctypes/__init__.py
+++ b/Lib/ctypes/__init__.py
@@ -34,24 +34,22 @@
      FUNCFLAG_USE_ERRNO as _FUNCFLAG_USE_ERRNO, \
      FUNCFLAG_USE_LASTERROR as _FUNCFLAG_USE_LASTERROR
 
-"""
-WINOLEAPI -> HRESULT
-WINOLEAPI_(type)
-
-STDMETHODCALLTYPE
-
-STDMETHOD(name)
-STDMETHOD_(type, name)
-
-STDAPICALLTYPE
-"""
+# WINOLEAPI -> HRESULT
+# WINOLEAPI_(type)
+#
+# STDMETHODCALLTYPE
+#
+# STDMETHOD(name)
+# STDMETHOD_(type, name)
+#
+# STDAPICALLTYPE
 
 def create_string_buffer(init, size=None):
     """create_string_buffer(aBytes) -> character array
     create_string_buffer(anInteger) -> character array
     create_string_buffer(aString, anInteger) -> character array
     """
-    if isinstance(init, (str, bytes)):
+    if isinstance(init, bytes):
         if size is None:
             size = len(init)+1
         buftype = c_char * size
@@ -286,7 +284,7 @@
     create_unicode_buffer(anInteger) -> character array
     create_unicode_buffer(aString, anInteger) -> character array
     """
-    if isinstance(init, (str, bytes)):
+    if isinstance(init, str):
         if size is None:
             size = len(init)+1
         buftype = c_wchar * size
@@ -395,7 +393,7 @@
         _type_ = "l"
         # _check_retval_ is called with the function's result when it
         # is used as restype.  It checks for the FAILED bit, and
-        # raises a WindowsError if it is set.
+        # raises an OSError if it is set.
         #
         # The _check_retval_ method is implemented in C, so that the
         # method definition itself is not included in the traceback
@@ -407,7 +405,7 @@
     class OleDLL(CDLL):
         """This class represents a dll exporting functions using the
         Windows stdcall calling convention, and returning HRESULT.
-        HRESULT error values are automatically raised as WindowsError
+        HRESULT error values are automatically raised as OSError
         exceptions.
         """
         _func_flags_ = _FUNCFLAG_STDCALL
@@ -456,7 +454,7 @@
             code = GetLastError()
         if descr is None:
             descr = FormatError(code).strip()
-        return WindowsError(None, descr, None, code)
+        return OSError(None, descr, None, code)
 
 if sizeof(c_uint) == sizeof(c_void_p):
     c_size_t = c_uint
diff --git a/Lib/ctypes/test/__init__.py b/Lib/ctypes/test/__init__.py
index cc5fe02..26a70b7 100644
--- a/Lib/ctypes/test/__init__.py
+++ b/Lib/ctypes/test/__init__.py
@@ -1,208 +1,14 @@
-import os, sys, unittest, getopt, time
+import os
+import unittest
+from test import support
 
-use_resources = []
+# skip tests if _ctypes was not built
+ctypes = support.import_module('ctypes')
+ctypes_symbols = dir(ctypes)
 
-class ResourceDenied(Exception):
-    """Test skipped because it requested a disallowed resource.
+def need_symbol(name):
+    return unittest.skipUnless(name in ctypes_symbols,
+                               '{!r} is required'.format(name))
 
-    This is raised when a test calls requires() for a resource that
-    has not be enabled.  Resources are defined by test modules.
-    """
-
-def is_resource_enabled(resource):
-    """Test whether a resource is enabled.
-
-    If the caller's module is __main__ then automatically return True."""
-    if sys._getframe().f_back.f_globals.get("__name__") == "__main__":
-        return True
-    result = use_resources is not None and \
-           (resource in use_resources or "*" in use_resources)
-    if not result:
-        _unavail[resource] = None
-    return result
-
-_unavail = {}
-def requires(resource, msg=None):
-    """Raise ResourceDenied if the specified resource is not available.
-
-    If the caller's module is __main__ then automatically return True."""
-    # see if the caller's module is __main__ - if so, treat as if
-    # the resource was set
-    if sys._getframe().f_back.f_globals.get("__name__") == "__main__":
-        return
-    if not is_resource_enabled(resource):
-        if msg is None:
-            msg = "Use of the `%s' resource not enabled" % resource
-        raise ResourceDenied(msg)
-
-def find_package_modules(package, mask):
-    import fnmatch
-    if (hasattr(package, "__loader__") and
-            hasattr(package.__loader__, '_files')):
-        path = package.__name__.replace(".", os.path.sep)
-        mask = os.path.join(path, mask)
-        for fnm in package.__loader__._files.keys():
-            if fnmatch.fnmatchcase(fnm, mask):
-                yield os.path.splitext(fnm)[0].replace(os.path.sep, ".")
-    else:
-        path = package.__path__[0]
-        for fnm in os.listdir(path):
-            if fnmatch.fnmatchcase(fnm, mask):
-                yield "%s.%s" % (package.__name__, os.path.splitext(fnm)[0])
-
-def get_tests(package, mask, verbosity, exclude=()):
-    """Return a list of skipped test modules, and a list of test cases."""
-    tests = []
-    skipped = []
-    for modname in find_package_modules(package, mask):
-        if modname.split(".")[-1] in exclude:
-            skipped.append(modname)
-            if verbosity > 1:
-                print("Skipped %s: excluded" % modname, file=sys.stderr)
-            continue
-        try:
-            mod = __import__(modname, globals(), locals(), ['*'])
-        except (ResourceDenied, unittest.SkipTest) as detail:
-            skipped.append(modname)
-            if verbosity > 1:
-                print("Skipped %s: %s" % (modname, detail), file=sys.stderr)
-            continue
-        for name in dir(mod):
-            if name.startswith("_"):
-                continue
-            o = getattr(mod, name)
-            if type(o) is type(unittest.TestCase) and issubclass(o, unittest.TestCase):
-                tests.append(o)
-    return skipped, tests
-
-def usage():
-    print(__doc__)
-    return 1
-
-def test_with_refcounts(runner, verbosity, testcase):
-    """Run testcase several times, tracking reference counts."""
-    import gc
-    import ctypes
-    ptc = ctypes._pointer_type_cache.copy()
-    cfc = ctypes._c_functype_cache.copy()
-    wfc = ctypes._win_functype_cache.copy()
-
-    # when searching for refcount leaks, we have to manually reset any
-    # caches that ctypes has.
-    def cleanup():
-        ctypes._pointer_type_cache = ptc.copy()
-        ctypes._c_functype_cache = cfc.copy()
-        ctypes._win_functype_cache = wfc.copy()
-        gc.collect()
-
-    test = unittest.makeSuite(testcase)
-    for i in range(5):
-        rc = sys.gettotalrefcount()
-        runner.run(test)
-        cleanup()
-    COUNT = 5
-    refcounts = [None] * COUNT
-    for i in range(COUNT):
-        rc = sys.gettotalrefcount()
-        runner.run(test)
-        cleanup()
-        refcounts[i] = sys.gettotalrefcount() - rc
-    if filter(None, refcounts):
-        print("%s leaks:\n\t" % testcase, refcounts)
-    elif verbosity:
-        print("%s: ok." % testcase)
-
-class TestRunner(unittest.TextTestRunner):
-    def run(self, test, skipped):
-        "Run the given test case or test suite."
-        # Same as unittest.TextTestRunner.run, except that it reports
-        # skipped tests.
-        result = self._makeResult()
-        startTime = time.time()
-        test(result)
-        stopTime = time.time()
-        timeTaken = stopTime - startTime
-        result.printErrors()
-        self.stream.writeln(result.separator2)
-        run = result.testsRun
-        if _unavail: #skipped:
-            requested = list(_unavail.keys())
-            requested.sort()
-            self.stream.writeln("Ran %d test%s in %.3fs (%s module%s skipped)" %
-                                (run, run != 1 and "s" or "", timeTaken,
-                                 len(skipped),
-                                 len(skipped) != 1 and "s" or ""))
-            self.stream.writeln("Unavailable resources: %s" % ", ".join(requested))
-        else:
-            self.stream.writeln("Ran %d test%s in %.3fs" %
-                                (run, run != 1 and "s" or "", timeTaken))
-        self.stream.writeln()
-        if not result.wasSuccessful():
-            self.stream.write("FAILED (")
-            failed, errored = map(len, (result.failures, result.errors))
-            if failed:
-                self.stream.write("failures=%d" % failed)
-            if errored:
-                if failed: self.stream.write(", ")
-                self.stream.write("errors=%d" % errored)
-            self.stream.writeln(")")
-        else:
-            self.stream.writeln("OK")
-        return result
-
-
-def main(*packages):
-    try:
-        opts, args = getopt.getopt(sys.argv[1:], "rqvu:x:")
-    except getopt.error:
-        return usage()
-
-    verbosity = 1
-    search_leaks = False
-    exclude = []
-    for flag, value in opts:
-        if flag == "-q":
-            verbosity -= 1
-        elif flag == "-v":
-            verbosity += 1
-        elif flag == "-r":
-            try:
-                sys.gettotalrefcount
-            except AttributeError:
-                print("-r flag requires Python debug build", file=sys.stderr)
-                return -1
-            search_leaks = True
-        elif flag == "-u":
-            use_resources.extend(value.split(","))
-        elif flag == "-x":
-            exclude.extend(value.split(","))
-
-    mask = "test_*.py"
-    if args:
-        mask = args[0]
-
-    for package in packages:
-        run_tests(package, mask, verbosity, search_leaks, exclude)
-
-
-def run_tests(package, mask, verbosity, search_leaks, exclude):
-    skipped, testcases = get_tests(package, mask, verbosity, exclude)
-    runner = TestRunner(verbosity=verbosity)
-
-    suites = [unittest.makeSuite(o) for o in testcases]
-    suite = unittest.TestSuite(suites)
-    result = runner.run(suite, skipped)
-
-    if search_leaks:
-        # hunt for refcount leaks
-        runner = BasicTestRunner()
-        for t in testcases:
-            test_with_refcounts(runner, verbosity, t)
-
-    return bool(result.errors)
-
-class BasicTestRunner:
-    def run(self, test):
-        result = unittest.TestResult()
-        test(result)
-        return result
+def load_tests(*args):
+    return support.load_package_tests(os.path.dirname(__file__), *args)
diff --git a/Lib/ctypes/test/__main__.py b/Lib/ctypes/test/__main__.py
new file mode 100644
index 0000000..362a9ec
--- /dev/null
+++ b/Lib/ctypes/test/__main__.py
@@ -0,0 +1,4 @@
+from ctypes.test import load_tests
+import unittest
+
+unittest.main()
diff --git a/Lib/ctypes/test/runtests.py b/Lib/ctypes/test/runtests.py
deleted file mode 100644
index b7a2b26..0000000
--- a/Lib/ctypes/test/runtests.py
+++ /dev/null
@@ -1,19 +0,0 @@
-"""Usage: runtests.py [-q] [-r] [-v] [-u resources] [mask]
-
-Run all tests found in this directory, and print a summary of the results.
-Command line flags:
-  -q     quiet mode: don't print anything while the tests are running
-  -r     run tests repeatedly, look for refcount leaks
-  -u<resources>
-         Add resources to the lits of allowed resources. '*' allows all
-         resources.
-  -v     verbose mode: print the test currently executed
-  -x<test1[,test2...]>
-         Exclude specified tests.
-  mask   mask to select filenames containing testcases, wildcards allowed
-"""
-import sys
-import ctypes.test
-
-if __name__ == "__main__":
-    sys.exit(ctypes.test.main(ctypes.test))
diff --git a/Lib/ctypes/test/test_arrays.py b/Lib/ctypes/test/test_arrays.py
index 99b97aa..8ca77e0 100644
--- a/Lib/ctypes/test/test_arrays.py
+++ b/Lib/ctypes/test/test_arrays.py
@@ -1,6 +1,8 @@
 import unittest
 from ctypes import *
 
+from ctypes.test import need_symbol
+
 formats = "bBhHiIlLqQfd"
 
 formats = c_byte, c_ubyte, c_short, c_ushort, c_int, c_uint, \
@@ -98,20 +100,16 @@
         self.assertEqual(sz[1:4:2], b"o")
         self.assertEqual(sz.value, b"foo")
 
-    try:
-        create_unicode_buffer
-    except NameError:
-        pass
-    else:
-        def test_from_addressW(self):
-            p = create_unicode_buffer("foo")
-            sz = (c_wchar * 3).from_address(addressof(p))
-            self.assertEqual(sz[:], "foo")
-            self.assertEqual(sz[::], "foo")
-            self.assertEqual(sz[::-1], "oof")
-            self.assertEqual(sz[::3], "f")
-            self.assertEqual(sz[1:4:2], "o")
-            self.assertEqual(sz.value, "foo")
+    @need_symbol('create_unicode_buffer')
+    def test_from_addressW(self):
+        p = create_unicode_buffer("foo")
+        sz = (c_wchar * 3).from_address(addressof(p))
+        self.assertEqual(sz[:], "foo")
+        self.assertEqual(sz[::], "foo")
+        self.assertEqual(sz[::-1], "oof")
+        self.assertEqual(sz[::3], "f")
+        self.assertEqual(sz[1:4:2], "o")
+        self.assertEqual(sz.value, "foo")
 
     def test_cache(self):
         # Array types are cached internally in the _ctypes extension,
diff --git a/Lib/ctypes/test/test_as_parameter.py b/Lib/ctypes/test/test_as_parameter.py
index 43703e3..948b463 100644
--- a/Lib/ctypes/test/test_as_parameter.py
+++ b/Lib/ctypes/test/test_as_parameter.py
@@ -1,5 +1,6 @@
 import unittest
 from ctypes import *
+from ctypes.test import need_symbol
 import _ctypes_test
 
 dll = CDLL(_ctypes_test.__file__)
@@ -17,11 +18,8 @@
     def wrap(self, param):
         return param
 
+    @need_symbol('c_wchar')
     def test_wchar_parm(self):
-        try:
-            c_wchar
-        except NameError:
-            return
         f = dll._testfunc_i_bhilfd
         f.argtypes = [c_byte, c_wchar, c_int, c_long, c_float, c_double]
         result = f(self.wrap(1), self.wrap("x"), self.wrap(3), self.wrap(4), self.wrap(5.0), self.wrap(6.0))
diff --git a/Lib/ctypes/test/test_bitfields.py b/Lib/ctypes/test/test_bitfields.py
index 77de606..9ca053d 100644
--- a/Lib/ctypes/test/test_bitfields.py
+++ b/Lib/ctypes/test/test_bitfields.py
@@ -1,4 +1,5 @@
 from ctypes import *
+from ctypes.test import need_symbol
 import unittest
 import os
 
@@ -127,20 +128,18 @@
         result = self.fail_fields(("a", c_char, 1))
         self.assertEqual(result, (TypeError, 'bit fields not allowed for type c_char'))
 
-        try:
-            c_wchar
-        except NameError:
-            pass
-        else:
-            result = self.fail_fields(("a", c_wchar, 1))
-            self.assertEqual(result, (TypeError, 'bit fields not allowed for type c_wchar'))
-
         class Dummy(Structure):
             _fields_ = []
 
         result = self.fail_fields(("a", Dummy, 1))
         self.assertEqual(result, (TypeError, 'bit fields not allowed for type Dummy'))
 
+    @need_symbol('c_wchar')
+    def test_c_wchar(self):
+        result = self.fail_fields(("a", c_wchar, 1))
+        self.assertEqual(result,
+                (TypeError, 'bit fields not allowed for type c_wchar'))
+
     def test_single_bitfield_size(self):
         for c_typ in int_types:
             result = self.fail_fields(("a", c_typ, -1))
@@ -240,7 +239,7 @@
             _anonymous_ = ["_"]
             _fields_ = [("_", X)]
 
-    @unittest.skipUnless(hasattr(ctypes, "c_uint32"), "c_int32 is required")
+    @need_symbol('c_uint32')
     def test_uint32(self):
         class X(Structure):
             _fields_ = [("a", c_uint32, 32)]
@@ -250,7 +249,7 @@
         x.a = 0xFDCBA987
         self.assertEqual(x.a, 0xFDCBA987)
 
-    @unittest.skipUnless(hasattr(ctypes, "c_uint64"), "c_int64 is required")
+    @need_symbol('c_uint64')
     def test_uint64(self):
         class X(Structure):
             _fields_ = [("a", c_uint64, 64)]
diff --git a/Lib/ctypes/test/test_buffers.py b/Lib/ctypes/test/test_buffers.py
index 0d12f47..166faaf 100644
--- a/Lib/ctypes/test/test_buffers.py
+++ b/Lib/ctypes/test/test_buffers.py
@@ -1,4 +1,5 @@
 from ctypes import *
+from ctypes.test import need_symbol
 import unittest
 
 class StringBufferTestCase(unittest.TestCase):
@@ -20,43 +21,44 @@
         self.assertEqual(b[::2], b"ac")
         self.assertEqual(b[::5], b"a")
 
+        self.assertRaises(TypeError, create_string_buffer, "abc")
+
     def test_buffer_interface(self):
         self.assertEqual(len(bytearray(create_string_buffer(0))), 0)
         self.assertEqual(len(bytearray(create_string_buffer(1))), 1)
 
-    try:
-        c_wchar
-    except NameError:
-        pass
-    else:
-        def test_unicode_buffer(self):
-            b = create_unicode_buffer(32)
-            self.assertEqual(len(b), 32)
-            self.assertEqual(sizeof(b), 32 * sizeof(c_wchar))
-            self.assertIs(type(b[0]), str)
+    @need_symbol('c_wchar')
+    def test_unicode_buffer(self):
+        b = create_unicode_buffer(32)
+        self.assertEqual(len(b), 32)
+        self.assertEqual(sizeof(b), 32 * sizeof(c_wchar))
+        self.assertIs(type(b[0]), str)
 
-            b = create_unicode_buffer("abc")
-            self.assertEqual(len(b), 4) # trailing nul char
-            self.assertEqual(sizeof(b), 4 * sizeof(c_wchar))
-            self.assertIs(type(b[0]), str)
-            self.assertEqual(b[0], "a")
-            self.assertEqual(b[:], "abc\0")
-            self.assertEqual(b[::], "abc\0")
-            self.assertEqual(b[::-1], "\0cba")
-            self.assertEqual(b[::2], "ac")
-            self.assertEqual(b[::5], "a")
+        b = create_unicode_buffer("abc")
+        self.assertEqual(len(b), 4) # trailing nul char
+        self.assertEqual(sizeof(b), 4 * sizeof(c_wchar))
+        self.assertIs(type(b[0]), str)
+        self.assertEqual(b[0], "a")
+        self.assertEqual(b[:], "abc\0")
+        self.assertEqual(b[::], "abc\0")
+        self.assertEqual(b[::-1], "\0cba")
+        self.assertEqual(b[::2], "ac")
+        self.assertEqual(b[::5], "a")
 
-        def test_unicode_conversion(self):
-            b = create_unicode_buffer("abc")
-            self.assertEqual(len(b), 4) # trailing nul char
-            self.assertEqual(sizeof(b), 4 * sizeof(c_wchar))
-            self.assertIs(type(b[0]), str)
-            self.assertEqual(b[0], "a")
-            self.assertEqual(b[:], "abc\0")
-            self.assertEqual(b[::], "abc\0")
-            self.assertEqual(b[::-1], "\0cba")
-            self.assertEqual(b[::2], "ac")
-            self.assertEqual(b[::5], "a")
+        self.assertRaises(TypeError, create_unicode_buffer, b"abc")
+
+    @need_symbol('c_wchar')
+    def test_unicode_conversion(self):
+        b = create_unicode_buffer("abc")
+        self.assertEqual(len(b), 4) # trailing nul char
+        self.assertEqual(sizeof(b), 4 * sizeof(c_wchar))
+        self.assertIs(type(b[0]), str)
+        self.assertEqual(b[0], "a")
+        self.assertEqual(b[:], "abc\0")
+        self.assertEqual(b[::], "abc\0")
+        self.assertEqual(b[::-1], "\0cba")
+        self.assertEqual(b[::2], "ac")
+        self.assertEqual(b[::5], "a")
 
 if __name__ == "__main__":
     unittest.main()
diff --git a/Lib/ctypes/test/test_bytes.py b/Lib/ctypes/test/test_bytes.py
index ee49c45..20fa056 100644
--- a/Lib/ctypes/test/test_bytes.py
+++ b/Lib/ctypes/test/test_bytes.py
@@ -6,27 +6,40 @@
 class BytesTest(unittest.TestCase):
     def test_c_char(self):
         x = c_char(b"x")
+        self.assertRaises(TypeError, c_char, "x")
         x.value = b"y"
+        with self.assertRaises(TypeError):
+            x.value = "y"
         c_char.from_param(b"x")
+        self.assertRaises(TypeError, c_char.from_param, "x")
         (c_char * 3)(b"a", b"b", b"c")
+        self.assertRaises(TypeError, c_char * 3, "a", "b", "c")
 
     def test_c_wchar(self):
         x = c_wchar("x")
+        self.assertRaises(TypeError, c_wchar, b"x")
         x.value = "y"
+        with self.assertRaises(TypeError):
+            x.value = b"y"
         c_wchar.from_param("x")
+        self.assertRaises(TypeError, c_wchar.from_param, b"x")
         (c_wchar * 3)("a", "b", "c")
+        self.assertRaises(TypeError, c_wchar * 3, b"a", b"b", b"c")
 
     def test_c_char_p(self):
         c_char_p(b"foo bar")
+        self.assertRaises(TypeError, c_char_p, "foo bar")
 
     def test_c_wchar_p(self):
         c_wchar_p("foo bar")
+        self.assertRaises(TypeError, c_wchar_p, b"foo bar")
 
     def test_struct(self):
         class X(Structure):
             _fields_ = [("a", c_char * 3)]
 
         x = X(b"abc")
+        self.assertRaises(TypeError, X, "abc")
         self.assertEqual(x.a, b"abc")
         self.assertEqual(type(x.a), bytes)
 
@@ -35,16 +48,18 @@
             _fields_ = [("a", c_wchar * 3)]
 
         x = X("abc")
+        self.assertRaises(TypeError, X, b"abc")
         self.assertEqual(x.a, "abc")
         self.assertEqual(type(x.a), str)
 
-    if sys.platform == "win32":
-        def test_BSTR(self):
-            from _ctypes import _SimpleCData
-            class BSTR(_SimpleCData):
-                _type_ = "X"
+    @unittest.skipUnless(sys.platform == "win32", 'Windows-specific test')
+    def test_BSTR(self):
+        from _ctypes import _SimpleCData
+        class BSTR(_SimpleCData):
+            _type_ = "X"
 
-            BSTR("abc")
+        BSTR("abc")
+
 
 if __name__ == '__main__':
     unittest.main()
diff --git a/Lib/ctypes/test/test_byteswap.py b/Lib/ctypes/test/test_byteswap.py
index 63dde13..427bb8b 100644
--- a/Lib/ctypes/test/test_byteswap.py
+++ b/Lib/ctypes/test/test_byteswap.py
@@ -14,7 +14,8 @@
 # For Structures and Unions, these types are created on demand.
 
 class Test(unittest.TestCase):
-    def X_test(self):
+    @unittest.skip('test disabled')
+    def test_X(self):
         print(sys.byteorder, file=sys.stderr)
         for i in range(32):
             bits = BITS()
diff --git a/Lib/ctypes/test/test_callbacks.py b/Lib/ctypes/test/test_callbacks.py
index 5600b43..3824f7c 100644
--- a/Lib/ctypes/test/test_callbacks.py
+++ b/Lib/ctypes/test/test_callbacks.py
@@ -1,5 +1,6 @@
 import unittest
 from ctypes import *
+from ctypes.test import need_symbol
 import _ctypes_test
 
 class Callbacks(unittest.TestCase):
@@ -88,9 +89,10 @@
     # disabled: would now (correctly) raise a RuntimeWarning about
     # a memory leak.  A callback function cannot return a non-integral
     # C type without causing a memory leak.
-##    def test_char_p(self):
-##        self.check_type(c_char_p, "abc")
-##        self.check_type(c_char_p, "def")
+    @unittest.skip('test disabled')
+    def test_char_p(self):
+        self.check_type(c_char_p, "abc")
+        self.check_type(c_char_p, "def")
 
     def test_pyobject(self):
         o = ()
@@ -142,13 +144,12 @@
         CFUNCTYPE(None)(lambda x=Nasty(): None)
 
 
-try:
-    WINFUNCTYPE
-except NameError:
-    pass
-else:
-    class StdcallCallbacks(Callbacks):
+@need_symbol('WINFUNCTYPE')
+class StdcallCallbacks(Callbacks):
+    try:
         functype = WINFUNCTYPE
+    except NameError:
+        pass
 
 ################################################################
 
@@ -178,7 +179,7 @@
         from ctypes.util import find_library
         libc_path = find_library("c")
         if not libc_path:
-            return # cannot test
+            self.skipTest('could not find libc')
         libc = CDLL(libc_path)
 
         @CFUNCTYPE(c_int, POINTER(c_int), POINTER(c_int))
@@ -190,23 +191,19 @@
         libc.qsort(array, len(array), sizeof(c_int), cmp_func)
         self.assertEqual(array[:], [1, 5, 7, 33, 99])
 
-    try:
-        WINFUNCTYPE
-    except NameError:
-        pass
-    else:
-        def test_issue_8959_b(self):
-            from ctypes.wintypes import BOOL, HWND, LPARAM
+    @need_symbol('WINFUNCTYPE')
+    def test_issue_8959_b(self):
+        from ctypes.wintypes import BOOL, HWND, LPARAM
+        global windowCount
+        windowCount = 0
+
+        @WINFUNCTYPE(BOOL, HWND, LPARAM)
+        def EnumWindowsCallbackFunc(hwnd, lParam):
             global windowCount
-            windowCount = 0
+            windowCount += 1
+            return True #Allow windows to keep enumerating
 
-            @WINFUNCTYPE(BOOL, HWND, LPARAM)
-            def EnumWindowsCallbackFunc(hwnd, lParam):
-                global windowCount
-                windowCount += 1
-                return True #Allow windows to keep enumerating
-
-            windll.user32.EnumWindows(EnumWindowsCallbackFunc, 0)
+        windll.user32.EnumWindows(EnumWindowsCallbackFunc, 0)
 
     def test_callback_register_int(self):
         # Issue #8275: buggy handling of callback args under Win64
diff --git a/Lib/ctypes/test/test_cast.py b/Lib/ctypes/test/test_cast.py
index 32496f6..187d2bd 100644
--- a/Lib/ctypes/test/test_cast.py
+++ b/Lib/ctypes/test/test_cast.py
@@ -1,4 +1,5 @@
 from ctypes import *
+from ctypes.test import need_symbol
 import unittest
 import sys
 
@@ -75,15 +76,11 @@
         self.assertEqual(cast(cast(s, c_void_p), c_char_p).value,
                              b"hiho")
 
-    try:
-        c_wchar_p
-    except NameError:
-        pass
-    else:
-        def test_wchar_p(self):
-            s = c_wchar_p("hiho")
-            self.assertEqual(cast(cast(s, c_void_p), c_wchar_p).value,
-                                 "hiho")
+    @need_symbol('c_wchar_p')
+    def test_wchar_p(self):
+        s = c_wchar_p("hiho")
+        self.assertEqual(cast(cast(s, c_void_p), c_wchar_p).value,
+                             "hiho")
 
 if __name__ == "__main__":
     unittest.main()
diff --git a/Lib/ctypes/test/test_cfuncs.py b/Lib/ctypes/test/test_cfuncs.py
index a080496..ac2240f 100644
--- a/Lib/ctypes/test/test_cfuncs.py
+++ b/Lib/ctypes/test/test_cfuncs.py
@@ -3,6 +3,7 @@
 
 import unittest
 from ctypes import *
+from ctypes.test import need_symbol
 
 import _ctypes_test
 
@@ -193,7 +194,7 @@
 try:
     WinDLL
 except NameError:
-    pass
+    def stdcall_dll(*_): pass
 else:
     class stdcall_dll(WinDLL):
         def __getattr__(self, name):
@@ -203,9 +204,9 @@
             setattr(self, name, func)
             return func
 
-    class stdcallCFunctions(CFunctions):
-        _dll = stdcall_dll(_ctypes_test.__file__)
-        pass
+@need_symbol('WinDLL')
+class stdcallCFunctions(CFunctions):
+    _dll = stdcall_dll(_ctypes_test.__file__)
 
 if __name__ == '__main__':
     unittest.main()
diff --git a/Lib/ctypes/test/test_checkretval.py b/Lib/ctypes/test/test_checkretval.py
index 01ccc57..e9567dc 100644
--- a/Lib/ctypes/test/test_checkretval.py
+++ b/Lib/ctypes/test/test_checkretval.py
@@ -1,6 +1,7 @@
 import unittest
 
 from ctypes import *
+from ctypes.test import need_symbol
 
 class CHECKED(c_int):
     def _check_retval_(value):
@@ -25,15 +26,11 @@
         del dll._testfunc_p_p.restype
         self.assertEqual(42, dll._testfunc_p_p(42))
 
-    try:
-        oledll
-    except NameError:
-        pass
-    else:
-        def test_oledll(self):
-            self.assertRaises(WindowsError,
-                                  oledll.oleaut32.CreateTypeLib2,
-                                  0, None, None)
+    @need_symbol('oledll')
+    def test_oledll(self):
+        self.assertRaises(OSError,
+                              oledll.oleaut32.CreateTypeLib2,
+                              0, None, None)
 
 if __name__ == "__main__":
     unittest.main()
diff --git a/Lib/ctypes/test/test_errcheck.py b/Lib/ctypes/test/test_errcheck.py
deleted file mode 100644
index a4913f9..0000000
--- a/Lib/ctypes/test/test_errcheck.py
+++ /dev/null
@@ -1,19 +0,0 @@
-import sys
-from ctypes import *
-
-##class HMODULE(Structure):
-##    _fields_ = [("value", c_void_p)]
-
-##    def __repr__(self):
-##        return "<HMODULE %s>" % self.value
-
-##windll.kernel32.GetModuleHandleA.restype = HMODULE
-
-##print windll.kernel32.GetModuleHandleA("python23.dll")
-##print hex(sys.dllhandle)
-
-##def nonzero(handle):
-##    return (GetLastError(), handle)
-
-##windll.kernel32.GetModuleHandleA.errcheck = nonzero
-##print windll.kernel32.GetModuleHandleA("spam")
diff --git a/Lib/ctypes/test/test_find.py b/Lib/ctypes/test/test_find.py
index c54b69b..d8cd8ad 100644
--- a/Lib/ctypes/test/test_find.py
+++ b/Lib/ctypes/test/test_find.py
@@ -1,82 +1,81 @@
 import unittest
+import os
 import sys
+import test.support
 from ctypes import *
 from ctypes.util import find_library
-from ctypes.test import is_resource_enabled
-
-if sys.platform == "win32":
-    lib_gl = find_library("OpenGL32")
-    lib_glu = find_library("Glu32")
-    lib_gle = None
-elif sys.platform == "darwin":
-    lib_gl = lib_glu = find_library("OpenGL")
-    lib_gle = None
-else:
-    lib_gl = find_library("GL")
-    lib_glu = find_library("GLU")
-    lib_gle = find_library("gle")
-
-## print, for debugging
-if is_resource_enabled("printing"):
-    if lib_gl or lib_glu or lib_gle:
-        print("OpenGL libraries:")
-        for item in (("GL", lib_gl),
-                     ("GLU", lib_glu),
-                     ("gle", lib_gle)):
-            print("\t", item)
-
 
 # On some systems, loading the OpenGL libraries needs the RTLD_GLOBAL mode.
 class Test_OpenGL_libs(unittest.TestCase):
-    def setUp(self):
-        self.gl = self.glu = self.gle = None
+    @classmethod
+    def setUpClass(cls):
+        lib_gl = lib_glu = lib_gle = None
+        if sys.platform == "win32":
+            lib_gl = find_library("OpenGL32")
+            lib_glu = find_library("Glu32")
+        elif sys.platform == "darwin":
+            lib_gl = lib_glu = find_library("OpenGL")
+        else:
+            lib_gl = find_library("GL")
+            lib_glu = find_library("GLU")
+            lib_gle = find_library("gle")
+
+        ## print, for debugging
+        if test.support.verbose:
+            print("OpenGL libraries:")
+            for item in (("GL", lib_gl),
+                         ("GLU", lib_glu),
+                         ("gle", lib_gle)):
+                print("\t", item)
+
+        cls.gl = cls.glu = cls.gle = None
         if lib_gl:
-            self.gl = CDLL(lib_gl, mode=RTLD_GLOBAL)
+            cls.gl = CDLL(lib_gl, mode=RTLD_GLOBAL)
         if lib_glu:
-            self.glu = CDLL(lib_glu, RTLD_GLOBAL)
+            cls.glu = CDLL(lib_glu, RTLD_GLOBAL)
         if lib_gle:
             try:
-                self.gle = CDLL(lib_gle)
+                cls.gle = CDLL(lib_gle)
             except OSError:
                 pass
 
-    if lib_gl:
-        def test_gl(self):
-            if self.gl:
-                self.gl.glClearIndex
+    def test_gl(self):
+        if self.gl is None:
+            self.skipTest('lib_gl not available')
+        self.gl.glClearIndex
 
-    if lib_glu:
-        def test_glu(self):
-            if self.glu:
-                self.glu.gluBeginCurve
+    def test_glu(self):
+        if self.glu is None:
+            self.skipTest('lib_glu not available')
+        self.glu.gluBeginCurve
 
-    if lib_gle:
-        def test_gle(self):
-            if self.gle:
-                self.gle.gleGetJoinStyle
+    def test_gle(self):
+        if self.gle is None:
+            self.skipTest('lib_gle not available')
+        self.gle.gleGetJoinStyle
 
-##if os.name == "posix" and sys.platform != "darwin":
-
-##    # On platforms where the default shared library suffix is '.so',
-##    # at least some libraries can be loaded as attributes of the cdll
-##    # object, since ctypes now tries loading the lib again
-##    # with '.so' appended of the first try fails.
-##    #
-##    # Won't work for libc, unfortunately.  OTOH, it isn't
-##    # needed for libc since this is already mapped into the current
-##    # process (?)
-##    #
-##    # On MAC OSX, it won't work either, because dlopen() needs a full path,
-##    # and the default suffix is either none or '.dylib'.
-
-##    class LoadLibs(unittest.TestCase):
-##        def test_libm(self):
-##            import math
-##            libm = cdll.libm
-##            sqrt = libm.sqrt
-##            sqrt.argtypes = (c_double,)
-##            sqrt.restype = c_double
-##            self.assertEqual(sqrt(2), math.sqrt(2))
+# On platforms where the default shared library suffix is '.so',
+# at least some libraries can be loaded as attributes of the cdll
+# object, since ctypes now tries loading the lib again
+# with '.so' appended of the first try fails.
+#
+# Won't work for libc, unfortunately.  OTOH, it isn't
+# needed for libc since this is already mapped into the current
+# process (?)
+#
+# On MAC OSX, it won't work either, because dlopen() needs a full path,
+# and the default suffix is either none or '.dylib'.
+@unittest.skip('test disabled')
+@unittest.skipUnless(os.name=="posix" and sys.platform != "darwin",
+                     'test not suitable for this platform')
+class LoadLibs(unittest.TestCase):
+    def test_libm(self):
+        import math
+        libm = cdll.libm
+        sqrt = libm.sqrt
+        sqrt.argtypes = (c_double,)
+        sqrt.restype = c_double
+        self.assertEqual(sqrt(2), math.sqrt(2))
 
 if __name__ == "__main__":
     unittest.main()
diff --git a/Lib/ctypes/test/test_frombuffer.py b/Lib/ctypes/test/test_frombuffer.py
index ffb27a6..6aa2d1c 100644
--- a/Lib/ctypes/test/test_frombuffer.py
+++ b/Lib/ctypes/test/test_frombuffer.py
@@ -10,7 +10,7 @@
         self._init_called = True
 
 class Test(unittest.TestCase):
-    def test_fom_buffer(self):
+    def test_from_buffer(self):
         a = array.array("i", range(16))
         x = (c_int * 16).from_buffer(a)
 
@@ -23,25 +23,37 @@
         a[0], a[-1] = 200, -200
         self.assertEqual(x[:], a.tolist())
 
-        self.assertIn(a, x._objects.values())
+        self.assertRaises(BufferError, a.append, 100)
+        self.assertRaises(BufferError, a.pop)
 
-        self.assertRaises(ValueError,
-                          c_int.from_buffer, a, -1)
+        del x; del y; gc.collect(); gc.collect(); gc.collect()
+        a.append(100)
+        a.pop()
+        x = (c_int * 16).from_buffer(a)
+
+        self.assertIn(a, [obj.obj if isinstance(obj, memoryview) else obj
+                          for obj in x._objects.values()])
 
         expected = x[:]
         del a; gc.collect(); gc.collect(); gc.collect()
         self.assertEqual(x[:], expected)
 
-        self.assertRaises(TypeError,
-                          (c_char * 16).from_buffer, "a" * 16)
+        with self.assertRaises(TypeError):
+            (c_char * 16).from_buffer(b"a" * 16)
+        with self.assertRaises(TypeError):
+            (c_char * 16).from_buffer("a" * 16)
 
-    def test_fom_buffer_with_offset(self):
+    def test_from_buffer_with_offset(self):
         a = array.array("i", range(16))
         x = (c_int * 15).from_buffer(a, sizeof(c_int))
 
         self.assertEqual(x[:], a.tolist()[1:])
-        self.assertRaises(ValueError, lambda: (c_int * 16).from_buffer(a, sizeof(c_int)))
-        self.assertRaises(ValueError, lambda: (c_int * 1).from_buffer(a, 16 * sizeof(c_int)))
+        with self.assertRaises(ValueError):
+            c_int.from_buffer(a, -1)
+        with self.assertRaises(ValueError):
+            (c_int * 16).from_buffer(a, sizeof(c_int))
+        with self.assertRaises(ValueError):
+            (c_int * 1).from_buffer(a, 16 * sizeof(c_int))
 
     def test_from_buffer_copy(self):
         a = array.array("i", range(16))
@@ -56,26 +68,30 @@
         a[0], a[-1] = 200, -200
         self.assertEqual(x[:], list(range(16)))
 
-        self.assertEqual(x._objects, None)
+        a.append(100)
+        self.assertEqual(x[:], list(range(16)))
 
-        self.assertRaises(ValueError,
-                          c_int.from_buffer, a, -1)
+        self.assertEqual(x._objects, None)
 
         del a; gc.collect(); gc.collect(); gc.collect()
         self.assertEqual(x[:], list(range(16)))
 
         x = (c_char * 16).from_buffer_copy(b"a" * 16)
         self.assertEqual(x[:], b"a" * 16)
+        with self.assertRaises(TypeError):
+            (c_char * 16).from_buffer_copy("a" * 16)
 
-    def test_fom_buffer_copy_with_offset(self):
+    def test_from_buffer_copy_with_offset(self):
         a = array.array("i", range(16))
         x = (c_int * 15).from_buffer_copy(a, sizeof(c_int))
 
         self.assertEqual(x[:], a.tolist()[1:])
-        self.assertRaises(ValueError,
-                          (c_int * 16).from_buffer_copy, a, sizeof(c_int))
-        self.assertRaises(ValueError,
-                          (c_int * 1).from_buffer_copy, a, 16 * sizeof(c_int))
+        with self.assertRaises(ValueError):
+            c_int.from_buffer_copy(a, -1)
+        with self.assertRaises(ValueError):
+            (c_int * 16).from_buffer_copy(a, sizeof(c_int))
+        with self.assertRaises(ValueError):
+            (c_int * 1).from_buffer_copy(a, 16 * sizeof(c_int))
 
 if __name__ == '__main__':
     unittest.main()
diff --git a/Lib/ctypes/test/test_functions.py b/Lib/ctypes/test/test_functions.py
index 07eeb68..7562892 100644
--- a/Lib/ctypes/test/test_functions.py
+++ b/Lib/ctypes/test/test_functions.py
@@ -6,6 +6,7 @@
 """
 
 from ctypes import *
+from ctypes.test import need_symbol
 import sys, unittest
 
 try:
@@ -63,22 +64,16 @@
             pass
 
 
+    @need_symbol('c_wchar')
     def test_wchar_parm(self):
-        try:
-            c_wchar
-        except NameError:
-            return
         f = dll._testfunc_i_bhilfd
         f.argtypes = [c_byte, c_wchar, c_int, c_long, c_float, c_double]
         result = f(1, "x", 3, 4, 5.0, 6.0)
         self.assertEqual(result, 139)
         self.assertEqual(type(result), int)
 
+    @need_symbol('c_wchar')
     def test_wchar_result(self):
-        try:
-            c_wchar
-        except NameError:
-            return
         f = dll._testfunc_i_bhilfd
         f.argtypes = [c_byte, c_short, c_int, c_long, c_float, c_double]
         f.restype = c_wchar
@@ -155,11 +150,8 @@
         self.assertEqual(result, -21)
         self.assertEqual(type(result), float)
 
+    @need_symbol('c_longlong')
     def test_longlongresult(self):
-        try:
-            c_longlong
-        except NameError:
-            return
         f = dll._testfunc_q_bhilfd
         f.restype = c_longlong
         f.argtypes = [c_byte, c_short, c_int, c_long, c_float, c_double]
@@ -296,6 +288,7 @@
         result = f(-10, cb)
         self.assertEqual(result, -18)
 
+    @need_symbol('c_longlong')
     def test_longlong_callbacks(self):
 
         f = dll._testfunc_callback_q_qf
@@ -348,16 +341,16 @@
         s2h = dll.ret_2h_func(inp)
         self.assertEqual((s2h.x, s2h.y), (99*2, 88*3))
 
-    if sys.platform == "win32":
-        def test_struct_return_2H_stdcall(self):
-            class S2H(Structure):
-                _fields_ = [("x", c_short),
-                            ("y", c_short)]
+    @unittest.skipUnless(sys.platform == "win32", 'Windows-specific test')
+    def test_struct_return_2H_stdcall(self):
+        class S2H(Structure):
+            _fields_ = [("x", c_short),
+                        ("y", c_short)]
 
-            windll.s_ret_2h_func.restype = S2H
-            windll.s_ret_2h_func.argtypes = [S2H]
-            s2h = windll.s_ret_2h_func(S2H(99, 88))
-            self.assertEqual((s2h.x, s2h.y), (99*2, 88*3))
+        windll.s_ret_2h_func.restype = S2H
+        windll.s_ret_2h_func.argtypes = [S2H]
+        s2h = windll.s_ret_2h_func(S2H(99, 88))
+        self.assertEqual((s2h.x, s2h.y), (99*2, 88*3))
 
     def test_struct_return_8H(self):
         class S8I(Structure):
@@ -376,23 +369,24 @@
         self.assertEqual((s8i.a, s8i.b, s8i.c, s8i.d, s8i.e, s8i.f, s8i.g, s8i.h),
                              (9*2, 8*3, 7*4, 6*5, 5*6, 4*7, 3*8, 2*9))
 
-    if sys.platform == "win32":
-        def test_struct_return_8H_stdcall(self):
-            class S8I(Structure):
-                _fields_ = [("a", c_int),
-                            ("b", c_int),
-                            ("c", c_int),
-                            ("d", c_int),
-                            ("e", c_int),
-                            ("f", c_int),
-                            ("g", c_int),
-                            ("h", c_int)]
-            windll.s_ret_8i_func.restype = S8I
-            windll.s_ret_8i_func.argtypes = [S8I]
-            inp = S8I(9, 8, 7, 6, 5, 4, 3, 2)
-            s8i = windll.s_ret_8i_func(inp)
-            self.assertEqual((s8i.a, s8i.b, s8i.c, s8i.d, s8i.e, s8i.f, s8i.g, s8i.h),
-                                 (9*2, 8*3, 7*4, 6*5, 5*6, 4*7, 3*8, 2*9))
+    @unittest.skipUnless(sys.platform == "win32", 'Windows-specific test')
+    def test_struct_return_8H_stdcall(self):
+        class S8I(Structure):
+            _fields_ = [("a", c_int),
+                        ("b", c_int),
+                        ("c", c_int),
+                        ("d", c_int),
+                        ("e", c_int),
+                        ("f", c_int),
+                        ("g", c_int),
+                        ("h", c_int)]
+        windll.s_ret_8i_func.restype = S8I
+        windll.s_ret_8i_func.argtypes = [S8I]
+        inp = S8I(9, 8, 7, 6, 5, 4, 3, 2)
+        s8i = windll.s_ret_8i_func(inp)
+        self.assertEqual(
+                (s8i.a, s8i.b, s8i.c, s8i.d, s8i.e, s8i.f, s8i.g, s8i.h),
+                (9*2, 8*3, 7*4, 6*5, 5*6, 4*7, 3*8, 2*9))
 
     def test_sf1651235(self):
         # see http://www.python.org/sf/1651235
diff --git a/Lib/ctypes/test/test_integers.py b/Lib/ctypes/test/test_integers.py
deleted file mode 100644
index 62e4b08..0000000
--- a/Lib/ctypes/test/test_integers.py
+++ /dev/null
@@ -1,5 +0,0 @@
-# superseded by test_numbers.py
-import unittest
-
-if __name__ == '__main__':
-    unittest.main()
diff --git a/Lib/ctypes/test/test_internals.py b/Lib/ctypes/test/test_internals.py
index cbf2e05..271e3f5 100644
--- a/Lib/ctypes/test/test_internals.py
+++ b/Lib/ctypes/test/test_internals.py
@@ -5,17 +5,14 @@
 
 # XXX This test must be reviewed for correctness!!!
 
-"""
-ctypes' types are container types.
-
-They have an internal memory block, which only consists of some bytes,
-but it has to keep references to other objects as well. This is not
-really needed for trivial C types like int or char, but it is important
-for aggregate types like strings or pointers in particular.
-
-What about pointers?
-
-"""
+# ctypes' types are container types.
+#
+# They have an internal memory block, which only consists of some bytes,
+# but it has to keep references to other objects as well. This is not
+# really needed for trivial C types like int or char, but it is important
+# for aggregate types like strings or pointers in particular.
+#
+# What about pointers?
 
 class ObjectsTestCase(unittest.TestCase):
     def assertSame(self, a, b):
diff --git a/Lib/ctypes/test/test_keeprefs.py b/Lib/ctypes/test/test_keeprefs.py
index db8adfb..94c0257 100644
--- a/Lib/ctypes/test/test_keeprefs.py
+++ b/Lib/ctypes/test/test_keeprefs.py
@@ -94,7 +94,8 @@
         self.assertEqual(x._objects, {'1': i})
 
 class DeletePointerTestCase(unittest.TestCase):
-    def X_test(self):
+    @unittest.skip('test disabled')
+    def test_X(self):
         class X(Structure):
             _fields_ = [("p", POINTER(c_char_p))]
         x = X()
diff --git a/Lib/ctypes/test/test_loading.py b/Lib/ctypes/test/test_loading.py
index 414363d..4fb8964 100644
--- a/Lib/ctypes/test/test_loading.py
+++ b/Lib/ctypes/test/test_loading.py
@@ -1,38 +1,46 @@
 from ctypes import *
-import sys, unittest
 import os
+import sys
+import unittest
+import test.support
 from ctypes.util import find_library
-from ctypes.test import is_resource_enabled
 
 libc_name = None
-if os.name == "nt":
-    libc_name = find_library("c")
-elif os.name == "ce":
-    libc_name = "coredll"
-elif sys.platform == "cygwin":
-    libc_name = "cygwin1.dll"
-else:
-    libc_name = find_library("c")
 
-if is_resource_enabled("printing"):
-    print("libc_name is", libc_name)
+def setUpModule():
+    global libc_name
+    if os.name == "nt":
+        libc_name = find_library("c")
+    elif os.name == "ce":
+        libc_name = "coredll"
+    elif sys.platform == "cygwin":
+        libc_name = "cygwin1.dll"
+    else:
+        libc_name = find_library("c")
+
+    if test.support.verbose:
+        print("libc_name is", libc_name)
 
 class LoaderTest(unittest.TestCase):
 
     unknowndll = "xxrandomnamexx"
 
-    if libc_name is not None:
-        def test_load(self):
-            CDLL(libc_name)
-            CDLL(os.path.basename(libc_name))
-            self.assertRaises(OSError, CDLL, self.unknowndll)
+    def test_load(self):
+        if libc_name is None:
+            self.skipTest('could not find libc')
+        CDLL(libc_name)
+        CDLL(os.path.basename(libc_name))
+        self.assertRaises(OSError, CDLL, self.unknowndll)
 
-    if libc_name is not None and os.path.basename(libc_name) == "libc.so.6":
-        def test_load_version(self):
-            cdll.LoadLibrary("libc.so.6")
-            # linux uses version, libc 9 should not exist
-            self.assertRaises(OSError, cdll.LoadLibrary, "libc.so.9")
-            self.assertRaises(OSError, cdll.LoadLibrary, self.unknowndll)
+    def test_load_version(self):
+        if libc_name is None:
+            self.skipTest('could not find libc')
+        if os.path.basename(libc_name) != 'libc.so.6':
+            self.skipTest('wrong libc path for test')
+        cdll.LoadLibrary("libc.so.6")
+        # linux uses version, libc 9 should not exist
+        self.assertRaises(OSError, cdll.LoadLibrary, "libc.so.9")
+        self.assertRaises(OSError, cdll.LoadLibrary, self.unknowndll)
 
     def test_find(self):
         for name in ("c", "m"):
@@ -41,66 +49,71 @@
                 cdll.LoadLibrary(lib)
                 CDLL(lib)
 
-    if os.name in ("nt", "ce"):
-        def test_load_library(self):
-            self.assertIsNotNone(libc_name)
-            if is_resource_enabled("printing"):
-                print(find_library("kernel32"))
-                print(find_library("user32"))
+    @unittest.skipUnless(os.name in ("nt", "ce"),
+                         'test specific to Windows (NT/CE)')
+    def test_load_library(self):
+        self.assertIsNotNone(libc_name)
+        if test.support.verbose:
+            print(find_library("kernel32"))
+            print(find_library("user32"))
 
-            if os.name == "nt":
-                windll.kernel32.GetModuleHandleW
-                windll["kernel32"].GetModuleHandleW
-                windll.LoadLibrary("kernel32").GetModuleHandleW
-                WinDLL("kernel32").GetModuleHandleW
-            elif os.name == "ce":
-                windll.coredll.GetModuleHandleW
-                windll["coredll"].GetModuleHandleW
-                windll.LoadLibrary("coredll").GetModuleHandleW
-                WinDLL("coredll").GetModuleHandleW
+        if os.name == "nt":
+            windll.kernel32.GetModuleHandleW
+            windll["kernel32"].GetModuleHandleW
+            windll.LoadLibrary("kernel32").GetModuleHandleW
+            WinDLL("kernel32").GetModuleHandleW
+        elif os.name == "ce":
+            windll.coredll.GetModuleHandleW
+            windll["coredll"].GetModuleHandleW
+            windll.LoadLibrary("coredll").GetModuleHandleW
+            WinDLL("coredll").GetModuleHandleW
 
-        def test_load_ordinal_functions(self):
-            import _ctypes_test
-            dll = WinDLL(_ctypes_test.__file__)
-            # We load the same function both via ordinal and name
-            func_ord = dll[2]
-            func_name = dll.GetString
-            # addressof gets the address where the function pointer is stored
-            a_ord = addressof(func_ord)
-            a_name = addressof(func_name)
-            f_ord_addr = c_void_p.from_address(a_ord).value
-            f_name_addr = c_void_p.from_address(a_name).value
-            self.assertEqual(hex(f_ord_addr), hex(f_name_addr))
+    @unittest.skipUnless(os.name in ("nt", "ce"),
+                         'test specific to Windows (NT/CE)')
+    def test_load_ordinal_functions(self):
+        import _ctypes_test
+        dll = WinDLL(_ctypes_test.__file__)
+        # We load the same function both via ordinal and name
+        func_ord = dll[2]
+        func_name = dll.GetString
+        # addressof gets the address where the function pointer is stored
+        a_ord = addressof(func_ord)
+        a_name = addressof(func_name)
+        f_ord_addr = c_void_p.from_address(a_ord).value
+        f_name_addr = c_void_p.from_address(a_name).value
+        self.assertEqual(hex(f_ord_addr), hex(f_name_addr))
 
-            self.assertRaises(AttributeError, dll.__getitem__, 1234)
+        self.assertRaises(AttributeError, dll.__getitem__, 1234)
 
-    if os.name == "nt":
-        def test_1703286_A(self):
-            from _ctypes import LoadLibrary, FreeLibrary
-            # On winXP 64-bit, advapi32 loads at an address that does
-            # NOT fit into a 32-bit integer.  FreeLibrary must be able
-            # to accept this address.
+    @unittest.skipUnless(os.name == "nt", 'Windows-specific test')
+    def test_1703286_A(self):
+        from _ctypes import LoadLibrary, FreeLibrary
+        # On winXP 64-bit, advapi32 loads at an address that does
+        # NOT fit into a 32-bit integer.  FreeLibrary must be able
+        # to accept this address.
 
-            # These are tests for http://www.python.org/sf/1703286
-            handle = LoadLibrary("advapi32")
-            FreeLibrary(handle)
+        # These are tests for http://www.python.org/sf/1703286
+        handle = LoadLibrary("advapi32")
+        FreeLibrary(handle)
 
-        def test_1703286_B(self):
-            # Since on winXP 64-bit advapi32 loads like described
-            # above, the (arbitrarily selected) CloseEventLog function
-            # also has a high address.  'call_function' should accept
-            # addresses so large.
-            from _ctypes import call_function
-            advapi32 = windll.advapi32
-            # Calling CloseEventLog with a NULL argument should fail,
-            # but the call should not segfault or so.
-            self.assertEqual(0, advapi32.CloseEventLog(None))
-            windll.kernel32.GetProcAddress.argtypes = c_void_p, c_char_p
-            windll.kernel32.GetProcAddress.restype = c_void_p
-            proc = windll.kernel32.GetProcAddress(advapi32._handle, b"CloseEventLog")
-            self.assertTrue(proc)
-            # This is the real test: call the function via 'call_function'
-            self.assertEqual(0, call_function(proc, (None,)))
+    @unittest.skipUnless(os.name == "nt", 'Windows-specific test')
+    def test_1703286_B(self):
+        # Since on winXP 64-bit advapi32 loads like described
+        # above, the (arbitrarily selected) CloseEventLog function
+        # also has a high address.  'call_function' should accept
+        # addresses so large.
+        from _ctypes import call_function
+        advapi32 = windll.advapi32
+        # Calling CloseEventLog with a NULL argument should fail,
+        # but the call should not segfault or so.
+        self.assertEqual(0, advapi32.CloseEventLog(None))
+        windll.kernel32.GetProcAddress.argtypes = c_void_p, c_char_p
+        windll.kernel32.GetProcAddress.restype = c_void_p
+        proc = windll.kernel32.GetProcAddress(advapi32._handle,
+                                              b"CloseEventLog")
+        self.assertTrue(proc)
+        # This is the real test: call the function via 'call_function'
+        self.assertEqual(0, call_function(proc, (None,)))
 
 if __name__ == "__main__":
     unittest.main()
diff --git a/Lib/ctypes/test/test_macholib.py b/Lib/ctypes/test/test_macholib.py
index eda846d..6b35269 100644
--- a/Lib/ctypes/test/test_macholib.py
+++ b/Lib/ctypes/test/test_macholib.py
@@ -3,35 +3,33 @@
 import unittest
 
 # Bob Ippolito:
-"""
-Ok.. the code to find the filename for __getattr__ should look
-something like:
-
-import os
-from macholib.dyld import dyld_find
-
-def find_lib(name):
-     possible = ['lib'+name+'.dylib', name+'.dylib',
-     name+'.framework/'+name]
-     for dylib in possible:
-         try:
-             return os.path.realpath(dyld_find(dylib))
-         except ValueError:
-             pass
-     raise ValueError, "%s not found" % (name,)
-
-It'll have output like this:
-
- >>> find_lib('pthread')
-'/usr/lib/libSystem.B.dylib'
- >>> find_lib('z')
-'/usr/lib/libz.1.dylib'
- >>> find_lib('IOKit')
-'/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit'
-
--bob
-
-"""
+#
+# Ok.. the code to find the filename for __getattr__ should look
+# something like:
+#
+# import os
+# from macholib.dyld import dyld_find
+#
+# def find_lib(name):
+#      possible = ['lib'+name+'.dylib', name+'.dylib',
+#      name+'.framework/'+name]
+#      for dylib in possible:
+#          try:
+#              return os.path.realpath(dyld_find(dylib))
+#          except ValueError:
+#              pass
+#      raise ValueError, "%s not found" % (name,)
+#
+# It'll have output like this:
+#
+#  >>> find_lib('pthread')
+# '/usr/lib/libSystem.B.dylib'
+#  >>> find_lib('z')
+# '/usr/lib/libz.1.dylib'
+#  >>> find_lib('IOKit')
+# '/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit'
+#
+# -bob
 
 from ctypes.macholib.dyld import dyld_find
 
@@ -45,18 +43,21 @@
     raise ValueError("%s not found" % (name,))
 
 class MachOTest(unittest.TestCase):
-    if sys.platform == "darwin":
-        def test_find(self):
+    @unittest.skipUnless(sys.platform == "darwin", 'OSX-specific test')
+    def test_find(self):
 
-            self.assertEqual(find_lib('pthread'),
-                                 '/usr/lib/libSystem.B.dylib')
+        self.assertEqual(find_lib('pthread'),
+                             '/usr/lib/libSystem.B.dylib')
 
-            result = find_lib('z')
-            self.assertTrue(result.startswith('/usr/lib/libz.1'))
-            self.assertTrue(result.endswith('.dylib'))
+        result = find_lib('z')
+        # Issue #21093: dyld default search path includes $HOME/lib and
+        # /usr/local/lib before /usr/lib, which caused test failures if
+        # a local copy of libz exists in one of them. Now ignore the head
+        # of the path.
+        self.assertRegex(result, r".*/lib/libz\..*.*\.dylib")
 
-            self.assertEqual(find_lib('IOKit'),
-                                 '/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit')
+        self.assertEqual(find_lib('IOKit'),
+                             '/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit')
 
 if __name__ == "__main__":
     unittest.main()
diff --git a/Lib/ctypes/test/test_memfunctions.py b/Lib/ctypes/test/test_memfunctions.py
index aec4aaa..e784b9a 100644
--- a/Lib/ctypes/test/test_memfunctions.py
+++ b/Lib/ctypes/test/test_memfunctions.py
@@ -2,17 +2,19 @@
 from test import support
 import unittest
 from ctypes import *
+from ctypes.test import need_symbol
 
 class MemFunctionsTest(unittest.TestCase):
-##    def test_overflow(self):
-##        # string_at and wstring_at must use the Python calling
-##        # convention (which acquires the GIL and checks the Python
-##        # error flag).  Provoke an error and catch it; see also issue
-##        # #3554: <http://bugs.python.org/issue3554>
-##        self.assertRaises((OverflowError, MemoryError, SystemError),
-##                          lambda: wstring_at(u"foo", sys.maxint - 1))
-##        self.assertRaises((OverflowError, MemoryError, SystemError),
-##                          lambda: string_at("foo", sys.maxint - 1))
+    @unittest.skip('test disabled')
+    def test_overflow(self):
+        # string_at and wstring_at must use the Python calling
+        # convention (which acquires the GIL and checks the Python
+        # error flag).  Provoke an error and catch it; see also issue
+        # #3554: <http://bugs.python.org/issue3554>
+        self.assertRaises((OverflowError, MemoryError, SystemError),
+                          lambda: wstring_at(u"foo", sys.maxint - 1))
+        self.assertRaises((OverflowError, MemoryError, SystemError),
+                          lambda: string_at("foo", sys.maxint - 1))
 
     def test_memmove(self):
         # large buffers apparently increase the chance that the memory
@@ -61,21 +63,17 @@
         self.assertEqual(string_at(b"foo bar", 7), b"foo bar")
         self.assertEqual(string_at(b"foo bar", 3), b"foo")
 
-    try:
-        create_unicode_buffer
-    except NameError:
-        pass
-    else:
-        def test_wstring_at(self):
-            p = create_unicode_buffer("Hello, World")
-            a = create_unicode_buffer(1000000)
-            result = memmove(a, p, len(p) * sizeof(c_wchar))
-            self.assertEqual(a.value, "Hello, World")
+    @need_symbol('create_unicode_buffer')
+    def test_wstring_at(self):
+        p = create_unicode_buffer("Hello, World")
+        a = create_unicode_buffer(1000000)
+        result = memmove(a, p, len(p) * sizeof(c_wchar))
+        self.assertEqual(a.value, "Hello, World")
 
-            self.assertEqual(wstring_at(a), "Hello, World")
-            self.assertEqual(wstring_at(a, 5), "Hello")
-            self.assertEqual(wstring_at(a, 16), "Hello, World\0\0\0\0")
-            self.assertEqual(wstring_at(a, 0), "")
+        self.assertEqual(wstring_at(a), "Hello, World")
+        self.assertEqual(wstring_at(a, 5), "Hello")
+        self.assertEqual(wstring_at(a, 16), "Hello, World\0\0\0\0")
+        self.assertEqual(wstring_at(a, 0), "")
 
 if __name__ == "__main__":
     unittest.main()
diff --git a/Lib/ctypes/test/test_numbers.py b/Lib/ctypes/test/test_numbers.py
index 3b7194f..2afca26 100644
--- a/Lib/ctypes/test/test_numbers.py
+++ b/Lib/ctypes/test/test_numbers.py
@@ -82,12 +82,13 @@
             self.assertRaises(TypeError, t, "")
             self.assertRaises(TypeError, t, None)
 
-##    def test_valid_ranges(self):
-##        # invalid values of the correct type
-##        # raise ValueError (not OverflowError)
-##        for t, (l, h) in zip(unsigned_types, unsigned_ranges):
-##            self.assertRaises(ValueError, t, l-1)
-##            self.assertRaises(ValueError, t, h+1)
+    @unittest.skip('test disabled')
+    def test_valid_ranges(self):
+        # invalid values of the correct type
+        # raise ValueError (not OverflowError)
+        for t, (l, h) in zip(unsigned_types, unsigned_ranges):
+            self.assertRaises(ValueError, t, l-1)
+            self.assertRaises(ValueError, t, h+1)
 
     def test_from_param(self):
         # the from_param class method attribute always
@@ -200,16 +201,17 @@
         self.assertEqual(v.value, b'?')
 
     # array does not support c_bool / 't'
-    # def test_bool_from_address(self):
-    #     from ctypes import c_bool
-    #     from array import array
-    #     a = array(c_bool._type_, [True])
-    #     v = t.from_address(a.buffer_info()[0])
-    #     self.assertEqual(v.value, a[0])
-    #     self.assertEqual(type(v) is t)
-    #     a[0] = False
-    #     self.assertEqual(v.value, a[0])
-    #     self.assertEqual(type(v) is t)
+    @unittest.skip('test disabled')
+    def test_bool_from_address(self):
+        from ctypes import c_bool
+        from array import array
+        a = array(c_bool._type_, [True])
+        v = t.from_address(a.buffer_info()[0])
+        self.assertEqual(v.value, a[0])
+        self.assertEqual(type(v) is t)
+        a[0] = False
+        self.assertEqual(v.value, a[0])
+        self.assertEqual(type(v) is t)
 
     def test_init(self):
         # c_int() can be initialized from Python's int, and c_int.
@@ -227,8 +229,9 @@
             if (hasattr(t, "__ctype_le__")):
                 self.assertRaises(OverflowError, t.__ctype_le__, big_int)
 
-##    def test_perf(self):
-##        check_perf()
+    @unittest.skip('test disabled')
+    def test_perf(self):
+        check_perf()
 
 from ctypes import _SimpleCData
 class c_int_S(_SimpleCData):
diff --git a/Lib/ctypes/test/test_objects.py b/Lib/ctypes/test/test_objects.py
index f075c20..ef7b20b 100644
--- a/Lib/ctypes/test/test_objects.py
+++ b/Lib/ctypes/test/test_objects.py
@@ -59,12 +59,9 @@
 import ctypes.test.test_objects
 
 class TestCase(unittest.TestCase):
-    if sys.hexversion > 0x02040000:
-        # Python 2.3 has no ELLIPSIS flag, so we don't test with this
-        # version:
-        def test(self):
-            doctest.testmod(ctypes.test.test_objects)
+    def test(self):
+        failures, tests = doctest.testmod(ctypes.test.test_objects)
+        self.assertFalse(failures, 'doctests failed, see output above')
 
 if __name__ == '__main__':
-    if sys.hexversion > 0x02040000:
-        doctest.testmod(ctypes.test.test_objects)
+    doctest.testmod(ctypes.test.test_objects)
diff --git a/Lib/ctypes/test/test_parameters.py b/Lib/ctypes/test/test_parameters.py
index 12b5bd5..e56bccf 100644
--- a/Lib/ctypes/test/test_parameters.py
+++ b/Lib/ctypes/test/test_parameters.py
@@ -1,4 +1,5 @@
 import unittest, sys
+from ctypes.test import need_symbol
 
 class SimpleTypesTestCase(unittest.TestCase):
 
@@ -35,10 +36,9 @@
         self.assertEqual(CVOIDP.from_param("abc"), "abcabc")
         self.assertEqual(CCHARP.from_param("abc"), "abcabcabcabc")
 
-        try:
-            from ctypes import c_wchar_p
-        except ImportError:
-            return
+    @need_symbol('c_wchar_p')
+    def test_subclasses_c_wchar_p(self):
+        from ctypes import c_wchar_p
 
         class CWCHARP(c_wchar_p):
             def from_param(cls, value):
@@ -66,13 +66,9 @@
         a = c_char_p(b"123")
         self.assertIs(c_char_p.from_param(a), a)
 
+    @need_symbol('c_wchar_p')
     def test_cw_strings(self):
-        from ctypes import byref
-        try:
-            from ctypes import c_wchar_p
-        except ImportError:
-##            print "(No c_wchar_p)"
-            return
+        from ctypes import byref, c_wchar_p
 
         c_wchar_p.from_param("123")
 
@@ -139,9 +135,6 @@
         self.assertRaises(TypeError, LPINT.from_param, c_long*3)
         self.assertRaises(TypeError, LPINT.from_param, c_uint*3)
 
-##    def test_performance(self):
-##        check_perf()
-
     def test_noctypes_argtype(self):
         import _ctypes_test
         from ctypes import CDLL, c_void_p, ArgumentError
diff --git a/Lib/ctypes/test/test_pep3118.py b/Lib/ctypes/test/test_pep3118.py
index ad13b01..32f802c 100644
--- a/Lib/ctypes/test/test_pep3118.py
+++ b/Lib/ctypes/test/test_pep3118.py
@@ -96,6 +96,9 @@
 class aUnion(Union):
     _fields_ = [("a", c_int)]
 
+class StructWithArrays(Structure):
+    _fields_ = [("x", c_long * 3 * 2), ("y", Point * 4)]
+
 class Incomplete(Structure):
     pass
 
@@ -145,10 +148,10 @@
 
     ## arrays and pointers
 
-    (c_double * 4,              "(4)<d",                (4,),           c_double),
-    (c_float * 4 * 3 * 2,       "(2,3,4)<f",            (2,3,4),        c_float),
-    (POINTER(c_short) * 2,      "(2)&<h",               (2,),           POINTER(c_short)),
-    (POINTER(c_short) * 2 * 3,  "(3,2)&<h",             (3,2,),         POINTER(c_short)),
+    (c_double * 4,              "<d",                   (4,),           c_double),
+    (c_float * 4 * 3 * 2,       "<f",                   (2,3,4),        c_float),
+    (POINTER(c_short) * 2,      "&<h",                  (2,),           POINTER(c_short)),
+    (POINTER(c_short) * 2 * 3,  "&<h",                  (3,2,),         POINTER(c_short)),
     (POINTER(c_short * 2),      "&(2)<h",               (),           POINTER(c_short)),
 
     ## structures and unions
@@ -160,6 +163,9 @@
     (EmptyStruct,               "T{}",                  (),           EmptyStruct),
     # the pep does't support unions
     (aUnion,                    "B",                    (),           aUnion),
+    # structure with sub-arrays
+    (StructWithArrays,          "T{(2,3)<l:x:(4)T{<l:x:<l:y:}:y:}", (),  StructWithArrays),
+    (StructWithArrays * 3,      "T{(2,3)<l:x:(4)T{<l:x:<l:y:}:y:}", (3,),  StructWithArrays),
 
     ## pointer to incomplete structure
     (Incomplete,                "B",                    (),           Incomplete),
diff --git a/Lib/ctypes/test/test_pickling.py b/Lib/ctypes/test/test_pickling.py
index 8c91222..c4a79b9 100644
--- a/Lib/ctypes/test/test_pickling.py
+++ b/Lib/ctypes/test/test_pickling.py
@@ -14,9 +14,9 @@
 class Y(X):
     _fields_ = [("str", c_char_p)]
 
-class PickleTest(unittest.TestCase):
+class PickleTest:
     def dumps(self, item):
-        return pickle.dumps(item)
+        return pickle.dumps(item, self.proto)
 
     def loads(self, item):
         return pickle.loads(item)
@@ -67,17 +67,15 @@
             self.assertRaises(ValueError, lambda: self.dumps(item))
 
     def test_wchar(self):
-        pickle.dumps(c_char(b"x"))
+        self.dumps(c_char(b"x"))
         # Issue 5049
-        pickle.dumps(c_wchar("x"))
+        self.dumps(c_wchar("x"))
 
-class PickleTest_1(PickleTest):
-    def dumps(self, item):
-        return pickle.dumps(item, 1)
-
-class PickleTest_2(PickleTest):
-    def dumps(self, item):
-        return pickle.dumps(item, 2)
+for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+    name = 'PickleTest_%s' % proto
+    globals()[name] = type(name,
+                           (PickleTest, unittest.TestCase),
+                           {'proto': proto})
 
 if __name__ == "__main__":
     unittest.main()
diff --git a/Lib/ctypes/test/test_pointers.py b/Lib/ctypes/test/test_pointers.py
index f8ef0ab..4cd3a7a 100644
--- a/Lib/ctypes/test/test_pointers.py
+++ b/Lib/ctypes/test/test_pointers.py
@@ -7,6 +7,8 @@
                  c_long, c_ulong, c_longlong, c_ulonglong, c_double, c_float]
 python_types = [int, int, int, int, int, int,
                 int, int, int, int, float, float]
+LargeNamedType = type('T' * 2 ** 25, (Structure,), {})
+large_string = 'T' * 2 ** 25
 
 class PointersTestCase(unittest.TestCase):
 
@@ -188,5 +190,11 @@
             mth = WINFUNCTYPE(None)(42, "name", (), None)
             self.assertEqual(bool(mth), True)
 
+    def test_pointer_type_name(self):
+        self.assertTrue(POINTER(LargeNamedType))
+
+    def test_pointer_type_str_name(self):
+        self.assertTrue(POINTER(large_string))
+
 if __name__ == '__main__':
     unittest.main()
diff --git a/Lib/ctypes/test/test_prototypes.py b/Lib/ctypes/test/test_prototypes.py
index 6ef1b1b..818c111 100644
--- a/Lib/ctypes/test/test_prototypes.py
+++ b/Lib/ctypes/test/test_prototypes.py
@@ -1,4 +1,5 @@
 from ctypes import *
+from ctypes.test import need_symbol
 import unittest
 
 # IMPORTANT INFO:
@@ -135,13 +136,14 @@
         func(pointer(c_int()))
         func((c_int * 3)())
 
-        try:
-            func.restype = c_wchar_p
-        except NameError:
-            pass
-        else:
-            self.assertEqual(None, func(c_wchar_p(None)))
-            self.assertEqual("123", func(c_wchar_p("123")))
+    @need_symbol('c_wchar_p')
+    def test_c_void_p_arg_with_c_wchar_p(self):
+        func = testdll._testfunc_p_p
+        func.restype = c_wchar_p
+        func.argtypes = c_void_p,
+
+        self.assertEqual(None, func(c_wchar_p(None)))
+        self.assertEqual("123", func(c_wchar_p("123")))
 
     def test_instance(self):
         func = testdll._testfunc_p_p
@@ -156,51 +158,47 @@
         func.argtypes = None
         self.assertEqual(None, func(X()))
 
-try:
-    c_wchar
-except NameError:
-    pass
-else:
-    class WCharPointersTestCase(unittest.TestCase):
+@need_symbol('c_wchar')
+class WCharPointersTestCase(unittest.TestCase):
 
-        def setUp(self):
-            func = testdll._testfunc_p_p
-            func.restype = c_int
-            func.argtypes = None
+    def setUp(self):
+        func = testdll._testfunc_p_p
+        func.restype = c_int
+        func.argtypes = None
 
 
-        def test_POINTER_c_wchar_arg(self):
-            func = testdll._testfunc_p_p
-            func.restype = c_wchar_p
-            func.argtypes = POINTER(c_wchar),
+    def test_POINTER_c_wchar_arg(self):
+        func = testdll._testfunc_p_p
+        func.restype = c_wchar_p
+        func.argtypes = POINTER(c_wchar),
 
-            self.assertEqual(None, func(None))
-            self.assertEqual("123", func("123"))
-            self.assertEqual(None, func(c_wchar_p(None)))
-            self.assertEqual("123", func(c_wchar_p("123")))
+        self.assertEqual(None, func(None))
+        self.assertEqual("123", func("123"))
+        self.assertEqual(None, func(c_wchar_p(None)))
+        self.assertEqual("123", func(c_wchar_p("123")))
 
-            self.assertEqual("123", func(c_wbuffer("123")))
-            ca = c_wchar("a")
-            self.assertEqual("a", func(pointer(ca))[0])
-            self.assertEqual("a", func(byref(ca))[0])
+        self.assertEqual("123", func(c_wbuffer("123")))
+        ca = c_wchar("a")
+        self.assertEqual("a", func(pointer(ca))[0])
+        self.assertEqual("a", func(byref(ca))[0])
 
-        def test_c_wchar_p_arg(self):
-            func = testdll._testfunc_p_p
-            func.restype = c_wchar_p
-            func.argtypes = c_wchar_p,
+    def test_c_wchar_p_arg(self):
+        func = testdll._testfunc_p_p
+        func.restype = c_wchar_p
+        func.argtypes = c_wchar_p,
 
-            c_wchar_p.from_param("123")
+        c_wchar_p.from_param("123")
 
-            self.assertEqual(None, func(None))
-            self.assertEqual("123", func("123"))
-            self.assertEqual(None, func(c_wchar_p(None)))
-            self.assertEqual("123", func(c_wchar_p("123")))
+        self.assertEqual(None, func(None))
+        self.assertEqual("123", func("123"))
+        self.assertEqual(None, func(c_wchar_p(None)))
+        self.assertEqual("123", func(c_wchar_p("123")))
 
-            # XXX Currently, these raise TypeErrors, although they shouldn't:
-            self.assertEqual("123", func(c_wbuffer("123")))
-            ca = c_wchar("a")
-            self.assertEqual("a", func(pointer(ca))[0])
-            self.assertEqual("a", func(byref(ca))[0])
+        # XXX Currently, these raise TypeErrors, although they shouldn't:
+        self.assertEqual("123", func(c_wbuffer("123")))
+        ca = c_wchar("a")
+        self.assertEqual("a", func(pointer(ca))[0])
+        self.assertEqual("a", func(byref(ca))[0])
 
 class ArrayTest(unittest.TestCase):
     def test(self):
diff --git a/Lib/ctypes/test/test_python_api.py b/Lib/ctypes/test/test_python_api.py
index 5eb882a..9c13746 100644
--- a/Lib/ctypes/test/test_python_api.py
+++ b/Lib/ctypes/test/test_python_api.py
@@ -1,7 +1,6 @@
 from ctypes import *
 import unittest, sys
 from test import support
-from ctypes.test import is_resource_enabled
 
 ################################################################
 # This section should be moved into ctypes\__init__.py, when it's ready.
@@ -39,24 +38,21 @@
         del pyob
         self.assertEqual(grc(s), refcnt)
 
-    if is_resource_enabled("refcount"):
-        # This test is unreliable, because it is possible that code in
-        # unittest changes the refcount of the '42' integer.  So, it
-        # is disabled by default.
-        def test_PyLong_Long(self):
-            ref42 = grc(42)
-            pythonapi.PyLong_FromLong.restype = py_object
-            self.assertEqual(pythonapi.PyLong_FromLong(42), 42)
+    @support.refcount_test
+    def test_PyLong_Long(self):
+        ref42 = grc(42)
+        pythonapi.PyLong_FromLong.restype = py_object
+        self.assertEqual(pythonapi.PyLong_FromLong(42), 42)
 
-            self.assertEqual(grc(42), ref42)
+        self.assertEqual(grc(42), ref42)
 
-            pythonapi.PyLong_AsLong.argtypes = (py_object,)
-            pythonapi.PyLong_AsLong.restype = c_long
+        pythonapi.PyLong_AsLong.argtypes = (py_object,)
+        pythonapi.PyLong_AsLong.restype = c_long
 
-            res = pythonapi.PyLong_AsLong(42)
-            self.assertEqual(grc(res), ref42 + 1)
-            del res
-            self.assertEqual(grc(42), ref42)
+        res = pythonapi.PyLong_AsLong(42)
+        self.assertEqual(grc(res), ref42 + 1)
+        del res
+        self.assertEqual(grc(42), ref42)
 
     @support.refcount_test
     def test_PyObj_FromPtr(self):
diff --git a/Lib/ctypes/test/test_random_things.py b/Lib/ctypes/test/test_random_things.py
index 515acf5..4555ecd 100644
--- a/Lib/ctypes/test/test_random_things.py
+++ b/Lib/ctypes/test/test_random_things.py
@@ -5,23 +5,22 @@
     42 / arg
     raise ValueError(arg)
 
-if sys.platform == "win32":
+@unittest.skipUnless(sys.platform == "win32", 'Windows-specific test')
+class call_function_TestCase(unittest.TestCase):
+    # _ctypes.call_function is deprecated and private, but used by
+    # Gary Bishp's readline module.  If we have it, we must test it as well.
 
-    class call_function_TestCase(unittest.TestCase):
-        # _ctypes.call_function is deprecated and private, but used by
-        # Gary Bishp's readline module.  If we have it, we must test it as well.
+    def test(self):
+        from _ctypes import call_function
+        windll.kernel32.LoadLibraryA.restype = c_void_p
+        windll.kernel32.GetProcAddress.argtypes = c_void_p, c_char_p
+        windll.kernel32.GetProcAddress.restype = c_void_p
 
-        def test(self):
-            from _ctypes import call_function
-            windll.kernel32.LoadLibraryA.restype = c_void_p
-            windll.kernel32.GetProcAddress.argtypes = c_void_p, c_char_p
-            windll.kernel32.GetProcAddress.restype = c_void_p
+        hdll = windll.kernel32.LoadLibraryA(b"kernel32")
+        funcaddr = windll.kernel32.GetProcAddress(hdll, b"GetModuleHandleA")
 
-            hdll = windll.kernel32.LoadLibraryA(b"kernel32")
-            funcaddr = windll.kernel32.GetProcAddress(hdll, b"GetModuleHandleA")
-
-            self.assertEqual(call_function(funcaddr, (None,)),
-                                 windll.kernel32.GetModuleHandleA(None))
+        self.assertEqual(call_function(funcaddr, (None,)),
+                             windll.kernel32.GetModuleHandleA(None))
 
 class CallbackTracbackTestCase(unittest.TestCase):
     # When an exception is raised in a ctypes callback function, the C
diff --git a/Lib/ctypes/test/test_slicing.py b/Lib/ctypes/test/test_slicing.py
index 82fee96..240dc0c 100644
--- a/Lib/ctypes/test/test_slicing.py
+++ b/Lib/ctypes/test/test_slicing.py
@@ -1,5 +1,6 @@
 import unittest
 from ctypes import *
+from ctypes.test import need_symbol
 
 import _ctypes_test
 
@@ -125,44 +126,40 @@
         self.assertEqual(p[2:5:-3], s[2:5:-3])
 
 
-    try:
-        c_wchar
-    except NameError:
-        pass
-    else:
-        def test_wchar_ptr(self):
-            s = "abcdefghijklmnopqrstuvwxyz\0"
+    @need_symbol('c_wchar')
+    def test_wchar_ptr(self):
+        s = "abcdefghijklmnopqrstuvwxyz\0"
 
-            dll = CDLL(_ctypes_test.__file__)
-            dll.my_wcsdup.restype = POINTER(c_wchar)
-            dll.my_wcsdup.argtypes = POINTER(c_wchar),
-            dll.my_free.restype = None
-            res = dll.my_wcsdup(s)
-            self.assertEqual(res[:len(s)], s)
-            self.assertEqual(res[:len(s):], s)
-            self.assertEqual(res[len(s)-1:-1:-1], s[::-1])
-            self.assertEqual(res[len(s)-1:5:-7], s[:5:-7])
+        dll = CDLL(_ctypes_test.__file__)
+        dll.my_wcsdup.restype = POINTER(c_wchar)
+        dll.my_wcsdup.argtypes = POINTER(c_wchar),
+        dll.my_free.restype = None
+        res = dll.my_wcsdup(s)
+        self.assertEqual(res[:len(s)], s)
+        self.assertEqual(res[:len(s):], s)
+        self.assertEqual(res[len(s)-1:-1:-1], s[::-1])
+        self.assertEqual(res[len(s)-1:5:-7], s[:5:-7])
 
-            import operator
-            self.assertRaises(TypeError, operator.setitem,
-                              res, slice(0, 5), "abcde")
-            dll.my_free(res)
+        import operator
+        self.assertRaises(TypeError, operator.setitem,
+                          res, slice(0, 5), "abcde")
+        dll.my_free(res)
 
-            if sizeof(c_wchar) == sizeof(c_short):
-                dll.my_wcsdup.restype = POINTER(c_short)
-            elif sizeof(c_wchar) == sizeof(c_int):
-                dll.my_wcsdup.restype = POINTER(c_int)
-            elif sizeof(c_wchar) == sizeof(c_long):
-                dll.my_wcsdup.restype = POINTER(c_long)
-            else:
-                return
-            res = dll.my_wcsdup(s)
-            tmpl = list(range(ord("a"), ord("z")+1))
-            self.assertEqual(res[:len(s)-1], tmpl)
-            self.assertEqual(res[:len(s)-1:], tmpl)
-            self.assertEqual(res[len(s)-2:-1:-1], tmpl[::-1])
-            self.assertEqual(res[len(s)-2:5:-7], tmpl[:5:-7])
-            dll.my_free(res)
+        if sizeof(c_wchar) == sizeof(c_short):
+            dll.my_wcsdup.restype = POINTER(c_short)
+        elif sizeof(c_wchar) == sizeof(c_int):
+            dll.my_wcsdup.restype = POINTER(c_int)
+        elif sizeof(c_wchar) == sizeof(c_long):
+            dll.my_wcsdup.restype = POINTER(c_long)
+        else:
+            self.skipTest('Pointers to c_wchar are not supported')
+        res = dll.my_wcsdup(s)
+        tmpl = list(range(ord("a"), ord("z")+1))
+        self.assertEqual(res[:len(s)-1], tmpl)
+        self.assertEqual(res[:len(s)-1:], tmpl)
+        self.assertEqual(res[len(s)-2:-1:-1], tmpl[::-1])
+        self.assertEqual(res[len(s)-2:5:-7], tmpl[:5:-7])
+        dll.my_free(res)
 
 ################################################################
 
diff --git a/Lib/ctypes/test/test_strings.py b/Lib/ctypes/test/test_strings.py
index 9dc2a29..c7bfbda 100644
--- a/Lib/ctypes/test/test_strings.py
+++ b/Lib/ctypes/test/test_strings.py
@@ -1,5 +1,6 @@
 import unittest
 from ctypes import *
+from ctypes.test import need_symbol
 
 class StringArrayTestCase(unittest.TestCase):
     def test(self):
@@ -53,36 +54,33 @@
 ##        print BUF.from_param(c_char_p("python"))
 ##        print BUF.from_param(BUF(*"pyth"))
 
-try:
-    c_wchar
-except NameError:
-    pass
-else:
-    class WStringArrayTestCase(unittest.TestCase):
-        def test(self):
-            BUF = c_wchar * 4
+@need_symbol('c_wchar')
+class WStringArrayTestCase(unittest.TestCase):
+    def test(self):
+        BUF = c_wchar * 4
 
-            buf = BUF("a", "b", "c")
-            self.assertEqual(buf.value, "abc")
+        buf = BUF("a", "b", "c")
+        self.assertEqual(buf.value, "abc")
 
-            buf.value = "ABCD"
-            self.assertEqual(buf.value, "ABCD")
+        buf.value = "ABCD"
+        self.assertEqual(buf.value, "ABCD")
 
-            buf.value = "x"
-            self.assertEqual(buf.value, "x")
+        buf.value = "x"
+        self.assertEqual(buf.value, "x")
 
-            buf[1] = "Z"
-            self.assertEqual(buf.value, "xZCD")
+        buf[1] = "Z"
+        self.assertEqual(buf.value, "xZCD")
 
-        @unittest.skipIf(sizeof(c_wchar) < 4,
-                         "sizeof(wchar_t) is smaller than 4 bytes")
-        def test_nonbmp(self):
-            u = chr(0x10ffff)
-            w = c_wchar(u)
-            self.assertEqual(w.value, u)
+    @unittest.skipIf(sizeof(c_wchar) < 4,
+                     "sizeof(wchar_t) is smaller than 4 bytes")
+    def test_nonbmp(self):
+        u = chr(0x10ffff)
+        w = c_wchar(u)
+        self.assertEqual(w.value, u)
 
 class StringTestCase(unittest.TestCase):
-    def XX_test_basic_strings(self):
+    @unittest.skip('test disabled')
+    def test_basic_strings(self):
         cs = c_string("abcdef")
 
         # Cannot call len on a c_string any longer
@@ -108,7 +106,8 @@
 
         self.assertRaises(TypeError, c_string, "123")
 
-    def XX_test_sized_strings(self):
+    @unittest.skip('test disabled')
+    def test_sized_strings(self):
 
         # New in releases later than 0.4.0:
         self.assertRaises(TypeError, c_string, None)
@@ -125,7 +124,8 @@
         self.assertEqual(c_string(2).raw[-1], "\000")
         self.assertEqual(len(c_string(2).raw), 2)
 
-    def XX_test_initialized_strings(self):
+    @unittest.skip('test disabled')
+    def test_initialized_strings(self):
 
         self.assertEqual(c_string("ab", 4).raw[:2], "ab")
         self.assertEqual(c_string("ab", 4).raw[:2:], "ab")
@@ -134,7 +134,8 @@
         self.assertEqual(c_string("ab", 4).raw[-1], "\000")
         self.assertEqual(c_string("ab", 2).raw, "a\000")
 
-    def XX_test_toolong(self):
+    @unittest.skip('test disabled')
+    def test_toolong(self):
         cs = c_string("abcdef")
         # Much too long string:
         self.assertRaises(ValueError, setattr, cs, "value", "123456789012345")
@@ -142,54 +143,53 @@
         # One char too long values:
         self.assertRaises(ValueError, setattr, cs, "value", "1234567")
 
-##    def test_perf(self):
-##        check_perf()
+    @unittest.skip('test disabled')
+    def test_perf(self):
+        check_perf()
 
-try:
-    c_wchar
-except NameError:
-    pass
-else:
-    class WStringTestCase(unittest.TestCase):
-        def test_wchar(self):
-            c_wchar("x")
-            repr(byref(c_wchar("x")))
-            c_wchar("x")
+@need_symbol('c_wchar')
+class WStringTestCase(unittest.TestCase):
+    def test_wchar(self):
+        c_wchar("x")
+        repr(byref(c_wchar("x")))
+        c_wchar("x")
 
 
-        def X_test_basic_wstrings(self):
-            cs = c_wstring("abcdef")
+    @unittest.skip('test disabled')
+    def test_basic_wstrings(self):
+        cs = c_wstring("abcdef")
 
-            # XXX This behaviour is about to change:
-            # len returns the size of the internal buffer in bytes.
-            # This includes the terminating NUL character.
-            self.assertEqual(sizeof(cs), 14)
+        # XXX This behaviour is about to change:
+        # len returns the size of the internal buffer in bytes.
+        # This includes the terminating NUL character.
+        self.assertEqual(sizeof(cs), 14)
 
-            # The value property is the string up to the first terminating NUL.
-            self.assertEqual(cs.value, "abcdef")
-            self.assertEqual(c_wstring("abc\000def").value, "abc")
+        # The value property is the string up to the first terminating NUL.
+        self.assertEqual(cs.value, "abcdef")
+        self.assertEqual(c_wstring("abc\000def").value, "abc")
 
-            self.assertEqual(c_wstring("abc\000def").value, "abc")
+        self.assertEqual(c_wstring("abc\000def").value, "abc")
 
-            # The raw property is the total buffer contents:
-            self.assertEqual(cs.raw, "abcdef\000")
-            self.assertEqual(c_wstring("abc\000def").raw, "abc\000def\000")
+        # The raw property is the total buffer contents:
+        self.assertEqual(cs.raw, "abcdef\000")
+        self.assertEqual(c_wstring("abc\000def").raw, "abc\000def\000")
 
-            # We can change the value:
-            cs.value = "ab"
-            self.assertEqual(cs.value, "ab")
-            self.assertEqual(cs.raw, "ab\000\000\000\000\000")
+        # We can change the value:
+        cs.value = "ab"
+        self.assertEqual(cs.value, "ab")
+        self.assertEqual(cs.raw, "ab\000\000\000\000\000")
 
-            self.assertRaises(TypeError, c_wstring, "123")
-            self.assertRaises(ValueError, c_wstring, 0)
+        self.assertRaises(TypeError, c_wstring, "123")
+        self.assertRaises(ValueError, c_wstring, 0)
 
-        def X_test_toolong(self):
-            cs = c_wstring("abcdef")
-            # Much too long string:
-            self.assertRaises(ValueError, setattr, cs, "value", "123456789012345")
+    @unittest.skip('test disabled')
+    def test_toolong(self):
+        cs = c_wstring("abcdef")
+        # Much too long string:
+        self.assertRaises(ValueError, setattr, cs, "value", "123456789012345")
 
-            # One char too long values:
-            self.assertRaises(ValueError, setattr, cs, "value", "1234567")
+        # One char too long values:
+        self.assertRaises(ValueError, setattr, cs, "value", "1234567")
 
 
 def run_test(rep, msg, func, arg):
diff --git a/Lib/ctypes/test/test_structures.py b/Lib/ctypes/test/test_structures.py
index 87613ad..84d456c 100644
--- a/Lib/ctypes/test/test_structures.py
+++ b/Lib/ctypes/test/test_structures.py
@@ -1,5 +1,6 @@
 import unittest
 from ctypes import *
+from ctypes.test import need_symbol
 from struct import calcsize
 import _testcapi
 
@@ -291,12 +292,8 @@
         self.assertEqual(p.phone.number, b"5678")
         self.assertEqual(p.age, 5)
 
+    @need_symbol('c_wchar')
     def test_structures_with_wchar(self):
-        try:
-            c_wchar
-        except NameError:
-            return # no unicode
-
         class PersonW(Structure):
             _fields_ = [("name", c_wchar * 12),
                         ("age", c_int)]
@@ -325,7 +322,7 @@
         self.assertEqual(cls, RuntimeError)
         self.assertEqual(msg,
                              "(Phone) <class 'TypeError'>: "
-                             "expected string, int found")
+                             "expected bytes, int found")
 
         cls, msg = self.get_except(Person, b"Someone", (b"a", b"b", b"c"))
         self.assertEqual(cls, RuntimeError)
@@ -354,14 +351,14 @@
         except Exception as detail:
             return detail.__class__, str(detail)
 
-
-##    def test_subclass_creation(self):
-##        meta = type(Structure)
-##        # same as 'class X(Structure): pass'
-##        # fails, since we need either a _fields_ or a _abstract_ attribute
-##        cls, msg = self.get_except(meta, "X", (Structure,), {})
-##        self.assertEqual((cls, msg),
-##                             (AttributeError, "class must define a '_fields_' attribute"))
+    @unittest.skip('test disabled')
+    def test_subclass_creation(self):
+        meta = type(Structure)
+        # same as 'class X(Structure): pass'
+        # fails, since we need either a _fields_ or a _abstract_ attribute
+        cls, msg = self.get_except(meta, "X", (Structure,), {})
+        self.assertEqual((cls, msg),
+                (AttributeError, "class must define a '_fields_' attribute"))
 
     def test_abstract_class(self):
         class X(Structure):
diff --git a/Lib/ctypes/test/test_unicode.py b/Lib/ctypes/test/test_unicode.py
index c3b2d48..c200af7 100644
--- a/Lib/ctypes/test/test_unicode.py
+++ b/Lib/ctypes/test/test_unicode.py
@@ -1,58 +1,55 @@
 import unittest
 import ctypes
+from ctypes.test import need_symbol
 
-try:
-    ctypes.c_wchar
-except AttributeError:
-    pass
-else:
-    import _ctypes_test
+import _ctypes_test
 
-    class UnicodeTestCase(unittest.TestCase):
-        def test_wcslen(self):
-            dll = ctypes.CDLL(_ctypes_test.__file__)
-            wcslen = dll.my_wcslen
-            wcslen.argtypes = [ctypes.c_wchar_p]
+@need_symbol('c_wchar')
+class UnicodeTestCase(unittest.TestCase):
+    def test_wcslen(self):
+        dll = ctypes.CDLL(_ctypes_test.__file__)
+        wcslen = dll.my_wcslen
+        wcslen.argtypes = [ctypes.c_wchar_p]
 
-            self.assertEqual(wcslen("abc"), 3)
-            self.assertEqual(wcslen("ab\u2070"), 3)
-            self.assertRaises(ctypes.ArgumentError, wcslen, b"ab\xe4")
+        self.assertEqual(wcslen("abc"), 3)
+        self.assertEqual(wcslen("ab\u2070"), 3)
+        self.assertRaises(ctypes.ArgumentError, wcslen, b"ab\xe4")
 
-        def test_buffers(self):
-            buf = ctypes.create_unicode_buffer("abc")
-            self.assertEqual(len(buf), 3+1)
+    def test_buffers(self):
+        buf = ctypes.create_unicode_buffer("abc")
+        self.assertEqual(len(buf), 3+1)
 
-            buf = ctypes.create_unicode_buffer("ab\xe4\xf6\xfc")
-            self.assertEqual(buf[:], "ab\xe4\xf6\xfc\0")
-            self.assertEqual(buf[::], "ab\xe4\xf6\xfc\0")
-            self.assertEqual(buf[::-1], '\x00\xfc\xf6\xe4ba')
-            self.assertEqual(buf[::2], 'a\xe4\xfc')
-            self.assertEqual(buf[6:5:-1], "")
+        buf = ctypes.create_unicode_buffer("ab\xe4\xf6\xfc")
+        self.assertEqual(buf[:], "ab\xe4\xf6\xfc\0")
+        self.assertEqual(buf[::], "ab\xe4\xf6\xfc\0")
+        self.assertEqual(buf[::-1], '\x00\xfc\xf6\xe4ba')
+        self.assertEqual(buf[::2], 'a\xe4\xfc')
+        self.assertEqual(buf[6:5:-1], "")
 
-    func = ctypes.CDLL(_ctypes_test.__file__)._testfunc_p_p
+func = ctypes.CDLL(_ctypes_test.__file__)._testfunc_p_p
 
-    class StringTestCase(UnicodeTestCase):
-        def setUp(self):
-            func.argtypes = [ctypes.c_char_p]
-            func.restype = ctypes.c_char_p
+class StringTestCase(UnicodeTestCase):
+    def setUp(self):
+        func.argtypes = [ctypes.c_char_p]
+        func.restype = ctypes.c_char_p
 
-        def tearDown(self):
-            func.argtypes = None
-            func.restype = ctypes.c_int
+    def tearDown(self):
+        func.argtypes = None
+        func.restype = ctypes.c_int
 
-        def test_func(self):
-            self.assertEqual(func(b"abc\xe4"), b"abc\xe4")
+    def test_func(self):
+        self.assertEqual(func(b"abc\xe4"), b"abc\xe4")
 
-        def test_buffers(self):
-            buf = ctypes.create_string_buffer(b"abc")
-            self.assertEqual(len(buf), 3+1)
+    def test_buffers(self):
+        buf = ctypes.create_string_buffer(b"abc")
+        self.assertEqual(len(buf), 3+1)
 
-            buf = ctypes.create_string_buffer(b"ab\xe4\xf6\xfc")
-            self.assertEqual(buf[:], b"ab\xe4\xf6\xfc\0")
-            self.assertEqual(buf[::], b"ab\xe4\xf6\xfc\0")
-            self.assertEqual(buf[::-1], b'\x00\xfc\xf6\xe4ba')
-            self.assertEqual(buf[::2], b'a\xe4\xfc')
-            self.assertEqual(buf[6:5:-1], b"")
+        buf = ctypes.create_string_buffer(b"ab\xe4\xf6\xfc")
+        self.assertEqual(buf[:], b"ab\xe4\xf6\xfc\0")
+        self.assertEqual(buf[::], b"ab\xe4\xf6\xfc\0")
+        self.assertEqual(buf[::-1], b'\x00\xfc\xf6\xe4ba')
+        self.assertEqual(buf[::2], b'a\xe4\xfc')
+        self.assertEqual(buf[6:5:-1], b"")
 
 
 if __name__ == '__main__':
diff --git a/Lib/ctypes/test/test_values.py b/Lib/ctypes/test/test_values.py
index e464102..1c1fd7d 100644
--- a/Lib/ctypes/test/test_values.py
+++ b/Lib/ctypes/test/test_values.py
@@ -3,6 +3,7 @@
 """
 
 import unittest
+import sys
 from ctypes import *
 
 import _ctypes_test
@@ -27,62 +28,68 @@
         ctdll = CDLL(_ctypes_test.__file__)
         self.assertRaises(ValueError, c_int.in_dll, ctdll, "Undefined_Symbol")
 
-    class Win_ValuesTestCase(unittest.TestCase):
-        """This test only works when python itself is a dll/shared library"""
+@unittest.skipUnless(sys.platform == 'win32', 'Windows-specific test')
+class Win_ValuesTestCase(unittest.TestCase):
+    """This test only works when python itself is a dll/shared library"""
 
-        def test_optimizeflag(self):
-            # This test accesses the Py_OptimizeFlag intger, which is
-            # exported by the Python dll.
+    def test_optimizeflag(self):
+        # This test accesses the Py_OptimizeFlag integer, which is
+        # exported by the Python dll and should match the sys.flags value
 
-            # It's value is set depending on the -O and -OO flags:
-            # if not given, it is 0 and __debug__ is 1.
-            # If -O is given, the flag is 1, for -OO it is 2.
-            # docstrings are also removed in the latter case.
-            opt = c_int.in_dll(pydll, "Py_OptimizeFlag").value
-            if __debug__:
-                self.assertEqual(opt, 0)
-            elif ValuesTestCase.__doc__ is not None:
-                self.assertEqual(opt, 1)
-            else:
-                self.assertEqual(opt, 2)
+        opt = c_int.in_dll(pythonapi, "Py_OptimizeFlag").value
+        self.assertEqual(opt, sys.flags.optimize)
 
-        def test_frozentable(self):
-            # Python exports a PyImport_FrozenModules symbol. This is a
-            # pointer to an array of struct _frozen entries.  The end of the
-            # array is marked by an entry containing a NULL name and zero
-            # size.
+    def test_frozentable(self):
+        # Python exports a PyImport_FrozenModules symbol. This is a
+        # pointer to an array of struct _frozen entries.  The end of the
+        # array is marked by an entry containing a NULL name and zero
+        # size.
 
-            # In standard Python, this table contains a __hello__
-            # module, and a __phello__ package containing a spam
-            # module.
-            class struct_frozen(Structure):
-                _fields_ = [("name", c_char_p),
-                            ("code", POINTER(c_ubyte)),
-                            ("size", c_int)]
-            FrozenTable = POINTER(struct_frozen)
+        # In standard Python, this table contains a __hello__
+        # module, and a __phello__ package containing a spam
+        # module.
+        class struct_frozen(Structure):
+            _fields_ = [("name", c_char_p),
+                        ("code", POINTER(c_ubyte)),
+                        ("size", c_int)]
+        FrozenTable = POINTER(struct_frozen)
 
-            ft = FrozenTable.in_dll(pydll, "PyImport_FrozenModules")
-            # ft is a pointer to the struct_frozen entries:
-            items = []
-            for entry in ft:
-                # This is dangerous. We *can* iterate over a pointer, but
-                # the loop will not terminate (maybe with an access
-                # violation;-) because the pointer instance has no size.
-                if entry.name is None:
-                    break
-                items.append((entry.name, entry.size))
-            import sys
-            if sys.version_info[:2] >= (2, 3):
-                expected = [("__hello__", 104), ("__phello__", -104), ("__phello__.spam", 104)]
-            else:
-                expected = [("__hello__", 100), ("__phello__", -100), ("__phello__.spam", 100)]
-            self.assertEqual(items, expected)
+        ft = FrozenTable.in_dll(pythonapi, "PyImport_FrozenModules")
+        # ft is a pointer to the struct_frozen entries:
+        items = []
+        # _frozen_importlib changes size whenever importlib._bootstrap
+        # changes, so it gets a special case.  We should make sure it's
+        # found, but don't worry about its size too much.
+        _fzn_implib_seen = False
+        for entry in ft:
+            # This is dangerous. We *can* iterate over a pointer, but
+            # the loop will not terminate (maybe with an access
+            # violation;-) because the pointer instance has no size.
+            if entry.name is None:
+                break
 
-            from ctypes import _pointer_type_cache
-            del _pointer_type_cache[struct_frozen]
+            if entry.name == b'_frozen_importlib':
+                _fzn_implib_seen = True
+                self.assertTrue(entry.size,
+                    "_frozen_importlib was reported as having no size")
+                continue
+            items.append((entry.name, entry.size))
 
-        def test_undefined(self):
-            self.assertRaises(ValueError, c_int.in_dll, pydll, "Undefined_Symbol")
+        expected = [(b"__hello__", 161),
+                    (b"__phello__", -161),
+                    (b"__phello__.spam", 161),
+                    ]
+        self.assertEqual(items, expected)
+
+        self.assertTrue(_fzn_implib_seen,
+            "_frozen_importlib wasn't found in PyImport_FrozenModules")
+
+        from ctypes import _pointer_type_cache
+        del _pointer_type_cache[struct_frozen]
+
+    def test_undefined(self):
+        self.assertRaises(ValueError, c_int.in_dll, pythonapi,
+                          "Undefined_Symbol")
 
 if __name__ == '__main__':
     unittest.main()
diff --git a/Lib/ctypes/test/test_win32.py b/Lib/ctypes/test/test_win32.py
index da21336..5867b05 100644
--- a/Lib/ctypes/test/test_win32.py
+++ b/Lib/ctypes/test/test_win32.py
@@ -1,99 +1,103 @@
 # Windows specific tests
 
 from ctypes import *
-from ctypes.test import is_resource_enabled
 import unittest, sys
 from test import support
 
 import _ctypes_test
 
-if sys.platform == "win32" and sizeof(c_void_p) == sizeof(c_int):
-    # Only windows 32-bit has different calling conventions.
+# Only windows 32-bit has different calling conventions.
+@unittest.skipUnless(sys.platform == "win32", 'Windows-specific test')
+@unittest.skipUnless(sizeof(c_void_p) == sizeof(c_int),
+                     "sizeof c_void_p and c_int differ")
+class WindowsTestCase(unittest.TestCase):
+    def test_callconv_1(self):
+        # Testing stdcall function
 
-    class WindowsTestCase(unittest.TestCase):
-        def test_callconv_1(self):
-            # Testing stdcall function
+        IsWindow = windll.user32.IsWindow
+        # ValueError: Procedure probably called with not enough arguments
+        # (4 bytes missing)
+        self.assertRaises(ValueError, IsWindow)
 
-            IsWindow = windll.user32.IsWindow
-            # ValueError: Procedure probably called with not enough arguments (4 bytes missing)
-            self.assertRaises(ValueError, IsWindow)
+        # This one should succeed...
+        self.assertEqual(0, IsWindow(0))
 
-            # This one should succeed...
-            self.assertEqual(0, IsWindow(0))
+        # ValueError: Procedure probably called with too many arguments
+        # (8 bytes in excess)
+        self.assertRaises(ValueError, IsWindow, 0, 0, 0)
 
-            # ValueError: Procedure probably called with too many arguments (8 bytes in excess)
-            self.assertRaises(ValueError, IsWindow, 0, 0, 0)
+    def test_callconv_2(self):
+        # Calling stdcall function as cdecl
 
-        def test_callconv_2(self):
-            # Calling stdcall function as cdecl
+        IsWindow = cdll.user32.IsWindow
 
-            IsWindow = cdll.user32.IsWindow
+        # ValueError: Procedure called with not enough arguments
+        # (4 bytes missing) or wrong calling convention
+        self.assertRaises(ValueError, IsWindow, None)
 
-            # ValueError: Procedure called with not enough arguments (4 bytes missing)
-            # or wrong calling convention
-            self.assertRaises(ValueError, IsWindow, None)
+@unittest.skipUnless(sys.platform == "win32", 'Windows-specific test')
+class FunctionCallTestCase(unittest.TestCase):
+    @unittest.skipUnless('MSC' in sys.version, "SEH only supported by MSC")
+    @unittest.skipIf(sys.executable.lower().endswith('_d.exe'),
+                     "SEH not enabled in debug builds")
+    def test_SEH(self):
+        # Call functions with invalid arguments, and make sure
+        # that access violations are trapped and raise an
+        # exception.
+        self.assertRaises(OSError, windll.kernel32.GetModuleHandleA, 32)
 
-if sys.platform == "win32":
-    class FunctionCallTestCase(unittest.TestCase):
+    def test_noargs(self):
+        # This is a special case on win32 x64
+        windll.user32.GetDesktopWindow()
 
-        if is_resource_enabled("SEH"):
-            def test_SEH(self):
-                # Call functions with invalid arguments, and make sure
-                # that access violations are trapped and raise an
-                # exception.
-                self.assertRaises(WindowsError, windll.kernel32.GetModuleHandleA, 32)
+@unittest.skipUnless(sys.platform == "win32", 'Windows-specific test')
+class TestWintypes(unittest.TestCase):
+    def test_HWND(self):
+        from ctypes import wintypes
+        self.assertEqual(sizeof(wintypes.HWND), sizeof(c_void_p))
 
-        def test_noargs(self):
-            # This is a special case on win32 x64
-            windll.user32.GetDesktopWindow()
+    def test_PARAM(self):
+        from ctypes import wintypes
+        self.assertEqual(sizeof(wintypes.WPARAM),
+                             sizeof(c_void_p))
+        self.assertEqual(sizeof(wintypes.LPARAM),
+                             sizeof(c_void_p))
 
-    class TestWintypes(unittest.TestCase):
-        def test_HWND(self):
-            from ctypes import wintypes
-            self.assertEqual(sizeof(wintypes.HWND), sizeof(c_void_p))
+    def test_COMError(self):
+        from _ctypes import COMError
+        if support.HAVE_DOCSTRINGS:
+            self.assertEqual(COMError.__doc__,
+                             "Raised when a COM method call failed.")
 
-        def test_PARAM(self):
-            from ctypes import wintypes
-            self.assertEqual(sizeof(wintypes.WPARAM),
-                                 sizeof(c_void_p))
-            self.assertEqual(sizeof(wintypes.LPARAM),
-                                 sizeof(c_void_p))
+        ex = COMError(-1, "text", ("details",))
+        self.assertEqual(ex.hresult, -1)
+        self.assertEqual(ex.text, "text")
+        self.assertEqual(ex.details, ("details",))
 
-        def test_COMError(self):
-            from _ctypes import COMError
-            if support.HAVE_DOCSTRINGS:
-                self.assertEqual(COMError.__doc__,
-                                 "Raised when a COM method call failed.")
+@unittest.skipUnless(sys.platform == "win32", 'Windows-specific test')
+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)
 
-            ex = COMError(-1, "text", ("details",))
-            self.assertEqual(ex.hresult, -1)
-            self.assertEqual(ex.text, "text")
-            self.assertEqual(ex.details, ("details",))
+        e = WinError(ERROR_INVALID_PARAMETER)
+        self.assertEqual(e.args, args)
+        self.assertEqual(e.errno, errno.EINVAL)
+        self.assertEqual(e.winerror, ERROR_INVALID_PARAMETER)
 
-    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)
+        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):
         class POINT(Structure):
             _fields_ = [("x", c_long),
@@ -107,9 +111,29 @@
 
         dll = CDLL(_ctypes_test.__file__)
 
-        pt = POINT(10, 10)
-        rect = RECT(0, 0, 20, 20)
-        self.assertEqual(1, dll.PointInRect(byref(rect), pt))
+        pt = POINT(15, 25)
+        left = c_long.in_dll(dll, 'left')
+        top = c_long.in_dll(dll, 'top')
+        right = c_long.in_dll(dll, 'right')
+        bottom = c_long.in_dll(dll, 'bottom')
+        rect = RECT(left, top, right, bottom)
+        PointInRect = dll.PointInRect
+        PointInRect.argtypes = [POINTER(RECT), POINT]
+        self.assertEqual(1, PointInRect(byref(rect), pt))
+
+        ReturnRect = dll.ReturnRect
+        ReturnRect.argtypes = [c_int, RECT, POINTER(RECT), POINT, RECT,
+                               POINTER(RECT), POINT, RECT]
+        ReturnRect.restype = RECT
+        for i in range(4):
+            ret = ReturnRect(i, rect, pointer(rect), pt, rect,
+                         byref(rect), pt, rect)
+            # the c function will check and modify ret if something is
+            # passed in improperly
+            self.assertEqual(ret.left, left.value)
+            self.assertEqual(ret.right, right.value)
+            self.assertEqual(ret.top, top.value)
+            self.assertEqual(ret.bottom, bottom.value)
 
 if __name__ == '__main__':
     unittest.main()
diff --git a/Lib/ctypes/test/test_wintypes.py b/Lib/ctypes/test/test_wintypes.py
index 806fcce..71442df 100644
--- a/Lib/ctypes/test/test_wintypes.py
+++ b/Lib/ctypes/test/test_wintypes.py
@@ -1,14 +1,12 @@
 import sys
 import unittest
 
-if not sys.platform.startswith('win'):
-    raise unittest.SkipTest('Windows-only test')
-
 from ctypes import *
-from ctypes import wintypes
 
+@unittest.skipUnless(sys.platform.startswith('win'), 'Windows-only test')
 class WinTypesTest(unittest.TestCase):
     def test_variant_bool(self):
+        from ctypes import wintypes
         # reads 16-bits from memory, anything non-zero is True
         for true_value in (1, 32767, 32768, 65535, 65537):
             true = POINTER(c_int16)(c_int16(true_value))
diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py
index 054c511..595113b 100644
--- a/Lib/ctypes/util.py
+++ b/Lib/ctypes/util.py
@@ -85,7 +85,7 @@
 
 elif os.name == "posix":
     # Andreas Degert's find functions, using gcc, /sbin/ldconfig, objdump
-    import re, tempfile, errno
+    import re, tempfile
 
     def _findLib_gcc(name):
         expr = r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name)
@@ -102,9 +102,8 @@
         finally:
             try:
                 os.unlink(ccout)
-            except OSError as e:
-                if e.errno != errno.ENOENT:
-                    raise
+            except FileNotFoundError:
+                pass
         if rv == 10:
             raise OSError('gcc or cc command not found')
         res = re.search(expr, trace)
@@ -133,8 +132,10 @@
             cmd = 'if ! type objdump >/dev/null 2>&1; then exit 10; fi;' \
                   "objdump -p -j .dynamic 2>/dev/null " + f
             f = os.popen(cmd)
-            dump = f.read()
-            rv = f.close()
+            try:
+                dump = f.read()
+            finally:
+                rv = f.close()
             if rv == 10:
                 raise OSError('objdump command not found')
             res = re.search(r'\sSONAME\s+([^\s]+)', dump)
@@ -177,10 +178,11 @@
             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]
+            with contextlib.closing(os.popen(cmd)) as f:
+                for line in f.readlines():
+                    line = line.strip()
+                    if line.startswith('Default Library Path (ELF):'):
+                        paths = line.split()[4]
 
             if not paths:
                 return None
diff --git a/Lib/datetime.py b/Lib/datetime.py
index d1f353b..1789714 100644
--- a/Lib/datetime.py
+++ b/Lib/datetime.py
@@ -23,9 +23,10 @@
 # for all computations.  See the book for algorithms for converting between
 # proleptic Gregorian ordinals and many other calendar systems.
 
-_DAYS_IN_MONTH = [None, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
+# -1 is a placeholder for indexing purposes.
+_DAYS_IN_MONTH = [-1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
 
-_DAYS_BEFORE_MONTH = [None]
+_DAYS_BEFORE_MONTH = [-1] # -1 is a placeholder for indexing purposes.
 dbm = 0
 for dim in _DAYS_IN_MONTH[1:]:
     _DAYS_BEFORE_MONTH.append(dbm)
@@ -1917,203 +1918,203 @@
 timezone.min = timezone._create(timezone._minoffset)
 timezone.max = timezone._create(timezone._maxoffset)
 _EPOCH = datetime(1970, 1, 1, tzinfo=timezone.utc)
-"""
-Some time zone algebra.  For a datetime x, let
-    x.n = x stripped of its timezone -- its naive time.
-    x.o = x.utcoffset(), and assuming that doesn't raise an exception or
-          return None
-    x.d = x.dst(), and assuming that doesn't raise an exception or
-          return None
-    x.s = x's standard offset, x.o - x.d
 
-Now some derived rules, where k is a duration (timedelta).
+# Some time zone algebra.  For a datetime x, let
+#     x.n = x stripped of its timezone -- its naive time.
+#     x.o = x.utcoffset(), and assuming that doesn't raise an exception or
+#           return None
+#     x.d = x.dst(), and assuming that doesn't raise an exception or
+#           return None
+#     x.s = x's standard offset, x.o - x.d
+#
+# Now some derived rules, where k is a duration (timedelta).
+#
+# 1. x.o = x.s + x.d
+#    This follows from the definition of x.s.
+#
+# 2. If x and y have the same tzinfo member, x.s = y.s.
+#    This is actually a requirement, an assumption we need to make about
+#    sane tzinfo classes.
+#
+# 3. The naive UTC time corresponding to x is x.n - x.o.
+#    This is again a requirement for a sane tzinfo class.
+#
+# 4. (x+k).s = x.s
+#    This follows from #2, and that datimetimetz+timedelta preserves tzinfo.
+#
+# 5. (x+k).n = x.n + k
+#    Again follows from how arithmetic is defined.
+#
+# Now we can explain tz.fromutc(x).  Let's assume it's an interesting case
+# (meaning that the various tzinfo methods exist, and don't blow up or return
+# None when called).
+#
+# The function wants to return a datetime y with timezone tz, equivalent to x.
+# x is already in UTC.
+#
+# By #3, we want
+#
+#     y.n - y.o = x.n                             [1]
+#
+# The algorithm starts by attaching tz to x.n, and calling that y.  So
+# x.n = y.n at the start.  Then it wants to add a duration k to y, so that [1]
+# becomes true; in effect, we want to solve [2] for k:
+#
+#    (y+k).n - (y+k).o = x.n                      [2]
+#
+# By #1, this is the same as
+#
+#    (y+k).n - ((y+k).s + (y+k).d) = x.n          [3]
+#
+# By #5, (y+k).n = y.n + k, which equals x.n + k because x.n=y.n at the start.
+# Substituting that into [3],
+#
+#    x.n + k - (y+k).s - (y+k).d = x.n; the x.n terms cancel, leaving
+#    k - (y+k).s - (y+k).d = 0; rearranging,
+#    k = (y+k).s - (y+k).d; by #4, (y+k).s == y.s, so
+#    k = y.s - (y+k).d
+#
+# On the RHS, (y+k).d can't be computed directly, but y.s can be, and we
+# approximate k by ignoring the (y+k).d term at first.  Note that k can't be
+# very large, since all offset-returning methods return a duration of magnitude
+# less than 24 hours.  For that reason, if y is firmly in std time, (y+k).d must
+# be 0, so ignoring it has no consequence then.
+#
+# In any case, the new value is
+#
+#     z = y + y.s                                 [4]
+#
+# It's helpful to step back at look at [4] from a higher level:  it's simply
+# mapping from UTC to tz's standard time.
+#
+# At this point, if
+#
+#     z.n - z.o = x.n                             [5]
+#
+# we have an equivalent time, and are almost done.  The insecurity here is
+# at the start of daylight time.  Picture US Eastern for concreteness.  The wall
+# time jumps from 1:59 to 3:00, and wall hours of the form 2:MM don't make good
+# sense then.  The docs ask that an Eastern tzinfo class consider such a time to
+# be EDT (because it's "after 2"), which is a redundant spelling of 1:MM EST
+# on the day DST starts.  We want to return the 1:MM EST spelling because that's
+# the only spelling that makes sense on the local wall clock.
+#
+# In fact, if [5] holds at this point, we do have the standard-time spelling,
+# but that takes a bit of proof.  We first prove a stronger result.  What's the
+# difference between the LHS and RHS of [5]?  Let
+#
+#     diff = x.n - (z.n - z.o)                    [6]
+#
+# Now
+#     z.n =                       by [4]
+#     (y + y.s).n =               by #5
+#     y.n + y.s =                 since y.n = x.n
+#     x.n + y.s =                 since z and y are have the same tzinfo member,
+#                                     y.s = z.s by #2
+#     x.n + z.s
+#
+# Plugging that back into [6] gives
+#
+#     diff =
+#     x.n - ((x.n + z.s) - z.o) =     expanding
+#     x.n - x.n - z.s + z.o =         cancelling
+#     - z.s + z.o =                   by #2
+#     z.d
+#
+# So diff = z.d.
+#
+# If [5] is true now, diff = 0, so z.d = 0 too, and we have the standard-time
+# spelling we wanted in the endcase described above.  We're done.  Contrarily,
+# if z.d = 0, then we have a UTC equivalent, and are also done.
+#
+# If [5] is not true now, diff = z.d != 0, and z.d is the offset we need to
+# add to z (in effect, z is in tz's standard time, and we need to shift the
+# local clock into tz's daylight time).
+#
+# Let
+#
+#     z' = z + z.d = z + diff                     [7]
+#
+# and we can again ask whether
+#
+#     z'.n - z'.o = x.n                           [8]
+#
+# If so, we're done.  If not, the tzinfo class is insane, according to the
+# assumptions we've made.  This also requires a bit of proof.  As before, let's
+# compute the difference between the LHS and RHS of [8] (and skipping some of
+# the justifications for the kinds of substitutions we've done several times
+# already):
+#
+#     diff' = x.n - (z'.n - z'.o) =           replacing z'.n via [7]
+#             x.n  - (z.n + diff - z'.o) =    replacing diff via [6]
+#             x.n - (z.n + x.n - (z.n - z.o) - z'.o) =
+#             x.n - z.n - x.n + z.n - z.o + z'.o =    cancel x.n
+#             - z.n + z.n - z.o + z'.o =              cancel z.n
+#             - z.o + z'.o =                      #1 twice
+#             -z.s - z.d + z'.s + z'.d =          z and z' have same tzinfo
+#             z'.d - z.d
+#
+# So z' is UTC-equivalent to x iff z'.d = z.d at this point.  If they are equal,
+# we've found the UTC-equivalent so are done.  In fact, we stop with [7] and
+# return z', not bothering to compute z'.d.
+#
+# How could z.d and z'd differ?  z' = z + z.d [7], so merely moving z' by
+# a dst() offset, and starting *from* a time already in DST (we know z.d != 0),
+# would have to change the result dst() returns:  we start in DST, and moving
+# a little further into it takes us out of DST.
+#
+# There isn't a sane case where this can happen.  The closest it gets is at
+# the end of DST, where there's an hour in UTC with no spelling in a hybrid
+# tzinfo class.  In US Eastern, that's 5:MM UTC = 0:MM EST = 1:MM EDT.  During
+# that hour, on an Eastern clock 1:MM is taken as being in standard time (6:MM
+# UTC) because the docs insist on that, but 0:MM is taken as being in daylight
+# time (4:MM UTC).  There is no local time mapping to 5:MM UTC.  The local
+# clock jumps from 1:59 back to 1:00 again, and repeats the 1:MM hour in
+# standard time.  Since that's what the local clock *does*, we want to map both
+# UTC hours 5:MM and 6:MM to 1:MM Eastern.  The result is ambiguous
+# in local time, but so it goes -- it's the way the local clock works.
+#
+# When x = 5:MM UTC is the input to this algorithm, x.o=0, y.o=-5 and y.d=0,
+# so z=0:MM.  z.d=60 (minutes) then, so [5] doesn't hold and we keep going.
+# z' = z + z.d = 1:MM then, and z'.d=0, and z'.d - z.d = -60 != 0 so [8]
+# (correctly) concludes that z' is not UTC-equivalent to x.
+#
+# Because we know z.d said z was in daylight time (else [5] would have held and
+# we would have stopped then), and we know z.d != z'.d (else [8] would have held
+# and we have stopped then), and there are only 2 possible values dst() can
+# return in Eastern, it follows that z'.d must be 0 (which it is in the example,
+# but the reasoning doesn't depend on the example -- it depends on there being
+# two possible dst() outcomes, one zero and the other non-zero).  Therefore
+# z' must be in standard time, and is the spelling we want in this case.
+#
+# Note again that z' is not UTC-equivalent as far as the hybrid tzinfo class is
+# concerned (because it takes z' as being in standard time rather than the
+# daylight time we intend here), but returning it gives the real-life "local
+# clock repeats an hour" behavior when mapping the "unspellable" UTC hour into
+# tz.
+#
+# When the input is 6:MM, z=1:MM and z.d=0, and we stop at once, again with
+# the 1:MM standard time spelling we want.
+#
+# So how can this break?  One of the assumptions must be violated.  Two
+# possibilities:
+#
+# 1) [2] effectively says that y.s is invariant across all y belong to a given
+#    time zone.  This isn't true if, for political reasons or continental drift,
+#    a region decides to change its base offset from UTC.
+#
+# 2) There may be versions of "double daylight" time where the tail end of
+#    the analysis gives up a step too early.  I haven't thought about that
+#    enough to say.
+#
+# In any case, it's clear that the default fromutc() is strong enough to handle
+# "almost all" time zones:  so long as the standard offset is invariant, it
+# doesn't matter if daylight time transition points change from year to year, or
+# if daylight time is skipped in some years; it doesn't matter how large or
+# small dst() may get within its bounds; and it doesn't even matter if some
+# perverse time zone returns a negative dst()).  So a breaking case must be
+# pretty bizarre, and a tzinfo subclass can override fromutc() if it is.
 
-1. x.o = x.s + x.d
-   This follows from the definition of x.s.
-
-2. If x and y have the same tzinfo member, x.s = y.s.
-   This is actually a requirement, an assumption we need to make about
-   sane tzinfo classes.
-
-3. The naive UTC time corresponding to x is x.n - x.o.
-   This is again a requirement for a sane tzinfo class.
-
-4. (x+k).s = x.s
-   This follows from #2, and that datimetimetz+timedelta preserves tzinfo.
-
-5. (x+k).n = x.n + k
-   Again follows from how arithmetic is defined.
-
-Now we can explain tz.fromutc(x).  Let's assume it's an interesting case
-(meaning that the various tzinfo methods exist, and don't blow up or return
-None when called).
-
-The function wants to return a datetime y with timezone tz, equivalent to x.
-x is already in UTC.
-
-By #3, we want
-
-    y.n - y.o = x.n                             [1]
-
-The algorithm starts by attaching tz to x.n, and calling that y.  So
-x.n = y.n at the start.  Then it wants to add a duration k to y, so that [1]
-becomes true; in effect, we want to solve [2] for k:
-
-   (y+k).n - (y+k).o = x.n                      [2]
-
-By #1, this is the same as
-
-   (y+k).n - ((y+k).s + (y+k).d) = x.n          [3]
-
-By #5, (y+k).n = y.n + k, which equals x.n + k because x.n=y.n at the start.
-Substituting that into [3],
-
-   x.n + k - (y+k).s - (y+k).d = x.n; the x.n terms cancel, leaving
-   k - (y+k).s - (y+k).d = 0; rearranging,
-   k = (y+k).s - (y+k).d; by #4, (y+k).s == y.s, so
-   k = y.s - (y+k).d
-
-On the RHS, (y+k).d can't be computed directly, but y.s can be, and we
-approximate k by ignoring the (y+k).d term at first.  Note that k can't be
-very large, since all offset-returning methods return a duration of magnitude
-less than 24 hours.  For that reason, if y is firmly in std time, (y+k).d must
-be 0, so ignoring it has no consequence then.
-
-In any case, the new value is
-
-    z = y + y.s                                 [4]
-
-It's helpful to step back at look at [4] from a higher level:  it's simply
-mapping from UTC to tz's standard time.
-
-At this point, if
-
-    z.n - z.o = x.n                             [5]
-
-we have an equivalent time, and are almost done.  The insecurity here is
-at the start of daylight time.  Picture US Eastern for concreteness.  The wall
-time jumps from 1:59 to 3:00, and wall hours of the form 2:MM don't make good
-sense then.  The docs ask that an Eastern tzinfo class consider such a time to
-be EDT (because it's "after 2"), which is a redundant spelling of 1:MM EST
-on the day DST starts.  We want to return the 1:MM EST spelling because that's
-the only spelling that makes sense on the local wall clock.
-
-In fact, if [5] holds at this point, we do have the standard-time spelling,
-but that takes a bit of proof.  We first prove a stronger result.  What's the
-difference between the LHS and RHS of [5]?  Let
-
-    diff = x.n - (z.n - z.o)                    [6]
-
-Now
-    z.n =                       by [4]
-    (y + y.s).n =               by #5
-    y.n + y.s =                 since y.n = x.n
-    x.n + y.s =                 since z and y are have the same tzinfo member,
-                                    y.s = z.s by #2
-    x.n + z.s
-
-Plugging that back into [6] gives
-
-    diff =
-    x.n - ((x.n + z.s) - z.o) =     expanding
-    x.n - x.n - z.s + z.o =         cancelling
-    - z.s + z.o =                   by #2
-    z.d
-
-So diff = z.d.
-
-If [5] is true now, diff = 0, so z.d = 0 too, and we have the standard-time
-spelling we wanted in the endcase described above.  We're done.  Contrarily,
-if z.d = 0, then we have a UTC equivalent, and are also done.
-
-If [5] is not true now, diff = z.d != 0, and z.d is the offset we need to
-add to z (in effect, z is in tz's standard time, and we need to shift the
-local clock into tz's daylight time).
-
-Let
-
-    z' = z + z.d = z + diff                     [7]
-
-and we can again ask whether
-
-    z'.n - z'.o = x.n                           [8]
-
-If so, we're done.  If not, the tzinfo class is insane, according to the
-assumptions we've made.  This also requires a bit of proof.  As before, let's
-compute the difference between the LHS and RHS of [8] (and skipping some of
-the justifications for the kinds of substitutions we've done several times
-already):
-
-    diff' = x.n - (z'.n - z'.o) =           replacing z'.n via [7]
-            x.n  - (z.n + diff - z'.o) =    replacing diff via [6]
-            x.n - (z.n + x.n - (z.n - z.o) - z'.o) =
-            x.n - z.n - x.n + z.n - z.o + z'.o =    cancel x.n
-            - z.n + z.n - z.o + z'.o =              cancel z.n
-            - z.o + z'.o =                      #1 twice
-            -z.s - z.d + z'.s + z'.d =          z and z' have same tzinfo
-            z'.d - z.d
-
-So z' is UTC-equivalent to x iff z'.d = z.d at this point.  If they are equal,
-we've found the UTC-equivalent so are done.  In fact, we stop with [7] and
-return z', not bothering to compute z'.d.
-
-How could z.d and z'd differ?  z' = z + z.d [7], so merely moving z' by
-a dst() offset, and starting *from* a time already in DST (we know z.d != 0),
-would have to change the result dst() returns:  we start in DST, and moving
-a little further into it takes us out of DST.
-
-There isn't a sane case where this can happen.  The closest it gets is at
-the end of DST, where there's an hour in UTC with no spelling in a hybrid
-tzinfo class.  In US Eastern, that's 5:MM UTC = 0:MM EST = 1:MM EDT.  During
-that hour, on an Eastern clock 1:MM is taken as being in standard time (6:MM
-UTC) because the docs insist on that, but 0:MM is taken as being in daylight
-time (4:MM UTC).  There is no local time mapping to 5:MM UTC.  The local
-clock jumps from 1:59 back to 1:00 again, and repeats the 1:MM hour in
-standard time.  Since that's what the local clock *does*, we want to map both
-UTC hours 5:MM and 6:MM to 1:MM Eastern.  The result is ambiguous
-in local time, but so it goes -- it's the way the local clock works.
-
-When x = 5:MM UTC is the input to this algorithm, x.o=0, y.o=-5 and y.d=0,
-so z=0:MM.  z.d=60 (minutes) then, so [5] doesn't hold and we keep going.
-z' = z + z.d = 1:MM then, and z'.d=0, and z'.d - z.d = -60 != 0 so [8]
-(correctly) concludes that z' is not UTC-equivalent to x.
-
-Because we know z.d said z was in daylight time (else [5] would have held and
-we would have stopped then), and we know z.d != z'.d (else [8] would have held
-and we have stopped then), and there are only 2 possible values dst() can
-return in Eastern, it follows that z'.d must be 0 (which it is in the example,
-but the reasoning doesn't depend on the example -- it depends on there being
-two possible dst() outcomes, one zero and the other non-zero).  Therefore
-z' must be in standard time, and is the spelling we want in this case.
-
-Note again that z' is not UTC-equivalent as far as the hybrid tzinfo class is
-concerned (because it takes z' as being in standard time rather than the
-daylight time we intend here), but returning it gives the real-life "local
-clock repeats an hour" behavior when mapping the "unspellable" UTC hour into
-tz.
-
-When the input is 6:MM, z=1:MM and z.d=0, and we stop at once, again with
-the 1:MM standard time spelling we want.
-
-So how can this break?  One of the assumptions must be violated.  Two
-possibilities:
-
-1) [2] effectively says that y.s is invariant across all y belong to a given
-   time zone.  This isn't true if, for political reasons or continental drift,
-   a region decides to change its base offset from UTC.
-
-2) There may be versions of "double daylight" time where the tail end of
-   the analysis gives up a step too early.  I haven't thought about that
-   enough to say.
-
-In any case, it's clear that the default fromutc() is strong enough to handle
-"almost all" time zones:  so long as the standard offset is invariant, it
-doesn't matter if daylight time transition points change from year to year, or
-if daylight time is skipped in some years; it doesn't matter how large or
-small dst() may get within its bounds; and it doesn't even matter if some
-perverse time zone returns a negative dst()).  So a breaking case must be
-pretty bizarre, and a tzinfo subclass can override fromutc() if it is.
-"""
 try:
     from _datetime import *
 except ImportError:
diff --git a/Lib/dbm/__init__.py b/Lib/dbm/__init__.py
index a783fde..5f4664a 100644
--- a/Lib/dbm/__init__.py
+++ b/Lib/dbm/__init__.py
@@ -42,7 +42,7 @@
 _defaultmod = None
 _modules = {}
 
-error = (error, IOError)
+error = (error, OSError)
 
 try:
     from dbm import ndbm
@@ -111,12 +111,10 @@
     try:
         f = io.open(filename + ".pag", "rb")
         f.close()
-        # dbm linked with gdbm on OS/2 doesn't have .dir file
-        if not (ndbm.library == "GNU gdbm" and sys.platform == "os2emx"):
-            f = io.open(filename + ".dir", "rb")
-            f.close()
+        f = io.open(filename + ".dir", "rb")
+        f.close()
         return "dbm.ndbm"
-    except IOError:
+    except OSError:
         # some dbm emulations based on Berkeley DB generate a .db file
         # some do not, but they should be caught by the bsd checks
         try:
@@ -129,7 +127,7 @@
                 d = ndbm.open(filename)
                 d.close()
                 return "dbm.ndbm"
-        except IOError:
+        except OSError:
             pass
 
     # Check for dumbdbm next -- this has a .dir and a .dat file
@@ -146,13 +144,13 @@
                 return "dbm.dumb"
         finally:
             f.close()
-    except (OSError, IOError):
+    except OSError:
         pass
 
     # See if the file exists, return None if not
     try:
         f = io.open(filename, "rb")
-    except IOError:
+    except OSError:
         return None
 
     # Read the start of the file -- the magic number
diff --git a/Lib/dbm/dumb.py b/Lib/dbm/dumb.py
index cfb9123..8f48aad 100644
--- a/Lib/dbm/dumb.py
+++ b/Lib/dbm/dumb.py
@@ -29,7 +29,7 @@
 
 _BLOCKSIZE = 512
 
-error = IOError
+error = OSError
 
 class _Database(collections.MutableMapping):
 
@@ -67,10 +67,11 @@
         # Mod by Jack: create data file if needed
         try:
             f = _io.open(self._datfile, 'r', encoding="Latin-1")
-        except IOError:
-            f = _io.open(self._datfile, 'w', encoding="Latin-1")
-            self._chmod(self._datfile)
-        f.close()
+        except OSError:
+            with _io.open(self._datfile, 'w', encoding="Latin-1") as f:
+                self._chmod(self._datfile)
+        else:
+            f.close()
         self._update()
 
     # Read directory file into the in-memory index dict.
@@ -78,15 +79,15 @@
         self._index = {}
         try:
             f = _io.open(self._dirfile, 'r', encoding="Latin-1")
-        except IOError:
+        except OSError:
             pass
         else:
-            for line in f:
-                line = line.rstrip()
-                key, pos_and_siz_pair = eval(line)
-                key = key.encode('Latin-1')
-                self._index[key] = pos_and_siz_pair
-            f.close()
+            with f:
+                for line in f:
+                    line = line.rstrip()
+                    key, pos_and_siz_pair = eval(line)
+                    key = key.encode('Latin-1')
+                    self._index[key] = pos_and_siz_pair
 
     # Write the index dict to the directory file.  The original directory
     # file (if any) is renamed with a .bak extension first.  If a .bak
@@ -100,32 +101,36 @@
 
         try:
             self._os.unlink(self._bakfile)
-        except self._os.error:
+        except OSError:
             pass
 
         try:
             self._os.rename(self._dirfile, self._bakfile)
-        except self._os.error:
+        except OSError:
             pass
 
-        f = self._io.open(self._dirfile, 'w', encoding="Latin-1")
-        self._chmod(self._dirfile)
-        for key, pos_and_siz_pair in self._index.items():
-            # Use Latin-1 since it has no qualms with any value in any
-            # position; UTF-8, though, does care sometimes.
-            f.write("%r, %r\n" % (key.decode('Latin-1'), pos_and_siz_pair))
-        f.close()
+        with self._io.open(self._dirfile, 'w', encoding="Latin-1") as f:
+            self._chmod(self._dirfile)
+            for key, pos_and_siz_pair in self._index.items():
+                # Use Latin-1 since it has no qualms with any value in any
+                # position; UTF-8, though, does care sometimes.
+                entry = "%r, %r\n" % (key.decode('Latin-1'), pos_and_siz_pair)
+                f.write(entry)
 
     sync = _commit
 
+    def _verify_open(self):
+        if self._index is None:
+            raise error('DBM object has already been closed')
+
     def __getitem__(self, key):
         if isinstance(key, str):
             key = key.encode('utf-8')
+        self._verify_open()
         pos, siz = self._index[key]     # may raise KeyError
-        f = _io.open(self._datfile, 'rb')
-        f.seek(pos)
-        dat = f.read(siz)
-        f.close()
+        with _io.open(self._datfile, 'rb') as f:
+            f.seek(pos)
+            dat = f.read(siz)
         return dat
 
     # Append val to the data file, starting at a _BLOCKSIZE-aligned
@@ -133,14 +138,13 @@
     # to get to an aligned offset.  Return pair
     #     (starting offset of val, len(val))
     def _addval(self, val):
-        f = _io.open(self._datfile, 'rb+')
-        f.seek(0, 2)
-        pos = int(f.tell())
-        npos = ((pos + _BLOCKSIZE - 1) // _BLOCKSIZE) * _BLOCKSIZE
-        f.write(b'\0'*(npos-pos))
-        pos = npos
-        f.write(val)
-        f.close()
+        with _io.open(self._datfile, 'rb+') as f:
+            f.seek(0, 2)
+            pos = int(f.tell())
+            npos = ((pos + _BLOCKSIZE - 1) // _BLOCKSIZE) * _BLOCKSIZE
+            f.write(b'\0'*(npos-pos))
+            pos = npos
+            f.write(val)
         return (pos, len(val))
 
     # Write val to the data file, starting at offset pos.  The caller
@@ -148,10 +152,9 @@
     # pos to hold val, without overwriting some other value.  Return
     # pair (pos, len(val)).
     def _setval(self, pos, val):
-        f = _io.open(self._datfile, 'rb+')
-        f.seek(pos)
-        f.write(val)
-        f.close()
+        with _io.open(self._datfile, 'rb+') as f:
+            f.seek(pos)
+            f.write(val)
         return (pos, len(val))
 
     # key is a new key whose associated value starts in the data file
@@ -159,10 +162,9 @@
     # the in-memory index dict, and append one to the directory file.
     def _addkey(self, key, pos_and_siz_pair):
         self._index[key] = pos_and_siz_pair
-        f = _io.open(self._dirfile, 'a', encoding="Latin-1")
-        self._chmod(self._dirfile)
-        f.write("%r, %r\n" % (key.decode("Latin-1"), pos_and_siz_pair))
-        f.close()
+        with _io.open(self._dirfile, 'a', encoding="Latin-1") as f:
+            self._chmod(self._dirfile)
+            f.write("%r, %r\n" % (key.decode("Latin-1"), pos_and_siz_pair))
 
     def __setitem__(self, key, val):
         if isinstance(key, str):
@@ -173,6 +175,7 @@
             val = val.encode('utf-8')
         elif not isinstance(val, (bytes, bytearray)):
             raise TypeError("values must be bytes or strings")
+        self._verify_open()
         if key not in self._index:
             self._addkey(key, self._addval(val))
         else:
@@ -200,6 +203,7 @@
     def __delitem__(self, key):
         if isinstance(key, str):
             key = key.encode('utf-8')
+        self._verify_open()
         # The blocks used by the associated value are lost.
         del self._index[key]
         # XXX It's unclear why we do a _commit() here (the code always
@@ -209,22 +213,38 @@
         self._commit()
 
     def keys(self):
-        return list(self._index.keys())
+        try:
+            return list(self._index)
+        except TypeError:
+            raise error('DBM object has already been closed') from None
 
     def items(self):
+        self._verify_open()
         return [(key, self[key]) for key in self._index.keys()]
 
     def __contains__(self, key):
         if isinstance(key, str):
             key = key.encode('utf-8')
-        return key in self._index
+        try:
+            return key in self._index
+        except TypeError:
+            if self._index is None:
+                raise error('DBM object has already been closed') from None
+            else:
+                raise
 
     def iterkeys(self):
-        return iter(self._index.keys())
+        try:
+            return iter(self._index)
+        except TypeError:
+            raise error('DBM object has already been closed') from None
     __iter__ = iterkeys
 
     def __len__(self):
-        return len(self._index)
+        try:
+            return len(self._index)
+        except TypeError:
+            raise error('DBM object has already been closed') from None
 
     def close(self):
         self._commit()
@@ -236,6 +256,12 @@
         if hasattr(self._os, 'chmod'):
             self._os.chmod(file, self._mode)
 
+    def __enter__(self):
+        return self
+
+    def __exit__(self, *args):
+        self.close()
+
 
 def open(file, flag=None, mode=0o666):
     """Open the database file, filename, and return corresponding object.
diff --git a/Lib/decimal.py b/Lib/decimal.py
index 9f37e4f..b254f9c 100644
--- a/Lib/decimal.py
+++ b/Lib/decimal.py
@@ -116,6 +116,9 @@
     # Two major classes
     'Decimal', 'Context',
 
+    # Named tuple representation
+    'DecimalTuple',
+
     # Contexts
     'DefaultContext', 'BasicContext', 'ExtendedContext',
 
@@ -124,6 +127,9 @@
     'Inexact', 'Rounded', 'Subnormal', 'Overflow', 'Underflow',
     'FloatOperation',
 
+    # Exceptional conditions that trigger InvalidOperation
+    'DivisionImpossible', 'InvalidContext', 'ConversionSyntax', 'DivisionUndefined',
+
     # Constants for use in setting up contexts
     'ROUND_DOWN', 'ROUND_HALF_UP', 'ROUND_HALF_EVEN', 'ROUND_CEILING',
     'ROUND_FLOOR', 'ROUND_UP', 'ROUND_HALF_DOWN', 'ROUND_05UP',
@@ -140,9 +146,8 @@
 
 __version__ = '1.70'    # Highest version of the spec this complies with
                         # See http://speleotrove.com/decimal/
-__libmpdec_version__ = "2.4.0" # compatible libmpdec version
+__libmpdec_version__ = "2.4.1" # compatible libmpdec version
 
-import copy as _copy
 import math as _math
 import numbers as _numbers
 import sys
@@ -704,8 +709,7 @@
 
         raise TypeError("Cannot convert %r to Decimal" % value)
 
-    # @classmethod, but @decorator is not valid Python 2.3 syntax, so
-    # don't use it (see notes on Py2.3 compatibility at top of file)
+    @classmethod
     def from_float(cls, f):
         """Converts a float to a decimal number, exactly.
 
@@ -744,7 +748,6 @@
             return result
         else:
             return cls(result)
-    from_float = classmethod(from_float)
 
     def _isnan(self):
         """Returns whether the number is not actually one.
@@ -3772,6 +3775,8 @@
         if self._is_special:
             sign = _format_sign(self._sign, spec)
             body = str(self.copy_abs())
+            if spec['type'] == '%':
+                body += '%'
             return _format_align(sign, body, spec)
 
         # a type of None defaults to 'g' or 'G', depending on context
diff --git a/Lib/difflib.py b/Lib/difflib.py
index f0bfcc5..7eb42a9 100644
--- a/Lib/difflib.py
+++ b/Lib/difflib.py
@@ -30,7 +30,6 @@
            'Differ','IS_CHARACTER_JUNK', 'IS_LINE_JUNK', 'context_diff',
            'unified_diff', 'HtmlDiff', 'Match']
 
-import warnings
 import heapq
 from collections import namedtuple as _namedtuple
 
@@ -334,20 +333,6 @@
             for elt in popular: # ditto; as fast for 1% deletion
                 del b2j[elt]
 
-    def isbjunk(self, item):
-        "Deprecated; use 'item in SequenceMatcher().bjunk'."
-        warnings.warn("'SequenceMatcher().isbjunk(item)' is deprecated;\n"
-                      "use 'item in SMinstance.bjunk' instead.",
-                      DeprecationWarning, 2)
-        return item in self.bjunk
-
-    def isbpopular(self, item):
-        "Deprecated; use 'item in SequenceMatcher().bpopular'."
-        warnings.warn("'SequenceMatcher().isbpopular(item)' is deprecated;\n"
-                      "use 'item in SMinstance.bpopular' instead.",
-                      DeprecationWarning, 2)
-        return item in self.bpopular
-
     def find_longest_match(self, alo, ahi, blo, bhi):
         """Find longest matching block in a[alo:ahi] and b[blo:bhi].
 
@@ -526,8 +511,8 @@
             non_adjacent.append((i1, j1, k1))
 
         non_adjacent.append( (la, lb, 0) )
-        self.matching_blocks = non_adjacent
-        return map(Match._make, self.matching_blocks)
+        self.matching_blocks = list(map(Match._make, non_adjacent))
+        return self.matching_blocks
 
     def get_opcodes(self):
         """Return list of 5-tuples describing how to turn a into b.
@@ -920,8 +905,7 @@
             else:
                 raise ValueError('unknown tag %r' % (tag,))
 
-            for line in g:
-                yield line
+            yield from g
 
     def _dump(self, tag, x, lo, hi):
         """Generate comparison results for a same-tagged range."""
@@ -940,8 +924,7 @@
             second = self._dump('+', b, blo, bhi)
 
         for g in first, second:
-            for line in g:
-                yield line
+            yield from g
 
     def _fancy_replace(self, a, alo, ahi, b, blo, bhi):
         r"""
@@ -995,8 +978,7 @@
             # no non-identical "pretty close" pair
             if eqi is None:
                 # no identical pair either -- treat it as a straight replace
-                for line in self._plain_replace(a, alo, ahi, b, blo, bhi):
-                    yield line
+                yield from self._plain_replace(a, alo, ahi, b, blo, bhi)
                 return
             # no close pair, but an identical pair -- synch up on that
             best_i, best_j, best_ratio = eqi, eqj, 1.0
@@ -1008,8 +990,7 @@
         # identical
 
         # pump out diffs from before the synch point
-        for line in self._fancy_helper(a, alo, best_i, b, blo, best_j):
-            yield line
+        yield from self._fancy_helper(a, alo, best_i, b, blo, best_j)
 
         # do intraline marking on the synch pair
         aelt, belt = a[best_i], b[best_j]
@@ -1031,15 +1012,13 @@
                     btags += ' ' * lb
                 else:
                     raise ValueError('unknown tag %r' % (tag,))
-            for line in self._qformat(aelt, belt, atags, btags):
-                yield line
+            yield from self._qformat(aelt, belt, atags, btags)
         else:
             # the synch pair is identical
             yield '  ' + aelt
 
         # pump out diffs from after the synch point
-        for line in self._fancy_helper(a, best_i+1, ahi, b, best_j+1, bhi):
-            yield line
+        yield from self._fancy_helper(a, best_i+1, ahi, b, best_j+1, bhi)
 
     def _fancy_helper(self, a, alo, ahi, b, blo, bhi):
         g = []
@@ -1051,8 +1030,7 @@
         elif blo < bhi:
             g = self._dump('+', b, blo, bhi)
 
-        for line in g:
-            yield line
+        yield from g
 
     def _qformat(self, aline, bline, atags, btags):
         r"""
diff --git a/Lib/dis.py b/Lib/dis.py
index 543fdc7..81cbe7f 100644
--- a/Lib/dis.py
+++ b/Lib/dis.py
@@ -2,12 +2,15 @@
 
 import sys
 import types
+import collections
+import io
 
 from opcode import *
 from opcode import __all__ as _opcodes_all
 
 __all__ = ["code_info", "dis", "disassemble", "distb", "disco",
-           "findlinestarts", "findlabels", "show_code"] + _opcodes_all
+           "findlinestarts", "findlabels", "show_code",
+           "get_instructions", "Instruction", "Bytecode"] + _opcodes_all
 del _opcodes_all
 
 _have_code = (types.MethodType, types.FunctionType, types.CodeType, type)
@@ -25,14 +28,14 @@
         c = compile(source, name, 'exec')
     return c
 
-def dis(x=None):
+def dis(x=None, *, file=None):
     """Disassemble classes, methods, functions, or code.
 
     With no argument, disassemble the last traceback.
 
     """
     if x is None:
-        distb()
+        distb(file=file)
         return
     if hasattr(x, '__func__'):  # Method
         x = x.__func__
@@ -42,23 +45,23 @@
         items = sorted(x.__dict__.items())
         for name, x1 in items:
             if isinstance(x1, _have_code):
-                print("Disassembly of %s:" % name)
+                print("Disassembly of %s:" % name, file=file)
                 try:
-                    dis(x1)
+                    dis(x1, file=file)
                 except TypeError as msg:
-                    print("Sorry:", msg)
-                print()
+                    print("Sorry:", msg, file=file)
+                print(file=file)
     elif hasattr(x, 'co_code'): # Code object
-        disassemble(x)
+        disassemble(x, file=file)
     elif isinstance(x, (bytes, bytearray)): # Raw bytecode
-        _disassemble_bytes(x)
+        _disassemble_bytes(x, file=file)
     elif isinstance(x, str):    # Source code
-        _disassemble_str(x)
+        _disassemble_str(x, file=file)
     else:
         raise TypeError("don't know how to disassemble %s objects" %
                         type(x).__name__)
 
-def distb(tb=None):
+def distb(tb=None, *, file=None):
     """Disassemble a traceback (default: last traceback)."""
     if tb is None:
         try:
@@ -66,7 +69,7 @@
         except AttributeError:
             raise RuntimeError("no last traceback to disassemble")
         while tb.tb_next: tb = tb.tb_next
-    disassemble(tb.tb_frame.f_code, tb.tb_lasti)
+    disassemble(tb.tb_frame.f_code, tb.tb_lasti, file=file)
 
 # The inspect module interrogates this dictionary to build its
 # list of CO_* constants. It is also used by pretty_flags to
@@ -95,19 +98,22 @@
         names.append(hex(flags))
     return ", ".join(names)
 
-def code_info(x):
-    """Formatted details of methods, functions, or code."""
+def _get_code_object(x):
+    """Helper to handle methods, functions, strings and raw code objects"""
     if hasattr(x, '__func__'): # Method
         x = x.__func__
     if hasattr(x, '__code__'): # Function
         x = x.__code__
     if isinstance(x, str):     # Source code
-        x = _try_compile(x, "<code_info>")
+        x = _try_compile(x, "<disassembly>")
     if hasattr(x, 'co_code'):  # Code object
-        return _format_code_info(x)
-    else:
-        raise TypeError("don't know how to disassemble %s objects" %
-                        type(x).__name__)
+        return x
+    raise TypeError("don't know how to disassemble %s objects" %
+                    type(x).__name__)
+
+def code_info(x):
+    """Formatted details of methods, functions, or code."""
+    return _format_code_info(_get_code_object(x))
 
 def _format_code_info(co):
     lines = []
@@ -140,106 +146,206 @@
             lines.append("%4d: %s" % i_n)
     return "\n".join(lines)
 
-def show_code(co):
-    """Print details of methods, functions, or code to stdout."""
-    print(code_info(co))
+def show_code(co, *, file=None):
+    """Print details of methods, functions, or code to *file*.
 
-def disassemble(co, lasti=-1):
-    """Disassemble a code object."""
-    code = co.co_code
-    labels = findlabels(code)
+    If *file* is not provided, the output is printed on stdout.
+    """
+    print(code_info(co), file=file)
+
+_Instruction = collections.namedtuple("_Instruction",
+     "opname opcode arg argval argrepr offset starts_line is_jump_target")
+
+class Instruction(_Instruction):
+    """Details for a bytecode operation
+
+       Defined fields:
+         opname - human readable name for operation
+         opcode - numeric code for operation
+         arg - numeric argument to operation (if any), otherwise None
+         argval - resolved arg value (if known), otherwise same as arg
+         argrepr - human readable description of operation argument
+         offset - start index of operation within bytecode sequence
+         starts_line - line started by this opcode (if any), otherwise None
+         is_jump_target - True if other code jumps to here, otherwise False
+    """
+
+    def _disassemble(self, lineno_width=3, mark_as_current=False):
+        """Format instruction details for inclusion in disassembly output
+
+        *lineno_width* sets the width of the line number field (0 omits it)
+        *mark_as_current* inserts a '-->' marker arrow as part of the line
+        """
+        fields = []
+        # Column: Source code line number
+        if lineno_width:
+            if self.starts_line is not None:
+                lineno_fmt = "%%%dd" % lineno_width
+                fields.append(lineno_fmt % self.starts_line)
+            else:
+                fields.append(' ' * lineno_width)
+        # Column: Current instruction indicator
+        if mark_as_current:
+            fields.append('-->')
+        else:
+            fields.append('   ')
+        # Column: Jump target marker
+        if self.is_jump_target:
+            fields.append('>>')
+        else:
+            fields.append('  ')
+        # Column: Instruction offset from start of code sequence
+        fields.append(repr(self.offset).rjust(4))
+        # Column: Opcode name
+        fields.append(self.opname.ljust(20))
+        # Column: Opcode argument
+        if self.arg is not None:
+            fields.append(repr(self.arg).rjust(5))
+            # Column: Opcode argument details
+            if self.argrepr:
+                fields.append('(' + self.argrepr + ')')
+        return ' '.join(fields).rstrip()
+
+
+def get_instructions(x, *, first_line=None):
+    """Iterator for the opcodes in methods, functions or code
+
+    Generates a series of Instruction named tuples giving the details of
+    each operations in the supplied code.
+
+    If *first_line* is not None, it indicates the line number that should
+    be reported for the first source line in the disassembled code.
+    Otherwise, the source line information (if any) is taken directly from
+    the disassembled code object.
+    """
+    co = _get_code_object(x)
+    cell_names = co.co_cellvars + co.co_freevars
     linestarts = dict(findlinestarts(co))
+    if first_line is not None:
+        line_offset = first_line - co.co_firstlineno
+    else:
+        line_offset = 0
+    return _get_instructions_bytes(co.co_code, co.co_varnames, co.co_names,
+                                   co.co_consts, cell_names, linestarts,
+                                   line_offset)
+
+def _get_const_info(const_index, const_list):
+    """Helper to get optional details about const references
+
+       Returns the dereferenced constant and its repr if the constant
+       list is defined.
+       Otherwise returns the constant index and its repr().
+    """
+    argval = const_index
+    if const_list is not None:
+        argval = const_list[const_index]
+    return argval, repr(argval)
+
+def _get_name_info(name_index, name_list):
+    """Helper to get optional details about named references
+
+       Returns the dereferenced name as both value and repr if the name
+       list is defined.
+       Otherwise returns the name index and its repr().
+    """
+    argval = name_index
+    if name_list is not None:
+        argval = name_list[name_index]
+        argrepr = argval
+    else:
+        argrepr = repr(argval)
+    return argval, argrepr
+
+
+def _get_instructions_bytes(code, varnames=None, names=None, constants=None,
+                      cells=None, linestarts=None, line_offset=0):
+    """Iterate over the instructions in a bytecode string.
+
+    Generates a sequence of Instruction namedtuples giving the details of each
+    opcode.  Additional information about the code's runtime environment
+    (e.g. variable names, constants) can be specified using optional
+    arguments.
+
+    """
+    labels = findlabels(code)
+    extended_arg = 0
+    starts_line = None
+    free = None
+    # enumerate() is not an option, since we sometimes process
+    # multiple elements on a single pass through the loop
     n = len(code)
     i = 0
-    extended_arg = 0
-    free = None
     while i < n:
         op = code[i]
-        if i in linestarts:
-            if i > 0:
-                print()
-            print("%3d" % linestarts[i], end=' ')
-        else:
-            print('   ', end=' ')
-
-        if i == lasti: print('-->', end=' ')
-        else: print('   ', end=' ')
-        if i in labels: print('>>', end=' ')
-        else: print('  ', end=' ')
-        print(repr(i).rjust(4), end=' ')
-        print(opname[op].ljust(20), end=' ')
+        offset = i
+        if linestarts is not None:
+            starts_line = linestarts.get(i, None)
+            if starts_line is not None:
+                starts_line += line_offset
+        is_jump_target = i in labels
         i = i+1
+        arg = None
+        argval = None
+        argrepr = ''
         if op >= HAVE_ARGUMENT:
-            oparg = code[i] + code[i+1]*256 + extended_arg
+            arg = code[i] + code[i+1]*256 + extended_arg
             extended_arg = 0
             i = i+2
             if op == EXTENDED_ARG:
-                extended_arg = oparg*65536
-            print(repr(oparg).rjust(5), end=' ')
+                extended_arg = arg*65536
+            #  Set argval to the dereferenced value of the argument when
+            #  availabe, and argrepr to the string representation of argval.
+            #    _disassemble_bytes needs the string repr of the
+            #    raw name index for LOAD_GLOBAL, LOAD_CONST, etc.
+            argval = arg
             if op in hasconst:
-                print('(' + repr(co.co_consts[oparg]) + ')', end=' ')
+                argval, argrepr = _get_const_info(arg, constants)
             elif op in hasname:
-                print('(' + co.co_names[oparg] + ')', end=' ')
+                argval, argrepr = _get_name_info(arg, names)
             elif op in hasjrel:
-                print('(to ' + repr(i + oparg) + ')', end=' ')
+                argval = i + arg
+                argrepr = "to " + repr(argval)
             elif op in haslocal:
-                print('(' + co.co_varnames[oparg] + ')', end=' ')
+                argval, argrepr = _get_name_info(arg, varnames)
             elif op in hascompare:
-                print('(' + cmp_op[oparg] + ')', end=' ')
+                argval = cmp_op[arg]
+                argrepr = argval
             elif op in hasfree:
-                if free is None:
-                    free = co.co_cellvars + co.co_freevars
-                print('(' + free[oparg] + ')', end=' ')
+                argval, argrepr = _get_name_info(arg, cells)
             elif op in hasnargs:
-                print('(%d positional, %d keyword pair)'
-                      % (code[i-2], code[i-1]), end=' ')
-        print()
+                argrepr = "%d positional, %d keyword pair" % (code[i-2], code[i-1])
+        yield Instruction(opname[op], op,
+                          arg, argval, argrepr,
+                          offset, starts_line, is_jump_target)
+
+def disassemble(co, lasti=-1, *, file=None):
+    """Disassemble a code object."""
+    cell_names = co.co_cellvars + co.co_freevars
+    linestarts = dict(findlinestarts(co))
+    _disassemble_bytes(co.co_code, lasti, co.co_varnames, co.co_names,
+                       co.co_consts, cell_names, linestarts, file=file)
 
 def _disassemble_bytes(code, lasti=-1, varnames=None, names=None,
-                       constants=None):
-    labels = findlabels(code)
-    n = len(code)
-    i = 0
-    while i < n:
-        op = code[i]
-        if i == lasti: print('-->', end=' ')
-        else: print('   ', end=' ')
-        if i in labels: print('>>', end=' ')
-        else: print('  ', end=' ')
-        print(repr(i).rjust(4), end=' ')
-        print(opname[op].ljust(15), end=' ')
-        i = i+1
-        if op >= HAVE_ARGUMENT:
-            oparg = code[i] + code[i+1]*256
-            i = i+2
-            print(repr(oparg).rjust(5), end=' ')
-            if op in hasconst:
-                if constants:
-                    print('(' + repr(constants[oparg]) + ')', end=' ')
-                else:
-                    print('(%d)'%oparg, end=' ')
-            elif op in hasname:
-                if names is not None:
-                    print('(' + names[oparg] + ')', end=' ')
-                else:
-                    print('(%d)'%oparg, end=' ')
-            elif op in hasjrel:
-                print('(to ' + repr(i + oparg) + ')', end=' ')
-            elif op in haslocal:
-                if varnames:
-                    print('(' + varnames[oparg] + ')', end=' ')
-                else:
-                    print('(%d)' % oparg, end=' ')
-            elif op in hascompare:
-                print('(' + cmp_op[oparg] + ')', end=' ')
-            elif op in hasnargs:
-                print('(%d positional, %d keyword pair)'
-                      % (code[i-2], code[i-1]), end=' ')
-        print()
+                       constants=None, cells=None, linestarts=None,
+                       *, file=None, line_offset=0):
+    # Omit the line number column entirely if we have no line number info
+    show_lineno = linestarts is not None
+    # TODO?: Adjust width upwards if max(linestarts.values()) >= 1000?
+    lineno_width = 3 if show_lineno else 0
+    for instr in _get_instructions_bytes(code, varnames, names,
+                                         constants, cells, linestarts,
+                                         line_offset=line_offset):
+        new_source_line = (show_lineno and
+                           instr.starts_line is not None and
+                           instr.offset > 0)
+        if new_source_line:
+            print(file=file)
+        is_current_instr = instr.offset == lasti
+        print(instr._disassemble(lineno_width, is_current_instr), file=file)
 
-def _disassemble_str(source):
+def _disassemble_str(source, *, file=None):
     """Compile the source string, then disassemble the code object."""
-    disassemble(_try_compile(source, '<dis>'))
+    disassemble(_try_compile(source, '<dis>'), file=file)
 
 disco = disassemble                     # XXX For backwards compatibility
 
@@ -250,19 +356,21 @@
 
     """
     labels = []
+    # enumerate() is not an option, since we sometimes process
+    # multiple elements on a single pass through the loop
     n = len(code)
     i = 0
     while i < n:
         op = code[i]
         i = i+1
         if op >= HAVE_ARGUMENT:
-            oparg = code[i] + code[i+1]*256
+            arg = code[i] + code[i+1]*256
             i = i+2
             label = -1
             if op in hasjrel:
-                label = i+oparg
+                label = i+arg
             elif op in hasjabs:
-                label = oparg
+                label = arg
             if label >= 0:
                 if label not in labels:
                     labels.append(label)
@@ -290,27 +398,77 @@
     if lineno != lastlineno:
         yield (addr, lineno)
 
+class Bytecode:
+    """The bytecode operations of a piece of code
+
+    Instantiate this with a function, method, string of code, or a code object
+    (as returned by compile()).
+
+    Iterating over this yields the bytecode operations as Instruction instances.
+    """
+    def __init__(self, x, *, first_line=None, current_offset=None):
+        self.codeobj = co = _get_code_object(x)
+        if first_line is None:
+            self.first_line = co.co_firstlineno
+            self._line_offset = 0
+        else:
+            self.first_line = first_line
+            self._line_offset = first_line - co.co_firstlineno
+        self._cell_names = co.co_cellvars + co.co_freevars
+        self._linestarts = dict(findlinestarts(co))
+        self._original_object = x
+        self.current_offset = current_offset
+
+    def __iter__(self):
+        co = self.codeobj
+        return _get_instructions_bytes(co.co_code, co.co_varnames, co.co_names,
+                                       co.co_consts, self._cell_names,
+                                       self._linestarts,
+                                       line_offset=self._line_offset)
+
+    def __repr__(self):
+        return "{}({!r})".format(self.__class__.__name__,
+                                 self._original_object)
+
+    @classmethod
+    def from_traceback(cls, tb):
+        """ Construct a Bytecode from the given traceback """
+        while tb.tb_next:
+            tb = tb.tb_next
+        return cls(tb.tb_frame.f_code, current_offset=tb.tb_lasti)
+
+    def info(self):
+        """Return formatted information about the code object."""
+        return _format_code_info(self.codeobj)
+
+    def dis(self):
+        """Return a formatted view of the bytecode operations."""
+        co = self.codeobj
+        if self.current_offset is not None:
+            offset = self.current_offset
+        else:
+            offset = -1
+        with io.StringIO() as output:
+            _disassemble_bytes(co.co_code, varnames=co.co_varnames,
+                               names=co.co_names, constants=co.co_consts,
+                               cells=self._cell_names,
+                               linestarts=self._linestarts,
+                               line_offset=self._line_offset,
+                               file=output,
+                               lasti=offset)
+            return output.getvalue()
+
+
 def _test():
     """Simple test program to disassemble a file."""
-    if sys.argv[1:]:
-        if sys.argv[2:]:
-            sys.stderr.write("usage: python dis.py [-|file]\n")
-            sys.exit(2)
-        fn = sys.argv[1]
-        if not fn or fn == "-":
-            fn = None
-    else:
-        fn = None
-    if fn is None:
-        f = sys.stdin
-    else:
-        f = open(fn)
-    source = f.read()
-    if fn is not None:
-        f.close()
-    else:
-        fn = "<stdin>"
-    code = compile(source, fn, "exec")
+    import argparse
+
+    parser = argparse.ArgumentParser()
+    parser.add_argument('infile', type=argparse.FileType(), nargs='?', default='-')
+    args = parser.parse_args()
+    with args.infile as infile:
+        source = infile.read()
+    code = compile(source, args.infile.name, "exec")
     dis(code)
 
 if __name__ == "__main__":
diff --git a/Lib/distutils/__init__.py b/Lib/distutils/__init__.py
index 057e90b..dfe62ff 100644
--- a/Lib/distutils/__init__.py
+++ b/Lib/distutils/__init__.py
@@ -13,5 +13,5 @@
 # Updated automatically by the Python release process.
 #
 #--start constants--
-__version__ = "3.3.6"
+__version__ = "3.4.2"
 #--end constants--
diff --git a/Lib/distutils/archive_util.py b/Lib/distutils/archive_util.py
index fcda08e..4470bb0 100644
--- a/Lib/distutils/archive_util.py
+++ b/Lib/distutils/archive_util.py
@@ -18,15 +18,55 @@
 from distutils.dir_util import mkpath
 from distutils import log
 
-def make_tarball(base_name, base_dir, compress="gzip", verbose=0, dry_run=0):
+try:
+    from pwd import getpwnam
+except ImportError:
+    getpwnam = None
+
+try:
+    from grp import getgrnam
+except ImportError:
+    getgrnam = None
+
+def _get_gid(name):
+    """Returns a gid, given a group name."""
+    if getgrnam is None or name is None:
+        return None
+    try:
+        result = getgrnam(name)
+    except KeyError:
+        result = None
+    if result is not None:
+        return result[2]
+    return None
+
+def _get_uid(name):
+    """Returns an uid, given a user name."""
+    if getpwnam is None or name is None:
+        return None
+    try:
+        result = getpwnam(name)
+    except KeyError:
+        result = None
+    if result is not None:
+        return result[2]
+    return None
+
+def make_tarball(base_name, base_dir, compress="gzip", verbose=0, dry_run=0,
+                 owner=None, group=None):
     """Create a (possibly compressed) tar file from all the files under
     'base_dir'.
 
     'compress' must be "gzip" (the default), "compress", "bzip2", or None.
-    Both "tar" and the compression utility named by 'compress' must be on
-    the default program search path, so this is probably Unix-specific.
+    (compress will be deprecated in Python 3.2)
+
+    'owner' and 'group' can be used to define an owner and a group for the
+    archive that is being built. If not provided, the current owner and group
+    will be used.
+
     The output tar file will be named 'base_dir' +  ".tar", possibly plus
     the appropriate compression extension (".gz", ".bz2" or ".Z").
+
     Returns the output filename.
     """
     tar_compression = {'gzip': 'gz', 'bzip2': 'bz2', None: '', 'compress': ''}
@@ -48,10 +88,23 @@
     import tarfile  # late import so Python build itself doesn't break
 
     log.info('Creating tar archive')
+
+    uid = _get_uid(owner)
+    gid = _get_gid(group)
+
+    def _set_uid_gid(tarinfo):
+        if gid is not None:
+            tarinfo.gid = gid
+            tarinfo.gname = group
+        if uid is not None:
+            tarinfo.uid = uid
+            tarinfo.uname = owner
+        return tarinfo
+
     if not dry_run:
         tar = tarfile.open(archive_name, 'w|%s' % tar_compression[compress])
         try:
-            tar.add(base_dir)
+            tar.add(base_dir, filter=_set_uid_gid)
         finally:
             tar.close()
 
@@ -140,7 +193,7 @@
     return None
 
 def make_archive(base_name, format, root_dir=None, base_dir=None, verbose=0,
-                 dry_run=0):
+                 dry_run=0, owner=None, group=None):
     """Create an archive file (eg. zip or tar).
 
     'base_name' is the name of the file to create, minus any format-specific
@@ -153,6 +206,9 @@
     ie. 'base_dir' will be the common prefix of all files and
     directories in the archive.  'root_dir' and 'base_dir' both default
     to the current directory.  Returns the name of the archive file.
+
+    'owner' and 'group' are used when creating a tar archive. By default,
+    uses the current owner and group.
     """
     save_cwd = os.getcwd()
     if root_dir is not None:
@@ -174,6 +230,11 @@
     func = format_info[0]
     for arg, val in format_info[1]:
         kwargs[arg] = val
+
+    if format != 'zip':
+        kwargs['owner'] = owner
+        kwargs['group'] = group
+
     try:
         filename = func(base_name, base_dir, **kwargs)
     finally:
diff --git a/Lib/distutils/ccompiler.py b/Lib/distutils/ccompiler.py
index c795c95..911e84d 100644
--- a/Lib/distutils/ccompiler.py
+++ b/Lib/distutils/ccompiler.py
@@ -351,7 +351,7 @@
         return macros, objects, extra, pp_opts, build
 
     def _get_cc_args(self, pp_opts, debug, before):
-        # works for unixccompiler, emxccompiler, cygwinccompiler
+        # works for unixccompiler, cygwinccompiler
         cc_args = pp_opts + ['-c']
         if debug:
             cc_args[:0] = ['-g']
@@ -926,7 +926,6 @@
     # on a cygwin built python we can use gcc like an ordinary UNIXish
     # compiler
     ('cygwin.*', 'unix'),
-    ('os2emx', 'emx'),
 
     # OS name mappings
     ('posix', 'unix'),
@@ -968,8 +967,6 @@
                                "Mingw32 port of GNU C Compiler for Win32"),
                    'bcpp':    ('bcppcompiler', 'BCPPCompiler',
                                "Borland C++ Compiler"),
-                   'emx':     ('emxccompiler', 'EMXCCompiler',
-                               "EMX port of GNU C Compiler for OS/2"),
                  }
 
 def show_compilers():
diff --git a/Lib/distutils/cmd.py b/Lib/distutils/cmd.py
index 3ea0810..c89d5ef 100644
--- a/Lib/distutils/cmd.py
+++ b/Lib/distutils/cmd.py
@@ -365,9 +365,11 @@
         from distutils.spawn import spawn
         spawn(cmd, search_path, dry_run=self.dry_run)
 
-    def make_archive(self, base_name, format, root_dir=None, base_dir=None):
+    def make_archive(self, base_name, format, root_dir=None, base_dir=None,
+                     owner=None, group=None):
         return archive_util.make_archive(base_name, format, root_dir, base_dir,
-                                         dry_run=self.dry_run)
+                                         dry_run=self.dry_run,
+                                         owner=owner, group=group)
 
     def make_file(self, infiles, outfile, func, args,
                   exec_msg=None, skip_msg=None, level=1):
diff --git a/Lib/distutils/command/bdist.py b/Lib/distutils/command/bdist.py
index c5188eb..6814a1c 100644
--- a/Lib/distutils/command/bdist.py
+++ b/Lib/distutils/command/bdist.py
@@ -37,6 +37,12 @@
                      "[default: dist]"),
                     ('skip-build', None,
                      "skip rebuilding everything (for testing/debugging)"),
+                    ('owner=', 'u',
+                     "Owner name used when creating a tar file"
+                     " [default: current user]"),
+                    ('group=', 'g',
+                     "Group name used when creating a tar file"
+                     " [default: current group]"),
                    ]
 
     boolean_options = ['skip-build']
@@ -52,8 +58,7 @@
     # This won't do in reality: will need to distinguish RPM-ish Linux,
     # Debian-ish Linux, Solaris, FreeBSD, ..., Windows, Mac OS.
     default_format = {'posix': 'gztar',
-                      'nt': 'zip',
-                      'os2': 'zip'}
+                      'nt': 'zip'}
 
     # Establish the preferred order (for the --help-formats option).
     format_commands = ['rpm', 'gztar', 'bztar', 'ztar', 'tar',
@@ -78,6 +83,8 @@
         self.formats = None
         self.dist_dir = None
         self.skip_build = 0
+        self.group = None
+        self.owner = None
 
     def finalize_options(self):
         # have to finalize 'plat_name' before 'bdist_base'
@@ -123,6 +130,11 @@
             if cmd_name not in self.no_format_option:
                 sub_cmd.format = self.formats[i]
 
+            # passing the owner and group names for tar archiving
+            if cmd_name == 'bdist_dumb':
+                sub_cmd.owner = self.owner
+                sub_cmd.group = self.group
+
             # If we're going to need to run this command again, tell it to
             # keep its temporary files around so subsequent runs go faster.
             if cmd_name in commands[i+1:]:
diff --git a/Lib/distutils/command/bdist_dumb.py b/Lib/distutils/command/bdist_dumb.py
index 1ab09d1..4405d12 100644
--- a/Lib/distutils/command/bdist_dumb.py
+++ b/Lib/distutils/command/bdist_dumb.py
@@ -33,13 +33,18 @@
                     ('relative', None,
                      "build the archive using relative paths"
                      "(default: false)"),
+                    ('owner=', 'u',
+                     "Owner name used when creating a tar file"
+                     " [default: current user]"),
+                    ('group=', 'g',
+                     "Group name used when creating a tar file"
+                     " [default: current group]"),
                    ]
 
     boolean_options = ['keep-temp', 'skip-build', 'relative']
 
     default_format = { 'posix': 'gztar',
-                       'nt': 'zip',
-                       'os2': 'zip' }
+                       'nt': 'zip' }
 
     def initialize_options(self):
         self.bdist_dir = None
@@ -49,6 +54,8 @@
         self.dist_dir = None
         self.skip_build = None
         self.relative = 0
+        self.owner = None
+        self.group = None
 
     def finalize_options(self):
         if self.bdist_dir is None:
@@ -85,11 +92,6 @@
         archive_basename = "%s.%s" % (self.distribution.get_fullname(),
                                       self.plat_name)
 
-        # OS/2 objects to any ":" characters in a filename (such as when
-        # a timestamp is used in a version) so change them to hyphens.
-        if os.name == "os2":
-            archive_basename = archive_basename.replace(":", "-")
-
         pseudoinstall_root = os.path.join(self.dist_dir, archive_basename)
         if not self.relative:
             archive_root = self.bdist_dir
@@ -107,7 +109,8 @@
 
         # Make the archive
         filename = self.make_archive(pseudoinstall_root,
-                                     self.format, root_dir=archive_root)
+                                     self.format, root_dir=archive_root,
+                                     owner=self.owner, group=self.group)
         if self.distribution.has_ext_modules():
             pyversion = get_python_version()
         else:
diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py
index bc6a23f..acbe648 100644
--- a/Lib/distutils/command/build_ext.py
+++ b/Lib/distutils/command/build_ext.py
@@ -14,13 +14,7 @@
 from distutils.util import get_platform
 from distutils import log
 
-# this keeps compatibility from 2.3 to 2.5
-if sys.version < "2.6":
-    USER_BASE = None
-    HAS_USER_SITE = False
-else:
-    from site import USER_BASE
-    HAS_USER_SITE = True
+from site import USER_BASE
 
 if os.name == 'nt':
     from distutils.msvccompiler import get_build_version
@@ -97,14 +91,11 @@
          "list of SWIG command line options"),
         ('swig=', None,
          "path to the SWIG executable"),
+        ('user', None,
+         "add user include, library and rpath")
         ]
 
-    boolean_options = ['inplace', 'debug', 'force', 'swig-cpp']
-
-    if HAS_USER_SITE:
-        user_options.append(('user', None,
-                             "add user include, library and rpath"))
-        boolean_options.append('user')
+    boolean_options = ['inplace', 'debug', 'force', 'swig-cpp', 'user']
 
     help_options = [
         ('help-compiler', None,
@@ -230,11 +221,6 @@
                 self.library_dirs.append(os.path.join(sys.exec_prefix,
                                          'PC', 'VC6'))
 
-        # OS/2 (EMX) doesn't support Debug vs Release builds, but has the
-        # import libraries in its "Config" subdirectory
-        if os.name == 'os2':
-            self.library_dirs.append(os.path.join(sys.exec_prefix, 'Config'))
-
         # for extensions under Cygwin and AtheOS Python's library directory must be
         # appended to library_dirs
         if sys.platform[:6] == 'cygwin' or sys.platform[:6] == 'atheos':
@@ -251,7 +237,7 @@
         # Python's library directory must be appended to library_dirs
         # See Issues: #1600860, #4366
         if (sysconfig.get_config_var('Py_ENABLE_SHARED')):
-            if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")):
+            if not sysconfig.python_build:
                 # building third party extensions
                 self.library_dirs.append(sysconfig.get_config_var('LIBDIR'))
             else:
@@ -619,9 +605,6 @@
                     return fn
             else:
                 return "swig.exe"
-        elif os.name == "os2":
-            # assume swig available in the PATH.
-            return "swig.exe"
         else:
             raise DistutilsPlatformError(
                   "I don't know how to find (much less run) SWIG "
@@ -672,9 +655,6 @@
         """
         from distutils.sysconfig import get_config_var
         ext_path = ext_name.split('.')
-        # OS/2 has an 8 character module (extension) limit :-(
-        if os.name == "os2":
-            ext_path[len(ext_path) - 1] = ext_path[len(ext_path) - 1][:8]
         # extensions in debug_mode are named 'module_d.pyd' under windows
         ext_suffix = get_config_var('EXT_SUFFIX')
         if os.name == 'nt' and self.debug:
@@ -695,7 +675,7 @@
     def get_libraries(self, ext):
         """Return the list of libraries to link against when building a
         shared extension.  On most platforms, this is just 'ext.libraries';
-        on Windows and OS/2, we add the Python library (eg. python20.dll).
+        on Windows, we add the Python library (eg. python20.dll).
         """
         # The python library is always needed on Windows.  For MSVC, this
         # is redundant, since the library is mentioned in a pragma in
@@ -715,19 +695,6 @@
                 return ext.libraries + [pythonlib]
             else:
                 return ext.libraries
-        elif sys.platform == "os2emx":
-            # EMX/GCC requires the python library explicitly, and I
-            # believe VACPP does as well (though not confirmed) - AIM Apr01
-            template = "python%d%d"
-            # debug versions of the main DLL aren't supported, at least
-            # not at this time - AIM Apr01
-            #if self.debug:
-            #    template = template + '_d'
-            pythonlib = (template %
-                   (sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff))
-            # don't extend ext.libraries, it may be shared with other
-            # extensions, it is a reference to the original list
-            return ext.libraries + [pythonlib]
         elif sys.platform[:6] == "cygwin":
             template = "python%d.%d"
             pythonlib = (template %
diff --git a/Lib/distutils/command/build_py.py b/Lib/distutils/command/build_py.py
index d48eb69..9100b96 100644
--- a/Lib/distutils/command/build_py.py
+++ b/Lib/distutils/command/build_py.py
@@ -3,7 +3,7 @@
 Implements the Distutils 'build_py' command."""
 
 import os
-import imp
+import importlib.util
 import sys
 from glob import glob
 
@@ -313,11 +313,11 @@
             outputs.append(filename)
             if include_bytecode:
                 if self.compile:
-                    outputs.append(imp.cache_from_source(filename,
-                                                         debug_override=True))
+                    outputs.append(importlib.util.cache_from_source(
+                        filename, debug_override=True))
                 if self.optimize > 0:
-                    outputs.append(imp.cache_from_source(filename,
-                                                         debug_override=False))
+                    outputs.append(importlib.util.cache_from_source(
+                        filename, debug_override=False))
 
         outputs += [
             os.path.join(build_dir, filename)
diff --git a/Lib/distutils/command/build_scripts.py b/Lib/distutils/command/build_scripts.py
index 4b5b22e..90a8380 100644
--- a/Lib/distutils/command/build_scripts.py
+++ b/Lib/distutils/command/build_scripts.py
@@ -74,7 +74,7 @@
             # script.
             try:
                 f = open(script, "rb")
-            except IOError:
+            except OSError:
                 if not self.dry_run:
                     raise
                 f = None
diff --git a/Lib/distutils/command/check.py b/Lib/distutils/command/check.py
index 22b9349..7ebe707 100644
--- a/Lib/distutils/command/check.py
+++ b/Lib/distutils/command/check.py
@@ -122,7 +122,7 @@
         """Returns warnings when the provided data doesn't compile."""
         source_path = StringIO()
         parser = Parser()
-        settings = frontend.OptionParser().get_default_values()
+        settings = frontend.OptionParser(components=(Parser,)).get_default_values()
         settings.tab_width = 4
         settings.pep_references = None
         settings.rfc_references = None
@@ -138,8 +138,8 @@
         document.note_source(source_path, -1)
         try:
             parser.parse(data, document)
-        except AttributeError:
-            reporter.messages.append((-1, 'Could not finish the parsing.',
-                                      '', {}))
+        except AttributeError as e:
+            reporter.messages.append(
+                (-1, 'Could not finish the parsing: %s.' % e, '', {}))
 
         return reporter.messages
diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py
index 3c675d1..d768dc5 100644
--- a/Lib/distutils/command/install.py
+++ b/Lib/distutils/command/install.py
@@ -15,32 +15,17 @@
 from distutils.util import get_platform
 from distutils.errors import DistutilsOptionError
 
-# this keeps compatibility from 2.3 to 2.5
-if sys.version < "2.6":
-    USER_BASE = None
-    USER_SITE = None
-    HAS_USER_SITE = False
-else:
-    from site import USER_BASE
-    from site import USER_SITE
-    HAS_USER_SITE = True
+from site import USER_BASE
+from site import USER_SITE
+HAS_USER_SITE = True
 
-if sys.version < "2.2":
-    WINDOWS_SCHEME = {
-        'purelib': '$base',
-        'platlib': '$base',
-        'headers': '$base/Include/$dist_name',
-        'scripts': '$base/Scripts',
-        'data'   : '$base',
-    }
-else:
-    WINDOWS_SCHEME = {
-        'purelib': '$base/Lib/site-packages',
-        'platlib': '$base/Lib/site-packages',
-        'headers': '$base/Include/$dist_name',
-        'scripts': '$base/Scripts',
-        'data'   : '$base',
-    }
+WINDOWS_SCHEME = {
+    'purelib': '$base/Lib/site-packages',
+    'platlib': '$base/Lib/site-packages',
+    'headers': '$base/Include/$dist_name',
+    'scripts': '$base/Scripts',
+    'data'   : '$base',
+}
 
 INSTALL_SCHEMES = {
     'unix_prefix': {
@@ -58,13 +43,6 @@
         'data'   : '$base',
         },
     'nt': WINDOWS_SCHEME,
-    'os2': {
-        'purelib': '$base/Lib/site-packages',
-        'platlib': '$base/Lib/site-packages',
-        'headers': '$base/Include/$dist_name',
-        'scripts': '$base/Scripts',
-        'data'   : '$base',
-        },
     }
 
 # user site schemes
@@ -86,14 +64,6 @@
         'data'   : '$userbase',
         }
 
-    INSTALL_SCHEMES['os2_home'] = {
-        'purelib': '$usersite',
-        'platlib': '$usersite',
-        'headers': '$userbase/include/python$py_version_short/$dist_name',
-        'scripts': '$userbase/bin',
-        'data'   : '$userbase',
-        }
-
 # The keys to an installation scheme; if any new types of files are to be
 # installed, be sure to add an entry to every installation scheme above,
 # and to SCHEME_KEYS here.
diff --git a/Lib/distutils/command/install_lib.py b/Lib/distutils/command/install_lib.py
index 15c08f1..215813b 100644
--- a/Lib/distutils/command/install_lib.py
+++ b/Lib/distutils/command/install_lib.py
@@ -4,7 +4,7 @@
 (install all Python modules)."""
 
 import os
-import imp
+import importlib.util
 import sys
 
 from distutils.core import Command
@@ -165,10 +165,10 @@
             if ext != PYTHON_SOURCE_EXTENSION:
                 continue
             if self.compile:
-                bytecode_files.append(imp.cache_from_source(
+                bytecode_files.append(importlib.util.cache_from_source(
                     py_file, debug_override=True))
             if self.optimize > 0:
-                bytecode_files.append(imp.cache_from_source(
+                bytecode_files.append(importlib.util.cache_from_source(
                     py_file, debug_override=False))
 
         return bytecode_files
diff --git a/Lib/distutils/command/sdist.py b/Lib/distutils/command/sdist.py
index 116f67e..7ea3d5f 100644
--- a/Lib/distutils/command/sdist.py
+++ b/Lib/distutils/command/sdist.py
@@ -74,6 +74,10 @@
         ('metadata-check', None,
          "Ensure that all required elements of meta-data "
          "are supplied. Warn if any missing. [default]"),
+        ('owner=', 'u',
+         "Owner name used when creating a tar file [default: current user]"),
+        ('group=', 'g',
+         "Group name used when creating a tar file [default: current group]"),
         ]
 
     boolean_options = ['use-defaults', 'prune',
@@ -113,6 +117,8 @@
 
         self.archive_files = None
         self.metadata_check = 1
+        self.owner = None
+        self.group = None
 
     def finalize_options(self):
         if self.manifest is None:
@@ -444,7 +450,8 @@
             self.formats.append(self.formats.pop(self.formats.index('tar')))
 
         for fmt in self.formats:
-            file = self.make_archive(base_name, fmt, base_dir=base_dir)
+            file = self.make_archive(base_name, fmt, base_dir=base_dir,
+                                     owner=self.owner, group=self.group)
             archive_files.append(file)
             self.distribution.dist_files.append(('sdist', '', file))
 
diff --git a/Lib/distutils/command/upload.py b/Lib/distutils/command/upload.py
index e30c189..1a96e22 100644
--- a/Lib/distutils/command/upload.py
+++ b/Lib/distutils/command/upload.py
@@ -2,10 +2,6 @@
 
 Implements the Distutils 'upload' subcommand (upload package to PyPI)."""
 
-from distutils.errors import *
-from distutils.core import PyPIRCCommand
-from distutils.spawn import spawn
-from distutils import log
 import sys
 import os, io
 import socket
@@ -13,6 +9,10 @@
 from base64 import standard_b64encode
 from urllib.request import urlopen, Request, HTTPError
 from urllib.parse import urlparse
+from distutils.errors import DistutilsError, DistutilsOptionError
+from distutils.core import PyPIRCCommand
+from distutils.spawn import spawn
+from distutils import log
 
 # this keeps compatibility for 2.3 and 2.4
 if sys.version < "2.5":
@@ -143,11 +143,11 @@
 
         # Build up the MIME payload for the POST data
         boundary = '--------------GHSKFJDLGDS7543FJKLFHRE75642756743254'
-        sep_boundary = b'\n--' + boundary.encode('ascii')
-        end_boundary = sep_boundary + b'--'
+        sep_boundary = b'\r\n--' + boundary.encode('ascii')
+        end_boundary = sep_boundary + b'--\r\n'
         body = io.BytesIO()
         for key, value in data.items():
-            title = '\nContent-Disposition: form-data; name="%s"' % key
+            title = '\r\nContent-Disposition: form-data; name="%s"' % key
             # handle multiple entries for the same name
             if type(value) != type([]):
                 value = [value]
@@ -159,12 +159,11 @@
                     value = str(value).encode('utf-8')
                 body.write(sep_boundary)
                 body.write(title.encode('utf-8'))
-                body.write(b"\n\n")
+                body.write(b"\r\n\r\n")
                 body.write(value)
                 if value and value[-1:] == b'\r':
                     body.write(b'\n')  # write an extra newline (lurve Macs)
         body.write(end_boundary)
-        body.write(b"\n")
         body = body.getvalue()
 
         self.announce("Submitting %s to %s" % (filename, self.repository), log.INFO)
@@ -182,9 +181,9 @@
             result = urlopen(request)
             status = result.getcode()
             reason = result.msg
-        except socket.error as e:
+        except OSError as e:
             self.announce(str(e), log.ERROR)
-            return
+            raise
         except HTTPError as e:
             status = e.code
             reason = e.msg
@@ -193,8 +192,9 @@
             self.announce('Server response (%s): %s' % (status, reason),
                           log.INFO)
         else:
-            self.announce('Upload failed (%s): %s' % (status, reason),
-                          log.ERROR)
+            msg = 'Upload failed (%s): %s' % (status, reason)
+            self.announce(msg, log.ERROR)
+            raise DistutilsError(msg)
         if self.show_response:
             text = self._read_pypi_response(result)
             msg = '\n'.join(('-' * 75, text, '-' * 75))
diff --git a/Lib/distutils/config.py b/Lib/distutils/config.py
index 106e146..382aca8 100644
--- a/Lib/distutils/config.py
+++ b/Lib/distutils/config.py
@@ -83,6 +83,15 @@
                             current[key] = config.get(server, key)
                         else:
                             current[key] = default
+
+                    # work around people having "repository" for the "pypi"
+                    # section of their config set to the HTTP (rather than
+                    # HTTPS) URL
+                    if (server == 'pypi' and
+                        repository in (self.DEFAULT_REPOSITORY, 'pypi')):
+                        current['repository'] = self.DEFAULT_REPOSITORY
+                        return current
+
                     if (current['server'] == repository or
                         current['repository'] == repository):
                         return current
diff --git a/Lib/distutils/core.py b/Lib/distutils/core.py
index 25d91ba..2bfe66a 100644
--- a/Lib/distutils/core.py
+++ b/Lib/distutils/core.py
@@ -127,8 +127,9 @@
     if _setup_stop_after == "config":
         return dist
 
-    # Parse the command line; any command-line errors are the end user's
-    # fault, so turn them into SystemExit to suppress tracebacks.
+    # Parse the command line and override config files; any
+    # command-line errors are the end user's fault, so turn them into
+    # SystemExit to suppress tracebacks.
     try:
         ok = dist.parse_command_line()
     except DistutilsArgError as msg:
@@ -147,7 +148,7 @@
             dist.run_commands()
         except KeyboardInterrupt:
             raise SystemExit("interrupted")
-        except (IOError, os.error) as exc:
+        except OSError as exc:
             if DEBUG:
                 sys.stderr.write("error: %s\n" % (exc,))
                 raise
diff --git a/Lib/distutils/cygwinccompiler.py b/Lib/distutils/cygwinccompiler.py
index e0074a1..d28b1b3 100644
--- a/Lib/distutils/cygwinccompiler.py
+++ b/Lib/distutils/cygwinccompiler.py
@@ -54,7 +54,8 @@
 from distutils.ccompiler import gen_preprocess_options, gen_lib_options
 from distutils.unixccompiler import UnixCCompiler
 from distutils.file_util import write_file
-from distutils.errors import DistutilsExecError, CompileError, UnknownFileError
+from distutils.errors import (DistutilsExecError, CCompilerError,
+        CompileError, UnknownFileError)
 from distutils import log
 from distutils.version import LooseVersion
 from distutils.spawn import find_executable
@@ -294,18 +295,17 @@
         else:
             entry_point = ''
 
-        if self.gcc_version < '4' or is_cygwingcc():
-            no_cygwin = ' -mno-cygwin'
-        else:
-            no_cygwin = ''
+        if is_cygwingcc():
+            raise CCompilerError(
+                'Cygwin gcc cannot be used with --compiler=mingw32')
 
-        self.set_executables(compiler='gcc%s -O -Wall' % no_cygwin,
-                             compiler_so='gcc%s -mdll -O -Wall' % no_cygwin,
-                             compiler_cxx='g++%s -O -Wall' % no_cygwin,
-                             linker_exe='gcc%s' % no_cygwin,
-                             linker_so='%s%s %s %s'
-                                    % (self.linker_dll, no_cygwin,
-                                       shared_option, entry_point))
+        self.set_executables(compiler='gcc -O -Wall',
+                             compiler_so='gcc -mdll -O -Wall',
+                             compiler_cxx='g++ -O -Wall',
+                             linker_exe='gcc',
+                             linker_so='%s %s %s'
+                                        % (self.linker_dll, shared_option,
+                                           entry_point))
         # Maybe we should also append -mthreads, but then the finished
         # dlls need another dll (mingwm10.dll see Mingw32 docs)
         # (-mthreads: Support thread-safe exception handling on `Mingw32')
@@ -364,7 +364,7 @@
                 return CONFIG_H_NOTOK, "'%s' does not mention '__GNUC__'" % fn
         finally:
             config_h.close()
-    except IOError as exc:
+    except OSError as exc:
         return (CONFIG_H_UNCERTAIN,
                 "couldn't read '%s': %s" % (fn, exc.strerror))
 
diff --git a/Lib/distutils/dir_util.py b/Lib/distutils/dir_util.py
index 6a72bdd..d5cd8e3 100644
--- a/Lib/distutils/dir_util.py
+++ b/Lib/distutils/dir_util.py
@@ -81,7 +81,7 @@
     """Create all the empty directories under 'base_dir' needed to put 'files'
     there.
 
-    'base_dir' is just the a name of a directory which doesn't necessarily
+    'base_dir' is just the name of a directory which doesn't necessarily
     exist yet; 'files' is a list of filenames to be interpreted relative to
     'base_dir'.  'base_dir' + the directory portion of every file in 'files'
     will be created if it doesn't already exist.  'mode', 'verbose' and
@@ -124,13 +124,12 @@
               "cannot copy tree '%s': not a directory" % src)
     try:
         names = os.listdir(src)
-    except os.error as e:
-        (errno, errstr) = e
+    except OSError as e:
         if dry_run:
             names = []
         else:
             raise DistutilsFileError(
-                  "error listing files in '%s': %s" % (src, errstr))
+                  "error listing files in '%s': %s" % (src, e.strerror))
 
     if not dry_run:
         mkpath(dst, verbose=verbose)
@@ -197,7 +196,7 @@
             abspath = os.path.abspath(cmd[1])
             if abspath in _path_created:
                 del _path_created[abspath]
-        except (IOError, OSError) as exc:
+        except OSError as exc:
             log.warn("error removing %s: %s", directory, exc)
 
 def ensure_relative(path):
diff --git a/Lib/distutils/dist.py b/Lib/distutils/dist.py
index 11a2102..7eb04bc 100644
--- a/Lib/distutils/dist.py
+++ b/Lib/distutils/dist.py
@@ -52,7 +52,9 @@
                       ('quiet', 'q', "run quietly (turns verbosity off)"),
                       ('dry-run', 'n', "don't actually do anything"),
                       ('help', 'h', "show detailed help message"),
-                     ]
+                      ('no-user-cfg', None,
+                       'ignore pydistutils.cfg in your home directory'),
+    ]
 
     # 'common_usage' is a short (2-3 line) string describing the common
     # usage of the setup script.
@@ -259,6 +261,22 @@
                     else:
                         sys.stderr.write(msg + "\n")
 
+        # no-user-cfg is handled before other command line args
+        # because other args override the config files, and this
+        # one is needed before we can load the config files.
+        # If attrs['script_args'] wasn't passed, assume false.
+        #
+        # This also make sure we just look at the global options
+        self.want_user_cfg = True
+
+        if self.script_args is not None:
+            for arg in self.script_args:
+                if not arg.startswith('-'):
+                    break
+                if arg == '--no-user-cfg':
+                    self.want_user_cfg = False
+                    break
+
         self.finalize_options()
 
     def get_option_dict(self, command):
@@ -310,7 +328,10 @@
         Distutils installation directory (ie. where the top-level
         Distutils __inst__.py file lives), a file in the user's home
         directory named .pydistutils.cfg on Unix and pydistutils.cfg
-        on Windows/Mac, and setup.cfg in the current directory.
+        on Windows/Mac; and setup.cfg in the current directory.
+
+        The file in the user's home directory can be disabled with the
+        --no-user-cfg option.
         """
         files = []
         check_environ()
@@ -330,15 +351,19 @@
             user_filename = "pydistutils.cfg"
 
         # And look for the user config file
-        user_file = os.path.join(os.path.expanduser('~'), user_filename)
-        if os.path.isfile(user_file):
-            files.append(user_file)
+        if self.want_user_cfg:
+            user_file = os.path.join(os.path.expanduser('~'), user_filename)
+            if os.path.isfile(user_file):
+                files.append(user_file)
 
         # All platforms support local setup.cfg
         local_file = "setup.cfg"
         if os.path.isfile(local_file):
             files.append(local_file)
 
+        if DEBUG:
+            self.announce("using config files: %s" % ', '.join(files))
+
         return files
 
     def parse_config_files(self, filenames=None):
diff --git a/Lib/distutils/emxccompiler.py b/Lib/distutils/emxccompiler.py
deleted file mode 100644
index 3675f8d..0000000
--- a/Lib/distutils/emxccompiler.py
+++ /dev/null
@@ -1,315 +0,0 @@
-"""distutils.emxccompiler
-
-Provides the EMXCCompiler class, a subclass of UnixCCompiler that
-handles the EMX port of the GNU C compiler to OS/2.
-"""
-
-# issues:
-#
-# * OS/2 insists that DLLs can have names no longer than 8 characters
-#   We put export_symbols in a def-file, as though the DLL can have
-#   an arbitrary length name, but truncate the output filename.
-#
-# * only use OMF objects and use LINK386 as the linker (-Zomf)
-#
-# * always build for multithreading (-Zmt) as the accompanying OS/2 port
-#   of Python is only distributed with threads enabled.
-#
-# tested configurations:
-#
-# * EMX gcc 2.81/EMX 0.9d fix03
-
-import os,sys,copy
-from distutils.ccompiler import gen_preprocess_options, gen_lib_options
-from distutils.unixccompiler import UnixCCompiler
-from distutils.file_util import write_file
-from distutils.errors import DistutilsExecError, CompileError, UnknownFileError
-from distutils import log
-
-class EMXCCompiler (UnixCCompiler):
-
-    compiler_type = 'emx'
-    obj_extension = ".obj"
-    static_lib_extension = ".lib"
-    shared_lib_extension = ".dll"
-    static_lib_format = "%s%s"
-    shared_lib_format = "%s%s"
-    res_extension = ".res"      # compiled resource file
-    exe_extension = ".exe"
-
-    def __init__ (self,
-                  verbose=0,
-                  dry_run=0,
-                  force=0):
-
-        UnixCCompiler.__init__ (self, verbose, dry_run, force)
-
-        (status, details) = check_config_h()
-        self.debug_print("Python's GCC status: %s (details: %s)" %
-                         (status, details))
-        if status is not CONFIG_H_OK:
-            self.warn(
-                "Python's pyconfig.h doesn't seem to support your compiler.  " +
-                ("Reason: %s." % details) +
-                "Compiling may fail because of undefined preprocessor macros.")
-
-        (self.gcc_version, self.ld_version) = \
-            get_versions()
-        self.debug_print(self.compiler_type + ": gcc %s, ld %s\n" %
-                         (self.gcc_version,
-                          self.ld_version) )
-
-        # Hard-code GCC because that's what this is all about.
-        # XXX optimization, warnings etc. should be customizable.
-        self.set_executables(compiler='gcc -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall',
-                             compiler_so='gcc -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall',
-                             linker_exe='gcc -Zomf -Zmt -Zcrtdll',
-                             linker_so='gcc -Zomf -Zmt -Zcrtdll -Zdll')
-
-        # want the gcc library statically linked (so that we don't have
-        # to distribute a version dependent on the compiler we have)
-        self.dll_libraries=["gcc"]
-
-    # __init__ ()
-
-    def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
-        if ext == '.rc':
-            # gcc requires '.rc' compiled to binary ('.res') files !!!
-            try:
-                self.spawn(["rc", "-r", src])
-            except DistutilsExecError as msg:
-                raise CompileError(msg)
-        else: # for other files use the C-compiler
-            try:
-                self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
-                           extra_postargs)
-            except DistutilsExecError as msg:
-                raise CompileError(msg)
-
-    def link (self,
-              target_desc,
-              objects,
-              output_filename,
-              output_dir=None,
-              libraries=None,
-              library_dirs=None,
-              runtime_library_dirs=None,
-              export_symbols=None,
-              debug=0,
-              extra_preargs=None,
-              extra_postargs=None,
-              build_temp=None,
-              target_lang=None):
-
-        # use separate copies, so we can modify the lists
-        extra_preargs = copy.copy(extra_preargs or [])
-        libraries = copy.copy(libraries or [])
-        objects = copy.copy(objects or [])
-
-        # Additional libraries
-        libraries.extend(self.dll_libraries)
-
-        # handle export symbols by creating a def-file
-        # with executables this only works with gcc/ld as linker
-        if ((export_symbols is not None) and
-            (target_desc != self.EXECUTABLE)):
-            # (The linker doesn't do anything if output is up-to-date.
-            # So it would probably better to check if we really need this,
-            # but for this we had to insert some unchanged parts of
-            # UnixCCompiler, and this is not what we want.)
-
-            # we want to put some files in the same directory as the
-            # object files are, build_temp doesn't help much
-            # where are the object files
-            temp_dir = os.path.dirname(objects[0])
-            # name of dll to give the helper files the same base name
-            (dll_name, dll_extension) = os.path.splitext(
-                os.path.basename(output_filename))
-
-            # generate the filenames for these files
-            def_file = os.path.join(temp_dir, dll_name + ".def")
-
-            # Generate .def file
-            contents = [
-                "LIBRARY %s INITINSTANCE TERMINSTANCE" % \
-                os.path.splitext(os.path.basename(output_filename))[0],
-                "DATA MULTIPLE NONSHARED",
-                "EXPORTS"]
-            for sym in export_symbols:
-                contents.append('  "%s"' % sym)
-            self.execute(write_file, (def_file, contents),
-                         "writing %s" % def_file)
-
-            # next add options for def-file and to creating import libraries
-            # for gcc/ld the def-file is specified as any other object files
-            objects.append(def_file)
-
-        #end: if ((export_symbols is not None) and
-        #        (target_desc != self.EXECUTABLE or self.linker_dll == "gcc")):
-
-        # who wants symbols and a many times larger output file
-        # should explicitly switch the debug mode on
-        # otherwise we let dllwrap/ld strip the output file
-        # (On my machine: 10KB < stripped_file < ??100KB
-        #   unstripped_file = stripped_file + XXX KB
-        #  ( XXX=254 for a typical python extension))
-        if not debug:
-            extra_preargs.append("-s")
-
-        UnixCCompiler.link(self,
-                           target_desc,
-                           objects,
-                           output_filename,
-                           output_dir,
-                           libraries,
-                           library_dirs,
-                           runtime_library_dirs,
-                           None, # export_symbols, we do this in our def-file
-                           debug,
-                           extra_preargs,
-                           extra_postargs,
-                           build_temp,
-                           target_lang)
-
-    # link ()
-
-    # -- Miscellaneous methods -----------------------------------------
-
-    # override the object_filenames method from CCompiler to
-    # support rc and res-files
-    def object_filenames (self,
-                          source_filenames,
-                          strip_dir=0,
-                          output_dir=''):
-        if output_dir is None: output_dir = ''
-        obj_names = []
-        for src_name in source_filenames:
-            # use normcase to make sure '.rc' is really '.rc' and not '.RC'
-            (base, ext) = os.path.splitext (os.path.normcase(src_name))
-            if ext not in (self.src_extensions + ['.rc']):
-                raise UnknownFileError("unknown file type '%s' (from '%s')" % \
-                      (ext, src_name))
-            if strip_dir:
-                base = os.path.basename (base)
-            if ext == '.rc':
-                # these need to be compiled to object files
-                obj_names.append (os.path.join (output_dir,
-                                            base + self.res_extension))
-            else:
-                obj_names.append (os.path.join (output_dir,
-                                            base + self.obj_extension))
-        return obj_names
-
-    # object_filenames ()
-
-    # override the find_library_file method from UnixCCompiler
-    # to deal with file naming/searching differences
-    def find_library_file(self, dirs, lib, debug=0):
-        shortlib = '%s.lib' % lib
-        longlib = 'lib%s.lib' % lib    # this form very rare
-
-        # get EMX's default library directory search path
-        try:
-            emx_dirs = os.environ['LIBRARY_PATH'].split(';')
-        except KeyError:
-            emx_dirs = []
-
-        for dir in dirs + emx_dirs:
-            shortlibp = os.path.join(dir, shortlib)
-            longlibp = os.path.join(dir, longlib)
-            if os.path.exists(shortlibp):
-                return shortlibp
-            elif os.path.exists(longlibp):
-                return longlibp
-
-        # Oops, didn't find it in *any* of 'dirs'
-        return None
-
-# class EMXCCompiler
-
-
-# Because these compilers aren't configured in Python's pyconfig.h file by
-# default, we should at least warn the user if he is using a unmodified
-# version.
-
-CONFIG_H_OK = "ok"
-CONFIG_H_NOTOK = "not ok"
-CONFIG_H_UNCERTAIN = "uncertain"
-
-def check_config_h():
-
-    """Check if the current Python installation (specifically, pyconfig.h)
-    appears amenable to building extensions with GCC.  Returns a tuple
-    (status, details), where 'status' is one of the following constants:
-      CONFIG_H_OK
-        all is well, go ahead and compile
-      CONFIG_H_NOTOK
-        doesn't look good
-      CONFIG_H_UNCERTAIN
-        not sure -- unable to read pyconfig.h
-    'details' is a human-readable string explaining the situation.
-
-    Note there are two ways to conclude "OK": either 'sys.version' contains
-    the string "GCC" (implying that this Python was built with GCC), or the
-    installed "pyconfig.h" contains the string "__GNUC__".
-    """
-
-    # XXX since this function also checks sys.version, it's not strictly a
-    # "pyconfig.h" check -- should probably be renamed...
-
-    from distutils import sysconfig
-    # if sys.version contains GCC then python was compiled with
-    # GCC, and the pyconfig.h file should be OK
-    if sys.version.find("GCC") >= 0:
-        return (CONFIG_H_OK, "sys.version mentions 'GCC'")
-
-    fn = sysconfig.get_config_h_filename()
-    try:
-        # It would probably better to read single lines to search.
-        # But we do this only once, and it is fast enough
-        f = open(fn)
-        try:
-            s = f.read()
-        finally:
-            f.close()
-
-    except IOError as exc:
-        # if we can't read this file, we cannot say it is wrong
-        # the compiler will complain later about this file as missing
-        return (CONFIG_H_UNCERTAIN,
-                "couldn't read '%s': %s" % (fn, exc.strerror))
-
-    else:
-        # "pyconfig.h" contains an "#ifdef __GNUC__" or something similar
-        if s.find("__GNUC__") >= 0:
-            return (CONFIG_H_OK, "'%s' mentions '__GNUC__'" % fn)
-        else:
-            return (CONFIG_H_NOTOK, "'%s' does not mention '__GNUC__'" % fn)
-
-
-def get_versions():
-    """ Try to find out the versions of gcc and ld.
-        If not possible it returns None for it.
-    """
-    from distutils.version import StrictVersion
-    from distutils.spawn import find_executable
-    import re
-
-    gcc_exe = find_executable('gcc')
-    if gcc_exe:
-        out = os.popen(gcc_exe + ' -dumpversion','r')
-        try:
-            out_string = out.read()
-        finally:
-            out.close()
-        result = re.search('(\d+\.\d+\.\d+)', out_string, re.ASCII)
-        if result:
-            gcc_version = StrictVersion(result.group(1))
-        else:
-            gcc_version = None
-    else:
-        gcc_version = None
-    # EMX ld has no way of reporting version number, and we use GCC
-    # anyway - so we can link OMF DLLs
-    ld_version = None
-    return (gcc_version, ld_version)
diff --git a/Lib/distutils/errors.py b/Lib/distutils/errors.py
index eb13c98..8b93059 100644
--- a/Lib/distutils/errors.py
+++ b/Lib/distutils/errors.py
@@ -35,8 +35,8 @@
 
 class DistutilsFileError (DistutilsError):
     """Any problems in the filesystem: expected file not found, etc.
-    Typically this is for problems that we detect before IOError or
-    OSError could be raised."""
+    Typically this is for problems that we detect before OSError
+    could be raised."""
     pass
 
 class DistutilsOptionError (DistutilsError):
diff --git a/Lib/distutils/file_util.py b/Lib/distutils/file_util.py
index 9bdd14e..b3fee35 100644
--- a/Lib/distutils/file_util.py
+++ b/Lib/distutils/file_util.py
@@ -27,26 +27,26 @@
     try:
         try:
             fsrc = open(src, 'rb')
-        except os.error as e:
+        except OSError as e:
             raise DistutilsFileError("could not open '%s': %s" % (src, e.strerror))
 
         if os.path.exists(dst):
             try:
                 os.unlink(dst)
-            except os.error as e:
+            except OSError as e:
                 raise DistutilsFileError(
                       "could not delete '%s': %s" % (dst, e.strerror))
 
         try:
             fdst = open(dst, 'wb')
-        except os.error as e:
+        except OSError as e:
             raise DistutilsFileError(
                   "could not create '%s': %s" % (dst, e.strerror))
 
         while True:
             try:
                 buf = fsrc.read(buffer_size)
-            except os.error as e:
+            except OSError as e:
                 raise DistutilsFileError(
                       "could not read from '%s': %s" % (src, e.strerror))
 
@@ -55,7 +55,7 @@
 
             try:
                 fdst.write(buf)
-            except os.error as e:
+            except OSError as e:
                 raise DistutilsFileError(
                       "could not write to '%s': %s" % (dst, e.strerror))
     finally:
@@ -80,7 +80,8 @@
     (os.symlink) instead of copying: set it to "hard" or "sym"; if it is
     None (the default), files are copied.  Don't set 'link' on systems that
     don't support it: 'copy_file()' doesn't check if hard or symbolic
-    linking is available.
+    linking is available. If hardlink fails, falls back to
+    _copy_file_contents().
 
     Under Mac OS, uses the native file copy function in macostools; on
     other systems, uses '_copy_file_contents()' to copy file contents.
@@ -132,24 +133,31 @@
     # (Unix only, of course, but that's the caller's responsibility)
     elif link == 'hard':
         if not (os.path.exists(dst) and os.path.samefile(src, dst)):
-            os.link(src, dst)
+            try:
+                os.link(src, dst)
+                return (dst, 1)
+            except OSError:
+                # If hard linking fails, fall back on copying file
+                # (some special filesystems don't support hard linking
+                #  even under Unix, see issue #8876).
+                pass
     elif link == 'sym':
         if not (os.path.exists(dst) and os.path.samefile(src, dst)):
             os.symlink(src, dst)
+            return (dst, 1)
 
     # Otherwise (non-Mac, not linking), copy the file contents and
     # (optionally) copy the times and mode.
-    else:
-        _copy_file_contents(src, dst)
-        if preserve_mode or preserve_times:
-            st = os.stat(src)
+    _copy_file_contents(src, dst)
+    if preserve_mode or preserve_times:
+        st = os.stat(src)
 
-            # According to David Ascher <da@ski.org>, utime() should be done
-            # before chmod() (at least under NT).
-            if preserve_times:
-                os.utime(dst, (st[ST_ATIME], st[ST_MTIME]))
-            if preserve_mode:
-                os.chmod(dst, S_IMODE(st[ST_MODE]))
+        # According to David Ascher <da@ski.org>, utime() should be done
+        # before chmod() (at least under NT).
+        if preserve_times:
+            os.utime(dst, (st[ST_ATIME], st[ST_MTIME]))
+        if preserve_mode:
+            os.chmod(dst, S_IMODE(st[ST_MODE]))
 
     return (dst, 1)
 
@@ -193,8 +201,8 @@
     copy_it = False
     try:
         os.rename(src, dst)
-    except os.error as e:
-        (num, msg) = e
+    except OSError as e:
+        (num, msg) = e.args
         if num == errno.EXDEV:
             copy_it = True
         else:
@@ -205,11 +213,11 @@
         copy_file(src, dst, verbose=verbose)
         try:
             os.unlink(src)
-        except os.error as e:
-            (num, msg) = e
+        except OSError as e:
+            (num, msg) = e.args
             try:
                 os.unlink(dst)
-            except os.error:
+            except OSError:
                 pass
             raise DistutilsFileError(
                   "couldn't move '%s' to '%s' by copy/delete: "
diff --git a/Lib/distutils/msvc9compiler.py b/Lib/distutils/msvc9compiler.py
index b3f6ce1..9688f20 100644
--- a/Lib/distutils/msvc9compiler.py
+++ b/Lib/distutils/msvc9compiler.py
@@ -729,7 +729,7 @@
                 return manifest_file
             finally:
                 manifest_f.close()
-        except IOError:
+        except OSError:
             pass
 
     # -- Miscellaneous methods -----------------------------------------
diff --git a/Lib/distutils/spawn.py b/Lib/distutils/spawn.py
index f66ff93..22e87e8 100644
--- a/Lib/distutils/spawn.py
+++ b/Lib/distutils/spawn.py
@@ -36,8 +36,6 @@
         _spawn_posix(cmd, search_path, dry_run=dry_run)
     elif os.name == 'nt':
         _spawn_nt(cmd, search_path, dry_run=dry_run)
-    elif os.name == 'os2':
-        _spawn_os2(cmd, search_path, dry_run=dry_run)
     else:
         raise DistutilsPlatformError(
               "don't know how to spawn programs on platform '%s'" % os.name)
@@ -82,30 +80,6 @@
             raise DistutilsExecError(
                   "command %r failed with exit status %d" % (cmd, rc))
 
-def _spawn_os2(cmd, search_path=1, verbose=0, dry_run=0):
-    executable = cmd[0]
-    if search_path:
-        # either we find one or it stays the same
-        executable = find_executable(executable) or executable
-    log.info(' '.join([executable] + cmd[1:]))
-    if not dry_run:
-        # spawnv for OS/2 EMX requires a full path to the .exe
-        try:
-            rc = os.spawnv(os.P_WAIT, executable, cmd)
-        except OSError as exc:
-            # this seems to happen when the command isn't found
-            if not DEBUG:
-                cmd = executable
-            raise DistutilsExecError(
-                  "command %r failed: %s" % (cmd, exc.args[-1]))
-        if rc != 0:
-            # and this reflects the command running but failing
-            if not DEBUG:
-                cmd = executable
-            log.debug("command %r failed with exit status %d" % (cmd, rc))
-            raise DistutilsExecError(
-                  "command %r failed with exit status %d" % (cmd, rc))
-
 if sys.platform == 'darwin':
     from distutils import sysconfig
     _cfg_target = None
@@ -207,7 +181,7 @@
     paths = path.split(os.pathsep)
     base, ext = os.path.splitext(executable)
 
-    if (sys.platform == 'win32' or os.name == 'os2') and (ext != '.exe'):
+    if (sys.platform == 'win32') and (ext != '.exe'):
         executable = executable + '.exe'
 
     if not os.path.isfile(executable):
diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
index b947988..a1452fe 100644
--- a/Lib/distutils/sysconfig.py
+++ b/Lib/distutils/sysconfig.py
@@ -114,8 +114,6 @@
         return os.path.join(prefix, "include", python_dir)
     elif os.name == "nt":
         return os.path.join(prefix, "include")
-    elif os.name == "os2":
-        return os.path.join(prefix, "Include")
     else:
         raise DistutilsPlatformError(
             "I don't know where Python installs its C header files "
@@ -153,14 +151,6 @@
         if standard_lib:
             return os.path.join(prefix, "Lib")
         else:
-            if get_python_version() < "2.2":
-                return prefix
-            else:
-                return os.path.join(prefix, "Lib", "site-packages")
-    elif os.name == "os2":
-        if standard_lib:
-            return os.path.join(prefix, "Lib")
-        else:
             return os.path.join(prefix, "Lib", "site-packages")
     else:
         raise DistutilsPlatformError(
@@ -186,7 +176,8 @@
             # version and build tools may not support the same set
             # of CPU architectures for universal builds.
             global _config_vars
-            if not _config_vars.get('CUSTOMIZED_OSX_COMPILER', ''):
+            # Use get_config_var() to ensure _config_vars is initialized.
+            if not get_config_var('CUSTOMIZED_OSX_COMPILER'):
                 import _osx_support
                 _osx_support.customize_compiler(_config_vars)
                 _config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True'
@@ -250,12 +241,8 @@
             inc_dir = _sys_home or project_base
     else:
         inc_dir = get_python_inc(plat_specific=1)
-    if get_python_version() < '2.2':
-        config_h = 'config.h'
-    else:
-        # The name of the config.h file changed in 2.2
-        config_h = 'pyconfig.h'
-    return os.path.join(inc_dir, config_h)
+
+    return os.path.join(inc_dir, 'pyconfig.h')
 
 
 def get_makefile_filename():
@@ -442,7 +429,7 @@
     try:
         filename = get_makefile_filename()
         parse_makefile(filename, g)
-    except IOError as msg:
+    except OSError as msg:
         my_msg = "invalid Python installation: unable to open %s" % filename
         if hasattr(msg, "strerror"):
             my_msg = my_msg + " (%s)" % msg.strerror
@@ -454,7 +441,7 @@
         filename = get_config_h_filename()
         with open(filename) as file:
             parse_config_h(file, g)
-    except IOError as msg:
+    except OSError as msg:
         my_msg = "invalid Python installation: unable to open %s" % filename
         if hasattr(msg, "strerror"):
             my_msg = my_msg + " (%s)" % msg.strerror
@@ -467,17 +454,6 @@
     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)
-
     global _config_vars
     _config_vars = g
 
@@ -492,7 +468,6 @@
     # XXX hmmm.. a normal install puts include files here
     g['INCLUDEPY'] = get_python_inc(plat_specific=0)
 
-    g['SO'] = '.pyd'
     g['EXT_SUFFIX'] = '.pyd'
     g['EXE'] = ".exe"
     g['VERSION'] = get_python_version().replace(".", "")
@@ -502,24 +477,6 @@
     _config_vars = g
 
 
-def _init_os2():
-    """Initialize the module as appropriate for OS/2"""
-    g = {}
-    # set basic install directories
-    g['LIBDEST'] = get_python_lib(plat_specific=0, standard_lib=1)
-    g['BINLIBDEST'] = get_python_lib(plat_specific=1, standard_lib=1)
-
-    # XXX hmmm.. a normal install puts include files here
-    g['INCLUDEPY'] = get_python_inc(plat_specific=0)
-
-    g['SO'] = '.pyd'
-    g['EXT_SUFFIX'] = '.pyd'
-    g['EXE'] = ".exe"
-
-    global _config_vars
-    _config_vars = g
-
-
 def get_config_vars(*args):
     """With no arguments, return a dictionary of all configuration
     variables relevant for the current platform.  Generally this includes
@@ -544,6 +501,11 @@
         _config_vars['prefix'] = PREFIX
         _config_vars['exec_prefix'] = EXEC_PREFIX
 
+        # For backward compatibility, see issue19555
+        SO = _config_vars.get('EXT_SUFFIX')
+        if SO is not None:
+            _config_vars['SO'] = SO
+
         # Always convert srcdir to an absolute path
         srcdir = _config_vars.get('srcdir', project_base)
         if os.name == 'posix':
@@ -594,4 +556,7 @@
     returned by 'get_config_vars()'.  Equivalent to
     get_config_vars().get(name)
     """
+    if name == 'SO':
+        import warnings
+        warnings.warn('SO is deprecated, use EXT_SUFFIX', DeprecationWarning, 2)
     return get_config_vars().get(name)
diff --git a/Lib/distutils/tests/test_archive_util.py b/Lib/distutils/tests/test_archive_util.py
index d3fb24a..2d72af4 100644
--- a/Lib/distutils/tests/test_archive_util.py
+++ b/Lib/distutils/tests/test_archive_util.py
@@ -16,6 +16,13 @@
 from test.support import check_warnings, run_unittest, patch
 
 try:
+    import grp
+    import pwd
+    UID_GID_SUPPORT = True
+except ImportError:
+    UID_GID_SUPPORT = False
+
+try:
     import zipfile
     ZIP_SUPPORT = True
 except ImportError:
@@ -77,7 +84,7 @@
 
         tmpdir2 = self.mkdtemp()
         unittest.skipUnless(splitdrive(tmpdir)[0] == splitdrive(tmpdir2)[0],
-                            "Source and target should be on same drive")
+                            "source and target should be on same drive")
 
         base_name = os.path.join(tmpdir2, target_name)
 
@@ -275,6 +282,58 @@
         finally:
             del ARCHIVE_FORMATS['xxx']
 
+    def test_make_archive_owner_group(self):
+        # testing make_archive with owner and group, with various combinations
+        # this works even if there's not gid/uid support
+        if UID_GID_SUPPORT:
+            group = grp.getgrgid(0)[0]
+            owner = pwd.getpwuid(0)[0]
+        else:
+            group = owner = 'root'
+
+        base_dir, root_dir, base_name =  self._create_files()
+        base_name = os.path.join(self.mkdtemp() , 'archive')
+        res = make_archive(base_name, 'zip', root_dir, base_dir, owner=owner,
+                           group=group)
+        self.assertTrue(os.path.exists(res))
+
+        res = make_archive(base_name, 'zip', root_dir, base_dir)
+        self.assertTrue(os.path.exists(res))
+
+        res = make_archive(base_name, 'tar', root_dir, base_dir,
+                           owner=owner, group=group)
+        self.assertTrue(os.path.exists(res))
+
+        res = make_archive(base_name, 'tar', root_dir, base_dir,
+                           owner='kjhkjhkjg', group='oihohoh')
+        self.assertTrue(os.path.exists(res))
+
+    @unittest.skipUnless(ZLIB_SUPPORT, "Requires zlib")
+    @unittest.skipUnless(UID_GID_SUPPORT, "Requires grp and pwd support")
+    def test_tarfile_root_owner(self):
+        tmpdir, tmpdir2, base_name =  self._create_files()
+        old_dir = os.getcwd()
+        os.chdir(tmpdir)
+        group = grp.getgrgid(0)[0]
+        owner = pwd.getpwuid(0)[0]
+        try:
+            archive_name = make_tarball(base_name, 'dist', compress=None,
+                                        owner=owner, group=group)
+        finally:
+            os.chdir(old_dir)
+
+        # check if the compressed tarball was created
+        self.assertTrue(os.path.exists(archive_name))
+
+        # now checks the rights
+        archive = tarfile.open(archive_name)
+        try:
+            for member in archive.getmembers():
+                self.assertEqual(member.uid, 0)
+                self.assertEqual(member.gid, 0)
+        finally:
+            archive.close()
+
 def test_suite():
     return unittest.makeSuite(ArchiveUtilTestCase)
 
diff --git a/Lib/distutils/tests/test_bdist_dumb.py b/Lib/distutils/tests/test_bdist_dumb.py
index 0ad32d4..c8ccdc2 100644
--- a/Lib/distutils/tests/test_bdist_dumb.py
+++ b/Lib/distutils/tests/test_bdist_dumb.py
@@ -1,7 +1,6 @@
 """Tests for distutils.command.bdist_dumb."""
 
 import os
-import imp
 import sys
 import zipfile
 import unittest
@@ -75,8 +74,6 @@
         # see what we have
         dist_created = os.listdir(os.path.join(pkg_dir, 'dist'))
         base = "%s.%s.zip" % (dist.get_fullname(), cmd.plat_name)
-        if os.name == 'os2':
-            base = base.replace(':', '-')
 
         self.assertEqual(dist_created, [base])
 
@@ -90,7 +87,7 @@
         contents = sorted(os.path.basename(fn) for fn in contents)
         wanted = ['foo-0.1-py%s.%s.egg-info' % sys.version_info[:2], 'foo.py']
         if not sys.dont_write_bytecode:
-            wanted.append('foo.%s.pyc' % imp.get_tag())
+            wanted.append('foo.%s.pyc' % sys.implementation.cache_tag)
         self.assertEqual(contents, sorted(wanted))
 
 def test_suite():
diff --git a/Lib/distutils/tests/test_bdist_rpm.py b/Lib/distutils/tests/test_bdist_rpm.py
index bcbb563..25c14ab 100644
--- a/Lib/distutils/tests/test_bdist_rpm.py
+++ b/Lib/distutils/tests/test_bdist_rpm.py
@@ -24,6 +24,7 @@
 """
 
 class BuildRpmTestCase(support.TempdirManager,
+                       support.EnvironGuard,
                        support.LoggingSilencer,
                        unittest.TestCase):
 
@@ -54,6 +55,7 @@
     def test_quiet(self):
         # let's create a package
         tmp_dir = self.mkdtemp()
+        os.environ['HOME'] = tmp_dir   # to confine dir '.rpmdb' creation
         pkg_dir = os.path.join(tmp_dir, 'foo')
         os.mkdir(pkg_dir)
         self.write_file((pkg_dir, 'setup.py'), SETUP_PY)
@@ -96,6 +98,7 @@
     def test_no_optimize_flag(self):
         # let's create a package that brakes bdist_rpm
         tmp_dir = self.mkdtemp()
+        os.environ['HOME'] = tmp_dir   # to confine dir '.rpmdb' creation
         pkg_dir = os.path.join(tmp_dir, 'foo')
         os.mkdir(pkg_dir)
         self.write_file((pkg_dir, 'setup.py'), SETUP_PY)
diff --git a/Lib/distutils/tests/test_build_ext.py b/Lib/distutils/tests/test_build_ext.py
index 9853abd..b9f407f 100644
--- a/Lib/distutils/tests/test_build_ext.py
+++ b/Lib/distutils/tests/test_build_ext.py
@@ -31,12 +31,11 @@
         self.tmp_dir = self.mkdtemp()
         self.sys_path = sys.path, sys.path[:]
         sys.path.append(self.tmp_dir)
-        if sys.version > "2.6":
-            import site
-            self.old_user_base = site.USER_BASE
-            site.USER_BASE = self.mkdtemp()
-            from distutils.command import build_ext
-            build_ext.USER_BASE = site.USER_BASE
+        import site
+        self.old_user_base = site.USER_BASE
+        site.USER_BASE = self.mkdtemp()
+        from distutils.command import build_ext
+        build_ext.USER_BASE = site.USER_BASE
 
     def test_build_ext(self):
         global ALREADY_TESTED
@@ -84,11 +83,10 @@
         support.unload('xx')
         sys.path = self.sys_path[0]
         sys.path[:] = self.sys_path[1]
-        if sys.version > "2.6":
-            import site
-            site.USER_BASE = self.old_user_base
-            from distutils.command import build_ext
-            build_ext.USER_BASE = self.old_user_base
+        import site
+        site.USER_BASE = self.old_user_base
+        from distutils.command import build_ext
+        build_ext.USER_BASE = self.old_user_base
         super(BuildExtTestCase, self).tearDown()
 
     def test_solaris_enable_shared(self):
@@ -444,8 +442,16 @@
 
         # get the deployment target that the interpreter was built with
         target = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET')
-        target = tuple(map(int, target.split('.')))
-        target = '%02d%01d0' % target
+        target = tuple(map(int, target.split('.')[0:2]))
+        # format the target value as defined in the Apple
+        # Availability Macros.  We can't use the macro names since
+        # at least one value we test with will not exist yet.
+        if target[1] < 10:
+            # for 10.1 through 10.9.x -> "10n0"
+            target = '%02d%01d0' % target
+        else:
+            # for 10.10 and beyond -> "10nn00"
+            target = '%02d%02d00' % target
         deptarget_ext = Extension(
             'deptarget',
             [deptarget_c],
diff --git a/Lib/distutils/tests/test_build_py.py b/Lib/distutils/tests/test_build_py.py
index 2ce9d44..c8f6b89 100644
--- a/Lib/distutils/tests/test_build_py.py
+++ b/Lib/distutils/tests/test_build_py.py
@@ -2,7 +2,6 @@
 
 import os
 import sys
-import imp
 import unittest
 
 from distutils.command.build_py import build_py
@@ -63,7 +62,8 @@
             self.assertFalse(os.path.exists(pycache_dir))
         else:
             pyc_files = os.listdir(pycache_dir)
-            self.assertIn("__init__.%s.pyc" % imp.get_tag(), pyc_files)
+            self.assertIn("__init__.%s.pyc" % sys.implementation.cache_tag,
+                          pyc_files)
 
     def test_empty_package_dir(self):
         # See bugs #1668596/#1720897
@@ -102,7 +102,8 @@
         found = os.listdir(cmd.build_lib)
         self.assertEqual(sorted(found), ['__pycache__', 'boiledeggs.py'])
         found = os.listdir(os.path.join(cmd.build_lib, '__pycache__'))
-        self.assertEqual(found, ['boiledeggs.%s.pyc' % imp.get_tag()])
+        self.assertEqual(found,
+                         ['boiledeggs.%s.pyc' % sys.implementation.cache_tag])
 
     @unittest.skipIf(sys.dont_write_bytecode, 'byte-compile disabled')
     def test_byte_compile_optimized(self):
@@ -119,7 +120,8 @@
         found = os.listdir(cmd.build_lib)
         self.assertEqual(sorted(found), ['__pycache__', 'boiledeggs.py'])
         found = os.listdir(os.path.join(cmd.build_lib, '__pycache__'))
-        self.assertEqual(sorted(found), ['boiledeggs.%s.pyo' % imp.get_tag()])
+        self.assertEqual(sorted(found),
+                         ['boiledeggs.%s.pyo' % sys.implementation.cache_tag])
 
     def test_dir_in_package_data(self):
         """
diff --git a/Lib/distutils/tests/test_check.py b/Lib/distutils/tests/test_check.py
index 601b686..959fa90 100644
--- a/Lib/distutils/tests/test_check.py
+++ b/Lib/distutils/tests/test_check.py
@@ -1,4 +1,5 @@
 """Tests for distutils.command.check."""
+import textwrap
 import unittest
 from test.support import run_unittest
 
@@ -92,6 +93,36 @@
         cmd = self._run(metadata, strict=1, restructuredtext=1)
         self.assertEqual(cmd._warnings, 0)
 
+    @unittest.skipUnless(HAS_DOCUTILS, "won't test without docutils")
+    def test_check_restructuredtext_with_syntax_highlight(self):
+        # Don't fail if there is a `code` or `code-block` directive
+
+        example_rst_docs = []
+        example_rst_docs.append(textwrap.dedent("""\
+            Here's some code:
+
+            .. code:: python
+
+                def foo():
+                    pass
+            """))
+        example_rst_docs.append(textwrap.dedent("""\
+            Here's some code:
+
+            .. code-block:: python
+
+                def foo():
+                    pass
+            """))
+
+        for rest_with_code in example_rst_docs:
+            pkg_info, dist = self.create_dist(long_description=rest_with_code)
+            cmd = check(dist)
+            cmd.check_restructuredtext()
+            self.assertEqual(cmd._warnings, 0)
+            msgs = cmd._check_rst_data(rest_with_code)
+            self.assertEqual(len(msgs), 0)
+
     def test_check_all(self):
 
         metadata = {'url': 'xxx', 'author': 'xxx'}
diff --git a/Lib/distutils/tests/test_dir_util.py b/Lib/distutils/tests/test_dir_util.py
index 1589f12..d436cf8 100644
--- a/Lib/distutils/tests/test_dir_util.py
+++ b/Lib/distutils/tests/test_dir_util.py
@@ -2,9 +2,10 @@
 import unittest
 import os
 import stat
-import shutil
 import sys
+from unittest.mock import patch
 
+from distutils import dir_util, errors
 from distutils.dir_util import (mkpath, remove_tree, create_tree, copy_tree,
                                 ensure_relative)
 
@@ -12,6 +13,7 @@
 from distutils.tests import support
 from test.support import run_unittest
 
+
 class DirUtilTestCase(support.TempdirManager, unittest.TestCase):
 
     def _log(self, msg, *args):
@@ -52,7 +54,7 @@
         self.assertEqual(self._logs, wanted)
 
     @unittest.skipIf(sys.platform.startswith('win'),
-                        "This test is only appropriate for POSIX-like systems.")
+        "This test is only appropriate for POSIX-like systems.")
     def test_mkpath_with_custom_mode(self):
         # Get and set the current umask value for testing mode bits.
         umask = os.umask(0o002)
@@ -120,6 +122,16 @@
             self.assertEqual(ensure_relative('c:\\home\\foo'), 'c:home\\foo')
             self.assertEqual(ensure_relative('home\\foo'), 'home\\foo')
 
+    def test_copy_tree_exception_in_listdir(self):
+        """
+        An exception in listdir should raise a DistutilsFileError
+        """
+        with patch("os.listdir", side_effect=OSError()), \
+             self.assertRaises(errors.DistutilsFileError):
+            src = self.tempdirs[-1]
+            dir_util.copy_tree(src, None)
+
+
 def test_suite():
     return unittest.makeSuite(DirUtilTestCase)
 
diff --git a/Lib/distutils/tests/test_dist.py b/Lib/distutils/tests/test_dist.py
index 61ac57d..b7fd3fb 100644
--- a/Lib/distutils/tests/test_dist.py
+++ b/Lib/distutils/tests/test_dist.py
@@ -39,6 +39,7 @@
 
 
 class DistributionTestCase(support.LoggingSilencer,
+                           support.TempdirManager,
                            support.EnvironGuard,
                            unittest.TestCase):
 
@@ -213,6 +214,34 @@
         self.assertRaises(ValueError, dist.announce, args, kwargs)
 
 
+    def test_find_config_files_disable(self):
+        # Ticket #1180: Allow user to disable their home config file.
+        temp_home = self.mkdtemp()
+        if os.name == 'posix':
+            user_filename = os.path.join(temp_home, ".pydistutils.cfg")
+        else:
+            user_filename = os.path.join(temp_home, "pydistutils.cfg")
+
+        with open(user_filename, 'w') as f:
+            f.write('[distutils]\n')
+
+        def _expander(path):
+            return temp_home
+
+        old_expander = os.path.expanduser
+        os.path.expanduser = _expander
+        try:
+            d = Distribution()
+            all_files = d.find_config_files()
+
+            d = Distribution(attrs={'script_args': ['--no-user-cfg']})
+            files = d.find_config_files()
+        finally:
+            os.path.expanduser = old_expander
+
+        # make sure --no-user-cfg disables the user cfg file
+        self.assertEqual(len(all_files)-1, len(files))
+
 class MetadataTestCase(support.TempdirManager, support.EnvironGuard,
                        unittest.TestCase):
 
diff --git a/Lib/distutils/tests/test_file_util.py b/Lib/distutils/tests/test_file_util.py
index 3c3e3dc..a6d04f0 100644
--- a/Lib/distutils/tests/test_file_util.py
+++ b/Lib/distutils/tests/test_file_util.py
@@ -2,10 +2,13 @@
 import unittest
 import os
 import shutil
+import errno
+from unittest.mock import patch
 
-from distutils.file_util import move_file
+from distutils.file_util import move_file, copy_file
 from distutils import log
 from distutils.tests import support
+from distutils.errors import DistutilsFileError
 from test.support import run_unittest
 
 class FileUtilTestCase(support.TempdirManager, unittest.TestCase):
@@ -58,6 +61,52 @@
         wanted = ['moving %s -> %s' % (self.source, self.target_dir)]
         self.assertEqual(self._logs, wanted)
 
+    def test_move_file_exception_unpacking_rename(self):
+        # see issue 22182
+        with patch("os.rename", side_effect=OSError("wrong", 1)), \
+             self.assertRaises(DistutilsFileError):
+            with open(self.source, 'w') as fobj:
+                fobj.write('spam eggs')
+            move_file(self.source, self.target, verbose=0)
+
+    def test_move_file_exception_unpacking_unlink(self):
+        # see issue 22182
+        with patch("os.rename", side_effect=OSError(errno.EXDEV, "wrong")), \
+             patch("os.unlink", side_effect=OSError("wrong", 1)), \
+             self.assertRaises(DistutilsFileError):
+            with open(self.source, 'w') as fobj:
+                fobj.write('spam eggs')
+            move_file(self.source, self.target, verbose=0)
+
+    def test_copy_file_hard_link(self):
+        with open(self.source, 'w') as f:
+            f.write('some content')
+        st = os.stat(self.source)
+        copy_file(self.source, self.target, link='hard')
+        st2 = os.stat(self.source)
+        st3 = os.stat(self.target)
+        self.assertTrue(os.path.samestat(st, st2), (st, st2))
+        self.assertTrue(os.path.samestat(st2, st3), (st2, st3))
+        with open(self.source, 'r') as f:
+            self.assertEqual(f.read(), 'some content')
+
+    def test_copy_file_hard_link_failure(self):
+        # If hard linking fails, copy_file() falls back on copying file
+        # (some special filesystems don't support hard linking even under
+        #  Unix, see issue #8876).
+        with open(self.source, 'w') as f:
+            f.write('some content')
+        st = os.stat(self.source)
+        with patch("os.link", side_effect=OSError(0, "linking unsupported")):
+            copy_file(self.source, self.target, link='hard')
+        st2 = os.stat(self.source)
+        st3 = os.stat(self.target)
+        self.assertTrue(os.path.samestat(st, st2), (st, st2))
+        self.assertFalse(os.path.samestat(st2, st3), (st2, st3))
+        for fn in (self.source, self.target):
+            with open(fn, 'r') as f:
+                self.assertEqual(f.read(), 'some content')
+
 
 def test_suite():
     return unittest.makeSuite(FileUtilTestCase)
diff --git a/Lib/distutils/tests/test_install.py b/Lib/distutils/tests/test_install.py
index ede88e5..18e1e57 100644
--- a/Lib/distutils/tests/test_install.py
+++ b/Lib/distutils/tests/test_install.py
@@ -1,7 +1,6 @@
 """Tests for distutils.command.install."""
 
 import os
-import imp
 import sys
 import unittest
 import site
@@ -94,7 +93,7 @@
 
         self.addCleanup(cleanup)
 
-        for key in ('nt_user', 'unix_user', 'os2_home'):
+        for key in ('nt_user', 'unix_user'):
             self.assertIn(key, INSTALL_SCHEMES)
 
         dist = Distribution({'name': 'xx'})
@@ -193,7 +192,8 @@
             f.close()
 
         found = [os.path.basename(line) for line in content.splitlines()]
-        expected = ['hello.py', 'hello.%s.pyc' % imp.get_tag(), 'sayhi',
+        expected = ['hello.py', 'hello.%s.pyc' % sys.implementation.cache_tag,
+                    'sayhi',
                     'UNKNOWN-0.0.0-py%s.%s.egg-info' % sys.version_info[:2]]
         self.assertEqual(found, expected)
 
diff --git a/Lib/distutils/tests/test_install_lib.py b/Lib/distutils/tests/test_install_lib.py
index d0dfca0..40dd1a9 100644
--- a/Lib/distutils/tests/test_install_lib.py
+++ b/Lib/distutils/tests/test_install_lib.py
@@ -1,7 +1,7 @@
 """Tests for distutils.command.install_data."""
 import sys
 import os
-import imp
+import importlib.util
 import unittest
 
 from distutils.command.install_lib import install_lib
@@ -44,8 +44,10 @@
         f = os.path.join(project_dir, 'foo.py')
         self.write_file(f, '# python file')
         cmd.byte_compile([f])
-        pyc_file = imp.cache_from_source('foo.py', debug_override=True)
-        pyo_file = imp.cache_from_source('foo.py', debug_override=False)
+        pyc_file = importlib.util.cache_from_source('foo.py',
+                                                    debug_override=True)
+        pyo_file = importlib.util.cache_from_source('foo.py',
+                                                    debug_override=False)
         self.assertTrue(os.path.exists(pyc_file))
         self.assertTrue(os.path.exists(pyo_file))
 
diff --git a/Lib/distutils/tests/test_sdist.py b/Lib/distutils/tests/test_sdist.py
index c952406..5a04e0d 100644
--- a/Lib/distutils/tests/test_sdist.py
+++ b/Lib/distutils/tests/test_sdist.py
@@ -14,6 +14,12 @@
 except ImportError:
     ZLIB_SUPPORT = False
 
+try:
+    import grp
+    import pwd
+    UID_GID_SUPPORT = True
+except ImportError:
+    UID_GID_SUPPORT = False
 
 from distutils.command.sdist import sdist, show_formats
 from distutils.core import Distribution
@@ -423,6 +429,54 @@
         self.assertEqual(sorted(filenames), ['fake-1.0', 'fake-1.0/PKG-INFO',
                                              'fake-1.0/README.manual'])
 
+    @unittest.skipUnless(ZLIB_SUPPORT, "requires zlib")
+    @unittest.skipUnless(UID_GID_SUPPORT, "Requires grp and pwd support")
+    @unittest.skipIf(find_executable('tar') is None,
+                     "The tar command is not found")
+    @unittest.skipIf(find_executable('gzip') is None,
+                     "The gzip command is not found")
+    def test_make_distribution_owner_group(self):
+        # now building a sdist
+        dist, cmd = self.get_cmd()
+
+        # creating a gztar and specifying the owner+group
+        cmd.formats = ['gztar']
+        cmd.owner = pwd.getpwuid(0)[0]
+        cmd.group = grp.getgrgid(0)[0]
+        cmd.ensure_finalized()
+        cmd.run()
+
+        # making sure we have the good rights
+        archive_name = join(self.tmp_dir, 'dist', 'fake-1.0.tar.gz')
+        archive = tarfile.open(archive_name)
+        try:
+            for member in archive.getmembers():
+                self.assertEqual(member.uid, 0)
+                self.assertEqual(member.gid, 0)
+        finally:
+            archive.close()
+
+        # building a sdist again
+        dist, cmd = self.get_cmd()
+
+        # creating a gztar
+        cmd.formats = ['gztar']
+        cmd.ensure_finalized()
+        cmd.run()
+
+        # making sure we have the good rights
+        archive_name = join(self.tmp_dir, 'dist', 'fake-1.0.tar.gz')
+        archive = tarfile.open(archive_name)
+
+        # note that we are not testing the group ownership here
+        # because, depending on the platforms and the container
+        # rights (see #7408)
+        try:
+            for member in archive.getmembers():
+                self.assertEqual(member.uid, os.getuid())
+        finally:
+            archive.close()
+
 def test_suite():
     return unittest.makeSuite(SDistTestCase)
 
diff --git a/Lib/distutils/tests/test_sysconfig.py b/Lib/distutils/tests/test_sysconfig.py
index a1cb47d..fc4d1de 100644
--- a/Lib/distutils/tests/test_sysconfig.py
+++ b/Lib/distutils/tests/test_sysconfig.py
@@ -1,16 +1,17 @@
 """Tests for distutils.sysconfig."""
 import os
 import shutil
-import test
+import subprocess
+import sys
+import textwrap
 import unittest
 
 from distutils import sysconfig
 from distutils.ccompiler import get_default_compiler
 from distutils.tests import support
-from test.support import TESTFN, run_unittest
+from test.support import TESTFN, run_unittest, check_warnings
 
-class SysconfigTestCase(support.EnvironGuard,
-                        unittest.TestCase):
+class SysconfigTestCase(support.EnvironGuard, unittest.TestCase):
     def setUp(self):
         super(SysconfigTestCase, self).setUp()
         self.makefile = None
@@ -32,7 +33,6 @@
         self.assertTrue(os.path.isfile(config_h), config_h)
 
     def test_get_python_lib(self):
-        lib_dir = sysconfig.get_python_lib()
         # XXX doesn't work on Linux when Python was never installed before
         #self.assertTrue(os.path.isdir(lib_dir), lib_dir)
         # test for pythonxx.lib?
@@ -67,8 +67,9 @@
             self.assertTrue(os.path.exists(Python_h), Python_h)
             self.assertTrue(sysconfig._is_python_source_dir(srcdir))
         elif os.name == 'posix':
-            self.assertEqual(os.path.dirname(sysconfig.get_makefile_filename()),
-                                 srcdir)
+            self.assertEqual(
+                os.path.dirname(sysconfig.get_makefile_filename()),
+                srcdir)
 
     def test_srcdir_independent_of_cwd(self):
         # srcdir should be independent of the current working directory
@@ -126,10 +127,13 @@
 
     def test_sysconfig_module(self):
         import sysconfig as global_sysconfig
-        self.assertEqual(global_sysconfig.get_config_var('CFLAGS'), sysconfig.get_config_var('CFLAGS'))
-        self.assertEqual(global_sysconfig.get_config_var('LDFLAGS'), sysconfig.get_config_var('LDFLAGS'))
+        self.assertEqual(global_sysconfig.get_config_var('CFLAGS'),
+                         sysconfig.get_config_var('CFLAGS'))
+        self.assertEqual(global_sysconfig.get_config_var('LDFLAGS'),
+                         sysconfig.get_config_var('LDFLAGS'))
 
-    @unittest.skipIf(sysconfig.get_config_var('CUSTOMIZED_OSX_COMPILER'),'compiler flags customized')
+    @unittest.skipIf(sysconfig.get_config_var('CUSTOMIZED_OSX_COMPILER'),
+                     'compiler flags customized')
     def test_sysconfig_compiler_vars(self):
         # On OS X, binary installers support extension module building on
         # various levels of the operating system with differing Xcode
@@ -148,9 +152,49 @@
         import sysconfig as global_sysconfig
         if sysconfig.get_config_var('CUSTOMIZED_OSX_COMPILER'):
             self.skipTest('compiler flags customized')
-        self.assertEqual(global_sysconfig.get_config_var('LDSHARED'), sysconfig.get_config_var('LDSHARED'))
-        self.assertEqual(global_sysconfig.get_config_var('CC'), sysconfig.get_config_var('CC'))
+        self.assertEqual(global_sysconfig.get_config_var('LDSHARED'),
+                         sysconfig.get_config_var('LDSHARED'))
+        self.assertEqual(global_sysconfig.get_config_var('CC'),
+                         sysconfig.get_config_var('CC'))
 
+    @unittest.skipIf(sysconfig.get_config_var('EXT_SUFFIX') is None,
+                     'EXT_SUFFIX required for this test')
+    def test_SO_deprecation(self):
+        self.assertWarns(DeprecationWarning,
+                         sysconfig.get_config_var, 'SO')
+
+    @unittest.skipIf(sysconfig.get_config_var('EXT_SUFFIX') is None,
+                     'EXT_SUFFIX required for this test')
+    def test_SO_value(self):
+        with check_warnings(('', DeprecationWarning)):
+            self.assertEqual(sysconfig.get_config_var('SO'),
+                             sysconfig.get_config_var('EXT_SUFFIX'))
+
+    @unittest.skipIf(sysconfig.get_config_var('EXT_SUFFIX') is None,
+                     'EXT_SUFFIX required for this test')
+    def test_SO_in_vars(self):
+        vars = sysconfig.get_config_vars()
+        self.assertIsNotNone(vars['SO'])
+        self.assertEqual(vars['SO'], vars['EXT_SUFFIX'])
+
+    def test_customize_compiler_before_get_config_vars(self):
+        # Issue #21923: test that a Distribution compiler
+        # instance can be called without an explicit call to
+        # get_config_vars().
+        with open(TESTFN, 'w') as f:
+            f.writelines(textwrap.dedent('''\
+                from distutils.core import Distribution
+                config = Distribution().get_command_obj('config')
+                # try_compile may pass or it may fail if no compiler
+                # is found but it should not raise an exception.
+                rc = config.try_compile('int x;')
+                '''))
+        p = subprocess.Popen([str(sys.executable), TESTFN],
+                stdout=subprocess.PIPE,
+                stderr=subprocess.STDOUT,
+                universal_newlines=True)
+        outs, errs = p.communicate()
+        self.assertEqual(0, p.returncode, "Subprocess failed: " + outs)
 
 
 def test_suite():
diff --git a/Lib/distutils/tests/test_upload.py b/Lib/distutils/tests/test_upload.py
index 8532369..dccaf77 100644
--- a/Lib/distutils/tests/test_upload.py
+++ b/Lib/distutils/tests/test_upload.py
@@ -6,6 +6,7 @@
 from distutils.command import upload as upload_mod
 from distutils.command.upload import upload
 from distutils.core import Distribution
+from distutils.errors import DistutilsError
 from distutils.log import INFO
 
 from distutils.tests.test_config import PYPIRC, PyPIRCCommandTestCase
@@ -41,13 +42,14 @@
 
 class FakeOpen(object):
 
-    def __init__(self, url):
+    def __init__(self, url, msg=None, code=None):
         self.url = url
         if not isinstance(url, str):
             self.req = url
         else:
             self.req = None
-        self.msg = 'OK'
+        self.msg = msg or 'OK'
+        self.code = code or 200
 
     def getheader(self, name, default=None):
         return {
@@ -58,7 +60,7 @@
         return b'xyzzy'
 
     def getcode(self):
-        return 200
+        return self.code
 
 
 class uploadTestCase(PyPIRCCommandTestCase):
@@ -68,13 +70,15 @@
         self.old_open = upload_mod.urlopen
         upload_mod.urlopen = self._urlopen
         self.last_open = None
+        self.next_msg = None
+        self.next_code = None
 
     def tearDown(self):
         upload_mod.urlopen = self.old_open
         super(uploadTestCase, self).tearDown()
 
     def _urlopen(self, url):
-        self.last_open = FakeOpen(url)
+        self.last_open = FakeOpen(url, msg=self.next_msg, code=self.next_code)
         return self.last_open
 
     def test_finalize_options(self):
@@ -123,17 +127,22 @@
 
         # what did we send ?
         headers = dict(self.last_open.req.headers)
-        self.assertEqual(headers['Content-length'], '2087')
-        self.assertTrue(headers['Content-type'].startswith('multipart/form-data'))
+        self.assertEqual(headers['Content-length'], '2161')
+        content_type = headers['Content-type']
+        self.assertTrue(content_type.startswith('multipart/form-data'))
         self.assertEqual(self.last_open.req.get_method(), 'POST')
-        self.assertEqual(self.last_open.req.get_full_url(),
-                         'https://pypi.python.org/pypi')
-        self.assertIn(b'xxx', self.last_open.req.data)
+        expected_url = 'https://pypi.python.org/pypi'
+        self.assertEqual(self.last_open.req.get_full_url(), expected_url)
+        self.assertTrue(b'xxx' in self.last_open.req.data)
 
         # The PyPI response body was echoed
         results = self.get_logs(INFO)
         self.assertIn('xyzzy\n', results[-1])
 
+    def test_upload_fails(self):
+        self.next_msg = "Not Found"
+        self.next_code = 404
+        self.assertRaises(DistutilsError, self.test_upload)
 
 def test_suite():
     return unittest.makeSuite(uploadTestCase)
diff --git a/Lib/distutils/tests/test_util.py b/Lib/distutils/tests/test_util.py
index a1abf8f..4e9d79b 100644
--- a/Lib/distutils/tests/test_util.py
+++ b/Lib/distutils/tests/test_util.py
@@ -237,7 +237,7 @@
         self.assertRaises(DistutilsPlatformError,
                           change_root, 'c:\\root', 'its\\here')
 
-        # XXX platforms to be covered: os2, mac
+        # XXX platforms to be covered: mac
 
     def test_check_environ(self):
         util._environ_checked = 0
diff --git a/Lib/distutils/util.py b/Lib/distutils/util.py
index b558957..5adcac5 100644
--- a/Lib/distutils/util.py
+++ b/Lib/distutils/util.py
@@ -6,7 +6,7 @@
 
 import os
 import re
-import imp
+import importlib.util
 import sys
 import string
 from distutils.errors import DistutilsPlatformError
@@ -154,12 +154,6 @@
             path = path[1:]
         return os.path.join(new_root, path)
 
-    elif os.name == 'os2':
-        (drive, path) = os.path.splitdrive(pathname)
-        if path[0] == os.sep:
-            path = path[1:]
-        return os.path.join(new_root, path)
-
     else:
         raise DistutilsPlatformError("nothing known about platform '%s'" % os.name)
 
@@ -444,9 +438,10 @@
             #   cfile - byte-compiled file
             #   dfile - purported source filename (same as 'file' by default)
             if optimize >= 0:
-                cfile = imp.cache_from_source(file, debug_override=not optimize)
+                cfile = importlib.util.cache_from_source(
+                    file, debug_override=not optimize)
             else:
-                cfile = imp.cache_from_source(file)
+                cfile = importlib.util.cache_from_source(file)
             dfile = file
             if prefix:
                 if file[:len(prefix)] != prefix:
diff --git a/Lib/doctest.py b/Lib/doctest.py
index 3f0d9d9..64e6d71 100644
--- a/Lib/doctest.py
+++ b/Lib/doctest.py
@@ -62,6 +62,7 @@
     'REPORT_NDIFF',
     'REPORT_ONLY_FIRST_FAILURE',
     'REPORTING_FLAGS',
+    'FAIL_FAST',
     # 1. Utility Functions
     # 2. Example & DocTest
     'Example',
@@ -92,6 +93,7 @@
 ]
 
 import __future__
+import argparse
 import difflib
 import inspect
 import linecache
@@ -150,11 +152,13 @@
 REPORT_CDIFF = register_optionflag('REPORT_CDIFF')
 REPORT_NDIFF = register_optionflag('REPORT_NDIFF')
 REPORT_ONLY_FIRST_FAILURE = register_optionflag('REPORT_ONLY_FIRST_FAILURE')
+FAIL_FAST = register_optionflag('FAIL_FAST')
 
 REPORTING_FLAGS = (REPORT_UDIFF |
                    REPORT_CDIFF |
                    REPORT_NDIFF |
-                   REPORT_ONLY_FIRST_FAILURE)
+                   REPORT_ONLY_FIRST_FAILURE |
+                   FAIL_FAST)
 
 # Special string markers for use in `want` strings:
 BLANKLINE_MARKER = '<BLANKLINE>'
@@ -212,7 +216,7 @@
     if module_relative:
         package = _normalize_module(package, 3)
         filename = _module_relative_path(package, filename)
-        if hasattr(package, '__loader__'):
+        if getattr(package, '__loader__', None) is not None:
             if hasattr(package.__loader__, 'get_data'):
                 file_contents = package.__loader__.get_data(filename)
                 file_contents = file_contents.decode(encoding)
@@ -477,9 +481,6 @@
                self.options == other.options and \
                self.exc_msg == other.exc_msg
 
-    def __ne__(self, other):
-        return not self == other
-
     def __hash__(self):
         return hash((self.source, self.want, self.lineno, self.indent,
                      self.exc_msg))
@@ -543,9 +544,6 @@
                self.filename == other.filename and \
                self.lineno == other.lineno
 
-    def __ne__(self, other):
-        return not self == other
-
     def __hash__(self):
         return hash((self.docstring, self.name, self.filename, self.lineno))
 
@@ -940,6 +938,14 @@
             return module is inspect.getmodule(object)
         elif inspect.isfunction(object):
             return module.__dict__ is object.__globals__
+        elif inspect.ismethoddescriptor(object):
+            if hasattr(object, '__objclass__'):
+                obj_mod = object.__objclass__.__module__
+            elif hasattr(object, '__module__'):
+                obj_mod = object.__module__
+            else:
+                return True # [XX] no easy way to tell otherwise
+            return module.__name__ == obj_mod
         elif inspect.isclass(object):
             return module.__name__ == object.__module__
         elif hasattr(object, '__module__'):
@@ -972,7 +978,7 @@
             for valname, val in obj.__dict__.items():
                 valname = '%s.%s' % (name, valname)
                 # Recurse to functions & classes.
-                if ((inspect.isfunction(val) or inspect.isclass(val)) and
+                if ((inspect.isroutine(val) or inspect.isclass(val)) and
                     self._from_module(module, val)):
                     self._find(tests, val, valname, module, source_lines,
                                globs, seen)
@@ -984,9 +990,8 @@
                     raise ValueError("DocTestFinder.find: __test__ keys "
                                      "must be strings: %r" %
                                      (type(valname),))
-                if not (inspect.isfunction(val) or inspect.isclass(val) or
-                        inspect.ismethod(val) or inspect.ismodule(val) or
-                        isinstance(val, str)):
+                if not (inspect.isroutine(val) or inspect.isclass(val) or
+                        inspect.ismodule(val) or isinstance(val, str)):
                     raise ValueError("DocTestFinder.find: __test__ values "
                                      "must be strings, functions, methods, "
                                      "classes, or modules: %r" %
@@ -1005,7 +1010,7 @@
                     val = getattr(obj, valname).__func__
 
                 # Recurse to methods, properties, and nested classes.
-                if ((inspect.isfunction(val) or inspect.isclass(val) or
+                if ((inspect.isroutine(val) or inspect.isclass(val) or
                       isinstance(val, property)) and
                       self._from_module(module, val)):
                     valname = '%s.%s' % (name, valname)
@@ -1367,6 +1372,9 @@
             else:
                 assert False, ("unknown outcome", outcome)
 
+            if failures and self.optionflags & FAIL_FAST:
+                break
+
         # Restore the option flags (in case they were modified)
         self.optionflags = original_optionflags
 
@@ -2275,9 +2283,6 @@
                self._dt_tearDown == other._dt_tearDown and \
                self._dt_checker == other._dt_checker
 
-    def __ne__(self, other):
-        return not self == other
-
     def __hash__(self):
         return hash((self._dt_optionflags, self._dt_setUp, self._dt_tearDown,
                      self._dt_checker))
@@ -2308,6 +2313,12 @@
     __str__ = shortDescription
 
 
+class _DocTestSuite(unittest.TestSuite):
+
+    def _removeTestAtIndex(self, index):
+        pass
+
+
 def DocTestSuite(module=None, globs=None, extraglobs=None, test_finder=None,
                  **options):
     """
@@ -2353,7 +2364,7 @@
 
     if not tests and sys.flags.optimize >=2:
         # Skip doctests when running with -O2
-        suite = unittest.TestSuite()
+        suite = _DocTestSuite()
         suite.addTest(SkipDocTestCase(module))
         return suite
     elif not tests:
@@ -2367,7 +2378,7 @@
         raise ValueError(module, "has no docstrings")
 
     tests.sort()
-    suite = unittest.TestSuite()
+    suite = _DocTestSuite()
 
     for test in tests:
         if len(test.examples) == 0:
@@ -2477,7 +2488,7 @@
     encoding
       An encoding that will be used to convert the files to unicode.
     """
-    suite = unittest.TestSuite()
+    suite = _DocTestSuite()
 
     # We do this here so that _normalize_module is called at the right
     # level.  If it were called in DocFileTest, then this function
@@ -2727,13 +2738,30 @@
 
 
 def _test():
-    testfiles = [arg for arg in sys.argv[1:] if arg and arg[0] != '-']
-    if not testfiles:
-        name = os.path.basename(sys.argv[0])
-        if '__loader__' in globals():          # python -m
-            name, _ = os.path.splitext(name)
-        print("usage: {0} [-v] file ...".format(name))
-        return 2
+    parser = argparse.ArgumentParser(description="doctest runner")
+    parser.add_argument('-v', '--verbose', action='store_true', default=False,
+                        help='print very verbose output for all tests')
+    parser.add_argument('-o', '--option', action='append',
+                        choices=OPTIONFLAGS_BY_NAME.keys(), default=[],
+                        help=('specify a doctest option flag to apply'
+                              ' to the test run; may be specified more'
+                              ' than once to apply multiple options'))
+    parser.add_argument('-f', '--fail-fast', action='store_true',
+                        help=('stop running tests after first failure (this'
+                              ' is a shorthand for -o FAIL_FAST, and is'
+                              ' in addition to any other -o options)'))
+    parser.add_argument('file', nargs='+',
+                        help='file containing the tests to run')
+    args = parser.parse_args()
+    testfiles = args.file
+    # Verbose used to be handled by the "inspect argv" magic in DocTestRunner,
+    # but since we are using argparse we are passing it manually now.
+    verbose = args.verbose
+    options = 0
+    for option in args.option:
+        options |= OPTIONFLAGS_BY_NAME[option]
+    if args.fail_fast:
+        options |= FAIL_FAST
     for filename in testfiles:
         if filename.endswith(".py"):
             # It is a module -- insert its dir into sys.path and try to
@@ -2743,9 +2771,10 @@
             sys.path.insert(0, dirname)
             m = __import__(filename[:-3])
             del sys.path[0]
-            failures, _ = testmod(m)
+            failures, _ = testmod(m, verbose=verbose, optionflags=options)
         else:
-            failures, _ = testfile(filename, module_relative=False)
+            failures, _ = testfile(filename, module_relative=False,
+                                     verbose=verbose, optionflags=options)
         if failures:
             return 1
     return 0
diff --git a/Lib/email/_header_value_parser.py b/Lib/email/_header_value_parser.py
index 0369e01..1806cac 100644
--- a/Lib/email/_header_value_parser.py
+++ b/Lib/email/_header_value_parser.py
@@ -70,7 +70,7 @@
 import re
 import urllib   # For urllib.parse.unquote
 from string import hexdigits
-from collections import namedtuple, OrderedDict
+from collections import OrderedDict
 from email import _encoded_words as _ew
 from email import errors
 from email import utils
@@ -368,8 +368,7 @@
                 yield (indent + '    !! invalid element in token '
                                         'list: {!r}'.format(token))
             else:
-                for line in token._pp(indent+'    '):
-                    yield line
+                yield from token._pp(indent+'    ')
         if self.defects:
             extra = ' Defects: {}'.format(self.defects)
         else:
@@ -1315,24 +1314,22 @@
 # Parser
 #
 
-"""Parse strings according to RFC822/2047/2822/5322 rules.
-
-This is a stateless parser.  Each get_XXX function accepts a string and
-returns either a Terminal or a TokenList representing the RFC object named
-by the method and a string containing the remaining unparsed characters
-from the input.  Thus a parser method consumes the next syntactic construct
-of a given type and returns a token representing the construct plus the
-unparsed remainder of the input string.
-
-For example, if the first element of a structured header is a 'phrase',
-then:
-
-    phrase, value = get_phrase(value)
-
-returns the complete phrase from the start of the string value, plus any
-characters left in the string after the phrase is removed.
-
-"""
+# Parse strings according to RFC822/2047/2822/5322 rules.
+#
+# This is a stateless parser.  Each get_XXX function accepts a string and
+# returns either a Terminal or a TokenList representing the RFC object named
+# by the method and a string containing the remaining unparsed characters
+# from the input.  Thus a parser method consumes the next syntactic construct
+# of a given type and returns a token representing the construct plus the
+# unparsed remainder of the input string.
+#
+# For example, if the first element of a structured header is a 'phrase',
+# then:
+#
+#     phrase, value = get_phrase(value)
+#
+# returns the complete phrase from the start of the string value, plus any
+# characters left in the string after the phrase is removed.
 
 _wsp_splitter = re.compile(r'([{}]+)'.format(''.join(WSP))).split
 _non_atom_end_matcher = re.compile(r"[^{}]+".format(
@@ -2900,7 +2897,7 @@
     try:
         token, value = get_token(value)
     except errors.HeaderParseError:
-        ctype.defects.append(errors.InvalidHeaderDefect(
+        disp_header.defects.append(errors.InvalidHeaderDefect(
             "Expected content disposition but found {!r}".format(value)))
         _find_mime_parameters(disp_header, value)
         return disp_header
@@ -2931,8 +2928,8 @@
     try:
         token, value = get_token(value)
     except errors.HeaderParseError:
-        ctype.defects.append(errors.InvalidHeaderDefect(
-            "Expected content trnasfer encoding but found {!r}".format(value)))
+        cte_header.defects.append(errors.InvalidHeaderDefect(
+            "Expected content transfer encoding but found {!r}".format(value)))
     else:
         cte_header.append(token)
         cte_header.cte = token.value.strip().lower()
diff --git a/Lib/email/contentmanager.py b/Lib/email/contentmanager.py
new file mode 100644
index 0000000..d363652
--- /dev/null
+++ b/Lib/email/contentmanager.py
@@ -0,0 +1,249 @@
+import binascii
+import email.charset
+import email.message
+import email.errors
+from email import quoprimime
+
+class ContentManager:
+
+    def __init__(self):
+        self.get_handlers = {}
+        self.set_handlers = {}
+
+    def add_get_handler(self, key, handler):
+        self.get_handlers[key] = handler
+
+    def get_content(self, msg, *args, **kw):
+        content_type = msg.get_content_type()
+        if content_type in self.get_handlers:
+            return self.get_handlers[content_type](msg, *args, **kw)
+        maintype = msg.get_content_maintype()
+        if maintype in self.get_handlers:
+            return self.get_handlers[maintype](msg, *args, **kw)
+        if '' in self.get_handlers:
+            return self.get_handlers[''](msg, *args, **kw)
+        raise KeyError(content_type)
+
+    def add_set_handler(self, typekey, handler):
+        self.set_handlers[typekey] = handler
+
+    def set_content(self, msg, obj, *args, **kw):
+        if msg.get_content_maintype() == 'multipart':
+            # XXX: is this error a good idea or not?  We can remove it later,
+            # but we can't add it later, so do it for now.
+            raise TypeError("set_content not valid on multipart")
+        handler = self._find_set_handler(msg, obj)
+        msg.clear_content()
+        handler(msg, obj, *args, **kw)
+
+    def _find_set_handler(self, msg, obj):
+        full_path_for_error = None
+        for typ in type(obj).__mro__:
+            if typ in self.set_handlers:
+                return self.set_handlers[typ]
+            qname = typ.__qualname__
+            modname = getattr(typ, '__module__', '')
+            full_path = '.'.join((modname, qname)) if modname else qname
+            if full_path_for_error is None:
+                full_path_for_error = full_path
+            if full_path in self.set_handlers:
+                return self.set_handlers[full_path]
+            if qname in self.set_handlers:
+                return self.set_handlers[qname]
+            name = typ.__name__
+            if name in self.set_handlers:
+                return self.set_handlers[name]
+        if None in self.set_handlers:
+            return self.set_handlers[None]
+        raise KeyError(full_path_for_error)
+
+
+raw_data_manager = ContentManager()
+
+
+def get_text_content(msg, errors='replace'):
+    content = msg.get_payload(decode=True)
+    charset = msg.get_param('charset', 'ASCII')
+    return content.decode(charset, errors=errors)
+raw_data_manager.add_get_handler('text', get_text_content)
+
+
+def get_non_text_content(msg):
+    return msg.get_payload(decode=True)
+for maintype in 'audio image video application'.split():
+    raw_data_manager.add_get_handler(maintype, get_non_text_content)
+
+
+def get_message_content(msg):
+    return msg.get_payload(0)
+for subtype in 'rfc822 external-body'.split():
+    raw_data_manager.add_get_handler('message/'+subtype, get_message_content)
+
+
+def get_and_fixup_unknown_message_content(msg):
+    # If we don't understand a message subtype, we are supposed to treat it as
+    # if it were application/octet-stream, per
+    # tools.ietf.org/html/rfc2046#section-5.2.4.  Feedparser doesn't do that,
+    # so do our best to fix things up.  Note that it is *not* appropriate to
+    # model message/partial content as Message objects, so they are handled
+    # here as well.  (How to reassemble them is out of scope for this comment :)
+    return bytes(msg.get_payload(0))
+raw_data_manager.add_get_handler('message',
+                                 get_and_fixup_unknown_message_content)
+
+
+def _prepare_set(msg, maintype, subtype, headers):
+    msg['Content-Type'] = '/'.join((maintype, subtype))
+    if headers:
+        if not hasattr(headers[0], 'name'):
+            mp = msg.policy
+            headers = [mp.header_factory(*mp.header_source_parse([header]))
+                       for header in headers]
+        try:
+            for header in headers:
+                if header.defects:
+                    raise header.defects[0]
+                msg[header.name] = header
+        except email.errors.HeaderDefect as exc:
+            raise ValueError("Invalid header: {}".format(
+                                header.fold(policy=msg.policy))) from exc
+
+
+def _finalize_set(msg, disposition, filename, cid, params):
+    if disposition is None and filename is not None:
+        disposition = 'attachment'
+    if disposition is not None:
+        msg['Content-Disposition'] = disposition
+    if filename is not None:
+        msg.set_param('filename',
+                      filename,
+                      header='Content-Disposition',
+                      replace=True)
+    if cid is not None:
+        msg['Content-ID'] = cid
+    if params is not None:
+        for key, value in params.items():
+            msg.set_param(key, value)
+
+
+# XXX: This is a cleaned-up version of base64mime.body_encode.  It would
+# be nice to drop both this and quoprimime.body_encode in favor of
+# enhanced binascii routines that accepted a max_line_length parameter.
+def _encode_base64(data, max_line_length):
+    encoded_lines = []
+    unencoded_bytes_per_line = max_line_length * 3 // 4
+    for i in range(0, len(data), unencoded_bytes_per_line):
+        thisline = data[i:i+unencoded_bytes_per_line]
+        encoded_lines.append(binascii.b2a_base64(thisline).decode('ascii'))
+    return ''.join(encoded_lines)
+
+
+def _encode_text(string, charset, cte, policy):
+    lines = string.encode(charset).splitlines()
+    linesep = policy.linesep.encode('ascii')
+    def embeded_body(lines): return linesep.join(lines) + linesep
+    def normal_body(lines): return b'\n'.join(lines) + b'\n'
+    if cte==None:
+        # Use heuristics to decide on the "best" encoding.
+        try:
+            return '7bit', normal_body(lines).decode('ascii')
+        except UnicodeDecodeError:
+            pass
+        if (policy.cte_type == '8bit' and
+                max(len(x) for x in lines) <= policy.max_line_length):
+            return '8bit', normal_body(lines).decode('ascii', 'surrogateescape')
+        sniff = embeded_body(lines[:10])
+        sniff_qp = quoprimime.body_encode(sniff.decode('latin-1'),
+                                          policy.max_line_length)
+        sniff_base64 = binascii.b2a_base64(sniff)
+        # This is a little unfair to qp; it includes lineseps, base64 doesn't.
+        if len(sniff_qp) > len(sniff_base64):
+            cte = 'base64'
+        else:
+            cte = 'quoted-printable'
+            if len(lines) <= 10:
+                return cte, sniff_qp
+    if cte == '7bit':
+        data = normal_body(lines).decode('ascii')
+    elif cte == '8bit':
+        data = normal_body(lines).decode('ascii', 'surrogateescape')
+    elif cte == 'quoted-printable':
+        data = quoprimime.body_encode(normal_body(lines).decode('latin-1'),
+                                      policy.max_line_length)
+    elif cte == 'base64':
+        data = _encode_base64(embeded_body(lines), policy.max_line_length)
+    else:
+        raise ValueError("Unknown content transfer encoding {}".format(cte))
+    return cte, data
+
+
+def set_text_content(msg, string, subtype="plain", charset='utf-8', cte=None,
+                     disposition=None, filename=None, cid=None,
+                     params=None, headers=None):
+    _prepare_set(msg, 'text', subtype, headers)
+    cte, payload = _encode_text(string, charset, cte, msg.policy)
+    msg.set_payload(payload)
+    msg.set_param('charset',
+                  email.charset.ALIASES.get(charset, charset),
+                  replace=True)
+    msg['Content-Transfer-Encoding'] = cte
+    _finalize_set(msg, disposition, filename, cid, params)
+raw_data_manager.add_set_handler(str, set_text_content)
+
+
+def set_message_content(msg, message, subtype="rfc822", cte=None,
+                       disposition=None, filename=None, cid=None,
+                       params=None, headers=None):
+    if subtype == 'partial':
+        raise ValueError("message/partial is not supported for Message objects")
+    if subtype == 'rfc822':
+        if cte not in (None, '7bit', '8bit', 'binary'):
+            # http://tools.ietf.org/html/rfc2046#section-5.2.1 mandate.
+            raise ValueError(
+                "message/rfc822 parts do not support cte={}".format(cte))
+        # 8bit will get coerced on serialization if policy.cte_type='7bit'.  We
+        # may end up claiming 8bit when it isn't needed, but the only negative
+        # result of that should be a gateway that needs to coerce to 7bit
+        # having to look through the whole embedded message to discover whether
+        # or not it actually has to do anything.
+        cte = '8bit' if cte is None else cte
+    elif subtype == 'external-body':
+        if cte not in (None, '7bit'):
+            # http://tools.ietf.org/html/rfc2046#section-5.2.3 mandate.
+            raise ValueError(
+                "message/external-body parts do not support cte={}".format(cte))
+        cte = '7bit'
+    elif cte is None:
+        # http://tools.ietf.org/html/rfc2046#section-5.2.4 says all future
+        # subtypes should be restricted to 7bit, so assume that.
+        cte = '7bit'
+    _prepare_set(msg, 'message', subtype, headers)
+    msg.set_payload([message])
+    msg['Content-Transfer-Encoding'] = cte
+    _finalize_set(msg, disposition, filename, cid, params)
+raw_data_manager.add_set_handler(email.message.Message, set_message_content)
+
+
+def set_bytes_content(msg, data, maintype, subtype, cte='base64',
+                     disposition=None, filename=None, cid=None,
+                     params=None, headers=None):
+    _prepare_set(msg, maintype, subtype, headers)
+    if cte == 'base64':
+        data = _encode_base64(data, max_line_length=msg.policy.max_line_length)
+    elif cte == 'quoted-printable':
+        # XXX: quoprimime.body_encode won't encode newline characters in data,
+        # so we can't use it.  This means max_line_length is ignored.  Another
+        # bug to fix later.  (Note: encoders.quopri is broken on line ends.)
+        data = binascii.b2a_qp(data, istext=False, header=False, quotetabs=True)
+        data = data.decode('ascii')
+    elif cte == '7bit':
+        # Make sure it really is only ASCII.  The early warning here seems
+        # worth the overhead...if you care write your own content manager :).
+        data.encode('ascii')
+    elif cte in ('8bit', 'binary'):
+        data = data.decode('ascii', 'surrogateescape')
+    msg.set_payload(data)
+    msg['Content-Transfer-Encoding'] = cte
+    _finalize_set(msg, disposition, filename, cid, params)
+for typ in (bytes, bytearray, memoryview):
+    raw_data_manager.add_set_handler(typ, set_bytes_content)
diff --git a/Lib/email/encoders.py b/Lib/email/encoders.py
index f9657f0..0a66acb 100644
--- a/Lib/email/encoders.py
+++ b/Lib/email/encoders.py
@@ -54,21 +54,12 @@
         # There's no payload.  For backwards compatibility we use 7bit
         msg['Content-Transfer-Encoding'] = '7bit'
         return
-    # We play a trick to make this go fast.  If encoding/decode to ASCII
-    # succeeds, we know the data must be 7bit, otherwise treat it as 8bit.
+    # We play a trick to make this go fast.  If decoding from ASCII succeeds,
+    # we know the data must be 7bit, otherwise treat it as 8bit.
     try:
-        if isinstance(orig, str):
-            orig.encode('ascii')
-        else:
-            orig.decode('ascii')
+        orig.decode('ascii')
     except UnicodeError:
-        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'
+        msg['Content-Transfer-Encoding'] = '8bit'
     else:
         msg['Content-Transfer-Encoding'] = '7bit'
 
diff --git a/Lib/email/feedparser.py b/Lib/email/feedparser.py
index ea41e95..c95b27f 100644
--- a/Lib/email/feedparser.py
+++ b/Lib/email/feedparser.py
@@ -33,7 +33,7 @@
 NLCRE_crack = re.compile('(\r\n|\r|\n)')
 # RFC 2822 $3.6.8 Optional fields.  ftext is %d33-57 / %d59-126, Any character
 # except controls, SP, and ":".
-headerRE = re.compile(r'^(From |[\041-\071\073-\176]{1,}:|[\t ])')
+headerRE = re.compile(r'^(From |[\041-\071\073-\176]*:|[\t ])')
 EMPTYSTRING = ''
 NL = '\n'
 
@@ -50,8 +50,8 @@
     simple abstraction -- it parses until EOF closes the current message.
     """
     def __init__(self):
-        # The last partial line pushed into this object.
-        self._partial = ''
+        # Chunks of the last partial line pushed into this object.
+        self._partial = []
         # The list of full, pushed lines, in reverse order
         self._lines = []
         # The stack of false-EOF checking predicates.
@@ -67,8 +67,8 @@
 
     def close(self):
         # Don't forget any trailing partial line.
-        self._lines.append(self._partial)
-        self._partial = ''
+        self.pushlines(''.join(self._partial).splitlines(True))
+        self._partial = []
         self._closed = True
 
     def readline(self):
@@ -96,26 +96,27 @@
 
     def push(self, data):
         """Push some new data into this object."""
-        # Handle any previous leftovers
-        data, self._partial = self._partial + data, ''
-        # Crack into lines, but preserve the newlines on the end of each
-        parts = NLCRE_crack.split(data)
-        # The *ahem* interesting behaviour of re.split when supplied grouping
-        # parentheses is that the last element of the resulting list is the
-        # data after the final RE.  In the case of a NL/CR terminated string,
-        # this is the empty string.
-        self._partial = parts.pop()
-        #GAN 29Mar09  bugs 1555570, 1721862  Confusion at 8K boundary ending with \r:
-        # is there a \n to follow later?
-        if not self._partial and parts and parts[-1].endswith('\r'):
-            self._partial = parts.pop(-2)+parts.pop()
-        # parts is a list of strings, alternating between the line contents
-        # and the eol character(s).  Gather up a list of lines after
-        # re-attaching the newlines.
-        lines = []
-        for i in range(len(parts) // 2):
-            lines.append(parts[i*2] + parts[i*2+1])
-        self.pushlines(lines)
+        # Crack into lines, but preserve the linesep characters on the end of each
+        parts = data.splitlines(True)
+
+        if not parts or not parts[0].endswith(('\n', '\r')):
+            # No new complete lines, so just accumulate partials
+            self._partial += parts
+            return
+
+        if self._partial:
+            # If there are previous leftovers, complete them now
+            self._partial.append(parts[0])
+            parts[0:1] = ''.join(self._partial).splitlines(True)
+            del self._partial[:]
+
+        # If the last element of the list does not end in a newline, then treat
+        # it as a partial line.  We only check for '\n' here because a line
+        # ending with '\r' might be a line that was split in the middle of a
+        # '\r\n' sequence (see bugs 1555570 and 1721862).
+        if not parts[-1].endswith('\n'):
+            self._partial = [parts.pop()]
+        self.pushlines(parts)
 
     def pushlines(self, lines):
         # Reverse and insert at the front of the lines.
@@ -135,7 +136,7 @@
 class FeedParser:
     """A feed-style parser of email."""
 
-    def __init__(self, _factory=message.Message, *, policy=compat32):
+    def __init__(self, _factory=None, *, policy=compat32):
         """_factory is called with no arguments to create a new message obj
 
         The policy keyword specifies a policy object that controls a number of
@@ -143,14 +144,23 @@
         backward compatibility.
 
         """
-        self._factory = _factory
         self.policy = policy
-        try:
-            _factory(policy=self.policy)
-            self._factory_kwds = lambda: {'policy': self.policy}
-        except TypeError:
-            # Assume this is an old-style factory
-            self._factory_kwds = lambda: {}
+        self._factory_kwds = lambda: {'policy': self.policy}
+        if _factory is None:
+            # What this should be:
+            #self._factory = policy.default_message_factory
+            # but, because we are post 3.4 feature freeze, fix with temp hack:
+            if self.policy is compat32:
+                self._factory = message.Message
+            else:
+                self._factory = message.EmailMessage
+        else:
+            self._factory = _factory
+            try:
+                _factory(policy=self.policy)
+            except TypeError:
+                # Assume this is an old-style factory
+                self._factory_kwds = lambda: {}
         self._input = BufferedSubFile()
         self._msgstack = []
         self._parse = self._parsegen().__next__
@@ -501,6 +511,15 @@
             # There will always be a colon, because if there wasn't the part of
             # the parser that calls us would have started parsing the body.
             i = line.find(':')
+
+            # If the colon is on the start of the line the header is clearly
+            # malformed, but we might be able to salvage the rest of the
+            # message. Track the error but keep going.
+            if i == 0:
+                defect = errors.InvalidHeaderDefect("Missing header name.")
+                self._cur.defects.append(defect)
+                continue
+
             assert i>0, "_parse_headers fed line with no : and no leading WS"
             lastheader = line[:i]
             lastvalue = [line]
diff --git a/Lib/email/generator.py b/Lib/email/generator.py
index e4a86d4..4735721 100644
--- a/Lib/email/generator.py
+++ b/Lib/email/generator.py
@@ -10,14 +10,10 @@
 import sys
 import time
 import random
-import warnings
 
 from copy import deepcopy
 from io import StringIO, BytesIO
-from email._policybase import compat32
-from email.header import Header
 from email.utils import _has_surrogates
-import email.charset as _charset
 
 UNDERSCORE = '_'
 NL = '\n'  # XXX: no longer used by the code below.
@@ -55,8 +51,9 @@
         by RFC 2822.
 
         The policy keyword specifies a policy object that controls a number of
-        aspects of the generator's operation.  The default policy maintains
-        backward compatibility.
+        aspects of the generator's operation.  If no policy is specified,
+        the policy associated with the Message object passed to the
+        flatten method is used.
 
         """
         self._fp = outfp
@@ -80,7 +77,9 @@
         Note that for subobjects, no From_ line is printed.
 
         linesep specifies the characters used to indicate a new line in
-        the output.  The default value is determined by the policy.
+        the output.  The default value is determined by the policy specified
+        when the Generator instance was created or, if none was specified,
+        from the policy associated with the msg.
 
         """
         # We use the _XXX constants for operating on data that comes directly
diff --git a/Lib/email/header.py b/Lib/email/header.py
index 5bd0638..9c89589 100644
--- a/Lib/email/header.py
+++ b/Lib/email/header.py
@@ -100,7 +100,6 @@
                 words.append((encoded, encoding, charset))
     # Now loop over words and remove words that consist of whitespace
     # between two encoded strings.
-    import sys
     droplist = []
     for n, w in enumerate(words):
         if n>1 and w[1] and words[n-2][1] and words[n-1][0].isspace():
@@ -362,7 +361,6 @@
         for string, charset in self._chunks:
             if hasspace is not None:
                 hasspace = string and self._nonctext(string[0])
-                import sys
                 if lastcs not in (None, 'us-ascii'):
                     if not hasspace or charset not in (None, 'us-ascii'):
                         formatter.add_transition()
diff --git a/Lib/email/headerregistry.py b/Lib/email/headerregistry.py
index 1fae950..911a2af 100644
--- a/Lib/email/headerregistry.py
+++ b/Lib/email/headerregistry.py
@@ -7,6 +7,7 @@
 and will probably change some before that happens.
 
 """
+from types import MappingProxyType
 
 from email import utils
 from email import errors
@@ -454,7 +455,7 @@
 
     @property
     def params(self):
-        return self._params.copy()
+        return MappingProxyType(self._params)
 
 
 class ContentTypeHeader(ParameterizedMIMEHeader):
diff --git a/Lib/email/iterators.py b/Lib/email/iterators.py
index 3adc4a0..b5502ee 100644
--- a/Lib/email/iterators.py
+++ b/Lib/email/iterators.py
@@ -26,8 +26,7 @@
     yield self
     if self.is_multipart():
         for subpart in self.get_payload():
-            for subsubpart in subpart.walk():
-                yield subsubpart
+            yield from subpart.walk()
 
 
 
@@ -40,8 +39,7 @@
     for subpart in msg.walk():
         payload = subpart.get_payload(decode=decode)
         if isinstance(payload, str):
-            for line in StringIO(payload):
-                yield line
+            yield from StringIO(payload)
 
 
 def typed_subpart_iterator(msg, maintype='text', subtype=None):
diff --git a/Lib/email/message.py b/Lib/email/message.py
index afe350c..2f37dbb 100644
--- a/Lib/email/message.py
+++ b/Lib/email/message.py
@@ -8,8 +8,8 @@
 
 import re
 import uu
-import base64
-import binascii
+import quopri
+import warnings
 from io import BytesIO, StringIO
 
 # Intrapackage imports
@@ -132,22 +132,50 @@
 
     def __str__(self):
         """Return the entire formatted message as a string.
-        This includes the headers, body, and envelope header.
         """
         return self.as_string()
 
-    def as_string(self, unixfrom=False, maxheaderlen=0):
+    def as_string(self, unixfrom=False, maxheaderlen=0, policy=None):
         """Return the entire formatted message as a string.
-        Optional `unixfrom' when True, means include the Unix From_ envelope
-        header.
 
-        This is a convenience method and may not generate the message exactly
-        as you intend.  For more flexibility, use the flatten() method of a
-        Generator instance.
+        Optional 'unixfrom', when true, means include the Unix From_ envelope
+        header.  For backward compatibility reasons, if maxheaderlen is
+        not specified it defaults to 0, so you must override it explicitly
+        if you want a different maxheaderlen.  'policy' is passed to the
+        Generator instance used to serialize the mesasge; if it is not
+        specified the policy associated with the message instance is used.
+
+        If the message object contains binary data that is not encoded
+        according to RFC standards, the non-compliant data will be replaced by
+        unicode "unknown character" code points.
         """
         from email.generator import Generator
+        policy = self.policy if policy is None else policy
         fp = StringIO()
-        g = Generator(fp, mangle_from_=False, maxheaderlen=maxheaderlen)
+        g = Generator(fp,
+                      mangle_from_=False,
+                      maxheaderlen=maxheaderlen,
+                      policy=policy)
+        g.flatten(self, unixfrom=unixfrom)
+        return fp.getvalue()
+
+    def __bytes__(self):
+        """Return the entire formatted message as a bytes object.
+        """
+        return self.as_bytes()
+
+    def as_bytes(self, unixfrom=False, policy=None):
+        """Return the entire formatted message as a bytes object.
+
+        Optional 'unixfrom', when true, means include the Unix From_ envelope
+        header.  'policy' is passed to the BytesGenerator instance used to
+        serialize the message; if not specified the policy associated with
+        the message instance is used.
+        """
+        from email.generator import BytesGenerator
+        policy = self.policy if policy is None else policy
+        fp = BytesIO()
+        g = BytesGenerator(fp, mangle_from_=False, policy=policy)
         g.flatten(self, unixfrom=unixfrom)
         return fp.getvalue()
 
@@ -177,7 +205,11 @@
         if self._payload is None:
             self._payload = [payload]
         else:
-            self._payload.append(payload)
+            try:
+                self._payload.append(payload)
+            except AttributeError:
+                raise TypeError("Attach is not valid on a message with a"
+                                " non-multipart payload")
 
     def get_payload(self, i=None, decode=False):
         """Return a reference to the payload.
@@ -241,14 +273,14 @@
                     bpayload = payload.encode('ascii')
                 except UnicodeError:
                     # This won't happen for RFC compliant messages (messages
-                    # containing only ASCII codepoints in the unicode input).
+                    # containing only ASCII code points in the unicode input).
                     # If it does happen, turn the string into bytes in a way
                     # guaranteed not to fail.
                     bpayload = payload.encode('raw-unicode-escape')
         if not decode:
             return payload
         if cte == 'quoted-printable':
-            return utils._qdecode(bpayload)
+            return quopri.decodestring(bpayload)
         elif cte == 'base64':
             # XXX: this is a bit of a hack; decode_b should probably be factored
             # out somewhere, but I haven't figured out where yet.
@@ -668,7 +700,7 @@
         return failobj
 
     def set_param(self, param, value, header='Content-Type', requote=True,
-                  charset=None, language=''):
+                  charset=None, language='', replace=False):
         """Set a parameter in the Content-Type header.
 
         If the parameter already exists in the header, its value will be
@@ -712,8 +744,11 @@
                 else:
                     ctype = SEMISPACE.join([ctype, append_param])
         if ctype != self.get(header):
-            del self[header]
-            self[header] = ctype
+            if replace:
+                self.replace_header(header, ctype)
+            else:
+                del self[header]
+                self[header] = ctype
 
     def del_param(self, param, header='content-type', requote=True):
         """Remove the given parameter completely from the Content-Type header.
@@ -894,3 +929,219 @@
 
     # I.e. def walk(self): ...
     from email.iterators import walk
+
+# XXX Support for temporary deprecation hack for is_attachment property.
+class _IsAttachment:
+    def __init__(self, value):
+        self.value = value
+    def __call__(self):
+        return self.value
+    def __bool__(self):
+        warnings.warn("is_attachment will be a method, not a property, in 3.5",
+                      DeprecationWarning,
+                      stacklevel=3)
+        return self.value
+
+class MIMEPart(Message):
+
+    def __init__(self, policy=None):
+        if policy is None:
+            from email.policy import default
+            policy = default
+        Message.__init__(self, policy)
+
+    @property
+    def is_attachment(self):
+        c_d = self.get('content-disposition')
+        result = False if c_d is None else c_d.content_disposition == 'attachment'
+        # XXX transitional hack to raise deprecation if not called.
+        return _IsAttachment(result)
+
+    def _find_body(self, part, preferencelist):
+        if part.is_attachment():
+            return
+        maintype, subtype = part.get_content_type().split('/')
+        if maintype == 'text':
+            if subtype in preferencelist:
+                yield (preferencelist.index(subtype), part)
+            return
+        if maintype != 'multipart':
+            return
+        if subtype != 'related':
+            for subpart in part.iter_parts():
+                yield from self._find_body(subpart, preferencelist)
+            return
+        if 'related' in preferencelist:
+            yield (preferencelist.index('related'), part)
+        candidate = None
+        start = part.get_param('start')
+        if start:
+            for subpart in part.iter_parts():
+                if subpart['content-id'] == start:
+                    candidate = subpart
+                    break
+        if candidate is None:
+            subparts = part.get_payload()
+            candidate = subparts[0] if subparts else None
+        if candidate is not None:
+            yield from self._find_body(candidate, preferencelist)
+
+    def get_body(self, preferencelist=('related', 'html', 'plain')):
+        """Return best candidate mime part for display as 'body' of message.
+
+        Do a depth first search, starting with self, looking for the first part
+        matching each of the items in preferencelist, and return the part
+        corresponding to the first item that has a match, or None if no items
+        have a match.  If 'related' is not included in preferencelist, consider
+        the root part of any multipart/related encountered as a candidate
+        match.  Ignore parts with 'Content-Disposition: attachment'.
+        """
+        best_prio = len(preferencelist)
+        body = None
+        for prio, part in self._find_body(self, preferencelist):
+            if prio < best_prio:
+                best_prio = prio
+                body = part
+                if prio == 0:
+                    break
+        return body
+
+    _body_types = {('text', 'plain'),
+                   ('text', 'html'),
+                   ('multipart', 'related'),
+                   ('multipart', 'alternative')}
+    def iter_attachments(self):
+        """Return an iterator over the non-main parts of a multipart.
+
+        Skip the first of each occurrence of text/plain, text/html,
+        multipart/related, or multipart/alternative in the multipart (unless
+        they have a 'Content-Disposition: attachment' header) and include all
+        remaining subparts in the returned iterator.  When applied to a
+        multipart/related, return all parts except the root part.  Return an
+        empty iterator when applied to a multipart/alternative or a
+        non-multipart.
+        """
+        maintype, subtype = self.get_content_type().split('/')
+        if maintype != 'multipart' or subtype == 'alternative':
+            return
+        parts = self.get_payload()
+        if maintype == 'multipart' and subtype == 'related':
+            # For related, we treat everything but the root as an attachment.
+            # The root may be indicated by 'start'; if there's no start or we
+            # can't find the named start, treat the first subpart as the root.
+            start = self.get_param('start')
+            if start:
+                found = False
+                attachments = []
+                for part in parts:
+                    if part.get('content-id') == start:
+                        found = True
+                    else:
+                        attachments.append(part)
+                if found:
+                    yield from attachments
+                    return
+            parts.pop(0)
+            yield from parts
+            return
+        # Otherwise we more or less invert the remaining logic in get_body.
+        # This only really works in edge cases (ex: non-text relateds or
+        # alternatives) if the sending agent sets content-disposition.
+        seen = []   # Only skip the first example of each candidate type.
+        for part in parts:
+            maintype, subtype = part.get_content_type().split('/')
+            if ((maintype, subtype) in self._body_types and
+                    not part.is_attachment() and subtype not in seen):
+                seen.append(subtype)
+                continue
+            yield part
+
+    def iter_parts(self):
+        """Return an iterator over all immediate subparts of a multipart.
+
+        Return an empty iterator for a non-multipart.
+        """
+        if self.get_content_maintype() == 'multipart':
+            yield from self.get_payload()
+
+    def get_content(self, *args, content_manager=None, **kw):
+        if content_manager is None:
+            content_manager = self.policy.content_manager
+        return content_manager.get_content(self, *args, **kw)
+
+    def set_content(self, *args, content_manager=None, **kw):
+        if content_manager is None:
+            content_manager = self.policy.content_manager
+        content_manager.set_content(self, *args, **kw)
+
+    def _make_multipart(self, subtype, disallowed_subtypes, boundary):
+        if self.get_content_maintype() == 'multipart':
+            existing_subtype = self.get_content_subtype()
+            disallowed_subtypes = disallowed_subtypes + (subtype,)
+            if existing_subtype in disallowed_subtypes:
+                raise ValueError("Cannot convert {} to {}".format(
+                    existing_subtype, subtype))
+        keep_headers = []
+        part_headers = []
+        for name, value in self._headers:
+            if name.lower().startswith('content-'):
+                part_headers.append((name, value))
+            else:
+                keep_headers.append((name, value))
+        if part_headers:
+            # There is existing content, move it to the first subpart.
+            part = type(self)(policy=self.policy)
+            part._headers = part_headers
+            part._payload = self._payload
+            self._payload = [part]
+        else:
+            self._payload = []
+        self._headers = keep_headers
+        self['Content-Type'] = 'multipart/' + subtype
+        if boundary is not None:
+            self.set_param('boundary', boundary)
+
+    def make_related(self, boundary=None):
+        self._make_multipart('related', ('alternative', 'mixed'), boundary)
+
+    def make_alternative(self, boundary=None):
+        self._make_multipart('alternative', ('mixed',), boundary)
+
+    def make_mixed(self, boundary=None):
+        self._make_multipart('mixed', (), boundary)
+
+    def _add_multipart(self, _subtype, *args, _disp=None, **kw):
+        if (self.get_content_maintype() != 'multipart' or
+                self.get_content_subtype() != _subtype):
+            getattr(self, 'make_' + _subtype)()
+        part = type(self)(policy=self.policy)
+        part.set_content(*args, **kw)
+        if _disp and 'content-disposition' not in part:
+            part['Content-Disposition'] = _disp
+        self.attach(part)
+
+    def add_related(self, *args, **kw):
+        self._add_multipart('related', *args, _disp='inline', **kw)
+
+    def add_alternative(self, *args, **kw):
+        self._add_multipart('alternative', *args, **kw)
+
+    def add_attachment(self, *args, **kw):
+        self._add_multipart('mixed', *args, _disp='attachment', **kw)
+
+    def clear(self):
+        self._headers = []
+        self._payload = None
+
+    def clear_content(self):
+        self._headers = [(n, v) for n, v in self._headers
+                         if not n.lower().startswith('content-')]
+        self._payload = None
+
+
+class EmailMessage(MIMEPart):
+
+    def set_content(self, *args, **kw):
+        super().set_content(*args, **kw)
+        if 'MIME-Version' not in self:
+            self['MIME-Version'] = '1.0'
diff --git a/Lib/email/mime/nonmultipart.py b/Lib/email/mime/nonmultipart.py
index fc3b9eb..e1f5196 100644
--- a/Lib/email/mime/nonmultipart.py
+++ b/Lib/email/mime/nonmultipart.py
@@ -12,7 +12,7 @@
 
 
 class MIMENonMultipart(MIMEBase):
-    """Base class for MIME multipart/* type messages."""
+    """Base class for MIME non-multipart type messages."""
 
     def attach(self, payload):
         # The public API prohibits attaching multiple subparts to MIMEBase
diff --git a/Lib/email/mime/text.py b/Lib/email/mime/text.py
index 3b5b09f..ec18b85 100644
--- a/Lib/email/mime/text.py
+++ b/Lib/email/mime/text.py
@@ -6,7 +6,6 @@
 
 __all__ = ['MIMEText']
 
-from email.encoders import encode_7or8bit
 from email.mime.nonmultipart import MIMENonMultipart
 
 
diff --git a/Lib/email/parser.py b/Lib/email/parser.py
index 752bf35..8c9bc9e 100644
--- a/Lib/email/parser.py
+++ b/Lib/email/parser.py
@@ -4,19 +4,18 @@
 
 """A parser of RFC 2822 and MIME email messages."""
 
-__all__ = ['Parser', 'HeaderParser', 'BytesParser', 'BytesHeaderParser']
+__all__ = ['Parser', 'HeaderParser', 'BytesParser', 'BytesHeaderParser',
+           'FeedParser', 'BytesFeedParser']
 
-import warnings
 from io import StringIO, TextIOWrapper
 
 from email.feedparser import FeedParser, BytesFeedParser
-from email.message import Message
 from email._policybase import compat32
 
 
 
 class Parser:
-    def __init__(self, _class=Message, *, policy=compat32):
+    def __init__(self, _class=None, *, policy=compat32):
         """Parser of RFC 2822 and MIME email messages.
 
         Creates an in-memory object tree representing the email message, which
@@ -107,8 +106,10 @@
         meaning it parses the entire contents of the file.
         """
         fp = TextIOWrapper(fp, encoding='ascii', errors='surrogateescape')
-        with fp:
+        try:
             return self.parser.parse(fp, headersonly)
+        finally:
+            fp.detach()
 
 
     def parsebytes(self, text, headersonly=False):
diff --git a/Lib/email/policy.py b/Lib/email/policy.py
index 38e88af..f0b20f4 100644
--- a/Lib/email/policy.py
+++ b/Lib/email/policy.py
@@ -5,6 +5,7 @@
 from email._policybase import Policy, Compat32, compat32, _extend_docstrings
 from email.utils import _has_surrogates
 from email.headerregistry import HeaderRegistry as HeaderRegistry
+from email.contentmanager import raw_data_manager
 
 __all__ = [
     'Compat32',
@@ -58,10 +59,22 @@
                            special treatment, while all other fields are
                            treated as unstructured.  This list will be
                            completed before the extension is marked stable.)
+
+    content_manager     -- an object with at least two methods: get_content
+                           and set_content.  When the get_content or
+                           set_content method of a Message object is called,
+                           it calls the corresponding method of this object,
+                           passing it the message object as its first argument,
+                           and any arguments or keywords that were passed to
+                           it as additional arguments.  The default
+                           content_manager is
+                           :data:`~email.contentmanager.raw_data_manager`.
+
     """
 
     refold_source = 'long'
     header_factory = HeaderRegistry()
+    content_manager = raw_data_manager
 
     def __init__(self, **kw):
         # Ensure that each new instance gets a unique header factory
diff --git a/Lib/email/quoprimime.py b/Lib/email/quoprimime.py
index 30bf916..c1fe2b4 100644
--- a/Lib/email/quoprimime.py
+++ b/Lib/email/quoprimime.py
@@ -40,7 +40,6 @@
     ]
 
 import re
-import io
 
 from string import ascii_letters, digits, hexdigits
 
diff --git a/Lib/email/utils.py b/Lib/email/utils.py
index f76c21e..cacb9b1 100644
--- a/Lib/email/utils.py
+++ b/Lib/email/utils.py
@@ -25,13 +25,10 @@
 import os
 import re
 import time
-import base64
 import random
 import socket
 import datetime
 import urllib.parse
-import warnings
-from io import StringIO
 
 from email._parseaddr import quote
 from email._parseaddr import AddressList as _AddressList
@@ -39,10 +36,7 @@
 
 from email._parseaddr import parsedate, parsedate_tz, _parsedate_tz
 
-from quopri import decodestring as _qdecode
-
 # Intrapackage imports
-from email.encoders import _bencode, _qencode
 from email.charset import Charset
 
 COMMASPACE = ', '
@@ -54,17 +48,27 @@
 specialsre = re.compile(r'[][\\()<>@,:;".]')
 escapesre = re.compile(r'[\\"]')
 
-# How to figure out if we are processing strings that come from a byte
-# source with undecodable characters.
-_has_surrogates = re.compile(
-    '([^\ud800-\udbff]|\A)[\udc00-\udfff]([^\udc00-\udfff]|\Z)').search
+def _has_surrogates(s):
+    """Return True if s contains surrogate-escaped binary data."""
+    # This check is based on the fact that unless there are surrogates, utf8
+    # (Python's default encoding) can encode any string.  This is the fastest
+    # way to check for surrogates, see issue 11454 for timings.
+    try:
+        s.encode()
+        return False
+    except UnicodeEncodeError:
+        return True
 
 # How to deal with a string containing bytes before handing it to the
 # application through the 'normal' interface.
 def _sanitize(string):
-    # Turn any escaped bytes into unicode 'unknown' char.
-    original_bytes = string.encode('ascii', 'surrogateescape')
-    return original_bytes.decode('ascii', 'replace')
+    # Turn any escaped bytes into unicode 'unknown' char.  If the escaped
+    # bytes happen to be utf-8 they will instead get decoded, even if they
+    # were invalid in the charset the source was supposed to be in.  This
+    # seems like it is not a bad thing; a defect was still registered.
+    original_bytes = string.encode('utf-8', 'surrogateescape')
+    return original_bytes.decode('utf-8', 'replace')
+
 
 
 # Helpers
diff --git a/Lib/encodings/aliases.py b/Lib/encodings/aliases.py
index 235deb5..4cbaade 100644
--- a/Lib/encodings/aliases.py
+++ b/Lib/encodings/aliases.py
@@ -33,9 +33,9 @@
     'us'                 : 'ascii',
     'us_ascii'           : 'ascii',
 
-    ## base64_codec codec
-    #'base64'             : 'base64_codec',
-    #'base_64'            : 'base64_codec',
+    # base64_codec codec
+    'base64'             : 'base64_codec',
+    'base_64'            : 'base64_codec',
 
     # big5 codec
     'big5_tw'            : 'big5',
@@ -45,8 +45,8 @@
     'big5_hkscs'         : 'big5hkscs',
     'hkscs'              : 'big5hkscs',
 
-    ## bz2_codec codec
-    #'bz2'                : 'bz2_codec',
+    # bz2_codec codec
+    'bz2'                : 'bz2_codec',
 
     # cp037 codec
     '037'                : 'cp037',
@@ -63,6 +63,12 @@
     'csibm1026'          : 'cp1026',
     'ibm1026'            : 'cp1026',
 
+    # cp1125 codec
+    '1125'                : 'cp1125',
+    'ibm1125'             : 'cp1125',
+    'cp866u'              : 'cp1125',
+    'ruscii'              : 'cp1125',
+
     # cp1140 codec
     '1140'               : 'cp1140',
     'ibm1140'            : 'cp1140',
@@ -103,6 +109,11 @@
     '1258'               : 'cp1258',
     'windows_1258'       : 'cp1258',
 
+    # cp273 codec
+    '273'                : 'cp273',
+    'ibm273'             : 'cp273',
+    'csibm273'           : 'cp273',
+
     # cp424 codec
     '424'                : 'cp424',
     'csibm424'           : 'cp424',
@@ -248,8 +259,8 @@
     'cp936'              : 'gbk',
     'ms936'              : 'gbk',
 
-    ## hex_codec codec
-    #'hex'                : 'hex_codec',
+    # hex_codec codec
+    'hex'                : 'hex_codec',
 
     # hp_roman8 codec
     'roman8'             : 'hp_roman8',
@@ -450,13 +461,13 @@
     'cp154'              : 'ptcp154',
     'cyrillic_asian'     : 'ptcp154',
 
-    ## quopri_codec codec
-    #'quopri'             : 'quopri_codec',
-    #'quoted_printable'   : 'quopri_codec',
-    #'quotedprintable'    : 'quopri_codec',
+    # quopri_codec codec
+    'quopri'             : 'quopri_codec',
+    'quoted_printable'   : 'quopri_codec',
+    'quotedprintable'    : 'quopri_codec',
 
-    ## rot_13 codec
-    #'rot13'              : 'rot_13',
+    # rot_13 codec
+    'rot13'              : 'rot_13',
 
     # shift_jis codec
     'csshiftjis'         : 'shift_jis',
@@ -518,12 +529,12 @@
     'utf8_ucs2'          : 'utf_8',
     'utf8_ucs4'          : 'utf_8',
 
-    ## uu_codec codec
-    #'uu'                 : 'uu_codec',
+    # uu_codec codec
+    'uu'                 : 'uu_codec',
 
-    ## zlib_codec codec
-    #'zip'                : 'zlib_codec',
-    #'zlib'               : 'zlib_codec',
+    # zlib_codec codec
+    'zip'                : 'zlib_codec',
+    'zlib'               : 'zlib_codec',
 
     # temporary mac CJK aliases, will be replaced by proper codecs in 3.1
     'x_mac_japanese'      : 'shift_jis',
diff --git a/Lib/encodings/cp037.py b/Lib/encodings/cp037.py
index bfe2c1e..4edd708 100644
--- a/Lib/encodings/cp037.py
+++ b/Lib/encodings/cp037.py
@@ -301,7 +301,6 @@
     '\xd9'     #  0xFD -> LATIN CAPITAL LETTER U WITH GRAVE
     '\xda'     #  0xFE -> LATIN CAPITAL LETTER U WITH ACUTE
     '\x9f'     #  0xFF -> CONTROL
-    '\ufffe'   ## Widen to UCS2 for optimization
 )
 
 ### Encoding table
diff --git a/Lib/encodings/cp1125.py b/Lib/encodings/cp1125.py
new file mode 100644
index 0000000..b1fd69d
--- /dev/null
+++ b/Lib/encodings/cp1125.py
@@ -0,0 +1,698 @@
+""" Python Character Mapping Codec for CP1125
+
+"""#"
+
+import codecs
+
+### Codec APIs
+
+class Codec(codecs.Codec):
+
+    def encode(self,input,errors='strict'):
+        return codecs.charmap_encode(input,errors,encoding_map)
+
+    def decode(self,input,errors='strict'):
+        return codecs.charmap_decode(input,errors,decoding_table)
+
+class IncrementalEncoder(codecs.IncrementalEncoder):
+    def encode(self, input, final=False):
+        return codecs.charmap_encode(input,self.errors,encoding_map)[0]
+
+class IncrementalDecoder(codecs.IncrementalDecoder):
+    def decode(self, input, final=False):
+        return codecs.charmap_decode(input,self.errors,decoding_table)[0]
+
+class StreamWriter(Codec,codecs.StreamWriter):
+    pass
+
+class StreamReader(Codec,codecs.StreamReader):
+    pass
+
+### encodings module API
+
+def getregentry():
+    return codecs.CodecInfo(
+        name='cp1125',
+        encode=Codec().encode,
+        decode=Codec().decode,
+        incrementalencoder=IncrementalEncoder,
+        incrementaldecoder=IncrementalDecoder,
+        streamreader=StreamReader,
+        streamwriter=StreamWriter,
+    )
+
+### Decoding Map
+
+decoding_map = codecs.make_identity_dict(range(256))
+decoding_map.update({
+    0x0080: 0x0410,     #  CYRILLIC CAPITAL LETTER A
+    0x0081: 0x0411,     #  CYRILLIC CAPITAL LETTER BE
+    0x0082: 0x0412,     #  CYRILLIC CAPITAL LETTER VE
+    0x0083: 0x0413,     #  CYRILLIC CAPITAL LETTER GHE
+    0x0084: 0x0414,     #  CYRILLIC CAPITAL LETTER DE
+    0x0085: 0x0415,     #  CYRILLIC CAPITAL LETTER IE
+    0x0086: 0x0416,     #  CYRILLIC CAPITAL LETTER ZHE
+    0x0087: 0x0417,     #  CYRILLIC CAPITAL LETTER ZE
+    0x0088: 0x0418,     #  CYRILLIC CAPITAL LETTER I
+    0x0089: 0x0419,     #  CYRILLIC CAPITAL LETTER SHORT I
+    0x008a: 0x041a,     #  CYRILLIC CAPITAL LETTER KA
+    0x008b: 0x041b,     #  CYRILLIC CAPITAL LETTER EL
+    0x008c: 0x041c,     #  CYRILLIC CAPITAL LETTER EM
+    0x008d: 0x041d,     #  CYRILLIC CAPITAL LETTER EN
+    0x008e: 0x041e,     #  CYRILLIC CAPITAL LETTER O
+    0x008f: 0x041f,     #  CYRILLIC CAPITAL LETTER PE
+    0x0090: 0x0420,     #  CYRILLIC CAPITAL LETTER ER
+    0x0091: 0x0421,     #  CYRILLIC CAPITAL LETTER ES
+    0x0092: 0x0422,     #  CYRILLIC CAPITAL LETTER TE
+    0x0093: 0x0423,     #  CYRILLIC CAPITAL LETTER U
+    0x0094: 0x0424,     #  CYRILLIC CAPITAL LETTER EF
+    0x0095: 0x0425,     #  CYRILLIC CAPITAL LETTER HA
+    0x0096: 0x0426,     #  CYRILLIC CAPITAL LETTER TSE
+    0x0097: 0x0427,     #  CYRILLIC CAPITAL LETTER CHE
+    0x0098: 0x0428,     #  CYRILLIC CAPITAL LETTER SHA
+    0x0099: 0x0429,     #  CYRILLIC CAPITAL LETTER SHCHA
+    0x009a: 0x042a,     #  CYRILLIC CAPITAL LETTER HARD SIGN
+    0x009b: 0x042b,     #  CYRILLIC CAPITAL LETTER YERU
+    0x009c: 0x042c,     #  CYRILLIC CAPITAL LETTER SOFT SIGN
+    0x009d: 0x042d,     #  CYRILLIC CAPITAL LETTER E
+    0x009e: 0x042e,     #  CYRILLIC CAPITAL LETTER YU
+    0x009f: 0x042f,     #  CYRILLIC CAPITAL LETTER YA
+    0x00a0: 0x0430,     #  CYRILLIC SMALL LETTER A
+    0x00a1: 0x0431,     #  CYRILLIC SMALL LETTER BE
+    0x00a2: 0x0432,     #  CYRILLIC SMALL LETTER VE
+    0x00a3: 0x0433,     #  CYRILLIC SMALL LETTER GHE
+    0x00a4: 0x0434,     #  CYRILLIC SMALL LETTER DE
+    0x00a5: 0x0435,     #  CYRILLIC SMALL LETTER IE
+    0x00a6: 0x0436,     #  CYRILLIC SMALL LETTER ZHE
+    0x00a7: 0x0437,     #  CYRILLIC SMALL LETTER ZE
+    0x00a8: 0x0438,     #  CYRILLIC SMALL LETTER I
+    0x00a9: 0x0439,     #  CYRILLIC SMALL LETTER SHORT I
+    0x00aa: 0x043a,     #  CYRILLIC SMALL LETTER KA
+    0x00ab: 0x043b,     #  CYRILLIC SMALL LETTER EL
+    0x00ac: 0x043c,     #  CYRILLIC SMALL LETTER EM
+    0x00ad: 0x043d,     #  CYRILLIC SMALL LETTER EN
+    0x00ae: 0x043e,     #  CYRILLIC SMALL LETTER O
+    0x00af: 0x043f,     #  CYRILLIC SMALL LETTER PE
+    0x00b0: 0x2591,     #  LIGHT SHADE
+    0x00b1: 0x2592,     #  MEDIUM SHADE
+    0x00b2: 0x2593,     #  DARK SHADE
+    0x00b3: 0x2502,     #  BOX DRAWINGS LIGHT VERTICAL
+    0x00b4: 0x2524,     #  BOX DRAWINGS LIGHT VERTICAL AND LEFT
+    0x00b5: 0x2561,     #  BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
+    0x00b6: 0x2562,     #  BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
+    0x00b7: 0x2556,     #  BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
+    0x00b8: 0x2555,     #  BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
+    0x00b9: 0x2563,     #  BOX DRAWINGS DOUBLE VERTICAL AND LEFT
+    0x00ba: 0x2551,     #  BOX DRAWINGS DOUBLE VERTICAL
+    0x00bb: 0x2557,     #  BOX DRAWINGS DOUBLE DOWN AND LEFT
+    0x00bc: 0x255d,     #  BOX DRAWINGS DOUBLE UP AND LEFT
+    0x00bd: 0x255c,     #  BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
+    0x00be: 0x255b,     #  BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
+    0x00bf: 0x2510,     #  BOX DRAWINGS LIGHT DOWN AND LEFT
+    0x00c0: 0x2514,     #  BOX DRAWINGS LIGHT UP AND RIGHT
+    0x00c1: 0x2534,     #  BOX DRAWINGS LIGHT UP AND HORIZONTAL
+    0x00c2: 0x252c,     #  BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
+    0x00c3: 0x251c,     #  BOX DRAWINGS LIGHT VERTICAL AND RIGHT
+    0x00c4: 0x2500,     #  BOX DRAWINGS LIGHT HORIZONTAL
+    0x00c5: 0x253c,     #  BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
+    0x00c6: 0x255e,     #  BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
+    0x00c7: 0x255f,     #  BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
+    0x00c8: 0x255a,     #  BOX DRAWINGS DOUBLE UP AND RIGHT
+    0x00c9: 0x2554,     #  BOX DRAWINGS DOUBLE DOWN AND RIGHT
+    0x00ca: 0x2569,     #  BOX DRAWINGS DOUBLE UP AND HORIZONTAL
+    0x00cb: 0x2566,     #  BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
+    0x00cc: 0x2560,     #  BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
+    0x00cd: 0x2550,     #  BOX DRAWINGS DOUBLE HORIZONTAL
+    0x00ce: 0x256c,     #  BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
+    0x00cf: 0x2567,     #  BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
+    0x00d0: 0x2568,     #  BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
+    0x00d1: 0x2564,     #  BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
+    0x00d2: 0x2565,     #  BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
+    0x00d3: 0x2559,     #  BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
+    0x00d4: 0x2558,     #  BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
+    0x00d5: 0x2552,     #  BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
+    0x00d6: 0x2553,     #  BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
+    0x00d7: 0x256b,     #  BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
+    0x00d8: 0x256a,     #  BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
+    0x00d9: 0x2518,     #  BOX DRAWINGS LIGHT UP AND LEFT
+    0x00da: 0x250c,     #  BOX DRAWINGS LIGHT DOWN AND RIGHT
+    0x00db: 0x2588,     #  FULL BLOCK
+    0x00dc: 0x2584,     #  LOWER HALF BLOCK
+    0x00dd: 0x258c,     #  LEFT HALF BLOCK
+    0x00de: 0x2590,     #  RIGHT HALF BLOCK
+    0x00df: 0x2580,     #  UPPER HALF BLOCK
+    0x00e0: 0x0440,     #  CYRILLIC SMALL LETTER ER
+    0x00e1: 0x0441,     #  CYRILLIC SMALL LETTER ES
+    0x00e2: 0x0442,     #  CYRILLIC SMALL LETTER TE
+    0x00e3: 0x0443,     #  CYRILLIC SMALL LETTER U
+    0x00e4: 0x0444,     #  CYRILLIC SMALL LETTER EF
+    0x00e5: 0x0445,     #  CYRILLIC SMALL LETTER HA
+    0x00e6: 0x0446,     #  CYRILLIC SMALL LETTER TSE
+    0x00e7: 0x0447,     #  CYRILLIC SMALL LETTER CHE
+    0x00e8: 0x0448,     #  CYRILLIC SMALL LETTER SHA
+    0x00e9: 0x0449,     #  CYRILLIC SMALL LETTER SHCHA
+    0x00ea: 0x044a,     #  CYRILLIC SMALL LETTER HARD SIGN
+    0x00eb: 0x044b,     #  CYRILLIC SMALL LETTER YERU
+    0x00ec: 0x044c,     #  CYRILLIC SMALL LETTER SOFT SIGN
+    0x00ed: 0x044d,     #  CYRILLIC SMALL LETTER E
+    0x00ee: 0x044e,     #  CYRILLIC SMALL LETTER YU
+    0x00ef: 0x044f,     #  CYRILLIC SMALL LETTER YA
+    0x00f0: 0x0401,     #  CYRILLIC CAPITAL LETTER IO
+    0x00f1: 0x0451,     #  CYRILLIC SMALL LETTER IO
+    0x00f2: 0x0490,     #  CYRILLIC CAPITAL LETTER GHE WITH UPTURN
+    0x00f3: 0x0491,     #  CYRILLIC SMALL LETTER GHE WITH UPTURN
+    0x00f4: 0x0404,     #  CYRILLIC CAPITAL LETTER UKRAINIAN IE
+    0x00f5: 0x0454,     #  CYRILLIC SMALL LETTER UKRAINIAN IE
+    0x00f6: 0x0406,     #  CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I
+    0x00f7: 0x0456,     #  CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I
+    0x00f8: 0x0407,     #  CYRILLIC CAPITAL LETTER YI
+    0x00f9: 0x0457,     #  CYRILLIC SMALL LETTER YI
+    0x00fa: 0x00b7,     #  MIDDLE DOT
+    0x00fb: 0x221a,     #  SQUARE ROOT
+    0x00fc: 0x2116,     #  NUMERO SIGN
+    0x00fd: 0x00a4,     #  CURRENCY SIGN
+    0x00fe: 0x25a0,     #  BLACK SQUARE
+    0x00ff: 0x00a0,     #  NO-BREAK SPACE
+})
+
+### Decoding Table
+
+decoding_table = (
+    '\x00'     #  0x0000 -> NULL
+    '\x01'     #  0x0001 -> START OF HEADING
+    '\x02'     #  0x0002 -> START OF TEXT
+    '\x03'     #  0x0003 -> END OF TEXT
+    '\x04'     #  0x0004 -> END OF TRANSMISSION
+    '\x05'     #  0x0005 -> ENQUIRY
+    '\x06'     #  0x0006 -> ACKNOWLEDGE
+    '\x07'     #  0x0007 -> BELL
+    '\x08'     #  0x0008 -> BACKSPACE
+    '\t'       #  0x0009 -> HORIZONTAL TABULATION
+    '\n'       #  0x000a -> LINE FEED
+    '\x0b'     #  0x000b -> VERTICAL TABULATION
+    '\x0c'     #  0x000c -> FORM FEED
+    '\r'       #  0x000d -> CARRIAGE RETURN
+    '\x0e'     #  0x000e -> SHIFT OUT
+    '\x0f'     #  0x000f -> SHIFT IN
+    '\x10'     #  0x0010 -> DATA LINK ESCAPE
+    '\x11'     #  0x0011 -> DEVICE CONTROL ONE
+    '\x12'     #  0x0012 -> DEVICE CONTROL TWO
+    '\x13'     #  0x0013 -> DEVICE CONTROL THREE
+    '\x14'     #  0x0014 -> DEVICE CONTROL FOUR
+    '\x15'     #  0x0015 -> NEGATIVE ACKNOWLEDGE
+    '\x16'     #  0x0016 -> SYNCHRONOUS IDLE
+    '\x17'     #  0x0017 -> END OF TRANSMISSION BLOCK
+    '\x18'     #  0x0018 -> CANCEL
+    '\x19'     #  0x0019 -> END OF MEDIUM
+    '\x1a'     #  0x001a -> SUBSTITUTE
+    '\x1b'     #  0x001b -> ESCAPE
+    '\x1c'     #  0x001c -> FILE SEPARATOR
+    '\x1d'     #  0x001d -> GROUP SEPARATOR
+    '\x1e'     #  0x001e -> RECORD SEPARATOR
+    '\x1f'     #  0x001f -> UNIT SEPARATOR
+    ' '        #  0x0020 -> SPACE
+    '!'        #  0x0021 -> EXCLAMATION MARK
+    '"'        #  0x0022 -> QUOTATION MARK
+    '#'        #  0x0023 -> NUMBER SIGN
+    '$'        #  0x0024 -> DOLLAR SIGN
+    '%'        #  0x0025 -> PERCENT SIGN
+    '&'        #  0x0026 -> AMPERSAND
+    "'"        #  0x0027 -> APOSTROPHE
+    '('        #  0x0028 -> LEFT PARENTHESIS
+    ')'        #  0x0029 -> RIGHT PARENTHESIS
+    '*'        #  0x002a -> ASTERISK
+    '+'        #  0x002b -> PLUS SIGN
+    ','        #  0x002c -> COMMA
+    '-'        #  0x002d -> HYPHEN-MINUS
+    '.'        #  0x002e -> FULL STOP
+    '/'        #  0x002f -> SOLIDUS
+    '0'        #  0x0030 -> DIGIT ZERO
+    '1'        #  0x0031 -> DIGIT ONE
+    '2'        #  0x0032 -> DIGIT TWO
+    '3'        #  0x0033 -> DIGIT THREE
+    '4'        #  0x0034 -> DIGIT FOUR
+    '5'        #  0x0035 -> DIGIT FIVE
+    '6'        #  0x0036 -> DIGIT SIX
+    '7'        #  0x0037 -> DIGIT SEVEN
+    '8'        #  0x0038 -> DIGIT EIGHT
+    '9'        #  0x0039 -> DIGIT NINE
+    ':'        #  0x003a -> COLON
+    ';'        #  0x003b -> SEMICOLON
+    '<'        #  0x003c -> LESS-THAN SIGN
+    '='        #  0x003d -> EQUALS SIGN
+    '>'        #  0x003e -> GREATER-THAN SIGN
+    '?'        #  0x003f -> QUESTION MARK
+    '@'        #  0x0040 -> COMMERCIAL AT
+    'A'        #  0x0041 -> LATIN CAPITAL LETTER A
+    'B'        #  0x0042 -> LATIN CAPITAL LETTER B
+    'C'        #  0x0043 -> LATIN CAPITAL LETTER C
+    'D'        #  0x0044 -> LATIN CAPITAL LETTER D
+    'E'        #  0x0045 -> LATIN CAPITAL LETTER E
+    'F'        #  0x0046 -> LATIN CAPITAL LETTER F
+    'G'        #  0x0047 -> LATIN CAPITAL LETTER G
+    'H'        #  0x0048 -> LATIN CAPITAL LETTER H
+    'I'        #  0x0049 -> LATIN CAPITAL LETTER I
+    'J'        #  0x004a -> LATIN CAPITAL LETTER J
+    'K'        #  0x004b -> LATIN CAPITAL LETTER K
+    'L'        #  0x004c -> LATIN CAPITAL LETTER L
+    'M'        #  0x004d -> LATIN CAPITAL LETTER M
+    'N'        #  0x004e -> LATIN CAPITAL LETTER N
+    'O'        #  0x004f -> LATIN CAPITAL LETTER O
+    'P'        #  0x0050 -> LATIN CAPITAL LETTER P
+    'Q'        #  0x0051 -> LATIN CAPITAL LETTER Q
+    'R'        #  0x0052 -> LATIN CAPITAL LETTER R
+    'S'        #  0x0053 -> LATIN CAPITAL LETTER S
+    'T'        #  0x0054 -> LATIN CAPITAL LETTER T
+    'U'        #  0x0055 -> LATIN CAPITAL LETTER U
+    'V'        #  0x0056 -> LATIN CAPITAL LETTER V
+    'W'        #  0x0057 -> LATIN CAPITAL LETTER W
+    'X'        #  0x0058 -> LATIN CAPITAL LETTER X
+    'Y'        #  0x0059 -> LATIN CAPITAL LETTER Y
+    'Z'        #  0x005a -> LATIN CAPITAL LETTER Z
+    '['        #  0x005b -> LEFT SQUARE BRACKET
+    '\\'       #  0x005c -> REVERSE SOLIDUS
+    ']'        #  0x005d -> RIGHT SQUARE BRACKET
+    '^'        #  0x005e -> CIRCUMFLEX ACCENT
+    '_'        #  0x005f -> LOW LINE
+    '`'        #  0x0060 -> GRAVE ACCENT
+    'a'        #  0x0061 -> LATIN SMALL LETTER A
+    'b'        #  0x0062 -> LATIN SMALL LETTER B
+    'c'        #  0x0063 -> LATIN SMALL LETTER C
+    'd'        #  0x0064 -> LATIN SMALL LETTER D
+    'e'        #  0x0065 -> LATIN SMALL LETTER E
+    'f'        #  0x0066 -> LATIN SMALL LETTER F
+    'g'        #  0x0067 -> LATIN SMALL LETTER G
+    'h'        #  0x0068 -> LATIN SMALL LETTER H
+    'i'        #  0x0069 -> LATIN SMALL LETTER I
+    'j'        #  0x006a -> LATIN SMALL LETTER J
+    'k'        #  0x006b -> LATIN SMALL LETTER K
+    'l'        #  0x006c -> LATIN SMALL LETTER L
+    'm'        #  0x006d -> LATIN SMALL LETTER M
+    'n'        #  0x006e -> LATIN SMALL LETTER N
+    'o'        #  0x006f -> LATIN SMALL LETTER O
+    'p'        #  0x0070 -> LATIN SMALL LETTER P
+    'q'        #  0x0071 -> LATIN SMALL LETTER Q
+    'r'        #  0x0072 -> LATIN SMALL LETTER R
+    's'        #  0x0073 -> LATIN SMALL LETTER S
+    't'        #  0x0074 -> LATIN SMALL LETTER T
+    'u'        #  0x0075 -> LATIN SMALL LETTER U
+    'v'        #  0x0076 -> LATIN SMALL LETTER V
+    'w'        #  0x0077 -> LATIN SMALL LETTER W
+    'x'        #  0x0078 -> LATIN SMALL LETTER X
+    'y'        #  0x0079 -> LATIN SMALL LETTER Y
+    'z'        #  0x007a -> LATIN SMALL LETTER Z
+    '{'        #  0x007b -> LEFT CURLY BRACKET
+    '|'        #  0x007c -> VERTICAL LINE
+    '}'        #  0x007d -> RIGHT CURLY BRACKET
+    '~'        #  0x007e -> TILDE
+    '\x7f'     #  0x007f -> DELETE
+    '\u0410'   #  0x0080 -> CYRILLIC CAPITAL LETTER A
+    '\u0411'   #  0x0081 -> CYRILLIC CAPITAL LETTER BE
+    '\u0412'   #  0x0082 -> CYRILLIC CAPITAL LETTER VE
+    '\u0413'   #  0x0083 -> CYRILLIC CAPITAL LETTER GHE
+    '\u0414'   #  0x0084 -> CYRILLIC CAPITAL LETTER DE
+    '\u0415'   #  0x0085 -> CYRILLIC CAPITAL LETTER IE
+    '\u0416'   #  0x0086 -> CYRILLIC CAPITAL LETTER ZHE
+    '\u0417'   #  0x0087 -> CYRILLIC CAPITAL LETTER ZE
+    '\u0418'   #  0x0088 -> CYRILLIC CAPITAL LETTER I
+    '\u0419'   #  0x0089 -> CYRILLIC CAPITAL LETTER SHORT I
+    '\u041a'   #  0x008a -> CYRILLIC CAPITAL LETTER KA
+    '\u041b'   #  0x008b -> CYRILLIC CAPITAL LETTER EL
+    '\u041c'   #  0x008c -> CYRILLIC CAPITAL LETTER EM
+    '\u041d'   #  0x008d -> CYRILLIC CAPITAL LETTER EN
+    '\u041e'   #  0x008e -> CYRILLIC CAPITAL LETTER O
+    '\u041f'   #  0x008f -> CYRILLIC CAPITAL LETTER PE
+    '\u0420'   #  0x0090 -> CYRILLIC CAPITAL LETTER ER
+    '\u0421'   #  0x0091 -> CYRILLIC CAPITAL LETTER ES
+    '\u0422'   #  0x0092 -> CYRILLIC CAPITAL LETTER TE
+    '\u0423'   #  0x0093 -> CYRILLIC CAPITAL LETTER U
+    '\u0424'   #  0x0094 -> CYRILLIC CAPITAL LETTER EF
+    '\u0425'   #  0x0095 -> CYRILLIC CAPITAL LETTER HA
+    '\u0426'   #  0x0096 -> CYRILLIC CAPITAL LETTER TSE
+    '\u0427'   #  0x0097 -> CYRILLIC CAPITAL LETTER CHE
+    '\u0428'   #  0x0098 -> CYRILLIC CAPITAL LETTER SHA
+    '\u0429'   #  0x0099 -> CYRILLIC CAPITAL LETTER SHCHA
+    '\u042a'   #  0x009a -> CYRILLIC CAPITAL LETTER HARD SIGN
+    '\u042b'   #  0x009b -> CYRILLIC CAPITAL LETTER YERU
+    '\u042c'   #  0x009c -> CYRILLIC CAPITAL LETTER SOFT SIGN
+    '\u042d'   #  0x009d -> CYRILLIC CAPITAL LETTER E
+    '\u042e'   #  0x009e -> CYRILLIC CAPITAL LETTER YU
+    '\u042f'   #  0x009f -> CYRILLIC CAPITAL LETTER YA
+    '\u0430'   #  0x00a0 -> CYRILLIC SMALL LETTER A
+    '\u0431'   #  0x00a1 -> CYRILLIC SMALL LETTER BE
+    '\u0432'   #  0x00a2 -> CYRILLIC SMALL LETTER VE
+    '\u0433'   #  0x00a3 -> CYRILLIC SMALL LETTER GHE
+    '\u0434'   #  0x00a4 -> CYRILLIC SMALL LETTER DE
+    '\u0435'   #  0x00a5 -> CYRILLIC SMALL LETTER IE
+    '\u0436'   #  0x00a6 -> CYRILLIC SMALL LETTER ZHE
+    '\u0437'   #  0x00a7 -> CYRILLIC SMALL LETTER ZE
+    '\u0438'   #  0x00a8 -> CYRILLIC SMALL LETTER I
+    '\u0439'   #  0x00a9 -> CYRILLIC SMALL LETTER SHORT I
+    '\u043a'   #  0x00aa -> CYRILLIC SMALL LETTER KA
+    '\u043b'   #  0x00ab -> CYRILLIC SMALL LETTER EL
+    '\u043c'   #  0x00ac -> CYRILLIC SMALL LETTER EM
+    '\u043d'   #  0x00ad -> CYRILLIC SMALL LETTER EN
+    '\u043e'   #  0x00ae -> CYRILLIC SMALL LETTER O
+    '\u043f'   #  0x00af -> CYRILLIC SMALL LETTER PE
+    '\u2591'   #  0x00b0 -> LIGHT SHADE
+    '\u2592'   #  0x00b1 -> MEDIUM SHADE
+    '\u2593'   #  0x00b2 -> DARK SHADE
+    '\u2502'   #  0x00b3 -> BOX DRAWINGS LIGHT VERTICAL
+    '\u2524'   #  0x00b4 -> BOX DRAWINGS LIGHT VERTICAL AND LEFT
+    '\u2561'   #  0x00b5 -> BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
+    '\u2562'   #  0x00b6 -> BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
+    '\u2556'   #  0x00b7 -> BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
+    '\u2555'   #  0x00b8 -> BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
+    '\u2563'   #  0x00b9 -> BOX DRAWINGS DOUBLE VERTICAL AND LEFT
+    '\u2551'   #  0x00ba -> BOX DRAWINGS DOUBLE VERTICAL
+    '\u2557'   #  0x00bb -> BOX DRAWINGS DOUBLE DOWN AND LEFT
+    '\u255d'   #  0x00bc -> BOX DRAWINGS DOUBLE UP AND LEFT
+    '\u255c'   #  0x00bd -> BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
+    '\u255b'   #  0x00be -> BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
+    '\u2510'   #  0x00bf -> BOX DRAWINGS LIGHT DOWN AND LEFT
+    '\u2514'   #  0x00c0 -> BOX DRAWINGS LIGHT UP AND RIGHT
+    '\u2534'   #  0x00c1 -> BOX DRAWINGS LIGHT UP AND HORIZONTAL
+    '\u252c'   #  0x00c2 -> BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
+    '\u251c'   #  0x00c3 -> BOX DRAWINGS LIGHT VERTICAL AND RIGHT
+    '\u2500'   #  0x00c4 -> BOX DRAWINGS LIGHT HORIZONTAL
+    '\u253c'   #  0x00c5 -> BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
+    '\u255e'   #  0x00c6 -> BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
+    '\u255f'   #  0x00c7 -> BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
+    '\u255a'   #  0x00c8 -> BOX DRAWINGS DOUBLE UP AND RIGHT
+    '\u2554'   #  0x00c9 -> BOX DRAWINGS DOUBLE DOWN AND RIGHT
+    '\u2569'   #  0x00ca -> BOX DRAWINGS DOUBLE UP AND HORIZONTAL
+    '\u2566'   #  0x00cb -> BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
+    '\u2560'   #  0x00cc -> BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
+    '\u2550'   #  0x00cd -> BOX DRAWINGS DOUBLE HORIZONTAL
+    '\u256c'   #  0x00ce -> BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
+    '\u2567'   #  0x00cf -> BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
+    '\u2568'   #  0x00d0 -> BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
+    '\u2564'   #  0x00d1 -> BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
+    '\u2565'   #  0x00d2 -> BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
+    '\u2559'   #  0x00d3 -> BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
+    '\u2558'   #  0x00d4 -> BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
+    '\u2552'   #  0x00d5 -> BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
+    '\u2553'   #  0x00d6 -> BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
+    '\u256b'   #  0x00d7 -> BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
+    '\u256a'   #  0x00d8 -> BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
+    '\u2518'   #  0x00d9 -> BOX DRAWINGS LIGHT UP AND LEFT
+    '\u250c'   #  0x00da -> BOX DRAWINGS LIGHT DOWN AND RIGHT
+    '\u2588'   #  0x00db -> FULL BLOCK
+    '\u2584'   #  0x00dc -> LOWER HALF BLOCK
+    '\u258c'   #  0x00dd -> LEFT HALF BLOCK
+    '\u2590'   #  0x00de -> RIGHT HALF BLOCK
+    '\u2580'   #  0x00df -> UPPER HALF BLOCK
+    '\u0440'   #  0x00e0 -> CYRILLIC SMALL LETTER ER
+    '\u0441'   #  0x00e1 -> CYRILLIC SMALL LETTER ES
+    '\u0442'   #  0x00e2 -> CYRILLIC SMALL LETTER TE
+    '\u0443'   #  0x00e3 -> CYRILLIC SMALL LETTER U
+    '\u0444'   #  0x00e4 -> CYRILLIC SMALL LETTER EF
+    '\u0445'   #  0x00e5 -> CYRILLIC SMALL LETTER HA
+    '\u0446'   #  0x00e6 -> CYRILLIC SMALL LETTER TSE
+    '\u0447'   #  0x00e7 -> CYRILLIC SMALL LETTER CHE
+    '\u0448'   #  0x00e8 -> CYRILLIC SMALL LETTER SHA
+    '\u0449'   #  0x00e9 -> CYRILLIC SMALL LETTER SHCHA
+    '\u044a'   #  0x00ea -> CYRILLIC SMALL LETTER HARD SIGN
+    '\u044b'   #  0x00eb -> CYRILLIC SMALL LETTER YERU
+    '\u044c'   #  0x00ec -> CYRILLIC SMALL LETTER SOFT SIGN
+    '\u044d'   #  0x00ed -> CYRILLIC SMALL LETTER E
+    '\u044e'   #  0x00ee -> CYRILLIC SMALL LETTER YU
+    '\u044f'   #  0x00ef -> CYRILLIC SMALL LETTER YA
+    '\u0401'   #  0x00f0 -> CYRILLIC CAPITAL LETTER IO
+    '\u0451'   #  0x00f1 -> CYRILLIC SMALL LETTER IO
+    '\u0490'   #  0x00f2 -> CYRILLIC CAPITAL LETTER GHE WITH UPTURN
+    '\u0491'   #  0x00f3 -> CYRILLIC SMALL LETTER GHE WITH UPTURN
+    '\u0404'   #  0x00f4 -> CYRILLIC CAPITAL LETTER UKRAINIAN IE
+    '\u0454'   #  0x00f5 -> CYRILLIC SMALL LETTER UKRAINIAN IE
+    '\u0406'   #  0x00f6 -> CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I
+    '\u0456'   #  0x00f7 -> CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I
+    '\u0407'   #  0x00f8 -> CYRILLIC CAPITAL LETTER YI
+    '\u0457'   #  0x00f9 -> CYRILLIC SMALL LETTER YI
+    '\xb7'     #  0x00fa -> MIDDLE DOT
+    '\u221a'   #  0x00fb -> SQUARE ROOT
+    '\u2116'   #  0x00fc -> NUMERO SIGN
+    '\xa4'     #  0x00fd -> CURRENCY SIGN
+    '\u25a0'   #  0x00fe -> BLACK SQUARE
+    '\xa0'     #  0x00ff -> NO-BREAK SPACE
+)
+
+### Encoding Map
+
+encoding_map = {
+    0x0000: 0x0000,     #  NULL
+    0x0001: 0x0001,     #  START OF HEADING
+    0x0002: 0x0002,     #  START OF TEXT
+    0x0003: 0x0003,     #  END OF TEXT
+    0x0004: 0x0004,     #  END OF TRANSMISSION
+    0x0005: 0x0005,     #  ENQUIRY
+    0x0006: 0x0006,     #  ACKNOWLEDGE
+    0x0007: 0x0007,     #  BELL
+    0x0008: 0x0008,     #  BACKSPACE
+    0x0009: 0x0009,     #  HORIZONTAL TABULATION
+    0x000a: 0x000a,     #  LINE FEED
+    0x000b: 0x000b,     #  VERTICAL TABULATION
+    0x000c: 0x000c,     #  FORM FEED
+    0x000d: 0x000d,     #  CARRIAGE RETURN
+    0x000e: 0x000e,     #  SHIFT OUT
+    0x000f: 0x000f,     #  SHIFT IN
+    0x0010: 0x0010,     #  DATA LINK ESCAPE
+    0x0011: 0x0011,     #  DEVICE CONTROL ONE
+    0x0012: 0x0012,     #  DEVICE CONTROL TWO
+    0x0013: 0x0013,     #  DEVICE CONTROL THREE
+    0x0014: 0x0014,     #  DEVICE CONTROL FOUR
+    0x0015: 0x0015,     #  NEGATIVE ACKNOWLEDGE
+    0x0016: 0x0016,     #  SYNCHRONOUS IDLE
+    0x0017: 0x0017,     #  END OF TRANSMISSION BLOCK
+    0x0018: 0x0018,     #  CANCEL
+    0x0019: 0x0019,     #  END OF MEDIUM
+    0x001a: 0x001a,     #  SUBSTITUTE
+    0x001b: 0x001b,     #  ESCAPE
+    0x001c: 0x001c,     #  FILE SEPARATOR
+    0x001d: 0x001d,     #  GROUP SEPARATOR
+    0x001e: 0x001e,     #  RECORD SEPARATOR
+    0x001f: 0x001f,     #  UNIT SEPARATOR
+    0x0020: 0x0020,     #  SPACE
+    0x0021: 0x0021,     #  EXCLAMATION MARK
+    0x0022: 0x0022,     #  QUOTATION MARK
+    0x0023: 0x0023,     #  NUMBER SIGN
+    0x0024: 0x0024,     #  DOLLAR SIGN
+    0x0025: 0x0025,     #  PERCENT SIGN
+    0x0026: 0x0026,     #  AMPERSAND
+    0x0027: 0x0027,     #  APOSTROPHE
+    0x0028: 0x0028,     #  LEFT PARENTHESIS
+    0x0029: 0x0029,     #  RIGHT PARENTHESIS
+    0x002a: 0x002a,     #  ASTERISK
+    0x002b: 0x002b,     #  PLUS SIGN
+    0x002c: 0x002c,     #  COMMA
+    0x002d: 0x002d,     #  HYPHEN-MINUS
+    0x002e: 0x002e,     #  FULL STOP
+    0x002f: 0x002f,     #  SOLIDUS
+    0x0030: 0x0030,     #  DIGIT ZERO
+    0x0031: 0x0031,     #  DIGIT ONE
+    0x0032: 0x0032,     #  DIGIT TWO
+    0x0033: 0x0033,     #  DIGIT THREE
+    0x0034: 0x0034,     #  DIGIT FOUR
+    0x0035: 0x0035,     #  DIGIT FIVE
+    0x0036: 0x0036,     #  DIGIT SIX
+    0x0037: 0x0037,     #  DIGIT SEVEN
+    0x0038: 0x0038,     #  DIGIT EIGHT
+    0x0039: 0x0039,     #  DIGIT NINE
+    0x003a: 0x003a,     #  COLON
+    0x003b: 0x003b,     #  SEMICOLON
+    0x003c: 0x003c,     #  LESS-THAN SIGN
+    0x003d: 0x003d,     #  EQUALS SIGN
+    0x003e: 0x003e,     #  GREATER-THAN SIGN
+    0x003f: 0x003f,     #  QUESTION MARK
+    0x0040: 0x0040,     #  COMMERCIAL AT
+    0x0041: 0x0041,     #  LATIN CAPITAL LETTER A
+    0x0042: 0x0042,     #  LATIN CAPITAL LETTER B
+    0x0043: 0x0043,     #  LATIN CAPITAL LETTER C
+    0x0044: 0x0044,     #  LATIN CAPITAL LETTER D
+    0x0045: 0x0045,     #  LATIN CAPITAL LETTER E
+    0x0046: 0x0046,     #  LATIN CAPITAL LETTER F
+    0x0047: 0x0047,     #  LATIN CAPITAL LETTER G
+    0x0048: 0x0048,     #  LATIN CAPITAL LETTER H
+    0x0049: 0x0049,     #  LATIN CAPITAL LETTER I
+    0x004a: 0x004a,     #  LATIN CAPITAL LETTER J
+    0x004b: 0x004b,     #  LATIN CAPITAL LETTER K
+    0x004c: 0x004c,     #  LATIN CAPITAL LETTER L
+    0x004d: 0x004d,     #  LATIN CAPITAL LETTER M
+    0x004e: 0x004e,     #  LATIN CAPITAL LETTER N
+    0x004f: 0x004f,     #  LATIN CAPITAL LETTER O
+    0x0050: 0x0050,     #  LATIN CAPITAL LETTER P
+    0x0051: 0x0051,     #  LATIN CAPITAL LETTER Q
+    0x0052: 0x0052,     #  LATIN CAPITAL LETTER R
+    0x0053: 0x0053,     #  LATIN CAPITAL LETTER S
+    0x0054: 0x0054,     #  LATIN CAPITAL LETTER T
+    0x0055: 0x0055,     #  LATIN CAPITAL LETTER U
+    0x0056: 0x0056,     #  LATIN CAPITAL LETTER V
+    0x0057: 0x0057,     #  LATIN CAPITAL LETTER W
+    0x0058: 0x0058,     #  LATIN CAPITAL LETTER X
+    0x0059: 0x0059,     #  LATIN CAPITAL LETTER Y
+    0x005a: 0x005a,     #  LATIN CAPITAL LETTER Z
+    0x005b: 0x005b,     #  LEFT SQUARE BRACKET
+    0x005c: 0x005c,     #  REVERSE SOLIDUS
+    0x005d: 0x005d,     #  RIGHT SQUARE BRACKET
+    0x005e: 0x005e,     #  CIRCUMFLEX ACCENT
+    0x005f: 0x005f,     #  LOW LINE
+    0x0060: 0x0060,     #  GRAVE ACCENT
+    0x0061: 0x0061,     #  LATIN SMALL LETTER A
+    0x0062: 0x0062,     #  LATIN SMALL LETTER B
+    0x0063: 0x0063,     #  LATIN SMALL LETTER C
+    0x0064: 0x0064,     #  LATIN SMALL LETTER D
+    0x0065: 0x0065,     #  LATIN SMALL LETTER E
+    0x0066: 0x0066,     #  LATIN SMALL LETTER F
+    0x0067: 0x0067,     #  LATIN SMALL LETTER G
+    0x0068: 0x0068,     #  LATIN SMALL LETTER H
+    0x0069: 0x0069,     #  LATIN SMALL LETTER I
+    0x006a: 0x006a,     #  LATIN SMALL LETTER J
+    0x006b: 0x006b,     #  LATIN SMALL LETTER K
+    0x006c: 0x006c,     #  LATIN SMALL LETTER L
+    0x006d: 0x006d,     #  LATIN SMALL LETTER M
+    0x006e: 0x006e,     #  LATIN SMALL LETTER N
+    0x006f: 0x006f,     #  LATIN SMALL LETTER O
+    0x0070: 0x0070,     #  LATIN SMALL LETTER P
+    0x0071: 0x0071,     #  LATIN SMALL LETTER Q
+    0x0072: 0x0072,     #  LATIN SMALL LETTER R
+    0x0073: 0x0073,     #  LATIN SMALL LETTER S
+    0x0074: 0x0074,     #  LATIN SMALL LETTER T
+    0x0075: 0x0075,     #  LATIN SMALL LETTER U
+    0x0076: 0x0076,     #  LATIN SMALL LETTER V
+    0x0077: 0x0077,     #  LATIN SMALL LETTER W
+    0x0078: 0x0078,     #  LATIN SMALL LETTER X
+    0x0079: 0x0079,     #  LATIN SMALL LETTER Y
+    0x007a: 0x007a,     #  LATIN SMALL LETTER Z
+    0x007b: 0x007b,     #  LEFT CURLY BRACKET
+    0x007c: 0x007c,     #  VERTICAL LINE
+    0x007d: 0x007d,     #  RIGHT CURLY BRACKET
+    0x007e: 0x007e,     #  TILDE
+    0x007f: 0x007f,     #  DELETE
+    0x00a0: 0x00ff,     #  NO-BREAK SPACE
+    0x00a4: 0x00fd,     #  CURRENCY SIGN
+    0x00b7: 0x00fa,     #  MIDDLE DOT
+    0x0401: 0x00f0,     #  CYRILLIC CAPITAL LETTER IO
+    0x0404: 0x00f4,     #  CYRILLIC CAPITAL LETTER UKRAINIAN IE
+    0x0406: 0x00f6,     #  CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I
+    0x0407: 0x00f8,     #  CYRILLIC CAPITAL LETTER YI
+    0x0410: 0x0080,     #  CYRILLIC CAPITAL LETTER A
+    0x0411: 0x0081,     #  CYRILLIC CAPITAL LETTER BE
+    0x0412: 0x0082,     #  CYRILLIC CAPITAL LETTER VE
+    0x0413: 0x0083,     #  CYRILLIC CAPITAL LETTER GHE
+    0x0414: 0x0084,     #  CYRILLIC CAPITAL LETTER DE
+    0x0415: 0x0085,     #  CYRILLIC CAPITAL LETTER IE
+    0x0416: 0x0086,     #  CYRILLIC CAPITAL LETTER ZHE
+    0x0417: 0x0087,     #  CYRILLIC CAPITAL LETTER ZE
+    0x0418: 0x0088,     #  CYRILLIC CAPITAL LETTER I
+    0x0419: 0x0089,     #  CYRILLIC CAPITAL LETTER SHORT I
+    0x041a: 0x008a,     #  CYRILLIC CAPITAL LETTER KA
+    0x041b: 0x008b,     #  CYRILLIC CAPITAL LETTER EL
+    0x041c: 0x008c,     #  CYRILLIC CAPITAL LETTER EM
+    0x041d: 0x008d,     #  CYRILLIC CAPITAL LETTER EN
+    0x041e: 0x008e,     #  CYRILLIC CAPITAL LETTER O
+    0x041f: 0x008f,     #  CYRILLIC CAPITAL LETTER PE
+    0x0420: 0x0090,     #  CYRILLIC CAPITAL LETTER ER
+    0x0421: 0x0091,     #  CYRILLIC CAPITAL LETTER ES
+    0x0422: 0x0092,     #  CYRILLIC CAPITAL LETTER TE
+    0x0423: 0x0093,     #  CYRILLIC CAPITAL LETTER U
+    0x0424: 0x0094,     #  CYRILLIC CAPITAL LETTER EF
+    0x0425: 0x0095,     #  CYRILLIC CAPITAL LETTER HA
+    0x0426: 0x0096,     #  CYRILLIC CAPITAL LETTER TSE
+    0x0427: 0x0097,     #  CYRILLIC CAPITAL LETTER CHE
+    0x0428: 0x0098,     #  CYRILLIC CAPITAL LETTER SHA
+    0x0429: 0x0099,     #  CYRILLIC CAPITAL LETTER SHCHA
+    0x042a: 0x009a,     #  CYRILLIC CAPITAL LETTER HARD SIGN
+    0x042b: 0x009b,     #  CYRILLIC CAPITAL LETTER YERU
+    0x042c: 0x009c,     #  CYRILLIC CAPITAL LETTER SOFT SIGN
+    0x042d: 0x009d,     #  CYRILLIC CAPITAL LETTER E
+    0x042e: 0x009e,     #  CYRILLIC CAPITAL LETTER YU
+    0x042f: 0x009f,     #  CYRILLIC CAPITAL LETTER YA
+    0x0430: 0x00a0,     #  CYRILLIC SMALL LETTER A
+    0x0431: 0x00a1,     #  CYRILLIC SMALL LETTER BE
+    0x0432: 0x00a2,     #  CYRILLIC SMALL LETTER VE
+    0x0433: 0x00a3,     #  CYRILLIC SMALL LETTER GHE
+    0x0434: 0x00a4,     #  CYRILLIC SMALL LETTER DE
+    0x0435: 0x00a5,     #  CYRILLIC SMALL LETTER IE
+    0x0436: 0x00a6,     #  CYRILLIC SMALL LETTER ZHE
+    0x0437: 0x00a7,     #  CYRILLIC SMALL LETTER ZE
+    0x0438: 0x00a8,     #  CYRILLIC SMALL LETTER I
+    0x0439: 0x00a9,     #  CYRILLIC SMALL LETTER SHORT I
+    0x043a: 0x00aa,     #  CYRILLIC SMALL LETTER KA
+    0x043b: 0x00ab,     #  CYRILLIC SMALL LETTER EL
+    0x043c: 0x00ac,     #  CYRILLIC SMALL LETTER EM
+    0x043d: 0x00ad,     #  CYRILLIC SMALL LETTER EN
+    0x043e: 0x00ae,     #  CYRILLIC SMALL LETTER O
+    0x043f: 0x00af,     #  CYRILLIC SMALL LETTER PE
+    0x0440: 0x00e0,     #  CYRILLIC SMALL LETTER ER
+    0x0441: 0x00e1,     #  CYRILLIC SMALL LETTER ES
+    0x0442: 0x00e2,     #  CYRILLIC SMALL LETTER TE
+    0x0443: 0x00e3,     #  CYRILLIC SMALL LETTER U
+    0x0444: 0x00e4,     #  CYRILLIC SMALL LETTER EF
+    0x0445: 0x00e5,     #  CYRILLIC SMALL LETTER HA
+    0x0446: 0x00e6,     #  CYRILLIC SMALL LETTER TSE
+    0x0447: 0x00e7,     #  CYRILLIC SMALL LETTER CHE
+    0x0448: 0x00e8,     #  CYRILLIC SMALL LETTER SHA
+    0x0449: 0x00e9,     #  CYRILLIC SMALL LETTER SHCHA
+    0x044a: 0x00ea,     #  CYRILLIC SMALL LETTER HARD SIGN
+    0x044b: 0x00eb,     #  CYRILLIC SMALL LETTER YERU
+    0x044c: 0x00ec,     #  CYRILLIC SMALL LETTER SOFT SIGN
+    0x044d: 0x00ed,     #  CYRILLIC SMALL LETTER E
+    0x044e: 0x00ee,     #  CYRILLIC SMALL LETTER YU
+    0x044f: 0x00ef,     #  CYRILLIC SMALL LETTER YA
+    0x0451: 0x00f1,     #  CYRILLIC SMALL LETTER IO
+    0x0454: 0x00f5,     #  CYRILLIC SMALL LETTER UKRAINIAN IE
+    0x0456: 0x00f7,     #  CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I
+    0x0457: 0x00f9,     #  CYRILLIC SMALL LETTER YI
+    0x0490: 0x00f2,     #  CYRILLIC CAPITAL LETTER GHE WITH UPTURN
+    0x0491: 0x00f3,     #  CYRILLIC SMALL LETTER GHE WITH UPTURN
+    0x2116: 0x00fc,     #  NUMERO SIGN
+    0x221a: 0x00fb,     #  SQUARE ROOT
+    0x2500: 0x00c4,     #  BOX DRAWINGS LIGHT HORIZONTAL
+    0x2502: 0x00b3,     #  BOX DRAWINGS LIGHT VERTICAL
+    0x250c: 0x00da,     #  BOX DRAWINGS LIGHT DOWN AND RIGHT
+    0x2510: 0x00bf,     #  BOX DRAWINGS LIGHT DOWN AND LEFT
+    0x2514: 0x00c0,     #  BOX DRAWINGS LIGHT UP AND RIGHT
+    0x2518: 0x00d9,     #  BOX DRAWINGS LIGHT UP AND LEFT
+    0x251c: 0x00c3,     #  BOX DRAWINGS LIGHT VERTICAL AND RIGHT
+    0x2524: 0x00b4,     #  BOX DRAWINGS LIGHT VERTICAL AND LEFT
+    0x252c: 0x00c2,     #  BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
+    0x2534: 0x00c1,     #  BOX DRAWINGS LIGHT UP AND HORIZONTAL
+    0x253c: 0x00c5,     #  BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
+    0x2550: 0x00cd,     #  BOX DRAWINGS DOUBLE HORIZONTAL
+    0x2551: 0x00ba,     #  BOX DRAWINGS DOUBLE VERTICAL
+    0x2552: 0x00d5,     #  BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
+    0x2553: 0x00d6,     #  BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
+    0x2554: 0x00c9,     #  BOX DRAWINGS DOUBLE DOWN AND RIGHT
+    0x2555: 0x00b8,     #  BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
+    0x2556: 0x00b7,     #  BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
+    0x2557: 0x00bb,     #  BOX DRAWINGS DOUBLE DOWN AND LEFT
+    0x2558: 0x00d4,     #  BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
+    0x2559: 0x00d3,     #  BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
+    0x255a: 0x00c8,     #  BOX DRAWINGS DOUBLE UP AND RIGHT
+    0x255b: 0x00be,     #  BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
+    0x255c: 0x00bd,     #  BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
+    0x255d: 0x00bc,     #  BOX DRAWINGS DOUBLE UP AND LEFT
+    0x255e: 0x00c6,     #  BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
+    0x255f: 0x00c7,     #  BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
+    0x2560: 0x00cc,     #  BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
+    0x2561: 0x00b5,     #  BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
+    0x2562: 0x00b6,     #  BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
+    0x2563: 0x00b9,     #  BOX DRAWINGS DOUBLE VERTICAL AND LEFT
+    0x2564: 0x00d1,     #  BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
+    0x2565: 0x00d2,     #  BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
+    0x2566: 0x00cb,     #  BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
+    0x2567: 0x00cf,     #  BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
+    0x2568: 0x00d0,     #  BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
+    0x2569: 0x00ca,     #  BOX DRAWINGS DOUBLE UP AND HORIZONTAL
+    0x256a: 0x00d8,     #  BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
+    0x256b: 0x00d7,     #  BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
+    0x256c: 0x00ce,     #  BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
+    0x2580: 0x00df,     #  UPPER HALF BLOCK
+    0x2584: 0x00dc,     #  LOWER HALF BLOCK
+    0x2588: 0x00db,     #  FULL BLOCK
+    0x258c: 0x00dd,     #  LEFT HALF BLOCK
+    0x2590: 0x00de,     #  RIGHT HALF BLOCK
+    0x2591: 0x00b0,     #  LIGHT SHADE
+    0x2592: 0x00b1,     #  MEDIUM SHADE
+    0x2593: 0x00b2,     #  DARK SHADE
+    0x25a0: 0x00fe,     #  BLACK SQUARE
+}
diff --git a/Lib/encodings/cp273.py b/Lib/encodings/cp273.py
new file mode 100644
index 0000000..69c6d77
--- /dev/null
+++ b/Lib/encodings/cp273.py
@@ -0,0 +1,307 @@
+""" Python Character Mapping Codec cp273 generated from 'python-mappings/CP273.TXT' with gencodec.py.
+
+"""#"
+
+import codecs
+
+### Codec APIs
+
+class Codec(codecs.Codec):
+
+    def encode(self,input,errors='strict'):
+        return codecs.charmap_encode(input,errors,encoding_table)
+
+    def decode(self,input,errors='strict'):
+        return codecs.charmap_decode(input,errors,decoding_table)
+
+class IncrementalEncoder(codecs.IncrementalEncoder):
+    def encode(self, input, final=False):
+        return codecs.charmap_encode(input,self.errors,encoding_table)[0]
+
+class IncrementalDecoder(codecs.IncrementalDecoder):
+    def decode(self, input, final=False):
+        return codecs.charmap_decode(input,self.errors,decoding_table)[0]
+
+class StreamWriter(Codec,codecs.StreamWriter):
+    pass
+
+class StreamReader(Codec,codecs.StreamReader):
+    pass
+
+### encodings module API
+
+def getregentry():
+    return codecs.CodecInfo(
+        name='cp273',
+        encode=Codec().encode,
+        decode=Codec().decode,
+        incrementalencoder=IncrementalEncoder,
+        incrementaldecoder=IncrementalDecoder,
+        streamreader=StreamReader,
+        streamwriter=StreamWriter,
+    )
+
+
+### Decoding Table
+
+decoding_table = (
+    '\x00'      #  0x00 -> NULL (NUL)
+    '\x01'      #  0x01 -> START OF HEADING (SOH)
+    '\x02'      #  0x02 -> START OF TEXT (STX)
+    '\x03'      #  0x03 -> END OF TEXT (ETX)
+    '\x9c'      #  0x04 -> STRING TERMINATOR (ST)
+    '\t'        #  0x05 -> CHARACTER TABULATION (HT)
+    '\x86'      #  0x06 -> START OF SELECTED AREA (SSA)
+    '\x7f'      #  0x07 -> DELETE (DEL)
+    '\x97'      #  0x08 -> END OF GUARDED AREA (EPA)
+    '\x8d'      #  0x09 -> REVERSE LINE FEED (RI)
+    '\x8e'      #  0x0A -> SINGLE-SHIFT TWO (SS2)
+    '\x0b'      #  0x0B -> LINE TABULATION (VT)
+    '\x0c'      #  0x0C -> FORM FEED (FF)
+    '\r'        #  0x0D -> CARRIAGE RETURN (CR)
+    '\x0e'      #  0x0E -> SHIFT OUT (SO)
+    '\x0f'      #  0x0F -> SHIFT IN (SI)
+    '\x10'      #  0x10 -> DATALINK ESCAPE (DLE)
+    '\x11'      #  0x11 -> DEVICE CONTROL ONE (DC1)
+    '\x12'      #  0x12 -> DEVICE CONTROL TWO (DC2)
+    '\x13'      #  0x13 -> DEVICE CONTROL THREE (DC3)
+    '\x9d'      #  0x14 -> OPERATING SYSTEM COMMAND (OSC)
+    '\x85'      #  0x15 -> NEXT LINE (NEL)
+    '\x08'      #  0x16 -> BACKSPACE (BS)
+    '\x87'      #  0x17 -> END OF SELECTED AREA (ESA)
+    '\x18'      #  0x18 -> CANCEL (CAN)
+    '\x19'      #  0x19 -> END OF MEDIUM (EM)
+    '\x92'      #  0x1A -> PRIVATE USE TWO (PU2)
+    '\x8f'      #  0x1B -> SINGLE-SHIFT THREE (SS3)
+    '\x1c'      #  0x1C -> FILE SEPARATOR (IS4)
+    '\x1d'      #  0x1D -> GROUP SEPARATOR (IS3)
+    '\x1e'      #  0x1E -> RECORD SEPARATOR (IS2)
+    '\x1f'      #  0x1F -> UNIT SEPARATOR (IS1)
+    '\x80'      #  0x20 -> PADDING CHARACTER (PAD)
+    '\x81'      #  0x21 -> HIGH OCTET PRESET (HOP)
+    '\x82'      #  0x22 -> BREAK PERMITTED HERE (BPH)
+    '\x83'      #  0x23 -> NO BREAK HERE (NBH)
+    '\x84'      #  0x24 -> INDEX (IND)
+    '\n'        #  0x25 -> LINE FEED (LF)
+    '\x17'      #  0x26 -> END OF TRANSMISSION BLOCK (ETB)
+    '\x1b'      #  0x27 -> ESCAPE (ESC)
+    '\x88'      #  0x28 -> CHARACTER TABULATION SET (HTS)
+    '\x89'      #  0x29 -> CHARACTER TABULATION WITH JUSTIFICATION (HTJ)
+    '\x8a'      #  0x2A -> LINE TABULATION SET (VTS)
+    '\x8b'      #  0x2B -> PARTIAL LINE FORWARD (PLD)
+    '\x8c'      #  0x2C -> PARTIAL LINE BACKWARD (PLU)
+    '\x05'      #  0x2D -> ENQUIRY (ENQ)
+    '\x06'      #  0x2E -> ACKNOWLEDGE (ACK)
+    '\x07'      #  0x2F -> BELL (BEL)
+    '\x90'      #  0x30 -> DEVICE CONTROL STRING (DCS)
+    '\x91'      #  0x31 -> PRIVATE USE ONE (PU1)
+    '\x16'      #  0x32 -> SYNCHRONOUS IDLE (SYN)
+    '\x93'      #  0x33 -> SET TRANSMIT STATE (STS)
+    '\x94'      #  0x34 -> CANCEL CHARACTER (CCH)
+    '\x95'      #  0x35 -> MESSAGE WAITING (MW)
+    '\x96'      #  0x36 -> START OF GUARDED AREA (SPA)
+    '\x04'      #  0x37 -> END OF TRANSMISSION (EOT)
+    '\x98'      #  0x38 -> START OF STRING (SOS)
+    '\x99'      #  0x39 -> SINGLE GRAPHIC CHARACTER INTRODUCER (SGCI)
+    '\x9a'      #  0x3A -> SINGLE CHARACTER INTRODUCER (SCI)
+    '\x9b'      #  0x3B -> CONTROL SEQUENCE INTRODUCER (CSI)
+    '\x14'      #  0x3C -> DEVICE CONTROL FOUR (DC4)
+    '\x15'      #  0x3D -> NEGATIVE ACKNOWLEDGE (NAK)
+    '\x9e'      #  0x3E -> PRIVACY MESSAGE (PM)
+    '\x1a'      #  0x3F -> SUBSTITUTE (SUB)
+    ' '         #  0x40 -> SPACE
+    '\xa0'      #  0x41 -> NO-BREAK SPACE
+    '\xe2'      #  0x42 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
+    '{'         #  0x43 -> LEFT CURLY BRACKET
+    '\xe0'      #  0x44 -> LATIN SMALL LETTER A WITH GRAVE
+    '\xe1'      #  0x45 -> LATIN SMALL LETTER A WITH ACUTE
+    '\xe3'      #  0x46 -> LATIN SMALL LETTER A WITH TILDE
+    '\xe5'      #  0x47 -> LATIN SMALL LETTER A WITH RING ABOVE
+    '\xe7'      #  0x48 -> LATIN SMALL LETTER C WITH CEDILLA
+    '\xf1'      #  0x49 -> LATIN SMALL LETTER N WITH TILDE
+    '\xc4'      #  0x4A -> LATIN CAPITAL LETTER A WITH DIAERESIS
+    '.'         #  0x4B -> FULL STOP
+    '<'         #  0x4C -> LESS-THAN SIGN
+    '('         #  0x4D -> LEFT PARENTHESIS
+    '+'         #  0x4E -> PLUS SIGN
+    '!'         #  0x4F -> EXCLAMATION MARK
+    '&'         #  0x50 -> AMPERSAND
+    '\xe9'      #  0x51 -> LATIN SMALL LETTER E WITH ACUTE
+    '\xea'      #  0x52 -> LATIN SMALL LETTER E WITH CIRCUMFLEX
+    '\xeb'      #  0x53 -> LATIN SMALL LETTER E WITH DIAERESIS
+    '\xe8'      #  0x54 -> LATIN SMALL LETTER E WITH GRAVE
+    '\xed'      #  0x55 -> LATIN SMALL LETTER I WITH ACUTE
+    '\xee'      #  0x56 -> LATIN SMALL LETTER I WITH CIRCUMFLEX
+    '\xef'      #  0x57 -> LATIN SMALL LETTER I WITH DIAERESIS
+    '\xec'      #  0x58 -> LATIN SMALL LETTER I WITH GRAVE
+    '~'         #  0x59 -> TILDE
+    '\xdc'      #  0x5A -> LATIN CAPITAL LETTER U WITH DIAERESIS
+    '$'         #  0x5B -> DOLLAR SIGN
+    '*'         #  0x5C -> ASTERISK
+    ')'         #  0x5D -> RIGHT PARENTHESIS
+    ';'         #  0x5E -> SEMICOLON
+    '^'         #  0x5F -> CIRCUMFLEX ACCENT
+    '-'         #  0x60 -> HYPHEN-MINUS
+    '/'         #  0x61 -> SOLIDUS
+    '\xc2'      #  0x62 -> LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+    '['         #  0x63 -> LEFT SQUARE BRACKET
+    '\xc0'      #  0x64 -> LATIN CAPITAL LETTER A WITH GRAVE
+    '\xc1'      #  0x65 -> LATIN CAPITAL LETTER A WITH ACUTE
+    '\xc3'      #  0x66 -> LATIN CAPITAL LETTER A WITH TILDE
+    '\xc5'      #  0x67 -> LATIN CAPITAL LETTER A WITH RING ABOVE
+    '\xc7'      #  0x68 -> LATIN CAPITAL LETTER C WITH CEDILLA
+    '\xd1'      #  0x69 -> LATIN CAPITAL LETTER N WITH TILDE
+    '\xf6'      #  0x6A -> LATIN SMALL LETTER O WITH DIAERESIS
+    ','         #  0x6B -> COMMA
+    '%'         #  0x6C -> PERCENT SIGN
+    '_'         #  0x6D -> LOW LINE
+    '>'         #  0x6E -> GREATER-THAN SIGN
+    '?'         #  0x6F -> QUESTION MARK
+    '\xf8'      #  0x70 -> LATIN SMALL LETTER O WITH STROKE
+    '\xc9'      #  0x71 -> LATIN CAPITAL LETTER E WITH ACUTE
+    '\xca'      #  0x72 -> LATIN CAPITAL LETTER E WITH CIRCUMFLEX
+    '\xcb'      #  0x73 -> LATIN CAPITAL LETTER E WITH DIAERESIS
+    '\xc8'      #  0x74 -> LATIN CAPITAL LETTER E WITH GRAVE
+    '\xcd'      #  0x75 -> LATIN CAPITAL LETTER I WITH ACUTE
+    '\xce'      #  0x76 -> LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+    '\xcf'      #  0x77 -> LATIN CAPITAL LETTER I WITH DIAERESIS
+    '\xcc'      #  0x78 -> LATIN CAPITAL LETTER I WITH GRAVE
+    '`'         #  0x79 -> GRAVE ACCENT
+    ':'         #  0x7A -> COLON
+    '#'         #  0x7B -> NUMBER SIGN
+    '\xa7'      #  0x7C -> SECTION SIGN
+    "'"         #  0x7D -> APOSTROPHE
+    '='         #  0x7E -> EQUALS SIGN
+    '"'         #  0x7F -> QUOTATION MARK
+    '\xd8'      #  0x80 -> LATIN CAPITAL LETTER O WITH STROKE
+    'a'         #  0x81 -> LATIN SMALL LETTER A
+    'b'         #  0x82 -> LATIN SMALL LETTER B
+    'c'         #  0x83 -> LATIN SMALL LETTER C
+    'd'         #  0x84 -> LATIN SMALL LETTER D
+    'e'         #  0x85 -> LATIN SMALL LETTER E
+    'f'         #  0x86 -> LATIN SMALL LETTER F
+    'g'         #  0x87 -> LATIN SMALL LETTER G
+    'h'         #  0x88 -> LATIN SMALL LETTER H
+    'i'         #  0x89 -> LATIN SMALL LETTER I
+    '\xab'      #  0x8A -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+    '\xbb'      #  0x8B -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+    '\xf0'      #  0x8C -> LATIN SMALL LETTER ETH (Icelandic)
+    '\xfd'      #  0x8D -> LATIN SMALL LETTER Y WITH ACUTE
+    '\xfe'      #  0x8E -> LATIN SMALL LETTER THORN (Icelandic)
+    '\xb1'      #  0x8F -> PLUS-MINUS SIGN
+    '\xb0'      #  0x90 -> DEGREE SIGN
+    'j'         #  0x91 -> LATIN SMALL LETTER J
+    'k'         #  0x92 -> LATIN SMALL LETTER K
+    'l'         #  0x93 -> LATIN SMALL LETTER L
+    'm'         #  0x94 -> LATIN SMALL LETTER M
+    'n'         #  0x95 -> LATIN SMALL LETTER N
+    'o'         #  0x96 -> LATIN SMALL LETTER O
+    'p'         #  0x97 -> LATIN SMALL LETTER P
+    'q'         #  0x98 -> LATIN SMALL LETTER Q
+    'r'         #  0x99 -> LATIN SMALL LETTER R
+    '\xaa'      #  0x9A -> FEMININE ORDINAL INDICATOR
+    '\xba'      #  0x9B -> MASCULINE ORDINAL INDICATOR
+    '\xe6'      #  0x9C -> LATIN SMALL LETTER AE
+    '\xb8'      #  0x9D -> CEDILLA
+    '\xc6'      #  0x9E -> LATIN CAPITAL LETTER AE
+    '\xa4'      #  0x9F -> CURRENCY SIGN
+    '\xb5'      #  0xA0 -> MICRO SIGN
+    '\xdf'      #  0xA1 -> LATIN SMALL LETTER SHARP S (German)
+    's'         #  0xA2 -> LATIN SMALL LETTER S
+    't'         #  0xA3 -> LATIN SMALL LETTER T
+    'u'         #  0xA4 -> LATIN SMALL LETTER U
+    'v'         #  0xA5 -> LATIN SMALL LETTER V
+    'w'         #  0xA6 -> LATIN SMALL LETTER W
+    'x'         #  0xA7 -> LATIN SMALL LETTER X
+    'y'         #  0xA8 -> LATIN SMALL LETTER Y
+    'z'         #  0xA9 -> LATIN SMALL LETTER Z
+    '\xa1'      #  0xAA -> INVERTED EXCLAMATION MARK
+    '\xbf'      #  0xAB -> INVERTED QUESTION MARK
+    '\xd0'      #  0xAC -> LATIN CAPITAL LETTER ETH (Icelandic)
+    '\xdd'      #  0xAD -> LATIN CAPITAL LETTER Y WITH ACUTE
+    '\xde'      #  0xAE -> LATIN CAPITAL LETTER THORN (Icelandic)
+    '\xae'      #  0xAF -> REGISTERED SIGN
+    '\xa2'      #  0xB0 -> CENT SIGN
+    '\xa3'      #  0xB1 -> POUND SIGN
+    '\xa5'      #  0xB2 -> YEN SIGN
+    '\xb7'      #  0xB3 -> MIDDLE DOT
+    '\xa9'      #  0xB4 -> COPYRIGHT SIGN
+    '@'         #  0xB5 -> COMMERCIAL AT
+    '\xb6'      #  0xB6 -> PILCROW SIGN
+    '\xbc'      #  0xB7 -> VULGAR FRACTION ONE QUARTER
+    '\xbd'      #  0xB8 -> VULGAR FRACTION ONE HALF
+    '\xbe'      #  0xB9 -> VULGAR FRACTION THREE QUARTERS
+    '\xac'      #  0xBA -> NOT SIGN
+    '|'         #  0xBB -> VERTICAL LINE
+    '\u203e'    #  0xBC -> OVERLINE
+    '\xa8'      #  0xBD -> DIAERESIS
+    '\xb4'      #  0xBE -> ACUTE ACCENT
+    '\xd7'      #  0xBF -> MULTIPLICATION SIGN
+    '\xe4'      #  0xC0 -> LATIN SMALL LETTER A WITH DIAERESIS
+    'A'         #  0xC1 -> LATIN CAPITAL LETTER A
+    'B'         #  0xC2 -> LATIN CAPITAL LETTER B
+    'C'         #  0xC3 -> LATIN CAPITAL LETTER C
+    'D'         #  0xC4 -> LATIN CAPITAL LETTER D
+    'E'         #  0xC5 -> LATIN CAPITAL LETTER E
+    'F'         #  0xC6 -> LATIN CAPITAL LETTER F
+    'G'         #  0xC7 -> LATIN CAPITAL LETTER G
+    'H'         #  0xC8 -> LATIN CAPITAL LETTER H
+    'I'         #  0xC9 -> LATIN CAPITAL LETTER I
+    '\xad'      #  0xCA -> SOFT HYPHEN
+    '\xf4'      #  0xCB -> LATIN SMALL LETTER O WITH CIRCUMFLEX
+    '\xa6'      #  0xCC -> BROKEN BAR
+    '\xf2'      #  0xCD -> LATIN SMALL LETTER O WITH GRAVE
+    '\xf3'      #  0xCE -> LATIN SMALL LETTER O WITH ACUTE
+    '\xf5'      #  0xCF -> LATIN SMALL LETTER O WITH TILDE
+    '\xfc'      #  0xD0 -> LATIN SMALL LETTER U WITH DIAERESIS
+    'J'         #  0xD1 -> LATIN CAPITAL LETTER J
+    'K'         #  0xD2 -> LATIN CAPITAL LETTER K
+    'L'         #  0xD3 -> LATIN CAPITAL LETTER L
+    'M'         #  0xD4 -> LATIN CAPITAL LETTER M
+    'N'         #  0xD5 -> LATIN CAPITAL LETTER N
+    'O'         #  0xD6 -> LATIN CAPITAL LETTER O
+    'P'         #  0xD7 -> LATIN CAPITAL LETTER P
+    'Q'         #  0xD8 -> LATIN CAPITAL LETTER Q
+    'R'         #  0xD9 -> LATIN CAPITAL LETTER R
+    '\xb9'      #  0xDA -> SUPERSCRIPT ONE
+    '\xfb'      #  0xDB -> LATIN SMALL LETTER U WITH CIRCUMFLEX
+    '}'         #  0xDC -> RIGHT CURLY BRACKET
+    '\xf9'      #  0xDD -> LATIN SMALL LETTER U WITH GRAVE
+    '\xfa'      #  0xDE -> LATIN SMALL LETTER U WITH ACUTE
+    '\xff'      #  0xDF -> LATIN SMALL LETTER Y WITH DIAERESIS
+    '\xd6'      #  0xE0 -> LATIN CAPITAL LETTER O WITH DIAERESIS
+    '\xf7'      #  0xE1 -> DIVISION SIGN
+    'S'         #  0xE2 -> LATIN CAPITAL LETTER S
+    'T'         #  0xE3 -> LATIN CAPITAL LETTER T
+    'U'         #  0xE4 -> LATIN CAPITAL LETTER U
+    'V'         #  0xE5 -> LATIN CAPITAL LETTER V
+    'W'         #  0xE6 -> LATIN CAPITAL LETTER W
+    'X'         #  0xE7 -> LATIN CAPITAL LETTER X
+    'Y'         #  0xE8 -> LATIN CAPITAL LETTER Y
+    'Z'         #  0xE9 -> LATIN CAPITAL LETTER Z
+    '\xb2'      #  0xEA -> SUPERSCRIPT TWO
+    '\xd4'      #  0xEB -> LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+    '\\'        #  0xEC -> REVERSE SOLIDUS
+    '\xd2'      #  0xED -> LATIN CAPITAL LETTER O WITH GRAVE
+    '\xd3'      #  0xEE -> LATIN CAPITAL LETTER O WITH ACUTE
+    '\xd5'      #  0xEF -> LATIN CAPITAL LETTER O WITH TILDE
+    '0'         #  0xF0 -> DIGIT ZERO
+    '1'         #  0xF1 -> DIGIT ONE
+    '2'         #  0xF2 -> DIGIT TWO
+    '3'         #  0xF3 -> DIGIT THREE
+    '4'         #  0xF4 -> DIGIT FOUR
+    '5'         #  0xF5 -> DIGIT FIVE
+    '6'         #  0xF6 -> DIGIT SIX
+    '7'         #  0xF7 -> DIGIT SEVEN
+    '8'         #  0xF8 -> DIGIT EIGHT
+    '9'         #  0xF9 -> DIGIT NINE
+    '\xb3'      #  0xFA -> SUPERSCRIPT THREE
+    '\xdb'      #  0xFB -> LATIN CAPITAL LETTER U WITH CIRCUMFLEX
+    ']'         #  0xFC -> RIGHT SQUARE BRACKET
+    '\xd9'      #  0xFD -> LATIN CAPITAL LETTER U WITH GRAVE
+    '\xda'      #  0xFE -> LATIN CAPITAL LETTER U WITH ACUTE
+    '\x9f'      #  0xFF -> APPLICATION PROGRAM COMMAND (APC)
+)
+
+### Encoding table
+encoding_table=codecs.charmap_build(decoding_table)
diff --git a/Lib/encodings/cp500.py b/Lib/encodings/cp500.py
index a975be7..5f61535 100644
--- a/Lib/encodings/cp500.py
+++ b/Lib/encodings/cp500.py
@@ -301,7 +301,6 @@
     '\xd9'     #  0xFD -> LATIN CAPITAL LETTER U WITH GRAVE
     '\xda'     #  0xFE -> LATIN CAPITAL LETTER U WITH ACUTE
     '\x9f'     #  0xFF -> CONTROL
-    '\ufffe'   ## Widen to UCS2 for optimization
 )
 
 ### Encoding table
diff --git a/Lib/encodings/iso8859_1.py b/Lib/encodings/iso8859_1.py
index d9cc516..8cfc01f 100644
--- a/Lib/encodings/iso8859_1.py
+++ b/Lib/encodings/iso8859_1.py
@@ -301,7 +301,6 @@
     '\xfd'     #  0xFD -> LATIN SMALL LETTER Y WITH ACUTE
     '\xfe'     #  0xFE -> LATIN SMALL LETTER THORN (Icelandic)
     '\xff'     #  0xFF -> LATIN SMALL LETTER Y WITH DIAERESIS
-    '\ufffe'   ## Widen to UCS2 for optimization
 )
 
 ### Encoding table
diff --git a/Lib/encodings/rot_13.py b/Lib/encodings/rot_13.py
index 1f2f47b..f0b4186 100755
--- a/Lib/encodings/rot_13.py
+++ b/Lib/encodings/rot_13.py
@@ -106,7 +106,7 @@
 ### Filter API
 
 def rot13(infile, outfile):
-    outfile.write(infile.read().encode('rot-13'))
+    outfile.write(codecs.encode(infile.read(), 'rot-13'))
 
 if __name__ == '__main__':
     import sys
diff --git a/Lib/encodings/uu_codec.py b/Lib/encodings/uu_codec.py
index 1454095..2a5728f 100644
--- a/Lib/encodings/uu_codec.py
+++ b/Lib/encodings/uu_codec.py
@@ -54,7 +54,7 @@
             data = binascii.a2b_uu(s)
         except binascii.Error as v:
             # Workaround for broken uuencoders by /Fredrik Lundh
-            nbytes = (((ord(s[0])-32) & 63) * 4 + 5) / 3
+            nbytes = (((s[0]-32) & 63) * 4 + 5) // 3
             data = binascii.a2b_uu(s[:nbytes])
             #sys.stderr.write("Warning: %s\n" % str(v))
         write(data)
diff --git a/Lib/ensurepip/__init__.py b/Lib/ensurepip/__init__.py
new file mode 100644
index 0000000..0188b41
--- /dev/null
+++ b/Lib/ensurepip/__init__.py
@@ -0,0 +1,210 @@
+import os
+import os.path
+import pkgutil
+import sys
+import tempfile
+
+
+__all__ = ["version", "bootstrap"]
+
+
+_SETUPTOOLS_VERSION = "12.0.5"
+
+_PIP_VERSION = "6.0.7"
+
+# pip currently requires ssl support, so we try to provide a nicer
+# error message when that is missing (http://bugs.python.org/issue19744)
+_MISSING_SSL_MESSAGE = ("pip {} requires SSL/TLS".format(_PIP_VERSION))
+try:
+    import ssl
+except ImportError:
+    ssl = None
+    def _require_ssl_for_pip():
+        raise RuntimeError(_MISSING_SSL_MESSAGE)
+else:
+    def _require_ssl_for_pip():
+        pass
+
+_PROJECTS = [
+    ("setuptools", _SETUPTOOLS_VERSION),
+    ("pip", _PIP_VERSION),
+]
+
+
+def _run_pip(args, additional_paths=None):
+    # Add our bundled software to the sys.path so we can import it
+    if additional_paths is not None:
+        sys.path = additional_paths + sys.path
+
+    # Install the bundled software
+    import pip
+    pip.main(args)
+
+
+def version():
+    """
+    Returns a string specifying the bundled version of pip.
+    """
+    return _PIP_VERSION
+
+def _disable_pip_configuration_settings():
+    # We deliberately ignore all pip environment variables
+    # when invoking pip
+    # See http://bugs.python.org/issue19734 for details
+    keys_to_remove = [k for k in os.environ if k.startswith("PIP_")]
+    for k in keys_to_remove:
+        del os.environ[k]
+    # We also ignore the settings in the default pip configuration file
+    # See http://bugs.python.org/issue20053 for details
+    os.environ['PIP_CONFIG_FILE'] = os.devnull
+
+
+def bootstrap(*, root=None, upgrade=False, user=False,
+              altinstall=False, default_pip=False,
+              verbosity=0):
+    """
+    Bootstrap pip into the current Python installation (or the given root
+    directory).
+
+    Note that calling this function will alter both sys.path and os.environ.
+    """
+    if altinstall and default_pip:
+        raise ValueError("Cannot use altinstall and default_pip together")
+
+    _require_ssl_for_pip()
+    _disable_pip_configuration_settings()
+
+    # By default, installing pip and setuptools installs all of the
+    # following scripts (X.Y == running Python version):
+    #
+    #   pip, pipX, pipX.Y, easy_install, easy_install-X.Y
+    #
+    # pip 1.5+ allows ensurepip to request that some of those be left out
+    if altinstall:
+        # omit pip, pipX and easy_install
+        os.environ["ENSUREPIP_OPTIONS"] = "altinstall"
+    elif not default_pip:
+        # omit pip and easy_install
+        os.environ["ENSUREPIP_OPTIONS"] = "install"
+
+    with tempfile.TemporaryDirectory() as tmpdir:
+        # Put our bundled wheels into a temporary directory and construct the
+        # additional paths that need added to sys.path
+        additional_paths = []
+        for project, version in _PROJECTS:
+            wheel_name = "{}-{}-py2.py3-none-any.whl".format(project, version)
+            whl = pkgutil.get_data(
+                "ensurepip",
+                "_bundled/{}".format(wheel_name),
+            )
+            with open(os.path.join(tmpdir, wheel_name), "wb") as fp:
+                fp.write(whl)
+
+            additional_paths.append(os.path.join(tmpdir, wheel_name))
+
+        # Construct the arguments to be passed to the pip command
+        args = ["install", "--no-index", "--find-links", tmpdir]
+        if root:
+            args += ["--root", root]
+        if upgrade:
+            args += ["--upgrade"]
+        if user:
+            args += ["--user"]
+        if verbosity:
+            args += ["-" + "v" * verbosity]
+
+        _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
+
+def _uninstall_helper(*, verbosity=0):
+    """Helper to support a clean default uninstall process on Windows
+
+    Note that calling this function may alter os.environ.
+    """
+    # Nothing to do if pip was never installed, or has been removed
+    try:
+        import pip
+    except ImportError:
+        return
+
+    # If the pip version doesn't match the bundled one, leave it alone
+    if pip.__version__ != _PIP_VERSION:
+        msg = ("ensurepip will only uninstall a matching version "
+               "({!r} installed, {!r} bundled)")
+        print(msg.format(pip.__version__, _PIP_VERSION), file=sys.stderr)
+        return
+
+    _require_ssl_for_pip()
+    _disable_pip_configuration_settings()
+
+    # Construct the arguments to be passed to the pip command
+    args = ["uninstall", "-y"]
+    if verbosity:
+        args += ["-" + "v" * verbosity]
+
+    _run_pip(args + [p[0] for p in reversed(_PROJECTS)])
+
+
+def _main(argv=None):
+    if ssl is None:
+        print("Ignoring ensurepip failure: {}".format(_MISSING_SSL_MESSAGE),
+              file=sys.stderr)
+        return
+
+    import argparse
+    parser = argparse.ArgumentParser(prog="python -m ensurepip")
+    parser.add_argument(
+        "--version",
+        action="version",
+        version="pip {}".format(version()),
+        help="Show the version of pip that is bundled with this Python.",
+    )
+    parser.add_argument(
+        "-v", "--verbose",
+        action="count",
+        default=0,
+        dest="verbosity",
+        help=("Give more output. Option is additive, and can be used up to 3 "
+              "times."),
+    )
+    parser.add_argument(
+        "-U", "--upgrade",
+        action="store_true",
+        default=False,
+        help="Upgrade pip and dependencies, even if already installed.",
+    )
+    parser.add_argument(
+        "--user",
+        action="store_true",
+        default=False,
+        help="Install using the user scheme.",
+    )
+    parser.add_argument(
+        "--root",
+        default=None,
+        help="Install everything relative to this alternate root directory.",
+    )
+    parser.add_argument(
+        "--altinstall",
+        action="store_true",
+        default=False,
+        help=("Make an alternate install, installing only the X.Y versioned"
+              "scripts (Default: pipX, pipX.Y, easy_install-X.Y)"),
+    )
+    parser.add_argument(
+        "--default-pip",
+        action="store_true",
+        default=False,
+        help=("Make a default pip install, installing the unqualified pip "
+              "and easy_install in addition to the versioned scripts"),
+    )
+
+    args = parser.parse_args(argv)
+
+    bootstrap(
+        root=args.root,
+        upgrade=args.upgrade,
+        user=args.user,
+        verbosity=args.verbosity,
+        altinstall=args.altinstall,
+        default_pip=args.default_pip,
+    )
diff --git a/Lib/ensurepip/__main__.py b/Lib/ensurepip/__main__.py
new file mode 100644
index 0000000..77527d7
--- /dev/null
+++ b/Lib/ensurepip/__main__.py
@@ -0,0 +1,4 @@
+import ensurepip
+
+if __name__ == "__main__":
+    ensurepip._main()
diff --git a/Lib/ensurepip/_bundled/pip-6.0.7-py2.py3-none-any.whl b/Lib/ensurepip/_bundled/pip-6.0.7-py2.py3-none-any.whl
new file mode 100644
index 0000000..e01e8c4
--- /dev/null
+++ b/Lib/ensurepip/_bundled/pip-6.0.7-py2.py3-none-any.whl
Binary files differ
diff --git a/Lib/ensurepip/_bundled/setuptools-12.0.5-py2.py3-none-any.whl b/Lib/ensurepip/_bundled/setuptools-12.0.5-py2.py3-none-any.whl
new file mode 100644
index 0000000..978cf6c
--- /dev/null
+++ b/Lib/ensurepip/_bundled/setuptools-12.0.5-py2.py3-none-any.whl
Binary files differ
diff --git a/Lib/ensurepip/_uninstall.py b/Lib/ensurepip/_uninstall.py
new file mode 100644
index 0000000..750365e
--- /dev/null
+++ b/Lib/ensurepip/_uninstall.py
@@ -0,0 +1,30 @@
+"""Basic pip uninstallation support, helper for the Windows uninstaller"""
+
+import argparse
+import ensurepip
+
+
+def _main(argv=None):
+    parser = argparse.ArgumentParser(prog="python -m ensurepip._uninstall")
+    parser.add_argument(
+        "--version",
+        action="version",
+        version="pip {}".format(ensurepip.version()),
+        help="Show the version of pip this will attempt to uninstall.",
+    )
+    parser.add_argument(
+        "-v", "--verbose",
+        action="count",
+        default=0,
+        dest="verbosity",
+        help=("Give more output. Option is additive, and can be used up to 3 "
+              "times."),
+    )
+
+    args = parser.parse_args(argv)
+
+    ensurepip._uninstall_helper(verbosity=args.verbosity)
+
+
+if __name__ == "__main__":
+    _main()
diff --git a/Lib/enum.py b/Lib/enum.py
new file mode 100644
index 0000000..9b19c1d
--- /dev/null
+++ b/Lib/enum.py
@@ -0,0 +1,530 @@
+import sys
+from collections import OrderedDict
+from types import MappingProxyType, DynamicClassAttribute
+
+__all__ = ['Enum', 'IntEnum', 'unique']
+
+
+def _is_descriptor(obj):
+    """Returns True if obj is a descriptor, False otherwise."""
+    return (
+            hasattr(obj, '__get__') or
+            hasattr(obj, '__set__') or
+            hasattr(obj, '__delete__'))
+
+
+def _is_dunder(name):
+    """Returns True if a __dunder__ name, False otherwise."""
+    return (name[:2] == name[-2:] == '__' and
+            name[2:3] != '_' and
+            name[-3:-2] != '_' and
+            len(name) > 4)
+
+
+def _is_sunder(name):
+    """Returns True if a _sunder_ name, False otherwise."""
+    return (name[0] == name[-1] == '_' and
+            name[1:2] != '_' and
+            name[-2:-1] != '_' and
+            len(name) > 2)
+
+
+def _make_class_unpicklable(cls):
+    """Make the given class un-picklable."""
+    def _break_on_call_reduce(self, proto):
+        raise TypeError('%r cannot be pickled' % self)
+    cls.__reduce_ex__ = _break_on_call_reduce
+    cls.__module__ = '<unknown>'
+
+
+class _EnumDict(dict):
+    """Track enum member order and ensure member names are not reused.
+
+    EnumMeta will use the names found in self._member_names as the
+    enumeration member names.
+
+    """
+    def __init__(self):
+        super().__init__()
+        self._member_names = []
+
+    def __setitem__(self, key, value):
+        """Changes anything not dundered or not a descriptor.
+
+        If an enum member name is used twice, an error is raised; duplicate
+        values are not checked for.
+
+        Single underscore (sunder) names are reserved.
+
+        """
+        if _is_sunder(key):
+            raise ValueError('_names_ are reserved for future Enum use')
+        elif _is_dunder(key):
+            pass
+        elif key in self._member_names:
+            # descriptor overwriting an enum?
+            raise TypeError('Attempted to reuse key: %r' % key)
+        elif not _is_descriptor(value):
+            if key in self:
+                # enum overwriting a descriptor?
+                raise TypeError('Key already defined as: %r' % self[key])
+            self._member_names.append(key)
+        super().__setitem__(key, value)
+
+
+
+# Dummy value for Enum as EnumMeta explicitly checks for it, but of course
+# until EnumMeta finishes running the first time the Enum class doesn't exist.
+# This is also why there are checks in EnumMeta like `if Enum is not None`
+Enum = None
+
+
+class EnumMeta(type):
+    """Metaclass for Enum"""
+    @classmethod
+    def __prepare__(metacls, cls, bases):
+        return _EnumDict()
+
+    def __new__(metacls, cls, bases, classdict):
+        # an Enum class is final once enumeration items have been defined; it
+        # cannot be mixed with other types (int, float, etc.) if it has an
+        # inherited __new__ unless a new __new__ is defined (or the resulting
+        # class will fail).
+        member_type, first_enum = metacls._get_mixins_(bases)
+        __new__, save_new, use_args = metacls._find_new_(classdict, member_type,
+                                                        first_enum)
+
+        # save enum items into separate mapping so they don't get baked into
+        # the new class
+        members = {k: classdict[k] for k in classdict._member_names}
+        for name in classdict._member_names:
+            del classdict[name]
+
+        # check for illegal enum names (any others?)
+        invalid_names = set(members) & {'mro', }
+        if invalid_names:
+            raise ValueError('Invalid enum member name: {0}'.format(
+                ','.join(invalid_names)))
+
+        # create our new Enum type
+        enum_class = super().__new__(metacls, cls, bases, classdict)
+        enum_class._member_names_ = []               # names in definition order
+        enum_class._member_map_ = OrderedDict()      # name->value map
+        enum_class._member_type_ = member_type
+
+        # Reverse value->name map for hashable values.
+        enum_class._value2member_map_ = {}
+
+        # If a custom type is mixed into the Enum, and it does not know how
+        # to pickle itself, pickle.dumps will succeed but pickle.loads will
+        # fail.  Rather than have the error show up later and possibly far
+        # from the source, sabotage the pickle protocol for this class so
+        # that pickle.dumps also fails.
+        #
+        # However, if the new class implements its own __reduce_ex__, do not
+        # sabotage -- it's on them to make sure it works correctly.  We use
+        # __reduce_ex__ instead of any of the others as it is preferred by
+        # pickle over __reduce__, and it handles all pickle protocols.
+        if '__reduce_ex__' not in classdict:
+            if member_type is not object:
+                methods = ('__getnewargs_ex__', '__getnewargs__',
+                        '__reduce_ex__', '__reduce__')
+                if not any(m in member_type.__dict__ for m in methods):
+                    _make_class_unpicklable(enum_class)
+
+        # instantiate them, checking for duplicates as we go
+        # we instantiate first instead of checking for duplicates first in case
+        # a custom __new__ is doing something funky with the values -- such as
+        # auto-numbering ;)
+        for member_name in classdict._member_names:
+            value = members[member_name]
+            if not isinstance(value, tuple):
+                args = (value, )
+            else:
+                args = value
+            if member_type is tuple:   # special case for tuple enums
+                args = (args, )     # wrap it one more time
+            if not use_args:
+                enum_member = __new__(enum_class)
+                if not hasattr(enum_member, '_value_'):
+                    enum_member._value_ = value
+            else:
+                enum_member = __new__(enum_class, *args)
+                if not hasattr(enum_member, '_value_'):
+                    enum_member._value_ = member_type(*args)
+            value = enum_member._value_
+            enum_member._name_ = member_name
+            enum_member.__objclass__ = enum_class
+            enum_member.__init__(*args)
+            # If another member with the same value was already defined, the
+            # new member becomes an alias to the existing one.
+            for name, canonical_member in enum_class._member_map_.items():
+                if canonical_member._value_ == enum_member._value_:
+                    enum_member = canonical_member
+                    break
+            else:
+                # Aliases don't appear in member names (only in __members__).
+                enum_class._member_names_.append(member_name)
+            enum_class._member_map_[member_name] = enum_member
+            try:
+                # This may fail if value is not hashable. We can't add the value
+                # to the map, and by-value lookups for this value will be
+                # linear.
+                enum_class._value2member_map_[value] = enum_member
+            except TypeError:
+                pass
+
+        # double check that repr and friends are not the mixin's or various
+        # things break (such as pickle)
+        for name in ('__repr__', '__str__', '__format__', '__reduce_ex__'):
+            class_method = getattr(enum_class, name)
+            obj_method = getattr(member_type, name, None)
+            enum_method = getattr(first_enum, name, None)
+            if obj_method is not None and obj_method is class_method:
+                setattr(enum_class, name, enum_method)
+
+        # replace any other __new__ with our own (as long as Enum is not None,
+        # anyway) -- again, this is to support pickle
+        if Enum is not None:
+            # if the user defined their own __new__, save it before it gets
+            # clobbered in case they subclass later
+            if save_new:
+                enum_class.__new_member__ = __new__
+            enum_class.__new__ = Enum.__new__
+        return enum_class
+
+    def __call__(cls, value, names=None, *, module=None, qualname=None, type=None):
+        """Either returns an existing member, or creates a new enum class.
+
+        This method is used both when an enum class is given a value to match
+        to an enumeration member (i.e. Color(3)) and for the functional API
+        (i.e. Color = Enum('Color', names='red green blue')).
+
+        When used for the functional API:
+
+        `value` will be the name of the new class.
+
+        `names` should be either a string of white-space/comma delimited names
+        (values will start at 1), or an iterator/mapping of name, value pairs.
+
+        `module` should be set to the module this class is being created in;
+        if it is not set, an attempt to find that module will be made, but if
+        it fails the class will not be picklable.
+
+        `qualname` should be set to the actual location this class can be found
+        at in its module; by default it is set to the global scope.  If this is
+        not correct, unpickling will fail in some circumstances.
+
+        `type`, if set, will be mixed in as the first base class.
+
+        """
+        if names is None:  # simple value lookup
+            return cls.__new__(cls, value)
+        # otherwise, functional API: we're creating a new Enum type
+        return cls._create_(value, names, module=module, qualname=qualname, type=type)
+
+    def __contains__(cls, member):
+        return isinstance(member, cls) and member._name_ in cls._member_map_
+
+    def __delattr__(cls, attr):
+        # nicer error message when someone tries to delete an attribute
+        # (see issue19025).
+        if attr in cls._member_map_:
+            raise AttributeError(
+                    "%s: cannot delete Enum member." % cls.__name__)
+        super().__delattr__(attr)
+
+    def __dir__(self):
+        return (['__class__', '__doc__', '__members__', '__module__'] +
+                self._member_names_)
+
+    def __getattr__(cls, name):
+        """Return the enum member matching `name`
+
+        We use __getattr__ instead of descriptors or inserting into the enum
+        class' __dict__ in order to support `name` and `value` being both
+        properties for enum members (which live in the class' __dict__) and
+        enum members themselves.
+
+        """
+        if _is_dunder(name):
+            raise AttributeError(name)
+        try:
+            return cls._member_map_[name]
+        except KeyError:
+            raise AttributeError(name) from None
+
+    def __getitem__(cls, name):
+        return cls._member_map_[name]
+
+    def __iter__(cls):
+        return (cls._member_map_[name] for name in cls._member_names_)
+
+    def __len__(cls):
+        return len(cls._member_names_)
+
+    @property
+    def __members__(cls):
+        """Returns a mapping of member name->value.
+
+        This mapping lists all enum members, including aliases. Note that this
+        is a read-only view of the internal mapping.
+
+        """
+        return MappingProxyType(cls._member_map_)
+
+    def __repr__(cls):
+        return "<enum %r>" % cls.__name__
+
+    def __reversed__(cls):
+        return (cls._member_map_[name] for name in reversed(cls._member_names_))
+
+    def __setattr__(cls, name, value):
+        """Block attempts to reassign Enum members.
+
+        A simple assignment to the class namespace only changes one of the
+        several possible ways to get an Enum member from the Enum class,
+        resulting in an inconsistent Enumeration.
+
+        """
+        member_map = cls.__dict__.get('_member_map_', {})
+        if name in member_map:
+            raise AttributeError('Cannot reassign members.')
+        super().__setattr__(name, value)
+
+    def _create_(cls, class_name, names=None, *, module=None, qualname=None, type=None):
+        """Convenience method to create a new Enum class.
+
+        `names` can be:
+
+        * A string containing member names, separated either with spaces or
+          commas.  Values are auto-numbered from 1.
+        * An iterable of member names.  Values are auto-numbered from 1.
+        * An iterable of (member name, value) pairs.
+        * A mapping of member name -> value.
+
+        """
+        metacls = cls.__class__
+        bases = (cls, ) if type is None else (type, cls)
+        classdict = metacls.__prepare__(class_name, bases)
+
+        # special processing needed for names?
+        if isinstance(names, str):
+            names = names.replace(',', ' ').split()
+        if isinstance(names, (tuple, list)) and isinstance(names[0], str):
+            names = [(e, i) for (i, e) in enumerate(names, 1)]
+
+        # Here, names is either an iterable of (name, value) or a mapping.
+        for item in names:
+            if isinstance(item, str):
+                member_name, member_value = item, names[item]
+            else:
+                member_name, member_value = item
+            classdict[member_name] = member_value
+        enum_class = metacls.__new__(metacls, class_name, bases, classdict)
+
+        # TODO: replace the frame hack if a blessed way to know the calling
+        # module is ever developed
+        if module is None:
+            try:
+                module = sys._getframe(2).f_globals['__name__']
+            except (AttributeError, ValueError) as exc:
+                pass
+        if module is None:
+            _make_class_unpicklable(enum_class)
+        else:
+            enum_class.__module__ = module
+        if qualname is not None:
+            enum_class.__qualname__ = qualname
+
+        return enum_class
+
+    @staticmethod
+    def _get_mixins_(bases):
+        """Returns the type for creating enum members, and the first inherited
+        enum class.
+
+        bases: the tuple of bases that was given to __new__
+
+        """
+        if not bases:
+            return object, Enum
+
+        # double check that we are not subclassing a class with existing
+        # enumeration members; while we're at it, see if any other data
+        # type has been mixed in so we can use the correct __new__
+        member_type = first_enum = None
+        for base in bases:
+            if  (base is not Enum and
+                    issubclass(base, Enum) and
+                    base._member_names_):
+                raise TypeError("Cannot extend enumerations")
+        # base is now the last base in bases
+        if not issubclass(base, Enum):
+            raise TypeError("new enumerations must be created as "
+                    "`ClassName([mixin_type,] enum_type)`")
+
+        # get correct mix-in type (either mix-in type of Enum subclass, or
+        # first base if last base is Enum)
+        if not issubclass(bases[0], Enum):
+            member_type = bases[0]     # first data type
+            first_enum = bases[-1]  # enum type
+        else:
+            for base in bases[0].__mro__:
+                # most common: (IntEnum, int, Enum, object)
+                # possible:    (<Enum 'AutoIntEnum'>, <Enum 'IntEnum'>,
+                #               <class 'int'>, <Enum 'Enum'>,
+                #               <class 'object'>)
+                if issubclass(base, Enum):
+                    if first_enum is None:
+                        first_enum = base
+                else:
+                    if member_type is None:
+                        member_type = base
+
+        return member_type, first_enum
+
+    @staticmethod
+    def _find_new_(classdict, member_type, first_enum):
+        """Returns the __new__ to be used for creating the enum members.
+
+        classdict: the class dictionary given to __new__
+        member_type: the data type whose __new__ will be used by default
+        first_enum: enumeration to check for an overriding __new__
+
+        """
+        # now find the correct __new__, checking to see of one was defined
+        # by the user; also check earlier enum classes in case a __new__ was
+        # saved as __new_member__
+        __new__ = classdict.get('__new__', None)
+
+        # should __new__ be saved as __new_member__ later?
+        save_new = __new__ is not None
+
+        if __new__ is None:
+            # check all possibles for __new_member__ before falling back to
+            # __new__
+            for method in ('__new_member__', '__new__'):
+                for possible in (member_type, first_enum):
+                    target = getattr(possible, method, None)
+                    if target not in {
+                            None,
+                            None.__new__,
+                            object.__new__,
+                            Enum.__new__,
+                            }:
+                        __new__ = target
+                        break
+                if __new__ is not None:
+                    break
+            else:
+                __new__ = object.__new__
+
+        # if a non-object.__new__ is used then whatever value/tuple was
+        # assigned to the enum member name will be passed to __new__ and to the
+        # new enum member's __init__
+        if __new__ is object.__new__:
+            use_args = False
+        else:
+            use_args = True
+
+        return __new__, save_new, use_args
+
+
+class Enum(metaclass=EnumMeta):
+    """Generic enumeration.
+
+    Derive from this class to define new enumerations.
+
+    """
+    def __new__(cls, value):
+        # all enum instances are actually created during class construction
+        # without calling this method; this method is called by the metaclass'
+        # __call__ (i.e. Color(3) ), and by pickle
+        if type(value) is cls:
+            # For lookups like Color(Color.red)
+            return value
+        # by-value search for a matching enum member
+        # see if it's in the reverse mapping (for hashable values)
+        try:
+            if value in cls._value2member_map_:
+                return cls._value2member_map_[value]
+        except TypeError:
+            # not there, now do long search -- O(n) behavior
+            for member in cls._member_map_.values():
+                if member._value_ == value:
+                    return member
+        raise ValueError("%r is not a valid %s" % (value, cls.__name__))
+
+    def __repr__(self):
+        return "<%s.%s: %r>" % (
+                self.__class__.__name__, self._name_, self._value_)
+
+    def __str__(self):
+        return "%s.%s" % (self.__class__.__name__, self._name_)
+
+    def __dir__(self):
+        added_behavior = [
+                m
+                for cls in self.__class__.mro()
+                for m in cls.__dict__
+                if m[0] != '_'
+                ]
+        return (['__class__', '__doc__', '__module__', 'name', 'value'] +
+                added_behavior)
+
+    def __format__(self, format_spec):
+        # mixed-in Enums should use the mixed-in type's __format__, otherwise
+        # we can get strange results with the Enum name showing up instead of
+        # the value
+
+        # pure Enum branch
+        if self._member_type_ is object:
+            cls = str
+            val = str(self)
+        # mix-in branch
+        else:
+            cls = self._member_type_
+            val = self._value_
+        return cls.__format__(val, format_spec)
+
+    def __hash__(self):
+        return hash(self._name_)
+
+    def __reduce_ex__(self, proto):
+        return self.__class__, (self._value_, )
+
+    # DynamicClassAttribute is used to provide access to the `name` and
+    # `value` properties of enum members while keeping some measure of
+    # protection from modification, while still allowing for an enumeration
+    # to have members named `name` and `value`.  This works because enumeration
+    # members are not set directly on the enum class -- __getattr__ is
+    # used to look them up.
+
+    @DynamicClassAttribute
+    def name(self):
+        """The name of the Enum member."""
+        return self._name_
+
+    @DynamicClassAttribute
+    def value(self):
+        """The value of the Enum member."""
+        return self._value_
+
+
+class IntEnum(int, Enum):
+    """Enum where members are also (and must be) ints"""
+
+
+def unique(enumeration):
+    """Class decorator for enumerations ensuring unique member values."""
+    duplicates = []
+    for name, member in enumeration.__members__.items():
+        if name != member.name:
+            duplicates.append((name, member.name))
+    if duplicates:
+        alias_details = ', '.join(
+                ["%s -> %s" % (alias, name) for (alias, name) in duplicates])
+        raise ValueError('duplicate values found in %r: %s' %
+                (enumeration, alias_details))
+    return enumeration
diff --git a/Lib/filecmp.py b/Lib/filecmp.py
index f5cea1d..e5ad839 100644
--- a/Lib/filecmp.py
+++ b/Lib/filecmp.py
@@ -6,6 +6,7 @@
 Functions:
     cmp(f1, f2, shallow=True) -> int
     cmpfiles(a, b, common) -> ([], [], [])
+    clear_cache()
 
 """
 
@@ -13,11 +14,18 @@
 import stat
 from itertools import filterfalse
 
-__all__ = ["cmp", "dircmp", "cmpfiles"]
+__all__ = ['clear_cache', 'cmp', 'dircmp', 'cmpfiles', 'DEFAULT_IGNORES']
 
 _cache = {}
 BUFSIZE = 8*1024
 
+DEFAULT_IGNORES = [
+    'RCS', 'CVS', 'tags', '.git', '.hg', '.bzr', '_darcs', '__pycache__']
+
+def clear_cache():
+    """Clear the filecmp cache."""
+    _cache.clear()
+
 def cmp(f1, f2, shallow=True):
     """Compare two files.
 
@@ -28,14 +36,15 @@
     f2 -- Second file name
 
     shallow -- Just check stat signature (do not read the files).
-               defaults to 1.
+               defaults to True.
 
     Return value:
 
     True if the files are the same, False otherwise.
 
     This function uses a cache for past comparisons and the results,
-    with a cache invalidation mechanism relying on stale signatures.
+    with cache entries invalidated if their stat information
+    changes.  The cache may be cleared by calling clear_cache().
 
     """
 
@@ -52,7 +61,7 @@
     if outcome is None:
         outcome = _do_cmp(f1, f2)
         if len(_cache) > 100:      # limit the maximum size of the cache
-            _cache.clear()
+            clear_cache()
         _cache[f1, f2, s1, s2] = outcome
     return outcome
 
@@ -80,7 +89,7 @@
     dircmp(a, b, ignore=None, hide=None)
       A and B are directories.
       IGNORE is a list of names to ignore,
-        defaults to ['RCS', 'CVS', 'tags'].
+        defaults to DEFAULT_IGNORES.
       HIDE is a list of names to hide,
         defaults to [os.curdir, os.pardir].
 
@@ -116,7 +125,7 @@
         else:
             self.hide = hide
         if ignore is None:
-            self.ignore = ['RCS', 'CVS', 'tags'] # Names ignored in comparison
+            self.ignore = DEFAULT_IGNORES
         else:
             self.ignore = ignore
 
@@ -147,12 +156,12 @@
             ok = 1
             try:
                 a_stat = os.stat(a_path)
-            except os.error as why:
+            except OSError as why:
                 # print('Can\'t stat', a_path, ':', why.args[1])
                 ok = 0
             try:
                 b_stat = os.stat(b_path)
-            except os.error as why:
+            except OSError as why:
                 # print('Can\'t stat', b_path, ':', why.args[1])
                 ok = 0
 
@@ -268,7 +277,7 @@
 def _cmp(a, b, sh, abs=abs, cmp=cmp):
     try:
         return not abs(cmp(a, b, sh))
-    except os.error:
+    except OSError:
         return 2
 
 
diff --git a/Lib/fileinput.py b/Lib/fileinput.py
index 879a0fd..87758ad 100644
--- a/Lib/fileinput.py
+++ b/Lib/fileinput.py
@@ -30,7 +30,7 @@
 
 All files are opened in text mode by default, you can override this by
 setting the mode parameter to input() or FileInput.__init__().
-If an I/O error occurs during opening or reading a file, the IOError
+If an I/O error occurs during opening or reading a file, the OSError
 exception is raised.
 
 If sys.stdin is used more than once, the second and further use will
@@ -222,6 +222,10 @@
         if mode not in ('r', 'rU', 'U', 'rb'):
             raise ValueError("FileInput opening mode must be one of "
                              "'r', 'rU', 'U' and 'rb'")
+        if 'U' in mode:
+            import warnings
+            warnings.warn("'U' mode is deprecated",
+                          DeprecationWarning, 2)
         self._mode = mode
         if openhook:
             if inplace:
@@ -316,15 +320,20 @@
             self._backupfilename = 0
             if self._filename == '-':
                 self._filename = '<stdin>'
-                self._file = sys.stdin
+                if 'b' in self._mode:
+                    self._file = sys.stdin.buffer
+                else:
+                    self._file = sys.stdin
                 self._isstdin = True
             else:
                 if self._inplace:
                     self._backupfilename = (
                         self._filename + (self._backup or ".bak"))
-                    try: os.unlink(self._backupfilename)
-                    except os.error: pass
-                    # The next few lines may raise IOError
+                    try:
+                        os.unlink(self._backupfilename)
+                    except OSError:
+                        pass
+                    # The next few lines may raise OSError
                     os.rename(self._filename, self._backupfilename)
                     self._file = open(self._backupfilename, self._mode)
                     try:
@@ -346,7 +355,7 @@
                     self._savestdout = sys.stdout
                     sys.stdout = self._output
                 else:
-                    # This may raise IOError
+                    # This may raise OSError
                     if self._openhook:
                         self._file = self._openhook(self._filename, self._mode)
                     else:
diff --git a/Lib/formatter.py b/Lib/formatter.py
index 60e60f1..9338261 100644
--- a/Lib/formatter.py
+++ b/Lib/formatter.py
@@ -19,6 +19,9 @@
 """
 
 import sys
+import warnings
+warnings.warn('the formatter module is deprecated and will be removed in '
+              'Python 3.6', PendingDeprecationWarning)
 
 
 AS_IS = None
@@ -433,11 +436,15 @@
         fp = open(sys.argv[1])
     else:
         fp = sys.stdin
-    for line in fp:
-        if line == '\n':
-            f.end_paragraph(1)
-        else:
-            f.add_flowing_data(line)
+    try:
+        for line in fp:
+            if line == '\n':
+                f.end_paragraph(1)
+            else:
+                f.add_flowing_data(line)
+    finally:
+        if fp is not sys.stdin:
+            fp.close()
     f.end_paragraph(0)
 
 
diff --git a/Lib/fractions.py b/Lib/fractions.py
index 8be52d2..79e83ff 100644
--- a/Lib/fractions.py
+++ b/Lib/fractions.py
@@ -182,8 +182,10 @@
         elif not isinstance(f, float):
             raise TypeError("%s.from_float() only takes floats, not %r (%s)" %
                             (cls.__name__, f, type(f).__name__))
-        if math.isnan(f) or math.isinf(f):
-            raise TypeError("Cannot convert %r to %s." % (f, cls.__name__))
+        if math.isnan(f):
+            raise ValueError("Cannot convert %r to %s." % (f, cls.__name__))
+        if math.isinf(f):
+            raise OverflowError("Cannot convert %r to %s." % (f, cls.__name__))
         return cls(*f.as_integer_ratio())
 
     @classmethod
@@ -196,9 +198,11 @@
             raise TypeError(
                 "%s.from_decimal() only takes Decimals, not %r (%s)" %
                 (cls.__name__, dec, type(dec).__name__))
-        if not dec.is_finite():
-            # Catches infinities and nans.
-            raise TypeError("Cannot convert %s to %s." % (dec, cls.__name__))
+        if dec.is_infinite():
+            raise OverflowError(
+                "Cannot convert %s to %s." % (dec, cls.__name__))
+        if dec.is_nan():
+            raise ValueError("Cannot convert %s to %s." % (dec, cls.__name__))
         sign, digits, exp = dec.as_tuple()
         digits = int(''.join(map(str, digits)))
         if sign:
diff --git a/Lib/ftplib.py b/Lib/ftplib.py
index 5e75e6d..cd8c1a9 100644
--- a/Lib/ftplib.py
+++ b/Lib/ftplib.py
@@ -39,9 +39,10 @@
 import os
 import sys
 import socket
+import warnings
 from socket import _GLOBAL_DEFAULT_TIMEOUT
 
-__all__ = ["FTP","Netrc"]
+__all__ = ["FTP", "Netrc"]
 
 # Magic number from <socket.h>
 MSG_OOB = 0x1                           # Process data out of band
@@ -63,7 +64,7 @@
 
 # All exceptions (hopefully) that may be raised here and that aren't
 # (always) programming errors on our side
-all_errors = (Error, IOError, EOFError)
+all_errors = (Error, OSError, EOFError)
 
 
 # Line terminators (we always output CRLF, but accept any of CRLF, CR, LF)
@@ -126,7 +127,7 @@
         if self.sock is not None:
             try:
                 self.quit()
-            except (socket.error, EOFError):
+            except (OSError, EOFError):
                 pass
             finally:
                 if self.sock is not None:
@@ -136,6 +137,7 @@
         '''Connect to host.  Arguments are:
          - host: hostname to connect to (string, default previous host)
          - port: port to connect to (integer, default previous port)
+         - timeout: the timeout to set against the ftp socket(s)
          - source_address: a 2-tuple (host, port) for the socket to bind
            to as its source address before connecting.
         '''
@@ -186,7 +188,8 @@
     # Internal: send one line to the server, appending CRLF
     def putline(self, line):
         line = line + CRLF
-        if self.debugging > 1: print('*put*', self.sanitize(line))
+        if self.debugging > 1:
+            print('*put*', self.sanitize(line))
         self.sock.sendall(line.encode(self.encoding))
 
     # Internal: send one command to the server (through putline())
@@ -202,9 +205,12 @@
             raise Error("got more than %d bytes" % self.maxline)
         if self.debugging > 1:
             print('*get*', self.sanitize(line))
-        if not line: raise EOFError
-        if line[-2:] == CRLF: line = line[:-2]
-        elif line[-1:] in CRLF: line = line[:-1]
+        if not line:
+            raise EOFError
+        if line[-2:] == CRLF:
+            line = line[:-2]
+        elif line[-1:] in CRLF:
+            line = line[:-1]
         return line
 
     # Internal: get a response from the server, which may possibly
@@ -227,7 +233,8 @@
     # Raise various errors if the response indicates an error
     def getresp(self):
         resp = self.getmultiline()
-        if self.debugging: print('*resp*', self.sanitize(resp))
+        if self.debugging:
+            print('*resp*', self.sanitize(resp))
         self.lastresp = resp[:3]
         c = resp[:1]
         if c in {'1', '2', '3'}:
@@ -251,7 +258,8 @@
         IP and Synch; that doesn't seem to work with the servers I've
         tried.  Instead, just send the ABOR command as OOB data.'''
         line = b'ABOR' + B_CRLF
-        if self.debugging > 1: print('*put urgent*', self.sanitize(line))
+        if self.debugging > 1:
+            print('*put urgent*', self.sanitize(line))
         self.sock.sendall(line, MSG_OOB)
         resp = self.getmultiline()
         if resp[:3] not in {'426', '225', '226'}:
@@ -300,7 +308,7 @@
             try:
                 sock = socket.socket(af, socktype, proto)
                 sock.bind(sa)
-            except socket.error as _:
+            except OSError as _:
                 err = _
                 if sock:
                     sock.close()
@@ -311,8 +319,7 @@
             if err is not None:
                 raise err
             else:
-                raise socket.error("getaddrinfo returns an empty list")
-            raise socket.error(msg)
+                raise OSError("getaddrinfo returns an empty list")
         sock.listen(1)
         port = sock.getsockname()[1] # Get proper port
         host = self.sock.getsockname()[0] # Get proper host
@@ -392,9 +399,12 @@
 
     def login(self, user = '', passwd = '', acct = ''):
         '''Login, default anonymous.'''
-        if not user: user = 'anonymous'
-        if not passwd: passwd = ''
-        if not acct: acct = ''
+        if not user:
+            user = 'anonymous'
+        if not passwd:
+            passwd = ''
+        if not acct:
+            acct = ''
         if user == 'anonymous' and passwd in {'', '-'}:
             # If there is no anonymous ftp password specified
             # then we'll just use anonymous@
@@ -405,8 +415,10 @@
             #   host or country.
             passwd = passwd + 'anonymous@'
         resp = self.sendcmd('USER ' + user)
-        if resp[0] == '3': resp = self.sendcmd('PASS ' + passwd)
-        if resp[0] == '3': resp = self.sendcmd('ACCT ' + acct)
+        if resp[0] == '3':
+            resp = self.sendcmd('PASS ' + passwd)
+        if resp[0] == '3':
+            resp = self.sendcmd('ACCT ' + acct)
         if resp[0] != '2':
             raise error_reply(resp)
         return resp
@@ -432,6 +444,9 @@
                 if not data:
                     break
                 callback(data)
+            # shutdown ssl layer
+            if _SSLSocket is not None and isinstance(conn, _SSLSocket):
+                conn.unwrap()
         return self.voidresp()
 
     def retrlines(self, cmd, callback = None):
@@ -446,7 +461,8 @@
         Returns:
           The response code.
         """
-        if callback is None: callback = print_line
+        if callback is None:
+            callback = print_line
         resp = self.sendcmd('TYPE A')
         with self.transfercmd(cmd) as conn, \
                  conn.makefile('r', encoding=self.encoding) as fp:
@@ -454,7 +470,8 @@
                 line = fp.readline(self.maxline + 1)
                 if len(line) > self.maxline:
                     raise Error("got more than %d bytes" % self.maxline)
-                if self.debugging > 2: print('*retr*', repr(line))
+                if self.debugging > 2:
+                    print('*retr*', repr(line))
                 if not line:
                     break
                 if line[-2:] == CRLF:
@@ -462,6 +479,9 @@
                 elif line[-1:] == '\n':
                     line = line[:-1]
                 callback(line)
+            # shutdown ssl layer
+            if _SSLSocket is not None and isinstance(conn, _SSLSocket):
+                conn.unwrap()
         return self.voidresp()
 
     def storbinary(self, cmd, fp, blocksize=8192, callback=None, rest=None):
@@ -483,9 +503,14 @@
         with self.transfercmd(cmd, rest) as conn:
             while 1:
                 buf = fp.read(blocksize)
-                if not buf: break
+                if not buf:
+                    break
                 conn.sendall(buf)
-                if callback: callback(buf)
+                if callback:
+                    callback(buf)
+            # shutdown ssl layer
+            if _SSLSocket is not None and isinstance(conn, _SSLSocket):
+                conn.unwrap()
         return self.voidresp()
 
     def storlines(self, cmd, fp, callback=None):
@@ -506,12 +531,17 @@
                 buf = fp.readline(self.maxline + 1)
                 if len(buf) > self.maxline:
                     raise Error("got more than %d bytes" % self.maxline)
-                if not buf: break
+                if not buf:
+                    break
                 if buf[-2:] != B_CRLF:
                     if buf[-1] in B_CRLF: buf = buf[:-1]
                     buf = buf + B_CRLF
                 conn.sendall(buf)
-                if callback: callback(buf)
+                if callback:
+                    callback(buf)
+            # shutdown ssl layer
+            if _SSLSocket is not None and isinstance(conn, _SSLSocket):
+                conn.unwrap()
         return self.voidresp()
 
     def acct(self, password):
@@ -646,8 +676,10 @@
 try:
     import ssl
 except ImportError:
-    pass
+    _SSLSocket = None
 else:
+    _SSLSocket = ssl.SSLSocket
+
     class FTP_TLS(FTP):
         '''A FTP subclass which adds TLS support to FTP as described
         in RFC-4217.
@@ -681,7 +713,7 @@
         '221 Goodbye.'
         >>>
         '''
-        ssl_version = ssl.PROTOCOL_TLSv1
+        ssl_version = ssl.PROTOCOL_SSLv23
 
         def __init__(self, host='', user='', passwd='', acct='', keyfile=None,
                      certfile=None, context=None,
@@ -694,6 +726,10 @@
                                  "exclusive")
             self.keyfile = keyfile
             self.certfile = certfile
+            if context is None:
+                context = ssl._create_stdlib_context(self.ssl_version,
+                                                     certfile=certfile,
+                                                     keyfile=keyfile)
             self.context = context
             self._prot_p = False
             FTP.__init__(self, host, user, passwd, acct, timeout, source_address)
@@ -707,16 +743,12 @@
             '''Set up secure control connection by using TLS/SSL.'''
             if isinstance(self.sock, ssl.SSLSocket):
                 raise ValueError("Already using TLS")
-            if self.ssl_version == ssl.PROTOCOL_TLSv1:
+            if self.ssl_version >= ssl.PROTOCOL_SSLv23:
                 resp = self.voidcmd('AUTH TLS')
             else:
                 resp = self.voidcmd('AUTH SSL')
-            if self.context is not None:
-                self.sock = self.context.wrap_socket(self.sock)
-            else:
-                self.sock = ssl.wrap_socket(self.sock, self.keyfile,
-                                            self.certfile,
-                                            ssl_version=self.ssl_version)
+            self.sock = self.context.wrap_socket(self.sock,
+                                                 server_hostname=self.host)
             self.file = self.sock.makefile(mode='r', encoding=self.encoding)
             return resp
 
@@ -755,80 +787,10 @@
         def ntransfercmd(self, cmd, rest=None):
             conn, size = FTP.ntransfercmd(self, cmd, rest)
             if self._prot_p:
-                if self.context is not None:
-                    conn = self.context.wrap_socket(conn)
-                else:
-                    conn = ssl.wrap_socket(conn, self.keyfile, self.certfile,
-                                           ssl_version=self.ssl_version)
+                conn = self.context.wrap_socket(conn,
+                                                server_hostname=self.host)
             return conn, size
 
-        def retrbinary(self, cmd, callback, blocksize=8192, rest=None):
-            self.voidcmd('TYPE I')
-            with self.transfercmd(cmd, rest) as conn:
-                while 1:
-                    data = conn.recv(blocksize)
-                    if not data:
-                        break
-                    callback(data)
-                # shutdown ssl layer
-                if isinstance(conn, ssl.SSLSocket):
-                    conn.unwrap()
-            return self.voidresp()
-
-        def retrlines(self, cmd, callback = None):
-            if callback is None: callback = print_line
-            resp = self.sendcmd('TYPE A')
-            conn = self.transfercmd(cmd)
-            fp = conn.makefile('r', encoding=self.encoding)
-            with fp, conn:
-                while 1:
-                    line = fp.readline(self.maxline + 1)
-                    if len(line) > self.maxline:
-                        raise Error("got more than %d bytes" % self.maxline)
-                    if self.debugging > 2: print('*retr*', repr(line))
-                    if not line:
-                        break
-                    if line[-2:] == CRLF:
-                        line = line[:-2]
-                    elif line[-1:] == '\n':
-                        line = line[:-1]
-                    callback(line)
-                # shutdown ssl layer
-                if isinstance(conn, ssl.SSLSocket):
-                    conn.unwrap()
-            return self.voidresp()
-
-        def storbinary(self, cmd, fp, blocksize=8192, callback=None, rest=None):
-            self.voidcmd('TYPE I')
-            with self.transfercmd(cmd, rest) as conn:
-                while 1:
-                    buf = fp.read(blocksize)
-                    if not buf: break
-                    conn.sendall(buf)
-                    if callback: callback(buf)
-                # shutdown ssl layer
-                if isinstance(conn, ssl.SSLSocket):
-                    conn.unwrap()
-            return self.voidresp()
-
-        def storlines(self, cmd, fp, callback=None):
-            self.voidcmd('TYPE A')
-            with self.transfercmd(cmd) as conn:
-                while 1:
-                    buf = fp.readline(self.maxline + 1)
-                    if len(buf) > self.maxline:
-                        raise Error("got more than %d bytes" % self.maxline)
-                    if not buf: break
-                    if buf[-2:] != B_CRLF:
-                        if buf[-1] in B_CRLF: buf = buf[:-1]
-                        buf = buf + B_CRLF
-                    conn.sendall(buf)
-                    if callback: callback(buf)
-                # shutdown ssl layer
-                if isinstance(conn, ssl.SSLSocket):
-                    conn.unwrap()
-            return self.voidresp()
-
         def abort(self):
             # overridden as we can't pass MSG_OOB flag to sendall()
             line = b'ABOR' + B_CRLF
@@ -839,7 +801,7 @@
             return resp
 
     __all__.append('FTP_TLS')
-    all_errors = (Error, IOError, EOFError, ssl.SSLError)
+    all_errors = (Error, OSError, EOFError, ssl.SSLError)
 
 
 _150_re = None
@@ -936,7 +898,8 @@
 
 def ftpcp(source, sourcename, target, targetname = '', type = 'I'):
     '''Copy file from one FTP-instance to another.'''
-    if not targetname: targetname = sourcename
+    if not targetname:
+        targetname = sourcename
     type = 'TYPE ' + type
     source.voidcmd(type)
     target.voidcmd(type)
@@ -946,9 +909,11 @@
     # transfer request.
     # So: STOR before RETR, because here the target is a "user".
     treply = target.sendcmd('STOR ' + targetname)
-    if treply[:3] not in {'125', '150'}: raise error_proto  # RFC 959
+    if treply[:3] not in {'125', '150'}:
+        raise error_proto  # RFC 959
     sreply = source.sendcmd('RETR ' + sourcename)
-    if sreply[:3] not in {'125', '150'}: raise error_proto  # RFC 959
+    if sreply[:3] not in {'125', '150'}:
+        raise error_proto  # RFC 959
     source.voidresp()
     target.voidresp()
 
@@ -966,19 +931,22 @@
     __defacct = None
 
     def __init__(self, filename=None):
+        warnings.warn("This class is deprecated, use the netrc module instead",
+                      DeprecationWarning, 2)
         if filename is None:
             if "HOME" in os.environ:
                 filename = os.path.join(os.environ["HOME"],
                                         ".netrc")
             else:
-                raise IOError("specify file to load or set $HOME")
+                raise OSError("specify file to load or set $HOME")
         self.__hosts = {}
         self.__macros = {}
         fp = open(filename, "r")
         in_macro = 0
         while 1:
             line = fp.readline()
-            if not line: break
+            if not line:
+                break
             if in_macro and line.strip():
                 macro_lines.append(line)
                 continue
@@ -1087,7 +1055,7 @@
     userid = passwd = acct = ''
     try:
         netrc = Netrc(rcfile)
-    except IOError:
+    except OSError:
         if rcfile is not None:
             sys.stderr.write("Could not open account file"
                              " -- using anonymous login.")
diff --git a/Lib/functools.py b/Lib/functools.py
index 053e44e..3e93a3d 100644
--- a/Lib/functools.py
+++ b/Lib/functools.py
@@ -3,16 +3,24 @@
 # Python module wrapper for _functools C module
 # to allow utilities written in Python to be added
 # to the functools module.
-# Written by Nick Coghlan <ncoghlan at gmail.com>
-# and Raymond Hettinger <python at rcn.com>
-#   Copyright (C) 2006-2010 Python Software Foundation.
+# Written by Nick Coghlan <ncoghlan at gmail.com>,
+# Raymond Hettinger <python at rcn.com>,
+# and Łukasz Langa <lukasz at langa.pl>.
+#   Copyright (C) 2006-2013 Python Software Foundation.
 # See C source code for _functools credits/copyright
 
 __all__ = ['update_wrapper', 'wraps', 'WRAPPER_ASSIGNMENTS', 'WRAPPER_UPDATES',
-           'total_ordering', 'cmp_to_key', 'lru_cache', 'reduce', 'partial']
+           'total_ordering', 'cmp_to_key', 'lru_cache', 'reduce', 'partial',
+           'partialmethod', 'singledispatch']
 
-from _functools import partial, reduce
+try:
+    from _functools import reduce
+except ImportError:
+    pass
+from abc import get_cache_token
 from collections import namedtuple
+from types import MappingProxyType
+from weakref import WeakKeyDictionary
 try:
     from _thread import RLock
 except:
@@ -47,7 +55,6 @@
        are updated with the corresponding attribute from the wrapped
        function (defaults to functools.WRAPPER_UPDATES)
     """
-    wrapper.__wrapped__ = wrapped
     for attr in assigned:
         try:
             value = getattr(wrapped, attr)
@@ -57,6 +64,9 @@
             setattr(wrapper, attr, value)
     for attr in updated:
         getattr(wrapper, attr).update(getattr(wrapped, attr, {}))
+    # Issue #17482: set __wrapped__ last so we don't inadvertently copy it
+    # from the wrapped function when updating __dict__
+    wrapper.__wrapped__ = wrapped
     # Return the wrapper so this can be used as a decorator via partial()
     return wrapper
 
@@ -79,21 +89,106 @@
 ### total_ordering class decorator
 ################################################################################
 
+# The total ordering functions all invoke the root magic method directly
+# rather than using the corresponding operator.  This avoids possible
+# infinite recursion that could occur when the operator dispatch logic
+# detects a NotImplemented result and then calls a reflected method.
+
+def _gt_from_lt(self, other):
+    'Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).'
+    op_result = self.__lt__(other)
+    if op_result is NotImplemented:
+        return NotImplemented
+    return not op_result and self != other
+
+def _le_from_lt(self, other):
+    'Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).'
+    op_result = self.__lt__(other)
+    return op_result or self == other
+
+def _ge_from_lt(self, other):
+    'Return a >= b.  Computed by @total_ordering from (not a < b).'
+    op_result = self.__lt__(other)
+    if op_result is NotImplemented:
+        return NotImplemented
+    return not op_result
+
+def _ge_from_le(self, other):
+    'Return a >= b.  Computed by @total_ordering from (not a <= b) or (a == b).'
+    op_result = self.__le__(other)
+    if op_result is NotImplemented:
+        return NotImplemented
+    return not op_result or self == other
+
+def _lt_from_le(self, other):
+    'Return a < b.  Computed by @total_ordering from (a <= b) and (a != b).'
+    op_result = self.__le__(other)
+    if op_result is NotImplemented:
+        return NotImplemented
+    return op_result and self != other
+
+def _gt_from_le(self, other):
+    'Return a > b.  Computed by @total_ordering from (not a <= b).'
+    op_result = self.__le__(other)
+    if op_result is NotImplemented:
+        return NotImplemented
+    return not op_result
+
+def _lt_from_gt(self, other):
+    'Return a < b.  Computed by @total_ordering from (not a > b) and (a != b).'
+    op_result = self.__gt__(other)
+    if op_result is NotImplemented:
+        return NotImplemented
+    return not op_result and self != other
+
+def _ge_from_gt(self, other):
+    'Return a >= b.  Computed by @total_ordering from (a > b) or (a == b).'
+    op_result = self.__gt__(other)
+    return op_result or self == other
+
+def _le_from_gt(self, other):
+    'Return a <= b.  Computed by @total_ordering from (not a > b).'
+    op_result = self.__gt__(other)
+    if op_result is NotImplemented:
+        return NotImplemented
+    return not op_result
+
+def _le_from_ge(self, other):
+    'Return a <= b.  Computed by @total_ordering from (not a >= b) or (a == b).'
+    op_result = self.__ge__(other)
+    if op_result is NotImplemented:
+        return NotImplemented
+    return not op_result or self == other
+
+def _gt_from_ge(self, other):
+    'Return a > b.  Computed by @total_ordering from (a >= b) and (a != b).'
+    op_result = self.__ge__(other)
+    if op_result is NotImplemented:
+        return NotImplemented
+    return op_result and self != other
+
+def _lt_from_ge(self, other):
+    'Return a < b.  Computed by @total_ordering from (not a >= b).'
+    op_result = self.__ge__(other)
+    if op_result is NotImplemented:
+        return NotImplemented
+    return not op_result
+
 def total_ordering(cls):
     """Class decorator that fills in missing ordering methods"""
     convert = {
-        '__lt__': [('__gt__', lambda self, other: not (self < other or self == other)),
-                   ('__le__', lambda self, other: self < other or self == other),
-                   ('__ge__', lambda self, other: not self < other)],
-        '__le__': [('__ge__', lambda self, other: not self <= other or self == other),
-                   ('__lt__', lambda self, other: self <= other and not self == other),
-                   ('__gt__', lambda self, other: not self <= other)],
-        '__gt__': [('__lt__', lambda self, other: not (self > other or self == other)),
-                   ('__ge__', lambda self, other: self > other or self == other),
-                   ('__le__', lambda self, other: not self > other)],
-        '__ge__': [('__le__', lambda self, other: (not self >= other) or self == other),
-                   ('__gt__', lambda self, other: self >= other and not self == other),
-                   ('__lt__', lambda self, other: not self >= other)]
+        '__lt__': [('__gt__', _gt_from_lt),
+                   ('__le__', _le_from_lt),
+                   ('__ge__', _ge_from_lt)],
+        '__le__': [('__ge__', _ge_from_le),
+                   ('__lt__', _lt_from_le),
+                   ('__gt__', _gt_from_le)],
+        '__gt__': [('__lt__', _lt_from_gt),
+                   ('__ge__', _ge_from_gt),
+                   ('__le__', _le_from_gt)],
+        '__ge__': [('__le__', _le_from_ge),
+                   ('__gt__', _gt_from_ge),
+                   ('__lt__', _lt_from_ge)]
     }
     # Find user-defined comparisons (not those inherited from object).
     roots = [op for op in convert if getattr(cls, op, None) is not getattr(object, op, None)]
@@ -103,7 +198,6 @@
     for opname, opfunc in convert[root]:
         if opname not in roots:
             opfunc.__name__ = opname
-            opfunc.__doc__ = getattr(int, opname).__doc__
             setattr(cls, opname, opfunc)
     return cls
 
@@ -140,6 +234,104 @@
 
 
 ################################################################################
+### partial() argument application
+################################################################################
+
+# Purely functional, no descriptor behaviour
+def partial(func, *args, **keywords):
+    """New function with partial application of the given arguments
+    and keywords.
+    """
+    def newfunc(*fargs, **fkeywords):
+        newkeywords = keywords.copy()
+        newkeywords.update(fkeywords)
+        return func(*(args + fargs), **newkeywords)
+    newfunc.func = func
+    newfunc.args = args
+    newfunc.keywords = keywords
+    return newfunc
+
+try:
+    from _functools import partial
+except ImportError:
+    pass
+
+# Descriptor version
+class partialmethod(object):
+    """Method descriptor with partial application of the given arguments
+    and keywords.
+
+    Supports wrapping existing descriptors and handles non-descriptor
+    callables as instance methods.
+    """
+
+    def __init__(self, func, *args, **keywords):
+        if not callable(func) and not hasattr(func, "__get__"):
+            raise TypeError("{!r} is not callable or a descriptor"
+                                 .format(func))
+
+        # func could be a descriptor like classmethod which isn't callable,
+        # so we can't inherit from partial (it verifies func is callable)
+        if isinstance(func, partialmethod):
+            # flattening is mandatory in order to place cls/self before all
+            # other arguments
+            # it's also more efficient since only one function will be called
+            self.func = func.func
+            self.args = func.args + args
+            self.keywords = func.keywords.copy()
+            self.keywords.update(keywords)
+        else:
+            self.func = func
+            self.args = args
+            self.keywords = keywords
+
+    def __repr__(self):
+        args = ", ".join(map(repr, self.args))
+        keywords = ", ".join("{}={!r}".format(k, v)
+                                 for k, v in self.keywords.items())
+        format_string = "{module}.{cls}({func}, {args}, {keywords})"
+        return format_string.format(module=self.__class__.__module__,
+                                    cls=self.__class__.__name__,
+                                    func=self.func,
+                                    args=args,
+                                    keywords=keywords)
+
+    def _make_unbound_method(self):
+        def _method(*args, **keywords):
+            call_keywords = self.keywords.copy()
+            call_keywords.update(keywords)
+            cls_or_self, *rest = args
+            call_args = (cls_or_self,) + self.args + tuple(rest)
+            return self.func(*call_args, **call_keywords)
+        _method.__isabstractmethod__ = self.__isabstractmethod__
+        _method._partialmethod = self
+        return _method
+
+    def __get__(self, obj, cls):
+        get = getattr(self.func, "__get__", None)
+        result = None
+        if get is not None:
+            new_func = get(obj, cls)
+            if new_func is not self.func:
+                # Assume __get__ returning something new indicates the
+                # creation of an appropriate callable
+                result = partial(new_func, *self.args, **self.keywords)
+                try:
+                    result.__self__ = new_func.__self__
+                except AttributeError:
+                    pass
+        if result is None:
+            # If the underlying descriptor didn't do anything, treat this
+            # like an instance method
+            result = self._make_unbound_method().__get__(obj, cls)
+        return result
+
+    @property
+    def __isabstractmethod__(self):
+        return getattr(self.func, "__isabstractmethod__", False)
+
+
+################################################################################
 ### LRU Cache function decorator
 ################################################################################
 
@@ -214,13 +406,18 @@
     # The internals of the lru_cache are encapsulated for thread safety and
     # to allow the implementation to change (including a possible C version).
 
+    # Early detection of an erroneous call to @lru_cache without any arguments
+    # resulting in the inner function being passed to maxsize instead of an
+    # integer or None.
+    if maxsize is not None and not isinstance(maxsize, int):
+        raise TypeError('Expected maxsize to be an integer or None')
+
     # Constants shared by all lru cache instances:
     sentinel = object()          # unique object used to signal cache misses
     make_key = _make_key         # build a key from the function arguments
     PREV, NEXT, KEY, RESULT = 0, 1, 2, 3   # names for the link fields
 
     def decorating_function(user_function):
-
         cache = {}
         hits = misses = 0
         full = False
@@ -329,3 +526,210 @@
         return update_wrapper(wrapper, user_function)
 
     return decorating_function
+
+
+################################################################################
+### singledispatch() - single-dispatch generic function decorator
+################################################################################
+
+def _c3_merge(sequences):
+    """Merges MROs in *sequences* to a single MRO using the C3 algorithm.
+
+    Adapted from http://www.python.org/download/releases/2.3/mro/.
+
+    """
+    result = []
+    while True:
+        sequences = [s for s in sequences if s]   # purge empty sequences
+        if not sequences:
+            return result
+        for s1 in sequences:   # find merge candidates among seq heads
+            candidate = s1[0]
+            for s2 in sequences:
+                if candidate in s2[1:]:
+                    candidate = None
+                    break      # reject the current head, it appears later
+            else:
+                break
+        if not candidate:
+            raise RuntimeError("Inconsistent hierarchy")
+        result.append(candidate)
+        # remove the chosen candidate
+        for seq in sequences:
+            if seq[0] == candidate:
+                del seq[0]
+
+def _c3_mro(cls, abcs=None):
+    """Computes the method resolution order using extended C3 linearization.
+
+    If no *abcs* are given, the algorithm works exactly like the built-in C3
+    linearization used for method resolution.
+
+    If given, *abcs* is a list of abstract base classes that should be inserted
+    into the resulting MRO. Unrelated ABCs are ignored and don't end up in the
+    result. The algorithm inserts ABCs where their functionality is introduced,
+    i.e. issubclass(cls, abc) returns True for the class itself but returns
+    False for all its direct base classes. Implicit ABCs for a given class
+    (either registered or inferred from the presence of a special method like
+    __len__) are inserted directly after the last ABC explicitly listed in the
+    MRO of said class. If two implicit ABCs end up next to each other in the
+    resulting MRO, their ordering depends on the order of types in *abcs*.
+
+    """
+    for i, base in enumerate(reversed(cls.__bases__)):
+        if hasattr(base, '__abstractmethods__'):
+            boundary = len(cls.__bases__) - i
+            break   # Bases up to the last explicit ABC are considered first.
+    else:
+        boundary = 0
+    abcs = list(abcs) if abcs else []
+    explicit_bases = list(cls.__bases__[:boundary])
+    abstract_bases = []
+    other_bases = list(cls.__bases__[boundary:])
+    for base in abcs:
+        if issubclass(cls, base) and not any(
+                issubclass(b, base) for b in cls.__bases__
+            ):
+            # If *cls* is the class that introduces behaviour described by
+            # an ABC *base*, insert said ABC to its MRO.
+            abstract_bases.append(base)
+    for base in abstract_bases:
+        abcs.remove(base)
+    explicit_c3_mros = [_c3_mro(base, abcs=abcs) for base in explicit_bases]
+    abstract_c3_mros = [_c3_mro(base, abcs=abcs) for base in abstract_bases]
+    other_c3_mros = [_c3_mro(base, abcs=abcs) for base in other_bases]
+    return _c3_merge(
+        [[cls]] +
+        explicit_c3_mros + abstract_c3_mros + other_c3_mros +
+        [explicit_bases] + [abstract_bases] + [other_bases]
+    )
+
+def _compose_mro(cls, types):
+    """Calculates the method resolution order for a given class *cls*.
+
+    Includes relevant abstract base classes (with their respective bases) from
+    the *types* iterable. Uses a modified C3 linearization algorithm.
+
+    """
+    bases = set(cls.__mro__)
+    # Remove entries which are already present in the __mro__ or unrelated.
+    def is_related(typ):
+        return (typ not in bases and hasattr(typ, '__mro__')
+                                 and issubclass(cls, typ))
+    types = [n for n in types if is_related(n)]
+    # Remove entries which are strict bases of other entries (they will end up
+    # in the MRO anyway.
+    def is_strict_base(typ):
+        for other in types:
+            if typ != other and typ in other.__mro__:
+                return True
+        return False
+    types = [n for n in types if not is_strict_base(n)]
+    # Subclasses of the ABCs in *types* which are also implemented by
+    # *cls* can be used to stabilize ABC ordering.
+    type_set = set(types)
+    mro = []
+    for typ in types:
+        found = []
+        for sub in typ.__subclasses__():
+            if sub not in bases and issubclass(cls, sub):
+                found.append([s for s in sub.__mro__ if s in type_set])
+        if not found:
+            mro.append(typ)
+            continue
+        # Favor subclasses with the biggest number of useful bases
+        found.sort(key=len, reverse=True)
+        for sub in found:
+            for subcls in sub:
+                if subcls not in mro:
+                    mro.append(subcls)
+    return _c3_mro(cls, abcs=mro)
+
+def _find_impl(cls, registry):
+    """Returns the best matching implementation from *registry* for type *cls*.
+
+    Where there is no registered implementation for a specific type, its method
+    resolution order is used to find a more generic implementation.
+
+    Note: if *registry* does not contain an implementation for the base
+    *object* type, this function may return None.
+
+    """
+    mro = _compose_mro(cls, registry.keys())
+    match = None
+    for t in mro:
+        if match is not None:
+            # If *match* is an implicit ABC but there is another unrelated,
+            # equally matching implicit ABC, refuse the temptation to guess.
+            if (t in registry and t not in cls.__mro__
+                              and match not in cls.__mro__
+                              and not issubclass(match, t)):
+                raise RuntimeError("Ambiguous dispatch: {} or {}".format(
+                    match, t))
+            break
+        if t in registry:
+            match = t
+    return registry.get(match)
+
+def singledispatch(func):
+    """Single-dispatch generic function decorator.
+
+    Transforms a function into a generic function, which can have different
+    behaviours depending upon the type of its first argument. The decorated
+    function acts as the default implementation, and additional
+    implementations can be registered using the register() attribute of the
+    generic function.
+
+    """
+    registry = {}
+    dispatch_cache = WeakKeyDictionary()
+    cache_token = None
+
+    def dispatch(cls):
+        """generic_func.dispatch(cls) -> <function implementation>
+
+        Runs the dispatch algorithm to return the best available implementation
+        for the given *cls* registered on *generic_func*.
+
+        """
+        nonlocal cache_token
+        if cache_token is not None:
+            current_token = get_cache_token()
+            if cache_token != current_token:
+                dispatch_cache.clear()
+                cache_token = current_token
+        try:
+            impl = dispatch_cache[cls]
+        except KeyError:
+            try:
+                impl = registry[cls]
+            except KeyError:
+                impl = _find_impl(cls, registry)
+            dispatch_cache[cls] = impl
+        return impl
+
+    def register(cls, func=None):
+        """generic_func.register(cls, func) -> func
+
+        Registers a new implementation for the given *cls* on a *generic_func*.
+
+        """
+        nonlocal cache_token
+        if func is None:
+            return lambda f: register(cls, f)
+        registry[cls] = func
+        if cache_token is None and hasattr(cls, '__abstractmethods__'):
+            cache_token = get_cache_token()
+        dispatch_cache.clear()
+        return func
+
+    def wrapper(*args, **kw):
+        return dispatch(args[0].__class__)(*args, **kw)
+
+    registry[object] = func
+    wrapper.register = register
+    wrapper.dispatch = dispatch
+    wrapper.registry = MappingProxyType(registry)
+    wrapper._clear_cache = dispatch_cache.clear
+    update_wrapper(wrapper, func)
+    return wrapper
diff --git a/Lib/genericpath.py b/Lib/genericpath.py
index 340c004..ca4a510 100644
--- a/Lib/genericpath.py
+++ b/Lib/genericpath.py
@@ -7,7 +7,8 @@
 import stat
 
 __all__ = ['commonprefix', 'exists', 'getatime', 'getctime', 'getmtime',
-           'getsize', 'isdir', 'isfile']
+           'getsize', 'isdir', 'isfile', 'samefile', 'sameopenfile',
+           'samestat']
 
 
 # Does a path exist?
@@ -16,7 +17,7 @@
     """Test whether a path exists.  Returns False for broken symbolic links"""
     try:
         os.stat(path)
-    except os.error:
+    except OSError:
         return False
     return True
 
@@ -27,7 +28,7 @@
     """Test whether a path is a regular file"""
     try:
         st = os.stat(path)
-    except os.error:
+    except OSError:
         return False
     return stat.S_ISREG(st.st_mode)
 
@@ -39,7 +40,7 @@
     """Return true if the pathname refers to an existing directory."""
     try:
         st = os.stat(s)
-    except os.error:
+    except OSError:
         return False
     return stat.S_ISDIR(st.st_mode)
 
@@ -75,6 +76,31 @@
             return s1[:i]
     return s1
 
+# Are two stat buffers (obtained from stat, fstat or lstat)
+# describing the same file?
+def samestat(s1, s2):
+    """Test whether two stat buffers reference the same file"""
+    return (s1.st_ino == s2.st_ino and
+            s1.st_dev == s2.st_dev)
+
+
+# Are two filenames really pointing to the same file?
+def samefile(f1, f2):
+    """Test whether two pathnames reference the same actual file"""
+    s1 = os.stat(f1)
+    s2 = os.stat(f2)
+    return samestat(s1, s2)
+
+
+# Are two open files really referencing the same file?
+# (Not necessarily the same file descriptor!)
+def sameopenfile(fp1, fp2):
+    """Test whether two open file objects reference the same file"""
+    s1 = os.fstat(fp1)
+    s2 = os.fstat(fp2)
+    return samestat(s1, s2)
+
+
 # Split a path in root and extension.
 # The extension is everything starting at the last dot in the last
 # pathname component; the root is everything before that.
diff --git a/Lib/getpass.py b/Lib/getpass.py
index 53c38b8..7c4e976 100644
--- a/Lib/getpass.py
+++ b/Lib/getpass.py
@@ -135,7 +135,13 @@
         input = sys.stdin
     prompt = str(prompt)
     if prompt:
-        stream.write(prompt)
+        try:
+            stream.write(prompt)
+        except UnicodeEncodeError:
+            # Use replace error handler to get as much as possible printed.
+            prompt = prompt.encode(stream.encoding, 'replace')
+            prompt = prompt.decode(stream.encoding)
+            stream.write(prompt)
         stream.flush()
     # NOTE: The Python C API calls flockfile() (and unlock) during readline.
     line = input.readline()
diff --git a/Lib/gettext.py b/Lib/gettext.py
index e43f044..05d9c1e 100644
--- a/Lib/gettext.py
+++ b/Lib/gettext.py
@@ -244,7 +244,7 @@
             version, msgcount, masteridx, transidx = unpack('>4I', buf[4:20])
             ii = '>II'
         else:
-            raise IOError(0, 'Bad magic number', filename)
+            raise OSError(0, 'Bad magic number', filename)
         # Now put all messages from the .mo file buffer into the catalog
         # dictionary.
         for i in range(0, msgcount):
@@ -256,7 +256,7 @@
                 msg = buf[moff:mend]
                 tmsg = buf[toff:tend]
             else:
-                raise IOError(0, 'File is corrupt', filename)
+                raise OSError(0, 'File is corrupt', filename)
             # See if we're looking at GNU .mo conventions for metadata
             if mlen == 0:
                 # Catalog description
@@ -398,7 +398,7 @@
     if not mofiles:
         if fallback:
             return NullTranslations()
-        raise IOError(ENOENT, 'No translation file found for domain', domain)
+        raise OSError(ENOENT, 'No translation file found for domain', domain)
     # Avoid opening, reading, and parsing the .mo file after it's been done
     # once.
     result = None
@@ -460,7 +460,7 @@
     try:
         t = translation(domain, _localedirs.get(domain, None),
                         codeset=_localecodesets.get(domain))
-    except IOError:
+    except OSError:
         return message
     return t.gettext(message)
 
@@ -468,7 +468,7 @@
     try:
         t = translation(domain, _localedirs.get(domain, None),
                         codeset=_localecodesets.get(domain))
-    except IOError:
+    except OSError:
         return message
     return t.lgettext(message)
 
@@ -476,7 +476,7 @@
     try:
         t = translation(domain, _localedirs.get(domain, None),
                         codeset=_localecodesets.get(domain))
-    except IOError:
+    except OSError:
         if n == 1:
             return msgid1
         else:
@@ -487,7 +487,7 @@
     try:
         t = translation(domain, _localedirs.get(domain, None),
                         codeset=_localecodesets.get(domain))
-    except IOError:
+    except OSError:
         if n == 1:
             return msgid1
         else:
diff --git a/Lib/glob.py b/Lib/glob.py
index 1f60265..d6eca24 100644
--- a/Lib/glob.py
+++ b/Lib/glob.py
@@ -26,14 +26,18 @@
     patterns.
 
     """
-    if not has_magic(pathname):
-        if os.path.lexists(pathname):
-            yield pathname
-        return
     dirname, basename = os.path.split(pathname)
+    if not has_magic(pathname):
+        if basename:
+            if os.path.lexists(pathname):
+                yield pathname
+        else:
+            # Patterns ending with a slash should match only directories
+            if os.path.isdir(dirname):
+                yield pathname
+        return
     if not dirname:
-        for name in glob1(None, basename):
-            yield name
+        yield from glob1(None, basename)
         return
     # `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
@@ -62,7 +66,7 @@
             dirname = os.curdir
     try:
         names = os.listdir(dirname)
-    except os.error:
+    except OSError:
         return []
     if not _ishidden(pattern):
         names = [x for x in names if not _ishidden(x)]
@@ -80,8 +84,8 @@
     return []
 
 
-magic_check = re.compile('[*?[]')
-magic_check_bytes = re.compile(b'[*?[]')
+magic_check = re.compile('([*?[])')
+magic_check_bytes = re.compile(b'([*?[])')
 
 def has_magic(s):
     if isinstance(s, bytes):
@@ -92,3 +96,15 @@
 
 def _ishidden(path):
     return path[0] in ('.', b'.'[0])
+
+def escape(pathname):
+    """Escape all special characters.
+    """
+    # Escaping is done by wrapping any of "*?[" between square brackets.
+    # Metacharacters do not work in the drive part and shouldn't be escaped.
+    drive, pathname = os.path.splitdrive(pathname)
+    if isinstance(pathname, bytes):
+        pathname = magic_check_bytes.sub(br'[\1]', pathname)
+    else:
+        pathname = magic_check.sub(r'[\1]', pathname)
+    return drive + pathname
diff --git a/Lib/gzip.py b/Lib/gzip.py
index 4ff9820..f934d4f 100644
--- a/Lib/gzip.py
+++ b/Lib/gzip.py
@@ -23,9 +23,9 @@
     The filename argument can be an actual filename (a str or bytes object), or
     an existing file object to read from or write to.
 
-    The mode argument can be "r", "rb", "w", "wb", "a" or "ab" for binary mode,
-    or "rt", "wt" or "at" for text mode. The default mode is "rb", and the
-    default compresslevel is 9.
+    The mode argument can be "r", "rb", "w", "wb", "x", "xb", "a" or "ab" for
+    binary mode, or "rt", "wt", "xt" or "at" for text mode. The default mode is
+    "rb", and the default compresslevel is 9.
 
     For binary mode, this function is equivalent to the GzipFile constructor:
     GzipFile(filename, mode, compresslevel). In this case, the encoding, errors
@@ -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
@@ -154,11 +151,11 @@
         fileobj, if discernible; otherwise, it defaults to the empty string,
         and in this case the original filename is not included in the header.
 
-        The mode argument can be any of 'r', 'rb', 'a', 'ab', 'w', or 'wb',
-        depending on whether the file will be read or written.  The default
+        The mode argument can be any of 'r', 'rb', 'a', 'ab', 'w', 'wb', 'x', or
+        'xb' depending on whether the file will be read or written.  The default
         is the mode of fileobj if discernible; otherwise, the default is 'rb'.
         A mode of 'r' is equivalent to one of 'rb', and similarly for 'w' and
-        'wb', and 'a' and 'ab'.
+        'wb', 'a' and 'ab', and 'x' and 'xb'.
 
         The compresslevel argument is an integer from 0 to 9 controlling the
         level of compression; 1 is fastest and produces the least compression,
@@ -204,7 +201,7 @@
             self.min_readsize = 100
             fileobj = _PaddedFile(fileobj)
 
-        elif mode.startswith(('w', 'a')):
+        elif mode.startswith(('w', 'a', 'x')):
             self.mode = WRITE
             self._init_write(filename)
             self.compress = zlib.compressobj(compresslevel,
@@ -281,28 +278,32 @@
         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')
+            raise OSError('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)
+            raise OSError('Unknown compression method')
 
         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)
+            extra_len, = struct.unpack("<H", self._read_exact(2))
+            self._read_exact(extra_len)
         if flag & FNAME:
             # Read and discard a null-terminated string containing the filename
             while True:
@@ -316,18 +317,19 @@
                 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()
         if self.mode != WRITE:
             import errno
-            raise IOError(errno.EBADF, "write() on read-only GzipFile object")
+            raise OSError(errno.EBADF, "write() on read-only GzipFile object")
 
         if self.fileobj is None:
             raise ValueError("write() on closed GzipFile object")
@@ -348,27 +350,23 @@
         self._check_closed()
         if self.mode != READ:
             import errno
-            raise IOError(errno.EBADF, "read() on write-only GzipFile object")
+            raise OSError(errno.EBADF, "read() on write-only GzipFile object")
 
         if self.extrasize <= 0 and self.fileobj is None:
             return b''
 
         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]
@@ -381,17 +379,14 @@
         self._check_closed()
         if self.mode != READ:
             import errno
-            raise IOError(errno.EBADF, "read1() on write-only GzipFile object")
+            raise OSError(errno.EBADF, "read1() on write-only GzipFile object")
 
         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
@@ -405,7 +400,7 @@
     def peek(self, n):
         if self.mode != READ:
             import errno
-            raise IOError(errno.EBADF, "peek() on write-only GzipFile object")
+            raise OSError(errno.EBADF, "peek() on write-only GzipFile object")
 
         # Do not return ridiculously small buffers, for one common idiom
         # is to call peek(1) and expect more bytes in return.
@@ -414,12 +409,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
@@ -432,13 +424,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
 
@@ -455,7 +448,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 )
@@ -471,6 +464,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
@@ -485,13 +479,12 @@
         # 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),
+            raise OSError("CRC check failed %s != %s" % (hex(crc32),
                                                          hex(self.crc)))
         elif isize != (self.size & 0xffffffff):
-            raise IOError("Incorrect length of data produced")
+            raise OSError("Incorrect length of data produced")
 
         # Gzip files can be padded with zeroes and still have archives.
         # Consume all zero bytes and set the file position to the first
@@ -540,7 +533,7 @@
         '''Return the uncompressed stream file position indicator to the
         beginning of the file'''
         if self.mode != READ:
-            raise IOError("Can't rewind in write mode")
+            raise OSError("Can't rewind in write mode")
         self.fileobj.seek(0)
         self._new_member = True
         self.extrabuf = b""
@@ -565,7 +558,7 @@
                 raise ValueError('Seek from end not supported')
         if self.mode == WRITE:
             if offset < self.offset:
-                raise IOError('Negative seek in write mode')
+                raise OSError('Negative seek in write mode')
             count = offset - self.offset
             chunk = bytes(1024)
             for i in range(count // 1024):
diff --git a/Lib/hashlib.py b/Lib/hashlib.py
index 21454c7..316cece 100644
--- a/Lib/hashlib.py
+++ b/Lib/hashlib.py
@@ -1,4 +1,4 @@
-#  Copyright (C) 2005-2010   Gregory P. Smith (greg@krypto.org)
+#.  Copyright (C) 2005-2010   Gregory P. Smith (greg@krypto.org)
 #  Licensed to PSF under a Contributor Agreement.
 #
 
@@ -60,34 +60,38 @@
 algorithms_available = set(__always_supported)
 
 __all__ = __always_supported + ('new', 'algorithms_guaranteed',
-                                'algorithms_available')
+                                'algorithms_available', 'pbkdf2_hmac')
 
 
+__builtin_constructor_cache = {}
+
 def __get_builtin_constructor(name):
+    cache = __builtin_constructor_cache
+    constructor = cache.get(name)
+    if constructor is not None:
+        return constructor
     try:
         if name in ('SHA1', 'sha1'):
             import _sha1
-            return _sha1.sha1
+            cache['SHA1'] = cache['sha1'] = _sha1.sha1
         elif name in ('MD5', 'md5'):
             import _md5
-            return _md5.md5
+            cache['MD5'] = cache['md5'] = _md5.md5
         elif name in ('SHA256', 'sha256', 'SHA224', 'sha224'):
             import _sha256
-            bs = name[3:]
-            if bs == '256':
-                return _sha256.sha256
-            elif bs == '224':
-                return _sha256.sha224
+            cache['SHA224'] = cache['sha224'] = _sha256.sha224
+            cache['SHA256'] = cache['sha256'] = _sha256.sha256
         elif name in ('SHA512', 'sha512', 'SHA384', 'sha384'):
             import _sha512
-            bs = name[3:]
-            if bs == '512':
-                return _sha512.sha512
-            elif bs == '384':
-                return _sha512.sha384
+            cache['SHA384'] = cache['sha384'] = _sha512.sha384
+            cache['SHA512'] = cache['sha512'] = _sha512.sha512
     except ImportError:
         pass  # no extension module, this hash is unsupported.
 
+    constructor = cache.get(name)
+    if constructor is not None:
+        return constructor
+
     raise ValueError('unsupported hash type ' + name)
 
 
@@ -134,6 +138,71 @@
     new = __py_new
     __get_hash = __get_builtin_constructor
 
+try:
+    # OpenSSL's PKCS5_PBKDF2_HMAC requires OpenSSL 1.0+ with HMAC and SHA
+    from _hashlib import pbkdf2_hmac
+except ImportError:
+    _trans_5C = bytes((x ^ 0x5C) for x in range(256))
+    _trans_36 = bytes((x ^ 0x36) for x in range(256))
+
+    def pbkdf2_hmac(hash_name, password, salt, iterations, dklen=None):
+        """Password based key derivation function 2 (PKCS #5 v2.0)
+
+        This Python implementations based on the hmac module about as fast
+        as OpenSSL's PKCS5_PBKDF2_HMAC for short passwords and much faster
+        for long passwords.
+        """
+        if not isinstance(hash_name, str):
+            raise TypeError(hash_name)
+
+        if not isinstance(password, (bytes, bytearray)):
+            password = bytes(memoryview(password))
+        if not isinstance(salt, (bytes, bytearray)):
+            salt = bytes(memoryview(salt))
+
+        # Fast inline HMAC implementation
+        inner = new(hash_name)
+        outer = new(hash_name)
+        blocksize = getattr(inner, 'block_size', 64)
+        if len(password) > blocksize:
+            password = new(hash_name, password).digest()
+        password = password + b'\x00' * (blocksize - len(password))
+        inner.update(password.translate(_trans_36))
+        outer.update(password.translate(_trans_5C))
+
+        def prf(msg, inner=inner, outer=outer):
+            # PBKDF2_HMAC uses the password as key. We can re-use the same
+            # digest objects and just update copies to skip initialization.
+            icpy = inner.copy()
+            ocpy = outer.copy()
+            icpy.update(msg)
+            ocpy.update(icpy.digest())
+            return ocpy.digest()
+
+        if iterations < 1:
+            raise ValueError(iterations)
+        if dklen is None:
+            dklen = outer.digest_size
+        if dklen < 1:
+            raise ValueError(dklen)
+
+        dkey = b''
+        loop = 1
+        from_bytes = int.from_bytes
+        while len(dkey) < dklen:
+            prev = prf(salt + loop.to_bytes(4, 'big'))
+            # endianess doesn't matter here as long to / from use the same
+            rkey = int.from_bytes(prev, 'big')
+            for i in range(iterations - 1):
+                prev = prf(prev)
+                # rkey = rkey ^ prev
+                rkey ^= from_bytes(prev, 'big')
+            loop += 1
+            dkey += rkey.to_bytes(inner.digest_size, 'big')
+
+        return dkey[:dklen]
+
+
 for __func_name in __always_supported:
     # try them all, some may not work due to the OpenSSL
     # version not supporting that algorithm.
diff --git a/Lib/hmac.py b/Lib/hmac.py
index 4297a71..77785a2 100644
--- a/Lib/hmac.py
+++ b/Lib/hmac.py
@@ -4,7 +4,8 @@
 """
 
 import warnings as _warnings
-from operator import _compare_digest as compare_digest
+from _operator import _compare_digest as compare_digest
+import hashlib as _hashlib
 
 trans_5C = bytes((x ^ 0x5C) for x in range(256))
 trans_36 = bytes((x ^ 0x36) for x in range(256))
@@ -28,21 +29,27 @@
         key:       key for the keyed hash object.
         msg:       Initial input for the hash, if provided.
         digestmod: A module supporting PEP 247.  *OR*
-                   A hashlib constructor returning a new hash object.
+                   A hashlib constructor returning a new hash object. *OR*
+                   A hash name suitable for hashlib.new().
                    Defaults to hashlib.md5.
+                   Implicit default to hashlib.md5 is deprecated and will be
+                   removed in Python 3.6.
 
-        Note: key and msg must be bytes objects.
+        Note: key and msg must be a bytes or bytearray objects.
         """
 
-        if not isinstance(key, bytes):
-            raise TypeError("key: expected bytes, but got %r" % type(key).__name__)
+        if not isinstance(key, (bytes, bytearray)):
+            raise TypeError("key: expected bytes or bytearray, but got %r" % type(key).__name__)
 
         if digestmod is None:
-            import hashlib
-            digestmod = hashlib.md5
+            _warnings.warn("HMAC() without an explicit digestmod argument "
+                           "is deprecated.", PendingDeprecationWarning, 2)
+            digestmod = _hashlib.md5
 
         if callable(digestmod):
             self.digest_cons = digestmod
+        elif isinstance(digestmod, str):
+            self.digest_cons = lambda d=b'': _hashlib.new(digestmod, d)
         else:
             self.digest_cons = lambda d=b'': digestmod.new(d)
 
@@ -63,6 +70,10 @@
                            RuntimeWarning, 2)
             blocksize = self.blocksize
 
+        # self.blocksize is the default blocksize. self.block_size is
+        # effective block size as well as the public API attribute.
+        self.block_size = blocksize
+
         if len(key) > blocksize:
             key = self.digest_cons(key).digest()
 
@@ -72,11 +83,13 @@
         if msg is not None:
             self.update(msg)
 
+    @property
+    def name(self):
+        return "hmac-" + self.inner.name
+
     def update(self, msg):
         """Update this hashing object with the string msg.
         """
-        if not isinstance(msg, bytes):
-            raise TypeError("expected bytes, but got %r" % type(msg).__name__)
         self.inner.update(msg)
 
     def copy(self):
diff --git a/Lib/html/__init__.py b/Lib/html/__init__.py
index 02652ef..da0a0a3 100644
--- a/Lib/html/__init__.py
+++ b/Lib/html/__init__.py
@@ -2,12 +2,12 @@
 General functions for HTML manipulation.
 """
 
+import re as _re
+from html.entities import html5 as _html5
 
-_escape_map = {ord('&'): '&amp;', ord('<'): '&lt;', ord('>'): '&gt;'}
-_escape_map_full = {ord('&'): '&amp;', ord('<'): '&lt;', ord('>'): '&gt;',
-                    ord('"'): '&quot;', ord('\''): '&#x27;'}
 
-# NB: this is a candidate for a bytes/string polymorphic interface
+__all__ = ['escape', 'unescape']
+
 
 def escape(s, quote=True):
     """
@@ -16,6 +16,117 @@
     characters, both double quote (") and single quote (') characters are also
     translated.
     """
+    s = s.replace("&", "&amp;") # Must be done first!
+    s = s.replace("<", "&lt;")
+    s = s.replace(">", "&gt;")
     if quote:
-        return s.translate(_escape_map_full)
-    return s.translate(_escape_map)
+        s = s.replace('"', "&quot;")
+        s = s.replace('\'', "&#x27;")
+    return s
+
+
+# see http://www.w3.org/TR/html5/syntax.html#tokenizing-character-references
+
+_invalid_charrefs = {
+    0x00: '\ufffd',  # REPLACEMENT CHARACTER
+    0x0d: '\r',      # CARRIAGE RETURN
+    0x80: '\u20ac',  # EURO SIGN
+    0x81: '\x81',    # <control>
+    0x82: '\u201a',  # SINGLE LOW-9 QUOTATION MARK
+    0x83: '\u0192',  # LATIN SMALL LETTER F WITH HOOK
+    0x84: '\u201e',  # DOUBLE LOW-9 QUOTATION MARK
+    0x85: '\u2026',  # HORIZONTAL ELLIPSIS
+    0x86: '\u2020',  # DAGGER
+    0x87: '\u2021',  # DOUBLE DAGGER
+    0x88: '\u02c6',  # MODIFIER LETTER CIRCUMFLEX ACCENT
+    0x89: '\u2030',  # PER MILLE SIGN
+    0x8a: '\u0160',  # LATIN CAPITAL LETTER S WITH CARON
+    0x8b: '\u2039',  # SINGLE LEFT-POINTING ANGLE QUOTATION MARK
+    0x8c: '\u0152',  # LATIN CAPITAL LIGATURE OE
+    0x8d: '\x8d',    # <control>
+    0x8e: '\u017d',  # LATIN CAPITAL LETTER Z WITH CARON
+    0x8f: '\x8f',    # <control>
+    0x90: '\x90',    # <control>
+    0x91: '\u2018',  # LEFT SINGLE QUOTATION MARK
+    0x92: '\u2019',  # RIGHT SINGLE QUOTATION MARK
+    0x93: '\u201c',  # LEFT DOUBLE QUOTATION MARK
+    0x94: '\u201d',  # RIGHT DOUBLE QUOTATION MARK
+    0x95: '\u2022',  # BULLET
+    0x96: '\u2013',  # EN DASH
+    0x97: '\u2014',  # EM DASH
+    0x98: '\u02dc',  # SMALL TILDE
+    0x99: '\u2122',  # TRADE MARK SIGN
+    0x9a: '\u0161',  # LATIN SMALL LETTER S WITH CARON
+    0x9b: '\u203a',  # SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
+    0x9c: '\u0153',  # LATIN SMALL LIGATURE OE
+    0x9d: '\x9d',    # <control>
+    0x9e: '\u017e',  # LATIN SMALL LETTER Z WITH CARON
+    0x9f: '\u0178',  # LATIN CAPITAL LETTER Y WITH DIAERESIS
+}
+
+_invalid_codepoints = {
+    # 0x0001 to 0x0008
+    0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
+    # 0x000E to 0x001F
+    0xe, 0xf, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19,
+    0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
+    # 0x007F to 0x009F
+    0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a,
+    0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96,
+    0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
+    # 0xFDD0 to 0xFDEF
+    0xfdd0, 0xfdd1, 0xfdd2, 0xfdd3, 0xfdd4, 0xfdd5, 0xfdd6, 0xfdd7, 0xfdd8,
+    0xfdd9, 0xfdda, 0xfddb, 0xfddc, 0xfddd, 0xfdde, 0xfddf, 0xfde0, 0xfde1,
+    0xfde2, 0xfde3, 0xfde4, 0xfde5, 0xfde6, 0xfde7, 0xfde8, 0xfde9, 0xfdea,
+    0xfdeb, 0xfdec, 0xfded, 0xfdee, 0xfdef,
+    # others
+    0xb, 0xfffe, 0xffff, 0x1fffe, 0x1ffff, 0x2fffe, 0x2ffff, 0x3fffe, 0x3ffff,
+    0x4fffe, 0x4ffff, 0x5fffe, 0x5ffff, 0x6fffe, 0x6ffff, 0x7fffe, 0x7ffff,
+    0x8fffe, 0x8ffff, 0x9fffe, 0x9ffff, 0xafffe, 0xaffff, 0xbfffe, 0xbffff,
+    0xcfffe, 0xcffff, 0xdfffe, 0xdffff, 0xefffe, 0xeffff, 0xffffe, 0xfffff,
+    0x10fffe, 0x10ffff
+}
+
+
+def _replace_charref(s):
+    s = s.group(1)
+    if s[0] == '#':
+        # numeric charref
+        if s[1] in 'xX':
+            num = int(s[2:].rstrip(';'), 16)
+        else:
+            num = int(s[1:].rstrip(';'))
+        if num in _invalid_charrefs:
+            return _invalid_charrefs[num]
+        if 0xD800 <= num <= 0xDFFF or num > 0x10FFFF:
+            return '\uFFFD'
+        if num in _invalid_codepoints:
+            return ''
+        return chr(num)
+    else:
+        # named charref
+        if s in _html5:
+            return _html5[s]
+        # find the longest matching name (as defined by the standard)
+        for x in range(len(s)-1, 1, -1):
+            if s[:x] in _html5:
+                return _html5[s[:x]] + s[x:]
+        else:
+            return '&' + s
+
+
+_charref = _re.compile(r'&(#[0-9]+;?'
+                       r'|#[xX][0-9a-fA-F]+;?'
+                       r'|[^\t\n\f <&#;]{1,32};?)')
+
+def unescape(s):
+    """
+    Convert all named and numeric character references (e.g. &gt;, &#62;,
+    &x3e;) in the string s to the corresponding unicode characters.
+    This function uses the rules defined by the HTML 5 standard
+    for both valid and invalid character references, and the list of
+    HTML 5 named character references defined in html.entities.html5.
+    """
+    if '&' not in s:
+        return s
+    return _charref.sub(_replace_charref, s)
diff --git a/Lib/html/entities.py b/Lib/html/entities.py
index e891ad6..f7deae6 100644
--- a/Lib/html/entities.py
+++ b/Lib/html/entities.py
@@ -1,6 +1,6 @@
 """HTML character entity references."""
 
-# maps the HTML entity name to the Unicode codepoint
+# maps the HTML entity name to the Unicode code point
 name2codepoint = {
     'AElig':    0x00c6, # latin capital letter AE = latin capital ligature AE, U+00C6 ISOlat1
     'Aacute':   0x00c1, # latin capital letter A with acute, U+00C1 ISOlat1
@@ -2492,7 +2492,7 @@
     'zwnj;': '\u200c',
 }
 
-# maps the Unicode codepoint to the HTML entity name
+# maps the Unicode code point to the HTML entity name
 codepoint2name = {}
 
 # maps the HTML entity name to the character
diff --git a/Lib/html/parser.py b/Lib/html/parser.py
index 63fe774..a650d5e 100644
--- a/Lib/html/parser.py
+++ b/Lib/html/parser.py
@@ -8,9 +8,14 @@
 # and CDATA (character data -- only end tags are special).
 
 
-import _markupbase
 import re
 import warnings
+import _markupbase
+
+from html import unescape
+
+
+__all__ = ['HTMLParser']
 
 # Regular expressions used for parsing
 
@@ -92,6 +97,8 @@
         return result
 
 
+_default_sentinel = object()
+
 class HTMLParser(_markupbase.ParserBase):
     """Find tags and other markup and call handler functions.
 
@@ -105,26 +112,39 @@
     self.handle_startendtag(); end tags by self.handle_endtag().  The
     data between tags is passed from the parser to the derived class
     by calling self.handle_data() with the data as argument (the data
-    may be split up in arbitrary chunks).  Entity references are
-    passed by calling self.handle_entityref() with the entity
-    reference as the argument.  Numeric character references are
-    passed to self.handle_charref() with the string containing the
-    reference as the argument.
+    may be split up in arbitrary chunks).  If convert_charrefs is
+    True the character references are converted automatically to the
+    corresponding Unicode character (and self.handle_data() is no
+    longer split in chunks), otherwise they are passed by calling
+    self.handle_entityref() or self.handle_charref() with the string
+    containing respectively the named or numeric reference as the
+    argument.
     """
 
     CDATA_CONTENT_ELEMENTS = ("script", "style")
 
-    def __init__(self, strict=False):
+    def __init__(self, strict=_default_sentinel, *,
+                 convert_charrefs=_default_sentinel):
         """Initialize and reset this instance.
 
+        If convert_charrefs is True (default: False), all character references
+        are automatically converted to the corresponding Unicode characters.
         If strict is set to False (the default) the parser will parse invalid
         markup, otherwise it will raise an error.  Note that the strict mode
-        is deprecated.
+        and argument are deprecated.
         """
-        if strict:
-            warnings.warn("The strict mode is deprecated.",
+        if strict is not _default_sentinel:
+            warnings.warn("The strict argument and mode are deprecated.",
                           DeprecationWarning, stacklevel=2)
+        else:
+            strict = False  # default
         self.strict = strict
+        if convert_charrefs is _default_sentinel:
+            convert_charrefs = False  # default
+            warnings.warn("The value of convert_charrefs will become True in "
+                          "3.5. You are encouraged to set the value explicitly.",
+                          DeprecationWarning, stacklevel=2)
+        self.convert_charrefs = convert_charrefs
         self.reset()
 
     def reset(self):
@@ -149,6 +169,8 @@
         self.goahead(1)
 
     def error(self, message):
+        warnings.warn("The 'error' method is deprecated.",
+                      DeprecationWarning, stacklevel=2)
         raise HTMLParseError(message, self.getpos())
 
     __starttag_text = None
@@ -173,14 +195,25 @@
         i = 0
         n = len(rawdata)
         while i < n:
-            match = self.interesting.search(rawdata, i) # < or &
-            if match:
-                j = match.start()
+            if self.convert_charrefs and not self.cdata_elem:
+                j = rawdata.find('<', i)
+                if j < 0:
+                    if not end:
+                        break  # wait till we get all the text
+                    j = n
             else:
-                if self.cdata_elem:
-                    break
-                j = n
-            if i < j: self.handle_data(rawdata[i:j])
+                match = self.interesting.search(rawdata, i)  # < or &
+                if match:
+                    j = match.start()
+                else:
+                    if self.cdata_elem:
+                        break
+                    j = n
+            if i < j:
+                if self.convert_charrefs and not self.cdata_elem:
+                    self.handle_data(unescape(rawdata[i:j]))
+                else:
+                    self.handle_data(rawdata[i:j])
             i = self.updatepos(i, j)
             if i == n: break
             startswith = rawdata.startswith
@@ -215,7 +248,10 @@
                             k = i + 1
                     else:
                         k += 1
-                    self.handle_data(rawdata[i:k])
+                    if self.convert_charrefs and not self.cdata_elem:
+                        self.handle_data(unescape(rawdata[i:k]))
+                    else:
+                        self.handle_data(rawdata[i:k])
                 i = self.updatepos(i, k)
             elif startswith("&#", i):
                 match = charref.match(rawdata, i)
@@ -266,7 +302,10 @@
                 assert 0, "interesting.search() lied"
         # end while
         if end and i < n and not self.cdata_elem:
-            self.handle_data(rawdata[i:n])
+            if self.convert_charrefs and not self.cdata_elem:
+                self.handle_data(unescape(rawdata[i:n]))
+            else:
+                self.handle_data(rawdata[i:n])
             i = self.updatepos(i, n)
         self.rawdata = rawdata[i:]
 
@@ -349,7 +388,7 @@
                  attrvalue[:1] == '"' == attrvalue[-1:]:
                 attrvalue = attrvalue[1:-1]
             if attrvalue:
-                attrvalue = self.unescape(attrvalue)
+                attrvalue = unescape(attrvalue)
             attrs.append((attrname.lower(), attrvalue))
             k = m.end()
 
@@ -505,31 +544,7 @@
 
     # Internal -- helper to remove special character quoting
     def unescape(self, s):
-        if '&' not in s:
-            return s
-        def replaceEntities(s):
-            s = s.groups()[0]
-            try:
-                if s[0] == "#":
-                    s = s[1:]
-                    if s[0] in ['x','X']:
-                        c = int(s[1:].rstrip(';'), 16)
-                    else:
-                        c = int(s.rstrip(';'))
-                    return chr(c)
-            except ValueError:
-                return '&#' + s
-            else:
-                from html.entities import html5
-                if s in html5:
-                    return html5[s]
-                elif s.endswith(';'):
-                    return '&' + s
-                for x in range(2, len(s)):
-                    if s[:x] in html5:
-                        return html5[s[:x]] + s[x:]
-                else:
-                    return '&' + s
-
-        return re.sub(r"&(#?[xX]?(?:[0-9a-fA-F]+;|\w{1,32};?))",
-                      replaceEntities, s, flags=re.ASCII)
+        warnings.warn('The unescape method is deprecated and will be removed '
+                      'in 3.5, use html.unescape() instead.',
+                      DeprecationWarning, stacklevel=2)
+        return unescape(s)
diff --git a/Lib/http/client.py b/Lib/http/client.py
index e05c84d..6de4b0e 100644
--- a/Lib/http/client.py
+++ b/Lib/http/client.py
@@ -73,7 +73,6 @@
 import socket
 import collections
 from urllib.parse import urlsplit
-import warnings
 
 __all__ = ["HTTPResponse", "HTTPConnection",
            "HTTPException", "NotConnected", "UnknownProtocol",
@@ -271,8 +270,6 @@
     return email.parser.Parser(_class=_class).parsestr(hstring)
 
 
-_strict_sentinel = object()
-
 class HTTPResponse(io.RawIOBase):
 
     # See RFC 2616 sec 19.6 and RFC 1945 sec 6 for details.
@@ -282,7 +279,7 @@
     # text following RFC 2047.  The basic status line parsing only
     # accepts iso-8859-1.
 
-    def __init__(self, sock, debuglevel=0, strict=_strict_sentinel, method=None, url=None):
+    def __init__(self, sock, debuglevel=0, method=None, url=None):
         # If the response includes a content-length header, we need to
         # make sure that the client doesn't read more than the
         # specified number of bytes.  If it does, it will block until
@@ -292,10 +289,6 @@
         # clients unless they know what they are doing.
         self.fp = sock.makefile("rb")
         self.debuglevel = debuglevel
-        if strict is not _strict_sentinel:
-            warnings.warn("the 'strict' argument isn't supported anymore; "
-                "http.client now always assumes HTTP/1.x compliant servers.",
-                DeprecationWarning, 2)
         self._method = method
 
         # The HTTPResponse object is returned via urllib.  The clients
@@ -732,13 +725,17 @@
     default_port = HTTP_PORT
     auto_open = 1
     debuglevel = 0
+    # TCP Maximum Segment Size (MSS) is determined by the TCP stack on
+    # a per-connection basis.  There is no simple and efficient
+    # platform independent mechanism for determining the MSS, so
+    # instead a reasonable estimate is chosen.  The getsockopt()
+    # interface using the TCP_MAXSEG parameter may be a suitable
+    # approach on some operating systems. A value of 16KiB is chosen
+    # as a reasonable estimate of the maximum MSS.
+    mss = 16384
 
-    def __init__(self, host, port=None, strict=_strict_sentinel,
-                 timeout=socket._GLOBAL_DEFAULT_TIMEOUT, source_address=None):
-        if strict is not _strict_sentinel:
-            warnings.warn("the 'strict' argument isn't supported anymore; "
-                "http.client now always assumes HTTP/1.x compliant servers.",
-                DeprecationWarning, 2)
+    def __init__(self, host, port=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
+                 source_address=None):
         self.timeout = timeout
         self.source_address = source_address
         self.sock = None
@@ -750,22 +747,37 @@
         self._tunnel_port = None
         self._tunnel_headers = {}
 
-        self._set_hostport(host, port)
+        (self.host, self.port) = self._get_hostport(host, port)
+
+        # This is stored as an instance variable to allow unit
+        # tests to replace it with a suitable mockup
+        self._create_connection = socket.create_connection
 
     def set_tunnel(self, host, port=None, headers=None):
-        """ Sets up the host and the port for the HTTP CONNECT Tunnelling.
+        """Set up host and port for HTTP CONNECT tunnelling.
 
-        The headers argument should be a mapping of extra HTTP headers
-        to send with the CONNECT request.
+        In a connection that uses HTTP CONNECT tunneling, the host passed to the
+        constructor is used as a proxy server that relays all communication to
+        the endpoint passed to `set_tunnel`. This done by sending an HTTP
+        CONNECT request to the proxy server when the connection is established.
+
+        This method must be called before the HTML connection has been
+        established.
+
+        The headers argument should be a mapping of extra HTTP headers to send
+        with the CONNECT request.
         """
-        self._tunnel_host = host
-        self._tunnel_port = port
+
+        if self.sock:
+            raise RuntimeError("Can't set up tunnel for established connection")
+
+        self._tunnel_host, self._tunnel_port = self._get_hostport(host, port)
         if headers:
             self._tunnel_headers = headers
         else:
             self._tunnel_headers.clear()
 
-    def _set_hostport(self, host, port):
+    def _get_hostport(self, host, port):
         if port is None:
             i = host.rfind(':')
             j = host.rfind(']')         # ipv6 addresses have [...]
@@ -782,15 +794,15 @@
                 port = self.default_port
             if host and host[0] == '[' and host[-1] == ']':
                 host = host[1:-1]
-        self.host = host
-        self.port = port
+
+        return (host, port)
 
     def set_debuglevel(self, level):
         self.debuglevel = level
 
     def _tunnel(self):
-        self._set_hostport(self._tunnel_host, self._tunnel_port)
-        connect_str = "CONNECT %s:%d HTTP/1.0\r\n" % (self.host, self.port)
+        connect_str = "CONNECT %s:%d HTTP/1.0\r\n" % (self._tunnel_host,
+            self._tunnel_port)
         connect_bytes = connect_str.encode("ascii")
         self.send(connect_bytes)
         for header, value in self._tunnel_headers.items():
@@ -804,8 +816,8 @@
 
         if code != 200:
             self.close()
-            raise socket.error("Tunnel connection failed: %d %s" % (code,
-                                                                    message.strip()))
+            raise OSError("Tunnel connection failed: %d %s" % (code,
+                                                               message.strip()))
         while True:
             line = response.fp.readline(_MAXLINE + 1)
             if len(line) > _MAXLINE:
@@ -818,8 +830,9 @@
 
     def connect(self):
         """Connect to the host and port specified in __init__."""
-        self.sock = socket.create_connection((self.host,self.port),
-                                             self.timeout, self.source_address)
+        self.sock = self._create_connection((self.host,self.port),
+                                            self.timeout, self.source_address)
+
         if self._tunnel_host:
             self._tunnel()
 
@@ -899,8 +912,11 @@
         del self._buffer[:]
         # If msg and message_body are sent in a single send() call,
         # it will avoid performance problems caused by the interaction
-        # between delayed ack and the Nagle algorithm.
-        if isinstance(message_body, bytes):
+        # between delayed ack and the Nagle algorithm. However,
+        # there is no performance gain if the message is larger
+        # than MSS (and there is a memory penalty for the message
+        # copy).
+        if isinstance(message_body, bytes) and len(message_body) < self.mss:
             msg += message_body
             message_body = None
         self.send(msg)
@@ -985,22 +1001,29 @@
                         netloc_enc = netloc.encode("idna")
                     self.putheader('Host', netloc_enc)
                 else:
+                    if self._tunnel_host:
+                        host = self._tunnel_host
+                        port = self._tunnel_port
+                    else:
+                        host = self.host
+                        port = self.port
+
                     try:
-                        host_enc = self.host.encode("ascii")
+                        host_enc = host.encode("ascii")
                     except UnicodeEncodeError:
-                        host_enc = self.host.encode("idna")
+                        host_enc = host.encode("idna")
 
                     # As per RFC 273, IPv6 address should be wrapped with []
                     # when used as Host header
 
-                    if self.host.find(':') >= 0:
+                    if host.find(':') >= 0:
                         host_enc = b'[' + host_enc + b']'
 
-                    if self.port == self.default_port:
+                    if port == self.default_port:
                         self.putheader('Host', host_enc)
                     else:
                         host_enc = host_enc.decode("ascii")
-                        self.putheader('Host', "%s:%s" % (host_enc, self.port))
+                        self.putheader('Host', "%s:%s" % (host_enc, port))
 
             # note: we are assuming that clients will not attempt to set these
             #       headers since *this* library must deal with the
@@ -1144,18 +1167,22 @@
         else:
             response = self.response_class(self.sock, method=self._method)
 
-        response.begin()
-        assert response.will_close != _UNKNOWN
-        self.__state = _CS_IDLE
+        try:
+            response.begin()
+            assert response.will_close != _UNKNOWN
+            self.__state = _CS_IDLE
 
-        if response.will_close:
-            # this effectively passes the connection to the response
-            self.close()
-        else:
-            # remember this, so we can tell when it is complete
-            self.__response = response
+            if response.will_close:
+                # this effectively passes the connection to the response
+                self.close()
+            else:
+                # remember this, so we can tell when it is complete
+                self.__response = response
 
-        return response
+            return response
+        except:
+            response.close()
+            raise
 
 try:
     import ssl
@@ -1170,20 +1197,19 @@
         # XXX Should key_file and cert_file be deprecated in favour of context?
 
         def __init__(self, host, port=None, key_file=None, cert_file=None,
-                     strict=_strict_sentinel, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
-                     source_address=None, *, context=None, check_hostname=None):
-            super(HTTPSConnection, self).__init__(host, port, strict, timeout,
+                     timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
+                     source_address=None, *, context=None,
+                     check_hostname=None):
+            super(HTTPSConnection, self).__init__(host, port, timeout,
                                                   source_address)
             self.key_file = key_file
             self.cert_file = cert_file
             if context is None:
-                # Some reasonable defaults
-                context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
-                context.options |= ssl.OP_NO_SSLv2
+                context = ssl._create_default_https_context()
             will_verify = context.verify_mode != ssl.CERT_NONE
             if check_hostname is None:
-                check_hostname = will_verify
-            elif check_hostname and not will_verify:
+                check_hostname = context.check_hostname
+            if check_hostname and not will_verify:
                 raise ValueError("check_hostname needs a SSL context with "
                                  "either CERT_OPTIONAL or CERT_REQUIRED")
             if key_file or cert_file:
@@ -1194,23 +1220,22 @@
         def connect(self):
             "Connect to a host on a given (SSL) port."
 
-            sock = socket.create_connection((self.host, self.port),
-                                            self.timeout, self.source_address)
+            super().connect()
 
             if self._tunnel_host:
-                self.sock = sock
-                self._tunnel()
+                server_hostname = self._tunnel_host
+            else:
+                server_hostname = self.host
 
-            server_hostname = self.host if ssl.HAS_SNI else None
-            self.sock = self._context.wrap_socket(sock,
+            self.sock = self._context.wrap_socket(self.sock,
                                                   server_hostname=server_hostname)
-            try:
-                if self._check_hostname:
-                    ssl.match_hostname(self.sock.getpeercert(), self.host)
-            except Exception:
-                self.sock.shutdown(socket.SHUT_RDWR)
-                self.sock.close()
-                raise
+            if not self._context.check_hostname and self._check_hostname:
+                try:
+                    ssl.match_hostname(self.sock.getpeercert(), server_hostname)
+                except Exception:
+                    self.sock.shutdown(socket.SHUT_RDWR)
+                    self.sock.close()
+                    raise
 
     __all__.append("HTTPSConnection")
 
diff --git a/Lib/http/cookiejar.py b/Lib/http/cookiejar.py
index 9fcd4c6..7e4982f 100644
--- a/Lib/http/cookiejar.py
+++ b/Lib/http/cookiejar.py
@@ -1193,8 +1193,7 @@
             pass
         else:
             mapping = True
-            for subobj in deepvalues(obj):
-                yield subobj
+            yield from deepvalues(obj)
         if not mapping:
             yield obj
 
@@ -1723,16 +1722,16 @@
     def __repr__(self):
         r = []
         for cookie in self: r.append(repr(cookie))
-        return "<%s[%s]>" % (self.__class__, ", ".join(r))
+        return "<%s[%s]>" % (self.__class__.__name__, ", ".join(r))
 
     def __str__(self):
         r = []
         for cookie in self: r.append(str(cookie))
-        return "<%s[%s]>" % (self.__class__, ", ".join(r))
+        return "<%s[%s]>" % (self.__class__.__name__, ", ".join(r))
 
 
-# derives from IOError for backwards-compatibility with Python 2.4.0
-class LoadError(IOError): pass
+# derives from OSError for backwards-compatibility with Python 2.4.0
+class LoadError(OSError): pass
 
 class FileCookieJar(CookieJar):
     """CookieJar that can be loaded from and saved to a file."""
@@ -1762,17 +1761,14 @@
             if self.filename is not None: filename = self.filename
             else: raise ValueError(MISSING_FILENAME_TEXT)
 
-        f = open(filename)
-        try:
+        with open(filename) as f:
             self._really_load(f, filename, ignore_discard, ignore_expires)
-        finally:
-            f.close()
 
     def revert(self, filename=None,
                ignore_discard=False, ignore_expires=False):
         """Clear all cookies and reload cookies from a saved file.
 
-        Raises LoadError (or IOError) if reversion is not successful; the
+        Raises LoadError (or OSError) if reversion is not successful; the
         object's state will not be altered if this happens.
 
         """
@@ -1787,7 +1783,7 @@
             self._cookies = {}
             try:
                 self.load(filename, ignore_discard, ignore_expires)
-            except (LoadError, IOError):
+            except OSError:
                 self._cookies = old_state
                 raise
 
@@ -1796,7 +1792,7 @@
 
 
 def lwp_cookie_str(cookie):
-    """Return string representation of Cookie in an the LWP cookie file format.
+    """Return string representation of Cookie in the LWP cookie file format.
 
     Actually, the format is extended a bit -- see module docstring.
 
@@ -1857,15 +1853,12 @@
             if self.filename is not None: filename = self.filename
             else: raise ValueError(MISSING_FILENAME_TEXT)
 
-        f = open(filename, "w")
-        try:
+        with open(filename, "w") as f:
             # There really isn't an LWP Cookies 2.0 format, but this indicates
             # that there is extra information in here (domain_dot and
             # port_spec) while still being compatible with libwww-perl, I hope.
             f.write("#LWP-Cookies-2.0\n")
             f.write(self.as_lwp_str(ignore_discard, ignore_expires))
-        finally:
-            f.close()
 
     def _really_load(self, f, filename, ignore_discard, ignore_expires):
         magic = f.readline()
@@ -1938,8 +1931,7 @@
                     if not ignore_expires and c.is_expired(now):
                         continue
                     self.set_cookie(c)
-
-        except IOError:
+        except OSError:
             raise
         except Exception:
             _warn_unhandled_exception()
@@ -2045,7 +2037,7 @@
                     continue
                 self.set_cookie(c)
 
-        except IOError:
+        except OSError:
             raise
         except Exception:
             _warn_unhandled_exception()
@@ -2057,8 +2049,7 @@
             if self.filename is not None: filename = self.filename
             else: raise ValueError(MISSING_FILENAME_TEXT)
 
-        f = open(filename, "w")
-        try:
+        with open(filename, "w") as f:
             f.write(self.header)
             now = time.time()
             for cookie in self:
@@ -2087,5 +2078,3 @@
                     "\t".join([cookie.domain, initial_dot, cookie.path,
                                secure, expires, name, value])+
                     "\n")
-        finally:
-            f.close()
diff --git a/Lib/http/cookies.py b/Lib/http/cookies.py
index 556d101..3e1abd7 100644
--- a/Lib/http/cookies.py
+++ b/Lib/http/cookies.py
@@ -330,8 +330,8 @@
         "comment"  : "Comment",
         "domain"   : "Domain",
         "max-age"  : "Max-Age",
-        "secure"   : "secure",
-        "httponly" : "httponly",
+        "secure"   : "Secure",
+        "httponly" : "HttpOnly",
         "version"  : "Version",
     }
 
@@ -486,8 +486,12 @@
 
     def __setitem__(self, key, value):
         """Dictionary style assignment."""
-        rval, cval = self.value_encode(value)
-        self.__set(key, rval, cval)
+        if isinstance(value, Morsel):
+            # allow assignment of constructed Morsels (e.g. for pickling)
+            dict.__setitem__(self, key, value)
+        else:
+            rval, cval = self.value_encode(value)
+            self.__set(key, rval, cval)
 
     def output(self, attrs=None, header="Set-Cookie:", sep="\015\012"):
         """Return a string suitable for HTTP."""
diff --git a/Lib/http/server.py b/Lib/http/server.py
index 7d3b506..cfa29f4 100644
--- a/Lib/http/server.py
+++ b/Lib/http/server.py
@@ -85,8 +85,6 @@
 __all__ = ["HTTPServer", "BaseHTTPRequestHandler"]
 
 import html
-import email.message
-import email.parser
 import http.client
 import io
 import mimetypes
@@ -401,12 +399,17 @@
         while not self.close_connection:
             self.handle_one_request()
 
-    def send_error(self, code, message=None):
+    def send_error(self, code, message=None, explain=None):
         """Send and log an error reply.
 
-        Arguments are the error code, and a detailed message.
-        The detailed message defaults to the short entry matching the
-        response code.
+        Arguments are
+        * code:    an HTTP error code
+                   3 digits
+        * message: a simple optional 1 line reason phrase.
+                   *( HTAB / SP / VCHAR / %x80-FF )
+                   defaults to short entry matching the response code
+        * explain: a detailed message defaults to the long entry
+                   matching the response code.
 
         This sends an error response (so it must be called before any
         output has been generated), logs the error, and finally sends
@@ -420,17 +423,20 @@
             shortmsg, longmsg = '???', '???'
         if message is None:
             message = shortmsg
-        explain = longmsg
+        if explain is None:
+            explain = longmsg
         self.log_error("code %d, message %s", code, message)
         # using _quote_html to prevent Cross Site Scripting attacks (see bug #1100201)
         content = (self.error_message_format %
-                   {'code': code, 'message': _quote_html(message), 'explain': explain})
+                   {'code': code, 'message': _quote_html(message), 'explain': _quote_html(explain)})
+        body = content.encode('UTF-8', 'replace')
         self.send_response(code, message)
         self.send_header("Content-Type", self.error_content_type)
         self.send_header('Connection', 'close')
+        self.send_header('Content-Length', int(len(body)))
         self.end_headers()
         if self.command != 'HEAD' and code >= 200 and code not in (204, 304):
-            self.wfile.write(content.encode('UTF-8', 'replace'))
+            self.wfile.write(body)
 
     def send_response(self, code, message=None):
         """Add the response header to the headers buffer and log the
@@ -695,10 +701,14 @@
         path = self.translate_path(self.path)
         f = None
         if os.path.isdir(path):
-            if not self.path.endswith('/'):
+            parts = urllib.parse.urlsplit(self.path)
+            if not parts.path.endswith('/'):
                 # redirect browser - doing basically what apache does
                 self.send_response(301)
-                self.send_header("Location", self.path + "/")
+                new_parts = (parts[0], parts[1], parts[2] + '/',
+                             parts[3], parts[4])
+                new_url = urllib.parse.urlunsplit(new_parts)
+                self.send_header("Location", new_url)
                 self.end_headers()
                 return None
             for index in "index.html", "index.htm":
@@ -711,7 +721,7 @@
         ctype = self.guess_type(path)
         try:
             f = open(path, 'rb')
-        except IOError:
+        except OSError:
             self.send_error(404, "File not found")
             return None
         try:
@@ -736,12 +746,17 @@
         """
         try:
             list = os.listdir(path)
-        except os.error:
+        except OSError:
             self.send_error(404, "No permission to list directory")
             return None
         list.sort(key=lambda a: a.lower())
         r = []
-        displaypath = html.escape(urllib.parse.unquote(self.path))
+        try:
+            displaypath = urllib.parse.unquote(self.path,
+                                               errors='surrogatepass')
+        except UnicodeDecodeError:
+            displaypath = urllib.parse.unquote(path)
+        displaypath = html.escape(displaypath)
         enc = sys.getfilesystemencoding()
         title = 'Directory listing for %s' % displaypath
         r.append('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" '
@@ -763,9 +778,11 @@
                 displayname = name + "@"
                 # Note: a link to a directory displays with @ and links with /
             r.append('<li><a href="%s">%s</a></li>'
-                    % (urllib.parse.quote(linkname), html.escape(displayname)))
+                    % (urllib.parse.quote(linkname,
+                                          errors='surrogatepass'),
+                       html.escape(displayname)))
         r.append('</ul>\n<hr>\n</body>\n</html>\n')
-        encoded = '\n'.join(r).encode(enc)
+        encoded = '\n'.join(r).encode(enc, 'surrogateescape')
         f = io.BytesIO()
         f.write(encoded)
         f.seek(0)
@@ -788,7 +805,11 @@
         path = path.split('#',1)[0]
         # Don't forget explicit trailing slash when normalizing. Issue17324
         trailing_slash = path.rstrip().endswith('/')
-        path = posixpath.normpath(urllib.parse.unquote(path))
+        try:
+            path = urllib.parse.unquote(path, errors='surrogatepass')
+        except UnicodeDecodeError:
+            path = urllib.parse.unquote(path)
+        path = posixpath.normpath(path)
         words = path.split('/')
         words = filter(None, words)
         path = os.getcwd()
@@ -1130,7 +1151,7 @@
             try:
                 try:
                     os.setuid(nobody)
-                except os.error:
+                except OSError:
                     pass
                 os.dup2(self.rfile.fileno(), 0)
                 os.dup2(self.wfile.fileno(), 1)
@@ -1183,15 +1204,15 @@
                 self.log_message("CGI script exited OK")
 
 
-def test(HandlerClass = BaseHTTPRequestHandler,
-         ServerClass = HTTPServer, protocol="HTTP/1.0", port=8000):
+def test(HandlerClass=BaseHTTPRequestHandler,
+         ServerClass=HTTPServer, protocol="HTTP/1.0", port=8000, bind=""):
     """Test the HTTP request handler class.
 
     This runs an HTTP server on port 8000 (or the first command line
     argument).
 
     """
-    server_address = ('', port)
+    server_address = (bind, port)
 
     HandlerClass.protocol_version = protocol
     httpd = ServerClass(server_address, HandlerClass)
@@ -1209,12 +1230,16 @@
     parser = argparse.ArgumentParser()
     parser.add_argument('--cgi', action='store_true',
                        help='Run as CGI Server')
+    parser.add_argument('--bind', '-b', default='', metavar='ADDRESS',
+                        help='Specify alternate bind address '
+                             '[default: all interfaces]')
     parser.add_argument('port', action='store',
                         default=8000, type=int,
                         nargs='?',
                         help='Specify alternate port [default: 8000]')
     args = parser.parse_args()
     if args.cgi:
-        test(HandlerClass=CGIHTTPRequestHandler, port=args.port)
+        handler_class = CGIHTTPRequestHandler
     else:
-        test(HandlerClass=SimpleHTTPRequestHandler, port=args.port)
+        handler_class = SimpleHTTPRequestHandler
+    test(HandlerClass=handler_class, port=args.port, bind=args.bind)
diff --git a/Lib/idlelib/AutoComplete.py b/Lib/idlelib/AutoComplete.py
index f366030..b20512d 100644
--- a/Lib/idlelib/AutoComplete.py
+++ b/Lib/idlelib/AutoComplete.py
@@ -226,3 +226,8 @@
         namespace = sys.modules.copy()
         namespace.update(__main__.__dict__)
         return eval(name, namespace)
+
+
+if __name__ == '__main__':
+    from unittest import main
+    main('idlelib.idle_test.test_autocomplete', verbosity=2)
diff --git a/Lib/idlelib/AutoExpand.py b/Lib/idlelib/AutoExpand.py
index 9e93d57..7059054 100644
--- a/Lib/idlelib/AutoExpand.py
+++ b/Lib/idlelib/AutoExpand.py
@@ -1,3 +1,17 @@
+'''Complete the current word before the cursor with words in the editor.
+
+Each menu selection or shortcut key selection replaces the word with a
+different word with the same prefix. The search for matches begins
+before the target and moves toward the top of the editor. It then starts
+after the cursor and moves down. It then returns to the original word and
+the cycle starts again.
+
+Changing the current text line or leaving the cursor in a different
+place before requesting the next selection causes AutoExpand to reset
+its state.
+
+This is an extension file and there is only one instance of AutoExpand.
+'''
 import string
 import re
 
@@ -20,6 +34,7 @@
         self.state = None
 
     def expand_word_event(self, event):
+        "Replace the current word with the next expansion."
         curinsert = self.text.index("insert")
         curline = self.text.get("insert linestart", "insert lineend")
         if not self.state:
@@ -46,6 +61,7 @@
         return "break"
 
     def getwords(self):
+        "Return a list of words that match the prefix before the cursor."
         word = self.getprevword()
         if not word:
             return []
@@ -76,8 +92,13 @@
         return words
 
     def getprevword(self):
+        "Return the word prefix before the cursor."
         line = self.text.get("insert linestart", "insert")
         i = len(line)
         while i > 0 and line[i-1] in self.wordchars:
             i = i-1
         return line[i:]
+
+if __name__ == '__main__':
+    import unittest
+    unittest.main('idlelib.idle_test.test_autoexpand', verbosity=2)
diff --git a/Lib/idlelib/Bindings.py b/Lib/idlelib/Bindings.py
index 65c0317..226671c 100644
--- a/Lib/idlelib/Bindings.py
+++ b/Lib/idlelib/Bindings.py
@@ -8,9 +8,16 @@
 windows.
 
 """
-import sys
+from importlib.util import find_spec
+
 from idlelib.configHandler import idleConf
-from idlelib import macosxSupport
+
+#   Warning: menudefs is altered in macosxSupport.overrideRootMenu()
+#   after it is determined that an OS X Aqua Tk is in use,
+#   which cannot be done until after Tk() is first called.
+#   Do not alter the 'file', 'options', or 'help' cascades here
+#   without altering overrideRootMenu() as well.
+#       TODO: Make this more robust
 
 menudefs = [
  # underscore prefixes character to underscore
@@ -70,7 +77,8 @@
    ('!_Auto-open Stack Viewer', '<<toggle-jit-stack-viewer>>'),
    ]),
  ('options', [
-   ('_Configure IDLE...', '<<open-config-dialog>>'),
+   ('Configure _IDLE', '<<open-config-dialog>>'),
+   ('Configure _Extensions', '<<open-config-extensions-dialog>>'),
    None,
    ]),
  ('help', [
@@ -81,27 +89,7 @@
    ]),
 ]
 
-if macosxSupport.runningAsOSXApp():
-    # Running as a proper MacOS application bundle. This block restructures
-    # the menus a little to make them conform better to the HIG.
-
-    quitItem = menudefs[0][1][-1]
-    closeItem = menudefs[0][1][-2]
-
-    # Remove the last 3 items of the file menu: a separator, close window and
-    # quit. Close window will be reinserted just above the save item, where
-    # it should be according to the HIG. Quit is in the application menu.
-    del menudefs[0][1][-3:]
-    menudefs[0][1].insert(6, closeItem)
-
-    # Remove the 'About' entry from the help menu, it is in the application
-    # menu
-    del menudefs[-1][1][0:2]
-
-    # Remove the 'Configure' entry from the options menu, it is in the
-    # application menu as 'Preferences'
-    del menudefs[-2][1][0:2]
+if find_spec('turtledemo'):
+    menudefs[-1][1].append(('Turtle Demo', '<<open-turtle-demo>>'))
 
 default_keydefs = idleConf.GetCurrentKeySet()
-
-del sys
diff --git a/Lib/idlelib/CallTipWindow.py b/Lib/idlelib/CallTipWindow.py
index 8e29dab..170d146 100644
--- a/Lib/idlelib/CallTipWindow.py
+++ b/Lib/idlelib/CallTipWindow.py
@@ -2,9 +2,8 @@
 
 After ToolTip.py, which uses ideas gleaned from PySol
 Used by the CallTips IDLE extension.
-
 """
-from tkinter import *
+from tkinter import Toplevel, Label, LEFT, SOLID, TclError
 
 HIDE_VIRTUAL_EVENT_NAME = "<<calltipwindow-hide>>"
 HIDE_SEQUENCES = ("<Key-Escape>", "<FocusOut>")
@@ -133,37 +132,29 @@
         return bool(self.tipwindow)
 
 
+def _calltip_window(parent):  # htest #
+    from tkinter import Toplevel, Text, LEFT, BOTH
 
-###############################
-#
-# Test Code
-#
-class container: # Conceptually an editor_window
-    def __init__(self):
-        root = Tk()
-        text = self.text = Text(root)
-        text.pack(side=LEFT, fill=BOTH, expand=1)
-        text.insert("insert", "string.split")
-        root.update()
-        self.calltip = CallTip(text)
+    top = Toplevel(parent)
+    top.title("Test calltips")
+    top.geometry("200x100+%d+%d" % (parent.winfo_rootx() + 200,
+                  parent.winfo_rooty() + 150))
+    text = Text(top)
+    text.pack(side=LEFT, fill=BOTH, expand=1)
+    text.insert("insert", "string.split")
+    top.update()
+    calltip = CallTip(text)
 
-        text.event_add("<<calltip-show>>", "(")
-        text.event_add("<<calltip-hide>>", ")")
-        text.bind("<<calltip-show>>", self.calltip_show)
-        text.bind("<<calltip-hide>>", self.calltip_hide)
-
-        text.focus_set()
-        root.mainloop()
-
-    def calltip_show(self, event):
-        self.calltip.showtip("Hello world")
-
-    def calltip_hide(self, event):
-        self.calltip.hidetip()
-
-def main():
-    # Test code
-    c=container()
+    def calltip_show(event):
+        calltip.showtip("(s=Hello world)", "insert", "end")
+    def calltip_hide(event):
+        calltip.hidetip()
+    text.event_add("<<calltip-show>>", "(")
+    text.event_add("<<calltip-hide>>", ")")
+    text.bind("<<calltip-show>>", calltip_show)
+    text.bind("<<calltip-hide>>", calltip_hide)
+    text.focus_set()
 
 if __name__=='__main__':
-    main()
+    from idlelib.idle_test.htest import run
+    run(_calltip_window)
diff --git a/Lib/idlelib/ClassBrowser.py b/Lib/idlelib/ClassBrowser.py
index 71176cd..5be65ef 100644
--- a/Lib/idlelib/ClassBrowser.py
+++ b/Lib/idlelib/ClassBrowser.py
@@ -19,13 +19,23 @@
 from idlelib.TreeWidget import TreeNode, TreeItem, ScrolledCanvas
 from idlelib.configHandler import idleConf
 
+file_open = None  # Method...Item and Class...Item use this.
+# Normally PyShell.flist.open, but there is no PyShell.flist for htest.
+
 class ClassBrowser:
 
-    def __init__(self, flist, name, path):
+    def __init__(self, flist, name, path, _htest=False):
         # XXX This API should change, if the file doesn't end in ".py"
         # XXX the code here is bogus!
+        """
+        _htest - bool, change box when location running htest.
+        """
+        global file_open
+        if not _htest:
+            file_open = PyShell.flist.open
         self.name = name
         self.file = os.path.join(path[0], self.name + ".py")
+        self._htest = _htest
         self.init(flist)
 
     def close(self, event=None):
@@ -40,6 +50,9 @@
         self.top = top = ListedToplevel(flist.root)
         top.protocol("WM_DELETE_WINDOW", self.close)
         top.bind("<Escape>", self.close)
+        if self._htest: # place dialog below parent if running htest
+            top.geometry("+%d+%d" %
+                (flist.root.winfo_rootx(), flist.root.winfo_rooty() + 200))
         self.settitle()
         top.focus_set()
         # create scrolled canvas
@@ -94,7 +107,7 @@
             return []
         try:
             dict = pyclbr.readmodule_ex(name, [dir] + sys.path)
-        except ImportError as msg:
+        except ImportError:
             return []
         items = []
         self.classes = {}
@@ -163,7 +176,7 @@
     def OnDoubleClick(self):
         if not os.path.exists(self.file):
             return
-        edit = PyShell.flist.open(self.file)
+        edit = file_open(self.file)
         if hasattr(self.cl, 'lineno'):
             lineno = self.cl.lineno
             edit.gotoline(lineno)
@@ -199,10 +212,10 @@
     def OnDoubleClick(self):
         if not os.path.exists(self.file):
             return
-        edit = PyShell.flist.open(self.file)
+        edit = file_open(self.file)
         edit.gotoline(self.cl.methods[self.name])
 
-def main():
+def _class_browser(parent): #Wrapper for htest
     try:
         file = __file__
     except NameError:
@@ -213,9 +226,11 @@
             file = sys.argv[0]
     dir, file = os.path.split(file)
     name = os.path.splitext(file)[0]
-    ClassBrowser(PyShell.flist, name, [dir])
-    if sys.stdin is sys.__stdin__:
-        mainloop()
+    flist = PyShell.PyShellFileList(parent)
+    global file_open
+    file_open = flist.open
+    ClassBrowser(flist, name, [dir], _htest=True)
 
 if __name__ == "__main__":
-    main()
+    from idlelib.idle_test.htest import run
+    run(_class_browser)
diff --git a/Lib/idlelib/CodeContext.py b/Lib/idlelib/CodeContext.py
index 84491d5..44783b6 100644
--- a/Lib/idlelib/CodeContext.py
+++ b/Lib/idlelib/CodeContext.py
@@ -15,8 +15,8 @@
 from sys import maxsize as INFINITY
 from idlelib.configHandler import idleConf
 
-BLOCKOPENERS = set(["class", "def", "elif", "else", "except", "finally", "for",
-                    "if", "try", "while", "with"])
+BLOCKOPENERS = {"class", "def", "elif", "else", "except", "finally", "for",
+                    "if", "try", "while", "with"}
 UPDATEINTERVAL = 100 # millisec
 FONTUPDATEINTERVAL = 1000 # millisec
 
diff --git a/Lib/idlelib/ColorDelegator.py b/Lib/idlelib/ColorDelegator.py
index 61e2be4..13a9010 100644
--- a/Lib/idlelib/ColorDelegator.py
+++ b/Lib/idlelib/ColorDelegator.py
@@ -2,7 +2,6 @@
 import re
 import keyword
 import builtins
-from tkinter import *
 from idlelib.Delegator import Delegator
 from idlelib.configHandler import idleConf
 
@@ -32,7 +31,6 @@
 
 prog = re.compile(make_pat(), re.S)
 idprog = re.compile(r"\s+(\w+)", re.S)
-asprog = re.compile(r".*?\b(as)\b")
 
 class ColorDelegator(Delegator):
 
@@ -40,7 +38,6 @@
         Delegator.__init__(self)
         self.prog = prog
         self.idprog = idprog
-        self.asprog = asprog
         self.LoadTagDefs()
 
     def setdelegate(self, delegate):
@@ -72,7 +69,6 @@
             "DEFINITION": idleConf.GetHighlight(theme, "definition"),
             "SYNC": {'background':None,'foreground':None},
             "TODO": {'background':None,'foreground':None},
-            "BREAK": idleConf.GetHighlight(theme, "break"),
             "ERROR": idleConf.GetHighlight(theme, "error"),
             # The following is used by ReplaceDialog:
             "hit": idleConf.GetHighlight(theme, "hit"),
@@ -214,22 +210,6 @@
                                     self.tag_add("DEFINITION",
                                                  head + "+%dc" % a,
                                                  head + "+%dc" % b)
-                            elif value == "import":
-                                # color all the "as" words on same line, except
-                                # if in a comment; cheap approximation to the
-                                # truth
-                                if '#' in chars:
-                                    endpos = chars.index('#')
-                                else:
-                                    endpos = len(chars)
-                                while True:
-                                    m1 = self.asprog.match(chars, b, endpos)
-                                    if not m1:
-                                        break
-                                    a, b = m1.span(1)
-                                    self.tag_add("KEYWORD",
-                                                 head + "+%dc" % a,
-                                                 head + "+%dc" % b)
                     m = self.prog.search(chars, m.end())
                 if "SYNC" in self.tag_names(next + "-1c"):
                     head = next
@@ -253,17 +233,24 @@
         for tag in self.tagdefs:
             self.tag_remove(tag, "1.0", "end")
 
-def main():
+def _color_delegator(parent):  # htest #
+    from tkinter import Toplevel, Text
     from idlelib.Percolator import Percolator
-    root = Tk()
-    root.wm_protocol("WM_DELETE_WINDOW", root.quit)
-    text = Text(background="white")
+
+    top = Toplevel(parent)
+    top.title("Test ColorDelegator")
+    top.geometry("200x100+%d+%d" % (parent.winfo_rootx() + 200,
+                  parent.winfo_rooty() + 150))
+    source = "if somename: x = 'abc' # comment\nprint\n"
+    text = Text(top, background="white")
     text.pack(expand=1, fill="both")
+    text.insert("insert", source)
     text.focus_set()
+
     p = Percolator(text)
     d = ColorDelegator()
     p.insertfilter(d)
-    root.mainloop()
 
 if __name__ == "__main__":
-    main()
+    from idlelib.idle_test.htest import run
+    run(_color_delegator)
diff --git a/Lib/idlelib/Debugger.py b/Lib/idlelib/Debugger.py
index d4872ed..6875197 100644
--- a/Lib/idlelib/Debugger.py
+++ b/Lib/idlelib/Debugger.py
@@ -1,6 +1,5 @@
 import os
 import bdb
-import types
 from tkinter import *
 from idlelib.WindowList import ListedToplevel
 from idlelib.ScrolledList import ScrolledList
@@ -322,7 +321,7 @@
 class StackViewer(ScrolledList):
 
     def __init__(self, master, flist, gui):
-        if macosxSupport.runningAsOSXApp():
+        if macosxSupport.isAquaTk():
             # At least on with the stock AquaTk version on OSX 10.4 you'll
             # get an shaking GUI that eventually kills IDLE if the width
             # argument is specified.
diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py
index 4bf1111..1520ad0 100644
--- a/Lib/idlelib/EditorWindow.py
+++ b/Lib/idlelib/EditorWindow.py
@@ -1,7 +1,8 @@
 import importlib
 import importlib.abc
+import importlib.util
 import os
-from platform import python_version
+import platform
 import re
 import string
 import sys
@@ -25,6 +26,8 @@
 # The default tab setting for a Text widget, in average-width characters.
 TK_TABWIDTH_DEFAULT = 8
 
+_py_version = ' (%s)' % platform.python_version()
+
 def _sphinx_version():
     "Format sys.version_info to produce the Sphinx version string used to install the chm docs"
     major, minor, micro, level, serial = sys.version_info
@@ -78,6 +81,8 @@
         self.parent = None
 
 helpDialog = HelpDialog()  # singleton instance
+def _help_dialog(parent):  # wrapper for htest
+    helpDialog.show_dialog(parent)
 
 
 class EditorWindow(object):
@@ -108,8 +113,8 @@
                                        'Python%s.chm' % _sphinx_version())
                 if os.path.isfile(chmfile):
                     dochome = chmfile
-            elif macosxSupport.runningAsOSXApp():
-                # documentation is stored inside the python framework
+            elif sys.platform == 'darwin':
+                # documentation may be stored inside a python framework
                 dochome = os.path.join(sys.base_prefix,
                         'Resources/English.lproj/Documentation/index.html')
             dochome = os.path.normpath(dochome)
@@ -119,7 +124,7 @@
                     # Safari requires real file:-URLs
                     EditorWindow.help_url = 'file://' + EditorWindow.help_url
             else:
-                EditorWindow.help_url = "http://docs.python.org/%d.%d" % sys.version_info[:2]
+                EditorWindow.help_url = "https://docs.python.org/%d.%d/" % sys.version_info[:2]
         currentTheme=idleConf.CurrentTheme()
         self.flist = flist
         root = root or flist.root
@@ -165,7 +170,7 @@
 
         self.top.protocol("WM_DELETE_WINDOW", self.close)
         self.top.bind("<<close-window>>", self.close_event)
-        if macosxSupport.runningAsOSXApp():
+        if macosxSupport.isAquaTk():
             # Command-W on editorwindows doesn't work without this.
             text.bind('<<close-window>>', self.close_event)
             # Some OS X systems have only one mouse button,
@@ -184,6 +189,8 @@
         text.bind("<<python-docs>>", self.python_docs)
         text.bind("<<about-idle>>", self.about_dialog)
         text.bind("<<open-config-dialog>>", self.config_dialog)
+        text.bind("<<open-config-extensions-dialog>>",
+                  self.config_extensions_dialog)
         text.bind("<<open-module>>", self.open_module)
         text.bind("<<do-nothing>>", lambda event: "break")
         text.bind("<<select-all>>", self.select_all)
@@ -219,6 +226,7 @@
             text.bind("<<close-all-windows>>", self.flist.close_all_callback)
             text.bind("<<open-class-browser>>", self.open_class_browser)
             text.bind("<<open-path-browser>>", self.open_path_browser)
+            text.bind("<<open-turtle-demo>>", self.open_turtle_demo)
 
         self.set_status_bar()
         vbar['command'] = text.yview
@@ -408,7 +416,7 @@
 
     def set_status_bar(self):
         self.status_bar = self.MultiStatusBar(self.top)
-        if macosxSupport.runningAsOSXApp():
+        if sys.platform == "darwin":
             # Insert some padding to avoid obscuring some of the statusbar
             # by the resize widget.
             self.status_bar.set_label('_padding1', '    ', side=RIGHT)
@@ -431,13 +439,10 @@
         ("format", "F_ormat"),
         ("run", "_Run"),
         ("options", "_Options"),
-        ("windows", "_Windows"),
+        ("windows", "_Window"),
         ("help", "_Help"),
     ]
 
-    if macosxSupport.runningAsOSXApp():
-        menu_specs[-2] = ("windows", "_Window")
-
 
     def createmenubar(self):
         mbar = self.menubar
@@ -446,7 +451,7 @@
             underline, label = prepstr(label)
             menudict[name] = menu = Menu(mbar, name=name)
             mbar.add_cascade(label=label, menu=menu, underline=underline)
-        if macosxSupport.isCarbonAquaTk(self.root):
+        if macosxSupport.isCarbonTk():
             # Insert the application menu
             menudict['application'] = menu = Menu(mbar, name='apple')
             mbar.add_cascade(label='IDLE', menu=menu)
@@ -537,6 +542,8 @@
 
     def config_dialog(self, event=None):
         configDialog.ConfigDialog(self.top,'Settings')
+    def config_extensions_dialog(self, event=None):
+        configDialog.ConfigExtensionsDialog(self.top)
 
     def help_dialog(self, event=None):
         if self.root:
@@ -549,7 +556,7 @@
         if sys.platform[:3] == 'win':
             try:
                 os.startfile(self.help_url)
-            except WindowsError as why:
+            except OSError as why:
                 tkMessageBox.showerror(title='Document Start Failure',
                     message=str(why), parent=self.text)
         else:
@@ -660,20 +667,20 @@
             return
         # XXX Ought to insert current file's directory in front of path
         try:
-            loader = importlib.find_loader(name)
+            spec = importlib.util.find_spec(name)
         except (ValueError, ImportError) as msg:
             tkMessageBox.showerror("Import error", str(msg), parent=self.text)
             return
-        if loader is None:
+        if spec is None:
             tkMessageBox.showerror("Import error", "module not found",
                                    parent=self.text)
             return
-        if not isinstance(loader, importlib.abc.SourceLoader):
+        if not isinstance(spec.loader, importlib.abc.SourceLoader):
             tkMessageBox.showerror("Import error", "not a source-based module",
                                    parent=self.text)
             return
         try:
-            file_path = loader.get_filename(name)
+            file_path = spec.loader.get_filename(name)
         except AttributeError:
             tkMessageBox.showerror("Import error",
                                    "loader does not support get_filename",
@@ -683,16 +690,15 @@
             self.flist.open(file_path)
         else:
             self.io.loadfile(file_path)
+        return file_path
 
     def open_class_browser(self, event=None):
         filename = self.io.filename
-        if not filename:
-            tkMessageBox.showerror(
-                "No filename",
-                "This buffer has no associated filename",
-                master=self.text)
-            self.text.focus_set()
-            return None
+        if not (self.__class__.__name__ == 'PyShellEditorWindow'
+                and filename):
+            filename = self.open_module()
+            if filename is None:
+                return
         head, tail = os.path.split(filename)
         base, ext = os.path.splitext(tail)
         from idlelib import ClassBrowser
@@ -702,6 +708,14 @@
         from idlelib import PathBrowser
         PathBrowser.PathBrowser(self.flist)
 
+    def open_turtle_demo(self, event = None):
+        import subprocess
+
+        cmd = [sys.executable,
+               '-c',
+               'from turtledemo.__main__ import main; main()']
+        p = subprocess.Popen(cmd, shell=False)
+
     def gotoline(self, lineno):
         if lineno is not None and lineno > 0:
             self.text.mark_set("insert", "%d.0" % lineno)
@@ -752,7 +766,7 @@
         self.color = None
 
     def ResetColorizer(self):
-        "Update the colour theme"
+        "Update the color theme"
         # Called from self.filename_change_hook and from configDialog.py
         self._rmcolorizer()
         self._addcolorizer()
@@ -872,7 +886,7 @@
             if sys.platform[:3] == 'win':
                 try:
                     os.startfile(helpfile)
-                except WindowsError as why:
+                except OSError as why:
                     tkMessageBox.showerror(title='Document Start Failure',
                         message=str(why), parent=self.text)
             else:
@@ -932,7 +946,7 @@
         short = self.short_title()
         long = self.long_title()
         if short and long:
-            title = short + " - " + long
+            title = short + " - " + long + _py_version
         elif short:
             title = short
         elif long:
@@ -956,14 +970,13 @@
         self.undo.reset_undo()
 
     def short_title(self):
-        pyversion = "Python " + python_version() + ": "
         filename = self.io.filename
         if filename:
             filename = os.path.basename(filename)
         else:
             filename = "Untitled"
         # return unicode string to display non-ASCII chars correctly
-        return pyversion + self._filename_to_unicode(filename)
+        return self._filename_to_unicode(filename)
 
     def long_title(self):
         # return unicode string to display non-ASCII chars correctly
@@ -1063,7 +1076,7 @@
         try:
             try:
                 mod = importlib.import_module('.' + name, package=__package__)
-            except ImportError:
+            except (ImportError, TypeError):
                 mod = importlib.import_module(name)
         except ImportError:
             print("\nFailed to import extension: ", name)
@@ -1672,7 +1685,7 @@
     keylist = keydefs.get(eventname)
     # issue10940: temporary workaround to prevent hang with OS X Cocoa Tk 8.5
     # if not keylist:
-    if (not keylist) or (macosxSupport.runningAsOSXApp() and eventname in {
+    if (not keylist) or (macosxSupport.isCocoaTk() and eventname in {
                             "<<open-module>>",
                             "<<goto-line>>",
                             "<<change-indentwidth>>"}):
@@ -1699,19 +1712,20 @@
     tk.call('set', 'tcl_nonwordchars', '[^a-zA-Z0-9_]')
 
 
-def test():
-    root = Tk()
+def _editor_window(parent):  # htest #
+    # error if close master window first - timer event, after script
+    root = parent
     fixwordbreaks(root)
-    root.withdraw()
     if sys.argv[1:]:
         filename = sys.argv[1]
     else:
         filename = None
+    macosxSupport.setupApp(root, None)
     edit = EditorWindow(root=root, filename=filename)
-    edit.set_close_hook(root.quit)
     edit.text.bind("<<close-all-windows>>", edit.close_event)
-    root.mainloop()
-    root.destroy()
+    # Does not stop error, neither does following
+    # edit.text.bind("<<close-window>>", edit.close_event)
 
 if __name__ == '__main__':
-    test()
+    from idlelib.idle_test.htest import run
+    run(_help_dialog, _editor_window)
diff --git a/Lib/idlelib/FileList.py b/Lib/idlelib/FileList.py
index 37a337e..a9989a8 100644
--- a/Lib/idlelib/FileList.py
+++ b/Lib/idlelib/FileList.py
@@ -103,7 +103,7 @@
         if not os.path.isabs(filename):
             try:
                 pwd = os.getcwd()
-            except os.error:
+            except OSError:
                 pass
             else:
                 filename = os.path.join(pwd, filename)
diff --git a/Lib/idlelib/FormatParagraph.py b/Lib/idlelib/FormatParagraph.py
index ae4e6e7..7a9d185 100644
--- a/Lib/idlelib/FormatParagraph.py
+++ b/Lib/idlelib/FormatParagraph.py
@@ -32,7 +32,7 @@
     def close(self):
         self.editwin = None
 
-    def format_paragraph_event(self, event):
+    def format_paragraph_event(self, event, limit=None):
         """Formats paragraph to a max width specified in idleConf.
 
         If text is selected, format_paragraph_event will start breaking lines
@@ -41,9 +41,14 @@
         If no text is selected, format_paragraph_event uses the current
         cursor location to determine the paragraph (lines of text surrounded
         by blank lines) and formats it.
+
+        The length limit parameter is for testing with a known value.
         """
-        maxformatwidth = idleConf.GetOption(
-                'main', 'FormatParagraph', 'paragraph', type='int')
+        if limit is None:
+            # The default length limit is that defined by pep8
+            limit = idleConf.GetOption(
+                'extensions', 'FormatParagraph', 'max-width',
+                type='int', default=72)
         text = self.editwin.text
         first, last = self.editwin.get_selection_indices()
         if first and last:
@@ -53,9 +58,9 @@
             first, last, comment_header, data = \
                     find_paragraph(text, text.index("insert"))
         if comment_header:
-            newdata = reformat_comment(data, maxformatwidth, comment_header)
+            newdata = reformat_comment(data, limit, comment_header)
         else:
-            newdata = reformat_paragraph(data, maxformatwidth)
+            newdata = reformat_paragraph(data, limit)
         text.tag_remove("sel", "1.0", "end")
 
         if newdata != data:
@@ -185,7 +190,6 @@
     return m.group(1)
 
 if __name__ == "__main__":
-    from test import support; support.use_resources = ['gui']
     import unittest
     unittest.main('idlelib.idle_test.test_formatparagraph',
             verbosity=2, exit=False)
diff --git a/Lib/idlelib/GrepDialog.py b/Lib/idlelib/GrepDialog.py
index c359074..aa866d0 100644
--- a/Lib/idlelib/GrepDialog.py
+++ b/Lib/idlelib/GrepDialog.py
@@ -1,9 +1,14 @@
 import os
 import fnmatch
+import re  # for htest
 import sys
-from tkinter import *
+from tkinter import StringVar, BooleanVar, Checkbutton  # for GrepDialog
+from tkinter import Tk, Text, Button, SEL, END  # for htest
 from idlelib import SearchEngine
+import itertools
 from idlelib.SearchDialogBase import SearchDialogBase
+# Importing OutputWindow fails due to import loop
+# EditorWindow -> GrepDialop -> OutputWindow -> EditorWindow
 
 def grep(text, io=None, flist=None):
     root = text._root()
@@ -40,10 +45,10 @@
 
     def create_entries(self):
         SearchDialogBase.create_entries(self)
-        self.globent = self.make_entry("In files:", self.globvar)
+        self.globent = self.make_entry("In files:", self.globvar)[0]
 
     def create_other_buttons(self):
-        f = self.make_frame()
+        f = self.make_frame()[0]
 
         btn = Checkbutton(f, anchor="w",
                 variable=self.recvar,
@@ -63,7 +68,7 @@
         if not path:
             self.top.bell()
             return
-        from idlelib.OutputWindow import OutputWindow
+        from idlelib.OutputWindow import OutputWindow  # leave here!
         save = sys.stdout
         try:
             sys.stdout = OutputWindow(self.flist)
@@ -79,21 +84,26 @@
         pat = self.engine.getpat()
         print("Searching %r in %s ..." % (pat, path))
         hits = 0
-        for fn in list:
-            try:
-                with open(fn, errors='replace') as f:
-                    for lineno, line in enumerate(f, 1):
-                        if line[-1:] == '\n':
-                            line = line[:-1]
-                        if prog.search(line):
-                            sys.stdout.write("%s: %s: %s\n" %
-                                             (fn, lineno, line))
-                            hits += 1
-            except OSError as msg:
-                print(msg)
-        print(("Hits found: %s\n"
-              "(Hint: right-click to open locations.)"
-              % hits) if hits else "No hits.")
+        try:
+            for fn in list:
+                try:
+                    with open(fn, errors='replace') as f:
+                        for lineno, line in enumerate(f, 1):
+                            if line[-1:] == '\n':
+                                line = line[:-1]
+                            if prog.search(line):
+                                sys.stdout.write("%s: %s: %s\n" %
+                                                 (fn, lineno, line))
+                                hits += 1
+                except OSError as msg:
+                    print(msg)
+            print(("Hits found: %s\n"
+                  "(Hint: right-click to open locations.)"
+                  % hits) if hits else "No hits.")
+        except AttributeError:
+            # Tk window has been closed, OutputWindow.text = None,
+            # so in OW.write, OW.text.insert fails.
+            pass
 
     def findfiles(self, dir, base, rec):
         try:
@@ -120,9 +130,30 @@
             self.top.grab_release()
             self.top.withdraw()
 
+
+def _grep_dialog(parent):  # htest #
+    from idlelib.PyShell import PyShellFileList
+    root = Tk()
+    root.title("Test GrepDialog")
+    width, height, x, y = list(map(int, re.split('[x+]', parent.geometry())))
+    root.geometry("+%d+%d"%(x, y + 150))
+
+    flist = PyShellFileList(root)
+    text = Text(root, height=5)
+    text.pack()
+
+    def show_grep_dialog():
+        text.tag_add(SEL, "1.0", END)
+        grep(text, flist=flist)
+        text.tag_remove(SEL, "1.0", END)
+
+    button = Button(root, text="Show GrepDialog", command=show_grep_dialog)
+    button.pack()
+    root.mainloop()
+
 if __name__ == "__main__":
-    # A human test is a bit tricky since EditorWindow() imports this module.
-    # Hence Idle must be restarted after editing this file for a live test.
     import unittest
     unittest.main('idlelib.idle_test.test_grep', verbosity=2, exit=False)
 
+    from idlelib.idle_test.htest import run
+    run(_grep_dialog)
diff --git a/Lib/idlelib/HyperParser.py b/Lib/idlelib/HyperParser.py
index 4af4b08..77cb057 100644
--- a/Lib/idlelib/HyperParser.py
+++ b/Lib/idlelib/HyperParser.py
@@ -1,23 +1,31 @@
-"""
-HyperParser
-===========
-This module defines the HyperParser class, which provides advanced parsing
-abilities for the ParenMatch and other extensions.
-The HyperParser uses PyParser. PyParser is intended mostly to give information
-on the proper indentation of code. HyperParser gives some information on the
-structure of code, used by extensions to help the user.
+"""Provide advanced parsing abilities for ParenMatch and other extensions.
+
+HyperParser uses PyParser.  PyParser mostly gives information on the
+proper indentation of code.  HyperParser gives additional information on
+the structure of code.
 """
 
 import string
-import keyword
+from keyword import iskeyword
 from idlelib import PyParse
 
-class HyperParser:
 
+# all ASCII chars that may be in an identifier
+_ASCII_ID_CHARS = frozenset(string.ascii_letters + string.digits + "_")
+# all ASCII chars that may be the first char of an identifier
+_ASCII_ID_FIRST_CHARS = frozenset(string.ascii_letters + "_")
+
+# lookup table for whether 7-bit ASCII chars are valid in a Python identifier
+_IS_ASCII_ID_CHAR = [(chr(x) in _ASCII_ID_CHARS) for x in range(128)]
+# lookup table for whether 7-bit ASCII chars are valid as the first
+# char in a Python identifier
+_IS_ASCII_ID_FIRST_CHAR = \
+    [(chr(x) in _ASCII_ID_FIRST_CHARS) for x in range(128)]
+
+
+class HyperParser:
     def __init__(self, editwin, index):
-        """Initialize the HyperParser to analyze the surroundings of the given
-        index.
-        """
+        "To initialize, analyze the surroundings of the given index."
 
         self.editwin = editwin
         self.text = text = editwin.text
@@ -33,9 +41,10 @@
                 startat = max(lno - context, 1)
                 startatindex = repr(startat) + ".0"
                 stopatindex = "%d.end" % lno
-                # We add the newline because PyParse requires a newline at end.
-                # We add a space so that index won't be at end of line, so that
-                # its status will be the same as the char before it, if should.
+                # We add the newline because PyParse requires a newline
+                # at end. We add a space so that index won't be at end
+                # of line, so that its status will be the same as the
+                # char before it, if should.
                 parser.set_str(text.get(startatindex, stopatindex)+' \n')
                 bod = parser.find_good_parse_start(
                           editwin._build_char_in_string_func(startatindex))
@@ -49,122 +58,175 @@
             else:
                 startatindex = "1.0"
             stopatindex = "%d.end" % lno
-            # We add the newline because PyParse requires a newline at end.
-            # We add a space so that index won't be at end of line, so that
-            # its status will be the same as the char before it, if should.
+            # We add the newline because PyParse requires it. We add a
+            # space so that index won't be at end of line, so that its
+            # status will be the same as the char before it, if should.
             parser.set_str(text.get(startatindex, stopatindex)+' \n')
             parser.set_lo(0)
 
-        # We want what the parser has, except for the last newline and space.
+        # We want what the parser has, minus the last newline and space.
         self.rawtext = parser.str[:-2]
-        # As far as I can see, parser.str preserves the statement we are in,
-        # so that stopatindex can be used to synchronize the string with the
-        # text box indices.
+        # Parser.str apparently preserves the statement we are in, so
+        # that stopatindex can be used to synchronize the string with
+        # the text box indices.
         self.stopatindex = stopatindex
         self.bracketing = parser.get_last_stmt_bracketing()
-        # find which pairs of bracketing are openers. These always correspond
-        # to a character of rawtext.
-        self.isopener = [i>0 and self.bracketing[i][1] > self.bracketing[i-1][1]
+        # find which pairs of bracketing are openers. These always
+        # correspond to a character of rawtext.
+        self.isopener = [i>0 and self.bracketing[i][1] >
+                         self.bracketing[i-1][1]
                          for i in range(len(self.bracketing))]
 
         self.set_index(index)
 
     def set_index(self, index):
-        """Set the index to which the functions relate. Note that it must be
-        in the same statement.
+        """Set the index to which the functions relate.
+
+        The index must be in the same statement.
         """
-        indexinrawtext = \
-            len(self.rawtext) - len(self.text.get(index, self.stopatindex))
+        indexinrawtext = (len(self.rawtext) -
+                          len(self.text.get(index, self.stopatindex)))
         if indexinrawtext < 0:
-            raise ValueError("The index given is before the analyzed statement")
+            raise ValueError("Index %s precedes the analyzed statement"
+                             % index)
         self.indexinrawtext = indexinrawtext
         # find the rightmost bracket to which index belongs
         self.indexbracket = 0
-        while self.indexbracket < len(self.bracketing)-1 and \
-              self.bracketing[self.indexbracket+1][0] < self.indexinrawtext:
+        while (self.indexbracket < len(self.bracketing)-1 and
+               self.bracketing[self.indexbracket+1][0] < self.indexinrawtext):
             self.indexbracket += 1
-        if self.indexbracket < len(self.bracketing)-1 and \
-           self.bracketing[self.indexbracket+1][0] == self.indexinrawtext and \
-           not self.isopener[self.indexbracket+1]:
+        if (self.indexbracket < len(self.bracketing)-1 and
+            self.bracketing[self.indexbracket+1][0] == self.indexinrawtext and
+           not self.isopener[self.indexbracket+1]):
             self.indexbracket += 1
 
     def is_in_string(self):
-        """Is the index given to the HyperParser is in a string?"""
+        """Is the index given to the HyperParser in a string?"""
         # The bracket to which we belong should be an opener.
         # If it's an opener, it has to have a character.
-        return self.isopener[self.indexbracket] and \
-               self.rawtext[self.bracketing[self.indexbracket][0]] in ('"', "'")
+        return (self.isopener[self.indexbracket] and
+                self.rawtext[self.bracketing[self.indexbracket][0]]
+                in ('"', "'"))
 
     def is_in_code(self):
-        """Is the index given to the HyperParser is in a normal code?"""
-        return not self.isopener[self.indexbracket] or \
-               self.rawtext[self.bracketing[self.indexbracket][0]] not in \
-                                                                ('#', '"', "'")
+        """Is the index given to the HyperParser in normal code?"""
+        return (not self.isopener[self.indexbracket] or
+                self.rawtext[self.bracketing[self.indexbracket][0]]
+                not in ('#', '"', "'"))
 
     def get_surrounding_brackets(self, openers='([{', mustclose=False):
-        """If the index given to the HyperParser is surrounded by a bracket
-        defined in openers (or at least has one before it), return the
-        indices of the opening bracket and the closing bracket (or the
-        end of line, whichever comes first).
-        If it is not surrounded by brackets, or the end of line comes before
-        the closing bracket and mustclose is True, returns None.
+        """Return bracket indexes or None.
+
+        If the index given to the HyperParser is surrounded by a
+        bracket defined in openers (or at least has one before it),
+        return the indices of the opening bracket and the closing
+        bracket (or the end of line, whichever comes first).
+
+        If it is not surrounded by brackets, or the end of line comes
+        before the closing bracket and mustclose is True, returns None.
         """
+
         bracketinglevel = self.bracketing[self.indexbracket][1]
         before = self.indexbracket
-        while not self.isopener[before] or \
-              self.rawtext[self.bracketing[before][0]] not in openers or \
-              self.bracketing[before][1] > bracketinglevel:
+        while (not self.isopener[before] or
+              self.rawtext[self.bracketing[before][0]] not in openers or
+              self.bracketing[before][1] > bracketinglevel):
             before -= 1
             if before < 0:
                 return None
             bracketinglevel = min(bracketinglevel, self.bracketing[before][1])
         after = self.indexbracket + 1
-        while after < len(self.bracketing) and \
-              self.bracketing[after][1] >= bracketinglevel:
+        while (after < len(self.bracketing) and
+              self.bracketing[after][1] >= bracketinglevel):
             after += 1
 
         beforeindex = self.text.index("%s-%dc" %
             (self.stopatindex, len(self.rawtext)-self.bracketing[before][0]))
-        if after >= len(self.bracketing) or \
-           self.bracketing[after][0] > len(self.rawtext):
+        if (after >= len(self.bracketing) or
+           self.bracketing[after][0] > len(self.rawtext)):
             if mustclose:
                 return None
             afterindex = self.stopatindex
         else:
-            # We are after a real char, so it is a ')' and we give the index
-            # before it.
-            afterindex = self.text.index("%s-%dc" %
-                (self.stopatindex,
+            # We are after a real char, so it is a ')' and we give the
+            # index before it.
+            afterindex = self.text.index(
+                "%s-%dc" % (self.stopatindex,
                  len(self.rawtext)-(self.bracketing[after][0]-1)))
 
         return beforeindex, afterindex
 
-    # This string includes all chars that may be in a white space
-    _whitespace_chars = " \t\n\\"
-    # This string includes all chars that may be in an identifier
-    _id_chars = string.ascii_letters + string.digits + "_"
-    # This string includes all chars that may be the first char of an identifier
-    _id_first_chars = string.ascii_letters + "_"
+    # the set of built-in identifiers which are also keywords,
+    # i.e. keyword.iskeyword() returns True for them
+    _ID_KEYWORDS = frozenset({"True", "False", "None"})
 
-    # Given a string and pos, return the number of chars in the identifier
-    # which ends at pos, or 0 if there is no such one. Saved words are not
-    # identifiers.
-    def _eat_identifier(self, str, limit, pos):
+    @classmethod
+    def _eat_identifier(cls, str, limit, pos):
+        """Given a string and pos, return the number of chars in the
+        identifier which ends at pos, or 0 if there is no such one.
+
+        This ignores non-identifier eywords are not identifiers.
+        """
+        is_ascii_id_char = _IS_ASCII_ID_CHAR
+
+        # Start at the end (pos) and work backwards.
         i = pos
-        while i > limit and str[i-1] in self._id_chars:
+
+        # Go backwards as long as the characters are valid ASCII
+        # identifier characters. This is an optimization, since it
+        # is faster in the common case where most of the characters
+        # are ASCII.
+        while i > limit and (
+                ord(str[i - 1]) < 128 and
+                is_ascii_id_char[ord(str[i - 1])]
+        ):
             i -= 1
-        if i < pos and (str[i] not in self._id_first_chars or \
-                        keyword.iskeyword(str[i:pos])):
-            i = pos
+
+        # If the above loop ended due to reaching a non-ASCII
+        # character, continue going backwards using the most generic
+        # test for whether a string contains only valid identifier
+        # characters.
+        if i > limit and ord(str[i - 1]) >= 128:
+            while i - 4 >= limit and ('a' + str[i - 4:pos]).isidentifier():
+                i -= 4
+            if i - 2 >= limit and ('a' + str[i - 2:pos]).isidentifier():
+                i -= 2
+            if i - 1 >= limit and ('a' + str[i - 1:pos]).isidentifier():
+                i -= 1
+
+            # The identifier candidate starts here. If it isn't a valid
+            # identifier, don't eat anything. At this point that is only
+            # possible if the first character isn't a valid first
+            # character for an identifier.
+            if not str[i:pos].isidentifier():
+                return 0
+        elif i < pos:
+            # All characters in str[i:pos] are valid ASCII identifier
+            # characters, so it is enough to check that the first is
+            # valid as the first character of an identifier.
+            if not _IS_ASCII_ID_FIRST_CHAR[ord(str[i])]:
+                return 0
+
+        # All keywords are valid identifiers, but should not be
+        # considered identifiers here, except for True, False and None.
+        if i < pos and (
+                iskeyword(str[i:pos]) and
+                str[i:pos] not in cls._ID_KEYWORDS
+        ):
+            return 0
+
         return pos - i
 
+    # This string includes all chars that may be in a white space
+    _whitespace_chars = " \t\n\\"
+
     def get_expression(self):
-        """Return a string with the Python expression which ends at the given
-        index, which is empty if there is no real one.
+        """Return a string with the Python expression which ends at the
+        given index, which is empty if there is no real one.
         """
         if not self.is_in_code():
-            raise ValueError("get_expression should only be called if index "\
-                             "is inside a code.")
+            raise ValueError("get_expression should only be called"
+                             "if index is inside a code.")
 
         rawtext = self.rawtext
         bracketing = self.bracketing
@@ -177,20 +239,20 @@
         postdot_phase = True
 
         while 1:
-            # Eat whitespaces, comments, and if postdot_phase is False - one dot
+            # Eat whitespaces, comments, and if postdot_phase is False - a dot
             while 1:
                 if pos>brck_limit and rawtext[pos-1] in self._whitespace_chars:
                     # Eat a whitespace
                     pos -= 1
-                elif not postdot_phase and \
-                     pos > brck_limit and rawtext[pos-1] == '.':
+                elif (not postdot_phase and
+                      pos > brck_limit and rawtext[pos-1] == '.'):
                     # Eat a dot
                     pos -= 1
                     postdot_phase = True
-                # The next line will fail if we are *inside* a comment, but we
-                # shouldn't be.
-                elif pos == brck_limit and brck_index > 0 and \
-                     rawtext[bracketing[brck_index-1][0]] == '#':
+                # The next line will fail if we are *inside* a comment,
+                # but we shouldn't be.
+                elif (pos == brck_limit and brck_index > 0 and
+                      rawtext[bracketing[brck_index-1][0]] == '#'):
                     # Eat a comment
                     brck_index -= 2
                     brck_limit = bracketing[brck_index][0]
@@ -200,8 +262,8 @@
                     break
 
             if not postdot_phase:
-                # We didn't find a dot, so the expression end at the last
-                # identifier pos.
+                # We didn't find a dot, so the expression end at the
+                # last identifier pos.
                 break
 
             ret = self._eat_identifier(rawtext, brck_limit, pos)
@@ -209,13 +271,13 @@
                 # There is an identifier to eat
                 pos = pos - ret
                 last_identifier_pos = pos
-                # Now, in order to continue the search, we must find a dot.
+                # Now, to continue the search, we must find a dot.
                 postdot_phase = False
                 # (the loop continues now)
 
             elif pos == brck_limit:
-                # We are at a bracketing limit. If it is a closing bracket,
-                # eat the bracket, otherwise, stop the search.
+                # We are at a bracketing limit. If it is a closing
+                # bracket, eat the bracket, otherwise, stop the search.
                 level = bracketing[brck_index][1]
                 while brck_index > 0 and bracketing[brck_index-1][1] > level:
                     brck_index -= 1
@@ -244,3 +306,8 @@
                 break
 
         return rawtext[last_identifier_pos:self.indexinrawtext]
+
+
+if __name__ == '__main__':
+    import unittest
+    unittest.main('idlelib.idle_test.test_hyperparser', verbosity=2)
diff --git a/Lib/idlelib/IOBinding.py b/Lib/idlelib/IOBinding.py
index f008b46..841a308 100644
--- a/Lib/idlelib/IOBinding.py
+++ b/Lib/idlelib/IOBinding.py
@@ -506,7 +506,7 @@
         else:
             try:
                 pwd = os.getcwd()
-            except os.error:
+            except OSError:
                 pwd = ""
             return pwd, ""
 
@@ -525,16 +525,17 @@
         if self.editwin.flist:
             self.editwin.update_recent_files_list(filename)
 
-def test():
+def _io_binding(parent):
     root = Tk()
+    root.title("Test IOBinding")
+    width, height, x, y = list(map(int, re.split('[x+]', parent.geometry())))
+    root.geometry("+%d+%d"%(x, y + 150))
     class MyEditWin:
         def __init__(self, text):
             self.text = text
             self.flist = None
             self.text.bind("<Control-o>", self.open)
             self.text.bind("<Control-s>", self.save)
-            self.text.bind("<Alt-s>", self.save_as)
-            self.text.bind("<Alt-z>", self.save_a_copy)
         def get_saved(self): return 0
         def set_saved(self, flag): pass
         def reset_undo(self): pass
@@ -542,16 +543,13 @@
             self.text.event_generate("<<open-window-from-file>>")
         def save(self, event):
             self.text.event_generate("<<save-window>>")
-        def save_as(self, event):
-            self.text.event_generate("<<save-window-as-file>>")
-        def save_a_copy(self, event):
-            self.text.event_generate("<<save-copy-of-window-as-file>>")
+
     text = Text(root)
     text.pack()
     text.focus_set()
     editwin = MyEditWin(text)
     io = IOBinding(editwin)
-    root.mainloop()
 
 if __name__ == "__main__":
-    test()
+    from idlelib.idle_test.htest import run
+    run(_io_binding)
diff --git a/Lib/idlelib/IdleHistory.py b/Lib/idlelib/IdleHistory.py
index d6cb162..078af29 100644
--- a/Lib/idlelib/IdleHistory.py
+++ b/Lib/idlelib/IdleHistory.py
@@ -100,7 +100,5 @@
         self.prefix = None
 
 if __name__ == "__main__":
-    from test import support
-    support.use_resources = ['gui']
     from unittest import main
     main('idlelib.idle_test.test_idlehistory', verbosity=2, exit=False)
diff --git a/Lib/idlelib/MultiCall.py b/Lib/idlelib/MultiCall.py
index 64729ea..251a84d 100644
--- a/Lib/idlelib/MultiCall.py
+++ b/Lib/idlelib/MultiCall.py
@@ -32,7 +32,6 @@
 import sys
 import re
 import tkinter
-from idlelib import macosxSupport
 
 # the event type constants, which define the meaning of mc_type
 MC_KEYPRESS=0; MC_KEYRELEASE=1; MC_BUTTONPRESS=2; MC_BUTTONRELEASE=3;
@@ -45,7 +44,7 @@
 MC_OPTION = 1<<6; MC_COMMAND = 1<<7
 
 # define the list of modifiers, to be used in complex event types.
-if macosxSupport.runningAsOSXApp():
+if sys.platform == "darwin":
     _modifiers = (("Shift",), ("Control",), ("Option",), ("Command",))
     _modifier_masks = (MC_SHIFT, MC_CONTROL, MC_OPTION, MC_COMMAND)
 else:
@@ -57,6 +56,12 @@
                          for number in range(len(_modifiers))
                          for name in _modifiers[number]])
 
+# In 3.4, if no shell window is ever open, the underlying Tk widget is
+# destroyed before .__del__ methods here are called.  The following
+# is used to selectively ignore shutdown exceptions to avoid
+# 'Exception ignored' messages.  See http://bugs.python.org/issue20167
+APPLICATION_GONE = "application has been destroyed"
+
 # A binder is a class which binds functions to one type of event. It has two
 # methods: bind and unbind, which get a function and a parsed sequence, as
 # returned by _parse_sequence(). There are two types of binders:
@@ -98,7 +103,12 @@
 
     def __del__(self):
         if self.handlerid:
-            self.widget.unbind(self.widgetinst, self.sequence, self.handlerid)
+            try:
+                self.widget.unbind(self.widgetinst, self.sequence,
+                        self.handlerid)
+            except tkinter.TclError as e:
+                if not APPLICATION_GONE in e.args[0]:
+                    raise
 
 # An int in range(1 << len(_modifiers)) represents a combination of modifiers
 # (if the least significent bit is on, _modifiers[0] is on, and so on).
@@ -227,7 +237,11 @@
 
     def __del__(self):
         for seq, id in self.handlerids:
-            self.widget.unbind(self.widgetinst, seq, id)
+            try:
+                self.widget.unbind(self.widgetinst, seq, id)
+            except tkinter.TclError as e:
+                if not APPLICATION_GONE in e.args[0]:
+                    raise
 
 # define the list of event types to be handled by MultiEvent. the order is
 # compatible with the definition of event type constants.
@@ -390,15 +404,21 @@
                 func, triplets = self.__eventinfo[virtual]
                 if func:
                     for triplet in triplets:
-                        self.__binders[triplet[1]].unbind(triplet, func)
-
+                        try:
+                            self.__binders[triplet[1]].unbind(triplet, func)
+                        except tkinter.TclError as e:
+                            if not APPLICATION_GONE in e.args[0]:
+                                raise
 
     _multicall_dict[widget] = MultiCall
     return MultiCall
 
-if __name__ == "__main__":
-    # Test
+
+def _multi_call(parent):
     root = tkinter.Tk()
+    root.title("Test MultiCall")
+    width, height, x, y = list(map(int, re.split('[x+]', parent.geometry())))
+    root.geometry("+%d+%d"%(x, y + 150))
     text = MultiCallCreator(tkinter.Text)(root)
     text.pack()
     def bindseq(seq, n=[0]):
@@ -414,8 +434,13 @@
     bindseq("<Alt-Control-Key-a>")
     bindseq("<Key-b>")
     bindseq("<Control-Button-1>")
+    bindseq("<Button-2>")
     bindseq("<Alt-Button-1>")
     bindseq("<FocusOut>")
     bindseq("<Enter>")
     bindseq("<Leave>")
     root.mainloop()
+
+if __name__ == "__main__":
+    from idlelib.idle_test.htest import run
+    run(_multi_call)
diff --git a/Lib/idlelib/MultiStatusBar.py b/Lib/idlelib/MultiStatusBar.py
index 4fc8dcf..f44b6a8 100644
--- a/Lib/idlelib/MultiStatusBar.py
+++ b/Lib/idlelib/MultiStatusBar.py
@@ -17,16 +17,29 @@
             label = self.labels[name]
         label.config(text=text)
 
-def _test():
-    b = Frame()
-    c = Text(b)
-    c.pack(side=TOP)
-    a = MultiStatusBar(b)
-    a.set_label("one", "hello")
-    a.set_label("two", "world")
-    a.pack(side=BOTTOM, fill=X)
-    b.pack()
-    b.mainloop()
+def _multistatus_bar(parent):
+    root = Tk()
+    width, height, x, y = list(map(int, re.split('[x+]', parent.geometry())))
+    root.geometry("+%d+%d" %(x, y + 150))
+    root.title("Test multistatus bar")
+    frame = Frame(root)
+    text = Text(frame)
+    text.pack()
+    msb = MultiStatusBar(frame)
+    msb.set_label("one", "hello")
+    msb.set_label("two", "world")
+    msb.pack(side=BOTTOM, fill=X)
+
+    def change():
+        msb.set_label("one", "foo")
+        msb.set_label("two", "bar")
+
+    button = Button(root, text="Update status", command=change)
+    button.pack(side=BOTTOM)
+    frame.pack()
+    frame.mainloop()
+    root.mainloop()
 
 if __name__ == '__main__':
-    _test()
+    from idlelib.idle_test.htest import run
+    run(_multistatus_bar)
diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt
index 6388d0d..a3a8fbf 100644
--- a/Lib/idlelib/NEWS.txt
+++ b/Lib/idlelib/NEWS.txt
@@ -1,74 +1,91 @@
-What's New in IDLE 3.3.4?
+What's New in Idle 3.4.3?
 =========================
 
-- Issue #17390: Add Python version to Idle editor window title bar.
-  Original patches by Edmond Burnett and Kent Johnson.
+- Issue #16893: Update Idle doc chapter to match current Idle and add new
+  information.
 
-- Issue #18960: IDLE now ignores the source encoding declaration on the second
-  line if the first line contains anything except a comment.
+- Issue #3068: Add Idle extension configuration dialog to Options menu.
+  Changes are written to HOME/.idlerc/config-extensions.cfg.
+  Original patch by Tal Einat.
 
-- Issue #20058: sys.stdin.readline() in IDLE now always returns only one line.
+- Issue #16233: A module browser (File : Class Browser, Alt+C) requires a
+  editor window with a filename.  When Class Browser is requested otherwise,
+  from a shell, output window, or 'Untitled' editor, Idle no longer displays
+  an error box.  It now pops up an  Open Module box (Alt+M). If a valid name
+  is entered and a module is opened, a corresponding browser is also opened.
 
-- Issue #19481: print() of string subclass instance in IDLE no longer hangs.
+- Issue #4832: Save As to type Python files automatically adds .py to the
+  name you enter (even if your system does not display it).  Some systems
+  automatically add .txt when type is Text files.
 
-- Issue #18270: Prevent possible IDLE AttributeError on OS X when no initial
-  shell window is present.
+- Issue #21986: Code objects are not normally pickled by the pickle module.
+  To match this, they are no longer pickled when running under Idle.
 
 
-What's New in IDLE 3.3.3?
+What's New in IDLE 3.4.2?
 =========================
 
-- Issue #18873: IDLE now detects Python source code encoding only in comment
-  lines.
+- Issue #17390: Adjust Editor window title; remove 'Python',
+  move version to end.
 
-- Issue #18988: The "Tab" key now works when a word is already autocompleted.
+- Issue #14105: Idle debugger breakpoints no longer disappear
+  when inseting or deleting lines.
 
-- Issue #18489: Add tests for SearchEngine. Original patch by Phil Webster.
+- Issue #17172: Turtledemo can now be run from Idle.
+  Currently, the entry is on the Help menu, but it may move to Run.
+  Patch by Ramchandra Apt and Lita Cho.
 
-- Issue #18429: Format / Format Paragraph, now works when comment blocks
-  are selected. As with text blocks, this works best when the selection
-  only includes complete lines.
+- Issue #21765: Add support for non-ascii identifiers to HyperParser.
 
-- Issue #18226: Add docstrings and unittests for FormatParagraph.py.
-  Original patches by Todd Rovito and Phil Webster.
+- Issue #21940: Add unittest for WidgetRedirector. Initial patch by Saimadhav
+  Heblikar.
 
-- Issue #18279: Format - Strip trailing whitespace no longer marks a file as
-  changed when it has not been changed. This fix followed the addition of a
-  test file originally written by Phil Webster (the issue's main goal).
+- Issue #18592: Add unittest for SearchDialogBase. Patch by Phil Webster.
 
-- Issue #7136: In the Idle File menu, "New Window" is renamed "New File".
-  Patch by Tal Einat, Roget Serwy, and Todd Rovito.
+- Issue #21694: Add unittest for ParenMatch. Patch by Saimadhav Heblikar.
 
-- Remove dead imports of imp.
+- Issue #21686: add unittest for HyperParser. Original patch by Saimadhav
+  Heblikar.
 
-- Issue #18196: Avoid displaying spurious SystemExit tracebacks.
+- Issue #12387: Add missing upper(lower)case versions of default Windows key
+  bindings for Idle so Caps Lock does not disable them. Patch by Roger Serwy.
 
-- Issue #5492: Avoid traceback when exiting IDLE caused by a race condition.
+- Issue #21695: Closing a Find-in-files output window while the search is
+  still in progress no longer closes Idle.
 
-- Issue #17511: Keep IDLE find dialog open after clicking "Find Next".
-  Original patch by Sarah K.
+- Issue #18910: Add unittest for textView. Patch by Phil Webster.
 
-- Issue #18055: Move IDLE off of imp and on to importlib.
+- Issue #18292: Add unittest for AutoExpand. Patch by Saihadhav Heblikar.
 
-- Issue #15392: Create a unittest framework for IDLE.
-  Initial patch by Rajagopalasarma Jayakrishnan.
-  See Lib/idlelib/idle_test/README.txt for how to run Idle tests.
+- Issue #18409: Add unittest for AutoComplete. Patch by Phil Webster.
 
-- Issue #14146: Highlight source line while debugging on Windows.
-
-- Issue #17532: Always include Options menu for IDLE on OS X.
-  Patch by Guilherme Simões.
+- Issue #18104: Add idlelib/idle_test/htest.py with a few sample tests to begin
+  consolidating and improving human-validated tests of Idle. Change other files
+  as needed to work with htest.  Running the module as __main__ runs all tests.
 
 
-What's New in IDLE 3.3.2?
+What's New in IDLE 3.4.1?
+=========================
+
+- Issue #18104: Add idlelib/idle_test/htest.py with a few sample tests to begin
+  consolidating and improving human-validated tests of Idle. Change other files
+  as needed to work with htest.  Running the module as __main__ runs all tests.
+
+- Issue #21139: Change default paragraph width to 72, the PEP 8 recommendation.
+
+- Issue #21284: Paragraph reformat test passes after user changes reformat width.
+
+- Issue #17654: Ensure IDLE menus are customized properly on OS X for
+  non-framework builds and for all variants of Tk.
+
+
+What's New in IDLE 3.4.0?
 =========================
 
 - Issue #17390: Display Python version on Idle title bar.
   Initial patch by Edmond Burnett.
 
-
-What's New in IDLE 3.3.1?
-=========================
+- Issue #5066: Update IDLE docs. Patch by Todd Rovito.
 
 - Issue #17625: Close the replace dialog after it is used.
 
diff --git a/Lib/idlelib/ObjectBrowser.py b/Lib/idlelib/ObjectBrowser.py
index b359efc..7b57aa4 100644
--- a/Lib/idlelib/ObjectBrowser.py
+++ b/Lib/idlelib/ObjectBrowser.py
@@ -9,6 +9,8 @@
 # XXX TO DO:
 # - for classes/modules, add "open source" to object browser
 
+import re
+
 from idlelib.TreeWidget import TreeItem, TreeNode, ScrolledCanvas
 
 from reprlib import Repr
@@ -119,12 +121,14 @@
         c = ObjectTreeItem
     return c(labeltext, object, setfunction)
 
-# Test script
 
-def _test():
+def _object_browser(parent):
     import sys
     from tkinter import Tk
     root = Tk()
+    root.title("Test ObjectBrowser")
+    width, height, x, y = list(map(int, re.split('[x+]', parent.geometry())))
+    root.geometry("+%d+%d"%(x, y + 150))
     root.configure(bd=0, bg="yellow")
     root.focus_set()
     sc = ScrolledCanvas(root, bg="white", highlightthickness=0, takefocus=1)
@@ -135,4 +139,5 @@
     root.mainloop()
 
 if __name__ == '__main__':
-    _test()
+    from idlelib.idle_test.htest import run
+    run(_object_browser)
diff --git a/Lib/idlelib/ParenMatch.py b/Lib/idlelib/ParenMatch.py
index 6d91b39..19bad8c 100644
--- a/Lib/idlelib/ParenMatch.py
+++ b/Lib/idlelib/ParenMatch.py
@@ -90,7 +90,8 @@
             self.set_timeout = self.set_timeout_none
 
     def flash_paren_event(self, event):
-        indices = HyperParser(self.editwin, "insert").get_surrounding_brackets()
+        indices = (HyperParser(self.editwin, "insert")
+                   .get_surrounding_brackets())
         if indices is None:
             self.warn_mismatched()
             return
@@ -167,6 +168,11 @@
         # associate a counter with an event; only disable the "paren"
         # tag if the event is for the most recent timer.
         self.counter += 1
-        self.editwin.text_frame.after(self.FLASH_DELAY,
-                                      lambda self=self, c=self.counter: \
-                                      self.handle_restore_timer(c))
+        self.editwin.text_frame.after(
+            self.FLASH_DELAY,
+            lambda self=self, c=self.counter: self.handle_restore_timer(c))
+
+
+if __name__ == '__main__':
+    import unittest
+    unittest.main('idlelib.idle_test.test_parenmatch', verbosity=2)
diff --git a/Lib/idlelib/PathBrowser.py b/Lib/idlelib/PathBrowser.py
index ba40719..58ff830 100644
--- a/Lib/idlelib/PathBrowser.py
+++ b/Lib/idlelib/PathBrowser.py
@@ -4,10 +4,16 @@
 
 from idlelib.TreeWidget import TreeItem
 from idlelib.ClassBrowser import ClassBrowser, ModuleBrowserTreeItem
+from idlelib.PyShell import PyShellFileList
+
 
 class PathBrowser(ClassBrowser):
 
-    def __init__(self, flist):
+    def __init__(self, flist, _htest=False):
+        """
+        _htest - bool, change box location when running htest
+        """
+        self._htest = _htest
         self.init(flist)
 
     def settitle(self):
@@ -44,7 +50,7 @@
     def GetSubList(self):
         try:
             names = os.listdir(self.dir or os.curdir)
-        except os.error:
+        except OSError:
             return []
         packages = []
         for name in names:
@@ -87,12 +93,14 @@
         sorted.sort()
         return sorted
 
-def main():
-    from idlelib import PyShell
-    PathBrowser(PyShell.flist)
-    if sys.stdin is sys.__stdin__:
-        mainloop()
+def _path_browser(parent):
+    flist = PyShellFileList(parent)
+    PathBrowser(flist, _htest=True)
+    parent.mainloop()
 
 if __name__ == "__main__":
     from unittest import main
     main('idlelib.idle_test.test_pathbrowser', verbosity=2, exit=False)
+
+    from idlelib.idle_test.htest import run
+    run(_path_browser)
diff --git a/Lib/idlelib/Percolator.py b/Lib/idlelib/Percolator.py
index c91de38..9e93319 100644
--- a/Lib/idlelib/Percolator.py
+++ b/Lib/idlelib/Percolator.py
@@ -51,8 +51,9 @@
             f.setdelegate(filter.delegate)
             filter.setdelegate(None)
 
-def main():
-    import tkinter as Tk
+def _percolator(parent):
+    import tkinter as tk
+    import re
     class Tracer(Delegator):
         def __init__(self, name):
             self.name = name
@@ -63,22 +64,41 @@
         def delete(self, *args):
             print(self.name, ": delete", args)
             self.delegate.delete(*args)
-    root = Tk.Tk()
-    root.wm_protocol("WM_DELETE_WINDOW", root.quit)
-    text = Tk.Text()
-    text.pack()
-    text.focus_set()
+    root = tk.Tk()
+    root.title("Test Percolator")
+    width, height, x, y = list(map(int, re.split('[x+]', parent.geometry())))
+    root.geometry("+%d+%d"%(x, y + 150))
+    text = tk.Text(root)
     p = Percolator(text)
     t1 = Tracer("t1")
     t2 = Tracer("t2")
-    p.insertfilter(t1)
-    p.insertfilter(t2)
-    root.mainloop() # click close widget to continue...
-    p.removefilter(t2)
-    root.mainloop()
-    p.insertfilter(t2)
-    p.removefilter(t1)
+
+    def toggle1():
+        if var1.get() == 0:
+            var1.set(1)
+            p.insertfilter(t1)
+        elif var1.get() == 1:
+            var1.set(0)
+            p.removefilter(t1)
+
+    def toggle2():
+        if var2.get() == 0:
+            var2.set(1)
+            p.insertfilter(t2)
+        elif var2.get() == 1:
+            var2.set(0)
+            p.removefilter(t2)
+
+    text.pack()
+    var1 = tk.IntVar()
+    cb1 = tk.Checkbutton(root, text="Tracer1", command=toggle1, variable=var1)
+    cb1.pack()
+    var2 = tk.IntVar()
+    cb2 = tk.Checkbutton(root, text="Tracer2", command=toggle2, variable=var2)
+    cb2.pack()
+
     root.mainloop()
 
 if __name__ == "__main__":
-    main()
+    from idlelib.idle_test.htest import run
+    run(_percolator)
diff --git a/Lib/idlelib/PyParse.py b/Lib/idlelib/PyParse.py
index 61a0003..3e501ca 100644
--- a/Lib/idlelib/PyParse.py
+++ b/Lib/idlelib/PyParse.py
@@ -1,5 +1,7 @@
 import re
 import sys
+from collections import Mapping
+from functools import partial
 
 # Reason last stmt is continued (or C_NONE if it's not).
 (C_NONE, C_BACKSLASH, C_STRING_FIRST_LINE,
@@ -91,19 +93,48 @@
     [^[\](){}#'"\\]+
 """, re.VERBOSE).match
 
-# Build translation table to map uninteresting chars to "x", open
-# brackets to "(", and close brackets to ")".
 
-_tran = {}
-for i in range(256):
-    _tran[i] = 'x'
-for ch in "({[":
-    _tran[ord(ch)] = '('
-for ch in ")}]":
-    _tran[ord(ch)] = ')'
-for ch in "\"'\\\n#":
-    _tran[ord(ch)] = ch
-del i, ch
+class StringTranslatePseudoMapping(Mapping):
+    r"""Utility class to be used with str.translate()
+
+    This Mapping class wraps a given dict. When a value for a key is
+    requested via __getitem__() or get(), the key is looked up in the
+    given dict. If found there, the value from the dict is returned.
+    Otherwise, the default value given upon initialization is returned.
+
+    This allows using str.translate() to make some replacements, and to
+    replace all characters for which no replacement was specified with
+    a given character instead of leaving them as-is.
+
+    For example, to replace everything except whitespace with 'x':
+
+    >>> whitespace_chars = ' \t\n\r'
+    >>> preserve_dict = {ord(c): ord(c) for c in whitespace_chars}
+    >>> mapping = StringTranslatePseudoMapping(preserve_dict, ord('x'))
+    >>> text = "a + b\tc\nd"
+    >>> text.translate(mapping)
+    'x x x\tx\nx'
+    """
+    def __init__(self, non_defaults, default_value):
+        self._non_defaults = non_defaults
+        self._default_value = default_value
+
+        def _get(key, _get=non_defaults.get, _default=default_value):
+            return _get(key, _default)
+        self._get = _get
+
+    def __getitem__(self, item):
+        return self._get(item)
+
+    def __len__(self):
+        return len(self._non_defaults)
+
+    def __iter__(self):
+        return iter(self._non_defaults)
+
+    def get(self, key, default=None):
+        return self._get(key)
+
 
 class Parser:
 
@@ -113,19 +144,6 @@
 
     def set_str(self, s):
         assert len(s) == 0 or s[-1] == '\n'
-        if isinstance(s, str):
-            # The parse functions have no idea what to do with Unicode, so
-            # replace all Unicode characters with "x".  This is "safe"
-            # so long as the only characters germane to parsing the structure
-            # of Python are 7-bit ASCII.  It's *necessary* because Unicode
-            # strings don't have a .translate() method that supports
-            # deletechars.
-            uniphooey = s
-            s = []
-            push = s.append
-            for raw in map(ord, uniphooey):
-                push(raw < 127 and chr(raw) or "x")
-            s = "".join(s)
         self.str = s
         self.study_level = 0
 
@@ -197,6 +215,16 @@
         if lo > 0:
             self.str = self.str[lo:]
 
+    # Build a translation table to map uninteresting chars to 'x', open
+    # brackets to '(', close brackets to ')' while preserving quotes,
+    # backslashes, newlines and hashes. This is to be passed to
+    # str.translate() in _study1().
+    _tran = {}
+    _tran.update((ord(c), ord('(')) for c in "({[")
+    _tran.update((ord(c), ord(')')) for c in ")}]")
+    _tran.update((ord(c), ord(c)) for c in "\"'\\\n#")
+    _tran = StringTranslatePseudoMapping(_tran, default_value=ord('x'))
+
     # As quickly as humanly possible <wink>, find the line numbers (0-
     # based) of the non-continuation lines.
     # Creates self.{goodlines, continuation}.
@@ -211,7 +239,7 @@
         # uninteresting characters.  This can cut the number of chars
         # by a factor of 10-40, and so greatly speed the following loop.
         str = self.str
-        str = str.translate(_tran)
+        str = str.translate(self._tran)
         str = str.replace('xxxxxxxx', 'x')
         str = str.replace('xxxx', 'x')
         str = str.replace('xx', 'x')
diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py
index 2e5ebb2..51aa3f4 100755
--- a/Lib/idlelib/PyShell.py
+++ b/Lib/idlelib/PyShell.py
@@ -21,7 +21,7 @@
 try:
     from tkinter import *
 except ImportError:
-    print("** IDLE can't import Tkinter.  " \
+    print("** IDLE can't import Tkinter.\n"
           "Your Python may not be configured for Tk. **", file=sys.__stderr__)
     sys.exit(1)
 import tkinter.messagebox as tkMessageBox
@@ -138,6 +138,7 @@
         self.io.set_filename_change_hook(filename_changed_hook)
         if self.io.filename:
             self.restore_file_breaks()
+        self.color_breakpoint_text()
 
     rmenu_specs = [
         ("Cut", "<<cut>>", "rmenu_check_cut"),
@@ -148,6 +149,18 @@
         ("Clear Breakpoint", "<<clear-breakpoint-here>>", None)
     ]
 
+    def color_breakpoint_text(self, color=True):
+        "Turn colorizing of breakpoint text on or off"
+        if self.io is None:
+            # possible due to update in restore_file_breaks
+            return
+        if color:
+            theme = idleConf.GetOption('main','Theme','name')
+            cfg = idleConf.GetHighlight(theme, "break")
+        else:
+            cfg = {'foreground': '', 'background': ''}
+        self.text.tag_config('BREAK', cfg)
+
     def set_breakpoint(self, lineno):
         text = self.text
         filename = self.io.filename
@@ -217,13 +230,8 @@
         #     This is necessary to keep the saved breaks synched with the
         #     saved file.
         #
-        #     Breakpoints are set as tagged ranges in the text.  Certain
-        #     kinds of edits cause these ranges to be deleted: Inserting
-        #     or deleting a line just before a breakpoint, and certain
-        #     deletions prior to a breakpoint.  These issues need to be
-        #     investigated and understood.  It's not clear if they are
-        #     Tk issues or IDLE issues, or whether they can actually
-        #     be fixed.  Since a modified file has to be saved before it is
+        #     Breakpoints are set as tagged ranges in the text.
+        #     Since a modified file has to be saved before it is
         #     run, and since self.breakpoints (from which the subprocess
         #     debugger is loaded) is updated during the save, the visible
         #     breaks stay synched with the subprocess even if one of these
@@ -419,7 +427,7 @@
             try:
                 self.rpcclt = MyRPCClient(addr)
                 break
-            except socket.error as err:
+            except OSError as err:
                 pass
         else:
             self.display_port_binding_error()
@@ -641,9 +649,9 @@
             code = compile(source, filename, "exec")
         except (OverflowError, SyntaxError):
             self.tkconsole.resetoutput()
-            tkerr = self.tkconsole.stderr
-            print('*** Error in script or command!\n', file=tkerr)
-            print('Traceback (most recent call last):', file=tkerr)
+            print('*** Error in script or command!\n'
+                 'Traceback (most recent call last):',
+                  file=self.tkconsole.stderr)
             InteractiveInterpreter.showsyntaxerror(self, filename)
             self.tkconsole.showprompt()
         else:
@@ -840,13 +848,10 @@
         ("edit", "_Edit"),
         ("debug", "_Debug"),
         ("options", "_Options"),
-        ("windows", "_Windows"),
+        ("windows", "_Window"),
         ("help", "_Help"),
     ]
 
-    if macosxSupport.runningAsOSXApp():
-        menu_specs[-2] = ("windows", "_Window")
-
 
     # New classes
     from idlelib.IdleHistory import History
@@ -1034,7 +1039,10 @@
                 self.close()
                 return False
         else:
-            nosub = "==== No Subprocess ===="
+            nosub = ("==== No Subprocess ====\n\n" +
+                    "WARNING: Running IDLE without a Subprocess is deprecated\n" +
+                    "and will be removed in a later version. See Help/IDLE Help\n" +
+                    "for details.\n\n")
             sys.displayhook = rpc.displayhook
 
         self.write("Python %s on %s\n%s\n%s" %
@@ -1398,7 +1406,8 @@
        idle  [-dns] [-t title] - [arg]*
 
   -h         print this help message and exit
-  -n         run IDLE without a subprocess (see Help/IDLE Help for details)
+  -n         run IDLE without a subprocess (DEPRECATED,
+             see Help/IDLE Help for details)
 
 The following options will override the IDLE 'settings' configuration:
 
@@ -1458,8 +1467,7 @@
     try:
         opts, args = getopt.getopt(sys.argv[1:], "c:deihnr:st:")
     except getopt.error as msg:
-        sys.stderr.write("Error: %s\n" % str(msg))
-        sys.stderr.write(usage_msg)
+        print("Error: %s\n%s" % (msg, usage_msg), file=sys.stderr)
         sys.exit(2)
     for o, a in opts:
         if o == '-c':
@@ -1476,6 +1484,8 @@
         if o == '-i':
             enable_shell = True
         if o == '-n':
+            print(" Warning: running IDLE without a subprocess is deprecated.",
+                  file=sys.stderr)
             use_subprocess = False
         if o == '-r':
             script = a
@@ -1554,7 +1564,7 @@
         shell = flist.open_shell()
         if not shell:
             return # couldn't open shell
-        if macosxSupport.runningAsOSXApp() and flist.dict:
+        if macosxSupport.isAquaTk() and flist.dict:
             # On OSX: when the user has double-clicked on a file that causes
             # IDLE to be launched the shell window will open just in front of
             # the file she wants to see. Lower the interpreter window when
diff --git a/Lib/idlelib/ReplaceDialog.py b/Lib/idlelib/ReplaceDialog.py
index e73f2c5..fc8b80f 100644
--- a/Lib/idlelib/ReplaceDialog.py
+++ b/Lib/idlelib/ReplaceDialog.py
@@ -40,7 +40,7 @@
 
     def create_entries(self):
         SearchDialogBase.create_entries(self)
-        self.replent = self.make_entry("Replace with:", self.replvar)
+        self.replent = self.make_entry("Replace with:", self.replvar)[0]
 
     def create_command_buttons(self):
         SearchDialogBase.create_command_buttons(self)
@@ -188,3 +188,34 @@
     def close(self, event=None):
         SearchDialogBase.close(self, event)
         self.text.tag_remove("hit", "1.0", "end")
+
+def _replace_dialog(parent):
+    root = Tk()
+    root.title("Test ReplaceDialog")
+    width, height, x, y = list(map(int, re.split('[x+]', parent.geometry())))
+    root.geometry("+%d+%d"%(x, y + 150))
+
+    # mock undo delegator methods
+    def undo_block_start():
+        pass
+
+    def undo_block_stop():
+        pass
+
+    text = Text(root)
+    text.undo_block_start = undo_block_start
+    text.undo_block_stop = undo_block_stop
+    text.pack()
+    text.insert("insert","This is a sample string.\n"*10)
+
+    def show_replace():
+        text.tag_add(SEL, "1.0", END)
+        replace(text)
+        text.tag_remove(SEL, "1.0", END)
+
+    button = Button(root, text="Replace", command=show_replace)
+    button.pack()
+
+if __name__ == '__main__':
+    from idlelib.idle_test.htest import run
+    run(_replace_dialog)
diff --git a/Lib/idlelib/ScriptBinding.py b/Lib/idlelib/ScriptBinding.py
index 6bfe128..b783637 100644
--- a/Lib/idlelib/ScriptBinding.py
+++ b/Lib/idlelib/ScriptBinding.py
@@ -53,7 +53,7 @@
         self.flist = self.editwin.flist
         self.root = self.editwin.root
 
-        if macosxSupport.runningAsOSXApp():
+        if macosxSupport.isCocoaTk():
             self.editwin.text_frame.bind('<<run-module-event-2>>', self._run_module_event)
 
     def check_module_event(self, event):
@@ -114,7 +114,7 @@
             shell.set_warning_stream(saved_stream)
 
     def run_module_event(self, event):
-        if macosxSupport.runningAsOSXApp():
+        if macosxSupport.isCocoaTk():
             # Tk-Cocoa in MacOSX is broken until at least
             # Tk 8.5.9, and without this rather
             # crude workaround IDLE would hang when a user
diff --git a/Lib/idlelib/ScrolledList.py b/Lib/idlelib/ScrolledList.py
index 0255a0a..71ec547 100644
--- a/Lib/idlelib/ScrolledList.py
+++ b/Lib/idlelib/ScrolledList.py
@@ -119,21 +119,22 @@
         pass
 
 
-def test():
+def _scrolled_list(parent):
     root = Tk()
-    root.protocol("WM_DELETE_WINDOW", root.destroy)
+    root.title("Test ScrolledList")
+    width, height, x, y = list(map(int, re.split('[x+]', parent.geometry())))
+    root.geometry("+%d+%d"%(x, y + 150))
     class MyScrolledList(ScrolledList):
-        def fill_menu(self): self.menu.add_command(label="pass")
+        def fill_menu(self): self.menu.add_command(label="right click")
         def on_select(self, index): print("select", self.get(index))
         def on_double(self, index): print("double", self.get(index))
-    s = MyScrolledList(root)
-    for i in range(30):
-        s.append("item %02d" % i)
-    return root
 
-def main():
-    root = test()
+    scrolled_list = MyScrolledList(root)
+    for i in range(30):
+        scrolled_list.append("Item %02d" % i)
+
     root.mainloop()
 
 if __name__ == '__main__':
-    main()
+    from idlelib.idle_test.htest import run
+    run(_scrolled_list)
diff --git a/Lib/idlelib/SearchDialog.py b/Lib/idlelib/SearchDialog.py
index bf76c41..38408b8 100644
--- a/Lib/idlelib/SearchDialog.py
+++ b/Lib/idlelib/SearchDialog.py
@@ -65,3 +65,25 @@
         if pat:
             self.engine.setcookedpat(pat)
         return self.find_again(text)
+
+def _search_dialog(parent):
+    root = Tk()
+    root.title("Test SearchDialog")
+    width, height, x, y = list(map(int, re.split('[x+]', parent.geometry())))
+    root.geometry("+%d+%d"%(x, y + 150))
+    text = Text(root)
+    text.pack()
+    text.insert("insert","This is a sample string.\n"*10)
+
+    def show_find():
+        text.tag_add(SEL, "1.0", END)
+        s = _setup(text)
+        s.open(text)
+        text.tag_remove(SEL, "1.0", END)
+
+    button = Button(root, text="Search", command=show_find)
+    button.pack()
+
+if __name__ == '__main__':
+    from idlelib.idle_test.htest import run
+    run(_search_dialog)
diff --git a/Lib/idlelib/SearchDialogBase.py b/Lib/idlelib/SearchDialogBase.py
index b8b49b2..5fa84e2 100644
--- a/Lib/idlelib/SearchDialogBase.py
+++ b/Lib/idlelib/SearchDialogBase.py
@@ -1,34 +1,51 @@
 '''Define SearchDialogBase used by Search, Replace, and Grep dialogs.'''
-from tkinter import *
+
+from tkinter import (Toplevel, Frame, Entry, Label, Button,
+                     Checkbutton, Radiobutton)
 
 class SearchDialogBase:
-    '''Create most of a modal search dialog (make_frame, create_widgets).
+    '''Create most of a 3 or 4 row, 3 column search dialog.
 
-    The wide left column contains:
-    1 or 2 text entry lines (create_entries, make_entry);
-    a row of standard radiobuttons (create_option_buttons);
-    a row of dialog specific radiobuttons (create_other_buttons).
+    The left and wide middle column contain:
+    1 or 2 labeled text entry lines (make_entry, create_entries);
+    a row of standard Checkbuttons (make_frame, create_option_buttons),
+    each of which corresponds to a search engine Variable;
+    a row of dialog-specific Check/Radiobuttons (create_other_buttons).
 
     The narrow right column contains command buttons
-    (create_command_buttons, make_button).
+    (make_button, create_command_buttons).
     These are bound to functions that execute the command.
 
-    Except for command buttons, this base class is not limited to
-    items common to all three subclasses.  Rather, it is the Find dialog
-    minus the "Find Next" command and its execution function.
-    The other dialogs override methods to replace and add widgets.
+    Except for command buttons, this base class is not limited to items
+    common to all three subclasses.  Rather, it is the Find dialog minus
+    the "Find Next" command, its execution function, and the
+    default_command attribute needed in create_widgets. The other
+    dialogs override attributes and methods, the latter to replace and
+    add widgets.
     '''
 
-    title = "Search Dialog"
+    title = "Search Dialog"  # replace in subclasses
     icon = "Search"
-    needwrapbutton = 1
+    needwrapbutton = 1  # not in Find in Files
 
     def __init__(self, root, engine):
+        '''Initialize root, engine, and top attributes.
+
+        top (level widget): set in create_widgets() called from open().
+        text (Text searched): set in open(), only used in subclasses().
+        ent (ry): created in make_entry() called from create_entry().
+        row (of grid): 0 in create_widgets(), +1 in make_entry/frame().
+        default_command: set in subclasses, used in create_widgers().
+
+        title (of dialog): class attribute, override in subclasses.
+        icon (of dialog): ditto, use unclear if cannot minimize dialog.
+        '''
         self.root = root
         self.engine = engine
         self.top = None
 
     def open(self, text, searchphrase=None):
+        "Make dialog visible on top of others and ready to use."
         self.text = text
         if not self.top:
             self.create_widgets()
@@ -44,11 +61,17 @@
         self.top.grab_set()
 
     def close(self, event=None):
+        "Put dialog away for later use."
         if self.top:
             self.top.grab_release()
             self.top.withdraw()
 
     def create_widgets(self):
+        '''Create basic 3 row x 3 col search (find) dialog.
+
+        Other dialogs override subsidiary create_x methods as needed.
+        Replace and Find-in-Files add another entry row.
+        '''
         top = Toplevel(self.root)
         top.bind("<Return>", self.default_command)
         top.bind("<Escape>", self.close)
@@ -61,29 +84,84 @@
         self.top.grid_columnconfigure(0, pad=2, weight=0)
         self.top.grid_columnconfigure(1, pad=2, minsize=100, weight=100)
 
-        self.create_entries()
-        self.create_option_buttons()
-        self.create_other_buttons()
-        return self.create_command_buttons()
+        self.create_entries()  # row 0 (and maybe 1), cols 0, 1
+        self.create_option_buttons()  # next row, cols 0, 1
+        self.create_other_buttons()  # next row, cols 0, 1
+        self.create_command_buttons()  # col 2, all rows
 
-    def make_entry(self, label, var):
-        l = Label(self.top, text=label)
-        l.grid(row=self.row, column=0, sticky="nw")
-        e = Entry(self.top, textvariable=var, exportselection=0)
-        e.grid(row=self.row, column=1, sticky="nwe")
+    def make_entry(self, label_text, var):
+        '''Return (entry, label), .
+
+        entry - gridded labeled Entry for text entry.
+        label - Label widget, returned for testing.
+        '''
+        label = Label(self.top, text=label_text)
+        label.grid(row=self.row, column=0, sticky="nw")
+        entry = Entry(self.top, textvariable=var, exportselection=0)
+        entry.grid(row=self.row, column=1, sticky="nwe")
         self.row = self.row + 1
-        return e
+        return entry, label
+
+    def create_entries(self):
+        "Create one or more entry lines with make_entry."
+        self.ent = self.make_entry("Find:", self.engine.patvar)[0]
 
     def make_frame(self,labeltext=None):
+        '''Return (frame, label).
+
+        frame - gridded labeled Frame for option or other buttons.
+        label - Label widget, returned for testing.
+        '''
         if labeltext:
-            l = Label(self.top, text=labeltext)
-            l.grid(row=self.row, column=0, sticky="nw")
-        f = Frame(self.top)
-        f.grid(row=self.row, column=1, columnspan=1, sticky="nwe")
+            label = Label(self.top, text=labeltext)
+            label.grid(row=self.row, column=0, sticky="nw")
+        else:
+            label = ''
+        frame = Frame(self.top)
+        frame.grid(row=self.row, column=1, columnspan=1, sticky="nwe")
         self.row = self.row + 1
-        return f
+        return frame, label
+
+    def create_option_buttons(self):
+        '''Return (filled frame, options) for testing.
+
+        Options is a list of SearchEngine booleanvar, label pairs.
+        A gridded frame from make_frame is filled with a Checkbutton
+        for each pair, bound to the var, with the corresponding label.
+        '''
+        frame = self.make_frame("Options")[0]
+        engine = self.engine
+        options = [(engine.revar, "Regular expression"),
+                   (engine.casevar, "Match case"),
+                   (engine.wordvar, "Whole word")]
+        if self.needwrapbutton:
+            options.append((engine.wrapvar, "Wrap around"))
+        for var, label in options:
+            btn = Checkbutton(frame, anchor="w", variable=var, text=label)
+            btn.pack(side="left", fill="both")
+            if var.get():
+                btn.select()
+        return frame, options
+
+    def create_other_buttons(self):
+        '''Return (frame, others) for testing.
+
+        Others is a list of value, label pairs.
+        A gridded frame from make_frame is filled with radio buttons.
+        '''
+        frame = self.make_frame("Direction")[0]
+        var = self.engine.backvar
+        others = [(1, 'Up'), (0, 'Down')]
+        for val, label in others:
+            btn = Radiobutton(frame, anchor="w",
+                              variable=var, value=val, text=label)
+            btn.pack(side="left", fill="both")
+            if var.get() == val:
+                btn.select()
+        return frame, others
 
     def make_button(self, label, command, isdef=0):
+        "Return command button gridded in command frame."
         b = Button(self.buttonframe,
                    text=label, command=command,
                    default=isdef and "active" or "normal")
@@ -92,66 +170,15 @@
         self.buttonframe.grid(rowspan=rows+1)
         return b
 
-    def create_entries(self):
-        self.ent = self.make_entry("Find:", self.engine.patvar)
-
-    def create_option_buttons(self):
-        f = self.make_frame("Options")
-
-        btn = Checkbutton(f, anchor="w",
-                variable=self.engine.revar,
-                text="Regular expression")
-        btn.pack(side="left", fill="both")
-        if self.engine.isre():
-            btn.select()
-
-        btn = Checkbutton(f, anchor="w",
-                variable=self.engine.casevar,
-                text="Match case")
-        btn.pack(side="left", fill="both")
-        if self.engine.iscase():
-            btn.select()
-
-        btn = Checkbutton(f, anchor="w",
-                variable=self.engine.wordvar,
-                text="Whole word")
-        btn.pack(side="left", fill="both")
-        if self.engine.isword():
-            btn.select()
-
-        if self.needwrapbutton:
-            btn = Checkbutton(f, anchor="w",
-                    variable=self.engine.wrapvar,
-                    text="Wrap around")
-            btn.pack(side="left", fill="both")
-            if self.engine.iswrap():
-                btn.select()
-
-    def create_other_buttons(self):
-        f = self.make_frame("Direction")
-
-        #lbl = Label(f, text="Direction: ")
-        #lbl.pack(side="left")
-
-        btn = Radiobutton(f, anchor="w",
-                variable=self.engine.backvar, value=1,
-                text="Up")
-        btn.pack(side="left", fill="both")
-        if self.engine.isback():
-            btn.select()
-
-        btn = Radiobutton(f, anchor="w",
-                variable=self.engine.backvar, value=0,
-                text="Down")
-        btn.pack(side="left", fill="both")
-        if not self.engine.isback():
-            btn.select()
-
     def create_command_buttons(self):
-        #
-        # place button frame on the right
+        "Place buttons in vertical command frame gridded on right."
         f = self.buttonframe = Frame(self.top)
         f.grid(row=0,column=2,padx=2,pady=2,ipadx=2,ipady=2)
 
         b = self.make_button("close", self.close)
         b.lower()
+
+if __name__ == '__main__':
+    import unittest
+    unittest.main(
+        'idlelib.idle_test.test_searchdialogbase', verbosity=2)
diff --git a/Lib/idlelib/SearchEngine.py b/Lib/idlelib/SearchEngine.py
index 9d3c4cb..099cb09 100644
--- a/Lib/idlelib/SearchEngine.py
+++ b/Lib/idlelib/SearchEngine.py
@@ -85,7 +85,7 @@
         except re.error as what:
             args = what.args
             msg = args[0]
-            col = arg[1] if len(args) >= 2 else -1
+            col = args[1] if len(args) >= 2 else -1
             self.report_error(pat, msg, col)
             return None
         return prog
@@ -229,6 +229,5 @@
     return line, col
 
 if __name__ == "__main__":
-    from test import support; support.use_resources = ['gui']
     import unittest
     unittest.main('idlelib.idle_test.test_searchengine', verbosity=2, exit=False)
diff --git a/Lib/idlelib/StackViewer.py b/Lib/idlelib/StackViewer.py
index 4ef2d31..b1e5e26 100644
--- a/Lib/idlelib/StackViewer.py
+++ b/Lib/idlelib/StackViewer.py
@@ -1,9 +1,12 @@
 import os
 import sys
 import linecache
+import re
+import tkinter as tk
 
 from idlelib.TreeWidget import TreeNode, TreeItem, ScrolledCanvas
 from idlelib.ObjectBrowser import ObjectTreeItem, make_objecttreeitem
+from idlelib.PyShell import PyShellFileList
 
 def StackBrowser(root, flist=None, tb=None, top=None):
     if top is None:
@@ -120,3 +123,30 @@
             item = make_objecttreeitem(key + " =", value, setfunction)
             sublist.append(item)
         return sublist
+
+def _stack_viewer(parent):
+    root = tk.Tk()
+    root.title("Test StackViewer")
+    width, height, x, y = list(map(int, re.split('[x+]', parent.geometry())))
+    root.geometry("+%d+%d"%(x, y + 150))
+    flist = PyShellFileList(root)
+    try: # to obtain a traceback object
+        intentional_name_error
+    except NameError:
+        exc_type, exc_value, exc_tb = sys.exc_info()
+
+    # inject stack trace to sys
+    sys.last_type = exc_type
+    sys.last_value = exc_value
+    sys.last_traceback = exc_tb
+
+    StackBrowser(root, flist=flist, top=root, tb=exc_tb)
+
+    # restore sys to original state
+    del sys.last_type
+    del sys.last_value
+    del sys.last_traceback
+
+if __name__ == '__main__':
+    from idlelib.idle_test.htest import run
+    run(_stack_viewer)
diff --git a/Lib/idlelib/ToolTip.py b/Lib/idlelib/ToolTip.py
index b178803..964107e 100644
--- a/Lib/idlelib/ToolTip.py
+++ b/Lib/idlelib/ToolTip.py
@@ -76,14 +76,22 @@
         for item in self.items:
             listbox.insert(END, item)
 
-def main():
-    # Test code
+def _tooltip(parent):
     root = Tk()
-    b = Button(root, text="Hello", command=root.destroy)
-    b.pack()
-    root.update()
-    tip = ListboxToolTip(b, ["Hello", "world"])
+    root.title("Test tooltip")
+    width, height, x, y = list(map(int, re.split('[x+]', parent.geometry())))
+    root.geometry("+%d+%d"%(x, y + 150))
+    label = Label(root, text="Place your mouse over buttons")
+    label.pack()
+    button1 = Button(root, text="Button 1")
+    button2 = Button(root, text="Button 2")
+    button1.pack()
+    button2.pack()
+    ToolTip(button1, "This is tooltip text for button1.")
+    ListboxToolTip(button2, ["This is","multiple line",
+                            "tooltip text","for button2"])
     root.mainloop()
 
 if __name__ == '__main__':
-    main()
+    from idlelib.idle_test.htest import run
+    run(_tooltip)
diff --git a/Lib/idlelib/TreeWidget.py b/Lib/idlelib/TreeWidget.py
index 25bae48..860f60c 100644
--- a/Lib/idlelib/TreeWidget.py
+++ b/Lib/idlelib/TreeWidget.py
@@ -173,11 +173,12 @@
 
     def draw(self, x, y):
         # XXX This hard-codes too many geometry constants!
+        dy = 20
         self.x, self.y = x, y
         self.drawicon()
         self.drawtext()
         if self.state != 'expanded':
-            return y+17
+            return y + dy
         # draw children
         if not self.children:
             sublist = self.item._GetSubList()
@@ -188,7 +189,7 @@
                 child = self.__class__(self.canvas, self, item)
                 self.children.append(child)
         cx = x+20
-        cy = y+17
+        cy = y + dy
         cylast = 0
         for child in self.children:
             cylast = cy
@@ -227,7 +228,7 @@
 
     def drawtext(self):
         textx = self.x+20-1
-        texty = self.y-1
+        texty = self.y-4
         labeltext = self.item.GetLabelText()
         if labeltext:
             id = self.canvas.create_text(textx, texty, anchor="nw",
@@ -381,7 +382,7 @@
         try:
             os.rename(self.path, newpath)
             self.path = newpath
-        except os.error:
+        except OSError:
             pass
 
     def GetIconName(self):
@@ -394,7 +395,7 @@
     def GetSubList(self):
         try:
             names = os.listdir(self.path)
-        except os.error:
+        except OSError:
             return []
         names.sort(key = os.path.normcase)
         sublist = []
@@ -448,29 +449,18 @@
         return "break"
 
 
-# Testing functions
-
-def test():
-    from idlelib import PyShell
-    root = Toplevel(PyShell.root)
-    root.configure(bd=0, bg="yellow")
-    root.focus_set()
+def _tree_widget(parent):
+    root = Tk()
+    root.title("Test TreeWidget")
+    width, height, x, y = list(map(int, re.split('[x+]', parent.geometry())))
+    root.geometry("+%d+%d"%(x, y + 150))
     sc = ScrolledCanvas(root, bg="white", highlightthickness=0, takefocus=1)
-    sc.frame.pack(expand=1, fill="both")
-    item = FileTreeItem("C:/windows/desktop")
+    sc.frame.pack(expand=1, fill="both", side=LEFT)
+    item = FileTreeItem(os.getcwd())
     node = TreeNode(sc.canvas, None, item)
     node.expand()
-
-def test2():
-    # test w/o scrolling canvas
-    root = Tk()
-    root.configure(bd=0)
-    canvas = Canvas(root, bg="white", highlightthickness=0)
-    canvas.pack(expand=1, fill="both")
-    item = FileTreeItem(os.curdir)
-    node = TreeNode(canvas, None, item)
-    node.update()
-    canvas.focus_set()
+    root.mainloop()
 
 if __name__ == '__main__':
-    test()
+    from idlelib.idle_test.htest import run
+    run(_tree_widget)
diff --git a/Lib/idlelib/UndoDelegator.py b/Lib/idlelib/UndoDelegator.py
index d2ef638..04c1cf5 100644
--- a/Lib/idlelib/UndoDelegator.py
+++ b/Lib/idlelib/UndoDelegator.py
@@ -336,17 +336,30 @@
         self.depth = self.depth + incr
         return self.depth
 
-def main():
+def _undo_delegator(parent):
     from idlelib.Percolator import Percolator
     root = Tk()
-    root.wm_protocol("WM_DELETE_WINDOW", root.quit)
-    text = Text()
+    root.title("Test UndoDelegator")
+    width, height, x, y = list(map(int, re.split('[x+]', parent.geometry())))
+    root.geometry("+%d+%d"%(x, y + 150))
+
+    text = Text(root)
+    text.config(height=10)
     text.pack()
     text.focus_set()
     p = Percolator(text)
     d = UndoDelegator()
     p.insertfilter(d)
+
+    undo = Button(root, text="Undo", command=lambda:d.undo_event(None))
+    undo.pack(side='left')
+    redo = Button(root, text="Redo", command=lambda:d.redo_event(None))
+    redo.pack(side='left')
+    dump = Button(root, text="Dump", command=lambda:d.dump_event(None))
+    dump.pack(side='left')
+
     root.mainloop()
 
 if __name__ == "__main__":
-    main()
+    from idlelib.idle_test.htest import run
+    run(_undo_delegator)
diff --git a/Lib/idlelib/WidgetRedirector.py b/Lib/idlelib/WidgetRedirector.py
index ba5251f..b3d7bfa 100644
--- a/Lib/idlelib/WidgetRedirector.py
+++ b/Lib/idlelib/WidgetRedirector.py
@@ -1,29 +1,40 @@
-from tkinter import *
+from tkinter import TclError
 
 class WidgetRedirector:
-
     """Support for redirecting arbitrary widget subcommands.
 
-    Some Tk operations don't normally pass through Tkinter.  For example, if a
+    Some Tk operations don't normally pass through tkinter.  For example, if a
     character is inserted into a Text widget by pressing a key, a default Tk
     binding to the widget's 'insert' operation is activated, and the Tk library
-    processes the insert without calling back into Tkinter.
+    processes the insert without calling back into tkinter.
 
-    Although a binding to <Key> could be made via Tkinter, what we really want
-    to do is to hook the Tk 'insert' operation itself.
+    Although a binding to <Key> could be made via tkinter, what we really want
+    to do is to hook the Tk 'insert' operation itself.  For one thing, we want
+    a text.insert call in idle code to have the same effect as a key press.
 
     When a widget is instantiated, a Tcl command is created whose name is the
     same as the pathname widget._w.  This command is used to invoke the various
     widget operations, e.g. insert (for a Text widget). We are going to hook
     this command and provide a facility ('register') to intercept the widget
-    operation.
+    operation.  We will also intercept method calls on the tkinter class
+    instance that represents the tk widget.
 
-    In IDLE, the function being registered provides access to the top of a
-    Percolator chain.  At the bottom of the chain is a call to the original
-    Tk widget operation.
-
+    In IDLE, WidgetRedirector is used in Percolator to intercept Text
+    commands.  The function being registered provides access to the top
+    of a Percolator chain.  At the bottom of the chain is a call to the
+    original Tk widget operation.
     """
     def __init__(self, widget):
+        '''Initialize attributes and setup redirection.
+
+        _operations: dict mapping operation name to new function.
+        widget: the widget whose tcl command is to be intercepted.
+        tk: widget.tk, a convenience attribute, probably not needed.
+        orig: new name of the original tcl command.
+
+        Since renaming to orig fails with TclError when orig already
+        exists, only one WidgetDirector can exist for a given widget.
+        '''
         self._operations = {}
         self.widget = widget            # widget instance
         self.tk = tk = widget.tk        # widget's root
@@ -40,27 +51,45 @@
                                              self.widget._w)
 
     def close(self):
+        "Unregister operations and revert redirection created by .__init__."
         for operation in list(self._operations):
             self.unregister(operation)
-        widget = self.widget; del self.widget
-        orig = self.orig; del self.orig
+        widget = self.widget
         tk = widget.tk
         w = widget._w
+        # Restore the original widget Tcl command.
         tk.deletecommand(w)
-        # restore the original widget Tcl command:
-        tk.call("rename", orig, w)
+        tk.call("rename", self.orig, w)
+        del self.widget, self.tk  # Should not be needed
+        # if instance is deleted after close, as in Percolator.
 
     def register(self, operation, function):
+        '''Return OriginalCommand(operation) after registering function.
+
+        Registration adds an operation: function pair to ._operations.
+        It also adds an widget function attribute that masks the tkinter
+        class instance method.  Method masking operates independently
+        from command dispatch.
+
+        If a second function is registered for the same operation, the
+        first function is replaced in both places.
+        '''
         self._operations[operation] = function
         setattr(self.widget, operation, function)
         return OriginalCommand(self, operation)
 
     def unregister(self, operation):
+        '''Return the function for the operation, or None.
+
+        Deleting the instance attribute unmasks the class attribute.
+        '''
         if operation in self._operations:
             function = self._operations[operation]
             del self._operations[operation]
-            if hasattr(self.widget, operation):
+            try:
                 delattr(self.widget, operation)
+            except AttributeError:
+                pass
             return function
         else:
             return None
@@ -88,14 +117,29 @@
 
 
 class OriginalCommand:
+    '''Callable for original tk command that has been redirected.
+
+    Returned by .register; can be used in the function registered.
+    redir = WidgetRedirector(text)
+    def my_insert(*args):
+        print("insert", args)
+        original_insert(*args)
+    original_insert = redir.register("insert", my_insert)
+    '''
 
     def __init__(self, redir, operation):
+        '''Create .tk_call and .orig_and_operation for .__call__ method.
+
+        .redir and .operation store the input args for __repr__.
+        .tk and .orig copy attributes of .redir (probably not needed).
+        '''
         self.redir = redir
         self.operation = operation
-        self.tk = redir.tk
-        self.orig = redir.orig
-        self.tk_call = self.tk.call
-        self.orig_and_operation = (self.orig, self.operation)
+        self.tk = redir.tk  # redundant with self.redir
+        self.orig = redir.orig  # redundant with self.redir
+        # These two could be deleted after checking recipient code.
+        self.tk_call = redir.tk.call
+        self.orig_and_operation = (redir.orig, operation)
 
     def __repr__(self):
         return "OriginalCommand(%r, %r)" % (self.redir, self.operation)
@@ -104,23 +148,27 @@
         return self.tk_call(self.orig_and_operation + args)
 
 
-def main():
+def _widget_redirector(parent):  # htest #
+    from tkinter import Tk, Text
+    import re
+
     root = Tk()
-    root.wm_protocol("WM_DELETE_WINDOW", root.quit)
-    text = Text()
+    root.title("Test WidgetRedirector")
+    width, height, x, y = list(map(int, re.split('[x+]', parent.geometry())))
+    root.geometry("+%d+%d"%(x, y + 150))
+    text = Text(root)
     text.pack()
     text.focus_set()
     redir = WidgetRedirector(text)
-    global previous_tcl_fcn
     def my_insert(*args):
         print("insert", args)
-        previous_tcl_fcn(*args)
-    previous_tcl_fcn = redir.register("insert", my_insert)
+        original_insert(*args)
+    original_insert = redir.register("insert", my_insert)
     root.mainloop()
-    redir.unregister("insert")  # runs after first 'close window'
-    redir.close()
-    root.mainloop()
-    root.destroy()
 
 if __name__ == "__main__":
-    main()
+    import unittest
+    unittest.main('idlelib.idle_test.test_widgetredir',
+                  verbosity=2, exit=False)
+    from idlelib.idle_test.htest import run
+    run(_widget_redirector)
diff --git a/Lib/idlelib/ZoomHeight.py b/Lib/idlelib/ZoomHeight.py
index e8d1710..a5d679e 100644
--- a/Lib/idlelib/ZoomHeight.py
+++ b/Lib/idlelib/ZoomHeight.py
@@ -32,7 +32,7 @@
         newy = 0
         newheight = newheight - 72
 
-    elif macosxSupport.runningAsOSXApp():
+    elif macosxSupport.isAquaTk():
         # The '88' below is a magic number that avoids placing the bottom
         # of the window below the panel on my machine. I don't know how
         # to calculate the correct value for this with tkinter.
diff --git a/Lib/idlelib/aboutDialog.py b/Lib/idlelib/aboutDialog.py
index 7fe1ab8..942562a 100644
--- a/Lib/idlelib/aboutDialog.py
+++ b/Lib/idlelib/aboutDialog.py
@@ -4,6 +4,7 @@
 
 from tkinter import *
 import os
+import sys
 
 from idlelib import textView
 from idlelib import idlever
@@ -12,11 +13,16 @@
     """Modal about dialog for idle
 
     """
-    def __init__(self,parent,title):
+    def __init__(self, parent, title, _htest=False):
+        """
+        _htest - bool, change box location when running htest
+        """
         Toplevel.__init__(self, parent)
         self.configure(borderwidth=5)
-        self.geometry("+%d+%d" % (parent.winfo_rootx()+30,
-                                  parent.winfo_rooty()+30))
+        # place dialog below parent if running htest
+        self.geometry("+%d+%d" % (
+                        parent.winfo_rootx()+30,
+                        parent.winfo_rooty()+(30 if not _htest else 100)))
         self.bg = "#707070"
         self.fg = "#ffffff"
         self.CreateWidgets()
@@ -57,7 +63,8 @@
                            justify=LEFT, fg=self.fg, bg=self.bg)
         labelEmail.grid(row=6, column=0, columnspan=2,
                         sticky=W, padx=10, pady=0)
-        labelWWW = Label(frameBg, text='www:  http://www.python.org/idle/',
+        labelWWW = Label(frameBg, text='https://docs.python.org/' +
+                         sys.version[:3] + '/library/idle.html',
                          justify=LEFT, fg=self.fg, bg=self.bg)
         labelWWW.grid(row=7, column=0, columnspan=2, sticky=W, padx=10, pady=0)
         Frame(frameBg, borderwidth=1, relief=SUNKEN,
@@ -136,10 +143,5 @@
         self.destroy()
 
 if __name__ == '__main__':
-    # test the dialog
-    root = Tk()
-    def run():
-        from idlelib import aboutDialog
-        aboutDialog.AboutDialog(root, 'About')
-    Button(root, text='Dialog', command=run).pack()
-    root.mainloop()
+    from idlelib.idle_test.htest import run
+    run(AboutDialog)
diff --git a/Lib/idlelib/config-extensions.def b/Lib/idlelib/config-extensions.def
index 39e69ce..a24b8c9 100644
--- a/Lib/idlelib/config-extensions.def
+++ b/Lib/idlelib/config-extensions.def
@@ -3,75 +3,37 @@
 # IDLE reads several config files to determine user preferences.  This
 # file is the default configuration file for IDLE extensions settings.
 #
-# Each extension must have at least one section, named after the extension
-# module. This section must contain an 'enable' item (=1 to enable the
-# extension, =0 to disable it), it may contain 'enable_editor' or 'enable_shell'
-# items, to apply it only to editor/shell windows, and may also contain any
-# other general configuration items for the extension.
+# Each extension must have at least one section, named after the
+# extension module. This section must contain an 'enable' item (=True to
+# enable the extension, =False to disable it), it may contain
+# 'enable_editor' or 'enable_shell' items, to apply it only to editor ir
+# shell windows, and may also contain any other general configuration
+# items for the extension.  Other True/False values will also be
+# recognized as boolean by the Extension Configuration dialog.
 #
-# Each extension must define at least one section named ExtensionName_bindings
-# or ExtensionName_cfgBindings. If present, ExtensionName_bindings defines
-# virtual event bindings for the extension that are not user re-configurable.
-# If present, ExtensionName_cfgBindings defines virtual event bindings for the
+# Each extension must define at least one section named
+# ExtensionName_bindings or ExtensionName_cfgBindings. If present,
+# ExtensionName_bindings defines virtual event bindings for the
+# extension that are not user re-configurable. If present,
+# ExtensionName_cfgBindings defines virtual event bindings for the
 # extension that may be sensibly re-configured.
 #
-# If there are no keybindings for a menus' virtual events, include lines like
-# <<toggle-code-context>>=   (See [CodeContext], below.)
+# If there are no keybindings for a menus' virtual events, include lines
+# like <<toggle-code-context>>=  (See [CodeContext], below.)
 #
-# Currently it is necessary to manually modify this file to change extension
-# key bindings and default values. To customize, create
+# Currently it is necessary to manually modify this file to change
+# extension key bindings and default values. To customize, create
 # ~/.idlerc/config-extensions.cfg and append the appropriate customized
 # section(s).  Those sections will override the defaults in this file.
 #
-# Note: If a keybinding is already in use when the extension is
-# loaded, the extension's virtual event's keybinding will be set to ''.
+# Note: If a keybinding is already in use when the extension is loaded,
+# the extension's virtual event's keybinding will be set to ''.
 #
 # See config-keys.def for notes on specifying keys and extend.txt for
 # information on creating IDLE extensions.
 
-[FormatParagraph]
-enable=1
-[FormatParagraph_cfgBindings]
-format-paragraph=<Alt-Key-q>
-
-[AutoExpand]
-enable=1
-[AutoExpand_cfgBindings]
-expand-word=<Alt-Key-slash>
-
-[ZoomHeight]
-enable=1
-[ZoomHeight_cfgBindings]
-zoom-height=<Alt-Key-2>
-
-[ScriptBinding]
-enable=1
-enable_shell=0
-enable_editor=1
-[ScriptBinding_cfgBindings]
-run-module=<Key-F5>
-check-module=<Alt-Key-x>
-
-[CallTips]
-enable=1
-[CallTips_cfgBindings]
-force-open-calltip=<Control-Key-backslash>
-[CallTips_bindings]
-try-open-calltip=<KeyRelease-parenleft>
-refresh-calltip=<KeyRelease-parenright> <KeyRelease-0>
-
-[ParenMatch]
-enable=1
-style= expression
-flash-delay= 500
-bell= 1
-[ParenMatch_cfgBindings]
-flash-paren=<Control-Key-0>
-[ParenMatch_bindings]
-paren-closed=<KeyRelease-parenright> <KeyRelease-bracketright> <KeyRelease-braceright>
-
 [AutoComplete]
-enable=1
+enable=True
 popupwait=2000
 [AutoComplete_cfgBindings]
 force-open-completions=<Control-Key-space>
@@ -79,18 +41,59 @@
 autocomplete=<Key-Tab>
 try-open-completions=<KeyRelease-period> <KeyRelease-slash> <KeyRelease-backslash>
 
+[AutoExpand]
+enable=True
+[AutoExpand_cfgBindings]
+expand-word=<Alt-Key-slash>
+
+[CallTips]
+enable=True
+[CallTips_cfgBindings]
+force-open-calltip=<Control-Key-backslash>
+[CallTips_bindings]
+try-open-calltip=<KeyRelease-parenleft>
+refresh-calltip=<KeyRelease-parenright> <KeyRelease-0>
+
 [CodeContext]
-enable=1
-enable_shell=0
+enable=True
+enable_shell=False
 numlines=3
-visible=0
+visible=False
 bgcolor=LightGray
 fgcolor=Black
 [CodeContext_bindings]
 toggle-code-context=
 
-[RstripExtension]
-enable=1
-enable_shell=0
-enable_editor=1
+[FormatParagraph]
+enable=True
+max-width=72
+[FormatParagraph_cfgBindings]
+format-paragraph=<Alt-Key-q>
 
+[ParenMatch]
+enable=True
+style= expression
+flash-delay= 500
+bell=True
+[ParenMatch_cfgBindings]
+flash-paren=<Control-Key-0>
+[ParenMatch_bindings]
+paren-closed=<KeyRelease-parenright> <KeyRelease-bracketright> <KeyRelease-braceright>
+
+[RstripExtension]
+enable=True
+enable_shell=False
+enable_editor=True
+
+[ScriptBinding]
+enable=True
+enable_shell=False
+enable_editor=True
+[ScriptBinding_cfgBindings]
+run-module=<Key-F5>
+check-module=<Alt-Key-x>
+
+[ZoomHeight]
+enable=True
+[ZoomHeight_cfgBindings]
+zoom-height=<Alt-Key-2>
diff --git a/Lib/idlelib/config-keys.def b/Lib/idlelib/config-keys.def
index fdc35ba..3bfcb69 100644
--- a/Lib/idlelib/config-keys.def
+++ b/Lib/idlelib/config-keys.def
@@ -13,37 +13,37 @@
 paste=<Control-Key-v> <Control-Key-V>
 beginning-of-line= <Key-Home>
 center-insert=<Control-Key-l> <Control-Key-L>
-close-all-windows=<Control-Key-q>
+close-all-windows=<Control-Key-q> <Control-Key-Q>
 close-window=<Alt-Key-F4> <Meta-Key-F4>
 do-nothing=<Control-Key-F12>
 end-of-file=<Control-Key-d> <Control-Key-D>
 python-docs=<Key-F1>
 python-context-help=<Shift-Key-F1>
-history-next=<Alt-Key-n> <Meta-Key-n>
-history-previous=<Alt-Key-p> <Meta-Key-p>
+history-next=<Alt-Key-n> <Meta-Key-n> <Alt-Key-N> <Meta-Key-N>
+history-previous=<Alt-Key-p> <Meta-Key-p> <Alt-Key-P> <Meta-Key-P>
 interrupt-execution=<Control-Key-c> <Control-Key-C>
 view-restart=<Key-F6>
 restart-shell=<Control-Key-F6>
-open-class-browser=<Alt-Key-c> <Meta-Key-c> <Alt-Key-C>
-open-module=<Alt-Key-m> <Meta-Key-m> <Alt-Key-M>
+open-class-browser=<Alt-Key-c> <Meta-Key-c> <Alt-Key-C> <Meta-Key-C>
+open-module=<Alt-Key-m> <Meta-Key-m> <Alt-Key-M> <Meta-Key-M>
 open-new-window=<Control-Key-n> <Control-Key-N>
 open-window-from-file=<Control-Key-o> <Control-Key-O>
 plain-newline-and-indent=<Control-Key-j> <Control-Key-J>
 print-window=<Control-Key-p> <Control-Key-P>
-redo=<Control-Shift-Key-Z>
+redo=<Control-Shift-Key-Z> <Control-Shift-Key-z>
 remove-selection=<Key-Escape>
-save-copy-of-window-as-file=<Alt-Shift-Key-S>
-save-window-as-file=<Control-Shift-Key-S>
-save-window=<Control-Key-s>
-select-all=<Control-Key-a>
+save-copy-of-window-as-file=<Alt-Shift-Key-S> <Alt-Shift-Key-s>
+save-window-as-file=<Control-Shift-Key-S> <Control-Shift-Key-s>
+save-window=<Control-Key-s> <Control-Key-S>
+select-all=<Control-Key-a> <Control-Key-A>
 toggle-auto-coloring=<Control-Key-slash>
 undo=<Control-Key-z> <Control-Key-Z>
 find=<Control-Key-f> <Control-Key-F>
-find-again=<Control-Key-g> <Key-F3>
+find-again=<Control-Key-g> <Key-F3> <Control-Key-G>
 find-in-files=<Alt-Key-F3> <Meta-Key-F3>
 find-selection=<Control-Key-F3>
 replace=<Control-Key-h> <Control-Key-H>
-goto-line=<Alt-Key-g> <Meta-Key-g>
+goto-line=<Alt-Key-g> <Meta-Key-g> <Alt-Key-G> <Meta-Key-G>
 smart-backspace=<Key-BackSpace>
 newline-and-indent=<Key-Return> <Key-KP_Enter>
 smart-indent=<Key-Tab>
@@ -53,8 +53,8 @@
 uncomment-region=<Alt-Key-4> <Meta-Key-4>
 tabify-region=<Alt-Key-5> <Meta-Key-5>
 untabify-region=<Alt-Key-6> <Meta-Key-6>
-toggle-tabs=<Alt-Key-t> <Meta-Key-t> <Alt-Key-T>
-change-indentwidth=<Alt-Key-u> <Meta-Key-u> <Alt-Key-U>
+toggle-tabs=<Alt-Key-t> <Meta-Key-t> <Alt-Key-T> <Meta-Key-T>
+change-indentwidth=<Alt-Key-u> <Meta-Key-u> <Alt-Key-U> <Meta-Key-U>
 del-word-left=<Control-Key-BackSpace>
 del-word-right=<Control-Key-Delete>
 
diff --git a/Lib/idlelib/config-main.def b/Lib/idlelib/config-main.def
index 9546e2b..0d203cb 100644
--- a/Lib/idlelib/config-main.def
+++ b/Lib/idlelib/config-main.def
@@ -58,9 +58,6 @@
 font-bold= 0
 encoding= none
 
-[FormatParagraph]
-paragraph=70
-
 [Indent]
 use-spaces= 1
 num-spaces= 4
diff --git a/Lib/idlelib/configDialog.py b/Lib/idlelib/configDialog.py
index efe5c43..ec1de6c 100644
--- a/Lib/idlelib/configDialog.py
+++ b/Lib/idlelib/configDialog.py
@@ -13,7 +13,6 @@
 import tkinter.messagebox as tkMessageBox
 import tkinter.colorchooser as tkColorChooser
 import tkinter.font as tkFont
-import copy
 
 from idlelib.configHandler import idleConf
 from idlelib.dynOptionMenuWidget import DynOptionMenu
@@ -21,526 +20,562 @@
 from idlelib.keybindingDialog import GetKeysDialog
 from idlelib.configSectionNameDialog import GetCfgSectionNameDialog
 from idlelib.configHelpSourceEdit import GetHelpSourceDialog
+from idlelib.tabbedpages import TabbedPageSet
 from idlelib import macosxSupport
-
 class ConfigDialog(Toplevel):
 
-    def __init__(self,parent,title):
+    def __init__(self, parent, title='', _htest=False, _utest=False):
+        """
+        _htest - bool, change box location when running htest
+        _utest - bool, don't wait_window when running unittest
+        """
         Toplevel.__init__(self, parent)
+        self.parent = parent
+        if _htest:
+            parent.instance_dict = {}
         self.wm_withdraw()
 
         self.configure(borderwidth=5)
-        self.title('IDLE Preferences')
-        self.geometry("+%d+%d" % (parent.winfo_rootx()+20,
-                parent.winfo_rooty()+30))
+        self.title(title or 'IDLE Preferences')
+        self.geometry(
+                "+%d+%d" % (parent.winfo_rootx() + 20,
+                parent.winfo_rooty() + (30 if not _htest else 150)))
         #Theme Elements. Each theme element key is its display name.
         #The first value of the tuple is the sample area tag name.
         #The second value is the display name list sort index.
-        self.themeElements={'Normal Text':('normal','00'),
-            'Python Keywords':('keyword','01'),
-            'Python Definitions':('definition','02'),
+        self.themeElements={
+            'Normal Text':('normal', '00'),
+            'Python Keywords':('keyword', '01'),
+            'Python Definitions':('definition', '02'),
             'Python Builtins':('builtin', '03'),
-            'Python Comments':('comment','04'),
-            'Python Strings':('string','05'),
-            'Selected Text':('hilite','06'),
-            'Found Text':('hit','07'),
-            'Cursor':('cursor','08'),
-            'Error Text':('error','09'),
-            'Shell Normal Text':('console','10'),
-            'Shell Stdout Text':('stdout','11'),
-            'Shell Stderr Text':('stderr','12'),
+            'Python Comments':('comment', '04'),
+            'Python Strings':('string', '05'),
+            'Selected Text':('hilite', '06'),
+            'Found Text':('hit', '07'),
+            'Cursor':('cursor', '08'),
+            'Error Text':('error', '09'),
+            'Shell Normal Text':('console', '10'),
+            'Shell Stdout Text':('stdout', '11'),
+            'Shell Stderr Text':('stderr', '12'),
             }
         self.ResetChangedItems() #load initial values in changed items dict
         self.CreateWidgets()
-        self.resizable(height=FALSE,width=FALSE)
+        self.resizable(height=FALSE, width=FALSE)
         self.transient(parent)
         self.grab_set()
         self.protocol("WM_DELETE_WINDOW", self.Cancel)
-        self.parent = parent
         self.tabPages.focus_set()
         #key bindings for this dialog
-        #self.bind('<Escape>',self.Cancel) #dismiss dialog, no save
-        #self.bind('<Alt-a>',self.Apply) #apply changes, save
-        #self.bind('<F1>',self.Help) #context help
+        #self.bind('<Escape>', self.Cancel) #dismiss dialog, no save
+        #self.bind('<Alt-a>', self.Apply) #apply changes, save
+        #self.bind('<F1>', self.Help) #context help
         self.LoadConfigs()
         self.AttachVarCallbacks() #avoid callbacks during LoadConfigs
 
-        self.wm_deiconify()
-        self.wait_window()
+        if not _utest:
+            self.wm_deiconify()
+            self.wait_window()
 
     def CreateWidgets(self):
         self.tabPages = TabbedPageSet(self,
-                page_names=['Fonts/Tabs','Highlighting','Keys','General'])
-        frameActionButtons = Frame(self,pady=2)
-        #action buttons
-
-        if macosxSupport.runningAsOSXApp():
-            # Surpress the padx and pady arguments when
-            # running as IDLE.app, otherwise the text
-            # on these buttons will not be readable.
-            extraKwds={}
-        else:
-            extraKwds=dict(padx=6, pady=3)
-
-# Comment out button creation and packing until implement self.Help
-##        self.buttonHelp = Button(frameActionButtons,text='Help',
-##                command=self.Help,takefocus=FALSE,
-##                **extraKwds)
-        self.buttonOk = Button(frameActionButtons,text='Ok',
-                command=self.Ok,takefocus=FALSE,
-                **extraKwds)
-        self.buttonApply = Button(frameActionButtons,text='Apply',
-                command=self.Apply,takefocus=FALSE,
-                **extraKwds)
-        self.buttonCancel = Button(frameActionButtons,text='Cancel',
-                command=self.Cancel,takefocus=FALSE,
-                **extraKwds)
+                page_names=['Fonts/Tabs', 'Highlighting', 'Keys', 'General'])
+        self.tabPages.pack(side=TOP, expand=TRUE, fill=BOTH)
         self.CreatePageFontTab()
         self.CreatePageHighlight()
         self.CreatePageKeys()
         self.CreatePageGeneral()
-##        self.buttonHelp.pack(side=RIGHT,padx=5)
-        self.buttonOk.pack(side=LEFT,padx=5)
-        self.buttonApply.pack(side=LEFT,padx=5)
-        self.buttonCancel.pack(side=LEFT,padx=5)
-        frameActionButtons.pack(side=BOTTOM)
-        Frame(self, height=2, borderwidth=0).pack(side=BOTTOM)
-        self.tabPages.pack(side=TOP,expand=TRUE,fill=BOTH)
+        self.create_action_buttons().pack(side=BOTTOM)
+    def create_action_buttons(self):
+        if macosxSupport.isAquaTk():
+            # Changing the default padding on OSX results in unreadable
+            # text in the buttons
+            paddingArgs = {}
+        else:
+            paddingArgs = {'padx':6, 'pady':3}
+        outer = Frame(self, pady=2)
+        buttons = Frame(outer, pady=2)
+        self.buttonOk = Button(
+                buttons, text='Ok', command=self.Ok,
+                takefocus=FALSE, **paddingArgs)
+        self.buttonApply = Button(
+                buttons, text='Apply', command=self.Apply,
+                takefocus=FALSE, **paddingArgs)
+        self.buttonCancel = Button(
+                buttons, text='Cancel', command=self.Cancel,
+                takefocus=FALSE, **paddingArgs)
+        self.buttonOk.pack(side=LEFT, padx=5)
+        self.buttonApply.pack(side=LEFT, padx=5)
+        self.buttonCancel.pack(side=LEFT, padx=5)
+# Comment out Help button creation and packing until implement self.Help
+##        self.buttonHelp = Button(
+##                buttons, text='Help', command=self.Help,
+##                takefocus=FALSE, **paddingArgs)
+##        self.buttonHelp.pack(side=RIGHT, padx=5)
 
+        # add space above buttons
+        Frame(outer, height=2, borderwidth=0).pack(side=TOP)
+        buttons.pack(side=BOTTOM)
+        return outer
     def CreatePageFontTab(self):
-        #tkVars
-        self.fontSize=StringVar(self)
-        self.fontBold=BooleanVar(self)
-        self.fontName=StringVar(self)
-        self.spaceNum=IntVar(self)
-        self.editFont=tkFont.Font(self,('courier',10,'normal'))
+        parent = self.parent
+        self.fontSize = StringVar(parent)
+        self.fontBold = BooleanVar(parent)
+        self.fontName = StringVar(parent)
+        self.spaceNum = IntVar(parent)
+        self.editFont = tkFont.Font(parent, ('courier', 10, 'normal'))
+
         ##widget creation
         #body frame
-        frame=self.tabPages.pages['Fonts/Tabs'].frame
+        frame = self.tabPages.pages['Fonts/Tabs'].frame
         #body section frames
-        frameFont=LabelFrame(frame,borderwidth=2,relief=GROOVE,
-                             text=' Base Editor Font ')
-        frameIndent=LabelFrame(frame,borderwidth=2,relief=GROOVE,
-                               text=' Indentation Width ')
+        frameFont = LabelFrame(
+                frame, borderwidth=2, relief=GROOVE, text=' Base Editor Font ')
+        frameIndent = LabelFrame(
+                frame, borderwidth=2, relief=GROOVE, text=' Indentation Width ')
         #frameFont
-        frameFontName=Frame(frameFont)
-        frameFontParam=Frame(frameFont)
-        labelFontNameTitle=Label(frameFontName,justify=LEFT,
-                text='Font Face :')
-        self.listFontName=Listbox(frameFontName,height=5,takefocus=FALSE,
-                exportselection=FALSE)
-        self.listFontName.bind('<ButtonRelease-1>',self.OnListFontButtonRelease)
-        scrollFont=Scrollbar(frameFontName)
+        frameFontName = Frame(frameFont)
+        frameFontParam = Frame(frameFont)
+        labelFontNameTitle = Label(
+                frameFontName, justify=LEFT, text='Font Face :')
+        self.listFontName = Listbox(
+                frameFontName, height=5, takefocus=FALSE, exportselection=FALSE)
+        self.listFontName.bind(
+                '<ButtonRelease-1>', self.OnListFontButtonRelease)
+        scrollFont = Scrollbar(frameFontName)
         scrollFont.config(command=self.listFontName.yview)
         self.listFontName.config(yscrollcommand=scrollFont.set)
-        labelFontSizeTitle=Label(frameFontParam,text='Size :')
-        self.optMenuFontSize=DynOptionMenu(frameFontParam,self.fontSize,None,
-            command=self.SetFontSample)
-        checkFontBold=Checkbutton(frameFontParam,variable=self.fontBold,
-            onvalue=1,offvalue=0,text='Bold',command=self.SetFontSample)
-        frameFontSample=Frame(frameFont,relief=SOLID,borderwidth=1)
-        self.labelFontSample=Label(frameFontSample,
-                text='AaBbCcDdEe\nFfGgHhIiJjK\n1234567890\n#:+=(){}[]',
-                justify=LEFT,font=self.editFont)
+        labelFontSizeTitle = Label(frameFontParam, text='Size :')
+        self.optMenuFontSize = DynOptionMenu(
+                frameFontParam, self.fontSize, None, command=self.SetFontSample)
+        checkFontBold = Checkbutton(
+                frameFontParam, variable=self.fontBold, onvalue=1,
+                offvalue=0, text='Bold', command=self.SetFontSample)
+        frameFontSample = Frame(frameFont, relief=SOLID, borderwidth=1)
+        self.labelFontSample = Label(
+                frameFontSample, justify=LEFT, font=self.editFont,
+                text='AaBbCcDdEe\nFfGgHhIiJjK\n1234567890\n#:+=(){}[]')
         #frameIndent
-        frameIndentSize=Frame(frameIndent)
-        labelSpaceNumTitle=Label(frameIndentSize, justify=LEFT,
-                                 text='Python Standard: 4 Spaces!')
-        self.scaleSpaceNum=Scale(frameIndentSize, variable=self.spaceNum,
-                                 orient='horizontal',
-                                 tickinterval=2, from_=2, to=16)
+        frameIndentSize = Frame(frameIndent)
+        labelSpaceNumTitle = Label(
+                frameIndentSize, justify=LEFT,
+                text='Python Standard: 4 Spaces!')
+        self.scaleSpaceNum = Scale(
+                frameIndentSize, variable=self.spaceNum,
+                orient='horizontal', tickinterval=2, from_=2, to=16)
+
         #widget packing
         #body
-        frameFont.pack(side=LEFT,padx=5,pady=5,expand=TRUE,fill=BOTH)
-        frameIndent.pack(side=LEFT,padx=5,pady=5,fill=Y)
+        frameFont.pack(side=LEFT, padx=5, pady=5, expand=TRUE, fill=BOTH)
+        frameIndent.pack(side=LEFT, padx=5, pady=5, fill=Y)
         #frameFont
-        frameFontName.pack(side=TOP,padx=5,pady=5,fill=X)
-        frameFontParam.pack(side=TOP,padx=5,pady=5,fill=X)
-        labelFontNameTitle.pack(side=TOP,anchor=W)
-        self.listFontName.pack(side=LEFT,expand=TRUE,fill=X)
-        scrollFont.pack(side=LEFT,fill=Y)
-        labelFontSizeTitle.pack(side=LEFT,anchor=W)
-        self.optMenuFontSize.pack(side=LEFT,anchor=W)
-        checkFontBold.pack(side=LEFT,anchor=W,padx=20)
-        frameFontSample.pack(side=TOP,padx=5,pady=5,expand=TRUE,fill=BOTH)
-        self.labelFontSample.pack(expand=TRUE,fill=BOTH)
+        frameFontName.pack(side=TOP, padx=5, pady=5, fill=X)
+        frameFontParam.pack(side=TOP, padx=5, pady=5, fill=X)
+        labelFontNameTitle.pack(side=TOP, anchor=W)
+        self.listFontName.pack(side=LEFT, expand=TRUE, fill=X)
+        scrollFont.pack(side=LEFT, fill=Y)
+        labelFontSizeTitle.pack(side=LEFT, anchor=W)
+        self.optMenuFontSize.pack(side=LEFT, anchor=W)
+        checkFontBold.pack(side=LEFT, anchor=W, padx=20)
+        frameFontSample.pack(side=TOP, padx=5, pady=5, expand=TRUE, fill=BOTH)
+        self.labelFontSample.pack(expand=TRUE, fill=BOTH)
         #frameIndent
-        frameIndentSize.pack(side=TOP,fill=X)
-        labelSpaceNumTitle.pack(side=TOP,anchor=W,padx=5)
-        self.scaleSpaceNum.pack(side=TOP,padx=5,fill=X)
+        frameIndentSize.pack(side=TOP, fill=X)
+        labelSpaceNumTitle.pack(side=TOP, anchor=W, padx=5)
+        self.scaleSpaceNum.pack(side=TOP, padx=5, fill=X)
         return frame
 
     def CreatePageHighlight(self):
-        self.builtinTheme=StringVar(self)
-        self.customTheme=StringVar(self)
-        self.fgHilite=BooleanVar(self)
-        self.colour=StringVar(self)
-        self.fontName=StringVar(self)
-        self.themeIsBuiltin=BooleanVar(self)
-        self.highlightTarget=StringVar(self)
+        parent = self.parent
+        self.builtinTheme = StringVar(parent)
+        self.customTheme = StringVar(parent)
+        self.fgHilite = BooleanVar(parent)
+        self.colour = StringVar(parent)
+        self.fontName = StringVar(parent)
+        self.themeIsBuiltin = BooleanVar(parent)
+        self.highlightTarget = StringVar(parent)
+
         ##widget creation
         #body frame
-        frame=self.tabPages.pages['Highlighting'].frame
+        frame = self.tabPages.pages['Highlighting'].frame
         #body section frames
-        frameCustom=LabelFrame(frame,borderwidth=2,relief=GROOVE,
-                               text=' Custom Highlighting ')
-        frameTheme=LabelFrame(frame,borderwidth=2,relief=GROOVE,
-                              text=' Highlighting Theme ')
+        frameCustom = LabelFrame(frame, borderwidth=2, relief=GROOVE,
+                                 text=' Custom Highlighting ')
+        frameTheme = LabelFrame(frame, borderwidth=2, relief=GROOVE,
+                                text=' Highlighting Theme ')
         #frameCustom
-        self.textHighlightSample=Text(frameCustom,relief=SOLID,borderwidth=1,
-            font=('courier',12,''),cursor='hand2',width=21,height=11,
-            takefocus=FALSE,highlightthickness=0,wrap=NONE)
+        self.textHighlightSample=Text(
+                frameCustom, relief=SOLID, borderwidth=1,
+                font=('courier', 12, ''), cursor='hand2', width=21, height=11,
+                takefocus=FALSE, highlightthickness=0, wrap=NONE)
         text=self.textHighlightSample
-        text.bind('<Double-Button-1>',lambda e: 'break')
-        text.bind('<B1-Motion>',lambda e: 'break')
-        textAndTags=(('#you can click here','comment'),('\n','normal'),
-            ('#to choose items','comment'),('\n','normal'),('def','keyword'),
-            (' ','normal'),('func','definition'),('(param):','normal'),
-            ('\n  ','normal'),('"""string"""','string'),('\n  var0 = ','normal'),
-            ("'string'",'string'),('\n  var1 = ','normal'),("'selected'",'hilite'),
-            ('\n  var2 = ','normal'),("'found'",'hit'),
-            ('\n  var3 = ','normal'),('list', 'builtin'), ('(','normal'),
-            ('None', 'keyword'),(')\n\n','normal'),
-            (' error ','error'),(' ','normal'),('cursor |','cursor'),
-            ('\n ','normal'),('shell','console'),(' ','normal'),('stdout','stdout'),
-            (' ','normal'),('stderr','stderr'),('\n','normal'))
+        text.bind('<Double-Button-1>', lambda e: 'break')
+        text.bind('<B1-Motion>', lambda e: 'break')
+        textAndTags=(
+            ('#you can click here', 'comment'), ('\n', 'normal'),
+            ('#to choose items', 'comment'), ('\n', 'normal'),
+            ('def', 'keyword'), (' ', 'normal'),
+            ('func', 'definition'), ('(param):\n  ', 'normal'),
+            ('"""string"""', 'string'), ('\n  var0 = ', 'normal'),
+            ("'string'", 'string'), ('\n  var1 = ', 'normal'),
+            ("'selected'", 'hilite'), ('\n  var2 = ', 'normal'),
+            ("'found'", 'hit'), ('\n  var3 = ', 'normal'),
+            ('list', 'builtin'), ('(', 'normal'),
+            ('None', 'keyword'), (')\n\n', 'normal'),
+            (' error ', 'error'), (' ', 'normal'),
+            ('cursor |', 'cursor'), ('\n ', 'normal'),
+            ('shell', 'console'), (' ', 'normal'),
+            ('stdout', 'stdout'), (' ', 'normal'),
+            ('stderr', 'stderr'), ('\n', 'normal'))
         for txTa in textAndTags:
-            text.insert(END,txTa[0],txTa[1])
+            text.insert(END, txTa[0], txTa[1])
         for element in self.themeElements:
-            text.tag_bind(self.themeElements[element][0],'<ButtonPress-1>',
-                lambda event,elem=element: event.widget.winfo_toplevel()
-                .highlightTarget.set(elem))
+            def tem(event, elem=element):
+                event.widget.winfo_toplevel().highlightTarget.set(elem)
+            text.tag_bind(
+                    self.themeElements[element][0], '<ButtonPress-1>', tem)
         text.config(state=DISABLED)
-        self.frameColourSet=Frame(frameCustom,relief=SOLID,borderwidth=1)
-        frameFgBg=Frame(frameCustom)
-        buttonSetColour=Button(self.frameColourSet,text='Choose Colour for :',
-            command=self.GetColour,highlightthickness=0)
-        self.optMenuHighlightTarget=DynOptionMenu(self.frameColourSet,
-            self.highlightTarget,None,highlightthickness=0)#,command=self.SetHighlightTargetBinding
-        self.radioFg=Radiobutton(frameFgBg,variable=self.fgHilite,
-            value=1,text='Foreground',command=self.SetColourSampleBinding)
-        self.radioBg=Radiobutton(frameFgBg,variable=self.fgHilite,
-            value=0,text='Background',command=self.SetColourSampleBinding)
+        self.frameColourSet = Frame(frameCustom, relief=SOLID, borderwidth=1)
+        frameFgBg = Frame(frameCustom)
+        buttonSetColour = Button(
+                self.frameColourSet, text='Choose Colour for :',
+                command=self.GetColour, highlightthickness=0)
+        self.optMenuHighlightTarget = DynOptionMenu(
+                self.frameColourSet, self.highlightTarget, None,
+                highlightthickness=0) #, command=self.SetHighlightTargetBinding
+        self.radioFg = Radiobutton(
+                frameFgBg, variable=self.fgHilite, value=1,
+                text='Foreground', command=self.SetColourSampleBinding)
+        self.radioBg=Radiobutton(
+                frameFgBg, variable=self.fgHilite, value=0,
+                text='Background', command=self.SetColourSampleBinding)
         self.fgHilite.set(1)
-        buttonSaveCustomTheme=Button(frameCustom,
-            text='Save as New Custom Theme',command=self.SaveAsNewTheme)
+        buttonSaveCustomTheme = Button(
+                frameCustom, text='Save as New Custom Theme',
+                command=self.SaveAsNewTheme)
         #frameTheme
-        labelTypeTitle=Label(frameTheme,text='Select : ')
-        self.radioThemeBuiltin=Radiobutton(frameTheme,variable=self.themeIsBuiltin,
-            value=1,command=self.SetThemeType,text='a Built-in Theme')
-        self.radioThemeCustom=Radiobutton(frameTheme,variable=self.themeIsBuiltin,
-            value=0,command=self.SetThemeType,text='a Custom Theme')
-        self.optMenuThemeBuiltin=DynOptionMenu(frameTheme,
-            self.builtinTheme,None,command=None)
-        self.optMenuThemeCustom=DynOptionMenu(frameTheme,
-            self.customTheme,None,command=None)
-        self.buttonDeleteCustomTheme=Button(frameTheme,text='Delete Custom Theme',
+        labelTypeTitle = Label(frameTheme, text='Select : ')
+        self.radioThemeBuiltin = Radiobutton(
+                frameTheme, variable=self.themeIsBuiltin, value=1,
+                command=self.SetThemeType, text='a Built-in Theme')
+        self.radioThemeCustom = Radiobutton(
+                frameTheme, variable=self.themeIsBuiltin, value=0,
+                command=self.SetThemeType, text='a Custom Theme')
+        self.optMenuThemeBuiltin = DynOptionMenu(
+                frameTheme, self.builtinTheme, None, command=None)
+        self.optMenuThemeCustom=DynOptionMenu(
+                frameTheme, self.customTheme, None, command=None)
+        self.buttonDeleteCustomTheme=Button(
+                frameTheme, text='Delete Custom Theme',
                 command=self.DeleteCustomTheme)
+
         ##widget packing
         #body
-        frameCustom.pack(side=LEFT,padx=5,pady=5,expand=TRUE,fill=BOTH)
-        frameTheme.pack(side=LEFT,padx=5,pady=5,fill=Y)
+        frameCustom.pack(side=LEFT, padx=5, pady=5, expand=TRUE, fill=BOTH)
+        frameTheme.pack(side=LEFT, padx=5, pady=5, fill=Y)
         #frameCustom
-        self.frameColourSet.pack(side=TOP,padx=5,pady=5,expand=TRUE,fill=X)
-        frameFgBg.pack(side=TOP,padx=5,pady=0)
-        self.textHighlightSample.pack(side=TOP,padx=5,pady=5,expand=TRUE,
-            fill=BOTH)
-        buttonSetColour.pack(side=TOP,expand=TRUE,fill=X,padx=8,pady=4)
-        self.optMenuHighlightTarget.pack(side=TOP,expand=TRUE,fill=X,padx=8,pady=3)
-        self.radioFg.pack(side=LEFT,anchor=E)
-        self.radioBg.pack(side=RIGHT,anchor=W)
-        buttonSaveCustomTheme.pack(side=BOTTOM,fill=X,padx=5,pady=5)
+        self.frameColourSet.pack(side=TOP, padx=5, pady=5, expand=TRUE, fill=X)
+        frameFgBg.pack(side=TOP, padx=5, pady=0)
+        self.textHighlightSample.pack(
+                side=TOP, padx=5, pady=5, expand=TRUE, fill=BOTH)
+        buttonSetColour.pack(side=TOP, expand=TRUE, fill=X, padx=8, pady=4)
+        self.optMenuHighlightTarget.pack(
+                side=TOP, expand=TRUE, fill=X, padx=8, pady=3)
+        self.radioFg.pack(side=LEFT, anchor=E)
+        self.radioBg.pack(side=RIGHT, anchor=W)
+        buttonSaveCustomTheme.pack(side=BOTTOM, fill=X, padx=5, pady=5)
         #frameTheme
-        labelTypeTitle.pack(side=TOP,anchor=W,padx=5,pady=5)
-        self.radioThemeBuiltin.pack(side=TOP,anchor=W,padx=5)
-        self.radioThemeCustom.pack(side=TOP,anchor=W,padx=5,pady=2)
-        self.optMenuThemeBuiltin.pack(side=TOP,fill=X,padx=5,pady=5)
-        self.optMenuThemeCustom.pack(side=TOP,fill=X,anchor=W,padx=5,pady=5)
-        self.buttonDeleteCustomTheme.pack(side=TOP,fill=X,padx=5,pady=5)
+        labelTypeTitle.pack(side=TOP, anchor=W, padx=5, pady=5)
+        self.radioThemeBuiltin.pack(side=TOP, anchor=W, padx=5)
+        self.radioThemeCustom.pack(side=TOP, anchor=W, padx=5, pady=2)
+        self.optMenuThemeBuiltin.pack(side=TOP, fill=X, padx=5, pady=5)
+        self.optMenuThemeCustom.pack(side=TOP, fill=X, anchor=W, padx=5, pady=5)
+        self.buttonDeleteCustomTheme.pack(side=TOP, fill=X, padx=5, pady=5)
         return frame
 
     def CreatePageKeys(self):
-        #tkVars
-        self.bindingTarget=StringVar(self)
-        self.builtinKeys=StringVar(self)
-        self.customKeys=StringVar(self)
-        self.keysAreBuiltin=BooleanVar(self)
-        self.keyBinding=StringVar(self)
+        parent = self.parent
+        self.bindingTarget = StringVar(parent)
+        self.builtinKeys = StringVar(parent)
+        self.customKeys = StringVar(parent)
+        self.keysAreBuiltin = BooleanVar(parent)
+        self.keyBinding = StringVar(parent)
+
         ##widget creation
         #body frame
-        frame=self.tabPages.pages['Keys'].frame
+        frame = self.tabPages.pages['Keys'].frame
         #body section frames
-        frameCustom=LabelFrame(frame,borderwidth=2,relief=GROOVE,
-                               text=' Custom Key Bindings ')
-        frameKeySets=LabelFrame(frame,borderwidth=2,relief=GROOVE,
-                           text=' Key Set ')
+        frameCustom = LabelFrame(
+                frame, borderwidth=2, relief=GROOVE,
+                text=' Custom Key Bindings ')
+        frameKeySets = LabelFrame(
+                frame, borderwidth=2, relief=GROOVE, text=' Key Set ')
         #frameCustom
-        frameTarget=Frame(frameCustom)
-        labelTargetTitle=Label(frameTarget,text='Action - Key(s)')
-        scrollTargetY=Scrollbar(frameTarget)
-        scrollTargetX=Scrollbar(frameTarget,orient=HORIZONTAL)
-        self.listBindings=Listbox(frameTarget,takefocus=FALSE,
-                exportselection=FALSE)
-        self.listBindings.bind('<ButtonRelease-1>',self.KeyBindingSelected)
+        frameTarget = Frame(frameCustom)
+        labelTargetTitle = Label(frameTarget, text='Action - Key(s)')
+        scrollTargetY = Scrollbar(frameTarget)
+        scrollTargetX = Scrollbar(frameTarget, orient=HORIZONTAL)
+        self.listBindings = Listbox(
+                frameTarget, takefocus=FALSE, exportselection=FALSE)
+        self.listBindings.bind('<ButtonRelease-1>', self.KeyBindingSelected)
         scrollTargetY.config(command=self.listBindings.yview)
         scrollTargetX.config(command=self.listBindings.xview)
         self.listBindings.config(yscrollcommand=scrollTargetY.set)
         self.listBindings.config(xscrollcommand=scrollTargetX.set)
-        self.buttonNewKeys=Button(frameCustom,text='Get New Keys for Selection',
-            command=self.GetNewKeys,state=DISABLED)
+        self.buttonNewKeys = Button(
+                frameCustom, text='Get New Keys for Selection',
+                command=self.GetNewKeys, state=DISABLED)
         #frameKeySets
         frames = [Frame(frameKeySets, padx=2, pady=2, borderwidth=0)
                   for i in range(2)]
-        self.radioKeysBuiltin=Radiobutton(frames[0],variable=self.keysAreBuiltin,
-            value=1,command=self.SetKeysType,text='Use a Built-in Key Set')
-        self.radioKeysCustom=Radiobutton(frames[0],variable=self.keysAreBuiltin,
-            value=0,command=self.SetKeysType,text='Use a Custom Key Set')
-        self.optMenuKeysBuiltin=DynOptionMenu(frames[0],
-            self.builtinKeys,None,command=None)
-        self.optMenuKeysCustom=DynOptionMenu(frames[0],
-            self.customKeys,None,command=None)
-        self.buttonDeleteCustomKeys=Button(frames[1],text='Delete Custom Key Set',
+        self.radioKeysBuiltin = Radiobutton(
+                frames[0], variable=self.keysAreBuiltin, value=1,
+                command=self.SetKeysType, text='Use a Built-in Key Set')
+        self.radioKeysCustom = Radiobutton(
+                frames[0], variable=self.keysAreBuiltin,  value=0,
+                command=self.SetKeysType, text='Use a Custom Key Set')
+        self.optMenuKeysBuiltin = DynOptionMenu(
+                frames[0], self.builtinKeys, None, command=None)
+        self.optMenuKeysCustom = DynOptionMenu(
+                frames[0], self.customKeys, None, command=None)
+        self.buttonDeleteCustomKeys = Button(
+                frames[1], text='Delete Custom Key Set',
                 command=self.DeleteCustomKeys)
-        buttonSaveCustomKeys=Button(frames[1],
-                text='Save as New Custom Key Set',command=self.SaveAsNewKeySet)
+        buttonSaveCustomKeys = Button(
+                frames[1], text='Save as New Custom Key Set',
+                command=self.SaveAsNewKeySet)
+
         ##widget packing
         #body
-        frameCustom.pack(side=BOTTOM,padx=5,pady=5,expand=TRUE,fill=BOTH)
-        frameKeySets.pack(side=BOTTOM,padx=5,pady=5,fill=BOTH)
+        frameCustom.pack(side=BOTTOM, padx=5, pady=5, expand=TRUE, fill=BOTH)
+        frameKeySets.pack(side=BOTTOM, padx=5, pady=5, fill=BOTH)
         #frameCustom
-        self.buttonNewKeys.pack(side=BOTTOM,fill=X,padx=5,pady=5)
-        frameTarget.pack(side=LEFT,padx=5,pady=5,expand=TRUE,fill=BOTH)
+        self.buttonNewKeys.pack(side=BOTTOM, fill=X, padx=5, pady=5)
+        frameTarget.pack(side=LEFT, padx=5, pady=5, expand=TRUE, fill=BOTH)
         #frame target
-        frameTarget.columnconfigure(0,weight=1)
-        frameTarget.rowconfigure(1,weight=1)
-        labelTargetTitle.grid(row=0,column=0,columnspan=2,sticky=W)
-        self.listBindings.grid(row=1,column=0,sticky=NSEW)
-        scrollTargetY.grid(row=1,column=1,sticky=NS)
-        scrollTargetX.grid(row=2,column=0,sticky=EW)
+        frameTarget.columnconfigure(0, weight=1)
+        frameTarget.rowconfigure(1, weight=1)
+        labelTargetTitle.grid(row=0, column=0, columnspan=2, sticky=W)
+        self.listBindings.grid(row=1, column=0, sticky=NSEW)
+        scrollTargetY.grid(row=1, column=1, sticky=NS)
+        scrollTargetX.grid(row=2, column=0, sticky=EW)
         #frameKeySets
         self.radioKeysBuiltin.grid(row=0, column=0, sticky=W+NS)
         self.radioKeysCustom.grid(row=1, column=0, sticky=W+NS)
         self.optMenuKeysBuiltin.grid(row=0, column=1, sticky=NSEW)
         self.optMenuKeysCustom.grid(row=1, column=1, sticky=NSEW)
-        self.buttonDeleteCustomKeys.pack(side=LEFT,fill=X,expand=True,padx=2)
-        buttonSaveCustomKeys.pack(side=LEFT,fill=X,expand=True,padx=2)
+        self.buttonDeleteCustomKeys.pack(side=LEFT, fill=X, expand=True, padx=2)
+        buttonSaveCustomKeys.pack(side=LEFT, fill=X, expand=True, padx=2)
         frames[0].pack(side=TOP, fill=BOTH, expand=True)
         frames[1].pack(side=TOP, fill=X, expand=True, pady=2)
         return frame
 
     def CreatePageGeneral(self):
-        #tkVars
-        self.winWidth=StringVar(self)
-        self.winHeight=StringVar(self)
-        self.paraWidth=StringVar(self)
-        self.startupEdit=IntVar(self)
-        self.autoSave=IntVar(self)
-        self.encoding=StringVar(self)
-        self.userHelpBrowser=BooleanVar(self)
-        self.helpBrowser=StringVar(self)
+        parent = self.parent
+        self.winWidth = StringVar(parent)
+        self.winHeight = StringVar(parent)
+        self.startupEdit = IntVar(parent)
+        self.autoSave = IntVar(parent)
+        self.encoding = StringVar(parent)
+        self.userHelpBrowser = BooleanVar(parent)
+        self.helpBrowser = StringVar(parent)
+
         #widget creation
         #body
-        frame=self.tabPages.pages['General'].frame
+        frame = self.tabPages.pages['General'].frame
         #body section frames
-        frameRun=LabelFrame(frame,borderwidth=2,relief=GROOVE,
-                            text=' Startup Preferences ')
-        frameSave=LabelFrame(frame,borderwidth=2,relief=GROOVE,
-                             text=' Autosave Preferences ')
-        frameWinSize=Frame(frame,borderwidth=2,relief=GROOVE)
-        frameParaSize=Frame(frame,borderwidth=2,relief=GROOVE)
-        frameHelp=LabelFrame(frame,borderwidth=2,relief=GROOVE,
-                             text=' Additional Help Sources ')
+        frameRun = LabelFrame(frame, borderwidth=2, relief=GROOVE,
+                              text=' Startup Preferences ')
+        frameSave = LabelFrame(frame, borderwidth=2, relief=GROOVE,
+                               text=' Autosave Preferences ')
+        frameWinSize = Frame(frame, borderwidth=2, relief=GROOVE)
+        frameHelp = LabelFrame(frame, borderwidth=2, relief=GROOVE,
+                               text=' Additional Help Sources ')
         #frameRun
-        labelRunChoiceTitle=Label(frameRun,text='At Startup')
-        radioStartupEdit=Radiobutton(frameRun,variable=self.startupEdit,
-            value=1,command=self.SetKeysType,text="Open Edit Window")
-        radioStartupShell=Radiobutton(frameRun,variable=self.startupEdit,
-            value=0,command=self.SetKeysType,text='Open Shell Window')
+        labelRunChoiceTitle = Label(frameRun, text='At Startup')
+        radioStartupEdit = Radiobutton(
+                frameRun, variable=self.startupEdit, value=1,
+                command=self.SetKeysType, text="Open Edit Window")
+        radioStartupShell = Radiobutton(
+                frameRun, variable=self.startupEdit, value=0,
+                command=self.SetKeysType, text='Open Shell Window')
         #frameSave
-        labelRunSaveTitle=Label(frameSave,text='At Start of Run (F5)  ')
-        radioSaveAsk=Radiobutton(frameSave,variable=self.autoSave,
-            value=0,command=self.SetKeysType,text="Prompt to Save")
-        radioSaveAuto=Radiobutton(frameSave,variable=self.autoSave,
-            value=1,command=self.SetKeysType,text='No Prompt')
+        labelRunSaveTitle = Label(frameSave, text='At Start of Run (F5)  ')
+        radioSaveAsk = Radiobutton(
+                frameSave, variable=self.autoSave, value=0,
+                command=self.SetKeysType, text="Prompt to Save")
+        radioSaveAuto = Radiobutton(
+                frameSave, variable=self.autoSave, value=1,
+                command=self.SetKeysType, text='No Prompt')
         #frameWinSize
-        labelWinSizeTitle=Label(frameWinSize,text='Initial Window Size'+
-                '  (in characters)')
-        labelWinWidthTitle=Label(frameWinSize,text='Width')
-        entryWinWidth=Entry(frameWinSize,textvariable=self.winWidth,
-                width=3)
-        labelWinHeightTitle=Label(frameWinSize,text='Height')
-        entryWinHeight=Entry(frameWinSize,textvariable=self.winHeight,
-                width=3)
-        #paragraphFormatWidth
-        labelParaWidthTitle=Label(frameParaSize,text='Paragraph reformat'+
-                ' width (in characters)')
-        entryParaWidth=Entry(frameParaSize,textvariable=self.paraWidth,
-                width=3)
+        labelWinSizeTitle = Label(
+                frameWinSize, text='Initial Window Size  (in characters)')
+        labelWinWidthTitle = Label(frameWinSize, text='Width')
+        entryWinWidth = Entry(
+                frameWinSize, textvariable=self.winWidth, width=3)
+        labelWinHeightTitle = Label(frameWinSize, text='Height')
+        entryWinHeight = Entry(
+                frameWinSize, textvariable=self.winHeight, width=3)
         #frameHelp
-        frameHelpList=Frame(frameHelp)
-        frameHelpListButtons=Frame(frameHelpList)
-        scrollHelpList=Scrollbar(frameHelpList)
-        self.listHelp=Listbox(frameHelpList,height=5,takefocus=FALSE,
+        frameHelpList = Frame(frameHelp)
+        frameHelpListButtons = Frame(frameHelpList)
+        scrollHelpList = Scrollbar(frameHelpList)
+        self.listHelp = Listbox(
+                frameHelpList, height=5, takefocus=FALSE,
                 exportselection=FALSE)
         scrollHelpList.config(command=self.listHelp.yview)
         self.listHelp.config(yscrollcommand=scrollHelpList.set)
-        self.listHelp.bind('<ButtonRelease-1>',self.HelpSourceSelected)
-        self.buttonHelpListEdit=Button(frameHelpListButtons,text='Edit',
-                state=DISABLED,width=8,command=self.HelpListItemEdit)
-        self.buttonHelpListAdd=Button(frameHelpListButtons,text='Add',
-                width=8,command=self.HelpListItemAdd)
-        self.buttonHelpListRemove=Button(frameHelpListButtons,text='Remove',
-                state=DISABLED,width=8,command=self.HelpListItemRemove)
+        self.listHelp.bind('<ButtonRelease-1>', self.HelpSourceSelected)
+        self.buttonHelpListEdit = Button(
+                frameHelpListButtons, text='Edit', state=DISABLED,
+                width=8, command=self.HelpListItemEdit)
+        self.buttonHelpListAdd = Button(
+                frameHelpListButtons, text='Add',
+                width=8, command=self.HelpListItemAdd)
+        self.buttonHelpListRemove = Button(
+                frameHelpListButtons, text='Remove', state=DISABLED,
+                width=8, command=self.HelpListItemRemove)
+
         #widget packing
         #body
-        frameRun.pack(side=TOP,padx=5,pady=5,fill=X)
-        frameSave.pack(side=TOP,padx=5,pady=5,fill=X)
-        frameWinSize.pack(side=TOP,padx=5,pady=5,fill=X)
-        frameParaSize.pack(side=TOP,padx=5,pady=5,fill=X)
-        frameHelp.pack(side=TOP,padx=5,pady=5,expand=TRUE,fill=BOTH)
+        frameRun.pack(side=TOP, padx=5, pady=5, fill=X)
+        frameSave.pack(side=TOP, padx=5, pady=5, fill=X)
+        frameWinSize.pack(side=TOP, padx=5, pady=5, fill=X)
+        frameHelp.pack(side=TOP, padx=5, pady=5, expand=TRUE, fill=BOTH)
         #frameRun
-        labelRunChoiceTitle.pack(side=LEFT,anchor=W,padx=5,pady=5)
-        radioStartupShell.pack(side=RIGHT,anchor=W,padx=5,pady=5)
-        radioStartupEdit.pack(side=RIGHT,anchor=W,padx=5,pady=5)
+        labelRunChoiceTitle.pack(side=LEFT, anchor=W, padx=5, pady=5)
+        radioStartupShell.pack(side=RIGHT, anchor=W, padx=5, pady=5)
+        radioStartupEdit.pack(side=RIGHT, anchor=W, padx=5, pady=5)
         #frameSave
-        labelRunSaveTitle.pack(side=LEFT,anchor=W,padx=5,pady=5)
-        radioSaveAuto.pack(side=RIGHT,anchor=W,padx=5,pady=5)
-        radioSaveAsk.pack(side=RIGHT,anchor=W,padx=5,pady=5)
+        labelRunSaveTitle.pack(side=LEFT, anchor=W, padx=5, pady=5)
+        radioSaveAuto.pack(side=RIGHT, anchor=W, padx=5, pady=5)
+        radioSaveAsk.pack(side=RIGHT, anchor=W, padx=5, pady=5)
         #frameWinSize
-        labelWinSizeTitle.pack(side=LEFT,anchor=W,padx=5,pady=5)
-        entryWinHeight.pack(side=RIGHT,anchor=E,padx=10,pady=5)
-        labelWinHeightTitle.pack(side=RIGHT,anchor=E,pady=5)
-        entryWinWidth.pack(side=RIGHT,anchor=E,padx=10,pady=5)
-        labelWinWidthTitle.pack(side=RIGHT,anchor=E,pady=5)
-        #paragraphFormatWidth
-        labelParaWidthTitle.pack(side=LEFT,anchor=W,padx=5,pady=5)
-        entryParaWidth.pack(side=RIGHT,anchor=E,padx=10,pady=5)
+        labelWinSizeTitle.pack(side=LEFT, anchor=W, padx=5, pady=5)
+        entryWinHeight.pack(side=RIGHT, anchor=E, padx=10, pady=5)
+        labelWinHeightTitle.pack(side=RIGHT, anchor=E, pady=5)
+        entryWinWidth.pack(side=RIGHT, anchor=E, padx=10, pady=5)
+        labelWinWidthTitle.pack(side=RIGHT, anchor=E, pady=5)
         #frameHelp
-        frameHelpListButtons.pack(side=RIGHT,padx=5,pady=5,fill=Y)
-        frameHelpList.pack(side=TOP,padx=5,pady=5,expand=TRUE,fill=BOTH)
-        scrollHelpList.pack(side=RIGHT,anchor=W,fill=Y)
-        self.listHelp.pack(side=LEFT,anchor=E,expand=TRUE,fill=BOTH)
-        self.buttonHelpListEdit.pack(side=TOP,anchor=W,pady=5)
-        self.buttonHelpListAdd.pack(side=TOP,anchor=W)
-        self.buttonHelpListRemove.pack(side=TOP,anchor=W,pady=5)
+        frameHelpListButtons.pack(side=RIGHT, padx=5, pady=5, fill=Y)
+        frameHelpList.pack(side=TOP, padx=5, pady=5, expand=TRUE, fill=BOTH)
+        scrollHelpList.pack(side=RIGHT, anchor=W, fill=Y)
+        self.listHelp.pack(side=LEFT, anchor=E, expand=TRUE, fill=BOTH)
+        self.buttonHelpListEdit.pack(side=TOP, anchor=W, pady=5)
+        self.buttonHelpListAdd.pack(side=TOP, anchor=W)
+        self.buttonHelpListRemove.pack(side=TOP, anchor=W, pady=5)
         return frame
 
     def AttachVarCallbacks(self):
-        self.fontSize.trace_variable('w',self.VarChanged_fontSize)
-        self.fontName.trace_variable('w',self.VarChanged_fontName)
-        self.fontBold.trace_variable('w',self.VarChanged_fontBold)
-        self.spaceNum.trace_variable('w',self.VarChanged_spaceNum)
-        self.colour.trace_variable('w',self.VarChanged_colour)
-        self.builtinTheme.trace_variable('w',self.VarChanged_builtinTheme)
-        self.customTheme.trace_variable('w',self.VarChanged_customTheme)
-        self.themeIsBuiltin.trace_variable('w',self.VarChanged_themeIsBuiltin)
-        self.highlightTarget.trace_variable('w',self.VarChanged_highlightTarget)
-        self.keyBinding.trace_variable('w',self.VarChanged_keyBinding)
-        self.builtinKeys.trace_variable('w',self.VarChanged_builtinKeys)
-        self.customKeys.trace_variable('w',self.VarChanged_customKeys)
-        self.keysAreBuiltin.trace_variable('w',self.VarChanged_keysAreBuiltin)
-        self.winWidth.trace_variable('w',self.VarChanged_winWidth)
-        self.winHeight.trace_variable('w',self.VarChanged_winHeight)
-        self.paraWidth.trace_variable('w',self.VarChanged_paraWidth)
-        self.startupEdit.trace_variable('w',self.VarChanged_startupEdit)
-        self.autoSave.trace_variable('w',self.VarChanged_autoSave)
-        self.encoding.trace_variable('w',self.VarChanged_encoding)
+        self.fontSize.trace_variable('w', self.VarChanged_fontSize)
+        self.fontName.trace_variable('w', self.VarChanged_fontName)
+        self.fontBold.trace_variable('w', self.VarChanged_fontBold)
+        self.spaceNum.trace_variable('w', self.VarChanged_spaceNum)
+        self.colour.trace_variable('w', self.VarChanged_colour)
+        self.builtinTheme.trace_variable('w', self.VarChanged_builtinTheme)
+        self.customTheme.trace_variable('w', self.VarChanged_customTheme)
+        self.themeIsBuiltin.trace_variable('w', self.VarChanged_themeIsBuiltin)
+        self.highlightTarget.trace_variable('w', self.VarChanged_highlightTarget)
+        self.keyBinding.trace_variable('w', self.VarChanged_keyBinding)
+        self.builtinKeys.trace_variable('w', self.VarChanged_builtinKeys)
+        self.customKeys.trace_variable('w', self.VarChanged_customKeys)
+        self.keysAreBuiltin.trace_variable('w', self.VarChanged_keysAreBuiltin)
+        self.winWidth.trace_variable('w', self.VarChanged_winWidth)
+        self.winHeight.trace_variable('w', self.VarChanged_winHeight)
+        self.startupEdit.trace_variable('w', self.VarChanged_startupEdit)
+        self.autoSave.trace_variable('w', self.VarChanged_autoSave)
+        self.encoding.trace_variable('w', self.VarChanged_encoding)
 
-    def VarChanged_fontSize(self,*params):
-        value=self.fontSize.get()
-        self.AddChangedItem('main','EditorWindow','font-size',value)
+    def VarChanged_fontSize(self, *params):
+        value = self.fontSize.get()
+        self.AddChangedItem('main', 'EditorWindow', 'font-size', value)
 
-    def VarChanged_fontName(self,*params):
-        value=self.fontName.get()
-        self.AddChangedItem('main','EditorWindow','font',value)
+    def VarChanged_fontName(self, *params):
+        value = self.fontName.get()
+        self.AddChangedItem('main', 'EditorWindow', 'font', value)
 
-    def VarChanged_fontBold(self,*params):
-        value=self.fontBold.get()
-        self.AddChangedItem('main','EditorWindow','font-bold',value)
+    def VarChanged_fontBold(self, *params):
+        value = self.fontBold.get()
+        self.AddChangedItem('main', 'EditorWindow', 'font-bold', value)
 
-    def VarChanged_spaceNum(self,*params):
-        value=self.spaceNum.get()
-        self.AddChangedItem('main','Indent','num-spaces',value)
+    def VarChanged_spaceNum(self, *params):
+        value = self.spaceNum.get()
+        self.AddChangedItem('main', 'Indent', 'num-spaces', value)
 
-    def VarChanged_colour(self,*params):
+    def VarChanged_colour(self, *params):
         self.OnNewColourSet()
 
-    def VarChanged_builtinTheme(self,*params):
-        value=self.builtinTheme.get()
-        self.AddChangedItem('main','Theme','name',value)
+    def VarChanged_builtinTheme(self, *params):
+        value = self.builtinTheme.get()
+        self.AddChangedItem('main', 'Theme', 'name', value)
         self.PaintThemeSample()
 
-    def VarChanged_customTheme(self,*params):
-        value=self.customTheme.get()
+    def VarChanged_customTheme(self, *params):
+        value = self.customTheme.get()
         if value != '- no custom themes -':
-            self.AddChangedItem('main','Theme','name',value)
+            self.AddChangedItem('main', 'Theme', 'name', value)
             self.PaintThemeSample()
 
-    def VarChanged_themeIsBuiltin(self,*params):
-        value=self.themeIsBuiltin.get()
-        self.AddChangedItem('main','Theme','default',value)
+    def VarChanged_themeIsBuiltin(self, *params):
+        value = self.themeIsBuiltin.get()
+        self.AddChangedItem('main', 'Theme', 'default', value)
         if value:
             self.VarChanged_builtinTheme()
         else:
             self.VarChanged_customTheme()
 
-    def VarChanged_highlightTarget(self,*params):
+    def VarChanged_highlightTarget(self, *params):
         self.SetHighlightTarget()
 
-    def VarChanged_keyBinding(self,*params):
-        value=self.keyBinding.get()
-        keySet=self.customKeys.get()
-        event=self.listBindings.get(ANCHOR).split()[0]
+    def VarChanged_keyBinding(self, *params):
+        value = self.keyBinding.get()
+        keySet = self.customKeys.get()
+        event = self.listBindings.get(ANCHOR).split()[0]
         if idleConf.IsCoreBinding(event):
             #this is a core keybinding
-            self.AddChangedItem('keys',keySet,event,value)
+            self.AddChangedItem('keys', keySet, event, value)
         else: #this is an extension key binding
-            extName=idleConf.GetExtnNameForEvent(event)
-            extKeybindSection=extName+'_cfgBindings'
-            self.AddChangedItem('extensions',extKeybindSection,event,value)
+            extName = idleConf.GetExtnNameForEvent(event)
+            extKeybindSection = extName + '_cfgBindings'
+            self.AddChangedItem('extensions', extKeybindSection, event, value)
 
-    def VarChanged_builtinKeys(self,*params):
-        value=self.builtinKeys.get()
-        self.AddChangedItem('main','Keys','name',value)
+    def VarChanged_builtinKeys(self, *params):
+        value = self.builtinKeys.get()
+        self.AddChangedItem('main', 'Keys', 'name', value)
         self.LoadKeysList(value)
 
-    def VarChanged_customKeys(self,*params):
-        value=self.customKeys.get()
+    def VarChanged_customKeys(self, *params):
+        value = self.customKeys.get()
         if value != '- no custom keys -':
-            self.AddChangedItem('main','Keys','name',value)
+            self.AddChangedItem('main', 'Keys', 'name', value)
             self.LoadKeysList(value)
 
-    def VarChanged_keysAreBuiltin(self,*params):
-        value=self.keysAreBuiltin.get()
-        self.AddChangedItem('main','Keys','default',value)
+    def VarChanged_keysAreBuiltin(self, *params):
+        value = self.keysAreBuiltin.get()
+        self.AddChangedItem('main', 'Keys', 'default', value)
         if value:
             self.VarChanged_builtinKeys()
         else:
             self.VarChanged_customKeys()
 
-    def VarChanged_winWidth(self,*params):
-        value=self.winWidth.get()
-        self.AddChangedItem('main','EditorWindow','width',value)
+    def VarChanged_winWidth(self, *params):
+        value = self.winWidth.get()
+        self.AddChangedItem('main', 'EditorWindow', 'width', value)
 
-    def VarChanged_winHeight(self,*params):
-        value=self.winHeight.get()
-        self.AddChangedItem('main','EditorWindow','height',value)
+    def VarChanged_winHeight(self, *params):
+        value = self.winHeight.get()
+        self.AddChangedItem('main', 'EditorWindow', 'height', value)
 
-    def VarChanged_paraWidth(self,*params):
-        value=self.paraWidth.get()
-        self.AddChangedItem('main','FormatParagraph','paragraph',value)
+    def VarChanged_startupEdit(self, *params):
+        value = self.startupEdit.get()
+        self.AddChangedItem('main', 'General', 'editor-on-startup', value)
 
-    def VarChanged_startupEdit(self,*params):
-        value=self.startupEdit.get()
-        self.AddChangedItem('main','General','editor-on-startup',value)
+    def VarChanged_autoSave(self, *params):
+        value = self.autoSave.get()
+        self.AddChangedItem('main', 'General', 'autosave', value)
 
-    def VarChanged_autoSave(self,*params):
-        value=self.autoSave.get()
-        self.AddChangedItem('main','General','autosave',value)
-
-    def VarChanged_encoding(self,*params):
-        value=self.encoding.get()
-        self.AddChangedItem('main','EditorWindow','encoding',value)
+    def VarChanged_encoding(self, *params):
+        value = self.encoding.get()
+        self.AddChangedItem('main', 'EditorWindow', 'encoding', value)
 
     def ResetChangedItems(self):
         #When any config item is changed in this dialog, an entry
@@ -548,24 +583,25 @@
         #dictionary. The key should be the config file section name and the
         #value a dictionary, whose key:value pairs are item=value pairs for
         #that config file section.
-        self.changedItems={'main':{},'highlight':{},'keys':{},'extensions':{}}
+        self.changedItems = {'main':{}, 'highlight':{}, 'keys':{},
+                             'extensions':{}}
 
-    def AddChangedItem(self,type,section,item,value):
-        value=str(value) #make sure we use a string
-        if section not in self.changedItems[type]:
-            self.changedItems[type][section]={}
-        self.changedItems[type][section][item]=value
+    def AddChangedItem(self, typ, section, item, value):
+        value = str(value) #make sure we use a string
+        if section not in self.changedItems[typ]:
+            self.changedItems[typ][section] = {}
+        self.changedItems[typ][section][item] = value
 
     def GetDefaultItems(self):
-        dItems={'main':{},'highlight':{},'keys':{},'extensions':{}}
+        dItems={'main':{}, 'highlight':{}, 'keys':{}, 'extensions':{}}
         for configType in dItems:
-            sections=idleConf.GetSectionList('default',configType)
+            sections = idleConf.GetSectionList('default', configType)
             for section in sections:
-                dItems[configType][section]={}
-                options=idleConf.defaultCfg[configType].GetOptionList(section)
+                dItems[configType][section] = {}
+                options = idleConf.defaultCfg[configType].GetOptionList(section)
                 for option in options:
-                    dItems[configType][section][option]=(
-                            idleConf.defaultCfg[configType].Get(section,option))
+                    dItems[configType][section][option] = (
+                            idleConf.defaultCfg[configType].Get(section, option))
         return dItems
 
     def SetThemeType(self):
@@ -591,26 +627,26 @@
             self.buttonDeleteCustomKeys.config(state=NORMAL)
 
     def GetNewKeys(self):
-        listIndex=self.listBindings.index(ANCHOR)
-        binding=self.listBindings.get(listIndex)
-        bindName=binding.split()[0] #first part, up to first space
+        listIndex = self.listBindings.index(ANCHOR)
+        binding = self.listBindings.get(listIndex)
+        bindName = binding.split()[0] #first part, up to first space
         if self.keysAreBuiltin.get():
-            currentKeySetName=self.builtinKeys.get()
+            currentKeySetName = self.builtinKeys.get()
         else:
-            currentKeySetName=self.customKeys.get()
-        currentBindings=idleConf.GetCurrentKeySet()
+            currentKeySetName = self.customKeys.get()
+        currentBindings = idleConf.GetCurrentKeySet()
         if currentKeySetName in self.changedItems['keys']: #unsaved changes
-            keySetChanges=self.changedItems['keys'][currentKeySetName]
+            keySetChanges = self.changedItems['keys'][currentKeySetName]
             for event in keySetChanges:
-                currentBindings[event]=keySetChanges[event].split()
+                currentBindings[event] = keySetChanges[event].split()
         currentKeySequences = list(currentBindings.values())
-        newKeys=GetKeysDialog(self,'Get New Keys',bindName,
+        newKeys = GetKeysDialog(self, 'Get New Keys', bindName,
                 currentKeySequences).result
         if newKeys: #new keys were specified
             if self.keysAreBuiltin.get(): #current key set is a built-in
-                message=('Your changes will be saved as a new Custom Key Set. '+
-                        'Enter a name for your new Custom Key Set below.')
-                newKeySet=self.GetNewKeysName(message)
+                message = ('Your changes will be saved as a new Custom Key Set.'
+                           ' Enter a name for your new Custom Key Set below.')
+                newKeySet = self.GetNewKeysName(message)
                 if not newKeySet: #user cancelled custom key set creation
                     self.listBindings.select_set(listIndex)
                     self.listBindings.select_anchor(listIndex)
@@ -618,7 +654,7 @@
                 else: #create new custom key set based on previously active key set
                     self.CreateNewKeySet(newKeySet)
             self.listBindings.delete(listIndex)
-            self.listBindings.insert(listIndex,bindName+' - '+newKeys)
+            self.listBindings.insert(listIndex, bindName+' - '+newKeys)
             self.listBindings.select_set(listIndex)
             self.listBindings.select_anchor(listIndex)
             self.keyBinding.set(newKeys)
@@ -626,65 +662,65 @@
             self.listBindings.select_set(listIndex)
             self.listBindings.select_anchor(listIndex)
 
-    def GetNewKeysName(self,message):
-        usedNames=(idleConf.GetSectionList('user','keys')+
-                idleConf.GetSectionList('default','keys'))
-        newKeySet=GetCfgSectionNameDialog(self,'New Custom Key Set',
-                message,usedNames).result
+    def GetNewKeysName(self, message):
+        usedNames = (idleConf.GetSectionList('user', 'keys') +
+                idleConf.GetSectionList('default', 'keys'))
+        newKeySet = GetCfgSectionNameDialog(
+                self, 'New Custom Key Set', message, usedNames).result
         return newKeySet
 
     def SaveAsNewKeySet(self):
-        newKeysName=self.GetNewKeysName('New Key Set Name:')
+        newKeysName = self.GetNewKeysName('New Key Set Name:')
         if newKeysName:
             self.CreateNewKeySet(newKeysName)
 
-    def KeyBindingSelected(self,event):
+    def KeyBindingSelected(self, event):
         self.buttonNewKeys.config(state=NORMAL)
 
-    def CreateNewKeySet(self,newKeySetName):
+    def CreateNewKeySet(self, newKeySetName):
         #creates new custom key set based on the previously active key set,
         #and makes the new key set active
         if self.keysAreBuiltin.get():
-            prevKeySetName=self.builtinKeys.get()
+            prevKeySetName = self.builtinKeys.get()
         else:
-            prevKeySetName=self.customKeys.get()
-        prevKeys=idleConf.GetCoreKeys(prevKeySetName)
-        newKeys={}
+            prevKeySetName = self.customKeys.get()
+        prevKeys = idleConf.GetCoreKeys(prevKeySetName)
+        newKeys = {}
         for event in prevKeys: #add key set to changed items
-            eventName=event[2:-2] #trim off the angle brackets
-            binding=' '.join(prevKeys[event])
-            newKeys[eventName]=binding
+            eventName = event[2:-2] #trim off the angle brackets
+            binding = ' '.join(prevKeys[event])
+            newKeys[eventName] = binding
         #handle any unsaved changes to prev key set
         if prevKeySetName in self.changedItems['keys']:
-            keySetChanges=self.changedItems['keys'][prevKeySetName]
+            keySetChanges = self.changedItems['keys'][prevKeySetName]
             for event in keySetChanges:
-                newKeys[event]=keySetChanges[event]
+                newKeys[event] = keySetChanges[event]
         #save the new theme
-        self.SaveNewKeySet(newKeySetName,newKeys)
+        self.SaveNewKeySet(newKeySetName, newKeys)
         #change gui over to the new key set
-        customKeyList=idleConf.GetSectionList('user','keys')
+        customKeyList = idleConf.GetSectionList('user', 'keys')
         customKeyList.sort()
-        self.optMenuKeysCustom.SetMenu(customKeyList,newKeySetName)
+        self.optMenuKeysCustom.SetMenu(customKeyList, newKeySetName)
         self.keysAreBuiltin.set(0)
         self.SetKeysType()
 
-    def LoadKeysList(self,keySetName):
-        reselect=0
-        newKeySet=0
+    def LoadKeysList(self, keySetName):
+        reselect = 0
+        newKeySet = 0
         if self.listBindings.curselection():
-            reselect=1
-            listIndex=self.listBindings.index(ANCHOR)
-        keySet=idleConf.GetKeySet(keySetName)
+            reselect = 1
+            listIndex = self.listBindings.index(ANCHOR)
+        keySet = idleConf.GetKeySet(keySetName)
         bindNames = list(keySet.keys())
         bindNames.sort()
-        self.listBindings.delete(0,END)
+        self.listBindings.delete(0, END)
         for bindName in bindNames:
-            key=' '.join(keySet[bindName]) #make key(s) into a string
-            bindName=bindName[2:-2] #trim off the angle brackets
+            key = ' '.join(keySet[bindName]) #make key(s) into a string
+            bindName = bindName[2:-2] #trim off the angle brackets
             if keySetName in self.changedItems['keys']:
                 #handle any unsaved changes to this key set
                 if bindName in self.changedItems['keys'][keySetName]:
-                    key=self.changedItems['keys'][keySetName][bindName]
+                    key = self.changedItems['keys'][keySetName][bindName]
             self.listBindings.insert(END, bindName+' - '+key)
         if reselect:
             self.listBindings.see(listIndex)
@@ -693,9 +729,9 @@
 
     def DeleteCustomKeys(self):
         keySetName=self.customKeys.get()
-        if not tkMessageBox.askyesno('Delete Key Set','Are you sure you wish '+
-                                     'to delete the key set %r ?' % (keySetName),
-                                     parent=self):
+        delmsg = 'Are you sure you wish to delete the key set %r ?'
+        if not tkMessageBox.askyesno(
+                'Delete Key Set',  delmsg % keySetName, parent=self):
             return
         #remove key set from config
         idleConf.userCfg['keys'].remove_section(keySetName)
@@ -704,25 +740,25 @@
         #write changes
         idleConf.userCfg['keys'].Save()
         #reload user key set list
-        itemList=idleConf.GetSectionList('user','keys')
+        itemList = idleConf.GetSectionList('user', 'keys')
         itemList.sort()
         if not itemList:
             self.radioKeysCustom.config(state=DISABLED)
-            self.optMenuKeysCustom.SetMenu(itemList,'- no custom keys -')
+            self.optMenuKeysCustom.SetMenu(itemList, '- no custom keys -')
         else:
-            self.optMenuKeysCustom.SetMenu(itemList,itemList[0])
+            self.optMenuKeysCustom.SetMenu(itemList, itemList[0])
         #revert to default key set
-        self.keysAreBuiltin.set(idleConf.defaultCfg['main'].Get('Keys','default'))
-        self.builtinKeys.set(idleConf.defaultCfg['main'].Get('Keys','name'))
+        self.keysAreBuiltin.set(idleConf.defaultCfg['main'].Get('Keys', 'default'))
+        self.builtinKeys.set(idleConf.defaultCfg['main'].Get('Keys', 'name'))
         #user can't back out of these changes, they must be applied now
         self.Apply()
         self.SetKeysType()
 
     def DeleteCustomTheme(self):
-        themeName=self.customTheme.get()
-        if not tkMessageBox.askyesno('Delete Theme','Are you sure you wish '+
-                                     'to delete the theme %r ?' % (themeName,),
-                                     parent=self):
+        themeName = self.customTheme.get()
+        delmsg = 'Are you sure you wish to delete the theme %r ?'
+        if not tkMessageBox.askyesno(
+                'Delete Theme',  delmsg % themeName, parent=self):
             return
         #remove theme from config
         idleConf.userCfg['highlight'].remove_section(themeName)
@@ -731,153 +767,149 @@
         #write changes
         idleConf.userCfg['highlight'].Save()
         #reload user theme list
-        itemList=idleConf.GetSectionList('user','highlight')
+        itemList = idleConf.GetSectionList('user', 'highlight')
         itemList.sort()
         if not itemList:
             self.radioThemeCustom.config(state=DISABLED)
-            self.optMenuThemeCustom.SetMenu(itemList,'- no custom themes -')
+            self.optMenuThemeCustom.SetMenu(itemList, '- no custom themes -')
         else:
-            self.optMenuThemeCustom.SetMenu(itemList,itemList[0])
+            self.optMenuThemeCustom.SetMenu(itemList, itemList[0])
         #revert to default theme
-        self.themeIsBuiltin.set(idleConf.defaultCfg['main'].Get('Theme','default'))
-        self.builtinTheme.set(idleConf.defaultCfg['main'].Get('Theme','name'))
+        self.themeIsBuiltin.set(idleConf.defaultCfg['main'].Get('Theme', 'default'))
+        self.builtinTheme.set(idleConf.defaultCfg['main'].Get('Theme', 'name'))
         #user can't back out of these changes, they must be applied now
         self.Apply()
         self.SetThemeType()
 
     def GetColour(self):
-        target=self.highlightTarget.get()
-        prevColour=self.frameColourSet.cget('bg')
-        rgbTuplet, colourString = tkColorChooser.askcolor(parent=self,
-            title='Pick new colour for : '+target,initialcolor=prevColour)
-        if colourString and (colourString!=prevColour):
+        target = self.highlightTarget.get()
+        prevColour = self.frameColourSet.cget('bg')
+        rgbTuplet, colourString = tkColorChooser.askcolor(
+                parent=self, title='Pick new colour for : '+target,
+                initialcolor=prevColour)
+        if colourString and (colourString != prevColour):
             #user didn't cancel, and they chose a new colour
-            if self.themeIsBuiltin.get(): #current theme is a built-in
-                message=('Your changes will be saved as a new Custom Theme. '+
-                        'Enter a name for your new Custom Theme below.')
-                newTheme=self.GetNewThemeName(message)
-                if not newTheme: #user cancelled custom theme creation
+            if self.themeIsBuiltin.get():  #current theme is a built-in
+                message = ('Your changes will be saved as a new Custom Theme. '
+                           'Enter a name for your new Custom Theme below.')
+                newTheme = self.GetNewThemeName(message)
+                if not newTheme:  #user cancelled custom theme creation
                     return
-                else: #create new custom theme based on previously active theme
+                else:  #create new custom theme based on previously active theme
                     self.CreateNewTheme(newTheme)
                     self.colour.set(colourString)
-            else: #current theme is user defined
+            else:  #current theme is user defined
                 self.colour.set(colourString)
 
     def OnNewColourSet(self):
         newColour=self.colour.get()
-        self.frameColourSet.config(bg=newColour)#set sample
-        if self.fgHilite.get(): plane='foreground'
-        else: plane='background'
-        sampleElement=self.themeElements[self.highlightTarget.get()][0]
+        self.frameColourSet.config(bg=newColour)  #set sample
+        plane ='foreground' if self.fgHilite.get() else 'background'
+        sampleElement = self.themeElements[self.highlightTarget.get()][0]
         self.textHighlightSample.tag_config(sampleElement, **{plane:newColour})
-        theme=self.customTheme.get()
-        themeElement=sampleElement+'-'+plane
-        self.AddChangedItem('highlight',theme,themeElement,newColour)
+        theme = self.customTheme.get()
+        themeElement = sampleElement + '-' + plane
+        self.AddChangedItem('highlight', theme, themeElement, newColour)
 
-    def GetNewThemeName(self,message):
-        usedNames=(idleConf.GetSectionList('user','highlight')+
-                idleConf.GetSectionList('default','highlight'))
-        newTheme=GetCfgSectionNameDialog(self,'New Custom Theme',
-                message,usedNames).result
+    def GetNewThemeName(self, message):
+        usedNames = (idleConf.GetSectionList('user', 'highlight') +
+                idleConf.GetSectionList('default', 'highlight'))
+        newTheme = GetCfgSectionNameDialog(
+                self, 'New Custom Theme', message, usedNames).result
         return newTheme
 
     def SaveAsNewTheme(self):
-        newThemeName=self.GetNewThemeName('New Theme Name:')
+        newThemeName = self.GetNewThemeName('New Theme Name:')
         if newThemeName:
             self.CreateNewTheme(newThemeName)
 
-    def CreateNewTheme(self,newThemeName):
+    def CreateNewTheme(self, newThemeName):
         #creates new custom theme based on the previously active theme,
         #and makes the new theme active
         if self.themeIsBuiltin.get():
-            themeType='default'
-            themeName=self.builtinTheme.get()
+            themeType = 'default'
+            themeName = self.builtinTheme.get()
         else:
-            themeType='user'
-            themeName=self.customTheme.get()
-        newTheme=idleConf.GetThemeDict(themeType,themeName)
+            themeType = 'user'
+            themeName = self.customTheme.get()
+        newTheme = idleConf.GetThemeDict(themeType, themeName)
         #apply any of the old theme's unsaved changes to the new theme
         if themeName in self.changedItems['highlight']:
-            themeChanges=self.changedItems['highlight'][themeName]
+            themeChanges = self.changedItems['highlight'][themeName]
             for element in themeChanges:
-                newTheme[element]=themeChanges[element]
+                newTheme[element] = themeChanges[element]
         #save the new theme
-        self.SaveNewTheme(newThemeName,newTheme)
+        self.SaveNewTheme(newThemeName, newTheme)
         #change gui over to the new theme
-        customThemeList=idleConf.GetSectionList('user','highlight')
+        customThemeList = idleConf.GetSectionList('user', 'highlight')
         customThemeList.sort()
-        self.optMenuThemeCustom.SetMenu(customThemeList,newThemeName)
+        self.optMenuThemeCustom.SetMenu(customThemeList, newThemeName)
         self.themeIsBuiltin.set(0)
         self.SetThemeType()
 
-    def OnListFontButtonRelease(self,event):
+    def OnListFontButtonRelease(self, event):
         font = self.listFontName.get(ANCHOR)
         self.fontName.set(font.lower())
         self.SetFontSample()
 
-    def SetFontSample(self,event=None):
-        fontName=self.fontName.get()
-        if self.fontBold.get():
-            fontWeight=tkFont.BOLD
-        else:
-            fontWeight=tkFont.NORMAL
+    def SetFontSample(self, event=None):
+        fontName = self.fontName.get()
+        fontWeight = tkFont.BOLD if self.fontBold.get() else tkFont.NORMAL
         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
+        if self.highlightTarget.get() == 'Cursor':  #bg not possible
             self.radioFg.config(state=DISABLED)
             self.radioBg.config(state=DISABLED)
             self.fgHilite.set(1)
-        else: #both fg and bg can be set
+        else:  #both fg and bg can be set
             self.radioFg.config(state=NORMAL)
             self.radioBg.config(state=NORMAL)
             self.fgHilite.set(1)
         self.SetColourSample()
 
-    def SetColourSampleBinding(self,*args):
+    def SetColourSampleBinding(self, *args):
         self.SetColourSample()
 
     def SetColourSample(self):
         #set the colour smaple area
-        tag=self.themeElements[self.highlightTarget.get()][0]
-        if self.fgHilite.get(): plane='foreground'
-        else: plane='background'
-        colour=self.textHighlightSample.tag_cget(tag,plane)
+        tag = self.themeElements[self.highlightTarget.get()][0]
+        plane = 'foreground' if self.fgHilite.get() else 'background'
+        colour = self.textHighlightSample.tag_cget(tag, plane)
         self.frameColourSet.config(bg=colour)
 
     def PaintThemeSample(self):
-        if self.themeIsBuiltin.get(): #a default theme
-            theme=self.builtinTheme.get()
-        else: #a user theme
-            theme=self.customTheme.get()
+        if self.themeIsBuiltin.get():  #a default theme
+            theme = self.builtinTheme.get()
+        else:  #a user theme
+            theme = self.customTheme.get()
         for elementTitle in self.themeElements:
-            element=self.themeElements[elementTitle][0]
-            colours=idleConf.GetHighlight(theme,element)
-            if element=='cursor': #cursor sample needs special painting
-                colours['background']=idleConf.GetHighlight(theme,
-                        'normal', fgBg='bg')
+            element = self.themeElements[elementTitle][0]
+            colours = idleConf.GetHighlight(theme, element)
+            if element == 'cursor': #cursor sample needs special painting
+                colours['background'] = idleConf.GetHighlight(
+                        theme, 'normal', fgBg='bg')
             #handle any unsaved changes to this theme
             if theme in self.changedItems['highlight']:
-                themeDict=self.changedItems['highlight'][theme]
-                if element+'-foreground' in themeDict:
-                    colours['foreground']=themeDict[element+'-foreground']
-                if element+'-background' in themeDict:
-                    colours['background']=themeDict[element+'-background']
+                themeDict = self.changedItems['highlight'][theme]
+                if element + '-foreground' in themeDict:
+                    colours['foreground'] = themeDict[element + '-foreground']
+                if element + '-background' in themeDict:
+                    colours['background'] = themeDict[element + '-background']
             self.textHighlightSample.tag_config(element, **colours)
         self.SetColourSample()
 
-    def HelpSourceSelected(self,event):
+    def HelpSourceSelected(self, event):
         self.SetHelpListButtonStates()
 
     def SetHelpListButtonStates(self):
-        if self.listHelp.size()<1: #no entries in list
+        if self.listHelp.size() < 1:  #no entries in list
             self.buttonHelpListEdit.config(state=DISABLED)
             self.buttonHelpListRemove.config(state=DISABLED)
         else: #there are some entries
-            if self.listHelp.curselection(): #there currently is a selection
+            if self.listHelp.curselection():  #there currently is a selection
                 self.buttonHelpListEdit.config(state=NORMAL)
                 self.buttonHelpListRemove.config(state=NORMAL)
             else:  #there currently is not a selection
@@ -885,28 +917,29 @@
                 self.buttonHelpListRemove.config(state=DISABLED)
 
     def HelpListItemAdd(self):
-        helpSource=GetHelpSourceDialog(self,'New Help Source').result
+        helpSource = GetHelpSourceDialog(self, 'New Help Source').result
         if helpSource:
-            self.userHelpList.append( (helpSource[0],helpSource[1]) )
-            self.listHelp.insert(END,helpSource[0])
+            self.userHelpList.append((helpSource[0], helpSource[1]))
+            self.listHelp.insert(END, helpSource[0])
             self.UpdateUserHelpChangedItems()
         self.SetHelpListButtonStates()
 
     def HelpListItemEdit(self):
-        itemIndex=self.listHelp.index(ANCHOR)
-        helpSource=self.userHelpList[itemIndex]
-        newHelpSource=GetHelpSourceDialog(self,'Edit Help Source',
-                menuItem=helpSource[0],filePath=helpSource[1]).result
-        if (not newHelpSource) or (newHelpSource==helpSource):
+        itemIndex = self.listHelp.index(ANCHOR)
+        helpSource = self.userHelpList[itemIndex]
+        newHelpSource = GetHelpSourceDialog(
+                self, 'Edit Help Source', menuItem=helpSource[0],
+                filePath=helpSource[1]).result
+        if (not newHelpSource) or (newHelpSource == helpSource):
             return #no changes
-        self.userHelpList[itemIndex]=newHelpSource
+        self.userHelpList[itemIndex] = newHelpSource
         self.listHelp.delete(itemIndex)
-        self.listHelp.insert(itemIndex,newHelpSource[0])
+        self.listHelp.insert(itemIndex, newHelpSource[0])
         self.UpdateUserHelpChangedItems()
         self.SetHelpListButtonStates()
 
     def HelpListItemRemove(self):
-        itemIndex=self.listHelp.index(ANCHOR)
+        itemIndex = self.listHelp.index(ANCHOR)
         del(self.userHelpList[itemIndex])
         self.listHelp.delete(itemIndex)
         self.UpdateUserHelpChangedItems()
@@ -915,18 +948,19 @@
     def UpdateUserHelpChangedItems(self):
         "Clear and rebuild the HelpFiles section in self.changedItems"
         self.changedItems['main']['HelpFiles'] = {}
-        for num in range(1,len(self.userHelpList)+1):
-            self.AddChangedItem('main','HelpFiles',str(num),
+        for num in range(1, len(self.userHelpList) + 1):
+            self.AddChangedItem(
+                    'main', 'HelpFiles', str(num),
                     ';'.join(self.userHelpList[num-1][:2]))
 
     def LoadFontCfg(self):
         ##base editor font selection list
-        fonts=list(tkFont.families(self))
+        fonts = list(tkFont.families(self))
         fonts.sort()
         for font in fonts:
-            self.listFontName.insert(END,font)
-        configuredFont=idleConf.GetOption('main','EditorWindow','font',
-                                          default='courier')
+            self.listFontName.insert(END, font)
+        configuredFont = idleConf.GetOption(
+                'main', 'EditorWindow', 'font', default='courier')
         lc_configuredFont = configuredFont.lower()
         self.fontName.set(lc_configuredFont)
         lc_fonts = [s.lower() for s in fonts]
@@ -936,107 +970,104 @@
             self.listFontName.select_set(currentFontIndex)
             self.listFontName.select_anchor(currentFontIndex)
         ##font size dropdown
-        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 )
+        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 )
         ##fontWeight
-        self.fontBold.set(idleConf.GetOption('main','EditorWindow',
-                                             'font-bold',default=0,type='bool'))
+        self.fontBold.set(idleConf.GetOption(
+                'main', 'EditorWindow', 'font-bold', default=0, type='bool'))
         ##font sample
         self.SetFontSample()
 
     def LoadTabCfg(self):
         ##indent sizes
-        spaceNum=idleConf.GetOption('main','Indent','num-spaces',
-                default=4,type='int')
+        spaceNum = idleConf.GetOption(
+            'main', 'Indent', 'num-spaces', default=4, type='int')
         self.spaceNum.set(spaceNum)
 
     def LoadThemeCfg(self):
         ##current theme type radiobutton
-        self.themeIsBuiltin.set(idleConf.GetOption('main','Theme','default',
-            type='bool',default=1))
+        self.themeIsBuiltin.set(idleConf.GetOption(
+                'main', 'Theme', 'default', type='bool', default=1))
         ##currently set theme
-        currentOption=idleConf.CurrentTheme()
+        currentOption = idleConf.CurrentTheme()
         ##load available theme option menus
         if self.themeIsBuiltin.get(): #default theme selected
-            itemList=idleConf.GetSectionList('default','highlight')
+            itemList = idleConf.GetSectionList('default', 'highlight')
             itemList.sort()
-            self.optMenuThemeBuiltin.SetMenu(itemList,currentOption)
-            itemList=idleConf.GetSectionList('user','highlight')
+            self.optMenuThemeBuiltin.SetMenu(itemList, currentOption)
+            itemList = idleConf.GetSectionList('user', 'highlight')
             itemList.sort()
             if not itemList:
                 self.radioThemeCustom.config(state=DISABLED)
                 self.customTheme.set('- no custom themes -')
             else:
-                self.optMenuThemeCustom.SetMenu(itemList,itemList[0])
+                self.optMenuThemeCustom.SetMenu(itemList, itemList[0])
         else: #user theme selected
-            itemList=idleConf.GetSectionList('user','highlight')
+            itemList = idleConf.GetSectionList('user', 'highlight')
             itemList.sort()
-            self.optMenuThemeCustom.SetMenu(itemList,currentOption)
-            itemList=idleConf.GetSectionList('default','highlight')
+            self.optMenuThemeCustom.SetMenu(itemList, currentOption)
+            itemList = idleConf.GetSectionList('default', 'highlight')
             itemList.sort()
-            self.optMenuThemeBuiltin.SetMenu(itemList,itemList[0])
+            self.optMenuThemeBuiltin.SetMenu(itemList, itemList[0])
         self.SetThemeType()
         ##load theme element option menu
         themeNames = list(self.themeElements.keys())
         themeNames.sort(key=lambda x: self.themeElements[x][1])
-        self.optMenuHighlightTarget.SetMenu(themeNames,themeNames[0])
+        self.optMenuHighlightTarget.SetMenu(themeNames, themeNames[0])
         self.PaintThemeSample()
         self.SetHighlightTarget()
 
     def LoadKeyCfg(self):
         ##current keys type radiobutton
-        self.keysAreBuiltin.set(idleConf.GetOption('main','Keys','default',
-            type='bool',default=1))
+        self.keysAreBuiltin.set(idleConf.GetOption(
+                'main', 'Keys', 'default', type='bool', default=1))
         ##currently set keys
-        currentOption=idleConf.CurrentKeys()
+        currentOption = idleConf.CurrentKeys()
         ##load available keyset option menus
         if self.keysAreBuiltin.get(): #default theme selected
-            itemList=idleConf.GetSectionList('default','keys')
+            itemList = idleConf.GetSectionList('default', 'keys')
             itemList.sort()
-            self.optMenuKeysBuiltin.SetMenu(itemList,currentOption)
-            itemList=idleConf.GetSectionList('user','keys')
+            self.optMenuKeysBuiltin.SetMenu(itemList, currentOption)
+            itemList = idleConf.GetSectionList('user', 'keys')
             itemList.sort()
             if not itemList:
                 self.radioKeysCustom.config(state=DISABLED)
                 self.customKeys.set('- no custom keys -')
             else:
-                self.optMenuKeysCustom.SetMenu(itemList,itemList[0])
+                self.optMenuKeysCustom.SetMenu(itemList, itemList[0])
         else: #user key set selected
-            itemList=idleConf.GetSectionList('user','keys')
+            itemList = idleConf.GetSectionList('user', 'keys')
             itemList.sort()
-            self.optMenuKeysCustom.SetMenu(itemList,currentOption)
-            itemList=idleConf.GetSectionList('default','keys')
+            self.optMenuKeysCustom.SetMenu(itemList, currentOption)
+            itemList = idleConf.GetSectionList('default', 'keys')
             itemList.sort()
-            self.optMenuKeysBuiltin.SetMenu(itemList,itemList[0])
+            self.optMenuKeysBuiltin.SetMenu(itemList, itemList[0])
         self.SetKeysType()
         ##load keyset element list
-        keySetName=idleConf.CurrentKeys()
+        keySetName = idleConf.CurrentKeys()
         self.LoadKeysList(keySetName)
 
     def LoadGeneralCfg(self):
         #startup state
-        self.startupEdit.set(idleConf.GetOption('main','General',
-                'editor-on-startup',default=1,type='bool'))
+        self.startupEdit.set(idleConf.GetOption(
+                'main', 'General', 'editor-on-startup', default=1, type='bool'))
         #autosave state
-        self.autoSave.set(idleConf.GetOption('main', 'General', 'autosave',
-                                             default=0, type='bool'))
+        self.autoSave.set(idleConf.GetOption(
+                'main', 'General', 'autosave', default=0, type='bool'))
         #initial window size
-        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',
-                                              type='int'))
+        self.winWidth.set(idleConf.GetOption(
+                'main', 'EditorWindow', 'width', type='int'))
+        self.winHeight.set(idleConf.GetOption(
+                'main', 'EditorWindow', 'height', type='int'))
         # default source encoding
-        self.encoding.set(idleConf.GetOption('main', 'EditorWindow',
-                                             'encoding', default='none'))
+        self.encoding.set(idleConf.GetOption(
+                'main', 'EditorWindow', 'encoding', default='none'))
         # additional help sources
         self.userHelpList = idleConf.GetAllExtraHelpSourcesList()
         for helpItem in self.userHelpList:
-            self.listHelp.insert(END,helpItem[0])
+            self.listHelp.insert(END, helpItem[0])
         self.SetHelpListButtonStates()
 
     def LoadConfigs(self):
@@ -1054,7 +1085,7 @@
         ### general page
         self.LoadGeneralCfg()
 
-    def SaveNewKeySet(self,keySetName,keySet):
+    def SaveNewKeySet(self, keySetName, keySet):
         """
         save a newly created core key set.
         keySetName - string, the name of the new key set
@@ -1063,10 +1094,10 @@
         if not idleConf.userCfg['keys'].has_section(keySetName):
             idleConf.userCfg['keys'].add_section(keySetName)
         for event in keySet:
-            value=keySet[event]
-            idleConf.userCfg['keys'].SetOption(keySetName,event,value)
+            value = keySet[event]
+            idleConf.userCfg['keys'].SetOption(keySetName, event, value)
 
-    def SaveNewTheme(self,themeName,theme):
+    def SaveNewTheme(self, themeName, theme):
         """
         save a newly created theme.
         themeName - string, the name of the new theme
@@ -1075,16 +1106,16 @@
         if not idleConf.userCfg['highlight'].has_section(themeName):
             idleConf.userCfg['highlight'].add_section(themeName)
         for element in theme:
-            value=theme[element]
-            idleConf.userCfg['highlight'].SetOption(themeName,element,value)
+            value = theme[element]
+            idleConf.userCfg['highlight'].SetOption(themeName, element, value)
 
-    def SetUserValue(self,configType,section,item,value):
-        if idleConf.defaultCfg[configType].has_option(section,item):
-            if idleConf.defaultCfg[configType].Get(section,item)==value:
+    def SetUserValue(self, configType, section, item, value):
+        if idleConf.defaultCfg[configType].has_option(section, item):
+            if idleConf.defaultCfg[configType].Get(section, item) == value:
                 #the setting equals a default setting, remove it from user cfg
-                return idleConf.userCfg[configType].RemoveOption(section,item)
+                return idleConf.userCfg[configType].RemoveOption(section, item)
         #if we got here set the option
-        return idleConf.userCfg[configType].SetOption(section,item,value)
+        return idleConf.userCfg[configType].SetOption(section, item, value)
 
     def SaveAllChangedConfigs(self):
         "Save configuration changes to the user config file."
@@ -1098,7 +1129,7 @@
                     cfgTypeHasChanges = True
                 for item in self.changedItems[configType][section]:
                     value = self.changedItems[configType][section][item]
-                    if self.SetUserValue(configType,section,item,value):
+                    if self.SetUserValue(configType, section, item, value):
                         cfgTypeHasChanges = True
             if cfgTypeHasChanges:
                 idleConf.userCfg[configType].Save()
@@ -1139,10 +1170,252 @@
     def Help(self):
         pass
 
+class VerticalScrolledFrame(Frame):
+    """A pure Tkinter vertically scrollable frame.
+
+    * Use the 'interior' attribute to place widgets inside the scrollable frame
+    * Construct and pack/place/grid normally
+    * This frame only allows vertical scrolling
+    """
+    def __init__(self, parent, *args, **kw):
+        Frame.__init__(self, parent, *args, **kw)
+
+        # create a canvas object and a vertical scrollbar for scrolling it
+        vscrollbar = Scrollbar(self, orient=VERTICAL)
+        vscrollbar.pack(fill=Y, side=RIGHT, expand=FALSE)
+        canvas = Canvas(self, bd=0, highlightthickness=0,
+                        yscrollcommand=vscrollbar.set)
+        canvas.pack(side=LEFT, fill=BOTH, expand=TRUE)
+        vscrollbar.config(command=canvas.yview)
+
+        # reset the view
+        canvas.xview_moveto(0)
+        canvas.yview_moveto(0)
+
+        # create a frame inside the canvas which will be scrolled with it
+        self.interior = interior = Frame(canvas)
+        interior_id = canvas.create_window(0, 0, window=interior, anchor=NW)
+
+        # track changes to the canvas and frame width and sync them,
+        # also updating the scrollbar
+        def _configure_interior(event):
+            # update the scrollbars to match the size of the inner frame
+            size = (interior.winfo_reqwidth(), interior.winfo_reqheight())
+            canvas.config(scrollregion="0 0 %s %s" % size)
+            if interior.winfo_reqwidth() != canvas.winfo_width():
+                # update the canvas's width to fit the inner frame
+                canvas.config(width=interior.winfo_reqwidth())
+        interior.bind('<Configure>', _configure_interior)
+
+        def _configure_canvas(event):
+            if interior.winfo_reqwidth() != canvas.winfo_width():
+                # update the inner frame's width to fill the canvas
+                canvas.itemconfigure(interior_id, width=canvas.winfo_width())
+        canvas.bind('<Configure>', _configure_canvas)
+
+        return
+
+def is_int(s):
+    "Return 's is blank or represents an int'"
+    if not s:
+        return True
+    try:
+        int(s)
+        return True
+    except ValueError:
+        return False
+
+# TODO:
+# * Revert to default(s)? Per option or per extension?
+# * List options in their original order (possible??)
+class ConfigExtensionsDialog(Toplevel):
+    """A dialog for configuring IDLE extensions.
+
+    This dialog is generic - it works for any and all IDLE extensions.
+
+    IDLE extensions save their configuration options using idleConf.
+    ConfigExtensionsDialog reads the current configuration using idleConf,
+    supplies a GUI interface to change the configuration values, and saves the
+    changes using idleConf.
+
+    Not all changes take effect immediately - some may require restarting IDLE.
+    This depends on each extension's implementation.
+
+    All values are treated as text, and it is up to the user to supply
+    reasonable values. The only exception to this are the 'enable*' options,
+    which are boolean, and can be toggled with an True/False button.
+    """
+    def __init__(self, parent, title=None, _htest=False):
+        Toplevel.__init__(self, parent)
+        self.wm_withdraw()
+
+        self.configure(borderwidth=5)
+        self.geometry(
+                "+%d+%d" % (parent.winfo_rootx() + 20,
+                parent.winfo_rooty() + (30 if not _htest else 150)))
+        self.wm_title(title or 'IDLE Extensions Configuration')
+
+        self.defaultCfg = idleConf.defaultCfg['extensions']
+        self.userCfg = idleConf.userCfg['extensions']
+        self.is_int = self.register(is_int)
+        self.load_extensions()
+        self.create_widgets()
+
+        self.resizable(height=FALSE, width=FALSE) # don't allow resizing yet
+        self.transient(parent)
+        self.protocol("WM_DELETE_WINDOW", self.Cancel)
+        self.tabbed_page_set.focus_set()
+        # wait for window to be generated
+        self.update()
+        # set current width as the minimum width
+        self.wm_minsize(self.winfo_width(), 1)
+        # now allow resizing
+        self.resizable(height=TRUE, width=TRUE)
+
+        self.wm_deiconify()
+        if not _htest:
+            self.grab_set()
+            self.wait_window()
+
+    def load_extensions(self):
+        "Fill self.extensions with data from the default and user configs."
+        self.extensions = {}
+        for ext_name in idleConf.GetExtensions(active_only=False):
+            self.extensions[ext_name] = []
+
+        for ext_name in self.extensions:
+            opt_list = sorted(self.defaultCfg.GetOptionList(ext_name))
+
+            # bring 'enable' options to the beginning of the list
+            enables = [opt_name for opt_name in opt_list
+                       if opt_name.startswith('enable')]
+            for opt_name in enables:
+                opt_list.remove(opt_name)
+            opt_list = enables + opt_list
+
+            for opt_name in opt_list:
+                def_str = self.defaultCfg.Get(
+                        ext_name, opt_name, raw=True)
+                try:
+                    def_obj = {'True':True, 'False':False}[def_str]
+                    opt_type = 'bool'
+                except KeyError:
+                    try:
+                        def_obj = int(def_str)
+                        opt_type = 'int'
+                    except ValueError:
+                        def_obj = def_str
+                        opt_type = None
+                try:
+                    value = self.userCfg.Get(
+                            ext_name, opt_name, type=opt_type, raw=True,
+                            default=def_obj)
+                except ValueError:  # Need this until .Get fixed
+                    value = def_obj  # bad values overwritten by entry
+                var = StringVar(self)
+                var.set(str(value))
+
+                self.extensions[ext_name].append({'name': opt_name,
+                                                  'type': opt_type,
+                                                  'default': def_str,
+                                                  'value': value,
+                                                  'var': var,
+                                                 })
+
+    def create_widgets(self):
+        """Create the dialog's widgets."""
+        self.rowconfigure(0, weight=1)
+        self.rowconfigure(1, weight=0)
+        self.columnconfigure(0, weight=1)
+
+        # create the tabbed pages
+        self.tabbed_page_set = TabbedPageSet(
+                self, page_names=self.extensions.keys(),
+                n_rows=None, max_tabs_per_row=5,
+                page_class=TabbedPageSet.PageRemove)
+        self.tabbed_page_set.grid(row=0, column=0, sticky=NSEW)
+        for ext_name in self.extensions:
+            self.create_tab_page(ext_name)
+
+        self.create_action_buttons().grid(row=1)
+
+    create_action_buttons = ConfigDialog.create_action_buttons
+
+    def create_tab_page(self, ext_name):
+        """Create the page for an extension."""
+
+        page = LabelFrame(self.tabbed_page_set.pages[ext_name].frame,
+                          border=2, padx=2, relief=GROOVE,
+                          text=' %s ' % ext_name)
+        page.pack(fill=BOTH, expand=True, padx=12, pady=2)
+
+        # create the scrollable frame which will contain the entries
+        scrolled_frame = VerticalScrolledFrame(page, pady=2, height=250)
+        scrolled_frame.pack(side=BOTTOM, fill=BOTH, expand=TRUE)
+        entry_area = scrolled_frame.interior
+        entry_area.columnconfigure(0, weight=0)
+        entry_area.columnconfigure(1, weight=1)
+
+        # create an entry for each configuration option
+        for row, opt in enumerate(self.extensions[ext_name]):
+            # create a row with a label and entry/checkbutton
+            label = Label(entry_area, text=opt['name'])
+            label.grid(row=row, column=0, sticky=NW)
+            var = opt['var']
+            if opt['type'] == 'bool':
+                Checkbutton(entry_area, textvariable=var, variable=var,
+                            onvalue='True', offvalue='False',
+                            indicatoron=FALSE, selectcolor='', width=8
+                    ).grid(row=row, column=1, sticky=W, padx=7)
+            elif opt['type'] == 'int':
+                Entry(entry_area, textvariable=var, validate='key',
+                    validatecommand=(self.is_int, '%P')
+                    ).grid(row=row, column=1, sticky=NSEW, padx=7)
+
+            else:
+                Entry(entry_area, textvariable=var
+                    ).grid(row=row, column=1, sticky=NSEW, padx=7)
+        return
+
+
+    Ok = ConfigDialog.Ok
+
+    def Apply(self):
+        self.save_all_changed_configs()
+        pass
+
+    Cancel = ConfigDialog.Cancel
+
+    def Help(self):
+        pass
+
+    def set_user_value(self, section, opt):
+        name = opt['name']
+        default = opt['default']
+        value = opt['var'].get().strip() or default
+        opt['var'].set(value)
+        # if self.defaultCfg.has_section(section):
+        # Currently, always true; if not, indent to return
+        if (value == default):
+            return self.userCfg.RemoveOption(section, name)
+        # set the option
+        return self.userCfg.SetOption(section, name, value)
+
+    def save_all_changed_configs(self):
+        """Save configuration changes to the user config file."""
+        has_changes = False
+        for ext_name in self.extensions:
+            options = self.extensions[ext_name]
+            for opt in options:
+                if self.set_user_value(ext_name, opt):
+                    has_changes = True
+        if has_changes:
+            self.userCfg.Save()
+
+
 if __name__ == '__main__':
-    #test the dialog
-    root=Tk()
-    Button(root,text='Dialog',
-            command=lambda:ConfigDialog(root,'Settings')).pack()
-    root.instance_dict={}
-    root.mainloop()
+    import unittest
+    unittest.main('idlelib.idle_test.test_configdialog',
+                  verbosity=2, exit=False)
+    from idlelib.idle_test.htest import run
+    run(ConfigDialog, ConfigExtensionsDialog)
diff --git a/Lib/idlelib/configHandler.py b/Lib/idlelib/configHandler.py
index a974d54..b94b8f1 100644
--- a/Lib/idlelib/configHandler.py
+++ b/Lib/idlelib/configHandler.py
@@ -15,13 +15,13 @@
 the retrieval of config information. When a default is returned instead of
 a requested config value, a message is printed to stderr to aid in
 configuration problem notification and resolution.
-
 """
+# TODOs added Oct 2014, tjr
+
 import os
 import sys
 
-from idlelib import macosxSupport
-from configparser import ConfigParser, NoOptionError, NoSectionError
+from configparser import ConfigParser
 
 class InvalidConfigType(Exception): pass
 class InvalidConfigSet(Exception): pass
@@ -36,7 +36,7 @@
         """
         cfgFile - string, fully specified configuration file name
         """
-        self.file=cfgFile
+        self.file = cfgFile
         ConfigParser.__init__(self, defaults=cfgDefaults, strict=False)
 
     def Get(self, section, option, type=None, default=None, raw=False):
@@ -44,28 +44,27 @@
         Get an option value for given section/option or return default.
         If type is specified, return as type.
         """
+        # TODO Use default as fallback, at least if not None
+        # Should also print Warning(file, section, option).
+        # Currently may raise ValueError
         if not self.has_option(section, option):
             return default
-        if type=='bool':
+        if type == 'bool':
             return self.getboolean(section, option)
-        elif type=='int':
+        elif type == 'int':
             return self.getint(section, option)
         else:
             return self.get(section, option, raw=raw)
 
-    def GetOptionList(self,section):
-        """
-        Get an option list for given section
-        """
+    def GetOptionList(self, section):
+        "Return a list of options for given section, else []."
         if self.has_section(section):
             return self.options(section)
         else:  #return a default value
             return []
 
     def Load(self):
-        """
-        Load the configuration file from disk
-        """
+        "Load the configuration file from disk."
         self.read(self.file)
 
 class IdleUserConfParser(IdleConfParser):
@@ -73,61 +72,50 @@
     IdleConfigParser specialised for user configuration handling.
     """
 
-    def AddSection(self,section):
-        """
-        if section doesn't exist, add it
-        """
+    def AddSection(self, section):
+        "If section doesn't exist, add it."
         if not self.has_section(section):
             self.add_section(section)
 
     def RemoveEmptySections(self):
-        """
-        remove any sections that have no options
-        """
+        "Remove any sections that have no options."
         for section in self.sections():
             if not self.GetOptionList(section):
                 self.remove_section(section)
 
     def IsEmpty(self):
-        """
-        Remove empty sections and then return 1 if parser has no sections
-        left, else return 0.
-        """
+        "Return True if no sections after removing empty sections."
         self.RemoveEmptySections()
-        if self.sections():
-            return 0
-        else:
-            return 1
+        return not self.sections()
 
-    def RemoveOption(self,section,option):
-        """
-        If section/option exists, remove it.
-        Returns 1 if option was removed, 0 otherwise.
+    def RemoveOption(self, section, option):
+        """Return True if option is removed from section, else False.
+
+        False if either section does not exist or did not have option.
         """
         if self.has_section(section):
-            return self.remove_option(section,option)
+            return self.remove_option(section, option)
+        return False
 
-    def SetOption(self,section,option,value):
+    def SetOption(self, section, option, value):
+        """Return True if option is added or changed to value, else False.
+
+        Add section if required.  False means option already had value.
         """
-        Sets option to value, adding section if required.
-        Returns 1 if option was added or changed, otherwise 0.
-        """
-        if self.has_option(section,option):
-            if self.get(section,option)==value:
-                return 0
+        if self.has_option(section, option):
+            if self.get(section, option) == value:
+                return False
             else:
-                self.set(section,option,value)
-                return 1
+                self.set(section, option, value)
+                return True
         else:
             if not self.has_section(section):
                 self.add_section(section)
-            self.set(section,option,value)
-            return 1
+            self.set(section, option, value)
+            return True
 
     def RemoveFile(self):
-        """
-        Removes the user config file from disk if it exists.
-        """
+        "Remove user config file self.file from disk if it exists."
         if os.path.exists(self.file):
             os.remove(self.file)
 
@@ -151,62 +139,59 @@
             self.RemoveFile()
 
 class IdleConf:
-    """
-    holds config parsers for all idle config files:
-    default config files
-        (idle install dir)/config-main.def
-        (idle install dir)/config-extensions.def
-        (idle install dir)/config-highlight.def
-        (idle install dir)/config-keys.def
-    user config  files
-        (user home dir)/.idlerc/config-main.cfg
-        (user home dir)/.idlerc/config-extensions.cfg
-        (user home dir)/.idlerc/config-highlight.cfg
-        (user home dir)/.idlerc/config-keys.cfg
+    """Hold config parsers for all idle config files in singleton instance.
+
+    Default config files, self.defaultCfg --
+        for config_type in self.config_types:
+            (idle install dir)/config-{config-type}.def
+
+    User config files, self.userCfg --
+        for config_type in self.config_types:
+        (user home dir)/.idlerc/config-{config-type}.cfg
     """
     def __init__(self):
-        self.defaultCfg={}
-        self.userCfg={}
-        self.cfg={}
+        self.config_types = ('main', 'extensions', 'highlight', 'keys')
+        self.defaultCfg = {}
+        self.userCfg = {}
+        self.cfg = {}  # TODO use to select userCfg vs defaultCfg
         self.CreateConfigHandlers()
         self.LoadCfgFiles()
-        #self.LoadCfg()
+
 
     def CreateConfigHandlers(self):
-        """
-        set up a dictionary of config parsers for default and user
-        configurations respectively
-        """
+        "Populate default and user config parser dictionaries."
         #build idle install path
         if __name__ != '__main__': # we were imported
             idleDir=os.path.dirname(__file__)
         else: # we were exec'ed (for testing only)
             idleDir=os.path.abspath(sys.path[0])
         userDir=self.GetUserCfgDir()
-        configTypes=('main','extensions','highlight','keys')
-        defCfgFiles={}
-        usrCfgFiles={}
-        for cfgType in configTypes: #build config file names
-            defCfgFiles[cfgType]=os.path.join(idleDir,'config-'+cfgType+'.def')
-            usrCfgFiles[cfgType]=os.path.join(userDir,'config-'+cfgType+'.cfg')
-        for cfgType in configTypes: #create config parsers
-            self.defaultCfg[cfgType]=IdleConfParser(defCfgFiles[cfgType])
-            self.userCfg[cfgType]=IdleUserConfParser(usrCfgFiles[cfgType])
+
+        defCfgFiles = {}
+        usrCfgFiles = {}
+        # TODO eliminate these temporaries by combining loops
+        for cfgType in self.config_types: #build config file names
+            defCfgFiles[cfgType] = os.path.join(
+                    idleDir, 'config-' + cfgType + '.def')
+            usrCfgFiles[cfgType] = os.path.join(
+                    userDir, 'config-' + cfgType + '.cfg')
+        for cfgType in self.config_types: #create config parsers
+            self.defaultCfg[cfgType] = IdleConfParser(defCfgFiles[cfgType])
+            self.userCfg[cfgType] = IdleUserConfParser(usrCfgFiles[cfgType])
 
     def GetUserCfgDir(self):
-        """
-        Creates (if required) and returns a filesystem directory for storing
-        user config files.
+        """Return a filesystem directory for storing user config files.
 
+        Creates it if required.
         """
         cfgDir = '.idlerc'
         userDir = os.path.expanduser('~')
         if userDir != '~': # expanduser() found user home dir
             if not os.path.exists(userDir):
-                warn = ('\n Warning: os.path.expanduser("~") points to\n '+
-                        userDir+',\n but the path does not exist.\n')
+                warn = ('\n Warning: os.path.expanduser("~") points to\n ' +
+                        userDir + ',\n but the path does not exist.')
                 try:
-                    sys.stderr.write(warn)
+                    print(warn, file=sys.stderr)
                 except OSError:
                     pass
                 userDir = '~'
@@ -218,45 +203,44 @@
             try:
                 os.mkdir(userDir)
             except OSError:
-                warn = ('\n Warning: unable to create user config directory\n'+
-                        userDir+'\n Check path and permissions.\n Exiting!\n\n')
-                sys.stderr.write(warn)
+                warn = ('\n Warning: unable to create user config directory\n' +
+                        userDir + '\n Check path and permissions.\n Exiting!\n')
+                print(warn, file=sys.stderr)
                 raise SystemExit
+        # TODO continue without userDIr instead of exit
         return userDir
 
     def GetOption(self, configType, section, option, default=None, type=None,
                   warn_on_default=True, raw=False):
-        """
-        Get an option value for given config type and given general
-        configuration section/option or return a default. If type is specified,
-        return as type. Firstly the user configuration is checked, with a
-        fallback to the default configuration, and a final 'catch all'
-        fallback to a useable passed-in default if the option isn't present in
-        either the user or the default configuration.
-        configType must be one of ('main','extensions','highlight','keys')
-        If a default is returned, and warn_on_default is True, a warning is
-        printed to stderr.
+        """Return a value for configType section option, or default.
 
+        If type is not None, return a value of that type.  Also pass raw
+        to the config parser.  First try to return a valid value
+        (including type) from a user configuration. If that fails, try
+        the default configuration. If that fails, return default, with a
+        default of None.
+
+        Warn if either user or default configurations have an invalid value.
+        Warn if default is returned and warn_on_default is True.
         """
         try:
-            if self.userCfg[configType].has_option(section,option):
+            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' %
+                       ' from section %r: %r' %
                        (type, option, section,
-                        self.userCfg[configType].Get(section, option,
-                                                     raw=raw)))
+                       self.userCfg[configType].Get(section, option, raw=raw)))
             try:
-                sys.stderr.write(warning)
+                print(warning, file=sys.stderr)
             except OSError:
                 pass
         try:
             if self.defaultCfg[configType].has_option(section,option):
-                return self.defaultCfg[configType].Get(section, option,
-                                                       type=type, raw=raw)
+                return self.defaultCfg[configType].Get(
+                        section, option, type=type, raw=raw)
         except ValueError:
             pass
         #returning default, print warning
@@ -264,29 +248,28 @@
             warning = ('\n Warning: configHandler.py - IdleConf.GetOption -\n'
                        ' problem retrieving configuration option %r\n'
                        ' from section %r.\n'
-                       ' returning default value: %r\n' %
+                       ' returning default value: %r' %
                        (option, section, default))
             try:
-                sys.stderr.write(warning)
+                print(warning, file=sys.stderr)
             except OSError:
                 pass
         return default
+
     def SetOption(self, configType, section, option, value):
-        """In user's config file, set section's option to value.
-        """
+        """Set section option to value in user config file."""
         self.userCfg[configType].SetOption(section, option, value)
 
     def GetSectionList(self, configSet, configType):
-        """
-        Get a list of sections from either the user or default config for
-        the given config type.
+        """Return sections for configSet configType configuration.
+
         configSet must be either 'user' or 'default'
-        configType must be one of ('main','extensions','highlight','keys')
+        configType must be in self.config_types.
         """
-        if not (configType in ('main','extensions','highlight','keys')):
+        if not (configType in self.config_types):
             raise InvalidConfigType('Invalid configType specified')
         if configSet == 'user':
-            cfgParser=self.userCfg[configType]
+            cfgParser = self.userCfg[configType]
         elif configSet == 'default':
             cfgParser=self.defaultCfg[configType]
         else:
@@ -294,25 +277,27 @@
         return cfgParser.sections()
 
     def GetHighlight(self, theme, element, fgBg=None):
-        """
-        return individual highlighting theme elements.
-        fgBg - string ('fg'or'bg') or None, if None return a dictionary
-        containing fg and bg colours (appropriate for passing to Tkinter in,
-        e.g., a tag_config call), otherwise fg or bg colour only as specified.
+        """Return individual theme element highlight color(s).
+
+        fgBg - string ('fg' or 'bg') or None.
+        If None, return a dictionary containing fg and bg colors with
+        keys 'foreground' and 'background'.  Otherwise, only return
+        fg or bg color, as specified.  Colors are intended to be
+        appropriate for passing to Tkinter in, e.g., a tag_config call).
         """
         if self.defaultCfg['highlight'].has_section(theme):
-            themeDict=self.GetThemeDict('default',theme)
+            themeDict = self.GetThemeDict('default', theme)
         else:
-            themeDict=self.GetThemeDict('user',theme)
-        fore=themeDict[element+'-foreground']
-        if element=='cursor': #there is no config value for cursor bg
-            back=themeDict['normal-background']
+            themeDict = self.GetThemeDict('user', theme)
+        fore = themeDict[element + '-foreground']
+        if element == 'cursor':  # There is no config value for cursor bg
+            back = themeDict['normal-background']
         else:
-            back=themeDict[element+'-background']
-        highlight={"foreground": fore,"background": back}
-        if not fgBg: #return dict of both colours
+            back = themeDict[element + '-background']
+        highlight = {"foreground": fore, "background": back}
+        if not fgBg:  # Return dict of both colors
             return highlight
-        else: #return specified colour only
+        else:  # Return specified color only
             if fgBg == 'fg':
                 return highlight["foreground"]
             if fgBg == 'bg':
@@ -320,26 +305,26 @@
             else:
                 raise InvalidFgBg('Invalid fgBg specified')
 
-    def GetThemeDict(self,type,themeName):
-        """
+    def GetThemeDict(self, type, themeName):
+        """Return {option:value} dict for elements in themeName.
+
         type - string, 'default' or 'user' theme type
         themeName - string, theme name
-        Returns a dictionary which holds {option:value} for each element
-        in the specified theme. Values are loaded over a set of ultimate last
-        fallback defaults to guarantee that all theme elements are present in
-        a newly created theme.
+        Values are loaded over ultimate fallback defaults to guarantee
+        that all theme elements are present in a newly created theme.
         """
         if type == 'user':
-            cfgParser=self.userCfg['highlight']
+            cfgParser = self.userCfg['highlight']
         elif type == 'default':
-            cfgParser=self.defaultCfg['highlight']
+            cfgParser = self.defaultCfg['highlight']
         else:
             raise InvalidTheme('Invalid theme type specified')
-        #foreground and background values are provded for each theme element
-        #(apart from cursor) even though all these values are not yet used
-        #by idle, to allow for their use in the future. Default values are
-        #generally black and white.
-        theme={ 'normal-foreground':'#000000',
+        # Provide foreground and background colors for each theme
+        # element (other than cursor) even though some values are not
+        # yet used by idle, to allow for their use in the future.
+        # Default values are generally black and white.
+        # TODO copy theme from a class attribute.
+        theme ={'normal-foreground':'#000000',
                 'normal-background':'#ffffff',
                 'keyword-foreground':'#000000',
                 'keyword-background':'#ffffff',
@@ -369,52 +354,50 @@
                 'console-foreground':'#000000',
                 'console-background':'#ffffff' }
         for element in theme:
-            if not cfgParser.has_option(themeName,element):
-                #we are going to return a default, print warning
-                warning=('\n Warning: configHandler.py - IdleConf.GetThemeDict'
+            if not cfgParser.has_option(themeName, element):
+                # Print warning that will return a default color
+                warning = ('\n Warning: configHandler.IdleConf.GetThemeDict'
                            ' -\n problem retrieving theme element %r'
                            '\n from theme %r.\n'
-                           ' returning default value: %r\n' %
+                           ' returning default color: %r' %
                            (element, themeName, theme[element]))
                 try:
-                    sys.stderr.write(warning)
+                    print(warning, file=sys.stderr)
                 except OSError:
                     pass
-            colour=cfgParser.Get(themeName,element,default=theme[element])
-            theme[element]=colour
+            theme[element] = cfgParser.Get(
+                    themeName, element, default=theme[element])
         return theme
 
     def CurrentTheme(self):
-        """
-        Returns the name of the currently active theme
-        """
-        return self.GetOption('main','Theme','name',default='')
+        "Return the name of the currently active theme."
+        return self.GetOption('main', 'Theme', 'name', default='')
 
     def CurrentKeys(self):
-        """
-        Returns the name of the currently active key set
-        """
-        return self.GetOption('main','Keys','name',default='')
+        "Return the name of the currently active key set."
+        return self.GetOption('main', 'Keys', 'name', default='')
 
     def GetExtensions(self, active_only=True, editor_only=False, shell_only=False):
+        """Return extensions in default and user config-extensions files.
+
+        If active_only True, only return active (enabled) extensions
+        and optionally only editor or shell extensions.
+        If active_only False, return all extensions.
         """
-        Gets a list of all idle extensions declared in the config files.
-        active_only - boolean, if true only return active (enabled) extensions
-        """
-        extns=self.RemoveKeyBindNames(
-                self.GetSectionList('default','extensions'))
-        userExtns=self.RemoveKeyBindNames(
-                self.GetSectionList('user','extensions'))
+        extns = self.RemoveKeyBindNames(
+                self.GetSectionList('default', 'extensions'))
+        userExtns = self.RemoveKeyBindNames(
+                self.GetSectionList('user', 'extensions'))
         for extn in userExtns:
             if extn not in extns: #user has added own extension
                 extns.append(extn)
         if active_only:
-            activeExtns=[]
+            activeExtns = []
             for extn in extns:
                 if self.GetOption('extensions', extn, 'enable', default=True,
                                   type='bool'):
                     #the extension is enabled
-                    if editor_only or shell_only:
+                    if editor_only or shell_only:  # TODO if both, contradictory
                         if editor_only:
                             option = "enable_editor"
                         else:
@@ -429,106 +412,110 @@
         else:
             return extns
 
-    def RemoveKeyBindNames(self,extnNameList):
-        #get rid of keybinding section names
-        names=extnNameList
-        kbNameIndicies=[]
+    def RemoveKeyBindNames(self, extnNameList):
+        "Return extnNameList with keybinding section names removed."
+        # TODO Easier to return filtered copy with list comp
+        names = extnNameList
+        kbNameIndicies = []
         for name in names:
             if name.endswith(('_bindings', '_cfgBindings')):
                 kbNameIndicies.append(names.index(name))
-        kbNameIndicies.sort()
-        kbNameIndicies.reverse()
+        kbNameIndicies.sort(reverse=True)
         for index in kbNameIndicies: #delete each keybinding section name
             del(names[index])
         return names
 
-    def GetExtnNameForEvent(self,virtualEvent):
+    def GetExtnNameForEvent(self, virtualEvent):
+        """Return the name of the extension binding virtualEvent, or None.
+
+        virtualEvent - string, name of the virtual event to test for,
+                       without the enclosing '<< >>'
         """
-        Returns the name of the extension that virtualEvent is bound in, or
-        None if not bound in any extension.
-        virtualEvent - string, name of the virtual event to test for, without
-                       the enclosing '<< >>'
-        """
-        extName=None
-        vEvent='<<'+virtualEvent+'>>'
+        extName = None
+        vEvent = '<<' + virtualEvent + '>>'
         for extn in self.GetExtensions(active_only=0):
             for event in self.GetExtensionKeys(extn):
                 if event == vEvent:
-                    extName=extn
+                    extName = extn  # TODO return here?
         return extName
 
-    def GetExtensionKeys(self,extensionName):
+    def GetExtensionKeys(self, extensionName):
+        """Return dict: {configurable extensionName event : active keybinding}.
+
+        Events come from default config extension_cfgBindings section.
+        Keybindings come from GetCurrentKeySet() active key dict,
+        where previously used bindings are disabled.
         """
-        returns a dictionary of the configurable keybindings for a particular
-        extension,as they exist in the dictionary returned by GetCurrentKeySet;
-        that is, where previously used bindings are disabled.
-        """
-        keysName=extensionName+'_cfgBindings'
-        activeKeys=self.GetCurrentKeySet()
-        extKeys={}
+        keysName = extensionName + '_cfgBindings'
+        activeKeys = self.GetCurrentKeySet()
+        extKeys = {}
         if self.defaultCfg['extensions'].has_section(keysName):
-            eventNames=self.defaultCfg['extensions'].GetOptionList(keysName)
+            eventNames = self.defaultCfg['extensions'].GetOptionList(keysName)
             for eventName in eventNames:
-                event='<<'+eventName+'>>'
-                binding=activeKeys[event]
-                extKeys[event]=binding
+                event = '<<' + eventName + '>>'
+                binding = activeKeys[event]
+                extKeys[event] = binding
         return extKeys
 
     def __GetRawExtensionKeys(self,extensionName):
+        """Return dict {configurable extensionName event : keybinding list}.
+
+        Events come from default config extension_cfgBindings section.
+        Keybindings list come from the splitting of GetOption, which
+        tries user config before default config.
         """
-        returns a dictionary of the configurable keybindings for a particular
-        extension, as defined in the configuration files, or an empty dictionary
-        if no bindings are found
-        """
-        keysName=extensionName+'_cfgBindings'
-        extKeys={}
+        keysName = extensionName+'_cfgBindings'
+        extKeys = {}
         if self.defaultCfg['extensions'].has_section(keysName):
-            eventNames=self.defaultCfg['extensions'].GetOptionList(keysName)
+            eventNames = self.defaultCfg['extensions'].GetOptionList(keysName)
             for eventName in eventNames:
-                binding=self.GetOption('extensions',keysName,
-                        eventName,default='').split()
-                event='<<'+eventName+'>>'
-                extKeys[event]=binding
+                binding = self.GetOption(
+                        'extensions', keysName, eventName, default='').split()
+                event = '<<' + eventName + '>>'
+                extKeys[event] = binding
         return extKeys
 
-    def GetExtensionBindings(self,extensionName):
+    def GetExtensionBindings(self, extensionName):
+        """Return dict {extensionName event : active or defined keybinding}.
+
+        Augment self.GetExtensionKeys(extensionName) with mapping of non-
+        configurable events (from default config) to GetOption splits,
+        as in self.__GetRawExtensionKeys.
         """
-        Returns a dictionary of all the event bindings for a particular
-        extension. The configurable keybindings are returned as they exist in
-        the dictionary returned by GetCurrentKeySet; that is, where re-used
-        keybindings are disabled.
-        """
-        bindsName=extensionName+'_bindings'
-        extBinds=self.GetExtensionKeys(extensionName)
+        bindsName = extensionName + '_bindings'
+        extBinds = self.GetExtensionKeys(extensionName)
         #add the non-configurable bindings
         if self.defaultCfg['extensions'].has_section(bindsName):
-            eventNames=self.defaultCfg['extensions'].GetOptionList(bindsName)
+            eventNames = self.defaultCfg['extensions'].GetOptionList(bindsName)
             for eventName in eventNames:
-                binding=self.GetOption('extensions',bindsName,
-                        eventName,default='').split()
-                event='<<'+eventName+'>>'
-                extBinds[event]=binding
+                binding = self.GetOption(
+                        'extensions', bindsName, eventName, default='').split()
+                event = '<<' + eventName + '>>'
+                extBinds[event] = binding
 
         return extBinds
 
     def GetKeyBinding(self, keySetName, eventStr):
+        """Return the keybinding list for keySetName eventStr.
+
+        keySetName - name of key binding set (config-keys section).
+        eventStr - virtual event, including brackets, as in '<<event>>'.
         """
-        returns the keybinding for a specific event.
-        keySetName - string, name of key binding set
-        eventStr - string, the virtual event we want the binding for,
-                   represented as a string, eg. '<<event>>'
-        """
-        eventName=eventStr[2:-2] #trim off the angle brackets
-        binding=self.GetOption('keys',keySetName,eventName,default='').split()
+        eventName = eventStr[2:-2] #trim off the angle brackets
+        binding = self.GetOption('keys', keySetName, eventName, default='').split()
         return binding
 
     def GetCurrentKeySet(self):
+        "Return CurrentKeys with 'darwin' modifications."
         result = self.GetKeySet(self.CurrentKeys())
 
-        if macosxSupport.runningAsOSXApp():
-            # We're using AquaTk, replace all keybingings that use the
-            # Alt key by ones that use the Option key because the former
-            # don't work reliably.
+        if sys.platform == "darwin":
+            # OS X Tk variants do not support the "Alt" keyboard modifier.
+            # So replace all keybingings that use "Alt" with ones that
+            # use the "Option" keyboard modifier.
+            # TODO (Ned?): the "Option" modifier does not work properly for
+            #        Cocoa Tk and XQuartz Tk so we should not use it
+            #        in default OS X KeySets.
             for k, v in result.items():
                 v2 = [ x.replace('<Alt-', '<Option-') for x in v ]
                 if v != v2:
@@ -536,40 +523,43 @@
 
         return result
 
-    def GetKeySet(self,keySetName):
+    def GetKeySet(self, keySetName):
+        """Return event-key dict for keySetName core plus active extensions.
+
+        If a binding defined in an extension is already in use, the
+        extension binding is disabled by being set to ''
         """
-        Returns a dictionary of: all requested core keybindings, plus the
-        keybindings for all currently active extensions. If a binding defined
-        in an extension is already in use, that binding is disabled.
-        """
-        keySet=self.GetCoreKeys(keySetName)
-        activeExtns=self.GetExtensions(active_only=1)
+        keySet = self.GetCoreKeys(keySetName)
+        activeExtns = self.GetExtensions(active_only=1)
         for extn in activeExtns:
-            extKeys=self.__GetRawExtensionKeys(extn)
+            extKeys = self.__GetRawExtensionKeys(extn)
             if extKeys: #the extension defines keybindings
                 for event in extKeys:
                     if extKeys[event] in keySet.values():
                         #the binding is already in use
-                        extKeys[event]='' #disable this binding
-                    keySet[event]=extKeys[event] #add binding
+                        extKeys[event] = '' #disable this binding
+                    keySet[event] = extKeys[event] #add binding
         return keySet
 
-    def IsCoreBinding(self,virtualEvent):
-        """
-        returns true if the virtual event is bound in the core idle keybindings.
-        virtualEvent - string, name of the virtual event to test for, without
-                       the enclosing '<< >>'
+    def IsCoreBinding(self, virtualEvent):
+        """Return True if the virtual event is one of the core idle key events.
+
+        virtualEvent - string, name of the virtual event to test for,
+                       without the enclosing '<< >>'
         """
         return ('<<'+virtualEvent+'>>') in self.GetCoreKeys()
 
+# TODO make keyBindins a file or class attribute used for test above
+# and copied in function below
+
     def GetCoreKeys(self, keySetName=None):
-        """
-        returns the requested set of core keybindings, with fallbacks if
-        required.
-        Keybindings loaded from the config file(s) are loaded _over_ these
-        defaults, so if there is a problem getting any core binding there will
-        be an 'ultimate last resort fallback' to the CUA-ish bindings
-        defined here.
+        """Return dict of core virtual-key keybindings for keySetName.
+
+        The default keySetName None corresponds to the keyBindings base
+        dict. If keySetName is not None, bindings from the config
+        file(s) are loaded _over_ these defaults, so if there is a
+        problem getting any core binding there will be an 'ultimate last
+        resort fallback' to the CUA-ish bindings defined here.
         """
         keyBindings={
             '<<copy>>': ['<Control-c>', '<Control-C>'],
@@ -624,22 +614,24 @@
             }
         if keySetName:
             for event in keyBindings:
-                binding=self.GetKeyBinding(keySetName,event)
+                binding = self.GetKeyBinding(keySetName, event)
                 if binding:
-                    keyBindings[event]=binding
+                    keyBindings[event] = binding
                 else: #we are going to return a default, print warning
                     warning=('\n Warning: configHandler.py - IdleConf.GetCoreKeys'
                                ' -\n problem retrieving key binding for event %r'
                                '\n from key set %r.\n'
-                               ' returning default value: %r\n' %
+                               ' returning default value: %r' %
                                (event, keySetName, keyBindings[event]))
                     try:
-                        sys.stderr.write(warning)
+                        print(warning, file=sys.stderr)
                     except OSError:
                         pass
         return keyBindings
-    def GetExtraHelpSourceList(self,configSet):
-        """Fetch list of extra help sources from a given configSet.
+
+    def GetExtraHelpSourceList(self, configSet):
+        """Return list of extra help sources from a given configSet.
+
         Valid configSets are 'user' or 'default'.  Return a list of tuples of
         the form (menu_item , path_to_help_file , option), or return the empty
         list.  'option' is the sequence number of the help resource.  'option'
@@ -647,19 +639,19 @@
         therefore the returned list must be sorted by 'option'.
 
         """
-        helpSources=[]
-        if configSet=='user':
-            cfgParser=self.userCfg['main']
-        elif configSet=='default':
-            cfgParser=self.defaultCfg['main']
+        helpSources = []
+        if configSet == 'user':
+            cfgParser = self.userCfg['main']
+        elif configSet == 'default':
+            cfgParser = self.defaultCfg['main']
         else:
             raise InvalidConfigSet('Invalid configSet specified')
         options=cfgParser.GetOptionList('HelpFiles')
         for option in options:
-            value=cfgParser.Get('HelpFiles',option,default=';')
-            if value.find(';')==-1: #malformed config entry with no ';'
-                menuItem='' #make these empty
-                helpPath='' #so value won't be added to list
+            value=cfgParser.Get('HelpFiles', option, default=';')
+            if value.find(';') == -1: #malformed config entry with no ';'
+                menuItem = '' #make these empty
+                helpPath = '' #so value won't be added to list
             else: #config entry contains ';' as expected
                 value=value.split(';')
                 menuItem=value[0].strip()
@@ -670,47 +662,44 @@
         return helpSources
 
     def GetAllExtraHelpSourcesList(self):
+        """Return a list of the details of all additional help sources.
+
+        Tuples in the list are those of GetExtraHelpSourceList.
         """
-        Returns a list of tuples containing the details of all additional help
-        sources configured, or an empty list if there are none. Tuples are of
-        the format returned by GetExtraHelpSourceList.
-        """
-        allHelpSources=( self.GetExtraHelpSourceList('default')+
+        allHelpSources = (self.GetExtraHelpSourceList('default') +
                 self.GetExtraHelpSourceList('user') )
         return allHelpSources
 
     def LoadCfgFiles(self):
-        """
-        load all configuration files.
-        """
+        "Load all configuration files."
         for key in self.defaultCfg:
             self.defaultCfg[key].Load()
             self.userCfg[key].Load() #same keys
 
     def SaveUserCfgFiles(self):
-        """
-        write all loaded user configuration files back to disk
-        """
+        "Write all loaded user configuration files to disk."
         for key in self.userCfg:
             self.userCfg[key].Save()
 
-idleConf=IdleConf()
 
+idleConf = IdleConf()
+
+# TODO Revise test output, write expanded unittest
 ### module test
 if __name__ == '__main__':
     def dumpCfg(cfg):
-        print('\n',cfg,'\n')
+        print('\n', cfg, '\n')
         for key in cfg:
-            sections=cfg[key].sections()
+            sections = cfg[key].sections()
             print(key)
             print(sections)
             for section in sections:
-                options=cfg[key].options(section)
+                options = cfg[key].options(section)
                 print(section)
                 print(options)
                 for option in options:
-                    print(option, '=', cfg[key].Get(section,option))
+                    print(option, '=', cfg[key].Get(section, option))
     dumpCfg(idleConf.defaultCfg)
     dumpCfg(idleConf.userCfg)
-    print(idleConf.userCfg['main'].Get('Theme','name'))
+    print(idleConf.userCfg['main'].Get('Theme', 'name'))
     #print idleConf.userCfg['highlight'].GetDefHighlight('Foo','normal')
diff --git a/Lib/idlelib/configHelpSourceEdit.py b/Lib/idlelib/configHelpSourceEdit.py
index 2ccb400..242b08d 100644
--- a/Lib/idlelib/configHelpSourceEdit.py
+++ b/Lib/idlelib/configHelpSourceEdit.py
@@ -8,13 +8,14 @@
 import tkinter.filedialog as tkFileDialog
 
 class GetHelpSourceDialog(Toplevel):
-    def __init__(self, parent, title, menuItem='', filePath=''):
+    def __init__(self, parent, title, menuItem='', filePath='', _htest=False):
         """Get menu entry and url/ local file location for Additional Help
 
         User selects a name for the Help resource and provides a web url
         or a local file as its source.  The user can enter a url or browse
         for the file.
 
+        _htest - bool, change box location when running htest
         """
         Toplevel.__init__(self, parent)
         self.configure(borderwidth=5)
@@ -31,12 +32,14 @@
         self.withdraw() #hide while setting geometry
         #needs to be done here so that the winfo_reqwidth is valid
         self.update_idletasks()
-        #centre dialog over parent:
-        self.geometry("+%d+%d" %
-                      ((parent.winfo_rootx() + ((parent.winfo_width()/2)
-                                                -(self.winfo_reqwidth()/2)),
-                        parent.winfo_rooty() + ((parent.winfo_height()/2)
-                                                -(self.winfo_reqheight()/2)))))
+        #centre dialog over parent. below parent if running htest.
+        self.geometry(
+                "+%d+%d" % (
+                    parent.winfo_rootx() +
+                    (parent.winfo_width()/2 - self.winfo_reqwidth()/2),
+                    parent.winfo_rooty() +
+                    ((parent.winfo_height()/2 - self.winfo_reqheight()/2)
+                    if not _htest else 150)))
         self.deiconify() #geometry set, unhide
         self.bind('<Return>', self.Ok)
         self.wait_window()
@@ -159,11 +162,5 @@
         self.destroy()
 
 if __name__ == '__main__':
-    #test the dialog
-    root = Tk()
-    def run():
-        keySeq = ''
-        dlg = GetHelpSourceDialog(root, 'Get Help Source')
-        print(dlg.result)
-    Button(root,text='Dialog', command=run).pack()
-    root.mainloop()
+    from idlelib.idle_test.htest import run
+    run(GetHelpSourceDialog)
diff --git a/Lib/idlelib/configSectionNameDialog.py b/Lib/idlelib/configSectionNameDialog.py
index b05e38e..5137836 100644
--- a/Lib/idlelib/configSectionNameDialog.py
+++ b/Lib/idlelib/configSectionNameDialog.py
@@ -8,10 +8,11 @@
 import tkinter.messagebox as tkMessageBox
 
 class GetCfgSectionNameDialog(Toplevel):
-    def __init__(self, parent, title, message, used_names):
+    def __init__(self, parent, title, message, used_names, _htest=False):
         """
         message - string, informational message to display
         used_names - string collection, names already in use for validity check
+        _htest - bool, change box location when running htest
         """
         Toplevel.__init__(self, parent)
         self.configure(borderwidth=5)
@@ -30,11 +31,12 @@
         self.messageInfo.config(width=self.frameMain.winfo_reqwidth())
         self.geometry(
                 "+%d+%d" % (
-                parent.winfo_rootx() +
-                (parent.winfo_width()/2 - self.winfo_reqwidth()/2),
-                parent.winfo_rooty() +
-                (parent.winfo_height()/2 - self.winfo_reqheight()/2)
-                ) )  #centre dialog over parent
+                    parent.winfo_rootx() +
+                    (parent.winfo_width()/2 - self.winfo_reqwidth()/2),
+                    parent.winfo_rooty() +
+                    ((parent.winfo_height()/2 - self.winfo_reqheight()/2)
+                    if not _htest else 100)
+                ) )  #centre dialog over parent (or below htest box)
         self.deiconify()  #geometry set, unhide
         self.wait_window()
 
@@ -92,15 +94,5 @@
     import unittest
     unittest.main('idlelib.idle_test.test_config_name', verbosity=2, exit=False)
 
-    # also human test the dialog
-    root = Tk()
-    def run():
-        dlg=GetCfgSectionNameDialog(root,'Get Name',
-                "After the text entered with [Ok] is stripped, <nothing>, "
-                "'abc', or more that 30 chars are errors. "
-                "Close with a valid entry (printed), [Cancel], or [X]",
-                {'abc'})
-        print(dlg.result)
-    Message(root, text='').pack()  # will be needed for oher dialog tests
-    Button(root, text='Click to begin dialog test', command=run).pack()
-    root.mainloop()
+    from idlelib.idle_test.htest import run
+    run(GetCfgSectionNameDialog)
diff --git a/Lib/idlelib/dynOptionMenuWidget.py b/Lib/idlelib/dynOptionMenuWidget.py
index 922de96..515b4ba 100644
--- a/Lib/idlelib/dynOptionMenuWidget.py
+++ b/Lib/idlelib/dynOptionMenuWidget.py
@@ -2,16 +2,15 @@
 OptionMenu widget modified to allow dynamic menu reconfiguration
 and setting of highlightthickness
 """
-from tkinter import OptionMenu
-from tkinter import _setit
 import copy
+from tkinter import OptionMenu, _setit, StringVar, Button
 
 class DynOptionMenu(OptionMenu):
     """
     unlike OptionMenu, our kwargs can include highlightthickness
     """
     def __init__(self, master, variable, value, *values, **kwargs):
-        #get a copy of kwargs before OptionMenu.__init__ munges them
+        # TODO copy value instead of whole dict
         kwargsCopy=copy.copy(kwargs)
         if 'highlightthickness' in list(kwargs.keys()):
             del(kwargs['highlightthickness'])
@@ -33,3 +32,26 @@
                     command=_setit(self.variable,item,self.command))
         if value:
             self.variable.set(value)
+
+def _dyn_option_menu(parent):  # htest #
+    from tkinter import Toplevel
+
+    top = Toplevel()
+    top.title("Tets dynamic option menu")
+    top.geometry("200x100+%d+%d" % (parent.winfo_rootx() + 200,
+                  parent.winfo_rooty() + 150))
+    top.focus_set()
+
+    var = StringVar(top)
+    var.set("Old option set") #Set the default value
+    dyn = DynOptionMenu(top,var, "old1","old2","old3","old4")
+    dyn.pack()
+
+    def update():
+        dyn.SetMenu(["new1","new2","new3","new4"], value="new option set")
+    button = Button(top, text="Change option set", command=update)
+    button.pack()
+
+if __name__ == '__main__':
+    from idlelib.idle_test.htest import run
+    run(_dyn_option_menu)
diff --git a/Lib/idlelib/help.txt b/Lib/idlelib/help.txt
index ff786c5..7eff370 100644
--- a/Lib/idlelib/help.txt
+++ b/Lib/idlelib/help.txt
@@ -1,142 +1,185 @@
 [See the end of this file for ** TIPS ** on using IDLE !!]
 
-Click on the dotted line at the top of a menu to "tear it off": a
-separate window containing the menu is created.
+IDLE is the Python IDE built with the tkinter GUI toolkit.
 
-File Menu:
+IDLE has the following features:
+-coded in 100% pure Python, using the tkinter GUI toolkit
+-cross-platform: works on Windows, Unix, and OS X
+-multi-window text editor with multiple undo, Python colorizing, smart indent,
+call tips, and many other features
+-Python shell window (a.k.a interactive interpreter)
+-debugger (not complete, but you can set breakpoints, view and step)
 
-	New File         -- Create a new file editing window
-	Open...          -- Open an existing file
-	Recent Files...  -- Open a list of recent files
-	Open Module...   -- Open an existing module (searches sys.path)
-	Class Browser    -- Show classes and methods in current file
-	Path Browser     -- Show sys.path directories, modules, classes
+Menus:
+
+IDLE has two window types the Shell window and the Editor window. It is
+possible to have multiple editor windows simultaneously. IDLE's
+menus dynamically change based on which window is currently selected. Each menu
+documented below indicates which window type it is associated with. Click on
+the dotted line at the top of a menu to "tear it off": a separate window
+containing the menu is created (for Unix and Windows only).
+
+File Menu (Shell and Editor):
+
+        New File         -- Create a new file editing window
+        Open...          -- Open an existing file
+        Open Module...   -- Open an existing module (searches sys.path)
+        Recent Files...  -- Open a list of recent files
+        Class Browser    -- Show classes and methods in current file
+        Path Browser     -- Show sys.path directories, modules, classes,
                             and methods
-	---
-	Save             -- Save current window to the associated file (unsaved
-		            windows have a * before and after the window title)
+        ---
+        Save             -- Save current window to the associated file (unsaved
+                            windows have a * before and after the window title)
 
-	Save As...       -- Save current window to new file, which becomes
-		            the associated file
-	Save Copy As...  -- Save current window to different file
-		            without changing the associated file
-	---
-	Print Window     -- Print the current window
-	---
-	Close            -- Close current window (asks to save if unsaved)
-	Exit             -- Close all windows, quit (asks to save if unsaved)
+        Save As...       -- Save current window to new file, which becomes
+                            the associated file
+        Save Copy As...  -- Save current window to different file
+                            without changing the associated file
+        ---
+        Print Window     -- Print the current window
+        ---
+        Close            -- Close current window (asks to save if unsaved)
+        Exit             -- Close all windows, quit (asks to save if unsaved)
 
-Edit Menu:
+Edit Menu (Shell and Editor):
 
-	Undo             -- Undo last change to current window
-                            (A maximum of 1000 changes may be undone)
-	Redo             -- Redo last undone change to current window
-	---
-	Cut              -- Copy a selection into system-wide clipboard,
+        Undo             -- Undo last change to current window
+                            (a maximum of 1000 changes may be undone)
+        Redo             -- Redo last undone change to current 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
-	Select All       -- Select the entire contents of the edit buffer
-	---
-	Find...          -- Open a search dialog box with many options
-	Find Again       -- Repeat last search
-	Find Selection   -- Search for the string in the selection
-	Find in Files... -- Open a search dialog box for searching files
-	Replace...       -- Open a search-and-replace dialog box
-	Go to Line       -- Ask for a line number and show that line
-	Show Calltip     -- Open a small window with function param hints
-	Show Completions -- Open a scroll window allowing selection keywords
-			    and attributes. (see '*TIPS*', below)
-	Show Parens	 -- Highlight the surrounding parenthesis
-	Expand Word      -- Expand the word you have typed to match another
-		            word in the same buffer; repeat to get a
+        Copy             -- Copy selection into system-wide clipboard
+        Paste            -- Insert system-wide clipboard into window
+        Select All       -- Select the entire contents of the edit buffer
+        ---
+        Find...          -- Open a search dialog box with many options
+        Find Again       -- Repeat last search
+        Find Selection   -- Search for the string in the selection
+        Find in Files... -- Open a search dialog box for searching files
+        Replace...       -- Open a search-and-replace dialog box
+        Go to Line       -- Ask for a line number and show that line
+        Expand Word      -- Expand the word you have typed to match another
+                            word in the same buffer; repeat to get a
                             different expansion
+        Show Calltip     -- After an unclosed parenthesis for a function, open
+                            a small window with function parameter hints
+        Show Parens      -- Highlight the surrounding parenthesis
+        Show Completions -- Open a scroll window allowing selection keywords
+                            and attributes. (see '*TIPS*', below)
 
-Format Menu (only in Edit window):
+Format Menu (Editor window only):
 
-	Indent Region       -- Shift selected lines right 4 spaces
-	Dedent Region       -- Shift selected lines left 4 spaces
-	Comment Out Region  -- Insert ## in front of selected lines
-	Uncomment Region    -- Remove leading # or ## from selected lines
-	Tabify Region       -- Turns *leading* stretches of spaces into tabs
-		(Note: We recommend using 4 space blocks to indent Python code.)
-	Untabify Region     -- Turn *all* tabs into the right number of spaces
-	New Indent Width... -- Open dialog to change indent width
-	Format Paragraph    -- Reformat the current blank-line-separated
-                               paragraph
+        Indent Region       -- Shift selected lines right by the indent width
+                               (default 4 spaces)
+        Dedent Region       -- Shift selected lines left by the indent width
+                               (default 4 spaces)
+        Comment Out Region  -- Insert ## in front of selected lines
+        Uncomment Region    -- Remove leading # or ## from selected lines
+        Tabify Region       -- Turns *leading* stretches of spaces into tabs.
+                (Note: We recommend using 4 space blocks to indent Python code.)
+        Untabify Region     -- Turn *all* tabs into the corrent number of spaces
+        Toggle tabs         -- Open a dialog to switch between indenting with
+                               spaces and tabs.
+        New Indent Width... -- Open a dialog to change indent width.  The
+                               accepted default by the Python community is 4
+                               spaces.
+        Format Paragraph    -- Reformat the current blank-line-separated
+                               paragraph. All lines in the paragraph will be
+                               formatted to less than 80 columns.
+        ---
+        Strip trailing whitespace -- Removed any space characters after the end
+                                     of the last non-space character
 
-Run Menu (only in Edit window):
+Run Menu (Editor window only):
 
-	Python Shell -- Open or wake up the Python shell window
-	---
-	Check Module -- Run a syntax check on the module
-	Run Module   -- Execute the current file in the __main__ namespace
+        Python Shell -- Open or wake up the Python shell window
+        ---
+        Check Module -- Check the syntax of the module currently open in the
+                        Editor window.  If the module has not been saved IDLE
+                        will prompt the user to save the code.
+        Run Module   -- Restart the shell to clean the environment, then
+                        execute the currently open module. If the module has
+                        not been saved IDLE will prompt the user to save the
+                        code.
 
-Shell Menu (only in Shell window):
+Shell Menu (Shell window only):
 
-	View Last Restart -- Scroll the shell window to the last restart
-	Restart Shell     -- Restart the interpreter with a fresh environment
+        View Last Restart -- Scroll the shell window to the last Shell restart
+        Restart Shell     -- Restart the shell to clean the environment
 
-Debug Menu (only in Shell window):
+Debug Menu (Shell window only):
 
-	Go to File/Line   -- look around the insert point for a filename
-		             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
+        Go to File/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.  Available in the context
+                             menu of the Shell window.
+        Debugger (toggle) -- This feature is not complete and considered
+                             experimental. Run commands in the shell under the
+                             debugger.
+        Stack Viewer      -- Show the stack traceback of the last exception
+        Auto-open Stack Viewer (toggle) -- Toggle automatically opening the
+                                           stack viewer on unhandled
+                                           exception
 
-Options Menu:
+Options Menu (Shell and Editor):
 
-	Configure IDLE -- Open a configuration dialog.  Fonts, indentation,
+        Configure IDLE -- Open a configuration dialog.  Fonts, indentation,
                           keybindings, and color themes may be altered.
-                          Startup Preferences may be set, and Additional Help
-                          Sources can be specified.
-			  
-			  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
-			  shows the block context of the section of code
-			  which is scrolling off the top or the window.
-			  (Not present in Shell window.)
+                          Startup Preferences may be set, and additional Help
+                          sources can be specified.
 
-Windows Menu:
+        ---
+        Code Context (toggle) -- Open a pane at the top of the edit window
+                                 which shows the block context of the section
+                                 of code which is scrolling off the top or the
+                                 window. This is not present in the Shell
+                                 window only the Editor window.
 
-	Zoom Height -- toggles the window between configured size
-	and maximum height.
-	---
-	The rest of this menu lists the names of all open windows;
-	select one to bring it to the foreground (deiconifying it if
-	necessary).
+Window Menu (Shell and Editor):
+
+        Zoom Height -- Toggles the window between normal size (40x80 initial
+        setting) and maximum height.  The initial size is in the Configure
+        IDLE dialog under the general tab.
+        ---
+        The rest of this menu lists the names of all open windows;
+        select one to bring it to the foreground (deiconifying it if
+        necessary).
 
 Help Menu:
 
-	About IDLE  -- Version, copyright, license, credits
-	IDLE Readme -- Background discussion and change details
-	---
-	IDLE Help   -- Display this file
-	Python Docs -- Access local Python documentation, if
-		       installed.  Otherwise, access www.python.org.
-	---
-	(Additional Help Sources may be added here)
+        About IDLE  -- Version, copyright, license, credits
+        ---
+        IDLE Help   -- Display this file which is a help file for IDLE
+                       detailing the menu options, basic editing and navigation,
+                       and other tips.
+        Python Docs -- Access local Python documentation, if
+                       installed.  Or will start a web browser and open
+                       docs.python.org showing the latest Python documentation.
+        ---
+        Additional help sources may be added here with the Configure IDLE
+        dialog under the General tab.
 
-Edit context menu (Right-click / Control-click on OS X in Edit window):
+Editor context menu (Right-click / Control-click on OS X in Edit window):
 
-	Cut              -- Copy a selection into system-wide clipboard,
+        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
+        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
 
 Shell context menu (Right-click / Control-click on OS X in Shell window):
 
-	Cut              -- Copy a selection into system-wide clipboard,
+        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
+        Copy             -- Copy selection into system-wide clipboard
+        Paste            -- Insert system-wide clipboard into window
+        ---
+        Go to file/line  -- Same as in Debug menu
 
 
 ** TIPS **
@@ -144,159 +187,182 @@
 
 Additional Help Sources:
 
-	Windows users can Google on zopeshelf.chm to access Zope help files in
-	the Windows help format.  The Additional Help Sources feature of the
-	configuration GUI supports .chm, along with any other filetypes
-	supported by your browser.  Supply a Menu Item title, and enter the
-	location in the Help File Path slot of the New Help Source dialog.  Use
-	http:// and/or www. to identify external URLs, or download the file and
-	browse for its path on your machine using the Browse button.
+        Windows users can Google on zopeshelf.chm to access Zope help files in
+        the Windows help format.  The Additional Help Sources feature of the
+        configuration GUI supports .chm, along with any other filetypes
+        supported by your browser.  Supply a Menu Item title, and enter the
+        location in the Help File Path slot of the New Help Source dialog.  Use
+        http:// and/or www. to identify external URLs, or download the file and
+        browse for its path on your machine using the Browse button.
 
-	All users can access the extensive sources of help, including
-	tutorials, available at www.python.org/doc.  Selected URLs can be added
-	or removed from the Help menu at any time using Configure IDLE.
+        All users can access the extensive sources of help, including
+        tutorials, available at docs.python.org.  Selected URLs can be added
+        or removed from the Help menu at any time using Configure IDLE.
 
 Basic editing and navigation:
 
-	Backspace deletes char to the left; DEL deletes char to the right.
-	Control-backspace deletes word left, Control-DEL deletes word right.
-	Arrow keys and Page Up/Down move around.
-	Control-left/right Arrow moves by words in a strange but useful way.
-	Home/End go to begin/end of line.
-	Control-Home/End go to begin/end of file.
-	Some useful Emacs bindings are inherited from Tcl/Tk:
-		Control-a     beginning of line
-		Control-e     end of line
-		Control-k     kill line (but doesn't put it in clipboard)
-		Control-l     center window around the insertion point
-	Standard Windows bindings may work on that platform.
-	Keybindings are selected in the Settings Dialog, look there.
+        Backspace deletes char to the left; DEL deletes char to the right.
+        Control-backspace deletes word left, Control-DEL deletes word right.
+        Arrow keys and Page Up/Down move around.
+        Control-left/right Arrow moves by words in a strange but useful way.
+        Home/End go to begin/end of line.
+        Control-Home/End go to begin/end of file.
+        Some useful Emacs bindings are inherited from Tcl/Tk:
+                Control-a     beginning of line
+                Control-e     end of line
+                Control-k     kill line (but doesn't put it in clipboard)
+                Control-l     center window around the insertion point
+        Standard keybindings (like Control-c to copy and Control-v to
+        paste) may work.  Keybindings are selected in the Configure IDLE
+        dialog.
 
 Automatic indentation:
 
-	After a block-opening statement, the next line is indented by 4 spaces
-	(in the Python Shell window by one tab).  After certain keywords
-	(break, return etc.) the next line is dedented.  In leading
-	indentation, Backspace deletes up to 4 spaces if they are there.  Tab
-	inserts spaces (in the Python Shell window one tab), number depends on
-	Indent Width.  (N.B. Currently tabs are restricted to four spaces due
-	to Tcl/Tk issues.)
+        After a block-opening statement, the next line is indented by 4 spaces
+        (in the Python Shell window by one tab).  After certain keywords
+        (break, return etc.) the next line is dedented.  In leading
+        indentation, Backspace deletes up to 4 spaces if they are there.  Tab
+        inserts spaces (in the Python Shell window one tab), number depends on
+        Indent Width. Currently tabs are restricted to four spaces due
+        to Tcl/Tk limitations.
 
         See also the indent/dedent region commands in the edit menu.
 
 Completions:
 
-	Completions are supplied for functions, classes, and attributes of
-	classes, both built-in and user-defined.  Completions are also provided
-	for filenames.
+        Completions are supplied for functions, classes, and attributes of
+        classes, both built-in and user-defined.  Completions are also provided
+        for filenames.
 
-	The AutoCompleteWindow (ACW) will open after a predefined delay
-	(default is two seconds) after a '.' or (in a string) an os.sep is
-	typed.  If after one of those characters (plus zero or more other
-	characters) you type a Tab the ACW will open immediately if a possible
-	continuation is found.
+        The AutoCompleteWindow (ACW) will open after a predefined delay
+        (default is two seconds) after a '.' or (in a string) an os.sep is
+        typed.  If after one of those characters (plus zero or more other
+        characters) a tab is typed the ACW will open immediately if a possible
+        continuation is found.
 
-	If there is only one possible completion for the characters entered, a
-	Tab will supply that completion without opening the ACW.
+        If there is only one possible completion for the characters entered, a
+        tab will supply that completion without opening the ACW.
 
-	'Show Completions' will force open a completions window.  In an empty
-	string, this will contain the files in the current directory.  On a
-	blank line, it will contain the built-in and user-defined functions and
-	classes in the current name spaces, plus any modules imported.  If some
-	characters have been entered, the ACW will attempt to be more specific.
+        'Show Completions' will force open a completions window, by default the
+        Control-space keys will open a completions window.  In an empty
+        string, this will contain the files in the current directory.  On a
+        blank line, it will contain the built-in and user-defined functions and
+        classes in the current name spaces, plus any modules imported.  If some
+        characters have been entered, the ACW will attempt to be more specific.
 
-	If string of characters is typed, the ACW selection will jump to the
-	entry most closely matching those characters. Entering a Tab will cause
-	the longest non-ambiguous match to be entered in the Edit window or
-	Shell.  Two Tabs in a row will supply the current ACW selection, as
-	will Return or a double click.  Cursor keys, Page Up/Down, mouse
-	selection, and the scrollwheel all operate on the ACW.
+        If string of characters is typed, the ACW selection will jump to the
+        entry most closely matching those characters. Entering a tab will cause
+        the longest non-ambiguous match to be entered in the Edit window or
+        Shell.  Two tabs in a row will supply the current ACW selection, as
+        will return or a double click.  Cursor keys, Page Up/Down, mouse
+        selection, and the scroll wheel all operate on the ACW.
 
-	'Hidden' attributes can be accessed by typing the beginning of hidden
-	name after a '.'.  e.g. '_'.  This allows access to modules with
-	'__all__' set, or to class-private attributes.
+        "Hidden" attributes can be accessed by typing the beginning of hidden
+        name after a '.',  e.g. '_'.  This allows access to modules with
+        '__all__' set, or to class-private attributes.
 
-	Completions and the 'Expand Word' facility can save a lot of typing!
+        Completions and the 'Expand Word' facility can save a lot of typing!
 
-	Completions are currently limited to those in the namespaces.  Names in
-	an Edit window which are not via __main__ or sys.modules will not be
-	found.  Run the module once with your imports to correct this
-	situation.  Note that IDLE itself places quite a few modules in
-	sys.modules, so much can be found by default, e.g. the re module.
+        Completions are currently limited to those in the namespaces.  Names in
+        an Editor window which are not via __main__ or sys.modules will not be
+        found.  Run the module once with your imports to correct this
+        situation.  Note that IDLE itself places quite a few modules in
+        sys.modules, so much can be found by default, e.g. the re module.
 
-	If you don't like the ACW popping up unbidden, simply make the delay
-	longer or disable the extension.  OTOH, you could make the delay zero.
-
-	You could also switch off the CallTips extension.  (We will be adding
-	a delay to the call tip window.)
+        If you don't like the ACW popping up unbidden, simply make the delay
+        longer or disable the extension.  Or another option is the delay could
+        be set to zero. Another alternative to preventing ACW popups is to
+        disable the call tips extension.
 
 Python Shell window:
 
-	Control-c interrupts executing command.
-	Control-d sends end-of-file; closes window if typed at >>> prompt.
+        Control-c interrupts executing command.
+        Control-d sends end-of-file; closes window if typed at >>> prompt.
+        Alt-/ expand word is also useful to reduce typing.
 
     Command history:
 
-	Alt-p retrieves previous command matching what you have typed.
-	Alt-n retrieves next.
-	      (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.
+        Alt-p retrieves previous command matching what you have typed. On OS X
+        use Control-p.
+        Alt-n retrieves next. On OS X use Control-n.
+        Return while cursor is on a previous command retrieves that command.
 
     Syntax colors:
 
-	The coloring is applied in a background "thread", so you may
-	occasionally see uncolorized text.  To change the color
-	scheme, use the Configure IDLE / Highlighting dialog.
+        The coloring is applied in a background "thread", so you may
+        occasionally see uncolorized text.  To change the color
+        scheme, use the Configure IDLE / Highlighting dialog.
 
     Python default syntax colors:
 
-	Keywords	orange
-	Builtins	royal purple
-	Strings		green
-	Comments	red
-	Definitions	blue
+        Keywords        orange
+        Builtins        royal purple
+        Strings         green
+        Comments        red
+        Definitions     blue
 
     Shell default colors:
 
-	Console output	brown
-	stdout		blue
-	stderr		red
-	stdin		black
+        Console output  brown
+        stdout          blue
+        stderr          red
+        stdin           black
 
 Other preferences:
 
-	The font preferences, keybinding, and startup preferences can
-	be changed using the Settings dialog.
+        The font preferences, highlighting, keys, and general preferences can
+        be changed via the Configure IDLE menu option.  Be sure to note that
+        keys can be user defined, IDLE ships with four built in key sets. In
+        addition a user can create a custom key set in the Configure IDLE
+        dialog under the keys tab.
 
 Command line usage:
 
-	Enter idle -h at the command prompt to get a usage message.
+        Enter idle -h at the command prompt to get a usage message.
 
-Running without a subprocess:
+        idle.py [-c command] [-d] [-e] [-s] [-t title] [arg] ...
 
-	If IDLE is started with the -n command line switch it will run in a
-	single process and will not create the subprocess which runs the RPC
-	Python execution server.  This can be useful if Python cannot create
-	the subprocess or the RPC socket interface on your platform.  However,
-	in this mode user code is not isolated from IDLE itself.  Also, the
-	environment is not restarted when Run/Run Module (F5) is selected.  If
-	your code has been modified, you must reload() the affected modules and
-	re-import any specific items (e.g. from foo import baz) if the changes
-	are to take effect.  For these reasons, it is preferable to run IDLE
-	with the default subprocess if at all possible.
+        -c command  run this command
+        -d          enable debugger
+        -e          edit mode; arguments are files to be edited
+        -s          run $IDLESTARTUP or $PYTHONSTARTUP first
+        -t title    set title of shell window
+
+        If there are arguments:
+        1. If -e is used, arguments are files opened for editing and sys.argv
+           reflects the arguments passed to IDLE itself.
+        2. Otherwise, if -c is used, all arguments are placed in
+           sys.argv[1:...], with sys.argv[0] set to -c.
+        3. Otherwise, if neither -e nor -c is used, the first argument is a
+           script which is executed with the remaining arguments in
+           sys.argv[1:...]  and sys.argv[0] set to the script name.  If the
+           script name is -, no script is executed but an interactive Python
+           session is started; the arguments are still available in sys.argv.
+
+Running without a subprocess: (DEPRECATED in Python 3.4 see Issue 16123)
+
+        If IDLE is started with the -n command line switch it will run in a
+        single process and will not create the subprocess which runs the RPC
+        Python execution server.  This can be useful if Python cannot create
+        the subprocess or the RPC socket interface on your platform.  However,
+        in this mode user code is not isolated from IDLE itself.  Also, the
+        environment is not restarted when Run/Run Module (F5) is selected.  If
+        your code has been modified, you must reload() the affected modules and
+        re-import any specific items (e.g. from foo import baz) if the changes
+        are to take effect.  For these reasons, it is preferable to run IDLE
+        with the default subprocess if at all possible.
 
 Extensions:
 
-	IDLE contains an extension facility.  See the beginning of
-	config-extensions.def in the idlelib directory for further information.
-	The default extensions are currently:
+        IDLE contains an extension facility.  See the beginning of
+        config-extensions.def in the idlelib directory for further information.
+        The default extensions are currently:
 
-		FormatParagraph
-		AutoExpand
-		ZoomHeight
-		ScriptBinding
-		CallTips
-		ParenMatch
-		AutoComplete
-		CodeContext
+                FormatParagraph
+                AutoExpand
+                ZoomHeight
+                ScriptBinding
+                CallTips
+                ParenMatch
+                AutoComplete
+                CodeContext
diff --git a/Lib/idlelib/idle_test/README.txt b/Lib/idlelib/idle_test/README.txt
index 6b92483..f6b6a21 100644
--- a/Lib/idlelib/idle_test/README.txt
+++ b/Lib/idlelib/idle_test/README.txt
@@ -26,7 +26,6 @@
 with xyz (lowercased) added after 'test_'.
 ---
 if __name__ == "__main__":
-    from test import support; support.use_resources = ['gui']
     import unittest
     unittest.main('idlelib.idle_test.test_', verbosity=2, exit=False)
 ---
@@ -34,12 +33,12 @@
 
 2. Gui Tests
 
-Gui tests need 'requires' and 'use_resources' from test.support
-(test.test_support in 2.7). A test is a gui test if it creates a Tk root or
-master object either directly or indirectly by instantiating a tkinter or
-idle class. For the benefit of buildbot machines that do not have a graphics
-screen, gui tests must be 'guarded' by "requires('gui')" in a setUp
-function or method. This will typically be setUpClass.
+Gui tests need 'requires' from test.support (test.test_support in 2.7). A
+test is a gui test if it creates a Tk root or master object either directly
+or indirectly by instantiating a tkinter or idle class. For the benefit of
+test processes that either have no graphical environment available or are not
+allowed to use it, gui tests must be 'guarded' by "requires('gui')" in a
+setUp function or method. This will typically be setUpClass.
 
 To avoid interfering with other gui tests, all gui objects must be destroyed
 and deleted by the end of the test.  If a widget, such as a Tk root, is created
@@ -57,11 +56,17 @@
         del cls.root
 ---
 
-Support.requires('gui') returns true if it is either called in a main module
-(which never happens on buildbots) or if use_resources contains 'gui'.
-Use_resources is set by test.regrtest but not by unittest. So when running
-tests in another module with unittest, we set it ourselves, as in the xyz.py
-template above.
+Support.requires('gui') causes the test(s) it guards to be skipped if any of
+a few conditions are met:
+ - The tests are being run by regrtest.py, and it was started without
+   enabling the "gui" resource with the "-u" command line option.
+ - The tests are being run on Windows by a service that is not allowed to
+   interact with the graphical environment.
+ - The tests are being run on Mac OSX in a process that cannot make a window
+   manager connection.
+ - tkinter.Tk cannot be successfully instantiated for some reason.
+ - test.support.use_resources has been set by something other than
+   regrtest.py and does not contain "gui".
 
 Since non-gui tests always run, but gui tests only sometimes, tests of non-gui
 operations should best avoid needing a gui. Methods that make incidental use of
@@ -88,8 +93,8 @@
 
 To run all idle_test/test_*.py tests, either interactively
 ('>>>', with unittest imported) or from a command line, use one of the
-following. (Notes: unittest does not run gui tests; in 2.7, 'test ' (with the
-space) is 'test.regrtest '; where present, -v and -ugui can be omitted.)
+following. (Notes: in 2.7, 'test ' (with the space) is 'test.regrtest ';
+where present, -v and -ugui can be omitted.)
 
 >>> unittest.main('idlelib.idle_test', verbosity=2, exit=False)
 python -m unittest -v idlelib.idle_test
@@ -98,13 +103,13 @@
 
 The idle tests are 'discovered' by idlelib.idle_test.__init__.load_tests,
 which is also imported into test.test_idle. Normally, neither file should be
-changed when working on individual test modules. The third command runs runs
+changed when working on individual test modules. The third command runs
 unittest indirectly through regrtest. The same happens when the entire test
 suite is run with 'python -m test'. So that command must work for buildbots
 to stay green. Idle tests must not disturb the environment in a way that
 makes other tests fail (issue 18081).
 
 To run an individual Testcase or test method, extend the dotted name given to
-unittest on the command line. (But gui tests will not this way.)
+unittest on the command line.
 
 python -m unittest -v idlelib.idle_test.test_xyz.Test_case.test_meth
diff --git a/Lib/idlelib/idle_test/htest.py b/Lib/idlelib/idle_test/htest.py
new file mode 100644
index 0000000..aa7f2e8
--- /dev/null
+++ b/Lib/idlelib/idle_test/htest.py
@@ -0,0 +1,407 @@
+'''Run human tests of Idle's window, dialog, and popup widgets.
+
+run(*tests)
+Create a master Tk window.  Within that, run each callable in tests
+after finding the matching test spec in this file.  If tests is empty,
+run an htest for each spec dict in this file after finding the matching
+callable in the module named in the spec.  Close the window to skip or
+end the test.
+
+In a tested module, let X be a global name bound to a callable (class
+or function) whose .__name__ attrubute is also X (the usual situation).
+The first parameter of X must be 'parent'.  When called, the parent
+argument will be the root window.  X must create a child Toplevel
+window (or subclass thereof).  The Toplevel may be a test widget or
+dialog, in which case the callable is the corresonding class.  Or the
+Toplevel may contain the widget to be tested or set up a context in
+which a test widget is invoked.  In this latter case, the callable is a
+wrapper function that sets up the Toplevel and other objects.  Wrapper
+function names, such as _editor_window', should start with '_'.
+
+
+End the module with
+
+if __name__ == '__main__':
+    <unittest, if there is one>
+    from idlelib.idle_test.htest import run
+    run(X)
+
+To have wrapper functions and test invocation code ignored by coveragepy
+reports, put '# htest #' on the def statement header line.
+
+def _wrapper(parent):  # htest #
+
+Also make sure that the 'if __name__' line matches the above.  Then have
+make sure that .coveragerc includes the following.
+
+[report]
+exclude_lines =
+    .*# htest #
+    if __name__ == .__main__.:
+
+(The "." instead of "'" is intentional and necessary.)
+
+
+To run any X, this file must contain a matching instance of the
+following template, with X.__name__ prepended to '_spec'.
+When all tests are run, the prefix is use to get X.
+
+_spec = {
+    'file': '',
+    'kwds': {'title': ''},
+    'msg': ""
+    }
+
+file (no .py): run() imports file.py.
+kwds: augmented with {'parent':root} and passed to X as **kwds.
+title: an example kwd; some widgets need this, delete if not.
+msg: master window hints about testing the widget.
+
+
+Modules and classes not being tested at the moment:
+PyShell.PyShellEditorWindow
+Debugger.Debugger
+AutoCompleteWindow.AutoCompleteWindow
+OutputWindow.OutputWindow (indirectly being tested with grep test)
+'''
+
+from importlib import import_module
+from idlelib.macosxSupport import _initializeTkVariantTests
+import tkinter as tk
+
+AboutDialog_spec = {
+    'file': 'aboutDialog',
+    'kwds': {'title': 'aboutDialog test',
+             '_htest': True,
+             },
+    'msg': "Test every button. Ensure Python, TK and IDLE versions "
+           "are correctly displayed.\n [Close] to exit.",
+    }
+
+_calltip_window_spec = {
+    'file': 'CallTipWindow',
+    'kwds': {},
+    'msg': "Typing '(' should display a calltip.\n"
+           "Typing ') should hide the calltip.\n"
+    }
+
+_class_browser_spec = {
+    'file': 'ClassBrowser',
+    'kwds': {},
+    'msg': "Inspect names of module, class(with superclass if "
+           "applicable), methods and functions.\nToggle nested items.\n"
+           "Double clicking on items prints a traceback for an exception "
+           "that is ignored."
+    }
+ConfigExtensionsDialog_spec = {
+    'file': 'configDialog',
+    'kwds': {'title': 'Test Extension Configuration',
+             '_htest': True,},
+    'msg': "IDLE extensions dialog.\n"
+           "\n[Ok] to close the dialog.[Apply] to apply the settings and "
+           "and [Cancel] to revert all changes.\nRe-run the test to ensure "
+           "changes made have persisted."
+    }
+
+_color_delegator_spec = {
+    'file': 'ColorDelegator',
+    'kwds': {},
+    'msg': "The text is sample Python code.\n"
+           "Ensure components like comments, keywords, builtins,\n"
+           "string, definitions, and break are correctly colored.\n"
+           "The default color scheme is in idlelib/config-highlight.def"
+    }
+
+ConfigDialog_spec = {
+    'file': 'configDialog',
+    'kwds': {'title': 'ConfigDialogTest',
+             '_htest': True,},
+    'msg': "IDLE preferences dialog.\n"
+           "In the 'Fonts/Tabs' tab, changing font face, should update the "
+           "font face of the text in the area below it.\nIn the "
+           "'Highlighting' tab, try different color schemes. Clicking "
+           "items in the sample program should update the choices above it."
+           "\nIn the 'Keys' and 'General' tab, test settings of interest."
+           "\n[Ok] to close the dialog.[Apply] to apply the settings and "
+           "and [Cancel] to revert all changes.\nRe-run the test to ensure "
+           "changes made have persisted."
+    }
+
+# TODO Improve message
+_dyn_option_menu_spec = {
+    'file': 'dynOptionMenuWidget',
+    'kwds': {},
+    'msg': "Select one of the many options in the 'old option set'.\n"
+           "Click the button to change the option set.\n"
+           "Select one of the many options in the 'new option set'."
+    }
+
+# TODO edit wrapper
+_editor_window_spec = {
+   'file': 'EditorWindow',
+    'kwds': {},
+    'msg': "Test editor functions of interest.\n"
+           "Best to close editor first."
+    }
+
+GetCfgSectionNameDialog_spec = {
+    'file': 'configSectionNameDialog',
+    'kwds': {'title':'Get Name',
+             'message':'Enter something',
+             'used_names': {'abc'},
+             '_htest': True},
+    'msg': "After the text entered with [Ok] is stripped, <nothing>, "
+           "'abc', or more that 30 chars are errors.\n"
+           "Close 'Get Name' with a valid entry (printed to Shell), "
+           "[Cancel], or [X]",
+    }
+
+GetHelpSourceDialog_spec = {
+    'file': 'configHelpSourceEdit',
+    'kwds': {'title': 'Get helpsource',
+             '_htest': True},
+    'msg': "Enter menu item name and help file path\n "
+           "<nothing> and more than 30 chars are invalid menu item names.\n"
+           "<nothing>, file does not exist are invalid path items.\n"
+           "Test for incomplete web address for help file path.\n"
+           "A valid entry will be printed to shell with [0k].\n"
+           "[Cancel] will print None to shell",
+    }
+
+# Update once issue21519 is resolved.
+GetKeysDialog_spec = {
+    'file': 'keybindingDialog',
+    'kwds': {'title': 'Test keybindings',
+             'action': 'find-again',
+             'currentKeySequences': [''] ,
+             '_htest': True,
+             },
+    'msg': "Test for different key modifier sequences.\n"
+           "<nothing> is invalid.\n"
+           "No modifier key is invalid.\n"
+           "Shift key with [a-z],[0-9], function key, move key, tab, space"
+           "is invalid.\nNo validity checking if advanced key binding "
+           "entry is used."
+    }
+
+_grep_dialog_spec = {
+    'file': 'GrepDialog',
+    'kwds': {},
+    'msg': "Click the 'Show GrepDialog' button.\n"
+           "Test the various 'Find-in-files' functions.\n"
+           "The results should be displayed in a new '*Output*' window.\n"
+           "'Right-click'->'Goto file/line' anywhere in the search results "
+           "should open that file \nin a new EditorWindow."
+    }
+
+_help_dialog_spec = {
+    'file': 'EditorWindow',
+    'kwds': {},
+    'msg': "If the help text displays, this works.\n"
+           "Text is selectable. Window is scrollable."
+    }
+
+_io_binding_spec = {
+    'file': 'IOBinding',
+    'kwds': {},
+    'msg': "Test the following bindings\n"
+           "<Control-o> to display open window from file dialog.\n"
+           "<Control-s> to save the file\n"
+    }
+
+_multi_call_spec = {
+    'file': 'MultiCall',
+    'kwds': {},
+    'msg': "The following actions should trigger a print to console or IDLE"
+           " Shell.\nEntering and leaving the text area, key entry, "
+           "<Control-Key>,\n<Alt-Key-a>, <Control-Key-a>, "
+           "<Alt-Control-Key-a>, \n<Control-Button-1>, <Alt-Button-1> and "
+           "focusing out of the window\nare sequences to be tested."
+    }
+
+_multistatus_bar_spec = {
+    'file': 'MultiStatusBar',
+    'kwds': {},
+    'msg': "Ensure presence of multi-status bar below text area.\n"
+           "Click 'Update Status' to change the multi-status text"
+    }
+
+_object_browser_spec = {
+    'file': 'ObjectBrowser',
+    'kwds': {},
+    'msg': "Double click on items upto the lowest level.\n"
+           "Attributes of the objects and related information "
+           "will be displayed side-by-side at each level."
+    }
+
+_path_browser_spec = {
+    'file': 'PathBrowser',
+    'kwds': {},
+    'msg': "Test for correct display of all paths in sys.path.\n"
+           "Toggle nested items upto the lowest level.\n"
+           "Double clicking on an item prints a traceback\n"
+           "for an exception that is ignored."
+    }
+
+_percolator_spec = {
+    'file': 'Percolator',
+    'kwds': {},
+    'msg': "There are two tracers which can be toggled using a checkbox.\n"
+           "Toggling a tracer 'on' by checking it should print tracer"
+           "output to the console or to the IDLE shell.\n"
+           "If both the tracers are 'on', the output from the tracer which "
+           "was switched 'on' later, should be printed first\n"
+           "Test for actions like text entry, and removal."
+    }
+
+_replace_dialog_spec = {
+    'file': 'ReplaceDialog',
+    'kwds': {},
+    'msg': "Click the 'Replace' button.\n"
+           "Test various replace options in the 'Replace dialog'.\n"
+           "Click [Close] or [X] to close the 'Replace Dialog'."
+    }
+
+_search_dialog_spec = {
+    'file': 'SearchDialog',
+    'kwds': {},
+    'msg': "Click the 'Search' button.\n"
+           "Test various search options in the 'Search dialog'.\n"
+           "Click [Close] or [X] to close the 'Search Dialog'."
+    }
+
+_scrolled_list_spec = {
+    'file': 'ScrolledList',
+    'kwds': {},
+    'msg': "You should see a scrollable list of items\n"
+           "Selecting (clicking) or double clicking an item "
+           "prints the name to the console or Idle shell.\n"
+           "Right clicking an item will display a popup."
+    }
+
+_stack_viewer_spec = {
+    'file': 'StackViewer',
+    'kwds': {},
+    'msg': "A stacktrace for a NameError exception.\n"
+           "Expand 'idlelib ...' and '<locals>'.\n"
+           "Check that exc_value, exc_tb, and exc_type are correct.\n"
+    }
+
+_tabbed_pages_spec = {
+    'file': 'tabbedpages',
+    'kwds': {},
+    'msg': "Toggle between the two tabs 'foo' and 'bar'\n"
+           "Add a tab by entering a suitable name for it.\n"
+           "Remove an existing tab by entering its name.\n"
+           "Remove all existing tabs.\n"
+           "<nothing> is an invalid add page and remove page name.\n"
+    }
+
+TextViewer_spec = {
+    'file': 'textView',
+    'kwds': {'title': 'Test textView',
+             'text':'The quick brown fox jumps over the lazy dog.\n'*35,
+             '_htest': True},
+    'msg': "Test for read-only property of text.\n"
+           "Text is selectable. Window is scrollable.",
+     }
+
+_tooltip_spec = {
+    'file': 'ToolTip',
+    'kwds': {},
+    'msg': "Place mouse cursor over both the buttons\n"
+           "A tooltip should appear with some text."
+    }
+
+_tree_widget_spec = {
+    'file': 'TreeWidget',
+    'kwds': {},
+    'msg': "The canvas is scrollable.\n"
+           "Click on folders upto to the lowest level."
+    }
+
+_undo_delegator_spec = {
+    'file': 'UndoDelegator',
+    'kwds': {},
+    'msg': "Click [Undo] to undo any action.\n"
+           "Click [Redo] to redo any action.\n"
+           "Click [Dump] to dump the current state "
+           "by printing to the console or the IDLE shell.\n"
+    }
+
+_widget_redirector_spec = {
+    'file': 'WidgetRedirector',
+    'kwds': {},
+    'msg': "Every text insert should be printed to the console."
+           "or the IDLE shell."
+    }
+
+def run(*tests):
+    root = tk.Tk()
+    root.title('IDLE htest')
+    root.resizable(0, 0)
+    _initializeTkVariantTests(root)
+
+    # a scrollable Label like constant width text widget.
+    frameLabel = tk.Frame(root, padx=10)
+    frameLabel.pack()
+    text = tk.Text(frameLabel, wrap='word')
+    text.configure(bg=root.cget('bg'), relief='flat', height=4, width=70)
+    scrollbar = tk.Scrollbar(frameLabel, command=text.yview)
+    text.config(yscrollcommand=scrollbar.set)
+    scrollbar.pack(side='right', fill='y', expand=False)
+    text.pack(side='left', fill='both', expand=True)
+
+    test_list = [] # List of tuples of the form (spec, callable widget)
+    if tests:
+        for test in tests:
+            test_spec = globals()[test.__name__ + '_spec']
+            test_spec['name'] = test.__name__
+            test_list.append((test_spec,  test))
+    else:
+        for k, d in globals().items():
+            if k.endswith('_spec'):
+                test_name = k[:-5]
+                test_spec = d
+                test_spec['name'] = test_name
+                mod = import_module('idlelib.' + test_spec['file'])
+                test = getattr(mod, test_name)
+                test_list.append((test_spec, test))
+
+    test_name = tk.StringVar('')
+    callable_object = None
+    test_kwds = None
+
+    def next():
+
+        nonlocal test_name, callable_object, test_kwds
+        if len(test_list) == 1:
+            next_button.pack_forget()
+        test_spec, callable_object = test_list.pop()
+        test_kwds = test_spec['kwds']
+        test_kwds['parent'] = root
+        test_name.set('Test ' + test_spec['name'])
+
+        text.configure(state='normal') # enable text editing
+        text.delete('1.0','end')
+        text.insert("1.0",test_spec['msg'])
+        text.configure(state='disabled') # preserve read-only property
+
+    def run_test():
+        widget = callable_object(**test_kwds)
+        try:
+            print(widget.result)
+        except AttributeError:
+            pass
+
+    button = tk.Button(root, textvariable=test_name, command=run_test)
+    button.pack()
+    next_button = tk.Button(root, text="Next", command=next)
+    next_button.pack()
+
+    next()
+
+    root.mainloop()
+
+if __name__ == '__main__':
+    run()
diff --git a/Lib/idlelib/idle_test/mock_idle.py b/Lib/idlelib/idle_test/mock_idle.py
index c364a24..1672a34 100644
--- a/Lib/idlelib/idle_test/mock_idle.py
+++ b/Lib/idlelib/idle_test/mock_idle.py
@@ -5,6 +5,33 @@
 
 from idlelib.idle_test.mock_tk import Text
 
+class Func:
+    '''Mock function captures args and returns result set by test.
+
+    Attributes:
+    self.called - records call even if no args, kwds passed.
+    self.result - set by init, returned by call.
+    self.args - captures positional arguments.
+    self.kwds - captures keyword arguments.
+
+    Most common use will probably be to mock methods.
+    Mock_tk.Var and Mbox_func are special variants of this.
+    '''
+    def __init__(self, result=None):
+        self.called = False
+        self.result = result
+        self.args = None
+        self.kwds = None
+    def __call__(self, *args, **kwds):
+        self.called = True
+        self.args = args
+        self.kwds = kwds
+        if isinstance(self.result, BaseException):
+            raise self.result
+        else:
+            return self.result
+
+
 class Editor:
     '''Minimally imitate EditorWindow.EditorWindow class.
     '''
@@ -17,6 +44,7 @@
         last = self.text.index('end')
         return first, last
 
+
 class UndoDelegator:
     '''Minimally imitate UndoDelegator,UndoDelegator class.
     '''
diff --git a/Lib/idlelib/idle_test/mock_tk.py b/Lib/idlelib/idle_test/mock_tk.py
index 762bbc9..a8030f4 100644
--- a/Lib/idlelib/idle_test/mock_tk.py
+++ b/Lib/idlelib/idle_test/mock_tk.py
@@ -1,9 +1,27 @@
 """Classes that replace tkinter gui objects used by an object being tested.
 
-A gui object is anything with a master or parent paramenter, which is typically
-required in spite of what the doc strings say.
+A gui object is anything with a master or parent paramenter, which is
+typically required in spite of what the doc strings say.
 """
 
+class Event:
+    '''Minimal mock with attributes for testing event handlers.
+
+    This is not a gui object, but is used as an argument for callbacks
+    that access attributes of the event passed. If a callback ignores
+    the event, other than the fact that is happened, pass 'event'.
+
+    Keyboard, mouse, window, and other sources generate Event instances.
+    Event instances have the following attributes: serial (number of
+    event), time (of event), type (of event as number), widget (in which
+    event occurred), and x,y (position of mouse). There are other
+    attributes for specific events, such as keycode for key events.
+    tkinter.Event.__doc__ has more but is still not complete.
+    '''
+    def __init__(self, **kwds):
+        "Create event with attributes needed for test"
+        self.__dict__.update(kwds)
+
 class Var:
     "Use for String/Int/BooleanVar: incomplete"
     def __init__(self, master=None, value=None, name=None):
@@ -20,9 +38,10 @@
 
     Instead of displaying a message box, the mock's call method saves the
     arguments as instance attributes, which test functions can then examime.
+    The test can set the result returned to ask function
     """
-    def __init__(self):
-        self.result = None  # The return for all show funcs
+    def __init__(self, result=None):
+        self.result = result  # Return None for all show funcs
     def __call__(self, title, message, *args, **kwds):
         # Save all args for possible examination by tester
         self.title = title
@@ -97,7 +116,7 @@
         """Return a (line, char) tuple of int indexes into self.data.
 
         This implements .index without converting the result back to a string.
-        The result is contrained by the number of lines and linelengths of
+        The result is constrained by the number of lines and linelengths of
         self.data. For many indexes, the result is initially (1, 0).
 
         The input index may have any of several possible forms:
diff --git a/Lib/idlelib/idle_test/test_autocomplete.py b/Lib/idlelib/idle_test/test_autocomplete.py
new file mode 100644
index 0000000..bcc853c
--- /dev/null
+++ b/Lib/idlelib/idle_test/test_autocomplete.py
@@ -0,0 +1,143 @@
+import unittest
+from test.support import requires
+from tkinter import Tk, Text, TclError
+
+import idlelib.AutoComplete as ac
+import idlelib.AutoCompleteWindow as acw
+import idlelib.macosxSupport as mac
+from idlelib.idle_test.mock_idle import Func
+from idlelib.idle_test.mock_tk import Event
+
+class AutoCompleteWindow:
+    def complete():
+        return
+
+class DummyEditwin:
+    def __init__(self, root, text):
+        self.root = root
+        self.text = text
+        self.indentwidth = 8
+        self.tabwidth = 8
+        self.context_use_ps1 = True
+
+
+class AutoCompleteTest(unittest.TestCase):
+
+    @classmethod
+    def setUpClass(cls):
+        requires('gui')
+        cls.root = Tk()
+        mac.setupApp(cls.root, None)
+        cls.text = Text(cls.root)
+        cls.editor = DummyEditwin(cls.root, cls.text)
+
+    @classmethod
+    def tearDownClass(cls):
+        cls.root.destroy()
+        del cls.text
+        del cls.editor
+        del cls.root
+
+    def setUp(self):
+        self.editor.text.delete('1.0', 'end')
+        self.autocomplete = ac.AutoComplete(self.editor)
+
+    def test_init(self):
+        self.assertEqual(self.autocomplete.editwin, self.editor)
+
+    def test_make_autocomplete_window(self):
+        testwin = self.autocomplete._make_autocomplete_window()
+        self.assertIsInstance(testwin, acw.AutoCompleteWindow)
+
+    def test_remove_autocomplete_window(self):
+        self.autocomplete.autocompletewindow = (
+            self.autocomplete._make_autocomplete_window())
+        self.autocomplete._remove_autocomplete_window()
+        self.assertIsNone(self.autocomplete.autocompletewindow)
+
+    def test_force_open_completions_event(self):
+        # Test that force_open_completions_event calls _open_completions
+        o_cs = Func()
+        self.autocomplete.open_completions = o_cs
+        self.autocomplete.force_open_completions_event('event')
+        self.assertEqual(o_cs.args, (True, False, True))
+
+    def test_try_open_completions_event(self):
+        Equal = self.assertEqual
+        autocomplete = self.autocomplete
+        trycompletions = self.autocomplete.try_open_completions_event
+        o_c_l = Func()
+        autocomplete._open_completions_later = o_c_l
+
+        # _open_completions_later should not be called with no text in editor
+        trycompletions('event')
+        Equal(o_c_l.args, None)
+
+        # _open_completions_later should be called with COMPLETE_ATTRIBUTES (1)
+        self.text.insert('1.0', 're.')
+        trycompletions('event')
+        Equal(o_c_l.args, (False, False, False, 1))
+
+        # _open_completions_later should be called with COMPLETE_FILES (2)
+        self.text.delete('1.0', 'end')
+        self.text.insert('1.0', '"./Lib/')
+        trycompletions('event')
+        Equal(o_c_l.args, (False, False, False, 2))
+
+    def test_autocomplete_event(self):
+        Equal = self.assertEqual
+        autocomplete = self.autocomplete
+
+        # Test that the autocomplete event is ignored if user is pressing a
+        # modifier key in addition to the tab key
+        ev = Event(mc_state=True)
+        self.assertIsNone(autocomplete.autocomplete_event(ev))
+        del ev.mc_state
+
+        # If autocomplete window is open, complete() method is called
+        testwin = self.autocomplete._make_autocomplete_window()
+        self.text.insert('1.0', 're.')
+        Equal(self.autocomplete.autocomplete_event(ev), 'break')
+
+        # If autocomplete window is not active or does not exist,
+        # open_completions is called. Return depends on its return.
+        autocomplete._remove_autocomplete_window()
+        o_cs = Func()  # .result = None
+        autocomplete.open_completions = o_cs
+        Equal(self.autocomplete.autocomplete_event(ev), None)
+        Equal(o_cs.args, (False, True, True))
+        o_cs.result = True
+        Equal(self.autocomplete.autocomplete_event(ev), 'break')
+        Equal(o_cs.args, (False, True, True))
+
+    def test_open_completions_later(self):
+        # Test that autocomplete._delayed_completion_id is set
+        pass
+
+    def test_delayed_open_completions(self):
+        # Test that autocomplete._delayed_completion_id set to None and that
+        # open_completions only called if insertion index is the same as
+        # _delayed_completion_index
+        pass
+
+    def test_open_completions(self):
+        # Test completions of files and attributes as well as non-completion
+        # of errors
+        pass
+
+    def test_fetch_completions(self):
+        # Test that fetch_completions returns 2 lists:
+        # For attribute completion, a large list containing all variables, and
+        # a small list containing non-private variables.
+        # For file completion, a large list containing all files in the path,
+        # and a small list containing files that do not start with '.'
+        pass
+
+    def test_get_entity(self):
+        # Test that a name is in the namespace of sys.modules and
+        # __main__.__dict__
+        pass
+
+
+if __name__ == '__main__':
+    unittest.main(verbosity=2)
diff --git a/Lib/idlelib/idle_test/test_autoexpand.py b/Lib/idlelib/idle_test/test_autoexpand.py
new file mode 100644
index 0000000..7ca941e
--- /dev/null
+++ b/Lib/idlelib/idle_test/test_autoexpand.py
@@ -0,0 +1,141 @@
+"""Unit tests for idlelib.AutoExpand"""
+import unittest
+from test.support import requires
+from tkinter import Text, Tk
+#from idlelib.idle_test.mock_tk import Text
+from idlelib.AutoExpand import AutoExpand
+
+
+class Dummy_Editwin:
+    # AutoExpand.__init__ only needs .text
+    def __init__(self, text):
+        self.text = text
+
+class AutoExpandTest(unittest.TestCase):
+
+    @classmethod
+    def setUpClass(cls):
+        if 'tkinter' in str(Text):
+            requires('gui')
+            cls.tk = Tk()
+            cls.text = Text(cls.tk)
+        else:
+            cls.text = Text()
+        cls.auto_expand = AutoExpand(Dummy_Editwin(cls.text))
+
+    @classmethod
+    def tearDownClass(cls):
+        if hasattr(cls, 'tk'):
+            cls.tk.destroy()
+            del cls.tk
+        del cls.text, cls.auto_expand
+
+    def tearDown(self):
+        self.text.delete('1.0', 'end')
+
+    def test_get_prevword(self):
+        text = self.text
+        previous = self.auto_expand.getprevword
+        equal = self.assertEqual
+
+        equal(previous(), '')
+
+        text.insert('insert', 't')
+        equal(previous(), 't')
+
+        text.insert('insert', 'his')
+        equal(previous(), 'this')
+
+        text.insert('insert', ' ')
+        equal(previous(), '')
+
+        text.insert('insert', 'is')
+        equal(previous(), 'is')
+
+        text.insert('insert', '\nsample\nstring')
+        equal(previous(), 'string')
+
+        text.delete('3.0', 'insert')
+        equal(previous(), '')
+
+        text.delete('1.0', 'end')
+        equal(previous(), '')
+
+    def test_before_only(self):
+        previous = self.auto_expand.getprevword
+        expand = self.auto_expand.expand_word_event
+        equal = self.assertEqual
+
+        self.text.insert('insert', 'ab ac bx ad ab a')
+        equal(self.auto_expand.getwords(), ['ab', 'ad', 'ac', 'a'])
+        expand('event')
+        equal(previous(), 'ab')
+        expand('event')
+        equal(previous(), 'ad')
+        expand('event')
+        equal(previous(), 'ac')
+        expand('event')
+        equal(previous(), 'a')
+
+    def test_after_only(self):
+        # Also add punctuation 'noise' that should be ignored.
+        text = self.text
+        previous = self.auto_expand.getprevword
+        expand = self.auto_expand.expand_word_event
+        equal = self.assertEqual
+
+        text.insert('insert', 'a, [ab] ac: () bx"" cd ac= ad ya')
+        text.mark_set('insert', '1.1')
+        equal(self.auto_expand.getwords(), ['ab', 'ac', 'ad', 'a'])
+        expand('event')
+        equal(previous(), 'ab')
+        expand('event')
+        equal(previous(), 'ac')
+        expand('event')
+        equal(previous(), 'ad')
+        expand('event')
+        equal(previous(), 'a')
+
+    def test_both_before_after(self):
+        text = self.text
+        previous = self.auto_expand.getprevword
+        expand = self.auto_expand.expand_word_event
+        equal = self.assertEqual
+
+        text.insert('insert', 'ab xy yz\n')
+        text.insert('insert', 'a ac by ac')
+
+        text.mark_set('insert', '2.1')
+        equal(self.auto_expand.getwords(), ['ab', 'ac', 'a'])
+        expand('event')
+        equal(previous(), 'ab')
+        expand('event')
+        equal(previous(), 'ac')
+        expand('event')
+        equal(previous(), 'a')
+
+    def test_other_expand_cases(self):
+        text = self.text
+        expand = self.auto_expand.expand_word_event
+        equal = self.assertEqual
+
+        # no expansion candidate found
+        equal(self.auto_expand.getwords(), [])
+        equal(expand('event'), 'break')
+
+        text.insert('insert', 'bx cy dz a')
+        equal(self.auto_expand.getwords(), [])
+
+        # reset state by successfully expanding once
+        # move cursor to another position and expand again
+        text.insert('insert', 'ac xy a ac ad a')
+        text.mark_set('insert', '1.7')
+        expand('event')
+        initial_state = self.auto_expand.state
+        text.mark_set('insert', '1.end')
+        expand('event')
+        new_state = self.auto_expand.state
+        self.assertNotEqual(initial_state, new_state)
+
+if __name__ == '__main__':
+    unittest.main(verbosity=2)
diff --git a/Lib/idlelib/idle_test/test_calltips.py b/Lib/idlelib/idle_test/test_calltips.py
index f363764..4ee15ae 100644
--- a/Lib/idlelib/idle_test/test_calltips.py
+++ b/Lib/idlelib/idle_test/test_calltips.py
@@ -54,9 +54,9 @@
 
         gtest(List, List.__doc__)
         gtest(list.__new__,
-               'T.__new__(S, ...) -> a new object with type S, a subtype of T')
+               'Create and return a new object.  See help(type) for accurate signature.')
         gtest(list.__init__,
-               'x.__init__(...) initializes x; see help(type(x)) for signature')
+               'Initialize self.  See help(type(self)) for accurate signature.')
         append_doc =  "L.append(object) -> None -- append object to end"
         gtest(list.append, append_doc)
         gtest([].append, append_doc)
@@ -69,7 +69,8 @@
         self.assertEqual(signature(textwrap.TextWrapper), '''\
 (width=70, initial_indent='', subsequent_indent='', expand_tabs=True,
     replace_whitespace=True, fix_sentence_endings=False, break_long_words=True,
-    drop_whitespace=True, break_on_hyphens=True, tabsize=8)''')
+    drop_whitespace=True, break_on_hyphens=True, tabsize=8, *, max_lines=None,
+    placeholder=' [...]')''')
 
     def test_docline_truncation(self):
         def f(): pass
diff --git a/Lib/idlelib/idle_test/test_configdialog.py b/Lib/idlelib/idle_test/test_configdialog.py
new file mode 100644
index 0000000..6883123
--- /dev/null
+++ b/Lib/idlelib/idle_test/test_configdialog.py
@@ -0,0 +1,32 @@
+'''Unittests for idlelib/configHandler.py
+
+Coverage: 46% just by creating dialog. The other half is change code.
+
+'''
+import unittest
+from test.support import requires
+from tkinter import Tk
+from idlelib.configDialog import ConfigDialog
+from idlelib.macosxSupport import _initializeTkVariantTests
+
+
+class ConfigDialogTest(unittest.TestCase):
+
+    @classmethod
+    def setUpClass(cls):
+        requires('gui')
+        cls.root = Tk()
+        _initializeTkVariantTests(cls.root)
+
+    @classmethod
+    def tearDownClass(cls):
+        cls.root.destroy()
+        del cls.root
+
+    def test_dialog(self):
+        d=ConfigDialog(self.root, 'Test', _utest=True)
+        d.destroy()
+
+
+if __name__ == '__main__':
+    unittest.main(verbosity=2)
diff --git a/Lib/idlelib/idle_test/test_formatparagraph.py b/Lib/idlelib/idle_test/test_formatparagraph.py
index f4a7c2d..690c936 100644
--- a/Lib/idlelib/idle_test/test_formatparagraph.py
+++ b/Lib/idlelib/idle_test/test_formatparagraph.py
@@ -293,7 +293,7 @@
         # Set cursor ('insert' mark) to '1.0', within text.
         text.insert('1.0', self.test_string)
         text.mark_set('insert', '1.0')
-        self.formatter('ParameterDoesNothing')
+        self.formatter('ParameterDoesNothing', limit=70)
         result = text.get('1.0', 'insert')
         # find function includes \n
         expected = (
@@ -305,7 +305,7 @@
         # Select from 1.11 to line end.
         text.insert('1.0', self.test_string)
         text.tag_add('sel', '1.11', '1.end')
-        self.formatter('ParameterDoesNothing')
+        self.formatter('ParameterDoesNothing', limit=70)
         result = text.get('1.0', 'insert')
         # selection excludes \n
         expected = (
@@ -319,7 +319,7 @@
         #  Select 2 long lines.
         text.insert('1.0', self.multiline_test_string)
         text.tag_add('sel', '2.0', '4.0')
-        self.formatter('ParameterDoesNothing')
+        self.formatter('ParameterDoesNothing', limit=70)
         result = text.get('2.0', 'insert')
         expected = (
 "    The second line's length is way over the max width. It goes on and\n"
@@ -334,7 +334,7 @@
 
         # Set cursor ('insert') to '1.0', within block.
         text.insert('1.0', self.multiline_test_comment)
-        self.formatter('ParameterDoesNothing')
+        self.formatter('ParameterDoesNothing', limit=70)
         result = text.get('1.0', 'insert')
         expected = (
 "# The first line is under the max width. The second line's length is\n"
@@ -348,7 +348,7 @@
         # Select line 2, verify line 1 unaffected.
         text.insert('1.0', self.multiline_test_comment)
         text.tag_add('sel', '2.0', '3.0')
-        self.formatter('ParameterDoesNothing')
+        self.formatter('ParameterDoesNothing', limit=70)
         result = text.get('1.0', 'insert')
         expected = (
 "# The first line is under the max width.\n"
diff --git a/Lib/idlelib/idle_test/test_hyperparser.py b/Lib/idlelib/idle_test/test_hyperparser.py
new file mode 100644
index 0000000..edfc783
--- /dev/null
+++ b/Lib/idlelib/idle_test/test_hyperparser.py
@@ -0,0 +1,273 @@
+"""Unittest for idlelib.HyperParser"""
+import unittest
+from test.support import requires
+from tkinter import Tk, Text
+from idlelib.EditorWindow import EditorWindow
+from idlelib.HyperParser import HyperParser
+
+class DummyEditwin:
+    def __init__(self, text):
+        self.text = text
+        self.indentwidth = 8
+        self.tabwidth = 8
+        self.context_use_ps1 = True
+        self.num_context_lines = 50, 500, 1000
+
+    _build_char_in_string_func = EditorWindow._build_char_in_string_func
+    is_char_in_string = EditorWindow.is_char_in_string
+
+
+class HyperParserTest(unittest.TestCase):
+    code = (
+            '"""This is a module docstring"""\n'
+            '# this line is a comment\n'
+            'x = "this is a string"\n'
+            "y = 'this is also a string'\n"
+            'l = [i for i in range(10)]\n'
+            'm = [py*py for # comment\n'
+            '       py in l]\n'
+            'x.__len__\n'
+            "z = ((r'asdf')+('a')))\n"
+            '[x for x in\n'
+            'for = False\n'
+            'cliché = "this is a string with unicode, what a cliché"'
+            )
+
+    @classmethod
+    def setUpClass(cls):
+        requires('gui')
+        cls.root = Tk()
+        cls.text = Text(cls.root)
+        cls.editwin = DummyEditwin(cls.text)
+
+    @classmethod
+    def tearDownClass(cls):
+        del cls.text, cls.editwin
+        cls.root.destroy()
+        del cls.root
+
+    def setUp(self):
+        self.text.insert('insert', self.code)
+
+    def tearDown(self):
+        self.text.delete('1.0', 'end')
+        self.editwin.context_use_ps1 = True
+
+    def get_parser(self, index):
+        """
+        Return a parser object with index at 'index'
+        """
+        return HyperParser(self.editwin, index)
+
+    def test_init(self):
+        """
+        test corner cases in the init method
+        """
+        with self.assertRaises(ValueError) as ve:
+            self.text.tag_add('console', '1.0', '1.end')
+            p = self.get_parser('1.5')
+        self.assertIn('precedes', str(ve.exception))
+
+        # test without ps1
+        self.editwin.context_use_ps1 = False
+
+        # number of lines lesser than 50
+        p = self.get_parser('end')
+        self.assertEqual(p.rawtext, self.text.get('1.0', 'end'))
+
+        # number of lines greater than 50
+        self.text.insert('end', self.text.get('1.0', 'end')*4)
+        p = self.get_parser('54.5')
+
+    def test_is_in_string(self):
+        get = self.get_parser
+
+        p = get('1.0')
+        self.assertFalse(p.is_in_string())
+        p = get('1.4')
+        self.assertTrue(p.is_in_string())
+        p = get('2.3')
+        self.assertFalse(p.is_in_string())
+        p = get('3.3')
+        self.assertFalse(p.is_in_string())
+        p = get('3.7')
+        self.assertTrue(p.is_in_string())
+        p = get('4.6')
+        self.assertTrue(p.is_in_string())
+        p = get('12.54')
+        self.assertTrue(p.is_in_string())
+
+    def test_is_in_code(self):
+        get = self.get_parser
+
+        p = get('1.0')
+        self.assertTrue(p.is_in_code())
+        p = get('1.1')
+        self.assertFalse(p.is_in_code())
+        p = get('2.5')
+        self.assertFalse(p.is_in_code())
+        p = get('3.4')
+        self.assertTrue(p.is_in_code())
+        p = get('3.6')
+        self.assertFalse(p.is_in_code())
+        p = get('4.14')
+        self.assertFalse(p.is_in_code())
+
+    def test_get_surrounding_bracket(self):
+        get = self.get_parser
+
+        def without_mustclose(parser):
+            # a utility function to get surrounding bracket
+            # with mustclose=False
+            return parser.get_surrounding_brackets(mustclose=False)
+
+        def with_mustclose(parser):
+            # a utility function to get surrounding bracket
+            # with mustclose=True
+            return parser.get_surrounding_brackets(mustclose=True)
+
+        p = get('3.2')
+        self.assertIsNone(with_mustclose(p))
+        self.assertIsNone(without_mustclose(p))
+
+        p = get('5.6')
+        self.assertTupleEqual(without_mustclose(p), ('5.4', '5.25'))
+        self.assertTupleEqual(without_mustclose(p), with_mustclose(p))
+
+        p = get('5.23')
+        self.assertTupleEqual(without_mustclose(p), ('5.21', '5.24'))
+        self.assertTupleEqual(without_mustclose(p), with_mustclose(p))
+
+        p = get('6.15')
+        self.assertTupleEqual(without_mustclose(p), ('6.4', '6.end'))
+        self.assertIsNone(with_mustclose(p))
+
+        p = get('9.end')
+        self.assertIsNone(with_mustclose(p))
+        self.assertIsNone(without_mustclose(p))
+
+    def test_get_expression(self):
+        get = self.get_parser
+
+        p = get('4.2')
+        self.assertEqual(p.get_expression(), 'y ')
+
+        p = get('4.7')
+        with self.assertRaises(ValueError) as ve:
+            p.get_expression()
+        self.assertIn('is inside a code', str(ve.exception))
+
+        p = get('5.25')
+        self.assertEqual(p.get_expression(), 'range(10)')
+
+        p = get('6.7')
+        self.assertEqual(p.get_expression(), 'py')
+
+        p = get('6.8')
+        self.assertEqual(p.get_expression(), '')
+
+        p = get('7.9')
+        self.assertEqual(p.get_expression(), 'py')
+
+        p = get('8.end')
+        self.assertEqual(p.get_expression(), 'x.__len__')
+
+        p = get('9.13')
+        self.assertEqual(p.get_expression(), "r'asdf'")
+
+        p = get('9.17')
+        with self.assertRaises(ValueError) as ve:
+            p.get_expression()
+        self.assertIn('is inside a code', str(ve.exception))
+
+        p = get('10.0')
+        self.assertEqual(p.get_expression(), '')
+
+        p = get('10.6')
+        self.assertEqual(p.get_expression(), '')
+
+        p = get('10.11')
+        self.assertEqual(p.get_expression(), '')
+
+        p = get('11.3')
+        self.assertEqual(p.get_expression(), '')
+
+        p = get('11.11')
+        self.assertEqual(p.get_expression(), 'False')
+
+        p = get('12.6')
+        self.assertEqual(p.get_expression(), 'cliché')
+
+    def test_eat_identifier(self):
+        def is_valid_id(candidate):
+            result = HyperParser._eat_identifier(candidate, 0, len(candidate))
+            if result == len(candidate):
+                return True
+            elif result == 0:
+                return False
+            else:
+                err_msg = "Unexpected result: {} (expected 0 or {}".format(
+                    result, len(candidate)
+                )
+                raise Exception(err_msg)
+
+        # invalid first character which is valid elsewhere in an identifier
+        self.assertFalse(is_valid_id('2notid'))
+
+        # ASCII-only valid identifiers
+        self.assertTrue(is_valid_id('valid_id'))
+        self.assertTrue(is_valid_id('_valid_id'))
+        self.assertTrue(is_valid_id('valid_id_'))
+        self.assertTrue(is_valid_id('_2valid_id'))
+
+        # keywords which should be "eaten"
+        self.assertTrue(is_valid_id('True'))
+        self.assertTrue(is_valid_id('False'))
+        self.assertTrue(is_valid_id('None'))
+
+        # keywords which should not be "eaten"
+        self.assertFalse(is_valid_id('for'))
+        self.assertFalse(is_valid_id('import'))
+        self.assertFalse(is_valid_id('return'))
+
+        # valid unicode identifiers
+        self.assertTrue(is_valid_id('cliche'))
+        self.assertTrue(is_valid_id('cliché'))
+        self.assertTrue(is_valid_id('a٢'))
+
+        # invalid unicode identifiers
+        self.assertFalse(is_valid_id('2a'))
+        self.assertFalse(is_valid_id('٢a'))
+        self.assertFalse(is_valid_id('a²'))
+
+        # valid identifier after "punctuation"
+        self.assertEqual(HyperParser._eat_identifier('+ var', 0, 5), len('var'))
+        self.assertEqual(HyperParser._eat_identifier('+var', 0, 4), len('var'))
+        self.assertEqual(HyperParser._eat_identifier('.var', 0, 4), len('var'))
+
+        # invalid identifiers
+        self.assertFalse(is_valid_id('+'))
+        self.assertFalse(is_valid_id(' '))
+        self.assertFalse(is_valid_id(':'))
+        self.assertFalse(is_valid_id('?'))
+        self.assertFalse(is_valid_id('^'))
+        self.assertFalse(is_valid_id('\\'))
+        self.assertFalse(is_valid_id('"'))
+        self.assertFalse(is_valid_id('"a string"'))
+
+    def test_eat_identifier_various_lengths(self):
+        eat_id = HyperParser._eat_identifier
+
+        for length in range(1, 21):
+            self.assertEqual(eat_id('a' * length, 0, length), length)
+            self.assertEqual(eat_id('é' * length, 0, length), length)
+            self.assertEqual(eat_id('a' + '2' * (length - 1), 0, length), length)
+            self.assertEqual(eat_id('é' + '2' * (length - 1), 0, length), length)
+            self.assertEqual(eat_id('é' + 'a' * (length - 1), 0, length), length)
+            self.assertEqual(eat_id('é' * (length - 1) + 'a', 0, length), length)
+            self.assertEqual(eat_id('+' * length, 0, length), 0)
+            self.assertEqual(eat_id('2' + 'a' * (length - 1), 0, length), 0)
+            self.assertEqual(eat_id('2' + 'é' * (length - 1), 0, length), 0)
+
+if __name__ == '__main__':
+    unittest.main(verbosity=2)
diff --git a/Lib/idlelib/idle_test/test_parenmatch.py b/Lib/idlelib/idle_test/test_parenmatch.py
new file mode 100644
index 0000000..9aba4be
--- /dev/null
+++ b/Lib/idlelib/idle_test/test_parenmatch.py
@@ -0,0 +1,109 @@
+"""Test idlelib.ParenMatch."""
+# This must currently be a gui test because ParenMatch methods use
+# several text methods not defined on idlelib.idle_test.mock_tk.Text.
+
+import unittest
+from unittest.mock import Mock
+from test.support import requires
+from tkinter import Tk, Text
+from idlelib.ParenMatch import ParenMatch
+
+class DummyEditwin:
+    def __init__(self, text):
+        self.text = text
+        self.indentwidth = 8
+        self.tabwidth = 8
+        self.context_use_ps1 = True
+
+
+class ParenMatchTest(unittest.TestCase):
+
+    @classmethod
+    def setUpClass(cls):
+        requires('gui')
+        cls.root = Tk()
+        cls.text = Text(cls.root)
+        cls.editwin = DummyEditwin(cls.text)
+        cls.editwin.text_frame = Mock()
+
+    @classmethod
+    def tearDownClass(cls):
+        del cls.text, cls.editwin
+        cls.root.destroy()
+        del cls.root
+
+    def tearDown(self):
+        self.text.delete('1.0', 'end')
+
+    def test_paren_expression(self):
+        """
+        Test ParenMatch with 'expression' style.
+        """
+        text = self.text
+        pm = ParenMatch(self.editwin)
+        pm.set_style('expression')
+
+        text.insert('insert', 'def foobar(a, b')
+        pm.flash_paren_event('event')
+        self.assertIn('<<parenmatch-check-restore>>', text.event_info())
+        self.assertTupleEqual(text.tag_prevrange('paren', 'end'),
+                             ('1.10', '1.15'))
+        text.insert('insert', ')')
+        pm.restore_event()
+        self.assertNotIn('<<parenmatch-check-restore>>', text.event_info())
+        self.assertEqual(text.tag_prevrange('paren', 'end'), ())
+
+        # paren_closed_event can only be tested as below
+        pm.paren_closed_event('event')
+        self.assertTupleEqual(text.tag_prevrange('paren', 'end'),
+                                                ('1.10', '1.16'))
+
+    def test_paren_default(self):
+        """
+        Test ParenMatch with 'default' style.
+        """
+        text = self.text
+        pm = ParenMatch(self.editwin)
+        pm.set_style('default')
+
+        text.insert('insert', 'def foobar(a, b')
+        pm.flash_paren_event('event')
+        self.assertIn('<<parenmatch-check-restore>>', text.event_info())
+        self.assertTupleEqual(text.tag_prevrange('paren', 'end'),
+                             ('1.10', '1.11'))
+        text.insert('insert', ')')
+        pm.restore_event()
+        self.assertNotIn('<<parenmatch-check-restore>>', text.event_info())
+        self.assertEqual(text.tag_prevrange('paren', 'end'), ())
+
+    def test_paren_corner(self):
+        """
+        Test corner cases in flash_paren_event and paren_closed_event.
+
+        These cases force conditional expression and alternate paths.
+        """
+        text = self.text
+        pm = ParenMatch(self.editwin)
+
+        text.insert('insert', '# this is a commen)')
+        self.assertIsNone(pm.paren_closed_event('event'))
+
+        text.insert('insert', '\ndef')
+        self.assertIsNone(pm.flash_paren_event('event'))
+        self.assertIsNone(pm.paren_closed_event('event'))
+
+        text.insert('insert', ' a, *arg)')
+        self.assertIsNone(pm.paren_closed_event('event'))
+
+    def test_handle_restore_timer(self):
+        pm = ParenMatch(self.editwin)
+        pm.restore_event = Mock()
+        pm.handle_restore_timer(0)
+        self.assertTrue(pm.restore_event.called)
+        pm.restore_event.reset_mock()
+        pm.handle_restore_timer(1)
+        self.assertFalse(pm.restore_event.called)
+
+
+if __name__ == '__main__':
+    unittest.main(verbosity=2)
diff --git a/Lib/idlelib/idle_test/test_searchdialogbase.py b/Lib/idlelib/idle_test/test_searchdialogbase.py
new file mode 100644
index 0000000..eccdd47
--- /dev/null
+++ b/Lib/idlelib/idle_test/test_searchdialogbase.py
@@ -0,0 +1,165 @@
+'''Unittests for idlelib/SearchDialogBase.py
+
+Coverage: 99%. The only thing not covered is inconsequential --
+testing skipping of suite when self.needwrapbutton is false.
+
+'''
+import unittest
+from test.support import requires
+from tkinter import Tk, Toplevel, Frame, Label, BooleanVar, StringVar
+from idlelib import SearchEngine as se
+from idlelib import SearchDialogBase as sdb
+from idlelib.idle_test.mock_idle import Func
+from idlelib.idle_test.mock_tk import Var, Mbox
+
+# The following could help make some tests gui-free.
+# However, they currently make radiobutton tests fail.
+##def setUpModule():
+##    # Replace tk objects used to initialize se.SearchEngine.
+##    se.BooleanVar = Var
+##    se.StringVar = Var
+##
+##def tearDownModule():
+##    se.BooleanVar = BooleanVar
+##    se.StringVar = StringVar
+
+class SearchDialogBaseTest(unittest.TestCase):
+
+    @classmethod
+    def setUpClass(cls):
+        requires('gui')
+        cls.root = Tk()
+
+    @classmethod
+    def tearDownClass(cls):
+        cls.root.destroy()
+        del cls.root
+
+    def setUp(self):
+        self.engine = se.SearchEngine(self.root)  # None also seems to work
+        self.dialog = sdb.SearchDialogBase(root=self.root, engine=self.engine)
+
+    def tearDown(self):
+        self.dialog.close()
+
+    def test_open_and_close(self):
+        # open calls create_widgets, which needs default_command
+        self.dialog.default_command = None
+
+        # Since text parameter of .open is not used in base class,
+        # pass dummy 'text' instead of tk.Text().
+        self.dialog.open('text')
+        self.assertEqual(self.dialog.top.state(), 'normal')
+        self.dialog.close()
+        self.assertEqual(self.dialog.top.state(), 'withdrawn')
+
+        self.dialog.open('text', searchphrase="hello")
+        self.assertEqual(self.dialog.ent.get(), 'hello')
+        self.dialog.close()
+
+    def test_create_widgets(self):
+        self.dialog.create_entries = Func()
+        self.dialog.create_option_buttons = Func()
+        self.dialog.create_other_buttons = Func()
+        self.dialog.create_command_buttons = Func()
+
+        self.dialog.default_command = None
+        self.dialog.create_widgets()
+
+        self.assertTrue(self.dialog.create_entries.called)
+        self.assertTrue(self.dialog.create_option_buttons.called)
+        self.assertTrue(self.dialog.create_other_buttons.called)
+        self.assertTrue(self.dialog.create_command_buttons.called)
+
+    def test_make_entry(self):
+        equal = self.assertEqual
+        self.dialog.row = 0
+        self.dialog.top = Toplevel(self.root)
+        entry, label = self.dialog.make_entry("Test:", 'hello')
+        equal(label['text'], 'Test:')
+
+        self.assertIn(entry.get(), 'hello')
+        egi = entry.grid_info()
+        equal(int(egi['row']), 0)
+        equal(int(egi['column']), 1)
+        equal(int(egi['rowspan']), 1)
+        equal(int(egi['columnspan']), 1)
+        equal(self.dialog.row, 1)
+
+    def test_create_entries(self):
+        self.dialog.row = 0
+        self.engine.setpat('hello')
+        self.dialog.create_entries()
+        self.assertIn(self.dialog.ent.get(), 'hello')
+
+    def test_make_frame(self):
+        self.dialog.row = 0
+        self.dialog.top = Toplevel(self.root)
+        frame, label = self.dialog.make_frame()
+        self.assertEqual(label, '')
+        self.assertIsInstance(frame, Frame)
+
+        frame, label = self.dialog.make_frame('testlabel')
+        self.assertEqual(label['text'], 'testlabel')
+        self.assertIsInstance(frame, Frame)
+
+    def btn_test_setup(self, meth):
+        self.dialog.top = Toplevel(self.root)
+        self.dialog.row = 0
+        return meth()
+
+    def test_create_option_buttons(self):
+        e = self.engine
+        for state in (0, 1):
+            for var in (e.revar, e.casevar, e.wordvar, e.wrapvar):
+                var.set(state)
+            frame, options = self.btn_test_setup(
+                    self.dialog.create_option_buttons)
+            for spec, button in zip (options, frame.pack_slaves()):
+                var, label = spec
+                self.assertEqual(button['text'], label)
+                self.assertEqual(var.get(), state)
+                if state == 1:
+                    button.deselect()
+                else:
+                    button.select()
+                self.assertEqual(var.get(), 1 - state)
+
+    def test_create_other_buttons(self):
+        for state in (False, True):
+            var = self.engine.backvar
+            var.set(state)
+            frame, others = self.btn_test_setup(
+                self.dialog.create_other_buttons)
+            buttons = frame.pack_slaves()
+            for spec, button in zip(others, buttons):
+                val, label = spec
+                self.assertEqual(button['text'], label)
+                if val == state:
+                    # hit other button, then this one
+                    # indexes depend on button order
+                    self.assertEqual(var.get(), state)
+                    buttons[val].select()
+                    self.assertEqual(var.get(), 1 - state)
+                    buttons[1-val].select()
+                    self.assertEqual(var.get(), state)
+
+    def test_make_button(self):
+        self.dialog.top = Toplevel(self.root)
+        self.dialog.buttonframe = Frame(self.dialog.top)
+        btn = self.dialog.make_button('Test', self.dialog.close)
+        self.assertEqual(btn['text'], 'Test')
+
+    def test_create_command_buttons(self):
+        self.dialog.create_command_buttons()
+        # Look for close button command in buttonframe
+        closebuttoncommand = ''
+        for child in self.dialog.buttonframe.winfo_children():
+            if child['text'] == 'close':
+                closebuttoncommand = child['command']
+        self.assertIn('close', closebuttoncommand)
+
+
+
+if __name__ == '__main__':
+    unittest.main(verbosity=2, exit=2)
diff --git a/Lib/idlelib/idle_test/test_textview.py b/Lib/idlelib/idle_test/test_textview.py
new file mode 100644
index 0000000..68e5b82
--- /dev/null
+++ b/Lib/idlelib/idle_test/test_textview.py
@@ -0,0 +1,97 @@
+'''Test the functions and main class method of textView.py.
+
+Since all methods and functions create (or destroy) a TextViewer, which
+is a widget containing multiple widgets, all tests must be gui tests.
+Using mock Text would not change this.  Other mocks are used to retrieve
+information about calls.
+
+The coverage is essentially 100%.
+'''
+from test.support import requires
+requires('gui')
+
+import unittest
+import os
+from tkinter import Tk
+from idlelib import textView as tv
+from idlelib.idle_test.mock_idle import Func
+from idlelib.idle_test.mock_tk import Mbox
+
+def setUpModule():
+    global root
+    root = Tk()
+
+def tearDownModule():
+    global root
+    root.destroy()  # pyflakes falsely sees root as undefined
+    del root
+
+
+class TV(tv.TextViewer):  # used by TextViewTest
+    transient = Func()
+    grab_set = Func()
+    wait_window = Func()
+
+class TextViewTest(unittest.TestCase):
+
+    def setUp(self):
+        TV.transient.__init__()
+        TV.grab_set.__init__()
+        TV.wait_window.__init__()
+
+    def test_init_modal(self):
+        view = TV(root, 'Title', 'test text')
+        self.assertTrue(TV.transient.called)
+        self.assertTrue(TV.grab_set.called)
+        self.assertTrue(TV.wait_window.called)
+        view.Ok()
+
+    def test_init_nonmodal(self):
+        view = TV(root, 'Title', 'test text', modal=False)
+        self.assertFalse(TV.transient.called)
+        self.assertFalse(TV.grab_set.called)
+        self.assertFalse(TV.wait_window.called)
+        view.Ok()
+
+    def test_ok(self):
+        view = TV(root, 'Title', 'test text', modal=False)
+        view.destroy = Func()
+        view.Ok()
+        self.assertTrue(view.destroy.called)
+        del view.destroy  # unmask real function
+        view.destroy
+
+
+class textviewTest(unittest.TestCase):
+
+    @classmethod
+    def setUpClass(cls):
+        cls.orig_mbox = tv.tkMessageBox
+        tv.tkMessageBox = Mbox
+
+    @classmethod
+    def tearDownClass(cls):
+        tv.tkMessageBox = cls.orig_mbox
+        del cls.orig_mbox
+
+    def test_view_text(self):
+        # If modal True, tkinter will error with 'can't invoke "event" command'
+        view = tv.view_text(root, 'Title', 'test text', modal=False)
+        self.assertIsInstance(view, tv.TextViewer)
+
+    def test_view_file(self):
+        test_dir = os.path.dirname(__file__)
+        testfile = os.path.join(test_dir, 'test_textview.py')
+        view = tv.view_file(root, 'Title', testfile, modal=False)
+        self.assertIsInstance(view, tv.TextViewer)
+        self.assertIn('Test', view.textView.get('1.0', '1.end'))
+        view.Ok()
+
+        # Mock messagebox will be used and view_file will not return anything
+        testfile = os.path.join(test_dir, '../notthere.py')
+        view = tv.view_file(root, 'Title', testfile, modal=False)
+        self.assertIsNone(view)
+
+
+if __name__ == '__main__':
+    unittest.main(verbosity=2)
diff --git a/Lib/idlelib/idle_test/test_widgetredir.py b/Lib/idlelib/idle_test/test_widgetredir.py
new file mode 100644
index 0000000..6440561
--- /dev/null
+++ b/Lib/idlelib/idle_test/test_widgetredir.py
@@ -0,0 +1,122 @@
+"""Unittest for idlelib.WidgetRedirector
+
+100% coverage
+"""
+from test.support import requires
+import unittest
+from idlelib.idle_test.mock_idle import Func
+from tkinter import Tk, Text, TclError
+from idlelib.WidgetRedirector import WidgetRedirector
+
+
+class InitCloseTest(unittest.TestCase):
+
+    @classmethod
+    def setUpClass(cls):
+        requires('gui')
+        cls.tk = Tk()
+        cls.text = Text(cls.tk)
+
+    @classmethod
+    def tearDownClass(cls):
+        cls.text.destroy()
+        cls.tk.destroy()
+        del cls.text, cls.tk
+
+    def test_init(self):
+        redir = WidgetRedirector(self.text)
+        self.assertEqual(redir.widget, self.text)
+        self.assertEqual(redir.tk, self.text.tk)
+        self.assertRaises(TclError, WidgetRedirector, self.text)
+        redir.close()  # restore self.tk, self.text
+
+    def test_close(self):
+        redir = WidgetRedirector(self.text)
+        redir.register('insert', Func)
+        redir.close()
+        self.assertEqual(redir._operations, {})
+        self.assertFalse(hasattr(self.text, 'widget'))
+
+
+class WidgetRedirectorTest(unittest.TestCase):
+
+    @classmethod
+    def setUpClass(cls):
+        requires('gui')
+        cls.tk = Tk()
+        cls.text = Text(cls.tk)
+
+    @classmethod
+    def tearDownClass(cls):
+        cls.text.destroy()
+        cls.tk.destroy()
+        del cls.text, cls.tk
+
+    def setUp(self):
+        self.redir = WidgetRedirector(self.text)
+        self.func = Func()
+        self.orig_insert = self.redir.register('insert', self.func)
+        self.text.insert('insert', 'asdf')  # leaves self.text empty
+
+    def tearDown(self):
+        self.text.delete('1.0', 'end')
+        self.redir.close()
+
+    def test_repr(self):  # partly for 100% coverage
+        self.assertIn('Redirector', repr(self.redir))
+        self.assertIn('Original', repr(self.orig_insert))
+
+    def test_register(self):
+        self.assertEqual(self.text.get('1.0', 'end'), '\n')
+        self.assertEqual(self.func.args, ('insert', 'asdf'))
+        self.assertIn('insert', self.redir._operations)
+        self.assertIn('insert', self.text.__dict__)
+        self.assertEqual(self.text.insert, self.func)
+
+    def test_original_command(self):
+        self.assertEqual(self.orig_insert.operation, 'insert')
+        self.assertEqual(self.orig_insert.tk_call, self.text.tk.call)
+        self.orig_insert('insert', 'asdf')
+        self.assertEqual(self.text.get('1.0', 'end'), 'asdf\n')
+
+    def test_unregister(self):
+        self.assertIsNone(self.redir.unregister('invalid operation name'))
+        self.assertEqual(self.redir.unregister('insert'), self.func)
+        self.assertNotIn('insert', self.redir._operations)
+        self.assertNotIn('insert', self.text.__dict__)
+
+    def test_unregister_no_attribute(self):
+        del self.text.insert
+        self.assertEqual(self.redir.unregister('insert'), self.func)
+
+    def test_dispatch_intercept(self):
+        self.func.__init__(True)
+        self.assertTrue(self.redir.dispatch('insert', False))
+        self.assertFalse(self.func.args[0])
+
+    def test_dispatch_bypass(self):
+        self.orig_insert('insert', 'asdf')
+        # tk.call returns '' where Python would return None
+        self.assertEqual(self.redir.dispatch('delete', '1.0', 'end'), '')
+        self.assertEqual(self.text.get('1.0', 'end'), '\n')
+
+    def test_dispatch_error(self):
+        self.func.__init__(TclError())
+        self.assertEqual(self.redir.dispatch('insert', False), '')
+        self.assertEqual(self.redir.dispatch('invalid'), '')
+
+    def test_command_dispatch(self):
+        # Test that .__init__ causes redirection of tk calls
+        # through redir.dispatch
+        self.tk.call(self.text._w, 'insert', 'hello')
+        self.assertEqual(self.func.args, ('hello',))
+        self.assertEqual(self.text.get('1.0', 'end'), '\n')
+        # Ensure that called through redir .dispatch and not through
+        # self.text.insert by having mock raise TclError.
+        self.func.__init__(TclError())
+        self.assertEqual(self.tk.call(self.text._w, 'insert', 'boo'), '')
+
+
+
+if __name__ == '__main__':
+    unittest.main(verbosity=2)
diff --git a/Lib/idlelib/idlever.py b/Lib/idlelib/idlever.py
index 9ad7d89..40f8cef 100644
--- a/Lib/idlelib/idlever.py
+++ b/Lib/idlelib/idlever.py
@@ -1 +1 @@
-IDLE_VERSION = "3.3.6"
+IDLE_VERSION = "3.4.2"
diff --git a/Lib/idlelib/keybindingDialog.py b/Lib/idlelib/keybindingDialog.py
index 0f0da8c..e6438bf 100644
--- a/Lib/idlelib/keybindingDialog.py
+++ b/Lib/idlelib/keybindingDialog.py
@@ -4,15 +4,16 @@
 from tkinter import *
 import tkinter.messagebox as tkMessageBox
 import string
-from idlelib import macosxSupport
+import sys
 
 class GetKeysDialog(Toplevel):
-    def __init__(self,parent,title,action,currentKeySequences):
+    def __init__(self,parent,title,action,currentKeySequences,_htest=False):
         """
         action - string, the name of the virtual event these keys will be
                  mapped to
         currentKeys - list, a list of all key sequence lists currently mapped
                  to virtual events, for overlap checking
+        _htest - bool, change box location when running htest
         """
         Toplevel.__init__(self, parent)
         self.configure(borderwidth=5)
@@ -38,11 +39,14 @@
         self.LoadFinalKeyList()
         self.withdraw() #hide while setting geometry
         self.update_idletasks()
-        self.geometry("+%d+%d" %
-            ((parent.winfo_rootx()+((parent.winfo_width()/2)
-                -(self.winfo_reqwidth()/2)),
-              parent.winfo_rooty()+((parent.winfo_height()/2)
-                -(self.winfo_reqheight()/2)) )) ) #centre dialog over parent
+        self.geometry(
+                "+%d+%d" % (
+                    parent.winfo_rootx() +
+                    (parent.winfo_width()/2 - self.winfo_reqwidth()/2),
+                    parent.winfo_rooty() +
+                    ((parent.winfo_height()/2 - self.winfo_reqheight()/2)
+                    if not _htest else 150)
+                ) )  #centre dialog over parent (or below htest box)
         self.deiconify() #geometry set, unhide
         self.wait_window()
 
@@ -133,8 +137,7 @@
         order is also important: key binding equality depends on it, so
         config-keys.def must use the same ordering.
         """
-        import sys
-        if macosxSupport.runningAsOSXApp():
+        if sys.platform == "darwin":
             self.modifiers = ['Shift', 'Control', 'Option', 'Command']
         else:
             self.modifiers = ['Control', 'Alt', 'Shift']
@@ -259,11 +262,5 @@
         return keysOK
 
 if __name__ == '__main__':
-    #test the dialog
-    root=Tk()
-    def run():
-        keySeq=''
-        dlg=GetKeysDialog(root,'Get Keys','find-again',[])
-        print(dlg.result)
-    Button(root,text='Dialog',command=run).pack()
-    root.mainloop()
+    from idlelib.idle_test.htest import run
+    run(GetKeysDialog)
diff --git a/Lib/idlelib/macosxSupport.py b/Lib/idlelib/macosxSupport.py
index 67069fa..65bd688 100644
--- a/Lib/idlelib/macosxSupport.py
+++ b/Lib/idlelib/macosxSupport.py
@@ -1,48 +1,70 @@
 """
-A number of function that enhance IDLE on MacOSX when it used as a normal
-GUI application (as opposed to an X11 application).
+A number of functions that enhance IDLE on Mac OSX.
 """
 import sys
 import tkinter
 from os import path
-
-
-_appbundle = None
+import warnings
 
 def runningAsOSXApp():
-    """
-    Returns True if Python is running from within an app on OSX.
-    If so, the various OS X customizations will be triggered later (menu
-    fixup, et al).  (Originally, this test was supposed to condition
-    behavior on whether IDLE was running under Aqua Tk rather than
-    under X11 Tk but that does not work since a framework build
-    could be linked with X11.  For several releases, this test actually
-    differentiates between whether IDLE is running from a framework or
-    not.  As a future enhancement, it should be considered whether there
-    should be a difference based on framework and any needed X11 adaptions
-    should be made dependent on a new function that actually tests for X11.)
-    """
-    global _appbundle
-    if _appbundle is None:
-        _appbundle = sys.platform == 'darwin'
-        if _appbundle:
-            import sysconfig
-            _appbundle = bool(sysconfig.get_config_var('PYTHONFRAMEWORK'))
-    return _appbundle
-
-_carbonaquatk = None
+    warnings.warn("runningAsOSXApp() is deprecated, use isAquaTk()",
+                        DeprecationWarning, stacklevel=2)
+    return isAquaTk()
 
 def isCarbonAquaTk(root):
+    warnings.warn("isCarbonAquaTk(root) is deprecated, use isCarbonTk()",
+                        DeprecationWarning, stacklevel=2)
+    return isCarbonTk()
+
+_tk_type = None
+
+def _initializeTkVariantTests(root):
+    """
+    Initializes OS X Tk variant values for
+    isAquaTk(), isCarbonTk(), isCocoaTk(), and isXQuartz().
+    """
+    global _tk_type
+    if sys.platform == 'darwin':
+        ws = root.tk.call('tk', 'windowingsystem')
+        if 'x11' in ws:
+            _tk_type = "xquartz"
+        elif 'aqua' not in ws:
+            _tk_type = "other"
+        elif 'AppKit' in root.tk.call('winfo', 'server', '.'):
+            _tk_type = "cocoa"
+        else:
+            _tk_type = "carbon"
+    else:
+        _tk_type = "other"
+
+def isAquaTk():
+    """
+    Returns True if IDLE is using a native OS X Tk (Cocoa or Carbon).
+    """
+    assert _tk_type is not None
+    return _tk_type == "cocoa" or _tk_type == "carbon"
+
+def isCarbonTk():
     """
     Returns True if IDLE is using a Carbon Aqua Tk (instead of the
     newer Cocoa Aqua Tk).
     """
-    global _carbonaquatk
-    if _carbonaquatk is None:
-        _carbonaquatk = (runningAsOSXApp() and
-                         'aqua' in root.tk.call('tk', 'windowingsystem') and
-                         'AppKit' not in root.tk.call('winfo', 'server', '.'))
-    return _carbonaquatk
+    assert _tk_type is not None
+    return _tk_type == "carbon"
+
+def isCocoaTk():
+    """
+    Returns True if IDLE is using a Cocoa Aqua Tk.
+    """
+    assert _tk_type is not None
+    return _tk_type == "cocoa"
+
+def isXQuartz():
+    """
+    Returns True if IDLE is using an OS X X11 Tk.
+    """
+    assert _tk_type is not None
+    return _tk_type == "xquartz"
 
 def tkVersionWarning(root):
     """
@@ -53,8 +75,7 @@
         can still crash unexpectedly.
     """
 
-    if (runningAsOSXApp() and
-            ('AppKit' in root.tk.call('winfo', 'server', '.')) ):
+    if isCocoaTk():
         patchlevel = root.tk.call('info', 'patchlevel')
         if patchlevel not in ('8.5.7', '8.5.9'):
             return False
@@ -88,8 +109,8 @@
 
 def overrideRootMenu(root, flist):
     """
-    Replace the Tk root menu by something that's more appropriate for
-    IDLE.
+    Replace the Tk root menu by something that is more appropriate for
+    IDLE with an Aqua Tk.
     """
     # The menu that is attached to the Tk root (".") is also used by AquaTk for
     # all windows that don't specify a menu of their own. The default menubar
@@ -108,6 +129,20 @@
     from idlelib import WindowList
     from idlelib.MultiCall import MultiCallCreator
 
+    closeItem = Bindings.menudefs[0][1][-2]
+
+    # Remove the last 3 items of the file menu: a separator, close window and
+    # quit. Close window will be reinserted just above the save item, where
+    # it should be according to the HIG. Quit is in the application menu.
+    del Bindings.menudefs[0][1][-3:]
+    Bindings.menudefs[0][1].insert(6, closeItem)
+
+    # Remove the 'About' entry from the help menu, it is in the application
+    # menu
+    del Bindings.menudefs[-1][1][0:2]
+    # Remove the 'Configure Idle' entry from the options menu, it is in the
+    # application menu as 'Preferences'
+    del Bindings.menudefs[-2][1][0]
     menubar = Menu(root)
     root.configure(menu=menubar)
     menudict = {}
@@ -156,7 +191,7 @@
         # right thing for now.
         root.createcommand('exit', flist.close_all_callback)
 
-    if isCarbonAquaTk(root):
+    if isCarbonTk():
         # for Carbon AquaTk, replace the default Tk apple menu
         menudict['application'] = menu = Menu(menubar, name='apple')
         menubar.add_cascade(label='IDLE', menu=menu)
@@ -171,8 +206,7 @@
             Bindings.menudefs[0][1].append(
                     ('_Preferences....', '<<open-config-dialog>>'),
                 )
-    else:
-        # assume Cocoa AquaTk
+    if isCocoaTk():
         # replace default About dialog with About IDLE one
         root.createcommand('tkAboutDialog', about_dialog)
         # replace default "Help" item in Help menu
@@ -182,10 +216,22 @@
 
 def setupApp(root, flist):
     """
-    Perform setup for the OSX application bundle.
-    """
-    if not runningAsOSXApp(): return
+    Perform initial OS X customizations if needed.
+    Called from PyShell.main() after initial calls to Tk()
 
-    hideTkConsole(root)
-    overrideRootMenu(root, flist)
-    addOpenEventSupport(root, flist)
+    There are currently three major versions of Tk in use on OS X:
+        1. Aqua Cocoa Tk (native default since OS X 10.6)
+        2. Aqua Carbon Tk (original native, 32-bit only, deprecated)
+        3. X11 (supported by some third-party distributors, deprecated)
+    There are various differences among the three that affect IDLE
+    behavior, primarily with menus, mouse key events, and accelerators.
+    Some one-time customizations are performed here.
+    Others are dynamically tested throughout idlelib by calls to the
+    isAquaTk(), isCarbonTk(), isCocoaTk(), isXQuartz() functions which
+    are initialized here as well.
+    """
+    _initializeTkVariantTests(root)
+    if isAquaTk():
+        hideTkConsole(root)
+        overrideRootMenu(root, flist)
+        addOpenEventSupport(root, flist)
diff --git a/Lib/idlelib/rpc.py b/Lib/idlelib/rpc.py
index ddce6e9..f2aae51 100644
--- a/Lib/idlelib/rpc.py
+++ b/Lib/idlelib/rpc.py
@@ -29,6 +29,7 @@
 
 import sys
 import os
+import io
 import socket
 import select
 import socketserver
@@ -53,16 +54,15 @@
     ms = marshal.dumps(co)
     return unpickle_code, (ms,)
 
-# XXX KBK 24Aug02 function pickling capability not used in Idle
-#  def unpickle_function(ms):
-#      return ms
+def dumps(obj, protocol=None):
+    f = io.BytesIO()
+    p = CodePickler(f, protocol)
+    p.dump(obj)
+    return f.getvalue()
 
-#  def pickle_function(fn):
-#      assert isinstance(fn, type.FunctionType)
-#      return repr(fn)
-
-copyreg.pickle(types.CodeType, pickle_code, unpickle_code)
-# copyreg.pickle(types.FunctionType, pickle_function, unpickle_function)
+class CodePickler(pickle.Pickler):
+    dispatch_table = {types.CodeType: pickle_code}
+    dispatch_table.update(copyreg.dispatch_table)
 
 BUFSIZE = 8*1024
 LOCALHOST = '127.0.0.1'
@@ -199,7 +199,7 @@
             raise
         except KeyboardInterrupt:
             raise
-        except socket.error:
+        except OSError:
             raise
         except Exception as ex:
             return ("CALLEXC", ex)
@@ -329,7 +329,7 @@
     def putmessage(self, message):
         self.debug("putmessage:%d:" % message[0])
         try:
-            s = pickle.dumps(message)
+            s = dumps(message)
         except pickle.PicklingError:
             print("Cannot pickle:", repr(message), file=sys.__stderr__)
             raise
@@ -340,7 +340,7 @@
                 n = self.sock.send(s[:BUFSIZE])
             except (AttributeError, TypeError):
                 raise OSError("socket no longer exists")
-            except socket.error:
+            except OSError:
                 raise
             else:
                 s = s[n:]
@@ -357,7 +357,7 @@
                 return None
             try:
                 s = self.sock.recv(BUFSIZE)
-            except socket.error:
+            except OSError:
                 raise EOFError
             if len(s) == 0:
                 raise EOFError
@@ -537,7 +537,7 @@
             SocketIO.__init__(self, working_sock)
         else:
             print("** Invalid host: ", address, file=sys.__stderr__)
-            raise socket.error
+            raise OSError
 
     def get_remote_proxy(self, oid):
         return RPCProxy(self, oid)
diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py
index c1859b6..13cec62 100644
--- a/Lib/idlelib/run.py
+++ b/Lib/idlelib/run.py
@@ -150,8 +150,8 @@
         try:
             server = MyRPCServer(address, MyHandler)
             break
-        except socket.error as err:
-            print("IDLE Subprocess: socket error: " + err.args[1] +
+        except OSError as err:
+            print("IDLE Subprocess: OSError: " + err.args[1] +
                   ", retrying....", file=sys.__stderr__)
             socket_error = err
     else:
diff --git a/Lib/idlelib/tabbedpages.py b/Lib/idlelib/tabbedpages.py
index 2557732..965f9f8 100644
--- a/Lib/idlelib/tabbedpages.py
+++ b/Lib/idlelib/tabbedpages.py
@@ -467,9 +467,12 @@
 
         self._tab_set.set_selected_tab(page_name)
 
-if __name__ == '__main__':
+def _tabbed_pages(parent):
     # test dialog
     root=Tk()
+    width, height, x, y = list(map(int, re.split('[x+]', parent.geometry())))
+    root.geometry("+%d+%d"%(x, y + 175))
+    root.title("Test tabbed pages")
     tabPage=TabbedPageSet(root, page_names=['Foobar','Baz'], n_rows=0,
                           expand_tabs=False,
                           )
@@ -488,3 +491,8 @@
     labelPgName.pack(padx=5)
     entryPgName.pack(padx=5)
     root.mainloop()
+
+
+if __name__ == '__main__':
+    from idlelib.idle_test.htest import run
+    run(_tabbed_pages)
diff --git a/Lib/idlelib/testcode.py b/Lib/idlelib/testcode.py
deleted file mode 100644
index 05eaa56..0000000
--- a/Lib/idlelib/testcode.py
+++ /dev/null
@@ -1,31 +0,0 @@
-import string
-
-def f():
-    a = 0
-    b = 1
-    c = 2
-    d = 3
-    e = 4
-    g()
-
-def g():
-    h()
-
-def h():
-    i()
-
-def i():
-    j()
-
-def j():
-    k()
-
-def k():
-    l()
-
-l = lambda: test()
-
-def test():
-    string.capwords(1)
-
-f()
diff --git a/Lib/idlelib/textView.py b/Lib/idlelib/textView.py
index dd50544..4257eea 100644
--- a/Lib/idlelib/textView.py
+++ b/Lib/idlelib/textView.py
@@ -9,15 +9,21 @@
     """A simple text viewer dialog for IDLE
 
     """
-    def __init__(self, parent, title, text, modal=True):
+    def __init__(self, parent, title, text, modal=True, _htest=False):
         """Show the given text in a scrollable window with a 'close' button
 
+        If modal option set to False, user can interact with other windows,
+        otherwise they will be unable to interact with other windows until
+        the textview window is closed.
+
+        _htest - bool; change box location when running htest.
         """
         Toplevel.__init__(self, parent)
         self.configure(borderwidth=5)
+        # place dialog below parent if running htest
         self.geometry("=%dx%d+%d+%d" % (625, 500,
-                                        parent.winfo_rootx() + 10,
-                                        parent.winfo_rooty() + 10))
+                           parent.winfo_rootx() + 10,
+                           parent.winfo_rooty() + (10 if not _htest else 100)))
         #elguavas - config placeholders til config stuff completed
         self.bg = '#ffffff'
         self.fg = '#000000'
@@ -66,32 +72,15 @@
     try:
         with open(filename, 'r', encoding=encoding) as file:
             contents = file.read()
-    except OSError:
-        import tkinter.messagebox as tkMessageBox
+    except IOError:
         tkMessageBox.showerror(title='File Load Error',
                                message='Unable to load file %r .' % filename,
                                parent=parent)
     else:
         return view_text(parent, title, contents, modal)
 
-
 if __name__ == '__main__':
-    #test the dialog
-    root=Tk()
-    root.title('textView test')
-    filename = './textView.py'
-    with open(filename, 'r') as f:
-        text = f.read()
-    btn1 = Button(root, text='view_text',
-                  command=lambda:view_text(root, 'view_text', text))
-    btn1.pack(side=LEFT)
-    btn2 = Button(root, text='view_file',
-                  command=lambda:view_file(root, 'view_file', filename))
-    btn2.pack(side=LEFT)
-    btn3 = Button(root, text='nonmodal view_text',
-                  command=lambda:view_text(root, 'nonmodal view_text', text,
-                                           modal=False))
-    btn3.pack(side=LEFT)
-    close = Button(root, text='Close', command=root.destroy)
-    close.pack(side=RIGHT)
-    root.mainloop()
+    import unittest
+    unittest.main('idlelib.idle_test.test_textview', verbosity=2, exit=False)
+    from idlelib.idle_test.htest import run
+    run(TextViewer)
diff --git a/Lib/imaplib.py b/Lib/imaplib.py
index ad5f4e9..72ab5d7 100644
--- a/Lib/imaplib.py
+++ b/Lib/imaplib.py
@@ -185,7 +185,7 @@
         except Exception:
             try:
                 self.shutdown()
-            except socket.error:
+            except OSError:
                 pass
             raise
 
@@ -281,7 +281,7 @@
         self.file.close()
         try:
             self.sock.shutdown(socket.SHUT_RDWR)
-        except socket.error as e:
+        except OSError as e:
             # The server might already have closed the connection
             if e.errno != errno.ENOTCONN:
                 raise
@@ -554,7 +554,7 @@
         import hmac
         pwd = (self.password.encode('ASCII') if isinstance(self.password, str)
                                              else self.password)
-        return self.user + " " + hmac.HMAC(pwd, challenge).hexdigest()
+        return self.user + " " + hmac.HMAC(pwd, challenge, 'md5').hexdigest()
 
 
     def logout(self):
@@ -742,12 +742,11 @@
             raise self.abort('TLS not supported by server')
         # Generate a default SSL context if none was passed.
         if ssl_context is None:
-            ssl_context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
-            # SSLv2 considered harmful.
-            ssl_context.options |= ssl.OP_NO_SSLv2
+            ssl_context = ssl._create_stdlib_context()
         typ, dat = self._simple_command(name)
         if typ == 'OK':
-            self.sock = ssl_context.wrap_socket(self.sock)
+            self.sock = ssl_context.wrap_socket(self.sock,
+                                                server_hostname=self.host)
             self.file = self.sock.makefile('rb')
             self._tls_established = True
             self._get_capabilities()
@@ -915,7 +914,7 @@
 
         try:
             self.send(data + CRLF)
-        except (socket.error, OSError) as val:
+        except OSError as val:
             raise self.abort('socket error: %s' % val)
 
         if literal is None:
@@ -940,7 +939,7 @@
             try:
                 self.send(literal)
                 self.send(CRLF)
-            except (socket.error, OSError) as val:
+            except OSError as val:
                 raise self.abort('socket error: %s' % val)
 
             if not literator:
@@ -1090,7 +1089,7 @@
 
         # Protocol mandates all lines terminated by CRLF
         if not line.endswith(b'\r\n'):
-            raise self.abort('socket error: unterminated line')
+            raise self.abort('socket error: unterminated line: %r' % line)
 
         line = line[:-2]
         if __debug__:
@@ -1215,15 +1214,16 @@
 
             self.keyfile = keyfile
             self.certfile = certfile
+            if ssl_context is None:
+                ssl_context = ssl._create_stdlib_context(certfile=certfile,
+                                                         keyfile=keyfile)
             self.ssl_context = ssl_context
             IMAP4.__init__(self, host, port)
 
         def _create_socket(self):
             sock = IMAP4._create_socket(self)
-            if self.ssl_context:
-                return self.ssl_context.wrap_socket(sock)
-            else:
-                return ssl.wrap_socket(sock, self.keyfile, self.certfile)
+            return self.ssl_context.wrap_socket(sock,
+                                                server_hostname=self.host)
 
         def open(self, host='', port=IMAP4_SSL_PORT):
             """Setup connection to remote server on "host:port".
diff --git a/Lib/imghdr.py b/Lib/imghdr.py
index bdd47ee..add2ea8 100644
--- a/Lib/imghdr.py
+++ b/Lib/imghdr.py
@@ -147,7 +147,7 @@
             sys.stdout.flush()
             try:
                 print(what(filename))
-            except IOError:
+            except OSError:
                 print('*** not found ***')
 
 if __name__ == '__main__':
diff --git a/Lib/imp.py b/Lib/imp.py
index 4088383..c8449c6 100644
--- a/Lib/imp.py
+++ b/Lib/imp.py
@@ -16,18 +16,20 @@
     # Platform doesn't support dynamic loading.
     load_dynamic = None
 
-# Directly exposed by this module
-from importlib._bootstrap import new_module
-from importlib._bootstrap import cache_from_source, source_from_cache
+from importlib._bootstrap import SourcelessFileLoader, _ERR_MSG, _SpecMethods
 
-
-from importlib import _bootstrap
 from importlib import machinery
+from importlib import util
+import importlib
 import os
 import sys
 import tokenize
+import types
 import warnings
 
+warnings.warn("the imp module is deprecated in favour of importlib; "
+              "see the module's documentation for alternative uses",
+              PendingDeprecationWarning)
 
 # DEPRECATED
 SEARCH_ERROR = 0
@@ -42,9 +44,23 @@
 IMP_HOOK = 9
 
 
+def new_module(name):
+    """**DEPRECATED**
+
+    Create a new module.
+
+    The module is not entered into sys.modules.
+
+    """
+    return types.ModuleType(name)
+
+
 def get_magic():
-    """Return the magic number for .pyc or .pyo files."""
-    return _bootstrap._MAGIC_BYTES
+    """**DEPRECATED**
+
+    Return the magic number for .pyc or .pyo files.
+    """
+    return util.MAGIC_NUMBER
 
 
 def get_tag():
@@ -52,12 +68,42 @@
     return sys.implementation.cache_tag
 
 
+def cache_from_source(path, debug_override=None):
+    """**DEPRECATED**
+
+    Given the path to a .py file, return the path to its .pyc/.pyo file.
+
+    The .py file does not need to exist; this simply returns the path to the
+    .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 used in
+    place of sys.flags.optimize.
+
+    If sys.implementation.cache_tag is None then NotImplementedError is raised.
+
+    """
+    return util.cache_from_source(path, debug_override)
+
+
+def source_from_cache(path):
+    """**DEPRECATED**
+
+    Given the path to a .pyc./.pyo file, return the path to its .py file.
+
+    The .pyc/.pyo file does not need to exist; this simply returns the path to
+    the .py file calculated to correspond to the .pyc/.pyo file.  If path does
+    not conform to PEP 3147 format, ValueError will be raised. If
+    sys.implementation.cache_tag is None then NotImplementedError is raised.
+
+    """
+    return util.source_from_cache(path)
+
+
 def get_suffixes():
-    warnings.warn('imp.get_suffixes() is deprecated; use the constants '
-                  'defined on importlib.machinery instead',
-                  DeprecationWarning, 2)
+    """**DEPRECATED**"""
     extensions = [(s, 'rb', C_EXTENSION) for s in machinery.EXTENSION_SUFFIXES]
-    source = [(s, 'U', PY_SOURCE) for s in machinery.SOURCE_SUFFIXES]
+    source = [(s, 'r', PY_SOURCE) for s in machinery.SOURCE_SUFFIXES]
     bytecode = [(s, 'rb', PY_COMPILED) for s in machinery.BYTECODE_SUFFIXES]
 
     return extensions + source + bytecode
@@ -65,7 +111,11 @@
 
 class NullImporter:
 
-    """Null import object."""
+    """**DEPRECATED**
+
+    Null import object.
+
+    """
 
     def __init__(self, path):
         if path == '':
@@ -106,48 +156,49 @@
             return super().get_data(path)
 
 
-class _LoadSourceCompatibility(_HackedGetData, _bootstrap.SourceFileLoader):
+class _LoadSourceCompatibility(_HackedGetData, machinery.SourceFileLoader):
 
     """Compatibility support for implementing load_source()."""
 
 
 def load_source(name, pathname, file=None):
-    msg = ('imp.load_source() is deprecated; use '
-           'importlib.machinery.SourceFileLoader(name, pathname).load_module()'
-           ' instead')
-    warnings.warn(msg, DeprecationWarning, 2)
-    _LoadSourceCompatibility(name, pathname, file).load_module(name)
-    module = sys.modules[name]
+    loader = _LoadSourceCompatibility(name, pathname, file)
+    spec = util.spec_from_file_location(name, pathname, loader=loader)
+    methods = _SpecMethods(spec)
+    if name in sys.modules:
+        module = methods.exec(sys.modules[name])
+    else:
+        module = methods.load()
     # To allow reloading to potentially work, use a non-hacked loader which
     # won't rely on a now-closed file object.
-    module.__loader__ = _bootstrap.SourceFileLoader(name, pathname)
+    module.__loader__ = machinery.SourceFileLoader(name, pathname)
+    module.__spec__.loader = module.__loader__
     return module
 
 
-class _LoadCompiledCompatibility(_HackedGetData,
-        _bootstrap.SourcelessFileLoader):
+class _LoadCompiledCompatibility(_HackedGetData, SourcelessFileLoader):
 
     """Compatibility support for implementing load_compiled()."""
 
 
 def load_compiled(name, pathname, file=None):
-    msg = ('imp.load_compiled() is deprecated; use '
-           'importlib.machinery.SourcelessFileLoader(name, pathname).'
-           'load_module() instead ')
-    warnings.warn(msg, DeprecationWarning, 2)
-    _LoadCompiledCompatibility(name, pathname, file).load_module(name)
-    module = sys.modules[name]
+    """**DEPRECATED**"""
+    loader = _LoadCompiledCompatibility(name, pathname, file)
+    spec = util.spec_from_file_location(name, pathname, loader=loader)
+    methods = _SpecMethods(spec)
+    if name in sys.modules:
+        module = methods.exec(sys.modules[name])
+    else:
+        module = methods.load()
     # To allow reloading to potentially work, use a non-hacked loader which
     # won't rely on a now-closed file object.
-    module.__loader__ = _bootstrap.SourcelessFileLoader(name, pathname)
+    module.__loader__ = SourcelessFileLoader(name, pathname)
+    module.__spec__.loader = module.__loader__
     return module
 
 
 def load_package(name, path):
-    msg = ('imp.load_package() is deprecated; use either '
-           'importlib.machinery.SourceFileLoader() or '
-           'importlib.machinery.SourcelessFileLoader() instead')
-    warnings.warn(msg, DeprecationWarning, 2)
+    """**DEPRECATED**"""
     if os.path.isdir(path):
         extensions = (machinery.SOURCE_SUFFIXES[:] +
                       machinery.BYTECODE_SUFFIXES[:])
@@ -157,7 +208,13 @@
                 break
         else:
             raise ValueError('{!r} is not a package'.format(path))
-    return _bootstrap.SourceFileLoader(name, path).load_module(name)
+    spec = util.spec_from_file_location(name, path,
+                                        submodule_search_locations=[])
+    methods = _SpecMethods(spec)
+    if name in sys.modules:
+        return methods.exec(sys.modules[name])
+    else:
+        return methods.load()
 
 
 def load_module(name, file, filename, details):
@@ -169,32 +226,30 @@
 
     """
     suffix, mode, type_ = details
-    with warnings.catch_warnings():
-        warnings.simplefilter('ignore')
-        if mode and (not mode.startswith(('r', 'U')) or '+' in mode):
-            raise ValueError('invalid file open mode {!r}'.format(mode))
-        elif file is None and type_ in {PY_SOURCE, PY_COMPILED}:
-            msg = 'file object required for import (type code {})'.format(type_)
-            raise ValueError(msg)
-        elif type_ == PY_SOURCE:
-            return load_source(name, filename, file)
-        elif type_ == PY_COMPILED:
-            return load_compiled(name, filename, file)
-        elif type_ == C_EXTENSION and load_dynamic is not None:
-            if file is None:
-                with open(filename, 'rb') as opened_file:
-                    return load_dynamic(name, filename, opened_file)
-            else:
-                return load_dynamic(name, filename, file)
-        elif type_ == PKG_DIRECTORY:
-            return load_package(name, filename)
-        elif type_ == C_BUILTIN:
-            return init_builtin(name)
-        elif type_ == PY_FROZEN:
-            return init_frozen(name)
+    if mode and (not mode.startswith(('r', 'U')) or '+' in mode):
+        raise ValueError('invalid file open mode {!r}'.format(mode))
+    elif file is None and type_ in {PY_SOURCE, PY_COMPILED}:
+        msg = 'file object required for import (type code {})'.format(type_)
+        raise ValueError(msg)
+    elif type_ == PY_SOURCE:
+        return load_source(name, filename, file)
+    elif type_ == PY_COMPILED:
+        return load_compiled(name, filename, file)
+    elif type_ == C_EXTENSION and load_dynamic is not None:
+        if file is None:
+            with open(filename, 'rb') as opened_file:
+                return load_dynamic(name, filename, opened_file)
         else:
-            msg =  "Don't know how to import {} (type code {})".format(name, type_)
-            raise ImportError(msg, name=name)
+            return load_dynamic(name, filename, file)
+    elif type_ == PKG_DIRECTORY:
+        return load_package(name, filename)
+    elif type_ == C_BUILTIN:
+        return init_builtin(name)
+    elif type_ == PY_FROZEN:
+        return init_frozen(name)
+    else:
+        msg =  "Don't know how to import {} (type code {})".format(name, type_)
+        raise ImportError(msg, name=name)
 
 
 def find_module(name, path=None):
@@ -230,54 +285,31 @@
             file_path = os.path.join(package_directory, package_file_name)
             if os.path.isfile(file_path):
                 return None, package_directory, ('', '', PKG_DIRECTORY)
-        with warnings.catch_warnings():
-            warnings.simplefilter('ignore')
-            for suffix, mode, type_ in get_suffixes():
-                file_name = name + suffix
-                file_path = os.path.join(entry, file_name)
-                if os.path.isfile(file_path):
-                    break
-            else:
-                continue
-            break  # Break out of outer loop when breaking out of inner loop.
+        for suffix, mode, type_ in get_suffixes():
+            file_name = name + suffix
+            file_path = os.path.join(entry, file_name)
+            if os.path.isfile(file_path):
+                break
+        else:
+            continue
+        break  # Break out of outer loop when breaking out of inner loop.
     else:
-        raise ImportError(_bootstrap._ERR_MSG.format(name), name=name)
+        raise ImportError(_ERR_MSG.format(name), name=name)
 
     encoding = None
-    if mode == 'U':
+    if 'b' not in mode:
         with open(file_path, 'rb') as file:
             encoding = tokenize.detect_encoding(file.readline)[0]
     file = open(file_path, mode, encoding=encoding)
     return file, file_path, (suffix, mode, type_)
 
 
-_RELOADING = {}
-
 def reload(module):
-    """Reload the module and return it.
+    """**DEPRECATED**
+
+    Reload the module and return it.
 
     The module must have been successfully imported before.
 
     """
-    if not module or type(module) != type(sys):
-        raise TypeError("reload() argument must be module")
-    name = module.__name__
-    if name not in sys.modules:
-        msg = "module {} not in sys.modules"
-        raise ImportError(msg.format(name), name=name)
-    if name in _RELOADING:
-        return _RELOADING[name]
-    _RELOADING[name] = module
-    try:
-        parent_name = name.rpartition('.')[0]
-        if parent_name and parent_name not in sys.modules:
-            msg = "parent {!r} not in sys.modules"
-            raise ImportError(msg.format(parent_name), name=parent_name)
-        module.__loader__.load_module(name)
-        # The module may have replaced itself in sys.modules!
-        return sys.modules[module.__name__]
-    finally:
-        try:
-            del _RELOADING[name]
-        except KeyError:
-            pass
+    return importlib.reload(module)
diff --git a/Lib/importlib/__init__.py b/Lib/importlib/__init__.py
index 22c90f2..1bc9947 100644
--- a/Lib/importlib/__init__.py
+++ b/Lib/importlib/__init__.py
@@ -1,5 +1,5 @@
 """A pure Python implementation of import."""
-__all__ = ['__import__', 'import_module', 'invalidate_caches']
+__all__ = ['__import__', 'import_module', 'invalidate_caches', 'reload']
 
 # Bootstrap help #####################################################
 
@@ -22,7 +22,12 @@
     # a second copy of the module.
     _bootstrap.__name__ = 'importlib._bootstrap'
     _bootstrap.__package__ = 'importlib'
-    _bootstrap.__file__ = __file__.replace('__init__.py', '_bootstrap.py')
+    try:
+        _bootstrap.__file__ = __file__.replace('__init__.py', '_bootstrap.py')
+    except NameError:
+        # __file__ is not guaranteed to be defined, e.g. if this code gets
+        # frozen by a tool like cx_Freeze.
+        pass
     sys.modules['importlib._bootstrap'] = _bootstrap
 
 # To simplify imports in test code
@@ -32,6 +37,10 @@
 # Fully bootstrapped at this point, import whatever you like, circular
 # dependencies and startup overhead minimisation permitting :)
 
+import types
+import warnings
+
+
 # Public API #########################################################
 
 from ._bootstrap import __import__
@@ -46,20 +55,15 @@
 
 
 def find_loader(name, path=None):
-    """Find the loader for the specified module.
+    """Return the loader for the specified module.
 
-    First, sys.modules is checked to see if the module was already imported. If
-    so, then sys.modules[name].__loader__ is returned. If that happens to be
-    set to None, then ValueError is raised. If the module is not in
-    sys.modules, then sys.meta_path is searched for a suitable loader with the
-    value of 'path' given to the finders. None is returned if no loader could
-    be found.
+    This is a backward-compatible wrapper around find_spec().
 
-    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.
+    This function is deprecated in favor of importlib.util.find_spec().
 
     """
+    warnings.warn('Use importlib.util.find_spec() instead.',
+                  DeprecationWarning, stacklevel=2)
     try:
         loader = sys.modules[name].__loader__
         if loader is None:
@@ -68,7 +72,20 @@
             return loader
     except KeyError:
         pass
-    return _bootstrap._find_module(name, path)
+    except AttributeError:
+        raise ValueError('{}.__loader__ is not set'.format(name))
+
+    spec = _bootstrap._find_spec(name, path)
+    # We won't worry about malformed specs (missing attributes).
+    if spec is None:
+        return None
+    if spec.loader is None:
+        if spec.submodule_search_locations is None:
+            raise ImportError('spec for {} missing loader'.format(name),
+                              name=name)
+        raise ImportError('namespace packages do not have loaders',
+                          name=name)
+    return spec.loader
 
 
 def import_module(name, package=None):
@@ -82,9 +99,58 @@
     level = 0
     if name.startswith('.'):
         if not package:
-            raise TypeError("relative imports require the 'package' argument")
+            msg = ("the 'package' argument is required to perform a relative "
+                   "import for {!r}")
+            raise TypeError(msg.format(name))
         for character in name:
             if character != '.':
                 break
             level += 1
     return _bootstrap._gcd_import(name[level:], package, level)
+
+
+_RELOADING = {}
+
+
+def reload(module):
+    """Reload the module and return it.
+
+    The module must have been successfully imported before.
+
+    """
+    if not module or not isinstance(module, types.ModuleType):
+        raise TypeError("reload() argument must be module")
+    try:
+        name = module.__spec__.name
+    except AttributeError:
+        name = module.__name__
+
+    if sys.modules.get(name) is not module:
+        msg = "module {} not in sys.modules"
+        raise ImportError(msg.format(name), name=name)
+    if name in _RELOADING:
+        return _RELOADING[name]
+    _RELOADING[name] = module
+    try:
+        parent_name = name.rpartition('.')[0]
+        if parent_name:
+            try:
+                parent = sys.modules[parent_name]
+            except KeyError:
+                msg = "parent {!r} not in sys.modules"
+                raise ImportError(msg.format(parent_name), name=parent_name)
+            else:
+                pkgpath = parent.__path__
+        else:
+            pkgpath = None
+        target = module
+        spec = module.__spec__ = _bootstrap._find_spec(name, pkgpath, target)
+        methods = _bootstrap._SpecMethods(spec)
+        methods.exec(module)
+        # The module may have replaced itself in sys.modules!
+        return sys.modules[name]
+    finally:
+        try:
+            del _RELOADING[name]
+        except KeyError:
+            pass
diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py
index e40ec92..5b91c05 100644
--- a/Lib/importlib/_bootstrap.py
+++ b/Lib/importlib/_bootstrap.py
@@ -9,7 +9,7 @@
 #
 # IMPORTANT: Whenever making changes to this module, be sure to run
 # a top-level make in order to get the frozen version of the module
-# update. Not doing so, will result in the Makefile to fail for
+# update. Not doing so will result in the Makefile to fail for
 # all others who don't have a ./python around to freeze the module
 # in the early stages of compilation.
 #
@@ -20,10 +20,6 @@
 # reference any injected objects! This includes not only global code but also
 # anything specified at the class level.
 
-# XXX Make sure all public names have no single leading underscore and all
-#     others do.
-
-
 # Bootstrap-related code ######################################################
 
 _CASE_INSENSITIVE_PLATFORMS = 'win', 'cygwin', 'darwin'
@@ -41,76 +37,58 @@
     return _relax_case
 
 
-# TODO: Expose from marshal
 def _w_long(x):
-    """Convert a 32-bit integer to little-endian.
-
-    XXX Temporary until marshal's long functions are exposed.
-
-    """
-    x = int(x)
-    int_bytes = []
-    int_bytes.append(x & 0xFF)
-    int_bytes.append((x >> 8) & 0xFF)
-    int_bytes.append((x >> 16) & 0xFF)
-    int_bytes.append((x >> 24) & 0xFF)
-    return bytearray(int_bytes)
+    """Convert a 32-bit integer to little-endian."""
+    return (int(x) & 0xFFFFFFFF).to_bytes(4, 'little')
 
 
-# TODO: Expose from marshal
 def _r_long(int_bytes):
-    """Convert 4 bytes in little-endian to an integer.
-
-    XXX Temporary until marshal's long function are exposed.
-
-    """
-    x = int_bytes[0]
-    x |= int_bytes[1] << 8
-    x |= int_bytes[2] << 16
-    x |= int_bytes[3] << 24
-    return x
+    """Convert 4 bytes in little-endian to an integer."""
+    return int.from_bytes(int_bytes, 'little')
 
 
 def _path_join(*path_parts):
     """Replacement for os.path.join()."""
-    new_parts = []
-    for part in path_parts:
-        if not part:
-            continue
-        new_parts.append(part)
-        if part[-1] not in path_separators:
-            new_parts.append(path_sep)
-    return ''.join(new_parts[:-1])  # Drop superfluous path separator.
+    return path_sep.join([part.rstrip(path_separators)
+                          for part in path_parts if part])
 
 
 def _path_split(path):
     """Replacement for os.path.split()."""
+    if len(path_separators) == 1:
+        front, _, tail = path.rpartition(path_sep)
+        return front, tail
     for x in reversed(path):
         if x in path_separators:
-            sep = x
-            break
-    else:
-        sep = path_sep
-    front, _, tail = path.rpartition(sep)
-    return front, tail
+            front, tail = path.rsplit(x, maxsplit=1)
+            return front, tail
+    return '', path
+
+
+def _path_stat(path):
+    """Stat the path.
+
+    Made a separate function to make it easier to override in experiments
+    (e.g. cache stat results).
+
+    """
+    return _os.stat(path)
 
 
 def _path_is_mode_type(path, mode):
     """Test whether the path is the specified mode type."""
     try:
-        stat_info = _os.stat(path)
+        stat_info = _path_stat(path)
     except OSError:
         return False
     return (stat_info.st_mode & 0o170000) == mode
 
 
-# XXX Could also expose Modules/getpath.c:isfile()
 def _path_isfile(path):
     """Replacement for os.path.isfile."""
     return _path_is_mode_type(path, 0o100000)
 
 
-# XXX Could also expose Modules/getpath.c:isdir()
 def _path_isdir(path):
     """Replacement for os.path.isdir."""
     if not path:
@@ -148,17 +126,30 @@
     new.__dict__.update(old.__dict__)
 
 
+def _new_module(name):
+    return type(sys)(name)
+
+
 _code_type = type(_wrap.__code__)
 
 
-def new_module(name):
-    """Create a new module.
 
-    The module is not entered into sys.modules.
+class _ManageReload:
 
-    """
-    return type(_io)(name)
+    """Manages the possible clean-up of sys.modules for load_module()."""
 
+    def __init__(self, name):
+        self._name = name
+
+    def __enter__(self):
+        self._is_reload = self._name in sys.modules
+
+    def __exit__(self, *args):
+        if any(arg is not None for arg in args) and not self._is_reload:
+            try:
+                del sys.modules[self._name]
+            except KeyError:
+                pass
 
 # Module-level locking ########################################################
 
@@ -214,7 +205,7 @@
                         self.count += 1
                         return True
                     if self.has_deadlock():
-                        raise _DeadlockError("deadlock detected by %r" % self)
+                        raise _DeadlockError('deadlock detected by %r' % self)
                     if self.wakeup.acquire(False):
                         self.waiters += 1
                 # Wait for a release() call
@@ -227,7 +218,7 @@
         tid = _thread.get_ident()
         with self.lock:
             if self.owner != tid:
-                raise RuntimeError("cannot release un-acquired lock")
+                raise RuntimeError('cannot release un-acquired lock')
             assert self.count > 0
             self.count -= 1
             if self.count == 0:
@@ -237,7 +228,7 @@
                     self.wakeup.release()
 
     def __repr__(self):
-        return "_ModuleLock(%r) at %d" % (self.name, id(self))
+        return '_ModuleLock({!r}) at {}'.format(self.name, id(self))
 
 
 class _DummyModuleLock:
@@ -254,11 +245,28 @@
 
     def release(self):
         if self.count == 0:
-            raise RuntimeError("cannot release un-acquired lock")
+            raise RuntimeError('cannot release un-acquired lock')
         self.count -= 1
 
     def __repr__(self):
-        return "_DummyModuleLock(%r) at %d" % (self.name, id(self))
+        return '_DummyModuleLock({!r}) at {}'.format(self.name, id(self))
+
+
+class _ModuleLockManager:
+
+    def __init__(self, name):
+        self._name = name
+        self._lock = None
+
+    def __enter__(self):
+        try:
+            self._lock = _get_module_lock(self._name)
+        finally:
+            _imp.release_lock()
+        self._lock.acquire()
+
+    def __exit__(self, *args, **kwargs):
+        self._lock.release()
 
 
 # The following two functions are for consumption by Python/import.c.
@@ -315,95 +323,109 @@
 
 # Finder/loader utility code ###############################################
 
-"""Magic word to reject .pyc files generated by other Python versions.
-It should change for each incompatible change to the bytecode.
+# Magic word to reject .pyc files generated by other Python versions.
+# It should change for each incompatible change to the bytecode.
+#
+# The value of CR and LF is incorporated so if you ever read or write
+# a .pyc file in text mode the magic number will be wrong; also, the
+# Apple MPW compiler swaps their values, botching string constants.
+#
+# The magic numbers must be spaced apart at least 2 values, as the
+# -U interpeter flag will cause MAGIC+1 being used. They have been
+# odd numbers for some time now.
+#
+# There were a variety of old schemes for setting the magic number.
+# The current working scheme is to increment the previous value by
+# 10.
+#
+# Starting with the adoption of PEP 3147 in Python 3.2, every bump in magic
+# number also includes a new "magic tag", i.e. a human readable string used
+# to represent the magic number in __pycache__ directories.  When you change
+# the magic number, you must also set a new unique magic tag.  Generally this
+# can be named after the Python major version of the magic number bump, but
+# it can really be anything, as long as it's different than anything else
+# that's come before.  The tags are included in the following table, starting
+# with Python 3.2a0.
+#
+# Known values:
+#  Python 1.5:   20121
+#  Python 1.5.1: 20121
+#     Python 1.5.2: 20121
+#     Python 1.6:   50428
+#     Python 2.0:   50823
+#     Python 2.0.1: 50823
+#     Python 2.1:   60202
+#     Python 2.1.1: 60202
+#     Python 2.1.2: 60202
+#     Python 2.2:   60717
+#     Python 2.3a0: 62011
+#     Python 2.3a0: 62021
+#     Python 2.3a0: 62011 (!)
+#     Python 2.4a0: 62041
+#     Python 2.4a3: 62051
+#     Python 2.4b1: 62061
+#     Python 2.5a0: 62071
+#     Python 2.5a0: 62081 (ast-branch)
+#     Python 2.5a0: 62091 (with)
+#     Python 2.5a0: 62092 (changed WITH_CLEANUP opcode)
+#     Python 2.5b3: 62101 (fix wrong code: for x, in ...)
+#     Python 2.5b3: 62111 (fix wrong code: x += yield)
+#     Python 2.5c1: 62121 (fix wrong lnotab with for loops and
+#                          storing constants that should have been removed)
+#     Python 2.5c2: 62131 (fix wrong code: for x, in ... in listcomp/genexp)
+#     Python 2.6a0: 62151 (peephole optimizations and STORE_MAP opcode)
+#     Python 2.6a1: 62161 (WITH_CLEANUP optimization)
+#     Python 2.7a0: 62171 (optimize list comprehensions/change LIST_APPEND)
+#     Python 2.7a0: 62181 (optimize conditional branches:
+#                          introduce POP_JUMP_IF_FALSE and POP_JUMP_IF_TRUE)
+#     Python 2.7a0  62191 (introduce SETUP_WITH)
+#     Python 2.7a0  62201 (introduce BUILD_SET)
+#     Python 2.7a0  62211 (introduce MAP_ADD and SET_ADD)
+#     Python 3000:   3000
+#                    3010 (removed UNARY_CONVERT)
+#                    3020 (added BUILD_SET)
+#                    3030 (added keyword-only parameters)
+#                    3040 (added signature annotations)
+#                    3050 (print becomes a function)
+#                    3060 (PEP 3115 metaclass syntax)
+#                    3061 (string literals become unicode)
+#                    3071 (PEP 3109 raise changes)
+#                    3081 (PEP 3137 make __file__ and __name__ unicode)
+#                    3091 (kill str8 interning)
+#                    3101 (merge from 2.6a0, see 62151)
+#                    3103 (__file__ points to source file)
+#     Python 3.0a4: 3111 (WITH_CLEANUP optimization).
+#     Python 3.0a5: 3131 (lexical exception stacking, including POP_EXCEPT)
+#     Python 3.1a0: 3141 (optimize list, set and dict comprehensions:
+#             change LIST_APPEND and SET_ADD, add MAP_ADD)
+#     Python 3.1a0: 3151 (optimize conditional branches:
+#             introduce POP_JUMP_IF_FALSE and POP_JUMP_IF_TRUE)
+#     Python 3.2a0: 3160 (add SETUP_WITH)
+#                   tag: cpython-32
+#     Python 3.2a1: 3170 (add DUP_TOP_TWO, remove DUP_TOPX and ROT_FOUR)
+#                   tag: cpython-32
+#     Python 3.2a2  3180 (add DELETE_DEREF)
+#     Python 3.3a0  3190 __class__ super closure changed
+#     Python 3.3a0  3200 (__qualname__ added)
+#                      3210 (added size modulo 2**32 to the pyc header)
+#     Python 3.3a1  3220 (changed PEP 380 implementation)
+#     Python 3.3a4  3230 (revert changes to implicit __class__ closure)
+#     Python 3.4a1  3250 (evaluate positional default arguments before
+#                        keyword-only defaults)
+#     Python 3.4a1  3260 (add LOAD_CLASSDEREF; allow locals of class to override
+#                        free vars)
+#     Python 3.4a1  3270 (various tweaks to the __class__ closure)
+#     Python 3.4a1  3280 (remove implicit class argument)
+#     Python 3.4a4  3290 (changes to __qualname__ computation)
+#     Python 3.4a4  3300 (more changes to __qualname__ computation)
+#     Python 3.4rc2 3310 (alter __qualname__ computation)
+#
+# MAGIC must change whenever the bytecode emitted by the compiler may no
+# longer be understood by older implementations of the eval loop (usually
+# due to the addition of new opcodes).
 
-The value of CR and LF is incorporated so if you ever read or write
-a .pyc file in text mode the magic number will be wrong; also, the
-Apple MPW compiler swaps their values, botching string constants.
-
-The magic numbers must be spaced apart at least 2 values, as the
--U interpeter flag will cause MAGIC+1 being used. They have been
-odd numbers for some time now.
-
-There were a variety of old schemes for setting the magic number.
-The current working scheme is to increment the previous value by
-10.
-
-Starting with the adoption of PEP 3147 in Python 3.2, every bump in magic
-number also includes a new "magic tag", i.e. a human readable string used
-to represent the magic number in __pycache__ directories.  When you change
-the magic number, you must also set a new unique magic tag.  Generally this
-can be named after the Python major version of the magic number bump, but
-it can really be anything, as long as it's different than anything else
-that's come before.  The tags are included in the following table, starting
-with Python 3.2a0.
-
-Known values:
- Python 1.5:   20121
- Python 1.5.1: 20121
-    Python 1.5.2: 20121
-    Python 1.6:   50428
-    Python 2.0:   50823
-    Python 2.0.1: 50823
-    Python 2.1:   60202
-    Python 2.1.1: 60202
-    Python 2.1.2: 60202
-    Python 2.2:   60717
-    Python 2.3a0: 62011
-    Python 2.3a0: 62021
-    Python 2.3a0: 62011 (!)
-    Python 2.4a0: 62041
-    Python 2.4a3: 62051
-    Python 2.4b1: 62061
-    Python 2.5a0: 62071
-    Python 2.5a0: 62081 (ast-branch)
-    Python 2.5a0: 62091 (with)
-    Python 2.5a0: 62092 (changed WITH_CLEANUP opcode)
-    Python 2.5b3: 62101 (fix wrong code: for x, in ...)
-    Python 2.5b3: 62111 (fix wrong code: x += yield)
-    Python 2.5c1: 62121 (fix wrong lnotab with for loops and
-                         storing constants that should have been removed)
-    Python 2.5c2: 62131 (fix wrong code: for x, in ... in listcomp/genexp)
-    Python 2.6a0: 62151 (peephole optimizations and STORE_MAP opcode)
-    Python 2.6a1: 62161 (WITH_CLEANUP optimization)
-    Python 3000:   3000
-                   3010 (removed UNARY_CONVERT)
-                   3020 (added BUILD_SET)
-                   3030 (added keyword-only parameters)
-                   3040 (added signature annotations)
-                   3050 (print becomes a function)
-                   3060 (PEP 3115 metaclass syntax)
-                   3061 (string literals become unicode)
-                   3071 (PEP 3109 raise changes)
-                   3081 (PEP 3137 make __file__ and __name__ unicode)
-                   3091 (kill str8 interning)
-                   3101 (merge from 2.6a0, see 62151)
-                   3103 (__file__ points to source file)
-    Python 3.0a4: 3111 (WITH_CLEANUP optimization).
-    Python 3.0a5: 3131 (lexical exception stacking, including POP_EXCEPT)
-    Python 3.1a0: 3141 (optimize list, set and dict comprehensions:
-            change LIST_APPEND and SET_ADD, add MAP_ADD)
-    Python 3.1a0: 3151 (optimize conditional branches:
-            introduce POP_JUMP_IF_FALSE and POP_JUMP_IF_TRUE)
-    Python 3.2a0: 3160 (add SETUP_WITH)
-                  tag: cpython-32
-    Python 3.2a1: 3170 (add DUP_TOP_TWO, remove DUP_TOPX and ROT_FOUR)
-                  tag: cpython-32
-    Python 3.2a2  3180 (add DELETE_DEREF)
-    Python 3.3a0  3190 __class__ super closure changed
-    Python 3.3a0  3200 (__qualname__ added)
-                     3210 (added size modulo 2**32 to the pyc header)
-    Python 3.3a1  3220 (changed PEP 380 implementation)
-    Python 3.3a4  3230 (revert changes to implicit __class__ closure)
-
-MAGIC must change whenever the bytecode emitted by the compiler may no
-longer be understood by older implementations of the eval loop (usually
-due to the addition of new opcodes).
-
-"""
-_RAW_MAGIC_NUMBER = 3230 | ord('\r') << 16 | ord('\n') << 24
-_MAGIC_BYTES = bytes(_RAW_MAGIC_NUMBER >> n & 0xff for n in range(0, 25, 8))
+MAGIC_NUMBER = (3310).to_bytes(2, 'little') + b'\r\n'
+_RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little')  # For import.c
 
 _PYCACHE = '__pycache__'
 
@@ -431,11 +453,11 @@
     else:
         suffixes = OPTIMIZED_BYTECODE_SUFFIXES
     head, tail = _path_split(path)
-    base_filename, sep, _ = tail.partition('.')
+    base, sep, rest = tail.rpartition('.')
     tag = sys.implementation.cache_tag
     if tag is None:
         raise NotImplementedError('sys.implementation.cache_tag is None')
-    filename = ''.join([base_filename, sep, tag, suffixes[0]])
+    filename = ''.join([(base if base else rest), sep, tag, suffixes[0]])
     return _path_join(head, _PYCACHE, filename)
 
 
@@ -481,6 +503,18 @@
     return source_path if _path_isfile(source_path) else bytecode_path
 
 
+def _calc_mode(path):
+    """Calculate the mode permissions for a bytecode file."""
+    try:
+        mode = _path_stat(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 mode
+
+
 def _verbose_message(message, *args, verbosity=1):
     """Print the message to stderr if -v/PYTHONVERBOSE is turned on."""
     if sys.flags.verbose >= verbosity:
@@ -489,85 +523,6 @@
         print(message.format(*args), file=sys.stderr)
 
 
-def set_package(fxn):
-    """Set __package__ on the returned module."""
-    def set_package_wrapper(*args, **kwargs):
-        module = fxn(*args, **kwargs)
-        if getattr(module, '__package__', None) is None:
-            module.__package__ = module.__name__
-            if not hasattr(module, '__path__'):
-                module.__package__ = module.__package__.rpartition('.')[0]
-        return module
-    _wrap(set_package_wrapper, fxn)
-    return set_package_wrapper
-
-
-def set_loader(fxn):
-    """Set __loader__ on the returned module."""
-    def set_loader_wrapper(self, *args, **kwargs):
-        module = fxn(self, *args, **kwargs)
-        if not hasattr(module, '__loader__'):
-            module.__loader__ = self
-        return module
-    _wrap(set_loader_wrapper, fxn)
-    return set_loader_wrapper
-
-
-def module_for_loader(fxn):
-    """Decorator to handle selecting the proper module for loaders.
-
-    The decorated function is passed the module to use instead of the module
-    name. The module passed in to the function is either from sys.modules if
-    it already exists or is a new module. If the module is new, then __name__
-    is set the first argument to the method, __loader__ is set to self, and
-    __package__ is set accordingly (if self.is_package() is defined) will be set
-    before it is passed to the decorated function (if self.is_package() does
-    not work for the module it will be set post-load).
-
-    If an exception is raised and the decorator created the module it is
-    subsequently removed from sys.modules.
-
-    The decorator assumes that the decorated function takes the module name as
-    the second argument.
-
-    """
-    def module_for_loader_wrapper(self, fullname, *args, **kwargs):
-        module = sys.modules.get(fullname)
-        is_reload = module is not None
-        if not is_reload:
-            # This must be done before open() is called as the 'io' module
-            # implicitly imports 'locale' and would otherwise trigger an
-            # infinite loop.
-            module = new_module(fullname)
-            # This must be done before putting the module in sys.modules
-            # (otherwise an optimization shortcut in import.c becomes wrong)
-            module.__initializing__ = True
-            sys.modules[fullname] = module
-            module.__loader__ = self
-            try:
-                is_package = self.is_package(fullname)
-            except (ImportError, AttributeError):
-                pass
-            else:
-                if is_package:
-                    module.__package__ = fullname
-                else:
-                    module.__package__ = fullname.rpartition('.')[0]
-        else:
-            module.__initializing__ = True
-        try:
-            # If __package__ was not set above, __import__() will do it later.
-            return fxn(self, module, *args, **kwargs)
-        except:
-            if not is_reload:
-                del sys.modules[fullname]
-            raise
-        finally:
-            module.__initializing__ = False
-    _wrap(module_for_loader_wrapper, fxn)
-    return module_for_loader_wrapper
-
-
 def _check_name(method):
     """Decorator to verify that the module being requested matches the one the
     loader can handle.
@@ -580,7 +535,7 @@
         if name is None:
             name = self.name
         elif self.name != name:
-            raise ImportError("loader cannot handle %s" % name, name=name)
+            raise ImportError('loader cannot handle %s' % name, name=name)
         return method(self, name, *args, **kwargs)
     _wrap(_check_name_wrapper, method)
     return _check_name_wrapper
@@ -590,7 +545,7 @@
     """Decorator to verify the named module is built-in."""
     def _requires_builtin_wrapper(self, fullname):
         if fullname not in sys.builtin_module_names:
-            raise ImportError("{} is not a built-in module".format(fullname),
+            raise ImportError('{!r} is not a built-in module'.format(fullname),
                               name=fullname)
         return fxn(self, fullname)
     _wrap(_requires_builtin_wrapper, fxn)
@@ -601,7 +556,7 @@
     """Decorator to verify the named module is frozen."""
     def _requires_frozen_wrapper(self, fullname):
         if not _imp.is_frozen(fullname):
-            raise ImportError("{} is not a frozen module".format(fullname),
+            raise ImportError('{!r} is not a frozen module'.format(fullname),
                               name=fullname)
         return fxn(self, fullname)
     _wrap(_requires_frozen_wrapper, fxn)
@@ -610,17 +565,682 @@
 
 def _find_module_shim(self, fullname):
     """Try to find a loader for the specified module by delegating to
-    self.find_loader()."""
+    self.find_loader().
+
+    This method is deprecated in favor of finder.find_spec().
+
+    """
     # Call find_loader(). If it returns a string (indicating this
     # is a namespace package portion), generate a warning and
     # return None.
     loader, portions = self.find_loader(fullname)
     if loader is None and len(portions):
-        msg = "Not importing directory {}: missing __init__"
+        msg = 'Not importing directory {}: missing __init__'
         _warnings.warn(msg.format(portions[0]), ImportWarning)
     return loader
 
 
+def _load_module_shim(self, fullname):
+    """Load the specified module into sys.modules and return it.
+
+    This method is deprecated.  Use loader.exec_module instead.
+
+    """
+    spec = spec_from_loader(fullname, self)
+    methods = _SpecMethods(spec)
+    if fullname in sys.modules:
+        module = sys.modules[fullname]
+        methods.exec(module)
+        return sys.modules[fullname]
+    else:
+        return methods.load()
+
+
+def _validate_bytecode_header(data, source_stats=None, name=None, path=None):
+    """Validate the header of the passed-in bytecode against source_stats (if
+    given) and returning the bytecode that can be compiled by compile().
+
+    All other arguments are used to enhance error reporting.
+
+    ImportError is raised when the magic number is incorrect or the bytecode is
+    found to be stale. EOFError is raised when the data is found to be
+    truncated.
+
+    """
+    exc_details = {}
+    if name is not None:
+        exc_details['name'] = name
+    else:
+        # To prevent having to make all messages have a conditional name.
+        name = '<bytecode>'
+    if path is not None:
+        exc_details['path'] = path
+    magic = data[:4]
+    raw_timestamp = data[4:8]
+    raw_size = data[8:12]
+    if magic != MAGIC_NUMBER:
+        message = 'bad magic number in {!r}: {!r}'.format(name, magic)
+        _verbose_message(message)
+        raise ImportError(message, **exc_details)
+    elif len(raw_timestamp) != 4:
+        message = 'reached EOF while reading timestamp in {!r}'.format(name)
+        _verbose_message(message)
+        raise EOFError(message)
+    elif len(raw_size) != 4:
+        message = 'reached EOF while reading size of source in {!r}'.format(name)
+        _verbose_message(message)
+        raise EOFError(message)
+    if source_stats is not None:
+        try:
+            source_mtime = int(source_stats['mtime'])
+        except KeyError:
+            pass
+        else:
+            if _r_long(raw_timestamp) != source_mtime:
+                message = 'bytecode is stale for {!r}'.format(name)
+                _verbose_message(message)
+                raise ImportError(message, **exc_details)
+        try:
+            source_size = source_stats['size'] & 0xFFFFFFFF
+        except KeyError:
+            pass
+        else:
+            if _r_long(raw_size) != source_size:
+                raise ImportError('bytecode is stale for {!r}'.format(name),
+                                  **exc_details)
+    return data[12:]
+
+
+def _compile_bytecode(data, name=None, bytecode_path=None, source_path=None):
+    """Compile bytecode as returned by _validate_bytecode_header()."""
+    code = marshal.loads(data)
+    if isinstance(code, _code_type):
+        _verbose_message('code object from {!r}', bytecode_path)
+        if source_path is not None:
+            _imp._fix_co_filename(code, source_path)
+        return code
+    else:
+        raise ImportError('Non-code object in {!r}'.format(bytecode_path),
+                          name=name, path=bytecode_path)
+
+def _code_to_bytecode(code, mtime=0, source_size=0):
+    """Compile a code object into bytecode for writing out to a byte-compiled
+    file."""
+    data = bytearray(MAGIC_NUMBER)
+    data.extend(_w_long(mtime))
+    data.extend(_w_long(source_size))
+    data.extend(marshal.dumps(code))
+    return data
+
+
+def decode_source(source_bytes):
+    """Decode bytes representing source code and return the string.
+
+    Universal newline support is used in the decoding.
+    """
+    import tokenize  # To avoid bootstrap issues.
+    source_bytes_readline = _io.BytesIO(source_bytes).readline
+    encoding = tokenize.detect_encoding(source_bytes_readline)
+    newline_decoder = _io.IncrementalNewlineDecoder(None, True)
+    return newline_decoder.decode(source_bytes.decode(encoding[0]))
+
+
+# Module specifications #######################################################
+
+def _module_repr(module):
+    # The implementation of ModuleType__repr__().
+    loader = getattr(module, '__loader__', None)
+    if hasattr(loader, 'module_repr'):
+        # As soon as BuiltinImporter, FrozenImporter, and NamespaceLoader
+        # drop their implementations for module_repr. we can add a
+        # deprecation warning here.
+        try:
+            return loader.module_repr(module)
+        except Exception:
+            pass
+    try:
+        spec = module.__spec__
+    except AttributeError:
+        pass
+    else:
+        if spec is not None:
+            return _SpecMethods(spec).module_repr()
+
+    # We could use module.__class__.__name__ instead of 'module' in the
+    # various repr permutations.
+    try:
+        name = module.__name__
+    except AttributeError:
+        name = '?'
+    try:
+        filename = module.__file__
+    except AttributeError:
+        if loader is None:
+            return '<module {!r}>'.format(name)
+        else:
+            return '<module {!r} ({!r})>'.format(name, loader)
+    else:
+        return '<module {!r} from {!r}>'.format(name, filename)
+
+
+class _installed_safely:
+
+    def __init__(self, module):
+        self._module = module
+        self._spec = module.__spec__
+
+    def __enter__(self):
+        # This must be done before putting the module in sys.modules
+        # (otherwise an optimization shortcut in import.c becomes
+        # wrong)
+        self._spec._initializing = True
+        sys.modules[self._spec.name] = self._module
+
+    def __exit__(self, *args):
+        try:
+            spec = self._spec
+            if any(arg is not None for arg in args):
+                try:
+                    del sys.modules[spec.name]
+                except KeyError:
+                    pass
+            else:
+                _verbose_message('import {!r} # {!r}', spec.name, spec.loader)
+        finally:
+            self._spec._initializing = False
+
+
+class ModuleSpec:
+    """The specification for a module, used for loading.
+
+    A module's spec is the source for information about the module.  For
+    data associated with the module, including source, use the spec's
+    loader.
+
+    `name` is the absolute name of the module.  `loader` is the loader
+    to use when loading the module.  `parent` is the name of the
+    package the module is in.  The parent is derived from the name.
+
+    `is_package` determines if the module is considered a package or
+    not.  On modules this is reflected by the `__path__` attribute.
+
+    `origin` is the specific location used by the loader from which to
+    load the module, if that information is available.  When filename is
+    set, origin will match.
+
+    `has_location` indicates that a spec's "origin" reflects a location.
+    When this is True, `__file__` attribute of the module is set.
+
+    `cached` is the location of the cached bytecode file, if any.  It
+    corresponds to the `__cached__` attribute.
+
+    `submodule_search_locations` is the sequence of path entries to
+    search when importing submodules.  If set, is_package should be
+    True--and False otherwise.
+
+    Packages are simply modules that (may) have submodules.  If a spec
+    has a non-None value in `submodule_search_locations`, the import
+    system will consider modules loaded from the spec as packages.
+
+    Only finders (see importlib.abc.MetaPathFinder and
+    importlib.abc.PathEntryFinder) should modify ModuleSpec instances.
+
+    """
+
+    def __init__(self, name, loader, *, origin=None, loader_state=None,
+                 is_package=None):
+        self.name = name
+        self.loader = loader
+        self.origin = origin
+        self.loader_state = loader_state
+        self.submodule_search_locations = [] if is_package else None
+
+        # file-location attributes
+        self._set_fileattr = False
+        self._cached = None
+
+    def __repr__(self):
+        args = ['name={!r}'.format(self.name),
+                'loader={!r}'.format(self.loader)]
+        if self.origin is not None:
+            args.append('origin={!r}'.format(self.origin))
+        if self.submodule_search_locations is not None:
+            args.append('submodule_search_locations={}'
+                        .format(self.submodule_search_locations))
+        return '{}({})'.format(self.__class__.__name__, ', '.join(args))
+
+    def __eq__(self, other):
+        smsl = self.submodule_search_locations
+        try:
+            return (self.name == other.name and
+                    self.loader == other.loader and
+                    self.origin == other.origin and
+                    smsl == other.submodule_search_locations and
+                    self.cached == other.cached and
+                    self.has_location == other.has_location)
+        except AttributeError:
+            return False
+
+    @property
+    def cached(self):
+        if self._cached is None:
+            if self.origin is not None and self._set_fileattr:
+                filename = self.origin
+                if filename.endswith(tuple(SOURCE_SUFFIXES)):
+                    try:
+                        self._cached = cache_from_source(filename)
+                    except NotImplementedError:
+                        pass
+                elif filename.endswith(tuple(BYTECODE_SUFFIXES)):
+                    self._cached = filename
+        return self._cached
+
+    @cached.setter
+    def cached(self, cached):
+        self._cached = cached
+
+    @property
+    def parent(self):
+        """The name of the module's parent."""
+        if self.submodule_search_locations is None:
+            return self.name.rpartition('.')[0]
+        else:
+            return self.name
+
+    @property
+    def has_location(self):
+        return self._set_fileattr
+
+    @has_location.setter
+    def has_location(self, value):
+        self._set_fileattr = bool(value)
+
+
+def spec_from_loader(name, loader, *, origin=None, is_package=None):
+    """Return a module spec based on various loader methods."""
+    if hasattr(loader, 'get_filename'):
+        if is_package is None:
+            return spec_from_file_location(name, loader=loader)
+        search = [] if is_package else None
+        return spec_from_file_location(name, loader=loader,
+                                       submodule_search_locations=search)
+
+    if is_package is None:
+        if hasattr(loader, 'is_package'):
+            try:
+                is_package = loader.is_package(name)
+            except ImportError:
+                is_package = None  # aka, undefined
+        else:
+            # the default
+            is_package = False
+
+    return ModuleSpec(name, loader, origin=origin, is_package=is_package)
+
+
+_POPULATE = object()
+
+
+def spec_from_file_location(name, location=None, *, loader=None,
+                            submodule_search_locations=_POPULATE):
+    """Return a module spec based on a file location.
+
+    To indicate that the module is a package, set
+    submodule_search_locations to a list of directory paths.  An
+    empty list is sufficient, though its not otherwise useful to the
+    import system.
+
+    The loader must take a spec as its only __init__() arg.
+
+    """
+    if location is None:
+        # The caller may simply want a partially populated location-
+        # oriented spec.  So we set the location to a bogus value and
+        # fill in as much as we can.
+        location = '<unknown>'
+        if hasattr(loader, 'get_filename'):
+            # ExecutionLoader
+            try:
+                location = loader.get_filename(name)
+            except ImportError:
+                pass
+
+    # If the location is on the filesystem, but doesn't actually exist,
+    # we could return None here, indicating that the location is not
+    # valid.  However, we don't have a good way of testing since an
+    # indirect location (e.g. a zip file or URL) will look like a
+    # non-existent file relative to the filesystem.
+
+    spec = ModuleSpec(name, loader, origin=location)
+    spec._set_fileattr = True
+
+    # Pick a loader if one wasn't provided.
+    if loader is None:
+        for loader_class, suffixes in _get_supported_file_loaders():
+            if location.endswith(tuple(suffixes)):
+                loader = loader_class(name, location)
+                spec.loader = loader
+                break
+        else:
+            return None
+
+    # Set submodule_search_paths appropriately.
+    if submodule_search_locations is _POPULATE:
+        # Check the loader.
+        if hasattr(loader, 'is_package'):
+            try:
+                is_package = loader.is_package(name)
+            except ImportError:
+                pass
+            else:
+                if is_package:
+                    spec.submodule_search_locations = []
+    else:
+        spec.submodule_search_locations = submodule_search_locations
+    if spec.submodule_search_locations == []:
+        if location:
+            dirname = _path_split(location)[0]
+            spec.submodule_search_locations.append(dirname)
+
+    return spec
+
+
+def _spec_from_module(module, loader=None, origin=None):
+    # This function is meant for use in _setup().
+    try:
+        spec = module.__spec__
+    except AttributeError:
+        pass
+    else:
+        if spec is not None:
+            return spec
+
+    name = module.__name__
+    if loader is None:
+        try:
+            loader = module.__loader__
+        except AttributeError:
+            # loader will stay None.
+            pass
+    try:
+        location = module.__file__
+    except AttributeError:
+        location = None
+    if origin is None:
+        if location is None:
+            try:
+                origin = loader._ORIGIN
+            except AttributeError:
+                origin = None
+        else:
+            origin = location
+    try:
+        cached = module.__cached__
+    except AttributeError:
+        cached = None
+    try:
+        submodule_search_locations = list(module.__path__)
+    except AttributeError:
+        submodule_search_locations = None
+
+    spec = ModuleSpec(name, loader, origin=origin)
+    spec._set_fileattr = False if location is None else True
+    spec.cached = cached
+    spec.submodule_search_locations = submodule_search_locations
+    return spec
+
+
+class _SpecMethods:
+
+    """Convenience wrapper around spec objects to provide spec-specific
+    methods."""
+
+    # The various spec_from_* functions could be made factory methods here.
+
+    def __init__(self, spec):
+        self.spec = spec
+
+    def module_repr(self):
+        """Return the repr to use for the module."""
+        # We mostly replicate _module_repr() using the spec attributes.
+        spec = self.spec
+        name = '?' if spec.name is None else spec.name
+        if spec.origin is None:
+            if spec.loader is None:
+                return '<module {!r}>'.format(name)
+            else:
+                return '<module {!r} ({!r})>'.format(name, spec.loader)
+        else:
+            if spec.has_location:
+                return '<module {!r} from {!r}>'.format(name, spec.origin)
+            else:
+                return '<module {!r} ({})>'.format(spec.name, spec.origin)
+
+    def init_module_attrs(self, module, *, _override=False, _force_name=True):
+        """Set the module's attributes.
+
+        All missing import-related module attributes will be set.  Here
+        is how the spec attributes map onto the module:
+
+        spec.name -> module.__name__
+        spec.loader -> module.__loader__
+        spec.parent -> module.__package__
+        spec -> module.__spec__
+
+        Optional:
+        spec.origin -> module.__file__ (if spec.set_fileattr is true)
+        spec.cached -> module.__cached__ (if __file__ also set)
+        spec.submodule_search_locations -> module.__path__ (if set)
+
+        """
+        spec = self.spec
+
+        # The passed in module may be not support attribute assignment,
+        # in which case we simply don't set the attributes.
+
+        # __name__
+        if (_override or _force_name or
+            getattr(module, '__name__', None) is None):
+            try:
+                module.__name__ = spec.name
+            except AttributeError:
+                pass
+
+        # __loader__
+        if _override or getattr(module, '__loader__', None) is None:
+            loader = spec.loader
+            if loader is None:
+                # A backward compatibility hack.
+                if spec.submodule_search_locations is not None:
+                    loader = _NamespaceLoader.__new__(_NamespaceLoader)
+                    loader._path = spec.submodule_search_locations
+            try:
+                module.__loader__ = loader
+            except AttributeError:
+                pass
+
+        # __package__
+        if _override or getattr(module, '__package__', None) is None:
+            try:
+                module.__package__ = spec.parent
+            except AttributeError:
+                pass
+
+        # __spec__
+        try:
+            module.__spec__ = spec
+        except AttributeError:
+            pass
+
+        # __path__
+        if _override or getattr(module, '__path__', None) is None:
+            if spec.submodule_search_locations is not None:
+                try:
+                    module.__path__ = spec.submodule_search_locations
+                except AttributeError:
+                    pass
+
+        if spec.has_location:
+            # __file__
+            if _override or getattr(module, '__file__', None) is None:
+                try:
+                    module.__file__ = spec.origin
+                except AttributeError:
+                    pass
+
+            # __cached__
+            if _override or getattr(module, '__cached__', None) is None:
+                if spec.cached is not None:
+                    try:
+                        module.__cached__ = spec.cached
+                    except AttributeError:
+                        pass
+
+    def create(self):
+        """Return a new module to be loaded.
+
+        The import-related module attributes are also set with the
+        appropriate values from the spec.
+
+        """
+        spec = self.spec
+        # Typically loaders will not implement create_module().
+        if hasattr(spec.loader, 'create_module'):
+            # If create_module() returns `None` it means the default
+            # module creation should be used.
+            module = spec.loader.create_module(spec)
+        else:
+            module = None
+        if module is None:
+            # This must be done before open() is ever called as the 'io'
+            # module implicitly imports 'locale' and would otherwise
+            # trigger an infinite loop.
+            module = _new_module(spec.name)
+        self.init_module_attrs(module)
+        return module
+
+    def _exec(self, module):
+        """Do everything necessary to execute the module.
+
+        The namespace of `module` is used as the target of execution.
+        This method uses the loader's `exec_module()` method.
+
+        """
+        self.spec.loader.exec_module(module)
+
+    # Used by importlib.reload() and _load_module_shim().
+    def exec(self, module):
+        """Execute the spec in an existing module's namespace."""
+        name = self.spec.name
+        _imp.acquire_lock()
+        with _ModuleLockManager(name):
+            if sys.modules.get(name) is not module:
+                msg = 'module {!r} not in sys.modules'.format(name)
+                raise ImportError(msg, name=name)
+            if self.spec.loader is None:
+                if self.spec.submodule_search_locations is None:
+                    raise ImportError('missing loader', name=self.spec.name)
+                # namespace package
+                self.init_module_attrs(module, _override=True)
+                return module
+            self.init_module_attrs(module, _override=True)
+            if not hasattr(self.spec.loader, 'exec_module'):
+                # (issue19713) Once BuiltinImporter and ExtensionFileLoader
+                # have exec_module() implemented, we can add a deprecation
+                # warning here.
+                self.spec.loader.load_module(name)
+            else:
+                self._exec(module)
+        return sys.modules[name]
+
+    def _load_backward_compatible(self):
+        # (issue19713) Once BuiltinImporter and ExtensionFileLoader
+        # have exec_module() implemented, we can add a deprecation
+        # warning here.
+        spec = self.spec
+        spec.loader.load_module(spec.name)
+        # The module must be in sys.modules at this point!
+        module = sys.modules[spec.name]
+        if getattr(module, '__loader__', None) is None:
+            try:
+                module.__loader__ = spec.loader
+            except AttributeError:
+                pass
+        if getattr(module, '__package__', None) is None:
+            try:
+                # Since module.__path__ may not line up with
+                # spec.submodule_search_paths, we can't necessarily rely
+                # on spec.parent here.
+                module.__package__ = module.__name__
+                if not hasattr(module, '__path__'):
+                    module.__package__ = spec.name.rpartition('.')[0]
+            except AttributeError:
+                pass
+        if getattr(module, '__spec__', None) is None:
+            try:
+                module.__spec__ = spec
+            except AttributeError:
+                pass
+        return module
+
+    def _load_unlocked(self):
+        # A helper for direct use by the import system.
+        if self.spec.loader is not None:
+            # not a namespace package
+            if not hasattr(self.spec.loader, 'exec_module'):
+                return self._load_backward_compatible()
+
+        module = self.create()
+        with _installed_safely(module):
+            if self.spec.loader is None:
+                if self.spec.submodule_search_locations is None:
+                    raise ImportError('missing loader', name=self.spec.name)
+                # A namespace package so do nothing.
+            else:
+                self._exec(module)
+
+        # We don't ensure that the import-related module attributes get
+        # set in the sys.modules replacement case.  Such modules are on
+        # their own.
+        return sys.modules[self.spec.name]
+
+    # A method used during testing of _load_unlocked() and by
+    # _load_module_shim().
+    def load(self):
+        """Return a new module object, loaded by the spec's loader.
+
+        The module is not added to its parent.
+
+        If a module is already in sys.modules, that existing module gets
+        clobbered.
+
+        """
+        _imp.acquire_lock()
+        with _ModuleLockManager(self.spec.name):
+            return self._load_unlocked()
+
+
+def _fix_up_module(ns, name, pathname, cpathname=None):
+    # This function is used by PyImport_ExecCodeModuleObject().
+    loader = ns.get('__loader__')
+    spec = ns.get('__spec__')
+    if not loader:
+        if spec:
+            loader = spec.loader
+        elif pathname == cpathname:
+            loader = SourcelessFileLoader(name, pathname)
+        else:
+            loader = SourceFileLoader(name, pathname)
+    if not spec:
+        spec = spec_from_file_location(name, pathname, loader=loader)
+    try:
+        ns['__spec__'] = spec
+        ns['__loader__'] = loader
+        ns['__file__'] = pathname
+        ns['__cached__'] = cpathname
+    except Exception:
+        # Not important enough to report.
+        pass
 
 
 # Loaders #####################################################################
@@ -634,9 +1254,23 @@
 
     """
 
+    @staticmethod
+    def module_repr(module):
+        """Return repr for the module.
+
+        The method is deprecated.  The import machinery does the job itself.
+
+        """
+        return '<module {!r} (built-in)>'.format(module.__name__)
+
     @classmethod
-    def module_repr(cls, module):
-        return "<module '{}' (built-in)>".format(module.__name__)
+    def find_spec(cls, fullname, path=None, target=None):
+        if path is not None:
+            return None
+        if _imp.is_builtin(fullname):
+            return spec_from_loader(fullname, cls, origin='built-in')
+        else:
+            return None
 
     @classmethod
     def find_module(cls, fullname, path=None):
@@ -644,24 +1278,23 @@
 
         If 'path' is ever specified then the search is considered a failure.
 
+        This method is deprecated.  Use find_spec() instead.
+
         """
-        if path is not None:
-            return None
-        return cls if _imp.is_builtin(fullname) else None
+        spec = cls.find_spec(fullname, path)
+        return spec.loader if spec is not None else None
 
     @classmethod
-    @set_package
-    @set_loader
     @_requires_builtin
     def load_module(cls, fullname):
         """Load a built-in module."""
-        is_reload = fullname in sys.modules
-        try:
-            return _call_with_frames_removed(_imp.init_builtin, fullname)
-        except:
-            if not is_reload and fullname in sys.modules:
-                del sys.modules[fullname]
-            raise
+        # Once an exec_module() implementation is added we can also
+        # add a deprecation warning here.
+        with _ManageReload(fullname):
+            module = _call_with_frames_removed(_imp.init_builtin, fullname)
+        module.__loader__ = cls
+        module.__package__ = ''
+        return module
 
     @classmethod
     @_requires_builtin
@@ -691,31 +1324,48 @@
 
     """
 
+    @staticmethod
+    def module_repr(m):
+        """Return repr for the module.
+
+        The method is deprecated.  The import machinery does the job itself.
+
+        """
+        return '<module {!r} (frozen)>'.format(m.__name__)
+
     @classmethod
-    def module_repr(cls, m):
-        return "<module '{}' (frozen)>".format(m.__name__)
+    def find_spec(cls, fullname, path=None, target=None):
+        if _imp.is_frozen(fullname):
+            return spec_from_loader(fullname, cls, origin='frozen')
+        else:
+            return None
 
     @classmethod
     def find_module(cls, fullname, path=None):
-        """Find a frozen module."""
+        """Find a frozen module.
+
+        This method is deprecated.  Use find_spec() instead.
+
+        """
         return cls if _imp.is_frozen(fullname) else None
 
+    @staticmethod
+    def exec_module(module):
+        name = module.__spec__.name
+        if not _imp.is_frozen(name):
+            raise ImportError('{!r} is not a frozen module'.format(name),
+                              name=name)
+        code = _call_with_frames_removed(_imp.get_frozen_object, name)
+        exec(code, module.__dict__)
+
     @classmethod
-    @set_package
-    @set_loader
-    @_requires_frozen
     def load_module(cls, fullname):
-        """Load a frozen module."""
-        is_reload = fullname in sys.modules
-        try:
-            m = _call_with_frames_removed(_imp.init_frozen, fullname)
-            # Let our own module_repr() method produce a suitable repr.
-            del m.__file__
-            return m
-        except:
-            if not is_reload and fullname in sys.modules:
-                del sys.modules[fullname]
-            raise
+        """Load a frozen module.
+
+        This method is deprecated.  Use exec_module() instead.
+
+        """
+        return _load_module_shim(cls, fullname)
 
     @classmethod
     @_requires_frozen
@@ -738,22 +1388,21 @@
 
 class WindowsRegistryFinder:
 
-    """Meta path finder for modules declared in the Windows registry.
-    """
+    """Meta path finder for modules declared in the Windows registry."""
 
     REGISTRY_KEY = (
-        "Software\\Python\\PythonCore\\{sys_version}"
-        "\\Modules\\{fullname}")
+        'Software\\Python\\PythonCore\\{sys_version}'
+        '\\Modules\\{fullname}')
     REGISTRY_KEY_DEBUG = (
-        "Software\\Python\\PythonCore\\{sys_version}"
-        "\\Modules\\{fullname}\\Debug")
+        'Software\\Python\\PythonCore\\{sys_version}'
+        '\\Modules\\{fullname}\\Debug')
     DEBUG_BUILD = False  # Changed in _setup()
 
     @classmethod
     def _open_registry(cls, key):
         try:
             return _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, key)
-        except WindowsError:
+        except OSError:
             return _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, key)
 
     @classmethod
@@ -766,24 +1415,38 @@
                                   sys_version=sys.version[:3])
         try:
             with cls._open_registry(key) as hkey:
-                filepath = _winreg.QueryValue(hkey, "")
-        except WindowsError:
+                filepath = _winreg.QueryValue(hkey, '')
+        except OSError:
             return None
         return filepath
 
     @classmethod
-    def find_module(cls, fullname, path=None):
-        """Find module named in the registry."""
+    def find_spec(cls, fullname, path=None, target=None):
         filepath = cls._search_registry(fullname)
         if filepath is None:
             return None
         try:
-            _os.stat(filepath)
+            _path_stat(filepath)
         except OSError:
             return None
         for loader, suffixes in _get_supported_file_loaders():
             if filepath.endswith(tuple(suffixes)):
-                return loader(fullname, filepath)
+                spec = spec_from_loader(fullname, loader(fullname, filepath),
+                                        origin=filepath)
+                return spec
+
+    @classmethod
+    def find_module(cls, fullname, path=None):
+        """Find module named in the registry.
+
+        This method is deprecated.  Use exec_module() instead.
+
+        """
+        spec = cls.find_spec(fullname, path)
+        if spec is not None:
+            return spec.loader
+        else:
+            return None
 
 
 class _LoaderBasics:
@@ -799,74 +1462,15 @@
         tail_name = fullname.rpartition('.')[2]
         return filename_base == '__init__' and tail_name != '__init__'
 
-    def _bytes_from_bytecode(self, fullname, data, bytecode_path, source_stats):
-        """Return the marshalled bytes from bytecode, verifying the magic
-        number, timestamp and source size along the way.
+    def exec_module(self, module):
+        """Execute the module."""
+        code = self.get_code(module.__name__)
+        if code is None:
+            raise ImportError('cannot load module {!r} when get_code() '
+                              'returns None'.format(module.__name__))
+        _call_with_frames_removed(exec, code, module.__dict__)
 
-        If source_stats is None then skip the timestamp check.
-
-        """
-        magic = data[:4]
-        raw_timestamp = data[4:8]
-        raw_size = data[8:12]
-        if magic != _MAGIC_BYTES:
-            msg = 'bad magic number in {!r}: {!r}'.format(fullname, magic)
-            _verbose_message(msg)
-            raise ImportError(msg, name=fullname, path=bytecode_path)
-        elif len(raw_timestamp) != 4:
-            message = 'bad timestamp in {}'.format(fullname)
-            _verbose_message(message)
-            raise EOFError(message)
-        elif len(raw_size) != 4:
-            message = 'bad size in {}'.format(fullname)
-            _verbose_message(message)
-            raise EOFError(message)
-        if source_stats is not None:
-            try:
-                source_mtime = int(source_stats['mtime'])
-            except KeyError:
-                pass
-            else:
-                if _r_long(raw_timestamp) != source_mtime:
-                    message = 'bytecode is stale for {}'.format(fullname)
-                    _verbose_message(message)
-                    raise ImportError(message, name=fullname,
-                                      path=bytecode_path)
-            try:
-                source_size = source_stats['size'] & 0xFFFFFFFF
-            except KeyError:
-                pass
-            else:
-                if _r_long(raw_size) != source_size:
-                    raise ImportError(
-                        "bytecode is stale for {}".format(fullname),
-                        name=fullname, path=bytecode_path)
-        # Can't return the code object as errors from marshal loading need to
-        # propagate even when source is available.
-        return data[12:]
-
-    @module_for_loader
-    def _load_module(self, module, *, sourceless=False):
-        """Helper for load_module able to handle either source or sourceless
-        loading."""
-        name = module.__name__
-        code_object = self.get_code(name)
-        module.__file__ = self.get_filename(name)
-        if not sourceless:
-            try:
-                module.__cached__ = cache_from_source(module.__file__)
-            except NotImplementedError:
-                module.__cached__ = module.__file__
-        else:
-            module.__cached__ = module.__file__
-        module.__package__ = name
-        if self.is_package(name):
-            module.__path__ = [_path_split(module.__file__)[0]]
-        else:
-            module.__package__ = module.__package__.rpartition('.')[0]
-        module.__loader__ = self
-        _call_with_frames_removed(exec, code_object, module.__dict__)
-        return module
+    load_module = _load_module_shim
 
 
 class SourceLoader(_LoaderBasics):
@@ -874,8 +1478,10 @@
     def path_mtime(self, path):
         """Optional method that returns the modification time (an int) for the
         specified path, where path is a str.
+
+        Raises IOError when the path cannot be handled.
         """
-        raise NotImplementedError
+        raise IOError
 
     def path_stats(self, path):
         """Optional method returning a metadata dict for the specified path
@@ -886,6 +1492,7 @@
         - 'size' (optional) is the size in bytes of the source code.
 
         Implementing this method allows the loader to read bytecode files.
+        Raises IOError when the path cannot be handled.
         """
         return {'mtime': self.path_mtime(path)}
 
@@ -903,32 +1510,26 @@
         """Optional method which writes data (bytes) to a file path (a str).
 
         Implementing this method allows for the writing of bytecode files.
-
         """
-        raise NotImplementedError
 
 
     def get_source(self, fullname):
         """Concrete implementation of InspectLoader.get_source."""
-        import tokenize
         path = self.get_filename(fullname)
         try:
             source_bytes = self.get_data(path)
-        except IOError as exc:
-            raise ImportError("source not available through get_data()",
+        except OSError as exc:
+            raise ImportError('source not available through get_data()',
                               name=fullname) from exc
-        readsource = _io.BytesIO(source_bytes).readline
-        try:
-            encoding = tokenize.detect_encoding(readsource)
-        except SyntaxError as exc:
-            raise ImportError("Failed to detect encoding",
-                              name=fullname) from exc
-        newline_decoder = _io.IncrementalNewlineDecoder(None, True)
-        try:
-            return newline_decoder.decode(source_bytes.decode(encoding[0]))
-        except UnicodeDecodeError as exc:
-            raise ImportError("Failed to decode source file",
-                              name=fullname) from exc
+        return decode_source(source_bytes)
+
+    def source_to_code(self, data, path, *, _optimize=-1):
+        """Return the code object compiled from source.
+
+        The 'data' argument can be any object type that compile() supports.
+        """
+        return _call_with_frames_removed(compile, data, path, 'exec',
+                                        dont_inherit=True, optimize=_optimize)
 
     def get_code(self, fullname):
         """Concrete implementation of InspectLoader.get_code.
@@ -946,45 +1547,34 @@
         else:
             try:
                 st = self.path_stats(source_path)
-            except NotImplementedError:
+            except IOError:
                 pass
             else:
                 source_mtime = int(st['mtime'])
                 try:
                     data = self.get_data(bytecode_path)
-                except IOError:
+                except OSError:
                     pass
                 else:
                     try:
-                        bytes_data = self._bytes_from_bytecode(fullname, data,
-                                                               bytecode_path,
-                                                               st)
+                        bytes_data = _validate_bytecode_header(data,
+                                source_stats=st, name=fullname,
+                                path=bytecode_path)
                     except (ImportError, EOFError):
                         pass
                     else:
                         _verbose_message('{} matches {}', bytecode_path,
                                         source_path)
-                        found = marshal.loads(bytes_data)
-                        if isinstance(found, _code_type):
-                            _imp._fix_co_filename(found, source_path)
-                            _verbose_message('code object from {}',
-                                            bytecode_path)
-                            return found
-                        else:
-                            msg = "Non-code object in {}"
-                            raise ImportError(msg.format(bytecode_path),
-                                              name=fullname, path=bytecode_path)
+                        return _compile_bytecode(bytes_data, name=fullname,
+                                                 bytecode_path=bytecode_path,
+                                                 source_path=source_path)
         source_bytes = self.get_data(source_path)
-        code_object = _call_with_frames_removed(compile,
-                          source_bytes, source_path, 'exec',
-                          dont_inherit=True)
+        code_object = self.source_to_code(source_bytes, source_path)
         _verbose_message('code object from {}', source_path)
         if (not sys.dont_write_bytecode and bytecode_path is not None and
-            source_mtime is not None):
-            data = bytearray(_MAGIC_BYTES)
-            data.extend(_w_long(source_mtime))
-            data.extend(_w_long(len(source_bytes)))
-            data.extend(marshal.dumps(code_object))
+                source_mtime is not None):
+            data = _code_to_bytecode(code_object, source_mtime,
+                    len(source_bytes))
             try:
                 self._cache_bytecode(source_path, bytecode_path, data)
                 _verbose_message('wrote {!r}', bytecode_path)
@@ -992,16 +1582,6 @@
                 pass
         return code_object
 
-    def load_module(self, fullname):
-        """Concrete implementation of Loader.load_module.
-
-        Requires ExecutionLoader.get_filename and ResourceLoader.get_data to be
-        implemented to load source code. Use of bytecode is dictated by whether
-        get_code uses/writes bytecode.
-
-        """
-        return self._load_module(fullname)
-
 
 class FileLoader:
 
@@ -1014,10 +1594,22 @@
         self.name = fullname
         self.path = path
 
+    def __eq__(self, other):
+        return (self.__class__ == other.__class__ and
+                self.__dict__ == other.__dict__)
+
+    def __hash__(self):
+        return hash(self.name) ^ hash(self.path)
+
     @_check_name
     def load_module(self, fullname):
-        """Load a module from a file."""
-        # Issue #14857: Avoid the zero-argument form so the implementation
+        """Load a module from a file.
+
+        This method is deprecated.  Use exec_module() instead.
+
+        """
+        # The only reason for this method is for the name check.
+        # Issue #14857: Avoid the zero-argument form of super so the implementation
         # of that form can be updated without breaking the frozen module
         return super(FileLoader, self).load_module(fullname)
 
@@ -1038,18 +1630,12 @@
 
     def path_stats(self, path):
         """Return the metadata for the path."""
-        st = _os.stat(path)
+        st = _path_stat(path)
         return {'mtime': st.st_mtime, 'size': st.st_size}
 
     def _cache_bytecode(self, source_path, bytecode_path, data):
         # Adapt between the two APIs
-        try:
-            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
+        mode = _calc_mode(source_path)
         return self.set_data(bytecode_path, data, _mode=mode)
 
     def set_data(self, path, data, *, _mode=0o666):
@@ -1085,20 +1671,11 @@
 
     """Loader which handles sourceless file imports."""
 
-    def load_module(self, fullname):
-        return self._load_module(fullname, sourceless=True)
-
     def get_code(self, fullname):
         path = self.get_filename(fullname)
         data = self.get_data(path)
-        bytes_data = self._bytes_from_bytecode(fullname, data, path, None)
-        found = marshal.loads(bytes_data)
-        if isinstance(found, _code_type):
-            _verbose_message('code object from {!r}', path)
-            return found
-        else:
-            raise ImportError("Non-code object in {}".format(path),
-                              name=fullname, path=path)
+        bytes_data = _validate_bytecode_header(data, name=fullname, path=path)
+        return _compile_bytecode(bytes_data, name=fullname, bytecode_path=path)
 
     def get_source(self, fullname):
         """Return None as there is no source code."""
@@ -1121,23 +1698,30 @@
         self.name = name
         self.path = path
 
+    def __eq__(self, other):
+        return (self.__class__ == other.__class__ and
+                self.__dict__ == other.__dict__)
+
+    def __hash__(self):
+        return hash(self.name) ^ hash(self.path)
+
     @_check_name
-    @set_package
-    @set_loader
     def load_module(self, fullname):
         """Load an extension module."""
-        is_reload = fullname in sys.modules
-        try:
+        # Once an exec_module() implementation is added we can also
+        # add a deprecation warning here.
+        with _ManageReload(fullname):
             module = _call_with_frames_removed(_imp.load_dynamic,
                                                fullname, self.path)
-            _verbose_message('extension module loaded from {!r}', self.path)
-            if self.is_package(fullname) and not hasattr(module, '__path__'):
-                module.__path__ = [_path_split(self.path)[0]]
-            return module
-        except:
-            if not is_reload and fullname in sys.modules:
-                del sys.modules[fullname]
-            raise
+        _verbose_message('extension module loaded from {!r}', self.path)
+        is_package = self.is_package(fullname)
+        if is_package and not hasattr(module, '__path__'):
+            module.__path__ = [_path_split(self.path)[0]]
+        module.__loader__ = self
+        module.__package__ = module.__name__
+        if not is_package:
+            module.__package__ = module.__package__.rpartition('.')[0]
+        return module
 
     def is_package(self, fullname):
         """Return True if the extension module is a package."""
@@ -1153,6 +1737,11 @@
         """Return None as extension modules have no source code."""
         return None
 
+    @_check_name
+    def get_filename(self, fullname):
+        """Return the path to the source file as found by the finder."""
+        return self.path
+
 
 class _NamespacePath:
     """Represents a namespace package's path.  It uses the module name
@@ -1185,11 +1774,12 @@
         # If the parent's path has changed, recalculate _path
         parent_path = tuple(self._get_parent_path()) # Make a copy
         if parent_path != self._last_parent_path:
-            loader, new_path = self._path_finder(self._name, parent_path)
+            spec = self._path_finder(self._name, parent_path)
             # Note that no changes are made if a loader is returned, but we
             #  do remember the new parent path
-            if loader is None:
-                self._path = new_path
+            if spec is not None and spec.loader is None:
+                if spec.submodule_search_locations:
+                    self._path = spec.submodule_search_locations
             self._last_parent_path = parent_path     # Save the copy
         return self._path
 
@@ -1200,7 +1790,7 @@
         return len(self._recalculate())
 
     def __repr__(self):
-        return "_NamespacePath({!r})".format(self._path)
+        return '_NamespacePath({!r})'.format(self._path)
 
     def __contains__(self, item):
         return item in self._recalculate()
@@ -1209,20 +1799,41 @@
         self._path.append(item)
 
 
-class NamespaceLoader:
+# We use this exclusively in init_module_attrs() for backward-compatibility.
+class _NamespaceLoader:
     def __init__(self, name, path, path_finder):
         self._path = _NamespacePath(name, path, path_finder)
 
     @classmethod
     def module_repr(cls, module):
-        return "<module '{}' (namespace)>".format(module.__name__)
+        """Return repr for the module.
 
-    @module_for_loader
-    def load_module(self, module):
-        """Load a namespace module."""
+        The method is deprecated.  The import machinery does the job itself.
+
+        """
+        return '<module {!r} (namespace)>'.format(module.__name__)
+
+    def is_package(self, fullname):
+        return True
+
+    def get_source(self, fullname):
+        return ''
+
+    def get_code(self, fullname):
+        return compile('', '<string>', 'exec', dont_inherit=True)
+
+    def exec_module(self, module):
+        pass
+
+    def load_module(self, fullname):
+        """Load a namespace module.
+
+        This method is deprecated.  Use exec_module() instead.
+
+        """
+        # The import system never calls this method.
         _verbose_message('namespace module loaded with path {!r}', self._path)
-        module.__path__ = self._path
-        return module
+        return _load_module_shim(self, fullname)
 
 
 # Finders #####################################################################
@@ -1265,7 +1876,7 @@
 
         """
         if path == '':
-            path = '.'
+            path = _os.getcwd()
         try:
             finder = sys.path_importer_cache[path]
         except KeyError:
@@ -1274,7 +1885,22 @@
         return finder
 
     @classmethod
-    def _get_loader(cls, fullname, path):
+    def _legacy_get_spec(cls, fullname, finder):
+        # This would be a good place for a DeprecationWarning if
+        # we ended up going that route.
+        if hasattr(finder, 'find_loader'):
+            loader, portions = finder.find_loader(fullname)
+        else:
+            loader = finder.find_module(fullname)
+            portions = []
+        if loader is not None:
+            return spec_from_loader(fullname, loader)
+        spec = ModuleSpec(fullname, None)
+        spec.submodule_search_locations = portions
+        return spec
+
+    @classmethod
+    def _get_spec(cls, fullname, path, target=None):
         """Find the loader or namespace_path for this module/package name."""
         # If this ends up being a namespace package, namespace_path is
         #  the list of paths that will become its __path__
@@ -1284,38 +1910,61 @@
                 continue
             finder = cls._path_importer_cache(entry)
             if finder is not None:
-                if hasattr(finder, 'find_loader'):
-                    loader, portions = finder.find_loader(fullname)
+                if hasattr(finder, 'find_spec'):
+                    spec = finder.find_spec(fullname, target)
                 else:
-                    loader = finder.find_module(fullname)
-                    portions = []
-                if loader is not None:
-                    # We found a loader: return it immediately.
-                    return loader, namespace_path
+                    spec = cls._legacy_get_spec(fullname, finder)
+                if spec is None:
+                    continue
+                if spec.loader is not None:
+                    return spec
+                portions = spec.submodule_search_locations
+                if portions is None:
+                    raise ImportError('spec missing loader')
                 # This is possibly part of a namespace package.
                 #  Remember these path entries (if any) for when we
                 #  create a namespace package, and continue iterating
                 #  on path.
                 namespace_path.extend(portions)
         else:
-            return None, namespace_path
+            spec = ModuleSpec(fullname, None)
+            spec.submodule_search_locations = namespace_path
+            return spec
 
     @classmethod
-    def find_module(cls, fullname, path=None):
-        """Find the module on sys.path or 'path' based on sys.path_hooks and
+    def find_spec(cls, fullname, path=None, target=None):
+        """find the module on sys.path or 'path' based on sys.path_hooks and
         sys.path_importer_cache."""
         if path is None:
             path = sys.path
-        loader, namespace_path = cls._get_loader(fullname, path)
-        if loader is not None:
-            return loader
-        else:
+        spec = cls._get_spec(fullname, path, target)
+        if spec is None:
+            return None
+        elif spec.loader is None:
+            namespace_path = spec.submodule_search_locations
             if namespace_path:
                 # We found at least one namespace path.  Return a
-                #  loader which can create the namespace package.
-                return NamespaceLoader(fullname, namespace_path, cls._get_loader)
+                #  spec which can create the namespace package.
+                spec.origin = 'namespace'
+                spec.submodule_search_locations = _NamespacePath(fullname, namespace_path, cls._get_spec)
+                return spec
             else:
                 return None
+        else:
+            return spec
+
+    @classmethod
+    def find_module(cls, fullname, path=None):
+        """find the module on sys.path or 'path' based on sys.path_hooks and
+        sys.path_importer_cache.
+
+        This method is deprecated.  Use find_spec() instead.
+
+        """
+        spec = cls.find_spec(fullname, path)
+        if spec is None:
+            return None
+        return spec.loader
 
 
 class FileFinder:
@@ -1349,11 +1998,28 @@
 
     def find_loader(self, fullname):
         """Try to find a loader for the specified module, or the namespace
+        package portions. Returns (loader, list-of-portions).
+
+        This method is deprecated.  Use find_spec() instead.
+
+        """
+        spec = self.find_spec(fullname)
+        if spec is None:
+            return None, []
+        return spec.loader, spec.submodule_search_locations or []
+
+    def _get_spec(self, loader_class, fullname, path, smsl, target):
+        loader = loader_class(fullname, path)
+        return spec_from_file_location(fullname, path, loader=loader,
+                                       submodule_search_locations=smsl)
+
+    def find_spec(self, fullname, target=None):
+        """Try to find a loader for the specified module, or the namespace
         package portions. Returns (loader, list-of-portions)."""
         is_namespace = False
         tail_module = fullname.rpartition('.')[2]
         try:
-            mtime = _os.stat(self.path).st_mtime
+            mtime = _path_stat(self.path or _os.getcwd()).st_mtime
         except OSError:
             mtime = -1
         if mtime != self._path_mtime:
@@ -1369,33 +2035,34 @@
         # Check if the module is the name of a directory (and thus a package).
         if cache_module in cache:
             base_path = _path_join(self.path, tail_module)
-            if _path_isdir(base_path):
-                for suffix, loader in self._loaders:
-                    init_filename = '__init__' + suffix
-                    full_path = _path_join(base_path, init_filename)
-                    if _path_isfile(full_path):
-                        return (loader(fullname, full_path), [base_path])
-                else:
-                    # A namespace package, return the path if we don't also
-                    #  find a module in the next section.
-                    is_namespace = True
+            for suffix, loader_class in self._loaders:
+                init_filename = '__init__' + suffix
+                full_path = _path_join(base_path, init_filename)
+                if _path_isfile(full_path):
+                    return self._get_spec(loader_class, fullname, full_path, [base_path], target)
+            else:
+                # If a namespace package, return the path if we don't
+                #  find a module in the next section.
+                is_namespace = _path_isdir(base_path)
         # Check for a file w/ a proper suffix exists.
-        for suffix, loader in self._loaders:
+        for suffix, loader_class in self._loaders:
             full_path = _path_join(self.path, tail_module + suffix)
             _verbose_message('trying {}'.format(full_path), verbosity=2)
             if cache_module + suffix in cache:
                 if _path_isfile(full_path):
-                    return (loader(fullname, full_path), [])
+                    return self._get_spec(loader_class, fullname, full_path, None, target)
         if is_namespace:
             _verbose_message('possible namespace for {}'.format(base_path))
-            return (None, [base_path])
-        return (None, [])
+            spec = ModuleSpec(fullname, None)
+            spec.submodule_search_locations = [base_path]
+            return spec
+        return None
 
     def _fill_cache(self):
         """Fill the cache of potential modules and packages for this directory."""
         path = self.path
         try:
-            contents = _os.listdir(path)
+            contents = _os.listdir(path or _os.getcwd())
         except (FileNotFoundError, PermissionError, NotADirectoryError):
             # Directory has either been removed, turned into a file, or made
             # unreadable.
@@ -1420,7 +2087,7 @@
                 lower_suffix_contents.add(new_name)
             self._path_cache = lower_suffix_contents
         if sys.platform.startswith(_CASE_INSENSITIVE_PLATFORMS):
-            self._relaxed_path_cache = set(fn.lower() for fn in contents)
+            self._relaxed_path_cache = {fn.lower() for fn in contents}
 
     @classmethod
     def path_hook(cls, *loader_details):
@@ -1435,13 +2102,13 @@
         def path_hook_for_FileFinder(path):
             """Path hook for importlib.machinery.FileFinder."""
             if not _path_isdir(path):
-                raise ImportError("only directories are supported", path=path)
+                raise ImportError('only directories are supported', path=path)
             return cls(path, *loader_details)
 
         return path_hook_for_FileFinder
 
     def __repr__(self):
-        return "FileFinder(%r)" % (self.path,)
+        return 'FileFinder({!r})'.format(self.path)
 
 
 # Import itself ###############################################################
@@ -1468,19 +2135,51 @@
     return '{}.{}'.format(base, name) if name else base
 
 
-def _find_module(name, path):
+def _find_spec_legacy(finder, name, path):
+    # This would be a good place for a DeprecationWarning if
+    # we ended up going that route.
+    loader = finder.find_module(name, path)
+    if loader is None:
+        return None
+    return spec_from_loader(name, loader)
+
+
+def _find_spec(name, path, target=None):
     """Find a module's loader."""
     if not sys.meta_path:
         _warnings.warn('sys.meta_path is empty', ImportWarning)
+    # We check sys.modules here for the reload case.  While a passed-in
+    # target will usually indicate a reload there is no guarantee, whereas
+    # sys.modules provides one.
+    is_reload = name in sys.modules
     for finder in sys.meta_path:
         with _ImportLockContext():
-            loader = finder.find_module(name, path)
-        if loader is not None:
-            # The parent import may have already imported this module.
-            if name not in sys.modules:
-                return loader
+            try:
+                find_spec = finder.find_spec
+            except AttributeError:
+                spec = _find_spec_legacy(finder, name, path)
+                if spec is None:
+                    continue
             else:
-                return sys.modules[name].__loader__
+                spec = find_spec(name, path, target)
+        if spec is not None:
+            # The parent import may have already imported this module.
+            if not is_reload and name in sys.modules:
+                module = sys.modules[name]
+                try:
+                    __spec__ = module.__spec__
+                except AttributeError:
+                    # We use the found spec since that is the one that
+                    # we would have used if the parent module hadn't
+                    # beaten us to the punch.
+                    return spec
+                else:
+                    if __spec__ is None:
+                        return spec
+                    else:
+                        return __spec__
+            else:
+                return spec
     else:
         return None
 
@@ -1488,21 +2187,22 @@
 def _sanity_check(name, package, level):
     """Verify arguments are "sane"."""
     if not isinstance(name, str):
-        raise TypeError("module name must be str, not {}".format(type(name)))
+        raise TypeError('module name must be str, not {}'.format(type(name)))
     if level < 0:
         raise ValueError('level must be >= 0')
     if package:
         if not isinstance(package, str):
-            raise TypeError("__package__ not set to a string")
+            raise TypeError('__package__ not set to a string')
         elif package not in sys.modules:
-            msg = ("Parent module {!r} not loaded, cannot perform relative "
-                   "import")
+            msg = ('Parent module {!r} not loaded, cannot perform relative '
+                   'import')
             raise SystemError(msg.format(package))
     if not name and level == 0:
-        raise ValueError("Empty module name")
+        raise ValueError('Empty module name')
 
 
-_ERR_MSG = 'No module named {!r}'
+_ERR_MSG_PREFIX = 'No module named '
+_ERR_MSG = _ERR_MSG_PREFIX + '{!r}'
 
 def _find_and_load_unlocked(name, import_):
     path = None
@@ -1513,58 +2213,28 @@
         # Crazy side-effects!
         if name in sys.modules:
             return sys.modules[name]
-        # Backwards-compatibility; be nicer to skip the dict lookup.
         parent_module = sys.modules[parent]
         try:
             path = parent_module.__path__
         except AttributeError:
-            msg = (_ERR_MSG + '; {} is not a package').format(name, parent)
+            msg = (_ERR_MSG + '; {!r} is not a package').format(name, parent)
             raise ImportError(msg, name=name)
-    loader = _find_module(name, path)
-    if loader is None:
-        exc = ImportError(_ERR_MSG.format(name), name=name)
-        # TODO(brett): switch to a proper ModuleNotFound exception in Python
-        # 3.4.
-        exc._not_found = True
-        raise exc
-    elif name not in sys.modules:
-        # The parent import may have already imported this module.
-        loader.load_module(name)
-        _verbose_message('import {!r} # {!r}', name, loader)
-    # Backwards-compatibility; be nicer to skip the dict lookup.
-    module = sys.modules[name]
+    spec = _find_spec(name, path)
+    if spec is None:
+        raise ImportError(_ERR_MSG.format(name), name=name)
+    else:
+        module = _SpecMethods(spec)._load_unlocked()
     if parent:
         # Set the module as an attribute on its parent.
         parent_module = sys.modules[parent]
         setattr(parent_module, name.rpartition('.')[2], module)
-    # Set __package__ if the loader did not.
-    if getattr(module, '__package__', None) is None:
-        try:
-            module.__package__ = module.__name__
-            if not hasattr(module, '__path__'):
-                module.__package__ = module.__package__.rpartition('.')[0]
-        except AttributeError:
-            pass
-    # Set loader if need be.
-    if not hasattr(module, '__loader__'):
-        try:
-            module.__loader__ = loader
-        except AttributeError:
-            pass
     return module
 
 
 def _find_and_load(name, import_):
     """Find and load the module, and release the import lock."""
-    try:
-        lock = _get_module_lock(name)
-    finally:
-        _imp.release_lock()
-    lock.acquire()
-    try:
+    with _ModuleLockManager(name):
         return _find_and_load_unlocked(name, import_)
-    finally:
-        lock.release()
 
 
 def _gcd_import(name, package=None, level=0):
@@ -1585,8 +2255,8 @@
     module = sys.modules[name]
     if module is None:
         _imp.release_lock()
-        message = ("import of {} halted; "
-                    "None in sys.modules".format(name))
+        message = ('import of {} halted; '
+                   'None in sys.modules'.format(name))
         raise ImportError(message, name=name)
     _lock_unlock_module(name)
     return module
@@ -1616,9 +2286,7 @@
                     # 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 getattr(exc, '_not_found', False):
+                    if str(exc).startswith(_ERR_MSG_PREFIX):
                         if exc.name == from_name:
                             continue
                     raise
@@ -1686,6 +2354,13 @@
         return _handle_fromlist(module, fromlist, _gcd_import)
 
 
+def _builtin_from_name(name):
+    spec = BuiltinImporter.find_spec(name)
+    if spec is None:
+        raise ImportError('no built-in module named ' + name)
+    methods = _SpecMethods(spec)
+    return methods._load_unlocked()
+
 
 def _setup(sys_module, _imp_module):
     """Setup importlib by importing needed built-in modules and injecting them
@@ -1704,24 +2379,31 @@
     else:
         BYTECODE_SUFFIXES = DEBUG_BYTECODE_SUFFIXES
 
+    # Set up the spec for existing builtin/frozen modules.
     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
+            if name in sys.builtin_module_names:
+                loader = BuiltinImporter
+            elif _imp.is_frozen(name):
+                loader = FrozenImporter
+            else:
+                continue
+            spec = _spec_from_module(module, loader)
+            methods = _SpecMethods(spec)
+            methods.init_module_attrs(module)
 
+    # Directly load built-in modules needed during bootstrap.
     self_module = sys.modules[__name__]
     for builtin_name in ('_io', '_warnings', 'builtins', 'marshal'):
         if builtin_name not in sys.modules:
-            builtin_module = BuiltinImporter.load_module(builtin_name)
+            builtin_module = _builtin_from_name(builtin_name)
         else:
             builtin_module = sys.modules[builtin_name]
         setattr(self_module, builtin_name, builtin_module)
 
-    os_details = ('posix', ['/']), ('nt', ['\\', '/']), ('os2', ['\\', '/'])
+    # Directly load the os module (needed during bootstrap).
+    os_details = ('posix', ['/']), ('nt', ['\\', '/'])
     for builtin_os, path_separators in os_details:
         # Assumption made in _path_join()
         assert all(len(sep) == 1 for sep in path_separators)
@@ -1731,32 +2413,33 @@
             break
         else:
             try:
-                os_module = BuiltinImporter.load_module(builtin_os)
-                # TODO: rip out os2 code after 3.3 is released as per PEP 11
-                if builtin_os == 'os2' and 'EMX GCC' in sys.version:
-                    path_sep = path_separators[1]
+                os_module = _builtin_from_name(builtin_os)
                 break
             except ImportError:
                 continue
     else:
         raise ImportError('importlib requires posix or nt')
+    setattr(self_module, '_os', os_module)
+    setattr(self_module, 'path_sep', path_sep)
+    setattr(self_module, 'path_separators', ''.join(path_separators))
 
+    # Directly load the _thread module (needed during bootstrap).
     try:
-        thread_module = BuiltinImporter.load_module('_thread')
+        thread_module = _builtin_from_name('_thread')
     except ImportError:
         # Python was built without threads
         thread_module = None
-    weakref_module = BuiltinImporter.load_module('_weakref')
+    setattr(self_module, '_thread', thread_module)
 
+    # Directly load the _weakref module (needed during bootstrap).
+    weakref_module = _builtin_from_name('_weakref')
+    setattr(self_module, '_weakref', weakref_module)
+
+    # Directly load the winreg module (needed during bootstrap).
     if builtin_os == 'nt':
-        winreg_module = BuiltinImporter.load_module('winreg')
+        winreg_module = _builtin_from_name('winreg')
         setattr(self_module, '_winreg', winreg_module)
 
-    setattr(self_module, '_os', os_module)
-    setattr(self_module, '_thread', thread_module)
-    setattr(self_module, '_weakref', weakref_module)
-    setattr(self_module, 'path_sep', path_sep)
-    setattr(self_module, 'path_separators', set(path_separators))
     # Constants
     setattr(self_module, '_relax_case', _make_relax_case())
     EXTENSION_SUFFIXES.extend(_imp.extension_suffixes())
diff --git a/Lib/importlib/abc.py b/Lib/importlib/abc.py
index 387567a..558abd3 100644
--- a/Lib/importlib/abc.py
+++ b/Lib/importlib/abc.py
@@ -8,11 +8,6 @@
         raise
     _frozen_importlib = None
 import abc
-import imp
-import marshal
-import sys
-import tokenize
-import warnings
 
 
 def _register(abstract_cls, *classes):
@@ -37,28 +32,37 @@
     def find_module(self, fullname, path=None):
         """An abstract method that should find a module.
         The fullname is a str and the optional path is a str or None.
-        Returns a Loader object.
+        Returns a Loader object or None.
         """
-        raise NotImplementedError
 
 
 class MetaPathFinder(Finder):
 
     """Abstract base class for import finders on sys.meta_path."""
 
-    @abc.abstractmethod
+    # We don't define find_spec() here since that would break
+    # hasattr checks we do to support backward compatibility.
+
     def find_module(self, fullname, path):
-        """Abstract method which, when implemented, should find a module.
-        The fullname is a str and the path is a str or None.
-        Returns a Loader object.
+        """Return a loader for the module.
+
+        If no module is found, return None.  The fullname is a str and
+        the path is a list of strings or None.
+
+        This method is deprecated in favor of finder.find_spec(). If find_spec()
+        exists then backwards-compatible functionality is provided for this
+        method.
+
         """
-        raise NotImplementedError
+        if not hasattr(self, 'find_spec'):
+            return None
+        found = self.find_spec(fullname, path)
+        return found.loader if found is not None else None
 
     def invalidate_caches(self):
         """An optional method for clearing the finder's cache, if any.
         This method is used by importlib.invalidate_caches().
         """
-        return NotImplemented
 
 _register(MetaPathFinder, machinery.BuiltinImporter, machinery.FrozenImporter,
           machinery.PathFinder, machinery.WindowsRegistryFinder)
@@ -68,15 +72,35 @@
 
     """Abstract base class for path entry finders used by PathFinder."""
 
-    @abc.abstractmethod
+    # We don't define find_spec() here since that would break
+    # hasattr checks we do to support backward compatibility.
+
     def find_loader(self, fullname):
-        """Abstract method which, when implemented, returns a module loader.
-        The fullname is a str.  Returns a 2-tuple of (Loader, portion) where
-        portion is a sequence of file system locations contributing to part of
-        a namespace package.  The sequence may be empty and the loader may be
-        None.
+        """Return (loader, namespace portion) for the path entry.
+
+        The fullname is a str.  The namespace portion is a sequence of
+        path entries contributing to part of a namespace package. The
+        sequence may be empty.  If loader is not None, the portion will
+        be ignored.
+
+        The portion will be discarded if another path entry finder
+        locates the module as a normal module or package.
+
+        This method is deprecated in favor of finder.find_spec(). If find_spec()
+        is provided than backwards-compatible functionality is provided.
+
         """
-        raise NotImplementedError
+        if not hasattr(self, 'find_spec'):
+            return None, []
+        found = self.find_spec(fullname)
+        if found is not None:
+            if not found.submodule_search_locations:
+                portions = []
+            else:
+                portions = found.submodule_search_locations
+            return found.loader, portions
+        else:
+            return None, []
 
     find_module = _bootstrap._find_module_shim
 
@@ -84,7 +108,6 @@
         """An optional method for clearing the finder's cache, if any.
         This method is used by PathFinder.invalidate_caches().
         """
-        return NotImplemented
 
 _register(PathEntryFinder, machinery.FileFinder)
 
@@ -93,16 +116,49 @@
 
     """Abstract base class for import loaders."""
 
-    @abc.abstractmethod
-    def load_module(self, fullname):
-        """Abstract method which when implemented should load a module.
-        The fullname is a str."""
-        raise NotImplementedError
+    def create_module(self, spec):
+        """Return a module to initialize and into which to load.
 
-    @abc.abstractmethod
+        This method should raise ImportError if anything prevents it
+        from creating a new module.  It may return None to indicate
+        that the spec should create the new module.
+
+        create_module() is optional.
+
+        """
+        # By default, defer to _SpecMethods.create() for the new module.
+        return None
+
+    # We don't define exec_module() here since that would break
+    # hasattr checks we do to support backward compatibility.
+
+    def load_module(self, fullname):
+        """Return the loaded module.
+
+        The module must be added to sys.modules and have import-related
+        attributes set properly.  The fullname is a str.
+
+        ImportError is raised on failure.
+
+        This method is deprecated in favor of loader.exec_module(). If
+        exec_module() exists then it is used to provide a backwards-compatible
+        functionality for this method.
+
+        """
+        if not hasattr(self, 'exec_module'):
+            raise ImportError
+        return _bootstrap._load_module_shim(self, fullname)
+
     def module_repr(self, module):
-        """Abstract method which when implemented calculates and returns the
-        given module's repr."""
+        """Return a module's repr.
+
+        Used by the module type when the method does not raise
+        NotImplementedError.
+
+        This method is deprecated.
+
+        """
+        # The exception will cause ModuleType.__repr__ to ignore this method.
         raise NotImplementedError
 
 
@@ -119,7 +175,7 @@
     def get_data(self, path):
         """Abstract method which when implemented should return the bytes for
         the specified path.  The path must be a str."""
-        raise NotImplementedError
+        raise IOError
 
 
 class InspectLoader(Loader):
@@ -131,26 +187,47 @@
 
     """
 
-    @abc.abstractmethod
     def is_package(self, fullname):
-        """Abstract method which when implemented should return whether the
-        module is a package.  The fullname is a str.  Returns a bool."""
-        raise NotImplementedError
+        """Optional method which when implemented should return whether the
+        module is a package.  The fullname is a str.  Returns a bool.
 
-    @abc.abstractmethod
+        Raises ImportError if the module cannot be found.
+        """
+        raise ImportError
+
     def get_code(self, fullname):
-        """Abstract method which when implemented should return the code object
-        for the module.  The fullname is a str.  Returns a types.CodeType."""
-        raise NotImplementedError
+        """Method which returns the code object for the module.
+
+        The fullname is a str.  Returns a types.CodeType if possible, else
+        returns None if a code object does not make sense
+        (e.g. built-in module). Raises ImportError if the module cannot be
+        found.
+        """
+        source = self.get_source(fullname)
+        if source is None:
+            return None
+        return self.source_to_code(source)
 
     @abc.abstractmethod
     def get_source(self, fullname):
         """Abstract method which should return the source code for the
-        module.  The fullname is a str.  Returns a str."""
-        raise NotImplementedError
+        module.  The fullname is a str.  Returns a str.
 
-_register(InspectLoader, machinery.BuiltinImporter, machinery.FrozenImporter,
-            machinery.ExtensionFileLoader)
+        Raises ImportError if the module cannot be found.
+        """
+        raise ImportError
+
+    def source_to_code(self, data, path='<string>'):
+        """Compile 'data' into a code object.
+
+        The 'data' argument can be anything that compile() can handle. The'path'
+        argument should be where the data was retrieved (when applicable)."""
+        return compile(data, path, 'exec', dont_inherit=True)
+
+    exec_module = _bootstrap._LoaderBasics.exec_module
+    load_module = _bootstrap._LoaderBasics.load_module
+
+_register(InspectLoader, machinery.BuiltinImporter, machinery.FrozenImporter)
 
 
 class ExecutionLoader(InspectLoader):
@@ -165,8 +242,29 @@
     @abc.abstractmethod
     def get_filename(self, fullname):
         """Abstract method which should return the value that __file__ is to be
-        set to."""
-        raise NotImplementedError
+        set to.
+
+        Raises ImportError if the module cannot be found.
+        """
+        raise ImportError
+
+    def get_code(self, fullname):
+        """Method to return the code object for fullname.
+
+        Should return None if not applicable (e.g. built-in module).
+        Raise ImportError if the module cannot be found.
+        """
+        source = self.get_source(fullname)
+        if source is None:
+            return None
+        try:
+            path = self.get_filename(fullname)
+        except ImportError:
+            return self.source_to_code(source)
+        else:
+            return self.source_to_code(source, path)
+
+_register(ExecutionLoader, machinery.ExtensionFileLoader)
 
 
 class FileLoader(_bootstrap.FileLoader, ResourceLoader, ExecutionLoader):
@@ -198,7 +296,7 @@
     def path_mtime(self, path):
         """Return the (int) modification time for the path (str)."""
         if self.path_stats.__func__ is SourceLoader.path_stats:
-            raise NotImplementedError
+            raise IOError
         return int(self.path_stats(path)['mtime'])
 
     def path_stats(self, path):
@@ -209,7 +307,7 @@
         - 'size' (optional) is the size in bytes of the source code.
         """
         if self.path_mtime.__func__ is SourceLoader.path_mtime:
-            raise NotImplementedError
+            raise IOError
         return {'mtime': self.path_mtime(path)}
 
     def set_data(self, path, data):
@@ -220,185 +318,6 @@
         Any needed intermediary directories are to be created. If for some
         reason the file cannot be written because of permissions, fail
         silently.
-
         """
-        raise NotImplementedError
 
 _register(SourceLoader, machinery.SourceFileLoader)
-
-class PyLoader(SourceLoader):
-
-    """Implement the deprecated PyLoader ABC in terms of SourceLoader.
-
-    This class has been deprecated! It is slated for removal in Python 3.4.
-    If compatibility with Python 3.1 is not needed then implement the
-    SourceLoader ABC instead of this class. If Python 3.1 compatibility is
-    needed, then use the following idiom to have a single class that is
-    compatible with Python 3.1 onwards::
-
-        try:
-            from importlib.abc import SourceLoader
-        except ImportError:
-            from importlib.abc import PyLoader as SourceLoader
-
-
-        class CustomLoader(SourceLoader):
-            def get_filename(self, fullname):
-                # Implement ...
-
-            def source_path(self, fullname):
-                '''Implement source_path in terms of get_filename.'''
-                try:
-                    return self.get_filename(fullname)
-                except ImportError:
-                    return None
-
-            def is_package(self, fullname):
-                filename = os.path.basename(self.get_filename(fullname))
-                return os.path.splitext(filename)[0] == '__init__'
-
-    """
-
-    @abc.abstractmethod
-    def is_package(self, fullname):
-        raise NotImplementedError
-
-    @abc.abstractmethod
-    def source_path(self, fullname):
-        """Abstract method.  Accepts a str module name and returns the path to
-        the source code for the module."""
-        raise NotImplementedError
-
-    def get_filename(self, fullname):
-        """Implement get_filename in terms of source_path.
-
-        As get_filename should only return a source file path there is no
-        chance of the path not existing but loading still being possible, so
-        ImportError should propagate instead of being turned into returning
-        None.
-
-        """
-        warnings.warn("importlib.abc.PyLoader is deprecated and is "
-                            "slated for removal in Python 3.4; "
-                            "use SourceLoader instead. "
-                            "See the importlib documentation on how to be "
-                            "compatible with Python 3.1 onwards.",
-                        DeprecationWarning)
-        path = self.source_path(fullname)
-        if path is None:
-            raise ImportError(name=fullname)
-        else:
-            return path
-
-
-class PyPycLoader(PyLoader):
-
-    """Abstract base class to assist in loading source and bytecode by
-    requiring only back-end storage methods to be implemented.
-
-    This class has been deprecated! Removal is slated for Python 3.4. Implement
-    the SourceLoader ABC instead. If Python 3.1 compatibility is needed, see
-    PyLoader.
-
-    The methods get_code, get_source, and load_module are implemented for the
-    user.
-
-    """
-
-    def get_filename(self, fullname):
-        """Return the source or bytecode file path."""
-        path = self.source_path(fullname)
-        if path is not None:
-            return path
-        path = self.bytecode_path(fullname)
-        if path is not None:
-            return path
-        raise ImportError("no source or bytecode path available for "
-                            "{0!r}".format(fullname), name=fullname)
-
-    def get_code(self, fullname):
-        """Get a code object from source or bytecode."""
-        warnings.warn("importlib.abc.PyPycLoader is deprecated and slated for "
-                            "removal in Python 3.4; use SourceLoader instead. "
-                            "If Python 3.1 compatibility is required, see the "
-                            "latest documentation for PyLoader.",
-                        DeprecationWarning)
-        source_timestamp = self.source_mtime(fullname)
-        # Try to use bytecode if it is available.
-        bytecode_path = self.bytecode_path(fullname)
-        if bytecode_path:
-            data = self.get_data(bytecode_path)
-            try:
-                magic = data[:4]
-                if len(magic) < 4:
-                    raise ImportError(
-                        "bad magic number in {}".format(fullname),
-                        name=fullname, path=bytecode_path)
-                raw_timestamp = data[4:8]
-                if len(raw_timestamp) < 4:
-                    raise EOFError("bad timestamp in {}".format(fullname))
-                pyc_timestamp = _bootstrap._r_long(raw_timestamp)
-                raw_source_size = data[8:12]
-                if len(raw_source_size) != 4:
-                    raise EOFError("bad file size in {}".format(fullname))
-                # Source size is unused as the ABC does not provide a way to
-                # get the size of the source ahead of reading it.
-                bytecode = data[12:]
-                # Verify that the magic number is valid.
-                if imp.get_magic() != magic:
-                    raise ImportError(
-                        "bad magic number in {}".format(fullname),
-                        name=fullname, path=bytecode_path)
-                # Verify that the bytecode is not stale (only matters when
-                # there is source to fall back on.
-                if source_timestamp:
-                    if pyc_timestamp < source_timestamp:
-                        raise ImportError("bytecode is stale", name=fullname,
-                                          path=bytecode_path)
-            except (ImportError, EOFError):
-                # If source is available give it a shot.
-                if source_timestamp is not None:
-                    pass
-                else:
-                    raise
-            else:
-                # Bytecode seems fine, so try to use it.
-                return marshal.loads(bytecode)
-        elif source_timestamp is None:
-            raise ImportError("no source or bytecode available to create code "
-                              "object for {0!r}".format(fullname),
-                              name=fullname)
-        # Use the source.
-        source_path = self.source_path(fullname)
-        if source_path is None:
-            message = "a source path must exist to load {0}".format(fullname)
-            raise ImportError(message, name=fullname)
-        source = self.get_data(source_path)
-        code_object = compile(source, source_path, 'exec', dont_inherit=True)
-        # Generate bytecode and write it out.
-        if not sys.dont_write_bytecode:
-            data = bytearray(imp.get_magic())
-            data.extend(_bootstrap._w_long(source_timestamp))
-            data.extend(_bootstrap._w_long(len(source) & 0xFFFFFFFF))
-            data.extend(marshal.dumps(code_object))
-            self.write_bytecode(fullname, data)
-        return code_object
-
-    @abc.abstractmethod
-    def source_mtime(self, fullname):
-        """Abstract method. Accepts a str filename and returns an int
-        modification time for the source of the module."""
-        raise NotImplementedError
-
-    @abc.abstractmethod
-    def bytecode_path(self, fullname):
-        """Abstract method. Accepts a str filename and returns the str pathname
-        to the bytecode for the module."""
-        raise NotImplementedError
-
-    @abc.abstractmethod
-    def write_bytecode(self, fullname, bytecode):
-        """Abstract method.  Accepts a str filename and bytes object
-        representing the bytecode for the module.  Returns a boolean
-        representing whether the bytecode was written or not."""
-        raise NotImplementedError
diff --git a/Lib/importlib/machinery.py b/Lib/importlib/machinery.py
index ff826e4..2e1b2d7 100644
--- a/Lib/importlib/machinery.py
+++ b/Lib/importlib/machinery.py
@@ -5,6 +5,7 @@
 from ._bootstrap import (SOURCE_SUFFIXES, DEBUG_BYTECODE_SUFFIXES,
                          OPTIMIZED_BYTECODE_SUFFIXES, BYTECODE_SUFFIXES,
                          EXTENSION_SUFFIXES)
+from ._bootstrap import ModuleSpec
 from ._bootstrap import BuiltinImporter
 from ._bootstrap import FrozenImporter
 from ._bootstrap import WindowsRegistryFinder
diff --git a/Lib/importlib/util.py b/Lib/importlib/util.py
index 1316437..6d73b1d 100644
--- a/Lib/importlib/util.py
+++ b/Lib/importlib/util.py
@@ -1,9 +1,18 @@
 """Utility code for constructing importers, etc."""
 
-from ._bootstrap import module_for_loader
-from ._bootstrap import set_loader
-from ._bootstrap import set_package
+from ._bootstrap import MAGIC_NUMBER
+from ._bootstrap import cache_from_source
+from ._bootstrap import decode_source
+from ._bootstrap import source_from_cache
+from ._bootstrap import spec_from_loader
+from ._bootstrap import spec_from_file_location
 from ._bootstrap import _resolve_name
+from ._bootstrap import _find_spec
+
+from contextlib import contextmanager
+import functools
+import sys
+import warnings
 
 
 def resolve_name(name, package):
@@ -19,3 +28,175 @@
             break
         level += 1
     return _resolve_name(name[level:], package, level)
+
+
+def _find_spec_from_path(name, path=None):
+    """Return the spec for the specified module.
+
+    First, sys.modules is checked to see if the module was already imported. If
+    so, then sys.modules[name].__spec__ is returned. If that happens to be
+    set to None, then ValueError is raised. If the module is not in
+    sys.modules, then sys.meta_path is searched for a suitable spec with the
+    value of 'path' given to the finders. None is returned if no spec could
+    be found.
+
+    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 spec.
+
+    """
+    if name not in sys.modules:
+        return _find_spec(name, path)
+    else:
+        module = sys.modules[name]
+        if module is None:
+            return None
+        try:
+            spec = module.__spec__
+        except AttributeError:
+            raise ValueError('{}.__spec__ is not set'.format(name))
+        else:
+            if spec is None:
+                raise ValueError('{}.__spec__ is None'.format(name))
+            return spec
+
+
+def find_spec(name, package=None):
+    """Return the spec for the specified module.
+
+    First, sys.modules is checked to see if the module was already imported. If
+    so, then sys.modules[name].__spec__ is returned. If that happens to be
+    set to None, then ValueError is raised. If the module is not in
+    sys.modules, then sys.meta_path is searched for a suitable spec with the
+    value of 'path' given to the finders. None is returned if no spec could
+    be found.
+
+    If the name is for submodule (contains a dot), the parent module is
+    automatically imported.
+
+    The name and package arguments work the same as importlib.import_module().
+    In other words, relative module names (with leading dots) work.
+
+    """
+    fullname = resolve_name(name, package) if name.startswith('.') else name
+    if fullname not in sys.modules:
+        parent_name = fullname.rpartition('.')[0]
+        if parent_name:
+            # Use builtins.__import__() in case someone replaced it.
+            parent = __import__(parent_name, fromlist=['__path__'])
+            return _find_spec(fullname, parent.__path__)
+        else:
+            return _find_spec(fullname, None)
+    else:
+        module = sys.modules[fullname]
+        if module is None:
+            return None
+        try:
+            spec = module.__spec__
+        except AttributeError:
+            raise ValueError('{}.__spec__ is not set'.format(name))
+        else:
+            if spec is None:
+                raise ValueError('{}.__spec__ is None'.format(name))
+            return spec
+
+
+@contextmanager
+def _module_to_load(name):
+    is_reload = name in sys.modules
+
+    module = sys.modules.get(name)
+    if not is_reload:
+        # This must be done before open() is called as the 'io' module
+        # implicitly imports 'locale' and would otherwise trigger an
+        # infinite loop.
+        module = type(sys)(name)
+        # This must be done before putting the module in sys.modules
+        # (otherwise an optimization shortcut in import.c becomes wrong)
+        module.__initializing__ = True
+        sys.modules[name] = module
+    try:
+        yield module
+    except Exception:
+        if not is_reload:
+            try:
+                del sys.modules[name]
+            except KeyError:
+                pass
+    finally:
+        module.__initializing__ = False
+
+
+def set_package(fxn):
+    """Set __package__ on the returned module.
+
+    This function is deprecated.
+
+    """
+    @functools.wraps(fxn)
+    def set_package_wrapper(*args, **kwargs):
+        warnings.warn('The import system now takes care of this automatically.',
+                      DeprecationWarning, stacklevel=2)
+        module = fxn(*args, **kwargs)
+        if getattr(module, '__package__', None) is None:
+            module.__package__ = module.__name__
+            if not hasattr(module, '__path__'):
+                module.__package__ = module.__package__.rpartition('.')[0]
+        return module
+    return set_package_wrapper
+
+
+def set_loader(fxn):
+    """Set __loader__ on the returned module.
+
+    This function is deprecated.
+
+    """
+    @functools.wraps(fxn)
+    def set_loader_wrapper(self, *args, **kwargs):
+        warnings.warn('The import system now takes care of this automatically.',
+                      DeprecationWarning, stacklevel=2)
+        module = fxn(self, *args, **kwargs)
+        if getattr(module, '__loader__', None) is None:
+            module.__loader__ = self
+        return module
+    return set_loader_wrapper
+
+
+def module_for_loader(fxn):
+    """Decorator to handle selecting the proper module for loaders.
+
+    The decorated function is passed the module to use instead of the module
+    name. The module passed in to the function is either from sys.modules if
+    it already exists or is a new module. If the module is new, then __name__
+    is set the first argument to the method, __loader__ is set to self, and
+    __package__ is set accordingly (if self.is_package() is defined) will be set
+    before it is passed to the decorated function (if self.is_package() does
+    not work for the module it will be set post-load).
+
+    If an exception is raised and the decorator created the module it is
+    subsequently removed from sys.modules.
+
+    The decorator assumes that the decorated function takes the module name as
+    the second argument.
+
+    """
+    warnings.warn('The import system now takes care of this automatically.',
+                  DeprecationWarning, stacklevel=2)
+    @functools.wraps(fxn)
+    def module_for_loader_wrapper(self, fullname, *args, **kwargs):
+        with _module_to_load(fullname) as module:
+            module.__loader__ = self
+            try:
+                is_package = self.is_package(fullname)
+            except (ImportError, AttributeError):
+                pass
+            else:
+                if is_package:
+                    module.__package__ = fullname
+                else:
+                    module.__package__ = fullname.rpartition('.')[0]
+            # If __package__ was not set above, __import__() will do it later.
+            return fxn(self, module, *args, **kwargs)
+
+    return module_for_loader_wrapper
diff --git a/Lib/inspect.py b/Lib/inspect.py
index 680623d..1641824 100644
--- a/Lib/inspect.py
+++ b/Lib/inspect.py
@@ -31,7 +31,7 @@
 __author__ = ('Ka-Ping Yee <ping@lfw.org>',
               'Yury Selivanov <yselivanov@sprymix.com>')
 
-import imp
+import ast
 import importlib.machinery
 import itertools
 import linecache
@@ -39,6 +39,7 @@
 import re
 import sys
 import tokenize
+import token
 import types
 import warnings
 import functools
@@ -48,7 +49,7 @@
 
 # Create constants for the compiler flags in Include/code.h
 # We try to get them from dis to avoid duplication, but fall
-# back to hardcoding so the dependency is optional
+# back to hard-coding so the dependency is optional
 try:
     from dis import COMPILER_FLAG_NAMES as _flag_names
 except ImportError:
@@ -268,21 +269,40 @@
     else:
         mro = ()
     results = []
-    for key in dir(object):
-        # First try to get the value via __dict__. Some descriptors don't
-        # like calling their __get__ (see bug #1785).
-        for base in mro:
-            if key in base.__dict__:
-                value = base.__dict__[key]
-                break
-        else:
-            try:
-                value = getattr(object, key)
-            except AttributeError:
+    processed = set()
+    names = dir(object)
+    # :dd any DynamicClassAttributes to the list of names if object is a class;
+    # this may result in duplicate entries if, for example, a virtual
+    # attribute with the same name as a DynamicClassAttribute exists
+    try:
+        for base in object.__bases__:
+            for k, v in base.__dict__.items():
+                if isinstance(v, types.DynamicClassAttribute):
+                    names.append(k)
+    except AttributeError:
+        pass
+    for key in names:
+        # First try to get the value via getattr.  Some descriptors don't
+        # like calling their __get__ (see bug #1785), so fall back to
+        # looking in the __dict__.
+        try:
+            value = getattr(object, key)
+            # handle the duplicate key
+            if key in processed:
+                raise AttributeError
+        except AttributeError:
+            for base in mro:
+                if key in base.__dict__:
+                    value = base.__dict__[key]
+                    break
+            else:
+                # could be a (currently) missing slot member, or a buggy
+                # __dir__; discard and move on
                 continue
         if not predicate or predicate(value):
             results.append((key, value))
-    results.sort()
+        processed.add(key)
+    results.sort(key=lambda pair: pair[0])
     return results
 
 Attribute = namedtuple('Attribute', 'name kind defining_class object')
@@ -299,60 +319,106 @@
                'class method'    created via classmethod()
                'static method'   created via staticmethod()
                'property'        created via property()
-               'method'          any other flavor of method
+               'method'          any other flavor of method or descriptor
                'data'            not a method
 
         2. The class which defined this attribute (a class).
 
-        3. The object as obtained directly from the defining class's
-           __dict__, not via getattr.  This is especially important for
-           data attributes:  C.data is just a data object, but
-           C.__dict__['data'] may be a data descriptor with additional
-           info, like a __doc__ string.
+        3. The object as obtained by calling getattr; if this fails, or if the
+           resulting object does not live anywhere in the class' mro (including
+           metaclasses) then the object is looked up in the defining class's
+           dict (found by walking the mro).
+
+    If one of the items in dir(cls) is stored in the metaclass it will now
+    be discovered and not have None be listed as the class in which it was
+    defined.  Any items whose home class cannot be discovered are skipped.
     """
 
     mro = getmro(cls)
+    metamro = getmro(type(cls)) # for attributes stored in the metaclass
+    metamro = tuple([cls for cls in metamro if cls not in (type, object)])
+    class_bases = (cls,) + mro
+    all_bases = class_bases + metamro
     names = dir(cls)
+    # :dd any DynamicClassAttributes to the list of names;
+    # this may result in duplicate entries if, for example, a virtual
+    # attribute with the same name as a DynamicClassAttribute exists.
+    for base in mro:
+        for k, v in base.__dict__.items():
+            if isinstance(v, types.DynamicClassAttribute):
+                names.append(k)
     result = []
+    processed = set()
+
     for name in names:
         # Get the object associated with the name, and where it was defined.
+        # Normal objects will be looked up with both getattr and directly in
+        # its class' dict (in case getattr fails [bug #1785], and also to look
+        # for a docstring).
+        # For DynamicClassAttributes on the second pass we only look in the
+        # class's dict.
+        #
         # Getting an obj from the __dict__ sometimes reveals more than
         # using getattr.  Static and class methods are dramatic examples.
-        # Furthermore, some objects may raise an Exception when fetched with
-        # getattr(). This is the case with some descriptors (bug #1785).
-        # Thus, we only use getattr() as a last resort.
         homecls = None
-        for base in (cls,) + mro:
-            if name in base.__dict__:
-                obj = base.__dict__[name]
-                homecls = base
-                break
-        else:
-            obj = getattr(cls, name)
-            homecls = getattr(obj, "__objclass__", homecls)
-
-        # Classify the object.
-        if isinstance(obj, staticmethod):
-            kind = "static method"
-        elif isinstance(obj, classmethod):
-            kind = "class method"
-        elif isinstance(obj, property):
-            kind = "property"
-        elif ismethoddescriptor(obj):
-            kind = "method"
-        elif isdatadescriptor(obj):
-            kind = "data"
-        else:
-            obj_via_getattr = getattr(cls, name)
-            if (isfunction(obj_via_getattr) or
-                ismethoddescriptor(obj_via_getattr)):
-                kind = "method"
+        get_obj = None
+        dict_obj = None
+        if name not in processed:
+            try:
+                if name == '__dict__':
+                    raise Exception("__dict__ is special, don't want the proxy")
+                get_obj = getattr(cls, name)
+            except Exception as exc:
+                pass
             else:
-                kind = "data"
-            obj = obj_via_getattr
-
+                homecls = getattr(get_obj, "__objclass__", homecls)
+                if homecls not in class_bases:
+                    # if the resulting object does not live somewhere in the
+                    # mro, drop it and search the mro manually
+                    homecls = None
+                    last_cls = None
+                    # first look in the classes
+                    for srch_cls in class_bases:
+                        srch_obj = getattr(srch_cls, name, None)
+                        if srch_obj == get_obj:
+                            last_cls = srch_cls
+                    # then check the metaclasses
+                    for srch_cls in metamro:
+                        try:
+                            srch_obj = srch_cls.__getattr__(cls, name)
+                        except AttributeError:
+                            continue
+                        if srch_obj == get_obj:
+                            last_cls = srch_cls
+                    if last_cls is not None:
+                        homecls = last_cls
+        for base in all_bases:
+            if name in base.__dict__:
+                dict_obj = base.__dict__[name]
+                if homecls not in metamro:
+                    homecls = base
+                break
+        if homecls is None:
+            # unable to locate the attribute anywhere, most likely due to
+            # buggy custom __dir__; discard and move on
+            continue
+        obj = get_obj or dict_obj
+        # Classify the object or its descriptor.
+        if isinstance(dict_obj, staticmethod):
+            kind = "static method"
+            obj = dict_obj
+        elif isinstance(dict_obj, classmethod):
+            kind = "class method"
+            obj = dict_obj
+        elif isinstance(dict_obj, property):
+            kind = "property"
+            obj = dict_obj
+        elif isroutine(obj):
+            kind = "method"
+        else:
+            kind = "data"
         result.append(Attribute(name, kind, homecls, obj))
-
+        processed.add(name)
     return result
 
 # ----------------------------------------------------------- class helpers
@@ -361,6 +427,40 @@
     "Return tuple of base classes (including cls) in method resolution order."
     return cls.__mro__
 
+# -------------------------------------------------------- function helpers
+
+def unwrap(func, *, stop=None):
+    """Get the object wrapped by *func*.
+
+   Follows the chain of :attr:`__wrapped__` attributes returning the last
+   object in the chain.
+
+   *stop* is an optional callback accepting an object in the wrapper chain
+   as its sole argument that allows the unwrapping to be terminated early if
+   the callback returns a true value. If the callback never returns a true
+   value, the last object in the chain is returned as usual. For example,
+   :func:`signature` uses this to stop unwrapping if any object in the
+   chain has a ``__signature__`` attribute defined.
+
+   :exc:`ValueError` is raised if a cycle is encountered.
+
+    """
+    if stop is None:
+        def _is_wrapper(f):
+            return hasattr(f, '__wrapped__')
+    else:
+        def _is_wrapper(f):
+            return hasattr(f, '__wrapped__') and not stop(f)
+    f = func  # remember the original func for error reporting
+    memo = {id(f)} # Memoise by id to tolerate non-hashable objects
+    while _is_wrapper(func):
+        func = func.__wrapped__
+        id_func = id(func)
+        if id_func in memo:
+            raise ValueError('wrapper loop when unwrapping {!r}'.format(f))
+        memo.add(id_func)
+    return func
+
 # -------------------------------------------------- source code extraction
 def indentsize(line):
     """Return the indent size, in spaces, at the start of a line of text."""
@@ -417,9 +517,10 @@
             return object.__file__
         raise TypeError('{!r} is a built-in module'.format(object))
     if isclass(object):
-        object = sys.modules.get(object.__module__)
-        if hasattr(object, '__file__'):
-            return object.__file__
+        if hasattr(object, '__module__'):
+            object = sys.modules.get(object.__module__)
+            if hasattr(object, '__file__'):
+                return object.__file__
         raise TypeError('{!r} is a built-in class'.format(object))
     if ismethod(object):
         object = object.__func__
@@ -440,6 +541,9 @@
     """Get the module name, suffix, mode, and module type for a given file."""
     warnings.warn('inspect.getmoduleinfo() is deprecated', DeprecationWarning,
                   2)
+    with warnings.catch_warnings():
+        warnings.simplefilter('ignore', PendingDeprecationWarning)
+        import imp
     filename = os.path.basename(path)
     suffixes = [(-len(suffix), suffix, mode, mtype)
                     for suffix, mode, mtype in imp.get_suffixes()]
@@ -476,7 +580,7 @@
     if os.path.exists(filename):
         return filename
     # only return a non-existent filename if the module has a PEP 302 loader
-    if hasattr(getmodule(object, filename), '__loader__'):
+    if getattr(getmodule(object, filename), '__loader__', None) is not None:
         return filename
     # or it is in the linecache
     if filename in linecache.cache:
@@ -545,14 +649,20 @@
 
     The argument may be a module, class, method, function, traceback, frame,
     or code object.  The source code is returned as a list of all the lines
-    in the file and the line number indexes a line in that list.  An IOError
+    in the file and the line number indexes a line in that list.  An OSError
     is raised if the source code cannot be retrieved."""
 
-    file = getfile(object)
-    sourcefile = getsourcefile(object)
-    if not sourcefile and file[:1] + file[-1:] != '<>':
-        raise IOError('source code not available')
-    file = sourcefile if sourcefile else file
+    file = getsourcefile(object)
+    if file:
+        # Invalidate cache if needed.
+        linecache.checkcache(file)
+    else:
+        file = getfile(object)
+        # Allow filenames in form of "<something>" to pass through.
+        # `doctest` monkeypatches `linecache` module to enable
+        # inspection, so let `linecache.getlines` to be called.
+        if not (file.startswith('<') and file.endswith('>')):
+            raise OSError('source code not available')
 
     module = getmodule(object, file)
     if module:
@@ -560,7 +670,7 @@
     else:
         lines = linecache.getlines(file)
     if not lines:
-        raise IOError('could not get source code')
+        raise OSError('could not get source code')
 
     if ismodule(object):
         return lines, 0
@@ -586,7 +696,7 @@
             candidates.sort()
             return lines, candidates[0][1]
         else:
-            raise IOError('could not find class definition')
+            raise OSError('could not find class definition')
 
     if ismethod(object):
         object = object.__func__
@@ -598,14 +708,14 @@
         object = object.f_code
     if iscode(object):
         if not hasattr(object, 'co_firstlineno'):
-            raise IOError('could not find function definition')
+            raise OSError('could not find function definition')
         lnum = object.co_firstlineno - 1
         pat = re.compile(r'^(\s*def\s)|(.*(?<!\w)lambda(:|\s))|^(\s*@)')
         while lnum > 0:
             if pat.match(lines[lnum]): break
             lnum = lnum - 1
         return lines, lnum
-    raise IOError('could not find code object')
+    raise OSError('could not find code object')
 
 def getcomments(object):
     """Get lines of comments immediately preceding an object's source code.
@@ -614,7 +724,7 @@
     """
     try:
         lines, lnum = findsource(object)
-    except (IOError, TypeError):
+    except (OSError, TypeError):
         return None
 
     if ismodule(object):
@@ -710,7 +820,7 @@
     The argument may be a module, class, method, function, traceback, frame,
     or code object.  The source code is returned as a list of the lines
     corresponding to the object and the line number indicates where in the
-    original source file the first line of code was found.  An IOError is
+    original source file the first line of code was found.  An OSError is
     raised if the source code cannot be retrieved."""
     lines, lnum = findsource(object)
 
@@ -722,7 +832,7 @@
 
     The argument may be a module, class, method, function, traceback, frame,
     or code object.  The source code is returned as a single string.  An
-    IOError is raised if the source code cannot be retrieved."""
+    OSError is raised if the source code cannot be retrieved."""
     lines, lnum = getsourcelines(object)
     return ''.join(lines)
 
@@ -831,7 +941,7 @@
     'args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotations')
 
 def getfullargspec(func):
-    """Get the names and default values of a function's arguments.
+    """Get the names and default values of a callable object's arguments.
 
     A tuple of seven things is returned:
     (args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults annotations).
@@ -845,13 +955,78 @@
     The first four items in the tuple correspond to getargspec().
     """
 
-    if ismethod(func):
-        func = func.__func__
-    if not isfunction(func):
-        raise TypeError('{!r} is not a Python function'.format(func))
-    args, varargs, kwonlyargs, varkw = _getfullargs(func.__code__)
-    return FullArgSpec(args, varargs, varkw, func.__defaults__,
-            kwonlyargs, func.__kwdefaults__, func.__annotations__)
+    try:
+        # Re: `skip_bound_arg=False`
+        #
+        # There is a notable difference in behaviour between getfullargspec
+        # and Signature: the former always returns 'self' parameter for bound
+        # methods, whereas the Signature always shows the actual calling
+        # signature of the passed object.
+        #
+        # To simulate this behaviour, we "unbind" bound methods, to trick
+        # inspect.signature to always return their first parameter ("self",
+        # usually)
+
+        # Re: `follow_wrapper_chains=False`
+        #
+        # getfullargspec() historically ignored __wrapped__ attributes,
+        # so we ensure that remains the case in 3.3+
+
+        sig = _signature_internal(func,
+                                  follow_wrapper_chains=False,
+                                  skip_bound_arg=False)
+    except Exception as ex:
+        # Most of the times 'signature' will raise ValueError.
+        # But, it can also raise AttributeError, and, maybe something
+        # else. So to be fully backwards compatible, we catch all
+        # possible exceptions here, and reraise a TypeError.
+        raise TypeError('unsupported callable') from ex
+
+    args = []
+    varargs = None
+    varkw = None
+    kwonlyargs = []
+    defaults = ()
+    annotations = {}
+    defaults = ()
+    kwdefaults = {}
+
+    if sig.return_annotation is not sig.empty:
+        annotations['return'] = sig.return_annotation
+
+    for param in sig.parameters.values():
+        kind = param.kind
+        name = param.name
+
+        if kind is _POSITIONAL_ONLY:
+            args.append(name)
+        elif kind is _POSITIONAL_OR_KEYWORD:
+            args.append(name)
+            if param.default is not param.empty:
+                defaults += (param.default,)
+        elif kind is _VAR_POSITIONAL:
+            varargs = name
+        elif kind is _KEYWORD_ONLY:
+            kwonlyargs.append(name)
+            if param.default is not param.empty:
+                kwdefaults[name] = param.default
+        elif kind is _VAR_KEYWORD:
+            varkw = name
+
+        if param.annotation is not param.empty:
+            annotations[name] = param.annotation
+
+    if not kwdefaults:
+        # compatibility with 'func.__kwdefaults__'
+        kwdefaults = None
+
+    if not defaults:
+        # compatibility with 'func.__defaults__'
+        defaults = None
+
+    return FullArgSpec(args, varargs, varkw, defaults,
+                       kwonlyargs, kwdefaults, annotations)
+
 
 ArgInfo = namedtuple('ArgInfo', 'args varargs keywords locals')
 
@@ -956,7 +1131,7 @@
     elif missing == 2:
         s = "{} and {}".format(*names)
     else:
-        tail = ", {} and {}".format(names[-2:])
+        tail = ", {} and {}".format(*names[-2:])
         del names[-2:]
         s = ", ".join(names) + tail
     raise TypeError("%s() missing %i required %s argument%s: %s" %
@@ -1039,7 +1214,7 @@
     missing = 0
     for kwarg in kwonlyargs:
         if kwarg not in arg2value:
-            if kwarg in kwonlydefaults:
+            if kwonlydefaults and kwarg in kwonlydefaults:
                 arg2value[kwarg] = kwonlydefaults[kwarg]
             else:
                 missing += 1
@@ -1125,7 +1300,7 @@
         start = lineno - 1 - context//2
         try:
             lines, lnum = findsource(frame)
-        except IOError:
+        except OSError:
             lines = index = None
         else:
             start = max(start, 1)
@@ -1317,13 +1492,15 @@
 
 _WrapperDescriptor = type(type.__call__)
 _MethodWrapper = type(all.__call__)
+_ClassMethodWrapper = type(int.__dict__['from_bytes'])
 
 _NonUserDefinedCallables = (_WrapperDescriptor,
                             _MethodWrapper,
+                            _ClassMethodWrapper,
                             types.BuiltinFunctionType)
 
 
-def _get_user_defined_method(cls, method_name):
+def _signature_get_user_defined_method(cls, method_name):
     try:
         meth = getattr(cls, method_name)
     except AttributeError:
@@ -1335,8 +1512,387 @@
             return meth
 
 
-def signature(obj):
-    '''Get a signature object for the passed callable.'''
+def _signature_get_partial(wrapped_sig, partial, extra_args=()):
+    # Internal helper to calculate how 'wrapped_sig' signature will
+    # look like after applying a 'functools.partial' object (or alike)
+    # on it.
+
+    old_params = wrapped_sig.parameters
+    new_params = OrderedDict(old_params.items())
+
+    partial_args = partial.args or ()
+    partial_keywords = partial.keywords or {}
+
+    if extra_args:
+        partial_args = extra_args + partial_args
+
+    try:
+        ba = wrapped_sig.bind_partial(*partial_args, **partial_keywords)
+    except TypeError as ex:
+        msg = 'partial object {!r} has incorrect arguments'.format(partial)
+        raise ValueError(msg) from ex
+
+
+    transform_to_kwonly = False
+    for param_name, param in old_params.items():
+        try:
+            arg_value = ba.arguments[param_name]
+        except KeyError:
+            pass
+        else:
+            if param.kind is _POSITIONAL_ONLY:
+                # If positional-only parameter is bound by partial,
+                # it effectively disappears from the signature
+                new_params.pop(param_name)
+                continue
+
+            if param.kind is _POSITIONAL_OR_KEYWORD:
+                if param_name in partial_keywords:
+                    # This means that this parameter, and all parameters
+                    # after it should be keyword-only (and var-positional
+                    # should be removed). Here's why. Consider the following
+                    # function:
+                    #     foo(a, b, *args, c):
+                    #         pass
+                    #
+                    # "partial(foo, a='spam')" will have the following
+                    # signature: "(*, a='spam', b, c)". Because attempting
+                    # to call that partial with "(10, 20)" arguments will
+                    # raise a TypeError, saying that "a" argument received
+                    # multiple values.
+                    transform_to_kwonly = True
+                    # Set the new default value
+                    new_params[param_name] = param.replace(default=arg_value)
+                else:
+                    # was passed as a positional argument
+                    new_params.pop(param.name)
+                    continue
+
+            if param.kind is _KEYWORD_ONLY:
+                # Set the new default value
+                new_params[param_name] = param.replace(default=arg_value)
+
+        if transform_to_kwonly:
+            assert param.kind is not _POSITIONAL_ONLY
+
+            if param.kind is _POSITIONAL_OR_KEYWORD:
+                new_param = new_params[param_name].replace(kind=_KEYWORD_ONLY)
+                new_params[param_name] = new_param
+                new_params.move_to_end(param_name)
+            elif param.kind in (_KEYWORD_ONLY, _VAR_KEYWORD):
+                new_params.move_to_end(param_name)
+            elif param.kind is _VAR_POSITIONAL:
+                new_params.pop(param.name)
+
+    return wrapped_sig.replace(parameters=new_params.values())
+
+
+def _signature_bound_method(sig):
+    # Internal helper to transform signatures for unbound
+    # functions to bound methods
+
+    params = tuple(sig.parameters.values())
+
+    if not params or params[0].kind in (_VAR_KEYWORD, _KEYWORD_ONLY):
+        raise ValueError('invalid method signature')
+
+    kind = params[0].kind
+    if kind in (_POSITIONAL_OR_KEYWORD, _POSITIONAL_ONLY):
+        # Drop first parameter:
+        # '(p1, p2[, ...])' -> '(p2[, ...])'
+        params = params[1:]
+    else:
+        if kind is not _VAR_POSITIONAL:
+            # Unless we add a new parameter type we never
+            # get here
+            raise ValueError('invalid argument type')
+        # It's a var-positional parameter.
+        # Do nothing. '(*args[, ...])' -> '(*args[, ...])'
+
+    return sig.replace(parameters=params)
+
+
+def _signature_is_builtin(obj):
+    # Internal helper to test if `obj` is a callable that might
+    # support Argument Clinic's __text_signature__ protocol.
+    return (isbuiltin(obj) or
+            ismethoddescriptor(obj) or
+            isinstance(obj, _NonUserDefinedCallables) or
+            # Can't test 'isinstance(type)' here, as it would
+            # also be True for regular python classes
+            obj in (type, object))
+
+
+def _signature_is_functionlike(obj):
+    # Internal helper to test if `obj` is a duck type of FunctionType.
+    # A good example of such objects are functions compiled with
+    # Cython, which have all attributes that a pure Python function
+    # would have, but have their code statically compiled.
+
+    if not callable(obj) or isclass(obj):
+        # All function-like objects are obviously callables,
+        # and not classes.
+        return False
+
+    name = getattr(obj, '__name__', None)
+    code = getattr(obj, '__code__', None)
+    defaults = getattr(obj, '__defaults__', _void) # Important to use _void ...
+    kwdefaults = getattr(obj, '__kwdefaults__', _void) # ... and not None here
+    annotations = getattr(obj, '__annotations__', None)
+
+    return (isinstance(code, types.CodeType) and
+            isinstance(name, str) and
+            (defaults is None or isinstance(defaults, tuple)) and
+            (kwdefaults is None or isinstance(kwdefaults, dict)) and
+            isinstance(annotations, dict))
+
+
+def _signature_get_bound_param(spec):
+    # Internal helper to get first parameter name from a
+    # __text_signature__ of a builtin method, which should
+    # be in the following format: '($param1, ...)'.
+    # Assumptions are that the first argument won't have
+    # a default value or an annotation.
+
+    assert spec.startswith('($')
+
+    pos = spec.find(',')
+    if pos == -1:
+        pos = spec.find(')')
+
+    cpos = spec.find(':')
+    assert cpos == -1 or cpos > pos
+
+    cpos = spec.find('=')
+    assert cpos == -1 or cpos > pos
+
+    return spec[2:pos]
+
+
+def _signature_strip_non_python_syntax(signature):
+    """
+    Takes a signature in Argument Clinic's extended signature format.
+    Returns a tuple of three things:
+      * that signature re-rendered in standard Python syntax,
+      * the index of the "self" parameter (generally 0), or None if
+        the function does not have a "self" parameter, and
+      * the index of the last "positional only" parameter,
+        or None if the signature has no positional-only parameters.
+    """
+
+    if not signature:
+        return signature, None, None
+
+    self_parameter = None
+    last_positional_only = None
+
+    lines = [l.encode('ascii') for l in signature.split('\n')]
+    generator = iter(lines).__next__
+    token_stream = tokenize.tokenize(generator)
+
+    delayed_comma = False
+    skip_next_comma = False
+    text = []
+    add = text.append
+
+    current_parameter = 0
+    OP = token.OP
+    ERRORTOKEN = token.ERRORTOKEN
+
+    # token stream always starts with ENCODING token, skip it
+    t = next(token_stream)
+    assert t.type == tokenize.ENCODING
+
+    for t in token_stream:
+        type, string = t.type, t.string
+
+        if type == OP:
+            if string == ',':
+                if skip_next_comma:
+                    skip_next_comma = False
+                else:
+                    assert not delayed_comma
+                    delayed_comma = True
+                    current_parameter += 1
+                continue
+
+            if string == '/':
+                assert not skip_next_comma
+                assert last_positional_only is None
+                skip_next_comma = True
+                last_positional_only = current_parameter - 1
+                continue
+
+        if (type == ERRORTOKEN) and (string == '$'):
+            assert self_parameter is None
+            self_parameter = current_parameter
+            continue
+
+        if delayed_comma:
+            delayed_comma = False
+            if not ((type == OP) and (string == ')')):
+                add(', ')
+        add(string)
+        if (string == ','):
+            add(' ')
+    clean_signature = ''.join(text)
+    return clean_signature, self_parameter, last_positional_only
+
+
+def _signature_fromstr(cls, obj, s, skip_bound_arg=True):
+    # Internal helper to parse content of '__text_signature__'
+    # and return a Signature based on it
+    Parameter = cls._parameter_cls
+
+    clean_signature, self_parameter, last_positional_only = \
+        _signature_strip_non_python_syntax(s)
+
+    program = "def foo" + clean_signature + ": pass"
+
+    try:
+        module = ast.parse(program)
+    except SyntaxError:
+        module = None
+
+    if not isinstance(module, ast.Module):
+        raise ValueError("{!r} builtin has invalid signature".format(obj))
+
+    f = module.body[0]
+
+    parameters = []
+    empty = Parameter.empty
+    invalid = object()
+
+    module = None
+    module_dict = {}
+    module_name = getattr(obj, '__module__', None)
+    if module_name:
+        module = sys.modules.get(module_name, None)
+        if module:
+            module_dict = module.__dict__
+    sys_module_dict = sys.modules
+
+    def parse_name(node):
+        assert isinstance(node, ast.arg)
+        if node.annotation != None:
+            raise ValueError("Annotations are not currently supported")
+        return node.arg
+
+    def wrap_value(s):
+        try:
+            value = eval(s, module_dict)
+        except NameError:
+            try:
+                value = eval(s, sys_module_dict)
+            except NameError:
+                raise RuntimeError()
+
+        if isinstance(value, str):
+            return ast.Str(value)
+        if isinstance(value, (int, float)):
+            return ast.Num(value)
+        if isinstance(value, bytes):
+            return ast.Bytes(value)
+        if value in (True, False, None):
+            return ast.NameConstant(value)
+        raise RuntimeError()
+
+    class RewriteSymbolics(ast.NodeTransformer):
+        def visit_Attribute(self, node):
+            a = []
+            n = node
+            while isinstance(n, ast.Attribute):
+                a.append(n.attr)
+                n = n.value
+            if not isinstance(n, ast.Name):
+                raise RuntimeError()
+            a.append(n.id)
+            value = ".".join(reversed(a))
+            return wrap_value(value)
+
+        def visit_Name(self, node):
+            if not isinstance(node.ctx, ast.Load):
+                raise ValueError()
+            return wrap_value(node.id)
+
+    def p(name_node, default_node, default=empty):
+        name = parse_name(name_node)
+        if name is invalid:
+            return None
+        if default_node and default_node is not _empty:
+            try:
+                default_node = RewriteSymbolics().visit(default_node)
+                o = ast.literal_eval(default_node)
+            except ValueError:
+                o = invalid
+            if o is invalid:
+                return None
+            default = o if o is not invalid else default
+        parameters.append(Parameter(name, kind, default=default, annotation=empty))
+
+    # non-keyword-only parameters
+    args = reversed(f.args.args)
+    defaults = reversed(f.args.defaults)
+    iter = itertools.zip_longest(args, defaults, fillvalue=None)
+    if last_positional_only is not None:
+        kind = Parameter.POSITIONAL_ONLY
+    else:
+        kind = Parameter.POSITIONAL_OR_KEYWORD
+    for i, (name, default) in enumerate(reversed(list(iter))):
+        p(name, default)
+        if i == last_positional_only:
+            kind = Parameter.POSITIONAL_OR_KEYWORD
+
+    # *args
+    if f.args.vararg:
+        kind = Parameter.VAR_POSITIONAL
+        p(f.args.vararg, empty)
+
+    # keyword-only arguments
+    kind = Parameter.KEYWORD_ONLY
+    for name, default in zip(f.args.kwonlyargs, f.args.kw_defaults):
+        p(name, default)
+
+    # **kwargs
+    if f.args.kwarg:
+        kind = Parameter.VAR_KEYWORD
+        p(f.args.kwarg, empty)
+
+    if self_parameter is not None:
+        # Possibly strip the bound argument:
+        #    - We *always* strip first bound argument if
+        #      it is a module.
+        #    - We don't strip first bound argument if
+        #      skip_bound_arg is False.
+        assert parameters
+        _self = getattr(obj, '__self__', None)
+        self_isbound = _self is not None
+        self_ismodule = ismodule(_self)
+        if self_isbound and (self_ismodule or skip_bound_arg):
+            parameters.pop(0)
+        else:
+            # for builtins, self parameter is always positional-only!
+            p = parameters[0].replace(kind=Parameter.POSITIONAL_ONLY)
+            parameters[0] = p
+
+    return cls(parameters, return_annotation=cls.empty)
+
+
+def _signature_from_builtin(cls, func, skip_bound_arg=True):
+    # Internal helper function to get signature for
+    # builtin callables
+    if not _signature_is_builtin(func):
+        raise TypeError("{!r} is not a Python builtin "
+                        "function".format(func))
+
+    s = getattr(func, "__text_signature__", None)
+    if not s:
+        raise ValueError("no signature found for builtin {!r}".format(func))
+
+    return _signature_fromstr(cls, func, s, skip_bound_arg)
+
+
+def _signature_internal(obj, follow_wrapper_chains=True, skip_bound_arg=True):
 
     if not callable(obj):
         raise TypeError('{!r} is not a callable object'.format(obj))
@@ -1344,8 +1900,17 @@
     if isinstance(obj, types.MethodType):
         # In this case we skip the first parameter of the underlying
         # function (usually `self` or `cls`).
-        sig = signature(obj.__func__)
-        return sig.replace(parameters=tuple(sig.parameters.values())[1:])
+        sig = _signature_internal(obj.__func__,
+                                  follow_wrapper_chains,
+                                  skip_bound_arg)
+        if skip_bound_arg:
+            return _signature_bound_method(sig)
+        else:
+            return sig
+
+    # Was this function wrapped by a decorator?
+    if follow_wrapper_chains:
+        obj = unwrap(obj, stop=(lambda f: hasattr(f, "__signature__")))
 
     try:
         sig = obj.__signature__
@@ -1353,60 +1918,49 @@
         pass
     else:
         if sig is not None:
+            if not isinstance(sig, Signature):
+                raise TypeError(
+                    'unexpected object {!r} in __signature__ '
+                    'attribute'.format(sig))
             return sig
 
     try:
-        # Was this function wrapped by a decorator?
-        wrapped = obj.__wrapped__
+        partialmethod = obj._partialmethod
     except AttributeError:
         pass
     else:
-        return signature(wrapped)
+        if isinstance(partialmethod, functools.partialmethod):
+            # Unbound partialmethod (see functools.partialmethod)
+            # This means, that we need to calculate the signature
+            # as if it's a regular partial object, but taking into
+            # account that the first positional argument
+            # (usually `self`, or `cls`) will not be passed
+            # automatically (as for boundmethods)
 
-    if isinstance(obj, types.FunctionType):
+            wrapped_sig = _signature_internal(partialmethod.func,
+                                              follow_wrapper_chains,
+                                              skip_bound_arg)
+            sig = _signature_get_partial(wrapped_sig, partialmethod, (None,))
+
+            first_wrapped_param = tuple(wrapped_sig.parameters.values())[0]
+            new_params = (first_wrapped_param,) + tuple(sig.parameters.values())
+
+            return sig.replace(parameters=new_params)
+
+    if isfunction(obj) or _signature_is_functionlike(obj):
+        # If it's a pure Python function, or an object that is duck type
+        # of a Python function (Cython functions, for instance), then:
         return Signature.from_function(obj)
 
+    if _signature_is_builtin(obj):
+        return _signature_from_builtin(Signature, obj,
+                                       skip_bound_arg=skip_bound_arg)
+
     if isinstance(obj, functools.partial):
-        sig = signature(obj.func)
-
-        new_params = OrderedDict(sig.parameters.items())
-
-        partial_args = obj.args or ()
-        partial_keywords = obj.keywords or {}
-        try:
-            ba = sig.bind_partial(*partial_args, **partial_keywords)
-        except TypeError as ex:
-            msg = 'partial object {!r} has incorrect arguments'.format(obj)
-            raise ValueError(msg) from ex
-
-        for arg_name, arg_value in ba.arguments.items():
-            param = new_params[arg_name]
-            if arg_name in partial_keywords:
-                # We set a new default value, because the following code
-                # is correct:
-                #
-                #   >>> def foo(a): print(a)
-                #   >>> print(partial(partial(foo, a=10), a=20)())
-                #   20
-                #   >>> print(partial(partial(foo, a=10), a=20)(a=30))
-                #   30
-                #
-                # So, with 'partial' objects, passing a keyword argument is
-                # like setting a new default value for the corresponding
-                # parameter
-                #
-                # We also mark this parameter with '_partial_kwarg'
-                # flag.  Later, in '_bind', the 'default' value of this
-                # parameter will be added to 'kwargs', to simulate
-                # the 'functools.partial' real call.
-                new_params[arg_name] = param.replace(default=arg_value,
-                                                     _partial_kwarg=True)
-
-            elif (param.kind not in (_VAR_KEYWORD, _VAR_POSITIONAL) and
-                            not param._partial_kwarg):
-                new_params.pop(arg_name)
-
-        return sig.replace(parameters=new_params.values())
+        wrapped_sig = _signature_internal(obj.func,
+                                          follow_wrapper_chains,
+                                          skip_bound_arg)
+        return _signature_get_partial(wrapped_sig, obj)
 
     sig = None
     if isinstance(obj, type):
@@ -1414,32 +1968,80 @@
 
         # First, let's see if it has an overloaded __call__ defined
         # in its metaclass
-        call = _get_user_defined_method(type(obj), '__call__')
+        call = _signature_get_user_defined_method(type(obj), '__call__')
         if call is not None:
-            sig = signature(call)
+            sig = _signature_internal(call,
+                                      follow_wrapper_chains,
+                                      skip_bound_arg)
         else:
             # Now we check if the 'obj' class has a '__new__' method
-            new = _get_user_defined_method(obj, '__new__')
+            new = _signature_get_user_defined_method(obj, '__new__')
             if new is not None:
-                sig = signature(new)
+                sig = _signature_internal(new,
+                                          follow_wrapper_chains,
+                                          skip_bound_arg)
             else:
                 # Finally, we should have at least __init__ implemented
-                init = _get_user_defined_method(obj, '__init__')
+                init = _signature_get_user_defined_method(obj, '__init__')
                 if init is not None:
-                    sig = signature(init)
+                    sig = _signature_internal(init,
+                                              follow_wrapper_chains,
+                                              skip_bound_arg)
+
+        if sig is None:
+            # At this point we know, that `obj` is a class, with no user-
+            # defined '__init__', '__new__', or class-level '__call__'
+
+            for base in obj.__mro__[:-1]:
+                # Since '__text_signature__' is implemented as a
+                # descriptor that extracts text signature from the
+                # class docstring, if 'obj' is derived from a builtin
+                # class, its own '__text_signature__' may be 'None'.
+                # Therefore, we go through the MRO (except the last
+                # class in there, which is 'object') to find the first
+                # class with non-empty text signature.
+                try:
+                    text_sig = base.__text_signature__
+                except AttributeError:
+                    pass
+                else:
+                    if text_sig:
+                        # If 'obj' class has a __text_signature__ attribute:
+                        # return a signature based on it
+                        return _signature_fromstr(Signature, obj, text_sig)
+
+            # No '__text_signature__' was found for the 'obj' class.
+            # Last option is to check if its '__init__' is
+            # object.__init__ or type.__init__.
+            if type not in obj.__mro__:
+                # We have a class (not metaclass), but no user-defined
+                # __init__ or __new__ for it
+                if obj.__init__ is object.__init__:
+                    # Return a signature of 'object' builtin.
+                    return signature(object)
+
     elif not isinstance(obj, _NonUserDefinedCallables):
         # An object with __call__
         # We also check that the 'obj' is not an instance of
         # _WrapperDescriptor or _MethodWrapper to avoid
         # infinite recursion (and even potential segfault)
-        call = _get_user_defined_method(type(obj), '__call__')
+        call = _signature_get_user_defined_method(type(obj), '__call__')
         if call is not None:
-            sig = signature(call)
+            try:
+                sig = _signature_internal(call,
+                                          follow_wrapper_chains,
+                                          skip_bound_arg)
+            except ValueError as ex:
+                msg = 'no signature found for {!r}'.format(obj)
+                raise ValueError(msg) from ex
 
     if sig is not None:
         # For classes and objects we skip the first parameter of their
         # __call__, __new__, or __init__ methods
-        return sig.replace(parameters=tuple(sig.parameters.values())[1:])
+        if skip_bound_arg:
+            return _signature_bound_method(sig)
+        else:
+            return sig
 
     if isinstance(obj, types.BuiltinFunctionType):
         # Raise a nicer error message for builtins
@@ -1448,6 +2050,10 @@
 
     raise ValueError('callable {!r} is not supported by signature'.format(obj))
 
+def signature(obj):
+    '''Get a signature object for the passed callable.'''
+    return _signature_internal(obj)
+
 
 class _void:
     '''A private marker - used in Parameter & Signature'''
@@ -1486,10 +2092,12 @@
         The name of the parameter as a string.
     * default : object
         The default value for the parameter if specified.  If the
-        parameter has no default value, this attribute is not set.
+        parameter has no default value, this attribute is set to
+        `Parameter.empty`.
     * annotation
         The annotation for the parameter if specified.  If the
-        parameter has no annotation, this attribute is not set.
+        parameter has no annotation, this attribute is set to
+        `Parameter.empty`.
     * kind : str
         Describes how argument values are bound to the parameter.
         Possible values: `Parameter.POSITIONAL_ONLY`,
@@ -1497,7 +2105,7 @@
         `Parameter.KEYWORD_ONLY`, `Parameter.VAR_KEYWORD`.
     '''
 
-    __slots__ = ('_name', '_kind', '_default', '_annotation', '_partial_kwarg')
+    __slots__ = ('_name', '_kind', '_default', '_annotation')
 
     POSITIONAL_ONLY         = _POSITIONAL_ONLY
     POSITIONAL_OR_KEYWORD   = _POSITIONAL_OR_KEYWORD
@@ -1507,8 +2115,7 @@
 
     empty = _empty
 
-    def __init__(self, name, kind, *, default=_empty, annotation=_empty,
-                 _partial_kwarg=False):
+    def __init__(self, name, kind, *, default=_empty, annotation=_empty):
 
         if kind not in (_POSITIONAL_ONLY, _POSITIONAL_OR_KEYWORD,
                         _VAR_POSITIONAL, _KEYWORD_ONLY, _VAR_KEYWORD):
@@ -1522,19 +2129,16 @@
         self._default = default
         self._annotation = annotation
 
-        if name is None:
-            if kind != _POSITIONAL_ONLY:
-                raise ValueError("None is not a valid name for a "
-                                 "non-positional-only parameter")
-            self._name = name
-        else:
-            name = str(name)
-            if kind != _POSITIONAL_ONLY and not name.isidentifier():
-                msg = '{!r} is not a valid parameter name'.format(name)
-                raise ValueError(msg)
-            self._name = name
+        if name is _empty:
+            raise ValueError('name is a required attribute for Parameter')
 
-        self._partial_kwarg = _partial_kwarg
+        if not isinstance(name, str):
+            raise TypeError("name must be a str, not a {!r}".format(name))
+
+        if not name.isidentifier():
+            raise ValueError('{!r} is not a valid parameter name'.format(name))
+
+        self._name = name
 
     @property
     def name(self):
@@ -1552,8 +2156,8 @@
     def kind(self):
         return self._kind
 
-    def replace(self, *, name=_void, kind=_void, annotation=_void,
-                default=_void, _partial_kwarg=_void):
+    def replace(self, *, name=_void, kind=_void,
+                annotation=_void, default=_void):
         '''Creates a customized copy of the Parameter.'''
 
         if name is _void:
@@ -1568,20 +2172,11 @@
         if default is _void:
             default = self._default
 
-        if _partial_kwarg is _void:
-            _partial_kwarg = self._partial_kwarg
-
-        return type(self)(name, kind, default=default, annotation=annotation,
-                          _partial_kwarg=_partial_kwarg)
+        return type(self)(name, kind, default=default, annotation=annotation)
 
     def __str__(self):
         kind = self.kind
-
         formatted = self._name
-        if kind == _POSITIONAL_ONLY:
-            if formatted is None:
-                formatted = ''
-            formatted = '<{}>'.format(formatted)
 
         # Add annotation and default value
         if self._annotation is not _empty:
@@ -1642,12 +2237,7 @@
     def args(self):
         args = []
         for param_name, param in self._signature.parameters.items():
-            if (param.kind in (_VAR_KEYWORD, _KEYWORD_ONLY) or
-                                                    param._partial_kwarg):
-                # Keyword arguments mapped by 'functools.partial'
-                # (Parameter._partial_kwarg is True) are mapped
-                # in 'BoundArguments.kwargs', along with VAR_KEYWORD &
-                # KEYWORD_ONLY
+            if param.kind in (_VAR_KEYWORD, _KEYWORD_ONLY):
                 break
 
             try:
@@ -1672,8 +2262,7 @@
         kwargs_started = False
         for param_name, param in self._signature.parameters.items():
             if not kwargs_started:
-                if (param.kind in (_VAR_KEYWORD, _KEYWORD_ONLY) or
-                                                param._partial_kwarg):
+                if param.kind in (_VAR_KEYWORD, _KEYWORD_ONLY):
                     kwargs_started = True
                 else:
                     if param_name not in self.arguments:
@@ -1720,7 +2309,7 @@
     * return_annotation : object
         The annotation for the return type of the function if specified.
         If the function has no annotation for its return type, this
-        attribute is not set.
+        attribute is set to `Signature.empty`.
     * bind(*args, **kwargs) -> BoundArguments
         Creates a mapping from positional and keyword arguments to
         parameters.
@@ -1748,24 +2337,37 @@
             if __validate_parameters__:
                 params = OrderedDict()
                 top_kind = _POSITIONAL_ONLY
+                kind_defaults = False
 
                 for idx, param in enumerate(parameters):
                     kind = param.kind
+                    name = param.name
+
                     if kind < top_kind:
-                        msg = 'wrong parameter order: {} before {}'
-                        msg = msg.format(top_kind, param.kind)
+                        msg = 'wrong parameter order: {!r} before {!r}'
+                        msg = msg.format(top_kind, kind)
                         raise ValueError(msg)
-                    else:
+                    elif kind > top_kind:
+                        kind_defaults = False
                         top_kind = kind
 
-                    name = param.name
-                    if name is None:
-                        name = str(idx)
-                        param = param.replace(name=name)
+                    if kind in (_POSITIONAL_ONLY, _POSITIONAL_OR_KEYWORD):
+                        if param.default is _empty:
+                            if kind_defaults:
+                                # No default for this parameter, but the
+                                # previous parameter of the same kind had
+                                # a default
+                                msg = 'non-default argument follows default ' \
+                                      'argument'
+                                raise ValueError(msg)
+                        else:
+                            # There is a default for this parameter.
+                            kind_defaults = True
 
                     if name in params:
                         msg = 'duplicate parameter name: {!r}'.format(name)
                         raise ValueError(msg)
+
                     params[name] = param
             else:
                 params = OrderedDict(((param.name, param)
@@ -1778,8 +2380,14 @@
     def from_function(cls, func):
         '''Constructs Signature for the given python function'''
 
-        if not isinstance(func, types.FunctionType):
-            raise TypeError('{!r} is not a Python function'.format(func))
+        is_duck_function = False
+        if not isfunction(func):
+            if _signature_is_functionlike(func):
+                is_duck_function = True
+            else:
+                # If it's not a pure Python function, and not a duck type
+                # of pure function:
+                raise TypeError('{!r} is not a Python function'.format(func))
 
         Parameter = cls._parameter_cls
 
@@ -1816,7 +2424,7 @@
                                         default=defaults[offset]))
 
         # *args
-        if func_code.co_flags & 0x04:
+        if func_code.co_flags & CO_VARARGS:
             name = arg_names[pos_count + keyword_only_count]
             annotation = annotations.get(name, _empty)
             parameters.append(Parameter(name, annotation=annotation,
@@ -1833,9 +2441,9 @@
                                         kind=_KEYWORD_ONLY,
                                         default=default))
         # **kwargs
-        if func_code.co_flags & 0x08:
+        if func_code.co_flags & CO_VARKEYWORDS:
             index = pos_count + keyword_only_count
-            if func_code.co_flags & 0x04:
+            if func_code.co_flags & CO_VARARGS:
                 index += 1
 
             name = arg_names[index]
@@ -1843,9 +2451,15 @@
             parameters.append(Parameter(name, annotation=annotation,
                                         kind=_VAR_KEYWORD))
 
+        # Is 'func' is a pure Python function - don't validate the
+        # parameters list (for correct order and defaults), it should be OK.
         return cls(parameters,
                    return_annotation=annotations.get('return', _empty),
-                   __validate_parameters__=False)
+                   __validate_parameters__=is_duck_function)
+
+    @classmethod
+    def from_builtin(cls, func):
+        return _signature_from_builtin(cls, func)
 
     @property
     def parameters(self):
@@ -1912,15 +2526,6 @@
         parameters_ex = ()
         arg_vals = iter(args)
 
-        if partial:
-            # Support for binding arguments to 'functools.partial' objects.
-            # See 'functools.partial' case in 'signature()' implementation
-            # for details.
-            for param_name, param in self.parameters.items():
-                if (param._partial_kwarg and param_name not in kwargs):
-                    # Simulating 'functools.partial' behavior
-                    kwargs[param_name] = param.default
-
         while True:
             # Let's iterate through the positional arguments and corresponding
             # parameters
@@ -1955,6 +2560,8 @@
                         parameters_ex = (param,)
                         break
                     else:
+                        # No default, not VAR_KEYWORD, not VAR_POSITIONAL,
+                        # not in `kwargs`
                         if partial:
                             parameters_ex = (param,)
                             break
@@ -1993,19 +2600,17 @@
         # keyword arguments
         kwargs_param = None
         for param in itertools.chain(parameters_ex, parameters):
-            if param.kind == _POSITIONAL_ONLY:
-                # This should never happen in case of a properly built
-                # Signature object (but let's have this check here
-                # to ensure correct behaviour just in case)
-                raise TypeError('{arg!r} parameter is positional only, '
-                                'but was passed as a keyword'. \
-                                format(arg=param.name))
-
             if param.kind == _VAR_KEYWORD:
                 # Memorize that we have a '**kwargs'-like parameter
                 kwargs_param = param
                 continue
 
+            if param.kind == _VAR_POSITIONAL:
+                # Named arguments don't refer to '*args'-like parameters.
+                # We only arrive here if the positional arguments ended
+                # before reaching the last parameter before *args.
+                continue
+
             param_name = param.name
             try:
                 arg_val = kwargs.pop(param_name)
@@ -2020,6 +2625,14 @@
                                     format(arg=param_name)) from None
 
             else:
+                if param.kind == _POSITIONAL_ONLY:
+                    # This should never happen in case of a properly built
+                    # Signature object (but let's have this check here
+                    # to ensure correct behaviour just in case)
+                    raise TypeError('{arg!r} parameter is positional only, '
+                                    'but was passed as a keyword'. \
+                                    format(arg=param.name))
+
                 arguments[param_name] = arg_val
 
         if kwargs:
@@ -2031,27 +2644,37 @@
 
         return self._bound_arguments_cls(self, arguments)
 
-    def bind(__bind_self, *args, **kwargs):
+    def bind(*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 __bind_self._bind(args, kwargs)
+        return args[0]._bind(args[1:], kwargs)
 
-    def bind_partial(__bind_self, *args, **kwargs):
+    def bind_partial(*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 __bind_self._bind(args, kwargs, partial=True)
+        return args[0]._bind(args[1:], kwargs, partial=True)
 
     def __str__(self):
         result = []
+        render_pos_only_separator = False
         render_kw_only_separator = True
-        for idx, param in enumerate(self.parameters.values()):
+        for param in self.parameters.values():
             formatted = str(param)
 
             kind = param.kind
+
+            if kind == _POSITIONAL_ONLY:
+                render_pos_only_separator = True
+            elif render_pos_only_separator:
+                # It's not a positional-only parameter, and the flag
+                # is set to 'True' (there were pos-only params before.)
+                result.append('/')
+                render_pos_only_separator = False
+
             if kind == _VAR_POSITIONAL:
                 # OK, we have an '*args'-like parameter, so we won't need
                 # a '*' to separate keyword-only arguments
@@ -2067,6 +2690,11 @@
 
             result.append(formatted)
 
+        if render_pos_only_separator:
+            # There were only positional-only parameters, hence the
+            # flag was not reset to 'False'
+            result.append('/')
+
         rendered = '({})'.format(', '.join(result))
 
         if self.return_annotation is not _empty:
@@ -2074,3 +2702,64 @@
             rendered += ' -> {}'.format(anno)
 
         return rendered
+
+def _main():
+    """ Logic for inspecting an object given at command line """
+    import argparse
+    import importlib
+
+    parser = argparse.ArgumentParser()
+    parser.add_argument(
+        'object',
+         help="The object to be analysed. "
+              "It supports the 'module:qualname' syntax")
+    parser.add_argument(
+        '-d', '--details', action='store_true',
+        help='Display info about the module rather than its source code')
+
+    args = parser.parse_args()
+
+    target = args.object
+    mod_name, has_attrs, attrs = target.partition(":")
+    try:
+        obj = module = importlib.import_module(mod_name)
+    except Exception as exc:
+        msg = "Failed to import {} ({}: {})".format(mod_name,
+                                                    type(exc).__name__,
+                                                    exc)
+        print(msg, file=sys.stderr)
+        exit(2)
+
+    if has_attrs:
+        parts = attrs.split(".")
+        obj = module
+        for part in parts:
+            obj = getattr(obj, part)
+
+    if module.__name__ in sys.builtin_module_names:
+        print("Can't get info for builtin modules.", file=sys.stderr)
+        exit(1)
+
+    if args.details:
+        print('Target: {}'.format(target))
+        print('Origin: {}'.format(getsourcefile(module)))
+        print('Cached: {}'.format(module.__cached__))
+        if obj is module:
+            print('Loader: {}'.format(repr(module.__loader__)))
+            if hasattr(module, '__path__'):
+                print('Submodule search path: {}'.format(module.__path__))
+        else:
+            try:
+                __, lineno = findsource(obj)
+            except Exception:
+                pass
+            else:
+                print('Line: {}'.format(lineno))
+
+        print('\n')
+    else:
+        print(getsource(obj))
+
+
+if __name__ == "__main__":
+    _main()
diff --git a/Lib/io.py b/Lib/io.py
index bda4def..8d68f1e 100644
--- 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 raise an IOError if they do not support a given operation.
+allowed to raise an OSError 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
@@ -70,16 +70,16 @@
 # Method descriptions and default implementations are inherited from the C
 # version however.
 class IOBase(_io._IOBase, metaclass=abc.ABCMeta):
-    pass
+    __doc__ = _io._IOBase.__doc__
 
 class RawIOBase(_io._RawIOBase, IOBase):
-    pass
+    __doc__ = _io._RawIOBase.__doc__
 
 class BufferedIOBase(_io._BufferedIOBase, IOBase):
-    pass
+    __doc__ = _io._BufferedIOBase.__doc__
 
 class TextIOBase(_io._TextIOBase, IOBase):
-    pass
+    __doc__ = _io._TextIOBase.__doc__
 
 RawIOBase.register(FileIO)
 
diff --git a/Lib/ipaddress.py b/Lib/ipaddress.py
index ecf3f44..ac03c36 100644
--- a/Lib/ipaddress.py
+++ b/Lib/ipaddress.py
@@ -388,40 +388,7 @@
     return NotImplemented
 
 
-class _TotalOrderingMixin:
-    # Helper that derives the other comparison operations from
-    # __lt__ and __eq__
-    # We avoid functools.total_ordering because it doesn't handle
-    # NotImplemented correctly yet (http://bugs.python.org/issue10042)
-    def __eq__(self, other):
-        raise NotImplementedError
-    def __ne__(self, other):
-        equal = self.__eq__(other)
-        if equal is NotImplemented:
-            return NotImplemented
-        return not equal
-    def __lt__(self, other):
-        raise NotImplementedError
-    def __le__(self, other):
-        less = self.__lt__(other)
-        if less is NotImplemented or not less:
-            return self.__eq__(other)
-        return less
-    def __gt__(self, other):
-        less = self.__lt__(other)
-        if less is NotImplemented:
-            return NotImplemented
-        equal = self.__eq__(other)
-        if equal is NotImplemented:
-            return NotImplemented
-        return not (less or equal)
-    def __ge__(self, other):
-        less = self.__lt__(other)
-        if less is NotImplemented:
-            return NotImplemented
-        return not less
-
-class _IPAddressBase(_TotalOrderingMixin):
+class _IPAddressBase:
 
     """The mother class."""
 
@@ -472,7 +439,7 @@
         """Return prefix length from the bitwise netmask.
 
         Args:
-            ip_int: An integer, the netmask in axpanded bitwise format
+            ip_int: An integer, the netmask in expanded bitwise format
 
         Returns:
             An integer, the prefix length.
@@ -554,6 +521,7 @@
             self._report_invalid_netmask(ip_str)
 
 
+@functools.total_ordering
 class _BaseAddress(_IPAddressBase):
 
     """A generic IP object.
@@ -578,12 +546,11 @@
             return NotImplemented
 
     def __lt__(self, other):
+        if not isinstance(other, _BaseAddress):
+            return NotImplemented
         if self._version != other._version:
             raise TypeError('%s and %s are not of the same version' % (
                              self, other))
-        if not isinstance(other, _BaseAddress):
-            raise TypeError('%s and %s are not of the same type' % (
-                             self, other))
         if self._ip != other._ip:
             return self._ip < other._ip
         return False
@@ -613,6 +580,7 @@
         return (self._version, self)
 
 
+@functools.total_ordering
 class _BaseNetwork(_IPAddressBase):
 
     """A generic IP network object.
@@ -662,12 +630,11 @@
             return self._address_class(broadcast + n)
 
     def __lt__(self, other):
+        if not isinstance(other, _BaseNetwork):
+            return NotImplemented
         if self._version != other._version:
             raise TypeError('%s and %s are not of the same version' % (
                              self, other))
-        if not isinstance(other, _BaseNetwork):
-            raise TypeError('%s and %s are not of the same type' % (
-                             self, other))
         if self.network_address != other.network_address:
             return self.network_address < other.network_address
         if self.netmask != other.netmask:
@@ -1030,13 +997,25 @@
         """Test if this address is allocated for private networks.
 
         Returns:
-            A boolean, True if the address is reserved per RFC 4193.
+            A boolean, True if the address is reserved per
+            iana-ipv4-special-registry or iana-ipv6-special-registry.
 
         """
         return (self.network_address.is_private and
                 self.broadcast_address.is_private)
 
     @property
+    def is_global(self):
+        """Test if this address is allocated for public networks.
+
+        Returns:
+            A boolean, True if the address is not reserved per
+            iana-ipv4-special-registry or iana-ipv6-special-registry.
+
+        """
+        return not self.is_private
+
+    @property
     def is_unspecified(self):
         """Test if the address is unspecified.
 
@@ -1276,19 +1255,30 @@
         return self in reserved_network
 
     @property
+    @functools.lru_cache()
     def is_private(self):
         """Test if this address is allocated for private networks.
 
         Returns:
-            A boolean, True if the address is reserved per RFC 1918.
+            A boolean, True if the address is reserved per
+            iana-ipv4-special-registry.
 
         """
-        private_10 = IPv4Network('10.0.0.0/8')
-        private_172 = IPv4Network('172.16.0.0/12')
-        private_192 = IPv4Network('192.168.0.0/16')
-        return (self in private_10 or
-                self in private_172 or
-                self in private_192)
+        return (self in IPv4Network('0.0.0.0/8') or
+                self in IPv4Network('10.0.0.0/8') or
+                self in IPv4Network('127.0.0.0/8') or
+                self in IPv4Network('169.254.0.0/16') or
+                self in IPv4Network('172.16.0.0/12') or
+                self in IPv4Network('192.0.0.0/29') or
+                self in IPv4Network('192.0.0.170/31') or
+                self in IPv4Network('192.0.2.0/24') or
+                self in IPv4Network('192.168.0.0/16') or
+                self in IPv4Network('198.18.0.0/15') or
+                self in IPv4Network('198.51.100.0/24') or
+                self in IPv4Network('203.0.113.0/24') or
+                self in IPv4Network('240.0.0.0/4') or
+                self in IPv4Network('255.255.255.255/32'))
+
 
     @property
     def is_multicast(self):
@@ -1504,6 +1494,21 @@
         if self._prefixlen == (self._max_prefixlen - 1):
             self.hosts = self.__iter__
 
+    @property
+    @functools.lru_cache()
+    def is_global(self):
+        """Test if this address is allocated for public networks.
+
+        Returns:
+            A boolean, True if the address is not reserved per
+            iana-ipv4-special-registry.
+
+        """
+        return (not (self.network_address in IPv4Network('100.64.0.0/10') and
+                    self.broadcast_address in IPv4Network('100.64.0.0/10')) and
+                not self.is_private)
+
+
 
 class _BaseV6:
 
@@ -1860,15 +1865,36 @@
         return self in sitelocal_network
 
     @property
+    @functools.lru_cache()
     def is_private(self):
         """Test if this address is allocated for private networks.
 
         Returns:
-            A boolean, True if the address is reserved per RFC 4193.
+            A boolean, True if the address is reserved per
+            iana-ipv6-special-registry.
 
         """
-        private_network = IPv6Network('fc00::/7')
-        return self in private_network
+        return (self in IPv6Network('::1/128') or
+                self in IPv6Network('::/128') or
+                self in IPv6Network('::ffff:0:0/96') or
+                self in IPv6Network('100::/64') or
+                self in IPv6Network('2001::/23') or
+                self in IPv6Network('2001:2::/48') or
+                self in IPv6Network('2001:db8::/32') or
+                self in IPv6Network('2001:10::/28') or
+                self in IPv6Network('fc00::/7') or
+                self in IPv6Network('fe80::/10'))
+
+    @property
+    def is_global(self):
+        """Test if this address is allocated for public networks.
+
+        Returns:
+            A boolean, true if the address is not reserved per
+            iana-ipv6-special-registry.
+
+        """
+        return not self.is_private
 
     @property
     def is_unspecified(self):
@@ -2096,6 +2122,18 @@
         if self._prefixlen == (self._max_prefixlen - 1):
             self.hosts = self.__iter__
 
+    def hosts(self):
+        """Generate Iterator over usable hosts in a network.
+
+          This is like __iter__ except it doesn't return the
+          Subnet-Router anycast address.
+
+        """
+        network = int(self.network_address)
+        broadcast = int(self.broadcast_address)
+        for x in range(network + 1, broadcast + 1):
+            yield self._address_class(x)
+
     @property
     def is_site_local(self):
         """Test if the address is reserved for site-local.
diff --git a/Lib/json/__init__.py b/Lib/json/__init__.py
index 6d9b30d..94f7d8c 100644
--- a/Lib/json/__init__.py
+++ b/Lib/json/__init__.py
@@ -36,8 +36,7 @@
 Pretty printing::
 
     >>> import json
-    >>> print(json.dumps({'4': 5, '6': 7}, sort_keys=True,
-    ...                  indent=4, separators=(',', ': ')))
+    >>> print(json.dumps({'4': 5, '6': 7}, sort_keys=True, indent=4))
     {
         "4": 5,
         "6": 7
@@ -143,13 +142,12 @@
     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.  Since the default item separator is ``', '``,  the
-    output might include trailing whitespace when ``indent`` is specified.
-    You can use ``separators=(',', ': ')`` to avoid this.
+    representation.
 
-    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.
+    If specified, ``separators`` should be an ``(item_separator, key_separator)``
+    tuple.  The default is ``(', ', ': ')`` if *indent* is ``None`` and
+    ``(',', ': ')`` otherwise.  To get the most compact JSON representation,
+    you should specify ``(',', ':')`` to eliminate whitespace.
 
     ``default(obj)`` is a function that should return a serializable version
     of obj or raise TypeError. The default simply raises TypeError.
@@ -206,13 +204,12 @@
     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.  Since the default item separator is ``', '``,  the
-    output might include trailing whitespace when ``indent`` is specified.
-    You can use ``separators=(',', ': ')`` to avoid this.
+    representation.
 
-    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.
+    If specified, ``separators`` should be an ``(item_separator, key_separator)``
+    tuple.  The default is ``(', ', ': ')`` if *indent* is ``None`` and
+    ``(',', ': ')`` otherwise.  To get the most compact JSON representation,
+    you should specify ``(',', ':')`` to eliminate whitespace.
 
     ``default(obj)`` is a function that should return a serializable version
     of obj or raise TypeError. The default simply raises TypeError.
@@ -310,6 +307,11 @@
     The ``encoding`` argument is ignored and deprecated.
 
     """
+    if not isinstance(s, str):
+        raise TypeError('the JSON object must be str, not {!r}'.format(
+                            s.__class__.__name__))
+    if s.startswith(u'\ufeff'):
+        raise ValueError("Unexpected UTF-8 BOM (decode using utf-8-sig)")
     if (cls is None and object_hook is None and
             parse_int is None and parse_float is None and
             parse_constant is None and object_pairs_hook is None and not kw):
diff --git a/Lib/json/decoder.py b/Lib/json/decoder.py
index 80d3420..59e5f41 100644
--- a/Lib/json/decoder.py
+++ b/Lib/json/decoder.py
@@ -1,9 +1,6 @@
 """Implementation of JSONDecoder
 """
-import binascii
 import re
-import sys
-import struct
 
 from json import scanner
 try:
@@ -15,14 +12,9 @@
 
 FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL
 
-def _floatconstants():
-    _BYTES = binascii.unhexlify(b'7FF80000000000007FF0000000000000')
-    if sys.byteorder != 'big':
-        _BYTES = _BYTES[:8][::-1] + _BYTES[8:][::-1]
-    nan, inf = struct.unpack('dd', _BYTES)
-    return nan, inf, -inf
-
-NaN, PosInf, NegInf = _floatconstants()
+NaN = float('nan')
+PosInf = float('inf')
+NegInf = float('-inf')
 
 
 def linecol(doc, pos):
@@ -195,8 +187,8 @@
 
         try:
             value, end = scan_once(s, end)
-        except StopIteration:
-            raise ValueError(errmsg("Expecting object", s, end))
+        except StopIteration as err:
+            raise ValueError(errmsg("Expecting value", s, err.value)) from None
         pairs_append((key, value))
         try:
             nextchar = s[end]
@@ -239,8 +231,8 @@
     while True:
         try:
             value, end = scan_once(s, end)
-        except StopIteration:
-            raise ValueError(errmsg("Expecting object", s, end))
+        except StopIteration as err:
+            raise ValueError(errmsg("Expecting value", s, err.value)) from None
         _append(value)
         nextchar = s[end:end + 1]
         if nextchar in _ws:
@@ -250,7 +242,7 @@
         if nextchar == ']':
             break
         elif nextchar != ',':
-            raise ValueError(errmsg("Expecting ',' delimiter", s, end))
+            raise ValueError(errmsg("Expecting ',' delimiter", s, end - 1))
         try:
             if s[end] in _ws:
                 end += 1
@@ -365,6 +357,6 @@
         """
         try:
             obj, end = self.scan_once(s, idx)
-        except StopIteration:
-            raise ValueError("No JSON object could be decoded")
+        except StopIteration as err:
+            raise ValueError(errmsg("Expecting value", s, err.value)) from None
         return obj, end
diff --git a/Lib/json/encoder.py b/Lib/json/encoder.py
index 1d8b20c..0513838 100644
--- a/Lib/json/encoder.py
+++ b/Lib/json/encoder.py
@@ -125,14 +125,12 @@
         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.  Since the default
-        item separator is ', ',  the output might include trailing
-        whitespace when indent is specified.  You can use
-        separators=(',', ': ') to avoid this.
+        None is the most compact representation.
 
-        If specified, separators should be a (item_separator, key_separator)
-        tuple.  The default is (', ', ': ').  To get the most compact JSON
-        representation you should specify (',', ':') to eliminate whitespace.
+        If specified, separators should be an (item_separator, key_separator)
+        tuple.  The default is (', ', ': ') if *indent* is ``None`` and
+        (',', ': ') otherwise.  To get the most compact JSON representation,
+        you should specify (',', ':') to eliminate whitespace.
 
         If specified, default is a function that gets called for objects
         that can't otherwise be serialized.  It should return a JSON encodable
@@ -148,6 +146,8 @@
         self.indent = indent
         if separators is not None:
             self.item_separator, self.key_separator = separators
+        elif indent is not None:
+            self.item_separator = ','
         if default is not None:
             self.default = default
 
@@ -175,6 +175,7 @@
     def encode(self, o):
         """Return a JSON string representation of a Python data structure.
 
+        >>> from json.encoder import JSONEncoder
         >>> JSONEncoder().encode({"foo": ["bar", "baz"]})
         '{"foo": ["bar", "baz"]}'
 
@@ -298,9 +299,13 @@
             elif value is False:
                 yield buf + 'false'
             elif isinstance(value, int):
-                yield buf + str(value)
+                # Subclasses of int/float may override __str__, but we still
+                # want to encode them as integers/floats in JSON. One example
+                # within the standard library is IntEnum.
+                yield buf + str(int(value))
             elif isinstance(value, float):
-                yield buf + _floatstr(value)
+                # see comment above for int
+                yield buf + _floatstr(float(value))
             else:
                 yield buf
                 if isinstance(value, (list, tuple)):
@@ -309,8 +314,7 @@
                     chunks = _iterencode_dict(value, _current_indent_level)
                 else:
                     chunks = _iterencode(value, _current_indent_level)
-                for chunk in chunks:
-                    yield chunk
+                yield from chunks
         if newline_indent is not None:
             _current_indent_level -= 1
             yield '\n' + _indent * _current_indent_level
@@ -347,7 +351,8 @@
             # JavaScript is weakly typed for these, so it makes sense to
             # also allow them.  Many encoders seem to do something like this.
             elif isinstance(key, float):
-                key = _floatstr(key)
+                # see comment for int/float in _make_iterencode
+                key = _floatstr(float(key))
             elif key is True:
                 key = 'true'
             elif key is False:
@@ -355,7 +360,8 @@
             elif key is None:
                 key = 'null'
             elif isinstance(key, int):
-                key = str(key)
+                # see comment for int/float in _make_iterencode
+                key = str(int(key))
             elif _skipkeys:
                 continue
             else:
@@ -375,9 +381,11 @@
             elif value is False:
                 yield 'false'
             elif isinstance(value, int):
-                yield str(value)
+                # see comment for int/float in _make_iterencode
+                yield str(int(value))
             elif isinstance(value, float):
-                yield _floatstr(value)
+                # see comment for int/float in _make_iterencode
+                yield _floatstr(float(value))
             else:
                 if isinstance(value, (list, tuple)):
                     chunks = _iterencode_list(value, _current_indent_level)
@@ -385,8 +393,7 @@
                     chunks = _iterencode_dict(value, _current_indent_level)
                 else:
                     chunks = _iterencode(value, _current_indent_level)
-                for chunk in chunks:
-                    yield chunk
+                yield from chunks
         if newline_indent is not None:
             _current_indent_level -= 1
             yield '\n' + _indent * _current_indent_level
@@ -404,15 +411,15 @@
         elif o is False:
             yield 'false'
         elif isinstance(o, int):
-            yield str(o)
+            # see comment for int/float in _make_iterencode
+            yield str(int(o))
         elif isinstance(o, float):
-            yield _floatstr(o)
+            # see comment for int/float in _make_iterencode
+            yield _floatstr(float(o))
         elif isinstance(o, (list, tuple)):
-            for chunk in _iterencode_list(o, _current_indent_level):
-                yield chunk
+            yield from _iterencode_list(o, _current_indent_level)
         elif isinstance(o, dict):
-            for chunk in _iterencode_dict(o, _current_indent_level):
-                yield chunk
+            yield from _iterencode_dict(o, _current_indent_level)
         else:
             if markers is not None:
                 markerid = id(o)
@@ -420,8 +427,7 @@
                     raise ValueError("Circular reference detected")
                 markers[markerid] = o
             o = _default(o)
-            for chunk in _iterencode(o, _current_indent_level):
-                yield chunk
+            yield from _iterencode(o, _current_indent_level)
             if markers is not None:
                 del markers[markerid]
     return _iterencode
diff --git a/Lib/json/scanner.py b/Lib/json/scanner.py
index 23eef61..86426cd 100644
--- a/Lib/json/scanner.py
+++ b/Lib/json/scanner.py
@@ -29,7 +29,7 @@
         try:
             nextchar = string[idx]
         except IndexError:
-            raise StopIteration
+            raise StopIteration(idx)
 
         if nextchar == '"':
             return parse_string(string, idx + 1, strict)
@@ -60,7 +60,7 @@
         elif nextchar == '-' and string[idx:idx + 9] == '-Infinity':
             return parse_constant('-Infinity'), idx + 9
         else:
-            raise StopIteration
+            raise StopIteration(idx)
 
     def scan_once(string, idx):
         try:
diff --git a/Lib/json/tool.py b/Lib/json/tool.py
index ecf9c47..7db4528 100644
--- a/Lib/json/tool.py
+++ b/Lib/json/tool.py
@@ -31,8 +31,7 @@
         except ValueError as e:
             raise SystemExit(e)
     with outfile:
-        json.dump(obj, outfile, sort_keys=True,
-                  indent=4, separators=(',', ': '))
+        json.dump(obj, outfile, sort_keys=True, indent=4)
         outfile.write('\n')
 
 
diff --git a/Lib/keyword.py b/Lib/keyword.py
index dad39cc..6e1e882 100755
--- a/Lib/keyword.py
+++ b/Lib/keyword.py
@@ -60,6 +60,12 @@
     if len(args) > 1: optfile = args[1]
     else: optfile = "Lib/keyword.py"
 
+    # load the output skeleton from the target, taking care to preserve its
+    # newline convention.
+    with open(optfile, newline='') as fp:
+        format = fp.readlines()
+    nl = format[0][len(format[0].strip()):] if format else '\n'
+
     # scan the source file for keywords
     with open(iptfile) as fp:
         strprog = re.compile('"([^"]+)"')
@@ -68,26 +74,21 @@
             if '{1, "' in line:
                 match = strprog.search(line)
                 if match:
-                    lines.append("        '" + match.group(1) + "',\n")
+                    lines.append("        '" + match.group(1) + "'," + nl)
     lines.sort()
 
-    # load the output skeleton from the target
-    with open(optfile) as fp:
-        format = fp.readlines()
-
-    # insert the lines of keywords
+    # insert the lines of keywords into the skeleton
     try:
-        start = format.index("#--start keywords--\n") + 1
-        end = format.index("#--end keywords--\n")
+        start = format.index("#--start keywords--" + nl) + 1
+        end = format.index("#--end keywords--" + nl)
         format[start:end] = lines
     except ValueError:
         sys.stderr.write("target does not contain format markers\n")
         sys.exit(1)
 
     # write the output file
-    fp = open(optfile, 'w')
-    fp.write(''.join(format))
-    fp.close()
+    with open(optfile, 'w', newline='') as fp:
+        fp.writelines(format)
 
 if __name__ == "__main__":
     main()
diff --git a/Lib/lib2to3/Grammar.txt b/Lib/lib2to3/Grammar.txt
index 1e1f24c..e667bcd 100644
--- a/Lib/lib2to3/Grammar.txt
+++ b/Lib/lib2to3/Grammar.txt
@@ -56,7 +56,7 @@
 expr_stmt: testlist_star_expr (augassign (yield_expr|testlist) |
                      ('=' (yield_expr|testlist_star_expr))*)
 testlist_star_expr: (test|star_expr) (',' (test|star_expr))* [',']
-augassign: ('+=' | '-=' | '*=' | '/=' | '%=' | '&=' | '|=' | '^=' |
+augassign: ('+=' | '-=' | '*=' | '@=' | '/=' | '%=' | '&=' | '|=' | '^=' |
             '<<=' | '>>=' | '**=' | '//=')
 # For normal assignments, additional restrictions enforced by the interpreter
 print_stmt: 'print' ( [ test (',' test)* [','] ] |
@@ -119,7 +119,7 @@
 and_expr: shift_expr ('&' shift_expr)*
 shift_expr: arith_expr (('<<'|'>>') arith_expr)*
 arith_expr: term (('+'|'-') term)*
-term: factor (('*'|'/'|'%'|'//') factor)*
+term: factor (('*'|'@'|'/'|'%'|'//') factor)*
 factor: ('+'|'-'|'~') factor | power
 power: atom trailer* ['**' factor]
 atom: ('(' [yield_expr|testlist_gexp] ')' |
@@ -155,4 +155,5 @@
 # not used in grammar, but may appear in "node" passed from Parser to Compiler
 encoding_decl: NAME
 
-yield_expr: 'yield' [testlist]
+yield_expr: 'yield' [yield_arg]
+yield_arg: 'from' test | testlist
diff --git a/Lib/lib2to3/btm_utils.py b/Lib/lib2to3/btm_utils.py
index 2276dc9..339750e 100644
--- a/Lib/lib2to3/btm_utils.py
+++ b/Lib/lib2to3/btm_utils.py
@@ -96,8 +96,7 @@
     def leaves(self):
         "Generator that returns the leaves of the tree"
         for child in self.children:
-            for x in child.leaves():
-                yield x
+            yield from child.leaves()
         if not self.children:
             yield self
 
@@ -277,7 +276,6 @@
     sub-iterables"""
     for x in sequence:
         if isinstance(x, (list, tuple)):
-            for y in rec_test(x, test_func):
-                yield y
+            yield from rec_test(x, test_func)
         else:
             yield test_func(x)
diff --git a/Lib/lib2to3/fixer_util.py b/Lib/lib2to3/fixer_util.py
index 60d219f..44502bf 100644
--- a/Lib/lib2to3/fixer_util.py
+++ b/Lib/lib2to3/fixer_util.py
@@ -129,6 +129,29 @@
     imp = Node(syms.import_from, children)
     return imp
 
+def ImportAndCall(node, results, names):
+    """Returns an import statement and calls a method
+    of the module:
+
+    import module
+    module.name()"""
+    obj = results["obj"].clone()
+    if obj.type == syms.arglist:
+        newarglist = obj.clone()
+    else:
+        newarglist = Node(syms.arglist, [obj.clone()])
+    after = results["after"]
+    if after:
+        after = [n.clone() for n in after]
+    new = Node(syms.power,
+               Attr(Name(names[0]), Name(names[1])) +
+               [Node(syms.trailer,
+                     [results["lpar"].clone(),
+                      newarglist,
+                      results["rpar"].clone()])] + after)
+    new.prefix = node.prefix
+    return new
+
 
 ###########################################################
 ### Determine whether a node represents a given literal
@@ -164,8 +187,8 @@
     return Node(syms.atom, [LParen(), node, RParen()])
 
 
-consuming_calls = set(["sorted", "list", "set", "any", "all", "tuple", "sum",
-                       "min", "max", "enumerate"])
+consuming_calls = {"sorted", "list", "set", "any", "all", "tuple", "sum",
+                   "min", "max", "enumerate"}
 
 def attr_chain(obj, attr):
     """Follow an attribute chain.
@@ -336,7 +359,7 @@
     root.insert_child(insert_pos, Node(syms.simple_stmt, children))
 
 
-_def_syms = set([syms.classdef, syms.funcdef])
+_def_syms = {syms.classdef, syms.funcdef}
 def find_binding(name, node, package=None):
     """ Returns the node which binds variable name, otherwise None.
         If optional argument package is supplied, only imports will
@@ -379,7 +402,7 @@
                 return ret
     return None
 
-_block_syms = set([syms.funcdef, syms.classdef, syms.trailer])
+_block_syms = {syms.funcdef, syms.classdef, syms.trailer}
 def _find(name, node):
     nodes = [node]
     while nodes:
diff --git a/Lib/lib2to3/fixes/fix_asserts.py b/Lib/lib2to3/fixes/fix_asserts.py
new file mode 100644
index 0000000..5bcec88
--- /dev/null
+++ b/Lib/lib2to3/fixes/fix_asserts.py
@@ -0,0 +1,34 @@
+"""Fixer that replaces deprecated unittest method names."""
+
+# Author: Ezio Melotti
+
+from ..fixer_base import BaseFix
+from ..fixer_util import Name
+
+NAMES = dict(
+    assert_="assertTrue",
+    assertEquals="assertEqual",
+    assertNotEquals="assertNotEqual",
+    assertAlmostEquals="assertAlmostEqual",
+    assertNotAlmostEquals="assertNotAlmostEqual",
+    assertRegexpMatches="assertRegex",
+    assertRaisesRegexp="assertRaisesRegex",
+    failUnlessEqual="assertEqual",
+    failIfEqual="assertNotEqual",
+    failUnlessAlmostEqual="assertAlmostEqual",
+    failIfAlmostEqual="assertNotAlmostEqual",
+    failUnless="assertTrue",
+    failUnlessRaises="assertRaises",
+    failIf="assertFalse",
+)
+
+
+class FixAsserts(BaseFix):
+
+    PATTERN = """
+              power< any+ trailer< '.' meth=(%s)> any* >
+              """ % '|'.join(map(repr, NAMES))
+
+    def transform(self, node, results):
+        name = results["meth"][0]
+        name.replace(Name(NAMES[str(name)], prefix=name.prefix))
diff --git a/Lib/lib2to3/fixes/fix_dict.py b/Lib/lib2to3/fixes/fix_dict.py
index 4cc3717..963f952 100644
--- a/Lib/lib2to3/fixes/fix_dict.py
+++ b/Lib/lib2to3/fixes/fix_dict.py
@@ -36,7 +36,7 @@
 from .. import fixer_util
 
 
-iter_exempt = fixer_util.consuming_calls | set(["iter"])
+iter_exempt = fixer_util.consuming_calls | {"iter"}
 
 
 class FixDict(fixer_base.BaseFix):
diff --git a/Lib/lib2to3/fixes/fix_exitfunc.py b/Lib/lib2to3/fixes/fix_exitfunc.py
index 9afc2fa..2e47887 100644
--- a/Lib/lib2to3/fixes/fix_exitfunc.py
+++ b/Lib/lib2to3/fixes/fix_exitfunc.py
@@ -35,7 +35,7 @@
         self.sys_import = None
 
     def transform(self, node, results):
-        # First, find a the sys import. We'll just hope it's global scope.
+        # First, find the sys import. We'll just hope it's global scope.
         if "sys_import" in results:
             if self.sys_import is None:
                 self.sys_import = results["sys_import"]
diff --git a/Lib/lib2to3/fixes/fix_intern.py b/Lib/lib2to3/fixes/fix_intern.py
index 6be11cd..fb2973c 100644
--- a/Lib/lib2to3/fixes/fix_intern.py
+++ b/Lib/lib2to3/fixes/fix_intern.py
@@ -6,9 +6,8 @@
 intern(s) -> sys.intern(s)"""
 
 # Local imports
-from .. import pytree
 from .. import fixer_base
-from ..fixer_util import Name, Attr, touch_import
+from ..fixer_util import ImportAndCall, touch_import
 
 
 class FixIntern(fixer_base.BaseFix):
@@ -26,21 +25,7 @@
     """
 
     def transform(self, node, results):
-        syms = self.syms
-        obj = results["obj"].clone()
-        if obj.type == syms.arglist:
-            newarglist = obj.clone()
-        else:
-            newarglist = pytree.Node(syms.arglist, [obj.clone()])
-        after = results["after"]
-        if after:
-            after = [n.clone() for n in after]
-        new = pytree.Node(syms.power,
-                          Attr(Name("sys"), Name("intern")) +
-                          [pytree.Node(syms.trailer,
-                                       [results["lpar"].clone(),
-                                        newarglist,
-                                        results["rpar"].clone()])] + after)
-        new.prefix = node.prefix
+        names = ('sys', 'intern')
+        new = ImportAndCall(node, results, names)
         touch_import(None, 'sys', node)
         return new
diff --git a/Lib/lib2to3/fixes/fix_reload.py b/Lib/lib2to3/fixes/fix_reload.py
new file mode 100644
index 0000000..1855357
--- /dev/null
+++ b/Lib/lib2to3/fixes/fix_reload.py
@@ -0,0 +1,28 @@
+"""Fixer for reload().
+
+reload(s) -> imp.reload(s)"""
+
+# Local imports
+from .. import fixer_base
+from ..fixer_util import ImportAndCall, touch_import
+
+
+class FixReload(fixer_base.BaseFix):
+    BM_compatible = True
+    order = "pre"
+
+    PATTERN = """
+    power< 'reload'
+           trailer< lpar='('
+                    ( not(arglist | argument<any '=' any>) obj=any
+                      | obj=arglist<(not argument<any '=' any>) any ','> )
+                    rpar=')' >
+           after=any*
+    >
+    """
+
+    def transform(self, node, results):
+        names = ('imp', 'reload')
+        new = ImportAndCall(node, results, names)
+        touch_import(None, 'imp', node)
+        return new
diff --git a/Lib/lib2to3/main.py b/Lib/lib2to3/main.py
index f9cc18b..1a1df01 100644
--- a/Lib/lib2to3/main.py
+++ b/Lib/lib2to3/main.py
@@ -2,7 +2,7 @@
 Main program for 2to3.
 """
 
-from __future__ import with_statement
+from __future__ import with_statement, print_function
 
 import sys
 import os
@@ -90,11 +90,11 @@
             if os.path.lexists(backup):
                 try:
                     os.remove(backup)
-                except os.error as err:
+                except OSError as err:
                     self.log_message("Can't remove backup %s", backup)
             try:
                 os.rename(filename, backup)
-            except os.error as err:
+            except OSError as err:
                 self.log_message("Can't rename %s to %s", filename, backup)
         # Actually write the new file
         write = super(StdoutRefactoringTool, self).write_file
diff --git a/Lib/lib2to3/patcomp.py b/Lib/lib2to3/patcomp.py
index 0a259e9..2012ec4 100644
--- a/Lib/lib2to3/patcomp.py
+++ b/Lib/lib2to3/patcomp.py
@@ -32,7 +32,7 @@
 
 def tokenize_wrapper(input):
     """Tokenizes a string suppressing significant whitespace."""
-    skip = set((token.NEWLINE, token.INDENT, token.DEDENT))
+    skip = {token.NEWLINE, token.INDENT, token.DEDENT}
     tokens = tokenize.generate_tokens(io.StringIO(input).readline)
     for quintuple in tokens:
         type, value, start, end, line_text = quintuple
diff --git a/Lib/lib2to3/pgen2/conv.py b/Lib/lib2to3/pgen2/conv.py
index bf49762..ed0cac5 100644
--- a/Lib/lib2to3/pgen2/conv.py
+++ b/Lib/lib2to3/pgen2/conv.py
@@ -60,7 +60,7 @@
         """
         try:
             f = open(filename)
-        except IOError as err:
+        except OSError as err:
             print("Can't open %s: %s" % (filename, err))
             return False
         self.symbol2number = {}
@@ -111,7 +111,7 @@
         """
         try:
             f = open(filename)
-        except IOError as err:
+        except OSError as err:
             print("Can't open %s: %s" % (filename, err))
             return False
         # The code below essentially uses f's iterator-ness!
diff --git a/Lib/lib2to3/pgen2/driver.py b/Lib/lib2to3/pgen2/driver.py
index 4c611c6..3ccc69d 100644
--- a/Lib/lib2to3/pgen2/driver.py
+++ b/Lib/lib2to3/pgen2/driver.py
@@ -123,7 +123,7 @@
             logger.info("Writing grammar tables to %s", gp)
             try:
                 g.dump(gp)
-            except IOError as e:
+            except OSError as e:
                 logger.info("Writing failed:"+str(e))
     else:
         g = grammar.Grammar()
diff --git a/Lib/lib2to3/pgen2/grammar.py b/Lib/lib2to3/pgen2/grammar.py
index 14c5f70..b4481d1 100644
--- a/Lib/lib2to3/pgen2/grammar.py
+++ b/Lib/lib2to3/pgen2/grammar.py
@@ -86,15 +86,13 @@
 
     def dump(self, filename):
         """Dump the grammar tables to a pickle file."""
-        f = open(filename, "wb")
-        pickle.dump(self.__dict__, f, 2)
-        f.close()
+        with open(filename, "wb") as f:
+            pickle.dump(self.__dict__, f, 2)
 
     def load(self, filename):
         """Load the grammar tables from a pickle file."""
-        f = open(filename, "rb")
-        d = pickle.load(f)
-        f.close()
+        with open(filename, "rb") as f:
+            d = pickle.load(f)
         self.__dict__.update(d)
 
     def copy(self):
@@ -151,6 +149,7 @@
 { LBRACE
 } RBRACE
 @ AT
+@= ATEQUAL
 == EQEQUAL
 != NOTEQUAL
 <> NOTEQUAL
diff --git a/Lib/lib2to3/pgen2/token.py b/Lib/lib2to3/pgen2/token.py
index 6a6d0b6..7599396 100755
--- a/Lib/lib2to3/pgen2/token.py
+++ b/Lib/lib2to3/pgen2/token.py
@@ -57,12 +57,13 @@
 DOUBLESLASH = 48
 DOUBLESLASHEQUAL = 49
 AT = 50
-OP = 51
-COMMENT = 52
-NL = 53
-RARROW = 54
-ERRORTOKEN = 55
-N_TOKENS = 56
+ATEQUAL = 51
+OP = 52
+COMMENT = 53
+NL = 54
+RARROW = 55
+ERRORTOKEN = 56
+N_TOKENS = 57
 NT_OFFSET = 256
 #--end constants--
 
diff --git a/Lib/lib2to3/pgen2/tokenize.py b/Lib/lib2to3/pgen2/tokenize.py
index 1bb931e..3dd1ee9 100644
--- a/Lib/lib2to3/pgen2/tokenize.py
+++ b/Lib/lib2to3/pgen2/tokenize.py
@@ -84,7 +84,7 @@
 # recognized as two instances of =).
 Operator = group(r"\*\*=?", r">>=?", r"<<=?", r"<>", r"!=",
                  r"//=?", r"->",
-                 r"[+\-*/%&|^=<>]=?",
+                 r"[+\-*/%&@|^=<>]=?",
                  r"~")
 
 Bracket = '[][(){}]'
diff --git a/Lib/lib2to3/pytree.py b/Lib/lib2to3/pytree.py
index 17cbf0a..ad3592c 100644
--- a/Lib/lib2to3/pytree.py
+++ b/Lib/lib2to3/pytree.py
@@ -64,16 +64,6 @@
 
     __hash__ = None # For Py3 compatibility.
 
-    def __ne__(self, other):
-        """
-        Compare two nodes for inequality.
-
-        This calls the method _eq().
-        """
-        if self.__class__ is not other.__class__:
-            return NotImplemented
-        return not self._eq(other)
-
     def _eq(self, other):
         """
         Compare two nodes for equality.
@@ -194,8 +184,7 @@
 
     def leaves(self):
         for child in self.children:
-            for x in child.leaves():
-                yield x
+            yield from child.leaves()
 
     def depth(self):
         if self.parent is None:
@@ -274,16 +263,14 @@
     def post_order(self):
         """Return a post-order iterator for the tree."""
         for child in self.children:
-            for node in child.post_order():
-                yield node
+            yield from child.post_order()
         yield self
 
     def pre_order(self):
         """Return a pre-order iterator for the tree."""
         yield self
         for child in self.children:
-            for node in child.pre_order():
-                yield node
+            yield from child.pre_order()
 
     def _prefix_getter(self):
         """
diff --git a/Lib/lib2to3/refactor.py b/Lib/lib2to3/refactor.py
index 201e193..c24be14 100644
--- a/Lib/lib2to3/refactor.py
+++ b/Lib/lib2to3/refactor.py
@@ -57,7 +57,7 @@
         # Always return leafs
         if pat.type is None:
             raise _EveryNode
-        return set([pat.type])
+        return {pat.type}
 
     if isinstance(pat, pytree.NegatedPattern):
         if pat.content:
@@ -133,7 +133,7 @@
     def advance():
         tok = next(gen)
         return tok[0], tok[1]
-    ignore = frozenset((token.NEWLINE, tokenize.NL, token.COMMENT))
+    ignore = frozenset({token.NEWLINE, tokenize.NL, token.COMMENT})
     features = set()
     try:
         while True:
@@ -326,7 +326,7 @@
         """
         try:
             f = open(filename, "rb")
-        except IOError as err:
+        except OSError as err:
             self.log_error("Can't open %s: %s", filename, err)
             return None, None
         try:
@@ -534,12 +534,12 @@
         """
         try:
             f = _open_with_encoding(filename, "w", encoding=encoding)
-        except os.error as err:
+        except OSError as err:
             self.log_error("Can't create %s: %s", filename, err)
             return
         try:
             f.write(_to_system_newlines(new_text))
-        except os.error as err:
+        except OSError as err:
             self.log_error("Can't write %s: %s", filename, err)
         finally:
             f.close()
diff --git a/Lib/lib2to3/tests/__init__.py b/Lib/lib2to3/tests/__init__.py
index cfaea0d..c5166fc 100644
--- a/Lib/lib2to3/tests/__init__.py
+++ b/Lib/lib2to3/tests/__init__.py
@@ -1,24 +1,9 @@
-"""Make tests/ into a package. This allows us to "import tests" and
-have tests.all_tests be a TestSuite representing all test cases
-from all test_*.py files in tests/."""
 # Author: Collin Winter
 
 import os
-import os.path
 import unittest
-import types
 
-from . import support
+from test.support import load_package_tests
 
-all_tests = unittest.TestSuite()
-
-tests_dir = os.path.join(os.path.dirname(__file__), '..', 'tests')
-tests = [t[0:-3] for t in os.listdir(tests_dir)
-                        if t.startswith('test_') and t.endswith('.py')]
-
-loader = unittest.TestLoader()
-
-for t in tests:
-    __import__("",globals(),locals(),[t],level=1)
-    mod = globals()[t]
-    all_tests.addTests(loader.loadTestsFromModule(mod))
+def load_tests(*args):
+    return load_package_tests(os.path.dirname(__file__), *args)
diff --git a/Lib/lib2to3/tests/__main__.py b/Lib/lib2to3/tests/__main__.py
new file mode 100644
index 0000000..40a23a2
--- /dev/null
+++ b/Lib/lib2to3/tests/__main__.py
@@ -0,0 +1,4 @@
+from . import load_tests
+import unittest
+
+unittest.main()
diff --git a/Lib/lib2to3/tests/pytree_idempotency.py b/Lib/lib2to3/tests/pytree_idempotency.py
index a02bbfe..c6359bf 100755
--- a/Lib/lib2to3/tests/pytree_idempotency.py
+++ b/Lib/lib2to3/tests/pytree_idempotency.py
@@ -4,6 +4,8 @@
 
 """Main program for testing the infrastructure."""
 
+from __future__ import print_function
+
 __author__ = "Guido van Rossum <guido@python.org>"
 
 # Support imports (need to be imported first)
@@ -53,7 +55,7 @@
     for dir in sys.path:
         try:
             names = os.listdir(dir)
-        except os.error:
+        except OSError:
             continue
         print("Scanning", dir, "...", file=sys.stderr)
         for name in names:
diff --git a/Lib/lib2to3/tests/test_all_fixers.py b/Lib/lib2to3/tests/test_all_fixers.py
index f64b3d9..15079fe 100644
--- a/Lib/lib2to3/tests/test_all_fixers.py
+++ b/Lib/lib2to3/tests/test_all_fixers.py
@@ -7,12 +7,14 @@
 
 # Python imports
 import unittest
+import test.support
 
 # Local imports
 from lib2to3 import refactor
 from . import support
 
 
+@test.support.requires_resource('cpu')
 class Test_all(support.TestCase):
 
     def setUp(self):
@@ -21,3 +23,6 @@
     def test_all_project_files(self):
         for filepath in support.all_project_files():
             self.refactor.refactor_file(filepath)
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Lib/lib2to3/tests/test_fixers.py b/Lib/lib2to3/tests/test_fixers.py
index 2f08f93..06b0033 100644
--- a/Lib/lib2to3/tests/test_fixers.py
+++ b/Lib/lib2to3/tests/test_fixers.py
@@ -282,6 +282,65 @@
         b = """f(*args, **kwds)"""
         self.check(a, b)
 
+class Test_reload(FixerTestCase):
+    fixer = "reload"
+
+    def test(self):
+        b = """reload(a)"""
+        a = """import imp\nimp.reload(a)"""
+        self.check(b, a)
+
+    def test_comment(self):
+        b = """reload( a ) # comment"""
+        a = """import imp\nimp.reload( a ) # comment"""
+        self.check(b, a)
+
+        # PEP 8 comments
+        b = """reload( a )  # comment"""
+        a = """import imp\nimp.reload( a )  # comment"""
+        self.check(b, a)
+
+    def test_space(self):
+        b = """reload( a )"""
+        a = """import imp\nimp.reload( a )"""
+        self.check(b, a)
+
+        b = """reload( a)"""
+        a = """import imp\nimp.reload( a)"""
+        self.check(b, a)
+
+        b = """reload(a )"""
+        a = """import imp\nimp.reload(a )"""
+        self.check(b, a)
+
+    def test_unchanged(self):
+        s = """reload(a=1)"""
+        self.unchanged(s)
+
+        s = """reload(f, g)"""
+        self.unchanged(s)
+
+        s = """reload(f, *h)"""
+        self.unchanged(s)
+
+        s = """reload(f, *h, **i)"""
+        self.unchanged(s)
+
+        s = """reload(f, **i)"""
+        self.unchanged(s)
+
+        s = """reload(*h, **i)"""
+        self.unchanged(s)
+
+        s = """reload(*h)"""
+        self.unchanged(s)
+
+        s = """reload(**i)"""
+        self.unchanged(s)
+
+        s = """reload()"""
+        self.unchanged(s)
+
 class Test_intern(FixerTestCase):
     fixer = "intern"
 
@@ -4576,3 +4635,53 @@
     def test_unchanged(self):
         s = """f(sys.exitfunc)"""
         self.unchanged(s)
+
+
+class Test_asserts(FixerTestCase):
+
+    fixer = "asserts"
+
+    def test_deprecated_names(self):
+        tests = [
+            ('self.assert_(True)', 'self.assertTrue(True)'),
+            ('self.assertEquals(2, 2)', 'self.assertEqual(2, 2)'),
+            ('self.assertNotEquals(2, 3)', 'self.assertNotEqual(2, 3)'),
+            ('self.assertAlmostEquals(2, 3)', 'self.assertAlmostEqual(2, 3)'),
+            ('self.assertNotAlmostEquals(2, 8)', 'self.assertNotAlmostEqual(2, 8)'),
+            ('self.failUnlessEqual(2, 2)', 'self.assertEqual(2, 2)'),
+            ('self.failIfEqual(2, 3)', 'self.assertNotEqual(2, 3)'),
+            ('self.failUnlessAlmostEqual(2, 3)', 'self.assertAlmostEqual(2, 3)'),
+            ('self.failIfAlmostEqual(2, 8)', 'self.assertNotAlmostEqual(2, 8)'),
+            ('self.failUnless(True)', 'self.assertTrue(True)'),
+            ('self.failUnlessRaises(foo)', 'self.assertRaises(foo)'),
+            ('self.failIf(False)', 'self.assertFalse(False)'),
+        ]
+        for b, a in tests:
+            self.check(b, a)
+
+    def test_variants(self):
+        b = 'eq = self.assertEquals'
+        a = 'eq = self.assertEqual'
+        self.check(b, a)
+        b = 'self.assertEquals(2, 3, msg="fail")'
+        a = 'self.assertEqual(2, 3, msg="fail")'
+        self.check(b, a)
+        b = 'self.assertEquals(2, 3, msg="fail") # foo'
+        a = 'self.assertEqual(2, 3, msg="fail") # foo'
+        self.check(b, a)
+        b = 'self.assertEquals (2, 3)'
+        a = 'self.assertEqual (2, 3)'
+        self.check(b, a)
+        b = '  self.assertEquals (2, 3)'
+        a = '  self.assertEqual (2, 3)'
+        self.check(b, a)
+        b = 'with self.failUnlessRaises(Explosion): explode()'
+        a = 'with self.assertRaises(Explosion): explode()'
+        self.check(b, a)
+        b = 'with self.failUnlessRaises(Explosion) as cm: explode()'
+        a = 'with self.assertRaises(Explosion) as cm: explode()'
+        self.check(b, a)
+
+    def test_unchanged(self):
+        self.unchanged('self.assertEqualsOnSaturday')
+        self.unchanged('self.assertEqualsOnSaturday(3, 5)')
diff --git a/Lib/lib2to3/tests/test_parser.py b/Lib/lib2to3/tests/test_parser.py
index a383a14..5bb9d2b 100644
--- a/Lib/lib2to3/tests/test_parser.py
+++ b/Lib/lib2to3/tests/test_parser.py
@@ -48,6 +48,19 @@
             raise AssertionError("Syntax shouldn't have been valid")
 
 
+class TestMatrixMultiplication(GrammarTest):
+    def test_matrix_multiplication_operator(self):
+        self.validate("a @ b")
+        self.validate("a @= b")
+
+
+class TestYieldFrom(GrammarTest):
+    def test_matrix_multiplication_operator(self):
+        self.validate("yield from x")
+        self.validate("(yield from x) + y")
+        self.invalid_syntax("yield from")
+
+
 class TestRaiseChanges(GrammarTest):
     def test_2x_style_1(self):
         self.validate("raise")
@@ -77,7 +90,7 @@
         self.invalid_syntax("raise E from")
 
 
-# Adaptated from Python 3's Lib/test/test_grammar.py:GrammarTests.testFuncdef
+# Adapted from Python 3's Lib/test/test_grammar.py:GrammarTests.testFuncdef
 class TestFunctionAnnotations(GrammarTest):
     def test_1(self):
         self.validate("""def f(x) -> list: pass""")
diff --git a/Lib/linecache.py b/Lib/linecache.py
index c3f2c3f..02a9eb5 100644
--- a/Lib/linecache.py
+++ b/Lib/linecache.py
@@ -59,7 +59,7 @@
             continue   # no-op for files loaded via a __loader__
         try:
             stat = os.stat(fullname)
-        except os.error:
+        except OSError:
             del cache[filename]
             continue
         if size != stat.st_size or mtime != stat.st_mtime:
@@ -91,7 +91,7 @@
             if name and get_source:
                 try:
                     data = get_source(name)
-                except (ImportError, IOError):
+                except (ImportError, OSError):
                     pass
                 else:
                     if data is None:
@@ -118,14 +118,14 @@
             try:
                 stat = os.stat(fullname)
                 break
-            except os.error:
+            except OSError:
                 pass
         else:
             return []
     try:
         with tokenize.open(fullname) as fp:
             lines = fp.readlines()
-    except IOError:
+    except OSError:
         return []
     if lines and not lines[-1].endswith('\n'):
         lines[-1] += '\n'
diff --git a/Lib/locale.py b/Lib/locale.py
index 7cfea61..7ff4356 100644
--- a/Lib/locale.py
+++ b/Lib/locale.py
@@ -344,14 +344,32 @@
     # Convert the encoding to a C lib compatible encoding string
     norm_encoding = encodings.normalize_encoding(encoding)
     #print('norm encoding: %r' % norm_encoding)
-    norm_encoding = encodings.aliases.aliases.get(norm_encoding,
+    norm_encoding = encodings.aliases.aliases.get(norm_encoding.lower(),
                                                   norm_encoding)
     #print('aliased encoding: %r' % norm_encoding)
-    encoding = locale_encoding_alias.get(norm_encoding,
-                                         norm_encoding)
+    encoding = norm_encoding
+    norm_encoding = norm_encoding.lower()
+    if norm_encoding in locale_encoding_alias:
+        encoding = locale_encoding_alias[norm_encoding]
+    else:
+        norm_encoding = norm_encoding.replace('_', '')
+        norm_encoding = norm_encoding.replace('-', '')
+        if norm_encoding in locale_encoding_alias:
+            encoding = locale_encoding_alias[norm_encoding]
     #print('found encoding %r' % encoding)
     return langname + '.' + encoding
 
+def _append_modifier(code, modifier):
+    if modifier == 'euro':
+        if '.' not in code:
+            return code + '.ISO8859-15'
+        _, _, encoding = code.partition('.')
+        if encoding in ('ISO8859-15', 'UTF-8'):
+            return code
+        if encoding == 'ISO8859-1':
+            return _replace_encoding(code, 'ISO8859-15')
+    return code + '@' + modifier
+
 def normalize(localename):
 
     """ Returns a normalized locale code for the given locale
@@ -403,7 +421,7 @@
         if code is not None:
             #print('lookup without modifier succeeded')
             if '@' not in code:
-                return code + '@' + modifier
+                return _append_modifier(code, modifier)
             if code.split('@', 1)[1].lower() == modifier:
                 return code
         #print('second lookup failed')
@@ -427,7 +445,8 @@
             if code is not None:
                 #print('lookup without modifier and encoding succeeded')
                 if '@' not in code:
-                    return _replace_encoding(code, encoding) + '@' + modifier
+                    code = _replace_encoding(code, encoding)
+                    return _append_modifier(code, modifier)
                 code, defmod = code.split('@', 1)
                 if defmod.lower() == modifier:
                     return _replace_encoding(code, encoding) + '@' + defmod
@@ -586,8 +605,8 @@
     # On Win32, this will return the ANSI code page
     def getpreferredencoding(do_setlocale = True):
         """Return the charset that the user is likely using."""
-        import _locale
-        return _locale._getdefaultlocale()[1]
+        import _bootlocale
+        return _bootlocale.getpreferredencoding(False)
 else:
     # On Unix, if CODESET is available, use that.
     try:
@@ -606,27 +625,16 @@
         def getpreferredencoding(do_setlocale = True):
             """Return the charset that the user is likely using,
             according to the system configuration."""
+            import _bootlocale
             if do_setlocale:
                 oldloc = setlocale(LC_CTYPE)
                 try:
                     setlocale(LC_CTYPE, "")
                 except Error:
                     pass
-                result = nl_langinfo(CODESET)
-                if not result and sys.platform == 'darwin':
-                    # nl_langinfo can return an empty string
-                    # when the setting has an invalid value.
-                    # Default to UTF-8 in that case because
-                    # UTF-8 is the default charset on OSX and
-                    # returning nothing will crash the
-                    # interpreter.
-                    result = 'UTF-8'
+            result = _bootlocale.getpreferredencoding(False)
+            if do_setlocale:
                 setlocale(LC_CTYPE, oldloc)
-            else:
-                result = nl_langinfo(CODESET)
-                if not result and sys.platform == 'darwin':
-                    # See above for explanation
-                    result = 'UTF-8'
             return result
 
 
@@ -654,6 +662,14 @@
     'jis':                          'JIS7',
     'jis7':                         'JIS7',
     'ajec':                         'eucJP',
+    'koi8c':                        'KOI8-C',
+    'microsoftcp1251':              'CP1251',
+    'microsoftcp1255':              'CP1255',
+    'microsoftcp1256':              'CP1256',
+    '88591':                        'ISO8859-1',
+    '88592':                        'ISO8859-2',
+    '88595':                        'ISO8859-5',
+    '885915':                       'ISO8859-15',
 
     # Mappings from Python codec names to C lib encoding names
     'ascii':                        'ISO8859-1',
@@ -681,10 +697,18 @@
     'utf_8':                        'UTF-8',
     'koi8_r':                       'KOI8-R',
     'koi8_u':                       'KOI8-U',
+    'cp1251':                       'CP1251',
+    'cp1255':                       'CP1255',
+    'cp1256':                       'CP1256',
+
     # XXX This list is still incomplete. If you know more
     # mappings, please file a bug report. Thanks.
 }
 
+for k, v in sorted(locale_encoding_alias.items()):
+    k = k.replace('_', '')
+    locale_encoding_alias.setdefault(k, v)
+
 #
 # The locale_alias table maps lowercase alias names to C locale names
 # (case-sensitive). Encodings are always separated from the locale
@@ -793,440 +817,237 @@
 #    updated 'sr_cs' -> 'sr_RS.UTF-8' to 'sr_CS.UTF-8'
 #    updated 'sr_cs.utf8@latn' -> 'sr_RS.UTF-8@latin' to 'sr_CS.UTF-8@latin'
 #    updated 'sr_cs@latn' -> 'sr_RS.UTF-8@latin' to 'sr_CS.UTF-8@latin'
+#
+# SS 2014-10-01:
+# Updated alias mapping with glibc 2.19 supported locales.
 
 locale_alias = {
     'a3':                                   'az_AZ.KOI8-C',
     'a3_az':                                'az_AZ.KOI8-C',
-    'a3_az.koi8c':                          'az_AZ.KOI8-C',
     'a3_az.koic':                           'az_AZ.KOI8-C',
+    'aa_dj':                                'aa_DJ.ISO8859-1',
+    'aa_er':                                'aa_ER.UTF-8',
+    'aa_et':                                'aa_ET.UTF-8',
     'af':                                   'af_ZA.ISO8859-1',
     'af_za':                                'af_ZA.ISO8859-1',
-    'af_za.iso88591':                       'af_ZA.ISO8859-1',
     'am':                                   'am_ET.UTF-8',
     'am_et':                                'am_ET.UTF-8',
     'american':                             'en_US.ISO8859-1',
-    'american.iso88591':                    'en_US.ISO8859-1',
+    'an_es':                                'an_ES.ISO8859-15',
     'ar':                                   'ar_AA.ISO8859-6',
     'ar_aa':                                'ar_AA.ISO8859-6',
-    'ar_aa.iso88596':                       'ar_AA.ISO8859-6',
     'ar_ae':                                'ar_AE.ISO8859-6',
-    'ar_ae.iso88596':                       'ar_AE.ISO8859-6',
     'ar_bh':                                'ar_BH.ISO8859-6',
-    'ar_bh.iso88596':                       'ar_BH.ISO8859-6',
     'ar_dz':                                'ar_DZ.ISO8859-6',
-    'ar_dz.iso88596':                       'ar_DZ.ISO8859-6',
     'ar_eg':                                'ar_EG.ISO8859-6',
-    'ar_eg.iso88596':                       'ar_EG.ISO8859-6',
     'ar_in':                                'ar_IN.UTF-8',
     'ar_iq':                                'ar_IQ.ISO8859-6',
-    'ar_iq.iso88596':                       'ar_IQ.ISO8859-6',
     'ar_jo':                                'ar_JO.ISO8859-6',
-    'ar_jo.iso88596':                       'ar_JO.ISO8859-6',
     'ar_kw':                                'ar_KW.ISO8859-6',
-    'ar_kw.iso88596':                       'ar_KW.ISO8859-6',
     'ar_lb':                                'ar_LB.ISO8859-6',
-    'ar_lb.iso88596':                       'ar_LB.ISO8859-6',
     'ar_ly':                                'ar_LY.ISO8859-6',
-    'ar_ly.iso88596':                       'ar_LY.ISO8859-6',
     'ar_ma':                                'ar_MA.ISO8859-6',
-    'ar_ma.iso88596':                       'ar_MA.ISO8859-6',
     'ar_om':                                'ar_OM.ISO8859-6',
-    'ar_om.iso88596':                       'ar_OM.ISO8859-6',
     'ar_qa':                                'ar_QA.ISO8859-6',
-    'ar_qa.iso88596':                       'ar_QA.ISO8859-6',
     'ar_sa':                                'ar_SA.ISO8859-6',
-    'ar_sa.iso88596':                       'ar_SA.ISO8859-6',
     'ar_sd':                                'ar_SD.ISO8859-6',
-    'ar_sd.iso88596':                       'ar_SD.ISO8859-6',
     'ar_sy':                                'ar_SY.ISO8859-6',
-    'ar_sy.iso88596':                       'ar_SY.ISO8859-6',
     'ar_tn':                                'ar_TN.ISO8859-6',
-    'ar_tn.iso88596':                       'ar_TN.ISO8859-6',
     'ar_ye':                                'ar_YE.ISO8859-6',
-    'ar_ye.iso88596':                       'ar_YE.ISO8859-6',
     'arabic':                               'ar_AA.ISO8859-6',
-    'arabic.iso88596':                      'ar_AA.ISO8859-6',
     'as':                                   'as_IN.UTF-8',
     'as_in':                                'as_IN.UTF-8',
+    'ast_es':                               'ast_ES.ISO8859-15',
+    'ayc_pe':                               'ayc_PE.UTF-8',
     'az':                                   'az_AZ.ISO8859-9E',
     'az_az':                                'az_AZ.ISO8859-9E',
     'az_az.iso88599e':                      'az_AZ.ISO8859-9E',
     'be':                                   'be_BY.CP1251',
     'be@latin':                             'be_BY.UTF-8@latin',
+    'be_bg.utf8':                           'bg_BG.UTF-8',
     'be_by':                                'be_BY.CP1251',
-    'be_by.cp1251':                         'be_BY.CP1251',
-    'be_by.microsoftcp1251':                'be_BY.CP1251',
-    'be_by.utf8@latin':                     'be_BY.UTF-8@latin',
     'be_by@latin':                          'be_BY.UTF-8@latin',
+    'bem_zm':                               'bem_ZM.UTF-8',
+    'ber_dz':                               'ber_DZ.UTF-8',
+    'ber_ma':                               'ber_MA.UTF-8',
     'bg':                                   'bg_BG.CP1251',
     'bg_bg':                                'bg_BG.CP1251',
-    'bg_bg.cp1251':                         'bg_BG.CP1251',
-    'bg_bg.iso88595':                       'bg_BG.ISO8859-5',
-    'bg_bg.koi8r':                          'bg_BG.KOI8-R',
-    'bg_bg.microsoftcp1251':                'bg_BG.CP1251',
+    'bho_in':                               'bho_IN.UTF-8',
+    'bn_bd':                                'bn_BD.UTF-8',
     'bn_in':                                'bn_IN.UTF-8',
+    'bo_cn':                                'bo_CN.UTF-8',
     'bo_in':                                'bo_IN.UTF-8',
     'bokmal':                               'nb_NO.ISO8859-1',
     'bokm\xe5l':                            'nb_NO.ISO8859-1',
     'br':                                   'br_FR.ISO8859-1',
     'br_fr':                                'br_FR.ISO8859-1',
-    'br_fr.iso88591':                       'br_FR.ISO8859-1',
-    'br_fr.iso885914':                      'br_FR.ISO8859-14',
-    'br_fr.iso885915':                      'br_FR.ISO8859-15',
-    'br_fr.iso885915@euro':                 'br_FR.ISO8859-15',
-    'br_fr.utf8@euro':                      'br_FR.UTF-8',
-    'br_fr@euro':                           'br_FR.ISO8859-15',
+    'brx_in':                               'brx_IN.UTF-8',
     'bs':                                   'bs_BA.ISO8859-2',
     'bs_ba':                                'bs_BA.ISO8859-2',
-    'bs_ba.iso88592':                       'bs_BA.ISO8859-2',
     'bulgarian':                            'bg_BG.CP1251',
+    'byn_er':                               'byn_ER.UTF-8',
     'c':                                    'C',
     'c-french':                             'fr_CA.ISO8859-1',
-    'c-french.iso88591':                    'fr_CA.ISO8859-1',
     'c.ascii':                              'C',
     'c.en':                                 'C',
     'c.iso88591':                           'en_US.ISO8859-1',
+    'c.utf8':                               'en_US.UTF-8',
     'c_c':                                  'C',
     'c_c.c':                                'C',
     'ca':                                   'ca_ES.ISO8859-1',
     'ca_ad':                                'ca_AD.ISO8859-1',
-    'ca_ad.iso88591':                       'ca_AD.ISO8859-1',
-    'ca_ad.iso885915':                      'ca_AD.ISO8859-15',
-    'ca_ad.iso885915@euro':                 'ca_AD.ISO8859-15',
-    'ca_ad.utf8@euro':                      'ca_AD.UTF-8',
-    'ca_ad@euro':                           'ca_AD.ISO8859-15',
     'ca_es':                                'ca_ES.ISO8859-1',
-    'ca_es.iso88591':                       'ca_ES.ISO8859-1',
-    'ca_es.iso885915':                      'ca_ES.ISO8859-15',
-    'ca_es.iso885915@euro':                 'ca_ES.ISO8859-15',
-    'ca_es.utf8@euro':                      'ca_ES.UTF-8',
-    'ca_es@euro':                           'ca_ES.ISO8859-15',
+    'ca_es@valencia':                       'ca_ES.ISO8859-15@valencia',
     'ca_fr':                                'ca_FR.ISO8859-1',
-    'ca_fr.iso88591':                       'ca_FR.ISO8859-1',
-    'ca_fr.iso885915':                      'ca_FR.ISO8859-15',
-    'ca_fr.iso885915@euro':                 'ca_FR.ISO8859-15',
-    'ca_fr.utf8@euro':                      'ca_FR.UTF-8',
-    'ca_fr@euro':                           'ca_FR.ISO8859-15',
     'ca_it':                                'ca_IT.ISO8859-1',
-    'ca_it.iso88591':                       'ca_IT.ISO8859-1',
-    'ca_it.iso885915':                      'ca_IT.ISO8859-15',
-    'ca_it.iso885915@euro':                 'ca_IT.ISO8859-15',
-    'ca_it.utf8@euro':                      'ca_IT.UTF-8',
-    'ca_it@euro':                           'ca_IT.ISO8859-15',
     'catalan':                              'ca_ES.ISO8859-1',
     'cextend':                              'en_US.ISO8859-1',
-    'cextend.en':                           'en_US.ISO8859-1',
     'chinese-s':                            'zh_CN.eucCN',
     'chinese-t':                            'zh_TW.eucTW',
+    'crh_ua':                               'crh_UA.UTF-8',
     'croatian':                             'hr_HR.ISO8859-2',
     'cs':                                   'cs_CZ.ISO8859-2',
     'cs_cs':                                'cs_CZ.ISO8859-2',
-    'cs_cs.iso88592':                       'cs_CZ.ISO8859-2',
     'cs_cz':                                'cs_CZ.ISO8859-2',
-    'cs_cz.iso88592':                       'cs_CZ.ISO8859-2',
+    'csb_pl':                               'csb_PL.UTF-8',
+    'cv_ru':                                'cv_RU.UTF-8',
     'cy':                                   'cy_GB.ISO8859-1',
     'cy_gb':                                'cy_GB.ISO8859-1',
-    'cy_gb.iso88591':                       'cy_GB.ISO8859-1',
-    'cy_gb.iso885914':                      'cy_GB.ISO8859-14',
-    'cy_gb.iso885915':                      'cy_GB.ISO8859-15',
-    'cy_gb@euro':                           'cy_GB.ISO8859-15',
     'cz':                                   'cs_CZ.ISO8859-2',
     'cz_cz':                                'cs_CZ.ISO8859-2',
     'czech':                                'cs_CZ.ISO8859-2',
     'da':                                   'da_DK.ISO8859-1',
-    'da.iso885915':                         'da_DK.ISO8859-15',
     'da_dk':                                'da_DK.ISO8859-1',
-    'da_dk.88591':                          'da_DK.ISO8859-1',
-    'da_dk.885915':                         'da_DK.ISO8859-15',
-    'da_dk.iso88591':                       'da_DK.ISO8859-1',
-    'da_dk.iso885915':                      'da_DK.ISO8859-15',
-    'da_dk@euro':                           'da_DK.ISO8859-15',
     'danish':                               'da_DK.ISO8859-1',
-    'danish.iso88591':                      'da_DK.ISO8859-1',
     'dansk':                                'da_DK.ISO8859-1',
     'de':                                   'de_DE.ISO8859-1',
-    'de.iso885915':                         'de_DE.ISO8859-15',
     'de_at':                                'de_AT.ISO8859-1',
-    'de_at.iso88591':                       'de_AT.ISO8859-1',
-    'de_at.iso885915':                      'de_AT.ISO8859-15',
-    'de_at.iso885915@euro':                 'de_AT.ISO8859-15',
-    'de_at.utf8@euro':                      'de_AT.UTF-8',
-    'de_at@euro':                           'de_AT.ISO8859-15',
     'de_be':                                'de_BE.ISO8859-1',
-    'de_be.iso88591':                       'de_BE.ISO8859-1',
-    'de_be.iso885915':                      'de_BE.ISO8859-15',
-    'de_be.iso885915@euro':                 'de_BE.ISO8859-15',
-    'de_be.utf8@euro':                      'de_BE.UTF-8',
-    'de_be@euro':                           'de_BE.ISO8859-15',
     'de_ch':                                'de_CH.ISO8859-1',
-    'de_ch.iso88591':                       'de_CH.ISO8859-1',
-    'de_ch.iso885915':                      'de_CH.ISO8859-15',
-    'de_ch@euro':                           'de_CH.ISO8859-15',
     'de_de':                                'de_DE.ISO8859-1',
-    'de_de.88591':                          'de_DE.ISO8859-1',
-    'de_de.885915':                         'de_DE.ISO8859-15',
-    'de_de.885915@euro':                    'de_DE.ISO8859-15',
-    'de_de.iso88591':                       'de_DE.ISO8859-1',
-    'de_de.iso885915':                      'de_DE.ISO8859-15',
-    'de_de.iso885915@euro':                 'de_DE.ISO8859-15',
-    'de_de.utf8@euro':                      'de_DE.UTF-8',
-    'de_de@euro':                           'de_DE.ISO8859-15',
+    'de_li.utf8':                           'de_LI.UTF-8',
     'de_lu':                                'de_LU.ISO8859-1',
-    'de_lu.iso88591':                       'de_LU.ISO8859-1',
-    'de_lu.iso885915':                      'de_LU.ISO8859-15',
-    'de_lu.iso885915@euro':                 'de_LU.ISO8859-15',
-    'de_lu.utf8@euro':                      'de_LU.UTF-8',
-    'de_lu@euro':                           'de_LU.ISO8859-15',
     'deutsch':                              'de_DE.ISO8859-1',
+    'doi_in':                               'doi_IN.UTF-8',
     'dutch':                                'nl_NL.ISO8859-1',
     'dutch.iso88591':                       'nl_BE.ISO8859-1',
+    'dv_mv':                                'dv_MV.UTF-8',
+    'dz_bt':                                'dz_BT.UTF-8',
     'ee':                                   'ee_EE.ISO8859-4',
     'ee_ee':                                'ee_EE.ISO8859-4',
-    'ee_ee.iso88594':                       'ee_EE.ISO8859-4',
     'eesti':                                'et_EE.ISO8859-1',
     'el':                                   'el_GR.ISO8859-7',
+    'el_cy':                                'el_CY.ISO8859-7',
     'el_gr':                                'el_GR.ISO8859-7',
-    'el_gr.iso88597':                       'el_GR.ISO8859-7',
     'el_gr@euro':                           'el_GR.ISO8859-15',
     'en':                                   'en_US.ISO8859-1',
-    'en.iso88591':                          'en_US.ISO8859-1',
+    'en_ag':                                'en_AG.UTF-8',
     'en_au':                                'en_AU.ISO8859-1',
-    'en_au.iso88591':                       'en_AU.ISO8859-1',
     'en_be':                                'en_BE.ISO8859-1',
-    'en_be@euro':                           'en_BE.ISO8859-15',
     'en_bw':                                'en_BW.ISO8859-1',
-    'en_bw.iso88591':                       'en_BW.ISO8859-1',
     'en_ca':                                'en_CA.ISO8859-1',
-    'en_ca.iso88591':                       'en_CA.ISO8859-1',
+    'en_dk':                                'en_DK.ISO8859-1',
+    'en_dl.utf8':                           'en_DL.UTF-8',
     'en_gb':                                'en_GB.ISO8859-1',
-    'en_gb.88591':                          'en_GB.ISO8859-1',
-    'en_gb.iso88591':                       'en_GB.ISO8859-1',
-    'en_gb.iso885915':                      'en_GB.ISO8859-15',
-    'en_gb@euro':                           'en_GB.ISO8859-15',
     'en_hk':                                'en_HK.ISO8859-1',
-    'en_hk.iso88591':                       'en_HK.ISO8859-1',
     'en_ie':                                'en_IE.ISO8859-1',
-    'en_ie.iso88591':                       'en_IE.ISO8859-1',
-    'en_ie.iso885915':                      'en_IE.ISO8859-15',
-    'en_ie.iso885915@euro':                 'en_IE.ISO8859-15',
-    'en_ie.utf8@euro':                      'en_IE.UTF-8',
-    'en_ie@euro':                           'en_IE.ISO8859-15',
     'en_in':                                'en_IN.ISO8859-1',
+    'en_ng':                                'en_NG.UTF-8',
     'en_nz':                                'en_NZ.ISO8859-1',
-    'en_nz.iso88591':                       'en_NZ.ISO8859-1',
     'en_ph':                                'en_PH.ISO8859-1',
-    'en_ph.iso88591':                       'en_PH.ISO8859-1',
     'en_sg':                                'en_SG.ISO8859-1',
-    'en_sg.iso88591':                       'en_SG.ISO8859-1',
     'en_uk':                                'en_GB.ISO8859-1',
     'en_us':                                'en_US.ISO8859-1',
-    'en_us.88591':                          'en_US.ISO8859-1',
-    'en_us.885915':                         'en_US.ISO8859-15',
-    'en_us.iso88591':                       'en_US.ISO8859-1',
-    'en_us.iso885915':                      'en_US.ISO8859-15',
-    'en_us.iso885915@euro':                 'en_US.ISO8859-15',
-    'en_us@euro':                           'en_US.ISO8859-15',
     'en_us@euro@euro':                      'en_US.ISO8859-15',
     'en_za':                                'en_ZA.ISO8859-1',
-    'en_za.88591':                          'en_ZA.ISO8859-1',
-    'en_za.iso88591':                       'en_ZA.ISO8859-1',
-    'en_za.iso885915':                      'en_ZA.ISO8859-15',
-    'en_za@euro':                           'en_ZA.ISO8859-15',
+    'en_zm':                                'en_ZM.UTF-8',
     'en_zw':                                'en_ZW.ISO8859-1',
-    'en_zw.iso88591':                       'en_ZW.ISO8859-1',
+    'en_zw.utf8':                           'en_ZS.UTF-8',
     'eng_gb':                               'en_GB.ISO8859-1',
-    'eng_gb.8859':                          'en_GB.ISO8859-1',
     'english':                              'en_EN.ISO8859-1',
-    'english.iso88591':                     'en_EN.ISO8859-1',
     'english_uk':                           'en_GB.ISO8859-1',
-    'english_uk.8859':                      'en_GB.ISO8859-1',
     'english_united-states':                'en_US.ISO8859-1',
     'english_united-states.437':            'C',
     'english_us':                           'en_US.ISO8859-1',
-    'english_us.8859':                      'en_US.ISO8859-1',
-    'english_us.ascii':                     'en_US.ISO8859-1',
     'eo':                                   'eo_XX.ISO8859-3',
+    'eo.utf8':                              'eo.UTF-8',
     'eo_eo':                                'eo_EO.ISO8859-3',
-    'eo_eo.iso88593':                       'eo_EO.ISO8859-3',
+    'eo_us.utf8':                           'eo_US.UTF-8',
     'eo_xx':                                'eo_XX.ISO8859-3',
-    'eo_xx.iso88593':                       'eo_XX.ISO8859-3',
     'es':                                   'es_ES.ISO8859-1',
     'es_ar':                                'es_AR.ISO8859-1',
-    'es_ar.iso88591':                       'es_AR.ISO8859-1',
     'es_bo':                                'es_BO.ISO8859-1',
-    'es_bo.iso88591':                       'es_BO.ISO8859-1',
     'es_cl':                                'es_CL.ISO8859-1',
-    'es_cl.iso88591':                       'es_CL.ISO8859-1',
     'es_co':                                'es_CO.ISO8859-1',
-    'es_co.iso88591':                       'es_CO.ISO8859-1',
     'es_cr':                                'es_CR.ISO8859-1',
-    'es_cr.iso88591':                       'es_CR.ISO8859-1',
+    'es_cu':                                'es_CU.UTF-8',
     'es_do':                                'es_DO.ISO8859-1',
-    'es_do.iso88591':                       'es_DO.ISO8859-1',
     'es_ec':                                'es_EC.ISO8859-1',
-    'es_ec.iso88591':                       'es_EC.ISO8859-1',
     'es_es':                                'es_ES.ISO8859-1',
-    'es_es.88591':                          'es_ES.ISO8859-1',
-    'es_es.iso88591':                       'es_ES.ISO8859-1',
-    'es_es.iso885915':                      'es_ES.ISO8859-15',
-    'es_es.iso885915@euro':                 'es_ES.ISO8859-15',
-    'es_es.utf8@euro':                      'es_ES.UTF-8',
-    'es_es@euro':                           'es_ES.ISO8859-15',
     'es_gt':                                'es_GT.ISO8859-1',
-    'es_gt.iso88591':                       'es_GT.ISO8859-1',
     'es_hn':                                'es_HN.ISO8859-1',
-    'es_hn.iso88591':                       'es_HN.ISO8859-1',
     'es_mx':                                'es_MX.ISO8859-1',
-    'es_mx.iso88591':                       'es_MX.ISO8859-1',
     'es_ni':                                'es_NI.ISO8859-1',
-    'es_ni.iso88591':                       'es_NI.ISO8859-1',
     'es_pa':                                'es_PA.ISO8859-1',
-    'es_pa.iso88591':                       'es_PA.ISO8859-1',
-    'es_pa.iso885915':                      'es_PA.ISO8859-15',
-    'es_pa@euro':                           'es_PA.ISO8859-15',
     'es_pe':                                'es_PE.ISO8859-1',
-    'es_pe.iso88591':                       'es_PE.ISO8859-1',
-    'es_pe.iso885915':                      'es_PE.ISO8859-15',
-    'es_pe@euro':                           'es_PE.ISO8859-15',
     'es_pr':                                'es_PR.ISO8859-1',
-    'es_pr.iso88591':                       'es_PR.ISO8859-1',
     'es_py':                                'es_PY.ISO8859-1',
-    'es_py.iso88591':                       'es_PY.ISO8859-1',
-    'es_py.iso885915':                      'es_PY.ISO8859-15',
-    'es_py@euro':                           'es_PY.ISO8859-15',
     'es_sv':                                'es_SV.ISO8859-1',
-    'es_sv.iso88591':                       'es_SV.ISO8859-1',
-    'es_sv.iso885915':                      'es_SV.ISO8859-15',
-    'es_sv@euro':                           'es_SV.ISO8859-15',
     'es_us':                                'es_US.ISO8859-1',
-    'es_us.iso88591':                       'es_US.ISO8859-1',
     'es_uy':                                'es_UY.ISO8859-1',
-    'es_uy.iso88591':                       'es_UY.ISO8859-1',
-    'es_uy.iso885915':                      'es_UY.ISO8859-15',
-    'es_uy@euro':                           'es_UY.ISO8859-15',
     'es_ve':                                'es_VE.ISO8859-1',
-    'es_ve.iso88591':                       'es_VE.ISO8859-1',
-    'es_ve.iso885915':                      'es_VE.ISO8859-15',
-    'es_ve@euro':                           'es_VE.ISO8859-15',
     'estonian':                             'et_EE.ISO8859-1',
     'et':                                   'et_EE.ISO8859-15',
     'et_ee':                                'et_EE.ISO8859-15',
-    'et_ee.iso88591':                       'et_EE.ISO8859-1',
-    'et_ee.iso885913':                      'et_EE.ISO8859-13',
-    'et_ee.iso885915':                      'et_EE.ISO8859-15',
-    'et_ee.iso88594':                       'et_EE.ISO8859-4',
-    'et_ee@euro':                           'et_EE.ISO8859-15',
     'eu':                                   'eu_ES.ISO8859-1',
     'eu_es':                                'eu_ES.ISO8859-1',
-    'eu_es.iso88591':                       'eu_ES.ISO8859-1',
-    'eu_es.iso885915':                      'eu_ES.ISO8859-15',
-    'eu_es.iso885915@euro':                 'eu_ES.ISO8859-15',
-    'eu_es.utf8@euro':                      'eu_ES.UTF-8',
-    'eu_es@euro':                           'eu_ES.ISO8859-15',
+    'eu_fr':                                'eu_FR.ISO8859-1',
     'fa':                                   'fa_IR.UTF-8',
     'fa_ir':                                'fa_IR.UTF-8',
     'fa_ir.isiri3342':                      'fa_IR.ISIRI-3342',
+    'ff_sn':                                'ff_SN.UTF-8',
     'fi':                                   'fi_FI.ISO8859-15',
-    'fi.iso885915':                         'fi_FI.ISO8859-15',
     'fi_fi':                                'fi_FI.ISO8859-15',
-    'fi_fi.88591':                          'fi_FI.ISO8859-1',
-    'fi_fi.iso88591':                       'fi_FI.ISO8859-1',
-    'fi_fi.iso885915':                      'fi_FI.ISO8859-15',
-    'fi_fi.iso885915@euro':                 'fi_FI.ISO8859-15',
-    'fi_fi.utf8@euro':                      'fi_FI.UTF-8',
-    'fi_fi@euro':                           'fi_FI.ISO8859-15',
+    'fil_ph':                               'fil_PH.UTF-8',
     'finnish':                              'fi_FI.ISO8859-1',
-    'finnish.iso88591':                     'fi_FI.ISO8859-1',
     'fo':                                   'fo_FO.ISO8859-1',
     'fo_fo':                                'fo_FO.ISO8859-1',
-    'fo_fo.iso88591':                       'fo_FO.ISO8859-1',
-    'fo_fo.iso885915':                      'fo_FO.ISO8859-15',
-    'fo_fo@euro':                           'fo_FO.ISO8859-15',
     'fr':                                   'fr_FR.ISO8859-1',
-    'fr.iso885915':                         'fr_FR.ISO8859-15',
     'fr_be':                                'fr_BE.ISO8859-1',
-    'fr_be.88591':                          'fr_BE.ISO8859-1',
-    'fr_be.iso88591':                       'fr_BE.ISO8859-1',
-    'fr_be.iso885915':                      'fr_BE.ISO8859-15',
-    'fr_be.iso885915@euro':                 'fr_BE.ISO8859-15',
-    'fr_be.utf8@euro':                      'fr_BE.UTF-8',
-    'fr_be@euro':                           'fr_BE.ISO8859-15',
     'fr_ca':                                'fr_CA.ISO8859-1',
-    'fr_ca.88591':                          'fr_CA.ISO8859-1',
-    'fr_ca.iso88591':                       'fr_CA.ISO8859-1',
-    'fr_ca.iso885915':                      'fr_CA.ISO8859-15',
-    'fr_ca@euro':                           'fr_CA.ISO8859-15',
     'fr_ch':                                'fr_CH.ISO8859-1',
-    'fr_ch.88591':                          'fr_CH.ISO8859-1',
-    'fr_ch.iso88591':                       'fr_CH.ISO8859-1',
-    'fr_ch.iso885915':                      'fr_CH.ISO8859-15',
-    'fr_ch@euro':                           'fr_CH.ISO8859-15',
     'fr_fr':                                'fr_FR.ISO8859-1',
-    'fr_fr.88591':                          'fr_FR.ISO8859-1',
-    'fr_fr.iso88591':                       'fr_FR.ISO8859-1',
-    'fr_fr.iso885915':                      'fr_FR.ISO8859-15',
-    'fr_fr.iso885915@euro':                 'fr_FR.ISO8859-15',
-    'fr_fr.utf8@euro':                      'fr_FR.UTF-8',
-    'fr_fr@euro':                           'fr_FR.ISO8859-15',
     'fr_lu':                                'fr_LU.ISO8859-1',
-    'fr_lu.88591':                          'fr_LU.ISO8859-1',
-    'fr_lu.iso88591':                       'fr_LU.ISO8859-1',
-    'fr_lu.iso885915':                      'fr_LU.ISO8859-15',
-    'fr_lu.iso885915@euro':                 'fr_LU.ISO8859-15',
-    'fr_lu.utf8@euro':                      'fr_LU.UTF-8',
-    'fr_lu@euro':                           'fr_LU.ISO8859-15',
     'fran\xe7ais':                          'fr_FR.ISO8859-1',
     'fre_fr':                               'fr_FR.ISO8859-1',
-    'fre_fr.8859':                          'fr_FR.ISO8859-1',
     'french':                               'fr_FR.ISO8859-1',
     'french.iso88591':                      'fr_CH.ISO8859-1',
     'french_france':                        'fr_FR.ISO8859-1',
-    'french_france.8859':                   'fr_FR.ISO8859-1',
+    'fur_it':                               'fur_IT.UTF-8',
+    'fy_de':                                'fy_DE.UTF-8',
+    'fy_nl':                                'fy_NL.UTF-8',
     'ga':                                   'ga_IE.ISO8859-1',
     'ga_ie':                                'ga_IE.ISO8859-1',
-    'ga_ie.iso88591':                       'ga_IE.ISO8859-1',
-    'ga_ie.iso885914':                      'ga_IE.ISO8859-14',
-    'ga_ie.iso885915':                      'ga_IE.ISO8859-15',
-    'ga_ie.iso885915@euro':                 'ga_IE.ISO8859-15',
-    'ga_ie.utf8@euro':                      'ga_IE.UTF-8',
-    'ga_ie@euro':                           'ga_IE.ISO8859-15',
     'galego':                               'gl_ES.ISO8859-1',
     'galician':                             'gl_ES.ISO8859-1',
     'gd':                                   'gd_GB.ISO8859-1',
     'gd_gb':                                'gd_GB.ISO8859-1',
-    'gd_gb.iso88591':                       'gd_GB.ISO8859-1',
-    'gd_gb.iso885914':                      'gd_GB.ISO8859-14',
-    'gd_gb.iso885915':                      'gd_GB.ISO8859-15',
-    'gd_gb@euro':                           'gd_GB.ISO8859-15',
     'ger_de':                               'de_DE.ISO8859-1',
-    'ger_de.8859':                          'de_DE.ISO8859-1',
     'german':                               'de_DE.ISO8859-1',
     'german.iso88591':                      'de_CH.ISO8859-1',
     'german_germany':                       'de_DE.ISO8859-1',
-    'german_germany.8859':                  'de_DE.ISO8859-1',
+    'gez_er':                               'gez_ER.UTF-8',
+    'gez_et':                               'gez_ET.UTF-8',
     'gl':                                   'gl_ES.ISO8859-1',
     'gl_es':                                'gl_ES.ISO8859-1',
-    'gl_es.iso88591':                       'gl_ES.ISO8859-1',
-    'gl_es.iso885915':                      'gl_ES.ISO8859-15',
-    'gl_es.iso885915@euro':                 'gl_ES.ISO8859-15',
-    'gl_es.utf8@euro':                      'gl_ES.UTF-8',
-    'gl_es@euro':                           'gl_ES.ISO8859-15',
     'greek':                                'el_GR.ISO8859-7',
-    'greek.iso88597':                       'el_GR.ISO8859-7',
     'gu_in':                                'gu_IN.UTF-8',
     'gv':                                   'gv_GB.ISO8859-1',
     'gv_gb':                                'gv_GB.ISO8859-1',
-    'gv_gb.iso88591':                       'gv_GB.ISO8859-1',
-    'gv_gb.iso885914':                      'gv_GB.ISO8859-14',
-    'gv_gb.iso885915':                      'gv_GB.ISO8859-15',
-    'gv_gb@euro':                           'gv_GB.ISO8859-15',
+    'ha_ng':                                'ha_NG.UTF-8',
     'he':                                   'he_IL.ISO8859-8',
     'he_il':                                'he_IL.ISO8859-8',
-    'he_il.cp1255':                         'he_IL.CP1255',
-    'he_il.iso88598':                       'he_IL.ISO8859-8',
-    'he_il.microsoftcp1255':                'he_IL.CP1255',
     'hebrew':                               'he_IL.ISO8859-8',
-    'hebrew.iso88598':                      'he_IL.ISO8859-8',
     'hi':                                   'hi_IN.ISCII-DEV',
     'hi_in':                                'hi_IN.ISCII-DEV',
     'hi_in.isciidev':                       'hi_IN.ISCII-DEV',
@@ -1234,23 +1055,25 @@
     'hne_in':                               'hne_IN.UTF-8',
     'hr':                                   'hr_HR.ISO8859-2',
     'hr_hr':                                'hr_HR.ISO8859-2',
-    'hr_hr.iso88592':                       'hr_HR.ISO8859-2',
     'hrvatski':                             'hr_HR.ISO8859-2',
+    'hsb_de':                               'hsb_DE.ISO8859-2',
+    'ht_ht':                                'ht_HT.UTF-8',
     'hu':                                   'hu_HU.ISO8859-2',
     'hu_hu':                                'hu_HU.ISO8859-2',
-    'hu_hu.iso88592':                       'hu_HU.ISO8859-2',
     'hungarian':                            'hu_HU.ISO8859-2',
+    'hy_am':                                'hy_AM.UTF-8',
+    'hy_am.armscii8':                       'hy_AM.ARMSCII_8',
+    'ia':                                   'ia.UTF-8',
+    'ia_fr':                                'ia_FR.UTF-8',
     'icelandic':                            'is_IS.ISO8859-1',
-    'icelandic.iso88591':                   'is_IS.ISO8859-1',
     'id':                                   'id_ID.ISO8859-1',
     'id_id':                                'id_ID.ISO8859-1',
+    'ig_ng':                                'ig_NG.UTF-8',
+    'ik_ca':                                'ik_CA.UTF-8',
     'in':                                   'id_ID.ISO8859-1',
     'in_id':                                'id_ID.ISO8859-1',
     'is':                                   'is_IS.ISO8859-1',
     'is_is':                                'is_IS.ISO8859-1',
-    'is_is.iso88591':                       'is_IS.ISO8859-1',
-    'is_is.iso885915':                      'is_IS.ISO8859-15',
-    'is_is@euro':                           'is_IS.ISO8859-15',
     'iso-8859-1':                           'en_US.ISO8859-1',
     'iso-8859-15':                          'en_US.ISO8859-15',
     'iso8859-1':                            'en_US.ISO8859-1',
@@ -1258,77 +1081,55 @@
     'iso_8859_1':                           'en_US.ISO8859-1',
     'iso_8859_15':                          'en_US.ISO8859-15',
     'it':                                   'it_IT.ISO8859-1',
-    'it.iso885915':                         'it_IT.ISO8859-15',
     'it_ch':                                'it_CH.ISO8859-1',
-    'it_ch.iso88591':                       'it_CH.ISO8859-1',
-    'it_ch.iso885915':                      'it_CH.ISO8859-15',
-    'it_ch@euro':                           'it_CH.ISO8859-15',
     'it_it':                                'it_IT.ISO8859-1',
-    'it_it.88591':                          'it_IT.ISO8859-1',
-    'it_it.iso88591':                       'it_IT.ISO8859-1',
-    'it_it.iso885915':                      'it_IT.ISO8859-15',
-    'it_it.iso885915@euro':                 'it_IT.ISO8859-15',
-    'it_it.utf8@euro':                      'it_IT.UTF-8',
-    'it_it@euro':                           'it_IT.ISO8859-15',
     'italian':                              'it_IT.ISO8859-1',
-    'italian.iso88591':                     'it_IT.ISO8859-1',
     'iu':                                   'iu_CA.NUNACOM-8',
     'iu_ca':                                'iu_CA.NUNACOM-8',
     'iu_ca.nunacom8':                       'iu_CA.NUNACOM-8',
     'iw':                                   'he_IL.ISO8859-8',
     'iw_il':                                'he_IL.ISO8859-8',
-    'iw_il.iso88598':                       'he_IL.ISO8859-8',
+    'iw_il.utf8':                           'iw_IL.UTF-8',
     'ja':                                   'ja_JP.eucJP',
-    'ja.jis':                               'ja_JP.JIS7',
-    'ja.sjis':                              'ja_JP.SJIS',
     'ja_jp':                                'ja_JP.eucJP',
-    'ja_jp.ajec':                           'ja_JP.eucJP',
     'ja_jp.euc':                            'ja_JP.eucJP',
-    'ja_jp.eucjp':                          'ja_JP.eucJP',
-    'ja_jp.iso-2022-jp':                    'ja_JP.JIS7',
-    'ja_jp.iso2022jp':                      'ja_JP.JIS7',
-    'ja_jp.jis':                            'ja_JP.JIS7',
-    'ja_jp.jis7':                           'ja_JP.JIS7',
     'ja_jp.mscode':                         'ja_JP.SJIS',
     'ja_jp.pck':                            'ja_JP.SJIS',
-    'ja_jp.sjis':                           'ja_JP.SJIS',
-    'ja_jp.ujis':                           'ja_JP.eucJP',
     'japan':                                'ja_JP.eucJP',
     'japanese':                             'ja_JP.eucJP',
     'japanese-euc':                         'ja_JP.eucJP',
     'japanese.euc':                         'ja_JP.eucJP',
-    'japanese.sjis':                        'ja_JP.SJIS',
     'jp_jp':                                'ja_JP.eucJP',
     'ka':                                   'ka_GE.GEORGIAN-ACADEMY',
     'ka_ge':                                'ka_GE.GEORGIAN-ACADEMY',
     'ka_ge.georgianacademy':                'ka_GE.GEORGIAN-ACADEMY',
     'ka_ge.georgianps':                     'ka_GE.GEORGIAN-PS',
     'ka_ge.georgianrs':                     'ka_GE.GEORGIAN-ACADEMY',
+    'kk_kz':                                'kk_KZ.RK1048',
     'kl':                                   'kl_GL.ISO8859-1',
     'kl_gl':                                'kl_GL.ISO8859-1',
-    'kl_gl.iso88591':                       'kl_GL.ISO8859-1',
-    'kl_gl.iso885915':                      'kl_GL.ISO8859-15',
-    'kl_gl@euro':                           'kl_GL.ISO8859-15',
     'km_kh':                                'km_KH.UTF-8',
     'kn':                                   'kn_IN.UTF-8',
     'kn_in':                                'kn_IN.UTF-8',
     'ko':                                   'ko_KR.eucKR',
     'ko_kr':                                'ko_KR.eucKR',
     'ko_kr.euc':                            'ko_KR.eucKR',
-    'ko_kr.euckr':                          'ko_KR.eucKR',
+    'kok_in':                               'kok_IN.UTF-8',
     'korean':                               'ko_KR.eucKR',
     'korean.euc':                           'ko_KR.eucKR',
     'ks':                                   'ks_IN.UTF-8',
     'ks_in':                                'ks_IN.UTF-8',
-    'ks_in@devanagari':                     'ks_IN.UTF-8@devanagari',
+    'ks_in@devanagari.utf8':                'ks_IN.UTF-8@devanagari',
+    'ku_tr':                                'ku_TR.ISO8859-9',
     'kw':                                   'kw_GB.ISO8859-1',
     'kw_gb':                                'kw_GB.ISO8859-1',
-    'kw_gb.iso88591':                       'kw_GB.ISO8859-1',
-    'kw_gb.iso885914':                      'kw_GB.ISO8859-14',
-    'kw_gb.iso885915':                      'kw_GB.ISO8859-15',
-    'kw_gb@euro':                           'kw_GB.ISO8859-15',
     'ky':                                   'ky_KG.UTF-8',
     'ky_kg':                                'ky_KG.UTF-8',
+    'lb_lu':                                'lb_LU.UTF-8',
+    'lg_ug':                                'lg_UG.ISO8859-10',
+    'li_be':                                'li_BE.UTF-8',
+    'li_nl':                                'li_NL.UTF-8',
+    'lij_it':                               'lij_IT.UTF-8',
     'lithuanian':                           'lt_LT.ISO8859-13',
     'lo':                                   'lo_LA.MULELAO-1',
     'lo_la':                                'lo_LA.MULELAO-1',
@@ -1337,157 +1138,102 @@
     'lo_la.mulelao1':                       'lo_LA.MULELAO-1',
     'lt':                                   'lt_LT.ISO8859-13',
     'lt_lt':                                'lt_LT.ISO8859-13',
-    'lt_lt.iso885913':                      'lt_LT.ISO8859-13',
-    'lt_lt.iso88594':                       'lt_LT.ISO8859-4',
     'lv':                                   'lv_LV.ISO8859-13',
     'lv_lv':                                'lv_LV.ISO8859-13',
-    'lv_lv.iso885913':                      'lv_LV.ISO8859-13',
-    'lv_lv.iso88594':                       'lv_LV.ISO8859-4',
+    'mag_in':                               'mag_IN.UTF-8',
     'mai':                                  'mai_IN.UTF-8',
     'mai_in':                               'mai_IN.UTF-8',
+    'mg_mg':                                'mg_MG.ISO8859-15',
+    'mhr_ru':                               'mhr_RU.UTF-8',
     'mi':                                   'mi_NZ.ISO8859-1',
     'mi_nz':                                'mi_NZ.ISO8859-1',
-    'mi_nz.iso88591':                       'mi_NZ.ISO8859-1',
     'mk':                                   'mk_MK.ISO8859-5',
     'mk_mk':                                'mk_MK.ISO8859-5',
-    'mk_mk.cp1251':                         'mk_MK.CP1251',
-    'mk_mk.iso88595':                       'mk_MK.ISO8859-5',
-    'mk_mk.microsoftcp1251':                'mk_MK.CP1251',
     'ml':                                   'ml_IN.UTF-8',
     'ml_in':                                'ml_IN.UTF-8',
+    'mn_mn':                                'mn_MN.UTF-8',
+    'mni_in':                               'mni_IN.UTF-8',
     'mr':                                   'mr_IN.UTF-8',
     'mr_in':                                'mr_IN.UTF-8',
     'ms':                                   'ms_MY.ISO8859-1',
     'ms_my':                                'ms_MY.ISO8859-1',
-    'ms_my.iso88591':                       'ms_MY.ISO8859-1',
     'mt':                                   'mt_MT.ISO8859-3',
     'mt_mt':                                'mt_MT.ISO8859-3',
-    'mt_mt.iso88593':                       'mt_MT.ISO8859-3',
+    'my_mm':                                'my_MM.UTF-8',
+    'nan_tw@latin':                         'nan_TW.UTF-8@latin',
     'nb':                                   'nb_NO.ISO8859-1',
     'nb_no':                                'nb_NO.ISO8859-1',
-    'nb_no.88591':                          'nb_NO.ISO8859-1',
-    'nb_no.iso88591':                       'nb_NO.ISO8859-1',
-    'nb_no.iso885915':                      'nb_NO.ISO8859-15',
-    'nb_no@euro':                           'nb_NO.ISO8859-15',
+    'nds_de':                               'nds_DE.UTF-8',
+    'nds_nl':                               'nds_NL.UTF-8',
     'ne_np':                                'ne_NP.UTF-8',
+    'nhn_mx':                               'nhn_MX.UTF-8',
+    'niu_nu':                               'niu_NU.UTF-8',
+    'niu_nz':                               'niu_NZ.UTF-8',
     'nl':                                   'nl_NL.ISO8859-1',
-    'nl.iso885915':                         'nl_NL.ISO8859-15',
+    'nl_aw':                                'nl_AW.UTF-8',
     'nl_be':                                'nl_BE.ISO8859-1',
-    'nl_be.88591':                          'nl_BE.ISO8859-1',
-    'nl_be.iso88591':                       'nl_BE.ISO8859-1',
-    'nl_be.iso885915':                      'nl_BE.ISO8859-15',
-    'nl_be.iso885915@euro':                 'nl_BE.ISO8859-15',
-    'nl_be.utf8@euro':                      'nl_BE.UTF-8',
-    'nl_be@euro':                           'nl_BE.ISO8859-15',
     'nl_nl':                                'nl_NL.ISO8859-1',
-    'nl_nl.88591':                          'nl_NL.ISO8859-1',
-    'nl_nl.iso88591':                       'nl_NL.ISO8859-1',
-    'nl_nl.iso885915':                      'nl_NL.ISO8859-15',
-    'nl_nl.iso885915@euro':                 'nl_NL.ISO8859-15',
-    'nl_nl.utf8@euro':                      'nl_NL.UTF-8',
-    'nl_nl@euro':                           'nl_NL.ISO8859-15',
     'nn':                                   'nn_NO.ISO8859-1',
     'nn_no':                                'nn_NO.ISO8859-1',
-    'nn_no.88591':                          'nn_NO.ISO8859-1',
-    'nn_no.iso88591':                       'nn_NO.ISO8859-1',
-    'nn_no.iso885915':                      'nn_NO.ISO8859-15',
-    'nn_no@euro':                           'nn_NO.ISO8859-15',
     'no':                                   'no_NO.ISO8859-1',
     'no@nynorsk':                           'ny_NO.ISO8859-1',
     'no_no':                                'no_NO.ISO8859-1',
-    'no_no.88591':                          'no_NO.ISO8859-1',
-    'no_no.iso88591':                       'no_NO.ISO8859-1',
-    'no_no.iso885915':                      'no_NO.ISO8859-15',
     'no_no.iso88591@bokmal':                'no_NO.ISO8859-1',
     'no_no.iso88591@nynorsk':               'no_NO.ISO8859-1',
-    'no_no@euro':                           'no_NO.ISO8859-15',
     'norwegian':                            'no_NO.ISO8859-1',
-    'norwegian.iso88591':                   'no_NO.ISO8859-1',
     'nr':                                   'nr_ZA.ISO8859-1',
     'nr_za':                                'nr_ZA.ISO8859-1',
-    'nr_za.iso88591':                       'nr_ZA.ISO8859-1',
     'nso':                                  'nso_ZA.ISO8859-15',
     'nso_za':                               'nso_ZA.ISO8859-15',
-    'nso_za.iso885915':                     'nso_ZA.ISO8859-15',
     'ny':                                   'ny_NO.ISO8859-1',
     'ny_no':                                'ny_NO.ISO8859-1',
-    'ny_no.88591':                          'ny_NO.ISO8859-1',
-    'ny_no.iso88591':                       'ny_NO.ISO8859-1',
-    'ny_no.iso885915':                      'ny_NO.ISO8859-15',
-    'ny_no@euro':                           'ny_NO.ISO8859-15',
     'nynorsk':                              'nn_NO.ISO8859-1',
     'oc':                                   'oc_FR.ISO8859-1',
     'oc_fr':                                'oc_FR.ISO8859-1',
-    'oc_fr.iso88591':                       'oc_FR.ISO8859-1',
-    'oc_fr.iso885915':                      'oc_FR.ISO8859-15',
-    'oc_fr@euro':                           'oc_FR.ISO8859-15',
+    'om_et':                                'om_ET.UTF-8',
+    'om_ke':                                'om_KE.ISO8859-1',
     'or':                                   'or_IN.UTF-8',
     'or_in':                                'or_IN.UTF-8',
+    'os_ru':                                'os_RU.UTF-8',
     'pa':                                   'pa_IN.UTF-8',
     'pa_in':                                'pa_IN.UTF-8',
+    'pa_pk':                                'pa_PK.UTF-8',
+    'pap_an':                               'pap_AN.UTF-8',
     'pd':                                   'pd_US.ISO8859-1',
     'pd_de':                                'pd_DE.ISO8859-1',
-    'pd_de.iso88591':                       'pd_DE.ISO8859-1',
-    'pd_de.iso885915':                      'pd_DE.ISO8859-15',
-    'pd_de@euro':                           'pd_DE.ISO8859-15',
     'pd_us':                                'pd_US.ISO8859-1',
-    'pd_us.iso88591':                       'pd_US.ISO8859-1',
-    'pd_us.iso885915':                      'pd_US.ISO8859-15',
-    'pd_us@euro':                           'pd_US.ISO8859-15',
     'ph':                                   'ph_PH.ISO8859-1',
     'ph_ph':                                'ph_PH.ISO8859-1',
-    'ph_ph.iso88591':                       'ph_PH.ISO8859-1',
     'pl':                                   'pl_PL.ISO8859-2',
     'pl_pl':                                'pl_PL.ISO8859-2',
-    'pl_pl.iso88592':                       'pl_PL.ISO8859-2',
     'polish':                               'pl_PL.ISO8859-2',
     'portuguese':                           'pt_PT.ISO8859-1',
-    'portuguese.iso88591':                  'pt_PT.ISO8859-1',
     'portuguese_brazil':                    'pt_BR.ISO8859-1',
-    'portuguese_brazil.8859':               'pt_BR.ISO8859-1',
     'posix':                                'C',
     'posix-utf2':                           'C',
     'pp':                                   'pp_AN.ISO8859-1',
     'pp_an':                                'pp_AN.ISO8859-1',
-    'pp_an.iso88591':                       'pp_AN.ISO8859-1',
+    'ps_af':                                'ps_AF.UTF-8',
     'pt':                                   'pt_PT.ISO8859-1',
-    'pt.iso885915':                         'pt_PT.ISO8859-15',
     'pt_br':                                'pt_BR.ISO8859-1',
-    'pt_br.88591':                          'pt_BR.ISO8859-1',
-    'pt_br.iso88591':                       'pt_BR.ISO8859-1',
-    'pt_br.iso885915':                      'pt_BR.ISO8859-15',
-    'pt_br@euro':                           'pt_BR.ISO8859-15',
     'pt_pt':                                'pt_PT.ISO8859-1',
-    'pt_pt.88591':                          'pt_PT.ISO8859-1',
-    'pt_pt.iso88591':                       'pt_PT.ISO8859-1',
-    'pt_pt.iso885915':                      'pt_PT.ISO8859-15',
-    'pt_pt.iso885915@euro':                 'pt_PT.ISO8859-15',
-    'pt_pt.utf8@euro':                      'pt_PT.UTF-8',
-    'pt_pt@euro':                           'pt_PT.ISO8859-15',
     'ro':                                   'ro_RO.ISO8859-2',
     'ro_ro':                                'ro_RO.ISO8859-2',
-    'ro_ro.iso88592':                       'ro_RO.ISO8859-2',
     'romanian':                             'ro_RO.ISO8859-2',
     'ru':                                   'ru_RU.UTF-8',
-    'ru.koi8r':                             'ru_RU.KOI8-R',
     'ru_ru':                                'ru_RU.UTF-8',
-    'ru_ru.cp1251':                         'ru_RU.CP1251',
-    'ru_ru.iso88595':                       'ru_RU.ISO8859-5',
-    'ru_ru.koi8r':                          'ru_RU.KOI8-R',
-    'ru_ru.microsoftcp1251':                'ru_RU.CP1251',
     'ru_ua':                                'ru_UA.KOI8-U',
-    'ru_ua.cp1251':                         'ru_UA.CP1251',
-    'ru_ua.koi8u':                          'ru_UA.KOI8-U',
-    'ru_ua.microsoftcp1251':                'ru_UA.CP1251',
     'rumanian':                             'ro_RO.ISO8859-2',
     'russian':                              'ru_RU.ISO8859-5',
     'rw':                                   'rw_RW.ISO8859-1',
     'rw_rw':                                'rw_RW.ISO8859-1',
-    'rw_rw.iso88591':                       'rw_RW.ISO8859-1',
+    'sa_in':                                'sa_IN.UTF-8',
+    'sat_in':                               'sat_IN.UTF-8',
+    'sc_it':                                'sc_IT.UTF-8',
     'sd':                                   'sd_IN.UTF-8',
-    'sd@devanagari':                        'sd_IN.UTF-8@devanagari',
     'sd_in':                                'sd_IN.UTF-8',
-    'sd_in@devanagari':                     'sd_IN.UTF-8@devanagari',
+    'sd_in@devanagari.utf8':                'sd_IN.UTF-8@devanagari',
+    'sd_pk':                                'sd_PK.UTF-8',
     'se_no':                                'se_NO.UTF-8',
     'serbocroatian':                        'sr_RS.UTF-8@latin',
     'sh':                                   'sr_RS.UTF-8@latin',
@@ -1496,42 +1242,38 @@
     'sh_hr.iso88592':                       'hr_HR.ISO8859-2',
     'sh_sp':                                'sr_CS.ISO8859-2',
     'sh_yu':                                'sr_RS.UTF-8@latin',
+    'shs_ca':                               'shs_CA.UTF-8',
     'si':                                   'si_LK.UTF-8',
     'si_lk':                                'si_LK.UTF-8',
+    'sid_et':                               'sid_ET.UTF-8',
     'sinhala':                              'si_LK.UTF-8',
     'sk':                                   'sk_SK.ISO8859-2',
     'sk_sk':                                'sk_SK.ISO8859-2',
-    'sk_sk.iso88592':                       'sk_SK.ISO8859-2',
     'sl':                                   'sl_SI.ISO8859-2',
     'sl_cs':                                'sl_CS.ISO8859-2',
     'sl_si':                                'sl_SI.ISO8859-2',
-    'sl_si.iso88592':                       'sl_SI.ISO8859-2',
     'slovak':                               'sk_SK.ISO8859-2',
     'slovene':                              'sl_SI.ISO8859-2',
     'slovenian':                            'sl_SI.ISO8859-2',
+    'so_dj':                                'so_DJ.ISO8859-1',
+    'so_et':                                'so_ET.UTF-8',
+    'so_ke':                                'so_KE.ISO8859-1',
+    'so_so':                                'so_SO.ISO8859-1',
     'sp':                                   'sr_CS.ISO8859-5',
     'sp_yu':                                'sr_CS.ISO8859-5',
     'spanish':                              'es_ES.ISO8859-1',
-    'spanish.iso88591':                     'es_ES.ISO8859-1',
     'spanish_spain':                        'es_ES.ISO8859-1',
-    'spanish_spain.8859':                   'es_ES.ISO8859-1',
     'sq':                                   'sq_AL.ISO8859-2',
     'sq_al':                                'sq_AL.ISO8859-2',
-    'sq_al.iso88592':                       'sq_AL.ISO8859-2',
+    'sq_mk':                                'sq_MK.UTF-8',
     'sr':                                   'sr_RS.UTF-8',
     'sr@cyrillic':                          'sr_RS.UTF-8',
-    'sr@latin':                             'sr_RS.UTF-8@latin',
     'sr@latn':                              'sr_CS.UTF-8@latin',
     'sr_cs':                                'sr_CS.UTF-8',
-    'sr_cs.iso88592':                       'sr_CS.ISO8859-2',
     'sr_cs.iso88592@latn':                  'sr_CS.ISO8859-2',
-    'sr_cs.iso88595':                       'sr_CS.ISO8859-5',
-    'sr_cs.utf8@latn':                      'sr_CS.UTF-8@latin',
     'sr_cs@latn':                           'sr_CS.UTF-8@latin',
     'sr_me':                                'sr_ME.UTF-8',
     'sr_rs':                                'sr_RS.UTF-8',
-    'sr_rs.utf8@latn':                      'sr_RS.UTF-8@latin',
-    'sr_rs@latin':                          'sr_RS.UTF-8@latin',
     'sr_rs@latn':                           'sr_RS.UTF-8@latin',
     'sr_sp':                                'sr_CS.ISO8859-2',
     'sr_yu':                                'sr_RS.UTF-8@latin',
@@ -1540,79 +1282,64 @@
     'sr_yu.iso88595':                       'sr_CS.ISO8859-5',
     'sr_yu.iso88595@cyrillic':              'sr_CS.ISO8859-5',
     'sr_yu.microsoftcp1251@cyrillic':       'sr_CS.CP1251',
+    'sr_yu.utf8':                           'sr_RS.UTF-8',
     'sr_yu.utf8@cyrillic':                  'sr_RS.UTF-8',
     'sr_yu@cyrillic':                       'sr_RS.UTF-8',
     'ss':                                   'ss_ZA.ISO8859-1',
     'ss_za':                                'ss_ZA.ISO8859-1',
-    'ss_za.iso88591':                       'ss_ZA.ISO8859-1',
     'st':                                   'st_ZA.ISO8859-1',
     'st_za':                                'st_ZA.ISO8859-1',
-    'st_za.iso88591':                       'st_ZA.ISO8859-1',
     'sv':                                   'sv_SE.ISO8859-1',
-    'sv.iso885915':                         'sv_SE.ISO8859-15',
     'sv_fi':                                'sv_FI.ISO8859-1',
-    'sv_fi.iso88591':                       'sv_FI.ISO8859-1',
-    'sv_fi.iso885915':                      'sv_FI.ISO8859-15',
-    'sv_fi.iso885915@euro':                 'sv_FI.ISO8859-15',
-    'sv_fi.utf8@euro':                      'sv_FI.UTF-8',
-    'sv_fi@euro':                           'sv_FI.ISO8859-15',
     'sv_se':                                'sv_SE.ISO8859-1',
-    'sv_se.88591':                          'sv_SE.ISO8859-1',
-    'sv_se.iso88591':                       'sv_SE.ISO8859-1',
-    'sv_se.iso885915':                      'sv_SE.ISO8859-15',
-    'sv_se@euro':                           'sv_SE.ISO8859-15',
+    'sw_ke':                                'sw_KE.UTF-8',
+    'sw_tz':                                'sw_TZ.UTF-8',
     'swedish':                              'sv_SE.ISO8859-1',
-    'swedish.iso88591':                     'sv_SE.ISO8859-1',
+    'szl_pl':                               'szl_PL.UTF-8',
     'ta':                                   'ta_IN.TSCII-0',
     'ta_in':                                'ta_IN.TSCII-0',
     'ta_in.tscii':                          'ta_IN.TSCII-0',
     'ta_in.tscii0':                         'ta_IN.TSCII-0',
+    'ta_lk':                                'ta_LK.UTF-8',
     'te':                                   'te_IN.UTF-8',
+    'te_in':                                'te_IN.UTF-8',
     'tg':                                   'tg_TJ.KOI8-C',
     'tg_tj':                                'tg_TJ.KOI8-C',
-    'tg_tj.koi8c':                          'tg_TJ.KOI8-C',
     'th':                                   'th_TH.ISO8859-11',
     'th_th':                                'th_TH.ISO8859-11',
-    'th_th.iso885911':                      'th_TH.ISO8859-11',
     'th_th.tactis':                         'th_TH.TIS620',
     'th_th.tis620':                         'th_TH.TIS620',
     'thai':                                 'th_TH.ISO8859-11',
+    'ti_er':                                'ti_ER.UTF-8',
+    'ti_et':                                'ti_ET.UTF-8',
+    'tig_er':                               'tig_ER.UTF-8',
+    'tk_tm':                                'tk_TM.UTF-8',
     'tl':                                   'tl_PH.ISO8859-1',
     'tl_ph':                                'tl_PH.ISO8859-1',
-    'tl_ph.iso88591':                       'tl_PH.ISO8859-1',
     'tn':                                   'tn_ZA.ISO8859-15',
     'tn_za':                                'tn_ZA.ISO8859-15',
-    'tn_za.iso885915':                      'tn_ZA.ISO8859-15',
     'tr':                                   'tr_TR.ISO8859-9',
+    'tr_cy':                                'tr_CY.ISO8859-9',
     'tr_tr':                                'tr_TR.ISO8859-9',
-    'tr_tr.iso88599':                       'tr_TR.ISO8859-9',
     'ts':                                   'ts_ZA.ISO8859-1',
     'ts_za':                                'ts_ZA.ISO8859-1',
-    'ts_za.iso88591':                       'ts_ZA.ISO8859-1',
     'tt':                                   'tt_RU.TATAR-CYR',
     'tt_ru':                                'tt_RU.TATAR-CYR',
-    'tt_ru.koi8c':                          'tt_RU.KOI8-C',
     'tt_ru.tatarcyr':                       'tt_RU.TATAR-CYR',
+    'tt_ru@iqtelif':                        'tt_RU.UTF-8@iqtelif',
     'turkish':                              'tr_TR.ISO8859-9',
-    'turkish.iso88599':                     'tr_TR.ISO8859-9',
+    'ug_cn':                                'ug_CN.UTF-8',
     'uk':                                   'uk_UA.KOI8-U',
     'uk_ua':                                'uk_UA.KOI8-U',
-    'uk_ua.cp1251':                         'uk_UA.CP1251',
-    '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',
     'universal.utf8@ucs4':                  'en_US.UTF-8',
+    'unm_us':                               'unm_US.UTF-8',
     'ur':                                   'ur_PK.CP1256',
     'ur_in':                                'ur_IN.UTF-8',
     'ur_pk':                                'ur_PK.CP1256',
-    'ur_pk.cp1256':                         'ur_PK.CP1256',
-    'ur_pk.microsoftcp1256':                'ur_PK.CP1256',
     'uz':                                   'uz_UZ.UTF-8',
     'uz_uz':                                'uz_UZ.UTF-8',
-    'uz_uz.iso88591':                       'uz_UZ.ISO8859-1',
-    'uz_uz.utf8@cyrillic':                  'uz_UZ.UTF-8',
     'uz_uz@cyrillic':                       'uz_UZ.UTF-8',
     've':                                   've_ZA.UTF-8',
     've_za':                                've_ZA.UTF-8',
@@ -1624,35 +1351,28 @@
     'vi_vn.viscii111':                      'vi_VN.VISCII',
     'wa':                                   'wa_BE.ISO8859-1',
     'wa_be':                                'wa_BE.ISO8859-1',
-    'wa_be.iso88591':                       'wa_BE.ISO8859-1',
-    'wa_be.iso885915':                      'wa_BE.ISO8859-15',
-    'wa_be.iso885915@euro':                 'wa_BE.ISO8859-15',
-    'wa_be@euro':                           'wa_BE.ISO8859-15',
+    'wae_ch':                               'wae_CH.UTF-8',
+    'wal_et':                               'wal_ET.UTF-8',
+    'wo_sn':                                'wo_SN.UTF-8',
     'xh':                                   'xh_ZA.ISO8859-1',
     'xh_za':                                'xh_ZA.ISO8859-1',
-    'xh_za.iso88591':                       'xh_ZA.ISO8859-1',
     'yi':                                   'yi_US.CP1255',
     'yi_us':                                'yi_US.CP1255',
-    'yi_us.cp1255':                         'yi_US.CP1255',
-    'yi_us.microsoftcp1255':                'yi_US.CP1255',
+    'yo_ng':                                'yo_NG.UTF-8',
+    'yue_hk':                               'yue_HK.UTF-8',
     'zh':                                   'zh_CN.eucCN',
     'zh_cn':                                'zh_CN.gb2312',
     'zh_cn.big5':                           'zh_TW.big5',
     'zh_cn.euc':                            'zh_CN.eucCN',
-    'zh_cn.gb18030':                        'zh_CN.gb18030',
-    'zh_cn.gb2312':                         'zh_CN.gb2312',
-    'zh_cn.gbk':                            'zh_CN.gbk',
     'zh_hk':                                'zh_HK.big5hkscs',
-    'zh_hk.big5':                           'zh_HK.big5',
     'zh_hk.big5hk':                         'zh_HK.big5hkscs',
-    'zh_hk.big5hkscs':                      'zh_HK.big5hkscs',
+    'zh_sg':                                'zh_SG.GB2312',
+    'zh_sg.gbk':                            'zh_SG.GBK',
     'zh_tw':                                'zh_TW.big5',
-    'zh_tw.big5':                           'zh_TW.big5',
     'zh_tw.euc':                            'zh_TW.eucTW',
     'zh_tw.euctw':                          'zh_TW.eucTW',
     'zu':                                   'zu_ZA.ISO8859-1',
     'zu_za':                                'zu_ZA.ISO8859-1',
-    'zu_za.iso88591':                       'zu_ZA.ISO8859-1',
 }
 
 #
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py
index 9f436f3..9a8685b 100644
--- a/Lib/logging/__init__.py
+++ b/Lib/logging/__init__.py
@@ -1,4 +1,4 @@
-# Copyright 2001-2013 by Vinay Sajip. All Rights Reserved.
+# Copyright 2001-2014 by Vinay Sajip. All Rights Reserved.
 #
 # Permission to use, copy, modify, and distribute this software and its
 # documentation for any purpose and without fee is hereby granted,
@@ -18,12 +18,13 @@
 Logging package for Python. Based on PEP 282 and comments thereto in
 comp.lang.python.
 
-Copyright (C) 2001-2013 Vinay Sajip. All Rights Reserved.
+Copyright (C) 2001-2014 Vinay Sajip. All Rights Reserved.
 
 To use, simply 'import logging' and log away!
 """
 
-import sys, os, time, io, traceback, warnings, weakref
+import sys, os, time, io, traceback, warnings, weakref, collections
+
 from string import Template
 
 __all__ = ['BASIC_FORMAT', 'BufferingFormatter', 'CRITICAL', 'DEBUG', 'ERROR',
@@ -42,6 +43,7 @@
 
 __author__  = "Vinay Sajip <vinay_sajip@red-dove.com>"
 __status__  = "production"
+# The following module attributes are no longer updated.
 __version__ = "0.5.1.2"
 __date__    = "07 February 2010"
 
@@ -50,34 +52,6 @@
 #---------------------------------------------------------------------------
 
 #
-# _srcfile is used when walking the stack to check when we've got the first
-# caller stack frame.
-#
-if hasattr(sys, 'frozen'): #support for py2exe
-    _srcfile = "logging%s__init__%s" % (os.sep, __file__[-4:])
-else:
-    _srcfile = __file__
-_srcfile = os.path.normcase(_srcfile)
-
-
-if hasattr(sys, '_getframe'):
-    currentframe = lambda: sys._getframe(3)
-else: #pragma: no cover
-    def currentframe():
-        """Return the frame object for the caller's stack frame."""
-        try:
-            raise Exception
-        except:
-            return sys.exc_info()[2].tb_frame.f_back
-
-# _srcfile is only used in conjunction with sys._getframe().
-# To provide compatibility with older versions of Python, set _srcfile
-# to None if _getframe() is not available; this value will prevent
-# findCaller() from being called.
-#if not hasattr(sys, "_getframe"):
-#    _srcfile = None
-
-#
 #_startTime is used as the base when calculating the relative time of events
 #
 _startTime = time.time()
@@ -123,20 +97,22 @@
 DEBUG = 10
 NOTSET = 0
 
-_levelNames = {
-    CRITICAL : 'CRITICAL',
-    ERROR : 'ERROR',
-    WARNING : 'WARNING',
-    INFO : 'INFO',
-    DEBUG : 'DEBUG',
-    NOTSET : 'NOTSET',
-    'CRITICAL' : CRITICAL,
-    'ERROR' : ERROR,
-    'WARN' : WARNING,
-    'WARNING' : WARNING,
-    'INFO' : INFO,
-    'DEBUG' : DEBUG,
-    'NOTSET' : NOTSET,
+_levelToName = {
+    CRITICAL: 'CRITICAL',
+    ERROR: 'ERROR',
+    WARNING: 'WARNING',
+    INFO: 'INFO',
+    DEBUG: 'DEBUG',
+    NOTSET: 'NOTSET',
+}
+_nameToLevel = {
+    'CRITICAL': CRITICAL,
+    'ERROR': ERROR,
+    'WARN': WARNING,
+    'WARNING': WARNING,
+    'INFO': INFO,
+    'DEBUG': DEBUG,
+    'NOTSET': NOTSET,
 }
 
 def getLevelName(level):
@@ -153,7 +129,8 @@
 
     Otherwise, the string "Level %s" % level is returned.
     """
-    return _levelNames.get(level, ("Level %s" % level))
+    # See Issue #22386 for the reason for this convoluted expression
+    return _levelToName.get(level, _nameToLevel.get(level, ("Level %s" % level)))
 
 def addLevelName(level, levelName):
     """
@@ -163,18 +140,52 @@
     """
     _acquireLock()
     try:    #unlikely to cause an exception, but you never know...
-        _levelNames[level] = levelName
-        _levelNames[levelName] = level
+        _levelToName[level] = levelName
+        _nameToLevel[levelName] = level
     finally:
         _releaseLock()
 
+if hasattr(sys, '_getframe'):
+    currentframe = lambda: sys._getframe(3)
+else: #pragma: no cover
+    def currentframe():
+        """Return the frame object for the caller's stack frame."""
+        try:
+            raise Exception
+        except Exception:
+            return sys.exc_info()[2].tb_frame.f_back
+
+#
+# _srcfile is used when walking the stack to check when we've got the first
+# caller stack frame, by skipping frames whose filename is that of this
+# module's source. It therefore should contain the filename of this module's
+# source file.
+#
+# Ordinarily we would use __file__ for this, but frozen modules don't always
+# have __file__ set, for some reason (see Issue #21736). Thus, we get the
+# filename from a handy code object from a function defined in this module.
+# (There's no particular reason for picking addLevelName.)
+#
+
+_srcfile = os.path.normcase(addLevelName.__code__.co_filename)
+
+# _srcfile is only used in conjunction with sys._getframe().
+# To provide compatibility with older versions of Python, set _srcfile
+# to None if _getframe() is not available; this value will prevent
+# findCaller() from being called. You can also do this if you want to avoid
+# the overhead of fetching caller information, even when _getframe() is
+# available.
+#if not hasattr(sys, '_getframe'):
+#    _srcfile = None
+
+
 def _checkLevel(level):
     if isinstance(level, int):
         rv = level
     elif str(level) == level:
-        if level not in _levelNames:
+        if level not in _nameToLevel:
             raise ValueError("Unknown level: %r" % level)
-        rv = _levelNames[level]
+        rv = _nameToLevel[level]
     else:
         raise TypeError("Level not an integer or a valid string: %r" % level)
     return rv
@@ -250,7 +261,13 @@
         # 'Value is %d' instead of 'Value is 0'.
         # For the use case of passing a dictionary, this should not be a
         # problem.
-        if args and len(args) == 1 and isinstance(args[0], dict) and args[0]:
+        # Issue #21172: a request was made to relax the isinstance check
+        # to hasattr(args[0], '__getitem__'). However, the docs on string
+        # formatting still seem to suggest a mapping object is required.
+        # Thus, while not removing the isinstance check, it does now look
+        # for collections.Mapping rather than, as before, dict.
+        if (args and len(args) == 1 and isinstance(args[0], collections.Mapping)
+            and args[0]):
             args = args[0]
         self.args = args
         self.levelname = getLevelName(level)
@@ -708,16 +725,17 @@
     Remove a handler reference from the internal cleanup list.
     """
     # 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 and _handlerList is not None and
-        _releaseLock is not None):
-        _acquireLock()
+    # set to None. It can also be called from another thread. So we need to
+    # pre-emptively grab the necessary globals and check if they're None,
+    # to prevent race conditions and failures during interpreter shutdown.
+    acquire, release, handlers = _acquireLock, _releaseLock, _handlerList
+    if acquire and release and handlers:
+        acquire()
         try:
-            if wr in _handlerList:
-                _handlerList.remove(wr)
+            if wr in handlers:
+                handlers.remove(wr)
         finally:
-            _releaseLock()
+            release()
 
 def _addHandlerRef(handler):
     """
@@ -882,16 +900,37 @@
         The record which was being processed is passed in to this method.
         """
         if raiseExceptions and sys.stderr:  # see issue 13807
-            ei = sys.exc_info()
+            t, v, tb = sys.exc_info()
             try:
-                traceback.print_exception(ei[0], ei[1], ei[2],
-                                          None, sys.stderr)
-                sys.stderr.write('Logged from file %s, line %s\n' % (
-                                 record.filename, record.lineno))
-            except IOError: #pragma: no cover
+                sys.stderr.write('--- Logging error ---\n')
+                traceback.print_exception(t, v, tb, None, sys.stderr)
+                sys.stderr.write('Call stack:\n')
+                # Walk the stack frame up until we're out of logging,
+                # so as to print the calling context.
+                frame = tb.tb_frame
+                while (frame and os.path.dirname(frame.f_code.co_filename) ==
+                       __path__[0]):
+                    frame = frame.f_back
+                if frame:
+                    traceback.print_stack(frame, file=sys.stderr)
+                else:
+                    # couldn't find the right stack frame, for some reason
+                    sys.stderr.write('Logged from file %s, line %s\n' % (
+                                     record.filename, record.lineno))
+                # Issue 18671: output logging message and arguments
+                try:
+                    sys.stderr.write('Message: %r\n'
+                                     'Arguments: %s\n' % (record.msg,
+                                                          record.args))
+                except Exception:
+                    sys.stderr.write('Unable to print the message and arguments'
+                                     ' - possible formatting error.\nUse the'
+                                     ' traceback above to help find the error.\n'
+                                    )
+            except OSError: #pragma: no cover
                 pass    # see issue 5971
             finally:
-                del ei
+                del t, v, tb
 
 class StreamHandler(Handler):
     """
@@ -941,9 +980,7 @@
             stream.write(msg)
             stream.write(self.terminator)
             self.flush()
-        except (KeyboardInterrupt, SystemExit): #pragma: no cover
-            raise
-        except:
+        except Exception:
             self.handleError(record)
 
 class FileHandler(StreamHandler):
@@ -1686,7 +1723,7 @@
     _acquireLock()
     try:
         if len(root.handlers) == 0:
-            handlers = kwargs.get("handlers")
+            handlers = kwargs.pop("handlers", None)
             if handlers is None:
                 if "stream" in kwargs and "filename" in kwargs:
                     raise ValueError("'stream' and 'filename' should not be "
@@ -1696,28 +1733,31 @@
                     raise ValueError("'stream' or 'filename' should not be "
                                      "specified together with 'handlers'")
             if handlers is None:
-                filename = kwargs.get("filename")
+                filename = kwargs.pop("filename", None)
                 if filename:
-                    mode = kwargs.get("filemode", 'a')
+                    mode = kwargs.pop("filemode", 'a')
                     h = FileHandler(filename, mode)
                 else:
-                    stream = kwargs.get("stream")
+                    stream = kwargs.pop("stream", None)
                     h = StreamHandler(stream)
                 handlers = [h]
-            dfs = kwargs.get("datefmt", None)
-            style = kwargs.get("style", '%')
+            dfs = kwargs.pop("datefmt", None)
+            style = kwargs.pop("style", '%')
             if style not in _STYLES:
                 raise ValueError('Style must be one of: %s' % ','.join(
                                  _STYLES.keys()))
-            fs = kwargs.get("format", _STYLES[style][1])
+            fs = kwargs.pop("format", _STYLES[style][1])
             fmt = Formatter(fs, dfs, style)
             for h in handlers:
                 if h.formatter is None:
                     h.setFormatter(fmt)
                 root.addHandler(h)
-            level = kwargs.get("level")
+            level = kwargs.pop("level", None)
             if level is not None:
                 root.setLevel(level)
+            if kwargs:
+                keys = ', '.join(kwargs.keys())
+                raise ValueError('Unrecognised argument(s): %s' % keys)
     finally:
         _releaseLock()
 
@@ -1836,7 +1876,7 @@
                     h.acquire()
                     h.flush()
                     h.close()
-                except (IOError, ValueError):
+                except (OSError, ValueError):
                     # Ignore errors which might be caused
                     # because handlers have been closed but
                     # references to them are still around at
@@ -1844,7 +1884,7 @@
                     pass
                 finally:
                     h.release()
-        except:
+        except: # ignore everything, as we're shutting down
             if raiseExceptions:
                 raise
             #else, swallow
diff --git a/Lib/logging/config.py b/Lib/logging/config.py
index 1880614..895fb26 100644
--- a/Lib/logging/config.py
+++ b/Lib/logging/config.py
@@ -1,4 +1,4 @@
-# Copyright 2001-2013 by Vinay Sajip. All Rights Reserved.
+# Copyright 2001-2014 by Vinay Sajip. All Rights Reserved.
 #
 # Permission to use, copy, modify, and distribute this software and its
 # documentation for any purpose and without fee is hereby granted,
@@ -19,13 +19,19 @@
 is based on PEP 282 and comments thereto in comp.lang.python, and influenced
 by Apache's log4j system.
 
-Copyright (C) 2001-2013 Vinay Sajip. All Rights Reserved.
+Copyright (C) 2001-2014 Vinay Sajip. All Rights Reserved.
 
 To use, simply 'import logging' and log away!
 """
 
-import sys, logging, logging.handlers, socket, struct, traceback, re
+import errno
 import io
+import logging
+import logging.handlers
+import re
+import struct
+import sys
+import traceback
 
 try:
     import _thread as thread
@@ -38,10 +44,7 @@
 
 DEFAULT_LOGGING_CONFIG_PORT = 9030
 
-if sys.platform == "win32":
-    RESET_ERROR = 10054   #WSAECONNRESET
-else:
-    RESET_ERROR = 104     #ECONNRESET
+RESET_ERROR = errno.ECONNRESET
 
 #
 #   The following code implements a socket listener for on-the-fly
@@ -61,11 +64,14 @@
     """
     import configparser
 
-    cp = configparser.ConfigParser(defaults)
-    if hasattr(fname, 'readline'):
-        cp.read_file(fname)
+    if isinstance(fname, configparser.RawConfigParser):
+        cp = fname
     else:
-        cp.read(fname)
+        cp = configparser.ConfigParser(defaults)
+        if hasattr(fname, 'readline'):
+            cp.read_file(fname)
+        else:
+            cp.read(fname)
 
     formatters = _create_formatters(cp)
 
@@ -141,7 +147,7 @@
         h = klass(*args)
         if "level" in section:
             level = section["level"]
-            h.setLevel(logging._levelNames[level])
+            h.setLevel(level)
         if len(fmt):
             h.setFormatter(formatters[fmt])
         if issubclass(klass, logging.handlers.MemoryHandler):
@@ -188,7 +194,7 @@
     log = root
     if "level" in section:
         level = section["level"]
-        log.setLevel(logging._levelNames[level])
+        log.setLevel(level)
     for h in root.handlers[:]:
         root.removeHandler(h)
     hlist = section["handlers"]
@@ -234,7 +240,7 @@
             existing.remove(qn)
         if "level" in section:
             level = section["level"]
-            logger.setLevel(logging._levelNames[level])
+            logger.setLevel(level)
         for h in logger.handlers[:]:
             logger.removeHandler(h)
         logger.propagate = propagate
@@ -271,6 +277,30 @@
     return True
 
 
+class ConvertingMixin(object):
+    """For ConvertingXXX's, this mixin class provides common functions"""
+
+    def convert_with_key(self, key, value, replace=True):
+        result = self.configurator.convert(value)
+        #If the converted value is different, save for next time
+        if value is not result:
+            if replace:
+                self[key] = result
+            if type(result) in (ConvertingDict, ConvertingList,
+                               ConvertingTuple):
+                result.parent = self
+                result.key = key
+        return result
+
+    def convert(self, value):
+        result = self.configurator.convert(value)
+        if value is not result:
+            if type(result) in (ConvertingDict, ConvertingList,
+                               ConvertingTuple):
+                result.parent = self
+        return result
+
+
 # The ConvertingXXX classes are wrappers around standard Python containers,
 # and they serve to convert any suitable values in the container. The
 # conversion converts base dicts, lists and tuples to their wrapped
@@ -280,77 +310,37 @@
 # Each wrapper should have a configurator attribute holding the actual
 # configurator to use for conversion.
 
-class ConvertingDict(dict):
+class ConvertingDict(dict, ConvertingMixin):
     """A converting dictionary wrapper."""
 
     def __getitem__(self, key):
         value = dict.__getitem__(self, key)
-        result = self.configurator.convert(value)
-        #If the converted value is different, save for next time
-        if value is not result:
-            self[key] = result
-            if type(result) in (ConvertingDict, ConvertingList,
-                                ConvertingTuple):
-                result.parent = self
-                result.key = key
-        return result
+        return self.convert_with_key(key, value)
 
     def get(self, key, default=None):
         value = dict.get(self, key, default)
-        result = self.configurator.convert(value)
-        #If the converted value is different, save for next time
-        if value is not result:
-            self[key] = result
-            if type(result) in (ConvertingDict, ConvertingList,
-                                ConvertingTuple):
-                result.parent = self
-                result.key = key
-        return result
+        return self.convert_with_key(key, value)
 
     def pop(self, key, default=None):
         value = dict.pop(self, key, default)
-        result = self.configurator.convert(value)
-        if value is not result:
-            if type(result) in (ConvertingDict, ConvertingList,
-                                ConvertingTuple):
-                result.parent = self
-                result.key = key
-        return result
+        return self.convert_with_key(key, value, replace=False)
 
-class ConvertingList(list):
+class ConvertingList(list, ConvertingMixin):
     """A converting list wrapper."""
     def __getitem__(self, key):
         value = list.__getitem__(self, key)
-        result = self.configurator.convert(value)
-        #If the converted value is different, save for next time
-        if value is not result:
-            self[key] = result
-            if type(result) in (ConvertingDict, ConvertingList,
-                                ConvertingTuple):
-                result.parent = self
-                result.key = key
-        return result
+        return self.convert_with_key(key, value)
 
     def pop(self, idx=-1):
         value = list.pop(self, idx)
-        result = self.configurator.convert(value)
-        if value is not result:
-            if type(result) in (ConvertingDict, ConvertingList,
-                                ConvertingTuple):
-                result.parent = self
-        return result
+        return self.convert(value)
 
-class ConvertingTuple(tuple):
+class ConvertingTuple(tuple, ConvertingMixin):
     """A converting tuple wrapper."""
     def __getitem__(self, key):
         value = tuple.__getitem__(self, key)
-        result = self.configurator.convert(value)
-        if value is not result:
-            if type(result) in (ConvertingDict, ConvertingList,
-                                ConvertingTuple):
-                result.parent = self
-                result.key = key
-        return result
+        # Can't replace a tuple entry.
+        return self.convert_with_key(key, value, replace=False)
 
 class BaseConfigurator(object):
     """
@@ -729,6 +719,7 @@
                 'address' in config:
                 config['address'] = self.as_tuple(config['address'])
             factory = klass
+        props = config.pop('.', None)
         kwargs = dict([(k, config[k]) for k in config if valid_ident(k)])
         try:
             result = factory(**kwargs)
@@ -747,6 +738,9 @@
             result.setLevel(logging._checkLevel(level))
         if filters:
             self.add_filters(result, filters)
+        if props:
+            for name, value in props.items():
+                setattr(result, name, value)
         return result
 
     def add_handlers(self, logger, handlers):
@@ -795,7 +789,7 @@
     dictConfigClass(config).configure()
 
 
-def listen(port=DEFAULT_LOGGING_CONFIG_PORT):
+def listen(port=DEFAULT_LOGGING_CONFIG_PORT, verify=None):
     """
     Start up a socket server on the specified port, and listen for new
     configurations.
@@ -804,6 +798,15 @@
     Returns a Thread object on which you can call start() to start the server,
     and which you can join() when appropriate. To stop the server, call
     stopListening().
+
+    Use the ``verify`` argument to verify any bytes received across the wire
+    from a client. If specified, it should be a callable which receives a
+    single argument - the bytes of configuration data received across the
+    network - and it should return either ``None``, to indicate that the
+    passed in bytes could not be verified and should be discarded, or a
+    byte string which is then passed to the configuration machinery as
+    normal. Note that you can return transformed bytes, e.g. by decrypting
+    the bytes passed in.
     """
     if not thread: #pragma: no cover
         raise NotImplementedError("listen() needs threading to work")
@@ -831,31 +834,28 @@
                     chunk = self.connection.recv(slen)
                     while len(chunk) < slen:
                         chunk = chunk + conn.recv(slen - len(chunk))
-                    chunk = chunk.decode("utf-8")
-                    try:
-                        import json
-                        d =json.loads(chunk)
-                        assert isinstance(d, dict)
-                        dictConfig(d)
-                    except:
-                        #Apply new configuration.
-
-                        file = io.StringIO(chunk)
+                    if self.server.verify is not None:
+                        chunk = self.server.verify(chunk)
+                    if chunk is not None:   # verified, can process
+                        chunk = chunk.decode("utf-8")
                         try:
-                            fileConfig(file)
-                        except (KeyboardInterrupt, SystemExit): #pragma: no cover
-                            raise
-                        except:
-                            traceback.print_exc()
+                            import json
+                            d =json.loads(chunk)
+                            assert isinstance(d, dict)
+                            dictConfig(d)
+                        except Exception:
+                            #Apply new configuration.
+
+                            file = io.StringIO(chunk)
+                            try:
+                                fileConfig(file)
+                            except Exception:
+                                traceback.print_exc()
                     if self.server.ready:
                         self.server.ready.set()
-            except socket.error as e:
-                if not isinstance(e.args, tuple):
+            except OSError as e:
+                if e.errno != RESET_ERROR:
                     raise
-                else:
-                    errcode = e.args[0]
-                    if errcode != RESET_ERROR:
-                        raise
 
     class ConfigSocketReceiver(ThreadingTCPServer):
         """
@@ -865,13 +865,14 @@
         allow_reuse_address = 1
 
         def __init__(self, host='localhost', port=DEFAULT_LOGGING_CONFIG_PORT,
-                     handler=None, ready=None):
+                     handler=None, ready=None, verify=None):
             ThreadingTCPServer.__init__(self, (host, port), handler)
             logging._acquireLock()
             self.abort = 0
             logging._releaseLock()
             self.timeout = 1
             self.ready = ready
+            self.verify = verify
 
         def serve_until_stopped(self):
             import select
@@ -889,16 +890,18 @@
 
     class Server(threading.Thread):
 
-        def __init__(self, rcvr, hdlr, port):
+        def __init__(self, rcvr, hdlr, port, verify):
             super(Server, self).__init__()
             self.rcvr = rcvr
             self.hdlr = hdlr
             self.port = port
+            self.verify = verify
             self.ready = threading.Event()
 
         def run(self):
             server = self.rcvr(port=self.port, handler=self.hdlr,
-                               ready=self.ready)
+                               ready=self.ready,
+                               verify=self.verify)
             if self.port == 0:
                 self.port = server.server_address[1]
             self.ready.set()
@@ -908,7 +911,7 @@
             logging._releaseLock()
             server.serve_until_stopped()
 
-    return Server(ConfigSocketReceiver, ConfigStreamHandler, port)
+    return Server(ConfigSocketReceiver, ConfigStreamHandler, port, verify)
 
 def stopListening():
     """
diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py
index ddec7dd..c67ac99 100644
--- a/Lib/logging/handlers.py
+++ b/Lib/logging/handlers.py
@@ -23,8 +23,7 @@
 To use, simply 'import logging.handlers' and log away!
 """
 
-import errno, logging, socket, os, pickle, struct, time, re
-from codecs import BOM_UTF8
+import logging, socket, os, pickle, struct, time, re
 from stat import ST_DEV, ST_INO, ST_MTIME
 import queue
 try:
@@ -72,9 +71,7 @@
             if self.shouldRollover(record):
                 self.doRollover()
             logging.FileHandler.emit(self, record)
-        except (KeyboardInterrupt, SystemExit): #pragma: no cover
-            raise
-        except:
+        except Exception:
             self.handleError(record)
 
     def rotation_filename(self, default_name):
@@ -201,11 +198,12 @@
     If backupCount is > 0, when rollover is done, no more than backupCount
     files are kept - the oldest ones are deleted.
     """
-    def __init__(self, filename, when='h', interval=1, backupCount=0, encoding=None, delay=False, utc=False):
+    def __init__(self, filename, when='h', interval=1, backupCount=0, encoding=None, delay=False, utc=False, atTime=None):
         BaseRotatingHandler.__init__(self, filename, 'a', encoding, delay)
         self.when = when.upper()
         self.backupCount = backupCount
         self.utc = utc
+        self.atTime = atTime
         # Calculate the real rollover interval, which is just the number of
         # seconds between rollovers.  Also set the filename suffix used when
         # a rollover occurs.  Current 'when' events supported:
@@ -275,9 +273,22 @@
             currentHour = t[3]
             currentMinute = t[4]
             currentSecond = t[5]
-            # r is the number of seconds left between now and midnight
-            r = _MIDNIGHT - ((currentHour * 60 + currentMinute) * 60 +
-                    currentSecond)
+            currentDay = t[6]
+            # r is the number of seconds left between now and the next rotation
+            if self.atTime is None:
+                rotate_ts = _MIDNIGHT
+            else:
+                rotate_ts = ((self.atTime.hour * 60 + self.atTime.minute)*60 +
+                    self.atTime.second)
+
+            r = rotate_ts - ((currentHour * 60 + currentMinute) * 60 +
+                currentSecond)
+            if r < 0:
+                # Rotate time is before the current time (for example when
+                # self.rotateAt is 13:45 and it now 14:15), rotation is
+                # tomorrow.
+                r += _MIDNIGHT
+                currentDay = (currentDay + 1) % 7
             result = currentTime + r
             # If we are rolling over on a certain day, add in the number of days until
             # the next rollover, but offset by 1 since we just calculated the time
@@ -295,7 +306,7 @@
             # This is because the above time calculation takes us to midnight on this
             # day, i.e. the start of the next day.
             if self.when.startswith('W'):
-                day = t[6] # 0 is Monday
+                day = currentDay # 0 is Monday
                 if day != self.dayOfWeek:
                     if day < self.dayOfWeek:
                         daysToWait = self.dayOfWeek - day
@@ -444,17 +455,15 @@
         try:
             # stat the file by path, checking for existence
             sres = os.stat(self.baseFilename)
-        except OSError as err:
-            if err.errno == errno.ENOENT:
-                sres = None
-            else:
-                raise
+        except FileNotFoundError:
+            sres = None
         # compare file system stat with that of our stream file handle
         if not sres or sres[ST_DEV] != self.dev or sres[ST_INO] != self.ino:
             if self.stream is not None:
                 # we have an open file handle, clean it up
                 self.stream.flush()
                 self.stream.close()
+                self.stream = None  # See Issue #21742: _open () might fail.
                 # open a new file handle and get new stat info from that fd
                 self.stream = self._open()
                 self._statstream()
@@ -485,6 +494,10 @@
         logging.Handler.__init__(self)
         self.host = host
         self.port = port
+        if port is None:
+            self.address = host
+        else:
+            self.address = (host, port)
         self.sock = None
         self.closeOnError = False
         self.retryTime = None
@@ -500,15 +513,17 @@
         A factory method which allows subclasses to define the precise
         type of socket they want.
         """
-        s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-        if hasattr(s, 'settimeout'):
-            s.settimeout(timeout)
-        try:
-            s.connect((self.host, self.port))
-            return s
-        except socket.error:
-            s.close()
-            raise
+        if self.port is not None:
+            result = socket.create_connection(self.address, timeout=timeout)
+        else:
+            result = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
+            result.settimeout(timeout)
+            try:
+                result.connect(self.address)
+            except OSError:
+                result.close()  # Issue 19182
+                raise
+        return result
 
     def createSocket(self):
         """
@@ -528,7 +543,7 @@
             try:
                 self.sock = self.makeSocket()
                 self.retryTime = None # next time, no delay before trying
-            except socket.error:
+            except OSError:
                 #Creation failed, so set the retry time and return.
                 if self.retryTime is None:
                     self.retryPeriod = self.retryStart
@@ -552,16 +567,8 @@
         #but are still unable to connect.
         if self.sock:
             try:
-                if hasattr(self.sock, "sendall"):
-                    self.sock.sendall(s)
-                else: #pragma: no cover
-                    sentsofar = 0
-                    left = len(s)
-                    while left > 0:
-                        sent = self.sock.send(s[sentsofar:])
-                        sentsofar = sentsofar + sent
-                        left = left - sent
-            except socket.error: #pragma: no cover
+                self.sock.sendall(s)
+            except OSError: #pragma: no cover
                 self.sock.close()
                 self.sock = None  # so we can call createSocket next time
 
@@ -611,9 +618,7 @@
         try:
             s = self.makePickle(record)
             self.send(s)
-        except (KeyboardInterrupt, SystemExit): #pragma: no cover
-            raise
-        except:
+        except Exception:
             self.handleError(record)
 
     def close(self):
@@ -652,7 +657,11 @@
         The factory method of SocketHandler is here overridden to create
         a UDP socket (SOCK_DGRAM).
         """
-        s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
+        if self.port is None:
+            family = socket.AF_UNIX
+        else:
+            family = socket.AF_INET
+        s = socket.socket(family, socket.SOCK_DGRAM)
         return s
 
     def send(self, s):
@@ -665,7 +674,7 @@
         """
         if self.sock is None:
             self.createSocket()
-        self.sock.sendto(s, (self.host, self.port))
+        self.sock.sendto(s, self.address)
 
 class SysLogHandler(logging.Handler):
     """
@@ -777,7 +786,11 @@
 
         If address is specified as a string, a UNIX socket is used. To log to a
         local syslogd, "SysLogHandler(address="/dev/log")" can be used.
-        If facility is not specified, LOG_USER is used.
+        If facility is not specified, LOG_USER is used. If socktype is
+        specified as socket.SOCK_DGRAM or socket.SOCK_STREAM, that specific
+        socket type will be used. For Unix sockets, you can also specify a
+        socktype of None, in which case socket.SOCK_DGRAM will be used, falling
+        back to socket.SOCK_STREAM.
         """
         logging.Handler.__init__(self)
 
@@ -807,7 +820,7 @@
             self.socket.connect(address)
             # it worked, so set self.socktype to the used type
             self.socktype = use_socktype
-        except socket.error:
+        except OSError:
             self.socket.close()
             if self.socktype is not None:
                 # user didn't specify falling back, so fail
@@ -818,7 +831,7 @@
                 self.socket.connect(address)
                 # it worked, so set self.socktype to the used type
                 self.socktype = use_socktype
-            except socket.error:
+            except OSError:
                 self.socket.close()
                 raise
 
@@ -866,26 +879,25 @@
         The record is formatted, and then sent to the syslog server. If
         exception information is present, it is NOT sent to the server.
         """
-        msg = self.format(record)
-        if self.ident:
-            msg = self.ident + msg
-        if self.append_nul:
-            msg += '\000'
-        """
-        We need to convert record level to lowercase, maybe this will
-        change in the future.
-        """
-        prio = '<%d>' % self.encodePriority(self.facility,
-                                            self.mapPriority(record.levelname))
-        prio = prio.encode('utf-8')
-        # Message is a string. Convert to bytes as required by RFC 5424
-        msg = msg.encode('utf-8')
-        msg = prio + msg
         try:
+            msg = self.format(record)
+            if self.ident:
+                msg = self.ident + msg
+            if self.append_nul:
+                msg += '\000'
+
+            # We need to convert record level to lowercase, maybe this will
+            # change in the future.
+            prio = '<%d>' % self.encodePriority(self.facility,
+                                                self.mapPriority(record.levelname))
+            prio = prio.encode('utf-8')
+            # Message is a string. Convert to bytes as required by RFC 5424
+            msg = msg.encode('utf-8')
+            msg = prio + msg
             if self.unixsocket:
                 try:
                     self.socket.send(msg)
-                except socket.error:
+                except OSError:
                     self.socket.close()
                     self._connect_unixsocket(self.address)
                     self.socket.send(msg)
@@ -893,9 +905,7 @@
                 self.socket.sendto(msg, self.address)
             else:
                 self.socket.sendall(msg)
-        except (KeyboardInterrupt, SystemExit): #pragma: no cover
-            raise
-        except:
+        except Exception:
             self.handleError(record)
 
 class SMTPHandler(logging.Handler):
@@ -921,11 +931,11 @@
         default is one second).
         """
         logging.Handler.__init__(self)
-        if isinstance(mailhost, tuple):
+        if isinstance(mailhost, (list, tuple)):
             self.mailhost, self.mailport = mailhost
         else:
             self.mailhost, self.mailport = mailhost, None
-        if isinstance(credentials, tuple):
+        if isinstance(credentials, (list, tuple)):
             self.username, self.password = credentials
         else:
             self.username = None
@@ -973,9 +983,7 @@
                 smtp.login(self.username, self.password)
             smtp.sendmail(self.fromaddr, self.toaddrs, msg)
             smtp.quit()
-        except (KeyboardInterrupt, SystemExit): #pragma: no cover
-            raise
-        except:
+        except Exception:
             self.handleError(record)
 
 class NTEventLogHandler(logging.Handler):
@@ -1060,9 +1068,7 @@
                 type = self.getEventType(record)
                 msg = self.format(record)
                 self._welu.ReportEvent(self.appname, id, cat, type, [msg])
-            except (KeyboardInterrupt, SystemExit): #pragma: no cover
-                raise
-            except:
+            except Exception:
                 self.handleError(record)
 
     def close(self):
@@ -1083,7 +1089,8 @@
     A class which sends records to a Web server, using either GET or
     POST semantics.
     """
-    def __init__(self, host, url, method="GET", secure=False, credentials=None):
+    def __init__(self, host, url, method="GET", secure=False, credentials=None,
+                 context=None):
         """
         Initialize the instance with the host, the request URL, and the method
         ("GET" or "POST")
@@ -1092,11 +1099,15 @@
         method = method.upper()
         if method not in ["GET", "POST"]:
             raise ValueError("method must be GET or POST")
+        if not secure and context is not None:
+            raise ValueError("context parameter only makes sense "
+                             "with secure=True")
         self.host = host
         self.url = url
         self.method = method
         self.secure = secure
         self.credentials = credentials
+        self.context = context
 
     def mapLogRecord(self, record):
         """
@@ -1116,7 +1127,7 @@
             import http.client, urllib.parse
             host = self.host
             if self.secure:
-                h = http.client.HTTPSConnection(host)
+                h = http.client.HTTPSConnection(host, context=self.context)
             else:
                 h = http.client.HTTPConnection(host)
             url = self.url
@@ -1147,9 +1158,7 @@
             if self.method == "POST":
                 h.send(data.encode('utf-8'))
             h.getresponse()    #can't do anything with the result
-        except (KeyboardInterrupt, SystemExit): #pragma: no cover
-            raise
-        except:
+        except Exception:
             self.handleError(record)
 
 class BufferingHandler(logging.Handler):
@@ -1329,9 +1338,7 @@
         """
         try:
             self.enqueue(self.prepare(record))
-        except (KeyboardInterrupt, SystemExit): #pragma: no cover
-            raise
-        except:
+        except Exception:
             self.handleError(record)
 
 if threading:
diff --git a/Lib/lzma.py b/Lib/lzma.py
index 1a89887..f1d3958 100644
--- a/Lib/lzma.py
+++ b/Lib/lzma.py
@@ -54,9 +54,9 @@
         bytes object), in which case the named file is opened, or it can
         be an existing file object to read from or write to.
 
-        mode can be "r" for reading (default), "w" for (over)writing, or
-        "a" for appending. These can equivalently be given as "rb", "wb",
-        and "ab" respectively.
+        mode can be "r" for reading (default), "w" for (over)writing,
+        "x" for creating exclusively, or "a" for appending. These can
+        equivalently be given as "rb", "wb", "xb" and "ab" respectively.
 
         format specifies the container format to use for the file.
         If mode is "r", this defaults to FORMAT_AUTO. Otherwise, the
@@ -110,8 +110,9 @@
             # stream will need a separate decompressor object.
             self._init_args = {"format":format, "filters":filters}
             self._decompressor = LZMADecompressor(**self._init_args)
-            self._buffer = None
-        elif mode in ("w", "wb", "a", "ab"):
+            self._buffer = b""
+            self._buffer_offset = 0
+        elif mode in ("w", "wb", "a", "ab", "x", "xb"):
             if format is None:
                 format = FORMAT_XZ
             mode_code = _MODE_WRITE
@@ -143,7 +144,7 @@
         try:
             if self._mode in (_MODE_READ, _MODE_READ_EOF):
                 self._decompressor = None
-                self._buffer = None
+                self._buffer = b""
             elif self._mode == _MODE_WRITE:
                 self._fp.write(self._compressor.flush())
                 self._compressor = None
@@ -187,15 +188,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():
@@ -204,16 +208,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:
@@ -236,30 +237,48 @@
                     return False
             else:
                 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)
@@ -274,9 +293,9 @@
         The exact number of bytes returned is unspecified.
         """
         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.
@@ -285,7 +304,7 @@
         Returns b"" if the file is already at EOF.
         """
         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()
@@ -302,18 +321,40 @@
         # this does not give enough data for the decompressor to make progress.
         # In this case we make multiple reads, to avoid returning b"".
         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
 
+    def readline(self, size=-1):
+        """Read a line of uncompressed bytes from the file.
+
+        The terminating newline (if present) is retained. If size is
+        non-negative, no more than size bytes will be read (in which
+        case the line may be incomplete). Returns b'' if already at EOF.
+        """
+        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 write(self, data):
         """Write a bytes object to the file.
 
@@ -333,7 +374,8 @@
         self._mode = _MODE_READ
         self._pos = 0
         self._decompressor = LZMADecompressor(**self._init_args)
-        self._buffer = None
+        self._buffer = b""
+        self._buffer_offset = 0
 
     def seek(self, offset, whence=0):
         """Change the file position.
@@ -372,8 +414,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
 
@@ -388,23 +429,25 @@
          encoding=None, errors=None, newline=None):
     """Open an LZMA-compressed file in binary or text mode.
 
-    filename can be either an actual file name (given as a str or bytes object),
-    in which case the named file is opened, or it can be an existing file object
-    to read from or write to.
+    filename can be either an actual file name (given as a str or bytes
+    object), in which case the named file is opened, or it can be an
+    existing file object to read from or write to.
 
-    The mode argument can be "r", "rb" (default), "w", "wb", "a", or "ab" for
-    binary mode, or "rt", "wt" or "at" for text mode.
+    The mode argument can be "r", "rb" (default), "w", "wb", "x", "xb",
+    "a", or "ab" for binary mode, or "rt", "wt", "xt", or "at" for text
+    mode.
 
-    The format, check, preset and filters arguments specify the compression
-    settings, as for LZMACompressor, LZMADecompressor and LZMAFile.
+    The format, check, preset and filters arguments specify the
+    compression settings, as for LZMACompressor, LZMADecompressor and
+    LZMAFile.
 
-    For binary mode, this function is equivalent to the LZMAFile constructor:
-    LZMAFile(filename, mode, ...). In this case, the encoding, errors and
-    newline arguments must not be provided.
+    For binary mode, this function is equivalent to the LZMAFile
+    constructor: LZMAFile(filename, mode, ...). In this case, the
+    encoding, errors and newline arguments must not be provided.
 
     For text mode, a LZMAFile object is created, and wrapped in an
-    io.TextIOWrapper instance with the specified encoding, error handling
-    behavior, and line ending(s).
+    io.TextIOWrapper instance with the specified encoding, error
+    handling behavior, and line ending(s).
 
     """
     if "t" in mode:
@@ -434,7 +477,7 @@
     Refer to LZMACompressor's docstring for a description of the
     optional arguments *format*, *check*, *preset* and *filters*.
 
-    For incremental compression, use an LZMACompressor object instead.
+    For incremental compression, use an LZMACompressor instead.
     """
     comp = LZMACompressor(format, check, preset, filters)
     return comp.compress(data) + comp.flush()
@@ -446,7 +489,7 @@
     Refer to LZMADecompressor's docstring for a description of the
     optional arguments *format*, *check* and *filters*.
 
-    For incremental decompression, use a LZMADecompressor object instead.
+    For incremental decompression, use an LZMADecompressor instead.
     """
     results = []
     while True:
diff --git a/Lib/macpath.py b/Lib/macpath.py
index 1615d91..5ca0097 100644
--- a/Lib/macpath.py
+++ b/Lib/macpath.py
@@ -53,7 +53,7 @@
     colon = _get_colon(s)
     path = s
     for t in p:
-        if (not s) or isabs(t):
+        if (not path) or isabs(t):
             path = t
             continue
         if t[:1] == colon:
@@ -127,7 +127,7 @@
 
     try:
         st = os.lstat(path)
-    except os.error:
+    except OSError:
         return False
     return True
 
diff --git a/Lib/mailbox.py b/Lib/mailbox.py
index 3b64c2e..2eee76c 100644
--- a/Lib/mailbox.py
+++ b/Lib/mailbox.py
@@ -6,7 +6,6 @@
 # or returning from a flush() method.  See functions _sync_flush() and
 # _sync_close().
 
-import sys
 import os
 import time
 import calendar
@@ -20,9 +19,6 @@
 import io
 import contextlib
 try:
-    if sys.platform == 'os2emx':
-        # OS/2 EMX fcntl() not adequate
-        raise ImportError
     import fcntl
 except ImportError:
     fcntl = None
@@ -107,7 +103,7 @@
 
     def itervalues(self):
         """Return an iterator over all messages."""
-        for key in self.keys():
+        for key in self.iterkeys():
             try:
                 value = self[key]
             except KeyError:
@@ -123,7 +119,7 @@
 
     def iteritems(self):
         """Return an iterator over (key, message) tuples."""
-        for key in self.keys():
+        for key in self.iterkeys():
             try:
                 value = self[key]
             except KeyError:
@@ -158,7 +154,7 @@
 
     def popitem(self):
         """Delete an arbitrary (key, message) pair and return it."""
-        for key in self.keys():
+        for key in self.iterkeys():
             return (key, self.pop(key))     # This is only run once.
         else:
             raise KeyError('No messages in mailbox')
@@ -166,7 +162,7 @@
     def update(self, arg=None):
         """Change the messages that correspond to certain keys."""
         if hasattr(arg, 'iteritems'):
-            source = arg.items()
+            source = arg.iteritems()
         elif hasattr(arg, 'items'):
             source = arg.items()
         else:
@@ -339,11 +335,8 @@
         # This overrides an inapplicable implementation in the superclass.
         try:
             self.remove(key)
-        except KeyError:
+        except (KeyError, FileNotFoundError):
             pass
-        except OSError as e:
-            if e.errno != errno.ENOENT:
-                raise
 
     def __setitem__(self, key, message):
         """Replace the keyed message; raise KeyError if it doesn't exist."""
@@ -375,14 +368,11 @@
     def get_message(self, key):
         """Return a Message representation or raise a KeyError."""
         subpath = self._lookup(key)
-        f = open(os.path.join(self._path, subpath), 'rb')
-        try:
+        with open(os.path.join(self._path, subpath), 'rb') as f:
             if self._factory:
                 msg = self._factory(f)
             else:
                 msg = MaildirMessage(f)
-        finally:
-            f.close()
         subdir, name = os.path.split(subpath)
         msg.set_subdir(subdir)
         if self.colon in name:
@@ -392,11 +382,8 @@
 
     def get_bytes(self, key):
         """Return a bytes representation or raise a KeyError."""
-        f = open(os.path.join(self._path, self._lookup(key)), 'rb')
-        try:
+        with open(os.path.join(self._path, self._lookup(key)), 'rb') as f:
             return f.read().replace(linesep, b'\n')
-        finally:
-            f.close()
 
     def get_file(self, key):
         """Return a file-like representation or raise a KeyError."""
@@ -508,16 +495,12 @@
         path = os.path.join(self._path, 'tmp', uniq)
         try:
             os.stat(path)
-        except OSError as e:
-            if e.errno == errno.ENOENT:
-                Maildir._count += 1
-                try:
-                    return _create_carefully(path)
-                except OSError as e:
-                    if e.errno != errno.EEXIST:
-                        raise
-            else:
-                raise
+        except FileNotFoundError:
+            Maildir._count += 1
+            try:
+                return _create_carefully(path)
+            except FileExistsError:
+                pass
 
         # Fall through to here if stat succeeded or open raised EEXIST.
         raise ExternalClashError('Name clash prevented file creation: %s' %
@@ -576,7 +559,7 @@
     def next(self):
         """Return the next message in a one-time iteration."""
         if not hasattr(self, '_onetime_keys'):
-            self._onetime_keys = iter(self.keys())
+            self._onetime_keys = self.iterkeys()
         while True:
             try:
                 return self[next(self._onetime_keys)]
@@ -594,7 +577,7 @@
         Mailbox.__init__(self, path, factory, create)
         try:
             f = open(self._path, 'rb+')
-        except IOError as e:
+        except OSError as e:
             if e.errno == errno.ENOENT:
                 if create:
                     f = open(self._path, 'wb+')
@@ -637,8 +620,7 @@
     def iterkeys(self):
         """Return an iterator over keys."""
         self._lookup()
-        for key in self._toc.keys():
-            yield key
+        yield from self._toc.keys()
 
     def __contains__(self, key):
         """Return True if the keyed message exists, False otherwise."""
@@ -716,13 +698,9 @@
         os.chmod(new_file.name, mode)
         try:
             os.rename(new_file.name, self._path)
-        except OSError as e:
-            if e.errno == errno.EEXIST or \
-              (os.name == 'os2' and e.errno == errno.EACCES):
-                os.remove(self._path)
-                os.rename(new_file.name, self._path)
-            else:
-                raise
+        except FileExistsError:
+            os.remove(self._path)
+            os.rename(new_file.name, self._path)
         self._file = open(self._path, 'rb+')
         self._toc = new_toc
         self._pending = False
@@ -999,7 +977,7 @@
         path = os.path.join(self._path, str(key))
         try:
             f = open(path, 'rb+')
-        except IOError as e:
+        except OSError as e:
             if e.errno == errno.ENOENT:
                 raise KeyError('No message with key: %s' % key)
             else:
@@ -1013,7 +991,7 @@
         path = os.path.join(self._path, str(key))
         try:
             f = open(path, 'rb+')
-        except IOError as e:
+        except OSError as e:
             if e.errno == errno.ENOENT:
                 raise KeyError('No message with key: %s' % key)
             else:
@@ -1039,12 +1017,12 @@
                 f = open(os.path.join(self._path, str(key)), 'rb+')
             else:
                 f = open(os.path.join(self._path, str(key)), 'rb')
-        except IOError as e:
+        except OSError as e:
             if e.errno == errno.ENOENT:
                 raise KeyError('No message with key: %s' % key)
             else:
                 raise
-        try:
+        with f:
             if self._locked:
                 _lock_file(f)
             try:
@@ -1052,8 +1030,6 @@
             finally:
                 if self._locked:
                     _unlock_file(f)
-        finally:
-            f.close()
         for name, key_list in self.get_sequences().items():
             if key in key_list:
                 msg.add_sequence(name)
@@ -1066,12 +1042,12 @@
                 f = open(os.path.join(self._path, str(key)), 'rb+')
             else:
                 f = open(os.path.join(self._path, str(key)), 'rb')
-        except IOError as e:
+        except OSError as e:
             if e.errno == errno.ENOENT:
                 raise KeyError('No message with key: %s' % key)
             else:
                 raise
-        try:
+        with f:
             if self._locked:
                 _lock_file(f)
             try:
@@ -1079,14 +1055,12 @@
             finally:
                 if self._locked:
                     _unlock_file(f)
-        finally:
-            f.close()
 
     def get_file(self, key):
         """Return a file-like representation or raise a KeyError."""
         try:
             f = open(os.path.join(self._path, str(key)), 'rb')
-        except IOError as e:
+        except OSError as e:
             if e.errno == errno.ENOENT:
                 raise KeyError('No message with key: %s' % key)
             else:
@@ -1104,7 +1078,7 @@
 
     def __len__(self):
         """Return a count of messages in the mailbox."""
-        return len(list(self.keys()))
+        return len(list(self.iterkeys()))
 
     def lock(self):
         """Lock the mailbox."""
@@ -1218,7 +1192,7 @@
         sequences = self.get_sequences()
         prev = 0
         changes = []
-        for key in self.keys():
+        for key in self.iterkeys():
             if key - 1 != prev:
                 changes.append((key, prev + 1))
                 if hasattr(os, 'link'):
@@ -2006,7 +1980,7 @@
         return result
 
     def __enter__(self):
-        """Context manager protocol support."""
+        """Context management protocol support."""
         return self
 
     def __exit__(self, *exc):
@@ -2079,7 +2053,7 @@
         if fcntl:
             try:
                 fcntl.lockf(f, fcntl.LOCK_EX | fcntl.LOCK_NB)
-            except IOError as e:
+            except OSError as e:
                 if e.errno in (errno.EAGAIN, errno.EACCES, errno.EROFS):
                     raise ExternalClashError('lockf: lock unavailable: %s' %
                                              f.name)
@@ -2089,7 +2063,7 @@
             try:
                 pre_lock = _create_temporary(f.name + '.lock')
                 pre_lock.close()
-            except IOError as e:
+            except OSError as e:
                 if e.errno in (errno.EACCES, errno.EROFS):
                     return  # Without write access, just skip dotlocking.
                 else:
@@ -2102,14 +2076,10 @@
                 else:
                     os.rename(pre_lock.name, f.name + '.lock')
                     dotlock_done = True
-            except OSError as e:
-                if e.errno == errno.EEXIST or \
-                  (os.name == 'os2' and e.errno == errno.EACCES):
-                    os.remove(pre_lock.name)
-                    raise ExternalClashError('dot lock unavailable: %s' %
-                                             f.name)
-                else:
-                    raise
+            except FileExistsError:
+                os.remove(pre_lock.name)
+                raise ExternalClashError('dot lock unavailable: %s' %
+                                         f.name)
     except:
         if fcntl:
             fcntl.lockf(f, fcntl.LOCK_UN)
diff --git a/Lib/mailcap.py b/Lib/mailcap.py
index 0c0b19c..97e3035 100644
--- a/Lib/mailcap.py
+++ b/Lib/mailcap.py
@@ -20,7 +20,7 @@
     for mailcap in listmailcapfiles():
         try:
             fp = open(mailcap, 'r')
-        except IOError:
+        except OSError:
             continue
         with fp:
             morecaps = readmailcapfile(fp)
diff --git a/Lib/mimetypes.py b/Lib/mimetypes.py
index cdebf7a..b98c874 100644
--- a/Lib/mimetypes.py
+++ b/Lib/mimetypes.py
@@ -361,7 +361,7 @@
 def read_mime_types(file):
     try:
         f = open(file)
-    except IOError:
+    except OSError:
         return None
     with f:
         db = MimeTypes()
diff --git a/Lib/modulefinder.py b/Lib/modulefinder.py
index 264b0f0..b778e60 100644
--- a/Lib/modulefinder.py
+++ b/Lib/modulefinder.py
@@ -1,13 +1,17 @@
 """Find modules used by a script, using introspection."""
 
 import dis
-import imp
+import importlib._bootstrap
 import importlib.machinery
 import marshal
 import os
 import sys
 import types
 import struct
+import warnings
+with warnings.catch_warnings():
+    warnings.simplefilter('ignore', PendingDeprecationWarning)
+    import imp
 
 # XXX Clean up once str8's cstor matches bytes.
 LOAD_CONST = bytes([dis.opname.index('LOAD_CONST')])
@@ -229,7 +233,7 @@
         for dir in m.__path__:
             try:
                 names = os.listdir(dir)
-            except os.error:
+            except OSError:
                 self.msg(2, "can't list directory", dir)
                 continue
             for name in names:
@@ -284,11 +288,12 @@
         if type == imp.PY_SOURCE:
             co = compile(fp.read()+'\n', pathname, 'exec')
         elif type == imp.PY_COMPILED:
-            if fp.read(4) != imp.get_magic():
-                self.msgout(2, "raise ImportError: Bad magic number", pathname)
-                raise ImportError("Bad magic number in %s" % pathname)
-            fp.read(8)  # Skip mtime and size.
-            co = marshal.load(fp)
+            try:
+                marshal_data = importlib._bootstrap._validate_bytecode_header(fp.read())
+            except ImportError as exc:
+                self.msgout(2, "raise ImportError: " + str(exc), pathname)
+                raise
+            co = marshal.loads(marshal_data)
         else:
             co = None
         m = self.add_module(fqname)
@@ -563,11 +568,12 @@
             if isinstance(consts[i], type(co)):
                 consts[i] = self.replace_paths_in_code(consts[i])
 
-        return types.CodeType(co.co_argcount, co.co_nlocals, co.co_stacksize,
-                         co.co_flags, co.co_code, tuple(consts), co.co_names,
-                         co.co_varnames, new_filename, co.co_name,
-                         co.co_firstlineno, co.co_lnotab,
-                         co.co_freevars, co.co_cellvars)
+        return types.CodeType(co.co_argcount, co.co_kwonlyargcount,
+                              co.co_nlocals, co.co_stacksize, co.co_flags,
+                              co.co_code, tuple(consts), co.co_names,
+                              co.co_varnames, new_filename, co.co_name,
+                              co.co_firstlineno, co.co_lnotab, co.co_freevars,
+                              co.co_cellvars)
 
 
 def test():
diff --git a/Lib/multiprocessing/__init__.py b/Lib/multiprocessing/__init__.py
index 1f3e67c..86df638 100644
--- a/Lib/multiprocessing/__init__.py
+++ b/Lib/multiprocessing/__init__.py
@@ -8,260 +8,31 @@
 # subpackage 'multiprocessing.dummy' has the same API but is a simple
 # wrapper for 'threading'.
 #
-# Try calling `multiprocessing.doc.main()` to read the html
-# documentation in a webbrowser.
-#
-#
 # Copyright (c) 2006-2008, R Oudkerk
 # Licensed to PSF under a Contributor Agreement.
 #
 
-__version__ = '0.70a1'
-
-__all__ = [
-    'Process', 'current_process', 'active_children', 'freeze_support',
-    'Manager', 'Pipe', 'cpu_count', 'log_to_stderr', 'get_logger',
-    'allow_connection_pickling', 'BufferTooShort', 'TimeoutError',
-    'Lock', 'RLock', 'Semaphore', 'BoundedSemaphore', 'Condition',
-    'Event', 'Barrier', 'Queue', 'SimpleQueue', 'JoinableQueue', 'Pool',
-    'Value', 'Array', 'RawValue', 'RawArray', 'SUBDEBUG', 'SUBWARNING',
-    ]
-
-__author__ = 'R. Oudkerk (r.m.oudkerk@gmail.com)'
-
-#
-# Imports
-#
-
-import os
 import sys
-
-from multiprocessing.process import Process, current_process, active_children
-from multiprocessing.util import SUBDEBUG, SUBWARNING
+from . import context
 
 #
-# Exceptions
+# Copy stuff from default context
 #
 
-class ProcessError(Exception):
-    pass
-
-class BufferTooShort(ProcessError):
-    pass
-
-class TimeoutError(ProcessError):
-    pass
-
-class AuthenticationError(ProcessError):
-    pass
-
-import _multiprocessing
+globals().update((name, getattr(context._default_context, name))
+                 for name in context._default_context.__all__)
+__all__ = context._default_context.__all__
 
 #
-# Definitions not depending on native semaphores
+# XXX These should not really be documented or public.
 #
 
-def Manager():
-    '''
-    Returns a manager associated with a running server process
-
-    The managers methods such as `Lock()`, `Condition()` and `Queue()`
-    can be used to create shared objects.
-    '''
-    from multiprocessing.managers import SyncManager
-    m = SyncManager()
-    m.start()
-    return m
-
-def Pipe(duplex=True):
-    '''
-    Returns two connection object connected by a pipe
-    '''
-    from multiprocessing.connection import Pipe
-    return Pipe(duplex)
-
-def cpu_count():
-    '''
-    Returns the number of CPUs in the system
-    '''
-    if sys.platform == 'win32':
-        try:
-            num = int(os.environ['NUMBER_OF_PROCESSORS'])
-        except (ValueError, KeyError):
-            num = 0
-    elif 'bsd' in sys.platform or sys.platform == 'darwin':
-        comm = '/sbin/sysctl -n hw.ncpu'
-        if sys.platform == 'darwin':
-            comm = '/usr' + comm
-        try:
-            with os.popen(comm) as p:
-                num = int(p.read())
-        except ValueError:
-            num = 0
-    else:
-        try:
-            num = os.sysconf('SC_NPROCESSORS_ONLN')
-        except (ValueError, OSError, AttributeError):
-            num = 0
-
-    if num >= 1:
-        return num
-    else:
-        raise NotImplementedError('cannot determine number of cpus')
-
-def freeze_support():
-    '''
-    Check whether this is a fake forked process in a frozen executable.
-    If so then run code specified by commandline and exit.
-    '''
-    if sys.platform == 'win32' and getattr(sys, 'frozen', False):
-        from multiprocessing.forking import freeze_support
-        freeze_support()
-
-def get_logger():
-    '''
-    Return package logger -- if it does not already exist then it is created
-    '''
-    from multiprocessing.util import get_logger
-    return get_logger()
-
-def log_to_stderr(level=None):
-    '''
-    Turn on logging and add a handler which prints to stderr
-    '''
-    from multiprocessing.util import log_to_stderr
-    return log_to_stderr(level)
-
-def allow_connection_pickling():
-    '''
-    Install support for sending connections and sockets between processes
-    '''
-    # This is undocumented.  In previous versions of multiprocessing
-    # its only effect was to make socket objects inheritable on Windows.
-    import multiprocessing.connection
+SUBDEBUG = 5
+SUBWARNING = 25
 
 #
-# Definitions depending on native semaphores
+# Alias for main module -- will be reset by bootstrapping child processes
 #
 
-def Lock():
-    '''
-    Returns a non-recursive lock object
-    '''
-    from multiprocessing.synchronize import Lock
-    return Lock()
-
-def RLock():
-    '''
-    Returns a recursive lock object
-    '''
-    from multiprocessing.synchronize import RLock
-    return RLock()
-
-def Condition(lock=None):
-    '''
-    Returns a condition object
-    '''
-    from multiprocessing.synchronize import Condition
-    return Condition(lock)
-
-def Semaphore(value=1):
-    '''
-    Returns a semaphore object
-    '''
-    from multiprocessing.synchronize import Semaphore
-    return Semaphore(value)
-
-def BoundedSemaphore(value=1):
-    '''
-    Returns a bounded semaphore object
-    '''
-    from multiprocessing.synchronize import BoundedSemaphore
-    return BoundedSemaphore(value)
-
-def Event():
-    '''
-    Returns an event object
-    '''
-    from multiprocessing.synchronize import Event
-    return Event()
-
-def Barrier(parties, action=None, timeout=None):
-    '''
-    Returns a barrier object
-    '''
-    from multiprocessing.synchronize import Barrier
-    return Barrier(parties, action, timeout)
-
-def Queue(maxsize=0):
-    '''
-    Returns a queue object
-    '''
-    from multiprocessing.queues import Queue
-    return Queue(maxsize)
-
-def JoinableQueue(maxsize=0):
-    '''
-    Returns a queue object
-    '''
-    from multiprocessing.queues import JoinableQueue
-    return JoinableQueue(maxsize)
-
-def SimpleQueue():
-    '''
-    Returns a queue object
-    '''
-    from multiprocessing.queues import SimpleQueue
-    return SimpleQueue()
-
-def Pool(processes=None, initializer=None, initargs=(), maxtasksperchild=None):
-    '''
-    Returns a process pool object
-    '''
-    from multiprocessing.pool import Pool
-    return Pool(processes, initializer, initargs, maxtasksperchild)
-
-def RawValue(typecode_or_type, *args):
-    '''
-    Returns a shared object
-    '''
-    from multiprocessing.sharedctypes import RawValue
-    return RawValue(typecode_or_type, *args)
-
-def RawArray(typecode_or_type, size_or_initializer):
-    '''
-    Returns a shared array
-    '''
-    from multiprocessing.sharedctypes import RawArray
-    return RawArray(typecode_or_type, size_or_initializer)
-
-def Value(typecode_or_type, *args, lock=True):
-    '''
-    Returns a synchronized shared object
-    '''
-    from multiprocessing.sharedctypes import Value
-    return Value(typecode_or_type, *args, lock=lock)
-
-def Array(typecode_or_type, size_or_initializer, *, lock=True):
-    '''
-    Returns a synchronized shared array
-    '''
-    from multiprocessing.sharedctypes import Array
-    return Array(typecode_or_type, size_or_initializer, lock=lock)
-
-#
-#
-#
-
-if sys.platform == 'win32':
-
-    def set_executable(executable):
-        '''
-        Sets the path to a python.exe or pythonw.exe binary used to run
-        child processes on Windows instead of sys.executable.
-        Useful for people embedding Python.
-        '''
-        from multiprocessing.forking import set_executable
-        set_executable(executable)
-
-    __all__ += ['set_executable']
+if '__main__' in sys.modules:
+    sys.modules['__mp_main__'] = sys.modules['__main__']
diff --git a/Lib/multiprocessing/connection.py b/Lib/multiprocessing/connection.py
index 22589d0..87117d9 100644
--- a/Lib/multiprocessing/connection.py
+++ b/Lib/multiprocessing/connection.py
@@ -12,22 +12,23 @@
 import io
 import os
 import sys
-import pickle
-import select
 import socket
 import struct
-import errno
 import time
 import tempfile
 import itertools
 
 import _multiprocessing
-from multiprocessing import current_process, AuthenticationError, BufferTooShort
-from multiprocessing.util import get_temp_dir, Finalize, sub_debug, debug
-from multiprocessing.forking import ForkingPickler
+
+from . import reduction
+from . import util
+
+from . import AuthenticationError, BufferTooShort
+from .reduction import ForkingPickler
+
 try:
     import _winapi
-    from _winapi import WAIT_OBJECT_0, WAIT_TIMEOUT, INFINITE
+    from _winapi import WAIT_OBJECT_0, WAIT_ABANDONED_0, WAIT_TIMEOUT, INFINITE
 except ImportError:
     if sys.platform == 'win32':
         raise
@@ -72,10 +73,10 @@
     if family == 'AF_INET':
         return ('localhost', 0)
     elif family == 'AF_UNIX':
-        return tempfile.mktemp(prefix='listener-', dir=get_temp_dir())
+        return tempfile.mktemp(prefix='listener-', dir=util.get_temp_dir())
     elif family == 'AF_PIPE':
         return tempfile.mktemp(prefix=r'\\.\pipe\pyc-%d-%d-' %
-                               (os.getpid(), next(_mmap_counter)))
+                               (os.getpid(), next(_mmap_counter)), dir="")
     else:
         raise ValueError('unrecognized family')
 
@@ -132,22 +133,22 @@
 
     def _check_closed(self):
         if self._handle is None:
-            raise IOError("handle is closed")
+            raise OSError("handle is closed")
 
     def _check_readable(self):
         if not self._readable:
-            raise IOError("connection is write-only")
+            raise OSError("connection is write-only")
 
     def _check_writable(self):
         if not self._writable:
-            raise IOError("connection is read-only")
+            raise OSError("connection is read-only")
 
     def _bad_message_length(self):
         if self._writable:
             self._readable = False
         else:
             self.close()
-        raise IOError("bad message length")
+        raise OSError("bad message length")
 
     @property
     def closed(self):
@@ -202,9 +203,7 @@
         """Send a (picklable) object"""
         self._check_closed()
         self._check_writable()
-        buf = io.BytesIO()
-        ForkingPickler(buf, pickle.HIGHEST_PROTOCOL).dump(obj)
-        self._send_bytes(buf.getbuffer())
+        self._send_bytes(ForkingPickler.dumps(obj))
 
     def recv_bytes(self, maxlength=None):
         """
@@ -221,7 +220,7 @@
 
     def recv_bytes_into(self, buf, offset=0):
         """
-        Receive bytes data into a writeable buffer-like object.
+        Receive bytes data into a writeable bytes-like object.
         Return the number of bytes read.
         """
         self._check_closed()
@@ -249,7 +248,7 @@
         self._check_closed()
         self._check_readable()
         buf = self._recv_bytes()
-        return pickle.loads(buf.getbuffer())
+        return ForkingPickler.loads(buf.getbuffer())
 
     def poll(self, timeout=0.0):
         """Whether there is any input available to be read"""
@@ -317,7 +316,7 @@
                             return f
                         elif err == _winapi.ERROR_MORE_DATA:
                             return self._get_more_data(ov, maxsize)
-                except IOError as e:
+                except OSError as e:
                     if e.winerror == _winapi.ERROR_BROKEN_PIPE:
                         raise EOFError
                     else:
@@ -389,7 +388,7 @@
                 if remaining == size:
                     raise EOFError
                 else:
-                    raise IOError("got end of file during message")
+                    raise OSError("got end of file during message")
             buf.write(chunk)
             remaining -= n
         return buf
@@ -459,7 +458,7 @@
         Returns a `Connection` object.
         '''
         if self._listener is None:
-            raise IOError('listener is closed')
+            raise OSError('listener is closed')
         c = self._listener.accept()
         if self._authkey:
             deliver_challenge(c, self._authkey)
@@ -545,7 +544,9 @@
             _winapi.FILE_FLAG_FIRST_PIPE_INSTANCE,
             _winapi.PIPE_TYPE_MESSAGE | _winapi.PIPE_READMODE_MESSAGE |
             _winapi.PIPE_WAIT,
-            1, obsize, ibsize, _winapi.NMPWAIT_WAIT_FOREVER, _winapi.NULL
+            1, obsize, ibsize, _winapi.NMPWAIT_WAIT_FOREVER,
+            # default security descriptor: the handle cannot be inherited
+            _winapi.NULL
             )
         h2 = _winapi.CreateFile(
             address, access, 0, _winapi.NULL, _winapi.OPEN_EXISTING,
@@ -590,7 +591,7 @@
         self._last_accepted = None
 
         if family == 'AF_UNIX':
-            self._unlink = Finalize(
+            self._unlink = util.Finalize(
                 self, os.unlink, args=(address,), exitpriority=0
                 )
         else:
@@ -638,8 +639,8 @@
             self._handle_queue = [self._new_handle(first=True)]
 
             self._last_accepted = None
-            sub_debug('listener created with address=%r', self._address)
-            self.close = Finalize(
+            util.sub_debug('listener created with address=%r', self._address)
+            self.close = util.Finalize(
                 self, PipeListener._finalize_pipe_listener,
                 args=(self._handle_queue, self._address), exitpriority=0
                 )
@@ -681,7 +682,7 @@
 
         @staticmethod
         def _finalize_pipe_listener(queue, address):
-            sub_debug('closing listener with address=%r', address)
+            util.sub_debug('closing listener with address=%r', address)
             for handle in queue:
                 _winapi.CloseHandle(handle)
 
@@ -698,7 +699,7 @@
                     0, _winapi.NULL, _winapi.OPEN_EXISTING,
                     _winapi.FILE_FLAG_OVERLAPPED, _winapi.NULL
                     )
-            except WindowsError as e:
+            except OSError as e:
                 if e.winerror not in (_winapi.ERROR_SEM_TIMEOUT,
                                       _winapi.ERROR_PIPE_BUSY) or _check_timeout(t):
                     raise
@@ -727,7 +728,7 @@
     assert isinstance(authkey, bytes)
     message = os.urandom(MESSAGE_LENGTH)
     connection.send_bytes(CHALLENGE + message)
-    digest = hmac.new(authkey, message).digest()
+    digest = hmac.new(authkey, message, 'md5').digest()
     response = connection.recv_bytes(256)        # reject large message
     if response == digest:
         connection.send_bytes(WELCOME)
@@ -741,7 +742,7 @@
     message = connection.recv_bytes(256)         # reject large message
     assert message[:len(CHALLENGE)] == CHALLENGE, 'message = %r' % message
     message = message[len(CHALLENGE):]
-    digest = hmac.new(authkey, message).digest()
+    digest = hmac.new(authkey, message, 'md5').digest()
     connection.send_bytes(digest)
     response = connection.recv_bytes(256)        # reject large message
     if response != WELCOME:
@@ -884,28 +885,15 @@
 
 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]
+    import selectors
 
+    # poll/select have the advantage of not requiring any extra file
+    # descriptor, contrarily to epoll/kqueue (also, they require a single
+    # syscall).
+    if hasattr(selectors, 'PollSelector'):
+        _WaitSelector = selectors.PollSelector
+    else:
+        _WaitSelector = selectors.SelectSelector
 
     def wait(object_list, timeout=None):
         '''
@@ -913,34 +901,54 @@
 
         Returns list of those objects in object_list which are ready/readable.
         '''
-        if timeout is not None:
-            if timeout <= 0:
-                return _poll(object_list, 0)
-            else:
-                deadline = time.time() + timeout
-        while True:
-            try:
-                return _poll(object_list, timeout)
-            except OSError as e:
-                if e.errno != errno.EINTR:
-                    raise
+        with _WaitSelector() as selector:
+            for obj in object_list:
+                selector.register(obj, selectors.EVENT_READ)
+
             if timeout is not None:
-                timeout = deadline - time.time()
+                deadline = time.time() + timeout
+
+            while True:
+                ready = selector.select(timeout)
+                if ready:
+                    return [key.fileobj for (key, events) in ready]
+                else:
+                    if timeout is not None:
+                        timeout = deadline - time.time()
+                        if timeout < 0:
+                            return ready
 
 #
 # Make connection and socket objects sharable if possible
 #
 
 if sys.platform == 'win32':
-    from . import reduction
-    ForkingPickler.register(socket.socket, reduction.reduce_socket)
-    ForkingPickler.register(Connection, reduction.reduce_connection)
-    ForkingPickler.register(PipeConnection, reduction.reduce_pipe_connection)
+    def reduce_connection(conn):
+        handle = conn.fileno()
+        with socket.fromfd(handle, socket.AF_INET, socket.SOCK_STREAM) as s:
+            from . import resource_sharer
+            ds = resource_sharer.DupSocket(s)
+            return rebuild_connection, (ds, conn.readable, conn.writable)
+    def rebuild_connection(ds, readable, writable):
+        sock = ds.detach()
+        return Connection(sock.detach(), readable, writable)
+    reduction.register(Connection, reduce_connection)
+
+    def reduce_pipe_connection(conn):
+        access = ((_winapi.FILE_GENERIC_READ if conn.readable else 0) |
+                  (_winapi.FILE_GENERIC_WRITE if conn.writable else 0))
+        dh = reduction.DupHandle(conn.fileno(), access)
+        return rebuild_pipe_connection, (dh, conn.readable, conn.writable)
+    def rebuild_pipe_connection(dh, readable, writable):
+        handle = dh.detach()
+        return PipeConnection(handle, readable, writable)
+    reduction.register(PipeConnection, reduce_pipe_connection)
+
 else:
-    try:
-        from . import reduction
-    except ImportError:
-        pass
-    else:
-        ForkingPickler.register(socket.socket, reduction.reduce_socket)
-        ForkingPickler.register(Connection, reduction.reduce_connection)
+    def reduce_connection(conn):
+        df = reduction.DupFd(conn.fileno())
+        return rebuild_connection, (df, conn.readable, conn.writable)
+    def rebuild_connection(df, readable, writable):
+        fd = df.detach()
+        return Connection(fd, readable, writable)
+    reduction.register(Connection, reduce_connection)
diff --git a/Lib/multiprocessing/context.py b/Lib/multiprocessing/context.py
new file mode 100644
index 0000000..63849f9
--- /dev/null
+++ b/Lib/multiprocessing/context.py
@@ -0,0 +1,348 @@
+import os
+import sys
+import threading
+
+from . import process
+
+__all__ = []            # things are copied from here to __init__.py
+
+#
+# Exceptions
+#
+
+class ProcessError(Exception):
+    pass
+
+class BufferTooShort(ProcessError):
+    pass
+
+class TimeoutError(ProcessError):
+    pass
+
+class AuthenticationError(ProcessError):
+    pass
+
+#
+# Base type for contexts
+#
+
+class BaseContext(object):
+
+    ProcessError = ProcessError
+    BufferTooShort = BufferTooShort
+    TimeoutError = TimeoutError
+    AuthenticationError = AuthenticationError
+
+    current_process = staticmethod(process.current_process)
+    active_children = staticmethod(process.active_children)
+
+    def cpu_count(self):
+        '''Returns the number of CPUs in the system'''
+        num = os.cpu_count()
+        if num is None:
+            raise NotImplementedError('cannot determine number of cpus')
+        else:
+            return num
+
+    def Manager(self):
+        '''Returns a manager associated with a running server process
+
+        The managers methods such as `Lock()`, `Condition()` and `Queue()`
+        can be used to create shared objects.
+        '''
+        from .managers import SyncManager
+        m = SyncManager(ctx=self.get_context())
+        m.start()
+        return m
+
+    def Pipe(self, duplex=True):
+        '''Returns two connection object connected by a pipe'''
+        from .connection import Pipe
+        return Pipe(duplex)
+
+    def Lock(self):
+        '''Returns a non-recursive lock object'''
+        from .synchronize import Lock
+        return Lock(ctx=self.get_context())
+
+    def RLock(self):
+        '''Returns a recursive lock object'''
+        from .synchronize import RLock
+        return RLock(ctx=self.get_context())
+
+    def Condition(self, lock=None):
+        '''Returns a condition object'''
+        from .synchronize import Condition
+        return Condition(lock, ctx=self.get_context())
+
+    def Semaphore(self, value=1):
+        '''Returns a semaphore object'''
+        from .synchronize import Semaphore
+        return Semaphore(value, ctx=self.get_context())
+
+    def BoundedSemaphore(self, value=1):
+        '''Returns a bounded semaphore object'''
+        from .synchronize import BoundedSemaphore
+        return BoundedSemaphore(value, ctx=self.get_context())
+
+    def Event(self):
+        '''Returns an event object'''
+        from .synchronize import Event
+        return Event(ctx=self.get_context())
+
+    def Barrier(self, parties, action=None, timeout=None):
+        '''Returns a barrier object'''
+        from .synchronize import Barrier
+        return Barrier(parties, action, timeout, ctx=self.get_context())
+
+    def Queue(self, maxsize=0):
+        '''Returns a queue object'''
+        from .queues import Queue
+        return Queue(maxsize, ctx=self.get_context())
+
+    def JoinableQueue(self, maxsize=0):
+        '''Returns a queue object'''
+        from .queues import JoinableQueue
+        return JoinableQueue(maxsize, ctx=self.get_context())
+
+    def SimpleQueue(self):
+        '''Returns a queue object'''
+        from .queues import SimpleQueue
+        return SimpleQueue(ctx=self.get_context())
+
+    def Pool(self, processes=None, initializer=None, initargs=(),
+             maxtasksperchild=None):
+        '''Returns a process pool object'''
+        from .pool import Pool
+        return Pool(processes, initializer, initargs, maxtasksperchild,
+                    context=self.get_context())
+
+    def RawValue(self, typecode_or_type, *args):
+        '''Returns a shared object'''
+        from .sharedctypes import RawValue
+        return RawValue(typecode_or_type, *args)
+
+    def RawArray(self, typecode_or_type, size_or_initializer):
+        '''Returns a shared array'''
+        from .sharedctypes import RawArray
+        return RawArray(typecode_or_type, size_or_initializer)
+
+    def Value(self, typecode_or_type, *args, lock=True):
+        '''Returns a synchronized shared object'''
+        from .sharedctypes import Value
+        return Value(typecode_or_type, *args, lock=lock,
+                     ctx=self.get_context())
+
+    def Array(self, typecode_or_type, size_or_initializer, *, lock=True):
+        '''Returns a synchronized shared array'''
+        from .sharedctypes import Array
+        return Array(typecode_or_type, size_or_initializer, lock=lock,
+                     ctx=self.get_context())
+
+    def freeze_support(self):
+        '''Check whether this is a fake forked process in a frozen executable.
+        If so then run code specified by commandline and exit.
+        '''
+        if sys.platform == 'win32' and getattr(sys, 'frozen', False):
+            from .spawn import freeze_support
+            freeze_support()
+
+    def get_logger(self):
+        '''Return package logger -- if it does not already exist then
+        it is created.
+        '''
+        from .util import get_logger
+        return get_logger()
+
+    def log_to_stderr(self, level=None):
+        '''Turn on logging and add a handler which prints to stderr'''
+        from .util import log_to_stderr
+        return log_to_stderr(level)
+
+    def allow_connection_pickling(self):
+        '''Install support for sending connections and sockets
+        between processes
+        '''
+        # This is undocumented.  In previous versions of multiprocessing
+        # its only effect was to make socket objects inheritable on Windows.
+        from . import connection
+
+    def set_executable(self, executable):
+        '''Sets the path to a python.exe or pythonw.exe binary used to run
+        child processes instead of sys.executable when using the 'spawn'
+        start method.  Useful for people embedding Python.
+        '''
+        from .spawn import set_executable
+        set_executable(executable)
+
+    def set_forkserver_preload(self, module_names):
+        '''Set list of module names to try to load in forkserver process.
+        This is really just a hint.
+        '''
+        from .forkserver import set_forkserver_preload
+        set_forkserver_preload(module_names)
+
+    def get_context(self, method=None):
+        if method is None:
+            return self
+        try:
+            ctx = _concrete_contexts[method]
+        except KeyError:
+            raise ValueError('cannot find context for %r' % method)
+        ctx._check_available()
+        return ctx
+
+    def get_start_method(self, allow_none=False):
+        return self._name
+
+    def set_start_method(self, method=None):
+        raise ValueError('cannot set start method of concrete context')
+
+    def _check_available(self):
+        pass
+
+#
+# Type of default context -- underlying context can be set at most once
+#
+
+class Process(process.BaseProcess):
+    _start_method = None
+    @staticmethod
+    def _Popen(process_obj):
+        return _default_context.get_context().Process._Popen(process_obj)
+
+class DefaultContext(BaseContext):
+    Process = Process
+
+    def __init__(self, context):
+        self._default_context = context
+        self._actual_context = None
+
+    def get_context(self, method=None):
+        if method is None:
+            if self._actual_context is None:
+                self._actual_context = self._default_context
+            return self._actual_context
+        else:
+            return super().get_context(method)
+
+    def set_start_method(self, method, force=False):
+        if self._actual_context is not None and not force:
+            raise RuntimeError('context has already been set')
+        if method is None and force:
+            self._actual_context = None
+            return
+        self._actual_context = self.get_context(method)
+
+    def get_start_method(self, allow_none=False):
+        if self._actual_context is None:
+            if allow_none:
+                return None
+            self._actual_context = self._default_context
+        return self._actual_context._name
+
+    def get_all_start_methods(self):
+        if sys.platform == 'win32':
+            return ['spawn']
+        else:
+            from . import reduction
+            if reduction.HAVE_SEND_HANDLE:
+                return ['fork', 'spawn', 'forkserver']
+            else:
+                return ['fork', 'spawn']
+
+DefaultContext.__all__ = list(x for x in dir(DefaultContext) if x[0] != '_')
+
+#
+# Context types for fixed start method
+#
+
+if sys.platform != 'win32':
+
+    class ForkProcess(process.BaseProcess):
+        _start_method = 'fork'
+        @staticmethod
+        def _Popen(process_obj):
+            from .popen_fork import Popen
+            return Popen(process_obj)
+
+    class SpawnProcess(process.BaseProcess):
+        _start_method = 'spawn'
+        @staticmethod
+        def _Popen(process_obj):
+            from .popen_spawn_posix import Popen
+            return Popen(process_obj)
+
+    class ForkServerProcess(process.BaseProcess):
+        _start_method = 'forkserver'
+        @staticmethod
+        def _Popen(process_obj):
+            from .popen_forkserver import Popen
+            return Popen(process_obj)
+
+    class ForkContext(BaseContext):
+        _name = 'fork'
+        Process = ForkProcess
+
+    class SpawnContext(BaseContext):
+        _name = 'spawn'
+        Process = SpawnProcess
+
+    class ForkServerContext(BaseContext):
+        _name = 'forkserver'
+        Process = ForkServerProcess
+        def _check_available(self):
+            from . import reduction
+            if not reduction.HAVE_SEND_HANDLE:
+                raise ValueError('forkserver start method not available')
+
+    _concrete_contexts = {
+        'fork': ForkContext(),
+        'spawn': SpawnContext(),
+        'forkserver': ForkServerContext(),
+    }
+    _default_context = DefaultContext(_concrete_contexts['fork'])
+
+else:
+
+    class SpawnProcess(process.BaseProcess):
+        _start_method = 'spawn'
+        @staticmethod
+        def _Popen(process_obj):
+            from .popen_spawn_win32 import Popen
+            return Popen(process_obj)
+
+    class SpawnContext(BaseContext):
+        _name = 'spawn'
+        Process = SpawnProcess
+
+    _concrete_contexts = {
+        'spawn': SpawnContext(),
+    }
+    _default_context = DefaultContext(_concrete_contexts['spawn'])
+
+#
+# Force the start method
+#
+
+def _force_start_method(method):
+    _default_context._actual_context = _concrete_contexts[method]
+
+#
+# Check that the current thread is spawning a child process
+#
+
+_tls = threading.local()
+
+def get_spawning_popen():
+    return getattr(_tls, 'spawning_popen', None)
+
+def set_spawning_popen(popen):
+    _tls.spawning_popen = popen
+
+def assert_spawning(obj):
+    if get_spawning_popen() is None:
+        raise RuntimeError(
+            '%s objects should only be shared between processes'
+            ' through inheritance' % type(obj).__name__
+            )
diff --git a/Lib/multiprocessing/dummy/__init__.py b/Lib/multiprocessing/dummy/__init__.py
index e31fc61..135db7f 100644
--- a/Lib/multiprocessing/dummy/__init__.py
+++ b/Lib/multiprocessing/dummy/__init__.py
@@ -4,32 +4,7 @@
 # multiprocessing/dummy/__init__.py
 #
 # Copyright (c) 2006-2008, R Oudkerk
-# 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 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.
+# Licensed to PSF under a Contributor Agreement.
 #
 
 __all__ = [
@@ -47,7 +22,7 @@
 import weakref
 import array
 
-from multiprocessing.dummy.connection import Pipe
+from .connection import Pipe
 from threading import Lock, RLock, Semaphore, BoundedSemaphore
 from threading import Event, Condition, Barrier
 from queue import Queue
@@ -129,7 +104,7 @@
         self._value = value
     value = property(_get, _set)
     def __repr__(self):
-        return '<%r(%r, %r)>'%(type(self).__name__,self._typecode,self._value)
+        return '<%s(%r, %r)>'%(type(self).__name__,self._typecode,self._value)
 
 def Manager():
     return sys.modules[__name__]
@@ -138,7 +113,7 @@
     pass
 
 def Pool(processes=None, initializer=None, initargs=()):
-    from multiprocessing.pool import ThreadPool
+    from ..pool import ThreadPool
     return ThreadPool(processes, initializer, initargs)
 
 JoinableQueue = Queue
diff --git a/Lib/multiprocessing/dummy/connection.py b/Lib/multiprocessing/dummy/connection.py
index 874ec8e..694ef96 100644
--- a/Lib/multiprocessing/dummy/connection.py
+++ b/Lib/multiprocessing/dummy/connection.py
@@ -4,32 +4,7 @@
 # multiprocessing/dummy/connection.py
 #
 # Copyright (c) 2006-2008, R Oudkerk
-# 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 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.
+# Licensed to PSF under a Contributor Agreement.
 #
 
 __all__ = [ 'Client', 'Listener', 'Pipe' ]
diff --git a/Lib/multiprocessing/forking.py b/Lib/multiprocessing/forking.py
deleted file mode 100644
index 449978a..0000000
--- a/Lib/multiprocessing/forking.py
+++ /dev/null
@@ -1,474 +0,0 @@
-#
-# Module for starting a process object using os.fork() or CreateProcess()
-#
-# multiprocessing/forking.py
-#
-# Copyright (c) 2006-2008, R Oudkerk
-# Licensed to PSF under a Contributor Agreement.
-#
-
-import os
-import sys
-import signal
-import errno
-
-from multiprocessing import util, process
-
-__all__ = ['Popen', 'assert_spawning', 'duplicate', 'close', 'ForkingPickler']
-
-#
-# Check that the current thread is spawning a child process
-#
-
-def assert_spawning(self):
-    if not Popen.thread_is_spawning():
-        raise RuntimeError(
-            '%s objects should only be shared between processes'
-            ' through inheritance' % type(self).__name__
-            )
-
-#
-# Try making some callable types picklable
-#
-
-from pickle import Pickler
-from copyreg import dispatch_table
-
-class ForkingPickler(Pickler):
-    _extra_reducers = {}
-    def __init__(self, *args):
-        Pickler.__init__(self, *args)
-        self.dispatch_table = dispatch_table.copy()
-        self.dispatch_table.update(self._extra_reducers)
-    @classmethod
-    def register(cls, type, reduce):
-        cls._extra_reducers[type] = reduce
-
-def _reduce_method(m):
-    if m.__self__ is None:
-        return getattr, (m.__class__, m.__func__.__name__)
-    else:
-        return getattr, (m.__self__, m.__func__.__name__)
-class _C:
-    def f(self):
-        pass
-ForkingPickler.register(type(_C().f), _reduce_method)
-
-
-def _reduce_method_descriptor(m):
-    return getattr, (m.__objclass__, m.__name__)
-ForkingPickler.register(type(list.append), _reduce_method_descriptor)
-ForkingPickler.register(type(int.__add__), _reduce_method_descriptor)
-
-try:
-    from functools import partial
-except ImportError:
-    pass
-else:
-    def _reduce_partial(p):
-        return _rebuild_partial, (p.func, p.args, p.keywords or {})
-    def _rebuild_partial(func, args, keywords):
-        return partial(func, *args, **keywords)
-    ForkingPickler.register(partial, _reduce_partial)
-
-#
-# Unix
-#
-
-if sys.platform != 'win32':
-    duplicate = os.dup
-    close = os.close
-
-    #
-    # We define a Popen class similar to the one from subprocess, but
-    # whose constructor takes a process object as its argument.
-    #
-
-    class Popen(object):
-
-        def __init__(self, process_obj):
-            sys.stdout.flush()
-            sys.stderr.flush()
-            self.returncode = None
-
-            r, w = os.pipe()
-            self.sentinel = r
-
-            self.pid = os.fork()
-            if self.pid == 0:
-                os.close(r)
-                if 'random' in sys.modules:
-                    import random
-                    random.seed()
-                code = process_obj._bootstrap()
-                os._exit(code)
-
-            # `w` will be closed when the child exits, at which point `r`
-            # will become ready for reading (using e.g. select()).
-            os.close(w)
-            util.Finalize(self, os.close, (r,))
-
-        def poll(self, flag=os.WNOHANG):
-            if self.returncode is None:
-                while True:
-                    try:
-                        pid, sts = os.waitpid(self.pid, flag)
-                    except os.error as e:
-                        if e.errno == errno.EINTR:
-                            continue
-                        # Child process not yet created. See #1731717
-                        # e.errno == errno.ECHILD == 10
-                        return None
-                    else:
-                        break
-                if pid == self.pid:
-                    if os.WIFSIGNALED(sts):
-                        self.returncode = -os.WTERMSIG(sts)
-                    else:
-                        assert os.WIFEXITED(sts)
-                        self.returncode = os.WEXITSTATUS(sts)
-            return self.returncode
-
-        def wait(self, timeout=None):
-            if self.returncode is None:
-                if timeout is not None:
-                    from multiprocessing.connection import wait
-                    if not wait([self.sentinel], timeout):
-                        return None
-                # This shouldn't block if wait() returned successfully.
-                return self.poll(os.WNOHANG if timeout == 0.0 else 0)
-            return self.returncode
-
-        def terminate(self):
-            if self.returncode is None:
-                try:
-                    os.kill(self.pid, signal.SIGTERM)
-                except OSError:
-                    if self.wait(timeout=0.1) is None:
-                        raise
-
-        @staticmethod
-        def thread_is_spawning():
-            return False
-
-#
-# Windows
-#
-
-else:
-    import _thread
-    import msvcrt
-    import _winapi
-
-    from pickle import load, HIGHEST_PROTOCOL
-
-    def dump(obj, file, protocol=None):
-        ForkingPickler(file, protocol).dump(obj)
-
-    #
-    #
-    #
-
-    TERMINATE = 0x10000
-    WINEXE = (sys.platform == 'win32' and getattr(sys, 'frozen', False))
-    WINSERVICE = sys.executable.lower().endswith("pythonservice.exe")
-
-    close = _winapi.CloseHandle
-
-    #
-    # _python_exe is the assumed path to the python executable.
-    # People embedding Python want to modify it.
-    #
-
-    if WINSERVICE:
-        _python_exe = os.path.join(sys.exec_prefix, 'python.exe')
-    else:
-        _python_exe = sys.executable
-
-    def set_executable(exe):
-        global _python_exe
-        _python_exe = exe
-
-    #
-    #
-    #
-
-    def duplicate(handle, target_process=None, inheritable=False):
-        if target_process is None:
-            target_process = _winapi.GetCurrentProcess()
-        return _winapi.DuplicateHandle(
-            _winapi.GetCurrentProcess(), handle, target_process,
-            0, inheritable, _winapi.DUPLICATE_SAME_ACCESS
-            )
-
-    #
-    # We define a Popen class similar to the one from subprocess, but
-    # whose constructor takes a process object as its argument.
-    #
-
-    class Popen(object):
-        '''
-        Start a subprocess to run the code of a process object
-        '''
-        _tls = _thread._local()
-
-        def __init__(self, process_obj):
-            cmd = ' '.join('"%s"' % x for x in get_command_line())
-            prep_data = get_preparation_data(process_obj._name)
-
-            # create pipe for communication with child
-            rfd, wfd = os.pipe()
-
-            # get handle for read end of the pipe and make it inheritable
-            rhandle = duplicate(msvcrt.get_osfhandle(rfd), inheritable=True)
-            os.close(rfd)
-
-            with open(wfd, 'wb', closefd=True) as to_child:
-                # start process
-                try:
-                    hp, ht, pid, tid = _winapi.CreateProcess(
-                        _python_exe, cmd + (' %s' % rhandle),
-                        None, None, 1, 0, None, None, None
-                        )
-                    _winapi.CloseHandle(ht)
-                finally:
-                    close(rhandle)
-
-                # set attributes of self
-                self.pid = pid
-                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)
-                try:
-                    dump(prep_data, to_child, HIGHEST_PROTOCOL)
-                    dump(process_obj, to_child, HIGHEST_PROTOCOL)
-                finally:
-                    del Popen._tls.process_handle
-
-        @staticmethod
-        def thread_is_spawning():
-            return getattr(Popen._tls, 'process_handle', None) is not None
-
-        @staticmethod
-        def duplicate_for_child(handle):
-            return duplicate(handle, Popen._tls.process_handle)
-
-        def wait(self, timeout=None):
-            if self.returncode is None:
-                if timeout is None:
-                    msecs = _winapi.INFINITE
-                else:
-                    msecs = max(0, int(timeout * 1000 + 0.5))
-
-                res = _winapi.WaitForSingleObject(int(self._handle), msecs)
-                if res == _winapi.WAIT_OBJECT_0:
-                    code = _winapi.GetExitCodeProcess(self._handle)
-                    if code == TERMINATE:
-                        code = -signal.SIGTERM
-                    self.returncode = code
-
-            return self.returncode
-
-        def poll(self):
-            return self.wait(timeout=0)
-
-        def terminate(self):
-            if self.returncode is None:
-                try:
-                    _winapi.TerminateProcess(int(self._handle), TERMINATE)
-                except OSError:
-                    if self.wait(timeout=1.0) is None:
-                        raise
-
-    #
-    #
-    #
-
-    def is_forking(argv):
-        '''
-        Return whether commandline indicates we are forking
-        '''
-        if len(argv) >= 2 and argv[1] == '--multiprocessing-fork':
-            assert len(argv) == 3
-            return True
-        else:
-            return False
-
-
-    def freeze_support():
-        '''
-        Run code for process object if this in not the main process
-        '''
-        if is_forking(sys.argv):
-            main()
-            sys.exit()
-
-
-    def get_command_line():
-        '''
-        Returns prefix of command line used for spawning a child process
-        '''
-        if getattr(process.current_process(), '_inheriting', False):
-            raise RuntimeError('''
-            Attempt to start a new process before the current process
-            has finished its bootstrapping phase.
-
-            This probably means that you are on Windows and you have
-            forgotten to use the proper idiom in the main module:
-
-                if __name__ == '__main__':
-                    freeze_support()
-                    ...
-
-            The "freeze_support()" line can be omitted if the program
-            is not going to be frozen to produce a Windows executable.''')
-
-        if getattr(sys, 'frozen', False):
-            return [sys.executable, '--multiprocessing-fork']
-        else:
-            prog = 'from multiprocessing.forking import main; main()'
-            opts = util._args_from_interpreter_flags()
-            return [_python_exe] + opts + ['-c', prog, '--multiprocessing-fork']
-
-
-    def main():
-        '''
-        Run code specified by data received over pipe
-        '''
-        assert is_forking(sys.argv)
-
-        handle = int(sys.argv[-1])
-        fd = msvcrt.open_osfhandle(handle, os.O_RDONLY)
-        from_parent = os.fdopen(fd, 'rb')
-
-        process.current_process()._inheriting = True
-        preparation_data = load(from_parent)
-        prepare(preparation_data)
-        self = load(from_parent)
-        process.current_process()._inheriting = False
-
-        from_parent.close()
-
-        exitcode = self._bootstrap()
-        sys.exit(exitcode)
-
-
-    def get_preparation_data(name):
-        '''
-        Return info about parent needed by child to unpickle process object
-        '''
-        from .util import _logger, _log_to_stderr
-
-        d = dict(
-            name=name,
-            sys_path=sys.path,
-            sys_argv=sys.argv,
-            log_to_stderr=_log_to_stderr,
-            orig_dir=process.ORIGINAL_DIR,
-            authkey=process.current_process().authkey,
-            )
-
-        if _logger is not None:
-            d['log_level'] = _logger.getEffectiveLevel()
-
-        if not WINEXE and not WINSERVICE:
-            main_path = getattr(sys.modules['__main__'], '__file__', None)
-            if not main_path and sys.argv[0] not in ('', '-c'):
-                main_path = sys.argv[0]
-            if main_path is not None:
-                if not os.path.isabs(main_path) and \
-                                          process.ORIGINAL_DIR is not None:
-                    main_path = os.path.join(process.ORIGINAL_DIR, main_path)
-                d['main_path'] = os.path.normpath(main_path)
-
-        return d
-
-#
-# Prepare current process
-#
-
-old_main_modules = []
-
-def prepare(data):
-    '''
-    Try to get current process ready to unpickle process object
-    '''
-    old_main_modules.append(sys.modules['__main__'])
-
-    if 'name' in data:
-        process.current_process().name = data['name']
-
-    if 'authkey' in data:
-        process.current_process()._authkey = data['authkey']
-
-    if 'log_to_stderr' in data and data['log_to_stderr']:
-        util.log_to_stderr()
-
-    if 'log_level' in data:
-        util.get_logger().setLevel(data['log_level'])
-
-    if 'sys_path' in data:
-        sys.path = data['sys_path']
-
-    if 'sys_argv' in data:
-        sys.argv = data['sys_argv']
-
-    if 'dir' in data:
-        os.chdir(data['dir'])
-
-    if 'orig_dir' in data:
-        process.ORIGINAL_DIR = data['orig_dir']
-
-    if 'main_path' in data:
-        # XXX (ncoghlan): The following code makes several bogus
-        # assumptions regarding the relationship between __file__
-        # and a module's real name. See PEP 302 and issue #10845
-        main_path = data['main_path']
-        main_name = os.path.splitext(os.path.basename(main_path))[0]
-        if main_name == '__init__':
-            main_name = os.path.basename(os.path.dirname(main_path))
-
-        if main_name == '__main__':
-            main_module = sys.modules['__main__']
-            main_module.__file__ = main_path
-        elif main_name != 'ipython':
-            # Main modules not actually called __main__.py may
-            # contain additional code that should still be executed
-            import imp
-
-            if main_path is None:
-                dirs = None
-            elif os.path.basename(main_path).startswith('__init__.py'):
-                dirs = [os.path.dirname(os.path.dirname(main_path))]
-            else:
-                dirs = [os.path.dirname(main_path)]
-
-            assert main_name not in sys.modules, main_name
-            file, path_name, etc = imp.find_module(main_name, dirs)
-            try:
-                # We would like to do "imp.load_module('__main__', ...)"
-                # here.  However, that would cause 'if __name__ ==
-                # "__main__"' clauses to be executed.
-                main_module = imp.load_module(
-                    '__parents_main__', file, path_name, etc
-                    )
-            finally:
-                if file:
-                    file.close()
-
-            sys.modules['__main__'] = main_module
-            main_module.__name__ = '__main__'
-
-            # Try to make the potentially picklable objects in
-            # sys.modules['__main__'] realize they are in the main
-            # module -- somewhat ugly.
-            for obj in list(main_module.__dict__.values()):
-                try:
-                    if obj.__module__ == '__parents_main__':
-                        obj.__module__ = '__main__'
-                except Exception:
-                    pass
diff --git a/Lib/multiprocessing/forkserver.py b/Lib/multiprocessing/forkserver.py
new file mode 100644
index 0000000..387517e
--- /dev/null
+++ b/Lib/multiprocessing/forkserver.py
@@ -0,0 +1,267 @@
+import errno
+import os
+import selectors
+import signal
+import socket
+import struct
+import sys
+import threading
+
+from . import connection
+from . import process
+from . import reduction
+from . import semaphore_tracker
+from . import spawn
+from . import util
+
+__all__ = ['ensure_running', 'get_inherited_fds', 'connect_to_new_process',
+           'set_forkserver_preload']
+
+#
+#
+#
+
+MAXFDS_TO_SEND = 256
+UNSIGNED_STRUCT = struct.Struct('Q')     # large enough for pid_t
+
+#
+# Forkserver class
+#
+
+class ForkServer(object):
+
+    def __init__(self):
+        self._forkserver_address = None
+        self._forkserver_alive_fd = None
+        self._inherited_fds = None
+        self._lock = threading.Lock()
+        self._preload_modules = ['__main__']
+
+    def set_forkserver_preload(self, modules_names):
+        '''Set list of module names to try to load in forkserver process.'''
+        if not all(type(mod) is str for mod in self._preload_modules):
+            raise TypeError('module_names must be a list of strings')
+        self._preload_modules = modules_names
+
+    def get_inherited_fds(self):
+        '''Return list of fds inherited from parent process.
+
+        This returns None if the current process was not started by fork
+        server.
+        '''
+        return self._inherited_fds
+
+    def connect_to_new_process(self, fds):
+        '''Request forkserver to create a child process.
+
+        Returns a pair of fds (status_r, data_w).  The calling process can read
+        the child process's pid and (eventually) its returncode from status_r.
+        The calling process should write to data_w the pickled preparation and
+        process data.
+        '''
+        self.ensure_running()
+        if len(fds) + 4 >= MAXFDS_TO_SEND:
+            raise ValueError('too many fds')
+        with socket.socket(socket.AF_UNIX) as client:
+            client.connect(self._forkserver_address)
+            parent_r, child_w = os.pipe()
+            child_r, parent_w = os.pipe()
+            allfds = [child_r, child_w, self._forkserver_alive_fd,
+                      semaphore_tracker.getfd()]
+            allfds += fds
+            try:
+                reduction.sendfds(client, allfds)
+                return parent_r, parent_w
+            except:
+                os.close(parent_r)
+                os.close(parent_w)
+                raise
+            finally:
+                os.close(child_r)
+                os.close(child_w)
+
+    def ensure_running(self):
+        '''Make sure that a fork server is running.
+
+        This can be called from any process.  Note that usually a child
+        process will just reuse the forkserver started by its parent, so
+        ensure_running() will do nothing.
+        '''
+        with self._lock:
+            semaphore_tracker.ensure_running()
+            if self._forkserver_alive_fd is not None:
+                return
+
+            cmd = ('from multiprocessing.forkserver import main; ' +
+                   'main(%d, %d, %r, **%r)')
+
+            if self._preload_modules:
+                desired_keys = {'main_path', 'sys_path'}
+                data = spawn.get_preparation_data('ignore')
+                data = dict((x,y) for (x,y) in data.items()
+                            if x in desired_keys)
+            else:
+                data = {}
+
+            with socket.socket(socket.AF_UNIX) as listener:
+                address = connection.arbitrary_address('AF_UNIX')
+                listener.bind(address)
+                os.chmod(address, 0o600)
+                listener.listen(100)
+
+                # all client processes own the write end of the "alive" pipe;
+                # when they all terminate the read end becomes ready.
+                alive_r, alive_w = os.pipe()
+                try:
+                    fds_to_pass = [listener.fileno(), alive_r]
+                    cmd %= (listener.fileno(), alive_r, self._preload_modules,
+                            data)
+                    exe = spawn.get_executable()
+                    args = [exe] + util._args_from_interpreter_flags()
+                    args += ['-c', cmd]
+                    pid = util.spawnv_passfds(exe, args, fds_to_pass)
+                except:
+                    os.close(alive_w)
+                    raise
+                finally:
+                    os.close(alive_r)
+                self._forkserver_address = address
+                self._forkserver_alive_fd = alive_w
+
+#
+#
+#
+
+def main(listener_fd, alive_r, preload, main_path=None, sys_path=None):
+    '''Run forkserver.'''
+    if preload:
+        if '__main__' in preload and main_path is not None:
+            process.current_process()._inheriting = True
+            try:
+                spawn.import_main_path(main_path)
+            finally:
+                del process.current_process()._inheriting
+        for modname in preload:
+            try:
+                __import__(modname)
+            except ImportError:
+                pass
+
+    # close sys.stdin
+    if sys.stdin is not None:
+        try:
+            sys.stdin.close()
+            sys.stdin = open(os.devnull)
+        except (OSError, ValueError):
+            pass
+
+    # ignoring SIGCHLD means no need to reap zombie processes
+    handler = signal.signal(signal.SIGCHLD, signal.SIG_IGN)
+    with socket.socket(socket.AF_UNIX, fileno=listener_fd) as listener, \
+         selectors.DefaultSelector() as selector:
+        _forkserver._forkserver_address = listener.getsockname()
+
+        selector.register(listener, selectors.EVENT_READ)
+        selector.register(alive_r, selectors.EVENT_READ)
+
+        while True:
+            try:
+                while True:
+                    rfds = [key.fileobj for (key, events) in selector.select()]
+                    if rfds:
+                        break
+
+                if alive_r in rfds:
+                    # EOF because no more client processes left
+                    assert os.read(alive_r, 1) == b''
+                    raise SystemExit
+
+                assert listener in rfds
+                with listener.accept()[0] as s:
+                    code = 1
+                    if os.fork() == 0:
+                        try:
+                            _serve_one(s, listener, alive_r, handler)
+                        except Exception:
+                            sys.excepthook(*sys.exc_info())
+                            sys.stderr.flush()
+                        finally:
+                            os._exit(code)
+
+            except InterruptedError:
+                pass
+            except OSError as e:
+                if e.errno != errno.ECONNABORTED:
+                    raise
+
+def _serve_one(s, listener, alive_r, handler):
+    # close unnecessary stuff and reset SIGCHLD handler
+    listener.close()
+    os.close(alive_r)
+    signal.signal(signal.SIGCHLD, handler)
+
+    # receive fds from parent process
+    fds = reduction.recvfds(s, MAXFDS_TO_SEND + 1)
+    s.close()
+    assert len(fds) <= MAXFDS_TO_SEND
+    (child_r, child_w, _forkserver._forkserver_alive_fd,
+     stfd, *_forkserver._inherited_fds) = fds
+    semaphore_tracker._semaphore_tracker._fd = stfd
+
+    # send pid to client processes
+    write_unsigned(child_w, os.getpid())
+
+    # reseed random number generator
+    if 'random' in sys.modules:
+        import random
+        random.seed()
+
+    # run process object received over pipe
+    code = spawn._main(child_r)
+
+    # write the exit code to the pipe
+    write_unsigned(child_w, code)
+
+#
+# Read and write unsigned numbers
+#
+
+def read_unsigned(fd):
+    data = b''
+    length = UNSIGNED_STRUCT.size
+    while len(data) < length:
+        while True:
+            try:
+                s = os.read(fd, length - len(data))
+            except InterruptedError:
+                pass
+            else:
+                break
+        if not s:
+            raise EOFError('unexpected EOF')
+        data += s
+    return UNSIGNED_STRUCT.unpack(data)[0]
+
+def write_unsigned(fd, n):
+    msg = UNSIGNED_STRUCT.pack(n)
+    while msg:
+        while True:
+            try:
+                nbytes = os.write(fd, msg)
+            except InterruptedError:
+                pass
+            else:
+                break
+        if nbytes == 0:
+            raise RuntimeError('should not get here')
+        msg = msg[nbytes:]
+
+#
+#
+#
+
+_forkserver = ForkServer()
+ensure_running = _forkserver.ensure_running
+get_inherited_fds = _forkserver.get_inherited_fds
+connect_to_new_process = _forkserver.connect_to_new_process
+set_forkserver_preload = _forkserver.set_forkserver_preload
diff --git a/Lib/multiprocessing/heap.py b/Lib/multiprocessing/heap.py
index e63fdb8..344a45f 100644
--- a/Lib/multiprocessing/heap.py
+++ b/Lib/multiprocessing/heap.py
@@ -11,12 +11,12 @@
 import mmap
 import os
 import sys
+import tempfile
 import threading
-import itertools
 
-import _multiprocessing
-from multiprocessing.util import Finalize, info
-from multiprocessing.forking import assert_spawning
+from . import context
+from . import reduction
+from . import util
 
 __all__ = ['BufferWrapper']
 
@@ -30,17 +30,25 @@
 
     class Arena(object):
 
-        _counter = itertools.count()
+        _rand = tempfile._RandomNameSequence()
 
         def __init__(self, size):
             self.size = size
-            self.name = 'pym-%d-%d' % (os.getpid(), next(Arena._counter))
-            self.buffer = mmap.mmap(-1, self.size, tagname=self.name)
-            assert _winapi.GetLastError() == 0, 'tagname already in use'
+            for i in range(100):
+                name = 'pym-%d-%s' % (os.getpid(), next(self._rand))
+                buf = mmap.mmap(-1, size, tagname=name)
+                if _winapi.GetLastError() == 0:
+                    break
+                # We have reopened a preexisting mmap.
+                buf.close()
+            else:
+                raise FileExistsError('Cannot find name for new mmap')
+            self.name = name
+            self.buffer = buf
             self._state = (self.size, self.name)
 
         def __getstate__(self):
-            assert_spawning(self)
+            context.assert_spawning(self)
             return self._state
 
         def __setstate__(self, state):
@@ -52,10 +60,28 @@
 
     class Arena(object):
 
-        def __init__(self, size):
-            self.buffer = mmap.mmap(-1, size)
+        def __init__(self, size, fd=-1):
             self.size = size
-            self.name = None
+            self.fd = fd
+            if fd == -1:
+                self.fd, name = tempfile.mkstemp(
+                     prefix='pym-%d-'%os.getpid(), dir=util.get_temp_dir())
+                os.unlink(name)
+                util.Finalize(self, os.close, (self.fd,))
+                with open(self.fd, 'wb', closefd=False) as f:
+                    f.write(b'\0'*size)
+            self.buffer = mmap.mmap(self.fd, self.size)
+
+    def reduce_arena(a):
+        if a.fd == -1:
+            raise ValueError('Arena is unpicklable because '
+                             'forking was enabled when it was created')
+        return rebuild_arena, (a.size, reduction.DupFd(a.fd))
+
+    def rebuild_arena(size, dupfd):
+        return Arena(size, dupfd.detach())
+
+    reduction.register(Arena, reduce_arena)
 
 #
 # Class allowing allocation of chunks of memory from arenas
@@ -90,7 +116,7 @@
         if i == len(self._lengths):
             length = self._roundup(max(self._size, size), mmap.PAGESIZE)
             self._size *= 2
-            info('allocating a new mmap of length %d', length)
+            util.info('allocating a new mmap of length %d', length)
             arena = Arena(length)
             self._arenas.append(arena)
             return (arena, 0, length)
@@ -216,7 +242,7 @@
         assert 0 <= size < sys.maxsize
         block = BufferWrapper._heap.malloc(size)
         self._state = (block, size)
-        Finalize(self, BufferWrapper._heap.free, args=(block,))
+        util.Finalize(self, BufferWrapper._heap.free, args=(block,))
 
     def create_memoryview(self):
         (arena, start, stop), size = self._state
diff --git a/Lib/multiprocessing/managers.py b/Lib/multiprocessing/managers.py
index 96056b0..66d46fc 100644
--- a/Lib/multiprocessing/managers.py
+++ b/Lib/multiprocessing/managers.py
@@ -19,11 +19,16 @@
 import array
 import queue
 
-from traceback import format_exc
-from multiprocessing import Process, current_process, active_children, Pool, util, connection
-from multiprocessing.process import AuthenticationString
-from multiprocessing.forking import Popen, ForkingPickler
 from time import time as _time
+from traceback import format_exc
+
+from . import connection
+from . import context
+from . import pool
+from . import process
+from . import reduction
+from . import util
+from . import get_context
 
 #
 # Register some things for pickling
@@ -31,16 +36,14 @@
 
 def reduce_array(a):
     return array.array, (a.typecode, a.tobytes())
-ForkingPickler.register(array.array, reduce_array)
+reduction.register(array.array, reduce_array)
 
 view_types = [type(getattr({}, name)()) for name in ('items','keys','values')]
 if view_types[0] is not list:       # only needed in Py3.0
     def rebuild_as_list(obj):
         return list, (list(obj),)
     for view_type in view_types:
-        ForkingPickler.register(view_type, rebuild_as_list)
-        import copyreg
-        copyreg.pickle(view_type, rebuild_as_list)
+        reduction.register(view_type, rebuild_as_list)
 
 #
 # Type for identifying shared objects
@@ -130,7 +133,7 @@
     def __init__(self, registry, address, authkey, serializer):
         assert isinstance(authkey, bytes)
         self.registry = registry
-        self.authkey = AuthenticationString(authkey)
+        self.authkey = process.AuthenticationString(authkey)
         Listener, Client = listener_client[serializer]
 
         # do authentication later
@@ -146,7 +149,7 @@
         Run the server forever
         '''
         self.stop_event = threading.Event()
-        current_process()._manager_server = self
+        process.current_process()._manager_server = self
         try:
             accepter = threading.Thread(target=self.accepter)
             accepter.daemon = True
@@ -167,7 +170,7 @@
         while True:
             try:
                 c = self.listener.accept()
-            except (OSError, IOError):
+            except OSError:
                 continue
             t = threading.Thread(target=self.handle_request, args=(c,))
             t.daemon = True
@@ -436,15 +439,17 @@
     _registry = {}
     _Server = Server
 
-    def __init__(self, address=None, authkey=None, serializer='pickle'):
+    def __init__(self, address=None, authkey=None, serializer='pickle',
+                 ctx=None):
         if authkey is None:
-            authkey = current_process().authkey
+            authkey = process.current_process().authkey
         self._address = address     # XXX not final address if eg ('', 0)
-        self._authkey = AuthenticationString(authkey)
+        self._authkey = process.AuthenticationString(authkey)
         self._state = State()
         self._state.value = State.INITIAL
         self._serializer = serializer
         self._Listener, self._Client = listener_client[serializer]
+        self._ctx = ctx or get_context()
 
     def get_server(self):
         '''
@@ -476,7 +481,7 @@
         reader, writer = connection.Pipe(duplex=False)
 
         # spawn process which runs a server
-        self._process = Process(
+        self._process = self._ctx.Process(
             target=type(self)._run_server,
             args=(self._registry, self._address, self._authkey,
                   self._serializer, writer, initializer, initargs),
@@ -691,11 +696,11 @@
         self._Client = listener_client[serializer][1]
 
         if authkey is not None:
-            self._authkey = AuthenticationString(authkey)
+            self._authkey = process.AuthenticationString(authkey)
         elif self._manager is not None:
             self._authkey = self._manager._authkey
         else:
-            self._authkey = current_process().authkey
+            self._authkey = process.current_process().authkey
 
         if incref:
             self._incref()
@@ -704,7 +709,7 @@
 
     def _connect(self):
         util.debug('making connection to manager')
-        name = current_process().name
+        name = process.current_process().name
         if threading.current_thread().name != 'MainThread':
             name += '|' + threading.current_thread().name
         conn = self._Client(self._token.address, authkey=self._authkey)
@@ -798,7 +803,7 @@
 
     def __reduce__(self):
         kwds = {}
-        if Popen.thread_is_spawning():
+        if context.get_spawning_popen() is not None:
             kwds['authkey'] = self._authkey
 
         if getattr(self, '_isauto', False):
@@ -835,14 +840,14 @@
 
     If possible the shared object is returned, or otherwise a proxy for it.
     '''
-    server = getattr(current_process(), '_manager_server', None)
+    server = getattr(process.current_process(), '_manager_server', None)
 
     if server and server.address == token.address:
         return server.id_to_obj[token.id][0]
     else:
         incref = (
             kwds.pop('incref', True) and
-            not getattr(current_process(), '_inheriting', False)
+            not getattr(process.current_process(), '_inheriting', False)
             )
         return func(token, serializer, incref=incref, **kwds)
 
@@ -889,7 +894,7 @@
     if authkey is None and manager is not None:
         authkey = manager._authkey
     if authkey is None:
-        authkey = current_process().authkey
+        authkey = process.current_process().authkey
 
     ProxyType = MakeProxyType('AutoProxy[%s]' % token.typeid, exposed)
     proxy = ProxyType(token, serializer, manager=manager, authkey=authkey,
@@ -1072,17 +1077,22 @@
     ))
 
 
-PoolProxy = MakeProxyType('PoolProxy', (
+BasePoolProxy = MakeProxyType('PoolProxy', (
     'apply', 'apply_async', 'close', 'imap', 'imap_unordered', 'join',
-    'map', 'map_async', 'starmap', 'starmap_async', 'terminate'
+    'map', 'map_async', 'starmap', 'starmap_async', 'terminate',
     ))
-PoolProxy._method_to_typeid_ = {
+BasePoolProxy._method_to_typeid_ = {
     'apply_async': 'AsyncResult',
     'map_async': 'AsyncResult',
     'starmap_async': 'AsyncResult',
     'imap': 'Iterator',
     'imap_unordered': 'Iterator'
     }
+class PoolProxy(BasePoolProxy):
+    def __enter__(self):
+        return self
+    def __exit__(self, exc_type, exc_val, exc_tb):
+        self.terminate()
 
 #
 # Definition of SyncManager
@@ -1109,7 +1119,7 @@
                      AcquirerProxy)
 SyncManager.register('Condition', threading.Condition, ConditionProxy)
 SyncManager.register('Barrier', threading.Barrier, BarrierProxy)
-SyncManager.register('Pool', Pool, PoolProxy)
+SyncManager.register('Pool', pool.Pool, PoolProxy)
 SyncManager.register('list', list, ListProxy)
 SyncManager.register('dict', dict, DictProxy)
 SyncManager.register('Value', Value, ValueProxy)
diff --git a/Lib/multiprocessing/pool.py b/Lib/multiprocessing/pool.py
index 0f2dab4..8832a5c 100644
--- a/Lib/multiprocessing/pool.py
+++ b/Lib/multiprocessing/pool.py
@@ -7,7 +7,7 @@
 # Licensed to PSF under a Contributor Agreement.
 #
 
-__all__ = ['Pool']
+__all__ = ['Pool', 'ThreadPool']
 
 #
 # Imports
@@ -17,10 +17,14 @@
 import queue
 import itertools
 import collections
+import os
 import time
+import traceback
 
-from multiprocessing import Process, cpu_count, TimeoutError
-from multiprocessing.util import Finalize, debug
+# If threading is available then ThreadPool should be provided.  Therefore
+# we avoid top-level imports which are liable to fail on some systems.
+from . import util
+from . import get_context, TimeoutError
 
 #
 # Constants representing the state of a pool
@@ -43,6 +47,29 @@
     return list(itertools.starmap(args[0], args[1]))
 
 #
+# Hack to embed stringification of remote traceback in local traceback
+#
+
+class RemoteTraceback(Exception):
+    def __init__(self, tb):
+        self.tb = tb
+    def __str__(self):
+        return self.tb
+
+class ExceptionWithTraceback:
+    def __init__(self, exc, tb):
+        tb = traceback.format_exception(type(exc), exc, tb)
+        tb = ''.join(tb)
+        self.exc = exc
+        self.tb = '\n"""\n%s"""' % tb
+    def __reduce__(self):
+        return rebuild_exc, (self.exc, self.tb)
+
+def rebuild_exc(exc, tb):
+    exc.__cause__ = RemoteTraceback(tb)
+    return exc
+
+#
 # Code run by worker processes
 #
 
@@ -63,7 +90,8 @@
         return "<MaybeEncodingError: %s>" % str(self)
 
 
-def worker(inqueue, outqueue, initializer=None, initargs=(), maxtasks=None):
+def worker(inqueue, outqueue, initializer=None, initargs=(), maxtasks=None,
+           wrap_exception=False):
     assert maxtasks is None or (type(maxtasks) == int and maxtasks > 0)
     put = outqueue.put
     get = inqueue.get
@@ -78,28 +106,30 @@
     while maxtasks is None or (maxtasks and completed < maxtasks):
         try:
             task = get()
-        except (EOFError, IOError):
-            debug('worker got EOFError or IOError -- exiting')
+        except (EOFError, OSError):
+            util.debug('worker got EOFError or OSError -- exiting')
             break
 
         if task is None:
-            debug('worker got sentinel -- exiting')
+            util.debug('worker got sentinel -- exiting')
             break
 
         job, i, func, args, kwds = task
         try:
             result = (True, func(*args, **kwds))
         except Exception as e:
+            if wrap_exception:
+                e = ExceptionWithTraceback(e, e.__traceback__)
             result = (False, e)
         try:
             put((job, i, result))
         except Exception as e:
             wrapped = MaybeEncodingError(e, result[1])
-            debug("Possible encoding error while sending result: %s" % (
+            util.debug("Possible encoding error while sending result: %s" % (
                 wrapped))
             put((job, i, (False, wrapped)))
         completed += 1
-    debug('worker exiting after %d tasks' % completed)
+    util.debug('worker exiting after %d tasks' % completed)
 
 #
 # Class representing a process pool
@@ -109,10 +139,14 @@
     '''
     Class which supports an async version of applying functions to arguments.
     '''
-    Process = Process
+    _wrap_exception = True
+
+    def Process(self, *args, **kwds):
+        return self._ctx.Process(*args, **kwds)
 
     def __init__(self, processes=None, initializer=None, initargs=(),
-                 maxtasksperchild=None):
+                 maxtasksperchild=None, context=None):
+        self._ctx = context or get_context()
         self._setup_queues()
         self._taskqueue = queue.Queue()
         self._cache = {}
@@ -122,10 +156,7 @@
         self._initargs = initargs
 
         if processes is None:
-            try:
-                processes = cpu_count()
-            except NotImplementedError:
-                processes = 1
+            processes = os.cpu_count() or 1
         if processes < 1:
             raise ValueError("Number of processes must be at least 1")
 
@@ -162,7 +193,7 @@
         self._result_handler._state = RUN
         self._result_handler.start()
 
-        self._terminate = Finalize(
+        self._terminate = util.Finalize(
             self, self._terminate_pool,
             args=(self._taskqueue, self._inqueue, self._outqueue, self._pool,
                   self._worker_handler, self._task_handler,
@@ -179,7 +210,7 @@
             worker = self._pool[i]
             if worker.exitcode is not None:
                 # worker exited
-                debug('cleaning up worker %d' % i)
+                util.debug('cleaning up worker %d' % i)
                 worker.join()
                 cleaned = True
                 del self._pool[i]
@@ -193,13 +224,14 @@
             w = self.Process(target=worker,
                              args=(self._inqueue, self._outqueue,
                                    self._initializer,
-                                   self._initargs, self._maxtasksperchild)
+                                   self._initargs, self._maxtasksperchild,
+                                   self._wrap_exception)
                             )
             self._pool.append(w)
             w.name = w.name.replace('Process', 'PoolWorker')
             w.daemon = True
             w.start()
-            debug('added worker')
+            util.debug('added worker')
 
     def _maintain_pool(self):
         """Clean up any exited workers and start replacements for them.
@@ -208,9 +240,8 @@
             self._repopulate_pool()
 
     def _setup_queues(self):
-        from .queues import SimpleQueue
-        self._inqueue = SimpleQueue()
-        self._outqueue = SimpleQueue()
+        self._inqueue = self._ctx.SimpleQueue()
+        self._outqueue = self._ctx.SimpleQueue()
         self._quick_put = self._inqueue._writer.send
         self._quick_get = self._outqueue._reader.recv
 
@@ -336,7 +367,7 @@
             time.sleep(0.1)
         # send sentinel to stop workers
         pool._taskqueue.put(None)
-        debug('worker handler exiting')
+        util.debug('worker handler exiting')
 
     @staticmethod
     def _handle_tasks(taskqueue, put, outqueue, pool, cache):
@@ -346,7 +377,7 @@
             i = -1
             for i, task in enumerate(taskseq):
                 if thread._state:
-                    debug('task handler found thread._state != RUN')
+                    util.debug('task handler found thread._state != RUN')
                     break
                 try:
                     put(task)
@@ -358,27 +389,27 @@
                         pass
             else:
                 if set_length:
-                    debug('doing set_length()')
+                    util.debug('doing set_length()')
                     set_length(i+1)
                 continue
             break
         else:
-            debug('task handler got sentinel')
+            util.debug('task handler got sentinel')
 
 
         try:
             # tell result handler to finish when cache is empty
-            debug('task handler sending sentinel to result handler')
+            util.debug('task handler sending sentinel to result handler')
             outqueue.put(None)
 
             # tell workers there is no more work
-            debug('task handler sending sentinel to workers')
+            util.debug('task handler sending sentinel to workers')
             for p in pool:
                 put(None)
-        except IOError:
-            debug('task handler got IOError when sending sentinels')
+        except OSError:
+            util.debug('task handler got OSError when sending sentinels')
 
-        debug('task handler exiting')
+        util.debug('task handler exiting')
 
     @staticmethod
     def _handle_results(outqueue, get, cache):
@@ -387,17 +418,17 @@
         while 1:
             try:
                 task = get()
-            except (IOError, EOFError):
-                debug('result handler got EOFError/IOError -- exiting')
+            except (OSError, EOFError):
+                util.debug('result handler got EOFError/OSError -- exiting')
                 return
 
             if thread._state:
                 assert thread._state == TERMINATE
-                debug('result handler found thread._state=TERMINATE')
+                util.debug('result handler found thread._state=TERMINATE')
                 break
 
             if task is None:
-                debug('result handler got sentinel')
+                util.debug('result handler got sentinel')
                 break
 
             job, i, obj = task
@@ -409,12 +440,12 @@
         while cache and thread._state != TERMINATE:
             try:
                 task = get()
-            except (IOError, EOFError):
-                debug('result handler got EOFError/IOError -- exiting')
+            except (OSError, EOFError):
+                util.debug('result handler got EOFError/OSError -- exiting')
                 return
 
             if task is None:
-                debug('result handler ignoring extra sentinel')
+                util.debug('result handler ignoring extra sentinel')
                 continue
             job, i, obj = task
             try:
@@ -423,7 +454,7 @@
                 pass
 
         if hasattr(outqueue, '_reader'):
-            debug('ensuring that outqueue is not full')
+            util.debug('ensuring that outqueue is not full')
             # If we don't make room available in outqueue then
             # attempts to add the sentinel (None) to outqueue may
             # block.  There is guaranteed to be no more than 2 sentinels.
@@ -432,10 +463,10 @@
                     if not outqueue._reader.poll():
                         break
                     get()
-            except (IOError, EOFError):
+            except (OSError, EOFError):
                 pass
 
-        debug('result handler exiting: len(cache)=%s, thread._state=%s',
+        util.debug('result handler exiting: len(cache)=%s, thread._state=%s',
               len(cache), thread._state)
 
     @staticmethod
@@ -453,19 +484,19 @@
               )
 
     def close(self):
-        debug('closing pool')
+        util.debug('closing pool')
         if self._state == RUN:
             self._state = CLOSE
             self._worker_handler._state = CLOSE
 
     def terminate(self):
-        debug('terminating pool')
+        util.debug('terminating pool')
         self._state = TERMINATE
         self._worker_handler._state = TERMINATE
         self._terminate()
 
     def join(self):
-        debug('joining pool')
+        util.debug('joining pool')
         assert self._state in (CLOSE, TERMINATE)
         self._worker_handler.join()
         self._task_handler.join()
@@ -476,7 +507,7 @@
     @staticmethod
     def _help_stuff_finish(inqueue, task_handler, size):
         # task_handler may be blocked trying to put items on inqueue
-        debug('removing tasks from inqueue until task handler finished')
+        util.debug('removing tasks from inqueue until task handler finished')
         inqueue._rlock.acquire()
         while task_handler.is_alive() and inqueue._reader.poll():
             inqueue._reader.recv()
@@ -486,12 +517,12 @@
     def _terminate_pool(cls, taskqueue, inqueue, outqueue, pool,
                         worker_handler, task_handler, result_handler, cache):
         # this is guaranteed to only be called once
-        debug('finalizing pool')
+        util.debug('finalizing pool')
 
         worker_handler._state = TERMINATE
         task_handler._state = TERMINATE
 
-        debug('helping task handler/workers to finish')
+        util.debug('helping task handler/workers to finish')
         cls._help_stuff_finish(inqueue, task_handler, len(pool))
 
         assert result_handler.is_alive() or len(cache) == 0
@@ -501,31 +532,31 @@
 
         # We must wait for the worker handler to exit before terminating
         # workers because we don't want workers to be restarted behind our back.
-        debug('joining worker handler')
+        util.debug('joining worker handler')
         if threading.current_thread() is not worker_handler:
             worker_handler.join()
 
         # Terminate workers which haven't already finished.
         if pool and hasattr(pool[0], 'terminate'):
-            debug('terminating workers')
+            util.debug('terminating workers')
             for p in pool:
                 if p.exitcode is None:
                     p.terminate()
 
-        debug('joining task handler')
+        util.debug('joining task handler')
         if threading.current_thread() is not task_handler:
             task_handler.join()
 
-        debug('joining result handler')
+        util.debug('joining result handler')
         if threading.current_thread() is not result_handler:
             result_handler.join()
 
         if pool and hasattr(pool[0], 'terminate'):
-            debug('joining pool workers')
+            util.debug('joining pool workers')
             for p in pool:
                 if p.is_alive():
                     # worker has not yet exited
-                    debug('cleaning up worker %d' % p.pid)
+                    util.debug('cleaning up worker %d' % p.pid)
                     p.join()
 
     def __enter__(self):
@@ -710,8 +741,12 @@
 #
 
 class ThreadPool(Pool):
+    _wrap_exception = False
 
-    from .dummy import Process
+    @staticmethod
+    def Process(*args, **kwds):
+        from .dummy import Process
+        return Process(*args, **kwds)
 
     def __init__(self, processes=None, initializer=None, initargs=()):
         Pool.__init__(self, processes, initializer, initargs)
diff --git a/Lib/multiprocessing/popen_fork.py b/Lib/multiprocessing/popen_fork.py
new file mode 100644
index 0000000..367e72e
--- /dev/null
+++ b/Lib/multiprocessing/popen_fork.py
@@ -0,0 +1,83 @@
+import os
+import sys
+import signal
+import errno
+
+from . import util
+
+__all__ = ['Popen']
+
+#
+# Start child process using fork
+#
+
+class Popen(object):
+    method = 'fork'
+
+    def __init__(self, process_obj):
+        sys.stdout.flush()
+        sys.stderr.flush()
+        self.returncode = None
+        self._launch(process_obj)
+
+    def duplicate_for_child(self, fd):
+        return fd
+
+    def poll(self, flag=os.WNOHANG):
+        if self.returncode is None:
+            while True:
+                try:
+                    pid, sts = os.waitpid(self.pid, flag)
+                except OSError as e:
+                    if e.errno == errno.EINTR:
+                        continue
+                    # Child process not yet created. See #1731717
+                    # e.errno == errno.ECHILD == 10
+                    return None
+                else:
+                    break
+            if pid == self.pid:
+                if os.WIFSIGNALED(sts):
+                    self.returncode = -os.WTERMSIG(sts)
+                else:
+                    assert os.WIFEXITED(sts)
+                    self.returncode = os.WEXITSTATUS(sts)
+        return self.returncode
+
+    def wait(self, timeout=None):
+        if self.returncode is None:
+            if timeout is not None:
+                from multiprocessing.connection import wait
+                if not wait([self.sentinel], timeout):
+                    return None
+            # This shouldn't block if wait() returned successfully.
+            return self.poll(os.WNOHANG if timeout == 0.0 else 0)
+        return self.returncode
+
+    def terminate(self):
+        if self.returncode is None:
+            try:
+                os.kill(self.pid, signal.SIGTERM)
+            except ProcessLookupError:
+                pass
+            except OSError:
+                if self.wait(timeout=0.1) is None:
+                    raise
+
+    def _launch(self, process_obj):
+        code = 1
+        parent_r, child_w = os.pipe()
+        self.pid = os.fork()
+        if self.pid == 0:
+            try:
+                os.close(parent_r)
+                if 'random' in sys.modules:
+                    import random
+                    random.seed()
+                code = process_obj._bootstrap()
+            finally:
+                os._exit(code)
+        else:
+            os.close(child_w)
+            util.Finalize(self, os.close, (parent_r,))
+            self.sentinel = parent_r
diff --git a/Lib/multiprocessing/popen_forkserver.py b/Lib/multiprocessing/popen_forkserver.py
new file mode 100644
index 0000000..e792194
--- /dev/null
+++ b/Lib/multiprocessing/popen_forkserver.py
@@ -0,0 +1,69 @@
+import io
+import os
+
+from . import reduction
+if not reduction.HAVE_SEND_HANDLE:
+    raise ImportError('No support for sending fds between processes')
+from . import context
+from . import forkserver
+from . import popen_fork
+from . import spawn
+from . import util
+
+
+__all__ = ['Popen']
+
+#
+# Wrapper for an fd used while launching a process
+#
+
+class _DupFd(object):
+    def __init__(self, ind):
+        self.ind = ind
+    def detach(self):
+        return forkserver.get_inherited_fds()[self.ind]
+
+#
+# Start child process using a server process
+#
+
+class Popen(popen_fork.Popen):
+    method = 'forkserver'
+    DupFd = _DupFd
+
+    def __init__(self, process_obj):
+        self._fds = []
+        super().__init__(process_obj)
+
+    def duplicate_for_child(self, fd):
+        self._fds.append(fd)
+        return len(self._fds) - 1
+
+    def _launch(self, process_obj):
+        prep_data = spawn.get_preparation_data(process_obj._name)
+        buf = io.BytesIO()
+        context.set_spawning_popen(self)
+        try:
+            reduction.dump(prep_data, buf)
+            reduction.dump(process_obj, buf)
+        finally:
+            context.set_spawning_popen(None)
+
+        self.sentinel, w = forkserver.connect_to_new_process(self._fds)
+        util.Finalize(self, os.close, (self.sentinel,))
+        with open(w, 'wb', closefd=True) as f:
+            f.write(buf.getbuffer())
+        self.pid = forkserver.read_unsigned(self.sentinel)
+
+    def poll(self, flag=os.WNOHANG):
+        if self.returncode is None:
+            from multiprocessing.connection import wait
+            timeout = 0 if flag == os.WNOHANG else None
+            if not wait([self.sentinel], timeout):
+                return None
+            try:
+                self.returncode = forkserver.read_unsigned(self.sentinel)
+            except (OSError, EOFError):
+                # The process ended abnormally perhaps because of a signal
+                self.returncode = 255
+        return self.returncode
diff --git a/Lib/multiprocessing/popen_spawn_posix.py b/Lib/multiprocessing/popen_spawn_posix.py
new file mode 100644
index 0000000..6b0a8d6
--- /dev/null
+++ b/Lib/multiprocessing/popen_spawn_posix.py
@@ -0,0 +1,69 @@
+import io
+import os
+
+from . import context
+from . import popen_fork
+from . import reduction
+from . import spawn
+from . import util
+
+__all__ = ['Popen']
+
+
+#
+# Wrapper for an fd used while launching a process
+#
+
+class _DupFd(object):
+    def __init__(self, fd):
+        self.fd = fd
+    def detach(self):
+        return self.fd
+
+#
+# Start child process using a fresh interpreter
+#
+
+class Popen(popen_fork.Popen):
+    method = 'spawn'
+    DupFd = _DupFd
+
+    def __init__(self, process_obj):
+        self._fds = []
+        super().__init__(process_obj)
+
+    def duplicate_for_child(self, fd):
+        self._fds.append(fd)
+        return fd
+
+    def _launch(self, process_obj):
+        from . import semaphore_tracker
+        tracker_fd = semaphore_tracker.getfd()
+        self._fds.append(tracker_fd)
+        prep_data = spawn.get_preparation_data(process_obj._name)
+        fp = io.BytesIO()
+        context.set_spawning_popen(self)
+        try:
+            reduction.dump(prep_data, fp)
+            reduction.dump(process_obj, fp)
+        finally:
+            context.set_spawning_popen(None)
+
+        parent_r = child_w = child_r = parent_w = None
+        try:
+            parent_r, child_w = os.pipe()
+            child_r, parent_w = os.pipe()
+            cmd = spawn.get_command_line(tracker_fd=tracker_fd,
+                                         pipe_handle=child_r)
+            self._fds.extend([child_r, child_w])
+            self.pid = util.spawnv_passfds(spawn.get_executable(),
+                                           cmd, self._fds)
+            self.sentinel = parent_r
+            with open(parent_w, 'wb', closefd=False) as f:
+                f.write(fp.getbuffer())
+        finally:
+            if parent_r is not None:
+                util.Finalize(self, os.close, (parent_r,))
+            for fd in (child_r, child_w, parent_w):
+                if fd is not None:
+                    os.close(fd)
diff --git a/Lib/multiprocessing/popen_spawn_win32.py b/Lib/multiprocessing/popen_spawn_win32.py
new file mode 100644
index 0000000..3b53068
--- /dev/null
+++ b/Lib/multiprocessing/popen_spawn_win32.py
@@ -0,0 +1,99 @@
+import os
+import msvcrt
+import signal
+import sys
+import _winapi
+
+from . import context
+from . import spawn
+from . import reduction
+from . import util
+
+__all__ = ['Popen']
+
+#
+#
+#
+
+TERMINATE = 0x10000
+WINEXE = (sys.platform == 'win32' and getattr(sys, 'frozen', False))
+WINSERVICE = sys.executable.lower().endswith("pythonservice.exe")
+
+#
+# We define a Popen class similar to the one from subprocess, but
+# whose constructor takes a process object as its argument.
+#
+
+class Popen(object):
+    '''
+    Start a subprocess to run the code of a process object
+    '''
+    method = 'spawn'
+
+    def __init__(self, process_obj):
+        prep_data = spawn.get_preparation_data(process_obj._name)
+
+        # read end of pipe will be "stolen" by the child process
+        # -- see spawn_main() in spawn.py.
+        rhandle, whandle = _winapi.CreatePipe(None, 0)
+        wfd = msvcrt.open_osfhandle(whandle, 0)
+        cmd = spawn.get_command_line(parent_pid=os.getpid(),
+                                     pipe_handle=rhandle)
+        cmd = ' '.join('"%s"' % x for x in cmd)
+
+        with open(wfd, 'wb', closefd=True) as to_child:
+            # start process
+            try:
+                hp, ht, pid, tid = _winapi.CreateProcess(
+                    spawn.get_executable(), cmd,
+                    None, None, False, 0, None, None, None)
+                _winapi.CloseHandle(ht)
+            except:
+                _winapi.CloseHandle(rhandle)
+                raise
+
+            # set attributes of self
+            self.pid = pid
+            self.returncode = None
+            self._handle = hp
+            self.sentinel = int(hp)
+            util.Finalize(self, _winapi.CloseHandle, (self.sentinel,))
+
+            # send information to child
+            context.set_spawning_popen(self)
+            try:
+                reduction.dump(prep_data, to_child)
+                reduction.dump(process_obj, to_child)
+            finally:
+                context.set_spawning_popen(None)
+
+    def duplicate_for_child(self, handle):
+        assert self is context.get_spawning_popen()
+        return reduction.duplicate(handle, self.sentinel)
+
+    def wait(self, timeout=None):
+        if self.returncode is None:
+            if timeout is None:
+                msecs = _winapi.INFINITE
+            else:
+                msecs = max(0, int(timeout * 1000 + 0.5))
+
+            res = _winapi.WaitForSingleObject(int(self._handle), msecs)
+            if res == _winapi.WAIT_OBJECT_0:
+                code = _winapi.GetExitCodeProcess(self._handle)
+                if code == TERMINATE:
+                    code = -signal.SIGTERM
+                self.returncode = code
+
+        return self.returncode
+
+    def poll(self):
+        return self.wait(timeout=0)
+
+    def terminate(self):
+        if self.returncode is None:
+            try:
+                _winapi.TerminateProcess(int(self._handle), TERMINATE)
+            except OSError:
+                if self.wait(timeout=1.0) is None:
+                    raise
diff --git a/Lib/multiprocessing/process.py b/Lib/multiprocessing/process.py
index 3d32add..68959bf 100644
--- a/Lib/multiprocessing/process.py
+++ b/Lib/multiprocessing/process.py
@@ -7,7 +7,7 @@
 # Licensed to PSF under a Contributor Agreement.
 #
 
-__all__ = ['Process', 'current_process', 'active_children']
+__all__ = ['BaseProcess', 'current_process', 'active_children']
 
 #
 # Imports
@@ -43,7 +43,7 @@
     Return list of process objects corresponding to live child processes
     '''
     _cleanup()
-    return list(_current_process._children)
+    return list(_children)
 
 #
 #
@@ -51,33 +51,29 @@
 
 def _cleanup():
     # check for processes which have finished
-    for p in list(_current_process._children):
+    for p in list(_children):
         if p._popen.poll() is not None:
-            _current_process._children.discard(p)
+            _children.discard(p)
 
 #
 # The `Process` class
 #
 
-class Process(object):
+class BaseProcess(object):
     '''
     Process objects represent activity that is run in a separate process
 
-    The class is analagous to `threading.Thread`
+    The class is analogous to `threading.Thread`
     '''
-    _Popen = None
+    def _Popen(self):
+        raise NotImplementedError
 
     def __init__(self, group=None, target=None, name=None, args=(), kwargs={},
                  *, daemon=None):
         assert group is None, 'group argument must be None for now'
-        count = next(_current_process._counter)
+        count = next(_process_counter)
         self._identity = _current_process._identity + (count,)
-        self._authkey = _current_process._authkey
-        if daemon is not None:
-            self._daemonic = daemon
-        else:
-            self._daemonic = _current_process._daemonic
-        self._tempdir = _current_process._tempdir
+        self._config = _current_process._config.copy()
         self._parent_pid = os.getpid()
         self._popen = None
         self._target = target
@@ -85,6 +81,8 @@
         self._kwargs = dict(kwargs)
         self._name = name or type(self).__name__ + '-' + \
                      ':'.join(str(i) for i in self._identity)
+        if daemon is not None:
+            self.daemon = daemon
         _dangling.add(self)
 
     def run(self):
@@ -101,16 +99,12 @@
         assert self._popen is None, 'cannot start a process twice'
         assert self._parent_pid == os.getpid(), \
                'can only start a process object created by current process'
-        assert not _current_process._daemonic, \
+        assert not _current_process._config.get('daemon'), \
                'daemonic processes are not allowed to have children'
         _cleanup()
-        if self._Popen is not None:
-            Popen = self._Popen
-        else:
-            from .forking import Popen
-        self._popen = Popen(self)
+        self._popen = self._Popen(self)
         self._sentinel = self._popen.sentinel
-        _current_process._children.add(self)
+        _children.add(self)
 
     def terminate(self):
         '''
@@ -126,7 +120,7 @@
         assert self._popen is not None, 'can only join a started process'
         res = self._popen.wait(timeout)
         if res is not None:
-            _current_process._children.discard(self)
+            _children.discard(self)
 
     def is_alive(self):
         '''
@@ -154,7 +148,7 @@
         '''
         Return whether process is a daemon
         '''
-        return self._daemonic
+        return self._config.get('daemon', False)
 
     @daemon.setter
     def daemon(self, daemonic):
@@ -162,18 +156,18 @@
         Set whether process is a daemon
         '''
         assert self._popen is None, 'process has already started'
-        self._daemonic = daemonic
+        self._config['daemon'] = daemonic
 
     @property
     def authkey(self):
-        return self._authkey
+        return self._config['authkey']
 
     @authkey.setter
     def authkey(self, authkey):
         '''
         Set authorization key of process
         '''
-        self._authkey = AuthenticationString(authkey)
+        self._config['authkey'] = AuthenticationString(authkey)
 
     @property
     def exitcode(self):
@@ -227,17 +221,19 @@
                 status = 'stopped[%s]' % _exitcode_to_name.get(status, status)
 
         return '<%s(%s, %s%s)>' % (type(self).__name__, self._name,
-                                   status, self._daemonic and ' daemon' or '')
+                                   status, self.daemon and ' daemon' or '')
 
     ##
 
     def _bootstrap(self):
-        from . import util
-        global _current_process
+        from . import util, context
+        global _current_process, _process_counter, _children
 
         try:
-            self._children = set()
-            self._counter = itertools.count(1)
+            if self._start_method is not None:
+                context._force_start_method(self._start_method)
+            _process_counter = itertools.count(1)
+            _children = set()
             if sys.stdin is not None:
                 try:
                     sys.stdin.close()
@@ -285,8 +281,8 @@
 
 class AuthenticationString(bytes):
     def __reduce__(self):
-        from .forking import Popen
-        if not Popen.thread_is_spawning():
+        from .context import get_spawning_popen
+        if get_spawning_popen() is None:
             raise TypeError(
                 'Pickling an AuthenticationString object is '
                 'disallowed for security reasons'
@@ -297,20 +293,29 @@
 # Create object representing the main process
 #
 
-class _MainProcess(Process):
+class _MainProcess(BaseProcess):
 
     def __init__(self):
         self._identity = ()
-        self._daemonic = False
         self._name = 'MainProcess'
         self._parent_pid = None
         self._popen = None
-        self._counter = itertools.count(1)
-        self._children = set()
-        self._authkey = AuthenticationString(os.urandom(32))
-        self._tempdir = None
+        self._config = {'authkey': AuthenticationString(os.urandom(32)),
+                        'semprefix': '/mp'}
+        # Note that some versions of FreeBSD only allow named
+        # semaphores to have names of up to 14 characters.  Therefore
+        # we choose a short prefix.
+        #
+        # On MacOSX in a sandbox it may be necessary to use a
+        # different prefix -- see #19478.
+        #
+        # Everything in self._config will be inherited by descendant
+        # processes.
+
 
 _current_process = _MainProcess()
+_process_counter = itertools.count(1)
+_children = set()
 del _MainProcess
 
 #
diff --git a/Lib/multiprocessing/queues.py b/Lib/multiprocessing/queues.py
index 37271fb..f650771 100644
--- a/Lib/multiprocessing/queues.py
+++ b/Lib/multiprocessing/queues.py
@@ -18,11 +18,14 @@
 import errno
 
 from queue import Empty, Full
+
 import _multiprocessing
-from multiprocessing.connection import Pipe
-from multiprocessing.synchronize import Lock, BoundedSemaphore, Semaphore, Condition
-from multiprocessing.util import debug, info, Finalize, register_after_fork
-from multiprocessing.forking import assert_spawning
+
+from . import connection
+from . import context
+
+from .util import debug, info, Finalize, register_after_fork, is_exiting
+from .reduction import ForkingPickler
 
 #
 # Queue type using a pipe, buffer and thread
@@ -30,18 +33,18 @@
 
 class Queue(object):
 
-    def __init__(self, maxsize=0):
+    def __init__(self, maxsize=0, *, ctx):
         if maxsize <= 0:
             maxsize = _multiprocessing.SemLock.SEM_VALUE_MAX
         self._maxsize = maxsize
-        self._reader, self._writer = Pipe(duplex=False)
-        self._rlock = Lock()
+        self._reader, self._writer = connection.Pipe(duplex=False)
+        self._rlock = ctx.Lock()
         self._opid = os.getpid()
         if sys.platform == 'win32':
             self._wlock = None
         else:
-            self._wlock = Lock()
-        self._sem = BoundedSemaphore(maxsize)
+            self._wlock = ctx.Lock()
+        self._sem = ctx.BoundedSemaphore(maxsize)
         # For use by concurrent.futures
         self._ignore_epipe = False
 
@@ -51,7 +54,7 @@
             register_after_fork(self, Queue._after_fork)
 
     def __getstate__(self):
-        assert_spawning(self)
+        context.assert_spawning(self)
         return (self._ignore_epipe, self._maxsize, self._reader, self._writer,
                 self._rlock, self._wlock, self._sem, self._opid)
 
@@ -69,8 +72,8 @@
         self._joincancelled = False
         self._closed = False
         self._close = None
-        self._send = self._writer.send
-        self._recv = self._reader.recv
+        self._send_bytes = self._writer.send_bytes
+        self._recv_bytes = self._reader.recv_bytes
         self._poll = self._reader.poll
 
     def put(self, obj, block=True, timeout=None):
@@ -89,14 +92,9 @@
 
     def get(self, block=True, timeout=None):
         if block and timeout is None:
-            self._rlock.acquire()
-            try:
-                res = self._recv()
-                self._sem.release()
-                return res
-            finally:
-                self._rlock.release()
-
+            with self._rlock:
+                res = self._recv_bytes()
+            self._sem.release()
         else:
             if block:
                 deadline = time.time() + timeout
@@ -109,11 +107,12 @@
                         raise Empty
                 elif not self._poll():
                     raise Empty
-                res = self._recv()
+                res = self._recv_bytes()
                 self._sem.release()
-                return res
             finally:
                 self._rlock.release()
+        # unserialize the data after having released the lock
+        return ForkingPickler.loads(res)
 
     def qsize(self):
         # Raises NotImplementedError on Mac OSX because of broken sem_getvalue()
@@ -158,7 +157,7 @@
         self._buffer.clear()
         self._thread = threading.Thread(
             target=Queue._feed,
-            args=(self._buffer, self._notempty, self._send,
+            args=(self._buffer, self._notempty, self._send_bytes,
                   self._wlock, self._writer.close, self._ignore_epipe),
             name='QueueFeederThread'
             )
@@ -210,10 +209,8 @@
             notempty.release()
 
     @staticmethod
-    def _feed(buffer, notempty, send, writelock, close, ignore_epipe):
+    def _feed(buffer, notempty, send_bytes, writelock, close, ignore_epipe):
         debug('starting thread to feed data to pipe')
-        from .util import is_exiting
-
         nacquire = notempty.acquire
         nrelease = notempty.release
         nwait = notempty.wait
@@ -241,12 +238,14 @@
                             close()
                             return
 
+                        # serialize the data before acquiring the lock
+                        obj = ForkingPickler.dumps(obj)
                         if wacquire is None:
-                            send(obj)
+                            send_bytes(obj)
                         else:
                             wacquire()
                             try:
-                                send(obj)
+                                send_bytes(obj)
                             finally:
                                 wrelease()
                 except IndexError:
@@ -279,10 +278,10 @@
 
 class JoinableQueue(Queue):
 
-    def __init__(self, maxsize=0):
-        Queue.__init__(self, maxsize)
-        self._unfinished_tasks = Semaphore(0)
-        self._cond = Condition()
+    def __init__(self, maxsize=0, *, ctx):
+        Queue.__init__(self, maxsize, ctx=ctx)
+        self._unfinished_tasks = ctx.Semaphore(0)
+        self._cond = ctx.Condition()
 
     def __getstate__(self):
         return Queue.__getstate__(self) + (self._cond, self._unfinished_tasks)
@@ -332,48 +331,37 @@
 
 class SimpleQueue(object):
 
-    def __init__(self):
-        self._reader, self._writer = Pipe(duplex=False)
-        self._rlock = Lock()
+    def __init__(self, *, ctx):
+        self._reader, self._writer = connection.Pipe(duplex=False)
+        self._rlock = ctx.Lock()
         self._poll = self._reader.poll
         if sys.platform == 'win32':
             self._wlock = None
         else:
-            self._wlock = Lock()
-        self._make_methods()
+            self._wlock = ctx.Lock()
 
     def empty(self):
         return not self._poll()
 
     def __getstate__(self):
-        assert_spawning(self)
+        context.assert_spawning(self)
         return (self._reader, self._writer, self._rlock, self._wlock)
 
     def __setstate__(self, state):
         (self._reader, self._writer, self._rlock, self._wlock) = state
-        self._make_methods()
 
-    def _make_methods(self):
-        recv = self._reader.recv
-        racquire, rrelease = self._rlock.acquire, self._rlock.release
-        def get():
-            racquire()
-            try:
-                return recv()
-            finally:
-                rrelease()
-        self.get = get
+    def get(self):
+        with self._rlock:
+            res = self._reader.recv_bytes()
+        # unserialize the data after having released the lock
+        return ForkingPickler.loads(res)
 
+    def put(self, obj):
+        # serialize the data before acquiring the lock
+        obj = ForkingPickler.dumps(obj)
         if self._wlock is None:
             # writes to a message oriented win32 pipe are atomic
-            self.put = self._writer.send
+            self._writer.send_bytes(obj)
         else:
-            send = self._writer.send
-            wacquire, wrelease = self._wlock.acquire, self._wlock.release
-            def put(obj):
-                wacquire()
-                try:
-                    return send(obj)
-                finally:
-                    wrelease()
-            self.put = put
+            with self._wlock:
+                self._writer.send_bytes(obj)
diff --git a/Lib/multiprocessing/reduction.py b/Lib/multiprocessing/reduction.py
index 656fa8f..8f209b4 100644
--- a/Lib/multiprocessing/reduction.py
+++ b/Lib/multiprocessing/reduction.py
@@ -1,6 +1,5 @@
 #
-# Module to allow connection and socket objects to be transferred
-# between processes
+# Module which deals with pickling of objects.
 #
 # multiprocessing/reduction.py
 #
@@ -8,27 +7,56 @@
 # Licensed to PSF under a Contributor Agreement.
 #
 
-__all__ = ['reduce_socket', 'reduce_connection', 'send_handle', 'recv_handle']
-
+import copyreg
+import functools
+import io
 import os
-import sys
+import pickle
 import socket
-import threading
-import struct
-import signal
+import sys
 
-from multiprocessing import current_process
-from multiprocessing.util import register_after_fork, debug, sub_debug
-from multiprocessing.util import is_exiting, sub_warning
+from . import context
 
+__all__ = ['send_handle', 'recv_handle', 'ForkingPickler', 'register', 'dump']
+
+
+HAVE_SEND_HANDLE = (sys.platform == 'win32' or
+                    (hasattr(socket, 'CMSG_LEN') and
+                     hasattr(socket, 'SCM_RIGHTS') and
+                     hasattr(socket.socket, 'sendmsg')))
 
 #
-#
+# Pickler subclass
 #
 
-if not(sys.platform == 'win32' or (hasattr(socket, 'CMSG_LEN') and
-                                   hasattr(socket, 'SCM_RIGHTS'))):
-    raise ImportError('pickling of connections not supported')
+class ForkingPickler(pickle.Pickler):
+    '''Pickler subclass used by multiprocessing.'''
+    _extra_reducers = {}
+    _copyreg_dispatch_table = copyreg.dispatch_table
+
+    def __init__(self, *args):
+        super().__init__(*args)
+        self.dispatch_table = self._copyreg_dispatch_table.copy()
+        self.dispatch_table.update(self._extra_reducers)
+
+    @classmethod
+    def register(cls, type, reduce):
+        '''Register a reduce function for a type.'''
+        cls._extra_reducers[type] = reduce
+
+    @classmethod
+    def dumps(cls, obj, protocol=None):
+        buf = io.BytesIO()
+        cls(buf, protocol).dump(obj)
+        return buf.getbuffer()
+
+    loads = pickle.loads
+
+register = ForkingPickler.register
+
+def dump(obj, file, protocol=None):
+    '''Replacement for pickle.dump() using ForkingPickler.'''
+    ForkingPickler(file, protocol).dump(obj)
 
 #
 # Platform specific definitions
@@ -36,20 +64,44 @@
 
 if sys.platform == 'win32':
     # Windows
-    __all__ += ['reduce_pipe_connection']
+    __all__ += ['DupHandle', 'duplicate', 'steal_handle']
     import _winapi
 
+    def duplicate(handle, target_process=None, inheritable=False):
+        '''Duplicate a handle.  (target_process is a handle not a pid!)'''
+        if target_process is None:
+            target_process = _winapi.GetCurrentProcess()
+        return _winapi.DuplicateHandle(
+            _winapi.GetCurrentProcess(), handle, target_process,
+            0, inheritable, _winapi.DUPLICATE_SAME_ACCESS)
+
+    def steal_handle(source_pid, handle):
+        '''Steal a handle from process identified by source_pid.'''
+        source_process_handle = _winapi.OpenProcess(
+            _winapi.PROCESS_DUP_HANDLE, False, source_pid)
+        try:
+            return _winapi.DuplicateHandle(
+                source_process_handle, handle,
+                _winapi.GetCurrentProcess(), 0, False,
+                _winapi.DUPLICATE_SAME_ACCESS | _winapi.DUPLICATE_CLOSE_SOURCE)
+        finally:
+            _winapi.CloseHandle(source_process_handle)
+
     def send_handle(conn, handle, destination_pid):
+        '''Send a handle over a local connection.'''
         dh = DupHandle(handle, _winapi.DUPLICATE_SAME_ACCESS, destination_pid)
         conn.send(dh)
 
     def recv_handle(conn):
+        '''Receive a handle over a local connection.'''
         return conn.recv().detach()
 
     class DupHandle(object):
+        '''Picklable wrapper for a handle.'''
         def __init__(self, handle, access, pid=None):
-            # duplicate handle for process with given pid
             if pid is None:
+                # We just duplicate the handle in the current process and
+                # let the receiving process steal the handle.
                 pid = os.getpid()
             proc = _winapi.OpenProcess(_winapi.PROCESS_DUP_HANDLE, False, pid)
             try:
@@ -62,9 +114,12 @@
             self._pid = pid
 
         def detach(self):
+            '''Get the handle.  This should only be called once.'''
             # retrieve handle from process which currently owns it
             if self._pid == os.getpid():
+                # The handle has already been duplicated for this process.
                 return self._handle
+            # We must steal the handle from the process whose pid is self._pid.
             proc = _winapi.OpenProcess(_winapi.PROCESS_DUP_HANDLE, False,
                                        self._pid)
             try:
@@ -74,207 +129,112 @@
             finally:
                 _winapi.CloseHandle(proc)
 
-    class DupSocket(object):
-        def __init__(self, sock):
-            new_sock = sock.dup()
-            def send(conn, pid):
-                share = new_sock.share(pid)
-                conn.send_bytes(share)
-            self._id = resource_sharer.register(send, new_sock.close)
-
-        def detach(self):
-            conn = resource_sharer.get_connection(self._id)
-            try:
-                share = conn.recv_bytes()
-                return socket.fromshare(share)
-            finally:
-                conn.close()
-
-    def reduce_socket(s):
-        return rebuild_socket, (DupSocket(s),)
-
-    def rebuild_socket(ds):
-        return ds.detach()
-
-    def reduce_connection(conn):
-        handle = conn.fileno()
-        with socket.fromfd(handle, socket.AF_INET, socket.SOCK_STREAM) as s:
-            ds = DupSocket(s)
-            return rebuild_connection, (ds, conn.readable, conn.writable)
-
-    def rebuild_connection(ds, readable, writable):
-        from .connection import Connection
-        sock = ds.detach()
-        return Connection(sock.detach(), readable, writable)
-
-    def reduce_pipe_connection(conn):
-        access = ((_winapi.FILE_GENERIC_READ if conn.readable else 0) |
-                  (_winapi.FILE_GENERIC_WRITE if conn.writable else 0))
-        dh = DupHandle(conn.fileno(), access)
-        return rebuild_pipe_connection, (dh, conn.readable, conn.writable)
-
-    def rebuild_pipe_connection(dh, readable, writable):
-        from .connection import PipeConnection
-        handle = dh.detach()
-        return PipeConnection(handle, readable, writable)
-
 else:
     # Unix
+    __all__ += ['DupFd', 'sendfds', 'recvfds']
+    import array
 
     # On MacOSX we should acknowledge receipt of fds -- see Issue14669
     ACKNOWLEDGE = sys.platform == 'darwin'
 
-    def send_handle(conn, handle, destination_pid):
-        with socket.fromfd(conn.fileno(), socket.AF_UNIX, socket.SOCK_STREAM) as s:
-            s.sendmsg([b'x'], [(socket.SOL_SOCKET, socket.SCM_RIGHTS,
-                                struct.pack("@i", handle))])
-        if ACKNOWLEDGE and conn.recv_bytes() != b'ACK':
+    def sendfds(sock, fds):
+        '''Send an array of fds over an AF_UNIX socket.'''
+        fds = array.array('i', fds)
+        msg = bytes([len(fds) % 256])
+        sock.sendmsg([msg], [(socket.SOL_SOCKET, socket.SCM_RIGHTS, fds)])
+        if ACKNOWLEDGE and sock.recv(1) != b'A':
             raise RuntimeError('did not receive acknowledgement of fd')
 
-    def recv_handle(conn):
-        size = struct.calcsize("@i")
+    def recvfds(sock, size):
+        '''Receive an array of fds over an AF_UNIX socket.'''
+        a = array.array('i')
+        bytes_size = a.itemsize * size
+        msg, ancdata, flags, addr = sock.recvmsg(1, socket.CMSG_LEN(bytes_size))
+        if not msg and not ancdata:
+            raise EOFError
+        try:
+            if ACKNOWLEDGE:
+                sock.send(b'A')
+            if len(ancdata) != 1:
+                raise RuntimeError('received %d items of ancdata' %
+                                   len(ancdata))
+            cmsg_level, cmsg_type, cmsg_data = ancdata[0]
+            if (cmsg_level == socket.SOL_SOCKET and
+                cmsg_type == socket.SCM_RIGHTS):
+                if len(cmsg_data) % a.itemsize != 0:
+                    raise ValueError
+                a.frombytes(cmsg_data)
+                assert len(a) % 256 == msg[0]
+                return list(a)
+        except (ValueError, IndexError):
+            pass
+        raise RuntimeError('Invalid data received')
+
+    def send_handle(conn, handle, destination_pid):
+        '''Send a handle over a local connection.'''
         with socket.fromfd(conn.fileno(), socket.AF_UNIX, socket.SOCK_STREAM) as s:
-            msg, ancdata, flags, addr = s.recvmsg(1, socket.CMSG_LEN(size))
-            try:
-                if ACKNOWLEDGE:
-                    conn.send_bytes(b'ACK')
-                cmsg_level, cmsg_type, cmsg_data = ancdata[0]
-                if (cmsg_level == socket.SOL_SOCKET and
-                    cmsg_type == socket.SCM_RIGHTS):
-                    return struct.unpack("@i", cmsg_data[:size])[0]
-            except (ValueError, IndexError, struct.error):
-                pass
-            raise RuntimeError('Invalid data received')
+            sendfds(s, [handle])
 
-    class DupFd(object):
-        def __init__(self, fd):
-            new_fd = os.dup(fd)
-            def send(conn, pid):
-                send_handle(conn, new_fd, pid)
-            def close():
-                os.close(new_fd)
-            self._id = resource_sharer.register(send, close)
+    def recv_handle(conn):
+        '''Receive a handle over a local connection.'''
+        with socket.fromfd(conn.fileno(), socket.AF_UNIX, socket.SOCK_STREAM) as s:
+            return recvfds(s, 1)[0]
 
-        def detach(self):
-            conn = resource_sharer.get_connection(self._id)
-            try:
-                return recv_handle(conn)
-            finally:
-                conn.close()
+    def DupFd(fd):
+        '''Return a wrapper for an fd.'''
+        popen_obj = context.get_spawning_popen()
+        if popen_obj is not None:
+            return popen_obj.DupFd(popen_obj.duplicate_for_child(fd))
+        elif HAVE_SEND_HANDLE:
+            from . import resource_sharer
+            return resource_sharer.DupFd(fd)
+        else:
+            raise ValueError('SCM_RIGHTS appears not to be available')
 
-    def reduce_socket(s):
+#
+# Try making some callable types picklable
+#
+
+def _reduce_method(m):
+    if m.__self__ is None:
+        return getattr, (m.__class__, m.__func__.__name__)
+    else:
+        return getattr, (m.__self__, m.__func__.__name__)
+class _C:
+    def f(self):
+        pass
+register(type(_C().f), _reduce_method)
+
+
+def _reduce_method_descriptor(m):
+    return getattr, (m.__objclass__, m.__name__)
+register(type(list.append), _reduce_method_descriptor)
+register(type(int.__add__), _reduce_method_descriptor)
+
+
+def _reduce_partial(p):
+    return _rebuild_partial, (p.func, p.args, p.keywords or {})
+def _rebuild_partial(func, args, keywords):
+    return functools.partial(func, *args, **keywords)
+register(functools.partial, _reduce_partial)
+
+#
+# Make sockets picklable
+#
+
+if sys.platform == 'win32':
+    def _reduce_socket(s):
+        from .resource_sharer import DupSocket
+        return _rebuild_socket, (DupSocket(s),)
+    def _rebuild_socket(ds):
+        return ds.detach()
+    register(socket.socket, _reduce_socket)
+
+else:
+    def _reduce_socket(s):
         df = DupFd(s.fileno())
-        return rebuild_socket, (df, s.family, s.type, s.proto)
-
-    def rebuild_socket(df, family, type, proto):
+        return _rebuild_socket, (df, s.family, s.type, s.proto)
+    def _rebuild_socket(df, family, type, proto):
         fd = df.detach()
-        s = socket.fromfd(fd, family, type, proto)
-        os.close(fd)
-        return s
-
-    def reduce_connection(conn):
-        df = DupFd(conn.fileno())
-        return rebuild_connection, (df, conn.readable, conn.writable)
-
-    def rebuild_connection(df, readable, writable):
-        from .connection import Connection
-        fd = df.detach()
-        return Connection(fd, readable, writable)
-
-#
-# Server which shares registered resources with clients
-#
-
-class ResourceSharer(object):
-    def __init__(self):
-        self._key = 0
-        self._cache = {}
-        self._old_locks = []
-        self._lock = threading.Lock()
-        self._listener = None
-        self._address = None
-        self._thread = None
-        register_after_fork(self, ResourceSharer._afterfork)
-
-    def register(self, send, close):
-        with self._lock:
-            if self._address is None:
-                self._start()
-            self._key += 1
-            self._cache[self._key] = (send, close)
-            return (self._address, self._key)
-
-    @staticmethod
-    def get_connection(ident):
-        from .connection import Client
-        address, key = ident
-        c = Client(address, authkey=current_process().authkey)
-        c.send((key, os.getpid()))
-        return c
-
-    def stop(self, timeout=None):
-        from .connection import Client
-        with self._lock:
-            if self._address is not None:
-                c = Client(self._address, authkey=current_process().authkey)
-                c.send(None)
-                c.close()
-                self._thread.join(timeout)
-                if self._thread.is_alive():
-                    sub_warn('ResourceSharer thread did not stop when asked')
-                self._listener.close()
-                self._thread = None
-                self._address = None
-                self._listener = None
-                for key, (send, close) in self._cache.items():
-                    close()
-                self._cache.clear()
-
-    def _afterfork(self):
-        for key, (send, close) in self._cache.items():
-            close()
-        self._cache.clear()
-        # If self._lock was locked at the time of the fork, it may be broken
-        # -- see issue 6721.  Replace it without letting it be gc'ed.
-        self._old_locks.append(self._lock)
-        self._lock = threading.Lock()
-        if self._listener is not None:
-            self._listener.close()
-        self._listener = None
-        self._address = None
-        self._thread = None
-
-    def _start(self):
-        from .connection import Listener
-        assert self._listener is None
-        debug('starting listener and thread for sending handles')
-        self._listener = Listener(authkey=current_process().authkey)
-        self._address = self._listener.address
-        t = threading.Thread(target=self._serve)
-        t.daemon = True
-        t.start()
-        self._thread = t
-
-    def _serve(self):
-        if hasattr(signal, 'pthread_sigmask'):
-            signal.pthread_sigmask(signal.SIG_BLOCK, range(1, signal.NSIG))
-        while 1:
-            try:
-                conn = self._listener.accept()
-                msg = conn.recv()
-                if msg is None:
-                    break
-                key, destination_pid = msg
-                send, close = self._cache.pop(key)
-                send(conn, destination_pid)
-                close()
-                conn.close()
-            except:
-                if not is_exiting():
-                    import traceback
-                    sub_warning(
-                        'thread for sharing handles raised exception :\n' +
-                        '-'*79 + '\n' + traceback.format_exc() + '-'*79
-                        )
-
-resource_sharer = ResourceSharer()
+        return socket.socket(family, type, proto, fileno=fd)
+    register(socket.socket, _reduce_socket)
diff --git a/Lib/multiprocessing/resource_sharer.py b/Lib/multiprocessing/resource_sharer.py
new file mode 100644
index 0000000..5e46fc6
--- /dev/null
+++ b/Lib/multiprocessing/resource_sharer.py
@@ -0,0 +1,158 @@
+#
+# We use a background thread for sharing fds on Unix, and for sharing sockets on
+# Windows.
+#
+# A client which wants to pickle a resource registers it with the resource
+# sharer and gets an identifier in return.  The unpickling process will connect
+# to the resource sharer, sends the identifier and its pid, and then receives
+# the resource.
+#
+
+import os
+import signal
+import socket
+import sys
+import threading
+
+from . import process
+from . import reduction
+from . import util
+
+__all__ = ['stop']
+
+
+if sys.platform == 'win32':
+    __all__ += ['DupSocket']
+
+    class DupSocket(object):
+        '''Picklable wrapper for a socket.'''
+        def __init__(self, sock):
+            new_sock = sock.dup()
+            def send(conn, pid):
+                share = new_sock.share(pid)
+                conn.send_bytes(share)
+            self._id = _resource_sharer.register(send, new_sock.close)
+
+        def detach(self):
+            '''Get the socket.  This should only be called once.'''
+            with _resource_sharer.get_connection(self._id) as conn:
+                share = conn.recv_bytes()
+                return socket.fromshare(share)
+
+else:
+    __all__ += ['DupFd']
+
+    class DupFd(object):
+        '''Wrapper for fd which can be used at any time.'''
+        def __init__(self, fd):
+            new_fd = os.dup(fd)
+            def send(conn, pid):
+                reduction.send_handle(conn, new_fd, pid)
+            def close():
+                os.close(new_fd)
+            self._id = _resource_sharer.register(send, close)
+
+        def detach(self):
+            '''Get the fd.  This should only be called once.'''
+            with _resource_sharer.get_connection(self._id) as conn:
+                return reduction.recv_handle(conn)
+
+
+class _ResourceSharer(object):
+    '''Manager for resouces using background thread.'''
+    def __init__(self):
+        self._key = 0
+        self._cache = {}
+        self._old_locks = []
+        self._lock = threading.Lock()
+        self._listener = None
+        self._address = None
+        self._thread = None
+        util.register_after_fork(self, _ResourceSharer._afterfork)
+
+    def register(self, send, close):
+        '''Register resource, returning an identifier.'''
+        with self._lock:
+            if self._address is None:
+                self._start()
+            self._key += 1
+            self._cache[self._key] = (send, close)
+            return (self._address, self._key)
+
+    @staticmethod
+    def get_connection(ident):
+        '''Return connection from which to receive identified resource.'''
+        from .connection import Client
+        address, key = ident
+        c = Client(address, authkey=process.current_process().authkey)
+        c.send((key, os.getpid()))
+        return c
+
+    def stop(self, timeout=None):
+        '''Stop the background thread and clear registered resources.'''
+        from .connection import Client
+        with self._lock:
+            if self._address is not None:
+                c = Client(self._address,
+                           authkey=process.current_process().authkey)
+                c.send(None)
+                c.close()
+                self._thread.join(timeout)
+                if self._thread.is_alive():
+                    util.sub_warning('_ResourceSharer thread did '
+                                     'not stop when asked')
+                self._listener.close()
+                self._thread = None
+                self._address = None
+                self._listener = None
+                for key, (send, close) in self._cache.items():
+                    close()
+                self._cache.clear()
+
+    def _afterfork(self):
+        for key, (send, close) in self._cache.items():
+            close()
+        self._cache.clear()
+        # If self._lock was locked at the time of the fork, it may be broken
+        # -- see issue 6721.  Replace it without letting it be gc'ed.
+        self._old_locks.append(self._lock)
+        self._lock = threading.Lock()
+        if self._listener is not None:
+            self._listener.close()
+        self._listener = None
+        self._address = None
+        self._thread = None
+
+    def _start(self):
+        from .connection import Listener
+        assert self._listener is None
+        util.debug('starting listener and thread for sending handles')
+        self._listener = Listener(authkey=process.current_process().authkey)
+        self._address = self._listener.address
+        t = threading.Thread(target=self._serve)
+        t.daemon = True
+        t.start()
+        self._thread = t
+
+    def _serve(self):
+        if hasattr(signal, 'pthread_sigmask'):
+            signal.pthread_sigmask(signal.SIG_BLOCK, range(1, signal.NSIG))
+        while 1:
+            try:
+                with self._listener.accept() as conn:
+                    msg = conn.recv()
+                    if msg is None:
+                        break
+                    key, destination_pid = msg
+                    send, close = self._cache.pop(key)
+                    try:
+                        send(conn, destination_pid)
+                    finally:
+                        close()
+            except:
+                if not util.is_exiting():
+                    sys.excepthook(*sys.exc_info())
+
+
+_resource_sharer = _ResourceSharer()
+stop = _resource_sharer.stop
diff --git a/Lib/multiprocessing/semaphore_tracker.py b/Lib/multiprocessing/semaphore_tracker.py
new file mode 100644
index 0000000..de7738e
--- /dev/null
+++ b/Lib/multiprocessing/semaphore_tracker.py
@@ -0,0 +1,143 @@
+#
+# On Unix we run a server process which keeps track of unlinked
+# semaphores. The server ignores SIGINT and SIGTERM and reads from a
+# pipe.  Every other process of the program has a copy of the writable
+# end of the pipe, so we get EOF when all other processes have exited.
+# Then the server process unlinks any remaining semaphore names.
+#
+# This is important because the system only supports a limited number
+# of named semaphores, and they will not be automatically removed till
+# the next reboot.  Without this semaphore tracker process, "killall
+# python" would probably leave unlinked semaphores.
+#
+
+import os
+import signal
+import sys
+import threading
+import warnings
+import _multiprocessing
+
+from . import spawn
+from . import util
+
+__all__ = ['ensure_running', 'register', 'unregister']
+
+
+class SemaphoreTracker(object):
+
+    def __init__(self):
+        self._lock = threading.Lock()
+        self._fd = None
+
+    def getfd(self):
+        self.ensure_running()
+        return self._fd
+
+    def ensure_running(self):
+        '''Make sure that semaphore tracker process is running.
+
+        This can be run from any process.  Usually a child process will use
+        the semaphore created by its parent.'''
+        with self._lock:
+            if self._fd is not None:
+                return
+            fds_to_pass = []
+            try:
+                fds_to_pass.append(sys.stderr.fileno())
+            except Exception:
+                pass
+            cmd = 'from multiprocessing.semaphore_tracker import main;main(%d)'
+            r, w = os.pipe()
+            try:
+                fds_to_pass.append(r)
+                # process will out live us, so no need to wait on pid
+                exe = spawn.get_executable()
+                args = [exe] + util._args_from_interpreter_flags()
+                args += ['-c', cmd % r]
+                util.spawnv_passfds(exe, args, fds_to_pass)
+            except:
+                os.close(w)
+                raise
+            else:
+                self._fd = w
+            finally:
+                os.close(r)
+
+    def register(self, name):
+        '''Register name of semaphore with semaphore tracker.'''
+        self._send('REGISTER', name)
+
+    def unregister(self, name):
+        '''Unregister name of semaphore with semaphore tracker.'''
+        self._send('UNREGISTER', name)
+
+    def _send(self, cmd, name):
+        self.ensure_running()
+        msg = '{0}:{1}\n'.format(cmd, name).encode('ascii')
+        if len(name) > 512:
+            # posix guarantees that writes to a pipe of less than PIPE_BUF
+            # bytes are atomic, and that PIPE_BUF >= 512
+            raise ValueError('name too long')
+        nbytes = os.write(self._fd, msg)
+        assert nbytes == len(msg)
+
+
+_semaphore_tracker = SemaphoreTracker()
+ensure_running = _semaphore_tracker.ensure_running
+register = _semaphore_tracker.register
+unregister = _semaphore_tracker.unregister
+getfd = _semaphore_tracker.getfd
+
+
+def main(fd):
+    '''Run semaphore tracker.'''
+    # protect the process from ^C and "killall python" etc
+    signal.signal(signal.SIGINT, signal.SIG_IGN)
+    signal.signal(signal.SIGTERM, signal.SIG_IGN)
+
+    for f in (sys.stdin, sys.stdout):
+        try:
+            f.close()
+        except Exception:
+            pass
+
+    cache = set()
+    try:
+        # keep track of registered/unregistered semaphores
+        with open(fd, 'rb') as f:
+            for line in f:
+                try:
+                    cmd, name = line.strip().split(b':')
+                    if cmd == b'REGISTER':
+                        cache.add(name)
+                    elif cmd == b'UNREGISTER':
+                        cache.remove(name)
+                    else:
+                        raise RuntimeError('unrecognized command %r' % cmd)
+                except Exception:
+                    try:
+                        sys.excepthook(*sys.exc_info())
+                    except:
+                        pass
+    finally:
+        # all processes have terminated; cleanup any remaining semaphores
+        if cache:
+            try:
+                warnings.warn('semaphore_tracker: There appear to be %d '
+                              'leaked semaphores to clean up at shutdown' %
+                              len(cache))
+            except Exception:
+                pass
+        for name in cache:
+            # For some reason the process which created and registered this
+            # semaphore has failed to unregister it. Presumably it has died.
+            # We therefore unlink it.
+            try:
+                name = name.decode('ascii')
+                try:
+                    _multiprocessing.sem_unlink(name)
+                except Exception as e:
+                    warnings.warn('semaphore_tracker: %r: %s' % (name, e))
+            finally:
+                pass
diff --git a/Lib/multiprocessing/sharedctypes.py b/Lib/multiprocessing/sharedctypes.py
index a358ed4..0c17825 100644
--- a/Lib/multiprocessing/sharedctypes.py
+++ b/Lib/multiprocessing/sharedctypes.py
@@ -10,8 +10,11 @@
 import ctypes
 import weakref
 
-from multiprocessing import heap, RLock
-from multiprocessing.forking import assert_spawning, ForkingPickler
+from . import heap
+from . import get_context
+
+from .context import assert_spawning
+from .reduction import ForkingPickler
 
 __all__ = ['RawValue', 'RawArray', 'Value', 'Array', 'copy', 'synchronized']
 
@@ -63,7 +66,7 @@
         result.__init__(*size_or_initializer)
         return result
 
-def Value(typecode_or_type, *args, lock=True):
+def Value(typecode_or_type, *args, lock=True, ctx=None):
     '''
     Return a synchronization wrapper for a Value
     '''
@@ -71,12 +74,13 @@
     if lock is False:
         return obj
     if lock in (True, None):
-        lock = RLock()
+        ctx = ctx or get_context()
+        lock = ctx.RLock()
     if not hasattr(lock, 'acquire'):
         raise AttributeError("'%r' has no method 'acquire'" % lock)
-    return synchronized(obj, lock)
+    return synchronized(obj, lock, ctx=ctx)
 
-def Array(typecode_or_type, size_or_initializer, *, lock=True):
+def Array(typecode_or_type, size_or_initializer, *, lock=True, ctx=None):
     '''
     Return a synchronization wrapper for a RawArray
     '''
@@ -84,25 +88,27 @@
     if lock is False:
         return obj
     if lock in (True, None):
-        lock = RLock()
+        ctx = ctx or get_context()
+        lock = ctx.RLock()
     if not hasattr(lock, 'acquire'):
         raise AttributeError("'%r' has no method 'acquire'" % lock)
-    return synchronized(obj, lock)
+    return synchronized(obj, lock, ctx=ctx)
 
 def copy(obj):
     new_obj = _new_value(type(obj))
     ctypes.pointer(new_obj)[0] = obj
     return new_obj
 
-def synchronized(obj, lock=None):
+def synchronized(obj, lock=None, ctx=None):
     assert not isinstance(obj, SynchronizedBase), 'object already synchronized'
+    ctx = ctx or get_context()
 
     if isinstance(obj, ctypes._SimpleCData):
-        return Synchronized(obj, lock)
+        return Synchronized(obj, lock, ctx)
     elif isinstance(obj, ctypes.Array):
         if obj._type_ is ctypes.c_char:
-            return SynchronizedString(obj, lock)
-        return SynchronizedArray(obj, lock)
+            return SynchronizedString(obj, lock, ctx)
+        return SynchronizedArray(obj, lock, ctx)
     else:
         cls = type(obj)
         try:
@@ -112,7 +118,7 @@
             d = dict((name, make_property(name)) for name in names)
             classname = 'Synchronized' + cls.__name__
             scls = class_cache[cls] = type(classname, (SynchronizedBase,), d)
-        return scls(obj, lock)
+        return scls(obj, lock, ctx)
 
 #
 # Functions for pickling/unpickling
@@ -172,9 +178,13 @@
 
 class SynchronizedBase(object):
 
-    def __init__(self, obj, lock=None):
+    def __init__(self, obj, lock=None, ctx=None):
         self._obj = obj
-        self._lock = lock or RLock()
+        if lock:
+            self._lock = lock
+        else:
+            ctx = ctx or get_context(force=True)
+            self._lock = ctx.RLock()
         self.acquire = self._lock.acquire
         self.release = self._lock.release
 
diff --git a/Lib/multiprocessing/spawn.py b/Lib/multiprocessing/spawn.py
new file mode 100644
index 0000000..336e479
--- /dev/null
+++ b/Lib/multiprocessing/spawn.py
@@ -0,0 +1,287 @@
+#
+# Code used to start processes when using the spawn or forkserver
+# start methods.
+#
+# multiprocessing/spawn.py
+#
+# Copyright (c) 2006-2008, R Oudkerk
+# Licensed to PSF under a Contributor Agreement.
+#
+
+import os
+import pickle
+import sys
+import runpy
+import types
+
+from . import get_start_method, set_start_method
+from . import process
+from . import util
+
+__all__ = ['_main', 'freeze_support', 'set_executable', 'get_executable',
+           'get_preparation_data', 'get_command_line', 'import_main_path']
+
+#
+# _python_exe is the assumed path to the python executable.
+# People embedding Python want to modify it.
+#
+
+if sys.platform != 'win32':
+    WINEXE = False
+    WINSERVICE = False
+else:
+    WINEXE = (sys.platform == 'win32' and getattr(sys, 'frozen', False))
+    WINSERVICE = sys.executable.lower().endswith("pythonservice.exe")
+
+if WINSERVICE:
+    _python_exe = os.path.join(sys.exec_prefix, 'python.exe')
+else:
+    _python_exe = sys.executable
+
+def set_executable(exe):
+    global _python_exe
+    _python_exe = exe
+
+def get_executable():
+    return _python_exe
+
+#
+#
+#
+
+def is_forking(argv):
+    '''
+    Return whether commandline indicates we are forking
+    '''
+    if len(argv) >= 2 and argv[1] == '--multiprocessing-fork':
+        return True
+    else:
+        return False
+
+
+def freeze_support():
+    '''
+    Run code for process object if this in not the main process
+    '''
+    if is_forking(sys.argv):
+        kwds = {}
+        for arg in sys.argv[2:]:
+            name, value = arg.split('=')
+            if value == 'None':
+                kwds[name] = None
+            else:
+                kwds[name] = int(value)
+        spawn_main(**kwds)
+        sys.exit()
+
+
+def get_command_line(**kwds):
+    '''
+    Returns prefix of command line used for spawning a child process
+    '''
+    if getattr(sys, 'frozen', False):
+        return ([sys.executable, '--multiprocessing-fork'] +
+                ['%s=%r' % item for item in kwds.items()])
+    else:
+        prog = 'from multiprocessing.spawn import spawn_main; spawn_main(%s)'
+        prog %= ', '.join('%s=%r' % item for item in kwds.items())
+        opts = util._args_from_interpreter_flags()
+        return [_python_exe] + opts + ['-c', prog, '--multiprocessing-fork']
+
+
+def spawn_main(pipe_handle, parent_pid=None, tracker_fd=None):
+    '''
+    Run code specifed by data received over pipe
+    '''
+    assert is_forking(sys.argv)
+    if sys.platform == 'win32':
+        import msvcrt
+        from .reduction import steal_handle
+        new_handle = steal_handle(parent_pid, pipe_handle)
+        fd = msvcrt.open_osfhandle(new_handle, os.O_RDONLY)
+    else:
+        from . import semaphore_tracker
+        semaphore_tracker._semaphore_tracker._fd = tracker_fd
+        fd = pipe_handle
+    exitcode = _main(fd)
+    sys.exit(exitcode)
+
+
+def _main(fd):
+    with os.fdopen(fd, 'rb', closefd=True) as from_parent:
+        process.current_process()._inheriting = True
+        try:
+            preparation_data = pickle.load(from_parent)
+            prepare(preparation_data)
+            self = pickle.load(from_parent)
+        finally:
+            del process.current_process()._inheriting
+    return self._bootstrap()
+
+
+def _check_not_importing_main():
+    if getattr(process.current_process(), '_inheriting', False):
+        raise RuntimeError('''
+        An attempt has been made to start a new process before the
+        current process has finished its bootstrapping phase.
+
+        This probably means that you are not using fork to start your
+        child processes and you have forgotten to use the proper idiom
+        in the main module:
+
+            if __name__ == '__main__':
+                freeze_support()
+                ...
+
+        The "freeze_support()" line can be omitted if the program
+        is not going to be frozen to produce an executable.''')
+
+
+def get_preparation_data(name):
+    '''
+    Return info about parent needed by child to unpickle process object
+    '''
+    _check_not_importing_main()
+    d = dict(
+        log_to_stderr=util._log_to_stderr,
+        authkey=process.current_process().authkey,
+        )
+
+    if util._logger is not None:
+        d['log_level'] = util._logger.getEffectiveLevel()
+
+    sys_path=sys.path.copy()
+    try:
+        i = sys_path.index('')
+    except ValueError:
+        pass
+    else:
+        sys_path[i] = process.ORIGINAL_DIR
+
+    d.update(
+        name=name,
+        sys_path=sys_path,
+        sys_argv=sys.argv,
+        orig_dir=process.ORIGINAL_DIR,
+        dir=os.getcwd(),
+        start_method=get_start_method(),
+        )
+
+    # Figure out whether to initialise main in the subprocess as a module
+    # or through direct execution (or to leave it alone entirely)
+    main_module = sys.modules['__main__']
+    main_mod_name = getattr(main_module.__spec__, "name", None)
+    if main_mod_name is not None:
+        d['init_main_from_name'] = main_mod_name
+    elif sys.platform != 'win32' or (not WINEXE and not WINSERVICE):
+        main_path = getattr(main_module, '__file__', None)
+        if main_path is not None:
+            if (not os.path.isabs(main_path) and
+                        process.ORIGINAL_DIR is not None):
+                main_path = os.path.join(process.ORIGINAL_DIR, main_path)
+            d['init_main_from_path'] = os.path.normpath(main_path)
+
+    return d
+
+#
+# Prepare current process
+#
+
+old_main_modules = []
+
+def prepare(data):
+    '''
+    Try to get current process ready to unpickle process object
+    '''
+    if 'name' in data:
+        process.current_process().name = data['name']
+
+    if 'authkey' in data:
+        process.current_process().authkey = data['authkey']
+
+    if 'log_to_stderr' in data and data['log_to_stderr']:
+        util.log_to_stderr()
+
+    if 'log_level' in data:
+        util.get_logger().setLevel(data['log_level'])
+
+    if 'sys_path' in data:
+        sys.path = data['sys_path']
+
+    if 'sys_argv' in data:
+        sys.argv = data['sys_argv']
+
+    if 'dir' in data:
+        os.chdir(data['dir'])
+
+    if 'orig_dir' in data:
+        process.ORIGINAL_DIR = data['orig_dir']
+
+    if 'start_method' in data:
+        set_start_method(data['start_method'])
+
+    if 'init_main_from_name' in data:
+        _fixup_main_from_name(data['init_main_from_name'])
+    elif 'init_main_from_path' in data:
+        _fixup_main_from_path(data['init_main_from_path'])
+
+# Multiprocessing module helpers to fix up the main module in
+# spawned subprocesses
+def _fixup_main_from_name(mod_name):
+    # __main__.py files for packages, directories, zip archives, etc, run
+    # their "main only" code unconditionally, so we don't even try to
+    # populate anything in __main__, nor do we make any changes to
+    # __main__ attributes
+    current_main = sys.modules['__main__']
+    if mod_name == "__main__" or mod_name.endswith(".__main__"):
+        return
+
+    # If this process was forked, __main__ may already be populated
+    if getattr(current_main.__spec__, "name", None) == mod_name:
+        return
+
+    # Otherwise, __main__ may contain some non-main code where we need to
+    # support unpickling it properly. We rerun it as __mp_main__ and make
+    # the normal __main__ an alias to that
+    old_main_modules.append(current_main)
+    main_module = types.ModuleType("__mp_main__")
+    main_content = runpy.run_module(mod_name,
+                                    run_name="__mp_main__",
+                                    alter_sys=True)
+    main_module.__dict__.update(main_content)
+    sys.modules['__main__'] = sys.modules['__mp_main__'] = main_module
+
+
+def _fixup_main_from_path(main_path):
+    # If this process was forked, __main__ may already be populated
+    current_main = sys.modules['__main__']
+
+    # Unfortunately, the main ipython launch script historically had no
+    # "if __name__ == '__main__'" guard, so we work around that
+    # by treating it like a __main__.py file
+    # See https://github.com/ipython/ipython/issues/4698
+    main_name = os.path.splitext(os.path.basename(main_path))[0]
+    if main_name == 'ipython':
+        return
+
+    # Otherwise, if __file__ already has the setting we expect,
+    # there's nothing more to do
+    if getattr(current_main, '__file__', None) == main_path:
+        return
+
+    # If the parent process has sent a path through rather than a module
+    # name we assume it is an executable script that may contain
+    # non-main code that needs to be executed
+    old_main_modules.append(current_main)
+    main_module = types.ModuleType("__mp_main__")
+    main_content = runpy.run_path(main_path,
+                                  run_name="__mp_main__")
+    main_module.__dict__.update(main_content)
+    sys.modules['__main__'] = sys.modules['__mp_main__'] = main_module
+
+
+def import_main_path(main_path):
+    '''
+    Set sys.modules['__main__'] to module at main_path
+    '''
+    _fixup_main_from_path(main_path)
diff --git a/Lib/multiprocessing/synchronize.py b/Lib/multiprocessing/synchronize.py
index 0faca78..dea1cbd 100644
--- a/Lib/multiprocessing/synchronize.py
+++ b/Lib/multiprocessing/synchronize.py
@@ -13,18 +13,20 @@
 
 import threading
 import sys
-
+import tempfile
 import _multiprocessing
-from multiprocessing.process import current_process
-from multiprocessing.util import register_after_fork, debug
-from multiprocessing.forking import assert_spawning, Popen
+
 from time import time as _time
 
+from . import context
+from . import process
+from . import util
+
 # Try to import the mp.synchronize module cleanly, if it fails
 # raise ImportError for platforms lacking a working sem_open implementation.
 # See issue 3770
 try:
-    from _multiprocessing import SemLock
+    from _multiprocessing import SemLock, sem_unlink
 except (ImportError):
     raise ImportError("This platform lacks a functioning sem_open" +
                       " implementation, therefore, the required" +
@@ -44,15 +46,47 @@
 
 class SemLock(object):
 
-    def __init__(self, kind, value, maxvalue):
-        sl = self._semlock = _multiprocessing.SemLock(kind, value, maxvalue)
-        debug('created semlock with handle %s' % sl.handle)
+    _rand = tempfile._RandomNameSequence()
+
+    def __init__(self, kind, value, maxvalue, *, ctx):
+        if ctx is None:
+            ctx = context._default_context.get_context()
+        name = ctx.get_start_method()
+        unlink_now = sys.platform == 'win32' or name == 'fork'
+        for i in range(100):
+            try:
+                sl = self._semlock = _multiprocessing.SemLock(
+                    kind, value, maxvalue, self._make_name(),
+                    unlink_now)
+            except FileExistsError:
+                pass
+            else:
+                break
+        else:
+            raise FileExistsError('cannot find name for semaphore')
+
+        util.debug('created semlock with handle %s' % sl.handle)
         self._make_methods()
 
         if sys.platform != 'win32':
             def _after_fork(obj):
                 obj._semlock._after_fork()
-            register_after_fork(self, _after_fork)
+            util.register_after_fork(self, _after_fork)
+
+        if self._semlock.name is not None:
+            # We only get here if we are on Unix with forking
+            # disabled.  When the object is garbage collected or the
+            # process shuts down we unlink the semaphore name
+            from .semaphore_tracker import register
+            register(self._semlock.name)
+            util.Finalize(self, SemLock._cleanup, (self._semlock.name,),
+                          exitpriority=0)
+
+    @staticmethod
+    def _cleanup(name):
+        from .semaphore_tracker import unregister
+        sem_unlink(name)
+        unregister(name)
 
     def _make_methods(self):
         self.acquire = self._semlock.acquire
@@ -65,23 +99,32 @@
         return self._semlock.__exit__(*args)
 
     def __getstate__(self):
-        assert_spawning(self)
+        context.assert_spawning(self)
         sl = self._semlock
-        return (Popen.duplicate_for_child(sl.handle), sl.kind, sl.maxvalue)
+        if sys.platform == 'win32':
+            h = context.get_spawning_popen().duplicate_for_child(sl.handle)
+        else:
+            h = sl.handle
+        return (h, sl.kind, sl.maxvalue, sl.name)
 
     def __setstate__(self, state):
         self._semlock = _multiprocessing.SemLock._rebuild(*state)
-        debug('recreated blocker with handle %r' % state[0])
+        util.debug('recreated blocker with handle %r' % state[0])
         self._make_methods()
 
+    @staticmethod
+    def _make_name():
+        return '%s-%s' % (process.current_process()._config['semprefix'],
+                          next(SemLock._rand))
+
 #
 # Semaphore
 #
 
 class Semaphore(SemLock):
 
-    def __init__(self, value=1):
-        SemLock.__init__(self, SEMAPHORE, value, SEM_VALUE_MAX)
+    def __init__(self, value=1, *, ctx):
+        SemLock.__init__(self, SEMAPHORE, value, SEM_VALUE_MAX, ctx=ctx)
 
     def get_value(self):
         return self._semlock._get_value()
@@ -99,8 +142,8 @@
 
 class BoundedSemaphore(Semaphore):
 
-    def __init__(self, value=1):
-        SemLock.__init__(self, SEMAPHORE, value, value)
+    def __init__(self, value=1, *, ctx):
+        SemLock.__init__(self, SEMAPHORE, value, value, ctx=ctx)
 
     def __repr__(self):
         try:
@@ -116,13 +159,13 @@
 
 class Lock(SemLock):
 
-    def __init__(self):
-        SemLock.__init__(self, SEMAPHORE, 1, 1)
+    def __init__(self, *, ctx):
+        SemLock.__init__(self, SEMAPHORE, 1, 1, ctx=ctx)
 
     def __repr__(self):
         try:
             if self._semlock._is_mine():
-                name = current_process().name
+                name = process.current_process().name
                 if threading.current_thread().name != 'MainThread':
                     name += '|' + threading.current_thread().name
             elif self._semlock._get_value() == 1:
@@ -141,13 +184,13 @@
 
 class RLock(SemLock):
 
-    def __init__(self):
-        SemLock.__init__(self, RECURSIVE_MUTEX, 1, 1)
+    def __init__(self, *, ctx):
+        SemLock.__init__(self, RECURSIVE_MUTEX, 1, 1, ctx=ctx)
 
     def __repr__(self):
         try:
             if self._semlock._is_mine():
-                name = current_process().name
+                name = process.current_process().name
                 if threading.current_thread().name != 'MainThread':
                     name += '|' + threading.current_thread().name
                 count = self._semlock._count()
@@ -167,15 +210,15 @@
 
 class Condition(object):
 
-    def __init__(self, lock=None):
-        self._lock = lock or RLock()
-        self._sleeping_count = Semaphore(0)
-        self._woken_count = Semaphore(0)
-        self._wait_semaphore = Semaphore(0)
+    def __init__(self, lock=None, *, ctx):
+        self._lock = lock or ctx.RLock()
+        self._sleeping_count = ctx.Semaphore(0)
+        self._woken_count = ctx.Semaphore(0)
+        self._wait_semaphore = ctx.Semaphore(0)
         self._make_methods()
 
     def __getstate__(self):
-        assert_spawning(self)
+        context.assert_spawning(self)
         return (self._lock, self._sleeping_count,
                 self._woken_count, self._wait_semaphore)
 
@@ -289,9 +332,9 @@
 
 class Event(object):
 
-    def __init__(self):
-        self._cond = Condition(Lock())
-        self._flag = Semaphore(0)
+    def __init__(self, *, ctx):
+        self._cond = ctx.Condition(ctx.Lock())
+        self._flag = ctx.Semaphore(0)
 
     def is_set(self):
         self._cond.acquire()
@@ -340,11 +383,11 @@
 
 class Barrier(threading.Barrier):
 
-    def __init__(self, parties, action=None, timeout=None):
+    def __init__(self, parties, action=None, timeout=None, *, ctx):
         import struct
-        from multiprocessing.heap import BufferWrapper
+        from .heap import BufferWrapper
         wrapper = BufferWrapper(struct.calcsize('i') * 2)
-        cond = Condition()
+        cond = ctx.Condition()
         self.__setstate__((parties, action, timeout, cond, wrapper))
         self._state = 0
         self._count = 0
diff --git a/Lib/multiprocessing/util.py b/Lib/multiprocessing/util.py
index f5862b4..0b695e4 100644
--- a/Lib/multiprocessing/util.py
+++ b/Lib/multiprocessing/util.py
@@ -7,8 +7,6 @@
 # Licensed to PSF under a Contributor Agreement.
 #
 
-import sys
-import functools
 import os
 import itertools
 import weakref
@@ -17,13 +15,13 @@
                         # cleanup function before multiprocessing does
 from subprocess import _args_from_interpreter_flags
 
-from multiprocessing.process import current_process, active_children
+from . import process
 
 __all__ = [
     'sub_debug', 'debug', 'info', 'sub_warning', 'get_logger',
     'log_to_stderr', 'get_temp_dir', 'register_after_fork',
     'is_exiting', 'Finalize', 'ForkAwareThreadLock', 'ForkAwareLocal',
-    'SUBDEBUG', 'SUBWARNING',
+    'close_all_fds_except', 'SUBDEBUG', 'SUBWARNING',
     ]
 
 #
@@ -71,8 +69,6 @@
 
             _logger = logging.getLogger(LOGGER_NAME)
             _logger.propagate = 0
-            logging.addLevelName(SUBDEBUG, 'SUBDEBUG')
-            logging.addLevelName(SUBWARNING, 'SUBWARNING')
 
             # XXX multiprocessing should cleanup before logging
             if hasattr(atexit, 'unregister'):
@@ -111,13 +107,14 @@
 
 def get_temp_dir():
     # get name of a temp directory which will be automatically cleaned up
-    if current_process()._tempdir is None:
+    tempdir = process.current_process()._config.get('tempdir')
+    if tempdir is None:
         import shutil, tempfile
         tempdir = tempfile.mkdtemp(prefix='pymp-')
         info('created temp directory %s', tempdir)
         Finalize(None, shutil.rmtree, args=[tempdir], exitpriority=-100)
-        current_process()._tempdir = tempdir
-    return current_process()._tempdir
+        process.current_process()._config['tempdir'] = tempdir
+    return tempdir
 
 #
 # Support for reinitialization of objects when bootstrapping a child process
@@ -273,8 +270,8 @@
 _exiting = False
 
 def _exit_function(info=info, debug=debug, _run_finalizers=_run_finalizers,
-                   active_children=active_children,
-                   current_process=current_process):
+                   active_children=process.active_children,
+                   current_process=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.
@@ -303,7 +300,7 @@
             # #9207.
 
             for p in active_children():
-                if p._daemonic:
+                if p.daemon:
                     info('calling terminate() for daemon %s', p.name)
                     p._popen.terminate()
 
@@ -335,3 +332,36 @@
         register_after_fork(self, lambda obj : obj.__dict__.clear())
     def __reduce__(self):
         return type(self), ()
+
+#
+# Close fds except those specified
+#
+
+try:
+    MAXFD = os.sysconf("SC_OPEN_MAX")
+except Exception:
+    MAXFD = 256
+
+def close_all_fds_except(fds):
+    fds = list(fds) + [-1, MAXFD]
+    fds.sort()
+    assert fds[-1] == MAXFD, 'fd too large'
+    for i in range(len(fds) - 1):
+        os.closerange(fds[i]+1, fds[i+1])
+
+#
+# Start a program with only specified fds kept open
+#
+
+def spawnv_passfds(path, args, passfds):
+    import _posixsubprocess
+    passfds = sorted(passfds)
+    errpipe_read, errpipe_write = os.pipe()
+    try:
+        return _posixsubprocess.fork_exec(
+            args, [os.fsencode(path)], True, passfds, None, None,
+            -1, -1, -1, -1, -1, -1, errpipe_read, errpipe_write,
+            False, False, None)
+    finally:
+        os.close(errpipe_read)
+        os.close(errpipe_write)
diff --git a/Lib/netrc.py b/Lib/netrc.py
index 2aa48f3..bbb3d23 100644
--- a/Lib/netrc.py
+++ b/Lib/netrc.py
@@ -3,8 +3,6 @@
 # Module and documentation by Eric S. Raymond, 21 Dec 1998
 
 import os, shlex, stat
-if os.name == 'posix':
-    import pwd
 
 __all__ = ["netrc", "NetrcParseError"]
 
@@ -28,7 +26,7 @@
             try:
                 file = os.path.join(os.environ['HOME'], ".netrc")
             except KeyError:
-                raise IOError("Could not find .netrc: $HOME is not set")
+                raise OSError("Could not find .netrc: $HOME is not set")
         self.hosts = {}
         self.macros = {}
         with open(file) as fp:
@@ -92,6 +90,7 @@
                     if os.name == 'posix' and default_netrc:
                         prop = os.fstat(fp.fileno())
                         if prop.st_uid != os.getuid():
+                            import pwd
                             try:
                                 fowner = pwd.getpwuid(prop.st_uid)[0]
                             except KeyError:
diff --git a/Lib/nntplib.py b/Lib/nntplib.py
index 02cc37c..bcf7d1b 100644
--- a/Lib/nntplib.py
+++ b/Lib/nntplib.py
@@ -80,13 +80,13 @@
 from socket import _GLOBAL_DEFAULT_TIMEOUT
 
 __all__ = ["NNTP",
-           "NNTPReplyError", "NNTPTemporaryError", "NNTPPermanentError",
-           "NNTPProtocolError", "NNTPDataError",
+           "NNTPError", "NNTPReplyError", "NNTPTemporaryError",
+           "NNTPPermanentError", "NNTPProtocolError", "NNTPDataError",
            "decode_header",
            ]
 
 # maximal line length when calling readline(). This is to prevent
-# reading arbitrary lenght lines. RFC 3977 limits NNTP line length to
+# reading arbitrary length lines. RFC 3977 limits NNTP line length to
 # 512 characters, including CRLF. We have selected 2048 just to be on
 # the safe side.
 _MAXLINE = 2048
@@ -279,7 +279,7 @@
 
 if _have_ssl:
 
-    def _encrypt_on(sock, context):
+    def _encrypt_on(sock, context, hostname):
         """Wrap a socket in SSL/TLS. Arguments:
         - sock: Socket to wrap
         - context: SSL context to use for the encrypted connection
@@ -288,10 +288,8 @@
         """
         # Generate a default SSL context if none was passed.
         if context is None:
-            context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
-            # SSLv2 considered harmful.
-            context.options |= ssl.OP_NO_SSLv2
-        return context.wrap_socket(sock)
+            context = ssl._create_stdlib_context()
+        return context.wrap_socket(sock, server_hostname=hostname)
 
 
 # The classes themselves
@@ -366,7 +364,7 @@
         if is_connected():
             try:
                 self.quit()
-            except (socket.error, EOFError):
+            except (OSError, EOFError):
                 pass
             finally:
                 if is_connected():
@@ -956,7 +954,7 @@
                 if auth:
                     user = auth[0]
                     password = auth[2]
-        except IOError:
+        except OSError:
             pass
         # Perform NNTP authentication if needed.
         if not user:
@@ -1007,7 +1005,7 @@
             resp = self._shortcmd('STARTTLS')
             if resp.startswith('382'):
                 self.file.close()
-                self.sock = _encrypt_on(self.sock, context)
+                self.sock = _encrypt_on(self.sock, context, self.host)
                 self.file = self.sock.makefile("rwb")
                 self.tls_on = True
                 # Capabilities may change after TLS starts up, so ask for them
@@ -1067,7 +1065,7 @@
             in default port and the `ssl_context` argument for SSL connections.
             """
             self.sock = socket.create_connection((host, port), timeout)
-            self.sock = _encrypt_on(self.sock, ssl_context)
+            self.sock = _encrypt_on(self.sock, ssl_context, host)
             file = self.sock.makefile("rwb")
             _NNTPBase.__init__(self, file, host,
                                readermode=readermode, timeout=timeout)
@@ -1086,7 +1084,6 @@
 # Test retrieval when run as a script.
 if __name__ == '__main__':
     import argparse
-    from email.utils import parsedate
 
     parser = argparse.ArgumentParser(description="""\
         nntplib built-in demo - display the latest articles in a newsgroup""")
diff --git a/Lib/ntpath.py b/Lib/ntpath.py
index 303e586..af3fb87 100644
--- a/Lib/ntpath.py
+++ b/Lib/ntpath.py
@@ -17,7 +17,7 @@
            "ismount", "expanduser","expandvars","normpath","abspath",
            "splitunc","curdir","pardir","sep","pathsep","defpath","altsep",
            "extsep","devnull","realpath","supports_unicode_filenames","relpath",
-           "samefile", "sameopenfile",]
+           "samefile", "sameopenfile", "samestat",]
 
 # strings representing various path-related bits and pieces
 # These are primarily for export; internally, they are hardcoded.
@@ -30,9 +30,6 @@
 defpath = '.;C:\\bin'
 if 'ce' in sys.builtin_module_names:
     defpath = '\\Windows'
-elif 'os2' in sys.builtin_module_names:
-    # OS/2 w/ VACPP
-    altsep = '/'
 devnull = 'nul'
 
 def _get_empty(path):
@@ -260,12 +257,11 @@
 
 def islink(path):
     """Test whether a path is a symbolic link.
-    This will always return false for Windows prior to 6.0
-    and for OS/2.
+    This will always return false for Windows prior to 6.0.
     """
     try:
         st = os.lstat(path)
-    except (os.error, AttributeError):
+    except (OSError, AttributeError):
         return False
     return stat.S_ISLNK(st.st_mode)
 
@@ -275,20 +271,39 @@
     """Test whether a path exists.  Returns True for broken symbolic links"""
     try:
         st = os.lstat(path)
-    except (os.error, WindowsError):
+    except OSError:
         return False
     return True
 
-# Is a path a mount point?  Either a root (with or without drive letter)
-# or an UNC path with at most a / or \ after the mount point.
-
+# Is a path a mount point?
+# Any drive letter root (eg c:\)
+# Any share UNC (eg \\server\share)
+# Any volume mounted on a filesystem folder
+#
+# No one method detects all three situations. Historically we've lexically
+# detected drive letter roots and share UNCs. The canonical approach to
+# detecting mounted volumes (querying the reparse tag) fails for the most
+# common case: drive letter roots. The alternative which uses GetVolumePathName
+# fails if the drive letter is the result of a SUBST.
+try:
+    from nt import _getvolumepathname
+except ImportError:
+    _getvolumepathname = None
 def ismount(path):
-    """Test whether a path is a mount point (defined as root of drive)"""
+    """Test whether a path is a mount point (a drive root, the root of a
+    share, or a mounted volume)"""
     seps = _get_bothseps(path)
+    path = abspath(path)
     root, rest = splitdrive(path)
     if root and root[0] in seps:
         return (not rest) or (rest in seps)
-    return rest in seps
+    if rest in seps:
+        return True
+
+    if _getvolumepathname:
+        return path.rstrip(seps) == _getvolumepathname(path).rstrip(seps)
+    else:
+        return False
 
 
 # Expand paths beginning with '~' or '~user'.
@@ -530,7 +545,7 @@
         if path: # Empty path must return current working directory.
             try:
                 path = _getfullpathname(path)
-            except WindowsError:
+            except OSError:
                 pass # Bad path - return unchanged.
         elif isinstance(path, bytes):
             path = os.getcwdb()
@@ -598,23 +613,6 @@
     def _getfinalpathname(f):
         return normcase(abspath(f))
 
-def samefile(f1, f2):
-    "Test whether two pathnames reference the same actual file"
-    return _getfinalpathname(f1) == _getfinalpathname(f2)
-
-
-try:
-    from nt import _getfileinformation
-except ImportError:
-    # On other operating systems, just return the fd and see that
-    # it compares equal in sameopenfile.
-    def _getfileinformation(fd):
-        return fd
-
-def sameopenfile(f1, f2):
-    """Test whether two file objects reference the same file"""
-    return _getfileinformation(f1) == _getfileinformation(f2)
-
 
 try:
     # The genericpath.isdir implementation uses os.stat and checks the mode
diff --git a/Lib/nturl2path.py b/Lib/nturl2path.py
index 511dcec..5a6d44a 100644
--- a/Lib/nturl2path.py
+++ b/Lib/nturl2path.py
@@ -23,7 +23,7 @@
     comp = url.split('|')
     if len(comp) != 2 or comp[0][-1] not in string.ascii_letters:
         error = 'Bad URL: ' + url
-        raise IOError(error)
+        raise OSError(error)
     drive = comp[0][-1].upper()
     components = comp[1].split('/')
     path = drive + ':'
@@ -55,7 +55,7 @@
     comp = p.split(':')
     if len(comp) != 2 or len(comp[0]) > 1:
         error = 'Bad path: ' + p
-        raise IOError(error)
+        raise OSError(error)
 
     drive = urllib.parse.quote(comp[0].upper())
     components = comp[1].split('\\')
diff --git a/Lib/numbers.py b/Lib/numbers.py
index b206457..7eedc63 100644
--- a/Lib/numbers.py
+++ b/Lib/numbers.py
@@ -141,11 +141,6 @@
         """self == other"""
         raise NotImplementedError
 
-    def __ne__(self, other):
-        """self != other"""
-        # The default __ne__ doesn't negate __eq__ until 3.0.
-        return not (self == other)
-
 Complex.register(complex)
 
 
diff --git a/Lib/opcode.py b/Lib/opcode.py
index a639fe3..0bd1ee6 100644
--- a/Lib/opcode.py
+++ b/Lib/opcode.py
@@ -8,6 +8,19 @@
            "haslocal", "hascompare", "hasfree", "opname", "opmap",
            "HAVE_ARGUMENT", "EXTENDED_ARG", "hasnargs"]
 
+# It's a chicken-and-egg I'm afraid:
+# We're imported before _opcode's made.
+# With exception unheeded
+# (stack_effect is not needed)
+# Both our chickens and eggs are allayed.
+#     --Larry Hastings, 2013/11/23
+
+try:
+    from _opcode import stack_effect
+    __all__.append('stack_effect')
+except ImportError:
+    pass
+
 cmp_op = ('<', '<=', '==', '!=', '>', '>=', 'in', 'not in', 'is',
         'is not', 'exception match', 'BAD')
 
@@ -84,7 +97,6 @@
 def_op('BINARY_OR', 66)
 def_op('INPLACE_POWER', 67)
 def_op('GET_ITER', 68)
-def_op('STORE_LOCALS', 69)
 
 def_op('PRINT_EXPR', 70)
 def_op('LOAD_BUILD_CLASS', 71)
@@ -179,6 +191,9 @@
 def_op('SET_ADD', 146)
 def_op('MAP_ADD', 147)
 
+def_op('LOAD_CLASSDEREF', 148)
+hasfree.append(148)
+
 def_op('EXTENDED_ARG', 144)
 EXTENDED_ARG = 144
 
diff --git a/Lib/operator.py b/Lib/operator.py
new file mode 100644
index 0000000..b60349f
--- /dev/null
+++ b/Lib/operator.py
@@ -0,0 +1,411 @@
+"""
+Operator Interface
+
+This module exports a set of functions corresponding to the intrinsic
+operators of Python.  For example, operator.add(x, y) is equivalent
+to the expression x+y.  The function names are those used for special
+methods; variants without leading and trailing '__' are also provided
+for convenience.
+
+This is the pure Python implementation of the module.
+"""
+
+__all__ = ['abs', 'add', 'and_', 'attrgetter', 'concat', 'contains', 'countOf',
+           'delitem', 'eq', 'floordiv', 'ge', 'getitem', 'gt', 'iadd', 'iand',
+           'iconcat', 'ifloordiv', 'ilshift', 'imod', 'imul', 'index',
+           'indexOf', 'inv', 'invert', 'ior', 'ipow', 'irshift', 'is_',
+           'is_not', 'isub', 'itemgetter', 'itruediv', 'ixor', 'le',
+           'length_hint', 'lshift', 'lt', 'methodcaller', 'mod', 'mul', 'ne',
+           'neg', 'not_', 'or_', 'pos', 'pow', 'rshift', 'setitem', 'sub',
+           'truediv', 'truth', 'xor']
+
+from builtins import abs as _abs
+
+
+# Comparison Operations *******************************************************#
+
+def lt(a, b):
+    "Same as a < b."
+    return a < b
+
+def le(a, b):
+    "Same as a <= b."
+    return a <= b
+
+def eq(a, b):
+    "Same as a == b."
+    return a == b
+
+def ne(a, b):
+    "Same as a != b."
+    return a != b
+
+def ge(a, b):
+    "Same as a >= b."
+    return a >= b
+
+def gt(a, b):
+    "Same as a > b."
+    return a > b
+
+# Logical Operations **********************************************************#
+
+def not_(a):
+    "Same as not a."
+    return not a
+
+def truth(a):
+    "Return True if a is true, False otherwise."
+    return True if a else False
+
+def is_(a, b):
+    "Same as a is b."
+    return a is b
+
+def is_not(a, b):
+    "Same as a is not b."
+    return a is not b
+
+# Mathematical/Bitwise Operations *********************************************#
+
+def abs(a):
+    "Same as abs(a)."
+    return _abs(a)
+
+def add(a, b):
+    "Same as a + b."
+    return a + b
+
+def and_(a, b):
+    "Same as a & b."
+    return a & b
+
+def floordiv(a, b):
+    "Same as a // b."
+    return a // b
+
+def index(a):
+    "Same as a.__index__()."
+    return a.__index__()
+
+def inv(a):
+    "Same as ~a."
+    return ~a
+invert = inv
+
+def lshift(a, b):
+    "Same as a << b."
+    return a << b
+
+def mod(a, b):
+    "Same as a % b."
+    return a % b
+
+def mul(a, b):
+    "Same as a * b."
+    return a * b
+
+def neg(a):
+    "Same as -a."
+    return -a
+
+def or_(a, b):
+    "Same as a | b."
+    return a | b
+
+def pos(a):
+    "Same as +a."
+    return +a
+
+def pow(a, b):
+    "Same as a ** b."
+    return a ** b
+
+def rshift(a, b):
+    "Same as a >> b."
+    return a >> b
+
+def sub(a, b):
+    "Same as a - b."
+    return a - b
+
+def truediv(a, b):
+    "Same as a / b."
+    return a / b
+
+def xor(a, b):
+    "Same as a ^ b."
+    return a ^ b
+
+# Sequence Operations *********************************************************#
+
+def concat(a, b):
+    "Same as a + b, for a and b sequences."
+    if not hasattr(a, '__getitem__'):
+        msg = "'%s' object can't be concatenated" % type(a).__name__
+        raise TypeError(msg)
+    return a + b
+
+def contains(a, b):
+    "Same as b in a (note reversed operands)."
+    return b in a
+
+def countOf(a, b):
+    "Return the number of times b occurs in a."
+    count = 0
+    for i in a:
+        if i == b:
+            count += 1
+    return count
+
+def delitem(a, b):
+    "Same as del a[b]."
+    del a[b]
+
+def getitem(a, b):
+    "Same as a[b]."
+    return a[b]
+
+def indexOf(a, b):
+    "Return the first index of b in a."
+    for i, j in enumerate(a):
+        if j == b:
+            return i
+    else:
+        raise ValueError('sequence.index(x): x not in sequence')
+
+def setitem(a, b, c):
+    "Same as a[b] = c."
+    a[b] = c
+
+def length_hint(obj, default=0):
+    """
+    Return an estimate of the number of items in obj.
+    This is useful for presizing containers when building from an iterable.
+
+    If the object supports len(), the result will be exact. Otherwise, it may
+    over- or under-estimate by an arbitrary amount. The result will be an
+    integer >= 0.
+    """
+    if not isinstance(default, int):
+        msg = ("'%s' object cannot be interpreted as an integer" %
+               type(default).__name__)
+        raise TypeError(msg)
+
+    try:
+        return len(obj)
+    except TypeError:
+        pass
+
+    try:
+        hint = type(obj).__length_hint__
+    except AttributeError:
+        return default
+
+    try:
+        val = hint(obj)
+    except TypeError:
+        return default
+    if val is NotImplemented:
+        return default
+    if not isinstance(val, int):
+        msg = ('__length_hint__ must be integer, not %s' %
+               type(val).__name__)
+        raise TypeError(msg)
+    if val < 0:
+        msg = '__length_hint__() should return >= 0'
+        raise ValueError(msg)
+    return val
+
+# Generalized Lookup Objects **************************************************#
+
+class attrgetter:
+    """
+    Return a callable object that fetches the given attribute(s) from its operand.
+    After f = attrgetter('name'), the call f(r) returns r.name.
+    After g = attrgetter('name', 'date'), the call g(r) returns (r.name, r.date).
+    After h = attrgetter('name.first', 'name.last'), the call h(r) returns
+    (r.name.first, r.name.last).
+    """
+    def __init__(self, attr, *attrs):
+        if not attrs:
+            if not isinstance(attr, str):
+                raise TypeError('attribute name must be a string')
+            names = attr.split('.')
+            def func(obj):
+                for name in names:
+                    obj = getattr(obj, name)
+                return obj
+            self._call = func
+        else:
+            getters = tuple(map(attrgetter, (attr,) + attrs))
+            def func(obj):
+                return tuple(getter(obj) for getter in getters)
+            self._call = func
+
+    def __call__(self, obj):
+        return self._call(obj)
+
+class itemgetter:
+    """
+    Return a callable object that fetches the given item(s) from its operand.
+    After f = itemgetter(2), the call f(r) returns r[2].
+    After g = itemgetter(2, 5, 3), the call g(r) returns (r[2], r[5], r[3])
+    """
+    def __init__(self, item, *items):
+        if not items:
+            def func(obj):
+                return obj[item]
+            self._call = func
+        else:
+            items = (item,) + items
+            def func(obj):
+                return tuple(obj[i] for i in items)
+            self._call = func
+
+    def __call__(self, obj):
+        return self._call(obj)
+
+class methodcaller:
+    """
+    Return a callable object that calls the given method on its operand.
+    After f = methodcaller('name'), the call f(r) returns r.name().
+    After g = methodcaller('name', 'date', foo=1), the call g(r) returns
+    r.name('date', foo=1).
+    """
+
+    def __init__(*args, **kwargs):
+        if len(args) < 2:
+            msg = "methodcaller needs at least one argument, the method name"
+            raise TypeError(msg)
+        self = args[0]
+        self._name = args[1]
+        self._args = args[2:]
+        self._kwargs = kwargs
+
+    def __call__(self, obj):
+        return getattr(obj, self._name)(*self._args, **self._kwargs)
+
+# In-place Operations *********************************************************#
+
+def iadd(a, b):
+    "Same as a += b."
+    a += b
+    return a
+
+def iand(a, b):
+    "Same as a &= b."
+    a &= b
+    return a
+
+def iconcat(a, b):
+    "Same as a += b, for a and b sequences."
+    if not hasattr(a, '__getitem__'):
+        msg = "'%s' object can't be concatenated" % type(a).__name__
+        raise TypeError(msg)
+    a += b
+    return a
+
+def ifloordiv(a, b):
+    "Same as a //= b."
+    a //= b
+    return a
+
+def ilshift(a, b):
+    "Same as a <<= b."
+    a <<= b
+    return a
+
+def imod(a, b):
+    "Same as a %= b."
+    a %= b
+    return a
+
+def imul(a, b):
+    "Same as a *= b."
+    a *= b
+    return a
+
+def ior(a, b):
+    "Same as a |= b."
+    a |= b
+    return a
+
+def ipow(a, b):
+    "Same as a **= b."
+    a **=b
+    return a
+
+def irshift(a, b):
+    "Same as a >>= b."
+    a >>= b
+    return a
+
+def isub(a, b):
+    "Same as a -= b."
+    a -= b
+    return a
+
+def itruediv(a, b):
+    "Same as a /= b."
+    a /= b
+    return a
+
+def ixor(a, b):
+    "Same as a ^= b."
+    a ^= b
+    return a
+
+
+try:
+    from _operator import *
+except ImportError:
+    pass
+else:
+    from _operator import __doc__
+
+# All of these "__func__ = func" assignments have to happen after importing
+# from _operator to make sure they're set to the right function
+__lt__ = lt
+__le__ = le
+__eq__ = eq
+__ne__ = ne
+__ge__ = ge
+__gt__ = gt
+__not__ = not_
+__abs__ = abs
+__add__ = add
+__and__ = and_
+__floordiv__ = floordiv
+__index__ = index
+__inv__ = inv
+__invert__ = invert
+__lshift__ = lshift
+__mod__ = mod
+__mul__ = mul
+__neg__ = neg
+__or__ = or_
+__pos__ = pos
+__pow__ = pow
+__rshift__ = rshift
+__sub__ = sub
+__truediv__ = truediv
+__xor__ = xor
+__concat__ = concat
+__contains__ = contains
+__delitem__ = delitem
+__getitem__ = getitem
+__setitem__ = setitem
+__iadd__ = iadd
+__iand__ = iand
+__iconcat__ = iconcat
+__ifloordiv__ = ifloordiv
+__ilshift__ = ilshift
+__imod__ = imod
+__imul__ = imul
+__ior__ = ior
+__ipow__ = ipow
+__irshift__ = irshift
+__isub__ = isub
+__itruediv__ = itruediv
+__ixor__ = ixor
diff --git a/Lib/os.py b/Lib/os.py
index b42ccba..556f592 100644
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -1,9 +1,9 @@
-r"""OS routines for Mac, NT, or Posix depending on what system we're on.
+r"""OS routines for NT or Posix depending on what system we're on.
 
 This exports:
-  - all functions from posix, nt, os2, or ce, e.g. unlink, stat, etc.
+  - all functions from posix, nt or ce, e.g. unlink, stat, etc.
   - os.path is either posixpath or ntpath
-  - os.name is either 'posix', 'nt', 'os2' or 'ce'.
+  - os.name is either 'posix', 'nt' or 'ce'.
   - os.curdir is a string representing the current directory ('.' or ':')
   - os.pardir is a string representing the parent directory ('..' or '::')
   - os.sep is the (or a most common) pathname separator ('/' or ':' or '\\')
@@ -81,30 +81,6 @@
     except ImportError:
         pass
 
-elif 'os2' in _names:
-    name = 'os2'
-    linesep = '\r\n'
-    from os2 import *
-    try:
-        from os2 import _exit
-        __all__.append('_exit')
-    except ImportError:
-        pass
-    if sys.version.find('EMX GCC') == -1:
-        import ntpath as path
-    else:
-        import os2emxpath as path
-        from _emx_link import link
-
-    import os2
-    __all__.extend(_get_exports_list(os2))
-    del os2
-
-    try:
-        from os2 import _have_functions
-    except ImportError:
-        pass
-
 elif 'ce' in _names:
     name = 'ce'
     linesep = '\r\n'
@@ -234,7 +210,7 @@
 # (Inspired by Eric Raymond; the doc strings are mostly his)
 
 def makedirs(name, mode=0o777, exist_ok=False):
-    """makedirs(path [, mode=0o777][, exist_ok=False])
+    """makedirs(name [, mode=0o777][, exist_ok=False])
 
     Super-mkdir; create a leaf directory and all intermediate ones.  Works like
     mkdir, except that any intermediate path segment (not just the rightmost)
@@ -249,10 +225,9 @@
     if head and tail and not path.exists(head):
         try:
             makedirs(head, mode, exist_ok)
-        except OSError as e:
+        except FileExistsError:
             # be happy if someone already created the path
-            if e.errno != errno.EEXIST:
-                raise
+            pass
         cdir = curdir
         if isinstance(tail, bytes):
             cdir = bytes(curdir, 'ASCII')
@@ -265,7 +240,7 @@
             raise
 
 def removedirs(name):
-    """removedirs(path)
+    """removedirs(name)
 
     Super-rmdir; remove a leaf directory and all empty intermediate
     ones.  Works like rmdir except that, if the leaf directory is
@@ -282,7 +257,7 @@
     while head and tail:
         try:
             rmdir(head)
-        except error:
+        except OSError:
             break
         head, tail = path.split(head)
 
@@ -309,7 +284,7 @@
     if head and tail:
         try:
             removedirs(head)
-        except error:
+        except OSError:
             pass
 
 __all__.extend(["makedirs", "removedirs", "renames"])
@@ -337,15 +312,16 @@
 
     When topdown is true, the caller can modify the dirnames list in-place
     (e.g., via del or slice assignment), and walk will only recurse into the
-    subdirectories whose names remain in dirnames; this can be used to prune
-    the search, or to impose a specific order of visiting.  Modifying
-    dirnames when topdown is false is ineffective, since the directories in
-    dirnames have already been generated by the time dirnames itself is
-    generated.
+    subdirectories whose names remain in dirnames; this can be used to prune the
+    search, or to impose a specific order of visiting.  Modifying dirnames when
+    topdown is false is ineffective, since the directories in dirnames have
+    already been generated by the time dirnames itself is generated. No matter
+    the value of topdown, the list of subdirectories is retrieved before the
+    tuples for the directory and its subdirectories are generated.
 
     By default errors from the os.listdir() call are ignored.  If
     optional arg 'onerror' is specified, it should be a function; it
-    will be called with one argument, an os.error instance.  It can
+    will be called with one argument, an OSError instance.  It can
     report the error to continue with the walk, or raise the exception
     to abort the walk.  Note that the filename is available as the
     filename attribute of the exception object.
@@ -369,6 +345,7 @@
         print("bytes in", len(files), "non-directory files")
         if 'CVS' in dirs:
             dirs.remove('CVS')  # don't visit CVS directories
+
     """
 
     islink, join, isdir = path.islink, path.join, path.isdir
@@ -379,10 +356,10 @@
     # minor reason when (say) a thousand readable directories are still
     # left to visit.  That logic is copied here.
     try:
-        # Note that listdir and error are globals in this module due
+        # Note that listdir is global in this module due
         # to earlier import-*.
         names = listdir(top)
-    except error as err:
+    except OSError as err:
         if onerror is not None:
             onerror(err)
         return
@@ -484,7 +461,7 @@
             try:
                 orig_st = stat(name, dir_fd=topfd, follow_symlinks=follow_symlinks)
                 dirfd = open(name, O_RDONLY, dir_fd=topfd)
-            except error as err:
+            except OSError as err:
                 if onerror is not None:
                     onerror(err)
                 return
@@ -579,7 +556,7 @@
         fullname = path.join(dir, file)
         try:
             exec_func(fullname, *argrest)
-        except error as e:
+        except OSError as e:
             last_exc = e
             tb = sys.exc_info()[2]
             if (e.errno != errno.ENOENT and e.errno != errno.ENOTDIR
@@ -636,7 +613,7 @@
 
 
 # Change environ to automatically call putenv(), unsetenv if they exist.
-from collections.abc import MutableMapping
+from _collections_abc import MutableMapping
 
 class _Environ(MutableMapping):
     def __init__(self, data, encodekey, decodekey, encodevalue, decodevalue, putenv, unsetenv):
@@ -696,17 +673,19 @@
 except NameError:
     _putenv = lambda key, value: None
 else:
-    __all__.append("putenv")
+    if "putenv" not in __all__:
+        __all__.append("putenv")
 
 try:
     _unsetenv = unsetenv
 except NameError:
     _unsetenv = lambda key: _putenv(key, "")
 else:
-    __all__.append("unsetenv")
+    if "unsetenv" not in __all__:
+        __all__.append("unsetenv")
 
 def _createenviron():
-    if name in ('os2', 'nt'):
+    if name == 'nt':
         # Where Env Var Names Must Be UPPERCASE
         def check_str(value):
             if not isinstance(value, str):
@@ -746,7 +725,7 @@
     key, default and the result are str."""
     return environ.get(key, default)
 
-supports_bytes_environ = name not in ('os2', 'nt')
+supports_bytes_environ = (name != 'nt')
 __all__.extend(("getenv", "supports_bytes_environ"))
 
 if supports_bytes_environ:
@@ -845,7 +824,7 @@
                 elif WIFEXITED(sts):
                     return WEXITSTATUS(sts)
                 else:
-                    raise error("Not stopped, signaled or exited???")
+                    raise OSError("Not stopped, signaled or exited???")
 
     def spawnv(mode, file, args):
         """spawnv(mode, file, args) -> integer
@@ -888,6 +867,10 @@
 otherwise return -SIG, where SIG is the signal that killed it. """
         return _spawnvef(mode, file, args, env, execvpe)
 
+
+    __all__.extend(["spawnv", "spawnve", "spawnvp", "spawnvpe"])
+
+
 if _exists("spawnv"):
     # These aren't supplied by the basic Windows code
     # but can be easily implemented in Python
@@ -913,7 +896,7 @@
         return spawnve(mode, file, args[:-1], env)
 
 
-    __all__.extend(["spawnv", "spawnve", "spawnl", "spawnle",])
+    __all__.extend(["spawnl", "spawnle"])
 
 
 if _exists("spawnvp"):
@@ -941,34 +924,8 @@
         return spawnvpe(mode, file, args[:-1], env)
 
 
-    __all__.extend(["spawnvp", "spawnvpe", "spawnlp", "spawnlpe",])
+    __all__.extend(["spawnlp", "spawnlpe"])
 
-import copyreg as _copyreg
-
-def _make_stat_result(tup, dict):
-    return stat_result(tup, dict)
-
-def _pickle_stat_result(sr):
-    (type, args) = sr.__reduce__()
-    return (_make_stat_result, args)
-
-try:
-    _copyreg.pickle(stat_result, _pickle_stat_result, _make_stat_result)
-except NameError: # stat_result may not exist
-    pass
-
-def _make_statvfs_result(tup, dict):
-    return statvfs_result(tup, dict)
-
-def _pickle_statvfs_result(sr):
-    (type, args) = sr.__reduce__()
-    return (_make_statvfs_result, args)
-
-try:
-    _copyreg.pickle(statvfs_result, _pickle_statvfs_result,
-                     _make_statvfs_result)
-except NameError: # statvfs_result may not exist
-    pass
 
 # Supply os.popen()
 def popen(cmd, mode="r", buffering=-1):
diff --git a/Lib/os2emxpath.py b/Lib/os2emxpath.py
deleted file mode 100644
index 0ccbf8a..0000000
--- a/Lib/os2emxpath.py
+++ /dev/null
@@ -1,158 +0,0 @@
-# Module 'os2emxpath' -- common operations on OS/2 pathnames
-"""Common pathname manipulations, OS/2 EMX version.
-
-Instead of importing this module directly, import os and refer to this
-module as os.path.
-"""
-
-import os
-import stat
-from genericpath import *
-from ntpath import (expanduser, expandvars, isabs, islink, splitdrive,
-                    splitext, split)
-
-__all__ = ["normcase","isabs","join","splitdrive","split","splitext",
-           "basename","dirname","commonprefix","getsize","getmtime",
-           "getatime","getctime", "islink","exists","lexists","isdir","isfile",
-           "ismount","expanduser","expandvars","normpath","abspath",
-           "splitunc","curdir","pardir","sep","pathsep","defpath","altsep",
-           "extsep","devnull","realpath","supports_unicode_filenames"]
-
-# strings representing various path-related bits and pieces
-curdir = '.'
-pardir = '..'
-extsep = '.'
-sep = '/'
-altsep = '\\'
-pathsep = ';'
-defpath = '.;C:\\bin'
-devnull = 'nul'
-
-# Normalize the case of a pathname and map slashes to backslashes.
-# Other normalizations (such as optimizing '../' away) are not done
-# (this is done by normpath).
-
-def normcase(s):
-    """Normalize case of pathname.
-
-    Makes all characters lowercase and all altseps into seps."""
-    if not isinstance(s, (bytes, str)):
-        raise TypeError("normcase() argument must be str or bytes, "
-                        "not '{}'".format(s.__class__.__name__))
-    return s.replace('\\', '/').lower()
-
-
-# Join two (or more) paths.
-
-def join(a, *p):
-    """Join two or more pathname components, inserting sep as needed"""
-    path = a
-    for b in p:
-        if isabs(b):
-            path = b
-        elif path == '' or path[-1:] in '/\\:':
-            path = path + b
-        else:
-            path = path + '/' + b
-    return path
-
-
-# Parse UNC paths
-def splitunc(p):
-    """Split a pathname into UNC mount point and relative path specifiers.
-
-    Return a 2-tuple (unc, rest); either part may be empty.
-    If unc is not empty, it has the form '//host/mount' (or similar
-    using backslashes).  unc+rest is always the input path.
-    Paths containing drive letters never have an UNC part.
-    """
-    if p[1:2] == ':':
-        return '', p # Drive letter present
-    firstTwo = p[0:2]
-    if firstTwo == '/' * 2 or firstTwo == '\\' * 2:
-        # is a UNC path:
-        # vvvvvvvvvvvvvvvvvvvv equivalent to drive letter
-        # \\machine\mountpoint\directories...
-        #           directory ^^^^^^^^^^^^^^^
-        normp = normcase(p)
-        index = normp.find('/', 2)
-        if index == -1:
-            ##raise RuntimeError, 'illegal UNC path: "' + p + '"'
-            return ("", p)
-        index = normp.find('/', index + 1)
-        if index == -1:
-            index = len(p)
-        return p[:index], p[index:]
-    return '', p
-
-
-# Return the tail (basename) part of a path.
-
-def basename(p):
-    """Returns the final component of a pathname"""
-    return split(p)[1]
-
-
-# Return the head (dirname) part of a path.
-
-def dirname(p):
-    """Returns the directory component of a pathname"""
-    return split(p)[0]
-
-
-# alias exists to lexists
-lexists = exists
-
-
-# Is a path a directory?
-
-# Is a path a mount point?  Either a root (with or without drive letter)
-# or an UNC path with at most a / or \ after the mount point.
-
-def ismount(path):
-    """Test whether a path is a mount point (defined as root of drive)"""
-    unc, rest = splitunc(path)
-    if unc:
-        return rest in ("", "/", "\\")
-    p = splitdrive(path)[1]
-    return len(p) == 1 and p[0] in '/\\'
-
-
-# Normalize a path, e.g. A//B, A/./B and A/foo/../B all become A/B.
-
-def normpath(path):
-    """Normalize path, eliminating double slashes, etc."""
-    path = path.replace('\\', '/')
-    prefix, path = splitdrive(path)
-    while path[:1] == '/':
-        prefix = prefix + '/'
-        path = path[1:]
-    comps = path.split('/')
-    i = 0
-    while i < len(comps):
-        if comps[i] == '.':
-            del comps[i]
-        elif comps[i] == '..' and i > 0 and comps[i-1] not in ('', '..'):
-            del comps[i-1:i+1]
-            i = i - 1
-        elif comps[i] == '' and i > 0 and comps[i-1] != '':
-            del comps[i]
-        else:
-            i = i + 1
-    # If the path is now empty, substitute '.'
-    if not prefix and not comps:
-        comps.append('.')
-    return prefix + '/'.join(comps)
-
-
-# Return an absolute path.
-def abspath(path):
-    """Return the absolute version of a path"""
-    if not isabs(path):
-        path = join(os.getcwd(), path)
-    return normpath(path)
-
-# realpath is a no-op on systems without islink support
-realpath = abspath
-
-supports_unicode_filenames = False
diff --git a/Lib/pathlib.py b/Lib/pathlib.py
new file mode 100644
index 0000000..73fd432
--- /dev/null
+++ b/Lib/pathlib.py
@@ -0,0 +1,1287 @@
+import fnmatch
+import functools
+import io
+import ntpath
+import os
+import posixpath
+import re
+import sys
+from collections import Sequence
+from contextlib import contextmanager
+from errno import EINVAL, ENOENT, ENOTDIR
+from operator import attrgetter
+from stat import S_ISDIR, S_ISLNK, S_ISREG, S_ISSOCK, S_ISBLK, S_ISCHR, S_ISFIFO
+from urllib.parse import quote_from_bytes as urlquote_from_bytes
+
+
+supports_symlinks = True
+if os.name == 'nt':
+    import nt
+    if sys.getwindowsversion()[:2] >= (6, 0):
+        from nt import _getfinalpathname
+    else:
+        supports_symlinks = False
+        _getfinalpathname = None
+else:
+    nt = None
+
+
+__all__ = [
+    "PurePath", "PurePosixPath", "PureWindowsPath",
+    "Path", "PosixPath", "WindowsPath",
+    ]
+
+#
+# Internals
+#
+
+def _is_wildcard_pattern(pat):
+    # Whether this pattern needs actual matching using fnmatch, or can
+    # be looked up directly as a file.
+    return "*" in pat or "?" in pat or "[" in pat
+
+
+class _Flavour(object):
+    """A flavour implements a particular (platform-specific) set of path
+    semantics."""
+
+    def __init__(self):
+        self.join = self.sep.join
+
+    def parse_parts(self, parts):
+        parsed = []
+        sep = self.sep
+        altsep = self.altsep
+        drv = root = ''
+        it = reversed(parts)
+        for part in it:
+            if not part:
+                continue
+            if altsep:
+                part = part.replace(altsep, sep)
+            drv, root, rel = self.splitroot(part)
+            if sep in rel:
+                for x in reversed(rel.split(sep)):
+                    if x and x != '.':
+                        parsed.append(sys.intern(x))
+            else:
+                if rel and rel != '.':
+                    parsed.append(sys.intern(rel))
+            if drv or root:
+                if not drv:
+                    # If no drive is present, try to find one in the previous
+                    # parts. This makes the result of parsing e.g.
+                    # ("C:", "/", "a") reasonably intuitive.
+                    for part in it:
+                        drv = self.splitroot(part)[0]
+                        if drv:
+                            break
+                break
+        if drv or root:
+            parsed.append(drv + root)
+        parsed.reverse()
+        return drv, root, parsed
+
+    def join_parsed_parts(self, drv, root, parts, drv2, root2, parts2):
+        """
+        Join the two paths represented by the respective
+        (drive, root, parts) tuples.  Return a new (drive, root, parts) tuple.
+        """
+        if root2:
+            if not drv2 and drv:
+                return drv, root2, [drv + root2] + parts2[1:]
+        elif drv2:
+            if drv2 == drv or self.casefold(drv2) == self.casefold(drv):
+                # Same drive => second path is relative to the first
+                return drv, root, parts + parts2[1:]
+        else:
+            # Second path is non-anchored (common case)
+            return drv, root, parts + parts2
+        return drv2, root2, parts2
+
+
+class _WindowsFlavour(_Flavour):
+    # Reference for Windows paths can be found at
+    # http://msdn.microsoft.com/en-us/library/aa365247%28v=vs.85%29.aspx
+
+    sep = '\\'
+    altsep = '/'
+    has_drv = True
+    pathmod = ntpath
+
+    is_supported = (os.name == 'nt')
+
+    drive_letters = (
+        set(chr(x) for x in range(ord('a'), ord('z') + 1)) |
+        set(chr(x) for x in range(ord('A'), ord('Z') + 1))
+    )
+    ext_namespace_prefix = '\\\\?\\'
+
+    reserved_names = (
+        {'CON', 'PRN', 'AUX', 'NUL'} |
+        {'COM%d' % i for i in range(1, 10)} |
+        {'LPT%d' % i for i in range(1, 10)}
+        )
+
+    # Interesting findings about extended paths:
+    # - '\\?\c:\a', '//?/c:\a' and '//?/c:/a' are all supported
+    #   but '\\?\c:/a' is not
+    # - extended paths are always absolute; "relative" extended paths will
+    #   fail.
+
+    def splitroot(self, part, sep=sep):
+        first = part[0:1]
+        second = part[1:2]
+        if (second == sep and first == sep):
+            # XXX extended paths should also disable the collapsing of "."
+            # components (according to MSDN docs).
+            prefix, part = self._split_extended_path(part)
+            first = part[0:1]
+            second = part[1:2]
+        else:
+            prefix = ''
+        third = part[2:3]
+        if (second == sep and first == sep and third != sep):
+            # is a UNC path:
+            # vvvvvvvvvvvvvvvvvvvvv root
+            # \\machine\mountpoint\directory\etc\...
+            #            directory ^^^^^^^^^^^^^^
+            index = part.find(sep, 2)
+            if index != -1:
+                index2 = part.find(sep, index + 1)
+                # a UNC path can't have two slashes in a row
+                # (after the initial two)
+                if index2 != index + 1:
+                    if index2 == -1:
+                        index2 = len(part)
+                    if prefix:
+                        return prefix + part[1:index2], sep, part[index2+1:]
+                    else:
+                        return part[:index2], sep, part[index2+1:]
+        drv = root = ''
+        if second == ':' and first in self.drive_letters:
+            drv = part[:2]
+            part = part[2:]
+            first = third
+        if first == sep:
+            root = first
+            part = part.lstrip(sep)
+        return prefix + drv, root, part
+
+    def casefold(self, s):
+        return s.lower()
+
+    def casefold_parts(self, parts):
+        return [p.lower() for p in parts]
+
+    def resolve(self, path):
+        s = str(path)
+        if not s:
+            return os.getcwd()
+        if _getfinalpathname is not None:
+            return self._ext_to_normal(_getfinalpathname(s))
+        # Means fallback on absolute
+        return None
+
+    def _split_extended_path(self, s, ext_prefix=ext_namespace_prefix):
+        prefix = ''
+        if s.startswith(ext_prefix):
+            prefix = s[:4]
+            s = s[4:]
+            if s.startswith('UNC\\'):
+                prefix += s[:3]
+                s = '\\' + s[3:]
+        return prefix, s
+
+    def _ext_to_normal(self, s):
+        # Turn back an extended path into a normal DOS-like path
+        return self._split_extended_path(s)[1]
+
+    def is_reserved(self, parts):
+        # NOTE: the rules for reserved names seem somewhat complicated
+        # (e.g. r"..\NUL" is reserved but not r"foo\NUL").
+        # We err on the side of caution and return True for paths which are
+        # not considered reserved by Windows.
+        if not parts:
+            return False
+        if parts[0].startswith('\\\\'):
+            # UNC paths are never reserved
+            return False
+        return parts[-1].partition('.')[0].upper() in self.reserved_names
+
+    def make_uri(self, path):
+        # Under Windows, file URIs use the UTF-8 encoding.
+        drive = path.drive
+        if len(drive) == 2 and drive[1] == ':':
+            # It's a path on a local drive => 'file:///c:/a/b'
+            rest = path.as_posix()[2:].lstrip('/')
+            return 'file:///%s/%s' % (
+                drive, urlquote_from_bytes(rest.encode('utf-8')))
+        else:
+            # It's a path on a network drive => 'file://host/share/a/b'
+            return 'file:' + urlquote_from_bytes(path.as_posix().encode('utf-8'))
+
+
+class _PosixFlavour(_Flavour):
+    sep = '/'
+    altsep = ''
+    has_drv = False
+    pathmod = posixpath
+
+    is_supported = (os.name != 'nt')
+
+    def splitroot(self, part, sep=sep):
+        if part and part[0] == sep:
+            stripped_part = part.lstrip(sep)
+            # According to POSIX path resolution:
+            # http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap04.html#tag_04_11
+            # "A pathname that begins with two successive slashes may be
+            # interpreted in an implementation-defined manner, although more
+            # than two leading slashes shall be treated as a single slash".
+            if len(part) - len(stripped_part) == 2:
+                return '', sep * 2, stripped_part
+            else:
+                return '', sep, stripped_part
+        else:
+            return '', '', part
+
+    def casefold(self, s):
+        return s
+
+    def casefold_parts(self, parts):
+        return parts
+
+    def resolve(self, path):
+        sep = self.sep
+        accessor = path._accessor
+        seen = {}
+        def _resolve(path, rest):
+            if rest.startswith(sep):
+                path = ''
+
+            for name in rest.split(sep):
+                if not name or name == '.':
+                    # current dir
+                    continue
+                if name == '..':
+                    # parent dir
+                    path, _, _ = path.rpartition(sep)
+                    continue
+                newpath = path + sep + name
+                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.
+                    raise RuntimeError("Symlink loop from %r" % newpath)
+                # Resolve the symbolic link
+                try:
+                    target = accessor.readlink(newpath)
+                except OSError as e:
+                    if e.errno != EINVAL:
+                        raise
+                    # Not a symlink
+                    path = newpath
+                else:
+                    seen[newpath] = None # not resolved symlink
+                    path = _resolve(path, target)
+                    seen[newpath] = path # resolved symlink
+
+            return path
+        # NOTE: according to POSIX, getcwd() cannot contain path components
+        # which are symlinks.
+        base = '' if path.is_absolute() else os.getcwd()
+        return _resolve(base, str(path)) or sep
+
+    def is_reserved(self, parts):
+        return False
+
+    def make_uri(self, path):
+        # We represent the path using the local filesystem encoding,
+        # for portability to other applications.
+        bpath = bytes(path)
+        return 'file://' + urlquote_from_bytes(bpath)
+
+
+_windows_flavour = _WindowsFlavour()
+_posix_flavour = _PosixFlavour()
+
+
+class _Accessor:
+    """An accessor implements a particular (system-specific or not) way of
+    accessing paths on the filesystem."""
+
+
+class _NormalAccessor(_Accessor):
+
+    def _wrap_strfunc(strfunc):
+        @functools.wraps(strfunc)
+        def wrapped(pathobj, *args):
+            return strfunc(str(pathobj), *args)
+        return staticmethod(wrapped)
+
+    def _wrap_binary_strfunc(strfunc):
+        @functools.wraps(strfunc)
+        def wrapped(pathobjA, pathobjB, *args):
+            return strfunc(str(pathobjA), str(pathobjB), *args)
+        return staticmethod(wrapped)
+
+    stat = _wrap_strfunc(os.stat)
+
+    lstat = _wrap_strfunc(os.lstat)
+
+    open = _wrap_strfunc(os.open)
+
+    listdir = _wrap_strfunc(os.listdir)
+
+    chmod = _wrap_strfunc(os.chmod)
+
+    if hasattr(os, "lchmod"):
+        lchmod = _wrap_strfunc(os.lchmod)
+    else:
+        def lchmod(self, pathobj, mode):
+            raise NotImplementedError("lchmod() not available on this system")
+
+    mkdir = _wrap_strfunc(os.mkdir)
+
+    unlink = _wrap_strfunc(os.unlink)
+
+    rmdir = _wrap_strfunc(os.rmdir)
+
+    rename = _wrap_binary_strfunc(os.rename)
+
+    replace = _wrap_binary_strfunc(os.replace)
+
+    if nt:
+        if supports_symlinks:
+            symlink = _wrap_binary_strfunc(os.symlink)
+        else:
+            def symlink(a, b, target_is_directory):
+                raise NotImplementedError("symlink() not available on this system")
+    else:
+        # Under POSIX, os.symlink() takes two args
+        @staticmethod
+        def symlink(a, b, target_is_directory):
+            return os.symlink(str(a), str(b))
+
+    utime = _wrap_strfunc(os.utime)
+
+    # Helper for resolve()
+    def readlink(self, path):
+        return os.readlink(path)
+
+
+_normal_accessor = _NormalAccessor()
+
+
+#
+# Globbing helpers
+#
+
+@contextmanager
+def _cached(func):
+    try:
+        func.__cached__
+        yield func
+    except AttributeError:
+        cache = {}
+        def wrapper(*args):
+            try:
+                return cache[args]
+            except KeyError:
+                value = cache[args] = func(*args)
+                return value
+        wrapper.__cached__ = True
+        try:
+            yield wrapper
+        finally:
+            cache.clear()
+
+def _make_selector(pattern_parts):
+    pat = pattern_parts[0]
+    child_parts = pattern_parts[1:]
+    if pat == '**':
+        cls = _RecursiveWildcardSelector
+    elif '**' in pat:
+        raise ValueError("Invalid pattern: '**' can only be an entire path component")
+    elif _is_wildcard_pattern(pat):
+        cls = _WildcardSelector
+    else:
+        cls = _PreciseSelector
+    return cls(pat, child_parts)
+
+if hasattr(functools, "lru_cache"):
+    _make_selector = functools.lru_cache()(_make_selector)
+
+
+class _Selector:
+    """A selector matches a specific glob pattern part against the children
+    of a given path."""
+
+    def __init__(self, child_parts):
+        self.child_parts = child_parts
+        if child_parts:
+            self.successor = _make_selector(child_parts)
+        else:
+            self.successor = _TerminatingSelector()
+
+    def select_from(self, parent_path):
+        """Iterate over all child paths of `parent_path` matched by this
+        selector.  This can contain parent_path itself."""
+        path_cls = type(parent_path)
+        is_dir = path_cls.is_dir
+        exists = path_cls.exists
+        listdir = parent_path._accessor.listdir
+        return self._select_from(parent_path, is_dir, exists, listdir)
+
+
+class _TerminatingSelector:
+
+    def _select_from(self, parent_path, is_dir, exists, listdir):
+        yield parent_path
+
+
+class _PreciseSelector(_Selector):
+
+    def __init__(self, name, child_parts):
+        self.name = name
+        _Selector.__init__(self, child_parts)
+
+    def _select_from(self, parent_path, is_dir, exists, listdir):
+        if not is_dir(parent_path):
+            return
+        path = parent_path._make_child_relpath(self.name)
+        if exists(path):
+            for p in self.successor._select_from(path, is_dir, exists, listdir):
+                yield p
+
+
+class _WildcardSelector(_Selector):
+
+    def __init__(self, pat, child_parts):
+        self.pat = re.compile(fnmatch.translate(pat))
+        _Selector.__init__(self, child_parts)
+
+    def _select_from(self, parent_path, is_dir, exists, listdir):
+        if not is_dir(parent_path):
+            return
+        cf = parent_path._flavour.casefold
+        for name in listdir(parent_path):
+            casefolded = cf(name)
+            if self.pat.match(casefolded):
+                path = parent_path._make_child_relpath(name)
+                for p in self.successor._select_from(path, is_dir, exists, listdir):
+                    yield p
+
+
+class _RecursiveWildcardSelector(_Selector):
+
+    def __init__(self, pat, child_parts):
+        _Selector.__init__(self, child_parts)
+
+    def _iterate_directories(self, parent_path, is_dir, listdir):
+        yield parent_path
+        for name in listdir(parent_path):
+            path = parent_path._make_child_relpath(name)
+            if is_dir(path):
+                for p in self._iterate_directories(path, is_dir, listdir):
+                    yield p
+
+    def _select_from(self, parent_path, is_dir, exists, listdir):
+        if not is_dir(parent_path):
+            return
+        with _cached(listdir) as listdir:
+            yielded = set()
+            try:
+                successor_select = self.successor._select_from
+                for starting_point in self._iterate_directories(parent_path, is_dir, listdir):
+                    for p in successor_select(starting_point, is_dir, exists, listdir):
+                        if p not in yielded:
+                            yield p
+                            yielded.add(p)
+            finally:
+                yielded.clear()
+
+
+#
+# Public API
+#
+
+class _PathParents(Sequence):
+    """This object provides sequence-like access to the logical ancestors
+    of a path.  Don't try to construct it yourself."""
+    __slots__ = ('_pathcls', '_drv', '_root', '_parts')
+
+    def __init__(self, path):
+        # We don't store the instance to avoid reference cycles
+        self._pathcls = type(path)
+        self._drv = path._drv
+        self._root = path._root
+        self._parts = path._parts
+
+    def __len__(self):
+        if self._drv or self._root:
+            return len(self._parts) - 1
+        else:
+            return len(self._parts)
+
+    def __getitem__(self, idx):
+        if idx < 0 or idx >= len(self):
+            raise IndexError(idx)
+        return self._pathcls._from_parsed_parts(self._drv, self._root,
+                                                self._parts[:-idx - 1])
+
+    def __repr__(self):
+        return "<{}.parents>".format(self._pathcls.__name__)
+
+
+class PurePath(object):
+    """PurePath represents a filesystem path and offers operations which
+    don't imply any actual filesystem I/O.  Depending on your system,
+    instantiating a PurePath will return either a PurePosixPath or a
+    PureWindowsPath object.  You can also instantiate either of these classes
+    directly, regardless of your system.
+    """
+    __slots__ = (
+        '_drv', '_root', '_parts',
+        '_str', '_hash', '_pparts', '_cached_cparts',
+    )
+
+    def __new__(cls, *args):
+        """Construct a PurePath from one or several strings and or existing
+        PurePath objects.  The strings and path objects are combined so as
+        to yield a canonicalized path, which is incorporated into the
+        new PurePath object.
+        """
+        if cls is PurePath:
+            cls = PureWindowsPath if os.name == 'nt' else PurePosixPath
+        return cls._from_parts(args)
+
+    def __reduce__(self):
+        # Using the parts tuple helps share interned path parts
+        # when pickling related paths.
+        return (self.__class__, tuple(self._parts))
+
+    @classmethod
+    def _parse_args(cls, args):
+        # This is useful when you don't want to create an instance, just
+        # canonicalize some constructor arguments.
+        parts = []
+        for a in args:
+            if isinstance(a, PurePath):
+                parts += a._parts
+            elif isinstance(a, str):
+                # Force-cast str subclasses to str (issue #21127)
+                parts.append(str(a))
+            else:
+                raise TypeError(
+                    "argument should be a path or str object, not %r"
+                    % type(a))
+        return cls._flavour.parse_parts(parts)
+
+    @classmethod
+    def _from_parts(cls, args, init=True):
+        # We need to call _parse_args on the instance, so as to get the
+        # right flavour.
+        self = object.__new__(cls)
+        drv, root, parts = self._parse_args(args)
+        self._drv = drv
+        self._root = root
+        self._parts = parts
+        if init:
+            self._init()
+        return self
+
+    @classmethod
+    def _from_parsed_parts(cls, drv, root, parts, init=True):
+        self = object.__new__(cls)
+        self._drv = drv
+        self._root = root
+        self._parts = parts
+        if init:
+            self._init()
+        return self
+
+    @classmethod
+    def _format_parsed_parts(cls, drv, root, parts):
+        if drv or root:
+            return drv + root + cls._flavour.join(parts[1:])
+        else:
+            return cls._flavour.join(parts)
+
+    def _init(self):
+        # Overriden in concrete Path
+        pass
+
+    def _make_child(self, args):
+        drv, root, parts = self._parse_args(args)
+        drv, root, parts = self._flavour.join_parsed_parts(
+            self._drv, self._root, self._parts, drv, root, parts)
+        return self._from_parsed_parts(drv, root, parts)
+
+    def __str__(self):
+        """Return the string representation of the path, suitable for
+        passing to system calls."""
+        try:
+            return self._str
+        except AttributeError:
+            self._str = self._format_parsed_parts(self._drv, self._root,
+                                                  self._parts) or '.'
+            return self._str
+
+    def as_posix(self):
+        """Return the string representation of the path with forward (/)
+        slashes."""
+        f = self._flavour
+        return str(self).replace(f.sep, '/')
+
+    def __bytes__(self):
+        """Return the bytes representation of the path.  This is only
+        recommended to use under Unix."""
+        return os.fsencode(str(self))
+
+    def __repr__(self):
+        return "{}({!r})".format(self.__class__.__name__, self.as_posix())
+
+    def as_uri(self):
+        """Return the path as a 'file' URI."""
+        if not self.is_absolute():
+            raise ValueError("relative path can't be expressed as a file URI")
+        return self._flavour.make_uri(self)
+
+    @property
+    def _cparts(self):
+        # Cached casefolded parts, for hashing and comparison
+        try:
+            return self._cached_cparts
+        except AttributeError:
+            self._cached_cparts = self._flavour.casefold_parts(self._parts)
+            return self._cached_cparts
+
+    def __eq__(self, other):
+        if not isinstance(other, PurePath):
+            return NotImplemented
+        return self._cparts == other._cparts and self._flavour is other._flavour
+
+    def __hash__(self):
+        try:
+            return self._hash
+        except AttributeError:
+            self._hash = hash(tuple(self._cparts))
+            return self._hash
+
+    def __lt__(self, other):
+        if not isinstance(other, PurePath) or self._flavour is not other._flavour:
+            return NotImplemented
+        return self._cparts < other._cparts
+
+    def __le__(self, other):
+        if not isinstance(other, PurePath) or self._flavour is not other._flavour:
+            return NotImplemented
+        return self._cparts <= other._cparts
+
+    def __gt__(self, other):
+        if not isinstance(other, PurePath) or self._flavour is not other._flavour:
+            return NotImplemented
+        return self._cparts > other._cparts
+
+    def __ge__(self, other):
+        if not isinstance(other, PurePath) or self._flavour is not other._flavour:
+            return NotImplemented
+        return self._cparts >= other._cparts
+
+    drive = property(attrgetter('_drv'),
+                     doc="""The drive prefix (letter or UNC path), if any.""")
+
+    root = property(attrgetter('_root'),
+                    doc="""The root of the path, if any.""")
+
+    @property
+    def anchor(self):
+        """The concatenation of the drive and root, or ''."""
+        anchor = self._drv + self._root
+        return anchor
+
+    @property
+    def name(self):
+        """The final path component, if any."""
+        parts = self._parts
+        if len(parts) == (1 if (self._drv or self._root) else 0):
+            return ''
+        return parts[-1]
+
+    @property
+    def suffix(self):
+        """The final component's last suffix, if any."""
+        name = self.name
+        i = name.rfind('.')
+        if 0 < i < len(name) - 1:
+            return name[i:]
+        else:
+            return ''
+
+    @property
+    def suffixes(self):
+        """A list of the final component's suffixes, if any."""
+        name = self.name
+        if name.endswith('.'):
+            return []
+        name = name.lstrip('.')
+        return ['.' + suffix for suffix in name.split('.')[1:]]
+
+    @property
+    def stem(self):
+        """The final path component, minus its last suffix."""
+        name = self.name
+        i = name.rfind('.')
+        if 0 < i < len(name) - 1:
+            return name[:i]
+        else:
+            return name
+
+    def with_name(self, name):
+        """Return a new path with the file name changed."""
+        if not self.name:
+            raise ValueError("%r has an empty name" % (self,))
+        drv, root, parts = self._flavour.parse_parts((name,))
+        if (not name or name[-1] in [self._flavour.sep, self._flavour.altsep]
+            or drv or root or len(parts) != 1):
+            raise ValueError("Invalid name %r" % (name))
+        return self._from_parsed_parts(self._drv, self._root,
+                                       self._parts[:-1] + [name])
+
+    def with_suffix(self, suffix):
+        """Return a new path with the file suffix changed (or added, if none)."""
+        # XXX if suffix is None, should the current suffix be removed?
+        f = self._flavour
+        if f.sep in suffix or f.altsep and f.altsep in suffix:
+            raise ValueError("Invalid suffix %r" % (suffix))
+        if suffix and not suffix.startswith('.') or suffix == '.':
+            raise ValueError("Invalid suffix %r" % (suffix))
+        name = self.name
+        if not name:
+            raise ValueError("%r has an empty name" % (self,))
+        old_suffix = self.suffix
+        if not old_suffix:
+            name = name + suffix
+        else:
+            name = name[:-len(old_suffix)] + suffix
+        return self._from_parsed_parts(self._drv, self._root,
+                                       self._parts[:-1] + [name])
+
+    def relative_to(self, *other):
+        """Return the relative path to another path identified by the passed
+        arguments.  If the operation is not possible (because this is not
+        a subpath of the other path), raise ValueError.
+        """
+        # For the purpose of this method, drive and root are considered
+        # separate parts, i.e.:
+        #   Path('c:/').relative_to('c:')  gives Path('/')
+        #   Path('c:/').relative_to('/')   raise ValueError
+        if not other:
+            raise TypeError("need at least one argument")
+        parts = self._parts
+        drv = self._drv
+        root = self._root
+        if root:
+            abs_parts = [drv, root] + parts[1:]
+        else:
+            abs_parts = parts
+        to_drv, to_root, to_parts = self._parse_args(other)
+        if to_root:
+            to_abs_parts = [to_drv, to_root] + to_parts[1:]
+        else:
+            to_abs_parts = to_parts
+        n = len(to_abs_parts)
+        cf = self._flavour.casefold_parts
+        if (root or drv) if n == 0 else cf(abs_parts[:n]) != cf(to_abs_parts):
+            formatted = self._format_parsed_parts(to_drv, to_root, to_parts)
+            raise ValueError("{!r} does not start with {!r}"
+                             .format(str(self), str(formatted)))
+        return self._from_parsed_parts('', root if n == 1 else '',
+                                       abs_parts[n:])
+
+    @property
+    def parts(self):
+        """An object providing sequence-like access to the
+        components in the filesystem path."""
+        # We cache the tuple to avoid building a new one each time .parts
+        # is accessed.  XXX is this necessary?
+        try:
+            return self._pparts
+        except AttributeError:
+            self._pparts = tuple(self._parts)
+            return self._pparts
+
+    def joinpath(self, *args):
+        """Combine this path with one or several arguments, and return a
+        new path representing either a subpath (if all arguments are relative
+        paths) or a totally different path (if one of the arguments is
+        anchored).
+        """
+        return self._make_child(args)
+
+    def __truediv__(self, key):
+        return self._make_child((key,))
+
+    def __rtruediv__(self, key):
+        return self._from_parts([key] + self._parts)
+
+    @property
+    def parent(self):
+        """The logical parent of the path."""
+        drv = self._drv
+        root = self._root
+        parts = self._parts
+        if len(parts) == 1 and (drv or root):
+            return self
+        return self._from_parsed_parts(drv, root, parts[:-1])
+
+    @property
+    def parents(self):
+        """A sequence of this path's logical parents."""
+        return _PathParents(self)
+
+    def is_absolute(self):
+        """True if the path is absolute (has both a root and, if applicable,
+        a drive)."""
+        if not self._root:
+            return False
+        return not self._flavour.has_drv or bool(self._drv)
+
+    def is_reserved(self):
+        """Return True if the path contains one of the special names reserved
+        by the system, if any."""
+        return self._flavour.is_reserved(self._parts)
+
+    def match(self, path_pattern):
+        """
+        Return True if this path matches the given pattern.
+        """
+        cf = self._flavour.casefold
+        path_pattern = cf(path_pattern)
+        drv, root, pat_parts = self._flavour.parse_parts((path_pattern,))
+        if not pat_parts:
+            raise ValueError("empty pattern")
+        if drv and drv != cf(self._drv):
+            return False
+        if root and root != cf(self._root):
+            return False
+        parts = self._cparts
+        if drv or root:
+            if len(pat_parts) != len(parts):
+                return False
+            pat_parts = pat_parts[1:]
+        elif len(pat_parts) > len(parts):
+            return False
+        for part, pat in zip(reversed(parts), reversed(pat_parts)):
+            if not fnmatch.fnmatchcase(part, pat):
+                return False
+        return True
+
+
+class PurePosixPath(PurePath):
+    _flavour = _posix_flavour
+    __slots__ = ()
+
+
+class PureWindowsPath(PurePath):
+    _flavour = _windows_flavour
+    __slots__ = ()
+
+
+# Filesystem-accessing classes
+
+
+class Path(PurePath):
+    __slots__ = (
+        '_accessor',
+        '_closed',
+    )
+
+    def __new__(cls, *args, **kwargs):
+        if cls is Path:
+            cls = WindowsPath if os.name == 'nt' else PosixPath
+        self = cls._from_parts(args, init=False)
+        if not self._flavour.is_supported:
+            raise NotImplementedError("cannot instantiate %r on your system"
+                                      % (cls.__name__,))
+        self._init()
+        return self
+
+    def _init(self,
+              # Private non-constructor arguments
+              template=None,
+              ):
+        self._closed = False
+        if template is not None:
+            self._accessor = template._accessor
+        else:
+            self._accessor = _normal_accessor
+
+    def _make_child_relpath(self, part):
+        # This is an optimization used for dir walking.  `part` must be
+        # a single part relative to this path.
+        parts = self._parts + [part]
+        return self._from_parsed_parts(self._drv, self._root, parts)
+
+    def __enter__(self):
+        if self._closed:
+            self._raise_closed()
+        return self
+
+    def __exit__(self, t, v, tb):
+        self._closed = True
+
+    def _raise_closed(self):
+        raise ValueError("I/O operation on closed path")
+
+    def _opener(self, name, flags, mode=0o666):
+        # A stub for the opener argument to built-in open()
+        return self._accessor.open(self, flags, mode)
+
+    def _raw_open(self, flags, mode=0o777):
+        """
+        Open the file pointed by this path and return a file descriptor,
+        as os.open() does.
+        """
+        if self._closed:
+            self._raise_closed()
+        return self._accessor.open(self, flags, mode)
+
+    # Public API
+
+    @classmethod
+    def cwd(cls):
+        """Return a new path pointing to the current working directory
+        (as returned by os.getcwd()).
+        """
+        return cls(os.getcwd())
+
+    def iterdir(self):
+        """Iterate over the files in this directory.  Does not yield any
+        result for the special paths '.' and '..'.
+        """
+        if self._closed:
+            self._raise_closed()
+        for name in self._accessor.listdir(self):
+            if name in {'.', '..'}:
+                # Yielding a path object for these makes little sense
+                continue
+            yield self._make_child_relpath(name)
+            if self._closed:
+                self._raise_closed()
+
+    def glob(self, pattern):
+        """Iterate over this subtree and yield all existing files (of any
+        kind, including directories) matching the given pattern.
+        """
+        pattern = self._flavour.casefold(pattern)
+        drv, root, pattern_parts = self._flavour.parse_parts((pattern,))
+        if drv or root:
+            raise NotImplementedError("Non-relative patterns are unsupported")
+        selector = _make_selector(tuple(pattern_parts))
+        for p in selector.select_from(self):
+            yield p
+
+    def rglob(self, pattern):
+        """Recursively yield all existing files (of any kind, including
+        directories) matching the given pattern, anywhere in this subtree.
+        """
+        pattern = self._flavour.casefold(pattern)
+        drv, root, pattern_parts = self._flavour.parse_parts((pattern,))
+        if drv or root:
+            raise NotImplementedError("Non-relative patterns are unsupported")
+        selector = _make_selector(("**",) + tuple(pattern_parts))
+        for p in selector.select_from(self):
+            yield p
+
+    def absolute(self):
+        """Return an absolute version of this path.  This function works
+        even if the path doesn't point to anything.
+
+        No normalization is done, i.e. all '.' and '..' will be kept along.
+        Use resolve() to get the canonical path to a file.
+        """
+        # XXX untested yet!
+        if self._closed:
+            self._raise_closed()
+        if self.is_absolute():
+            return self
+        # FIXME this must defer to the specific flavour (and, under Windows,
+        # use nt._getfullpathname())
+        obj = self._from_parts([os.getcwd()] + self._parts, init=False)
+        obj._init(template=self)
+        return obj
+
+    def resolve(self):
+        """
+        Make the path absolute, resolving all symlinks on the way and also
+        normalizing it (for example turning slashes into backslashes under
+        Windows).
+        """
+        if self._closed:
+            self._raise_closed()
+        s = self._flavour.resolve(self)
+        if s is None:
+            # No symlink resolution => for consistency, raise an error if
+            # the path doesn't exist or is forbidden
+            self.stat()
+            s = str(self.absolute())
+        # Now we have no symlinks in the path, it's safe to normalize it.
+        normed = self._flavour.pathmod.normpath(s)
+        obj = self._from_parts((normed,), init=False)
+        obj._init(template=self)
+        return obj
+
+    def stat(self):
+        """
+        Return the result of the stat() system call on this path, like
+        os.stat() does.
+        """
+        return self._accessor.stat(self)
+
+    def owner(self):
+        """
+        Return the login name of the file owner.
+        """
+        import pwd
+        return pwd.getpwuid(self.stat().st_uid).pw_name
+
+    def group(self):
+        """
+        Return the group name of the file gid.
+        """
+        import grp
+        return grp.getgrgid(self.stat().st_gid).gr_name
+
+    def open(self, mode='r', buffering=-1, encoding=None,
+             errors=None, newline=None):
+        """
+        Open the file pointed by this path and return a file object, as
+        the built-in open() function does.
+        """
+        if self._closed:
+            self._raise_closed()
+        return io.open(str(self), mode, buffering, encoding, errors, newline,
+                       opener=self._opener)
+
+    def touch(self, mode=0o666, exist_ok=True):
+        """
+        Create this file with the given access mode, if it doesn't exist.
+        """
+        if self._closed:
+            self._raise_closed()
+        if exist_ok:
+            # First try to bump modification time
+            # Implementation note: GNU touch uses the UTIME_NOW option of
+            # the utimensat() / futimens() functions.
+            try:
+                self._accessor.utime(self, None)
+            except OSError:
+                # Avoid exception chaining
+                pass
+            else:
+                return
+        flags = os.O_CREAT | os.O_WRONLY
+        if not exist_ok:
+            flags |= os.O_EXCL
+        fd = self._raw_open(flags, mode)
+        os.close(fd)
+
+    def mkdir(self, mode=0o777, parents=False):
+        if self._closed:
+            self._raise_closed()
+        if not parents:
+            self._accessor.mkdir(self, mode)
+        else:
+            try:
+                self._accessor.mkdir(self, mode)
+            except OSError as e:
+                if e.errno != ENOENT:
+                    raise
+                self.parent.mkdir(parents=True)
+                self._accessor.mkdir(self, mode)
+
+    def chmod(self, mode):
+        """
+        Change the permissions of the path, like os.chmod().
+        """
+        if self._closed:
+            self._raise_closed()
+        self._accessor.chmod(self, mode)
+
+    def lchmod(self, mode):
+        """
+        Like chmod(), except if the path points to a symlink, the symlink's
+        permissions are changed, rather than its target's.
+        """
+        if self._closed:
+            self._raise_closed()
+        self._accessor.lchmod(self, mode)
+
+    def unlink(self):
+        """
+        Remove this file or link.
+        If the path is a directory, use rmdir() instead.
+        """
+        if self._closed:
+            self._raise_closed()
+        self._accessor.unlink(self)
+
+    def rmdir(self):
+        """
+        Remove this directory.  The directory must be empty.
+        """
+        if self._closed:
+            self._raise_closed()
+        self._accessor.rmdir(self)
+
+    def lstat(self):
+        """
+        Like stat(), except if the path points to a symlink, the symlink's
+        status information is returned, rather than its target's.
+        """
+        if self._closed:
+            self._raise_closed()
+        return self._accessor.lstat(self)
+
+    def rename(self, target):
+        """
+        Rename this path to the given path.
+        """
+        if self._closed:
+            self._raise_closed()
+        self._accessor.rename(self, target)
+
+    def replace(self, target):
+        """
+        Rename this path to the given path, clobbering the existing
+        destination if it exists.
+        """
+        if self._closed:
+            self._raise_closed()
+        self._accessor.replace(self, target)
+
+    def symlink_to(self, target, target_is_directory=False):
+        """
+        Make this path a symlink pointing to the given path.
+        Note the order of arguments (self, target) is the reverse of os.symlink's.
+        """
+        if self._closed:
+            self._raise_closed()
+        self._accessor.symlink(target, self, target_is_directory)
+
+    # Convenience functions for querying the stat results
+
+    def exists(self):
+        """
+        Whether this path exists.
+        """
+        try:
+            self.stat()
+        except OSError as e:
+            if e.errno not in (ENOENT, ENOTDIR):
+                raise
+            return False
+        return True
+
+    def is_dir(self):
+        """
+        Whether this path is a directory.
+        """
+        try:
+            return S_ISDIR(self.stat().st_mode)
+        except OSError as e:
+            if e.errno not in (ENOENT, ENOTDIR):
+                raise
+            # Path doesn't exist or is a broken symlink
+            # (see https://bitbucket.org/pitrou/pathlib/issue/12/)
+            return False
+
+    def is_file(self):
+        """
+        Whether this path is a regular file (also True for symlinks pointing
+        to regular files).
+        """
+        try:
+            return S_ISREG(self.stat().st_mode)
+        except OSError as e:
+            if e.errno not in (ENOENT, ENOTDIR):
+                raise
+            # Path doesn't exist or is a broken symlink
+            # (see https://bitbucket.org/pitrou/pathlib/issue/12/)
+            return False
+
+    def is_symlink(self):
+        """
+        Whether this path is a symbolic link.
+        """
+        try:
+            return S_ISLNK(self.lstat().st_mode)
+        except OSError as e:
+            if e.errno not in (ENOENT, ENOTDIR):
+                raise
+            # Path doesn't exist
+            return False
+
+    def is_block_device(self):
+        """
+        Whether this path is a block device.
+        """
+        try:
+            return S_ISBLK(self.stat().st_mode)
+        except OSError as e:
+            if e.errno not in (ENOENT, ENOTDIR):
+                raise
+            # Path doesn't exist or is a broken symlink
+            # (see https://bitbucket.org/pitrou/pathlib/issue/12/)
+            return False
+
+    def is_char_device(self):
+        """
+        Whether this path is a character device.
+        """
+        try:
+            return S_ISCHR(self.stat().st_mode)
+        except OSError as e:
+            if e.errno not in (ENOENT, ENOTDIR):
+                raise
+            # Path doesn't exist or is a broken symlink
+            # (see https://bitbucket.org/pitrou/pathlib/issue/12/)
+            return False
+
+    def is_fifo(self):
+        """
+        Whether this path is a FIFO.
+        """
+        try:
+            return S_ISFIFO(self.stat().st_mode)
+        except OSError as e:
+            if e.errno not in (ENOENT, ENOTDIR):
+                raise
+            # Path doesn't exist or is a broken symlink
+            # (see https://bitbucket.org/pitrou/pathlib/issue/12/)
+            return False
+
+    def is_socket(self):
+        """
+        Whether this path is a socket.
+        """
+        try:
+            return S_ISSOCK(self.stat().st_mode)
+        except OSError as e:
+            if e.errno not in (ENOENT, ENOTDIR):
+                raise
+            # Path doesn't exist or is a broken symlink
+            # (see https://bitbucket.org/pitrou/pathlib/issue/12/)
+            return False
+
+
+class PosixPath(Path, PurePosixPath):
+    __slots__ = ()
+
+class WindowsPath(Path, PureWindowsPath):
+    __slots__ = ()
diff --git a/Lib/pdb.py b/Lib/pdb.py
index 80cba9d..e28564b 100755
--- a/Lib/pdb.py
+++ b/Lib/pdb.py
@@ -92,21 +92,14 @@
     cre = re.compile(r'def\s+%s\s*[(]' % re.escape(funcname))
     try:
         fp = open(filename)
-    except IOError:
+    except OSError:
         return None
     # consumer of this info expects the first line to be 1
-    lineno = 1
-    answer = None
-    while True:
-        line = fp.readline()
-        if line == '':
-            break
-        if cre.match(line):
-            answer = funcname, filename, lineno
-            break
-        lineno += 1
-    fp.close()
-    return answer
+    with fp:
+        for lineno, line in enumerate(fp, start=1):
+            if cre.match(line):
+                return funcname, filename, lineno
+    return None
 
 def getsourcelines(obj):
     lines, lineno = inspect.findsource(obj)
@@ -170,12 +163,12 @@
             try:
                 with open(os.path.join(envHome, ".pdbrc")) as rcFile:
                     self.rcLines.extend(rcFile)
-            except IOError:
+            except OSError:
                 pass
         try:
             with open(".pdbrc") as rcFile:
                 self.rcLines.extend(rcFile)
-        except IOError:
+        except OSError:
             pass
 
         self.commands = {} # associates a command list to breakpoint numbers
@@ -304,8 +297,16 @@
             return
         exc_type, exc_value, exc_traceback = exc_info
         frame.f_locals['__exception__'] = exc_type, exc_value
-        self.message(traceback.format_exception_only(exc_type,
-                                                     exc_value)[-1].strip())
+
+        # An 'Internal StopIteration' exception is an exception debug event
+        # issued by the interpreter when handling a subgenerator run with
+        # 'yield from' or a generator controled by a for loop. No exception has
+        # actually occurred in this case. The debugger uses this debug event to
+        # stop when the debuggee is returning from such generators.
+        prefix = 'Internal ' if (not exc_traceback
+                                    and exc_type is StopIteration) else ''
+        self.message('%s%s' % (prefix,
+            traceback.format_exception_only(exc_type, exc_value)[-1].strip()))
         self.interaction(frame, exc_traceback)
 
     # General interaction function
@@ -672,7 +673,7 @@
             # now set the break point
             err = self.set_break(filename, line, temporary, cond, funcname)
             if err:
-                self.error(err, file=self.stdout)
+                self.error(err)
             else:
                 bp = self.get_breaks(filename, line)[-1]
                 self.message("Breakpoint %d at %s:%d" %
@@ -1163,15 +1164,13 @@
             return _rstr('** raised %s **' % err)
 
     def do_p(self, arg):
-        """p(rint) expression
+        """p expression
         Print the value of the expression.
         """
         try:
             self.message(repr(self._getval(arg)))
         except:
             pass
-    # make "print" an alias of "p" since print isn't a Python statement anymore
-    do_print = do_p
 
     def do_pp(self, arg):
         """pp expression
@@ -1245,7 +1244,7 @@
         breaklist = self.get_file_breaks(filename)
         try:
             lines, lineno = getsourcelines(self.curframe)
-        except IOError as err:
+        except OSError as err:
             self.error(err)
             return
         self._print_lines(lines, lineno, breaklist, self.curframe)
@@ -1261,7 +1260,7 @@
             return
         try:
             lines, lineno = getsourcelines(obj)
-        except (IOError, TypeError) as err:
+        except (OSError, TypeError) as err:
             self.error(err)
             return
         self._print_lines(lines, lineno)
@@ -1392,7 +1391,7 @@
         placed in the .pdbrc file):
 
         # Print instance variables (usage "pi classInst")
-        alias pi for k in %1.__dict__.keys(): print "%1.",k,"=",%1.__dict__[k]
+        alias pi for k in %1.__dict__.keys(): print("%1.",k,"=",%1.__dict__[k])
         # Print instance variables in self
         alias ps pi self
         """
@@ -1550,7 +1549,7 @@
         'help', 'where', 'down', 'up', 'break', 'tbreak', 'clear', 'disable',
         'enable', 'ignore', 'condition', 'commands', 'step', 'next', 'until',
         'jump', 'return', 'retval', 'run', 'continue', 'list', 'longlist',
-        'args', 'print', 'pp', 'whatis', 'source', 'display', 'undisplay',
+        'args', 'p', 'pp', 'whatis', 'source', 'display', 'undisplay',
         'interact', 'alias', 'unalias', 'debug', 'quit',
     ]
 
diff --git a/Lib/pickle.py b/Lib/pickle.py
index 386ffba..e38ecac 100644
--- a/Lib/pickle.py
+++ b/Lib/pickle.py
@@ -23,12 +23,13 @@
 
 """
 
-from types import FunctionType, BuiltinFunctionType
+from types import FunctionType
 from copyreg import dispatch_table
 from copyreg import _extension_registry, _inverted_registry, _extension_cache
-import marshal
+from itertools import islice
 import sys
-import struct
+from sys import maxsize
+from struct import pack, unpack
 import re
 import io
 import codecs
@@ -41,28 +42,24 @@
 bytes_types = (bytes, bytearray)
 
 # These are purely informational; no code uses these.
-format_version = "3.0"                  # File format version we write
+format_version = "4.0"                  # File format version we write
 compatible_formats = ["1.0",            # Original protocol 0
                       "1.1",            # Protocol 0 with INST added
                       "1.2",            # Original protocol 1
                       "1.3",            # Protocol 1 with BINFLOAT added
                       "2.0",            # Protocol 2
                       "3.0",            # Protocol 3
+                      "4.0",            # Protocol 4
                       ]                 # Old format versions we can read
 
 # This is the highest protocol number we know how to read.
-HIGHEST_PROTOCOL = 3
+HIGHEST_PROTOCOL = 4
 
 # The protocol we write by default.  May be less than HIGHEST_PROTOCOL.
 # We intentionally write a protocol that Python 2.x cannot read;
 # there are too many issues with that.
 DEFAULT_PROTOCOL = 3
 
-# Why use struct.pack() for pickling but marshal.loads() for
-# unpickling?  struct.pack() is 40% faster than marshal.dumps(), but
-# marshal.loads() is twice as fast as struct.unpack()!
-mloads = marshal.loads
-
 class PickleError(Exception):
     """A common base class for the other pickling exceptions."""
     pass
@@ -168,7 +165,183 @@
 BINBYTES       = b'B'   # push bytes; counted binary string argument
 SHORT_BINBYTES = b'C'   #  "     "   ;    "      "       "      " < 256 bytes
 
-__all__.extend([x for x in dir() if re.match("[A-Z][A-Z0-9_]+$",x)])
+# Protocol 4
+SHORT_BINUNICODE = b'\x8c'  # push short string; UTF-8 length < 256 bytes
+BINUNICODE8      = b'\x8d'  # push very long string
+BINBYTES8        = b'\x8e'  # push very long bytes string
+EMPTY_SET        = b'\x8f'  # push empty set on the stack
+ADDITEMS         = b'\x90'  # modify set by adding topmost stack items
+FROZENSET        = b'\x91'  # build frozenset from topmost stack items
+NEWOBJ_EX        = b'\x92'  # like NEWOBJ but work with keyword only arguments
+STACK_GLOBAL     = b'\x93'  # same as GLOBAL but using names on the stacks
+MEMOIZE          = b'\x94'  # store top of the stack in memo
+FRAME            = b'\x95'  # indicate the beginning of a new frame
+
+__all__.extend([x for x in dir() if re.match("[A-Z][A-Z0-9_]+$", x)])
+
+
+class _Framer:
+
+    _FRAME_SIZE_TARGET = 64 * 1024
+
+    def __init__(self, file_write):
+        self.file_write = file_write
+        self.current_frame = None
+
+    def start_framing(self):
+        self.current_frame = io.BytesIO()
+
+    def end_framing(self):
+        if self.current_frame and self.current_frame.tell() > 0:
+            self.commit_frame(force=True)
+            self.current_frame = None
+
+    def commit_frame(self, force=False):
+        if self.current_frame:
+            f = self.current_frame
+            if f.tell() >= self._FRAME_SIZE_TARGET or force:
+                with f.getbuffer() as data:
+                    n = len(data)
+                    write = self.file_write
+                    write(FRAME)
+                    write(pack("<Q", n))
+                    write(data)
+                f.seek(0)
+                f.truncate()
+
+    def write(self, data):
+        if self.current_frame:
+            return self.current_frame.write(data)
+        else:
+            return self.file_write(data)
+
+
+class _Unframer:
+
+    def __init__(self, file_read, file_readline, file_tell=None):
+        self.file_read = file_read
+        self.file_readline = file_readline
+        self.current_frame = None
+
+    def read(self, n):
+        if self.current_frame:
+            data = self.current_frame.read(n)
+            if not data and n != 0:
+                self.current_frame = None
+                return self.file_read(n)
+            if len(data) < n:
+                raise UnpicklingError(
+                    "pickle exhausted before end of frame")
+            return data
+        else:
+            return self.file_read(n)
+
+    def readline(self):
+        if self.current_frame:
+            data = self.current_frame.readline()
+            if not data:
+                self.current_frame = None
+                return self.file_readline()
+            if data[-1] != b'\n'[0]:
+                raise UnpicklingError(
+                    "pickle exhausted before end of frame")
+            return data
+        else:
+            return self.file_readline()
+
+    def load_frame(self, frame_size):
+        if self.current_frame and self.current_frame.read() != b'':
+            raise UnpicklingError(
+                "beginning of a new frame before end of current frame")
+        self.current_frame = io.BytesIO(self.file_read(frame_size))
+
+
+# Tools used for pickling.
+
+def _getattribute(obj, name, allow_qualname=False):
+    dotted_path = name.split(".")
+    if not allow_qualname and len(dotted_path) > 1:
+        raise AttributeError("Can't get qualified attribute {!r} on {!r}; " +
+                             "use protocols >= 4 to enable support"
+                             .format(name, obj))
+    for subpath in dotted_path:
+        if subpath == '<locals>':
+            raise AttributeError("Can't get local attribute {!r} on {!r}"
+                                 .format(name, obj))
+        try:
+            obj = getattr(obj, subpath)
+        except AttributeError:
+            raise AttributeError("Can't get attribute {!r} on {!r}"
+                                 .format(name, obj))
+    return obj
+
+def whichmodule(obj, name, allow_qualname=False):
+    """Find the module an object belong to."""
+    module_name = getattr(obj, '__module__', None)
+    if module_name is not None:
+        return module_name
+    # Protect the iteration by using a list copy of sys.modules against dynamic
+    # modules that trigger imports of other modules upon calls to getattr.
+    for module_name, module in list(sys.modules.items()):
+        if module_name == '__main__' or module is None:
+            continue
+        try:
+            if _getattribute(module, name, allow_qualname) is obj:
+                return module_name
+        except AttributeError:
+            pass
+    return '__main__'
+
+def encode_long(x):
+    r"""Encode a long to a two's complement little-endian binary string.
+    Note that 0 is a special case, returning an empty string, to save a
+    byte in the LONG1 pickling context.
+
+    >>> encode_long(0)
+    b''
+    >>> encode_long(255)
+    b'\xff\x00'
+    >>> encode_long(32767)
+    b'\xff\x7f'
+    >>> encode_long(-256)
+    b'\x00\xff'
+    >>> encode_long(-32768)
+    b'\x00\x80'
+    >>> encode_long(-128)
+    b'\x80'
+    >>> encode_long(127)
+    b'\x7f'
+    >>>
+    """
+    if x == 0:
+        return b''
+    nbytes = (x.bit_length() >> 3) + 1
+    result = x.to_bytes(nbytes, byteorder='little', signed=True)
+    if x < 0 and nbytes > 1:
+        if result[-1] == 0xff and (result[-2] & 0x80) != 0:
+            result = result[:-1]
+    return result
+
+def decode_long(data):
+    r"""Decode a long from a two's complement little-endian binary string.
+
+    >>> decode_long(b'')
+    0
+    >>> decode_long(b"\xff\x00")
+    255
+    >>> decode_long(b"\xff\x7f")
+    32767
+    >>> decode_long(b"\x00\xff")
+    -256
+    >>> decode_long(b"\x00\x80")
+    -32768
+    >>> decode_long(b"\x80")
+    -128
+    >>> decode_long(b"\x7f")
+    127
+    """
+    return int.from_bytes(data, byteorder='little', signed=True)
+
 
 # Pickling machinery
 
@@ -177,24 +350,25 @@
     def __init__(self, file, protocol=None, *, fix_imports=True):
         """This takes a binary file for writing a pickle data stream.
 
-        The optional protocol argument tells the pickler to use the
-        given protocol; supported protocols are 0, 1, 2, 3.  The default
-        protocol is 3; a backward-incompatible protocol designed for
-        Python 3.0.
+        The optional *protocol* argument tells the pickler to use the
+        given protocol; supported protocols are 0, 1, 2, 3 and 4.  The
+        default protocol is 3; a backward-incompatible protocol designed
+        for Python 3.
 
         Specifying a negative protocol version selects the highest
         protocol version supported.  The higher the protocol used, the
         more recent the version of Python needed to read the pickle
         produced.
 
-        The file argument must have a write() method that accepts a single
-        bytes argument. It can thus be a file object opened for binary
-        writing, a io.BytesIO instance, or any other custom object that
-        meets this interface.
+        The *file* argument must have a write() method that accepts a
+        single bytes argument. It can thus be a file object opened for
+        binary writing, a io.BytesIO instance, or any other custom
+        object that meets this interface.
 
-        If fix_imports is True and protocol is less than 3, pickle will try to
-        map the new Python 3.x names to the old module names used in Python
-        2.x, so that the pickle data stream is readable with Python 2.x.
+        If *fix_imports* is True and *protocol* is less than 3, pickle
+        will try to map the new Python 3 names to the old module names
+        used in Python 2, so that the pickle data stream is readable
+        with Python 2.
         """
         if protocol is None:
             protocol = DEFAULT_PROTOCOL
@@ -203,9 +377,11 @@
         elif not 0 <= protocol <= HIGHEST_PROTOCOL:
             raise ValueError("pickle protocol must be <= %d" % HIGHEST_PROTOCOL)
         try:
-            self.write = file.write
+            self._file_write = file.write
         except AttributeError:
             raise TypeError("file must have a 'write' attribute")
+        self.framer = _Framer(self._file_write)
+        self.write = self.framer.write
         self.memo = {}
         self.proto = int(protocol)
         self.bin = protocol >= 1
@@ -216,10 +392,9 @@
         """Clears the pickler's "memo".
 
         The memo is the data structure that remembers which objects the
-        pickler has already seen, so that shared or recursive objects are
-        pickled by reference and not by value.  This method is useful when
-        re-using picklers.
-
+        pickler has already seen, so that shared or recursive objects
+        are pickled by reference and not by value.  This method is
+        useful when re-using picklers.
         """
         self.memo.clear()
 
@@ -227,13 +402,16 @@
         """Write a pickled representation of obj to the open file."""
         # Check whether Pickler was initialized correctly. This is
         # only needed to mimic the behavior of _pickle.Pickler.dump().
-        if not hasattr(self, "write"):
+        if not hasattr(self, "_file_write"):
             raise PicklingError("Pickler.__init__() was not called by "
                                 "%s.__init__()" % (self.__class__.__name__,))
         if self.proto >= 2:
-            self.write(PROTO + bytes([self.proto]))
+            self.write(PROTO + pack("<B", self.proto))
+        if self.proto >= 4:
+            self.framer.start_framing()
         self.save(obj)
         self.write(STOP)
+        self.framer.end_framing()
 
     def memoize(self, obj):
         """Store an object in the memo."""
@@ -253,31 +431,35 @@
         if self.fast:
             return
         assert id(obj) not in self.memo
-        memo_len = len(self.memo)
-        self.write(self.put(memo_len))
-        self.memo[id(obj)] = memo_len, obj
+        idx = len(self.memo)
+        self.write(self.put(idx))
+        self.memo[id(obj)] = idx, obj
 
     # Return a PUT (BINPUT, LONG_BINPUT) opcode string, with argument i.
-    def put(self, i, pack=struct.pack):
-        if self.bin:
-            if i < 256:
-                return BINPUT + bytes([i])
+    def put(self, idx):
+        if self.proto >= 4:
+            return MEMOIZE
+        elif self.bin:
+            if idx < 256:
+                return BINPUT + pack("<B", idx)
             else:
-                return LONG_BINPUT + pack("<I", i)
-
-        return PUT + repr(i).encode("ascii") + b'\n'
+                return LONG_BINPUT + pack("<I", idx)
+        else:
+            return PUT + repr(idx).encode("ascii") + b'\n'
 
     # Return a GET (BINGET, LONG_BINGET) opcode string, with argument i.
-    def get(self, i, pack=struct.pack):
+    def get(self, i):
         if self.bin:
             if i < 256:
-                return BINGET + bytes([i])
+                return BINGET + pack("<B", i)
             else:
                 return LONG_BINGET + pack("<I", i)
 
         return GET + repr(i).encode("ascii") + b'\n'
 
     def save(self, obj, save_persistent_id=True):
+        self.framer.commit_frame()
+
         # Check for persistent id (defined by a subclass)
         pid = self.persistent_id(obj)
         if pid is not None and save_persistent_id:
@@ -286,20 +468,20 @@
 
         # Check the memo
         x = self.memo.get(id(obj))
-        if x:
+        if x is not None:
             self.write(self.get(x[0]))
             return
 
         # Check the type dispatch table
         t = type(obj)
         f = self.dispatch.get(t)
-        if f:
+        if f is not None:
             f(self, obj) # Call unbound method with explicit self
             return
 
         # Check private dispatch table if any, or else copyreg.dispatch_table
         reduce = getattr(self, 'dispatch_table', dispatch_table).get(t)
-        if reduce:
+        if reduce is not None:
             rv = reduce(obj)
         else:
             # Check for a class with a custom metaclass; treat as regular class
@@ -313,11 +495,11 @@
 
             # Check for a __reduce_ex__ method, fall back to __reduce__
             reduce = getattr(obj, "__reduce_ex__", None)
-            if reduce:
+            if reduce is not None:
                 rv = reduce(self.proto)
             else:
                 reduce = getattr(obj, "__reduce__", None)
-                if reduce:
+                if reduce is not None:
                     rv = reduce()
                 else:
                     raise PicklingError("Can't pickle %r object: %r" %
@@ -353,24 +535,33 @@
         else:
             self.write(PERSID + str(pid).encode("ascii") + b'\n')
 
-    def save_reduce(self, func, args, state=None,
-                    listitems=None, dictitems=None, obj=None):
+    def save_reduce(self, func, args, state=None, listitems=None,
+                    dictitems=None, obj=None):
         # This API is called by some subclasses
 
-        # Assert that args is a tuple
         if not isinstance(args, tuple):
-            raise PicklingError("args from save_reduce() should be a tuple")
-
-        # Assert that func is callable
+            raise PicklingError("args from save_reduce() must be a tuple")
         if not callable(func):
-            raise PicklingError("func from save_reduce() should be callable")
+            raise PicklingError("func from save_reduce() must be callable")
 
         save = self.save
         write = self.write
 
-        # Protocol 2 special case: if func's name is __newobj__, use NEWOBJ
-        if self.proto >= 2 and getattr(func, "__name__", "") == "__newobj__":
-            # A __reduce__ implementation can direct protocol 2 to
+        func_name = getattr(func, "__name__", "")
+        if self.proto >= 4 and func_name == "__newobj_ex__":
+            cls, args, kwargs = args
+            if not hasattr(cls, "__new__"):
+                raise PicklingError("args[0] from {} args has no __new__"
+                                    .format(func_name))
+            if obj is not None and cls is not obj.__class__:
+                raise PicklingError("args[0] from {} args has the wrong class"
+                                    .format(func_name))
+            save(cls)
+            save(args)
+            save(kwargs)
+            write(NEWOBJ_EX)
+        elif self.proto >= 2 and func_name == "__newobj__":
+            # A __reduce__ implementation can direct protocol 2 or newer to
             # use the more efficient NEWOBJ opcode, while still
             # allowing protocol 0 and 1 to work normally.  For this to
             # work, the function returned by __reduce__ should be
@@ -413,7 +604,13 @@
             write(REDUCE)
 
         if obj is not None:
-            self.memoize(obj)
+            # If the object is already in the memo, this means it is
+            # recursive. In this case, throw away everything we put on the
+            # stack, and fetch the object back from the memo.
+            if id(obj) in self.memo:
+                write(POP + self.get(self.memo[id(obj)][0]))
+            else:
+                self.memoize(obj)
 
         # More new special cases (that work with older protocols as
         # well): when __reduce__ returns a tuple with 4 or 5 items,
@@ -438,22 +635,14 @@
         self.write(NONE)
     dispatch[type(None)] = save_none
 
-    def save_ellipsis(self, obj):
-        self.save_global(Ellipsis, 'Ellipsis')
-    dispatch[type(Ellipsis)] = save_ellipsis
-
-    def save_notimplemented(self, obj):
-        self.save_global(NotImplemented, 'NotImplemented')
-    dispatch[type(NotImplemented)] = save_notimplemented
-
     def save_bool(self, obj):
         if self.proto >= 2:
-            self.write(obj and NEWTRUE or NEWFALSE)
+            self.write(NEWTRUE if obj else NEWFALSE)
         else:
-            self.write(obj and TRUE or FALSE)
+            self.write(TRUE if obj else FALSE)
     dispatch[bool] = save_bool
 
-    def save_long(self, obj, pack=struct.pack):
+    def save_long(self, obj):
         if self.bin:
             # If the int is small enough to fit in a signed 4-byte 2's-comp
             # format, we can store it more efficiently than the general
@@ -461,93 +650,95 @@
             # First one- and two-byte unsigned ints:
             if obj >= 0:
                 if obj <= 0xff:
-                    self.write(BININT1 + bytes([obj]))
+                    self.write(BININT1 + pack("<B", obj))
                     return
                 if obj <= 0xffff:
-                    self.write(BININT2 + bytes([obj&0xff, obj>>8]))
+                    self.write(BININT2 + pack("<H", obj))
                     return
             # Next check for 4-byte signed ints:
-            high_bits = obj >> 31  # note that Python shift sign-extends
-            if high_bits == 0 or high_bits == -1:
-                # All high bits are copies of bit 2**31, so the value
-                # fits in a 4-byte signed int.
+            if -0x80000000 <= obj <= 0x7fffffff:
                 self.write(BININT + pack("<i", obj))
                 return
         if self.proto >= 2:
             encoded = encode_long(obj)
             n = len(encoded)
             if n < 256:
-                self.write(LONG1 + bytes([n]) + encoded)
+                self.write(LONG1 + pack("<B", n) + encoded)
             else:
                 self.write(LONG4 + pack("<i", n) + encoded)
             return
         self.write(LONG + repr(obj).encode("ascii") + b'L\n')
     dispatch[int] = save_long
 
-    def save_float(self, obj, pack=struct.pack):
+    def save_float(self, obj):
         if self.bin:
             self.write(BINFLOAT + pack('>d', obj))
         else:
             self.write(FLOAT + repr(obj).encode("ascii") + b'\n')
     dispatch[float] = save_float
 
-    def save_bytes(self, obj, pack=struct.pack):
+    def save_bytes(self, obj):
         if self.proto < 3:
-            if len(obj) == 0:
+            if not obj: # bytes object is empty
                 self.save_reduce(bytes, (), obj=obj)
             else:
                 self.save_reduce(codecs.encode,
                                  (str(obj, 'latin1'), 'latin1'), obj=obj)
             return
         n = len(obj)
-        if n < 256:
-            self.write(SHORT_BINBYTES + bytes([n]) + bytes(obj))
+        if n <= 0xff:
+            self.write(SHORT_BINBYTES + pack("<B", n) + obj)
+        elif n > 0xffffffff and self.proto >= 4:
+            self.write(BINBYTES8 + pack("<Q", n) + obj)
         else:
-            self.write(BINBYTES + pack("<I", n) + bytes(obj))
+            self.write(BINBYTES + pack("<I", n) + obj)
         self.memoize(obj)
     dispatch[bytes] = save_bytes
 
-    def save_str(self, obj, pack=struct.pack):
+    def save_str(self, obj):
         if self.bin:
             encoded = obj.encode('utf-8', 'surrogatepass')
             n = len(encoded)
-            self.write(BINUNICODE + pack("<I", n) + encoded)
+            if n <= 0xff and self.proto >= 4:
+                self.write(SHORT_BINUNICODE + pack("<B", n) + encoded)
+            elif n > 0xffffffff and self.proto >= 4:
+                self.write(BINUNICODE8 + pack("<Q", n) + encoded)
+            else:
+                self.write(BINUNICODE + pack("<I", n) + encoded)
         else:
             obj = obj.replace("\\", "\\u005c")
             obj = obj.replace("\n", "\\u000a")
-            self.write(UNICODE + bytes(obj.encode('raw-unicode-escape')) +
+            self.write(UNICODE + obj.encode('raw-unicode-escape') +
                        b'\n')
         self.memoize(obj)
     dispatch[str] = save_str
 
     def save_tuple(self, obj):
-        write = self.write
-        proto = self.proto
-
-        n = len(obj)
-        if n == 0:
-            if proto:
-                write(EMPTY_TUPLE)
+        if not obj: # tuple is empty
+            if self.bin:
+                self.write(EMPTY_TUPLE)
             else:
-                write(MARK + TUPLE)
+                self.write(MARK + TUPLE)
             return
 
+        n = len(obj)
         save = self.save
         memo = self.memo
-        if n <= 3 and proto >= 2:
+        if n <= 3 and self.proto >= 2:
             for element in obj:
                 save(element)
             # Subtle.  Same as in the big comment below.
             if id(obj) in memo:
                 get = self.get(memo[id(obj)][0])
-                write(POP * n + get)
+                self.write(POP * n + get)
             else:
-                write(_tuplesize2code[n])
+                self.write(_tuplesize2code[n])
                 self.memoize(obj)
             return
 
         # proto 0 or proto 1 and tuple isn't empty, or proto > 1 and tuple
         # has more than 3 elements.
+        write = self.write
         write(MARK)
         for element in obj:
             save(element)
@@ -561,25 +752,23 @@
             # could have been done in the "for element" loop instead, but
             # recursive tuples are a rare thing.
             get = self.get(memo[id(obj)][0])
-            if proto:
+            if self.bin:
                 write(POP_MARK + get)
             else:   # proto 0 -- POP_MARK not available
                 write(POP * (n+1) + get)
             return
 
         # No recursion.
-        self.write(TUPLE)
+        write(TUPLE)
         self.memoize(obj)
 
     dispatch[tuple] = save_tuple
 
     def save_list(self, obj):
-        write = self.write
-
         if self.bin:
-            write(EMPTY_LIST)
+            self.write(EMPTY_LIST)
         else:   # proto 0 -- can't use EMPTY_LIST
-            write(MARK + LIST)
+            self.write(MARK + LIST)
 
         self.memoize(obj)
         self._batch_appends(obj)
@@ -599,17 +788,9 @@
                 write(APPEND)
             return
 
-        items = iter(items)
-        r = range(self._BATCHSIZE)
-        while items is not None:
-            tmp = []
-            for i in r:
-                try:
-                    x = next(items)
-                    tmp.append(x)
-                except StopIteration:
-                    items = None
-                    break
+        it = iter(items)
+        while True:
+            tmp = list(islice(it, self._BATCHSIZE))
             n = len(tmp)
             if n > 1:
                 write(MARK)
@@ -620,14 +801,14 @@
                 save(tmp[0])
                 write(APPEND)
             # else tmp is empty, and we're done
+            if n < self._BATCHSIZE:
+                return
 
     def save_dict(self, obj):
-        write = self.write
-
         if self.bin:
-            write(EMPTY_DICT)
+            self.write(EMPTY_DICT)
         else:   # proto 0 -- can't use EMPTY_DICT
-            write(MARK + DICT)
+            self.write(MARK + DICT)
 
         self.memoize(obj)
         self._batch_setitems(obj.items())
@@ -648,16 +829,9 @@
                 write(SETITEM)
             return
 
-        items = iter(items)
-        r = range(self._BATCHSIZE)
-        while items is not None:
-            tmp = []
-            for i in r:
-                try:
-                    tmp.append(next(items))
-                except StopIteration:
-                    items = None
-                    break
+        it = iter(items)
+        while True:
+            tmp = list(islice(it, self._BATCHSIZE))
             n = len(tmp)
             if n > 1:
                 write(MARK)
@@ -671,55 +845,109 @@
                 save(v)
                 write(SETITEM)
             # else tmp is empty, and we're done
+            if n < self._BATCHSIZE:
+                return
 
-    def save_global(self, obj, name=None, pack=struct.pack):
+    def save_set(self, obj):
+        save = self.save
+        write = self.write
+
+        if self.proto < 4:
+            self.save_reduce(set, (list(obj),), obj=obj)
+            return
+
+        write(EMPTY_SET)
+        self.memoize(obj)
+
+        it = iter(obj)
+        while True:
+            batch = list(islice(it, self._BATCHSIZE))
+            n = len(batch)
+            if n > 0:
+                write(MARK)
+                for item in batch:
+                    save(item)
+                write(ADDITEMS)
+            if n < self._BATCHSIZE:
+                return
+    dispatch[set] = save_set
+
+    def save_frozenset(self, obj):
+        save = self.save
+        write = self.write
+
+        if self.proto < 4:
+            self.save_reduce(frozenset, (list(obj),), obj=obj)
+            return
+
+        write(MARK)
+        for item in obj:
+            save(item)
+
+        if id(obj) in self.memo:
+            # If the object is already in the memo, this means it is
+            # recursive. In this case, throw away everything we put on the
+            # stack, and fetch the object back from the memo.
+            write(POP_MARK + self.get(self.memo[id(obj)][0]))
+            return
+
+        write(FROZENSET)
+        self.memoize(obj)
+    dispatch[frozenset] = save_frozenset
+
+    def save_global(self, obj, name=None):
         write = self.write
         memo = self.memo
 
+        if name is None and self.proto >= 4:
+            name = getattr(obj, '__qualname__', None)
         if name is None:
             name = obj.__name__
 
-        module = getattr(obj, "__module__", None)
-        if module is None:
-            module = whichmodule(obj, name)
-
+        module_name = whichmodule(obj, name, allow_qualname=self.proto >= 4)
         try:
-            __import__(module, level=0)
-            mod = sys.modules[module]
-            klass = getattr(mod, name)
+            __import__(module_name, level=0)
+            module = sys.modules[module_name]
+            obj2 = _getattribute(module, name, allow_qualname=self.proto >= 4)
         except (ImportError, KeyError, AttributeError):
             raise PicklingError(
                 "Can't pickle %r: it's not found as %s.%s" %
-                (obj, module, name))
+                (obj, module_name, name))
         else:
-            if klass is not obj:
+            if obj2 is not obj:
                 raise PicklingError(
                     "Can't pickle %r: it's not the same object as %s.%s" %
-                    (obj, module, name))
+                    (obj, module_name, name))
 
         if self.proto >= 2:
-            code = _extension_registry.get((module, name))
+            code = _extension_registry.get((module_name, name))
             if code:
                 assert code > 0
                 if code <= 0xff:
-                    write(EXT1 + bytes([code]))
+                    write(EXT1 + pack("<B", code))
                 elif code <= 0xffff:
-                    write(EXT2 + bytes([code&0xff, code>>8]))
+                    write(EXT2 + pack("<H", code))
                 else:
                     write(EXT4 + pack("<i", code))
                 return
         # Non-ASCII identifiers are supported only with protocols >= 3.
-        if self.proto >= 3:
-            write(GLOBAL + bytes(module, "utf-8") + b'\n' +
+        if self.proto >= 4:
+            self.save(module_name)
+            self.save(name)
+            write(STACK_GLOBAL)
+        elif self.proto >= 3:
+            write(GLOBAL + bytes(module_name, "utf-8") + b'\n' +
                   bytes(name, "utf-8") + b'\n')
         else:
             if self.fix_imports:
-                if (module, name) in _compat_pickle.REVERSE_NAME_MAPPING:
-                    module, name = _compat_pickle.REVERSE_NAME_MAPPING[(module, name)]
-                if module in _compat_pickle.REVERSE_IMPORT_MAPPING:
-                    module = _compat_pickle.REVERSE_IMPORT_MAPPING[module]
+                r_name_mapping = _compat_pickle.REVERSE_NAME_MAPPING
+                r_import_mapping = _compat_pickle.REVERSE_IMPORT_MAPPING
+                if (module_name, name) in r_name_mapping:
+                    module_name, name = r_name_mapping[(module_name, name)]
+                if module_name in r_import_mapping:
+                    module_name = r_import_mapping[module_name]
             try:
-                write(GLOBAL + bytes(module, "ascii") + b'\n' +
+                write(GLOBAL + bytes(module_name, "ascii") + b'\n' +
                       bytes(name, "ascii") + b'\n')
             except UnicodeEncodeError:
                 raise PicklingError(
@@ -738,58 +966,8 @@
         return self.save_global(obj)
 
     dispatch[FunctionType] = save_global
-    dispatch[BuiltinFunctionType] = save_global
     dispatch[type] = save_type
 
-# Pickling helpers
-
-def _keep_alive(x, memo):
-    """Keeps a reference to the object x in the memo.
-
-    Because we remember objects by their id, we have
-    to assure that possibly temporary objects are kept
-    alive by referencing them.
-    We store a reference at the id of the memo, which should
-    normally not be used unless someone tries to deepcopy
-    the memo itself...
-    """
-    try:
-        memo[id(memo)].append(x)
-    except KeyError:
-        # aha, this is the first one :-)
-        memo[id(memo)]=[x]
-
-
-# A cache for whichmodule(), mapping a function object to the name of
-# the module in which the function was found.
-
-classmap = {} # called classmap for backwards compatibility
-
-def whichmodule(func, funcname):
-    """Figure out the module in which a function occurs.
-
-    Search sys.modules for the module.
-    Cache in classmap.
-    Return a module name.
-    If the function cannot be found, return "__main__".
-    """
-    # Python functions should always get an __module__ from their globals.
-    mod = getattr(func, "__module__", None)
-    if mod is not None:
-        return mod
-    if func in classmap:
-        return classmap[func]
-
-    for name, module in list(sys.modules.items()):
-        if module is None:
-            continue # skip dummy package entries
-        if name != '__main__' and getattr(module, funcname, None) is func:
-            break
-    else:
-        name = '__main__'
-    classmap[func] = name
-    return name
-
 
 # Unpickling machinery
 
@@ -799,8 +977,14 @@
                  encoding="ASCII", errors="strict"):
         """This takes a binary file for reading a pickle data stream.
 
-        The protocol version of the pickle is detected automatically, so no
-        proto argument is needed.
+        The protocol version of the pickle is detected automatically, so
+        no proto argument is needed.
+
+        The argument *file* must have two methods, a read() method that
+        takes an integer argument, and a readline() method that requires
+        no arguments.  Both methods should return bytes.  Thus *file*
+        can be a binary file object opened for reading, a io.BytesIO
+        object, or any other custom object that meets this interface.
 
         The file-like object must have two methods, a read() method
         that takes an integer argument, and a readline() method that
@@ -809,16 +993,17 @@
         reading, a BytesIO object, or any other custom object that
         meets this interface.
 
-        Optional keyword arguments are *fix_imports*, *encoding* and *errors*,
-        which are used to control compatiblity support for pickle stream
-        generated by Python 2.x.  If *fix_imports* is True, pickle will try to
-        map the old Python 2.x names to the new names used in Python 3.x.  The
-        *encoding* and *errors* tell pickle how to decode 8-bit string
-        instances pickled by Python 2.x; these default to 'ASCII' and
-        'strict', respectively.
+        Optional keyword arguments are *fix_imports*, *encoding* and
+        *errors*, which are used to control compatiblity support for
+        pickle stream generated by Python 2.  If *fix_imports* is True,
+        pickle will try to map the old Python 2 names to the new names
+        used in Python 3.  The *encoding* and *errors* tell pickle how
+        to decode 8-bit string instances pickled by Python 2; these
+        default to 'ASCII' and 'strict', respectively. *encoding* can be
+        'bytes' to read theses 8-bit string instances as bytes objects.
         """
-        self.readline = file.readline
-        self.read = file.read
+        self._file_readline = file.readline
+        self._file_read = file.read
         self.memo = {}
         self.encoding = encoding
         self.errors = errors
@@ -832,16 +1017,20 @@
         """
         # Check whether Unpickler was initialized correctly. This is
         # only needed to mimic the behavior of _pickle.Unpickler.dump().
-        if not hasattr(self, "read"):
+        if not hasattr(self, "_file_read"):
             raise UnpicklingError("Unpickler.__init__() was not called by "
                                   "%s.__init__()" % (self.__class__.__name__,))
+        self._unframer = _Unframer(self._file_read, self._file_readline)
+        self.read = self._unframer.read
+        self.readline = self._unframer.readline
         self.mark = object() # any new unique object
         self.stack = []
         self.append = self.stack.append
+        self.proto = 0
         read = self.read
         dispatch = self.dispatch
         try:
-            while 1:
+            while True:
                 key = read(1)
                 if not key:
                     raise EOFError
@@ -871,12 +1060,19 @@
     dispatch = {}
 
     def load_proto(self):
-        proto = ord(self.read(1))
+        proto = self.read(1)[0]
         if not 0 <= proto <= HIGHEST_PROTOCOL:
             raise ValueError("unsupported pickle protocol: %d" % proto)
         self.proto = proto
     dispatch[PROTO[0]] = load_proto
 
+    def load_frame(self):
+        frame_size, = unpack('<Q', self.read(8))
+        if frame_size > sys.maxsize:
+            raise ValueError("frame size > sys.maxsize: %d" % frame_size)
+        self._unframer.load_frame(frame_size)
+    dispatch[FRAME[0]] = load_frame
+
     def load_persid(self):
         pid = self.readline()[:-1].decode("ascii")
         self.append(self.persistent_load(pid))
@@ -906,43 +1102,40 @@
         elif data == TRUE[1:]:
             val = True
         else:
-            try:
-                val = int(data, 0)
-            except ValueError:
-                val = int(data, 0)
+            val = int(data, 0)
         self.append(val)
     dispatch[INT[0]] = load_int
 
     def load_binint(self):
-        self.append(mloads(b'i' + self.read(4)))
+        self.append(unpack('<i', self.read(4))[0])
     dispatch[BININT[0]] = load_binint
 
     def load_binint1(self):
-        self.append(ord(self.read(1)))
+        self.append(self.read(1)[0])
     dispatch[BININT1[0]] = load_binint1
 
     def load_binint2(self):
-        self.append(mloads(b'i' + self.read(2) + b'\000\000'))
+        self.append(unpack('<H', self.read(2))[0])
     dispatch[BININT2[0]] = load_binint2
 
     def load_long(self):
-        val = self.readline()[:-1].decode("ascii")
-        if val and val[-1] == 'L':
+        val = self.readline()[:-1]
+        if val and val[-1] == b'L'[0]:
             val = val[:-1]
         self.append(int(val, 0))
     dispatch[LONG[0]] = load_long
 
     def load_long1(self):
-        n = ord(self.read(1))
+        n = self.read(1)[0]
         data = self.read(n)
         self.append(decode_long(data))
     dispatch[LONG1[0]] = load_long1
 
     def load_long4(self):
-        n = mloads(b'i' + self.read(4))
+        n, = unpack('<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");
+            raise UnpicklingError("LONG pickle has negative byte count")
         data = self.read(n)
         self.append(decode_long(data))
     dispatch[LONG4[0]] = load_long4
@@ -951,39 +1144,43 @@
         self.append(float(self.readline()[:-1]))
     dispatch[FLOAT[0]] = load_float
 
-    def load_binfloat(self, unpack=struct.unpack):
+    def load_binfloat(self):
         self.append(unpack('>d', self.read(8))[0])
     dispatch[BINFLOAT[0]] = load_binfloat
 
-    def load_string(self):
-        orig = self.readline()
-        rep = orig[:-1]
-        for q in (b'"', b"'"): # double or single quote
-            if rep.startswith(q):
-                if len(rep) < 2 or not rep.endswith(q):
-                    raise ValueError("insecure string pickle")
-                rep = rep[len(q):-len(q)]
-                break
+    def _decode_string(self, value):
+        # Used to allow strings from Python 2 to be decoded either as
+        # bytes or Unicode strings.  This should be used only with the
+        # STRING, BINSTRING and SHORT_BINSTRING opcodes.
+        if self.encoding == "bytes":
+            return value
         else:
-            raise ValueError("insecure string pickle: %r" % orig)
-        self.append(codecs.escape_decode(rep)[0]
-                    .decode(self.encoding, self.errors))
+            return value.decode(self.encoding, self.errors)
+
+    def load_string(self):
+        data = self.readline()[:-1]
+        # Strip outermost quotes
+        if len(data) >= 2 and data[0] == data[-1] and data[0] in b'"\'':
+            data = data[1:-1]
+        else:
+            raise UnpicklingError("the STRING opcode argument must be quoted")
+        self.append(self._decode_string(codecs.escape_decode(data)[0]))
     dispatch[STRING[0]] = load_string
 
     def load_binstring(self):
         # Deprecated BINSTRING uses signed 32-bit length
-        len = mloads(b'i' + self.read(4))
+        len, = unpack('<i', self.read(4))
         if len < 0:
-            raise UnpicklingError("BINSTRING pickle has negative byte count");
+            raise UnpicklingError("BINSTRING pickle has negative byte count")
         data = self.read(len)
-        value = str(data, self.encoding, self.errors)
-        self.append(value)
+        self.append(self._decode_string(data))
     dispatch[BINSTRING[0]] = load_binstring
 
-    def load_binbytes(self, unpack=struct.unpack, maxsize=sys.maxsize):
+    def load_binbytes(self):
         len, = unpack('<I', self.read(4))
         if len > maxsize:
-            raise UnpicklingError("BINBYTES exceeds system's maximum size of %d bytes" % maxsize);
+            raise UnpicklingError("BINBYTES exceeds system's maximum size "
+                                  "of %d bytes" % maxsize)
         self.append(self.read(len))
     dispatch[BINBYTES[0]] = load_binbytes
 
@@ -991,25 +1188,38 @@
         self.append(str(self.readline()[:-1], 'raw-unicode-escape'))
     dispatch[UNICODE[0]] = load_unicode
 
-    def load_binunicode(self, unpack=struct.unpack, maxsize=sys.maxsize):
+    def load_binunicode(self):
         len, = unpack('<I', self.read(4))
         if len > maxsize:
-            raise UnpicklingError("BINUNICODE exceeds system's maximum size of %d bytes" % 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
 
+    def load_binunicode8(self):
+        len, = unpack('<Q', self.read(8))
+        if len > maxsize:
+            raise UnpicklingError("BINUNICODE8 exceeds system's maximum size "
+                                  "of %d bytes" % maxsize)
+        self.append(str(self.read(len), 'utf-8', 'surrogatepass'))
+    dispatch[BINUNICODE8[0]] = load_binunicode8
+
     def load_short_binstring(self):
-        len = ord(self.read(1))
-        data = bytes(self.read(len))
-        value = str(data, self.encoding, self.errors)
-        self.append(value)
+        len = self.read(1)[0]
+        data = self.read(len)
+        self.append(self._decode_string(data))
     dispatch[SHORT_BINSTRING[0]] = load_short_binstring
 
     def load_short_binbytes(self):
-        len = ord(self.read(1))
-        self.append(bytes(self.read(len)))
+        len = self.read(1)[0]
+        self.append(self.read(len))
     dispatch[SHORT_BINBYTES[0]] = load_short_binbytes
 
+    def load_short_binunicode(self):
+        len = self.read(1)[0]
+        self.append(str(self.read(len), 'utf-8', 'surrogatepass'))
+    dispatch[SHORT_BINUNICODE[0]] = load_short_binunicode
+
     def load_tuple(self):
         k = self.marker()
         self.stack[k:] = [tuple(self.stack[k+1:])]
@@ -1039,6 +1249,15 @@
         self.append({})
     dispatch[EMPTY_DICT[0]] = load_empty_dictionary
 
+    def load_empty_set(self):
+        self.append(set())
+    dispatch[EMPTY_SET[0]] = load_empty_set
+
+    def load_frozenset(self):
+        k = self.marker()
+        self.stack[k:] = [frozenset(self.stack[k+1:])]
+    dispatch[FROZENSET[0]] = load_frozenset
+
     def load_list(self):
         k = self.marker()
         self.stack[k:] = [self.stack[k+1:]]
@@ -1046,12 +1265,9 @@
 
     def load_dict(self):
         k = self.marker()
-        d = {}
         items = self.stack[k+1:]
-        for i in range(0, len(items), 2):
-            key = items[i]
-            value = items[i+1]
-            d[key] = value
+        d = {items[i]: items[i+1]
+             for i in range(0, len(items), 2)}
         self.stack[k:] = [d]
     dispatch[DICT[0]] = load_dict
 
@@ -1090,11 +1306,19 @@
 
     def load_newobj(self):
         args = self.stack.pop()
-        cls = self.stack[-1]
+        cls = self.stack.pop()
         obj = cls.__new__(cls, *args)
-        self.stack[-1] = obj
+        self.append(obj)
     dispatch[NEWOBJ[0]] = load_newobj
 
+    def load_newobj_ex(self):
+        kwargs = self.stack.pop()
+        args = self.stack.pop()
+        cls = self.stack.pop()
+        obj = cls.__new__(cls, *args, **kwargs)
+        self.append(obj)
+    dispatch[NEWOBJ_EX[0]] = load_newobj_ex
+
     def load_global(self):
         module = self.readline()[:-1].decode("utf-8")
         name = self.readline()[:-1].decode("utf-8")
@@ -1102,18 +1326,26 @@
         self.append(klass)
     dispatch[GLOBAL[0]] = load_global
 
+    def load_stack_global(self):
+        name = self.stack.pop()
+        module = self.stack.pop()
+        if type(name) is not str or type(module) is not str:
+            raise UnpicklingError("STACK_GLOBAL requires str")
+        self.append(self.find_class(module, name))
+    dispatch[STACK_GLOBAL[0]] = load_stack_global
+
     def load_ext1(self):
-        code = ord(self.read(1))
+        code = self.read(1)[0]
         self.get_extension(code)
     dispatch[EXT1[0]] = load_ext1
 
     def load_ext2(self):
-        code = mloads(b'i' + self.read(2) + b'\000\000')
+        code, = unpack('<H', self.read(2))
         self.get_extension(code)
     dispatch[EXT2[0]] = load_ext2
 
     def load_ext4(self):
-        code = mloads(b'i' + self.read(4))
+        code, = unpack('<i', self.read(4))
         self.get_extension(code)
     dispatch[EXT4[0]] = load_ext4
 
@@ -1127,7 +1359,7 @@
         if not key:
             if code <= 0: # note that 0 is forbidden
                 # Corrupt or hostile pickle.
-                raise UnpicklingError("EXT specifies code <= 0");
+                raise UnpicklingError("EXT specifies code <= 0")
             raise ValueError("unregistered extension code %d" % code)
         obj = self.find_class(*key)
         _extension_cache[code] = obj
@@ -1141,9 +1373,8 @@
             if module in _compat_pickle.IMPORT_MAPPING:
                 module = _compat_pickle.IMPORT_MAPPING[module]
         __import__(module, level=0)
-        mod = sys.modules[module]
-        klass = getattr(mod, name)
-        return klass
+        return _getattribute(sys.modules[module], name,
+                             allow_qualname=self.proto >= 4)
 
     def load_reduce(self):
         stack = self.stack
@@ -1181,7 +1412,7 @@
         self.append(self.memo[i])
     dispatch[BINGET[0]] = load_binget
 
-    def load_long_binget(self, unpack=struct.unpack):
+    def load_long_binget(self):
         i, = unpack('<I', self.read(4))
         self.append(self.memo[i])
     dispatch[LONG_BINGET[0]] = load_long_binget
@@ -1200,13 +1431,18 @@
         self.memo[i] = self.stack[-1]
     dispatch[BINPUT[0]] = load_binput
 
-    def load_long_binput(self, unpack=struct.unpack, maxsize=sys.maxsize):
+    def load_long_binput(self):
         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
 
+    def load_memoize(self):
+        memo = self.memo
+        memo[len(memo)] = self.stack[-1]
+    dispatch[MEMOIZE[0]] = load_memoize
+
     def load_append(self):
         stack = self.stack
         value = stack.pop()
@@ -1246,12 +1482,26 @@
         del stack[mark:]
     dispatch[SETITEMS[0]] = load_setitems
 
+    def load_additems(self):
+        stack = self.stack
+        mark = self.marker()
+        set_obj = stack[mark - 1]
+        items = stack[mark + 1:]
+        if isinstance(set_obj, set):
+            set_obj.update(items)
+        else:
+            add = set_obj.add
+            for item in items:
+                add(item)
+        del stack[mark:]
+    dispatch[ADDITEMS[0]] = load_additems
+
     def load_build(self):
         stack = self.stack
         state = stack.pop()
         inst = stack[-1]
         setstate = getattr(inst, "__setstate__", None)
-        if setstate:
+        if setstate is not None:
             setstate(state)
             return
         slotstate = None
@@ -1279,86 +1529,46 @@
         raise _Stop(value)
     dispatch[STOP[0]] = load_stop
 
-# Encode/decode ints.
-
-def encode_long(x):
-    r"""Encode a long to a two's complement little-endian binary string.
-    Note that 0 is a special case, returning an empty string, to save a
-    byte in the LONG1 pickling context.
-
-    >>> encode_long(0)
-    b''
-    >>> encode_long(255)
-    b'\xff\x00'
-    >>> encode_long(32767)
-    b'\xff\x7f'
-    >>> encode_long(-256)
-    b'\x00\xff'
-    >>> encode_long(-32768)
-    b'\x00\x80'
-    >>> encode_long(-128)
-    b'\x80'
-    >>> encode_long(127)
-    b'\x7f'
-    >>>
-    """
-    if x == 0:
-        return b''
-    nbytes = (x.bit_length() >> 3) + 1
-    result = x.to_bytes(nbytes, byteorder='little', signed=True)
-    if x < 0 and nbytes > 1:
-        if result[-1] == 0xff and (result[-2] & 0x80) != 0:
-            result = result[:-1]
-    return result
-
-def decode_long(data):
-    r"""Decode an int from a two's complement little-endian binary string.
-
-    >>> decode_long(b'')
-    0
-    >>> decode_long(b"\xff\x00")
-    255
-    >>> decode_long(b"\xff\x7f")
-    32767
-    >>> decode_long(b"\x00\xff")
-    -256
-    >>> decode_long(b"\x00\x80")
-    -32768
-    >>> decode_long(b"\x80")
-    -128
-    >>> decode_long(b"\x7f")
-    127
-    """
-    return int.from_bytes(data, byteorder='little', signed=True)
 
 # Shorthands
 
-def dump(obj, file, protocol=None, *, fix_imports=True):
-    Pickler(file, protocol, fix_imports=fix_imports).dump(obj)
+def _dump(obj, file, protocol=None, *, fix_imports=True):
+    _Pickler(file, protocol, fix_imports=fix_imports).dump(obj)
 
-def dumps(obj, protocol=None, *, fix_imports=True):
+def _dumps(obj, protocol=None, *, fix_imports=True):
     f = io.BytesIO()
-    Pickler(f, protocol, fix_imports=fix_imports).dump(obj)
+    _Pickler(f, protocol, fix_imports=fix_imports).dump(obj)
     res = f.getvalue()
     assert isinstance(res, bytes_types)
     return res
 
-def load(file, *, fix_imports=True, encoding="ASCII", errors="strict"):
-    return Unpickler(file, fix_imports=fix_imports,
+def _load(file, *, fix_imports=True, encoding="ASCII", errors="strict"):
+    return _Unpickler(file, fix_imports=fix_imports,
                      encoding=encoding, errors=errors).load()
 
-def loads(s, *, fix_imports=True, encoding="ASCII", errors="strict"):
+def _loads(s, *, fix_imports=True, encoding="ASCII", errors="strict"):
     if isinstance(s, str):
         raise TypeError("Can't load pickle from unicode string")
     file = io.BytesIO(s)
-    return Unpickler(file, fix_imports=fix_imports,
-                     encoding=encoding, errors=errors).load()
+    return _Unpickler(file, fix_imports=fix_imports,
+                      encoding=encoding, errors=errors).load()
 
 # Use the faster _pickle if possible
 try:
-    from _pickle import *
+    from _pickle import (
+        PickleError,
+        PicklingError,
+        UnpicklingError,
+        Pickler,
+        Unpickler,
+        dump,
+        dumps,
+        load,
+        loads
+    )
 except ImportError:
     Pickler, Unpickler = _Pickler, _Unpickler
+    dump, dumps, load, loads = _dump, _dumps, _load, _loads
 
 # Doctest
 def _test():
diff --git a/Lib/pickletools.py b/Lib/pickletools.py
index 612fa8f..6b86723 100644
--- a/Lib/pickletools.py
+++ b/Lib/pickletools.py
@@ -11,6 +11,7 @@
 '''
 
 import codecs
+import io
 import pickle
 import re
 import sys
@@ -34,119 +35,118 @@
 #   by a later GET.
 
 
-"""
-"A pickle" is a program for a virtual pickle machine (PM, but more accurately
-called an unpickling machine).  It's a sequence of opcodes, interpreted by the
-PM, building an arbitrarily complex Python object.
+# "A pickle" is a program for a virtual pickle machine (PM, but more accurately
+# called an unpickling machine).  It's a sequence of opcodes, interpreted by the
+# PM, building an arbitrarily complex Python object.
+#
+# For the most part, the PM is very simple:  there are no looping, testing, or
+# conditional instructions, no arithmetic and no function calls.  Opcodes are
+# executed once each, from first to last, until a STOP opcode is reached.
+#
+# The PM has two data areas, "the stack" and "the memo".
+#
+# Many opcodes push Python objects onto the stack; e.g., INT pushes a Python
+# integer object on the stack, whose value is gotten from a decimal string
+# literal immediately following the INT opcode in the pickle bytestream.  Other
+# opcodes take Python objects off the stack.  The result of unpickling is
+# whatever object is left on the stack when the final STOP opcode is executed.
+#
+# The memo is simply an array of objects, or it can be implemented as a dict
+# mapping little integers to objects.  The memo serves as the PM's "long term
+# memory", and the little integers indexing the memo are akin to variable
+# names.  Some opcodes pop a stack object into the memo at a given index,
+# and others push a memo object at a given index onto the stack again.
+#
+# At heart, that's all the PM has.  Subtleties arise for these reasons:
+#
+# + Object identity.  Objects can be arbitrarily complex, and subobjects
+#   may be shared (for example, the list [a, a] refers to the same object a
+#   twice).  It can be vital that unpickling recreate an isomorphic object
+#   graph, faithfully reproducing sharing.
+#
+# + Recursive objects.  For example, after "L = []; L.append(L)", L is a
+#   list, and L[0] is the same list.  This is related to the object identity
+#   point, and some sequences of pickle opcodes are subtle in order to
+#   get the right result in all cases.
+#
+# + Things pickle doesn't know everything about.  Examples of things pickle
+#   does know everything about are Python's builtin scalar and container
+#   types, like ints and tuples.  They generally have opcodes dedicated to
+#   them.  For things like module references and instances of user-defined
+#   classes, pickle's knowledge is limited.  Historically, many enhancements
+#   have been made to the pickle protocol in order to do a better (faster,
+#   and/or more compact) job on those.
+#
+# + Backward compatibility and micro-optimization.  As explained below,
+#   pickle opcodes never go away, not even when better ways to do a thing
+#   get invented.  The repertoire of the PM just keeps growing over time.
+#   For example, protocol 0 had two opcodes for building Python integers (INT
+#   and LONG), protocol 1 added three more for more-efficient pickling of short
+#   integers, and protocol 2 added two more for more-efficient pickling of
+#   long integers (before protocol 2, the only ways to pickle a Python long
+#   took time quadratic in the number of digits, for both pickling and
+#   unpickling).  "Opcode bloat" isn't so much a subtlety as a source of
+#   wearying complication.
+#
+#
+# Pickle protocols:
+#
+# For compatibility, the meaning of a pickle opcode never changes.  Instead new
+# pickle opcodes get added, and each version's unpickler can handle all the
+# pickle opcodes in all protocol versions to date.  So old pickles continue to
+# be readable forever.  The pickler can generally be told to restrict itself to
+# the subset of opcodes available under previous protocol versions too, so that
+# users can create pickles under the current version readable by older
+# versions.  However, a pickle does not contain its version number embedded
+# within it.  If an older unpickler tries to read a pickle using a later
+# protocol, the result is most likely an exception due to seeing an unknown (in
+# the older unpickler) opcode.
+#
+# The original pickle used what's now called "protocol 0", and what was called
+# "text mode" before Python 2.3.  The entire pickle bytestream is made up of
+# printable 7-bit ASCII characters, plus the newline character, in protocol 0.
+# That's why it was called text mode.  Protocol 0 is small and elegant, but
+# sometimes painfully inefficient.
+#
+# The second major set of additions is now called "protocol 1", and was called
+# "binary mode" before Python 2.3.  This added many opcodes with arguments
+# consisting of arbitrary bytes, including NUL bytes and unprintable "high bit"
+# bytes.  Binary mode pickles can be substantially smaller than equivalent
+# text mode pickles, and sometimes faster too; e.g., BININT represents a 4-byte
+# int as 4 bytes following the opcode, which is cheaper to unpickle than the
+# (perhaps) 11-character decimal string attached to INT.  Protocol 1 also added
+# a number of opcodes that operate on many stack elements at once (like APPENDS
+# and SETITEMS), and "shortcut" opcodes (like EMPTY_DICT and EMPTY_TUPLE).
+#
+# The third major set of additions came in Python 2.3, and is called "protocol
+# 2".  This added:
+#
+# - A better way to pickle instances of new-style classes (NEWOBJ).
+#
+# - A way for a pickle to identify its protocol (PROTO).
+#
+# - Time- and space- efficient pickling of long ints (LONG{1,4}).
+#
+# - Shortcuts for small tuples (TUPLE{1,2,3}}.
+#
+# - Dedicated opcodes for bools (NEWTRUE, NEWFALSE).
+#
+# - The "extension registry", a vector of popular objects that can be pushed
+#   efficiently by index (EXT{1,2,4}).  This is akin to the memo and GET, but
+#   the registry contents are predefined (there's nothing akin to the memo's
+#   PUT).
+#
+# Another independent change with Python 2.3 is the abandonment of any
+# pretense that it might be safe to load pickles received from untrusted
+# parties -- no sufficient security analysis has been done to guarantee
+# this and there isn't a use case that warrants the expense of such an
+# analysis.
+#
+# To this end, all tests for __safe_for_unpickling__ or for
+# copyreg.safe_constructors are removed from the unpickling code.
+# References to these variables in the descriptions below are to be seen
+# as describing unpickling in Python 2.2 and before.
 
-For the most part, the PM is very simple:  there are no looping, testing, or
-conditional instructions, no arithmetic and no function calls.  Opcodes are
-executed once each, from first to last, until a STOP opcode is reached.
-
-The PM has two data areas, "the stack" and "the memo".
-
-Many opcodes push Python objects onto the stack; e.g., INT pushes a Python
-integer object on the stack, whose value is gotten from a decimal string
-literal immediately following the INT opcode in the pickle bytestream.  Other
-opcodes take Python objects off the stack.  The result of unpickling is
-whatever object is left on the stack when the final STOP opcode is executed.
-
-The memo is simply an array of objects, or it can be implemented as a dict
-mapping little integers to objects.  The memo serves as the PM's "long term
-memory", and the little integers indexing the memo are akin to variable
-names.  Some opcodes pop a stack object into the memo at a given index,
-and others push a memo object at a given index onto the stack again.
-
-At heart, that's all the PM has.  Subtleties arise for these reasons:
-
-+ Object identity.  Objects can be arbitrarily complex, and subobjects
-  may be shared (for example, the list [a, a] refers to the same object a
-  twice).  It can be vital that unpickling recreate an isomorphic object
-  graph, faithfully reproducing sharing.
-
-+ Recursive objects.  For example, after "L = []; L.append(L)", L is a
-  list, and L[0] is the same list.  This is related to the object identity
-  point, and some sequences of pickle opcodes are subtle in order to
-  get the right result in all cases.
-
-+ Things pickle doesn't know everything about.  Examples of things pickle
-  does know everything about are Python's builtin scalar and container
-  types, like ints and tuples.  They generally have opcodes dedicated to
-  them.  For things like module references and instances of user-defined
-  classes, pickle's knowledge is limited.  Historically, many enhancements
-  have been made to the pickle protocol in order to do a better (faster,
-  and/or more compact) job on those.
-
-+ Backward compatibility and micro-optimization.  As explained below,
-  pickle opcodes never go away, not even when better ways to do a thing
-  get invented.  The repertoire of the PM just keeps growing over time.
-  For example, protocol 0 had two opcodes for building Python integers (INT
-  and LONG), protocol 1 added three more for more-efficient pickling of short
-  integers, and protocol 2 added two more for more-efficient pickling of
-  long integers (before protocol 2, the only ways to pickle a Python long
-  took time quadratic in the number of digits, for both pickling and
-  unpickling).  "Opcode bloat" isn't so much a subtlety as a source of
-  wearying complication.
-
-
-Pickle protocols:
-
-For compatibility, the meaning of a pickle opcode never changes.  Instead new
-pickle opcodes get added, and each version's unpickler can handle all the
-pickle opcodes in all protocol versions to date.  So old pickles continue to
-be readable forever.  The pickler can generally be told to restrict itself to
-the subset of opcodes available under previous protocol versions too, so that
-users can create pickles under the current version readable by older
-versions.  However, a pickle does not contain its version number embedded
-within it.  If an older unpickler tries to read a pickle using a later
-protocol, the result is most likely an exception due to seeing an unknown (in
-the older unpickler) opcode.
-
-The original pickle used what's now called "protocol 0", and what was called
-"text mode" before Python 2.3.  The entire pickle bytestream is made up of
-printable 7-bit ASCII characters, plus the newline character, in protocol 0.
-That's why it was called text mode.  Protocol 0 is small and elegant, but
-sometimes painfully inefficient.
-
-The second major set of additions is now called "protocol 1", and was called
-"binary mode" before Python 2.3.  This added many opcodes with arguments
-consisting of arbitrary bytes, including NUL bytes and unprintable "high bit"
-bytes.  Binary mode pickles can be substantially smaller than equivalent
-text mode pickles, and sometimes faster too; e.g., BININT represents a 4-byte
-int as 4 bytes following the opcode, which is cheaper to unpickle than the
-(perhaps) 11-character decimal string attached to INT.  Protocol 1 also added
-a number of opcodes that operate on many stack elements at once (like APPENDS
-and SETITEMS), and "shortcut" opcodes (like EMPTY_DICT and EMPTY_TUPLE).
-
-The third major set of additions came in Python 2.3, and is called "protocol
-2".  This added:
-
-- A better way to pickle instances of new-style classes (NEWOBJ).
-
-- A way for a pickle to identify its protocol (PROTO).
-
-- Time- and space- efficient pickling of long ints (LONG{1,4}).
-
-- Shortcuts for small tuples (TUPLE{1,2,3}}.
-
-- Dedicated opcodes for bools (NEWTRUE, NEWFALSE).
-
-- The "extension registry", a vector of popular objects that can be pushed
-  efficiently by index (EXT{1,2,4}).  This is akin to the memo and GET, but
-  the registry contents are predefined (there's nothing akin to the memo's
-  PUT).
-
-Another independent change with Python 2.3 is the abandonment of any
-pretense that it might be safe to load pickles received from untrusted
-parties -- no sufficient security analysis has been done to guarantee
-this and there isn't a use case that warrants the expense of such an
-analysis.
-
-To this end, all tests for __safe_for_unpickling__ or for
-copyreg.safe_constructors are removed from the unpickling code.
-References to these variables in the descriptions below are to be seen
-as describing unpickling in Python 2.2 and before.
-"""
 
 # Meta-rule:  Descriptions are stored in instances of descriptor objects,
 # with plain constructors.  No meta-language is defined from which
@@ -169,6 +169,7 @@
 TAKEN_FROM_ARGUMENT1  = -2   # num bytes is 1-byte unsigned int
 TAKEN_FROM_ARGUMENT4  = -3   # num bytes is 4-byte signed little-endian int
 TAKEN_FROM_ARGUMENT4U = -4   # num bytes is 4-byte unsigned little-endian int
+TAKEN_FROM_ARGUMENT8U = -5   # num bytes is 8-byte unsigned little-endian int
 
 class ArgumentDescriptor(object):
     __slots__ = (
@@ -176,7 +177,7 @@
         'name',
 
         # length of argument, in bytes; an int; UP_TO_NEWLINE and
-        # TAKEN_FROM_ARGUMENT{1,4} are negative values for variable-length
+        # TAKEN_FROM_ARGUMENT{1,4,8} are negative values for variable-length
         # cases
         'n',
 
@@ -197,7 +198,8 @@
                                        n in (UP_TO_NEWLINE,
                                              TAKEN_FROM_ARGUMENT1,
                                              TAKEN_FROM_ARGUMENT4,
-                                             TAKEN_FROM_ARGUMENT4U))
+                                             TAKEN_FROM_ARGUMENT4U,
+                                             TAKEN_FROM_ARGUMENT8U))
         self.n = n
 
         self.reader = reader
@@ -289,6 +291,27 @@
             doc="Four-byte unsigned integer, little-endian.")
 
 
+def read_uint8(f):
+    r"""
+    >>> import io
+    >>> read_uint8(io.BytesIO(b'\xff\x00\x00\x00\x00\x00\x00\x00'))
+    255
+    >>> read_uint8(io.BytesIO(b'\xff' * 8)) == 2**64-1
+    True
+    """
+
+    data = f.read(8)
+    if len(data) == 8:
+        return _unpack("<Q", data)[0]
+    raise ValueError("not enough data in stream to read uint8")
+
+uint8 = ArgumentDescriptor(
+            name='uint8',
+            n=8,
+            reader=read_uint8,
+            doc="Eight-byte unsigned integer, little-endian.")
+
+
 def read_stringnl(f, decode=True, stripquotes=True):
     r"""
     >>> import io
@@ -382,6 +405,36 @@
                              a single blank separating the two strings.
                              """)
 
+
+def read_string1(f):
+    r"""
+    >>> import io
+    >>> read_string1(io.BytesIO(b"\x00"))
+    ''
+    >>> read_string1(io.BytesIO(b"\x03abcdef"))
+    'abc'
+    """
+
+    n = read_uint1(f)
+    assert n >= 0
+    data = f.read(n)
+    if len(data) == n:
+        return data.decode("latin-1")
+    raise ValueError("expected %d bytes in a string1, but only %d remain" %
+                     (n, len(data)))
+
+string1 = ArgumentDescriptor(
+              name="string1",
+              n=TAKEN_FROM_ARGUMENT1,
+              reader=read_string1,
+              doc="""A counted string.
+
+              The first argument is a 1-byte unsigned int giving the number
+              of bytes in the string, and the second argument is that many
+              bytes.
+              """)
+
+
 def read_string4(f):
     r"""
     >>> import io
@@ -416,28 +469,28 @@
               """)
 
 
-def read_string1(f):
+def read_bytes1(f):
     r"""
     >>> import io
-    >>> read_string1(io.BytesIO(b"\x00"))
-    ''
-    >>> read_string1(io.BytesIO(b"\x03abcdef"))
-    'abc'
+    >>> read_bytes1(io.BytesIO(b"\x00"))
+    b''
+    >>> read_bytes1(io.BytesIO(b"\x03abcdef"))
+    b'abc'
     """
 
     n = read_uint1(f)
     assert n >= 0
     data = f.read(n)
     if len(data) == n:
-        return data.decode("latin-1")
-    raise ValueError("expected %d bytes in a string1, but only %d remain" %
+        return data
+    raise ValueError("expected %d bytes in a bytes1, but only %d remain" %
                      (n, len(data)))
 
-string1 = ArgumentDescriptor(
-              name="string1",
+bytes1 = ArgumentDescriptor(
+              name="bytes1",
               n=TAKEN_FROM_ARGUMENT1,
-              reader=read_string1,
-              doc="""A counted string.
+              reader=read_bytes1,
+              doc="""A counted bytes string.
 
               The first argument is a 1-byte unsigned int giving the number
               of bytes in the string, and the second argument is that many
@@ -487,6 +540,7 @@
     """
 
     n = read_uint4(f)
+    assert n >= 0
     if n > sys.maxsize:
         raise ValueError("bytes4 byte count > sys.maxsize: %d" % n)
     data = f.read(n)
@@ -506,6 +560,40 @@
               """)
 
 
+def read_bytes8(f):
+    r"""
+    >>> import io, struct, sys
+    >>> read_bytes8(io.BytesIO(b"\x00\x00\x00\x00\x00\x00\x00\x00abc"))
+    b''
+    >>> read_bytes8(io.BytesIO(b"\x03\x00\x00\x00\x00\x00\x00\x00abcdef"))
+    b'abc'
+    >>> bigsize8 = struct.pack("<Q", sys.maxsize//3)
+    >>> read_bytes8(io.BytesIO(bigsize8 + b"abcdef"))  #doctest: +ELLIPSIS
+    Traceback (most recent call last):
+    ...
+    ValueError: expected ... bytes in a bytes8, but only 6 remain
+    """
+
+    n = read_uint8(f)
+    assert n >= 0
+    if n > sys.maxsize:
+        raise ValueError("bytes8 byte count > sys.maxsize: %d" % n)
+    data = f.read(n)
+    if len(data) == n:
+        return data
+    raise ValueError("expected %d bytes in a bytes8, but only %d remain" %
+                     (n, len(data)))
+
+bytes8 = ArgumentDescriptor(
+              name="bytes8",
+              n=TAKEN_FROM_ARGUMENT8U,
+              reader=read_bytes8,
+              doc="""A counted bytes string.
+
+              The first argument is a 8-byte little-endian unsigned int giving
+              the number of bytes, and the second argument is that many bytes.
+              """)
+
 def read_unicodestringnl(f):
     r"""
     >>> import io
@@ -531,6 +619,46 @@
                       escape sequences.
                       """)
 
+
+def read_unicodestring1(f):
+    r"""
+    >>> import io
+    >>> s = 'abcd\uabcd'
+    >>> enc = s.encode('utf-8')
+    >>> enc
+    b'abcd\xea\xaf\x8d'
+    >>> n = bytes([len(enc)])  # little-endian 1-byte length
+    >>> t = read_unicodestring1(io.BytesIO(n + enc + b'junk'))
+    >>> s == t
+    True
+
+    >>> read_unicodestring1(io.BytesIO(n + enc[:-1]))
+    Traceback (most recent call last):
+    ...
+    ValueError: expected 7 bytes in a unicodestring1, but only 6 remain
+    """
+
+    n = read_uint1(f)
+    assert n >= 0
+    data = f.read(n)
+    if len(data) == n:
+        return str(data, 'utf-8', 'surrogatepass')
+    raise ValueError("expected %d bytes in a unicodestring1, but only %d "
+                     "remain" % (n, len(data)))
+
+unicodestring1 = ArgumentDescriptor(
+                    name="unicodestring1",
+                    n=TAKEN_FROM_ARGUMENT1,
+                    reader=read_unicodestring1,
+                    doc="""A counted Unicode string.
+
+                    The first argument is a 1-byte little-endian signed int
+                    giving the number of bytes in the string, and the second
+                    argument-- the UTF-8 encoding of the Unicode string --
+                    contains that many bytes.
+                    """)
+
+
 def read_unicodestring4(f):
     r"""
     >>> import io
@@ -550,6 +678,7 @@
     """
 
     n = read_uint4(f)
+    assert n >= 0
     if n > sys.maxsize:
         raise ValueError("unicodestring4 byte count > sys.maxsize: %d" % n)
     data = f.read(n)
@@ -571,6 +700,47 @@
                     """)
 
 
+def read_unicodestring8(f):
+    r"""
+    >>> import io
+    >>> s = 'abcd\uabcd'
+    >>> enc = s.encode('utf-8')
+    >>> enc
+    b'abcd\xea\xaf\x8d'
+    >>> n = bytes([len(enc)]) + bytes(7)  # little-endian 8-byte length
+    >>> t = read_unicodestring8(io.BytesIO(n + enc + b'junk'))
+    >>> s == t
+    True
+
+    >>> read_unicodestring8(io.BytesIO(n + enc[:-1]))
+    Traceback (most recent call last):
+    ...
+    ValueError: expected 7 bytes in a unicodestring8, but only 6 remain
+    """
+
+    n = read_uint8(f)
+    assert n >= 0
+    if n > sys.maxsize:
+        raise ValueError("unicodestring8 byte count > sys.maxsize: %d" % n)
+    data = f.read(n)
+    if len(data) == n:
+        return str(data, 'utf-8', 'surrogatepass')
+    raise ValueError("expected %d bytes in a unicodestring8, but only %d "
+                     "remain" % (n, len(data)))
+
+unicodestring8 = ArgumentDescriptor(
+                    name="unicodestring8",
+                    n=TAKEN_FROM_ARGUMENT8U,
+                    reader=read_unicodestring8,
+                    doc="""A counted Unicode string.
+
+                    The first argument is a 8-byte little-endian signed int
+                    giving the number of bytes in the string, and the second
+                    argument-- the UTF-8 encoding of the Unicode string --
+                    contains that many bytes.
+                    """)
+
+
 def read_decimalnl_short(f):
     r"""
     >>> import io
@@ -799,103 +969,107 @@
         return self.name
 
 
-pyint = StackObject(
-            name='int',
-            obtype=int,
-            doc="A short (as opposed to long) Python integer object.")
-
-pylong = StackObject(
-             name='long',
-             obtype=int,
-             doc="A long (as opposed to short) Python integer object.")
+pyint = pylong = StackObject(
+    name='int',
+    obtype=int,
+    doc="A Python integer object.")
 
 pyinteger_or_bool = StackObject(
-                        name='int_or_bool',
-                        obtype=(int, bool),
-                        doc="A Python integer object (short or long), or "
-                            "a Python bool.")
+    name='int_or_bool',
+    obtype=(int, bool),
+    doc="A Python integer or boolean object.")
 
 pybool = StackObject(
-             name='bool',
-             obtype=(bool,),
-             doc="A Python bool object.")
+    name='bool',
+    obtype=bool,
+    doc="A Python boolean object.")
 
 pyfloat = StackObject(
-              name='float',
-              obtype=float,
-              doc="A Python float object.")
+    name='float',
+    obtype=float,
+    doc="A Python float object.")
 
-pystring = StackObject(
-               name='string',
-               obtype=bytes,
-               doc="A Python (8-bit) string object.")
+pybytes_or_str = pystring = StackObject(
+    name='bytes_or_str',
+    obtype=(bytes, str),
+    doc="A Python bytes or (Unicode) string object.")
 
 pybytes = StackObject(
-               name='bytes',
-               obtype=bytes,
-               doc="A Python bytes object.")
+    name='bytes',
+    obtype=bytes,
+    doc="A Python bytes object.")
 
 pyunicode = StackObject(
-                name='str',
-                obtype=str,
-                doc="A Python (Unicode) string object.")
+    name='str',
+    obtype=str,
+    doc="A Python (Unicode) string object.")
 
 pynone = StackObject(
-             name="None",
-             obtype=type(None),
-             doc="The Python None object.")
+    name="None",
+    obtype=type(None),
+    doc="The Python None object.")
 
 pytuple = StackObject(
-              name="tuple",
-              obtype=tuple,
-              doc="A Python tuple object.")
+    name="tuple",
+    obtype=tuple,
+    doc="A Python tuple object.")
 
 pylist = StackObject(
-             name="list",
-             obtype=list,
-             doc="A Python list object.")
+    name="list",
+    obtype=list,
+    doc="A Python list object.")
 
 pydict = StackObject(
-             name="dict",
-             obtype=dict,
-             doc="A Python dict object.")
+    name="dict",
+    obtype=dict,
+    doc="A Python dict object.")
+
+pyset = StackObject(
+    name="set",
+    obtype=set,
+    doc="A Python set object.")
+
+pyfrozenset = StackObject(
+    name="frozenset",
+    obtype=set,
+    doc="A Python frozenset object.")
 
 anyobject = StackObject(
-                name='any',
-                obtype=object,
-                doc="Any kind of object whatsoever.")
+    name='any',
+    obtype=object,
+    doc="Any kind of object whatsoever.")
 
 markobject = StackObject(
-                 name="mark",
-                 obtype=StackObject,
-                 doc="""'The mark' is a unique object.
+    name="mark",
+    obtype=StackObject,
+    doc="""'The mark' is a unique object.
 
-                 Opcodes that operate on a variable number of objects
-                 generally don't embed the count of objects in the opcode,
-                 or pull it off the stack.  Instead the MARK opcode is used
-                 to push a special marker object on the stack, and then
-                 some other opcodes grab all the objects from the top of
-                 the stack down to (but not including) the topmost marker
-                 object.
-                 """)
+Opcodes that operate on a variable number of objects
+generally don't embed the count of objects in the opcode,
+or pull it off the stack.  Instead the MARK opcode is used
+to push a special marker object on the stack, and then
+some other opcodes grab all the objects from the top of
+the stack down to (but not including) the topmost marker
+object.
+""")
 
 stackslice = StackObject(
-                 name="stackslice",
-                 obtype=StackObject,
-                 doc="""An object representing a contiguous slice of the stack.
+    name="stackslice",
+    obtype=StackObject,
+    doc="""An object representing a contiguous slice of the stack.
 
-                 This is used in conjunction with markobject, to represent all
-                 of the stack following the topmost markobject.  For example,
-                 the POP_MARK opcode changes the stack from
+This is used in conjunction with markobject, to represent all
+of the stack following the topmost markobject.  For example,
+the POP_MARK opcode changes the stack from
 
-                     [..., markobject, stackslice]
-                 to
-                     [...]
+    [..., markobject, stackslice]
+to
+    [...]
 
-                 No matter how many object are on the stack after the topmost
-                 markobject, POP_MARK gets rid of all of them (including the
-                 topmost markobject too).
-                 """)
+No matter how many object are on the stack after the topmost
+markobject, POP_MARK gets rid of all of them (including the
+topmost markobject too).
+""")
 
 ##############################################################################
 # Descriptors for pickle opcodes.
@@ -1032,7 +1206,7 @@
       code='L',
       arg=decimalnl_long,
       stack_before=[],
-      stack_after=[pylong],
+      stack_after=[pyint],
       proto=0,
       doc="""Push a long integer.
 
@@ -1050,7 +1224,7 @@
       code='\x8a',
       arg=long1,
       stack_before=[],
-      stack_after=[pylong],
+      stack_after=[pyint],
       proto=2,
       doc="""Long integer using one-byte length.
 
@@ -1061,7 +1235,7 @@
       code='\x8b',
       arg=long4,
       stack_before=[],
-      stack_after=[pylong],
+      stack_after=[pyint],
       proto=2,
       doc="""Long integer using found-byte length.
 
@@ -1074,45 +1248,50 @@
       code='S',
       arg=stringnl,
       stack_before=[],
-      stack_after=[pystring],
+      stack_after=[pybytes_or_str],
       proto=0,
       doc="""Push a Python string object.
 
       The argument is a repr-style string, with bracketing quote characters,
       and perhaps embedded escapes.  The argument extends until the next
-      newline character.  (Actually, they are decoded into a str instance
+      newline character.  These are usually decoded into a str instance
       using the encoding given to the Unpickler constructor. or the default,
-      'ASCII'.)
+      'ASCII'.  If the encoding given was 'bytes' however, they will be
+      decoded as bytes object instead.
       """),
 
     I(name='BINSTRING',
       code='T',
       arg=string4,
       stack_before=[],
-      stack_after=[pystring],
+      stack_after=[pybytes_or_str],
       proto=1,
       doc="""Push a Python string object.
 
-      There are two arguments:  the first is a 4-byte little-endian signed int
-      giving the number of bytes in the string, and the second is that many
-      bytes, which are taken literally as the string content.  (Actually,
-      they are decoded into a str instance using the encoding given to the
-      Unpickler constructor. or the default, 'ASCII'.)
+      There are two arguments: the first is a 4-byte little-endian
+      signed int giving the number of bytes in the string, and the
+      second is that many bytes, which are taken literally as the string
+      content.  These are usually decoded into a str instance using the
+      encoding given to the Unpickler constructor. or the default,
+      'ASCII'.  If the encoding given was 'bytes' however, they will be
+      decoded as bytes object instead.
       """),
 
     I(name='SHORT_BINSTRING',
       code='U',
       arg=string1,
       stack_before=[],
-      stack_after=[pystring],
+      stack_after=[pybytes_or_str],
       proto=1,
       doc="""Push a Python string object.
 
-      There are two arguments:  the first is a 1-byte unsigned int giving
-      the number of bytes in the string, and the second is that many bytes,
-      which are taken literally as the string content.  (Actually, they
-      are decoded into a str instance using the encoding given to the
-      Unpickler constructor. or the default, 'ASCII'.)
+      There are two arguments: the first is a 1-byte unsigned int giving
+      the number of bytes in the string, and the second is that many
+      bytes, which are taken literally as the string content.  These are
+      usually decoded into a str instance using the encoding given to
+      the Unpickler constructor. or the default, 'ASCII'.  If the
+      encoding given was 'bytes' however, they will be decoded as bytes
+      object instead.
       """),
 
     # Bytes (protocol 3 only; older protocols don't support bytes at all)
@@ -1143,6 +1322,19 @@
       literally as the string content.
       """),
 
+    I(name='BINBYTES8',
+      code='\x8e',
+      arg=bytes8,
+      stack_before=[],
+      stack_after=[pybytes],
+      proto=4,
+      doc="""Push a Python bytes object.
+
+      There are two arguments:  the first is a 8-byte unsigned int giving
+      the number of bytes in the string, and the second is that many bytes,
+      which are taken literally as the string content.
+      """),
+
     # Ways to spell None.
 
     I(name='NONE',
@@ -1191,6 +1383,19 @@
       until the next newline character.
       """),
 
+    I(name='SHORT_BINUNICODE',
+      code='\x8c',
+      arg=unicodestring1,
+      stack_before=[],
+      stack_after=[pyunicode],
+      proto=4,
+      doc="""Push a Python Unicode string object.
+
+      There are two arguments:  the first is a 1-byte little-endian signed int
+      giving the number of bytes in the string.  The second is that many
+      bytes, and is the UTF-8 encoding of the Unicode string.
+      """),
+
     I(name='BINUNICODE',
       code='X',
       arg=unicodestring4,
@@ -1204,6 +1409,19 @@
       bytes, and is the UTF-8 encoding of the Unicode string.
       """),
 
+    I(name='BINUNICODE8',
+      code='\x8d',
+      arg=unicodestring8,
+      stack_before=[],
+      stack_after=[pyunicode],
+      proto=4,
+      doc="""Push a Python Unicode string object.
+
+      There are two arguments:  the first is a 8-byte little-endian signed int
+      giving the number of bytes in the string.  The second is that many
+      bytes, and is the UTF-8 encoding of the Unicode string.
+      """),
+
     # Ways to spell floats.
 
     I(name='FLOAT',
@@ -1429,6 +1647,54 @@
       1, 2, ..., n, and in that order.
       """),
 
+    # Ways to build sets
+
+    I(name='EMPTY_SET',
+      code='\x8f',
+      arg=None,
+      stack_before=[],
+      stack_after=[pyset],
+      proto=4,
+      doc="Push an empty set."),
+
+    I(name='ADDITEMS',
+      code='\x90',
+      arg=None,
+      stack_before=[pyset, markobject, stackslice],
+      stack_after=[pyset],
+      proto=4,
+      doc="""Add an arbitrary number of items to an existing set.
+
+      The slice of the stack following the topmost markobject is taken as
+      a sequence of items, added to the set immediately under the topmost
+      markobject.  Everything at and after the topmost markobject is popped,
+      leaving the mutated set at the top of the stack.
+
+      Stack before:  ... pyset markobject item_1 ... item_n
+      Stack after:   ... pyset
+
+      where pyset has been modified via pyset.add(item_i) = item_i for i in
+      1, 2, ..., n, and in that order.
+      """),
+
+    # Way to build frozensets
+
+    I(name='FROZENSET',
+      code='\x91',
+      arg=None,
+      stack_before=[markobject, stackslice],
+      stack_after=[pyfrozenset],
+      proto=4,
+      doc="""Build a frozenset out of the topmost slice, after markobject.
+
+      All the stack entries following the topmost markobject are placed into
+      a single Python frozenset, which single frozenset object replaces all
+      of the stack from the topmost markobject onward.  For example,
+
+      Stack before: ... markobject 1 2 3
+      Stack after:  ... frozenset({1, 2, 3})
+      """),
+
     # Stack manipulation.
 
     I(name='POP',
@@ -1550,6 +1816,18 @@
       unsigned little-endian integer following.
       """),
 
+    I(name='MEMOIZE',
+      code='\x94',
+      arg=None,
+      stack_before=[anyobject],
+      stack_after=[anyobject],
+      proto=4,
+      doc="""Store the stack top into the memo.  The stack is not popped.
+
+      The index of the memo location to write is the number of
+      elements currently present in the memo.
+      """),
+
     # Access the extension registry (predefined objects).  Akin to the GET
     # family.
 
@@ -1615,6 +1893,15 @@
       stack, so unpickling subclasses can override this form of lookup.
       """),
 
+    I(name='STACK_GLOBAL',
+      code='\x93',
+      arg=None,
+      stack_before=[pyunicode, pyunicode],
+      stack_after=[anyobject],
+      proto=0,
+      doc="""Push a global object (module.attr) on the stack.
+      """),
+
     # Ways to build objects of classes pickle doesn't know about directly
     # (user-defined classes).  I despair of documenting this accurately
     # and comprehensibly -- you really have to read the pickle code to
@@ -1771,6 +2058,21 @@
       onto the stack.
       """),
 
+    I(name='NEWOBJ_EX',
+      code='\x92',
+      arg=None,
+      stack_before=[anyobject, anyobject, anyobject],
+      stack_after=[anyobject],
+      proto=4,
+      doc="""Build an object instance.
+
+      The stack before should be thought of as containing a class
+      object followed by an argument tuple and by a keyword argument dict
+      (the dict being the stack top).  Call these cls and args.  They are
+      popped off the stack, and the value returned by
+      cls.__new__(cls, *args, *kwargs) is  pushed back  onto the stack.
+      """),
+
     # Machine control.
 
     I(name='PROTO',
@@ -1798,6 +2100,20 @@
       empty then.
       """),
 
+    # Framing support.
+
+    I(name='FRAME',
+      code='\x95',
+      arg=uint8,
+      stack_before=[],
+      stack_after=[],
+      proto=4,
+      doc="""Indicate the beginning of a new frame.
+
+      The unpickler may use this opcode to safely prefetch data from its
+      underlying stream.
+      """),
+
     # Ways to deal with persistent IDs.
 
     I(name='PERSID',
@@ -1904,6 +2220,38 @@
 ##############################################################################
 # A pickle opcode generator.
 
+def _genops(data, yield_end_pos=False):
+    if isinstance(data, bytes_types):
+        data = io.BytesIO(data)
+
+    if hasattr(data, "tell"):
+        getpos = data.tell
+    else:
+        getpos = lambda: None
+
+    while True:
+        pos = getpos()
+        code = data.read(1)
+        opcode = code2op.get(code.decode("latin-1"))
+        if opcode is None:
+            if code == b"":
+                raise ValueError("pickle exhausted before seeing STOP")
+            else:
+                raise ValueError("at position %s, opcode %r unknown" % (
+                                 "<unknown>" if pos is None else pos,
+                                 code))
+        if opcode.arg is None:
+            arg = None
+        else:
+            arg = opcode.arg.reader(data)
+        if yield_end_pos:
+            yield opcode, arg, pos, getpos()
+        else:
+            yield opcode, arg, pos
+        if code == b'.':
+            assert opcode.name == 'STOP'
+            break
+
 def genops(pickle):
     """Generate all the opcodes in a pickle.
 
@@ -1927,62 +2275,69 @@
     used.  Else (the pickle doesn't have a tell(), and it's not obvious how
     to query its current position) pos is None.
     """
-
-    if isinstance(pickle, bytes_types):
-        import io
-        pickle = io.BytesIO(pickle)
-
-    if hasattr(pickle, "tell"):
-        getpos = pickle.tell
-    else:
-        getpos = lambda: None
-
-    while True:
-        pos = getpos()
-        code = pickle.read(1)
-        opcode = code2op.get(code.decode("latin-1"))
-        if opcode is None:
-            if code == b"":
-                raise ValueError("pickle exhausted before seeing STOP")
-            else:
-                raise ValueError("at position %s, opcode %r unknown" % (
-                                 pos is None and "<unknown>" or pos,
-                                 code))
-        if opcode.arg is None:
-            arg = None
-        else:
-            arg = opcode.arg.reader(pickle)
-        yield opcode, arg, pos
-        if code == b'.':
-            assert opcode.name == 'STOP'
-            break
+    return _genops(pickle)
 
 ##############################################################################
 # A pickle optimizer.
 
 def optimize(p):
     'Optimize a pickle string by removing unused PUT opcodes'
-    gets = set()            # set of args used by a GET opcode
-    puts = []               # (arg, startpos, stoppos) for the PUT opcodes
-    prevpos = None          # set to pos if previous opcode was a PUT
-    for opcode, arg, pos in genops(p):
-        if prevpos is not None:
-            puts.append((prevarg, prevpos, pos))
-            prevpos = None
+    put = 'PUT'
+    get = 'GET'
+    oldids = set()          # set of all PUT ids
+    newids = {}             # set of ids used by a GET opcode
+    opcodes = []            # (op, idx) or (pos, end_pos)
+    proto = 0
+    protoheader = b''
+    for opcode, arg, pos, end_pos in _genops(p, yield_end_pos=True):
         if 'PUT' in opcode.name:
-            prevarg, prevpos = arg, pos
+            oldids.add(arg)
+            opcodes.append((put, arg))
+        elif opcode.name == 'MEMOIZE':
+            idx = len(oldids)
+            oldids.add(idx)
+            opcodes.append((put, idx))
+        elif 'FRAME' in opcode.name:
+            pass
         elif 'GET' in opcode.name:
-            gets.add(arg)
+            if opcode.proto > proto:
+                proto = opcode.proto
+            newids[arg] = None
+            opcodes.append((get, arg))
+        elif opcode.name == 'PROTO':
+            if arg > proto:
+                proto = arg
+            if pos == 0:
+                protoheader = p[pos: end_pos]
+            else:
+                opcodes.append((pos, end_pos))
+        else:
+            opcodes.append((pos, end_pos))
+    del oldids
 
-    # Copy the pickle string except for PUTS without a corresponding GET
-    s = []
-    i = 0
-    for arg, start, stop in puts:
-        j = stop if (arg in gets) else start
-        s.append(p[i:j])
-        i = stop
-    s.append(p[i:])
-    return b''.join(s)
+    # Copy the opcodes except for PUTS without a corresponding GET
+    out = io.BytesIO()
+    # Write the PROTO header before any framing
+    out.write(protoheader)
+    pickler = pickle._Pickler(out, proto)
+    if proto >= 4:
+        pickler.framer.start_framing()
+    idx = 0
+    for op, arg in opcodes:
+        if op is put:
+            if arg not in newids:
+                continue
+            data = pickler.put(idx)
+            newids[arg] = idx
+            idx += 1
+        elif op is get:
+            data = pickler.get(newids[arg])
+        else:
+            data = p[op:arg]
+        pickler.framer.commit_frame()
+        pickler.write(data)
+    pickler.framer.end_framing()
+    return out.getvalue()
 
 ##############################################################################
 # A symbolic pickle disassembler.
@@ -2082,17 +2437,20 @@
                 errormsg = markmsg = "no MARK exists on stack"
 
         # Check for correct memo usage.
-        if opcode.name in ("PUT", "BINPUT", "LONG_BINPUT"):
-            assert arg is not None
-            if arg in memo:
+        if opcode.name in ("PUT", "BINPUT", "LONG_BINPUT", "MEMOIZE"):
+            if opcode.name == "MEMOIZE":
+                memo_idx = len(memo)
+            else:
+                assert arg is not None
+                memo_idx = arg
+            if memo_idx in memo:
                 errormsg = "memo key %r already defined" % arg
             elif not stack:
                 errormsg = "stack is empty -- can't store into memo"
             elif stack[-1] is markobject:
                 errormsg = "can't store markobject in the memo"
             else:
-                memo[arg] = stack[-1]
-
+                memo[memo_idx] = stack[-1]
         elif opcode.name in ("GET", "BINGET", "LONG_BINGET"):
             if arg in memo:
                 assert len(after) == 1
diff --git a/Lib/pkgutil.py b/Lib/pkgutil.py
index 20e6498..a54e947 100644
--- a/Lib/pkgutil.py
+++ b/Lib/pkgutil.py
@@ -1,12 +1,14 @@
 """Utilities to support packages."""
 
-import os
-import sys
+from functools import singledispatch as simplegeneric
 import importlib
-import imp
+import importlib.util
+import importlib.machinery
+import os
 import os.path
-from warnings import warn
+import sys
 from types import ModuleType
+import warnings
 
 __all__ = [
     'get_importer', 'iter_importers', 'get_loader', 'find_loader',
@@ -14,59 +16,34 @@
     'ImpImporter', 'ImpLoader', 'read_code', 'extend_path',
 ]
 
+
+def _get_spec(finder, name):
+    """Return the finder-specific module spec."""
+    # Works with legacy finders.
+    try:
+        find_spec = finder.find_spec
+    except AttributeError:
+        loader = finder.find_module(name)
+        if loader is None:
+            return None
+        return importlib.util.spec_from_loader(name, loader)
+    else:
+        return find_spec(name)
+
+
 def read_code(stream):
     # This helper is needed in order for the PEP 302 emulation to
     # correctly handle compiled files
     import marshal
 
     magic = stream.read(4)
-    if magic != imp.get_magic():
+    if magic != importlib.util.MAGIC_NUMBER:
         return None
 
     stream.read(8) # Skip timestamp and size
     return marshal.load(stream)
 
 
-def simplegeneric(func):
-    """Make a trivial single-dispatch generic function"""
-    registry = {}
-    def wrapper(*args, **kw):
-        ob = args[0]
-        try:
-            cls = ob.__class__
-        except AttributeError:
-            cls = type(ob)
-        try:
-            mro = cls.__mro__
-        except AttributeError:
-            try:
-                class cls(cls, object):
-                    pass
-                mro = cls.__mro__[1:]
-            except TypeError:
-                mro = object,   # must be an ExtensionClass or some such  :(
-        for t in mro:
-            if t in registry:
-                return registry[t](*args, **kw)
-        else:
-            return func(*args, **kw)
-    try:
-        wrapper.__name__ = func.__name__
-    except (TypeError, AttributeError):
-        pass    # Python 2.3 doesn't allow functions to be renamed
-
-    def register(typ, func=None):
-        if func is None:
-            return lambda f: register(typ, f)
-        registry[typ] = func
-        return func
-
-    wrapper.__dict__ = func.__dict__
-    wrapper.__doc__ = func.__doc__
-    wrapper.register = register
-    return wrapper
-
-
 def walk_packages(path=None, prefix='', onerror=None):
     """Yields (module_loader, name, ispkg) for all modules recursively
     on path, or, if path is None, all accessible modules.
@@ -121,8 +98,7 @@
                 # don't traverse path items we've seen before
                 path = [p for p in path if not seen(p)]
 
-                for item in walk_packages(path, name+'.', onerror):
-                    yield item
+                yield from walk_packages(path, name+'.', onerror)
 
 
 def iter_modules(path=None, prefix=''):
@@ -149,13 +125,12 @@
                 yield i, name, ispkg
 
 
-#@simplegeneric
+@simplegeneric
 def iter_importer_modules(importer, prefix=''):
     if not hasattr(importer, 'iter_modules'):
         return []
     return importer.iter_modules(prefix)
 
-iter_importer_modules = simplegeneric(iter_importer_modules)
 
 # Implement a file walker for the normal importlib path hook
 def _iter_file_finder_modules(importer, prefix=''):
@@ -201,6 +176,13 @@
 iter_importer_modules.register(
     importlib.machinery.FileFinder, _iter_file_finder_modules)
 
+
+def _import_imp():
+    global imp
+    with warnings.catch_warnings():
+        warnings.simplefilter('ignore', PendingDeprecationWarning)
+        imp = importlib.import_module('imp')
+
 class ImpImporter:
     """PEP 302 Importer that wraps Python's "classic" import algorithm
 
@@ -213,8 +195,10 @@
     """
 
     def __init__(self, path=None):
-        warn("This emulation is deprecated, use 'importlib' instead",
+        global imp
+        warnings.warn("This emulation is deprecated, use 'importlib' instead",
              DeprecationWarning)
+        _import_imp()
         self.path = path
 
     def find_module(self, fullname, path=None):
@@ -279,8 +263,9 @@
     code = source = None
 
     def __init__(self, fullname, file, filename, etc):
-        warn("This emulation is deprecated, use 'importlib' instead",
-             DeprecationWarning)
+        warnings.warn("This emulation is deprecated, use 'importlib' instead",
+                      DeprecationWarning)
+        _import_imp()
         self.file = file
         self.filename = filename
         self.fullname = fullname
@@ -350,16 +335,16 @@
                     self.file.close()
             elif mod_type==imp.PY_COMPILED:
                 if os.path.exists(self.filename[:-1]):
-                    f = open(self.filename[:-1], 'r')
-                    self.source = f.read()
-                    f.close()
+                    with open(self.filename[:-1], 'r') as f:
+                        self.source = f.read()
             elif mod_type==imp.PKG_DIRECTORY:
                 self.source = self._get_delegate().get_source()
         return self.source
 
-
     def _get_delegate(self):
-        return ImpImporter(self.filename).find_module('__init__')
+        finder = ImpImporter(self.filename)
+        spec = _get_spec(finder, '__init__')
+        return spec.loader
 
     def get_filename(self, fullname=None):
         fullname = self._fix_name(fullname)
@@ -456,12 +441,12 @@
         if path is None:
             return
     else:
-        for importer in sys.meta_path:
-            yield importer
+        yield from sys.meta_path
         path = sys.path
     for item in path:
         yield get_importer(item)
 
+
 def get_loader(module_or_name):
     """Get a PEP 302 "loader" object for module_or_name
 
@@ -471,11 +456,15 @@
     """
     if module_or_name in sys.modules:
         module_or_name = sys.modules[module_or_name]
+        if module_or_name is None:
+            return None
     if isinstance(module_or_name, ModuleType):
         module = module_or_name
         loader = getattr(module, '__loader__', None)
         if loader is not None:
             return loader
+        if getattr(module, '__spec__', None) is None:
+            return None
         fullname = module.__name__
     else:
         fullname = module_or_name
@@ -485,29 +474,22 @@
 def find_loader(fullname):
     """Find a PEP 302 "loader" object for fullname
 
-    This is s convenience wrapper around :func:`importlib.find_loader` that
-    sets the *path* argument correctly when searching for submodules, and
-    also ensures parent packages (if any) are imported before searching for
-    submodules.
+    This is a backwards compatibility wrapper around
+    importlib.util.find_spec that converts most failures to ImportError
+    and only returns the loader rather than the full spec
     """
     if fullname.startswith('.'):
         msg = "Relative module name {!r} not supported".format(fullname)
         raise ImportError(msg)
-    path = None
-    pkg_name = fullname.rpartition(".")[0]
-    if pkg_name:
-        pkg = importlib.import_module(pkg_name)
-        path = getattr(pkg, "__path__", None)
-        if path is None:
-            return None
     try:
-        return importlib.find_loader(fullname, path)
+        spec = importlib.util.find_spec(fullname)
     except (ImportError, AttributeError, TypeError, ValueError) as ex:
         # This hack fixes an impedance mismatch between pkgutil and
         # 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
+    return spec.loader if spec is not None else None
 
 
 def extend_path(path, name):
@@ -569,13 +551,14 @@
 
         finder = get_importer(dir)
         if finder is not None:
+            portions = []
+            if hasattr(finder, 'find_spec'):
+                spec = finder.find_spec(final_name)
+                if spec is not None:
+                    portions = spec.submodule_search_locations or []
             # Is this finder PEP 420 compliant?
-            if hasattr(finder, 'find_loader'):
-                loader, portions = finder.find_loader(final_name)
-            else:
-                # No, no need to call it
-                loader = None
-                portions = []
+            elif hasattr(finder, 'find_loader'):
+                _, portions = finder.find_loader(final_name)
 
             for portion in portions:
                 # XXX This may still add duplicate entries to path on
@@ -589,19 +572,20 @@
         if os.path.isfile(pkgfile):
             try:
                 f = open(pkgfile)
-            except IOError as msg:
+            except OSError as msg:
                 sys.stderr.write("Can't open %s: %s\n" %
                                  (pkgfile, msg))
             else:
-                for line in f:
-                    line = line.rstrip('\n')
-                    if not line or line.startswith('#'):
-                        continue
-                    path.append(line) # Don't check for existence!
-                f.close()
+                with f:
+                    for line in f:
+                        line = line.rstrip('\n')
+                        if not line or line.startswith('#'):
+                            continue
+                        path.append(line) # Don't check for existence!
 
     return path
 
+
 def get_data(package, resource):
     """Get a resource from a package.
 
@@ -624,10 +608,15 @@
     which does not support get_data(), then None is returned.
     """
 
-    loader = get_loader(package)
+    spec = importlib.util.find_spec(package)
+    if spec is None:
+        return None
+    loader = spec.loader
     if loader is None or not hasattr(loader, 'get_data'):
         return None
-    mod = sys.modules.get(package) or loader.load_module(package)
+    # XXX needs test
+    mod = (sys.modules.get(package) or
+           importlib._bootstrap._SpecMethods(spec).load())
     if mod is None or not hasattr(mod, '__file__'):
         return None
 
diff --git a/Lib/plat-os2emx/IN.py b/Lib/plat-os2emx/IN.py
deleted file mode 100644
index 753ae24..0000000
--- a/Lib/plat-os2emx/IN.py
+++ /dev/null
@@ -1,82 +0,0 @@
-# Generated by h2py from f:/emx/include/netinet/in.h
-
-# Included from sys/param.h
-PAGE_SIZE = 0x1000
-HZ = 100
-MAXNAMLEN = 260
-MAXPATHLEN = 260
-def htonl(X): return _swapl(X)
-
-def ntohl(X): return _swapl(X)
-
-def htons(X): return _swaps(X)
-
-def ntohs(X): return _swaps(X)
-
-IPPROTO_IP = 0
-IPPROTO_ICMP = 1
-IPPROTO_IGMP = 2
-IPPROTO_GGP = 3
-IPPROTO_TCP = 6
-IPPROTO_EGP = 8
-IPPROTO_PUP = 12
-IPPROTO_UDP = 17
-IPPROTO_IDP = 22
-IPPROTO_TP = 29
-IPPROTO_EON = 80
-IPPROTO_RAW = 255
-IPPROTO_MAX = 256
-IPPORT_RESERVED = 1024
-IPPORT_USERRESERVED = 5000
-def IN_CLASSA(i): return (((int)(i) & 0x80000000) == 0)
-
-IN_CLASSA_NET = 0xff000000
-IN_CLASSA_NSHIFT = 24
-IN_CLASSA_HOST = 0x00ffffff
-IN_CLASSA_MAX = 128
-def IN_CLASSB(i): return (((int)(i) & 0xc0000000) == 0x80000000)
-
-IN_CLASSB_NET = 0xffff0000
-IN_CLASSB_NSHIFT = 16
-IN_CLASSB_HOST = 0x0000ffff
-IN_CLASSB_MAX = 65536
-def IN_CLASSC(i): return (((int)(i) & 0xe0000000) == 0xc0000000)
-
-IN_CLASSC_NET = 0xffffff00
-IN_CLASSC_NSHIFT = 8
-IN_CLASSC_HOST = 0x000000ff
-def IN_CLASSD(i): return (((int)(i) & 0xf0000000) == 0xe0000000)
-
-IN_CLASSD_NET = 0xf0000000
-IN_CLASSD_NSHIFT = 28
-IN_CLASSD_HOST = 0x0fffffff
-def IN_MULTICAST(i): return IN_CLASSD(i)
-
-def IN_EXPERIMENTAL(i): return (((int)(i) & 0xe0000000) == 0xe0000000)
-
-def IN_BADCLASS(i): return (((int)(i) & 0xf0000000) == 0xf0000000)
-
-INADDR_ANY = 0x00000000
-INADDR_LOOPBACK = 0x7f000001
-INADDR_BROADCAST = 0xffffffff
-INADDR_NONE = 0xffffffff
-INADDR_UNSPEC_GROUP = 0xe0000000
-INADDR_ALLHOSTS_GROUP = 0xe0000001
-INADDR_MAX_LOCAL_GROUP = 0xe00000ff
-IN_LOOPBACKNET = 127
-IP_OPTIONS = 1
-IP_MULTICAST_IF = 2
-IP_MULTICAST_TTL = 3
-IP_MULTICAST_LOOP = 4
-IP_ADD_MEMBERSHIP = 5
-IP_DROP_MEMBERSHIP = 6
-IP_HDRINCL = 2
-IP_TOS = 3
-IP_TTL = 4
-IP_RECVOPTS = 5
-IP_RECVRETOPTS = 6
-IP_RECVDSTADDR = 7
-IP_RETOPTS = 8
-IP_DEFAULT_MULTICAST_TTL = 1
-IP_DEFAULT_MULTICAST_LOOP = 1
-IP_MAX_MEMBERSHIPS = 20
diff --git a/Lib/plat-os2emx/SOCKET.py b/Lib/plat-os2emx/SOCKET.py
deleted file mode 100644
index dac594a..0000000
--- a/Lib/plat-os2emx/SOCKET.py
+++ /dev/null
@@ -1,106 +0,0 @@
-# Generated by h2py from f:/emx/include/sys/socket.h
-
-# Included from sys/types.h
-FD_SETSIZE = 256
-
-# Included from sys/uio.h
-FREAD = 1
-FWRITE = 2
-SOCK_STREAM = 1
-SOCK_DGRAM = 2
-SOCK_RAW = 3
-SOCK_RDM = 4
-SOCK_SEQPACKET = 5
-SO_DEBUG = 0x0001
-SO_ACCEPTCONN = 0x0002
-SO_REUSEADDR = 0x0004
-SO_KEEPALIVE = 0x0008
-SO_DONTROUTE = 0x0010
-SO_BROADCAST = 0x0020
-SO_USELOOPBACK = 0x0040
-SO_LINGER = 0x0080
-SO_OOBINLINE = 0x0100
-SO_L_BROADCAST = 0x0200
-SO_RCV_SHUTDOWN = 0x0400
-SO_SND_SHUTDOWN = 0x0800
-SO_SNDBUF = 0x1001
-SO_RCVBUF = 0x1002
-SO_SNDLOWAT = 0x1003
-SO_RCVLOWAT = 0x1004
-SO_SNDTIMEO = 0x1005
-SO_RCVTIMEO = 0x1006
-SO_ERROR = 0x1007
-SO_TYPE = 0x1008
-SO_OPTIONS = 0x1010
-SOL_SOCKET = 0xffff
-AF_UNSPEC = 0
-AF_UNIX = 1
-AF_INET = 2
-AF_IMPLINK = 3
-AF_PUP = 4
-AF_CHAOS = 5
-AF_NS = 6
-AF_NBS = 7
-AF_ISO = 7
-AF_OSI = AF_ISO
-AF_ECMA = 8
-AF_DATAKIT = 9
-AF_CCITT = 10
-AF_SNA = 11
-AF_DECnet = 12
-AF_DLI = 13
-AF_LAT = 14
-AF_HYLINK = 15
-AF_APPLETALK = 16
-AF_NB = 17
-AF_NETBIOS = AF_NB
-AF_OS2 = AF_UNIX
-AF_MAX = 18
-PF_UNSPEC = AF_UNSPEC
-PF_UNIX = AF_UNIX
-PF_INET = AF_INET
-PF_IMPLINK = AF_IMPLINK
-PF_PUP = AF_PUP
-PF_CHAOS = AF_CHAOS
-PF_NS = AF_NS
-PF_NBS = AF_NBS
-PF_ISO = AF_ISO
-PF_OSI = AF_ISO
-PF_ECMA = AF_ECMA
-PF_DATAKIT = AF_DATAKIT
-PF_CCITT = AF_CCITT
-PF_SNA = AF_SNA
-PF_DECnet = AF_DECnet
-PF_DLI = AF_DLI
-PF_LAT = AF_LAT
-PF_HYLINK = AF_HYLINK
-PF_APPLETALK = AF_APPLETALK
-PF_NB = AF_NB
-PF_NETBIOS = AF_NB
-PF_OS2 = AF_UNIX
-PF_MAX = AF_MAX
-SOMAXCONN = 5
-MSG_OOB = 0x1
-MSG_PEEK = 0x2
-MSG_DONTROUTE = 0x4
-MSG_EOR = 0x8
-MSG_TRUNC = 0x10
-MSG_CTRUNC = 0x20
-MSG_WAITALL = 0x40
-MSG_MAXIOVLEN = 16
-SCM_RIGHTS = 0x01
-MT_FREE = 0
-MT_DATA = 1
-MT_HEADER = 2
-MT_SOCKET = 3
-MT_PCB = 4
-MT_RTABLE = 5
-MT_HTABLE = 6
-MT_ATABLE = 7
-MT_SONAME = 8
-MT_ZOMBIE = 9
-MT_SOOPTS = 10
-MT_FTABLE = 11
-MT_RIGHTS = 12
-MT_IFADDR = 13
-MAXSOCKETS = 2048
diff --git a/Lib/plat-os2emx/_emx_link.py b/Lib/plat-os2emx/_emx_link.py
deleted file mode 100644
index 01e6b54..0000000
--- a/Lib/plat-os2emx/_emx_link.py
+++ /dev/null
@@ -1,79 +0,0 @@
-# _emx_link.py
-
-# Written by Andrew I MacIntyre, December 2002.
-
-"""_emx_link.py is a simplistic emulation of the Unix link(2) library routine
-for creating so-called hard links.  It is intended to be imported into
-the os module in place of the unimplemented (on OS/2) Posix link()
-function (os.link()).
-
-We do this on OS/2 by implementing a file copy, with link(2) semantics:-
-  - the target cannot already exist;
-  - we hope that the actual file open (if successful) is actually
-    atomic...
-
-Limitations of this approach/implementation include:-
-  - no support for correct link counts (EMX stat(target).st_nlink
-    is always 1);
-  - thread safety undefined;
-  - default file permissions (r+w) used, can't be over-ridden;
-  - implemented in Python so comparatively slow, especially for large
-    source files;
-  - need sufficient free disk space to store the copy.
-
-Behaviour:-
-  - any exception should propagate to the caller;
-  - want target to be an exact copy of the source, so use binary mode;
-  - returns None, same as os.link() which is implemented in posixmodule.c;
-  - target removed in the event of a failure where possible;
-  - given the motivation to write this emulation came from trying to
-    support a Unix resource lock implementation, where minimal overhead
-    during creation of the target is desirable and the files are small,
-    we read a source block before attempting to create the target so that
-    we're ready to immediately write some data into it.
-"""
-
-import os
-import errno
-
-__all__ = ['link']
-
-def link(source, target):
-    """link(source, target) -> None
-
-    Attempt to hard link the source file to the target file name.
-    On OS/2, this creates a complete copy of the source file.
-    """
-
-    s = os.open(source, os.O_RDONLY | os.O_BINARY)
-    if os.isatty(s):
-        raise OSError(errno.EXDEV, 'Cross-device link')
-    data = os.read(s, 1024)
-
-    try:
-        t = os.open(target, os.O_WRONLY | os.O_BINARY | os.O_CREAT | os.O_EXCL)
-    except OSError:
-        os.close(s)
-        raise
-
-    try:
-        while data:
-            os.write(t, data)
-            data = os.read(s, 1024)
-    except OSError:
-        os.close(s)
-        os.close(t)
-        os.unlink(target)
-        raise
-
-    os.close(s)
-    os.close(t)
-
-if __name__ == '__main__':
-    import sys
-    try:
-        link(sys.argv[1], sys.argv[2])
-    except IndexError:
-        print('Usage: emx_link <source> <target>')
-    except OSError:
-        print('emx_link: %s' % str(sys.exc_info()[1]))
diff --git a/Lib/plat-os2emx/grp.py b/Lib/plat-os2emx/grp.py
deleted file mode 100644
index ee63ef8..0000000
--- a/Lib/plat-os2emx/grp.py
+++ /dev/null
@@ -1,182 +0,0 @@
-# this module is an OS/2 oriented replacement for the grp standard
-# extension module.
-
-# written by Andrew MacIntyre, April 2001.
-# updated July 2003, adding field accessor support
-
-# note that this implementation checks whether ":" or ";" as used as
-# the field separator character.
-
-"""Replacement for grp standard extension module, intended for use on
-OS/2 and similar systems which don't normally have an /etc/group file.
-
-The standard Unix group database is an ASCII text file with 4 fields per
-record (line), separated by a colon:
-  - group name (string)
-  - group password (optional encrypted string)
-  - group id (integer)
-  - group members (comma delimited list of userids, with no spaces)
-
-Note that members are only included in the group file for groups that
-aren't their primary groups.
-(see the section 8.2 of the Python Library Reference)
-
-This implementation differs from the standard Unix implementation by
-allowing use of the platform's native path separator character - ';' on OS/2,
-DOS and MS-Windows - as the field separator in addition to the Unix
-standard ":".
-
-The module looks for the group database at the following locations
-(in order first to last):
-  - ${ETC_GROUP}              (or %ETC_GROUP%)
-  - ${ETC}/group              (or %ETC%/group)
-  - ${PYTHONHOME}/Etc/group   (or %PYTHONHOME%/Etc/group)
-
-Classes
--------
-
-None
-
-Functions
----------
-
-getgrgid(gid) -  return the record for group-id gid as a 4-tuple
-
-getgrnam(name) - return the record for group 'name' as a 4-tuple
-
-getgrall() -     return a list of 4-tuples, each tuple being one record
-                 (NOTE: the order is arbitrary)
-
-Attributes
-----------
-
-group_file -     the path of the group database file
-
-"""
-
-import os
-
-# try and find the group file
-__group_path = []
-if 'ETC_GROUP' in os.environ:
-    __group_path.append(os.environ['ETC_GROUP'])
-if 'ETC' in os.environ:
-    __group_path.append('%s/group' % os.environ['ETC'])
-if 'PYTHONHOME' in os.environ:
-    __group_path.append('%s/Etc/group' % os.environ['PYTHONHOME'])
-
-group_file = None
-for __i in __group_path:
-    try:
-        __f = open(__i, 'r')
-        __f.close()
-        group_file = __i
-        break
-    except:
-        pass
-
-# decide what field separator we can try to use - Unix standard, with
-# the platform's path separator as an option.  No special field conversion
-# handlers are required for the group file.
-__field_sep = [':']
-if os.pathsep:
-    if os.pathsep != ':':
-        __field_sep.append(os.pathsep)
-
-# helper routine to identify which separator character is in use
-def __get_field_sep(record):
-    fs = None
-    for c in __field_sep:
-        # there should be 3 delimiter characters (for 4 fields)
-        if record.count(c) == 3:
-            fs = c
-            break
-    if fs:
-        return fs
-    else:
-        raise KeyError('>> group database fields not delimited <<')
-
-# class to match the new record field name accessors.
-# the resulting object is intended to behave like a read-only tuple,
-# with each member also accessible by a field name.
-class Group:
-    def __init__(self, name, passwd, gid, mem):
-        self.__dict__['gr_name'] = name
-        self.__dict__['gr_passwd'] = passwd
-        self.__dict__['gr_gid'] = gid
-        self.__dict__['gr_mem'] = mem
-        self.__dict__['_record'] = (self.gr_name, self.gr_passwd,
-                                    self.gr_gid, self.gr_mem)
-
-    def __len__(self):
-        return 4
-
-    def __getitem__(self, key):
-        return self._record[key]
-
-    def __setattr__(self, name, value):
-        raise AttributeError('attribute read-only: %s' % name)
-
-    def __repr__(self):
-        return str(self._record)
-
-    def __cmp__(self, other):
-        this = str(self._record)
-        if this == other:
-            return 0
-        elif this < other:
-            return -1
-        else:
-            return 1
-
-
-# read the whole file, parsing each entry into tuple form
-# with dictionaries to speed recall by GID or group name
-def __read_group_file():
-    if group_file:
-        group = open(group_file, 'r')
-    else:
-        raise KeyError('>> no group database <<')
-    gidx = {}
-    namx = {}
-    sep = None
-    while 1:
-        entry = group.readline().strip()
-        if len(entry) > 3:
-            if sep is None:
-                sep = __get_field_sep(entry)
-            fields = entry.split(sep)
-            fields[2] = int(fields[2])
-            fields[3] = [f.strip() for f in fields[3].split(',')]
-            record = Group(*fields)
-            if fields[2] not in gidx:
-                gidx[fields[2]] = record
-            if fields[0] not in namx:
-                namx[fields[0]] = record
-        elif len(entry) > 0:
-            pass                         # skip empty or malformed records
-        else:
-            break
-    group.close()
-    if len(gidx) == 0:
-        raise KeyError
-    return (gidx, namx)
-
-# return the group database entry by GID
-def getgrgid(gid):
-    g, n = __read_group_file()
-    return g[gid]
-
-# return the group database entry by group name
-def getgrnam(name):
-    g, n = __read_group_file()
-    return n[name]
-
-# return all the group database entries
-def getgrall():
-    g, n = __read_group_file()
-    return g.values()
-
-# test harness
-if __name__ == '__main__':
-    getgrall()
diff --git a/Lib/plat-os2emx/pwd.py b/Lib/plat-os2emx/pwd.py
deleted file mode 100644
index 2cb077f..0000000
--- a/Lib/plat-os2emx/pwd.py
+++ /dev/null
@@ -1,208 +0,0 @@
-# this module is an OS/2 oriented replacement for the pwd standard
-# extension module.
-
-# written by Andrew MacIntyre, April 2001.
-# updated July 2003, adding field accessor support
-
-# note that this implementation checks whether ":" or ";" as used as
-# the field separator character.  Path conversions are are applied when
-# the database uses ":" as the field separator character.
-
-"""Replacement for pwd standard extension module, intended for use on
-OS/2 and similar systems which don't normally have an /etc/passwd file.
-
-The standard Unix password database is an ASCII text file with 7 fields
-per record (line), separated by a colon:
-  - user name (string)
-  - password (encrypted string, or "*" or "")
-  - user id (integer)
-  - group id (integer)
-  - description (usually user's name)
-  - home directory (path to user's home directory)
-  - shell (path to the user's login shell)
-
-(see the section 8.1 of the Python Library Reference)
-
-This implementation differs from the standard Unix implementation by
-allowing use of the platform's native path separator character - ';' on OS/2,
-DOS and MS-Windows - as the field separator in addition to the Unix
-standard ":".  Additionally, when ":" is the separator path conversions
-are applied to deal with any munging of the drive letter reference.
-
-The module looks for the password database at the following locations
-(in order first to last):
-  - ${ETC_PASSWD}             (or %ETC_PASSWD%)
-  - ${ETC}/passwd             (or %ETC%/passwd)
-  - ${PYTHONHOME}/Etc/passwd  (or %PYTHONHOME%/Etc/passwd)
-
-Classes
--------
-
-None
-
-Functions
----------
-
-getpwuid(uid) -  return the record for user-id uid as a 7-tuple
-
-getpwnam(name) - return the record for user 'name' as a 7-tuple
-
-getpwall() -     return a list of 7-tuples, each tuple being one record
-                 (NOTE: the order is arbitrary)
-
-Attributes
-----------
-
-passwd_file -    the path of the password database file
-
-"""
-
-import os
-
-# try and find the passwd file
-__passwd_path = []
-if 'ETC_PASSWD' in os.environ:
-    __passwd_path.append(os.environ['ETC_PASSWD'])
-if 'ETC' in os.environ:
-    __passwd_path.append('%s/passwd' % os.environ['ETC'])
-if 'PYTHONHOME' in os.environ:
-    __passwd_path.append('%s/Etc/passwd' % os.environ['PYTHONHOME'])
-
-passwd_file = None
-for __i in __passwd_path:
-    try:
-        __f = open(__i, 'r')
-        __f.close()
-        passwd_file = __i
-        break
-    except:
-        pass
-
-# path conversion handlers
-def __nullpathconv(path):
-    return path.replace(os.altsep, os.sep)
-
-def __unixpathconv(path):
-    # two known drive letter variations: "x;" and "$x"
-    if path[0] == '$':
-        conv = path[1] + ':' + path[2:]
-    elif path[1] == ';':
-        conv = path[0] + ':' + path[2:]
-    else:
-        conv = path
-    return conv.replace(os.altsep, os.sep)
-
-# decide what field separator we can try to use - Unix standard, with
-# the platform's path separator as an option.  No special field conversion
-# handler is required when using the platform's path separator as field
-# separator, but are required for the home directory and shell fields when
-# using the standard Unix (":") field separator.
-__field_sep = {':': __unixpathconv}
-if os.pathsep:
-    if os.pathsep != ':':
-        __field_sep[os.pathsep] = __nullpathconv
-
-# helper routine to identify which separator character is in use
-def __get_field_sep(record):
-    fs = None
-    for c in __field_sep.keys():
-        # there should be 6 delimiter characters (for 7 fields)
-        if record.count(c) == 6:
-            fs = c
-            break
-    if fs:
-        return fs
-    else:
-        raise KeyError('>> passwd database fields not delimited <<')
-
-# class to match the new record field name accessors.
-# the resulting object is intended to behave like a read-only tuple,
-# with each member also accessible by a field name.
-class Passwd:
-    def __init__(self, name, passwd, uid, gid, gecos, dir, shell):
-        self.__dict__['pw_name'] = name
-        self.__dict__['pw_passwd'] = passwd
-        self.__dict__['pw_uid'] = uid
-        self.__dict__['pw_gid'] = gid
-        self.__dict__['pw_gecos'] = gecos
-        self.__dict__['pw_dir'] = dir
-        self.__dict__['pw_shell'] = shell
-        self.__dict__['_record'] = (self.pw_name, self.pw_passwd,
-                                    self.pw_uid, self.pw_gid,
-                                    self.pw_gecos, self.pw_dir,
-                                    self.pw_shell)
-
-    def __len__(self):
-        return 7
-
-    def __getitem__(self, key):
-        return self._record[key]
-
-    def __setattr__(self, name, value):
-        raise AttributeError('attribute read-only: %s' % name)
-
-    def __repr__(self):
-        return str(self._record)
-
-    def __cmp__(self, other):
-        this = str(self._record)
-        if this == other:
-            return 0
-        elif this < other:
-            return -1
-        else:
-            return 1
-
-
-# read the whole file, parsing each entry into tuple form
-# with dictionaries to speed recall by UID or passwd name
-def __read_passwd_file():
-    if passwd_file:
-        passwd = open(passwd_file, 'r')
-    else:
-        raise KeyError('>> no password database <<')
-    uidx = {}
-    namx = {}
-    sep = None
-    while True:
-        entry = passwd.readline().strip()
-        if len(entry) > 6:
-            if sep is None:
-                sep = __get_field_sep(entry)
-            fields = entry.split(sep)
-            for i in (2, 3):
-                fields[i] = int(fields[i])
-            for i in (5, 6):
-                fields[i] = __field_sep[sep](fields[i])
-            record = Passwd(*fields)
-            if fields[2] not in uidx:
-                uidx[fields[2]] = record
-            if fields[0] not in namx:
-                namx[fields[0]] = record
-        elif len(entry) > 0:
-            pass                         # skip empty or malformed records
-        else:
-            break
-    passwd.close()
-    if len(uidx) == 0:
-        raise KeyError
-    return (uidx, namx)
-
-# return the passwd database entry by UID
-def getpwuid(uid):
-    u, n = __read_passwd_file()
-    return u[uid]
-
-# return the passwd database entry by passwd name
-def getpwnam(name):
-    u, n = __read_passwd_file()
-    return n[name]
-
-# return all the passwd database entries
-def getpwall():
-    u, n = __read_passwd_file()
-    return n.values()
-
-# test harness
-if __name__ == '__main__':
-    getpwall()
diff --git a/Lib/plat-os2emx/regen b/Lib/plat-os2emx/regen
deleted file mode 100755
index 3ecd2a8..0000000
--- a/Lib/plat-os2emx/regen
+++ /dev/null
@@ -1,7 +0,0 @@
-#! /bin/sh
-export INCLUDE=$C_INCLUDE_PATH
-set -v
-python.exe ../../Tools/scripts/h2py.py $C_INCLUDE_PATH/fcntl.h
-python.exe ../../Tools/scripts/h2py.py $C_INCLUDE_PATH/sys/socket.h
-python.exe ../../Tools/scripts/h2py.py -i '(u_long)' $C_INCLUDE_PATH/netinet/in.h
-#python.exe ../../Tools/scripts/h2py.py $C_INCLUDE_PATH/termios.h
diff --git a/Lib/platform.py b/Lib/platform.py
index 030ef2a..c4ffe95 100755
--- a/Lib/platform.py
+++ b/Lib/platform.py
@@ -122,7 +122,7 @@
 except AttributeError:
     # os.devnull was added in Python 2.4, so emulate it for earlier
     # Python versions
-    if sys.platform in ('dos','win32','win16','os2'):
+    if sys.platform in ('dos', 'win32', 'win16'):
         # Use the old CP/M NUL as device name
         DEV_NULL = 'NUL'
     else:
@@ -141,7 +141,7 @@
                           b'|'
                           br'(libc(_\w+)?\.so(?:\.(\d[0-9.]*))?)', re.ASCII)
 
-def libc_ver(executable=sys.executable,lib='',version='',
+def libc_ver(executable=sys.executable, lib='', version='',
 
              chunksize=16384):
 
@@ -163,12 +163,12 @@
         # here to work around problems with Cygwin not being
         # able to open symlinks for reading
         executable = os.path.realpath(executable)
-    f = open(executable,'rb')
+    f = open(executable, 'rb')
     binary = f.read(chunksize)
     pos = 0
     while 1:
         if b'libc' in binary or b'GLIBC' in binary:
-            m = _libc_search.search(binary,pos)
+            m = _libc_search.search(binary, pos)
         else:
             m = None
         if not m:
@@ -177,7 +177,7 @@
                 break
             pos = 0
             continue
-        libcinit,glibc,glibcversion,so,threads,soversion = [
+        libcinit, glibc, glibcversion, so, threads, soversion = [
             s.decode('latin1') if s is not None else s
             for s in m.groups()]
         if libcinit and not lib:
@@ -197,9 +197,9 @@
                     version = version + threads
         pos = m.end()
     f.close()
-    return lib,version
+    return lib, version
 
-def _dist_try_harder(distname,version,id):
+def _dist_try_harder(distname, version, id):
 
     """ Tries some special tricks to get the distribution
         information in case the default method fails.
@@ -214,7 +214,7 @@
         for line in open('/var/adm/inst-log/info'):
             tv = line.split()
             if len(tv) == 2:
-                tag,value = tv
+                tag, value = tv
             else:
                 continue
             if tag == 'MIN_DIST_VERSION':
@@ -222,7 +222,7 @@
             elif tag == 'DIST_IDENT':
                 values = value.split('-')
                 id = values[2]
-        return distname,version,id
+        return distname, version, id
 
     if os.path.exists('/etc/.installed'):
         # Caldera OpenLinux has some infos in that file (thanks to Colin Kong)
@@ -231,7 +231,7 @@
             if len(pkg) >= 2 and pkg[0] == 'OpenLinux':
                 # XXX does Caldera support non Intel platforms ? If yes,
                 #     where can we find the needed id ?
-                return 'OpenLinux',pkg[1],id
+                return 'OpenLinux', pkg[1], id
 
     if os.path.isdir('/usr/lib/setup'):
         # Check for slackware version tag file (thanks to Greg Andruk)
@@ -243,9 +243,9 @@
             verfiles.sort()
             distname = 'slackware'
             version = verfiles[-1][14:]
-            return distname,version,id
+            return distname, version, id
 
-    return distname,version,id
+    return distname, version, id
 
 _release_filename = re.compile(r'(\w+)[-_](release|version)', re.ASCII)
 _lsb_release_version = re.compile(r'(.+)'
@@ -314,25 +314,25 @@
         distribution read from the OS is returned. Otherwise the short
         name taken from supported_dists is used.
 
-        Returns a tuple (distname,version,id) which default to the
+        Returns a tuple (distname, version, id) which default to the
         args given as parameters.
 
     """
     try:
         etc = os.listdir(_UNIXCONFDIR)
-    except os.error:
+    except OSError:
         # Probably not a Unix system
-        return distname,version,id
+        return distname, version, id
     etc.sort()
     for file in etc:
         m = _release_filename.match(file)
         if m is not None:
-            _distname,dummy = m.groups()
+            _distname, dummy = m.groups()
             if _distname in supported_dists:
                 distname = _distname
                 break
     else:
-        return _dist_try_harder(distname,version,id)
+        return _dist_try_harder(distname, version, id)
 
     # Read the first line
     with open(os.path.join(_UNIXCONFDIR, file), 'r',
@@ -350,7 +350,7 @@
 
 # To maintain backwards compatibility:
 
-def dist(distname='',version='',id='',
+def dist(distname='', version='', id='',
 
          supported_dists=_supported_dists):
 
@@ -360,7 +360,7 @@
         /etc and then reverts to _dist_try_harder() in case no
         suitable files are found.
 
-        Returns a tuple (distname,version,id) which default to the
+        Returns a tuple (distname, version, id) which default to the
         args given as parameters.
 
     """
@@ -385,11 +385,11 @@
     if build:
         l.append(build)
     try:
-        ints = map(int,l)
+        ints = map(int, l)
     except ValueError:
         strings = l
     else:
-        strings = list(map(str,ints))
+        strings = list(map(str, ints))
     version = '.'.join(strings[:3])
     return version
 
@@ -408,46 +408,43 @@
 
 def _syscmd_ver(system='', release='', version='',
 
-               supported_platforms=('win32','win16','dos','os2')):
+               supported_platforms=('win32', 'win16', 'dos')):
 
     """ Tries to figure out the OS version used and returns
-        a tuple (system,release,version).
+        a tuple (system, release, version).
 
         It uses the "ver" shell command for this which is known
-        to exists on Windows, DOS and OS/2. XXX Others too ?
+        to exists on Windows, DOS. XXX Others too ?
 
         In case this fails, the given parameters are used as
         defaults.
 
     """
     if sys.platform not in supported_platforms:
-        return system,release,version
+        return system, release, version
 
     # Try some common cmd strings
-    for cmd in ('ver','command /c ver','cmd /c ver'):
+    for cmd in ('ver', 'command /c ver', 'cmd /c ver'):
         try:
             pipe = popen(cmd)
             info = pipe.read()
             if pipe.close():
-                raise os.error('command failed')
+                raise OSError('command failed')
             # XXX How can I suppress shell errors from being written
             #     to stderr ?
-        except os.error as why:
-            #print 'Command %s failed: %s' % (cmd,why)
-            continue
-        except IOError as why:
-            #print 'Command %s failed: %s' % (cmd,why)
+        except OSError as why:
+            #print 'Command %s failed: %s' % (cmd, why)
             continue
         else:
             break
     else:
-        return system,release,version
+        return system, release, version
 
     # Parse the output
     info = info.strip()
     m = _ver_output.match(info)
     if m is not None:
-        system,release,version = m.groups()
+        system, release, version = m.groups()
         # Strip trailing dots from version and release
         if release[-1] == '.':
             release = release[:-1]
@@ -456,9 +453,9 @@
         # Normalize the version and build strings (eliminating additional
         # zeros)
         version = _norm_version(version)
-    return system,release,version
+    return system, release, version
 
-def _win32_getvalue(key,name,default=''):
+def _win32_getvalue(key, name, default=''):
 
     """ Read a value for name from the registry key.
 
@@ -473,14 +470,14 @@
         import winreg
         RegQueryValueEx = winreg.QueryValueEx
     try:
-        return RegQueryValueEx(key,name)
+        return RegQueryValueEx(key, name)
     except:
         return default
 
-def win32_ver(release='',version='',csd='',ptype=''):
+def win32_ver(release='', version='', csd='', ptype=''):
 
     """ Get additional version information from the Windows Registry
-        and return a tuple (version,csd,ptype) referring to version
+        and return a tuple (version, csd, ptype) referring to version
         number, CSD level (service pack), and OS type (multi/single
         processor).
 
@@ -506,7 +503,6 @@
 
     # Import the needed APIs
     try:
-        import win32api
         from win32api import RegQueryValueEx, RegOpenKeyEx, \
              RegCloseKey, GetVersionEx
         from win32con import HKEY_LOCAL_MACHINE, VER_PLATFORM_WIN32_NT, \
@@ -517,7 +513,7 @@
             sys.getwindowsversion
         except AttributeError:
             # No emulation possible, so return the defaults...
-            return release,version,csd,ptype
+            return release, version, csd, ptype
         else:
             # Emulation using winreg (added in Python 2.0) and
             # sys.getwindowsversion() (added in Python 2.3)
@@ -535,8 +531,8 @@
 
     # Find out the registry key and some general version infos
     winver = GetVersionEx()
-    maj,min,buildno,plat,csd = winver
-    version = '%i.%i.%i' % (maj,min,buildno & 0xFFFF)
+    maj, min, buildno, plat, csd = winver
+    version = '%i.%i.%i' % (maj, min, buildno & 0xFFFF)
     if hasattr(winver, "service_pack"):
         if winver.service_pack != "":
             csd = 'SP%s' % winver.service_pack_major
@@ -586,7 +582,7 @@
                     # Discard any type that isn't REG_SZ
                     if type == REG_SZ and name.find("Server") != -1:
                         product_type = VER_NT_SERVER
-                except WindowsError:
+                except OSError:
                     # Use default of VER_NT_WORKSTATION
                     pass
 
@@ -611,8 +607,8 @@
     else:
         if not release:
             # E.g. Win3.1 with win32s
-            release = '%i.%i' % (maj,min)
-        return release,version,csd,ptype
+            release = '%i.%i' % (maj, min)
+        return release, version, csd, ptype
 
     # Open the registry key
     try:
@@ -620,7 +616,7 @@
         # Get a value to make sure the key exists...
         RegQueryValueEx(keyCurVer, 'SystemRoot')
     except:
-        return release,version,csd,ptype
+        return release, version, csd, ptype
 
     # Parse values
     #subversion = _win32_getvalue(keyCurVer,
@@ -630,73 +626,17 @@
     #   release = release + subversion # 95a, 95b, etc.
     build = _win32_getvalue(keyCurVer,
                             'CurrentBuildNumber',
-                            ('',1))[0]
+                            ('', 1))[0]
     ptype = _win32_getvalue(keyCurVer,
                            'CurrentType',
-                           (ptype,1))[0]
+                           (ptype, 1))[0]
 
     # Normalize version
-    version = _norm_version(version,build)
+    version = _norm_version(version, build)
 
     # Close key
     RegCloseKey(keyCurVer)
-    return release,version,csd,ptype
-
-def _mac_ver_lookup(selectors,default=None):
-
-    from _gestalt import gestalt
-    l = []
-    append = l.append
-    for selector in selectors:
-        try:
-            append(gestalt(selector))
-        except (RuntimeError, OSError):
-            append(default)
-    return l
-
-def _bcd2str(bcd):
-
-    return hex(bcd)[2:]
-
-def _mac_ver_gestalt():
-    """
-        Thanks to Mark R. Levinson for mailing documentation links and
-        code examples for this function. Documentation for the
-        gestalt() API is available online at:
-
-           http://www.rgaros.nl/gestalt/
-    """
-    # Check whether the version info module is available
-    try:
-        import _gestalt
-    except ImportError:
-        return None
-    # Get the infos
-    sysv, sysa = _mac_ver_lookup(('sysv','sysa'))
-    # Decode the infos
-    if sysv:
-        major = (sysv & 0xFF00) >> 8
-        minor = (sysv & 0x00F0) >> 4
-        patch = (sysv & 0x000F)
-
-        if (major, minor) >= (10, 4):
-            # the 'sysv' gestald cannot return patchlevels
-            # higher than 9. Apple introduced 3 new
-            # gestalt codes in 10.4 to deal with this
-            # issue (needed because patch levels can
-            # run higher than 9, such as 10.4.11)
-            major,minor,patch = _mac_ver_lookup(('sys1','sys2','sys3'))
-            release = '%i.%i.%i' %(major, minor, patch)
-        else:
-            release = '%s.%i.%i' % (_bcd2str(major),minor,patch)
-
-    if sysa:
-        machine = {0x1: '68k',
-                   0x2: 'PowerPC',
-                   0xa: 'i386'}.get(sysa,'')
-
-    versioninfo=('', '', '')
-    return release,versioninfo,machine
+    return release, version, csd, ptype
 
 def _mac_ver_xml():
     fn = '/System/Library/CoreServices/SystemVersion.plist'
@@ -708,18 +648,19 @@
     except ImportError:
         return None
 
-    pl = plistlib.readPlist(fn)
+    with open(fn, 'rb') as f:
+        pl = plistlib.load(f)
     release = pl['ProductVersion']
-    versioninfo=('', '', '')
+    versioninfo = ('', '', '')
     machine = os.uname().machine
     if machine in ('ppc', 'Power Macintosh'):
-        # for compatibility with the gestalt based code
+        # Canonical name
         machine = 'PowerPC'
 
-    return release,versioninfo,machine
+    return release, versioninfo, machine
 
 
-def mac_ver(release='',versioninfo=('','',''),machine=''):
+def mac_ver(release='', versioninfo=('', '', ''), machine=''):
 
     """ Get MacOS version information and return it as tuple (release,
         versioninfo, machine) with versioninfo being a tuple (version,
@@ -735,16 +676,10 @@
     if info is not None:
         return info
 
-    # If that doesn't work for some reason fall back to reading the
-    # information using gestalt calls.
-    info = _mac_ver_gestalt()
-    if info is not None:
-        return info
-
     # If that also doesn't work return the default values
-    return release,versioninfo,machine
+    return release, versioninfo, machine
 
-def _java_getprop(name,default):
+def _java_getprop(name, default):
 
     from java.lang import System
     try:
@@ -755,13 +690,13 @@
     except AttributeError:
         return default
 
-def java_ver(release='',vendor='',vminfo=('','',''),osinfo=('','','')):
+def java_ver(release='', vendor='', vminfo=('', '', ''), osinfo=('', '', '')):
 
     """ Version interface for Jython.
 
-        Returns a tuple (release,vendor,vminfo,osinfo) with vminfo being
-        a tuple (vm_name,vm_release,vm_vendor) and osinfo being a
-        tuple (os_name,os_version,os_arch).
+        Returns a tuple (release, vendor, vminfo, osinfo) with vminfo being
+        a tuple (vm_name, vm_release, vm_vendor) and osinfo being a
+        tuple (os_name, os_version, os_arch).
 
         Values which cannot be determined are set to the defaults
         given as parameters (which all default to '').
@@ -771,7 +706,7 @@
     try:
         import java.lang
     except ImportError:
-        return release,vendor,vminfo,osinfo
+        return release, vendor, vminfo, osinfo
 
     vendor = _java_getprop('java.vendor', vendor)
     release = _java_getprop('java.version', release)
@@ -790,9 +725,9 @@
 
 ### System name aliasing
 
-def system_alias(system,release,version):
+def system_alias(system, release, version):
 
-    """ Returns (system,release,version) aliased to common
+    """ Returns (system, release, version) aliased to common
         marketing names used for some systems.
 
         It also does some reordering of the information in some cases
@@ -802,13 +737,13 @@
     if system == 'Rhapsody':
         # Apple's BSD derivative
         # XXX How can we determine the marketing release number ?
-        return 'MacOS X Server',system+release,version
+        return 'MacOS X Server', system+release, version
 
     elif system == 'SunOS':
         # Sun's OS
         if release < '5':
             # These releases use the old name SunOS
-            return system,release,version
+            return system, release, version
         # Modify release (marketing release = SunOS release - 3)
         l = release.split('.')
         if l:
@@ -836,11 +771,11 @@
         else:
             version = '64bit'
 
-    elif system in ('win32','win16'):
+    elif system in ('win32', 'win16'):
         # In case one of the other tricks
         system = 'Windows'
 
-    return system,release,version
+    return system, release, version
 
 ### Various internal helpers
 
@@ -853,21 +788,21 @@
     platform = '-'.join(x.strip() for x in filter(len, args))
 
     # Cleanup some possible filename obstacles...
-    platform = platform.replace(' ','_')
-    platform = platform.replace('/','-')
-    platform = platform.replace('\\','-')
-    platform = platform.replace(':','-')
-    platform = platform.replace(';','-')
-    platform = platform.replace('"','-')
-    platform = platform.replace('(','-')
-    platform = platform.replace(')','-')
+    platform = platform.replace(' ', '_')
+    platform = platform.replace('/', '-')
+    platform = platform.replace('\\', '-')
+    platform = platform.replace(':', '-')
+    platform = platform.replace(';', '-')
+    platform = platform.replace('"', '-')
+    platform = platform.replace('(', '-')
+    platform = platform.replace(')', '-')
 
     # No need to report 'unknown' information...
-    platform = platform.replace('unknown','')
+    platform = platform.replace('unknown', '')
 
     # Fold '--'s and remove trailing '-'
     while 1:
-        cleaned = platform.replace('--','-')
+        cleaned = platform.replace('--', '-')
         if cleaned == platform:
             break
         platform = cleaned
@@ -887,7 +822,7 @@
         return default
     try:
         return socket.gethostname()
-    except socket.error:
+    except OSError:
         # Still not working...
         return default
 
@@ -899,19 +834,19 @@
     filepath = os.path.abspath(filepath)
     while os.path.islink(filepath):
         filepath = os.path.normpath(
-            os.path.join(os.path.dirname(filepath),os.readlink(filepath)))
+            os.path.join(os.path.dirname(filepath), os.readlink(filepath)))
     return filepath
 
-def _syscmd_uname(option,default=''):
+def _syscmd_uname(option, default=''):
 
     """ Interface to the system's uname command.
     """
-    if sys.platform in ('dos','win32','win16','os2'):
+    if sys.platform in ('dos', 'win32', 'win16'):
         # XXX Others too ?
         return default
     try:
         f = os.popen('uname %s 2> %s' % (option, DEV_NULL))
-    except (AttributeError,os.error):
+    except (AttributeError, OSError):
         return default
     output = f.read().strip()
     rc = f.close()
@@ -920,7 +855,7 @@
     else:
         return output
 
-def _syscmd_file(target,default=''):
+def _syscmd_file(target, default=''):
 
     """ Interface to the system's file command.
 
@@ -929,7 +864,7 @@
         default in case the command should fail.
 
     """
-    if sys.platform in ('dos','win32','win16','os2'):
+    if sys.platform in ('dos', 'win32', 'win16'):
         # XXX Others too ?
         return default
     target = _follow_symlinks(target)
@@ -937,7 +872,7 @@
         proc = subprocess.Popen(['file', target],
                 stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
 
-    except (AttributeError,os.error):
+    except (AttributeError, OSError):
         return default
     output = proc.communicate()[0].decode('latin-1')
     rc = proc.wait()
@@ -951,17 +886,17 @@
 # Default values for architecture; non-empty strings override the
 # defaults given as parameters
 _default_architecture = {
-    'win32': ('','WindowsPE'),
-    'win16': ('','Windows'),
-    'dos': ('','MSDOS'),
+    'win32': ('', 'WindowsPE'),
+    'win16': ('', 'Windows'),
+    'dos': ('', 'MSDOS'),
 }
 
-def architecture(executable=sys.executable,bits='',linkage=''):
+def architecture(executable=sys.executable, bits='', linkage=''):
 
     """ Queries the given executable (defaults to the Python interpreter
         binary) for various architecture information.
 
-        Returns a tuple (bits,linkage) which contains information about
+        Returns a tuple (bits, linkage) which contains information about
         the bit architecture and the linkage format used for the
         executable. Both values are returned as strings.
 
@@ -999,16 +934,16 @@
         # "file" command did not return anything; we'll try to provide
         # some sensible defaults then...
         if sys.platform in _default_architecture:
-            b,l = _default_architecture[sys.platform]
+            b, l = _default_architecture[sys.platform]
             if b:
                 bits = b
             if l:
                 linkage = l
-        return bits,linkage
+        return bits, linkage
 
     if 'executable' not in fileout:
         # Format not supported
-        return bits,linkage
+        return bits, linkage
 
     # Bits
     if '32-bit' in fileout:
@@ -1036,7 +971,7 @@
         # XXX the A.OUT format also falls under this class...
         pass
 
-    return bits,linkage
+    return bits, linkage
 
 ### Portable uname() interface
 
@@ -1048,7 +983,7 @@
 def uname():
 
     """ Fairly portable uname interface. Returns a tuple
-        of strings (system,node,release,version,machine,processor)
+        of strings (system, node, release, version, machine, processor)
         identifying the underlying platform.
 
         Note that unlike the os.uname function this also returns
@@ -1067,7 +1002,7 @@
 
     # Get some infos from the builtin os.uname API...
     try:
-        system,node,release,version,machine = os.uname()
+        system, node, release, version, machine = os.uname()
     except AttributeError:
         no_os_uname = 1
 
@@ -1085,7 +1020,7 @@
 
         # Try win32_ver() on win32 platforms
         if system == 'win32':
-            release,version,csd,ptype = win32_ver()
+            release, version, csd, ptype = win32_ver()
             if release and version:
                 use_syscmd_ver = 0
             # Try to use the PROCESSOR_* environment variables
@@ -1104,7 +1039,7 @@
         # Try the 'ver' system command available on some
         # platforms
         if use_syscmd_ver:
-            system,release,version = _syscmd_ver(system)
+            system, release, version = _syscmd_ver(system)
             # Normalize system to what win32_ver() normally returns
             # (_syscmd_ver() tends to return the vendor name as well)
             if system == 'Microsoft Windows':
@@ -1122,7 +1057,7 @@
 
         # In case we still don't know anything useful, we'll try to
         # help ourselves
-        if system in ('win32','win16'):
+        if system in ('win32', 'win16'):
             if not version:
                 if system == 'win32':
                     version = '32bit'
@@ -1131,7 +1066,7 @@
             system = 'Windows'
 
         elif system[:4] == 'java':
-            release,vendor,vminfo,osinfo = java_ver()
+            release, vendor, vminfo, osinfo = java_ver()
             system = 'Java'
             version = ', '.join(vminfo)
             if not version:
@@ -1149,14 +1084,14 @@
         except ImportError:
             pass
         else:
-            csid, cpu_number = vms_lib.getsyi('SYI$_CPU',0)
+            csid, cpu_number = vms_lib.getsyi('SYI$_CPU', 0)
             if (cpu_number >= 128):
                 processor = 'Alpha'
             else:
                 processor = 'VAX'
     if not processor:
         # Get processor information from the uname system command
-        processor = _syscmd_uname('-p','')
+        processor = _syscmd_uname('-p', '')
 
     #If any unknowns still exist, replace them with ''s, which are more portable
     if system == 'unknown':
@@ -1177,7 +1112,8 @@
         system = 'Windows'
         release = 'Vista'
 
-    _uname_cache = uname_result(system,node,release,version,machine,processor)
+    _uname_cache = uname_result(system, node, release, version,
+                                machine, processor)
     return _uname_cache
 
 ### Direct interfaces to some of the uname() return values
@@ -1474,57 +1410,58 @@
 
     # Get uname information and then apply platform specific cosmetics
     # to it...
-    system,node,release,version,machine,processor = uname()
+    system, node, release, version, machine, processor = uname()
     if machine == processor:
         processor = ''
     if aliased:
-        system,release,version = system_alias(system,release,version)
+        system, release, version = system_alias(system, release, version)
 
     if system == 'Windows':
         # MS platforms
-        rel,vers,csd,ptype = win32_ver(version)
+        rel, vers, csd, ptype = win32_ver(version)
         if terse:
-            platform = _platform(system,release)
+            platform = _platform(system, release)
         else:
-            platform = _platform(system,release,version,csd)
+            platform = _platform(system, release, version, csd)
 
     elif system in ('Linux',):
         # Linux based systems
-        distname,distversion,distid = dist('')
+        distname, distversion, distid = dist('')
         if distname and not terse:
-            platform = _platform(system,release,machine,processor,
+            platform = _platform(system, release, machine, processor,
                                  'with',
-                                 distname,distversion,distid)
+                                 distname, distversion, distid)
         else:
             # If the distribution name is unknown check for libc vs. glibc
-            libcname,libcversion = libc_ver(sys.executable)
-            platform = _platform(system,release,machine,processor,
+            libcname, libcversion = libc_ver(sys.executable)
+            platform = _platform(system, release, machine, processor,
                                  'with',
                                  libcname+libcversion)
     elif system == 'Java':
         # Java platforms
-        r,v,vminfo,(os_name,os_version,os_arch) = java_ver()
+        r, v, vminfo, (os_name, os_version, os_arch) = java_ver()
         if terse or not os_name:
-            platform = _platform(system,release,version)
+            platform = _platform(system, release, version)
         else:
-            platform = _platform(system,release,version,
+            platform = _platform(system, release, version,
                                  'on',
-                                 os_name,os_version,os_arch)
+                                 os_name, os_version, os_arch)
 
     elif system == 'MacOS':
         # MacOS platforms
         if terse:
-            platform = _platform(system,release)
+            platform = _platform(system, release)
         else:
-            platform = _platform(system,release,machine)
+            platform = _platform(system, release, machine)
 
     else:
         # Generic handler
         if terse:
-            platform = _platform(system,release)
+            platform = _platform(system, release)
         else:
-            bits,linkage = architecture(sys.executable)
-            platform = _platform(system,release,machine,processor,bits,linkage)
+            bits, linkage = architecture(sys.executable)
+            platform = _platform(system, release, machine,
+                                 processor, bits, linkage)
 
     _platform_cache[(aliased, terse)] = platform
     return platform
@@ -1535,5 +1472,5 @@
     # Default is to print the aliased verbose platform string
     terse = ('terse' in sys.argv or '--terse' in sys.argv)
     aliased = (not 'nonaliased' in sys.argv and not '--nonaliased' in sys.argv)
-    print(platform(aliased,terse))
+    print(platform(aliased, terse))
     sys.exit(0)
diff --git a/Lib/plistlib.py b/Lib/plistlib.py
index 2b0b634..b9946fd 100644
--- a/Lib/plistlib.py
+++ b/Lib/plistlib.py
@@ -4,25 +4,20 @@
 basic object types, like dictionaries, lists, numbers and strings.
 Usually the top level object is a dictionary.
 
-To write out a plist file, use the writePlist(rootObject, pathOrFile)
-function. 'rootObject' is the top level object, 'pathOrFile' is a
-filename or a (writable) file object.
+To write out a plist file, use the dump(value, file)
+function. 'value' is the top level object, 'file' is
+a (writable) file object.
 
-To parse a plist from a file, use the readPlist(pathOrFile) function,
-with a file name or a (readable) file object as the only argument. It
+To parse a plist from a file, use the load(file) function,
+with a (readable) file object as the only argument. It
 returns the top level object (again, usually a dictionary).
 
-To work with plist data in bytes objects, you can use readPlistFromBytes()
-and writePlistToBytes().
+To work with plist data in bytes objects, you can use loads()
+and dumps().
 
 Values can be strings, integers, floats, booleans, tuples, lists,
-dictionaries (but only with string keys), Data or datetime.datetime objects.
-String values (including dictionary keys) have to be unicode strings -- they
-will be written out as UTF-8.
-
-The <data> plist type is supported through the Data class. This is a
-thin wrapper around a Python bytes object. Use 'Data' if your strings
-contain control characters.
+dictionaries (but only with string keys), Data, bytes, bytearray, or
+datetime.datetime objects.
 
 Generate Plist example:
 
@@ -37,226 +32,48 @@
             aTrueValue = True,
             aFalseValue = False,
         ),
-        someData = Data(b"<binary gunk>"),
-        someMoreData = Data(b"<lots of binary gunk>" * 10),
+        someData = b"<binary gunk>",
+        someMoreData = b"<lots of binary gunk>" * 10,
         aDate = datetime.datetime.fromtimestamp(time.mktime(time.gmtime())),
     )
-    writePlist(pl, fileName)
+    with open(fileName, 'wb') as fp:
+        dump(pl, fp)
 
 Parse Plist example:
 
-    pl = readPlist(pathOrFile)
-    print pl["aKey"]
+    with open(fileName, 'rb') as fp:
+        pl = load(fp)
+    print(pl["aKey"])
 """
-
-
 __all__ = [
     "readPlist", "writePlist", "readPlistFromBytes", "writePlistToBytes",
-    "Plist", "Data", "Dict"
+    "Plist", "Data", "Dict", "FMT_XML", "FMT_BINARY",
+    "load", "dump", "loads", "dumps"
 ]
-# Note: the Plist and Dict classes have been deprecated.
 
 import binascii
+import codecs
+import contextlib
 import datetime
+import enum
 from io import BytesIO
+import itertools
+import os
 import re
+import struct
+from warnings import warn
+from xml.parsers.expat import ParserCreate
 
 
-def readPlist(pathOrFile):
-    """Read a .plist file. 'pathOrFile' may either be a file name or a
-    (readable) file object. Return the unpacked root object (which
-    usually is a dictionary).
-    """
-    didOpen = False
-    try:
-        if isinstance(pathOrFile, str):
-            pathOrFile = open(pathOrFile, 'rb')
-            didOpen = True
-        p = PlistParser()
-        rootObject = p.parse(pathOrFile)
-    finally:
-        if didOpen:
-            pathOrFile.close()
-    return rootObject
+PlistFormat = enum.Enum('PlistFormat', 'FMT_XML FMT_BINARY', module=__name__)
+globals().update(PlistFormat.__members__)
 
 
-def writePlist(rootObject, pathOrFile):
-    """Write 'rootObject' to a .plist file. 'pathOrFile' may either be a
-    file name or a (writable) file object.
-    """
-    didOpen = False
-    try:
-        if isinstance(pathOrFile, str):
-            pathOrFile = open(pathOrFile, 'wb')
-            didOpen = True
-        writer = PlistWriter(pathOrFile)
-        writer.writeln("<plist version=\"1.0\">")
-        writer.writeValue(rootObject)
-        writer.writeln("</plist>")
-    finally:
-        if didOpen:
-            pathOrFile.close()
-
-
-def readPlistFromBytes(data):
-    """Read a plist data from a bytes object. Return the root object.
-    """
-    return readPlist(BytesIO(data))
-
-
-def writePlistToBytes(rootObject):
-    """Return 'rootObject' as a plist-formatted bytes object.
-    """
-    f = BytesIO()
-    writePlist(rootObject, f)
-    return f.getvalue()
-
-
-class DumbXMLWriter:
-    def __init__(self, file, indentLevel=0, indent="\t"):
-        self.file = file
-        self.stack = []
-        self.indentLevel = indentLevel
-        self.indent = indent
-
-    def beginElement(self, element):
-        self.stack.append(element)
-        self.writeln("<%s>" % element)
-        self.indentLevel += 1
-
-    def endElement(self, element):
-        assert self.indentLevel > 0
-        assert self.stack.pop() == element
-        self.indentLevel -= 1
-        self.writeln("</%s>" % element)
-
-    def simpleElement(self, element, value=None):
-        if value is not None:
-            value = _escape(value)
-            self.writeln("<%s>%s</%s>" % (element, value, element))
-        else:
-            self.writeln("<%s/>" % element)
-
-    def writeln(self, line):
-        if line:
-            # plist has fixed encoding of utf-8
-            if isinstance(line, str):
-                line = line.encode('utf-8')
-            self.file.write(self.indentLevel * self.indent)
-            self.file.write(line)
-        self.file.write(b'\n')
-
-
-# Contents should conform to a subset of ISO 8601
-# (in particular, YYYY '-' MM '-' DD 'T' HH ':' MM ':' SS 'Z'.  Smaller units may be omitted with
-#  a loss of precision)
-_dateParser = re.compile(r"(?P<year>\d\d\d\d)(?:-(?P<month>\d\d)(?:-(?P<day>\d\d)(?:T(?P<hour>\d\d)(?::(?P<minute>\d\d)(?::(?P<second>\d\d))?)?)?)?)?Z", re.ASCII)
-
-def _dateFromString(s):
-    order = ('year', 'month', 'day', 'hour', 'minute', 'second')
-    gd = _dateParser.match(s).groupdict()
-    lst = []
-    for key in order:
-        val = gd[key]
-        if val is None:
-            break
-        lst.append(int(val))
-    return datetime.datetime(*lst)
-
-def _dateToString(d):
-    return '%04d-%02d-%02dT%02d:%02d:%02dZ' % (
-        d.year, d.month, d.day,
-        d.hour, d.minute, d.second
-    )
-
-
-# Regex to find any control chars, except for \t \n and \r
-_controlCharPat = re.compile(
-    r"[\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0b\x0c\x0e\x0f"
-    r"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f]")
-
-def _escape(text):
-    m = _controlCharPat.search(text)
-    if m is not None:
-        raise ValueError("strings can't contains control characters; "
-                         "use plistlib.Data instead")
-    text = text.replace("\r\n", "\n")       # convert DOS line endings
-    text = text.replace("\r", "\n")         # convert Mac line endings
-    text = text.replace("&", "&amp;")       # escape '&'
-    text = text.replace("<", "&lt;")        # escape '<'
-    text = text.replace(">", "&gt;")        # escape '>'
-    return text
-
-
-PLISTHEADER = b"""\
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-"""
-
-class PlistWriter(DumbXMLWriter):
-
-    def __init__(self, file, indentLevel=0, indent=b"\t", writeHeader=1):
-        if writeHeader:
-            file.write(PLISTHEADER)
-        DumbXMLWriter.__init__(self, file, indentLevel, indent)
-
-    def writeValue(self, value):
-        if isinstance(value, str):
-            self.simpleElement("string", value)
-        elif isinstance(value, bool):
-            # must switch for bool before int, as bool is a
-            # subclass of int...
-            if value:
-                self.simpleElement("true")
-            else:
-                self.simpleElement("false")
-        elif isinstance(value, int):
-            self.simpleElement("integer", "%d" % value)
-        elif isinstance(value, float):
-            self.simpleElement("real", repr(value))
-        elif isinstance(value, dict):
-            self.writeDict(value)
-        elif isinstance(value, Data):
-            self.writeData(value)
-        elif isinstance(value, datetime.datetime):
-            self.simpleElement("date", _dateToString(value))
-        elif isinstance(value, (tuple, list)):
-            self.writeArray(value)
-        else:
-            raise TypeError("unsupported type: %s" % type(value))
-
-    def writeData(self, data):
-        self.beginElement("data")
-        self.indentLevel -= 1
-        maxlinelength = max(16, 76 - len(self.indent.replace(b"\t", b" " * 8) *
-                                 self.indentLevel))
-        for line in data.asBase64(maxlinelength).split(b"\n"):
-            if line:
-                self.writeln(line)
-        self.indentLevel += 1
-        self.endElement("data")
-
-    def writeDict(self, d):
-        if d:
-            self.beginElement("dict")
-            items = sorted(d.items())
-            for key, value in items:
-                if not isinstance(key, str):
-                    raise TypeError("keys must be strings")
-                self.simpleElement("key", key)
-                self.writeValue(value)
-            self.endElement("dict")
-        else:
-            self.simpleElement("dict")
-
-    def writeArray(self, array):
-        if array:
-            self.beginElement("array")
-            for value in array:
-                self.writeValue(value)
-            self.endElement("array")
-        else:
-            self.simpleElement("array")
+#
+#
+# Deprecated functionality
+#
+#
 
 
 class _InternalDict(dict):
@@ -264,19 +81,18 @@
     # This class is needed while Dict is scheduled for deprecation:
     # we only need to warn when a *user* instantiates Dict or when
     # the "attribute notation for dict keys" is used.
+    __slots__ = ()
 
     def __getattr__(self, attr):
         try:
             value = self[attr]
         except KeyError:
             raise AttributeError(attr)
-        from warnings import warn
         warn("Attribute access from plist dicts is deprecated, use d[key] "
              "notation instead", DeprecationWarning, 2)
         return value
 
     def __setattr__(self, attr, value):
-        from warnings import warn
         warn("Attribute access from plist dicts is deprecated, use d[key] "
              "notation instead", DeprecationWarning, 2)
         self[attr] = value
@@ -286,56 +102,111 @@
             del self[attr]
         except KeyError:
             raise AttributeError(attr)
-        from warnings import warn
         warn("Attribute access from plist dicts is deprecated, use d[key] "
              "notation instead", DeprecationWarning, 2)
 
+
 class Dict(_InternalDict):
 
     def __init__(self, **kwargs):
-        from warnings import warn
         warn("The plistlib.Dict class is deprecated, use builtin dict instead",
              DeprecationWarning, 2)
         super().__init__(**kwargs)
 
 
-class Plist(_InternalDict):
+@contextlib.contextmanager
+def _maybe_open(pathOrFile, mode):
+    if isinstance(pathOrFile, str):
+        with open(pathOrFile, mode) as fp:
+            yield fp
 
-    """This class has been deprecated. Use readPlist() and writePlist()
+    else:
+        yield pathOrFile
+
+
+class Plist(_InternalDict):
+    """This class has been deprecated. Use dump() and load()
     functions instead, together with regular dict objects.
     """
 
     def __init__(self, **kwargs):
-        from warnings import warn
-        warn("The Plist class is deprecated, use the readPlist() and "
-             "writePlist() functions instead", DeprecationWarning, 2)
+        warn("The Plist class is deprecated, use the load() and "
+             "dump() functions instead", DeprecationWarning, 2)
         super().__init__(**kwargs)
 
+    @classmethod
     def fromFile(cls, pathOrFile):
-        """Deprecated. Use the readPlist() function instead."""
-        rootObject = readPlist(pathOrFile)
+        """Deprecated. Use the load() function instead."""
+        with _maybe_open(pathOrFile, 'rb') as fp:
+            value = load(fp)
         plist = cls()
-        plist.update(rootObject)
+        plist.update(value)
         return plist
-    fromFile = classmethod(fromFile)
 
     def write(self, pathOrFile):
-        """Deprecated. Use the writePlist() function instead."""
-        writePlist(self, pathOrFile)
+        """Deprecated. Use the dump() function instead."""
+        with _maybe_open(pathOrFile, 'wb') as fp:
+            dump(self, fp)
 
 
-def _encodeBase64(s, maxlinelength=76):
-    # copied from base64.encodebytes(), with added maxlinelength argument
-    maxbinsize = (maxlinelength//4)*3
-    pieces = []
-    for i in range(0, len(s), maxbinsize):
-        chunk = s[i : i + maxbinsize]
-        pieces.append(binascii.b2a_base64(chunk))
-    return b''.join(pieces)
+def readPlist(pathOrFile):
+    """
+    Read a .plist from a path or file. pathOrFile should either
+    be a file name, or a readable binary file object.
+
+    This function is deprecated, use load instead.
+    """
+    warn("The readPlist function is deprecated, use load() instead",
+        DeprecationWarning, 2)
+
+    with _maybe_open(pathOrFile, 'rb') as fp:
+        return load(fp, fmt=None, use_builtin_types=False,
+            dict_type=_InternalDict)
+
+def writePlist(value, pathOrFile):
+    """
+    Write 'value' to a .plist file. 'pathOrFile' may either be a
+    file name or a (writable) file object.
+
+    This function is deprecated, use dump instead.
+    """
+    warn("The writePlist function is deprecated, use dump() instead",
+        DeprecationWarning, 2)
+    with _maybe_open(pathOrFile, 'wb') as fp:
+        dump(value, fp, fmt=FMT_XML, sort_keys=True, skipkeys=False)
+
+
+def readPlistFromBytes(data):
+    """
+    Read a plist data from a bytes object. Return the root object.
+
+    This function is deprecated, use loads instead.
+    """
+    warn("The readPlistFromBytes function is deprecated, use loads() instead",
+        DeprecationWarning, 2)
+    return load(BytesIO(data), fmt=None, use_builtin_types=False,
+        dict_type=_InternalDict)
+
+
+def writePlistToBytes(value):
+    """
+    Return 'value' as a plist-formatted bytes object.
+
+    This function is deprecated, use dumps instead.
+    """
+    warn("The writePlistToBytes function is deprecated, use dumps() instead",
+        DeprecationWarning, 2)
+    f = BytesIO()
+    dump(value, f, fmt=FMT_XML, sort_keys=True, skipkeys=False)
+    return f.getvalue()
+
 
 class Data:
+    """
+    Wrapper for binary data.
 
-    """Wrapper for binary data."""
+    This class is deprecated, use a bytes object instead.
+    """
 
     def __init__(self, data):
         if not isinstance(data, bytes):
@@ -346,10 +217,10 @@
     def fromBase64(cls, data):
         # base64.decodebytes just calls binascii.a2b_base64;
         # it seems overkill to use both base64 and binascii.
-        return cls(binascii.a2b_base64(data))
+        return cls(_decode_base64(data))
 
     def asBase64(self, maxlinelength=76):
-        return _encodeBase64(self.data, maxlinelength)
+        return _encode_base64(self.data, maxlinelength)
 
     def __eq__(self, other):
         if isinstance(other, self.__class__):
@@ -362,43 +233,119 @@
     def __repr__(self):
         return "%s(%s)" % (self.__class__.__name__, repr(self.data))
 
-class PlistParser:
+#
+#
+# End of deprecated functionality
+#
+#
 
-    def __init__(self):
+
+#
+# XML support
+#
+
+
+# XML 'header'
+PLISTHEADER = b"""\
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+"""
+
+
+# Regex to find any control chars, except for \t \n and \r
+_controlCharPat = re.compile(
+    r"[\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0b\x0c\x0e\x0f"
+    r"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f]")
+
+def _encode_base64(s, maxlinelength=76):
+    # copied from base64.encodebytes(), with added maxlinelength argument
+    maxbinsize = (maxlinelength//4)*3
+    pieces = []
+    for i in range(0, len(s), maxbinsize):
+        chunk = s[i : i + maxbinsize]
+        pieces.append(binascii.b2a_base64(chunk))
+    return b''.join(pieces)
+
+def _decode_base64(s):
+    if isinstance(s, str):
+        return binascii.a2b_base64(s.encode("utf-8"))
+
+    else:
+        return binascii.a2b_base64(s)
+
+# Contents should conform to a subset of ISO 8601
+# (in particular, YYYY '-' MM '-' DD 'T' HH ':' MM ':' SS 'Z'.  Smaller units
+# may be omitted with #  a loss of precision)
+_dateParser = re.compile(r"(?P<year>\d\d\d\d)(?:-(?P<month>\d\d)(?:-(?P<day>\d\d)(?:T(?P<hour>\d\d)(?::(?P<minute>\d\d)(?::(?P<second>\d\d))?)?)?)?)?Z", re.ASCII)
+
+
+def _date_from_string(s):
+    order = ('year', 'month', 'day', 'hour', 'minute', 'second')
+    gd = _dateParser.match(s).groupdict()
+    lst = []
+    for key in order:
+        val = gd[key]
+        if val is None:
+            break
+        lst.append(int(val))
+    return datetime.datetime(*lst)
+
+
+def _date_to_string(d):
+    return '%04d-%02d-%02dT%02d:%02d:%02dZ' % (
+        d.year, d.month, d.day,
+        d.hour, d.minute, d.second
+    )
+
+def _escape(text):
+    m = _controlCharPat.search(text)
+    if m is not None:
+        raise ValueError("strings can't contains control characters; "
+                         "use bytes instead")
+    text = text.replace("\r\n", "\n")       # convert DOS line endings
+    text = text.replace("\r", "\n")         # convert Mac line endings
+    text = text.replace("&", "&amp;")       # escape '&'
+    text = text.replace("<", "&lt;")        # escape '<'
+    text = text.replace(">", "&gt;")        # escape '>'
+    return text
+
+class _PlistParser:
+    def __init__(self, use_builtin_types, dict_type):
         self.stack = []
-        self.currentKey = None
+        self.current_key = None
         self.root = None
+        self._use_builtin_types = use_builtin_types
+        self._dict_type = dict_type
 
     def parse(self, fileobj):
-        from xml.parsers.expat import ParserCreate
         self.parser = ParserCreate()
-        self.parser.StartElementHandler = self.handleBeginElement
-        self.parser.EndElementHandler = self.handleEndElement
-        self.parser.CharacterDataHandler = self.handleData
+        self.parser.StartElementHandler = self.handle_begin_element
+        self.parser.EndElementHandler = self.handle_end_element
+        self.parser.CharacterDataHandler = self.handle_data
         self.parser.ParseFile(fileobj)
         return self.root
 
-    def handleBeginElement(self, element, attrs):
+    def handle_begin_element(self, element, attrs):
         self.data = []
         handler = getattr(self, "begin_" + element, None)
         if handler is not None:
             handler(attrs)
 
-    def handleEndElement(self, element):
+    def handle_end_element(self, element):
         handler = getattr(self, "end_" + element, None)
         if handler is not None:
             handler()
 
-    def handleData(self, data):
+    def handle_data(self, data):
         self.data.append(data)
 
-    def addObject(self, value):
-        if self.currentKey is not None:
+    def add_object(self, value):
+        if self.current_key is not None:
             if not isinstance(self.stack[-1], type({})):
                 raise ValueError("unexpected element at line %d" %
                                  self.parser.CurrentLineNumber)
-            self.stack[-1][self.currentKey] = value
-            self.currentKey = None
+            self.stack[-1][self.current_key] = value
+            self.current_key = None
         elif not self.stack:
             # this is the root object
             self.root = value
@@ -408,7 +355,7 @@
                                  self.parser.CurrentLineNumber)
             self.stack[-1].append(value)
 
-    def getData(self):
+    def get_data(self):
         data = ''.join(self.data)
         self.data = []
         return data
@@ -416,39 +363,663 @@
     # element handlers
 
     def begin_dict(self, attrs):
-        d = _InternalDict()
-        self.addObject(d)
+        d = self._dict_type()
+        self.add_object(d)
         self.stack.append(d)
+
     def end_dict(self):
-        if self.currentKey:
+        if self.current_key:
             raise ValueError("missing value for key '%s' at line %d" %
-                             (self.currentKey,self.parser.CurrentLineNumber))
+                             (self.current_key,self.parser.CurrentLineNumber))
         self.stack.pop()
 
     def end_key(self):
-        if self.currentKey or not isinstance(self.stack[-1], type({})):
+        if self.current_key or not isinstance(self.stack[-1], type({})):
             raise ValueError("unexpected key at line %d" %
                              self.parser.CurrentLineNumber)
-        self.currentKey = self.getData()
+        self.current_key = self.get_data()
 
     def begin_array(self, attrs):
         a = []
-        self.addObject(a)
+        self.add_object(a)
         self.stack.append(a)
+
     def end_array(self):
         self.stack.pop()
 
     def end_true(self):
-        self.addObject(True)
+        self.add_object(True)
+
     def end_false(self):
-        self.addObject(False)
+        self.add_object(False)
+
     def end_integer(self):
-        self.addObject(int(self.getData()))
+        self.add_object(int(self.get_data()))
+
     def end_real(self):
-        self.addObject(float(self.getData()))
+        self.add_object(float(self.get_data()))
+
     def end_string(self):
-        self.addObject(self.getData())
+        self.add_object(self.get_data())
+
     def end_data(self):
-        self.addObject(Data.fromBase64(self.getData().encode("utf-8")))
+        if self._use_builtin_types:
+            self.add_object(_decode_base64(self.get_data()))
+
+        else:
+            self.add_object(Data.fromBase64(self.get_data()))
+
     def end_date(self):
-        self.addObject(_dateFromString(self.getData()))
+        self.add_object(_date_from_string(self.get_data()))
+
+
+class _DumbXMLWriter:
+    def __init__(self, file, indent_level=0, indent="\t"):
+        self.file = file
+        self.stack = []
+        self._indent_level = indent_level
+        self.indent = indent
+
+    def begin_element(self, element):
+        self.stack.append(element)
+        self.writeln("<%s>" % element)
+        self._indent_level += 1
+
+    def end_element(self, element):
+        assert self._indent_level > 0
+        assert self.stack.pop() == element
+        self._indent_level -= 1
+        self.writeln("</%s>" % element)
+
+    def simple_element(self, element, value=None):
+        if value is not None:
+            value = _escape(value)
+            self.writeln("<%s>%s</%s>" % (element, value, element))
+
+        else:
+            self.writeln("<%s/>" % element)
+
+    def writeln(self, line):
+        if line:
+            # plist has fixed encoding of utf-8
+
+            # XXX: is this test needed?
+            if isinstance(line, str):
+                line = line.encode('utf-8')
+            self.file.write(self._indent_level * self.indent)
+            self.file.write(line)
+        self.file.write(b'\n')
+
+
+class _PlistWriter(_DumbXMLWriter):
+    def __init__(
+            self, file, indent_level=0, indent=b"\t", writeHeader=1,
+            sort_keys=True, skipkeys=False):
+
+        if writeHeader:
+            file.write(PLISTHEADER)
+        _DumbXMLWriter.__init__(self, file, indent_level, indent)
+        self._sort_keys = sort_keys
+        self._skipkeys = skipkeys
+
+    def write(self, value):
+        self.writeln("<plist version=\"1.0\">")
+        self.write_value(value)
+        self.writeln("</plist>")
+
+    def write_value(self, value):
+        if isinstance(value, str):
+            self.simple_element("string", value)
+
+        elif value is True:
+            self.simple_element("true")
+
+        elif value is False:
+            self.simple_element("false")
+
+        elif isinstance(value, int):
+            if -1 << 63 <= value < 1 << 64:
+                self.simple_element("integer", "%d" % value)
+            else:
+                raise OverflowError(value)
+
+        elif isinstance(value, float):
+            self.simple_element("real", repr(value))
+
+        elif isinstance(value, dict):
+            self.write_dict(value)
+
+        elif isinstance(value, Data):
+            self.write_data(value)
+
+        elif isinstance(value, (bytes, bytearray)):
+            self.write_bytes(value)
+
+        elif isinstance(value, datetime.datetime):
+            self.simple_element("date", _date_to_string(value))
+
+        elif isinstance(value, (tuple, list)):
+            self.write_array(value)
+
+        else:
+            raise TypeError("unsupported type: %s" % type(value))
+
+    def write_data(self, data):
+        self.write_bytes(data.data)
+
+    def write_bytes(self, data):
+        self.begin_element("data")
+        self._indent_level -= 1
+        maxlinelength = max(
+            16,
+            76 - len(self.indent.replace(b"\t", b" " * 8) * self._indent_level))
+
+        for line in _encode_base64(data, maxlinelength).split(b"\n"):
+            if line:
+                self.writeln(line)
+        self._indent_level += 1
+        self.end_element("data")
+
+    def write_dict(self, d):
+        if d:
+            self.begin_element("dict")
+            if self._sort_keys:
+                items = sorted(d.items())
+            else:
+                items = d.items()
+
+            for key, value in items:
+                if not isinstance(key, str):
+                    if self._skipkeys:
+                        continue
+                    raise TypeError("keys must be strings")
+                self.simple_element("key", key)
+                self.write_value(value)
+            self.end_element("dict")
+
+        else:
+            self.simple_element("dict")
+
+    def write_array(self, array):
+        if array:
+            self.begin_element("array")
+            for value in array:
+                self.write_value(value)
+            self.end_element("array")
+
+        else:
+            self.simple_element("array")
+
+
+def _is_fmt_xml(header):
+    prefixes = (b'<?xml', b'<plist')
+
+    for pfx in prefixes:
+        if header.startswith(pfx):
+            return True
+
+    # Also check for alternative XML encodings, this is slightly
+    # overkill because the Apple tools (and plistlib) will not
+    # generate files with these encodings.
+    for bom, encoding in (
+                (codecs.BOM_UTF8, "utf-8"),
+                (codecs.BOM_UTF16_BE, "utf-16-be"),
+                (codecs.BOM_UTF16_LE, "utf-16-le"),
+                # expat does not support utf-32
+                #(codecs.BOM_UTF32_BE, "utf-32-be"),
+                #(codecs.BOM_UTF32_LE, "utf-32-le"),
+            ):
+        if not header.startswith(bom):
+            continue
+
+        for start in prefixes:
+            prefix = bom + start.decode('ascii').encode(encoding)
+            if header[:len(prefix)] == prefix:
+                return True
+
+    return False
+
+#
+# Binary Plist
+#
+
+
+class InvalidFileException (ValueError):
+    def __init__(self, message="Invalid file"):
+        ValueError.__init__(self, message)
+
+_BINARY_FORMAT = {1: 'B', 2: 'H', 4: 'L', 8: 'Q'}
+
+class _BinaryPlistParser:
+    """
+    Read or write a binary plist file, following the description of the binary
+    format.  Raise InvalidFileException in case of error, otherwise return the
+    root object.
+
+    see also: http://opensource.apple.com/source/CF/CF-744.18/CFBinaryPList.c
+    """
+    def __init__(self, use_builtin_types, dict_type):
+        self._use_builtin_types = use_builtin_types
+        self._dict_type = dict_type
+
+    def parse(self, fp):
+        try:
+            # The basic file format:
+            # HEADER
+            # object...
+            # refid->offset...
+            # TRAILER
+            self._fp = fp
+            self._fp.seek(-32, os.SEEK_END)
+            trailer = self._fp.read(32)
+            if len(trailer) != 32:
+                raise InvalidFileException()
+            (
+                offset_size, self._ref_size, num_objects, top_object,
+                offset_table_offset
+            ) = struct.unpack('>6xBBQQQ', trailer)
+            self._fp.seek(offset_table_offset)
+            self._object_offsets = self._read_ints(num_objects, offset_size)
+            return self._read_object(self._object_offsets[top_object])
+
+        except (OSError, IndexError, struct.error):
+            raise InvalidFileException()
+
+    def _get_size(self, tokenL):
+        """ return the size of the next object."""
+        if tokenL == 0xF:
+            m = self._fp.read(1)[0] & 0x3
+            s = 1 << m
+            f = '>' + _BINARY_FORMAT[s]
+            return struct.unpack(f, self._fp.read(s))[0]
+
+        return tokenL
+
+    def _read_ints(self, n, size):
+        data = self._fp.read(size * n)
+        if size in _BINARY_FORMAT:
+            return struct.unpack('>' + _BINARY_FORMAT[size] * n, data)
+        else:
+            return tuple(int.from_bytes(data[i: i + size], 'big')
+                         for i in range(0, size * n, size))
+
+    def _read_refs(self, n):
+        return self._read_ints(n, self._ref_size)
+
+    def _read_object(self, offset):
+        """
+        read the object at offset.
+
+        May recursively read sub-objects (content of an array/dict/set)
+        """
+        self._fp.seek(offset)
+        token = self._fp.read(1)[0]
+        tokenH, tokenL = token & 0xF0, token & 0x0F
+
+        if token == 0x00:
+            return None
+
+        elif token == 0x08:
+            return False
+
+        elif token == 0x09:
+            return True
+
+        # The referenced source code also mentions URL (0x0c, 0x0d) and
+        # UUID (0x0e), but neither can be generated using the Cocoa libraries.
+
+        elif token == 0x0f:
+            return b''
+
+        elif tokenH == 0x10:  # int
+            return int.from_bytes(self._fp.read(1 << tokenL),
+                                  'big', signed=tokenL >= 3)
+
+        elif token == 0x22: # real
+            return struct.unpack('>f', self._fp.read(4))[0]
+
+        elif token == 0x23: # real
+            return struct.unpack('>d', self._fp.read(8))[0]
+
+        elif token == 0x33:  # date
+            f = struct.unpack('>d', self._fp.read(8))[0]
+            # timestamp 0 of binary plists corresponds to 1/1/2001
+            # (year of Mac OS X 10.0), instead of 1/1/1970.
+            return datetime.datetime.utcfromtimestamp(f + (31 * 365 + 8) * 86400)
+
+        elif tokenH == 0x40:  # data
+            s = self._get_size(tokenL)
+            if self._use_builtin_types:
+                return self._fp.read(s)
+            else:
+                return Data(self._fp.read(s))
+
+        elif tokenH == 0x50:  # ascii string
+            s = self._get_size(tokenL)
+            result =  self._fp.read(s).decode('ascii')
+            return result
+
+        elif tokenH == 0x60:  # unicode string
+            s = self._get_size(tokenL)
+            return self._fp.read(s * 2).decode('utf-16be')
+
+        # tokenH == 0x80 is documented as 'UID' and appears to be used for
+        # keyed-archiving, not in plists.
+
+        elif tokenH == 0xA0:  # array
+            s = self._get_size(tokenL)
+            obj_refs = self._read_refs(s)
+            return [self._read_object(self._object_offsets[x])
+                for x in obj_refs]
+
+        # tokenH == 0xB0 is documented as 'ordset', but is not actually
+        # implemented in the Apple reference code.
+
+        # tokenH == 0xC0 is documented as 'set', but sets cannot be used in
+        # plists.
+
+        elif tokenH == 0xD0:  # dict
+            s = self._get_size(tokenL)
+            key_refs = self._read_refs(s)
+            obj_refs = self._read_refs(s)
+            result = self._dict_type()
+            for k, o in zip(key_refs, obj_refs):
+                result[self._read_object(self._object_offsets[k])
+                    ] = self._read_object(self._object_offsets[o])
+            return result
+
+        raise InvalidFileException()
+
+def _count_to_size(count):
+    if count < 1 << 8:
+        return 1
+
+    elif count < 1 << 16:
+        return 2
+
+    elif count << 1 << 32:
+        return 4
+
+    else:
+        return 8
+
+class _BinaryPlistWriter (object):
+    def __init__(self, fp, sort_keys, skipkeys):
+        self._fp = fp
+        self._sort_keys = sort_keys
+        self._skipkeys = skipkeys
+
+    def write(self, value):
+
+        # Flattened object list:
+        self._objlist = []
+
+        # Mappings from object->objectid
+        # First dict has (type(object), object) as the key,
+        # second dict is used when object is not hashable and
+        # has id(object) as the key.
+        self._objtable = {}
+        self._objidtable = {}
+
+        # Create list of all objects in the plist
+        self._flatten(value)
+
+        # Size of object references in serialized containers
+        # depends on the number of objects in the plist.
+        num_objects = len(self._objlist)
+        self._object_offsets = [0]*num_objects
+        self._ref_size = _count_to_size(num_objects)
+
+        self._ref_format = _BINARY_FORMAT[self._ref_size]
+
+        # Write file header
+        self._fp.write(b'bplist00')
+
+        # Write object list
+        for obj in self._objlist:
+            self._write_object(obj)
+
+        # Write refnum->object offset table
+        top_object = self._getrefnum(value)
+        offset_table_offset = self._fp.tell()
+        offset_size = _count_to_size(offset_table_offset)
+        offset_format = '>' + _BINARY_FORMAT[offset_size] * num_objects
+        self._fp.write(struct.pack(offset_format, *self._object_offsets))
+
+        # Write trailer
+        sort_version = 0
+        trailer = (
+            sort_version, offset_size, self._ref_size, num_objects,
+            top_object, offset_table_offset
+        )
+        self._fp.write(struct.pack('>5xBBBQQQ', *trailer))
+
+    def _flatten(self, value):
+        # First check if the object is in the object table, not used for
+        # containers to ensure that two subcontainers with the same contents
+        # will be serialized as distinct values.
+        if isinstance(value, (
+                str, int, float, datetime.datetime, bytes, bytearray)):
+            if (type(value), value) in self._objtable:
+                return
+
+        elif isinstance(value, Data):
+            if (type(value.data), value.data) in self._objtable:
+                return
+
+        # Add to objectreference map
+        refnum = len(self._objlist)
+        self._objlist.append(value)
+        try:
+            if isinstance(value, Data):
+                self._objtable[(type(value.data), value.data)] = refnum
+            else:
+                self._objtable[(type(value), value)] = refnum
+        except TypeError:
+            self._objidtable[id(value)] = refnum
+
+        # And finally recurse into containers
+        if isinstance(value, dict):
+            keys = []
+            values = []
+            items = value.items()
+            if self._sort_keys:
+                items = sorted(items)
+
+            for k, v in items:
+                if not isinstance(k, str):
+                    if self._skipkeys:
+                        continue
+                    raise TypeError("keys must be strings")
+                keys.append(k)
+                values.append(v)
+
+            for o in itertools.chain(keys, values):
+                self._flatten(o)
+
+        elif isinstance(value, (list, tuple)):
+            for o in value:
+                self._flatten(o)
+
+    def _getrefnum(self, value):
+        try:
+            if isinstance(value, Data):
+                return self._objtable[(type(value.data), value.data)]
+            else:
+                return self._objtable[(type(value), value)]
+        except TypeError:
+            return self._objidtable[id(value)]
+
+    def _write_size(self, token, size):
+        if size < 15:
+            self._fp.write(struct.pack('>B', token | size))
+
+        elif size < 1 << 8:
+            self._fp.write(struct.pack('>BBB', token | 0xF, 0x10, size))
+
+        elif size < 1 << 16:
+            self._fp.write(struct.pack('>BBH', token | 0xF, 0x11, size))
+
+        elif size < 1 << 32:
+            self._fp.write(struct.pack('>BBL', token | 0xF, 0x12, size))
+
+        else:
+            self._fp.write(struct.pack('>BBQ', token | 0xF, 0x13, size))
+
+    def _write_object(self, value):
+        ref = self._getrefnum(value)
+        self._object_offsets[ref] = self._fp.tell()
+        if value is None:
+            self._fp.write(b'\x00')
+
+        elif value is False:
+            self._fp.write(b'\x08')
+
+        elif value is True:
+            self._fp.write(b'\x09')
+
+        elif isinstance(value, int):
+            if value < 0:
+                try:
+                    self._fp.write(struct.pack('>Bq', 0x13, value))
+                except struct.error:
+                    raise OverflowError(value) from None
+            elif value < 1 << 8:
+                self._fp.write(struct.pack('>BB', 0x10, value))
+            elif value < 1 << 16:
+                self._fp.write(struct.pack('>BH', 0x11, value))
+            elif value < 1 << 32:
+                self._fp.write(struct.pack('>BL', 0x12, value))
+            elif value < 1 << 63:
+                self._fp.write(struct.pack('>BQ', 0x13, value))
+            elif value < 1 << 64:
+                self._fp.write(b'\x14' + value.to_bytes(16, 'big', signed=True))
+            else:
+                raise OverflowError(value)
+
+        elif isinstance(value, float):
+            self._fp.write(struct.pack('>Bd', 0x23, value))
+
+        elif isinstance(value, datetime.datetime):
+            f = (value - datetime.datetime(2001, 1, 1)).total_seconds()
+            self._fp.write(struct.pack('>Bd', 0x33, f))
+
+        elif isinstance(value, Data):
+            self._write_size(0x40, len(value.data))
+            self._fp.write(value.data)
+
+        elif isinstance(value, (bytes, bytearray)):
+            self._write_size(0x40, len(value))
+            self._fp.write(value)
+
+        elif isinstance(value, str):
+            try:
+                t = value.encode('ascii')
+                self._write_size(0x50, len(value))
+            except UnicodeEncodeError:
+                t = value.encode('utf-16be')
+                self._write_size(0x60, len(value))
+
+            self._fp.write(t)
+
+        elif isinstance(value, (list, tuple)):
+            refs = [self._getrefnum(o) for o in value]
+            s = len(refs)
+            self._write_size(0xA0, s)
+            self._fp.write(struct.pack('>' + self._ref_format * s, *refs))
+
+        elif isinstance(value, dict):
+            keyRefs, valRefs = [], []
+
+            if self._sort_keys:
+                rootItems = sorted(value.items())
+            else:
+                rootItems = value.items()
+
+            for k, v in rootItems:
+                if not isinstance(k, str):
+                    if self._skipkeys:
+                        continue
+                    raise TypeError("keys must be strings")
+                keyRefs.append(self._getrefnum(k))
+                valRefs.append(self._getrefnum(v))
+
+            s = len(keyRefs)
+            self._write_size(0xD0, s)
+            self._fp.write(struct.pack('>' + self._ref_format * s, *keyRefs))
+            self._fp.write(struct.pack('>' + self._ref_format * s, *valRefs))
+
+        else:
+            raise TypeError(value)
+
+
+def _is_fmt_binary(header):
+    return header[:8] == b'bplist00'
+
+
+#
+# Generic bits
+#
+
+_FORMATS={
+    FMT_XML: dict(
+        detect=_is_fmt_xml,
+        parser=_PlistParser,
+        writer=_PlistWriter,
+    ),
+    FMT_BINARY: dict(
+        detect=_is_fmt_binary,
+        parser=_BinaryPlistParser,
+        writer=_BinaryPlistWriter,
+    )
+}
+
+
+def load(fp, *, fmt=None, use_builtin_types=True, dict_type=dict):
+    """Read a .plist file. 'fp' should be (readable) file object.
+    Return the unpacked root object (which usually is a dictionary).
+    """
+    if fmt is None:
+        header = fp.read(32)
+        fp.seek(0)
+        for info in _FORMATS.values():
+            if info['detect'](header):
+                P = info['parser']
+                break
+
+        else:
+            raise InvalidFileException()
+
+    else:
+        P = _FORMATS[fmt]['parser']
+
+    p = P(use_builtin_types=use_builtin_types, dict_type=dict_type)
+    return p.parse(fp)
+
+
+def loads(value, *, fmt=None, use_builtin_types=True, dict_type=dict):
+    """Read a .plist file from a bytes object.
+    Return the unpacked root object (which usually is a dictionary).
+    """
+    fp = BytesIO(value)
+    return load(
+        fp, fmt=fmt, use_builtin_types=use_builtin_types, dict_type=dict_type)
+
+
+def dump(value, fp, *, fmt=FMT_XML, sort_keys=True, skipkeys=False):
+    """Write 'value' to a .plist file. 'fp' should be a (writable)
+    file object.
+    """
+    if fmt not in _FORMATS:
+        raise ValueError("Unsupported format: %r"%(fmt,))
+
+    writer = _FORMATS[fmt]["writer"](fp, sort_keys=sort_keys, skipkeys=skipkeys)
+    writer.write(value)
+
+
+def dumps(value, *, fmt=FMT_XML, skipkeys=False, sort_keys=True):
+    """Return a bytes object with the contents for a .plist file.
+    """
+    fp = BytesIO()
+    dump(value, fp, fmt=fmt, skipkeys=skipkeys, sort_keys=sort_keys)
+    return fp.getvalue()
diff --git a/Lib/poplib.py b/Lib/poplib.py
index 43f8305..8ad9cb7 100644
--- a/Lib/poplib.py
+++ b/Lib/poplib.py
@@ -13,7 +13,15 @@
 
 # Imports
 
-import re, socket
+import errno
+import re
+import socket
+
+try:
+    import ssl
+    HAVE_SSL = True
+except ImportError:
+    HAVE_SSL = False
 
 __all__ = ["POP3","error_proto"]
 
@@ -33,7 +41,7 @@
 CRLF = CR+LF
 
 # maximal line length when calling readline(). This is to prevent
-# reading arbitrary lenght lines. RFC 1939 limits POP3 line length to
+# reading arbitrary length lines. RFC 1939 limits POP3 line length to
 # 512 characters, including CRLF. We have selected 2048 just to be on
 # the safe side.
 _MAXLINE = 2048
@@ -61,6 +69,8 @@
             APOP name digest        apop(name, digest)
             TOP msg n               top(msg, n)
             UIDL [msg]              uidl(msg = None)
+            CAPA                    capa()
+            STLS                    stls()
 
     Raises one exception: 'error_proto'.
 
@@ -87,6 +97,7 @@
                  timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
         self.host = host
         self.port = port
+        self._tls_established = False
         self.sock = self._create_socket(timeout)
         self.file = self.sock.makefile('rb')
         self._debugging = 0
@@ -268,7 +279,14 @@
         if self.file is not None:
             self.file.close()
         if self.sock is not None:
-            self.sock.close()
+            try:
+                self.sock.shutdown(socket.SHUT_RDWR)
+            except OSError as e:
+                # The server might already have closed the connection
+                if e.errno != errno.ENOTCONN:
+                    raise
+            finally:
+                self.sock.close()
         self.file = self.sock = None
 
     #__del__ = quit
@@ -324,21 +342,71 @@
             return self._shortcmd('UIDL %s' % which)
         return self._longcmd('UIDL')
 
-try:
-    import ssl
-except ImportError:
-    pass
-else:
+
+    def capa(self):
+        """Return server capabilities (RFC 2449) as a dictionary
+        >>> c=poplib.POP3('localhost')
+        >>> c.capa()
+        {'IMPLEMENTATION': ['Cyrus', 'POP3', 'server', 'v2.2.12'],
+         'TOP': [], 'LOGIN-DELAY': ['0'], 'AUTH-RESP-CODE': [],
+         'EXPIRE': ['NEVER'], 'USER': [], 'STLS': [], 'PIPELINING': [],
+         'UIDL': [], 'RESP-CODES': []}
+        >>>
+
+        Really, according to RFC 2449, the cyrus folks should avoid
+        having the implementation split into multiple arguments...
+        """
+        def _parsecap(line):
+            lst = line.decode('ascii').split()
+            return lst[0], lst[1:]
+
+        caps = {}
+        try:
+            resp = self._longcmd('CAPA')
+            rawcaps = resp[1]
+            for capline in rawcaps:
+                capnm, capargs = _parsecap(capline)
+                caps[capnm] = capargs
+        except error_proto as _err:
+            raise error_proto('-ERR CAPA not supported by server')
+        return caps
+
+
+    def stls(self, context=None):
+        """Start a TLS session on the active connection as specified in RFC 2595.
+
+                context - a ssl.SSLContext
+        """
+        if not HAVE_SSL:
+            raise error_proto('-ERR TLS support missing')
+        if self._tls_established:
+            raise error_proto('-ERR TLS session already established')
+        caps = self.capa()
+        if not 'STLS' in caps:
+            raise error_proto('-ERR STLS not supported by server')
+        if context is None:
+            context = ssl._create_stdlib_context()
+        resp = self._shortcmd('STLS')
+        self.sock = context.wrap_socket(self.sock,
+                                        server_hostname=self.host)
+        self.file = self.sock.makefile('rb')
+        self._tls_established = True
+        return resp
+
+
+if HAVE_SSL:
 
     class POP3_SSL(POP3):
         """POP3 client class over SSL connection
 
-        Instantiate with: POP3_SSL(hostname, port=995, keyfile=None, certfile=None)
+        Instantiate with: POP3_SSL(hostname, port=995, keyfile=None, certfile=None,
+                                   context=None)
 
                hostname - the hostname of the pop3 over ssl server
                port - port number
                keyfile - PEM formatted file that contains your private key
                certfile - PEM formatted certificate chain file
+               context - a ssl.SSLContext
 
         See the methods of the parent class POP3 for more documentation.
         """
@@ -353,17 +421,25 @@
                                  "exclusive")
             self.keyfile = keyfile
             self.certfile = certfile
+            if context is None:
+                context = ssl._create_stdlib_context(certfile=certfile,
+                                                     keyfile=keyfile)
             self.context = context
             POP3.__init__(self, host, port, timeout)
 
         def _create_socket(self, timeout):
             sock = POP3._create_socket(self, timeout)
-            if self.context is not None:
-                sock = self.context.wrap_socket(sock)
-            else:
-                sock = ssl.wrap_socket(sock, self.keyfile, self.certfile)
+            sock = self.context.wrap_socket(sock,
+                                            server_hostname=self.host)
             return sock
 
+        def stls(self, keyfile=None, certfile=None, context=None):
+            """The method unconditionally raises an exception since the
+            STLS command doesn't make any sense on an already established
+            SSL/TLS session.
+            """
+            raise error_proto('-ERR TLS session already established')
+
     __all__.append("POP3_SSL")
 
 if __name__ == "__main__":
diff --git a/Lib/posixpath.py b/Lib/posixpath.py
index fd63f97..0aa53fe 100644
--- a/Lib/posixpath.py
+++ b/Lib/posixpath.py
@@ -48,7 +48,6 @@
 
 def normcase(s):
     """Normalize case of pathname.  Has no effect under Posix"""
-    # TODO: on Mac OS X, this should really return s.lower().
     if not isinstance(s, (bytes, str)):
         raise TypeError("normcase() argument must be str or bytes, "
                         "not '{}'".format(s.__class__.__name__))
@@ -84,12 +83,10 @@
             else:
                 path += sep + b
     except TypeError:
-        valid_types = all(isinstance(s, (str, bytes, bytearray))
-                          for s in (a, ) + p)
-        if valid_types:
+        if all(isinstance(s, (str, bytes)) for s in (a,) + p):
             # Must have a mixture of text and binary data
             raise TypeError("Can't mix strings and bytes in path "
-                            "components.") from None
+                            "components") from None
         raise
     return path
 
@@ -162,7 +159,7 @@
     """Test whether a path is a symbolic link"""
     try:
         st = os.lstat(path)
-    except (os.error, AttributeError):
+    except (OSError, AttributeError):
         return False
     return stat.S_ISLNK(st.st_mode)
 
@@ -172,56 +169,35 @@
     """Test whether a path exists.  Returns True for broken symbolic links"""
     try:
         os.lstat(path)
-    except os.error:
+    except OSError:
         return False
     return True
 
 
-# Are two filenames really pointing to the same file?
-
-def samefile(f1, f2):
-    """Test whether two pathnames reference the same actual file"""
-    s1 = os.stat(f1)
-    s2 = os.stat(f2)
-    return samestat(s1, s2)
-
-
-# Are two open files really referencing the same file?
-# (Not necessarily the same file descriptor!)
-
-def sameopenfile(fp1, fp2):
-    """Test whether two open file objects reference the same file"""
-    s1 = os.fstat(fp1)
-    s2 = os.fstat(fp2)
-    return samestat(s1, s2)
-
-
-# Are two stat buffers (obtained from stat, fstat or lstat)
-# describing the same file?
-
-def samestat(s1, s2):
-    """Test whether two stat buffers reference the same file"""
-    return s1.st_ino == s2.st_ino and \
-           s1.st_dev == s2.st_dev
-
-
 # Is a path a mount point?
 # (Does this work for all UNIXes?  Is it even guaranteed to work by Posix?)
 
 def ismount(path):
     """Test whether a path is a mount point"""
-    if islink(path):
-        # A symlink can never be a mount point
-        return False
     try:
         s1 = os.lstat(path)
-        if isinstance(path, bytes):
-            parent = join(path, b'..')
-        else:
-            parent = join(path, '..')
+    except OSError:
+        # It doesn't exist -- so not a mount point. :-)
+        return False
+    else:
+        # A symlink can never be a mount point
+        if stat.S_ISLNK(s1.st_mode):
+            return False
+
+    if isinstance(path, bytes):
+        parent = join(path, b'..')
+    else:
+        parent = join(path, '..')
+    try:
         s2 = os.lstat(parent)
-    except os.error:
-        return False # It doesn't exist -- so not a mount point :-)
+    except OSError:
+        return False
+
     dev1 = s1.st_dev
     dev2 = s2.st_dev
     if dev1 != dev2:
diff --git a/Lib/pprint.py b/Lib/pprint.py
index 22be0b4b..2cbffed 100644
--- a/Lib/pprint.py
+++ b/Lib/pprint.py
@@ -34,6 +34,7 @@
 
 """
 
+import re
 import sys as _sys
 from collections import OrderedDict as _OrderedDict
 from io import StringIO as _StringIO
@@ -41,22 +42,19 @@
 __all__ = ["pprint","pformat","isreadable","isrecursive","saferepr",
            "PrettyPrinter"]
 
-# cache these for faster access:
-_commajoin = ", ".join
-_id = id
-_len = len
-_type = type
 
-
-def pprint(object, stream=None, indent=1, width=80, depth=None):
+def pprint(object, stream=None, indent=1, width=80, depth=None, *,
+           compact=False):
     """Pretty-print a Python object to a stream [default is sys.stdout]."""
     printer = PrettyPrinter(
-        stream=stream, indent=indent, width=width, depth=depth)
+        stream=stream, indent=indent, width=width, depth=depth,
+        compact=compact)
     printer.pprint(object)
 
-def pformat(object, indent=1, width=80, depth=None):
+def pformat(object, indent=1, width=80, depth=None, *, compact=False):
     """Format a Python object into a pretty-printed representation."""
-    return PrettyPrinter(indent=indent, width=width, depth=depth).pformat(object)
+    return PrettyPrinter(indent=indent, width=width, depth=depth,
+                         compact=compact).pformat(object)
 
 def saferepr(object):
     """Version of repr() which can handle recursive data structures."""
@@ -101,7 +99,8 @@
     return _safe_key(t[0]), _safe_key(t[1])
 
 class PrettyPrinter:
-    def __init__(self, indent=1, width=80, depth=None, stream=None):
+    def __init__(self, indent=1, width=80, depth=None, stream=None, *,
+                 compact=False):
         """Handle pretty printing operations onto a stream using a set of
         configured parameters.
 
@@ -118,6 +117,9 @@
             The desired output stream.  If omitted (or false), the standard
             output stream available at construction will be used.
 
+        compact
+            If true, several items will be combined in one line.
+
         """
         indent = int(indent)
         width = int(width)
@@ -131,6 +133,7 @@
             self._stream = stream
         else:
             self._stream = _sys.stdout
+        self._compact = bool(compact)
 
     def pprint(self, object):
         self._format(object, self._stream, 0, 0, {}, 0)
@@ -150,28 +153,25 @@
 
     def _format(self, object, stream, indent, allowance, context, level):
         level = level + 1
-        objid = _id(object)
+        objid = id(object)
         if objid in context:
             stream.write(_recursion(object))
             self._recursive = True
             self._readable = False
             return
         rep = self._repr(object, context, level - 1)
-        typ = _type(object)
-        sepLines = _len(rep) > (self._width - 1 - indent - allowance)
+        typ = type(object)
+        max_width = self._width - 1 - indent - allowance
+        sepLines = len(rep) > max_width
         write = stream.write
 
-        if self._depth and level > self._depth:
-            write(rep)
-            return
-
         if sepLines:
             r = getattr(typ, "__repr__", None)
             if issubclass(typ, dict):
                 write('{')
                 if self._indent_per_level > 1:
                     write((self._indent_per_level - 1) * ' ')
-                length = _len(object)
+                length = len(object)
                 if length:
                     context[objid] = 1
                     indent = indent + self._indent_per_level
@@ -183,13 +183,13 @@
                     rep = self._repr(key, context, level)
                     write(rep)
                     write(': ')
-                    self._format(ent, stream, indent + _len(rep) + 2,
+                    self._format(ent, stream, indent + len(rep) + 2,
                                   allowance + 1, context, level)
                     if length > 1:
                         for key, ent in items[1:]:
                             rep = self._repr(key, context, level)
                             write(',\n%s%s: ' % (' '*indent, rep))
-                            self._format(ent, stream, indent + _len(rep) + 2,
+                            self._format(ent, stream, indent + len(rep) + 2,
                                           allowance + 1, context, level)
                     indent = indent - self._indent_per_level
                     del context[objid]
@@ -201,7 +201,7 @@
                 (issubclass(typ, set) and r is set.__repr__) or
                 (issubclass(typ, frozenset) and r is frozenset.__repr__)
                ):
-                length = _len(object)
+                length = len(object)
                 if issubclass(typ, list):
                     write('[')
                     endchar = ']'
@@ -225,23 +225,77 @@
                     write((self._indent_per_level - 1) * ' ')
                 if length:
                     context[objid] = 1
-                    indent = indent + self._indent_per_level
-                    self._format(object[0], stream, indent, allowance + 1,
-                                 context, level)
-                    if length > 1:
-                        for ent in object[1:]:
-                            write(',\n' + ' '*indent)
-                            self._format(ent, stream, indent,
-                                          allowance + 1, context, level)
-                    indent = indent - self._indent_per_level
+                    self._format_items(object, stream,
+                                       indent + self._indent_per_level,
+                                       allowance + 1, context, level)
                     del context[objid]
                 if issubclass(typ, tuple) and length == 1:
                     write(',')
                 write(endchar)
                 return
 
+            if issubclass(typ, str) and len(object) > 0 and r is str.__repr__:
+                chunks = []
+                lines = object.splitlines(True)
+                if level == 1:
+                    indent += 1
+                    max_width -= 2
+                for i, line in enumerate(lines):
+                    rep = repr(line)
+                    if len(rep) <= max_width:
+                        chunks.append(rep)
+                    else:
+                        # A list of alternating (non-space, space) strings
+                        parts = re.split(r'(\s+)', line) + ['']
+                        current = ''
+                        for i in range(0, len(parts), 2):
+                            part = parts[i] + parts[i+1]
+                            candidate = current + part
+                            if len(repr(candidate)) > max_width:
+                                if current:
+                                    chunks.append(repr(current))
+                                current = part
+                            else:
+                                current = candidate
+                        if current:
+                            chunks.append(repr(current))
+                if len(chunks) == 1:
+                    write(rep)
+                    return
+                if level == 1:
+                    write('(')
+                for i, rep in enumerate(chunks):
+                    if i > 0:
+                        write('\n' + ' '*indent)
+                    write(rep)
+                if level == 1:
+                    write(')')
+                return
         write(rep)
 
+    def _format_items(self, items, stream, indent, allowance, context, level):
+        write = stream.write
+        delimnl = ',\n' + ' ' * indent
+        delim = ''
+        width = max_width = self._width - indent - allowance + 2
+        for ent in items:
+            if self._compact:
+                rep = self._repr(ent, context, level)
+                w = len(rep) + 2
+                if width < w:
+                    width = max_width
+                    if delim:
+                        delim = delimnl
+                if width >= w:
+                    width -= w
+                    write(delim)
+                    delim = ', '
+                    write(rep)
+                    continue
+            write(delim)
+            delim = delimnl
+            self._format(ent, stream, indent, allowance, context, level)
+
     def _repr(self, object, context, level):
         repr, readable, recursive = self.format(object, context.copy(),
                                                 self._depth, level)
@@ -262,7 +316,7 @@
 # Return triple (repr_string, isreadable, isrecursive).
 
 def _safe_repr(object, context, maxlevels, level):
-    typ = _type(object)
+    typ = type(object)
     if typ is str:
         if 'locale' not in _sys.modules:
             return repr(object), True, False
@@ -286,7 +340,7 @@
     if issubclass(typ, dict) and r is dict.__repr__:
         if not object:
             return "{}", True, False
-        objid = _id(object)
+        objid = id(object)
         if maxlevels and level >= maxlevels:
             return "{...}", False, objid in context
         if objid in context:
@@ -307,7 +361,7 @@
             if krecur or vrecur:
                 recursive = True
         del context[objid]
-        return "{%s}" % _commajoin(components), readable, recursive
+        return "{%s}" % ", ".join(components), readable, recursive
 
     if (issubclass(typ, list) and r is list.__repr__) or \
        (issubclass(typ, tuple) and r is tuple.__repr__):
@@ -315,13 +369,13 @@
             if not object:
                 return "[]", True, False
             format = "[%s]"
-        elif _len(object) == 1:
+        elif len(object) == 1:
             format = "(%s,)"
         else:
             if not object:
                 return "()", True, False
             format = "(%s)"
-        objid = _id(object)
+        objid = id(object)
         if maxlevels and level >= maxlevels:
             return format % "...", False, objid in context
         if objid in context:
@@ -340,7 +394,7 @@
             if orecur:
                 recursive = True
         del context[objid]
-        return format % _commajoin(components), readable, recursive
+        return format % ", ".join(components), readable, recursive
 
     rep = repr(object)
     return rep, (rep and not rep.startswith('<')), False
@@ -348,7 +402,7 @@
 
 def _recursion(object):
     return ("<Recursion on %s with id=%s>"
-            % (_type(object).__name__, _id(object)))
+            % (type(object).__name__, id(object)))
 
 
 def _perfcheck(object=None):
diff --git a/Lib/profile.py b/Lib/profile.py
index 743e77d..5d0e968 100755
--- a/Lib/profile.py
+++ b/Lib/profile.py
@@ -40,6 +40,40 @@
 #       return i_count
 #itimes = integer_timer # replace with C coded timer returning integers
 
+class _Utils:
+    """Support class for utility functions which are shared by
+    profile.py and cProfile.py modules.
+    Not supposed to be used directly.
+    """
+
+    def __init__(self, profiler):
+        self.profiler = profiler
+
+    def run(self, statement, filename, sort):
+        prof = self.profiler()
+        try:
+            prof.run(statement)
+        except SystemExit:
+            pass
+        finally:
+            self._show(prof, filename, sort)
+
+    def runctx(self, statement, globals, locals, filename, sort):
+        prof = self.profiler()
+        try:
+            prof.runctx(statement, globals, locals)
+        except SystemExit:
+            pass
+        finally:
+            self._show(prof, filename, sort)
+
+    def _show(self, prof, filename, sort):
+        if filename is not None:
+            prof.dump_stats(filename)
+        else:
+            prof.print_stats(sort)
+
+
 #**************************************************************************
 # The following are the static member functions for the profiler class
 # Note that an instance of Profile() is *not* needed to call them.
@@ -56,15 +90,7 @@
     standard name string (file/line/function-name) that is presented in
     each line.
     """
-    prof = Profile()
-    try:
-        prof = prof.run(statement)
-    except SystemExit:
-        pass
-    if filename is not None:
-        prof.dump_stats(filename)
-    else:
-        return prof.print_stats(sort)
+    return _Utils(Profile).run(statement, filename, sort)
 
 def runctx(statement, globals, locals, filename=None, sort=-1):
     """Run statement under profiler, supplying your own globals and locals,
@@ -72,16 +98,8 @@
 
     statement and filename have the same semantics as profile.run
     """
-    prof = Profile()
-    try:
-        prof = prof.runctx(statement, globals, locals)
-    except SystemExit:
-        pass
+    return _Utils(Profile).runctx(statement, globals, locals, filename, sort)
 
-    if filename is not None:
-        prof.dump_stats(filename)
-    else:
-        return prof.print_stats(sort)
 
 class Profile:
     """Profiler class.
@@ -373,10 +391,9 @@
                   print_stats()
 
     def dump_stats(self, file):
-        f = open(file, 'wb')
-        self.create_stats()
-        marshal.dump(self.stats, f)
-        f.close()
+        with open(file, 'wb') as f:
+            self.create_stats()
+            marshal.dump(self.stats, f)
 
     def create_stats(self):
         self.simulate_cmd_complete()
diff --git a/Lib/pstats.py b/Lib/pstats.py
index 6a77605..e1ec355 100644
--- a/Lib/pstats.py
+++ b/Lib/pstats.py
@@ -93,9 +93,8 @@
             self.stats = {}
             return
         elif isinstance(arg, str):
-            f = open(arg, 'rb')
-            self.stats = marshal.load(f)
-            f.close()
+            with open(arg, 'rb') as f:
+                self.stats = marshal.load(f)
             try:
                 file_stats = os.stat(arg)
                 arg = time.ctime(file_stats.st_mtime) + "    " + arg
@@ -149,11 +148,8 @@
 
     def dump_stats(self, filename):
         """Write the profile data to a file we know how to load back."""
-        f = open(filename, 'wb')
-        try:
+        with open(filename, 'wb') as f:
             marshal.dump(self.stats, f)
-        finally:
-            f.close()
 
     # list the tuple indices and directions for sorting,
     # along with some printable description
@@ -612,7 +608,7 @@
             if line:
                 try:
                     self.stats = Stats(line)
-                except IOError as err:
+                except OSError as err:
                     print(err.args[1], file=self.stream)
                     return
                 except Exception as err:
diff --git a/Lib/pty.py b/Lib/pty.py
index 3ccf619..e841f12 100644
--- a/Lib/pty.py
+++ b/Lib/pty.py
@@ -47,27 +47,16 @@
     return _open_terminal()
 
 def _open_terminal():
-    """Open pty master and return (master_fd, tty_name).
-    SGI and generic BSD version, for when openpty() fails."""
-    try:
-        import sgi
-    except ImportError:
-        pass
-    else:
-        try:
-            tty_name, master_fd = sgi._getpty(os.O_RDWR, 0o666, 0)
-        except IOError as msg:
-            raise os.error(msg)
-        return master_fd, tty_name
+    """Open pty master and return (master_fd, tty_name)."""
     for x in 'pqrstuvwxyzPQRST':
         for y in '0123456789abcdef':
             pty_name = '/dev/pty' + x + y
             try:
                 fd = os.open(pty_name, os.O_RDWR)
-            except os.error:
+            except OSError:
                 continue
             return (fd, '/dev/tty' + x + y)
-    raise os.error('out of pty devices')
+    raise OSError('out of pty devices')
 
 def slave_open(tty_name):
     """slave_open(tty_name) -> slave_fd
@@ -83,7 +72,7 @@
     try:
         ioctl(result, I_PUSH, "ptem")
         ioctl(result, I_PUSH, "ldterm")
-    except IOError:
+    except OSError:
         pass
     return result
 
@@ -173,8 +162,9 @@
         restore = 0
     try:
         _copy(master_fd, master_read, stdin_read)
-    except (IOError, OSError):
+    except OSError:
         if restore:
             tty.tcsetattr(STDIN_FILENO, tty.TCSAFLUSH, mode)
 
     os.close(master_fd)
+    return os.waitpid(pid, 0)[1]
diff --git a/Lib/py_compile.py b/Lib/py_compile.py
index 62d69ad..1277b93 100644
--- a/Lib/py_compile.py
+++ b/Lib/py_compile.py
@@ -3,17 +3,14 @@
 This module has intimate knowledge of the format of .pyc files.
 """
 
-import builtins
-import errno
-import imp
-import marshal
+import importlib._bootstrap
+import importlib.machinery
+import importlib.util
 import os
+import os.path
 import sys
-import tokenize
 import traceback
 
-MAGIC = imp.get_magic()
-
 __all__ = ["compile", "main", "PyCompileError"]
 
 
@@ -65,13 +62,6 @@
         return self.msg
 
 
-def wr_long(f, x):
-    """Internal; write a 32-bit int to a file in little-endian order."""
-    f.write(bytes([x         & 0xff,
-                   (x >> 8)  & 0xff,
-                   (x >> 16) & 0xff,
-                   (x >> 24) & 0xff]))
-
 def compile(file, cfile=None, dfile=None, doraise=False, optimize=-1):
     """Byte-compile one Python source file to Python bytecode.
 
@@ -107,18 +97,31 @@
     See compileall.py for a script/module that uses this module to
     byte-compile all installed files (or all files in selected
     directories).
+
+    Do note that FileExistsError is raised if cfile ends up pointing at a
+    non-regular file or symlink. Because the compilation uses a file renaming,
+    the resulting file would be regular and thus not the same type of file as
+    it was previously.
     """
-    with tokenize.open(file) as f:
-        try:
-            st = os.fstat(f.fileno())
-        except AttributeError:
-            st = os.stat(file)
-        timestamp = int(st.st_mtime)
-        size = st.st_size & 0xFFFFFFFF
-        codestring = f.read()
+    if cfile is None:
+        if optimize >= 0:
+            cfile = importlib.util.cache_from_source(file,
+                                                     debug_override=not optimize)
+        else:
+            cfile = importlib.util.cache_from_source(file)
+    if os.path.islink(cfile):
+        msg = ('{} is a symlink and will be changed into a regular file if '
+               'import writes a byte-compiled file to it')
+        raise FileExistsError(msg.format(cfile))
+    elif os.path.exists(cfile) and not os.path.isfile(cfile):
+        msg = ('{} is a non-regular file and will be changed into a regular '
+               'one if import writes a byte-compiled file to it')
+        raise FileExistsError(msg.format(cfile))
+    loader = importlib.machinery.SourceFileLoader('<py_compile>', file)
+    source_bytes = loader.get_data(file)
     try:
-        codeobject = builtins.compile(codestring, dfile or file, 'exec',
-                                      optimize=optimize)
+        code = loader.source_to_code(source_bytes, dfile or file,
+                                     _optimize=optimize)
     except Exception as err:
         py_exc = PyCompileError(err.__class__, err, dfile or file)
         if doraise:
@@ -126,28 +129,20 @@
         else:
             sys.stderr.write(py_exc.msg + '\n')
             return
-    if cfile is None:
-        if optimize >= 0:
-            cfile = imp.cache_from_source(file, debug_override=not optimize)
-        else:
-            cfile = imp.cache_from_source(file)
     try:
         dirname = os.path.dirname(cfile)
         if dirname:
             os.makedirs(dirname)
-    except OSError as error:
-        if error.errno != errno.EEXIST:
-            raise
-    with open(cfile, 'wb') as fc:
-        fc.write(b'\0\0\0\0')
-        wr_long(fc, timestamp)
-        wr_long(fc, size)
-        marshal.dump(codeobject, fc)
-        fc.flush()
-        fc.seek(0, 0)
-        fc.write(MAGIC)
+    except FileExistsError:
+        pass
+    source_stats = loader.path_stats(file)
+    bytecode = importlib._bootstrap._code_to_bytecode(
+            code, source_stats['mtime'], source_stats['size'])
+    mode = importlib._bootstrap._calc_mode(file)
+    importlib._bootstrap._write_atomic(cfile, bytecode, mode)
     return cfile
 
+
 def main(args=None):
     """Compile several source files.
 
@@ -173,7 +168,7 @@
             except PyCompileError as error:
                 rv = 1
                 sys.stderr.write("%s\n" % error.msg)
-            except IOError as error:
+            except OSError as error:
                 rv = 1
                 sys.stderr.write("%s\n" % error)
     else:
diff --git a/Lib/pyclbr.py b/Lib/pyclbr.py
index 9ec05ee..dd58ada 100644
--- a/Lib/pyclbr.py
+++ b/Lib/pyclbr.py
@@ -42,7 +42,7 @@
 import io
 import os
 import sys
-import importlib
+import importlib.util
 import tokenize
 from token import NAME, DEDENT, OP
 from operator import itemgetter
@@ -140,13 +140,14 @@
         search_path = path
     else:
         search_path = path + sys.path
-    loader = importlib.find_loader(fullmodule, search_path)
-    fname = loader.get_filename(fullmodule)
+    # XXX This will change once issue19944 lands.
+    spec = importlib.util._find_spec_from_path(fullmodule, search_path)
+    fname = spec.loader.get_filename(fullmodule)
     _modules[fullmodule] = dict
-    if loader.is_package(fullmodule):
+    if spec.loader.is_package(fullmodule):
         dict['__path__'] = [os.path.dirname(fname)]
     try:
-        source = loader.get_source(fullmodule)
+        source = spec.loader.get_source(fullmodule)
         if source is None:
             return dict
     except (AttributeError, ImportError):
diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index c9d8436..d53a1b4 100755
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -1,8 +1,9 @@
 #!/usr/bin/env python3
 """Generate Python documentation in HTML or text for interactive use.
 
-In the Python interpreter, do "from pydoc import help" to provide
-help.  Calling help(thing) on a Python object documents the object.
+At the Python interactive prompt, calling help(thing) on a Python object
+documents the object, and calling help() starts up an interactive
+help session.
 
 Or, at the shell command line outside of Python:
 
@@ -44,16 +45,16 @@
 """
 
 # Known bugs that can't be fixed here:
-#   - imp.load_module() cannot be prevented from clobbering existing
-#     loaded modules, so calling synopsis() on a binary module file
-#     changes the contents of any existing module with the same name.
+#   - synopsis() cannot be prevented from clobbering existing
+#     loaded modules.
 #   - If the __file__ attribute on a module is a relative path and
 #     the current directory is changed with os.chdir(), an incorrect
 #     path will be displayed.
 
 import builtins
-import imp
+import importlib._bootstrap
 import importlib.machinery
+import importlib.util
 import inspect
 import io
 import os
@@ -63,10 +64,11 @@
 import sys
 import time
 import tokenize
+import urllib.parse
 import warnings
 from collections import deque
 from reprlib import Repr
-from traceback import extract_tb, format_exception_only
+from traceback import format_exception_only
 
 
 # --------------------------------------------------------- common routines
@@ -137,6 +139,19 @@
             inspect.isbuiltin(obj) or
             inspect.ismethoddescriptor(obj))
 
+def _is_bound_method(fn):
+    """
+    Returns True if fn is a bound method, regardless of whether
+    fn was implemented in Python or in C.
+    """
+    if inspect.ismethod(fn):
+        return True
+    if inspect.isbuiltin(fn):
+        self = getattr(fn, '__self__', None)
+        return not (inspect.ismodule(self) or (self is None))
+    return False
+
+
 def allmethods(cl):
     methods = {}
     for key, value in inspect.getmembers(cl, _is_some_method):
@@ -167,8 +182,9 @@
 def visiblename(name, all=None, obj=None):
     """Decide whether to show documentation on a variable."""
     # Certain special names are redundant or internal.
+    # XXX Remove __initializing__?
     if name in {'__author__', '__builtins__', '__cached__', '__credits__',
-                '__date__', '__doc__', '__file__', '__initializing__',
+                '__date__', '__doc__', '__file__', '__spec__',
                 '__loader__', '__module__', '__name__', '__package__',
                 '__path__', '__qualname__', '__slots__', '__version__'}:
         return 0
@@ -224,34 +240,38 @@
     mtime = os.stat(filename).st_mtime
     lastupdate, result = cache.get(filename, (None, None))
     if lastupdate is None or lastupdate < mtime:
-        try:
-            file = tokenize.open(filename)
-        except IOError:
-            # module can't be opened, so skip it
-            return None
-        binary_suffixes = importlib.machinery.BYTECODE_SUFFIXES[:]
-        binary_suffixes += importlib.machinery.EXTENSION_SUFFIXES[:]
-        if any(filename.endswith(x) for x in binary_suffixes):
-            # binary modules have to be imported
-            file.close()
-            if any(filename.endswith(x) for x in
-                    importlib.machinery.BYTECODE_SUFFIXES):
-                loader = importlib.machinery.SourcelessFileLoader('__temp__',
-                                                                  filename)
-            else:
-                loader = importlib.machinery.ExtensionFileLoader('__temp__',
-                                                                 filename)
+        # Look for binary suffixes first, falling back to source.
+        if filename.endswith(tuple(importlib.machinery.BYTECODE_SUFFIXES)):
+            loader_cls = importlib.machinery.SourcelessFileLoader
+        elif filename.endswith(tuple(importlib.machinery.EXTENSION_SUFFIXES)):
+            loader_cls = importlib.machinery.ExtensionFileLoader
+        else:
+            loader_cls = None
+        # Now handle the choice.
+        if loader_cls is None:
+            # Must be a source file.
             try:
-                module = loader.load_module('__temp__')
+                file = tokenize.open(filename)
+            except OSError:
+                # module can't be opened, so skip it
+                return None
+            # text modules can be directly examined
+            with file:
+                result = source_synopsis(file)
+        else:
+            # Must be a binary module, which has to be imported.
+            loader = loader_cls('__temp__', filename)
+            # XXX We probably don't need to pass in the loader here.
+            spec = importlib.util.spec_from_file_location('__temp__', filename,
+                                                          loader=loader)
+            _spec = importlib._bootstrap._SpecMethods(spec)
+            try:
+                module = _spec.load()
             except:
                 return None
-            result = (module.__doc__ or '').splitlines()[0]
             del sys.modules['__temp__']
-        else:
-            # text modules can be directly examined
-            result = source_synopsis(file)
-            file.close()
-
+            result = (module.__doc__ or '').splitlines()[0]
+        # Cache the result.
         cache[filename] = (mtime, result)
     return result
 
@@ -267,20 +287,22 @@
 
 def importfile(path):
     """Import a Python source file or compiled file given its path."""
-    magic = imp.get_magic()
+    magic = importlib.util.MAGIC_NUMBER
     with open(path, 'rb') as file:
-        if file.read(len(magic)) == magic:
-            kind = imp.PY_COMPILED
-        else:
-            kind = imp.PY_SOURCE
-        file.seek(0)
-        filename = os.path.basename(path)
-        name, ext = os.path.splitext(filename)
-        try:
-            module = imp.load_module(name, file, path, (ext, 'r', kind))
-        except:
-            raise ErrorDuringImport(path, sys.exc_info())
-    return module
+        is_bytecode = magic == file.read(len(magic))
+    filename = os.path.basename(path)
+    name, ext = os.path.splitext(filename)
+    if is_bytecode:
+        loader = importlib._bootstrap.SourcelessFileLoader(name, path)
+    else:
+        loader = importlib._bootstrap.SourceFileLoader(name, path)
+    # XXX We probably don't need to pass in the loader here.
+    spec = importlib.util.spec_from_file_location(name, path, loader=loader)
+    _spec = importlib._bootstrap._SpecMethods(spec)
+    try:
+        return _spec.load()
+    except:
+        raise ErrorDuringImport(path, sys.exc_info())
 
 def safeimport(path, forceload=0, cache={}):
     """Import a module; handle errors; return None if the module isn't found.
@@ -574,10 +596,15 @@
             elif pep:
                 url = 'http://www.python.org/dev/peps/pep-%04d/' % int(pep)
                 results.append('<a href="%s">%s</a>' % (url, escape(all)))
+            elif selfdot:
+                # Create a link for methods like 'self.method(...)'
+                # and use <strong> for attributes like 'self.attr'
+                if text[end:end+1] == '(':
+                    results.append('self.' + self.namelink(name, methods))
+                else:
+                    results.append('self.<strong>%s</strong>' % name)
             elif text[end:end+1] == '(':
                 results.append(self.namelink(name, methods, funcs, classes))
-            elif selfdot:
-                results.append('self.<strong>%s</strong>' % name)
             else:
                 results.append(self.namelink(name, classes))
             here = end
@@ -622,10 +649,7 @@
         head = '<big><big><strong>%s</strong></big></big>' % linkedname
         try:
             path = inspect.getabsfile(object)
-            url = path
-            if sys.platform == 'win32':
-                import nturl2path
-                url = nturl2path.pathname2url(path)
+            url = urllib.parse.quote(path)
             filelink = self.filelink(url, path)
         except TypeError:
             filelink = '(built-in)'
@@ -891,7 +915,7 @@
         anchor = (cl and cl.__name__ or '') + '-' + name
         note = ''
         skipdocs = 0
-        if inspect.ismethod(object):
+        if _is_bound_method(object):
             imclass = object.__self__.__class__
             if cl:
                 if imclass is not cl:
@@ -902,7 +926,6 @@
                         object.__self__.__class__, mod)
                 else:
                     note = ' unbound %s method' % self.classlink(imclass,mod)
-            object = object.__func__
 
         if name == realname:
             title = '<a name="%s"><strong>%s</strong></a>' % (anchor, realname)
@@ -916,23 +939,24 @@
                 reallink = realname
             title = '<a name="%s"><strong>%s</strong></a> = %s' % (
                 anchor, name, reallink)
-        if inspect.isfunction(object):
-            args, varargs, kwonlyargs, kwdefaults, varkw, defaults, ann = \
-                inspect.getfullargspec(object)
-            argspec = inspect.formatargspec(
-                args, varargs, kwonlyargs, kwdefaults, varkw, defaults, ann,
-                formatvalue=self.formatvalue,
-                formatannotation=inspect.formatannotationrelativeto(object))
-            if realname == '<lambda>':
-                title = '<strong>%s</strong> <em>lambda</em> ' % name
-                # XXX lambda's won't usually have func_annotations['return']
-                # since the syntax doesn't support but it is possible.
-                # So removing parentheses isn't truly safe.
-                argspec = argspec[1:-1] # remove parentheses
-        else:
+        argspec = None
+        if inspect.isroutine(object):
+            try:
+                signature = inspect.signature(object)
+            except (ValueError, TypeError):
+                signature = None
+            if signature:
+                argspec = str(signature)
+                if realname == '<lambda>':
+                    title = '<strong>%s</strong> <em>lambda</em> ' % name
+                    # XXX lambda's won't usually have func_annotations['return']
+                    # since the syntax doesn't support but it is possible.
+                    # So removing parentheses isn't truly safe.
+                    argspec = argspec[1:-1] # remove parentheses
+        if not argspec:
             argspec = '(...)'
 
-        decl = title + argspec + (note and self.grey(
+        decl = title + self.escape(argspec) + (note and self.grey(
                '<font face="helvetica, arial">%s</font>' % note))
 
         if skipdocs:
@@ -1236,8 +1260,12 @@
                         doc = getdoc(value)
                     else:
                         doc = None
-                    push(self.docother(getattr(object, name),
-                                       name, mod, maxlen=70, doc=doc) + '\n')
+                    try:
+                        obj = getattr(object, name)
+                    except AttributeError:
+                        obj = homecls.__dict__[name]
+                    push(self.docother(obj, name, mod, maxlen=70, doc=doc) +
+                         '\n')
             return attrs
 
         attrs = [(name, kind, cls, value)
@@ -1259,7 +1287,6 @@
             else:
                 tag = "inherited from %s" % classname(thisclass,
                                                       object.__module__)
-
             # Sort attrs by name.
             attrs.sort()
 
@@ -1274,6 +1301,7 @@
                                      lambda t: t[1] == 'data descriptor')
             attrs = spilldata("Data and other attributes %s:\n" % tag, attrs,
                               lambda t: t[1] == 'data')
+
             assert attrs == []
             attrs = inherited
 
@@ -1292,7 +1320,7 @@
         name = name or realname
         note = ''
         skipdocs = 0
-        if inspect.ismethod(object):
+        if _is_bound_method(object):
             imclass = object.__self__.__class__
             if cl:
                 if imclass is not cl:
@@ -1303,7 +1331,6 @@
                         object.__self__.__class__, mod)
                 else:
                     note = ' unbound %s method' % classname(imclass,mod)
-            object = object.__func__
 
         if name == realname:
             title = self.bold(realname)
@@ -1312,20 +1339,22 @@
                 cl.__dict__[realname] is object):
                 skipdocs = 1
             title = self.bold(name) + ' = ' + realname
-        if inspect.isfunction(object):
-            args, varargs, varkw, defaults, kwonlyargs, kwdefaults, ann = \
-              inspect.getfullargspec(object)
-            argspec = inspect.formatargspec(
-                args, varargs, varkw, defaults, kwonlyargs, kwdefaults, ann,
-                formatvalue=self.formatvalue,
-                formatannotation=inspect.formatannotationrelativeto(object))
-            if realname == '<lambda>':
-                title = self.bold(name) + ' lambda '
-                # XXX lambda's won't usually have func_annotations['return']
-                # since the syntax doesn't support but it is possible.
-                # So removing parentheses isn't truly safe.
-                argspec = argspec[1:-1] # remove parentheses
-        else:
+        argspec = None
+
+        if inspect.isroutine(object):
+            try:
+                signature = inspect.signature(object)
+            except (ValueError, TypeError):
+                signature = None
+            if signature:
+                argspec = str(signature)
+                if realname == '<lambda>':
+                    title = self.bold(name) + ' lambda '
+                    # XXX lambda's won't usually have func_annotations['return']
+                    # since the syntax doesn't support but it is possible.
+                    # So removing parentheses isn't truly safe.
+                    argspec = argspec[1:-1] # remove parentheses
+        if not argspec:
             argspec = '(...)'
         decl = title + argspec + note
 
@@ -1378,11 +1407,16 @@
 def pager(text):
     """The first time this is called, determine what kind of pager to use."""
     global pager
+    # Escape non-encodable characters to avoid encoding errors later
+    encoding = sys.getfilesystemencoding()
+    text = text.encode(encoding, 'backslashreplace').decode(encoding)
     pager = getpager()
     pager(text)
 
 def getpager():
     """Decide what method to use for paging through text."""
+    if not hasattr(sys.stdin, "isatty"):
+        return plainpager
     if not hasattr(sys.stdout, "isatty"):
         return plainpager
     if not sys.stdin.isatty() or not sys.stdout.isatty():
@@ -1396,7 +1430,7 @@
             return lambda text: pipepager(text, os.environ['PAGER'])
     if os.environ.get('TERM') in ('dumb', 'emacs'):
         return plainpager
-    if sys.platform == 'win32' or sys.platform.startswith('os2'):
+    if sys.platform == 'win32':
         return lambda text: tempfilepager(plain(text), 'more <')
     if hasattr(os, 'system') and os.system('(less) 2>/dev/null') == 0:
         return lambda text: pipepager(text, 'less')
@@ -1422,16 +1456,15 @@
     try:
         pipe.write(text)
         pipe.close()
-    except IOError:
+    except OSError:
         pass # Ignore broken pipes caused by quitting the pager program.
 
 def tempfilepager(text, cmd):
     """Page through text by invoking a program on a temporary file."""
     import tempfile
     filename = tempfile.mktemp()
-    file = open(filename, 'w')
-    file.write(text)
-    file.close()
+    with open(filename, 'w') as file:
+        file.write(text)
     try:
         os.system(cmd + ' "' + filename + '"')
     finally:
@@ -1446,12 +1479,18 @@
         old = tty.tcgetattr(fd)
         tty.setcbreak(fd)
         getchar = lambda: sys.stdin.read(1)
-    except (ImportError, AttributeError):
+    except (ImportError, AttributeError, io.UnsupportedOperation):
         tty = None
         getchar = lambda: sys.stdin.readline()[:-1][:1]
 
     try:
-        r = inc = os.environ.get('LINES', 25) - 1
+        try:
+            h = int(os.environ.get('LINES', 0))
+        except ValueError:
+            h = 0
+        if h <= 1:
+            h = 25
+        r = inc = h - 1
         sys.stdout.write('\n'.join(lines[:inc]) + '\n')
         while lines[r:]:
             sys.stdout.write('-- more --')
@@ -1605,7 +1644,7 @@
     # in pydoc_data/topics.py.
     #
     # CAUTION: if you change one of these dictionaries, be sure to adapt the
-    #          list of needed labels in Doc/tools/sphinxext/pyspecific.py and
+    #          list of needed labels in Doc/tools/pyspecific.py and
     #          regenerate the pydoc_data/topics.py file by running
     #              make pydoc-topics
     #          in Doc/ and copying the output file into the Lib/ directory.
@@ -1705,7 +1744,6 @@
         'TRACEBACKS': 'TYPES',
         'NONE': ('bltin-null-object', ''),
         'ELLIPSIS': ('bltin-ellipsis-object', 'SLICINGS'),
-        'FILES': ('bltin-file-objects', ''),
         'SPECIALATTRIBUTES': ('specialattrs', ''),
         'CLASSES': ('types', 'class SPECIALMETHODS PRIVATENAMES'),
         'MODULES': ('typesmodules', 'import'),
@@ -1841,7 +1879,7 @@
 
     def intro(self):
         self.output.write('''
-Welcome to Python %s!  This is the interactive help utility.
+Welcome to Python %s's help utility!
 
 If this is your first time using Python, you should definitely check out
 the tutorial on the Internet at http://docs.python.org/%s/tutorial/.
@@ -1850,10 +1888,10 @@
 Python programs and using Python modules.  To quit this help utility and
 return to the interpreter, just type "quit".
 
-To get a list of available modules, keywords, or topics, type "modules",
-"keywords", or "topics".  Each module also comes with a one-line summary
-of what it does; to list the modules whose summaries contain a given word
-such as "spam", type "modules spam".
+To get a list of available modules, keywords, symbols, or topics, type
+"modules", "keywords", "symbols", or "topics".  Each module also comes
+with a one-line summary of what it does; to list the modules whose name
+or summary contain a given string such as "spam", type "modules spam".
 ''' % tuple([sys.version[:3]]*2))
 
     def list(self, items, columns=4, width=80):
@@ -1917,11 +1955,10 @@
         if more_xrefs:
             xrefs = (xrefs or '') + ' ' + more_xrefs
         if xrefs:
-            import formatter
-            buffer = io.StringIO()
-            formatter.DumbWriter(buffer).send_flowing_data(
-                'Related help topics: ' + ', '.join(xrefs.split()) + '\n')
-            self.output.write('\n%s\n' % buffer.getvalue())
+            import textwrap
+            text = 'Related help topics: ' + ', '.join(xrefs.split()) + '\n'
+            wrapped_text = textwrap.wrap(text, 72)
+            self.output.write('\n%s\n' % ''.join(wrapped_text))
 
     def _gettopic(self, topic, more_xrefs=''):
         """Return unbuffered tuple of (topic, xrefs).
@@ -1958,9 +1995,10 @@
     def listmodules(self, key=''):
         if key:
             self.output.write('''
-Here is a list of matching modules.  Enter any module name to get more help.
+Here is a list of modules whose name or summary contains '{}'.
+If there are any, enter a module name to get more help.
 
-''')
+'''.format(key))
             apropos(key)
         else:
             self.output.write('''
@@ -1979,35 +2017,11 @@
             self.list(modules.keys())
             self.output.write('''
 Enter any module name to get more help.  Or, type "modules spam" to search
-for modules whose descriptions contain the word "spam".
+for modules whose name or summary contain the string "spam".
 ''')
 
 help = Helper()
 
-class Scanner:
-    """A generic tree iterator."""
-    def __init__(self, roots, children, descendp):
-        self.roots = roots[:]
-        self.state = []
-        self.children = children
-        self.descendp = descendp
-
-    def next(self):
-        if not self.state:
-            if not self.roots:
-                return None
-            root = self.roots.pop(0)
-            self.state = [(root, self.children(root))]
-        node, children = self.state[-1]
-        if not children:
-            self.state.pop()
-            return self.next()
-        child = children.pop(0)
-        if self.descendp(child):
-            self.state.append((child, self.children(child)))
-        return child
-
-
 class ModuleScanner:
     """An interruptible scanner that searches module synopses."""
 
@@ -2036,10 +2050,11 @@
                 callback(None, modname, '')
             else:
                 try:
-                    loader = importer.find_module(modname)
+                    spec = pkgutil._get_spec(importer, modname)
                 except SyntaxError:
                     # raised by tests for bad coding cookies or BOM
                     continue
+                loader = spec.loader
                 if hasattr(loader, 'get_source'):
                     try:
                         source = loader.get_source(modname)
@@ -2053,8 +2068,9 @@
                     else:
                         path = None
                 else:
+                    _spec = importlib._bootstrap._SpecMethods(spec)
                     try:
-                        module = loader.load_module(modname)
+                        module = _spec.load()
                     except ImportError:
                         if onerror:
                             onerror(modname)
@@ -2341,7 +2357,7 @@
 
     def html_getfile(path):
         """Get and display a source file listing safely."""
-        path = path.replace('%20', ' ')
+        path = urllib.parse.unquote(path)
         with tokenize.open(path) as fp:
             lines = html.escape(fp.read())
         body = '<pre>%s</pre>' % lines
diff --git a/Lib/pydoc_data/topics.py b/Lib/pydoc_data/topics.py
index e2fd380..cc7f17d 100644
--- a/Lib/pydoc_data/topics.py
+++ b/Lib/pydoc_data/topics.py
@@ -1,78 +1,78 @@
 # -*- coding: utf-8 -*-
-# Autogenerated by Sphinx on Sun Feb 23 08:13:25 2014
+# Autogenerated by Sphinx on Sun Oct  5 19:01:41 2014
 topics = {'assert': '\nThe "assert" statement\n**********************\n\nAssert statements are a convenient way to insert debugging assertions\ninto a program:\n\n   assert_stmt ::= "assert" expression ["," expression]\n\nThe simple form, "assert expression", is equivalent to\n\n   if __debug__:\n      if not expression: raise AssertionError\n\nThe extended form, "assert expression1, expression2", is equivalent to\n\n   if __debug__:\n      if not expression1: raise AssertionError(expression2)\n\nThese equivalences assume that "__debug__" and "AssertionError" refer\nto the built-in variables with those names.  In the current\nimplementation, the built-in variable "__debug__" is "True" under\nnormal circumstances, "False" when optimization is requested (command\nline option -O).  The current code generator emits no code for an\nassert statement when optimization is requested at compile time.  Note\nthat it is unnecessary to include the source code for the expression\nthat failed in the error message; it will be displayed as part of the\nstack trace.\n\nAssignments to "__debug__" are illegal.  The value for the built-in\nvariable is determined when the interpreter starts.\n',
- 'assignment': '\nAssignment statements\n*********************\n\nAssignment statements are used to (re)bind names to values and to\nmodify attributes or items of mutable objects:\n\n   assignment_stmt ::= (target_list "=")+ (expression_list | yield_expression)\n   target_list     ::= target ("," target)* [","]\n   target          ::= identifier\n              | "(" target_list ")"\n              | "[" target_list "]"\n              | attributeref\n              | subscription\n              | slicing\n              | "*" target\n\n(See section *Primaries* for the syntax definitions for the last three\nsymbols.)\n\nAn assignment statement evaluates the expression list (remember that\nthis can be a single expression or a comma-separated list, the latter\nyielding a tuple) and assigns the single resulting object to each of\nthe target lists, from left to right.\n\nAssignment is defined recursively depending on the form of the target\n(list). When a target is part of a mutable object (an attribute\nreference, subscription or slicing), the mutable object must\nultimately perform the assignment and decide about its validity, and\nmay raise an exception if the assignment is unacceptable.  The rules\nobserved by various types and the exceptions raised are given with the\ndefinition of the object types (see section *The standard type\nhierarchy*).\n\nAssignment of an object to a target list, optionally enclosed in\nparentheses or square brackets, is recursively defined as follows.\n\n* If the target list is a single target: The object is assigned to\n  that target.\n\n* If the target list is a comma-separated list of targets: The\n  object must be an iterable with the same number of items as there\n  are targets in the target list, and the items are assigned, from\n  left to right, to the corresponding targets.\n\n  * If the target list contains one target prefixed with an\n    asterisk, called a "starred" target: The object must be a sequence\n    with at least as many items as there are targets in the target\n    list, minus one.  The first items of the sequence are assigned,\n    from left to right, to the targets before the starred target.  The\n    final items of the sequence are assigned to the targets after the\n    starred target.  A list of the remaining items in the sequence is\n    then assigned to the starred target (the list can be empty).\n\n  * Else: The object must be a sequence with the same number of\n    items as there are targets in the target list, and the items are\n    assigned, from left to right, to the corresponding targets.\n\nAssignment of an object to a single target is recursively defined as\nfollows.\n\n* If the target is an identifier (name):\n\n  * If the name does not occur in a "global" or "nonlocal" statement\n    in the current code block: the name is bound to the object in the\n    current local namespace.\n\n  * Otherwise: the name is bound to the object in the global\n    namespace or the outer namespace determined by "nonlocal",\n    respectively.\n\n  The name is rebound if it was already bound.  This may cause the\n  reference count for the object previously bound to the name to reach\n  zero, causing the object to be deallocated and its destructor (if it\n  has one) to be called.\n\n* If the target is a target list enclosed in parentheses or in\n  square brackets: The object must be an iterable with the same number\n  of items as there are targets in the target list, and its items are\n  assigned, from left to right, to the corresponding targets.\n\n* If the target is an attribute reference: The primary expression in\n  the reference is evaluated.  It should yield an object with\n  assignable attributes; if this is not the case, "TypeError" is\n  raised.  That object is then asked to assign the assigned object to\n  the given attribute; if it cannot perform the assignment, it raises\n  an exception (usually but not necessarily "AttributeError").\n\n  Note: If the object is a class instance and the attribute reference\n  occurs on both sides of the assignment operator, the RHS expression,\n  "a.x" can access either an instance attribute or (if no instance\n  attribute exists) a class attribute.  The LHS target "a.x" is always\n  set as an instance attribute, creating it if necessary.  Thus, the\n  two occurrences of "a.x" do not necessarily refer to the same\n  attribute: if the RHS expression refers to a class attribute, the\n  LHS creates a new instance attribute as the target of the\n  assignment:\n\n     class Cls:\n         x = 3             # class variable\n     inst = Cls()\n     inst.x = inst.x + 1   # writes inst.x as 4 leaving Cls.x as 3\n\n  This description does not necessarily apply to descriptor\n  attributes, such as properties created with "property()".\n\n* If the target is a subscription: The primary expression in the\n  reference is evaluated.  It should yield either a mutable sequence\n  object (such as a list) or a mapping object (such as a dictionary).\n  Next, the subscript expression is evaluated.\n\n  If the primary is a mutable sequence object (such as a list), the\n  subscript must yield an integer.  If it is negative, the sequence\'s\n  length is added to it.  The resulting value must be a nonnegative\n  integer less than the sequence\'s length, and the sequence is asked\n  to assign the assigned object to its item with that index.  If the\n  index is out of range, "IndexError" is raised (assignment to a\n  subscripted sequence cannot add new items to a list).\n\n  If the primary is a mapping object (such as a dictionary), the\n  subscript must have a type compatible with the mapping\'s key type,\n  and the mapping is then asked to create a key/datum pair which maps\n  the subscript to the assigned object.  This can either replace an\n  existing key/value pair with the same key value, or insert a new\n  key/value pair (if no key with the same value existed).\n\n  For user-defined objects, the "__setitem__()" method is called with\n  appropriate arguments.\n\n* If the target is a slicing: The primary expression in the\n  reference is evaluated.  It should yield a mutable sequence object\n  (such as a list).  The assigned object should be a sequence object\n  of the same type.  Next, the lower and upper bound expressions are\n  evaluated, insofar they are present; defaults are zero and the\n  sequence\'s length.  The bounds should evaluate to integers. If\n  either bound is negative, the sequence\'s length is added to it.  The\n  resulting bounds are clipped to lie between zero and the sequence\'s\n  length, inclusive.  Finally, the sequence object is asked to replace\n  the slice with the items of the assigned sequence.  The length of\n  the slice may be different from the length of the assigned sequence,\n  thus changing the length of the target sequence, if the object\n  allows it.\n\n**CPython implementation detail:** In the current implementation, the\nsyntax for targets is taken to be the same as for expressions, and\ninvalid syntax is rejected during the code generation phase, causing\nless detailed error messages.\n\nWARNING: Although the definition of assignment implies that overlaps\nbetween the left-hand side and the right-hand side are \'safe\' (for\nexample "a, b = b, a" swaps two variables), overlaps *within* the\ncollection of assigned-to variables are not safe!  For instance, the\nfollowing program prints "[0, 2]":\n\n   x = [0, 1]\n   i = 0\n   i, x[i] = 1, 2\n   print(x)\n\nSee also: **PEP 3132** - Extended Iterable Unpacking\n\n     The specification for the "*target" feature.\n\n\nAugmented assignment statements\n===============================\n\nAugmented assignment is the combination, in a single statement, of a\nbinary operation and an assignment statement:\n\n   augmented_assignment_stmt ::= augtarget augop (expression_list | yield_expression)\n   augtarget                 ::= identifier | attributeref | subscription | slicing\n   augop                     ::= "+=" | "-=" | "*=" | "/=" | "//=" | "%=" | "**="\n             | ">>=" | "<<=" | "&=" | "^=" | "|="\n\n(See section *Primaries* for the syntax definitions for the last three\nsymbols.)\n\nAn augmented assignment evaluates the target (which, unlike normal\nassignment statements, cannot be an unpacking) and the expression\nlist, performs the binary operation specific to the type of assignment\non the two operands, and assigns the result to the original target.\nThe target is only evaluated once.\n\nAn augmented assignment expression like "x += 1" can be rewritten as\n"x = x + 1" to achieve a similar, but not exactly equal effect. In the\naugmented version, "x" is only evaluated once. Also, when possible,\nthe actual operation is performed *in-place*, meaning that rather than\ncreating a new object and assigning that to the target, the old object\nis modified instead.\n\nWith the exception of assigning to tuples and multiple targets in a\nsingle statement, the assignment done by augmented assignment\nstatements is handled the same way as normal assignments. Similarly,\nwith the exception of the possible *in-place* behavior, the binary\noperation performed by augmented assignment is the same as the normal\nbinary operations.\n\nFor targets which are attribute references, the same *caveat about\nclass and instance attributes* applies as for regular assignments.\n',
+ 'assignment': '\nAssignment statements\n*********************\n\nAssignment statements are used to (re)bind names to values and to\nmodify attributes or items of mutable objects:\n\n   assignment_stmt ::= (target_list "=")+ (expression_list | yield_expression)\n   target_list     ::= target ("," target)* [","]\n   target          ::= identifier\n              | "(" target_list ")"\n              | "[" target_list "]"\n              | attributeref\n              | subscription\n              | slicing\n              | "*" target\n\n(See section *Primaries* for the syntax definitions for\n*attributeref*, *subscription*, and *slicing*.)\n\nAn assignment statement evaluates the expression list (remember that\nthis can be a single expression or a comma-separated list, the latter\nyielding a tuple) and assigns the single resulting object to each of\nthe target lists, from left to right.\n\nAssignment is defined recursively depending on the form of the target\n(list). When a target is part of a mutable object (an attribute\nreference, subscription or slicing), the mutable object must\nultimately perform the assignment and decide about its validity, and\nmay raise an exception if the assignment is unacceptable.  The rules\nobserved by various types and the exceptions raised are given with the\ndefinition of the object types (see section *The standard type\nhierarchy*).\n\nAssignment of an object to a target list, optionally enclosed in\nparentheses or square brackets, is recursively defined as follows.\n\n* If the target list is a single target: The object is assigned to\n  that target.\n\n* If the target list is a comma-separated list of targets: The\n  object must be an iterable with the same number of items as there\n  are targets in the target list, and the items are assigned, from\n  left to right, to the corresponding targets.\n\n  * If the target list contains one target prefixed with an\n    asterisk, called a "starred" target: The object must be a sequence\n    with at least as many items as there are targets in the target\n    list, minus one.  The first items of the sequence are assigned,\n    from left to right, to the targets before the starred target.  The\n    final items of the sequence are assigned to the targets after the\n    starred target.  A list of the remaining items in the sequence is\n    then assigned to the starred target (the list can be empty).\n\n  * Else: The object must be a sequence with the same number of\n    items as there are targets in the target list, and the items are\n    assigned, from left to right, to the corresponding targets.\n\nAssignment of an object to a single target is recursively defined as\nfollows.\n\n* If the target is an identifier (name):\n\n  * If the name does not occur in a "global" or "nonlocal" statement\n    in the current code block: the name is bound to the object in the\n    current local namespace.\n\n  * Otherwise: the name is bound to the object in the global\n    namespace or the outer namespace determined by "nonlocal",\n    respectively.\n\n  The name is rebound if it was already bound.  This may cause the\n  reference count for the object previously bound to the name to reach\n  zero, causing the object to be deallocated and its destructor (if it\n  has one) to be called.\n\n* If the target is a target list enclosed in parentheses or in\n  square brackets: The object must be an iterable with the same number\n  of items as there are targets in the target list, and its items are\n  assigned, from left to right, to the corresponding targets.\n\n* If the target is an attribute reference: The primary expression in\n  the reference is evaluated.  It should yield an object with\n  assignable attributes; if this is not the case, "TypeError" is\n  raised.  That object is then asked to assign the assigned object to\n  the given attribute; if it cannot perform the assignment, it raises\n  an exception (usually but not necessarily "AttributeError").\n\n  Note: If the object is a class instance and the attribute reference\n  occurs on both sides of the assignment operator, the RHS expression,\n  "a.x" can access either an instance attribute or (if no instance\n  attribute exists) a class attribute.  The LHS target "a.x" is always\n  set as an instance attribute, creating it if necessary.  Thus, the\n  two occurrences of "a.x" do not necessarily refer to the same\n  attribute: if the RHS expression refers to a class attribute, the\n  LHS creates a new instance attribute as the target of the\n  assignment:\n\n     class Cls:\n         x = 3             # class variable\n     inst = Cls()\n     inst.x = inst.x + 1   # writes inst.x as 4 leaving Cls.x as 3\n\n  This description does not necessarily apply to descriptor\n  attributes, such as properties created with "property()".\n\n* If the target is a subscription: The primary expression in the\n  reference is evaluated.  It should yield either a mutable sequence\n  object (such as a list) or a mapping object (such as a dictionary).\n  Next, the subscript expression is evaluated.\n\n  If the primary is a mutable sequence object (such as a list), the\n  subscript must yield an integer.  If it is negative, the sequence\'s\n  length is added to it.  The resulting value must be a nonnegative\n  integer less than the sequence\'s length, and the sequence is asked\n  to assign the assigned object to its item with that index.  If the\n  index is out of range, "IndexError" is raised (assignment to a\n  subscripted sequence cannot add new items to a list).\n\n  If the primary is a mapping object (such as a dictionary), the\n  subscript must have a type compatible with the mapping\'s key type,\n  and the mapping is then asked to create a key/datum pair which maps\n  the subscript to the assigned object.  This can either replace an\n  existing key/value pair with the same key value, or insert a new\n  key/value pair (if no key with the same value existed).\n\n  For user-defined objects, the "__setitem__()" method is called with\n  appropriate arguments.\n\n* If the target is a slicing: The primary expression in the\n  reference is evaluated.  It should yield a mutable sequence object\n  (such as a list).  The assigned object should be a sequence object\n  of the same type.  Next, the lower and upper bound expressions are\n  evaluated, insofar they are present; defaults are zero and the\n  sequence\'s length.  The bounds should evaluate to integers. If\n  either bound is negative, the sequence\'s length is added to it.  The\n  resulting bounds are clipped to lie between zero and the sequence\'s\n  length, inclusive.  Finally, the sequence object is asked to replace\n  the slice with the items of the assigned sequence.  The length of\n  the slice may be different from the length of the assigned sequence,\n  thus changing the length of the target sequence, if the target\n  sequence allows it.\n\n**CPython implementation detail:** In the current implementation, the\nsyntax for targets is taken to be the same as for expressions, and\ninvalid syntax is rejected during the code generation phase, causing\nless detailed error messages.\n\nAlthough the definition of assignment implies that overlaps between\nthe left-hand side and the right-hand side are \'simultanenous\' (for\nexample "a, b = b, a" swaps two variables), overlaps *within* the\ncollection of assigned-to variables occur left-to-right, sometimes\nresulting in confusion.  For instance, the following program prints\n"[0, 2]":\n\n   x = [0, 1]\n   i = 0\n   i, x[i] = 1, 2         # i is updated, then x[i] is updated\n   print(x)\n\nSee also: **PEP 3132** - Extended Iterable Unpacking\n\n     The specification for the "*target" feature.\n\n\nAugmented assignment statements\n===============================\n\nAugmented assignment is the combination, in a single statement, of a\nbinary operation and an assignment statement:\n\n   augmented_assignment_stmt ::= augtarget augop (expression_list | yield_expression)\n   augtarget                 ::= identifier | attributeref | subscription | slicing\n   augop                     ::= "+=" | "-=" | "*=" | "/=" | "//=" | "%=" | "**="\n             | ">>=" | "<<=" | "&=" | "^=" | "|="\n\n(See section *Primaries* for the syntax definitions of the last three\nsymbols.)\n\nAn augmented assignment evaluates the target (which, unlike normal\nassignment statements, cannot be an unpacking) and the expression\nlist, performs the binary operation specific to the type of assignment\non the two operands, and assigns the result to the original target.\nThe target is only evaluated once.\n\nAn augmented assignment expression like "x += 1" can be rewritten as\n"x = x + 1" to achieve a similar, but not exactly equal effect. In the\naugmented version, "x" is only evaluated once. Also, when possible,\nthe actual operation is performed *in-place*, meaning that rather than\ncreating a new object and assigning that to the target, the old object\nis modified instead.\n\nUnlike normal assignments, augmented assignments evaluate the left-\nhand side *before* evaluating the right-hand side.  For example, "a[i]\n+= f(x)" first looks-up "a[i]", then it evaluates "f(x)" and performs\nthe addition, and lastly, it writes the result back to "a[i]".\n\nWith the exception of assigning to tuples and multiple targets in a\nsingle statement, the assignment done by augmented assignment\nstatements is handled the same way as normal assignments. Similarly,\nwith the exception of the possible *in-place* behavior, the binary\noperation performed by augmented assignment is the same as the normal\nbinary operations.\n\nFor targets which are attribute references, the same *caveat about\nclass and instance attributes* applies as for regular assignments.\n',
  'atom-identifiers': '\nIdentifiers (Names)\n*******************\n\nAn identifier occurring as an atom is a name.  See section\n*Identifiers and keywords* for lexical definition and section *Naming\nand binding* for documentation of naming and binding.\n\nWhen the name is bound to an object, evaluation of the atom yields\nthat object. When a name is not bound, an attempt to evaluate it\nraises a "NameError" exception.\n\n**Private name mangling:** When an identifier that textually occurs in\na class definition begins with two or more underscore characters and\ndoes not end in two or more underscores, it is considered a *private\nname* of that class. Private names are transformed to a longer form\nbefore code is generated for them.  The transformation inserts the\nclass name, with leading underscores removed and a single underscore\ninserted, in front of the name.  For example, the identifier "__spam"\noccurring in a class named "Ham" will be transformed to "_Ham__spam".\nThis transformation is independent of the syntactical context in which\nthe identifier is used.  If the transformed name is extremely long\n(longer than 255 characters), implementation defined truncation may\nhappen. If the class name consists only of underscores, no\ntransformation is done.\n',
  'atom-literals': "\nLiterals\n********\n\nPython supports string and bytes literals and various numeric\nliterals:\n\n   literal ::= stringliteral | bytesliteral\n               | integer | floatnumber | imagnumber\n\nEvaluation of a literal yields an object of the given type (string,\nbytes, integer, floating point number, complex number) with the given\nvalue.  The value may be approximated in the case of floating point\nand imaginary (complex) literals.  See section *Literals* for details.\n\nAll literals correspond to immutable data types, and hence the\nobject's identity is less important than its value.  Multiple\nevaluations of literals with the same value (either the same\noccurrence in the program text or a different occurrence) may obtain\nthe same object or a different object with the same value.\n",
- 'attribute-access': '\nCustomizing attribute access\n****************************\n\nThe following methods can be defined to customize the meaning of\nattribute access (use of, assignment to, or deletion of "x.name") for\nclass instances.\n\nobject.__getattr__(self, name)\n\n   Called when an attribute lookup has not found the attribute in the\n   usual places (i.e. it is not an instance attribute nor is it found\n   in the class tree for "self").  "name" is the attribute name. This\n   method should return the (computed) attribute value or raise an\n   "AttributeError" exception.\n\n   Note that if the attribute is found through the normal mechanism,\n   "__getattr__()" is not called.  (This is an intentional asymmetry\n   between "__getattr__()" and "__setattr__()".) This is done both for\n   efficiency reasons and because otherwise "__getattr__()" would have\n   no way to access other attributes of the instance.  Note that at\n   least for instance variables, you can fake total control by not\n   inserting any values in the instance attribute dictionary (but\n   instead inserting them in another object).  See the\n   "__getattribute__()" method below for a way to actually get total\n   control over attribute access.\n\nobject.__getattribute__(self, name)\n\n   Called unconditionally to implement attribute accesses for\n   instances of the class. If the class also defines "__getattr__()",\n   the latter will not be called unless "__getattribute__()" either\n   calls it explicitly or raises an "AttributeError". This method\n   should return the (computed) attribute value or raise an\n   "AttributeError" exception. In order to avoid infinite recursion in\n   this method, its implementation should always call the base class\n   method with the same name to access any attributes it needs, for\n   example, "object.__getattribute__(self, name)".\n\n   Note: This method may still be bypassed when looking up special\n     methods as the result of implicit invocation via language syntax\n     or built-in functions. See *Special method lookup*.\n\nobject.__setattr__(self, name, value)\n\n   Called when an attribute assignment is attempted.  This is called\n   instead of the normal mechanism (i.e. store the value in the\n   instance dictionary). *name* is the attribute name, *value* is the\n   value to be assigned to it.\n\n   If "__setattr__()" wants to assign to an instance attribute, it\n   should call the base class method with the same name, for example,\n   "object.__setattr__(self, name, value)".\n\nobject.__delattr__(self, name)\n\n   Like "__setattr__()" but for attribute deletion instead of\n   assignment.  This should only be implemented if "del obj.name" is\n   meaningful for the object.\n\nobject.__dir__(self)\n\n   Called when "dir()" is called on the object. A sequence must be\n   returned. "dir()" converts the returned sequence to a list and\n   sorts it.\n\n\nImplementing Descriptors\n========================\n\nThe following methods only apply when an instance of the class\ncontaining the method (a so-called *descriptor* class) appears in an\n*owner* class (the descriptor must be in either the owner\'s class\ndictionary or in the class dictionary for one of its parents).  In the\nexamples below, "the attribute" refers to the attribute whose name is\nthe key of the property in the owner class\' "__dict__".\n\nobject.__get__(self, instance, owner)\n\n   Called to get the attribute of the owner class (class attribute\n   access) or of an instance of that class (instance attribute\n   access). *owner* is always the owner class, while *instance* is the\n   instance that the attribute was accessed through, or "None" when\n   the attribute is accessed through the *owner*.  This method should\n   return the (computed) attribute value or raise an "AttributeError"\n   exception.\n\nobject.__set__(self, instance, value)\n\n   Called to set the attribute on an instance *instance* of the owner\n   class to a new value, *value*.\n\nobject.__delete__(self, instance)\n\n   Called to delete the attribute on an instance *instance* of the\n   owner class.\n\n\nInvoking Descriptors\n====================\n\nIn general, a descriptor is an object attribute with "binding\nbehavior", one whose attribute access has been overridden by methods\nin the descriptor protocol:  "__get__()", "__set__()", and\n"__delete__()". If any of those methods are defined for an object, it\nis said to be a descriptor.\n\nThe default behavior for attribute access is to get, set, or delete\nthe attribute from an object\'s dictionary. For instance, "a.x" has a\nlookup chain starting with "a.__dict__[\'x\']", then\n"type(a).__dict__[\'x\']", and continuing through the base classes of\n"type(a)" excluding metaclasses.\n\nHowever, if the looked-up value is an object defining one of the\ndescriptor methods, then Python may override the default behavior and\ninvoke the descriptor method instead.  Where this occurs in the\nprecedence chain depends on which descriptor methods were defined and\nhow they were called.\n\nThe starting point for descriptor invocation is a binding, "a.x". How\nthe arguments are assembled depends on "a":\n\nDirect Call\n   The simplest and least common call is when user code directly\n   invokes a descriptor method:    "x.__get__(a)".\n\nInstance Binding\n   If binding to an object instance, "a.x" is transformed into the\n   call: "type(a).__dict__[\'x\'].__get__(a, type(a))".\n\nClass Binding\n   If binding to a class, "A.x" is transformed into the call:\n   "A.__dict__[\'x\'].__get__(None, A)".\n\nSuper Binding\n   If "a" is an instance of "super", then the binding "super(B,\n   obj).m()" searches "obj.__class__.__mro__" for the base class "A"\n   immediately preceding "B" and then invokes the descriptor with the\n   call: "A.__dict__[\'m\'].__get__(obj, obj.__class__)".\n\nFor instance bindings, the precedence of descriptor invocation depends\non the which descriptor methods are defined.  A descriptor can define\nany combination of "__get__()", "__set__()" and "__delete__()".  If it\ndoes not define "__get__()", then accessing the attribute will return\nthe descriptor object itself unless there is a value in the object\'s\ninstance dictionary.  If the descriptor defines "__set__()" and/or\n"__delete__()", it is a data descriptor; if it defines neither, it is\na non-data descriptor.  Normally, data descriptors define both\n"__get__()" and "__set__()", while non-data descriptors have just the\n"__get__()" method.  Data descriptors with "__set__()" and "__get__()"\ndefined always override a redefinition in an instance dictionary.  In\ncontrast, non-data descriptors can be overridden by instances.\n\nPython methods (including "staticmethod()" and "classmethod()") are\nimplemented as non-data descriptors.  Accordingly, instances can\nredefine and override methods.  This allows individual instances to\nacquire behaviors that differ from other instances of the same class.\n\nThe "property()" function is implemented as a data descriptor.\nAccordingly, instances cannot override the behavior of a property.\n\n\n__slots__\n=========\n\nBy default, instances of classes have a dictionary for attribute\nstorage.  This wastes space for objects having very few instance\nvariables.  The space consumption can become acute when creating large\nnumbers of instances.\n\nThe default can be overridden by defining *__slots__* in a class\ndefinition. The *__slots__* declaration takes a sequence of instance\nvariables and reserves just enough space in each instance to hold a\nvalue for each variable.  Space is saved because *__dict__* is not\ncreated for each instance.\n\nobject.__slots__\n\n   This class variable can be assigned a string, iterable, or sequence\n   of strings with variable names used by instances.  If defined in a\n   class, *__slots__* reserves space for the declared variables and\n   prevents the automatic creation of *__dict__* and *__weakref__* for\n   each instance.\n\n\nNotes on using *__slots__*\n--------------------------\n\n* When inheriting from a class without *__slots__*, the *__dict__*\n  attribute of that class will always be accessible, so a *__slots__*\n  definition in the subclass is meaningless.\n\n* Without a *__dict__* variable, instances cannot be assigned new\n  variables not listed in the *__slots__* definition.  Attempts to\n  assign to an unlisted variable name raises "AttributeError". If\n  dynamic assignment of new variables is desired, then add\n  "\'__dict__\'" to the sequence of strings in the *__slots__*\n  declaration.\n\n* Without a *__weakref__* variable for each instance, classes\n  defining *__slots__* do not support weak references to its\n  instances. If weak reference support is needed, then add\n  "\'__weakref__\'" to the sequence of strings in the *__slots__*\n  declaration.\n\n* *__slots__* are implemented at the class level by creating\n  descriptors (*Implementing Descriptors*) for each variable name.  As\n  a result, class attributes cannot be used to set default values for\n  instance variables defined by *__slots__*; otherwise, the class\n  attribute would overwrite the descriptor assignment.\n\n* The action of a *__slots__* declaration is limited to the class\n  where it is defined.  As a result, subclasses will have a *__dict__*\n  unless they also define *__slots__* (which must only contain names\n  of any *additional* slots).\n\n* If a class defines a slot also defined in a base class, the\n  instance variable defined by the base class slot is inaccessible\n  (except by retrieving its descriptor directly from the base class).\n  This renders the meaning of the program undefined.  In the future, a\n  check may be added to prevent this.\n\n* Nonempty *__slots__* does not work for classes derived from\n  "variable-length" built-in types such as "int", "bytes" and "tuple".\n\n* Any non-string iterable may be assigned to *__slots__*. Mappings\n  may also be used; however, in the future, special meaning may be\n  assigned to the values corresponding to each key.\n\n* *__class__* assignment works only if both classes have the same\n  *__slots__*.\n',
- 'attribute-references': '\nAttribute references\n********************\n\nAn attribute reference is a primary followed by a period and a name:\n\n   attributeref ::= primary "." identifier\n\nThe primary must evaluate to an object of a type that supports\nattribute references, which most objects do.  This object is then\nasked to produce the attribute whose name is the identifier (which can\nbe customized by overriding the "__getattr__()" method).  If this\nattribute is not available, the exception "AttributeError" is raised.\nOtherwise, the type and value of the object produced is determined by\nthe object.  Multiple evaluations of the same attribute reference may\nyield different objects.\n',
- 'augassign': '\nAugmented assignment statements\n*******************************\n\nAugmented assignment is the combination, in a single statement, of a\nbinary operation and an assignment statement:\n\n   augmented_assignment_stmt ::= augtarget augop (expression_list | yield_expression)\n   augtarget                 ::= identifier | attributeref | subscription | slicing\n   augop                     ::= "+=" | "-=" | "*=" | "/=" | "//=" | "%=" | "**="\n             | ">>=" | "<<=" | "&=" | "^=" | "|="\n\n(See section *Primaries* for the syntax definitions for the last three\nsymbols.)\n\nAn augmented assignment evaluates the target (which, unlike normal\nassignment statements, cannot be an unpacking) and the expression\nlist, performs the binary operation specific to the type of assignment\non the two operands, and assigns the result to the original target.\nThe target is only evaluated once.\n\nAn augmented assignment expression like "x += 1" can be rewritten as\n"x = x + 1" to achieve a similar, but not exactly equal effect. In the\naugmented version, "x" is only evaluated once. Also, when possible,\nthe actual operation is performed *in-place*, meaning that rather than\ncreating a new object and assigning that to the target, the old object\nis modified instead.\n\nWith the exception of assigning to tuples and multiple targets in a\nsingle statement, the assignment done by augmented assignment\nstatements is handled the same way as normal assignments. Similarly,\nwith the exception of the possible *in-place* behavior, the binary\noperation performed by augmented assignment is the same as the normal\nbinary operations.\n\nFor targets which are attribute references, the same *caveat about\nclass and instance attributes* applies as for regular assignments.\n',
- 'binary': '\nBinary arithmetic operations\n****************************\n\nThe binary arithmetic operations have the conventional priority\nlevels.  Note that some of these operations also apply to certain non-\nnumeric types.  Apart from the power operator, there are only two\nlevels, one for multiplicative operators and one for additive\noperators:\n\n   m_expr ::= u_expr | m_expr "*" u_expr | m_expr "//" u_expr | m_expr "/" u_expr\n              | m_expr "%" u_expr\n   a_expr ::= m_expr | a_expr "+" m_expr | a_expr "-" m_expr\n\nThe "*" (multiplication) operator yields the product of its arguments.\nThe arguments must either both be numbers, or one argument must be an\ninteger and the other must be a sequence. In the former case, the\nnumbers are converted to a common type and then multiplied together.\nIn the latter case, sequence repetition is performed; a negative\nrepetition factor yields an empty sequence.\n\nThe "/" (division) and "//" (floor division) operators yield the\nquotient of their arguments.  The numeric arguments are first\nconverted to a common type. Division of integers yields a float, while\nfloor division of integers results in an integer; the result is that\nof mathematical division with the \'floor\' function applied to the\nresult.  Division by zero raises the "ZeroDivisionError" exception.\n\nThe "%" (modulo) operator yields the remainder from the division of\nthe first argument by the second.  The numeric arguments are first\nconverted to a common type.  A zero right argument raises the\n"ZeroDivisionError" exception.  The arguments may be floating point\nnumbers, e.g., "3.14%0.7" equals "0.34" (since "3.14" equals "4*0.7 +\n0.34".)  The modulo operator always yields a result with the same sign\nas its second operand (or zero); the absolute value of the result is\nstrictly smaller than the absolute value of the second operand [1].\n\nThe floor division and modulo operators are connected by the following\nidentity: "x == (x//y)*y + (x%y)".  Floor division and modulo are also\nconnected with the built-in function "divmod()": "divmod(x, y) ==\n(x//y, x%y)". [2].\n\nIn addition to performing the modulo operation on numbers, the "%"\noperator is also overloaded by string objects to perform old-style\nstring formatting (also known as interpolation).  The syntax for\nstring formatting is described in the Python Library Reference,\nsection *printf-style String Formatting*.\n\nThe floor division operator, the modulo operator, and the "divmod()"\nfunction are not defined for complex numbers.  Instead, convert to a\nfloating point number using the "abs()" function if appropriate.\n\nThe "+" (addition) operator yields the sum of its arguments.  The\narguments must either both be numbers or both sequences of the same\ntype.  In the former case, the numbers are converted to a common type\nand then added together.  In the latter case, the sequences are\nconcatenated.\n\nThe "-" (subtraction) operator yields the difference of its arguments.\nThe numeric arguments are first converted to a common type.\n',
+ 'attribute-access': '\nCustomizing attribute access\n****************************\n\nThe following methods can be defined to customize the meaning of\nattribute access (use of, assignment to, or deletion of "x.name") for\nclass instances.\n\nobject.__getattr__(self, name)\n\n   Called when an attribute lookup has not found the attribute in the\n   usual places (i.e. it is not an instance attribute nor is it found\n   in the class tree for "self").  "name" is the attribute name. This\n   method should return the (computed) attribute value or raise an\n   "AttributeError" exception.\n\n   Note that if the attribute is found through the normal mechanism,\n   "__getattr__()" is not called.  (This is an intentional asymmetry\n   between "__getattr__()" and "__setattr__()".) This is done both for\n   efficiency reasons and because otherwise "__getattr__()" would have\n   no way to access other attributes of the instance.  Note that at\n   least for instance variables, you can fake total control by not\n   inserting any values in the instance attribute dictionary (but\n   instead inserting them in another object).  See the\n   "__getattribute__()" method below for a way to actually get total\n   control over attribute access.\n\nobject.__getattribute__(self, name)\n\n   Called unconditionally to implement attribute accesses for\n   instances of the class. If the class also defines "__getattr__()",\n   the latter will not be called unless "__getattribute__()" either\n   calls it explicitly or raises an "AttributeError". This method\n   should return the (computed) attribute value or raise an\n   "AttributeError" exception. In order to avoid infinite recursion in\n   this method, its implementation should always call the base class\n   method with the same name to access any attributes it needs, for\n   example, "object.__getattribute__(self, name)".\n\n   Note: This method may still be bypassed when looking up special\n     methods as the result of implicit invocation via language syntax\n     or built-in functions. See *Special method lookup*.\n\nobject.__setattr__(self, name, value)\n\n   Called when an attribute assignment is attempted.  This is called\n   instead of the normal mechanism (i.e. store the value in the\n   instance dictionary). *name* is the attribute name, *value* is the\n   value to be assigned to it.\n\n   If "__setattr__()" wants to assign to an instance attribute, it\n   should call the base class method with the same name, for example,\n   "object.__setattr__(self, name, value)".\n\nobject.__delattr__(self, name)\n\n   Like "__setattr__()" but for attribute deletion instead of\n   assignment.  This should only be implemented if "del obj.name" is\n   meaningful for the object.\n\nobject.__dir__(self)\n\n   Called when "dir()" is called on the object. A sequence must be\n   returned. "dir()" converts the returned sequence to a list and\n   sorts it.\n\n\nImplementing Descriptors\n========================\n\nThe following methods only apply when an instance of the class\ncontaining the method (a so-called *descriptor* class) appears in an\n*owner* class (the descriptor must be in either the owner\'s class\ndictionary or in the class dictionary for one of its parents).  In the\nexamples below, "the attribute" refers to the attribute whose name is\nthe key of the property in the owner class\' "__dict__".\n\nobject.__get__(self, instance, owner)\n\n   Called to get the attribute of the owner class (class attribute\n   access) or of an instance of that class (instance attribute\n   access). *owner* is always the owner class, while *instance* is the\n   instance that the attribute was accessed through, or "None" when\n   the attribute is accessed through the *owner*.  This method should\n   return the (computed) attribute value or raise an "AttributeError"\n   exception.\n\nobject.__set__(self, instance, value)\n\n   Called to set the attribute on an instance *instance* of the owner\n   class to a new value, *value*.\n\nobject.__delete__(self, instance)\n\n   Called to delete the attribute on an instance *instance* of the\n   owner class.\n\nThe attribute "__objclass__" is interpreted by the "inspect" module as\nspecifying the class where this object was defined (setting this\nappropriately can assist in runtime introspection of dynamic class\nattributes). For callables, it may indicate that an instance of the\ngiven type (or a subclass) is expected or required as the first\npositional argument (for example, CPython sets this attribute for\nunbound methods that are implemented in C).\n\n\nInvoking Descriptors\n====================\n\nIn general, a descriptor is an object attribute with "binding\nbehavior", one whose attribute access has been overridden by methods\nin the descriptor protocol:  "__get__()", "__set__()", and\n"__delete__()". If any of those methods are defined for an object, it\nis said to be a descriptor.\n\nThe default behavior for attribute access is to get, set, or delete\nthe attribute from an object\'s dictionary. For instance, "a.x" has a\nlookup chain starting with "a.__dict__[\'x\']", then\n"type(a).__dict__[\'x\']", and continuing through the base classes of\n"type(a)" excluding metaclasses.\n\nHowever, if the looked-up value is an object defining one of the\ndescriptor methods, then Python may override the default behavior and\ninvoke the descriptor method instead.  Where this occurs in the\nprecedence chain depends on which descriptor methods were defined and\nhow they were called.\n\nThe starting point for descriptor invocation is a binding, "a.x". How\nthe arguments are assembled depends on "a":\n\nDirect Call\n   The simplest and least common call is when user code directly\n   invokes a descriptor method:    "x.__get__(a)".\n\nInstance Binding\n   If binding to an object instance, "a.x" is transformed into the\n   call: "type(a).__dict__[\'x\'].__get__(a, type(a))".\n\nClass Binding\n   If binding to a class, "A.x" is transformed into the call:\n   "A.__dict__[\'x\'].__get__(None, A)".\n\nSuper Binding\n   If "a" is an instance of "super", then the binding "super(B,\n   obj).m()" searches "obj.__class__.__mro__" for the base class "A"\n   immediately preceding "B" and then invokes the descriptor with the\n   call: "A.__dict__[\'m\'].__get__(obj, obj.__class__)".\n\nFor instance bindings, the precedence of descriptor invocation depends\non the which descriptor methods are defined.  A descriptor can define\nany combination of "__get__()", "__set__()" and "__delete__()".  If it\ndoes not define "__get__()", then accessing the attribute will return\nthe descriptor object itself unless there is a value in the object\'s\ninstance dictionary.  If the descriptor defines "__set__()" and/or\n"__delete__()", it is a data descriptor; if it defines neither, it is\na non-data descriptor.  Normally, data descriptors define both\n"__get__()" and "__set__()", while non-data descriptors have just the\n"__get__()" method.  Data descriptors with "__set__()" and "__get__()"\ndefined always override a redefinition in an instance dictionary.  In\ncontrast, non-data descriptors can be overridden by instances.\n\nPython methods (including "staticmethod()" and "classmethod()") are\nimplemented as non-data descriptors.  Accordingly, instances can\nredefine and override methods.  This allows individual instances to\nacquire behaviors that differ from other instances of the same class.\n\nThe "property()" function is implemented as a data descriptor.\nAccordingly, instances cannot override the behavior of a property.\n\n\n__slots__\n=========\n\nBy default, instances of classes have a dictionary for attribute\nstorage.  This wastes space for objects having very few instance\nvariables.  The space consumption can become acute when creating large\nnumbers of instances.\n\nThe default can be overridden by defining *__slots__* in a class\ndefinition. The *__slots__* declaration takes a sequence of instance\nvariables and reserves just enough space in each instance to hold a\nvalue for each variable.  Space is saved because *__dict__* is not\ncreated for each instance.\n\nobject.__slots__\n\n   This class variable can be assigned a string, iterable, or sequence\n   of strings with variable names used by instances.  If defined in a\n   class, *__slots__* reserves space for the declared variables and\n   prevents the automatic creation of *__dict__* and *__weakref__* for\n   each instance.\n\n\nNotes on using *__slots__*\n--------------------------\n\n* When inheriting from a class without *__slots__*, the *__dict__*\n  attribute of that class will always be accessible, so a *__slots__*\n  definition in the subclass is meaningless.\n\n* Without a *__dict__* variable, instances cannot be assigned new\n  variables not listed in the *__slots__* definition.  Attempts to\n  assign to an unlisted variable name raises "AttributeError". If\n  dynamic assignment of new variables is desired, then add\n  "\'__dict__\'" to the sequence of strings in the *__slots__*\n  declaration.\n\n* Without a *__weakref__* variable for each instance, classes\n  defining *__slots__* do not support weak references to its\n  instances. If weak reference support is needed, then add\n  "\'__weakref__\'" to the sequence of strings in the *__slots__*\n  declaration.\n\n* *__slots__* are implemented at the class level by creating\n  descriptors (*Implementing Descriptors*) for each variable name.  As\n  a result, class attributes cannot be used to set default values for\n  instance variables defined by *__slots__*; otherwise, the class\n  attribute would overwrite the descriptor assignment.\n\n* The action of a *__slots__* declaration is limited to the class\n  where it is defined.  As a result, subclasses will have a *__dict__*\n  unless they also define *__slots__* (which must only contain names\n  of any *additional* slots).\n\n* If a class defines a slot also defined in a base class, the\n  instance variable defined by the base class slot is inaccessible\n  (except by retrieving its descriptor directly from the base class).\n  This renders the meaning of the program undefined.  In the future, a\n  check may be added to prevent this.\n\n* Nonempty *__slots__* does not work for classes derived from\n  "variable-length" built-in types such as "int", "bytes" and "tuple".\n\n* Any non-string iterable may be assigned to *__slots__*. Mappings\n  may also be used; however, in the future, special meaning may be\n  assigned to the values corresponding to each key.\n\n* *__class__* assignment works only if both classes have the same\n  *__slots__*.\n',
+ 'attribute-references': '\nAttribute references\n********************\n\nAn attribute reference is a primary followed by a period and a name:\n\n   attributeref ::= primary "." identifier\n\nThe primary must evaluate to an object of a type that supports\nattribute references, which most objects do.  This object is then\nasked to produce the attribute whose name is the identifier.  This\nproduction can be customized by overriding the "__getattr__()" method.\nIf this attribute is not available, the exception "AttributeError" is\nraised.  Otherwise, the type and value of the object produced is\ndetermined by the object.  Multiple evaluations of the same attribute\nreference may yield different objects.\n',
+ 'augassign': '\nAugmented assignment statements\n*******************************\n\nAugmented assignment is the combination, in a single statement, of a\nbinary operation and an assignment statement:\n\n   augmented_assignment_stmt ::= augtarget augop (expression_list | yield_expression)\n   augtarget                 ::= identifier | attributeref | subscription | slicing\n   augop                     ::= "+=" | "-=" | "*=" | "/=" | "//=" | "%=" | "**="\n             | ">>=" | "<<=" | "&=" | "^=" | "|="\n\n(See section *Primaries* for the syntax definitions of the last three\nsymbols.)\n\nAn augmented assignment evaluates the target (which, unlike normal\nassignment statements, cannot be an unpacking) and the expression\nlist, performs the binary operation specific to the type of assignment\non the two operands, and assigns the result to the original target.\nThe target is only evaluated once.\n\nAn augmented assignment expression like "x += 1" can be rewritten as\n"x = x + 1" to achieve a similar, but not exactly equal effect. In the\naugmented version, "x" is only evaluated once. Also, when possible,\nthe actual operation is performed *in-place*, meaning that rather than\ncreating a new object and assigning that to the target, the old object\nis modified instead.\n\nUnlike normal assignments, augmented assignments evaluate the left-\nhand side *before* evaluating the right-hand side.  For example, "a[i]\n+= f(x)" first looks-up "a[i]", then it evaluates "f(x)" and performs\nthe addition, and lastly, it writes the result back to "a[i]".\n\nWith the exception of assigning to tuples and multiple targets in a\nsingle statement, the assignment done by augmented assignment\nstatements is handled the same way as normal assignments. Similarly,\nwith the exception of the possible *in-place* behavior, the binary\noperation performed by augmented assignment is the same as the normal\nbinary operations.\n\nFor targets which are attribute references, the same *caveat about\nclass and instance attributes* applies as for regular assignments.\n',
+ 'binary': '\nBinary arithmetic operations\n****************************\n\nThe binary arithmetic operations have the conventional priority\nlevels.  Note that some of these operations also apply to certain non-\nnumeric types.  Apart from the power operator, there are only two\nlevels, one for multiplicative operators and one for additive\noperators:\n\n   m_expr ::= u_expr | m_expr "*" u_expr | m_expr "//" u_expr | m_expr "/" u_expr\n              | m_expr "%" u_expr\n   a_expr ::= m_expr | a_expr "+" m_expr | a_expr "-" m_expr\n\nThe "*" (multiplication) operator yields the product of its arguments.\nThe arguments must either both be numbers, or one argument must be an\ninteger and the other must be a sequence. In the former case, the\nnumbers are converted to a common type and then multiplied together.\nIn the latter case, sequence repetition is performed; a negative\nrepetition factor yields an empty sequence.\n\nThe "/" (division) and "//" (floor division) operators yield the\nquotient of their arguments.  The numeric arguments are first\nconverted to a common type. Division of integers yields a float, while\nfloor division of integers results in an integer; the result is that\nof mathematical division with the \'floor\' function applied to the\nresult.  Division by zero raises the "ZeroDivisionError" exception.\n\nThe "%" (modulo) operator yields the remainder from the division of\nthe first argument by the second.  The numeric arguments are first\nconverted to a common type.  A zero right argument raises the\n"ZeroDivisionError" exception.  The arguments may be floating point\nnumbers, e.g., "3.14%0.7" equals "0.34" (since "3.14" equals "4*0.7 +\n0.34".)  The modulo operator always yields a result with the same sign\nas its second operand (or zero); the absolute value of the result is\nstrictly smaller than the absolute value of the second operand [1].\n\nThe floor division and modulo operators are connected by the following\nidentity: "x == (x//y)*y + (x%y)".  Floor division and modulo are also\nconnected with the built-in function "divmod()": "divmod(x, y) ==\n(x//y, x%y)". [2].\n\nIn addition to performing the modulo operation on numbers, the "%"\noperator is also overloaded by string objects to perform old-style\nstring formatting (also known as interpolation).  The syntax for\nstring formatting is described in the Python Library Reference,\nsection *printf-style String Formatting*.\n\nThe floor division operator, the modulo operator, and the "divmod()"\nfunction are not defined for complex numbers.  Instead, convert to a\nfloating point number using the "abs()" function if appropriate.\n\nThe "+" (addition) operator yields the sum of its arguments.  The\narguments must either both be numbers or both be sequences of the same\ntype.  In the former case, the numbers are converted to a common type\nand then added together. In the latter case, the sequences are\nconcatenated.\n\nThe "-" (subtraction) operator yields the difference of its arguments.\nThe numeric arguments are first converted to a common type.\n',
  'bitwise': '\nBinary bitwise operations\n*************************\n\nEach of the three bitwise operations has a different priority level:\n\n   and_expr ::= shift_expr | and_expr "&" shift_expr\n   xor_expr ::= and_expr | xor_expr "^" and_expr\n   or_expr  ::= xor_expr | or_expr "|" xor_expr\n\nThe "&" operator yields the bitwise AND of its arguments, which must\nbe integers.\n\nThe "^" operator yields the bitwise XOR (exclusive OR) of its\narguments, which must be integers.\n\nThe "|" operator yields the bitwise (inclusive) OR of its arguments,\nwhich must be integers.\n',
  'bltin-code-objects': '\nCode Objects\n************\n\nCode objects are used by the implementation to represent "pseudo-\ncompiled" executable Python code such as a function body. They differ\nfrom function objects because they don\'t contain a reference to their\nglobal execution environment.  Code objects are returned by the built-\nin "compile()" function and can be extracted from function objects\nthrough their "__code__" attribute. See also the "code" module.\n\nA code object can be executed or evaluated by passing it (instead of a\nsource string) to the "exec()" or "eval()"  built-in functions.\n\nSee *The standard type hierarchy* for more information.\n',
  'bltin-ellipsis-object': '\nThe Ellipsis Object\n*******************\n\nThis object is commonly used by slicing (see *Slicings*).  It supports\nno special operations.  There is exactly one ellipsis object, named\n"Ellipsis" (a built-in name).  "type(Ellipsis)()" produces the\n"Ellipsis" singleton.\n\nIt is written as "Ellipsis" or "...".\n',
  'bltin-null-object': '\nThe Null Object\n***************\n\nThis object is returned by functions that don\'t explicitly return a\nvalue.  It supports no special operations.  There is exactly one null\nobject, named "None" (a built-in name).  "type(None)()" produces the\nsame singleton.\n\nIt is written as "None".\n',
  'bltin-type-objects': '\nType Objects\n************\n\nType objects represent the various object types.  An object\'s type is\naccessed by the built-in function "type()".  There are no special\noperations on types.  The standard module "types" defines names for\nall standard built-in types.\n\nTypes are written like this: "<class \'int\'>".\n',
- 'booleans': '\nBoolean operations\n******************\n\n   or_test  ::= and_test | or_test "or" and_test\n   and_test ::= not_test | and_test "and" not_test\n   not_test ::= comparison | "not" not_test\n\nIn the context of Boolean operations, and also when expressions are\nused by control flow statements, the following values are interpreted\nas false: "False", "None", numeric zero of all types, and empty\nstrings and containers (including strings, tuples, lists,\ndictionaries, sets and frozensets).  All other values are interpreted\nas true.  User-defined objects can customize their truth value by\nproviding a "__bool__()" method.\n\nThe operator "not" yields "True" if its argument is false, "False"\notherwise.\n\nThe expression "x and y" first evaluates *x*; if *x* is false, its\nvalue is returned; otherwise, *y* is evaluated and the resulting value\nis returned.\n\nThe expression "x or y" first evaluates *x*; if *x* is true, its value\nis returned; otherwise, *y* is evaluated and the resulting value is\nreturned.\n\n(Note that neither "and" nor "or" restrict the value and type they\nreturn to "False" and "True", but rather return the last evaluated\nargument.  This is sometimes useful, e.g., if "s" is a string that\nshould be replaced by a default value if it is empty, the expression\n"s or \'foo\'" yields the desired value.  Because "not" has to invent a\nvalue anyway, it does not bother to return a value of the same type as\nits argument, so e.g., "not \'foo\'" yields "False", not "\'\'".)\n',
+ 'booleans': '\nBoolean operations\n******************\n\n   or_test  ::= and_test | or_test "or" and_test\n   and_test ::= not_test | and_test "and" not_test\n   not_test ::= comparison | "not" not_test\n\nIn the context of Boolean operations, and also when expressions are\nused by control flow statements, the following values are interpreted\nas false: "False", "None", numeric zero of all types, and empty\nstrings and containers (including strings, tuples, lists,\ndictionaries, sets and frozensets).  All other values are interpreted\nas true.  User-defined objects can customize their truth value by\nproviding a "__bool__()" method.\n\nThe operator "not" yields "True" if its argument is false, "False"\notherwise.\n\nThe expression "x and y" first evaluates *x*; if *x* is false, its\nvalue is returned; otherwise, *y* is evaluated and the resulting value\nis returned.\n\nThe expression "x or y" first evaluates *x*; if *x* is true, its value\nis returned; otherwise, *y* is evaluated and the resulting value is\nreturned.\n\n(Note that neither "and" nor "or" restrict the value and type they\nreturn to "False" and "True", but rather return the last evaluated\nargument.  This is sometimes useful, e.g., if "s" is a string that\nshould be replaced by a default value if it is empty, the expression\n"s or \'foo\'" yields the desired value.  Because "not" has to create a\nnew value, it returns a boolean value regardless of the type of its\nargument (for example, "not \'foo\'" produces "False" rather than "\'\'".)\n',
  'break': '\nThe "break" statement\n*********************\n\n   break_stmt ::= "break"\n\n"break" may only occur syntactically nested in a "for" or "while"\nloop, but not nested in a function or class definition within that\nloop.\n\nIt terminates the nearest enclosing loop, skipping the optional "else"\nclause if the loop has one.\n\nIf a "for" loop is terminated by "break", the loop control target\nkeeps its current value.\n\nWhen "break" passes control out of a "try" statement with a "finally"\nclause, that "finally" clause is executed before really leaving the\nloop.\n',
  'callable-types': '\nEmulating callable objects\n**************************\n\nobject.__call__(self[, args...])\n\n   Called when the instance is "called" as a function; if this method\n   is defined, "x(arg1, arg2, ...)" is a shorthand for\n   "x.__call__(arg1, arg2, ...)".\n',
- 'calls': '\nCalls\n*****\n\nA call calls a callable object (e.g., a *function*) with a possibly\nempty series of *arguments*:\n\n   call                 ::= primary "(" [argument_list [","] | comprehension] ")"\n   argument_list        ::= positional_arguments ["," keyword_arguments]\n                       ["," "*" expression] ["," keyword_arguments]\n                       ["," "**" expression]\n                     | keyword_arguments ["," "*" expression]\n                       ["," keyword_arguments] ["," "**" expression]\n                     | "*" expression ["," keyword_arguments] ["," "**" expression]\n                     | "**" expression\n   positional_arguments ::= expression ("," expression)*\n   keyword_arguments    ::= keyword_item ("," keyword_item)*\n   keyword_item         ::= identifier "=" expression\n\nA trailing comma may be present after the positional and keyword\narguments but does not affect the semantics.\n\nThe primary must evaluate to a callable object (user-defined\nfunctions, built-in functions, methods of built-in objects, class\nobjects, methods of class instances, and all objects having a\n"__call__()" method are callable).  All argument expressions are\nevaluated before the call is attempted.  Please refer to section\n*Function definitions* for the syntax of formal *parameter* lists.\n\nIf keyword arguments are present, they are first converted to\npositional arguments, as follows.  First, a list of unfilled slots is\ncreated for the formal parameters.  If there are N positional\narguments, they are placed in the first N slots.  Next, for each\nkeyword argument, the identifier is used to determine the\ncorresponding slot (if the identifier is the same as the first formal\nparameter name, the first slot is used, and so on).  If the slot is\nalready filled, a "TypeError" exception is raised. Otherwise, the\nvalue of the argument is placed in the slot, filling it (even if the\nexpression is "None", it fills the slot).  When all arguments have\nbeen processed, the slots that are still unfilled are filled with the\ncorresponding default value from the function definition.  (Default\nvalues are calculated, once, when the function is defined; thus, a\nmutable object such as a list or dictionary used as default value will\nbe shared by all calls that don\'t specify an argument value for the\ncorresponding slot; this should usually be avoided.)  If there are any\nunfilled slots for which no default value is specified, a "TypeError"\nexception is raised.  Otherwise, the list of filled slots is used as\nthe argument list for the call.\n\n**CPython implementation detail:** An implementation may provide\nbuilt-in functions whose positional parameters do not have names, even\nif they are \'named\' for the purpose of documentation, and which\ntherefore cannot be supplied by keyword.  In CPython, this is the case\nfor functions implemented in C that use "PyArg_ParseTuple()" to parse\ntheir arguments.\n\nIf there are more positional arguments than there are formal parameter\nslots, a "TypeError" exception is raised, unless a formal parameter\nusing the syntax "*identifier" is present; in this case, that formal\nparameter receives a tuple containing the excess positional arguments\n(or an empty tuple if there were no excess positional arguments).\n\nIf any keyword argument does not correspond to a formal parameter\nname, a "TypeError" exception is raised, unless a formal parameter\nusing the syntax "**identifier" is present; in this case, that formal\nparameter receives a dictionary containing the excess keyword\narguments (using the keywords as keys and the argument values as\ncorresponding values), or a (new) empty dictionary if there were no\nexcess keyword arguments.\n\nIf the syntax "*expression" appears in the function call, "expression"\nmust evaluate to an iterable.  Elements from this iterable are treated\nas if they were additional positional arguments; if there are\npositional arguments *x1*, ..., *xN*, and "expression" evaluates to a\nsequence *y1*, ..., *yM*, this is equivalent to a call with M+N\npositional arguments *x1*, ..., *xN*, *y1*, ..., *yM*.\n\nA consequence of this is that although the "*expression" syntax may\nappear *after* some keyword arguments, it is processed *before* the\nkeyword arguments (and the "**expression" argument, if any -- see\nbelow).  So:\n\n   >>> def f(a, b):\n   ...  print(a, b)\n   ...\n   >>> f(b=1, *(2,))\n   2 1\n   >>> f(a=1, *(2,))\n   Traceback (most recent call last):\n     File "<stdin>", line 1, in ?\n   TypeError: f() got multiple values for keyword argument \'a\'\n   >>> f(1, *(2,))\n   1 2\n\nIt is unusual for both keyword arguments and the "*expression" syntax\nto be used in the same call, so in practice this confusion does not\narise.\n\nIf the syntax "**expression" appears in the function call,\n"expression" must evaluate to a mapping, the contents of which are\ntreated as additional keyword arguments.  In the case of a keyword\nappearing in both "expression" and as an explicit keyword argument, a\n"TypeError" exception is raised.\n\nFormal parameters using the syntax "*identifier" or "**identifier"\ncannot be used as positional argument slots or as keyword argument\nnames.\n\nA call always returns some value, possibly "None", unless it raises an\nexception.  How this value is computed depends on the type of the\ncallable object.\n\nIf it is---\n\na user-defined function:\n   The code block for the function is executed, passing it the\n   argument list.  The first thing the code block will do is bind the\n   formal parameters to the arguments; this is described in section\n   *Function definitions*.  When the code block executes a "return"\n   statement, this specifies the return value of the function call.\n\na built-in function or method:\n   The result is up to the interpreter; see *Built-in Functions* for\n   the descriptions of built-in functions and methods.\n\na class object:\n   A new instance of that class is returned.\n\na class instance method:\n   The corresponding user-defined function is called, with an argument\n   list that is one longer than the argument list of the call: the\n   instance becomes the first argument.\n\na class instance:\n   The class must define a "__call__()" method; the effect is then the\n   same as if that method was called.\n',
+ 'calls': '\nCalls\n*****\n\nA call calls a callable object (e.g., a *function*) with a possibly\nempty series of *arguments*:\n\n   call                 ::= primary "(" [argument_list [","] | comprehension] ")"\n   argument_list        ::= positional_arguments ["," keyword_arguments]\n                       ["," "*" expression] ["," keyword_arguments]\n                       ["," "**" expression]\n                     | keyword_arguments ["," "*" expression]\n                       ["," keyword_arguments] ["," "**" expression]\n                     | "*" expression ["," keyword_arguments] ["," "**" expression]\n                     | "**" expression\n   positional_arguments ::= expression ("," expression)*\n   keyword_arguments    ::= keyword_item ("," keyword_item)*\n   keyword_item         ::= identifier "=" expression\n\nAn optional trailing comma may be present after the positional and\nkeyword arguments but does not affect the semantics.\n\nThe primary must evaluate to a callable object (user-defined\nfunctions, built-in functions, methods of built-in objects, class\nobjects, methods of class instances, and all objects having a\n"__call__()" method are callable).  All argument expressions are\nevaluated before the call is attempted.  Please refer to section\n*Function definitions* for the syntax of formal *parameter* lists.\n\nIf keyword arguments are present, they are first converted to\npositional arguments, as follows.  First, a list of unfilled slots is\ncreated for the formal parameters.  If there are N positional\narguments, they are placed in the first N slots.  Next, for each\nkeyword argument, the identifier is used to determine the\ncorresponding slot (if the identifier is the same as the first formal\nparameter name, the first slot is used, and so on).  If the slot is\nalready filled, a "TypeError" exception is raised. Otherwise, the\nvalue of the argument is placed in the slot, filling it (even if the\nexpression is "None", it fills the slot).  When all arguments have\nbeen processed, the slots that are still unfilled are filled with the\ncorresponding default value from the function definition.  (Default\nvalues are calculated, once, when the function is defined; thus, a\nmutable object such as a list or dictionary used as default value will\nbe shared by all calls that don\'t specify an argument value for the\ncorresponding slot; this should usually be avoided.)  If there are any\nunfilled slots for which no default value is specified, a "TypeError"\nexception is raised.  Otherwise, the list of filled slots is used as\nthe argument list for the call.\n\n**CPython implementation detail:** An implementation may provide\nbuilt-in functions whose positional parameters do not have names, even\nif they are \'named\' for the purpose of documentation, and which\ntherefore cannot be supplied by keyword.  In CPython, this is the case\nfor functions implemented in C that use "PyArg_ParseTuple()" to parse\ntheir arguments.\n\nIf there are more positional arguments than there are formal parameter\nslots, a "TypeError" exception is raised, unless a formal parameter\nusing the syntax "*identifier" is present; in this case, that formal\nparameter receives a tuple containing the excess positional arguments\n(or an empty tuple if there were no excess positional arguments).\n\nIf any keyword argument does not correspond to a formal parameter\nname, a "TypeError" exception is raised, unless a formal parameter\nusing the syntax "**identifier" is present; in this case, that formal\nparameter receives a dictionary containing the excess keyword\narguments (using the keywords as keys and the argument values as\ncorresponding values), or a (new) empty dictionary if there were no\nexcess keyword arguments.\n\nIf the syntax "*expression" appears in the function call, "expression"\nmust evaluate to an iterable.  Elements from this iterable are treated\nas if they were additional positional arguments; if there are\npositional arguments *x1*, ..., *xN*, and "expression" evaluates to a\nsequence *y1*, ..., *yM*, this is equivalent to a call with M+N\npositional arguments *x1*, ..., *xN*, *y1*, ..., *yM*.\n\nA consequence of this is that although the "*expression" syntax may\nappear *after* some keyword arguments, it is processed *before* the\nkeyword arguments (and the "**expression" argument, if any -- see\nbelow).  So:\n\n   >>> def f(a, b):\n   ...  print(a, b)\n   ...\n   >>> f(b=1, *(2,))\n   2 1\n   >>> f(a=1, *(2,))\n   Traceback (most recent call last):\n     File "<stdin>", line 1, in ?\n   TypeError: f() got multiple values for keyword argument \'a\'\n   >>> f(1, *(2,))\n   1 2\n\nIt is unusual for both keyword arguments and the "*expression" syntax\nto be used in the same call, so in practice this confusion does not\narise.\n\nIf the syntax "**expression" appears in the function call,\n"expression" must evaluate to a mapping, the contents of which are\ntreated as additional keyword arguments.  In the case of a keyword\nappearing in both "expression" and as an explicit keyword argument, a\n"TypeError" exception is raised.\n\nFormal parameters using the syntax "*identifier" or "**identifier"\ncannot be used as positional argument slots or as keyword argument\nnames.\n\nA call always returns some value, possibly "None", unless it raises an\nexception.  How this value is computed depends on the type of the\ncallable object.\n\nIf it is---\n\na user-defined function:\n   The code block for the function is executed, passing it the\n   argument list.  The first thing the code block will do is bind the\n   formal parameters to the arguments; this is described in section\n   *Function definitions*.  When the code block executes a "return"\n   statement, this specifies the return value of the function call.\n\na built-in function or method:\n   The result is up to the interpreter; see *Built-in Functions* for\n   the descriptions of built-in functions and methods.\n\na class object:\n   A new instance of that class is returned.\n\na class instance method:\n   The corresponding user-defined function is called, with an argument\n   list that is one longer than the argument list of the call: the\n   instance becomes the first argument.\n\na class instance:\n   The class must define a "__call__()" method; the effect is then the\n   same as if that method was called.\n',
  'class': '\nClass definitions\n*****************\n\nA class definition defines a class object (see section *The standard\ntype hierarchy*):\n\n   classdef    ::= [decorators] "class" classname [inheritance] ":" suite\n   inheritance ::= "(" [parameter_list] ")"\n   classname   ::= identifier\n\nA class definition is an executable statement.  The inheritance list\nusually gives a list of base classes (see *Customizing class creation*\nfor more advanced uses), so each item in the list should evaluate to a\nclass object which allows subclassing.  Classes without an inheritance\nlist inherit, by default, from the base class "object"; hence,\n\n   class Foo:\n       pass\n\nis equivalent to\n\n   class Foo(object):\n       pass\n\nThe class\'s suite is then executed in a new execution frame (see\n*Naming and binding*), using a newly created local namespace and the\noriginal global namespace. (Usually, the suite contains mostly\nfunction definitions.)  When the class\'s suite finishes execution, its\nexecution frame is discarded but its local namespace is saved. [4] A\nclass object is then created using the inheritance list for the base\nclasses and the saved local namespace for the attribute dictionary.\nThe class name is bound to this class object in the original local\nnamespace.\n\nClass creation can be customized heavily using *metaclasses*.\n\nClasses can also be decorated: just like when decorating functions,\n\n   @f1(arg)\n   @f2\n   class Foo: pass\n\nis equivalent to\n\n   class Foo: pass\n   Foo = f1(arg)(f2(Foo))\n\nThe evaluation rules for the decorator expressions are the same as for\nfunction decorators.  The result must be a class object, which is then\nbound to the class name.\n\n**Programmer\'s note:** Variables defined in the class definition are\nclass attributes; they are shared by instances.  Instance attributes\ncan be set in a method with "self.name = value".  Both class and\ninstance attributes are accessible through the notation ""self.name"",\nand an instance attribute hides a class attribute with the same name\nwhen accessed in this way.  Class attributes can be used as defaults\nfor instance attributes, but using mutable values there can lead to\nunexpected results.  *Descriptors* can be used to create instance\nvariables with different implementation details.\n\nSee also: **PEP 3115** - Metaclasses in Python 3 **PEP 3129** -\n  Class Decorators\n\n-[ Footnotes ]-\n\n[1] The exception is propagated to the invocation stack unless\n    there is a "finally" clause which happens to raise another\n    exception. That new exception causes the old one to be lost.\n\n[2] Currently, control "flows off the end" except in the case of\n    an exception or the execution of a "return", "continue", or\n    "break" statement.\n\n[3] A string literal appearing as the first statement in the\n    function body is transformed into the function\'s "__doc__"\n    attribute and therefore the function\'s *docstring*.\n\n[4] A string literal appearing as the first statement in the class\n    body is transformed into the namespace\'s "__doc__" item and\n    therefore the class\'s *docstring*.\n',
- 'comparisons': '\nComparisons\n***********\n\nUnlike C, all comparison operations in Python have the same priority,\nwhich is lower than that of any arithmetic, shifting or bitwise\noperation.  Also unlike C, expressions like "a < b < c" have the\ninterpretation that is conventional in mathematics:\n\n   comparison    ::= or_expr ( comp_operator or_expr )*\n   comp_operator ::= "<" | ">" | "==" | ">=" | "<=" | "!="\n                     | "is" ["not"] | ["not"] "in"\n\nComparisons yield boolean values: "True" or "False".\n\nComparisons can be chained arbitrarily, e.g., "x < y <= z" is\nequivalent to "x < y and y <= z", except that "y" is evaluated only\nonce (but in both cases "z" is not evaluated at all when "x < y" is\nfound to be false).\n\nFormally, if *a*, *b*, *c*, ..., *y*, *z* are expressions and *op1*,\n*op2*, ..., *opN* are comparison operators, then "a op1 b op2 c ... y\nopN z" is equivalent to "a op1 b and b op2 c and ... y opN z", except\nthat each expression is evaluated at most once.\n\nNote that "a op1 b op2 c" doesn\'t imply any kind of comparison between\n*a* and *c*, so that, e.g., "x < y > z" is perfectly legal (though\nperhaps not pretty).\n\nThe operators "<", ">", "==", ">=", "<=", and "!=" compare the values\nof two objects.  The objects need not have the same type. If both are\nnumbers, they are converted to a common type.  Otherwise, the "==" and\n"!=" operators *always* consider objects of different types to be\nunequal, while the "<", ">", ">=" and "<=" operators raise a\n"TypeError" when comparing objects of different types that do not\nimplement these operators for the given pair of types.  You can\ncontrol comparison behavior of objects of non-built-in types by\ndefining rich comparison methods like "__gt__()", described in section\n*Basic customization*.\n\nComparison of objects of the same type depends on the type:\n\n* Numbers are compared arithmetically.\n\n* The values "float(\'NaN\')" and "Decimal(\'NaN\')" are special. The\n  are identical to themselves, "x is x" but are not equal to\n  themselves, "x != x".  Additionally, comparing any value to a\n  not-a-number value will return "False".  For example, both "3 <\n  float(\'NaN\')" and "float(\'NaN\') < 3" will return "False".\n\n* Bytes objects are compared lexicographically using the numeric\n  values of their elements.\n\n* Strings are compared lexicographically using the numeric\n  equivalents (the result of the built-in function "ord()") of their\n  characters. [3] String and bytes object can\'t be compared!\n\n* Tuples and lists are compared lexicographically using comparison\n  of corresponding elements.  This means that to compare equal, each\n  element must compare equal and the two sequences must be of the same\n  type and have the same length.\n\n  If not equal, the sequences are ordered the same as their first\n  differing elements.  For example, "[1,2,x] <= [1,2,y]" has the same\n  value as "x <= y".  If the corresponding element does not exist, the\n  shorter sequence is ordered first (for example, "[1,2] < [1,2,3]").\n\n* Mappings (dictionaries) compare equal if and only if they have the\n  same "(key, value)" pairs. Order comparisons "(\'<\', \'<=\', \'>=\',\n  \'>\')" raise "TypeError".\n\n* Sets and frozensets define comparison operators to mean subset and\n  superset tests.  Those relations do not define total orderings (the\n  two sets "{1,2}" and {2,3} are not equal, nor subsets of one\n  another, nor supersets of one another).  Accordingly, sets are not\n  appropriate arguments for functions which depend on total ordering.\n  For example, "min()", "max()", and "sorted()" produce undefined\n  results given a list of sets as inputs.\n\n* Most other objects of built-in types compare unequal unless they\n  are the same object; the choice whether one object is considered\n  smaller or larger than another one is made arbitrarily but\n  consistently within one execution of a program.\n\nComparison of objects of the differing types depends on whether either\nof the types provide explicit support for the comparison.  Most\nnumeric types can be compared with one another.  When cross-type\ncomparison is not supported, the comparison method returns\n"NotImplemented".\n\nThe operators "in" and "not in" test for membership.  "x in s"\nevaluates to true if *x* is a member of *s*, and false otherwise.  "x\nnot in s" returns the negation of "x in s".  All built-in sequences\nand set types support this as well as dictionary, for which "in" tests\nwhether a the dictionary has a given key. For container types such as\nlist, tuple, set, frozenset, dict, or collections.deque, the\nexpression "x in y" is equivalent to "any(x is e or x == e for e in\ny)".\n\nFor the string and bytes types, "x in y" is true if and only if *x* is\na substring of *y*.  An equivalent test is "y.find(x) != -1".  Empty\nstrings are always considered to be a substring of any other string,\nso """ in "abc"" will return "True".\n\nFor user-defined classes which define the "__contains__()" method, "x\nin y" is true if and only if "y.__contains__(x)" is true.\n\nFor user-defined classes which do not define "__contains__()" but do\ndefine "__iter__()", "x in y" is true if some value "z" with "x == z"\nis produced while iterating over "y".  If an exception is raised\nduring the iteration, it is as if "in" raised that exception.\n\nLastly, the old-style iteration protocol is tried: if a class defines\n"__getitem__()", "x in y" is true if and only if there is a non-\nnegative integer index *i* such that "x == y[i]", and all lower\ninteger indices do not raise "IndexError" exception.  (If any other\nexception is raised, it is as if "in" raised that exception).\n\nThe operator "not in" is defined to have the inverse true value of\n"in".\n\nThe operators "is" and "is not" test for object identity: "x is y" is\ntrue if and only if *x* and *y* are the same object.  "x is not y"\nyields the inverse truth value. [4]\n',
- 'compound': '\nCompound statements\n*******************\n\nCompound statements contain (groups of) other statements; they affect\nor control the execution of those other statements in some way.  In\ngeneral, compound statements span multiple lines, although in simple\nincarnations a whole compound statement may be contained in one line.\n\nThe "if", "while" and "for" statements implement traditional control\nflow constructs.  "try" specifies exception handlers and/or cleanup\ncode for a group of statements, while the "with" statement allows the\nexecution of initialization and finalization code around a block of\ncode.  Function and class definitions are also syntactically compound\nstatements.\n\nCompound statements consist of one or more \'clauses.\'  A clause\nconsists of a header and a \'suite.\'  The clause headers of a\nparticular compound statement are all at the same indentation level.\nEach clause header begins with a uniquely identifying keyword and ends\nwith a colon.  A suite is a group of statements controlled by a\nclause.  A suite can be one or more semicolon-separated simple\nstatements on the same line as the header, following the header\'s\ncolon, or it can be one or more indented statements on subsequent\nlines.  Only the latter form of suite can contain nested compound\nstatements; the following is illegal, mostly because it wouldn\'t be\nclear to which "if" clause a following "else" clause would belong:\n\n   if test1: if test2: print(x)\n\nAlso note that the semicolon binds tighter than the colon in this\ncontext, so that in the following example, either all or none of the\n"print()" calls are executed:\n\n   if x < y < z: print(x); print(y); print(z)\n\nSummarizing:\n\n   compound_stmt ::= if_stmt\n                     | while_stmt\n                     | for_stmt\n                     | try_stmt\n                     | with_stmt\n                     | funcdef\n                     | classdef\n   suite         ::= stmt_list NEWLINE | NEWLINE INDENT statement+ DEDENT\n   statement     ::= stmt_list NEWLINE | compound_stmt\n   stmt_list     ::= simple_stmt (";" simple_stmt)* [";"]\n\nNote that statements always end in a "NEWLINE" possibly followed by a\n"DEDENT".  Also note that optional continuation clauses always begin\nwith a keyword that cannot start a statement, thus there are no\nambiguities (the \'dangling "else"\' problem is solved in Python by\nrequiring nested "if" statements to be indented).\n\nThe formatting of the grammar rules in the following sections places\neach clause on a separate line for clarity.\n\n\nThe "if" statement\n==================\n\nThe "if" statement is used for conditional execution:\n\n   if_stmt ::= "if" expression ":" suite\n               ( "elif" expression ":" suite )*\n               ["else" ":" suite]\n\nIt selects exactly one of the suites by evaluating the expressions one\nby one until one is found to be true (see section *Boolean operations*\nfor the definition of true and false); then that suite is executed\n(and no other part of the "if" statement is executed or evaluated).\nIf all expressions are false, the suite of the "else" clause, if\npresent, is executed.\n\n\nThe "while" statement\n=====================\n\nThe "while" statement is used for repeated execution as long as an\nexpression is true:\n\n   while_stmt ::= "while" expression ":" suite\n                  ["else" ":" suite]\n\nThis repeatedly tests the expression and, if it is true, executes the\nfirst suite; if the expression is false (which may be the first time\nit is tested) the suite of the "else" clause, if present, is executed\nand the loop terminates.\n\nA "break" statement executed in the first suite terminates the loop\nwithout executing the "else" clause\'s suite.  A "continue" statement\nexecuted in the first suite skips the rest of the suite and goes back\nto testing the expression.\n\n\nThe "for" statement\n===================\n\nThe "for" statement is used to iterate over the elements of a sequence\n(such as a string, tuple or list) or other iterable object:\n\n   for_stmt ::= "for" target_list "in" expression_list ":" suite\n                ["else" ":" suite]\n\nThe expression list is evaluated once; it should yield an iterable\nobject.  An iterator is created for the result of the\n"expression_list".  The suite is then executed once for each item\nprovided by the iterator, in the order of ascending indices.  Each\nitem in turn is assigned to the target list using the standard rules\nfor assignments (see *Assignment statements*), and then the suite is\nexecuted.  When the items are exhausted (which is immediately when the\nsequence is empty or an iterator raises a "StopIteration" exception),\nthe suite in the "else" clause, if present, is executed, and the loop\nterminates.\n\nA "break" statement executed in the first suite terminates the loop\nwithout executing the "else" clause\'s suite.  A "continue" statement\nexecuted in the first suite skips the rest of the suite and continues\nwith the next item, or with the "else" clause if there was no next\nitem.\n\nThe suite may assign to the variable(s) in the target list; this does\nnot affect the next item assigned to it.\n\nNames in the target list are not deleted when the loop is finished,\nbut if the sequence is empty, it will not have been assigned to at all\nby the loop.  Hint: the built-in function "range()" returns an\niterator of integers suitable to emulate the effect of Pascal\'s "for i\n:= a to b do"; e.g., "list(range(3))" returns the list "[0, 1, 2]".\n\nNote: There is a subtlety when the sequence is being modified by the\n  loop (this can only occur for mutable sequences, i.e. lists).  An\n  internal counter is used to keep track of which item is used next,\n  and this is incremented on each iteration.  When this counter has\n  reached the length of the sequence the loop terminates.  This means\n  that if the suite deletes the current (or a previous) item from the\n  sequence, the next item will be skipped (since it gets the index of\n  the current item which has already been treated).  Likewise, if the\n  suite inserts an item in the sequence before the current item, the\n  current item will be treated again the next time through the loop.\n  This can lead to nasty bugs that can be avoided by making a\n  temporary copy using a slice of the whole sequence, e.g.,\n\n     for x in a[:]:\n         if x < 0: a.remove(x)\n\n\nThe "try" statement\n===================\n\nThe "try" statement specifies exception handlers and/or cleanup code\nfor a group of statements:\n\n   try_stmt  ::= try1_stmt | try2_stmt\n   try1_stmt ::= "try" ":" suite\n                 ("except" [expression ["as" target]] ":" suite)+\n                 ["else" ":" suite]\n                 ["finally" ":" suite]\n   try2_stmt ::= "try" ":" suite\n                 "finally" ":" suite\n\nThe "except" clause(s) specify one or more exception handlers. When no\nexception occurs in the "try" clause, no exception handler is\nexecuted. When an exception occurs in the "try" suite, a search for an\nexception handler is started.  This search inspects the except clauses\nin turn until one is found that matches the exception.  An expression-\nless except clause, if present, must be last; it matches any\nexception.  For an except clause with an expression, that expression\nis evaluated, and the clause matches the exception if the resulting\nobject is "compatible" with the exception.  An object is compatible\nwith an exception if it is the class or a base class of the exception\nobject or a tuple containing an item compatible with the exception.\n\nIf no except clause matches the exception, the search for an exception\nhandler continues in the surrounding code and on the invocation stack.\n[1]\n\nIf the evaluation of an expression in the header of an except clause\nraises an exception, the original search for a handler is canceled and\na search starts for the new exception in the surrounding code and on\nthe call stack (it is treated as if the entire "try" statement raised\nthe exception).\n\nWhen a matching except clause is found, the exception is assigned to\nthe target specified after the "as" keyword in that except clause, if\npresent, and the except clause\'s suite is executed.  All except\nclauses must have an executable block.  When the end of this block is\nreached, execution continues normally after the entire try statement.\n(This means that if two nested handlers exist for the same exception,\nand the exception occurs in the try clause of the inner handler, the\nouter handler will not handle the exception.)\n\nWhen an exception has been assigned using "as target", it is cleared\nat the end of the except clause.  This is as if\n\n   except E as N:\n       foo\n\nwas translated to\n\n   except E as N:\n       try:\n           foo\n       finally:\n           del N\n\nThis means the exception must be assigned to a different name to be\nable to refer to it after the except clause.  Exceptions are cleared\nbecause with the traceback attached to them, they form a reference\ncycle with the stack frame, keeping all locals in that frame alive\nuntil the next garbage collection occurs.\n\nBefore an except clause\'s suite is executed, details about the\nexception are stored in the "sys" module and can be access via\n"sys.exc_info()". "sys.exc_info()" returns a 3-tuple consisting of the\nexception class, the exception instance and a traceback object (see\nsection *The standard type hierarchy*) identifying the point in the\nprogram where the exception occurred.  "sys.exc_info()" values are\nrestored to their previous values (before the call) when returning\nfrom a function that handled an exception.\n\nThe optional "else" clause is executed if and when control flows off\nthe end of the "try" clause. [2] Exceptions in the "else" clause are\nnot handled by the preceding "except" clauses.\n\nIf "finally" is present, it specifies a \'cleanup\' handler.  The "try"\nclause is executed, including any "except" and "else" clauses.  If an\nexception occurs in any of the clauses and is not handled, the\nexception is temporarily saved. The "finally" clause is executed.  If\nthere is a saved exception it is re-raised at the end of the "finally"\nclause.  If the "finally" clause raises another exception, the saved\nexception is set as the context of the new exception. If the "finally"\nclause executes a "return" or "break" statement, the saved exception\nis discarded:\n\n   def f():\n       try:\n           1/0\n       finally:\n           return 42\n\n   >>> f()\n   42\n\nThe exception information is not available to the program during\nexecution of the "finally" clause.\n\nWhen a "return", "break" or "continue" statement is executed in the\n"try" suite of a "try"..."finally" statement, the "finally" clause is\nalso executed \'on the way out.\' A "continue" statement is illegal in\nthe "finally" clause. (The reason is a problem with the current\nimplementation --- this restriction may be lifted in the future).\n\nAdditional information on exceptions can be found in section\n*Exceptions*, and information on using the "raise" statement to\ngenerate exceptions may be found in section *The raise statement*.\n\n\nThe "with" statement\n====================\n\nThe "with" statement is used to wrap the execution of a block with\nmethods defined by a context manager (see section *With Statement\nContext Managers*). This allows common "try"..."except"..."finally"\nusage patterns to be encapsulated for convenient reuse.\n\n   with_stmt ::= "with" with_item ("," with_item)* ":" suite\n   with_item ::= expression ["as" target]\n\nThe execution of the "with" statement with one "item" proceeds as\nfollows:\n\n1. The context expression (the expression given in the "with_item")\n   is evaluated to obtain a context manager.\n\n2. The context manager\'s "__exit__()" is loaded for later use.\n\n3. The context manager\'s "__enter__()" method is invoked.\n\n4. If a target was included in the "with" statement, the return\n   value from "__enter__()" is assigned to it.\n\n   Note: The "with" statement guarantees that if the "__enter__()"\n     method returns without an error, then "__exit__()" will always be\n     called. Thus, if an error occurs during the assignment to the\n     target list, it will be treated the same as an error occurring\n     within the suite would be. See step 6 below.\n\n5. The suite is executed.\n\n6. The context manager\'s "__exit__()" method is invoked.  If an\n   exception caused the suite to be exited, its type, value, and\n   traceback are passed as arguments to "__exit__()". Otherwise, three\n   "None" arguments are supplied.\n\n   If the suite was exited due to an exception, and the return value\n   from the "__exit__()" method was false, the exception is reraised.\n   If the return value was true, the exception is suppressed, and\n   execution continues with the statement following the "with"\n   statement.\n\n   If the suite was exited for any reason other than an exception, the\n   return value from "__exit__()" is ignored, and execution proceeds\n   at the normal location for the kind of exit that was taken.\n\nWith more than one item, the context managers are processed as if\nmultiple "with" statements were nested:\n\n   with A() as a, B() as b:\n       suite\n\nis equivalent to\n\n   with A() as a:\n       with B() as b:\n           suite\n\nChanged in version 3.1: Support for multiple context expressions.\n\nSee also: **PEP 0343** - The "with" statement\n\n     The specification, background, and examples for the Python "with"\n     statement.\n\n\nFunction definitions\n====================\n\nA function definition defines a user-defined function object (see\nsection *The standard type hierarchy*):\n\n   funcdef        ::= [decorators] "def" funcname "(" [parameter_list] ")" ["->" expression] ":" suite\n   decorators     ::= decorator+\n   decorator      ::= "@" dotted_name ["(" [parameter_list [","]] ")"] NEWLINE\n   dotted_name    ::= identifier ("." identifier)*\n   parameter_list ::= (defparameter ",")*\n                      ( "*" [parameter] ("," defparameter)* ["," "**" parameter]\n                      | "**" parameter\n                      | defparameter [","] )\n   parameter      ::= identifier [":" expression]\n   defparameter   ::= parameter ["=" expression]\n   funcname       ::= identifier\n\nA function definition is an executable statement.  Its execution binds\nthe function name in the current local namespace to a function object\n(a wrapper around the executable code for the function).  This\nfunction object contains a reference to the current global namespace\nas the global namespace to be used when the function is called.\n\nThe function definition does not execute the function body; this gets\nexecuted only when the function is called. [3]\n\nA function definition may be wrapped by one or more *decorator*\nexpressions. Decorator expressions are evaluated when the function is\ndefined, in the scope that contains the function definition.  The\nresult must be a callable, which is invoked with the function object\nas the only argument. The returned value is bound to the function name\ninstead of the function object.  Multiple decorators are applied in\nnested fashion. For example, the following code\n\n   @f1(arg)\n   @f2\n   def func(): pass\n\nis equivalent to\n\n   def func(): pass\n   func = f1(arg)(f2(func))\n\nWhen one or more *parameters* have the form *parameter* "="\n*expression*, the function is said to have "default parameter values."\nFor a parameter with a default value, the corresponding *argument* may\nbe omitted from a call, in which case the parameter\'s default value is\nsubstituted.  If a parameter has a default value, all following\nparameters up until the ""*"" must also have a default value --- this\nis a syntactic restriction that is not expressed by the grammar.\n\n**Default parameter values are evaluated when the function definition\nis executed.** This means that the expression is evaluated once, when\nthe function is defined, and that the same "pre-computed" value is\nused for each call.  This is especially important to understand when a\ndefault parameter is a mutable object, such as a list or a dictionary:\nif the function modifies the object (e.g. by appending an item to a\nlist), the default value is in effect modified. This is generally not\nwhat was intended.  A way around this is to use "None" as the default,\nand explicitly test for it in the body of the function, e.g.:\n\n   def whats_on_the_telly(penguin=None):\n       if penguin is None:\n           penguin = []\n       penguin.append("property of the zoo")\n       return penguin\n\nFunction call semantics are described in more detail in section\n*Calls*. A function call always assigns values to all parameters\nmentioned in the parameter list, either from position arguments, from\nkeyword arguments, or from default values.  If the form\n""*identifier"" is present, it is initialized to a tuple receiving any\nexcess positional parameters, defaulting to the empty tuple.  If the\nform ""**identifier"" is present, it is initialized to a new\ndictionary receiving any excess keyword arguments, defaulting to a new\nempty dictionary. Parameters after ""*"" or ""*identifier"" are\nkeyword-only parameters and may only be passed used keyword arguments.\n\nParameters may have annotations of the form "": expression"" following\nthe parameter name.  Any parameter may have an annotation even those\nof the form "*identifier" or "**identifier".  Functions may have\n"return" annotation of the form ""-> expression"" after the parameter\nlist.  These annotations can be any valid Python expression and are\nevaluated when the function definition is executed.  Annotations may\nbe evaluated in a different order than they appear in the source code.\nThe presence of annotations does not change the semantics of a\nfunction.  The annotation values are available as values of a\ndictionary keyed by the parameters\' names in the "__annotations__"\nattribute of the function object.\n\nIt is also possible to create anonymous functions (functions not bound\nto a name), for immediate use in expressions.  This uses lambda\nexpressions, described in section *Lambdas*.  Note that the lambda\nexpression is merely a shorthand for a simplified function definition;\na function defined in a ""def"" statement can be passed around or\nassigned to another name just like a function defined by a lambda\nexpression.  The ""def"" form is actually more powerful since it\nallows the execution of multiple statements and annotations.\n\n**Programmer\'s note:** Functions are first-class objects.  A ""def""\nstatement executed inside a function definition defines a local\nfunction that can be returned or passed around.  Free variables used\nin the nested function can access the local variables of the function\ncontaining the def.  See section *Naming and binding* for details.\n\nSee also: **PEP 3107** - Function Annotations\n\n     The original specification for function annotations.\n\n\nClass definitions\n=================\n\nA class definition defines a class object (see section *The standard\ntype hierarchy*):\n\n   classdef    ::= [decorators] "class" classname [inheritance] ":" suite\n   inheritance ::= "(" [parameter_list] ")"\n   classname   ::= identifier\n\nA class definition is an executable statement.  The inheritance list\nusually gives a list of base classes (see *Customizing class creation*\nfor more advanced uses), so each item in the list should evaluate to a\nclass object which allows subclassing.  Classes without an inheritance\nlist inherit, by default, from the base class "object"; hence,\n\n   class Foo:\n       pass\n\nis equivalent to\n\n   class Foo(object):\n       pass\n\nThe class\'s suite is then executed in a new execution frame (see\n*Naming and binding*), using a newly created local namespace and the\noriginal global namespace. (Usually, the suite contains mostly\nfunction definitions.)  When the class\'s suite finishes execution, its\nexecution frame is discarded but its local namespace is saved. [4] A\nclass object is then created using the inheritance list for the base\nclasses and the saved local namespace for the attribute dictionary.\nThe class name is bound to this class object in the original local\nnamespace.\n\nClass creation can be customized heavily using *metaclasses*.\n\nClasses can also be decorated: just like when decorating functions,\n\n   @f1(arg)\n   @f2\n   class Foo: pass\n\nis equivalent to\n\n   class Foo: pass\n   Foo = f1(arg)(f2(Foo))\n\nThe evaluation rules for the decorator expressions are the same as for\nfunction decorators.  The result must be a class object, which is then\nbound to the class name.\n\n**Programmer\'s note:** Variables defined in the class definition are\nclass attributes; they are shared by instances.  Instance attributes\ncan be set in a method with "self.name = value".  Both class and\ninstance attributes are accessible through the notation ""self.name"",\nand an instance attribute hides a class attribute with the same name\nwhen accessed in this way.  Class attributes can be used as defaults\nfor instance attributes, but using mutable values there can lead to\nunexpected results.  *Descriptors* can be used to create instance\nvariables with different implementation details.\n\nSee also: **PEP 3115** - Metaclasses in Python 3 **PEP 3129** -\n  Class Decorators\n\n-[ Footnotes ]-\n\n[1] The exception is propagated to the invocation stack unless\n    there is a "finally" clause which happens to raise another\n    exception. That new exception causes the old one to be lost.\n\n[2] Currently, control "flows off the end" except in the case of\n    an exception or the execution of a "return", "continue", or\n    "break" statement.\n\n[3] A string literal appearing as the first statement in the\n    function body is transformed into the function\'s "__doc__"\n    attribute and therefore the function\'s *docstring*.\n\n[4] A string literal appearing as the first statement in the class\n    body is transformed into the namespace\'s "__doc__" item and\n    therefore the class\'s *docstring*.\n',
+ 'comparisons': '\nComparisons\n***********\n\nUnlike C, all comparison operations in Python have the same priority,\nwhich is lower than that of any arithmetic, shifting or bitwise\noperation.  Also unlike C, expressions like "a < b < c" have the\ninterpretation that is conventional in mathematics:\n\n   comparison    ::= or_expr ( comp_operator or_expr )*\n   comp_operator ::= "<" | ">" | "==" | ">=" | "<=" | "!="\n                     | "is" ["not"] | ["not"] "in"\n\nComparisons yield boolean values: "True" or "False".\n\nComparisons can be chained arbitrarily, e.g., "x < y <= z" is\nequivalent to "x < y and y <= z", except that "y" is evaluated only\nonce (but in both cases "z" is not evaluated at all when "x < y" is\nfound to be false).\n\nFormally, if *a*, *b*, *c*, ..., *y*, *z* are expressions and *op1*,\n*op2*, ..., *opN* are comparison operators, then "a op1 b op2 c ... y\nopN z" is equivalent to "a op1 b and b op2 c and ... y opN z", except\nthat each expression is evaluated at most once.\n\nNote that "a op1 b op2 c" doesn\'t imply any kind of comparison between\n*a* and *c*, so that, e.g., "x < y > z" is perfectly legal (though\nperhaps not pretty).\n\nThe operators "<", ">", "==", ">=", "<=", and "!=" compare the values\nof two objects.  The objects need not have the same type. If both are\nnumbers, they are converted to a common type.  Otherwise, the "==" and\n"!=" operators *always* consider objects of different types to be\nunequal, while the "<", ">", ">=" and "<=" operators raise a\n"TypeError" when comparing objects of different types that do not\nimplement these operators for the given pair of types.  You can\ncontrol comparison behavior of objects of non-built-in types by\ndefining rich comparison methods like "__gt__()", described in section\n*Basic customization*.\n\nComparison of objects of the same type depends on the type:\n\n* Numbers are compared arithmetically.\n\n* The values "float(\'NaN\')" and "Decimal(\'NaN\')" are special. The\n  are identical to themselves, "x is x" but are not equal to\n  themselves, "x != x".  Additionally, comparing any value to a\n  not-a-number value will return "False".  For example, both "3 <\n  float(\'NaN\')" and "float(\'NaN\') < 3" will return "False".\n\n* Bytes objects are compared lexicographically using the numeric\n  values of their elements.\n\n* Strings are compared lexicographically using the numeric\n  equivalents (the result of the built-in function "ord()") of their\n  characters. [3] String and bytes object can\'t be compared!\n\n* Tuples and lists are compared lexicographically using comparison\n  of corresponding elements.  This means that to compare equal, each\n  element must compare equal and the two sequences must be of the same\n  type and have the same length.\n\n  If not equal, the sequences are ordered the same as their first\n  differing elements.  For example, "[1,2,x] <= [1,2,y]" has the same\n  value as "x <= y".  If the corresponding element does not exist, the\n  shorter sequence is ordered first (for example, "[1,2] < [1,2,3]").\n\n* Mappings (dictionaries) compare equal if and only if they have the\n  same "(key, value)" pairs. Order comparisons "(\'<\', \'<=\', \'>=\',\n  \'>\')" raise "TypeError".\n\n* Sets and frozensets define comparison operators to mean subset and\n  superset tests.  Those relations do not define total orderings (the\n  two sets "{1,2}" and {2,3} are not equal, nor subsets of one\n  another, nor supersets of one another).  Accordingly, sets are not\n  appropriate arguments for functions which depend on total ordering.\n  For example, "min()", "max()", and "sorted()" produce undefined\n  results given a list of sets as inputs.\n\n* Most other objects of built-in types compare unequal unless they\n  are the same object; the choice whether one object is considered\n  smaller or larger than another one is made arbitrarily but\n  consistently within one execution of a program.\n\nComparison of objects of differing types depends on whether either of\nthe types provide explicit support for the comparison.  Most numeric\ntypes can be compared with one another.  When cross-type comparison is\nnot supported, the comparison method returns "NotImplemented".\n\nThe operators "in" and "not in" test for membership.  "x in s"\nevaluates to true if *x* is a member of *s*, and false otherwise.  "x\nnot in s" returns the negation of "x in s".  All built-in sequences\nand set types support this as well as dictionary, for which "in" tests\nwhether the dictionary has a given key. For container types such as\nlist, tuple, set, frozenset, dict, or collections.deque, the\nexpression "x in y" is equivalent to "any(x is e or x == e for e in\ny)".\n\nFor the string and bytes types, "x in y" is true if and only if *x* is\na substring of *y*.  An equivalent test is "y.find(x) != -1".  Empty\nstrings are always considered to be a substring of any other string,\nso """ in "abc"" will return "True".\n\nFor user-defined classes which define the "__contains__()" method, "x\nin y" is true if and only if "y.__contains__(x)" is true.\n\nFor user-defined classes which do not define "__contains__()" but do\ndefine "__iter__()", "x in y" is true if some value "z" with "x == z"\nis produced while iterating over "y".  If an exception is raised\nduring the iteration, it is as if "in" raised that exception.\n\nLastly, the old-style iteration protocol is tried: if a class defines\n"__getitem__()", "x in y" is true if and only if there is a non-\nnegative integer index *i* such that "x == y[i]", and all lower\ninteger indices do not raise "IndexError" exception.  (If any other\nexception is raised, it is as if "in" raised that exception).\n\nThe operator "not in" is defined to have the inverse true value of\n"in".\n\nThe operators "is" and "is not" test for object identity: "x is y" is\ntrue if and only if *x* and *y* are the same object.  "x is not y"\nyields the inverse truth value. [4]\n',
+ 'compound': '\nCompound statements\n*******************\n\nCompound statements contain (groups of) other statements; they affect\nor control the execution of those other statements in some way.  In\ngeneral, compound statements span multiple lines, although in simple\nincarnations a whole compound statement may be contained in one line.\n\nThe "if", "while" and "for" statements implement traditional control\nflow constructs.  "try" specifies exception handlers and/or cleanup\ncode for a group of statements, while the "with" statement allows the\nexecution of initialization and finalization code around a block of\ncode.  Function and class definitions are also syntactically compound\nstatements.\n\nA compound statement consists of one or more \'clauses.\'  A clause\nconsists of a header and a \'suite.\'  The clause headers of a\nparticular compound statement are all at the same indentation level.\nEach clause header begins with a uniquely identifying keyword and ends\nwith a colon.  A suite is a group of statements controlled by a\nclause.  A suite can be one or more semicolon-separated simple\nstatements on the same line as the header, following the header\'s\ncolon, or it can be one or more indented statements on subsequent\nlines.  Only the latter form of a suite can contain nested compound\nstatements; the following is illegal, mostly because it wouldn\'t be\nclear to which "if" clause a following "else" clause would belong:\n\n   if test1: if test2: print(x)\n\nAlso note that the semicolon binds tighter than the colon in this\ncontext, so that in the following example, either all or none of the\n"print()" calls are executed:\n\n   if x < y < z: print(x); print(y); print(z)\n\nSummarizing:\n\n   compound_stmt ::= if_stmt\n                     | while_stmt\n                     | for_stmt\n                     | try_stmt\n                     | with_stmt\n                     | funcdef\n                     | classdef\n   suite         ::= stmt_list NEWLINE | NEWLINE INDENT statement+ DEDENT\n   statement     ::= stmt_list NEWLINE | compound_stmt\n   stmt_list     ::= simple_stmt (";" simple_stmt)* [";"]\n\nNote that statements always end in a "NEWLINE" possibly followed by a\n"DEDENT".  Also note that optional continuation clauses always begin\nwith a keyword that cannot start a statement, thus there are no\nambiguities (the \'dangling "else"\' problem is solved in Python by\nrequiring nested "if" statements to be indented).\n\nThe formatting of the grammar rules in the following sections places\neach clause on a separate line for clarity.\n\n\nThe "if" statement\n==================\n\nThe "if" statement is used for conditional execution:\n\n   if_stmt ::= "if" expression ":" suite\n               ( "elif" expression ":" suite )*\n               ["else" ":" suite]\n\nIt selects exactly one of the suites by evaluating the expressions one\nby one until one is found to be true (see section *Boolean operations*\nfor the definition of true and false); then that suite is executed\n(and no other part of the "if" statement is executed or evaluated).\nIf all expressions are false, the suite of the "else" clause, if\npresent, is executed.\n\n\nThe "while" statement\n=====================\n\nThe "while" statement is used for repeated execution as long as an\nexpression is true:\n\n   while_stmt ::= "while" expression ":" suite\n                  ["else" ":" suite]\n\nThis repeatedly tests the expression and, if it is true, executes the\nfirst suite; if the expression is false (which may be the first time\nit is tested) the suite of the "else" clause, if present, is executed\nand the loop terminates.\n\nA "break" statement executed in the first suite terminates the loop\nwithout executing the "else" clause\'s suite.  A "continue" statement\nexecuted in the first suite skips the rest of the suite and goes back\nto testing the expression.\n\n\nThe "for" statement\n===================\n\nThe "for" statement is used to iterate over the elements of a sequence\n(such as a string, tuple or list) or other iterable object:\n\n   for_stmt ::= "for" target_list "in" expression_list ":" suite\n                ["else" ":" suite]\n\nThe expression list is evaluated once; it should yield an iterable\nobject.  An iterator is created for the result of the\n"expression_list".  The suite is then executed once for each item\nprovided by the iterator, in the order returned by the iterator.  Each\nitem in turn is assigned to the target list using the standard rules\nfor assignments (see *Assignment statements*), and then the suite is\nexecuted.  When the items are exhausted (which is immediately when the\nsequence is empty or an iterator raises a "StopIteration" exception),\nthe suite in the "else" clause, if present, is executed, and the loop\nterminates.\n\nA "break" statement executed in the first suite terminates the loop\nwithout executing the "else" clause\'s suite.  A "continue" statement\nexecuted in the first suite skips the rest of the suite and continues\nwith the next item, or with the "else" clause if there is no next\nitem.\n\nThe for-loop makes assignments to the variables(s) in the target list.\nThis overwrites all previous assignments to those variables including\nthose made in the suite of the for-loop:\n\n   for i in range(10):\n       print(i)\n       i = 5             # this will not affect the for-loop\n                         # because i will be overwritten with the next\n                         # index in the range\n\nNames in the target list are not deleted when the loop is finished,\nbut if the sequence is empty, they will not have been assigned to at\nall by the loop.  Hint: the built-in function "range()" returns an\niterator of integers suitable to emulate the effect of Pascal\'s "for i\n:= a to b do"; e.g., "list(range(3))" returns the list "[0, 1, 2]".\n\nNote: There is a subtlety when the sequence is being modified by the\n  loop (this can only occur for mutable sequences, i.e. lists).  An\n  internal counter is used to keep track of which item is used next,\n  and this is incremented on each iteration.  When this counter has\n  reached the length of the sequence the loop terminates.  This means\n  that if the suite deletes the current (or a previous) item from the\n  sequence, the next item will be skipped (since it gets the index of\n  the current item which has already been treated).  Likewise, if the\n  suite inserts an item in the sequence before the current item, the\n  current item will be treated again the next time through the loop.\n  This can lead to nasty bugs that can be avoided by making a\n  temporary copy using a slice of the whole sequence, e.g.,\n\n     for x in a[:]:\n         if x < 0: a.remove(x)\n\n\nThe "try" statement\n===================\n\nThe "try" statement specifies exception handlers and/or cleanup code\nfor a group of statements:\n\n   try_stmt  ::= try1_stmt | try2_stmt\n   try1_stmt ::= "try" ":" suite\n                 ("except" [expression ["as" identifier]] ":" suite)+\n                 ["else" ":" suite]\n                 ["finally" ":" suite]\n   try2_stmt ::= "try" ":" suite\n                 "finally" ":" suite\n\nThe "except" clause(s) specify one or more exception handlers. When no\nexception occurs in the "try" clause, no exception handler is\nexecuted. When an exception occurs in the "try" suite, a search for an\nexception handler is started.  This search inspects the except clauses\nin turn until one is found that matches the exception.  An expression-\nless except clause, if present, must be last; it matches any\nexception.  For an except clause with an expression, that expression\nis evaluated, and the clause matches the exception if the resulting\nobject is "compatible" with the exception.  An object is compatible\nwith an exception if it is the class or a base class of the exception\nobject or a tuple containing an item compatible with the exception.\n\nIf no except clause matches the exception, the search for an exception\nhandler continues in the surrounding code and on the invocation stack.\n[1]\n\nIf the evaluation of an expression in the header of an except clause\nraises an exception, the original search for a handler is canceled and\na search starts for the new exception in the surrounding code and on\nthe call stack (it is treated as if the entire "try" statement raised\nthe exception).\n\nWhen a matching except clause is found, the exception is assigned to\nthe target specified after the "as" keyword in that except clause, if\npresent, and the except clause\'s suite is executed.  All except\nclauses must have an executable block.  When the end of this block is\nreached, execution continues normally after the entire try statement.\n(This means that if two nested handlers exist for the same exception,\nand the exception occurs in the try clause of the inner handler, the\nouter handler will not handle the exception.)\n\nWhen an exception has been assigned using "as target", it is cleared\nat the end of the except clause.  This is as if\n\n   except E as N:\n       foo\n\nwas translated to\n\n   except E as N:\n       try:\n           foo\n       finally:\n           del N\n\nThis means the exception must be assigned to a different name to be\nable to refer to it after the except clause.  Exceptions are cleared\nbecause with the traceback attached to them, they form a reference\ncycle with the stack frame, keeping all locals in that frame alive\nuntil the next garbage collection occurs.\n\nBefore an except clause\'s suite is executed, details about the\nexception are stored in the "sys" module and can be accessed via\n"sys.exc_info()". "sys.exc_info()" returns a 3-tuple consisting of the\nexception class, the exception instance and a traceback object (see\nsection *The standard type hierarchy*) identifying the point in the\nprogram where the exception occurred.  "sys.exc_info()" values are\nrestored to their previous values (before the call) when returning\nfrom a function that handled an exception.\n\nThe optional "else" clause is executed if and when control flows off\nthe end of the "try" clause. [2] Exceptions in the "else" clause are\nnot handled by the preceding "except" clauses.\n\nIf "finally" is present, it specifies a \'cleanup\' handler.  The "try"\nclause is executed, including any "except" and "else" clauses.  If an\nexception occurs in any of the clauses and is not handled, the\nexception is temporarily saved. The "finally" clause is executed.  If\nthere is a saved exception it is re-raised at the end of the "finally"\nclause.  If the "finally" clause raises another exception, the saved\nexception is set as the context of the new exception. If the "finally"\nclause executes a "return" or "break" statement, the saved exception\nis discarded:\n\n   >>> def f():\n   ...     try:\n   ...         1/0\n   ...     finally:\n   ...         return 42\n   ...\n   >>> f()\n   42\n\nThe exception information is not available to the program during\nexecution of the "finally" clause.\n\nWhen a "return", "break" or "continue" statement is executed in the\n"try" suite of a "try"..."finally" statement, the "finally" clause is\nalso executed \'on the way out.\' A "continue" statement is illegal in\nthe "finally" clause. (The reason is a problem with the current\nimplementation --- this restriction may be lifted in the future).\n\nThe return value of a function is determined by the last "return"\nstatement executed.  Since the "finally" clause always executes, a\n"return" statement executed in the "finally" clause will always be the\nlast one executed:\n\n   >>> def foo():\n   ...     try:\n   ...         return \'try\'\n   ...     finally:\n   ...         return \'finally\'\n   ...\n   >>> foo()\n   \'finally\'\n\nAdditional information on exceptions can be found in section\n*Exceptions*, and information on using the "raise" statement to\ngenerate exceptions may be found in section *The raise statement*.\n\n\nThe "with" statement\n====================\n\nThe "with" statement is used to wrap the execution of a block with\nmethods defined by a context manager (see section *With Statement\nContext Managers*). This allows common "try"..."except"..."finally"\nusage patterns to be encapsulated for convenient reuse.\n\n   with_stmt ::= "with" with_item ("," with_item)* ":" suite\n   with_item ::= expression ["as" target]\n\nThe execution of the "with" statement with one "item" proceeds as\nfollows:\n\n1. The context expression (the expression given in the "with_item")\n   is evaluated to obtain a context manager.\n\n2. The context manager\'s "__exit__()" is loaded for later use.\n\n3. The context manager\'s "__enter__()" method is invoked.\n\n4. If a target was included in the "with" statement, the return\n   value from "__enter__()" is assigned to it.\n\n   Note: The "with" statement guarantees that if the "__enter__()"\n     method returns without an error, then "__exit__()" will always be\n     called. Thus, if an error occurs during the assignment to the\n     target list, it will be treated the same as an error occurring\n     within the suite would be. See step 6 below.\n\n5. The suite is executed.\n\n6. The context manager\'s "__exit__()" method is invoked.  If an\n   exception caused the suite to be exited, its type, value, and\n   traceback are passed as arguments to "__exit__()". Otherwise, three\n   "None" arguments are supplied.\n\n   If the suite was exited due to an exception, and the return value\n   from the "__exit__()" method was false, the exception is reraised.\n   If the return value was true, the exception is suppressed, and\n   execution continues with the statement following the "with"\n   statement.\n\n   If the suite was exited for any reason other than an exception, the\n   return value from "__exit__()" is ignored, and execution proceeds\n   at the normal location for the kind of exit that was taken.\n\nWith more than one item, the context managers are processed as if\nmultiple "with" statements were nested:\n\n   with A() as a, B() as b:\n       suite\n\nis equivalent to\n\n   with A() as a:\n       with B() as b:\n           suite\n\nChanged in version 3.1: Support for multiple context expressions.\n\nSee also: **PEP 0343** - The "with" statement\n\n     The specification, background, and examples for the Python "with"\n     statement.\n\n\nFunction definitions\n====================\n\nA function definition defines a user-defined function object (see\nsection *The standard type hierarchy*):\n\n   funcdef        ::= [decorators] "def" funcname "(" [parameter_list] ")" ["->" expression] ":" suite\n   decorators     ::= decorator+\n   decorator      ::= "@" dotted_name ["(" [parameter_list [","]] ")"] NEWLINE\n   dotted_name    ::= identifier ("." identifier)*\n   parameter_list ::= (defparameter ",")*\n                      | "*" [parameter] ("," defparameter)* ["," "**" parameter]\n                      | "**" parameter\n                      | defparameter [","] )\n   parameter      ::= identifier [":" expression]\n   defparameter   ::= parameter ["=" expression]\n   funcname       ::= identifier\n\nA function definition is an executable statement.  Its execution binds\nthe function name in the current local namespace to a function object\n(a wrapper around the executable code for the function).  This\nfunction object contains a reference to the current global namespace\nas the global namespace to be used when the function is called.\n\nThe function definition does not execute the function body; this gets\nexecuted only when the function is called. [3]\n\nA function definition may be wrapped by one or more *decorator*\nexpressions. Decorator expressions are evaluated when the function is\ndefined, in the scope that contains the function definition.  The\nresult must be a callable, which is invoked with the function object\nas the only argument. The returned value is bound to the function name\ninstead of the function object.  Multiple decorators are applied in\nnested fashion. For example, the following code\n\n   @f1(arg)\n   @f2\n   def func(): pass\n\nis equivalent to\n\n   def func(): pass\n   func = f1(arg)(f2(func))\n\nWhen one or more *parameters* have the form *parameter* "="\n*expression*, the function is said to have "default parameter values."\nFor a parameter with a default value, the corresponding *argument* may\nbe omitted from a call, in which case the parameter\'s default value is\nsubstituted.  If a parameter has a default value, all following\nparameters up until the ""*"" must also have a default value --- this\nis a syntactic restriction that is not expressed by the grammar.\n\n**Default parameter values are evaluated from left to right when the\nfunction definition is executed.** This means that the expression is\nevaluated once, when the function is defined, and that the same "pre-\ncomputed" value is used for each call.  This is especially important\nto understand when a default parameter is a mutable object, such as a\nlist or a dictionary: if the function modifies the object (e.g. by\nappending an item to a list), the default value is in effect modified.\nThis is generally not what was intended.  A way around this is to use\n"None" as the default, and explicitly test for it in the body of the\nfunction, e.g.:\n\n   def whats_on_the_telly(penguin=None):\n       if penguin is None:\n           penguin = []\n       penguin.append("property of the zoo")\n       return penguin\n\nFunction call semantics are described in more detail in section\n*Calls*. A function call always assigns values to all parameters\nmentioned in the parameter list, either from position arguments, from\nkeyword arguments, or from default values.  If the form\n""*identifier"" is present, it is initialized to a tuple receiving any\nexcess positional parameters, defaulting to the empty tuple.  If the\nform ""**identifier"" is present, it is initialized to a new\ndictionary receiving any excess keyword arguments, defaulting to a new\nempty dictionary. Parameters after ""*"" or ""*identifier"" are\nkeyword-only parameters and may only be passed used keyword arguments.\n\nParameters may have annotations of the form "": expression"" following\nthe parameter name.  Any parameter may have an annotation even those\nof the form "*identifier" or "**identifier".  Functions may have\n"return" annotation of the form ""-> expression"" after the parameter\nlist.  These annotations can be any valid Python expression and are\nevaluated when the function definition is executed.  Annotations may\nbe evaluated in a different order than they appear in the source code.\nThe presence of annotations does not change the semantics of a\nfunction.  The annotation values are available as values of a\ndictionary keyed by the parameters\' names in the "__annotations__"\nattribute of the function object.\n\nIt is also possible to create anonymous functions (functions not bound\nto a name), for immediate use in expressions.  This uses lambda\nexpressions, described in section *Lambdas*.  Note that the lambda\nexpression is merely a shorthand for a simplified function definition;\na function defined in a ""def"" statement can be passed around or\nassigned to another name just like a function defined by a lambda\nexpression.  The ""def"" form is actually more powerful since it\nallows the execution of multiple statements and annotations.\n\n**Programmer\'s note:** Functions are first-class objects.  A ""def""\nstatement executed inside a function definition defines a local\nfunction that can be returned or passed around.  Free variables used\nin the nested function can access the local variables of the function\ncontaining the def.  See section *Naming and binding* for details.\n\nSee also: **PEP 3107** - Function Annotations\n\n     The original specification for function annotations.\n\n\nClass definitions\n=================\n\nA class definition defines a class object (see section *The standard\ntype hierarchy*):\n\n   classdef    ::= [decorators] "class" classname [inheritance] ":" suite\n   inheritance ::= "(" [parameter_list] ")"\n   classname   ::= identifier\n\nA class definition is an executable statement.  The inheritance list\nusually gives a list of base classes (see *Customizing class creation*\nfor more advanced uses), so each item in the list should evaluate to a\nclass object which allows subclassing.  Classes without an inheritance\nlist inherit, by default, from the base class "object"; hence,\n\n   class Foo:\n       pass\n\nis equivalent to\n\n   class Foo(object):\n       pass\n\nThe class\'s suite is then executed in a new execution frame (see\n*Naming and binding*), using a newly created local namespace and the\noriginal global namespace. (Usually, the suite contains mostly\nfunction definitions.)  When the class\'s suite finishes execution, its\nexecution frame is discarded but its local namespace is saved. [4] A\nclass object is then created using the inheritance list for the base\nclasses and the saved local namespace for the attribute dictionary.\nThe class name is bound to this class object in the original local\nnamespace.\n\nClass creation can be customized heavily using *metaclasses*.\n\nClasses can also be decorated: just like when decorating functions,\n\n   @f1(arg)\n   @f2\n   class Foo: pass\n\nis equivalent to\n\n   class Foo: pass\n   Foo = f1(arg)(f2(Foo))\n\nThe evaluation rules for the decorator expressions are the same as for\nfunction decorators.  The result must be a class object, which is then\nbound to the class name.\n\n**Programmer\'s note:** Variables defined in the class definition are\nclass attributes; they are shared by instances.  Instance attributes\ncan be set in a method with "self.name = value".  Both class and\ninstance attributes are accessible through the notation ""self.name"",\nand an instance attribute hides a class attribute with the same name\nwhen accessed in this way.  Class attributes can be used as defaults\nfor instance attributes, but using mutable values there can lead to\nunexpected results.  *Descriptors* can be used to create instance\nvariables with different implementation details.\n\nSee also: **PEP 3115** - Metaclasses in Python 3 **PEP 3129** -\n  Class Decorators\n\n-[ Footnotes ]-\n\n[1] The exception is propagated to the invocation stack unless\n    there is a "finally" clause which happens to raise another\n    exception. That new exception causes the old one to be lost.\n\n[2] Currently, control "flows off the end" except in the case of\n    an exception or the execution of a "return", "continue", or\n    "break" statement.\n\n[3] A string literal appearing as the first statement in the\n    function body is transformed into the function\'s "__doc__"\n    attribute and therefore the function\'s *docstring*.\n\n[4] A string literal appearing as the first statement in the class\n    body is transformed into the namespace\'s "__doc__" item and\n    therefore the class\'s *docstring*.\n',
  'context-managers': '\nWith Statement Context Managers\n*******************************\n\nA *context manager* is an object that defines the runtime context to\nbe established when executing a "with" statement. The context manager\nhandles the entry into, and the exit from, the desired runtime context\nfor the execution of the block of code.  Context managers are normally\ninvoked using the "with" statement (described in section *The with\nstatement*), but can also be used by directly invoking their methods.\n\nTypical uses of context managers include saving and restoring various\nkinds of global state, locking and unlocking resources, closing opened\nfiles, etc.\n\nFor more information on context managers, see *Context Manager Types*.\n\nobject.__enter__(self)\n\n   Enter the runtime context related to this object. The "with"\n   statement will bind this method\'s return value to the target(s)\n   specified in the "as" clause of the statement, if any.\n\nobject.__exit__(self, exc_type, exc_value, traceback)\n\n   Exit the runtime context related to this object. The parameters\n   describe the exception that caused the context to be exited. If the\n   context was exited without an exception, all three arguments will\n   be "None".\n\n   If an exception is supplied, and the method wishes to suppress the\n   exception (i.e., prevent it from being propagated), it should\n   return a true value. Otherwise, the exception will be processed\n   normally upon exit from this method.\n\n   Note that "__exit__()" methods should not reraise the passed-in\n   exception; this is the caller\'s responsibility.\n\nSee also: **PEP 0343** - The "with" statement\n\n     The specification, background, and examples for the Python "with"\n     statement.\n',
  'continue': '\nThe "continue" statement\n************************\n\n   continue_stmt ::= "continue"\n\n"continue" may only occur syntactically nested in a "for" or "while"\nloop, but not nested in a function or class definition or "finally"\nclause within that loop.  It continues with the next cycle of the\nnearest enclosing loop.\n\nWhen "continue" passes control out of a "try" statement with a\n"finally" clause, that "finally" clause is executed before really\nstarting the next loop cycle.\n',
- 'conversions': '\nArithmetic conversions\n**********************\n\nWhen a description of an arithmetic operator below uses the phrase\n"the numeric arguments are converted to a common type," this means\nthat the operator implementation for built-in types works that way:\n\n* If either argument is a complex number, the other is converted to\n  complex;\n\n* otherwise, if either argument is a floating point number, the\n  other is converted to floating point;\n\n* otherwise, both must be integers and no conversion is necessary.\n\nSome additional rules apply for certain operators (e.g., a string left\nargument to the \'%\' operator).  Extensions must define their own\nconversion behavior.\n',
- 'customization': '\nBasic customization\n*******************\n\nobject.__new__(cls[, ...])\n\n   Called to create a new instance of class *cls*.  "__new__()" is a\n   static method (special-cased so you need not declare it as such)\n   that takes the class of which an instance was requested as its\n   first argument.  The remaining arguments are those passed to the\n   object constructor expression (the call to the class).  The return\n   value of "__new__()" should be the new object instance (usually an\n   instance of *cls*).\n\n   Typical implementations create a new instance of the class by\n   invoking the superclass\'s "__new__()" method using\n   "super(currentclass, cls).__new__(cls[, ...])" with appropriate\n   arguments and then modifying the newly-created instance as\n   necessary before returning it.\n\n   If "__new__()" returns an instance of *cls*, then the new\n   instance\'s "__init__()" method will be invoked like\n   "__init__(self[, ...])", where *self* is the new instance and the\n   remaining arguments are the same as were passed to "__new__()".\n\n   If "__new__()" does not return an instance of *cls*, then the new\n   instance\'s "__init__()" method will not be invoked.\n\n   "__new__()" is intended mainly to allow subclasses of immutable\n   types (like int, str, or tuple) to customize instance creation.  It\n   is also commonly overridden in custom metaclasses in order to\n   customize class creation.\n\nobject.__init__(self[, ...])\n\n   Called when the instance is created.  The arguments are those\n   passed to the class constructor expression.  If a base class has an\n   "__init__()" method, the derived class\'s "__init__()" method, if\n   any, must explicitly call it to ensure proper initialization of the\n   base class part of the instance; for example:\n   "BaseClass.__init__(self, [args...])".  As a special constraint on\n   constructors, no value may be returned; doing so will cause a\n   "TypeError" to be raised at runtime.\n\nobject.__del__(self)\n\n   Called when the instance is about to be destroyed.  This is also\n   called a destructor.  If a base class has a "__del__()" method, the\n   derived class\'s "__del__()" method, if any, must explicitly call it\n   to ensure proper deletion of the base class part of the instance.\n   Note that it is possible (though not recommended!) for the\n   "__del__()" method to postpone destruction of the instance by\n   creating a new reference to it.  It may then be called at a later\n   time when this new reference is deleted.  It is not guaranteed that\n   "__del__()" methods are called for objects that still exist when\n   the interpreter exits.\n\n   Note: "del x" doesn\'t directly call "x.__del__()" --- the former\n     decrements the reference count for "x" by one, and the latter is\n     only called when "x"\'s reference count reaches zero.  Some common\n     situations that may prevent the reference count of an object from\n     going to zero include: circular references between objects (e.g.,\n     a doubly-linked list or a tree data structure with parent and\n     child pointers); a reference to the object on the stack frame of\n     a function that caught an exception (the traceback stored in\n     "sys.exc_info()[2]" keeps the stack frame alive); or a reference\n     to the object on the stack frame that raised an unhandled\n     exception in interactive mode (the traceback stored in\n     "sys.last_traceback" keeps the stack frame alive).  The first\n     situation can only be remedied by explicitly breaking the cycles;\n     the latter two situations can be resolved by storing "None" in\n     "sys.last_traceback". Circular references which are garbage are\n     detected when the option cycle detector is enabled (it\'s on by\n     default), but can only be cleaned up if there are no Python-\n     level "__del__()" methods involved. Refer to the documentation\n     for the "gc" module for more information about how "__del__()"\n     methods are handled by the cycle detector, particularly the\n     description of the "garbage" value.\n\n   Warning: Due to the precarious circumstances under which\n     "__del__()" methods are invoked, exceptions that occur during\n     their execution are ignored, and a warning is printed to\n     "sys.stderr" instead. Also, when "__del__()" is invoked in\n     response to a module being deleted (e.g., when execution of the\n     program is done), other globals referenced by the "__del__()"\n     method may already have been deleted or in the process of being\n     torn down (e.g. the import machinery shutting down).  For this\n     reason, "__del__()" methods should do the absolute minimum needed\n     to maintain external invariants.  Starting with version 1.5,\n     Python guarantees that globals whose name begins with a single\n     underscore are deleted from their module before other globals are\n     deleted; if no other references to such globals exist, this may\n     help in assuring that imported modules are still available at the\n     time when the "__del__()" method is called.\n\nobject.__repr__(self)\n\n   Called by the "repr()" built-in function to compute the "official"\n   string representation of an object.  If at all possible, this\n   should look like a valid Python expression that could be used to\n   recreate an object with the same value (given an appropriate\n   environment).  If this is not possible, a string of the form\n   "<...some useful description...>" should be returned. The return\n   value must be a string object. If a class defines "__repr__()" but\n   not "__str__()", then "__repr__()" is also used when an "informal"\n   string representation of instances of that class is required.\n\n   This is typically used for debugging, so it is important that the\n   representation is information-rich and unambiguous.\n\nobject.__str__(self)\n\n   Called by "str(object)" and the built-in functions "format()" and\n   "print()" to compute the "informal" or nicely printable string\n   representation of an object.  The return value must be a *string*\n   object.\n\n   This method differs from "object.__repr__()" in that there is no\n   expectation that "__str__()" return a valid Python expression: a\n   more convenient or concise representation can be used.\n\n   The default implementation defined by the built-in type "object"\n   calls "object.__repr__()".\n\nobject.__bytes__(self)\n\n   Called by "bytes()" to compute a byte-string representation of an\n   object. This should return a "bytes" object.\n\nobject.__format__(self, format_spec)\n\n   Called by the "format()" built-in function (and by extension, the\n   "str.format()" method of class "str") to produce a "formatted"\n   string representation of an object. The "format_spec" argument is a\n   string that contains a description of the formatting options\n   desired. The interpretation of the "format_spec" argument is up to\n   the type implementing "__format__()", however most classes will\n   either delegate formatting to one of the built-in types, or use a\n   similar formatting option syntax.\n\n   See *Format Specification Mini-Language* for a description of the\n   standard formatting syntax.\n\n   The return value must be a string object.\n\nobject.__lt__(self, other)\nobject.__le__(self, other)\nobject.__eq__(self, other)\nobject.__ne__(self, other)\nobject.__gt__(self, other)\nobject.__ge__(self, other)\n\n   These are the so-called "rich comparison" methods. The\n   correspondence between operator symbols and method names is as\n   follows: "x<y" calls "x.__lt__(y)", "x<=y" calls "x.__le__(y)",\n   "x==y" calls "x.__eq__(y)", "x!=y" calls "x.__ne__(y)", "x>y" calls\n   "x.__gt__(y)", and "x>=y" calls "x.__ge__(y)".\n\n   A rich comparison method may return the singleton "NotImplemented"\n   if it does not implement the operation for a given pair of\n   arguments. By convention, "False" and "True" are returned for a\n   successful comparison. However, these methods can return any value,\n   so if the comparison operator is used in a Boolean context (e.g.,\n   in the condition of an "if" statement), Python will call "bool()"\n   on the value to determine if the result is true or false.\n\n   There are no implied relationships among the comparison operators.\n   The truth of "x==y" does not imply that "x!=y" is false.\n   Accordingly, when defining "__eq__()", one should also define\n   "__ne__()" so that the operators will behave as expected.  See the\n   paragraph on "__hash__()" for some important notes on creating\n   *hashable* objects which support custom comparison operations and\n   are usable as dictionary keys.\n\n   There are no swapped-argument versions of these methods (to be used\n   when the left argument does not support the operation but the right\n   argument does); rather, "__lt__()" and "__gt__()" are each other\'s\n   reflection, "__le__()" and "__ge__()" are each other\'s reflection,\n   and "__eq__()" and "__ne__()" are their own reflection.\n\n   Arguments to rich comparison methods are never coerced.\n\n   To automatically generate ordering operations from a single root\n   operation, see "functools.total_ordering()".\n\nobject.__hash__(self)\n\n   Called by built-in function "hash()" and for operations on members\n   of hashed collections including "set", "frozenset", and "dict".\n   "__hash__()" should return an integer.  The only required property\n   is that objects which compare equal have the same hash value; it is\n   advised to somehow mix together (e.g. using exclusive or) the hash\n   values for the components of the object that also play a part in\n   comparison of objects.\n\n   Note: "hash()" truncates the value returned from an object\'s\n     custom "__hash__()" method to the size of a "Py_ssize_t".  This\n     is typically 8 bytes on 64-bit builds and 4 bytes on 32-bit\n     builds. If an object\'s   "__hash__()" must interoperate on builds\n     of different bit sizes, be sure to check the width on all\n     supported builds.  An easy way to do this is with "python -c\n     "import sys; print(sys.hash_info.width)""\n\n   If a class does not define an "__eq__()" method it should not\n   define a "__hash__()" operation either; if it defines "__eq__()"\n   but not "__hash__()", its instances will not be usable as items in\n   hashable collections.  If a class defines mutable objects and\n   implements an "__eq__()" method, it should not implement\n   "__hash__()", since the implementation of hashable collections\n   requires that a key\'s hash value is immutable (if the object\'s hash\n   value changes, it will be in the wrong hash bucket).\n\n   User-defined classes have "__eq__()" and "__hash__()" methods by\n   default; with them, all objects compare unequal (except with\n   themselves) and "x.__hash__()" returns an appropriate value such\n   that "x == y" implies both that "x is y" and "hash(x) == hash(y)".\n\n   A class that overrides "__eq__()" and does not define "__hash__()"\n   will have its "__hash__()" implicitly set to "None".  When the\n   "__hash__()" method of a class is "None", instances of the class\n   will raise an appropriate "TypeError" when a program attempts to\n   retrieve their hash value, and will also be correctly identified as\n   unhashable when checking "isinstance(obj, collections.Hashable").\n\n   If a class that overrides "__eq__()" needs to retain the\n   implementation of "__hash__()" from a parent class, the interpreter\n   must be told this explicitly by setting "__hash__ =\n   <ParentClass>.__hash__".\n\n   If a class that does not override "__eq__()" wishes to suppress\n   hash support, it should include "__hash__ = None" in the class\n   definition. A class which defines its own "__hash__()" that\n   explicitly raises a "TypeError" would be incorrectly identified as\n   hashable by an "isinstance(obj, collections.Hashable)" call.\n\n   Note: By default, the "__hash__()" values of str, bytes and\n     datetime objects are "salted" with an unpredictable random value.\n     Although they remain constant within an individual Python\n     process, they are not predictable between repeated invocations of\n     Python.This is intended to provide protection against a denial-\n     of-service caused by carefully-chosen inputs that exploit the\n     worst case performance of a dict insertion, O(n^2) complexity.\n     See http://www.ocert.org/advisories/ocert-2011-003.html for\n     details.Changing hash values affects the iteration order of\n     dicts, sets and other mappings.  Python has never made guarantees\n     about this ordering (and it typically varies between 32-bit and\n     64-bit builds).See also "PYTHONHASHSEED".\n\n   Changed in version 3.3: Hash randomization is enabled by default.\n\nobject.__bool__(self)\n\n   Called to implement truth value testing and the built-in operation\n   "bool()"; should return "False" or "True".  When this method is not\n   defined, "__len__()" is called, if it is defined, and the object is\n   considered true if its result is nonzero.  If a class defines\n   neither "__len__()" nor "__bool__()", all its instances are\n   considered true.\n',
- 'debugger': '\n"pdb" --- The Python Debugger\n*****************************\n\nThe module "pdb" defines an interactive source code debugger for\nPython programs.  It supports setting (conditional) breakpoints and\nsingle stepping at the source line level, inspection of stack frames,\nsource code listing, and evaluation of arbitrary Python code in the\ncontext of any stack frame.  It also supports post-mortem debugging\nand can be called under program control.\n\nThe debugger is extensible -- it is actually defined as the class\n"Pdb". This is currently undocumented but easily understood by reading\nthe source.  The extension interface uses the modules "bdb" and "cmd".\n\nThe debugger\'s prompt is "(Pdb)". Typical usage to run a program under\ncontrol of the debugger is:\n\n   >>> import pdb\n   >>> import mymodule\n   >>> pdb.run(\'mymodule.test()\')\n   > <string>(0)?()\n   (Pdb) continue\n   > <string>(1)?()\n   (Pdb) continue\n   NameError: \'spam\'\n   > <string>(1)?()\n   (Pdb)\n\nChanged in version 3.3: Tab-completion via the "readline" module is\navailable for commands and command arguments, e.g. the current global\nand local names are offered as arguments of the "print" command.\n\n"pdb.py" can also be invoked as a script to debug other scripts.  For\nexample:\n\n   python3 -m pdb myscript.py\n\nWhen invoked as a script, pdb will automatically enter post-mortem\ndebugging if the program being debugged exits abnormally.  After post-\nmortem debugging (or after normal exit of the program), pdb will\nrestart the program.  Automatic restarting preserves pdb\'s state (such\nas breakpoints) and in most cases is more useful than quitting the\ndebugger upon program\'s exit.\n\nNew in version 3.2: "pdb.py" now accepts a "-c" option that executes\ncommands as if given in a ".pdbrc" file, see *Debugger Commands*.\n\nThe typical usage to break into the debugger from a running program is\nto insert\n\n   import pdb; pdb.set_trace()\n\nat the location you want to break into the debugger.  You can then\nstep through the code following this statement, and continue running\nwithout the debugger using the "continue" command.\n\nThe typical usage to inspect a crashed program is:\n\n   >>> import pdb\n   >>> import mymodule\n   >>> mymodule.test()\n   Traceback (most recent call last):\n     File "<stdin>", line 1, in ?\n     File "./mymodule.py", line 4, in test\n       test2()\n     File "./mymodule.py", line 3, in test2\n       print(spam)\n   NameError: spam\n   >>> pdb.pm()\n   > ./mymodule.py(3)test2()\n   -> print(spam)\n   (Pdb)\n\nThe module defines the following functions; each enters the debugger\nin a slightly different way:\n\npdb.run(statement, globals=None, locals=None)\n\n   Execute the *statement* (given as a string or a code object) under\n   debugger control.  The debugger prompt appears before any code is\n   executed; you can set breakpoints and type "continue", or you can\n   step through the statement using "step" or "next" (all these\n   commands are explained below).  The optional *globals* and *locals*\n   arguments specify the environment in which the code is executed; by\n   default the dictionary of the module "__main__" is used.  (See the\n   explanation of the built-in "exec()" or "eval()" functions.)\n\npdb.runeval(expression, globals=None, locals=None)\n\n   Evaluate the *expression* (given as a string or a code object)\n   under debugger control.  When "runeval()" returns, it returns the\n   value of the expression.  Otherwise this function is similar to\n   "run()".\n\npdb.runcall(function, *args, **kwds)\n\n   Call the *function* (a function or method object, not a string)\n   with the given arguments.  When "runcall()" returns, it returns\n   whatever the function call returned.  The debugger prompt appears\n   as soon as the function is entered.\n\npdb.set_trace()\n\n   Enter the debugger at the calling stack frame.  This is useful to\n   hard-code a breakpoint at a given point in a program, even if the\n   code is not otherwise being debugged (e.g. when an assertion\n   fails).\n\npdb.post_mortem(traceback=None)\n\n   Enter post-mortem debugging of the given *traceback* object.  If no\n   *traceback* is given, it uses the one of the exception that is\n   currently being handled (an exception must be being handled if the\n   default is to be used).\n\npdb.pm()\n\n   Enter post-mortem debugging of the traceback found in\n   "sys.last_traceback".\n\nThe "run*" functions and "set_trace()" are aliases for instantiating\nthe "Pdb" class and calling the method of the same name.  If you want\nto access further features, you have to do this yourself:\n\nclass class pdb.Pdb(completekey=\'tab\', stdin=None, stdout=None, skip=None, nosigint=False)\n\n   "Pdb" is the debugger class.\n\n   The *completekey*, *stdin* and *stdout* arguments are passed to the\n   underlying "cmd.Cmd" class; see the description there.\n\n   The *skip* argument, if given, must be an iterable of glob-style\n   module name patterns.  The debugger will not step into frames that\n   originate in a module that matches one of these patterns. [1]\n\n   By default, Pdb sets a handler for the SIGINT signal (which is sent\n   when the user presses Ctrl-C on the console) when you give a\n   "continue" command. This allows you to break into the debugger\n   again by pressing Ctrl-C.  If you want Pdb not to touch the SIGINT\n   handler, set *nosigint* tot true.\n\n   Example call to enable tracing with *skip*:\n\n      import pdb; pdb.Pdb(skip=[\'django.*\']).set_trace()\n\n   New in version 3.1: The *skip* argument.\n\n   New in version 3.2: The *nosigint* argument.  Previously, a SIGINT\n   handler was never set by Pdb.\n\n   run(statement, globals=None, locals=None)\n   runeval(expression, globals=None, locals=None)\n   runcall(function, *args, **kwds)\n   set_trace()\n\n      See the documentation for the functions explained above.\n\n\nDebugger Commands\n=================\n\nThe commands recognized by the debugger are listed below.  Most\ncommands can be abbreviated to one or two letters as indicated; e.g.\n"h(elp)" means that either "h" or "help" can be used to enter the help\ncommand (but not "he" or "hel", nor "H" or "Help" or "HELP").\nArguments to commands must be separated by whitespace (spaces or\ntabs).  Optional arguments are enclosed in square brackets ("[]") in\nthe command syntax; the square brackets must not be typed.\nAlternatives in the command syntax are separated by a vertical bar\n("|").\n\nEntering a blank line repeats the last command entered.  Exception: if\nthe last command was a "list" command, the next 11 lines are listed.\n\nCommands that the debugger doesn\'t recognize are assumed to be Python\nstatements and are executed in the context of the program being\ndebugged.  Python statements can also be prefixed with an exclamation\npoint ("!").  This is a powerful way to inspect the program being\ndebugged; it is even possible to change a variable or call a function.\nWhen an exception occurs in such a statement, the exception name is\nprinted but the debugger\'s state is not changed.\n\nThe debugger supports *aliases*.  Aliases can have parameters which\nallows one a certain level of adaptability to the context under\nexamination.\n\nMultiple commands may be entered on a single line, separated by ";;".\n(A single ";" is not used as it is the separator for multiple commands\nin a line that is passed to the Python parser.)  No intelligence is\napplied to separating the commands; the input is split at the first\n";;" pair, even if it is in the middle of a quoted string.\n\nIf a file ".pdbrc" exists in the user\'s home directory or in the\ncurrent directory, it is read in and executed as if it had been typed\nat the debugger prompt.  This is particularly useful for aliases.  If\nboth files exist, the one in the home directory is read first and\naliases defined there can be overridden by the local file.\n\nChanged in version 3.2: ".pdbrc" can now contain commands that\ncontinue debugging, such as "continue" or "next".  Previously, these\ncommands had no effect.\n\nh(elp) [command]\n\n   Without argument, print the list of available commands.  With a\n   *command* as argument, print help about that command.  "help pdb"\n   displays the full documentation (the docstring of the "pdb"\n   module).  Since the *command* argument must be an identifier, "help\n   exec" must be entered to get help on the "!" command.\n\nw(here)\n\n   Print a stack trace, with the most recent frame at the bottom.  An\n   arrow indicates the current frame, which determines the context of\n   most commands.\n\nd(own) [count]\n\n   Move the current frame *count* (default one) levels down in the\n   stack trace (to a newer frame).\n\nu(p) [count]\n\n   Move the current frame *count* (default one) levels up in the stack\n   trace (to an older frame).\n\nb(reak) [([filename:]lineno | function) [, condition]]\n\n   With a *lineno* argument, set a break there in the current file.\n   With a *function* argument, set a break at the first executable\n   statement within that function.  The line number may be prefixed\n   with a filename and a colon, to specify a breakpoint in another\n   file (probably one that hasn\'t been loaded yet).  The file is\n   searched on "sys.path".  Note that each breakpoint is assigned a\n   number to which all the other breakpoint commands refer.\n\n   If a second argument is present, it is an expression which must\n   evaluate to true before the breakpoint is honored.\n\n   Without argument, list all breaks, including for each breakpoint,\n   the number of times that breakpoint has been hit, the current\n   ignore count, and the associated condition if any.\n\ntbreak [([filename:]lineno | function) [, condition]]\n\n   Temporary breakpoint, which is removed automatically when it is\n   first hit. The arguments are the same as for "break".\n\ncl(ear) [filename:lineno | bpnumber [bpnumber ...]]\n\n   With a *filename:lineno* argument, clear all the breakpoints at\n   this line. With a space separated list of breakpoint numbers, clear\n   those breakpoints. Without argument, clear all breaks (but first\n   ask confirmation).\n\ndisable [bpnumber [bpnumber ...]]\n\n   Disable the breakpoints given as a space separated list of\n   breakpoint numbers.  Disabling a breakpoint means it cannot cause\n   the program to stop execution, but unlike clearing a breakpoint, it\n   remains in the list of breakpoints and can be (re-)enabled.\n\nenable [bpnumber [bpnumber ...]]\n\n   Enable the breakpoints specified.\n\nignore bpnumber [count]\n\n   Set the ignore count for the given breakpoint number.  If count is\n   omitted, the ignore count is set to 0.  A breakpoint becomes active\n   when the ignore count is zero.  When non-zero, the count is\n   decremented each time the breakpoint is reached and the breakpoint\n   is not disabled and any associated condition evaluates to true.\n\ncondition bpnumber [condition]\n\n   Set a new *condition* for the breakpoint, an expression which must\n   evaluate to true before the breakpoint is honored.  If *condition*\n   is absent, any existing condition is removed; i.e., the breakpoint\n   is made unconditional.\n\ncommands [bpnumber]\n\n   Specify a list of commands for breakpoint number *bpnumber*.  The\n   commands themselves appear on the following lines.  Type a line\n   containing just "end" to terminate the commands. An example:\n\n      (Pdb) commands 1\n      (com) print some_variable\n      (com) end\n      (Pdb)\n\n   To remove all commands from a breakpoint, type commands and follow\n   it immediately with "end"; that is, give no commands.\n\n   With no *bpnumber* argument, commands refers to the last breakpoint\n   set.\n\n   You can use breakpoint commands to start your program up again.\n   Simply use the continue command, or step, or any other command that\n   resumes execution.\n\n   Specifying any command resuming execution (currently continue,\n   step, next, return, jump, quit and their abbreviations) terminates\n   the command list (as if that command was immediately followed by\n   end). This is because any time you resume execution (even with a\n   simple next or step), you may encounter another breakpoint--which\n   could have its own command list, leading to ambiguities about which\n   list to execute.\n\n   If you use the \'silent\' command in the command list, the usual\n   message about stopping at a breakpoint is not printed.  This may be\n   desirable for breakpoints that are to print a specific message and\n   then continue.  If none of the other commands print anything, you\n   see no sign that the breakpoint was reached.\n\ns(tep)\n\n   Execute the current line, stop at the first possible occasion\n   (either in a function that is called or on the next line in the\n   current function).\n\nn(ext)\n\n   Continue execution until the next line in the current function is\n   reached or it returns.  (The difference between "next" and "step"\n   is that "step" stops inside a called function, while "next"\n   executes called functions at (nearly) full speed, only stopping at\n   the next line in the current function.)\n\nunt(il) [lineno]\n\n   Without argument, continue execution until the line with a number\n   greater than the current one is reached.\n\n   With a line number, continue execution until a line with a number\n   greater or equal to that is reached.  In both cases, also stop when\n   the current frame returns.\n\n   Changed in version 3.2: Allow giving an explicit line number.\n\nr(eturn)\n\n   Continue execution until the current function returns.\n\nc(ont(inue))\n\n   Continue execution, only stop when a breakpoint is encountered.\n\nj(ump) lineno\n\n   Set the next line that will be executed.  Only available in the\n   bottom-most frame.  This lets you jump back and execute code again,\n   or jump forward to skip code that you don\'t want to run.\n\n   It should be noted that not all jumps are allowed -- for instance\n   it is not possible to jump into the middle of a "for" loop or out\n   of a "finally" clause.\n\nl(ist) [first[, last]]\n\n   List source code for the current file.  Without arguments, list 11\n   lines around the current line or continue the previous listing.\n   With "." as argument, list 11 lines around the current line.  With\n   one argument, list 11 lines around at that line.  With two\n   arguments, list the given range; if the second argument is less\n   than the first, it is interpreted as a count.\n\n   The current line in the current frame is indicated by "->".  If an\n   exception is being debugged, the line where the exception was\n   originally raised or propagated is indicated by ">>", if it differs\n   from the current line.\n\n   New in version 3.2: The ">>" marker.\n\nll | longlist\n\n   List all source code for the current function or frame.\n   Interesting lines are marked as for "list".\n\n   New in version 3.2.\n\na(rgs)\n\n   Print the argument list of the current function.\n\np(rint) expression\n\n   Evaluate the *expression* in the current context and print its\n   value.\n\npp expression\n\n   Like the "print" command, except the value of the expression is\n   pretty-printed using the "pprint" module.\n\nwhatis expression\n\n   Print the type of the *expression*.\n\nsource expression\n\n   Try to get source code for the given object and display it.\n\n   New in version 3.2.\n\ndisplay [expression]\n\n   Display the value of the expression if it changed, each time\n   execution stops in the current frame.\n\n   Without expression, list all display expressions for the current\n   frame.\n\n   New in version 3.2.\n\nundisplay [expression]\n\n   Do not display the expression any more in the current frame.\n   Without expression, clear all display expressions for the current\n   frame.\n\n   New in version 3.2.\n\ninteract\n\n   Start an interative interpreter (using the "code" module) whose\n   global namespace contains all the (global and local) names found in\n   the current scope.\n\n   New in version 3.2.\n\nalias [name [command]]\n\n   Create an alias called *name* that executes *command*.  The command\n   must *not* be enclosed in quotes.  Replaceable parameters can be\n   indicated by "%1", "%2", and so on, while "%*" is replaced by all\n   the parameters. If no command is given, the current alias for\n   *name* is shown. If no arguments are given, all aliases are listed.\n\n   Aliases may be nested and can contain anything that can be legally\n   typed at the pdb prompt.  Note that internal pdb commands *can* be\n   overridden by aliases.  Such a command is then hidden until the\n   alias is removed.  Aliasing is recursively applied to the first\n   word of the command line; all other words in the line are left\n   alone.\n\n   As an example, here are two useful aliases (especially when placed\n   in the ".pdbrc" file):\n\n      # Print instance variables (usage "pi classInst")\n      alias pi for k in %1.__dict__.keys(): print("%1.",k,"=",%1.__dict__[k])\n      # Print instance variables in self\n      alias ps pi self\n\nunalias name\n\n   Delete the specified alias.\n\n! statement\n\n   Execute the (one-line) *statement* in the context of the current\n   stack frame. The exclamation point can be omitted unless the first\n   word of the statement resembles a debugger command.  To set a\n   global variable, you can prefix the assignment command with a\n   "global" statement on the same line, e.g.:\n\n      (Pdb) global list_options; list_options = [\'-l\']\n      (Pdb)\n\nrun [args ...]\nrestart [args ...]\n\n   Restart the debugged Python program.  If an argument is supplied,\n   it is split with "shlex" and the result is used as the new\n   "sys.argv". History, breakpoints, actions and debugger options are\n   preserved. "restart" is an alias for "run".\n\nq(uit)\n\n   Quit from the debugger.  The program being executed is aborted.\n\n-[ Footnotes ]-\n\n[1] Whether a frame is considered to originate in a certain module\n    is determined by the "__name__" in the frame globals.\n',
+ 'conversions': '\nArithmetic conversions\n**********************\n\nWhen a description of an arithmetic operator below uses the phrase\n"the numeric arguments are converted to a common type," this means\nthat the operator implementation for built-in types works as follows:\n\n* If either argument is a complex number, the other is converted to\n  complex;\n\n* otherwise, if either argument is a floating point number, the\n  other is converted to floating point;\n\n* otherwise, both must be integers and no conversion is necessary.\n\nSome additional rules apply for certain operators (e.g., a string as a\nleft argument to the \'%\' operator).  Extensions must define their own\nconversion behavior.\n',
+ 'customization': '\nBasic customization\n*******************\n\nobject.__new__(cls[, ...])\n\n   Called to create a new instance of class *cls*.  "__new__()" is a\n   static method (special-cased so you need not declare it as such)\n   that takes the class of which an instance was requested as its\n   first argument.  The remaining arguments are those passed to the\n   object constructor expression (the call to the class).  The return\n   value of "__new__()" should be the new object instance (usually an\n   instance of *cls*).\n\n   Typical implementations create a new instance of the class by\n   invoking the superclass\'s "__new__()" method using\n   "super(currentclass, cls).__new__(cls[, ...])" with appropriate\n   arguments and then modifying the newly-created instance as\n   necessary before returning it.\n\n   If "__new__()" returns an instance of *cls*, then the new\n   instance\'s "__init__()" method will be invoked like\n   "__init__(self[, ...])", where *self* is the new instance and the\n   remaining arguments are the same as were passed to "__new__()".\n\n   If "__new__()" does not return an instance of *cls*, then the new\n   instance\'s "__init__()" method will not be invoked.\n\n   "__new__()" is intended mainly to allow subclasses of immutable\n   types (like int, str, or tuple) to customize instance creation.  It\n   is also commonly overridden in custom metaclasses in order to\n   customize class creation.\n\nobject.__init__(self[, ...])\n\n   Called when the instance is created.  The arguments are those\n   passed to the class constructor expression.  If a base class has an\n   "__init__()" method, the derived class\'s "__init__()" method, if\n   any, must explicitly call it to ensure proper initialization of the\n   base class part of the instance; for example:\n   "BaseClass.__init__(self, [args...])".  As a special constraint on\n   constructors, no value may be returned; doing so will cause a\n   "TypeError" to be raised at runtime.\n\nobject.__del__(self)\n\n   Called when the instance is about to be destroyed.  This is also\n   called a destructor.  If a base class has a "__del__()" method, the\n   derived class\'s "__del__()" method, if any, must explicitly call it\n   to ensure proper deletion of the base class part of the instance.\n   Note that it is possible (though not recommended!) for the\n   "__del__()" method to postpone destruction of the instance by\n   creating a new reference to it.  It may then be called at a later\n   time when this new reference is deleted.  It is not guaranteed that\n   "__del__()" methods are called for objects that still exist when\n   the interpreter exits.\n\n   Note: "del x" doesn\'t directly call "x.__del__()" --- the former\n     decrements the reference count for "x" by one, and the latter is\n     only called when "x"\'s reference count reaches zero.  Some common\n     situations that may prevent the reference count of an object from\n     going to zero include: circular references between objects (e.g.,\n     a doubly-linked list or a tree data structure with parent and\n     child pointers); a reference to the object on the stack frame of\n     a function that caught an exception (the traceback stored in\n     "sys.exc_info()[2]" keeps the stack frame alive); or a reference\n     to the object on the stack frame that raised an unhandled\n     exception in interactive mode (the traceback stored in\n     "sys.last_traceback" keeps the stack frame alive).  The first\n     situation can only be remedied by explicitly breaking the cycles;\n     the latter two situations can be resolved by storing "None" in\n     "sys.last_traceback". Circular references which are garbage are\n     detected and cleaned up when the cyclic garbage collector is\n     enabled (it\'s on by default). Refer to the documentation for the\n     "gc" module for more information about this topic.\n\n   Warning: Due to the precarious circumstances under which\n     "__del__()" methods are invoked, exceptions that occur during\n     their execution are ignored, and a warning is printed to\n     "sys.stderr" instead. Also, when "__del__()" is invoked in\n     response to a module being deleted (e.g., when execution of the\n     program is done), other globals referenced by the "__del__()"\n     method may already have been deleted or in the process of being\n     torn down (e.g. the import machinery shutting down).  For this\n     reason, "__del__()" methods should do the absolute minimum needed\n     to maintain external invariants.  Starting with version 1.5,\n     Python guarantees that globals whose name begins with a single\n     underscore are deleted from their module before other globals are\n     deleted; if no other references to such globals exist, this may\n     help in assuring that imported modules are still available at the\n     time when the "__del__()" method is called.\n\nobject.__repr__(self)\n\n   Called by the "repr()" built-in function to compute the "official"\n   string representation of an object.  If at all possible, this\n   should look like a valid Python expression that could be used to\n   recreate an object with the same value (given an appropriate\n   environment).  If this is not possible, a string of the form\n   "<...some useful description...>" should be returned. The return\n   value must be a string object. If a class defines "__repr__()" but\n   not "__str__()", then "__repr__()" is also used when an "informal"\n   string representation of instances of that class is required.\n\n   This is typically used for debugging, so it is important that the\n   representation is information-rich and unambiguous.\n\nobject.__str__(self)\n\n   Called by "str(object)" and the built-in functions "format()" and\n   "print()" to compute the "informal" or nicely printable string\n   representation of an object.  The return value must be a *string*\n   object.\n\n   This method differs from "object.__repr__()" in that there is no\n   expectation that "__str__()" return a valid Python expression: a\n   more convenient or concise representation can be used.\n\n   The default implementation defined by the built-in type "object"\n   calls "object.__repr__()".\n\nobject.__bytes__(self)\n\n   Called by "bytes()" to compute a byte-string representation of an\n   object. This should return a "bytes" object.\n\nobject.__format__(self, format_spec)\n\n   Called by the "format()" built-in function (and by extension, the\n   "str.format()" method of class "str") to produce a "formatted"\n   string representation of an object. The "format_spec" argument is a\n   string that contains a description of the formatting options\n   desired. The interpretation of the "format_spec" argument is up to\n   the type implementing "__format__()", however most classes will\n   either delegate formatting to one of the built-in types, or use a\n   similar formatting option syntax.\n\n   See *Format Specification Mini-Language* for a description of the\n   standard formatting syntax.\n\n   The return value must be a string object.\n\n   Changed in version 3.4: The __format__ method of "object" itself\n   raises a "TypeError" if passed any non-empty string.\n\nobject.__lt__(self, other)\nobject.__le__(self, other)\nobject.__eq__(self, other)\nobject.__ne__(self, other)\nobject.__gt__(self, other)\nobject.__ge__(self, other)\n\n   These are the so-called "rich comparison" methods. The\n   correspondence between operator symbols and method names is as\n   follows: "x<y" calls "x.__lt__(y)", "x<=y" calls "x.__le__(y)",\n   "x==y" calls "x.__eq__(y)", "x!=y" calls "x.__ne__(y)", "x>y" calls\n   "x.__gt__(y)", and "x>=y" calls "x.__ge__(y)".\n\n   A rich comparison method may return the singleton "NotImplemented"\n   if it does not implement the operation for a given pair of\n   arguments. By convention, "False" and "True" are returned for a\n   successful comparison. However, these methods can return any value,\n   so if the comparison operator is used in a Boolean context (e.g.,\n   in the condition of an "if" statement), Python will call "bool()"\n   on the value to determine if the result is true or false.\n\n   There are no implied relationships among the comparison operators.\n   The truth of "x==y" does not imply that "x!=y" is false.\n   Accordingly, when defining "__eq__()", one should also define\n   "__ne__()" so that the operators will behave as expected.  See the\n   paragraph on "__hash__()" for some important notes on creating\n   *hashable* objects which support custom comparison operations and\n   are usable as dictionary keys.\n\n   There are no swapped-argument versions of these methods (to be used\n   when the left argument does not support the operation but the right\n   argument does); rather, "__lt__()" and "__gt__()" are each other\'s\n   reflection, "__le__()" and "__ge__()" are each other\'s reflection,\n   and "__eq__()" and "__ne__()" are their own reflection.\n\n   Arguments to rich comparison methods are never coerced.\n\n   To automatically generate ordering operations from a single root\n   operation, see "functools.total_ordering()".\n\nobject.__hash__(self)\n\n   Called by built-in function "hash()" and for operations on members\n   of hashed collections including "set", "frozenset", and "dict".\n   "__hash__()" should return an integer.  The only required property\n   is that objects which compare equal have the same hash value; it is\n   advised to somehow mix together (e.g. using exclusive or) the hash\n   values for the components of the object that also play a part in\n   comparison of objects.\n\n   Note: "hash()" truncates the value returned from an object\'s\n     custom "__hash__()" method to the size of a "Py_ssize_t".  This\n     is typically 8 bytes on 64-bit builds and 4 bytes on 32-bit\n     builds. If an object\'s   "__hash__()" must interoperate on builds\n     of different bit sizes, be sure to check the width on all\n     supported builds.  An easy way to do this is with "python -c\n     "import sys; print(sys.hash_info.width)""\n\n   If a class does not define an "__eq__()" method it should not\n   define a "__hash__()" operation either; if it defines "__eq__()"\n   but not "__hash__()", its instances will not be usable as items in\n   hashable collections.  If a class defines mutable objects and\n   implements an "__eq__()" method, it should not implement\n   "__hash__()", since the implementation of hashable collections\n   requires that a key\'s hash value is immutable (if the object\'s hash\n   value changes, it will be in the wrong hash bucket).\n\n   User-defined classes have "__eq__()" and "__hash__()" methods by\n   default; with them, all objects compare unequal (except with\n   themselves) and "x.__hash__()" returns an appropriate value such\n   that "x == y" implies both that "x is y" and "hash(x) == hash(y)".\n\n   A class that overrides "__eq__()" and does not define "__hash__()"\n   will have its "__hash__()" implicitly set to "None".  When the\n   "__hash__()" method of a class is "None", instances of the class\n   will raise an appropriate "TypeError" when a program attempts to\n   retrieve their hash value, and will also be correctly identified as\n   unhashable when checking "isinstance(obj, collections.Hashable").\n\n   If a class that overrides "__eq__()" needs to retain the\n   implementation of "__hash__()" from a parent class, the interpreter\n   must be told this explicitly by setting "__hash__ =\n   <ParentClass>.__hash__".\n\n   If a class that does not override "__eq__()" wishes to suppress\n   hash support, it should include "__hash__ = None" in the class\n   definition. A class which defines its own "__hash__()" that\n   explicitly raises a "TypeError" would be incorrectly identified as\n   hashable by an "isinstance(obj, collections.Hashable)" call.\n\n   Note: By default, the "__hash__()" values of str, bytes and\n     datetime objects are "salted" with an unpredictable random value.\n     Although they remain constant within an individual Python\n     process, they are not predictable between repeated invocations of\n     Python.This is intended to provide protection against a denial-\n     of-service caused by carefully-chosen inputs that exploit the\n     worst case performance of a dict insertion, O(n^2) complexity.\n     See http://www.ocert.org/advisories/ocert-2011-003.html for\n     details.Changing hash values affects the iteration order of\n     dicts, sets and other mappings.  Python has never made guarantees\n     about this ordering (and it typically varies between 32-bit and\n     64-bit builds).See also "PYTHONHASHSEED".\n\n   Changed in version 3.3: Hash randomization is enabled by default.\n\nobject.__bool__(self)\n\n   Called to implement truth value testing and the built-in operation\n   "bool()"; should return "False" or "True".  When this method is not\n   defined, "__len__()" is called, if it is defined, and the object is\n   considered true if its result is nonzero.  If a class defines\n   neither "__len__()" nor "__bool__()", all its instances are\n   considered true.\n',
+ 'debugger': '\n"pdb" --- The Python Debugger\n*****************************\n\nThe module "pdb" defines an interactive source code debugger for\nPython programs.  It supports setting (conditional) breakpoints and\nsingle stepping at the source line level, inspection of stack frames,\nsource code listing, and evaluation of arbitrary Python code in the\ncontext of any stack frame.  It also supports post-mortem debugging\nand can be called under program control.\n\nThe debugger is extensible -- it is actually defined as the class\n"Pdb". This is currently undocumented but easily understood by reading\nthe source.  The extension interface uses the modules "bdb" and "cmd".\n\nThe debugger\'s prompt is "(Pdb)". Typical usage to run a program under\ncontrol of the debugger is:\n\n   >>> import pdb\n   >>> import mymodule\n   >>> pdb.run(\'mymodule.test()\')\n   > <string>(0)?()\n   (Pdb) continue\n   > <string>(1)?()\n   (Pdb) continue\n   NameError: \'spam\'\n   > <string>(1)?()\n   (Pdb)\n\nChanged in version 3.3: Tab-completion via the "readline" module is\navailable for commands and command arguments, e.g. the current global\nand local names are offered as arguments of the "p" command.\n\n"pdb.py" can also be invoked as a script to debug other scripts.  For\nexample:\n\n   python3 -m pdb myscript.py\n\nWhen invoked as a script, pdb will automatically enter post-mortem\ndebugging if the program being debugged exits abnormally.  After post-\nmortem debugging (or after normal exit of the program), pdb will\nrestart the program.  Automatic restarting preserves pdb\'s state (such\nas breakpoints) and in most cases is more useful than quitting the\ndebugger upon program\'s exit.\n\nNew in version 3.2: "pdb.py" now accepts a "-c" option that executes\ncommands as if given in a ".pdbrc" file, see *Debugger Commands*.\n\nThe typical usage to break into the debugger from a running program is\nto insert\n\n   import pdb; pdb.set_trace()\n\nat the location you want to break into the debugger.  You can then\nstep through the code following this statement, and continue running\nwithout the debugger using the "continue" command.\n\nThe typical usage to inspect a crashed program is:\n\n   >>> import pdb\n   >>> import mymodule\n   >>> mymodule.test()\n   Traceback (most recent call last):\n     File "<stdin>", line 1, in ?\n     File "./mymodule.py", line 4, in test\n       test2()\n     File "./mymodule.py", line 3, in test2\n       print(spam)\n   NameError: spam\n   >>> pdb.pm()\n   > ./mymodule.py(3)test2()\n   -> print(spam)\n   (Pdb)\n\nThe module defines the following functions; each enters the debugger\nin a slightly different way:\n\npdb.run(statement, globals=None, locals=None)\n\n   Execute the *statement* (given as a string or a code object) under\n   debugger control.  The debugger prompt appears before any code is\n   executed; you can set breakpoints and type "continue", or you can\n   step through the statement using "step" or "next" (all these\n   commands are explained below).  The optional *globals* and *locals*\n   arguments specify the environment in which the code is executed; by\n   default the dictionary of the module "__main__" is used.  (See the\n   explanation of the built-in "exec()" or "eval()" functions.)\n\npdb.runeval(expression, globals=None, locals=None)\n\n   Evaluate the *expression* (given as a string or a code object)\n   under debugger control.  When "runeval()" returns, it returns the\n   value of the expression.  Otherwise this function is similar to\n   "run()".\n\npdb.runcall(function, *args, **kwds)\n\n   Call the *function* (a function or method object, not a string)\n   with the given arguments.  When "runcall()" returns, it returns\n   whatever the function call returned.  The debugger prompt appears\n   as soon as the function is entered.\n\npdb.set_trace()\n\n   Enter the debugger at the calling stack frame.  This is useful to\n   hard-code a breakpoint at a given point in a program, even if the\n   code is not otherwise being debugged (e.g. when an assertion\n   fails).\n\npdb.post_mortem(traceback=None)\n\n   Enter post-mortem debugging of the given *traceback* object.  If no\n   *traceback* is given, it uses the one of the exception that is\n   currently being handled (an exception must be being handled if the\n   default is to be used).\n\npdb.pm()\n\n   Enter post-mortem debugging of the traceback found in\n   "sys.last_traceback".\n\nThe "run*" functions and "set_trace()" are aliases for instantiating\nthe "Pdb" class and calling the method of the same name.  If you want\nto access further features, you have to do this yourself:\n\nclass class pdb.Pdb(completekey=\'tab\', stdin=None, stdout=None, skip=None, nosigint=False)\n\n   "Pdb" is the debugger class.\n\n   The *completekey*, *stdin* and *stdout* arguments are passed to the\n   underlying "cmd.Cmd" class; see the description there.\n\n   The *skip* argument, if given, must be an iterable of glob-style\n   module name patterns.  The debugger will not step into frames that\n   originate in a module that matches one of these patterns. [1]\n\n   By default, Pdb sets a handler for the SIGINT signal (which is sent\n   when the user presses Ctrl-C on the console) when you give a\n   "continue" command. This allows you to break into the debugger\n   again by pressing Ctrl-C.  If you want Pdb not to touch the SIGINT\n   handler, set *nosigint* tot true.\n\n   Example call to enable tracing with *skip*:\n\n      import pdb; pdb.Pdb(skip=[\'django.*\']).set_trace()\n\n   New in version 3.1: The *skip* argument.\n\n   New in version 3.2: The *nosigint* argument.  Previously, a SIGINT\n   handler was never set by Pdb.\n\n   run(statement, globals=None, locals=None)\n   runeval(expression, globals=None, locals=None)\n   runcall(function, *args, **kwds)\n   set_trace()\n\n      See the documentation for the functions explained above.\n\n\nDebugger Commands\n=================\n\nThe commands recognized by the debugger are listed below.  Most\ncommands can be abbreviated to one or two letters as indicated; e.g.\n"h(elp)" means that either "h" or "help" can be used to enter the help\ncommand (but not "he" or "hel", nor "H" or "Help" or "HELP").\nArguments to commands must be separated by whitespace (spaces or\ntabs).  Optional arguments are enclosed in square brackets ("[]") in\nthe command syntax; the square brackets must not be typed.\nAlternatives in the command syntax are separated by a vertical bar\n("|").\n\nEntering a blank line repeats the last command entered.  Exception: if\nthe last command was a "list" command, the next 11 lines are listed.\n\nCommands that the debugger doesn\'t recognize are assumed to be Python\nstatements and are executed in the context of the program being\ndebugged.  Python statements can also be prefixed with an exclamation\npoint ("!").  This is a powerful way to inspect the program being\ndebugged; it is even possible to change a variable or call a function.\nWhen an exception occurs in such a statement, the exception name is\nprinted but the debugger\'s state is not changed.\n\nThe debugger supports *aliases*.  Aliases can have parameters which\nallows one a certain level of adaptability to the context under\nexamination.\n\nMultiple commands may be entered on a single line, separated by ";;".\n(A single ";" is not used as it is the separator for multiple commands\nin a line that is passed to the Python parser.)  No intelligence is\napplied to separating the commands; the input is split at the first\n";;" pair, even if it is in the middle of a quoted string.\n\nIf a file ".pdbrc" exists in the user\'s home directory or in the\ncurrent directory, it is read in and executed as if it had been typed\nat the debugger prompt.  This is particularly useful for aliases.  If\nboth files exist, the one in the home directory is read first and\naliases defined there can be overridden by the local file.\n\nChanged in version 3.2: ".pdbrc" can now contain commands that\ncontinue debugging, such as "continue" or "next".  Previously, these\ncommands had no effect.\n\nh(elp) [command]\n\n   Without argument, print the list of available commands.  With a\n   *command* as argument, print help about that command.  "help pdb"\n   displays the full documentation (the docstring of the "pdb"\n   module).  Since the *command* argument must be an identifier, "help\n   exec" must be entered to get help on the "!" command.\n\nw(here)\n\n   Print a stack trace, with the most recent frame at the bottom.  An\n   arrow indicates the current frame, which determines the context of\n   most commands.\n\nd(own) [count]\n\n   Move the current frame *count* (default one) levels down in the\n   stack trace (to a newer frame).\n\nu(p) [count]\n\n   Move the current frame *count* (default one) levels up in the stack\n   trace (to an older frame).\n\nb(reak) [([filename:]lineno | function) [, condition]]\n\n   With a *lineno* argument, set a break there in the current file.\n   With a *function* argument, set a break at the first executable\n   statement within that function.  The line number may be prefixed\n   with a filename and a colon, to specify a breakpoint in another\n   file (probably one that hasn\'t been loaded yet).  The file is\n   searched on "sys.path".  Note that each breakpoint is assigned a\n   number to which all the other breakpoint commands refer.\n\n   If a second argument is present, it is an expression which must\n   evaluate to true before the breakpoint is honored.\n\n   Without argument, list all breaks, including for each breakpoint,\n   the number of times that breakpoint has been hit, the current\n   ignore count, and the associated condition if any.\n\ntbreak [([filename:]lineno | function) [, condition]]\n\n   Temporary breakpoint, which is removed automatically when it is\n   first hit. The arguments are the same as for "break".\n\ncl(ear) [filename:lineno | bpnumber [bpnumber ...]]\n\n   With a *filename:lineno* argument, clear all the breakpoints at\n   this line. With a space separated list of breakpoint numbers, clear\n   those breakpoints. Without argument, clear all breaks (but first\n   ask confirmation).\n\ndisable [bpnumber [bpnumber ...]]\n\n   Disable the breakpoints given as a space separated list of\n   breakpoint numbers.  Disabling a breakpoint means it cannot cause\n   the program to stop execution, but unlike clearing a breakpoint, it\n   remains in the list of breakpoints and can be (re-)enabled.\n\nenable [bpnumber [bpnumber ...]]\n\n   Enable the breakpoints specified.\n\nignore bpnumber [count]\n\n   Set the ignore count for the given breakpoint number.  If count is\n   omitted, the ignore count is set to 0.  A breakpoint becomes active\n   when the ignore count is zero.  When non-zero, the count is\n   decremented each time the breakpoint is reached and the breakpoint\n   is not disabled and any associated condition evaluates to true.\n\ncondition bpnumber [condition]\n\n   Set a new *condition* for the breakpoint, an expression which must\n   evaluate to true before the breakpoint is honored.  If *condition*\n   is absent, any existing condition is removed; i.e., the breakpoint\n   is made unconditional.\n\ncommands [bpnumber]\n\n   Specify a list of commands for breakpoint number *bpnumber*.  The\n   commands themselves appear on the following lines.  Type a line\n   containing just "end" to terminate the commands. An example:\n\n      (Pdb) commands 1\n      (com) p some_variable\n      (com) end\n      (Pdb)\n\n   To remove all commands from a breakpoint, type commands and follow\n   it immediately with "end"; that is, give no commands.\n\n   With no *bpnumber* argument, commands refers to the last breakpoint\n   set.\n\n   You can use breakpoint commands to start your program up again.\n   Simply use the continue command, or step, or any other command that\n   resumes execution.\n\n   Specifying any command resuming execution (currently continue,\n   step, next, return, jump, quit and their abbreviations) terminates\n   the command list (as if that command was immediately followed by\n   end). This is because any time you resume execution (even with a\n   simple next or step), you may encounter another breakpoint--which\n   could have its own command list, leading to ambiguities about which\n   list to execute.\n\n   If you use the \'silent\' command in the command list, the usual\n   message about stopping at a breakpoint is not printed.  This may be\n   desirable for breakpoints that are to print a specific message and\n   then continue.  If none of the other commands print anything, you\n   see no sign that the breakpoint was reached.\n\ns(tep)\n\n   Execute the current line, stop at the first possible occasion\n   (either in a function that is called or on the next line in the\n   current function).\n\nn(ext)\n\n   Continue execution until the next line in the current function is\n   reached or it returns.  (The difference between "next" and "step"\n   is that "step" stops inside a called function, while "next"\n   executes called functions at (nearly) full speed, only stopping at\n   the next line in the current function.)\n\nunt(il) [lineno]\n\n   Without argument, continue execution until the line with a number\n   greater than the current one is reached.\n\n   With a line number, continue execution until a line with a number\n   greater or equal to that is reached.  In both cases, also stop when\n   the current frame returns.\n\n   Changed in version 3.2: Allow giving an explicit line number.\n\nr(eturn)\n\n   Continue execution until the current function returns.\n\nc(ont(inue))\n\n   Continue execution, only stop when a breakpoint is encountered.\n\nj(ump) lineno\n\n   Set the next line that will be executed.  Only available in the\n   bottom-most frame.  This lets you jump back and execute code again,\n   or jump forward to skip code that you don\'t want to run.\n\n   It should be noted that not all jumps are allowed -- for instance\n   it is not possible to jump into the middle of a "for" loop or out\n   of a "finally" clause.\n\nl(ist) [first[, last]]\n\n   List source code for the current file.  Without arguments, list 11\n   lines around the current line or continue the previous listing.\n   With "." as argument, list 11 lines around the current line.  With\n   one argument, list 11 lines around at that line.  With two\n   arguments, list the given range; if the second argument is less\n   than the first, it is interpreted as a count.\n\n   The current line in the current frame is indicated by "->".  If an\n   exception is being debugged, the line where the exception was\n   originally raised or propagated is indicated by ">>", if it differs\n   from the current line.\n\n   New in version 3.2: The ">>" marker.\n\nll | longlist\n\n   List all source code for the current function or frame.\n   Interesting lines are marked as for "list".\n\n   New in version 3.2.\n\na(rgs)\n\n   Print the argument list of the current function.\n\np expression\n\n   Evaluate the *expression* in the current context and print its\n   value.\n\n   Note: "print()" can also be used, but is not a debugger command\n     --- this executes the Python "print()" function.\n\npp expression\n\n   Like the "p" command, except the value of the expression is pretty-\n   printed using the "pprint" module.\n\nwhatis expression\n\n   Print the type of the *expression*.\n\nsource expression\n\n   Try to get source code for the given object and display it.\n\n   New in version 3.2.\n\ndisplay [expression]\n\n   Display the value of the expression if it changed, each time\n   execution stops in the current frame.\n\n   Without expression, list all display expressions for the current\n   frame.\n\n   New in version 3.2.\n\nundisplay [expression]\n\n   Do not display the expression any more in the current frame.\n   Without expression, clear all display expressions for the current\n   frame.\n\n   New in version 3.2.\n\ninteract\n\n   Start an interative interpreter (using the "code" module) whose\n   global namespace contains all the (global and local) names found in\n   the current scope.\n\n   New in version 3.2.\n\nalias [name [command]]\n\n   Create an alias called *name* that executes *command*.  The command\n   must *not* be enclosed in quotes.  Replaceable parameters can be\n   indicated by "%1", "%2", and so on, while "%*" is replaced by all\n   the parameters. If no command is given, the current alias for\n   *name* is shown. If no arguments are given, all aliases are listed.\n\n   Aliases may be nested and can contain anything that can be legally\n   typed at the pdb prompt.  Note that internal pdb commands *can* be\n   overridden by aliases.  Such a command is then hidden until the\n   alias is removed.  Aliasing is recursively applied to the first\n   word of the command line; all other words in the line are left\n   alone.\n\n   As an example, here are two useful aliases (especially when placed\n   in the ".pdbrc" file):\n\n      # Print instance variables (usage "pi classInst")\n      alias pi for k in %1.__dict__.keys(): print("%1.",k,"=",%1.__dict__[k])\n      # Print instance variables in self\n      alias ps pi self\n\nunalias name\n\n   Delete the specified alias.\n\n! statement\n\n   Execute the (one-line) *statement* in the context of the current\n   stack frame. The exclamation point can be omitted unless the first\n   word of the statement resembles a debugger command.  To set a\n   global variable, you can prefix the assignment command with a\n   "global" statement on the same line, e.g.:\n\n      (Pdb) global list_options; list_options = [\'-l\']\n      (Pdb)\n\nrun [args ...]\nrestart [args ...]\n\n   Restart the debugged Python program.  If an argument is supplied,\n   it is split with "shlex" and the result is used as the new\n   "sys.argv". History, breakpoints, actions and debugger options are\n   preserved. "restart" is an alias for "run".\n\nq(uit)\n\n   Quit from the debugger.  The program being executed is aborted.\n\n-[ Footnotes ]-\n\n[1] Whether a frame is considered to originate in a certain module\n    is determined by the "__name__" in the frame globals.\n',
  'del': '\nThe "del" statement\n*******************\n\n   del_stmt ::= "del" target_list\n\nDeletion is recursively defined very similar to the way assignment is\ndefined. Rather than spelling it out in full details, here are some\nhints.\n\nDeletion of a target list recursively deletes each target, from left\nto right.\n\nDeletion of a name removes the binding of that name from the local or\nglobal namespace, depending on whether the name occurs in a "global"\nstatement in the same code block.  If the name is unbound, a\n"NameError" exception will be raised.\n\nDeletion of attribute references, subscriptions and slicings is passed\nto the primary object involved; deletion of a slicing is in general\nequivalent to assignment of an empty slice of the right type (but even\nthis is determined by the sliced object).\n\nChanged in version 3.2: Previously it was illegal to delete a name\nfrom the local namespace if it occurs as a free variable in a nested\nblock.\n',
  'dict': '\nDictionary displays\n*******************\n\nA dictionary display is a possibly empty series of key/datum pairs\nenclosed in curly braces:\n\n   dict_display       ::= "{" [key_datum_list | dict_comprehension] "}"\n   key_datum_list     ::= key_datum ("," key_datum)* [","]\n   key_datum          ::= expression ":" expression\n   dict_comprehension ::= expression ":" expression comp_for\n\nA dictionary display yields a new dictionary object.\n\nIf a comma-separated sequence of key/datum pairs is given, they are\nevaluated from left to right to define the entries of the dictionary:\neach key object is used as a key into the dictionary to store the\ncorresponding datum.  This means that you can specify the same key\nmultiple times in the key/datum list, and the final dictionary\'s value\nfor that key will be the last one given.\n\nA dict comprehension, in contrast to list and set comprehensions,\nneeds two expressions separated with a colon followed by the usual\n"for" and "if" clauses. When the comprehension is run, the resulting\nkey and value elements are inserted in the new dictionary in the order\nthey are produced.\n\nRestrictions on the types of the key values are listed earlier in\nsection *The standard type hierarchy*.  (To summarize, the key type\nshould be *hashable*, which excludes all mutable objects.)  Clashes\nbetween duplicate keys are not detected; the last datum (textually\nrightmost in the display) stored for a given key value prevails.\n',
  'dynamic-features': '\nInteraction with dynamic features\n*********************************\n\nThere are several cases where Python statements are illegal when used\nin conjunction with nested scopes that contain free variables.\n\nIf a variable is referenced in an enclosing scope, it is illegal to\ndelete the name.  An error will be reported at compile time.\n\nIf the wild card form of import --- "import *" --- is used in a\nfunction and the function contains or is a nested block with free\nvariables, the compiler will raise a "SyntaxError".\n\nThe "eval()" and "exec()" functions do not have access to the full\nenvironment for resolving names.  Names may be resolved in the local\nand global namespaces of the caller.  Free variables are not resolved\nin the nearest enclosing namespace, but in the global namespace.  [1]\nThe "exec()" and "eval()" functions have optional arguments to\noverride the global and local namespace.  If only one namespace is\nspecified, it is used for both.\n',
  'else': '\nThe "if" statement\n******************\n\nThe "if" statement is used for conditional execution:\n\n   if_stmt ::= "if" expression ":" suite\n               ( "elif" expression ":" suite )*\n               ["else" ":" suite]\n\nIt selects exactly one of the suites by evaluating the expressions one\nby one until one is found to be true (see section *Boolean operations*\nfor the definition of true and false); then that suite is executed\n(and no other part of the "if" statement is executed or evaluated).\nIf all expressions are false, the suite of the "else" clause, if\npresent, is executed.\n',
  'exceptions': '\nExceptions\n**********\n\nExceptions are a means of breaking out of the normal flow of control\nof a code block in order to handle errors or other exceptional\nconditions.  An exception is *raised* at the point where the error is\ndetected; it may be *handled* by the surrounding code block or by any\ncode block that directly or indirectly invoked the code block where\nthe error occurred.\n\nThe Python interpreter raises an exception when it detects a run-time\nerror (such as division by zero).  A Python program can also\nexplicitly raise an exception with the "raise" statement. Exception\nhandlers are specified with the "try" ... "except" statement.  The\n"finally" clause of such a statement can be used to specify cleanup\ncode which does not handle the exception, but is executed whether an\nexception occurred or not in the preceding code.\n\nPython uses the "termination" model of error handling: an exception\nhandler can find out what happened and continue execution at an outer\nlevel, but it cannot repair the cause of the error and retry the\nfailing operation (except by re-entering the offending piece of code\nfrom the top).\n\nWhen an exception is not handled at all, the interpreter terminates\nexecution of the program, or returns to its interactive main loop.  In\neither case, it prints a stack backtrace, except when the exception is\n"SystemExit".\n\nExceptions are identified by class instances.  The "except" clause is\nselected depending on the class of the instance: it must reference the\nclass of the instance or a base class thereof.  The instance can be\nreceived by the handler and can carry additional information about the\nexceptional condition.\n\nNote: Exception messages are not part of the Python API.  Their\n  contents may change from one version of Python to the next without\n  warning and should not be relied on by code which will run under\n  multiple versions of the interpreter.\n\nSee also the description of the "try" statement in section *The try\nstatement* and "raise" statement in section *The raise statement*.\n\n-[ Footnotes ]-\n\n[1] This limitation occurs because the code that is executed by\n    these operations is not available at the time the module is\n    compiled.\n',
- 'execmodel': '\nExecution model\n***************\n\n\nNaming and binding\n==================\n\n*Names* refer to objects.  Names are introduced by name binding\noperations. Each occurrence of a name in the program text refers to\nthe *binding* of that name established in the innermost function block\ncontaining the use.\n\nA *block* is a piece of Python program text that is executed as a\nunit. The following are blocks: a module, a function body, and a class\ndefinition. Each command typed interactively is a block.  A script\nfile (a file given as standard input to the interpreter or specified\non the interpreter command line the first argument) is a code block.\nA script command (a command specified on the interpreter command line\nwith the \'**-c**\' option) is a code block.  The string argument passed\nto the built-in functions "eval()" and "exec()" is a code block.\n\nA code block is executed in an *execution frame*.  A frame contains\nsome administrative information (used for debugging) and determines\nwhere and how execution continues after the code block\'s execution has\ncompleted.\n\nA *scope* defines the visibility of a name within a block.  If a local\nvariable is defined in a block, its scope includes that block.  If the\ndefinition occurs in a function block, the scope extends to any blocks\ncontained within the defining one, unless a contained block introduces\na different binding for the name.  The scope of names defined in a\nclass block is limited to the class block; it does not extend to the\ncode blocks of methods -- this includes comprehensions and generator\nexpressions since they are implemented using a function scope.  This\nmeans that the following will fail:\n\n   class A:\n       a = 42\n       b = list(a + i for i in range(10))\n\nWhen a name is used in a code block, it is resolved using the nearest\nenclosing scope.  The set of all such scopes visible to a code block\nis called the block\'s *environment*.\n\nIf a name is bound in a block, it is a local variable of that block,\nunless declared as "nonlocal".  If a name is bound at the module\nlevel, it is a global variable.  (The variables of the module code\nblock are local and global.)  If a variable is used in a code block\nbut not defined there, it is a *free variable*.\n\nWhen a name is not found at all, a "NameError" exception is raised.\nIf the name refers to a local variable that has not been bound, a\n"UnboundLocalError" exception is raised.  "UnboundLocalError" is a\nsubclass of "NameError".\n\nThe following constructs bind names: formal parameters to functions,\n"import" statements, class and function definitions (these bind the\nclass or function name in the defining block), and targets that are\nidentifiers if occurring in an assignment, "for" loop header, or after\n"as" in a "with" statement or "except" clause. The "import" statement\nof the form "from ... import *" binds all names defined in the\nimported module, except those beginning with an underscore.  This form\nmay only be used at the module level.\n\nA target occurring in a "del" statement is also considered bound for\nthis purpose (though the actual semantics are to unbind the name).\n\nEach assignment or import statement occurs within a block defined by a\nclass or function definition or at the module level (the top-level\ncode block).\n\nIf a name binding operation occurs anywhere within a code block, all\nuses of the name within the block are treated as references to the\ncurrent block.  This can lead to errors when a name is used within a\nblock before it is bound.  This rule is subtle.  Python lacks\ndeclarations and allows name binding operations to occur anywhere\nwithin a code block.  The local variables of a code block can be\ndetermined by scanning the entire text of the block for name binding\noperations.\n\nIf the "global" statement occurs within a block, all uses of the name\nspecified in the statement refer to the binding of that name in the\ntop-level namespace.  Names are resolved in the top-level namespace by\nsearching the global namespace, i.e. the namespace of the module\ncontaining the code block, and the builtins namespace, the namespace\nof the module "builtins".  The global namespace is searched first.  If\nthe name is not found there, the builtins namespace is searched.  The\nglobal statement must precede all uses of the name.\n\nThe builtins namespace associated with the execution of a code block\nis actually found by looking up the name "__builtins__" in its global\nnamespace; this should be a dictionary or a module (in the latter case\nthe module\'s dictionary is used).  By default, when in the "__main__"\nmodule, "__builtins__" is the built-in module "builtins"; when in any\nother module, "__builtins__" is an alias for the dictionary of the\n"builtins" module itself.  "__builtins__" can be set to a user-created\ndictionary to create a weak form of restricted execution.\n\n**CPython implementation detail:** Users should not touch\n"__builtins__"; it is strictly an implementation detail.  Users\nwanting to override values in the builtins namespace should "import"\nthe "builtins" module and modify its attributes appropriately.\n\nThe namespace for a module is automatically created the first time a\nmodule is imported.  The main module for a script is always called\n"__main__".\n\nThe "global" statement has the same scope as a name binding operation\nin the same block.  If the nearest enclosing scope for a free variable\ncontains a global statement, the free variable is treated as a global.\n\nA class definition is an executable statement that may use and define\nnames. These references follow the normal rules for name resolution.\nThe namespace of the class definition becomes the attribute dictionary\nof the class.  Names defined at the class scope are not visible in\nmethods.\n\n\nInteraction with dynamic features\n---------------------------------\n\nThere are several cases where Python statements are illegal when used\nin conjunction with nested scopes that contain free variables.\n\nIf a variable is referenced in an enclosing scope, it is illegal to\ndelete the name.  An error will be reported at compile time.\n\nIf the wild card form of import --- "import *" --- is used in a\nfunction and the function contains or is a nested block with free\nvariables, the compiler will raise a "SyntaxError".\n\nThe "eval()" and "exec()" functions do not have access to the full\nenvironment for resolving names.  Names may be resolved in the local\nand global namespaces of the caller.  Free variables are not resolved\nin the nearest enclosing namespace, but in the global namespace.  [1]\nThe "exec()" and "eval()" functions have optional arguments to\noverride the global and local namespace.  If only one namespace is\nspecified, it is used for both.\n\n\nExceptions\n==========\n\nExceptions are a means of breaking out of the normal flow of control\nof a code block in order to handle errors or other exceptional\nconditions.  An exception is *raised* at the point where the error is\ndetected; it may be *handled* by the surrounding code block or by any\ncode block that directly or indirectly invoked the code block where\nthe error occurred.\n\nThe Python interpreter raises an exception when it detects a run-time\nerror (such as division by zero).  A Python program can also\nexplicitly raise an exception with the "raise" statement. Exception\nhandlers are specified with the "try" ... "except" statement.  The\n"finally" clause of such a statement can be used to specify cleanup\ncode which does not handle the exception, but is executed whether an\nexception occurred or not in the preceding code.\n\nPython uses the "termination" model of error handling: an exception\nhandler can find out what happened and continue execution at an outer\nlevel, but it cannot repair the cause of the error and retry the\nfailing operation (except by re-entering the offending piece of code\nfrom the top).\n\nWhen an exception is not handled at all, the interpreter terminates\nexecution of the program, or returns to its interactive main loop.  In\neither case, it prints a stack backtrace, except when the exception is\n"SystemExit".\n\nExceptions are identified by class instances.  The "except" clause is\nselected depending on the class of the instance: it must reference the\nclass of the instance or a base class thereof.  The instance can be\nreceived by the handler and can carry additional information about the\nexceptional condition.\n\nNote: Exception messages are not part of the Python API.  Their\n  contents may change from one version of Python to the next without\n  warning and should not be relied on by code which will run under\n  multiple versions of the interpreter.\n\nSee also the description of the "try" statement in section *The try\nstatement* and "raise" statement in section *The raise statement*.\n\n-[ Footnotes ]-\n\n[1] This limitation occurs because the code that is executed by\n    these operations is not available at the time the module is\n    compiled.\n',
+ 'execmodel': '\nExecution model\n***************\n\n\nNaming and binding\n==================\n\n*Names* refer to objects.  Names are introduced by name binding\noperations. Each occurrence of a name in the program text refers to\nthe *binding* of that name established in the innermost function block\ncontaining the use.\n\nA *block* is a piece of Python program text that is executed as a\nunit. The following are blocks: a module, a function body, and a class\ndefinition. Each command typed interactively is a block.  A script\nfile (a file given as standard input to the interpreter or specified\nas a command line argument to the interpreter) is a code block.  A\nscript command (a command specified on the interpreter command line\nwith the \'**-c**\' option) is a code block.  The string argument passed\nto the built-in functions "eval()" and "exec()" is a code block.\n\nA code block is executed in an *execution frame*.  A frame contains\nsome administrative information (used for debugging) and determines\nwhere and how execution continues after the code block\'s execution has\ncompleted.\n\nA *scope* defines the visibility of a name within a block.  If a local\nvariable is defined in a block, its scope includes that block.  If the\ndefinition occurs in a function block, the scope extends to any blocks\ncontained within the defining one, unless a contained block introduces\na different binding for the name.  The scope of names defined in a\nclass block is limited to the class block; it does not extend to the\ncode blocks of methods -- this includes comprehensions and generator\nexpressions since they are implemented using a function scope.  This\nmeans that the following will fail:\n\n   class A:\n       a = 42\n       b = list(a + i for i in range(10))\n\nWhen a name is used in a code block, it is resolved using the nearest\nenclosing scope.  The set of all such scopes visible to a code block\nis called the block\'s *environment*.\n\nIf a name is bound in a block, it is a local variable of that block,\nunless declared as "nonlocal".  If a name is bound at the module\nlevel, it is a global variable.  (The variables of the module code\nblock are local and global.)  If a variable is used in a code block\nbut not defined there, it is a *free variable*.\n\nWhen a name is not found at all, a "NameError" exception is raised.\nIf the name refers to a local variable that has not been bound, an\n"UnboundLocalError" exception is raised.  "UnboundLocalError" is a\nsubclass of "NameError".\n\nThe following constructs bind names: formal parameters to functions,\n"import" statements, class and function definitions (these bind the\nclass or function name in the defining block), and targets that are\nidentifiers if occurring in an assignment, "for" loop header, or after\n"as" in a "with" statement or "except" clause. The "import" statement\nof the form "from ... import *" binds all names defined in the\nimported module, except those beginning with an underscore.  This form\nmay only be used at the module level.\n\nA target occurring in a "del" statement is also considered bound for\nthis purpose (though the actual semantics are to unbind the name).\n\nEach assignment or import statement occurs within a block defined by a\nclass or function definition or at the module level (the top-level\ncode block).\n\nIf a name binding operation occurs anywhere within a code block, all\nuses of the name within the block are treated as references to the\ncurrent block.  This can lead to errors when a name is used within a\nblock before it is bound.  This rule is subtle.  Python lacks\ndeclarations and allows name binding operations to occur anywhere\nwithin a code block.  The local variables of a code block can be\ndetermined by scanning the entire text of the block for name binding\noperations.\n\nIf the "global" statement occurs within a block, all uses of the name\nspecified in the statement refer to the binding of that name in the\ntop-level namespace.  Names are resolved in the top-level namespace by\nsearching the global namespace, i.e. the namespace of the module\ncontaining the code block, and the builtins namespace, the namespace\nof the module "builtins".  The global namespace is searched first.  If\nthe name is not found there, the builtins namespace is searched.  The\nglobal statement must precede all uses of the name.\n\nThe builtins namespace associated with the execution of a code block\nis actually found by looking up the name "__builtins__" in its global\nnamespace; this should be a dictionary or a module (in the latter case\nthe module\'s dictionary is used).  By default, when in the "__main__"\nmodule, "__builtins__" is the built-in module "builtins"; when in any\nother module, "__builtins__" is an alias for the dictionary of the\n"builtins" module itself.  "__builtins__" can be set to a user-created\ndictionary to create a weak form of restricted execution.\n\n**CPython implementation detail:** Users should not touch\n"__builtins__"; it is strictly an implementation detail.  Users\nwanting to override values in the builtins namespace should "import"\nthe "builtins" module and modify its attributes appropriately.\n\nThe namespace for a module is automatically created the first time a\nmodule is imported.  The main module for a script is always called\n"__main__".\n\nThe "global" statement has the same scope as a name binding operation\nin the same block.  If the nearest enclosing scope for a free variable\ncontains a global statement, the free variable is treated as a global.\n\nA class definition is an executable statement that may use and define\nnames. These references follow the normal rules for name resolution.\nThe namespace of the class definition becomes the attribute dictionary\nof the class.  Names defined at the class scope are not visible in\nmethods.\n\n\nInteraction with dynamic features\n---------------------------------\n\nThere are several cases where Python statements are illegal when used\nin conjunction with nested scopes that contain free variables.\n\nIf a variable is referenced in an enclosing scope, it is illegal to\ndelete the name.  An error will be reported at compile time.\n\nIf the wild card form of import --- "import *" --- is used in a\nfunction and the function contains or is a nested block with free\nvariables, the compiler will raise a "SyntaxError".\n\nThe "eval()" and "exec()" functions do not have access to the full\nenvironment for resolving names.  Names may be resolved in the local\nand global namespaces of the caller.  Free variables are not resolved\nin the nearest enclosing namespace, but in the global namespace.  [1]\nThe "exec()" and "eval()" functions have optional arguments to\noverride the global and local namespace.  If only one namespace is\nspecified, it is used for both.\n\n\nExceptions\n==========\n\nExceptions are a means of breaking out of the normal flow of control\nof a code block in order to handle errors or other exceptional\nconditions.  An exception is *raised* at the point where the error is\ndetected; it may be *handled* by the surrounding code block or by any\ncode block that directly or indirectly invoked the code block where\nthe error occurred.\n\nThe Python interpreter raises an exception when it detects a run-time\nerror (such as division by zero).  A Python program can also\nexplicitly raise an exception with the "raise" statement. Exception\nhandlers are specified with the "try" ... "except" statement.  The\n"finally" clause of such a statement can be used to specify cleanup\ncode which does not handle the exception, but is executed whether an\nexception occurred or not in the preceding code.\n\nPython uses the "termination" model of error handling: an exception\nhandler can find out what happened and continue execution at an outer\nlevel, but it cannot repair the cause of the error and retry the\nfailing operation (except by re-entering the offending piece of code\nfrom the top).\n\nWhen an exception is not handled at all, the interpreter terminates\nexecution of the program, or returns to its interactive main loop.  In\neither case, it prints a stack backtrace, except when the exception is\n"SystemExit".\n\nExceptions are identified by class instances.  The "except" clause is\nselected depending on the class of the instance: it must reference the\nclass of the instance or a base class thereof.  The instance can be\nreceived by the handler and can carry additional information about the\nexceptional condition.\n\nNote: Exception messages are not part of the Python API.  Their\n  contents may change from one version of Python to the next without\n  warning and should not be relied on by code which will run under\n  multiple versions of the interpreter.\n\nSee also the description of the "try" statement in section *The try\nstatement* and "raise" statement in section *The raise statement*.\n\n-[ Footnotes ]-\n\n[1] This limitation occurs because the code that is executed by\n    these operations is not available at the time the module is\n    compiled.\n',
  'exprlists': '\nExpression lists\n****************\n\n   expression_list ::= expression ( "," expression )* [","]\n\nAn expression list containing at least one comma yields a tuple.  The\nlength of the tuple is the number of expressions in the list.  The\nexpressions are evaluated from left to right.\n\nThe trailing comma is required only to create a single tuple (a.k.a. a\n*singleton*); it is optional in all other cases.  A single expression\nwithout a trailing comma doesn\'t create a tuple, but rather yields the\nvalue of that expression. (To create an empty tuple, use an empty pair\nof parentheses: "()".)\n',
  'floating': '\nFloating point literals\n***********************\n\nFloating point literals are described by the following lexical\ndefinitions:\n\n   floatnumber   ::= pointfloat | exponentfloat\n   pointfloat    ::= [intpart] fraction | intpart "."\n   exponentfloat ::= (intpart | pointfloat) exponent\n   intpart       ::= digit+\n   fraction      ::= "." digit+\n   exponent      ::= ("e" | "E") ["+" | "-"] digit+\n\nNote that the integer and exponent parts are always interpreted using\nradix 10. For example, "077e010" is legal, and denotes the same number\nas "77e10". The allowed range of floating point literals is\nimplementation-dependent. Some examples of floating point literals:\n\n   3.14    10.    .001    1e100    3.14e-10    0e0\n\nNote that numeric literals do not include a sign; a phrase like "-1"\nis actually an expression composed of the unary operator "-" and the\nliteral "1".\n',
- 'for': '\nThe "for" statement\n*******************\n\nThe "for" statement is used to iterate over the elements of a sequence\n(such as a string, tuple or list) or other iterable object:\n\n   for_stmt ::= "for" target_list "in" expression_list ":" suite\n                ["else" ":" suite]\n\nThe expression list is evaluated once; it should yield an iterable\nobject.  An iterator is created for the result of the\n"expression_list".  The suite is then executed once for each item\nprovided by the iterator, in the order of ascending indices.  Each\nitem in turn is assigned to the target list using the standard rules\nfor assignments (see *Assignment statements*), and then the suite is\nexecuted.  When the items are exhausted (which is immediately when the\nsequence is empty or an iterator raises a "StopIteration" exception),\nthe suite in the "else" clause, if present, is executed, and the loop\nterminates.\n\nA "break" statement executed in the first suite terminates the loop\nwithout executing the "else" clause\'s suite.  A "continue" statement\nexecuted in the first suite skips the rest of the suite and continues\nwith the next item, or with the "else" clause if there was no next\nitem.\n\nThe suite may assign to the variable(s) in the target list; this does\nnot affect the next item assigned to it.\n\nNames in the target list are not deleted when the loop is finished,\nbut if the sequence is empty, it will not have been assigned to at all\nby the loop.  Hint: the built-in function "range()" returns an\niterator of integers suitable to emulate the effect of Pascal\'s "for i\n:= a to b do"; e.g., "list(range(3))" returns the list "[0, 1, 2]".\n\nNote: There is a subtlety when the sequence is being modified by the\n  loop (this can only occur for mutable sequences, i.e. lists).  An\n  internal counter is used to keep track of which item is used next,\n  and this is incremented on each iteration.  When this counter has\n  reached the length of the sequence the loop terminates.  This means\n  that if the suite deletes the current (or a previous) item from the\n  sequence, the next item will be skipped (since it gets the index of\n  the current item which has already been treated).  Likewise, if the\n  suite inserts an item in the sequence before the current item, the\n  current item will be treated again the next time through the loop.\n  This can lead to nasty bugs that can be avoided by making a\n  temporary copy using a slice of the whole sequence, e.g.,\n\n     for x in a[:]:\n         if x < 0: a.remove(x)\n',
- 'formatstrings': '\nFormat String Syntax\n********************\n\nThe "str.format()" method and the "Formatter" class share the same\nsyntax for format strings (although in the case of "Formatter",\nsubclasses can define their own format string syntax).\n\nFormat strings contain "replacement fields" surrounded by curly braces\n"{}". Anything that is not contained in braces is considered literal\ntext, which is copied unchanged to the output.  If you need to include\na brace character in the literal text, it can be escaped by doubling:\n"{{" and "}}".\n\nThe grammar for a replacement field is as follows:\n\n      replacement_field ::= "{" [field_name] ["!" conversion] [":" format_spec] "}"\n      field_name        ::= arg_name ("." attribute_name | "[" element_index "]")*\n      arg_name          ::= [identifier | integer]\n      attribute_name    ::= identifier\n      element_index     ::= integer | index_string\n      index_string      ::= <any source character except "]"> +\n      conversion        ::= "r" | "s" | "a"\n      format_spec       ::= <described in the next section>\n\nIn less formal terms, the replacement field can start with a\n*field_name* that specifies the object whose value is to be formatted\nand inserted into the output instead of the replacement field. The\n*field_name* is optionally followed by a  *conversion* field, which is\npreceded by an exclamation point "\'!\'", and a *format_spec*, which is\npreceded by a colon "\':\'".  These specify a non-default format for the\nreplacement value.\n\nSee also the *Format Specification Mini-Language* section.\n\nThe *field_name* itself begins with an *arg_name* that is either a\nnumber or a keyword.  If it\'s a number, it refers to a positional\nargument, and if it\'s a keyword, it refers to a named keyword\nargument.  If the numerical arg_names in a format string are 0, 1, 2,\n... in sequence, they can all be omitted (not just some) and the\nnumbers 0, 1, 2, ... will be automatically inserted in that order.\nBecause *arg_name* is not quote-delimited, it is not possible to\nspecify arbitrary dictionary keys (e.g., the strings "\'10\'" or\n"\':-]\'") within a format string. The *arg_name* can be followed by any\nnumber of index or attribute expressions. An expression of the form\n"\'.name\'" selects the named attribute using "getattr()", while an\nexpression of the form "\'[index]\'" does an index lookup using\n"__getitem__()".\n\nChanged in version 3.1: The positional argument specifiers can be\nomitted, so "\'{} {}\'" is equivalent to "\'{0} {1}\'".\n\nSome simple format string examples:\n\n   "First, thou shalt count to {0}" # References first positional argument\n   "Bring me a {}"                  # Implicitly references the first positional argument\n   "From {} to {}"                  # Same as "From {0} to {1}"\n   "My quest is {name}"             # References keyword argument \'name\'\n   "Weight in tons {0.weight}"      # \'weight\' attribute of first positional arg\n   "Units destroyed: {players[0]}"  # First element of keyword argument \'players\'.\n\nThe *conversion* field causes a type coercion before formatting.\nNormally, the job of formatting a value is done by the "__format__()"\nmethod of the value itself.  However, in some cases it is desirable to\nforce a type to be formatted as a string, overriding its own\ndefinition of formatting.  By converting the value to a string before\ncalling "__format__()", the normal formatting logic is bypassed.\n\nThree conversion flags are currently supported: "\'!s\'" which calls\n"str()" on the value, "\'!r\'" which calls "repr()" and "\'!a\'" which\ncalls "ascii()".\n\nSome examples:\n\n   "Harold\'s a clever {0!s}"        # Calls str() on the argument first\n   "Bring out the holy {name!r}"    # Calls repr() on the argument first\n   "More {!a}"                      # Calls ascii() on the argument first\n\nThe *format_spec* field contains a specification of how the value\nshould be presented, including such details as field width, alignment,\npadding, decimal precision and so on.  Each value type can define its\nown "formatting mini-language" or interpretation of the *format_spec*.\n\nMost built-in types support a common formatting mini-language, which\nis described in the next section.\n\nA *format_spec* field can also include nested replacement fields\nwithin it. These nested replacement fields can contain only a field\nname; conversion flags and format specifications are not allowed.  The\nreplacement fields within the format_spec are substituted before the\n*format_spec* string is interpreted. This allows the formatting of a\nvalue to be dynamically specified.\n\nSee the *Format examples* section for some examples.\n\n\nFormat Specification Mini-Language\n==================================\n\n"Format specifications" are used within replacement fields contained\nwithin a format string to define how individual values are presented\n(see *Format String Syntax*).  They can also be passed directly to the\nbuilt-in "format()" function.  Each formattable type may define how\nthe format specification is to be interpreted.\n\nMost built-in types implement the following options for format\nspecifications, although some of the formatting options are only\nsupported by the numeric types.\n\nA general convention is that an empty format string ("""") produces\nthe same result as if you had called "str()" on the value. A non-empty\nformat string typically modifies the result.\n\nThe general form of a *standard format specifier* is:\n\n   format_spec ::= [[fill]align][sign][#][0][width][,][.precision][type]\n   fill        ::= <any character>\n   align       ::= "<" | ">" | "=" | "^"\n   sign        ::= "+" | "-" | " "\n   width       ::= integer\n   precision   ::= integer\n   type        ::= "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "s" | "x" | "X" | "%"\n\nIf a valid *align* value is specified, it can be preceded by a *fill*\ncharacter that can be any character and defaults to a space if\nomitted. Note that it is not possible to use "{" and "}" as *fill*\nchar while using the "str.format()" method; this limitation however\ndoesn\'t affect the "format()" function.\n\nThe meaning of the various alignment options is as follows:\n\n   +-----------+------------------------------------------------------------+\n   | Option    | Meaning                                                    |\n   +===========+============================================================+\n   | "\'<\'"     | Forces the field to be left-aligned within the available   |\n   +-----------+------------------------------------------------------------+\n   | "\'>\'"     | Forces the field to be right-aligned within the available  |\n   +-----------+------------------------------------------------------------+\n   | "\'=\'"     | Forces the padding to be placed after the sign (if any)    |\n   +-----------+------------------------------------------------------------+\n   | "\'^\'"     | Forces the field to be centered within the available       |\n   +-----------+------------------------------------------------------------+\n\nNote that unless a minimum field width is defined, the field width\nwill always be the same size as the data to fill it, so that the\nalignment option has no meaning in this case.\n\nThe *sign* option is only valid for number types, and can be one of\nthe following:\n\n   +-----------+------------------------------------------------------------+\n   | Option    | Meaning                                                    |\n   +===========+============================================================+\n   | "\'+\'"     | indicates that a sign should be used for both positive as  |\n   +-----------+------------------------------------------------------------+\n   | "\'-\'"     | indicates that a sign should be used only for negative     |\n   +-----------+------------------------------------------------------------+\n   | space     | indicates that a leading space should be used on positive  |\n   +-----------+------------------------------------------------------------+\n\nThe "\'#\'" option causes the "alternate form" to be used for the\nconversion.  The alternate form is defined differently for different\ntypes.  This option is only valid for integer, float, complex and\nDecimal types. For integers, when binary, octal, or hexadecimal output\nis used, this option adds the prefix respective "\'0b\'", "\'0o\'", or\n"\'0x\'" to the output value. For floats, complex and Decimal the\nalternate form causes the result of the conversion to always contain a\ndecimal-point character, even if no digits follow it. Normally, a\ndecimal-point character appears in the result of these conversions\nonly if a digit follows it. In addition, for "\'g\'" and "\'G\'"\nconversions, trailing zeros are not removed from the result.\n\nThe "\',\'" option signals the use of a comma for a thousands separator.\nFor a locale aware separator, use the "\'n\'" integer presentation type\ninstead.\n\nChanged in version 3.1: Added the "\',\'" option (see also **PEP 378**).\n\n*width* is a decimal integer defining the minimum field width.  If not\nspecified, then the field width will be determined by the content.\n\nPreceding the *width* field by a zero ("\'0\'") character enables sign-\naware zero-padding for numeric types.  This is equivalent to a *fill*\ncharacter of "\'0\'" with an *alignment* type of "\'=\'".\n\nThe *precision* is a decimal number indicating how many digits should\nbe displayed after the decimal point for a floating point value\nformatted with "\'f\'" and "\'F\'", or before and after the decimal point\nfor a floating point value formatted with "\'g\'" or "\'G\'".  For non-\nnumber types the field indicates the maximum field size - in other\nwords, how many characters will be used from the field content. The\n*precision* is not allowed for integer values.\n\nFinally, the *type* determines how the data should be presented.\n\nThe available string presentation types are:\n\n   +-----------+------------------------------------------------------------+\n   | Type      | Meaning                                                    |\n   +===========+============================================================+\n   | "\'s\'"     | String format. This is the default type for strings and    |\n   +-----------+------------------------------------------------------------+\n   | None      | The same as "\'s\'".                                         |\n   +-----------+------------------------------------------------------------+\n\nThe available integer presentation types are:\n\n   +-----------+------------------------------------------------------------+\n   | Type      | Meaning                                                    |\n   +===========+============================================================+\n   | "\'b\'"     | Binary format. Outputs the number in base 2.               |\n   +-----------+------------------------------------------------------------+\n   | "\'c\'"     | Character. Converts the integer to the corresponding       |\n   +-----------+------------------------------------------------------------+\n   | "\'d\'"     | Decimal Integer. Outputs the number in base 10.            |\n   +-----------+------------------------------------------------------------+\n   | "\'o\'"     | Octal format. Outputs the number in base 8.                |\n   +-----------+------------------------------------------------------------+\n   | "\'x\'"     | Hex format. Outputs the number in base 16, using lower-    |\n   +-----------+------------------------------------------------------------+\n   | "\'X\'"     | Hex format. Outputs the number in base 16, using upper-    |\n   +-----------+------------------------------------------------------------+\n   | "\'n\'"     | Number. This is the same as "\'d\'", except that it uses the |\n   +-----------+------------------------------------------------------------+\n   | None      | The same as "\'d\'".                                         |\n   +-----------+------------------------------------------------------------+\n\nIn addition to the above presentation types, integers can be formatted\nwith the floating point presentation types listed below (except "\'n\'"\nand None). When doing so, "float()" is used to convert the integer to\na floating point number before formatting.\n\nThe available presentation types for floating point and decimal values\nare:\n\n   +-----------+------------------------------------------------------------+\n   | Type      | Meaning                                                    |\n   +===========+============================================================+\n   | "\'e\'"     | Exponent notation. Prints the number in scientific         |\n   +-----------+------------------------------------------------------------+\n   | "\'E\'"     | Exponent notation. Same as "\'e\'" except it uses an upper   |\n   +-----------+------------------------------------------------------------+\n   | "\'f\'"     | Fixed point. Displays the number as a fixed-point number.  |\n   +-----------+------------------------------------------------------------+\n   | "\'F\'"     | Fixed point. Same as "\'f\'", but converts "nan" to "NAN"    |\n   +-----------+------------------------------------------------------------+\n   | "\'g\'"     | General format.  For a given precision "p >= 1", this      |\n   +-----------+------------------------------------------------------------+\n   | "\'G\'"     | General format. Same as "\'g\'" except switches to "\'E\'" if  |\n   +-----------+------------------------------------------------------------+\n   | "\'n\'"     | Number. This is the same as "\'g\'", except that it uses the |\n   +-----------+------------------------------------------------------------+\n   | "\'%\'"     | Percentage. Multiplies the number by 100 and displays in   |\n   +-----------+------------------------------------------------------------+\n   | None      | Similar to "\'g\'", except with at least one digit past the  |\n   +-----------+------------------------------------------------------------+\n\n\nFormat examples\n===============\n\nThis section contains examples of the new format syntax and comparison\nwith the old "%"-formatting.\n\nIn most of the cases the syntax is similar to the old "%"-formatting,\nwith the addition of the "{}" and with ":" used instead of "%". For\nexample, "\'%03.2f\'" can be translated to "\'{:03.2f}\'".\n\nThe new format syntax also supports new and different options, shown\nin the follow examples.\n\nAccessing arguments by position:\n\n   >>> \'{0}, {1}, {2}\'.format(\'a\', \'b\', \'c\')\n   \'a, b, c\'\n   >>> \'{}, {}, {}\'.format(\'a\', \'b\', \'c\')  # 3.1+ only\n   \'a, b, c\'\n   >>> \'{2}, {1}, {0}\'.format(\'a\', \'b\', \'c\')\n   \'c, b, a\'\n   >>> \'{2}, {1}, {0}\'.format(*\'abc\')      # unpacking argument sequence\n   \'c, b, a\'\n   >>> \'{0}{1}{0}\'.format(\'abra\', \'cad\')   # arguments\' indices can be repeated\n   \'abracadabra\'\n\nAccessing arguments by name:\n\n   >>> \'Coordinates: {latitude}, {longitude}\'.format(latitude=\'37.24N\', longitude=\'-115.81W\')\n   \'Coordinates: 37.24N, -115.81W\'\n   >>> coord = {\'latitude\': \'37.24N\', \'longitude\': \'-115.81W\'}\n   >>> \'Coordinates: {latitude}, {longitude}\'.format(**coord)\n   \'Coordinates: 37.24N, -115.81W\'\n\nAccessing arguments\' attributes:\n\n   >>> c = 3-5j\n   >>> (\'The complex number {0} is formed from the real part {0.real} \'\n   ...  \'and the imaginary part {0.imag}.\').format(c)\n   \'The complex number (3-5j) is formed from the real part 3.0 and the imaginary part -5.0.\'\n   >>> class Point:\n   ...     def __init__(self, x, y):\n   ...         self.x, self.y = x, y\n   ...     def __str__(self):\n   ...         return \'Point({self.x}, {self.y})\'.format(self=self)\n   ...\n   >>> str(Point(4, 2))\n   \'Point(4, 2)\'\n\nAccessing arguments\' items:\n\n   >>> coord = (3, 5)\n   >>> \'X: {0[0]};  Y: {0[1]}\'.format(coord)\n   \'X: 3;  Y: 5\'\n\nReplacing "%s" and "%r":\n\n   >>> "repr() shows quotes: {!r}; str() doesn\'t: {!s}".format(\'test1\', \'test2\')\n   "repr() shows quotes: \'test1\'; str() doesn\'t: test2"\n\nAligning the text and specifying a width:\n\n   >>> \'{:<30}\'.format(\'left aligned\')\n   \'left aligned                  \'\n   >>> \'{:>30}\'.format(\'right aligned\')\n   \'                 right aligned\'\n   >>> \'{:^30}\'.format(\'centered\')\n   \'           centered           \'\n   >>> \'{:*^30}\'.format(\'centered\')  # use \'*\' as a fill char\n   \'***********centered***********\'\n\nReplacing "%+f", "%-f", and "% f" and specifying a sign:\n\n   >>> \'{:+f}; {:+f}\'.format(3.14, -3.14)  # show it always\n   \'+3.140000; -3.140000\'\n   >>> \'{: f}; {: f}\'.format(3.14, -3.14)  # show a space for positive numbers\n   \' 3.140000; -3.140000\'\n   >>> \'{:-f}; {:-f}\'.format(3.14, -3.14)  # show only the minus -- same as \'{:f}; {:f}\'\n   \'3.140000; -3.140000\'\n\nReplacing "%x" and "%o" and converting the value to different bases:\n\n   >>> # format also supports binary numbers\n   >>> "int: {0:d};  hex: {0:x};  oct: {0:o};  bin: {0:b}".format(42)\n   \'int: 42;  hex: 2a;  oct: 52;  bin: 101010\'\n   >>> # with 0x, 0o, or 0b as prefix:\n   >>> "int: {0:d};  hex: {0:#x};  oct: {0:#o};  bin: {0:#b}".format(42)\n   \'int: 42;  hex: 0x2a;  oct: 0o52;  bin: 0b101010\'\n\nUsing the comma as a thousands separator:\n\n   >>> \'{:,}\'.format(1234567890)\n   \'1,234,567,890\'\n\nExpressing a percentage:\n\n   >>> points = 19\n   >>> total = 22\n   >>> \'Correct answers: {:.2%}\'.format(points/total)\n   \'Correct answers: 86.36%\'\n\nUsing type-specific formatting:\n\n   >>> import datetime\n   >>> d = datetime.datetime(2010, 7, 4, 12, 15, 58)\n   >>> \'{:%Y-%m-%d %H:%M:%S}\'.format(d)\n   \'2010-07-04 12:15:58\'\n\nNesting arguments and more complex examples:\n\n   >>> for align, text in zip(\'<^>\', [\'left\', \'center\', \'right\']):\n   ...     \'{0:{fill}{align}16}\'.format(text, fill=align, align=align)\n   ...\n   \'left<<<<<<<<<<<<\'\n   \'^^^^^center^^^^^\'\n   \'>>>>>>>>>>>right\'\n   >>>\n   >>> octets = [192, 168, 0, 1]\n   >>> \'{:02X}{:02X}{:02X}{:02X}\'.format(*octets)\n   \'C0A80001\'\n   >>> int(_, 16)\n   3232235521\n   >>>\n   >>> width = 5\n   >>> for num in range(5,12): #doctest: +NORMALIZE_WHITESPACE\n   ...     for base in \'dXob\':\n   ...         print(\'{0:{width}{base}}\'.format(num, base=base, width=width), end=\' \')\n   ...     print()\n   ...\n       5     5     5   101\n       6     6     6   110\n       7     7     7   111\n       8     8    10  1000\n       9     9    11  1001\n      10     A    12  1010\n      11     B    13  1011\n',
- 'function': '\nFunction definitions\n********************\n\nA function definition defines a user-defined function object (see\nsection *The standard type hierarchy*):\n\n   funcdef        ::= [decorators] "def" funcname "(" [parameter_list] ")" ["->" expression] ":" suite\n   decorators     ::= decorator+\n   decorator      ::= "@" dotted_name ["(" [parameter_list [","]] ")"] NEWLINE\n   dotted_name    ::= identifier ("." identifier)*\n   parameter_list ::= (defparameter ",")*\n                      ( "*" [parameter] ("," defparameter)* ["," "**" parameter]\n                      | "**" parameter\n                      | defparameter [","] )\n   parameter      ::= identifier [":" expression]\n   defparameter   ::= parameter ["=" expression]\n   funcname       ::= identifier\n\nA function definition is an executable statement.  Its execution binds\nthe function name in the current local namespace to a function object\n(a wrapper around the executable code for the function).  This\nfunction object contains a reference to the current global namespace\nas the global namespace to be used when the function is called.\n\nThe function definition does not execute the function body; this gets\nexecuted only when the function is called. [3]\n\nA function definition may be wrapped by one or more *decorator*\nexpressions. Decorator expressions are evaluated when the function is\ndefined, in the scope that contains the function definition.  The\nresult must be a callable, which is invoked with the function object\nas the only argument. The returned value is bound to the function name\ninstead of the function object.  Multiple decorators are applied in\nnested fashion. For example, the following code\n\n   @f1(arg)\n   @f2\n   def func(): pass\n\nis equivalent to\n\n   def func(): pass\n   func = f1(arg)(f2(func))\n\nWhen one or more *parameters* have the form *parameter* "="\n*expression*, the function is said to have "default parameter values."\nFor a parameter with a default value, the corresponding *argument* may\nbe omitted from a call, in which case the parameter\'s default value is\nsubstituted.  If a parameter has a default value, all following\nparameters up until the ""*"" must also have a default value --- this\nis a syntactic restriction that is not expressed by the grammar.\n\n**Default parameter values are evaluated when the function definition\nis executed.** This means that the expression is evaluated once, when\nthe function is defined, and that the same "pre-computed" value is\nused for each call.  This is especially important to understand when a\ndefault parameter is a mutable object, such as a list or a dictionary:\nif the function modifies the object (e.g. by appending an item to a\nlist), the default value is in effect modified. This is generally not\nwhat was intended.  A way around this is to use "None" as the default,\nand explicitly test for it in the body of the function, e.g.:\n\n   def whats_on_the_telly(penguin=None):\n       if penguin is None:\n           penguin = []\n       penguin.append("property of the zoo")\n       return penguin\n\nFunction call semantics are described in more detail in section\n*Calls*. A function call always assigns values to all parameters\nmentioned in the parameter list, either from position arguments, from\nkeyword arguments, or from default values.  If the form\n""*identifier"" is present, it is initialized to a tuple receiving any\nexcess positional parameters, defaulting to the empty tuple.  If the\nform ""**identifier"" is present, it is initialized to a new\ndictionary receiving any excess keyword arguments, defaulting to a new\nempty dictionary. Parameters after ""*"" or ""*identifier"" are\nkeyword-only parameters and may only be passed used keyword arguments.\n\nParameters may have annotations of the form "": expression"" following\nthe parameter name.  Any parameter may have an annotation even those\nof the form "*identifier" or "**identifier".  Functions may have\n"return" annotation of the form ""-> expression"" after the parameter\nlist.  These annotations can be any valid Python expression and are\nevaluated when the function definition is executed.  Annotations may\nbe evaluated in a different order than they appear in the source code.\nThe presence of annotations does not change the semantics of a\nfunction.  The annotation values are available as values of a\ndictionary keyed by the parameters\' names in the "__annotations__"\nattribute of the function object.\n\nIt is also possible to create anonymous functions (functions not bound\nto a name), for immediate use in expressions.  This uses lambda\nexpressions, described in section *Lambdas*.  Note that the lambda\nexpression is merely a shorthand for a simplified function definition;\na function defined in a ""def"" statement can be passed around or\nassigned to another name just like a function defined by a lambda\nexpression.  The ""def"" form is actually more powerful since it\nallows the execution of multiple statements and annotations.\n\n**Programmer\'s note:** Functions are first-class objects.  A ""def""\nstatement executed inside a function definition defines a local\nfunction that can be returned or passed around.  Free variables used\nin the nested function can access the local variables of the function\ncontaining the def.  See section *Naming and binding* for details.\n\nSee also: **PEP 3107** - Function Annotations\n\n     The original specification for function annotations.\n',
- 'global': '\nThe "global" statement\n**********************\n\n   global_stmt ::= "global" identifier ("," identifier)*\n\nThe "global" statement is a declaration which holds for the entire\ncurrent code block.  It means that the listed identifiers are to be\ninterpreted as globals.  It would be impossible to assign to a global\nvariable without "global", although free variables may refer to\nglobals without being declared global.\n\nNames listed in a "global" statement must not be used in the same code\nblock textually preceding that "global" statement.\n\nNames listed in a "global" statement must not be defined as formal\nparameters or in a "for" loop control target, "class" definition,\nfunction definition, or "import" statement.\n\n**CPython implementation detail:** The current implementation does not\nenforce the latter two restrictions, but programs should not abuse\nthis freedom, as future implementations may enforce them or silently\nchange the meaning of the program.\n\n**Programmer\'s note:** the "global" is a directive to the parser.  It\napplies only to code parsed at the same time as the "global"\nstatement. In particular, a "global" statement contained in a string\nor code object supplied to the built-in "exec()" function does not\naffect the code block *containing* the function call, and code\ncontained in such a string is unaffected by "global" statements in the\ncode containing the function call.  The same applies to the "eval()"\nand "compile()" functions.\n',
+ 'for': '\nThe "for" statement\n*******************\n\nThe "for" statement is used to iterate over the elements of a sequence\n(such as a string, tuple or list) or other iterable object:\n\n   for_stmt ::= "for" target_list "in" expression_list ":" suite\n                ["else" ":" suite]\n\nThe expression list is evaluated once; it should yield an iterable\nobject.  An iterator is created for the result of the\n"expression_list".  The suite is then executed once for each item\nprovided by the iterator, in the order returned by the iterator.  Each\nitem in turn is assigned to the target list using the standard rules\nfor assignments (see *Assignment statements*), and then the suite is\nexecuted.  When the items are exhausted (which is immediately when the\nsequence is empty or an iterator raises a "StopIteration" exception),\nthe suite in the "else" clause, if present, is executed, and the loop\nterminates.\n\nA "break" statement executed in the first suite terminates the loop\nwithout executing the "else" clause\'s suite.  A "continue" statement\nexecuted in the first suite skips the rest of the suite and continues\nwith the next item, or with the "else" clause if there is no next\nitem.\n\nThe for-loop makes assignments to the variables(s) in the target list.\nThis overwrites all previous assignments to those variables including\nthose made in the suite of the for-loop:\n\n   for i in range(10):\n       print(i)\n       i = 5             # this will not affect the for-loop\n                         # because i will be overwritten with the next\n                         # index in the range\n\nNames in the target list are not deleted when the loop is finished,\nbut if the sequence is empty, they will not have been assigned to at\nall by the loop.  Hint: the built-in function "range()" returns an\niterator of integers suitable to emulate the effect of Pascal\'s "for i\n:= a to b do"; e.g., "list(range(3))" returns the list "[0, 1, 2]".\n\nNote: There is a subtlety when the sequence is being modified by the\n  loop (this can only occur for mutable sequences, i.e. lists).  An\n  internal counter is used to keep track of which item is used next,\n  and this is incremented on each iteration.  When this counter has\n  reached the length of the sequence the loop terminates.  This means\n  that if the suite deletes the current (or a previous) item from the\n  sequence, the next item will be skipped (since it gets the index of\n  the current item which has already been treated).  Likewise, if the\n  suite inserts an item in the sequence before the current item, the\n  current item will be treated again the next time through the loop.\n  This can lead to nasty bugs that can be avoided by making a\n  temporary copy using a slice of the whole sequence, e.g.,\n\n     for x in a[:]:\n         if x < 0: a.remove(x)\n',
+ 'formatstrings': '\nFormat String Syntax\n********************\n\nThe "str.format()" method and the "Formatter" class share the same\nsyntax for format strings (although in the case of "Formatter",\nsubclasses can define their own format string syntax).\n\nFormat strings contain "replacement fields" surrounded by curly braces\n"{}". Anything that is not contained in braces is considered literal\ntext, which is copied unchanged to the output.  If you need to include\na brace character in the literal text, it can be escaped by doubling:\n"{{" and "}}".\n\nThe grammar for a replacement field is as follows:\n\n      replacement_field ::= "{" [field_name] ["!" conversion] [":" format_spec] "}"\n      field_name        ::= arg_name ("." attribute_name | "[" element_index "]")*\n      arg_name          ::= [identifier | integer]\n      attribute_name    ::= identifier\n      element_index     ::= integer | index_string\n      index_string      ::= <any source character except "]"> +\n      conversion        ::= "r" | "s" | "a"\n      format_spec       ::= <described in the next section>\n\nIn less formal terms, the replacement field can start with a\n*field_name* that specifies the object whose value is to be formatted\nand inserted into the output instead of the replacement field. The\n*field_name* is optionally followed by a  *conversion* field, which is\npreceded by an exclamation point "\'!\'", and a *format_spec*, which is\npreceded by a colon "\':\'".  These specify a non-default format for the\nreplacement value.\n\nSee also the *Format Specification Mini-Language* section.\n\nThe *field_name* itself begins with an *arg_name* that is either a\nnumber or a keyword.  If it\'s a number, it refers to a positional\nargument, and if it\'s a keyword, it refers to a named keyword\nargument.  If the numerical arg_names in a format string are 0, 1, 2,\n... in sequence, they can all be omitted (not just some) and the\nnumbers 0, 1, 2, ... will be automatically inserted in that order.\nBecause *arg_name* is not quote-delimited, it is not possible to\nspecify arbitrary dictionary keys (e.g., the strings "\'10\'" or\n"\':-]\'") within a format string. The *arg_name* can be followed by any\nnumber of index or attribute expressions. An expression of the form\n"\'.name\'" selects the named attribute using "getattr()", while an\nexpression of the form "\'[index]\'" does an index lookup using\n"__getitem__()".\n\nChanged in version 3.1: The positional argument specifiers can be\nomitted, so "\'{} {}\'" is equivalent to "\'{0} {1}\'".\n\nSome simple format string examples:\n\n   "First, thou shalt count to {0}" # References first positional argument\n   "Bring me a {}"                  # Implicitly references the first positional argument\n   "From {} to {}"                  # Same as "From {0} to {1}"\n   "My quest is {name}"             # References keyword argument \'name\'\n   "Weight in tons {0.weight}"      # \'weight\' attribute of first positional arg\n   "Units destroyed: {players[0]}"  # First element of keyword argument \'players\'.\n\nThe *conversion* field causes a type coercion before formatting.\nNormally, the job of formatting a value is done by the "__format__()"\nmethod of the value itself.  However, in some cases it is desirable to\nforce a type to be formatted as a string, overriding its own\ndefinition of formatting.  By converting the value to a string before\ncalling "__format__()", the normal formatting logic is bypassed.\n\nThree conversion flags are currently supported: "\'!s\'" which calls\n"str()" on the value, "\'!r\'" which calls "repr()" and "\'!a\'" which\ncalls "ascii()".\n\nSome examples:\n\n   "Harold\'s a clever {0!s}"        # Calls str() on the argument first\n   "Bring out the holy {name!r}"    # Calls repr() on the argument first\n   "More {!a}"                      # Calls ascii() on the argument first\n\nThe *format_spec* field contains a specification of how the value\nshould be presented, including such details as field width, alignment,\npadding, decimal precision and so on.  Each value type can define its\nown "formatting mini-language" or interpretation of the *format_spec*.\n\nMost built-in types support a common formatting mini-language, which\nis described in the next section.\n\nA *format_spec* field can also include nested replacement fields\nwithin it. These nested replacement fields can contain only a field\nname; conversion flags and format specifications are not allowed.  The\nreplacement fields within the format_spec are substituted before the\n*format_spec* string is interpreted. This allows the formatting of a\nvalue to be dynamically specified.\n\nSee the *Format examples* section for some examples.\n\n\nFormat Specification Mini-Language\n==================================\n\n"Format specifications" are used within replacement fields contained\nwithin a format string to define how individual values are presented\n(see *Format String Syntax*).  They can also be passed directly to the\nbuilt-in "format()" function.  Each formattable type may define how\nthe format specification is to be interpreted.\n\nMost built-in types implement the following options for format\nspecifications, although some of the formatting options are only\nsupported by the numeric types.\n\nA general convention is that an empty format string ("""") produces\nthe same result as if you had called "str()" on the value. A non-empty\nformat string typically modifies the result.\n\nThe general form of a *standard format specifier* is:\n\n   format_spec ::= [[fill]align][sign][#][0][width][,][.precision][type]\n   fill        ::= <any character>\n   align       ::= "<" | ">" | "=" | "^"\n   sign        ::= "+" | "-" | " "\n   width       ::= integer\n   precision   ::= integer\n   type        ::= "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "s" | "x" | "X" | "%"\n\nIf a valid *align* value is specified, it can be preceded by a *fill*\ncharacter that can be any character and defaults to a space if\nomitted. Note that it is not possible to use "{" and "}" as *fill*\nchar while using the "str.format()" method; this limitation however\ndoesn\'t affect the "format()" function.\n\nThe meaning of the various alignment options is as follows:\n\n   +-----------+------------------------------------------------------------+\n   | Option    | Meaning                                                    |\n   +===========+============================================================+\n   | "\'<\'"     | Forces the field to be left-aligned within the available   |\n   |           | space (this is the default for most objects).              |\n   +-----------+------------------------------------------------------------+\n   | "\'>\'"     | Forces the field to be right-aligned within the available  |\n   |           | space (this is the default for numbers).                   |\n   +-----------+------------------------------------------------------------+\n   | "\'=\'"     | Forces the padding to be placed after the sign (if any)    |\n   |           | but before the digits.  This is used for printing fields   |\n   |           | in the form \'+000000120\'. This alignment option is only    |\n   |           | valid for numeric types.                                   |\n   +-----------+------------------------------------------------------------+\n   | "\'^\'"     | Forces the field to be centered within the available       |\n   |           | space.                                                     |\n   +-----------+------------------------------------------------------------+\n\nNote that unless a minimum field width is defined, the field width\nwill always be the same size as the data to fill it, so that the\nalignment option has no meaning in this case.\n\nThe *sign* option is only valid for number types, and can be one of\nthe following:\n\n   +-----------+------------------------------------------------------------+\n   | Option    | Meaning                                                    |\n   +===========+============================================================+\n   | "\'+\'"     | indicates that a sign should be used for both positive as  |\n   |           | well as negative numbers.                                  |\n   +-----------+------------------------------------------------------------+\n   | "\'-\'"     | indicates that a sign should be used only for negative     |\n   |           | numbers (this is the default behavior).                    |\n   +-----------+------------------------------------------------------------+\n   | space     | indicates that a leading space should be used on positive  |\n   |           | numbers, and a minus sign on negative numbers.             |\n   +-----------+------------------------------------------------------------+\n\nThe "\'#\'" option causes the "alternate form" to be used for the\nconversion.  The alternate form is defined differently for different\ntypes.  This option is only valid for integer, float, complex and\nDecimal types. For integers, when binary, octal, or hexadecimal output\nis used, this option adds the prefix respective "\'0b\'", "\'0o\'", or\n"\'0x\'" to the output value. For floats, complex and Decimal the\nalternate form causes the result of the conversion to always contain a\ndecimal-point character, even if no digits follow it. Normally, a\ndecimal-point character appears in the result of these conversions\nonly if a digit follows it. In addition, for "\'g\'" and "\'G\'"\nconversions, trailing zeros are not removed from the result.\n\nThe "\',\'" option signals the use of a comma for a thousands separator.\nFor a locale aware separator, use the "\'n\'" integer presentation type\ninstead.\n\nChanged in version 3.1: Added the "\',\'" option (see also **PEP 378**).\n\n*width* is a decimal integer defining the minimum field width.  If not\nspecified, then the field width will be determined by the content.\n\nPreceding the *width* field by a zero ("\'0\'") character enables sign-\naware zero-padding for numeric types.  This is equivalent to a *fill*\ncharacter of "\'0\'" with an *alignment* type of "\'=\'".\n\nThe *precision* is a decimal number indicating how many digits should\nbe displayed after the decimal point for a floating point value\nformatted with "\'f\'" and "\'F\'", or before and after the decimal point\nfor a floating point value formatted with "\'g\'" or "\'G\'".  For non-\nnumber types the field indicates the maximum field size - in other\nwords, how many characters will be used from the field content. The\n*precision* is not allowed for integer values.\n\nFinally, the *type* determines how the data should be presented.\n\nThe available string presentation types are:\n\n   +-----------+------------------------------------------------------------+\n   | Type      | Meaning                                                    |\n   +===========+============================================================+\n   | "\'s\'"     | String format. This is the default type for strings and    |\n   |           | may be omitted.                                            |\n   +-----------+------------------------------------------------------------+\n   | None      | The same as "\'s\'".                                         |\n   +-----------+------------------------------------------------------------+\n\nThe available integer presentation types are:\n\n   +-----------+------------------------------------------------------------+\n   | Type      | Meaning                                                    |\n   +===========+============================================================+\n   | "\'b\'"     | Binary format. Outputs the number in base 2.               |\n   +-----------+------------------------------------------------------------+\n   | "\'c\'"     | Character. Converts the integer to the corresponding       |\n   |           | unicode character before printing.                         |\n   +-----------+------------------------------------------------------------+\n   | "\'d\'"     | Decimal Integer. Outputs the number in base 10.            |\n   +-----------+------------------------------------------------------------+\n   | "\'o\'"     | Octal format. Outputs the number in base 8.                |\n   +-----------+------------------------------------------------------------+\n   | "\'x\'"     | Hex format. Outputs the number in base 16, using lower-    |\n   |           | case letters for the digits above 9.                       |\n   +-----------+------------------------------------------------------------+\n   | "\'X\'"     | Hex format. Outputs the number in base 16, using upper-    |\n   |           | case letters for the digits above 9.                       |\n   +-----------+------------------------------------------------------------+\n   | "\'n\'"     | Number. This is the same as "\'d\'", except that it uses the |\n   |           | current locale setting to insert the appropriate number    |\n   |           | separator characters.                                      |\n   +-----------+------------------------------------------------------------+\n   | None      | The same as "\'d\'".                                         |\n   +-----------+------------------------------------------------------------+\n\nIn addition to the above presentation types, integers can be formatted\nwith the floating point presentation types listed below (except "\'n\'"\nand None). When doing so, "float()" is used to convert the integer to\na floating point number before formatting.\n\nThe available presentation types for floating point and decimal values\nare:\n\n   +-----------+------------------------------------------------------------+\n   | Type      | Meaning                                                    |\n   +===========+============================================================+\n   | "\'e\'"     | Exponent notation. Prints the number in scientific         |\n   |           | notation using the letter \'e\' to indicate the exponent.    |\n   |           | The default precision is "6".                              |\n   +-----------+------------------------------------------------------------+\n   | "\'E\'"     | Exponent notation. Same as "\'e\'" except it uses an upper   |\n   |           | case \'E\' as the separator character.                       |\n   +-----------+------------------------------------------------------------+\n   | "\'f\'"     | Fixed point. Displays the number as a fixed-point number.  |\n   |           | The default precision is "6".                              |\n   +-----------+------------------------------------------------------------+\n   | "\'F\'"     | Fixed point. Same as "\'f\'", but converts "nan" to "NAN"    |\n   |           | and "inf" to "INF".                                        |\n   +-----------+------------------------------------------------------------+\n   | "\'g\'"     | General format.  For a given precision "p >= 1", this      |\n   |           | rounds the number to "p" significant digits and then       |\n   |           | formats the result in either fixed-point format or in      |\n   |           | scientific notation, depending on its magnitude.  The      |\n   |           | precise rules are as follows: suppose that the result      |\n   |           | formatted with presentation type "\'e\'" and precision "p-1" |\n   |           | would have exponent "exp".  Then if "-4 <= exp < p", the   |\n   |           | number is formatted with presentation type "\'f\'" and       |\n   |           | precision "p-1-exp".  Otherwise, the number is formatted   |\n   |           | with presentation type "\'e\'" and precision "p-1". In both  |\n   |           | cases insignificant trailing zeros are removed from the    |\n   |           | significand, and the decimal point is also removed if      |\n   |           | there are no remaining digits following it.  Positive and  |\n   |           | negative infinity, positive and negative zero, and nans,   |\n   |           | are formatted as "inf", "-inf", "0", "-0" and "nan"        |\n   |           | respectively, regardless of the precision.  A precision of |\n   |           | "0" is treated as equivalent to a precision of "1". The    |\n   |           | default precision is "6".                                  |\n   +-----------+------------------------------------------------------------+\n   | "\'G\'"     | General format. Same as "\'g\'" except switches to "\'E\'" if  |\n   |           | the number gets too large. The representations of infinity |\n   |           | and NaN are uppercased, too.                               |\n   +-----------+------------------------------------------------------------+\n   | "\'n\'"     | Number. This is the same as "\'g\'", except that it uses the |\n   |           | current locale setting to insert the appropriate number    |\n   |           | separator characters.                                      |\n   +-----------+------------------------------------------------------------+\n   | "\'%\'"     | Percentage. Multiplies the number by 100 and displays in   |\n   |           | fixed ("\'f\'") format, followed by a percent sign.          |\n   +-----------+------------------------------------------------------------+\n   | None      | Similar to "\'g\'", except with at least one digit past the  |\n   |           | decimal point and a default precision of 12. This is       |\n   |           | intended to match "str()", except you can add the other    |\n   |           | format modifiers.                                          |\n   +-----------+------------------------------------------------------------+\n\n\nFormat examples\n===============\n\nThis section contains examples of the new format syntax and comparison\nwith the old "%"-formatting.\n\nIn most of the cases the syntax is similar to the old "%"-formatting,\nwith the addition of the "{}" and with ":" used instead of "%". For\nexample, "\'%03.2f\'" can be translated to "\'{:03.2f}\'".\n\nThe new format syntax also supports new and different options, shown\nin the follow examples.\n\nAccessing arguments by position:\n\n   >>> \'{0}, {1}, {2}\'.format(\'a\', \'b\', \'c\')\n   \'a, b, c\'\n   >>> \'{}, {}, {}\'.format(\'a\', \'b\', \'c\')  # 3.1+ only\n   \'a, b, c\'\n   >>> \'{2}, {1}, {0}\'.format(\'a\', \'b\', \'c\')\n   \'c, b, a\'\n   >>> \'{2}, {1}, {0}\'.format(*\'abc\')      # unpacking argument sequence\n   \'c, b, a\'\n   >>> \'{0}{1}{0}\'.format(\'abra\', \'cad\')   # arguments\' indices can be repeated\n   \'abracadabra\'\n\nAccessing arguments by name:\n\n   >>> \'Coordinates: {latitude}, {longitude}\'.format(latitude=\'37.24N\', longitude=\'-115.81W\')\n   \'Coordinates: 37.24N, -115.81W\'\n   >>> coord = {\'latitude\': \'37.24N\', \'longitude\': \'-115.81W\'}\n   >>> \'Coordinates: {latitude}, {longitude}\'.format(**coord)\n   \'Coordinates: 37.24N, -115.81W\'\n\nAccessing arguments\' attributes:\n\n   >>> c = 3-5j\n   >>> (\'The complex number {0} is formed from the real part {0.real} \'\n   ...  \'and the imaginary part {0.imag}.\').format(c)\n   \'The complex number (3-5j) is formed from the real part 3.0 and the imaginary part -5.0.\'\n   >>> class Point:\n   ...     def __init__(self, x, y):\n   ...         self.x, self.y = x, y\n   ...     def __str__(self):\n   ...         return \'Point({self.x}, {self.y})\'.format(self=self)\n   ...\n   >>> str(Point(4, 2))\n   \'Point(4, 2)\'\n\nAccessing arguments\' items:\n\n   >>> coord = (3, 5)\n   >>> \'X: {0[0]};  Y: {0[1]}\'.format(coord)\n   \'X: 3;  Y: 5\'\n\nReplacing "%s" and "%r":\n\n   >>> "repr() shows quotes: {!r}; str() doesn\'t: {!s}".format(\'test1\', \'test2\')\n   "repr() shows quotes: \'test1\'; str() doesn\'t: test2"\n\nAligning the text and specifying a width:\n\n   >>> \'{:<30}\'.format(\'left aligned\')\n   \'left aligned                  \'\n   >>> \'{:>30}\'.format(\'right aligned\')\n   \'                 right aligned\'\n   >>> \'{:^30}\'.format(\'centered\')\n   \'           centered           \'\n   >>> \'{:*^30}\'.format(\'centered\')  # use \'*\' as a fill char\n   \'***********centered***********\'\n\nReplacing "%+f", "%-f", and "% f" and specifying a sign:\n\n   >>> \'{:+f}; {:+f}\'.format(3.14, -3.14)  # show it always\n   \'+3.140000; -3.140000\'\n   >>> \'{: f}; {: f}\'.format(3.14, -3.14)  # show a space for positive numbers\n   \' 3.140000; -3.140000\'\n   >>> \'{:-f}; {:-f}\'.format(3.14, -3.14)  # show only the minus -- same as \'{:f}; {:f}\'\n   \'3.140000; -3.140000\'\n\nReplacing "%x" and "%o" and converting the value to different bases:\n\n   >>> # format also supports binary numbers\n   >>> "int: {0:d};  hex: {0:x};  oct: {0:o};  bin: {0:b}".format(42)\n   \'int: 42;  hex: 2a;  oct: 52;  bin: 101010\'\n   >>> # with 0x, 0o, or 0b as prefix:\n   >>> "int: {0:d};  hex: {0:#x};  oct: {0:#o};  bin: {0:#b}".format(42)\n   \'int: 42;  hex: 0x2a;  oct: 0o52;  bin: 0b101010\'\n\nUsing the comma as a thousands separator:\n\n   >>> \'{:,}\'.format(1234567890)\n   \'1,234,567,890\'\n\nExpressing a percentage:\n\n   >>> points = 19\n   >>> total = 22\n   >>> \'Correct answers: {:.2%}\'.format(points/total)\n   \'Correct answers: 86.36%\'\n\nUsing type-specific formatting:\n\n   >>> import datetime\n   >>> d = datetime.datetime(2010, 7, 4, 12, 15, 58)\n   >>> \'{:%Y-%m-%d %H:%M:%S}\'.format(d)\n   \'2010-07-04 12:15:58\'\n\nNesting arguments and more complex examples:\n\n   >>> for align, text in zip(\'<^>\', [\'left\', \'center\', \'right\']):\n   ...     \'{0:{fill}{align}16}\'.format(text, fill=align, align=align)\n   ...\n   \'left<<<<<<<<<<<<\'\n   \'^^^^^center^^^^^\'\n   \'>>>>>>>>>>>right\'\n   >>>\n   >>> octets = [192, 168, 0, 1]\n   >>> \'{:02X}{:02X}{:02X}{:02X}\'.format(*octets)\n   \'C0A80001\'\n   >>> int(_, 16)\n   3232235521\n   >>>\n   >>> width = 5\n   >>> for num in range(5,12): #doctest: +NORMALIZE_WHITESPACE\n   ...     for base in \'dXob\':\n   ...         print(\'{0:{width}{base}}\'.format(num, base=base, width=width), end=\' \')\n   ...     print()\n   ...\n       5     5     5   101\n       6     6     6   110\n       7     7     7   111\n       8     8    10  1000\n       9     9    11  1001\n      10     A    12  1010\n      11     B    13  1011\n',
+ 'function': '\nFunction definitions\n********************\n\nA function definition defines a user-defined function object (see\nsection *The standard type hierarchy*):\n\n   funcdef        ::= [decorators] "def" funcname "(" [parameter_list] ")" ["->" expression] ":" suite\n   decorators     ::= decorator+\n   decorator      ::= "@" dotted_name ["(" [parameter_list [","]] ")"] NEWLINE\n   dotted_name    ::= identifier ("." identifier)*\n   parameter_list ::= (defparameter ",")*\n                      | "*" [parameter] ("," defparameter)* ["," "**" parameter]\n                      | "**" parameter\n                      | defparameter [","] )\n   parameter      ::= identifier [":" expression]\n   defparameter   ::= parameter ["=" expression]\n   funcname       ::= identifier\n\nA function definition is an executable statement.  Its execution binds\nthe function name in the current local namespace to a function object\n(a wrapper around the executable code for the function).  This\nfunction object contains a reference to the current global namespace\nas the global namespace to be used when the function is called.\n\nThe function definition does not execute the function body; this gets\nexecuted only when the function is called. [3]\n\nA function definition may be wrapped by one or more *decorator*\nexpressions. Decorator expressions are evaluated when the function is\ndefined, in the scope that contains the function definition.  The\nresult must be a callable, which is invoked with the function object\nas the only argument. The returned value is bound to the function name\ninstead of the function object.  Multiple decorators are applied in\nnested fashion. For example, the following code\n\n   @f1(arg)\n   @f2\n   def func(): pass\n\nis equivalent to\n\n   def func(): pass\n   func = f1(arg)(f2(func))\n\nWhen one or more *parameters* have the form *parameter* "="\n*expression*, the function is said to have "default parameter values."\nFor a parameter with a default value, the corresponding *argument* may\nbe omitted from a call, in which case the parameter\'s default value is\nsubstituted.  If a parameter has a default value, all following\nparameters up until the ""*"" must also have a default value --- this\nis a syntactic restriction that is not expressed by the grammar.\n\n**Default parameter values are evaluated from left to right when the\nfunction definition is executed.** This means that the expression is\nevaluated once, when the function is defined, and that the same "pre-\ncomputed" value is used for each call.  This is especially important\nto understand when a default parameter is a mutable object, such as a\nlist or a dictionary: if the function modifies the object (e.g. by\nappending an item to a list), the default value is in effect modified.\nThis is generally not what was intended.  A way around this is to use\n"None" as the default, and explicitly test for it in the body of the\nfunction, e.g.:\n\n   def whats_on_the_telly(penguin=None):\n       if penguin is None:\n           penguin = []\n       penguin.append("property of the zoo")\n       return penguin\n\nFunction call semantics are described in more detail in section\n*Calls*. A function call always assigns values to all parameters\nmentioned in the parameter list, either from position arguments, from\nkeyword arguments, or from default values.  If the form\n""*identifier"" is present, it is initialized to a tuple receiving any\nexcess positional parameters, defaulting to the empty tuple.  If the\nform ""**identifier"" is present, it is initialized to a new\ndictionary receiving any excess keyword arguments, defaulting to a new\nempty dictionary. Parameters after ""*"" or ""*identifier"" are\nkeyword-only parameters and may only be passed used keyword arguments.\n\nParameters may have annotations of the form "": expression"" following\nthe parameter name.  Any parameter may have an annotation even those\nof the form "*identifier" or "**identifier".  Functions may have\n"return" annotation of the form ""-> expression"" after the parameter\nlist.  These annotations can be any valid Python expression and are\nevaluated when the function definition is executed.  Annotations may\nbe evaluated in a different order than they appear in the source code.\nThe presence of annotations does not change the semantics of a\nfunction.  The annotation values are available as values of a\ndictionary keyed by the parameters\' names in the "__annotations__"\nattribute of the function object.\n\nIt is also possible to create anonymous functions (functions not bound\nto a name), for immediate use in expressions.  This uses lambda\nexpressions, described in section *Lambdas*.  Note that the lambda\nexpression is merely a shorthand for a simplified function definition;\na function defined in a ""def"" statement can be passed around or\nassigned to another name just like a function defined by a lambda\nexpression.  The ""def"" form is actually more powerful since it\nallows the execution of multiple statements and annotations.\n\n**Programmer\'s note:** Functions are first-class objects.  A ""def""\nstatement executed inside a function definition defines a local\nfunction that can be returned or passed around.  Free variables used\nin the nested function can access the local variables of the function\ncontaining the def.  See section *Naming and binding* for details.\n\nSee also: **PEP 3107** - Function Annotations\n\n     The original specification for function annotations.\n',
+ 'global': '\nThe "global" statement\n**********************\n\n   global_stmt ::= "global" identifier ("," identifier)*\n\nThe "global" statement is a declaration which holds for the entire\ncurrent code block.  It means that the listed identifiers are to be\ninterpreted as globals.  It would be impossible to assign to a global\nvariable without "global", although free variables may refer to\nglobals without being declared global.\n\nNames listed in a "global" statement must not be used in the same code\nblock textually preceding that "global" statement.\n\nNames listed in a "global" statement must not be defined as formal\nparameters or in a "for" loop control target, "class" definition,\nfunction definition, or "import" statement.\n\n**CPython implementation detail:** The current implementation does not\nenforce the two restrictions, but programs should not abuse this\nfreedom, as future implementations may enforce them or silently change\nthe meaning of the program.\n\n**Programmer\'s note:** the "global" is a directive to the parser.  It\napplies only to code parsed at the same time as the "global"\nstatement. In particular, a "global" statement contained in a string\nor code object supplied to the built-in "exec()" function does not\naffect the code block *containing* the function call, and code\ncontained in such a string is unaffected by "global" statements in the\ncode containing the function call.  The same applies to the "eval()"\nand "compile()" functions.\n',
  'id-classes': '\nReserved classes of identifiers\n*******************************\n\nCertain classes of identifiers (besides keywords) have special\nmeanings.  These classes are identified by the patterns of leading and\ntrailing underscore characters:\n\n"_*"\n   Not imported by "from module import *".  The special identifier "_"\n   is used in the interactive interpreter to store the result of the\n   last evaluation; it is stored in the "builtins" module.  When not\n   in interactive mode, "_" has no special meaning and is not defined.\n   See section *The import statement*.\n\n   Note: The name "_" is often used in conjunction with\n     internationalization; refer to the documentation for the\n     "gettext" module for more information on this convention.\n\n"__*__"\n   System-defined names. These names are defined by the interpreter\n   and its implementation (including the standard library).  Current\n   system names are discussed in the *Special method names* section\n   and elsewhere.  More will likely be defined in future versions of\n   Python.  *Any* use of "__*__" names, in any context, that does not\n   follow explicitly documented use, is subject to breakage without\n   warning.\n\n"__*"\n   Class-private names.  Names in this category, when used within the\n   context of a class definition, are re-written to use a mangled form\n   to help avoid name clashes between "private" attributes of base and\n   derived classes. See section *Identifiers (Names)*.\n',
  'identifiers': '\nIdentifiers and keywords\n************************\n\nIdentifiers (also referred to as *names*) are described by the\nfollowing lexical definitions.\n\nThe syntax of identifiers in Python is based on the Unicode standard\nannex UAX-31, with elaboration and changes as defined below; see also\n**PEP 3131** for further details.\n\nWithin the ASCII range (U+0001..U+007F), the valid characters for\nidentifiers are the same as in Python 2.x: the uppercase and lowercase\nletters "A" through "Z", the underscore "_" and, except for the first\ncharacter, the digits "0" through "9".\n\nPython 3.0 introduces additional characters from outside the ASCII\nrange (see **PEP 3131**).  For these characters, the classification\nuses the version of the Unicode Character Database as included in the\n"unicodedata" module.\n\nIdentifiers are unlimited in length.  Case is significant.\n\n   identifier   ::= xid_start xid_continue*\n   id_start     ::= <all characters in general categories Lu, Ll, Lt, Lm, Lo, Nl, the underscore, and characters with the Other_ID_Start property>\n   id_continue  ::= <all characters in id_start, plus characters in the categories Mn, Mc, Nd, Pc and others with the Other_ID_Continue property>\n   xid_start    ::= <all characters in id_start whose NFKC normalization is in "id_start xid_continue*">\n   xid_continue ::= <all characters in id_continue whose NFKC normalization is in "id_continue*">\n\nThe Unicode category codes mentioned above stand for:\n\n* *Lu* - uppercase letters\n\n* *Ll* - lowercase letters\n\n* *Lt* - titlecase letters\n\n* *Lm* - modifier letters\n\n* *Lo* - other letters\n\n* *Nl* - letter numbers\n\n* *Mn* - nonspacing marks\n\n* *Mc* - spacing combining marks\n\n* *Nd* - decimal numbers\n\n* *Pc* - connector punctuations\n\n* *Other_ID_Start* - explicit list of characters in PropList.txt to\n  support backwards compatibility\n\n* *Other_ID_Continue* - likewise\n\nAll identifiers are converted into the normal form NFKC while parsing;\ncomparison of identifiers is based on NFKC.\n\nA non-normative HTML file listing all valid identifier characters for\nUnicode 4.1 can be found at http://www.dcl.hpi.uni-\npotsdam.de/home/loewis/table-3131.html.\n\n\nKeywords\n========\n\nThe following identifiers are used as reserved words, or *keywords* of\nthe language, and cannot be used as ordinary identifiers.  They must\nbe spelled exactly as written here:\n\n   False      class      finally    is         return\n   None       continue   for        lambda     try\n   True       def        from       nonlocal   while\n   and        del        global     not        with\n   as         elif       if         or         yield\n   assert     else       import     pass\n   break      except     in         raise\n\n\nReserved classes of identifiers\n===============================\n\nCertain classes of identifiers (besides keywords) have special\nmeanings.  These classes are identified by the patterns of leading and\ntrailing underscore characters:\n\n"_*"\n   Not imported by "from module import *".  The special identifier "_"\n   is used in the interactive interpreter to store the result of the\n   last evaluation; it is stored in the "builtins" module.  When not\n   in interactive mode, "_" has no special meaning and is not defined.\n   See section *The import statement*.\n\n   Note: The name "_" is often used in conjunction with\n     internationalization; refer to the documentation for the\n     "gettext" module for more information on this convention.\n\n"__*__"\n   System-defined names. These names are defined by the interpreter\n   and its implementation (including the standard library).  Current\n   system names are discussed in the *Special method names* section\n   and elsewhere.  More will likely be defined in future versions of\n   Python.  *Any* use of "__*__" names, in any context, that does not\n   follow explicitly documented use, is subject to breakage without\n   warning.\n\n"__*"\n   Class-private names.  Names in this category, when used within the\n   context of a class definition, are re-written to use a mangled form\n   to help avoid name clashes between "private" attributes of base and\n   derived classes. See section *Identifiers (Names)*.\n',
  'if': '\nThe "if" statement\n******************\n\nThe "if" statement is used for conditional execution:\n\n   if_stmt ::= "if" expression ":" suite\n               ( "elif" expression ":" suite )*\n               ["else" ":" suite]\n\nIt selects exactly one of the suites by evaluating the expressions one\nby one until one is found to be true (see section *Boolean operations*\nfor the definition of true and false); then that suite is executed\n(and no other part of the "if" statement is executed or evaluated).\nIf all expressions are false, the suite of the "else" clause, if\npresent, is executed.\n',
  'imaginary': '\nImaginary literals\n******************\n\nImaginary literals are described by the following lexical definitions:\n\n   imagnumber ::= (floatnumber | intpart) ("j" | "J")\n\nAn imaginary literal yields a complex number with a real part of 0.0.\nComplex numbers are represented as a pair of floating point numbers\nand have the same restrictions on their range.  To create a complex\nnumber with a nonzero real part, add a floating point number to it,\ne.g., "(3+4j)".  Some examples of imaginary literals:\n\n   3.14j   10.j    10j     .001j   1e100j  3.14e-10j\n',
- 'import': '\nThe "import" statement\n**********************\n\n   import_stmt     ::= "import" module ["as" name] ( "," module ["as" name] )*\n                   | "from" relative_module "import" identifier ["as" name]\n                   ( "," identifier ["as" name] )*\n                   | "from" relative_module "import" "(" identifier ["as" name]\n                   ( "," identifier ["as" name] )* [","] ")"\n                   | "from" module "import" "*"\n   module          ::= (identifier ".")* identifier\n   relative_module ::= "."* module | "."+\n   name            ::= identifier\n\nThe basic import statement (no "from" clause) is executed in two\nsteps:\n\n1. find a module, loading and initializing it if necessary\n\n2. define a name or names in the local namespace for the scope\n   where the "import" statement occurs.\n\nWhen the statement contains multiple clauses (separated by commas) the\ntwo steps are carried out separately for each clause, just as though\nthe clauses had been separated out into individiual import statements.\n\nThe details of the first step, finding and loading modules is\ndescribed in greater detail in the section on the *import system*,\nwhich also describes the various types of packages and modules that\ncan be imported, as well as all the hooks that can be used to\ncustomize the import system. Note that failures in this step may\nindicate either that the module could not be located, *or* that an\nerror occurred while initializing the module, which includes execution\nof the module\'s code.\n\nIf the requested module is retrieved successfully, it will be made\navailable in the local namespace in one of three ways:\n\n* If the module name is followed by "as", then the name following\n  "as" is bound directly to the imported module.\n\n* If no other name is specified, and the module being imported is a\n  top level module, the module\'s name is bound in the local namespace\n  as a reference to the imported module\n\n* If the module being imported is *not* a top level module, then the\n  name of the top level package that contains the module is bound in\n  the local namespace as a reference to the top level package. The\n  imported module must be accessed using its full qualified name\n  rather than directly\n\nThe "from" form uses a slightly more complex process:\n\n1. find the module specified in the "from" clause loading and\n   initializing it if necessary;\n\n2. for each of the identifiers specified in the "import" clauses:\n\n   1. check if the imported module has an attribute by that name\n\n   2. if not, attempt to import a submodule with that name and then\n      check the imported module again for that attribute\n\n   3. if the attribute is not found, "ImportError" is raised.\n\n   4. otherwise, a reference to that value is bound in the local\n      namespace, using the name in the "as" clause if it is present,\n      otherwise using the attribute name\n\nExamples:\n\n   import foo                 # foo imported and bound locally\n   import foo.bar.baz         # foo.bar.baz imported, foo bound locally\n   import foo.bar.baz as fbb  # foo.bar.baz imported and bound as fbb\n   from foo.bar import baz    # foo.bar.baz imported and bound as baz\n   from foo import attr       # foo imported and foo.attr bound as attr\n\nIf the list of identifiers is replaced by a star ("\'*\'"), all public\nnames defined in the module are bound in the local namespace for the\nscope where the "import" statement occurs.\n\nThe *public names* defined by a module are determined by checking the\nmodule\'s namespace for a variable named "__all__"; if defined, it must\nbe a sequence of strings which are names defined or imported by that\nmodule.  The names given in "__all__" are all considered public and\nare required to exist.  If "__all__" is not defined, the set of public\nnames includes all names found in the module\'s namespace which do not\nbegin with an underscore character ("\'_\'").  "__all__" should contain\nthe entire public API. It is intended to avoid accidentally exporting\nitems that are not part of the API (such as library modules which were\nimported and used within the module).\n\nThe "from" form with "*" may only occur in a module scope.  The wild\ncard form of import --- "import *" --- is only allowed at the module\nlevel. Attempting to use it in class or function definitions will\nraise a "SyntaxError".\n\nWhen specifying what module to import you do not have to specify the\nabsolute name of the module. When a module or package is contained\nwithin another package it is possible to make a relative import within\nthe same top package without having to mention the package name. By\nusing leading dots in the specified module or package after "from" you\ncan specify how high to traverse up the current package hierarchy\nwithout specifying exact names. One leading dot means the current\npackage where the module making the import exists. Two dots means up\none package level. Three dots is up two levels, etc. So if you execute\n"from . import mod" from a module in the "pkg" package then you will\nend up importing "pkg.mod". If you execute "from ..subpkg2 import mod"\nfrom within "pkg.subpkg1" you will import "pkg.subpkg2.mod". The\nspecification for relative imports is contained within **PEP 328**.\n\n"importlib.import_module()" is provided to support applications that\ndetermine which modules need to be loaded dynamically.\n\n\nFuture statements\n=================\n\nA *future statement* is a directive to the compiler that a particular\nmodule should be compiled using syntax or semantics that will be\navailable in a specified future release of Python.  The future\nstatement is intended to ease migration to future versions of Python\nthat introduce incompatible changes to the language.  It allows use of\nthe new features on a per-module basis before the release in which the\nfeature becomes standard.\n\n   future_statement ::= "from" "__future__" "import" feature ["as" name]\n                        ("," feature ["as" name])*\n                        | "from" "__future__" "import" "(" feature ["as" name]\n                        ("," feature ["as" name])* [","] ")"\n   feature          ::= identifier\n   name             ::= identifier\n\nA future statement must appear near the top of the module.  The only\nlines that can appear before a future statement are:\n\n* the module docstring (if any),\n\n* comments,\n\n* blank lines, and\n\n* other future statements.\n\nThe features recognized by Python 3.0 are "absolute_import",\n"division", "generators", "unicode_literals", "print_function",\n"nested_scopes" and "with_statement".  They are all redundant because\nthey are always enabled, and only kept for backwards compatibility.\n\nA future statement is recognized and treated specially at compile\ntime: Changes to the semantics of core constructs are often\nimplemented by generating different code.  It may even be the case\nthat a new feature introduces new incompatible syntax (such as a new\nreserved word), in which case the compiler may need to parse the\nmodule differently.  Such decisions cannot be pushed off until\nruntime.\n\nFor any given release, the compiler knows which feature names have\nbeen defined, and raises a compile-time error if a future statement\ncontains a feature not known to it.\n\nThe direct runtime semantics are the same as for any import statement:\nthere is a standard module "__future__", described later, and it will\nbe imported in the usual way at the time the future statement is\nexecuted.\n\nThe interesting runtime semantics depend on the specific feature\nenabled by the future statement.\n\nNote that there is nothing special about the statement:\n\n   import __future__ [as name]\n\nThat is not a future statement; it\'s an ordinary import statement with\nno special semantics or syntax restrictions.\n\nCode compiled by calls to the built-in functions "exec()" and\n"compile()" that occur in a module "M" containing a future statement\nwill, by default, use the new syntax or semantics associated with the\nfuture statement.  This can be controlled by optional arguments to\n"compile()" --- see the documentation of that function for details.\n\nA future statement typed at an interactive interpreter prompt will\ntake effect for the rest of the interpreter session.  If an\ninterpreter is started with the *-i* option, is passed a script name\nto execute, and the script includes a future statement, it will be in\neffect in the interactive session started after the script is\nexecuted.\n\nSee also: **PEP 236** - Back to the __future__\n\n     The original proposal for the __future__ mechanism.\n',
- 'in': '\nComparisons\n***********\n\nUnlike C, all comparison operations in Python have the same priority,\nwhich is lower than that of any arithmetic, shifting or bitwise\noperation.  Also unlike C, expressions like "a < b < c" have the\ninterpretation that is conventional in mathematics:\n\n   comparison    ::= or_expr ( comp_operator or_expr )*\n   comp_operator ::= "<" | ">" | "==" | ">=" | "<=" | "!="\n                     | "is" ["not"] | ["not"] "in"\n\nComparisons yield boolean values: "True" or "False".\n\nComparisons can be chained arbitrarily, e.g., "x < y <= z" is\nequivalent to "x < y and y <= z", except that "y" is evaluated only\nonce (but in both cases "z" is not evaluated at all when "x < y" is\nfound to be false).\n\nFormally, if *a*, *b*, *c*, ..., *y*, *z* are expressions and *op1*,\n*op2*, ..., *opN* are comparison operators, then "a op1 b op2 c ... y\nopN z" is equivalent to "a op1 b and b op2 c and ... y opN z", except\nthat each expression is evaluated at most once.\n\nNote that "a op1 b op2 c" doesn\'t imply any kind of comparison between\n*a* and *c*, so that, e.g., "x < y > z" is perfectly legal (though\nperhaps not pretty).\n\nThe operators "<", ">", "==", ">=", "<=", and "!=" compare the values\nof two objects.  The objects need not have the same type. If both are\nnumbers, they are converted to a common type.  Otherwise, the "==" and\n"!=" operators *always* consider objects of different types to be\nunequal, while the "<", ">", ">=" and "<=" operators raise a\n"TypeError" when comparing objects of different types that do not\nimplement these operators for the given pair of types.  You can\ncontrol comparison behavior of objects of non-built-in types by\ndefining rich comparison methods like "__gt__()", described in section\n*Basic customization*.\n\nComparison of objects of the same type depends on the type:\n\n* Numbers are compared arithmetically.\n\n* The values "float(\'NaN\')" and "Decimal(\'NaN\')" are special. The\n  are identical to themselves, "x is x" but are not equal to\n  themselves, "x != x".  Additionally, comparing any value to a\n  not-a-number value will return "False".  For example, both "3 <\n  float(\'NaN\')" and "float(\'NaN\') < 3" will return "False".\n\n* Bytes objects are compared lexicographically using the numeric\n  values of their elements.\n\n* Strings are compared lexicographically using the numeric\n  equivalents (the result of the built-in function "ord()") of their\n  characters. [3] String and bytes object can\'t be compared!\n\n* Tuples and lists are compared lexicographically using comparison\n  of corresponding elements.  This means that to compare equal, each\n  element must compare equal and the two sequences must be of the same\n  type and have the same length.\n\n  If not equal, the sequences are ordered the same as their first\n  differing elements.  For example, "[1,2,x] <= [1,2,y]" has the same\n  value as "x <= y".  If the corresponding element does not exist, the\n  shorter sequence is ordered first (for example, "[1,2] < [1,2,3]").\n\n* Mappings (dictionaries) compare equal if and only if they have the\n  same "(key, value)" pairs. Order comparisons "(\'<\', \'<=\', \'>=\',\n  \'>\')" raise "TypeError".\n\n* Sets and frozensets define comparison operators to mean subset and\n  superset tests.  Those relations do not define total orderings (the\n  two sets "{1,2}" and {2,3} are not equal, nor subsets of one\n  another, nor supersets of one another).  Accordingly, sets are not\n  appropriate arguments for functions which depend on total ordering.\n  For example, "min()", "max()", and "sorted()" produce undefined\n  results given a list of sets as inputs.\n\n* Most other objects of built-in types compare unequal unless they\n  are the same object; the choice whether one object is considered\n  smaller or larger than another one is made arbitrarily but\n  consistently within one execution of a program.\n\nComparison of objects of the differing types depends on whether either\nof the types provide explicit support for the comparison.  Most\nnumeric types can be compared with one another.  When cross-type\ncomparison is not supported, the comparison method returns\n"NotImplemented".\n\nThe operators "in" and "not in" test for membership.  "x in s"\nevaluates to true if *x* is a member of *s*, and false otherwise.  "x\nnot in s" returns the negation of "x in s".  All built-in sequences\nand set types support this as well as dictionary, for which "in" tests\nwhether a the dictionary has a given key. For container types such as\nlist, tuple, set, frozenset, dict, or collections.deque, the\nexpression "x in y" is equivalent to "any(x is e or x == e for e in\ny)".\n\nFor the string and bytes types, "x in y" is true if and only if *x* is\na substring of *y*.  An equivalent test is "y.find(x) != -1".  Empty\nstrings are always considered to be a substring of any other string,\nso """ in "abc"" will return "True".\n\nFor user-defined classes which define the "__contains__()" method, "x\nin y" is true if and only if "y.__contains__(x)" is true.\n\nFor user-defined classes which do not define "__contains__()" but do\ndefine "__iter__()", "x in y" is true if some value "z" with "x == z"\nis produced while iterating over "y".  If an exception is raised\nduring the iteration, it is as if "in" raised that exception.\n\nLastly, the old-style iteration protocol is tried: if a class defines\n"__getitem__()", "x in y" is true if and only if there is a non-\nnegative integer index *i* such that "x == y[i]", and all lower\ninteger indices do not raise "IndexError" exception.  (If any other\nexception is raised, it is as if "in" raised that exception).\n\nThe operator "not in" is defined to have the inverse true value of\n"in".\n\nThe operators "is" and "is not" test for object identity: "x is y" is\ntrue if and only if *x* and *y* are the same object.  "x is not y"\nyields the inverse truth value. [4]\n',
+ 'import': '\nThe "import" statement\n**********************\n\n   import_stmt     ::= "import" module ["as" name] ( "," module ["as" name] )*\n                   | "from" relative_module "import" identifier ["as" name]\n                   ( "," identifier ["as" name] )*\n                   | "from" relative_module "import" "(" identifier ["as" name]\n                   ( "," identifier ["as" name] )* [","] ")"\n                   | "from" module "import" "*"\n   module          ::= (identifier ".")* identifier\n   relative_module ::= "."* module | "."+\n   name            ::= identifier\n\nThe basic import statement (no "from" clause) is executed in two\nsteps:\n\n1. find a module, loading and initializing it if necessary\n\n2. define a name or names in the local namespace for the scope\n   where the "import" statement occurs.\n\nWhen the statement contains multiple clauses (separated by commas) the\ntwo steps are carried out separately for each clause, just as though\nthe clauses had been separated out into individiual import statements.\n\nThe details of the first step, finding and loading modules are\ndescribed in greater detail in the section on the *import system*,\nwhich also describes the various types of packages and modules that\ncan be imported, as well as all the hooks that can be used to\ncustomize the import system. Note that failures in this step may\nindicate either that the module could not be located, *or* that an\nerror occurred while initializing the module, which includes execution\nof the module\'s code.\n\nIf the requested module is retrieved successfully, it will be made\navailable in the local namespace in one of three ways:\n\n* If the module name is followed by "as", then the name following\n  "as" is bound directly to the imported module.\n\n* If no other name is specified, and the module being imported is a\n  top level module, the module\'s name is bound in the local namespace\n  as a reference to the imported module\n\n* If the module being imported is *not* a top level module, then the\n  name of the top level package that contains the module is bound in\n  the local namespace as a reference to the top level package. The\n  imported module must be accessed using its full qualified name\n  rather than directly\n\nThe "from" form uses a slightly more complex process:\n\n1. find the module specified in the "from" clause, loading and\n   initializing it if necessary;\n\n2. for each of the identifiers specified in the "import" clauses:\n\n   1. check if the imported module has an attribute by that name\n\n   2. if not, attempt to import a submodule with that name and then\n      check the imported module again for that attribute\n\n   3. if the attribute is not found, "ImportError" is raised.\n\n   4. otherwise, a reference to that value is stored in the local\n      namespace, using the name in the "as" clause if it is present,\n      otherwise using the attribute name\n\nExamples:\n\n   import foo                 # foo imported and bound locally\n   import foo.bar.baz         # foo.bar.baz imported, foo bound locally\n   import foo.bar.baz as fbb  # foo.bar.baz imported and bound as fbb\n   from foo.bar import baz    # foo.bar.baz imported and bound as baz\n   from foo import attr       # foo imported and foo.attr bound as attr\n\nIf the list of identifiers is replaced by a star ("\'*\'"), all public\nnames defined in the module are bound in the local namespace for the\nscope where the "import" statement occurs.\n\nThe *public names* defined by a module are determined by checking the\nmodule\'s namespace for a variable named "__all__"; if defined, it must\nbe a sequence of strings which are names defined or imported by that\nmodule.  The names given in "__all__" are all considered public and\nare required to exist.  If "__all__" is not defined, the set of public\nnames includes all names found in the module\'s namespace which do not\nbegin with an underscore character ("\'_\'").  "__all__" should contain\nthe entire public API. It is intended to avoid accidentally exporting\nitems that are not part of the API (such as library modules which were\nimported and used within the module).\n\nThe "from" form with "*" may only occur in a module scope.  The wild\ncard form of import --- "from module import *" --- is only allowed at\nthe module level.  Attempting to use it in class or function\ndefinitions will raise a "SyntaxError".\n\nWhen specifying what module to import you do not have to specify the\nabsolute name of the module. When a module or package is contained\nwithin another package it is possible to make a relative import within\nthe same top package without having to mention the package name. By\nusing leading dots in the specified module or package after "from" you\ncan specify how high to traverse up the current package hierarchy\nwithout specifying exact names. One leading dot means the current\npackage where the module making the import exists. Two dots means up\none package level. Three dots is up two levels, etc. So if you execute\n"from . import mod" from a module in the "pkg" package then you will\nend up importing "pkg.mod". If you execute "from ..subpkg2 import mod"\nfrom within "pkg.subpkg1" you will import "pkg.subpkg2.mod". The\nspecification for relative imports is contained within **PEP 328**.\n\n"importlib.import_module()" is provided to support applications that\ndetermine dynamically the modules to be loaded.\n\n\nFuture statements\n=================\n\nA *future statement* is a directive to the compiler that a particular\nmodule should be compiled using syntax or semantics that will be\navailable in a specified future release of Python where the feature\nbecomes standard.\n\nThe future statement is intended to ease migration to future versions\nof Python that introduce incompatible changes to the language.  It\nallows use of the new features on a per-module basis before the\nrelease in which the feature becomes standard.\n\n   future_statement ::= "from" "__future__" "import" feature ["as" name]\n                        ("," feature ["as" name])*\n                        | "from" "__future__" "import" "(" feature ["as" name]\n                        ("," feature ["as" name])* [","] ")"\n   feature          ::= identifier\n   name             ::= identifier\n\nA future statement must appear near the top of the module.  The only\nlines that can appear before a future statement are:\n\n* the module docstring (if any),\n\n* comments,\n\n* blank lines, and\n\n* other future statements.\n\nThe features recognized by Python 3.0 are "absolute_import",\n"division", "generators", "unicode_literals", "print_function",\n"nested_scopes" and "with_statement".  They are all redundant because\nthey are always enabled, and only kept for backwards compatibility.\n\nA future statement is recognized and treated specially at compile\ntime: Changes to the semantics of core constructs are often\nimplemented by generating different code.  It may even be the case\nthat a new feature introduces new incompatible syntax (such as a new\nreserved word), in which case the compiler may need to parse the\nmodule differently.  Such decisions cannot be pushed off until\nruntime.\n\nFor any given release, the compiler knows which feature names have\nbeen defined, and raises a compile-time error if a future statement\ncontains a feature not known to it.\n\nThe direct runtime semantics are the same as for any import statement:\nthere is a standard module "__future__", described later, and it will\nbe imported in the usual way at the time the future statement is\nexecuted.\n\nThe interesting runtime semantics depend on the specific feature\nenabled by the future statement.\n\nNote that there is nothing special about the statement:\n\n   import __future__ [as name]\n\nThat is not a future statement; it\'s an ordinary import statement with\nno special semantics or syntax restrictions.\n\nCode compiled by calls to the built-in functions "exec()" and\n"compile()" that occur in a module "M" containing a future statement\nwill, by default, use the new syntax or semantics associated with the\nfuture statement.  This can be controlled by optional arguments to\n"compile()" --- see the documentation of that function for details.\n\nA future statement typed at an interactive interpreter prompt will\ntake effect for the rest of the interpreter session.  If an\ninterpreter is started with the *-i* option, is passed a script name\nto execute, and the script includes a future statement, it will be in\neffect in the interactive session started after the script is\nexecuted.\n\nSee also: **PEP 236** - Back to the __future__\n\n     The original proposal for the __future__ mechanism.\n',
+ 'in': '\nComparisons\n***********\n\nUnlike C, all comparison operations in Python have the same priority,\nwhich is lower than that of any arithmetic, shifting or bitwise\noperation.  Also unlike C, expressions like "a < b < c" have the\ninterpretation that is conventional in mathematics:\n\n   comparison    ::= or_expr ( comp_operator or_expr )*\n   comp_operator ::= "<" | ">" | "==" | ">=" | "<=" | "!="\n                     | "is" ["not"] | ["not"] "in"\n\nComparisons yield boolean values: "True" or "False".\n\nComparisons can be chained arbitrarily, e.g., "x < y <= z" is\nequivalent to "x < y and y <= z", except that "y" is evaluated only\nonce (but in both cases "z" is not evaluated at all when "x < y" is\nfound to be false).\n\nFormally, if *a*, *b*, *c*, ..., *y*, *z* are expressions and *op1*,\n*op2*, ..., *opN* are comparison operators, then "a op1 b op2 c ... y\nopN z" is equivalent to "a op1 b and b op2 c and ... y opN z", except\nthat each expression is evaluated at most once.\n\nNote that "a op1 b op2 c" doesn\'t imply any kind of comparison between\n*a* and *c*, so that, e.g., "x < y > z" is perfectly legal (though\nperhaps not pretty).\n\nThe operators "<", ">", "==", ">=", "<=", and "!=" compare the values\nof two objects.  The objects need not have the same type. If both are\nnumbers, they are converted to a common type.  Otherwise, the "==" and\n"!=" operators *always* consider objects of different types to be\nunequal, while the "<", ">", ">=" and "<=" operators raise a\n"TypeError" when comparing objects of different types that do not\nimplement these operators for the given pair of types.  You can\ncontrol comparison behavior of objects of non-built-in types by\ndefining rich comparison methods like "__gt__()", described in section\n*Basic customization*.\n\nComparison of objects of the same type depends on the type:\n\n* Numbers are compared arithmetically.\n\n* The values "float(\'NaN\')" and "Decimal(\'NaN\')" are special. The\n  are identical to themselves, "x is x" but are not equal to\n  themselves, "x != x".  Additionally, comparing any value to a\n  not-a-number value will return "False".  For example, both "3 <\n  float(\'NaN\')" and "float(\'NaN\') < 3" will return "False".\n\n* Bytes objects are compared lexicographically using the numeric\n  values of their elements.\n\n* Strings are compared lexicographically using the numeric\n  equivalents (the result of the built-in function "ord()") of their\n  characters. [3] String and bytes object can\'t be compared!\n\n* Tuples and lists are compared lexicographically using comparison\n  of corresponding elements.  This means that to compare equal, each\n  element must compare equal and the two sequences must be of the same\n  type and have the same length.\n\n  If not equal, the sequences are ordered the same as their first\n  differing elements.  For example, "[1,2,x] <= [1,2,y]" has the same\n  value as "x <= y".  If the corresponding element does not exist, the\n  shorter sequence is ordered first (for example, "[1,2] < [1,2,3]").\n\n* Mappings (dictionaries) compare equal if and only if they have the\n  same "(key, value)" pairs. Order comparisons "(\'<\', \'<=\', \'>=\',\n  \'>\')" raise "TypeError".\n\n* Sets and frozensets define comparison operators to mean subset and\n  superset tests.  Those relations do not define total orderings (the\n  two sets "{1,2}" and {2,3} are not equal, nor subsets of one\n  another, nor supersets of one another).  Accordingly, sets are not\n  appropriate arguments for functions which depend on total ordering.\n  For example, "min()", "max()", and "sorted()" produce undefined\n  results given a list of sets as inputs.\n\n* Most other objects of built-in types compare unequal unless they\n  are the same object; the choice whether one object is considered\n  smaller or larger than another one is made arbitrarily but\n  consistently within one execution of a program.\n\nComparison of objects of differing types depends on whether either of\nthe types provide explicit support for the comparison.  Most numeric\ntypes can be compared with one another.  When cross-type comparison is\nnot supported, the comparison method returns "NotImplemented".\n\nThe operators "in" and "not in" test for membership.  "x in s"\nevaluates to true if *x* is a member of *s*, and false otherwise.  "x\nnot in s" returns the negation of "x in s".  All built-in sequences\nand set types support this as well as dictionary, for which "in" tests\nwhether the dictionary has a given key. For container types such as\nlist, tuple, set, frozenset, dict, or collections.deque, the\nexpression "x in y" is equivalent to "any(x is e or x == e for e in\ny)".\n\nFor the string and bytes types, "x in y" is true if and only if *x* is\na substring of *y*.  An equivalent test is "y.find(x) != -1".  Empty\nstrings are always considered to be a substring of any other string,\nso """ in "abc"" will return "True".\n\nFor user-defined classes which define the "__contains__()" method, "x\nin y" is true if and only if "y.__contains__(x)" is true.\n\nFor user-defined classes which do not define "__contains__()" but do\ndefine "__iter__()", "x in y" is true if some value "z" with "x == z"\nis produced while iterating over "y".  If an exception is raised\nduring the iteration, it is as if "in" raised that exception.\n\nLastly, the old-style iteration protocol is tried: if a class defines\n"__getitem__()", "x in y" is true if and only if there is a non-\nnegative integer index *i* such that "x == y[i]", and all lower\ninteger indices do not raise "IndexError" exception.  (If any other\nexception is raised, it is as if "in" raised that exception).\n\nThe operator "not in" is defined to have the inverse true value of\n"in".\n\nThe operators "is" and "is not" test for object identity: "x is y" is\ntrue if and only if *x* and *y* are the same object.  "x is not y"\nyields the inverse truth value. [4]\n',
  'integers': '\nInteger literals\n****************\n\nInteger literals are described by the following lexical definitions:\n\n   integer        ::= decimalinteger | octinteger | hexinteger | bininteger\n   decimalinteger ::= nonzerodigit digit* | "0"+\n   nonzerodigit   ::= "1"..."9"\n   digit          ::= "0"..."9"\n   octinteger     ::= "0" ("o" | "O") octdigit+\n   hexinteger     ::= "0" ("x" | "X") hexdigit+\n   bininteger     ::= "0" ("b" | "B") bindigit+\n   octdigit       ::= "0"..."7"\n   hexdigit       ::= digit | "a"..."f" | "A"..."F"\n   bindigit       ::= "0" | "1"\n\nThere is no limit for the length of integer literals apart from what\ncan be stored in available memory.\n\nNote that leading zeros in a non-zero decimal number are not allowed.\nThis is for disambiguation with C-style octal literals, which Python\nused before version 3.0.\n\nSome examples of integer literals:\n\n   7     2147483647                        0o177    0b100110111\n   3     79228162514264337593543950336     0o377    0x100000000\n         79228162514264337593543950336              0xdeadbeef\n',
- 'lambda': '\nLambdas\n*******\n\n   lambda_expr        ::= "lambda" [parameter_list]: expression\n   lambda_expr_nocond ::= "lambda" [parameter_list]: expression_nocond\n\nLambda expressions (sometimes called lambda forms) have the same\nsyntactic position as expressions.  They are a shorthand to create\nanonymous functions; the expression "lambda arguments: expression"\nyields a function object.  The unnamed object behaves like a function\nobject defined with\n\n   def <lambda>(arguments):\n       return expression\n\nSee section *Function definitions* for the syntax of parameter lists.\nNote that functions created with lambda expressions cannot contain\nstatements or annotations.\n',
+ 'lambda': '\nLambdas\n*******\n\n   lambda_expr        ::= "lambda" [parameter_list]: expression\n   lambda_expr_nocond ::= "lambda" [parameter_list]: expression_nocond\n\nLambda expressions (sometimes called lambda forms) are used to create\nanonymous functions. The expression "lambda arguments: expression"\nyields a function object.  The unnamed object behaves like a function\nobject defined with\n\n   def <lambda>(arguments):\n       return expression\n\nSee section *Function definitions* for the syntax of parameter lists.\nNote that functions created with lambda expressions cannot contain\nstatements or annotations.\n',
  'lists': '\nList displays\n*************\n\nA list display is a possibly empty series of expressions enclosed in\nsquare brackets:\n\n   list_display ::= "[" [expression_list | comprehension] "]"\n\nA list display yields a new list object, the contents being specified\nby either a list of expressions or a comprehension.  When a comma-\nseparated list of expressions is supplied, its elements are evaluated\nfrom left to right and placed into the list object in that order.\nWhen a comprehension is supplied, the list is constructed from the\nelements resulting from the comprehension.\n',
- 'naming': '\nNaming and binding\n******************\n\n*Names* refer to objects.  Names are introduced by name binding\noperations. Each occurrence of a name in the program text refers to\nthe *binding* of that name established in the innermost function block\ncontaining the use.\n\nA *block* is a piece of Python program text that is executed as a\nunit. The following are blocks: a module, a function body, and a class\ndefinition. Each command typed interactively is a block.  A script\nfile (a file given as standard input to the interpreter or specified\non the interpreter command line the first argument) is a code block.\nA script command (a command specified on the interpreter command line\nwith the \'**-c**\' option) is a code block.  The string argument passed\nto the built-in functions "eval()" and "exec()" is a code block.\n\nA code block is executed in an *execution frame*.  A frame contains\nsome administrative information (used for debugging) and determines\nwhere and how execution continues after the code block\'s execution has\ncompleted.\n\nA *scope* defines the visibility of a name within a block.  If a local\nvariable is defined in a block, its scope includes that block.  If the\ndefinition occurs in a function block, the scope extends to any blocks\ncontained within the defining one, unless a contained block introduces\na different binding for the name.  The scope of names defined in a\nclass block is limited to the class block; it does not extend to the\ncode blocks of methods -- this includes comprehensions and generator\nexpressions since they are implemented using a function scope.  This\nmeans that the following will fail:\n\n   class A:\n       a = 42\n       b = list(a + i for i in range(10))\n\nWhen a name is used in a code block, it is resolved using the nearest\nenclosing scope.  The set of all such scopes visible to a code block\nis called the block\'s *environment*.\n\nIf a name is bound in a block, it is a local variable of that block,\nunless declared as "nonlocal".  If a name is bound at the module\nlevel, it is a global variable.  (The variables of the module code\nblock are local and global.)  If a variable is used in a code block\nbut not defined there, it is a *free variable*.\n\nWhen a name is not found at all, a "NameError" exception is raised.\nIf the name refers to a local variable that has not been bound, a\n"UnboundLocalError" exception is raised.  "UnboundLocalError" is a\nsubclass of "NameError".\n\nThe following constructs bind names: formal parameters to functions,\n"import" statements, class and function definitions (these bind the\nclass or function name in the defining block), and targets that are\nidentifiers if occurring in an assignment, "for" loop header, or after\n"as" in a "with" statement or "except" clause. The "import" statement\nof the form "from ... import *" binds all names defined in the\nimported module, except those beginning with an underscore.  This form\nmay only be used at the module level.\n\nA target occurring in a "del" statement is also considered bound for\nthis purpose (though the actual semantics are to unbind the name).\n\nEach assignment or import statement occurs within a block defined by a\nclass or function definition or at the module level (the top-level\ncode block).\n\nIf a name binding operation occurs anywhere within a code block, all\nuses of the name within the block are treated as references to the\ncurrent block.  This can lead to errors when a name is used within a\nblock before it is bound.  This rule is subtle.  Python lacks\ndeclarations and allows name binding operations to occur anywhere\nwithin a code block.  The local variables of a code block can be\ndetermined by scanning the entire text of the block for name binding\noperations.\n\nIf the "global" statement occurs within a block, all uses of the name\nspecified in the statement refer to the binding of that name in the\ntop-level namespace.  Names are resolved in the top-level namespace by\nsearching the global namespace, i.e. the namespace of the module\ncontaining the code block, and the builtins namespace, the namespace\nof the module "builtins".  The global namespace is searched first.  If\nthe name is not found there, the builtins namespace is searched.  The\nglobal statement must precede all uses of the name.\n\nThe builtins namespace associated with the execution of a code block\nis actually found by looking up the name "__builtins__" in its global\nnamespace; this should be a dictionary or a module (in the latter case\nthe module\'s dictionary is used).  By default, when in the "__main__"\nmodule, "__builtins__" is the built-in module "builtins"; when in any\nother module, "__builtins__" is an alias for the dictionary of the\n"builtins" module itself.  "__builtins__" can be set to a user-created\ndictionary to create a weak form of restricted execution.\n\n**CPython implementation detail:** Users should not touch\n"__builtins__"; it is strictly an implementation detail.  Users\nwanting to override values in the builtins namespace should "import"\nthe "builtins" module and modify its attributes appropriately.\n\nThe namespace for a module is automatically created the first time a\nmodule is imported.  The main module for a script is always called\n"__main__".\n\nThe "global" statement has the same scope as a name binding operation\nin the same block.  If the nearest enclosing scope for a free variable\ncontains a global statement, the free variable is treated as a global.\n\nA class definition is an executable statement that may use and define\nnames. These references follow the normal rules for name resolution.\nThe namespace of the class definition becomes the attribute dictionary\nof the class.  Names defined at the class scope are not visible in\nmethods.\n\n\nInteraction with dynamic features\n=================================\n\nThere are several cases where Python statements are illegal when used\nin conjunction with nested scopes that contain free variables.\n\nIf a variable is referenced in an enclosing scope, it is illegal to\ndelete the name.  An error will be reported at compile time.\n\nIf the wild card form of import --- "import *" --- is used in a\nfunction and the function contains or is a nested block with free\nvariables, the compiler will raise a "SyntaxError".\n\nThe "eval()" and "exec()" functions do not have access to the full\nenvironment for resolving names.  Names may be resolved in the local\nand global namespaces of the caller.  Free variables are not resolved\nin the nearest enclosing namespace, but in the global namespace.  [1]\nThe "exec()" and "eval()" functions have optional arguments to\noverride the global and local namespace.  If only one namespace is\nspecified, it is used for both.\n',
- 'nonlocal': '\nThe "nonlocal" statement\n************************\n\n   nonlocal_stmt ::= "nonlocal" identifier ("," identifier)*\n\nThe "nonlocal" statement causes the listed identifiers to refer to\npreviously bound variables in the nearest enclosing scope.  This is\nimportant because the default behavior for binding is to search the\nlocal namespace first.  The statement allows encapsulated code to\nrebind variables outside of the local scope besides the global\n(module) scope.\n\nNames listed in a "nonlocal" statement, unlike to those listed in a\n"global" statement, must refer to pre-existing bindings in an\nenclosing scope (the scope in which a new binding should be created\ncannot be determined unambiguously).\n\nNames listed in a "nonlocal" statement must not collide with pre-\nexisting bindings in the local scope.\n\nSee also: **PEP 3104** - Access to Names in Outer Scopes\n\n     The specification for the "nonlocal" statement.\n',
+ 'naming': '\nNaming and binding\n******************\n\n*Names* refer to objects.  Names are introduced by name binding\noperations. Each occurrence of a name in the program text refers to\nthe *binding* of that name established in the innermost function block\ncontaining the use.\n\nA *block* is a piece of Python program text that is executed as a\nunit. The following are blocks: a module, a function body, and a class\ndefinition. Each command typed interactively is a block.  A script\nfile (a file given as standard input to the interpreter or specified\nas a command line argument to the interpreter) is a code block.  A\nscript command (a command specified on the interpreter command line\nwith the \'**-c**\' option) is a code block.  The string argument passed\nto the built-in functions "eval()" and "exec()" is a code block.\n\nA code block is executed in an *execution frame*.  A frame contains\nsome administrative information (used for debugging) and determines\nwhere and how execution continues after the code block\'s execution has\ncompleted.\n\nA *scope* defines the visibility of a name within a block.  If a local\nvariable is defined in a block, its scope includes that block.  If the\ndefinition occurs in a function block, the scope extends to any blocks\ncontained within the defining one, unless a contained block introduces\na different binding for the name.  The scope of names defined in a\nclass block is limited to the class block; it does not extend to the\ncode blocks of methods -- this includes comprehensions and generator\nexpressions since they are implemented using a function scope.  This\nmeans that the following will fail:\n\n   class A:\n       a = 42\n       b = list(a + i for i in range(10))\n\nWhen a name is used in a code block, it is resolved using the nearest\nenclosing scope.  The set of all such scopes visible to a code block\nis called the block\'s *environment*.\n\nIf a name is bound in a block, it is a local variable of that block,\nunless declared as "nonlocal".  If a name is bound at the module\nlevel, it is a global variable.  (The variables of the module code\nblock are local and global.)  If a variable is used in a code block\nbut not defined there, it is a *free variable*.\n\nWhen a name is not found at all, a "NameError" exception is raised.\nIf the name refers to a local variable that has not been bound, an\n"UnboundLocalError" exception is raised.  "UnboundLocalError" is a\nsubclass of "NameError".\n\nThe following constructs bind names: formal parameters to functions,\n"import" statements, class and function definitions (these bind the\nclass or function name in the defining block), and targets that are\nidentifiers if occurring in an assignment, "for" loop header, or after\n"as" in a "with" statement or "except" clause. The "import" statement\nof the form "from ... import *" binds all names defined in the\nimported module, except those beginning with an underscore.  This form\nmay only be used at the module level.\n\nA target occurring in a "del" statement is also considered bound for\nthis purpose (though the actual semantics are to unbind the name).\n\nEach assignment or import statement occurs within a block defined by a\nclass or function definition or at the module level (the top-level\ncode block).\n\nIf a name binding operation occurs anywhere within a code block, all\nuses of the name within the block are treated as references to the\ncurrent block.  This can lead to errors when a name is used within a\nblock before it is bound.  This rule is subtle.  Python lacks\ndeclarations and allows name binding operations to occur anywhere\nwithin a code block.  The local variables of a code block can be\ndetermined by scanning the entire text of the block for name binding\noperations.\n\nIf the "global" statement occurs within a block, all uses of the name\nspecified in the statement refer to the binding of that name in the\ntop-level namespace.  Names are resolved in the top-level namespace by\nsearching the global namespace, i.e. the namespace of the module\ncontaining the code block, and the builtins namespace, the namespace\nof the module "builtins".  The global namespace is searched first.  If\nthe name is not found there, the builtins namespace is searched.  The\nglobal statement must precede all uses of the name.\n\nThe builtins namespace associated with the execution of a code block\nis actually found by looking up the name "__builtins__" in its global\nnamespace; this should be a dictionary or a module (in the latter case\nthe module\'s dictionary is used).  By default, when in the "__main__"\nmodule, "__builtins__" is the built-in module "builtins"; when in any\nother module, "__builtins__" is an alias for the dictionary of the\n"builtins" module itself.  "__builtins__" can be set to a user-created\ndictionary to create a weak form of restricted execution.\n\n**CPython implementation detail:** Users should not touch\n"__builtins__"; it is strictly an implementation detail.  Users\nwanting to override values in the builtins namespace should "import"\nthe "builtins" module and modify its attributes appropriately.\n\nThe namespace for a module is automatically created the first time a\nmodule is imported.  The main module for a script is always called\n"__main__".\n\nThe "global" statement has the same scope as a name binding operation\nin the same block.  If the nearest enclosing scope for a free variable\ncontains a global statement, the free variable is treated as a global.\n\nA class definition is an executable statement that may use and define\nnames. These references follow the normal rules for name resolution.\nThe namespace of the class definition becomes the attribute dictionary\nof the class.  Names defined at the class scope are not visible in\nmethods.\n\n\nInteraction with dynamic features\n=================================\n\nThere are several cases where Python statements are illegal when used\nin conjunction with nested scopes that contain free variables.\n\nIf a variable is referenced in an enclosing scope, it is illegal to\ndelete the name.  An error will be reported at compile time.\n\nIf the wild card form of import --- "import *" --- is used in a\nfunction and the function contains or is a nested block with free\nvariables, the compiler will raise a "SyntaxError".\n\nThe "eval()" and "exec()" functions do not have access to the full\nenvironment for resolving names.  Names may be resolved in the local\nand global namespaces of the caller.  Free variables are not resolved\nin the nearest enclosing namespace, but in the global namespace.  [1]\nThe "exec()" and "eval()" functions have optional arguments to\noverride the global and local namespace.  If only one namespace is\nspecified, it is used for both.\n',
+ 'nonlocal': '\nThe "nonlocal" statement\n************************\n\n   nonlocal_stmt ::= "nonlocal" identifier ("," identifier)*\n\nThe "nonlocal" statement causes the listed identifiers to refer to\npreviously bound variables in the nearest enclosing scope excluding\nglobals. This is important because the default behavior for binding is\nto search the local namespace first.  The statement allows\nencapsulated code to rebind variables outside of the local scope\nbesides the global (module) scope.\n\nNames listed in a "nonlocal" statement, unlike those listed in a\n"global" statement, must refer to pre-existing bindings in an\nenclosing scope (the scope in which a new binding should be created\ncannot be determined unambiguously).\n\nNames listed in a "nonlocal" statement must not collide with pre-\nexisting bindings in the local scope.\n\nSee also: **PEP 3104** - Access to Names in Outer Scopes\n\n     The specification for the "nonlocal" statement.\n',
  'numbers': '\nNumeric literals\n****************\n\nThere are three types of numeric literals: integers, floating point\nnumbers, and imaginary numbers.  There are no complex literals\n(complex numbers can be formed by adding a real number and an\nimaginary number).\n\nNote that numeric literals do not include a sign; a phrase like "-1"\nis actually an expression composed of the unary operator \'"-"\' and the\nliteral "1".\n',
- 'numeric-types': '\nEmulating numeric types\n***********************\n\nThe following methods can be defined to emulate numeric objects.\nMethods corresponding to operations that are not supported by the\nparticular kind of number implemented (e.g., bitwise operations for\nnon-integral numbers) should be left undefined.\n\nobject.__add__(self, other)\nobject.__sub__(self, other)\nobject.__mul__(self, other)\nobject.__truediv__(self, other)\nobject.__floordiv__(self, other)\nobject.__mod__(self, other)\nobject.__divmod__(self, other)\nobject.__pow__(self, other[, modulo])\nobject.__lshift__(self, other)\nobject.__rshift__(self, other)\nobject.__and__(self, other)\nobject.__xor__(self, other)\nobject.__or__(self, other)\n\n   These methods are called to implement the binary arithmetic\n   operations ("+", "-", "*", "/", "//", "%", "divmod()", "pow()",\n   "**", "<<", ">>", "&", "^", "|").  For instance, to evaluate the\n   expression "x + y", where *x* is an instance of a class that has an\n   "__add__()" method, "x.__add__(y)" is called.  The "__divmod__()"\n   method should be the equivalent to using "__floordiv__()" and\n   "__mod__()"; it should not be related to "__truediv__()".  Note\n   that "__pow__()" should be defined to accept an optional third\n   argument if the ternary version of the built-in "pow()" function is\n   to be supported.\n\n   If one of those methods does not support the operation with the\n   supplied arguments, it should return "NotImplemented".\n\nobject.__radd__(self, other)\nobject.__rsub__(self, other)\nobject.__rmul__(self, other)\nobject.__rtruediv__(self, other)\nobject.__rfloordiv__(self, other)\nobject.__rmod__(self, other)\nobject.__rdivmod__(self, other)\nobject.__rpow__(self, other)\nobject.__rlshift__(self, other)\nobject.__rrshift__(self, other)\nobject.__rand__(self, other)\nobject.__rxor__(self, other)\nobject.__ror__(self, other)\n\n   These methods are called to implement the binary arithmetic\n   operations ("+", "-", "*", "/", "//", "%", "divmod()", "pow()",\n   "**", "<<", ">>", "&", "^", "|") with reflected (swapped) operands.\n   These functions are only called if the left operand does not\n   support the corresponding operation and the operands are of\n   different types. [2]  For instance, to evaluate the expression "x -\n   y", where *y* is an instance of a class that has an "__rsub__()"\n   method, "y.__rsub__(x)" is called if "x.__sub__(y)" returns\n   *NotImplemented*.\n\n   Note that ternary "pow()" will not try calling "__rpow__()" (the\n   coercion rules would become too complicated).\n\n   Note: If the right operand\'s type is a subclass of the left\n     operand\'s type and that subclass provides the reflected method\n     for the operation, this method will be called before the left\n     operand\'s non-reflected method.  This behavior allows subclasses\n     to override their ancestors\' operations.\n\nobject.__iadd__(self, other)\nobject.__isub__(self, other)\nobject.__imul__(self, other)\nobject.__itruediv__(self, other)\nobject.__ifloordiv__(self, other)\nobject.__imod__(self, other)\nobject.__ipow__(self, other[, modulo])\nobject.__ilshift__(self, other)\nobject.__irshift__(self, other)\nobject.__iand__(self, other)\nobject.__ixor__(self, other)\nobject.__ior__(self, other)\n\n   These methods are called to implement the augmented arithmetic\n   assignments ("+=", "-=", "*=", "/=", "//=", "%=", "**=", "<<=",\n   ">>=", "&=", "^=", "|=").  These methods should attempt to do the\n   operation in-place (modifying *self*) and return the result (which\n   could be, but does not have to be, *self*).  If a specific method\n   is not defined, the augmented assignment falls back to the normal\n   methods.  For instance, to execute the statement "x += y", where\n   *x* is an instance of a class that has an "__iadd__()" method,\n   "x.__iadd__(y)" is called.  If *x* is an instance of a class that\n   does not define a "__iadd__()" method, "x.__add__(y)" and\n   "y.__radd__(x)" are considered, as with the evaluation of "x + y".\n\nobject.__neg__(self)\nobject.__pos__(self)\nobject.__abs__(self)\nobject.__invert__(self)\n\n   Called to implement the unary arithmetic operations ("-", "+",\n   "abs()" and "~").\n\nobject.__complex__(self)\nobject.__int__(self)\nobject.__float__(self)\nobject.__round__(self[, n])\n\n   Called to implement the built-in functions "complex()", "int()",\n   "float()" and "round()".  Should return a value of the appropriate\n   type.\n\nobject.__index__(self)\n\n   Called to implement "operator.index()".  Also called whenever\n   Python needs an integer object (such as in slicing, or in the\n   built-in "bin()", "hex()" and "oct()" functions). Must return an\n   integer.\n',
- 'objects': '\nObjects, values and types\n*************************\n\n*Objects* are Python\'s abstraction for data.  All data in a Python\nprogram is represented by objects or by relations between objects. (In\na sense, and in conformance to Von Neumann\'s model of a "stored\nprogram computer," code is also represented by objects.)\n\nEvery object has an identity, a type and a value.  An object\'s\n*identity* never changes once it has been created; you may think of it\nas the object\'s address in memory.  The \'"is"\' operator compares the\nidentity of two objects; the "id()" function returns an integer\nrepresenting its identity.\n\n**CPython implementation detail:** For CPython, "id(x)" is the memory\naddress where "x" is stored.\n\nAn object\'s type determines the operations that the object supports\n(e.g., "does it have a length?") and also defines the possible values\nfor objects of that type.  The "type()" function returns an object\'s\ntype (which is an object itself).  Like its identity, an object\'s\n*type* is also unchangeable. [1]\n\nThe *value* of some objects can change.  Objects whose value can\nchange are said to be *mutable*; objects whose value is unchangeable\nonce they are created are called *immutable*. (The value of an\nimmutable container object that contains a reference to a mutable\nobject can change when the latter\'s value is changed; however the\ncontainer is still considered immutable, because the collection of\nobjects it contains cannot be changed.  So, immutability is not\nstrictly the same as having an unchangeable value, it is more subtle.)\nAn object\'s mutability is determined by its type; for instance,\nnumbers, strings and tuples are immutable, while dictionaries and\nlists are mutable.\n\nObjects are never explicitly destroyed; however, when they become\nunreachable they may be garbage-collected.  An implementation is\nallowed to postpone garbage collection or omit it altogether --- it is\na matter of implementation quality how garbage collection is\nimplemented, as long as no objects are collected that are still\nreachable.\n\n**CPython implementation detail:** CPython currently uses a reference-\ncounting scheme with (optional) delayed detection of cyclically linked\ngarbage, which collects most objects as soon as they become\nunreachable, but is not guaranteed to collect garbage containing\ncircular references.  See the documentation of the "gc" module for\ninformation on controlling the collection of cyclic garbage. Other\nimplementations act differently and CPython may change. Do not depend\non immediate finalization of objects when they become unreachable (ex:\nalways close files).\n\nNote that the use of the implementation\'s tracing or debugging\nfacilities may keep objects alive that would normally be collectable.\nAlso note that catching an exception with a \'"try"..."except"\'\nstatement may keep objects alive.\n\nSome objects contain references to "external" resources such as open\nfiles or windows.  It is understood that these resources are freed\nwhen the object is garbage-collected, but since garbage collection is\nnot guaranteed to happen, such objects also provide an explicit way to\nrelease the external resource, usually a "close()" method. Programs\nare strongly recommended to explicitly close such objects.  The\n\'"try"..."finally"\' statement and the \'"with"\' statement provide\nconvenient ways to do this.\n\nSome objects contain references to other objects; these are called\n*containers*. Examples of containers are tuples, lists and\ndictionaries.  The references are part of a container\'s value.  In\nmost cases, when we talk about the value of a container, we imply the\nvalues, not the identities of the contained objects; however, when we\ntalk about the mutability of a container, only the identities of the\nimmediately contained objects are implied.  So, if an immutable\ncontainer (like a tuple) contains a reference to a mutable object, its\nvalue changes if that mutable object is changed.\n\nTypes affect almost all aspects of object behavior.  Even the\nimportance of object identity is affected in some sense: for immutable\ntypes, operations that compute new values may actually return a\nreference to any existing object with the same type and value, while\nfor mutable objects this is not allowed.  E.g., after "a = 1; b = 1",\n"a" and "b" may or may not refer to the same object with the value\none, depending on the implementation, but after "c = []; d = []", "c"\nand "d" are guaranteed to refer to two different, unique, newly\ncreated empty lists. (Note that "c = d = []" assigns the same object\nto both "c" and "d".)\n',
- 'operator-summary': '\nOperator precedence\n*******************\n\nThe following table summarizes the operator precedences in Python,\nfrom lowest precedence (least binding) to highest precedence (most\nbinding).  Operators in the same box have the same precedence.  Unless\nthe syntax is explicitly given, operators are binary.  Operators in\nthe same box group left to right (except for comparisons, including\ntests, which all have the same precedence and chain from left to right\n--- see section *Comparisons* --- and exponentiation, which groups\nfrom right to left).\n\n+-------------------------------------------------+---------------------------------------+\n| Operator                                        | Description                           |\n+=================================================+=======================================+\n| "lambda"                                        | Lambda expression                     |\n+-------------------------------------------------+---------------------------------------+\n| "if" -- "else"                                  | Conditional expression                |\n+-------------------------------------------------+---------------------------------------+\n| "or"                                            | Boolean OR                            |\n+-------------------------------------------------+---------------------------------------+\n| "and"                                           | Boolean AND                           |\n+-------------------------------------------------+---------------------------------------+\n| "not" "x"                                       | Boolean NOT                           |\n+-------------------------------------------------+---------------------------------------+\n| "in", "not in", "is", "is not", "<", "<=", ">", | Comparisons, including membership     |\n| ">=", "!=", "=="                                | tests and identity tests              |\n+-------------------------------------------------+---------------------------------------+\n| "|"                                             | Bitwise OR                            |\n+-------------------------------------------------+---------------------------------------+\n| "^"                                             | Bitwise XOR                           |\n+-------------------------------------------------+---------------------------------------+\n| "&"                                             | Bitwise AND                           |\n+-------------------------------------------------+---------------------------------------+\n| "<<", ">>"                                      | Shifts                                |\n+-------------------------------------------------+---------------------------------------+\n| "+", "-"                                        | Addition and subtraction              |\n+-------------------------------------------------+---------------------------------------+\n| "*", "/", "//", "%"                             | Multiplication, division, remainder   |\n+-------------------------------------------------+---------------------------------------+\n| "+x", "-x", "~x"                                | Positive, negative, bitwise NOT       |\n+-------------------------------------------------+---------------------------------------+\n| "**"                                            | Exponentiation [6]                    |\n+-------------------------------------------------+---------------------------------------+\n| "x[index]", "x[index:index]",                   | Subscription, slicing, call,          |\n| "x(arguments...)", "x.attribute"                | attribute reference                   |\n+-------------------------------------------------+---------------------------------------+\n| "(expressions...)", "[expressions...]", "{key:  | Binding or tuple display, list        |\n| value...}", "{expressions...}"                  | display, dictionary display, set      |\n+-------------------------------------------------+---------------------------------------+\n\n-[ Footnotes ]-\n\n[1] While "abs(x%y) < abs(y)" is true mathematically, for floats\n    it may not be true numerically due to roundoff.  For example, and\n    assuming a platform on which a Python float is an IEEE 754 double-\n    precision number, in order that "-1e-100 % 1e100" have the same\n    sign as "1e100", the computed result is "-1e-100 + 1e100", which\n    is numerically exactly equal to "1e100".  The function\n    "math.fmod()" returns a result whose sign matches the sign of the\n    first argument instead, and so returns "-1e-100" in this case.\n    Which approach is more appropriate depends on the application.\n\n[2] If x is very close to an exact integer multiple of y, it\'s\n    possible for "x//y" to be one larger than "(x-x%y)//y" due to\n    rounding.  In such cases, Python returns the latter result, in\n    order to preserve that "divmod(x,y)[0] * y + x % y" be very close\n    to "x".\n\n[3] While comparisons between strings make sense at the byte\n    level, they may be counter-intuitive to users.  For example, the\n    strings ""\\u00C7"" and ""\\u0327\\u0043"" compare differently, even\n    though they both represent the same unicode character (LATIN\n    CAPITAL LETTER C WITH CEDILLA).  To compare strings in a human\n    recognizable way, compare using "unicodedata.normalize()".\n\n[4] Due to automatic garbage-collection, free lists, and the\n    dynamic nature of descriptors, you may notice seemingly unusual\n    behaviour in certain uses of the "is" operator, like those\n    involving comparisons between instance methods, or constants.\n    Check their documentation for more info.\n\n[5] The "%" operator is also used for string formatting; the same\n    precedence applies.\n\n[6] The power operator "**" binds less tightly than an arithmetic\n    or bitwise unary operator on its right, that is, "2**-1" is "0.5".\n',
+ 'numeric-types': '\nEmulating numeric types\n***********************\n\nThe following methods can be defined to emulate numeric objects.\nMethods corresponding to operations that are not supported by the\nparticular kind of number implemented (e.g., bitwise operations for\nnon-integral numbers) should be left undefined.\n\nobject.__add__(self, other)\nobject.__sub__(self, other)\nobject.__mul__(self, other)\nobject.__truediv__(self, other)\nobject.__floordiv__(self, other)\nobject.__mod__(self, other)\nobject.__divmod__(self, other)\nobject.__pow__(self, other[, modulo])\nobject.__lshift__(self, other)\nobject.__rshift__(self, other)\nobject.__and__(self, other)\nobject.__xor__(self, other)\nobject.__or__(self, other)\n\n   These methods are called to implement the binary arithmetic\n   operations ("+", "-", "*", "/", "//", "%", "divmod()", "pow()",\n   "**", "<<", ">>", "&", "^", "|").  For instance, to evaluate the\n   expression "x + y", where *x* is an instance of a class that has an\n   "__add__()" method, "x.__add__(y)" is called.  The "__divmod__()"\n   method should be the equivalent to using "__floordiv__()" and\n   "__mod__()"; it should not be related to "__truediv__()".  Note\n   that "__pow__()" should be defined to accept an optional third\n   argument if the ternary version of the built-in "pow()" function is\n   to be supported.\n\n   If one of those methods does not support the operation with the\n   supplied arguments, it should return "NotImplemented".\n\nobject.__radd__(self, other)\nobject.__rsub__(self, other)\nobject.__rmul__(self, other)\nobject.__rtruediv__(self, other)\nobject.__rfloordiv__(self, other)\nobject.__rmod__(self, other)\nobject.__rdivmod__(self, other)\nobject.__rpow__(self, other)\nobject.__rlshift__(self, other)\nobject.__rrshift__(self, other)\nobject.__rand__(self, other)\nobject.__rxor__(self, other)\nobject.__ror__(self, other)\n\n   These methods are called to implement the binary arithmetic\n   operations ("+", "-", "*", "/", "//", "%", "divmod()", "pow()",\n   "**", "<<", ">>", "&", "^", "|") with reflected (swapped) operands.\n   These functions are only called if the left operand does not\n   support the corresponding operation and the operands are of\n   different types. [2]  For instance, to evaluate the expression "x -\n   y", where *y* is an instance of a class that has an "__rsub__()"\n   method, "y.__rsub__(x)" is called if "x.__sub__(y)" returns\n   *NotImplemented*.\n\n   Note that ternary "pow()" will not try calling "__rpow__()" (the\n   coercion rules would become too complicated).\n\n   Note: If the right operand\'s type is a subclass of the left\n     operand\'s type and that subclass provides the reflected method\n     for the operation, this method will be called before the left\n     operand\'s non-reflected method.  This behavior allows subclasses\n     to override their ancestors\' operations.\n\nobject.__iadd__(self, other)\nobject.__isub__(self, other)\nobject.__imul__(self, other)\nobject.__itruediv__(self, other)\nobject.__ifloordiv__(self, other)\nobject.__imod__(self, other)\nobject.__ipow__(self, other[, modulo])\nobject.__ilshift__(self, other)\nobject.__irshift__(self, other)\nobject.__iand__(self, other)\nobject.__ixor__(self, other)\nobject.__ior__(self, other)\n\n   These methods are called to implement the augmented arithmetic\n   assignments ("+=", "-=", "*=", "/=", "//=", "%=", "**=", "<<=",\n   ">>=", "&=", "^=", "|=").  These methods should attempt to do the\n   operation in-place (modifying *self*) and return the result (which\n   could be, but does not have to be, *self*).  If a specific method\n   is not defined, the augmented assignment falls back to the normal\n   methods.  For instance, if *x* is an instance of a class with an\n   "__iadd__()" method, "x += y" is equivalent to "x = x.__iadd__(y)"\n   . Otherwise, "x.__add__(y)" and "y.__radd__(x)" are considered, as\n   with the evaluation of "x + y". In certain situations, augmented\n   assignment can result in unexpected errors (see *Why does\n   a_tuple[i] += [\'item\'] raise an exception when the addition\n   works?*), but this behavior is in fact part of the data model.\n\nobject.__neg__(self)\nobject.__pos__(self)\nobject.__abs__(self)\nobject.__invert__(self)\n\n   Called to implement the unary arithmetic operations ("-", "+",\n   "abs()" and "~").\n\nobject.__complex__(self)\nobject.__int__(self)\nobject.__float__(self)\nobject.__round__(self[, n])\n\n   Called to implement the built-in functions "complex()", "int()",\n   "float()" and "round()".  Should return a value of the appropriate\n   type.\n\nobject.__index__(self)\n\n   Called to implement "operator.index()", and whenever Python needs\n   to losslessly convert the numeric object to an integer object (such\n   as in slicing, or in the built-in "bin()", "hex()" and "oct()"\n   functions). Presence of this method indicates that the numeric\n   object is an integer type.  Must return an integer.\n\n   Note: In order to have a coherent integer type class, when\n     "__index__()" is defined "__int__()" should also be defined, and\n     both should return the same value.\n',
+ 'objects': '\nObjects, values and types\n*************************\n\n*Objects* are Python\'s abstraction for data.  All data in a Python\nprogram is represented by objects or by relations between objects. (In\na sense, and in conformance to Von Neumann\'s model of a "stored\nprogram computer," code is also represented by objects.)\n\nEvery object has an identity, a type and a value.  An object\'s\n*identity* never changes once it has been created; you may think of it\nas the object\'s address in memory.  The \'"is"\' operator compares the\nidentity of two objects; the "id()" function returns an integer\nrepresenting its identity.\n\n**CPython implementation detail:** For CPython, "id(x)" is the memory\naddress where "x" is stored.\n\nAn object\'s type determines the operations that the object supports\n(e.g., "does it have a length?") and also defines the possible values\nfor objects of that type.  The "type()" function returns an object\'s\ntype (which is an object itself).  Like its identity, an object\'s\n*type* is also unchangeable. [1]\n\nThe *value* of some objects can change.  Objects whose value can\nchange are said to be *mutable*; objects whose value is unchangeable\nonce they are created are called *immutable*. (The value of an\nimmutable container object that contains a reference to a mutable\nobject can change when the latter\'s value is changed; however the\ncontainer is still considered immutable, because the collection of\nobjects it contains cannot be changed.  So, immutability is not\nstrictly the same as having an unchangeable value, it is more subtle.)\nAn object\'s mutability is determined by its type; for instance,\nnumbers, strings and tuples are immutable, while dictionaries and\nlists are mutable.\n\nObjects are never explicitly destroyed; however, when they become\nunreachable they may be garbage-collected.  An implementation is\nallowed to postpone garbage collection or omit it altogether --- it is\na matter of implementation quality how garbage collection is\nimplemented, as long as no objects are collected that are still\nreachable.\n\n**CPython implementation detail:** CPython currently uses a reference-\ncounting scheme with (optional) delayed detection of cyclically linked\ngarbage, which collects most objects as soon as they become\nunreachable, but is not guaranteed to collect garbage containing\ncircular references.  See the documentation of the "gc" module for\ninformation on controlling the collection of cyclic garbage. Other\nimplementations act differently and CPython may change. Do not depend\non immediate finalization of objects when they become unreachable (so\nyou should always close files explicitly).\n\nNote that the use of the implementation\'s tracing or debugging\nfacilities may keep objects alive that would normally be collectable.\nAlso note that catching an exception with a \'"try"..."except"\'\nstatement may keep objects alive.\n\nSome objects contain references to "external" resources such as open\nfiles or windows.  It is understood that these resources are freed\nwhen the object is garbage-collected, but since garbage collection is\nnot guaranteed to happen, such objects also provide an explicit way to\nrelease the external resource, usually a "close()" method. Programs\nare strongly recommended to explicitly close such objects.  The\n\'"try"..."finally"\' statement and the \'"with"\' statement provide\nconvenient ways to do this.\n\nSome objects contain references to other objects; these are called\n*containers*. Examples of containers are tuples, lists and\ndictionaries.  The references are part of a container\'s value.  In\nmost cases, when we talk about the value of a container, we imply the\nvalues, not the identities of the contained objects; however, when we\ntalk about the mutability of a container, only the identities of the\nimmediately contained objects are implied.  So, if an immutable\ncontainer (like a tuple) contains a reference to a mutable object, its\nvalue changes if that mutable object is changed.\n\nTypes affect almost all aspects of object behavior.  Even the\nimportance of object identity is affected in some sense: for immutable\ntypes, operations that compute new values may actually return a\nreference to any existing object with the same type and value, while\nfor mutable objects this is not allowed.  E.g., after "a = 1; b = 1",\n"a" and "b" may or may not refer to the same object with the value\none, depending on the implementation, but after "c = []; d = []", "c"\nand "d" are guaranteed to refer to two different, unique, newly\ncreated empty lists. (Note that "c = d = []" assigns the same object\nto both "c" and "d".)\n',
+ 'operator-summary': '\nOperator precedence\n*******************\n\nThe following table summarizes the operator precedence in Python, from\nlowest precedence (least binding) to highest precedence (most\nbinding).  Operators in the same box have the same precedence.  Unless\nthe syntax is explicitly given, operators are binary.  Operators in\nthe same box group left to right (except for exponentiation, which\ngroups from right to left).\n\nNote that comparisons, membership tests, and identity tests, all have\nthe same precedence and have a left-to-right chaining feature as\ndescribed in the *Comparisons* section.\n\n+-------------------------------------------------+---------------------------------------+\n| Operator                                        | Description                           |\n+=================================================+=======================================+\n| "lambda"                                        | Lambda expression                     |\n+-------------------------------------------------+---------------------------------------+\n| "if" -- "else"                                  | Conditional expression                |\n+-------------------------------------------------+---------------------------------------+\n| "or"                                            | Boolean OR                            |\n+-------------------------------------------------+---------------------------------------+\n| "and"                                           | Boolean AND                           |\n+-------------------------------------------------+---------------------------------------+\n| "not" "x"                                       | Boolean NOT                           |\n+-------------------------------------------------+---------------------------------------+\n| "in", "not in", "is", "is not", "<", "<=", ">", | Comparisons, including membership     |\n| ">=", "!=", "=="                                | tests and identity tests              |\n+-------------------------------------------------+---------------------------------------+\n| "|"                                             | Bitwise OR                            |\n+-------------------------------------------------+---------------------------------------+\n| "^"                                             | Bitwise XOR                           |\n+-------------------------------------------------+---------------------------------------+\n| "&"                                             | Bitwise AND                           |\n+-------------------------------------------------+---------------------------------------+\n| "<<", ">>"                                      | Shifts                                |\n+-------------------------------------------------+---------------------------------------+\n| "+", "-"                                        | Addition and subtraction              |\n+-------------------------------------------------+---------------------------------------+\n| "*", "/", "//", "%"                             | Multiplication, division, remainder   |\n|                                                 | [5]                                   |\n+-------------------------------------------------+---------------------------------------+\n| "+x", "-x", "~x"                                | Positive, negative, bitwise NOT       |\n+-------------------------------------------------+---------------------------------------+\n| "**"                                            | Exponentiation [6]                    |\n+-------------------------------------------------+---------------------------------------+\n| "x[index]", "x[index:index]",                   | Subscription, slicing, call,          |\n| "x(arguments...)", "x.attribute"                | attribute reference                   |\n+-------------------------------------------------+---------------------------------------+\n| "(expressions...)", "[expressions...]", "{key:  | Binding or tuple display, list        |\n| value...}", "{expressions...}"                  | display, dictionary display, set      |\n|                                                 | display                               |\n+-------------------------------------------------+---------------------------------------+\n\n-[ Footnotes ]-\n\n[1] While "abs(x%y) < abs(y)" is true mathematically, for floats\n    it may not be true numerically due to roundoff.  For example, and\n    assuming a platform on which a Python float is an IEEE 754 double-\n    precision number, in order that "-1e-100 % 1e100" have the same\n    sign as "1e100", the computed result is "-1e-100 + 1e100", which\n    is numerically exactly equal to "1e100".  The function\n    "math.fmod()" returns a result whose sign matches the sign of the\n    first argument instead, and so returns "-1e-100" in this case.\n    Which approach is more appropriate depends on the application.\n\n[2] If x is very close to an exact integer multiple of y, it\'s\n    possible for "x//y" to be one larger than "(x-x%y)//y" due to\n    rounding.  In such cases, Python returns the latter result, in\n    order to preserve that "divmod(x,y)[0] * y + x % y" be very close\n    to "x".\n\n[3] While comparisons between strings make sense at the byte\n    level, they may be counter-intuitive to users.  For example, the\n    strings ""\\u00C7"" and ""\\u0327\\u0043"" compare differently, even\n    though they both represent the same unicode character (LATIN\n    CAPITAL LETTER C WITH CEDILLA).  To compare strings in a human\n    recognizable way, compare using "unicodedata.normalize()".\n\n[4] Due to automatic garbage-collection, free lists, and the\n    dynamic nature of descriptors, you may notice seemingly unusual\n    behaviour in certain uses of the "is" operator, like those\n    involving comparisons between instance methods, or constants.\n    Check their documentation for more info.\n\n[5] The "%" operator is also used for string formatting; the same\n    precedence applies.\n\n[6] The power operator "**" binds less tightly than an arithmetic\n    or bitwise unary operator on its right, that is, "2**-1" is "0.5".\n',
  'pass': '\nThe "pass" statement\n********************\n\n   pass_stmt ::= "pass"\n\n"pass" is a null operation --- when it is executed, nothing happens.\nIt is useful as a placeholder when a statement is required\nsyntactically, but no code needs to be executed, for example:\n\n   def f(arg): pass    # a function that does nothing (yet)\n\n   class C: pass       # a class with no methods (yet)\n',
  'power': '\nThe power operator\n******************\n\nThe power operator binds more tightly than unary operators on its\nleft; it binds less tightly than unary operators on its right.  The\nsyntax is:\n\n   power ::= primary ["**" u_expr]\n\nThus, in an unparenthesized sequence of power and unary operators, the\noperators are evaluated from right to left (this does not constrain\nthe evaluation order for the operands): "-1**2" results in "-1".\n\nThe power operator has the same semantics as the built-in "pow()"\nfunction, when called with two arguments: it yields its left argument\nraised to the power of its right argument.  The numeric arguments are\nfirst converted to a common type, and the result is of that type.\n\nFor int operands, the result has the same type as the operands unless\nthe second argument is negative; in that case, all arguments are\nconverted to float and a float result is delivered. For example,\n"10**2" returns "100", but "10**-2" returns "0.01".\n\nRaising "0.0" to a negative power results in a "ZeroDivisionError".\nRaising a negative number to a fractional power results in a "complex"\nnumber. (In earlier versions it raised a "ValueError".)\n',
  'raise': '\nThe "raise" statement\n*********************\n\n   raise_stmt ::= "raise" [expression ["from" expression]]\n\nIf no expressions are present, "raise" re-raises the last exception\nthat was active in the current scope.  If no exception is active in\nthe current scope, a "RuntimeError" exception is raised indicating\nthat this is an error.\n\nOtherwise, "raise" evaluates the first expression as the exception\nobject.  It must be either a subclass or an instance of\n"BaseException". If it is a class, the exception instance will be\nobtained when needed by instantiating the class with no arguments.\n\nThe *type* of the exception is the exception instance\'s class, the\n*value* is the instance itself.\n\nA traceback object is normally created automatically when an exception\nis raised and attached to it as the "__traceback__" attribute, which\nis writable. You can create an exception and set your own traceback in\none step using the "with_traceback()" exception method (which returns\nthe same exception instance, with its traceback set to its argument),\nlike so:\n\n   raise Exception("foo occurred").with_traceback(tracebackobj)\n\nThe "from" clause is used for exception chaining: if given, the second\n*expression* must be another exception class or instance, which will\nthen be attached to the raised exception as the "__cause__" attribute\n(which is writable).  If the raised exception is not handled, both\nexceptions will be printed:\n\n   >>> try:\n   ...     print(1 / 0)\n   ... except Exception as exc:\n   ...     raise RuntimeError("Something bad happened") from exc\n   ...\n   Traceback (most recent call last):\n     File "<stdin>", line 2, in <module>\n   ZeroDivisionError: int division or modulo by zero\n\n   The above exception was the direct cause of the following exception:\n\n   Traceback (most recent call last):\n     File "<stdin>", line 4, in <module>\n   RuntimeError: Something bad happened\n\nA similar mechanism works implicitly if an exception is raised inside\nan exception handler: the previous exception is then attached as the\nnew exception\'s "__context__" attribute:\n\n   >>> try:\n   ...     print(1 / 0)\n   ... except:\n   ...     raise RuntimeError("Something bad happened")\n   ...\n   Traceback (most recent call last):\n     File "<stdin>", line 2, in <module>\n   ZeroDivisionError: int division or modulo by zero\n\n   During handling of the above exception, another exception occurred:\n\n   Traceback (most recent call last):\n     File "<stdin>", line 4, in <module>\n   RuntimeError: Something bad happened\n\nAdditional information on exceptions can be found in section\n*Exceptions*, and information about handling exceptions is in section\n*The try statement*.\n',
  'return': '\nThe "return" statement\n**********************\n\n   return_stmt ::= "return" [expression_list]\n\n"return" may only occur syntactically nested in a function definition,\nnot within a nested class definition.\n\nIf an expression list is present, it is evaluated, else "None" is\nsubstituted.\n\n"return" leaves the current function call with the expression list (or\n"None") as return value.\n\nWhen "return" passes control out of a "try" statement with a "finally"\nclause, that "finally" clause is executed before really leaving the\nfunction.\n\nIn a generator function, the "return" statement indicates that the\ngenerator is done and will cause "StopIteration" to be raised. The\nreturned value (if any) is used as an argument to construct\n"StopIteration" and becomes the "StopIteration.value" attribute.\n',
- 'sequence-types': '\nEmulating container types\n*************************\n\nThe following methods can be defined to implement container objects.\nContainers usually are sequences (such as lists or tuples) or mappings\n(like dictionaries), but can represent other containers as well.  The\nfirst set of methods is used either to emulate a sequence or to\nemulate a mapping; the difference is that for a sequence, the\nallowable keys should be the integers *k* for which "0 <= k < N" where\n*N* is the length of the sequence, or slice objects, which define a\nrange of items.  It is also recommended that mappings provide the\nmethods "keys()", "values()", "items()", "get()", "clear()",\n"setdefault()", "pop()", "popitem()", "copy()", and "update()"\nbehaving similar to those for Python\'s standard dictionary objects.\nThe "collections" module provides a "MutableMapping" abstract base\nclass to help create those methods from a base set of "__getitem__()",\n"__setitem__()", "__delitem__()", and "keys()". Mutable sequences\nshould provide methods "append()", "count()", "index()", "extend()",\n"insert()", "pop()", "remove()", "reverse()" and "sort()", like Python\nstandard list objects.  Finally, sequence types should implement\naddition (meaning concatenation) and multiplication (meaning\nrepetition) by defining the methods "__add__()", "__radd__()",\n"__iadd__()", "__mul__()", "__rmul__()" and "__imul__()" described\nbelow; they should not define other numerical operators.  It is\nrecommended that both mappings and sequences implement the\n"__contains__()" method to allow efficient use of the "in" operator;\nfor mappings, "in" should search the mapping\'s keys; for sequences, it\nshould search through the values.  It is further recommended that both\nmappings and sequences implement the "__iter__()" method to allow\nefficient iteration through the container; for mappings, "__iter__()"\nshould be the same as "keys()"; for sequences, it should iterate\nthrough the values.\n\nobject.__len__(self)\n\n   Called to implement the built-in function "len()".  Should return\n   the length of the object, an integer ">=" 0.  Also, an object that\n   doesn\'t define a "__bool__()" method and whose "__len__()" method\n   returns zero is considered to be false in a Boolean context.\n\nNote: Slicing is done exclusively with the following three methods.\n  A call like\n\n     a[1:2] = b\n\n  is translated to\n\n     a[slice(1, 2, None)] = b\n\n  and so forth.  Missing slice items are always filled in with "None".\n\nobject.__getitem__(self, key)\n\n   Called to implement evaluation of "self[key]". For sequence types,\n   the accepted keys should be integers and slice objects.  Note that\n   the special interpretation of negative indexes (if the class wishes\n   to emulate a sequence type) is up to the "__getitem__()" method. If\n   *key* is of an inappropriate type, "TypeError" may be raised; if of\n   a value outside the set of indexes for the sequence (after any\n   special interpretation of negative values), "IndexError" should be\n   raised. For mapping types, if *key* is missing (not in the\n   container), "KeyError" should be raised.\n\n   Note: "for" loops expect that an "IndexError" will be raised for\n     illegal indexes to allow proper detection of the end of the\n     sequence.\n\nobject.__setitem__(self, key, value)\n\n   Called to implement assignment to "self[key]".  Same note as for\n   "__getitem__()".  This should only be implemented for mappings if\n   the objects support changes to the values for keys, or if new keys\n   can be added, or for sequences if elements can be replaced.  The\n   same exceptions should be raised for improper *key* values as for\n   the "__getitem__()" method.\n\nobject.__delitem__(self, key)\n\n   Called to implement deletion of "self[key]".  Same note as for\n   "__getitem__()".  This should only be implemented for mappings if\n   the objects support removal of keys, or for sequences if elements\n   can be removed from the sequence.  The same exceptions should be\n   raised for improper *key* values as for the "__getitem__()" method.\n\nobject.__iter__(self)\n\n   This method is called when an iterator is required for a container.\n   This method should return a new iterator object that can iterate\n   over all the objects in the container.  For mappings, it should\n   iterate over the keys of the container, and should also be made\n   available as the method "keys()".\n\n   Iterator objects also need to implement this method; they are\n   required to return themselves.  For more information on iterator\n   objects, see *Iterator Types*.\n\nobject.__reversed__(self)\n\n   Called (if present) by the "reversed()" built-in to implement\n   reverse iteration.  It should return a new iterator object that\n   iterates over all the objects in the container in reverse order.\n\n   If the "__reversed__()" method is not provided, the "reversed()"\n   built-in will fall back to using the sequence protocol ("__len__()"\n   and "__getitem__()").  Objects that support the sequence protocol\n   should only provide "__reversed__()" if they can provide an\n   implementation that is more efficient than the one provided by\n   "reversed()".\n\nThe membership test operators ("in" and "not in") are normally\nimplemented as an iteration through a sequence.  However, container\nobjects can supply the following special method with a more efficient\nimplementation, which also does not require the object be a sequence.\n\nobject.__contains__(self, item)\n\n   Called to implement membership test operators.  Should return true\n   if *item* is in *self*, false otherwise.  For mapping objects, this\n   should consider the keys of the mapping rather than the values or\n   the key-item pairs.\n\n   For objects that don\'t define "__contains__()", the membership test\n   first tries iteration via "__iter__()", then the old sequence\n   iteration protocol via "__getitem__()", see *this section in the\n   language reference*.\n',
+ 'sequence-types': '\nEmulating container types\n*************************\n\nThe following methods can be defined to implement container objects.\nContainers usually are sequences (such as lists or tuples) or mappings\n(like dictionaries), but can represent other containers as well.  The\nfirst set of methods is used either to emulate a sequence or to\nemulate a mapping; the difference is that for a sequence, the\nallowable keys should be the integers *k* for which "0 <= k < N" where\n*N* is the length of the sequence, or slice objects, which define a\nrange of items.  It is also recommended that mappings provide the\nmethods "keys()", "values()", "items()", "get()", "clear()",\n"setdefault()", "pop()", "popitem()", "copy()", and "update()"\nbehaving similar to those for Python\'s standard dictionary objects.\nThe "collections" module provides a "MutableMapping" abstract base\nclass to help create those methods from a base set of "__getitem__()",\n"__setitem__()", "__delitem__()", and "keys()". Mutable sequences\nshould provide methods "append()", "count()", "index()", "extend()",\n"insert()", "pop()", "remove()", "reverse()" and "sort()", like Python\nstandard list objects.  Finally, sequence types should implement\naddition (meaning concatenation) and multiplication (meaning\nrepetition) by defining the methods "__add__()", "__radd__()",\n"__iadd__()", "__mul__()", "__rmul__()" and "__imul__()" described\nbelow; they should not define other numerical operators.  It is\nrecommended that both mappings and sequences implement the\n"__contains__()" method to allow efficient use of the "in" operator;\nfor mappings, "in" should search the mapping\'s keys; for sequences, it\nshould search through the values.  It is further recommended that both\nmappings and sequences implement the "__iter__()" method to allow\nefficient iteration through the container; for mappings, "__iter__()"\nshould be the same as "keys()"; for sequences, it should iterate\nthrough the values.\n\nobject.__len__(self)\n\n   Called to implement the built-in function "len()".  Should return\n   the length of the object, an integer ">=" 0.  Also, an object that\n   doesn\'t define a "__bool__()" method and whose "__len__()" method\n   returns zero is considered to be false in a Boolean context.\n\nobject.__length_hint__(self)\n\n   Called to implement "operator.length_hint()". Should return an\n   estimated length for the object (which may be greater or less than\n   the actual length). The length must be an integer ">=" 0. This\n   method is purely an optimization and is never required for\n   correctness.\n\n   New in version 3.4.\n\nNote: Slicing is done exclusively with the following three methods.\n  A call like\n\n     a[1:2] = b\n\n  is translated to\n\n     a[slice(1, 2, None)] = b\n\n  and so forth.  Missing slice items are always filled in with "None".\n\nobject.__getitem__(self, key)\n\n   Called to implement evaluation of "self[key]". For sequence types,\n   the accepted keys should be integers and slice objects.  Note that\n   the special interpretation of negative indexes (if the class wishes\n   to emulate a sequence type) is up to the "__getitem__()" method. If\n   *key* is of an inappropriate type, "TypeError" may be raised; if of\n   a value outside the set of indexes for the sequence (after any\n   special interpretation of negative values), "IndexError" should be\n   raised. For mapping types, if *key* is missing (not in the\n   container), "KeyError" should be raised.\n\n   Note: "for" loops expect that an "IndexError" will be raised for\n     illegal indexes to allow proper detection of the end of the\n     sequence.\n\nobject.__setitem__(self, key, value)\n\n   Called to implement assignment to "self[key]".  Same note as for\n   "__getitem__()".  This should only be implemented for mappings if\n   the objects support changes to the values for keys, or if new keys\n   can be added, or for sequences if elements can be replaced.  The\n   same exceptions should be raised for improper *key* values as for\n   the "__getitem__()" method.\n\nobject.__delitem__(self, key)\n\n   Called to implement deletion of "self[key]".  Same note as for\n   "__getitem__()".  This should only be implemented for mappings if\n   the objects support removal of keys, or for sequences if elements\n   can be removed from the sequence.  The same exceptions should be\n   raised for improper *key* values as for the "__getitem__()" method.\n\nobject.__iter__(self)\n\n   This method is called when an iterator is required for a container.\n   This method should return a new iterator object that can iterate\n   over all the objects in the container.  For mappings, it should\n   iterate over the keys of the container, and should also be made\n   available as the method "keys()".\n\n   Iterator objects also need to implement this method; they are\n   required to return themselves.  For more information on iterator\n   objects, see *Iterator Types*.\n\nobject.__reversed__(self)\n\n   Called (if present) by the "reversed()" built-in to implement\n   reverse iteration.  It should return a new iterator object that\n   iterates over all the objects in the container in reverse order.\n\n   If the "__reversed__()" method is not provided, the "reversed()"\n   built-in will fall back to using the sequence protocol ("__len__()"\n   and "__getitem__()").  Objects that support the sequence protocol\n   should only provide "__reversed__()" if they can provide an\n   implementation that is more efficient than the one provided by\n   "reversed()".\n\nThe membership test operators ("in" and "not in") are normally\nimplemented as an iteration through a sequence.  However, container\nobjects can supply the following special method with a more efficient\nimplementation, which also does not require the object be a sequence.\n\nobject.__contains__(self, item)\n\n   Called to implement membership test operators.  Should return true\n   if *item* is in *self*, false otherwise.  For mapping objects, this\n   should consider the keys of the mapping rather than the values or\n   the key-item pairs.\n\n   For objects that don\'t define "__contains__()", the membership test\n   first tries iteration via "__iter__()", then the old sequence\n   iteration protocol via "__getitem__()", see *this section in the\n   language reference*.\n',
  'shifting': '\nShifting operations\n*******************\n\nThe shifting operations have lower priority than the arithmetic\noperations:\n\n   shift_expr ::= a_expr | shift_expr ( "<<" | ">>" ) a_expr\n\nThese operators accept integers as arguments.  They shift the first\nargument to the left or right by the number of bits given by the\nsecond argument.\n\nA right shift by *n* bits is defined as floor division by "pow(2,n)".\nA left shift by *n* bits is defined as multiplication with "pow(2,n)".\n\nNote: In the current implementation, the right-hand operand is\n  required to be at most "sys.maxsize".  If the right-hand operand is\n  larger than "sys.maxsize" an "OverflowError" exception is raised.\n',
  'slicings': '\nSlicings\n********\n\nA slicing selects a range of items in a sequence object (e.g., a\nstring, tuple or list).  Slicings may be used as expressions or as\ntargets in assignment or "del" statements.  The syntax for a slicing:\n\n   slicing      ::= primary "[" slice_list "]"\n   slice_list   ::= slice_item ("," slice_item)* [","]\n   slice_item   ::= expression | proper_slice\n   proper_slice ::= [lower_bound] ":" [upper_bound] [ ":" [stride] ]\n   lower_bound  ::= expression\n   upper_bound  ::= expression\n   stride       ::= expression\n\nThere is ambiguity in the formal syntax here: anything that looks like\nan expression list also looks like a slice list, so any subscription\ncan be interpreted as a slicing.  Rather than further complicating the\nsyntax, this is disambiguated by defining that in this case the\ninterpretation as a subscription takes priority over the\ninterpretation as a slicing (this is the case if the slice list\ncontains no proper slice).\n\nThe semantics for a slicing are as follows.  The primary must evaluate\nto a mapping object, and it is indexed (using the same "__getitem__()"\nmethod as normal subscription) with a key that is constructed from the\nslice list, as follows.  If the slice list contains at least one\ncomma, the key is a tuple containing the conversion of the slice\nitems; otherwise, the conversion of the lone slice item is the key.\nThe conversion of a slice item that is an expression is that\nexpression.  The conversion of a proper slice is a slice object (see\nsection *The standard type hierarchy*) whose "start", "stop" and\n"step" attributes are the values of the expressions given as lower\nbound, upper bound and stride, respectively, substituting "None" for\nmissing expressions.\n',
  'specialattrs': '\nSpecial Attributes\n******************\n\nThe implementation adds a few special read-only attributes to several\nobject types, where they are relevant.  Some of these are not reported\nby the "dir()" built-in function.\n\nobject.__dict__\n\n   A dictionary or other mapping object used to store an object\'s\n   (writable) attributes.\n\ninstance.__class__\n\n   The class to which a class instance belongs.\n\nclass.__bases__\n\n   The tuple of base classes of a class object.\n\nclass.__name__\n\n   The name of the class or type.\n\nclass.__qualname__\n\n   The *qualified name* of the class or type.\n\n   New in version 3.3.\n\nclass.__mro__\n\n   This attribute is a tuple of classes that are considered when\n   looking for base classes during method resolution.\n\nclass.mro()\n\n   This method can be overridden by a metaclass to customize the\n   method resolution order for its instances.  It is called at class\n   instantiation, and its result is stored in "__mro__".\n\nclass.__subclasses__()\n\n   Each class keeps a list of weak references to its immediate\n   subclasses.  This method returns a list of all those references\n   still alive. Example:\n\n      >>> int.__subclasses__()\n      [<class \'bool\'>]\n\n-[ Footnotes ]-\n\n[1] Additional information on these special methods may be found\n    in the Python Reference Manual (*Basic customization*).\n\n[2] As a consequence, the list "[1, 2]" is considered equal to\n    "[1.0, 2.0]", and similarly for tuples.\n\n[3] They must have since the parser can\'t tell the type of the\n    operands.\n\n[4] Cased characters are those with general category property\n    being one of "Lu" (Letter, uppercase), "Ll" (Letter, lowercase),\n    or "Lt" (Letter, titlecase).\n\n[5] To format only a tuple you should therefore provide a\n    singleton tuple whose only element is the tuple to be formatted.\n',
- 'specialnames': '\nSpecial method names\n********************\n\nA class can implement certain operations that are invoked by special\nsyntax (such as arithmetic operations or subscripting and slicing) by\ndefining methods with special names. This is Python\'s approach to\n*operator overloading*, allowing classes to define their own behavior\nwith respect to language operators.  For instance, if a class defines\na method named "__getitem__()", and "x" is an instance of this class,\nthen "x[i]" is roughly equivalent to "type(x).__getitem__(x, i)".\nExcept where mentioned, attempts to execute an operation raise an\nexception when no appropriate method is defined (typically\n"AttributeError" or "TypeError").\n\nWhen implementing a class that emulates any built-in type, it is\nimportant that the emulation only be implemented to the degree that it\nmakes sense for the object being modelled.  For example, some\nsequences may work well with retrieval of individual elements, but\nextracting a slice may not make sense.  (One example of this is the\n"NodeList" interface in the W3C\'s Document Object Model.)\n\n\nBasic customization\n===================\n\nobject.__new__(cls[, ...])\n\n   Called to create a new instance of class *cls*.  "__new__()" is a\n   static method (special-cased so you need not declare it as such)\n   that takes the class of which an instance was requested as its\n   first argument.  The remaining arguments are those passed to the\n   object constructor expression (the call to the class).  The return\n   value of "__new__()" should be the new object instance (usually an\n   instance of *cls*).\n\n   Typical implementations create a new instance of the class by\n   invoking the superclass\'s "__new__()" method using\n   "super(currentclass, cls).__new__(cls[, ...])" with appropriate\n   arguments and then modifying the newly-created instance as\n   necessary before returning it.\n\n   If "__new__()" returns an instance of *cls*, then the new\n   instance\'s "__init__()" method will be invoked like\n   "__init__(self[, ...])", where *self* is the new instance and the\n   remaining arguments are the same as were passed to "__new__()".\n\n   If "__new__()" does not return an instance of *cls*, then the new\n   instance\'s "__init__()" method will not be invoked.\n\n   "__new__()" is intended mainly to allow subclasses of immutable\n   types (like int, str, or tuple) to customize instance creation.  It\n   is also commonly overridden in custom metaclasses in order to\n   customize class creation.\n\nobject.__init__(self[, ...])\n\n   Called when the instance is created.  The arguments are those\n   passed to the class constructor expression.  If a base class has an\n   "__init__()" method, the derived class\'s "__init__()" method, if\n   any, must explicitly call it to ensure proper initialization of the\n   base class part of the instance; for example:\n   "BaseClass.__init__(self, [args...])".  As a special constraint on\n   constructors, no value may be returned; doing so will cause a\n   "TypeError" to be raised at runtime.\n\nobject.__del__(self)\n\n   Called when the instance is about to be destroyed.  This is also\n   called a destructor.  If a base class has a "__del__()" method, the\n   derived class\'s "__del__()" method, if any, must explicitly call it\n   to ensure proper deletion of the base class part of the instance.\n   Note that it is possible (though not recommended!) for the\n   "__del__()" method to postpone destruction of the instance by\n   creating a new reference to it.  It may then be called at a later\n   time when this new reference is deleted.  It is not guaranteed that\n   "__del__()" methods are called for objects that still exist when\n   the interpreter exits.\n\n   Note: "del x" doesn\'t directly call "x.__del__()" --- the former\n     decrements the reference count for "x" by one, and the latter is\n     only called when "x"\'s reference count reaches zero.  Some common\n     situations that may prevent the reference count of an object from\n     going to zero include: circular references between objects (e.g.,\n     a doubly-linked list or a tree data structure with parent and\n     child pointers); a reference to the object on the stack frame of\n     a function that caught an exception (the traceback stored in\n     "sys.exc_info()[2]" keeps the stack frame alive); or a reference\n     to the object on the stack frame that raised an unhandled\n     exception in interactive mode (the traceback stored in\n     "sys.last_traceback" keeps the stack frame alive).  The first\n     situation can only be remedied by explicitly breaking the cycles;\n     the latter two situations can be resolved by storing "None" in\n     "sys.last_traceback". Circular references which are garbage are\n     detected when the option cycle detector is enabled (it\'s on by\n     default), but can only be cleaned up if there are no Python-\n     level "__del__()" methods involved. Refer to the documentation\n     for the "gc" module for more information about how "__del__()"\n     methods are handled by the cycle detector, particularly the\n     description of the "garbage" value.\n\n   Warning: Due to the precarious circumstances under which\n     "__del__()" methods are invoked, exceptions that occur during\n     their execution are ignored, and a warning is printed to\n     "sys.stderr" instead. Also, when "__del__()" is invoked in\n     response to a module being deleted (e.g., when execution of the\n     program is done), other globals referenced by the "__del__()"\n     method may already have been deleted or in the process of being\n     torn down (e.g. the import machinery shutting down).  For this\n     reason, "__del__()" methods should do the absolute minimum needed\n     to maintain external invariants.  Starting with version 1.5,\n     Python guarantees that globals whose name begins with a single\n     underscore are deleted from their module before other globals are\n     deleted; if no other references to such globals exist, this may\n     help in assuring that imported modules are still available at the\n     time when the "__del__()" method is called.\n\nobject.__repr__(self)\n\n   Called by the "repr()" built-in function to compute the "official"\n   string representation of an object.  If at all possible, this\n   should look like a valid Python expression that could be used to\n   recreate an object with the same value (given an appropriate\n   environment).  If this is not possible, a string of the form\n   "<...some useful description...>" should be returned. The return\n   value must be a string object. If a class defines "__repr__()" but\n   not "__str__()", then "__repr__()" is also used when an "informal"\n   string representation of instances of that class is required.\n\n   This is typically used for debugging, so it is important that the\n   representation is information-rich and unambiguous.\n\nobject.__str__(self)\n\n   Called by "str(object)" and the built-in functions "format()" and\n   "print()" to compute the "informal" or nicely printable string\n   representation of an object.  The return value must be a *string*\n   object.\n\n   This method differs from "object.__repr__()" in that there is no\n   expectation that "__str__()" return a valid Python expression: a\n   more convenient or concise representation can be used.\n\n   The default implementation defined by the built-in type "object"\n   calls "object.__repr__()".\n\nobject.__bytes__(self)\n\n   Called by "bytes()" to compute a byte-string representation of an\n   object. This should return a "bytes" object.\n\nobject.__format__(self, format_spec)\n\n   Called by the "format()" built-in function (and by extension, the\n   "str.format()" method of class "str") to produce a "formatted"\n   string representation of an object. The "format_spec" argument is a\n   string that contains a description of the formatting options\n   desired. The interpretation of the "format_spec" argument is up to\n   the type implementing "__format__()", however most classes will\n   either delegate formatting to one of the built-in types, or use a\n   similar formatting option syntax.\n\n   See *Format Specification Mini-Language* for a description of the\n   standard formatting syntax.\n\n   The return value must be a string object.\n\nobject.__lt__(self, other)\nobject.__le__(self, other)\nobject.__eq__(self, other)\nobject.__ne__(self, other)\nobject.__gt__(self, other)\nobject.__ge__(self, other)\n\n   These are the so-called "rich comparison" methods. The\n   correspondence between operator symbols and method names is as\n   follows: "x<y" calls "x.__lt__(y)", "x<=y" calls "x.__le__(y)",\n   "x==y" calls "x.__eq__(y)", "x!=y" calls "x.__ne__(y)", "x>y" calls\n   "x.__gt__(y)", and "x>=y" calls "x.__ge__(y)".\n\n   A rich comparison method may return the singleton "NotImplemented"\n   if it does not implement the operation for a given pair of\n   arguments. By convention, "False" and "True" are returned for a\n   successful comparison. However, these methods can return any value,\n   so if the comparison operator is used in a Boolean context (e.g.,\n   in the condition of an "if" statement), Python will call "bool()"\n   on the value to determine if the result is true or false.\n\n   There are no implied relationships among the comparison operators.\n   The truth of "x==y" does not imply that "x!=y" is false.\n   Accordingly, when defining "__eq__()", one should also define\n   "__ne__()" so that the operators will behave as expected.  See the\n   paragraph on "__hash__()" for some important notes on creating\n   *hashable* objects which support custom comparison operations and\n   are usable as dictionary keys.\n\n   There are no swapped-argument versions of these methods (to be used\n   when the left argument does not support the operation but the right\n   argument does); rather, "__lt__()" and "__gt__()" are each other\'s\n   reflection, "__le__()" and "__ge__()" are each other\'s reflection,\n   and "__eq__()" and "__ne__()" are their own reflection.\n\n   Arguments to rich comparison methods are never coerced.\n\n   To automatically generate ordering operations from a single root\n   operation, see "functools.total_ordering()".\n\nobject.__hash__(self)\n\n   Called by built-in function "hash()" and for operations on members\n   of hashed collections including "set", "frozenset", and "dict".\n   "__hash__()" should return an integer.  The only required property\n   is that objects which compare equal have the same hash value; it is\n   advised to somehow mix together (e.g. using exclusive or) the hash\n   values for the components of the object that also play a part in\n   comparison of objects.\n\n   Note: "hash()" truncates the value returned from an object\'s\n     custom "__hash__()" method to the size of a "Py_ssize_t".  This\n     is typically 8 bytes on 64-bit builds and 4 bytes on 32-bit\n     builds. If an object\'s   "__hash__()" must interoperate on builds\n     of different bit sizes, be sure to check the width on all\n     supported builds.  An easy way to do this is with "python -c\n     "import sys; print(sys.hash_info.width)""\n\n   If a class does not define an "__eq__()" method it should not\n   define a "__hash__()" operation either; if it defines "__eq__()"\n   but not "__hash__()", its instances will not be usable as items in\n   hashable collections.  If a class defines mutable objects and\n   implements an "__eq__()" method, it should not implement\n   "__hash__()", since the implementation of hashable collections\n   requires that a key\'s hash value is immutable (if the object\'s hash\n   value changes, it will be in the wrong hash bucket).\n\n   User-defined classes have "__eq__()" and "__hash__()" methods by\n   default; with them, all objects compare unequal (except with\n   themselves) and "x.__hash__()" returns an appropriate value such\n   that "x == y" implies both that "x is y" and "hash(x) == hash(y)".\n\n   A class that overrides "__eq__()" and does not define "__hash__()"\n   will have its "__hash__()" implicitly set to "None".  When the\n   "__hash__()" method of a class is "None", instances of the class\n   will raise an appropriate "TypeError" when a program attempts to\n   retrieve their hash value, and will also be correctly identified as\n   unhashable when checking "isinstance(obj, collections.Hashable").\n\n   If a class that overrides "__eq__()" needs to retain the\n   implementation of "__hash__()" from a parent class, the interpreter\n   must be told this explicitly by setting "__hash__ =\n   <ParentClass>.__hash__".\n\n   If a class that does not override "__eq__()" wishes to suppress\n   hash support, it should include "__hash__ = None" in the class\n   definition. A class which defines its own "__hash__()" that\n   explicitly raises a "TypeError" would be incorrectly identified as\n   hashable by an "isinstance(obj, collections.Hashable)" call.\n\n   Note: By default, the "__hash__()" values of str, bytes and\n     datetime objects are "salted" with an unpredictable random value.\n     Although they remain constant within an individual Python\n     process, they are not predictable between repeated invocations of\n     Python.This is intended to provide protection against a denial-\n     of-service caused by carefully-chosen inputs that exploit the\n     worst case performance of a dict insertion, O(n^2) complexity.\n     See http://www.ocert.org/advisories/ocert-2011-003.html for\n     details.Changing hash values affects the iteration order of\n     dicts, sets and other mappings.  Python has never made guarantees\n     about this ordering (and it typically varies between 32-bit and\n     64-bit builds).See also "PYTHONHASHSEED".\n\n   Changed in version 3.3: Hash randomization is enabled by default.\n\nobject.__bool__(self)\n\n   Called to implement truth value testing and the built-in operation\n   "bool()"; should return "False" or "True".  When this method is not\n   defined, "__len__()" is called, if it is defined, and the object is\n   considered true if its result is nonzero.  If a class defines\n   neither "__len__()" nor "__bool__()", all its instances are\n   considered true.\n\n\nCustomizing attribute access\n============================\n\nThe following methods can be defined to customize the meaning of\nattribute access (use of, assignment to, or deletion of "x.name") for\nclass instances.\n\nobject.__getattr__(self, name)\n\n   Called when an attribute lookup has not found the attribute in the\n   usual places (i.e. it is not an instance attribute nor is it found\n   in the class tree for "self").  "name" is the attribute name. This\n   method should return the (computed) attribute value or raise an\n   "AttributeError" exception.\n\n   Note that if the attribute is found through the normal mechanism,\n   "__getattr__()" is not called.  (This is an intentional asymmetry\n   between "__getattr__()" and "__setattr__()".) This is done both for\n   efficiency reasons and because otherwise "__getattr__()" would have\n   no way to access other attributes of the instance.  Note that at\n   least for instance variables, you can fake total control by not\n   inserting any values in the instance attribute dictionary (but\n   instead inserting them in another object).  See the\n   "__getattribute__()" method below for a way to actually get total\n   control over attribute access.\n\nobject.__getattribute__(self, name)\n\n   Called unconditionally to implement attribute accesses for\n   instances of the class. If the class also defines "__getattr__()",\n   the latter will not be called unless "__getattribute__()" either\n   calls it explicitly or raises an "AttributeError". This method\n   should return the (computed) attribute value or raise an\n   "AttributeError" exception. In order to avoid infinite recursion in\n   this method, its implementation should always call the base class\n   method with the same name to access any attributes it needs, for\n   example, "object.__getattribute__(self, name)".\n\n   Note: This method may still be bypassed when looking up special\n     methods as the result of implicit invocation via language syntax\n     or built-in functions. See *Special method lookup*.\n\nobject.__setattr__(self, name, value)\n\n   Called when an attribute assignment is attempted.  This is called\n   instead of the normal mechanism (i.e. store the value in the\n   instance dictionary). *name* is the attribute name, *value* is the\n   value to be assigned to it.\n\n   If "__setattr__()" wants to assign to an instance attribute, it\n   should call the base class method with the same name, for example,\n   "object.__setattr__(self, name, value)".\n\nobject.__delattr__(self, name)\n\n   Like "__setattr__()" but for attribute deletion instead of\n   assignment.  This should only be implemented if "del obj.name" is\n   meaningful for the object.\n\nobject.__dir__(self)\n\n   Called when "dir()" is called on the object. A sequence must be\n   returned. "dir()" converts the returned sequence to a list and\n   sorts it.\n\n\nImplementing Descriptors\n------------------------\n\nThe following methods only apply when an instance of the class\ncontaining the method (a so-called *descriptor* class) appears in an\n*owner* class (the descriptor must be in either the owner\'s class\ndictionary or in the class dictionary for one of its parents).  In the\nexamples below, "the attribute" refers to the attribute whose name is\nthe key of the property in the owner class\' "__dict__".\n\nobject.__get__(self, instance, owner)\n\n   Called to get the attribute of the owner class (class attribute\n   access) or of an instance of that class (instance attribute\n   access). *owner* is always the owner class, while *instance* is the\n   instance that the attribute was accessed through, or "None" when\n   the attribute is accessed through the *owner*.  This method should\n   return the (computed) attribute value or raise an "AttributeError"\n   exception.\n\nobject.__set__(self, instance, value)\n\n   Called to set the attribute on an instance *instance* of the owner\n   class to a new value, *value*.\n\nobject.__delete__(self, instance)\n\n   Called to delete the attribute on an instance *instance* of the\n   owner class.\n\n\nInvoking Descriptors\n--------------------\n\nIn general, a descriptor is an object attribute with "binding\nbehavior", one whose attribute access has been overridden by methods\nin the descriptor protocol:  "__get__()", "__set__()", and\n"__delete__()". If any of those methods are defined for an object, it\nis said to be a descriptor.\n\nThe default behavior for attribute access is to get, set, or delete\nthe attribute from an object\'s dictionary. For instance, "a.x" has a\nlookup chain starting with "a.__dict__[\'x\']", then\n"type(a).__dict__[\'x\']", and continuing through the base classes of\n"type(a)" excluding metaclasses.\n\nHowever, if the looked-up value is an object defining one of the\ndescriptor methods, then Python may override the default behavior and\ninvoke the descriptor method instead.  Where this occurs in the\nprecedence chain depends on which descriptor methods were defined and\nhow they were called.\n\nThe starting point for descriptor invocation is a binding, "a.x". How\nthe arguments are assembled depends on "a":\n\nDirect Call\n   The simplest and least common call is when user code directly\n   invokes a descriptor method:    "x.__get__(a)".\n\nInstance Binding\n   If binding to an object instance, "a.x" is transformed into the\n   call: "type(a).__dict__[\'x\'].__get__(a, type(a))".\n\nClass Binding\n   If binding to a class, "A.x" is transformed into the call:\n   "A.__dict__[\'x\'].__get__(None, A)".\n\nSuper Binding\n   If "a" is an instance of "super", then the binding "super(B,\n   obj).m()" searches "obj.__class__.__mro__" for the base class "A"\n   immediately preceding "B" and then invokes the descriptor with the\n   call: "A.__dict__[\'m\'].__get__(obj, obj.__class__)".\n\nFor instance bindings, the precedence of descriptor invocation depends\non the which descriptor methods are defined.  A descriptor can define\nany combination of "__get__()", "__set__()" and "__delete__()".  If it\ndoes not define "__get__()", then accessing the attribute will return\nthe descriptor object itself unless there is a value in the object\'s\ninstance dictionary.  If the descriptor defines "__set__()" and/or\n"__delete__()", it is a data descriptor; if it defines neither, it is\na non-data descriptor.  Normally, data descriptors define both\n"__get__()" and "__set__()", while non-data descriptors have just the\n"__get__()" method.  Data descriptors with "__set__()" and "__get__()"\ndefined always override a redefinition in an instance dictionary.  In\ncontrast, non-data descriptors can be overridden by instances.\n\nPython methods (including "staticmethod()" and "classmethod()") are\nimplemented as non-data descriptors.  Accordingly, instances can\nredefine and override methods.  This allows individual instances to\nacquire behaviors that differ from other instances of the same class.\n\nThe "property()" function is implemented as a data descriptor.\nAccordingly, instances cannot override the behavior of a property.\n\n\n__slots__\n---------\n\nBy default, instances of classes have a dictionary for attribute\nstorage.  This wastes space for objects having very few instance\nvariables.  The space consumption can become acute when creating large\nnumbers of instances.\n\nThe default can be overridden by defining *__slots__* in a class\ndefinition. The *__slots__* declaration takes a sequence of instance\nvariables and reserves just enough space in each instance to hold a\nvalue for each variable.  Space is saved because *__dict__* is not\ncreated for each instance.\n\nobject.__slots__\n\n   This class variable can be assigned a string, iterable, or sequence\n   of strings with variable names used by instances.  If defined in a\n   class, *__slots__* reserves space for the declared variables and\n   prevents the automatic creation of *__dict__* and *__weakref__* for\n   each instance.\n\n\nNotes on using *__slots__*\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n* When inheriting from a class without *__slots__*, the *__dict__*\n  attribute of that class will always be accessible, so a *__slots__*\n  definition in the subclass is meaningless.\n\n* Without a *__dict__* variable, instances cannot be assigned new\n  variables not listed in the *__slots__* definition.  Attempts to\n  assign to an unlisted variable name raises "AttributeError". If\n  dynamic assignment of new variables is desired, then add\n  "\'__dict__\'" to the sequence of strings in the *__slots__*\n  declaration.\n\n* Without a *__weakref__* variable for each instance, classes\n  defining *__slots__* do not support weak references to its\n  instances. If weak reference support is needed, then add\n  "\'__weakref__\'" to the sequence of strings in the *__slots__*\n  declaration.\n\n* *__slots__* are implemented at the class level by creating\n  descriptors (*Implementing Descriptors*) for each variable name.  As\n  a result, class attributes cannot be used to set default values for\n  instance variables defined by *__slots__*; otherwise, the class\n  attribute would overwrite the descriptor assignment.\n\n* The action of a *__slots__* declaration is limited to the class\n  where it is defined.  As a result, subclasses will have a *__dict__*\n  unless they also define *__slots__* (which must only contain names\n  of any *additional* slots).\n\n* If a class defines a slot also defined in a base class, the\n  instance variable defined by the base class slot is inaccessible\n  (except by retrieving its descriptor directly from the base class).\n  This renders the meaning of the program undefined.  In the future, a\n  check may be added to prevent this.\n\n* Nonempty *__slots__* does not work for classes derived from\n  "variable-length" built-in types such as "int", "bytes" and "tuple".\n\n* Any non-string iterable may be assigned to *__slots__*. Mappings\n  may also be used; however, in the future, special meaning may be\n  assigned to the values corresponding to each key.\n\n* *__class__* assignment works only if both classes have the same\n  *__slots__*.\n\n\nCustomizing class creation\n==========================\n\nBy default, classes are constructed using "type()". The class body is\nexecuted in a new namespace and the class name is bound locally to the\nresult of "type(name, bases, namespace)".\n\nThe class creation process can be customised by passing the\n"metaclass" keyword argument in the class definition line, or by\ninheriting from an existing class that included such an argument. In\nthe following example, both "MyClass" and "MySubclass" are instances\nof "Meta":\n\n   class Meta(type):\n       pass\n\n   class MyClass(metaclass=Meta):\n       pass\n\n   class MySubclass(MyClass):\n       pass\n\nAny other keyword arguments that are specified in the class definition\nare passed through to all metaclass operations described below.\n\nWhen a class definition is executed, the following steps occur:\n\n* the appropriate metaclass is determined\n\n* the class namespace is prepared\n\n* the class body is executed\n\n* the class object is created\n\n\nDetermining the appropriate metaclass\n-------------------------------------\n\nThe appropriate metaclass for a class definition is determined as\nfollows:\n\n* if no bases and no explicit metaclass are given, then "type()" is\n  used\n\n* if an explicit metaclass is given and it is *not* an instance of\n  "type()", then it is used directly as the metaclass\n\n* if an instance of "type()" is given as the explicit metaclass, or\n  bases are defined, then the most derived metaclass is used\n\nThe most derived metaclass is selected from the explicitly specified\nmetaclass (if any) and the metaclasses (i.e. "type(cls)") of all\nspecified base classes. The most derived metaclass is one which is a\nsubtype of *all* of these candidate metaclasses. If none of the\ncandidate metaclasses meets that criterion, then the class definition\nwill fail with "TypeError".\n\n\nPreparing the class namespace\n-----------------------------\n\nOnce the appropriate metaclass has been identified, then the class\nnamespace is prepared. If the metaclass has a "__prepare__" attribute,\nit is called as "namespace = metaclass.__prepare__(name, bases,\n**kwds)" (where the additional keyword arguments, if any, come from\nthe class definition).\n\nIf the metaclass has no "__prepare__" attribute, then the class\nnamespace is initialised as an empty "dict()" instance.\n\nSee also: **PEP 3115** - Metaclasses in Python 3000\n\n     Introduced the "__prepare__" namespace hook\n\n\nExecuting the class body\n------------------------\n\nThe class body is executed (approximately) as "exec(body, globals(),\nnamespace)". The key difference from a normal call to "exec()" is that\nlexical scoping allows the class body (including any methods) to\nreference names from the current and outer scopes when the class\ndefinition occurs inside a function.\n\nHowever, even when the class definition occurs inside the function,\nmethods defined inside the class still cannot see names defined at the\nclass scope. Class variables must be accessed through the first\nparameter of instance or class methods, and cannot be accessed at all\nfrom static methods.\n\n\nCreating the class object\n-------------------------\n\nOnce the class namespace has been populated by executing the class\nbody, the class object is created by calling "metaclass(name, bases,\nnamespace, **kwds)" (the additional keywords passed here are the same\nas those passed to "__prepare__").\n\nThis class object is the one that will be referenced by the zero-\nargument form of "super()". "__class__" is an implicit closure\nreference created by the compiler if any methods in a class body refer\nto either "__class__" or "super". This allows the zero argument form\nof "super()" to correctly identify the class being defined based on\nlexical scoping, while the class or instance that was used to make the\ncurrent call is identified based on the first argument passed to the\nmethod.\n\nAfter the class object is created, it is passed to the class\ndecorators included in the class definition (if any) and the resulting\nobject is bound in the local namespace as the defined class.\n\nSee also: **PEP 3135** - New super\n\n     Describes the implicit "__class__" closure reference\n\n\nMetaclass example\n-----------------\n\nThe potential uses for metaclasses are boundless. Some ideas that have\nbeen explored include logging, interface checking, automatic\ndelegation, automatic property creation, proxies, frameworks, and\nautomatic resource locking/synchronization.\n\nHere is an example of a metaclass that uses an\n"collections.OrderedDict" to remember the order that class members\nwere defined:\n\n   class OrderedClass(type):\n\n        @classmethod\n        def __prepare__(metacls, name, bases, **kwds):\n           return collections.OrderedDict()\n\n        def __new__(cls, name, bases, namespace, **kwds):\n           result = type.__new__(cls, name, bases, dict(namespace))\n           result.members = tuple(namespace)\n           return result\n\n   class A(metaclass=OrderedClass):\n       def one(self): pass\n       def two(self): pass\n       def three(self): pass\n       def four(self): pass\n\n   >>> A.members\n   (\'__module__\', \'one\', \'two\', \'three\', \'four\')\n\nWhen the class definition for *A* gets executed, the process begins\nwith calling the metaclass\'s "__prepare__()" method which returns an\nempty "collections.OrderedDict".  That mapping records the methods and\nattributes of *A* as they are defined within the body of the class\nstatement. Once those definitions are executed, the ordered dictionary\nis fully populated and the metaclass\'s "__new__()" method gets\ninvoked.  That method builds the new type and it saves the ordered\ndictionary keys in an attribute called "members".\n\n\nCustomizing instance and subclass checks\n========================================\n\nThe following methods are used to override the default behavior of the\n"isinstance()" and "issubclass()" built-in functions.\n\nIn particular, the metaclass "abc.ABCMeta" implements these methods in\norder to allow the addition of Abstract Base Classes (ABCs) as\n"virtual base classes" to any class or type (including built-in\ntypes), including other ABCs.\n\nclass.__instancecheck__(self, instance)\n\n   Return true if *instance* should be considered a (direct or\n   indirect) instance of *class*. If defined, called to implement\n   "isinstance(instance, class)".\n\nclass.__subclasscheck__(self, subclass)\n\n   Return true if *subclass* should be considered a (direct or\n   indirect) subclass of *class*.  If defined, called to implement\n   "issubclass(subclass, class)".\n\nNote that these methods are looked up on the type (metaclass) of a\nclass.  They cannot be defined as class methods in the actual class.\nThis is consistent with the lookup of special methods that are called\non instances, only in this case the instance is itself a class.\n\nSee also: **PEP 3119** - Introducing Abstract Base Classes\n\n     Includes the specification for customizing "isinstance()" and\n     "issubclass()" behavior through "__instancecheck__()" and\n     "__subclasscheck__()", with motivation for this functionality in\n     the context of adding Abstract Base Classes (see the "abc"\n     module) to the language.\n\n\nEmulating callable objects\n==========================\n\nobject.__call__(self[, args...])\n\n   Called when the instance is "called" as a function; if this method\n   is defined, "x(arg1, arg2, ...)" is a shorthand for\n   "x.__call__(arg1, arg2, ...)".\n\n\nEmulating container types\n=========================\n\nThe following methods can be defined to implement container objects.\nContainers usually are sequences (such as lists or tuples) or mappings\n(like dictionaries), but can represent other containers as well.  The\nfirst set of methods is used either to emulate a sequence or to\nemulate a mapping; the difference is that for a sequence, the\nallowable keys should be the integers *k* for which "0 <= k < N" where\n*N* is the length of the sequence, or slice objects, which define a\nrange of items.  It is also recommended that mappings provide the\nmethods "keys()", "values()", "items()", "get()", "clear()",\n"setdefault()", "pop()", "popitem()", "copy()", and "update()"\nbehaving similar to those for Python\'s standard dictionary objects.\nThe "collections" module provides a "MutableMapping" abstract base\nclass to help create those methods from a base set of "__getitem__()",\n"__setitem__()", "__delitem__()", and "keys()". Mutable sequences\nshould provide methods "append()", "count()", "index()", "extend()",\n"insert()", "pop()", "remove()", "reverse()" and "sort()", like Python\nstandard list objects.  Finally, sequence types should implement\naddition (meaning concatenation) and multiplication (meaning\nrepetition) by defining the methods "__add__()", "__radd__()",\n"__iadd__()", "__mul__()", "__rmul__()" and "__imul__()" described\nbelow; they should not define other numerical operators.  It is\nrecommended that both mappings and sequences implement the\n"__contains__()" method to allow efficient use of the "in" operator;\nfor mappings, "in" should search the mapping\'s keys; for sequences, it\nshould search through the values.  It is further recommended that both\nmappings and sequences implement the "__iter__()" method to allow\nefficient iteration through the container; for mappings, "__iter__()"\nshould be the same as "keys()"; for sequences, it should iterate\nthrough the values.\n\nobject.__len__(self)\n\n   Called to implement the built-in function "len()".  Should return\n   the length of the object, an integer ">=" 0.  Also, an object that\n   doesn\'t define a "__bool__()" method and whose "__len__()" method\n   returns zero is considered to be false in a Boolean context.\n\nNote: Slicing is done exclusively with the following three methods.\n  A call like\n\n     a[1:2] = b\n\n  is translated to\n\n     a[slice(1, 2, None)] = b\n\n  and so forth.  Missing slice items are always filled in with "None".\n\nobject.__getitem__(self, key)\n\n   Called to implement evaluation of "self[key]". For sequence types,\n   the accepted keys should be integers and slice objects.  Note that\n   the special interpretation of negative indexes (if the class wishes\n   to emulate a sequence type) is up to the "__getitem__()" method. If\n   *key* is of an inappropriate type, "TypeError" may be raised; if of\n   a value outside the set of indexes for the sequence (after any\n   special interpretation of negative values), "IndexError" should be\n   raised. For mapping types, if *key* is missing (not in the\n   container), "KeyError" should be raised.\n\n   Note: "for" loops expect that an "IndexError" will be raised for\n     illegal indexes to allow proper detection of the end of the\n     sequence.\n\nobject.__setitem__(self, key, value)\n\n   Called to implement assignment to "self[key]".  Same note as for\n   "__getitem__()".  This should only be implemented for mappings if\n   the objects support changes to the values for keys, or if new keys\n   can be added, or for sequences if elements can be replaced.  The\n   same exceptions should be raised for improper *key* values as for\n   the "__getitem__()" method.\n\nobject.__delitem__(self, key)\n\n   Called to implement deletion of "self[key]".  Same note as for\n   "__getitem__()".  This should only be implemented for mappings if\n   the objects support removal of keys, or for sequences if elements\n   can be removed from the sequence.  The same exceptions should be\n   raised for improper *key* values as for the "__getitem__()" method.\n\nobject.__iter__(self)\n\n   This method is called when an iterator is required for a container.\n   This method should return a new iterator object that can iterate\n   over all the objects in the container.  For mappings, it should\n   iterate over the keys of the container, and should also be made\n   available as the method "keys()".\n\n   Iterator objects also need to implement this method; they are\n   required to return themselves.  For more information on iterator\n   objects, see *Iterator Types*.\n\nobject.__reversed__(self)\n\n   Called (if present) by the "reversed()" built-in to implement\n   reverse iteration.  It should return a new iterator object that\n   iterates over all the objects in the container in reverse order.\n\n   If the "__reversed__()" method is not provided, the "reversed()"\n   built-in will fall back to using the sequence protocol ("__len__()"\n   and "__getitem__()").  Objects that support the sequence protocol\n   should only provide "__reversed__()" if they can provide an\n   implementation that is more efficient than the one provided by\n   "reversed()".\n\nThe membership test operators ("in" and "not in") are normally\nimplemented as an iteration through a sequence.  However, container\nobjects can supply the following special method with a more efficient\nimplementation, which also does not require the object be a sequence.\n\nobject.__contains__(self, item)\n\n   Called to implement membership test operators.  Should return true\n   if *item* is in *self*, false otherwise.  For mapping objects, this\n   should consider the keys of the mapping rather than the values or\n   the key-item pairs.\n\n   For objects that don\'t define "__contains__()", the membership test\n   first tries iteration via "__iter__()", then the old sequence\n   iteration protocol via "__getitem__()", see *this section in the\n   language reference*.\n\n\nEmulating numeric types\n=======================\n\nThe following methods can be defined to emulate numeric objects.\nMethods corresponding to operations that are not supported by the\nparticular kind of number implemented (e.g., bitwise operations for\nnon-integral numbers) should be left undefined.\n\nobject.__add__(self, other)\nobject.__sub__(self, other)\nobject.__mul__(self, other)\nobject.__truediv__(self, other)\nobject.__floordiv__(self, other)\nobject.__mod__(self, other)\nobject.__divmod__(self, other)\nobject.__pow__(self, other[, modulo])\nobject.__lshift__(self, other)\nobject.__rshift__(self, other)\nobject.__and__(self, other)\nobject.__xor__(self, other)\nobject.__or__(self, other)\n\n   These methods are called to implement the binary arithmetic\n   operations ("+", "-", "*", "/", "//", "%", "divmod()", "pow()",\n   "**", "<<", ">>", "&", "^", "|").  For instance, to evaluate the\n   expression "x + y", where *x* is an instance of a class that has an\n   "__add__()" method, "x.__add__(y)" is called.  The "__divmod__()"\n   method should be the equivalent to using "__floordiv__()" and\n   "__mod__()"; it should not be related to "__truediv__()".  Note\n   that "__pow__()" should be defined to accept an optional third\n   argument if the ternary version of the built-in "pow()" function is\n   to be supported.\n\n   If one of those methods does not support the operation with the\n   supplied arguments, it should return "NotImplemented".\n\nobject.__radd__(self, other)\nobject.__rsub__(self, other)\nobject.__rmul__(self, other)\nobject.__rtruediv__(self, other)\nobject.__rfloordiv__(self, other)\nobject.__rmod__(self, other)\nobject.__rdivmod__(self, other)\nobject.__rpow__(self, other)\nobject.__rlshift__(self, other)\nobject.__rrshift__(self, other)\nobject.__rand__(self, other)\nobject.__rxor__(self, other)\nobject.__ror__(self, other)\n\n   These methods are called to implement the binary arithmetic\n   operations ("+", "-", "*", "/", "//", "%", "divmod()", "pow()",\n   "**", "<<", ">>", "&", "^", "|") with reflected (swapped) operands.\n   These functions are only called if the left operand does not\n   support the corresponding operation and the operands are of\n   different types. [2]  For instance, to evaluate the expression "x -\n   y", where *y* is an instance of a class that has an "__rsub__()"\n   method, "y.__rsub__(x)" is called if "x.__sub__(y)" returns\n   *NotImplemented*.\n\n   Note that ternary "pow()" will not try calling "__rpow__()" (the\n   coercion rules would become too complicated).\n\n   Note: If the right operand\'s type is a subclass of the left\n     operand\'s type and that subclass provides the reflected method\n     for the operation, this method will be called before the left\n     operand\'s non-reflected method.  This behavior allows subclasses\n     to override their ancestors\' operations.\n\nobject.__iadd__(self, other)\nobject.__isub__(self, other)\nobject.__imul__(self, other)\nobject.__itruediv__(self, other)\nobject.__ifloordiv__(self, other)\nobject.__imod__(self, other)\nobject.__ipow__(self, other[, modulo])\nobject.__ilshift__(self, other)\nobject.__irshift__(self, other)\nobject.__iand__(self, other)\nobject.__ixor__(self, other)\nobject.__ior__(self, other)\n\n   These methods are called to implement the augmented arithmetic\n   assignments ("+=", "-=", "*=", "/=", "//=", "%=", "**=", "<<=",\n   ">>=", "&=", "^=", "|=").  These methods should attempt to do the\n   operation in-place (modifying *self*) and return the result (which\n   could be, but does not have to be, *self*).  If a specific method\n   is not defined, the augmented assignment falls back to the normal\n   methods.  For instance, to execute the statement "x += y", where\n   *x* is an instance of a class that has an "__iadd__()" method,\n   "x.__iadd__(y)" is called.  If *x* is an instance of a class that\n   does not define a "__iadd__()" method, "x.__add__(y)" and\n   "y.__radd__(x)" are considered, as with the evaluation of "x + y".\n\nobject.__neg__(self)\nobject.__pos__(self)\nobject.__abs__(self)\nobject.__invert__(self)\n\n   Called to implement the unary arithmetic operations ("-", "+",\n   "abs()" and "~").\n\nobject.__complex__(self)\nobject.__int__(self)\nobject.__float__(self)\nobject.__round__(self[, n])\n\n   Called to implement the built-in functions "complex()", "int()",\n   "float()" and "round()".  Should return a value of the appropriate\n   type.\n\nobject.__index__(self)\n\n   Called to implement "operator.index()".  Also called whenever\n   Python needs an integer object (such as in slicing, or in the\n   built-in "bin()", "hex()" and "oct()" functions). Must return an\n   integer.\n\n\nWith Statement Context Managers\n===============================\n\nA *context manager* is an object that defines the runtime context to\nbe established when executing a "with" statement. The context manager\nhandles the entry into, and the exit from, the desired runtime context\nfor the execution of the block of code.  Context managers are normally\ninvoked using the "with" statement (described in section *The with\nstatement*), but can also be used by directly invoking their methods.\n\nTypical uses of context managers include saving and restoring various\nkinds of global state, locking and unlocking resources, closing opened\nfiles, etc.\n\nFor more information on context managers, see *Context Manager Types*.\n\nobject.__enter__(self)\n\n   Enter the runtime context related to this object. The "with"\n   statement will bind this method\'s return value to the target(s)\n   specified in the "as" clause of the statement, if any.\n\nobject.__exit__(self, exc_type, exc_value, traceback)\n\n   Exit the runtime context related to this object. The parameters\n   describe the exception that caused the context to be exited. If the\n   context was exited without an exception, all three arguments will\n   be "None".\n\n   If an exception is supplied, and the method wishes to suppress the\n   exception (i.e., prevent it from being propagated), it should\n   return a true value. Otherwise, the exception will be processed\n   normally upon exit from this method.\n\n   Note that "__exit__()" methods should not reraise the passed-in\n   exception; this is the caller\'s responsibility.\n\nSee also: **PEP 0343** - The "with" statement\n\n     The specification, background, and examples for the Python "with"\n     statement.\n\n\nSpecial method lookup\n=====================\n\nFor custom classes, implicit invocations of special methods are only\nguaranteed to work correctly if defined on an object\'s type, not in\nthe object\'s instance dictionary.  That behaviour is the reason why\nthe following code raises an exception:\n\n   >>> class C:\n   ...     pass\n   ...\n   >>> c = C()\n   >>> c.__len__ = lambda: 5\n   >>> len(c)\n   Traceback (most recent call last):\n     File "<stdin>", line 1, in <module>\n   TypeError: object of type \'C\' has no len()\n\nThe rationale behind this behaviour lies with a number of special\nmethods such as "__hash__()" and "__repr__()" that are implemented by\nall objects, including type objects. If the implicit lookup of these\nmethods used the conventional lookup process, they would fail when\ninvoked on the type object itself:\n\n   >>> 1 .__hash__() == hash(1)\n   True\n   >>> int.__hash__() == hash(int)\n   Traceback (most recent call last):\n     File "<stdin>", line 1, in <module>\n   TypeError: descriptor \'__hash__\' of \'int\' object needs an argument\n\nIncorrectly attempting to invoke an unbound method of a class in this\nway is sometimes referred to as \'metaclass confusion\', and is avoided\nby bypassing the instance when looking up special methods:\n\n   >>> type(1).__hash__(1) == hash(1)\n   True\n   >>> type(int).__hash__(int) == hash(int)\n   True\n\nIn addition to bypassing any instance attributes in the interest of\ncorrectness, implicit special method lookup generally also bypasses\nthe "__getattribute__()" method even of the object\'s metaclass:\n\n   >>> class Meta(type):\n   ...    def __getattribute__(*args):\n   ...       print("Metaclass getattribute invoked")\n   ...       return type.__getattribute__(*args)\n   ...\n   >>> class C(object, metaclass=Meta):\n   ...     def __len__(self):\n   ...         return 10\n   ...     def __getattribute__(*args):\n   ...         print("Class getattribute invoked")\n   ...         return object.__getattribute__(*args)\n   ...\n   >>> c = C()\n   >>> c.__len__()                 # Explicit lookup via instance\n   Class getattribute invoked\n   10\n   >>> type(c).__len__(c)          # Explicit lookup via type\n   Metaclass getattribute invoked\n   10\n   >>> len(c)                      # Implicit lookup\n   10\n\nBypassing the "__getattribute__()" machinery in this fashion provides\nsignificant scope for speed optimisations within the interpreter, at\nthe cost of some flexibility in the handling of special methods (the\nspecial method *must* be set on the class object itself in order to be\nconsistently invoked by the interpreter).\n\n-[ Footnotes ]-\n\n[1] It *is* possible in some cases to change an object\'s type,\n    under certain controlled conditions. It generally isn\'t a good\n    idea though, since it can lead to some very strange behaviour if\n    it is handled incorrectly.\n\n[2] For operands of the same type, it is assumed that if the non-\n    reflected method (such as "__add__()") fails the operation is not\n    supported, which is why the reflected method is not called.\n',
- 'string-methods': '\nString Methods\n**************\n\nStrings implement all of the *common* sequence operations, along with\nthe additional methods described below.\n\nStrings also support two styles of string formatting, one providing a\nlarge degree of flexibility and customization (see "str.format()",\n*Format String Syntax* and *String Formatting*) and the other based on\nC "printf" style formatting that handles a narrower range of types and\nis slightly harder to use correctly, but is often faster for the cases\nit can handle (*printf-style String Formatting*).\n\nThe *Text Processing Services* section of the standard library covers\na number of other modules that provide various text related utilities\n(including regular expression support in the "re" module).\n\nstr.capitalize()\n\n   Return a copy of the string with its first character capitalized\n   and the rest lowercased.\n\nstr.casefold()\n\n   Return a casefolded copy of the string. Casefolded strings may be\n   used for caseless matching.\n\n   Casefolding is similar to lowercasing but more aggressive because\n   it is intended to remove all case distinctions in a string. For\n   example, the German lowercase letter "\'\xc3\x9f\'" is equivalent to ""ss"".\n   Since it is already lowercase, "lower()" would do nothing to "\'\xc3\x9f\'";\n   "casefold()" converts it to ""ss"".\n\n   The casefolding algorithm is described in section 3.13 of the\n   Unicode Standard.\n\n   New in version 3.3.\n\nstr.center(width[, fillchar])\n\n   Return centered in a string of length *width*. Padding is done\n   using the specified *fillchar* (default is a space).\n\nstr.count(sub[, start[, end]])\n\n   Return the number of non-overlapping occurrences of substring *sub*\n   in the range [*start*, *end*].  Optional arguments *start* and\n   *end* are interpreted as in slice notation.\n\nstr.encode(encoding="utf-8", errors="strict")\n\n   Return an encoded version of the string as a bytes object. Default\n   encoding is "\'utf-8\'". *errors* may be given to set a different\n   error handling scheme. The default for *errors* is "\'strict\'",\n   meaning that encoding errors raise a "UnicodeError". Other possible\n   values are "\'ignore\'", "\'replace\'", "\'xmlcharrefreplace\'",\n   "\'backslashreplace\'" and any other name registered via\n   "codecs.register_error()", see section *Codec Base Classes*. For a\n   list of possible encodings, see section *Standard Encodings*.\n\n   Changed in version 3.1: Support for keyword arguments added.\n\nstr.endswith(suffix[, start[, end]])\n\n   Return "True" if the string ends with the specified *suffix*,\n   otherwise return "False".  *suffix* can also be a tuple of suffixes\n   to look for.  With optional *start*, test beginning at that\n   position.  With optional *end*, stop comparing at that position.\n\nstr.expandtabs([tabsize])\n\n   Return a copy of the string where all tab characters are replaced\n   by one or more spaces, depending on the current column and the\n   given tab size.  Tab positions occur every *tabsize* characters\n   (default is 8, giving tab positions at columns 0, 8, 16 and so on).\n   To expand the string, the current column is set to zero and the\n   string is examined character by character.  If the character is a\n   tab ("\\t"), one or more space characters are inserted in the result\n   until the current column is equal to the next tab position. (The\n   tab character itself is not copied.)  If the character is a newline\n   ("\\n") or return ("\\r"), it is copied and the current column is\n   reset to zero.  Any other character is copied unchanged and the\n   current column is incremented by one regardless of how the\n   character is represented when printed.\n\n   >>> \'01\\t012\\t0123\\t01234\'.expandtabs()\n   \'01      012     0123    01234\'\n   >>> \'01\\t012\\t0123\\t01234\'.expandtabs(4)\n   \'01  012 0123    01234\'\n\nstr.find(sub[, start[, end]])\n\n   Return the lowest index in the string where substring *sub* is\n   found, such that *sub* is contained in the slice "s[start:end]".\n   Optional arguments *start* and *end* are interpreted as in slice\n   notation.  Return "-1" if *sub* is not found.\n\n   Note: The "find()" method should be used only if you need to know\n     the position of *sub*.  To check if *sub* is a substring or not,\n     use the "in" operator:\n\n        >>> \'Py\' in \'Python\'\n        True\n\nstr.format(*args, **kwargs)\n\n   Perform a string formatting operation.  The string on which this\n   method is called can contain literal text or replacement fields\n   delimited by braces "{}".  Each replacement field contains either\n   the numeric index of a positional argument, or the name of a\n   keyword argument.  Returns a copy of the string where each\n   replacement field is replaced with the string value of the\n   corresponding argument.\n\n   >>> "The sum of 1 + 2 is {0}".format(1+2)\n   \'The sum of 1 + 2 is 3\'\n\n   See *Format String Syntax* for a description of the various\n   formatting options that can be specified in format strings.\n\nstr.format_map(mapping)\n\n   Similar to "str.format(**mapping)", except that "mapping" is used\n   directly and not copied to a "dict".  This is useful if for example\n   "mapping" is a dict subclass:\n\n   >>> class Default(dict):\n   ...     def __missing__(self, key):\n   ...         return key\n   ...\n   >>> \'{name} was born in {country}\'.format_map(Default(name=\'Guido\'))\n   \'Guido was born in country\'\n\n   New in version 3.2.\n\nstr.index(sub[, start[, end]])\n\n   Like "find()", but raise "ValueError" when the substring is not\n   found.\n\nstr.isalnum()\n\n   Return true if all characters in the string are alphanumeric and\n   there is at least one character, false otherwise.  A character "c"\n   is alphanumeric if one of the following returns "True":\n   "c.isalpha()", "c.isdecimal()", "c.isdigit()", or "c.isnumeric()".\n\nstr.isalpha()\n\n   Return true if all characters in the string are alphabetic and\n   there is at least one character, false otherwise.  Alphabetic\n   characters are those characters defined in the Unicode character\n   database as "Letter", i.e., those with general category property\n   being one of "Lm", "Lt", "Lu", "Ll", or "Lo".  Note that this is\n   different from the "Alphabetic" property defined in the Unicode\n   Standard.\n\nstr.isdecimal()\n\n   Return true if all characters in the string are decimal characters\n   and there is at least one character, false otherwise. Decimal\n   characters are those from general category "Nd". This category\n   includes digit characters, and all characters that can be used to\n   form decimal-radix numbers, e.g. U+0660, ARABIC-INDIC DIGIT ZERO.\n\nstr.isdigit()\n\n   Return true if all characters in the string are digits and there is\n   at least one character, false otherwise.  Digits include decimal\n   characters and digits that need special handling, such as the\n   compatibility superscript digits.  Formally, a digit is a character\n   that has the property value Numeric_Type=Digit or\n   Numeric_Type=Decimal.\n\nstr.isidentifier()\n\n   Return true if the string is a valid identifier according to the\n   language definition, section *Identifiers and keywords*.\n\n   Use "keyword.iskeyword()" to test for reserved identifiers such as\n   "def" and "class".\n\nstr.islower()\n\n   Return true if all cased characters [4] in the string are lowercase\n   and there is at least one cased character, false otherwise.\n\nstr.isnumeric()\n\n   Return true if all characters in the string are numeric characters,\n   and there is at least one character, false otherwise. Numeric\n   characters include digit characters, and all characters that have\n   the Unicode numeric value property, e.g. U+2155, VULGAR FRACTION\n   ONE FIFTH.  Formally, numeric characters are those with the\n   property value Numeric_Type=Digit, Numeric_Type=Decimal or\n   Numeric_Type=Numeric.\n\nstr.isprintable()\n\n   Return true if all characters in the string are printable or the\n   string is empty, false otherwise.  Nonprintable characters are\n   those characters defined in the Unicode character database as\n   "Other" or "Separator", excepting the ASCII space (0x20) which is\n   considered printable.  (Note that printable characters in this\n   context are those which should not be escaped when "repr()" is\n   invoked on a string.  It has no bearing on the handling of strings\n   written to "sys.stdout" or "sys.stderr".)\n\nstr.isspace()\n\n   Return true if there are only whitespace characters in the string\n   and there is at least one character, false otherwise.  Whitespace\n   characters  are those characters defined in the Unicode character\n   database as "Other" or "Separator" and those with bidirectional\n   property being one of "WS", "B", or "S".\n\nstr.istitle()\n\n   Return true if the string is a titlecased string and there is at\n   least one character, for example uppercase characters may only\n   follow uncased characters and lowercase characters only cased ones.\n   Return false otherwise.\n\nstr.isupper()\n\n   Return true if all cased characters [4] in the string are uppercase\n   and there is at least one cased character, false otherwise.\n\nstr.join(iterable)\n\n   Return a string which is the concatenation of the strings in the\n   *iterable* *iterable*.  A "TypeError" will be raised if there are\n   any non-string values in *iterable*, including "bytes" objects.\n   The separator between elements is the string providing this method.\n\nstr.ljust(width[, fillchar])\n\n   Return the string left justified in a string of length *width*.\n   Padding is done using the specified *fillchar* (default is a\n   space).  The original string is returned if *width* is less than or\n   equal to "len(s)".\n\nstr.lower()\n\n   Return a copy of the string with all the cased characters [4]\n   converted to lowercase.\n\n   The lowercasing algorithm used is described in section 3.13 of the\n   Unicode Standard.\n\nstr.lstrip([chars])\n\n   Return a copy of the string with leading characters removed.  The\n   *chars* argument is a string specifying the set of characters to be\n   removed.  If omitted or "None", the *chars* argument defaults to\n   removing whitespace.  The *chars* argument is not a prefix; rather,\n   all combinations of its values are stripped:\n\n   >>> \'   spacious   \'.lstrip()\n   \'spacious   \'\n   >>> \'www.example.com\'.lstrip(\'cmowz.\')\n   \'example.com\'\n\nstatic str.maketrans(x[, y[, z]])\n\n   This static method returns a translation table usable for\n   "str.translate()".\n\n   If there is only one argument, it must be a dictionary mapping\n   Unicode ordinals (integers) or characters (strings of length 1) to\n   Unicode ordinals, strings (of arbitrary lengths) or None.\n   Character keys will then be converted to ordinals.\n\n   If there are two arguments, they must be strings of equal length,\n   and in the resulting dictionary, each character in x will be mapped\n   to the character at the same position in y.  If there is a third\n   argument, it must be a string, whose characters will be mapped to\n   None in the result.\n\nstr.partition(sep)\n\n   Split the string at the first occurrence of *sep*, and return a\n   3-tuple containing the part before the separator, the separator\n   itself, and the part after the separator.  If the separator is not\n   found, return a 3-tuple containing the string itself, followed by\n   two empty strings.\n\nstr.replace(old, new[, count])\n\n   Return a copy of the string with all occurrences of substring *old*\n   replaced by *new*.  If the optional argument *count* is given, only\n   the first *count* occurrences are replaced.\n\nstr.rfind(sub[, start[, end]])\n\n   Return the highest index in the string where substring *sub* is\n   found, such that *sub* is contained within "s[start:end]".\n   Optional arguments *start* and *end* are interpreted as in slice\n   notation.  Return "-1" on failure.\n\nstr.rindex(sub[, start[, end]])\n\n   Like "rfind()" but raises "ValueError" when the substring *sub* is\n   not found.\n\nstr.rjust(width[, fillchar])\n\n   Return the string right justified in a string of length *width*.\n   Padding is done using the specified *fillchar* (default is a\n   space). The original string is returned if *width* is less than or\n   equal to "len(s)".\n\nstr.rpartition(sep)\n\n   Split the string at the last occurrence of *sep*, and return a\n   3-tuple containing the part before the separator, the separator\n   itself, and the part after the separator.  If the separator is not\n   found, return a 3-tuple containing two empty strings, followed by\n   the string itself.\n\nstr.rsplit(sep=None, maxsplit=-1)\n\n   Return a list of the words in the string, using *sep* as the\n   delimiter string. If *maxsplit* is given, at most *maxsplit* splits\n   are done, the *rightmost* ones.  If *sep* is not specified or\n   "None", any whitespace string is a separator.  Except for splitting\n   from the right, "rsplit()" behaves like "split()" which is\n   described in detail below.\n\nstr.rstrip([chars])\n\n   Return a copy of the string with trailing characters removed.  The\n   *chars* argument is a string specifying the set of characters to be\n   removed.  If omitted or "None", the *chars* argument defaults to\n   removing whitespace.  The *chars* argument is not a suffix; rather,\n   all combinations of its values are stripped:\n\n   >>> \'   spacious   \'.rstrip()\n   \'   spacious\'\n   >>> \'mississippi\'.rstrip(\'ipz\')\n   \'mississ\'\n\nstr.split(sep=None, maxsplit=-1)\n\n   Return a list of the words in the string, using *sep* as the\n   delimiter string.  If *maxsplit* is given, at most *maxsplit*\n   splits are done (thus, the list will have at most "maxsplit+1"\n   elements).  If *maxsplit* is not specified or "-1", then there is\n   no limit on the number of splits (all possible splits are made).\n\n   If *sep* is given, consecutive delimiters are not grouped together\n   and are deemed to delimit empty strings (for example,\n   "\'1,,2\'.split(\',\')" returns "[\'1\', \'\', \'2\']").  The *sep* argument\n   may consist of multiple characters (for example,\n   "\'1<>2<>3\'.split(\'<>\')" returns "[\'1\', \'2\', \'3\']"). Splitting an\n   empty string with a specified separator returns "[\'\']".\n\n   If *sep* is not specified or is "None", a different splitting\n   algorithm is applied: runs of consecutive whitespace are regarded\n   as a single separator, and the result will contain no empty strings\n   at the start or end if the string has leading or trailing\n   whitespace.  Consequently, splitting an empty string or a string\n   consisting of just whitespace with a "None" separator returns "[]".\n\n   For example, "\' 1  2   3  \'.split()" returns "[\'1\', \'2\', \'3\']", and\n   "\'  1  2   3  \'.split(None, 1)" returns "[\'1\', \'2   3  \']".\n\nstr.splitlines([keepends])\n\n   Return a list of the lines in the string, breaking at line\n   boundaries. This method uses the *universal newlines* approach to\n   splitting lines. Line breaks are not included in the resulting list\n   unless *keepends* is given and true.\n\n   For example, "\'ab c\\n\\nde fg\\rkl\\r\\n\'.splitlines()" returns "[\'ab\n   c\', \'\', \'de fg\', \'kl\']", while the same call with\n   "splitlines(True)" returns "[\'ab c\\n\', \'\\n\', \'de fg\\r\', \'kl\\r\\n\']".\n\n   Unlike "split()" when a delimiter string *sep* is given, this\n   method returns an empty list for the empty string, and a terminal\n   line break does not result in an extra line.\n\nstr.startswith(prefix[, start[, end]])\n\n   Return "True" if string starts with the *prefix*, otherwise return\n   "False". *prefix* can also be a tuple of prefixes to look for.\n   With optional *start*, test string beginning at that position.\n   With optional *end*, stop comparing string at that position.\n\nstr.strip([chars])\n\n   Return a copy of the string with the leading and trailing\n   characters removed. The *chars* argument is a string specifying the\n   set of characters to be removed. If omitted or "None", the *chars*\n   argument defaults to removing whitespace. The *chars* argument is\n   not a prefix or suffix; rather, all combinations of its values are\n   stripped:\n\n   >>> \'   spacious   \'.strip()\n   \'spacious\'\n   >>> \'www.example.com\'.strip(\'cmowz.\')\n   \'example\'\n\nstr.swapcase()\n\n   Return a copy of the string with uppercase characters converted to\n   lowercase and vice versa. Note that it is not necessarily true that\n   "s.swapcase().swapcase() == s".\n\nstr.title()\n\n   Return a titlecased version of the string where words start with an\n   uppercase character and the remaining characters are lowercase.\n\n   The algorithm uses a simple language-independent definition of a\n   word as groups of consecutive letters.  The definition works in\n   many contexts but it means that apostrophes in contractions and\n   possessives form word boundaries, which may not be the desired\n   result:\n\n      >>> "they\'re bill\'s friends from the UK".title()\n      "They\'Re Bill\'S Friends From The Uk"\n\n   A workaround for apostrophes can be constructed using regular\n   expressions:\n\n      >>> import re\n      >>> def titlecase(s):\n      ...     return re.sub(r"[A-Za-z]+(\'[A-Za-z]+)?",\n      ...                   lambda mo: mo.group(0)[0].upper() +\n      ...                              mo.group(0)[1:].lower(),\n      ...                   s)\n      ...\n      >>> titlecase("they\'re bill\'s friends.")\n      "They\'re Bill\'s Friends."\n\nstr.translate(map)\n\n   Return a copy of the *s* where all characters have been mapped\n   through the *map* which must be a dictionary of Unicode ordinals\n   (integers) to Unicode ordinals, strings or "None".  Unmapped\n   characters are left untouched. Characters mapped to "None" are\n   deleted.\n\n   You can use "str.maketrans()" to create a translation map from\n   character-to-character mappings in different formats.\n\n   Note: An even more flexible approach is to create a custom\n     character mapping codec using the "codecs" module (see\n     "encodings.cp1251" for an example).\n\nstr.upper()\n\n   Return a copy of the string with all the cased characters [4]\n   converted to uppercase.  Note that "str.upper().isupper()" might be\n   "False" if "s" contains uncased characters or if the Unicode\n   category of the resulting character(s) is not "Lu" (Letter,\n   uppercase), but e.g. "Lt" (Letter, titlecase).\n\n   The uppercasing algorithm used is described in section 3.13 of the\n   Unicode Standard.\n\nstr.zfill(width)\n\n   Return the numeric string left filled with zeros in a string of\n   length *width*.  A sign prefix is handled correctly.  The original\n   string is returned if *width* is less than or equal to "len(s)".\n',
- 'strings': '\nString and Bytes literals\n*************************\n\nString literals are described by the following lexical definitions:\n\n   stringliteral   ::= [stringprefix](shortstring | longstring)\n   stringprefix    ::= "r" | "u" | "R" | "U"\n   shortstring     ::= "\'" shortstringitem* "\'" | \'"\' shortstringitem* \'"\'\n   longstring      ::= "\'\'\'" longstringitem* "\'\'\'" | \'"""\' longstringitem* \'"""\'\n   shortstringitem ::= shortstringchar | stringescapeseq\n   longstringitem  ::= longstringchar | stringescapeseq\n   shortstringchar ::= <any source character except "\\" or newline or the quote>\n   longstringchar  ::= <any source character except "\\">\n   stringescapeseq ::= "\\" <any source character>\n\n   bytesliteral   ::= bytesprefix(shortbytes | longbytes)\n   bytesprefix    ::= "b" | "B" | "br" | "Br" | "bR" | "BR" | "rb" | "rB" | "Rb" | "RB"\n   shortbytes     ::= "\'" shortbytesitem* "\'" | \'"\' shortbytesitem* \'"\'\n   longbytes      ::= "\'\'\'" longbytesitem* "\'\'\'" | \'"""\' longbytesitem* \'"""\'\n   shortbytesitem ::= shortbyteschar | bytesescapeseq\n   longbytesitem  ::= longbyteschar | bytesescapeseq\n   shortbyteschar ::= <any ASCII character except "\\" or newline or the quote>\n   longbyteschar  ::= <any ASCII character except "\\">\n   bytesescapeseq ::= "\\" <any ASCII character>\n\nOne syntactic restriction not indicated by these productions is that\nwhitespace is not allowed between the "stringprefix" or "bytesprefix"\nand the rest of the literal. The source character set is defined by\nthe encoding declaration; it is UTF-8 if no encoding declaration is\ngiven in the source file; see section *Encoding declarations*.\n\nIn plain English: Both types of literals can be enclosed in matching\nsingle quotes ("\'") or double quotes (""").  They can also be enclosed\nin matching groups of three single or double quotes (these are\ngenerally referred to as *triple-quoted strings*).  The backslash\n("\\") character is used to escape characters that otherwise have a\nspecial meaning, such as newline, backslash itself, or the quote\ncharacter.\n\nBytes literals are always prefixed with "\'b\'" or "\'B\'"; they produce\nan instance of the "bytes" type instead of the "str" type.  They may\nonly contain ASCII characters; bytes with a numeric value of 128 or\ngreater must be expressed with escapes.\n\nAs of Python 3.3 it is possible again to prefix unicode strings with a\n"u" prefix to simplify maintenance of dual 2.x and 3.x codebases.\n\nBoth string and bytes literals may optionally be prefixed with a\nletter "\'r\'" or "\'R\'"; such strings are called *raw strings* and treat\nbackslashes as literal characters.  As a result, in string literals,\n"\'\\U\'" and "\'\\u\'" escapes in raw strings are not treated specially.\nGiven that Python 2.x\'s raw unicode literals behave differently than\nPython 3.x\'s the "\'ur\'" syntax is not supported.\n\n   New in version 3.3: The "\'rb\'" prefix of raw bytes literals has\n   been added as a synonym of "\'br\'".\n\n   New in version 3.3: Support for the unicode legacy literal\n   ("u\'value\'") was reintroduced to simplify the maintenance of dual\n   Python 2.x and 3.x codebases. See **PEP 414** for more information.\n\nIn triple-quoted strings, unescaped newlines and quotes are allowed\n(and are retained), except that three unescaped quotes in a row\nterminate the string.  (A "quote" is the character used to open the\nstring, i.e. either "\'" or """.)\n\nUnless an "\'r\'" or "\'R\'" prefix is present, escape sequences in\nstrings are interpreted according to rules similar to those used by\nStandard C.  The recognized escape sequences are:\n\n+-------------------+-----------------------------------+---------+\n| Escape Sequence   | Meaning                           | Notes   |\n+===================+===================================+=========+\n+-------------------+-----------------------------------+---------+\n+-------------------+-----------------------------------+---------+\n+-------------------+-----------------------------------+---------+\n+-------------------+-----------------------------------+---------+\n+-------------------+-----------------------------------+---------+\n+-------------------+-----------------------------------+---------+\n+-------------------+-----------------------------------+---------+\n+-------------------+-----------------------------------+---------+\n+-------------------+-----------------------------------+---------+\n+-------------------+-----------------------------------+---------+\n+-------------------+-----------------------------------+---------+\n| "\\ooo"            | Character with octal value *ooo*  | (1,3)   |\n+-------------------+-----------------------------------+---------+\n| "\\xhh"            | Character with hex value *hh*     | (2,3)   |\n+-------------------+-----------------------------------+---------+\n\nEscape sequences only recognized in string literals are:\n\n+-------------------+-----------------------------------+---------+\n| Escape Sequence   | Meaning                           | Notes   |\n+===================+===================================+=========+\n| "\\N{name}"        | Character named *name* in the     | (4)     |\n+-------------------+-----------------------------------+---------+\n| "\\uxxxx"          | Character with 16-bit hex value   | (5)     |\n+-------------------+-----------------------------------+---------+\n| "\\Uxxxxxxxx"      | Character with 32-bit hex value   | (6)     |\n+-------------------+-----------------------------------+---------+\n\nNotes:\n\n1. As in Standard C, up to three octal digits are accepted.\n\n2. Unlike in Standard C, exactly two hex digits are required.\n\n3. In a bytes literal, hexadecimal and octal escapes denote the\n   byte with the given value. In a string literal, these escapes\n   denote a Unicode character with the given value.\n\n4. Changed in version 3.3: Support for name aliases [1] has been\n   added.\n\n5. Individual code units which form parts of a surrogate pair can\n   be encoded using this escape sequence.  Exactly four hex digits are\n   required.\n\n6. Any Unicode character can be encoded this way.  Exactly eight\n   hex digits are required.\n\nUnlike Standard C, all unrecognized escape sequences are left in the\nstring unchanged, i.e., *the backslash is left in the string*.  (This\nbehavior is useful when debugging: if an escape sequence is mistyped,\nthe resulting output is more easily recognized as broken.)  It is also\nimportant to note that the escape sequences only recognized in string\nliterals fall into the category of unrecognized escapes for bytes\nliterals.\n\nEven in a raw string, string quotes can be escaped with a backslash,\nbut the backslash remains in the string; for example, "r"\\""" is a\nvalid string literal consisting of two characters: a backslash and a\ndouble quote; "r"\\"" is not a valid string literal (even a raw string\ncannot end in an odd number of backslashes).  Specifically, *a raw\nstring cannot end in a single backslash* (since the backslash would\nescape the following quote character).  Note also that a single\nbackslash followed by a newline is interpreted as those two characters\nas part of the string, *not* as a line continuation.\n',
- 'subscriptions': '\nSubscriptions\n*************\n\nA subscription selects an item of a sequence (string, tuple or list)\nor mapping (dictionary) object:\n\n   subscription ::= primary "[" expression_list "]"\n\nThe primary must evaluate to an object that supports subscription,\ne.g. a list or dictionary.  User-defined objects can support\nsubscription by defining a "__getitem__()" method.\n\nFor built-in objects, there are two types of objects that support\nsubscription:\n\nIf the primary is a mapping, the expression list must evaluate to an\nobject whose value is one of the keys of the mapping, and the\nsubscription selects the value in the mapping that corresponds to that\nkey.  (The expression list is a tuple except if it has exactly one\nitem.)\n\nIf the primary is a sequence, the expression (list) must evaluate to\nan integer or a slice (as discussed in the following section).\n\nThe formal syntax makes no special provision for negative indices in\nsequences; however, built-in sequences all provide a "__getitem__()"\nmethod that interprets negative indices by adding the length of the\nsequence to the index (so that "x[-1]" selects the last item of "x").\nThe resulting value must be a nonnegative integer less than the number\nof items in the sequence, and the subscription selects the item whose\nindex is that value (counting from zero). Since the support for\nnegative indices and slicing occurs in the object\'s "__getitem__()"\nmethod, subclasses overriding this method will need to explicitly add\nthat support.\n\nA string\'s items are characters.  A character is not a separate data\ntype but a string of exactly one character.\n',
+ 'specialnames': '\nSpecial method names\n********************\n\nA class can implement certain operations that are invoked by special\nsyntax (such as arithmetic operations or subscripting and slicing) by\ndefining methods with special names. This is Python\'s approach to\n*operator overloading*, allowing classes to define their own behavior\nwith respect to language operators.  For instance, if a class defines\na method named "__getitem__()", and "x" is an instance of this class,\nthen "x[i]" is roughly equivalent to "type(x).__getitem__(x, i)".\nExcept where mentioned, attempts to execute an operation raise an\nexception when no appropriate method is defined (typically\n"AttributeError" or "TypeError").\n\nWhen implementing a class that emulates any built-in type, it is\nimportant that the emulation only be implemented to the degree that it\nmakes sense for the object being modelled.  For example, some\nsequences may work well with retrieval of individual elements, but\nextracting a slice may not make sense.  (One example of this is the\n"NodeList" interface in the W3C\'s Document Object Model.)\n\n\nBasic customization\n===================\n\nobject.__new__(cls[, ...])\n\n   Called to create a new instance of class *cls*.  "__new__()" is a\n   static method (special-cased so you need not declare it as such)\n   that takes the class of which an instance was requested as its\n   first argument.  The remaining arguments are those passed to the\n   object constructor expression (the call to the class).  The return\n   value of "__new__()" should be the new object instance (usually an\n   instance of *cls*).\n\n   Typical implementations create a new instance of the class by\n   invoking the superclass\'s "__new__()" method using\n   "super(currentclass, cls).__new__(cls[, ...])" with appropriate\n   arguments and then modifying the newly-created instance as\n   necessary before returning it.\n\n   If "__new__()" returns an instance of *cls*, then the new\n   instance\'s "__init__()" method will be invoked like\n   "__init__(self[, ...])", where *self* is the new instance and the\n   remaining arguments are the same as were passed to "__new__()".\n\n   If "__new__()" does not return an instance of *cls*, then the new\n   instance\'s "__init__()" method will not be invoked.\n\n   "__new__()" is intended mainly to allow subclasses of immutable\n   types (like int, str, or tuple) to customize instance creation.  It\n   is also commonly overridden in custom metaclasses in order to\n   customize class creation.\n\nobject.__init__(self[, ...])\n\n   Called when the instance is created.  The arguments are those\n   passed to the class constructor expression.  If a base class has an\n   "__init__()" method, the derived class\'s "__init__()" method, if\n   any, must explicitly call it to ensure proper initialization of the\n   base class part of the instance; for example:\n   "BaseClass.__init__(self, [args...])".  As a special constraint on\n   constructors, no value may be returned; doing so will cause a\n   "TypeError" to be raised at runtime.\n\nobject.__del__(self)\n\n   Called when the instance is about to be destroyed.  This is also\n   called a destructor.  If a base class has a "__del__()" method, the\n   derived class\'s "__del__()" method, if any, must explicitly call it\n   to ensure proper deletion of the base class part of the instance.\n   Note that it is possible (though not recommended!) for the\n   "__del__()" method to postpone destruction of the instance by\n   creating a new reference to it.  It may then be called at a later\n   time when this new reference is deleted.  It is not guaranteed that\n   "__del__()" methods are called for objects that still exist when\n   the interpreter exits.\n\n   Note: "del x" doesn\'t directly call "x.__del__()" --- the former\n     decrements the reference count for "x" by one, and the latter is\n     only called when "x"\'s reference count reaches zero.  Some common\n     situations that may prevent the reference count of an object from\n     going to zero include: circular references between objects (e.g.,\n     a doubly-linked list or a tree data structure with parent and\n     child pointers); a reference to the object on the stack frame of\n     a function that caught an exception (the traceback stored in\n     "sys.exc_info()[2]" keeps the stack frame alive); or a reference\n     to the object on the stack frame that raised an unhandled\n     exception in interactive mode (the traceback stored in\n     "sys.last_traceback" keeps the stack frame alive).  The first\n     situation can only be remedied by explicitly breaking the cycles;\n     the latter two situations can be resolved by storing "None" in\n     "sys.last_traceback". Circular references which are garbage are\n     detected and cleaned up when the cyclic garbage collector is\n     enabled (it\'s on by default). Refer to the documentation for the\n     "gc" module for more information about this topic.\n\n   Warning: Due to the precarious circumstances under which\n     "__del__()" methods are invoked, exceptions that occur during\n     their execution are ignored, and a warning is printed to\n     "sys.stderr" instead. Also, when "__del__()" is invoked in\n     response to a module being deleted (e.g., when execution of the\n     program is done), other globals referenced by the "__del__()"\n     method may already have been deleted or in the process of being\n     torn down (e.g. the import machinery shutting down).  For this\n     reason, "__del__()" methods should do the absolute minimum needed\n     to maintain external invariants.  Starting with version 1.5,\n     Python guarantees that globals whose name begins with a single\n     underscore are deleted from their module before other globals are\n     deleted; if no other references to such globals exist, this may\n     help in assuring that imported modules are still available at the\n     time when the "__del__()" method is called.\n\nobject.__repr__(self)\n\n   Called by the "repr()" built-in function to compute the "official"\n   string representation of an object.  If at all possible, this\n   should look like a valid Python expression that could be used to\n   recreate an object with the same value (given an appropriate\n   environment).  If this is not possible, a string of the form\n   "<...some useful description...>" should be returned. The return\n   value must be a string object. If a class defines "__repr__()" but\n   not "__str__()", then "__repr__()" is also used when an "informal"\n   string representation of instances of that class is required.\n\n   This is typically used for debugging, so it is important that the\n   representation is information-rich and unambiguous.\n\nobject.__str__(self)\n\n   Called by "str(object)" and the built-in functions "format()" and\n   "print()" to compute the "informal" or nicely printable string\n   representation of an object.  The return value must be a *string*\n   object.\n\n   This method differs from "object.__repr__()" in that there is no\n   expectation that "__str__()" return a valid Python expression: a\n   more convenient or concise representation can be used.\n\n   The default implementation defined by the built-in type "object"\n   calls "object.__repr__()".\n\nobject.__bytes__(self)\n\n   Called by "bytes()" to compute a byte-string representation of an\n   object. This should return a "bytes" object.\n\nobject.__format__(self, format_spec)\n\n   Called by the "format()" built-in function (and by extension, the\n   "str.format()" method of class "str") to produce a "formatted"\n   string representation of an object. The "format_spec" argument is a\n   string that contains a description of the formatting options\n   desired. The interpretation of the "format_spec" argument is up to\n   the type implementing "__format__()", however most classes will\n   either delegate formatting to one of the built-in types, or use a\n   similar formatting option syntax.\n\n   See *Format Specification Mini-Language* for a description of the\n   standard formatting syntax.\n\n   The return value must be a string object.\n\n   Changed in version 3.4: The __format__ method of "object" itself\n   raises a "TypeError" if passed any non-empty string.\n\nobject.__lt__(self, other)\nobject.__le__(self, other)\nobject.__eq__(self, other)\nobject.__ne__(self, other)\nobject.__gt__(self, other)\nobject.__ge__(self, other)\n\n   These are the so-called "rich comparison" methods. The\n   correspondence between operator symbols and method names is as\n   follows: "x<y" calls "x.__lt__(y)", "x<=y" calls "x.__le__(y)",\n   "x==y" calls "x.__eq__(y)", "x!=y" calls "x.__ne__(y)", "x>y" calls\n   "x.__gt__(y)", and "x>=y" calls "x.__ge__(y)".\n\n   A rich comparison method may return the singleton "NotImplemented"\n   if it does not implement the operation for a given pair of\n   arguments. By convention, "False" and "True" are returned for a\n   successful comparison. However, these methods can return any value,\n   so if the comparison operator is used in a Boolean context (e.g.,\n   in the condition of an "if" statement), Python will call "bool()"\n   on the value to determine if the result is true or false.\n\n   There are no implied relationships among the comparison operators.\n   The truth of "x==y" does not imply that "x!=y" is false.\n   Accordingly, when defining "__eq__()", one should also define\n   "__ne__()" so that the operators will behave as expected.  See the\n   paragraph on "__hash__()" for some important notes on creating\n   *hashable* objects which support custom comparison operations and\n   are usable as dictionary keys.\n\n   There are no swapped-argument versions of these methods (to be used\n   when the left argument does not support the operation but the right\n   argument does); rather, "__lt__()" and "__gt__()" are each other\'s\n   reflection, "__le__()" and "__ge__()" are each other\'s reflection,\n   and "__eq__()" and "__ne__()" are their own reflection.\n\n   Arguments to rich comparison methods are never coerced.\n\n   To automatically generate ordering operations from a single root\n   operation, see "functools.total_ordering()".\n\nobject.__hash__(self)\n\n   Called by built-in function "hash()" and for operations on members\n   of hashed collections including "set", "frozenset", and "dict".\n   "__hash__()" should return an integer.  The only required property\n   is that objects which compare equal have the same hash value; it is\n   advised to somehow mix together (e.g. using exclusive or) the hash\n   values for the components of the object that also play a part in\n   comparison of objects.\n\n   Note: "hash()" truncates the value returned from an object\'s\n     custom "__hash__()" method to the size of a "Py_ssize_t".  This\n     is typically 8 bytes on 64-bit builds and 4 bytes on 32-bit\n     builds. If an object\'s   "__hash__()" must interoperate on builds\n     of different bit sizes, be sure to check the width on all\n     supported builds.  An easy way to do this is with "python -c\n     "import sys; print(sys.hash_info.width)""\n\n   If a class does not define an "__eq__()" method it should not\n   define a "__hash__()" operation either; if it defines "__eq__()"\n   but not "__hash__()", its instances will not be usable as items in\n   hashable collections.  If a class defines mutable objects and\n   implements an "__eq__()" method, it should not implement\n   "__hash__()", since the implementation of hashable collections\n   requires that a key\'s hash value is immutable (if the object\'s hash\n   value changes, it will be in the wrong hash bucket).\n\n   User-defined classes have "__eq__()" and "__hash__()" methods by\n   default; with them, all objects compare unequal (except with\n   themselves) and "x.__hash__()" returns an appropriate value such\n   that "x == y" implies both that "x is y" and "hash(x) == hash(y)".\n\n   A class that overrides "__eq__()" and does not define "__hash__()"\n   will have its "__hash__()" implicitly set to "None".  When the\n   "__hash__()" method of a class is "None", instances of the class\n   will raise an appropriate "TypeError" when a program attempts to\n   retrieve their hash value, and will also be correctly identified as\n   unhashable when checking "isinstance(obj, collections.Hashable").\n\n   If a class that overrides "__eq__()" needs to retain the\n   implementation of "__hash__()" from a parent class, the interpreter\n   must be told this explicitly by setting "__hash__ =\n   <ParentClass>.__hash__".\n\n   If a class that does not override "__eq__()" wishes to suppress\n   hash support, it should include "__hash__ = None" in the class\n   definition. A class which defines its own "__hash__()" that\n   explicitly raises a "TypeError" would be incorrectly identified as\n   hashable by an "isinstance(obj, collections.Hashable)" call.\n\n   Note: By default, the "__hash__()" values of str, bytes and\n     datetime objects are "salted" with an unpredictable random value.\n     Although they remain constant within an individual Python\n     process, they are not predictable between repeated invocations of\n     Python.This is intended to provide protection against a denial-\n     of-service caused by carefully-chosen inputs that exploit the\n     worst case performance of a dict insertion, O(n^2) complexity.\n     See http://www.ocert.org/advisories/ocert-2011-003.html for\n     details.Changing hash values affects the iteration order of\n     dicts, sets and other mappings.  Python has never made guarantees\n     about this ordering (and it typically varies between 32-bit and\n     64-bit builds).See also "PYTHONHASHSEED".\n\n   Changed in version 3.3: Hash randomization is enabled by default.\n\nobject.__bool__(self)\n\n   Called to implement truth value testing and the built-in operation\n   "bool()"; should return "False" or "True".  When this method is not\n   defined, "__len__()" is called, if it is defined, and the object is\n   considered true if its result is nonzero.  If a class defines\n   neither "__len__()" nor "__bool__()", all its instances are\n   considered true.\n\n\nCustomizing attribute access\n============================\n\nThe following methods can be defined to customize the meaning of\nattribute access (use of, assignment to, or deletion of "x.name") for\nclass instances.\n\nobject.__getattr__(self, name)\n\n   Called when an attribute lookup has not found the attribute in the\n   usual places (i.e. it is not an instance attribute nor is it found\n   in the class tree for "self").  "name" is the attribute name. This\n   method should return the (computed) attribute value or raise an\n   "AttributeError" exception.\n\n   Note that if the attribute is found through the normal mechanism,\n   "__getattr__()" is not called.  (This is an intentional asymmetry\n   between "__getattr__()" and "__setattr__()".) This is done both for\n   efficiency reasons and because otherwise "__getattr__()" would have\n   no way to access other attributes of the instance.  Note that at\n   least for instance variables, you can fake total control by not\n   inserting any values in the instance attribute dictionary (but\n   instead inserting them in another object).  See the\n   "__getattribute__()" method below for a way to actually get total\n   control over attribute access.\n\nobject.__getattribute__(self, name)\n\n   Called unconditionally to implement attribute accesses for\n   instances of the class. If the class also defines "__getattr__()",\n   the latter will not be called unless "__getattribute__()" either\n   calls it explicitly or raises an "AttributeError". This method\n   should return the (computed) attribute value or raise an\n   "AttributeError" exception. In order to avoid infinite recursion in\n   this method, its implementation should always call the base class\n   method with the same name to access any attributes it needs, for\n   example, "object.__getattribute__(self, name)".\n\n   Note: This method may still be bypassed when looking up special\n     methods as the result of implicit invocation via language syntax\n     or built-in functions. See *Special method lookup*.\n\nobject.__setattr__(self, name, value)\n\n   Called when an attribute assignment is attempted.  This is called\n   instead of the normal mechanism (i.e. store the value in the\n   instance dictionary). *name* is the attribute name, *value* is the\n   value to be assigned to it.\n\n   If "__setattr__()" wants to assign to an instance attribute, it\n   should call the base class method with the same name, for example,\n   "object.__setattr__(self, name, value)".\n\nobject.__delattr__(self, name)\n\n   Like "__setattr__()" but for attribute deletion instead of\n   assignment.  This should only be implemented if "del obj.name" is\n   meaningful for the object.\n\nobject.__dir__(self)\n\n   Called when "dir()" is called on the object. A sequence must be\n   returned. "dir()" converts the returned sequence to a list and\n   sorts it.\n\n\nImplementing Descriptors\n------------------------\n\nThe following methods only apply when an instance of the class\ncontaining the method (a so-called *descriptor* class) appears in an\n*owner* class (the descriptor must be in either the owner\'s class\ndictionary or in the class dictionary for one of its parents).  In the\nexamples below, "the attribute" refers to the attribute whose name is\nthe key of the property in the owner class\' "__dict__".\n\nobject.__get__(self, instance, owner)\n\n   Called to get the attribute of the owner class (class attribute\n   access) or of an instance of that class (instance attribute\n   access). *owner* is always the owner class, while *instance* is the\n   instance that the attribute was accessed through, or "None" when\n   the attribute is accessed through the *owner*.  This method should\n   return the (computed) attribute value or raise an "AttributeError"\n   exception.\n\nobject.__set__(self, instance, value)\n\n   Called to set the attribute on an instance *instance* of the owner\n   class to a new value, *value*.\n\nobject.__delete__(self, instance)\n\n   Called to delete the attribute on an instance *instance* of the\n   owner class.\n\nThe attribute "__objclass__" is interpreted by the "inspect" module as\nspecifying the class where this object was defined (setting this\nappropriately can assist in runtime introspection of dynamic class\nattributes). For callables, it may indicate that an instance of the\ngiven type (or a subclass) is expected or required as the first\npositional argument (for example, CPython sets this attribute for\nunbound methods that are implemented in C).\n\n\nInvoking Descriptors\n--------------------\n\nIn general, a descriptor is an object attribute with "binding\nbehavior", one whose attribute access has been overridden by methods\nin the descriptor protocol:  "__get__()", "__set__()", and\n"__delete__()". If any of those methods are defined for an object, it\nis said to be a descriptor.\n\nThe default behavior for attribute access is to get, set, or delete\nthe attribute from an object\'s dictionary. For instance, "a.x" has a\nlookup chain starting with "a.__dict__[\'x\']", then\n"type(a).__dict__[\'x\']", and continuing through the base classes of\n"type(a)" excluding metaclasses.\n\nHowever, if the looked-up value is an object defining one of the\ndescriptor methods, then Python may override the default behavior and\ninvoke the descriptor method instead.  Where this occurs in the\nprecedence chain depends on which descriptor methods were defined and\nhow they were called.\n\nThe starting point for descriptor invocation is a binding, "a.x". How\nthe arguments are assembled depends on "a":\n\nDirect Call\n   The simplest and least common call is when user code directly\n   invokes a descriptor method:    "x.__get__(a)".\n\nInstance Binding\n   If binding to an object instance, "a.x" is transformed into the\n   call: "type(a).__dict__[\'x\'].__get__(a, type(a))".\n\nClass Binding\n   If binding to a class, "A.x" is transformed into the call:\n   "A.__dict__[\'x\'].__get__(None, A)".\n\nSuper Binding\n   If "a" is an instance of "super", then the binding "super(B,\n   obj).m()" searches "obj.__class__.__mro__" for the base class "A"\n   immediately preceding "B" and then invokes the descriptor with the\n   call: "A.__dict__[\'m\'].__get__(obj, obj.__class__)".\n\nFor instance bindings, the precedence of descriptor invocation depends\non the which descriptor methods are defined.  A descriptor can define\nany combination of "__get__()", "__set__()" and "__delete__()".  If it\ndoes not define "__get__()", then accessing the attribute will return\nthe descriptor object itself unless there is a value in the object\'s\ninstance dictionary.  If the descriptor defines "__set__()" and/or\n"__delete__()", it is a data descriptor; if it defines neither, it is\na non-data descriptor.  Normally, data descriptors define both\n"__get__()" and "__set__()", while non-data descriptors have just the\n"__get__()" method.  Data descriptors with "__set__()" and "__get__()"\ndefined always override a redefinition in an instance dictionary.  In\ncontrast, non-data descriptors can be overridden by instances.\n\nPython methods (including "staticmethod()" and "classmethod()") are\nimplemented as non-data descriptors.  Accordingly, instances can\nredefine and override methods.  This allows individual instances to\nacquire behaviors that differ from other instances of the same class.\n\nThe "property()" function is implemented as a data descriptor.\nAccordingly, instances cannot override the behavior of a property.\n\n\n__slots__\n---------\n\nBy default, instances of classes have a dictionary for attribute\nstorage.  This wastes space for objects having very few instance\nvariables.  The space consumption can become acute when creating large\nnumbers of instances.\n\nThe default can be overridden by defining *__slots__* in a class\ndefinition. The *__slots__* declaration takes a sequence of instance\nvariables and reserves just enough space in each instance to hold a\nvalue for each variable.  Space is saved because *__dict__* is not\ncreated for each instance.\n\nobject.__slots__\n\n   This class variable can be assigned a string, iterable, or sequence\n   of strings with variable names used by instances.  If defined in a\n   class, *__slots__* reserves space for the declared variables and\n   prevents the automatic creation of *__dict__* and *__weakref__* for\n   each instance.\n\n\nNotes on using *__slots__*\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n* When inheriting from a class without *__slots__*, the *__dict__*\n  attribute of that class will always be accessible, so a *__slots__*\n  definition in the subclass is meaningless.\n\n* Without a *__dict__* variable, instances cannot be assigned new\n  variables not listed in the *__slots__* definition.  Attempts to\n  assign to an unlisted variable name raises "AttributeError". If\n  dynamic assignment of new variables is desired, then add\n  "\'__dict__\'" to the sequence of strings in the *__slots__*\n  declaration.\n\n* Without a *__weakref__* variable for each instance, classes\n  defining *__slots__* do not support weak references to its\n  instances. If weak reference support is needed, then add\n  "\'__weakref__\'" to the sequence of strings in the *__slots__*\n  declaration.\n\n* *__slots__* are implemented at the class level by creating\n  descriptors (*Implementing Descriptors*) for each variable name.  As\n  a result, class attributes cannot be used to set default values for\n  instance variables defined by *__slots__*; otherwise, the class\n  attribute would overwrite the descriptor assignment.\n\n* The action of a *__slots__* declaration is limited to the class\n  where it is defined.  As a result, subclasses will have a *__dict__*\n  unless they also define *__slots__* (which must only contain names\n  of any *additional* slots).\n\n* If a class defines a slot also defined in a base class, the\n  instance variable defined by the base class slot is inaccessible\n  (except by retrieving its descriptor directly from the base class).\n  This renders the meaning of the program undefined.  In the future, a\n  check may be added to prevent this.\n\n* Nonempty *__slots__* does not work for classes derived from\n  "variable-length" built-in types such as "int", "bytes" and "tuple".\n\n* Any non-string iterable may be assigned to *__slots__*. Mappings\n  may also be used; however, in the future, special meaning may be\n  assigned to the values corresponding to each key.\n\n* *__class__* assignment works only if both classes have the same\n  *__slots__*.\n\n\nCustomizing class creation\n==========================\n\nBy default, classes are constructed using "type()". The class body is\nexecuted in a new namespace and the class name is bound locally to the\nresult of "type(name, bases, namespace)".\n\nThe class creation process can be customised by passing the\n"metaclass" keyword argument in the class definition line, or by\ninheriting from an existing class that included such an argument. In\nthe following example, both "MyClass" and "MySubclass" are instances\nof "Meta":\n\n   class Meta(type):\n       pass\n\n   class MyClass(metaclass=Meta):\n       pass\n\n   class MySubclass(MyClass):\n       pass\n\nAny other keyword arguments that are specified in the class definition\nare passed through to all metaclass operations described below.\n\nWhen a class definition is executed, the following steps occur:\n\n* the appropriate metaclass is determined\n\n* the class namespace is prepared\n\n* the class body is executed\n\n* the class object is created\n\n\nDetermining the appropriate metaclass\n-------------------------------------\n\nThe appropriate metaclass for a class definition is determined as\nfollows:\n\n* if no bases and no explicit metaclass are given, then "type()" is\n  used\n\n* if an explicit metaclass is given and it is *not* an instance of\n  "type()", then it is used directly as the metaclass\n\n* if an instance of "type()" is given as the explicit metaclass, or\n  bases are defined, then the most derived metaclass is used\n\nThe most derived metaclass is selected from the explicitly specified\nmetaclass (if any) and the metaclasses (i.e. "type(cls)") of all\nspecified base classes. The most derived metaclass is one which is a\nsubtype of *all* of these candidate metaclasses. If none of the\ncandidate metaclasses meets that criterion, then the class definition\nwill fail with "TypeError".\n\n\nPreparing the class namespace\n-----------------------------\n\nOnce the appropriate metaclass has been identified, then the class\nnamespace is prepared. If the metaclass has a "__prepare__" attribute,\nit is called as "namespace = metaclass.__prepare__(name, bases,\n**kwds)" (where the additional keyword arguments, if any, come from\nthe class definition).\n\nIf the metaclass has no "__prepare__" attribute, then the class\nnamespace is initialised as an empty "dict()" instance.\n\nSee also: **PEP 3115** - Metaclasses in Python 3000\n\n     Introduced the "__prepare__" namespace hook\n\n\nExecuting the class body\n------------------------\n\nThe class body is executed (approximately) as "exec(body, globals(),\nnamespace)". The key difference from a normal call to "exec()" is that\nlexical scoping allows the class body (including any methods) to\nreference names from the current and outer scopes when the class\ndefinition occurs inside a function.\n\nHowever, even when the class definition occurs inside the function,\nmethods defined inside the class still cannot see names defined at the\nclass scope. Class variables must be accessed through the first\nparameter of instance or class methods, and cannot be accessed at all\nfrom static methods.\n\n\nCreating the class object\n-------------------------\n\nOnce the class namespace has been populated by executing the class\nbody, the class object is created by calling "metaclass(name, bases,\nnamespace, **kwds)" (the additional keywords passed here are the same\nas those passed to "__prepare__").\n\nThis class object is the one that will be referenced by the zero-\nargument form of "super()". "__class__" is an implicit closure\nreference created by the compiler if any methods in a class body refer\nto either "__class__" or "super". This allows the zero argument form\nof "super()" to correctly identify the class being defined based on\nlexical scoping, while the class or instance that was used to make the\ncurrent call is identified based on the first argument passed to the\nmethod.\n\nAfter the class object is created, it is passed to the class\ndecorators included in the class definition (if any) and the resulting\nobject is bound in the local namespace as the defined class.\n\nSee also: **PEP 3135** - New super\n\n     Describes the implicit "__class__" closure reference\n\n\nMetaclass example\n-----------------\n\nThe potential uses for metaclasses are boundless. Some ideas that have\nbeen explored include logging, interface checking, automatic\ndelegation, automatic property creation, proxies, frameworks, and\nautomatic resource locking/synchronization.\n\nHere is an example of a metaclass that uses an\n"collections.OrderedDict" to remember the order that class variables\nare defined:\n\n   class OrderedClass(type):\n\n        @classmethod\n        def __prepare__(metacls, name, bases, **kwds):\n           return collections.OrderedDict()\n\n        def __new__(cls, name, bases, namespace, **kwds):\n           result = type.__new__(cls, name, bases, dict(namespace))\n           result.members = tuple(namespace)\n           return result\n\n   class A(metaclass=OrderedClass):\n       def one(self): pass\n       def two(self): pass\n       def three(self): pass\n       def four(self): pass\n\n   >>> A.members\n   (\'__module__\', \'one\', \'two\', \'three\', \'four\')\n\nWhen the class definition for *A* gets executed, the process begins\nwith calling the metaclass\'s "__prepare__()" method which returns an\nempty "collections.OrderedDict".  That mapping records the methods and\nattributes of *A* as they are defined within the body of the class\nstatement. Once those definitions are executed, the ordered dictionary\nis fully populated and the metaclass\'s "__new__()" method gets\ninvoked.  That method builds the new type and it saves the ordered\ndictionary keys in an attribute called "members".\n\n\nCustomizing instance and subclass checks\n========================================\n\nThe following methods are used to override the default behavior of the\n"isinstance()" and "issubclass()" built-in functions.\n\nIn particular, the metaclass "abc.ABCMeta" implements these methods in\norder to allow the addition of Abstract Base Classes (ABCs) as\n"virtual base classes" to any class or type (including built-in\ntypes), including other ABCs.\n\nclass.__instancecheck__(self, instance)\n\n   Return true if *instance* should be considered a (direct or\n   indirect) instance of *class*. If defined, called to implement\n   "isinstance(instance, class)".\n\nclass.__subclasscheck__(self, subclass)\n\n   Return true if *subclass* should be considered a (direct or\n   indirect) subclass of *class*.  If defined, called to implement\n   "issubclass(subclass, class)".\n\nNote that these methods are looked up on the type (metaclass) of a\nclass.  They cannot be defined as class methods in the actual class.\nThis is consistent with the lookup of special methods that are called\non instances, only in this case the instance is itself a class.\n\nSee also: **PEP 3119** - Introducing Abstract Base Classes\n\n     Includes the specification for customizing "isinstance()" and\n     "issubclass()" behavior through "__instancecheck__()" and\n     "__subclasscheck__()", with motivation for this functionality in\n     the context of adding Abstract Base Classes (see the "abc"\n     module) to the language.\n\n\nEmulating callable objects\n==========================\n\nobject.__call__(self[, args...])\n\n   Called when the instance is "called" as a function; if this method\n   is defined, "x(arg1, arg2, ...)" is a shorthand for\n   "x.__call__(arg1, arg2, ...)".\n\n\nEmulating container types\n=========================\n\nThe following methods can be defined to implement container objects.\nContainers usually are sequences (such as lists or tuples) or mappings\n(like dictionaries), but can represent other containers as well.  The\nfirst set of methods is used either to emulate a sequence or to\nemulate a mapping; the difference is that for a sequence, the\nallowable keys should be the integers *k* for which "0 <= k < N" where\n*N* is the length of the sequence, or slice objects, which define a\nrange of items.  It is also recommended that mappings provide the\nmethods "keys()", "values()", "items()", "get()", "clear()",\n"setdefault()", "pop()", "popitem()", "copy()", and "update()"\nbehaving similar to those for Python\'s standard dictionary objects.\nThe "collections" module provides a "MutableMapping" abstract base\nclass to help create those methods from a base set of "__getitem__()",\n"__setitem__()", "__delitem__()", and "keys()". Mutable sequences\nshould provide methods "append()", "count()", "index()", "extend()",\n"insert()", "pop()", "remove()", "reverse()" and "sort()", like Python\nstandard list objects.  Finally, sequence types should implement\naddition (meaning concatenation) and multiplication (meaning\nrepetition) by defining the methods "__add__()", "__radd__()",\n"__iadd__()", "__mul__()", "__rmul__()" and "__imul__()" described\nbelow; they should not define other numerical operators.  It is\nrecommended that both mappings and sequences implement the\n"__contains__()" method to allow efficient use of the "in" operator;\nfor mappings, "in" should search the mapping\'s keys; for sequences, it\nshould search through the values.  It is further recommended that both\nmappings and sequences implement the "__iter__()" method to allow\nefficient iteration through the container; for mappings, "__iter__()"\nshould be the same as "keys()"; for sequences, it should iterate\nthrough the values.\n\nobject.__len__(self)\n\n   Called to implement the built-in function "len()".  Should return\n   the length of the object, an integer ">=" 0.  Also, an object that\n   doesn\'t define a "__bool__()" method and whose "__len__()" method\n   returns zero is considered to be false in a Boolean context.\n\nobject.__length_hint__(self)\n\n   Called to implement "operator.length_hint()". Should return an\n   estimated length for the object (which may be greater or less than\n   the actual length). The length must be an integer ">=" 0. This\n   method is purely an optimization and is never required for\n   correctness.\n\n   New in version 3.4.\n\nNote: Slicing is done exclusively with the following three methods.\n  A call like\n\n     a[1:2] = b\n\n  is translated to\n\n     a[slice(1, 2, None)] = b\n\n  and so forth.  Missing slice items are always filled in with "None".\n\nobject.__getitem__(self, key)\n\n   Called to implement evaluation of "self[key]". For sequence types,\n   the accepted keys should be integers and slice objects.  Note that\n   the special interpretation of negative indexes (if the class wishes\n   to emulate a sequence type) is up to the "__getitem__()" method. If\n   *key* is of an inappropriate type, "TypeError" may be raised; if of\n   a value outside the set of indexes for the sequence (after any\n   special interpretation of negative values), "IndexError" should be\n   raised. For mapping types, if *key* is missing (not in the\n   container), "KeyError" should be raised.\n\n   Note: "for" loops expect that an "IndexError" will be raised for\n     illegal indexes to allow proper detection of the end of the\n     sequence.\n\nobject.__setitem__(self, key, value)\n\n   Called to implement assignment to "self[key]".  Same note as for\n   "__getitem__()".  This should only be implemented for mappings if\n   the objects support changes to the values for keys, or if new keys\n   can be added, or for sequences if elements can be replaced.  The\n   same exceptions should be raised for improper *key* values as for\n   the "__getitem__()" method.\n\nobject.__delitem__(self, key)\n\n   Called to implement deletion of "self[key]".  Same note as for\n   "__getitem__()".  This should only be implemented for mappings if\n   the objects support removal of keys, or for sequences if elements\n   can be removed from the sequence.  The same exceptions should be\n   raised for improper *key* values as for the "__getitem__()" method.\n\nobject.__iter__(self)\n\n   This method is called when an iterator is required for a container.\n   This method should return a new iterator object that can iterate\n   over all the objects in the container.  For mappings, it should\n   iterate over the keys of the container, and should also be made\n   available as the method "keys()".\n\n   Iterator objects also need to implement this method; they are\n   required to return themselves.  For more information on iterator\n   objects, see *Iterator Types*.\n\nobject.__reversed__(self)\n\n   Called (if present) by the "reversed()" built-in to implement\n   reverse iteration.  It should return a new iterator object that\n   iterates over all the objects in the container in reverse order.\n\n   If the "__reversed__()" method is not provided, the "reversed()"\n   built-in will fall back to using the sequence protocol ("__len__()"\n   and "__getitem__()").  Objects that support the sequence protocol\n   should only provide "__reversed__()" if they can provide an\n   implementation that is more efficient than the one provided by\n   "reversed()".\n\nThe membership test operators ("in" and "not in") are normally\nimplemented as an iteration through a sequence.  However, container\nobjects can supply the following special method with a more efficient\nimplementation, which also does not require the object be a sequence.\n\nobject.__contains__(self, item)\n\n   Called to implement membership test operators.  Should return true\n   if *item* is in *self*, false otherwise.  For mapping objects, this\n   should consider the keys of the mapping rather than the values or\n   the key-item pairs.\n\n   For objects that don\'t define "__contains__()", the membership test\n   first tries iteration via "__iter__()", then the old sequence\n   iteration protocol via "__getitem__()", see *this section in the\n   language reference*.\n\n\nEmulating numeric types\n=======================\n\nThe following methods can be defined to emulate numeric objects.\nMethods corresponding to operations that are not supported by the\nparticular kind of number implemented (e.g., bitwise operations for\nnon-integral numbers) should be left undefined.\n\nobject.__add__(self, other)\nobject.__sub__(self, other)\nobject.__mul__(self, other)\nobject.__truediv__(self, other)\nobject.__floordiv__(self, other)\nobject.__mod__(self, other)\nobject.__divmod__(self, other)\nobject.__pow__(self, other[, modulo])\nobject.__lshift__(self, other)\nobject.__rshift__(self, other)\nobject.__and__(self, other)\nobject.__xor__(self, other)\nobject.__or__(self, other)\n\n   These methods are called to implement the binary arithmetic\n   operations ("+", "-", "*", "/", "//", "%", "divmod()", "pow()",\n   "**", "<<", ">>", "&", "^", "|").  For instance, to evaluate the\n   expression "x + y", where *x* is an instance of a class that has an\n   "__add__()" method, "x.__add__(y)" is called.  The "__divmod__()"\n   method should be the equivalent to using "__floordiv__()" and\n   "__mod__()"; it should not be related to "__truediv__()".  Note\n   that "__pow__()" should be defined to accept an optional third\n   argument if the ternary version of the built-in "pow()" function is\n   to be supported.\n\n   If one of those methods does not support the operation with the\n   supplied arguments, it should return "NotImplemented".\n\nobject.__radd__(self, other)\nobject.__rsub__(self, other)\nobject.__rmul__(self, other)\nobject.__rtruediv__(self, other)\nobject.__rfloordiv__(self, other)\nobject.__rmod__(self, other)\nobject.__rdivmod__(self, other)\nobject.__rpow__(self, other)\nobject.__rlshift__(self, other)\nobject.__rrshift__(self, other)\nobject.__rand__(self, other)\nobject.__rxor__(self, other)\nobject.__ror__(self, other)\n\n   These methods are called to implement the binary arithmetic\n   operations ("+", "-", "*", "/", "//", "%", "divmod()", "pow()",\n   "**", "<<", ">>", "&", "^", "|") with reflected (swapped) operands.\n   These functions are only called if the left operand does not\n   support the corresponding operation and the operands are of\n   different types. [2]  For instance, to evaluate the expression "x -\n   y", where *y* is an instance of a class that has an "__rsub__()"\n   method, "y.__rsub__(x)" is called if "x.__sub__(y)" returns\n   *NotImplemented*.\n\n   Note that ternary "pow()" will not try calling "__rpow__()" (the\n   coercion rules would become too complicated).\n\n   Note: If the right operand\'s type is a subclass of the left\n     operand\'s type and that subclass provides the reflected method\n     for the operation, this method will be called before the left\n     operand\'s non-reflected method.  This behavior allows subclasses\n     to override their ancestors\' operations.\n\nobject.__iadd__(self, other)\nobject.__isub__(self, other)\nobject.__imul__(self, other)\nobject.__itruediv__(self, other)\nobject.__ifloordiv__(self, other)\nobject.__imod__(self, other)\nobject.__ipow__(self, other[, modulo])\nobject.__ilshift__(self, other)\nobject.__irshift__(self, other)\nobject.__iand__(self, other)\nobject.__ixor__(self, other)\nobject.__ior__(self, other)\n\n   These methods are called to implement the augmented arithmetic\n   assignments ("+=", "-=", "*=", "/=", "//=", "%=", "**=", "<<=",\n   ">>=", "&=", "^=", "|=").  These methods should attempt to do the\n   operation in-place (modifying *self*) and return the result (which\n   could be, but does not have to be, *self*).  If a specific method\n   is not defined, the augmented assignment falls back to the normal\n   methods.  For instance, if *x* is an instance of a class with an\n   "__iadd__()" method, "x += y" is equivalent to "x = x.__iadd__(y)"\n   . Otherwise, "x.__add__(y)" and "y.__radd__(x)" are considered, as\n   with the evaluation of "x + y". In certain situations, augmented\n   assignment can result in unexpected errors (see *Why does\n   a_tuple[i] += [\'item\'] raise an exception when the addition\n   works?*), but this behavior is in fact part of the data model.\n\nobject.__neg__(self)\nobject.__pos__(self)\nobject.__abs__(self)\nobject.__invert__(self)\n\n   Called to implement the unary arithmetic operations ("-", "+",\n   "abs()" and "~").\n\nobject.__complex__(self)\nobject.__int__(self)\nobject.__float__(self)\nobject.__round__(self[, n])\n\n   Called to implement the built-in functions "complex()", "int()",\n   "float()" and "round()".  Should return a value of the appropriate\n   type.\n\nobject.__index__(self)\n\n   Called to implement "operator.index()", and whenever Python needs\n   to losslessly convert the numeric object to an integer object (such\n   as in slicing, or in the built-in "bin()", "hex()" and "oct()"\n   functions). Presence of this method indicates that the numeric\n   object is an integer type.  Must return an integer.\n\n   Note: In order to have a coherent integer type class, when\n     "__index__()" is defined "__int__()" should also be defined, and\n     both should return the same value.\n\n\nWith Statement Context Managers\n===============================\n\nA *context manager* is an object that defines the runtime context to\nbe established when executing a "with" statement. The context manager\nhandles the entry into, and the exit from, the desired runtime context\nfor the execution of the block of code.  Context managers are normally\ninvoked using the "with" statement (described in section *The with\nstatement*), but can also be used by directly invoking their methods.\n\nTypical uses of context managers include saving and restoring various\nkinds of global state, locking and unlocking resources, closing opened\nfiles, etc.\n\nFor more information on context managers, see *Context Manager Types*.\n\nobject.__enter__(self)\n\n   Enter the runtime context related to this object. The "with"\n   statement will bind this method\'s return value to the target(s)\n   specified in the "as" clause of the statement, if any.\n\nobject.__exit__(self, exc_type, exc_value, traceback)\n\n   Exit the runtime context related to this object. The parameters\n   describe the exception that caused the context to be exited. If the\n   context was exited without an exception, all three arguments will\n   be "None".\n\n   If an exception is supplied, and the method wishes to suppress the\n   exception (i.e., prevent it from being propagated), it should\n   return a true value. Otherwise, the exception will be processed\n   normally upon exit from this method.\n\n   Note that "__exit__()" methods should not reraise the passed-in\n   exception; this is the caller\'s responsibility.\n\nSee also: **PEP 0343** - The "with" statement\n\n     The specification, background, and examples for the Python "with"\n     statement.\n\n\nSpecial method lookup\n=====================\n\nFor custom classes, implicit invocations of special methods are only\nguaranteed to work correctly if defined on an object\'s type, not in\nthe object\'s instance dictionary.  That behaviour is the reason why\nthe following code raises an exception:\n\n   >>> class C:\n   ...     pass\n   ...\n   >>> c = C()\n   >>> c.__len__ = lambda: 5\n   >>> len(c)\n   Traceback (most recent call last):\n     File "<stdin>", line 1, in <module>\n   TypeError: object of type \'C\' has no len()\n\nThe rationale behind this behaviour lies with a number of special\nmethods such as "__hash__()" and "__repr__()" that are implemented by\nall objects, including type objects. If the implicit lookup of these\nmethods used the conventional lookup process, they would fail when\ninvoked on the type object itself:\n\n   >>> 1 .__hash__() == hash(1)\n   True\n   >>> int.__hash__() == hash(int)\n   Traceback (most recent call last):\n     File "<stdin>", line 1, in <module>\n   TypeError: descriptor \'__hash__\' of \'int\' object needs an argument\n\nIncorrectly attempting to invoke an unbound method of a class in this\nway is sometimes referred to as \'metaclass confusion\', and is avoided\nby bypassing the instance when looking up special methods:\n\n   >>> type(1).__hash__(1) == hash(1)\n   True\n   >>> type(int).__hash__(int) == hash(int)\n   True\n\nIn addition to bypassing any instance attributes in the interest of\ncorrectness, implicit special method lookup generally also bypasses\nthe "__getattribute__()" method even of the object\'s metaclass:\n\n   >>> class Meta(type):\n   ...    def __getattribute__(*args):\n   ...       print("Metaclass getattribute invoked")\n   ...       return type.__getattribute__(*args)\n   ...\n   >>> class C(object, metaclass=Meta):\n   ...     def __len__(self):\n   ...         return 10\n   ...     def __getattribute__(*args):\n   ...         print("Class getattribute invoked")\n   ...         return object.__getattribute__(*args)\n   ...\n   >>> c = C()\n   >>> c.__len__()                 # Explicit lookup via instance\n   Class getattribute invoked\n   10\n   >>> type(c).__len__(c)          # Explicit lookup via type\n   Metaclass getattribute invoked\n   10\n   >>> len(c)                      # Implicit lookup\n   10\n\nBypassing the "__getattribute__()" machinery in this fashion provides\nsignificant scope for speed optimisations within the interpreter, at\nthe cost of some flexibility in the handling of special methods (the\nspecial method *must* be set on the class object itself in order to be\nconsistently invoked by the interpreter).\n\n-[ Footnotes ]-\n\n[1] It *is* possible in some cases to change an object\'s type,\n    under certain controlled conditions. It generally isn\'t a good\n    idea though, since it can lead to some very strange behaviour if\n    it is handled incorrectly.\n\n[2] For operands of the same type, it is assumed that if the non-\n    reflected method (such as "__add__()") fails the operation is not\n    supported, which is why the reflected method is not called.\n',
+ 'string-methods': '\nString Methods\n**************\n\nStrings implement all of the *common* sequence operations, along with\nthe additional methods described below.\n\nStrings also support two styles of string formatting, one providing a\nlarge degree of flexibility and customization (see "str.format()",\n*Format String Syntax* and *String Formatting*) and the other based on\nC "printf" style formatting that handles a narrower range of types and\nis slightly harder to use correctly, but is often faster for the cases\nit can handle (*printf-style String Formatting*).\n\nThe *Text Processing Services* section of the standard library covers\na number of other modules that provide various text related utilities\n(including regular expression support in the "re" module).\n\nstr.capitalize()\n\n   Return a copy of the string with its first character capitalized\n   and the rest lowercased.\n\nstr.casefold()\n\n   Return a casefolded copy of the string. Casefolded strings may be\n   used for caseless matching.\n\n   Casefolding is similar to lowercasing but more aggressive because\n   it is intended to remove all case distinctions in a string. For\n   example, the German lowercase letter "\'\xc3\x9f\'" is equivalent to ""ss"".\n   Since it is already lowercase, "lower()" would do nothing to "\'\xc3\x9f\'";\n   "casefold()" converts it to ""ss"".\n\n   The casefolding algorithm is described in section 3.13 of the\n   Unicode Standard.\n\n   New in version 3.3.\n\nstr.center(width[, fillchar])\n\n   Return centered in a string of length *width*. Padding is done\n   using the specified *fillchar* (default is an ASCII space). The\n   original string is returned if *width* is less than or equal to\n   "len(s)".\n\nstr.count(sub[, start[, end]])\n\n   Return the number of non-overlapping occurrences of substring *sub*\n   in the range [*start*, *end*].  Optional arguments *start* and\n   *end* are interpreted as in slice notation.\n\nstr.encode(encoding="utf-8", errors="strict")\n\n   Return an encoded version of the string as a bytes object. Default\n   encoding is "\'utf-8\'". *errors* may be given to set a different\n   error handling scheme. The default for *errors* is "\'strict\'",\n   meaning that encoding errors raise a "UnicodeError". Other possible\n   values are "\'ignore\'", "\'replace\'", "\'xmlcharrefreplace\'",\n   "\'backslashreplace\'" and any other name registered via\n   "codecs.register_error()", see section *Codec Base Classes*. For a\n   list of possible encodings, see section *Standard Encodings*.\n\n   Changed in version 3.1: Support for keyword arguments added.\n\nstr.endswith(suffix[, start[, end]])\n\n   Return "True" if the string ends with the specified *suffix*,\n   otherwise return "False".  *suffix* can also be a tuple of suffixes\n   to look for.  With optional *start*, test beginning at that\n   position.  With optional *end*, stop comparing at that position.\n\nstr.expandtabs(tabsize=8)\n\n   Return a copy of the string where all tab characters are replaced\n   by one or more spaces, depending on the current column and the\n   given tab size.  Tab positions occur every *tabsize* characters\n   (default is 8, giving tab positions at columns 0, 8, 16 and so on).\n   To expand the string, the current column is set to zero and the\n   string is examined character by character.  If the character is a\n   tab ("\\t"), one or more space characters are inserted in the result\n   until the current column is equal to the next tab position. (The\n   tab character itself is not copied.)  If the character is a newline\n   ("\\n") or return ("\\r"), it is copied and the current column is\n   reset to zero.  Any other character is copied unchanged and the\n   current column is incremented by one regardless of how the\n   character is represented when printed.\n\n   >>> \'01\\t012\\t0123\\t01234\'.expandtabs()\n   \'01      012     0123    01234\'\n   >>> \'01\\t012\\t0123\\t01234\'.expandtabs(4)\n   \'01  012 0123    01234\'\n\nstr.find(sub[, start[, end]])\n\n   Return the lowest index in the string where substring *sub* is\n   found, such that *sub* is contained in the slice "s[start:end]".\n   Optional arguments *start* and *end* are interpreted as in slice\n   notation.  Return "-1" if *sub* is not found.\n\n   Note: The "find()" method should be used only if you need to know\n     the position of *sub*.  To check if *sub* is a substring or not,\n     use the "in" operator:\n\n        >>> \'Py\' in \'Python\'\n        True\n\nstr.format(*args, **kwargs)\n\n   Perform a string formatting operation.  The string on which this\n   method is called can contain literal text or replacement fields\n   delimited by braces "{}".  Each replacement field contains either\n   the numeric index of a positional argument, or the name of a\n   keyword argument.  Returns a copy of the string where each\n   replacement field is replaced with the string value of the\n   corresponding argument.\n\n   >>> "The sum of 1 + 2 is {0}".format(1+2)\n   \'The sum of 1 + 2 is 3\'\n\n   See *Format String Syntax* for a description of the various\n   formatting options that can be specified in format strings.\n\nstr.format_map(mapping)\n\n   Similar to "str.format(**mapping)", except that "mapping" is used\n   directly and not copied to a "dict".  This is useful if for example\n   "mapping" is a dict subclass:\n\n   >>> class Default(dict):\n   ...     def __missing__(self, key):\n   ...         return key\n   ...\n   >>> \'{name} was born in {country}\'.format_map(Default(name=\'Guido\'))\n   \'Guido was born in country\'\n\n   New in version 3.2.\n\nstr.index(sub[, start[, end]])\n\n   Like "find()", but raise "ValueError" when the substring is not\n   found.\n\nstr.isalnum()\n\n   Return true if all characters in the string are alphanumeric and\n   there is at least one character, false otherwise.  A character "c"\n   is alphanumeric if one of the following returns "True":\n   "c.isalpha()", "c.isdecimal()", "c.isdigit()", or "c.isnumeric()".\n\nstr.isalpha()\n\n   Return true if all characters in the string are alphabetic and\n   there is at least one character, false otherwise.  Alphabetic\n   characters are those characters defined in the Unicode character\n   database as "Letter", i.e., those with general category property\n   being one of "Lm", "Lt", "Lu", "Ll", or "Lo".  Note that this is\n   different from the "Alphabetic" property defined in the Unicode\n   Standard.\n\nstr.isdecimal()\n\n   Return true if all characters in the string are decimal characters\n   and there is at least one character, false otherwise. Decimal\n   characters are those from general category "Nd". This category\n   includes digit characters, and all characters that can be used to\n   form decimal-radix numbers, e.g. U+0660, ARABIC-INDIC DIGIT ZERO.\n\nstr.isdigit()\n\n   Return true if all characters in the string are digits and there is\n   at least one character, false otherwise.  Digits include decimal\n   characters and digits that need special handling, such as the\n   compatibility superscript digits.  Formally, a digit is a character\n   that has the property value Numeric_Type=Digit or\n   Numeric_Type=Decimal.\n\nstr.isidentifier()\n\n   Return true if the string is a valid identifier according to the\n   language definition, section *Identifiers and keywords*.\n\n   Use "keyword.iskeyword()" to test for reserved identifiers such as\n   "def" and "class".\n\nstr.islower()\n\n   Return true if all cased characters [4] in the string are lowercase\n   and there is at least one cased character, false otherwise.\n\nstr.isnumeric()\n\n   Return true if all characters in the string are numeric characters,\n   and there is at least one character, false otherwise. Numeric\n   characters include digit characters, and all characters that have\n   the Unicode numeric value property, e.g. U+2155, VULGAR FRACTION\n   ONE FIFTH.  Formally, numeric characters are those with the\n   property value Numeric_Type=Digit, Numeric_Type=Decimal or\n   Numeric_Type=Numeric.\n\nstr.isprintable()\n\n   Return true if all characters in the string are printable or the\n   string is empty, false otherwise.  Nonprintable characters are\n   those characters defined in the Unicode character database as\n   "Other" or "Separator", excepting the ASCII space (0x20) which is\n   considered printable.  (Note that printable characters in this\n   context are those which should not be escaped when "repr()" is\n   invoked on a string.  It has no bearing on the handling of strings\n   written to "sys.stdout" or "sys.stderr".)\n\nstr.isspace()\n\n   Return true if there are only whitespace characters in the string\n   and there is at least one character, false otherwise.  Whitespace\n   characters  are those characters defined in the Unicode character\n   database as "Other" or "Separator" and those with bidirectional\n   property being one of "WS", "B", or "S".\n\nstr.istitle()\n\n   Return true if the string is a titlecased string and there is at\n   least one character, for example uppercase characters may only\n   follow uncased characters and lowercase characters only cased ones.\n   Return false otherwise.\n\nstr.isupper()\n\n   Return true if all cased characters [4] in the string are uppercase\n   and there is at least one cased character, false otherwise.\n\nstr.join(iterable)\n\n   Return a string which is the concatenation of the strings in the\n   *iterable* *iterable*.  A "TypeError" will be raised if there are\n   any non-string values in *iterable*, including "bytes" objects.\n   The separator between elements is the string providing this method.\n\nstr.ljust(width[, fillchar])\n\n   Return the string left justified in a string of length *width*.\n   Padding is done using the specified *fillchar* (default is an ASCII\n   space). The original string is returned if *width* is less than or\n   equal to "len(s)".\n\nstr.lower()\n\n   Return a copy of the string with all the cased characters [4]\n   converted to lowercase.\n\n   The lowercasing algorithm used is described in section 3.13 of the\n   Unicode Standard.\n\nstr.lstrip([chars])\n\n   Return a copy of the string with leading characters removed.  The\n   *chars* argument is a string specifying the set of characters to be\n   removed.  If omitted or "None", the *chars* argument defaults to\n   removing whitespace.  The *chars* argument is not a prefix; rather,\n   all combinations of its values are stripped:\n\n      >>> \'   spacious   \'.lstrip()\n      \'spacious   \'\n      >>> \'www.example.com\'.lstrip(\'cmowz.\')\n      \'example.com\'\n\nstatic str.maketrans(x[, y[, z]])\n\n   This static method returns a translation table usable for\n   "str.translate()".\n\n   If there is only one argument, it must be a dictionary mapping\n   Unicode ordinals (integers) or characters (strings of length 1) to\n   Unicode ordinals, strings (of arbitrary lengths) or None.\n   Character keys will then be converted to ordinals.\n\n   If there are two arguments, they must be strings of equal length,\n   and in the resulting dictionary, each character in x will be mapped\n   to the character at the same position in y.  If there is a third\n   argument, it must be a string, whose characters will be mapped to\n   None in the result.\n\nstr.partition(sep)\n\n   Split the string at the first occurrence of *sep*, and return a\n   3-tuple containing the part before the separator, the separator\n   itself, and the part after the separator.  If the separator is not\n   found, return a 3-tuple containing the string itself, followed by\n   two empty strings.\n\nstr.replace(old, new[, count])\n\n   Return a copy of the string with all occurrences of substring *old*\n   replaced by *new*.  If the optional argument *count* is given, only\n   the first *count* occurrences are replaced.\n\nstr.rfind(sub[, start[, end]])\n\n   Return the highest index in the string where substring *sub* is\n   found, such that *sub* is contained within "s[start:end]".\n   Optional arguments *start* and *end* are interpreted as in slice\n   notation.  Return "-1" on failure.\n\nstr.rindex(sub[, start[, end]])\n\n   Like "rfind()" but raises "ValueError" when the substring *sub* is\n   not found.\n\nstr.rjust(width[, fillchar])\n\n   Return the string right justified in a string of length *width*.\n   Padding is done using the specified *fillchar* (default is an ASCII\n   space). The original string is returned if *width* is less than or\n   equal to "len(s)".\n\nstr.rpartition(sep)\n\n   Split the string at the last occurrence of *sep*, and return a\n   3-tuple containing the part before the separator, the separator\n   itself, and the part after the separator.  If the separator is not\n   found, return a 3-tuple containing two empty strings, followed by\n   the string itself.\n\nstr.rsplit(sep=None, maxsplit=-1)\n\n   Return a list of the words in the string, using *sep* as the\n   delimiter string. If *maxsplit* is given, at most *maxsplit* splits\n   are done, the *rightmost* ones.  If *sep* is not specified or\n   "None", any whitespace string is a separator.  Except for splitting\n   from the right, "rsplit()" behaves like "split()" which is\n   described in detail below.\n\nstr.rstrip([chars])\n\n   Return a copy of the string with trailing characters removed.  The\n   *chars* argument is a string specifying the set of characters to be\n   removed.  If omitted or "None", the *chars* argument defaults to\n   removing whitespace.  The *chars* argument is not a suffix; rather,\n   all combinations of its values are stripped:\n\n      >>> \'   spacious   \'.rstrip()\n      \'   spacious\'\n      >>> \'mississippi\'.rstrip(\'ipz\')\n      \'mississ\'\n\nstr.split(sep=None, maxsplit=-1)\n\n   Return a list of the words in the string, using *sep* as the\n   delimiter string.  If *maxsplit* is given, at most *maxsplit*\n   splits are done (thus, the list will have at most "maxsplit+1"\n   elements).  If *maxsplit* is not specified or "-1", then there is\n   no limit on the number of splits (all possible splits are made).\n\n   If *sep* is given, consecutive delimiters are not grouped together\n   and are deemed to delimit empty strings (for example,\n   "\'1,,2\'.split(\',\')" returns "[\'1\', \'\', \'2\']").  The *sep* argument\n   may consist of multiple characters (for example,\n   "\'1<>2<>3\'.split(\'<>\')" returns "[\'1\', \'2\', \'3\']"). Splitting an\n   empty string with a specified separator returns "[\'\']".\n\n   For example:\n\n      >>> \'1,2,3\'.split(\',\')\n      [\'1\', \'2\', \'3\']\n      >>> \'1,2,3\'.split(\',\', maxsplit=1)\n      [\'1\', \'2 3\']\n      >>> \'1,2,,3,\'.split(\',\')\n      [\'1\', \'2\', \'\', \'3\', \'\']\n\n   If *sep* is not specified or is "None", a different splitting\n   algorithm is applied: runs of consecutive whitespace are regarded\n   as a single separator, and the result will contain no empty strings\n   at the start or end if the string has leading or trailing\n   whitespace.  Consequently, splitting an empty string or a string\n   consisting of just whitespace with a "None" separator returns "[]".\n\n   For example:\n\n      >>> \'1 2 3\'.split()\n      [\'1\', \'2\', \'3\']\n      >>> \'1 2 3\'.split(maxsplit=1)\n      [\'1\', \'2 3\']\n      >>> \'   1   2   3   \'.split()\n      [\'1\', \'2\', \'3\']\n\nstr.splitlines([keepends])\n\n   Return a list of the lines in the string, breaking at line\n   boundaries. This method uses the *universal newlines* approach to\n   splitting lines. Line breaks are not included in the resulting list\n   unless *keepends* is given and true.\n\n   For example:\n\n      >>> \'ab c\\n\\nde fg\\rkl\\r\\n\'.splitlines()\n      [\'ab c\', \'\', \'de fg\', \'kl\']``\n      >>> \'ab c\\n\\nde fg\\rkl\\r\\n\'.splitlines(keepends=True)\n      [\'ab c\\n\', \'\\n\', \'de fg\\r\', \'kl\\r\\n\']\n\n   Unlike "split()" when a delimiter string *sep* is given, this\n   method returns an empty list for the empty string, and a terminal\n   line break does not result in an extra line:\n\n      >>> "".splitlines()\n      []\n      >>> "One line\\n".splitlines()\n      [\'One line\']\n\n   For comparison, "split(\'\\n\')" gives:\n\n      >>> \'\'.split(\'\\n\')\n      [\'\']\n      >>> \'Two lines\\n\'.split(\'\\n\')\n      [\'Two lines\', \'\']\n\nstr.startswith(prefix[, start[, end]])\n\n   Return "True" if string starts with the *prefix*, otherwise return\n   "False". *prefix* can also be a tuple of prefixes to look for.\n   With optional *start*, test string beginning at that position.\n   With optional *end*, stop comparing string at that position.\n\nstr.strip([chars])\n\n   Return a copy of the string with the leading and trailing\n   characters removed. The *chars* argument is a string specifying the\n   set of characters to be removed. If omitted or "None", the *chars*\n   argument defaults to removing whitespace. The *chars* argument is\n   not a prefix or suffix; rather, all combinations of its values are\n   stripped:\n\n      >>> \'   spacious   \'.strip()\n      \'spacious\'\n      >>> \'www.example.com\'.strip(\'cmowz.\')\n      \'example\'\n\nstr.swapcase()\n\n   Return a copy of the string with uppercase characters converted to\n   lowercase and vice versa. Note that it is not necessarily true that\n   "s.swapcase().swapcase() == s".\n\nstr.title()\n\n   Return a titlecased version of the string where words start with an\n   uppercase character and the remaining characters are lowercase.\n\n   For example:\n\n      >>> \'Hello world\'.title()\n      \'Hello World\'\n\n   The algorithm uses a simple language-independent definition of a\n   word as groups of consecutive letters.  The definition works in\n   many contexts but it means that apostrophes in contractions and\n   possessives form word boundaries, which may not be the desired\n   result:\n\n      >>> "they\'re bill\'s friends from the UK".title()\n      "They\'Re Bill\'S Friends From The Uk"\n\n   A workaround for apostrophes can be constructed using regular\n   expressions:\n\n      >>> import re\n      >>> def titlecase(s):\n      ...     return re.sub(r"[A-Za-z]+(\'[A-Za-z]+)?",\n      ...                   lambda mo: mo.group(0)[0].upper() +\n      ...                              mo.group(0)[1:].lower(),\n      ...                   s)\n      ...\n      >>> titlecase("they\'re bill\'s friends.")\n      "They\'re Bill\'s Friends."\n\nstr.translate(map)\n\n   Return a copy of the *s* where all characters have been mapped\n   through the *map* which must be a dictionary of Unicode ordinals\n   (integers) to Unicode ordinals, strings or "None".  Unmapped\n   characters are left untouched. Characters mapped to "None" are\n   deleted.\n\n   You can use "str.maketrans()" to create a translation map from\n   character-to-character mappings in different formats.\n\n   Note: An even more flexible approach is to create a custom\n     character mapping codec using the "codecs" module (see\n     "encodings.cp1251" for an example).\n\nstr.upper()\n\n   Return a copy of the string with all the cased characters [4]\n   converted to uppercase.  Note that "str.upper().isupper()" might be\n   "False" if "s" contains uncased characters or if the Unicode\n   category of the resulting character(s) is not "Lu" (Letter,\n   uppercase), but e.g. "Lt" (Letter, titlecase).\n\n   The uppercasing algorithm used is described in section 3.13 of the\n   Unicode Standard.\n\nstr.zfill(width)\n\n   Return a copy of the string left filled with ASCII "\'0\'" digits to\n   make a string of length *width*. A leading sign prefix ("\'+\'"/"\'-\'"\n   is handled by inserting the padding *after* the sign character\n   rather than before. The original string is returned if *width* is\n   less than or equal to "len(s)".\n\n   For example:\n\n      >>> "42".zfill(5)\n      \'00042\'\n      >>> "-42".zfill(5)\n      \'-0042\'\n',
+ 'strings': '\nString and Bytes literals\n*************************\n\nString literals are described by the following lexical definitions:\n\n   stringliteral   ::= [stringprefix](shortstring | longstring)\n   stringprefix    ::= "r" | "u" | "R" | "U"\n   shortstring     ::= "\'" shortstringitem* "\'" | \'"\' shortstringitem* \'"\'\n   longstring      ::= "\'\'\'" longstringitem* "\'\'\'" | \'"""\' longstringitem* \'"""\'\n   shortstringitem ::= shortstringchar | stringescapeseq\n   longstringitem  ::= longstringchar | stringescapeseq\n   shortstringchar ::= <any source character except "\\" or newline or the quote>\n   longstringchar  ::= <any source character except "\\">\n   stringescapeseq ::= "\\" <any source character>\n\n   bytesliteral   ::= bytesprefix(shortbytes | longbytes)\n   bytesprefix    ::= "b" | "B" | "br" | "Br" | "bR" | "BR" | "rb" | "rB" | "Rb" | "RB"\n   shortbytes     ::= "\'" shortbytesitem* "\'" | \'"\' shortbytesitem* \'"\'\n   longbytes      ::= "\'\'\'" longbytesitem* "\'\'\'" | \'"""\' longbytesitem* \'"""\'\n   shortbytesitem ::= shortbyteschar | bytesescapeseq\n   longbytesitem  ::= longbyteschar | bytesescapeseq\n   shortbyteschar ::= <any ASCII character except "\\" or newline or the quote>\n   longbyteschar  ::= <any ASCII character except "\\">\n   bytesescapeseq ::= "\\" <any ASCII character>\n\nOne syntactic restriction not indicated by these productions is that\nwhitespace is not allowed between the "stringprefix" or "bytesprefix"\nand the rest of the literal. The source character set is defined by\nthe encoding declaration; it is UTF-8 if no encoding declaration is\ngiven in the source file; see section *Encoding declarations*.\n\nIn plain English: Both types of literals can be enclosed in matching\nsingle quotes ("\'") or double quotes (""").  They can also be enclosed\nin matching groups of three single or double quotes (these are\ngenerally referred to as *triple-quoted strings*).  The backslash\n("\\") character is used to escape characters that otherwise have a\nspecial meaning, such as newline, backslash itself, or the quote\ncharacter.\n\nBytes literals are always prefixed with "\'b\'" or "\'B\'"; they produce\nan instance of the "bytes" type instead of the "str" type.  They may\nonly contain ASCII characters; bytes with a numeric value of 128 or\ngreater must be expressed with escapes.\n\nAs of Python 3.3 it is possible again to prefix unicode strings with a\n"u" prefix to simplify maintenance of dual 2.x and 3.x codebases.\n\nBoth string and bytes literals may optionally be prefixed with a\nletter "\'r\'" or "\'R\'"; such strings are called *raw strings* and treat\nbackslashes as literal characters.  As a result, in string literals,\n"\'\\U\'" and "\'\\u\'" escapes in raw strings are not treated specially.\nGiven that Python 2.x\'s raw unicode literals behave differently than\nPython 3.x\'s the "\'ur\'" syntax is not supported.\n\n   New in version 3.3: The "\'rb\'" prefix of raw bytes literals has\n   been added as a synonym of "\'br\'".\n\n   New in version 3.3: Support for the unicode legacy literal\n   ("u\'value\'") was reintroduced to simplify the maintenance of dual\n   Python 2.x and 3.x codebases. See **PEP 414** for more information.\n\nIn triple-quoted strings, unescaped newlines and quotes are allowed\n(and are retained), except that three unescaped quotes in a row\nterminate the string.  (A "quote" is the character used to open the\nstring, i.e. either "\'" or """.)\n\nUnless an "\'r\'" or "\'R\'" prefix is present, escape sequences in\nstrings are interpreted according to rules similar to those used by\nStandard C.  The recognized escape sequences are:\n\n+-------------------+-----------------------------------+---------+\n| Escape Sequence   | Meaning                           | Notes   |\n+===================+===================================+=========+\n| "\\newline"        | Backslash and newline ignored     |         |\n+-------------------+-----------------------------------+---------+\n| "\\\\"              | Backslash ("\\")                   |         |\n+-------------------+-----------------------------------+---------+\n| "\\\'"              | Single quote ("\'")                |         |\n+-------------------+-----------------------------------+---------+\n| "\\""              | Double quote (""")                |         |\n+-------------------+-----------------------------------+---------+\n| "\\a"              | ASCII Bell (BEL)                  |         |\n+-------------------+-----------------------------------+---------+\n| "\\b"              | ASCII Backspace (BS)              |         |\n+-------------------+-----------------------------------+---------+\n| "\\f"              | ASCII Formfeed (FF)               |         |\n+-------------------+-----------------------------------+---------+\n| "\\n"              | ASCII Linefeed (LF)               |         |\n+-------------------+-----------------------------------+---------+\n| "\\r"              | ASCII Carriage Return (CR)        |         |\n+-------------------+-----------------------------------+---------+\n| "\\t"              | ASCII Horizontal Tab (TAB)        |         |\n+-------------------+-----------------------------------+---------+\n| "\\v"              | ASCII Vertical Tab (VT)           |         |\n+-------------------+-----------------------------------+---------+\n| "\\ooo"            | Character with octal value *ooo*  | (1,3)   |\n+-------------------+-----------------------------------+---------+\n| "\\xhh"            | Character with hex value *hh*     | (2,3)   |\n+-------------------+-----------------------------------+---------+\n\nEscape sequences only recognized in string literals are:\n\n+-------------------+-----------------------------------+---------+\n| Escape Sequence   | Meaning                           | Notes   |\n+===================+===================================+=========+\n| "\\N{name}"        | Character named *name* in the     | (4)     |\n|                   | Unicode database                  |         |\n+-------------------+-----------------------------------+---------+\n| "\\uxxxx"          | Character with 16-bit hex value   | (5)     |\n|                   | *xxxx*                            |         |\n+-------------------+-----------------------------------+---------+\n| "\\Uxxxxxxxx"      | Character with 32-bit hex value   | (6)     |\n|                   | *xxxxxxxx*                        |         |\n+-------------------+-----------------------------------+---------+\n\nNotes:\n\n1. As in Standard C, up to three octal digits are accepted.\n\n2. Unlike in Standard C, exactly two hex digits are required.\n\n3. In a bytes literal, hexadecimal and octal escapes denote the\n   byte with the given value. In a string literal, these escapes\n   denote a Unicode character with the given value.\n\n4. Changed in version 3.3: Support for name aliases [1] has been\n   added.\n\n5. Individual code units which form parts of a surrogate pair can\n   be encoded using this escape sequence.  Exactly four hex digits are\n   required.\n\n6. Any Unicode character can be encoded this way.  Exactly eight\n   hex digits are required.\n\nUnlike Standard C, all unrecognized escape sequences are left in the\nstring unchanged, i.e., *the backslash is left in the string*.  (This\nbehavior is useful when debugging: if an escape sequence is mistyped,\nthe resulting output is more easily recognized as broken.)  It is also\nimportant to note that the escape sequences only recognized in string\nliterals fall into the category of unrecognized escapes for bytes\nliterals.\n\nEven in a raw string, string quotes can be escaped with a backslash,\nbut the backslash remains in the string; for example, "r"\\""" is a\nvalid string literal consisting of two characters: a backslash and a\ndouble quote; "r"\\"" is not a valid string literal (even a raw string\ncannot end in an odd number of backslashes).  Specifically, *a raw\nstring cannot end in a single backslash* (since the backslash would\nescape the following quote character).  Note also that a single\nbackslash followed by a newline is interpreted as those two characters\nas part of the string, *not* as a line continuation.\n',
+ 'subscriptions': '\nSubscriptions\n*************\n\nA subscription selects an item of a sequence (string, tuple or list)\nor mapping (dictionary) object:\n\n   subscription ::= primary "[" expression_list "]"\n\nThe primary must evaluate to an object that supports subscription\n(lists or dictionaries for example).  User-defined objects can support\nsubscription by defining a "__getitem__()" method.\n\nFor built-in objects, there are two types of objects that support\nsubscription:\n\nIf the primary is a mapping, the expression list must evaluate to an\nobject whose value is one of the keys of the mapping, and the\nsubscription selects the value in the mapping that corresponds to that\nkey.  (The expression list is a tuple except if it has exactly one\nitem.)\n\nIf the primary is a sequence, the expression (list) must evaluate to\nan integer or a slice (as discussed in the following section).\n\nThe formal syntax makes no special provision for negative indices in\nsequences; however, built-in sequences all provide a "__getitem__()"\nmethod that interprets negative indices by adding the length of the\nsequence to the index (so that "x[-1]" selects the last item of "x").\nThe resulting value must be a nonnegative integer less than the number\nof items in the sequence, and the subscription selects the item whose\nindex is that value (counting from zero). Since the support for\nnegative indices and slicing occurs in the object\'s "__getitem__()"\nmethod, subclasses overriding this method will need to explicitly add\nthat support.\n\nA string\'s items are characters.  A character is not a separate data\ntype but a string of exactly one character.\n',
  'truth': '\nTruth Value Testing\n*******************\n\nAny object can be tested for truth value, for use in an "if" or\n"while" condition or as operand of the Boolean operations below. The\nfollowing values are considered false:\n\n* "None"\n\n* "False"\n\n* zero of any numeric type, for example, "0", "0.0", "0j".\n\n* any empty sequence, for example, "\'\'", "()", "[]".\n\n* any empty mapping, for example, "{}".\n\n* instances of user-defined classes, if the class defines a\n  "__bool__()" or "__len__()" method, when that method returns the\n  integer zero or "bool" value "False". [1]\n\nAll other values are considered true --- so objects of many types are\nalways true.\n\nOperations and built-in functions that have a Boolean result always\nreturn "0" or "False" for false and "1" or "True" for true, unless\notherwise stated. (Important exception: the Boolean operations "or"\nand "and" always return one of their operands.)\n',
- 'try': '\nThe "try" statement\n*******************\n\nThe "try" statement specifies exception handlers and/or cleanup code\nfor a group of statements:\n\n   try_stmt  ::= try1_stmt | try2_stmt\n   try1_stmt ::= "try" ":" suite\n                 ("except" [expression ["as" target]] ":" suite)+\n                 ["else" ":" suite]\n                 ["finally" ":" suite]\n   try2_stmt ::= "try" ":" suite\n                 "finally" ":" suite\n\nThe "except" clause(s) specify one or more exception handlers. When no\nexception occurs in the "try" clause, no exception handler is\nexecuted. When an exception occurs in the "try" suite, a search for an\nexception handler is started.  This search inspects the except clauses\nin turn until one is found that matches the exception.  An expression-\nless except clause, if present, must be last; it matches any\nexception.  For an except clause with an expression, that expression\nis evaluated, and the clause matches the exception if the resulting\nobject is "compatible" with the exception.  An object is compatible\nwith an exception if it is the class or a base class of the exception\nobject or a tuple containing an item compatible with the exception.\n\nIf no except clause matches the exception, the search for an exception\nhandler continues in the surrounding code and on the invocation stack.\n[1]\n\nIf the evaluation of an expression in the header of an except clause\nraises an exception, the original search for a handler is canceled and\na search starts for the new exception in the surrounding code and on\nthe call stack (it is treated as if the entire "try" statement raised\nthe exception).\n\nWhen a matching except clause is found, the exception is assigned to\nthe target specified after the "as" keyword in that except clause, if\npresent, and the except clause\'s suite is executed.  All except\nclauses must have an executable block.  When the end of this block is\nreached, execution continues normally after the entire try statement.\n(This means that if two nested handlers exist for the same exception,\nand the exception occurs in the try clause of the inner handler, the\nouter handler will not handle the exception.)\n\nWhen an exception has been assigned using "as target", it is cleared\nat the end of the except clause.  This is as if\n\n   except E as N:\n       foo\n\nwas translated to\n\n   except E as N:\n       try:\n           foo\n       finally:\n           del N\n\nThis means the exception must be assigned to a different name to be\nable to refer to it after the except clause.  Exceptions are cleared\nbecause with the traceback attached to them, they form a reference\ncycle with the stack frame, keeping all locals in that frame alive\nuntil the next garbage collection occurs.\n\nBefore an except clause\'s suite is executed, details about the\nexception are stored in the "sys" module and can be access via\n"sys.exc_info()". "sys.exc_info()" returns a 3-tuple consisting of the\nexception class, the exception instance and a traceback object (see\nsection *The standard type hierarchy*) identifying the point in the\nprogram where the exception occurred.  "sys.exc_info()" values are\nrestored to their previous values (before the call) when returning\nfrom a function that handled an exception.\n\nThe optional "else" clause is executed if and when control flows off\nthe end of the "try" clause. [2] Exceptions in the "else" clause are\nnot handled by the preceding "except" clauses.\n\nIf "finally" is present, it specifies a \'cleanup\' handler.  The "try"\nclause is executed, including any "except" and "else" clauses.  If an\nexception occurs in any of the clauses and is not handled, the\nexception is temporarily saved. The "finally" clause is executed.  If\nthere is a saved exception it is re-raised at the end of the "finally"\nclause.  If the "finally" clause raises another exception, the saved\nexception is set as the context of the new exception. If the "finally"\nclause executes a "return" or "break" statement, the saved exception\nis discarded:\n\n   def f():\n       try:\n           1/0\n       finally:\n           return 42\n\n   >>> f()\n   42\n\nThe exception information is not available to the program during\nexecution of the "finally" clause.\n\nWhen a "return", "break" or "continue" statement is executed in the\n"try" suite of a "try"..."finally" statement, the "finally" clause is\nalso executed \'on the way out.\' A "continue" statement is illegal in\nthe "finally" clause. (The reason is a problem with the current\nimplementation --- this restriction may be lifted in the future).\n\nAdditional information on exceptions can be found in section\n*Exceptions*, and information on using the "raise" statement to\ngenerate exceptions may be found in section *The raise statement*.\n',
- 'types': '\nThe standard type hierarchy\n***************************\n\nBelow is a list of the types that are built into Python.  Extension\nmodules (written in C, Java, or other languages, depending on the\nimplementation) can define additional types.  Future versions of\nPython may add types to the type hierarchy (e.g., rational numbers,\nefficiently stored arrays of integers, etc.), although such additions\nwill often be provided via the standard library instead.\n\nSome of the type descriptions below contain a paragraph listing\n\'special attributes.\'  These are attributes that provide access to the\nimplementation and are not intended for general use.  Their definition\nmay change in the future.\n\nNone\n   This type has a single value.  There is a single object with this\n   value. This object is accessed through the built-in name "None". It\n   is used to signify the absence of a value in many situations, e.g.,\n   it is returned from functions that don\'t explicitly return\n   anything. Its truth value is false.\n\nNotImplemented\n   This type has a single value.  There is a single object with this\n   value. This object is accessed through the built-in name\n   "NotImplemented". Numeric methods and rich comparison methods may\n   return this value if they do not implement the operation for the\n   operands provided.  (The interpreter will then try the reflected\n   operation, or some other fallback, depending on the operator.)  Its\n   truth value is true.\n\nEllipsis\n   This type has a single value.  There is a single object with this\n   value. This object is accessed through the literal "..." or the\n   built-in name "Ellipsis".  Its truth value is true.\n\n"numbers.Number"\n   These are created by numeric literals and returned as results by\n   arithmetic operators and arithmetic built-in functions.  Numeric\n   objects are immutable; once created their value never changes.\n   Python numbers are of course strongly related to mathematical\n   numbers, but subject to the limitations of numerical representation\n   in computers.\n\n   Python distinguishes between integers, floating point numbers, and\n   complex numbers:\n\n   "numbers.Integral"\n      These represent elements from the mathematical set of integers\n      (positive and negative).\n\n      There are two types of integers:\n\n      Integers ("int")\n\n         These represent numbers in an unlimited range, subject to\n         available (virtual) memory only.  For the purpose of shift\n         and mask operations, a binary representation is assumed, and\n         negative numbers are represented in a variant of 2\'s\n         complement which gives the illusion of an infinite string of\n         sign bits extending to the left.\n\n      Booleans ("bool")\n         These represent the truth values False and True.  The two\n         objects representing the values "False" and "True" are the\n         only Boolean objects. The Boolean type is a subtype of the\n         integer type, and Boolean values behave like the values 0 and\n         1, respectively, in almost all contexts, the exception being\n         that when converted to a string, the strings ""False"" or\n         ""True"" are returned, respectively.\n\n      The rules for integer representation are intended to give the\n      most meaningful interpretation of shift and mask operations\n      involving negative integers.\n\n   "numbers.Real" ("float")\n      These represent machine-level double precision floating point\n      numbers. You are at the mercy of the underlying machine\n      architecture (and C or Java implementation) for the accepted\n      range and handling of overflow. Python does not support single-\n      precision floating point numbers; the savings in processor and\n      memory usage that are usually the reason for using these is\n      dwarfed by the overhead of using objects in Python, so there is\n      no reason to complicate the language with two kinds of floating\n      point numbers.\n\n   "numbers.Complex" ("complex")\n      These represent complex numbers as a pair of machine-level\n      double precision floating point numbers.  The same caveats apply\n      as for floating point numbers. The real and imaginary parts of a\n      complex number "z" can be retrieved through the read-only\n      attributes "z.real" and "z.imag".\n\nSequences\n   These represent finite ordered sets indexed by non-negative\n   numbers. The built-in function "len()" returns the number of items\n   of a sequence. When the length of a sequence is *n*, the index set\n   contains the numbers 0, 1, ..., *n*-1.  Item *i* of sequence *a* is\n   selected by "a[i]".\n\n   Sequences also support slicing: "a[i:j]" selects all items with\n   index *k* such that *i* "<=" *k* "<" *j*.  When used as an\n   expression, a slice is a sequence of the same type.  This implies\n   that the index set is renumbered so that it starts at 0.\n\n   Some sequences also support "extended slicing" with a third "step"\n   parameter: "a[i:j:k]" selects all items of *a* with index *x* where\n   "x = i + n*k", *n* ">=" "0" and *i* "<=" *x* "<" *j*.\n\n   Sequences are distinguished according to their mutability:\n\n   Immutable sequences\n      An object of an immutable sequence type cannot change once it is\n      created.  (If the object contains references to other objects,\n      these other objects may be mutable and may be changed; however,\n      the collection of objects directly referenced by an immutable\n      object cannot change.)\n\n      The following types are immutable sequences:\n\n      Strings\n         A string is a sequence of values that represent Unicode\n         codepoints. All the codepoints in range "U+0000 - U+10FFFF"\n         can be represented in a string.  Python doesn\'t have a "chr"\n         type, and every character in the string is represented as a\n         string object with length "1".  The built-in function "ord()"\n         converts a character to its codepoint (as an integer);\n         "chr()" converts an integer in range "0 - 10FFFF" to the\n         corresponding character. "str.encode()" can be used to\n         convert a "str" to "bytes" using the given encoding, and\n         "bytes.decode()" can be used to achieve the opposite.\n\n      Tuples\n         The items of a tuple are arbitrary Python objects. Tuples of\n         two or more items are formed by comma-separated lists of\n         expressions.  A tuple of one item (a \'singleton\') can be\n         formed by affixing a comma to an expression (an expression by\n         itself does not create a tuple, since parentheses must be\n         usable for grouping of expressions).  An empty tuple can be\n         formed by an empty pair of parentheses.\n\n      Bytes\n         A bytes object is an immutable array.  The items are 8-bit\n         bytes, represented by integers in the range 0 <= x < 256.\n         Bytes literals (like "b\'abc\'") and the built-in function\n         "bytes()" can be used to construct bytes objects.  Also,\n         bytes objects can be decoded to strings via the "decode()"\n         method.\n\n   Mutable sequences\n      Mutable sequences can be changed after they are created.  The\n      subscription and slicing notations can be used as the target of\n      assignment and "del" (delete) statements.\n\n      There are currently two intrinsic mutable sequence types:\n\n      Lists\n         The items of a list are arbitrary Python objects.  Lists are\n         formed by placing a comma-separated list of expressions in\n         square brackets. (Note that there are no special cases needed\n         to form lists of length 0 or 1.)\n\n      Byte Arrays\n         A bytearray object is a mutable array. They are created by\n         the built-in "bytearray()" constructor.  Aside from being\n         mutable (and hence unhashable), byte arrays otherwise provide\n         the same interface and functionality as immutable bytes\n         objects.\n\n      The extension module "array" provides an additional example of a\n      mutable sequence type, as does the "collections" module.\n\nSet types\n   These represent unordered, finite sets of unique, immutable\n   objects. As such, they cannot be indexed by any subscript. However,\n   they can be iterated over, and the built-in function "len()"\n   returns the number of items in a set. Common uses for sets are fast\n   membership testing, removing duplicates from a sequence, and\n   computing mathematical operations such as intersection, union,\n   difference, and symmetric difference.\n\n   For set elements, the same immutability rules apply as for\n   dictionary keys. Note that numeric types obey the normal rules for\n   numeric comparison: if two numbers compare equal (e.g., "1" and\n   "1.0"), only one of them can be contained in a set.\n\n   There are currently two intrinsic set types:\n\n   Sets\n      These represent a mutable set. They are created by the built-in\n      "set()" constructor and can be modified afterwards by several\n      methods, such as "add()".\n\n   Frozen sets\n      These represent an immutable set.  They are created by the\n      built-in "frozenset()" constructor.  As a frozenset is immutable\n      and *hashable*, it can be used again as an element of another\n      set, or as a dictionary key.\n\nMappings\n   These represent finite sets of objects indexed by arbitrary index\n   sets. The subscript notation "a[k]" selects the item indexed by "k"\n   from the mapping "a"; this can be used in expressions and as the\n   target of assignments or "del" statements. The built-in function\n   "len()" returns the number of items in a mapping.\n\n   There is currently a single intrinsic mapping type:\n\n   Dictionaries\n      These represent finite sets of objects indexed by nearly\n      arbitrary values.  The only types of values not acceptable as\n      keys are values containing lists or dictionaries or other\n      mutable types that are compared by value rather than by object\n      identity, the reason being that the efficient implementation of\n      dictionaries requires a key\'s hash value to remain constant.\n      Numeric types used for keys obey the normal rules for numeric\n      comparison: if two numbers compare equal (e.g., "1" and "1.0")\n      then they can be used interchangeably to index the same\n      dictionary entry.\n\n      Dictionaries are mutable; they can be created by the "{...}"\n      notation (see section *Dictionary displays*).\n\n      The extension modules "dbm.ndbm" and "dbm.gnu" provide\n      additional examples of mapping types, as does the "collections"\n      module.\n\nCallable types\n   These are the types to which the function call operation (see\n   section *Calls*) can be applied:\n\n   User-defined functions\n      A user-defined function object is created by a function\n      definition (see section *Function definitions*).  It should be\n      called with an argument list containing the same number of items\n      as the function\'s formal parameter list.\n\n      Special attributes:\n\n      +---------------------------+---------------------------------+-------------+\n      +===========================+=================================+=============+\n      | "__doc__"                 | The function\'s documentation    | Writable    |\n      +---------------------------+---------------------------------+-------------+\n      | "__name__"                | The function\'s name             | Writable    |\n      +---------------------------+---------------------------------+-------------+\n      | "__qualname__"            | The function\'s *qualified name* | Writable    |\n      +---------------------------+---------------------------------+-------------+\n      | "__module__"              | The name of the module the      | Writable    |\n      +---------------------------+---------------------------------+-------------+\n      | "__defaults__"            | A tuple containing default      | Writable    |\n      +---------------------------+---------------------------------+-------------+\n      | "__code__"                | The code object representing    | Writable    |\n      +---------------------------+---------------------------------+-------------+\n      | "__globals__"             | A reference to the dictionary   | Read-only   |\n      +---------------------------+---------------------------------+-------------+\n      | "__dict__"                | The namespace supporting        | Writable    |\n      +---------------------------+---------------------------------+-------------+\n      | "__closure__"             | "None" or a tuple of cells that | Read-only   |\n      +---------------------------+---------------------------------+-------------+\n      | "__annotations__"         | A dict containing annotations   | Writable    |\n      +---------------------------+---------------------------------+-------------+\n      | "__kwdefaults__"          | A dict containing defaults for  | Writable    |\n      +---------------------------+---------------------------------+-------------+\n\n      Most of the attributes labelled "Writable" check the type of the\n      assigned value.\n\n      Function objects also support getting and setting arbitrary\n      attributes, which can be used, for example, to attach metadata\n      to functions.  Regular attribute dot-notation is used to get and\n      set such attributes. *Note that the current implementation only\n      supports function attributes on user-defined functions. Function\n      attributes on built-in functions may be supported in the\n      future.*\n\n      Additional information about a function\'s definition can be\n      retrieved from its code object; see the description of internal\n      types below.\n\n   Instance methods\n      An instance method object combines a class, a class instance and\n      any callable object (normally a user-defined function).\n\n      Special read-only attributes: "__self__" is the class instance\n      object, "__func__" is the function object; "__doc__" is the\n      method\'s documentation (same as "__func__.__doc__"); "__name__"\n      is the method name (same as "__func__.__name__"); "__module__"\n      is the name of the module the method was defined in, or "None"\n      if unavailable.\n\n      Methods also support accessing (but not setting) the arbitrary\n      function attributes on the underlying function object.\n\n      User-defined method objects may be created when getting an\n      attribute of a class (perhaps via an instance of that class), if\n      that attribute is a user-defined function object or a class\n      method object.\n\n      When an instance method object is created by retrieving a user-\n      defined function object from a class via one of its instances,\n      its "__self__" attribute is the instance, and the method object\n      is said to be bound.  The new method\'s "__func__" attribute is\n      the original function object.\n\n      When a user-defined method object is created by retrieving\n      another method object from a class or instance, the behaviour is\n      the same as for a function object, except that the "__func__"\n      attribute of the new instance is not the original method object\n      but its "__func__" attribute.\n\n      When an instance method object is created by retrieving a class\n      method object from a class or instance, its "__self__" attribute\n      is the class itself, and its "__func__" attribute is the\n      function object underlying the class method.\n\n      When an instance method object is called, the underlying\n      function ("__func__") is called, inserting the class instance\n      ("__self__") in front of the argument list.  For instance, when\n      "C" is a class which contains a definition for a function "f()",\n      and "x" is an instance of "C", calling "x.f(1)" is equivalent to\n      calling "C.f(x, 1)".\n\n      When an instance method object is derived from a class method\n      object, the "class instance" stored in "__self__" will actually\n      be the class itself, so that calling either "x.f(1)" or "C.f(1)"\n      is equivalent to calling "f(C,1)" where "f" is the underlying\n      function.\n\n      Note that the transformation from function object to instance\n      method object happens each time the attribute is retrieved from\n      the instance.  In some cases, a fruitful optimization is to\n      assign the attribute to a local variable and call that local\n      variable. Also notice that this transformation only happens for\n      user-defined functions; other callable objects (and all non-\n      callable objects) are retrieved without transformation.  It is\n      also important to note that user-defined functions which are\n      attributes of a class instance are not converted to bound\n      methods; this *only* happens when the function is an attribute\n      of the class.\n\n   Generator functions\n      A function or method which uses the "yield" statement (see\n      section *The yield statement*) is called a *generator function*.\n      Such a function, when called, always returns an iterator object\n      which can be used to execute the body of the function:  calling\n      the iterator\'s "iterator.__next__()" method will cause the\n      function to execute until it provides a value using the "yield"\n      statement.  When the function executes a "return" statement or\n      falls off the end, a "StopIteration" exception is raised and the\n      iterator will have reached the end of the set of values to be\n      returned.\n\n   Built-in functions\n      A built-in function object is a wrapper around a C function.\n      Examples of built-in functions are "len()" and "math.sin()"\n      ("math" is a standard built-in module). The number and type of\n      the arguments are determined by the C function. Special read-\n      only attributes: "__doc__" is the function\'s documentation\n      string, or "None" if unavailable; "__name__" is the function\'s\n      name; "__self__" is set to "None" (but see the next item);\n      "__module__" is the name of the module the function was defined\n      in or "None" if unavailable.\n\n   Built-in methods\n      This is really a different disguise of a built-in function, this\n      time containing an object passed to the C function as an\n      implicit extra argument.  An example of a built-in method is\n      "alist.append()", assuming *alist* is a list object. In this\n      case, the special read-only attribute "__self__" is set to the\n      object denoted by *alist*.\n\n   Classes\n      Classes are callable.  These objects normally act as factories\n      for new instances of themselves, but variations are possible for\n      class types that override "__new__()".  The arguments of the\n      call are passed to "__new__()" and, in the typical case, to\n      "__init__()" to initialize the new instance.\n\n   Class Instances\n      Instances of arbitrary classes can be made callable by defining\n      a "__call__()" method in their class.\n\nModules\n   Modules are a basic organizational unit of Python code, and are\n   created by the *import system* as invoked either by the "import"\n   statement (see "import"), or by calling functions such as\n   "importlib.import_module()" and built-in "__import__()".  A module\n   object has a namespace implemented by a dictionary object (this is\n   the dictionary referenced by the "__globals__" attribute of\n   functions defined in the module).  Attribute references are\n   translated to lookups in this dictionary, e.g., "m.x" is equivalent\n   to "m.__dict__["x"]". A module object does not contain the code\n   object used to initialize the module (since it isn\'t needed once\n   the initialization is done).\n\n   Attribute assignment updates the module\'s namespace dictionary,\n   e.g., "m.x = 1" is equivalent to "m.__dict__["x"] = 1".\n\n   Special read-only attribute: "__dict__" is the module\'s namespace\n   as a dictionary object.\n\n   **CPython implementation detail:** Because of the way CPython\n   clears module dictionaries, the module dictionary will be cleared\n   when the module falls out of scope even if the dictionary still has\n   live references.  To avoid this, copy the dictionary or keep the\n   module around while using its dictionary directly.\n\n   Predefined (writable) attributes: "__name__" is the module\'s name;\n   "__doc__" is the module\'s documentation string, or "None" if\n   unavailable; "__file__" is the pathname of the file from which the\n   module was loaded, if it was loaded from a file. The "__file__"\n   attribute may be missing for certain types of modules, such as C\n   modules that are statically linked into the interpreter; for\n   extension modules loaded dynamically from a shared library, it is\n   the pathname of the shared library file.\n\nCustom classes\n   Custom class types are typically created by class definitions (see\n   section *Class definitions*).  A class has a namespace implemented\n   by a dictionary object. Class attribute references are translated\n   to lookups in this dictionary, e.g., "C.x" is translated to\n   "C.__dict__["x"]" (although there are a number of hooks which allow\n   for other means of locating attributes). When the attribute name is\n   not found there, the attribute search continues in the base\n   classes. This search of the base classes uses the C3 method\n   resolution order which behaves correctly even in the presence of\n   \'diamond\' inheritance structures where there are multiple\n   inheritance paths leading back to a common ancestor. Additional\n   details on the C3 MRO used by Python can be found in the\n   documentation accompanying the 2.3 release at\n   http://www.python.org/download/releases/2.3/mro/.\n\n   When a class attribute reference (for class "C", say) would yield a\n   class method object, it is transformed into an instance method\n   object whose "__self__" attributes is "C".  When it would yield a\n   static method object, it is transformed into the object wrapped by\n   the static method object. See section *Implementing Descriptors*\n   for another way in which attributes retrieved from a class may\n   differ from those actually contained in its "__dict__".\n\n   Class attribute assignments update the class\'s dictionary, never\n   the dictionary of a base class.\n\n   A class object can be called (see above) to yield a class instance\n   (see below).\n\n   Special attributes: "__name__" is the class name; "__module__" is\n   the module name in which the class was defined; "__dict__" is the\n   dictionary containing the class\'s namespace; "__bases__" is a tuple\n   (possibly empty or a singleton) containing the base classes, in the\n   order of their occurrence in the base class list; "__doc__" is the\n   class\'s documentation string, or None if undefined.\n\nClass instances\n   A class instance is created by calling a class object (see above).\n   A class instance has a namespace implemented as a dictionary which\n   is the first place in which attribute references are searched.\n   When an attribute is not found there, and the instance\'s class has\n   an attribute by that name, the search continues with the class\n   attributes.  If a class attribute is found that is a user-defined\n   function object, it is transformed into an instance method object\n   whose "__self__" attribute is the instance.  Static method and\n   class method objects are also transformed; see above under\n   "Classes".  See section *Implementing Descriptors* for another way\n   in which attributes of a class retrieved via its instances may\n   differ from the objects actually stored in the class\'s "__dict__".\n   If no class attribute is found, and the object\'s class has a\n   "__getattr__()" method, that is called to satisfy the lookup.\n\n   Attribute assignments and deletions update the instance\'s\n   dictionary, never a class\'s dictionary.  If the class has a\n   "__setattr__()" or "__delattr__()" method, this is called instead\n   of updating the instance dictionary directly.\n\n   Class instances can pretend to be numbers, sequences, or mappings\n   if they have methods with certain special names.  See section\n   *Special method names*.\n\n   Special attributes: "__dict__" is the attribute dictionary;\n   "__class__" is the instance\'s class.\n\nI/O objects (also known as file objects)\n   A *file object* represents an open file.  Various shortcuts are\n   available to create file objects: the "open()" built-in function,\n   and also "os.popen()", "os.fdopen()", and the "makefile()" method\n   of socket objects (and perhaps by other functions or methods\n   provided by extension modules).\n\n   The objects "sys.stdin", "sys.stdout" and "sys.stderr" are\n   initialized to file objects corresponding to the interpreter\'s\n   standard input, output and error streams; they are all open in text\n   mode and therefore follow the interface defined by the\n   "io.TextIOBase" abstract class.\n\nInternal types\n   A few types used internally by the interpreter are exposed to the\n   user. Their definitions may change with future versions of the\n   interpreter, but they are mentioned here for completeness.\n\n   Code objects\n      Code objects represent *byte-compiled* executable Python code,\n      or *bytecode*. The difference between a code object and a\n      function object is that the function object contains an explicit\n      reference to the function\'s globals (the module in which it was\n      defined), while a code object contains no context; also the\n      default argument values are stored in the function object, not\n      in the code object (because they represent values calculated at\n      run-time).  Unlike function objects, code objects are immutable\n      and contain no references (directly or indirectly) to mutable\n      objects.\n\n      Special read-only attributes: "co_name" gives the function name;\n      "co_argcount" is the number of positional arguments (including\n      arguments with default values); "co_nlocals" is the number of\n      local variables used by the function (including arguments);\n      "co_varnames" is a tuple containing the names of the local\n      variables (starting with the argument names); "co_cellvars" is a\n      tuple containing the names of local variables that are\n      referenced by nested functions; "co_freevars" is a tuple\n      containing the names of free variables; "co_code" is a string\n      representing the sequence of bytecode instructions; "co_consts"\n      is a tuple containing the literals used by the bytecode;\n      "co_names" is a tuple containing the names used by the bytecode;\n      "co_filename" is the filename from which the code was compiled;\n      "co_firstlineno" is the first line number of the function;\n      "co_lnotab" is a string encoding the mapping from bytecode\n      offsets to line numbers (for details see the source code of the\n      interpreter); "co_stacksize" is the required stack size\n      (including local variables); "co_flags" is an integer encoding a\n      number of flags for the interpreter.\n\n      The following flag bits are defined for "co_flags": bit "0x04"\n      is set if the function uses the "*arguments" syntax to accept an\n      arbitrary number of positional arguments; bit "0x08" is set if\n      the function uses the "**keywords" syntax to accept arbitrary\n      keyword arguments; bit "0x20" is set if the function is a\n      generator.\n\n      Future feature declarations ("from __future__ import division")\n      also use bits in "co_flags" to indicate whether a code object\n      was compiled with a particular feature enabled: bit "0x2000" is\n      set if the function was compiled with future division enabled;\n      bits "0x10" and "0x1000" were used in earlier versions of\n      Python.\n\n      Other bits in "co_flags" are reserved for internal use.\n\n      If a code object represents a function, the first item in\n      "co_consts" is the documentation string of the function, or\n      "None" if undefined.\n\n   Frame objects\n      Frame objects represent execution frames.  They may occur in\n      traceback objects (see below).\n\n      Special read-only attributes: "f_back" is to the previous stack\n      frame (towards the caller), or "None" if this is the bottom\n      stack frame; "f_code" is the code object being executed in this\n      frame; "f_locals" is the dictionary used to look up local\n      variables; "f_globals" is used for global variables;\n      "f_builtins" is used for built-in (intrinsic) names; "f_lasti"\n      gives the precise instruction (this is an index into the\n      bytecode string of the code object).\n\n      Special writable attributes: "f_trace", if not "None", is a\n      function called at the start of each source code line (this is\n      used by the debugger); "f_lineno" is the current line number of\n      the frame --- writing to this from within a trace function jumps\n      to the given line (only for the bottom-most frame).  A debugger\n      can implement a Jump command (aka Set Next Statement) by writing\n      to f_lineno.\n\n   Traceback objects\n      Traceback objects represent a stack trace of an exception.  A\n      traceback object is created when an exception occurs.  When the\n      search for an exception handler unwinds the execution stack, at\n      each unwound level a traceback object is inserted in front of\n      the current traceback.  When an exception handler is entered,\n      the stack trace is made available to the program. (See section\n      *The try statement*.) It is accessible as the third item of the\n      tuple returned by "sys.exc_info()". When the program contains no\n      suitable handler, the stack trace is written (nicely formatted)\n      to the standard error stream; if the interpreter is interactive,\n      it is also made available to the user as "sys.last_traceback".\n\n      Special read-only attributes: "tb_next" is the next level in the\n      stack trace (towards the frame where the exception occurred), or\n      "None" if there is no next level; "tb_frame" points to the\n      execution frame of the current level; "tb_lineno" gives the line\n      number where the exception occurred; "tb_lasti" indicates the\n      precise instruction.  The line number and last instruction in\n      the traceback may differ from the line number of its frame\n      object if the exception occurred in a "try" statement with no\n      matching except clause or with a finally clause.\n\n   Slice objects\n      Slice objects are used to represent slices for "__getitem__()"\n      methods.  They are also created by the built-in "slice()"\n      function.\n\n      Special read-only attributes: "start" is the lower bound; "stop"\n      is the upper bound; "step" is the step value; each is "None" if\n      omitted.  These attributes can have any type.\n\n      Slice objects support one method:\n\n      slice.indices(self, length)\n\n         This method takes a single integer argument *length* and\n         computes information about the slice that the slice object\n         would describe if applied to a sequence of *length* items.\n         It returns a tuple of three integers; respectively these are\n         the *start* and *stop* indices and the *step* or stride\n         length of the slice. Missing or out-of-bounds indices are\n         handled in a manner consistent with regular slices.\n\n   Static method objects\n      Static method objects provide a way of defeating the\n      transformation of function objects to method objects described\n      above. A static method object is a wrapper around any other\n      object, usually a user-defined method object. When a static\n      method object is retrieved from a class or a class instance, the\n      object actually returned is the wrapped object, which is not\n      subject to any further transformation. Static method objects are\n      not themselves callable, although the objects they wrap usually\n      are. Static method objects are created by the built-in\n      "staticmethod()" constructor.\n\n   Class method objects\n      A class method object, like a static method object, is a wrapper\n      around another object that alters the way in which that object\n      is retrieved from classes and class instances. The behaviour of\n      class method objects upon such retrieval is described above,\n      under "User-defined methods". Class method objects are created\n      by the built-in "classmethod()" constructor.\n',
+ 'try': '\nThe "try" statement\n*******************\n\nThe "try" statement specifies exception handlers and/or cleanup code\nfor a group of statements:\n\n   try_stmt  ::= try1_stmt | try2_stmt\n   try1_stmt ::= "try" ":" suite\n                 ("except" [expression ["as" identifier]] ":" suite)+\n                 ["else" ":" suite]\n                 ["finally" ":" suite]\n   try2_stmt ::= "try" ":" suite\n                 "finally" ":" suite\n\nThe "except" clause(s) specify one or more exception handlers. When no\nexception occurs in the "try" clause, no exception handler is\nexecuted. When an exception occurs in the "try" suite, a search for an\nexception handler is started.  This search inspects the except clauses\nin turn until one is found that matches the exception.  An expression-\nless except clause, if present, must be last; it matches any\nexception.  For an except clause with an expression, that expression\nis evaluated, and the clause matches the exception if the resulting\nobject is "compatible" with the exception.  An object is compatible\nwith an exception if it is the class or a base class of the exception\nobject or a tuple containing an item compatible with the exception.\n\nIf no except clause matches the exception, the search for an exception\nhandler continues in the surrounding code and on the invocation stack.\n[1]\n\nIf the evaluation of an expression in the header of an except clause\nraises an exception, the original search for a handler is canceled and\na search starts for the new exception in the surrounding code and on\nthe call stack (it is treated as if the entire "try" statement raised\nthe exception).\n\nWhen a matching except clause is found, the exception is assigned to\nthe target specified after the "as" keyword in that except clause, if\npresent, and the except clause\'s suite is executed.  All except\nclauses must have an executable block.  When the end of this block is\nreached, execution continues normally after the entire try statement.\n(This means that if two nested handlers exist for the same exception,\nand the exception occurs in the try clause of the inner handler, the\nouter handler will not handle the exception.)\n\nWhen an exception has been assigned using "as target", it is cleared\nat the end of the except clause.  This is as if\n\n   except E as N:\n       foo\n\nwas translated to\n\n   except E as N:\n       try:\n           foo\n       finally:\n           del N\n\nThis means the exception must be assigned to a different name to be\nable to refer to it after the except clause.  Exceptions are cleared\nbecause with the traceback attached to them, they form a reference\ncycle with the stack frame, keeping all locals in that frame alive\nuntil the next garbage collection occurs.\n\nBefore an except clause\'s suite is executed, details about the\nexception are stored in the "sys" module and can be accessed via\n"sys.exc_info()". "sys.exc_info()" returns a 3-tuple consisting of the\nexception class, the exception instance and a traceback object (see\nsection *The standard type hierarchy*) identifying the point in the\nprogram where the exception occurred.  "sys.exc_info()" values are\nrestored to their previous values (before the call) when returning\nfrom a function that handled an exception.\n\nThe optional "else" clause is executed if and when control flows off\nthe end of the "try" clause. [2] Exceptions in the "else" clause are\nnot handled by the preceding "except" clauses.\n\nIf "finally" is present, it specifies a \'cleanup\' handler.  The "try"\nclause is executed, including any "except" and "else" clauses.  If an\nexception occurs in any of the clauses and is not handled, the\nexception is temporarily saved. The "finally" clause is executed.  If\nthere is a saved exception it is re-raised at the end of the "finally"\nclause.  If the "finally" clause raises another exception, the saved\nexception is set as the context of the new exception. If the "finally"\nclause executes a "return" or "break" statement, the saved exception\nis discarded:\n\n   >>> def f():\n   ...     try:\n   ...         1/0\n   ...     finally:\n   ...         return 42\n   ...\n   >>> f()\n   42\n\nThe exception information is not available to the program during\nexecution of the "finally" clause.\n\nWhen a "return", "break" or "continue" statement is executed in the\n"try" suite of a "try"..."finally" statement, the "finally" clause is\nalso executed \'on the way out.\' A "continue" statement is illegal in\nthe "finally" clause. (The reason is a problem with the current\nimplementation --- this restriction may be lifted in the future).\n\nThe return value of a function is determined by the last "return"\nstatement executed.  Since the "finally" clause always executes, a\n"return" statement executed in the "finally" clause will always be the\nlast one executed:\n\n   >>> def foo():\n   ...     try:\n   ...         return \'try\'\n   ...     finally:\n   ...         return \'finally\'\n   ...\n   >>> foo()\n   \'finally\'\n\nAdditional information on exceptions can be found in section\n*Exceptions*, and information on using the "raise" statement to\ngenerate exceptions may be found in section *The raise statement*.\n',
+ 'types': '\nThe standard type hierarchy\n***************************\n\nBelow is a list of the types that are built into Python.  Extension\nmodules (written in C, Java, or other languages, depending on the\nimplementation) can define additional types.  Future versions of\nPython may add types to the type hierarchy (e.g., rational numbers,\nefficiently stored arrays of integers, etc.), although such additions\nwill often be provided via the standard library instead.\n\nSome of the type descriptions below contain a paragraph listing\n\'special attributes.\'  These are attributes that provide access to the\nimplementation and are not intended for general use.  Their definition\nmay change in the future.\n\nNone\n   This type has a single value.  There is a single object with this\n   value. This object is accessed through the built-in name "None". It\n   is used to signify the absence of a value in many situations, e.g.,\n   it is returned from functions that don\'t explicitly return\n   anything. Its truth value is false.\n\nNotImplemented\n   This type has a single value.  There is a single object with this\n   value. This object is accessed through the built-in name\n   "NotImplemented". Numeric methods and rich comparison methods may\n   return this value if they do not implement the operation for the\n   operands provided.  (The interpreter will then try the reflected\n   operation, or some other fallback, depending on the operator.)  Its\n   truth value is true.\n\nEllipsis\n   This type has a single value.  There is a single object with this\n   value. This object is accessed through the literal "..." or the\n   built-in name "Ellipsis".  Its truth value is true.\n\n"numbers.Number"\n   These are created by numeric literals and returned as results by\n   arithmetic operators and arithmetic built-in functions.  Numeric\n   objects are immutable; once created their value never changes.\n   Python numbers are of course strongly related to mathematical\n   numbers, but subject to the limitations of numerical representation\n   in computers.\n\n   Python distinguishes between integers, floating point numbers, and\n   complex numbers:\n\n   "numbers.Integral"\n      These represent elements from the mathematical set of integers\n      (positive and negative).\n\n      There are two types of integers:\n\n      Integers ("int")\n\n         These represent numbers in an unlimited range, subject to\n         available (virtual) memory only.  For the purpose of shift\n         and mask operations, a binary representation is assumed, and\n         negative numbers are represented in a variant of 2\'s\n         complement which gives the illusion of an infinite string of\n         sign bits extending to the left.\n\n      Booleans ("bool")\n         These represent the truth values False and True.  The two\n         objects representing the values "False" and "True" are the\n         only Boolean objects. The Boolean type is a subtype of the\n         integer type, and Boolean values behave like the values 0 and\n         1, respectively, in almost all contexts, the exception being\n         that when converted to a string, the strings ""False"" or\n         ""True"" are returned, respectively.\n\n      The rules for integer representation are intended to give the\n      most meaningful interpretation of shift and mask operations\n      involving negative integers.\n\n   "numbers.Real" ("float")\n      These represent machine-level double precision floating point\n      numbers. You are at the mercy of the underlying machine\n      architecture (and C or Java implementation) for the accepted\n      range and handling of overflow. Python does not support single-\n      precision floating point numbers; the savings in processor and\n      memory usage that are usually the reason for using these is\n      dwarfed by the overhead of using objects in Python, so there is\n      no reason to complicate the language with two kinds of floating\n      point numbers.\n\n   "numbers.Complex" ("complex")\n      These represent complex numbers as a pair of machine-level\n      double precision floating point numbers.  The same caveats apply\n      as for floating point numbers. The real and imaginary parts of a\n      complex number "z" can be retrieved through the read-only\n      attributes "z.real" and "z.imag".\n\nSequences\n   These represent finite ordered sets indexed by non-negative\n   numbers. The built-in function "len()" returns the number of items\n   of a sequence. When the length of a sequence is *n*, the index set\n   contains the numbers 0, 1, ..., *n*-1.  Item *i* of sequence *a* is\n   selected by "a[i]".\n\n   Sequences also support slicing: "a[i:j]" selects all items with\n   index *k* such that *i* "<=" *k* "<" *j*.  When used as an\n   expression, a slice is a sequence of the same type.  This implies\n   that the index set is renumbered so that it starts at 0.\n\n   Some sequences also support "extended slicing" with a third "step"\n   parameter: "a[i:j:k]" selects all items of *a* with index *x* where\n   "x = i + n*k", *n* ">=" "0" and *i* "<=" *x* "<" *j*.\n\n   Sequences are distinguished according to their mutability:\n\n   Immutable sequences\n      An object of an immutable sequence type cannot change once it is\n      created.  (If the object contains references to other objects,\n      these other objects may be mutable and may be changed; however,\n      the collection of objects directly referenced by an immutable\n      object cannot change.)\n\n      The following types are immutable sequences:\n\n      Strings\n         A string is a sequence of values that represent Unicode code\n         points. All the code points in the range "U+0000 - U+10FFFF"\n         can be represented in a string.  Python doesn\'t have a "char"\n         type; instead, every code point in the string is represented\n         as a string object with length "1".  The built-in function\n         "ord()" converts a code point from its string form to an\n         integer in the range "0 - 10FFFF"; "chr()" converts an\n         integer in the range "0 - 10FFFF" to the corresponding length\n         "1" string object. "str.encode()" can be used to convert a\n         "str" to "bytes" using the given text encoding, and\n         "bytes.decode()" can be used to achieve the opposite.\n\n      Tuples\n         The items of a tuple are arbitrary Python objects. Tuples of\n         two or more items are formed by comma-separated lists of\n         expressions.  A tuple of one item (a \'singleton\') can be\n         formed by affixing a comma to an expression (an expression by\n         itself does not create a tuple, since parentheses must be\n         usable for grouping of expressions).  An empty tuple can be\n         formed by an empty pair of parentheses.\n\n      Bytes\n         A bytes object is an immutable array.  The items are 8-bit\n         bytes, represented by integers in the range 0 <= x < 256.\n         Bytes literals (like "b\'abc\'") and the built-in function\n         "bytes()" can be used to construct bytes objects.  Also,\n         bytes objects can be decoded to strings via the "decode()"\n         method.\n\n   Mutable sequences\n      Mutable sequences can be changed after they are created.  The\n      subscription and slicing notations can be used as the target of\n      assignment and "del" (delete) statements.\n\n      There are currently two intrinsic mutable sequence types:\n\n      Lists\n         The items of a list are arbitrary Python objects.  Lists are\n         formed by placing a comma-separated list of expressions in\n         square brackets. (Note that there are no special cases needed\n         to form lists of length 0 or 1.)\n\n      Byte Arrays\n         A bytearray object is a mutable array. They are created by\n         the built-in "bytearray()" constructor.  Aside from being\n         mutable (and hence unhashable), byte arrays otherwise provide\n         the same interface and functionality as immutable bytes\n         objects.\n\n      The extension module "array" provides an additional example of a\n      mutable sequence type, as does the "collections" module.\n\nSet types\n   These represent unordered, finite sets of unique, immutable\n   objects. As such, they cannot be indexed by any subscript. However,\n   they can be iterated over, and the built-in function "len()"\n   returns the number of items in a set. Common uses for sets are fast\n   membership testing, removing duplicates from a sequence, and\n   computing mathematical operations such as intersection, union,\n   difference, and symmetric difference.\n\n   For set elements, the same immutability rules apply as for\n   dictionary keys. Note that numeric types obey the normal rules for\n   numeric comparison: if two numbers compare equal (e.g., "1" and\n   "1.0"), only one of them can be contained in a set.\n\n   There are currently two intrinsic set types:\n\n   Sets\n      These represent a mutable set. They are created by the built-in\n      "set()" constructor and can be modified afterwards by several\n      methods, such as "add()".\n\n   Frozen sets\n      These represent an immutable set.  They are created by the\n      built-in "frozenset()" constructor.  As a frozenset is immutable\n      and *hashable*, it can be used again as an element of another\n      set, or as a dictionary key.\n\nMappings\n   These represent finite sets of objects indexed by arbitrary index\n   sets. The subscript notation "a[k]" selects the item indexed by "k"\n   from the mapping "a"; this can be used in expressions and as the\n   target of assignments or "del" statements. The built-in function\n   "len()" returns the number of items in a mapping.\n\n   There is currently a single intrinsic mapping type:\n\n   Dictionaries\n      These represent finite sets of objects indexed by nearly\n      arbitrary values.  The only types of values not acceptable as\n      keys are values containing lists or dictionaries or other\n      mutable types that are compared by value rather than by object\n      identity, the reason being that the efficient implementation of\n      dictionaries requires a key\'s hash value to remain constant.\n      Numeric types used for keys obey the normal rules for numeric\n      comparison: if two numbers compare equal (e.g., "1" and "1.0")\n      then they can be used interchangeably to index the same\n      dictionary entry.\n\n      Dictionaries are mutable; they can be created by the "{...}"\n      notation (see section *Dictionary displays*).\n\n      The extension modules "dbm.ndbm" and "dbm.gnu" provide\n      additional examples of mapping types, as does the "collections"\n      module.\n\nCallable types\n   These are the types to which the function call operation (see\n   section *Calls*) can be applied:\n\n   User-defined functions\n      A user-defined function object is created by a function\n      definition (see section *Function definitions*).  It should be\n      called with an argument list containing the same number of items\n      as the function\'s formal parameter list.\n\n      Special attributes:\n\n      +---------------------------+---------------------------------+-------------+\n      | Attribute                 | Meaning                         |             |\n      +===========================+=================================+=============+\n      | "__doc__"                 | The function\'s documentation    | Writable    |\n      |                           | string, or "None" if            |             |\n      |                           | unavailable                     |             |\n      +---------------------------+---------------------------------+-------------+\n      | "__name__"                | The function\'s name             | Writable    |\n      +---------------------------+---------------------------------+-------------+\n      | "__qualname__"            | The function\'s *qualified name* | Writable    |\n      |                           | New in version 3.3.             |             |\n      +---------------------------+---------------------------------+-------------+\n      | "__module__"              | The name of the module the      | Writable    |\n      |                           | function was defined in, or     |             |\n      |                           | "None" if unavailable.          |             |\n      +---------------------------+---------------------------------+-------------+\n      | "__defaults__"            | A tuple containing default      | Writable    |\n      |                           | argument values for those       |             |\n      |                           | arguments that have defaults,   |             |\n      |                           | or "None" if no arguments have  |             |\n      |                           | a default value                 |             |\n      +---------------------------+---------------------------------+-------------+\n      | "__code__"                | The code object representing    | Writable    |\n      |                           | the compiled function body.     |             |\n      +---------------------------+---------------------------------+-------------+\n      | "__globals__"             | A reference to the dictionary   | Read-only   |\n      |                           | that holds the function\'s       |             |\n      |                           | global variables --- the global |             |\n      |                           | namespace of the module in      |             |\n      |                           | which the function was defined. |             |\n      +---------------------------+---------------------------------+-------------+\n      | "__dict__"                | The namespace supporting        | Writable    |\n      |                           | arbitrary function attributes.  |             |\n      +---------------------------+---------------------------------+-------------+\n      | "__closure__"             | "None" or a tuple of cells that | Read-only   |\n      |                           | contain bindings for the        |             |\n      |                           | function\'s free variables.      |             |\n      +---------------------------+---------------------------------+-------------+\n      | "__annotations__"         | A dict containing annotations   | Writable    |\n      |                           | of parameters.  The keys of the |             |\n      |                           | dict are the parameter names,   |             |\n      |                           | and "\'return\'" for the return   |             |\n      |                           | annotation, if provided.        |             |\n      +---------------------------+---------------------------------+-------------+\n      | "__kwdefaults__"          | A dict containing defaults for  | Writable    |\n      |                           | keyword-only parameters.        |             |\n      +---------------------------+---------------------------------+-------------+\n\n      Most of the attributes labelled "Writable" check the type of the\n      assigned value.\n\n      Function objects also support getting and setting arbitrary\n      attributes, which can be used, for example, to attach metadata\n      to functions.  Regular attribute dot-notation is used to get and\n      set such attributes. *Note that the current implementation only\n      supports function attributes on user-defined functions. Function\n      attributes on built-in functions may be supported in the\n      future.*\n\n      Additional information about a function\'s definition can be\n      retrieved from its code object; see the description of internal\n      types below.\n\n   Instance methods\n      An instance method object combines a class, a class instance and\n      any callable object (normally a user-defined function).\n\n      Special read-only attributes: "__self__" is the class instance\n      object, "__func__" is the function object; "__doc__" is the\n      method\'s documentation (same as "__func__.__doc__"); "__name__"\n      is the method name (same as "__func__.__name__"); "__module__"\n      is the name of the module the method was defined in, or "None"\n      if unavailable.\n\n      Methods also support accessing (but not setting) the arbitrary\n      function attributes on the underlying function object.\n\n      User-defined method objects may be created when getting an\n      attribute of a class (perhaps via an instance of that class), if\n      that attribute is a user-defined function object or a class\n      method object.\n\n      When an instance method object is created by retrieving a user-\n      defined function object from a class via one of its instances,\n      its "__self__" attribute is the instance, and the method object\n      is said to be bound.  The new method\'s "__func__" attribute is\n      the original function object.\n\n      When a user-defined method object is created by retrieving\n      another method object from a class or instance, the behaviour is\n      the same as for a function object, except that the "__func__"\n      attribute of the new instance is not the original method object\n      but its "__func__" attribute.\n\n      When an instance method object is created by retrieving a class\n      method object from a class or instance, its "__self__" attribute\n      is the class itself, and its "__func__" attribute is the\n      function object underlying the class method.\n\n      When an instance method object is called, the underlying\n      function ("__func__") is called, inserting the class instance\n      ("__self__") in front of the argument list.  For instance, when\n      "C" is a class which contains a definition for a function "f()",\n      and "x" is an instance of "C", calling "x.f(1)" is equivalent to\n      calling "C.f(x, 1)".\n\n      When an instance method object is derived from a class method\n      object, the "class instance" stored in "__self__" will actually\n      be the class itself, so that calling either "x.f(1)" or "C.f(1)"\n      is equivalent to calling "f(C,1)" where "f" is the underlying\n      function.\n\n      Note that the transformation from function object to instance\n      method object happens each time the attribute is retrieved from\n      the instance.  In some cases, a fruitful optimization is to\n      assign the attribute to a local variable and call that local\n      variable. Also notice that this transformation only happens for\n      user-defined functions; other callable objects (and all non-\n      callable objects) are retrieved without transformation.  It is\n      also important to note that user-defined functions which are\n      attributes of a class instance are not converted to bound\n      methods; this *only* happens when the function is an attribute\n      of the class.\n\n   Generator functions\n      A function or method which uses the "yield" statement (see\n      section *The yield statement*) is called a *generator function*.\n      Such a function, when called, always returns an iterator object\n      which can be used to execute the body of the function:  calling\n      the iterator\'s "iterator.__next__()" method will cause the\n      function to execute until it provides a value using the "yield"\n      statement.  When the function executes a "return" statement or\n      falls off the end, a "StopIteration" exception is raised and the\n      iterator will have reached the end of the set of values to be\n      returned.\n\n   Built-in functions\n      A built-in function object is a wrapper around a C function.\n      Examples of built-in functions are "len()" and "math.sin()"\n      ("math" is a standard built-in module). The number and type of\n      the arguments are determined by the C function. Special read-\n      only attributes: "__doc__" is the function\'s documentation\n      string, or "None" if unavailable; "__name__" is the function\'s\n      name; "__self__" is set to "None" (but see the next item);\n      "__module__" is the name of the module the function was defined\n      in or "None" if unavailable.\n\n   Built-in methods\n      This is really a different disguise of a built-in function, this\n      time containing an object passed to the C function as an\n      implicit extra argument.  An example of a built-in method is\n      "alist.append()", assuming *alist* is a list object. In this\n      case, the special read-only attribute "__self__" is set to the\n      object denoted by *alist*.\n\n   Classes\n      Classes are callable.  These objects normally act as factories\n      for new instances of themselves, but variations are possible for\n      class types that override "__new__()".  The arguments of the\n      call are passed to "__new__()" and, in the typical case, to\n      "__init__()" to initialize the new instance.\n\n   Class Instances\n      Instances of arbitrary classes can be made callable by defining\n      a "__call__()" method in their class.\n\nModules\n   Modules are a basic organizational unit of Python code, and are\n   created by the *import system* as invoked either by the "import"\n   statement (see "import"), or by calling functions such as\n   "importlib.import_module()" and built-in "__import__()".  A module\n   object has a namespace implemented by a dictionary object (this is\n   the dictionary referenced by the "__globals__" attribute of\n   functions defined in the module).  Attribute references are\n   translated to lookups in this dictionary, e.g., "m.x" is equivalent\n   to "m.__dict__["x"]". A module object does not contain the code\n   object used to initialize the module (since it isn\'t needed once\n   the initialization is done).\n\n   Attribute assignment updates the module\'s namespace dictionary,\n   e.g., "m.x = 1" is equivalent to "m.__dict__["x"] = 1".\n\n   Special read-only attribute: "__dict__" is the module\'s namespace\n   as a dictionary object.\n\n   **CPython implementation detail:** Because of the way CPython\n   clears module dictionaries, the module dictionary will be cleared\n   when the module falls out of scope even if the dictionary still has\n   live references.  To avoid this, copy the dictionary or keep the\n   module around while using its dictionary directly.\n\n   Predefined (writable) attributes: "__name__" is the module\'s name;\n   "__doc__" is the module\'s documentation string, or "None" if\n   unavailable; "__file__" is the pathname of the file from which the\n   module was loaded, if it was loaded from a file. The "__file__"\n   attribute may be missing for certain types of modules, such as C\n   modules that are statically linked into the interpreter; for\n   extension modules loaded dynamically from a shared library, it is\n   the pathname of the shared library file.\n\nCustom classes\n   Custom class types are typically created by class definitions (see\n   section *Class definitions*).  A class has a namespace implemented\n   by a dictionary object. Class attribute references are translated\n   to lookups in this dictionary, e.g., "C.x" is translated to\n   "C.__dict__["x"]" (although there are a number of hooks which allow\n   for other means of locating attributes). When the attribute name is\n   not found there, the attribute search continues in the base\n   classes. This search of the base classes uses the C3 method\n   resolution order which behaves correctly even in the presence of\n   \'diamond\' inheritance structures where there are multiple\n   inheritance paths leading back to a common ancestor. Additional\n   details on the C3 MRO used by Python can be found in the\n   documentation accompanying the 2.3 release at\n   http://www.python.org/download/releases/2.3/mro/.\n\n   When a class attribute reference (for class "C", say) would yield a\n   class method object, it is transformed into an instance method\n   object whose "__self__" attributes is "C".  When it would yield a\n   static method object, it is transformed into the object wrapped by\n   the static method object. See section *Implementing Descriptors*\n   for another way in which attributes retrieved from a class may\n   differ from those actually contained in its "__dict__".\n\n   Class attribute assignments update the class\'s dictionary, never\n   the dictionary of a base class.\n\n   A class object can be called (see above) to yield a class instance\n   (see below).\n\n   Special attributes: "__name__" is the class name; "__module__" is\n   the module name in which the class was defined; "__dict__" is the\n   dictionary containing the class\'s namespace; "__bases__" is a tuple\n   (possibly empty or a singleton) containing the base classes, in the\n   order of their occurrence in the base class list; "__doc__" is the\n   class\'s documentation string, or None if undefined.\n\nClass instances\n   A class instance is created by calling a class object (see above).\n   A class instance has a namespace implemented as a dictionary which\n   is the first place in which attribute references are searched.\n   When an attribute is not found there, and the instance\'s class has\n   an attribute by that name, the search continues with the class\n   attributes.  If a class attribute is found that is a user-defined\n   function object, it is transformed into an instance method object\n   whose "__self__" attribute is the instance.  Static method and\n   class method objects are also transformed; see above under\n   "Classes".  See section *Implementing Descriptors* for another way\n   in which attributes of a class retrieved via its instances may\n   differ from the objects actually stored in the class\'s "__dict__".\n   If no class attribute is found, and the object\'s class has a\n   "__getattr__()" method, that is called to satisfy the lookup.\n\n   Attribute assignments and deletions update the instance\'s\n   dictionary, never a class\'s dictionary.  If the class has a\n   "__setattr__()" or "__delattr__()" method, this is called instead\n   of updating the instance dictionary directly.\n\n   Class instances can pretend to be numbers, sequences, or mappings\n   if they have methods with certain special names.  See section\n   *Special method names*.\n\n   Special attributes: "__dict__" is the attribute dictionary;\n   "__class__" is the instance\'s class.\n\nI/O objects (also known as file objects)\n   A *file object* represents an open file.  Various shortcuts are\n   available to create file objects: the "open()" built-in function,\n   and also "os.popen()", "os.fdopen()", and the "makefile()" method\n   of socket objects (and perhaps by other functions or methods\n   provided by extension modules).\n\n   The objects "sys.stdin", "sys.stdout" and "sys.stderr" are\n   initialized to file objects corresponding to the interpreter\'s\n   standard input, output and error streams; they are all open in text\n   mode and therefore follow the interface defined by the\n   "io.TextIOBase" abstract class.\n\nInternal types\n   A few types used internally by the interpreter are exposed to the\n   user. Their definitions may change with future versions of the\n   interpreter, but they are mentioned here for completeness.\n\n   Code objects\n      Code objects represent *byte-compiled* executable Python code,\n      or *bytecode*. The difference between a code object and a\n      function object is that the function object contains an explicit\n      reference to the function\'s globals (the module in which it was\n      defined), while a code object contains no context; also the\n      default argument values are stored in the function object, not\n      in the code object (because they represent values calculated at\n      run-time).  Unlike function objects, code objects are immutable\n      and contain no references (directly or indirectly) to mutable\n      objects.\n\n      Special read-only attributes: "co_name" gives the function name;\n      "co_argcount" is the number of positional arguments (including\n      arguments with default values); "co_nlocals" is the number of\n      local variables used by the function (including arguments);\n      "co_varnames" is a tuple containing the names of the local\n      variables (starting with the argument names); "co_cellvars" is a\n      tuple containing the names of local variables that are\n      referenced by nested functions; "co_freevars" is a tuple\n      containing the names of free variables; "co_code" is a string\n      representing the sequence of bytecode instructions; "co_consts"\n      is a tuple containing the literals used by the bytecode;\n      "co_names" is a tuple containing the names used by the bytecode;\n      "co_filename" is the filename from which the code was compiled;\n      "co_firstlineno" is the first line number of the function;\n      "co_lnotab" is a string encoding the mapping from bytecode\n      offsets to line numbers (for details see the source code of the\n      interpreter); "co_stacksize" is the required stack size\n      (including local variables); "co_flags" is an integer encoding a\n      number of flags for the interpreter.\n\n      The following flag bits are defined for "co_flags": bit "0x04"\n      is set if the function uses the "*arguments" syntax to accept an\n      arbitrary number of positional arguments; bit "0x08" is set if\n      the function uses the "**keywords" syntax to accept arbitrary\n      keyword arguments; bit "0x20" is set if the function is a\n      generator.\n\n      Future feature declarations ("from __future__ import division")\n      also use bits in "co_flags" to indicate whether a code object\n      was compiled with a particular feature enabled: bit "0x2000" is\n      set if the function was compiled with future division enabled;\n      bits "0x10" and "0x1000" were used in earlier versions of\n      Python.\n\n      Other bits in "co_flags" are reserved for internal use.\n\n      If a code object represents a function, the first item in\n      "co_consts" is the documentation string of the function, or\n      "None" if undefined.\n\n   Frame objects\n      Frame objects represent execution frames.  They may occur in\n      traceback objects (see below).\n\n      Special read-only attributes: "f_back" is to the previous stack\n      frame (towards the caller), or "None" if this is the bottom\n      stack frame; "f_code" is the code object being executed in this\n      frame; "f_locals" is the dictionary used to look up local\n      variables; "f_globals" is used for global variables;\n      "f_builtins" is used for built-in (intrinsic) names; "f_lasti"\n      gives the precise instruction (this is an index into the\n      bytecode string of the code object).\n\n      Special writable attributes: "f_trace", if not "None", is a\n      function called at the start of each source code line (this is\n      used by the debugger); "f_lineno" is the current line number of\n      the frame --- writing to this from within a trace function jumps\n      to the given line (only for the bottom-most frame).  A debugger\n      can implement a Jump command (aka Set Next Statement) by writing\n      to f_lineno.\n\n      Frame objects support one method:\n\n      frame.clear()\n\n         This method clears all references to local variables held by\n         the frame.  Also, if the frame belonged to a generator, the\n         generator is finalized.  This helps break reference cycles\n         involving frame objects (for example when catching an\n         exception and storing its traceback for later use).\n\n         "RuntimeError" is raised if the frame is currently executing.\n\n         New in version 3.4.\n\n   Traceback objects\n      Traceback objects represent a stack trace of an exception.  A\n      traceback object is created when an exception occurs.  When the\n      search for an exception handler unwinds the execution stack, at\n      each unwound level a traceback object is inserted in front of\n      the current traceback.  When an exception handler is entered,\n      the stack trace is made available to the program. (See section\n      *The try statement*.) It is accessible as the third item of the\n      tuple returned by "sys.exc_info()". When the program contains no\n      suitable handler, the stack trace is written (nicely formatted)\n      to the standard error stream; if the interpreter is interactive,\n      it is also made available to the user as "sys.last_traceback".\n\n      Special read-only attributes: "tb_next" is the next level in the\n      stack trace (towards the frame where the exception occurred), or\n      "None" if there is no next level; "tb_frame" points to the\n      execution frame of the current level; "tb_lineno" gives the line\n      number where the exception occurred; "tb_lasti" indicates the\n      precise instruction.  The line number and last instruction in\n      the traceback may differ from the line number of its frame\n      object if the exception occurred in a "try" statement with no\n      matching except clause or with a finally clause.\n\n   Slice objects\n      Slice objects are used to represent slices for "__getitem__()"\n      methods.  They are also created by the built-in "slice()"\n      function.\n\n      Special read-only attributes: "start" is the lower bound; "stop"\n      is the upper bound; "step" is the step value; each is "None" if\n      omitted.  These attributes can have any type.\n\n      Slice objects support one method:\n\n      slice.indices(self, length)\n\n         This method takes a single integer argument *length* and\n         computes information about the slice that the slice object\n         would describe if applied to a sequence of *length* items.\n         It returns a tuple of three integers; respectively these are\n         the *start* and *stop* indices and the *step* or stride\n         length of the slice. Missing or out-of-bounds indices are\n         handled in a manner consistent with regular slices.\n\n   Static method objects\n      Static method objects provide a way of defeating the\n      transformation of function objects to method objects described\n      above. A static method object is a wrapper around any other\n      object, usually a user-defined method object. When a static\n      method object is retrieved from a class or a class instance, the\n      object actually returned is the wrapped object, which is not\n      subject to any further transformation. Static method objects are\n      not themselves callable, although the objects they wrap usually\n      are. Static method objects are created by the built-in\n      "staticmethod()" constructor.\n\n   Class method objects\n      A class method object, like a static method object, is a wrapper\n      around another object that alters the way in which that object\n      is retrieved from classes and class instances. The behaviour of\n      class method objects upon such retrieval is described above,\n      under "User-defined methods". Class method objects are created\n      by the built-in "classmethod()" constructor.\n',
  'typesfunctions': '\nFunctions\n*********\n\nFunction objects are created by function definitions.  The only\noperation on a function object is to call it: "func(argument-list)".\n\nThere are really two flavors of function objects: built-in functions\nand user-defined functions.  Both support the same operation (to call\nthe function), but the implementation is different, hence the\ndifferent object types.\n\nSee *Function definitions* for more information.\n',
- 'typesmapping': '\nMapping Types --- "dict"\n************************\n\nA *mapping* object maps *hashable* values to arbitrary objects.\nMappings are mutable objects.  There is currently only one standard\nmapping type, the *dictionary*.  (For other containers see the built-\nin "list", "set", and "tuple" classes, and the "collections" module.)\n\nA dictionary\'s keys are *almost* arbitrary values.  Values that are\nnot *hashable*, that is, values containing lists, dictionaries or\nother mutable types (that are compared by value rather than by object\nidentity) may not be used as keys.  Numeric types used for keys obey\nthe normal rules for numeric comparison: if two numbers compare equal\n(such as "1" and "1.0") then they can be used interchangeably to index\nthe same dictionary entry.  (Note however, that since computers store\nfloating-point numbers as approximations it is usually unwise to use\nthem as dictionary keys.)\n\nDictionaries can be created by placing a comma-separated list of "key:\nvalue" pairs within braces, for example: "{\'jack\': 4098, \'sjoerd\':\n4127}" or "{4098: \'jack\', 4127: \'sjoerd\'}", or by the "dict"\nconstructor.\n\nclass class dict(**kwarg)\nclass class dict(mapping, **kwarg)\nclass class dict(iterable, **kwarg)\n\n   Return a new dictionary initialized from an optional positional\n   argument and a possibly empty set of keyword arguments.\n\n   If no positional argument is given, an empty dictionary is created.\n   If a positional argument is given and it is a mapping object, a\n   dictionary is created with the same key-value pairs as the mapping\n   object.  Otherwise, the positional argument must be an *iterator*\n   object.  Each item in the iterable must itself be an iterator with\n   exactly two objects.  The first object of each item becomes a key\n   in the new dictionary, and the second object the corresponding\n   value.  If a key occurs more than once, the last value for that key\n   becomes the corresponding value in the new dictionary.\n\n   If keyword arguments are given, the keyword arguments and their\n   values are added to the dictionary created from the positional\n   argument.  If a key being added is already present, the value from\n   the keyword argument replaces the value from the positional\n   argument.\n\n   To illustrate, the following examples all return a dictionary equal\n   to "{"one": 1, "two": 2, "three": 3}":\n\n      >>> a = dict(one=1, two=2, three=3)\n      >>> b = {\'one\': 1, \'two\': 2, \'three\': 3}\n      >>> c = dict(zip([\'one\', \'two\', \'three\'], [1, 2, 3]))\n      >>> d = dict([(\'two\', 2), (\'one\', 1), (\'three\', 3)])\n      >>> e = dict({\'three\': 3, \'one\': 1, \'two\': 2})\n      >>> a == b == c == d == e\n      True\n\n   Providing keyword arguments as in the first example only works for\n   keys that are valid Python identifiers.  Otherwise, any valid keys\n   can be used.\n\n   These are the operations that dictionaries support (and therefore,\n   custom mapping types should support too):\n\n   len(d)\n\n      Return the number of items in the dictionary *d*.\n\n   d[key]\n\n      Return the item of *d* with key *key*.  Raises a "KeyError" if\n      *key* is not in the map.\n\n      If a subclass of dict defines a method "__missing__()", if the\n      key *key* is not present, the "d[key]" operation calls that\n      method with the key *key* as argument.  The "d[key]" operation\n      then returns or raises whatever is returned or raised by the\n      "__missing__(key)" call if the key is not present. No other\n      operations or methods invoke "__missing__()". If "__missing__()"\n      is not defined, "KeyError" is raised. "__missing__()" must be a\n      method; it cannot be an instance variable:\n\n         >>> class Counter(dict):\n         ...     def __missing__(self, key):\n         ...         return 0\n         >>> c = Counter()\n         >>> c[\'red\']\n         0\n         >>> c[\'red\'] += 1\n         >>> c[\'red\']\n         1\n\n      See "collections.Counter" for a complete implementation\n      including other methods helpful for accumulating and managing\n      tallies.\n\n   d[key] = value\n\n      Set "d[key]" to *value*.\n\n   del d[key]\n\n      Remove "d[key]" from *d*.  Raises a "KeyError" if *key* is not\n      in the map.\n\n   key in d\n\n      Return "True" if *d* has a key *key*, else "False".\n\n   key not in d\n\n      Equivalent to "not key in d".\n\n   iter(d)\n\n      Return an iterator over the keys of the dictionary.  This is a\n      shortcut for "iter(d.keys())".\n\n   clear()\n\n      Remove all items from the dictionary.\n\n   copy()\n\n      Return a shallow copy of the dictionary.\n\n   classmethod fromkeys(seq[, value])\n\n      Create a new dictionary with keys from *seq* and values set to\n      *value*.\n\n      "fromkeys()" is a class method that returns a new dictionary.\n      *value* defaults to "None".\n\n   get(key[, default])\n\n      Return the value for *key* if *key* is in the dictionary, else\n      *default*. If *default* is not given, it defaults to "None", so\n      that this method never raises a "KeyError".\n\n   items()\n\n      Return a new view of the dictionary\'s items ("(key, value)"\n      pairs). See the *documentation of view objects*.\n\n   keys()\n\n      Return a new view of the dictionary\'s keys.  See the\n      *documentation of view objects*.\n\n   pop(key[, default])\n\n      If *key* is in the dictionary, remove it and return its value,\n      else return *default*.  If *default* is not given and *key* is\n      not in the dictionary, a "KeyError" is raised.\n\n   popitem()\n\n      Remove and return an arbitrary "(key, value)" pair from the\n      dictionary.\n\n      "popitem()" is useful to destructively iterate over a\n      dictionary, as often used in set algorithms.  If the dictionary\n      is empty, calling "popitem()" raises a "KeyError".\n\n   setdefault(key[, default])\n\n      If *key* is in the dictionary, return its value.  If not, insert\n      *key* with a value of *default* and return *default*.  *default*\n      defaults to "None".\n\n   update([other])\n\n      Update the dictionary with the key/value pairs from *other*,\n      overwriting existing keys.  Return "None".\n\n      "update()" accepts either another dictionary object or an\n      iterable of key/value pairs (as tuples or other iterables of\n      length two).  If keyword arguments are specified, the dictionary\n      is then updated with those key/value pairs: "d.update(red=1,\n      blue=2)".\n\n   values()\n\n      Return a new view of the dictionary\'s values.  See the\n      *documentation of view objects*.\n\nSee also: "types.MappingProxyType" can be used to create a read-only\n  view of a "dict".\n\n\nDictionary view objects\n=======================\n\nThe objects returned by "dict.keys()", "dict.values()" and\n"dict.items()" are *view objects*.  They provide a dynamic view on the\ndictionary\'s entries, which means that when the dictionary changes,\nthe view reflects these changes.\n\nDictionary views can be iterated over to yield their respective data,\nand support membership tests:\n\nlen(dictview)\n\n   Return the number of entries in the dictionary.\n\niter(dictview)\n\n   Return an iterator over the keys, values or items (represented as\n   tuples of "(key, value)") in the dictionary.\n\n   Keys and values are iterated over in an arbitrary order which is\n   non-random, varies across Python implementations, and depends on\n   the dictionary\'s history of insertions and deletions. If keys,\n   values and items views are iterated over with no intervening\n   modifications to the dictionary, the order of items will directly\n   correspond.  This allows the creation of "(value, key)" pairs using\n   "zip()": "pairs = zip(d.values(), d.keys())".  Another way to\n   create the same list is "pairs = [(v, k) for (k, v) in d.items()]".\n\n   Iterating views while adding or deleting entries in the dictionary\n   may raise a "RuntimeError" or fail to iterate over all entries.\n\nx in dictview\n\n   Return "True" if *x* is in the underlying dictionary\'s keys, values\n   or items (in the latter case, *x* should be a "(key, value)"\n   tuple).\n\nKeys views are set-like since their entries are unique and hashable.\nIf all values are hashable, so that "(key, value)" pairs are unique\nand hashable, then the items view is also set-like.  (Values views are\nnot treated as set-like since the entries are generally not unique.)\nFor set-like views, all of the operations defined for the abstract\nbase class "collections.abc.Set" are available (for example, "==",\n"<", or "^").\n\nAn example of dictionary view usage:\n\n   >>> dishes = {\'eggs\': 2, \'sausage\': 1, \'bacon\': 1, \'spam\': 500}\n   >>> keys = dishes.keys()\n   >>> values = dishes.values()\n\n   >>> # iteration\n   >>> n = 0\n   >>> for val in values:\n   ...     n += val\n   >>> print(n)\n   504\n\n   >>> # keys and values are iterated over in the same order\n   >>> list(keys)\n   [\'eggs\', \'bacon\', \'sausage\', \'spam\']\n   >>> list(values)\n   [2, 1, 1, 500]\n\n   >>> # view objects are dynamic and reflect dict changes\n   >>> del dishes[\'eggs\']\n   >>> del dishes[\'sausage\']\n   >>> list(keys)\n   [\'spam\', \'bacon\']\n\n   >>> # set operations\n   >>> keys & {\'eggs\', \'bacon\', \'salad\'}\n   {\'bacon\'}\n   >>> keys ^ {\'sausage\', \'juice\'}\n   {\'juice\', \'sausage\', \'bacon\', \'spam\'}\n',
+ 'typesmapping': '\nMapping Types --- "dict"\n************************\n\nA *mapping* object maps *hashable* values to arbitrary objects.\nMappings are mutable objects.  There is currently only one standard\nmapping type, the *dictionary*.  (For other containers see the built-\nin "list", "set", and "tuple" classes, and the "collections" module.)\n\nA dictionary\'s keys are *almost* arbitrary values.  Values that are\nnot *hashable*, that is, values containing lists, dictionaries or\nother mutable types (that are compared by value rather than by object\nidentity) may not be used as keys.  Numeric types used for keys obey\nthe normal rules for numeric comparison: if two numbers compare equal\n(such as "1" and "1.0") then they can be used interchangeably to index\nthe same dictionary entry.  (Note however, that since computers store\nfloating-point numbers as approximations it is usually unwise to use\nthem as dictionary keys.)\n\nDictionaries can be created by placing a comma-separated list of "key:\nvalue" pairs within braces, for example: "{\'jack\': 4098, \'sjoerd\':\n4127}" or "{4098: \'jack\', 4127: \'sjoerd\'}", or by the "dict"\nconstructor.\n\nclass class dict(**kwarg)\nclass class dict(mapping, **kwarg)\nclass class dict(iterable, **kwarg)\n\n   Return a new dictionary initialized from an optional positional\n   argument and a possibly empty set of keyword arguments.\n\n   If no positional argument is given, an empty dictionary is created.\n   If a positional argument is given and it is a mapping object, a\n   dictionary is created with the same key-value pairs as the mapping\n   object.  Otherwise, the positional argument must be an *iterable*\n   object.  Each item in the iterable must itself be an iterable with\n   exactly two objects.  The first object of each item becomes a key\n   in the new dictionary, and the second object the corresponding\n   value.  If a key occurs more than once, the last value for that key\n   becomes the corresponding value in the new dictionary.\n\n   If keyword arguments are given, the keyword arguments and their\n   values are added to the dictionary created from the positional\n   argument.  If a key being added is already present, the value from\n   the keyword argument replaces the value from the positional\n   argument.\n\n   To illustrate, the following examples all return a dictionary equal\n   to "{"one": 1, "two": 2, "three": 3}":\n\n      >>> a = dict(one=1, two=2, three=3)\n      >>> b = {\'one\': 1, \'two\': 2, \'three\': 3}\n      >>> c = dict(zip([\'one\', \'two\', \'three\'], [1, 2, 3]))\n      >>> d = dict([(\'two\', 2), (\'one\', 1), (\'three\', 3)])\n      >>> e = dict({\'three\': 3, \'one\': 1, \'two\': 2})\n      >>> a == b == c == d == e\n      True\n\n   Providing keyword arguments as in the first example only works for\n   keys that are valid Python identifiers.  Otherwise, any valid keys\n   can be used.\n\n   These are the operations that dictionaries support (and therefore,\n   custom mapping types should support too):\n\n   len(d)\n\n      Return the number of items in the dictionary *d*.\n\n   d[key]\n\n      Return the item of *d* with key *key*.  Raises a "KeyError" if\n      *key* is not in the map.\n\n      If a subclass of dict defines a method "__missing__()", if the\n      key *key* is not present, the "d[key]" operation calls that\n      method with the key *key* as argument.  The "d[key]" operation\n      then returns or raises whatever is returned or raised by the\n      "__missing__(key)" call if the key is not present. No other\n      operations or methods invoke "__missing__()". If "__missing__()"\n      is not defined, "KeyError" is raised. "__missing__()" must be a\n      method; it cannot be an instance variable:\n\n         >>> class Counter(dict):\n         ...     def __missing__(self, key):\n         ...         return 0\n         >>> c = Counter()\n         >>> c[\'red\']\n         0\n         >>> c[\'red\'] += 1\n         >>> c[\'red\']\n         1\n\n      See "collections.Counter" for a complete implementation\n      including other methods helpful for accumulating and managing\n      tallies.\n\n   d[key] = value\n\n      Set "d[key]" to *value*.\n\n   del d[key]\n\n      Remove "d[key]" from *d*.  Raises a "KeyError" if *key* is not\n      in the map.\n\n   key in d\n\n      Return "True" if *d* has a key *key*, else "False".\n\n   key not in d\n\n      Equivalent to "not key in d".\n\n   iter(d)\n\n      Return an iterator over the keys of the dictionary.  This is a\n      shortcut for "iter(d.keys())".\n\n   clear()\n\n      Remove all items from the dictionary.\n\n   copy()\n\n      Return a shallow copy of the dictionary.\n\n   classmethod fromkeys(seq[, value])\n\n      Create a new dictionary with keys from *seq* and values set to\n      *value*.\n\n      "fromkeys()" is a class method that returns a new dictionary.\n      *value* defaults to "None".\n\n   get(key[, default])\n\n      Return the value for *key* if *key* is in the dictionary, else\n      *default*. If *default* is not given, it defaults to "None", so\n      that this method never raises a "KeyError".\n\n   items()\n\n      Return a new view of the dictionary\'s items ("(key, value)"\n      pairs). See the *documentation of view objects*.\n\n   keys()\n\n      Return a new view of the dictionary\'s keys.  See the\n      *documentation of view objects*.\n\n   pop(key[, default])\n\n      If *key* is in the dictionary, remove it and return its value,\n      else return *default*.  If *default* is not given and *key* is\n      not in the dictionary, a "KeyError" is raised.\n\n   popitem()\n\n      Remove and return an arbitrary "(key, value)" pair from the\n      dictionary.\n\n      "popitem()" is useful to destructively iterate over a\n      dictionary, as often used in set algorithms.  If the dictionary\n      is empty, calling "popitem()" raises a "KeyError".\n\n   setdefault(key[, default])\n\n      If *key* is in the dictionary, return its value.  If not, insert\n      *key* with a value of *default* and return *default*.  *default*\n      defaults to "None".\n\n   update([other])\n\n      Update the dictionary with the key/value pairs from *other*,\n      overwriting existing keys.  Return "None".\n\n      "update()" accepts either another dictionary object or an\n      iterable of key/value pairs (as tuples or other iterables of\n      length two).  If keyword arguments are specified, the dictionary\n      is then updated with those key/value pairs: "d.update(red=1,\n      blue=2)".\n\n   values()\n\n      Return a new view of the dictionary\'s values.  See the\n      *documentation of view objects*.\n\nSee also: "types.MappingProxyType" can be used to create a read-only\n  view of a "dict".\n\n\nDictionary view objects\n=======================\n\nThe objects returned by "dict.keys()", "dict.values()" and\n"dict.items()" are *view objects*.  They provide a dynamic view on the\ndictionary\'s entries, which means that when the dictionary changes,\nthe view reflects these changes.\n\nDictionary views can be iterated over to yield their respective data,\nand support membership tests:\n\nlen(dictview)\n\n   Return the number of entries in the dictionary.\n\niter(dictview)\n\n   Return an iterator over the keys, values or items (represented as\n   tuples of "(key, value)") in the dictionary.\n\n   Keys and values are iterated over in an arbitrary order which is\n   non-random, varies across Python implementations, and depends on\n   the dictionary\'s history of insertions and deletions. If keys,\n   values and items views are iterated over with no intervening\n   modifications to the dictionary, the order of items will directly\n   correspond.  This allows the creation of "(value, key)" pairs using\n   "zip()": "pairs = zip(d.values(), d.keys())".  Another way to\n   create the same list is "pairs = [(v, k) for (k, v) in d.items()]".\n\n   Iterating views while adding or deleting entries in the dictionary\n   may raise a "RuntimeError" or fail to iterate over all entries.\n\nx in dictview\n\n   Return "True" if *x* is in the underlying dictionary\'s keys, values\n   or items (in the latter case, *x* should be a "(key, value)"\n   tuple).\n\nKeys views are set-like since their entries are unique and hashable.\nIf all values are hashable, so that "(key, value)" pairs are unique\nand hashable, then the items view is also set-like.  (Values views are\nnot treated as set-like since the entries are generally not unique.)\nFor set-like views, all of the operations defined for the abstract\nbase class "collections.abc.Set" are available (for example, "==",\n"<", or "^").\n\nAn example of dictionary view usage:\n\n   >>> dishes = {\'eggs\': 2, \'sausage\': 1, \'bacon\': 1, \'spam\': 500}\n   >>> keys = dishes.keys()\n   >>> values = dishes.values()\n\n   >>> # iteration\n   >>> n = 0\n   >>> for val in values:\n   ...     n += val\n   >>> print(n)\n   504\n\n   >>> # keys and values are iterated over in the same order\n   >>> list(keys)\n   [\'eggs\', \'bacon\', \'sausage\', \'spam\']\n   >>> list(values)\n   [2, 1, 1, 500]\n\n   >>> # view objects are dynamic and reflect dict changes\n   >>> del dishes[\'eggs\']\n   >>> del dishes[\'sausage\']\n   >>> list(keys)\n   [\'spam\', \'bacon\']\n\n   >>> # set operations\n   >>> keys & {\'eggs\', \'bacon\', \'salad\'}\n   {\'bacon\'}\n   >>> keys ^ {\'sausage\', \'juice\'}\n   {\'juice\', \'sausage\', \'bacon\', \'spam\'}\n',
  'typesmethods': '\nMethods\n*******\n\nMethods are functions that are called using the attribute notation.\nThere are two flavors: built-in methods (such as "append()" on lists)\nand class instance methods.  Built-in methods are described with the\ntypes that support them.\n\nIf you access a method (a function defined in a class namespace)\nthrough an instance, you get a special object: a *bound method* (also\ncalled *instance method*) object. When called, it will add the "self"\nargument to the argument list.  Bound methods have two special read-\nonly attributes: "m.__self__" is the object on which the method\noperates, and "m.__func__" is the function implementing the method.\nCalling "m(arg-1, arg-2, ..., arg-n)" is completely equivalent to\ncalling "m.__func__(m.__self__, arg-1, arg-2, ..., arg-n)".\n\nLike function objects, bound method objects support getting arbitrary\nattributes.  However, since method attributes are actually stored on\nthe underlying function object ("meth.__func__"), setting method\nattributes on bound methods is disallowed.  Attempting to set an\nattribute on a method results in an "AttributeError" being raised.  In\norder to set a method attribute, you need to explicitly set it on the\nunderlying function object:\n\n   >>> class C:\n   ...     def method(self):\n   ...         pass\n   ...\n   >>> c = C()\n   >>> c.method.whoami = \'my name is method\'  # can\'t set on the method\n   Traceback (most recent call last):\n     File "<stdin>", line 1, in <module>\n   AttributeError: \'method\' object has no attribute \'whoami\'\n   >>> c.method.__func__.whoami = \'my name is method\'\n   >>> c.method.whoami\n   \'my name is method\'\n\nSee *The standard type hierarchy* for more information.\n',
  'typesmodules': '\nModules\n*******\n\nThe only special operation on a module is attribute access: "m.name",\nwhere *m* is a module and *name* accesses a name defined in *m*\'s\nsymbol table. Module attributes can be assigned to.  (Note that the\n"import" statement is not, strictly speaking, an operation on a module\nobject; "import foo" does not require a module object named *foo* to\nexist, rather it requires an (external) *definition* for a module\nnamed *foo* somewhere.)\n\nA special attribute of every module is "__dict__". This is the\ndictionary containing the module\'s symbol table. Modifying this\ndictionary will actually change the module\'s symbol table, but direct\nassignment to the "__dict__" attribute is not possible (you can write\n"m.__dict__[\'a\'] = 1", which defines "m.a" to be "1", but you can\'t\nwrite "m.__dict__ = {}").  Modifying "__dict__" directly is not\nrecommended.\n\nModules built into the interpreter are written like this: "<module\n\'sys\' (built-in)>".  If loaded from a file, they are written as\n"<module \'os\' from \'/usr/local/lib/pythonX.Y/os.pyc\'>".\n',
- 'typesseq': '\nSequence Types --- "list", "tuple", "range"\n*******************************************\n\nThere are three basic sequence types: lists, tuples, and range\nobjects. Additional sequence types tailored for processing of *binary\ndata* and *text strings* are described in dedicated sections.\n\n\nCommon Sequence Operations\n==========================\n\nThe operations in the following table are supported by most sequence\ntypes, both mutable and immutable. The "collections.abc.Sequence" ABC\nis provided to make it easier to correctly implement these operations\non custom sequence types.\n\nThis table lists the sequence operations sorted in ascending priority\n(operations in the same box have the same priority).  In the table,\n*s* and *t* are sequences of the same type, *n*, *i*, *j* and *k* are\nintegers and *x* is an arbitrary object that meets any type and value\nrestrictions imposed by *s*.\n\nThe "in" and "not in" operations have the same priorities as the\ncomparison operations. The "+" (concatenation) and "*" (repetition)\noperations have the same priority as the corresponding numeric\noperations.\n\n+----------------------------+----------------------------------+------------+\n| Operation                  | Result                           | Notes      |\n+============================+==================================+============+\n| "x in s"                   | "True" if an item of *s* is      | (1)        |\n+----------------------------+----------------------------------+------------+\n| "x not in s"               | "False" if an item of *s* is     | (1)        |\n+----------------------------+----------------------------------+------------+\n| "s + t"                    | the concatenation of *s* and *t* | (6)(7)     |\n+----------------------------+----------------------------------+------------+\n| "s * n" or "n * s"         | *n* shallow copies of *s*        | (2)(7)     |\n+----------------------------+----------------------------------+------------+\n| "s[i]"                     | *i*th item of *s*, origin 0      | (3)        |\n+----------------------------+----------------------------------+------------+\n| "s[i:j]"                   | slice of *s* from *i* to *j*     | (3)(4)     |\n+----------------------------+----------------------------------+------------+\n| "s[i:j:k]"                 | slice of *s* from *i* to *j*     | (3)(5)     |\n+----------------------------+----------------------------------+------------+\n+----------------------------+----------------------------------+------------+\n+----------------------------+----------------------------------+------------+\n+----------------------------+----------------------------------+------------+\n| "s.index(x[, i[, j]])"     | index of the first occurrence of | (8)        |\n+----------------------------+----------------------------------+------------+\n+----------------------------+----------------------------------+------------+\n\nSequences of the same type also support comparisons.  In particular,\ntuples and lists are compared lexicographically by comparing\ncorresponding elements. This means that to compare equal, every\nelement must compare equal and the two sequences must be of the same\ntype and have the same length.  (For full details see *Comparisons* in\nthe language reference.)\n\nNotes:\n\n1. While the "in" and "not in" operations are used only for simple\n   containment testing in the general case, some specialised sequences\n   (such as "str", "bytes" and "bytearray") also use them for\n   subsequence testing:\n\n      >>> "gg" in "eggs"\n      True\n\n2. Values of *n* less than "0" are treated as "0" (which yields an\n   empty sequence of the same type as *s*).  Note also that the copies\n   are shallow; nested structures are not copied.  This often haunts\n   new Python programmers; consider:\n\n      >>> lists = [[]] * 3\n      >>> lists\n      [[], [], []]\n      >>> lists[0].append(3)\n      >>> lists\n      [[3], [3], [3]]\n\n   What has happened is that "[[]]" is a one-element list containing\n   an empty list, so all three elements of "[[]] * 3" are (pointers\n   to) this single empty list.  Modifying any of the elements of\n   "lists" modifies this single list. You can create a list of\n   different lists this way:\n\n      >>> lists = [[] for i in range(3)]\n      >>> lists[0].append(3)\n      >>> lists[1].append(5)\n      >>> lists[2].append(7)\n      >>> lists\n      [[3], [5], [7]]\n\n3. If *i* or *j* is negative, the index is relative to the end of\n   the string: "len(s) + i" or "len(s) + j" is substituted.  But note\n   that "-0" is still "0".\n\n4. The slice of *s* from *i* to *j* is defined as the sequence of\n   items with index *k* such that "i <= k < j".  If *i* or *j* is\n   greater than "len(s)", use "len(s)".  If *i* is omitted or "None",\n   use "0".  If *j* is omitted or "None", use "len(s)".  If *i* is\n   greater than or equal to *j*, the slice is empty.\n\n5. The slice of *s* from *i* to *j* with step *k* is defined as the\n   sequence of items with index  "x = i + n*k" such that "0 <= n <\n   (j-i)/k".  In other words, the indices are "i", "i+k", "i+2*k",\n   "i+3*k" and so on, stopping when *j* is reached (but never\n   including *j*).  If *i* or *j* is greater than "len(s)", use\n   "len(s)".  If *i* or *j* are omitted or "None", they become "end"\n   values (which end depends on the sign of *k*).  Note, *k* cannot be\n   zero. If *k* is "None", it is treated like "1".\n\n6. Concatenating immutable sequences always results in a new\n   object. This means that building up a sequence by repeated\n   concatenation will have a quadratic runtime cost in the total\n   sequence length. To get a linear runtime cost, you must switch to\n   one of the alternatives below:\n\n   * if concatenating "str" objects, you can build a list and use\n     "str.join()" at the end or else write to a "io.StringIO" instance\n     and retrieve its value when complete\n\n   * if concatenating "bytes" objects, you can similarly use\n     "bytes.join()" or "io.BytesIO", or you can do in-place\n     concatenation with a "bytearray" object.  "bytearray" objects are\n     mutable and have an efficient overallocation mechanism\n\n   * if concatenating "tuple" objects, extend a "list" instead\n\n   * for other types, investigate the relevant class documentation\n\n7. Some sequence types (such as "range") only support item\n   sequences that follow specific patterns, and hence don\'t support\n   sequence concatenation or repetition.\n\n8. "index" raises "ValueError" when *x* is not found in *s*. When\n   supported, the additional arguments to the index method allow\n   efficient searching of subsections of the sequence. Passing the\n   extra arguments is roughly equivalent to using "s[i:j].index(x)",\n   only without copying any data and with the returned index being\n   relative to the start of the sequence rather than the start of the\n   slice.\n\n\nImmutable Sequence Types\n========================\n\nThe only operation that immutable sequence types generally implement\nthat is not also implemented by mutable sequence types is support for\nthe "hash()" built-in.\n\nThis support allows immutable sequences, such as "tuple" instances, to\nbe used as "dict" keys and stored in "set" and "frozenset" instances.\n\nAttempting to hash an immutable sequence that contains unhashable\nvalues will result in "TypeError".\n\n\nMutable Sequence Types\n======================\n\nThe operations in the following table are defined on mutable sequence\ntypes. The "collections.abc.MutableSequence" ABC is provided to make\nit easier to correctly implement these operations on custom sequence\ntypes.\n\nIn the table *s* is an instance of a mutable sequence type, *t* is any\niterable object and *x* is an arbitrary object that meets any type and\nvalue restrictions imposed by *s* (for example, "bytearray" only\naccepts integers that meet the value restriction "0 <= x <= 255").\n\n+--------------------------------+----------------------------------+-----------------------+\n| Operation                      | Result                           | Notes                 |\n+================================+==================================+=======================+\n+--------------------------------+----------------------------------+-----------------------+\n+--------------------------------+----------------------------------+-----------------------+\n+--------------------------------+----------------------------------+-----------------------+\n| "s[i:j:k] = t"                 | the elements of "s[i:j:k]" are   | (1)                   |\n+--------------------------------+----------------------------------+-----------------------+\n+--------------------------------+----------------------------------+-----------------------+\n+--------------------------------+----------------------------------+-----------------------+\n| "s.clear()"                    | removes all items from "s" (same | (5)                   |\n+--------------------------------+----------------------------------+-----------------------+\n| "s.copy()"                     | creates a shallow copy of "s"    | (5)                   |\n+--------------------------------+----------------------------------+-----------------------+\n+--------------------------------+----------------------------------+-----------------------+\n+--------------------------------+----------------------------------+-----------------------+\n| "s.pop([i])"                   | retrieves the item at *i* and    | (2)                   |\n+--------------------------------+----------------------------------+-----------------------+\n| "s.remove(x)"                  | remove the first item from *s*   | (3)                   |\n+--------------------------------+----------------------------------+-----------------------+\n| "s.reverse()"                  | reverses the items of *s* in     | (4)                   |\n+--------------------------------+----------------------------------+-----------------------+\n\nNotes:\n\n1. *t* must have the same length as the slice it is replacing.\n\n2. The optional argument *i* defaults to "-1", so that by default\n   the last item is removed and returned.\n\n3. "remove" raises "ValueError" when *x* is not found in *s*.\n\n4. The "reverse()" method modifies the sequence in place for\n   economy of space when reversing a large sequence.  To remind users\n   that it operates by side effect, it does not return the reversed\n   sequence.\n\n5. "clear()" and "copy()" are included for consistency with the\n   interfaces of mutable containers that don\'t support slicing\n   operations (such as "dict" and "set")\n\n   New in version 3.3: "clear()" and "copy()" methods.\n\n\nLists\n=====\n\nLists are mutable sequences, typically used to store collections of\nhomogeneous items (where the precise degree of similarity will vary by\napplication).\n\nclass class list([iterable])\n\n   Lists may be constructed in several ways:\n\n   * Using a pair of square brackets to denote the empty list: "[]"\n\n   * Using square brackets, separating items with commas: "[a]",\n     "[a, b, c]"\n\n   * Using a list comprehension: "[x for x in iterable]"\n\n   * Using the type constructor: "list()" or "list(iterable)"\n\n   The constructor builds a list whose items are the same and in the\n   same order as *iterable*\'s items.  *iterable* may be either a\n   sequence, a container that supports iteration, or an iterator\n   object.  If *iterable* is already a list, a copy is made and\n   returned, similar to "iterable[:]". For example, "list(\'abc\')"\n   returns "[\'a\', \'b\', \'c\']" and "list( (1, 2, 3) )" returns "[1, 2,\n   3]". If no argument is given, the constructor creates a new empty\n   list, "[]".\n\n   Many other operations also produce lists, including the "sorted()"\n   built-in.\n\n   Lists implement all of the *common* and *mutable* sequence\n   operations. Lists also provide the following additional method:\n\n   sort(*, key=None, reverse=None)\n\n      This method sorts the list in place, using only "<" comparisons\n      between items. Exceptions are not suppressed - if any comparison\n      operations fail, the entire sort operation will fail (and the\n      list will likely be left in a partially modified state).\n\n      "sort()" accepts two arguments that can only be passed by\n      keyword (*keyword-only arguments*):\n\n      *key* specifies a function of one argument that is used to\n      extract a comparison key from each list element (for example,\n      "key=str.lower"). The key corresponding to each item in the list\n      is calculated once and then used for the entire sorting process.\n      The default value of "None" means that list items are sorted\n      directly without calculating a separate key value.\n\n      The "functools.cmp_to_key()" utility is available to convert a\n      2.x style *cmp* function to a *key* function.\n\n      *reverse* is a boolean value.  If set to "True", then the list\n      elements are sorted as if each comparison were reversed.\n\n      This method modifies the sequence in place for economy of space\n      when sorting a large sequence.  To remind users that it operates\n      by side effect, it does not return the sorted sequence (use\n      "sorted()" to explicitly request a new sorted list instance).\n\n      The "sort()" method is guaranteed to be stable.  A sort is\n      stable if it guarantees not to change the relative order of\n      elements that compare equal --- this is helpful for sorting in\n      multiple passes (for example, sort by department, then by salary\n      grade).\n\n      **CPython implementation detail:** While a list is being sorted,\n      the effect of attempting to mutate, or even inspect, the list is\n      undefined.  The C implementation of Python makes the list appear\n      empty for the duration, and raises "ValueError" if it can detect\n      that the list has been mutated during a sort.\n\n\nTuples\n======\n\nTuples are immutable sequences, typically used to store collections of\nheterogeneous data (such as the 2-tuples produced by the "enumerate()"\nbuilt-in). Tuples are also used for cases where an immutable sequence\nof homogeneous data is needed (such as allowing storage in a "set" or\n"dict" instance).\n\nclass class tuple([iterable])\n\n   Tuples may be constructed in a number of ways:\n\n   * Using a pair of parentheses to denote the empty tuple: "()"\n\n   * Using a trailing comma for a singleton tuple: "a," or "(a,)"\n\n   * Separating items with commas: "a, b, c" or "(a, b, c)"\n\n   * Using the "tuple()" built-in: "tuple()" or "tuple(iterable)"\n\n   The constructor builds a tuple whose items are the same and in the\n   same order as *iterable*\'s items.  *iterable* may be either a\n   sequence, a container that supports iteration, or an iterator\n   object.  If *iterable* is already a tuple, it is returned\n   unchanged. For example, "tuple(\'abc\')" returns "(\'a\', \'b\', \'c\')"\n   and "tuple( [1, 2, 3] )" returns "(1, 2, 3)". If no argument is\n   given, the constructor creates a new empty tuple, "()".\n\n   Note that it is actually the comma which makes a tuple, not the\n   parentheses. The parentheses are optional, except in the empty\n   tuple case, or when they are needed to avoid syntactic ambiguity.\n   For example, "f(a, b, c)" is a function call with three arguments,\n   while "f((a, b, c))" is a function call with a 3-tuple as the sole\n   argument.\n\n   Tuples implement all of the *common* sequence operations.\n\nFor heterogeneous collections of data where access by name is clearer\nthan access by index, "collections.namedtuple()" may be a more\nappropriate choice than a simple tuple object.\n\n\nRanges\n======\n\nThe "range" type represents an immutable sequence of numbers and is\ncommonly used for looping a specific number of times in "for" loops.\n\nclass class range(stop)\nclass class range(start, stop[, step])\n\n   The arguments to the range constructor must be integers (either\n   built-in "int" or any object that implements the "__index__"\n   special method).  If the *step* argument is omitted, it defaults to\n   "1". If the *start* argument is omitted, it defaults to "0". If\n   *step* is zero, "ValueError" is raised.\n\n   For a positive *step*, the contents of a range "r" are determined\n   by the formula "r[i] = start + step*i" where "i >= 0" and "r[i] <\n   stop".\n\n   For a negative *step*, the contents of the range are still\n   determined by the formula "r[i] = start + step*i", but the\n   constraints are "i >= 0" and "r[i] > stop".\n\n   A range object will be empty if "r[0]" does not meet the value\n   constraint. Ranges do support negative indices, but these are\n   interpreted as indexing from the end of the sequence determined by\n   the positive indices.\n\n   Ranges containing absolute values larger than "sys.maxsize" are\n   permitted but some features (such as "len()") may raise\n   "OverflowError".\n\n   Range examples:\n\n      >>> list(range(10))\n      [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n      >>> list(range(1, 11))\n      [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n      >>> list(range(0, 30, 5))\n      [0, 5, 10, 15, 20, 25]\n      >>> list(range(0, 10, 3))\n      [0, 3, 6, 9]\n      >>> list(range(0, -10, -1))\n      [0, -1, -2, -3, -4, -5, -6, -7, -8, -9]\n      >>> list(range(0))\n      []\n      >>> list(range(1, 0))\n      []\n\n   Ranges implement all of the *common* sequence operations except\n   concatenation and repetition (due to the fact that range objects\n   can only represent sequences that follow a strict pattern and\n   repetition and concatenation will usually violate that pattern).\n\nThe advantage of the "range" type over a regular "list" or "tuple" is\nthat a "range" object will always take the same (small) amount of\nmemory, no matter the size of the range it represents (as it only\nstores the "start", "stop" and "step" values, calculating individual\nitems and subranges as needed).\n\nRange objects implement the "collections.abc.Sequence" ABC, and\nprovide features such as containment tests, element index lookup,\nslicing and support for negative indices (see *Sequence Types ---\nlist, tuple, range*):\n\n>>> r = range(0, 20, 2)\n>>> r\nrange(0, 20, 2)\n>>> 11 in r\nFalse\n>>> 10 in r\nTrue\n>>> r.index(10)\n5\n>>> r[5]\n10\n>>> r[:5]\nrange(0, 10, 2)\n>>> r[-1]\n18\n\nTesting range objects for equality with "==" and "!=" compares them as\nsequences.  That is, two range objects are considered equal if they\nrepresent the same sequence of values.  (Note that two range objects\nthat compare equal might have different "start", "stop" and "step"\nattributes, for example "range(0) == range(2, 1, 3)" or "range(0, 3,\n2) == range(0, 4, 2)".)\n\nChanged in version 3.2: Implement the Sequence ABC. Support slicing\nand negative indices. Test "int" objects for membership in constant\ntime instead of iterating through all items.\n\nChanged in version 3.3: Define \'==\' and \'!=\' to compare range objects\nbased on the sequence of values they define (instead of comparing\nbased on object identity).\n\nNew in version 3.3: The "start", "stop" and "step" attributes.\n',
- 'typesseq-mutable': '\nMutable Sequence Types\n**********************\n\nThe operations in the following table are defined on mutable sequence\ntypes. The "collections.abc.MutableSequence" ABC is provided to make\nit easier to correctly implement these operations on custom sequence\ntypes.\n\nIn the table *s* is an instance of a mutable sequence type, *t* is any\niterable object and *x* is an arbitrary object that meets any type and\nvalue restrictions imposed by *s* (for example, "bytearray" only\naccepts integers that meet the value restriction "0 <= x <= 255").\n\n+--------------------------------+----------------------------------+-----------------------+\n| Operation                      | Result                           | Notes                 |\n+================================+==================================+=======================+\n+--------------------------------+----------------------------------+-----------------------+\n+--------------------------------+----------------------------------+-----------------------+\n+--------------------------------+----------------------------------+-----------------------+\n| "s[i:j:k] = t"                 | the elements of "s[i:j:k]" are   | (1)                   |\n+--------------------------------+----------------------------------+-----------------------+\n+--------------------------------+----------------------------------+-----------------------+\n+--------------------------------+----------------------------------+-----------------------+\n| "s.clear()"                    | removes all items from "s" (same | (5)                   |\n+--------------------------------+----------------------------------+-----------------------+\n| "s.copy()"                     | creates a shallow copy of "s"    | (5)                   |\n+--------------------------------+----------------------------------+-----------------------+\n+--------------------------------+----------------------------------+-----------------------+\n+--------------------------------+----------------------------------+-----------------------+\n| "s.pop([i])"                   | retrieves the item at *i* and    | (2)                   |\n+--------------------------------+----------------------------------+-----------------------+\n| "s.remove(x)"                  | remove the first item from *s*   | (3)                   |\n+--------------------------------+----------------------------------+-----------------------+\n| "s.reverse()"                  | reverses the items of *s* in     | (4)                   |\n+--------------------------------+----------------------------------+-----------------------+\n\nNotes:\n\n1. *t* must have the same length as the slice it is replacing.\n\n2. The optional argument *i* defaults to "-1", so that by default\n   the last item is removed and returned.\n\n3. "remove" raises "ValueError" when *x* is not found in *s*.\n\n4. The "reverse()" method modifies the sequence in place for\n   economy of space when reversing a large sequence.  To remind users\n   that it operates by side effect, it does not return the reversed\n   sequence.\n\n5. "clear()" and "copy()" are included for consistency with the\n   interfaces of mutable containers that don\'t support slicing\n   operations (such as "dict" and "set")\n\n   New in version 3.3: "clear()" and "copy()" methods.\n',
+ 'typesseq': '\nSequence Types --- "list", "tuple", "range"\n*******************************************\n\nThere are three basic sequence types: lists, tuples, and range\nobjects. Additional sequence types tailored for processing of *binary\ndata* and *text strings* are described in dedicated sections.\n\n\nCommon Sequence Operations\n==========================\n\nThe operations in the following table are supported by most sequence\ntypes, both mutable and immutable. The "collections.abc.Sequence" ABC\nis provided to make it easier to correctly implement these operations\non custom sequence types.\n\nThis table lists the sequence operations sorted in ascending priority\n(operations in the same box have the same priority).  In the table,\n*s* and *t* are sequences of the same type, *n*, *i*, *j* and *k* are\nintegers and *x* is an arbitrary object that meets any type and value\nrestrictions imposed by *s*.\n\nThe "in" and "not in" operations have the same priorities as the\ncomparison operations. The "+" (concatenation) and "*" (repetition)\noperations have the same priority as the corresponding numeric\noperations.\n\n+----------------------------+----------------------------------+------------+\n| Operation                  | Result                           | Notes      |\n+============================+==================================+============+\n| "x in s"                   | "True" if an item of *s* is      | (1)        |\n|                            | equal to *x*, else "False"       |            |\n+----------------------------+----------------------------------+------------+\n| "x not in s"               | "False" if an item of *s* is     | (1)        |\n|                            | equal to *x*, else "True"        |            |\n+----------------------------+----------------------------------+------------+\n| "s + t"                    | the concatenation of *s* and *t* | (6)(7)     |\n+----------------------------+----------------------------------+------------+\n| "s * n" or "n * s"         | *n* shallow copies of *s*        | (2)(7)     |\n|                            | concatenated                     |            |\n+----------------------------+----------------------------------+------------+\n| "s[i]"                     | *i*th item of *s*, origin 0      | (3)        |\n+----------------------------+----------------------------------+------------+\n| "s[i:j]"                   | slice of *s* from *i* to *j*     | (3)(4)     |\n+----------------------------+----------------------------------+------------+\n| "s[i:j:k]"                 | slice of *s* from *i* to *j*     | (3)(5)     |\n|                            | with step *k*                    |            |\n+----------------------------+----------------------------------+------------+\n| "len(s)"                   | length of *s*                    |            |\n+----------------------------+----------------------------------+------------+\n| "min(s)"                   | smallest item of *s*             |            |\n+----------------------------+----------------------------------+------------+\n| "max(s)"                   | largest item of *s*              |            |\n+----------------------------+----------------------------------+------------+\n| "s.index(x[, i[, j]])"     | index of the first occurrence of | (8)        |\n|                            | *x* in *s* (at or after index    |            |\n|                            | *i* and before index *j*)        |            |\n+----------------------------+----------------------------------+------------+\n| "s.count(x)"               | total number of occurrences of   |            |\n|                            | *x* in *s*                       |            |\n+----------------------------+----------------------------------+------------+\n\nSequences of the same type also support comparisons.  In particular,\ntuples and lists are compared lexicographically by comparing\ncorresponding elements. This means that to compare equal, every\nelement must compare equal and the two sequences must be of the same\ntype and have the same length.  (For full details see *Comparisons* in\nthe language reference.)\n\nNotes:\n\n1. While the "in" and "not in" operations are used only for simple\n   containment testing in the general case, some specialised sequences\n   (such as "str", "bytes" and "bytearray") also use them for\n   subsequence testing:\n\n      >>> "gg" in "eggs"\n      True\n\n2. Values of *n* less than "0" are treated as "0" (which yields an\n   empty sequence of the same type as *s*).  Note also that the copies\n   are shallow; nested structures are not copied.  This often haunts\n   new Python programmers; consider:\n\n      >>> lists = [[]] * 3\n      >>> lists\n      [[], [], []]\n      >>> lists[0].append(3)\n      >>> lists\n      [[3], [3], [3]]\n\n   What has happened is that "[[]]" is a one-element list containing\n   an empty list, so all three elements of "[[]] * 3" are (pointers\n   to) this single empty list.  Modifying any of the elements of\n   "lists" modifies this single list. You can create a list of\n   different lists this way:\n\n      >>> lists = [[] for i in range(3)]\n      >>> lists[0].append(3)\n      >>> lists[1].append(5)\n      >>> lists[2].append(7)\n      >>> lists\n      [[3], [5], [7]]\n\n3. If *i* or *j* is negative, the index is relative to the end of\n   the string: "len(s) + i" or "len(s) + j" is substituted.  But note\n   that "-0" is still "0".\n\n4. The slice of *s* from *i* to *j* is defined as the sequence of\n   items with index *k* such that "i <= k < j".  If *i* or *j* is\n   greater than "len(s)", use "len(s)".  If *i* is omitted or "None",\n   use "0".  If *j* is omitted or "None", use "len(s)".  If *i* is\n   greater than or equal to *j*, the slice is empty.\n\n5. The slice of *s* from *i* to *j* with step *k* is defined as the\n   sequence of items with index  "x = i + n*k" such that "0 <= n <\n   (j-i)/k".  In other words, the indices are "i", "i+k", "i+2*k",\n   "i+3*k" and so on, stopping when *j* is reached (but never\n   including *j*).  If *i* or *j* is greater than "len(s)", use\n   "len(s)".  If *i* or *j* are omitted or "None", they become "end"\n   values (which end depends on the sign of *k*).  Note, *k* cannot be\n   zero. If *k* is "None", it is treated like "1".\n\n6. Concatenating immutable sequences always results in a new\n   object. This means that building up a sequence by repeated\n   concatenation will have a quadratic runtime cost in the total\n   sequence length. To get a linear runtime cost, you must switch to\n   one of the alternatives below:\n\n   * if concatenating "str" objects, you can build a list and use\n     "str.join()" at the end or else write to a "io.StringIO" instance\n     and retrieve its value when complete\n\n   * if concatenating "bytes" objects, you can similarly use\n     "bytes.join()" or "io.BytesIO", or you can do in-place\n     concatenation with a "bytearray" object.  "bytearray" objects are\n     mutable and have an efficient overallocation mechanism\n\n   * if concatenating "tuple" objects, extend a "list" instead\n\n   * for other types, investigate the relevant class documentation\n\n7. Some sequence types (such as "range") only support item\n   sequences that follow specific patterns, and hence don\'t support\n   sequence concatenation or repetition.\n\n8. "index" raises "ValueError" when *x* is not found in *s*. When\n   supported, the additional arguments to the index method allow\n   efficient searching of subsections of the sequence. Passing the\n   extra arguments is roughly equivalent to using "s[i:j].index(x)",\n   only without copying any data and with the returned index being\n   relative to the start of the sequence rather than the start of the\n   slice.\n\n\nImmutable Sequence Types\n========================\n\nThe only operation that immutable sequence types generally implement\nthat is not also implemented by mutable sequence types is support for\nthe "hash()" built-in.\n\nThis support allows immutable sequences, such as "tuple" instances, to\nbe used as "dict" keys and stored in "set" and "frozenset" instances.\n\nAttempting to hash an immutable sequence that contains unhashable\nvalues will result in "TypeError".\n\n\nMutable Sequence Types\n======================\n\nThe operations in the following table are defined on mutable sequence\ntypes. The "collections.abc.MutableSequence" ABC is provided to make\nit easier to correctly implement these operations on custom sequence\ntypes.\n\nIn the table *s* is an instance of a mutable sequence type, *t* is any\niterable object and *x* is an arbitrary object that meets any type and\nvalue restrictions imposed by *s* (for example, "bytearray" only\naccepts integers that meet the value restriction "0 <= x <= 255").\n\n+--------------------------------+----------------------------------+-----------------------+\n| Operation                      | Result                           | Notes                 |\n+================================+==================================+=======================+\n| "s[i] = x"                     | item *i* of *s* is replaced by   |                       |\n|                                | *x*                              |                       |\n+--------------------------------+----------------------------------+-----------------------+\n| "s[i:j] = t"                   | slice of *s* from *i* to *j* is  |                       |\n|                                | replaced by the contents of the  |                       |\n|                                | iterable *t*                     |                       |\n+--------------------------------+----------------------------------+-----------------------+\n| "del s[i:j]"                   | same as "s[i:j] = []"            |                       |\n+--------------------------------+----------------------------------+-----------------------+\n| "s[i:j:k] = t"                 | the elements of "s[i:j:k]" are   | (1)                   |\n|                                | replaced by those of *t*         |                       |\n+--------------------------------+----------------------------------+-----------------------+\n| "del s[i:j:k]"                 | removes the elements of          |                       |\n|                                | "s[i:j:k]" from the list         |                       |\n+--------------------------------+----------------------------------+-----------------------+\n| "s.append(x)"                  | appends *x* to the end of the    |                       |\n|                                | sequence (same as                |                       |\n|                                | "s[len(s):len(s)] = [x]")        |                       |\n+--------------------------------+----------------------------------+-----------------------+\n| "s.clear()"                    | removes all items from "s" (same | (5)                   |\n|                                | as "del s[:]")                   |                       |\n+--------------------------------+----------------------------------+-----------------------+\n| "s.copy()"                     | creates a shallow copy of "s"    | (5)                   |\n|                                | (same as "s[:]")                 |                       |\n+--------------------------------+----------------------------------+-----------------------+\n| "s.extend(t)"                  | extends *s* with the contents of |                       |\n|                                | *t* (same as "s[len(s):len(s)] = |                       |\n|                                | t")                              |                       |\n+--------------------------------+----------------------------------+-----------------------+\n| "s.insert(i, x)"               | inserts *x* into *s* at the      |                       |\n|                                | index given by *i* (same as      |                       |\n|                                | "s[i:i] = [x]")                  |                       |\n+--------------------------------+----------------------------------+-----------------------+\n| "s.pop([i])"                   | retrieves the item at *i* and    | (2)                   |\n|                                | also removes it from *s*         |                       |\n+--------------------------------+----------------------------------+-----------------------+\n| "s.remove(x)"                  | remove the first item from *s*   | (3)                   |\n|                                | where "s[i] == x"                |                       |\n+--------------------------------+----------------------------------+-----------------------+\n| "s.reverse()"                  | reverses the items of *s* in     | (4)                   |\n|                                | place                            |                       |\n+--------------------------------+----------------------------------+-----------------------+\n\nNotes:\n\n1. *t* must have the same length as the slice it is replacing.\n\n2. The optional argument *i* defaults to "-1", so that by default\n   the last item is removed and returned.\n\n3. "remove" raises "ValueError" when *x* is not found in *s*.\n\n4. The "reverse()" method modifies the sequence in place for\n   economy of space when reversing a large sequence.  To remind users\n   that it operates by side effect, it does not return the reversed\n   sequence.\n\n5. "clear()" and "copy()" are included for consistency with the\n   interfaces of mutable containers that don\'t support slicing\n   operations (such as "dict" and "set")\n\n   New in version 3.3: "clear()" and "copy()" methods.\n\n\nLists\n=====\n\nLists are mutable sequences, typically used to store collections of\nhomogeneous items (where the precise degree of similarity will vary by\napplication).\n\nclass class list([iterable])\n\n   Lists may be constructed in several ways:\n\n   * Using a pair of square brackets to denote the empty list: "[]"\n\n   * Using square brackets, separating items with commas: "[a]",\n     "[a, b, c]"\n\n   * Using a list comprehension: "[x for x in iterable]"\n\n   * Using the type constructor: "list()" or "list(iterable)"\n\n   The constructor builds a list whose items are the same and in the\n   same order as *iterable*\'s items.  *iterable* may be either a\n   sequence, a container that supports iteration, or an iterator\n   object.  If *iterable* is already a list, a copy is made and\n   returned, similar to "iterable[:]". For example, "list(\'abc\')"\n   returns "[\'a\', \'b\', \'c\']" and "list( (1, 2, 3) )" returns "[1, 2,\n   3]". If no argument is given, the constructor creates a new empty\n   list, "[]".\n\n   Many other operations also produce lists, including the "sorted()"\n   built-in.\n\n   Lists implement all of the *common* and *mutable* sequence\n   operations. Lists also provide the following additional method:\n\n   sort(*, key=None, reverse=None)\n\n      This method sorts the list in place, using only "<" comparisons\n      between items. Exceptions are not suppressed - if any comparison\n      operations fail, the entire sort operation will fail (and the\n      list will likely be left in a partially modified state).\n\n      "sort()" accepts two arguments that can only be passed by\n      keyword (*keyword-only arguments*):\n\n      *key* specifies a function of one argument that is used to\n      extract a comparison key from each list element (for example,\n      "key=str.lower"). The key corresponding to each item in the list\n      is calculated once and then used for the entire sorting process.\n      The default value of "None" means that list items are sorted\n      directly without calculating a separate key value.\n\n      The "functools.cmp_to_key()" utility is available to convert a\n      2.x style *cmp* function to a *key* function.\n\n      *reverse* is a boolean value.  If set to "True", then the list\n      elements are sorted as if each comparison were reversed.\n\n      This method modifies the sequence in place for economy of space\n      when sorting a large sequence.  To remind users that it operates\n      by side effect, it does not return the sorted sequence (use\n      "sorted()" to explicitly request a new sorted list instance).\n\n      The "sort()" method is guaranteed to be stable.  A sort is\n      stable if it guarantees not to change the relative order of\n      elements that compare equal --- this is helpful for sorting in\n      multiple passes (for example, sort by department, then by salary\n      grade).\n\n      **CPython implementation detail:** While a list is being sorted,\n      the effect of attempting to mutate, or even inspect, the list is\n      undefined.  The C implementation of Python makes the list appear\n      empty for the duration, and raises "ValueError" if it can detect\n      that the list has been mutated during a sort.\n\n\nTuples\n======\n\nTuples are immutable sequences, typically used to store collections of\nheterogeneous data (such as the 2-tuples produced by the "enumerate()"\nbuilt-in). Tuples are also used for cases where an immutable sequence\nof homogeneous data is needed (such as allowing storage in a "set" or\n"dict" instance).\n\nclass class tuple([iterable])\n\n   Tuples may be constructed in a number of ways:\n\n   * Using a pair of parentheses to denote the empty tuple: "()"\n\n   * Using a trailing comma for a singleton tuple: "a," or "(a,)"\n\n   * Separating items with commas: "a, b, c" or "(a, b, c)"\n\n   * Using the "tuple()" built-in: "tuple()" or "tuple(iterable)"\n\n   The constructor builds a tuple whose items are the same and in the\n   same order as *iterable*\'s items.  *iterable* may be either a\n   sequence, a container that supports iteration, or an iterator\n   object.  If *iterable* is already a tuple, it is returned\n   unchanged. For example, "tuple(\'abc\')" returns "(\'a\', \'b\', \'c\')"\n   and "tuple( [1, 2, 3] )" returns "(1, 2, 3)". If no argument is\n   given, the constructor creates a new empty tuple, "()".\n\n   Note that it is actually the comma which makes a tuple, not the\n   parentheses. The parentheses are optional, except in the empty\n   tuple case, or when they are needed to avoid syntactic ambiguity.\n   For example, "f(a, b, c)" is a function call with three arguments,\n   while "f((a, b, c))" is a function call with a 3-tuple as the sole\n   argument.\n\n   Tuples implement all of the *common* sequence operations.\n\nFor heterogeneous collections of data where access by name is clearer\nthan access by index, "collections.namedtuple()" may be a more\nappropriate choice than a simple tuple object.\n\n\nRanges\n======\n\nThe "range" type represents an immutable sequence of numbers and is\ncommonly used for looping a specific number of times in "for" loops.\n\nclass class range(stop)\nclass class range(start, stop[, step])\n\n   The arguments to the range constructor must be integers (either\n   built-in "int" or any object that implements the "__index__"\n   special method).  If the *step* argument is omitted, it defaults to\n   "1". If the *start* argument is omitted, it defaults to "0". If\n   *step* is zero, "ValueError" is raised.\n\n   For a positive *step*, the contents of a range "r" are determined\n   by the formula "r[i] = start + step*i" where "i >= 0" and "r[i] <\n   stop".\n\n   For a negative *step*, the contents of the range are still\n   determined by the formula "r[i] = start + step*i", but the\n   constraints are "i >= 0" and "r[i] > stop".\n\n   A range object will be empty if "r[0]" does not meet the value\n   constraint. Ranges do support negative indices, but these are\n   interpreted as indexing from the end of the sequence determined by\n   the positive indices.\n\n   Ranges containing absolute values larger than "sys.maxsize" are\n   permitted but some features (such as "len()") may raise\n   "OverflowError".\n\n   Range examples:\n\n      >>> list(range(10))\n      [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n      >>> list(range(1, 11))\n      [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n      >>> list(range(0, 30, 5))\n      [0, 5, 10, 15, 20, 25]\n      >>> list(range(0, 10, 3))\n      [0, 3, 6, 9]\n      >>> list(range(0, -10, -1))\n      [0, -1, -2, -3, -4, -5, -6, -7, -8, -9]\n      >>> list(range(0))\n      []\n      >>> list(range(1, 0))\n      []\n\n   Ranges implement all of the *common* sequence operations except\n   concatenation and repetition (due to the fact that range objects\n   can only represent sequences that follow a strict pattern and\n   repetition and concatenation will usually violate that pattern).\n\nThe advantage of the "range" type over a regular "list" or "tuple" is\nthat a "range" object will always take the same (small) amount of\nmemory, no matter the size of the range it represents (as it only\nstores the "start", "stop" and "step" values, calculating individual\nitems and subranges as needed).\n\nRange objects implement the "collections.abc.Sequence" ABC, and\nprovide features such as containment tests, element index lookup,\nslicing and support for negative indices (see *Sequence Types ---\nlist, tuple, range*):\n\n>>> r = range(0, 20, 2)\n>>> r\nrange(0, 20, 2)\n>>> 11 in r\nFalse\n>>> 10 in r\nTrue\n>>> r.index(10)\n5\n>>> r[5]\n10\n>>> r[:5]\nrange(0, 10, 2)\n>>> r[-1]\n18\n\nTesting range objects for equality with "==" and "!=" compares them as\nsequences.  That is, two range objects are considered equal if they\nrepresent the same sequence of values.  (Note that two range objects\nthat compare equal might have different "start", "stop" and "step"\nattributes, for example "range(0) == range(2, 1, 3)" or "range(0, 3,\n2) == range(0, 4, 2)".)\n\nChanged in version 3.2: Implement the Sequence ABC. Support slicing\nand negative indices. Test "int" objects for membership in constant\ntime instead of iterating through all items.\n\nChanged in version 3.3: Define \'==\' and \'!=\' to compare range objects\nbased on the sequence of values they define (instead of comparing\nbased on object identity).\n\nNew in version 3.3: The "start", "stop" and "step" attributes.\n',
+ 'typesseq-mutable': '\nMutable Sequence Types\n**********************\n\nThe operations in the following table are defined on mutable sequence\ntypes. The "collections.abc.MutableSequence" ABC is provided to make\nit easier to correctly implement these operations on custom sequence\ntypes.\n\nIn the table *s* is an instance of a mutable sequence type, *t* is any\niterable object and *x* is an arbitrary object that meets any type and\nvalue restrictions imposed by *s* (for example, "bytearray" only\naccepts integers that meet the value restriction "0 <= x <= 255").\n\n+--------------------------------+----------------------------------+-----------------------+\n| Operation                      | Result                           | Notes                 |\n+================================+==================================+=======================+\n| "s[i] = x"                     | item *i* of *s* is replaced by   |                       |\n|                                | *x*                              |                       |\n+--------------------------------+----------------------------------+-----------------------+\n| "s[i:j] = t"                   | slice of *s* from *i* to *j* is  |                       |\n|                                | replaced by the contents of the  |                       |\n|                                | iterable *t*                     |                       |\n+--------------------------------+----------------------------------+-----------------------+\n| "del s[i:j]"                   | same as "s[i:j] = []"            |                       |\n+--------------------------------+----------------------------------+-----------------------+\n| "s[i:j:k] = t"                 | the elements of "s[i:j:k]" are   | (1)                   |\n|                                | replaced by those of *t*         |                       |\n+--------------------------------+----------------------------------+-----------------------+\n| "del s[i:j:k]"                 | removes the elements of          |                       |\n|                                | "s[i:j:k]" from the list         |                       |\n+--------------------------------+----------------------------------+-----------------------+\n| "s.append(x)"                  | appends *x* to the end of the    |                       |\n|                                | sequence (same as                |                       |\n|                                | "s[len(s):len(s)] = [x]")        |                       |\n+--------------------------------+----------------------------------+-----------------------+\n| "s.clear()"                    | removes all items from "s" (same | (5)                   |\n|                                | as "del s[:]")                   |                       |\n+--------------------------------+----------------------------------+-----------------------+\n| "s.copy()"                     | creates a shallow copy of "s"    | (5)                   |\n|                                | (same as "s[:]")                 |                       |\n+--------------------------------+----------------------------------+-----------------------+\n| "s.extend(t)"                  | extends *s* with the contents of |                       |\n|                                | *t* (same as "s[len(s):len(s)] = |                       |\n|                                | t")                              |                       |\n+--------------------------------+----------------------------------+-----------------------+\n| "s.insert(i, x)"               | inserts *x* into *s* at the      |                       |\n|                                | index given by *i* (same as      |                       |\n|                                | "s[i:i] = [x]")                  |                       |\n+--------------------------------+----------------------------------+-----------------------+\n| "s.pop([i])"                   | retrieves the item at *i* and    | (2)                   |\n|                                | also removes it from *s*         |                       |\n+--------------------------------+----------------------------------+-----------------------+\n| "s.remove(x)"                  | remove the first item from *s*   | (3)                   |\n|                                | where "s[i] == x"                |                       |\n+--------------------------------+----------------------------------+-----------------------+\n| "s.reverse()"                  | reverses the items of *s* in     | (4)                   |\n|                                | place                            |                       |\n+--------------------------------+----------------------------------+-----------------------+\n\nNotes:\n\n1. *t* must have the same length as the slice it is replacing.\n\n2. The optional argument *i* defaults to "-1", so that by default\n   the last item is removed and returned.\n\n3. "remove" raises "ValueError" when *x* is not found in *s*.\n\n4. The "reverse()" method modifies the sequence in place for\n   economy of space when reversing a large sequence.  To remind users\n   that it operates by side effect, it does not return the reversed\n   sequence.\n\n5. "clear()" and "copy()" are included for consistency with the\n   interfaces of mutable containers that don\'t support slicing\n   operations (such as "dict" and "set")\n\n   New in version 3.3: "clear()" and "copy()" methods.\n',
  'unary': '\nUnary arithmetic and bitwise operations\n***************************************\n\nAll unary arithmetic and bitwise operations have the same priority:\n\n   u_expr ::= power | "-" u_expr | "+" u_expr | "~" u_expr\n\nThe unary "-" (minus) operator yields the negation of its numeric\nargument.\n\nThe unary "+" (plus) operator yields its numeric argument unchanged.\n\nThe unary "~" (invert) operator yields the bitwise inversion of its\ninteger argument.  The bitwise inversion of "x" is defined as\n"-(x+1)".  It only applies to integral numbers.\n\nIn all three cases, if the argument does not have the proper type, a\n"TypeError" exception is raised.\n',
  'while': '\nThe "while" statement\n*********************\n\nThe "while" statement is used for repeated execution as long as an\nexpression is true:\n\n   while_stmt ::= "while" expression ":" suite\n                  ["else" ":" suite]\n\nThis repeatedly tests the expression and, if it is true, executes the\nfirst suite; if the expression is false (which may be the first time\nit is tested) the suite of the "else" clause, if present, is executed\nand the loop terminates.\n\nA "break" statement executed in the first suite terminates the loop\nwithout executing the "else" clause\'s suite.  A "continue" statement\nexecuted in the first suite skips the rest of the suite and goes back\nto testing the expression.\n',
  'with': '\nThe "with" statement\n********************\n\nThe "with" statement is used to wrap the execution of a block with\nmethods defined by a context manager (see section *With Statement\nContext Managers*). This allows common "try"..."except"..."finally"\nusage patterns to be encapsulated for convenient reuse.\n\n   with_stmt ::= "with" with_item ("," with_item)* ":" suite\n   with_item ::= expression ["as" target]\n\nThe execution of the "with" statement with one "item" proceeds as\nfollows:\n\n1. The context expression (the expression given in the "with_item")\n   is evaluated to obtain a context manager.\n\n2. The context manager\'s "__exit__()" is loaded for later use.\n\n3. The context manager\'s "__enter__()" method is invoked.\n\n4. If a target was included in the "with" statement, the return\n   value from "__enter__()" is assigned to it.\n\n   Note: The "with" statement guarantees that if the "__enter__()"\n     method returns without an error, then "__exit__()" will always be\n     called. Thus, if an error occurs during the assignment to the\n     target list, it will be treated the same as an error occurring\n     within the suite would be. See step 6 below.\n\n5. The suite is executed.\n\n6. The context manager\'s "__exit__()" method is invoked.  If an\n   exception caused the suite to be exited, its type, value, and\n   traceback are passed as arguments to "__exit__()". Otherwise, three\n   "None" arguments are supplied.\n\n   If the suite was exited due to an exception, and the return value\n   from the "__exit__()" method was false, the exception is reraised.\n   If the return value was true, the exception is suppressed, and\n   execution continues with the statement following the "with"\n   statement.\n\n   If the suite was exited for any reason other than an exception, the\n   return value from "__exit__()" is ignored, and execution proceeds\n   at the normal location for the kind of exit that was taken.\n\nWith more than one item, the context managers are processed as if\nmultiple "with" statements were nested:\n\n   with A() as a, B() as b:\n       suite\n\nis equivalent to\n\n   with A() as a:\n       with B() as b:\n           suite\n\nChanged in version 3.1: Support for multiple context expressions.\n\nSee also: **PEP 0343** - The "with" statement\n\n     The specification, background, and examples for the Python "with"\n     statement.\n',
diff --git a/Lib/quopri.py b/Lib/quopri.py
index 3d0f0ac..46c2a4c 100755
--- a/Lib/quopri.py
+++ b/Lib/quopri.py
@@ -44,13 +44,11 @@
 def encode(input, output, quotetabs, header=False):
     """Read 'input', apply quoted-printable encoding, and write to 'output'.
 
-    'input' and 'output' are files with readline() and write() methods.
-    The 'quotetabs' flag indicates whether embedded tabs and spaces should be
-    quoted.  Note that line-ending tabs and spaces are always encoded, as per
-    RFC 1521.
-    The 'header' flag indicates whether we are encoding spaces as _ as per
-    RFC 1522.
-    """
+    'input' and 'output' are binary file objects. The 'quotetabs' flag
+    indicates whether embedded tabs and spaces should be quoted. Note that
+    line-ending tabs and spaces are always encoded, as per RFC 1521.
+    The 'header' flag indicates whether we are encoding spaces as _ as per RFC
+    1522."""
 
     if b2a_qp is not None:
         data = input.read()
@@ -118,7 +116,7 @@
 
 def decode(input, output, header=False):
     """Read 'input', apply quoted-printable decoding, and write to 'output'.
-    'input' and 'output' are files with readline() and write() methods.
+    'input' and 'output' are binary file objects.
     If 'header' is true, decode underscore as space (per RFC 1522)."""
 
     if a2b_qp is not None:
@@ -223,7 +221,7 @@
         else:
             try:
                 fp = open(file, "rb")
-            except IOError as msg:
+            except OSError as msg:
                 sys.stderr.write("%s: can't open (%s)\n" % (file, msg))
                 sts = 1
                 continue
diff --git a/Lib/random.py b/Lib/random.py
index 14ac5e5..4642928 100644
--- a/Lib/random.py
+++ b/Lib/random.py
@@ -41,7 +41,7 @@
 from math import log as _log, exp as _exp, pi as _pi, e as _e, ceil as _ceil
 from math import sqrt as _sqrt, acos as _acos, cos as _cos, sin as _sin
 from os import urandom as _urandom
-from collections.abc import Set as _Set, Sequence as _Sequence
+from _collections_abc import Set as _Set, Sequence as _Sequence
 from hashlib import sha512 as _sha512
 
 __all__ = ["Random","seed","random","uniform","randint","choice","sample",
@@ -105,7 +105,9 @@
 
         if a is None:
             try:
-                a = int.from_bytes(_urandom(32), 'big')
+                # Seed with enough bytes to span the 19937 bit
+                # state space for the Mersenne Twister
+                a = int.from_bytes(_urandom(2500), 'big')
             except NotImplementedError:
                 import time
                 a = int(time.time() * 256) # use fractional seconds
@@ -151,6 +153,9 @@
 
 ## -------------------- pickle support  -------------------
 
+    # Issue 17489: Since __reduce__ was defined to fix #759889 this is no
+    # longer called; we leave it here because it has been here since random was
+    # rewritten back in 2001 and why risk breaking something.
     def __getstate__(self): # for pickle
         return self.getstate()
 
@@ -216,10 +221,11 @@
                    Method=_MethodType, BuiltinMethod=_BuiltinMethodType):
         "Return a random int in the range [0,n).  Raises ValueError if n==0."
 
+        random = self.random
         getrandbits = self.getrandbits
         # Only call self.getrandbits if the original random() builtin method
         # has not been overridden or if a new getrandbits() was supplied.
-        if type(self.random) is BuiltinMethod or type(getrandbits) is Method:
+        if type(random) is BuiltinMethod or type(getrandbits) is Method:
             k = n.bit_length()  # don't use (n-1) here because n can be 1
             r = getrandbits(k)          # 0 <= r < 2**k
             while r >= n:
@@ -227,7 +233,6 @@
             return r
         # There's an overriden random() method but no new getrandbits() method,
         # so we can only use random() from here.
-        random = self.random
         if n >= maxsize:
             _warn("Underlying random() generator does not supply \n"
                 "enough bits to choose from a population range this large.\n"
@@ -251,10 +256,11 @@
         return seq[i]
 
     def shuffle(self, x, random=None):
-        """x, random=random.random -> shuffle list x in place; return None.
+        """Shuffle list x in place, and return None.
 
-        Optional arg random is a 0-argument function returning a random
-        float in [0.0, 1.0); by default, the standard random.random.
+        Optional argument random is a 0-argument function returning a
+        random float in [0.0, 1.0); if it is the default None, the
+        standard random.random will be used.
 
         """
 
@@ -349,7 +355,10 @@
 
         """
         u = self.random()
-        c = 0.5 if mode is None else (mode - low) / (high - low)
+        try:
+            c = 0.5 if mode is None else (mode - low) / (high - low)
+        except ZeroDivisionError:
+            return low
         if u > c:
             u = 1.0 - u
             c = 1.0 - c
diff --git a/Lib/re.py b/Lib/re.py
index a46ecc8..199afee 100644
--- a/Lib/re.py
+++ b/Lib/re.py
@@ -85,16 +85,17 @@
     \\       Matches a literal backslash.
 
 This module exports the following functions:
-    match    Match a regular expression pattern to the beginning of a string.
-    search   Search a string for the presence of a pattern.
-    sub      Substitute occurrences of a pattern found in a string.
-    subn     Same as sub, but also return the number of substitutions made.
-    split    Split a string by the occurrences of a pattern.
-    findall  Find all occurrences of a pattern in a string.
-    finditer Return an iterator yielding a match object for each match.
-    compile  Compile a pattern into a RegexObject.
-    purge    Clear the regular expression cache.
-    escape   Backslash all non-alphanumerics in a string.
+    match     Match a regular expression pattern to the beginning of a string.
+    fullmatch Match a regular expression pattern to all of a string.
+    search    Search a string for the presence of a pattern.
+    sub       Substitute occurrences of a pattern found in a string.
+    subn      Same as sub, but also return the number of substitutions made.
+    split     Split a string by the occurrences of a pattern.
+    findall   Find all occurrences of a pattern in a string.
+    finditer  Return an iterator yielding a match object for each match.
+    compile   Compile a pattern into a RegexObject.
+    purge     Clear the regular expression cache.
+    escape    Backslash all non-alphanumerics in a string.
 
 Some of the functions in this module takes flags as optional parameters:
     A  ASCII       For string patterns, make \w, \W, \b, \B, \d, \D
@@ -121,10 +122,13 @@
 import sys
 import sre_compile
 import sre_parse
-import functools
+try:
+    import _locale
+except ImportError:
+    _locale = None
 
 # public symbols
-__all__ = [ "match", "search", "sub", "subn", "split", "findall",
+__all__ = [ "match", "fullmatch", "search", "sub", "subn", "split", "findall",
     "compile", "purge", "template", "escape", "A", "I", "L", "M", "S", "X",
     "U", "ASCII", "IGNORECASE", "LOCALE", "MULTILINE", "DOTALL", "VERBOSE",
     "UNICODE", "error" ]
@@ -155,6 +159,11 @@
     a match object, or None if no match was found."""
     return _compile(pattern, flags).match(string)
 
+def fullmatch(pattern, string, flags=0):
+    """Try to apply the pattern to all of the string, returning
+    a match object, or None if no match was found."""
+    return _compile(pattern, flags).fullmatch(string)
+
 def search(pattern, string, flags=0):
     """Scan through string looking for a match to the pattern, returning
     a match object, or None if no match was found."""
@@ -270,7 +279,9 @@
     bypass_cache = flags & DEBUG
     if not bypass_cache:
         try:
-            return _cache[type(pattern), pattern, flags]
+            p, loc = _cache[type(pattern), pattern, flags]
+            if loc is None or loc == _locale.setlocale(_locale.LC_CTYPE):
+                return p
         except KeyError:
             pass
     if isinstance(pattern, _pattern_type):
@@ -284,7 +295,13 @@
     if not bypass_cache:
         if len(_cache) >= _MAXCACHE:
             _cache.clear()
-        _cache[type(pattern), pattern, flags] = p
+        if p.flags & LOCALE:
+            if not _locale:
+                return p
+            loc = _locale.setlocale(_locale.LC_CTYPE)
+        else:
+            loc = None
+        _cache[type(pattern), pattern, flags] = p, loc
     return p
 
 def _compile_repl(repl, pattern):
diff --git a/Lib/rlcompleter.py b/Lib/rlcompleter.py
index 3f97053..94f9341 100644
--- a/Lib/rlcompleter.py
+++ b/Lib/rlcompleter.py
@@ -29,6 +29,7 @@
 
 """
 
+import atexit
 import builtins
 import __main__
 
@@ -158,3 +159,7 @@
     pass
 else:
     readline.set_completer(Completer().complete)
+    # Release references early at shutdown (the readline module's
+    # contents are quasi-immortal, and the completer function holds a
+    # reference to globals).
+    atexit.register(lambda: readline.set_completer(None))
diff --git a/Lib/runpy.py b/Lib/runpy.py
index 39c0e9f..0bb57d7 100644
--- a/Lib/runpy.py
+++ b/Lib/runpy.py
@@ -10,11 +10,11 @@
 #    to implement PEP 338 (Executing Modules as Scripts)
 
 
-import os
 import sys
 import importlib.machinery # importlib first so we can test #15386 via -m
-import imp
-from pkgutil import read_code, get_loader, get_importer
+import importlib.util
+import types
+from pkgutil import read_code, get_importer
 
 __all__ = [
     "run_module", "run_path",
@@ -24,7 +24,7 @@
     """Temporarily replace a module in sys.modules with an empty namespace"""
     def __init__(self, mod_name):
         self.mod_name = mod_name
-        self.module = imp.new_module(mod_name)
+        self.module = types.ModuleType(mod_name)
         self._saved_module = []
 
     def __enter__(self):
@@ -58,51 +58,59 @@
         self.value = self._sentinel
         sys.argv[0] = self._saved_value
 
+# TODO: Replace these helpers with importlib._bootstrap._SpecMethods
 def _run_code(code, run_globals, init_globals=None,
-              mod_name=None, mod_fname=None,
-              mod_loader=None, pkg_name=None):
+              mod_name=None, mod_spec=None,
+              pkg_name=None, script_name=None):
     """Helper to run code in nominated namespace"""
     if init_globals is not None:
         run_globals.update(init_globals)
+    if mod_spec is None:
+        loader = None
+        fname = script_name
+        cached = None
+    else:
+        loader = mod_spec.loader
+        fname = mod_spec.origin
+        cached = mod_spec.cached
+        if pkg_name is None:
+            pkg_name = mod_spec.parent
     run_globals.update(__name__ = mod_name,
-                       __file__ = mod_fname,
-                       __cached__ = None,
+                       __file__ = fname,
+                       __cached__ = cached,
                        __doc__ = None,
-                       __loader__ = mod_loader,
-                       __package__ = pkg_name)
+                       __loader__ = loader,
+                       __package__ = pkg_name,
+                       __spec__ = mod_spec)
     exec(code, run_globals)
     return run_globals
 
 def _run_module_code(code, init_globals=None,
-                    mod_name=None, mod_fname=None,
-                    mod_loader=None, pkg_name=None):
+                    mod_name=None, mod_spec=None,
+                    pkg_name=None, script_name=None):
     """Helper to run code in new namespace with sys modified"""
-    with _TempModule(mod_name) as temp_module, _ModifiedArgv0(mod_fname):
+    fname = script_name if mod_spec is None else mod_spec.origin
+    with _TempModule(mod_name) as temp_module, _ModifiedArgv0(fname):
         mod_globals = temp_module.module.__dict__
         _run_code(code, mod_globals, init_globals,
-                  mod_name, mod_fname, mod_loader, pkg_name)
+                  mod_name, mod_spec, pkg_name, script_name)
     # Copy the globals of the temporary module, as they
     # may be cleared when the temporary module goes away
     return mod_globals.copy()
 
-
-# This helper is needed due to a missing component in the PEP 302
-# loader protocol (specifically, "get_filename" is non-standard)
-# Since we can't introduce new features in maintenance releases,
-# support was added to zipimporter under the name '_get_filename'
-def _get_filename(loader, mod_name):
-    for attr in ("get_filename", "_get_filename"):
-        meth = getattr(loader, attr, None)
-        if meth is not None:
-            return os.path.abspath(meth(mod_name))
-    return None
-
 # Helper to get the loader, code and filename for a module
 def _get_module_details(mod_name):
-    loader = get_loader(mod_name)
-    if loader is None:
+    try:
+        spec = importlib.util.find_spec(mod_name)
+    except (ImportError, AttributeError, TypeError, ValueError) as ex:
+        # This hack fixes an impedance mismatch between pkgutil and
+        # importlib, where the latter raises other errors for cases where
+        # pkgutil previously raised ImportError
+        msg = "Error while finding spec for {!r} ({}: {})"
+        raise ImportError(msg.format(mod_name, type(ex), ex)) from ex
+    if spec is None:
         raise ImportError("No module named %s" % mod_name)
-    if loader.is_package(mod_name):
+    if spec.submodule_search_locations is not None:
         if mod_name == "__main__" or mod_name.endswith(".__main__"):
             raise ImportError("Cannot use package as __main__ module")
         try:
@@ -111,11 +119,14 @@
         except ImportError as e:
             raise ImportError(("%s; %r is a package and cannot " +
                                "be directly executed") %(e, mod_name))
+    loader = spec.loader
+    if loader is None:
+        raise ImportError("%r is a namespace package and cannot be executed"
+                                                                 % mod_name)
     code = loader.get_code(mod_name)
     if code is None:
         raise ImportError("No code object available for %s" % mod_name)
-    filename = _get_filename(loader, mod_name)
-    return mod_name, loader, code, filename
+    return mod_name, spec, code
 
 # XXX ncoghlan: Should this be documented and made public?
 # (Current thoughts: don't repeat the mistake that lead to its
@@ -137,9 +148,9 @@
     """
     try:
         if alter_argv or mod_name != "__main__": # i.e. -m switch
-            mod_name, loader, code, fname = _get_module_details(mod_name)
+            mod_name, mod_spec, code = _get_module_details(mod_name)
         else:          # i.e. directory or zipfile execution
-            mod_name, loader, code, fname = _get_main_module_details()
+            mod_name, mod_spec, code = _get_main_module_details()
     except ImportError as exc:
         # Try to provide a good error message
         # for directories, zip files and the -m switch
@@ -152,12 +163,11 @@
             info = "can't find '__main__' module in %r" % sys.argv[0]
         msg = "%s: %s" % (sys.executable, info)
         sys.exit(msg)
-    pkg_name = mod_name.rpartition('.')[0]
     main_globals = sys.modules["__main__"].__dict__
     if alter_argv:
-        sys.argv[0] = fname
+        sys.argv[0] = mod_spec.origin
     return _run_code(code, main_globals, None,
-                     "__main__", fname, loader, pkg_name)
+                     "__main__", mod_spec)
 
 def run_module(mod_name, init_globals=None,
                run_name=None, alter_sys=False):
@@ -165,17 +175,14 @@
 
        Returns the resulting top level namespace dictionary
     """
-    mod_name, loader, code, fname = _get_module_details(mod_name)
+    mod_name, mod_spec, code = _get_module_details(mod_name)
     if run_name is None:
         run_name = mod_name
-    pkg_name = mod_name.rpartition('.')[0]
     if alter_sys:
-        return _run_module_code(code, init_globals, run_name,
-                                fname, loader, pkg_name)
+        return _run_module_code(code, init_globals, run_name, mod_spec)
     else:
         # Leave the sys module alone
-        return _run_code(code, {}, init_globals, run_name,
-                         fname, loader, pkg_name)
+        return _run_code(code, {}, init_globals, run_name, mod_spec)
 
 def _get_main_module_details():
     # Helper that gives a nicer error message when attempting to
@@ -204,10 +211,7 @@
         # That didn't work, so try it as normal source code
         with open(fname, "rb") as f:
             code = compile(f.read(), fname, 'exec')
-            loader = importlib.machinery.SourceFileLoader(run_name, fname)
-    else:
-        loader = importlib.machinery.SourcelessFileLoader(run_name, fname)
-    return code, loader
+    return code, fname
 
 def run_path(path_name, init_globals=None, run_name=None):
     """Execute code located at the specified filesystem location
@@ -223,12 +227,17 @@
         run_name = "<run_path>"
     pkg_name = run_name.rpartition(".")[0]
     importer = get_importer(path_name)
-    if isinstance(importer, (type(None), imp.NullImporter)):
+    # Trying to avoid importing imp so as to not consume the deprecation warning.
+    is_NullImporter = False
+    if type(importer).__module__ == 'imp':
+        if type(importer).__name__ == 'NullImporter':
+            is_NullImporter = True
+    if isinstance(importer, type(None)) or is_NullImporter:
         # Not a valid sys.path entry, so run the code directly
         # execfile() doesn't help as we want to allow compiled files
-        code, mod_loader = _get_code_from_file(run_name, path_name)
-        return _run_module_code(code, init_globals, run_name, path_name,
-                                mod_loader, pkg_name)
+        code, fname = _get_code_from_file(run_name, path_name)
+        return _run_module_code(code, init_globals, run_name,
+                                pkg_name=pkg_name, script_name=fname)
     else:
         # Importer is defined for path, so add it to
         # the start of sys.path
@@ -240,12 +249,12 @@
             # have no choice and we have to remove it even while we read the
             # code. If we don't do this, a __loader__ attribute in the
             # existing __main__ module may prevent location of the new module.
-            mod_name, loader, code, fname = _get_main_module_details()
+            mod_name, mod_spec, code = _get_main_module_details()
             with _TempModule(run_name) as temp_module, \
                  _ModifiedArgv0(path_name):
                 mod_globals = temp_module.module.__dict__
                 return _run_code(code, mod_globals, init_globals,
-                                    run_name, fname, loader, pkg_name).copy()
+                                    run_name, mod_spec, pkg_name).copy()
         finally:
             try:
                 sys.path.remove(path_name)
diff --git a/Lib/sched.py b/Lib/sched.py
index b9a7ad1..2e6b00a 100644
--- a/Lib/sched.py
+++ b/Lib/sched.py
@@ -71,10 +71,10 @@
         """
         if kwargs is _sentinel:
             kwargs = {}
+        event = Event(time, priority, action, argument, kwargs)
         with self._lock:
-            event = Event(time, priority, action, argument, kwargs)
             heapq.heappush(self._queue, event)
-            return event # The ID
+        return event # The ID
 
     def enter(self, delay, priority, action, argument=(), kwargs=_sentinel):
         """A variant that specifies the time as a relative time.
@@ -82,9 +82,8 @@
         This is actually the more commonly used interface.
 
         """
-        with self._lock:
-            time = self.timefunc() + delay
-            return self.enterabs(time, priority, action, argument, kwargs)
+        time = self.timefunc() + delay
+        return self.enterabs(time, priority, action, argument, kwargs)
 
     def cancel(self, event):
         """Remove an event from the queue.
@@ -165,4 +164,4 @@
         # the actual order they would be retrieved.
         with self._lock:
             events = self._queue[:]
-            return list(map(heapq.heappop, [events]*len(events)))
+        return list(map(heapq.heappop, [events]*len(events)))
diff --git a/Lib/selectors.py b/Lib/selectors.py
new file mode 100644
index 0000000..beb7ef7
--- /dev/null
+++ b/Lib/selectors.py
@@ -0,0 +1,533 @@
+"""Selectors module.
+
+This module allows high-level and efficient I/O multiplexing, built upon the
+`select` module primitives.
+"""
+
+
+from abc import ABCMeta, abstractmethod
+from collections import namedtuple, Mapping
+import math
+import select
+import sys
+
+
+# generic events, that must be mapped to implementation-specific ones
+EVENT_READ = (1 << 0)
+EVENT_WRITE = (1 << 1)
+
+
+def _fileobj_to_fd(fileobj):
+    """Return a file descriptor from a file object.
+
+    Parameters:
+    fileobj -- file object or file descriptor
+
+    Returns:
+    corresponding file descriptor
+
+    Raises:
+    ValueError if the object is invalid
+    """
+    if isinstance(fileobj, int):
+        fd = fileobj
+    else:
+        try:
+            fd = int(fileobj.fileno())
+        except (AttributeError, TypeError, ValueError):
+            raise ValueError("Invalid file object: "
+                             "{!r}".format(fileobj)) from None
+    if fd < 0:
+        raise ValueError("Invalid file descriptor: {}".format(fd))
+    return fd
+
+
+SelectorKey = namedtuple('SelectorKey', ['fileobj', 'fd', 'events', 'data'])
+"""Object used to associate a file object to its backing file descriptor,
+selected event mask and attached data."""
+
+
+class _SelectorMapping(Mapping):
+    """Mapping of file objects to selector keys."""
+
+    def __init__(self, selector):
+        self._selector = selector
+
+    def __len__(self):
+        return len(self._selector._fd_to_key)
+
+    def __getitem__(self, fileobj):
+        try:
+            fd = self._selector._fileobj_lookup(fileobj)
+            return self._selector._fd_to_key[fd]
+        except KeyError:
+            raise KeyError("{!r} is not registered".format(fileobj)) from None
+
+    def __iter__(self):
+        return iter(self._selector._fd_to_key)
+
+
+class BaseSelector(metaclass=ABCMeta):
+    """Selector abstract base class.
+
+    A selector supports registering file objects to be monitored for specific
+    I/O events.
+
+    A file object is a file descriptor or any object with a `fileno()` method.
+    An arbitrary object can be attached to the file object, which can be used
+    for example to store context information, a callback, etc.
+
+    A selector can use various implementations (select(), poll(), epoll()...)
+    depending on the platform. The default `Selector` class uses the most
+    efficient implementation on the current platform.
+    """
+
+    @abstractmethod
+    def register(self, fileobj, events, data=None):
+        """Register a file object.
+
+        Parameters:
+        fileobj -- file object or file descriptor
+        events  -- events to monitor (bitwise mask of EVENT_READ|EVENT_WRITE)
+        data    -- attached data
+
+        Returns:
+        SelectorKey instance
+
+        Raises:
+        ValueError if events is invalid
+        KeyError if fileobj is already registered
+        OSError if fileobj is closed or otherwise is unacceptable to
+                the underlying system call (if a system call is made)
+
+        Note:
+        OSError may or may not be raised
+        """
+        raise NotImplementedError
+
+    @abstractmethod
+    def unregister(self, fileobj):
+        """Unregister a file object.
+
+        Parameters:
+        fileobj -- file object or file descriptor
+
+        Returns:
+        SelectorKey instance
+
+        Raises:
+        KeyError if fileobj is not registered
+
+        Note:
+        If fileobj is registered but has since been closed this does
+        *not* raise OSError (even if the wrapped syscall does)
+        """
+        raise NotImplementedError
+
+    def modify(self, fileobj, events, data=None):
+        """Change a registered file object monitored events or attached data.
+
+        Parameters:
+        fileobj -- file object or file descriptor
+        events  -- events to monitor (bitwise mask of EVENT_READ|EVENT_WRITE)
+        data    -- attached data
+
+        Returns:
+        SelectorKey instance
+
+        Raises:
+        Anything that unregister() or register() raises
+        """
+        self.unregister(fileobj)
+        return self.register(fileobj, events, data)
+
+    @abstractmethod
+    def select(self, timeout=None):
+        """Perform the actual selection, until some monitored file objects are
+        ready or a timeout expires.
+
+        Parameters:
+        timeout -- if timeout > 0, this specifies the maximum wait time, in
+                   seconds
+                   if timeout <= 0, the select() call won't block, and will
+                   report the currently ready file objects
+                   if timeout is None, select() will block until a monitored
+                   file object becomes ready
+
+        Returns:
+        list of (key, events) for ready file objects
+        `events` is a bitwise mask of EVENT_READ|EVENT_WRITE
+        """
+        raise NotImplementedError
+
+    def close(self):
+        """Close the selector.
+
+        This must be called to make sure that any underlying resource is freed.
+        """
+        pass
+
+    def get_key(self, fileobj):
+        """Return the key associated to a registered file object.
+
+        Returns:
+        SelectorKey for this file object
+        """
+        mapping = self.get_map()
+        try:
+            if mapping is None:
+                raise KeyError
+            return mapping[fileobj]
+        except KeyError:
+            raise KeyError("{!r} is not registered".format(fileobj)) from None
+
+    @abstractmethod
+    def get_map(self):
+        """Return a mapping of file objects to selector keys."""
+        raise NotImplementedError
+
+    def __enter__(self):
+        return self
+
+    def __exit__(self, *args):
+        self.close()
+
+
+class _BaseSelectorImpl(BaseSelector):
+    """Base selector implementation."""
+
+    def __init__(self):
+        # this maps file descriptors to keys
+        self._fd_to_key = {}
+        # read-only mapping returned by get_map()
+        self._map = _SelectorMapping(self)
+
+    def _fileobj_lookup(self, fileobj):
+        """Return a file descriptor from a file object.
+
+        This wraps _fileobj_to_fd() to do an exhaustive search in case
+        the object is invalid but we still have it in our map.  This
+        is used by unregister() so we can unregister an object that
+        was previously registered even if it is closed.  It is also
+        used by _SelectorMapping.
+        """
+        try:
+            return _fileobj_to_fd(fileobj)
+        except ValueError:
+            # Do an exhaustive search.
+            for key in self._fd_to_key.values():
+                if key.fileobj is fileobj:
+                    return key.fd
+            # Raise ValueError after all.
+            raise
+
+    def register(self, fileobj, events, data=None):
+        if (not events) or (events & ~(EVENT_READ | EVENT_WRITE)):
+            raise ValueError("Invalid events: {!r}".format(events))
+
+        key = SelectorKey(fileobj, self._fileobj_lookup(fileobj), events, data)
+
+        if key.fd in self._fd_to_key:
+            raise KeyError("{!r} (FD {}) is already registered"
+                           .format(fileobj, key.fd))
+
+        self._fd_to_key[key.fd] = key
+        return key
+
+    def unregister(self, fileobj):
+        try:
+            key = self._fd_to_key.pop(self._fileobj_lookup(fileobj))
+        except KeyError:
+            raise KeyError("{!r} is not registered".format(fileobj)) from None
+        return key
+
+    def modify(self, fileobj, events, data=None):
+        # TODO: Subclasses can probably optimize this even further.
+        try:
+            key = self._fd_to_key[self._fileobj_lookup(fileobj)]
+        except KeyError:
+            raise KeyError("{!r} is not registered".format(fileobj)) from None
+        if events != key.events:
+            self.unregister(fileobj)
+            key = self.register(fileobj, events, data)
+        elif data != key.data:
+            # Use a shortcut to update the data.
+            key = key._replace(data=data)
+            self._fd_to_key[key.fd] = key
+        return key
+
+    def close(self):
+        self._fd_to_key.clear()
+        self._map = None
+
+    def get_map(self):
+        return self._map
+
+    def _key_from_fd(self, fd):
+        """Return the key associated to a given file descriptor.
+
+        Parameters:
+        fd -- file descriptor
+
+        Returns:
+        corresponding key, or None if not found
+        """
+        try:
+            return self._fd_to_key[fd]
+        except KeyError:
+            return None
+
+
+class SelectSelector(_BaseSelectorImpl):
+    """Select-based selector."""
+
+    def __init__(self):
+        super().__init__()
+        self._readers = set()
+        self._writers = set()
+
+    def register(self, fileobj, events, data=None):
+        key = super().register(fileobj, events, data)
+        if events & EVENT_READ:
+            self._readers.add(key.fd)
+        if events & EVENT_WRITE:
+            self._writers.add(key.fd)
+        return key
+
+    def unregister(self, fileobj):
+        key = super().unregister(fileobj)
+        self._readers.discard(key.fd)
+        self._writers.discard(key.fd)
+        return key
+
+    if sys.platform == 'win32':
+        def _select(self, r, w, _, timeout=None):
+            r, w, x = select.select(r, w, w, timeout)
+            return r, w + x, []
+    else:
+        _select = select.select
+
+    def select(self, timeout=None):
+        timeout = None if timeout is None else max(timeout, 0)
+        ready = []
+        try:
+            r, w, _ = self._select(self._readers, self._writers, [], timeout)
+        except InterruptedError:
+            return ready
+        r = set(r)
+        w = set(w)
+        for fd in r | w:
+            events = 0
+            if fd in r:
+                events |= EVENT_READ
+            if fd in w:
+                events |= EVENT_WRITE
+
+            key = self._key_from_fd(fd)
+            if key:
+                ready.append((key, events & key.events))
+        return ready
+
+
+if hasattr(select, 'poll'):
+
+    class PollSelector(_BaseSelectorImpl):
+        """Poll-based selector."""
+
+        def __init__(self):
+            super().__init__()
+            self._poll = select.poll()
+
+        def register(self, fileobj, events, data=None):
+            key = super().register(fileobj, events, data)
+            poll_events = 0
+            if events & EVENT_READ:
+                poll_events |= select.POLLIN
+            if events & EVENT_WRITE:
+                poll_events |= select.POLLOUT
+            self._poll.register(key.fd, poll_events)
+            return key
+
+        def unregister(self, fileobj):
+            key = super().unregister(fileobj)
+            self._poll.unregister(key.fd)
+            return key
+
+        def select(self, timeout=None):
+            if timeout is None:
+                timeout = None
+            elif timeout <= 0:
+                timeout = 0
+            else:
+                # poll() has a resolution of 1 millisecond, round away from
+                # zero to wait *at least* timeout seconds.
+                timeout = math.ceil(timeout * 1e3)
+            ready = []
+            try:
+                fd_event_list = self._poll.poll(timeout)
+            except InterruptedError:
+                return ready
+            for fd, event in fd_event_list:
+                events = 0
+                if event & ~select.POLLIN:
+                    events |= EVENT_WRITE
+                if event & ~select.POLLOUT:
+                    events |= EVENT_READ
+
+                key = self._key_from_fd(fd)
+                if key:
+                    ready.append((key, events & key.events))
+            return ready
+
+
+if hasattr(select, 'epoll'):
+
+    class EpollSelector(_BaseSelectorImpl):
+        """Epoll-based selector."""
+
+        def __init__(self):
+            super().__init__()
+            self._epoll = select.epoll()
+
+        def fileno(self):
+            return self._epoll.fileno()
+
+        def register(self, fileobj, events, data=None):
+            key = super().register(fileobj, events, data)
+            epoll_events = 0
+            if events & EVENT_READ:
+                epoll_events |= select.EPOLLIN
+            if events & EVENT_WRITE:
+                epoll_events |= select.EPOLLOUT
+            self._epoll.register(key.fd, epoll_events)
+            return key
+
+        def unregister(self, fileobj):
+            key = super().unregister(fileobj)
+            try:
+                self._epoll.unregister(key.fd)
+            except OSError:
+                # This can happen if the FD was closed since it
+                # was registered.
+                pass
+            return key
+
+        def select(self, timeout=None):
+            if timeout is None:
+                timeout = -1
+            elif timeout <= 0:
+                timeout = 0
+            else:
+                # epoll_wait() has a resolution of 1 millisecond, round away
+                # from zero to wait *at least* timeout seconds.
+                timeout = math.ceil(timeout * 1e3) * 1e-3
+
+            # epoll_wait() expects `maxevents` to be greater than zero;
+            # we want to make sure that `select()` can be called when no
+            # FD is registered.
+            max_ev = max(len(self._fd_to_key), 1)
+
+            ready = []
+            try:
+                fd_event_list = self._epoll.poll(timeout, max_ev)
+            except InterruptedError:
+                return ready
+            for fd, event in fd_event_list:
+                events = 0
+                if event & ~select.EPOLLIN:
+                    events |= EVENT_WRITE
+                if event & ~select.EPOLLOUT:
+                    events |= EVENT_READ
+
+                key = self._key_from_fd(fd)
+                if key:
+                    ready.append((key, events & key.events))
+            return ready
+
+        def close(self):
+            self._epoll.close()
+            super().close()
+
+
+if hasattr(select, 'kqueue'):
+
+    class KqueueSelector(_BaseSelectorImpl):
+        """Kqueue-based selector."""
+
+        def __init__(self):
+            super().__init__()
+            self._kqueue = select.kqueue()
+
+        def fileno(self):
+            return self._kqueue.fileno()
+
+        def register(self, fileobj, events, data=None):
+            key = super().register(fileobj, events, data)
+            if events & EVENT_READ:
+                kev = select.kevent(key.fd, select.KQ_FILTER_READ,
+                                    select.KQ_EV_ADD)
+                self._kqueue.control([kev], 0, 0)
+            if events & EVENT_WRITE:
+                kev = select.kevent(key.fd, select.KQ_FILTER_WRITE,
+                                    select.KQ_EV_ADD)
+                self._kqueue.control([kev], 0, 0)
+            return key
+
+        def unregister(self, fileobj):
+            key = super().unregister(fileobj)
+            if key.events & EVENT_READ:
+                kev = select.kevent(key.fd, select.KQ_FILTER_READ,
+                                    select.KQ_EV_DELETE)
+                try:
+                    self._kqueue.control([kev], 0, 0)
+                except OSError:
+                    # This can happen if the FD was closed since it
+                    # was registered.
+                    pass
+            if key.events & EVENT_WRITE:
+                kev = select.kevent(key.fd, select.KQ_FILTER_WRITE,
+                                    select.KQ_EV_DELETE)
+                try:
+                    self._kqueue.control([kev], 0, 0)
+                except OSError:
+                    # See comment above.
+                    pass
+            return key
+
+        def select(self, timeout=None):
+            timeout = None if timeout is None else max(timeout, 0)
+            max_ev = len(self._fd_to_key)
+            ready = []
+            try:
+                kev_list = self._kqueue.control(None, max_ev, timeout)
+            except InterruptedError:
+                return ready
+            for kev in kev_list:
+                fd = kev.ident
+                flag = kev.filter
+                events = 0
+                if flag == select.KQ_FILTER_READ:
+                    events |= EVENT_READ
+                if flag == select.KQ_FILTER_WRITE:
+                    events |= EVENT_WRITE
+
+                key = self._key_from_fd(fd)
+                if key:
+                    ready.append((key, events & key.events))
+            return ready
+
+        def close(self):
+            self._kqueue.close()
+            super().close()
+
+
+# Choose the best implementation: roughly, epoll|kqueue > poll > select.
+# select() also can't accept a FD > FD_SETSIZE (usually around 1024)
+if 'KqueueSelector' in globals():
+    DefaultSelector = KqueueSelector
+elif 'EpollSelector' in globals():
+    DefaultSelector = EpollSelector
+elif 'PollSelector' in globals():
+    DefaultSelector = PollSelector
+else:
+    DefaultSelector = SelectSelector
diff --git a/Lib/shelve.py b/Lib/shelve.py
index cc1815e..cef580e 100644
--- a/Lib/shelve.py
+++ b/Lib/shelve.py
@@ -61,7 +61,7 @@
 
 import collections
 
-__all__ = ["Shelf","BsdDbShelf","DbfilenameShelf","open"]
+__all__ = ["Shelf", "BsdDbShelf", "DbfilenameShelf", "open"]
 
 class _ClosedDict(collections.MutableMapping):
     'Marker for a closed dict.  Access attempts raise a ValueError.'
@@ -131,6 +131,12 @@
         except KeyError:
             pass
 
+    def __enter__(self):
+        return self
+
+    def __exit__(self, type, value, traceback):
+        self.close()
+
     def close(self):
         self.sync()
         try:
@@ -147,6 +153,7 @@
     def __del__(self):
         if not hasattr(self, 'writeback'):
             # __init__ didn't succeed, so don't bother closing
+            # see http://bugs.python.org/issue1339007 for details
             return
         self.close()
 
diff --git a/Lib/shlex.py b/Lib/shlex.py
index 69f3b45..4672553 100644
--- a/Lib/shlex.py
+++ b/Lib/shlex.py
@@ -290,15 +290,17 @@
     return "'" + s.replace("'", "'\"'\"'") + "'"
 
 
-if __name__ == '__main__':
-    if len(sys.argv) == 1:
-        lexer = shlex()
-    else:
-        file = sys.argv[1]
-        lexer = shlex(open(file), file)
+def _print_tokens(lexer):
     while 1:
         tt = lexer.get_token()
-        if tt:
-            print("Token: " + repr(tt))
-        else:
+        if not tt:
             break
+        print("Token: " + repr(tt))
+
+if __name__ == '__main__':
+    if len(sys.argv) == 1:
+        _print_tokens(shlex())
+    else:
+        fn = sys.argv[1]
+        with open(fn) as f:
+            _print_tokens(shlex(f, fn))
diff --git a/Lib/shutil.py b/Lib/shutil.py
index 5a4d4f6..ac06ae5 100644
--- a/Lib/shutil.py
+++ b/Lib/shutil.py
@@ -36,20 +36,24 @@
            "register_archive_format", "unregister_archive_format",
            "get_unpack_formats", "register_unpack_format",
            "unregister_unpack_format", "unpack_archive",
-           "ignore_patterns", "chown", "which"]
+           "ignore_patterns", "chown", "which", "get_terminal_size",
+           "SameFileError"]
            # disk_usage is added later, if available on the platform
 
-class Error(EnvironmentError):
+class Error(OSError):
     pass
 
-class SpecialFileError(EnvironmentError):
+class SameFileError(Error):
+    """Raised when source and destination are the same file."""
+
+class SpecialFileError(OSError):
     """Raised when trying to do a kind of operation (e.g. copying) which is
     not supported on a special file (e.g. a named pipe)"""
 
-class ExecError(EnvironmentError):
+class ExecError(OSError):
     """Raised when a command could not be executed"""
 
-class ReadError(EnvironmentError):
+class ReadError(OSError):
     """Raised when an archive cannot be read"""
 
 class RegistryError(Exception):
@@ -57,11 +61,6 @@
     and unpacking registeries fails"""
 
 
-try:
-    WindowsError
-except NameError:
-    WindowsError = None
-
 def copyfileobj(fsrc, fdst, length=16*1024):
     """copy data from file-like object fsrc to file-like object fdst"""
     while 1:
@@ -90,7 +89,7 @@
 
     """
     if _samefile(src, dst):
-        raise Error("`%s` and `%s` are the same file" % (src, dst))
+        raise SameFileError("{!r} and {!r} are the same file".format(src, dst))
 
     for fn in [src, dst]:
         try:
@@ -221,6 +220,9 @@
     If follow_symlinks is false, symlinks won't be followed. This
     resembles GNU's "cp -P src dst".
 
+    If source and destination are the same file, a SameFileError will be
+    raised.
+
     """
     if os.path.isdir(dst):
         dst = os.path.join(dst, os.path.basename(src))
@@ -329,15 +331,13 @@
         # continue with other files
         except Error as err:
             errors.extend(err.args[0])
-        except EnvironmentError as why:
+        except OSError as why:
             errors.append((srcname, dstname, str(why)))
     try:
         copystat(src, dst)
     except OSError as why:
-        if WindowsError is not None and isinstance(why, WindowsError):
-            # Copying file access times may fail on Windows
-            pass
-        else:
+        # Copying file access times may fail on Windows
+        if getattr(why, 'winerror', None) is None:
             errors.append((src, dst, str(why)))
     if errors:
         raise Error(errors)
@@ -356,24 +356,24 @@
     names = []
     try:
         names = os.listdir(path)
-    except os.error:
+    except OSError:
         onerror(os.listdir, path, sys.exc_info())
     for name in names:
         fullname = os.path.join(path, name)
         try:
             mode = os.lstat(fullname).st_mode
-        except os.error:
+        except OSError:
             mode = 0
         if stat.S_ISDIR(mode):
             _rmtree_unsafe(fullname, onerror)
         else:
             try:
                 os.unlink(fullname)
-            except os.error:
+            except OSError:
                 onerror(os.unlink, fullname, sys.exc_info())
     try:
         os.rmdir(path)
-    except os.error:
+    except OSError:
         onerror(os.rmdir, path, sys.exc_info())
 
 # Version using fd-based APIs to protect against races
@@ -464,7 +464,7 @@
                 _rmtree_safe_fd(fd, path, onerror)
                 try:
                     os.rmdir(path)
-                except os.error:
+                except OSError:
                     onerror(os.rmdir, path, sys.exc_info())
             else:
                 try:
@@ -600,7 +600,7 @@
     archive_name = base_name + '.tar' + compress_ext.get(compress, '')
     archive_dir = os.path.dirname(archive_name)
 
-    if not os.path.exists(archive_dir):
+    if archive_dir and not os.path.exists(archive_dir):
         if logger is not None:
             logger.info("creating %s", archive_dir)
         if not dry_run:
@@ -660,7 +660,7 @@
     zip_filename = base_name + ".zip"
     archive_dir = os.path.dirname(base_name)
 
-    if not os.path.exists(archive_dir):
+    if archive_dir and not os.path.exists(archive_dir):
         if logger is not None:
             logger.info("creating %s", archive_dir)
         if not dry_run:
diff --git a/Lib/site.py b/Lib/site.py
index 7e09701..ad5d136 100644
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -58,17 +58,20 @@
 because bar.pth comes alphabetically before foo.pth; and spam is
 omitted because it is not mentioned in either path configuration file.
 
-After these path manipulations, an attempt is made to import a module
+The readline module is also automatically configured to enable
+completion for systems that support it.  This can be overriden in
+sitecustomize, usercustomize or PYTHONSTARTUP.
+
+After these operations, an attempt is made to import a module
 named sitecustomize, which can perform arbitrary additional
 site-specific customizations.  If this import fails with an
 ImportError exception, it is silently ignored.
-
 """
 
 import sys
 import os
-import re
 import builtins
+import _sitebuiltins
 
 # Prefixes for site-packages; add additional prefixes like /usr/local here
 PREFIXES = [sys.prefix, sys.exec_prefix]
@@ -146,14 +149,14 @@
        and add that to known_paths, or execute it if it starts with 'import '.
     """
     if known_paths is None:
-        _init_pathinfo()
+        known_paths = _init_pathinfo()
         reset = 1
     else:
         reset = 0
     fullname = os.path.join(sitedir, name)
     try:
         f = open(fullname, "r")
-    except IOError:
+    except OSError:
         return
     with f:
         for n, line in enumerate(f):
@@ -196,7 +199,7 @@
         known_paths.add(sitedircase)
     try:
         names = os.listdir(sitedir)
-    except os.error:
+    except OSError:
         return
     names = [name for name in names if name.endswith(".pth")]
     for name in sorted(names):
@@ -300,9 +303,7 @@
             continue
         seen.add(prefix)
 
-        if sys.platform in ('os2emx', 'riscos'):
-            sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
-        elif os.sep == '/':
+        if os.sep == '/':
             sitepackages.append(os.path.join(prefix, "lib",
                                         "python" + sys.version[:3],
                                         "site-packages"))
@@ -325,27 +326,15 @@
     """Add site-packages (and possibly site-python) to sys.path"""
     for sitedir in getsitepackages(prefixes):
         if os.path.isdir(sitedir):
+            if "site-python" in sitedir:
+                import warnings
+                warnings.warn('"site-python" directories will not be '
+                              'supported in 3.5 anymore',
+                              DeprecationWarning)
             addsitedir(sitedir, known_paths)
 
     return known_paths
 
-def setBEGINLIBPATH():
-    """The OS/2 EMX port has optional extension modules that do double duty
-    as DLLs (and must use the .DLL file extension) for other extensions.
-    The library search path needs to be amended so these will be found
-    during module import.  Use BEGINLIBPATH so that these are at the start
-    of the library search path.
-
-    """
-    dllpath = os.path.join(sys.prefix, "Lib", "lib-dynload")
-    libpath = os.environ['BEGINLIBPATH'].split(';')
-    if libpath[-1]:
-        libpath.append(dllpath)
-    else:
-        libpath[-1] = dllpath
-    os.environ['BEGINLIBPATH'] = ';'.join(libpath)
-
-
 def setquit():
     """Define new builtins 'quit' and 'exit'.
 
@@ -360,126 +349,94 @@
     else:
         eof = 'Ctrl-D (i.e. EOF)'
 
-    class Quitter(object):
-        def __init__(self, name):
-            self.name = name
-        def __repr__(self):
-            return 'Use %s() or %s to exit' % (self.name, eof)
-        def __call__(self, code=None):
-            # Shells like IDLE catch the SystemExit, but listen when their
-            # stdin wrapper is closed.
-            try:
-                sys.stdin.close()
-            except:
-                pass
-            raise SystemExit(code)
-    builtins.quit = Quitter('quit')
-    builtins.exit = Quitter('exit')
+    builtins.quit = _sitebuiltins.Quitter('quit', eof)
+    builtins.exit = _sitebuiltins.Quitter('exit', eof)
 
 
-class _Printer(object):
-    """interactive prompt objects for printing the license text, a list of
-    contributors and the copyright notice."""
-
-    MAXLINES = 23
-
-    def __init__(self, name, data, files=(), dirs=()):
-        self.__name = name
-        self.__data = data
-        self.__files = files
-        self.__dirs = dirs
-        self.__lines = None
-
-    def __setup(self):
-        if self.__lines:
-            return
-        data = None
-        for dir in self.__dirs:
-            for filename in self.__files:
-                filename = os.path.join(dir, filename)
-                try:
-                    fp = open(filename, "r")
-                    data = fp.read()
-                    fp.close()
-                    break
-                except IOError:
-                    pass
-            if data:
-                break
-        if not data:
-            data = self.__data
-        self.__lines = data.split('\n')
-        self.__linecnt = len(self.__lines)
-
-    def __repr__(self):
-        self.__setup()
-        if len(self.__lines) <= self.MAXLINES:
-            return "\n".join(self.__lines)
-        else:
-            return "Type %s() to see the full %s text" % ((self.__name,)*2)
-
-    def __call__(self):
-        self.__setup()
-        prompt = 'Hit Return for more, or q (and Return) to quit: '
-        lineno = 0
-        while 1:
-            try:
-                for i in range(lineno, lineno + self.MAXLINES):
-                    print(self.__lines[i])
-            except IndexError:
-                break
-            else:
-                lineno += self.MAXLINES
-                key = None
-                while key is None:
-                    key = input(prompt)
-                    if key not in ('', 'q'):
-                        key = None
-                if key == 'q':
-                    break
-
 def setcopyright():
     """Set 'copyright' and 'credits' in builtins"""
-    builtins.copyright = _Printer("copyright", sys.copyright)
+    builtins.copyright = _sitebuiltins._Printer("copyright", sys.copyright)
     if sys.platform[:4] == 'java':
-        builtins.credits = _Printer(
+        builtins.credits = _sitebuiltins._Printer(
             "credits",
             "Jython is maintained by the Jython developers (www.jython.org).")
     else:
-        builtins.credits = _Printer("credits", """\
+        builtins.credits = _sitebuiltins._Printer("credits", """\
     Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands
     for supporting Python development.  See www.python.org for more information.""")
-    here = os.path.dirname(os.__file__)
-    builtins.license = _Printer(
+    files, dirs = [], []
+    # Not all modules are required to have a __file__ attribute.  See
+    # PEP 420 for more details.
+    if hasattr(os, '__file__'):
+        here = os.path.dirname(os.__file__)
+        files.extend(["LICENSE.txt", "LICENSE"])
+        dirs.extend([os.path.join(here, os.pardir), here, os.curdir])
+    builtins.license = _sitebuiltins._Printer(
         "license",
-        "See http://www.python.org/download/releases/%.5s/license/" % sys.version,
-        ["LICENSE.txt", "LICENSE"],
-        [os.path.join(here, os.pardir), here, os.curdir])
+        "See https://www.python.org/psf/license/",
+        files, dirs)
 
 
-class _Helper(object):
-    """Define the builtin 'help'.
-    This is a wrapper around pydoc.help (with a twist).
-
-    """
-
-    def __repr__(self):
-        return "Type help() for interactive help, " \
-               "or help(object) for help about object."
-    def __call__(self, *args, **kwds):
-        import pydoc
-        return pydoc.help(*args, **kwds)
-
 def sethelper():
-    builtins.help = _Helper()
+    builtins.help = _sitebuiltins._Helper()
+
+def enablerlcompleter():
+    """Enable default readline configuration on interactive prompts, by
+    registering a sys.__interactivehook__.
+
+    If the readline module can be imported, the hook will set the Tab key
+    as completion key and register ~/.python_history as history file.
+    This can be overriden in the sitecustomize or usercustomize module,
+    or in a PYTHONSTARTUP file.
+    """
+    def register_readline():
+        import atexit
+        try:
+            import readline
+            import rlcompleter
+        except ImportError:
+            return
+
+        # Reading the initialization (config) file may not be enough to set a
+        # completion key, so we set one first and then read the file.
+        readline_doc = getattr(readline, '__doc__', '')
+        if readline_doc is not None and 'libedit' in readline_doc:
+            readline.parse_and_bind('bind ^I rl_complete')
+        else:
+            readline.parse_and_bind('tab: complete')
+
+        try:
+            readline.read_init_file()
+        except OSError:
+            # An OSError here could have many causes, but the most likely one
+            # is that there's no .inputrc file (or .editrc file in the case of
+            # Mac OS X + libedit) in the expected location.  In that case, we
+            # want to ignore the exception.
+            pass
+
+        if readline.get_current_history_length() == 0:
+            # If no history was loaded, default to .python_history.
+            # The guard is necessary to avoid doubling history size at
+            # each interpreter exit when readline was already configured
+            # through a PYTHONSTARTUP hook, see:
+            # http://bugs.python.org/issue5845#msg198636
+            history = os.path.join(os.path.expanduser('~'),
+                                   '.python_history')
+            try:
+                readline.read_history_file(history)
+            except IOError:
+                pass
+            atexit.register(readline.write_history_file, history)
+
+    sys.__interactivehook__ = register_readline
 
 def aliasmbcs():
     """On Windows, some default encodings are not provided by Python,
     while they are always available as "mbcs" in each locale. Make
     them usable by aliasing to "mbcs" in such a case."""
     if sys.platform == 'win32':
-        import locale, codecs
-        enc = locale.getdefaultlocale()[1]
+        import _bootlocale, codecs
+        enc = _bootlocale.getpreferredencoding(False)
         if enc.startswith('cp'):            # "cp***" ?
             try:
                 codecs.lookup(enc)
@@ -488,8 +445,7 @@
                 encodings._cache[enc] = encodings._unknown
                 encodings.aliases.aliases[enc] = 'mbcs'
 
-
-CONFIG_LINE = re.compile(r'^(?P<key>(\w|[-_])+)\s*=\s*(?P<value>.*)\s*$')
+CONFIG_LINE = r'^(?P<key>(\w|[-_])+)\s*=\s*(?P<value>.*)\s*$'
 
 def venv(known_paths):
     global PREFIXES, ENABLE_USER_SITE
@@ -512,12 +468,14 @@
         ]
 
     if candidate_confs:
+        import re
+        config_line = re.compile(CONFIG_LINE)
         virtual_conf = candidate_confs[0]
         system_site = "true"
         with open(virtual_conf) as f:
             for line in f:
                 line = line.strip()
-                m = CONFIG_LINE.match(line)
+                m = config_line.match(line)
                 if m:
                     d = m.groupdict()
                     key, value = d['key'].lower(), d['value']
@@ -589,11 +547,10 @@
         ENABLE_USER_SITE = check_enableusersite()
     known_paths = addusersitepackages(known_paths)
     known_paths = addsitepackages(known_paths)
-    if sys.platform == 'os2emx':
-        setBEGINLIBPATH()
     setquit()
     setcopyright()
     sethelper()
+    enablerlcompleter()
     aliasmbcs()
     execsitecustomize()
     if ENABLE_USER_SITE:
diff --git a/Lib/smtpd.py b/Lib/smtpd.py
index 778d6d6..1fa157a 100755
--- a/Lib/smtpd.py
+++ b/Lib/smtpd.py
@@ -121,8 +121,9 @@
         })
     max_command_size_limit = max(command_size_limits.values())
 
-    def __init__(self, server, conn, addr, data_size_limit=DATA_SIZE_DEFAULT):
-        asynchat.async_chat.__init__(self, conn)
+    def __init__(self, server, conn, addr, data_size_limit=DATA_SIZE_DEFAULT,
+                 map=None):
+        asynchat.async_chat.__init__(self, conn, map=map)
         self.smtp_server = server
         self.conn = conn
         self.addr = addr
@@ -137,7 +138,7 @@
         self.num_bytes = 0
         try:
             self.peer = conn.getpeername()
-        except socket.error as err:
+        except OSError as err:
             # a race condition  may occur if the other end is closing
             # before we can get the peername
             self.close()
@@ -576,11 +577,11 @@
     channel_class = SMTPChannel
 
     def __init__(self, localaddr, remoteaddr,
-                 data_size_limit=DATA_SIZE_DEFAULT):
+                 data_size_limit=DATA_SIZE_DEFAULT, map=None):
         self._localaddr = localaddr
         self._remoteaddr = remoteaddr
         self.data_size_limit = data_size_limit
-        asyncore.dispatcher.__init__(self)
+        asyncore.dispatcher.__init__(self, map=map)
         try:
             self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
             # try to re-use a server port if possible
@@ -597,7 +598,8 @@
 
     def handle_accepted(self, conn, addr):
         print('Incoming connection from %s' % repr(addr), file=DEBUGSTREAM)
-        channel = self.channel_class(self, conn, addr, self.data_size_limit)
+        channel = self.channel_class(self, conn, addr, self.data_size_limit,
+                                     self._map)
 
     # API for "doing something useful with the message"
     def process_message(self, peer, mailfrom, rcpttos, data):
@@ -668,7 +670,7 @@
         except smtplib.SMTPRecipientsRefused as e:
             print('got SMTPRecipientsRefused', file=DEBUGSTREAM)
             refused = e.recipients
-        except (socket.error, smtplib.SMTPException) as e:
+        except (OSError, smtplib.SMTPException) as e:
             print('got', e.__class__, file=DEBUGSTREAM)
             # All recipients were refused.  If the exception had an associated
             # error code, use it.  Otherwise,fake it with a non-triggering
@@ -778,7 +780,7 @@
         if opt in ('-h', '--help'):
             usage(0)
         elif opt in ('-V', '--version'):
-            print(__version__, file=sys.stderr)
+            print(__version__)
             sys.exit(0)
         elif opt in ('-n', '--nosetuid'):
             options.setuid = 0
@@ -850,8 +852,7 @@
         nobody = pwd.getpwnam('nobody')[2]
         try:
             os.setuid(nobody)
-        except OSError as e:
-            if e.errno != errno.EPERM: raise
+        except PermissionError:
             print('Cannot setuid "nobody"; try running with -n option.', file=sys.stderr)
             sys.exit(1)
     try:
diff --git a/Lib/smtplib.py b/Lib/smtplib.py
index 57f181b..fa7f9e6 100755
--- a/Lib/smtplib.py
+++ b/Lib/smtplib.py
@@ -67,7 +67,7 @@
 OLDSTYLE_AUTH = re.compile(r"auth=(.*)", re.I)
 
 # Exception classes used by this module.
-class SMTPException(Exception):
+class SMTPException(OSError):
     """Base class for all exceptions raised by this module."""
 
 class SMTPServerDisconnected(SMTPException):
@@ -233,6 +233,7 @@
         will be used.
 
         """
+        self._host = host
         self.timeout = timeout
         self.esmtp_features = {}
         self.source_address = source_address
@@ -312,7 +313,7 @@
                 try:
                     port = int(port)
                 except ValueError:
-                    raise socket.error("nonnumeric port")
+                    raise OSError("nonnumeric port")
         if not port:
             port = self.default_port
         if self.debuglevel > 0:
@@ -333,7 +334,7 @@
                 s = s.encode("ascii")
             try:
                 self.sock.sendall(s)
-            except socket.error:
+            except OSError:
                 self.close()
                 raise SMTPServerDisconnected('Server not connected')
         else:
@@ -366,7 +367,7 @@
         while 1:
             try:
                 line = self.file.readline(_MAXLINE + 1)
-            except socket.error as e:
+            except OSError as e:
                 self.close()
                 raise SMTPServerDisconnected("Connection unexpectedly closed: "
                                              + str(e))
@@ -376,6 +377,7 @@
             if self.debuglevel > 0:
                 print('reply:', repr(line), file=stderr)
             if len(line) > _MAXLINE:
+                self.close()
                 raise SMTPResponseException(500, "Line too long.")
             resp.append(line[4:].strip(b' \t\r\n'))
             code = line[:3]
@@ -477,6 +479,18 @@
         """SMTP 'rset' command -- resets session."""
         return self.docmd("rset")
 
+    def _rset(self):
+        """Internal 'rset' command which ignores any SMTPServerDisconnected error.
+
+        Used internally in the library, since the server disconnected error
+        should appear to the application when the *next* command is issued, if
+        we are doing an internal "safety" reset.
+        """
+        try:
+            self.rset()
+        except SMTPServerDisconnected:
+            pass
+
     def noop(self):
         """SMTP 'noop' command -- doesn't do anything :>"""
         return self.docmd("noop")
@@ -582,7 +596,7 @@
         def encode_cram_md5(challenge, user, password):
             challenge = base64.decodebytes(challenge)
             response = user + " " + hmac.HMAC(password.encode('ascii'),
-                                              challenge).hexdigest()
+                                              challenge, 'md5').hexdigest()
             return encode_base64(response.encode('ascii'), eol='')
 
         def encode_plain(user, password):
@@ -667,10 +681,11 @@
             if context is not None and certfile is not None:
                 raise ValueError("context and certfile arguments are mutually "
                                  "exclusive")
-            if context is not None:
-                self.sock = context.wrap_socket(self.sock)
-            else:
-                self.sock = ssl.wrap_socket(self.sock, keyfile, certfile)
+            if context is None:
+                context = ssl._create_stdlib_context(certfile=certfile,
+                                                     keyfile=keyfile)
+            self.sock = context.wrap_socket(self.sock,
+                                            server_hostname=self._host)
             self.file = None
             # RFC 3207:
             # The client MUST discard any knowledge obtained from
@@ -759,7 +774,7 @@
             if code == 421:
                 self.close()
             else:
-                self.rset()
+                self._rset()
             raise SMTPSenderRefused(code, resp, from_addr)
         senderrs = {}
         if isinstance(to_addrs, str):
@@ -773,14 +788,14 @@
                 raise SMTPRecipientsRefused(senderrs)
         if len(senderrs) == len(to_addrs):
             # the server refused all our recipients
-            self.rset()
+            self._rset()
             raise SMTPRecipientsRefused(senderrs)
         (code, resp) = self.data(msg)
         if code != 250:
             if code == 421:
                 self.close()
             else:
-                self.rset()
+                self._rset()
             raise SMTPDataError(code, resp)
         #if we got here then somebody got our mail
         return senderrs
@@ -850,6 +865,10 @@
     def quit(self):
         """Terminate the SMTP session."""
         res = self.docmd("quit")
+        # A new EHLO is required after reconnecting with connect()
+        self.ehlo_resp = self.helo_resp = None
+        self.esmtp_features = {}
+        self.does_esmtp = False
         self.close()
         return res
 
@@ -883,6 +902,9 @@
                                  "exclusive")
             self.keyfile = keyfile
             self.certfile = certfile
+            if context is None:
+                context = ssl._create_stdlib_context(certfile=certfile,
+                                                     keyfile=keyfile)
             self.context = context
             SMTP.__init__(self, host, port, local_hostname, timeout,
                     source_address)
@@ -892,10 +914,8 @@
                 print('connect:', (host, port), file=stderr)
             new_socket = socket.create_connection((host, port), timeout,
                     self.source_address)
-            if self.context is not None:
-                new_socket = self.context.wrap_socket(new_socket)
-            else:
-                new_socket = ssl.wrap_socket(new_socket, self.keyfile, self.certfile)
+            new_socket = self.context.wrap_socket(new_socket,
+                                                  server_hostname=self._host)
             return new_socket
 
     __all__.append("SMTP_SSL")
@@ -937,7 +957,7 @@
             self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
             self.file = None
             self.sock.connect(host)
-        except socket.error:
+        except OSError:
             if self.debuglevel > 0:
                 print('connect fail:', host, file=stderr)
             if self.sock:
diff --git a/Lib/sndhdr.py b/Lib/sndhdr.py
index 9f5dcc9..240e507 100644
--- a/Lib/sndhdr.py
+++ b/Lib/sndhdr.py
@@ -11,7 +11,7 @@
 - number of bits/sample, or 'U' for U-LAW, or 'A' for A-LAW
 
 If the file doesn't have a recognizable type, it returns None.
-If the file can't be opened, IOError is raised.
+If the file can't be opened, OSError is raised.
 
 To compute the total time, divide the number of frames by the
 sampling rate (a frame contains a sample for each channel).
@@ -137,14 +137,17 @@
 
 
 def test_wav(h, f):
+    import wave
     # 'RIFF' <len> 'WAVE' 'fmt ' <len>
     if not h.startswith(b'RIFF') or h[8:12] != b'WAVE' or h[12:16] != b'fmt ':
         return None
-    style = get_short_le(h[20:22])
-    nchannels = get_short_le(h[22:24])
-    rate = get_long_le(h[24:28])
-    sample_bits = get_short_le(h[34:36])
-    return 'wav', rate, nchannels, -1, sample_bits
+    f.seek(0)
+    try:
+        w = wave.openfp(f, 'r')
+    except (EOFError, wave.Error):
+        return None
+    return ('wav', w.getframerate(), w.getnchannels(),
+                   w.getnframes(), 8*w.getsampwidth())
 
 tests.append(test_wav)
 
@@ -230,7 +233,7 @@
             sys.stdout.flush()
             try:
                 print(what(filename))
-            except IOError:
+            except OSError:
                 print('*** not found ***')
 
 if __name__ == '__main__':
diff --git a/Lib/socket.py b/Lib/socket.py
index d4f1b65..8efd760 100644
--- a/Lib/socket.py
+++ b/Lib/socket.py
@@ -35,11 +35,13 @@
 error -- exception raised for I/O errors
 has_ipv6 -- boolean value indicating if IPv6 is supported
 
-Integer constants:
+IntEnum constants:
 
 AF_INET, AF_UNIX -- socket domains (first argument to socket() call)
 SOCK_STREAM, SOCK_DGRAM, SOCK_RAW -- socket types (second argument)
 
+Integer constants:
+
 Many other constants may be defined; these may be used in calls to
 the setsockopt() and getsockopt() methods.
 """
@@ -48,6 +50,7 @@
 from _socket import *
 
 import os, sys, io
+from enum import IntEnum
 
 try:
     import errno
@@ -57,9 +60,34 @@
 EAGAIN = getattr(errno, 'EAGAIN', 11)
 EWOULDBLOCK = getattr(errno, 'EWOULDBLOCK', 11)
 
-__all__ = ["getfqdn", "create_connection"]
+__all__ = ["fromfd", "getfqdn", "create_connection",
+        "AddressFamily", "SocketKind"]
 __all__.extend(os._get_exports_list(_socket))
 
+# Set up the socket.AF_* socket.SOCK_* constants as members of IntEnums for
+# nicer string representations.
+# Note that _socket only knows about the integer values. The public interface
+# in this module understands the enums and translates them back from integers
+# where needed (e.g. .family property of a socket object).
+AddressFamily = IntEnum('AddressFamily',
+                        {name: value for name, value in globals().items()
+                         if name.isupper() and name.startswith('AF_')})
+globals().update(AddressFamily.__members__)
+
+SocketKind = IntEnum('SocketKind',
+                     {name: value for name, value in globals().items()
+                      if name.isupper() and name.startswith('SOCK_')})
+globals().update(SocketKind.__members__)
+
+def _intenum_converter(value, enum_klass):
+    """Convert a numeric family value to an IntEnum member.
+
+    If it's not a known member, return the numeric value itself.
+    """
+    try:
+        return enum_klass(value)
+    except ValueError:
+        return value
 
 _realsocket = socket
 
@@ -91,6 +119,10 @@
     __slots__ = ["__weakref__", "_io_refs", "_closed"]
 
     def __init__(self, family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None):
+        # For user code address family and type values are IntEnum members, but
+        # for the underlying _socket.socket they're just integers. The
+        # constructor of _socket.socket converts the given argument to an
+        # integer automatically.
         _socket.socket.__init__(self, family, type, proto, fileno)
         self._io_refs = 0
         self._closed = False
@@ -103,13 +135,32 @@
             self.close()
 
     def __repr__(self):
-        """Wrap __repr__() to reveal the real class name."""
-        s = _socket.socket.__repr__(self)
-        if s.startswith("<socket object"):
-            s = "<%s.%s%s%s" % (self.__class__.__module__,
-                                self.__class__.__name__,
-                                getattr(self, '_closed', False) and " [closed] " or "",
-                                s[7:])
+        """Wrap __repr__() to reveal the real class name and socket
+        address(es).
+        """
+        closed = getattr(self, '_closed', False)
+        s = "<%s.%s%s fd=%i, family=%s, type=%s, proto=%i" \
+            % (self.__class__.__module__,
+               self.__class__.__name__,
+               " [closed]" if closed else "",
+               self.fileno(),
+               self.family,
+               self.type,
+               self.proto)
+        if not closed:
+            try:
+                laddr = self.getsockname()
+                if laddr:
+                    s += ", laddr=%s" % str(laddr)
+            except error:
+                pass
+            try:
+                raddr = self.getpeername()
+                if raddr:
+                    s += ", raddr=%s" % str(raddr)
+            except error:
+                pass
+        s += '>'
         return s
 
     def __getstate__(self):
@@ -118,7 +169,8 @@
     def dup(self):
         """dup() -> socket object
 
-        Return a new socket object connected to the same system resource.
+        Duplicate the socket. Return a new socket object connected to the same
+        system resource. The new socket is non-inheritable.
         """
         fd = dup(self.fileno())
         sock = self.__class__(self.family, self.type, self.proto, fileno=fd)
@@ -149,9 +201,8 @@
         except the only mode characters supported are 'r', 'w' and 'b'.
         The semantics are similar too.  (XXX refactor to share code?)
         """
-        for c in mode:
-            if c not in {"r", "w", "b"}:
-                raise ValueError("invalid mode %r (only r, w, b allowed)")
+        if not set(mode) <= {"r", "w", "b"}:
+            raise ValueError("invalid mode %r (only r, w, b allowed)" % (mode,))
         writing = "w" in mode
         reading = "r" in mode or not writing
         assert reading or writing
@@ -210,6 +261,31 @@
         self._closed = True
         return super().detach()
 
+    @property
+    def family(self):
+        """Read-only access to the address family for this socket.
+        """
+        return _intenum_converter(super().family, AddressFamily)
+
+    @property
+    def type(self):
+        """Read-only access to the socket type.
+        """
+        return _intenum_converter(super().type, SocketKind)
+
+    if os.name == 'nt':
+        def get_inheritable(self):
+            return os.get_handle_inheritable(self.fileno())
+        def set_inheritable(self, inheritable):
+            os.set_handle_inheritable(self.fileno(), inheritable)
+    else:
+        def get_inheritable(self):
+            return os.get_inheritable(self.fileno())
+        def set_inheritable(self, inheritable):
+            os.set_inheritable(self.fileno(), inheritable)
+    get_inheritable.__doc__ = "Get the inheritable flag of the socket"
+    set_inheritable.__doc__ = "Set the inheritable flag of the socket"
+
 def fromfd(fd, family, type, proto=0):
     """ fromfd(fd, family, type[, proto]) -> socket object
 
@@ -223,10 +299,11 @@
     def fromshare(info):
         """ fromshare(info) -> socket object
 
-        Create a socket object from a the bytes object returned by
+        Create a socket object from the bytes object returned by
         socket.share(pid).
         """
         return socket(0, 0, 0, info)
+    __all__.append("fromshare")
 
 if hasattr(_socket, "socketpair"):
 
@@ -291,7 +368,7 @@
         self._checkClosed()
         self._checkReadable()
         if self._timeout_occurred:
-            raise IOError("cannot read from timed out object")
+            raise OSError("cannot read from timed out object")
         while True:
             try:
                 return self._sock.recv_into(b)
@@ -435,3 +512,27 @@
         raise err
     else:
         raise error("getaddrinfo returns an empty list")
+
+def getaddrinfo(host, port, family=0, type=0, proto=0, flags=0):
+    """Resolve host and port into list of address info entries.
+
+    Translate the host/port argument into a sequence of 5-tuples that contain
+    all the necessary arguments for creating a socket connected to that service.
+    host is a domain name, a string representation of an IPv4/v6 address or
+    None. port is a string service name such as 'http', a numeric port number or
+    None. By passing None as the value of host and port, you can pass NULL to
+    the underlying C API.
+
+    The family, type and proto arguments can be optionally specified in order to
+    narrow the list of addresses returned. Passing zero as a value for each of
+    these arguments selects the full range of results.
+    """
+    # We override this function since we want to translate the numeric family
+    # and socket type values to enum constants.
+    addrlist = []
+    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
+        af, socktype, proto, canonname, sa = res
+        addrlist.append((_intenum_converter(af, AddressFamily),
+                         _intenum_converter(socktype, SocketKind),
+                         proto, canonname, sa))
+    return addrlist
diff --git a/Lib/socketserver.py b/Lib/socketserver.py
index 8332fdf..7339911 100644
--- a/Lib/socketserver.py
+++ b/Lib/socketserver.py
@@ -131,7 +131,6 @@
 
 import socket
 import select
-import sys
 import os
 import errno
 try:
@@ -299,7 +298,7 @@
         """
         try:
             request, client_address = self.get_request()
-        except socket.error:
+        except OSError:
             return
         if self.verify_request(request, client_address):
             try:
@@ -427,8 +426,12 @@
         self.socket = socket.socket(self.address_family,
                                     self.socket_type)
         if bind_and_activate:
-            self.server_bind()
-            self.server_activate()
+            try:
+                self.server_bind()
+                self.server_activate()
+            except:
+                self.server_close()
+                raise
 
     def server_bind(self):
         """Called by constructor to bind the socket.
@@ -479,7 +482,7 @@
             #explicitly shutdown.  socket.close() merely releases
             #the socket and waits for GC to perform the actual close.
             request.shutdown(socket.SHUT_WR)
-        except socket.error:
+        except OSError:
             pass #some platforms may raise ENOTCONN here
         self.close_request(request)
 
@@ -524,35 +527,39 @@
 
     def collect_children(self):
         """Internal routine to wait for children that have exited."""
-        if self.active_children is None: return
-        while len(self.active_children) >= self.max_children:
-            # XXX: This will wait for any child process, not just ones
-            # spawned by this library. This could confuse other
-            # libraries that expect to be able to wait for their own
-            # children.
-            try:
-                pid, status = os.waitpid(0, 0)
-            except os.error:
-                pid = None
-            if pid not in self.active_children: continue
-            self.active_children.remove(pid)
+        if self.active_children is None:
+            return
 
-        # XXX: This loop runs more system calls than it ought
-        # to. There should be a way to put the active_children into a
-        # process group and then use os.waitpid(-pgid) to wait for any
-        # of that set, but I couldn't find a way to allocate pgids
-        # that couldn't collide.
-        for child in self.active_children:
+        # If we're above the max number of children, wait and reap them until
+        # we go back below threshold. Note that we use waitpid(-1) below to be
+        # able to collect children in size(<defunct children>) syscalls instead
+        # of size(<children>): the downside is that this might reap children
+        # which we didn't spawn, which is why we only resort to this when we're
+        # above max_children.
+        while len(self.active_children) >= self.max_children:
             try:
-                pid, status = os.waitpid(child, os.WNOHANG)
-            except os.error:
-                pid = None
-            if not pid: continue
+                pid, _ = os.waitpid(-1, 0)
+                self.active_children.discard(pid)
+            except InterruptedError:
+                pass
+            except ChildProcessError:
+                # we don't have any children, we're done
+                self.active_children.clear()
+            except OSError:
+                break
+
+        # Now reap all defunct children.
+        for pid in self.active_children.copy():
             try:
-                self.active_children.remove(pid)
-            except ValueError as e:
-                raise ValueError('%s. x=%d and list=%r' % (e.message, pid,
-                                                           self.active_children))
+                pid, _ = os.waitpid(pid, os.WNOHANG)
+                # if the child hasn't exited yet, pid will be 0 and ignored by
+                # discard() below
+                self.active_children.discard(pid)
+            except ChildProcessError:
+                # someone else reaped it
+                self.active_children.discard(pid)
+            except OSError:
+                pass
 
     def handle_timeout(self):
         """Wait for zombies after self.timeout seconds of inactivity.
@@ -574,8 +581,8 @@
         if pid:
             # Parent process
             if self.active_children is None:
-                self.active_children = []
-            self.active_children.append(pid)
+                self.active_children = set()
+            self.active_children.add(pid)
             self.close_request(request)
             return
         else:
diff --git a/Lib/sqlite3/dbapi2.py b/Lib/sqlite3/dbapi2.py
index 9a0b766..991682c 100644
--- a/Lib/sqlite3/dbapi2.py
+++ b/Lib/sqlite3/dbapi2.py
@@ -22,6 +22,7 @@
 
 import datetime
 import time
+import collections.abc
 
 from _sqlite3 import *
 
@@ -50,6 +51,7 @@
 sqlite_version_info = tuple([int(x) for x in sqlite_version.split(".")])
 
 Binary = memoryview
+collections.abc.Sequence.register(Row)
 
 def register_adapters_and_converters():
     def adapt_date(val):
diff --git a/Lib/sqlite3/test/dbapi.py b/Lib/sqlite3/test/dbapi.py
index b7ec1ad..04649fc 100644
--- a/Lib/sqlite3/test/dbapi.py
+++ b/Lib/sqlite3/test/dbapi.py
@@ -28,6 +28,9 @@
 except ImportError:
     threading = None
 
+from test.support import TESTFN, unlink
+
+
 class ModuleTests(unittest.TestCase):
     def CheckAPILevel(self):
         self.assertEqual(sqlite.apilevel, "2.0",
@@ -163,6 +166,21 @@
         with self.assertRaises(AttributeError):
             self.cx.in_transaction = True
 
+    def CheckOpenUri(self):
+        if sqlite.sqlite_version_info < (3, 7, 7):
+            with self.assertRaises(sqlite.NotSupportedError):
+                sqlite.connect(':memory:', uri=True)
+            return
+        self.addCleanup(unlink, TESTFN)
+        with sqlite.connect(TESTFN) as cx:
+            cx.execute('create table test(id integer)')
+        with sqlite.connect('file:' + TESTFN, uri=True) as cx:
+            cx.execute('insert into test(id) values(0)')
+        with sqlite.connect('file:' + TESTFN + '?mode=ro', uri=True) as cx:
+            with self.assertRaises(sqlite.OperationalError):
+                cx.execute('insert into test(id) values(1)')
+
+
 class CursorTests(unittest.TestCase):
     def setUp(self):
         self.cx = sqlite.connect(":memory:")
diff --git a/Lib/sqlite3/test/factory.py b/Lib/sqlite3/test/factory.py
index 1013755..98dcae5 100644
--- a/Lib/sqlite3/test/factory.py
+++ b/Lib/sqlite3/test/factory.py
@@ -23,6 +23,7 @@
 
 import unittest
 import sqlite3 as sqlite
+from collections.abc import Sequence
 
 class MyConnection(sqlite.Connection):
     def __init__(self, *args, **kwargs):
@@ -96,9 +97,19 @@
         self.assertEqual(col1, 1, "by name: wrong result for column 'A'")
         self.assertEqual(col2, 2, "by name: wrong result for column 'B'")
 
-        col1, col2 = row[0], row[1]
-        self.assertEqual(col1, 1, "by index: wrong result for column 0")
-        self.assertEqual(col2, 2, "by index: wrong result for column 1")
+        self.assertEqual(row[0], 1, "by index: wrong result for column 0")
+        self.assertEqual(row[1], 2, "by index: wrong result for column 1")
+        self.assertEqual(row[-1], 2, "by index: wrong result for column -1")
+        self.assertEqual(row[-2], 1, "by index: wrong result for column -2")
+
+        with self.assertRaises(IndexError):
+            row['c']
+        with self.assertRaises(IndexError):
+            row[2]
+        with self.assertRaises(IndexError):
+            row[-3]
+        with self.assertRaises(IndexError):
+            row[2**1000]
 
     def CheckSqliteRowIter(self):
         """Checks if the row object is iterable"""
@@ -142,6 +153,15 @@
         self.assertNotEqual(row_1, row_3)
         self.assertNotEqual(hash(row_1), hash(row_3))
 
+    def CheckSqliteRowAsSequence(self):
+        """ Checks if the row object can act like a sequence """
+        self.con.row_factory = sqlite.Row
+        row = self.con.execute("select 1 as a, 2 as b").fetchone()
+
+        as_tuple = tuple(row)
+        self.assertEqual(list(reversed(row)), list(reversed(as_tuple)))
+        self.assertIsInstance(row, Sequence)
+
     def tearDown(self):
         self.con.close()
 
diff --git a/Lib/sqlite3/test/regression.py b/Lib/sqlite3/test/regression.py
index c557ab6..eaaaa2c 100644
--- a/Lib/sqlite3/test/regression.py
+++ b/Lib/sqlite3/test/regression.py
@@ -336,6 +336,16 @@
                           sqlite.connect, ":memory:", isolation_level=123)
 
 
+    def CheckNullCharacter(self):
+        # Issue #21147
+        con = sqlite.connect(":memory:")
+        self.assertRaises(ValueError, con, "\0select 1")
+        self.assertRaises(ValueError, con, "select 1\0")
+        cur = con.cursor()
+        self.assertRaises(ValueError, cur.execute, " \0select 2")
+        self.assertRaises(ValueError, cur.execute, "select 2\0")
+
+
 def suite():
     regression_suite = unittest.makeSuite(RegressionTests, "Check")
     return unittest.TestSuite((regression_suite,))
diff --git a/Lib/sre_compile.py b/Lib/sre_compile.py
index b984a54..550ea15 100644
--- a/Lib/sre_compile.py
+++ b/Lib/sre_compile.py
@@ -10,9 +10,10 @@
 
 """Internal support module for sre"""
 
-import _sre, sys
+import _sre
 import sre_parse
 from sre_constants import *
+from _sre import MAXREPEAT
 
 assert _sre.MAGIC == MAGIC, "SRE module mismatch"
 
@@ -21,14 +22,51 @@
 else:
     MAXCODE = 0xFFFFFFFF
 
-def _identityfunction(x):
-    return x
-
 _LITERAL_CODES = set([LITERAL, NOT_LITERAL])
 _REPEATING_CODES = set([REPEAT, MIN_REPEAT, MAX_REPEAT])
 _SUCCESS_CODES = set([SUCCESS, FAILURE])
 _ASSERT_CODES = set([ASSERT, ASSERT_NOT])
 
+# Sets of lowercase characters which have the same uppercase.
+_equivalences = (
+    # LATIN SMALL LETTER I, LATIN SMALL LETTER DOTLESS I
+    (0x69, 0x131), # iı
+    # LATIN SMALL LETTER S, LATIN SMALL LETTER LONG S
+    (0x73, 0x17f), # sſ
+    # MICRO SIGN, GREEK SMALL LETTER MU
+    (0xb5, 0x3bc), # µμ
+    # COMBINING GREEK YPOGEGRAMMENI, GREEK SMALL LETTER IOTA, GREEK PROSGEGRAMMENI
+    (0x345, 0x3b9, 0x1fbe), # \u0345ιι
+    # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS, GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA
+    (0x390, 0x1fd3), # ΐΐ
+    # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS, GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND OXIA
+    (0x3b0, 0x1fe3), # ΰΰ
+    # GREEK SMALL LETTER BETA, GREEK BETA SYMBOL
+    (0x3b2, 0x3d0), # βϐ
+    # GREEK SMALL LETTER EPSILON, GREEK LUNATE EPSILON SYMBOL
+    (0x3b5, 0x3f5), # εϵ
+    # GREEK SMALL LETTER THETA, GREEK THETA SYMBOL
+    (0x3b8, 0x3d1), # θϑ
+    # GREEK SMALL LETTER KAPPA, GREEK KAPPA SYMBOL
+    (0x3ba, 0x3f0), # κϰ
+    # GREEK SMALL LETTER PI, GREEK PI SYMBOL
+    (0x3c0, 0x3d6), # πϖ
+    # GREEK SMALL LETTER RHO, GREEK RHO SYMBOL
+    (0x3c1, 0x3f1), # ρϱ
+    # GREEK SMALL LETTER FINAL SIGMA, GREEK SMALL LETTER SIGMA
+    (0x3c2, 0x3c3), # ςσ
+    # GREEK SMALL LETTER PHI, GREEK PHI SYMBOL
+    (0x3c6, 0x3d5), # φϕ
+    # LATIN SMALL LETTER S WITH DOT ABOVE, LATIN SMALL LETTER LONG S WITH DOT ABOVE
+    (0x1e61, 0x1e9b), # ṡẛ
+    # LATIN SMALL LIGATURE LONG S T, LATIN SMALL LIGATURE ST
+    (0xfb05, 0xfb06), # ſtst
+)
+
+# Maps the lowercase code to lowercase codes which have the same uppercase.
+_ignorecase_fixes = {i: tuple(j for j in t if i != j)
+                     for t in _equivalences for i in t}
+
 def _compile(code, pattern, flags):
     # internal: compile a (sub)pattern
     emit = code.append
@@ -37,11 +75,29 @@
     REPEATING_CODES = _REPEATING_CODES
     SUCCESS_CODES = _SUCCESS_CODES
     ASSERT_CODES = _ASSERT_CODES
+    if (flags & SRE_FLAG_IGNORECASE and
+            not (flags & SRE_FLAG_LOCALE) and
+            flags & SRE_FLAG_UNICODE):
+        fixes = _ignorecase_fixes
+    else:
+        fixes = None
     for op, av in pattern:
         if op in LITERAL_CODES:
             if flags & SRE_FLAG_IGNORECASE:
-                emit(OPCODES[OP_IGNORE[op]])
-                emit(_sre.getlower(av, flags))
+                lo = _sre.getlower(av, flags)
+                if fixes and lo in fixes:
+                    emit(OPCODES[IN_IGNORE])
+                    skip = _len(code); emit(0)
+                    if op is NOT_LITERAL:
+                        emit(OPCODES[NEGATE])
+                    for k in (lo,) + fixes[lo]:
+                        emit(OPCODES[LITERAL])
+                        emit(k)
+                    emit(OPCODES[FAILURE])
+                    code[skip] = _len(code) - skip
+                else:
+                    emit(OPCODES[OP_IGNORE[op]])
+                    emit(lo)
             else:
                 emit(OPCODES[op])
                 emit(av)
@@ -52,9 +108,9 @@
                     return _sre.getlower(literal, flags)
             else:
                 emit(OPCODES[op])
-                fixup = _identityfunction
+                fixup = None
             skip = _len(code); emit(0)
-            _compile_charset(av, flags, code, fixup)
+            _compile_charset(av, flags, code, fixup, fixes)
             code[skip] = _len(code) - skip
         elif op is ANY:
             if flags & SRE_FLAG_DOTALL:
@@ -64,13 +120,6 @@
         elif op in REPEATING_CODES:
             if flags & SRE_FLAG_TEMPLATE:
                 raise error("internal: unsupported template operator")
-                emit(OPCODES[REPEAT])
-                skip = _len(code); emit(0)
-                emit(av[0])
-                emit(av[1])
-                _compile(code, av[2], flags)
-                emit(OPCODES[SUCCESS])
-                code[skip] = _len(code) - skip
             elif _simple(av) and op is not REPEAT:
                 if op is MAX_REPEAT:
                     emit(OPCODES[REPEAT_ONE])
@@ -175,20 +224,19 @@
         else:
             raise ValueError("unsupported operand type", op)
 
-def _compile_charset(charset, flags, code, fixup=None):
+def _compile_charset(charset, flags, code, fixup=None, fixes=None):
     # compile charset subprogram
     emit = code.append
-    if fixup is None:
-        fixup = _identityfunction
-    for op, av in _optimize_charset(charset, fixup):
+    for op, av in _optimize_charset(charset, fixup, fixes,
+                                    flags & SRE_FLAG_UNICODE):
         emit(OPCODES[op])
         if op is NEGATE:
             pass
         elif op is LITERAL:
-            emit(fixup(av))
+            emit(av)
         elif op is RANGE:
-            emit(fixup(av[0]))
-            emit(fixup(av[1]))
+            emit(av[0])
+            emit(av[1])
         elif op is CHARSET:
             code.extend(av)
         elif op is BIGCHARSET:
@@ -204,161 +252,195 @@
             raise error("internal: unsupported set operator")
     emit(OPCODES[FAILURE])
 
-def _optimize_charset(charset, fixup):
+def _optimize_charset(charset, fixup, fixes, isunicode):
     # internal: optimize character set
     out = []
-    outappend = out.append
-    charmap = [0]*256
-    try:
-        for op, av in charset:
-            if op is NEGATE:
-                outappend((op, av))
-            elif op is LITERAL:
-                charmap[fixup(av)] = 1
-            elif op is RANGE:
-                for i in range(fixup(av[0]), fixup(av[1])+1):
-                    charmap[i] = 1
-            elif op is CATEGORY:
-                # XXX: could append to charmap tail
-                return charset # cannot compress
-    except IndexError:
-        # character set contains unicode characters
-        return _optimize_unicode(charset, fixup)
+    tail = []
+    charmap = bytearray(256)
+    for op, av in charset:
+        while True:
+            try:
+                if op is LITERAL:
+                    if fixup:
+                        i = fixup(av)
+                        charmap[i] = 1
+                        if fixes and i in fixes:
+                            for k in fixes[i]:
+                                charmap[k] = 1
+                    else:
+                        charmap[av] = 1
+                elif op is RANGE:
+                    r = range(av[0], av[1]+1)
+                    if fixup:
+                        r = map(fixup, r)
+                    if fixup and fixes:
+                        for i in r:
+                            charmap[i] = 1
+                            if i in fixes:
+                                for k in fixes[i]:
+                                    charmap[k] = 1
+                    else:
+                        for i in r:
+                            charmap[i] = 1
+                elif op is NEGATE:
+                    out.append((op, av))
+                else:
+                    tail.append((op, av))
+            except IndexError:
+                if len(charmap) == 256:
+                    # character set contains non-UCS1 character codes
+                    charmap += b'\0' * 0xff00
+                    continue
+                # character set contains non-BMP character codes
+                if fixup and isunicode and op is RANGE:
+                    lo, hi = av
+                    ranges = [av]
+                    # There are only two ranges of cased astral characters:
+                    # 10400-1044F (Deseret) and 118A0-118DF (Warang Citi).
+                    _fixup_range(max(0x10000, lo), min(0x11fff, hi),
+                                 ranges, fixup)
+                    for lo, hi in ranges:
+                        if lo == hi:
+                            tail.append((LITERAL, hi))
+                        else:
+                            tail.append((RANGE, (lo, hi)))
+                else:
+                    tail.append((op, av))
+            break
+
     # compress character map
-    i = p = n = 0
     runs = []
-    runsappend = runs.append
-    for c in charmap:
-        if c:
-            if n == 0:
-                p = i
-            n = n + 1
-        elif n:
-            runsappend((p, n))
-            n = 0
-        i = i + 1
-    if n:
-        runsappend((p, n))
-    if len(runs) <= 2:
+    q = 0
+    while True:
+        p = charmap.find(1, q)
+        if p < 0:
+            break
+        if len(runs) >= 2:
+            runs = None
+            break
+        q = charmap.find(0, p)
+        if q < 0:
+            runs.append((p, len(charmap)))
+            break
+        runs.append((p, q))
+    if runs is not None:
         # use literal/range
-        for p, n in runs:
-            if n == 1:
-                outappend((LITERAL, p))
+        for p, q in runs:
+            if q - p == 1:
+                out.append((LITERAL, p))
             else:
-                outappend((RANGE, (p, p+n-1)))
-        if len(out) < len(charset):
+                out.append((RANGE, (p, q - 1)))
+        out += tail
+        # if the case was changed or new representation is more compact
+        if fixup or len(out) < len(charset):
             return out
-    else:
-        # use bitmap
+        # else original character set is good enough
+        return charset
+
+    # use bitmap
+    if len(charmap) == 256:
         data = _mk_bitmap(charmap)
-        outappend((CHARSET, data))
+        out.append((CHARSET, data))
+        out += tail
         return out
-    return charset
 
-def _mk_bitmap(bits):
-    data = []
-    dataappend = data.append
-    if _sre.CODESIZE == 2:
-        start = (1, 0)
-    else:
-        start = (1, 0)
-    m, v = start
-    for c in bits:
-        if c:
-            v = v + m
-        m = m + m
-        if m > MAXCODE:
-            dataappend(v)
-            m, v = start
-    return data
+    # To represent a big charset, first a bitmap of all characters in the
+    # set is constructed. Then, this bitmap is sliced into chunks of 256
+    # characters, duplicate chunks are eliminated, and each chunk is
+    # given a number. In the compiled expression, the charset is
+    # represented by a 32-bit word sequence, consisting of one word for
+    # the number of different chunks, a sequence of 256 bytes (64 words)
+    # of chunk numbers indexed by their original chunk position, and a
+    # sequence of 256-bit chunks (8 words each).
 
-# To represent a big charset, first a bitmap of all characters in the
-# set is constructed. Then, this bitmap is sliced into chunks of 256
-# characters, duplicate chunks are eliminated, and each chunk is
-# given a number. In the compiled expression, the charset is
-# represented by a 32-bit word sequence, consisting of one word for
-# the number of different chunks, a sequence of 256 bytes (64 words)
-# of chunk numbers indexed by their original chunk position, and a
-# sequence of 256-bit chunks (8 words each).
+    # Compression is normally good: in a typical charset, large ranges of
+    # Unicode will be either completely excluded (e.g. if only cyrillic
+    # letters are to be matched), or completely included (e.g. if large
+    # subranges of Kanji match). These ranges will be represented by
+    # chunks of all one-bits or all zero-bits.
 
-# Compression is normally good: in a typical charset, large ranges of
-# Unicode will be either completely excluded (e.g. if only cyrillic
-# letters are to be matched), or completely included (e.g. if large
-# subranges of Kanji match). These ranges will be represented by
-# chunks of all one-bits or all zero-bits.
+    # Matching can be also done efficiently: the more significant byte of
+    # the Unicode character is an index into the chunk number, and the
+    # less significant byte is a bit index in the chunk (just like the
+    # CHARSET matching).
 
-# Matching can be also done efficiently: the more significant byte of
-# the Unicode character is an index into the chunk number, and the
-# less significant byte is a bit index in the chunk (just like the
-# CHARSET matching).
-
-# The BIGCHARSET opcode still supports only subsets
-# of the basic multilingual plane; an efficient representation
-# for all of Unicode has not yet been developed. This means,
-# in particular, that negated charsets cannot be represented as
-# bigcharsets.
-
-def _optimize_unicode(charset, fixup):
-    try:
-        import array
-    except ImportError:
-        return charset
-    charmap = [0]*65536
-    negate = 0
-    try:
-        for op, av in charset:
-            if op is NEGATE:
-                negate = 1
-            elif op is LITERAL:
-                charmap[fixup(av)] = 1
-            elif op is RANGE:
-                for i in range(fixup(av[0]), fixup(av[1])+1):
-                    charmap[i] = 1
-            elif op is CATEGORY:
-                # XXX: could expand category
-                return charset # cannot compress
-    except IndexError:
-        # non-BMP characters; XXX now they should work
-        return charset
-    if negate:
-        if sys.maxunicode != 65535:
-            # XXX: negation does not work with big charsets
-            # XXX2: now they should work, but removing this will make the
-            # charmap 17 times bigger
-            return charset
-        for i in range(65536):
-            charmap[i] = not charmap[i]
+    charmap = bytes(charmap) # should be hashable
     comps = {}
-    mapping = [0]*256
+    mapping = bytearray(256)
     block = 0
-    data = []
-    for i in range(256):
-        chunk = tuple(charmap[i*256:(i+1)*256])
-        new = comps.setdefault(chunk, block)
-        mapping[i] = new
-        if new == block:
-            block = block + 1
-            data = data + _mk_bitmap(chunk)
-    header = [block]
-    if _sre.CODESIZE == 2:
-        code = 'H'
-    else:
-        code = 'I'
-    # Convert block indices to byte array of 256 bytes
-    mapping = array.array('B', mapping).tobytes()
-    # Convert byte array to word array
-    mapping = array.array(code, mapping)
-    assert mapping.itemsize == _sre.CODESIZE
-    assert len(mapping) * mapping.itemsize == 256
-    header = header + mapping.tolist()
-    data[0:0] = header
-    return [(BIGCHARSET, data)]
+    data = bytearray()
+    for i in range(0, 65536, 256):
+        chunk = charmap[i: i + 256]
+        if chunk in comps:
+            mapping[i // 256] = comps[chunk]
+        else:
+            mapping[i // 256] = comps[chunk] = block
+            block += 1
+            data += chunk
+    data = _mk_bitmap(data)
+    data[0:0] = [block] + _bytes_to_codes(mapping)
+    out.append((BIGCHARSET, data))
+    out += tail
+    return out
+
+def _fixup_range(lo, hi, ranges, fixup):
+    for i in map(fixup, range(lo, hi+1)):
+        for k, (lo, hi) in enumerate(ranges):
+            if i < lo:
+                if l == lo - 1:
+                    ranges[k] = (i, hi)
+                else:
+                    ranges.insert(k, (i, i))
+                break
+            elif i > hi:
+                if i == hi + 1:
+                    ranges[k] = (lo, i)
+                    break
+            else:
+                break
+        else:
+            ranges.append((i, i))
+
+_CODEBITS = _sre.CODESIZE * 8
+_BITS_TRANS = b'0' + b'1' * 255
+def _mk_bitmap(bits, _CODEBITS=_CODEBITS, _int=int):
+    s = bits.translate(_BITS_TRANS)[::-1]
+    return [_int(s[i - _CODEBITS: i], 2)
+            for i in range(len(s), 0, -_CODEBITS)]
+
+def _bytes_to_codes(b):
+    # Convert block indices to word array
+    a = memoryview(b).cast('I')
+    assert a.itemsize == _sre.CODESIZE
+    assert len(a) * a.itemsize == len(b)
+    return a.tolist()
 
 def _simple(av):
     # check if av is a "simple" operator
     lo, hi = av[2].getwidth()
     return lo == hi == 1 and av[2][0][0] != SUBPATTERN
 
+def _generate_overlap_table(prefix):
+    """
+    Generate an overlap table for the following prefix.
+    An overlap table is a table of the same size as the prefix which
+    informs about the potential self-overlap for each index in the prefix:
+    - if overlap[i] == 0, prefix[i:] can't overlap prefix[0:...]
+    - if overlap[i] == k with 0 < k <= i, prefix[i-k+1:i+1] overlaps with
+      prefix[0:k]
+    """
+    table = [0] * len(prefix)
+    for i in range(1, len(prefix)):
+        idx = table[i - 1]
+        while prefix[i] != prefix[idx]:
+            if idx == 0:
+                table[i] = 0
+                break
+            idx = table[idx - 1]
+        else:
+            table[i] = idx + 1
+    return table
+
 def _compile_info(code, pattern, flags):
     # internal: compile an info block.  in the current version,
     # this contains min/max pattern width, and an optional literal
@@ -455,12 +537,7 @@
         emit(prefix_skip) # skip
         code.extend(prefix)
         # generate overlap table
-        table = [-1] + ([0]*len(prefix))
-        for i in range(len(prefix)):
-            table[i+1] = table[i]+1
-            while table[i+1] > 0 and prefix[i] != prefix[table[i+1]-1]:
-                table[i+1] = table[table[i+1]-1]+1
-        code.extend(table[1:]) # don't store first entry
+        code.extend(_generate_overlap_table(prefix))
     elif charset:
         _compile_charset(charset, flags, code)
     code[skip] = len(code) - skip
diff --git a/Lib/sre_constants.py b/Lib/sre_constants.py
index 3fb5eac..23e3516 100644
--- a/Lib/sre_constants.py
+++ b/Lib/sre_constants.py
@@ -15,11 +15,7 @@
 
 MAGIC = 20031017
 
-try:
-    from _sre import MAXREPEAT
-except ImportError:
-    import _sre
-    MAXREPEAT = _sre.MAXREPEAT = 65535
+from _sre import MAXREPEAT
 
 # SRE standard exception (access as sre.error)
 # should this really be here?
@@ -254,6 +250,8 @@
     f.write("#define SRE_FLAG_DOTALL %d\n" % SRE_FLAG_DOTALL)
     f.write("#define SRE_FLAG_UNICODE %d\n" % SRE_FLAG_UNICODE)
     f.write("#define SRE_FLAG_VERBOSE %d\n" % SRE_FLAG_VERBOSE)
+    f.write("#define SRE_FLAG_DEBUG %d\n" % SRE_FLAG_DEBUG)
+    f.write("#define SRE_FLAG_ASCII %d\n" % SRE_FLAG_ASCII)
 
     f.write("#define SRE_INFO_PREFIX %d\n" % SRE_INFO_PREFIX)
     f.write("#define SRE_INFO_LITERAL %d\n" % SRE_INFO_LITERAL)
diff --git a/Lib/sre_parse.py b/Lib/sre_parse.py
index 8a77790..b56d437 100644
--- a/Lib/sre_parse.py
+++ b/Lib/sre_parse.py
@@ -12,9 +12,8 @@
 
 # XXX: show string offset and offending character for all errors
 
-import sys
-
 from sre_constants import *
+from _sre import MAXREPEAT
 
 SPECIAL_CHARS = ".\\[{()*+?^$|"
 REPEAT_CHARS = "*+?{"
@@ -95,33 +94,45 @@
         self.data = data
         self.width = None
     def dump(self, level=0):
-        nl = 1
+        nl = True
         seqtypes = (tuple, list)
         for op, av in self.data:
-            print(level*"  " + op, end=' '); nl = 0
-            if op == "in":
+            print(level*"  " + op, end='')
+            if op == IN:
                 # member sublanguage
-                print(); nl = 1
+                print()
                 for op, a in av:
                     print((level+1)*"  " + op, a)
-            elif op == "branch":
-                print(); nl = 1
-                i = 0
-                for a in av[1]:
-                    if i > 0:
+            elif op == BRANCH:
+                print()
+                for i, a in enumerate(av[1]):
+                    if i:
                         print(level*"  " + "or")
-                    a.dump(level+1); nl = 1
-                    i = i + 1
+                    a.dump(level+1)
+            elif op == GROUPREF_EXISTS:
+                condgroup, item_yes, item_no = av
+                print('', condgroup)
+                item_yes.dump(level+1)
+                if item_no:
+                    print(level*"  " + "else")
+                    item_no.dump(level+1)
             elif isinstance(av, seqtypes):
+                nl = False
                 for a in av:
                     if isinstance(a, SubPattern):
-                        if not nl: print()
-                        a.dump(level+1); nl = 1
+                        if not nl:
+                            print()
+                        a.dump(level+1)
+                        nl = True
                     else:
-                        print(a, end=' ') ; nl = 0
+                        if not nl:
+                            print(' ', end='')
+                        print(a, end='')
+                        nl = False
+                if not nl:
+                    print()
             else:
-                print(av, end=' ') ; nl = 0
-            if not nl: print()
+                print('', av)
     def __repr__(self):
         return repr(self.data)
     def __len__(self):
@@ -617,7 +628,8 @@
                                         "%r" % name)
                         gid = state.groupdict.get(name)
                         if gid is None:
-                            raise error("unknown group name")
+                            msg = "unknown group name: {0!r}".format(name)
+                            raise error(msg)
                         subpatternappend((GROUPREF, gid))
                         continue
                     else:
@@ -670,7 +682,8 @@
                     if condname.isidentifier():
                         condgroup = state.groupdict.get(condname)
                         if condgroup is None:
-                            raise error("unknown group name")
+                            msg = "unknown group name: {0!r}".format(condname)
+                            raise error(msg)
                     else:
                         try:
                             condgroup = int(condname)
@@ -768,35 +781,33 @@
     # group references
     s = Tokenizer(source)
     sget = s.get
-    p = []
-    a = p.append
-    def literal(literal, p=p, pappend=a):
-        if p and p[-1][0] is LITERAL:
-            p[-1] = LITERAL, p[-1][1] + literal
-        else:
-            pappend((LITERAL, literal))
-    sep = source[:0]
-    if isinstance(sep, str):
-        makechar = chr
-    else:
-        makechar = chr
-    while 1:
+    groups = []
+    literals = []
+    literal = []
+    lappend = literal.append
+    def addgroup(index):
+        if literal:
+            literals.append(''.join(literal))
+            del literal[:]
+        groups.append((len(literals), index))
+        literals.append(None)
+    while True:
         this = sget()
         if this is None:
             break # end of replacement string
-        if this and this[0] == "\\":
+        if this[0] == "\\":
             # group
-            c = this[1:2]
+            c = this[1]
             if c == "g":
                 name = ""
                 if s.match("<"):
-                    while 1:
+                    while True:
                         char = sget()
                         if char is None:
                             raise error("unterminated group name")
                         if char == ">":
                             break
-                        name = name + char
+                        name += char
                 if not name:
                     raise error("missing group name")
                 try:
@@ -809,51 +820,40 @@
                     try:
                         index = pattern.groupindex[name]
                     except KeyError:
-                        raise IndexError("unknown group name")
-                a((MARK, index))
+                        msg = "unknown group name: {0!r}".format(name)
+                        raise IndexError(msg)
+                addgroup(index)
             elif c == "0":
                 if s.next in OCTDIGITS:
-                    this = this + sget()
+                    this += sget()
                     if s.next in OCTDIGITS:
-                        this = this + sget()
-                literal(makechar(int(this[1:], 8) & 0xff))
+                        this += sget()
+                lappend(chr(int(this[1:], 8) & 0xff))
             elif c in DIGITS:
                 isoctal = False
                 if s.next in DIGITS:
-                    this = this + sget()
+                    this += sget()
                     if (c in OCTDIGITS and this[2] in OCTDIGITS and
                         s.next in OCTDIGITS):
-                        this = this + sget()
+                        this += sget()
                         isoctal = True
-                        literal(makechar(int(this[1:], 8) & 0xff))
+                        lappend(chr(int(this[1:], 8) & 0xff))
                 if not isoctal:
-                    a((MARK, int(this[1:])))
+                    addgroup(int(this[1:]))
             else:
                 try:
-                    this = makechar(ESCAPES[this][1])
+                    this = chr(ESCAPES[this][1])
                 except KeyError:
                     pass
-                literal(this)
+                lappend(this)
         else:
-            literal(this)
-    # convert template to groups and literals lists
-    i = 0
-    groups = []
-    groupsappend = groups.append
-    literals = [None] * len(p)
-    if isinstance(source, str):
-        encode = lambda x: x
-    else:
+            lappend(this)
+    if literal:
+        literals.append(''.join(literal))
+    if not isinstance(source, str):
         # The tokenizer implicitly decodes bytes objects as latin-1, we must
         # therefore re-encode the final representation.
-        encode = lambda x: x.encode('latin-1')
-    for c, s in p:
-        if c is MARK:
-            groupsappend((i, s))
-            # literal[i] is already None
-        else:
-            literals[i] = encode(s)
-        i = i + 1
+        literals = [None if s is None else s.encode('latin-1') for s in literals]
     return groups, literals
 
 def expand_template(template, match):
diff --git a/Lib/ssl.py b/Lib/ssl.py
index cd8d6b4..8c75f00 100644
--- a/Lib/ssl.py
+++ b/Lib/ssl.py
@@ -52,10 +52,47 @@
 PROTOCOL_SSLv3
 PROTOCOL_SSLv23
 PROTOCOL_TLSv1
+PROTOCOL_TLSv1_1
+PROTOCOL_TLSv1_2
+
+The following constants identify various SSL alert message descriptions as per
+http://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-parameters-6
+
+ALERT_DESCRIPTION_CLOSE_NOTIFY
+ALERT_DESCRIPTION_UNEXPECTED_MESSAGE
+ALERT_DESCRIPTION_BAD_RECORD_MAC
+ALERT_DESCRIPTION_RECORD_OVERFLOW
+ALERT_DESCRIPTION_DECOMPRESSION_FAILURE
+ALERT_DESCRIPTION_HANDSHAKE_FAILURE
+ALERT_DESCRIPTION_BAD_CERTIFICATE
+ALERT_DESCRIPTION_UNSUPPORTED_CERTIFICATE
+ALERT_DESCRIPTION_CERTIFICATE_REVOKED
+ALERT_DESCRIPTION_CERTIFICATE_EXPIRED
+ALERT_DESCRIPTION_CERTIFICATE_UNKNOWN
+ALERT_DESCRIPTION_ILLEGAL_PARAMETER
+ALERT_DESCRIPTION_UNKNOWN_CA
+ALERT_DESCRIPTION_ACCESS_DENIED
+ALERT_DESCRIPTION_DECODE_ERROR
+ALERT_DESCRIPTION_DECRYPT_ERROR
+ALERT_DESCRIPTION_PROTOCOL_VERSION
+ALERT_DESCRIPTION_INSUFFICIENT_SECURITY
+ALERT_DESCRIPTION_INTERNAL_ERROR
+ALERT_DESCRIPTION_USER_CANCELLED
+ALERT_DESCRIPTION_NO_RENEGOTIATION
+ALERT_DESCRIPTION_UNSUPPORTED_EXTENSION
+ALERT_DESCRIPTION_CERTIFICATE_UNOBTAINABLE
+ALERT_DESCRIPTION_UNRECOGNIZED_NAME
+ALERT_DESCRIPTION_BAD_CERTIFICATE_STATUS_RESPONSE
+ALERT_DESCRIPTION_BAD_CERTIFICATE_HASH_VALUE
+ALERT_DESCRIPTION_UNKNOWN_PSK_IDENTITY
 """
 
 import textwrap
 import re
+import sys
+import os
+from collections import namedtuple
+from enum import Enum as _Enum
 
 import _ssl             # if we can't import it, let the error propagate
 
@@ -66,40 +103,32 @@
     SSLSyscallError, SSLEOFError,
     )
 from _ssl import CERT_NONE, CERT_OPTIONAL, CERT_REQUIRED
-from _ssl import (
-    OP_ALL, OP_NO_SSLv2, OP_NO_SSLv3, OP_NO_TLSv1,
-    OP_CIPHER_SERVER_PREFERENCE, OP_SINGLE_DH_USE
-    )
+from _ssl import (VERIFY_DEFAULT, VERIFY_CRL_CHECK_LEAF, VERIFY_CRL_CHECK_CHAIN,
+    VERIFY_X509_STRICT)
+from _ssl import txt2obj as _txt2obj, nid2obj as _nid2obj
+from _ssl import RAND_status, RAND_add, RAND_bytes, RAND_pseudo_bytes
 try:
-    from _ssl import OP_NO_COMPRESSION
+    from _ssl import RAND_egd
 except ImportError:
+    # LibreSSL does not provide RAND_egd
     pass
-try:
-    from _ssl import OP_SINGLE_ECDH_USE
-except ImportError:
-    pass
-from _ssl import RAND_status, RAND_egd, RAND_add, RAND_bytes, RAND_pseudo_bytes
-from _ssl import (
-    SSL_ERROR_ZERO_RETURN,
-    SSL_ERROR_WANT_READ,
-    SSL_ERROR_WANT_WRITE,
-    SSL_ERROR_WANT_X509_LOOKUP,
-    SSL_ERROR_SYSCALL,
-    SSL_ERROR_SSL,
-    SSL_ERROR_WANT_CONNECT,
-    SSL_ERROR_EOF,
-    SSL_ERROR_INVALID_ERROR_CODE,
-    )
+
+def _import_symbols(prefix):
+    for n in dir(_ssl):
+        if n.startswith(prefix):
+            globals()[n] = getattr(_ssl, n)
+
+_import_symbols('OP_')
+_import_symbols('ALERT_DESCRIPTION_')
+_import_symbols('SSL_ERROR_')
+_import_symbols('PROTOCOL_')
+
 from _ssl import HAS_SNI, HAS_ECDH, HAS_NPN
-from _ssl import (PROTOCOL_SSLv3, PROTOCOL_SSLv23,
-                  PROTOCOL_TLSv1)
+
 from _ssl import _OPENSSL_API_VERSION
 
-_PROTOCOL_NAMES = {
-    PROTOCOL_TLSv1: "TLSv1",
-    PROTOCOL_SSLv23: "SSLv23",
-    PROTOCOL_SSLv3: "SSLv3",
-}
+
+_PROTOCOL_NAMES = {value: name for name, value in globals().items() if name.startswith('PROTOCOL_')}
 try:
     from _ssl import PROTOCOL_SSLv2
     _SSLv2_IF_EXISTS = PROTOCOL_SSLv2
@@ -108,14 +137,25 @@
 else:
     _PROTOCOL_NAMES[PROTOCOL_SSLv2] = "SSLv2"
 
-from socket import getnameinfo as _getnameinfo
-from socket import error as socket_error
+try:
+    from _ssl import PROTOCOL_TLSv1_1, PROTOCOL_TLSv1_2
+except ImportError:
+    pass
+else:
+    _PROTOCOL_NAMES[PROTOCOL_TLSv1_1] = "TLSv1.1"
+    _PROTOCOL_NAMES[PROTOCOL_TLSv1_2] = "TLSv1.2"
+
+if sys.platform == "win32":
+    from _ssl import enum_certificates, enum_crls
+
 from socket import socket, AF_INET, SOCK_STREAM, create_connection
 from socket import SOL_SOCKET, SO_TYPE
 import base64        # for DER-to-PEM translation
-import traceback
 import errno
 
+
+socket_error = OSError  # keep that public name in module namespace
+
 if _ssl.HAS_TLS_UNIQUE:
     CHANNEL_BINDING_TYPES = ['tls-unique']
 else:
@@ -123,7 +163,37 @@
 
 # Disable weak or insecure ciphers by default
 # (OpenSSL's default setting is 'DEFAULT:!aNULL:!eNULL')
-_DEFAULT_CIPHERS = 'DEFAULT:!aNULL:!eNULL:!LOW:!EXPORT:!SSLv2'
+# Enable a better set of ciphers by default
+# This list has been explicitly chosen to:
+#   * Prefer cipher suites that offer perfect forward secrecy (DHE/ECDHE)
+#   * Prefer ECDHE over DHE for better performance
+#   * Prefer any AES-GCM over any AES-CBC for better performance and security
+#   * Then Use HIGH cipher suites as a fallback
+#   * Then Use 3DES as fallback which is secure but slow
+#   * Finally use RC4 as a fallback which is problematic but needed for
+#     compatibility some times.
+#   * Disable NULL authentication, NULL encryption, and MD5 MACs for security
+#     reasons
+_DEFAULT_CIPHERS = (
+    'ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+HIGH:'
+    'DH+HIGH:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+HIGH:RSA+3DES:ECDH+RC4:'
+    'DH+RC4:RSA+RC4:!aNULL:!eNULL:!MD5'
+)
+
+# Restricted and more secure ciphers for the server side
+# This list has been explicitly chosen to:
+#   * Prefer cipher suites that offer perfect forward secrecy (DHE/ECDHE)
+#   * Prefer ECDHE over DHE for better performance
+#   * Prefer any AES-GCM over any AES-CBC for better performance and security
+#   * Then Use HIGH cipher suites as a fallback
+#   * Then Use 3DES as fallback which is secure but slow
+#   * Disable NULL authentication, NULL encryption, MD5 MACs, DSS, and RC4 for
+#     security reasons
+_RESTRICTED_SERVER_CIPHERS = (
+    'ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+HIGH:'
+    'DH+HIGH:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+HIGH:RSA+3DES:!aNULL:'
+    '!eNULL:!MD5:!DSS:!RC4'
+)
 
 
 class CertificateError(ValueError):
@@ -144,7 +214,7 @@
     wildcards = leftmost.count('*')
     if wildcards > max_wildcards:
         # Issue #17980: avoid denials of service by refusing more
-        # than one wildcard per fragment.  A survery of established
+        # than one wildcard per fragment.  A survey of established
         # policy among SSL implementations showed it to be a
         # reasonable choice.
         raise CertificateError(
@@ -188,7 +258,9 @@
     returns nothing.
     """
     if not cert:
-        raise ValueError("empty or no certificate")
+        raise ValueError("empty or no certificate, match_hostname needs a "
+                         "SSL socket or SSL context with either "
+                         "CERT_OPTIONAL or CERT_REQUIRED")
     dnsnames = []
     san = cert.get('subjectAltName', ())
     for key, value in san:
@@ -220,11 +292,58 @@
             "subjectAltName fields were found")
 
 
+DefaultVerifyPaths = namedtuple("DefaultVerifyPaths",
+    "cafile capath openssl_cafile_env openssl_cafile openssl_capath_env "
+    "openssl_capath")
+
+def get_default_verify_paths():
+    """Return paths to default cafile and capath.
+    """
+    parts = _ssl.get_default_verify_paths()
+
+    # environment vars shadow paths
+    cafile = os.environ.get(parts[0], parts[1])
+    capath = os.environ.get(parts[2], parts[3])
+
+    return DefaultVerifyPaths(cafile if os.path.isfile(cafile) else None,
+                              capath if os.path.isdir(capath) else None,
+                              *parts)
+
+
+class _ASN1Object(namedtuple("_ASN1Object", "nid shortname longname oid")):
+    """ASN.1 object identifier lookup
+    """
+    __slots__ = ()
+
+    def __new__(cls, oid):
+        return super().__new__(cls, *_txt2obj(oid, name=False))
+
+    @classmethod
+    def fromnid(cls, nid):
+        """Create _ASN1Object from OpenSSL numeric ID
+        """
+        return super().__new__(cls, *_nid2obj(nid))
+
+    @classmethod
+    def fromname(cls, name):
+        """Create _ASN1Object from short name, long name or OID
+        """
+        return super().__new__(cls, *_txt2obj(name, name=True))
+
+
+class Purpose(_ASN1Object, _Enum):
+    """SSLContext purpose flags with X509v3 Extended Key Usage objects
+    """
+    SERVER_AUTH = '1.3.6.1.5.5.7.3.1'
+    CLIENT_AUTH = '1.3.6.1.5.5.7.3.2'
+
+
 class SSLContext(_SSLContext):
     """An SSLContext holds various SSL-related configuration options and
     data, such as certificates and possibly a private key."""
 
-    __slots__ = ('protocol',)
+    __slots__ = ('protocol', '__weakref__')
+    _windows_cert_stores = ("CA", "ROOT")
 
     def __new__(cls, protocol, *args, **kwargs):
         self = _SSLContext.__new__(cls, protocol)
@@ -256,6 +375,121 @@
 
         self._set_npn_protocols(protos)
 
+    def _load_windows_store_certs(self, storename, purpose):
+        certs = bytearray()
+        for cert, encoding, trust in enum_certificates(storename):
+            # CA certs are never PKCS#7 encoded
+            if encoding == "x509_asn":
+                if trust is True or purpose.oid in trust:
+                    certs.extend(cert)
+        self.load_verify_locations(cadata=certs)
+        return certs
+
+    def load_default_certs(self, purpose=Purpose.SERVER_AUTH):
+        if not isinstance(purpose, _ASN1Object):
+            raise TypeError(purpose)
+        if sys.platform == "win32":
+            for storename in self._windows_cert_stores:
+                self._load_windows_store_certs(storename, purpose)
+        self.set_default_verify_paths()
+
+
+def create_default_context(purpose=Purpose.SERVER_AUTH, *, cafile=None,
+                           capath=None, cadata=None):
+    """Create a SSLContext object with default settings.
+
+    NOTE: The protocol and settings may change anytime without prior
+          deprecation. The values represent a fair balance between maximum
+          compatibility and security.
+    """
+    if not isinstance(purpose, _ASN1Object):
+        raise TypeError(purpose)
+
+    context = SSLContext(PROTOCOL_SSLv23)
+
+    # SSLv2 considered harmful.
+    context.options |= OP_NO_SSLv2
+
+    # SSLv3 has problematic security and is only required for really old
+    # clients such as IE6 on Windows XP
+    context.options |= OP_NO_SSLv3
+
+    # disable compression to prevent CRIME attacks (OpenSSL 1.0+)
+    context.options |= getattr(_ssl, "OP_NO_COMPRESSION", 0)
+
+    if purpose == Purpose.SERVER_AUTH:
+        # verify certs and host name in client mode
+        context.verify_mode = CERT_REQUIRED
+        context.check_hostname = True
+    elif purpose == Purpose.CLIENT_AUTH:
+        # Prefer the server's ciphers by default so that we get stronger
+        # encryption
+        context.options |= getattr(_ssl, "OP_CIPHER_SERVER_PREFERENCE", 0)
+
+        # Use single use keys in order to improve forward secrecy
+        context.options |= getattr(_ssl, "OP_SINGLE_DH_USE", 0)
+        context.options |= getattr(_ssl, "OP_SINGLE_ECDH_USE", 0)
+
+        # disallow ciphers with known vulnerabilities
+        context.set_ciphers(_RESTRICTED_SERVER_CIPHERS)
+
+    if cafile or capath or cadata:
+        context.load_verify_locations(cafile, capath, cadata)
+    elif context.verify_mode != CERT_NONE:
+        # no explicit cafile, capath or cadata but the verify mode is
+        # CERT_OPTIONAL or CERT_REQUIRED. Let's try to load default system
+        # root CA certificates for the given purpose. This may fail silently.
+        context.load_default_certs(purpose)
+    return context
+
+def _create_unverified_context(protocol=PROTOCOL_SSLv23, *, cert_reqs=None,
+                           check_hostname=False, purpose=Purpose.SERVER_AUTH,
+                           certfile=None, keyfile=None,
+                           cafile=None, capath=None, cadata=None):
+    """Create a SSLContext object for Python stdlib modules
+
+    All Python stdlib modules shall use this function to create SSLContext
+    objects in order to keep common settings in one place. The configuration
+    is less restrict than create_default_context()'s to increase backward
+    compatibility.
+    """
+    if not isinstance(purpose, _ASN1Object):
+        raise TypeError(purpose)
+
+    context = SSLContext(protocol)
+    # SSLv2 considered harmful.
+    context.options |= OP_NO_SSLv2
+    # SSLv3 has problematic security and is only required for really old
+    # clients such as IE6 on Windows XP
+    context.options |= OP_NO_SSLv3
+
+    if cert_reqs is not None:
+        context.verify_mode = cert_reqs
+    context.check_hostname = check_hostname
+
+    if keyfile and not certfile:
+        raise ValueError("certfile must be specified")
+    if certfile or keyfile:
+        context.load_cert_chain(certfile, keyfile)
+
+    # load CA root certs
+    if cafile or capath or cadata:
+        context.load_verify_locations(cafile, capath, cadata)
+    elif context.verify_mode != CERT_NONE:
+        # no explicit cafile, capath or cadata but the verify mode is
+        # CERT_OPTIONAL or CERT_REQUIRED. Let's try to load default system
+        # root CA certificates for the given purpose. This may fail silently.
+        context.load_default_certs(purpose)
+
+    return context
+
+# Used by http.client if no context is explicitly passed.
+_create_default_https_context = create_default_context
+
+
+# Backwards compatibility alias, even though it's not a public name.
+_create_stdlib_context = _create_unverified_context
+
 
 class SSLSocket(socket):
     """This class implements a subtype of socket.socket that wraps
@@ -272,7 +506,7 @@
                  _context=None):
 
         if _context:
-            self.context = _context
+            self._context = _context
         else:
             if server_side and not certfile:
                 raise ValueError("certfile must be specified for server-side "
@@ -281,16 +515,16 @@
                 raise ValueError("certfile must be specified")
             if certfile and not keyfile:
                 keyfile = certfile
-            self.context = SSLContext(ssl_version)
-            self.context.verify_mode = cert_reqs
+            self._context = SSLContext(ssl_version)
+            self._context.verify_mode = cert_reqs
             if ca_certs:
-                self.context.load_verify_locations(ca_certs)
+                self._context.load_verify_locations(ca_certs)
             if certfile:
-                self.context.load_cert_chain(certfile, keyfile)
+                self._context.load_cert_chain(certfile, keyfile)
             if npn_protocols:
-                self.context.set_npn_protocols(npn_protocols)
+                self._context.set_npn_protocols(npn_protocols)
             if ciphers:
-                self.context.set_ciphers(ciphers)
+                self._context.set_ciphers(ciphers)
             self.keyfile = keyfile
             self.certfile = certfile
             self.cert_reqs = cert_reqs
@@ -304,11 +538,12 @@
         if server_side and server_hostname:
             raise ValueError("server_hostname can only be specified "
                              "in client mode")
+        if self._context.check_hostname and not server_hostname:
+            raise ValueError("check_hostname requires server_hostname")
         self.server_side = server_side
         self.server_hostname = server_hostname
         self.do_handshake_on_connect = do_handshake_on_connect
         self.suppress_ragged_eofs = suppress_ragged_eofs
-        connected = False
         if sock is not None:
             socket.__init__(self,
                             family=sock.family,
@@ -316,27 +551,29 @@
                             proto=sock.proto,
                             fileno=sock.fileno())
             self.settimeout(sock.gettimeout())
-            # see if it's connected
-            try:
-                sock.getpeername()
-            except socket_error as e:
-                if e.errno != errno.ENOTCONN:
-                    raise
-            else:
-                connected = True
             sock.detach()
         elif fileno is not None:
             socket.__init__(self, fileno=fileno)
         else:
             socket.__init__(self, family=family, type=type, proto=proto)
 
+        # See if we are connected
+        try:
+            self.getpeername()
+        except OSError as e:
+            if e.errno != errno.ENOTCONN:
+                raise
+            connected = False
+        else:
+            connected = True
+
         self._closed = False
         self._sslobj = None
         self._connected = connected
         if connected:
             # create the SSL object
             try:
-                self._sslobj = self.context._wrap_socket(self, server_side,
+                self._sslobj = self._context._wrap_socket(self, server_side,
                                                          server_hostname)
                 if do_handshake_on_connect:
                     timeout = self.gettimeout()
@@ -345,9 +582,18 @@
                         raise ValueError("do_handshake_on_connect should not be specified for non-blocking sockets")
                     self.do_handshake()
 
-            except socket_error as x:
+            except (OSError, ValueError):
                 self.close()
-                raise x
+                raise
+
+    @property
+    def context(self):
+        return self._context
+
+    @context.setter
+    def context(self, ctx):
+        self._context = ctx
+        self._sslobj.context = ctx
 
     def dup(self):
         raise NotImplemented("Can't dup() %s instances" %
@@ -357,11 +603,21 @@
         # raise an exception here if you wish to check for spurious closes
         pass
 
+    def _check_connected(self):
+        if not self._connected:
+            # getpeername() will raise ENOTCONN if the socket is really
+            # not connected; note that we can be connected even without
+            # _connected being set, e.g. if connect() first returned
+            # EAGAIN.
+            self.getpeername()
+
     def read(self, len=0, buffer=None):
         """Read up to LEN bytes and return them.
         Return zero-length string on EOF."""
 
         self._checkClosed()
+        if not self._sslobj:
+            raise ValueError("Read on closed or unwrapped SSL socket.")
         try:
             if buffer is not None:
                 v = self._sslobj.read(len, buffer)
@@ -382,6 +638,8 @@
         number of bytes of DATA actually transmitted."""
 
         self._checkClosed()
+        if not self._sslobj:
+            raise ValueError("Write on closed or unwrapped SSL socket.")
         return self._sslobj.write(data)
 
     def getpeercert(self, binary_form=False):
@@ -391,6 +649,7 @@
         certificate was provided, but not validated."""
 
         self._checkClosed()
+        self._check_connected()
         return self._sslobj.peer_certificate(binary_form)
 
     def selected_npn_protocol(self):
@@ -421,18 +680,17 @@
                 raise ValueError(
                     "non-zero flags not allowed in calls to send() on %s" %
                     self.__class__)
-            while True:
-                try:
-                    v = self._sslobj.write(data)
-                except SSLError as x:
-                    if x.args[0] == SSL_ERROR_WANT_READ:
-                        return 0
-                    elif x.args[0] == SSL_ERROR_WANT_WRITE:
-                        return 0
-                    else:
-                        raise
+            try:
+                v = self._sslobj.write(data)
+            except SSLError as x:
+                if x.args[0] == SSL_ERROR_WANT_READ:
+                    return 0
+                elif x.args[0] == SSL_ERROR_WANT_WRITE:
+                    return 0
                 else:
-                    return v
+                    raise
+            else:
+                return v
         else:
             return socket.send(self, data, flags)
 
@@ -540,12 +798,11 @@
 
     def _real_close(self):
         self._sslobj = None
-        # self._closed = True
         socket._real_close(self)
 
     def do_handshake(self, block=False):
         """Perform a TLS/SSL handshake."""
-
+        self._check_connected()
         timeout = self.gettimeout()
         try:
             if timeout == 0.0 and block:
@@ -554,6 +811,12 @@
         finally:
             self.settimeout(timeout)
 
+        if self.context.check_hostname:
+            if not self.server_hostname:
+                raise ValueError("check_hostname needs server_hostname "
+                                 "argument")
+            match_hostname(self.getpeercert(), self.server_hostname)
+
     def _real_connect(self, addr, connect_ex):
         if self.server_side:
             raise ValueError("can't connect in server-side mode")
@@ -569,11 +832,11 @@
                 rc = None
                 socket.connect(self, addr)
             if not rc:
+                self._connected = True
                 if self.do_handshake_on_connect:
                     self.do_handshake()
-                self._connected = True
             return rc
-        except socket_error:
+        except (OSError, ValueError):
             self._sslobj = None
             raise
 
@@ -664,22 +927,23 @@
     d = pem_cert_string.strip()[len(PEM_HEADER):-len(PEM_FOOTER)]
     return base64.decodebytes(d.encode('ASCII', 'strict'))
 
-def get_server_certificate(addr, ssl_version=PROTOCOL_SSLv3, ca_certs=None):
+def get_server_certificate(addr, ssl_version=PROTOCOL_SSLv23, ca_certs=None):
     """Retrieve the certificate from the server at the specified address,
     and return it as a PEM-encoded string.
     If 'ca_certs' is specified, validate the server cert against it.
     If 'ssl_version' is specified, use it in the connection attempt."""
 
     host, port = addr
-    if (ca_certs is not None):
+    if ca_certs is not None:
         cert_reqs = CERT_REQUIRED
     else:
         cert_reqs = CERT_NONE
-    s = create_connection(addr)
-    s = wrap_socket(s, ssl_version=ssl_version,
-                    cert_reqs=cert_reqs, ca_certs=ca_certs)
-    dercert = s.getpeercert(True)
-    s.close()
+    context = _create_stdlib_context(ssl_version,
+                                     cert_reqs=cert_reqs,
+                                     cafile=ca_certs)
+    with  create_connection(addr) as sock:
+        with context.wrap_socket(sock) as sslsock:
+            dercert = sslsock.getpeercert(True)
     return DER_cert_to_PEM_cert(dercert)
 
 def get_protocol_name(protocol_code):
diff --git a/Lib/stat.py b/Lib/stat.py
index 704adfe..3eecc3e 100644
--- a/Lib/stat.py
+++ b/Lib/stat.py
@@ -147,3 +147,9 @@
         else:
             perm.append("-")
     return "".join(perm)
+
+# If available, use C implementation
+try:
+    from _stat import *
+except ImportError:
+    pass
diff --git a/Lib/statistics.py b/Lib/statistics.py
new file mode 100644
index 0000000..25a26d4
--- /dev/null
+++ b/Lib/statistics.py
@@ -0,0 +1,595 @@
+##  Module statistics.py
+##
+##  Copyright (c) 2013 Steven D'Aprano <steve+python@pearwood.info>.
+##
+##  Licensed under the Apache License, Version 2.0 (the "License");
+##  you may not use this file except in compliance with the License.
+##  You may obtain a copy of the License at
+##
+##  http://www.apache.org/licenses/LICENSE-2.0
+##
+##  Unless required by applicable law or agreed to in writing, software
+##  distributed under the License is distributed on an "AS IS" BASIS,
+##  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+##  See the License for the specific language governing permissions and
+##  limitations under the License.
+
+
+"""
+Basic statistics module.
+
+This module provides functions for calculating statistics of data, including
+averages, variance, and standard deviation.
+
+Calculating averages
+--------------------
+
+==================  =============================================
+Function            Description
+==================  =============================================
+mean                Arithmetic mean (average) of data.
+median              Median (middle value) of data.
+median_low          Low median of data.
+median_high         High median of data.
+median_grouped      Median, or 50th percentile, of grouped data.
+mode                Mode (most common value) of data.
+==================  =============================================
+
+Calculate the arithmetic mean ("the average") of data:
+
+>>> mean([-1.0, 2.5, 3.25, 5.75])
+2.625
+
+
+Calculate the standard median of discrete data:
+
+>>> median([2, 3, 4, 5])
+3.5
+
+
+Calculate the median, or 50th percentile, of data grouped into class intervals
+centred on the data values provided. E.g. if your data points are rounded to
+the nearest whole number:
+
+>>> median_grouped([2, 2, 3, 3, 3, 4])  #doctest: +ELLIPSIS
+2.8333333333...
+
+This should be interpreted in this way: you have two data points in the class
+interval 1.5-2.5, three data points in the class interval 2.5-3.5, and one in
+the class interval 3.5-4.5. The median of these data points is 2.8333...
+
+
+Calculating variability or spread
+---------------------------------
+
+==================  =============================================
+Function            Description
+==================  =============================================
+pvariance           Population variance of data.
+variance            Sample variance of data.
+pstdev              Population standard deviation of data.
+stdev               Sample standard deviation of data.
+==================  =============================================
+
+Calculate the standard deviation of sample data:
+
+>>> stdev([2.5, 3.25, 5.5, 11.25, 11.75])  #doctest: +ELLIPSIS
+4.38961843444...
+
+If you have previously calculated the mean, you can pass it as the optional
+second argument to the four "spread" functions to avoid recalculating it:
+
+>>> data = [1, 2, 2, 4, 4, 4, 5, 6]
+>>> mu = mean(data)
+>>> pvariance(data, mu)
+2.5
+
+
+Exceptions
+----------
+
+A single exception is defined: StatisticsError is a subclass of ValueError.
+
+"""
+
+__all__ = [ 'StatisticsError',
+            'pstdev', 'pvariance', 'stdev', 'variance',
+            'median',  'median_low', 'median_high', 'median_grouped',
+            'mean', 'mode',
+          ]
+
+
+import collections
+import math
+
+from fractions import Fraction
+from decimal import Decimal
+
+
+# === Exceptions ===
+
+class StatisticsError(ValueError):
+    pass
+
+
+# === Private utilities ===
+
+def _sum(data, start=0):
+    """_sum(data [, start]) -> value
+
+    Return a high-precision sum of the given numeric data. If optional
+    argument ``start`` is given, it is added to the total. If ``data`` is
+    empty, ``start`` (defaulting to 0) is returned.
+
+
+    Examples
+    --------
+
+    >>> _sum([3, 2.25, 4.5, -0.5, 1.0], 0.75)
+    11.0
+
+    Some sources of round-off error will be avoided:
+
+    >>> _sum([1e50, 1, -1e50] * 1000)  # Built-in sum returns zero.
+    1000.0
+
+    Fractions and Decimals are also supported:
+
+    >>> from fractions import Fraction as F
+    >>> _sum([F(2, 3), F(7, 5), F(1, 4), F(5, 6)])
+    Fraction(63, 20)
+
+    >>> from decimal import Decimal as D
+    >>> data = [D("0.1375"), D("0.2108"), D("0.3061"), D("0.0419")]
+    >>> _sum(data)
+    Decimal('0.6963')
+
+    Mixed types are currently treated as an error, except that int is
+    allowed.
+    """
+    # We fail as soon as we reach a value that is not an int or the type of
+    # the first value which is not an int. E.g. _sum([int, int, float, int])
+    # is okay, but sum([int, int, float, Fraction]) is not.
+    allowed_types = set([int, type(start)])
+    n, d = _exact_ratio(start)
+    partials = {d: n}  # map {denominator: sum of numerators}
+    # Micro-optimizations.
+    exact_ratio = _exact_ratio
+    partials_get = partials.get
+    # Add numerators for each denominator.
+    for x in data:
+        _check_type(type(x), allowed_types)
+        n, d = exact_ratio(x)
+        partials[d] = partials_get(d, 0) + n
+    # Find the expected result type. If allowed_types has only one item, it
+    # will be int; if it has two, use the one which isn't int.
+    assert len(allowed_types) in (1, 2)
+    if len(allowed_types) == 1:
+        assert allowed_types.pop() is int
+        T = int
+    else:
+        T = (allowed_types - set([int])).pop()
+    if None in partials:
+        assert issubclass(T, (float, Decimal))
+        assert not math.isfinite(partials[None])
+        return T(partials[None])
+    total = Fraction()
+    for d, n in sorted(partials.items()):
+        total += Fraction(n, d)
+    if issubclass(T, int):
+        assert total.denominator == 1
+        return T(total.numerator)
+    if issubclass(T, Decimal):
+        return T(total.numerator)/total.denominator
+    return T(total)
+
+
+def _check_type(T, allowed):
+    if T not in allowed:
+        if len(allowed) == 1:
+            allowed.add(T)
+        else:
+            types = ', '.join([t.__name__ for t in allowed] + [T.__name__])
+            raise TypeError("unsupported mixed types: %s" % types)
+
+
+def _exact_ratio(x):
+    """Convert Real number x exactly to (numerator, denominator) pair.
+
+    >>> _exact_ratio(0.25)
+    (1, 4)
+
+    x is expected to be an int, Fraction, Decimal or float.
+    """
+    try:
+        try:
+            # int, Fraction
+            return (x.numerator, x.denominator)
+        except AttributeError:
+            # float
+            try:
+                return x.as_integer_ratio()
+            except AttributeError:
+                # Decimal
+                try:
+                    return _decimal_to_ratio(x)
+                except AttributeError:
+                    msg = "can't convert type '{}' to numerator/denominator"
+                    raise TypeError(msg.format(type(x).__name__)) from None
+    except (OverflowError, ValueError):
+        # INF or NAN
+        if __debug__:
+            # Decimal signalling NANs cannot be converted to float :-(
+            if isinstance(x, Decimal):
+                assert not x.is_finite()
+            else:
+                assert not math.isfinite(x)
+        return (x, None)
+
+
+# FIXME This is faster than Fraction.from_decimal, but still too slow.
+def _decimal_to_ratio(d):
+    """Convert Decimal d to exact integer ratio (numerator, denominator).
+
+    >>> from decimal import Decimal
+    >>> _decimal_to_ratio(Decimal("2.6"))
+    (26, 10)
+
+    """
+    sign, digits, exp = d.as_tuple()
+    if exp in ('F', 'n', 'N'):  # INF, NAN, sNAN
+        assert not d.is_finite()
+        raise ValueError
+    num = 0
+    for digit in digits:
+        num = num*10 + digit
+    if exp < 0:
+        den = 10**-exp
+    else:
+        num *= 10**exp
+        den = 1
+    if sign:
+        num = -num
+    return (num, den)
+
+
+def _counts(data):
+    # Generate a table of sorted (value, frequency) pairs.
+    table = collections.Counter(iter(data)).most_common()
+    if not table:
+        return table
+    # Extract the values with the highest frequency.
+    maxfreq = table[0][1]
+    for i in range(1, len(table)):
+        if table[i][1] != maxfreq:
+            table = table[:i]
+            break
+    return table
+
+
+# === Measures of central tendency (averages) ===
+
+def mean(data):
+    """Return the sample arithmetic mean of data.
+
+    >>> mean([1, 2, 3, 4, 4])
+    2.8
+
+    >>> from fractions import Fraction as F
+    >>> mean([F(3, 7), F(1, 21), F(5, 3), F(1, 3)])
+    Fraction(13, 21)
+
+    >>> from decimal import Decimal as D
+    >>> mean([D("0.5"), D("0.75"), D("0.625"), D("0.375")])
+    Decimal('0.5625')
+
+    If ``data`` is empty, StatisticsError will be raised.
+    """
+    if iter(data) is data:
+        data = list(data)
+    n = len(data)
+    if n < 1:
+        raise StatisticsError('mean requires at least one data point')
+    return _sum(data)/n
+
+
+# FIXME: investigate ways to calculate medians without sorting? Quickselect?
+def median(data):
+    """Return the median (middle value) of numeric data.
+
+    When the number of data points is odd, return the middle data point.
+    When the number of data points is even, the median is interpolated by
+    taking the average of the two middle values:
+
+    >>> median([1, 3, 5])
+    3
+    >>> median([1, 3, 5, 7])
+    4.0
+
+    """
+    data = sorted(data)
+    n = len(data)
+    if n == 0:
+        raise StatisticsError("no median for empty data")
+    if n%2 == 1:
+        return data[n//2]
+    else:
+        i = n//2
+        return (data[i - 1] + data[i])/2
+
+
+def median_low(data):
+    """Return the low median of numeric data.
+
+    When the number of data points is odd, the middle value is returned.
+    When it is even, the smaller of the two middle values is returned.
+
+    >>> median_low([1, 3, 5])
+    3
+    >>> median_low([1, 3, 5, 7])
+    3
+
+    """
+    data = sorted(data)
+    n = len(data)
+    if n == 0:
+        raise StatisticsError("no median for empty data")
+    if n%2 == 1:
+        return data[n//2]
+    else:
+        return data[n//2 - 1]
+
+
+def median_high(data):
+    """Return the high median of data.
+
+    When the number of data points is odd, the middle value is returned.
+    When it is even, the larger of the two middle values is returned.
+
+    >>> median_high([1, 3, 5])
+    3
+    >>> median_high([1, 3, 5, 7])
+    5
+
+    """
+    data = sorted(data)
+    n = len(data)
+    if n == 0:
+        raise StatisticsError("no median for empty data")
+    return data[n//2]
+
+
+def median_grouped(data, interval=1):
+    """"Return the 50th percentile (median) of grouped continuous data.
+
+    >>> median_grouped([1, 2, 2, 3, 4, 4, 4, 4, 4, 5])
+    3.7
+    >>> median_grouped([52, 52, 53, 54])
+    52.5
+
+    This calculates the median as the 50th percentile, and should be
+    used when your data is continuous and grouped. In the above example,
+    the values 1, 2, 3, etc. actually represent the midpoint of classes
+    0.5-1.5, 1.5-2.5, 2.5-3.5, etc. The middle value falls somewhere in
+    class 3.5-4.5, and interpolation is used to estimate it.
+
+    Optional argument ``interval`` represents the class interval, and
+    defaults to 1. Changing the class interval naturally will change the
+    interpolated 50th percentile value:
+
+    >>> median_grouped([1, 3, 3, 5, 7], interval=1)
+    3.25
+    >>> median_grouped([1, 3, 3, 5, 7], interval=2)
+    3.5
+
+    This function does not check whether the data points are at least
+    ``interval`` apart.
+    """
+    data = sorted(data)
+    n = len(data)
+    if n == 0:
+        raise StatisticsError("no median for empty data")
+    elif n == 1:
+        return data[0]
+    # Find the value at the midpoint. Remember this corresponds to the
+    # centre of the class interval.
+    x = data[n//2]
+    for obj in (x, interval):
+        if isinstance(obj, (str, bytes)):
+            raise TypeError('expected number but got %r' % obj)
+    try:
+        L = x - interval/2  # The lower limit of the median interval.
+    except TypeError:
+        # Mixed type. For now we just coerce to float.
+        L = float(x) - float(interval)/2
+    cf = data.index(x)  # Number of values below the median interval.
+    # FIXME The following line could be more efficient for big lists.
+    f = data.count(x)  # Number of data points in the median interval.
+    return L + interval*(n/2 - cf)/f
+
+
+def mode(data):
+    """Return the most common data point from discrete or nominal data.
+
+    ``mode`` assumes discrete data, and returns a single value. This is the
+    standard treatment of the mode as commonly taught in schools:
+
+    >>> mode([1, 1, 2, 3, 3, 3, 3, 4])
+    3
+
+    This also works with nominal (non-numeric) data:
+
+    >>> mode(["red", "blue", "blue", "red", "green", "red", "red"])
+    'red'
+
+    If there is not exactly one most common value, ``mode`` will raise
+    StatisticsError.
+    """
+    # Generate a table of sorted (value, frequency) pairs.
+    table = _counts(data)
+    if len(table) == 1:
+        return table[0][0]
+    elif table:
+        raise StatisticsError(
+                'no unique mode; found %d equally common values' % len(table)
+                )
+    else:
+        raise StatisticsError('no mode for empty data')
+
+
+# === Measures of spread ===
+
+# See http://mathworld.wolfram.com/Variance.html
+#     http://mathworld.wolfram.com/SampleVariance.html
+#     http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance
+#
+# Under no circumstances use the so-called "computational formula for
+# variance", as that is only suitable for hand calculations with a small
+# amount of low-precision data. It has terrible numeric properties.
+#
+# See a comparison of three computational methods here:
+# http://www.johndcook.com/blog/2008/09/26/comparing-three-methods-of-computing-standard-deviation/
+
+def _ss(data, c=None):
+    """Return sum of square deviations of sequence data.
+
+    If ``c`` is None, the mean is calculated in one pass, and the deviations
+    from the mean are calculated in a second pass. Otherwise, deviations are
+    calculated from ``c`` as given. Use the second case with care, as it can
+    lead to garbage results.
+    """
+    if c is None:
+        c = mean(data)
+    ss = _sum((x-c)**2 for x in data)
+    # The following sum should mathematically equal zero, but due to rounding
+    # error may not.
+    ss -= _sum((x-c) for x in data)**2/len(data)
+    assert not ss < 0, 'negative sum of square deviations: %f' % ss
+    return ss
+
+
+def variance(data, xbar=None):
+    """Return the sample variance of data.
+
+    data should be an iterable of Real-valued numbers, with at least two
+    values. The optional argument xbar, if given, should be the mean of
+    the data. If it is missing or None, the mean is automatically calculated.
+
+    Use this function when your data is a sample from a population. To
+    calculate the variance from the entire population, see ``pvariance``.
+
+    Examples:
+
+    >>> data = [2.75, 1.75, 1.25, 0.25, 0.5, 1.25, 3.5]
+    >>> variance(data)
+    1.3720238095238095
+
+    If you have already calculated the mean of your data, you can pass it as
+    the optional second argument ``xbar`` to avoid recalculating it:
+
+    >>> m = mean(data)
+    >>> variance(data, m)
+    1.3720238095238095
+
+    This function does not check that ``xbar`` is actually the mean of
+    ``data``. Giving arbitrary values for ``xbar`` may lead to invalid or
+    impossible results.
+
+    Decimals and Fractions are supported:
+
+    >>> from decimal import Decimal as D
+    >>> variance([D("27.5"), D("30.25"), D("30.25"), D("34.5"), D("41.75")])
+    Decimal('31.01875')
+
+    >>> from fractions import Fraction as F
+    >>> variance([F(1, 6), F(1, 2), F(5, 3)])
+    Fraction(67, 108)
+
+    """
+    if iter(data) is data:
+        data = list(data)
+    n = len(data)
+    if n < 2:
+        raise StatisticsError('variance requires at least two data points')
+    ss = _ss(data, xbar)
+    return ss/(n-1)
+
+
+def pvariance(data, mu=None):
+    """Return the population variance of ``data``.
+
+    data should be an iterable of Real-valued numbers, with at least one
+    value. The optional argument mu, if given, should be the mean of
+    the data. If it is missing or None, the mean is automatically calculated.
+
+    Use this function to calculate the variance from the entire population.
+    To estimate the variance from a sample, the ``variance`` function is
+    usually a better choice.
+
+    Examples:
+
+    >>> data = [0.0, 0.25, 0.25, 1.25, 1.5, 1.75, 2.75, 3.25]
+    >>> pvariance(data)
+    1.25
+
+    If you have already calculated the mean of the data, you can pass it as
+    the optional second argument to avoid recalculating it:
+
+    >>> mu = mean(data)
+    >>> pvariance(data, mu)
+    1.25
+
+    This function does not check that ``mu`` is actually the mean of ``data``.
+    Giving arbitrary values for ``mu`` may lead to invalid or impossible
+    results.
+
+    Decimals and Fractions are supported:
+
+    >>> from decimal import Decimal as D
+    >>> pvariance([D("27.5"), D("30.25"), D("30.25"), D("34.5"), D("41.75")])
+    Decimal('24.815')
+
+    >>> from fractions import Fraction as F
+    >>> pvariance([F(1, 4), F(5, 4), F(1, 2)])
+    Fraction(13, 72)
+
+    """
+    if iter(data) is data:
+        data = list(data)
+    n = len(data)
+    if n < 1:
+        raise StatisticsError('pvariance requires at least one data point')
+    ss = _ss(data, mu)
+    return ss/n
+
+
+def stdev(data, xbar=None):
+    """Return the square root of the sample variance.
+
+    See ``variance`` for arguments and other details.
+
+    >>> stdev([1.5, 2.5, 2.5, 2.75, 3.25, 4.75])
+    1.0810874155219827
+
+    """
+    var = variance(data, xbar)
+    try:
+        return var.sqrt()
+    except AttributeError:
+        return math.sqrt(var)
+
+
+def pstdev(data, mu=None):
+    """Return the square root of the population variance.
+
+    See ``pvariance`` for arguments and other details.
+
+    >>> pstdev([1.5, 2.5, 2.5, 2.75, 3.25, 4.75])
+    0.986893273527251
+
+    """
+    var = pvariance(data, mu)
+    try:
+        return var.sqrt()
+    except AttributeError:
+        return math.sqrt(var)
diff --git a/Lib/string.py b/Lib/string.py
index b57c79b..72a09f7 100644
--- a/Lib/string.py
+++ b/Lib/string.py
@@ -169,7 +169,8 @@
         self.check_unused_args(used_args, args, kwargs)
         return result
 
-    def _vformat(self, format_string, args, kwargs, used_args, recursion_depth):
+    def _vformat(self, format_string, args, kwargs, used_args, recursion_depth,
+                 auto_arg_index=0):
         if recursion_depth < 0:
             raise ValueError('Max string recursion exceeded')
         result = []
@@ -185,6 +186,23 @@
                 # this is some markup, find the object and do
                 #  the formatting
 
+                # handle arg indexing when empty field_names are given.
+                if field_name == '':
+                    if auto_arg_index is False:
+                        raise ValueError('cannot switch from manual field '
+                                         'specification to automatic field '
+                                         'numbering')
+                    field_name = str(auto_arg_index)
+                    auto_arg_index += 1
+                elif field_name.isdigit():
+                    if auto_arg_index:
+                        raise ValueError('cannot switch from manual field '
+                                         'specification to automatic field '
+                                         'numbering')
+                    # disable auto arg incrementing, if it gets
+                    # used later on, then an exception will be raised
+                    auto_arg_index = False
+
                 # given the field_name, find the object it references
                 #  and the argument it came from
                 obj, arg_used = self.get_field(field_name, args, kwargs)
@@ -195,7 +213,8 @@
 
                 # expand the format spec, if needed
                 format_spec = self._vformat(format_spec, args, kwargs,
-                                            used_args, recursion_depth-1)
+                                            used_args, recursion_depth-1,
+                                            auto_arg_index=auto_arg_index)
 
                 # format the object and append to the result
                 result.append(self.format_field(obj, format_spec))
diff --git a/Lib/struct.py b/Lib/struct.py
index 9bfc23f..d6bba58 100644
--- a/Lib/struct.py
+++ b/Lib/struct.py
@@ -1,6 +1,7 @@
 __all__ = [
     # Functions
     'calcsize', 'pack', 'pack_into', 'unpack', 'unpack_from',
+    'iter_unpack',
 
     # Classes
     'Struct',
diff --git a/Lib/subprocess.py b/Lib/subprocess.py
index 0178b08..bc0ef0b 100644
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -145,11 +145,13 @@
 getstatusoutput(cmd):
     Return (status, output) of executing cmd in a shell.
 
-    Execute the string 'cmd' in a shell with os.popen() and return a 2-tuple
-    (status, output).  cmd is actually run as '{ cmd ; } 2>&1', so that the
-    returned output will contain output or error messages. A trailing newline
-    is stripped from the output. The exit status for the command can be
-    interpreted according to the rules for the C function wait().  Example:
+    Execute the string 'cmd' in a shell with 'check_output' and
+    return a 2-tuple (status, output). Universal newlines mode is used,
+    meaning that the result with be decoded to a string.
+
+    A trailing newline is stripped from the output.
+    The exit status for the command can be interpreted
+    according to the rules for the function 'wait'.  Example:
 
     >>> subprocess.getstatusoutput('ls /bin/ls')
     (0, '/bin/ls')
@@ -178,6 +180,9 @@
 
     >>> output = subprocess.check_output(["ls", "-l", "/dev/null"])
 
+    There is an additional optional argument, "input", allowing you to
+    pass a string to the subprocess's stdin.  If you use this argument
+    you may not also use the Popen constructor's "stdin" argument.
 
 Exceptions
 ----------
@@ -345,8 +350,6 @@
 import io
 import os
 import time
-import traceback
-import gc
 import signal
 import builtins
 import warnings
@@ -398,19 +401,28 @@
         hStdOutput = None
         hStdError = None
         wShowWindow = 0
-    class pywintypes:
-        error = IOError
 else:
-    import select
-    _has_poll = hasattr(select, 'poll')
     import _posixsubprocess
-    _create_pipe = _posixsubprocess.cloexec_pipe
+    import select
+    import selectors
+    try:
+        import threading
+    except ImportError:
+        import dummy_threading as threading
 
     # When select or poll has indicated that the file is writable,
     # we can write up to _PIPE_BUF bytes without risk of blocking.
     # POSIX defines PIPE_BUF as >= 512.
     _PIPE_BUF = getattr(select, 'PIPE_BUF', 512)
 
+    # poll/select have the advantage of not requiring any extra file
+    # descriptor, contrarily to epoll/kqueue (also, they require a single
+    # syscall).
+    if hasattr(selectors, 'PollSelector'):
+        _PopenSelector = selectors.PollSelector
+    else:
+        _PopenSelector = selectors.SelectSelector
+
 
 __all__ = ["Popen", "PIPE", "STDOUT", "call", "check_call", "getstatusoutput",
            "getoutput", "check_output", "CalledProcessError", "DEVNULL"]
@@ -506,6 +518,8 @@
     for flag, opt in flag_opt_map.items():
         v = getattr(sys.flags, flag)
         if v > 0:
+            if flag == 'hash_randomization':
+                v = 1 # Handle specification of an exact seed
             args.append('-' + opt * v)
     for opt in sys.warnoptions:
         args.append('-W' + opt)
@@ -568,14 +582,31 @@
     ...              stderr=STDOUT)
     b'ls: non_existent_file: No such file or directory\n'
 
+    There is an additional optional argument, "input", allowing you to
+    pass a string to the subprocess's stdin.  If you use this argument
+    you may not also use the Popen constructor's "stdin" argument, as
+    it too will be used internally.  Example:
+
+    >>> check_output(["sed", "-e", "s/foo/bar/"],
+    ...              input=b"when in the course of fooman events\n")
+    b'when in the course of barman events\n'
+
     If universal_newlines=True is passed, the return value will be a
     string rather than bytes.
     """
     if 'stdout' in kwargs:
         raise ValueError('stdout argument not allowed, it will be overridden.')
+    if 'input' in kwargs:
+        if 'stdin' in kwargs:
+            raise ValueError('stdin and input arguments may not both be used.')
+        inputdata = kwargs['input']
+        del kwargs['input']
+        kwargs['stdin'] = PIPE
+    else:
+        inputdata = None
     with Popen(*popenargs, stdout=PIPE, **kwargs) as process:
         try:
-            output, unused_err = process.communicate(timeout=timeout)
+            output, unused_err = process.communicate(inputdata, timeout=timeout)
         except TimeoutExpired:
             process.kill()
             output, unused_err = process.communicate()
@@ -664,13 +695,15 @@
 #
 
 def getstatusoutput(cmd):
-    """Return (status, output) of executing cmd in a shell.
+    """    Return (status, output) of executing cmd in a shell.
 
-    Execute the string 'cmd' in a shell with os.popen() and return a 2-tuple
-    (status, output).  cmd is actually run as '{ cmd ; } 2>&1', so that the
-    returned output will contain output or error messages.  A trailing newline
-    is stripped from the output.  The exit status for the command can be
-    interpreted according to the rules for the C function wait().  Example:
+    Execute the string 'cmd' in a shell with 'check_output' and
+    return a 2-tuple (status, output). Universal newlines mode is used,
+    meaning that the result with be decoded to a string.
+
+    A trailing newline is stripped from the output.
+    The exit status for the command can be interpreted
+    according to the rules for the function 'wait'. Example:
 
     >>> import subprocess
     >>> subprocess.getstatusoutput('ls /bin/ls')
@@ -719,6 +752,12 @@
                  pass_fds=()):
         """Create new Popen instance."""
         _cleanup()
+        # Held while anything is calling waitpid before returncode has been
+        # updated to prevent clobbering returncode if wait() or poll() are
+        # called from multiple threads at once.  After acquiring the lock,
+        # code must re-check self.returncode to see if another thread just
+        # finished a waitpid() call.
+        self._waitpid_lock = threading.Lock()
 
         self._input = None
         self._communication_started = False
@@ -798,7 +837,8 @@
         if p2cwrite != -1:
             self.stdin = io.open(p2cwrite, 'wb', bufsize)
             if universal_newlines:
-                self.stdin = io.TextIOWrapper(self.stdin, write_through=True)
+                self.stdin = io.TextIOWrapper(self.stdin, write_through=True,
+                                              line_buffering=(bufsize == 1))
         if c2pread != -1:
             self.stdout = io.open(c2pread, 'rb', bufsize)
             if universal_newlines:
@@ -822,7 +862,7 @@
             for f in filter(None, (self.stdin, self.stdout, self.stderr)):
                 try:
                     f.close()
-                except EnvironmentError:
+                except OSError:
                     pass  # Ignore EBADF or other errors.
 
             if not self._closed_child_pipe_fds:
@@ -838,7 +878,7 @@
                 for fd in to_close:
                     try:
                         os.close(fd)
-                    except EnvironmentError:
+                    except OSError:
                         pass
 
             raise
@@ -899,7 +939,7 @@
                 if input:
                     try:
                         self.stdin.write(input)
-                    except IOError as e:
+                    except OSError as e:
                         if e.errno != errno.EPIPE and e.errno != errno.EINVAL:
                             raise
                 self.stdin.close()
@@ -1031,23 +1071,6 @@
             return Handle(h)
 
 
-        def _find_w9xpopen(self):
-            """Find and return absolut path to w9xpopen.exe"""
-            w9xpopen = os.path.join(
-                            os.path.dirname(_winapi.GetModuleFileName(0)),
-                                    "w9xpopen.exe")
-            if not os.path.exists(w9xpopen):
-                # Eeek - file-not-found - possibly an embedding
-                # situation - see if we can locate it in sys.exec_prefix
-                w9xpopen = os.path.join(os.path.dirname(sys.base_exec_prefix),
-                                        "w9xpopen.exe")
-                if not os.path.exists(w9xpopen):
-                    raise RuntimeError("Cannot locate w9xpopen.exe, which is "
-                                       "needed for Popen to work with your "
-                                       "shell or platform.")
-            return w9xpopen
-
-
         def _execute_child(self, args, executable, preexec_fn, close_fds,
                            pass_fds, cwd, env,
                            startupinfo, creationflags, shell,
@@ -1076,21 +1099,6 @@
                 startupinfo.wShowWindow = _winapi.SW_HIDE
                 comspec = os.environ.get("COMSPEC", "cmd.exe")
                 args = '{} /c "{}"'.format (comspec, args)
-                if (_winapi.GetVersion() >= 0x80000000 or
-                        os.path.basename(comspec).lower() == "command.com"):
-                    # Win9x, or using command.com on NT. We need to
-                    # use the w9xpopen intermediate program. For more
-                    # information, see KB Q150956
-                    # (http://web.archive.org/web/20011105084002/http://support.microsoft.com/support/kb/articles/Q150/9/56.asp)
-                    w9xpopen = self._find_w9xpopen()
-                    args = '"%s" %s' % (w9xpopen, args)
-                    # Not passing CREATE_NEW_CONSOLE has been known to
-                    # cause random failures on win9x.  Specifically a
-                    # dialog: "Your program accessed mem currently in
-                    # use at xxx" and a hopeful warning about the
-                    # stability of your system.  Cost is Ctrl+C won't
-                    # kill children.
-                    creationflags |= _winapi.CREATE_NEW_CONSOLE
 
             # Start the process
             try:
@@ -1102,12 +1110,6 @@
                                          env,
                                          cwd,
                                          startupinfo)
-            except pywintypes.error as e:
-                # Translate pywintypes.error to WindowsError, which is
-                # a subclass of OSError.  FIXME: We should really
-                # translate errno using _sys_errlist (or similar), but
-                # how can this be done from Python?
-                raise WindowsError(*e.args)
             finally:
                 # Child is launched. Close the parent's copy of those pipe
                 # handles that only the child should have open.  You need
@@ -1192,9 +1194,9 @@
                 if input is not None:
                     try:
                         self.stdin.write(input)
-                    except IOError as e:
+                    except OSError as e:
                         if e.errno == errno.EPIPE:
-                            # ignore pipe full error
+                            # communicate() should ignore pipe full error
                             pass
                         elif (e.errno == errno.EINVAL
                               and self.poll() is not None):
@@ -1278,7 +1280,7 @@
             if stdin is None:
                 pass
             elif stdin == PIPE:
-                p2cread, p2cwrite = _create_pipe()
+                p2cread, p2cwrite = os.pipe()
             elif stdin == DEVNULL:
                 p2cread = self._get_devnull()
             elif isinstance(stdin, int):
@@ -1290,7 +1292,7 @@
             if stdout is None:
                 pass
             elif stdout == PIPE:
-                c2pread, c2pwrite = _create_pipe()
+                c2pread, c2pwrite = os.pipe()
             elif stdout == DEVNULL:
                 c2pwrite = self._get_devnull()
             elif isinstance(stdout, int):
@@ -1302,7 +1304,7 @@
             if stderr is None:
                 pass
             elif stderr == PIPE:
-                errread, errwrite = _create_pipe()
+                errread, errwrite = os.pipe()
             elif stderr == STDOUT:
                 errwrite = c2pwrite
             elif stderr == DEVNULL:
@@ -1354,7 +1356,14 @@
             # For transferring possible exec failure from child to parent.
             # Data format: "exception name:hex errno:description"
             # Pickle is not used; it is complex and involves memory allocation.
-            errpipe_read, errpipe_write = _create_pipe()
+            errpipe_read, errpipe_write = os.pipe()
+            # errpipe_write must not be in the standard io 0, 1, or 2 fd range.
+            low_fds_to_close = []
+            while errpipe_write < 3:
+                low_fds_to_close.append(errpipe_write)
+                errpipe_write = os.dup(errpipe_write)
+            for low_fd in low_fds_to_close:
+                os.close(low_fd)
             try:
                 try:
                     # We must avoid complex work that could involve
@@ -1424,13 +1433,13 @@
                     exception_name, hex_errno, err_msg = (
                             errpipe_data.split(b':', 2))
                 except ValueError:
-                    exception_name = b'RuntimeError'
+                    exception_name = b'SubprocessError'
                     hex_errno = b'0'
                     err_msg = (b'Bad exception data from child: ' +
                                repr(errpipe_data))
                 child_exception_type = getattr(
                         builtins, exception_name.decode('ascii'),
-                        RuntimeError)
+                        SubprocessError)
                 err_msg = err_msg.decode(errors="surrogatepass")
                 if issubclass(child_exception_type, OSError) and hex_errno:
                     errno_num = int(hex_errno, 16)
@@ -1452,6 +1461,7 @@
         def _handle_exitstatus(self, sts, _WIFSIGNALED=os.WIFSIGNALED,
                 _WTERMSIG=os.WTERMSIG, _WIFEXITED=os.WIFEXITED,
                 _WEXITSTATUS=os.WEXITSTATUS):
+            """All callers to this function MUST hold self._waitpid_lock."""
             # This method is called (indirectly) by __del__, so it cannot
             # refer to anything outside of its local scope.
             if _WIFSIGNALED(sts):
@@ -1460,11 +1470,11 @@
                 self.returncode = _WEXITSTATUS(sts)
             else:
                 # Should never happen
-                raise RuntimeError("Unknown child exit status!")
+                raise SubprocessError("Unknown child exit status!")
 
 
         def _internal_poll(self, _deadstate=None, _waitpid=os.waitpid,
-                _WNOHANG=os.WNOHANG, _os_error=os.error, _ECHILD=errno.ECHILD):
+                _WNOHANG=os.WNOHANG, _ECHILD=errno.ECHILD):
             """Check if child process has terminated.  Returns returncode
             attribute.
 
@@ -1473,11 +1483,17 @@
 
             """
             if self.returncode is None:
+                if not self._waitpid_lock.acquire(False):
+                    # Something else is busy calling waitpid.  Don't allow two
+                    # at once.  We know nothing yet.
+                    return None
                 try:
+                    if self.returncode is not None:
+                        return self.returncode  # Another thread waited.
                     pid, sts = _waitpid(self.pid, _WNOHANG)
                     if pid == self.pid:
                         self._handle_exitstatus(sts)
-                except _os_error as e:
+                except OSError as e:
                     if _deadstate is not None:
                         self.returncode = _deadstate
                     elif e.errno == _ECHILD:
@@ -1487,10 +1503,13 @@
                         # can't get the status.
                         # http://bugs.python.org/issue15756
                         self.returncode = 0
+                finally:
+                    self._waitpid_lock.release()
             return self.returncode
 
 
         def _try_wait(self, wait_flags):
+            """All callers to this function MUST hold self._waitpid_lock."""
             try:
                 (pid, sts) = _eintr_retry_call(os.waitpid, self.pid, wait_flags)
             except OSError as e:
@@ -1523,11 +1542,17 @@
                 # cribbed from Lib/threading.py in Thread.wait() at r71065.
                 delay = 0.0005 # 500 us -> initial delay of 1 ms
                 while True:
-                    (pid, sts) = self._try_wait(os.WNOHANG)
-                    assert pid == self.pid or pid == 0
-                    if pid == self.pid:
-                        self._handle_exitstatus(sts)
-                        break
+                    if self._waitpid_lock.acquire(False):
+                        try:
+                            if self.returncode is not None:
+                                break  # Another thread waited.
+                            (pid, sts) = self._try_wait(os.WNOHANG)
+                            assert pid == self.pid or pid == 0
+                            if pid == self.pid:
+                                self._handle_exitstatus(sts)
+                                break
+                        finally:
+                            self._waitpid_lock.release()
                     remaining = self._remaining_time(endtime)
                     if remaining <= 0:
                         raise TimeoutExpired(self.args, timeout)
@@ -1535,11 +1560,15 @@
                     time.sleep(delay)
             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)
+                    with self._waitpid_lock:
+                        if self.returncode is not None:
+                            break  # Another thread waited.
+                        (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.
+                        # http://bugs.python.org/issue14396.
+                        if pid == self.pid:
+                            self._handle_exitstatus(sts)
             return self.returncode
 
 
@@ -1551,12 +1580,68 @@
                 if not input:
                     self.stdin.close()
 
-            if _has_poll:
-                stdout, stderr = self._communicate_with_poll(input, endtime,
-                                                             orig_timeout)
-            else:
-                stdout, stderr = self._communicate_with_select(input, endtime,
-                                                               orig_timeout)
+            stdout = None
+            stderr = None
+
+            # Only create this mapping if we haven't already.
+            if not self._communication_started:
+                self._fileobj2output = {}
+                if self.stdout:
+                    self._fileobj2output[self.stdout] = []
+                if self.stderr:
+                    self._fileobj2output[self.stderr] = []
+
+            if self.stdout:
+                stdout = self._fileobj2output[self.stdout]
+            if self.stderr:
+                stderr = self._fileobj2output[self.stderr]
+
+            self._save_input(input)
+
+            if self._input:
+                input_view = memoryview(self._input)
+
+            with _PopenSelector() as selector:
+                if self.stdin and input:
+                    selector.register(self.stdin, selectors.EVENT_WRITE)
+                if self.stdout:
+                    selector.register(self.stdout, selectors.EVENT_READ)
+                if self.stderr:
+                    selector.register(self.stderr, selectors.EVENT_READ)
+
+                while selector.get_map():
+                    timeout = self._remaining_time(endtime)
+                    if timeout is not None and timeout < 0:
+                        raise TimeoutExpired(self.args, orig_timeout)
+
+                    ready = selector.select(timeout)
+                    self._check_timeout(endtime, orig_timeout)
+
+                    # XXX Rewrite these to use non-blocking I/O on the file
+                    # objects; they are no longer using C stdio!
+
+                    for key, events in ready:
+                        if key.fileobj is self.stdin:
+                            chunk = input_view[self._input_offset :
+                                               self._input_offset + _PIPE_BUF]
+                            try:
+                                self._input_offset += os.write(key.fd, chunk)
+                            except OSError as e:
+                                if e.errno == errno.EPIPE:
+                                    selector.unregister(key.fileobj)
+                                    key.fileobj.close()
+                                else:
+                                    raise
+                            else:
+                                if self._input_offset >= len(self._input):
+                                    selector.unregister(key.fileobj)
+                                    key.fileobj.close()
+                        elif key.fileobj in (self.stdout, self.stderr):
+                            data = os.read(key.fd, 32768)
+                            if not data:
+                                selector.unregister(key.fileobj)
+                                key.fileobj.close()
+                            self._fileobj2output[key.fileobj].append(data)
 
             self.wait(timeout=self._remaining_time(endtime))
 
@@ -1590,170 +1675,6 @@
                     self._input = self._input.encode(self.stdin.encoding)
 
 
-        def _communicate_with_poll(self, input, endtime, orig_timeout):
-            stdout = None # Return
-            stderr = None # Return
-
-            if not self._communication_started:
-                self._fd2file = {}
-
-            poller = select.poll()
-            def register_and_append(file_obj, eventmask):
-                poller.register(file_obj.fileno(), eventmask)
-                self._fd2file[file_obj.fileno()] = file_obj
-
-            def close_unregister_and_remove(fd):
-                poller.unregister(fd)
-                self._fd2file[fd].close()
-                self._fd2file.pop(fd)
-
-            if self.stdin and input:
-                register_and_append(self.stdin, select.POLLOUT)
-
-            # Only create this mapping if we haven't already.
-            if not self._communication_started:
-                self._fd2output = {}
-                if self.stdout:
-                    self._fd2output[self.stdout.fileno()] = []
-                if self.stderr:
-                    self._fd2output[self.stderr.fileno()] = []
-
-            select_POLLIN_POLLPRI = select.POLLIN | select.POLLPRI
-            if self.stdout:
-                register_and_append(self.stdout, select_POLLIN_POLLPRI)
-                stdout = self._fd2output[self.stdout.fileno()]
-            if self.stderr:
-                register_and_append(self.stderr, select_POLLIN_POLLPRI)
-                stderr = self._fd2output[self.stderr.fileno()]
-
-            self._save_input(input)
-
-            if self._input:
-                input_view = memoryview(self._input)
-
-            while self._fd2file:
-                timeout = self._remaining_time(endtime)
-                if timeout is not None and timeout < 0:
-                    raise TimeoutExpired(self.args, orig_timeout)
-                try:
-                    ready = poller.poll(timeout)
-                except select.error as e:
-                    if e.args[0] == errno.EINTR:
-                        continue
-                    raise
-                self._check_timeout(endtime, orig_timeout)
-
-                # XXX Rewrite these to use non-blocking I/O on the
-                # file objects; they are no longer using C stdio!
-
-                for fd, mode in ready:
-                    if mode & select.POLLOUT:
-                        chunk = input_view[self._input_offset :
-                                           self._input_offset + _PIPE_BUF]
-                        try:
-                            self._input_offset += os.write(fd, chunk)
-                        except OSError as e:
-                            if e.errno == errno.EPIPE:
-                                close_unregister_and_remove(fd)
-                            else:
-                                raise
-                        else:
-                            if self._input_offset >= len(self._input):
-                                close_unregister_and_remove(fd)
-                    elif mode & select_POLLIN_POLLPRI:
-                        data = os.read(fd, 32768)
-                        if not data:
-                            close_unregister_and_remove(fd)
-                        self._fd2output[fd].append(data)
-                    else:
-                        # Ignore hang up or errors.
-                        close_unregister_and_remove(fd)
-
-            return (stdout, stderr)
-
-
-        def _communicate_with_select(self, input, endtime, orig_timeout):
-            if not self._communication_started:
-                self._read_set = []
-                self._write_set = []
-                if self.stdin and input:
-                    self._write_set.append(self.stdin)
-                if self.stdout:
-                    self._read_set.append(self.stdout)
-                if self.stderr:
-                    self._read_set.append(self.stderr)
-
-            self._save_input(input)
-
-            stdout = None # Return
-            stderr = None # Return
-
-            if self.stdout:
-                if not self._communication_started:
-                    self._stdout_buff = []
-                stdout = self._stdout_buff
-            if self.stderr:
-                if not self._communication_started:
-                    self._stderr_buff = []
-                stderr = self._stderr_buff
-
-            while self._read_set or self._write_set:
-                timeout = self._remaining_time(endtime)
-                if timeout is not None and timeout < 0:
-                    raise TimeoutExpired(self.args, orig_timeout)
-                try:
-                    (rlist, wlist, xlist) = \
-                        select.select(self._read_set, self._write_set, [],
-                                      timeout)
-                except select.error as e:
-                    if e.args[0] == errno.EINTR:
-                        continue
-                    raise
-
-                # According to the docs, returning three empty lists indicates
-                # that the timeout expired.
-                if not (rlist or wlist or xlist):
-                    raise TimeoutExpired(self.args, orig_timeout)
-                # We also check what time it is ourselves for good measure.
-                self._check_timeout(endtime, orig_timeout)
-
-                # XXX Rewrite these to use non-blocking I/O on the
-                # file objects; they are no longer using C stdio!
-
-                if self.stdin in wlist:
-                    chunk = self._input[self._input_offset :
-                                        self._input_offset + _PIPE_BUF]
-                    try:
-                        bytes_written = os.write(self.stdin.fileno(), chunk)
-                    except OSError as e:
-                        if e.errno == errno.EPIPE:
-                            self.stdin.close()
-                            self._write_set.remove(self.stdin)
-                        else:
-                            raise
-                    else:
-                        self._input_offset += bytes_written
-                        if self._input_offset >= len(self._input):
-                            self.stdin.close()
-                            self._write_set.remove(self.stdin)
-
-                if self.stdout in rlist:
-                    data = os.read(self.stdout.fileno(), 1024)
-                    if not data:
-                        self.stdout.close()
-                        self._read_set.remove(self.stdout)
-                    stdout.append(data)
-
-                if self.stderr in rlist:
-                    data = os.read(self.stderr.fileno(), 1024)
-                    if not data:
-                        self.stderr.close()
-                        self._read_set.remove(self.stderr)
-                    stderr.append(data)
-
-            return (stdout, stderr)
-
-
         def send_signal(self, sig):
             """Send a signal to the process
             """
diff --git a/Lib/sunau.py b/Lib/sunau.py
index 15f7b03..3c24492 100644
--- a/Lib/sunau.py
+++ b/Lib/sunau.py
@@ -51,7 +51,7 @@
         getcomptype()   -- returns compression type ('NONE' or 'ULAW')
         getcompname()   -- returns human-readable version of
                            compression type ('not compressed' matches 'NONE')
-        getparams()     -- returns a tuple consisting of all of the
+        getparams()     -- returns a namedtuple consisting of all of the
                            above in the above order
         getmarkers()    -- returns None (for compatibility with the
                            aifc module)
@@ -103,6 +103,11 @@
 is destroyed.
 """
 
+from collections import namedtuple
+
+_sunau_params = namedtuple('_sunau_params',
+                           'nchannels sampwidth framerate nframes comptype compname')
+
 # from <multimedia/audio_filehdr.h>
 AUDIO_FILE_MAGIC = 0x2e736e64
 AUDIO_FILE_ENCODING_MULAW_8 = 1
@@ -163,6 +168,12 @@
         if self._file:
             self.close()
 
+    def __enter__(self):
+        return self
+
+    def __exit__(self, *args):
+        self.close()
+
     def initfp(self, file):
         self._file = file
         self._soundpos = 0
@@ -246,9 +257,9 @@
             return 'not compressed'
 
     def getparams(self):
-        return self.getnchannels(), self.getsampwidth(), \
-                  self.getframerate(), self.getnframes(), \
-                  self.getcomptype(), self.getcompname()
+        return _sunau_params(self.getnchannels(), self.getsampwidth(),
+                  self.getframerate(), self.getnframes(),
+                  self.getcomptype(), self.getcompname())
 
     def getmarkers(self):
         return None
@@ -307,6 +318,12 @@
             self.close()
         self._file = None
 
+    def __enter__(self):
+        return self
+
+    def __exit__(self, *args):
+        self.close()
+
     def initfp(self, file):
         self._file = file
         self._framerate = 0
@@ -335,7 +352,7 @@
     def setsampwidth(self, sampwidth):
         if self._nframeswritten:
             raise Error('cannot change parameters after starting to write')
-        if sampwidth not in (1, 2, 4):
+        if sampwidth not in (1, 2, 3, 4):
             raise Error('bad sample width')
         self._sampwidth = sampwidth
 
@@ -390,14 +407,16 @@
         self.setcomptype(comptype, compname)
 
     def getparams(self):
-        return self.getnchannels(), self.getsampwidth(), \
-                  self.getframerate(), self.getnframes(), \
-                  self.getcomptype(), self.getcompname()
+        return _sunau_params(self.getnchannels(), self.getsampwidth(),
+                  self.getframerate(), self.getnframes(),
+                  self.getcomptype(), self.getcompname())
 
     def tell(self):
         return self._nframeswritten
 
     def writeframesraw(self, data):
+        if not isinstance(data, (bytes, bytearray)):
+            data = memoryview(data).cast('B')
         self._ensure_header_written()
         if self._comptype == 'ULAW':
             import audioop
@@ -421,9 +440,9 @@
                         self._datalength != self._datawritten:
                     self._patchheader()
                 self._file.flush()
+            finally:
                 if self._opened and self._file:
                     self._file.close()
-            finally:
                 self._file = None
 
     #
@@ -448,6 +467,9 @@
             elif self._sampwidth == 2:
                 encoding = AUDIO_FILE_ENCODING_LINEAR_16
                 self._framesize = 2
+            elif self._sampwidth == 3:
+                encoding = AUDIO_FILE_ENCODING_LINEAR_24
+                self._framesize = 3
             elif self._sampwidth == 4:
                 encoding = AUDIO_FILE_ENCODING_LINEAR_32
                 self._framesize = 4
diff --git a/Lib/symbol.py b/Lib/symbol.py
index 34143b5..5cf4a65 100755
--- a/Lib/symbol.py
+++ b/Lib/symbol.py
@@ -100,7 +100,7 @@
         sym_name[_value] = _name
 
 
-def main():
+def _main():
     import sys
     import token
     if len(sys.argv) == 1:
@@ -108,4 +108,4 @@
     token._main()
 
 if __name__ == "__main__":
-    main()
+    _main()
diff --git a/Lib/symtable.py b/Lib/symtable.py
index bb27196..e23313b 100644
--- a/Lib/symtable.py
+++ b/Lib/symtable.py
@@ -232,7 +232,8 @@
 
 if __name__ == "__main__":
     import os, sys
-    src = open(sys.argv[0]).read()
+    with open(sys.argv[0]) as f:
+        src = f.read()
     mod = symtable(src, os.path.split(sys.argv[0])[1], "exec")
     for ident in mod.get_identifiers():
         info = mod.lookup(ident)
diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
index 2a2160c..dbf7767 100644
--- a/Lib/sysconfig.py
+++ b/Lib/sysconfig.py
@@ -1,7 +1,6 @@
 """Access to Python's configuration information."""
 
 import os
-import re
 import sys
 from os.path import pardir, realpath
 
@@ -52,25 +51,6 @@
         'scripts': '{base}/Scripts',
         'data': '{base}',
         },
-    'os2': {
-        'stdlib': '{installed_base}/Lib',
-        'platstdlib': '{base}/Lib',
-        'purelib': '{base}/Lib/site-packages',
-        'platlib': '{base}/Lib/site-packages',
-        'include': '{installed_base}/Include',
-        'platinclude': '{installed_base}/Include',
-        'scripts': '{base}/Scripts',
-        'data': '{base}',
-        },
-    'os2_home': {
-        'stdlib': '{userbase}/lib/python{py_version_short}',
-        'platstdlib': '{userbase}/lib/python{py_version_short}',
-        'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
-        'platlib': '{userbase}/lib/python{py_version_short}/site-packages',
-        'include': '{userbase}/include/python{py_version_short}',
-        'scripts': '{userbase}/bin',
-        'data': '{userbase}',
-        },
     'nt_user': {
         'stdlib': '{userbase}/Python{py_version_nodot}',
         'platstdlib': '{userbase}/Python{py_version_nodot}',
@@ -210,7 +190,6 @@
     def joinuser(*args):
         return os.path.expanduser(os.path.join(*args))
 
-    # what about 'os2emx', 'riscos' ?
     if os.name == "nt":
         base = os.environ.get("APPDATA") or "~"
         if env_base:
@@ -242,6 +221,7 @@
     """
     # Regexes needed for parsing Makefile (and similar syntaxes,
     # like old-style Setup files).
+    import re
     _variable_rx = re.compile("([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*(.*)")
     _findvar1_rx = re.compile(r"\$\(([A-Za-z][A-Za-z0-9_]*)\)")
     _findvar2_rx = re.compile(r"\${([A-Za-z][A-Za-z0-9_]*)}")
@@ -369,21 +349,21 @@
     makefile = get_makefile_filename()
     try:
         _parse_makefile(makefile, vars)
-    except IOError as e:
+    except OSError as e:
         msg = "invalid Python installation: unable to open %s" % makefile
         if hasattr(e, "strerror"):
             msg = msg + " (%s)" % e.strerror
-        raise IOError(msg)
+        raise OSError(msg)
     # load the installed pyconfig.h:
     config_h = get_config_h_filename()
     try:
         with open(config_h) as f:
             parse_config_h(f, vars)
-    except IOError as e:
+    except OSError as e:
         msg = "invalid Python installation: unable to open %s" % config_h
         if hasattr(e, "strerror"):
             msg = msg + " (%s)" % e.strerror
-        raise IOError(msg)
+        raise OSError(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.
@@ -403,8 +383,8 @@
     # get_platform() succeeds.
     name = '_sysconfigdata'
     if 'darwin' in sys.platform:
-        import imp
-        module = imp.new_module(name)
+        import types
+        module = types.ModuleType(name)
         module.build_time_vars = vars
         sys.modules[name] = module
 
@@ -436,7 +416,6 @@
     vars['LIBDEST'] = get_path('stdlib')
     vars['BINLIBDEST'] = get_path('platstdlib')
     vars['INCLUDEPY'] = get_path('include')
-    vars['SO'] = '.pyd'
     vars['EXT_SUFFIX'] = '.pyd'
     vars['EXE'] = '.exe'
     vars['VERSION'] = _PY_VERSION_SHORT_NO_DOT
@@ -456,6 +435,7 @@
     """
     if vars is None:
         vars = {}
+    import re
     define_rx = re.compile("#define ([A-Z][A-Za-z0-9_]+) (.*)\n")
     undef_rx = re.compile("/[*] #undef ([A-Z][A-Za-z0-9_]+) [*]/\n")
 
@@ -552,10 +532,14 @@
             # sys.abiflags may not be defined on all platforms.
             _CONFIG_VARS['abiflags'] = ''
 
-        if os.name in ('nt', 'os2'):
+        if os.name == 'nt':
             _init_non_posix(_CONFIG_VARS)
         if os.name == 'posix':
             _init_posix(_CONFIG_VARS)
+        # For backward compatibility, see issue19555
+        SO = _CONFIG_VARS.get('EXT_SUFFIX')
+        if SO is not None:
+            _CONFIG_VARS['SO'] = SO
         # Setting 'userbase' is done below the call to the
         # init function to enable using 'get_config_var' in
         # the init-function.
@@ -599,6 +583,9 @@
 
     Equivalent to get_config_vars().get(name)
     """
+    if name == 'SO':
+        import warnings
+        warnings.warn('SO is deprecated, use EXT_SUFFIX', DeprecationWarning, 2)
     return get_config_vars().get(name)
 
 
@@ -679,6 +666,7 @@
         return "%s-%s.%s" % (osname, version, release)
     elif osname[:6] == "cygwin":
         osname = "cygwin"
+        import re
         rel_re = re.compile(r'[\d.]+')
         m = rel_re.match(release)
         if m:
diff --git a/Lib/tabnanny.py b/Lib/tabnanny.py
index 5b9b444..46e0f56 100755
--- a/Lib/tabnanny.py
+++ b/Lib/tabnanny.py
@@ -95,7 +95,7 @@
 
     try:
         f = tokenize.open(file)
-    except IOError as msg:
+    except OSError as msg:
         errprint("%r: I/O Error: %s" % (file, msg))
         return
 
diff --git a/Lib/tarfile.py b/Lib/tarfile.py
index f6d7f79..9e291c2 100755
--- a/Lib/tarfile.py
+++ b/Lib/tarfile.py
@@ -56,17 +56,15 @@
 # os.symlink on Windows prior to 6.0 raises NotImplementedError
 symlink_exception = (AttributeError, NotImplementedError)
 try:
-    # WindowsError (1314) will be raised if the caller does not hold the
+    # OSError (winerror=1314) will be raised if the caller does not hold the
     # SeCreateSymbolicLinkPrivilege privilege
-    symlink_exception += (WindowsError,)
+    symlink_exception += (OSError,)
 except NameError:
     pass
 
 # from tarfile import *
 __all__ = ["TarFile", "TarInfo", "is_tarfile", "TarError"]
 
-from builtins import open as _open # Since 'open' is TarFile.open
-
 #---------------------------------------------------------
 # tar constants
 #---------------------------------------------------------
@@ -140,30 +138,6 @@
 }
 
 #---------------------------------------------------------
-# Bits used in the mode field, values in octal.
-#---------------------------------------------------------
-S_IFLNK = 0o120000        # symbolic link
-S_IFREG = 0o100000        # regular file
-S_IFBLK = 0o060000        # block device
-S_IFDIR = 0o040000        # directory
-S_IFCHR = 0o020000        # character device
-S_IFIFO = 0o010000        # fifo
-
-TSUID   = 0o4000          # set UID on execution
-TSGID   = 0o2000          # set GID on execution
-TSVTX   = 0o1000          # reserved
-
-TUREAD  = 0o400           # read by owner
-TUWRITE = 0o200           # write by owner
-TUEXEC  = 0o100           # execute/search by owner
-TGREAD  = 0o040           # read by group
-TGWRITE = 0o020           # write by group
-TGEXEC  = 0o010           # execute/search by group
-TOREAD  = 0o004           # read by other
-TOWRITE = 0o002           # write by other
-TOEXEC  = 0o001           # execute/search by other
-
-#---------------------------------------------------------
 # initialization
 #---------------------------------------------------------
 if os.name in ("nt", "ce"):
@@ -220,7 +194,7 @@
     # A 0o200 byte indicates a positive number, a 0o377 byte a negative
     # number.
     if 0 <= n < 8 ** (digits - 1):
-        s = bytes("%0*o" % (digits - 1, n), "ascii") + NUL
+        s = bytes("%0*o" % (digits - 1, int(n)), "ascii") + NUL
     elif format == GNU_FORMAT and -256 ** (digits - 1) <= n < 256 ** (digits - 1):
         if n >= 0:
             s = bytearray([0o200])
@@ -264,13 +238,13 @@
     for b in range(blocks):
         buf = src.read(BUFSIZE)
         if len(buf) < BUFSIZE:
-            raise IOError("end of file reached")
+            raise OSError("end of file reached")
         dst.write(buf)
 
     if remainder != 0:
         buf = src.read(remainder)
         if len(buf) < remainder:
-            raise IOError("end of file reached")
+            raise OSError("end of file reached")
         dst.write(buf)
     return
 
@@ -405,7 +379,7 @@
                 if mode == "r":
                     self.dbuf = b""
                     self.cmp = bz2.BZ2Decompressor()
-                    self.exception = IOError
+                    self.exception = OSError
                 else:
                     self.cmp = bz2.BZ2Compressor()
 
@@ -1449,7 +1423,8 @@
             fileobj = bltn_open(name, self._mode)
             self._extfileobj = False
         else:
-            if name is None and hasattr(fileobj, "name"):
+            if (name is None and hasattr(fileobj, "name") and
+                isinstance(fileobj.name, (str, bytes))):
                 name = fileobj.name
             if hasattr(fileobj, "mode"):
                 self._mode = fileobj.mode
@@ -1672,7 +1647,7 @@
 
         try:
             t = cls.taropen(name, mode, fileobj, **kwargs)
-        except (IOError, EOFError):
+        except (OSError, EOFError):
             fileobj.close()
             if mode == 'r':
                 raise ReadError("not a bzip2 file")
@@ -2042,7 +2017,7 @@
         try:
             self._extract_member(tarinfo, os.path.join(path, tarinfo.name),
                                  set_attrs=set_attrs)
-        except EnvironmentError as e:
+        except OSError as e:
             if self.errorlevel > 0:
                 raise
             else:
@@ -2231,9 +2206,8 @@
                 if tarinfo.issym() and hasattr(os, "lchown"):
                     os.lchown(targetpath, u, g)
                 else:
-                    if sys.platform != "os2emx":
-                        os.chown(targetpath, u, g)
-            except EnvironmentError as e:
+                    os.chown(targetpath, u, g)
+            except OSError as e:
                 raise ExtractError("could not change owner")
 
     def chmod(self, tarinfo, targetpath):
@@ -2242,7 +2216,7 @@
         if hasattr(os, 'chmod'):
             try:
                 os.chmod(targetpath, tarinfo.mode)
-            except EnvironmentError as e:
+            except OSError as e:
                 raise ExtractError("could not change mode")
 
     def utime(self, tarinfo, targetpath):
@@ -2252,7 +2226,7 @@
             return
         try:
             os.utime(targetpath, (tarinfo.mtime, tarinfo.mtime))
-        except EnvironmentError as e:
+        except OSError as e:
             raise ExtractError("could not change modification time")
 
     #--------------------------------------------------------------------------
@@ -2343,9 +2317,9 @@
            corresponds to TarFile's mode.
         """
         if self.closed:
-            raise IOError("%s is closed" % self.__class__.__name__)
+            raise OSError("%s is closed" % self.__class__.__name__)
         if mode is not None and self.mode not in mode:
-            raise IOError("bad operation for mode %r" % self.mode)
+            raise OSError("bad operation for mode %r" % self.mode)
 
     def _find_link_target(self, tarinfo):
         """Find the target member of a symlink or hardlink member in the
@@ -2449,3 +2423,97 @@
 
 bltn_open = open
 open = TarFile.open
+
+
+def main():
+    import argparse
+
+    description = 'A simple command line interface for tarfile module.'
+    parser = argparse.ArgumentParser(description=description)
+    parser.add_argument('-v', '--verbose', action='store_true', default=False,
+                        help='Verbose output')
+    group = parser.add_mutually_exclusive_group()
+    group.add_argument('-l', '--list', metavar='<tarfile>',
+                       help='Show listing of a tarfile')
+    group.add_argument('-e', '--extract', nargs='+',
+                       metavar=('<tarfile>', '<output_dir>'),
+                       help='Extract tarfile into target dir')
+    group.add_argument('-c', '--create', nargs='+',
+                       metavar=('<name>', '<file>'),
+                       help='Create tarfile from sources')
+    group.add_argument('-t', '--test', metavar='<tarfile>',
+                       help='Test if a tarfile is valid')
+    args = parser.parse_args()
+
+    if args.test:
+        src = args.test
+        if is_tarfile(src):
+            with open(src, 'r') as tar:
+                tar.getmembers()
+                print(tar.getmembers(), file=sys.stderr)
+            if args.verbose:
+                print('{!r} is a tar archive.'.format(src))
+        else:
+            parser.exit(1, '{!r} is not a tar archive.\n'.format(src))
+
+    elif args.list:
+        src = args.list
+        if is_tarfile(src):
+            with TarFile.open(src, 'r:*') as tf:
+                tf.list(verbose=args.verbose)
+        else:
+            parser.exit(1, '{!r} is not a tar archive.\n'.format(src))
+
+    elif args.extract:
+        if len(args.extract) == 1:
+            src = args.extract[0]
+            curdir = os.curdir
+        elif len(args.extract) == 2:
+            src, curdir = args.extract
+        else:
+            parser.exit(1, parser.format_help())
+
+        if is_tarfile(src):
+            with TarFile.open(src, 'r:*') as tf:
+                tf.extractall(path=curdir)
+            if args.verbose:
+                if curdir == '.':
+                    msg = '{!r} file is extracted.'.format(src)
+                else:
+                    msg = ('{!r} file is extracted '
+                           'into {!r} directory.').format(src, curdir)
+                print(msg)
+        else:
+            parser.exit(1, '{!r} is not a tar archive.\n'.format(src))
+
+    elif args.create:
+        tar_name = args.create.pop(0)
+        _, ext = os.path.splitext(tar_name)
+        compressions = {
+            # gz
+            'gz': 'gz',
+            'tgz': 'gz',
+            # xz
+            'xz': 'xz',
+            'txz': 'xz',
+            # bz2
+            'bz2': 'bz2',
+            'tbz': 'bz2',
+            'tbz2': 'bz2',
+            'tb2': 'bz2',
+        }
+        tar_mode = 'w:' + compressions[ext] if ext in compressions else 'w'
+        tar_files = args.create
+
+        with TarFile.open(tar_name, tar_mode) as tf:
+            for file_name in tar_files:
+                tf.add(file_name)
+
+        if args.verbose:
+            print('{!r} file created.'.format(tar_name))
+
+    else:
+        parser.exit(1, parser.format_help())
+
+if __name__ == '__main__':
+    main()
diff --git a/Lib/telnetlib.py b/Lib/telnetlib.py
index d49d4f4..0cacac8 100644
--- a/Lib/telnetlib.py
+++ b/Lib/telnetlib.py
@@ -17,13 +17,12 @@
 Note that read_all() won't read until eof -- it just reads some data
 -- but it guarantees to read at least one byte unless EOF is hit.
 
-It is possible to pass a Telnet object to select.select() in order to
-wait until more data is available.  Note that in this case,
-read_eager() may return b'' even if there was data on the socket,
-because the protocol negotiation may have eaten the data.  This is why
-EOFError is needed in some cases to distinguish between "no data" and
-"connection closed" (since the socket also appears ready for reading
-when it is closed).
+It is possible to pass a Telnet object to a selector in order to wait until
+more data is available.  Note that in this case, read_eager() may return b''
+even if there was data on the socket, because the protocol negotiation may have
+eaten the data.  This is why EOFError is needed in some cases to distinguish
+between "no data" and "connection closed" (since the socket also appears ready
+for reading when it is closed).
 
 To do:
 - option negotiation
@@ -34,10 +33,9 @@
 
 
 # Imported modules
-import errno
 import sys
 import socket
-import select
+import selectors
 try:
     from time import monotonic as _time
 except ImportError:
@@ -134,6 +132,15 @@
 EXOPL = bytes([255]) # Extended-Options-List
 NOOPT = bytes([0])
 
+
+# poll/select have the advantage of not requiring any extra file descriptor,
+# contrarily to epoll/kqueue (also, they require a single syscall).
+if hasattr(selectors, 'PollSelector'):
+    _TelnetSelector = selectors.PollSelector
+else:
+    _TelnetSelector = selectors.SelectSelector
+
+
 class Telnet:
 
     """Telnet interface class.
@@ -210,7 +217,6 @@
         self.sb = 0 # flag for SB and SE sequence.
         self.sbdataq = b''
         self.option_callback = None
-        self._has_poll = hasattr(select, 'poll')
         if host is not None:
             self.open(host, port, timeout)
 
@@ -277,7 +283,7 @@
         """Write a string to the socket, doubling any IAC characters.
 
         Can block if the connection is blocked.  May raise
-        socket.error if the connection is closed.
+        OSError if the connection is closed.
 
         """
         if IAC in buffer:
@@ -293,61 +299,6 @@
         is closed and no cooked data is available.
 
         """
-        if self._has_poll:
-            return self._read_until_with_poll(match, timeout)
-        else:
-            return self._read_until_with_select(match, timeout)
-
-    def _read_until_with_poll(self, match, timeout):
-        """Read until a given string is encountered or until timeout.
-
-        This method uses select.poll() to implement the timeout.
-        """
-        n = len(match)
-        call_timeout = timeout
-        if timeout is not None:
-            time_start = _time()
-        self.process_rawq()
-        i = self.cookedq.find(match)
-        if i < 0:
-            poller = select.poll()
-            poll_in_or_priority_flags = select.POLLIN | select.POLLPRI
-            poller.register(self, poll_in_or_priority_flags)
-            while i < 0 and not self.eof:
-                try:
-                    ready = poller.poll(None if timeout is None
-                                        else 1000 * call_timeout)
-                except select.error as e:
-                    if e.errno == errno.EINTR:
-                        if timeout is not None:
-                            elapsed = _time() - time_start
-                            call_timeout = timeout-elapsed
-                        continue
-                    raise
-                for fd, mode in ready:
-                    if mode & poll_in_or_priority_flags:
-                        i = max(0, len(self.cookedq)-n)
-                        self.fill_rawq()
-                        self.process_rawq()
-                        i = self.cookedq.find(match, i)
-                if timeout is not None:
-                    elapsed = _time() - time_start
-                    if elapsed >= timeout:
-                        break
-                    call_timeout = timeout-elapsed
-            poller.unregister(self)
-        if i >= 0:
-            i = i + n
-            buf = self.cookedq[:i]
-            self.cookedq = self.cookedq[i:]
-            return buf
-        return self.read_very_lazy()
-
-    def _read_until_with_select(self, match, timeout=None):
-        """Read until a given string is encountered or until timeout.
-
-        The timeout is implemented using select.select().
-        """
         n = len(match)
         self.process_rawq()
         i = self.cookedq.find(match)
@@ -356,26 +307,25 @@
             buf = self.cookedq[:i]
             self.cookedq = self.cookedq[i:]
             return buf
-        s_reply = ([self], [], [])
-        s_args = s_reply
         if timeout is not None:
-            s_args = s_args + (timeout,)
-            time_start = _time()
-        while not self.eof and select.select(*s_args) == s_reply:
-            i = max(0, len(self.cookedq)-n)
-            self.fill_rawq()
-            self.process_rawq()
-            i = self.cookedq.find(match, i)
-            if i >= 0:
-                i = i+n
-                buf = self.cookedq[:i]
-                self.cookedq = self.cookedq[i:]
-                return buf
-            if timeout is not None:
-                elapsed = _time() - time_start
-                if elapsed >= timeout:
-                    break
-                s_args = s_reply + (timeout-elapsed,)
+            deadline = _time() + timeout
+        with _TelnetSelector() as selector:
+            selector.register(self, selectors.EVENT_READ)
+            while not self.eof:
+                if selector.select(timeout):
+                    i = max(0, len(self.cookedq)-n)
+                    self.fill_rawq()
+                    self.process_rawq()
+                    i = self.cookedq.find(match, i)
+                    if i >= 0:
+                        i = i+n
+                        buf = self.cookedq[:i]
+                        self.cookedq = self.cookedq[i:]
+                        return buf
+                if timeout is not None:
+                    timeout = deadline - _time()
+                    if timeout < 0:
+                        break
         return self.read_very_lazy()
 
     def read_all(self):
@@ -580,29 +530,35 @@
 
     def sock_avail(self):
         """Test whether data is available on the socket."""
-        return select.select([self], [], [], 0) == ([self], [], [])
+        with _TelnetSelector() as selector:
+            selector.register(self, selectors.EVENT_READ)
+            return bool(selector.select(0))
 
     def interact(self):
         """Interaction function, emulates a very dumb telnet client."""
         if sys.platform == "win32":
             self.mt_interact()
             return
-        while 1:
-            rfd, wfd, xfd = select.select([self, sys.stdin], [], [])
-            if self in rfd:
-                try:
-                    text = self.read_eager()
-                except EOFError:
-                    print('*** Connection closed by remote host ***')
-                    break
-                if text:
-                    sys.stdout.write(text.decode('ascii'))
-                    sys.stdout.flush()
-            if sys.stdin in rfd:
-                line = sys.stdin.readline().encode('ascii')
-                if not line:
-                    break
-                self.write(line)
+        with _TelnetSelector() as selector:
+            selector.register(self, selectors.EVENT_READ)
+            selector.register(sys.stdin, selectors.EVENT_READ)
+
+            while True:
+                for key, events in selector.select():
+                    if key.fileobj is self:
+                        try:
+                            text = self.read_eager()
+                        except EOFError:
+                            print('*** Connection closed by remote host ***')
+                            return
+                        if text:
+                            sys.stdout.write(text.decode('ascii'))
+                            sys.stdout.flush()
+                    elif key.fileobj is sys.stdin:
+                        line = sys.stdin.readline().encode('ascii')
+                        if not line:
+                            return
+                        self.write(line)
 
     def mt_interact(self):
         """Multithreaded version of interact()."""
@@ -649,79 +605,6 @@
         results are undeterministic, and may depend on the I/O timing.
 
         """
-        if self._has_poll:
-            return self._expect_with_poll(list, timeout)
-        else:
-            return self._expect_with_select(list, timeout)
-
-    def _expect_with_poll(self, expect_list, timeout=None):
-        """Read until one from a list of a regular expressions matches.
-
-        This method uses select.poll() to implement the timeout.
-        """
-        re = None
-        expect_list = expect_list[:]
-        indices = range(len(expect_list))
-        for i in indices:
-            if not hasattr(expect_list[i], "search"):
-                if not re: import re
-                expect_list[i] = re.compile(expect_list[i])
-        call_timeout = timeout
-        if timeout is not None:
-            time_start = _time()
-        self.process_rawq()
-        m = None
-        for i in indices:
-            m = expect_list[i].search(self.cookedq)
-            if m:
-                e = m.end()
-                text = self.cookedq[:e]
-                self.cookedq = self.cookedq[e:]
-                break
-        if not m:
-            poller = select.poll()
-            poll_in_or_priority_flags = select.POLLIN | select.POLLPRI
-            poller.register(self, poll_in_or_priority_flags)
-            while not m and not self.eof:
-                try:
-                    ready = poller.poll(None if timeout is None
-                                        else 1000 * call_timeout)
-                except select.error as e:
-                    if e.errno == errno.EINTR:
-                        if timeout is not None:
-                            elapsed = _time() - time_start
-                            call_timeout = timeout-elapsed
-                        continue
-                    raise
-                for fd, mode in ready:
-                    if mode & poll_in_or_priority_flags:
-                        self.fill_rawq()
-                        self.process_rawq()
-                        for i in indices:
-                            m = expect_list[i].search(self.cookedq)
-                            if m:
-                                e = m.end()
-                                text = self.cookedq[:e]
-                                self.cookedq = self.cookedq[e:]
-                                break
-                if timeout is not None:
-                    elapsed = _time() - time_start
-                    if elapsed >= timeout:
-                        break
-                    call_timeout = timeout-elapsed
-            poller.unregister(self)
-        if m:
-            return (i, m, text)
-        text = self.read_very_lazy()
-        if not text and self.eof:
-            raise EOFError
-        return (-1, None, text)
-
-    def _expect_with_select(self, list, timeout=None):
-        """Read until one from a list of a regular expressions matches.
-
-        The timeout is implemented using select.select().
-        """
         re = None
         list = list[:]
         indices = range(len(list))
@@ -730,27 +613,27 @@
                 if not re: import re
                 list[i] = re.compile(list[i])
         if timeout is not None:
-            time_start = _time()
-        while 1:
-            self.process_rawq()
-            for i in indices:
-                m = list[i].search(self.cookedq)
-                if m:
-                    e = m.end()
-                    text = self.cookedq[:e]
-                    self.cookedq = self.cookedq[e:]
-                    return (i, m, text)
-            if self.eof:
-                break
-            if timeout is not None:
-                elapsed = _time() - time_start
-                if elapsed >= timeout:
-                    break
-                s_args = ([self.fileno()], [], [], timeout-elapsed)
-                r, w, x = select.select(*s_args)
-                if not r:
-                    break
-            self.fill_rawq()
+            deadline = _time() + timeout
+        with _TelnetSelector() as selector:
+            selector.register(self, selectors.EVENT_READ)
+            while not self.eof:
+                self.process_rawq()
+                for i in indices:
+                    m = list[i].search(self.cookedq)
+                    if m:
+                        e = m.end()
+                        text = self.cookedq[:e]
+                        self.cookedq = self.cookedq[e:]
+                        return (i, m, text)
+                if timeout is not None:
+                    ready = selector.select(timeout)
+                    timeout = deadline - _time()
+                    if not ready:
+                        if timeout < 0:
+                            break
+                        else:
+                            continue
+                self.fill_rawq()
         text = self.read_very_lazy()
         if not text and self.eof:
             raise EOFError
diff --git a/Lib/tempfile.py b/Lib/tempfile.py
index 6bc842f..b6eeca3 100644
--- a/Lib/tempfile.py
+++ b/Lib/tempfile.py
@@ -1,10 +1,10 @@
 """Temporary files.
 
 This module provides generic, low- and high-level interfaces for
-creating temporary files and directories.  The interfaces listed
-as "safe" just below can be used without fear of race conditions.
-Those listed as "unsafe" cannot, and are provided for backward
-compatibility only.
+creating temporary files and directories.  All of the interfaces
+provided by this module can be used without fear of race conditions
+except for 'mktemp'.  'mktemp' is subject to race conditions and
+should not be used; it is provided for backward compatibility only.
 
 This module also provides some data items to the user:
 
@@ -27,7 +27,6 @@
 
 # Imports.
 
-import atexit as _atexit
 import functools as _functools
 import warnings as _warnings
 import io as _io
@@ -35,23 +34,7 @@
 import shutil as _shutil
 import errno as _errno
 from random import Random as _Random
-
-try:
-    import fcntl as _fcntl
-except ImportError:
-    def _set_cloexec(fd):
-        pass
-else:
-    def _set_cloexec(fd):
-        try:
-            flags = _fcntl.fcntl(fd, _fcntl.F_GETFD, 0)
-        except OSError:
-            pass
-        else:
-            # flags read successfully, modify
-            flags |= _fcntl.FD_CLOEXEC
-            _fcntl.fcntl(fd, _fcntl.F_SETFD, flags)
-
+import weakref as _weakref
 
 try:
     import _thread
@@ -60,8 +43,6 @@
 _allocate_lock = _thread.allocate_lock
 
 _text_openflags = _os.O_RDWR | _os.O_CREAT | _os.O_EXCL
-if hasattr(_os, 'O_NOINHERIT'):
-    _text_openflags |= _os.O_NOINHERIT
 if hasattr(_os, 'O_NOFOLLOW'):
     _text_openflags |= _os.O_NOFOLLOW
 
@@ -90,8 +71,8 @@
     # Fallback.  All we need is something that raises OSError if the
     # file doesn't exist.
     def _stat(fn):
-        f = open(fn)
-        f.close()
+        fd = _os.open(fn, _os.O_RDONLY)
+        _os.close(fd)
 
 def _exists(fn):
     try:
@@ -125,7 +106,7 @@
     def __next__(self):
         c = self.characters
         choose = self.rng.choice
-        letters = [choose(c) for dummy in "123456"]
+        letters = [choose(c) for dummy in range(8)]
         return ''.join(letters)
 
 def _candidate_tempdir_list():
@@ -167,7 +148,7 @@
 
     for dir in dirlist:
         if dir != _os.curdir:
-            dir = _os.path.normcase(_os.path.abspath(dir))
+            dir = _os.path.abspath(dir)
         # Try only a few names per directory.
         for seq in range(100):
             name = next(namer)
@@ -217,7 +198,6 @@
         file = _os.path.join(dir, pre + name + suf)
         try:
             fd = _os.open(file, flags, 0o600)
-            _set_cloexec(fd)
             return (fd, _os.path.abspath(file))
         except FileExistsError:
             continue    # try again
@@ -356,8 +336,7 @@
     underlying file object, without adding a __del__ method to the
     temporary file."""
 
-    # Set here since __del__ checks it
-    file = None
+    file = None  # Set here since __del__ checks it
     close_called = False
 
     def __init__(self, file, name, delete=True):
@@ -479,10 +458,14 @@
         flags |= _os.O_TEMPORARY
 
     (fd, name) = _mkstemp_inner(dir, prefix, suffix, flags)
-    file = _io.open(fd, mode, buffering=buffering,
-                    newline=newline, encoding=encoding)
+    try:
+        file = _io.open(fd, mode, buffering=buffering,
+                        newline=newline, encoding=encoding)
 
-    return _TemporaryFileWrapper(file, name, delete)
+        return _TemporaryFileWrapper(file, name, delete)
+    except Exception:
+        _os.close(fd)
+        raise
 
 if _os.name != 'posix' or _os.sys.platform == 'cygwin':
     # On non-POSIX and Cygwin systems, assume that we cannot unlink a file
@@ -535,7 +518,7 @@
         else:
             # Setting newline="\n" avoids newline translation;
             # this is important because otherwise on Windows we'd
-            # hget double newline translation upon rollover().
+            # get double newline translation upon rollover().
             self._file = _io.StringIO(newline="\n")
         self._max_size = max_size
         self._rolled = False
@@ -680,12 +663,17 @@
     in it are removed.
     """
 
-    # Handle mkdtemp raising an exception
-    name = None
-    _closed = False
-
     def __init__(self, suffix="", prefix=template, dir=None):
         self.name = mkdtemp(suffix, prefix, dir)
+        self._finalizer = _weakref.finalize(
+            self, self._cleanup, self.name,
+            warn_message="Implicitly cleaning up {!r}".format(self))
+
+    @classmethod
+    def _cleanup(cls, name, warn_message):
+        _shutil.rmtree(name)
+        _warnings.warn(warn_message, ResourceWarning)
+
 
     def __repr__(self):
         return "<{} {!r}>".format(self.__class__.__name__, self.name)
@@ -693,53 +681,9 @@
     def __enter__(self):
         return self.name
 
-    def cleanup(self, _warn=False, _warnings=_warnings):
-        if self.name and not self._closed:
-            try:
-                _shutil.rmtree(self.name)
-            except (TypeError, AttributeError) as ex:
-                if "None" not in '%s' % (ex,):
-                    raise
-                self._rmtree(self.name)
-            self._closed = True
-            if _warn and _warnings.warn:
-                try:
-                    _warnings.warn("Implicitly cleaning up {!r}".format(self),
-                                   ResourceWarning)
-                except:
-                    if _is_running:
-                        raise
-                    # Don't raise an exception if modules needed for emitting
-                    # a warning are already cleaned in shutdown process.
-
     def __exit__(self, exc, value, tb):
         self.cleanup()
 
-    def __del__(self):
-        # Issue a ResourceWarning if implicit cleanup needed
-        self.cleanup(_warn=True)
-
-    def _rmtree(self, path, _OSError=OSError, _sep=_os.path.sep,
-                _listdir=_os.listdir, _remove=_os.remove, _rmdir=_os.rmdir):
-        # Essentially a stripped down version of shutil.rmtree.  We can't
-        # use globals because they may be None'ed out at shutdown.
-        if not isinstance(path, str):
-            _sep = _sep.encode()
-        try:
-            for name in _listdir(path):
-                fullname = path + _sep + name
-                try:
-                    _remove(fullname)
-                except _OSError:
-                    self._rmtree(fullname)
-            _rmdir(path)
-        except _OSError:
-            pass
-
-_is_running = True
-
-def _on_shutdown():
-    global _is_running
-    _is_running = False
-
-_atexit.register(_on_shutdown)
+    def cleanup(self):
+        if self._finalizer.detach():
+            _shutil.rmtree(self.name)
diff --git a/Lib/test/__main__.py b/Lib/test/__main__.py
index ce5615b..d5fbe15 100644
--- a/Lib/test/__main__.py
+++ b/Lib/test/__main__.py
@@ -1,13 +1,3 @@
-from test import regrtest, support
+from test import regrtest
 
-
-TEMPDIR, TESTCWD = regrtest._make_temp_dir_for_build(regrtest.TEMPDIR)
-regrtest.TEMPDIR = TEMPDIR
-regrtest.TESTCWD = TESTCWD
-
-# Run the tests in a context manager that temporary changes the CWD to a
-# temporary and writable directory. If it's not possible to create or
-# change the CWD, the original CWD will be used. The original CWD is
-# available from support.SAVEDCWD.
-with support.temp_cwd(TESTCWD, quiet=True):
-    regrtest.main()
+regrtest.main_in_temp_cwd()
diff --git a/Lib/test/test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
similarity index 89%
rename from Lib/test/test_multiprocessing.py
rename to Lib/test/_test_multiprocessing.py
index aa66db4..44d6c71 100644
--- a/Lib/test/test_multiprocessing.py
+++ b/Lib/test/_test_multiprocessing.py
@@ -41,7 +41,7 @@
 
 try:
     from multiprocessing import reduction
-    HAS_REDUCTION = True
+    HAS_REDUCTION = reduction.HAVE_SEND_HANDLE
 except ImportError:
     HAS_REDUCTION = False
 
@@ -97,6 +97,9 @@
 except:
     MAXFD = 256
 
+# To speed up tests when using the forkserver, we can preload these:
+PRELOAD = ['__main__', 'test.test_multiprocessing_forkserver']
+
 #
 # Some tests require ctypes
 #
@@ -292,17 +295,22 @@
         self.assertTimingAlmostEqual(join.elapsed, 0.0)
         self.assertEqual(p.is_alive(), True)
 
+        # XXX maybe terminating too soon causes the problems on Gentoo...
+        time.sleep(1)
+
         p.terminate()
 
         if hasattr(signal, 'alarm'):
+            # On the Gentoo buildbot waitpid() often seems to block forever.
+            # We use alarm() to interrupt it if it blocks for too long.
             def handler(*args):
                 raise RuntimeError('join took too long: %s' % p)
             old_handler = signal.signal(signal.SIGALRM, handler)
             try:
                 signal.alarm(10)
                 self.assertEqual(join(), None)
-                signal.alarm(0)
             finally:
+                signal.alarm(0)
                 signal.signal(signal.SIGALRM, old_handler)
         else:
             self.assertEqual(join(), None)
@@ -340,7 +348,6 @@
 
     @classmethod
     def _test_recursion(cls, wconn, id):
-        from multiprocessing import forking
         wconn.send(id)
         if len(id) < 2:
             for i in range(2):
@@ -388,7 +395,7 @@
         self.assertFalse(wait_for_handle(sentinel, timeout=0.0))
         event.set()
         p.join()
-        self.assertTrue(wait_for_handle(sentinel, timeout=DELTA))
+        self.assertTrue(wait_for_handle(sentinel, timeout=1))
 
 #
 #
@@ -688,9 +695,6 @@
     def test_task_done(self):
         queue = self.JoinableQueue()
 
-        if sys.version_info < (2, 5) and not hasattr(queue, 'task_done'):
-            self.skipTest("requires 'queue.task_done()' method")
-
         workers = [self.Process(target=self._test_task_done, args=(queue,))
                    for i in range(4)]
 
@@ -1777,6 +1781,46 @@
                 self.assertEqual(r.get(), expected)
             self.assertRaises(ValueError, p.map_async, sqr, L)
 
+    @classmethod
+    def _test_traceback(cls):
+        raise RuntimeError(123) # some comment
+
+    def test_traceback(self):
+        # We want ensure that the traceback from the child process is
+        # contained in the traceback raised in the main process.
+        if self.TYPE == 'processes':
+            with self.Pool(1) as p:
+                try:
+                    p.apply(self._test_traceback)
+                except Exception as e:
+                    exc = e
+                else:
+                    raise AssertionError('expected RuntimeError')
+            self.assertIs(type(exc), RuntimeError)
+            self.assertEqual(exc.args, (123,))
+            cause = exc.__cause__
+            self.assertIs(type(cause), multiprocessing.pool.RemoteTraceback)
+            self.assertIn('raise RuntimeError(123) # some comment', cause.tb)
+
+            with test.support.captured_stderr() as f1:
+                try:
+                    raise exc
+                except RuntimeError:
+                    sys.excepthook(*sys.exc_info())
+            self.assertIn('raise RuntimeError(123) # some comment',
+                          f1.getvalue())
+
+    @classmethod
+    def _test_wrapped_exception(cls):
+        raise RuntimeError('foo')
+
+    def test_wrapped_exception(self):
+        # Issue #20980: Should not wrap exception when using thread pool
+        with self.Pool(1) as p:
+            with self.assertRaises(RuntimeError):
+                p.apply(self._test_wrapped_exception)
+
+
 def raising():
     raise KeyError("key")
 
@@ -2484,7 +2528,7 @@
 
     @classmethod
     def tearDownClass(cls):
-        from multiprocessing.reduction import resource_sharer
+        from multiprocessing import resource_sharer
         resource_sharer.stop(timeout=5)
 
     @classmethod
@@ -2798,30 +2842,40 @@
 # Test that from ... import * works for each module
 #
 
-class _TestImportStar(BaseTestCase):
+class _TestImportStar(unittest.TestCase):
 
-    ALLOWED_TYPES = ('processes',)
+    def get_module_names(self):
+        import glob
+        folder = os.path.dirname(multiprocessing.__file__)
+        pattern = os.path.join(folder, '*.py')
+        files = glob.glob(pattern)
+        modules = [os.path.splitext(os.path.split(f)[1])[0] for f in files]
+        modules = ['multiprocessing.' + m for m in modules]
+        modules.remove('multiprocessing.__init__')
+        modules.append('multiprocessing')
+        return modules
 
     def test_import(self):
-        modules = [
-            'multiprocessing', 'multiprocessing.connection',
-            'multiprocessing.heap', 'multiprocessing.managers',
-            'multiprocessing.pool', 'multiprocessing.process',
-            'multiprocessing.synchronize', 'multiprocessing.util'
-            ]
+        modules = self.get_module_names()
+        if sys.platform == 'win32':
+            modules.remove('multiprocessing.popen_fork')
+            modules.remove('multiprocessing.popen_forkserver')
+            modules.remove('multiprocessing.popen_spawn_posix')
+        else:
+            modules.remove('multiprocessing.popen_spawn_win32')
+            if not HAS_REDUCTION:
+                modules.remove('multiprocessing.popen_forkserver')
 
-        if HAS_REDUCTION:
-            modules.append('multiprocessing.reduction')
-
-        if c_int is not None:
+        if c_int is None:
             # This module requires _ctypes
-            modules.append('multiprocessing.sharedctypes')
+            modules.remove('multiprocessing.sharedctypes')
 
         for name in modules:
             __import__(name)
             mod = sys.modules[name]
+            self.assertTrue(hasattr(mod, '__all__'), name)
 
-            for attr in getattr(mod, '__all__', ()):
+            for attr in mod.__all__:
                 self.assertTrue(
                     hasattr(mod, attr),
                     '%r does not have attribute %r' % (mod, attr)
@@ -2904,7 +2958,7 @@
 
     @classmethod
     def _killer(cls, pid):
-        time.sleep(0.5)
+        time.sleep(0.1)
         os.kill(pid, signal.SIGUSR1)
 
     @unittest.skipUnless(hasattr(signal, 'SIGUSR1'), 'requires SIGUSR1')
@@ -2917,12 +2971,14 @@
         try:
             killer = self.Process(target=self._killer, args=(pid,))
             killer.start()
-            p = self.Process(target=time.sleep, args=(1,))
-            p.start()
-            p.join()
+            try:
+                p = self.Process(target=time.sleep, args=(2,))
+                p.start()
+                p.join()
+            finally:
+                killer.join()
             self.assertTrue(got_signal[0])
             self.assertEqual(p.exitcode, 0)
-            killer.join()
         finally:
             signal.signal(signal.SIGUSR1, oldhandler)
 
@@ -2935,8 +2991,11 @@
     @unittest.skipIf(WIN32, "skipped on Windows")
     def test_invalid_handles(self):
         conn = multiprocessing.connection.Connection(44977608)
+        # check that poll() doesn't crash
         try:
-            self.assertRaises((ValueError, OSError), conn.poll)
+            conn.poll()
+        except (ValueError, OSError):
+            pass
         finally:
             # Hack private attribute _handle to avoid printing an error
             # in conn.__del__
@@ -2944,131 +3003,6 @@
         self.assertRaises((ValueError, OSError),
                           multiprocessing.connection.Connection, -1)
 
-#
-# Functions used to create test cases from the base ones in this module
-#
-
-def create_test_cases(Mixin, type):
-    result = {}
-    glob = globals()
-    Type = type.capitalize()
-    ALL_TYPES = {'processes', 'threads', 'manager'}
-
-    for name in list(glob.keys()):
-        if name.startswith('_Test'):
-            base = glob[name]
-            assert set(base.ALLOWED_TYPES) <= ALL_TYPES, set(base.ALLOWED_TYPES)
-            if type in base.ALLOWED_TYPES:
-                newname = 'With' + Type + name[1:]
-                class Temp(base, Mixin, unittest.TestCase):
-                    pass
-                result[newname] = Temp
-                Temp.__name__ = Temp.__qualname__ = newname
-                Temp.__module__ = Mixin.__module__
-    return result
-
-#
-# Create test cases
-#
-
-class ProcessesMixin(object):
-    TYPE = 'processes'
-    Process = multiprocessing.Process
-    connection = multiprocessing.connection
-    current_process = staticmethod(multiprocessing.current_process)
-    active_children = staticmethod(multiprocessing.active_children)
-    Pool = staticmethod(multiprocessing.Pool)
-    Pipe = staticmethod(multiprocessing.Pipe)
-    Queue = staticmethod(multiprocessing.Queue)
-    JoinableQueue = staticmethod(multiprocessing.JoinableQueue)
-    Lock = staticmethod(multiprocessing.Lock)
-    RLock = staticmethod(multiprocessing.RLock)
-    Semaphore = staticmethod(multiprocessing.Semaphore)
-    BoundedSemaphore = staticmethod(multiprocessing.BoundedSemaphore)
-    Condition = staticmethod(multiprocessing.Condition)
-    Event = staticmethod(multiprocessing.Event)
-    Barrier = staticmethod(multiprocessing.Barrier)
-    Value = staticmethod(multiprocessing.Value)
-    Array = staticmethod(multiprocessing.Array)
-    RawValue = staticmethod(multiprocessing.RawValue)
-    RawArray = staticmethod(multiprocessing.RawArray)
-
-testcases_processes = create_test_cases(ProcessesMixin, type='processes')
-globals().update(testcases_processes)
-
-
-class ManagerMixin(object):
-    TYPE = 'manager'
-    Process = multiprocessing.Process
-    Queue = property(operator.attrgetter('manager.Queue'))
-    JoinableQueue = property(operator.attrgetter('manager.JoinableQueue'))
-    Lock = property(operator.attrgetter('manager.Lock'))
-    RLock = property(operator.attrgetter('manager.RLock'))
-    Semaphore = property(operator.attrgetter('manager.Semaphore'))
-    BoundedSemaphore = property(operator.attrgetter('manager.BoundedSemaphore'))
-    Condition = property(operator.attrgetter('manager.Condition'))
-    Event = property(operator.attrgetter('manager.Event'))
-    Barrier = property(operator.attrgetter('manager.Barrier'))
-    Value = property(operator.attrgetter('manager.Value'))
-    Array = property(operator.attrgetter('manager.Array'))
-    list = property(operator.attrgetter('manager.list'))
-    dict = property(operator.attrgetter('manager.dict'))
-    Namespace = property(operator.attrgetter('manager.Namespace'))
-
-    @classmethod
-    def Pool(cls, *args, **kwds):
-        return cls.manager.Pool(*args, **kwds)
-
-    @classmethod
-    def setUpClass(cls):
-        cls.manager = multiprocessing.Manager()
-
-    @classmethod
-    def tearDownClass(cls):
-        # only the manager process should be returned by active_children()
-        # but this can take a bit on slow machines, so wait a few seconds
-        # if there are other children too (see #17395)
-        t = 0.01
-        while len(multiprocessing.active_children()) > 1 and t < 5:
-            time.sleep(t)
-            t *= 2
-        gc.collect()                       # do garbage collection
-        if cls.manager._number_of_objects() != 0:
-            # This is not really an error since some tests do not
-            # ensure that all processes which hold a reference to a
-            # managed object have been joined.
-            print('Shared objects which still exist at manager shutdown:')
-            print(cls.manager._debug_info())
-        cls.manager.shutdown()
-        cls.manager.join()
-        cls.manager = None
-
-testcases_manager = create_test_cases(ManagerMixin, type='manager')
-globals().update(testcases_manager)
-
-
-class ThreadsMixin(object):
-    TYPE = 'threads'
-    Process = multiprocessing.dummy.Process
-    connection = multiprocessing.dummy.connection
-    current_process = staticmethod(multiprocessing.dummy.current_process)
-    active_children = staticmethod(multiprocessing.dummy.active_children)
-    Pool = staticmethod(multiprocessing.Pool)
-    Pipe = staticmethod(multiprocessing.dummy.Pipe)
-    Queue = staticmethod(multiprocessing.dummy.Queue)
-    JoinableQueue = staticmethod(multiprocessing.dummy.JoinableQueue)
-    Lock = staticmethod(multiprocessing.dummy.Lock)
-    RLock = staticmethod(multiprocessing.dummy.RLock)
-    Semaphore = staticmethod(multiprocessing.dummy.Semaphore)
-    BoundedSemaphore = staticmethod(multiprocessing.dummy.BoundedSemaphore)
-    Condition = staticmethod(multiprocessing.dummy.Condition)
-    Event = staticmethod(multiprocessing.dummy.Event)
-    Barrier = staticmethod(multiprocessing.dummy.Barrier)
-    Value = staticmethod(multiprocessing.dummy.Value)
-    Array = staticmethod(multiprocessing.dummy.Array)
-
-testcases_threads = create_test_cases(ThreadsMixin, type='threads')
-globals().update(testcases_threads)
 
 
 class OtherTest(unittest.TestCase):
@@ -3418,7 +3352,7 @@
     def test_flags(self):
         import json, subprocess
         # start child process using unusual flags
-        prog = ('from test.test_multiprocessing import TestFlags; ' +
+        prog = ('from test._test_multiprocessing import TestFlags; ' +
                 'TestFlags.run_in_child()')
         data = subprocess.check_output(
             [sys.executable, '-E', '-S', '-O', '-c', prog])
@@ -3465,13 +3399,14 @@
 
 class TestNoForkBomb(unittest.TestCase):
     def test_noforkbomb(self):
+        sm = multiprocessing.get_start_method()
         name = os.path.join(os.path.dirname(__file__), 'mp_fork_bomb.py')
-        if WIN32:
-            rc, out, err = test.script_helper.assert_python_failure(name)
+        if sm != 'fork':
+            rc, out, err = test.script_helper.assert_python_failure(name, sm)
             self.assertEqual('', out.decode('ascii'))
             self.assertIn('RuntimeError', err.decode('ascii'))
         else:
-            rc, out, err = test.script_helper.assert_python_ok(name)
+            rc, out, err = test.script_helper.assert_python_ok(name, sm)
             self.assertEqual('123', out.decode('ascii').rstrip())
             self.assertEqual('', err.decode('ascii'))
 
@@ -3489,7 +3424,8 @@
         if n > 1:
             p = multiprocessing.Process(target=cls.child, args=(n-1, conn))
             p.start()
-            p.join()
+            conn.close()
+            p.join(timeout=5)
         else:
             conn.send(len(util._afterfork_registry))
         conn.close()
@@ -3500,11 +3436,78 @@
         old_size = len(util._afterfork_registry)
         p = multiprocessing.Process(target=self.child, args=(5, w))
         p.start()
+        w.close()
         new_size = r.recv()
-        p.join()
+        p.join(timeout=5)
         self.assertLessEqual(new_size, old_size)
 
 #
+# Check that non-forked child processes do not inherit unneeded fds/handles
+#
+
+class TestCloseFds(unittest.TestCase):
+
+    def get_high_socket_fd(self):
+        if WIN32:
+            # The child process will not have any socket handles, so
+            # calling socket.fromfd() should produce WSAENOTSOCK even
+            # if there is a handle of the same number.
+            return socket.socket().detach()
+        else:
+            # We want to produce a socket with an fd high enough that a
+            # freshly created child process will not have any fds as high.
+            fd = socket.socket().detach()
+            to_close = []
+            while fd < 50:
+                to_close.append(fd)
+                fd = os.dup(fd)
+            for x in to_close:
+                os.close(x)
+            return fd
+
+    def close(self, fd):
+        if WIN32:
+            socket.socket(fileno=fd).close()
+        else:
+            os.close(fd)
+
+    @classmethod
+    def _test_closefds(cls, conn, fd):
+        try:
+            s = socket.fromfd(fd, socket.AF_INET, socket.SOCK_STREAM)
+        except Exception as e:
+            conn.send(e)
+        else:
+            s.close()
+            conn.send(None)
+
+    def test_closefd(self):
+        if not HAS_REDUCTION:
+            raise unittest.SkipTest('requires fd pickling')
+
+        reader, writer = multiprocessing.Pipe()
+        fd = self.get_high_socket_fd()
+        try:
+            p = multiprocessing.Process(target=self._test_closefds,
+                                        args=(writer, fd))
+            p.start()
+            writer.close()
+            e = reader.recv()
+            p.join(timeout=5)
+        finally:
+            self.close(fd)
+            writer.close()
+            reader.close()
+
+        if multiprocessing.get_start_method() == 'fork':
+            self.assertIs(e, None)
+        else:
+            WSAENOTSOCK = 10038
+            self.assertIsInstance(e, OSError)
+            self.assertTrue(e.errno == errno.EBADF or
+                            e.winerror == WSAENOTSOCK, e)
+
+#
 # Issue #17097: EINTR should be ignored by recv(), send(), accept() etc
 #
 
@@ -3548,10 +3551,10 @@
         def handler(signum, frame):
             pass
         signal.signal(signal.SIGUSR1, handler)
-        l = multiprocessing.connection.Listener()
-        conn.send(l.address)
-        a = l.accept()
-        a.send('welcome')
+        with multiprocessing.connection.Listener() as l:
+            conn.send(l.address)
+            a = l.accept()
+            a.send('welcome')
 
     @unittest.skipUnless(hasattr(signal, 'SIGUSR1'), 'requires SIGUSR1')
     def test_ignore_listener(self):
@@ -3572,26 +3575,267 @@
         finally:
             conn.close()
 
-#
-#
-#
+class TestStartMethod(unittest.TestCase):
+    @classmethod
+    def _check_context(cls, conn):
+        conn.send(multiprocessing.get_start_method())
 
-def setUpModule():
-    if sys.platform.startswith("linux"):
+    def check_context(self, ctx):
+        r, w = ctx.Pipe(duplex=False)
+        p = ctx.Process(target=self._check_context, args=(w,))
+        p.start()
+        w.close()
+        child_method = r.recv()
+        r.close()
+        p.join()
+        self.assertEqual(child_method, ctx.get_start_method())
+
+    def test_context(self):
+        for method in ('fork', 'spawn', 'forkserver'):
+            try:
+                ctx = multiprocessing.get_context(method)
+            except ValueError:
+                continue
+            self.assertEqual(ctx.get_start_method(), method)
+            self.assertIs(ctx.get_context(), ctx)
+            self.assertRaises(ValueError, ctx.set_start_method, 'spawn')
+            self.assertRaises(ValueError, ctx.set_start_method, None)
+            self.check_context(ctx)
+
+    def test_set_get(self):
+        multiprocessing.set_forkserver_preload(PRELOAD)
+        count = 0
+        old_method = multiprocessing.get_start_method()
         try:
-            lock = multiprocessing.RLock()
-        except OSError:
-            raise unittest.SkipTest("OSError raises on RLock creation, "
-                                    "see issue 3111!")
-    check_enough_semaphores()
-    util.get_temp_dir()     # creates temp directory for use by all processes
-    multiprocessing.get_logger().setLevel(LOG_LEVEL)
+            for method in ('fork', 'spawn', 'forkserver'):
+                try:
+                    multiprocessing.set_start_method(method, force=True)
+                except ValueError:
+                    continue
+                self.assertEqual(multiprocessing.get_start_method(), method)
+                ctx = multiprocessing.get_context()
+                self.assertEqual(ctx.get_start_method(), method)
+                self.assertTrue(type(ctx).__name__.lower().startswith(method))
+                self.assertTrue(
+                    ctx.Process.__name__.lower().startswith(method))
+                self.check_context(multiprocessing)
+                count += 1
+        finally:
+            multiprocessing.set_start_method(old_method, force=True)
+        self.assertGreaterEqual(count, 1)
+
+    def test_get_all(self):
+        methods = multiprocessing.get_all_start_methods()
+        if sys.platform == 'win32':
+            self.assertEqual(methods, ['spawn'])
+        else:
+            self.assertTrue(methods == ['fork', 'spawn'] or
+                            methods == ['fork', 'spawn', 'forkserver'])
+
+#
+# Check that killing process does not leak named semaphores
+#
+
+@unittest.skipIf(sys.platform == "win32",
+                 "test semantics don't make sense on Windows")
+class TestSemaphoreTracker(unittest.TestCase):
+    def test_semaphore_tracker(self):
+        import subprocess
+        cmd = '''if 1:
+            import multiprocessing as mp, time, os
+            mp.set_start_method("spawn")
+            lock1 = mp.Lock()
+            lock2 = mp.Lock()
+            os.write(%d, lock1._semlock.name.encode("ascii") + b"\\n")
+            os.write(%d, lock2._semlock.name.encode("ascii") + b"\\n")
+            time.sleep(10)
+        '''
+        r, w = os.pipe()
+        p = subprocess.Popen([sys.executable,
+                             '-c', cmd % (w, w)],
+                             pass_fds=[w],
+                             stderr=subprocess.PIPE)
+        os.close(w)
+        with open(r, 'rb', closefd=True) as f:
+            name1 = f.readline().rstrip().decode('ascii')
+            name2 = f.readline().rstrip().decode('ascii')
+        _multiprocessing.sem_unlink(name1)
+        p.terminate()
+        p.wait()
+        time.sleep(2.0)
+        with self.assertRaises(OSError) as ctx:
+            _multiprocessing.sem_unlink(name2)
+        # docs say it should be ENOENT, but OSX seems to give EINVAL
+        self.assertIn(ctx.exception.errno, (errno.ENOENT, errno.EINVAL))
+        err = p.stderr.read().decode('utf-8')
+        p.stderr.close()
+        expected = 'semaphore_tracker: There appear to be 2 leaked semaphores'
+        self.assertRegex(err, expected)
+        self.assertRegex(err, 'semaphore_tracker: %r: \[Errno' % name1)
+
+#
+# Mixins
+#
+
+class ProcessesMixin(object):
+    TYPE = 'processes'
+    Process = multiprocessing.Process
+    connection = multiprocessing.connection
+    current_process = staticmethod(multiprocessing.current_process)
+    active_children = staticmethod(multiprocessing.active_children)
+    Pool = staticmethod(multiprocessing.Pool)
+    Pipe = staticmethod(multiprocessing.Pipe)
+    Queue = staticmethod(multiprocessing.Queue)
+    JoinableQueue = staticmethod(multiprocessing.JoinableQueue)
+    Lock = staticmethod(multiprocessing.Lock)
+    RLock = staticmethod(multiprocessing.RLock)
+    Semaphore = staticmethod(multiprocessing.Semaphore)
+    BoundedSemaphore = staticmethod(multiprocessing.BoundedSemaphore)
+    Condition = staticmethod(multiprocessing.Condition)
+    Event = staticmethod(multiprocessing.Event)
+    Barrier = staticmethod(multiprocessing.Barrier)
+    Value = staticmethod(multiprocessing.Value)
+    Array = staticmethod(multiprocessing.Array)
+    RawValue = staticmethod(multiprocessing.RawValue)
+    RawArray = staticmethod(multiprocessing.RawArray)
 
 
-def tearDownModule():
-    # pause a bit so we don't get warning about dangling threads/processes
-    time.sleep(0.5)
+class ManagerMixin(object):
+    TYPE = 'manager'
+    Process = multiprocessing.Process
+    Queue = property(operator.attrgetter('manager.Queue'))
+    JoinableQueue = property(operator.attrgetter('manager.JoinableQueue'))
+    Lock = property(operator.attrgetter('manager.Lock'))
+    RLock = property(operator.attrgetter('manager.RLock'))
+    Semaphore = property(operator.attrgetter('manager.Semaphore'))
+    BoundedSemaphore = property(operator.attrgetter('manager.BoundedSemaphore'))
+    Condition = property(operator.attrgetter('manager.Condition'))
+    Event = property(operator.attrgetter('manager.Event'))
+    Barrier = property(operator.attrgetter('manager.Barrier'))
+    Value = property(operator.attrgetter('manager.Value'))
+    Array = property(operator.attrgetter('manager.Array'))
+    list = property(operator.attrgetter('manager.list'))
+    dict = property(operator.attrgetter('manager.dict'))
+    Namespace = property(operator.attrgetter('manager.Namespace'))
+
+    @classmethod
+    def Pool(cls, *args, **kwds):
+        return cls.manager.Pool(*args, **kwds)
+
+    @classmethod
+    def setUpClass(cls):
+        cls.manager = multiprocessing.Manager()
+
+    @classmethod
+    def tearDownClass(cls):
+        # only the manager process should be returned by active_children()
+        # but this can take a bit on slow machines, so wait a few seconds
+        # if there are other children too (see #17395)
+        t = 0.01
+        while len(multiprocessing.active_children()) > 1 and t < 5:
+            time.sleep(t)
+            t *= 2
+        gc.collect()                       # do garbage collection
+        if cls.manager._number_of_objects() != 0:
+            # This is not really an error since some tests do not
+            # ensure that all processes which hold a reference to a
+            # managed object have been joined.
+            print('Shared objects which still exist at manager shutdown:')
+            print(cls.manager._debug_info())
+        cls.manager.shutdown()
+        cls.manager.join()
+        cls.manager = None
 
 
-if __name__ == '__main__':
-    unittest.main()
+class ThreadsMixin(object):
+    TYPE = 'threads'
+    Process = multiprocessing.dummy.Process
+    connection = multiprocessing.dummy.connection
+    current_process = staticmethod(multiprocessing.dummy.current_process)
+    active_children = staticmethod(multiprocessing.dummy.active_children)
+    Pool = staticmethod(multiprocessing.Pool)
+    Pipe = staticmethod(multiprocessing.dummy.Pipe)
+    Queue = staticmethod(multiprocessing.dummy.Queue)
+    JoinableQueue = staticmethod(multiprocessing.dummy.JoinableQueue)
+    Lock = staticmethod(multiprocessing.dummy.Lock)
+    RLock = staticmethod(multiprocessing.dummy.RLock)
+    Semaphore = staticmethod(multiprocessing.dummy.Semaphore)
+    BoundedSemaphore = staticmethod(multiprocessing.dummy.BoundedSemaphore)
+    Condition = staticmethod(multiprocessing.dummy.Condition)
+    Event = staticmethod(multiprocessing.dummy.Event)
+    Barrier = staticmethod(multiprocessing.dummy.Barrier)
+    Value = staticmethod(multiprocessing.dummy.Value)
+    Array = staticmethod(multiprocessing.dummy.Array)
+
+#
+# Functions used to create test cases from the base ones in this module
+#
+
+def install_tests_in_module_dict(remote_globs, start_method):
+    __module__ = remote_globs['__name__']
+    local_globs = globals()
+    ALL_TYPES = {'processes', 'threads', 'manager'}
+
+    for name, base in local_globs.items():
+        if not isinstance(base, type):
+            continue
+        if issubclass(base, BaseTestCase):
+            if base is BaseTestCase:
+                continue
+            assert set(base.ALLOWED_TYPES) <= ALL_TYPES, base.ALLOWED_TYPES
+            for type_ in base.ALLOWED_TYPES:
+                newname = 'With' + type_.capitalize() + name[1:]
+                Mixin = local_globs[type_.capitalize() + 'Mixin']
+                class Temp(base, Mixin, unittest.TestCase):
+                    pass
+                Temp.__name__ = Temp.__qualname__ = newname
+                Temp.__module__ = __module__
+                remote_globs[newname] = Temp
+        elif issubclass(base, unittest.TestCase):
+            class Temp(base, object):
+                pass
+            Temp.__name__ = Temp.__qualname__ = name
+            Temp.__module__ = __module__
+            remote_globs[name] = Temp
+
+    dangling = [None, None]
+    old_start_method = [None]
+
+    def setUpModule():
+        multiprocessing.set_forkserver_preload(PRELOAD)
+        multiprocessing.process._cleanup()
+        dangling[0] = multiprocessing.process._dangling.copy()
+        dangling[1] = threading._dangling.copy()
+        old_start_method[0] = multiprocessing.get_start_method(allow_none=True)
+        try:
+            multiprocessing.set_start_method(start_method, force=True)
+        except ValueError:
+            raise unittest.SkipTest(start_method +
+                                    ' start method not supported')
+
+        if sys.platform.startswith("linux"):
+            try:
+                lock = multiprocessing.RLock()
+            except OSError:
+                raise unittest.SkipTest("OSError raises on RLock creation, "
+                                        "see issue 3111!")
+        check_enough_semaphores()
+        util.get_temp_dir()     # creates temp directory
+        multiprocessing.get_logger().setLevel(LOG_LEVEL)
+
+    def tearDownModule():
+        multiprocessing.set_start_method(old_start_method[0], force=True)
+        # pause a bit so we don't get warning about dangling threads/processes
+        time.sleep(0.5)
+        multiprocessing.process._cleanup()
+        gc.collect()
+        tmp = set(multiprocessing.process._dangling) - set(dangling[0])
+        if tmp:
+            print('Dangling processes:', tmp, file=sys.stderr)
+        del tmp
+        tmp = set(threading._dangling) - set(dangling[1])
+        if tmp:
+            print('Dangling threads:', tmp, file=sys.stderr)
+
+    remote_globs['setUpModule'] = setUpModule
+    remote_globs['tearDownModule'] = tearDownModule
diff --git a/Lib/test/audiodata/pluck-pcm24.au b/Lib/test/audiodata/pluck-pcm24.au
new file mode 100644
index 0000000..0bb2304
--- /dev/null
+++ b/Lib/test/audiodata/pluck-pcm24.au
Binary files differ
diff --git a/Lib/test/audiotests.py b/Lib/test/audiotests.py
index 6ff5bb8..0ae2242 100644
--- a/Lib/test/audiotests.py
+++ b/Lib/test/audiotests.py
@@ -12,24 +12,6 @@
     def seek(self, *args, **kwargs):
         raise io.UnsupportedOperation
 
-def byteswap2(data):
-    a = array.array('h')
-    a.frombytes(data)
-    a.byteswap()
-    return a.tobytes()
-
-def byteswap3(data):
-    ba = bytearray(data)
-    ba[::3] = data[2::3]
-    ba[2::3] = data[::3]
-    return bytes(ba)
-
-def byteswap4(data):
-    a = array.array('i')
-    a.frombytes(data)
-    a.byteswap()
-    return a.tobytes()
-
 
 class AudioTests:
     close_fd = False
@@ -56,9 +38,16 @@
         params = f.getparams()
         self.assertEqual(params,
                 (nchannels, sampwidth, framerate, nframes, comptype, compname))
+        self.assertEqual(params.nchannels, nchannels)
+        self.assertEqual(params.sampwidth, sampwidth)
+        self.assertEqual(params.framerate, framerate)
+        self.assertEqual(params.nframes, nframes)
+        self.assertEqual(params.comptype, comptype)
+        self.assertEqual(params.compname, compname)
 
-        dump = pickle.dumps(params)
-        self.assertEqual(pickle.loads(dump), params)
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            dump = pickle.dumps(params, proto)
+            self.assertEqual(pickle.loads(dump), params)
 
 
 class AudioWriteTests(AudioTests):
@@ -72,15 +61,12 @@
         return f
 
     def check_file(self, testfile, nframes, frames):
-        f = self.module.open(testfile, 'rb')
-        try:
+        with self.module.open(testfile, 'rb') as f:
             self.assertEqual(f.getnchannels(), self.nchannels)
             self.assertEqual(f.getsampwidth(), self.sampwidth)
             self.assertEqual(f.getframerate(), self.framerate)
             self.assertEqual(f.getnframes(), nframes)
             self.assertEqual(f.readframes(nframes), frames)
-        finally:
-            f.close()
 
     def test_write_params(self):
         f = self.create_file(TESTFN)
@@ -90,6 +76,53 @@
                           self.nframes, self.comptype, self.compname)
         f.close()
 
+    def test_write_context_manager_calls_close(self):
+        # Close checks for a minimum header and will raise an error
+        # if it is not set, so this proves that close is called.
+        with self.assertRaises(self.module.Error):
+            with self.module.open(TESTFN, 'wb'):
+                pass
+        with self.assertRaises(self.module.Error):
+            with open(TESTFN, 'wb') as testfile:
+                with self.module.open(testfile):
+                    pass
+
+    def test_context_manager_with_open_file(self):
+        with open(TESTFN, 'wb') as testfile:
+            with self.module.open(testfile) as f:
+                f.setnchannels(self.nchannels)
+                f.setsampwidth(self.sampwidth)
+                f.setframerate(self.framerate)
+                f.setcomptype(self.comptype, self.compname)
+            self.assertEqual(testfile.closed, self.close_fd)
+        with open(TESTFN, 'rb') as testfile:
+            with self.module.open(testfile) as f:
+                self.assertFalse(f.getfp().closed)
+                params = f.getparams()
+                self.assertEqual(params.nchannels, self.nchannels)
+                self.assertEqual(params.sampwidth, self.sampwidth)
+                self.assertEqual(params.framerate, self.framerate)
+            if not self.close_fd:
+                self.assertIsNone(f.getfp())
+            self.assertEqual(testfile.closed, self.close_fd)
+
+    def test_context_manager_with_filename(self):
+        # If the file doesn't get closed, this test won't fail, but it will
+        # produce a resource leak warning.
+        with self.module.open(TESTFN, 'wb') as f:
+            f.setnchannels(self.nchannels)
+            f.setsampwidth(self.sampwidth)
+            f.setframerate(self.framerate)
+            f.setcomptype(self.comptype, self.compname)
+        with self.module.open(TESTFN) as f:
+            self.assertFalse(f.getfp().closed)
+            params = f.getparams()
+            self.assertEqual(params.nchannels, self.nchannels)
+            self.assertEqual(params.sampwidth, self.sampwidth)
+            self.assertEqual(params.framerate, self.framerate)
+        if not self.close_fd:
+            self.assertIsNone(f.getfp())
+
     def test_write(self):
         f = self.create_file(TESTFN)
         f.setnframes(self.nframes)
@@ -98,6 +131,30 @@
 
         self.check_file(TESTFN, self.nframes, self.frames)
 
+    def test_write_bytearray(self):
+        f = self.create_file(TESTFN)
+        f.setnframes(self.nframes)
+        f.writeframes(bytearray(self.frames))
+        f.close()
+
+        self.check_file(TESTFN, self.nframes, self.frames)
+
+    def test_write_array(self):
+        f = self.create_file(TESTFN)
+        f.setnframes(self.nframes)
+        f.writeframes(array.array('h', self.frames))
+        f.close()
+
+        self.check_file(TESTFN, self.nframes, self.frames)
+
+    def test_write_memoryview(self):
+        f = self.create_file(TESTFN)
+        f.setnframes(self.nframes)
+        f.writeframes(memoryview(self.frames))
+        f.close()
+
+        self.check_file(TESTFN, self.nframes, self.frames)
+
     def test_incompleted_write(self):
         with open(TESTFN, 'wb') as testfile:
             testfile.write(b'ababagalamaga')
@@ -137,20 +194,18 @@
             self.check_file(testfile, self.nframes, self.frames)
 
     def test_unseekable_read(self):
-        f = self.create_file(TESTFN)
-        f.setnframes(self.nframes)
-        f.writeframes(self.frames)
-        f.close()
+        with self.create_file(TESTFN) as f:
+            f.setnframes(self.nframes)
+            f.writeframes(self.frames)
 
         with UnseekableIO(TESTFN, 'rb') as testfile:
             self.check_file(testfile, self.nframes, self.frames)
 
     def test_unseekable_write(self):
         with UnseekableIO(TESTFN, 'wb') as testfile:
-            f = self.create_file(testfile)
-            f.setnframes(self.nframes)
-            f.writeframes(self.frames)
-            f.close()
+            with self.create_file(testfile) as f:
+                f.setnframes(self.nframes)
+                f.writeframes(self.frames)
 
         self.check_file(TESTFN, self.nframes, self.frames)
 
@@ -267,12 +322,9 @@
 
         with open(TESTFN, 'rb') as testfile:
             self.assertEqual(testfile.read(13), b'ababagalamaga')
-            f = self.module.open(testfile, 'rb')
-            try:
+            with self.module.open(testfile, 'rb') as f:
                 self.assertEqual(f.getnchannels(), self.nchannels)
                 self.assertEqual(f.getsampwidth(), self.sampwidth)
                 self.assertEqual(f.getframerate(), self.framerate)
                 self.assertEqual(f.getnframes(), self.sndfilenframes)
                 self.assertEqual(f.readframes(self.nframes), self.frames)
-            finally:
-                f.close()
diff --git a/Lib/test/badsyntax_future10.py b/Lib/test/badsyntax_future10.py
new file mode 100644
index 0000000..fa5ab67
--- /dev/null
+++ b/Lib/test/badsyntax_future10.py
@@ -0,0 +1,3 @@
+from __future__ import absolute_import
+"spam, bar, blah"
+from __future__ import print_function
diff --git a/Lib/test/buffer_tests.py b/Lib/test/buffer_tests.py
index cf54c28..0a62940 100644
--- a/Lib/test/buffer_tests.py
+++ b/Lib/test/buffer_tests.py
@@ -160,14 +160,20 @@
                          self.marshal(b'abc\rab\tdef\ng\thi').expandtabs(8))
         self.assertEqual(b'abc\rab  def\ng   hi',
                          self.marshal(b'abc\rab\tdef\ng\thi').expandtabs(4))
+        self.assertEqual(b'abc\r\nab      def\ng       hi',
+                         self.marshal(b'abc\r\nab\tdef\ng\thi').expandtabs())
+        self.assertEqual(b'abc\r\nab      def\ng       hi',
+                         self.marshal(b'abc\r\nab\tdef\ng\thi').expandtabs(8))
         self.assertEqual(b'abc\r\nab  def\ng   hi',
                          self.marshal(b'abc\r\nab\tdef\ng\thi').expandtabs(4))
-        self.assertEqual(b'abc\rab      def\ng       hi',
-                         self.marshal(b'abc\rab\tdef\ng\thi').expandtabs())
-        self.assertEqual(b'abc\rab      def\ng       hi',
-                         self.marshal(b'abc\rab\tdef\ng\thi').expandtabs(8))
         self.assertEqual(b'abc\r\nab\r\ndef\ng\r\nhi',
-            self.marshal(b'abc\r\nab\r\ndef\ng\r\nhi').expandtabs(4))
+                         self.marshal(b'abc\r\nab\r\ndef\ng\r\nhi').expandtabs(4))
+        # check keyword args
+        self.assertEqual(b'abc\rab      def\ng       hi',
+                         self.marshal(b'abc\rab\tdef\ng\thi').expandtabs(tabsize=8))
+        self.assertEqual(b'abc\rab  def\ng   hi',
+                         self.marshal(b'abc\rab\tdef\ng\thi').expandtabs(tabsize=4))
+
         self.assertEqual(b'  a\n b', self.marshal(b' \ta\n\tb').expandtabs(1))
 
         self.assertRaises(TypeError, self.marshal(b'hello').expandtabs, 42, 42)
diff --git a/Lib/test/bytecode_helper.py b/Lib/test/bytecode_helper.py
new file mode 100644
index 0000000..58b4209
--- /dev/null
+++ b/Lib/test/bytecode_helper.py
@@ -0,0 +1,41 @@
+"""bytecode_helper - support tools for testing correct bytecode generation"""
+
+import unittest
+import dis
+import io
+
+_UNSPECIFIED = object()
+
+class BytecodeTestCase(unittest.TestCase):
+    """Custom assertion methods for inspecting bytecode."""
+
+    def get_disassembly_as_string(self, co):
+        s = io.StringIO()
+        dis.dis(co, file=s)
+        return s.getvalue()
+
+    def assertInBytecode(self, x, opname, argval=_UNSPECIFIED):
+        """Returns instr if op is found, otherwise throws AssertionError"""
+        for instr in dis.get_instructions(x):
+            if instr.opname == opname:
+                if argval is _UNSPECIFIED or instr.argval == argval:
+                    return instr
+        disassembly = self.get_disassembly_as_string(x)
+        if argval is _UNSPECIFIED:
+            msg = '%s not found in bytecode:\n%s' % (opname, disassembly)
+        else:
+            msg = '(%s,%r) not found in bytecode:\n%s'
+            msg = msg % (opname, argval, disassembly)
+        self.fail(msg)
+
+    def assertNotInBytecode(self, x, opname, argval=_UNSPECIFIED):
+        """Throws AssertionError if op is found"""
+        for instr in dis.get_instructions(x):
+            if instr.opname == opname:
+                disassembly = self.get_disassembly_as_string(co)
+                if opargval is _UNSPECIFIED:
+                    msg = '%s occurs in bytecode:\n%s' % (opname, disassembly)
+                elif instr.argval == argval:
+                    msg = '(%s,%r) occurs in bytecode:\n%s'
+                    msg = msg % (opname, argval, disassembly)
+                self.fail(msg)
diff --git a/Lib/test/coding20731.py b/Lib/test/coding20731.py
index ca4962e..b0e227a 100644
--- a/Lib/test/coding20731.py
+++ b/Lib/test/coding20731.py
@@ -1,4 +1,4 @@
-#coding:latin1
-
-
-
+#coding:latin1

+

+

+

diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py
index ab55476..f42b0f9 100644
--- a/Lib/test/datetimetester.py
+++ b/Lib/test/datetimetester.py
@@ -5,6 +5,7 @@
 
 import sys
 import pickle
+import random
 import unittest
 
 from operator import lt, le, gt, ge, eq, ne, truediv, floordiv, mod
@@ -76,8 +77,18 @@
     def __init__(self, offset=None, name=None, dstoffset=None):
         FixedOffset.__init__(self, offset, name, dstoffset)
 
+class _TZInfo(tzinfo):
+    def utcoffset(self, datetime_module):
+        return random.random()
+
 class TestTZInfo(unittest.TestCase):
 
+    def test_refcnt_crash_bug_22044(self):
+        tz1 = _TZInfo()
+        dt1 = datetime(2014, 7, 21, 11, 32, 3, 0, tz1)
+        with self.assertRaises(TypeError):
+            dt1.utcoffset()
+
     def test_non_abstractness(self):
         # In order to allow subclasses to get pickled, the C implementation
         # wasn't able to get away with having __init__ raise
@@ -619,6 +630,10 @@
         eq(td(hours=-.2/us_per_hour), td(0))
         eq(td(days=-.4/us_per_day, hours=-.2/us_per_hour), td(microseconds=-1))
 
+        # Test for a patch in Issue 8860
+        eq(td(microseconds=0.5), 0.5*td(microseconds=1.0))
+        eq(td(microseconds=0.5)//td.resolution, 0.5*td.resolution//td.resolution)
+
     def test_massive_normalization(self):
         td = timedelta(microseconds=-1)
         self.assertEqual((td.days, td.seconds, td.microseconds),
@@ -1667,11 +1682,12 @@
 
     def test_more_pickling(self):
         a = self.theclass(2003, 2, 7, 16, 48, 37, 444116)
-        s = pickle.dumps(a)
-        b = pickle.loads(s)
-        self.assertEqual(b.year, 2003)
-        self.assertEqual(b.month, 2)
-        self.assertEqual(b.day, 7)
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            s = pickle.dumps(a, proto)
+            b = pickle.loads(s)
+            self.assertEqual(b.year, 2003)
+            self.assertEqual(b.month, 2)
+            self.assertEqual(b.day, 7)
 
     def test_pickling_subclass_datetime(self):
         args = 6, 7, 23, 20, 59, 1, 64**2
diff --git a/Lib/test/final_a.py b/Lib/test/final_a.py
new file mode 100644
index 0000000..390ee88
--- /dev/null
+++ b/Lib/test/final_a.py
@@ -0,0 +1,19 @@
+"""
+Fodder for module finalization tests in test_module.
+"""
+
+import shutil
+import test.final_b
+
+x = 'a'
+
+class C:
+    def __del__(self):
+        # Inspect module globals and builtins
+        print("x =", x)
+        print("final_b.x =", test.final_b.x)
+        print("shutil.rmtree =", getattr(shutil.rmtree, '__name__', None))
+        print("len =", getattr(len, '__name__', None))
+
+c = C()
+_underscored = C()
diff --git a/Lib/test/final_b.py b/Lib/test/final_b.py
new file mode 100644
index 0000000..7228d82
--- /dev/null
+++ b/Lib/test/final_b.py
@@ -0,0 +1,19 @@
+"""
+Fodder for module finalization tests in test_module.
+"""
+
+import shutil
+import test.final_a
+
+x = 'b'
+
+class C:
+    def __del__(self):
+        # Inspect module globals and builtins
+        print("x =", x)
+        print("final_a.x =", test.final_a.x)
+        print("shutil.rmtree =", getattr(shutil.rmtree, '__name__', None))
+        print("len =", getattr(len, '__name__', None))
+
+c = C()
+_underscored = C()
diff --git a/Lib/test/fork_wait.py b/Lib/test/fork_wait.py
index 88527df..19b54ec 100644
--- a/Lib/test/fork_wait.py
+++ b/Lib/test/fork_wait.py
@@ -28,7 +28,7 @@
             self.alive[id] = os.getpid()
             try:
                 time.sleep(SHORTSLEEP)
-            except IOError:
+            except OSError:
                 pass
 
     def wait_impl(self, cpid):
diff --git a/Lib/test/keycert3.pem b/Lib/test/keycert3.pem
new file mode 100644
index 0000000..5bfa62c
--- /dev/null
+++ b/Lib/test/keycert3.pem
@@ -0,0 +1,73 @@
+-----BEGIN PRIVATE KEY-----
+MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAMLgD0kAKDb5cFyP
+jbwNfR5CtewdXC+kMXAWD8DLxiTTvhMW7qVnlwOm36mZlszHKvsRf05lT4pegiFM
+9z2j1OlaN+ci/X7NU22TNN6crYSiN77FjYJP464j876ndSxyD+rzys386T+1r1aZ
+aggEdkj1TsSsv1zWIYKlPIjlvhuxAgMBAAECgYA0aH+T2Vf3WOPv8KdkcJg6gCRe
+yJKXOWgWRcicx/CUzOEsTxmFIDPLxqAWA3k7v0B+3vjGw5Y9lycV/5XqXNoQI14j
+y09iNsumds13u5AKkGdTJnZhQ7UKdoVHfuP44ZdOv/rJ5/VD6F4zWywpe90pcbK+
+AWDVtusgGQBSieEl1QJBAOyVrUG5l2yoUBtd2zr/kiGm/DYyXlIthQO/A3/LngDW
+5/ydGxVsT7lAVOgCsoT+0L4efTh90PjzW8LPQrPBWVMCQQDS3h/FtYYd5lfz+FNL
+9CEe1F1w9l8P749uNUD0g317zv1tatIqVCsQWHfVHNdVvfQ+vSFw38OORO00Xqs9
+1GJrAkBkoXXEkxCZoy4PteheO/8IWWLGGr6L7di6MzFl1lIqwT6D8L9oaV2vynFT
+DnKop0pa09Unhjyw57KMNmSE2SUJAkEArloTEzpgRmCq4IK2/NpCeGdHS5uqRlbh
+1VIa/xGps7EWQl5Mn8swQDel/YP3WGHTjfx7pgSegQfkyaRtGpZ9OQJAa9Vumj8m
+JAAtI0Bnga8hgQx7BhTQY4CadDxyiRGOGYhwUzYVCqkb2sbVRH9HnwUaJT7cWBY3
+RnJdHOMXWem7/w==
+-----END PRIVATE KEY-----
+Certificate:
+    Data:
+        Version: 1 (0x0)
+        Serial Number: 12723342612721443281 (0xb09264b1f2da21d1)
+    Signature Algorithm: sha1WithRSAEncryption
+        Issuer: C=XY, O=Python Software Foundation CA, CN=our-ca-server
+        Validity
+            Not Before: Jan  4 19:47:07 2013 GMT
+            Not After : Nov 13 19:47:07 2022 GMT
+        Subject: C=XY, L=Castle Anthrax, O=Python Software Foundation, CN=localhost
+        Subject Public Key Info:
+            Public Key Algorithm: rsaEncryption
+                Public-Key: (1024 bit)
+                Modulus:
+                    00:c2:e0:0f:49:00:28:36:f9:70:5c:8f:8d:bc:0d:
+                    7d:1e:42:b5:ec:1d:5c:2f:a4:31:70:16:0f:c0:cb:
+                    c6:24:d3:be:13:16:ee:a5:67:97:03:a6:df:a9:99:
+                    96:cc:c7:2a:fb:11:7f:4e:65:4f:8a:5e:82:21:4c:
+                    f7:3d:a3:d4:e9:5a:37:e7:22:fd:7e:cd:53:6d:93:
+                    34:de:9c:ad:84:a2:37:be:c5:8d:82:4f:e3:ae:23:
+                    f3:be:a7:75:2c:72:0f:ea:f3:ca:cd:fc:e9:3f:b5:
+                    af:56:99:6a:08:04:76:48:f5:4e:c4:ac:bf:5c:d6:
+                    21:82:a5:3c:88:e5:be:1b:b1
+                Exponent: 65537 (0x10001)
+    Signature Algorithm: sha1WithRSAEncryption
+         2f:42:5f:a3:09:2c:fa:51:88:c7:37:7f:ea:0e:63:f0:a2:9a:
+         e5:5a:e2:c8:20:f0:3f:60:bc:c8:0f:b6:c6:76:ce:db:83:93:
+         f5:a3:33:67:01:8e:04:cd:00:9a:73:fd:f3:35:86:fa:d7:13:
+         e2:46:c6:9d:c0:29:53:d4:a9:90:b8:77:4b:e6:83:76:e4:92:
+         d6:9c:50:cf:43:d0:c6:01:77:61:9a:de:9b:70:f7:72:cd:59:
+         00:31:69:d9:b4:ca:06:9c:6d:c3:c7:80:8c:68:e6:b5:a2:f8:
+         ef:1d:bb:16:9f:77:77:ef:87:62:22:9b:4d:69:a4:3a:1a:f1:
+         21:5e:8c:32:ac:92:fd:15:6b:18:c2:7f:15:0d:98:30:ca:75:
+         8f:1a:71:df:da:1d:b2:ef:9a:e8:2d:2e:02:fd:4a:3c:aa:96:
+         0b:06:5d:35:b3:3d:24:87:4b:e0:b0:58:60:2f:45:ac:2e:48:
+         8a:b0:99:10:65:27:ff:cc:b1:d8:fd:bd:26:6b:b9:0c:05:2a:
+         f4:45:63:35:51:07:ed:83:85:fe:6f:69:cb:bb:40:a8:ae:b6:
+         3b:56:4a:2d:a4:ed:6d:11:2c:4d:ed:17:24:fd:47:bc:d3:41:
+         a2:d3:06:fe:0c:90:d8:d8:94:26:c4:ff:cc:a1:d8:42:77:eb:
+         fc:a9:94:71
+-----BEGIN CERTIFICATE-----
+MIICpDCCAYwCCQCwkmSx8toh0TANBgkqhkiG9w0BAQUFADBNMQswCQYDVQQGEwJY
+WTEmMCQGA1UECgwdUHl0aG9uIFNvZnR3YXJlIEZvdW5kYXRpb24gQ0ExFjAUBgNV
+BAMMDW91ci1jYS1zZXJ2ZXIwHhcNMTMwMTA0MTk0NzA3WhcNMjIxMTEzMTk0NzA3
+WjBfMQswCQYDVQQGEwJYWTEXMBUGA1UEBxMOQ2FzdGxlIEFudGhyYXgxIzAhBgNV
+BAoTGlB5dGhvbiBTb2Z0d2FyZSBGb3VuZGF0aW9uMRIwEAYDVQQDEwlsb2NhbGhv
+c3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMLgD0kAKDb5cFyPjbwNfR5C
+tewdXC+kMXAWD8DLxiTTvhMW7qVnlwOm36mZlszHKvsRf05lT4pegiFM9z2j1Ola
+N+ci/X7NU22TNN6crYSiN77FjYJP464j876ndSxyD+rzys386T+1r1aZaggEdkj1
+TsSsv1zWIYKlPIjlvhuxAgMBAAEwDQYJKoZIhvcNAQEFBQADggEBAC9CX6MJLPpR
+iMc3f+oOY/CimuVa4sgg8D9gvMgPtsZ2ztuDk/WjM2cBjgTNAJpz/fM1hvrXE+JG
+xp3AKVPUqZC4d0vmg3bkktacUM9D0MYBd2Ga3ptw93LNWQAxadm0ygacbcPHgIxo
+5rWi+O8duxafd3fvh2Iim01ppDoa8SFejDKskv0VaxjCfxUNmDDKdY8acd/aHbLv
+mugtLgL9SjyqlgsGXTWzPSSHS+CwWGAvRawuSIqwmRBlJ//Msdj9vSZruQwFKvRF
+YzVRB+2Dhf5vacu7QKiutjtWSi2k7W0RLE3tFyT9R7zTQaLTBv4MkNjYlCbE/8yh
+2EJ36/yplHE=
+-----END CERTIFICATE-----
diff --git a/Lib/test/keycert4.pem b/Lib/test/keycert4.pem
new file mode 100644
index 0000000..53355c8
--- /dev/null
+++ b/Lib/test/keycert4.pem
@@ -0,0 +1,73 @@
+-----BEGIN PRIVATE KEY-----
+MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAK5UQiMI5VkNs2Qv
+L7gUaiDdFevNUXRjU4DHAe3ZzzYLZNE69h9gO9VCSS16tJ5fT5VEu0EZyGr0e3V2
+NkX0ZoU0Hc/UaY4qx7LHmn5SYZpIxhJnkf7SyHJK1zUaGlU0/LxYqIuGCtF5dqx1
+L2OQhEx1GM6RydHdgX69G64LXcY5AgMBAAECgYAhsRMfJkb9ERLMl/oG/5sLQu9L
+pWDKt6+ZwdxzlZbggQ85CMYshjLKIod2DLL/sLf2x1PRXyRG131M1E3k8zkkz6de
+R1uDrIN/x91iuYzfLQZGh8bMY7Yjd2eoroa6R/7DjpElGejLxOAaDWO0ST2IFQy9
+myTGS2jSM97wcXfsSQJBANP3jelJoS5X6BRjTSneY21wcocxVuQh8pXpErALVNsT
+drrFTeaBuZp7KvbtnIM5g2WRNvaxLZlAY/hXPJvi6ncCQQDSix1cebml6EmPlEZS
+Mm8gwI2F9ufUunwJmBJcz826Do0ZNGByWDAM/JQZH4FX4GfAFNuj8PUb+GQfadkx
+i1DPAkEA0lVsNHojvuDsIo8HGuzarNZQT2beWjJ1jdxh9t7HrTx7LIps6rb/fhOK
+Zs0R6gVAJaEbcWAPZ2tFyECInAdnsQJAUjaeXXjuxFkjOFym5PvqpvhpivEx78Bu
+JPTr3rAKXmfGMxxfuOa0xK1wSyshP6ZR/RBn/+lcXPKubhHQDOegwwJAJF1DBQnN
++/tLmOPULtDwfP4Zixn+/8GmGOahFoRcu6VIGHmRilJTn6MOButw7Glv2YdeC6l/
+e83Gq6ffLVfKNQ==
+-----END PRIVATE KEY-----
+Certificate:
+    Data:
+        Version: 1 (0x0)
+        Serial Number: 12723342612721443282 (0xb09264b1f2da21d2)
+    Signature Algorithm: sha1WithRSAEncryption
+        Issuer: C=XY, O=Python Software Foundation CA, CN=our-ca-server
+        Validity
+            Not Before: Jan  4 19:47:07 2013 GMT
+            Not After : Nov 13 19:47:07 2022 GMT
+        Subject: C=XY, L=Castle Anthrax, O=Python Software Foundation, CN=fakehostname
+        Subject Public Key Info:
+            Public Key Algorithm: rsaEncryption
+                Public-Key: (1024 bit)
+                Modulus:
+                    00:ae:54:42:23:08:e5:59:0d:b3:64:2f:2f:b8:14:
+                    6a:20:dd:15:eb:cd:51:74:63:53:80:c7:01:ed:d9:
+                    cf:36:0b:64:d1:3a:f6:1f:60:3b:d5:42:49:2d:7a:
+                    b4:9e:5f:4f:95:44:bb:41:19:c8:6a:f4:7b:75:76:
+                    36:45:f4:66:85:34:1d:cf:d4:69:8e:2a:c7:b2:c7:
+                    9a:7e:52:61:9a:48:c6:12:67:91:fe:d2:c8:72:4a:
+                    d7:35:1a:1a:55:34:fc:bc:58:a8:8b:86:0a:d1:79:
+                    76:ac:75:2f:63:90:84:4c:75:18:ce:91:c9:d1:dd:
+                    81:7e:bd:1b:ae:0b:5d:c6:39
+                Exponent: 65537 (0x10001)
+    Signature Algorithm: sha1WithRSAEncryption
+         ad:45:8a:8e:ef:c6:ef:04:41:5c:2c:4a:84:dc:02:76:0c:d0:
+         66:0f:f0:16:04:58:4d:fd:68:b7:b8:d3:a8:41:a5:5c:3c:6f:
+         65:3c:d1:f8:ce:43:35:e7:41:5f:53:3d:c9:2c:c3:7d:fc:56:
+         4a:fa:47:77:38:9d:bb:97:28:0a:3b:91:19:7f:bc:74:ae:15:
+         6b:bd:20:36:67:45:a5:1e:79:d7:75:e6:89:5c:6d:54:84:d1:
+         95:d7:a7:b4:33:3c:af:37:c4:79:8f:5e:75:dc:75:c2:18:fb:
+         61:6f:2d:dc:38:65:5b:ba:67:28:d0:88:d7:8d:b9:23:5a:8e:
+         e8:c6:bb:db:ce:d5:b8:41:2a:ce:93:08:b6:95:ad:34:20:18:
+         d5:3b:37:52:74:50:0b:07:2c:b0:6d:a4:4c:7b:f4:e0:fd:d1:
+         af:17:aa:20:cd:62:e3:f0:9d:37:69:db:41:bd:d4:1c:fb:53:
+         20:da:88:9d:76:26:67:ce:01:90:a7:80:1d:a9:5b:39:73:68:
+         54:0a:d1:2a:03:1b:8f:3c:43:5d:5d:c4:51:f1:a7:e7:11:da:
+         31:2c:49:06:af:04:f4:b8:3c:99:c4:20:b9:06:36:a2:00:92:
+         61:1d:0c:6d:24:05:e2:82:e1:47:db:a0:5f:ba:b9:fb:ba:fa:
+         49:12:1e:ce
+-----BEGIN CERTIFICATE-----
+MIICpzCCAY8CCQCwkmSx8toh0jANBgkqhkiG9w0BAQUFADBNMQswCQYDVQQGEwJY
+WTEmMCQGA1UECgwdUHl0aG9uIFNvZnR3YXJlIEZvdW5kYXRpb24gQ0ExFjAUBgNV
+BAMMDW91ci1jYS1zZXJ2ZXIwHhcNMTMwMTA0MTk0NzA3WhcNMjIxMTEzMTk0NzA3
+WjBiMQswCQYDVQQGEwJYWTEXMBUGA1UEBxMOQ2FzdGxlIEFudGhyYXgxIzAhBgNV
+BAoTGlB5dGhvbiBTb2Z0d2FyZSBGb3VuZGF0aW9uMRUwEwYDVQQDEwxmYWtlaG9z
+dG5hbWUwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAK5UQiMI5VkNs2QvL7gU
+aiDdFevNUXRjU4DHAe3ZzzYLZNE69h9gO9VCSS16tJ5fT5VEu0EZyGr0e3V2NkX0
+ZoU0Hc/UaY4qx7LHmn5SYZpIxhJnkf7SyHJK1zUaGlU0/LxYqIuGCtF5dqx1L2OQ
+hEx1GM6RydHdgX69G64LXcY5AgMBAAEwDQYJKoZIhvcNAQEFBQADggEBAK1Fio7v
+xu8EQVwsSoTcAnYM0GYP8BYEWE39aLe406hBpVw8b2U80fjOQzXnQV9TPcksw338
+Vkr6R3c4nbuXKAo7kRl/vHSuFWu9IDZnRaUeedd15olcbVSE0ZXXp7QzPK83xHmP
+XnXcdcIY+2FvLdw4ZVu6ZyjQiNeNuSNajujGu9vO1bhBKs6TCLaVrTQgGNU7N1J0
+UAsHLLBtpEx79OD90a8XqiDNYuPwnTdp20G91Bz7UyDaiJ12JmfOAZCngB2pWzlz
+aFQK0SoDG488Q11dxFHxp+cR2jEsSQavBPS4PJnEILkGNqIAkmEdDG0kBeKC4Ufb
+oF+6ufu6+kkSHs4=
+-----END CERTIFICATE-----
diff --git a/Lib/test/leakers/test_gestalt.py b/Lib/test/leakers/test_gestalt.py
deleted file mode 100644
index e0081c1..0000000
--- a/Lib/test/leakers/test_gestalt.py
+++ /dev/null
@@ -1,14 +0,0 @@
-import sys
-
-if sys.platform != 'darwin':
-    raise ValueError("This test only leaks on Mac OS X")
-
-def leak():
-    # taken from platform._mac_ver_lookup()
-    from gestalt import gestalt
-    import MacOS
-
-    try:
-        gestalt('sysu')
-    except MacOS.Error:
-        pass
diff --git a/Lib/test/lock_tests.py b/Lib/test/lock_tests.py
index bfbf44e..1cbcea2 100644
--- a/Lib/test/lock_tests.py
+++ b/Lib/test/lock_tests.py
@@ -80,6 +80,11 @@
         lock = self.locktype()
         del lock
 
+    def test_repr(self):
+        lock = self.locktype()
+        repr(lock)
+        del lock
+
     def test_acquire_destroy(self):
         lock = self.locktype()
         lock.acquire()
@@ -413,6 +418,17 @@
         self.assertRaises(RuntimeError, cond.notify)
 
     def _check_notify(self, cond):
+        # Note that this test is sensitive to timing.  If the worker threads
+        # don't execute in a timely fashion, the main thread may think they
+        # are further along then they are.  The main thread therefore issues
+        # _wait() statements to try to make sure that it doesn't race ahead
+        # of the workers.
+        # Secondly, this test assumes that condition variables are not subject
+        # to spurious wakeups.  The absence of spurious wakeups is an implementation
+        # detail of Condition Cariables in current CPython, but in general, not
+        # a guaranteed property of condition variables as a programming
+        # construct.  In particular, it is possible that this can no longer
+        # be conveniently guaranteed should their implementation ever change.
         N = 5
         results1 = []
         results2 = []
@@ -440,6 +456,9 @@
             _wait()
         self.assertEqual(results1, [(True, 1)] * 3)
         self.assertEqual(results2, [])
+        # first wait, to ensure all workers settle into cond.wait() before
+        # we continue. See issue #8799
+        _wait()
         # Notify 5 threads: they might be in their first or second wait
         cond.acquire()
         cond.notify(5)
@@ -450,6 +469,7 @@
             _wait()
         self.assertEqual(results1, [(True, 1)] * 3 + [(True, 2)] * 2)
         self.assertEqual(results2, [(True, 2)] * 3)
+        _wait() # make sure all workers settle into cond.wait()
         # Notify all threads: they are all in their second wait
         cond.acquire()
         cond.notify_all()
diff --git a/Lib/test/make_ssl_certs.py b/Lib/test/make_ssl_certs.py
index 48d2e57..81d04f8 100644
--- a/Lib/test/make_ssl_certs.py
+++ b/Lib/test/make_ssl_certs.py
@@ -2,6 +2,7 @@
 and friends."""
 
 import os
+import shutil
 import sys
 import tempfile
 from subprocess import *
@@ -20,11 +21,54 @@
 
     [req_x509_extensions]
     subjectAltName         = DNS:{hostname}
+
+    [ ca ]
+    default_ca      = CA_default
+
+    [ CA_default ]
+    dir = cadir
+    database  = $dir/index.txt
+    crlnumber = $dir/crl.txt
+    default_md = sha1
+    default_days = 3600
+    default_crl_days = 3600
+    certificate = pycacert.pem
+    private_key = pycakey.pem
+    serial    = $dir/serial
+    RANDFILE  = $dir/.rand
+
+    policy          = policy_match
+
+    [ policy_match ]
+    countryName             = match
+    stateOrProvinceName     = optional
+    organizationName        = match
+    organizationalUnitName  = optional
+    commonName              = supplied
+    emailAddress            = optional
+
+    [ policy_anything ]
+    countryName   = optional
+    stateOrProvinceName = optional
+    localityName    = optional
+    organizationName  = optional
+    organizationalUnitName  = optional
+    commonName    = supplied
+    emailAddress    = optional
+
+
+    [ v3_ca ]
+
+    subjectKeyIdentifier=hash
+    authorityKeyIdentifier=keyid:always,issuer
+    basicConstraints = CA:true
+
     """
 
 here = os.path.abspath(os.path.dirname(__file__))
 
-def make_cert_key(hostname):
+def make_cert_key(hostname, sign=False):
+    print("creating cert for " + hostname)
     tempnames = []
     for i in range(3):
         with tempfile.NamedTemporaryFile(delete=False) as f:
@@ -33,10 +77,25 @@
     try:
         with open(req_file, 'w') as f:
             f.write(req_template.format(hostname=hostname))
-        args = ['req', '-new', '-days', '3650', '-nodes', '-x509',
+        args = ['req', '-new', '-days', '3650', '-nodes',
                 '-newkey', 'rsa:1024', '-keyout', key_file,
-                '-out', cert_file, '-config', req_file]
+                '-config', req_file]
+        if sign:
+            with tempfile.NamedTemporaryFile(delete=False) as f:
+                tempnames.append(f.name)
+                reqfile = f.name
+            args += ['-out', reqfile ]
+
+        else:
+            args += ['-x509', '-out', cert_file ]
         check_call(['openssl'] + args)
+
+        if sign:
+            args = ['ca', '-config', req_file, '-out', cert_file, '-outdir', 'cadir',
+                    '-policy', 'policy_anything', '-batch', '-infiles', reqfile ]
+            check_call(['openssl'] + args)
+
+
         with open(cert_file, 'r') as f:
             cert = f.read()
         with open(key_file, 'r') as f:
@@ -46,6 +105,36 @@
         for name in tempnames:
             os.remove(name)
 
+TMP_CADIR = 'cadir'
+
+def unmake_ca():
+    shutil.rmtree(TMP_CADIR)
+
+def make_ca():
+    os.mkdir(TMP_CADIR)
+    with open(os.path.join('cadir','index.txt'),'a+') as f:
+        pass # empty file
+    with open(os.path.join('cadir','crl.txt'),'a+') as f:
+        f.write("00")
+    with open(os.path.join('cadir','index.txt.attr'),'w+') as f:
+        f.write('unique_subject = no')
+
+    with tempfile.NamedTemporaryFile("w") as t:
+        t.write(req_template.format(hostname='our-ca-server'))
+        t.flush()
+        with tempfile.NamedTemporaryFile() as f:
+            args = ['req', '-new', '-days', '3650', '-extensions', 'v3_ca', '-nodes',
+                    '-newkey', 'rsa:2048', '-keyout', 'pycakey.pem',
+                    '-out', f.name,
+                    '-subj', '/C=XY/L=Castle Anthrax/O=Python Software Foundation CA/CN=our-ca-server']
+            check_call(['openssl'] + args)
+            args = ['ca', '-config', t.name, '-create_serial',
+                    '-out', 'pycacert.pem', '-batch', '-outdir', TMP_CADIR,
+                    '-keyfile', 'pycakey.pem', '-days', '3650',
+                    '-selfsign', '-extensions', 'v3_ca', '-infiles', f.name ]
+            check_call(['openssl'] + args)
+            args = ['ca', '-config', t.name, '-gencrl', '-out', 'revocation.crl']
+            check_call(['openssl'] + args)
 
 if __name__ == '__main__':
     os.chdir(here)
@@ -54,11 +143,34 @@
         f.write(cert)
     with open('ssl_key.pem', 'w') as f:
         f.write(key)
+    print("password protecting ssl_key.pem in ssl_key.passwd.pem")
+    check_call(['openssl','rsa','-in','ssl_key.pem','-out','ssl_key.passwd.pem','-des3','-passout','pass:somepass'])
+    check_call(['openssl','rsa','-in','ssl_key.pem','-out','keycert.passwd.pem','-des3','-passout','pass:somepass'])
+
     with open('keycert.pem', 'w') as f:
         f.write(key)
         f.write(cert)
+
+    with open('keycert.passwd.pem', 'a+') as f:
+        f.write(cert)
+
     # For certificate matching tests
+    make_ca()
     cert, key = make_cert_key('fakehostname')
     with open('keycert2.pem', 'w') as f:
         f.write(key)
         f.write(cert)
+
+    cert, key = make_cert_key('localhost', True)
+    with open('keycert3.pem', 'w') as f:
+        f.write(key)
+        f.write(cert)
+
+    cert, key = make_cert_key('fakehostname', True)
+    with open('keycert4.pem', 'w') as f:
+        f.write(key)
+        f.write(cert)
+
+    unmake_ca()
+    print("\n\nPlease change the values in test_ssl.py, test_parse_cert function related to notAfter,notBefore and serialNumber")
+    check_call(['openssl','x509','-in','keycert.pem','-dates','-serial','-noout'])
diff --git a/Lib/test/mock_socket.py b/Lib/test/mock_socket.py
index 861bfb2..e36724f 100644
--- a/Lib/test/mock_socket.py
+++ b/Lib/test/mock_socket.py
@@ -145,12 +145,8 @@
     return ""
 
 
-class gaierror(Exception):
-    pass
-
-
-class error(Exception):
-    pass
+gaierror = socket_module.gaierror
+error = socket_module.error
 
 
 # Constants
diff --git a/Lib/test/mp_fork_bomb.py b/Lib/test/mp_fork_bomb.py
index 908afe3..017e010 100644
--- a/Lib/test/mp_fork_bomb.py
+++ b/Lib/test/mp_fork_bomb.py
@@ -7,6 +7,11 @@
 # correctly on Windows.  However, we should get a RuntimeError rather
 # than the Windows equivalent of a fork bomb.
 
+if len(sys.argv) > 1:
+    multiprocessing.set_start_method(sys.argv[1])
+else:
+    multiprocessing.set_start_method('spawn')
+
 p = multiprocessing.Process(target=foo)
 p.start()
 p.join()
diff --git a/Lib/test/multibytecodec_support.py b/Lib/test/multibytecodec_support.py
index 14fea3e..bc1cfc8 100644
--- a/Lib/test/multibytecodec_support.py
+++ b/Lib/test/multibytecodec_support.py
@@ -21,7 +21,7 @@
     roundtriptest   = 1    # set if roundtrip is possible with unicode
     has_iso10646    = 0    # set if this encoding contains whole iso10646 map
     xmlcharnametest = None # string to test xmlcharrefreplace
-    unmappedunicode = '\udeee' # a unicode codepoint that is not mapped.
+    unmappedunicode = '\udeee' # a unicode code point that is not mapped.
 
     def setUp(self):
         if self.codec is None:
@@ -277,11 +277,10 @@
     supmaps = []
     codectests = []
 
-    def __init__(self, *args, **kw):
-        unittest.TestCase.__init__(self, *args, **kw)
+    def setUp(self):
         try:
             self.open_mapping_file().close() # test it to report the error early
-        except (IOError, HTTPException):
+        except (OSError, HTTPException):
             self.skipTest("Could not retrieve "+self.mapfileurl)
 
     def open_mapping_file(self):
diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py
index 4d59bde..bdc7bad 100644
--- a/Lib/test/pickletester.py
+++ b/Lib/test/pickletester.py
@@ -1,9 +1,11 @@
+import copyreg
 import io
-import unittest
 import pickle
 import pickletools
+import random
+import struct
 import sys
-import copyreg
+import unittest
 import weakref
 from http.cookies import SimpleCookie
 
@@ -93,6 +95,9 @@
     def __getinitargs__(self):
         return ()
 
+class H(object):
+    pass
+
 import __main__
 __main__.C = C
 C.__module__ = "__main__"
@@ -100,6 +105,8 @@
 D.__module__ = "__main__"
 __main__.E = E
 E.__module__ = "__main__"
+__main__.H = H
+H.__module__ = "__main__"
 
 class myint(int):
     def __init__(self, x):
@@ -491,31 +498,52 @@
     x.append(5)
     return x
 
+
 class AbstractPickleTests(unittest.TestCase):
     # Subclass must define self.dumps, self.loads.
 
+    optimized = False
+
     _testdata = create_data()
 
     def setUp(self):
         pass
 
+    def assert_is_copy(self, obj, objcopy, msg=None):
+        """Utility method to verify if two objects are copies of each others.
+        """
+        if msg is None:
+            msg = "{!r} is not a copy of {!r}".format(obj, objcopy)
+        self.assertEqual(obj, objcopy, msg=msg)
+        self.assertIs(type(obj), type(objcopy), msg=msg)
+        if hasattr(obj, '__dict__'):
+            self.assertDictEqual(obj.__dict__, objcopy.__dict__, msg=msg)
+            self.assertIsNot(obj.__dict__, objcopy.__dict__, msg=msg)
+        if hasattr(obj, '__slots__'):
+            self.assertListEqual(obj.__slots__, objcopy.__slots__, msg=msg)
+            for slot in obj.__slots__:
+                self.assertEqual(
+                    hasattr(obj, slot), hasattr(objcopy, slot), msg=msg)
+                self.assertEqual(getattr(obj, slot, None),
+                                 getattr(objcopy, slot, None), msg=msg)
+
     def test_misc(self):
         # test various datatypes not tested by testdata
         for proto in protocols:
             x = myint(4)
             s = self.dumps(x, proto)
             y = self.loads(s)
-            self.assertEqual(x, y)
+            self.assert_is_copy(x, y)
 
             x = (1, ())
             s = self.dumps(x, proto)
             y = self.loads(s)
-            self.assertEqual(x, y)
+            self.assert_is_copy(x, y)
 
             x = initarg(1, x)
             s = self.dumps(x, proto)
             y = self.loads(s)
-            self.assertEqual(x, y)
+            self.assert_is_copy(x, y)
 
         # XXX test __reduce__ protocol?
 
@@ -524,16 +552,16 @@
         for proto in protocols:
             s = self.dumps(expected, proto)
             got = self.loads(s)
-            self.assertEqual(expected, got)
+            self.assert_is_copy(expected, got)
 
     def test_load_from_data0(self):
-        self.assertEqual(self._testdata, self.loads(DATA0))
+        self.assert_is_copy(self._testdata, self.loads(DATA0))
 
     def test_load_from_data1(self):
-        self.assertEqual(self._testdata, self.loads(DATA1))
+        self.assert_is_copy(self._testdata, self.loads(DATA1))
 
     def test_load_from_data2(self):
-        self.assertEqual(self._testdata, self.loads(DATA2))
+        self.assert_is_copy(self._testdata, self.loads(DATA2))
 
     def test_load_classic_instance(self):
         # See issue5180.  Test loading 2.x pickles that
@@ -555,7 +583,7 @@
                        b"X\n"
                        b"p0\n"
                        b"(dp1\nb.").replace(b'X', xname)
-            self.assertEqual(X(*args), self.loads(pickle0))
+            self.assert_is_copy(X(*args), self.loads(pickle0))
 
             # Protocol 1 (binary mode pickle)
             """
@@ -572,7 +600,7 @@
             pickle1 = (b'(c__main__\n'
                        b'X\n'
                        b'q\x00oq\x01}q\x02b.').replace(b'X', xname)
-            self.assertEqual(X(*args), self.loads(pickle1))
+            self.assert_is_copy(X(*args), self.loads(pickle1))
 
             # Protocol 2 (pickle2 = b'\x80\x02' + pickle1)
             """
@@ -590,7 +618,7 @@
             pickle2 = (b'\x80\x02(c__main__\n'
                        b'X\n'
                        b'q\x00oq\x01}q\x02b.').replace(b'X', xname)
-            self.assertEqual(X(*args), self.loads(pickle2))
+            self.assert_is_copy(X(*args), self.loads(pickle2))
 
     # There are gratuitous differences between pickles produced by
     # pickle and cPickle, largely because cPickle starts PUT indices at
@@ -615,6 +643,7 @@
         for proto in protocols:
             s = self.dumps(l, proto)
             x = self.loads(s)
+            self.assertIsInstance(x, list)
             self.assertEqual(len(x), 1)
             self.assertTrue(x is x[0])
 
@@ -624,6 +653,7 @@
         for proto in protocols:
             s = self.dumps(t, proto)
             x = self.loads(s)
+            self.assertIsInstance(x, tuple)
             self.assertEqual(len(x), 1)
             self.assertEqual(len(x[0]), 1)
             self.assertTrue(x is x[0][0])
@@ -634,15 +664,39 @@
         for proto in protocols:
             s = self.dumps(d, proto)
             x = self.loads(s)
+            self.assertIsInstance(x, dict)
             self.assertEqual(list(x.keys()), [1])
             self.assertTrue(x[1] is x)
 
+    def test_recursive_set(self):
+        h = H()
+        y = set({h})
+        h.attr = y
+        for proto in protocols:
+            s = self.dumps(y, proto)
+            x = self.loads(s)
+            self.assertIsInstance(x, set)
+            self.assertIs(list(x)[0].attr, x)
+            self.assertEqual(len(x), 1)
+
+    def test_recursive_frozenset(self):
+        h = H()
+        y = frozenset({h})
+        h.attr = y
+        for proto in protocols:
+            s = self.dumps(y, proto)
+            x = self.loads(s)
+            self.assertIsInstance(x, frozenset)
+            self.assertIs(list(x)[0].attr, x)
+            self.assertEqual(len(x), 1)
+
     def test_recursive_inst(self):
         i = C()
         i.attr = i
         for proto in protocols:
             s = self.dumps(i, proto)
             x = self.loads(s)
+            self.assertIsInstance(x, C)
             self.assertEqual(dir(x), dir(i))
             self.assertIs(x.attr, x)
 
@@ -655,6 +709,7 @@
         for proto in protocols:
             s = self.dumps(l, proto)
             x = self.loads(s)
+            self.assertIsInstance(x, list)
             self.assertEqual(len(x), 1)
             self.assertEqual(dir(x[0]), dir(i))
             self.assertEqual(list(x[0].attr.keys()), [1])
@@ -662,31 +717,8 @@
 
     def test_get(self):
         self.assertRaises(KeyError, self.loads, b'g0\np0')
-        self.assertEqual(self.loads(b'((Kdtp0\nh\x00l.))'), [(100,), (100,)])
-
-    def test_insecure_strings(self):
-        # XXX Some of these tests are temporarily disabled
-        insecure = [b"abc", b"2 + 2", # not quoted
-                    ## b"'abc' + 'def'", # not a single quoted string
-                    b"'abc", # quote is not closed
-                    b"'abc\"", # open quote and close quote don't match
-                    b"'abc'   ?", # junk after close quote
-                    b"'\\'", # trailing backslash
-                    # Variations on issue #17710
-                    b"'",
-                    b'"',
-                    b"' ",
-                    b"'  ",
-                    b"'   ",
-                    b"'    ",
-                    b'"    ',
-                    # some tests of the quoting rules
-                    ## b"'abc\"\''",
-                    ## b"'\\\\a\'\'\'\\\'\\\\\''",
-                    ]
-        for b in insecure:
-            buf = b"S" + b + b"\012p0\012."
-            self.assertRaises(ValueError, self.loads, buf)
+        self.assert_is_copy([(100,), (100,)],
+                            self.loads(b'((Kdtp0\nh\x00l.))'))
 
     def test_unicode(self):
         endcases = ['', '<\\u>', '<\\\u1234>', '<\n>',
@@ -697,26 +729,26 @@
             for u in endcases:
                 p = self.dumps(u, proto)
                 u2 = self.loads(p)
-                self.assertEqual(u2, u)
+                self.assert_is_copy(u, u2)
 
     def test_unicode_high_plane(self):
         t = '\U00012345'
         for proto in protocols:
             p = self.dumps(t, proto)
             t2 = self.loads(p)
-            self.assertEqual(t2, t)
+            self.assert_is_copy(t, t2)
 
     def test_bytes(self):
         for proto in protocols:
             for s in b'', b'xyz', b'xyz'*100:
                 p = self.dumps(s, proto)
-                self.assertEqual(self.loads(p), s)
+                self.assert_is_copy(s, self.loads(p))
             for s in [bytes([i]) for i in range(256)]:
                 p = self.dumps(s, proto)
-                self.assertEqual(self.loads(p), s)
+                self.assert_is_copy(s, self.loads(p))
             for s in [bytes([i, i]) for i in range(256)]:
                 p = self.dumps(s, proto)
-                self.assertEqual(self.loads(p), s)
+                self.assert_is_copy(s, self.loads(p))
 
     def test_ints(self):
         import sys
@@ -726,14 +758,14 @@
                 for expected in (-n, n):
                     s = self.dumps(expected, proto)
                     n2 = self.loads(s)
-                    self.assertEqual(expected, n2)
+                    self.assert_is_copy(expected, n2)
                 n = n >> 1
 
     def test_maxint64(self):
         maxint64 = (1 << 63) - 1
         data = b'I' + str(maxint64).encode("ascii") + b'\n.'
         got = self.loads(data)
-        self.assertEqual(got, maxint64)
+        self.assert_is_copy(maxint64, got)
 
         # Try too with a bogus literal.
         data = b'I' + str(maxint64).encode("ascii") + b'JUNK\n.'
@@ -748,7 +780,7 @@
                     for n in npos, -npos:
                         pickle = self.dumps(n, proto)
                         got = self.loads(pickle)
-                        self.assertEqual(n, got)
+                        self.assert_is_copy(n, got)
         # Try a monster.  This is quadratic-time in protos 0 & 1, so don't
         # bother with those.
         nbase = int("deadbeeffeedface", 16)
@@ -756,6 +788,10 @@
         for n in nbase, -nbase:
             p = self.dumps(n, 2)
             got = self.loads(p)
+            # assert_is_copy is very expensive here as it precomputes
+            # a failure message by computing the repr() of n and got,
+            # we just do the check ourselves.
+            self.assertIs(type(got), int)
             self.assertEqual(n, got)
 
     def test_float(self):
@@ -766,7 +802,7 @@
             for value in test_values:
                 pickle = self.dumps(value, proto)
                 got = self.loads(pickle)
-                self.assertEqual(value, got)
+                self.assert_is_copy(value, got)
 
     @run_with_locale('LC_ALL', 'de_DE', 'fr_FR')
     def test_float_format(self):
@@ -774,10 +810,18 @@
         self.assertEqual(self.dumps(1.2, 0)[0:3], b'F1.')
 
     def test_reduce(self):
-        pass
+        for proto in protocols:
+            inst = AAA()
+            dumped = self.dumps(inst, proto)
+            loaded = self.loads(dumped)
+            self.assertEqual(loaded, REDUCE_A)
 
     def test_getinitargs(self):
-        pass
+        for proto in protocols:
+            inst = initarg(1, 2)
+            dumped = self.dumps(inst, proto)
+            loaded = self.loads(dumped)
+            self.assert_is_copy(inst, loaded)
 
     def test_pop_empty_stack(self):
         # Test issue7455
@@ -798,6 +842,7 @@
             s = self.dumps(a, proto)
             b = self.loads(s)
             self.assertEqual(a, b)
+            self.assertIs(type(a), type(b))
 
     def test_structseq(self):
         import time
@@ -807,29 +852,29 @@
         for proto in protocols:
             s = self.dumps(t, proto)
             u = self.loads(s)
-            self.assertEqual(t, u)
+            self.assert_is_copy(t, u)
             if hasattr(os, "stat"):
                 t = os.stat(os.curdir)
                 s = self.dumps(t, proto)
                 u = self.loads(s)
-                self.assertEqual(t, u)
+                self.assert_is_copy(t, u)
             if hasattr(os, "statvfs"):
                 t = os.statvfs(os.curdir)
                 s = self.dumps(t, proto)
                 u = self.loads(s)
-                self.assertEqual(t, u)
+                self.assert_is_copy(t, u)
 
     def test_ellipsis(self):
         for proto in protocols:
             s = self.dumps(..., proto)
             u = self.loads(s)
-            self.assertEqual(..., u)
+            self.assertIs(..., u)
 
     def test_notimplemented(self):
         for proto in protocols:
             s = self.dumps(NotImplemented, proto)
             u = self.loads(s)
-            self.assertEqual(NotImplemented, u)
+            self.assertIs(NotImplemented, u)
 
     def test_singleton_types(self):
         # Issue #6477: Test that types of built-in singletons can be pickled.
@@ -843,21 +888,21 @@
     # Tests for protocol 2
 
     def test_proto(self):
-        build_none = pickle.NONE + pickle.STOP
         for proto in protocols:
-            expected = build_none
+            pickled = self.dumps(None, proto)
             if proto >= 2:
-                expected = pickle.PROTO + bytes([proto]) + expected
-            p = self.dumps(None, proto)
-            self.assertEqual(p, expected)
+                proto_header = pickle.PROTO + bytes([proto])
+                self.assertTrue(pickled.startswith(proto_header))
+            else:
+                self.assertEqual(count_opcode(pickle.PROTO, pickled), 0)
 
         oob = protocols[-1] + 1     # a future protocol
+        build_none = pickle.NONE + pickle.STOP
         badpickle = pickle.PROTO + bytes([oob]) + build_none
         try:
             self.loads(badpickle)
-        except ValueError as detail:
-            self.assertTrue(str(detail).startswith(
-                                            "unsupported pickle protocol"))
+        except ValueError as err:
+            self.assertIn("unsupported pickle protocol", str(err))
         else:
             self.fail("expected bad protocol number to raise ValueError")
 
@@ -866,7 +911,7 @@
         for proto in protocols:
             s = self.dumps(x, proto)
             y = self.loads(s)
-            self.assertEqual(x, y)
+            self.assert_is_copy(x, y)
             self.assertEqual(opcode_in_pickle(pickle.LONG1, s), proto >= 2)
 
     def test_long4(self):
@@ -874,7 +919,7 @@
         for proto in protocols:
             s = self.dumps(x, proto)
             y = self.loads(s)
-            self.assertEqual(x, y)
+            self.assert_is_copy(x, y)
             self.assertEqual(opcode_in_pickle(pickle.LONG4, s), proto >= 2)
 
     def test_short_tuples(self):
@@ -912,9 +957,9 @@
             for x in a, b, c, d, e:
                 s = self.dumps(x, proto)
                 y = self.loads(s)
-                self.assertEqual(x, y, (proto, x, s, y))
-                expected = expected_opcode[proto, len(x)]
-                self.assertEqual(opcode_in_pickle(expected, s), True)
+                self.assert_is_copy(x, y)
+                expected = expected_opcode[min(proto, 3), len(x)]
+                self.assertTrue(opcode_in_pickle(expected, s))
 
     def test_singletons(self):
         # Map (proto, singleton) to expected opcode.
@@ -938,8 +983,8 @@
                 s = self.dumps(x, proto)
                 y = self.loads(s)
                 self.assertTrue(x is y, (proto, x, s, y))
-                expected = expected_opcode[proto, x]
-                self.assertEqual(opcode_in_pickle(expected, s), True)
+                expected = expected_opcode[min(proto, 3), x]
+                self.assertTrue(opcode_in_pickle(expected, s))
 
     def test_newobj_tuple(self):
         x = MyTuple([1, 2, 3])
@@ -948,8 +993,7 @@
         for proto in protocols:
             s = self.dumps(x, proto)
             y = self.loads(s)
-            self.assertEqual(tuple(x), tuple(y))
-            self.assertEqual(x.__dict__, y.__dict__)
+            self.assert_is_copy(x, y)
 
     def test_newobj_list(self):
         x = MyList([1, 2, 3])
@@ -958,8 +1002,7 @@
         for proto in protocols:
             s = self.dumps(x, proto)
             y = self.loads(s)
-            self.assertEqual(list(x), list(y))
-            self.assertEqual(x.__dict__, y.__dict__)
+            self.assert_is_copy(x, y)
 
     def test_newobj_generic(self):
         for proto in protocols:
@@ -970,6 +1013,7 @@
                 s = self.dumps(x, proto)
                 y = self.loads(s)
                 detail = (proto, C, B, x, y, type(y))
+                self.assert_is_copy(x, y) # XXX revisit
                 self.assertEqual(B(x), B(y), detail)
                 self.assertEqual(x.__dict__, y.__dict__, detail)
 
@@ -1008,11 +1052,10 @@
             s1 = self.dumps(x, 1)
             self.assertIn(__name__.encode("utf-8"), s1)
             self.assertIn(b"MyList", s1)
-            self.assertEqual(opcode_in_pickle(opcode, s1), False)
+            self.assertFalse(opcode_in_pickle(opcode, s1))
 
             y = self.loads(s1)
-            self.assertEqual(list(x), list(y))
-            self.assertEqual(x.__dict__, y.__dict__)
+            self.assert_is_copy(x, y)
 
             # Dump using protocol 2 for test.
             s2 = self.dumps(x, 2)
@@ -1021,9 +1064,7 @@
             self.assertEqual(opcode_in_pickle(opcode, s2), True, repr(s2))
 
             y = self.loads(s2)
-            self.assertEqual(list(x), list(y))
-            self.assertEqual(x.__dict__, y.__dict__)
-
+            self.assert_is_copy(x, y)
         finally:
             e.restore()
 
@@ -1047,7 +1088,7 @@
         for proto in protocols:
             s = self.dumps(x, proto)
             y = self.loads(s)
-            self.assertEqual(x, y)
+            self.assert_is_copy(x, y)
             num_appends = count_opcode(pickle.APPENDS, s)
             self.assertEqual(num_appends, proto > 0)
 
@@ -1056,7 +1097,7 @@
         for proto in protocols:
             s = self.dumps(x, proto)
             y = self.loads(s)
-            self.assertEqual(x, y)
+            self.assert_is_copy(x, y)
             num_appends = count_opcode(pickle.APPENDS, s)
             if proto == 0:
                 self.assertEqual(num_appends, 0)
@@ -1070,7 +1111,7 @@
             s = self.dumps(x, proto)
             self.assertIsInstance(s, bytes_types)
             y = self.loads(s)
-            self.assertEqual(x, y)
+            self.assert_is_copy(x, y)
             num_setitems = count_opcode(pickle.SETITEMS, s)
             self.assertEqual(num_setitems, proto > 0)
 
@@ -1079,22 +1120,49 @@
         for proto in protocols:
             s = self.dumps(x, proto)
             y = self.loads(s)
-            self.assertEqual(x, y)
+            self.assert_is_copy(x, y)
             num_setitems = count_opcode(pickle.SETITEMS, s)
             if proto == 0:
                 self.assertEqual(num_setitems, 0)
             else:
                 self.assertTrue(num_setitems >= 2)
 
+    def test_set_chunking(self):
+        n = 10  # too small to chunk
+        x = set(range(n))
+        for proto in protocols:
+            s = self.dumps(x, proto)
+            y = self.loads(s)
+            self.assert_is_copy(x, y)
+            num_additems = count_opcode(pickle.ADDITEMS, s)
+            if proto < 4:
+                self.assertEqual(num_additems, 0)
+            else:
+                self.assertEqual(num_additems, 1)
+
+        n = 2500  # expect at least two chunks when proto >= 4
+        x = set(range(n))
+        for proto in protocols:
+            s = self.dumps(x, proto)
+            y = self.loads(s)
+            self.assert_is_copy(x, y)
+            num_additems = count_opcode(pickle.ADDITEMS, s)
+            if proto < 4:
+                self.assertEqual(num_additems, 0)
+            else:
+                self.assertGreaterEqual(num_additems, 2)
+
     def test_simple_newobj(self):
         x = object.__new__(SimpleNewObj)  # avoid __init__
         x.abc = 666
         for proto in protocols:
             s = self.dumps(x, proto)
-            self.assertEqual(opcode_in_pickle(pickle.NEWOBJ, s), proto >= 2)
+            self.assertEqual(opcode_in_pickle(pickle.NEWOBJ, s),
+                             2 <= proto < 4)
+            self.assertEqual(opcode_in_pickle(pickle.NEWOBJ_EX, s),
+                             proto >= 4)
             y = self.loads(s)   # will raise TypeError if __init__ called
-            self.assertEqual(y.abc, 666)
-            self.assertEqual(x.__dict__, y.__dict__)
+            self.assert_is_copy(x, y)
 
     def test_newobj_list_slots(self):
         x = SlotList([1, 2, 3])
@@ -1102,10 +1170,7 @@
         x.bar = "hello"
         s = self.dumps(x, 2)
         y = self.loads(s)
-        self.assertEqual(list(x), list(y))
-        self.assertEqual(x.__dict__, y.__dict__)
-        self.assertEqual(x.foo, y.foo)
-        self.assertEqual(x.bar, y.bar)
+        self.assert_is_copy(x, y)
 
     def test_reduce_overrides_default_reduce_ex(self):
         for proto in protocols:
@@ -1154,11 +1219,10 @@
 
     @no_tracing
     def test_bad_getattr(self):
+        # Issue #3514: crash when there is an infinite loop in __getattr__
         x = BadGetattr()
-        for proto in 0, 1:
+        for proto in protocols:
             self.assertRaises(RuntimeError, self.dumps, x, proto)
-        # protocol 2 don't raise a RuntimeError.
-        d = self.dumps(x, 2)
 
     def test_reduce_bad_iterator(self):
         # Issue4176: crash when 4th and 5th items of __reduce__()
@@ -1191,11 +1255,10 @@
         obj = [dict(large_dict), dict(large_dict), dict(large_dict)]
 
         for proto in protocols:
-            dumped = self.dumps(obj, proto)
-            loaded = self.loads(dumped)
-            self.assertEqual(loaded, obj,
-                             "Failed protocol %d: %r != %r"
-                             % (proto, obj, loaded))
+            with self.subTest(proto=proto):
+                dumped = self.dumps(obj, proto)
+                loaded = self.loads(dumped)
+                self.assert_is_copy(obj, loaded)
 
     def test_attribute_name_interning(self):
         # Test that attribute names of pickled objects are interned when
@@ -1221,7 +1284,7 @@
         loaded = self.loads(DATA5)
         self.assertEqual(type(loaded), SimpleCookie)
         self.assertEqual(list(loaded.keys()), ["key"])
-        self.assertEqual(loaded["key"].value, "Set-Cookie: key=value")
+        self.assertEqual(loaded["key"].value, "value")
 
         for (exc, data) in DATA7.items():
             loaded = self.loads(data)
@@ -1248,6 +1311,35 @@
         dumped = self.dumps(set([3]), 2)
         self.assertEqual(dumped, DATA6)
 
+    def test_load_python2_str_as_bytes(self):
+        # From Python 2: pickle.dumps('a\x00\xa0', protocol=0)
+        self.assertEqual(self.loads(b"S'a\\x00\\xa0'\n.",
+                                    encoding="bytes"), b'a\x00\xa0')
+        # From Python 2: pickle.dumps('a\x00\xa0', protocol=1)
+        self.assertEqual(self.loads(b'U\x03a\x00\xa0.',
+                                    encoding="bytes"), b'a\x00\xa0')
+        # From Python 2: pickle.dumps('a\x00\xa0', protocol=2)
+        self.assertEqual(self.loads(b'\x80\x02U\x03a\x00\xa0.',
+                                    encoding="bytes"), b'a\x00\xa0')
+
+    def test_load_python2_unicode_as_str(self):
+        # From Python 2: pickle.dumps(u'π', protocol=0)
+        self.assertEqual(self.loads(b'V\\u03c0\n.',
+                                    encoding='bytes'), 'π')
+        # From Python 2: pickle.dumps(u'π', protocol=1)
+        self.assertEqual(self.loads(b'X\x02\x00\x00\x00\xcf\x80.',
+                                    encoding="bytes"), 'π')
+        # From Python 2: pickle.dumps(u'π', protocol=2)
+        self.assertEqual(self.loads(b'\x80\x02X\x02\x00\x00\x00\xcf\x80.',
+                                    encoding="bytes"), 'π')
+
+    def test_load_long_python2_str_as_bytes(self):
+        # From Python 2: pickle.dumps('x' * 300, protocol=1)
+        self.assertEqual(self.loads(pickle.BINSTRING +
+                                    struct.pack("<I", 300) +
+                                    b'x' * 300 + pickle.STOP,
+                                    encoding='bytes'), b'x' * 300)
+
     def test_large_pickles(self):
         # Test the correctness of internal buffering routines when handling
         # large data.
@@ -1266,11 +1358,14 @@
     def test_int_pickling_efficiency(self):
         # Test compacity of int representation (see issue #12744)
         for proto in protocols:
-            sizes = [len(self.dumps(2**n, proto)) for n in range(70)]
-            # the size function is monotonic
-            self.assertEqual(sorted(sizes), sizes)
-            if proto >= 2:
-                self.assertLessEqual(sizes[-1], 14)
+            with self.subTest(proto=proto):
+                pickles = [self.dumps(2**n, proto) for n in range(70)]
+                sizes = list(map(len, pickles))
+                # the size function is monotonic
+                self.assertEqual(sorted(sizes), sizes)
+                if proto >= 2:
+                    for p in pickles:
+                        self.assertFalse(opcode_in_pickle(pickle.LONG, p))
 
     def check_negative_32b_binXXX(self, dumped):
         if sys.maxsize > 2**32:
@@ -1301,6 +1396,35 @@
         dumped = b'\x80\x03X\x01\x00\x00\x00ar\xff\xff\xff\xff.'
         self.assertRaises(ValueError, self.loads, dumped)
 
+    def test_badly_escaped_string(self):
+        self.assertRaises(ValueError, self.loads, b"S'\\'\n.")
+
+    def test_badly_quoted_string(self):
+        # Issue #17710
+        badpickles = [b"S'\n.",
+                      b'S"\n.',
+                      b'S\' \n.',
+                      b'S" \n.',
+                      b'S\'"\n.',
+                      b'S"\'\n.',
+                      b"S' ' \n.",
+                      b'S" " \n.',
+                      b"S ''\n.",
+                      b'S ""\n.',
+                      b'S \n.',
+                      b'S\n.',
+                      b'S.']
+        for p in badpickles:
+            self.assertRaises(pickle.UnpicklingError, self.loads, p)
+
+    def test_correctly_quoted_string(self):
+        goodpickles = [(b"S''\n.", ''),
+                       (b'S""\n.', ''),
+                       (b'S"\\n"\n.', '\n'),
+                       (b"S'\\n'\n.", '\n')]
+        for p, expected in goodpickles:
+            self.assertEqual(self.loads(p), expected)
+
     def _check_pickling_with_opcode(self, obj, opcode, proto):
         pickled = self.dumps(obj, proto)
         self.assertTrue(opcode_in_pickle(opcode, pickled))
@@ -1324,6 +1448,202 @@
             else:
                 self._check_pickling_with_opcode(obj, pickle.SETITEMS, proto)
 
+    # Exercise framing (proto >= 4) for significant workloads
+
+    FRAME_SIZE_TARGET = 64 * 1024
+
+    def check_frame_opcodes(self, pickled):
+        """
+        Check the arguments of FRAME opcodes in a protocol 4+ pickle.
+        """
+        frame_opcode_size = 9
+        last_arg = last_pos = None
+        for op, arg, pos in pickletools.genops(pickled):
+            if op.name != 'FRAME':
+                continue
+            if last_pos is not None:
+                # The previous frame's size should be equal to the number
+                # of bytes up to the current frame.
+                frame_size = pos - last_pos - frame_opcode_size
+                self.assertEqual(frame_size, last_arg)
+            last_arg, last_pos = arg, pos
+        # The last frame's size should be equal to the number of bytes up
+        # to the pickle's end.
+        frame_size = len(pickled) - last_pos - frame_opcode_size
+        self.assertEqual(frame_size, last_arg)
+
+    def test_framing_many_objects(self):
+        obj = list(range(10**5))
+        for proto in range(4, pickle.HIGHEST_PROTOCOL + 1):
+            with self.subTest(proto=proto):
+                pickled = self.dumps(obj, proto)
+                unpickled = self.loads(pickled)
+                self.assertEqual(obj, unpickled)
+                bytes_per_frame = (len(pickled) /
+                                   count_opcode(pickle.FRAME, pickled))
+                self.assertGreater(bytes_per_frame,
+                                   self.FRAME_SIZE_TARGET / 2)
+                self.assertLessEqual(bytes_per_frame,
+                                     self.FRAME_SIZE_TARGET * 1)
+                self.check_frame_opcodes(pickled)
+
+    def test_framing_large_objects(self):
+        N = 1024 * 1024
+        obj = [b'x' * N, b'y' * N, b'z' * N]
+        for proto in range(4, pickle.HIGHEST_PROTOCOL + 1):
+            with self.subTest(proto=proto):
+                pickled = self.dumps(obj, proto)
+                unpickled = self.loads(pickled)
+                self.assertEqual(obj, unpickled)
+                n_frames = count_opcode(pickle.FRAME, pickled)
+                self.assertGreaterEqual(n_frames, len(obj))
+                self.check_frame_opcodes(pickled)
+
+    def test_optional_frames(self):
+        if pickle.HIGHEST_PROTOCOL < 4:
+            return
+
+        def remove_frames(pickled, keep_frame=None):
+            """Remove frame opcodes from the given pickle."""
+            frame_starts = []
+            # 1 byte for the opcode and 8 for the argument
+            frame_opcode_size = 9
+            for opcode, _, pos in pickletools.genops(pickled):
+                if opcode.name == 'FRAME':
+                    frame_starts.append(pos)
+
+            newpickle = bytearray()
+            last_frame_end = 0
+            for i, pos in enumerate(frame_starts):
+                if keep_frame and keep_frame(i):
+                    continue
+                newpickle += pickled[last_frame_end:pos]
+                last_frame_end = pos + frame_opcode_size
+            newpickle += pickled[last_frame_end:]
+            return newpickle
+
+        frame_size = self.FRAME_SIZE_TARGET
+        num_frames = 20
+        obj = [bytes([i]) * frame_size for i in range(num_frames)]
+
+        for proto in range(4, pickle.HIGHEST_PROTOCOL + 1):
+            pickled = self.dumps(obj, proto)
+
+            frameless_pickle = remove_frames(pickled)
+            self.assertEqual(count_opcode(pickle.FRAME, frameless_pickle), 0)
+            self.assertEqual(obj, self.loads(frameless_pickle))
+
+            some_frames_pickle = remove_frames(pickled, lambda i: i % 2)
+            self.assertLess(count_opcode(pickle.FRAME, some_frames_pickle),
+                            count_opcode(pickle.FRAME, pickled))
+            self.assertEqual(obj, self.loads(some_frames_pickle))
+
+    def test_frame_readline(self):
+        pickled = b'\x80\x04\x95\x05\x00\x00\x00\x00\x00\x00\x00I42\n.'
+        #    0: \x80 PROTO      4
+        #    2: \x95 FRAME      5
+        #   11: I    INT        42
+        #   15: .    STOP
+        self.assertEqual(self.loads(pickled), 42)
+
+    def test_nested_names(self):
+        global Nested
+        class Nested:
+            class A:
+                class B:
+                    class C:
+                        pass
+
+        for proto in range(4, pickle.HIGHEST_PROTOCOL + 1):
+            for obj in [Nested.A, Nested.A.B, Nested.A.B.C]:
+                with self.subTest(proto=proto, obj=obj):
+                    unpickled = self.loads(self.dumps(obj, proto))
+                    self.assertIs(obj, unpickled)
+
+    def test_py_methods(self):
+        global PyMethodsTest
+        class PyMethodsTest:
+            @staticmethod
+            def cheese():
+                return "cheese"
+            @classmethod
+            def wine(cls):
+                assert cls is PyMethodsTest
+                return "wine"
+            def biscuits(self):
+                assert isinstance(self, PyMethodsTest)
+                return "biscuits"
+            class Nested:
+                "Nested class"
+                @staticmethod
+                def ketchup():
+                    return "ketchup"
+                @classmethod
+                def maple(cls):
+                    assert cls is PyMethodsTest.Nested
+                    return "maple"
+                def pie(self):
+                    assert isinstance(self, PyMethodsTest.Nested)
+                    return "pie"
+
+        py_methods = (
+            PyMethodsTest.cheese,
+            PyMethodsTest.wine,
+            PyMethodsTest().biscuits,
+            PyMethodsTest.Nested.ketchup,
+            PyMethodsTest.Nested.maple,
+            PyMethodsTest.Nested().pie
+        )
+        py_unbound_methods = (
+            (PyMethodsTest.biscuits, PyMethodsTest),
+            (PyMethodsTest.Nested.pie, PyMethodsTest.Nested)
+        )
+        for proto in range(4, pickle.HIGHEST_PROTOCOL + 1):
+            for method in py_methods:
+                with self.subTest(proto=proto, method=method):
+                    unpickled = self.loads(self.dumps(method, proto))
+                    self.assertEqual(method(), unpickled())
+            for method, cls in py_unbound_methods:
+                obj = cls()
+                with self.subTest(proto=proto, method=method):
+                    unpickled = self.loads(self.dumps(method, proto))
+                    self.assertEqual(method(obj), unpickled(obj))
+
+    def test_c_methods(self):
+        global Subclass
+        class Subclass(tuple):
+            class Nested(str):
+                pass
+
+        c_methods = (
+            # bound built-in method
+            ("abcd".index, ("c",)),
+            # unbound built-in method
+            (str.index, ("abcd", "c")),
+            # bound "slot" method
+            ([1, 2, 3].__len__, ()),
+            # unbound "slot" method
+            (list.__len__, ([1, 2, 3],)),
+            # bound "coexist" method
+            ({1, 2}.__contains__, (2,)),
+            # unbound "coexist" method
+            (set.__contains__, ({1, 2}, 2)),
+            # built-in class method
+            (dict.fromkeys, (("a", 1), ("b", 2))),
+            # built-in static method
+            (bytearray.maketrans, (b"abc", b"xyz")),
+            # subclass methods
+            (Subclass([1,2,2]).count, (2,)),
+            (Subclass.count, (Subclass([1,2,2]), 2)),
+            (Subclass.Nested("sweet").count, ("e",)),
+            (Subclass.Nested.count, (Subclass.Nested("sweet"), "e")),
+        )
+        for proto in range(4, pickle.HIGHEST_PROTOCOL + 1):
+            for method, args in c_methods:
+                with self.subTest(proto=proto, method=method):
+                    unpickled = self.loads(self.dumps(method, proto))
+                    self.assertEqual(method(*args), unpickled(*args))
+
 
 class BigmemPickleTests(unittest.TestCase):
 
@@ -1336,8 +1656,9 @@
             for proto in protocols:
                 if proto < 2:
                     continue
-                with self.assertRaises((ValueError, OverflowError)):
-                    self.dumps(data, protocol=proto)
+                with self.subTest(proto=proto):
+                    with self.assertRaises((ValueError, OverflowError)):
+                        self.dumps(data, protocol=proto)
         finally:
             data = None
 
@@ -1352,24 +1673,44 @@
             for proto in protocols:
                 if proto < 3:
                     continue
-                try:
-                    pickled = self.dumps(data, protocol=proto)
-                    self.assertTrue(b"abcd" in pickled[:15])
-                    self.assertTrue(b"abcd" in pickled[-15:])
-                finally:
-                    pickled = None
+                with self.subTest(proto=proto):
+                    try:
+                        pickled = self.dumps(data, protocol=proto)
+                        header = (pickle.BINBYTES +
+                                  struct.pack("<I", len(data)))
+                        data_start = pickled.index(data)
+                        self.assertEqual(
+                            header,
+                            pickled[data_start-len(header):data_start])
+                    finally:
+                        pickled = None
         finally:
             data = None
 
     @bigmemtest(size=_4G, memuse=2.5, dry_run=False)
     def test_huge_bytes_64b(self, size):
-        data = b"a" * size
+        data = b"acbd" * (size // 4)
         try:
             for proto in protocols:
                 if proto < 3:
                     continue
-                with self.assertRaises((ValueError, OverflowError)):
-                    self.dumps(data, protocol=proto)
+                with self.subTest(proto=proto):
+                    if proto == 3:
+                        # Protocol 3 does not support large bytes objects.
+                        # Verify that we do not crash when processing one.
+                        with self.assertRaises((ValueError, OverflowError)):
+                            self.dumps(data, protocol=proto)
+                        continue
+                    try:
+                        pickled = self.dumps(data, protocol=proto)
+                        header = (pickle.BINBYTES8 +
+                                  struct.pack("<Q", len(data)))
+                        data_start = pickled.index(data)
+                        self.assertEqual(
+                            header,
+                            pickled[data_start-len(header):data_start])
+                    finally:
+                        pickled = None
         finally:
             data = None
 
@@ -1381,27 +1722,52 @@
         data = "abcd" * (size // 4)
         try:
             for proto in protocols:
-                try:
-                    pickled = self.dumps(data, protocol=proto)
-                    self.assertTrue(b"abcd" in pickled[:15])
-                    self.assertTrue(b"abcd" in pickled[-15:])
-                finally:
-                    pickled = None
+                if proto == 0:
+                    continue
+                with self.subTest(proto=proto):
+                    try:
+                        pickled = self.dumps(data, protocol=proto)
+                        header = (pickle.BINUNICODE +
+                                  struct.pack("<I", len(data)))
+                        data_start = pickled.index(b'abcd')
+                        self.assertEqual(
+                            header,
+                            pickled[data_start-len(header):data_start])
+                        self.assertEqual((pickled.rindex(b"abcd") + len(b"abcd") -
+                                          pickled.index(b"abcd")), len(data))
+                    finally:
+                        pickled = None
         finally:
             data = None
 
-    # BINUNICODE (protocols 1, 2 and 3) cannot carry more than
-    # 2**32 - 1 bytes of utf-8 encoded unicode.
+    # BINUNICODE (protocols 1, 2 and 3) cannot carry more than 2**32 - 1 bytes
+    # of utf-8 encoded unicode. BINUNICODE8 (protocol 4) supports these huge
+    # unicode strings however.
 
     @bigmemtest(size=_4G, memuse=8, dry_run=False)
     def test_huge_str_64b(self, size):
-        data = "a" * size
+        data = "abcd" * (size // 4)
         try:
             for proto in protocols:
                 if proto == 0:
                     continue
-                with self.assertRaises((ValueError, OverflowError)):
-                    self.dumps(data, protocol=proto)
+                with self.subTest(proto=proto):
+                    if proto < 4:
+                        with self.assertRaises((ValueError, OverflowError)):
+                            self.dumps(data, protocol=proto)
+                        continue
+                    try:
+                        pickled = self.dumps(data, protocol=proto)
+                        header = (pickle.BINUNICODE8 +
+                                  struct.pack("<Q", len(data)))
+                        data_start = pickled.index(b'abcd')
+                        self.assertEqual(
+                            header,
+                            pickled[data_start-len(header):data_start])
+                        self.assertEqual((pickled.rindex(b"abcd") + len(b"abcd") -
+                                          pickled.index(b"abcd")), len(data))
+                    finally:
+                        pickled = None
         finally:
             data = None
 
@@ -1445,8 +1811,8 @@
         return object.__reduce__(self)
 
 class REX_six(object):
-    """This class is used to check the 4th argument (list iterator) of the reduce
-    protocol.
+    """This class is used to check the 4th argument (list iterator) of
+    the reduce protocol.
     """
     def __init__(self, items=None):
         self.items = items if items is not None else []
@@ -1458,8 +1824,8 @@
         return type(self), (), None, iter(self.items), None
 
 class REX_seven(object):
-    """This class is used to check the 5th argument (dict iterator) of the reduce
-    protocol.
+    """This class is used to check the 5th argument (dict iterator) of
+    the reduce protocol.
     """
     def __init__(self, table=None):
         self.table = table if table is not None else {}
@@ -1497,10 +1863,16 @@
 class MyDict(dict):
     sample = {"a": 1, "b": 2}
 
+class MySet(set):
+    sample = {"a", "b"}
+
+class MyFrozenSet(frozenset):
+    sample = frozenset({"a", "b"})
+
 myclasses = [MyInt, MyFloat,
              MyComplex,
              MyStr, MyUnicode,
-             MyTuple, MyList, MyDict]
+             MyTuple, MyList, MyDict, MySet, MyFrozenSet]
 
 
 class SlotList(MyList):
@@ -1510,6 +1882,8 @@
     def __init__(self, a, b, c):
         # raise an error, to make sure this isn't called
         raise TypeError("SimpleNewObj.__init__() didn't expect to get called")
+    def __eq__(self, other):
+        return self.__dict__ == other.__dict__
 
 class BadGetattr:
     def __getattr__(self, key):
@@ -1546,7 +1920,7 @@
 
     def test_highest_protocol(self):
         # Of course this needs to be changed when HIGHEST_PROTOCOL changes.
-        self.assertEqual(pickle.HIGHEST_PROTOCOL, 3)
+        self.assertEqual(pickle.HIGHEST_PROTOCOL, 4)
 
     def test_callapi(self):
         f = io.BytesIO()
@@ -1731,22 +2105,23 @@
 
     def _check_multiple_unpicklings(self, ioclass):
         for proto in protocols:
-            data1 = [(x, str(x)) for x in range(2000)] + [b"abcde", len]
-            f = ioclass()
-            pickler = self.pickler_class(f, protocol=proto)
-            pickler.dump(data1)
-            pickled = f.getvalue()
+            with self.subTest(proto=proto):
+                data1 = [(x, str(x)) for x in range(2000)] + [b"abcde", len]
+                f = ioclass()
+                pickler = self.pickler_class(f, protocol=proto)
+                pickler.dump(data1)
+                pickled = f.getvalue()
 
-            N = 5
-            f = ioclass(pickled * N)
-            unpickler = self.unpickler_class(f)
-            for i in range(N):
-                if f.seekable():
-                    pos = f.tell()
-                self.assertEqual(unpickler.load(), data1)
-                if f.seekable():
-                    self.assertEqual(f.tell(), pos + len(pickled))
-            self.assertRaises(EOFError, unpickler.load)
+                N = 5
+                f = ioclass(pickled * N)
+                unpickler = self.unpickler_class(f)
+                for i in range(N):
+                    if f.seekable():
+                        pos = f.tell()
+                    self.assertEqual(unpickler.load(), data1)
+                    if f.seekable():
+                        self.assertEqual(f.tell(), pos + len(pickled))
+                self.assertRaises(EOFError, unpickler.load)
 
     def test_multiple_unpicklings_seekable(self):
         self._check_multiple_unpicklings(io.BytesIO)
diff --git a/Lib/test/pycacert.pem b/Lib/test/pycacert.pem
new file mode 100644
index 0000000..09b1f3e
--- /dev/null
+++ b/Lib/test/pycacert.pem
@@ -0,0 +1,78 @@
+Certificate:
+    Data:
+        Version: 3 (0x2)
+        Serial Number: 12723342612721443280 (0xb09264b1f2da21d0)
+    Signature Algorithm: sha1WithRSAEncryption
+        Issuer: C=XY, O=Python Software Foundation CA, CN=our-ca-server
+        Validity
+            Not Before: Jan  4 19:47:07 2013 GMT
+            Not After : Jan  2 19:47:07 2023 GMT
+        Subject: C=XY, O=Python Software Foundation CA, CN=our-ca-server
+        Subject Public Key Info:
+            Public Key Algorithm: rsaEncryption
+                Public-Key: (2048 bit)
+                Modulus:
+                    00:e7:de:e9:e3:0c:9f:00:b6:a1:fd:2b:5b:96:d2:
+                    6f:cc:e0:be:86:b9:20:5e:ec:03:7a:55:ab:ea:a4:
+                    e9:f9:49:85:d2:66:d5:ed:c7:7a:ea:56:8e:2d:8f:
+                    e7:42:e2:62:28:a9:9f:d6:1b:8e:eb:b5:b4:9c:9f:
+                    14:ab:df:e6:94:8b:76:1d:3e:6d:24:61:ed:0c:bf:
+                    00:8a:61:0c:df:5c:c8:36:73:16:00:cd:47:ba:6d:
+                    a4:a4:74:88:83:23:0a:19:fc:09:a7:3c:4a:4b:d3:
+                    e7:1d:2d:e4:ea:4c:54:21:f3:26:db:89:37:18:d4:
+                    02:bb:40:32:5f:a4:ff:2d:1c:f7:d4:bb:ec:8e:cf:
+                    5c:82:ac:e6:7c:08:6c:48:85:61:07:7f:25:e0:5c:
+                    e0:bc:34:5f:e0:b9:04:47:75:c8:47:0b:8d:bc:d6:
+                    c8:68:5f:33:83:62:d2:20:44:35:b1:ad:81:1a:8a:
+                    cd:bc:35:b0:5c:8b:47:d6:18:e9:9c:18:97:cc:01:
+                    3c:29:cc:e8:1e:e4:e4:c1:b8:de:e7:c2:11:18:87:
+                    5a:93:34:d8:a6:25:f7:14:71:eb:e4:21:a2:d2:0f:
+                    2e:2e:d4:62:00:35:d3:d6:ef:5c:60:4b:4c:a9:14:
+                    e2:dd:15:58:46:37:33:26:b7:e7:2e:5d:ed:42:e4:
+                    c5:4d
+                Exponent: 65537 (0x10001)
+        X509v3 extensions:
+            X509v3 Subject Key Identifier: 
+                BC:DD:62:D9:76:DA:1B:D2:54:6B:CF:E0:66:9B:1E:1E:7B:56:0C:0B
+            X509v3 Authority Key Identifier: 
+                keyid:BC:DD:62:D9:76:DA:1B:D2:54:6B:CF:E0:66:9B:1E:1E:7B:56:0C:0B
+
+            X509v3 Basic Constraints: 
+                CA:TRUE
+    Signature Algorithm: sha1WithRSAEncryption
+         7d:0a:f5:cb:8d:d3:5d:bd:99:8e:f8:2b:0f:ba:eb:c2:d9:a6:
+         27:4f:2e:7b:2f:0e:64:d8:1c:35:50:4e:ee:fc:90:b9:8d:6d:
+         a8:c5:c6:06:b0:af:f3:2d:bf:3b:b8:42:07:dd:18:7d:6d:95:
+         54:57:85:18:60:47:2f:eb:78:1b:f9:e8:17:fd:5a:0d:87:17:
+         28:ac:4c:6a:e6:bc:29:f4:f4:55:70:29:42:de:85:ea:ab:6c:
+         23:06:64:30:75:02:8e:53:bc:5e:01:33:37:cc:1e:cd:b8:a4:
+         fd:ca:e4:5f:65:3b:83:1c:86:f1:55:02:a0:3a:8f:db:91:b7:
+         40:14:b4:e7:8d:d2:ee:73:ba:e3:e5:34:2d:bc:94:6f:4e:24:
+         06:f7:5f:8b:0e:a7:8e:6b:de:5e:75:f4:32:9a:50:b1:44:33:
+         9a:d0:05:e2:78:82:ff:db:da:8a:63:eb:a9:dd:d1:bf:a0:61:
+         ad:e3:9e:8a:24:5d:62:0e:e7:4c:91:7f:ef:df:34:36:3b:2f:
+         5d:f5:84:b2:2f:c4:6d:93:96:1a:6f:30:28:f1:da:12:9a:64:
+         b4:40:33:1d:bd:de:2b:53:a8:ea:be:d6:bc:4e:96:f5:44:fb:
+         32:18:ae:d5:1f:f6:69:af:b6:4e:7b:1d:58:ec:3b:a9:53:a3:
+         5e:58:c8:9e
+-----BEGIN CERTIFICATE-----
+MIIDbTCCAlWgAwIBAgIJALCSZLHy2iHQMA0GCSqGSIb3DQEBBQUAME0xCzAJBgNV
+BAYTAlhZMSYwJAYDVQQKDB1QeXRob24gU29mdHdhcmUgRm91bmRhdGlvbiBDQTEW
+MBQGA1UEAwwNb3VyLWNhLXNlcnZlcjAeFw0xMzAxMDQxOTQ3MDdaFw0yMzAxMDIx
+OTQ3MDdaME0xCzAJBgNVBAYTAlhZMSYwJAYDVQQKDB1QeXRob24gU29mdHdhcmUg
+Rm91bmRhdGlvbiBDQTEWMBQGA1UEAwwNb3VyLWNhLXNlcnZlcjCCASIwDQYJKoZI
+hvcNAQEBBQADggEPADCCAQoCggEBAOfe6eMMnwC2of0rW5bSb8zgvoa5IF7sA3pV
+q+qk6flJhdJm1e3HeupWji2P50LiYiipn9Ybjuu1tJyfFKvf5pSLdh0+bSRh7Qy/
+AIphDN9cyDZzFgDNR7ptpKR0iIMjChn8Cac8SkvT5x0t5OpMVCHzJtuJNxjUArtA
+Ml+k/y0c99S77I7PXIKs5nwIbEiFYQd/JeBc4Lw0X+C5BEd1yEcLjbzWyGhfM4Ni
+0iBENbGtgRqKzbw1sFyLR9YY6ZwYl8wBPCnM6B7k5MG43ufCERiHWpM02KYl9xRx
+6+QhotIPLi7UYgA109bvXGBLTKkU4t0VWEY3Mya35y5d7ULkxU0CAwEAAaNQME4w
+HQYDVR0OBBYEFLzdYtl22hvSVGvP4GabHh57VgwLMB8GA1UdIwQYMBaAFLzdYtl2
+2hvSVGvP4GabHh57VgwLMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEB
+AH0K9cuN0129mY74Kw+668LZpidPLnsvDmTYHDVQTu78kLmNbajFxgawr/Mtvzu4
+QgfdGH1tlVRXhRhgRy/reBv56Bf9Wg2HFyisTGrmvCn09FVwKULeheqrbCMGZDB1
+Ao5TvF4BMzfMHs24pP3K5F9lO4MchvFVAqA6j9uRt0AUtOeN0u5zuuPlNC28lG9O
+JAb3X4sOp45r3l519DKaULFEM5rQBeJ4gv/b2opj66nd0b+gYa3jnookXWIO50yR
+f+/fNDY7L131hLIvxG2TlhpvMCjx2hKaZLRAMx293itTqOq+1rxOlvVE+zIYrtUf
+9mmvtk57HVjsO6lTo15YyJ4=
+-----END CERTIFICATE-----
diff --git a/Lib/test/pycakey.pem b/Lib/test/pycakey.pem
new file mode 100644
index 0000000..fc6effe
--- /dev/null
+++ b/Lib/test/pycakey.pem
@@ -0,0 +1,28 @@
+-----BEGIN PRIVATE KEY-----
+MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDn3unjDJ8AtqH9
+K1uW0m/M4L6GuSBe7AN6VavqpOn5SYXSZtXtx3rqVo4tj+dC4mIoqZ/WG47rtbSc
+nxSr3+aUi3YdPm0kYe0MvwCKYQzfXMg2cxYAzUe6baSkdIiDIwoZ/AmnPEpL0+cd
+LeTqTFQh8ybbiTcY1AK7QDJfpP8tHPfUu+yOz1yCrOZ8CGxIhWEHfyXgXOC8NF/g
+uQRHdchHC4281shoXzODYtIgRDWxrYEais28NbBci0fWGOmcGJfMATwpzOge5OTB
+uN7nwhEYh1qTNNimJfcUcevkIaLSDy4u1GIANdPW71xgS0ypFOLdFVhGNzMmt+cu
+Xe1C5MVNAgMBAAECggEBAJPM7QuUrPn4cLN/Ysd15lwTWn9oHDFFgkYFvCs66gXE
+ju/6Kx2BjWE4wTJby09AHM/MqB0DvguT7Mf1Q2j3tPQ1HZowg8OwRDleuwp6KIls
+jBbhL0Jdl/5HC67ktWvZ9wNvO/wFG1rQfT6FVajf9LUbWEaSZbOG2SLhHfsHorzu
+xjTJaI3bQ/0+79B1exwk5ruwhzFRd/XpY8hls7D/RfPIuHDlBghkW3N59KFWrf5h
+6bNEh2THm0+IyGcGqs0FD+QCOXyvsjwSUswqrr2ctLREOeDcd5ReUjSxYgjcJRrm
+J7ceIY/+uwDJxw/OlnmBvF6pQMkKwYW2gFztu+g2t4UCgYEA/9yo01Exz4crxXsy
+tAlnDJM++nZcm07rtFjTKHUfKY/cCgNTa8udM0svnfwlid/dpgLsI38gx04HHC1i
+EZ4acz+ToIWedLxM0nq73//xeRWEazOvCz1mMTZaMldahTWAyzN8qVK2B/625Yy4
+wNYWyweBBwEB8MzaCs73spksXOsCgYEA5/7wvhiofYGFAfMuANeJIwDL2OtBnoOv
+mVNfCmi3GC38fzwyi5ZpskWDiS2woJ+LQfs9Qu4EcZbUFLd7gbeOvb5gmFUtYope
+LitUUKunIR18MkQ+mQDBpQPQPhk4QJP5reCbWkrfTu7b5o/iS41s6fBTFmuzhLcT
+C71vFdCyeKcCgYAiCCqYeOtELDmBOeLDmaCQRqGQ1N96dOPbCBmF/xYXBCCDYG/f
+HaUaJnz96YTgstsbcrYP/p/Qgqtlbw/lQf9IpwMuzbcG1ejt8g89OyDWNyt2ytgU
+iaUnFJCos3/Byh0Iah/BsdOueo2/OJl2ZMOBW80orlSgv86cs2y037TL4wKBgQDm
+OOyW+MlbowhnIvfoBfwlLEkefnej4nKD6WRLZBcue5Qyf355X06Mhsc9foXlH+6G
+D9h/bswiHNdhp6N82rdgPGiHQx/CxiUoE/+b/nvgNO5mw6qLE2EXbG1e8pAMJcyE
+bHw+YkawggDfELI036fRj5gki8SeUz8nS1nNgElbyQKBgCRDX9Jh+MwSLu4QBWdt
+/fi+lv3K6kun/fI7EOV1vCV/j871tICu7pu5BrOLxAHqoVfU9AUX299/2KjCb5pv
+kjogiUK6qWCWBlfuqDNWGCoUGt1rhznUva0nNjSMy5rinBhhjpROZC2pw48lOluP
+UuvXsaPph7GTqPuy4Kab12YC
+-----END PRIVATE KEY-----
diff --git a/Lib/test/pydoc_mod.py b/Lib/test/pydoc_mod.py
index f86b5c6..cda1c9e 100644
--- a/Lib/test/pydoc_mod.py
+++ b/Lib/test/pydoc_mod.py
@@ -15,6 +15,16 @@
     NO_MEANING = "eggs"
     pass
 
+class C(object):
+    def say_no(self):
+        return "no"
+    def get_answer(self):
+        """ Return say_no() """
+        return self.say_no()
+    def is_it_true(self):
+        """ Return self.get_answer() """
+        return self.get_answer()
+
 def doc_func():
     """
     This function solves all of the world's problems:
diff --git a/Lib/test/pystone.py b/Lib/test/pystone.py
index d7f1ec9..a41f1e5 100755
--- a/Lib/test/pystone.py
+++ b/Lib/test/pystone.py
@@ -3,7 +3,7 @@
 """
 "PYSTONE" Benchmark Program
 
-Version:        Python/1.1 (corresponds to C/1.1 plus 2 Pystone fixes)
+Version:        Python/1.2 (corresponds to C/1.1 plus 3 Pystone fixes)
 
 Author:         Reinhold P. Weicker,  CACM Vol 27, No 10, 10/84 pg. 1013.
 
@@ -30,13 +30,20 @@
                 percent faster than version 1.0, so benchmark figures
                 of different versions can't be compared directly.
 
+                Version 1.2 changes the division to floor division.
+
+                Under Python 3 version 1.1 would use the normal division
+                operator, resulting in some of the operations mistakenly
+                yielding floats. Version 1.2 instead uses floor division
+                making the benchmark a integer benchmark again.
+
 """
 
 LOOPS = 50000
 
 from time import clock
 
-__version__ = "1.1"
+__version__ = "1.2"
 
 [Ident1, Ident2, Ident3, Ident4, Ident5] = range(1, 6)
 
@@ -123,7 +130,7 @@
                 EnumLoc = Proc6(Ident1)
             CharIndex = chr(ord(CharIndex)+1)
         IntLoc3 = IntLoc2 * IntLoc1
-        IntLoc2 = IntLoc3 / IntLoc1
+        IntLoc2 = IntLoc3 // IntLoc1
         IntLoc2 = 7 * (IntLoc3 - IntLoc2) - IntLoc1
         IntLoc1 = Proc2(IntLoc1)
 
diff --git a/Lib/test/re_tests.py b/Lib/test/re_tests.py
index 5d16e3d..7f8075e 100755
--- a/Lib/test/re_tests.py
+++ b/Lib/test/re_tests.py
@@ -86,7 +86,7 @@
     (r'\a[\b]\f\n\r\t\v', '\a\b\f\n\r\t\v', SUCCEED, 'found', '\a\b\f\n\r\t\v'),
     (r'[\a][\b][\f][\n][\r][\t][\v]', '\a\b\f\n\r\t\v', SUCCEED, 'found', '\a\b\f\n\r\t\v'),
     # NOTE: not an error under PCRE/PRE:
-    # (r'\u', '', SYNTAX_ERROR),    # A Perl escape
+    (r'\u', '', SYNTAX_ERROR),    # A Perl escape
     (r'\c\e\g\h\i\j\k\m\o\p\q\y\z', 'ceghijkmopqyz', SUCCEED, 'found', 'ceghijkmopqyz'),
     (r'\xff', '\377', SUCCEED, 'found', chr(255)),
     # new \x semantics
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
index ae62c6e..b633631 100755
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -1,11 +1,18 @@
 #! /usr/bin/env python3
 
 """
-Usage:
+Script to run Python regression tests.
 
+Run this script with -h or --help for documentation.
+"""
+
+USAGE = """\
 python -m test [options] [test_name1 [test_name2 ...]]
 python path/to/Lib/test/regrtest.py [options] [test_name1 [test_name2 ...]]
+"""
 
+DESCRIPTION = """\
+Run Python regression tests.
 
 If no arguments or options are provided, finds all files matching
 the pattern "test_*" in the Lib/test subdirectory and runs
@@ -15,63 +22,10 @@
 command line:
 
 python -E -Wd -m test [options] [test_name1 ...]
+"""
 
-
-Options:
-
--h/--help       -- print this text and exit
---timeout TIMEOUT
-                -- dump the traceback and exit if a test takes more
-                   than TIMEOUT seconds; disabled if TIMEOUT is negative
-                   or equals to zero
---wait          -- wait for user input, e.g., allow a debugger to be attached
-
-Verbosity
-
--v/--verbose    -- run tests in verbose mode with output to stdout
--w/--verbose2   -- re-run failed tests in verbose mode
--W/--verbose3   -- display test output on failure
--d/--debug      -- print traceback for failed tests
--q/--quiet      -- no output unless one or more tests fail
--o/--slow       -- print the slowest 10 tests
-   --header     -- print header with interpreter info
-
-Selecting tests
-
--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*
--s/--single     -- single step through a set of tests (see below)
--m/--match PAT  -- match test cases and methods with glob pattern PAT
--G/--failfast   -- fail as soon as a test fails (only with -v or -W)
--u/--use RES1,RES2,...
-                -- specify which special resource intensive tests to run
--M/--memlimit LIMIT
-                -- run very large memory-consuming tests
-   --testdir DIR
-                -- execute test files in the specified directory (instead
-                   of the Python stdlib test suite)
-
-Special runs
-
--l/--findleaks  -- if GC is available detect tests that leak memory
--L/--runleaks   -- run the leaks(1) command just before exit
--R/--huntrleaks RUNCOUNTS
-                -- search for reference leaks (needs debug build, v. slow)
--j/--multiprocess PROCESSES
-                -- run PROCESSES processes at once
--T/--coverage   -- turn on code coverage tracing using the trace module
--D/--coverdir DIRECTORY
-                -- Directory where coverage files are put
--N/--nocoverdir -- Put coverage files alongside modules
--t/--threshold THRESHOLD
-                -- call gc.set_threshold(THRESHOLD)
--n/--nowindows  -- suppress error message boxes on Windows
--F/--forever    -- run the specified tests in a loop, until an error happens
-
-
-Additional Option Details:
+EPILOG = """\
+Additional option details:
 
 -r randomizes test execution order. You can use --randseed=int to provide a
 int seed value for the randomizer; this is useful for reproducing troublesome
@@ -168,11 +122,12 @@
 # We import importlib *ASAP* in order to test #15386
 import importlib
 
+import argparse
 import builtins
 import faulthandler
-import getopt
 import io
 import json
+import locale
 import logging
 import os
 import platform
@@ -194,7 +149,7 @@
 except ImportError:
     threading = None
 try:
-    import multiprocessing.process
+    import _multiprocessing, multiprocessing.process
 except ImportError:
     multiprocessing = None
 
@@ -246,20 +201,262 @@
 RESOURCE_NAMES = ('audio', 'curses', 'largefile', 'network',
                   'decimal', 'cpu', 'subprocess', 'urlfetch', 'gui')
 
-TEMPDIR = os.path.abspath(tempfile.gettempdir())
+# When tests are run from the Python build directory, it is best practice
+# to keep the test files in a subfolder.  This eases the cleanup of leftover
+# files using the "make distclean" command.
+if sysconfig.is_python_build():
+    TEMPDIR = os.path.join(sysconfig.get_config_var('srcdir'), 'build')
+else:
+    TEMPDIR = tempfile.gettempdir()
+TEMPDIR = os.path.abspath(TEMPDIR)
 
-def usage(msg):
-    print(msg, file=sys.stderr)
-    print("Use --help for usage", file=sys.stderr)
-    sys.exit(2)
+class _ArgParser(argparse.ArgumentParser):
 
+    def error(self, message):
+        super().error(message + "\nPass -h or --help for complete help.")
 
-def main(tests=None, testdir=None, verbose=0, quiet=False,
+def _create_parser():
+    # Set prog to prevent the uninformative "__main__.py" from displaying in
+    # error messages when using "python -m test ...".
+    parser = _ArgParser(prog='regrtest.py',
+                        usage=USAGE,
+                        description=DESCRIPTION,
+                        epilog=EPILOG,
+                        add_help=False,
+                        formatter_class=argparse.RawDescriptionHelpFormatter)
+
+    # Arguments with this clause added to its help are described further in
+    # the epilog's "Additional option details" section.
+    more_details = '  See the section at bottom for more details.'
+
+    group = parser.add_argument_group('General options')
+    # We add help explicitly to control what argument group it renders under.
+    group.add_argument('-h', '--help', action='help',
+                       help='show this help message and exit')
+    group.add_argument('--timeout', metavar='TIMEOUT', type=float,
+                        help='dump the traceback and exit if a test takes '
+                             'more than TIMEOUT seconds; disabled if TIMEOUT '
+                             'is negative or equals to zero')
+    group.add_argument('--wait', action='store_true',
+                       help='wait for user input, e.g., allow a debugger '
+                            'to be attached')
+    group.add_argument('--slaveargs', metavar='ARGS')
+    group.add_argument('-S', '--start', metavar='START',
+                       help='the name of the test at which to start.' +
+                            more_details)
+
+    group = parser.add_argument_group('Verbosity')
+    group.add_argument('-v', '--verbose', action='count',
+                       help='run tests in verbose mode with output to stdout')
+    group.add_argument('-w', '--verbose2', action='store_true',
+                       help='re-run failed tests in verbose mode')
+    group.add_argument('-W', '--verbose3', action='store_true',
+                       help='display test output on failure')
+    group.add_argument('-q', '--quiet', action='store_true',
+                       help='no output unless one or more tests fail')
+    group.add_argument('-o', '--slow', action='store_true', dest='print_slow',
+                       help='print the slowest 10 tests')
+    group.add_argument('--header', action='store_true',
+                       help='print header with interpreter info')
+
+    group = parser.add_argument_group('Selecting tests')
+    group.add_argument('-r', '--randomize', action='store_true',
+                       help='randomize test execution order.' + more_details)
+    group.add_argument('--randseed', metavar='SEED',
+                       dest='random_seed', type=int,
+                       help='pass a random seed to reproduce a previous '
+                            'random run')
+    group.add_argument('-f', '--fromfile', metavar='FILE',
+                       help='read names of tests to run from a file.' +
+                            more_details)
+    group.add_argument('-x', '--exclude', action='store_true',
+                       help='arguments are tests to *exclude*')
+    group.add_argument('-s', '--single', action='store_true',
+                       help='single step through a set of tests.' +
+                            more_details)
+    group.add_argument('-m', '--match', metavar='PAT',
+                       dest='match_tests',
+                       help='match test cases and methods with glob pattern PAT')
+    group.add_argument('-G', '--failfast', action='store_true',
+                       help='fail as soon as a test fails (only with -v or -W)')
+    group.add_argument('-u', '--use', metavar='RES1,RES2,...',
+                       action='append', type=resources_list,
+                       help='specify which special resource intensive tests '
+                            'to run.' + more_details)
+    group.add_argument('-M', '--memlimit', metavar='LIMIT',
+                       help='run very large memory-consuming tests.' +
+                            more_details)
+    group.add_argument('--testdir', metavar='DIR',
+                       type=relative_filename,
+                       help='execute test files in the specified directory '
+                            '(instead of the Python stdlib test suite)')
+
+    group = parser.add_argument_group('Special runs')
+    group.add_argument('-l', '--findleaks', action='store_true',
+                       help='if GC is available detect tests that leak memory')
+    group.add_argument('-L', '--runleaks', action='store_true',
+                       help='run the leaks(1) command just before exit.' +
+                            more_details)
+    group.add_argument('-R', '--huntrleaks', metavar='RUNCOUNTS',
+                       type=huntrleaks,
+                       help='search for reference leaks (needs debug build, '
+                            'very slow).' + more_details)
+    group.add_argument('-j', '--multiprocess', metavar='PROCESSES',
+                       dest='use_mp', type=int,
+                       help='run PROCESSES processes at once')
+    group.add_argument('-T', '--coverage', action='store_true',
+                       dest='trace',
+                       help='turn on code coverage tracing using the trace '
+                            'module')
+    group.add_argument('-D', '--coverdir', metavar='DIR',
+                       type=relative_filename,
+                       help='directory where coverage files are put')
+    group.add_argument('-N', '--nocoverdir',
+                       action='store_const', const=None, dest='coverdir',
+                       help='put coverage files alongside modules')
+    group.add_argument('-t', '--threshold', metavar='THRESHOLD',
+                       type=int,
+                       help='call gc.set_threshold(THRESHOLD)')
+    group.add_argument('-n', '--nowindows', action='store_true',
+                       help='suppress error message boxes on Windows')
+    group.add_argument('-F', '--forever', action='store_true',
+                       help='run the specified tests in a loop, until an '
+                            'error happens')
+
+    parser.add_argument('args', nargs=argparse.REMAINDER,
+                        help=argparse.SUPPRESS)
+
+    return parser
+
+def relative_filename(string):
+    # CWD is replaced with a temporary dir before calling main(), so we
+    # join it with the saved CWD so it ends up where the user expects.
+    return os.path.join(support.SAVEDCWD, string)
+
+def huntrleaks(string):
+    args = string.split(':')
+    if len(args) not in (2, 3):
+        raise argparse.ArgumentTypeError(
+            'needs 2 or 3 colon-separated arguments')
+    nwarmup = int(args[0]) if args[0] else 5
+    ntracked = int(args[1]) if args[1] else 4
+    fname = args[2] if len(args) > 2 and args[2] else 'reflog.txt'
+    return nwarmup, ntracked, fname
+
+def resources_list(string):
+    u = [x.lower() for x in string.split(',')]
+    for r in u:
+        if r == 'all' or r == 'none':
+            continue
+        if r[0] == '-':
+            r = r[1:]
+        if r not in RESOURCE_NAMES:
+            raise argparse.ArgumentTypeError('invalid resource: ' + r)
+    return u
+
+def _parse_args(args, **kwargs):
+    # Defaults
+    ns = argparse.Namespace(testdir=None, verbose=0, quiet=False,
          exclude=False, single=False, randomize=False, fromfile=None,
          findleaks=False, use_resources=None, trace=False, coverdir='coverage',
          runleaks=False, huntrleaks=False, verbose2=False, print_slow=False,
          random_seed=None, use_mp=None, verbose3=False, forever=False,
-         header=False, failfast=False, match_tests=None):
+         header=False, failfast=False, match_tests=None)
+    for k, v in kwargs.items():
+        if not hasattr(ns, k):
+            raise TypeError('%r is an invalid keyword argument '
+                            'for this function' % k)
+        setattr(ns, k, v)
+    if ns.use_resources is None:
+        ns.use_resources = []
+
+    parser = _create_parser()
+    parser.parse_args(args=args, namespace=ns)
+
+    if ns.single and ns.fromfile:
+        parser.error("-s and -f don't go together!")
+    if ns.use_mp and ns.trace:
+        parser.error("-T and -j don't go together!")
+    if ns.use_mp and ns.findleaks:
+        parser.error("-l and -j don't go together!")
+    if ns.use_mp and ns.memlimit:
+        parser.error("-M and -j don't go together!")
+    if ns.failfast and not (ns.verbose or ns.verbose3):
+        parser.error("-G/--failfast needs either -v or -W")
+
+    if ns.quiet:
+        ns.verbose = 0
+    if ns.timeout is not None:
+        if hasattr(faulthandler, 'dump_traceback_later'):
+            if ns.timeout <= 0:
+                ns.timeout = None
+        else:
+            print("Warning: The timeout option requires "
+                  "faulthandler.dump_traceback_later")
+            ns.timeout = None
+    if ns.use_mp is not None:
+        if ns.use_mp <= 0:
+            # Use all cores + extras for tests that like to sleep
+            ns.use_mp = 2 + (os.cpu_count() or 1)
+        if ns.use_mp == 1:
+            ns.use_mp = None
+    if ns.use:
+        for a in ns.use:
+            for r in a:
+                if r == 'all':
+                    ns.use_resources[:] = RESOURCE_NAMES
+                    continue
+                if r == 'none':
+                    del ns.use_resources[:]
+                    continue
+                remove = False
+                if r[0] == '-':
+                    remove = True
+                    r = r[1:]
+                if remove:
+                    if r in ns.use_resources:
+                        ns.use_resources.remove(r)
+                elif r not in ns.use_resources:
+                    ns.use_resources.append(r)
+    if ns.random_seed is not None:
+        ns.randomize = True
+
+    return ns
+
+
+def run_test_in_subprocess(testname, ns):
+    """Run the given test in a subprocess with --slaveargs.
+
+    ns is the option Namespace parsed from command-line arguments. regrtest
+    is invoked in a subprocess with the --slaveargs argument; when the
+    subprocess exits, its return code, stdout and stderr are returned as a
+    3-tuple.
+    """
+    from subprocess import Popen, PIPE
+    base_cmd = ([sys.executable] + support.args_from_interpreter_flags() +
+                ['-X', 'faulthandler', '-m', 'test.regrtest'])
+
+    slaveargs = (
+            (testname, ns.verbose, ns.quiet),
+            dict(huntrleaks=ns.huntrleaks,
+                 use_resources=ns.use_resources,
+                 output_on_failure=ns.verbose3,
+                 timeout=ns.timeout, failfast=ns.failfast,
+                 match_tests=ns.match_tests))
+    # Running the child from the same working directory as regrtest's original
+    # invocation ensures that TEMPDIR for the child is the same when
+    # sysconfig.is_python_build() is true. See issue 15300.
+    popen = Popen(base_cmd + ['--slaveargs', json.dumps(slaveargs)],
+                  stdout=PIPE, stderr=PIPE,
+                  universal_newlines=True,
+                  close_fds=(os.name != 'nt'),
+                  cwd=support.SAVEDCWD)
+    stdout, stderr = popen.communicate()
+    retcode = popen.wait()
+    return retcode, stdout, stderr
+
+
+def main(tests=None, **kwargs):
     """Execute a test suite.
 
     This also parses command-line options and modifies its behavior
@@ -282,7 +479,6 @@
     directly to set the values that would normally be set by flags
     on the command line.
     """
-
     # Display the Python traceback on fatal errors (e.g. segfault)
     faulthandler.enable(all_threads=True)
 
@@ -298,187 +494,51 @@
     replace_stdout()
 
     support.record_original_stdout(sys.stdout)
-    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', 'randomize', 'fromfile=', 'findleaks',
-             'use=', 'threshold=', 'coverdir=', 'nocoverdir',
-             'runleaks', 'huntrleaks=', 'memlimit=', 'randseed=',
-             'multiprocess=', 'coverage', 'slaveargs=', 'forever', 'debug',
-             'start=', 'nowindows', 'header', 'testdir=', 'timeout=', 'wait',
-             'failfast', 'match='])
-    except getopt.error as msg:
-        usage(msg)
 
-    # Defaults
-    if random_seed is None:
-        random_seed = random.randrange(10000000)
-    if use_resources is None:
-        use_resources = []
-    debug = False
-    start = None
-    timeout = None
-    for o, a in opts:
-        if o in ('-h', '--help'):
-            print(__doc__)
-            return
-        elif o in ('-v', '--verbose'):
-            verbose += 1
-        elif o in ('-w', '--verbose2'):
-            verbose2 = True
-        elif o in ('-d', '--debug'):
-            debug = True
-        elif o in ('-W', '--verbose3'):
-            verbose3 = True
-        elif o in ('-G', '--failfast'):
-            failfast = True
-        elif o in ('-q', '--quiet'):
-            quiet = True;
-            verbose = 0
-        elif o in ('-x', '--exclude'):
-            exclude = True
-        elif o in ('-S', '--start'):
-            start = a
-        elif o in ('-s', '--single'):
-            single = True
-        elif o in ('-o', '--slow'):
-            print_slow = True
-        elif o in ('-r', '--randomize'):
-            randomize = True
-        elif o == '--randseed':
-            randomize = True
-            random_seed = int(a)
-        elif o in ('-f', '--fromfile'):
-            fromfile = a
-        elif o in ('-m', '--match'):
-            match_tests = a
-        elif o in ('-l', '--findleaks'):
-            findleaks = True
-        elif o in ('-L', '--runleaks'):
-            runleaks = True
-        elif o in ('-t', '--threshold'):
-            import gc
-            gc.set_threshold(int(a))
-        elif o in ('-T', '--coverage'):
-            trace = True
-        elif o in ('-D', '--coverdir'):
-            # CWD is replaced with a temporary dir before calling main(), so we
-            # need  join it with the saved CWD so it goes where the user expects.
-            coverdir = os.path.join(support.SAVEDCWD, a)
-        elif o in ('-N', '--nocoverdir'):
-            coverdir = None
-        elif o in ('-R', '--huntrleaks'):
-            huntrleaks = a.split(':')
-            if len(huntrleaks) not in (2, 3):
-                print(a, huntrleaks)
-                usage('-R takes 2 or 3 colon-separated arguments')
-            if not huntrleaks[0]:
-                huntrleaks[0] = 5
-            else:
-                huntrleaks[0] = int(huntrleaks[0])
-            if not huntrleaks[1]:
-                huntrleaks[1] = 4
-            else:
-                huntrleaks[1] = int(huntrleaks[1])
-            if len(huntrleaks) == 2 or not huntrleaks[2]:
-                huntrleaks[2:] = ["reflog.txt"]
-            # Avoid false positives due to various caches
-            # filling slowly with random data:
-            warm_caches()
-        elif o in ('-M', '--memlimit'):
-            support.set_memlimit(a)
-        elif o in ('-u', '--use'):
-            u = [x.lower() for x in a.split(',')]
-            for r in u:
-                if r == 'all':
-                    use_resources[:] = RESOURCE_NAMES
-                    continue
-                if r == 'none':
-                    del use_resources[:]
-                    continue
-                remove = False
-                if r[0] == '-':
-                    remove = True
-                    r = r[1:]
-                if r not in RESOURCE_NAMES:
-                    usage('Invalid -u/--use option: ' + a)
-                if remove:
-                    if r in use_resources:
-                        use_resources.remove(r)
-                elif r not in use_resources:
-                    use_resources.append(r)
-        elif o in ('-n', '--nowindows'):
-            import msvcrt
-            msvcrt.SetErrorMode(msvcrt.SEM_FAILCRITICALERRORS|
-                    msvcrt.SEM_NOALIGNMENTFAULTEXCEPT|
-                    msvcrt.SEM_NOGPFAULTERRORBOX|
-                    msvcrt.SEM_NOOPENFILEERRORBOX)
-            try:
-                msvcrt.CrtSetReportMode
-            except AttributeError:
-                # release build
-                pass
-            else:
-                for m in [msvcrt.CRT_WARN, msvcrt.CRT_ERROR, msvcrt.CRT_ASSERT]:
-                    msvcrt.CrtSetReportMode(m, msvcrt.CRTDBG_MODE_FILE)
-                    msvcrt.CrtSetReportFile(m, msvcrt.CRTDBG_FILE_STDERR)
-        elif o in ('-F', '--forever'):
-            forever = True
-        elif o in ('-j', '--multiprocess'):
-            use_mp = int(a)
-            if use_mp <= 0:
-                try:
-                    import multiprocessing
-                    # Use all cores + extras for tests that like to sleep
-                    use_mp = 2 + multiprocessing.cpu_count()
-                except (ImportError, NotImplementedError):
-                    use_mp = 3
-            if use_mp == 1:
-                use_mp = None
-        elif o == '--header':
-            header = True
-        elif o == '--slaveargs':
-            args, kwargs = json.loads(a)
-            try:
-                result = runtest(*args, **kwargs)
-            except KeyboardInterrupt:
-                result = INTERRUPTED, ''
-            except BaseException as e:
-                traceback.print_exc()
-                result = CHILD_ERROR, str(e)
-            sys.stdout.flush()
-            print()   # Force a newline (just in case)
-            print(json.dumps(result))
-            sys.exit(0)
-        elif o == '--testdir':
-            # CWD is replaced with a temporary dir before calling main(), so we
-            # join it with the saved CWD so it ends up where the user expects.
-            testdir = os.path.join(support.SAVEDCWD, a)
-        elif o == '--timeout':
-            if hasattr(faulthandler, 'dump_traceback_later'):
-                timeout = float(a)
-                if timeout <= 0:
-                    timeout = None
-            else:
-                print("Warning: The timeout option requires "
-                      "faulthandler.dump_traceback_later")
-                timeout = None
-        elif o == '--wait':
-            input("Press any key to continue...")
+    ns = _parse_args(sys.argv[1:], **kwargs)
+
+    if ns.huntrleaks:
+        # Avoid false positives due to various caches
+        # filling slowly with random data:
+        warm_caches()
+    if ns.memlimit is not None:
+        support.set_memlimit(ns.memlimit)
+    if ns.threshold is not None:
+        import gc
+        gc.set_threshold(ns.threshold)
+    if ns.nowindows:
+        import msvcrt
+        msvcrt.SetErrorMode(msvcrt.SEM_FAILCRITICALERRORS|
+                            msvcrt.SEM_NOALIGNMENTFAULTEXCEPT|
+                            msvcrt.SEM_NOGPFAULTERRORBOX|
+                            msvcrt.SEM_NOOPENFILEERRORBOX)
+        try:
+            msvcrt.CrtSetReportMode
+        except AttributeError:
+            # release build
+            pass
         else:
-            print(("No handler for option {}.  Please report this as a bug "
-                   "at http://bugs.python.org.").format(o), file=sys.stderr)
-            sys.exit(1)
-    if single and fromfile:
-        usage("-s and -f don't go together!")
-    if use_mp and trace:
-        usage("-T and -j don't go together!")
-    if use_mp and findleaks:
-        usage("-l and -j don't go together!")
-    if use_mp and support.max_memuse:
-        usage("-M and -j don't go together!")
-    if failfast and not (verbose or verbose3):
-        usage("-G/--failfast needs either -v or -W")
+            for m in [msvcrt.CRT_WARN, msvcrt.CRT_ERROR, msvcrt.CRT_ASSERT]:
+                msvcrt.CrtSetReportMode(m, msvcrt.CRTDBG_MODE_FILE)
+                msvcrt.CrtSetReportFile(m, msvcrt.CRTDBG_FILE_STDERR)
+    if ns.wait:
+        input("Press any key to continue...")
+
+    if ns.slaveargs is not None:
+        args, kwargs = json.loads(ns.slaveargs)
+        if kwargs.get('huntrleaks'):
+            unittest.BaseTestSuite._cleanup = False
+        try:
+            result = runtest(*args, **kwargs)
+        except KeyboardInterrupt:
+            result = INTERRUPTED, ''
+        except BaseException as e:
+            traceback.print_exc()
+            result = CHILD_ERROR, str(e)
+        sys.stdout.flush()
+        print()   # Force a newline (just in case)
+        print(json.dumps(result))
+        sys.exit(0)
 
     good = []
     bad = []
@@ -487,12 +547,12 @@
     environment_changed = []
     interrupted = False
 
-    if findleaks:
+    if ns.findleaks:
         try:
             import gc
         except ImportError:
             print('No GC available, disabling findleaks.')
-            findleaks = False
+            ns.findleaks = False
         else:
             # Uncomment the line below to report garbage that is not
             # freeable by reference counting alone.  By default only
@@ -500,82 +560,87 @@
             #gc.set_debug(gc.DEBUG_SAVEALL)
             found_garbage = []
 
-    if single:
+    if ns.huntrleaks:
+        unittest.BaseTestSuite._cleanup = False
+
+    if ns.single:
         filename = os.path.join(TEMPDIR, 'pynexttest')
         try:
-            fp = open(filename, 'r')
-            next_test = fp.read().strip()
-            tests = [next_test]
-            fp.close()
-        except IOError:
+            with open(filename, 'r') as fp:
+                next_test = fp.read().strip()
+                tests = [next_test]
+        except OSError:
             pass
 
-    if fromfile:
+    if ns.fromfile:
         tests = []
-        fp = open(os.path.join(support.SAVEDCWD, fromfile))
-        count_pat = re.compile(r'\[\s*\d+/\s*\d+\]')
-        for line in fp:
-            line = count_pat.sub('', line)
-            guts = line.split() # assuming no test has whitespace in its name
-            if guts and not guts[0].startswith('#'):
-                tests.extend(guts)
-        fp.close()
+        with open(os.path.join(support.SAVEDCWD, ns.fromfile)) as fp:
+            count_pat = re.compile(r'\[\s*\d+/\s*\d+\]')
+            for line in fp:
+                line = count_pat.sub('', line)
+                guts = line.split() # assuming no test has whitespace in its name
+                if guts and not guts[0].startswith('#'):
+                    tests.extend(guts)
 
     # Strip .py extensions.
-    removepy(args)
+    removepy(ns.args)
     removepy(tests)
 
     stdtests = STDTESTS[:]
     nottests = NOTTESTS.copy()
-    if exclude:
-        for arg in args:
+    if ns.exclude:
+        for arg in ns.args:
             if arg in stdtests:
                 stdtests.remove(arg)
             nottests.add(arg)
-        args = []
+        ns.args = []
 
     # For a partial run, we do not need to clutter the output.
-    if verbose or header or not (quiet or single or tests or args):
+    if ns.verbose or ns.header or not (ns.quiet or ns.single or tests or ns.args):
         # Print basic platform information
         print("==", platform.python_implementation(), *sys.version.split())
         print("==  ", platform.platform(aliased=True),
                       "%s-endian" % sys.byteorder)
+        print("==  ", "hash algorithm:", sys.hash_info.algorithm,
+              "64bit" if sys.maxsize > 2**32 else "32bit")
         print("==  ", os.getcwd())
         print("Testing with flags:", sys.flags)
 
     # if testdir is set, then we are not running the python tests suite, so
     # don't add default tests to be executed or skipped (pass empty values)
-    if testdir:
-        alltests = findtests(testdir, list(), set())
+    if ns.testdir:
+        alltests = findtests(ns.testdir, list(), set())
     else:
-        alltests = findtests(testdir, stdtests, nottests)
+        alltests = findtests(ns.testdir, stdtests, nottests)
 
-    selected = tests or args or alltests
-    if single:
+    selected = tests or ns.args or alltests
+    if ns.single:
         selected = selected[:1]
         try:
             next_single_test = alltests[alltests.index(selected[0])+1]
         except IndexError:
             next_single_test = None
     # Remove all the selected tests that precede start if it's set.
-    if start:
+    if ns.start:
         try:
-            del selected[:selected.index(start)]
+            del selected[:selected.index(ns.start)]
         except ValueError:
-            print("Couldn't find starting test (%s), using all tests" % start)
-    if randomize:
-        random.seed(random_seed)
-        print("Using random seed", random_seed)
+            print("Couldn't find starting test (%s), using all tests" % ns.start)
+    if ns.randomize:
+        if ns.random_seed is None:
+            ns.random_seed = random.randrange(10000000)
+        random.seed(ns.random_seed)
+        print("Using random seed", ns.random_seed)
         random.shuffle(selected)
-    if trace:
+    if ns.trace:
         import trace, tempfile
         tracer = trace.Trace(ignoredirs=[sys.base_prefix, sys.base_exec_prefix,
                                          tempfile.gettempdir()],
                              trace=False, count=True)
 
     test_times = []
-    support.verbose = verbose      # Tell tests to be moderately quiet
-    support.use_resources = use_resources
+    support.verbose = ns.verbose      # Tell tests to be moderately quiet
+    support.use_resources = ns.use_resources
     save_modules = sys.modules.keys()
 
     def accumulate_result(test, result):
@@ -593,7 +658,7 @@
             skipped.append(test)
             resource_denieds.append(test)
 
-    if forever:
+    if ns.forever:
         def test_forever(tests=list(selected)):
             while True:
                 for test in tests:
@@ -608,19 +673,16 @@
         test_count = '/{}'.format(len(selected))
         test_count_width = len(test_count) - 1
 
-    if use_mp:
+    if ns.use_mp:
         try:
             from threading import Thread
         except ImportError:
             print("Multiprocess option requires thread support")
             sys.exit(2)
         from queue import Queue
-        from subprocess import Popen, PIPE
-        debug_output_pat = re.compile(r"\[\d+ refs\]$")
+        debug_output_pat = re.compile(r"\[\d+ refs, \d+ blocks\]$")
         output = Queue()
         pending = MultiprocessTests(tests)
-        opt_args = support.args_from_interpreter_flags()
-        base_cmd = [sys.executable] + opt_args + ['-m', 'test.regrtest']
         def work():
             # A worker thread.
             try:
@@ -630,24 +692,7 @@
                     except StopIteration:
                         output.put((None, None, None, None))
                         return
-                    args_tuple = (
-                        (test, verbose, quiet),
-                        dict(huntrleaks=huntrleaks, use_resources=use_resources,
-                             debug=debug, output_on_failure=verbose3,
-                             timeout=timeout, failfast=failfast,
-                             match_tests=match_tests)
-                    )
-                    # -E is needed by some tests, e.g. test_import
-                    # Running the child from the same working directory ensures
-                    # that TEMPDIR for the child is the same when
-                    # sysconfig.is_python_build() is true. See issue 15300.
-                    popen = Popen(base_cmd + ['--slaveargs', json.dumps(args_tuple)],
-                                   stdout=PIPE, stderr=PIPE,
-                                   universal_newlines=True,
-                                   close_fds=(os.name != 'nt'),
-                                   cwd=support.SAVEDCWD)
-                    stdout, stderr = popen.communicate()
-                    retcode = popen.wait()
+                    retcode, stdout, stderr = run_test_in_subprocess(test, ns)
                     # Strip last refcount output line if it exists, since it
                     # comes from the shutdown of the interpreter in the subcommand.
                     stderr = debug_output_pat.sub("", stderr)
@@ -664,19 +709,19 @@
             except BaseException:
                 output.put((None, None, None, None))
                 raise
-        workers = [Thread(target=work) for i in range(use_mp)]
+        workers = [Thread(target=work) for i in range(ns.use_mp)]
         for worker in workers:
             worker.start()
         finished = 0
         test_index = 1
         try:
-            while finished < use_mp:
+            while finished < ns.use_mp:
                 test, stdout, stderr, result = output.get()
                 if test is None:
                     finished += 1
                     continue
                 accumulate_result(test, result)
-                if not quiet:
+                if not ns.quiet:
                     fmt = "[{1:{0}}{2}/{3}] {4}" if bad else "[{1:{0}}{2}] {4}"
                     print(fmt.format(
                         test_count_width, test_index, test_count,
@@ -699,29 +744,30 @@
             worker.join()
     else:
         for test_index, test in enumerate(tests, 1):
-            if not quiet:
+            if not ns.quiet:
                 fmt = "[{1:{0}}{2}/{3}] {4}" if bad else "[{1:{0}}{2}] {4}"
                 print(fmt.format(
                     test_count_width, test_index, test_count, len(bad), test))
                 sys.stdout.flush()
-            if trace:
+            if ns.trace:
                 # If we're tracing code coverage, then we don't exit with status
                 # if on a false return value from main.
-                tracer.runctx('runtest(test, verbose, quiet, timeout=timeout)',
+                tracer.runctx('runtest(test, ns.verbose, ns.quiet, timeout=ns.timeout)',
                               globals=globals(), locals=vars())
             else:
                 try:
-                    result = runtest(test, verbose, quiet, huntrleaks, debug,
-                                     output_on_failure=verbose3,
-                                     timeout=timeout, failfast=failfast,
-                                     match_tests=match_tests)
+                    result = runtest(test, ns.verbose, ns.quiet,
+                                     ns.huntrleaks,
+                                     output_on_failure=ns.verbose3,
+                                     timeout=ns.timeout, failfast=ns.failfast,
+                                     match_tests=ns.match_tests)
                     accumulate_result(test, result)
                 except KeyboardInterrupt:
                     interrupted = True
                     break
                 except:
                     raise
-            if findleaks:
+            if ns.findleaks:
                 gc.collect()
                 if gc.garbage:
                     print("Warning: test created", len(gc.garbage), end=' ')
@@ -742,11 +788,11 @@
         omitted = set(selected) - set(good) - set(bad) - set(skipped)
         print(count(len(omitted), "test"), "omitted:")
         printlist(omitted)
-    if good and not quiet:
+    if good and not ns.quiet:
         if not bad and not skipped and not interrupted and len(good) > 1:
             print("All", end=' ')
         print(count(len(good), "test"), "OK.")
-    if print_slow:
+    if ns.print_slow:
         test_times.sort(reverse=True)
         print("10 slowest tests:")
         for time, test in test_times[:10]:
@@ -760,32 +806,19 @@
         print("{} altered the execution environment:".format(
                  count(len(environment_changed), "test")))
         printlist(environment_changed)
-    if skipped and not quiet:
+    if skipped and not ns.quiet:
         print(count(len(skipped), "test"), "skipped:")
         printlist(skipped)
 
-        e = _ExpectedSkips()
-        plat = sys.platform
-        if e.isvalid():
-            surprise = set(skipped) - e.getexpected() - set(resource_denieds)
-            if surprise:
-                print(count(len(surprise), "skip"), \
-                      "unexpected on", plat + ":")
-                printlist(surprise)
-            else:
-                print("Those skips are all expected on", plat + ".")
-        else:
-            print("Ask someone to teach regrtest.py about which tests are")
-            print("expected to get skipped on", plat + ".")
-
-    if verbose2 and bad:
+    if ns.verbose2 and bad:
         print("Re-running failed tests in verbose mode")
         for test in bad:
             print("Re-running test %r in verbose mode" % test)
             sys.stdout.flush()
             try:
-                verbose = True
-                ok = runtest(test, True, quiet, huntrleaks, debug, timeout=timeout)
+                ns.verbose = True
+                ok = runtest(test, True, ns.quiet, ns.huntrleaks,
+                             timeout=ns.timeout)
             except KeyboardInterrupt:
                 # print a newline separate from the ^C
                 print()
@@ -793,18 +826,18 @@
             except:
                 raise
 
-    if single:
+    if ns.single:
         if next_single_test:
             with open(filename, 'w') as fp:
                 fp.write(next_single_test + '\n')
         else:
             os.unlink(filename)
 
-    if trace:
+    if ns.trace:
         r = tracer.results()
-        r.write_results(show_missing=True, summary=True, coverdir=coverdir)
+        r.write_results(show_missing=True, summary=True, coverdir=ns.coverdir)
 
-    if runleaks:
+    if ns.runleaks:
         os.system("leaks %d" % os.getpid())
 
     sys.exit(len(bad) > 0 or interrupted)
@@ -877,7 +910,7 @@
     atexit.register(restore_stdout)
 
 def runtest(test, verbose, quiet,
-            huntrleaks=False, debug=False, use_resources=None,
+            huntrleaks=False, use_resources=None,
             output_on_failure=False, failfast=False, match_tests=None,
             timeout=None):
     """Run a single test.
@@ -885,14 +918,15 @@
     test -- the name of the test
     verbose -- if true, print more messages
     quiet -- if true, don't print 'skipped' messages (probably redundant)
-    test_times -- a list of (time, test_name) pairs
     huntrleaks -- run multiple times to test for leaks; requires a debug
                   build; a triple corresponding to -R's three arguments
+    use_resources -- list of extra resources to use
     output_on_failure -- if true, display test output on failure
     timeout -- dump the traceback and exit if a test takes more than
                timeout seconds
+    failfast, match_tests -- See regrtest command-line flags for these.
 
-    Returns one of the test result constants:
+    Returns the tuple result, test_time, where result is one of the constants:
         INTERRUPTED      KeyboardInterrupt when run under -j
         RESOURCE_DENIED  test skipped because resource denied
         SKIPPED          test skipped for some other reason
@@ -930,7 +964,7 @@
                 sys.stdout = stream
                 sys.stderr = stream
                 result = runtest_inner(test, verbose, quiet, huntrleaks,
-                                       debug, display_failure=False)
+                                       display_failure=False)
                 if result[0] == FAILED:
                     output = stream.getvalue()
                     orig_stderr.write(output)
@@ -940,7 +974,7 @@
                 sys.stderr = orig_stderr
         else:
             support.verbose = verbose  # Tell tests to be moderately quiet
-            result = runtest_inner(test, verbose, quiet, huntrleaks, debug,
+            result = runtest_inner(test, verbose, quiet, huntrleaks,
                                    display_failure=not verbose)
         return result
     finally:
@@ -992,10 +1026,12 @@
                  'os.environ', 'sys.path', 'sys.path_hooks', '__import__',
                  'warnings.filters', 'asyncore.socket_map',
                  'logging._handlers', 'logging._handlerList', 'sys.gettrace',
-                 'sys.warnoptions', 'threading._dangling',
-                 'multiprocessing.process._dangling',
+                 'sys.warnoptions',
+                 # multiprocessing.process._cleanup() may release ref
+                 # to a thread, so check processes first.
+                 'multiprocessing.process._dangling', 'threading._dangling',
                  'sysconfig._CONFIG_VARS', 'sysconfig._INSTALL_SCHEMES',
-                 'support.TESTFN',
+                 'support.TESTFN', 'locale', 'warnings.showwarning',
                 )
 
     def get_sys_argv(self):
@@ -1123,6 +1159,8 @@
     def get_multiprocessing_process__dangling(self):
         if not multiprocessing:
             return None
+        # Unjoined process objects can survive after process exits
+        multiprocessing.process._cleanup()
         # This copies the weakrefs without making any strong reference
         return multiprocessing.process._dangling.copy()
     def restore_multiprocessing_process__dangling(self, saved):
@@ -1164,6 +1202,25 @@
             elif os.path.isdir(support.TESTFN):
                 shutil.rmtree(support.TESTFN)
 
+    _lc = [getattr(locale, lc) for lc in dir(locale)
+           if lc.startswith('LC_')]
+    def get_locale(self):
+        pairings = []
+        for lc in self._lc:
+            try:
+                pairings.append((lc, locale.setlocale(lc, None)))
+            except (TypeError, ValueError):
+                continue
+        return pairings
+    def restore_locale(self, saved):
+        for lc, setting in saved:
+            locale.setlocale(lc, setting)
+
+    def get_warnings_showwarning(self):
+        return warnings.showwarning
+    def restore_warnings_showwarning(self, fxn):
+        warnings.showwarning = fxn
+
     def resource_info(self):
         for name in self.resources:
             method_suffix = name.replace('.', '_')
@@ -1198,7 +1255,7 @@
 
 
 def runtest_inner(test, verbose, quiet,
-                  huntrleaks=False, debug=False, display_failure=True):
+                  huntrleaks=False, display_failure=True):
     support.unload(test)
 
     test_time = 0.0
@@ -1211,18 +1268,18 @@
             abstest = 'test.' + test
         with saved_test_environment(test, verbose, quiet) as environment:
             start_time = time.time()
-            the_package = __import__(abstest, globals(), locals(), [])
-            the_module = getattr(the_package, test)
+            the_module = importlib.import_module(abstest)
             # If the test has a test_main, that will run the appropriate
             # tests.  If not, use normal unittest test loading.
             test_runner = getattr(the_module, "test_main", None)
             if test_runner is None:
-                tests = unittest.TestLoader().loadTestsFromModule(the_module)
-                test_runner = lambda: support.run_unittest(tests)
+                def test_runner():
+                    loader = unittest.TestLoader()
+                    tests = loader.loadTestsFromModule(the_module)
+                    support.run_unittest(tests)
             test_runner()
             if huntrleaks:
-                refleak = dash_R(the_module, test, test_runner,
-                    huntrleaks)
+                refleak = dash_R(the_module, test, test_runner, huntrleaks)
             test_time = time.time() - start_time
     except support.ResourceDenied as msg:
         if not quiet:
@@ -1328,41 +1385,50 @@
         for obj in abc.__subclasses__() + [abc]:
             abcs[obj] = obj._abc_registry.copy()
 
-    if indirect_test:
-        def run_the_test():
-            indirect_test()
-    else:
-        def run_the_test():
-            del sys.modules[the_module.__name__]
-            exec('import ' + the_module.__name__)
-
-    deltas = []
     nwarmup, ntracked, fname = huntrleaks
     fname = os.path.join(support.SAVEDCWD, fname)
     repcount = nwarmup + ntracked
+    rc_deltas = [0] * repcount
+    alloc_deltas = [0] * repcount
+
     print("beginning", repcount, "repetitions", file=sys.stderr)
     print(("1234567890"*(repcount//10 + 1))[:repcount], file=sys.stderr)
     sys.stderr.flush()
-    dash_R_cleanup(fs, ps, pic, zdc, abcs)
     for i in range(repcount):
-        rc_before = sys.gettotalrefcount()
-        run_the_test()
+        indirect_test()
+        alloc_after, rc_after = dash_R_cleanup(fs, ps, pic, zdc, abcs)
         sys.stderr.write('.')
         sys.stderr.flush()
-        dash_R_cleanup(fs, ps, pic, zdc, abcs)
-        rc_after = sys.gettotalrefcount()
         if i >= nwarmup:
-            deltas.append(rc_after - rc_before)
+            rc_deltas[i] = rc_after - rc_before
+            alloc_deltas[i] = alloc_after - alloc_before
+        alloc_before, rc_before = alloc_after, rc_after
     print(file=sys.stderr)
-    if any(deltas):
-        msg = '%s leaked %s references, sum=%s' % (test, deltas, sum(deltas))
-        print(msg, file=sys.stderr)
-        sys.stderr.flush()
-        with open(fname, "a") as refrep:
-            print(msg, file=refrep)
-            refrep.flush()
-        return True
-    return False
+    # These checkers return False on success, True on failure
+    def check_rc_deltas(deltas):
+        return any(deltas)
+    def check_alloc_deltas(deltas):
+        # At least 1/3rd of 0s
+        if 3 * deltas.count(0) < len(deltas):
+            return True
+        # Nothing else than 1s, 0s and -1s
+        if not set(deltas) <= {1,0,-1}:
+            return True
+        return False
+    failed = False
+    for deltas, item_name, checker in [
+        (rc_deltas, 'references', check_rc_deltas),
+        (alloc_deltas, 'memory blocks', check_alloc_deltas)]:
+        if checker(deltas):
+            msg = '%s leaked %s %s, sum=%s' % (
+                test, deltas[nwarmup:], item_name, sum(deltas))
+            print(msg, file=sys.stderr)
+            sys.stderr.flush()
+            with open(fname, "a") as refrep:
+                print(msg, file=refrep)
+                refrep.flush()
+            failed = True
+    return failed
 
 def dash_R_cleanup(fs, ps, pic, zdc, abcs):
     import gc, copyreg
@@ -1428,8 +1494,11 @@
     else:
         ctypes._reset_cache()
 
-    # Collect cyclic trash.
+    # Collect cyclic trash and read memory statistics immediately after.
+    func1 = sys.getallocatedblocks
+    func2 = sys.gettotalrefcount
     gc.collect()
+    return func1(), func2()
 
 def warm_caches():
     # char cache
@@ -1472,307 +1541,10 @@
     print(fill(' '.join(str(elt) for elt in sorted(x)), width,
                initial_indent=blanks, subsequent_indent=blanks))
 
-# Map sys.platform to a string containing the basenames of tests
-# expected to be skipped on that platform.
-#
-# Special cases:
-#     test_pep277
-#         The _ExpectedSkips constructor adds this to the set of expected
-#         skips if not os.path.supports_unicode_filenames.
-#     test_timeout
-#         Controlled by test_timeout.skip_expected.  Requires the network
-#         resource and a socket module.
-#
-# Tests that are expected to be skipped everywhere except on one platform
-# are also handled separately.
 
-_expectations = (
-    ('win32',
-        """
-        test__locale
-        test_crypt
-        test_curses
-        test_dbm
-        test_devpoll
-        test_fcntl
-        test_fork1
-        test_epoll
-        test_dbm_gnu
-        test_dbm_ndbm
-        test_grp
-        test_ioctl
-        test_largefile
-        test_kqueue
-        test_openpty
-        test_ossaudiodev
-        test_pipes
-        test_poll
-        test_posix
-        test_pty
-        test_pwd
-        test_resource
-        test_signal
-        test_syslog
-        test_threadsignals
-        test_wait3
-        test_wait4
-        """),
-    ('linux',
-        """
-        test_curses
-        test_devpoll
-        test_largefile
-        test_kqueue
-        test_ossaudiodev
-        """),
-    ('unixware',
-        """
-        test_epoll
-        test_largefile
-        test_kqueue
-        test_minidom
-        test_openpty
-        test_pyexpat
-        test_sax
-        test_sundry
-        """),
-    ('openunix',
-        """
-        test_epoll
-        test_largefile
-        test_kqueue
-        test_minidom
-        test_openpty
-        test_pyexpat
-        test_sax
-        test_sundry
-        """),
-    ('sco_sv',
-        """
-        test_asynchat
-        test_fork1
-        test_epoll
-        test_gettext
-        test_largefile
-        test_locale
-        test_kqueue
-        test_minidom
-        test_openpty
-        test_pyexpat
-        test_queue
-        test_sax
-        test_sundry
-        test_thread
-        test_threaded_import
-        test_threadedtempfile
-        test_threading
-        """),
-    ('darwin',
-        """
-        test__locale
-        test_curses
-        test_devpoll
-        test_epoll
-        test_dbm_gnu
-        test_gdb
-        test_largefile
-        test_locale
-        test_minidom
-        test_ossaudiodev
-        test_poll
-        """),
-    ('sunos',
-        """
-        test_curses
-        test_dbm
-        test_epoll
-        test_kqueue
-        test_dbm_gnu
-        test_gzip
-        test_openpty
-        test_zipfile
-        test_zlib
-        """),
-    ('hp-ux',
-        """
-        test_curses
-        test_epoll
-        test_dbm_gnu
-        test_gzip
-        test_largefile
-        test_locale
-        test_kqueue
-        test_minidom
-        test_openpty
-        test_pyexpat
-        test_sax
-        test_zipfile
-        test_zlib
-        """),
-    ('cygwin',
-        """
-        test_curses
-        test_dbm
-        test_devpoll
-        test_epoll
-        test_ioctl
-        test_kqueue
-        test_largefile
-        test_locale
-        test_ossaudiodev
-        test_socketserver
-        """),
-    ('os2emx',
-        """
-        test_audioop
-        test_curses
-        test_epoll
-        test_kqueue
-        test_largefile
-        test_mmap
-        test_openpty
-        test_ossaudiodev
-        test_pty
-        test_resource
-        test_signal
-        """),
-    ('freebsd',
-        """
-        test_devpoll
-        test_epoll
-        test_dbm_gnu
-        test_locale
-        test_ossaudiodev
-        test_pep277
-        test_pty
-        test_socketserver
-        test_tcl
-        test_tk
-        test_ttk_guionly
-        test_ttk_textonly
-        test_timeout
-        test_urllibnet
-        test_multiprocessing
-        """),
-    ('aix',
-        """
-        test_bz2
-        test_epoll
-        test_dbm_gnu
-        test_gzip
-        test_kqueue
-        test_ossaudiodev
-        test_tcl
-        test_tk
-        test_ttk_guionly
-        test_ttk_textonly
-        test_zipimport
-        test_zlib
-        """),
-    ('openbsd',
-        """
-        test_ctypes
-        test_devpoll
-        test_epoll
-        test_dbm_gnu
-        test_locale
-        test_normalization
-        test_ossaudiodev
-        test_pep277
-        test_tcl
-        test_tk
-        test_ttk_guionly
-        test_ttk_textonly
-        test_multiprocessing
-        """),
-    ('netbsd',
-        """
-        test_ctypes
-        test_curses
-        test_devpoll
-        test_epoll
-        test_dbm_gnu
-        test_locale
-        test_ossaudiodev
-        test_pep277
-        test_tcl
-        test_tk
-        test_ttk_guionly
-        test_ttk_textonly
-        test_multiprocessing
-        """),
-)
-
-class _ExpectedSkips:
-    def __init__(self):
-        import os.path
-        from test import test_timeout
-
-        self.valid = False
-        expected = None
-        for item in _expectations:
-            if sys.platform.startswith(item[0]):
-                expected = item[1]
-                break
-        if expected is not None:
-            self.expected = set(expected.split())
-
-            # These are broken tests, for now skipped on every platform.
-            # XXX Fix these!
-            self.expected.add('test_nis')
-
-            # expected to be skipped on every platform, even Linux
-            if not os.path.supports_unicode_filenames:
-                self.expected.add('test_pep277')
-
-            # doctest, profile and cProfile tests fail when the codec for the
-            # fs encoding isn't built in because PyUnicode_Decode() adds two
-            # calls into Python.
-            encs = ("utf-8", "latin-1", "ascii", "mbcs", "utf-16", "utf-32")
-            if sys.getfilesystemencoding().lower() not in encs:
-                self.expected.add('test_profile')
-                self.expected.add('test_cProfile')
-                self.expected.add('test_doctest')
-
-            if test_timeout.skip_expected:
-                self.expected.add('test_timeout')
-
-            if sys.platform != "win32":
-                # test_sqlite is only reliable on Windows where the library
-                # is distributed with Python
-                WIN_ONLY = {"test_unicode_file", "test_winreg",
-                            "test_winsound", "test_startfile",
-                            "test_sqlite", "test_msilib"}
-                self.expected |= WIN_ONLY
-
-            if sys.platform != 'sunos5':
-                self.expected.add('test_nis')
-
-            if support.python_is_optimized():
-                self.expected.add("test_gdb")
-
-            self.valid = True
-
-    def isvalid(self):
-        "Return true iff _ExpectedSkips knows about the current platform."
-        return self.valid
-
-    def getexpected(self):
-        """Return set of test names we expect to skip on current platform.
-
-        self.isvalid() must be true.
-        """
-
-        assert self.isvalid()
-        return self.expected
-
-def _make_temp_dir_for_build(TEMPDIR):
-    # When tests are run from the Python build directory, it is best practice
-    # to keep the test files in a subfolder.  It eases the cleanup of leftover
-    # files using command "make distclean".
+def main_in_temp_cwd():
+    """Run main() in a temporary working directory."""
     if sysconfig.is_python_build():
-        TEMPDIR = os.path.join(sysconfig.get_config_var('srcdir'), 'build')
-        TEMPDIR = os.path.abspath(TEMPDIR)
         try:
             os.mkdir(TEMPDIR)
         except FileExistsError:
@@ -1781,10 +1553,16 @@
     # Define a writable temp dir that will be used as cwd while running
     # the tests. The name of the dir includes the pid to allow parallel
     # testing (see the -j option).
-    TESTCWD = 'test_python_{}'.format(os.getpid())
+    test_cwd = 'test_python_{}'.format(os.getpid())
+    test_cwd = os.path.join(TEMPDIR, test_cwd)
 
-    TESTCWD = os.path.join(TEMPDIR, TESTCWD)
-    return TEMPDIR, TESTCWD
+    # Run the tests in a context manager that temporarily changes the CWD to a
+    # temporary and writable directory.  If it's not possible to create or
+    # change the CWD, the original CWD will be used.  The original CWD is
+    # available from support.SAVEDCWD.
+    with support.temp_cwd(test_cwd, quiet=True):
+        main()
+
 
 if __name__ == '__main__':
     # Remove regrtest.py's own directory from the module search path. Despite
@@ -1808,11 +1586,4 @@
     # sanity check
     assert __file__ == os.path.abspath(sys.argv[0])
 
-    TEMPDIR, TESTCWD = _make_temp_dir_for_build(TEMPDIR)
-
-    # Run the tests in a context manager that temporary changes the CWD to a
-    # temporary and writable directory. If it's not possible to create or
-    # change the CWD, the original CWD will be used. The original CWD is
-    # available from support.SAVEDCWD.
-    with support.temp_cwd(TESTCWD, quiet=True):
-        main()
+    main_in_temp_cwd()
diff --git a/Lib/test/revocation.crl b/Lib/test/revocation.crl
new file mode 100644
index 0000000..6d89b08
--- /dev/null
+++ b/Lib/test/revocation.crl
@@ -0,0 +1,11 @@
+-----BEGIN X509 CRL-----
+MIIBpjCBjwIBATANBgkqhkiG9w0BAQUFADBNMQswCQYDVQQGEwJYWTEmMCQGA1UE
+CgwdUHl0aG9uIFNvZnR3YXJlIEZvdW5kYXRpb24gQ0ExFjAUBgNVBAMMDW91ci1j
+YS1zZXJ2ZXIXDTEzMTEyMTE3MDg0N1oXDTIzMDkzMDE3MDg0N1qgDjAMMAoGA1Ud
+FAQDAgEAMA0GCSqGSIb3DQEBBQUAA4IBAQCNJXC2mVKauEeN3LlQ3ZtM5gkH3ExH
++i4bmJjtJn497WwvvoIeUdrmVXgJQR93RtV37hZwN0SXMLlNmUZPH4rHhihayw4m
+unCzVj/OhCCY7/TPjKuJ1O/0XhaLBpBVjQN7R/1ujoRKbSia/CD3vcn7Fqxzw7LK
+fSRCKRGTj1CZiuxrphtFchwALXSiFDy9mr2ZKhImcyq1PydfgEzU78APpOkMQsIC
+UNJ/cf3c9emzf+dUtcMEcejQ3mynBo4eIGg1EW42bz4q4hSjzQlKcBV0muw5qXhc
+HOxH2iTFhQ7SrvVuK/dM14rYM4B5mSX3nRC1kNmXpS9j3wJDhuwmjHed
+-----END X509 CRL-----
diff --git a/Lib/test/script_helper.py b/Lib/test/script_helper.py
index ab20164..87a781e 100644
--- a/Lib/test/script_helper.py
+++ b/Lib/test/script_helper.py
@@ -12,13 +12,22 @@
 import shutil
 import zipfile
 
-from imp import source_from_cache
+from importlib.util import source_from_cache
 from test.support import make_legacy_pyc, strip_python_stderr, temp_dir
 
 # Executing the interpreter in a subprocess
 def _assert_python(expected_success, *args, **env_vars):
-    cmd_line = [sys.executable]
-    if not env_vars:
+    if '__isolated' in env_vars:
+        isolated = env_vars.pop('__isolated')
+    else:
+        isolated = not env_vars
+    cmd_line = [sys.executable, '-X', 'faulthandler']
+    if isolated:
+        # isolated mode: ignore Python environment variables, ignore user
+        # site-packages, and don't add the current directory to sys.path
+        cmd_line.append('-I')
+    elif not env_vars:
+        # ignore Python environment variables
         cmd_line.append('-E')
     # Need to preserve the original environment, for in-place testing of
     # shared library builds.
@@ -39,35 +48,59 @@
         p.stdout.close()
         p.stderr.close()
     rc = p.returncode
-    err =  strip_python_stderr(err)
+    err = strip_python_stderr(err)
     if (rc and expected_success) or (not rc and not expected_success):
         raise AssertionError(
-            "Process return code is %d, "
-            "stderr follows:\n%s" % (rc, err.decode('ascii', 'ignore')))
+            "Process return code is %d, command line was: %r, "
+            "stderr follows:\n%s" % (rc, cmd_line,
+                                     err.decode('ascii', 'ignore')))
     return rc, out, err
 
 def assert_python_ok(*args, **env_vars):
     """
     Assert that running the interpreter with `args` and optional environment
-    variables `env_vars` is ok and return a (return code, stdout, stderr) tuple.
+    variables `env_vars` succeeds (rc == 0) and return a (return code, stdout,
+    stderr) tuple.
+
+    If the __cleanenv keyword is set, env_vars is used a fresh environment.
+
+    Python is started in isolated mode (command line option -I),
+    except if the __isolated keyword is set to False.
     """
     return _assert_python(True, *args, **env_vars)
 
 def assert_python_failure(*args, **env_vars):
     """
     Assert that running the interpreter with `args` and optional environment
-    variables `env_vars` fails and return a (return code, stdout, stderr) tuple.
+    variables `env_vars` fails (rc != 0) and return a (return code, stdout,
+    stderr) tuple.
+
+    See assert_python_ok() for more options.
     """
     return _assert_python(False, *args, **env_vars)
 
-def spawn_python(*args, **kw):
+def spawn_python(*args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, **kw):
+    """Run a Python subprocess with the given arguments.
+
+    kw is extra keyword args to pass to subprocess.Popen. Returns a Popen
+    object.
+    """
     cmd_line = [sys.executable, '-E']
     cmd_line.extend(args)
+    # Under Fedora (?), GNU readline can output junk on stderr when initialized,
+    # depending on the TERM setting.  Setting TERM=vt100 is supposed to disable
+    # that.  References:
+    # - http://reinout.vanrees.org/weblog/2009/08/14/readline-invisible-character-hack.html
+    # - http://stackoverflow.com/questions/15760712/python-readline-module-prints-escape-character-during-import
+    # - http://lists.gnu.org/archive/html/bug-readline/2007-08/msg00004.html
+    env = kw.setdefault('env', dict(os.environ))
+    env['TERM'] = 'vt100'
     return subprocess.Popen(cmd_line, stdin=subprocess.PIPE,
-                            stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
+                            stdout=stdout, stderr=stderr,
                             **kw)
 
 def kill_python(p):
+    """Run the given Popen process until completion and return stdout."""
     p.stdin.close()
     data = p.stdout.read()
     p.stdout.close()
@@ -77,8 +110,10 @@
     subprocess._cleanup()
     return data
 
-def make_script(script_dir, script_basename, source):
-    script_filename = script_basename+os.extsep+'py'
+def make_script(script_dir, script_basename, source, omit_suffix=False):
+    script_filename = script_basename
+    if not omit_suffix:
+        script_filename += os.extsep + 'py'
     script_name = os.path.join(script_dir, script_filename)
     # The script should be encoded to UTF-8, the default string encoding
     script_file = open(script_name, 'w', encoding='utf-8')
@@ -121,8 +156,8 @@
     script_name = make_script(zip_dir, script_basename, source)
     unlink.append(script_name)
     if compiled:
-        init_name = py_compile(init_name, doraise=True)
-        script_name = py_compile(script_name, doraise=True)
+        init_name = py_compile.compile(init_name, doraise=True)
+        script_name = py_compile.compile(script_name, doraise=True)
         unlink.extend((init_name, script_name))
     pkg_names = [os.sep.join([pkg_name]*i) for i in range(1, depth+1)]
     script_name_in_zip = os.path.join(pkg_names[-1], os.path.basename(script_name))
diff --git a/Lib/test/selfsigned_pythontestdotnet.pem b/Lib/test/selfsigned_pythontestdotnet.pem
new file mode 100644
index 0000000..9a80073
--- /dev/null
+++ b/Lib/test/selfsigned_pythontestdotnet.pem
@@ -0,0 +1,16 @@
+-----BEGIN CERTIFICATE-----
+MIIChzCCAfCgAwIBAgIJAKGU95wKR8pSMA0GCSqGSIb3DQEBBQUAMHAxCzAJBgNV
+BAYTAlhZMRcwFQYDVQQHDA5DYXN0bGUgQW50aHJheDEjMCEGA1UECgwaUHl0aG9u
+IFNvZnR3YXJlIEZvdW5kYXRpb24xIzAhBgNVBAMMGnNlbGYtc2lnbmVkLnB5dGhv
+bnRlc3QubmV0MB4XDTE0MTEwMjE4MDkyOVoXDTI0MTAzMDE4MDkyOVowcDELMAkG
+A1UEBhMCWFkxFzAVBgNVBAcMDkNhc3RsZSBBbnRocmF4MSMwIQYDVQQKDBpQeXRo
+b24gU29mdHdhcmUgRm91bmRhdGlvbjEjMCEGA1UEAwwac2VsZi1zaWduZWQucHl0
+aG9udGVzdC5uZXQwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANDXQXW9tjyZ
+Xt0Iv2tLL1+jinr4wGg36ioLDLFkMf+2Y1GL0v0BnKYG4N1OKlAU15LXGeGer8vm
+Sv/yIvmdrELvhAbbo3w4a9TMYQA4XkIVLdvu3mvNOAet+8PMJxn26dbDhG809ALv
+EHY57lQsBS3G59RZyBPVqAqmImWNJnVzAgMBAAGjKTAnMCUGA1UdEQQeMByCGnNl
+bGYtc2lnbmVkLnB5dGhvbnRlc3QubmV0MA0GCSqGSIb3DQEBBQUAA4GBAIOXmdtM
+eG9qzP9TiXW/Gc/zI4cBfdCpC+Y4gOfC9bQUC7hefix4iO3+iZjgy3X/FaRxUUoV
+HKiXcXIaWqTSUWp45cSh0MbwZXudp6JIAptzdAhvvCrPKeC9i9GvxsPD4LtDAL97
+vSaxQBezA7hdxZd90/EeyMgVZgAnTCnvAWX9
+-----END CERTIFICATE-----
diff --git a/Lib/test/seq_tests.py b/Lib/test/seq_tests.py
index f185a82..9834af1 100644
--- a/Lib/test/seq_tests.py
+++ b/Lib/test/seq_tests.py
@@ -392,6 +392,7 @@
 
     def test_pickle(self):
         lst = self.type2test([4, 5, 6, 7])
-        lst2 = pickle.loads(pickle.dumps(lst))
-        self.assertEqual(lst2, lst)
-        self.assertNotEqual(id(lst2), id(lst))
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            lst2 = pickle.loads(pickle.dumps(lst, proto))
+            self.assertEqual(lst2, lst)
+            self.assertNotEqual(id(lst2), id(lst))
diff --git a/Lib/test/sortperf.py b/Lib/test/sortperf.py
index af7c0b4..90722f7 100644
--- a/Lib/test/sortperf.py
+++ b/Lib/test/sortperf.py
@@ -22,7 +22,7 @@
     fn = os.path.join(td, "rr%06d" % n)
     try:
         fp = open(fn, "rb")
-    except IOError:
+    except OSError:
         r = random.random
         result = [r() for i in range(n)]
         try:
@@ -35,9 +35,9 @@
                 if fp:
                     try:
                         os.unlink(fn)
-                    except os.error:
+                    except OSError:
                         pass
-        except IOError as msg:
+        except OSError as msg:
             print("can't write", fn, ":", msg)
     else:
         result = marshal.load(fp)
diff --git a/Lib/test/ssl_servers.py b/Lib/test/ssl_servers.py
index 8686153..759b3f4 100644
--- a/Lib/test/ssl_servers.py
+++ b/Lib/test/ssl_servers.py
@@ -35,7 +35,7 @@
         try:
             sock, addr = self.socket.accept()
             sslconn = self.context.wrap_socket(sock, server_side=True)
-        except socket.error as e:
+        except OSError as e:
             # socket errors are silenced by the caller, print them here
             if support.verbose:
                 sys.stderr.write("Got an error:\n%s\n" % e)
@@ -147,9 +147,11 @@
         self.server.shutdown()
 
 
-def make_https_server(case, certfile=CERTFILE, host=HOST, handler_class=None):
-    # we assume the certfile contains both private key and certificate
-    context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+def make_https_server(case, *, context=None, certfile=CERTFILE,
+                      host=HOST, handler_class=None):
+    if context is None:
+        context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+    # We assume the certfile contains both private key and certificate
     context.load_cert_chain(certfile)
     server = HTTPSServerThread(context, host, handler_class)
     flag = threading.Event()
diff --git a/Lib/test/ssltests.py b/Lib/test/ssltests.py
new file mode 100644
index 0000000..9b0ed22
--- /dev/null
+++ b/Lib/test/ssltests.py
@@ -0,0 +1,22 @@
+# Convenience test module to run all of the SSL-related tests in the
+# standard library.
+
+import sys
+import subprocess
+
+TESTS = ['test_asyncio', 'test_ftplib', 'test_hashlib', 'test_httplib',
+         'test_imaplib', 'test_nntplib', 'test_poplib', 'test_smtplib',
+         'test_smtpnet', 'test_urllib2_localnet', 'test_venv']
+
+def run_regrtests(*extra_args):
+    args = [sys.executable, "-m", "test"]
+    if not extra_args:
+        args.append("-unetwork")
+    else:
+        args.extend(extra_args)
+    args.extend(TESTS)
+    result = subprocess.call(args)
+    sys.exit(result)
+
+if __name__ == '__main__':
+    run_regrtests(*sys.argv[1:])
diff --git a/Lib/test/string_tests.py b/Lib/test/string_tests.py
index 4800d6d..242a931 100644
--- a/Lib/test/string_tests.py
+++ b/Lib/test/string_tests.py
@@ -1,5 +1,5 @@
 """
-Common tests shared by test_str, test_unicode, test_userstring and test_string.
+Common tests shared by test_unicode, test_userstring and test_string.
 """
 
 import unittest, string, sys, struct
@@ -79,11 +79,9 @@
     def checkraises(self, exc, obj, methodname, *args):
         obj = self.fixtype(obj)
         args = self.fixtype(args)
-        self.assertRaises(
-            exc,
-            getattr(obj, methodname),
-            *args
-        )
+        with self.assertRaises(exc) as cm:
+            getattr(obj, methodname)(*args)
+        self.assertNotEqual(str(cm.exception), '')
 
     # call obj.method(*args) without any checks
     def checkcall(self, obj, methodname, *args):
@@ -327,13 +325,26 @@
         self.checkraises(TypeError, 'hello', 'upper', 42)
 
     def test_expandtabs(self):
-        self.checkequal('abc\rab      def\ng       hi', 'abc\rab\tdef\ng\thi', 'expandtabs')
-        self.checkequal('abc\rab      def\ng       hi', 'abc\rab\tdef\ng\thi', 'expandtabs', 8)
-        self.checkequal('abc\rab  def\ng   hi', 'abc\rab\tdef\ng\thi', 'expandtabs', 4)
-        self.checkequal('abc\r\nab  def\ng   hi', 'abc\r\nab\tdef\ng\thi', 'expandtabs', 4)
-        self.checkequal('abc\rab      def\ng       hi', 'abc\rab\tdef\ng\thi', 'expandtabs')
-        self.checkequal('abc\rab      def\ng       hi', 'abc\rab\tdef\ng\thi', 'expandtabs', 8)
-        self.checkequal('abc\r\nab\r\ndef\ng\r\nhi', 'abc\r\nab\r\ndef\ng\r\nhi', 'expandtabs', 4)
+        self.checkequal('abc\rab      def\ng       hi', 'abc\rab\tdef\ng\thi',
+                        'expandtabs')
+        self.checkequal('abc\rab      def\ng       hi', 'abc\rab\tdef\ng\thi',
+                        'expandtabs', 8)
+        self.checkequal('abc\rab  def\ng   hi', 'abc\rab\tdef\ng\thi',
+                        'expandtabs', 4)
+        self.checkequal('abc\r\nab      def\ng       hi', 'abc\r\nab\tdef\ng\thi',
+                        'expandtabs')
+        self.checkequal('abc\r\nab      def\ng       hi', 'abc\r\nab\tdef\ng\thi',
+                        'expandtabs', 8)
+        self.checkequal('abc\r\nab  def\ng   hi', 'abc\r\nab\tdef\ng\thi',
+                        'expandtabs', 4)
+        self.checkequal('abc\r\nab\r\ndef\ng\r\nhi', 'abc\r\nab\r\ndef\ng\r\nhi',
+                        'expandtabs', 4)
+        # check keyword args
+        self.checkequal('abc\rab      def\ng       hi', 'abc\rab\tdef\ng\thi',
+                        'expandtabs', tabsize=8)
+        self.checkequal('abc\rab  def\ng   hi', 'abc\rab\tdef\ng\thi',
+                        'expandtabs', tabsize=4)
+
         self.checkequal('  a\n b', ' \ta\n\tb', 'expandtabs', 1)
 
         self.checkraises(TypeError, 'hello', 'expandtabs', 42, 42)
@@ -1106,8 +1117,7 @@
     def test_join(self):
         # join now works with any sequence type
         # moved here, because the argument order is
-        # different in string.join (see the test in
-        # test.test_string.StringTest.test_join)
+        # different in string.join
         self.checkequal('a b c d', ' ', 'join', ['a', 'b', 'c', 'd'])
         self.checkequal('abcd', '', 'join', ('a', 'b', 'c', 'd'))
         self.checkequal('bd', '', 'join', ('', 'b', '', 'd'))
@@ -1127,6 +1137,7 @@
         self.checkequal('a b c', ' ', 'join', BadSeq2())
 
         self.checkraises(TypeError, ' ', 'join')
+        self.checkraises(TypeError, ' ', 'join', None)
         self.checkraises(TypeError, ' ', 'join', 7)
         self.checkraises(TypeError, ' ', 'join', [1, 2, bytes()])
         try:
@@ -1165,7 +1176,8 @@
         self.checkraises(TypeError, 'abc', '__mod__')
         self.checkraises(TypeError, '%(foo)s', '__mod__', 42)
         self.checkraises(TypeError, '%s%s', '__mod__', (42,))
-        self.checkraises(TypeError, '%c', '__mod__', (None,))
+        with self.assertWarns(DeprecationWarning):
+            self.checkraises(TypeError, '%c', '__mod__', (None,))
         self.checkraises(ValueError, '%(foo', '__mod__', {})
         self.checkraises(TypeError, '%(foo)s %(bar)s', '__mod__', ('foo', 42))
         self.checkraises(TypeError, '%d', '__mod__', "42") # not numeric
diff --git a/Lib/test/subprocessdata/fd_status.py b/Lib/test/subprocessdata/fd_status.py
index 1f61e13..d12bd95 100644
--- a/Lib/test/subprocessdata/fd_status.py
+++ b/Lib/test/subprocessdata/fd_status.py
@@ -1,17 +1,27 @@
 """When called as a script, print a comma-separated list of the open
-file descriptors on stdout."""
+file descriptors on stdout.
+
+Usage:
+fd_stats.py: check all file descriptors
+fd_status.py fd1 fd2 ...: check only specified file descriptors
+"""
 
 import errno
 import os
-
-try:
-    _MAXFD = os.sysconf("SC_OPEN_MAX")
-except:
-    _MAXFD = 256
+import stat
+import sys
 
 if __name__ == "__main__":
     fds = []
-    for fd in range(0, _MAXFD):
+    if len(sys.argv) == 1:
+        try:
+            _MAXFD = os.sysconf("SC_OPEN_MAX")
+        except:
+            _MAXFD = 256
+        test_fds = range(0, _MAXFD)
+    else:
+        test_fds = map(int, sys.argv[1:])
+    for fd in test_fds:
         try:
             st = os.fstat(fd)
         except OSError as e:
@@ -19,6 +29,6 @@
                 continue
             raise
         # Ignore Solaris door files
-        if st.st_mode & 0xF000 != 0xd000:
+        if not stat.S_ISDOOR(st.st_mode):
             fds.append(fd)
     print(','.join(map(str, fds)))
diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
index 5c03f54..d98068c 100644
--- a/Lib/test/support/__init__.py
+++ b/Lib/test/support/__init__.py
@@ -3,28 +3,30 @@
 if __name__ != 'test.support':
     raise ImportError('support must be imported from the test package')
 
+import collections.abc
 import contextlib
 import errno
+import fnmatch
 import functools
 import gc
-import socket
-import sys
+import importlib
+import importlib.util
+import logging.handlers
 import os
 import platform
-import shutil
-import warnings
-import unittest
-import importlib
-import collections.abc
 import re
-import subprocess
-import imp
-import time
-import sysconfig
-import fnmatch
-import logging.handlers
+import shutil
+import socket
+import stat
 import struct
+import subprocess
+import sys
+import sysconfig
 import tempfile
+import time
+import unittest
+import urllib.error
+import warnings
 
 try:
     import _thread, threading
@@ -56,26 +58,49 @@
 except ImportError:
     lzma = None
 
+try:
+    import resource
+except ImportError:
+    resource = None
+
 __all__ = [
-    "Error", "TestFailed", "ResourceDenied", "import_module", "verbose",
-    "use_resources", "max_memuse", "record_original_stdout",
-    "get_original_stdout", "unload", "unlink", "rmtree", "forget",
+    # globals
+    "PIPE_MAX_SIZE", "verbose", "max_memuse", "use_resources", "failfast",
+    # exceptions
+    "Error", "TestFailed", "ResourceDenied",
+    # imports
+    "import_module", "import_fresh_module", "CleanImport",
+    # modules
+    "unload", "forget",
+    # io
+    "record_original_stdout", "get_original_stdout", "captured_stdout",
+    "captured_stdin", "captured_stderr",
+    # filesystem
+    "TESTFN", "SAVEDCWD", "unlink", "rmtree", "temp_cwd", "findfile",
+    "create_empty_file", "can_symlink", "fs_is_case_insensitive",
+    # unittest
     "is_resource_enabled", "requires", "requires_freebsd_version",
-    "requires_linux_version", "requires_mac_ver", "find_unused_port",
-    "bind_port", "IPV6_ENABLED", "is_jython", "TESTFN", "HOST", "SAVEDCWD",
-    "temp_cwd", "findfile", "create_empty_file", "sortdict",
-    "check_syntax_error", "open_urlresource", "check_warnings", "CleanImport",
-    "EnvironmentVarGuard", "TransientResource", "captured_stdout",
-    "captured_stdin", "captured_stderr", "time_out", "socket_peer_reset",
-    "ioerror_peer_reset", "run_with_locale", 'temp_umask',
-    "transient_internet", "set_memlimit", "bigmemtest", "bigaddrspacetest",
-    "BasicTestRunner", "run_unittest", "run_doctest", "threading_setup",
-    "threading_cleanup", "reap_children", "cpython_only", "check_impl_detail",
-    "get_attribute", "swap_item", "swap_attr", "requires_IEEE_754",
-    "TestHandler", "Matcher", "can_symlink", "skip_unless_symlink",
-    "skip_unless_xattr", "import_fresh_module", "requires_zlib",
-    "PIPE_MAX_SIZE", "failfast", "anticipate_failure", "run_with_tz",
-    "requires_gzip", "requires_bz2", "requires_lzma", "suppress_crash_popup",
+    "requires_linux_version", "requires_mac_ver", "check_syntax_error",
+    "TransientResource", "time_out", "socket_peer_reset", "ioerror_peer_reset",
+    "transient_internet", "BasicTestRunner", "run_unittest", "run_doctest",
+    "skip_unless_symlink", "requires_gzip", "requires_bz2", "requires_lzma",
+    "bigmemtest", "bigaddrspacetest", "cpython_only", "get_attribute",
+    "requires_IEEE_754", "skip_unless_xattr", "requires_zlib",
+    "anticipate_failure", "load_package_tests",
+    # sys
+    "is_jython", "check_impl_detail",
+    # network
+    "HOST", "IPV6_ENABLED", "find_unused_port", "bind_port", "open_urlresource",
+    # processes
+    'temp_umask', "reap_children",
+    # logging
+    "TestHandler",
+    # threads
+    "threading_setup", "threading_cleanup",
+    # miscellaneous
+    "check_warnings", "EnvironmentVarGuard", "run_with_locale", "swap_item",
+    "swap_attr", "Matcher", "set_memlimit", "SuppressCrashReport", "sortdict",
+    "run_with_tz",
     ]
 
 class Error(Exception):
@@ -97,7 +122,8 @@
     """Context manager to suppress package and module deprecation
     warnings when importing them.
 
-    If ignore is False, this context manager has no effect."""
+    If ignore is False, this context manager has no effect.
+    """
     if ignore:
         with warnings.catch_warnings():
             warnings.filterwarnings("ignore", ".+ (module|package)",
@@ -107,16 +133,21 @@
         yield
 
 
-def import_module(name, deprecated=False):
+def import_module(name, deprecated=False, *, required_on=()):
     """Import and return the module to be tested, raising SkipTest if
     it is not available.
 
     If deprecated is True, any module or package deprecation messages
-    will be suppressed."""
+    will be suppressed. If a module is required on a platform but optional for
+    others, set required_on to an iterable of platform prefixes which will be
+    compared against sys.platform.
+    """
     with _ignore_deprecated_imports(deprecated):
         try:
             return importlib.import_module(name)
         except ImportError as msg:
+            if sys.platform.startswith(tuple(required_on)):
+                raise
             raise unittest.SkipTest(str(msg))
 
 
@@ -158,6 +189,25 @@
         return unittest.expectedFailure
     return lambda f: f
 
+def load_package_tests(pkg_dir, loader, standard_tests, pattern):
+    """Generic load_tests implementation for simple test packages.
+
+    Most packages can implement load_tests using this function as follows:
+
+       def load_tests(*args):
+           return load_package_tests(os.path.dirname(__file__), *args)
+    """
+    if pattern is None:
+        pattern = "test*"
+    top_dir = os.path.dirname(              # Lib
+                  os.path.dirname(              # test
+                      os.path.dirname(__file__)))   # support
+    package_tests = loader.discover(start_dir=pkg_dir,
+                                    top_level_dir=top_dir,
+                                    pattern=pattern)
+    standard_tests.addTests(package_tests)
+    return standard_tests
+
 
 def import_fresh_module(name, fresh=(), blocked=(), deprecated=False):
     """Import and return a module, deliberately bypassing sys.modules.
@@ -287,7 +337,13 @@
         def _rmtree_inner(path):
             for name in os.listdir(path):
                 fullname = os.path.join(path, name)
-                if os.path.isdir(fullname):
+                try:
+                    mode = os.lstat(fullname).st_mode
+                except OSError as exc:
+                    print("support.rmtree(): os.lstat(%r) failed with %s" % (fullname, exc),
+                          file=sys.__stderr__)
+                    mode = 0
+                if stat.S_ISDIR(mode):
                     _waitfor(_rmtree_inner, fullname, waitall=True)
                     os.rmdir(fullname)
                 else:
@@ -302,25 +358,20 @@
 def unlink(filename):
     try:
         _unlink(filename)
-    except OSError as error:
-        # The filename need not exist.
-        if error.errno not in (errno.ENOENT, errno.ENOTDIR):
-            raise
+    except (FileNotFoundError, NotADirectoryError):
+        pass
 
 def rmdir(dirname):
     try:
         _rmdir(dirname)
-    except OSError as error:
-        # The directory need not exist.
-        if error.errno != errno.ENOENT:
-            raise
+    except FileNotFoundError:
+        pass
 
 def rmtree(path):
     try:
         _rmtree(path)
-    except OSError as error:
-        if error.errno != errno.ENOENT:
-            raise
+    except FileNotFoundError:
+        pass
 
 def make_legacy_pyc(source):
     """Move a PEP 3147 pyc/pyo file to its legacy pyc/pyo location.
@@ -332,7 +383,7 @@
         does not need to exist, however the PEP 3147 pyc file must exist.
     :return: The file system path to the legacy pyc file.
     """
-    pyc_file = imp.cache_from_source(source)
+    pyc_file = importlib.util.cache_from_source(source)
     up_one = os.path.dirname(os.path.abspath(source))
     legacy_pyc = os.path.join(up_one, source + ('c' if __debug__ else 'o'))
     os.rename(pyc_file, legacy_pyc)
@@ -351,15 +402,19 @@
         # combinations of PEP 3147 and legacy pyc and pyo files.
         unlink(source + 'c')
         unlink(source + 'o')
-        unlink(imp.cache_from_source(source, debug_override=True))
-        unlink(imp.cache_from_source(source, debug_override=False))
+        unlink(importlib.util.cache_from_source(source, debug_override=True))
+        unlink(importlib.util.cache_from_source(source, debug_override=False))
 
-# On some platforms, should not run gui test even if it is allowed
-# in `use_resources'.
-if sys.platform.startswith('win'):
-    import ctypes
-    import ctypes.wintypes
-    def _is_gui_available():
+# Check whether a gui is actually available
+def _is_gui_available():
+    if hasattr(_is_gui_available, 'result'):
+        return _is_gui_available.result
+    reason = None
+    if sys.platform.startswith('win'):
+        # if Python is running as a service (such as the buildbot service),
+        # gui interaction may be disallowed
+        import ctypes
+        import ctypes.wintypes
         UOI_FLAGS = 1
         WSF_VISIBLE = 0x0001
         class USEROBJECTFLAGS(ctypes.Structure):
@@ -379,29 +434,63 @@
             ctypes.byref(needed))
         if not res:
             raise ctypes.WinError()
-        return bool(uof.dwFlags & WSF_VISIBLE)
-else:
-    def _is_gui_available():
-        return True
+        if not bool(uof.dwFlags & WSF_VISIBLE):
+            reason = "gui not available (WSF_VISIBLE flag not set)"
+    elif sys.platform == 'darwin':
+        # The Aqua Tk implementations on OS X can abort the process if
+        # being called in an environment where a window server connection
+        # cannot be made, for instance when invoked by a buildbot or ssh
+        # process not running under the same user id as the current console
+        # user.  To avoid that, raise an exception if the window manager
+        # connection is not available.
+        from ctypes import cdll, c_int, pointer, Structure
+        from ctypes.util import find_library
+
+        app_services = cdll.LoadLibrary(find_library("ApplicationServices"))
+
+        if app_services.CGMainDisplayID() == 0:
+            reason = "gui tests cannot run without OS X window manager"
+        else:
+            class ProcessSerialNumber(Structure):
+                _fields_ = [("highLongOfPSN", c_int),
+                            ("lowLongOfPSN", c_int)]
+            psn = ProcessSerialNumber()
+            psn_p = pointer(psn)
+            if (  (app_services.GetCurrentProcess(psn_p) < 0) or
+                  (app_services.SetFrontProcess(psn_p) < 0) ):
+                reason = "cannot run without OS X gui process"
+
+    # check on every platform whether tkinter can actually do anything
+    if not reason:
+        try:
+            from tkinter import Tk
+            root = Tk()
+            root.update()
+            root.destroy()
+        except Exception as e:
+            err_string = str(e)
+            if len(err_string) > 50:
+                err_string = err_string[:50] + ' [...]'
+            reason = 'Tk unavailable due to {}: {}'.format(type(e).__name__,
+                                                           err_string)
+
+    _is_gui_available.reason = reason
+    _is_gui_available.result = not reason
+
+    return _is_gui_available.result
 
 def is_resource_enabled(resource):
-    """Test whether a resource is enabled.  Known resources are set by
-    regrtest.py."""
-    return use_resources is not None and resource in use_resources
+    """Test whether a resource is enabled.
+
+    Known resources are set by regrtest.py.  If not running under regrtest.py,
+    all resources are assumed enabled unless use_resources has been set.
+    """
+    return use_resources is None or resource in use_resources
 
 def requires(resource, msg=None):
-    """Raise ResourceDenied if the specified resource is not available.
-
-    If the caller's module is __main__ then automatically return True.  The
-    possibility of False being returned occurs when regrtest.py is
-    executing.
-    """
+    """Raise ResourceDenied if the specified resource is not available."""
     if resource == 'gui' and not _is_gui_available():
-        raise unittest.SkipTest("Cannot use the 'gui' resource")
-    # see if the caller's module is __main__ - if so, treat as if
-    # the resource was set
-    if sys._getframe(1).f_globals.get("__name__") == "__main__":
-        return
+        raise ResourceDenied(_is_gui_available.reason)
     if not is_resource_enabled(resource):
         if msg is None:
             msg = "Use of the %r resource not enabled" % resource
@@ -513,7 +602,7 @@
     the SO_REUSEADDR socket option having different semantics on Windows versus
     Unix/Linux.  On Unix, you can't have two AF_INET SOCK_STREAM sockets bind,
     listen and then accept connections on identical host/ports.  An EADDRINUSE
-    socket.error will be raised at some point (depending on the platform and
+    OSError will be raised at some point (depending on the platform and
     the order bind and listen were called on each socket).
 
     However, on Windows, if SO_REUSEADDR is set on the sockets, no EADDRINUSE
@@ -591,9 +680,9 @@
         sock = None
         try:
             sock = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
-            sock.bind(('::1', 0))
+            sock.bind((HOSTv6, 0))
             return True
-        except (socket.error, socket.gaierror):
+        except OSError:
             pass
         finally:
             if sock:
@@ -602,6 +691,18 @@
 
 IPV6_ENABLED = _is_ipv6_enabled()
 
+def system_must_validate_cert(f):
+    """Skip the test on TLS certificate validation failures."""
+    @functools.wraps(f)
+    def dec(*args, **kwargs):
+        try:
+            f(*args, **kwargs)
+        except IOError as e:
+            if "CERTIFICATE_VERIFY_FAILED" in str(e):
+                raise unittest.SkipTest("system does not contain "
+                                        "necessary certificates")
+            raise
+    return dec
 
 # A constant likely larger than the underlying OS pipe buffer size, to
 # make writes blocking.
@@ -940,7 +1041,12 @@
     requires('urlfetch')
 
     print('\tfetching %s ...' % url, file=get_original_stdout())
-    f = urllib.request.urlopen(url, timeout=15)
+    opener = urllib.request.build_opener()
+    if gzip:
+        opener.addheaders.append(('Accept-Encoding', 'gzip'))
+    f = opener.open(url, timeout=15)
+    if gzip and f.headers.get('Content-Encoding') == 'gzip':
+        f = gzip.GzipFile(fileobj=f)
     try:
         with open(fn, "wb") as out:
             s = f.read()
@@ -1180,9 +1286,9 @@
 # Context managers that raise ResourceDenied when various issues
 # with the Internet connection manifest themselves as exceptions.
 # XXX deprecate these and use transient_internet() instead
-time_out = TransientResource(IOError, errno=errno.ETIMEDOUT)
-socket_peer_reset = TransientResource(socket.error, errno=errno.ECONNRESET)
-ioerror_peer_reset = TransientResource(IOError, errno=errno.ECONNRESET)
+time_out = TransientResource(OSError, errno=errno.ETIMEDOUT)
+socket_peer_reset = TransientResource(OSError, errno=errno.ECONNRESET)
+ioerror_peer_reset = TransientResource(OSError, errno=errno.ECONNRESET)
 
 
 @contextlib.contextmanager
@@ -1218,6 +1324,8 @@
         n = getattr(err, 'errno', None)
         if (isinstance(err, socket.timeout) or
             (isinstance(err, socket.gaierror) and n in gai_errnos) or
+            (isinstance(err, urllib.error.URLError) and
+             "ConnectionRefusedError" in err.reason) or
             n in captured_errnos):
             if not verbose:
                 sys.stderr.write(denied.args[0] + "\n")
@@ -1228,17 +1336,17 @@
         if timeout is not None:
             socket.setdefaulttimeout(timeout)
         yield
-    except IOError as err:
+    except OSError as err:
         # urllib can wrap original socket errors multiple times (!), we must
         # unwrap to get at the original error.
         while True:
             a = err.args
-            if len(a) >= 1 and isinstance(a[0], IOError):
+            if len(a) >= 1 and isinstance(a[0], OSError):
                 err = a[0]
             # The error can also be wrapped as args[1]:
             #    except socket.error as msg:
-            #        raise IOError('socket error', msg).with_traceback(sys.exc_info()[2])
-            elif len(a) >= 2 and isinstance(a[1], IOError):
+            #        raise OSError('socket error', msg).with_traceback(sys.exc_info()[2])
+            elif len(a) >= 2 and isinstance(a[1], OSError):
                 err = a[1]
             else:
                 break
@@ -1565,7 +1673,7 @@
 
 def requires_resource(resource):
     if resource == 'gui' and not _is_gui_available():
-        return unittest.skip("resource 'gui' is not available")
+        return unittest.skip(_is_gui_available.reason)
     if is_resource_enabled(resource):
         return _id
     else:
@@ -1697,9 +1805,18 @@
 #=======================================================================
 # 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'))
+# Rather than trying to enumerate all the cases where docstrings may be
+# disabled, we just check for that directly
+
+def _check_docstrings():
+    """Just used to check if docstrings are enabled"""
+
+MISSING_C_DOCSTRINGS = (check_impl_detail() and
+                        sys.platform != 'win32' and
+                        not sysconfig.get_config_var('WITH_DOC_STRINGS'))
+
+HAVE_DOCSTRINGS = (_check_docstrings.__doc__ is not None and
+                   not MISSING_C_DOCSTRINGS)
 
 requires_docstrings = unittest.skipUnless(HAVE_DOCSTRINGS,
                                           "test requires docstrings")
@@ -1774,12 +1891,12 @@
 def threading_cleanup(*original_values):
     if not _thread:
         return
-    _MAX_COUNT = 10
+    _MAX_COUNT = 100
     for count in range(_MAX_COUNT):
         values = _thread._count(), threading._dangling
         if values == original_values:
             break
-        time.sleep(0.1)
+        time.sleep(0.01)
         gc_collect()
     # XXX print a warning in case of failure?
 
@@ -1881,7 +1998,7 @@
     This will typically be run on the result of the communicate() method
     of a subprocess.Popen object.
     """
-    stderr = re.sub(br"\[\d+ refs\]\r?\n?", b"", stderr).strip()
+    stderr = re.sub(br"\[\d+ refs, \d+ blocks\]\r?\n?", b"", stderr).strip()
     return stderr
 
 def args_from_interpreter_flags():
@@ -2012,27 +2129,81 @@
     return test if ok else unittest.skip(msg)(test)
 
 
-if sys.platform.startswith('win'):
-    @contextlib.contextmanager
-    def suppress_crash_popup():
-        """Disable Windows Error Reporting dialogs using SetErrorMode."""
-        # see http://msdn.microsoft.com/en-us/library/windows/desktop/ms680621%28v=vs.85%29.aspx
-        # GetErrorMode is not available on Windows XP and Windows Server 2003,
-        # but SetErrorMode returns the previous value, so we can use that
-        import ctypes
-        k32 = ctypes.windll.kernel32
-        SEM_NOGPFAULTERRORBOX = 0x02
-        old_error_mode = k32.SetErrorMode(SEM_NOGPFAULTERRORBOX)
-        k32.SetErrorMode(old_error_mode | SEM_NOGPFAULTERRORBOX)
-        try:
-            yield
-        finally:
-            k32.SetErrorMode(old_error_mode)
-else:
-    # this is a no-op for other platforms
-    @contextlib.contextmanager
-    def suppress_crash_popup():
-        yield
+def fs_is_case_insensitive(directory):
+    """Detects if the file system for the specified directory is case-insensitive."""
+    base_fp, base_path = tempfile.mkstemp(dir=directory)
+    case_path = base_path.upper()
+    if case_path == base_path:
+        case_path = base_path.lower()
+    try:
+        return os.path.samefile(base_path, case_path)
+    except FileNotFoundError:
+        return False
+    finally:
+        os.unlink(base_path)
+
+
+class SuppressCrashReport:
+    """Try to prevent a crash report from popping up.
+
+    On Windows, don't display the Windows Error Reporting dialog.  On UNIX,
+    disable the creation of coredump file.
+    """
+    old_value = None
+
+    def __enter__(self):
+        """On Windows, disable Windows Error Reporting dialogs using
+        SetErrorMode.
+
+        On UNIX, try to save the previous core file size limit, then set
+        soft limit to 0.
+        """
+        if sys.platform.startswith('win'):
+            # see http://msdn.microsoft.com/en-us/library/windows/desktop/ms680621.aspx
+            # GetErrorMode is not available on Windows XP and Windows Server 2003,
+            # but SetErrorMode returns the previous value, so we can use that
+            import ctypes
+            self._k32 = ctypes.windll.kernel32
+            SEM_NOGPFAULTERRORBOX = 0x02
+            self.old_value = self._k32.SetErrorMode(SEM_NOGPFAULTERRORBOX)
+            self._k32.SetErrorMode(self.old_value | SEM_NOGPFAULTERRORBOX)
+        else:
+            if resource is not None:
+                try:
+                    self.old_value = resource.getrlimit(resource.RLIMIT_CORE)
+                    resource.setrlimit(resource.RLIMIT_CORE,
+                                       (0, self.old_value[1]))
+                except (ValueError, OSError):
+                    pass
+            if sys.platform == 'darwin':
+                # Check if the 'Crash Reporter' on OSX was configured
+                # in 'Developer' mode and warn that it will get triggered
+                # when it is.
+                #
+                # This assumes that this context manager is used in tests
+                # that might trigger the next manager.
+                value = subprocess.Popen(['/usr/bin/defaults', 'read',
+                        'com.apple.CrashReporter', 'DialogType'],
+                        stdout=subprocess.PIPE).communicate()[0]
+                if value.strip() == b'developer':
+                    print("this test triggers the Crash Reporter, "
+                          "that is intentional", end='', flush=True)
+
+        return self
+
+    def __exit__(self, *ignore_exc):
+        """Restore Windows ErrorMode or core file behavior to initial value."""
+        if self.old_value is None:
+            return
+
+        if sys.platform.startswith('win'):
+            self._k32.SetErrorMode(self.old_value)
+        else:
+            if resource is not None:
+                try:
+                    resource.setrlimit(resource.RLIMIT_CORE, self.old_value)
+                except (ValueError, OSError):
+                    pass
 
 
 def patch(test_instance, object_to_patch, attr_name, new_value):
@@ -2067,3 +2238,23 @@
 
     # actually override the attribute
     setattr(object_to_patch, attr_name, new_value)
+
+
+def run_in_subinterp(code):
+    """
+    Run code in a subinterpreter. Raise unittest.SkipTest if the tracemalloc
+    module is enabled.
+    """
+    # Issue #10915, #15751: PyGILState_*() functions don't work with
+    # sub-interpreters, the tracemalloc module uses these functions internally
+    try:
+        import tracemalloc
+    except ImportError:
+        pass
+    else:
+        if tracemalloc.is_tracing():
+            raise unittest.SkipTest("run_in_subinterp() cannot be used "
+                                     "if tracemalloc module is tracing "
+                                     "memory allocations")
+    import _testcapi
+    return _testcapi.run_in_subinterp(code)
diff --git a/Lib/test/test___all__.py b/Lib/test/test___all__.py
index 608ec01..e94d984 100644
--- a/Lib/test/test___all__.py
+++ b/Lib/test/test___all__.py
@@ -29,17 +29,20 @@
         if not hasattr(sys.modules[modname], "__all__"):
             raise NoAll(modname)
         names = {}
-        try:
-            exec("from %s import *" % modname, names)
-        except Exception as e:
-            # Include the module name in the exception string
-            self.fail("__all__ failure in {}: {}: {}".format(
-                      modname, e.__class__.__name__, e))
-        if "__builtins__" in names:
-            del names["__builtins__"]
-        keys = set(names)
-        all = set(sys.modules[modname].__all__)
-        self.assertEqual(keys, all)
+        with self.subTest(module=modname):
+            try:
+                exec("from %s import *" % modname, names)
+            except Exception as e:
+                # Include the module name in the exception string
+                self.fail("__all__ failure in {}: {}: {}".format(
+                          modname, e.__class__.__name__, e))
+            if "__builtins__" in names:
+                del names["__builtins__"]
+            keys = set(names)
+            all_list = sys.modules[modname].__all__
+            all_set = set(all_list)
+            self.assertCountEqual(all_set, all_list, "in module {}".format(modname))
+            self.assertEqual(keys, all_set, "in module {}".format(modname))
 
     def walk_modules(self, basedir, modpath):
         for fn in sorted(os.listdir(basedir)):
@@ -69,13 +72,14 @@
 
         # rlcompleter needs special consideration; it import readline which
         # initializes GNU readline which calls setlocale(LC_CTYPE, "")... :-(
+        import locale
+        locale_tuple = locale.getlocale(locale.LC_CTYPE)
         try:
             import rlcompleter
-            import locale
         except ImportError:
             pass
-        else:
-            locale.setlocale(locale.LC_CTYPE, 'C')
+        finally:
+            locale.setlocale(locale.LC_CTYPE, locale_tuple)
 
         ignored = []
         failed_imports = []
@@ -110,8 +114,5 @@
             print('Following modules failed to be imported:', failed_imports)
 
 
-def test_main():
-    support.run_unittest(AllTest)
-
 if __name__ == "__main__":
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test__opcode.py b/Lib/test/test__opcode.py
new file mode 100644
index 0000000..0152e9d
--- /dev/null
+++ b/Lib/test/test__opcode.py
@@ -0,0 +1,23 @@
+import dis
+from test.support import run_unittest, import_module
+import unittest
+
+_opcode = import_module("_opcode")
+
+class OpcodeTests(unittest.TestCase):
+
+    def test_stack_effect(self):
+        self.assertEqual(_opcode.stack_effect(dis.opmap['POP_TOP']), -1)
+        self.assertEqual(_opcode.stack_effect(dis.opmap['DUP_TOP_TWO']), 2)
+        self.assertEqual(_opcode.stack_effect(dis.opmap['BUILD_SLICE'], 0), -1)
+        self.assertEqual(_opcode.stack_effect(dis.opmap['BUILD_SLICE'], 1), -1)
+        self.assertEqual(_opcode.stack_effect(dis.opmap['BUILD_SLICE'], 3), -2)
+        self.assertRaises(ValueError, _opcode.stack_effect, 30000)
+        self.assertRaises(ValueError, _opcode.stack_effect, dis.opmap['BUILD_SLICE'])
+        self.assertRaises(ValueError, _opcode.stack_effect, dis.opmap['POP_TOP'], 0)
+
+def test_main():
+    run_unittest(OpcodeTests)
+
+if __name__ == "__main__":
+    test_main()
diff --git a/Lib/test/test__osx_support.py b/Lib/test/test__osx_support.py
index fb159ec..5dcadf7 100644
--- a/Lib/test/test__osx_support.py
+++ b/Lib/test/test__osx_support.py
@@ -109,7 +109,9 @@
 
     def test__supports_universal_builds(self):
         import platform
-        self.assertEqual(platform.mac_ver()[0].split('.') >= ['10', '4'],
+        mac_ver_tuple = tuple(int(i) for i in
+                            platform.mac_ver()[0].split('.')[0:2])
+        self.assertEqual(mac_ver_tuple >= (10, 4),
                             _osx_support._supports_universal_builds())
 
     def test__find_appropriate_compiler(self):
diff --git a/Lib/test/test_abc.py b/Lib/test/test_abc.py
index d4d7556..93f9dae 100644
--- a/Lib/test/test_abc.py
+++ b/Lib/test/test_abc.py
@@ -68,6 +68,19 @@
 
 class TestABC(unittest.TestCase):
 
+    def test_ABC_helper(self):
+        # create an ABC using the helper class and perform basic checks
+        class C(abc.ABC):
+            @classmethod
+            @abc.abstractmethod
+            def foo(cls): return cls.__name__
+        self.assertEqual(type(C), abc.ABCMeta)
+        self.assertRaises(TypeError, C)
+        class D(C):
+            @classmethod
+            def foo(cls): return super().foo()
+        self.assertEqual(D.foo(), 'D')
+
     def test_abstractmethod_basics(self):
         @abc.abstractmethod
         def foo(self): pass
@@ -288,7 +301,10 @@
         b = B()
         self.assertFalse(isinstance(b, A))
         self.assertFalse(isinstance(b, (A,)))
+        token_old = abc.get_cache_token()
         A.register(B)
+        token_new = abc.get_cache_token()
+        self.assertNotEqual(token_old, token_new)
         self.assertTrue(isinstance(b, A))
         self.assertTrue(isinstance(b, (A,)))
 
diff --git a/Lib/test/test_aifc.py b/Lib/test/test_aifc.py
index 10260e3..ab51437 100644
--- a/Lib/test/test_aifc.py
+++ b/Lib/test/test_aifc.py
@@ -1,6 +1,7 @@
 from test.support import findfile, TESTFN, unlink
 import unittest
 from test import audiotests
+from audioop import byteswap
 import os
 import io
 import sys
@@ -119,7 +120,7 @@
       E5040CBC 617C0A3C 08BC0A3C 2C7C0B3C 517C0E3C 8A8410FC B6840EBC 457C0A3C \
       """)
     if sys.byteorder != 'big':
-        frames = audiotests.byteswap2(frames)
+        frames = byteswap(frames, 2)
 
 
 class AifcALAWTest(AifcTest, unittest.TestCase):
@@ -140,7 +141,7 @@
       E4800CC0 62000A40 08C00A40 2B000B40 52000E40 8A001180 B6000EC0 46000A40 \
       """)
     if sys.byteorder != 'big':
-        frames = audiotests.byteswap2(frames)
+        frames = byteswap(frames, 2)
 
 
 class AifcMiscTest(audiotests.AudioTests, unittest.TestCase):
@@ -149,6 +150,21 @@
         #This file contains chunk types aifc doesn't recognize.
         self.f = aifc.open(findfile('Sine-1000Hz-300ms.aif'))
 
+    def test_params_added(self):
+        f = self.f = aifc.open(TESTFN, 'wb')
+        f.aiff()
+        f.setparams((1, 1, 1, 1, b'NONE', b''))
+        f.close()
+
+        f = self.f = aifc.open(TESTFN, 'rb')
+        params = f.getparams()
+        self.assertEqual(params.nchannels, f.getnchannels())
+        self.assertEqual(params.sampwidth, f.getsampwidth())
+        self.assertEqual(params.framerate, f.getframerate())
+        self.assertEqual(params.nframes, f.getnframes())
+        self.assertEqual(params.comptype, f.getcomptype())
+        self.assertEqual(params.compname, f.getcompname())
+
     def test_write_header_comptype_sampwidth(self):
         for comptype in (b'ULAW', b'ulaw', b'ALAW', b'alaw', b'G722'):
             fout = aifc.open(io.BytesIO(), 'wb')
@@ -352,12 +368,14 @@
 
     def test_write_aiff_by_extension(self):
         sampwidth = 2
-        fout = self.fout = aifc.open(TESTFN + '.aiff', 'wb')
+        filename = TESTFN + '.aiff'
+        fout = self.fout = aifc.open(filename, 'wb')
+        self.addCleanup(unlink, filename)
         fout.setparams((1, sampwidth, 1, 1, b'ULAW', b''))
         frames = b'\x00' * fout.getnchannels() * sampwidth
         fout.writeframes(frames)
         fout.close()
-        f = self.f = aifc.open(TESTFN + '.aiff', 'rb')
+        f = self.f = aifc.open(filename, 'rb')
         self.assertEqual(f.getcomptype(), b'NONE')
         f.close()
 
diff --git a/Lib/test/test_argparse.py b/Lib/test/test_argparse.py
index 9cb15c7..1164f3f 100644
--- a/Lib/test/test_argparse.py
+++ b/Lib/test/test_argparse.py
@@ -14,6 +14,7 @@
 from io import StringIO
 
 from test import support
+from unittest import mock
 class StdIOBuffer(StringIO):
     pass
 
@@ -46,6 +47,9 @@
 
     def tearDown(self):
         os.chdir(self.old_dir)
+        for root, dirs, files in os.walk(self.temp_dir, topdown=False):
+            for name in files:
+                os.chmod(os.path.join(self.temp_dir, name), stat.S_IWRITE)
         shutil.rmtree(self.temp_dir, True)
 
     def create_readonly_file(self, filename):
@@ -231,8 +235,8 @@
                 parser = self._get_parser(tester)
                 for args_str in tester.failures:
                     args = args_str.split()
-                    raises = tester.assertRaises
-                    raises(ArgumentParserError, parser.parse_args, args)
+                    with tester.assertRaises(ArgumentParserError, msg=args):
+                        parser.parse_args(args)
 
             def test_successes(self, tester):
                 parser = self._get_parser(tester)
@@ -640,7 +644,7 @@
 
 
 class TestOptionalsRequired(ParserTestCase):
-    """Tests the an optional action that is required"""
+    """Tests an optional action that is required"""
 
     argument_signatures = [
         Sig('-x', type=int, required=True),
@@ -1421,6 +1425,19 @@
         type = argparse.FileType('wb', 1)
         self.assertEqual("FileType('wb', 1)", repr(type))
 
+    def test_r_latin(self):
+        type = argparse.FileType('r', encoding='latin_1')
+        self.assertEqual("FileType('r', encoding='latin_1')", repr(type))
+
+    def test_w_big5_ignore(self):
+        type = argparse.FileType('w', encoding='big5', errors='ignore')
+        self.assertEqual("FileType('w', encoding='big5', errors='ignore')",
+                         repr(type))
+
+    def test_r_1_replace(self):
+        type = argparse.FileType('r', 1, errors='replace')
+        self.assertEqual("FileType('r', 1, errors='replace')", repr(type))
+
 
 class RFile(object):
     seen = {}
@@ -1557,6 +1574,24 @@
     ]
 
 
+class TestFileTypeOpenArgs(TestCase):
+    """Test that open (the builtin) is correctly called"""
+
+    def test_open_args(self):
+        FT = argparse.FileType
+        cases = [
+            (FT('rb'), ('rb', -1, None, None)),
+            (FT('w', 1), ('w', 1, None, None)),
+            (FT('w', errors='replace'), ('w', -1, None, 'replace')),
+            (FT('wb', encoding='big5'), ('wb', -1, 'big5', None)),
+            (FT('w', 0, 'l1', 'strict'), ('w', 0, 'l1', 'strict')),
+        ]
+        with mock.patch('builtins.open') as m:
+            for type, args in cases:
+                type('foo')
+                m.assert_called_with('foo', *args)
+
+
 class TestTypeCallable(ParserTestCase):
     """Test some callables as option/argument types"""
 
@@ -2760,6 +2795,13 @@
         parser = ErrorRaisingArgumentParser(parents=[parent])
         self.assertEqual(NS(x='foo'), parser.parse_args([]))
 
+    def test_set_defaults_on_parent_and_subparser(self):
+        parser = argparse.ArgumentParser()
+        xparser = parser.add_subparsers().add_parser('X')
+        parser.set_defaults(foo=1)
+        xparser.set_defaults(foo=2)
+        self.assertEqual(NS(foo=2), parser.parse_args(['X']))
+
     def test_set_defaults_same_as_add_argument(self):
         parser = ErrorRaisingArgumentParser()
         parser.set_defaults(w='W', x='X', y='Y', z='Z')
@@ -4381,7 +4423,7 @@
     def test_version_format(self):
         parser = ErrorRaisingArgumentParser(prog='PPP')
         parser.add_argument('-v', '--version', action='version', version='%(prog)s 3.5')
-        msg = self._get_error(parser.parse_args, ['-v']).stderr
+        msg = self._get_error(parser.parse_args, ['-v']).stdout
         self.assertEqual('PPP 3.5\n', msg)
 
     def test_version_no_help(self):
@@ -4394,7 +4436,7 @@
     def test_version_action(self):
         parser = ErrorRaisingArgumentParser(prog='XXX')
         parser.add_argument('-V', action='version', version='%(prog)s 3.7')
-        msg = self._get_error(parser.parse_args, ['-V']).stderr
+        msg = self._get_error(parser.parse_args, ['-V']).stdout
         self.assertEqual('XXX 3.7\n', msg)
 
     def test_no_help(self):
@@ -4516,6 +4558,12 @@
         self.assertTrue(ns2 != ns3)
         self.assertTrue(ns2 != ns4)
 
+    def test_equality_returns_notimplemeted(self):
+        # See issue 21481
+        ns = argparse.Namespace(a=1, b=2)
+        self.assertIs(ns.__eq__(None), NotImplemented)
+        self.assertIs(ns.__ne__(None), NotImplemented)
+
 
 # ===================
 # File encoding tests
diff --git a/Lib/test/test_array.py b/Lib/test/test_array.py
index d68284f..07c9bf9 100644
--- a/Lib/test/test_array.py
+++ b/Lib/test/test_array.py
@@ -285,17 +285,18 @@
 
     def test_iterator_pickle(self):
         data = array.array(self.typecode, self.example)
-        orgit = iter(data)
-        d = pickle.dumps(orgit)
-        it = pickle.loads(d)
-        self.assertEqual(type(orgit), type(it))
-        self.assertEqual(list(it), list(data))
-
-        if len(data):
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            orgit = iter(data)
+            d = pickle.dumps(orgit, proto)
             it = pickle.loads(d)
-            next(it)
-            d = pickle.dumps(it)
-            self.assertEqual(list(it), list(data)[1:])
+            self.assertEqual(type(orgit), type(it))
+            self.assertEqual(list(it), list(data))
+
+            if len(data):
+                it = pickle.loads(d)
+                next(it)
+                d = pickle.dumps(it, proto)
+                self.assertEqual(list(it), list(data)[1:])
 
     def test_insert(self):
         a = array.array(self.typecode, self.example)
@@ -353,12 +354,12 @@
             support.unlink(support.TESTFN)
 
     def test_fromfile_ioerror(self):
-        # Issue #5395: Check if fromfile raises a proper IOError
+        # Issue #5395: Check if fromfile raises a proper OSError
         # instead of EOFError.
         a = array.array(self.typecode)
         f = open(support.TESTFN, 'wb')
         try:
-            self.assertRaises(IOError, a.fromfile, f, len(self.example))
+            self.assertRaises(OSError, a.fromfile, f, len(self.example))
         finally:
             f.close()
             support.unlink(support.TESTFN)
@@ -1026,6 +1027,18 @@
         basesize = support.calcvobjsize('Pn2Pi')
         support.check_sizeof(self, a, basesize)
 
+    def test_initialize_with_unicode(self):
+        if self.typecode != 'u':
+            with self.assertRaises(TypeError) as cm:
+                a = array.array(self.typecode, 'foo')
+            self.assertIn("cannot use a str", str(cm.exception))
+            with self.assertRaises(TypeError) as cm:
+                a = array.array(self.typecode, array.array('u', 'foo'))
+            self.assertIn("cannot use a unicode array", str(cm.exception))
+        else:
+            a = array.array(self.typecode, "foo")
+            a = array.array(self.typecode, array.array('u', 'foo'))
+
 
 class StringTest(BaseTest):
 
diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py
index 6352888..a533f86 100644
--- a/Lib/test/test_ast.py
+++ b/Lib/test/test_ast.py
@@ -37,7 +37,7 @@
     # FunctionDef with kwargs
     "def f(**kwargs): pass",
     # FunctionDef with all kind of args
-    "def f(a, b=1, c=None, d=[], e={}, *args, **kwargs): pass",
+    "def f(a, b=1, c=None, d=[], e={}, *args, f=42, **kwargs): pass",
     # ClassDef
     "class C:pass",
     # ClassDef, new style class
@@ -262,14 +262,13 @@
 
     def test_arguments(self):
         x = ast.arguments()
-        self.assertEqual(x._fields, ('args', 'vararg', 'varargannotation',
-                                      'kwonlyargs', 'kwarg', 'kwargannotation',
-                                      'defaults', 'kw_defaults'))
+        self.assertEqual(x._fields, ('args', 'vararg', 'kwonlyargs',
+                                      'kw_defaults', 'kwarg', 'defaults'))
 
         with self.assertRaises(AttributeError):
             x.vararg
 
-        x = ast.arguments(*range(1, 9))
+        x = ast.arguments(*range(1, 7))
         self.assertEqual(x.vararg, 2)
 
     def test_field_attr_writable(self):
@@ -560,8 +559,8 @@
         self.mod(m, "must have Load context", "eval")
 
     def _check_arguments(self, fac, check):
-        def arguments(args=None, vararg=None, varargannotation=None,
-                      kwonlyargs=None, kwarg=None, kwargannotation=None,
+        def arguments(args=None, vararg=None,
+                      kwonlyargs=None, kwarg=None,
                       defaults=None, kw_defaults=None):
             if args is None:
                 args = []
@@ -571,20 +570,12 @@
                 defaults = []
             if kw_defaults is None:
                 kw_defaults = []
-            args = ast.arguments(args, vararg, varargannotation, kwonlyargs,
-                                 kwarg, kwargannotation, defaults, kw_defaults)
+            args = ast.arguments(args, vararg, kwonlyargs, kw_defaults,
+                                 kwarg, defaults)
             return fac(args)
         args = [ast.arg("x", ast.Name("x", ast.Store()))]
         check(arguments(args=args), "must have Load context")
-        check(arguments(varargannotation=ast.Num(3)),
-              "varargannotation but no vararg")
-        check(arguments(varargannotation=ast.Name("x", ast.Store()), vararg="x"),
-                         "must have Load context")
         check(arguments(kwonlyargs=args), "must have Load context")
-        check(arguments(kwargannotation=ast.Num(42)),
-                       "kwargannotation but no kwarg")
-        check(arguments(kwargannotation=ast.Name("x", ast.Store()),
-                          kwarg="x"), "must have Load context")
         check(arguments(defaults=[ast.Num(3)]),
                        "more positional defaults than args")
         check(arguments(kw_defaults=[ast.Num(4)]),
@@ -599,7 +590,7 @@
                           "must have Load context")
 
     def test_funcdef(self):
-        a = ast.arguments([], None, None, [], None, None, [], [])
+        a = ast.arguments([], None, [], [], None, [])
         f = ast.FunctionDef("x", a, [], [], None)
         self.stmt(f, "empty body on FunctionDef")
         f = ast.FunctionDef("x", a, [ast.Pass()], [ast.Name("x", ast.Store())],
@@ -770,7 +761,7 @@
         self.expr(u, "must have Load context")
 
     def test_lambda(self):
-        a = ast.arguments([], None, None, [], None, None, [], [])
+        a = ast.arguments([], None, [], [], None, [])
         self.expr(ast.Lambda(a, ast.Name("x", ast.Store())),
                   "must have Load context")
         def fac(args):
@@ -928,6 +919,9 @@
     def test_tuple(self):
         self._sequence(ast.Tuple)
 
+    def test_nameconstant(self):
+        self.expr(ast.NameConstant(4), "singleton must be True, False, or None")
+
     def test_stdlib_validates(self):
         stdlib = os.path.dirname(ast.__file__)
         tests = [fn for fn in os.listdir(stdlib) if fn.endswith(".py")]
@@ -936,13 +930,10 @@
             fn = os.path.join(stdlib, module)
             with open(fn, "r", encoding="utf-8") as fp:
                 source = fp.read()
-            mod = ast.parse(source)
+            mod = ast.parse(source, fn)
             compile(mod, fn, "exec")
 
 
-def test_main():
-    support.run_unittest(AST_Tests, ASTHelpers_Test, ASTValidatorTests)
-
 def main():
     if __name__ != '__main__':
         return
@@ -955,20 +946,20 @@
             print("]")
         print("main()")
         raise SystemExit
-    test_main()
+    unittest.main()
 
 #### EVERYTHING BELOW IS GENERATED #####
 exec_results = [
-('Module', [('Expr', (1, 0), ('Name', (1, 0), 'None', ('Load',)))]),
-('Module', [('FunctionDef', (1, 0), 'f', ('arguments', [], None, None, [], None, None, [], []), [('Pass', (1, 9))], [], None)]),
-('Module', [('FunctionDef', (1, 0), 'f', ('arguments', [('arg', 'a', None)], None, None, [], None, None, [], []), [('Pass', (1, 10))], [], None)]),
-('Module', [('FunctionDef', (1, 0), 'f', ('arguments', [('arg', 'a', None)], None, None, [], None, None, [('Num', (1, 8), 0)], []), [('Pass', (1, 12))], [], None)]),
-('Module', [('FunctionDef', (1, 0), 'f', ('arguments', [], 'args', None, [], None, None, [], []), [('Pass', (1, 14))], [], None)]),
-('Module', [('FunctionDef', (1, 0), 'f', ('arguments', [], None, None, [], 'kwargs', None, [], []), [('Pass', (1, 17))], [], None)]),
-('Module', [('FunctionDef', (1, 0), 'f', ('arguments', [('arg', 'a', None), ('arg', 'b', None), ('arg', 'c', None), ('arg', 'd', None), ('arg', 'e', None)], 'args', None, [], 'kwargs', None, [('Num', (1, 11), 1), ('Name', (1, 16), 'None', ('Load',)), ('List', (1, 24), [], ('Load',)), ('Dict', (1, 30), [], [])], []), [('Pass', (1, 52))], [], None)]),
+('Module', [('Expr', (1, 0), ('NameConstant', (1, 0), None))]),
+('Module', [('FunctionDef', (1, 0), 'f', ('arguments', [], None, [], [], None, []), [('Pass', (1, 9))], [], None)]),
+('Module', [('FunctionDef', (1, 0), 'f', ('arguments', [('arg', (1, 6), 'a', None)], None, [], [], None, []), [('Pass', (1, 10))], [], None)]),
+('Module', [('FunctionDef', (1, 0), 'f', ('arguments', [('arg', (1, 6), 'a', None)], None, [], [], None, [('Num', (1, 8), 0)]), [('Pass', (1, 12))], [], None)]),
+('Module', [('FunctionDef', (1, 0), 'f', ('arguments', [], ('arg', (1, 7), 'args', None), [], [], None, []), [('Pass', (1, 14))], [], None)]),
+('Module', [('FunctionDef', (1, 0), 'f', ('arguments', [], None, [], [], ('arg', (1, 8), 'kwargs', None), []), [('Pass', (1, 17))], [], None)]),
+('Module', [('FunctionDef', (1, 0), 'f', ('arguments', [('arg', (1, 6), 'a', None), ('arg', (1, 9), 'b', None), ('arg', (1, 14), 'c', None), ('arg', (1, 22), 'd', None), ('arg', (1, 28), 'e', None)], ('arg', (1, 35), 'args', None), [('arg', (1, 41), 'f', None)], [('Num', (1, 43), 42)], ('arg', (1, 49), 'kwargs', None), [('Num', (1, 11), 1), ('NameConstant', (1, 16), None), ('List', (1, 24), [], ('Load',)), ('Dict', (1, 30), [], [])]), [('Pass', (1, 58))], [], None)]),
 ('Module', [('ClassDef', (1, 0), 'C', [], [], None, None, [('Pass', (1, 8))], [])]),
 ('Module', [('ClassDef', (1, 0), 'C', [('Name', (1, 8), 'object', ('Load',))], [], None, None, [('Pass', (1, 17))], [])]),
-('Module', [('FunctionDef', (1, 0), 'f', ('arguments', [], None, None, [], None, None, [], []), [('Return', (1, 8), ('Num', (1, 15), 1))], [], None)]),
+('Module', [('FunctionDef', (1, 0), 'f', ('arguments', [], None, [], [], None, []), [('Return', (1, 8), ('Num', (1, 15), 1))], [], None)]),
 ('Module', [('Delete', (1, 0), [('Name', (1, 4), 'v', ('Del',))])]),
 ('Module', [('Assign', (1, 0), [('Name', (1, 0), 'v', ('Store',))], ('Num', (1, 4), 1))]),
 ('Module', [('AugAssign', (1, 0), ('Name', (1, 0), 'v', ('Store',)), ('Add',), ('Num', (1, 5), 1))]),
@@ -1002,14 +993,14 @@
 ('Interactive', [('Expr', (1, 0), ('BinOp', (1, 0), ('Num', (1, 0), 1), ('Add',), ('Num', (1, 2), 2)))]),
 ]
 eval_results = [
-('Expression', ('Name', (1, 0), 'None', ('Load',))),
+('Expression', ('NameConstant', (1, 0), None)),
 ('Expression', ('BoolOp', (1, 0), ('And',), [('Name', (1, 0), 'a', ('Load',)), ('Name', (1, 6), 'b', ('Load',))])),
 ('Expression', ('BinOp', (1, 0), ('Name', (1, 0), 'a', ('Load',)), ('Add',), ('Name', (1, 4), 'b', ('Load',)))),
 ('Expression', ('UnaryOp', (1, 0), ('Not',), ('Name', (1, 4), 'v', ('Load',)))),
-('Expression', ('Lambda', (1, 0), ('arguments', [], None, None, [], None, None, [], []), ('Name', (1, 7), 'None', ('Load',)))),
+('Expression', ('Lambda', (1, 0), ('arguments', [], None, [], [], None, []), ('NameConstant', (1, 7), None))),
 ('Expression', ('Dict', (1, 0), [('Num', (1, 2), 1)], [('Num', (1, 4), 2)])),
 ('Expression', ('Dict', (1, 0), [], [])),
-('Expression', ('Set', (1, 0), [('Name', (1, 1), 'None', ('Load',))])),
+('Expression', ('Set', (1, 0), [('NameConstant', (1, 1), None)])),
 ('Expression', ('Dict', (1, 0), [('Num', (2, 6), 1)], [('Num', (4, 10), 2)])),
 ('Expression', ('ListComp', (1, 1), ('Name', (1, 1), 'a', ('Load',)), [('comprehension', ('Name', (1, 7), 'b', ('Store',)), ('Name', (1, 12), 'c', ('Load',)), [('Name', (1, 17), 'd', ('Load',))])])),
 ('Expression', ('GeneratorExp', (1, 1), ('Name', (1, 1), 'a', ('Load',)), [('comprehension', ('Name', (1, 7), 'b', ('Store',)), ('Name', (1, 12), 'c', ('Load',)), [('Name', (1, 17), 'd', ('Load',))])])),
diff --git a/Lib/test/test_asynchat.py b/Lib/test/test_asynchat.py
index c79fe6f..2dc9d0c 100644
--- a/Lib/test/test_asynchat.py
+++ b/Lib/test/test_asynchat.py
@@ -5,9 +5,14 @@
 # If this fails, the test will be skipped.
 thread = support.import_module('_thread')
 
-import asyncore, asynchat, socket, time
-import unittest
+import asynchat
+import asyncore
+import errno
+import socket
 import sys
+import time
+import unittest
+import unittest.mock
 try:
     import threading
 except ImportError:
@@ -15,6 +20,7 @@
 
 HOST = support.HOST
 SERVER_QUIT = b'QUIT\n'
+TIMEOUT = 3.0
 
 if threading:
     class echo_server(threading.Thread):
@@ -27,8 +33,8 @@
             self.event = event
             self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
             self.port = support.bind_port(self.sock)
-            # This will be set if the client wants us to wait before echoing data
-            # back.
+            # This will be set if the client wants us to wait before echoing
+            # data back.
             self.start_resend_event = None
 
         def run(self):
@@ -51,8 +57,8 @@
 
             # re-send entire set of collected data
             try:
-                # this may fail on some tests, such as test_close_when_done, since
-                # the client closes the channel when it's done sending
+                # this may fail on some tests, such as test_close_when_done,
+                # since the client closes the channel when it's done sending
                 while self.buffer:
                     n = conn.send(self.buffer[:self.chunk_size])
                     time.sleep(0.001)
@@ -95,7 +101,7 @@
         s.start()
         event.wait()
         event.clear()
-        time.sleep(0.01) # Give server time to start accepting.
+        time.sleep(0.01)   # Give server time to start accepting.
         return s, event
 
 
@@ -103,10 +109,10 @@
 class TestAsynchat(unittest.TestCase):
     usepoll = False
 
-    def setUp (self):
+    def setUp(self):
         self._threads = support.threading_setup()
 
-    def tearDown (self):
+    def tearDown(self):
         support.threading_cleanup(*self._threads)
 
     def line_terminator_check(self, term, server_chunk):
@@ -116,14 +122,16 @@
         s.start()
         event.wait()
         event.clear()
-        time.sleep(0.01) # Give server time to start accepting.
+        time.sleep(0.01)   # Give server time to start accepting.
         c = echo_client(term, s.port)
         c.push(b"hello ")
         c.push(b"world" + term)
         c.push(b"I'm not dead yet!" + term)
         c.push(SERVER_QUIT)
         asyncore.loop(use_poll=self.usepoll, count=300, timeout=.01)
-        s.join()
+        s.join(timeout=TIMEOUT)
+        if s.is_alive():
+            self.fail("join() timed out")
 
         self.assertEqual(c.contents, [b"hello world", b"I'm not dead yet!"])
 
@@ -133,17 +141,17 @@
 
     def test_line_terminator1(self):
         # test one-character terminator
-        for l in (1,2,3):
+        for l in (1, 2, 3):
             self.line_terminator_check(b'\n', l)
 
     def test_line_terminator2(self):
         # test two-character terminator
-        for l in (1,2,3):
+        for l in (1, 2, 3):
             self.line_terminator_check(b'\r\n', l)
 
     def test_line_terminator3(self):
         # test three-character terminator
-        for l in (1,2,3):
+        for l in (1, 2, 3):
             self.line_terminator_check(b'qqq', l)
 
     def numeric_terminator_check(self, termlen):
@@ -154,7 +162,9 @@
         c.push(data)
         c.push(SERVER_QUIT)
         asyncore.loop(use_poll=self.usepoll, count=300, timeout=.01)
-        s.join()
+        s.join(timeout=TIMEOUT)
+        if s.is_alive():
+            self.fail("join() timed out")
 
         self.assertEqual(c.contents, [data[:termlen]])
 
@@ -174,7 +184,9 @@
         c.push(data)
         c.push(SERVER_QUIT)
         asyncore.loop(use_poll=self.usepoll, count=300, timeout=.01)
-        s.join()
+        s.join(timeout=TIMEOUT)
+        if s.is_alive():
+            self.fail("join() timed out")
 
         self.assertEqual(c.contents, [])
         self.assertEqual(c.buffer, data)
@@ -186,7 +198,9 @@
         p = asynchat.simple_producer(data+SERVER_QUIT, buffer_size=8)
         c.push_with_producer(p)
         asyncore.loop(use_poll=self.usepoll, count=300, timeout=.01)
-        s.join()
+        s.join(timeout=TIMEOUT)
+        if s.is_alive():
+            self.fail("join() timed out")
 
         self.assertEqual(c.contents, [b"hello world", b"I'm not dead yet!"])
 
@@ -196,7 +210,9 @@
         data = b"hello world\nI'm not dead yet!\n"
         c.push_with_producer(data+SERVER_QUIT)
         asyncore.loop(use_poll=self.usepoll, count=300, timeout=.01)
-        s.join()
+        s.join(timeout=TIMEOUT)
+        if s.is_alive():
+            self.fail("join() timed out")
 
         self.assertEqual(c.contents, [b"hello world", b"I'm not dead yet!"])
 
@@ -207,7 +223,9 @@
         c.push(b"hello world\n\nI'm not dead yet!\n")
         c.push(SERVER_QUIT)
         asyncore.loop(use_poll=self.usepoll, count=300, timeout=.01)
-        s.join()
+        s.join(timeout=TIMEOUT)
+        if s.is_alive():
+            self.fail("join() timed out")
 
         self.assertEqual(c.contents,
                          [b"hello world", b"", b"I'm not dead yet!"])
@@ -226,7 +244,9 @@
         # where the server echoes all of its data before we can check that it
         # got any down below.
         s.start_resend_event.set()
-        s.join()
+        s.join(timeout=TIMEOUT)
+        if s.is_alive():
+            self.fail("join() timed out")
 
         self.assertEqual(c.contents, [])
         # the server might have been able to send a byte or two back, but this
@@ -234,15 +254,48 @@
         # (which could still result in the client not having received anything)
         self.assertGreater(len(s.buffer), 0)
 
+    def test_push(self):
+        # Issue #12523: push() should raise a TypeError if it doesn't get
+        # a bytes string
+        s, event = start_echo_server()
+        c = echo_client(b'\n', s.port)
+        data = b'bytes\n'
+        c.push(data)
+        c.push(bytearray(data))
+        c.push(memoryview(data))
+        self.assertRaises(TypeError, c.push, 10)
+        self.assertRaises(TypeError, c.push, 'unicode')
+        c.push(SERVER_QUIT)
+        asyncore.loop(use_poll=self.usepoll, count=300, timeout=.01)
+        s.join(timeout=TIMEOUT)
+        self.assertEqual(c.contents, [b'bytes', b'bytes', b'bytes'])
+
 
 class TestAsynchat_WithPoll(TestAsynchat):
     usepoll = True
 
+
+class TestAsynchatMocked(unittest.TestCase):
+    def test_blockingioerror(self):
+        # Issue #16133: handle_read() must ignore BlockingIOError
+        sock = unittest.mock.Mock()
+        sock.recv.side_effect = BlockingIOError(errno.EAGAIN)
+
+        dispatcher = asynchat.async_chat()
+        dispatcher.set_socket(sock)
+        self.addCleanup(dispatcher.del_channel)
+
+        with unittest.mock.patch.object(dispatcher, 'handle_error') as error:
+            dispatcher.handle_read()
+        self.assertFalse(error.called)
+
+
 class TestHelperFunctions(unittest.TestCase):
     def test_find_prefix_at_end(self):
         self.assertEqual(asynchat.find_prefix_at_end("qwerty\r", "\r\n"), 1)
         self.assertEqual(asynchat.find_prefix_at_end("qwertydkjf", "\r\n"), 0)
 
+
 class TestFifo(unittest.TestCase):
     def test_basic(self):
         f = asynchat.fifo()
@@ -268,9 +321,13 @@
         self.assertEqual(f.pop(), (0, None))
 
 
-def test_main(verbose=None):
-    support.run_unittest(TestAsynchat, TestAsynchat_WithPoll,
-                              TestHelperFunctions, TestFifo)
+class TestNotConnected(unittest.TestCase):
+    def test_disallow_negative_terminator(self):
+        # Issue #11259
+        client = asynchat.async_chat()
+        self.assertRaises(ValueError, client.set_terminator, -1)
+
+
 
 if __name__ == "__main__":
-    test_main(verbose=True)
+    unittest.main()
diff --git a/Lib/test/test_asyncio/__init__.py b/Lib/test/test_asyncio/__init__.py
new file mode 100644
index 0000000..80a9eea
--- /dev/null
+++ b/Lib/test/test_asyncio/__init__.py
@@ -0,0 +1,10 @@
+import os
+from test.support import load_package_tests, import_module
+
+# Skip tests if we don't have threading.
+import_module('threading')
+# Skip tests if we don't have concurrent.futures.
+import_module('concurrent.futures')
+
+def load_tests(*args):
+    return load_package_tests(os.path.dirname(__file__), *args)
diff --git a/Lib/test/test_asyncio/__main__.py b/Lib/test/test_asyncio/__main__.py
new file mode 100644
index 0000000..40a23a2
--- /dev/null
+++ b/Lib/test/test_asyncio/__main__.py
@@ -0,0 +1,4 @@
+from . import load_tests
+import unittest
+
+unittest.main()
diff --git a/Lib/test/test_asyncio/echo.py b/Lib/test/test_asyncio/echo.py
new file mode 100644
index 0000000..006364b
--- /dev/null
+++ b/Lib/test/test_asyncio/echo.py
@@ -0,0 +1,8 @@
+import os
+
+if __name__ == '__main__':
+    while True:
+        buf = os.read(0, 1024)
+        if not buf:
+            break
+        os.write(1, buf)
diff --git a/Lib/test/test_asyncio/echo2.py b/Lib/test/test_asyncio/echo2.py
new file mode 100644
index 0000000..e83ca09
--- /dev/null
+++ b/Lib/test/test_asyncio/echo2.py
@@ -0,0 +1,6 @@
+import os
+
+if __name__ == '__main__':
+    buf = os.read(0, 1024)
+    os.write(1, b'OUT:'+buf)
+    os.write(2, b'ERR:'+buf)
diff --git a/Lib/test/test_asyncio/echo3.py b/Lib/test/test_asyncio/echo3.py
new file mode 100644
index 0000000..0644967
--- /dev/null
+++ b/Lib/test/test_asyncio/echo3.py
@@ -0,0 +1,11 @@
+import os
+
+if __name__ == '__main__':
+    while True:
+        buf = os.read(0, 1024)
+        if not buf:
+            break
+        try:
+            os.write(1, b'OUT:'+buf)
+        except OSError as ex:
+            os.write(2, b'ERR:' + ex.__class__.__name__.encode('ascii'))
diff --git a/Lib/test/test_asyncio/keycert3.pem b/Lib/test/test_asyncio/keycert3.pem
new file mode 100644
index 0000000..5bfa62c
--- /dev/null
+++ b/Lib/test/test_asyncio/keycert3.pem
@@ -0,0 +1,73 @@
+-----BEGIN PRIVATE KEY-----
+MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAMLgD0kAKDb5cFyP
+jbwNfR5CtewdXC+kMXAWD8DLxiTTvhMW7qVnlwOm36mZlszHKvsRf05lT4pegiFM
+9z2j1OlaN+ci/X7NU22TNN6crYSiN77FjYJP464j876ndSxyD+rzys386T+1r1aZ
+aggEdkj1TsSsv1zWIYKlPIjlvhuxAgMBAAECgYA0aH+T2Vf3WOPv8KdkcJg6gCRe
+yJKXOWgWRcicx/CUzOEsTxmFIDPLxqAWA3k7v0B+3vjGw5Y9lycV/5XqXNoQI14j
+y09iNsumds13u5AKkGdTJnZhQ7UKdoVHfuP44ZdOv/rJ5/VD6F4zWywpe90pcbK+
+AWDVtusgGQBSieEl1QJBAOyVrUG5l2yoUBtd2zr/kiGm/DYyXlIthQO/A3/LngDW
+5/ydGxVsT7lAVOgCsoT+0L4efTh90PjzW8LPQrPBWVMCQQDS3h/FtYYd5lfz+FNL
+9CEe1F1w9l8P749uNUD0g317zv1tatIqVCsQWHfVHNdVvfQ+vSFw38OORO00Xqs9
+1GJrAkBkoXXEkxCZoy4PteheO/8IWWLGGr6L7di6MzFl1lIqwT6D8L9oaV2vynFT
+DnKop0pa09Unhjyw57KMNmSE2SUJAkEArloTEzpgRmCq4IK2/NpCeGdHS5uqRlbh
+1VIa/xGps7EWQl5Mn8swQDel/YP3WGHTjfx7pgSegQfkyaRtGpZ9OQJAa9Vumj8m
+JAAtI0Bnga8hgQx7BhTQY4CadDxyiRGOGYhwUzYVCqkb2sbVRH9HnwUaJT7cWBY3
+RnJdHOMXWem7/w==
+-----END PRIVATE KEY-----
+Certificate:
+    Data:
+        Version: 1 (0x0)
+        Serial Number: 12723342612721443281 (0xb09264b1f2da21d1)
+    Signature Algorithm: sha1WithRSAEncryption
+        Issuer: C=XY, O=Python Software Foundation CA, CN=our-ca-server
+        Validity
+            Not Before: Jan  4 19:47:07 2013 GMT
+            Not After : Nov 13 19:47:07 2022 GMT
+        Subject: C=XY, L=Castle Anthrax, O=Python Software Foundation, CN=localhost
+        Subject Public Key Info:
+            Public Key Algorithm: rsaEncryption
+                Public-Key: (1024 bit)
+                Modulus:
+                    00:c2:e0:0f:49:00:28:36:f9:70:5c:8f:8d:bc:0d:
+                    7d:1e:42:b5:ec:1d:5c:2f:a4:31:70:16:0f:c0:cb:
+                    c6:24:d3:be:13:16:ee:a5:67:97:03:a6:df:a9:99:
+                    96:cc:c7:2a:fb:11:7f:4e:65:4f:8a:5e:82:21:4c:
+                    f7:3d:a3:d4:e9:5a:37:e7:22:fd:7e:cd:53:6d:93:
+                    34:de:9c:ad:84:a2:37:be:c5:8d:82:4f:e3:ae:23:
+                    f3:be:a7:75:2c:72:0f:ea:f3:ca:cd:fc:e9:3f:b5:
+                    af:56:99:6a:08:04:76:48:f5:4e:c4:ac:bf:5c:d6:
+                    21:82:a5:3c:88:e5:be:1b:b1
+                Exponent: 65537 (0x10001)
+    Signature Algorithm: sha1WithRSAEncryption
+         2f:42:5f:a3:09:2c:fa:51:88:c7:37:7f:ea:0e:63:f0:a2:9a:
+         e5:5a:e2:c8:20:f0:3f:60:bc:c8:0f:b6:c6:76:ce:db:83:93:
+         f5:a3:33:67:01:8e:04:cd:00:9a:73:fd:f3:35:86:fa:d7:13:
+         e2:46:c6:9d:c0:29:53:d4:a9:90:b8:77:4b:e6:83:76:e4:92:
+         d6:9c:50:cf:43:d0:c6:01:77:61:9a:de:9b:70:f7:72:cd:59:
+         00:31:69:d9:b4:ca:06:9c:6d:c3:c7:80:8c:68:e6:b5:a2:f8:
+         ef:1d:bb:16:9f:77:77:ef:87:62:22:9b:4d:69:a4:3a:1a:f1:
+         21:5e:8c:32:ac:92:fd:15:6b:18:c2:7f:15:0d:98:30:ca:75:
+         8f:1a:71:df:da:1d:b2:ef:9a:e8:2d:2e:02:fd:4a:3c:aa:96:
+         0b:06:5d:35:b3:3d:24:87:4b:e0:b0:58:60:2f:45:ac:2e:48:
+         8a:b0:99:10:65:27:ff:cc:b1:d8:fd:bd:26:6b:b9:0c:05:2a:
+         f4:45:63:35:51:07:ed:83:85:fe:6f:69:cb:bb:40:a8:ae:b6:
+         3b:56:4a:2d:a4:ed:6d:11:2c:4d:ed:17:24:fd:47:bc:d3:41:
+         a2:d3:06:fe:0c:90:d8:d8:94:26:c4:ff:cc:a1:d8:42:77:eb:
+         fc:a9:94:71
+-----BEGIN CERTIFICATE-----
+MIICpDCCAYwCCQCwkmSx8toh0TANBgkqhkiG9w0BAQUFADBNMQswCQYDVQQGEwJY
+WTEmMCQGA1UECgwdUHl0aG9uIFNvZnR3YXJlIEZvdW5kYXRpb24gQ0ExFjAUBgNV
+BAMMDW91ci1jYS1zZXJ2ZXIwHhcNMTMwMTA0MTk0NzA3WhcNMjIxMTEzMTk0NzA3
+WjBfMQswCQYDVQQGEwJYWTEXMBUGA1UEBxMOQ2FzdGxlIEFudGhyYXgxIzAhBgNV
+BAoTGlB5dGhvbiBTb2Z0d2FyZSBGb3VuZGF0aW9uMRIwEAYDVQQDEwlsb2NhbGhv
+c3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMLgD0kAKDb5cFyPjbwNfR5C
+tewdXC+kMXAWD8DLxiTTvhMW7qVnlwOm36mZlszHKvsRf05lT4pegiFM9z2j1Ola
+N+ci/X7NU22TNN6crYSiN77FjYJP464j876ndSxyD+rzys386T+1r1aZaggEdkj1
+TsSsv1zWIYKlPIjlvhuxAgMBAAEwDQYJKoZIhvcNAQEFBQADggEBAC9CX6MJLPpR
+iMc3f+oOY/CimuVa4sgg8D9gvMgPtsZ2ztuDk/WjM2cBjgTNAJpz/fM1hvrXE+JG
+xp3AKVPUqZC4d0vmg3bkktacUM9D0MYBd2Ga3ptw93LNWQAxadm0ygacbcPHgIxo
+5rWi+O8duxafd3fvh2Iim01ppDoa8SFejDKskv0VaxjCfxUNmDDKdY8acd/aHbLv
+mugtLgL9SjyqlgsGXTWzPSSHS+CwWGAvRawuSIqwmRBlJ//Msdj9vSZruQwFKvRF
+YzVRB+2Dhf5vacu7QKiutjtWSi2k7W0RLE3tFyT9R7zTQaLTBv4MkNjYlCbE/8yh
+2EJ36/yplHE=
+-----END CERTIFICATE-----
diff --git a/Lib/test/test_asyncio/pycacert.pem b/Lib/test/test_asyncio/pycacert.pem
new file mode 100644
index 0000000..09b1f3e
--- /dev/null
+++ b/Lib/test/test_asyncio/pycacert.pem
@@ -0,0 +1,78 @@
+Certificate:
+    Data:
+        Version: 3 (0x2)
+        Serial Number: 12723342612721443280 (0xb09264b1f2da21d0)
+    Signature Algorithm: sha1WithRSAEncryption
+        Issuer: C=XY, O=Python Software Foundation CA, CN=our-ca-server
+        Validity
+            Not Before: Jan  4 19:47:07 2013 GMT
+            Not After : Jan  2 19:47:07 2023 GMT
+        Subject: C=XY, O=Python Software Foundation CA, CN=our-ca-server
+        Subject Public Key Info:
+            Public Key Algorithm: rsaEncryption
+                Public-Key: (2048 bit)
+                Modulus:
+                    00:e7:de:e9:e3:0c:9f:00:b6:a1:fd:2b:5b:96:d2:
+                    6f:cc:e0:be:86:b9:20:5e:ec:03:7a:55:ab:ea:a4:
+                    e9:f9:49:85:d2:66:d5:ed:c7:7a:ea:56:8e:2d:8f:
+                    e7:42:e2:62:28:a9:9f:d6:1b:8e:eb:b5:b4:9c:9f:
+                    14:ab:df:e6:94:8b:76:1d:3e:6d:24:61:ed:0c:bf:
+                    00:8a:61:0c:df:5c:c8:36:73:16:00:cd:47:ba:6d:
+                    a4:a4:74:88:83:23:0a:19:fc:09:a7:3c:4a:4b:d3:
+                    e7:1d:2d:e4:ea:4c:54:21:f3:26:db:89:37:18:d4:
+                    02:bb:40:32:5f:a4:ff:2d:1c:f7:d4:bb:ec:8e:cf:
+                    5c:82:ac:e6:7c:08:6c:48:85:61:07:7f:25:e0:5c:
+                    e0:bc:34:5f:e0:b9:04:47:75:c8:47:0b:8d:bc:d6:
+                    c8:68:5f:33:83:62:d2:20:44:35:b1:ad:81:1a:8a:
+                    cd:bc:35:b0:5c:8b:47:d6:18:e9:9c:18:97:cc:01:
+                    3c:29:cc:e8:1e:e4:e4:c1:b8:de:e7:c2:11:18:87:
+                    5a:93:34:d8:a6:25:f7:14:71:eb:e4:21:a2:d2:0f:
+                    2e:2e:d4:62:00:35:d3:d6:ef:5c:60:4b:4c:a9:14:
+                    e2:dd:15:58:46:37:33:26:b7:e7:2e:5d:ed:42:e4:
+                    c5:4d
+                Exponent: 65537 (0x10001)
+        X509v3 extensions:
+            X509v3 Subject Key Identifier: 
+                BC:DD:62:D9:76:DA:1B:D2:54:6B:CF:E0:66:9B:1E:1E:7B:56:0C:0B
+            X509v3 Authority Key Identifier: 
+                keyid:BC:DD:62:D9:76:DA:1B:D2:54:6B:CF:E0:66:9B:1E:1E:7B:56:0C:0B
+
+            X509v3 Basic Constraints: 
+                CA:TRUE
+    Signature Algorithm: sha1WithRSAEncryption
+         7d:0a:f5:cb:8d:d3:5d:bd:99:8e:f8:2b:0f:ba:eb:c2:d9:a6:
+         27:4f:2e:7b:2f:0e:64:d8:1c:35:50:4e:ee:fc:90:b9:8d:6d:
+         a8:c5:c6:06:b0:af:f3:2d:bf:3b:b8:42:07:dd:18:7d:6d:95:
+         54:57:85:18:60:47:2f:eb:78:1b:f9:e8:17:fd:5a:0d:87:17:
+         28:ac:4c:6a:e6:bc:29:f4:f4:55:70:29:42:de:85:ea:ab:6c:
+         23:06:64:30:75:02:8e:53:bc:5e:01:33:37:cc:1e:cd:b8:a4:
+         fd:ca:e4:5f:65:3b:83:1c:86:f1:55:02:a0:3a:8f:db:91:b7:
+         40:14:b4:e7:8d:d2:ee:73:ba:e3:e5:34:2d:bc:94:6f:4e:24:
+         06:f7:5f:8b:0e:a7:8e:6b:de:5e:75:f4:32:9a:50:b1:44:33:
+         9a:d0:05:e2:78:82:ff:db:da:8a:63:eb:a9:dd:d1:bf:a0:61:
+         ad:e3:9e:8a:24:5d:62:0e:e7:4c:91:7f:ef:df:34:36:3b:2f:
+         5d:f5:84:b2:2f:c4:6d:93:96:1a:6f:30:28:f1:da:12:9a:64:
+         b4:40:33:1d:bd:de:2b:53:a8:ea:be:d6:bc:4e:96:f5:44:fb:
+         32:18:ae:d5:1f:f6:69:af:b6:4e:7b:1d:58:ec:3b:a9:53:a3:
+         5e:58:c8:9e
+-----BEGIN CERTIFICATE-----
+MIIDbTCCAlWgAwIBAgIJALCSZLHy2iHQMA0GCSqGSIb3DQEBBQUAME0xCzAJBgNV
+BAYTAlhZMSYwJAYDVQQKDB1QeXRob24gU29mdHdhcmUgRm91bmRhdGlvbiBDQTEW
+MBQGA1UEAwwNb3VyLWNhLXNlcnZlcjAeFw0xMzAxMDQxOTQ3MDdaFw0yMzAxMDIx
+OTQ3MDdaME0xCzAJBgNVBAYTAlhZMSYwJAYDVQQKDB1QeXRob24gU29mdHdhcmUg
+Rm91bmRhdGlvbiBDQTEWMBQGA1UEAwwNb3VyLWNhLXNlcnZlcjCCASIwDQYJKoZI
+hvcNAQEBBQADggEPADCCAQoCggEBAOfe6eMMnwC2of0rW5bSb8zgvoa5IF7sA3pV
+q+qk6flJhdJm1e3HeupWji2P50LiYiipn9Ybjuu1tJyfFKvf5pSLdh0+bSRh7Qy/
+AIphDN9cyDZzFgDNR7ptpKR0iIMjChn8Cac8SkvT5x0t5OpMVCHzJtuJNxjUArtA
+Ml+k/y0c99S77I7PXIKs5nwIbEiFYQd/JeBc4Lw0X+C5BEd1yEcLjbzWyGhfM4Ni
+0iBENbGtgRqKzbw1sFyLR9YY6ZwYl8wBPCnM6B7k5MG43ufCERiHWpM02KYl9xRx
+6+QhotIPLi7UYgA109bvXGBLTKkU4t0VWEY3Mya35y5d7ULkxU0CAwEAAaNQME4w
+HQYDVR0OBBYEFLzdYtl22hvSVGvP4GabHh57VgwLMB8GA1UdIwQYMBaAFLzdYtl2
+2hvSVGvP4GabHh57VgwLMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEB
+AH0K9cuN0129mY74Kw+668LZpidPLnsvDmTYHDVQTu78kLmNbajFxgawr/Mtvzu4
+QgfdGH1tlVRXhRhgRy/reBv56Bf9Wg2HFyisTGrmvCn09FVwKULeheqrbCMGZDB1
+Ao5TvF4BMzfMHs24pP3K5F9lO4MchvFVAqA6j9uRt0AUtOeN0u5zuuPlNC28lG9O
+JAb3X4sOp45r3l519DKaULFEM5rQBeJ4gv/b2opj66nd0b+gYa3jnookXWIO50yR
+f+/fNDY7L131hLIvxG2TlhpvMCjx2hKaZLRAMx293itTqOq+1rxOlvVE+zIYrtUf
+9mmvtk57HVjsO6lTo15YyJ4=
+-----END CERTIFICATE-----
diff --git a/Lib/test/test_asyncio/ssl_cert.pem b/Lib/test/test_asyncio/ssl_cert.pem
new file mode 100644
index 0000000..47a7d7e
--- /dev/null
+++ b/Lib/test/test_asyncio/ssl_cert.pem
@@ -0,0 +1,15 @@
+-----BEGIN CERTIFICATE-----
+MIICVDCCAb2gAwIBAgIJANfHOBkZr8JOMA0GCSqGSIb3DQEBBQUAMF8xCzAJBgNV
+BAYTAlhZMRcwFQYDVQQHEw5DYXN0bGUgQW50aHJheDEjMCEGA1UEChMaUHl0aG9u
+IFNvZnR3YXJlIEZvdW5kYXRpb24xEjAQBgNVBAMTCWxvY2FsaG9zdDAeFw0xMDEw
+MDgyMzAxNTZaFw0yMDEwMDUyMzAxNTZaMF8xCzAJBgNVBAYTAlhZMRcwFQYDVQQH
+Ew5DYXN0bGUgQW50aHJheDEjMCEGA1UEChMaUHl0aG9uIFNvZnR3YXJlIEZvdW5k
+YXRpb24xEjAQBgNVBAMTCWxvY2FsaG9zdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAw
+gYkCgYEA21vT5isq7F68amYuuNpSFlKDPrMUCa4YWYqZRt2OZ+/3NKaZ2xAiSwr7
+6MrQF70t5nLbSPpqE5+5VrS58SY+g/sXLiFd6AplH1wJZwh78DofbFYXUggktFMt
+pTyiX8jtP66bkcPkDADA089RI1TQR6Ca+n7HFa7c1fabVV6i3zkCAwEAAaMYMBYw
+FAYDVR0RBA0wC4IJbG9jYWxob3N0MA0GCSqGSIb3DQEBBQUAA4GBAHPctQBEQ4wd
+BJ6+JcpIraopLn8BGhbjNWj40mmRqWB/NAWF6M5ne7KpGAu7tLeG4hb1zLaldK8G
+lxy2GPSRF6LFS48dpEj2HbMv2nvv6xxalDMJ9+DicWgAKTQ6bcX2j3GUkCR0g/T1
+CRlNBAAlvhKzO7Clpf9l0YKBEfraJByX
+-----END CERTIFICATE-----
diff --git a/Lib/test/test_asyncio/ssl_key.pem b/Lib/test/test_asyncio/ssl_key.pem
new file mode 100644
index 0000000..3fd3bbd
--- /dev/null
+++ b/Lib/test/test_asyncio/ssl_key.pem
@@ -0,0 +1,16 @@
+-----BEGIN PRIVATE KEY-----
+MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBANtb0+YrKuxevGpm
+LrjaUhZSgz6zFAmuGFmKmUbdjmfv9zSmmdsQIksK++jK0Be9LeZy20j6ahOfuVa0
+ufEmPoP7Fy4hXegKZR9cCWcIe/A6H2xWF1IIJLRTLaU8ol/I7T+um5HD5AwAwNPP
+USNU0Eegmvp+xxWu3NX2m1Veot85AgMBAAECgYA3ZdZ673X0oexFlq7AAmrutkHt
+CL7LvwrpOiaBjhyTxTeSNWzvtQBkIU8DOI0bIazA4UreAFffwtvEuPmonDb3F+Iq
+SMAu42XcGyVZEl+gHlTPU9XRX7nTOXVt+MlRRRxL6t9GkGfUAXI3XxJDXW3c0vBK
+UL9xqD8cORXOfE06rQJBAP8mEX1ERkR64Ptsoe4281vjTlNfIbs7NMPkUnrn9N/Y
+BLhjNIfQ3HFZG8BTMLfX7kCS9D593DW5tV4Z9BP/c6cCQQDcFzCcVArNh2JSywOQ
+ZfTfRbJg/Z5Lt9Fkngv1meeGNPgIMLN8Sg679pAOOWmzdMO3V706rNPzSVMME7E5
+oPIfAkEA8pDddarP5tCvTTgUpmTFbakm0KoTZm2+FzHcnA4jRh+XNTjTOv98Y6Ik
+eO5d1ZnKXseWvkZncQgxfdnMqqpj5wJAcNq/RVne1DbYlwWchT2Si65MYmmJ8t+F
+0mcsULqjOnEMwf5e+ptq5LzwbyrHZYq5FNk7ocufPv/ZQrcSSC+cFwJBAKvOJByS
+x56qyGeZLOQlWS2JS3KJo59XuLFGqcbgN9Om9xFa41Yb4N9NvplFivsvZdw3m1Q/
+SPIXQuT8RMPDVNQ=
+-----END PRIVATE KEY-----
diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py
new file mode 100644
index 0000000..9e7c50c
--- /dev/null
+++ b/Lib/test/test_asyncio/test_base_events.py
@@ -0,0 +1,1236 @@
+"""Tests for base_events.py"""
+
+import errno
+import logging
+import math
+import socket
+import sys
+import threading
+import time
+import unittest
+from unittest import mock
+
+import asyncio
+from asyncio import base_events
+from asyncio import constants
+from asyncio import test_utils
+try:
+    from test import support
+    from test.script_helper import assert_python_ok
+except ImportError:
+    from asyncio import test_support as support
+    from asyncio.test_support import assert_python_ok
+
+
+MOCK_ANY = mock.ANY
+PY34 = sys.version_info >= (3, 4)
+
+
+class BaseEventLoopTests(test_utils.TestCase):
+
+    def setUp(self):
+        self.loop = base_events.BaseEventLoop()
+        self.loop._selector = mock.Mock()
+        self.loop._selector.select.return_value = ()
+        self.set_event_loop(self.loop)
+
+    def test_not_implemented(self):
+        m = mock.Mock()
+        self.assertRaises(
+            NotImplementedError,
+            self.loop._make_socket_transport, m, m)
+        self.assertRaises(
+            NotImplementedError,
+            self.loop._make_ssl_transport, m, m, m, m)
+        self.assertRaises(
+            NotImplementedError,
+            self.loop._make_datagram_transport, m, m)
+        self.assertRaises(
+            NotImplementedError, self.loop._process_events, [])
+        self.assertRaises(
+            NotImplementedError, self.loop._write_to_self)
+        self.assertRaises(
+            NotImplementedError,
+            self.loop._make_read_pipe_transport, m, m)
+        self.assertRaises(
+            NotImplementedError,
+            self.loop._make_write_pipe_transport, m, m)
+        gen = self.loop._make_subprocess_transport(m, m, m, m, m, m, m)
+        self.assertRaises(NotImplementedError, next, iter(gen))
+
+    def test_close(self):
+        self.assertFalse(self.loop.is_closed())
+        self.loop.close()
+        self.assertTrue(self.loop.is_closed())
+
+        # it should be possible to call close() more than once
+        self.loop.close()
+        self.loop.close()
+
+        # operation blocked when the loop is closed
+        f = asyncio.Future(loop=self.loop)
+        self.assertRaises(RuntimeError, self.loop.run_forever)
+        self.assertRaises(RuntimeError, self.loop.run_until_complete, f)
+
+    def test__add_callback_handle(self):
+        h = asyncio.Handle(lambda: False, (), self.loop)
+
+        self.loop._add_callback(h)
+        self.assertFalse(self.loop._scheduled)
+        self.assertIn(h, self.loop._ready)
+
+    def test__add_callback_cancelled_handle(self):
+        h = asyncio.Handle(lambda: False, (), self.loop)
+        h.cancel()
+
+        self.loop._add_callback(h)
+        self.assertFalse(self.loop._scheduled)
+        self.assertFalse(self.loop._ready)
+
+    def test_set_default_executor(self):
+        executor = mock.Mock()
+        self.loop.set_default_executor(executor)
+        self.assertIs(executor, self.loop._default_executor)
+
+    def test_getnameinfo(self):
+        sockaddr = mock.Mock()
+        self.loop.run_in_executor = mock.Mock()
+        self.loop.getnameinfo(sockaddr)
+        self.assertEqual(
+            (None, socket.getnameinfo, sockaddr, 0),
+            self.loop.run_in_executor.call_args[0])
+
+    def test_call_soon(self):
+        def cb():
+            pass
+
+        h = self.loop.call_soon(cb)
+        self.assertEqual(h._callback, cb)
+        self.assertIsInstance(h, asyncio.Handle)
+        self.assertIn(h, self.loop._ready)
+
+    def test_call_later(self):
+        def cb():
+            pass
+
+        h = self.loop.call_later(10.0, cb)
+        self.assertIsInstance(h, asyncio.TimerHandle)
+        self.assertIn(h, self.loop._scheduled)
+        self.assertNotIn(h, self.loop._ready)
+
+    def test_call_later_negative_delays(self):
+        calls = []
+
+        def cb(arg):
+            calls.append(arg)
+
+        self.loop._process_events = mock.Mock()
+        self.loop.call_later(-1, cb, 'a')
+        self.loop.call_later(-2, cb, 'b')
+        test_utils.run_briefly(self.loop)
+        self.assertEqual(calls, ['b', 'a'])
+
+    def test_time_and_call_at(self):
+        def cb():
+            self.loop.stop()
+
+        self.loop._process_events = mock.Mock()
+        delay = 0.1
+
+        when = self.loop.time() + delay
+        self.loop.call_at(when, cb)
+        t0 = self.loop.time()
+        self.loop.run_forever()
+        dt = self.loop.time() - t0
+
+        # 50 ms: maximum granularity of the event loop
+        self.assertGreaterEqual(dt, delay - 0.050, dt)
+        # tolerate a difference of +800 ms because some Python buildbots
+        # are really slow
+        self.assertLessEqual(dt, 0.9, dt)
+
+    def check_thread(self, loop, debug):
+        def cb():
+            pass
+
+        loop.set_debug(debug)
+        if debug:
+            msg = ("Non-thread-safe operation invoked on an event loop other "
+                  "than the current one")
+            with self.assertRaisesRegex(RuntimeError, msg):
+                loop.call_soon(cb)
+            with self.assertRaisesRegex(RuntimeError, msg):
+                loop.call_later(60, cb)
+            with self.assertRaisesRegex(RuntimeError, msg):
+                loop.call_at(loop.time() + 60, cb)
+        else:
+            loop.call_soon(cb)
+            loop.call_later(60, cb)
+            loop.call_at(loop.time() + 60, cb)
+
+    def test_check_thread(self):
+        def check_in_thread(loop, event, debug, create_loop, fut):
+            # wait until the event loop is running
+            event.wait()
+
+            try:
+                if create_loop:
+                    loop2 = base_events.BaseEventLoop()
+                    try:
+                        asyncio.set_event_loop(loop2)
+                        self.check_thread(loop, debug)
+                    finally:
+                        asyncio.set_event_loop(None)
+                        loop2.close()
+                else:
+                    self.check_thread(loop, debug)
+            except Exception as exc:
+                loop.call_soon_threadsafe(fut.set_exception, exc)
+            else:
+                loop.call_soon_threadsafe(fut.set_result, None)
+
+        def test_thread(loop, debug, create_loop=False):
+            event = threading.Event()
+            fut = asyncio.Future(loop=loop)
+            loop.call_soon(event.set)
+            args = (loop, event, debug, create_loop, fut)
+            thread = threading.Thread(target=check_in_thread, args=args)
+            thread.start()
+            loop.run_until_complete(fut)
+            thread.join()
+
+        self.loop._process_events = mock.Mock()
+        self.loop._write_to_self = mock.Mock()
+
+        # raise RuntimeError if the thread has no event loop
+        test_thread(self.loop, True)
+
+        # check disabled if debug mode is disabled
+        test_thread(self.loop, False)
+
+        # raise RuntimeError if the event loop of the thread is not the called
+        # event loop
+        test_thread(self.loop, True, create_loop=True)
+
+        # check disabled if debug mode is disabled
+        test_thread(self.loop, False, create_loop=True)
+
+    def test_run_once_in_executor_handle(self):
+        def cb():
+            pass
+
+        self.assertRaises(
+            AssertionError, self.loop.run_in_executor,
+            None, asyncio.Handle(cb, (), self.loop), ('',))
+        self.assertRaises(
+            AssertionError, self.loop.run_in_executor,
+            None, asyncio.TimerHandle(10, cb, (), self.loop))
+
+    def test_run_once_in_executor_cancelled(self):
+        def cb():
+            pass
+        h = asyncio.Handle(cb, (), self.loop)
+        h.cancel()
+
+        f = self.loop.run_in_executor(None, h)
+        self.assertIsInstance(f, asyncio.Future)
+        self.assertTrue(f.done())
+        self.assertIsNone(f.result())
+
+    def test_run_once_in_executor_plain(self):
+        def cb():
+            pass
+        h = asyncio.Handle(cb, (), self.loop)
+        f = asyncio.Future(loop=self.loop)
+        executor = mock.Mock()
+        executor.submit.return_value = f
+
+        self.loop.set_default_executor(executor)
+
+        res = self.loop.run_in_executor(None, h)
+        self.assertIs(f, res)
+
+        executor = mock.Mock()
+        executor.submit.return_value = f
+        res = self.loop.run_in_executor(executor, h)
+        self.assertIs(f, res)
+        self.assertTrue(executor.submit.called)
+
+        f.cancel()  # Don't complain about abandoned Future.
+
+    def test__run_once(self):
+        h1 = asyncio.TimerHandle(time.monotonic() + 5.0, lambda: True, (),
+                                 self.loop)
+        h2 = asyncio.TimerHandle(time.monotonic() + 10.0, lambda: True, (),
+                                 self.loop)
+
+        h1.cancel()
+
+        self.loop._process_events = mock.Mock()
+        self.loop._scheduled.append(h1)
+        self.loop._scheduled.append(h2)
+        self.loop._run_once()
+
+        t = self.loop._selector.select.call_args[0][0]
+        self.assertTrue(9.5 < t < 10.5, t)
+        self.assertEqual([h2], self.loop._scheduled)
+        self.assertTrue(self.loop._process_events.called)
+
+    def test_set_debug(self):
+        self.loop.set_debug(True)
+        self.assertTrue(self.loop.get_debug())
+        self.loop.set_debug(False)
+        self.assertFalse(self.loop.get_debug())
+
+    @mock.patch('asyncio.base_events.logger')
+    def test__run_once_logging(self, m_logger):
+        def slow_select(timeout):
+            # Sleep a bit longer than a second to avoid timer resolution
+            # issues.
+            time.sleep(1.1)
+            return []
+
+        # logging needs debug flag
+        self.loop.set_debug(True)
+
+        # Log to INFO level if timeout > 1.0 sec.
+        self.loop._selector.select = slow_select
+        self.loop._process_events = mock.Mock()
+        self.loop._run_once()
+        self.assertEqual(logging.INFO, m_logger.log.call_args[0][0])
+
+        def fast_select(timeout):
+            time.sleep(0.001)
+            return []
+
+        self.loop._selector.select = fast_select
+        self.loop._run_once()
+        self.assertEqual(logging.DEBUG, m_logger.log.call_args[0][0])
+
+    def test__run_once_schedule_handle(self):
+        handle = None
+        processed = False
+
+        def cb(loop):
+            nonlocal processed, handle
+            processed = True
+            handle = loop.call_soon(lambda: True)
+
+        h = asyncio.TimerHandle(time.monotonic() - 1, cb, (self.loop,),
+                                self.loop)
+
+        self.loop._process_events = mock.Mock()
+        self.loop._scheduled.append(h)
+        self.loop._run_once()
+
+        self.assertTrue(processed)
+        self.assertEqual([handle], list(self.loop._ready))
+
+    def test__run_once_cancelled_event_cleanup(self):
+        self.loop._process_events = mock.Mock()
+
+        self.assertTrue(
+            0 < base_events._MIN_CANCELLED_TIMER_HANDLES_FRACTION < 1.0)
+
+        def cb():
+            pass
+
+        # Set up one "blocking" event that will not be cancelled to
+        # ensure later cancelled events do not make it to the head
+        # of the queue and get cleaned.
+        not_cancelled_count = 1
+        self.loop.call_later(3000, cb)
+
+        # Add less than threshold (base_events._MIN_SCHEDULED_TIMER_HANDLES)
+        # cancelled handles, ensure they aren't removed
+
+        cancelled_count = 2
+        for x in range(2):
+            h = self.loop.call_later(3600, cb)
+            h.cancel()
+
+        # Add some cancelled events that will be at head and removed
+        cancelled_count += 2
+        for x in range(2):
+            h = self.loop.call_later(100, cb)
+            h.cancel()
+
+        # This test is invalid if _MIN_SCHEDULED_TIMER_HANDLES is too low
+        self.assertLessEqual(cancelled_count + not_cancelled_count,
+            base_events._MIN_SCHEDULED_TIMER_HANDLES)
+
+        self.assertEqual(self.loop._timer_cancelled_count, cancelled_count)
+
+        self.loop._run_once()
+
+        cancelled_count -= 2
+
+        self.assertEqual(self.loop._timer_cancelled_count, cancelled_count)
+
+        self.assertEqual(len(self.loop._scheduled),
+            cancelled_count + not_cancelled_count)
+
+        # Need enough events to pass _MIN_CANCELLED_TIMER_HANDLES_FRACTION
+        # so that deletion of cancelled events will occur on next _run_once
+        add_cancel_count = int(math.ceil(
+            base_events._MIN_SCHEDULED_TIMER_HANDLES *
+            base_events._MIN_CANCELLED_TIMER_HANDLES_FRACTION)) + 1
+
+        add_not_cancel_count = max(base_events._MIN_SCHEDULED_TIMER_HANDLES -
+            add_cancel_count, 0)
+
+        # Add some events that will not be cancelled
+        not_cancelled_count += add_not_cancel_count
+        for x in range(add_not_cancel_count):
+            self.loop.call_later(3600, cb)
+
+        # Add enough cancelled events
+        cancelled_count += add_cancel_count
+        for x in range(add_cancel_count):
+            h = self.loop.call_later(3600, cb)
+            h.cancel()
+
+        # Ensure all handles are still scheduled
+        self.assertEqual(len(self.loop._scheduled),
+            cancelled_count + not_cancelled_count)
+
+        self.loop._run_once()
+
+        # Ensure cancelled events were removed
+        self.assertEqual(len(self.loop._scheduled), not_cancelled_count)
+
+        # Ensure only uncancelled events remain scheduled
+        self.assertTrue(all([not x._cancelled for x in self.loop._scheduled]))
+
+    def test_run_until_complete_type_error(self):
+        self.assertRaises(TypeError,
+            self.loop.run_until_complete, 'blah')
+
+    def test_run_until_complete_loop(self):
+        task = asyncio.Future(loop=self.loop)
+        other_loop = self.new_test_loop()
+        self.addCleanup(other_loop.close)
+        self.assertRaises(ValueError,
+            other_loop.run_until_complete, task)
+
+    def test_subprocess_exec_invalid_args(self):
+        args = [sys.executable, '-c', 'pass']
+
+        # missing program parameter (empty args)
+        self.assertRaises(TypeError,
+            self.loop.run_until_complete, self.loop.subprocess_exec,
+            asyncio.SubprocessProtocol)
+
+        # expected multiple arguments, not a list
+        self.assertRaises(TypeError,
+            self.loop.run_until_complete, self.loop.subprocess_exec,
+            asyncio.SubprocessProtocol, args)
+
+        # program arguments must be strings, not int
+        self.assertRaises(TypeError,
+            self.loop.run_until_complete, self.loop.subprocess_exec,
+            asyncio.SubprocessProtocol, sys.executable, 123)
+
+        # universal_newlines, shell, bufsize must not be set
+        self.assertRaises(TypeError,
+        self.loop.run_until_complete, self.loop.subprocess_exec,
+            asyncio.SubprocessProtocol, *args, universal_newlines=True)
+        self.assertRaises(TypeError,
+            self.loop.run_until_complete, self.loop.subprocess_exec,
+            asyncio.SubprocessProtocol, *args, shell=True)
+        self.assertRaises(TypeError,
+            self.loop.run_until_complete, self.loop.subprocess_exec,
+            asyncio.SubprocessProtocol, *args, bufsize=4096)
+
+    def test_subprocess_shell_invalid_args(self):
+        # expected a string, not an int or a list
+        self.assertRaises(TypeError,
+            self.loop.run_until_complete, self.loop.subprocess_shell,
+            asyncio.SubprocessProtocol, 123)
+        self.assertRaises(TypeError,
+            self.loop.run_until_complete, self.loop.subprocess_shell,
+            asyncio.SubprocessProtocol, [sys.executable, '-c', 'pass'])
+
+        # universal_newlines, shell, bufsize must not be set
+        self.assertRaises(TypeError,
+            self.loop.run_until_complete, self.loop.subprocess_shell,
+            asyncio.SubprocessProtocol, 'exit 0', universal_newlines=True)
+        self.assertRaises(TypeError,
+            self.loop.run_until_complete, self.loop.subprocess_shell,
+            asyncio.SubprocessProtocol, 'exit 0', shell=True)
+        self.assertRaises(TypeError,
+            self.loop.run_until_complete, self.loop.subprocess_shell,
+            asyncio.SubprocessProtocol, 'exit 0', bufsize=4096)
+
+    def test_default_exc_handler_callback(self):
+        self.loop._process_events = mock.Mock()
+
+        def zero_error(fut):
+            fut.set_result(True)
+            1/0
+
+        # Test call_soon (events.Handle)
+        with mock.patch('asyncio.base_events.logger') as log:
+            fut = asyncio.Future(loop=self.loop)
+            self.loop.call_soon(zero_error, fut)
+            fut.add_done_callback(lambda fut: self.loop.stop())
+            self.loop.run_forever()
+            log.error.assert_called_with(
+                test_utils.MockPattern('Exception in callback.*zero'),
+                exc_info=(ZeroDivisionError, MOCK_ANY, MOCK_ANY))
+
+        # Test call_later (events.TimerHandle)
+        with mock.patch('asyncio.base_events.logger') as log:
+            fut = asyncio.Future(loop=self.loop)
+            self.loop.call_later(0.01, zero_error, fut)
+            fut.add_done_callback(lambda fut: self.loop.stop())
+            self.loop.run_forever()
+            log.error.assert_called_with(
+                test_utils.MockPattern('Exception in callback.*zero'),
+                exc_info=(ZeroDivisionError, MOCK_ANY, MOCK_ANY))
+
+    def test_default_exc_handler_coro(self):
+        self.loop._process_events = mock.Mock()
+
+        @asyncio.coroutine
+        def zero_error_coro():
+            yield from asyncio.sleep(0.01, loop=self.loop)
+            1/0
+
+        # Test Future.__del__
+        with mock.patch('asyncio.base_events.logger') as log:
+            fut = asyncio.async(zero_error_coro(), loop=self.loop)
+            fut.add_done_callback(lambda *args: self.loop.stop())
+            self.loop.run_forever()
+            fut = None # Trigger Future.__del__ or futures._TracebackLogger
+            if PY34:
+                # Future.__del__ in Python 3.4 logs error with
+                # an actual exception context
+                log.error.assert_called_with(
+                    test_utils.MockPattern('.*exception was never retrieved'),
+                    exc_info=(ZeroDivisionError, MOCK_ANY, MOCK_ANY))
+            else:
+                # futures._TracebackLogger logs only textual traceback
+                log.error.assert_called_with(
+                    test_utils.MockPattern(
+                        '.*exception was never retrieved.*ZeroDiv'),
+                    exc_info=False)
+
+    def test_set_exc_handler_invalid(self):
+        with self.assertRaisesRegex(TypeError, 'A callable object or None'):
+            self.loop.set_exception_handler('spam')
+
+    def test_set_exc_handler_custom(self):
+        def zero_error():
+            1/0
+
+        def run_loop():
+            handle = self.loop.call_soon(zero_error)
+            self.loop._run_once()
+            return handle
+
+        self.loop.set_debug(True)
+        self.loop._process_events = mock.Mock()
+
+        mock_handler = mock.Mock()
+        self.loop.set_exception_handler(mock_handler)
+        handle = run_loop()
+        mock_handler.assert_called_with(self.loop, {
+            'exception': MOCK_ANY,
+            'message': test_utils.MockPattern(
+                                'Exception in callback.*zero_error'),
+            'handle': handle,
+            'source_traceback': handle._source_traceback,
+        })
+        mock_handler.reset_mock()
+
+        self.loop.set_exception_handler(None)
+        with mock.patch('asyncio.base_events.logger') as log:
+            run_loop()
+            log.error.assert_called_with(
+                        test_utils.MockPattern(
+                                'Exception in callback.*zero'),
+                        exc_info=(ZeroDivisionError, MOCK_ANY, MOCK_ANY))
+
+        assert not mock_handler.called
+
+    def test_set_exc_handler_broken(self):
+        def run_loop():
+            def zero_error():
+                1/0
+            self.loop.call_soon(zero_error)
+            self.loop._run_once()
+
+        def handler(loop, context):
+            raise AttributeError('spam')
+
+        self.loop._process_events = mock.Mock()
+
+        self.loop.set_exception_handler(handler)
+
+        with mock.patch('asyncio.base_events.logger') as log:
+            run_loop()
+            log.error.assert_called_with(
+                test_utils.MockPattern(
+                    'Unhandled error in exception handler'),
+                exc_info=(AttributeError, MOCK_ANY, MOCK_ANY))
+
+    def test_default_exc_handler_broken(self):
+        _context = None
+
+        class Loop(base_events.BaseEventLoop):
+
+            _selector = mock.Mock()
+            _process_events = mock.Mock()
+
+            def default_exception_handler(self, context):
+                nonlocal _context
+                _context = context
+                # Simulates custom buggy "default_exception_handler"
+                raise ValueError('spam')
+
+        loop = Loop()
+        self.addCleanup(loop.close)
+        asyncio.set_event_loop(loop)
+
+        def run_loop():
+            def zero_error():
+                1/0
+            loop.call_soon(zero_error)
+            loop._run_once()
+
+        with mock.patch('asyncio.base_events.logger') as log:
+            run_loop()
+            log.error.assert_called_with(
+                'Exception in default exception handler',
+                exc_info=True)
+
+        def custom_handler(loop, context):
+            raise ValueError('ham')
+
+        _context = None
+        loop.set_exception_handler(custom_handler)
+        with mock.patch('asyncio.base_events.logger') as log:
+            run_loop()
+            log.error.assert_called_with(
+                test_utils.MockPattern('Exception in default exception.*'
+                                       'while handling.*in custom'),
+                exc_info=True)
+
+            # Check that original context was passed to default
+            # exception handler.
+            self.assertIn('context', _context)
+            self.assertIs(type(_context['context']['exception']),
+                          ZeroDivisionError)
+
+    def test_env_var_debug(self):
+        code = '\n'.join((
+            'import asyncio',
+            'loop = asyncio.get_event_loop()',
+            'print(loop.get_debug())'))
+
+        # Test with -E to not fail if the unit test was run with
+        # PYTHONASYNCIODEBUG set to a non-empty string
+        sts, stdout, stderr = assert_python_ok('-E', '-c', code)
+        self.assertEqual(stdout.rstrip(), b'False')
+
+        sts, stdout, stderr = assert_python_ok('-c', code,
+                                               PYTHONASYNCIODEBUG='')
+        self.assertEqual(stdout.rstrip(), b'False')
+
+        sts, stdout, stderr = assert_python_ok('-c', code,
+                                               PYTHONASYNCIODEBUG='1')
+        self.assertEqual(stdout.rstrip(), b'True')
+
+        sts, stdout, stderr = assert_python_ok('-E', '-c', code,
+                                               PYTHONASYNCIODEBUG='1')
+        self.assertEqual(stdout.rstrip(), b'False')
+
+    def test_create_task(self):
+        class MyTask(asyncio.Task):
+            pass
+
+        @asyncio.coroutine
+        def test():
+            pass
+
+        class EventLoop(base_events.BaseEventLoop):
+            def create_task(self, coro):
+                return MyTask(coro, loop=loop)
+
+        loop = EventLoop()
+        self.set_event_loop(loop)
+
+        coro = test()
+        task = asyncio.async(coro, loop=loop)
+        self.assertIsInstance(task, MyTask)
+
+        # make warnings quiet
+        task._log_destroy_pending = False
+        coro.close()
+
+    def test_run_forever_keyboard_interrupt(self):
+        # Python issue #22601: ensure that the temporary task created by
+        # run_forever() consumes the KeyboardInterrupt and so don't log
+        # a warning
+        @asyncio.coroutine
+        def raise_keyboard_interrupt():
+            raise KeyboardInterrupt
+
+        self.loop._process_events = mock.Mock()
+        self.loop.call_exception_handler = mock.Mock()
+
+        try:
+            self.loop.run_until_complete(raise_keyboard_interrupt())
+        except KeyboardInterrupt:
+            pass
+        self.loop.close()
+        support.gc_collect()
+
+        self.assertFalse(self.loop.call_exception_handler.called)
+
+    def test_run_until_complete_baseexception(self):
+        # Python issue #22429: run_until_complete() must not schedule a pending
+        # call to stop() if the future raised a BaseException
+        @asyncio.coroutine
+        def raise_keyboard_interrupt():
+            raise KeyboardInterrupt
+
+        self.loop._process_events = mock.Mock()
+
+        try:
+            self.loop.run_until_complete(raise_keyboard_interrupt())
+        except KeyboardInterrupt:
+            pass
+
+        def func():
+            self.loop.stop()
+            func.called = True
+        func.called = False
+        try:
+            self.loop.call_soon(func)
+            self.loop.run_forever()
+        except KeyboardInterrupt:
+            pass
+        self.assertTrue(func.called)
+
+
+class MyProto(asyncio.Protocol):
+    done = None
+
+    def __init__(self, create_future=False):
+        self.state = 'INITIAL'
+        self.nbytes = 0
+        if create_future:
+            self.done = asyncio.Future()
+
+    def connection_made(self, transport):
+        self.transport = transport
+        assert self.state == 'INITIAL', self.state
+        self.state = 'CONNECTED'
+        transport.write(b'GET / HTTP/1.0\r\nHost: example.com\r\n\r\n')
+
+    def data_received(self, data):
+        assert self.state == 'CONNECTED', self.state
+        self.nbytes += len(data)
+
+    def eof_received(self):
+        assert self.state == 'CONNECTED', self.state
+        self.state = 'EOF'
+
+    def connection_lost(self, exc):
+        assert self.state in ('CONNECTED', 'EOF'), self.state
+        self.state = 'CLOSED'
+        if self.done:
+            self.done.set_result(None)
+
+
+class MyDatagramProto(asyncio.DatagramProtocol):
+    done = None
+
+    def __init__(self, create_future=False):
+        self.state = 'INITIAL'
+        self.nbytes = 0
+        if create_future:
+            self.done = asyncio.Future()
+
+    def connection_made(self, transport):
+        self.transport = transport
+        assert self.state == 'INITIAL', self.state
+        self.state = 'INITIALIZED'
+
+    def datagram_received(self, data, addr):
+        assert self.state == 'INITIALIZED', self.state
+        self.nbytes += len(data)
+
+    def error_received(self, exc):
+        assert self.state == 'INITIALIZED', self.state
+
+    def connection_lost(self, exc):
+        assert self.state == 'INITIALIZED', self.state
+        self.state = 'CLOSED'
+        if self.done:
+            self.done.set_result(None)
+
+
+class BaseEventLoopWithSelectorTests(test_utils.TestCase):
+
+    def setUp(self):
+        self.loop = asyncio.new_event_loop()
+        self.set_event_loop(self.loop)
+
+    @mock.patch('asyncio.base_events.socket')
+    def test_create_connection_multiple_errors(self, m_socket):
+
+        class MyProto(asyncio.Protocol):
+            pass
+
+        @asyncio.coroutine
+        def getaddrinfo(*args, **kw):
+            yield from []
+            return [(2, 1, 6, '', ('107.6.106.82', 80)),
+                    (2, 1, 6, '', ('107.6.106.82', 80))]
+
+        def getaddrinfo_task(*args, **kwds):
+            return asyncio.Task(getaddrinfo(*args, **kwds), loop=self.loop)
+
+        idx = -1
+        errors = ['err1', 'err2']
+
+        def _socket(*args, **kw):
+            nonlocal idx, errors
+            idx += 1
+            raise OSError(errors[idx])
+
+        m_socket.socket = _socket
+
+        self.loop.getaddrinfo = getaddrinfo_task
+
+        coro = self.loop.create_connection(MyProto, 'example.com', 80)
+        with self.assertRaises(OSError) as cm:
+            self.loop.run_until_complete(coro)
+
+        self.assertEqual(str(cm.exception), 'Multiple exceptions: err1, err2')
+
+    @mock.patch('asyncio.base_events.socket')
+    def test_create_connection_timeout(self, m_socket):
+        # Ensure that the socket is closed on timeout
+        sock = mock.Mock()
+        m_socket.socket.return_value = sock
+
+        def getaddrinfo(*args, **kw):
+            fut = asyncio.Future(loop=self.loop)
+            addr = (socket.AF_INET, socket.SOCK_STREAM, 0, '',
+                    ('127.0.0.1', 80))
+            fut.set_result([addr])
+            return fut
+        self.loop.getaddrinfo = getaddrinfo
+
+        with mock.patch.object(self.loop, 'sock_connect',
+                               side_effect=asyncio.TimeoutError):
+            coro = self.loop.create_connection(MyProto, '127.0.0.1', 80)
+            with self.assertRaises(asyncio.TimeoutError):
+                self.loop.run_until_complete(coro)
+            self.assertTrue(sock.close.called)
+
+    def test_create_connection_host_port_sock(self):
+        coro = self.loop.create_connection(
+            MyProto, 'example.com', 80, sock=object())
+        self.assertRaises(ValueError, self.loop.run_until_complete, coro)
+
+    def test_create_connection_no_host_port_sock(self):
+        coro = self.loop.create_connection(MyProto)
+        self.assertRaises(ValueError, self.loop.run_until_complete, coro)
+
+    def test_create_connection_no_getaddrinfo(self):
+        @asyncio.coroutine
+        def getaddrinfo(*args, **kw):
+            yield from []
+
+        def getaddrinfo_task(*args, **kwds):
+            return asyncio.Task(getaddrinfo(*args, **kwds), loop=self.loop)
+
+        self.loop.getaddrinfo = getaddrinfo_task
+        coro = self.loop.create_connection(MyProto, 'example.com', 80)
+        self.assertRaises(
+            OSError, self.loop.run_until_complete, coro)
+
+    def test_create_connection_connect_err(self):
+        @asyncio.coroutine
+        def getaddrinfo(*args, **kw):
+            yield from []
+            return [(2, 1, 6, '', ('107.6.106.82', 80))]
+
+        def getaddrinfo_task(*args, **kwds):
+            return asyncio.Task(getaddrinfo(*args, **kwds), loop=self.loop)
+
+        self.loop.getaddrinfo = getaddrinfo_task
+        self.loop.sock_connect = mock.Mock()
+        self.loop.sock_connect.side_effect = OSError
+
+        coro = self.loop.create_connection(MyProto, 'example.com', 80)
+        self.assertRaises(
+            OSError, self.loop.run_until_complete, coro)
+
+    def test_create_connection_multiple(self):
+        @asyncio.coroutine
+        def getaddrinfo(*args, **kw):
+            return [(2, 1, 6, '', ('0.0.0.1', 80)),
+                    (2, 1, 6, '', ('0.0.0.2', 80))]
+
+        def getaddrinfo_task(*args, **kwds):
+            return asyncio.Task(getaddrinfo(*args, **kwds), loop=self.loop)
+
+        self.loop.getaddrinfo = getaddrinfo_task
+        self.loop.sock_connect = mock.Mock()
+        self.loop.sock_connect.side_effect = OSError
+
+        coro = self.loop.create_connection(
+            MyProto, 'example.com', 80, family=socket.AF_INET)
+        with self.assertRaises(OSError):
+            self.loop.run_until_complete(coro)
+
+    @mock.patch('asyncio.base_events.socket')
+    def test_create_connection_multiple_errors_local_addr(self, m_socket):
+
+        def bind(addr):
+            if addr[0] == '0.0.0.1':
+                err = OSError('Err')
+                err.strerror = 'Err'
+                raise err
+
+        m_socket.socket.return_value.bind = bind
+
+        @asyncio.coroutine
+        def getaddrinfo(*args, **kw):
+            return [(2, 1, 6, '', ('0.0.0.1', 80)),
+                    (2, 1, 6, '', ('0.0.0.2', 80))]
+
+        def getaddrinfo_task(*args, **kwds):
+            return asyncio.Task(getaddrinfo(*args, **kwds), loop=self.loop)
+
+        self.loop.getaddrinfo = getaddrinfo_task
+        self.loop.sock_connect = mock.Mock()
+        self.loop.sock_connect.side_effect = OSError('Err2')
+
+        coro = self.loop.create_connection(
+            MyProto, 'example.com', 80, family=socket.AF_INET,
+            local_addr=(None, 8080))
+        with self.assertRaises(OSError) as cm:
+            self.loop.run_until_complete(coro)
+
+        self.assertTrue(str(cm.exception).startswith('Multiple exceptions: '))
+        self.assertTrue(m_socket.socket.return_value.close.called)
+
+    def test_create_connection_no_local_addr(self):
+        @asyncio.coroutine
+        def getaddrinfo(host, *args, **kw):
+            if host == 'example.com':
+                return [(2, 1, 6, '', ('107.6.106.82', 80)),
+                        (2, 1, 6, '', ('107.6.106.82', 80))]
+            else:
+                return []
+
+        def getaddrinfo_task(*args, **kwds):
+            return asyncio.Task(getaddrinfo(*args, **kwds), loop=self.loop)
+        self.loop.getaddrinfo = getaddrinfo_task
+
+        coro = self.loop.create_connection(
+            MyProto, 'example.com', 80, family=socket.AF_INET,
+            local_addr=(None, 8080))
+        self.assertRaises(
+            OSError, self.loop.run_until_complete, coro)
+
+    def test_create_connection_ssl_server_hostname_default(self):
+        self.loop.getaddrinfo = mock.Mock()
+
+        def mock_getaddrinfo(*args, **kwds):
+            f = asyncio.Future(loop=self.loop)
+            f.set_result([(socket.AF_INET, socket.SOCK_STREAM,
+                           socket.SOL_TCP, '', ('1.2.3.4', 80))])
+            return f
+
+        self.loop.getaddrinfo.side_effect = mock_getaddrinfo
+        self.loop.sock_connect = mock.Mock()
+        self.loop.sock_connect.return_value = ()
+        self.loop._make_ssl_transport = mock.Mock()
+
+        class _SelectorTransportMock:
+            _sock = None
+
+            def get_extra_info(self, key):
+                return mock.Mock()
+
+            def close(self):
+                self._sock.close()
+
+        def mock_make_ssl_transport(sock, protocol, sslcontext, waiter,
+                                    **kwds):
+            waiter.set_result(None)
+            transport = _SelectorTransportMock()
+            transport._sock = sock
+            return transport
+
+        self.loop._make_ssl_transport.side_effect = mock_make_ssl_transport
+        ANY = mock.ANY
+        # First try the default server_hostname.
+        self.loop._make_ssl_transport.reset_mock()
+        coro = self.loop.create_connection(MyProto, 'python.org', 80, ssl=True)
+        transport, _ = self.loop.run_until_complete(coro)
+        transport.close()
+        self.loop._make_ssl_transport.assert_called_with(
+            ANY, ANY, ANY, ANY,
+            server_side=False,
+            server_hostname='python.org')
+        # Next try an explicit server_hostname.
+        self.loop._make_ssl_transport.reset_mock()
+        coro = self.loop.create_connection(MyProto, 'python.org', 80, ssl=True,
+                                           server_hostname='perl.com')
+        transport, _ = self.loop.run_until_complete(coro)
+        transport.close()
+        self.loop._make_ssl_transport.assert_called_with(
+            ANY, ANY, ANY, ANY,
+            server_side=False,
+            server_hostname='perl.com')
+        # Finally try an explicit empty server_hostname.
+        self.loop._make_ssl_transport.reset_mock()
+        coro = self.loop.create_connection(MyProto, 'python.org', 80, ssl=True,
+                                           server_hostname='')
+        transport, _ = self.loop.run_until_complete(coro)
+        transport.close()
+        self.loop._make_ssl_transport.assert_called_with(ANY, ANY, ANY, ANY,
+                                                         server_side=False,
+                                                         server_hostname='')
+
+    def test_create_connection_no_ssl_server_hostname_errors(self):
+        # When not using ssl, server_hostname must be None.
+        coro = self.loop.create_connection(MyProto, 'python.org', 80,
+                                           server_hostname='')
+        self.assertRaises(ValueError, self.loop.run_until_complete, coro)
+        coro = self.loop.create_connection(MyProto, 'python.org', 80,
+                                           server_hostname='python.org')
+        self.assertRaises(ValueError, self.loop.run_until_complete, coro)
+
+    def test_create_connection_ssl_server_hostname_errors(self):
+        # When using ssl, server_hostname may be None if host is non-empty.
+        coro = self.loop.create_connection(MyProto, '', 80, ssl=True)
+        self.assertRaises(ValueError, self.loop.run_until_complete, coro)
+        coro = self.loop.create_connection(MyProto, None, 80, ssl=True)
+        self.assertRaises(ValueError, self.loop.run_until_complete, coro)
+        sock = socket.socket()
+        coro = self.loop.create_connection(MyProto, None, None,
+                                           ssl=True, sock=sock)
+        self.addCleanup(sock.close)
+        self.assertRaises(ValueError, self.loop.run_until_complete, coro)
+
+    def test_create_server_empty_host(self):
+        # if host is empty string use None instead
+        host = object()
+
+        @asyncio.coroutine
+        def getaddrinfo(*args, **kw):
+            nonlocal host
+            host = args[0]
+            yield from []
+
+        def getaddrinfo_task(*args, **kwds):
+            return asyncio.Task(getaddrinfo(*args, **kwds), loop=self.loop)
+
+        self.loop.getaddrinfo = getaddrinfo_task
+        fut = self.loop.create_server(MyProto, '', 0)
+        self.assertRaises(OSError, self.loop.run_until_complete, fut)
+        self.assertIsNone(host)
+
+    def test_create_server_host_port_sock(self):
+        fut = self.loop.create_server(
+            MyProto, '0.0.0.0', 0, sock=object())
+        self.assertRaises(ValueError, self.loop.run_until_complete, fut)
+
+    def test_create_server_no_host_port_sock(self):
+        fut = self.loop.create_server(MyProto)
+        self.assertRaises(ValueError, self.loop.run_until_complete, fut)
+
+    def test_create_server_no_getaddrinfo(self):
+        getaddrinfo = self.loop.getaddrinfo = mock.Mock()
+        getaddrinfo.return_value = []
+
+        f = self.loop.create_server(MyProto, '0.0.0.0', 0)
+        self.assertRaises(OSError, self.loop.run_until_complete, f)
+
+    @mock.patch('asyncio.base_events.socket')
+    def test_create_server_cant_bind(self, m_socket):
+
+        class Err(OSError):
+            strerror = 'error'
+
+        m_socket.getaddrinfo.return_value = [
+            (2, 1, 6, '', ('127.0.0.1', 10100))]
+        m_socket.getaddrinfo._is_coroutine = False
+        m_sock = m_socket.socket.return_value = mock.Mock()
+        m_sock.bind.side_effect = Err
+
+        fut = self.loop.create_server(MyProto, '0.0.0.0', 0)
+        self.assertRaises(OSError, self.loop.run_until_complete, fut)
+        self.assertTrue(m_sock.close.called)
+
+    @mock.patch('asyncio.base_events.socket')
+    def test_create_datagram_endpoint_no_addrinfo(self, m_socket):
+        m_socket.getaddrinfo.return_value = []
+        m_socket.getaddrinfo._is_coroutine = False
+
+        coro = self.loop.create_datagram_endpoint(
+            MyDatagramProto, local_addr=('localhost', 0))
+        self.assertRaises(
+            OSError, self.loop.run_until_complete, coro)
+
+    def test_create_datagram_endpoint_addr_error(self):
+        coro = self.loop.create_datagram_endpoint(
+            MyDatagramProto, local_addr='localhost')
+        self.assertRaises(
+            AssertionError, self.loop.run_until_complete, coro)
+        coro = self.loop.create_datagram_endpoint(
+            MyDatagramProto, local_addr=('localhost', 1, 2, 3))
+        self.assertRaises(
+            AssertionError, self.loop.run_until_complete, coro)
+
+    def test_create_datagram_endpoint_connect_err(self):
+        self.loop.sock_connect = mock.Mock()
+        self.loop.sock_connect.side_effect = OSError
+
+        coro = self.loop.create_datagram_endpoint(
+            asyncio.DatagramProtocol, remote_addr=('127.0.0.1', 0))
+        self.assertRaises(
+            OSError, self.loop.run_until_complete, coro)
+
+    @mock.patch('asyncio.base_events.socket')
+    def test_create_datagram_endpoint_socket_err(self, m_socket):
+        m_socket.getaddrinfo = socket.getaddrinfo
+        m_socket.socket.side_effect = OSError
+
+        coro = self.loop.create_datagram_endpoint(
+            asyncio.DatagramProtocol, family=socket.AF_INET)
+        self.assertRaises(
+            OSError, self.loop.run_until_complete, coro)
+
+        coro = self.loop.create_datagram_endpoint(
+            asyncio.DatagramProtocol, local_addr=('127.0.0.1', 0))
+        self.assertRaises(
+            OSError, self.loop.run_until_complete, coro)
+
+    @unittest.skipUnless(support.IPV6_ENABLED, 'IPv6 not supported or enabled')
+    def test_create_datagram_endpoint_no_matching_family(self):
+        coro = self.loop.create_datagram_endpoint(
+            asyncio.DatagramProtocol,
+            remote_addr=('127.0.0.1', 0), local_addr=('::1', 0))
+        self.assertRaises(
+            ValueError, self.loop.run_until_complete, coro)
+
+    @mock.patch('asyncio.base_events.socket')
+    def test_create_datagram_endpoint_setblk_err(self, m_socket):
+        m_socket.socket.return_value.setblocking.side_effect = OSError
+
+        coro = self.loop.create_datagram_endpoint(
+            asyncio.DatagramProtocol, family=socket.AF_INET)
+        self.assertRaises(
+            OSError, self.loop.run_until_complete, coro)
+        self.assertTrue(
+            m_socket.socket.return_value.close.called)
+
+    def test_create_datagram_endpoint_noaddr_nofamily(self):
+        coro = self.loop.create_datagram_endpoint(
+            asyncio.DatagramProtocol)
+        self.assertRaises(ValueError, self.loop.run_until_complete, coro)
+
+    @mock.patch('asyncio.base_events.socket')
+    def test_create_datagram_endpoint_cant_bind(self, m_socket):
+        class Err(OSError):
+            pass
+
+        m_socket.AF_INET6 = socket.AF_INET6
+        m_socket.getaddrinfo = socket.getaddrinfo
+        m_sock = m_socket.socket.return_value = mock.Mock()
+        m_sock.bind.side_effect = Err
+
+        fut = self.loop.create_datagram_endpoint(
+            MyDatagramProto,
+            local_addr=('127.0.0.1', 0), family=socket.AF_INET)
+        self.assertRaises(Err, self.loop.run_until_complete, fut)
+        self.assertTrue(m_sock.close.called)
+
+    def test_accept_connection_retry(self):
+        sock = mock.Mock()
+        sock.accept.side_effect = BlockingIOError()
+
+        self.loop._accept_connection(MyProto, sock)
+        self.assertFalse(sock.close.called)
+
+    @mock.patch('asyncio.base_events.logger')
+    def test_accept_connection_exception(self, m_log):
+        sock = mock.Mock()
+        sock.fileno.return_value = 10
+        sock.accept.side_effect = OSError(errno.EMFILE, 'Too many open files')
+        self.loop.remove_reader = mock.Mock()
+        self.loop.call_later = mock.Mock()
+
+        self.loop._accept_connection(MyProto, sock)
+        self.assertTrue(m_log.error.called)
+        self.assertFalse(sock.close.called)
+        self.loop.remove_reader.assert_called_with(10)
+        self.loop.call_later.assert_called_with(constants.ACCEPT_RETRY_DELAY,
+                                                # self.loop._start_serving
+                                                mock.ANY,
+                                                MyProto, sock, None, None)
+
+    def test_call_coroutine(self):
+        @asyncio.coroutine
+        def simple_coroutine():
+            pass
+
+        coro_func = simple_coroutine
+        coro_obj = coro_func()
+        self.addCleanup(coro_obj.close)
+        for func in (coro_func, coro_obj):
+            with self.assertRaises(TypeError):
+                self.loop.call_soon(func)
+            with self.assertRaises(TypeError):
+                self.loop.call_soon_threadsafe(func)
+            with self.assertRaises(TypeError):
+                self.loop.call_later(60, func)
+            with self.assertRaises(TypeError):
+                self.loop.call_at(self.loop.time() + 60, func)
+            with self.assertRaises(TypeError):
+                self.loop.run_in_executor(None, func)
+
+    @mock.patch('asyncio.base_events.logger')
+    def test_log_slow_callbacks(self, m_logger):
+        def stop_loop_cb(loop):
+            loop.stop()
+
+        @asyncio.coroutine
+        def stop_loop_coro(loop):
+            yield from ()
+            loop.stop()
+
+        asyncio.set_event_loop(self.loop)
+        self.loop.set_debug(True)
+        self.loop.slow_callback_duration = 0.0
+
+        # slow callback
+        self.loop.call_soon(stop_loop_cb, self.loop)
+        self.loop.run_forever()
+        fmt, *args = m_logger.warning.call_args[0]
+        self.assertRegex(fmt % tuple(args),
+                         "^Executing <Handle.*stop_loop_cb.*> "
+                         "took .* seconds$")
+
+        # slow task
+        asyncio.async(stop_loop_coro(self.loop), loop=self.loop)
+        self.loop.run_forever()
+        fmt, *args = m_logger.warning.call_args[0]
+        self.assertRegex(fmt % tuple(args),
+                         "^Executing <Task.*stop_loop_coro.*> "
+                         "took .* seconds$")
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py
new file mode 100644
index 0000000..4b957d8
--- /dev/null
+++ b/Lib/test/test_asyncio/test_events.py
@@ -0,0 +1,2381 @@
+"""Tests for events.py."""
+
+import functools
+import gc
+import io
+import os
+import platform
+import re
+import signal
+import socket
+try:
+    import ssl
+except ImportError:
+    ssl = None
+import subprocess
+import sys
+import threading
+import time
+import errno
+import unittest
+from unittest import mock
+import weakref
+
+
+import asyncio
+from asyncio import proactor_events
+from asyncio import selector_events
+from asyncio import sslproto
+from asyncio import test_utils
+try:
+    from test import support
+except ImportError:
+    from asyncio import test_support as support
+
+
+def data_file(filename):
+    if hasattr(support, 'TEST_HOME_DIR'):
+        fullname = os.path.join(support.TEST_HOME_DIR, filename)
+        if os.path.isfile(fullname):
+            return fullname
+    fullname = os.path.join(os.path.dirname(__file__), filename)
+    if os.path.isfile(fullname):
+        return fullname
+    raise FileNotFoundError(filename)
+
+
+def osx_tiger():
+    """Return True if the platform is Mac OS 10.4 or older."""
+    if sys.platform != 'darwin':
+        return False
+    version = platform.mac_ver()[0]
+    version = tuple(map(int, version.split('.')))
+    return version < (10, 5)
+
+
+ONLYCERT = data_file('ssl_cert.pem')
+ONLYKEY = data_file('ssl_key.pem')
+SIGNED_CERTFILE = data_file('keycert3.pem')
+SIGNING_CA = data_file('pycacert.pem')
+
+
+class MyBaseProto(asyncio.Protocol):
+    connected = None
+    done = None
+
+    def __init__(self, loop=None):
+        self.transport = None
+        self.state = 'INITIAL'
+        self.nbytes = 0
+        if loop is not None:
+            self.connected = asyncio.Future(loop=loop)
+            self.done = asyncio.Future(loop=loop)
+
+    def connection_made(self, transport):
+        self.transport = transport
+        assert self.state == 'INITIAL', self.state
+        self.state = 'CONNECTED'
+        if self.connected:
+            self.connected.set_result(None)
+
+    def data_received(self, data):
+        assert self.state == 'CONNECTED', self.state
+        self.nbytes += len(data)
+
+    def eof_received(self):
+        assert self.state == 'CONNECTED', self.state
+        self.state = 'EOF'
+
+    def connection_lost(self, exc):
+        assert self.state in ('CONNECTED', 'EOF'), self.state
+        self.state = 'CLOSED'
+        if self.done:
+            self.done.set_result(None)
+
+
+class MyProto(MyBaseProto):
+    def connection_made(self, transport):
+        super().connection_made(transport)
+        transport.write(b'GET / HTTP/1.0\r\nHost: example.com\r\n\r\n')
+
+
+class MyDatagramProto(asyncio.DatagramProtocol):
+    done = None
+
+    def __init__(self, loop=None):
+        self.state = 'INITIAL'
+        self.nbytes = 0
+        if loop is not None:
+            self.done = asyncio.Future(loop=loop)
+
+    def connection_made(self, transport):
+        self.transport = transport
+        assert self.state == 'INITIAL', self.state
+        self.state = 'INITIALIZED'
+
+    def datagram_received(self, data, addr):
+        assert self.state == 'INITIALIZED', self.state
+        self.nbytes += len(data)
+
+    def error_received(self, exc):
+        assert self.state == 'INITIALIZED', self.state
+
+    def connection_lost(self, exc):
+        assert self.state == 'INITIALIZED', self.state
+        self.state = 'CLOSED'
+        if self.done:
+            self.done.set_result(None)
+
+
+class MyReadPipeProto(asyncio.Protocol):
+    done = None
+
+    def __init__(self, loop=None):
+        self.state = ['INITIAL']
+        self.nbytes = 0
+        self.transport = None
+        if loop is not None:
+            self.done = asyncio.Future(loop=loop)
+
+    def connection_made(self, transport):
+        self.transport = transport
+        assert self.state == ['INITIAL'], self.state
+        self.state.append('CONNECTED')
+
+    def data_received(self, data):
+        assert self.state == ['INITIAL', 'CONNECTED'], self.state
+        self.nbytes += len(data)
+
+    def eof_received(self):
+        assert self.state == ['INITIAL', 'CONNECTED'], self.state
+        self.state.append('EOF')
+
+    def connection_lost(self, exc):
+        if 'EOF' not in self.state:
+            self.state.append('EOF')  # It is okay if EOF is missed.
+        assert self.state == ['INITIAL', 'CONNECTED', 'EOF'], self.state
+        self.state.append('CLOSED')
+        if self.done:
+            self.done.set_result(None)
+
+
+class MyWritePipeProto(asyncio.BaseProtocol):
+    done = None
+
+    def __init__(self, loop=None):
+        self.state = 'INITIAL'
+        self.transport = None
+        if loop is not None:
+            self.done = asyncio.Future(loop=loop)
+
+    def connection_made(self, transport):
+        self.transport = transport
+        assert self.state == 'INITIAL', self.state
+        self.state = 'CONNECTED'
+
+    def connection_lost(self, exc):
+        assert self.state == 'CONNECTED', self.state
+        self.state = 'CLOSED'
+        if self.done:
+            self.done.set_result(None)
+
+
+class MySubprocessProtocol(asyncio.SubprocessProtocol):
+
+    def __init__(self, loop):
+        self.state = 'INITIAL'
+        self.transport = None
+        self.connected = asyncio.Future(loop=loop)
+        self.completed = asyncio.Future(loop=loop)
+        self.disconnects = {fd: asyncio.Future(loop=loop) for fd in range(3)}
+        self.data = {1: b'', 2: b''}
+        self.returncode = None
+        self.got_data = {1: asyncio.Event(loop=loop),
+                         2: asyncio.Event(loop=loop)}
+
+    def connection_made(self, transport):
+        self.transport = transport
+        assert self.state == 'INITIAL', self.state
+        self.state = 'CONNECTED'
+        self.connected.set_result(None)
+
+    def connection_lost(self, exc):
+        assert self.state == 'CONNECTED', self.state
+        self.state = 'CLOSED'
+        self.completed.set_result(None)
+
+    def pipe_data_received(self, fd, data):
+        assert self.state == 'CONNECTED', self.state
+        self.data[fd] += data
+        self.got_data[fd].set()
+
+    def pipe_connection_lost(self, fd, exc):
+        assert self.state == 'CONNECTED', self.state
+        if exc:
+            self.disconnects[fd].set_exception(exc)
+        else:
+            self.disconnects[fd].set_result(exc)
+
+    def process_exited(self):
+        assert self.state == 'CONNECTED', self.state
+        self.returncode = self.transport.get_returncode()
+
+
+class EventLoopTestsMixin:
+
+    def setUp(self):
+        super().setUp()
+        self.loop = self.create_event_loop()
+        self.set_event_loop(self.loop)
+
+    def tearDown(self):
+        # just in case if we have transport close callbacks
+        if not self.loop.is_closed():
+            test_utils.run_briefly(self.loop)
+
+        self.loop.close()
+        gc.collect()
+        super().tearDown()
+
+    def test_run_until_complete_nesting(self):
+        @asyncio.coroutine
+        def coro1():
+            yield
+
+        @asyncio.coroutine
+        def coro2():
+            self.assertTrue(self.loop.is_running())
+            self.loop.run_until_complete(coro1())
+
+        self.assertRaises(
+            RuntimeError, self.loop.run_until_complete, coro2())
+
+    # Note: because of the default Windows timing granularity of
+    # 15.6 msec, we use fairly long sleep times here (~100 msec).
+
+    def test_run_until_complete(self):
+        t0 = self.loop.time()
+        self.loop.run_until_complete(asyncio.sleep(0.1, loop=self.loop))
+        t1 = self.loop.time()
+        self.assertTrue(0.08 <= t1-t0 <= 0.8, t1-t0)
+
+    def test_run_until_complete_stopped(self):
+        @asyncio.coroutine
+        def cb():
+            self.loop.stop()
+            yield from asyncio.sleep(0.1, loop=self.loop)
+        task = cb()
+        self.assertRaises(RuntimeError,
+                          self.loop.run_until_complete, task)
+
+    def test_call_later(self):
+        results = []
+
+        def callback(arg):
+            results.append(arg)
+            self.loop.stop()
+
+        self.loop.call_later(0.1, callback, 'hello world')
+        t0 = time.monotonic()
+        self.loop.run_forever()
+        t1 = time.monotonic()
+        self.assertEqual(results, ['hello world'])
+        self.assertTrue(0.08 <= t1-t0 <= 0.8, t1-t0)
+
+    def test_call_soon(self):
+        results = []
+
+        def callback(arg1, arg2):
+            results.append((arg1, arg2))
+            self.loop.stop()
+
+        self.loop.call_soon(callback, 'hello', 'world')
+        self.loop.run_forever()
+        self.assertEqual(results, [('hello', 'world')])
+
+    def test_call_soon_threadsafe(self):
+        results = []
+        lock = threading.Lock()
+
+        def callback(arg):
+            results.append(arg)
+            if len(results) >= 2:
+                self.loop.stop()
+
+        def run_in_thread():
+            self.loop.call_soon_threadsafe(callback, 'hello')
+            lock.release()
+
+        lock.acquire()
+        t = threading.Thread(target=run_in_thread)
+        t.start()
+
+        with lock:
+            self.loop.call_soon(callback, 'world')
+            self.loop.run_forever()
+        t.join()
+        self.assertEqual(results, ['hello', 'world'])
+
+    def test_call_soon_threadsafe_same_thread(self):
+        results = []
+
+        def callback(arg):
+            results.append(arg)
+            if len(results) >= 2:
+                self.loop.stop()
+
+        self.loop.call_soon_threadsafe(callback, 'hello')
+        self.loop.call_soon(callback, 'world')
+        self.loop.run_forever()
+        self.assertEqual(results, ['hello', 'world'])
+
+    def test_run_in_executor(self):
+        def run(arg):
+            return (arg, threading.get_ident())
+        f2 = self.loop.run_in_executor(None, run, 'yo')
+        res, thread_id = self.loop.run_until_complete(f2)
+        self.assertEqual(res, 'yo')
+        self.assertNotEqual(thread_id, threading.get_ident())
+
+    def test_reader_callback(self):
+        r, w = test_utils.socketpair()
+        r.setblocking(False)
+        bytes_read = bytearray()
+
+        def reader():
+            try:
+                data = r.recv(1024)
+            except BlockingIOError:
+                # Spurious readiness notifications are possible
+                # at least on Linux -- see man select.
+                return
+            if data:
+                bytes_read.extend(data)
+            else:
+                self.assertTrue(self.loop.remove_reader(r.fileno()))
+                r.close()
+
+        self.loop.add_reader(r.fileno(), reader)
+        self.loop.call_soon(w.send, b'abc')
+        test_utils.run_until(self.loop, lambda: len(bytes_read) >= 3)
+        self.loop.call_soon(w.send, b'def')
+        test_utils.run_until(self.loop, lambda: len(bytes_read) >= 6)
+        self.loop.call_soon(w.close)
+        self.loop.call_soon(self.loop.stop)
+        self.loop.run_forever()
+        self.assertEqual(bytes_read, b'abcdef')
+
+    def test_writer_callback(self):
+        r, w = test_utils.socketpair()
+        w.setblocking(False)
+
+        def writer(data):
+            w.send(data)
+            self.loop.stop()
+
+        data = b'x' * 1024
+        self.loop.add_writer(w.fileno(), writer, data)
+        self.loop.run_forever()
+
+        self.assertTrue(self.loop.remove_writer(w.fileno()))
+        self.assertFalse(self.loop.remove_writer(w.fileno()))
+
+        w.close()
+        read = r.recv(len(data) * 2)
+        r.close()
+        self.assertEqual(read, data)
+
+    def _basetest_sock_client_ops(self, httpd, sock):
+        if not isinstance(self.loop, proactor_events.BaseProactorEventLoop):
+            # in debug mode, socket operations must fail
+            # if the socket is not in blocking mode
+            self.loop.set_debug(True)
+            sock.setblocking(True)
+            with self.assertRaises(ValueError):
+                self.loop.run_until_complete(
+                    self.loop.sock_connect(sock, httpd.address))
+            with self.assertRaises(ValueError):
+                self.loop.run_until_complete(
+                    self.loop.sock_sendall(sock, b'GET / HTTP/1.0\r\n\r\n'))
+            with self.assertRaises(ValueError):
+                self.loop.run_until_complete(
+                    self.loop.sock_recv(sock, 1024))
+            with self.assertRaises(ValueError):
+                self.loop.run_until_complete(
+                    self.loop.sock_accept(sock))
+
+        # test in non-blocking mode
+        sock.setblocking(False)
+        self.loop.run_until_complete(
+            self.loop.sock_connect(sock, httpd.address))
+        self.loop.run_until_complete(
+            self.loop.sock_sendall(sock, b'GET / HTTP/1.0\r\n\r\n'))
+        data = self.loop.run_until_complete(
+            self.loop.sock_recv(sock, 1024))
+        # consume data
+        self.loop.run_until_complete(
+            self.loop.sock_recv(sock, 1024))
+        sock.close()
+        self.assertTrue(data.startswith(b'HTTP/1.0 200 OK'))
+
+    def test_sock_client_ops(self):
+        with test_utils.run_test_server() as httpd:
+            sock = socket.socket()
+            self._basetest_sock_client_ops(httpd, sock)
+
+    @unittest.skipUnless(hasattr(socket, 'AF_UNIX'), 'No UNIX Sockets')
+    def test_unix_sock_client_ops(self):
+        with test_utils.run_test_unix_server() as httpd:
+            sock = socket.socket(socket.AF_UNIX)
+            self._basetest_sock_client_ops(httpd, sock)
+
+    def test_sock_client_fail(self):
+        # Make sure that we will get an unused port
+        address = None
+        try:
+            s = socket.socket()
+            s.bind(('127.0.0.1', 0))
+            address = s.getsockname()
+        finally:
+            s.close()
+
+        sock = socket.socket()
+        sock.setblocking(False)
+        with self.assertRaises(ConnectionRefusedError):
+            self.loop.run_until_complete(
+                self.loop.sock_connect(sock, address))
+        sock.close()
+
+    def test_sock_accept(self):
+        listener = socket.socket()
+        listener.setblocking(False)
+        listener.bind(('127.0.0.1', 0))
+        listener.listen(1)
+        client = socket.socket()
+        client.connect(listener.getsockname())
+
+        f = self.loop.sock_accept(listener)
+        conn, addr = self.loop.run_until_complete(f)
+        self.assertEqual(conn.gettimeout(), 0)
+        self.assertEqual(addr, client.getsockname())
+        self.assertEqual(client.getpeername(), listener.getsockname())
+        client.close()
+        conn.close()
+        listener.close()
+
+    @unittest.skipUnless(hasattr(signal, 'SIGKILL'), 'No SIGKILL')
+    def test_add_signal_handler(self):
+        caught = 0
+
+        def my_handler():
+            nonlocal caught
+            caught += 1
+
+        # Check error behavior first.
+        self.assertRaises(
+            TypeError, self.loop.add_signal_handler, 'boom', my_handler)
+        self.assertRaises(
+            TypeError, self.loop.remove_signal_handler, 'boom')
+        self.assertRaises(
+            ValueError, self.loop.add_signal_handler, signal.NSIG+1,
+            my_handler)
+        self.assertRaises(
+            ValueError, self.loop.remove_signal_handler, signal.NSIG+1)
+        self.assertRaises(
+            ValueError, self.loop.add_signal_handler, 0, my_handler)
+        self.assertRaises(
+            ValueError, self.loop.remove_signal_handler, 0)
+        self.assertRaises(
+            ValueError, self.loop.add_signal_handler, -1, my_handler)
+        self.assertRaises(
+            ValueError, self.loop.remove_signal_handler, -1)
+        self.assertRaises(
+            RuntimeError, self.loop.add_signal_handler, signal.SIGKILL,
+            my_handler)
+        # Removing SIGKILL doesn't raise, since we don't call signal().
+        self.assertFalse(self.loop.remove_signal_handler(signal.SIGKILL))
+        # Now set a handler and handle it.
+        self.loop.add_signal_handler(signal.SIGINT, my_handler)
+
+        os.kill(os.getpid(), signal.SIGINT)
+        test_utils.run_until(self.loop, lambda: caught)
+
+        # Removing it should restore the default handler.
+        self.assertTrue(self.loop.remove_signal_handler(signal.SIGINT))
+        self.assertEqual(signal.getsignal(signal.SIGINT),
+                         signal.default_int_handler)
+        # Removing again returns False.
+        self.assertFalse(self.loop.remove_signal_handler(signal.SIGINT))
+
+    @unittest.skipUnless(hasattr(signal, 'SIGALRM'), 'No SIGALRM')
+    def test_signal_handling_while_selecting(self):
+        # Test with a signal actually arriving during a select() call.
+        caught = 0
+
+        def my_handler():
+            nonlocal caught
+            caught += 1
+            self.loop.stop()
+
+        self.loop.add_signal_handler(signal.SIGALRM, my_handler)
+
+        signal.setitimer(signal.ITIMER_REAL, 0.01, 0)  # Send SIGALRM once.
+        self.loop.run_forever()
+        self.assertEqual(caught, 1)
+
+    @unittest.skipUnless(hasattr(signal, 'SIGALRM'), 'No SIGALRM')
+    def test_signal_handling_args(self):
+        some_args = (42,)
+        caught = 0
+
+        def my_handler(*args):
+            nonlocal caught
+            caught += 1
+            self.assertEqual(args, some_args)
+
+        self.loop.add_signal_handler(signal.SIGALRM, my_handler, *some_args)
+
+        signal.setitimer(signal.ITIMER_REAL, 0.1, 0)  # Send SIGALRM once.
+        self.loop.call_later(0.5, self.loop.stop)
+        self.loop.run_forever()
+        self.assertEqual(caught, 1)
+
+    def _basetest_create_connection(self, connection_fut, check_sockname=True):
+        tr, pr = self.loop.run_until_complete(connection_fut)
+        self.assertIsInstance(tr, asyncio.Transport)
+        self.assertIsInstance(pr, asyncio.Protocol)
+        self.assertIs(pr.transport, tr)
+        if check_sockname:
+            self.assertIsNotNone(tr.get_extra_info('sockname'))
+        self.loop.run_until_complete(pr.done)
+        self.assertGreater(pr.nbytes, 0)
+        tr.close()
+
+    def test_create_connection(self):
+        with test_utils.run_test_server() as httpd:
+            conn_fut = self.loop.create_connection(
+                lambda: MyProto(loop=self.loop), *httpd.address)
+            self._basetest_create_connection(conn_fut)
+
+    @unittest.skipUnless(hasattr(socket, 'AF_UNIX'), 'No UNIX Sockets')
+    def test_create_unix_connection(self):
+        # Issue #20682: On Mac OS X Tiger, getsockname() returns a
+        # zero-length address for UNIX socket.
+        check_sockname = not osx_tiger()
+
+        with test_utils.run_test_unix_server() as httpd:
+            conn_fut = self.loop.create_unix_connection(
+                lambda: MyProto(loop=self.loop), httpd.address)
+            self._basetest_create_connection(conn_fut, check_sockname)
+
+    def test_create_connection_sock(self):
+        with test_utils.run_test_server() as httpd:
+            sock = None
+            infos = self.loop.run_until_complete(
+                self.loop.getaddrinfo(
+                    *httpd.address, type=socket.SOCK_STREAM))
+            for family, type, proto, cname, address in infos:
+                try:
+                    sock = socket.socket(family=family, type=type, proto=proto)
+                    sock.setblocking(False)
+                    self.loop.run_until_complete(
+                        self.loop.sock_connect(sock, address))
+                except:
+                    pass
+                else:
+                    break
+            else:
+                assert False, 'Can not create socket.'
+
+            f = self.loop.create_connection(
+                lambda: MyProto(loop=self.loop), sock=sock)
+            tr, pr = self.loop.run_until_complete(f)
+            self.assertIsInstance(tr, asyncio.Transport)
+            self.assertIsInstance(pr, asyncio.Protocol)
+            self.loop.run_until_complete(pr.done)
+            self.assertGreater(pr.nbytes, 0)
+            tr.close()
+
+    def _basetest_create_ssl_connection(self, connection_fut,
+                                        check_sockname=True):
+        tr, pr = self.loop.run_until_complete(connection_fut)
+        self.assertIsInstance(tr, asyncio.Transport)
+        self.assertIsInstance(pr, asyncio.Protocol)
+        self.assertTrue('ssl' in tr.__class__.__name__.lower())
+        if check_sockname:
+            self.assertIsNotNone(tr.get_extra_info('sockname'))
+        self.loop.run_until_complete(pr.done)
+        self.assertGreater(pr.nbytes, 0)
+        tr.close()
+
+    def _test_create_ssl_connection(self, httpd, create_connection,
+                                    check_sockname=True):
+        conn_fut = create_connection(ssl=test_utils.dummy_ssl_context())
+        self._basetest_create_ssl_connection(conn_fut, check_sockname)
+
+        # ssl.Purpose was introduced in Python 3.4
+        if hasattr(ssl, 'Purpose'):
+            def _dummy_ssl_create_context(purpose=ssl.Purpose.SERVER_AUTH, *,
+                                          cafile=None, capath=None,
+                                          cadata=None):
+                """
+                A ssl.create_default_context() replacement that doesn't enable
+                cert validation.
+                """
+                self.assertEqual(purpose, ssl.Purpose.SERVER_AUTH)
+                return test_utils.dummy_ssl_context()
+
+            # With ssl=True, ssl.create_default_context() should be called
+            with mock.patch('ssl.create_default_context',
+                            side_effect=_dummy_ssl_create_context) as m:
+                conn_fut = create_connection(ssl=True)
+                self._basetest_create_ssl_connection(conn_fut, check_sockname)
+                self.assertEqual(m.call_count, 1)
+
+        # With the real ssl.create_default_context(), certificate
+        # validation will fail
+        with self.assertRaises(ssl.SSLError) as cm:
+            conn_fut = create_connection(ssl=True)
+            # Ignore the "SSL handshake failed" log in debug mode
+            with test_utils.disable_logger():
+                self._basetest_create_ssl_connection(conn_fut, check_sockname)
+
+        self.assertEqual(cm.exception.reason, 'CERTIFICATE_VERIFY_FAILED')
+
+    @unittest.skipIf(ssl is None, 'No ssl module')
+    def test_create_ssl_connection(self):
+        with test_utils.run_test_server(use_ssl=True) as httpd:
+            create_connection = functools.partial(
+                self.loop.create_connection,
+                lambda: MyProto(loop=self.loop),
+                *httpd.address)
+            self._test_create_ssl_connection(httpd, create_connection)
+
+    def test_legacy_create_ssl_connection(self):
+        with test_utils.force_legacy_ssl_support():
+            self.test_create_ssl_connection()
+
+    @unittest.skipIf(ssl is None, 'No ssl module')
+    @unittest.skipUnless(hasattr(socket, 'AF_UNIX'), 'No UNIX Sockets')
+    def test_create_ssl_unix_connection(self):
+        # Issue #20682: On Mac OS X Tiger, getsockname() returns a
+        # zero-length address for UNIX socket.
+        check_sockname = not osx_tiger()
+
+        with test_utils.run_test_unix_server(use_ssl=True) as httpd:
+            create_connection = functools.partial(
+                self.loop.create_unix_connection,
+                lambda: MyProto(loop=self.loop), httpd.address,
+                server_hostname='127.0.0.1')
+
+            self._test_create_ssl_connection(httpd, create_connection,
+                                             check_sockname)
+
+    def test_legacy_create_ssl_unix_connection(self):
+        with test_utils.force_legacy_ssl_support():
+            self.test_create_ssl_unix_connection()
+
+    def test_create_connection_local_addr(self):
+        with test_utils.run_test_server() as httpd:
+            port = support.find_unused_port()
+            f = self.loop.create_connection(
+                lambda: MyProto(loop=self.loop),
+                *httpd.address, local_addr=(httpd.address[0], port))
+            tr, pr = self.loop.run_until_complete(f)
+            expected = pr.transport.get_extra_info('sockname')[1]
+            self.assertEqual(port, expected)
+            tr.close()
+
+    def test_create_connection_local_addr_in_use(self):
+        with test_utils.run_test_server() as httpd:
+            f = self.loop.create_connection(
+                lambda: MyProto(loop=self.loop),
+                *httpd.address, local_addr=httpd.address)
+            with self.assertRaises(OSError) as cm:
+                self.loop.run_until_complete(f)
+            self.assertEqual(cm.exception.errno, errno.EADDRINUSE)
+            self.assertIn(str(httpd.address), cm.exception.strerror)
+
+    def test_create_server(self):
+        proto = MyProto(self.loop)
+        f = self.loop.create_server(lambda: proto, '0.0.0.0', 0)
+        server = self.loop.run_until_complete(f)
+        self.assertEqual(len(server.sockets), 1)
+        sock = server.sockets[0]
+        host, port = sock.getsockname()
+        self.assertEqual(host, '0.0.0.0')
+        client = socket.socket()
+        client.connect(('127.0.0.1', port))
+        client.sendall(b'xxx')
+
+        self.loop.run_until_complete(proto.connected)
+        self.assertEqual('CONNECTED', proto.state)
+
+        test_utils.run_until(self.loop, lambda: proto.nbytes > 0)
+        self.assertEqual(3, proto.nbytes)
+
+        # extra info is available
+        self.assertIsNotNone(proto.transport.get_extra_info('sockname'))
+        self.assertEqual('127.0.0.1',
+                         proto.transport.get_extra_info('peername')[0])
+
+        # close connection
+        proto.transport.close()
+        self.loop.run_until_complete(proto.done)
+
+        self.assertEqual('CLOSED', proto.state)
+
+        # the client socket must be closed after to avoid ECONNRESET upon
+        # recv()/send() on the serving socket
+        client.close()
+
+        # close server
+        server.close()
+
+    def _make_unix_server(self, factory, **kwargs):
+        path = test_utils.gen_unix_socket_path()
+        self.addCleanup(lambda: os.path.exists(path) and os.unlink(path))
+
+        f = self.loop.create_unix_server(factory, path, **kwargs)
+        server = self.loop.run_until_complete(f)
+
+        return server, path
+
+    @unittest.skipUnless(hasattr(socket, 'AF_UNIX'), 'No UNIX Sockets')
+    def test_create_unix_server(self):
+        proto = MyProto(loop=self.loop)
+        server, path = self._make_unix_server(lambda: proto)
+        self.assertEqual(len(server.sockets), 1)
+
+        client = socket.socket(socket.AF_UNIX)
+        client.connect(path)
+        client.sendall(b'xxx')
+
+        self.loop.run_until_complete(proto.connected)
+        self.assertEqual('CONNECTED', proto.state)
+        test_utils.run_until(self.loop, lambda: proto.nbytes > 0)
+        self.assertEqual(3, proto.nbytes)
+
+        # close connection
+        proto.transport.close()
+        self.loop.run_until_complete(proto.done)
+
+        self.assertEqual('CLOSED', proto.state)
+
+        # the client socket must be closed after to avoid ECONNRESET upon
+        # recv()/send() on the serving socket
+        client.close()
+
+        # close server
+        server.close()
+
+    @unittest.skipUnless(hasattr(socket, 'AF_UNIX'), 'No UNIX Sockets')
+    def test_create_unix_server_path_socket_error(self):
+        proto = MyProto(loop=self.loop)
+        sock = socket.socket()
+        with sock:
+            f = self.loop.create_unix_server(lambda: proto, '/test', sock=sock)
+            with self.assertRaisesRegex(ValueError,
+                                        'path and sock can not be specified '
+                                        'at the same time'):
+                self.loop.run_until_complete(f)
+
+    def _create_ssl_context(self, certfile, keyfile=None):
+        sslcontext = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+        sslcontext.options |= ssl.OP_NO_SSLv2
+        sslcontext.load_cert_chain(certfile, keyfile)
+        return sslcontext
+
+    def _make_ssl_server(self, factory, certfile, keyfile=None):
+        sslcontext = self._create_ssl_context(certfile, keyfile)
+
+        f = self.loop.create_server(factory, '127.0.0.1', 0, ssl=sslcontext)
+        server = self.loop.run_until_complete(f)
+
+        sock = server.sockets[0]
+        host, port = sock.getsockname()
+        self.assertEqual(host, '127.0.0.1')
+        return server, host, port
+
+    def _make_ssl_unix_server(self, factory, certfile, keyfile=None):
+        sslcontext = self._create_ssl_context(certfile, keyfile)
+        return self._make_unix_server(factory, ssl=sslcontext)
+
+    @unittest.skipIf(ssl is None, 'No ssl module')
+    def test_create_server_ssl(self):
+        proto = MyProto(loop=self.loop)
+        server, host, port = self._make_ssl_server(
+            lambda: proto, ONLYCERT, ONLYKEY)
+
+        f_c = self.loop.create_connection(MyBaseProto, host, port,
+                                          ssl=test_utils.dummy_ssl_context())
+        client, pr = self.loop.run_until_complete(f_c)
+
+        client.write(b'xxx')
+        self.loop.run_until_complete(proto.connected)
+        self.assertEqual('CONNECTED', proto.state)
+
+        test_utils.run_until(self.loop, lambda: proto.nbytes > 0)
+        self.assertEqual(3, proto.nbytes)
+
+        # extra info is available
+        self.assertIsNotNone(proto.transport.get_extra_info('sockname'))
+        self.assertEqual('127.0.0.1',
+                         proto.transport.get_extra_info('peername')[0])
+
+        # close connection
+        proto.transport.close()
+        self.loop.run_until_complete(proto.done)
+        self.assertEqual('CLOSED', proto.state)
+
+        # the client socket must be closed after to avoid ECONNRESET upon
+        # recv()/send() on the serving socket
+        client.close()
+
+        # stop serving
+        server.close()
+
+    def test_legacy_create_server_ssl(self):
+        with test_utils.force_legacy_ssl_support():
+            self.test_create_server_ssl()
+
+    @unittest.skipIf(ssl is None, 'No ssl module')
+    @unittest.skipUnless(hasattr(socket, 'AF_UNIX'), 'No UNIX Sockets')
+    def test_create_unix_server_ssl(self):
+        proto = MyProto(loop=self.loop)
+        server, path = self._make_ssl_unix_server(
+            lambda: proto, ONLYCERT, ONLYKEY)
+
+        f_c = self.loop.create_unix_connection(
+            MyBaseProto, path, ssl=test_utils.dummy_ssl_context(),
+            server_hostname='')
+
+        client, pr = self.loop.run_until_complete(f_c)
+
+        client.write(b'xxx')
+        self.loop.run_until_complete(proto.connected)
+        self.assertEqual('CONNECTED', proto.state)
+        test_utils.run_until(self.loop, lambda: proto.nbytes > 0)
+        self.assertEqual(3, proto.nbytes)
+
+        # close connection
+        proto.transport.close()
+        self.loop.run_until_complete(proto.done)
+        self.assertEqual('CLOSED', proto.state)
+
+        # the client socket must be closed after to avoid ECONNRESET upon
+        # recv()/send() on the serving socket
+        client.close()
+
+        # stop serving
+        server.close()
+
+    def test_legacy_create_unix_server_ssl(self):
+        with test_utils.force_legacy_ssl_support():
+            self.test_create_unix_server_ssl()
+
+    @unittest.skipIf(ssl is None, 'No ssl module')
+    def test_create_server_ssl_verify_failed(self):
+        proto = MyProto(loop=self.loop)
+        server, host, port = self._make_ssl_server(
+            lambda: proto, SIGNED_CERTFILE)
+
+        sslcontext_client = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+        sslcontext_client.options |= ssl.OP_NO_SSLv2
+        sslcontext_client.verify_mode = ssl.CERT_REQUIRED
+        if hasattr(sslcontext_client, 'check_hostname'):
+            sslcontext_client.check_hostname = True
+
+
+        # no CA loaded
+        f_c = self.loop.create_connection(MyProto, host, port,
+                                          ssl=sslcontext_client)
+        with mock.patch.object(self.loop, 'call_exception_handler'):
+            with test_utils.disable_logger():
+                with self.assertRaisesRegex(ssl.SSLError,
+                                            'certificate verify failed '):
+                    self.loop.run_until_complete(f_c)
+
+            # execute the loop to log the connection error
+            test_utils.run_briefly(self.loop)
+
+        # close connection
+        self.assertIsNone(proto.transport)
+        server.close()
+
+    def test_legacy_create_server_ssl_verify_failed(self):
+        with test_utils.force_legacy_ssl_support():
+            self.test_create_server_ssl_verify_failed()
+
+    @unittest.skipIf(ssl is None, 'No ssl module')
+    @unittest.skipUnless(hasattr(socket, 'AF_UNIX'), 'No UNIX Sockets')
+    def test_create_unix_server_ssl_verify_failed(self):
+        proto = MyProto(loop=self.loop)
+        server, path = self._make_ssl_unix_server(
+            lambda: proto, SIGNED_CERTFILE)
+
+        sslcontext_client = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+        sslcontext_client.options |= ssl.OP_NO_SSLv2
+        sslcontext_client.verify_mode = ssl.CERT_REQUIRED
+        if hasattr(sslcontext_client, 'check_hostname'):
+            sslcontext_client.check_hostname = True
+
+        # no CA loaded
+        f_c = self.loop.create_unix_connection(MyProto, path,
+                                               ssl=sslcontext_client,
+                                               server_hostname='invalid')
+        with mock.patch.object(self.loop, 'call_exception_handler'):
+            with test_utils.disable_logger():
+                with self.assertRaisesRegex(ssl.SSLError,
+                                            'certificate verify failed '):
+                    self.loop.run_until_complete(f_c)
+
+            # execute the loop to log the connection error
+            test_utils.run_briefly(self.loop)
+
+        # close connection
+        self.assertIsNone(proto.transport)
+        server.close()
+
+
+    def test_legacy_create_unix_server_ssl_verify_failed(self):
+        with test_utils.force_legacy_ssl_support():
+            self.test_create_unix_server_ssl_verify_failed()
+
+    @unittest.skipIf(ssl is None, 'No ssl module')
+    def test_create_server_ssl_match_failed(self):
+        proto = MyProto(loop=self.loop)
+        server, host, port = self._make_ssl_server(
+            lambda: proto, SIGNED_CERTFILE)
+
+        sslcontext_client = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+        sslcontext_client.options |= ssl.OP_NO_SSLv2
+        sslcontext_client.verify_mode = ssl.CERT_REQUIRED
+        sslcontext_client.load_verify_locations(
+            cafile=SIGNING_CA)
+        if hasattr(sslcontext_client, 'check_hostname'):
+            sslcontext_client.check_hostname = True
+
+        # incorrect server_hostname
+        f_c = self.loop.create_connection(MyProto, host, port,
+                                          ssl=sslcontext_client)
+        with mock.patch.object(self.loop, 'call_exception_handler'):
+            with test_utils.disable_logger():
+                with self.assertRaisesRegex(
+                        ssl.CertificateError,
+                        "hostname '127.0.0.1' doesn't match 'localhost'"):
+                    self.loop.run_until_complete(f_c)
+
+        # close connection
+        proto.transport.close()
+        server.close()
+
+    def test_legacy_create_server_ssl_match_failed(self):
+        with test_utils.force_legacy_ssl_support():
+            self.test_create_server_ssl_match_failed()
+
+    @unittest.skipIf(ssl is None, 'No ssl module')
+    @unittest.skipUnless(hasattr(socket, 'AF_UNIX'), 'No UNIX Sockets')
+    def test_create_unix_server_ssl_verified(self):
+        proto = MyProto(loop=self.loop)
+        server, path = self._make_ssl_unix_server(
+            lambda: proto, SIGNED_CERTFILE)
+
+        sslcontext_client = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+        sslcontext_client.options |= ssl.OP_NO_SSLv2
+        sslcontext_client.verify_mode = ssl.CERT_REQUIRED
+        sslcontext_client.load_verify_locations(cafile=SIGNING_CA)
+        if hasattr(sslcontext_client, 'check_hostname'):
+            sslcontext_client.check_hostname = True
+
+        # Connection succeeds with correct CA and server hostname.
+        f_c = self.loop.create_unix_connection(MyProto, path,
+                                               ssl=sslcontext_client,
+                                               server_hostname='localhost')
+        client, pr = self.loop.run_until_complete(f_c)
+
+        # close connection
+        proto.transport.close()
+        client.close()
+        server.close()
+        self.loop.run_until_complete(proto.done)
+
+    def test_legacy_create_unix_server_ssl_verified(self):
+        with test_utils.force_legacy_ssl_support():
+            self.test_create_unix_server_ssl_verified()
+
+    @unittest.skipIf(ssl is None, 'No ssl module')
+    def test_create_server_ssl_verified(self):
+        proto = MyProto(loop=self.loop)
+        server, host, port = self._make_ssl_server(
+            lambda: proto, SIGNED_CERTFILE)
+
+        sslcontext_client = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+        sslcontext_client.options |= ssl.OP_NO_SSLv2
+        sslcontext_client.verify_mode = ssl.CERT_REQUIRED
+        sslcontext_client.load_verify_locations(cafile=SIGNING_CA)
+        if hasattr(sslcontext_client, 'check_hostname'):
+            sslcontext_client.check_hostname = True
+
+        # Connection succeeds with correct CA and server hostname.
+        f_c = self.loop.create_connection(MyProto, host, port,
+                                          ssl=sslcontext_client,
+                                          server_hostname='localhost')
+        client, pr = self.loop.run_until_complete(f_c)
+
+        # close connection
+        proto.transport.close()
+        client.close()
+        server.close()
+        self.loop.run_until_complete(proto.done)
+
+    def test_legacy_create_server_ssl_verified(self):
+        with test_utils.force_legacy_ssl_support():
+            self.test_create_server_ssl_verified()
+
+    def test_create_server_sock(self):
+        proto = asyncio.Future(loop=self.loop)
+
+        class TestMyProto(MyProto):
+            def connection_made(self, transport):
+                super().connection_made(transport)
+                proto.set_result(self)
+
+        sock_ob = socket.socket(type=socket.SOCK_STREAM)
+        sock_ob.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
+        sock_ob.bind(('0.0.0.0', 0))
+
+        f = self.loop.create_server(TestMyProto, sock=sock_ob)
+        server = self.loop.run_until_complete(f)
+        sock = server.sockets[0]
+        self.assertIs(sock, sock_ob)
+
+        host, port = sock.getsockname()
+        self.assertEqual(host, '0.0.0.0')
+        client = socket.socket()
+        client.connect(('127.0.0.1', port))
+        client.send(b'xxx')
+        client.close()
+        server.close()
+
+    def test_create_server_addr_in_use(self):
+        sock_ob = socket.socket(type=socket.SOCK_STREAM)
+        sock_ob.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
+        sock_ob.bind(('0.0.0.0', 0))
+
+        f = self.loop.create_server(MyProto, sock=sock_ob)
+        server = self.loop.run_until_complete(f)
+        sock = server.sockets[0]
+        host, port = sock.getsockname()
+
+        f = self.loop.create_server(MyProto, host=host, port=port)
+        with self.assertRaises(OSError) as cm:
+            self.loop.run_until_complete(f)
+        self.assertEqual(cm.exception.errno, errno.EADDRINUSE)
+
+        server.close()
+
+    @unittest.skipUnless(support.IPV6_ENABLED, 'IPv6 not supported or enabled')
+    def test_create_server_dual_stack(self):
+        f_proto = asyncio.Future(loop=self.loop)
+
+        class TestMyProto(MyProto):
+            def connection_made(self, transport):
+                super().connection_made(transport)
+                f_proto.set_result(self)
+
+        try_count = 0
+        while True:
+            try:
+                port = support.find_unused_port()
+                f = self.loop.create_server(TestMyProto, host=None, port=port)
+                server = self.loop.run_until_complete(f)
+            except OSError as ex:
+                if ex.errno == errno.EADDRINUSE:
+                    try_count += 1
+                    self.assertGreaterEqual(5, try_count)
+                    continue
+                else:
+                    raise
+            else:
+                break
+        client = socket.socket()
+        client.connect(('127.0.0.1', port))
+        client.send(b'xxx')
+        proto = self.loop.run_until_complete(f_proto)
+        proto.transport.close()
+        client.close()
+
+        f_proto = asyncio.Future(loop=self.loop)
+        client = socket.socket(socket.AF_INET6)
+        client.connect(('::1', port))
+        client.send(b'xxx')
+        proto = self.loop.run_until_complete(f_proto)
+        proto.transport.close()
+        client.close()
+
+        server.close()
+
+    def test_server_close(self):
+        f = self.loop.create_server(MyProto, '0.0.0.0', 0)
+        server = self.loop.run_until_complete(f)
+        sock = server.sockets[0]
+        host, port = sock.getsockname()
+
+        client = socket.socket()
+        client.connect(('127.0.0.1', port))
+        client.send(b'xxx')
+        client.close()
+
+        server.close()
+
+        client = socket.socket()
+        self.assertRaises(
+            ConnectionRefusedError, client.connect, ('127.0.0.1', port))
+        client.close()
+
+    def test_create_datagram_endpoint(self):
+        class TestMyDatagramProto(MyDatagramProto):
+            def __init__(inner_self):
+                super().__init__(loop=self.loop)
+
+            def datagram_received(self, data, addr):
+                super().datagram_received(data, addr)
+                self.transport.sendto(b'resp:'+data, addr)
+
+        coro = self.loop.create_datagram_endpoint(
+            TestMyDatagramProto, local_addr=('127.0.0.1', 0))
+        s_transport, server = self.loop.run_until_complete(coro)
+        host, port = s_transport.get_extra_info('sockname')
+
+        self.assertIsInstance(s_transport, asyncio.Transport)
+        self.assertIsInstance(server, TestMyDatagramProto)
+        self.assertEqual('INITIALIZED', server.state)
+        self.assertIs(server.transport, s_transport)
+
+        coro = self.loop.create_datagram_endpoint(
+            lambda: MyDatagramProto(loop=self.loop),
+            remote_addr=(host, port))
+        transport, client = self.loop.run_until_complete(coro)
+
+        self.assertIsInstance(transport, asyncio.Transport)
+        self.assertIsInstance(client, MyDatagramProto)
+        self.assertEqual('INITIALIZED', client.state)
+        self.assertIs(client.transport, transport)
+
+        transport.sendto(b'xxx')
+        test_utils.run_until(self.loop, lambda: server.nbytes)
+        self.assertEqual(3, server.nbytes)
+        test_utils.run_until(self.loop, lambda: client.nbytes)
+
+        # received
+        self.assertEqual(8, client.nbytes)
+
+        # extra info is available
+        self.assertIsNotNone(transport.get_extra_info('sockname'))
+
+        # close connection
+        transport.close()
+        self.loop.run_until_complete(client.done)
+        self.assertEqual('CLOSED', client.state)
+        server.transport.close()
+
+    def test_internal_fds(self):
+        loop = self.create_event_loop()
+        if not isinstance(loop, selector_events.BaseSelectorEventLoop):
+            loop.close()
+            self.skipTest('loop is not a BaseSelectorEventLoop')
+
+        self.assertEqual(1, loop._internal_fds)
+        loop.close()
+        self.assertEqual(0, loop._internal_fds)
+        self.assertIsNone(loop._csock)
+        self.assertIsNone(loop._ssock)
+
+    @unittest.skipUnless(sys.platform != 'win32',
+                         "Don't support pipes for Windows")
+    def test_read_pipe(self):
+        proto = MyReadPipeProto(loop=self.loop)
+
+        rpipe, wpipe = os.pipe()
+        pipeobj = io.open(rpipe, 'rb', 1024)
+
+        @asyncio.coroutine
+        def connect():
+            t, p = yield from self.loop.connect_read_pipe(
+                lambda: proto, pipeobj)
+            self.assertIs(p, proto)
+            self.assertIs(t, proto.transport)
+            self.assertEqual(['INITIAL', 'CONNECTED'], proto.state)
+            self.assertEqual(0, proto.nbytes)
+
+        self.loop.run_until_complete(connect())
+
+        os.write(wpipe, b'1')
+        test_utils.run_until(self.loop, lambda: proto.nbytes >= 1)
+        self.assertEqual(1, proto.nbytes)
+
+        os.write(wpipe, b'2345')
+        test_utils.run_until(self.loop, lambda: proto.nbytes >= 5)
+        self.assertEqual(['INITIAL', 'CONNECTED'], proto.state)
+        self.assertEqual(5, proto.nbytes)
+
+        os.close(wpipe)
+        self.loop.run_until_complete(proto.done)
+        self.assertEqual(
+            ['INITIAL', 'CONNECTED', 'EOF', 'CLOSED'], proto.state)
+        # extra info is available
+        self.assertIsNotNone(proto.transport.get_extra_info('pipe'))
+
+    @unittest.skipUnless(sys.platform != 'win32',
+                         "Don't support pipes for Windows")
+    # select, poll and kqueue don't support character devices (PTY) on Mac OS X
+    # older than 10.6 (Snow Leopard)
+    @support.requires_mac_ver(10, 6)
+    # Issue #20495: The test hangs on FreeBSD 7.2 but pass on FreeBSD 9
+    @support.requires_freebsd_version(8)
+    def test_read_pty_output(self):
+        proto = MyReadPipeProto(loop=self.loop)
+
+        master, slave = os.openpty()
+        master_read_obj = io.open(master, 'rb', 0)
+
+        @asyncio.coroutine
+        def connect():
+            t, p = yield from self.loop.connect_read_pipe(lambda: proto,
+                                                          master_read_obj)
+            self.assertIs(p, proto)
+            self.assertIs(t, proto.transport)
+            self.assertEqual(['INITIAL', 'CONNECTED'], proto.state)
+            self.assertEqual(0, proto.nbytes)
+
+        self.loop.run_until_complete(connect())
+
+        os.write(slave, b'1')
+        test_utils.run_until(self.loop, lambda: proto.nbytes)
+        self.assertEqual(1, proto.nbytes)
+
+        os.write(slave, b'2345')
+        test_utils.run_until(self.loop, lambda: proto.nbytes >= 5)
+        self.assertEqual(['INITIAL', 'CONNECTED'], proto.state)
+        self.assertEqual(5, proto.nbytes)
+
+        os.close(slave)
+        self.loop.run_until_complete(proto.done)
+        self.assertEqual(
+            ['INITIAL', 'CONNECTED', 'EOF', 'CLOSED'], proto.state)
+        # extra info is available
+        self.assertIsNotNone(proto.transport.get_extra_info('pipe'))
+
+    @unittest.skipUnless(sys.platform != 'win32',
+                         "Don't support pipes for Windows")
+    def test_write_pipe(self):
+        rpipe, wpipe = os.pipe()
+        pipeobj = io.open(wpipe, 'wb', 1024)
+
+        proto = MyWritePipeProto(loop=self.loop)
+        connect = self.loop.connect_write_pipe(lambda: proto, pipeobj)
+        transport, p = self.loop.run_until_complete(connect)
+        self.assertIs(p, proto)
+        self.assertIs(transport, proto.transport)
+        self.assertEqual('CONNECTED', proto.state)
+
+        transport.write(b'1')
+
+        data = bytearray()
+        def reader(data):
+            chunk = os.read(rpipe, 1024)
+            data += chunk
+            return len(data)
+
+        test_utils.run_until(self.loop, lambda: reader(data) >= 1)
+        self.assertEqual(b'1', data)
+
+        transport.write(b'2345')
+        test_utils.run_until(self.loop, lambda: reader(data) >= 5)
+        self.assertEqual(b'12345', data)
+        self.assertEqual('CONNECTED', proto.state)
+
+        os.close(rpipe)
+
+        # extra info is available
+        self.assertIsNotNone(proto.transport.get_extra_info('pipe'))
+
+        # close connection
+        proto.transport.close()
+        self.loop.run_until_complete(proto.done)
+        self.assertEqual('CLOSED', proto.state)
+
+    @unittest.skipUnless(sys.platform != 'win32',
+                         "Don't support pipes for Windows")
+    def test_write_pipe_disconnect_on_close(self):
+        rsock, wsock = test_utils.socketpair()
+        rsock.setblocking(False)
+        pipeobj = io.open(wsock.detach(), 'wb', 1024)
+
+        proto = MyWritePipeProto(loop=self.loop)
+        connect = self.loop.connect_write_pipe(lambda: proto, pipeobj)
+        transport, p = self.loop.run_until_complete(connect)
+        self.assertIs(p, proto)
+        self.assertIs(transport, proto.transport)
+        self.assertEqual('CONNECTED', proto.state)
+
+        transport.write(b'1')
+        data = self.loop.run_until_complete(self.loop.sock_recv(rsock, 1024))
+        self.assertEqual(b'1', data)
+
+        rsock.close()
+
+        self.loop.run_until_complete(proto.done)
+        self.assertEqual('CLOSED', proto.state)
+
+    @unittest.skipUnless(sys.platform != 'win32',
+                         "Don't support pipes for Windows")
+    # select, poll and kqueue don't support character devices (PTY) on Mac OS X
+    # older than 10.6 (Snow Leopard)
+    @support.requires_mac_ver(10, 6)
+    def test_write_pty(self):
+        master, slave = os.openpty()
+        slave_write_obj = io.open(slave, 'wb', 0)
+
+        proto = MyWritePipeProto(loop=self.loop)
+        connect = self.loop.connect_write_pipe(lambda: proto, slave_write_obj)
+        transport, p = self.loop.run_until_complete(connect)
+        self.assertIs(p, proto)
+        self.assertIs(transport, proto.transport)
+        self.assertEqual('CONNECTED', proto.state)
+
+        transport.write(b'1')
+
+        data = bytearray()
+        def reader(data):
+            chunk = os.read(master, 1024)
+            data += chunk
+            return len(data)
+
+        test_utils.run_until(self.loop, lambda: reader(data) >= 1,
+                             timeout=10)
+        self.assertEqual(b'1', data)
+
+        transport.write(b'2345')
+        test_utils.run_until(self.loop, lambda: reader(data) >= 5,
+                             timeout=10)
+        self.assertEqual(b'12345', data)
+        self.assertEqual('CONNECTED', proto.state)
+
+        os.close(master)
+
+        # extra info is available
+        self.assertIsNotNone(proto.transport.get_extra_info('pipe'))
+
+        # close connection
+        proto.transport.close()
+        self.loop.run_until_complete(proto.done)
+        self.assertEqual('CLOSED', proto.state)
+
+    def test_prompt_cancellation(self):
+        r, w = test_utils.socketpair()
+        r.setblocking(False)
+        f = self.loop.sock_recv(r, 1)
+        ov = getattr(f, 'ov', None)
+        if ov is not None:
+            self.assertTrue(ov.pending)
+
+        @asyncio.coroutine
+        def main():
+            try:
+                self.loop.call_soon(f.cancel)
+                yield from f
+            except asyncio.CancelledError:
+                res = 'cancelled'
+            else:
+                res = None
+            finally:
+                self.loop.stop()
+            return res
+
+        start = time.monotonic()
+        t = asyncio.Task(main(), loop=self.loop)
+        self.loop.run_forever()
+        elapsed = time.monotonic() - start
+
+        self.assertLess(elapsed, 0.1)
+        self.assertEqual(t.result(), 'cancelled')
+        self.assertRaises(asyncio.CancelledError, f.result)
+        if ov is not None:
+            self.assertFalse(ov.pending)
+        self.loop._stop_serving(r)
+
+        r.close()
+        w.close()
+
+    def test_timeout_rounding(self):
+        def _run_once():
+            self.loop._run_once_counter += 1
+            orig_run_once()
+
+        orig_run_once = self.loop._run_once
+        self.loop._run_once_counter = 0
+        self.loop._run_once = _run_once
+
+        @asyncio.coroutine
+        def wait():
+            loop = self.loop
+            yield from asyncio.sleep(1e-2, loop=loop)
+            yield from asyncio.sleep(1e-4, loop=loop)
+            yield from asyncio.sleep(1e-6, loop=loop)
+            yield from asyncio.sleep(1e-8, loop=loop)
+            yield from asyncio.sleep(1e-10, loop=loop)
+
+        self.loop.run_until_complete(wait())
+        # The ideal number of call is 12, but on some platforms, the selector
+        # may sleep at little bit less than timeout depending on the resolution
+        # of the clock used by the kernel. Tolerate a few useless calls on
+        # these platforms.
+        self.assertLessEqual(self.loop._run_once_counter, 20,
+            {'clock_resolution': self.loop._clock_resolution,
+             'selector': self.loop._selector.__class__.__name__})
+
+    def test_sock_connect_address(self):
+        addresses = [(socket.AF_INET, ('www.python.org', 80))]
+        if support.IPV6_ENABLED:
+            addresses.extend((
+                (socket.AF_INET6, ('www.python.org', 80)),
+                (socket.AF_INET6, ('www.python.org', 80, 0, 0)),
+            ))
+
+        for family, address in addresses:
+            for sock_type in (socket.SOCK_STREAM, socket.SOCK_DGRAM):
+                sock = socket.socket(family, sock_type)
+                with sock:
+                    sock.setblocking(False)
+                    connect = self.loop.sock_connect(sock, address)
+                    with self.assertRaises(ValueError) as cm:
+                        self.loop.run_until_complete(connect)
+                    self.assertIn('address must be resolved',
+                                  str(cm.exception))
+
+    def test_remove_fds_after_closing(self):
+        loop = self.create_event_loop()
+        callback = lambda: None
+        r, w = test_utils.socketpair()
+        self.addCleanup(r.close)
+        self.addCleanup(w.close)
+        loop.add_reader(r, callback)
+        loop.add_writer(w, callback)
+        loop.close()
+        self.assertFalse(loop.remove_reader(r))
+        self.assertFalse(loop.remove_writer(w))
+
+    def test_add_fds_after_closing(self):
+        loop = self.create_event_loop()
+        callback = lambda: None
+        r, w = test_utils.socketpair()
+        self.addCleanup(r.close)
+        self.addCleanup(w.close)
+        loop.close()
+        with self.assertRaises(RuntimeError):
+            loop.add_reader(r, callback)
+        with self.assertRaises(RuntimeError):
+            loop.add_writer(w, callback)
+
+    def test_close_running_event_loop(self):
+        @asyncio.coroutine
+        def close_loop(loop):
+            self.loop.close()
+
+        coro = close_loop(self.loop)
+        with self.assertRaises(RuntimeError):
+            self.loop.run_until_complete(coro)
+
+    def test_close(self):
+        self.loop.close()
+
+        @asyncio.coroutine
+        def test():
+            pass
+
+        func = lambda: False
+        coro = test()
+        self.addCleanup(coro.close)
+
+        # operation blocked when the loop is closed
+        with self.assertRaises(RuntimeError):
+            self.loop.run_forever()
+        with self.assertRaises(RuntimeError):
+            fut = asyncio.Future(loop=self.loop)
+            self.loop.run_until_complete(fut)
+        with self.assertRaises(RuntimeError):
+            self.loop.call_soon(func)
+        with self.assertRaises(RuntimeError):
+            self.loop.call_soon_threadsafe(func)
+        with self.assertRaises(RuntimeError):
+            self.loop.call_later(1.0, func)
+        with self.assertRaises(RuntimeError):
+            self.loop.call_at(self.loop.time() + .0, func)
+        with self.assertRaises(RuntimeError):
+            self.loop.run_in_executor(None, func)
+        with self.assertRaises(RuntimeError):
+            self.loop.create_task(coro)
+        with self.assertRaises(RuntimeError):
+            self.loop.add_signal_handler(signal.SIGTERM, func)
+
+
+class SubprocessTestsMixin:
+
+    def check_terminated(self, returncode):
+        if sys.platform == 'win32':
+            self.assertIsInstance(returncode, int)
+            # expect 1 but sometimes get 0
+        else:
+            self.assertEqual(-signal.SIGTERM, returncode)
+
+    def check_killed(self, returncode):
+        if sys.platform == 'win32':
+            self.assertIsInstance(returncode, int)
+            # expect 1 but sometimes get 0
+        else:
+            self.assertEqual(-signal.SIGKILL, returncode)
+
+    def test_subprocess_exec(self):
+        prog = os.path.join(os.path.dirname(__file__), 'echo.py')
+
+        connect = self.loop.subprocess_exec(
+                        functools.partial(MySubprocessProtocol, self.loop),
+                        sys.executable, prog)
+        transp, proto = self.loop.run_until_complete(connect)
+        self.assertIsInstance(proto, MySubprocessProtocol)
+        self.loop.run_until_complete(proto.connected)
+        self.assertEqual('CONNECTED', proto.state)
+
+        stdin = transp.get_pipe_transport(0)
+        stdin.write(b'Python The Winner')
+        self.loop.run_until_complete(proto.got_data[1].wait())
+        with test_utils.disable_logger():
+            transp.close()
+        self.loop.run_until_complete(proto.completed)
+        self.check_killed(proto.returncode)
+        self.assertEqual(b'Python The Winner', proto.data[1])
+
+    def test_subprocess_interactive(self):
+        prog = os.path.join(os.path.dirname(__file__), 'echo.py')
+
+        connect = self.loop.subprocess_exec(
+                        functools.partial(MySubprocessProtocol, self.loop),
+                        sys.executable, prog)
+        transp, proto = self.loop.run_until_complete(connect)
+        self.assertIsInstance(proto, MySubprocessProtocol)
+        self.loop.run_until_complete(proto.connected)
+        self.assertEqual('CONNECTED', proto.state)
+
+        stdin = transp.get_pipe_transport(0)
+        stdin.write(b'Python ')
+        self.loop.run_until_complete(proto.got_data[1].wait())
+        proto.got_data[1].clear()
+        self.assertEqual(b'Python ', proto.data[1])
+
+        stdin.write(b'The Winner')
+        self.loop.run_until_complete(proto.got_data[1].wait())
+        self.assertEqual(b'Python The Winner', proto.data[1])
+
+        with test_utils.disable_logger():
+            transp.close()
+        self.loop.run_until_complete(proto.completed)
+        self.check_killed(proto.returncode)
+
+    def test_subprocess_shell(self):
+        connect = self.loop.subprocess_shell(
+                        functools.partial(MySubprocessProtocol, self.loop),
+                        'echo Python')
+        transp, proto = self.loop.run_until_complete(connect)
+        self.assertIsInstance(proto, MySubprocessProtocol)
+        self.loop.run_until_complete(proto.connected)
+
+        transp.get_pipe_transport(0).close()
+        self.loop.run_until_complete(proto.completed)
+        self.assertEqual(0, proto.returncode)
+        self.assertTrue(all(f.done() for f in proto.disconnects.values()))
+        self.assertEqual(proto.data[1].rstrip(b'\r\n'), b'Python')
+        self.assertEqual(proto.data[2], b'')
+        transp.close()
+
+    def test_subprocess_exitcode(self):
+        connect = self.loop.subprocess_shell(
+                        functools.partial(MySubprocessProtocol, self.loop),
+                        'exit 7', stdin=None, stdout=None, stderr=None)
+        transp, proto = self.loop.run_until_complete(connect)
+        self.assertIsInstance(proto, MySubprocessProtocol)
+        self.loop.run_until_complete(proto.completed)
+        self.assertEqual(7, proto.returncode)
+        transp.close()
+
+    def test_subprocess_close_after_finish(self):
+        connect = self.loop.subprocess_shell(
+                        functools.partial(MySubprocessProtocol, self.loop),
+                        'exit 7', stdin=None, stdout=None, stderr=None)
+        transp, proto = self.loop.run_until_complete(connect)
+        self.assertIsInstance(proto, MySubprocessProtocol)
+        self.assertIsNone(transp.get_pipe_transport(0))
+        self.assertIsNone(transp.get_pipe_transport(1))
+        self.assertIsNone(transp.get_pipe_transport(2))
+        self.loop.run_until_complete(proto.completed)
+        self.assertEqual(7, proto.returncode)
+        self.assertIsNone(transp.close())
+
+    def test_subprocess_kill(self):
+        prog = os.path.join(os.path.dirname(__file__), 'echo.py')
+
+        connect = self.loop.subprocess_exec(
+                        functools.partial(MySubprocessProtocol, self.loop),
+                        sys.executable, prog)
+        transp, proto = self.loop.run_until_complete(connect)
+        self.assertIsInstance(proto, MySubprocessProtocol)
+        self.loop.run_until_complete(proto.connected)
+
+        transp.kill()
+        self.loop.run_until_complete(proto.completed)
+        self.check_killed(proto.returncode)
+        transp.close()
+
+    def test_subprocess_terminate(self):
+        prog = os.path.join(os.path.dirname(__file__), 'echo.py')
+
+        connect = self.loop.subprocess_exec(
+                        functools.partial(MySubprocessProtocol, self.loop),
+                        sys.executable, prog)
+        transp, proto = self.loop.run_until_complete(connect)
+        self.assertIsInstance(proto, MySubprocessProtocol)
+        self.loop.run_until_complete(proto.connected)
+
+        transp.terminate()
+        self.loop.run_until_complete(proto.completed)
+        self.check_terminated(proto.returncode)
+        transp.close()
+
+    @unittest.skipIf(sys.platform == 'win32', "Don't have SIGHUP")
+    def test_subprocess_send_signal(self):
+        prog = os.path.join(os.path.dirname(__file__), 'echo.py')
+
+        connect = self.loop.subprocess_exec(
+                        functools.partial(MySubprocessProtocol, self.loop),
+                        sys.executable, prog)
+        transp, proto = self.loop.run_until_complete(connect)
+        self.assertIsInstance(proto, MySubprocessProtocol)
+        self.loop.run_until_complete(proto.connected)
+
+        transp.send_signal(signal.SIGHUP)
+        self.loop.run_until_complete(proto.completed)
+        self.assertEqual(-signal.SIGHUP, proto.returncode)
+        transp.close()
+
+    def test_subprocess_stderr(self):
+        prog = os.path.join(os.path.dirname(__file__), 'echo2.py')
+
+        connect = self.loop.subprocess_exec(
+                        functools.partial(MySubprocessProtocol, self.loop),
+                        sys.executable, prog)
+        transp, proto = self.loop.run_until_complete(connect)
+        self.assertIsInstance(proto, MySubprocessProtocol)
+        self.loop.run_until_complete(proto.connected)
+
+        stdin = transp.get_pipe_transport(0)
+        stdin.write(b'test')
+
+        self.loop.run_until_complete(proto.completed)
+
+        transp.close()
+        self.assertEqual(b'OUT:test', proto.data[1])
+        self.assertTrue(proto.data[2].startswith(b'ERR:test'), proto.data[2])
+        self.assertEqual(0, proto.returncode)
+
+    def test_subprocess_stderr_redirect_to_stdout(self):
+        prog = os.path.join(os.path.dirname(__file__), 'echo2.py')
+
+        connect = self.loop.subprocess_exec(
+                        functools.partial(MySubprocessProtocol, self.loop),
+                        sys.executable, prog, stderr=subprocess.STDOUT)
+        transp, proto = self.loop.run_until_complete(connect)
+        self.assertIsInstance(proto, MySubprocessProtocol)
+        self.loop.run_until_complete(proto.connected)
+
+        stdin = transp.get_pipe_transport(0)
+        self.assertIsNotNone(transp.get_pipe_transport(1))
+        self.assertIsNone(transp.get_pipe_transport(2))
+
+        stdin.write(b'test')
+        self.loop.run_until_complete(proto.completed)
+        self.assertTrue(proto.data[1].startswith(b'OUT:testERR:test'),
+                        proto.data[1])
+        self.assertEqual(b'', proto.data[2])
+
+        transp.close()
+        self.assertEqual(0, proto.returncode)
+
+    def test_subprocess_close_client_stream(self):
+        prog = os.path.join(os.path.dirname(__file__), 'echo3.py')
+
+        connect = self.loop.subprocess_exec(
+                        functools.partial(MySubprocessProtocol, self.loop),
+                        sys.executable, prog)
+        transp, proto = self.loop.run_until_complete(connect)
+        self.assertIsInstance(proto, MySubprocessProtocol)
+        self.loop.run_until_complete(proto.connected)
+
+        stdin = transp.get_pipe_transport(0)
+        stdout = transp.get_pipe_transport(1)
+        stdin.write(b'test')
+        self.loop.run_until_complete(proto.got_data[1].wait())
+        self.assertEqual(b'OUT:test', proto.data[1])
+
+        stdout.close()
+        self.loop.run_until_complete(proto.disconnects[1])
+        stdin.write(b'xxx')
+        self.loop.run_until_complete(proto.got_data[2].wait())
+        if sys.platform != 'win32':
+            self.assertEqual(b'ERR:BrokenPipeError', proto.data[2])
+        else:
+            # After closing the read-end of a pipe, writing to the
+            # write-end using os.write() fails with errno==EINVAL and
+            # GetLastError()==ERROR_INVALID_NAME on Windows!?!  (Using
+            # WriteFile() we get ERROR_BROKEN_PIPE as expected.)
+            self.assertEqual(b'ERR:OSError', proto.data[2])
+        with test_utils.disable_logger():
+            transp.close()
+        self.loop.run_until_complete(proto.completed)
+        self.check_killed(proto.returncode)
+
+    def test_subprocess_wait_no_same_group(self):
+        # start the new process in a new session
+        connect = self.loop.subprocess_shell(
+                        functools.partial(MySubprocessProtocol, self.loop),
+                        'exit 7', stdin=None, stdout=None, stderr=None,
+                        start_new_session=True)
+        _, proto = yield self.loop.run_until_complete(connect)
+        self.assertIsInstance(proto, MySubprocessProtocol)
+        self.loop.run_until_complete(proto.completed)
+        self.assertEqual(7, proto.returncode)
+
+    def test_subprocess_exec_invalid_args(self):
+        @asyncio.coroutine
+        def connect(**kwds):
+            yield from self.loop.subprocess_exec(
+                asyncio.SubprocessProtocol,
+                'pwd', **kwds)
+
+        with self.assertRaises(ValueError):
+            self.loop.run_until_complete(connect(universal_newlines=True))
+        with self.assertRaises(ValueError):
+            self.loop.run_until_complete(connect(bufsize=4096))
+        with self.assertRaises(ValueError):
+            self.loop.run_until_complete(connect(shell=True))
+
+    def test_subprocess_shell_invalid_args(self):
+        @asyncio.coroutine
+        def connect(cmd=None, **kwds):
+            if not cmd:
+                cmd = 'pwd'
+            yield from self.loop.subprocess_shell(
+                asyncio.SubprocessProtocol,
+                cmd, **kwds)
+
+        with self.assertRaises(ValueError):
+            self.loop.run_until_complete(connect(['ls', '-l']))
+        with self.assertRaises(ValueError):
+            self.loop.run_until_complete(connect(universal_newlines=True))
+        with self.assertRaises(ValueError):
+            self.loop.run_until_complete(connect(bufsize=4096))
+        with self.assertRaises(ValueError):
+            self.loop.run_until_complete(connect(shell=False))
+
+
+if sys.platform == 'win32':
+
+    class SelectEventLoopTests(EventLoopTestsMixin, test_utils.TestCase):
+
+        def create_event_loop(self):
+            return asyncio.SelectorEventLoop()
+
+    class ProactorEventLoopTests(EventLoopTestsMixin,
+                                 SubprocessTestsMixin,
+                                 test_utils.TestCase):
+
+        def create_event_loop(self):
+            return asyncio.ProactorEventLoop()
+
+        if not sslproto._is_sslproto_available():
+            def test_create_ssl_connection(self):
+                raise unittest.SkipTest("need python 3.5 (ssl.MemoryBIO)")
+
+            def test_create_server_ssl(self):
+                raise unittest.SkipTest("need python 3.5 (ssl.MemoryBIO)")
+
+            def test_create_server_ssl_verify_failed(self):
+                raise unittest.SkipTest("need python 3.5 (ssl.MemoryBIO)")
+
+            def test_create_server_ssl_match_failed(self):
+                raise unittest.SkipTest("need python 3.5 (ssl.MemoryBIO)")
+
+            def test_create_server_ssl_verified(self):
+                raise unittest.SkipTest("need python 3.5 (ssl.MemoryBIO)")
+
+        def test_legacy_create_ssl_connection(self):
+            raise unittest.SkipTest("IocpEventLoop incompatible with legacy SSL")
+
+        def test_legacy_create_server_ssl(self):
+            raise unittest.SkipTest("IocpEventLoop incompatible with legacy SSL")
+
+        def test_legacy_create_server_ssl_verify_failed(self):
+            raise unittest.SkipTest("IocpEventLoop incompatible with legacy SSL")
+
+        def test_legacy_create_server_ssl_match_failed(self):
+            raise unittest.SkipTest("IocpEventLoop incompatible with legacy SSL")
+
+        def test_legacy_create_server_ssl_verified(self):
+            raise unittest.SkipTest("IocpEventLoop incompatible with legacy SSL")
+
+        def test_reader_callback(self):
+            raise unittest.SkipTest("IocpEventLoop does not have add_reader()")
+
+        def test_reader_callback_cancel(self):
+            raise unittest.SkipTest("IocpEventLoop does not have add_reader()")
+
+        def test_writer_callback(self):
+            raise unittest.SkipTest("IocpEventLoop does not have add_writer()")
+
+        def test_writer_callback_cancel(self):
+            raise unittest.SkipTest("IocpEventLoop does not have add_writer()")
+
+        def test_create_datagram_endpoint(self):
+            raise unittest.SkipTest(
+                "IocpEventLoop does not have create_datagram_endpoint()")
+
+        def test_remove_fds_after_closing(self):
+            raise unittest.SkipTest("IocpEventLoop does not have add_reader()")
+else:
+    from asyncio import selectors
+
+    class UnixEventLoopTestsMixin(EventLoopTestsMixin):
+        def setUp(self):
+            super().setUp()
+            watcher = asyncio.SafeChildWatcher()
+            watcher.attach_loop(self.loop)
+            asyncio.set_child_watcher(watcher)
+
+        def tearDown(self):
+            asyncio.set_child_watcher(None)
+            super().tearDown()
+
+    if hasattr(selectors, 'KqueueSelector'):
+        class KqueueEventLoopTests(UnixEventLoopTestsMixin,
+                                   SubprocessTestsMixin,
+                                   test_utils.TestCase):
+
+            def create_event_loop(self):
+                return asyncio.SelectorEventLoop(
+                    selectors.KqueueSelector())
+
+            # kqueue doesn't support character devices (PTY) on Mac OS X older
+            # than 10.9 (Maverick)
+            @support.requires_mac_ver(10, 9)
+            # Issue #20667: KqueueEventLoopTests.test_read_pty_output()
+            # hangs on OpenBSD 5.5
+            @unittest.skipIf(sys.platform.startswith('openbsd'),
+                             'test hangs on OpenBSD')
+            def test_read_pty_output(self):
+                super().test_read_pty_output()
+
+            # kqueue doesn't support character devices (PTY) on Mac OS X older
+            # than 10.9 (Maverick)
+            @support.requires_mac_ver(10, 9)
+            def test_write_pty(self):
+                super().test_write_pty()
+
+    if hasattr(selectors, 'EpollSelector'):
+        class EPollEventLoopTests(UnixEventLoopTestsMixin,
+                                  SubprocessTestsMixin,
+                                  test_utils.TestCase):
+
+            def create_event_loop(self):
+                return asyncio.SelectorEventLoop(selectors.EpollSelector())
+
+    if hasattr(selectors, 'PollSelector'):
+        class PollEventLoopTests(UnixEventLoopTestsMixin,
+                                 SubprocessTestsMixin,
+                                 test_utils.TestCase):
+
+            def create_event_loop(self):
+                return asyncio.SelectorEventLoop(selectors.PollSelector())
+
+    # Should always exist.
+    class SelectEventLoopTests(UnixEventLoopTestsMixin,
+                               SubprocessTestsMixin,
+                               test_utils.TestCase):
+
+        def create_event_loop(self):
+            return asyncio.SelectorEventLoop(selectors.SelectSelector())
+
+
+def noop(*args):
+    pass
+
+
+class HandleTests(test_utils.TestCase):
+
+    def setUp(self):
+        self.loop = mock.Mock()
+        self.loop.get_debug.return_value = True
+
+    def test_handle(self):
+        def callback(*args):
+            return args
+
+        args = ()
+        h = asyncio.Handle(callback, args, self.loop)
+        self.assertIs(h._callback, callback)
+        self.assertIs(h._args, args)
+        self.assertFalse(h._cancelled)
+
+        h.cancel()
+        self.assertTrue(h._cancelled)
+
+    def test_handle_from_handle(self):
+        def callback(*args):
+            return args
+        h1 = asyncio.Handle(callback, (), loop=self.loop)
+        self.assertRaises(
+            AssertionError, asyncio.Handle, h1, (), self.loop)
+
+    def test_callback_with_exception(self):
+        def callback():
+            raise ValueError()
+
+        self.loop = mock.Mock()
+        self.loop.call_exception_handler = mock.Mock()
+
+        h = asyncio.Handle(callback, (), self.loop)
+        h._run()
+
+        self.loop.call_exception_handler.assert_called_with({
+            'message': test_utils.MockPattern('Exception in callback.*'),
+            'exception': mock.ANY,
+            'handle': h,
+            'source_traceback': h._source_traceback,
+        })
+
+    def test_handle_weakref(self):
+        wd = weakref.WeakValueDictionary()
+        h = asyncio.Handle(lambda: None, (), self.loop)
+        wd['h'] = h  # Would fail without __weakref__ slot.
+
+    def test_handle_repr(self):
+        self.loop.get_debug.return_value = False
+
+        # simple function
+        h = asyncio.Handle(noop, (1, 2), self.loop)
+        filename, lineno = test_utils.get_function_source(noop)
+        self.assertEqual(repr(h),
+                        '<Handle noop(1, 2) at %s:%s>'
+                        % (filename, lineno))
+
+        # cancelled handle
+        h.cancel()
+        self.assertEqual(repr(h),
+                        '<Handle cancelled>')
+
+        # decorated function
+        cb = asyncio.coroutine(noop)
+        h = asyncio.Handle(cb, (), self.loop)
+        self.assertEqual(repr(h),
+                        '<Handle noop() at %s:%s>'
+                        % (filename, lineno))
+
+        # partial function
+        cb = functools.partial(noop, 1, 2)
+        h = asyncio.Handle(cb, (3,), self.loop)
+        regex = (r'^<Handle noop\(1, 2\)\(3\) at %s:%s>$'
+                 % (re.escape(filename), lineno))
+        self.assertRegex(repr(h), regex)
+
+        # partial method
+        if sys.version_info >= (3, 4):
+            method = HandleTests.test_handle_repr
+            cb = functools.partialmethod(method)
+            filename, lineno = test_utils.get_function_source(method)
+            h = asyncio.Handle(cb, (), self.loop)
+
+            cb_regex = r'<function HandleTests.test_handle_repr .*>'
+            cb_regex = (r'functools.partialmethod\(%s, , \)\(\)' % cb_regex)
+            regex = (r'^<Handle %s at %s:%s>$'
+                     % (cb_regex, re.escape(filename), lineno))
+            self.assertRegex(repr(h), regex)
+
+    def test_handle_repr_debug(self):
+        self.loop.get_debug.return_value = True
+
+        # simple function
+        create_filename = __file__
+        create_lineno = sys._getframe().f_lineno + 1
+        h = asyncio.Handle(noop, (1, 2), self.loop)
+        filename, lineno = test_utils.get_function_source(noop)
+        self.assertEqual(repr(h),
+                        '<Handle noop(1, 2) at %s:%s created at %s:%s>'
+                        % (filename, lineno, create_filename, create_lineno))
+
+        # cancelled handle
+        h.cancel()
+        self.assertEqual(
+            repr(h),
+            '<Handle cancelled noop(1, 2) at %s:%s created at %s:%s>'
+            % (filename, lineno, create_filename, create_lineno))
+
+        # double cancellation won't overwrite _repr
+        h.cancel()
+        self.assertEqual(
+            repr(h),
+            '<Handle cancelled noop(1, 2) at %s:%s created at %s:%s>'
+            % (filename, lineno, create_filename, create_lineno))
+
+    def test_handle_source_traceback(self):
+        loop = asyncio.get_event_loop_policy().new_event_loop()
+        loop.set_debug(True)
+        self.set_event_loop(loop)
+
+        def check_source_traceback(h):
+            lineno = sys._getframe(1).f_lineno - 1
+            self.assertIsInstance(h._source_traceback, list)
+            self.assertEqual(h._source_traceback[-1][:3],
+                             (__file__,
+                              lineno,
+                              'test_handle_source_traceback'))
+
+        # call_soon
+        h = loop.call_soon(noop)
+        check_source_traceback(h)
+
+        # call_soon_threadsafe
+        h = loop.call_soon_threadsafe(noop)
+        check_source_traceback(h)
+
+        # call_later
+        h = loop.call_later(0, noop)
+        check_source_traceback(h)
+
+        # call_at
+        h = loop.call_later(0, noop)
+        check_source_traceback(h)
+
+
+class TimerTests(unittest.TestCase):
+
+    def setUp(self):
+        self.loop = mock.Mock()
+
+    def test_hash(self):
+        when = time.monotonic()
+        h = asyncio.TimerHandle(when, lambda: False, (),
+                                mock.Mock())
+        self.assertEqual(hash(h), hash(when))
+
+    def test_timer(self):
+        def callback(*args):
+            return args
+
+        args = (1, 2, 3)
+        when = time.monotonic()
+        h = asyncio.TimerHandle(when, callback, args, mock.Mock())
+        self.assertIs(h._callback, callback)
+        self.assertIs(h._args, args)
+        self.assertFalse(h._cancelled)
+
+        # cancel
+        h.cancel()
+        self.assertTrue(h._cancelled)
+        self.assertIsNone(h._callback)
+        self.assertIsNone(h._args)
+
+        # when cannot be None
+        self.assertRaises(AssertionError,
+                          asyncio.TimerHandle, None, callback, args,
+                          self.loop)
+
+    def test_timer_repr(self):
+        self.loop.get_debug.return_value = False
+
+        # simple function
+        h = asyncio.TimerHandle(123, noop, (), self.loop)
+        src = test_utils.get_function_source(noop)
+        self.assertEqual(repr(h),
+                        '<TimerHandle when=123 noop() at %s:%s>' % src)
+
+        # cancelled handle
+        h.cancel()
+        self.assertEqual(repr(h),
+                        '<TimerHandle cancelled when=123>')
+
+    def test_timer_repr_debug(self):
+        self.loop.get_debug.return_value = True
+
+        # simple function
+        create_filename = __file__
+        create_lineno = sys._getframe().f_lineno + 1
+        h = asyncio.TimerHandle(123, noop, (), self.loop)
+        filename, lineno = test_utils.get_function_source(noop)
+        self.assertEqual(repr(h),
+                        '<TimerHandle when=123 noop() '
+                        'at %s:%s created at %s:%s>'
+                        % (filename, lineno, create_filename, create_lineno))
+
+        # cancelled handle
+        h.cancel()
+        self.assertEqual(repr(h),
+                        '<TimerHandle cancelled when=123 noop() '
+                        'at %s:%s created at %s:%s>'
+                        % (filename, lineno, create_filename, create_lineno))
+
+
+    def test_timer_comparison(self):
+        def callback(*args):
+            return args
+
+        when = time.monotonic()
+
+        h1 = asyncio.TimerHandle(when, callback, (), self.loop)
+        h2 = asyncio.TimerHandle(when, callback, (), self.loop)
+        # TODO: Use assertLess etc.
+        self.assertFalse(h1 < h2)
+        self.assertFalse(h2 < h1)
+        self.assertTrue(h1 <= h2)
+        self.assertTrue(h2 <= h1)
+        self.assertFalse(h1 > h2)
+        self.assertFalse(h2 > h1)
+        self.assertTrue(h1 >= h2)
+        self.assertTrue(h2 >= h1)
+        self.assertTrue(h1 == h2)
+        self.assertFalse(h1 != h2)
+
+        h2.cancel()
+        self.assertFalse(h1 == h2)
+
+        h1 = asyncio.TimerHandle(when, callback, (), self.loop)
+        h2 = asyncio.TimerHandle(when + 10.0, callback, (), self.loop)
+        self.assertTrue(h1 < h2)
+        self.assertFalse(h2 < h1)
+        self.assertTrue(h1 <= h2)
+        self.assertFalse(h2 <= h1)
+        self.assertFalse(h1 > h2)
+        self.assertTrue(h2 > h1)
+        self.assertFalse(h1 >= h2)
+        self.assertTrue(h2 >= h1)
+        self.assertFalse(h1 == h2)
+        self.assertTrue(h1 != h2)
+
+        h3 = asyncio.Handle(callback, (), self.loop)
+        self.assertIs(NotImplemented, h1.__eq__(h3))
+        self.assertIs(NotImplemented, h1.__ne__(h3))
+
+
+class AbstractEventLoopTests(unittest.TestCase):
+
+    def test_not_implemented(self):
+        f = mock.Mock()
+        loop = asyncio.AbstractEventLoop()
+        self.assertRaises(
+            NotImplementedError, loop.run_forever)
+        self.assertRaises(
+            NotImplementedError, loop.run_until_complete, None)
+        self.assertRaises(
+            NotImplementedError, loop.stop)
+        self.assertRaises(
+            NotImplementedError, loop.is_running)
+        self.assertRaises(
+            NotImplementedError, loop.is_closed)
+        self.assertRaises(
+            NotImplementedError, loop.close)
+        self.assertRaises(
+            NotImplementedError, loop.create_task, None)
+        self.assertRaises(
+            NotImplementedError, loop.call_later, None, None)
+        self.assertRaises(
+            NotImplementedError, loop.call_at, f, f)
+        self.assertRaises(
+            NotImplementedError, loop.call_soon, None)
+        self.assertRaises(
+            NotImplementedError, loop.time)
+        self.assertRaises(
+            NotImplementedError, loop.call_soon_threadsafe, None)
+        self.assertRaises(
+            NotImplementedError, loop.run_in_executor, f, f)
+        self.assertRaises(
+            NotImplementedError, loop.set_default_executor, f)
+        self.assertRaises(
+            NotImplementedError, loop.getaddrinfo, 'localhost', 8080)
+        self.assertRaises(
+            NotImplementedError, loop.getnameinfo, ('localhost', 8080))
+        self.assertRaises(
+            NotImplementedError, loop.create_connection, f)
+        self.assertRaises(
+            NotImplementedError, loop.create_server, f)
+        self.assertRaises(
+            NotImplementedError, loop.create_datagram_endpoint, f)
+        self.assertRaises(
+            NotImplementedError, loop.add_reader, 1, f)
+        self.assertRaises(
+            NotImplementedError, loop.remove_reader, 1)
+        self.assertRaises(
+            NotImplementedError, loop.add_writer, 1, f)
+        self.assertRaises(
+            NotImplementedError, loop.remove_writer, 1)
+        self.assertRaises(
+            NotImplementedError, loop.sock_recv, f, 10)
+        self.assertRaises(
+            NotImplementedError, loop.sock_sendall, f, 10)
+        self.assertRaises(
+            NotImplementedError, loop.sock_connect, f, f)
+        self.assertRaises(
+            NotImplementedError, loop.sock_accept, f)
+        self.assertRaises(
+            NotImplementedError, loop.add_signal_handler, 1, f)
+        self.assertRaises(
+            NotImplementedError, loop.remove_signal_handler, 1)
+        self.assertRaises(
+            NotImplementedError, loop.remove_signal_handler, 1)
+        self.assertRaises(
+            NotImplementedError, loop.connect_read_pipe, f,
+            mock.sentinel.pipe)
+        self.assertRaises(
+            NotImplementedError, loop.connect_write_pipe, f,
+            mock.sentinel.pipe)
+        self.assertRaises(
+            NotImplementedError, loop.subprocess_shell, f,
+            mock.sentinel)
+        self.assertRaises(
+            NotImplementedError, loop.subprocess_exec, f)
+        self.assertRaises(
+            NotImplementedError, loop.set_exception_handler, f)
+        self.assertRaises(
+            NotImplementedError, loop.default_exception_handler, f)
+        self.assertRaises(
+            NotImplementedError, loop.call_exception_handler, f)
+        self.assertRaises(
+            NotImplementedError, loop.get_debug)
+        self.assertRaises(
+            NotImplementedError, loop.set_debug, f)
+
+
+class ProtocolsAbsTests(unittest.TestCase):
+
+    def test_empty(self):
+        f = mock.Mock()
+        p = asyncio.Protocol()
+        self.assertIsNone(p.connection_made(f))
+        self.assertIsNone(p.connection_lost(f))
+        self.assertIsNone(p.data_received(f))
+        self.assertIsNone(p.eof_received())
+
+        dp = asyncio.DatagramProtocol()
+        self.assertIsNone(dp.connection_made(f))
+        self.assertIsNone(dp.connection_lost(f))
+        self.assertIsNone(dp.error_received(f))
+        self.assertIsNone(dp.datagram_received(f, f))
+
+        sp = asyncio.SubprocessProtocol()
+        self.assertIsNone(sp.connection_made(f))
+        self.assertIsNone(sp.connection_lost(f))
+        self.assertIsNone(sp.pipe_data_received(1, f))
+        self.assertIsNone(sp.pipe_connection_lost(1, f))
+        self.assertIsNone(sp.process_exited())
+
+
+class PolicyTests(unittest.TestCase):
+
+    def test_event_loop_policy(self):
+        policy = asyncio.AbstractEventLoopPolicy()
+        self.assertRaises(NotImplementedError, policy.get_event_loop)
+        self.assertRaises(NotImplementedError, policy.set_event_loop, object())
+        self.assertRaises(NotImplementedError, policy.new_event_loop)
+        self.assertRaises(NotImplementedError, policy.get_child_watcher)
+        self.assertRaises(NotImplementedError, policy.set_child_watcher,
+                          object())
+
+    def test_get_event_loop(self):
+        policy = asyncio.DefaultEventLoopPolicy()
+        self.assertIsNone(policy._local._loop)
+
+        loop = policy.get_event_loop()
+        self.assertIsInstance(loop, asyncio.AbstractEventLoop)
+
+        self.assertIs(policy._local._loop, loop)
+        self.assertIs(loop, policy.get_event_loop())
+        loop.close()
+
+    def test_get_event_loop_calls_set_event_loop(self):
+        policy = asyncio.DefaultEventLoopPolicy()
+
+        with mock.patch.object(
+                policy, "set_event_loop",
+                wraps=policy.set_event_loop) as m_set_event_loop:
+
+            loop = policy.get_event_loop()
+
+            # policy._local._loop must be set through .set_event_loop()
+            # (the unix DefaultEventLoopPolicy needs this call to attach
+            # the child watcher correctly)
+            m_set_event_loop.assert_called_with(loop)
+
+        loop.close()
+
+    def test_get_event_loop_after_set_none(self):
+        policy = asyncio.DefaultEventLoopPolicy()
+        policy.set_event_loop(None)
+        self.assertRaises(RuntimeError, policy.get_event_loop)
+
+    @mock.patch('asyncio.events.threading.current_thread')
+    def test_get_event_loop_thread(self, m_current_thread):
+
+        def f():
+            policy = asyncio.DefaultEventLoopPolicy()
+            self.assertRaises(RuntimeError, policy.get_event_loop)
+
+        th = threading.Thread(target=f)
+        th.start()
+        th.join()
+
+    def test_new_event_loop(self):
+        policy = asyncio.DefaultEventLoopPolicy()
+
+        loop = policy.new_event_loop()
+        self.assertIsInstance(loop, asyncio.AbstractEventLoop)
+        loop.close()
+
+    def test_set_event_loop(self):
+        policy = asyncio.DefaultEventLoopPolicy()
+        old_loop = policy.get_event_loop()
+
+        self.assertRaises(AssertionError, policy.set_event_loop, object())
+
+        loop = policy.new_event_loop()
+        policy.set_event_loop(loop)
+        self.assertIs(loop, policy.get_event_loop())
+        self.assertIsNot(old_loop, policy.get_event_loop())
+        loop.close()
+        old_loop.close()
+
+    def test_get_event_loop_policy(self):
+        policy = asyncio.get_event_loop_policy()
+        self.assertIsInstance(policy, asyncio.AbstractEventLoopPolicy)
+        self.assertIs(policy, asyncio.get_event_loop_policy())
+
+    def test_set_event_loop_policy(self):
+        self.assertRaises(
+            AssertionError, asyncio.set_event_loop_policy, object())
+
+        old_policy = asyncio.get_event_loop_policy()
+
+        policy = asyncio.DefaultEventLoopPolicy()
+        asyncio.set_event_loop_policy(policy)
+        self.assertIs(policy, asyncio.get_event_loop_policy())
+        self.assertIsNot(policy, old_policy)
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Lib/test/test_asyncio/test_futures.py b/Lib/test/test_asyncio/test_futures.py
new file mode 100644
index 0000000..c8b6829
--- /dev/null
+++ b/Lib/test/test_asyncio/test_futures.py
@@ -0,0 +1,473 @@
+"""Tests for futures.py."""
+
+import concurrent.futures
+import re
+import sys
+import threading
+import unittest
+from unittest import mock
+
+import asyncio
+from asyncio import test_utils
+try:
+    from test import support
+except ImportError:
+    from asyncio import test_support as support
+
+
+def _fakefunc(f):
+    return f
+
+def first_cb():
+    pass
+
+def last_cb():
+    pass
+
+
+class FutureTests(test_utils.TestCase):
+
+    def setUp(self):
+        self.loop = self.new_test_loop()
+        self.addCleanup(self.loop.close)
+
+    def test_initial_state(self):
+        f = asyncio.Future(loop=self.loop)
+        self.assertFalse(f.cancelled())
+        self.assertFalse(f.done())
+        f.cancel()
+        self.assertTrue(f.cancelled())
+
+    def test_init_constructor_default_loop(self):
+        asyncio.set_event_loop(self.loop)
+        f = asyncio.Future()
+        self.assertIs(f._loop, self.loop)
+
+    def test_constructor_positional(self):
+        # Make sure Future doesn't accept a positional argument
+        self.assertRaises(TypeError, asyncio.Future, 42)
+
+    def test_cancel(self):
+        f = asyncio.Future(loop=self.loop)
+        self.assertTrue(f.cancel())
+        self.assertTrue(f.cancelled())
+        self.assertTrue(f.done())
+        self.assertRaises(asyncio.CancelledError, f.result)
+        self.assertRaises(asyncio.CancelledError, f.exception)
+        self.assertRaises(asyncio.InvalidStateError, f.set_result, None)
+        self.assertRaises(asyncio.InvalidStateError, f.set_exception, None)
+        self.assertFalse(f.cancel())
+
+    def test_result(self):
+        f = asyncio.Future(loop=self.loop)
+        self.assertRaises(asyncio.InvalidStateError, f.result)
+
+        f.set_result(42)
+        self.assertFalse(f.cancelled())
+        self.assertTrue(f.done())
+        self.assertEqual(f.result(), 42)
+        self.assertEqual(f.exception(), None)
+        self.assertRaises(asyncio.InvalidStateError, f.set_result, None)
+        self.assertRaises(asyncio.InvalidStateError, f.set_exception, None)
+        self.assertFalse(f.cancel())
+
+    def test_exception(self):
+        exc = RuntimeError()
+        f = asyncio.Future(loop=self.loop)
+        self.assertRaises(asyncio.InvalidStateError, f.exception)
+
+        f.set_exception(exc)
+        self.assertFalse(f.cancelled())
+        self.assertTrue(f.done())
+        self.assertRaises(RuntimeError, f.result)
+        self.assertEqual(f.exception(), exc)
+        self.assertRaises(asyncio.InvalidStateError, f.set_result, None)
+        self.assertRaises(asyncio.InvalidStateError, f.set_exception, None)
+        self.assertFalse(f.cancel())
+
+    def test_exception_class(self):
+        f = asyncio.Future(loop=self.loop)
+        f.set_exception(RuntimeError)
+        self.assertIsInstance(f.exception(), RuntimeError)
+
+    def test_yield_from_twice(self):
+        f = asyncio.Future(loop=self.loop)
+
+        def fixture():
+            yield 'A'
+            x = yield from f
+            yield 'B', x
+            y = yield from f
+            yield 'C', y
+
+        g = fixture()
+        self.assertEqual(next(g), 'A')  # yield 'A'.
+        self.assertEqual(next(g), f)  # First yield from f.
+        f.set_result(42)
+        self.assertEqual(next(g), ('B', 42))  # yield 'B', x.
+        # The second "yield from f" does not yield f.
+        self.assertEqual(next(g), ('C', 42))  # yield 'C', y.
+
+    def test_future_repr(self):
+        self.loop.set_debug(True)
+        f_pending_debug = asyncio.Future(loop=self.loop)
+        frame = f_pending_debug._source_traceback[-1]
+        self.assertEqual(repr(f_pending_debug),
+                         '<Future pending created at %s:%s>'
+                         % (frame[0], frame[1]))
+        f_pending_debug.cancel()
+
+        self.loop.set_debug(False)
+        f_pending = asyncio.Future(loop=self.loop)
+        self.assertEqual(repr(f_pending), '<Future pending>')
+        f_pending.cancel()
+
+        f_cancelled = asyncio.Future(loop=self.loop)
+        f_cancelled.cancel()
+        self.assertEqual(repr(f_cancelled), '<Future cancelled>')
+
+        f_result = asyncio.Future(loop=self.loop)
+        f_result.set_result(4)
+        self.assertEqual(repr(f_result), '<Future finished result=4>')
+        self.assertEqual(f_result.result(), 4)
+
+        exc = RuntimeError()
+        f_exception = asyncio.Future(loop=self.loop)
+        f_exception.set_exception(exc)
+        self.assertEqual(repr(f_exception),
+                         '<Future finished exception=RuntimeError()>')
+        self.assertIs(f_exception.exception(), exc)
+
+        def func_repr(func):
+            filename, lineno = test_utils.get_function_source(func)
+            text = '%s() at %s:%s' % (func.__qualname__, filename, lineno)
+            return re.escape(text)
+
+        f_one_callbacks = asyncio.Future(loop=self.loop)
+        f_one_callbacks.add_done_callback(_fakefunc)
+        fake_repr = func_repr(_fakefunc)
+        self.assertRegex(repr(f_one_callbacks),
+                         r'<Future pending cb=\[%s\]>' % fake_repr)
+        f_one_callbacks.cancel()
+        self.assertEqual(repr(f_one_callbacks),
+                         '<Future cancelled>')
+
+        f_two_callbacks = asyncio.Future(loop=self.loop)
+        f_two_callbacks.add_done_callback(first_cb)
+        f_two_callbacks.add_done_callback(last_cb)
+        first_repr = func_repr(first_cb)
+        last_repr = func_repr(last_cb)
+        self.assertRegex(repr(f_two_callbacks),
+                         r'<Future pending cb=\[%s, %s\]>'
+                         % (first_repr, last_repr))
+
+        f_many_callbacks = asyncio.Future(loop=self.loop)
+        f_many_callbacks.add_done_callback(first_cb)
+        for i in range(8):
+            f_many_callbacks.add_done_callback(_fakefunc)
+        f_many_callbacks.add_done_callback(last_cb)
+        cb_regex = r'%s, <8 more>, %s' % (first_repr, last_repr)
+        self.assertRegex(repr(f_many_callbacks),
+                         r'<Future pending cb=\[%s\]>' % cb_regex)
+        f_many_callbacks.cancel()
+        self.assertEqual(repr(f_many_callbacks),
+                         '<Future cancelled>')
+
+    def test_copy_state(self):
+        # Test the internal _copy_state method since it's being directly
+        # invoked in other modules.
+        f = asyncio.Future(loop=self.loop)
+        f.set_result(10)
+
+        newf = asyncio.Future(loop=self.loop)
+        newf._copy_state(f)
+        self.assertTrue(newf.done())
+        self.assertEqual(newf.result(), 10)
+
+        f_exception = asyncio.Future(loop=self.loop)
+        f_exception.set_exception(RuntimeError())
+
+        newf_exception = asyncio.Future(loop=self.loop)
+        newf_exception._copy_state(f_exception)
+        self.assertTrue(newf_exception.done())
+        self.assertRaises(RuntimeError, newf_exception.result)
+
+        f_cancelled = asyncio.Future(loop=self.loop)
+        f_cancelled.cancel()
+
+        newf_cancelled = asyncio.Future(loop=self.loop)
+        newf_cancelled._copy_state(f_cancelled)
+        self.assertTrue(newf_cancelled.cancelled())
+
+    def test_iter(self):
+        fut = asyncio.Future(loop=self.loop)
+
+        def coro():
+            yield from fut
+
+        def test():
+            arg1, arg2 = coro()
+
+        self.assertRaises(AssertionError, test)
+        fut.cancel()
+
+    @mock.patch('asyncio.base_events.logger')
+    def test_tb_logger_abandoned(self, m_log):
+        fut = asyncio.Future(loop=self.loop)
+        del fut
+        self.assertFalse(m_log.error.called)
+
+    @mock.patch('asyncio.base_events.logger')
+    def test_tb_logger_result_unretrieved(self, m_log):
+        fut = asyncio.Future(loop=self.loop)
+        fut.set_result(42)
+        del fut
+        self.assertFalse(m_log.error.called)
+
+    @mock.patch('asyncio.base_events.logger')
+    def test_tb_logger_result_retrieved(self, m_log):
+        fut = asyncio.Future(loop=self.loop)
+        fut.set_result(42)
+        fut.result()
+        del fut
+        self.assertFalse(m_log.error.called)
+
+    @mock.patch('asyncio.base_events.logger')
+    def test_tb_logger_exception_unretrieved(self, m_log):
+        fut = asyncio.Future(loop=self.loop)
+        fut.set_exception(RuntimeError('boom'))
+        del fut
+        test_utils.run_briefly(self.loop)
+        self.assertTrue(m_log.error.called)
+
+    @mock.patch('asyncio.base_events.logger')
+    def test_tb_logger_exception_retrieved(self, m_log):
+        fut = asyncio.Future(loop=self.loop)
+        fut.set_exception(RuntimeError('boom'))
+        fut.exception()
+        del fut
+        self.assertFalse(m_log.error.called)
+
+    @mock.patch('asyncio.base_events.logger')
+    def test_tb_logger_exception_result_retrieved(self, m_log):
+        fut = asyncio.Future(loop=self.loop)
+        fut.set_exception(RuntimeError('boom'))
+        self.assertRaises(RuntimeError, fut.result)
+        del fut
+        self.assertFalse(m_log.error.called)
+
+    def test_wrap_future(self):
+
+        def run(arg):
+            return (arg, threading.get_ident())
+        ex = concurrent.futures.ThreadPoolExecutor(1)
+        f1 = ex.submit(run, 'oi')
+        f2 = asyncio.wrap_future(f1, loop=self.loop)
+        res, ident = self.loop.run_until_complete(f2)
+        self.assertIsInstance(f2, asyncio.Future)
+        self.assertEqual(res, 'oi')
+        self.assertNotEqual(ident, threading.get_ident())
+
+    def test_wrap_future_future(self):
+        f1 = asyncio.Future(loop=self.loop)
+        f2 = asyncio.wrap_future(f1)
+        self.assertIs(f1, f2)
+
+    @mock.patch('asyncio.futures.events')
+    def test_wrap_future_use_global_loop(self, m_events):
+        def run(arg):
+            return (arg, threading.get_ident())
+        ex = concurrent.futures.ThreadPoolExecutor(1)
+        f1 = ex.submit(run, 'oi')
+        f2 = asyncio.wrap_future(f1)
+        self.assertIs(m_events.get_event_loop.return_value, f2._loop)
+
+    def test_wrap_future_cancel(self):
+        f1 = concurrent.futures.Future()
+        f2 = asyncio.wrap_future(f1, loop=self.loop)
+        f2.cancel()
+        test_utils.run_briefly(self.loop)
+        self.assertTrue(f1.cancelled())
+        self.assertTrue(f2.cancelled())
+
+    def test_wrap_future_cancel2(self):
+        f1 = concurrent.futures.Future()
+        f2 = asyncio.wrap_future(f1, loop=self.loop)
+        f1.set_result(42)
+        f2.cancel()
+        test_utils.run_briefly(self.loop)
+        self.assertFalse(f1.cancelled())
+        self.assertEqual(f1.result(), 42)
+        self.assertTrue(f2.cancelled())
+
+    def test_future_source_traceback(self):
+        self.loop.set_debug(True)
+
+        future = asyncio.Future(loop=self.loop)
+        lineno = sys._getframe().f_lineno - 1
+        self.assertIsInstance(future._source_traceback, list)
+        self.assertEqual(future._source_traceback[-1][:3],
+                         (__file__,
+                          lineno,
+                          'test_future_source_traceback'))
+
+    @mock.patch('asyncio.base_events.logger')
+    def check_future_exception_never_retrieved(self, debug, m_log):
+        self.loop.set_debug(debug)
+
+        def memory_error():
+            try:
+                raise MemoryError()
+            except BaseException as exc:
+                return exc
+        exc = memory_error()
+
+        future = asyncio.Future(loop=self.loop)
+        if debug:
+            source_traceback = future._source_traceback
+        future.set_exception(exc)
+        future = None
+        test_utils.run_briefly(self.loop)
+        support.gc_collect()
+
+        if sys.version_info >= (3, 4):
+            if debug:
+                frame = source_traceback[-1]
+                regex = (r'^Future exception was never retrieved\n'
+                         r'future: <Future finished exception=MemoryError\(\) '
+                             r'created at {filename}:{lineno}>\n'
+                         r'source_traceback: Object '
+                            r'created at \(most recent call last\):\n'
+                         r'  File'
+                         r'.*\n'
+                         r'  File "{filename}", line {lineno}, '
+                            r'in check_future_exception_never_retrieved\n'
+                         r'    future = asyncio\.Future\(loop=self\.loop\)$'
+                         ).format(filename=re.escape(frame[0]),
+                                  lineno=frame[1])
+            else:
+                regex = (r'^Future exception was never retrieved\n'
+                         r'future: '
+                            r'<Future finished exception=MemoryError\(\)>$'
+                         )
+            exc_info = (type(exc), exc, exc.__traceback__)
+            m_log.error.assert_called_once_with(mock.ANY, exc_info=exc_info)
+        else:
+            if debug:
+                frame = source_traceback[-1]
+                regex = (r'^Future/Task exception was never retrieved\n'
+                         r'Future/Task created at \(most recent call last\):\n'
+                         r'  File'
+                         r'.*\n'
+                         r'  File "{filename}", line {lineno}, '
+                            r'in check_future_exception_never_retrieved\n'
+                         r'    future = asyncio\.Future\(loop=self\.loop\)\n'
+                         r'Traceback \(most recent call last\):\n'
+                         r'.*\n'
+                         r'MemoryError$'
+                         ).format(filename=re.escape(frame[0]),
+                                  lineno=frame[1])
+            else:
+                regex = (r'^Future/Task exception was never retrieved\n'
+                         r'Traceback \(most recent call last\):\n'
+                         r'.*\n'
+                         r'MemoryError$'
+                         )
+            m_log.error.assert_called_once_with(mock.ANY, exc_info=False)
+        message = m_log.error.call_args[0][0]
+        self.assertRegex(message, re.compile(regex, re.DOTALL))
+
+    def test_future_exception_never_retrieved(self):
+        self.check_future_exception_never_retrieved(False)
+
+    def test_future_exception_never_retrieved_debug(self):
+        self.check_future_exception_never_retrieved(True)
+
+    def test_set_result_unless_cancelled(self):
+        fut = asyncio.Future(loop=self.loop)
+        fut.cancel()
+        fut._set_result_unless_cancelled(2)
+        self.assertTrue(fut.cancelled())
+
+
+class FutureDoneCallbackTests(test_utils.TestCase):
+
+    def setUp(self):
+        self.loop = self.new_test_loop()
+
+    def run_briefly(self):
+        test_utils.run_briefly(self.loop)
+
+    def _make_callback(self, bag, thing):
+        # Create a callback function that appends thing to bag.
+        def bag_appender(future):
+            bag.append(thing)
+        return bag_appender
+
+    def _new_future(self):
+        return asyncio.Future(loop=self.loop)
+
+    def test_callbacks_invoked_on_set_result(self):
+        bag = []
+        f = self._new_future()
+        f.add_done_callback(self._make_callback(bag, 42))
+        f.add_done_callback(self._make_callback(bag, 17))
+
+        self.assertEqual(bag, [])
+        f.set_result('foo')
+
+        self.run_briefly()
+
+        self.assertEqual(bag, [42, 17])
+        self.assertEqual(f.result(), 'foo')
+
+    def test_callbacks_invoked_on_set_exception(self):
+        bag = []
+        f = self._new_future()
+        f.add_done_callback(self._make_callback(bag, 100))
+
+        self.assertEqual(bag, [])
+        exc = RuntimeError()
+        f.set_exception(exc)
+
+        self.run_briefly()
+
+        self.assertEqual(bag, [100])
+        self.assertEqual(f.exception(), exc)
+
+    def test_remove_done_callback(self):
+        bag = []
+        f = self._new_future()
+        cb1 = self._make_callback(bag, 1)
+        cb2 = self._make_callback(bag, 2)
+        cb3 = self._make_callback(bag, 3)
+
+        # Add one cb1 and one cb2.
+        f.add_done_callback(cb1)
+        f.add_done_callback(cb2)
+
+        # One instance of cb2 removed. Now there's only one cb1.
+        self.assertEqual(f.remove_done_callback(cb2), 1)
+
+        # Never had any cb3 in there.
+        self.assertEqual(f.remove_done_callback(cb3), 0)
+
+        # After this there will be 6 instances of cb1 and one of cb2.
+        f.add_done_callback(cb2)
+        for i in range(5):
+            f.add_done_callback(cb1)
+
+        # Remove all instances of cb1. One cb2 remains.
+        self.assertEqual(f.remove_done_callback(cb1), 6)
+
+        self.assertEqual(bag, [])
+        f.set_result('foo')
+
+        self.run_briefly()
+
+        self.assertEqual(bag, [2])
+        self.assertEqual(f.result(), 'foo')
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Lib/test/test_asyncio/test_locks.py b/Lib/test/test_asyncio/test_locks.py
new file mode 100644
index 0000000..dda4577
--- /dev/null
+++ b/Lib/test/test_asyncio/test_locks.py
@@ -0,0 +1,858 @@
+"""Tests for lock.py"""
+
+import unittest
+from unittest import mock
+import re
+
+import asyncio
+from asyncio import test_utils
+
+
+STR_RGX_REPR = (
+    r'^<(?P<class>.*?) object at (?P<address>.*?)'
+    r'\[(?P<extras>'
+    r'(set|unset|locked|unlocked)(,value:\d)?(,waiters:\d+)?'
+    r')\]>\Z'
+)
+RGX_REPR = re.compile(STR_RGX_REPR)
+
+
+class LockTests(test_utils.TestCase):
+
+    def setUp(self):
+        self.loop = self.new_test_loop()
+
+    def test_ctor_loop(self):
+        loop = mock.Mock()
+        lock = asyncio.Lock(loop=loop)
+        self.assertIs(lock._loop, loop)
+
+        lock = asyncio.Lock(loop=self.loop)
+        self.assertIs(lock._loop, self.loop)
+
+    def test_ctor_noloop(self):
+        asyncio.set_event_loop(self.loop)
+        lock = asyncio.Lock()
+        self.assertIs(lock._loop, self.loop)
+
+    def test_repr(self):
+        lock = asyncio.Lock(loop=self.loop)
+        self.assertTrue(repr(lock).endswith('[unlocked]>'))
+        self.assertTrue(RGX_REPR.match(repr(lock)))
+
+        @asyncio.coroutine
+        def acquire_lock():
+            yield from lock
+
+        self.loop.run_until_complete(acquire_lock())
+        self.assertTrue(repr(lock).endswith('[locked]>'))
+        self.assertTrue(RGX_REPR.match(repr(lock)))
+
+    def test_lock(self):
+        lock = asyncio.Lock(loop=self.loop)
+
+        @asyncio.coroutine
+        def acquire_lock():
+            return (yield from lock)
+
+        res = self.loop.run_until_complete(acquire_lock())
+
+        self.assertTrue(res)
+        self.assertTrue(lock.locked())
+
+        lock.release()
+        self.assertFalse(lock.locked())
+
+    def test_acquire(self):
+        lock = asyncio.Lock(loop=self.loop)
+        result = []
+
+        self.assertTrue(self.loop.run_until_complete(lock.acquire()))
+
+        @asyncio.coroutine
+        def c1(result):
+            if (yield from lock.acquire()):
+                result.append(1)
+            return True
+
+        @asyncio.coroutine
+        def c2(result):
+            if (yield from lock.acquire()):
+                result.append(2)
+            return True
+
+        @asyncio.coroutine
+        def c3(result):
+            if (yield from lock.acquire()):
+                result.append(3)
+            return True
+
+        t1 = asyncio.Task(c1(result), loop=self.loop)
+        t2 = asyncio.Task(c2(result), loop=self.loop)
+
+        test_utils.run_briefly(self.loop)
+        self.assertEqual([], result)
+
+        lock.release()
+        test_utils.run_briefly(self.loop)
+        self.assertEqual([1], result)
+
+        test_utils.run_briefly(self.loop)
+        self.assertEqual([1], result)
+
+        t3 = asyncio.Task(c3(result), loop=self.loop)
+
+        lock.release()
+        test_utils.run_briefly(self.loop)
+        self.assertEqual([1, 2], result)
+
+        lock.release()
+        test_utils.run_briefly(self.loop)
+        self.assertEqual([1, 2, 3], result)
+
+        self.assertTrue(t1.done())
+        self.assertTrue(t1.result())
+        self.assertTrue(t2.done())
+        self.assertTrue(t2.result())
+        self.assertTrue(t3.done())
+        self.assertTrue(t3.result())
+
+    def test_acquire_cancel(self):
+        lock = asyncio.Lock(loop=self.loop)
+        self.assertTrue(self.loop.run_until_complete(lock.acquire()))
+
+        task = asyncio.Task(lock.acquire(), loop=self.loop)
+        self.loop.call_soon(task.cancel)
+        self.assertRaises(
+            asyncio.CancelledError,
+            self.loop.run_until_complete, task)
+        self.assertFalse(lock._waiters)
+
+    def test_cancel_race(self):
+        # Several tasks:
+        # - A acquires the lock
+        # - B is blocked in aqcuire()
+        # - C is blocked in aqcuire()
+        #
+        # Now, concurrently:
+        # - B is cancelled
+        # - A releases the lock
+        #
+        # If B's waiter is marked cancelled but not yet removed from
+        # _waiters, A's release() call will crash when trying to set
+        # B's waiter; instead, it should move on to C's waiter.
+
+        # Setup: A has the lock, b and c are waiting.
+        lock = asyncio.Lock(loop=self.loop)
+
+        @asyncio.coroutine
+        def lockit(name, blocker):
+            yield from lock.acquire()
+            try:
+                if blocker is not None:
+                    yield from blocker
+            finally:
+                lock.release()
+
+        fa = asyncio.Future(loop=self.loop)
+        ta = asyncio.Task(lockit('A', fa), loop=self.loop)
+        test_utils.run_briefly(self.loop)
+        self.assertTrue(lock.locked())
+        tb = asyncio.Task(lockit('B', None), loop=self.loop)
+        test_utils.run_briefly(self.loop)
+        self.assertEqual(len(lock._waiters), 1)
+        tc = asyncio.Task(lockit('C', None), loop=self.loop)
+        test_utils.run_briefly(self.loop)
+        self.assertEqual(len(lock._waiters), 2)
+
+        # Create the race and check.
+        # Without the fix this failed at the last assert.
+        fa.set_result(None)
+        tb.cancel()
+        self.assertTrue(lock._waiters[0].cancelled())
+        test_utils.run_briefly(self.loop)
+        self.assertFalse(lock.locked())
+        self.assertTrue(ta.done())
+        self.assertTrue(tb.cancelled())
+        self.assertTrue(tc.done())
+
+    def test_release_not_acquired(self):
+        lock = asyncio.Lock(loop=self.loop)
+
+        self.assertRaises(RuntimeError, lock.release)
+
+    def test_release_no_waiters(self):
+        lock = asyncio.Lock(loop=self.loop)
+        self.loop.run_until_complete(lock.acquire())
+        self.assertTrue(lock.locked())
+
+        lock.release()
+        self.assertFalse(lock.locked())
+
+    def test_context_manager(self):
+        lock = asyncio.Lock(loop=self.loop)
+
+        @asyncio.coroutine
+        def acquire_lock():
+            return (yield from lock)
+
+        with self.loop.run_until_complete(acquire_lock()):
+            self.assertTrue(lock.locked())
+
+        self.assertFalse(lock.locked())
+
+    def test_context_manager_cant_reuse(self):
+        lock = asyncio.Lock(loop=self.loop)
+
+        @asyncio.coroutine
+        def acquire_lock():
+            return (yield from lock)
+
+        # This spells "yield from lock" outside a generator.
+        cm = self.loop.run_until_complete(acquire_lock())
+        with cm:
+            self.assertTrue(lock.locked())
+
+        self.assertFalse(lock.locked())
+
+        with self.assertRaises(AttributeError):
+            with cm:
+                pass
+
+    def test_context_manager_no_yield(self):
+        lock = asyncio.Lock(loop=self.loop)
+
+        try:
+            with lock:
+                self.fail('RuntimeError is not raised in with expression')
+        except RuntimeError as err:
+            self.assertEqual(
+                str(err),
+                '"yield from" should be used as context manager expression')
+
+        self.assertFalse(lock.locked())
+
+
+class EventTests(test_utils.TestCase):
+
+    def setUp(self):
+        self.loop = self.new_test_loop()
+
+    def test_ctor_loop(self):
+        loop = mock.Mock()
+        ev = asyncio.Event(loop=loop)
+        self.assertIs(ev._loop, loop)
+
+        ev = asyncio.Event(loop=self.loop)
+        self.assertIs(ev._loop, self.loop)
+
+    def test_ctor_noloop(self):
+        asyncio.set_event_loop(self.loop)
+        ev = asyncio.Event()
+        self.assertIs(ev._loop, self.loop)
+
+    def test_repr(self):
+        ev = asyncio.Event(loop=self.loop)
+        self.assertTrue(repr(ev).endswith('[unset]>'))
+        match = RGX_REPR.match(repr(ev))
+        self.assertEqual(match.group('extras'), 'unset')
+
+        ev.set()
+        self.assertTrue(repr(ev).endswith('[set]>'))
+        self.assertTrue(RGX_REPR.match(repr(ev)))
+
+        ev._waiters.append(mock.Mock())
+        self.assertTrue('waiters:1' in repr(ev))
+        self.assertTrue(RGX_REPR.match(repr(ev)))
+
+    def test_wait(self):
+        ev = asyncio.Event(loop=self.loop)
+        self.assertFalse(ev.is_set())
+
+        result = []
+
+        @asyncio.coroutine
+        def c1(result):
+            if (yield from ev.wait()):
+                result.append(1)
+
+        @asyncio.coroutine
+        def c2(result):
+            if (yield from ev.wait()):
+                result.append(2)
+
+        @asyncio.coroutine
+        def c3(result):
+            if (yield from ev.wait()):
+                result.append(3)
+
+        t1 = asyncio.Task(c1(result), loop=self.loop)
+        t2 = asyncio.Task(c2(result), loop=self.loop)
+
+        test_utils.run_briefly(self.loop)
+        self.assertEqual([], result)
+
+        t3 = asyncio.Task(c3(result), loop=self.loop)
+
+        ev.set()
+        test_utils.run_briefly(self.loop)
+        self.assertEqual([3, 1, 2], result)
+
+        self.assertTrue(t1.done())
+        self.assertIsNone(t1.result())
+        self.assertTrue(t2.done())
+        self.assertIsNone(t2.result())
+        self.assertTrue(t3.done())
+        self.assertIsNone(t3.result())
+
+    def test_wait_on_set(self):
+        ev = asyncio.Event(loop=self.loop)
+        ev.set()
+
+        res = self.loop.run_until_complete(ev.wait())
+        self.assertTrue(res)
+
+    def test_wait_cancel(self):
+        ev = asyncio.Event(loop=self.loop)
+
+        wait = asyncio.Task(ev.wait(), loop=self.loop)
+        self.loop.call_soon(wait.cancel)
+        self.assertRaises(
+            asyncio.CancelledError,
+            self.loop.run_until_complete, wait)
+        self.assertFalse(ev._waiters)
+
+    def test_clear(self):
+        ev = asyncio.Event(loop=self.loop)
+        self.assertFalse(ev.is_set())
+
+        ev.set()
+        self.assertTrue(ev.is_set())
+
+        ev.clear()
+        self.assertFalse(ev.is_set())
+
+    def test_clear_with_waiters(self):
+        ev = asyncio.Event(loop=self.loop)
+        result = []
+
+        @asyncio.coroutine
+        def c1(result):
+            if (yield from ev.wait()):
+                result.append(1)
+            return True
+
+        t = asyncio.Task(c1(result), loop=self.loop)
+        test_utils.run_briefly(self.loop)
+        self.assertEqual([], result)
+
+        ev.set()
+        ev.clear()
+        self.assertFalse(ev.is_set())
+
+        ev.set()
+        ev.set()
+        self.assertEqual(1, len(ev._waiters))
+
+        test_utils.run_briefly(self.loop)
+        self.assertEqual([1], result)
+        self.assertEqual(0, len(ev._waiters))
+
+        self.assertTrue(t.done())
+        self.assertTrue(t.result())
+
+
+class ConditionTests(test_utils.TestCase):
+
+    def setUp(self):
+        self.loop = self.new_test_loop()
+
+    def test_ctor_loop(self):
+        loop = mock.Mock()
+        cond = asyncio.Condition(loop=loop)
+        self.assertIs(cond._loop, loop)
+
+        cond = asyncio.Condition(loop=self.loop)
+        self.assertIs(cond._loop, self.loop)
+
+    def test_ctor_noloop(self):
+        asyncio.set_event_loop(self.loop)
+        cond = asyncio.Condition()
+        self.assertIs(cond._loop, self.loop)
+
+    def test_wait(self):
+        cond = asyncio.Condition(loop=self.loop)
+        result = []
+
+        @asyncio.coroutine
+        def c1(result):
+            yield from cond.acquire()
+            if (yield from cond.wait()):
+                result.append(1)
+            return True
+
+        @asyncio.coroutine
+        def c2(result):
+            yield from cond.acquire()
+            if (yield from cond.wait()):
+                result.append(2)
+            return True
+
+        @asyncio.coroutine
+        def c3(result):
+            yield from cond.acquire()
+            if (yield from cond.wait()):
+                result.append(3)
+            return True
+
+        t1 = asyncio.Task(c1(result), loop=self.loop)
+        t2 = asyncio.Task(c2(result), loop=self.loop)
+        t3 = asyncio.Task(c3(result), loop=self.loop)
+
+        test_utils.run_briefly(self.loop)
+        self.assertEqual([], result)
+        self.assertFalse(cond.locked())
+
+        self.assertTrue(self.loop.run_until_complete(cond.acquire()))
+        cond.notify()
+        test_utils.run_briefly(self.loop)
+        self.assertEqual([], result)
+        self.assertTrue(cond.locked())
+
+        cond.release()
+        test_utils.run_briefly(self.loop)
+        self.assertEqual([1], result)
+        self.assertTrue(cond.locked())
+
+        cond.notify(2)
+        test_utils.run_briefly(self.loop)
+        self.assertEqual([1], result)
+        self.assertTrue(cond.locked())
+
+        cond.release()
+        test_utils.run_briefly(self.loop)
+        self.assertEqual([1, 2], result)
+        self.assertTrue(cond.locked())
+
+        cond.release()
+        test_utils.run_briefly(self.loop)
+        self.assertEqual([1, 2, 3], result)
+        self.assertTrue(cond.locked())
+
+        self.assertTrue(t1.done())
+        self.assertTrue(t1.result())
+        self.assertTrue(t2.done())
+        self.assertTrue(t2.result())
+        self.assertTrue(t3.done())
+        self.assertTrue(t3.result())
+
+    def test_wait_cancel(self):
+        cond = asyncio.Condition(loop=self.loop)
+        self.loop.run_until_complete(cond.acquire())
+
+        wait = asyncio.Task(cond.wait(), loop=self.loop)
+        self.loop.call_soon(wait.cancel)
+        self.assertRaises(
+            asyncio.CancelledError,
+            self.loop.run_until_complete, wait)
+        self.assertFalse(cond._waiters)
+        self.assertTrue(cond.locked())
+
+    def test_wait_unacquired(self):
+        cond = asyncio.Condition(loop=self.loop)
+        self.assertRaises(
+            RuntimeError,
+            self.loop.run_until_complete, cond.wait())
+
+    def test_wait_for(self):
+        cond = asyncio.Condition(loop=self.loop)
+        presult = False
+
+        def predicate():
+            return presult
+
+        result = []
+
+        @asyncio.coroutine
+        def c1(result):
+            yield from cond.acquire()
+            if (yield from cond.wait_for(predicate)):
+                result.append(1)
+                cond.release()
+            return True
+
+        t = asyncio.Task(c1(result), loop=self.loop)
+
+        test_utils.run_briefly(self.loop)
+        self.assertEqual([], result)
+
+        self.loop.run_until_complete(cond.acquire())
+        cond.notify()
+        cond.release()
+        test_utils.run_briefly(self.loop)
+        self.assertEqual([], result)
+
+        presult = True
+        self.loop.run_until_complete(cond.acquire())
+        cond.notify()
+        cond.release()
+        test_utils.run_briefly(self.loop)
+        self.assertEqual([1], result)
+
+        self.assertTrue(t.done())
+        self.assertTrue(t.result())
+
+    def test_wait_for_unacquired(self):
+        cond = asyncio.Condition(loop=self.loop)
+
+        # predicate can return true immediately
+        res = self.loop.run_until_complete(cond.wait_for(lambda: [1, 2, 3]))
+        self.assertEqual([1, 2, 3], res)
+
+        self.assertRaises(
+            RuntimeError,
+            self.loop.run_until_complete,
+            cond.wait_for(lambda: False))
+
+    def test_notify(self):
+        cond = asyncio.Condition(loop=self.loop)
+        result = []
+
+        @asyncio.coroutine
+        def c1(result):
+            yield from cond.acquire()
+            if (yield from cond.wait()):
+                result.append(1)
+                cond.release()
+            return True
+
+        @asyncio.coroutine
+        def c2(result):
+            yield from cond.acquire()
+            if (yield from cond.wait()):
+                result.append(2)
+                cond.release()
+            return True
+
+        @asyncio.coroutine
+        def c3(result):
+            yield from cond.acquire()
+            if (yield from cond.wait()):
+                result.append(3)
+                cond.release()
+            return True
+
+        t1 = asyncio.Task(c1(result), loop=self.loop)
+        t2 = asyncio.Task(c2(result), loop=self.loop)
+        t3 = asyncio.Task(c3(result), loop=self.loop)
+
+        test_utils.run_briefly(self.loop)
+        self.assertEqual([], result)
+
+        self.loop.run_until_complete(cond.acquire())
+        cond.notify(1)
+        cond.release()
+        test_utils.run_briefly(self.loop)
+        self.assertEqual([1], result)
+
+        self.loop.run_until_complete(cond.acquire())
+        cond.notify(1)
+        cond.notify(2048)
+        cond.release()
+        test_utils.run_briefly(self.loop)
+        self.assertEqual([1, 2, 3], result)
+
+        self.assertTrue(t1.done())
+        self.assertTrue(t1.result())
+        self.assertTrue(t2.done())
+        self.assertTrue(t2.result())
+        self.assertTrue(t3.done())
+        self.assertTrue(t3.result())
+
+    def test_notify_all(self):
+        cond = asyncio.Condition(loop=self.loop)
+
+        result = []
+
+        @asyncio.coroutine
+        def c1(result):
+            yield from cond.acquire()
+            if (yield from cond.wait()):
+                result.append(1)
+                cond.release()
+            return True
+
+        @asyncio.coroutine
+        def c2(result):
+            yield from cond.acquire()
+            if (yield from cond.wait()):
+                result.append(2)
+                cond.release()
+            return True
+
+        t1 = asyncio.Task(c1(result), loop=self.loop)
+        t2 = asyncio.Task(c2(result), loop=self.loop)
+
+        test_utils.run_briefly(self.loop)
+        self.assertEqual([], result)
+
+        self.loop.run_until_complete(cond.acquire())
+        cond.notify_all()
+        cond.release()
+        test_utils.run_briefly(self.loop)
+        self.assertEqual([1, 2], result)
+
+        self.assertTrue(t1.done())
+        self.assertTrue(t1.result())
+        self.assertTrue(t2.done())
+        self.assertTrue(t2.result())
+
+    def test_notify_unacquired(self):
+        cond = asyncio.Condition(loop=self.loop)
+        self.assertRaises(RuntimeError, cond.notify)
+
+    def test_notify_all_unacquired(self):
+        cond = asyncio.Condition(loop=self.loop)
+        self.assertRaises(RuntimeError, cond.notify_all)
+
+    def test_repr(self):
+        cond = asyncio.Condition(loop=self.loop)
+        self.assertTrue('unlocked' in repr(cond))
+        self.assertTrue(RGX_REPR.match(repr(cond)))
+
+        self.loop.run_until_complete(cond.acquire())
+        self.assertTrue('locked' in repr(cond))
+
+        cond._waiters.append(mock.Mock())
+        self.assertTrue('waiters:1' in repr(cond))
+        self.assertTrue(RGX_REPR.match(repr(cond)))
+
+        cond._waiters.append(mock.Mock())
+        self.assertTrue('waiters:2' in repr(cond))
+        self.assertTrue(RGX_REPR.match(repr(cond)))
+
+    def test_context_manager(self):
+        cond = asyncio.Condition(loop=self.loop)
+
+        @asyncio.coroutine
+        def acquire_cond():
+            return (yield from cond)
+
+        with self.loop.run_until_complete(acquire_cond()):
+            self.assertTrue(cond.locked())
+
+        self.assertFalse(cond.locked())
+
+    def test_context_manager_no_yield(self):
+        cond = asyncio.Condition(loop=self.loop)
+
+        try:
+            with cond:
+                self.fail('RuntimeError is not raised in with expression')
+        except RuntimeError as err:
+            self.assertEqual(
+                str(err),
+                '"yield from" should be used as context manager expression')
+
+        self.assertFalse(cond.locked())
+
+    def test_explicit_lock(self):
+        lock = asyncio.Lock(loop=self.loop)
+        cond = asyncio.Condition(lock, loop=self.loop)
+
+        self.assertIs(cond._lock, lock)
+        self.assertIs(cond._loop, lock._loop)
+
+    def test_ambiguous_loops(self):
+        loop = self.new_test_loop()
+        self.addCleanup(loop.close)
+
+        lock = asyncio.Lock(loop=self.loop)
+        with self.assertRaises(ValueError):
+            asyncio.Condition(lock, loop=loop)
+
+
+class SemaphoreTests(test_utils.TestCase):
+
+    def setUp(self):
+        self.loop = self.new_test_loop()
+
+    def test_ctor_loop(self):
+        loop = mock.Mock()
+        sem = asyncio.Semaphore(loop=loop)
+        self.assertIs(sem._loop, loop)
+
+        sem = asyncio.Semaphore(loop=self.loop)
+        self.assertIs(sem._loop, self.loop)
+
+    def test_ctor_noloop(self):
+        asyncio.set_event_loop(self.loop)
+        sem = asyncio.Semaphore()
+        self.assertIs(sem._loop, self.loop)
+
+    def test_initial_value_zero(self):
+        sem = asyncio.Semaphore(0, loop=self.loop)
+        self.assertTrue(sem.locked())
+
+    def test_repr(self):
+        sem = asyncio.Semaphore(loop=self.loop)
+        self.assertTrue(repr(sem).endswith('[unlocked,value:1]>'))
+        self.assertTrue(RGX_REPR.match(repr(sem)))
+
+        self.loop.run_until_complete(sem.acquire())
+        self.assertTrue(repr(sem).endswith('[locked]>'))
+        self.assertTrue('waiters' not in repr(sem))
+        self.assertTrue(RGX_REPR.match(repr(sem)))
+
+        sem._waiters.append(mock.Mock())
+        self.assertTrue('waiters:1' in repr(sem))
+        self.assertTrue(RGX_REPR.match(repr(sem)))
+
+        sem._waiters.append(mock.Mock())
+        self.assertTrue('waiters:2' in repr(sem))
+        self.assertTrue(RGX_REPR.match(repr(sem)))
+
+    def test_semaphore(self):
+        sem = asyncio.Semaphore(loop=self.loop)
+        self.assertEqual(1, sem._value)
+
+        @asyncio.coroutine
+        def acquire_lock():
+            return (yield from sem)
+
+        res = self.loop.run_until_complete(acquire_lock())
+
+        self.assertTrue(res)
+        self.assertTrue(sem.locked())
+        self.assertEqual(0, sem._value)
+
+        sem.release()
+        self.assertFalse(sem.locked())
+        self.assertEqual(1, sem._value)
+
+    def test_semaphore_value(self):
+        self.assertRaises(ValueError, asyncio.Semaphore, -1)
+
+    def test_acquire(self):
+        sem = asyncio.Semaphore(3, loop=self.loop)
+        result = []
+
+        self.assertTrue(self.loop.run_until_complete(sem.acquire()))
+        self.assertTrue(self.loop.run_until_complete(sem.acquire()))
+        self.assertFalse(sem.locked())
+
+        @asyncio.coroutine
+        def c1(result):
+            yield from sem.acquire()
+            result.append(1)
+            return True
+
+        @asyncio.coroutine
+        def c2(result):
+            yield from sem.acquire()
+            result.append(2)
+            return True
+
+        @asyncio.coroutine
+        def c3(result):
+            yield from sem.acquire()
+            result.append(3)
+            return True
+
+        @asyncio.coroutine
+        def c4(result):
+            yield from sem.acquire()
+            result.append(4)
+            return True
+
+        t1 = asyncio.Task(c1(result), loop=self.loop)
+        t2 = asyncio.Task(c2(result), loop=self.loop)
+        t3 = asyncio.Task(c3(result), loop=self.loop)
+
+        test_utils.run_briefly(self.loop)
+        self.assertEqual([1], result)
+        self.assertTrue(sem.locked())
+        self.assertEqual(2, len(sem._waiters))
+        self.assertEqual(0, sem._value)
+
+        t4 = asyncio.Task(c4(result), loop=self.loop)
+
+        sem.release()
+        sem.release()
+        self.assertEqual(2, sem._value)
+
+        test_utils.run_briefly(self.loop)
+        self.assertEqual(0, sem._value)
+        self.assertEqual([1, 2, 3], result)
+        self.assertTrue(sem.locked())
+        self.assertEqual(1, len(sem._waiters))
+        self.assertEqual(0, sem._value)
+
+        self.assertTrue(t1.done())
+        self.assertTrue(t1.result())
+        self.assertTrue(t2.done())
+        self.assertTrue(t2.result())
+        self.assertTrue(t3.done())
+        self.assertTrue(t3.result())
+        self.assertFalse(t4.done())
+
+        # cleanup locked semaphore
+        sem.release()
+        self.loop.run_until_complete(t4)
+
+    def test_acquire_cancel(self):
+        sem = asyncio.Semaphore(loop=self.loop)
+        self.loop.run_until_complete(sem.acquire())
+
+        acquire = asyncio.Task(sem.acquire(), loop=self.loop)
+        self.loop.call_soon(acquire.cancel)
+        self.assertRaises(
+            asyncio.CancelledError,
+            self.loop.run_until_complete, acquire)
+        self.assertFalse(sem._waiters)
+
+    def test_release_not_acquired(self):
+        sem = asyncio.BoundedSemaphore(loop=self.loop)
+
+        self.assertRaises(ValueError, sem.release)
+
+    def test_release_no_waiters(self):
+        sem = asyncio.Semaphore(loop=self.loop)
+        self.loop.run_until_complete(sem.acquire())
+        self.assertTrue(sem.locked())
+
+        sem.release()
+        self.assertFalse(sem.locked())
+
+    def test_context_manager(self):
+        sem = asyncio.Semaphore(2, loop=self.loop)
+
+        @asyncio.coroutine
+        def acquire_lock():
+            return (yield from sem)
+
+        with self.loop.run_until_complete(acquire_lock()):
+            self.assertFalse(sem.locked())
+            self.assertEqual(1, sem._value)
+
+            with self.loop.run_until_complete(acquire_lock()):
+                self.assertTrue(sem.locked())
+
+        self.assertEqual(2, sem._value)
+
+    def test_context_manager_no_yield(self):
+        sem = asyncio.Semaphore(2, loop=self.loop)
+
+        try:
+            with sem:
+                self.fail('RuntimeError is not raised in with expression')
+        except RuntimeError as err:
+            self.assertEqual(
+                str(err),
+                '"yield from" should be used as context manager expression')
+
+        self.assertEqual(2, sem._value)
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Lib/test/test_asyncio/test_proactor_events.py b/Lib/test/test_asyncio/test_proactor_events.py
new file mode 100644
index 0000000..fcd9ab1
--- /dev/null
+++ b/Lib/test/test_asyncio/test_proactor_events.py
@@ -0,0 +1,591 @@
+"""Tests for proactor_events.py"""
+
+import socket
+import unittest
+from unittest import mock
+
+import asyncio
+from asyncio.proactor_events import BaseProactorEventLoop
+from asyncio.proactor_events import _ProactorSocketTransport
+from asyncio.proactor_events import _ProactorWritePipeTransport
+from asyncio.proactor_events import _ProactorDuplexPipeTransport
+from asyncio import test_utils
+
+
+def close_transport(transport):
+    # Don't call transport.close() because the event loop and the IOCP proactor
+    # are mocked
+    if transport._sock is None:
+        return
+    transport._sock.close()
+    transport._sock = None
+
+
+class ProactorSocketTransportTests(test_utils.TestCase):
+
+    def setUp(self):
+        self.loop = self.new_test_loop()
+        self.addCleanup(self.loop.close)
+        self.proactor = mock.Mock()
+        self.loop._proactor = self.proactor
+        self.protocol = test_utils.make_test_protocol(asyncio.Protocol)
+        self.sock = mock.Mock(socket.socket)
+
+    def socket_transport(self, waiter=None):
+        transport = _ProactorSocketTransport(self.loop, self.sock,
+                                             self.protocol, waiter=waiter)
+        self.addCleanup(close_transport, transport)
+        return transport
+
+    def test_ctor(self):
+        fut = asyncio.Future(loop=self.loop)
+        tr = self.socket_transport(waiter=fut)
+        test_utils.run_briefly(self.loop)
+        self.assertIsNone(fut.result())
+        self.protocol.connection_made(tr)
+        self.proactor.recv.assert_called_with(self.sock, 4096)
+
+    def test_loop_reading(self):
+        tr = self.socket_transport()
+        tr._loop_reading()
+        self.loop._proactor.recv.assert_called_with(self.sock, 4096)
+        self.assertFalse(self.protocol.data_received.called)
+        self.assertFalse(self.protocol.eof_received.called)
+
+    def test_loop_reading_data(self):
+        res = asyncio.Future(loop=self.loop)
+        res.set_result(b'data')
+
+        tr = self.socket_transport()
+        tr._read_fut = res
+        tr._loop_reading(res)
+        self.loop._proactor.recv.assert_called_with(self.sock, 4096)
+        self.protocol.data_received.assert_called_with(b'data')
+
+    def test_loop_reading_no_data(self):
+        res = asyncio.Future(loop=self.loop)
+        res.set_result(b'')
+
+        tr = self.socket_transport()
+        self.assertRaises(AssertionError, tr._loop_reading, res)
+
+        tr.close = mock.Mock()
+        tr._read_fut = res
+        tr._loop_reading(res)
+        self.assertFalse(self.loop._proactor.recv.called)
+        self.assertTrue(self.protocol.eof_received.called)
+        self.assertTrue(tr.close.called)
+
+    def test_loop_reading_aborted(self):
+        err = self.loop._proactor.recv.side_effect = ConnectionAbortedError()
+
+        tr = self.socket_transport()
+        tr._fatal_error = mock.Mock()
+        tr._loop_reading()
+        tr._fatal_error.assert_called_with(
+                            err,
+                            'Fatal read error on pipe transport')
+
+    def test_loop_reading_aborted_closing(self):
+        self.loop._proactor.recv.side_effect = ConnectionAbortedError()
+
+        tr = self.socket_transport()
+        tr._closing = True
+        tr._fatal_error = mock.Mock()
+        tr._loop_reading()
+        self.assertFalse(tr._fatal_error.called)
+
+    def test_loop_reading_aborted_is_fatal(self):
+        self.loop._proactor.recv.side_effect = ConnectionAbortedError()
+        tr = self.socket_transport()
+        tr._closing = False
+        tr._fatal_error = mock.Mock()
+        tr._loop_reading()
+        self.assertTrue(tr._fatal_error.called)
+
+    def test_loop_reading_conn_reset_lost(self):
+        err = self.loop._proactor.recv.side_effect = ConnectionResetError()
+
+        tr = self.socket_transport()
+        tr._closing = False
+        tr._fatal_error = mock.Mock()
+        tr._force_close = mock.Mock()
+        tr._loop_reading()
+        self.assertFalse(tr._fatal_error.called)
+        tr._force_close.assert_called_with(err)
+
+    def test_loop_reading_exception(self):
+        err = self.loop._proactor.recv.side_effect = (OSError())
+
+        tr = self.socket_transport()
+        tr._fatal_error = mock.Mock()
+        tr._loop_reading()
+        tr._fatal_error.assert_called_with(
+                            err,
+                            'Fatal read error on pipe transport')
+
+    def test_write(self):
+        tr = self.socket_transport()
+        tr._loop_writing = mock.Mock()
+        tr.write(b'data')
+        self.assertEqual(tr._buffer, None)
+        tr._loop_writing.assert_called_with(data=b'data')
+
+    def test_write_no_data(self):
+        tr = self.socket_transport()
+        tr.write(b'')
+        self.assertFalse(tr._buffer)
+
+    def test_write_more(self):
+        tr = self.socket_transport()
+        tr._write_fut = mock.Mock()
+        tr._loop_writing = mock.Mock()
+        tr.write(b'data')
+        self.assertEqual(tr._buffer, b'data')
+        self.assertFalse(tr._loop_writing.called)
+
+    def test_loop_writing(self):
+        tr = self.socket_transport()
+        tr._buffer = bytearray(b'data')
+        tr._loop_writing()
+        self.loop._proactor.send.assert_called_with(self.sock, b'data')
+        self.loop._proactor.send.return_value.add_done_callback.\
+            assert_called_with(tr._loop_writing)
+
+    @mock.patch('asyncio.proactor_events.logger')
+    def test_loop_writing_err(self, m_log):
+        err = self.loop._proactor.send.side_effect = OSError()
+        tr = self.socket_transport()
+        tr._fatal_error = mock.Mock()
+        tr._buffer = [b'da', b'ta']
+        tr._loop_writing()
+        tr._fatal_error.assert_called_with(
+                            err,
+                            'Fatal write error on pipe transport')
+        tr._conn_lost = 1
+
+        tr.write(b'data')
+        tr.write(b'data')
+        tr.write(b'data')
+        tr.write(b'data')
+        tr.write(b'data')
+        self.assertEqual(tr._buffer, None)
+        m_log.warning.assert_called_with('socket.send() raised exception.')
+
+    def test_loop_writing_stop(self):
+        fut = asyncio.Future(loop=self.loop)
+        fut.set_result(b'data')
+
+        tr = self.socket_transport()
+        tr._write_fut = fut
+        tr._loop_writing(fut)
+        self.assertIsNone(tr._write_fut)
+
+    def test_loop_writing_closing(self):
+        fut = asyncio.Future(loop=self.loop)
+        fut.set_result(1)
+
+        tr = self.socket_transport()
+        tr._write_fut = fut
+        tr.close()
+        tr._loop_writing(fut)
+        self.assertIsNone(tr._write_fut)
+        test_utils.run_briefly(self.loop)
+        self.protocol.connection_lost.assert_called_with(None)
+
+    def test_abort(self):
+        tr = self.socket_transport()
+        tr._force_close = mock.Mock()
+        tr.abort()
+        tr._force_close.assert_called_with(None)
+
+    def test_close(self):
+        tr = self.socket_transport()
+        tr.close()
+        test_utils.run_briefly(self.loop)
+        self.protocol.connection_lost.assert_called_with(None)
+        self.assertTrue(tr._closing)
+        self.assertEqual(tr._conn_lost, 1)
+
+        self.protocol.connection_lost.reset_mock()
+        tr.close()
+        test_utils.run_briefly(self.loop)
+        self.assertFalse(self.protocol.connection_lost.called)
+
+    def test_close_write_fut(self):
+        tr = self.socket_transport()
+        tr._write_fut = mock.Mock()
+        tr.close()
+        test_utils.run_briefly(self.loop)
+        self.assertFalse(self.protocol.connection_lost.called)
+
+    def test_close_buffer(self):
+        tr = self.socket_transport()
+        tr._buffer = [b'data']
+        tr.close()
+        test_utils.run_briefly(self.loop)
+        self.assertFalse(self.protocol.connection_lost.called)
+
+    @mock.patch('asyncio.base_events.logger')
+    def test_fatal_error(self, m_logging):
+        tr = self.socket_transport()
+        tr._force_close = mock.Mock()
+        tr._fatal_error(None)
+        self.assertTrue(tr._force_close.called)
+        self.assertTrue(m_logging.error.called)
+
+    def test_force_close(self):
+        tr = self.socket_transport()
+        tr._buffer = [b'data']
+        read_fut = tr._read_fut = mock.Mock()
+        write_fut = tr._write_fut = mock.Mock()
+        tr._force_close(None)
+
+        read_fut.cancel.assert_called_with()
+        write_fut.cancel.assert_called_with()
+        test_utils.run_briefly(self.loop)
+        self.protocol.connection_lost.assert_called_with(None)
+        self.assertEqual(None, tr._buffer)
+        self.assertEqual(tr._conn_lost, 1)
+
+    def test_force_close_idempotent(self):
+        tr = self.socket_transport()
+        tr._closing = True
+        tr._force_close(None)
+        test_utils.run_briefly(self.loop)
+        self.assertFalse(self.protocol.connection_lost.called)
+
+    def test_fatal_error_2(self):
+        tr = self.socket_transport()
+        tr._buffer = [b'data']
+        tr._force_close(None)
+
+        test_utils.run_briefly(self.loop)
+        self.protocol.connection_lost.assert_called_with(None)
+        self.assertEqual(None, tr._buffer)
+
+    def test_call_connection_lost(self):
+        tr = self.socket_transport()
+        tr._call_connection_lost(None)
+        self.assertTrue(self.protocol.connection_lost.called)
+        self.assertTrue(self.sock.close.called)
+
+    def test_write_eof(self):
+        tr = self.socket_transport()
+        self.assertTrue(tr.can_write_eof())
+        tr.write_eof()
+        self.sock.shutdown.assert_called_with(socket.SHUT_WR)
+        tr.write_eof()
+        self.assertEqual(self.sock.shutdown.call_count, 1)
+        tr.close()
+
+    def test_write_eof_buffer(self):
+        tr = self.socket_transport()
+        f = asyncio.Future(loop=self.loop)
+        tr._loop._proactor.send.return_value = f
+        tr.write(b'data')
+        tr.write_eof()
+        self.assertTrue(tr._eof_written)
+        self.assertFalse(self.sock.shutdown.called)
+        tr._loop._proactor.send.assert_called_with(self.sock, b'data')
+        f.set_result(4)
+        self.loop._run_once()
+        self.sock.shutdown.assert_called_with(socket.SHUT_WR)
+        tr.close()
+
+    def test_write_eof_write_pipe(self):
+        tr = _ProactorWritePipeTransport(
+            self.loop, self.sock, self.protocol)
+        self.assertTrue(tr.can_write_eof())
+        tr.write_eof()
+        self.assertTrue(tr._closing)
+        self.loop._run_once()
+        self.assertTrue(self.sock.close.called)
+        tr.close()
+
+    def test_write_eof_buffer_write_pipe(self):
+        tr = _ProactorWritePipeTransport(self.loop, self.sock, self.protocol)
+        f = asyncio.Future(loop=self.loop)
+        tr._loop._proactor.send.return_value = f
+        tr.write(b'data')
+        tr.write_eof()
+        self.assertTrue(tr._closing)
+        self.assertFalse(self.sock.shutdown.called)
+        tr._loop._proactor.send.assert_called_with(self.sock, b'data')
+        f.set_result(4)
+        self.loop._run_once()
+        self.loop._run_once()
+        self.assertTrue(self.sock.close.called)
+        tr.close()
+
+    def test_write_eof_duplex_pipe(self):
+        tr = _ProactorDuplexPipeTransport(
+            self.loop, self.sock, self.protocol)
+        self.assertFalse(tr.can_write_eof())
+        with self.assertRaises(NotImplementedError):
+            tr.write_eof()
+        close_transport(tr)
+
+    def test_pause_resume_reading(self):
+        tr = self.socket_transport()
+        futures = []
+        for msg in [b'data1', b'data2', b'data3', b'data4', b'']:
+            f = asyncio.Future(loop=self.loop)
+            f.set_result(msg)
+            futures.append(f)
+        self.loop._proactor.recv.side_effect = futures
+        self.loop._run_once()
+        self.assertFalse(tr._paused)
+        self.loop._run_once()
+        self.protocol.data_received.assert_called_with(b'data1')
+        self.loop._run_once()
+        self.protocol.data_received.assert_called_with(b'data2')
+        tr.pause_reading()
+        self.assertTrue(tr._paused)
+        for i in range(10):
+            self.loop._run_once()
+        self.protocol.data_received.assert_called_with(b'data2')
+        tr.resume_reading()
+        self.assertFalse(tr._paused)
+        self.loop._run_once()
+        self.protocol.data_received.assert_called_with(b'data3')
+        self.loop._run_once()
+        self.protocol.data_received.assert_called_with(b'data4')
+        tr.close()
+
+
+    def pause_writing_transport(self, high):
+        tr = self.socket_transport()
+        tr.set_write_buffer_limits(high=high)
+
+        self.assertEqual(tr.get_write_buffer_size(), 0)
+        self.assertFalse(self.protocol.pause_writing.called)
+        self.assertFalse(self.protocol.resume_writing.called)
+        return tr
+
+    def test_pause_resume_writing(self):
+        tr = self.pause_writing_transport(high=4)
+
+        # write a large chunk, must pause writing
+        fut = asyncio.Future(loop=self.loop)
+        self.loop._proactor.send.return_value = fut
+        tr.write(b'large data')
+        self.loop._run_once()
+        self.assertTrue(self.protocol.pause_writing.called)
+
+        # flush the buffer
+        fut.set_result(None)
+        self.loop._run_once()
+        self.assertEqual(tr.get_write_buffer_size(), 0)
+        self.assertTrue(self.protocol.resume_writing.called)
+
+    def test_pause_writing_2write(self):
+        tr = self.pause_writing_transport(high=4)
+
+        # first short write, the buffer is not full (3 <= 4)
+        fut1 = asyncio.Future(loop=self.loop)
+        self.loop._proactor.send.return_value = fut1
+        tr.write(b'123')
+        self.loop._run_once()
+        self.assertEqual(tr.get_write_buffer_size(), 3)
+        self.assertFalse(self.protocol.pause_writing.called)
+
+        # fill the buffer, must pause writing (6 > 4)
+        tr.write(b'abc')
+        self.loop._run_once()
+        self.assertEqual(tr.get_write_buffer_size(), 6)
+        self.assertTrue(self.protocol.pause_writing.called)
+
+    def test_pause_writing_3write(self):
+        tr = self.pause_writing_transport(high=4)
+
+        # first short write, the buffer is not full (1 <= 4)
+        fut = asyncio.Future(loop=self.loop)
+        self.loop._proactor.send.return_value = fut
+        tr.write(b'1')
+        self.loop._run_once()
+        self.assertEqual(tr.get_write_buffer_size(), 1)
+        self.assertFalse(self.protocol.pause_writing.called)
+
+        # second short write, the buffer is not full (3 <= 4)
+        tr.write(b'23')
+        self.loop._run_once()
+        self.assertEqual(tr.get_write_buffer_size(), 3)
+        self.assertFalse(self.protocol.pause_writing.called)
+
+        # fill the buffer, must pause writing (6 > 4)
+        tr.write(b'abc')
+        self.loop._run_once()
+        self.assertEqual(tr.get_write_buffer_size(), 6)
+        self.assertTrue(self.protocol.pause_writing.called)
+
+    def test_dont_pause_writing(self):
+        tr = self.pause_writing_transport(high=4)
+
+        # write a large chunk which completes immedialty,
+        # it should not pause writing
+        fut = asyncio.Future(loop=self.loop)
+        fut.set_result(None)
+        self.loop._proactor.send.return_value = fut
+        tr.write(b'very large data')
+        self.loop._run_once()
+        self.assertEqual(tr.get_write_buffer_size(), 0)
+        self.assertFalse(self.protocol.pause_writing.called)
+
+
+class BaseProactorEventLoopTests(test_utils.TestCase):
+
+    def setUp(self):
+        self.sock = mock.Mock(socket.socket)
+        self.proactor = mock.Mock()
+
+        self.ssock, self.csock = mock.Mock(), mock.Mock()
+
+        class EventLoop(BaseProactorEventLoop):
+            def _socketpair(s):
+                return (self.ssock, self.csock)
+
+        self.loop = EventLoop(self.proactor)
+        self.set_event_loop(self.loop)
+
+    @mock.patch.object(BaseProactorEventLoop, 'call_soon')
+    @mock.patch.object(BaseProactorEventLoop, '_socketpair')
+    def test_ctor(self, socketpair, call_soon):
+        ssock, csock = socketpair.return_value = (
+            mock.Mock(), mock.Mock())
+        loop = BaseProactorEventLoop(self.proactor)
+        self.assertIs(loop._ssock, ssock)
+        self.assertIs(loop._csock, csock)
+        self.assertEqual(loop._internal_fds, 1)
+        call_soon.assert_called_with(loop._loop_self_reading)
+        loop.close()
+
+    def test_close_self_pipe(self):
+        self.loop._close_self_pipe()
+        self.assertEqual(self.loop._internal_fds, 0)
+        self.assertTrue(self.ssock.close.called)
+        self.assertTrue(self.csock.close.called)
+        self.assertIsNone(self.loop._ssock)
+        self.assertIsNone(self.loop._csock)
+
+        # Don't call close(): _close_self_pipe() cannot be called twice
+        self.loop._closed = True
+
+    def test_close(self):
+        self.loop._close_self_pipe = mock.Mock()
+        self.loop.close()
+        self.assertTrue(self.loop._close_self_pipe.called)
+        self.assertTrue(self.proactor.close.called)
+        self.assertIsNone(self.loop._proactor)
+
+        self.loop._close_self_pipe.reset_mock()
+        self.loop.close()
+        self.assertFalse(self.loop._close_self_pipe.called)
+
+    def test_sock_recv(self):
+        self.loop.sock_recv(self.sock, 1024)
+        self.proactor.recv.assert_called_with(self.sock, 1024)
+
+    def test_sock_sendall(self):
+        self.loop.sock_sendall(self.sock, b'data')
+        self.proactor.send.assert_called_with(self.sock, b'data')
+
+    def test_sock_connect(self):
+        self.loop.sock_connect(self.sock, 123)
+        self.proactor.connect.assert_called_with(self.sock, 123)
+
+    def test_sock_accept(self):
+        self.loop.sock_accept(self.sock)
+        self.proactor.accept.assert_called_with(self.sock)
+
+    def test_socketpair(self):
+        class EventLoop(BaseProactorEventLoop):
+            # override the destructor to not log a ResourceWarning
+            def __del__(self):
+                pass
+        self.assertRaises(
+            NotImplementedError, EventLoop, self.proactor)
+
+    def test_make_socket_transport(self):
+        tr = self.loop._make_socket_transport(self.sock, asyncio.Protocol())
+        self.assertIsInstance(tr, _ProactorSocketTransport)
+        close_transport(tr)
+
+    def test_loop_self_reading(self):
+        self.loop._loop_self_reading()
+        self.proactor.recv.assert_called_with(self.ssock, 4096)
+        self.proactor.recv.return_value.add_done_callback.assert_called_with(
+            self.loop._loop_self_reading)
+
+    def test_loop_self_reading_fut(self):
+        fut = mock.Mock()
+        self.loop._loop_self_reading(fut)
+        self.assertTrue(fut.result.called)
+        self.proactor.recv.assert_called_with(self.ssock, 4096)
+        self.proactor.recv.return_value.add_done_callback.assert_called_with(
+            self.loop._loop_self_reading)
+
+    def test_loop_self_reading_exception(self):
+        self.loop.close = mock.Mock()
+        self.loop.call_exception_handler = mock.Mock()
+        self.proactor.recv.side_effect = OSError()
+        self.loop._loop_self_reading()
+        self.assertTrue(self.loop.call_exception_handler.called)
+
+    def test_write_to_self(self):
+        self.loop._write_to_self()
+        self.csock.send.assert_called_with(b'\0')
+
+    def test_process_events(self):
+        self.loop._process_events([])
+
+    @mock.patch('asyncio.base_events.logger')
+    def test_create_server(self, m_log):
+        pf = mock.Mock()
+        call_soon = self.loop.call_soon = mock.Mock()
+
+        self.loop._start_serving(pf, self.sock)
+        self.assertTrue(call_soon.called)
+
+        # callback
+        loop = call_soon.call_args[0][0]
+        loop()
+        self.proactor.accept.assert_called_with(self.sock)
+
+        # conn
+        fut = mock.Mock()
+        fut.result.return_value = (mock.Mock(), mock.Mock())
+
+        make_tr = self.loop._make_socket_transport = mock.Mock()
+        loop(fut)
+        self.assertTrue(fut.result.called)
+        self.assertTrue(make_tr.called)
+
+        # exception
+        fut.result.side_effect = OSError()
+        loop(fut)
+        self.assertTrue(self.sock.close.called)
+        self.assertTrue(m_log.error.called)
+
+    def test_create_server_cancel(self):
+        pf = mock.Mock()
+        call_soon = self.loop.call_soon = mock.Mock()
+
+        self.loop._start_serving(pf, self.sock)
+        loop = call_soon.call_args[0][0]
+
+        # cancelled
+        fut = asyncio.Future(loop=self.loop)
+        fut.cancel()
+        loop(fut)
+        self.assertTrue(self.sock.close.called)
+
+    def test_stop_serving(self):
+        sock = mock.Mock()
+        self.loop._stop_serving(sock)
+        self.assertTrue(sock.close.called)
+        self.proactor._stop_serving.assert_called_with(sock)
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Lib/test/test_asyncio/test_queues.py b/Lib/test/test_asyncio/test_queues.py
new file mode 100644
index 0000000..3d4ac51
--- /dev/null
+++ b/Lib/test/test_asyncio/test_queues.py
@@ -0,0 +1,476 @@
+"""Tests for queues.py"""
+
+import unittest
+from unittest import mock
+
+import asyncio
+from asyncio import test_utils
+
+
+class _QueueTestBase(test_utils.TestCase):
+
+    def setUp(self):
+        self.loop = self.new_test_loop()
+
+
+class QueueBasicTests(_QueueTestBase):
+
+    def _test_repr_or_str(self, fn, expect_id):
+        """Test Queue's repr or str.
+
+        fn is repr or str. expect_id is True if we expect the Queue's id to
+        appear in fn(Queue()).
+        """
+        def gen():
+            when = yield
+            self.assertAlmostEqual(0.1, when)
+            when = yield 0.1
+            self.assertAlmostEqual(0.2, when)
+            yield 0.1
+
+        loop = self.new_test_loop(gen)
+
+        q = asyncio.Queue(loop=loop)
+        self.assertTrue(fn(q).startswith('<Queue'), fn(q))
+        id_is_present = hex(id(q)) in fn(q)
+        self.assertEqual(expect_id, id_is_present)
+
+        @asyncio.coroutine
+        def add_getter():
+            q = asyncio.Queue(loop=loop)
+            # Start a task that waits to get.
+            asyncio.Task(q.get(), loop=loop)
+            # Let it start waiting.
+            yield from asyncio.sleep(0.1, loop=loop)
+            self.assertTrue('_getters[1]' in fn(q))
+            # resume q.get coroutine to finish generator
+            q.put_nowait(0)
+
+        loop.run_until_complete(add_getter())
+
+        @asyncio.coroutine
+        def add_putter():
+            q = asyncio.Queue(maxsize=1, loop=loop)
+            q.put_nowait(1)
+            # Start a task that waits to put.
+            asyncio.Task(q.put(2), loop=loop)
+            # Let it start waiting.
+            yield from asyncio.sleep(0.1, loop=loop)
+            self.assertTrue('_putters[1]' in fn(q))
+            # resume q.put coroutine to finish generator
+            q.get_nowait()
+
+        loop.run_until_complete(add_putter())
+
+        q = asyncio.Queue(loop=loop)
+        q.put_nowait(1)
+        self.assertTrue('_queue=[1]' in fn(q))
+
+    def test_ctor_loop(self):
+        loop = mock.Mock()
+        q = asyncio.Queue(loop=loop)
+        self.assertIs(q._loop, loop)
+
+        q = asyncio.Queue(loop=self.loop)
+        self.assertIs(q._loop, self.loop)
+
+    def test_ctor_noloop(self):
+        asyncio.set_event_loop(self.loop)
+        q = asyncio.Queue()
+        self.assertIs(q._loop, self.loop)
+
+    def test_repr(self):
+        self._test_repr_or_str(repr, True)
+
+    def test_str(self):
+        self._test_repr_or_str(str, False)
+
+    def test_empty(self):
+        q = asyncio.Queue(loop=self.loop)
+        self.assertTrue(q.empty())
+        q.put_nowait(1)
+        self.assertFalse(q.empty())
+        self.assertEqual(1, q.get_nowait())
+        self.assertTrue(q.empty())
+
+    def test_full(self):
+        q = asyncio.Queue(loop=self.loop)
+        self.assertFalse(q.full())
+
+        q = asyncio.Queue(maxsize=1, loop=self.loop)
+        q.put_nowait(1)
+        self.assertTrue(q.full())
+
+    def test_order(self):
+        q = asyncio.Queue(loop=self.loop)
+        for i in [1, 3, 2]:
+            q.put_nowait(i)
+
+        items = [q.get_nowait() for _ in range(3)]
+        self.assertEqual([1, 3, 2], items)
+
+    def test_maxsize(self):
+
+        def gen():
+            when = yield
+            self.assertAlmostEqual(0.01, when)
+            when = yield 0.01
+            self.assertAlmostEqual(0.02, when)
+            yield 0.01
+
+        loop = self.new_test_loop(gen)
+
+        q = asyncio.Queue(maxsize=2, loop=loop)
+        self.assertEqual(2, q.maxsize)
+        have_been_put = []
+
+        @asyncio.coroutine
+        def putter():
+            for i in range(3):
+                yield from q.put(i)
+                have_been_put.append(i)
+            return True
+
+        @asyncio.coroutine
+        def test():
+            t = asyncio.Task(putter(), loop=loop)
+            yield from asyncio.sleep(0.01, loop=loop)
+
+            # The putter is blocked after putting two items.
+            self.assertEqual([0, 1], have_been_put)
+            self.assertEqual(0, q.get_nowait())
+
+            # Let the putter resume and put last item.
+            yield from asyncio.sleep(0.01, loop=loop)
+            self.assertEqual([0, 1, 2], have_been_put)
+            self.assertEqual(1, q.get_nowait())
+            self.assertEqual(2, q.get_nowait())
+
+            self.assertTrue(t.done())
+            self.assertTrue(t.result())
+
+        loop.run_until_complete(test())
+        self.assertAlmostEqual(0.02, loop.time())
+
+
+class QueueGetTests(_QueueTestBase):
+
+    def test_blocking_get(self):
+        q = asyncio.Queue(loop=self.loop)
+        q.put_nowait(1)
+
+        @asyncio.coroutine
+        def queue_get():
+            return (yield from q.get())
+
+        res = self.loop.run_until_complete(queue_get())
+        self.assertEqual(1, res)
+
+    def test_get_with_putters(self):
+        q = asyncio.Queue(1, loop=self.loop)
+        q.put_nowait(1)
+
+        waiter = asyncio.Future(loop=self.loop)
+        q._putters.append((2, waiter))
+
+        res = self.loop.run_until_complete(q.get())
+        self.assertEqual(1, res)
+        self.assertTrue(waiter.done())
+        self.assertIsNone(waiter.result())
+
+    def test_blocking_get_wait(self):
+
+        def gen():
+            when = yield
+            self.assertAlmostEqual(0.01, when)
+            yield 0.01
+
+        loop = self.new_test_loop(gen)
+
+        q = asyncio.Queue(loop=loop)
+        started = asyncio.Event(loop=loop)
+        finished = False
+
+        @asyncio.coroutine
+        def queue_get():
+            nonlocal finished
+            started.set()
+            res = yield from q.get()
+            finished = True
+            return res
+
+        @asyncio.coroutine
+        def queue_put():
+            loop.call_later(0.01, q.put_nowait, 1)
+            queue_get_task = asyncio.Task(queue_get(), loop=loop)
+            yield from started.wait()
+            self.assertFalse(finished)
+            res = yield from queue_get_task
+            self.assertTrue(finished)
+            return res
+
+        res = loop.run_until_complete(queue_put())
+        self.assertEqual(1, res)
+        self.assertAlmostEqual(0.01, loop.time())
+
+    def test_nonblocking_get(self):
+        q = asyncio.Queue(loop=self.loop)
+        q.put_nowait(1)
+        self.assertEqual(1, q.get_nowait())
+
+    def test_nonblocking_get_exception(self):
+        q = asyncio.Queue(loop=self.loop)
+        self.assertRaises(asyncio.QueueEmpty, q.get_nowait)
+
+    def test_get_cancelled(self):
+
+        def gen():
+            when = yield
+            self.assertAlmostEqual(0.01, when)
+            when = yield 0.01
+            self.assertAlmostEqual(0.061, when)
+            yield 0.05
+
+        loop = self.new_test_loop(gen)
+
+        q = asyncio.Queue(loop=loop)
+
+        @asyncio.coroutine
+        def queue_get():
+            return (yield from asyncio.wait_for(q.get(), 0.051, loop=loop))
+
+        @asyncio.coroutine
+        def test():
+            get_task = asyncio.Task(queue_get(), loop=loop)
+            yield from asyncio.sleep(0.01, loop=loop)  # let the task start
+            q.put_nowait(1)
+            return (yield from get_task)
+
+        self.assertEqual(1, loop.run_until_complete(test()))
+        self.assertAlmostEqual(0.06, loop.time())
+
+    def test_get_cancelled_race(self):
+        q = asyncio.Queue(loop=self.loop)
+
+        t1 = asyncio.Task(q.get(), loop=self.loop)
+        t2 = asyncio.Task(q.get(), loop=self.loop)
+
+        test_utils.run_briefly(self.loop)
+        t1.cancel()
+        test_utils.run_briefly(self.loop)
+        self.assertTrue(t1.done())
+        q.put_nowait('a')
+        test_utils.run_briefly(self.loop)
+        self.assertEqual(t2.result(), 'a')
+
+    def test_get_with_waiting_putters(self):
+        q = asyncio.Queue(loop=self.loop, maxsize=1)
+        asyncio.Task(q.put('a'), loop=self.loop)
+        asyncio.Task(q.put('b'), loop=self.loop)
+        test_utils.run_briefly(self.loop)
+        self.assertEqual(self.loop.run_until_complete(q.get()), 'a')
+        self.assertEqual(self.loop.run_until_complete(q.get()), 'b')
+
+
+class QueuePutTests(_QueueTestBase):
+
+    def test_blocking_put(self):
+        q = asyncio.Queue(loop=self.loop)
+
+        @asyncio.coroutine
+        def queue_put():
+            # No maxsize, won't block.
+            yield from q.put(1)
+
+        self.loop.run_until_complete(queue_put())
+
+    def test_blocking_put_wait(self):
+
+        def gen():
+            when = yield
+            self.assertAlmostEqual(0.01, when)
+            yield 0.01
+
+        loop = self.new_test_loop(gen)
+
+        q = asyncio.Queue(maxsize=1, loop=loop)
+        started = asyncio.Event(loop=loop)
+        finished = False
+
+        @asyncio.coroutine
+        def queue_put():
+            nonlocal finished
+            started.set()
+            yield from q.put(1)
+            yield from q.put(2)
+            finished = True
+
+        @asyncio.coroutine
+        def queue_get():
+            loop.call_later(0.01, q.get_nowait)
+            queue_put_task = asyncio.Task(queue_put(), loop=loop)
+            yield from started.wait()
+            self.assertFalse(finished)
+            yield from queue_put_task
+            self.assertTrue(finished)
+
+        loop.run_until_complete(queue_get())
+        self.assertAlmostEqual(0.01, loop.time())
+
+    def test_nonblocking_put(self):
+        q = asyncio.Queue(loop=self.loop)
+        q.put_nowait(1)
+        self.assertEqual(1, q.get_nowait())
+
+    def test_nonblocking_put_exception(self):
+        q = asyncio.Queue(maxsize=1, loop=self.loop)
+        q.put_nowait(1)
+        self.assertRaises(asyncio.QueueFull, q.put_nowait, 2)
+
+    def test_float_maxsize(self):
+        q = asyncio.Queue(maxsize=1.3, loop=self.loop)
+        q.put_nowait(1)
+        q.put_nowait(2)
+        self.assertTrue(q.full())
+        self.assertRaises(asyncio.QueueFull, q.put_nowait, 3)
+
+        q = asyncio.Queue(maxsize=1.3, loop=self.loop)
+        @asyncio.coroutine
+        def queue_put():
+            yield from q.put(1)
+            yield from q.put(2)
+            self.assertTrue(q.full())
+        self.loop.run_until_complete(queue_put())
+
+    def test_put_cancelled(self):
+        q = asyncio.Queue(loop=self.loop)
+
+        @asyncio.coroutine
+        def queue_put():
+            yield from q.put(1)
+            return True
+
+        @asyncio.coroutine
+        def test():
+            return (yield from q.get())
+
+        t = asyncio.Task(queue_put(), loop=self.loop)
+        self.assertEqual(1, self.loop.run_until_complete(test()))
+        self.assertTrue(t.done())
+        self.assertTrue(t.result())
+
+    def test_put_cancelled_race(self):
+        q = asyncio.Queue(loop=self.loop, maxsize=1)
+
+        put_a = asyncio.Task(q.put('a'), loop=self.loop)
+        put_b = asyncio.Task(q.put('b'), loop=self.loop)
+        put_c = asyncio.Task(q.put('X'), loop=self.loop)
+
+        test_utils.run_briefly(self.loop)
+        self.assertTrue(put_a.done())
+        self.assertFalse(put_b.done())
+
+        put_c.cancel()
+        test_utils.run_briefly(self.loop)
+        self.assertTrue(put_c.done())
+        self.assertEqual(q.get_nowait(), 'a')
+        self.assertEqual(q.get_nowait(), 'b')
+
+        self.loop.run_until_complete(put_b)
+
+    def test_put_with_waiting_getters(self):
+        q = asyncio.Queue(loop=self.loop)
+        t = asyncio.Task(q.get(), loop=self.loop)
+        test_utils.run_briefly(self.loop)
+        self.loop.run_until_complete(q.put('a'))
+        self.assertEqual(self.loop.run_until_complete(t), 'a')
+
+
+class LifoQueueTests(_QueueTestBase):
+
+    def test_order(self):
+        q = asyncio.LifoQueue(loop=self.loop)
+        for i in [1, 3, 2]:
+            q.put_nowait(i)
+
+        items = [q.get_nowait() for _ in range(3)]
+        self.assertEqual([2, 3, 1], items)
+
+
+class PriorityQueueTests(_QueueTestBase):
+
+    def test_order(self):
+        q = asyncio.PriorityQueue(loop=self.loop)
+        for i in [1, 3, 2]:
+            q.put_nowait(i)
+
+        items = [q.get_nowait() for _ in range(3)]
+        self.assertEqual([1, 2, 3], items)
+
+
+class JoinableQueueTests(_QueueTestBase):
+
+    def test_task_done_underflow(self):
+        q = asyncio.JoinableQueue(loop=self.loop)
+        self.assertRaises(ValueError, q.task_done)
+
+    def test_task_done(self):
+        q = asyncio.JoinableQueue(loop=self.loop)
+        for i in range(100):
+            q.put_nowait(i)
+
+        accumulator = 0
+
+        # Two workers get items from the queue and call task_done after each.
+        # Join the queue and assert all items have been processed.
+        running = True
+
+        @asyncio.coroutine
+        def worker():
+            nonlocal accumulator
+
+            while running:
+                item = yield from q.get()
+                accumulator += item
+                q.task_done()
+
+        @asyncio.coroutine
+        def test():
+            tasks = [asyncio.Task(worker(), loop=self.loop)
+                     for index in range(2)]
+
+            yield from q.join()
+            return tasks
+
+        tasks = self.loop.run_until_complete(test())
+        self.assertEqual(sum(range(100)), accumulator)
+
+        # close running generators
+        running = False
+        for i in range(len(tasks)):
+            q.put_nowait(0)
+        self.loop.run_until_complete(asyncio.wait(tasks, loop=self.loop))
+
+    def test_join_empty_queue(self):
+        q = asyncio.JoinableQueue(loop=self.loop)
+
+        # Test that a queue join()s successfully, and before anything else
+        # (done twice for insurance).
+
+        @asyncio.coroutine
+        def join():
+            yield from q.join()
+            yield from q.join()
+
+        self.loop.run_until_complete(join())
+
+    def test_format(self):
+        q = asyncio.JoinableQueue(loop=self.loop)
+        self.assertEqual(q._format(), 'maxsize=0')
+
+        q._unfinished_tasks = 2
+        self.assertEqual(q._format(), 'maxsize=0 tasks=2')
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Lib/test/test_asyncio/test_selector_events.py b/Lib/test/test_asyncio/test_selector_events.py
new file mode 100644
index 0000000..f64e40d
--- /dev/null
+++ b/Lib/test/test_asyncio/test_selector_events.py
@@ -0,0 +1,1760 @@
+"""Tests for selector_events.py"""
+
+import errno
+import socket
+import unittest
+from unittest import mock
+try:
+    import ssl
+except ImportError:
+    ssl = None
+
+import asyncio
+from asyncio import selectors
+from asyncio import test_utils
+from asyncio.selector_events import BaseSelectorEventLoop
+from asyncio.selector_events import _SelectorTransport
+from asyncio.selector_events import _SelectorSslTransport
+from asyncio.selector_events import _SelectorSocketTransport
+from asyncio.selector_events import _SelectorDatagramTransport
+
+
+MOCK_ANY = mock.ANY
+
+
+class TestBaseSelectorEventLoop(BaseSelectorEventLoop):
+
+    def close(self):
+        # Don't call the close() method of the parent class, because the
+        # selector is mocked
+        self._closed = True
+
+    def _make_self_pipe(self):
+        self._ssock = mock.Mock()
+        self._csock = mock.Mock()
+        self._internal_fds += 1
+
+
+def list_to_buffer(l=()):
+    return bytearray().join(l)
+
+
+def close_transport(transport):
+    # Don't call transport.close() because the event loop and the selector
+    # are mocked
+    if transport._sock is None:
+        return
+    transport._sock.close()
+    transport._sock = None
+
+
+class BaseSelectorEventLoopTests(test_utils.TestCase):
+
+    def setUp(self):
+        self.selector = mock.Mock()
+        self.selector.select.return_value = []
+        self.loop = TestBaseSelectorEventLoop(self.selector)
+        self.set_event_loop(self.loop)
+
+    def test_make_socket_transport(self):
+        m = mock.Mock()
+        self.loop.add_reader = mock.Mock()
+        self.loop.add_reader._is_coroutine = False
+        transport = self.loop._make_socket_transport(m, asyncio.Protocol())
+        self.assertIsInstance(transport, _SelectorSocketTransport)
+        close_transport(transport)
+
+    @unittest.skipIf(ssl is None, 'No ssl module')
+    def test_make_ssl_transport(self):
+        m = mock.Mock()
+        self.loop.add_reader = mock.Mock()
+        self.loop.add_reader._is_coroutine = False
+        self.loop.add_writer = mock.Mock()
+        self.loop.remove_reader = mock.Mock()
+        self.loop.remove_writer = mock.Mock()
+        waiter = asyncio.Future(loop=self.loop)
+        with test_utils.disable_logger():
+            transport = self.loop._make_ssl_transport(
+                m, asyncio.Protocol(), m, waiter)
+            # execute the handshake while the logger is disabled
+            # to ignore SSL handshake failure
+            test_utils.run_briefly(self.loop)
+
+        # Sanity check
+        class_name = transport.__class__.__name__
+        self.assertIn("ssl", class_name.lower())
+        self.assertIn("transport", class_name.lower())
+
+        transport.close()
+        # execute pending callbacks to close the socket transport
+        test_utils.run_briefly(self.loop)
+
+    @mock.patch('asyncio.selector_events.ssl', None)
+    @mock.patch('asyncio.sslproto.ssl', None)
+    def test_make_ssl_transport_without_ssl_error(self):
+        m = mock.Mock()
+        self.loop.add_reader = mock.Mock()
+        self.loop.add_writer = mock.Mock()
+        self.loop.remove_reader = mock.Mock()
+        self.loop.remove_writer = mock.Mock()
+        with self.assertRaises(RuntimeError):
+            self.loop._make_ssl_transport(m, m, m, m)
+
+    def test_close(self):
+        class EventLoop(BaseSelectorEventLoop):
+            def _make_self_pipe(self):
+                self._ssock = mock.Mock()
+                self._csock = mock.Mock()
+                self._internal_fds += 1
+
+        self.loop = EventLoop(self.selector)
+        self.set_event_loop(self.loop)
+
+        ssock = self.loop._ssock
+        ssock.fileno.return_value = 7
+        csock = self.loop._csock
+        csock.fileno.return_value = 1
+        remove_reader = self.loop.remove_reader = mock.Mock()
+
+        self.loop._selector.close()
+        self.loop._selector = selector = mock.Mock()
+        self.assertFalse(self.loop.is_closed())
+
+        self.loop.close()
+        self.assertTrue(self.loop.is_closed())
+        self.assertIsNone(self.loop._selector)
+        self.assertIsNone(self.loop._csock)
+        self.assertIsNone(self.loop._ssock)
+        selector.close.assert_called_with()
+        ssock.close.assert_called_with()
+        csock.close.assert_called_with()
+        remove_reader.assert_called_with(7)
+
+        # it should be possible to call close() more than once
+        self.loop.close()
+        self.loop.close()
+
+        # operation blocked when the loop is closed
+        f = asyncio.Future(loop=self.loop)
+        self.assertRaises(RuntimeError, self.loop.run_forever)
+        self.assertRaises(RuntimeError, self.loop.run_until_complete, f)
+        fd = 0
+        def callback():
+            pass
+        self.assertRaises(RuntimeError, self.loop.add_reader, fd, callback)
+        self.assertRaises(RuntimeError, self.loop.add_writer, fd, callback)
+
+    def test_close_no_selector(self):
+        self.loop.remove_reader = mock.Mock()
+        self.loop._selector.close()
+        self.loop._selector = None
+        self.loop.close()
+        self.assertIsNone(self.loop._selector)
+
+    def test_socketpair(self):
+        self.assertRaises(NotImplementedError, self.loop._socketpair)
+
+    def test_read_from_self_tryagain(self):
+        self.loop._ssock.recv.side_effect = BlockingIOError
+        self.assertIsNone(self.loop._read_from_self())
+
+    def test_read_from_self_exception(self):
+        self.loop._ssock.recv.side_effect = OSError
+        self.assertRaises(OSError, self.loop._read_from_self)
+
+    def test_write_to_self_tryagain(self):
+        self.loop._csock.send.side_effect = BlockingIOError
+        with test_utils.disable_logger():
+            self.assertIsNone(self.loop._write_to_self())
+
+    def test_write_to_self_exception(self):
+        # _write_to_self() swallows OSError
+        self.loop._csock.send.side_effect = RuntimeError()
+        self.assertRaises(RuntimeError, self.loop._write_to_self)
+
+    def test_sock_recv(self):
+        sock = test_utils.mock_nonblocking_socket()
+        self.loop._sock_recv = mock.Mock()
+
+        f = self.loop.sock_recv(sock, 1024)
+        self.assertIsInstance(f, asyncio.Future)
+        self.loop._sock_recv.assert_called_with(f, False, sock, 1024)
+
+    def test__sock_recv_canceled_fut(self):
+        sock = mock.Mock()
+
+        f = asyncio.Future(loop=self.loop)
+        f.cancel()
+
+        self.loop._sock_recv(f, False, sock, 1024)
+        self.assertFalse(sock.recv.called)
+
+    def test__sock_recv_unregister(self):
+        sock = mock.Mock()
+        sock.fileno.return_value = 10
+
+        f = asyncio.Future(loop=self.loop)
+        f.cancel()
+
+        self.loop.remove_reader = mock.Mock()
+        self.loop._sock_recv(f, True, sock, 1024)
+        self.assertEqual((10,), self.loop.remove_reader.call_args[0])
+
+    def test__sock_recv_tryagain(self):
+        f = asyncio.Future(loop=self.loop)
+        sock = mock.Mock()
+        sock.fileno.return_value = 10
+        sock.recv.side_effect = BlockingIOError
+
+        self.loop.add_reader = mock.Mock()
+        self.loop._sock_recv(f, False, sock, 1024)
+        self.assertEqual((10, self.loop._sock_recv, f, True, sock, 1024),
+                         self.loop.add_reader.call_args[0])
+
+    def test__sock_recv_exception(self):
+        f = asyncio.Future(loop=self.loop)
+        sock = mock.Mock()
+        sock.fileno.return_value = 10
+        err = sock.recv.side_effect = OSError()
+
+        self.loop._sock_recv(f, False, sock, 1024)
+        self.assertIs(err, f.exception())
+
+    def test_sock_sendall(self):
+        sock = test_utils.mock_nonblocking_socket()
+        self.loop._sock_sendall = mock.Mock()
+
+        f = self.loop.sock_sendall(sock, b'data')
+        self.assertIsInstance(f, asyncio.Future)
+        self.assertEqual(
+            (f, False, sock, b'data'),
+            self.loop._sock_sendall.call_args[0])
+
+    def test_sock_sendall_nodata(self):
+        sock = test_utils.mock_nonblocking_socket()
+        self.loop._sock_sendall = mock.Mock()
+
+        f = self.loop.sock_sendall(sock, b'')
+        self.assertIsInstance(f, asyncio.Future)
+        self.assertTrue(f.done())
+        self.assertIsNone(f.result())
+        self.assertFalse(self.loop._sock_sendall.called)
+
+    def test__sock_sendall_canceled_fut(self):
+        sock = mock.Mock()
+
+        f = asyncio.Future(loop=self.loop)
+        f.cancel()
+
+        self.loop._sock_sendall(f, False, sock, b'data')
+        self.assertFalse(sock.send.called)
+
+    def test__sock_sendall_unregister(self):
+        sock = mock.Mock()
+        sock.fileno.return_value = 10
+
+        f = asyncio.Future(loop=self.loop)
+        f.cancel()
+
+        self.loop.remove_writer = mock.Mock()
+        self.loop._sock_sendall(f, True, sock, b'data')
+        self.assertEqual((10,), self.loop.remove_writer.call_args[0])
+
+    def test__sock_sendall_tryagain(self):
+        f = asyncio.Future(loop=self.loop)
+        sock = mock.Mock()
+        sock.fileno.return_value = 10
+        sock.send.side_effect = BlockingIOError
+
+        self.loop.add_writer = mock.Mock()
+        self.loop._sock_sendall(f, False, sock, b'data')
+        self.assertEqual(
+            (10, self.loop._sock_sendall, f, True, sock, b'data'),
+            self.loop.add_writer.call_args[0])
+
+    def test__sock_sendall_interrupted(self):
+        f = asyncio.Future(loop=self.loop)
+        sock = mock.Mock()
+        sock.fileno.return_value = 10
+        sock.send.side_effect = InterruptedError
+
+        self.loop.add_writer = mock.Mock()
+        self.loop._sock_sendall(f, False, sock, b'data')
+        self.assertEqual(
+            (10, self.loop._sock_sendall, f, True, sock, b'data'),
+            self.loop.add_writer.call_args[0])
+
+    def test__sock_sendall_exception(self):
+        f = asyncio.Future(loop=self.loop)
+        sock = mock.Mock()
+        sock.fileno.return_value = 10
+        err = sock.send.side_effect = OSError()
+
+        self.loop._sock_sendall(f, False, sock, b'data')
+        self.assertIs(f.exception(), err)
+
+    def test__sock_sendall(self):
+        sock = mock.Mock()
+
+        f = asyncio.Future(loop=self.loop)
+        sock.fileno.return_value = 10
+        sock.send.return_value = 4
+
+        self.loop._sock_sendall(f, False, sock, b'data')
+        self.assertTrue(f.done())
+        self.assertIsNone(f.result())
+
+    def test__sock_sendall_partial(self):
+        sock = mock.Mock()
+
+        f = asyncio.Future(loop=self.loop)
+        sock.fileno.return_value = 10
+        sock.send.return_value = 2
+
+        self.loop.add_writer = mock.Mock()
+        self.loop._sock_sendall(f, False, sock, b'data')
+        self.assertFalse(f.done())
+        self.assertEqual(
+            (10, self.loop._sock_sendall, f, True, sock, b'ta'),
+            self.loop.add_writer.call_args[0])
+
+    def test__sock_sendall_none(self):
+        sock = mock.Mock()
+
+        f = asyncio.Future(loop=self.loop)
+        sock.fileno.return_value = 10
+        sock.send.return_value = 0
+
+        self.loop.add_writer = mock.Mock()
+        self.loop._sock_sendall(f, False, sock, b'data')
+        self.assertFalse(f.done())
+        self.assertEqual(
+            (10, self.loop._sock_sendall, f, True, sock, b'data'),
+            self.loop.add_writer.call_args[0])
+
+    def test_sock_connect(self):
+        sock = test_utils.mock_nonblocking_socket()
+        self.loop._sock_connect = mock.Mock()
+
+        f = self.loop.sock_connect(sock, ('127.0.0.1', 8080))
+        self.assertIsInstance(f, asyncio.Future)
+        self.assertEqual(
+            (f, sock, ('127.0.0.1', 8080)),
+            self.loop._sock_connect.call_args[0])
+
+    def test_sock_connect_timeout(self):
+        # Tulip issue #205: sock_connect() must unregister the socket on
+        # timeout error
+
+        # prepare mocks
+        self.loop.add_writer = mock.Mock()
+        self.loop.remove_writer = mock.Mock()
+        sock = test_utils.mock_nonblocking_socket()
+        sock.connect.side_effect = BlockingIOError
+
+        # first call to sock_connect() registers the socket
+        fut = self.loop.sock_connect(sock, ('127.0.0.1', 80))
+        self.assertTrue(sock.connect.called)
+        self.assertTrue(self.loop.add_writer.called)
+        self.assertEqual(len(fut._callbacks), 1)
+
+        # on timeout, the socket must be unregistered
+        sock.connect.reset_mock()
+        fut.set_exception(asyncio.TimeoutError)
+        with self.assertRaises(asyncio.TimeoutError):
+            self.loop.run_until_complete(fut)
+        self.assertTrue(self.loop.remove_writer.called)
+
+    def test__sock_connect(self):
+        f = asyncio.Future(loop=self.loop)
+
+        sock = mock.Mock()
+        sock.fileno.return_value = 10
+
+        self.loop._sock_connect(f, sock, ('127.0.0.1', 8080))
+        self.assertTrue(f.done())
+        self.assertIsNone(f.result())
+        self.assertTrue(sock.connect.called)
+
+    def test__sock_connect_cb_cancelled_fut(self):
+        sock = mock.Mock()
+        self.loop.remove_writer = mock.Mock()
+
+        f = asyncio.Future(loop=self.loop)
+        f.cancel()
+
+        self.loop._sock_connect_cb(f, sock, ('127.0.0.1', 8080))
+        self.assertFalse(sock.getsockopt.called)
+
+    def test__sock_connect_writer(self):
+        # check that the fd is registered and then unregistered
+        self.loop._process_events = mock.Mock()
+        self.loop.add_writer = mock.Mock()
+        self.loop.remove_writer = mock.Mock()
+
+        sock = mock.Mock()
+        sock.fileno.return_value = 10
+        sock.connect.side_effect = BlockingIOError
+        sock.getsockopt.return_value = 0
+        address = ('127.0.0.1', 8080)
+
+        f = asyncio.Future(loop=self.loop)
+        self.loop._sock_connect(f, sock, address)
+        self.assertTrue(self.loop.add_writer.called)
+        self.assertEqual(10, self.loop.add_writer.call_args[0][0])
+
+        self.loop._sock_connect_cb(f, sock, address)
+        # need to run the event loop to execute _sock_connect_done() callback
+        self.loop.run_until_complete(f)
+        self.assertEqual((10,), self.loop.remove_writer.call_args[0])
+
+    def test__sock_connect_cb_tryagain(self):
+        f = asyncio.Future(loop=self.loop)
+        sock = mock.Mock()
+        sock.fileno.return_value = 10
+        sock.getsockopt.return_value = errno.EAGAIN
+
+        # check that the exception is handled
+        self.loop._sock_connect_cb(f, sock, ('127.0.0.1', 8080))
+
+    def test__sock_connect_cb_exception(self):
+        f = asyncio.Future(loop=self.loop)
+        sock = mock.Mock()
+        sock.fileno.return_value = 10
+        sock.getsockopt.return_value = errno.ENOTCONN
+
+        self.loop.remove_writer = mock.Mock()
+        self.loop._sock_connect_cb(f, sock, ('127.0.0.1', 8080))
+        self.assertIsInstance(f.exception(), OSError)
+
+    def test_sock_accept(self):
+        sock = test_utils.mock_nonblocking_socket()
+        self.loop._sock_accept = mock.Mock()
+
+        f = self.loop.sock_accept(sock)
+        self.assertIsInstance(f, asyncio.Future)
+        self.assertEqual(
+            (f, False, sock), self.loop._sock_accept.call_args[0])
+
+    def test__sock_accept(self):
+        f = asyncio.Future(loop=self.loop)
+
+        conn = mock.Mock()
+
+        sock = mock.Mock()
+        sock.fileno.return_value = 10
+        sock.accept.return_value = conn, ('127.0.0.1', 1000)
+
+        self.loop._sock_accept(f, False, sock)
+        self.assertTrue(f.done())
+        self.assertEqual((conn, ('127.0.0.1', 1000)), f.result())
+        self.assertEqual((False,), conn.setblocking.call_args[0])
+
+    def test__sock_accept_canceled_fut(self):
+        sock = mock.Mock()
+
+        f = asyncio.Future(loop=self.loop)
+        f.cancel()
+
+        self.loop._sock_accept(f, False, sock)
+        self.assertFalse(sock.accept.called)
+
+    def test__sock_accept_unregister(self):
+        sock = mock.Mock()
+        sock.fileno.return_value = 10
+
+        f = asyncio.Future(loop=self.loop)
+        f.cancel()
+
+        self.loop.remove_reader = mock.Mock()
+        self.loop._sock_accept(f, True, sock)
+        self.assertEqual((10,), self.loop.remove_reader.call_args[0])
+
+    def test__sock_accept_tryagain(self):
+        f = asyncio.Future(loop=self.loop)
+        sock = mock.Mock()
+        sock.fileno.return_value = 10
+        sock.accept.side_effect = BlockingIOError
+
+        self.loop.add_reader = mock.Mock()
+        self.loop._sock_accept(f, False, sock)
+        self.assertEqual(
+            (10, self.loop._sock_accept, f, True, sock),
+            self.loop.add_reader.call_args[0])
+
+    def test__sock_accept_exception(self):
+        f = asyncio.Future(loop=self.loop)
+        sock = mock.Mock()
+        sock.fileno.return_value = 10
+        err = sock.accept.side_effect = OSError()
+
+        self.loop._sock_accept(f, False, sock)
+        self.assertIs(err, f.exception())
+
+    def test_add_reader(self):
+        self.loop._selector.get_key.side_effect = KeyError
+        cb = lambda: True
+        self.loop.add_reader(1, cb)
+
+        self.assertTrue(self.loop._selector.register.called)
+        fd, mask, (r, w) = self.loop._selector.register.call_args[0]
+        self.assertEqual(1, fd)
+        self.assertEqual(selectors.EVENT_READ, mask)
+        self.assertEqual(cb, r._callback)
+        self.assertIsNone(w)
+
+    def test_add_reader_existing(self):
+        reader = mock.Mock()
+        writer = mock.Mock()
+        self.loop._selector.get_key.return_value = selectors.SelectorKey(
+            1, 1, selectors.EVENT_WRITE, (reader, writer))
+        cb = lambda: True
+        self.loop.add_reader(1, cb)
+
+        self.assertTrue(reader.cancel.called)
+        self.assertFalse(self.loop._selector.register.called)
+        self.assertTrue(self.loop._selector.modify.called)
+        fd, mask, (r, w) = self.loop._selector.modify.call_args[0]
+        self.assertEqual(1, fd)
+        self.assertEqual(selectors.EVENT_WRITE | selectors.EVENT_READ, mask)
+        self.assertEqual(cb, r._callback)
+        self.assertEqual(writer, w)
+
+    def test_add_reader_existing_writer(self):
+        writer = mock.Mock()
+        self.loop._selector.get_key.return_value = selectors.SelectorKey(
+            1, 1, selectors.EVENT_WRITE, (None, writer))
+        cb = lambda: True
+        self.loop.add_reader(1, cb)
+
+        self.assertFalse(self.loop._selector.register.called)
+        self.assertTrue(self.loop._selector.modify.called)
+        fd, mask, (r, w) = self.loop._selector.modify.call_args[0]
+        self.assertEqual(1, fd)
+        self.assertEqual(selectors.EVENT_WRITE | selectors.EVENT_READ, mask)
+        self.assertEqual(cb, r._callback)
+        self.assertEqual(writer, w)
+
+    def test_remove_reader(self):
+        self.loop._selector.get_key.return_value = selectors.SelectorKey(
+            1, 1, selectors.EVENT_READ, (None, None))
+        self.assertFalse(self.loop.remove_reader(1))
+
+        self.assertTrue(self.loop._selector.unregister.called)
+
+    def test_remove_reader_read_write(self):
+        reader = mock.Mock()
+        writer = mock.Mock()
+        self.loop._selector.get_key.return_value = selectors.SelectorKey(
+            1, 1, selectors.EVENT_READ | selectors.EVENT_WRITE,
+            (reader, writer))
+        self.assertTrue(
+            self.loop.remove_reader(1))
+
+        self.assertFalse(self.loop._selector.unregister.called)
+        self.assertEqual(
+            (1, selectors.EVENT_WRITE, (None, writer)),
+            self.loop._selector.modify.call_args[0])
+
+    def test_remove_reader_unknown(self):
+        self.loop._selector.get_key.side_effect = KeyError
+        self.assertFalse(
+            self.loop.remove_reader(1))
+
+    def test_add_writer(self):
+        self.loop._selector.get_key.side_effect = KeyError
+        cb = lambda: True
+        self.loop.add_writer(1, cb)
+
+        self.assertTrue(self.loop._selector.register.called)
+        fd, mask, (r, w) = self.loop._selector.register.call_args[0]
+        self.assertEqual(1, fd)
+        self.assertEqual(selectors.EVENT_WRITE, mask)
+        self.assertIsNone(r)
+        self.assertEqual(cb, w._callback)
+
+    def test_add_writer_existing(self):
+        reader = mock.Mock()
+        writer = mock.Mock()
+        self.loop._selector.get_key.return_value = selectors.SelectorKey(
+            1, 1, selectors.EVENT_READ, (reader, writer))
+        cb = lambda: True
+        self.loop.add_writer(1, cb)
+
+        self.assertTrue(writer.cancel.called)
+        self.assertFalse(self.loop._selector.register.called)
+        self.assertTrue(self.loop._selector.modify.called)
+        fd, mask, (r, w) = self.loop._selector.modify.call_args[0]
+        self.assertEqual(1, fd)
+        self.assertEqual(selectors.EVENT_WRITE | selectors.EVENT_READ, mask)
+        self.assertEqual(reader, r)
+        self.assertEqual(cb, w._callback)
+
+    def test_remove_writer(self):
+        self.loop._selector.get_key.return_value = selectors.SelectorKey(
+            1, 1, selectors.EVENT_WRITE, (None, None))
+        self.assertFalse(self.loop.remove_writer(1))
+
+        self.assertTrue(self.loop._selector.unregister.called)
+
+    def test_remove_writer_read_write(self):
+        reader = mock.Mock()
+        writer = mock.Mock()
+        self.loop._selector.get_key.return_value = selectors.SelectorKey(
+            1, 1, selectors.EVENT_READ | selectors.EVENT_WRITE,
+            (reader, writer))
+        self.assertTrue(
+            self.loop.remove_writer(1))
+
+        self.assertFalse(self.loop._selector.unregister.called)
+        self.assertEqual(
+            (1, selectors.EVENT_READ, (reader, None)),
+            self.loop._selector.modify.call_args[0])
+
+    def test_remove_writer_unknown(self):
+        self.loop._selector.get_key.side_effect = KeyError
+        self.assertFalse(
+            self.loop.remove_writer(1))
+
+    def test_process_events_read(self):
+        reader = mock.Mock()
+        reader._cancelled = False
+
+        self.loop._add_callback = mock.Mock()
+        self.loop._process_events(
+            [(selectors.SelectorKey(
+                1, 1, selectors.EVENT_READ, (reader, None)),
+              selectors.EVENT_READ)])
+        self.assertTrue(self.loop._add_callback.called)
+        self.loop._add_callback.assert_called_with(reader)
+
+    def test_process_events_read_cancelled(self):
+        reader = mock.Mock()
+        reader.cancelled = True
+
+        self.loop.remove_reader = mock.Mock()
+        self.loop._process_events(
+            [(selectors.SelectorKey(
+                1, 1, selectors.EVENT_READ, (reader, None)),
+             selectors.EVENT_READ)])
+        self.loop.remove_reader.assert_called_with(1)
+
+    def test_process_events_write(self):
+        writer = mock.Mock()
+        writer._cancelled = False
+
+        self.loop._add_callback = mock.Mock()
+        self.loop._process_events(
+            [(selectors.SelectorKey(1, 1, selectors.EVENT_WRITE,
+                                    (None, writer)),
+              selectors.EVENT_WRITE)])
+        self.loop._add_callback.assert_called_with(writer)
+
+    def test_process_events_write_cancelled(self):
+        writer = mock.Mock()
+        writer.cancelled = True
+        self.loop.remove_writer = mock.Mock()
+
+        self.loop._process_events(
+            [(selectors.SelectorKey(1, 1, selectors.EVENT_WRITE,
+                                    (None, writer)),
+              selectors.EVENT_WRITE)])
+        self.loop.remove_writer.assert_called_with(1)
+
+
+class SelectorTransportTests(test_utils.TestCase):
+
+    def setUp(self):
+        self.loop = self.new_test_loop()
+        self.protocol = test_utils.make_test_protocol(asyncio.Protocol)
+        self.sock = mock.Mock(socket.socket)
+        self.sock.fileno.return_value = 7
+
+    def create_transport(self):
+        transport = _SelectorTransport(self.loop, self.sock, self.protocol,
+                                       None)
+        self.addCleanup(close_transport, transport)
+        return transport
+
+    def test_ctor(self):
+        tr = self.create_transport()
+        self.assertIs(tr._loop, self.loop)
+        self.assertIs(tr._sock, self.sock)
+        self.assertIs(tr._sock_fd, 7)
+
+    def test_abort(self):
+        tr = self.create_transport()
+        tr._force_close = mock.Mock()
+
+        tr.abort()
+        tr._force_close.assert_called_with(None)
+
+    def test_close(self):
+        tr = self.create_transport()
+        tr.close()
+
+        self.assertTrue(tr._closing)
+        self.assertEqual(1, self.loop.remove_reader_count[7])
+        self.protocol.connection_lost(None)
+        self.assertEqual(tr._conn_lost, 1)
+
+        tr.close()
+        self.assertEqual(tr._conn_lost, 1)
+        self.assertEqual(1, self.loop.remove_reader_count[7])
+
+    def test_close_write_buffer(self):
+        tr = self.create_transport()
+        tr._buffer.extend(b'data')
+        tr.close()
+
+        self.assertFalse(self.loop.readers)
+        test_utils.run_briefly(self.loop)
+        self.assertFalse(self.protocol.connection_lost.called)
+
+    def test_force_close(self):
+        tr = self.create_transport()
+        tr._buffer.extend(b'1')
+        self.loop.add_reader(7, mock.sentinel)
+        self.loop.add_writer(7, mock.sentinel)
+        tr._force_close(None)
+
+        self.assertTrue(tr._closing)
+        self.assertEqual(tr._buffer, list_to_buffer())
+        self.assertFalse(self.loop.readers)
+        self.assertFalse(self.loop.writers)
+
+        # second close should not remove reader
+        tr._force_close(None)
+        self.assertFalse(self.loop.readers)
+        self.assertEqual(1, self.loop.remove_reader_count[7])
+
+    @mock.patch('asyncio.log.logger.error')
+    def test_fatal_error(self, m_exc):
+        exc = OSError()
+        tr = self.create_transport()
+        tr._force_close = mock.Mock()
+        tr._fatal_error(exc)
+
+        m_exc.assert_called_with(
+            test_utils.MockPattern(
+                'Fatal error on transport\nprotocol:.*\ntransport:.*'),
+            exc_info=(OSError, MOCK_ANY, MOCK_ANY))
+
+        tr._force_close.assert_called_with(exc)
+
+    def test_connection_lost(self):
+        exc = OSError()
+        tr = self.create_transport()
+        self.assertIsNotNone(tr._protocol)
+        self.assertIsNotNone(tr._loop)
+        tr._call_connection_lost(exc)
+
+        self.protocol.connection_lost.assert_called_with(exc)
+        self.sock.close.assert_called_with()
+        self.assertIsNone(tr._sock)
+
+        self.assertIsNone(tr._protocol)
+        self.assertIsNone(tr._loop)
+
+
+class SelectorSocketTransportTests(test_utils.TestCase):
+
+    def setUp(self):
+        self.loop = self.new_test_loop()
+        self.protocol = test_utils.make_test_protocol(asyncio.Protocol)
+        self.sock = mock.Mock(socket.socket)
+        self.sock_fd = self.sock.fileno.return_value = 7
+
+    def socket_transport(self, waiter=None):
+        transport = _SelectorSocketTransport(self.loop, self.sock,
+                                             self.protocol, waiter=waiter)
+        self.addCleanup(close_transport, transport)
+        return transport
+
+    def test_ctor(self):
+        waiter = asyncio.Future(loop=self.loop)
+        tr = self.socket_transport(waiter=waiter)
+        self.loop.run_until_complete(waiter)
+
+        self.loop.assert_reader(7, tr._read_ready)
+        test_utils.run_briefly(self.loop)
+        self.protocol.connection_made.assert_called_with(tr)
+
+    def test_ctor_with_waiter(self):
+        waiter = asyncio.Future(loop=self.loop)
+        self.socket_transport(waiter=waiter)
+        self.loop.run_until_complete(waiter)
+
+        self.assertIsNone(waiter.result())
+
+    def test_pause_resume_reading(self):
+        tr = self.socket_transport()
+        test_utils.run_briefly(self.loop)
+        self.assertFalse(tr._paused)
+        self.loop.assert_reader(7, tr._read_ready)
+        tr.pause_reading()
+        self.assertTrue(tr._paused)
+        self.assertFalse(7 in self.loop.readers)
+        tr.resume_reading()
+        self.assertFalse(tr._paused)
+        self.loop.assert_reader(7, tr._read_ready)
+        with self.assertRaises(RuntimeError):
+            tr.resume_reading()
+
+    def test_read_ready(self):
+        transport = self.socket_transport()
+
+        self.sock.recv.return_value = b'data'
+        transport._read_ready()
+
+        self.protocol.data_received.assert_called_with(b'data')
+
+    def test_read_ready_eof(self):
+        transport = self.socket_transport()
+        transport.close = mock.Mock()
+
+        self.sock.recv.return_value = b''
+        transport._read_ready()
+
+        self.protocol.eof_received.assert_called_with()
+        transport.close.assert_called_with()
+
+    def test_read_ready_eof_keep_open(self):
+        transport = self.socket_transport()
+        transport.close = mock.Mock()
+
+        self.sock.recv.return_value = b''
+        self.protocol.eof_received.return_value = True
+        transport._read_ready()
+
+        self.protocol.eof_received.assert_called_with()
+        self.assertFalse(transport.close.called)
+
+    @mock.patch('logging.exception')
+    def test_read_ready_tryagain(self, m_exc):
+        self.sock.recv.side_effect = BlockingIOError
+
+        transport = self.socket_transport()
+        transport._fatal_error = mock.Mock()
+        transport._read_ready()
+
+        self.assertFalse(transport._fatal_error.called)
+
+    @mock.patch('logging.exception')
+    def test_read_ready_tryagain_interrupted(self, m_exc):
+        self.sock.recv.side_effect = InterruptedError
+
+        transport = self.socket_transport()
+        transport._fatal_error = mock.Mock()
+        transport._read_ready()
+
+        self.assertFalse(transport._fatal_error.called)
+
+    @mock.patch('logging.exception')
+    def test_read_ready_conn_reset(self, m_exc):
+        err = self.sock.recv.side_effect = ConnectionResetError()
+
+        transport = self.socket_transport()
+        transport._force_close = mock.Mock()
+        with test_utils.disable_logger():
+            transport._read_ready()
+        transport._force_close.assert_called_with(err)
+
+    @mock.patch('logging.exception')
+    def test_read_ready_err(self, m_exc):
+        err = self.sock.recv.side_effect = OSError()
+
+        transport = self.socket_transport()
+        transport._fatal_error = mock.Mock()
+        transport._read_ready()
+
+        transport._fatal_error.assert_called_with(
+                                   err,
+                                   'Fatal read error on socket transport')
+
+    def test_write(self):
+        data = b'data'
+        self.sock.send.return_value = len(data)
+
+        transport = self.socket_transport()
+        transport.write(data)
+        self.sock.send.assert_called_with(data)
+
+    def test_write_bytearray(self):
+        data = bytearray(b'data')
+        self.sock.send.return_value = len(data)
+
+        transport = self.socket_transport()
+        transport.write(data)
+        self.sock.send.assert_called_with(data)
+        self.assertEqual(data, bytearray(b'data'))  # Hasn't been mutated.
+
+    def test_write_memoryview(self):
+        data = memoryview(b'data')
+        self.sock.send.return_value = len(data)
+
+        transport = self.socket_transport()
+        transport.write(data)
+        self.sock.send.assert_called_with(data)
+
+    def test_write_no_data(self):
+        transport = self.socket_transport()
+        transport._buffer.extend(b'data')
+        transport.write(b'')
+        self.assertFalse(self.sock.send.called)
+        self.assertEqual(list_to_buffer([b'data']), transport._buffer)
+
+    def test_write_buffer(self):
+        transport = self.socket_transport()
+        transport._buffer.extend(b'data1')
+        transport.write(b'data2')
+        self.assertFalse(self.sock.send.called)
+        self.assertEqual(list_to_buffer([b'data1', b'data2']),
+                         transport._buffer)
+
+    def test_write_partial(self):
+        data = b'data'
+        self.sock.send.return_value = 2
+
+        transport = self.socket_transport()
+        transport.write(data)
+
+        self.loop.assert_writer(7, transport._write_ready)
+        self.assertEqual(list_to_buffer([b'ta']), transport._buffer)
+
+    def test_write_partial_bytearray(self):
+        data = bytearray(b'data')
+        self.sock.send.return_value = 2
+
+        transport = self.socket_transport()
+        transport.write(data)
+
+        self.loop.assert_writer(7, transport._write_ready)
+        self.assertEqual(list_to_buffer([b'ta']), transport._buffer)
+        self.assertEqual(data, bytearray(b'data'))  # Hasn't been mutated.
+
+    def test_write_partial_memoryview(self):
+        data = memoryview(b'data')
+        self.sock.send.return_value = 2
+
+        transport = self.socket_transport()
+        transport.write(data)
+
+        self.loop.assert_writer(7, transport._write_ready)
+        self.assertEqual(list_to_buffer([b'ta']), transport._buffer)
+
+    def test_write_partial_none(self):
+        data = b'data'
+        self.sock.send.return_value = 0
+        self.sock.fileno.return_value = 7
+
+        transport = self.socket_transport()
+        transport.write(data)
+
+        self.loop.assert_writer(7, transport._write_ready)
+        self.assertEqual(list_to_buffer([b'data']), transport._buffer)
+
+    def test_write_tryagain(self):
+        self.sock.send.side_effect = BlockingIOError
+
+        data = b'data'
+        transport = self.socket_transport()
+        transport.write(data)
+
+        self.loop.assert_writer(7, transport._write_ready)
+        self.assertEqual(list_to_buffer([b'data']), transport._buffer)
+
+    @mock.patch('asyncio.selector_events.logger')
+    def test_write_exception(self, m_log):
+        err = self.sock.send.side_effect = OSError()
+
+        data = b'data'
+        transport = self.socket_transport()
+        transport._fatal_error = mock.Mock()
+        transport.write(data)
+        transport._fatal_error.assert_called_with(
+                                   err,
+                                   'Fatal write error on socket transport')
+        transport._conn_lost = 1
+
+        self.sock.reset_mock()
+        transport.write(data)
+        self.assertFalse(self.sock.send.called)
+        self.assertEqual(transport._conn_lost, 2)
+        transport.write(data)
+        transport.write(data)
+        transport.write(data)
+        transport.write(data)
+        m_log.warning.assert_called_with('socket.send() raised exception.')
+
+    def test_write_str(self):
+        transport = self.socket_transport()
+        self.assertRaises(TypeError, transport.write, 'str')
+
+    def test_write_closing(self):
+        transport = self.socket_transport()
+        transport.close()
+        self.assertEqual(transport._conn_lost, 1)
+        transport.write(b'data')
+        self.assertEqual(transport._conn_lost, 2)
+
+    def test_write_ready(self):
+        data = b'data'
+        self.sock.send.return_value = len(data)
+
+        transport = self.socket_transport()
+        transport._buffer.extend(data)
+        self.loop.add_writer(7, transport._write_ready)
+        transport._write_ready()
+        self.assertTrue(self.sock.send.called)
+        self.assertFalse(self.loop.writers)
+
+    def test_write_ready_closing(self):
+        data = b'data'
+        self.sock.send.return_value = len(data)
+
+        transport = self.socket_transport()
+        transport._closing = True
+        transport._buffer.extend(data)
+        self.loop.add_writer(7, transport._write_ready)
+        transport._write_ready()
+        self.assertTrue(self.sock.send.called)
+        self.assertFalse(self.loop.writers)
+        self.sock.close.assert_called_with()
+        self.protocol.connection_lost.assert_called_with(None)
+
+    def test_write_ready_no_data(self):
+        transport = self.socket_transport()
+        # This is an internal error.
+        self.assertRaises(AssertionError, transport._write_ready)
+
+    def test_write_ready_partial(self):
+        data = b'data'
+        self.sock.send.return_value = 2
+
+        transport = self.socket_transport()
+        transport._buffer.extend(data)
+        self.loop.add_writer(7, transport._write_ready)
+        transport._write_ready()
+        self.loop.assert_writer(7, transport._write_ready)
+        self.assertEqual(list_to_buffer([b'ta']), transport._buffer)
+
+    def test_write_ready_partial_none(self):
+        data = b'data'
+        self.sock.send.return_value = 0
+
+        transport = self.socket_transport()
+        transport._buffer.extend(data)
+        self.loop.add_writer(7, transport._write_ready)
+        transport._write_ready()
+        self.loop.assert_writer(7, transport._write_ready)
+        self.assertEqual(list_to_buffer([b'data']), transport._buffer)
+
+    def test_write_ready_tryagain(self):
+        self.sock.send.side_effect = BlockingIOError
+
+        transport = self.socket_transport()
+        transport._buffer = list_to_buffer([b'data1', b'data2'])
+        self.loop.add_writer(7, transport._write_ready)
+        transport._write_ready()
+
+        self.loop.assert_writer(7, transport._write_ready)
+        self.assertEqual(list_to_buffer([b'data1data2']), transport._buffer)
+
+    def test_write_ready_exception(self):
+        err = self.sock.send.side_effect = OSError()
+
+        transport = self.socket_transport()
+        transport._fatal_error = mock.Mock()
+        transport._buffer.extend(b'data')
+        transport._write_ready()
+        transport._fatal_error.assert_called_with(
+                                   err,
+                                   'Fatal write error on socket transport')
+
+    @mock.patch('asyncio.base_events.logger')
+    def test_write_ready_exception_and_close(self, m_log):
+        self.sock.send.side_effect = OSError()
+        remove_writer = self.loop.remove_writer = mock.Mock()
+
+        transport = self.socket_transport()
+        transport.close()
+        transport._buffer.extend(b'data')
+        transport._write_ready()
+        remove_writer.assert_called_with(self.sock_fd)
+
+    def test_write_eof(self):
+        tr = self.socket_transport()
+        self.assertTrue(tr.can_write_eof())
+        tr.write_eof()
+        self.sock.shutdown.assert_called_with(socket.SHUT_WR)
+        tr.write_eof()
+        self.assertEqual(self.sock.shutdown.call_count, 1)
+        tr.close()
+
+    def test_write_eof_buffer(self):
+        tr = self.socket_transport()
+        self.sock.send.side_effect = BlockingIOError
+        tr.write(b'data')
+        tr.write_eof()
+        self.assertEqual(tr._buffer, list_to_buffer([b'data']))
+        self.assertTrue(tr._eof)
+        self.assertFalse(self.sock.shutdown.called)
+        self.sock.send.side_effect = lambda _: 4
+        tr._write_ready()
+        self.assertTrue(self.sock.send.called)
+        self.sock.shutdown.assert_called_with(socket.SHUT_WR)
+        tr.close()
+
+
+@unittest.skipIf(ssl is None, 'No ssl module')
+class SelectorSslTransportTests(test_utils.TestCase):
+
+    def setUp(self):
+        self.loop = self.new_test_loop()
+        self.protocol = test_utils.make_test_protocol(asyncio.Protocol)
+        self.sock = mock.Mock(socket.socket)
+        self.sock.fileno.return_value = 7
+        self.sslsock = mock.Mock()
+        self.sslsock.fileno.return_value = 1
+        self.sslcontext = mock.Mock()
+        self.sslcontext.wrap_socket.return_value = self.sslsock
+
+    def ssl_transport(self, waiter=None, server_hostname=None):
+        transport = _SelectorSslTransport(self.loop, self.sock, self.protocol,
+                                          self.sslcontext, waiter=waiter,
+                                          server_hostname=server_hostname)
+        self.addCleanup(close_transport, transport)
+        return transport
+
+    def _make_one(self, create_waiter=None):
+        transport = self.ssl_transport()
+        self.sock.reset_mock()
+        self.sslsock.reset_mock()
+        self.sslcontext.reset_mock()
+        self.loop.reset_counters()
+        return transport
+
+    def test_on_handshake(self):
+        waiter = asyncio.Future(loop=self.loop)
+        tr = self.ssl_transport(waiter=waiter)
+        self.assertTrue(self.sslsock.do_handshake.called)
+        self.loop.assert_reader(1, tr._read_ready)
+        test_utils.run_briefly(self.loop)
+        self.assertIsNone(waiter.result())
+
+    def test_on_handshake_reader_retry(self):
+        self.loop.set_debug(False)
+        self.sslsock.do_handshake.side_effect = ssl.SSLWantReadError
+        transport = self.ssl_transport()
+        self.loop.assert_reader(1, transport._on_handshake, None)
+
+    def test_on_handshake_writer_retry(self):
+        self.loop.set_debug(False)
+        self.sslsock.do_handshake.side_effect = ssl.SSLWantWriteError
+        transport = self.ssl_transport()
+        self.loop.assert_writer(1, transport._on_handshake, None)
+
+    def test_on_handshake_exc(self):
+        exc = ValueError()
+        self.sslsock.do_handshake.side_effect = exc
+        with test_utils.disable_logger():
+            waiter = asyncio.Future(loop=self.loop)
+            transport = self.ssl_transport(waiter=waiter)
+        self.assertTrue(waiter.done())
+        self.assertIs(exc, waiter.exception())
+        self.assertTrue(self.sslsock.close.called)
+
+    def test_on_handshake_base_exc(self):
+        waiter = asyncio.Future(loop=self.loop)
+        transport = self.ssl_transport(waiter=waiter)
+        exc = BaseException()
+        self.sslsock.do_handshake.side_effect = exc
+        with test_utils.disable_logger():
+            self.assertRaises(BaseException, transport._on_handshake, 0)
+        self.assertTrue(self.sslsock.close.called)
+        self.assertTrue(waiter.done())
+        self.assertIs(exc, waiter.exception())
+
+    def test_cancel_handshake(self):
+        # Python issue #23197: cancelling an handshake must not raise an
+        # exception or log an error, even if the handshake failed
+        waiter = asyncio.Future(loop=self.loop)
+        transport = self.ssl_transport(waiter=waiter)
+        waiter.cancel()
+        exc = ValueError()
+        self.sslsock.do_handshake.side_effect = exc
+        with test_utils.disable_logger():
+            transport._on_handshake(0)
+        transport.close()
+        test_utils.run_briefly(self.loop)
+
+    def test_pause_resume_reading(self):
+        tr = self._make_one()
+        self.assertFalse(tr._paused)
+        self.loop.assert_reader(1, tr._read_ready)
+        tr.pause_reading()
+        self.assertTrue(tr._paused)
+        self.assertFalse(1 in self.loop.readers)
+        tr.resume_reading()
+        self.assertFalse(tr._paused)
+        self.loop.assert_reader(1, tr._read_ready)
+        with self.assertRaises(RuntimeError):
+            tr.resume_reading()
+
+    def test_write(self):
+        transport = self._make_one()
+        transport.write(b'data')
+        self.assertEqual(list_to_buffer([b'data']), transport._buffer)
+
+    def test_write_bytearray(self):
+        transport = self._make_one()
+        data = bytearray(b'data')
+        transport.write(data)
+        self.assertEqual(list_to_buffer([b'data']), transport._buffer)
+        self.assertEqual(data, bytearray(b'data'))  # Hasn't been mutated.
+        self.assertIsNot(data, transport._buffer)  # Hasn't been incorporated.
+
+    def test_write_memoryview(self):
+        transport = self._make_one()
+        data = memoryview(b'data')
+        transport.write(data)
+        self.assertEqual(list_to_buffer([b'data']), transport._buffer)
+
+    def test_write_no_data(self):
+        transport = self._make_one()
+        transport._buffer.extend(b'data')
+        transport.write(b'')
+        self.assertEqual(list_to_buffer([b'data']), transport._buffer)
+
+    def test_write_str(self):
+        transport = self._make_one()
+        self.assertRaises(TypeError, transport.write, 'str')
+
+    def test_write_closing(self):
+        transport = self._make_one()
+        transport.close()
+        self.assertEqual(transport._conn_lost, 1)
+        transport.write(b'data')
+        self.assertEqual(transport._conn_lost, 2)
+
+    @mock.patch('asyncio.selector_events.logger')
+    def test_write_exception(self, m_log):
+        transport = self._make_one()
+        transport._conn_lost = 1
+        transport.write(b'data')
+        self.assertEqual(transport._buffer, list_to_buffer())
+        transport.write(b'data')
+        transport.write(b'data')
+        transport.write(b'data')
+        transport.write(b'data')
+        m_log.warning.assert_called_with('socket.send() raised exception.')
+
+    def test_read_ready_recv(self):
+        self.sslsock.recv.return_value = b'data'
+        transport = self._make_one()
+        transport._read_ready()
+        self.assertTrue(self.sslsock.recv.called)
+        self.assertEqual((b'data',), self.protocol.data_received.call_args[0])
+
+    def test_read_ready_write_wants_read(self):
+        self.loop.add_writer = mock.Mock()
+        self.sslsock.recv.side_effect = BlockingIOError
+        transport = self._make_one()
+        transport._write_wants_read = True
+        transport._write_ready = mock.Mock()
+        transport._buffer.extend(b'data')
+        transport._read_ready()
+
+        self.assertFalse(transport._write_wants_read)
+        transport._write_ready.assert_called_with()
+        self.loop.add_writer.assert_called_with(
+            transport._sock_fd, transport._write_ready)
+
+    def test_read_ready_recv_eof(self):
+        self.sslsock.recv.return_value = b''
+        transport = self._make_one()
+        transport.close = mock.Mock()
+        transport._read_ready()
+        transport.close.assert_called_with()
+        self.protocol.eof_received.assert_called_with()
+
+    def test_read_ready_recv_conn_reset(self):
+        err = self.sslsock.recv.side_effect = ConnectionResetError()
+        transport = self._make_one()
+        transport._force_close = mock.Mock()
+        with test_utils.disable_logger():
+            transport._read_ready()
+        transport._force_close.assert_called_with(err)
+
+    def test_read_ready_recv_retry(self):
+        self.sslsock.recv.side_effect = ssl.SSLWantReadError
+        transport = self._make_one()
+        transport._read_ready()
+        self.assertTrue(self.sslsock.recv.called)
+        self.assertFalse(self.protocol.data_received.called)
+
+        self.sslsock.recv.side_effect = BlockingIOError
+        transport._read_ready()
+        self.assertFalse(self.protocol.data_received.called)
+
+        self.sslsock.recv.side_effect = InterruptedError
+        transport._read_ready()
+        self.assertFalse(self.protocol.data_received.called)
+
+    def test_read_ready_recv_write(self):
+        self.loop.remove_reader = mock.Mock()
+        self.loop.add_writer = mock.Mock()
+        self.sslsock.recv.side_effect = ssl.SSLWantWriteError
+        transport = self._make_one()
+        transport._read_ready()
+        self.assertFalse(self.protocol.data_received.called)
+        self.assertTrue(transport._read_wants_write)
+
+        self.loop.remove_reader.assert_called_with(transport._sock_fd)
+        self.loop.add_writer.assert_called_with(
+            transport._sock_fd, transport._write_ready)
+
+    def test_read_ready_recv_exc(self):
+        err = self.sslsock.recv.side_effect = OSError()
+        transport = self._make_one()
+        transport._fatal_error = mock.Mock()
+        transport._read_ready()
+        transport._fatal_error.assert_called_with(
+                                   err,
+                                   'Fatal read error on SSL transport')
+
+    def test_write_ready_send(self):
+        self.sslsock.send.return_value = 4
+        transport = self._make_one()
+        transport._buffer = list_to_buffer([b'data'])
+        transport._write_ready()
+        self.assertEqual(list_to_buffer(), transport._buffer)
+        self.assertTrue(self.sslsock.send.called)
+
+    def test_write_ready_send_none(self):
+        self.sslsock.send.return_value = 0
+        transport = self._make_one()
+        transport._buffer = list_to_buffer([b'data1', b'data2'])
+        transport._write_ready()
+        self.assertTrue(self.sslsock.send.called)
+        self.assertEqual(list_to_buffer([b'data1data2']), transport._buffer)
+
+    def test_write_ready_send_partial(self):
+        self.sslsock.send.return_value = 2
+        transport = self._make_one()
+        transport._buffer = list_to_buffer([b'data1', b'data2'])
+        transport._write_ready()
+        self.assertTrue(self.sslsock.send.called)
+        self.assertEqual(list_to_buffer([b'ta1data2']), transport._buffer)
+
+    def test_write_ready_send_closing_partial(self):
+        self.sslsock.send.return_value = 2
+        transport = self._make_one()
+        transport._buffer = list_to_buffer([b'data1', b'data2'])
+        transport._write_ready()
+        self.assertTrue(self.sslsock.send.called)
+        self.assertFalse(self.sslsock.close.called)
+
+    def test_write_ready_send_closing(self):
+        self.sslsock.send.return_value = 4
+        transport = self._make_one()
+        transport.close()
+        transport._buffer = list_to_buffer([b'data'])
+        transport._write_ready()
+        self.assertFalse(self.loop.writers)
+        self.protocol.connection_lost.assert_called_with(None)
+
+    def test_write_ready_send_closing_empty_buffer(self):
+        self.sslsock.send.return_value = 4
+        transport = self._make_one()
+        transport.close()
+        transport._buffer = list_to_buffer()
+        transport._write_ready()
+        self.assertFalse(self.loop.writers)
+        self.protocol.connection_lost.assert_called_with(None)
+
+    def test_write_ready_send_retry(self):
+        transport = self._make_one()
+        transport._buffer = list_to_buffer([b'data'])
+
+        self.sslsock.send.side_effect = ssl.SSLWantWriteError
+        transport._write_ready()
+        self.assertEqual(list_to_buffer([b'data']), transport._buffer)
+
+        self.sslsock.send.side_effect = BlockingIOError()
+        transport._write_ready()
+        self.assertEqual(list_to_buffer([b'data']), transport._buffer)
+
+    def test_write_ready_send_read(self):
+        transport = self._make_one()
+        transport._buffer = list_to_buffer([b'data'])
+
+        self.loop.remove_writer = mock.Mock()
+        self.sslsock.send.side_effect = ssl.SSLWantReadError
+        transport._write_ready()
+        self.assertFalse(self.protocol.data_received.called)
+        self.assertTrue(transport._write_wants_read)
+        self.loop.remove_writer.assert_called_with(transport._sock_fd)
+
+    def test_write_ready_send_exc(self):
+        err = self.sslsock.send.side_effect = OSError()
+
+        transport = self._make_one()
+        transport._buffer = list_to_buffer([b'data'])
+        transport._fatal_error = mock.Mock()
+        transport._write_ready()
+        transport._fatal_error.assert_called_with(
+                                   err,
+                                   'Fatal write error on SSL transport')
+        self.assertEqual(list_to_buffer(), transport._buffer)
+
+    def test_write_ready_read_wants_write(self):
+        self.loop.add_reader = mock.Mock()
+        self.sslsock.send.side_effect = BlockingIOError
+        transport = self._make_one()
+        transport._read_wants_write = True
+        transport._read_ready = mock.Mock()
+        transport._write_ready()
+
+        self.assertFalse(transport._read_wants_write)
+        transport._read_ready.assert_called_with()
+        self.loop.add_reader.assert_called_with(
+            transport._sock_fd, transport._read_ready)
+
+    def test_write_eof(self):
+        tr = self._make_one()
+        self.assertFalse(tr.can_write_eof())
+        self.assertRaises(NotImplementedError, tr.write_eof)
+
+    def check_close(self):
+        tr = self._make_one()
+        tr.close()
+
+        self.assertTrue(tr._closing)
+        self.assertEqual(1, self.loop.remove_reader_count[1])
+        self.assertEqual(tr._conn_lost, 1)
+
+        tr.close()
+        self.assertEqual(tr._conn_lost, 1)
+        self.assertEqual(1, self.loop.remove_reader_count[1])
+
+        test_utils.run_briefly(self.loop)
+
+    def test_close(self):
+        self.check_close()
+        self.assertTrue(self.protocol.connection_made.called)
+        self.assertTrue(self.protocol.connection_lost.called)
+
+    def test_close_not_connected(self):
+        self.sslsock.do_handshake.side_effect = ssl.SSLWantReadError
+        self.check_close()
+        self.assertFalse(self.protocol.connection_made.called)
+        self.assertFalse(self.protocol.connection_lost.called)
+
+    @unittest.skipIf(ssl is None, 'No SSL support')
+    def test_server_hostname(self):
+        self.ssl_transport(server_hostname='localhost')
+        self.sslcontext.wrap_socket.assert_called_with(
+            self.sock, do_handshake_on_connect=False, server_side=False,
+            server_hostname='localhost')
+
+
+class SelectorSslWithoutSslTransportTests(unittest.TestCase):
+
+    @mock.patch('asyncio.selector_events.ssl', None)
+    def test_ssl_transport_requires_ssl_module(self):
+        Mock = mock.Mock
+        with self.assertRaises(RuntimeError):
+            _SelectorSslTransport(Mock(), Mock(), Mock(), Mock())
+
+
+class SelectorDatagramTransportTests(test_utils.TestCase):
+
+    def setUp(self):
+        self.loop = self.new_test_loop()
+        self.protocol = test_utils.make_test_protocol(asyncio.DatagramProtocol)
+        self.sock = mock.Mock(spec_set=socket.socket)
+        self.sock.fileno.return_value = 7
+
+    def datagram_transport(self, address=None):
+        transport = _SelectorDatagramTransport(self.loop, self.sock,
+                                               self.protocol,
+                                               address=address)
+        self.addCleanup(close_transport, transport)
+        return transport
+
+    def test_read_ready(self):
+        transport = self.datagram_transport()
+
+        self.sock.recvfrom.return_value = (b'data', ('0.0.0.0', 1234))
+        transport._read_ready()
+
+        self.protocol.datagram_received.assert_called_with(
+            b'data', ('0.0.0.0', 1234))
+
+    def test_read_ready_tryagain(self):
+        transport = self.datagram_transport()
+
+        self.sock.recvfrom.side_effect = BlockingIOError
+        transport._fatal_error = mock.Mock()
+        transport._read_ready()
+
+        self.assertFalse(transport._fatal_error.called)
+
+    def test_read_ready_err(self):
+        transport = self.datagram_transport()
+
+        err = self.sock.recvfrom.side_effect = RuntimeError()
+        transport._fatal_error = mock.Mock()
+        transport._read_ready()
+
+        transport._fatal_error.assert_called_with(
+                                   err,
+                                   'Fatal read error on datagram transport')
+
+    def test_read_ready_oserr(self):
+        transport = self.datagram_transport()
+
+        err = self.sock.recvfrom.side_effect = OSError()
+        transport._fatal_error = mock.Mock()
+        transport._read_ready()
+
+        self.assertFalse(transport._fatal_error.called)
+        self.protocol.error_received.assert_called_with(err)
+
+    def test_sendto(self):
+        data = b'data'
+        transport = self.datagram_transport()
+        transport.sendto(data, ('0.0.0.0', 1234))
+        self.assertTrue(self.sock.sendto.called)
+        self.assertEqual(
+            self.sock.sendto.call_args[0], (data, ('0.0.0.0', 1234)))
+
+    def test_sendto_bytearray(self):
+        data = bytearray(b'data')
+        transport = self.datagram_transport()
+        transport.sendto(data, ('0.0.0.0', 1234))
+        self.assertTrue(self.sock.sendto.called)
+        self.assertEqual(
+            self.sock.sendto.call_args[0], (data, ('0.0.0.0', 1234)))
+
+    def test_sendto_memoryview(self):
+        data = memoryview(b'data')
+        transport = self.datagram_transport()
+        transport.sendto(data, ('0.0.0.0', 1234))
+        self.assertTrue(self.sock.sendto.called)
+        self.assertEqual(
+            self.sock.sendto.call_args[0], (data, ('0.0.0.0', 1234)))
+
+    def test_sendto_no_data(self):
+        transport = self.datagram_transport()
+        transport._buffer.append((b'data', ('0.0.0.0', 12345)))
+        transport.sendto(b'', ())
+        self.assertFalse(self.sock.sendto.called)
+        self.assertEqual(
+            [(b'data', ('0.0.0.0', 12345))], list(transport._buffer))
+
+    def test_sendto_buffer(self):
+        transport = self.datagram_transport()
+        transport._buffer.append((b'data1', ('0.0.0.0', 12345)))
+        transport.sendto(b'data2', ('0.0.0.0', 12345))
+        self.assertFalse(self.sock.sendto.called)
+        self.assertEqual(
+            [(b'data1', ('0.0.0.0', 12345)),
+             (b'data2', ('0.0.0.0', 12345))],
+            list(transport._buffer))
+
+    def test_sendto_buffer_bytearray(self):
+        data2 = bytearray(b'data2')
+        transport = self.datagram_transport()
+        transport._buffer.append((b'data1', ('0.0.0.0', 12345)))
+        transport.sendto(data2, ('0.0.0.0', 12345))
+        self.assertFalse(self.sock.sendto.called)
+        self.assertEqual(
+            [(b'data1', ('0.0.0.0', 12345)),
+             (b'data2', ('0.0.0.0', 12345))],
+            list(transport._buffer))
+        self.assertIsInstance(transport._buffer[1][0], bytes)
+
+    def test_sendto_buffer_memoryview(self):
+        data2 = memoryview(b'data2')
+        transport = self.datagram_transport()
+        transport._buffer.append((b'data1', ('0.0.0.0', 12345)))
+        transport.sendto(data2, ('0.0.0.0', 12345))
+        self.assertFalse(self.sock.sendto.called)
+        self.assertEqual(
+            [(b'data1', ('0.0.0.0', 12345)),
+             (b'data2', ('0.0.0.0', 12345))],
+            list(transport._buffer))
+        self.assertIsInstance(transport._buffer[1][0], bytes)
+
+    def test_sendto_tryagain(self):
+        data = b'data'
+
+        self.sock.sendto.side_effect = BlockingIOError
+
+        transport = self.datagram_transport()
+        transport.sendto(data, ('0.0.0.0', 12345))
+
+        self.loop.assert_writer(7, transport._sendto_ready)
+        self.assertEqual(
+            [(b'data', ('0.0.0.0', 12345))], list(transport._buffer))
+
+    @mock.patch('asyncio.selector_events.logger')
+    def test_sendto_exception(self, m_log):
+        data = b'data'
+        err = self.sock.sendto.side_effect = RuntimeError()
+
+        transport = self.datagram_transport()
+        transport._fatal_error = mock.Mock()
+        transport.sendto(data, ())
+
+        self.assertTrue(transport._fatal_error.called)
+        transport._fatal_error.assert_called_with(
+                                   err,
+                                   'Fatal write error on datagram transport')
+        transport._conn_lost = 1
+
+        transport._address = ('123',)
+        transport.sendto(data)
+        transport.sendto(data)
+        transport.sendto(data)
+        transport.sendto(data)
+        transport.sendto(data)
+        m_log.warning.assert_called_with('socket.send() raised exception.')
+
+    def test_sendto_error_received(self):
+        data = b'data'
+
+        self.sock.sendto.side_effect = ConnectionRefusedError
+
+        transport = self.datagram_transport()
+        transport._fatal_error = mock.Mock()
+        transport.sendto(data, ())
+
+        self.assertEqual(transport._conn_lost, 0)
+        self.assertFalse(transport._fatal_error.called)
+
+    def test_sendto_error_received_connected(self):
+        data = b'data'
+
+        self.sock.send.side_effect = ConnectionRefusedError
+
+        transport = self.datagram_transport(address=('0.0.0.0', 1))
+        transport._fatal_error = mock.Mock()
+        transport.sendto(data)
+
+        self.assertFalse(transport._fatal_error.called)
+        self.assertTrue(self.protocol.error_received.called)
+
+    def test_sendto_str(self):
+        transport = self.datagram_transport()
+        self.assertRaises(TypeError, transport.sendto, 'str', ())
+
+    def test_sendto_connected_addr(self):
+        transport = self.datagram_transport(address=('0.0.0.0', 1))
+        self.assertRaises(
+            ValueError, transport.sendto, b'str', ('0.0.0.0', 2))
+
+    def test_sendto_closing(self):
+        transport = self.datagram_transport(address=(1,))
+        transport.close()
+        self.assertEqual(transport._conn_lost, 1)
+        transport.sendto(b'data', (1,))
+        self.assertEqual(transport._conn_lost, 2)
+
+    def test_sendto_ready(self):
+        data = b'data'
+        self.sock.sendto.return_value = len(data)
+
+        transport = self.datagram_transport()
+        transport._buffer.append((data, ('0.0.0.0', 12345)))
+        self.loop.add_writer(7, transport._sendto_ready)
+        transport._sendto_ready()
+        self.assertTrue(self.sock.sendto.called)
+        self.assertEqual(
+            self.sock.sendto.call_args[0], (data, ('0.0.0.0', 12345)))
+        self.assertFalse(self.loop.writers)
+
+    def test_sendto_ready_closing(self):
+        data = b'data'
+        self.sock.send.return_value = len(data)
+
+        transport = self.datagram_transport()
+        transport._closing = True
+        transport._buffer.append((data, ()))
+        self.loop.add_writer(7, transport._sendto_ready)
+        transport._sendto_ready()
+        self.sock.sendto.assert_called_with(data, ())
+        self.assertFalse(self.loop.writers)
+        self.sock.close.assert_called_with()
+        self.protocol.connection_lost.assert_called_with(None)
+
+    def test_sendto_ready_no_data(self):
+        transport = self.datagram_transport()
+        self.loop.add_writer(7, transport._sendto_ready)
+        transport._sendto_ready()
+        self.assertFalse(self.sock.sendto.called)
+        self.assertFalse(self.loop.writers)
+
+    def test_sendto_ready_tryagain(self):
+        self.sock.sendto.side_effect = BlockingIOError
+
+        transport = self.datagram_transport()
+        transport._buffer.extend([(b'data1', ()), (b'data2', ())])
+        self.loop.add_writer(7, transport._sendto_ready)
+        transport._sendto_ready()
+
+        self.loop.assert_writer(7, transport._sendto_ready)
+        self.assertEqual(
+            [(b'data1', ()), (b'data2', ())],
+            list(transport._buffer))
+
+    def test_sendto_ready_exception(self):
+        err = self.sock.sendto.side_effect = RuntimeError()
+
+        transport = self.datagram_transport()
+        transport._fatal_error = mock.Mock()
+        transport._buffer.append((b'data', ()))
+        transport._sendto_ready()
+
+        transport._fatal_error.assert_called_with(
+                                   err,
+                                   'Fatal write error on datagram transport')
+
+    def test_sendto_ready_error_received(self):
+        self.sock.sendto.side_effect = ConnectionRefusedError
+
+        transport = self.datagram_transport()
+        transport._fatal_error = mock.Mock()
+        transport._buffer.append((b'data', ()))
+        transport._sendto_ready()
+
+        self.assertFalse(transport._fatal_error.called)
+
+    def test_sendto_ready_error_received_connection(self):
+        self.sock.send.side_effect = ConnectionRefusedError
+
+        transport = self.datagram_transport(address=('0.0.0.0', 1))
+        transport._fatal_error = mock.Mock()
+        transport._buffer.append((b'data', ()))
+        transport._sendto_ready()
+
+        self.assertFalse(transport._fatal_error.called)
+        self.assertTrue(self.protocol.error_received.called)
+
+    @mock.patch('asyncio.base_events.logger.error')
+    def test_fatal_error_connected(self, m_exc):
+        transport = self.datagram_transport(address=('0.0.0.0', 1))
+        err = ConnectionRefusedError()
+        transport._fatal_error(err)
+        self.assertFalse(self.protocol.error_received.called)
+        m_exc.assert_called_with(
+            test_utils.MockPattern(
+                'Fatal error on transport\nprotocol:.*\ntransport:.*'),
+            exc_info=(ConnectionRefusedError, MOCK_ANY, MOCK_ANY))
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Lib/test/test_asyncio/test_sslproto.py b/Lib/test/test_asyncio/test_sslproto.py
new file mode 100644
index 0000000..a72967e
--- /dev/null
+++ b/Lib/test/test_asyncio/test_sslproto.py
@@ -0,0 +1,71 @@
+"""Tests for asyncio/sslproto.py."""
+
+import unittest
+from unittest import mock
+try:
+    import ssl
+except ImportError:
+    ssl = None
+
+import asyncio
+from asyncio import sslproto
+from asyncio import test_utils
+
+
+@unittest.skipIf(ssl is None, 'No ssl module')
+class SslProtoHandshakeTests(test_utils.TestCase):
+
+    def setUp(self):
+        self.loop = asyncio.new_event_loop()
+        self.set_event_loop(self.loop)
+
+    def ssl_protocol(self, waiter=None):
+        sslcontext = test_utils.dummy_ssl_context()
+        app_proto = asyncio.Protocol()
+        proto = sslproto.SSLProtocol(self.loop, app_proto, sslcontext, waiter)
+        self.addCleanup(proto._app_transport.close)
+        return proto
+
+    def connection_made(self, ssl_proto, do_handshake=None):
+        transport = mock.Mock()
+        sslpipe = mock.Mock()
+        sslpipe.shutdown.return_value = b''
+        if do_handshake:
+            sslpipe.do_handshake.side_effect = do_handshake
+        else:
+            def mock_handshake(callback):
+                return []
+            sslpipe.do_handshake.side_effect = mock_handshake
+        with mock.patch('asyncio.sslproto._SSLPipe', return_value=sslpipe):
+            ssl_proto.connection_made(transport)
+
+    def test_cancel_handshake(self):
+        # Python issue #23197: cancelling an handshake must not raise an
+        # exception or log an error, even if the handshake failed
+        waiter = asyncio.Future(loop=self.loop)
+        ssl_proto = self.ssl_protocol(waiter)
+        handshake_fut = asyncio.Future(loop=self.loop)
+
+        def do_handshake(callback):
+            exc = Exception()
+            callback(exc)
+            handshake_fut.set_result(None)
+            return []
+
+        waiter.cancel()
+        self.connection_made(ssl_proto, do_handshake)
+
+        with test_utils.disable_logger():
+            self.loop.run_until_complete(handshake_fut)
+
+    def test_eof_received_waiter(self):
+        waiter = asyncio.Future(loop=self.loop)
+        ssl_proto = self.ssl_protocol(waiter)
+        self.connection_made(ssl_proto)
+        ssl_proto.eof_received()
+        test_utils.run_briefly(self.loop)
+        self.assertIsInstance(waiter.exception(), ConnectionResetError)
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Lib/test/test_asyncio/test_streams.py b/Lib/test/test_asyncio/test_streams.py
new file mode 100644
index 0000000..2273049
--- /dev/null
+++ b/Lib/test/test_asyncio/test_streams.py
@@ -0,0 +1,641 @@
+"""Tests for streams.py."""
+
+import gc
+import os
+import socket
+import sys
+import unittest
+from unittest import mock
+try:
+    import ssl
+except ImportError:
+    ssl = None
+
+import asyncio
+from asyncio import test_utils
+
+
+class StreamReaderTests(test_utils.TestCase):
+
+    DATA = b'line1\nline2\nline3\n'
+
+    def setUp(self):
+        self.loop = asyncio.new_event_loop()
+        self.set_event_loop(self.loop)
+
+    def tearDown(self):
+        # just in case if we have transport close callbacks
+        test_utils.run_briefly(self.loop)
+
+        self.loop.close()
+        gc.collect()
+        super().tearDown()
+
+    @mock.patch('asyncio.streams.events')
+    def test_ctor_global_loop(self, m_events):
+        stream = asyncio.StreamReader()
+        self.assertIs(stream._loop, m_events.get_event_loop.return_value)
+
+    def _basetest_open_connection(self, open_connection_fut):
+        reader, writer = self.loop.run_until_complete(open_connection_fut)
+        writer.write(b'GET / HTTP/1.0\r\n\r\n')
+        f = reader.readline()
+        data = self.loop.run_until_complete(f)
+        self.assertEqual(data, b'HTTP/1.0 200 OK\r\n')
+        f = reader.read()
+        data = self.loop.run_until_complete(f)
+        self.assertTrue(data.endswith(b'\r\n\r\nTest message'))
+        writer.close()
+
+    def test_open_connection(self):
+        with test_utils.run_test_server() as httpd:
+            conn_fut = asyncio.open_connection(*httpd.address,
+                                               loop=self.loop)
+            self._basetest_open_connection(conn_fut)
+
+    @unittest.skipUnless(hasattr(socket, 'AF_UNIX'), 'No UNIX Sockets')
+    def test_open_unix_connection(self):
+        with test_utils.run_test_unix_server() as httpd:
+            conn_fut = asyncio.open_unix_connection(httpd.address,
+                                                    loop=self.loop)
+            self._basetest_open_connection(conn_fut)
+
+    def _basetest_open_connection_no_loop_ssl(self, open_connection_fut):
+        try:
+            reader, writer = self.loop.run_until_complete(open_connection_fut)
+        finally:
+            asyncio.set_event_loop(None)
+        writer.write(b'GET / HTTP/1.0\r\n\r\n')
+        f = reader.read()
+        data = self.loop.run_until_complete(f)
+        self.assertTrue(data.endswith(b'\r\n\r\nTest message'))
+
+        writer.close()
+
+    @unittest.skipIf(ssl is None, 'No ssl module')
+    def test_open_connection_no_loop_ssl(self):
+        with test_utils.run_test_server(use_ssl=True) as httpd:
+            conn_fut = asyncio.open_connection(
+                *httpd.address,
+                ssl=test_utils.dummy_ssl_context(),
+                loop=self.loop)
+
+            self._basetest_open_connection_no_loop_ssl(conn_fut)
+
+    @unittest.skipIf(ssl is None, 'No ssl module')
+    @unittest.skipUnless(hasattr(socket, 'AF_UNIX'), 'No UNIX Sockets')
+    def test_open_unix_connection_no_loop_ssl(self):
+        with test_utils.run_test_unix_server(use_ssl=True) as httpd:
+            conn_fut = asyncio.open_unix_connection(
+                httpd.address,
+                ssl=test_utils.dummy_ssl_context(),
+                server_hostname='',
+                loop=self.loop)
+
+            self._basetest_open_connection_no_loop_ssl(conn_fut)
+
+    def _basetest_open_connection_error(self, open_connection_fut):
+        reader, writer = self.loop.run_until_complete(open_connection_fut)
+        writer._protocol.connection_lost(ZeroDivisionError())
+        f = reader.read()
+        with self.assertRaises(ZeroDivisionError):
+            self.loop.run_until_complete(f)
+        writer.close()
+        test_utils.run_briefly(self.loop)
+
+    def test_open_connection_error(self):
+        with test_utils.run_test_server() as httpd:
+            conn_fut = asyncio.open_connection(*httpd.address,
+                                               loop=self.loop)
+            self._basetest_open_connection_error(conn_fut)
+
+    @unittest.skipUnless(hasattr(socket, 'AF_UNIX'), 'No UNIX Sockets')
+    def test_open_unix_connection_error(self):
+        with test_utils.run_test_unix_server() as httpd:
+            conn_fut = asyncio.open_unix_connection(httpd.address,
+                                                    loop=self.loop)
+            self._basetest_open_connection_error(conn_fut)
+
+    def test_feed_empty_data(self):
+        stream = asyncio.StreamReader(loop=self.loop)
+
+        stream.feed_data(b'')
+        self.assertEqual(b'', stream._buffer)
+
+    def test_feed_nonempty_data(self):
+        stream = asyncio.StreamReader(loop=self.loop)
+
+        stream.feed_data(self.DATA)
+        self.assertEqual(self.DATA, stream._buffer)
+
+    def test_read_zero(self):
+        # Read zero bytes.
+        stream = asyncio.StreamReader(loop=self.loop)
+        stream.feed_data(self.DATA)
+
+        data = self.loop.run_until_complete(stream.read(0))
+        self.assertEqual(b'', data)
+        self.assertEqual(self.DATA, stream._buffer)
+
+    def test_read(self):
+        # Read bytes.
+        stream = asyncio.StreamReader(loop=self.loop)
+        read_task = asyncio.Task(stream.read(30), loop=self.loop)
+
+        def cb():
+            stream.feed_data(self.DATA)
+        self.loop.call_soon(cb)
+
+        data = self.loop.run_until_complete(read_task)
+        self.assertEqual(self.DATA, data)
+        self.assertEqual(b'', stream._buffer)
+
+    def test_read_line_breaks(self):
+        # Read bytes without line breaks.
+        stream = asyncio.StreamReader(loop=self.loop)
+        stream.feed_data(b'line1')
+        stream.feed_data(b'line2')
+
+        data = self.loop.run_until_complete(stream.read(5))
+
+        self.assertEqual(b'line1', data)
+        self.assertEqual(b'line2', stream._buffer)
+
+    def test_read_eof(self):
+        # Read bytes, stop at eof.
+        stream = asyncio.StreamReader(loop=self.loop)
+        read_task = asyncio.Task(stream.read(1024), loop=self.loop)
+
+        def cb():
+            stream.feed_eof()
+        self.loop.call_soon(cb)
+
+        data = self.loop.run_until_complete(read_task)
+        self.assertEqual(b'', data)
+        self.assertEqual(b'', stream._buffer)
+
+    def test_read_until_eof(self):
+        # Read all bytes until eof.
+        stream = asyncio.StreamReader(loop=self.loop)
+        read_task = asyncio.Task(stream.read(-1), loop=self.loop)
+
+        def cb():
+            stream.feed_data(b'chunk1\n')
+            stream.feed_data(b'chunk2')
+            stream.feed_eof()
+        self.loop.call_soon(cb)
+
+        data = self.loop.run_until_complete(read_task)
+
+        self.assertEqual(b'chunk1\nchunk2', data)
+        self.assertEqual(b'', stream._buffer)
+
+    def test_read_exception(self):
+        stream = asyncio.StreamReader(loop=self.loop)
+        stream.feed_data(b'line\n')
+
+        data = self.loop.run_until_complete(stream.read(2))
+        self.assertEqual(b'li', data)
+
+        stream.set_exception(ValueError())
+        self.assertRaises(
+            ValueError, self.loop.run_until_complete, stream.read(2))
+
+    def test_readline(self):
+        # Read one line. 'readline' will need to wait for the data
+        # to come from 'cb'
+        stream = asyncio.StreamReader(loop=self.loop)
+        stream.feed_data(b'chunk1 ')
+        read_task = asyncio.Task(stream.readline(), loop=self.loop)
+
+        def cb():
+            stream.feed_data(b'chunk2 ')
+            stream.feed_data(b'chunk3 ')
+            stream.feed_data(b'\n chunk4')
+        self.loop.call_soon(cb)
+
+        line = self.loop.run_until_complete(read_task)
+        self.assertEqual(b'chunk1 chunk2 chunk3 \n', line)
+        self.assertEqual(b' chunk4', stream._buffer)
+
+    def test_readline_limit_with_existing_data(self):
+        # Read one line. The data is in StreamReader's buffer
+        # before the event loop is run.
+
+        stream = asyncio.StreamReader(limit=3, loop=self.loop)
+        stream.feed_data(b'li')
+        stream.feed_data(b'ne1\nline2\n')
+
+        self.assertRaises(
+            ValueError, self.loop.run_until_complete, stream.readline())
+        # The buffer should contain the remaining data after exception
+        self.assertEqual(b'line2\n', stream._buffer)
+
+        stream = asyncio.StreamReader(limit=3, loop=self.loop)
+        stream.feed_data(b'li')
+        stream.feed_data(b'ne1')
+        stream.feed_data(b'li')
+
+        self.assertRaises(
+            ValueError, self.loop.run_until_complete, stream.readline())
+        # No b'\n' at the end. The 'limit' is set to 3. So before
+        # waiting for the new data in buffer, 'readline' will consume
+        # the entire buffer, and since the length of the consumed data
+        # is more than 3, it will raise a ValueError. The buffer is
+        # expected to be empty now.
+        self.assertEqual(b'', stream._buffer)
+
+    def test_at_eof(self):
+        stream = asyncio.StreamReader(loop=self.loop)
+        self.assertFalse(stream.at_eof())
+
+        stream.feed_data(b'some data\n')
+        self.assertFalse(stream.at_eof())
+
+        self.loop.run_until_complete(stream.readline())
+        self.assertFalse(stream.at_eof())
+
+        stream.feed_data(b'some data\n')
+        stream.feed_eof()
+        self.loop.run_until_complete(stream.readline())
+        self.assertTrue(stream.at_eof())
+
+    def test_readline_limit(self):
+        # Read one line. StreamReaders are fed with data after
+        # their 'readline' methods are called.
+
+        stream = asyncio.StreamReader(limit=7, loop=self.loop)
+        def cb():
+            stream.feed_data(b'chunk1')
+            stream.feed_data(b'chunk2')
+            stream.feed_data(b'chunk3\n')
+            stream.feed_eof()
+        self.loop.call_soon(cb)
+
+        self.assertRaises(
+            ValueError, self.loop.run_until_complete, stream.readline())
+        # The buffer had just one line of data, and after raising
+        # a ValueError it should be empty.
+        self.assertEqual(b'', stream._buffer)
+
+        stream = asyncio.StreamReader(limit=7, loop=self.loop)
+        def cb():
+            stream.feed_data(b'chunk1')
+            stream.feed_data(b'chunk2\n')
+            stream.feed_data(b'chunk3\n')
+            stream.feed_eof()
+        self.loop.call_soon(cb)
+
+        self.assertRaises(
+            ValueError, self.loop.run_until_complete, stream.readline())
+        self.assertEqual(b'chunk3\n', stream._buffer)
+
+    def test_readline_nolimit_nowait(self):
+        # All needed data for the first 'readline' call will be
+        # in the buffer.
+        stream = asyncio.StreamReader(loop=self.loop)
+        stream.feed_data(self.DATA[:6])
+        stream.feed_data(self.DATA[6:])
+
+        line = self.loop.run_until_complete(stream.readline())
+
+        self.assertEqual(b'line1\n', line)
+        self.assertEqual(b'line2\nline3\n', stream._buffer)
+
+    def test_readline_eof(self):
+        stream = asyncio.StreamReader(loop=self.loop)
+        stream.feed_data(b'some data')
+        stream.feed_eof()
+
+        line = self.loop.run_until_complete(stream.readline())
+        self.assertEqual(b'some data', line)
+
+    def test_readline_empty_eof(self):
+        stream = asyncio.StreamReader(loop=self.loop)
+        stream.feed_eof()
+
+        line = self.loop.run_until_complete(stream.readline())
+        self.assertEqual(b'', line)
+
+    def test_readline_read_byte_count(self):
+        stream = asyncio.StreamReader(loop=self.loop)
+        stream.feed_data(self.DATA)
+
+        self.loop.run_until_complete(stream.readline())
+
+        data = self.loop.run_until_complete(stream.read(7))
+
+        self.assertEqual(b'line2\nl', data)
+        self.assertEqual(b'ine3\n', stream._buffer)
+
+    def test_readline_exception(self):
+        stream = asyncio.StreamReader(loop=self.loop)
+        stream.feed_data(b'line\n')
+
+        data = self.loop.run_until_complete(stream.readline())
+        self.assertEqual(b'line\n', data)
+
+        stream.set_exception(ValueError())
+        self.assertRaises(
+            ValueError, self.loop.run_until_complete, stream.readline())
+        self.assertEqual(b'', stream._buffer)
+
+    def test_readexactly_zero_or_less(self):
+        # Read exact number of bytes (zero or less).
+        stream = asyncio.StreamReader(loop=self.loop)
+        stream.feed_data(self.DATA)
+
+        data = self.loop.run_until_complete(stream.readexactly(0))
+        self.assertEqual(b'', data)
+        self.assertEqual(self.DATA, stream._buffer)
+
+        data = self.loop.run_until_complete(stream.readexactly(-1))
+        self.assertEqual(b'', data)
+        self.assertEqual(self.DATA, stream._buffer)
+
+    def test_readexactly(self):
+        # Read exact number of bytes.
+        stream = asyncio.StreamReader(loop=self.loop)
+
+        n = 2 * len(self.DATA)
+        read_task = asyncio.Task(stream.readexactly(n), loop=self.loop)
+
+        def cb():
+            stream.feed_data(self.DATA)
+            stream.feed_data(self.DATA)
+            stream.feed_data(self.DATA)
+        self.loop.call_soon(cb)
+
+        data = self.loop.run_until_complete(read_task)
+        self.assertEqual(self.DATA + self.DATA, data)
+        self.assertEqual(self.DATA, stream._buffer)
+
+    def test_readexactly_eof(self):
+        # Read exact number of bytes (eof).
+        stream = asyncio.StreamReader(loop=self.loop)
+        n = 2 * len(self.DATA)
+        read_task = asyncio.Task(stream.readexactly(n), loop=self.loop)
+
+        def cb():
+            stream.feed_data(self.DATA)
+            stream.feed_eof()
+        self.loop.call_soon(cb)
+
+        with self.assertRaises(asyncio.IncompleteReadError) as cm:
+            self.loop.run_until_complete(read_task)
+        self.assertEqual(cm.exception.partial, self.DATA)
+        self.assertEqual(cm.exception.expected, n)
+        self.assertEqual(str(cm.exception),
+                         '18 bytes read on a total of 36 expected bytes')
+        self.assertEqual(b'', stream._buffer)
+
+    def test_readexactly_exception(self):
+        stream = asyncio.StreamReader(loop=self.loop)
+        stream.feed_data(b'line\n')
+
+        data = self.loop.run_until_complete(stream.readexactly(2))
+        self.assertEqual(b'li', data)
+
+        stream.set_exception(ValueError())
+        self.assertRaises(
+            ValueError, self.loop.run_until_complete, stream.readexactly(2))
+
+    def test_exception(self):
+        stream = asyncio.StreamReader(loop=self.loop)
+        self.assertIsNone(stream.exception())
+
+        exc = ValueError()
+        stream.set_exception(exc)
+        self.assertIs(stream.exception(), exc)
+
+    def test_exception_waiter(self):
+        stream = asyncio.StreamReader(loop=self.loop)
+
+        @asyncio.coroutine
+        def set_err():
+            stream.set_exception(ValueError())
+
+        t1 = asyncio.Task(stream.readline(), loop=self.loop)
+        t2 = asyncio.Task(set_err(), loop=self.loop)
+
+        self.loop.run_until_complete(asyncio.wait([t1, t2], loop=self.loop))
+
+        self.assertRaises(ValueError, t1.result)
+
+    def test_exception_cancel(self):
+        stream = asyncio.StreamReader(loop=self.loop)
+
+        t = asyncio.Task(stream.readline(), loop=self.loop)
+        test_utils.run_briefly(self.loop)
+        t.cancel()
+        test_utils.run_briefly(self.loop)
+        # The following line fails if set_exception() isn't careful.
+        stream.set_exception(RuntimeError('message'))
+        test_utils.run_briefly(self.loop)
+        self.assertIs(stream._waiter, None)
+
+    def test_start_server(self):
+
+        class MyServer:
+
+            def __init__(self, loop):
+                self.server = None
+                self.loop = loop
+
+            @asyncio.coroutine
+            def handle_client(self, client_reader, client_writer):
+                data = yield from client_reader.readline()
+                client_writer.write(data)
+
+            def start(self):
+                sock = socket.socket()
+                sock.bind(('127.0.0.1', 0))
+                self.server = self.loop.run_until_complete(
+                    asyncio.start_server(self.handle_client,
+                                         sock=sock,
+                                         loop=self.loop))
+                return sock.getsockname()
+
+            def handle_client_callback(self, client_reader, client_writer):
+                task = asyncio.Task(client_reader.readline(), loop=self.loop)
+
+                def done(task):
+                    client_writer.write(task.result())
+
+                task.add_done_callback(done)
+
+            def start_callback(self):
+                sock = socket.socket()
+                sock.bind(('127.0.0.1', 0))
+                addr = sock.getsockname()
+                sock.close()
+                self.server = self.loop.run_until_complete(
+                    asyncio.start_server(self.handle_client_callback,
+                                         host=addr[0], port=addr[1],
+                                         loop=self.loop))
+                return addr
+
+            def stop(self):
+                if self.server is not None:
+                    self.server.close()
+                    self.loop.run_until_complete(self.server.wait_closed())
+                    self.server = None
+
+        @asyncio.coroutine
+        def client(addr):
+            reader, writer = yield from asyncio.open_connection(
+                *addr, loop=self.loop)
+            # send a line
+            writer.write(b"hello world!\n")
+            # read it back
+            msgback = yield from reader.readline()
+            writer.close()
+            return msgback
+
+        # test the server variant with a coroutine as client handler
+        server = MyServer(self.loop)
+        addr = server.start()
+        msg = self.loop.run_until_complete(asyncio.Task(client(addr),
+                                                        loop=self.loop))
+        server.stop()
+        self.assertEqual(msg, b"hello world!\n")
+
+        # test the server variant with a callback as client handler
+        server = MyServer(self.loop)
+        addr = server.start_callback()
+        msg = self.loop.run_until_complete(asyncio.Task(client(addr),
+                                                        loop=self.loop))
+        server.stop()
+        self.assertEqual(msg, b"hello world!\n")
+
+    @unittest.skipUnless(hasattr(socket, 'AF_UNIX'), 'No UNIX Sockets')
+    def test_start_unix_server(self):
+
+        class MyServer:
+
+            def __init__(self, loop, path):
+                self.server = None
+                self.loop = loop
+                self.path = path
+
+            @asyncio.coroutine
+            def handle_client(self, client_reader, client_writer):
+                data = yield from client_reader.readline()
+                client_writer.write(data)
+
+            def start(self):
+                self.server = self.loop.run_until_complete(
+                    asyncio.start_unix_server(self.handle_client,
+                                              path=self.path,
+                                              loop=self.loop))
+
+            def handle_client_callback(self, client_reader, client_writer):
+                task = asyncio.Task(client_reader.readline(), loop=self.loop)
+
+                def done(task):
+                    client_writer.write(task.result())
+
+                task.add_done_callback(done)
+
+            def start_callback(self):
+                self.server = self.loop.run_until_complete(
+                    asyncio.start_unix_server(self.handle_client_callback,
+                                              path=self.path,
+                                              loop=self.loop))
+
+            def stop(self):
+                if self.server is not None:
+                    self.server.close()
+                    self.loop.run_until_complete(self.server.wait_closed())
+                    self.server = None
+
+        @asyncio.coroutine
+        def client(path):
+            reader, writer = yield from asyncio.open_unix_connection(
+                path, loop=self.loop)
+            # send a line
+            writer.write(b"hello world!\n")
+            # read it back
+            msgback = yield from reader.readline()
+            writer.close()
+            return msgback
+
+        # test the server variant with a coroutine as client handler
+        with test_utils.unix_socket_path() as path:
+            server = MyServer(self.loop, path)
+            server.start()
+            msg = self.loop.run_until_complete(asyncio.Task(client(path),
+                                                            loop=self.loop))
+            server.stop()
+            self.assertEqual(msg, b"hello world!\n")
+
+        # test the server variant with a callback as client handler
+        with test_utils.unix_socket_path() as path:
+            server = MyServer(self.loop, path)
+            server.start_callback()
+            msg = self.loop.run_until_complete(asyncio.Task(client(path),
+                                                            loop=self.loop))
+            server.stop()
+            self.assertEqual(msg, b"hello world!\n")
+
+    @unittest.skipIf(sys.platform == 'win32', "Don't have pipes")
+    def test_read_all_from_pipe_reader(self):
+        # See Tulip issue 168.  This test is derived from the example
+        # subprocess_attach_read_pipe.py, but we configure the
+        # StreamReader's limit so that twice it is less than the size
+        # of the data writter.  Also we must explicitly attach a child
+        # watcher to the event loop.
+
+        code = """\
+import os, sys
+fd = int(sys.argv[1])
+os.write(fd, b'data')
+os.close(fd)
+"""
+        rfd, wfd = os.pipe()
+        args = [sys.executable, '-c', code, str(wfd)]
+
+        pipe = open(rfd, 'rb', 0)
+        reader = asyncio.StreamReader(loop=self.loop, limit=1)
+        protocol = asyncio.StreamReaderProtocol(reader, loop=self.loop)
+        transport, _ = self.loop.run_until_complete(
+            self.loop.connect_read_pipe(lambda: protocol, pipe))
+
+        watcher = asyncio.SafeChildWatcher()
+        watcher.attach_loop(self.loop)
+        try:
+            asyncio.set_child_watcher(watcher)
+            create = asyncio.create_subprocess_exec(*args,
+                                                    pass_fds={wfd},
+                                                    loop=self.loop)
+            proc = self.loop.run_until_complete(create)
+            self.loop.run_until_complete(proc.wait())
+        finally:
+            asyncio.set_child_watcher(None)
+
+        os.close(wfd)
+        data = self.loop.run_until_complete(reader.read(-1))
+        self.assertEqual(data, b'data')
+
+    def test_streamreader_constructor(self):
+        self.addCleanup(asyncio.set_event_loop, None)
+        asyncio.set_event_loop(self.loop)
+
+        # Tulip issue #184: Ensure that StreamReaderProtocol constructor
+        # retrieves the current loop if the loop parameter is not set
+        reader = asyncio.StreamReader()
+        self.assertIs(reader._loop, self.loop)
+
+    def test_streamreaderprotocol_constructor(self):
+        self.addCleanup(asyncio.set_event_loop, None)
+        asyncio.set_event_loop(self.loop)
+
+        # Tulip issue #184: Ensure that StreamReaderProtocol constructor
+        # retrieves the current loop if the loop parameter is not set
+        reader = mock.Mock()
+        protocol = asyncio.StreamReaderProtocol(reader)
+        self.assertIs(protocol._loop, self.loop)
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Lib/test/test_asyncio/test_subprocess.py b/Lib/test/test_asyncio/test_subprocess.py
new file mode 100644
index 0000000..b467b04
--- /dev/null
+++ b/Lib/test/test_asyncio/test_subprocess.py
@@ -0,0 +1,389 @@
+import signal
+import sys
+import unittest
+from unittest import mock
+
+import asyncio
+from asyncio import base_subprocess
+from asyncio import subprocess
+from asyncio import test_utils
+try:
+    from test import support
+except ImportError:
+    from asyncio import test_support as support
+if sys.platform != 'win32':
+    from asyncio import unix_events
+
+# Program blocking
+PROGRAM_BLOCKED = [sys.executable, '-c', 'import time; time.sleep(3600)']
+
+# Program copying input to output
+PROGRAM_CAT = [
+    sys.executable, '-c',
+    ';'.join(('import sys',
+              'data = sys.stdin.buffer.read()',
+              'sys.stdout.buffer.write(data)'))]
+
+class TestSubprocessTransport(base_subprocess.BaseSubprocessTransport):
+    def _start(self, *args, **kwargs):
+        self._proc = mock.Mock()
+        self._proc.stdin = None
+        self._proc.stdout = None
+        self._proc.stderr = None
+
+
+class SubprocessTransportTests(test_utils.TestCase):
+    def setUp(self):
+        self.loop = self.new_test_loop()
+        self.set_event_loop(self.loop)
+
+
+    def create_transport(self, waiter=None):
+        protocol = mock.Mock()
+        protocol.connection_made._is_coroutine = False
+        protocol.process_exited._is_coroutine = False
+        transport = TestSubprocessTransport(
+                        self.loop, protocol, ['test'], False,
+                        None, None, None, 0, waiter=waiter)
+        return (transport, protocol)
+
+    def test_proc_exited(self):
+        waiter = asyncio.Future(loop=self.loop)
+        transport, protocol = self.create_transport(waiter)
+        transport._process_exited(6)
+        self.loop.run_until_complete(waiter)
+
+        self.assertEqual(transport.get_returncode(), 6)
+
+        self.assertTrue(protocol.connection_made.called)
+        self.assertTrue(protocol.process_exited.called)
+        self.assertTrue(protocol.connection_lost.called)
+        self.assertEqual(protocol.connection_lost.call_args[0], (None,))
+
+        self.assertFalse(transport._closed)
+        self.assertIsNone(transport._loop)
+        self.assertIsNone(transport._proc)
+        self.assertIsNone(transport._protocol)
+
+        # methods must raise ProcessLookupError if the process exited
+        self.assertRaises(ProcessLookupError,
+                          transport.send_signal, signal.SIGTERM)
+        self.assertRaises(ProcessLookupError, transport.terminate)
+        self.assertRaises(ProcessLookupError, transport.kill)
+
+        transport.close()
+
+
+class SubprocessMixin:
+
+    def test_stdin_stdout(self):
+        args = PROGRAM_CAT
+
+        @asyncio.coroutine
+        def run(data):
+            proc = yield from asyncio.create_subprocess_exec(
+                                          *args,
+                                          stdin=subprocess.PIPE,
+                                          stdout=subprocess.PIPE,
+                                          loop=self.loop)
+
+            # feed data
+            proc.stdin.write(data)
+            yield from proc.stdin.drain()
+            proc.stdin.close()
+
+            # get output and exitcode
+            data = yield from proc.stdout.read()
+            exitcode = yield from proc.wait()
+            return (exitcode, data)
+
+        task = run(b'some data')
+        task = asyncio.wait_for(task, 60.0, loop=self.loop)
+        exitcode, stdout = self.loop.run_until_complete(task)
+        self.assertEqual(exitcode, 0)
+        self.assertEqual(stdout, b'some data')
+
+    def test_communicate(self):
+        args = PROGRAM_CAT
+
+        @asyncio.coroutine
+        def run(data):
+            proc = yield from asyncio.create_subprocess_exec(
+                                          *args,
+                                          stdin=subprocess.PIPE,
+                                          stdout=subprocess.PIPE,
+                                          loop=self.loop)
+            stdout, stderr = yield from proc.communicate(data)
+            return proc.returncode, stdout
+
+        task = run(b'some data')
+        task = asyncio.wait_for(task, 60.0, loop=self.loop)
+        exitcode, stdout = self.loop.run_until_complete(task)
+        self.assertEqual(exitcode, 0)
+        self.assertEqual(stdout, b'some data')
+
+    def test_shell(self):
+        create = asyncio.create_subprocess_shell('exit 7',
+                                                 loop=self.loop)
+        proc = self.loop.run_until_complete(create)
+        exitcode = self.loop.run_until_complete(proc.wait())
+        self.assertEqual(exitcode, 7)
+
+    def test_start_new_session(self):
+        # start the new process in a new session
+        create = asyncio.create_subprocess_shell('exit 8',
+                                                 start_new_session=True,
+                                                 loop=self.loop)
+        proc = self.loop.run_until_complete(create)
+        exitcode = self.loop.run_until_complete(proc.wait())
+        self.assertEqual(exitcode, 8)
+
+    def test_kill(self):
+        args = PROGRAM_BLOCKED
+        create = asyncio.create_subprocess_exec(*args, loop=self.loop)
+        proc = self.loop.run_until_complete(create)
+        proc.kill()
+        returncode = self.loop.run_until_complete(proc.wait())
+        if sys.platform == 'win32':
+            self.assertIsInstance(returncode, int)
+            # expect 1 but sometimes get 0
+        else:
+            self.assertEqual(-signal.SIGKILL, returncode)
+
+    def test_terminate(self):
+        args = PROGRAM_BLOCKED
+        create = asyncio.create_subprocess_exec(*args, loop=self.loop)
+        proc = self.loop.run_until_complete(create)
+        proc.terminate()
+        returncode = self.loop.run_until_complete(proc.wait())
+        if sys.platform == 'win32':
+            self.assertIsInstance(returncode, int)
+            # expect 1 but sometimes get 0
+        else:
+            self.assertEqual(-signal.SIGTERM, returncode)
+
+    @unittest.skipIf(sys.platform == 'win32', "Don't have SIGHUP")
+    def test_send_signal(self):
+        code = 'import time; print("sleeping", flush=True); time.sleep(3600)'
+        args = [sys.executable, '-c', code]
+        create = asyncio.create_subprocess_exec(*args,
+                                                stdout=subprocess.PIPE,
+                                                loop=self.loop)
+        proc = self.loop.run_until_complete(create)
+
+        @asyncio.coroutine
+        def send_signal(proc):
+            # basic synchronization to wait until the program is sleeping
+            line = yield from proc.stdout.readline()
+            self.assertEqual(line, b'sleeping\n')
+
+            proc.send_signal(signal.SIGHUP)
+            returncode = (yield from proc.wait())
+            return returncode
+
+        returncode = self.loop.run_until_complete(send_signal(proc))
+        self.assertEqual(-signal.SIGHUP, returncode)
+
+    def prepare_broken_pipe_test(self):
+        # buffer large enough to feed the whole pipe buffer
+        large_data = b'x' * support.PIPE_MAX_SIZE
+
+        # the program ends before the stdin can be feeded
+        create = asyncio.create_subprocess_exec(
+                             sys.executable, '-c', 'pass',
+                             stdin=subprocess.PIPE,
+                             loop=self.loop)
+        proc = self.loop.run_until_complete(create)
+        return (proc, large_data)
+
+    def test_stdin_broken_pipe(self):
+        proc, large_data = self.prepare_broken_pipe_test()
+
+        @asyncio.coroutine
+        def write_stdin(proc, data):
+            proc.stdin.write(data)
+            yield from proc.stdin.drain()
+
+        coro = write_stdin(proc, large_data)
+        # drain() must raise BrokenPipeError or ConnectionResetError
+        with test_utils.disable_logger():
+            self.assertRaises((BrokenPipeError, ConnectionResetError),
+                              self.loop.run_until_complete, coro)
+        self.loop.run_until_complete(proc.wait())
+
+    def test_communicate_ignore_broken_pipe(self):
+        proc, large_data = self.prepare_broken_pipe_test()
+
+        # communicate() must ignore BrokenPipeError when feeding stdin
+        with test_utils.disable_logger():
+            self.loop.run_until_complete(proc.communicate(large_data))
+        self.loop.run_until_complete(proc.wait())
+
+    def test_pause_reading(self):
+        limit = 10
+        size = (limit * 2 + 1)
+
+        @asyncio.coroutine
+        def test_pause_reading():
+            code = '\n'.join((
+                'import sys',
+                'sys.stdout.write("x" * %s)' % size,
+                'sys.stdout.flush()',
+            ))
+
+            connect_read_pipe = self.loop.connect_read_pipe
+
+            @asyncio.coroutine
+            def connect_read_pipe_mock(*args, **kw):
+                transport, protocol = yield from connect_read_pipe(*args, **kw)
+                transport.pause_reading = mock.Mock()
+                transport.resume_reading = mock.Mock()
+                return (transport, protocol)
+
+            self.loop.connect_read_pipe = connect_read_pipe_mock
+
+            proc = yield from asyncio.create_subprocess_exec(
+                                         sys.executable, '-c', code,
+                                         stdin=asyncio.subprocess.PIPE,
+                                         stdout=asyncio.subprocess.PIPE,
+                                         limit=limit,
+                                         loop=self.loop)
+            stdout_transport = proc._transport.get_pipe_transport(1)
+
+            stdout, stderr = yield from proc.communicate()
+
+            # The child process produced more than limit bytes of output,
+            # the stream reader transport should pause the protocol to not
+            # allocate too much memory.
+            return (stdout, stdout_transport)
+
+        # Issue #22685: Ensure that the stream reader pauses the protocol
+        # when the child process produces too much data
+        stdout, transport = self.loop.run_until_complete(test_pause_reading())
+
+        self.assertEqual(stdout, b'x' * size)
+        self.assertTrue(transport.pause_reading.called)
+        self.assertTrue(transport.resume_reading.called)
+
+    def test_stdin_not_inheritable(self):
+        # Tulip issue #209: stdin must not be inheritable, otherwise
+        # the Process.communicate() hangs
+        @asyncio.coroutine
+        def len_message(message):
+            code = 'import sys; data = sys.stdin.read(); print(len(data))'
+            proc = yield from asyncio.create_subprocess_exec(
+                                          sys.executable, '-c', code,
+                                          stdin=asyncio.subprocess.PIPE,
+                                          stdout=asyncio.subprocess.PIPE,
+                                          stderr=asyncio.subprocess.PIPE,
+                                          close_fds=False,
+                                          loop=self.loop)
+            stdout, stderr = yield from proc.communicate(message)
+            exitcode = yield from proc.wait()
+            return (stdout, exitcode)
+
+        output, exitcode = self.loop.run_until_complete(len_message(b'abc'))
+        self.assertEqual(output.rstrip(), b'3')
+        self.assertEqual(exitcode, 0)
+
+    def test_cancel_process_wait(self):
+        # Issue #23140: cancel Process.wait()
+
+        @asyncio.coroutine
+        def cancel_wait():
+            proc = yield from asyncio.create_subprocess_exec(
+                                          *PROGRAM_BLOCKED,
+                                          loop=self.loop)
+
+            # Create an internal future waiting on the process exit
+            task = self.loop.create_task(proc.wait())
+            self.loop.call_soon(task.cancel)
+            try:
+                yield from task
+            except asyncio.CancelledError:
+                pass
+
+            # Cancel the future
+            task.cancel()
+
+            # Kill the process and wait until it is done
+            proc.kill()
+            yield from proc.wait()
+
+        self.loop.run_until_complete(cancel_wait())
+
+    def test_cancel_make_subprocess_transport_exec(self):
+        @asyncio.coroutine
+        def cancel_make_transport():
+            coro = asyncio.create_subprocess_exec(*PROGRAM_BLOCKED,
+                                                  loop=self.loop)
+            task = self.loop.create_task(coro)
+
+            self.loop.call_soon(task.cancel)
+            try:
+                yield from task
+            except asyncio.CancelledError:
+                pass
+
+        # ignore the log:
+        # "Exception during subprocess creation, kill the subprocess"
+        with test_utils.disable_logger():
+            self.loop.run_until_complete(cancel_make_transport())
+
+    def test_cancel_post_init(self):
+        @asyncio.coroutine
+        def cancel_make_transport():
+            coro = self.loop.subprocess_exec(asyncio.SubprocessProtocol,
+                                             *PROGRAM_BLOCKED)
+            task = self.loop.create_task(coro)
+
+            self.loop.call_soon(task.cancel)
+            try:
+                yield from task
+            except asyncio.CancelledError:
+                pass
+
+        # ignore the log:
+        # "Exception during subprocess creation, kill the subprocess"
+        with test_utils.disable_logger():
+            self.loop.run_until_complete(cancel_make_transport())
+            test_utils.run_briefly(self.loop)
+
+
+if sys.platform != 'win32':
+    # Unix
+    class SubprocessWatcherMixin(SubprocessMixin):
+
+        Watcher = None
+
+        def setUp(self):
+            policy = asyncio.get_event_loop_policy()
+            self.loop = policy.new_event_loop()
+            self.set_event_loop(self.loop)
+
+            watcher = self.Watcher()
+            watcher.attach_loop(self.loop)
+            policy.set_child_watcher(watcher)
+            self.addCleanup(policy.set_child_watcher, None)
+
+    class SubprocessSafeWatcherTests(SubprocessWatcherMixin,
+                                     test_utils.TestCase):
+
+        Watcher = unix_events.SafeChildWatcher
+
+    class SubprocessFastWatcherTests(SubprocessWatcherMixin,
+                                     test_utils.TestCase):
+
+        Watcher = unix_events.FastChildWatcher
+
+else:
+    # Windows
+    class SubprocessProactorTests(SubprocessMixin, test_utils.TestCase):
+
+        def setUp(self):
+            self.loop = asyncio.ProactorEventLoop()
+            self.set_event_loop(self.loop)
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Lib/test/test_asyncio/test_tasks.py b/Lib/test/test_asyncio/test_tasks.py
new file mode 100644
index 0000000..06447d7
--- /dev/null
+++ b/Lib/test/test_asyncio/test_tasks.py
@@ -0,0 +1,2019 @@
+"""Tests for tasks.py."""
+
+import os
+import re
+import sys
+import types
+import unittest
+import weakref
+from unittest import mock
+
+import asyncio
+from asyncio import coroutines
+from asyncio import test_utils
+try:
+    from test import support
+    from test.script_helper import assert_python_ok
+except ImportError:
+    from asyncio import test_support as support
+    from asyncio.test_support import assert_python_ok
+
+
+PY34 = (sys.version_info >= (3, 4))
+PY35 = (sys.version_info >= (3, 5))
+
+
+@asyncio.coroutine
+def coroutine_function():
+    pass
+
+
+def format_coroutine(qualname, state, src, source_traceback, generator=False):
+    if generator:
+        state = '%s' % state
+    else:
+        state = '%s, defined' % state
+    if source_traceback is not None:
+        frame = source_traceback[-1]
+        return ('coro=<%s() %s at %s> created at %s:%s'
+                % (qualname, state, src, frame[0], frame[1]))
+    else:
+        return 'coro=<%s() %s at %s>' % (qualname, state, src)
+
+
+class Dummy:
+
+    def __repr__(self):
+        return '<Dummy>'
+
+    def __call__(self, *args):
+        pass
+
+
+class TaskTests(test_utils.TestCase):
+
+    def setUp(self):
+        self.loop = self.new_test_loop()
+
+    def test_task_class(self):
+        @asyncio.coroutine
+        def notmuch():
+            return 'ok'
+        t = asyncio.Task(notmuch(), loop=self.loop)
+        self.loop.run_until_complete(t)
+        self.assertTrue(t.done())
+        self.assertEqual(t.result(), 'ok')
+        self.assertIs(t._loop, self.loop)
+
+        loop = asyncio.new_event_loop()
+        self.set_event_loop(loop)
+        t = asyncio.Task(notmuch(), loop=loop)
+        self.assertIs(t._loop, loop)
+        loop.run_until_complete(t)
+        loop.close()
+
+    def test_async_coroutine(self):
+        @asyncio.coroutine
+        def notmuch():
+            return 'ok'
+        t = asyncio.async(notmuch(), loop=self.loop)
+        self.loop.run_until_complete(t)
+        self.assertTrue(t.done())
+        self.assertEqual(t.result(), 'ok')
+        self.assertIs(t._loop, self.loop)
+
+        loop = asyncio.new_event_loop()
+        self.set_event_loop(loop)
+        t = asyncio.async(notmuch(), loop=loop)
+        self.assertIs(t._loop, loop)
+        loop.run_until_complete(t)
+        loop.close()
+
+    def test_async_future(self):
+        f_orig = asyncio.Future(loop=self.loop)
+        f_orig.set_result('ko')
+
+        f = asyncio.async(f_orig)
+        self.loop.run_until_complete(f)
+        self.assertTrue(f.done())
+        self.assertEqual(f.result(), 'ko')
+        self.assertIs(f, f_orig)
+
+        loop = asyncio.new_event_loop()
+        self.set_event_loop(loop)
+
+        with self.assertRaises(ValueError):
+            f = asyncio.async(f_orig, loop=loop)
+
+        loop.close()
+
+        f = asyncio.async(f_orig, loop=self.loop)
+        self.assertIs(f, f_orig)
+
+    def test_async_task(self):
+        @asyncio.coroutine
+        def notmuch():
+            return 'ok'
+        t_orig = asyncio.Task(notmuch(), loop=self.loop)
+        t = asyncio.async(t_orig)
+        self.loop.run_until_complete(t)
+        self.assertTrue(t.done())
+        self.assertEqual(t.result(), 'ok')
+        self.assertIs(t, t_orig)
+
+        loop = asyncio.new_event_loop()
+        self.set_event_loop(loop)
+
+        with self.assertRaises(ValueError):
+            t = asyncio.async(t_orig, loop=loop)
+
+        loop.close()
+
+        t = asyncio.async(t_orig, loop=self.loop)
+        self.assertIs(t, t_orig)
+
+    def test_async_neither(self):
+        with self.assertRaises(TypeError):
+            asyncio.async('ok')
+
+    def test_task_repr(self):
+        self.loop.set_debug(False)
+
+        @asyncio.coroutine
+        def notmuch():
+            yield from []
+            return 'abc'
+
+        # test coroutine function
+        self.assertEqual(notmuch.__name__, 'notmuch')
+        if PY35:
+            self.assertEqual(notmuch.__qualname__,
+                             'TaskTests.test_task_repr.<locals>.notmuch')
+        self.assertEqual(notmuch.__module__, __name__)
+
+        filename, lineno = test_utils.get_function_source(notmuch)
+        src = "%s:%s" % (filename, lineno)
+
+        # test coroutine object
+        gen = notmuch()
+        if coroutines._DEBUG or PY35:
+            coro_qualname = 'TaskTests.test_task_repr.<locals>.notmuch'
+        else:
+            coro_qualname = 'notmuch'
+        self.assertEqual(gen.__name__, 'notmuch')
+        if PY35:
+            self.assertEqual(gen.__qualname__,
+                             coro_qualname)
+
+        # test pending Task
+        t = asyncio.Task(gen, loop=self.loop)
+        t.add_done_callback(Dummy())
+
+        coro = format_coroutine(coro_qualname, 'running', src,
+                                t._source_traceback, generator=True)
+        self.assertEqual(repr(t),
+                         '<Task pending %s cb=[<Dummy>()]>' % coro)
+
+        # test cancelling Task
+        t.cancel()  # Does not take immediate effect!
+        self.assertEqual(repr(t),
+                         '<Task cancelling %s cb=[<Dummy>()]>' % coro)
+
+        # test cancelled Task
+        self.assertRaises(asyncio.CancelledError,
+                          self.loop.run_until_complete, t)
+        coro = format_coroutine(coro_qualname, 'done', src,
+                                t._source_traceback)
+        self.assertEqual(repr(t),
+                         '<Task cancelled %s>' % coro)
+
+        # test finished Task
+        t = asyncio.Task(notmuch(), loop=self.loop)
+        self.loop.run_until_complete(t)
+        coro = format_coroutine(coro_qualname, 'done', src,
+                                t._source_traceback)
+        self.assertEqual(repr(t),
+                         "<Task finished %s result='abc'>" % coro)
+
+    def test_task_repr_coro_decorator(self):
+        self.loop.set_debug(False)
+
+        @asyncio.coroutine
+        def notmuch():
+            # notmuch() function doesn't use yield from: it will be wrapped by
+            # @coroutine decorator
+            return 123
+
+        # test coroutine function
+        self.assertEqual(notmuch.__name__, 'notmuch')
+        if PY35:
+            self.assertEqual(notmuch.__qualname__,
+                             'TaskTests.test_task_repr_coro_decorator'
+                             '.<locals>.notmuch')
+        self.assertEqual(notmuch.__module__, __name__)
+
+        # test coroutine object
+        gen = notmuch()
+        if coroutines._DEBUG or PY35:
+            # On Python >= 3.5, generators now inherit the name of the
+            # function, as expected, and have a qualified name (__qualname__
+            # attribute).
+            coro_name = 'notmuch'
+            coro_qualname = ('TaskTests.test_task_repr_coro_decorator'
+                             '.<locals>.notmuch')
+        else:
+            # On Python < 3.5, generators inherit the name of the code, not of
+            # the function. See: http://bugs.python.org/issue21205
+            coro_name = coro_qualname = 'coro'
+        self.assertEqual(gen.__name__, coro_name)
+        if PY35:
+            self.assertEqual(gen.__qualname__, coro_qualname)
+
+        # test repr(CoroWrapper)
+        if coroutines._DEBUG:
+            # format the coroutine object
+            if coroutines._DEBUG:
+                filename, lineno = test_utils.get_function_source(notmuch)
+                frame = gen._source_traceback[-1]
+                coro = ('%s() running, defined at %s:%s, created at %s:%s'
+                        % (coro_qualname, filename, lineno,
+                           frame[0], frame[1]))
+            else:
+                code = gen.gi_code
+                coro = ('%s() running at %s:%s'
+                        % (coro_qualname, code.co_filename,
+                           code.co_firstlineno))
+
+            self.assertEqual(repr(gen), '<CoroWrapper %s>' % coro)
+
+        # test pending Task
+        t = asyncio.Task(gen, loop=self.loop)
+        t.add_done_callback(Dummy())
+
+        # format the coroutine object
+        if coroutines._DEBUG:
+            src = '%s:%s' % test_utils.get_function_source(notmuch)
+        else:
+            code = gen.gi_code
+            src = '%s:%s' % (code.co_filename, code.co_firstlineno)
+        coro = format_coroutine(coro_qualname, 'running', src,
+                                t._source_traceback,
+                                generator=not coroutines._DEBUG)
+        self.assertEqual(repr(t),
+                         '<Task pending %s cb=[<Dummy>()]>' % coro)
+        self.loop.run_until_complete(t)
+
+    def test_task_repr_wait_for(self):
+        self.loop.set_debug(False)
+
+        @asyncio.coroutine
+        def wait_for(fut):
+            return (yield from fut)
+
+        fut = asyncio.Future(loop=self.loop)
+        task = asyncio.Task(wait_for(fut), loop=self.loop)
+        test_utils.run_briefly(self.loop)
+        self.assertRegex(repr(task),
+                         '<Task .* wait_for=%s>' % re.escape(repr(fut)))
+
+        fut.set_result(None)
+        self.loop.run_until_complete(task)
+
+    def test_task_basics(self):
+        @asyncio.coroutine
+        def outer():
+            a = yield from inner1()
+            b = yield from inner2()
+            return a+b
+
+        @asyncio.coroutine
+        def inner1():
+            return 42
+
+        @asyncio.coroutine
+        def inner2():
+            return 1000
+
+        t = outer()
+        self.assertEqual(self.loop.run_until_complete(t), 1042)
+
+    def test_cancel(self):
+
+        def gen():
+            when = yield
+            self.assertAlmostEqual(10.0, when)
+            yield 0
+
+        loop = self.new_test_loop(gen)
+
+        @asyncio.coroutine
+        def task():
+            yield from asyncio.sleep(10.0, loop=loop)
+            return 12
+
+        t = asyncio.Task(task(), loop=loop)
+        loop.call_soon(t.cancel)
+        with self.assertRaises(asyncio.CancelledError):
+            loop.run_until_complete(t)
+        self.assertTrue(t.done())
+        self.assertTrue(t.cancelled())
+        self.assertFalse(t.cancel())
+
+    def test_cancel_yield(self):
+        @asyncio.coroutine
+        def task():
+            yield
+            yield
+            return 12
+
+        t = asyncio.Task(task(), loop=self.loop)
+        test_utils.run_briefly(self.loop)  # start coro
+        t.cancel()
+        self.assertRaises(
+            asyncio.CancelledError, self.loop.run_until_complete, t)
+        self.assertTrue(t.done())
+        self.assertTrue(t.cancelled())
+        self.assertFalse(t.cancel())
+
+    def test_cancel_inner_future(self):
+        f = asyncio.Future(loop=self.loop)
+
+        @asyncio.coroutine
+        def task():
+            yield from f
+            return 12
+
+        t = asyncio.Task(task(), loop=self.loop)
+        test_utils.run_briefly(self.loop)  # start task
+        f.cancel()
+        with self.assertRaises(asyncio.CancelledError):
+            self.loop.run_until_complete(t)
+        self.assertTrue(f.cancelled())
+        self.assertTrue(t.cancelled())
+
+    def test_cancel_both_task_and_inner_future(self):
+        f = asyncio.Future(loop=self.loop)
+
+        @asyncio.coroutine
+        def task():
+            yield from f
+            return 12
+
+        t = asyncio.Task(task(), loop=self.loop)
+        test_utils.run_briefly(self.loop)
+
+        f.cancel()
+        t.cancel()
+
+        with self.assertRaises(asyncio.CancelledError):
+            self.loop.run_until_complete(t)
+
+        self.assertTrue(t.done())
+        self.assertTrue(f.cancelled())
+        self.assertTrue(t.cancelled())
+
+    def test_cancel_task_catching(self):
+        fut1 = asyncio.Future(loop=self.loop)
+        fut2 = asyncio.Future(loop=self.loop)
+
+        @asyncio.coroutine
+        def task():
+            yield from fut1
+            try:
+                yield from fut2
+            except asyncio.CancelledError:
+                return 42
+
+        t = asyncio.Task(task(), loop=self.loop)
+        test_utils.run_briefly(self.loop)
+        self.assertIs(t._fut_waiter, fut1)  # White-box test.
+        fut1.set_result(None)
+        test_utils.run_briefly(self.loop)
+        self.assertIs(t._fut_waiter, fut2)  # White-box test.
+        t.cancel()
+        self.assertTrue(fut2.cancelled())
+        res = self.loop.run_until_complete(t)
+        self.assertEqual(res, 42)
+        self.assertFalse(t.cancelled())
+
+    def test_cancel_task_ignoring(self):
+        fut1 = asyncio.Future(loop=self.loop)
+        fut2 = asyncio.Future(loop=self.loop)
+        fut3 = asyncio.Future(loop=self.loop)
+
+        @asyncio.coroutine
+        def task():
+            yield from fut1
+            try:
+                yield from fut2
+            except asyncio.CancelledError:
+                pass
+            res = yield from fut3
+            return res
+
+        t = asyncio.Task(task(), loop=self.loop)
+        test_utils.run_briefly(self.loop)
+        self.assertIs(t._fut_waiter, fut1)  # White-box test.
+        fut1.set_result(None)
+        test_utils.run_briefly(self.loop)
+        self.assertIs(t._fut_waiter, fut2)  # White-box test.
+        t.cancel()
+        self.assertTrue(fut2.cancelled())
+        test_utils.run_briefly(self.loop)
+        self.assertIs(t._fut_waiter, fut3)  # White-box test.
+        fut3.set_result(42)
+        res = self.loop.run_until_complete(t)
+        self.assertEqual(res, 42)
+        self.assertFalse(fut3.cancelled())
+        self.assertFalse(t.cancelled())
+
+    def test_cancel_current_task(self):
+        loop = asyncio.new_event_loop()
+        self.set_event_loop(loop)
+
+        @asyncio.coroutine
+        def task():
+            t.cancel()
+            self.assertTrue(t._must_cancel)  # White-box test.
+            # The sleep should be cancelled immediately.
+            yield from asyncio.sleep(100, loop=loop)
+            return 12
+
+        t = asyncio.Task(task(), loop=loop)
+        self.assertRaises(
+            asyncio.CancelledError, loop.run_until_complete, t)
+        self.assertTrue(t.done())
+        self.assertFalse(t._must_cancel)  # White-box test.
+        self.assertFalse(t.cancel())
+
+    def test_stop_while_run_in_complete(self):
+
+        def gen():
+            when = yield
+            self.assertAlmostEqual(0.1, when)
+            when = yield 0.1
+            self.assertAlmostEqual(0.2, when)
+            when = yield 0.1
+            self.assertAlmostEqual(0.3, when)
+            yield 0.1
+
+        loop = self.new_test_loop(gen)
+
+        x = 0
+        waiters = []
+
+        @asyncio.coroutine
+        def task():
+            nonlocal x
+            while x < 10:
+                waiters.append(asyncio.sleep(0.1, loop=loop))
+                yield from waiters[-1]
+                x += 1
+                if x == 2:
+                    loop.stop()
+
+        t = asyncio.Task(task(), loop=loop)
+        with self.assertRaises(RuntimeError) as cm:
+            loop.run_until_complete(t)
+        self.assertEqual(str(cm.exception),
+                         'Event loop stopped before Future completed.')
+        self.assertFalse(t.done())
+        self.assertEqual(x, 2)
+        self.assertAlmostEqual(0.3, loop.time())
+
+        # close generators
+        for w in waiters:
+            w.close()
+        t.cancel()
+        self.assertRaises(asyncio.CancelledError, loop.run_until_complete, t)
+
+    def test_wait_for(self):
+
+        def gen():
+            when = yield
+            self.assertAlmostEqual(0.2, when)
+            when = yield 0
+            self.assertAlmostEqual(0.1, when)
+            when = yield 0.1
+
+        loop = self.new_test_loop(gen)
+
+        foo_running = None
+
+        @asyncio.coroutine
+        def foo():
+            nonlocal foo_running
+            foo_running = True
+            try:
+                yield from asyncio.sleep(0.2, loop=loop)
+            finally:
+                foo_running = False
+            return 'done'
+
+        fut = asyncio.Task(foo(), loop=loop)
+
+        with self.assertRaises(asyncio.TimeoutError):
+            loop.run_until_complete(asyncio.wait_for(fut, 0.1, loop=loop))
+        self.assertTrue(fut.done())
+        # it should have been cancelled due to the timeout
+        self.assertTrue(fut.cancelled())
+        self.assertAlmostEqual(0.1, loop.time())
+        self.assertEqual(foo_running, False)
+
+    def test_wait_for_blocking(self):
+        loop = self.new_test_loop()
+
+        @asyncio.coroutine
+        def coro():
+            return 'done'
+
+        res = loop.run_until_complete(asyncio.wait_for(coro(),
+                                                       timeout=None,
+                                                       loop=loop))
+        self.assertEqual(res, 'done')
+
+    def test_wait_for_with_global_loop(self):
+
+        def gen():
+            when = yield
+            self.assertAlmostEqual(0.2, when)
+            when = yield 0
+            self.assertAlmostEqual(0.01, when)
+            yield 0.01
+
+        loop = self.new_test_loop(gen)
+
+        @asyncio.coroutine
+        def foo():
+            yield from asyncio.sleep(0.2, loop=loop)
+            return 'done'
+
+        asyncio.set_event_loop(loop)
+        try:
+            fut = asyncio.Task(foo(), loop=loop)
+            with self.assertRaises(asyncio.TimeoutError):
+                loop.run_until_complete(asyncio.wait_for(fut, 0.01))
+        finally:
+            asyncio.set_event_loop(None)
+
+        self.assertAlmostEqual(0.01, loop.time())
+        self.assertTrue(fut.done())
+        self.assertTrue(fut.cancelled())
+
+    def test_wait_for_race_condition(self):
+
+        def gen():
+            yield 0.1
+            yield 0.1
+            yield 0.1
+
+        loop = self.new_test_loop(gen)
+
+        fut = asyncio.Future(loop=loop)
+        task = asyncio.wait_for(fut, timeout=0.2, loop=loop)
+        loop.call_later(0.1, fut.set_result, "ok")
+        res = loop.run_until_complete(task)
+        self.assertEqual(res, "ok")
+
+    def test_wait(self):
+
+        def gen():
+            when = yield
+            self.assertAlmostEqual(0.1, when)
+            when = yield 0
+            self.assertAlmostEqual(0.15, when)
+            yield 0.15
+
+        loop = self.new_test_loop(gen)
+
+        a = asyncio.Task(asyncio.sleep(0.1, loop=loop), loop=loop)
+        b = asyncio.Task(asyncio.sleep(0.15, loop=loop), loop=loop)
+
+        @asyncio.coroutine
+        def foo():
+            done, pending = yield from asyncio.wait([b, a], loop=loop)
+            self.assertEqual(done, set([a, b]))
+            self.assertEqual(pending, set())
+            return 42
+
+        res = loop.run_until_complete(asyncio.Task(foo(), loop=loop))
+        self.assertEqual(res, 42)
+        self.assertAlmostEqual(0.15, loop.time())
+
+        # Doing it again should take no time and exercise a different path.
+        res = loop.run_until_complete(asyncio.Task(foo(), loop=loop))
+        self.assertAlmostEqual(0.15, loop.time())
+        self.assertEqual(res, 42)
+
+    def test_wait_with_global_loop(self):
+
+        def gen():
+            when = yield
+            self.assertAlmostEqual(0.01, when)
+            when = yield 0
+            self.assertAlmostEqual(0.015, when)
+            yield 0.015
+
+        loop = self.new_test_loop(gen)
+
+        a = asyncio.Task(asyncio.sleep(0.01, loop=loop), loop=loop)
+        b = asyncio.Task(asyncio.sleep(0.015, loop=loop), loop=loop)
+
+        @asyncio.coroutine
+        def foo():
+            done, pending = yield from asyncio.wait([b, a])
+            self.assertEqual(done, set([a, b]))
+            self.assertEqual(pending, set())
+            return 42
+
+        asyncio.set_event_loop(loop)
+        res = loop.run_until_complete(
+            asyncio.Task(foo(), loop=loop))
+
+        self.assertEqual(res, 42)
+
+    def test_wait_duplicate_coroutines(self):
+        @asyncio.coroutine
+        def coro(s):
+            return s
+        c = coro('test')
+
+        task = asyncio.Task(
+            asyncio.wait([c, c, coro('spam')], loop=self.loop),
+            loop=self.loop)
+
+        done, pending = self.loop.run_until_complete(task)
+
+        self.assertFalse(pending)
+        self.assertEqual(set(f.result() for f in done), {'test', 'spam'})
+
+    def test_wait_errors(self):
+        self.assertRaises(
+            ValueError, self.loop.run_until_complete,
+            asyncio.wait(set(), loop=self.loop))
+
+        # -1 is an invalid return_when value
+        sleep_coro = asyncio.sleep(10.0, loop=self.loop)
+        wait_coro = asyncio.wait([sleep_coro], return_when=-1, loop=self.loop)
+        self.assertRaises(ValueError,
+                          self.loop.run_until_complete, wait_coro)
+
+        sleep_coro.close()
+
+    def test_wait_first_completed(self):
+
+        def gen():
+            when = yield
+            self.assertAlmostEqual(10.0, when)
+            when = yield 0
+            self.assertAlmostEqual(0.1, when)
+            yield 0.1
+
+        loop = self.new_test_loop(gen)
+
+        a = asyncio.Task(asyncio.sleep(10.0, loop=loop), loop=loop)
+        b = asyncio.Task(asyncio.sleep(0.1, loop=loop), loop=loop)
+        task = asyncio.Task(
+            asyncio.wait([b, a], return_when=asyncio.FIRST_COMPLETED,
+                         loop=loop),
+            loop=loop)
+
+        done, pending = loop.run_until_complete(task)
+        self.assertEqual({b}, done)
+        self.assertEqual({a}, pending)
+        self.assertFalse(a.done())
+        self.assertTrue(b.done())
+        self.assertIsNone(b.result())
+        self.assertAlmostEqual(0.1, loop.time())
+
+        # move forward to close generator
+        loop.advance_time(10)
+        loop.run_until_complete(asyncio.wait([a, b], loop=loop))
+
+    def test_wait_really_done(self):
+        # there is possibility that some tasks in the pending list
+        # became done but their callbacks haven't all been called yet
+
+        @asyncio.coroutine
+        def coro1():
+            yield
+
+        @asyncio.coroutine
+        def coro2():
+            yield
+            yield
+
+        a = asyncio.Task(coro1(), loop=self.loop)
+        b = asyncio.Task(coro2(), loop=self.loop)
+        task = asyncio.Task(
+            asyncio.wait([b, a], return_when=asyncio.FIRST_COMPLETED,
+                         loop=self.loop),
+            loop=self.loop)
+
+        done, pending = self.loop.run_until_complete(task)
+        self.assertEqual({a, b}, done)
+        self.assertTrue(a.done())
+        self.assertIsNone(a.result())
+        self.assertTrue(b.done())
+        self.assertIsNone(b.result())
+
+    def test_wait_first_exception(self):
+
+        def gen():
+            when = yield
+            self.assertAlmostEqual(10.0, when)
+            yield 0
+
+        loop = self.new_test_loop(gen)
+
+        # first_exception, task already has exception
+        a = asyncio.Task(asyncio.sleep(10.0, loop=loop), loop=loop)
+
+        @asyncio.coroutine
+        def exc():
+            raise ZeroDivisionError('err')
+
+        b = asyncio.Task(exc(), loop=loop)
+        task = asyncio.Task(
+            asyncio.wait([b, a], return_when=asyncio.FIRST_EXCEPTION,
+                         loop=loop),
+            loop=loop)
+
+        done, pending = loop.run_until_complete(task)
+        self.assertEqual({b}, done)
+        self.assertEqual({a}, pending)
+        self.assertAlmostEqual(0, loop.time())
+
+        # move forward to close generator
+        loop.advance_time(10)
+        loop.run_until_complete(asyncio.wait([a, b], loop=loop))
+
+    def test_wait_first_exception_in_wait(self):
+
+        def gen():
+            when = yield
+            self.assertAlmostEqual(10.0, when)
+            when = yield 0
+            self.assertAlmostEqual(0.01, when)
+            yield 0.01
+
+        loop = self.new_test_loop(gen)
+
+        # first_exception, exception during waiting
+        a = asyncio.Task(asyncio.sleep(10.0, loop=loop), loop=loop)
+
+        @asyncio.coroutine
+        def exc():
+            yield from asyncio.sleep(0.01, loop=loop)
+            raise ZeroDivisionError('err')
+
+        b = asyncio.Task(exc(), loop=loop)
+        task = asyncio.wait([b, a], return_when=asyncio.FIRST_EXCEPTION,
+                            loop=loop)
+
+        done, pending = loop.run_until_complete(task)
+        self.assertEqual({b}, done)
+        self.assertEqual({a}, pending)
+        self.assertAlmostEqual(0.01, loop.time())
+
+        # move forward to close generator
+        loop.advance_time(10)
+        loop.run_until_complete(asyncio.wait([a, b], loop=loop))
+
+    def test_wait_with_exception(self):
+
+        def gen():
+            when = yield
+            self.assertAlmostEqual(0.1, when)
+            when = yield 0
+            self.assertAlmostEqual(0.15, when)
+            yield 0.15
+
+        loop = self.new_test_loop(gen)
+
+        a = asyncio.Task(asyncio.sleep(0.1, loop=loop), loop=loop)
+
+        @asyncio.coroutine
+        def sleeper():
+            yield from asyncio.sleep(0.15, loop=loop)
+            raise ZeroDivisionError('really')
+
+        b = asyncio.Task(sleeper(), loop=loop)
+
+        @asyncio.coroutine
+        def foo():
+            done, pending = yield from asyncio.wait([b, a], loop=loop)
+            self.assertEqual(len(done), 2)
+            self.assertEqual(pending, set())
+            errors = set(f for f in done if f.exception() is not None)
+            self.assertEqual(len(errors), 1)
+
+        loop.run_until_complete(asyncio.Task(foo(), loop=loop))
+        self.assertAlmostEqual(0.15, loop.time())
+
+        loop.run_until_complete(asyncio.Task(foo(), loop=loop))
+        self.assertAlmostEqual(0.15, loop.time())
+
+    def test_wait_with_timeout(self):
+
+        def gen():
+            when = yield
+            self.assertAlmostEqual(0.1, when)
+            when = yield 0
+            self.assertAlmostEqual(0.15, when)
+            when = yield 0
+            self.assertAlmostEqual(0.11, when)
+            yield 0.11
+
+        loop = self.new_test_loop(gen)
+
+        a = asyncio.Task(asyncio.sleep(0.1, loop=loop), loop=loop)
+        b = asyncio.Task(asyncio.sleep(0.15, loop=loop), loop=loop)
+
+        @asyncio.coroutine
+        def foo():
+            done, pending = yield from asyncio.wait([b, a], timeout=0.11,
+                                                    loop=loop)
+            self.assertEqual(done, set([a]))
+            self.assertEqual(pending, set([b]))
+
+        loop.run_until_complete(asyncio.Task(foo(), loop=loop))
+        self.assertAlmostEqual(0.11, loop.time())
+
+        # move forward to close generator
+        loop.advance_time(10)
+        loop.run_until_complete(asyncio.wait([a, b], loop=loop))
+
+    def test_wait_concurrent_complete(self):
+
+        def gen():
+            when = yield
+            self.assertAlmostEqual(0.1, when)
+            when = yield 0
+            self.assertAlmostEqual(0.15, when)
+            when = yield 0
+            self.assertAlmostEqual(0.1, when)
+            yield 0.1
+
+        loop = self.new_test_loop(gen)
+
+        a = asyncio.Task(asyncio.sleep(0.1, loop=loop), loop=loop)
+        b = asyncio.Task(asyncio.sleep(0.15, loop=loop), loop=loop)
+
+        done, pending = loop.run_until_complete(
+            asyncio.wait([b, a], timeout=0.1, loop=loop))
+
+        self.assertEqual(done, set([a]))
+        self.assertEqual(pending, set([b]))
+        self.assertAlmostEqual(0.1, loop.time())
+
+        # move forward to close generator
+        loop.advance_time(10)
+        loop.run_until_complete(asyncio.wait([a, b], loop=loop))
+
+    def test_as_completed(self):
+
+        def gen():
+            yield 0
+            yield 0
+            yield 0.01
+            yield 0
+
+        loop = self.new_test_loop(gen)
+        # disable "slow callback" warning
+        loop.slow_callback_duration = 1.0
+        completed = set()
+        time_shifted = False
+
+        @asyncio.coroutine
+        def sleeper(dt, x):
+            nonlocal time_shifted
+            yield from asyncio.sleep(dt, loop=loop)
+            completed.add(x)
+            if not time_shifted and 'a' in completed and 'b' in completed:
+                time_shifted = True
+                loop.advance_time(0.14)
+            return x
+
+        a = sleeper(0.01, 'a')
+        b = sleeper(0.01, 'b')
+        c = sleeper(0.15, 'c')
+
+        @asyncio.coroutine
+        def foo():
+            values = []
+            for f in asyncio.as_completed([b, c, a], loop=loop):
+                values.append((yield from f))
+            return values
+
+        res = loop.run_until_complete(asyncio.Task(foo(), loop=loop))
+        self.assertAlmostEqual(0.15, loop.time())
+        self.assertTrue('a' in res[:2])
+        self.assertTrue('b' in res[:2])
+        self.assertEqual(res[2], 'c')
+
+        # Doing it again should take no time and exercise a different path.
+        res = loop.run_until_complete(asyncio.Task(foo(), loop=loop))
+        self.assertAlmostEqual(0.15, loop.time())
+
+    def test_as_completed_with_timeout(self):
+
+        def gen():
+            yield
+            yield 0
+            yield 0
+            yield 0.1
+
+        loop = self.new_test_loop(gen)
+
+        a = asyncio.sleep(0.1, 'a', loop=loop)
+        b = asyncio.sleep(0.15, 'b', loop=loop)
+
+        @asyncio.coroutine
+        def foo():
+            values = []
+            for f in asyncio.as_completed([a, b], timeout=0.12, loop=loop):
+                if values:
+                    loop.advance_time(0.02)
+                try:
+                    v = yield from f
+                    values.append((1, v))
+                except asyncio.TimeoutError as exc:
+                    values.append((2, exc))
+            return values
+
+        res = loop.run_until_complete(asyncio.Task(foo(), loop=loop))
+        self.assertEqual(len(res), 2, res)
+        self.assertEqual(res[0], (1, 'a'))
+        self.assertEqual(res[1][0], 2)
+        self.assertIsInstance(res[1][1], asyncio.TimeoutError)
+        self.assertAlmostEqual(0.12, loop.time())
+
+        # move forward to close generator
+        loop.advance_time(10)
+        loop.run_until_complete(asyncio.wait([a, b], loop=loop))
+
+    def test_as_completed_with_unused_timeout(self):
+
+        def gen():
+            yield
+            yield 0
+            yield 0.01
+
+        loop = self.new_test_loop(gen)
+
+        a = asyncio.sleep(0.01, 'a', loop=loop)
+
+        @asyncio.coroutine
+        def foo():
+            for f in asyncio.as_completed([a], timeout=1, loop=loop):
+                v = yield from f
+                self.assertEqual(v, 'a')
+
+        loop.run_until_complete(asyncio.Task(foo(), loop=loop))
+
+    def test_as_completed_reverse_wait(self):
+
+        def gen():
+            yield 0
+            yield 0.05
+            yield 0
+
+        loop = self.new_test_loop(gen)
+
+        a = asyncio.sleep(0.05, 'a', loop=loop)
+        b = asyncio.sleep(0.10, 'b', loop=loop)
+        fs = {a, b}
+        futs = list(asyncio.as_completed(fs, loop=loop))
+        self.assertEqual(len(futs), 2)
+
+        x = loop.run_until_complete(futs[1])
+        self.assertEqual(x, 'a')
+        self.assertAlmostEqual(0.05, loop.time())
+        loop.advance_time(0.05)
+        y = loop.run_until_complete(futs[0])
+        self.assertEqual(y, 'b')
+        self.assertAlmostEqual(0.10, loop.time())
+
+    def test_as_completed_concurrent(self):
+
+        def gen():
+            when = yield
+            self.assertAlmostEqual(0.05, when)
+            when = yield 0
+            self.assertAlmostEqual(0.05, when)
+            yield 0.05
+
+        loop = self.new_test_loop(gen)
+
+        a = asyncio.sleep(0.05, 'a', loop=loop)
+        b = asyncio.sleep(0.05, 'b', loop=loop)
+        fs = {a, b}
+        futs = list(asyncio.as_completed(fs, loop=loop))
+        self.assertEqual(len(futs), 2)
+        waiter = asyncio.wait(futs, loop=loop)
+        done, pending = loop.run_until_complete(waiter)
+        self.assertEqual(set(f.result() for f in done), {'a', 'b'})
+
+    def test_as_completed_duplicate_coroutines(self):
+
+        @asyncio.coroutine
+        def coro(s):
+            return s
+
+        @asyncio.coroutine
+        def runner():
+            result = []
+            c = coro('ham')
+            for f in asyncio.as_completed([c, c, coro('spam')],
+                                          loop=self.loop):
+                result.append((yield from f))
+            return result
+
+        fut = asyncio.Task(runner(), loop=self.loop)
+        self.loop.run_until_complete(fut)
+        result = fut.result()
+        self.assertEqual(set(result), {'ham', 'spam'})
+        self.assertEqual(len(result), 2)
+
+    def test_sleep(self):
+
+        def gen():
+            when = yield
+            self.assertAlmostEqual(0.05, when)
+            when = yield 0.05
+            self.assertAlmostEqual(0.1, when)
+            yield 0.05
+
+        loop = self.new_test_loop(gen)
+
+        @asyncio.coroutine
+        def sleeper(dt, arg):
+            yield from asyncio.sleep(dt/2, loop=loop)
+            res = yield from asyncio.sleep(dt/2, arg, loop=loop)
+            return res
+
+        t = asyncio.Task(sleeper(0.1, 'yeah'), loop=loop)
+        loop.run_until_complete(t)
+        self.assertTrue(t.done())
+        self.assertEqual(t.result(), 'yeah')
+        self.assertAlmostEqual(0.1, loop.time())
+
+    def test_sleep_cancel(self):
+
+        def gen():
+            when = yield
+            self.assertAlmostEqual(10.0, when)
+            yield 0
+
+        loop = self.new_test_loop(gen)
+
+        t = asyncio.Task(asyncio.sleep(10.0, 'yeah', loop=loop),
+                         loop=loop)
+
+        handle = None
+        orig_call_later = loop.call_later
+
+        def call_later(delay, callback, *args):
+            nonlocal handle
+            handle = orig_call_later(delay, callback, *args)
+            return handle
+
+        loop.call_later = call_later
+        test_utils.run_briefly(loop)
+
+        self.assertFalse(handle._cancelled)
+
+        t.cancel()
+        test_utils.run_briefly(loop)
+        self.assertTrue(handle._cancelled)
+
+    def test_task_cancel_sleeping_task(self):
+
+        def gen():
+            when = yield
+            self.assertAlmostEqual(0.1, when)
+            when = yield 0
+            self.assertAlmostEqual(5000, when)
+            yield 0.1
+
+        loop = self.new_test_loop(gen)
+
+        @asyncio.coroutine
+        def sleep(dt):
+            yield from asyncio.sleep(dt, loop=loop)
+
+        @asyncio.coroutine
+        def doit():
+            sleeper = asyncio.Task(sleep(5000), loop=loop)
+            loop.call_later(0.1, sleeper.cancel)
+            try:
+                yield from sleeper
+            except asyncio.CancelledError:
+                return 'cancelled'
+            else:
+                return 'slept in'
+
+        doer = doit()
+        self.assertEqual(loop.run_until_complete(doer), 'cancelled')
+        self.assertAlmostEqual(0.1, loop.time())
+
+    def test_task_cancel_waiter_future(self):
+        fut = asyncio.Future(loop=self.loop)
+
+        @asyncio.coroutine
+        def coro():
+            yield from fut
+
+        task = asyncio.Task(coro(), loop=self.loop)
+        test_utils.run_briefly(self.loop)
+        self.assertIs(task._fut_waiter, fut)
+
+        task.cancel()
+        test_utils.run_briefly(self.loop)
+        self.assertRaises(
+            asyncio.CancelledError, self.loop.run_until_complete, task)
+        self.assertIsNone(task._fut_waiter)
+        self.assertTrue(fut.cancelled())
+
+    def test_step_in_completed_task(self):
+        @asyncio.coroutine
+        def notmuch():
+            return 'ko'
+
+        gen = notmuch()
+        task = asyncio.Task(gen, loop=self.loop)
+        task.set_result('ok')
+
+        self.assertRaises(AssertionError, task._step)
+        gen.close()
+
+    def test_step_result(self):
+        @asyncio.coroutine
+        def notmuch():
+            yield None
+            yield 1
+            return 'ko'
+
+        self.assertRaises(
+            RuntimeError, self.loop.run_until_complete, notmuch())
+
+    def test_step_result_future(self):
+        # If coroutine returns future, task waits on this future.
+
+        class Fut(asyncio.Future):
+            def __init__(self, *args, **kwds):
+                self.cb_added = False
+                super().__init__(*args, **kwds)
+
+            def add_done_callback(self, fn):
+                self.cb_added = True
+                super().add_done_callback(fn)
+
+        fut = Fut(loop=self.loop)
+        result = None
+
+        @asyncio.coroutine
+        def wait_for_future():
+            nonlocal result
+            result = yield from fut
+
+        t = asyncio.Task(wait_for_future(), loop=self.loop)
+        test_utils.run_briefly(self.loop)
+        self.assertTrue(fut.cb_added)
+
+        res = object()
+        fut.set_result(res)
+        test_utils.run_briefly(self.loop)
+        self.assertIs(res, result)
+        self.assertTrue(t.done())
+        self.assertIsNone(t.result())
+
+    def test_step_with_baseexception(self):
+        @asyncio.coroutine
+        def notmutch():
+            raise BaseException()
+
+        task = asyncio.Task(notmutch(), loop=self.loop)
+        self.assertRaises(BaseException, task._step)
+
+        self.assertTrue(task.done())
+        self.assertIsInstance(task.exception(), BaseException)
+
+    def test_baseexception_during_cancel(self):
+
+        def gen():
+            when = yield
+            self.assertAlmostEqual(10.0, when)
+            yield 0
+
+        loop = self.new_test_loop(gen)
+
+        @asyncio.coroutine
+        def sleeper():
+            yield from asyncio.sleep(10, loop=loop)
+
+        base_exc = BaseException()
+
+        @asyncio.coroutine
+        def notmutch():
+            try:
+                yield from sleeper()
+            except asyncio.CancelledError:
+                raise base_exc
+
+        task = asyncio.Task(notmutch(), loop=loop)
+        test_utils.run_briefly(loop)
+
+        task.cancel()
+        self.assertFalse(task.done())
+
+        self.assertRaises(BaseException, test_utils.run_briefly, loop)
+
+        self.assertTrue(task.done())
+        self.assertFalse(task.cancelled())
+        self.assertIs(task.exception(), base_exc)
+
+    def test_iscoroutinefunction(self):
+        def fn():
+            pass
+
+        self.assertFalse(asyncio.iscoroutinefunction(fn))
+
+        def fn1():
+            yield
+        self.assertFalse(asyncio.iscoroutinefunction(fn1))
+
+        @asyncio.coroutine
+        def fn2():
+            yield
+        self.assertTrue(asyncio.iscoroutinefunction(fn2))
+
+    def test_yield_vs_yield_from(self):
+        fut = asyncio.Future(loop=self.loop)
+
+        @asyncio.coroutine
+        def wait_for_future():
+            yield fut
+
+        task = wait_for_future()
+        with self.assertRaises(RuntimeError):
+            self.loop.run_until_complete(task)
+
+        self.assertFalse(fut.done())
+
+    def test_yield_vs_yield_from_generator(self):
+        @asyncio.coroutine
+        def coro():
+            yield
+
+        @asyncio.coroutine
+        def wait_for_future():
+            gen = coro()
+            try:
+                yield gen
+            finally:
+                gen.close()
+
+        task = wait_for_future()
+        self.assertRaises(
+            RuntimeError,
+            self.loop.run_until_complete, task)
+
+    def test_coroutine_non_gen_function(self):
+        @asyncio.coroutine
+        def func():
+            return 'test'
+
+        self.assertTrue(asyncio.iscoroutinefunction(func))
+
+        coro = func()
+        self.assertTrue(asyncio.iscoroutine(coro))
+
+        res = self.loop.run_until_complete(coro)
+        self.assertEqual(res, 'test')
+
+    def test_coroutine_non_gen_function_return_future(self):
+        fut = asyncio.Future(loop=self.loop)
+
+        @asyncio.coroutine
+        def func():
+            return fut
+
+        @asyncio.coroutine
+        def coro():
+            fut.set_result('test')
+
+        t1 = asyncio.Task(func(), loop=self.loop)
+        t2 = asyncio.Task(coro(), loop=self.loop)
+        res = self.loop.run_until_complete(t1)
+        self.assertEqual(res, 'test')
+        self.assertIsNone(t2.result())
+
+    def test_current_task(self):
+        self.assertIsNone(asyncio.Task.current_task(loop=self.loop))
+
+        @asyncio.coroutine
+        def coro(loop):
+            self.assertTrue(asyncio.Task.current_task(loop=loop) is task)
+
+        task = asyncio.Task(coro(self.loop), loop=self.loop)
+        self.loop.run_until_complete(task)
+        self.assertIsNone(asyncio.Task.current_task(loop=self.loop))
+
+    def test_current_task_with_interleaving_tasks(self):
+        self.assertIsNone(asyncio.Task.current_task(loop=self.loop))
+
+        fut1 = asyncio.Future(loop=self.loop)
+        fut2 = asyncio.Future(loop=self.loop)
+
+        @asyncio.coroutine
+        def coro1(loop):
+            self.assertTrue(asyncio.Task.current_task(loop=loop) is task1)
+            yield from fut1
+            self.assertTrue(asyncio.Task.current_task(loop=loop) is task1)
+            fut2.set_result(True)
+
+        @asyncio.coroutine
+        def coro2(loop):
+            self.assertTrue(asyncio.Task.current_task(loop=loop) is task2)
+            fut1.set_result(True)
+            yield from fut2
+            self.assertTrue(asyncio.Task.current_task(loop=loop) is task2)
+
+        task1 = asyncio.Task(coro1(self.loop), loop=self.loop)
+        task2 = asyncio.Task(coro2(self.loop), loop=self.loop)
+
+        self.loop.run_until_complete(asyncio.wait((task1, task2),
+                                                  loop=self.loop))
+        self.assertIsNone(asyncio.Task.current_task(loop=self.loop))
+
+    # Some thorough tests for cancellation propagation through
+    # coroutines, tasks and wait().
+
+    def test_yield_future_passes_cancel(self):
+        # Cancelling outer() cancels inner() cancels waiter.
+        proof = 0
+        waiter = asyncio.Future(loop=self.loop)
+
+        @asyncio.coroutine
+        def inner():
+            nonlocal proof
+            try:
+                yield from waiter
+            except asyncio.CancelledError:
+                proof += 1
+                raise
+            else:
+                self.fail('got past sleep() in inner()')
+
+        @asyncio.coroutine
+        def outer():
+            nonlocal proof
+            try:
+                yield from inner()
+            except asyncio.CancelledError:
+                proof += 100  # Expect this path.
+            else:
+                proof += 10
+
+        f = asyncio.async(outer(), loop=self.loop)
+        test_utils.run_briefly(self.loop)
+        f.cancel()
+        self.loop.run_until_complete(f)
+        self.assertEqual(proof, 101)
+        self.assertTrue(waiter.cancelled())
+
+    def test_yield_wait_does_not_shield_cancel(self):
+        # Cancelling outer() makes wait() return early, leaves inner()
+        # running.
+        proof = 0
+        waiter = asyncio.Future(loop=self.loop)
+
+        @asyncio.coroutine
+        def inner():
+            nonlocal proof
+            yield from waiter
+            proof += 1
+
+        @asyncio.coroutine
+        def outer():
+            nonlocal proof
+            d, p = yield from asyncio.wait([inner()], loop=self.loop)
+            proof += 100
+
+        f = asyncio.async(outer(), loop=self.loop)
+        test_utils.run_briefly(self.loop)
+        f.cancel()
+        self.assertRaises(
+            asyncio.CancelledError, self.loop.run_until_complete, f)
+        waiter.set_result(None)
+        test_utils.run_briefly(self.loop)
+        self.assertEqual(proof, 1)
+
+    def test_shield_result(self):
+        inner = asyncio.Future(loop=self.loop)
+        outer = asyncio.shield(inner)
+        inner.set_result(42)
+        res = self.loop.run_until_complete(outer)
+        self.assertEqual(res, 42)
+
+    def test_shield_exception(self):
+        inner = asyncio.Future(loop=self.loop)
+        outer = asyncio.shield(inner)
+        test_utils.run_briefly(self.loop)
+        exc = RuntimeError('expected')
+        inner.set_exception(exc)
+        test_utils.run_briefly(self.loop)
+        self.assertIs(outer.exception(), exc)
+
+    def test_shield_cancel(self):
+        inner = asyncio.Future(loop=self.loop)
+        outer = asyncio.shield(inner)
+        test_utils.run_briefly(self.loop)
+        inner.cancel()
+        test_utils.run_briefly(self.loop)
+        self.assertTrue(outer.cancelled())
+
+    def test_shield_shortcut(self):
+        fut = asyncio.Future(loop=self.loop)
+        fut.set_result(42)
+        res = self.loop.run_until_complete(asyncio.shield(fut))
+        self.assertEqual(res, 42)
+
+    def test_shield_effect(self):
+        # Cancelling outer() does not affect inner().
+        proof = 0
+        waiter = asyncio.Future(loop=self.loop)
+
+        @asyncio.coroutine
+        def inner():
+            nonlocal proof
+            yield from waiter
+            proof += 1
+
+        @asyncio.coroutine
+        def outer():
+            nonlocal proof
+            yield from asyncio.shield(inner(), loop=self.loop)
+            proof += 100
+
+        f = asyncio.async(outer(), loop=self.loop)
+        test_utils.run_briefly(self.loop)
+        f.cancel()
+        with self.assertRaises(asyncio.CancelledError):
+            self.loop.run_until_complete(f)
+        waiter.set_result(None)
+        test_utils.run_briefly(self.loop)
+        self.assertEqual(proof, 1)
+
+    def test_shield_gather(self):
+        child1 = asyncio.Future(loop=self.loop)
+        child2 = asyncio.Future(loop=self.loop)
+        parent = asyncio.gather(child1, child2, loop=self.loop)
+        outer = asyncio.shield(parent, loop=self.loop)
+        test_utils.run_briefly(self.loop)
+        outer.cancel()
+        test_utils.run_briefly(self.loop)
+        self.assertTrue(outer.cancelled())
+        child1.set_result(1)
+        child2.set_result(2)
+        test_utils.run_briefly(self.loop)
+        self.assertEqual(parent.result(), [1, 2])
+
+    def test_gather_shield(self):
+        child1 = asyncio.Future(loop=self.loop)
+        child2 = asyncio.Future(loop=self.loop)
+        inner1 = asyncio.shield(child1, loop=self.loop)
+        inner2 = asyncio.shield(child2, loop=self.loop)
+        parent = asyncio.gather(inner1, inner2, loop=self.loop)
+        test_utils.run_briefly(self.loop)
+        parent.cancel()
+        # This should cancel inner1 and inner2 but bot child1 and child2.
+        test_utils.run_briefly(self.loop)
+        self.assertIsInstance(parent.exception(), asyncio.CancelledError)
+        self.assertTrue(inner1.cancelled())
+        self.assertTrue(inner2.cancelled())
+        child1.set_result(1)
+        child2.set_result(2)
+        test_utils.run_briefly(self.loop)
+
+    def test_as_completed_invalid_args(self):
+        fut = asyncio.Future(loop=self.loop)
+
+        # as_completed() expects a list of futures, not a future instance
+        self.assertRaises(TypeError, self.loop.run_until_complete,
+            asyncio.as_completed(fut, loop=self.loop))
+        coro = coroutine_function()
+        self.assertRaises(TypeError, self.loop.run_until_complete,
+            asyncio.as_completed(coro, loop=self.loop))
+        coro.close()
+
+    def test_wait_invalid_args(self):
+        fut = asyncio.Future(loop=self.loop)
+
+        # wait() expects a list of futures, not a future instance
+        self.assertRaises(TypeError, self.loop.run_until_complete,
+            asyncio.wait(fut, loop=self.loop))
+        coro = coroutine_function()
+        self.assertRaises(TypeError, self.loop.run_until_complete,
+            asyncio.wait(coro, loop=self.loop))
+        coro.close()
+
+        # wait() expects at least a future
+        self.assertRaises(ValueError, self.loop.run_until_complete,
+            asyncio.wait([], loop=self.loop))
+
+    def test_corowrapper_mocks_generator(self):
+
+        def check():
+            # A function that asserts various things.
+            # Called twice, with different debug flag values.
+
+            @asyncio.coroutine
+            def coro():
+                # The actual coroutine.
+                self.assertTrue(gen.gi_running)
+                yield from fut
+
+            # A completed Future used to run the coroutine.
+            fut = asyncio.Future(loop=self.loop)
+            fut.set_result(None)
+
+            # Call the coroutine.
+            gen = coro()
+
+            # Check some properties.
+            self.assertTrue(asyncio.iscoroutine(gen))
+            self.assertIsInstance(gen.gi_frame, types.FrameType)
+            self.assertFalse(gen.gi_running)
+            self.assertIsInstance(gen.gi_code, types.CodeType)
+
+            # Run it.
+            self.loop.run_until_complete(gen)
+
+            # The frame should have changed.
+            self.assertIsNone(gen.gi_frame)
+
+        # Save debug flag.
+        old_debug = asyncio.coroutines._DEBUG
+        try:
+            # Test with debug flag cleared.
+            asyncio.coroutines._DEBUG = False
+            check()
+
+            # Test with debug flag set.
+            asyncio.coroutines._DEBUG = True
+            check()
+
+        finally:
+            # Restore original debug flag.
+            asyncio.coroutines._DEBUG = old_debug
+
+    def test_yield_from_corowrapper(self):
+        old_debug = asyncio.coroutines._DEBUG
+        asyncio.coroutines._DEBUG = True
+        try:
+            @asyncio.coroutine
+            def t1():
+                return (yield from t2())
+
+            @asyncio.coroutine
+            def t2():
+                f = asyncio.Future(loop=self.loop)
+                asyncio.Task(t3(f), loop=self.loop)
+                return (yield from f)
+
+            @asyncio.coroutine
+            def t3(f):
+                f.set_result((1, 2, 3))
+
+            task = asyncio.Task(t1(), loop=self.loop)
+            val = self.loop.run_until_complete(task)
+            self.assertEqual(val, (1, 2, 3))
+        finally:
+            asyncio.coroutines._DEBUG = old_debug
+
+    def test_yield_from_corowrapper_send(self):
+        def foo():
+            a = yield
+            return a
+
+        def call(arg):
+            cw = asyncio.coroutines.CoroWrapper(foo(), foo)
+            cw.send(None)
+            try:
+                cw.send(arg)
+            except StopIteration as ex:
+                return ex.args[0]
+            else:
+                raise AssertionError('StopIteration was expected')
+
+        self.assertEqual(call((1, 2)), (1, 2))
+        self.assertEqual(call('spam'), 'spam')
+
+    def test_corowrapper_weakref(self):
+        wd = weakref.WeakValueDictionary()
+        def foo(): yield from []
+        cw = asyncio.coroutines.CoroWrapper(foo(), foo)
+        wd['cw'] = cw  # Would fail without __weakref__ slot.
+        cw.gen = None  # Suppress warning from __del__.
+
+    @unittest.skipUnless(PY34,
+                         'need python 3.4 or later')
+    def test_log_destroyed_pending_task(self):
+        @asyncio.coroutine
+        def kill_me(loop):
+            future = asyncio.Future(loop=loop)
+            yield from future
+            # at this point, the only reference to kill_me() task is
+            # the Task._wakeup() method in future._callbacks
+            raise Exception("code never reached")
+
+        mock_handler = mock.Mock()
+        self.loop.set_debug(True)
+        self.loop.set_exception_handler(mock_handler)
+
+        # schedule the task
+        coro = kill_me(self.loop)
+        task = asyncio.async(coro, loop=self.loop)
+        self.assertEqual(asyncio.Task.all_tasks(loop=self.loop), {task})
+
+        # execute the task so it waits for future
+        self.loop._run_once()
+        self.assertEqual(len(self.loop._ready), 0)
+
+        # remove the future used in kill_me(), and references to the task
+        del coro.gi_frame.f_locals['future']
+        coro = None
+        source_traceback = task._source_traceback
+        task = None
+
+        # no more reference to kill_me() task: the task is destroyed by the GC
+        support.gc_collect()
+
+        self.assertEqual(asyncio.Task.all_tasks(loop=self.loop), set())
+
+        mock_handler.assert_called_with(self.loop, {
+            'message': 'Task was destroyed but it is pending!',
+            'task': mock.ANY,
+            'source_traceback': source_traceback,
+        })
+        mock_handler.reset_mock()
+
+    @mock.patch('asyncio.coroutines.logger')
+    def test_coroutine_never_yielded(self, m_log):
+        debug = asyncio.coroutines._DEBUG
+        try:
+            asyncio.coroutines._DEBUG = True
+            @asyncio.coroutine
+            def coro_noop():
+                pass
+        finally:
+            asyncio.coroutines._DEBUG = debug
+
+        tb_filename = __file__
+        tb_lineno = sys._getframe().f_lineno + 2
+        # create a coroutine object but don't use it
+        coro_noop()
+        support.gc_collect()
+
+        self.assertTrue(m_log.error.called)
+        message = m_log.error.call_args[0][0]
+        func_filename, func_lineno = test_utils.get_function_source(coro_noop)
+        regex = (r'^<CoroWrapper %s\(\) .* at %s:%s, .*> '
+                    r'was never yielded from\n'
+                 r'Coroutine object created at \(most recent call last\):\n'
+                 r'.*\n'
+                 r'  File "%s", line %s, in test_coroutine_never_yielded\n'
+                 r'    coro_noop\(\)$'
+                 % (re.escape(coro_noop.__qualname__),
+                    re.escape(func_filename), func_lineno,
+                    re.escape(tb_filename), tb_lineno))
+
+        self.assertRegex(message, re.compile(regex, re.DOTALL))
+
+    def test_task_source_traceback(self):
+        self.loop.set_debug(True)
+
+        task = asyncio.Task(coroutine_function(), loop=self.loop)
+        lineno = sys._getframe().f_lineno - 1
+        self.assertIsInstance(task._source_traceback, list)
+        self.assertEqual(task._source_traceback[-1][:3],
+                         (__file__,
+                          lineno,
+                          'test_task_source_traceback'))
+        self.loop.run_until_complete(task)
+
+    def _test_cancel_wait_for(self, timeout):
+        loop = asyncio.new_event_loop()
+        self.addCleanup(loop.close)
+
+        @asyncio.coroutine
+        def blocking_coroutine():
+            fut = asyncio.Future(loop=loop)
+            # Block: fut result is never set
+            yield from fut
+
+        task = loop.create_task(blocking_coroutine())
+
+        wait = loop.create_task(asyncio.wait_for(task, timeout, loop=loop))
+        loop.call_soon(wait.cancel)
+
+        self.assertRaises(asyncio.CancelledError,
+                          loop.run_until_complete, wait)
+
+        # Python issue #23219: cancelling the wait must also cancel the task
+        self.assertTrue(task.cancelled())
+
+    def test_cancel_blocking_wait_for(self):
+        self._test_cancel_wait_for(None)
+
+    def test_cancel_wait_for(self):
+        self._test_cancel_wait_for(60.0)
+
+
+class GatherTestsBase:
+
+    def setUp(self):
+        self.one_loop = self.new_test_loop()
+        self.other_loop = self.new_test_loop()
+        self.set_event_loop(self.one_loop, cleanup=False)
+
+    def _run_loop(self, loop):
+        while loop._ready:
+            test_utils.run_briefly(loop)
+
+    def _check_success(self, **kwargs):
+        a, b, c = [asyncio.Future(loop=self.one_loop) for i in range(3)]
+        fut = asyncio.gather(*self.wrap_futures(a, b, c), **kwargs)
+        cb = test_utils.MockCallback()
+        fut.add_done_callback(cb)
+        b.set_result(1)
+        a.set_result(2)
+        self._run_loop(self.one_loop)
+        self.assertEqual(cb.called, False)
+        self.assertFalse(fut.done())
+        c.set_result(3)
+        self._run_loop(self.one_loop)
+        cb.assert_called_once_with(fut)
+        self.assertEqual(fut.result(), [2, 1, 3])
+
+    def test_success(self):
+        self._check_success()
+        self._check_success(return_exceptions=False)
+
+    def test_result_exception_success(self):
+        self._check_success(return_exceptions=True)
+
+    def test_one_exception(self):
+        a, b, c, d, e = [asyncio.Future(loop=self.one_loop) for i in range(5)]
+        fut = asyncio.gather(*self.wrap_futures(a, b, c, d, e))
+        cb = test_utils.MockCallback()
+        fut.add_done_callback(cb)
+        exc = ZeroDivisionError()
+        a.set_result(1)
+        b.set_exception(exc)
+        self._run_loop(self.one_loop)
+        self.assertTrue(fut.done())
+        cb.assert_called_once_with(fut)
+        self.assertIs(fut.exception(), exc)
+        # Does nothing
+        c.set_result(3)
+        d.cancel()
+        e.set_exception(RuntimeError())
+        e.exception()
+
+    def test_return_exceptions(self):
+        a, b, c, d = [asyncio.Future(loop=self.one_loop) for i in range(4)]
+        fut = asyncio.gather(*self.wrap_futures(a, b, c, d),
+                             return_exceptions=True)
+        cb = test_utils.MockCallback()
+        fut.add_done_callback(cb)
+        exc = ZeroDivisionError()
+        exc2 = RuntimeError()
+        b.set_result(1)
+        c.set_exception(exc)
+        a.set_result(3)
+        self._run_loop(self.one_loop)
+        self.assertFalse(fut.done())
+        d.set_exception(exc2)
+        self._run_loop(self.one_loop)
+        self.assertTrue(fut.done())
+        cb.assert_called_once_with(fut)
+        self.assertEqual(fut.result(), [3, 1, exc, exc2])
+
+    def test_env_var_debug(self):
+        aio_path = os.path.dirname(os.path.dirname(asyncio.__file__))
+
+        code = '\n'.join((
+            'import asyncio.coroutines',
+            'print(asyncio.coroutines._DEBUG)'))
+
+        # Test with -E to not fail if the unit test was run with
+        # PYTHONASYNCIODEBUG set to a non-empty string
+        sts, stdout, stderr = assert_python_ok('-E', '-c', code,
+                                               PYTHONPATH=aio_path)
+        self.assertEqual(stdout.rstrip(), b'False')
+
+        sts, stdout, stderr = assert_python_ok('-c', code,
+                                               PYTHONASYNCIODEBUG='',
+                                               PYTHONPATH=aio_path)
+        self.assertEqual(stdout.rstrip(), b'False')
+
+        sts, stdout, stderr = assert_python_ok('-c', code,
+                                               PYTHONASYNCIODEBUG='1',
+                                               PYTHONPATH=aio_path)
+        self.assertEqual(stdout.rstrip(), b'True')
+
+        sts, stdout, stderr = assert_python_ok('-E', '-c', code,
+                                               PYTHONASYNCIODEBUG='1',
+                                               PYTHONPATH=aio_path)
+        self.assertEqual(stdout.rstrip(), b'False')
+
+
+class FutureGatherTests(GatherTestsBase, test_utils.TestCase):
+
+    def wrap_futures(self, *futures):
+        return futures
+
+    def _check_empty_sequence(self, seq_or_iter):
+        asyncio.set_event_loop(self.one_loop)
+        self.addCleanup(asyncio.set_event_loop, None)
+        fut = asyncio.gather(*seq_or_iter)
+        self.assertIsInstance(fut, asyncio.Future)
+        self.assertIs(fut._loop, self.one_loop)
+        self._run_loop(self.one_loop)
+        self.assertTrue(fut.done())
+        self.assertEqual(fut.result(), [])
+        fut = asyncio.gather(*seq_or_iter, loop=self.other_loop)
+        self.assertIs(fut._loop, self.other_loop)
+
+    def test_constructor_empty_sequence(self):
+        self._check_empty_sequence([])
+        self._check_empty_sequence(())
+        self._check_empty_sequence(set())
+        self._check_empty_sequence(iter(""))
+
+    def test_constructor_heterogenous_futures(self):
+        fut1 = asyncio.Future(loop=self.one_loop)
+        fut2 = asyncio.Future(loop=self.other_loop)
+        with self.assertRaises(ValueError):
+            asyncio.gather(fut1, fut2)
+        with self.assertRaises(ValueError):
+            asyncio.gather(fut1, loop=self.other_loop)
+
+    def test_constructor_homogenous_futures(self):
+        children = [asyncio.Future(loop=self.other_loop) for i in range(3)]
+        fut = asyncio.gather(*children)
+        self.assertIs(fut._loop, self.other_loop)
+        self._run_loop(self.other_loop)
+        self.assertFalse(fut.done())
+        fut = asyncio.gather(*children, loop=self.other_loop)
+        self.assertIs(fut._loop, self.other_loop)
+        self._run_loop(self.other_loop)
+        self.assertFalse(fut.done())
+
+    def test_one_cancellation(self):
+        a, b, c, d, e = [asyncio.Future(loop=self.one_loop) for i in range(5)]
+        fut = asyncio.gather(a, b, c, d, e)
+        cb = test_utils.MockCallback()
+        fut.add_done_callback(cb)
+        a.set_result(1)
+        b.cancel()
+        self._run_loop(self.one_loop)
+        self.assertTrue(fut.done())
+        cb.assert_called_once_with(fut)
+        self.assertFalse(fut.cancelled())
+        self.assertIsInstance(fut.exception(), asyncio.CancelledError)
+        # Does nothing
+        c.set_result(3)
+        d.cancel()
+        e.set_exception(RuntimeError())
+        e.exception()
+
+    def test_result_exception_one_cancellation(self):
+        a, b, c, d, e, f = [asyncio.Future(loop=self.one_loop)
+                            for i in range(6)]
+        fut = asyncio.gather(a, b, c, d, e, f, return_exceptions=True)
+        cb = test_utils.MockCallback()
+        fut.add_done_callback(cb)
+        a.set_result(1)
+        zde = ZeroDivisionError()
+        b.set_exception(zde)
+        c.cancel()
+        self._run_loop(self.one_loop)
+        self.assertFalse(fut.done())
+        d.set_result(3)
+        e.cancel()
+        rte = RuntimeError()
+        f.set_exception(rte)
+        res = self.one_loop.run_until_complete(fut)
+        self.assertIsInstance(res[2], asyncio.CancelledError)
+        self.assertIsInstance(res[4], asyncio.CancelledError)
+        res[2] = res[4] = None
+        self.assertEqual(res, [1, zde, None, 3, None, rte])
+        cb.assert_called_once_with(fut)
+
+
+class CoroutineGatherTests(GatherTestsBase, test_utils.TestCase):
+
+    def setUp(self):
+        super().setUp()
+        asyncio.set_event_loop(self.one_loop)
+
+    def wrap_futures(self, *futures):
+        coros = []
+        for fut in futures:
+            @asyncio.coroutine
+            def coro(fut=fut):
+                return (yield from fut)
+            coros.append(coro())
+        return coros
+
+    def test_constructor_loop_selection(self):
+        @asyncio.coroutine
+        def coro():
+            return 'abc'
+        gen1 = coro()
+        gen2 = coro()
+        fut = asyncio.gather(gen1, gen2)
+        self.assertIs(fut._loop, self.one_loop)
+        self.one_loop.run_until_complete(fut)
+
+        self.set_event_loop(self.other_loop, cleanup=False)
+        gen3 = coro()
+        gen4 = coro()
+        fut2 = asyncio.gather(gen3, gen4, loop=self.other_loop)
+        self.assertIs(fut2._loop, self.other_loop)
+        self.other_loop.run_until_complete(fut2)
+
+    def test_duplicate_coroutines(self):
+        @asyncio.coroutine
+        def coro(s):
+            return s
+        c = coro('abc')
+        fut = asyncio.gather(c, c, coro('def'), c, loop=self.one_loop)
+        self._run_loop(self.one_loop)
+        self.assertEqual(fut.result(), ['abc', 'abc', 'def', 'abc'])
+
+    def test_cancellation_broadcast(self):
+        # Cancelling outer() cancels all children.
+        proof = 0
+        waiter = asyncio.Future(loop=self.one_loop)
+
+        @asyncio.coroutine
+        def inner():
+            nonlocal proof
+            yield from waiter
+            proof += 1
+
+        child1 = asyncio.async(inner(), loop=self.one_loop)
+        child2 = asyncio.async(inner(), loop=self.one_loop)
+        gatherer = None
+
+        @asyncio.coroutine
+        def outer():
+            nonlocal proof, gatherer
+            gatherer = asyncio.gather(child1, child2, loop=self.one_loop)
+            yield from gatherer
+            proof += 100
+
+        f = asyncio.async(outer(), loop=self.one_loop)
+        test_utils.run_briefly(self.one_loop)
+        self.assertTrue(f.cancel())
+        with self.assertRaises(asyncio.CancelledError):
+            self.one_loop.run_until_complete(f)
+        self.assertFalse(gatherer.cancel())
+        self.assertTrue(waiter.cancelled())
+        self.assertTrue(child1.cancelled())
+        self.assertTrue(child2.cancelled())
+        test_utils.run_briefly(self.one_loop)
+        self.assertEqual(proof, 0)
+
+    def test_exception_marking(self):
+        # Test for the first line marked "Mark exception retrieved."
+
+        @asyncio.coroutine
+        def inner(f):
+            yield from f
+            raise RuntimeError('should not be ignored')
+
+        a = asyncio.Future(loop=self.one_loop)
+        b = asyncio.Future(loop=self.one_loop)
+
+        @asyncio.coroutine
+        def outer():
+            yield from asyncio.gather(inner(a), inner(b), loop=self.one_loop)
+
+        f = asyncio.async(outer(), loop=self.one_loop)
+        test_utils.run_briefly(self.one_loop)
+        a.set_result(None)
+        test_utils.run_briefly(self.one_loop)
+        b.set_result(None)
+        test_utils.run_briefly(self.one_loop)
+        self.assertIsInstance(f.exception(), RuntimeError)
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Lib/test/test_asyncio/test_transports.py b/Lib/test/test_asyncio/test_transports.py
new file mode 100644
index 0000000..3b6e3d6
--- /dev/null
+++ b/Lib/test/test_asyncio/test_transports.py
@@ -0,0 +1,91 @@
+"""Tests for transports.py."""
+
+import unittest
+from unittest import mock
+
+import asyncio
+from asyncio import transports
+
+
+class TransportTests(unittest.TestCase):
+
+    def test_ctor_extra_is_none(self):
+        transport = asyncio.Transport()
+        self.assertEqual(transport._extra, {})
+
+    def test_get_extra_info(self):
+        transport = asyncio.Transport({'extra': 'info'})
+        self.assertEqual('info', transport.get_extra_info('extra'))
+        self.assertIsNone(transport.get_extra_info('unknown'))
+
+        default = object()
+        self.assertIs(default, transport.get_extra_info('unknown', default))
+
+    def test_writelines(self):
+        transport = asyncio.Transport()
+        transport.write = mock.Mock()
+
+        transport.writelines([b'line1',
+                              bytearray(b'line2'),
+                              memoryview(b'line3')])
+        self.assertEqual(1, transport.write.call_count)
+        transport.write.assert_called_with(b'line1line2line3')
+
+    def test_not_implemented(self):
+        transport = asyncio.Transport()
+
+        self.assertRaises(NotImplementedError,
+                          transport.set_write_buffer_limits)
+        self.assertRaises(NotImplementedError, transport.get_write_buffer_size)
+        self.assertRaises(NotImplementedError, transport.write, 'data')
+        self.assertRaises(NotImplementedError, transport.write_eof)
+        self.assertRaises(NotImplementedError, transport.can_write_eof)
+        self.assertRaises(NotImplementedError, transport.pause_reading)
+        self.assertRaises(NotImplementedError, transport.resume_reading)
+        self.assertRaises(NotImplementedError, transport.close)
+        self.assertRaises(NotImplementedError, transport.abort)
+
+    def test_dgram_not_implemented(self):
+        transport = asyncio.DatagramTransport()
+
+        self.assertRaises(NotImplementedError, transport.sendto, 'data')
+        self.assertRaises(NotImplementedError, transport.abort)
+
+    def test_subprocess_transport_not_implemented(self):
+        transport = asyncio.SubprocessTransport()
+
+        self.assertRaises(NotImplementedError, transport.get_pid)
+        self.assertRaises(NotImplementedError, transport.get_returncode)
+        self.assertRaises(NotImplementedError, transport.get_pipe_transport, 1)
+        self.assertRaises(NotImplementedError, transport.send_signal, 1)
+        self.assertRaises(NotImplementedError, transport.terminate)
+        self.assertRaises(NotImplementedError, transport.kill)
+
+    def test_flowcontrol_mixin_set_write_limits(self):
+
+        class MyTransport(transports._FlowControlMixin,
+                          transports.Transport):
+
+            def get_write_buffer_size(self):
+                return 512
+
+        loop = mock.Mock()
+        transport = MyTransport(loop=loop)
+        transport._protocol = mock.Mock()
+
+        self.assertFalse(transport._protocol_paused)
+
+        with self.assertRaisesRegex(ValueError, 'high.*must be >= low'):
+            transport.set_write_buffer_limits(high=0, low=1)
+
+        transport.set_write_buffer_limits(high=1024, low=128)
+        self.assertFalse(transport._protocol_paused)
+        self.assertEqual(transport.get_write_buffer_limits(), (128, 1024))
+
+        transport.set_write_buffer_limits(high=256, low=128)
+        self.assertTrue(transport._protocol_paused)
+        self.assertEqual(transport.get_write_buffer_limits(), (128, 256))
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Lib/test/test_asyncio/test_unix_events.py b/Lib/test/test_asyncio/test_unix_events.py
new file mode 100644
index 0000000..41249ff
--- /dev/null
+++ b/Lib/test/test_asyncio/test_unix_events.py
@@ -0,0 +1,1561 @@
+"""Tests for unix_events.py."""
+
+import collections
+import errno
+import io
+import os
+import signal
+import socket
+import stat
+import sys
+import tempfile
+import threading
+import unittest
+from unittest import mock
+
+if sys.platform == 'win32':
+    raise unittest.SkipTest('UNIX only')
+
+
+import asyncio
+from asyncio import log
+from asyncio import test_utils
+from asyncio import unix_events
+
+
+MOCK_ANY = mock.ANY
+
+
+def close_pipe_transport(transport):
+    # Don't call transport.close() because the event loop and the selector
+    # are mocked
+    if transport._pipe is None:
+        return
+    transport._pipe.close()
+    transport._pipe = None
+
+
+@unittest.skipUnless(signal, 'Signals are not supported')
+class SelectorEventLoopSignalTests(test_utils.TestCase):
+
+    def setUp(self):
+        self.loop = asyncio.SelectorEventLoop()
+        self.set_event_loop(self.loop)
+
+    def test_check_signal(self):
+        self.assertRaises(
+            TypeError, self.loop._check_signal, '1')
+        self.assertRaises(
+            ValueError, self.loop._check_signal, signal.NSIG + 1)
+
+    def test_handle_signal_no_handler(self):
+        self.loop._handle_signal(signal.NSIG + 1)
+
+    def test_handle_signal_cancelled_handler(self):
+        h = asyncio.Handle(mock.Mock(), (),
+                           loop=mock.Mock())
+        h.cancel()
+        self.loop._signal_handlers[signal.NSIG + 1] = h
+        self.loop.remove_signal_handler = mock.Mock()
+        self.loop._handle_signal(signal.NSIG + 1)
+        self.loop.remove_signal_handler.assert_called_with(signal.NSIG + 1)
+
+    @mock.patch('asyncio.unix_events.signal')
+    def test_add_signal_handler_setup_error(self, m_signal):
+        m_signal.NSIG = signal.NSIG
+        m_signal.set_wakeup_fd.side_effect = ValueError
+
+        self.assertRaises(
+            RuntimeError,
+            self.loop.add_signal_handler,
+            signal.SIGINT, lambda: True)
+
+    @mock.patch('asyncio.unix_events.signal')
+    def test_add_signal_handler_coroutine_error(self, m_signal):
+        m_signal.NSIG = signal.NSIG
+
+        @asyncio.coroutine
+        def simple_coroutine():
+            yield from []
+
+        # callback must not be a coroutine function
+        coro_func = simple_coroutine
+        coro_obj = coro_func()
+        self.addCleanup(coro_obj.close)
+        for func in (coro_func, coro_obj):
+            self.assertRaisesRegex(
+                TypeError, 'coroutines cannot be used with add_signal_handler',
+                self.loop.add_signal_handler,
+                signal.SIGINT, func)
+
+    @mock.patch('asyncio.unix_events.signal')
+    def test_add_signal_handler(self, m_signal):
+        m_signal.NSIG = signal.NSIG
+
+        cb = lambda: True
+        self.loop.add_signal_handler(signal.SIGHUP, cb)
+        h = self.loop._signal_handlers.get(signal.SIGHUP)
+        self.assertIsInstance(h, asyncio.Handle)
+        self.assertEqual(h._callback, cb)
+
+    @mock.patch('asyncio.unix_events.signal')
+    def test_add_signal_handler_install_error(self, m_signal):
+        m_signal.NSIG = signal.NSIG
+
+        def set_wakeup_fd(fd):
+            if fd == -1:
+                raise ValueError()
+        m_signal.set_wakeup_fd = set_wakeup_fd
+
+        class Err(OSError):
+            errno = errno.EFAULT
+        m_signal.signal.side_effect = Err
+
+        self.assertRaises(
+            Err,
+            self.loop.add_signal_handler,
+            signal.SIGINT, lambda: True)
+
+    @mock.patch('asyncio.unix_events.signal')
+    @mock.patch('asyncio.base_events.logger')
+    def test_add_signal_handler_install_error2(self, m_logging, m_signal):
+        m_signal.NSIG = signal.NSIG
+
+        class Err(OSError):
+            errno = errno.EINVAL
+        m_signal.signal.side_effect = Err
+
+        self.loop._signal_handlers[signal.SIGHUP] = lambda: True
+        self.assertRaises(
+            RuntimeError,
+            self.loop.add_signal_handler,
+            signal.SIGINT, lambda: True)
+        self.assertFalse(m_logging.info.called)
+        self.assertEqual(1, m_signal.set_wakeup_fd.call_count)
+
+    @mock.patch('asyncio.unix_events.signal')
+    @mock.patch('asyncio.base_events.logger')
+    def test_add_signal_handler_install_error3(self, m_logging, m_signal):
+        class Err(OSError):
+            errno = errno.EINVAL
+        m_signal.signal.side_effect = Err
+        m_signal.NSIG = signal.NSIG
+
+        self.assertRaises(
+            RuntimeError,
+            self.loop.add_signal_handler,
+            signal.SIGINT, lambda: True)
+        self.assertFalse(m_logging.info.called)
+        self.assertEqual(2, m_signal.set_wakeup_fd.call_count)
+
+    @mock.patch('asyncio.unix_events.signal')
+    def test_remove_signal_handler(self, m_signal):
+        m_signal.NSIG = signal.NSIG
+
+        self.loop.add_signal_handler(signal.SIGHUP, lambda: True)
+
+        self.assertTrue(
+            self.loop.remove_signal_handler(signal.SIGHUP))
+        self.assertTrue(m_signal.set_wakeup_fd.called)
+        self.assertTrue(m_signal.signal.called)
+        self.assertEqual(
+            (signal.SIGHUP, m_signal.SIG_DFL), m_signal.signal.call_args[0])
+
+    @mock.patch('asyncio.unix_events.signal')
+    def test_remove_signal_handler_2(self, m_signal):
+        m_signal.NSIG = signal.NSIG
+        m_signal.SIGINT = signal.SIGINT
+
+        self.loop.add_signal_handler(signal.SIGINT, lambda: True)
+        self.loop._signal_handlers[signal.SIGHUP] = object()
+        m_signal.set_wakeup_fd.reset_mock()
+
+        self.assertTrue(
+            self.loop.remove_signal_handler(signal.SIGINT))
+        self.assertFalse(m_signal.set_wakeup_fd.called)
+        self.assertTrue(m_signal.signal.called)
+        self.assertEqual(
+            (signal.SIGINT, m_signal.default_int_handler),
+            m_signal.signal.call_args[0])
+
+    @mock.patch('asyncio.unix_events.signal')
+    @mock.patch('asyncio.base_events.logger')
+    def test_remove_signal_handler_cleanup_error(self, m_logging, m_signal):
+        m_signal.NSIG = signal.NSIG
+        self.loop.add_signal_handler(signal.SIGHUP, lambda: True)
+
+        m_signal.set_wakeup_fd.side_effect = ValueError
+
+        self.loop.remove_signal_handler(signal.SIGHUP)
+        self.assertTrue(m_logging.info)
+
+    @mock.patch('asyncio.unix_events.signal')
+    def test_remove_signal_handler_error(self, m_signal):
+        m_signal.NSIG = signal.NSIG
+        self.loop.add_signal_handler(signal.SIGHUP, lambda: True)
+
+        m_signal.signal.side_effect = OSError
+
+        self.assertRaises(
+            OSError, self.loop.remove_signal_handler, signal.SIGHUP)
+
+    @mock.patch('asyncio.unix_events.signal')
+    def test_remove_signal_handler_error2(self, m_signal):
+        m_signal.NSIG = signal.NSIG
+        self.loop.add_signal_handler(signal.SIGHUP, lambda: True)
+
+        class Err(OSError):
+            errno = errno.EINVAL
+        m_signal.signal.side_effect = Err
+
+        self.assertRaises(
+            RuntimeError, self.loop.remove_signal_handler, signal.SIGHUP)
+
+    @mock.patch('asyncio.unix_events.signal')
+    def test_close(self, m_signal):
+        m_signal.NSIG = signal.NSIG
+
+        self.loop.add_signal_handler(signal.SIGHUP, lambda: True)
+        self.loop.add_signal_handler(signal.SIGCHLD, lambda: True)
+
+        self.assertEqual(len(self.loop._signal_handlers), 2)
+
+        m_signal.set_wakeup_fd.reset_mock()
+
+        self.loop.close()
+
+        self.assertEqual(len(self.loop._signal_handlers), 0)
+        m_signal.set_wakeup_fd.assert_called_once_with(-1)
+
+
+@unittest.skipUnless(hasattr(socket, 'AF_UNIX'),
+                     'UNIX Sockets are not supported')
+class SelectorEventLoopUnixSocketTests(test_utils.TestCase):
+
+    def setUp(self):
+        self.loop = asyncio.SelectorEventLoop()
+        self.set_event_loop(self.loop)
+
+    def test_create_unix_server_existing_path_sock(self):
+        with test_utils.unix_socket_path() as path:
+            sock = socket.socket(socket.AF_UNIX)
+            sock.bind(path)
+            with sock:
+                coro = self.loop.create_unix_server(lambda: None, path)
+                with self.assertRaisesRegex(OSError,
+                                            'Address.*is already in use'):
+                    self.loop.run_until_complete(coro)
+
+    def test_create_unix_server_existing_path_nonsock(self):
+        with tempfile.NamedTemporaryFile() as file:
+            coro = self.loop.create_unix_server(lambda: None, file.name)
+            with self.assertRaisesRegex(OSError,
+                                        'Address.*is already in use'):
+                self.loop.run_until_complete(coro)
+
+    def test_create_unix_server_ssl_bool(self):
+        coro = self.loop.create_unix_server(lambda: None, path='spam',
+                                            ssl=True)
+        with self.assertRaisesRegex(TypeError,
+                                    'ssl argument must be an SSLContext'):
+            self.loop.run_until_complete(coro)
+
+    def test_create_unix_server_nopath_nosock(self):
+        coro = self.loop.create_unix_server(lambda: None, path=None)
+        with self.assertRaisesRegex(ValueError,
+                                    'path was not specified, and no sock'):
+            self.loop.run_until_complete(coro)
+
+    def test_create_unix_server_path_inetsock(self):
+        sock = socket.socket()
+        with sock:
+            coro = self.loop.create_unix_server(lambda: None, path=None,
+                                                sock=sock)
+            with self.assertRaisesRegex(ValueError,
+                                        'A UNIX Domain Socket was expected'):
+                self.loop.run_until_complete(coro)
+
+    @mock.patch('asyncio.unix_events.socket')
+    def test_create_unix_server_bind_error(self, m_socket):
+        # Ensure that the socket is closed on any bind error
+        sock = mock.Mock()
+        m_socket.socket.return_value = sock
+
+        sock.bind.side_effect = OSError
+        coro = self.loop.create_unix_server(lambda: None, path="/test")
+        with self.assertRaises(OSError):
+            self.loop.run_until_complete(coro)
+        self.assertTrue(sock.close.called)
+
+        sock.bind.side_effect = MemoryError
+        coro = self.loop.create_unix_server(lambda: None, path="/test")
+        with self.assertRaises(MemoryError):
+            self.loop.run_until_complete(coro)
+        self.assertTrue(sock.close.called)
+
+    def test_create_unix_connection_path_sock(self):
+        coro = self.loop.create_unix_connection(
+            lambda: None, '/dev/null', sock=object())
+        with self.assertRaisesRegex(ValueError, 'path and sock can not be'):
+            self.loop.run_until_complete(coro)
+
+    def test_create_unix_connection_nopath_nosock(self):
+        coro = self.loop.create_unix_connection(
+            lambda: None, None)
+        with self.assertRaisesRegex(ValueError,
+                                    'no path and sock were specified'):
+            self.loop.run_until_complete(coro)
+
+    def test_create_unix_connection_nossl_serverhost(self):
+        coro = self.loop.create_unix_connection(
+            lambda: None, '/dev/null', server_hostname='spam')
+        with self.assertRaisesRegex(ValueError,
+                                    'server_hostname is only meaningful'):
+            self.loop.run_until_complete(coro)
+
+    def test_create_unix_connection_ssl_noserverhost(self):
+        coro = self.loop.create_unix_connection(
+            lambda: None, '/dev/null', ssl=True)
+
+        with self.assertRaisesRegex(
+            ValueError, 'you have to pass server_hostname when using ssl'):
+
+            self.loop.run_until_complete(coro)
+
+
+class UnixReadPipeTransportTests(test_utils.TestCase):
+
+    def setUp(self):
+        self.loop = self.new_test_loop()
+        self.protocol = test_utils.make_test_protocol(asyncio.Protocol)
+        self.pipe = mock.Mock(spec_set=io.RawIOBase)
+        self.pipe.fileno.return_value = 5
+
+        blocking_patcher = mock.patch('asyncio.unix_events._set_nonblocking')
+        blocking_patcher.start()
+        self.addCleanup(blocking_patcher.stop)
+
+        fstat_patcher = mock.patch('os.fstat')
+        m_fstat = fstat_patcher.start()
+        st = mock.Mock()
+        st.st_mode = stat.S_IFIFO
+        m_fstat.return_value = st
+        self.addCleanup(fstat_patcher.stop)
+
+    def read_pipe_transport(self, waiter=None):
+        transport = unix_events._UnixReadPipeTransport(self.loop, self.pipe,
+                                                       self.protocol,
+                                                       waiter=waiter)
+        self.addCleanup(close_pipe_transport, transport)
+        return transport
+
+    def test_ctor(self):
+        waiter = asyncio.Future(loop=self.loop)
+        tr = self.read_pipe_transport(waiter=waiter)
+        self.loop.run_until_complete(waiter)
+
+        self.protocol.connection_made.assert_called_with(tr)
+        self.loop.assert_reader(5, tr._read_ready)
+        self.assertIsNone(waiter.result())
+
+    @mock.patch('os.read')
+    def test__read_ready(self, m_read):
+        tr = self.read_pipe_transport()
+        m_read.return_value = b'data'
+        tr._read_ready()
+
+        m_read.assert_called_with(5, tr.max_size)
+        self.protocol.data_received.assert_called_with(b'data')
+
+    @mock.patch('os.read')
+    def test__read_ready_eof(self, m_read):
+        tr = self.read_pipe_transport()
+        m_read.return_value = b''
+        tr._read_ready()
+
+        m_read.assert_called_with(5, tr.max_size)
+        self.assertFalse(self.loop.readers)
+        test_utils.run_briefly(self.loop)
+        self.protocol.eof_received.assert_called_with()
+        self.protocol.connection_lost.assert_called_with(None)
+
+    @mock.patch('os.read')
+    def test__read_ready_blocked(self, m_read):
+        tr = self.read_pipe_transport()
+        m_read.side_effect = BlockingIOError
+        tr._read_ready()
+
+        m_read.assert_called_with(5, tr.max_size)
+        test_utils.run_briefly(self.loop)
+        self.assertFalse(self.protocol.data_received.called)
+
+    @mock.patch('asyncio.log.logger.error')
+    @mock.patch('os.read')
+    def test__read_ready_error(self, m_read, m_logexc):
+        tr = self.read_pipe_transport()
+        err = OSError()
+        m_read.side_effect = err
+        tr._close = mock.Mock()
+        tr._read_ready()
+
+        m_read.assert_called_with(5, tr.max_size)
+        tr._close.assert_called_with(err)
+        m_logexc.assert_called_with(
+            test_utils.MockPattern(
+                'Fatal read error on pipe transport'
+                '\nprotocol:.*\ntransport:.*'),
+            exc_info=(OSError, MOCK_ANY, MOCK_ANY))
+
+    @mock.patch('os.read')
+    def test_pause_reading(self, m_read):
+        tr = self.read_pipe_transport()
+        m = mock.Mock()
+        self.loop.add_reader(5, m)
+        tr.pause_reading()
+        self.assertFalse(self.loop.readers)
+
+    @mock.patch('os.read')
+    def test_resume_reading(self, m_read):
+        tr = self.read_pipe_transport()
+        tr.resume_reading()
+        self.loop.assert_reader(5, tr._read_ready)
+
+    @mock.patch('os.read')
+    def test_close(self, m_read):
+        tr = self.read_pipe_transport()
+        tr._close = mock.Mock()
+        tr.close()
+        tr._close.assert_called_with(None)
+
+    @mock.patch('os.read')
+    def test_close_already_closing(self, m_read):
+        tr = self.read_pipe_transport()
+        tr._closing = True
+        tr._close = mock.Mock()
+        tr.close()
+        self.assertFalse(tr._close.called)
+
+    @mock.patch('os.read')
+    def test__close(self, m_read):
+        tr = self.read_pipe_transport()
+        err = object()
+        tr._close(err)
+        self.assertTrue(tr._closing)
+        self.assertFalse(self.loop.readers)
+        test_utils.run_briefly(self.loop)
+        self.protocol.connection_lost.assert_called_with(err)
+
+    def test__call_connection_lost(self):
+        tr = self.read_pipe_transport()
+        self.assertIsNotNone(tr._protocol)
+        self.assertIsNotNone(tr._loop)
+
+        err = None
+        tr._call_connection_lost(err)
+        self.protocol.connection_lost.assert_called_with(err)
+        self.pipe.close.assert_called_with()
+
+        self.assertIsNone(tr._protocol)
+        self.assertIsNone(tr._loop)
+
+    def test__call_connection_lost_with_err(self):
+        tr = self.read_pipe_transport()
+        self.assertIsNotNone(tr._protocol)
+        self.assertIsNotNone(tr._loop)
+
+        err = OSError()
+        tr._call_connection_lost(err)
+        self.protocol.connection_lost.assert_called_with(err)
+        self.pipe.close.assert_called_with()
+
+        self.assertIsNone(tr._protocol)
+        self.assertIsNone(tr._loop)
+
+
+class UnixWritePipeTransportTests(test_utils.TestCase):
+
+    def setUp(self):
+        self.loop = self.new_test_loop()
+        self.protocol = test_utils.make_test_protocol(asyncio.BaseProtocol)
+        self.pipe = mock.Mock(spec_set=io.RawIOBase)
+        self.pipe.fileno.return_value = 5
+
+        blocking_patcher = mock.patch('asyncio.unix_events._set_nonblocking')
+        blocking_patcher.start()
+        self.addCleanup(blocking_patcher.stop)
+
+        fstat_patcher = mock.patch('os.fstat')
+        m_fstat = fstat_patcher.start()
+        st = mock.Mock()
+        st.st_mode = stat.S_IFSOCK
+        m_fstat.return_value = st
+        self.addCleanup(fstat_patcher.stop)
+
+    def write_pipe_transport(self, waiter=None):
+        transport = unix_events._UnixWritePipeTransport(self.loop, self.pipe,
+                                                        self.protocol,
+                                                        waiter=waiter)
+        self.addCleanup(close_pipe_transport, transport)
+        return transport
+
+    def test_ctor(self):
+        waiter = asyncio.Future(loop=self.loop)
+        tr = self.write_pipe_transport(waiter=waiter)
+        self.loop.run_until_complete(waiter)
+
+        self.protocol.connection_made.assert_called_with(tr)
+        self.loop.assert_reader(5, tr._read_ready)
+        self.assertEqual(None, waiter.result())
+
+    def test_can_write_eof(self):
+        tr = self.write_pipe_transport()
+        self.assertTrue(tr.can_write_eof())
+
+    @mock.patch('os.write')
+    def test_write(self, m_write):
+        tr = self.write_pipe_transport()
+        m_write.return_value = 4
+        tr.write(b'data')
+        m_write.assert_called_with(5, b'data')
+        self.assertFalse(self.loop.writers)
+        self.assertEqual([], tr._buffer)
+
+    @mock.patch('os.write')
+    def test_write_no_data(self, m_write):
+        tr = self.write_pipe_transport()
+        tr.write(b'')
+        self.assertFalse(m_write.called)
+        self.assertFalse(self.loop.writers)
+        self.assertEqual([], tr._buffer)
+
+    @mock.patch('os.write')
+    def test_write_partial(self, m_write):
+        tr = self.write_pipe_transport()
+        m_write.return_value = 2
+        tr.write(b'data')
+        m_write.assert_called_with(5, b'data')
+        self.loop.assert_writer(5, tr._write_ready)
+        self.assertEqual([b'ta'], tr._buffer)
+
+    @mock.patch('os.write')
+    def test_write_buffer(self, m_write):
+        tr = self.write_pipe_transport()
+        self.loop.add_writer(5, tr._write_ready)
+        tr._buffer = [b'previous']
+        tr.write(b'data')
+        self.assertFalse(m_write.called)
+        self.loop.assert_writer(5, tr._write_ready)
+        self.assertEqual([b'previous', b'data'], tr._buffer)
+
+    @mock.patch('os.write')
+    def test_write_again(self, m_write):
+        tr = self.write_pipe_transport()
+        m_write.side_effect = BlockingIOError()
+        tr.write(b'data')
+        m_write.assert_called_with(5, b'data')
+        self.loop.assert_writer(5, tr._write_ready)
+        self.assertEqual([b'data'], tr._buffer)
+
+    @mock.patch('asyncio.unix_events.logger')
+    @mock.patch('os.write')
+    def test_write_err(self, m_write, m_log):
+        tr = self.write_pipe_transport()
+        err = OSError()
+        m_write.side_effect = err
+        tr._fatal_error = mock.Mock()
+        tr.write(b'data')
+        m_write.assert_called_with(5, b'data')
+        self.assertFalse(self.loop.writers)
+        self.assertEqual([], tr._buffer)
+        tr._fatal_error.assert_called_with(
+                            err,
+                            'Fatal write error on pipe transport')
+        self.assertEqual(1, tr._conn_lost)
+
+        tr.write(b'data')
+        self.assertEqual(2, tr._conn_lost)
+        tr.write(b'data')
+        tr.write(b'data')
+        tr.write(b'data')
+        tr.write(b'data')
+        # This is a bit overspecified. :-(
+        m_log.warning.assert_called_with(
+            'pipe closed by peer or os.write(pipe, data) raised exception.')
+        tr.close()
+
+    @mock.patch('os.write')
+    def test_write_close(self, m_write):
+        tr = self.write_pipe_transport()
+        tr._read_ready()  # pipe was closed by peer
+
+        tr.write(b'data')
+        self.assertEqual(tr._conn_lost, 1)
+        tr.write(b'data')
+        self.assertEqual(tr._conn_lost, 2)
+
+    def test__read_ready(self):
+        tr = self.write_pipe_transport()
+        tr._read_ready()
+        self.assertFalse(self.loop.readers)
+        self.assertFalse(self.loop.writers)
+        self.assertTrue(tr._closing)
+        test_utils.run_briefly(self.loop)
+        self.protocol.connection_lost.assert_called_with(None)
+
+    @mock.patch('os.write')
+    def test__write_ready(self, m_write):
+        tr = self.write_pipe_transport()
+        self.loop.add_writer(5, tr._write_ready)
+        tr._buffer = [b'da', b'ta']
+        m_write.return_value = 4
+        tr._write_ready()
+        m_write.assert_called_with(5, b'data')
+        self.assertFalse(self.loop.writers)
+        self.assertEqual([], tr._buffer)
+
+    @mock.patch('os.write')
+    def test__write_ready_partial(self, m_write):
+        tr = self.write_pipe_transport()
+        self.loop.add_writer(5, tr._write_ready)
+        tr._buffer = [b'da', b'ta']
+        m_write.return_value = 3
+        tr._write_ready()
+        m_write.assert_called_with(5, b'data')
+        self.loop.assert_writer(5, tr._write_ready)
+        self.assertEqual([b'a'], tr._buffer)
+
+    @mock.patch('os.write')
+    def test__write_ready_again(self, m_write):
+        tr = self.write_pipe_transport()
+        self.loop.add_writer(5, tr._write_ready)
+        tr._buffer = [b'da', b'ta']
+        m_write.side_effect = BlockingIOError()
+        tr._write_ready()
+        m_write.assert_called_with(5, b'data')
+        self.loop.assert_writer(5, tr._write_ready)
+        self.assertEqual([b'data'], tr._buffer)
+
+    @mock.patch('os.write')
+    def test__write_ready_empty(self, m_write):
+        tr = self.write_pipe_transport()
+        self.loop.add_writer(5, tr._write_ready)
+        tr._buffer = [b'da', b'ta']
+        m_write.return_value = 0
+        tr._write_ready()
+        m_write.assert_called_with(5, b'data')
+        self.loop.assert_writer(5, tr._write_ready)
+        self.assertEqual([b'data'], tr._buffer)
+
+    @mock.patch('asyncio.log.logger.error')
+    @mock.patch('os.write')
+    def test__write_ready_err(self, m_write, m_logexc):
+        tr = self.write_pipe_transport()
+        self.loop.add_writer(5, tr._write_ready)
+        tr._buffer = [b'da', b'ta']
+        m_write.side_effect = err = OSError()
+        tr._write_ready()
+        m_write.assert_called_with(5, b'data')
+        self.assertFalse(self.loop.writers)
+        self.assertFalse(self.loop.readers)
+        self.assertEqual([], tr._buffer)
+        self.assertTrue(tr._closing)
+        m_logexc.assert_called_with(
+            test_utils.MockPattern(
+                'Fatal write error on pipe transport'
+                '\nprotocol:.*\ntransport:.*'),
+            exc_info=(OSError, MOCK_ANY, MOCK_ANY))
+        self.assertEqual(1, tr._conn_lost)
+        test_utils.run_briefly(self.loop)
+        self.protocol.connection_lost.assert_called_with(err)
+
+    @mock.patch('os.write')
+    def test__write_ready_closing(self, m_write):
+        tr = self.write_pipe_transport()
+        self.loop.add_writer(5, tr._write_ready)
+        tr._closing = True
+        tr._buffer = [b'da', b'ta']
+        m_write.return_value = 4
+        tr._write_ready()
+        m_write.assert_called_with(5, b'data')
+        self.assertFalse(self.loop.writers)
+        self.assertFalse(self.loop.readers)
+        self.assertEqual([], tr._buffer)
+        self.protocol.connection_lost.assert_called_with(None)
+        self.pipe.close.assert_called_with()
+
+    @mock.patch('os.write')
+    def test_abort(self, m_write):
+        tr = self.write_pipe_transport()
+        self.loop.add_writer(5, tr._write_ready)
+        self.loop.add_reader(5, tr._read_ready)
+        tr._buffer = [b'da', b'ta']
+        tr.abort()
+        self.assertFalse(m_write.called)
+        self.assertFalse(self.loop.readers)
+        self.assertFalse(self.loop.writers)
+        self.assertEqual([], tr._buffer)
+        self.assertTrue(tr._closing)
+        test_utils.run_briefly(self.loop)
+        self.protocol.connection_lost.assert_called_with(None)
+
+    def test__call_connection_lost(self):
+        tr = self.write_pipe_transport()
+        self.assertIsNotNone(tr._protocol)
+        self.assertIsNotNone(tr._loop)
+
+        err = None
+        tr._call_connection_lost(err)
+        self.protocol.connection_lost.assert_called_with(err)
+        self.pipe.close.assert_called_with()
+
+        self.assertIsNone(tr._protocol)
+        self.assertIsNone(tr._loop)
+
+    def test__call_connection_lost_with_err(self):
+        tr = self.write_pipe_transport()
+        self.assertIsNotNone(tr._protocol)
+        self.assertIsNotNone(tr._loop)
+
+        err = OSError()
+        tr._call_connection_lost(err)
+        self.protocol.connection_lost.assert_called_with(err)
+        self.pipe.close.assert_called_with()
+
+        self.assertIsNone(tr._protocol)
+        self.assertIsNone(tr._loop)
+
+    def test_close(self):
+        tr = self.write_pipe_transport()
+        tr.write_eof = mock.Mock()
+        tr.close()
+        tr.write_eof.assert_called_with()
+
+        # closing the transport twice must not fail
+        tr.close()
+
+    def test_close_closing(self):
+        tr = self.write_pipe_transport()
+        tr.write_eof = mock.Mock()
+        tr._closing = True
+        tr.close()
+        self.assertFalse(tr.write_eof.called)
+
+    def test_write_eof(self):
+        tr = self.write_pipe_transport()
+        tr.write_eof()
+        self.assertTrue(tr._closing)
+        self.assertFalse(self.loop.readers)
+        test_utils.run_briefly(self.loop)
+        self.protocol.connection_lost.assert_called_with(None)
+
+    def test_write_eof_pending(self):
+        tr = self.write_pipe_transport()
+        tr._buffer = [b'data']
+        tr.write_eof()
+        self.assertTrue(tr._closing)
+        self.assertFalse(self.protocol.connection_lost.called)
+
+
+class AbstractChildWatcherTests(unittest.TestCase):
+
+    def test_not_implemented(self):
+        f = mock.Mock()
+        watcher = asyncio.AbstractChildWatcher()
+        self.assertRaises(
+            NotImplementedError, watcher.add_child_handler, f, f)
+        self.assertRaises(
+            NotImplementedError, watcher.remove_child_handler, f)
+        self.assertRaises(
+            NotImplementedError, watcher.attach_loop, f)
+        self.assertRaises(
+            NotImplementedError, watcher.close)
+        self.assertRaises(
+            NotImplementedError, watcher.__enter__)
+        self.assertRaises(
+            NotImplementedError, watcher.__exit__, f, f, f)
+
+
+class BaseChildWatcherTests(unittest.TestCase):
+
+    def test_not_implemented(self):
+        f = mock.Mock()
+        watcher = unix_events.BaseChildWatcher()
+        self.assertRaises(
+            NotImplementedError, watcher._do_waitpid, f)
+
+
+WaitPidMocks = collections.namedtuple("WaitPidMocks",
+                                      ("waitpid",
+                                       "WIFEXITED",
+                                       "WIFSIGNALED",
+                                       "WEXITSTATUS",
+                                       "WTERMSIG",
+                                       ))
+
+
+class ChildWatcherTestsMixin:
+
+    ignore_warnings = mock.patch.object(log.logger, "warning")
+
+    def setUp(self):
+        self.loop = self.new_test_loop()
+        self.running = False
+        self.zombies = {}
+
+        with mock.patch.object(
+                self.loop, "add_signal_handler") as self.m_add_signal_handler:
+            self.watcher = self.create_watcher()
+            self.watcher.attach_loop(self.loop)
+
+    def waitpid(self, pid, flags):
+        if isinstance(self.watcher, asyncio.SafeChildWatcher) or pid != -1:
+            self.assertGreater(pid, 0)
+        try:
+            if pid < 0:
+                return self.zombies.popitem()
+            else:
+                return pid, self.zombies.pop(pid)
+        except KeyError:
+            pass
+        if self.running:
+            return 0, 0
+        else:
+            raise ChildProcessError()
+
+    def add_zombie(self, pid, returncode):
+        self.zombies[pid] = returncode + 32768
+
+    def WIFEXITED(self, status):
+        return status >= 32768
+
+    def WIFSIGNALED(self, status):
+        return 32700 < status < 32768
+
+    def WEXITSTATUS(self, status):
+        self.assertTrue(self.WIFEXITED(status))
+        return status - 32768
+
+    def WTERMSIG(self, status):
+        self.assertTrue(self.WIFSIGNALED(status))
+        return 32768 - status
+
+    def test_create_watcher(self):
+        self.m_add_signal_handler.assert_called_once_with(
+            signal.SIGCHLD, self.watcher._sig_chld)
+
+    def waitpid_mocks(func):
+        def wrapped_func(self):
+            def patch(target, wrapper):
+                return mock.patch(target, wraps=wrapper,
+                                  new_callable=mock.Mock)
+
+            with patch('os.WTERMSIG', self.WTERMSIG) as m_WTERMSIG, \
+                 patch('os.WEXITSTATUS', self.WEXITSTATUS) as m_WEXITSTATUS, \
+                 patch('os.WIFSIGNALED', self.WIFSIGNALED) as m_WIFSIGNALED, \
+                 patch('os.WIFEXITED', self.WIFEXITED) as m_WIFEXITED, \
+                 patch('os.waitpid', self.waitpid) as m_waitpid:
+                func(self, WaitPidMocks(m_waitpid,
+                                        m_WIFEXITED, m_WIFSIGNALED,
+                                        m_WEXITSTATUS, m_WTERMSIG,
+                                        ))
+        return wrapped_func
+
+    @waitpid_mocks
+    def test_sigchld(self, m):
+        # register a child
+        callback = mock.Mock()
+
+        with self.watcher:
+            self.running = True
+            self.watcher.add_child_handler(42, callback, 9, 10, 14)
+
+        self.assertFalse(callback.called)
+        self.assertFalse(m.WIFEXITED.called)
+        self.assertFalse(m.WIFSIGNALED.called)
+        self.assertFalse(m.WEXITSTATUS.called)
+        self.assertFalse(m.WTERMSIG.called)
+
+        # child is running
+        self.watcher._sig_chld()
+
+        self.assertFalse(callback.called)
+        self.assertFalse(m.WIFEXITED.called)
+        self.assertFalse(m.WIFSIGNALED.called)
+        self.assertFalse(m.WEXITSTATUS.called)
+        self.assertFalse(m.WTERMSIG.called)
+
+        # child terminates (returncode 12)
+        self.running = False
+        self.add_zombie(42, 12)
+        self.watcher._sig_chld()
+
+        self.assertTrue(m.WIFEXITED.called)
+        self.assertTrue(m.WEXITSTATUS.called)
+        self.assertFalse(m.WTERMSIG.called)
+        callback.assert_called_once_with(42, 12, 9, 10, 14)
+
+        m.WIFSIGNALED.reset_mock()
+        m.WIFEXITED.reset_mock()
+        m.WEXITSTATUS.reset_mock()
+        callback.reset_mock()
+
+        # ensure that the child is effectively reaped
+        self.add_zombie(42, 13)
+        with self.ignore_warnings:
+            self.watcher._sig_chld()
+
+        self.assertFalse(callback.called)
+        self.assertFalse(m.WTERMSIG.called)
+
+        m.WIFSIGNALED.reset_mock()
+        m.WIFEXITED.reset_mock()
+        m.WEXITSTATUS.reset_mock()
+
+        # sigchld called again
+        self.zombies.clear()
+        self.watcher._sig_chld()
+
+        self.assertFalse(callback.called)
+        self.assertFalse(m.WIFEXITED.called)
+        self.assertFalse(m.WIFSIGNALED.called)
+        self.assertFalse(m.WEXITSTATUS.called)
+        self.assertFalse(m.WTERMSIG.called)
+
+    @waitpid_mocks
+    def test_sigchld_two_children(self, m):
+        callback1 = mock.Mock()
+        callback2 = mock.Mock()
+
+        # register child 1
+        with self.watcher:
+            self.running = True
+            self.watcher.add_child_handler(43, callback1, 7, 8)
+
+        self.assertFalse(callback1.called)
+        self.assertFalse(callback2.called)
+        self.assertFalse(m.WIFEXITED.called)
+        self.assertFalse(m.WIFSIGNALED.called)
+        self.assertFalse(m.WEXITSTATUS.called)
+        self.assertFalse(m.WTERMSIG.called)
+
+        # register child 2
+        with self.watcher:
+            self.watcher.add_child_handler(44, callback2, 147, 18)
+
+        self.assertFalse(callback1.called)
+        self.assertFalse(callback2.called)
+        self.assertFalse(m.WIFEXITED.called)
+        self.assertFalse(m.WIFSIGNALED.called)
+        self.assertFalse(m.WEXITSTATUS.called)
+        self.assertFalse(m.WTERMSIG.called)
+
+        # children are running
+        self.watcher._sig_chld()
+
+        self.assertFalse(callback1.called)
+        self.assertFalse(callback2.called)
+        self.assertFalse(m.WIFEXITED.called)
+        self.assertFalse(m.WIFSIGNALED.called)
+        self.assertFalse(m.WEXITSTATUS.called)
+        self.assertFalse(m.WTERMSIG.called)
+
+        # child 1 terminates (signal 3)
+        self.add_zombie(43, -3)
+        self.watcher._sig_chld()
+
+        callback1.assert_called_once_with(43, -3, 7, 8)
+        self.assertFalse(callback2.called)
+        self.assertTrue(m.WIFSIGNALED.called)
+        self.assertFalse(m.WEXITSTATUS.called)
+        self.assertTrue(m.WTERMSIG.called)
+
+        m.WIFSIGNALED.reset_mock()
+        m.WIFEXITED.reset_mock()
+        m.WTERMSIG.reset_mock()
+        callback1.reset_mock()
+
+        # child 2 still running
+        self.watcher._sig_chld()
+
+        self.assertFalse(callback1.called)
+        self.assertFalse(callback2.called)
+        self.assertFalse(m.WIFEXITED.called)
+        self.assertFalse(m.WIFSIGNALED.called)
+        self.assertFalse(m.WEXITSTATUS.called)
+        self.assertFalse(m.WTERMSIG.called)
+
+        # child 2 terminates (code 108)
+        self.add_zombie(44, 108)
+        self.running = False
+        self.watcher._sig_chld()
+
+        callback2.assert_called_once_with(44, 108, 147, 18)
+        self.assertFalse(callback1.called)
+        self.assertTrue(m.WIFEXITED.called)
+        self.assertTrue(m.WEXITSTATUS.called)
+        self.assertFalse(m.WTERMSIG.called)
+
+        m.WIFSIGNALED.reset_mock()
+        m.WIFEXITED.reset_mock()
+        m.WEXITSTATUS.reset_mock()
+        callback2.reset_mock()
+
+        # ensure that the children are effectively reaped
+        self.add_zombie(43, 14)
+        self.add_zombie(44, 15)
+        with self.ignore_warnings:
+            self.watcher._sig_chld()
+
+        self.assertFalse(callback1.called)
+        self.assertFalse(callback2.called)
+        self.assertFalse(m.WTERMSIG.called)
+
+        m.WIFSIGNALED.reset_mock()
+        m.WIFEXITED.reset_mock()
+        m.WEXITSTATUS.reset_mock()
+
+        # sigchld called again
+        self.zombies.clear()
+        self.watcher._sig_chld()
+
+        self.assertFalse(callback1.called)
+        self.assertFalse(callback2.called)
+        self.assertFalse(m.WIFEXITED.called)
+        self.assertFalse(m.WIFSIGNALED.called)
+        self.assertFalse(m.WEXITSTATUS.called)
+        self.assertFalse(m.WTERMSIG.called)
+
+    @waitpid_mocks
+    def test_sigchld_two_children_terminating_together(self, m):
+        callback1 = mock.Mock()
+        callback2 = mock.Mock()
+
+        # register child 1
+        with self.watcher:
+            self.running = True
+            self.watcher.add_child_handler(45, callback1, 17, 8)
+
+        self.assertFalse(callback1.called)
+        self.assertFalse(callback2.called)
+        self.assertFalse(m.WIFEXITED.called)
+        self.assertFalse(m.WIFSIGNALED.called)
+        self.assertFalse(m.WEXITSTATUS.called)
+        self.assertFalse(m.WTERMSIG.called)
+
+        # register child 2
+        with self.watcher:
+            self.watcher.add_child_handler(46, callback2, 1147, 18)
+
+        self.assertFalse(callback1.called)
+        self.assertFalse(callback2.called)
+        self.assertFalse(m.WIFEXITED.called)
+        self.assertFalse(m.WIFSIGNALED.called)
+        self.assertFalse(m.WEXITSTATUS.called)
+        self.assertFalse(m.WTERMSIG.called)
+
+        # children are running
+        self.watcher._sig_chld()
+
+        self.assertFalse(callback1.called)
+        self.assertFalse(callback2.called)
+        self.assertFalse(m.WIFEXITED.called)
+        self.assertFalse(m.WIFSIGNALED.called)
+        self.assertFalse(m.WEXITSTATUS.called)
+        self.assertFalse(m.WTERMSIG.called)
+
+        # child 1 terminates (code 78)
+        # child 2 terminates (signal 5)
+        self.add_zombie(45, 78)
+        self.add_zombie(46, -5)
+        self.running = False
+        self.watcher._sig_chld()
+
+        callback1.assert_called_once_with(45, 78, 17, 8)
+        callback2.assert_called_once_with(46, -5, 1147, 18)
+        self.assertTrue(m.WIFSIGNALED.called)
+        self.assertTrue(m.WIFEXITED.called)
+        self.assertTrue(m.WEXITSTATUS.called)
+        self.assertTrue(m.WTERMSIG.called)
+
+        m.WIFSIGNALED.reset_mock()
+        m.WIFEXITED.reset_mock()
+        m.WTERMSIG.reset_mock()
+        m.WEXITSTATUS.reset_mock()
+        callback1.reset_mock()
+        callback2.reset_mock()
+
+        # ensure that the children are effectively reaped
+        self.add_zombie(45, 14)
+        self.add_zombie(46, 15)
+        with self.ignore_warnings:
+            self.watcher._sig_chld()
+
+        self.assertFalse(callback1.called)
+        self.assertFalse(callback2.called)
+        self.assertFalse(m.WTERMSIG.called)
+
+    @waitpid_mocks
+    def test_sigchld_race_condition(self, m):
+        # register a child
+        callback = mock.Mock()
+
+        with self.watcher:
+            # child terminates before being registered
+            self.add_zombie(50, 4)
+            self.watcher._sig_chld()
+
+            self.watcher.add_child_handler(50, callback, 1, 12)
+
+        callback.assert_called_once_with(50, 4, 1, 12)
+        callback.reset_mock()
+
+        # ensure that the child is effectively reaped
+        self.add_zombie(50, -1)
+        with self.ignore_warnings:
+            self.watcher._sig_chld()
+
+        self.assertFalse(callback.called)
+
+    @waitpid_mocks
+    def test_sigchld_replace_handler(self, m):
+        callback1 = mock.Mock()
+        callback2 = mock.Mock()
+
+        # register a child
+        with self.watcher:
+            self.running = True
+            self.watcher.add_child_handler(51, callback1, 19)
+
+        self.assertFalse(callback1.called)
+        self.assertFalse(callback2.called)
+        self.assertFalse(m.WIFEXITED.called)
+        self.assertFalse(m.WIFSIGNALED.called)
+        self.assertFalse(m.WEXITSTATUS.called)
+        self.assertFalse(m.WTERMSIG.called)
+
+        # register the same child again
+        with self.watcher:
+            self.watcher.add_child_handler(51, callback2, 21)
+
+        self.assertFalse(callback1.called)
+        self.assertFalse(callback2.called)
+        self.assertFalse(m.WIFEXITED.called)
+        self.assertFalse(m.WIFSIGNALED.called)
+        self.assertFalse(m.WEXITSTATUS.called)
+        self.assertFalse(m.WTERMSIG.called)
+
+        # child terminates (signal 8)
+        self.running = False
+        self.add_zombie(51, -8)
+        self.watcher._sig_chld()
+
+        callback2.assert_called_once_with(51, -8, 21)
+        self.assertFalse(callback1.called)
+        self.assertTrue(m.WIFSIGNALED.called)
+        self.assertFalse(m.WEXITSTATUS.called)
+        self.assertTrue(m.WTERMSIG.called)
+
+        m.WIFSIGNALED.reset_mock()
+        m.WIFEXITED.reset_mock()
+        m.WTERMSIG.reset_mock()
+        callback2.reset_mock()
+
+        # ensure that the child is effectively reaped
+        self.add_zombie(51, 13)
+        with self.ignore_warnings:
+            self.watcher._sig_chld()
+
+        self.assertFalse(callback1.called)
+        self.assertFalse(callback2.called)
+        self.assertFalse(m.WTERMSIG.called)
+
+    @waitpid_mocks
+    def test_sigchld_remove_handler(self, m):
+        callback = mock.Mock()
+
+        # register a child
+        with self.watcher:
+            self.running = True
+            self.watcher.add_child_handler(52, callback, 1984)
+
+        self.assertFalse(callback.called)
+        self.assertFalse(m.WIFEXITED.called)
+        self.assertFalse(m.WIFSIGNALED.called)
+        self.assertFalse(m.WEXITSTATUS.called)
+        self.assertFalse(m.WTERMSIG.called)
+
+        # unregister the child
+        self.watcher.remove_child_handler(52)
+
+        self.assertFalse(callback.called)
+        self.assertFalse(m.WIFEXITED.called)
+        self.assertFalse(m.WIFSIGNALED.called)
+        self.assertFalse(m.WEXITSTATUS.called)
+        self.assertFalse(m.WTERMSIG.called)
+
+        # child terminates (code 99)
+        self.running = False
+        self.add_zombie(52, 99)
+        with self.ignore_warnings:
+            self.watcher._sig_chld()
+
+        self.assertFalse(callback.called)
+
+    @waitpid_mocks
+    def test_sigchld_unknown_status(self, m):
+        callback = mock.Mock()
+
+        # register a child
+        with self.watcher:
+            self.running = True
+            self.watcher.add_child_handler(53, callback, -19)
+
+        self.assertFalse(callback.called)
+        self.assertFalse(m.WIFEXITED.called)
+        self.assertFalse(m.WIFSIGNALED.called)
+        self.assertFalse(m.WEXITSTATUS.called)
+        self.assertFalse(m.WTERMSIG.called)
+
+        # terminate with unknown status
+        self.zombies[53] = 1178
+        self.running = False
+        self.watcher._sig_chld()
+
+        callback.assert_called_once_with(53, 1178, -19)
+        self.assertTrue(m.WIFEXITED.called)
+        self.assertTrue(m.WIFSIGNALED.called)
+        self.assertFalse(m.WEXITSTATUS.called)
+        self.assertFalse(m.WTERMSIG.called)
+
+        callback.reset_mock()
+        m.WIFEXITED.reset_mock()
+        m.WIFSIGNALED.reset_mock()
+
+        # ensure that the child is effectively reaped
+        self.add_zombie(53, 101)
+        with self.ignore_warnings:
+            self.watcher._sig_chld()
+
+        self.assertFalse(callback.called)
+
+    @waitpid_mocks
+    def test_remove_child_handler(self, m):
+        callback1 = mock.Mock()
+        callback2 = mock.Mock()
+        callback3 = mock.Mock()
+
+        # register children
+        with self.watcher:
+            self.running = True
+            self.watcher.add_child_handler(54, callback1, 1)
+            self.watcher.add_child_handler(55, callback2, 2)
+            self.watcher.add_child_handler(56, callback3, 3)
+
+        # remove child handler 1
+        self.assertTrue(self.watcher.remove_child_handler(54))
+
+        # remove child handler 2 multiple times
+        self.assertTrue(self.watcher.remove_child_handler(55))
+        self.assertFalse(self.watcher.remove_child_handler(55))
+        self.assertFalse(self.watcher.remove_child_handler(55))
+
+        # all children terminate
+        self.add_zombie(54, 0)
+        self.add_zombie(55, 1)
+        self.add_zombie(56, 2)
+        self.running = False
+        with self.ignore_warnings:
+            self.watcher._sig_chld()
+
+        self.assertFalse(callback1.called)
+        self.assertFalse(callback2.called)
+        callback3.assert_called_once_with(56, 2, 3)
+
+    @waitpid_mocks
+    def test_sigchld_unhandled_exception(self, m):
+        callback = mock.Mock()
+
+        # register a child
+        with self.watcher:
+            self.running = True
+            self.watcher.add_child_handler(57, callback)
+
+        # raise an exception
+        m.waitpid.side_effect = ValueError
+
+        with mock.patch.object(log.logger,
+                               'error') as m_error:
+
+            self.assertEqual(self.watcher._sig_chld(), None)
+            self.assertTrue(m_error.called)
+
+    @waitpid_mocks
+    def test_sigchld_child_reaped_elsewhere(self, m):
+        # register a child
+        callback = mock.Mock()
+
+        with self.watcher:
+            self.running = True
+            self.watcher.add_child_handler(58, callback)
+
+        self.assertFalse(callback.called)
+        self.assertFalse(m.WIFEXITED.called)
+        self.assertFalse(m.WIFSIGNALED.called)
+        self.assertFalse(m.WEXITSTATUS.called)
+        self.assertFalse(m.WTERMSIG.called)
+
+        # child terminates
+        self.running = False
+        self.add_zombie(58, 4)
+
+        # waitpid is called elsewhere
+        os.waitpid(58, os.WNOHANG)
+
+        m.waitpid.reset_mock()
+
+        # sigchld
+        with self.ignore_warnings:
+            self.watcher._sig_chld()
+
+        if isinstance(self.watcher, asyncio.FastChildWatcher):
+            # here the FastChildWatche enters a deadlock
+            # (there is no way to prevent it)
+            self.assertFalse(callback.called)
+        else:
+            callback.assert_called_once_with(58, 255)
+
+    @waitpid_mocks
+    def test_sigchld_unknown_pid_during_registration(self, m):
+        # register two children
+        callback1 = mock.Mock()
+        callback2 = mock.Mock()
+
+        with self.ignore_warnings, self.watcher:
+            self.running = True
+            # child 1 terminates
+            self.add_zombie(591, 7)
+            # an unknown child terminates
+            self.add_zombie(593, 17)
+
+            self.watcher._sig_chld()
+
+            self.watcher.add_child_handler(591, callback1)
+            self.watcher.add_child_handler(592, callback2)
+
+        callback1.assert_called_once_with(591, 7)
+        self.assertFalse(callback2.called)
+
+    @waitpid_mocks
+    def test_set_loop(self, m):
+        # register a child
+        callback = mock.Mock()
+
+        with self.watcher:
+            self.running = True
+            self.watcher.add_child_handler(60, callback)
+
+        # attach a new loop
+        old_loop = self.loop
+        self.loop = self.new_test_loop()
+        patch = mock.patch.object
+
+        with patch(old_loop, "remove_signal_handler") as m_old_remove, \
+             patch(self.loop, "add_signal_handler") as m_new_add:
+
+            self.watcher.attach_loop(self.loop)
+
+            m_old_remove.assert_called_once_with(
+                signal.SIGCHLD)
+            m_new_add.assert_called_once_with(
+                signal.SIGCHLD, self.watcher._sig_chld)
+
+        # child terminates
+        self.running = False
+        self.add_zombie(60, 9)
+        self.watcher._sig_chld()
+
+        callback.assert_called_once_with(60, 9)
+
+    @waitpid_mocks
+    def test_set_loop_race_condition(self, m):
+        # register 3 children
+        callback1 = mock.Mock()
+        callback2 = mock.Mock()
+        callback3 = mock.Mock()
+
+        with self.watcher:
+            self.running = True
+            self.watcher.add_child_handler(61, callback1)
+            self.watcher.add_child_handler(62, callback2)
+            self.watcher.add_child_handler(622, callback3)
+
+        # detach the loop
+        old_loop = self.loop
+        self.loop = None
+
+        with mock.patch.object(
+                old_loop, "remove_signal_handler") as m_remove_signal_handler:
+
+            self.watcher.attach_loop(None)
+
+            m_remove_signal_handler.assert_called_once_with(
+                signal.SIGCHLD)
+
+        # child 1 & 2 terminate
+        self.add_zombie(61, 11)
+        self.add_zombie(62, -5)
+
+        # SIGCHLD was not caught
+        self.assertFalse(callback1.called)
+        self.assertFalse(callback2.called)
+        self.assertFalse(callback3.called)
+
+        # attach a new loop
+        self.loop = self.new_test_loop()
+
+        with mock.patch.object(
+                self.loop, "add_signal_handler") as m_add_signal_handler:
+
+            self.watcher.attach_loop(self.loop)
+
+            m_add_signal_handler.assert_called_once_with(
+                signal.SIGCHLD, self.watcher._sig_chld)
+            callback1.assert_called_once_with(61, 11)  # race condition!
+            callback2.assert_called_once_with(62, -5)  # race condition!
+            self.assertFalse(callback3.called)
+
+        callback1.reset_mock()
+        callback2.reset_mock()
+
+        # child 3 terminates
+        self.running = False
+        self.add_zombie(622, 19)
+        self.watcher._sig_chld()
+
+        self.assertFalse(callback1.called)
+        self.assertFalse(callback2.called)
+        callback3.assert_called_once_with(622, 19)
+
+    @waitpid_mocks
+    def test_close(self, m):
+        # register two children
+        callback1 = mock.Mock()
+
+        with self.watcher:
+            self.running = True
+            # child 1 terminates
+            self.add_zombie(63, 9)
+            # other child terminates
+            self.add_zombie(65, 18)
+            self.watcher._sig_chld()
+
+            self.watcher.add_child_handler(63, callback1)
+            self.watcher.add_child_handler(64, callback1)
+
+            self.assertEqual(len(self.watcher._callbacks), 1)
+            if isinstance(self.watcher, asyncio.FastChildWatcher):
+                self.assertEqual(len(self.watcher._zombies), 1)
+
+            with mock.patch.object(
+                    self.loop,
+                    "remove_signal_handler") as m_remove_signal_handler:
+
+                self.watcher.close()
+
+                m_remove_signal_handler.assert_called_once_with(
+                    signal.SIGCHLD)
+                self.assertFalse(self.watcher._callbacks)
+                if isinstance(self.watcher, asyncio.FastChildWatcher):
+                    self.assertFalse(self.watcher._zombies)
+
+
+class SafeChildWatcherTests (ChildWatcherTestsMixin, test_utils.TestCase):
+    def create_watcher(self):
+        return asyncio.SafeChildWatcher()
+
+
+class FastChildWatcherTests (ChildWatcherTestsMixin, test_utils.TestCase):
+    def create_watcher(self):
+        return asyncio.FastChildWatcher()
+
+
+class PolicyTests(unittest.TestCase):
+
+    def create_policy(self):
+        return asyncio.DefaultEventLoopPolicy()
+
+    def test_get_child_watcher(self):
+        policy = self.create_policy()
+        self.assertIsNone(policy._watcher)
+
+        watcher = policy.get_child_watcher()
+        self.assertIsInstance(watcher, asyncio.SafeChildWatcher)
+
+        self.assertIs(policy._watcher, watcher)
+
+        self.assertIs(watcher, policy.get_child_watcher())
+        self.assertIsNone(watcher._loop)
+
+    def test_get_child_watcher_after_set(self):
+        policy = self.create_policy()
+        watcher = asyncio.FastChildWatcher()
+
+        policy.set_child_watcher(watcher)
+        self.assertIs(policy._watcher, watcher)
+        self.assertIs(watcher, policy.get_child_watcher())
+
+    def test_get_child_watcher_with_mainloop_existing(self):
+        policy = self.create_policy()
+        loop = policy.get_event_loop()
+
+        self.assertIsNone(policy._watcher)
+        watcher = policy.get_child_watcher()
+
+        self.assertIsInstance(watcher, asyncio.SafeChildWatcher)
+        self.assertIs(watcher._loop, loop)
+
+        loop.close()
+
+    def test_get_child_watcher_thread(self):
+
+        def f():
+            policy.set_event_loop(policy.new_event_loop())
+
+            self.assertIsInstance(policy.get_event_loop(),
+                                  asyncio.AbstractEventLoop)
+            watcher = policy.get_child_watcher()
+
+            self.assertIsInstance(watcher, asyncio.SafeChildWatcher)
+            self.assertIsNone(watcher._loop)
+
+            policy.get_event_loop().close()
+
+        policy = self.create_policy()
+
+        th = threading.Thread(target=f)
+        th.start()
+        th.join()
+
+    def test_child_watcher_replace_mainloop_existing(self):
+        policy = self.create_policy()
+        loop = policy.get_event_loop()
+
+        watcher = policy.get_child_watcher()
+
+        self.assertIs(watcher._loop, loop)
+
+        new_loop = policy.new_event_loop()
+        policy.set_event_loop(new_loop)
+
+        self.assertIs(watcher._loop, new_loop)
+
+        policy.set_event_loop(None)
+
+        self.assertIs(watcher._loop, None)
+
+        loop.close()
+        new_loop.close()
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Lib/test/test_asyncio/test_windows_events.py b/Lib/test/test_asyncio/test_windows_events.py
new file mode 100644
index 0000000..73d8fcd
--- /dev/null
+++ b/Lib/test/test_asyncio/test_windows_events.py
@@ -0,0 +1,159 @@
+import os
+import sys
+import unittest
+from unittest import mock
+
+if sys.platform != 'win32':
+    raise unittest.SkipTest('Windows only')
+
+import _winapi
+
+import asyncio
+from asyncio import _overlapped
+from asyncio import test_utils
+from asyncio import windows_events
+
+
+class UpperProto(asyncio.Protocol):
+    def __init__(self):
+        self.buf = []
+
+    def connection_made(self, trans):
+        self.trans = trans
+
+    def data_received(self, data):
+        self.buf.append(data)
+        if b'\n' in data:
+            self.trans.write(b''.join(self.buf).upper())
+            self.trans.close()
+
+
+class ProactorTests(test_utils.TestCase):
+
+    def setUp(self):
+        self.loop = asyncio.ProactorEventLoop()
+        self.set_event_loop(self.loop)
+
+    def test_close(self):
+        a, b = self.loop._socketpair()
+        trans = self.loop._make_socket_transport(a, asyncio.Protocol())
+        f = asyncio.async(self.loop.sock_recv(b, 100))
+        trans.close()
+        self.loop.run_until_complete(f)
+        self.assertEqual(f.result(), b'')
+        b.close()
+
+    def test_double_bind(self):
+        ADDRESS = r'\\.\pipe\test_double_bind-%s' % os.getpid()
+        server1 = windows_events.PipeServer(ADDRESS)
+        with self.assertRaises(PermissionError):
+            windows_events.PipeServer(ADDRESS)
+        server1.close()
+
+    def test_pipe(self):
+        res = self.loop.run_until_complete(self._test_pipe())
+        self.assertEqual(res, 'done')
+
+    def _test_pipe(self):
+        ADDRESS = r'\\.\pipe\_test_pipe-%s' % os.getpid()
+
+        with self.assertRaises(FileNotFoundError):
+            yield from self.loop.create_pipe_connection(
+                asyncio.Protocol, ADDRESS)
+
+        [server] = yield from self.loop.start_serving_pipe(
+            UpperProto, ADDRESS)
+        self.assertIsInstance(server, windows_events.PipeServer)
+
+        clients = []
+        for i in range(5):
+            stream_reader = asyncio.StreamReader(loop=self.loop)
+            protocol = asyncio.StreamReaderProtocol(stream_reader,
+                                                    loop=self.loop)
+            trans, proto = yield from self.loop.create_pipe_connection(
+                lambda: protocol, ADDRESS)
+            self.assertIsInstance(trans, asyncio.Transport)
+            self.assertEqual(protocol, proto)
+            clients.append((stream_reader, trans))
+
+        for i, (r, w) in enumerate(clients):
+            w.write('lower-{}\n'.format(i).encode())
+
+        for i, (r, w) in enumerate(clients):
+            response = yield from r.readline()
+            self.assertEqual(response, 'LOWER-{}\n'.format(i).encode())
+            w.close()
+
+        server.close()
+
+        with self.assertRaises(FileNotFoundError):
+            yield from self.loop.create_pipe_connection(
+                asyncio.Protocol, ADDRESS)
+
+        return 'done'
+
+    def test_connect_pipe_cancel(self):
+        exc = OSError()
+        exc.winerror = _overlapped.ERROR_PIPE_BUSY
+        with mock.patch.object(_overlapped, 'ConnectPipe', side_effect=exc) as connect:
+            coro = self.loop._proactor.connect_pipe('pipe_address')
+            task = self.loop.create_task(coro)
+
+            # check that it's possible to cancel connect_pipe()
+            task.cancel()
+            with self.assertRaises(asyncio.CancelledError):
+                self.loop.run_until_complete(task)
+
+    def test_wait_for_handle(self):
+        event = _overlapped.CreateEvent(None, True, False, None)
+        self.addCleanup(_winapi.CloseHandle, event)
+
+        # Wait for unset event with 0.5s timeout;
+        # result should be False at timeout
+        fut = self.loop._proactor.wait_for_handle(event, 0.5)
+        start = self.loop.time()
+        done = self.loop.run_until_complete(fut)
+        elapsed = self.loop.time() - start
+
+        self.assertEqual(done, False)
+        self.assertFalse(fut.result())
+        self.assertTrue(0.48 < elapsed < 0.9, elapsed)
+
+        _overlapped.SetEvent(event)
+
+        # Wait for set event;
+        # result should be True immediately
+        fut = self.loop._proactor.wait_for_handle(event, 10)
+        start = self.loop.time()
+        done = self.loop.run_until_complete(fut)
+        elapsed = self.loop.time() - start
+
+        self.assertEqual(done, True)
+        self.assertTrue(fut.result())
+        self.assertTrue(0 <= elapsed < 0.3, elapsed)
+
+        # Tulip issue #195: cancelling a done _WaitHandleFuture must not crash
+        fut.cancel()
+
+    def test_wait_for_handle_cancel(self):
+        event = _overlapped.CreateEvent(None, True, False, None)
+        self.addCleanup(_winapi.CloseHandle, event)
+
+        # Wait for unset event with a cancelled future;
+        # CancelledError should be raised immediately
+        fut = self.loop._proactor.wait_for_handle(event, 10)
+        fut.cancel()
+        start = self.loop.time()
+        with self.assertRaises(asyncio.CancelledError):
+            self.loop.run_until_complete(fut)
+        elapsed = self.loop.time() - start
+        self.assertTrue(0 <= elapsed < 0.1, elapsed)
+
+        # Tulip issue #195: cancelling a _WaitHandleFuture twice must not crash
+        fut = self.loop._proactor.wait_for_handle(event)
+        fut.cancel()
+        fut.cancel()
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Lib/test/test_asyncio/test_windows_utils.py b/Lib/test/test_asyncio/test_windows_utils.py
new file mode 100644
index 0000000..d48b8bc
--- /dev/null
+++ b/Lib/test/test_asyncio/test_windows_utils.py
@@ -0,0 +1,182 @@
+"""Tests for window_utils"""
+
+import socket
+import sys
+import unittest
+import warnings
+from unittest import mock
+
+if sys.platform != 'win32':
+    raise unittest.SkipTest('Windows only')
+
+import _winapi
+
+from asyncio import _overlapped
+from asyncio import windows_utils
+try:
+    from test import support
+except ImportError:
+    from asyncio import test_support as support
+
+
+class WinsocketpairTests(unittest.TestCase):
+
+    def check_winsocketpair(self, ssock, csock):
+        csock.send(b'xxx')
+        self.assertEqual(b'xxx', ssock.recv(1024))
+        csock.close()
+        ssock.close()
+
+    def test_winsocketpair(self):
+        ssock, csock = windows_utils.socketpair()
+        self.check_winsocketpair(ssock, csock)
+
+    @unittest.skipUnless(support.IPV6_ENABLED, 'IPv6 not supported or enabled')
+    def test_winsocketpair_ipv6(self):
+        ssock, csock = windows_utils.socketpair(family=socket.AF_INET6)
+        self.check_winsocketpair(ssock, csock)
+
+    @unittest.skipIf(hasattr(socket, 'socketpair'),
+                     'socket.socketpair is available')
+    @mock.patch('asyncio.windows_utils.socket')
+    def test_winsocketpair_exc(self, m_socket):
+        m_socket.AF_INET = socket.AF_INET
+        m_socket.SOCK_STREAM = socket.SOCK_STREAM
+        m_socket.socket.return_value.getsockname.return_value = ('', 12345)
+        m_socket.socket.return_value.accept.return_value = object(), object()
+        m_socket.socket.return_value.connect.side_effect = OSError()
+
+        self.assertRaises(OSError, windows_utils.socketpair)
+
+    def test_winsocketpair_invalid_args(self):
+        self.assertRaises(ValueError,
+                          windows_utils.socketpair, family=socket.AF_UNSPEC)
+        self.assertRaises(ValueError,
+                          windows_utils.socketpair, type=socket.SOCK_DGRAM)
+        self.assertRaises(ValueError,
+                          windows_utils.socketpair, proto=1)
+
+    @unittest.skipIf(hasattr(socket, 'socketpair'),
+                     'socket.socketpair is available')
+    @mock.patch('asyncio.windows_utils.socket')
+    def test_winsocketpair_close(self, m_socket):
+        m_socket.AF_INET = socket.AF_INET
+        m_socket.SOCK_STREAM = socket.SOCK_STREAM
+        sock = mock.Mock()
+        m_socket.socket.return_value = sock
+        sock.bind.side_effect = OSError
+        self.assertRaises(OSError, windows_utils.socketpair)
+        self.assertTrue(sock.close.called)
+
+
+class PipeTests(unittest.TestCase):
+
+    def test_pipe_overlapped(self):
+        h1, h2 = windows_utils.pipe(overlapped=(True, True))
+        try:
+            ov1 = _overlapped.Overlapped()
+            self.assertFalse(ov1.pending)
+            self.assertEqual(ov1.error, 0)
+
+            ov1.ReadFile(h1, 100)
+            self.assertTrue(ov1.pending)
+            self.assertEqual(ov1.error, _winapi.ERROR_IO_PENDING)
+            ERROR_IO_INCOMPLETE = 996
+            try:
+                ov1.getresult()
+            except OSError as e:
+                self.assertEqual(e.winerror, ERROR_IO_INCOMPLETE)
+            else:
+                raise RuntimeError('expected ERROR_IO_INCOMPLETE')
+
+            ov2 = _overlapped.Overlapped()
+            self.assertFalse(ov2.pending)
+            self.assertEqual(ov2.error, 0)
+
+            ov2.WriteFile(h2, b"hello")
+            self.assertIn(ov2.error, {0, _winapi.ERROR_IO_PENDING})
+
+            res = _winapi.WaitForMultipleObjects([ov2.event], False, 100)
+            self.assertEqual(res, _winapi.WAIT_OBJECT_0)
+
+            self.assertFalse(ov1.pending)
+            self.assertEqual(ov1.error, ERROR_IO_INCOMPLETE)
+            self.assertFalse(ov2.pending)
+            self.assertIn(ov2.error, {0, _winapi.ERROR_IO_PENDING})
+            self.assertEqual(ov1.getresult(), b"hello")
+        finally:
+            _winapi.CloseHandle(h1)
+            _winapi.CloseHandle(h2)
+
+    def test_pipe_handle(self):
+        h, _ = windows_utils.pipe(overlapped=(True, True))
+        _winapi.CloseHandle(_)
+        p = windows_utils.PipeHandle(h)
+        self.assertEqual(p.fileno(), h)
+        self.assertEqual(p.handle, h)
+
+        # check garbage collection of p closes handle
+        with warnings.catch_warnings():
+            warnings.filterwarnings("ignore", "",  ResourceWarning)
+            del p
+            support.gc_collect()
+        try:
+            _winapi.CloseHandle(h)
+        except OSError as e:
+            self.assertEqual(e.winerror, 6)     # ERROR_INVALID_HANDLE
+        else:
+            raise RuntimeError('expected ERROR_INVALID_HANDLE')
+
+
+class PopenTests(unittest.TestCase):
+
+    def test_popen(self):
+        command = r"""if 1:
+            import sys
+            s = sys.stdin.readline()
+            sys.stdout.write(s.upper())
+            sys.stderr.write('stderr')
+            """
+        msg = b"blah\n"
+
+        p = windows_utils.Popen([sys.executable, '-c', command],
+                                stdin=windows_utils.PIPE,
+                                stdout=windows_utils.PIPE,
+                                stderr=windows_utils.PIPE)
+
+        for f in [p.stdin, p.stdout, p.stderr]:
+            self.assertIsInstance(f, windows_utils.PipeHandle)
+
+        ovin = _overlapped.Overlapped()
+        ovout = _overlapped.Overlapped()
+        overr = _overlapped.Overlapped()
+
+        ovin.WriteFile(p.stdin.handle, msg)
+        ovout.ReadFile(p.stdout.handle, 100)
+        overr.ReadFile(p.stderr.handle, 100)
+
+        events = [ovin.event, ovout.event, overr.event]
+        # Super-long timeout for slow buildbots.
+        res = _winapi.WaitForMultipleObjects(events, True, 10000)
+        self.assertEqual(res, _winapi.WAIT_OBJECT_0)
+        self.assertFalse(ovout.pending)
+        self.assertFalse(overr.pending)
+        self.assertFalse(ovin.pending)
+
+        self.assertEqual(ovin.getresult(), len(msg))
+        out = ovout.getresult().rstrip()
+        err = overr.getresult().rstrip()
+
+        self.assertGreater(len(out), 0)
+        self.assertGreater(len(err), 0)
+        # allow for partial reads...
+        self.assertTrue(msg.upper().rstrip().startswith(out))
+        self.assertTrue(b"stderr".startswith(err))
+
+        # The context manager calls wait() and closes resources
+        with p:
+            pass
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Lib/test/test_asyncore.py b/Lib/test/test_asyncore.py
index 5d0632e..d44726d 100644
--- a/Lib/test/test_asyncore.py
+++ b/Lib/test/test_asyncore.py
@@ -5,20 +5,19 @@
 import socket
 import sys
 import time
-import warnings
 import errno
 import struct
+import warnings
 
 from test import support
-from test.support import TESTFN, run_unittest, unlink, HOST, HOSTv6
 from io import BytesIO
-from io import StringIO
 
 try:
     import threading
 except ImportError:
     threading = None
 
+TIMEOUT = 3
 HAS_UNIX_SOCKETS = hasattr(socket, 'AF_UNIX')
 
 class dummysocket:
@@ -93,7 +92,7 @@
     """Helper function to bind a socket according to its family."""
     if HAS_UNIX_SOCKETS and sock.family == socket.AF_UNIX:
         # Make sure the path doesn't exist.
-        unlink(addr)
+        support.unlink(addr)
     sock.bind(addr)
 
 
@@ -256,40 +255,29 @@
         d = asyncore.dispatcher()
 
         # capture output of dispatcher.log() (to stderr)
-        fp = StringIO()
-        stderr = sys.stderr
         l1 = "Lovely spam! Wonderful spam!"
         l2 = "I don't like spam!"
-        try:
-            sys.stderr = fp
+        with support.captured_stderr() as stderr:
             d.log(l1)
             d.log(l2)
-        finally:
-            sys.stderr = stderr
 
-        lines = fp.getvalue().splitlines()
+        lines = stderr.getvalue().splitlines()
         self.assertEqual(lines, ['log: %s' % l1, 'log: %s' % l2])
 
     def test_log_info(self):
         d = asyncore.dispatcher()
 
         # capture output of dispatcher.log_info() (to stdout via print)
-        fp = StringIO()
-        stdout = sys.stdout
         l1 = "Have you got anything without spam?"
         l2 = "Why can't she have egg bacon spam and sausage?"
         l3 = "THAT'S got spam in it!"
-        try:
-            sys.stdout = fp
+        with support.captured_stdout() as stdout:
             d.log_info(l1, 'EGGS')
             d.log_info(l2)
             d.log_info(l3, 'SPAM')
-        finally:
-            sys.stdout = stdout
 
-        lines = fp.getvalue().splitlines()
+        lines = stdout.getvalue().splitlines()
         expected = ['EGGS: %s' % l1, 'info: %s' % l2, 'SPAM: %s' % l3]
-
         self.assertEqual(lines, expected)
 
     def test_unhandled(self):
@@ -297,18 +285,13 @@
         d.ignore_log_types = ()
 
         # capture output of dispatcher.log_info() (to stdout via print)
-        fp = StringIO()
-        stdout = sys.stdout
-        try:
-            sys.stdout = fp
+        with support.captured_stdout() as stdout:
             d.handle_expt()
             d.handle_read()
             d.handle_write()
             d.handle_connect()
-        finally:
-            sys.stdout = stdout
 
-        lines = fp.getvalue().splitlines()
+        lines = stdout.getvalue().splitlines()
         expected = ['warning: unhandled incoming priority event',
                     'warning: unhandled read event',
                     'warning: unhandled write event',
@@ -377,7 +360,7 @@
             data = b"Suppose there isn't a 16-ton weight?"
             d = dispatcherwithsend_noread()
             d.create_socket()
-            d.connect((HOST, port))
+            d.connect((support.HOST, port))
 
             # give time for socket to connect
             time.sleep(0.1)
@@ -395,7 +378,10 @@
 
             self.assertEqual(cap.getvalue(), data*2)
         finally:
-            t.join()
+            t.join(timeout=TIMEOUT)
+            if t.is_alive():
+                self.fail("join() timed out")
+
 
 
 class DispatcherWithSendTests_UsePoll(DispatcherWithSendTests):
@@ -406,14 +392,14 @@
 class FileWrapperTest(unittest.TestCase):
     def setUp(self):
         self.d = b"It's not dead, it's sleeping!"
-        with open(TESTFN, 'wb') as file:
+        with open(support.TESTFN, 'wb') as file:
             file.write(self.d)
 
     def tearDown(self):
-        unlink(TESTFN)
+        support.unlink(support.TESTFN)
 
     def test_recv(self):
-        fd = os.open(TESTFN, os.O_RDONLY)
+        fd = os.open(support.TESTFN, os.O_RDONLY)
         w = asyncore.file_wrapper(fd)
         os.close(fd)
 
@@ -427,20 +413,20 @@
     def test_send(self):
         d1 = b"Come again?"
         d2 = b"I want to buy some cheese."
-        fd = os.open(TESTFN, os.O_WRONLY | os.O_APPEND)
+        fd = os.open(support.TESTFN, os.O_WRONLY | os.O_APPEND)
         w = asyncore.file_wrapper(fd)
         os.close(fd)
 
         w.write(d1)
         w.send(d2)
         w.close()
-        with open(TESTFN, 'rb') as file:
+        with open(support.TESTFN, 'rb') as file:
             self.assertEqual(file.read(), self.d + d1 + d2)
 
     @unittest.skipUnless(hasattr(asyncore, 'file_dispatcher'),
                          'asyncore.file_dispatcher required')
     def test_dispatcher(self):
-        fd = os.open(TESTFN, os.O_RDONLY)
+        fd = os.open(support.TESTFN, os.O_RDONLY)
         data = []
         class FileDispatcher(asyncore.file_dispatcher):
             def handle_read(self):
@@ -450,6 +436,26 @@
         asyncore.loop(timeout=0.01, use_poll=True, count=2)
         self.assertEqual(b"".join(data), self.d)
 
+    def test_resource_warning(self):
+        # Issue #11453
+        fd = os.open(support.TESTFN, os.O_RDONLY)
+        f = asyncore.file_wrapper(fd)
+
+        os.close(fd)
+        with support.check_warnings(('', ResourceWarning)):
+            f = None
+            support.gc_collect()
+
+    def test_close_twice(self):
+        fd = os.open(support.TESTFN, os.O_RDONLY)
+        f = asyncore.file_wrapper(fd)
+        os.close(fd)
+
+        f.close()
+        self.assertEqual(f.fd, -1)
+        # calling close twice should not fail
+        f.close()
+
 
 class BaseTestHandler(asyncore.dispatcher):
 
@@ -740,7 +746,12 @@
         s.create_socket(self.family)
         self.assertEqual(s.socket.family, self.family)
         SOCK_NONBLOCK = getattr(socket, 'SOCK_NONBLOCK', 0)
-        self.assertEqual(s.socket.type, socket.SOCK_STREAM | SOCK_NONBLOCK)
+        sock_type = socket.SOCK_STREAM | SOCK_NONBLOCK
+        if hasattr(socket, 'SOCK_CLOEXEC'):
+            self.assertIn(s.socket.type,
+                          (sock_type | socket.SOCK_CLOEXEC, sock_type))
+        else:
+            self.assertEqual(s.socket.type, sock_type)
 
     def test_bind(self):
         if HAS_UNIX_SOCKETS and self.family == socket.AF_UNIX:
@@ -754,7 +765,7 @@
         s2 = asyncore.dispatcher()
         s2.create_socket(self.family)
         # EADDRINUSE indicates the socket was correctly bound
-        self.assertRaises(socket.error, s2.bind, (self.addr[0], port))
+        self.assertRaises(OSError, s2.bind, (self.addr[0], port))
 
     def test_set_reuse_addr(self):
         if HAS_UNIX_SOCKETS and self.family == socket.AF_UNIX:
@@ -762,7 +773,7 @@
         sock = socket.socket(self.family)
         try:
             sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
-        except socket.error:
+        except OSError:
             unittest.skip("SO_REUSEADDR not supported on this platform")
         else:
             # if SO_REUSEADDR succeeded for sock we expect asyncore
@@ -787,7 +798,11 @@
             t = threading.Thread(target=lambda: asyncore.loop(timeout=0.1,
                                                               count=500))
             t.start()
-            self.addCleanup(t.join)
+            def cleanup():
+                t.join(timeout=TIMEOUT)
+                if t.is_alive():
+                    self.fail("join() timed out")
+            self.addCleanup(cleanup)
 
             s = socket.socket(self.family, socket.SOCK_STREAM)
             s.settimeout(.2)
@@ -795,19 +810,19 @@
                          struct.pack('ii', 1, 0))
             try:
                 s.connect(server.address)
-            except socket.error:
+            except OSError:
                 pass
             finally:
                 s.close()
 
 class TestAPI_UseIPv4Sockets(BaseTestAPI):
     family = socket.AF_INET
-    addr = (HOST, 0)
+    addr = (support.HOST, 0)
 
 @unittest.skipUnless(support.IPV6_ENABLED, 'IPv6 support required')
 class TestAPI_UseIPv6Sockets(BaseTestAPI):
     family = socket.AF_INET6
-    addr = (HOSTv6, 0)
+    addr = (support.HOSTv6, 0)
 
 @unittest.skipUnless(HAS_UNIX_SOCKETS, 'Unix sockets required')
 class TestAPI_UseUnixSockets(BaseTestAPI):
@@ -816,7 +831,7 @@
     addr = support.TESTFN
 
     def tearDown(self):
-        unlink(self.addr)
+        support.unlink(self.addr)
         BaseTestAPI.tearDown(self)
 
 class TestAPI_UseIPv4Select(TestAPI_UseIPv4Sockets, unittest.TestCase):
diff --git a/Lib/test/test_atexit.py b/Lib/test/test_atexit.py
index 30c3b4a..70d2f1c 100644
--- a/Lib/test/test_atexit.py
+++ b/Lib/test/test_atexit.py
@@ -23,7 +23,9 @@
 def raise2():
     raise SystemError
 
-class TestCase(unittest.TestCase):
+
+class GeneralTest(unittest.TestCase):
+
     def setUp(self):
         self.save_stdout = sys.stdout
         self.save_stderr = sys.stderr
@@ -141,8 +143,43 @@
         self.assertEqual(l, [5])
 
 
+class SubinterpreterTest(unittest.TestCase):
+
+    def test_callbacks_leak(self):
+        # This test shows a leak in refleak mode if atexit doesn't
+        # take care to free callbacks in its per-subinterpreter module
+        # state.
+        n = atexit._ncallbacks()
+        code = r"""if 1:
+            import atexit
+            def f():
+                pass
+            atexit.register(f)
+            del atexit
+            """
+        ret = support.run_in_subinterp(code)
+        self.assertEqual(ret, 0)
+        self.assertEqual(atexit._ncallbacks(), n)
+
+    def test_callbacks_leak_refcycle(self):
+        # Similar to the above, but with a refcycle through the atexit
+        # module.
+        n = atexit._ncallbacks()
+        code = r"""if 1:
+            import atexit
+            def f():
+                pass
+            atexit.register(f)
+            atexit.__atexit = atexit
+            """
+        ret = support.run_in_subinterp(code)
+        self.assertEqual(ret, 0)
+        self.assertEqual(atexit._ncallbacks(), n)
+
+
 def test_main():
-    support.run_unittest(TestCase)
+    support.run_unittest(__name__)
+
 
 if __name__ == "__main__":
     test_main()
diff --git a/Lib/test/test_audioop.py b/Lib/test/test_audioop.py
index a92cf87..879adea 100644
--- a/Lib/test/test_audioop.py
+++ b/Lib/test/test_audioop.py
@@ -5,13 +5,18 @@
 def pack(width, data):
     return b''.join(v.to_bytes(width, sys.byteorder, signed=True) for v in data)
 
-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 unpack(width, data):
+    return [int.from_bytes(data[i: i + width], sys.byteorder, signed=True)
+            for i in range(0, len(data), width)]
+
+packs = {w: (lambda *data, width=w: pack(width, data)) for w in (1, 2, 3, 4)}
+maxvalues = {w: (1 << (8 * w - 1)) - 1 for w in (1, 2, 3, 4)}
+minvalues = {w: -1 << (8 * w - 1) for w in (1, 2, 3, 4)}
 
 datas = {
     1: b'\x00\x12\x45\xbb\x7f\x80\xff',
     2: packs[2](0, 0x1234, 0x4567, -0x4567, 0x7fff, -0x8000, -1),
+    3: packs[3](0, 0x123456, 0x456789, -0x456789, 0x7fffff, -0x800000, -1),
     4: packs[4](0, 0x12345678, 0x456789ab, -0x456789ab,
                 0x7fffffff, -0x80000000, -1),
 }
@@ -19,6 +24,7 @@
 INVALID_DATA = [
     (b'abc', 0),
     (b'abc', 2),
+    (b'ab', 3),
     (b'abc', 4),
 ]
 
@@ -26,8 +32,10 @@
 class TestAudioop(unittest.TestCase):
 
     def test_max(self):
-        for w in 1, 2, 4:
+        for w in 1, 2, 3, 4:
             self.assertEqual(audioop.max(b'', w), 0)
+            self.assertEqual(audioop.max(bytearray(), w), 0)
+            self.assertEqual(audioop.max(memoryview(b''), w), 0)
             p = packs[w]
             self.assertEqual(audioop.max(p(5), w), 5)
             self.assertEqual(audioop.max(p(5, -8, -1), w), 8)
@@ -36,9 +44,13 @@
             self.assertEqual(audioop.max(datas[w], w), -minvalues[w])
 
     def test_minmax(self):
-        for w in 1, 2, 4:
+        for w in 1, 2, 3, 4:
             self.assertEqual(audioop.minmax(b'', w),
                              (0x7fffffff, -0x80000000))
+            self.assertEqual(audioop.minmax(bytearray(), w),
+                             (0x7fffffff, -0x80000000))
+            self.assertEqual(audioop.minmax(memoryview(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))
@@ -50,16 +62,20 @@
                              (minvalues[w], maxvalues[w]))
 
     def test_maxpp(self):
-        for w in 1, 2, 4:
+        for w in 1, 2, 3, 4:
             self.assertEqual(audioop.maxpp(b'', w), 0)
+            self.assertEqual(audioop.maxpp(bytearray(), w), 0)
+            self.assertEqual(audioop.maxpp(memoryview(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):
-        for w in 1, 2, 4:
+        for w in 1, 2, 3, 4:
             self.assertEqual(audioop.avg(b'', w), 0)
+            self.assertEqual(audioop.avg(bytearray(), w), 0)
+            self.assertEqual(audioop.avg(memoryview(b''), w), 0)
             p = packs[w]
             self.assertEqual(audioop.avg(p(5), w), 5)
             self .assertEqual(audioop.avg(p(5, 8), w), 6)
@@ -74,17 +90,22 @@
                          -0x60000000)
 
     def test_avgpp(self):
-        for w in 1, 2, 4:
+        for w in 1, 2, 3, 4:
             self.assertEqual(audioop.avgpp(b'', w), 0)
+            self.assertEqual(audioop.avgpp(bytearray(), w), 0)
+            self.assertEqual(audioop.avgpp(memoryview(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[3], 3), 12937096)
         self.assertEqual(audioop.avgpp(datas[4], 4), 3311897002)
 
     def test_rms(self):
-        for w in 1, 2, 4:
+        for w in 1, 2, 3, 4:
             self.assertEqual(audioop.rms(b'', w), 0)
+            self.assertEqual(audioop.rms(bytearray(), w), 0)
+            self.assertEqual(audioop.rms(memoryview(b''), w), 0)
             p = packs[w]
             self.assertEqual(audioop.rms(p(*range(100)), w), 57)
             self.assertAlmostEqual(audioop.rms(p(maxvalues[w]) * 5, w),
@@ -93,11 +114,14 @@
                                    -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[3], 3), 5120523)
         self.assertEqual(audioop.rms(datas[4], 4), 1310854152)
 
     def test_cross(self):
-        for w in 1, 2, 4:
+        for w in 1, 2, 3, 4:
             self.assertEqual(audioop.cross(b'', w), -1)
+            self.assertEqual(audioop.cross(bytearray(), w), -1)
+            self.assertEqual(audioop.cross(memoryview(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)
@@ -106,22 +130,29 @@
             self.assertEqual(audioop.cross(p(minvalues[w], maxvalues[w]), w), 1)
 
     def test_add(self):
-        for w in 1, 2, 4:
+        for w in 1, 2, 3, 4:
             self.assertEqual(audioop.add(b'', b'', w), b'')
+            self.assertEqual(audioop.add(bytearray(), bytearray(), w), b'')
+            self.assertEqual(audioop.add(memoryview(b''), memoryview(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[3], datas[3], 3),
+                packs[3](0, 0x2468ac, 0x7fffff, -0x800000,
+                       0x7fffff, -0x800000, -2))
         self.assertEqual(audioop.add(datas[4], datas[4], 4),
                 packs[4](0, 0x2468acf0, 0x7fffffff, -0x80000000,
                        0x7fffffff, -0x80000000, -2))
 
     def test_bias(self):
-        for w in 1, 2, 4:
+        for w in 1, 2, 3, 4:
             for bias in 0, 1, -1, 127, -128, 0x7fffffff, -0x80000000:
                 self.assertEqual(audioop.bias(b'', w, bias), b'')
+                self.assertEqual(audioop.bias(bytearray(), w, bias), b'')
+                self.assertEqual(audioop.bias(memoryview(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),
@@ -138,6 +169,17 @@
                 packs[2](-1, 0x1233, 0x4566, -0x4568, 0x7ffe, 0x7fff, -2))
         self.assertEqual(audioop.bias(datas[2], 2, -0x80000000),
                 datas[2])
+        self.assertEqual(audioop.bias(datas[3], 3, 1),
+                packs[3](1, 0x123457, 0x45678a, -0x456788,
+                         -0x800000, -0x7fffff, 0))
+        self.assertEqual(audioop.bias(datas[3], 3, -1),
+                packs[3](-1, 0x123455, 0x456788, -0x45678a,
+                         0x7ffffe, 0x7fffff, -2))
+        self.assertEqual(audioop.bias(datas[3], 3, 0x7fffffff),
+                packs[3](-1, 0x123455, 0x456788, -0x45678a,
+                         0x7ffffe, 0x7fffff, -2))
+        self.assertEqual(audioop.bias(datas[3], 3, -0x80000000),
+                datas[3])
         self.assertEqual(audioop.bias(datas[4], 4, 1),
                 packs[4](1, 0x12345679, 0x456789ac, -0x456789aa,
                          -0x80000000, -0x7fffffff, 0))
@@ -152,99 +194,146 @@
                          -1, 0, 0x7fffffff))
 
     def test_lin2lin(self):
-        for w in 1, 2, 4:
+        for w in 1, 2, 3, 4:
             self.assertEqual(audioop.lin2lin(datas[w], w, w), datas[w])
+            self.assertEqual(audioop.lin2lin(bytearray(datas[w]), w, w),
+                             datas[w])
+            self.assertEqual(audioop.lin2lin(memoryview(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, 3),
+            packs[3](0, 0x120000, 0x450000, -0x450000,
+                     0x7f0000, -0x800000, -0x10000))
         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, 3),
+            packs[3](0, 0x123400, 0x456700, -0x456700,
+                     0x7fff00, -0x800000, -0x100))
         self.assertEqual(audioop.lin2lin(datas[2], 2, 4),
             packs[4](0, 0x12340000, 0x45670000, -0x45670000,
                      0x7fff0000, -0x80000000, -0x10000))
+        self.assertEqual(audioop.lin2lin(datas[3], 3, 1),
+            b'\x00\x12\x45\xba\x7f\x80\xff')
+        self.assertEqual(audioop.lin2lin(datas[3], 3, 2),
+            packs[2](0, 0x1234, 0x4567, -0x4568, 0x7fff, -0x8000, -1))
+        self.assertEqual(audioop.lin2lin(datas[3], 3, 4),
+            packs[4](0, 0x12345600, 0x45678900, -0x45678900,
+                     0x7fffff00, -0x80000000, -0x100))
         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))
+        self.assertEqual(audioop.lin2lin(datas[4], 4, 3),
+            packs[3](0, 0x123456, 0x456789, -0x45678a,
+                     0x7fffff, -0x800000, -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(bytearray(b'\x07\x7f\x7f'), 1, None),
+                         (b'\x00\x00\x00\xff\x00\xff', (-179, 40)))
+        self.assertEqual(audioop.adpcm2lin(memoryview(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', 3, None),
+                         (packs[3](0, 0xb00, 0x2900, -0x1600, 0x7200,
+                                   -0xb300), (-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
-        for w in 1, 2, 4:
+        for w in 1, 2, 3, 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)))
+        self.assertEqual(audioop.lin2adpcm(bytearray(datas[1]), 1, None),
+                         (b'\x07\x7f\x7f', (-221, 39)))
+        self.assertEqual(audioop.lin2adpcm(memoryview(datas[1]), 1, None),
+                         (b'\x07\x7f\x7f', (-221, 39)))
+        for w in 2, 3, 4:
+            self.assertEqual(audioop.lin2adpcm(datas[w], w, None),
+                             (b'\x07\x7f\x7f', (31, 39)))
 
         # Very cursory test
-        for w in 1, 2, 4:
+        for w in 1, 2, 3, 4:
             self.assertEqual(audioop.lin2adpcm(b'\0' * w * 10, w, None),
                              (b'\0' * 5, (0, 0)))
 
+    def test_invalid_adpcm_state(self):
+        # state must be a tuple or None, not an integer
+        self.assertRaises(TypeError, audioop.adpcm2lin, b'\0', 1, 555)
+        self.assertRaises(TypeError, audioop.lin2adpcm, b'\0', 1, 555)
+
     def test_lin2alaw(self):
         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')
+        self.assertEqual(audioop.lin2alaw(bytearray(datas[1]), 1),
+                         b'\xd5\x87\xa4\x24\xaa\x2a\x5a')
+        self.assertEqual(audioop.lin2alaw(memoryview(datas[1]), 1),
+                         b'\xd5\x87\xa4\x24\xaa\x2a\x5a')
+        for w in 2, 3, 4:
+            self.assertEqual(audioop.lin2alaw(datas[w], w),
+                             b'\xd5\x87\xa4\x24\xaa\x2a\x55')
 
     def test_alaw2lin(self):
         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)))
+        for w in 1, 2, 3, 4:
+            decoded = packs[w](*(x << (w * 8) >> 13 for x in src))
+            self.assertEqual(audioop.alaw2lin(encoded, w), decoded)
+            self.assertEqual(audioop.alaw2lin(bytearray(encoded), w), decoded)
+            self.assertEqual(audioop.alaw2lin(memoryview(encoded), w), decoded)
 
         encoded = bytes(range(256))
-        for w in 2, 4:
+        for w in 2, 3, 4:
             decoded = audioop.alaw2lin(encoded, w)
             self.assertEqual(audioop.lin2alaw(decoded, w), encoded)
 
     def test_lin2ulaw(self):
         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')
+        self.assertEqual(audioop.lin2ulaw(bytearray(datas[1]), 1),
+                         b'\xff\xad\x8e\x0e\x80\x00\x67')
+        self.assertEqual(audioop.lin2ulaw(memoryview(datas[1]), 1),
+                         b'\xff\xad\x8e\x0e\x80\x00\x67')
+        for w in 2, 3, 4:
+            self.assertEqual(audioop.lin2ulaw(datas[w], w),
+                             b'\xff\xad\x8e\x0e\x80\x00\x7e')
 
     def test_ulaw2lin(self):
         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)))
+        for w in 1, 2, 3, 4:
+            decoded = packs[w](*(x << (w * 8) >> 14 for x in src))
+            self.assertEqual(audioop.ulaw2lin(encoded, w), decoded)
+            self.assertEqual(audioop.ulaw2lin(bytearray(encoded), w), decoded)
+            self.assertEqual(audioop.ulaw2lin(memoryview(encoded), w), decoded)
 
         # 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:
+        for w in 2, 3, 4:
             decoded = audioop.ulaw2lin(encoded, w)
             self.assertEqual(audioop.lin2ulaw(decoded, w), encoded)
 
     def test_mul(self):
-        for w in 1, 2, 4:
+        for w in 1, 2, 3, 4:
             self.assertEqual(audioop.mul(b'', w, 2), b'')
+            self.assertEqual(audioop.mul(bytearray(), w, 2), b'')
+            self.assertEqual(audioop.mul(memoryview(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),
@@ -253,14 +342,21 @@
                          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[3], 3, 2),
+                packs[3](0, 0x2468ac, 0x7fffff, -0x800000,
+                         0x7fffff, -0x800000, -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:
+        for w in 1, 2, 3, 4:
             self.assertEqual(audioop.ratecv(b'', w, 1, 8000, 8000, None),
                              (b'', (-1, ((0, 0),))))
+            self.assertEqual(audioop.ratecv(bytearray(), w, 1, 8000, 8000, None),
+                             (b'', (-1, ((0, 0),))))
+            self.assertEqual(audioop.ratecv(memoryview(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),
@@ -272,7 +368,7 @@
         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:
+        for w in 1, 2, 3, 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):
@@ -283,13 +379,15 @@
             self.assertEqual(state, state0)
 
     def test_reverse(self):
-        for w in 1, 2, 4:
+        for w in 1, 2, 3, 4:
             self.assertEqual(audioop.reverse(b'', w), b'')
+            self.assertEqual(audioop.reverse(bytearray(), w), b'')
+            self.assertEqual(audioop.reverse(memoryview(b''), w), b'')
             self.assertEqual(audioop.reverse(packs[w](0, 1, 2), w),
                              packs[w](2, 1, 0))
 
     def test_tomono(self):
-        for w in 1, 2, 4:
+        for w in 1, 2, 3, 4:
             data1 = datas[w]
             data2 = bytearray(2 * len(data1))
             for k in range(w):
@@ -299,9 +397,13 @@
             for k in range(w):
                 data2[k+w::2*w] = data1[k::w]
             self.assertEqual(audioop.tomono(data2, w, 0.5, 0.5), data1)
+            self.assertEqual(audioop.tomono(bytearray(data2), w, 0.5, 0.5),
+                             data1)
+            self.assertEqual(audioop.tomono(memoryview(data2), w, 0.5, 0.5),
+                             data1)
 
     def test_tostereo(self):
-        for w in 1, 2, 4:
+        for w in 1, 2, 3, 4:
             data1 = datas[w]
             data2 = bytearray(2 * len(data1))
             for k in range(w):
@@ -311,14 +413,25 @@
             for k in range(w):
                 data2[k+w::2*w] = data1[k::w]
             self.assertEqual(audioop.tostereo(data1, w, 1, 1), data2)
+            self.assertEqual(audioop.tostereo(bytearray(data1), w, 1, 1), data2)
+            self.assertEqual(audioop.tostereo(memoryview(data1), w, 1, 1),
+                             data2)
 
     def test_findfactor(self):
         self.assertEqual(audioop.findfactor(datas[2], datas[2]), 1.0)
+        self.assertEqual(audioop.findfactor(bytearray(datas[2]),
+                                            bytearray(datas[2])), 1.0)
+        self.assertEqual(audioop.findfactor(memoryview(datas[2]),
+                                            memoryview(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(datas[2], datas[2]), (0, 1.0))
+        self.assertEqual(audioop.findfit(bytearray(datas[2]),
+                                         bytearray(datas[2])), (0, 1.0))
+        self.assertEqual(audioop.findfit(memoryview(datas[2]),
+                                         memoryview(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]),
@@ -326,16 +439,37 @@
 
     def test_findmax(self):
         self.assertEqual(audioop.findmax(datas[2], 1), 5)
+        self.assertEqual(audioop.findmax(bytearray(datas[2]), 1), 5)
+        self.assertEqual(audioop.findmax(memoryview(datas[2]), 1), 5)
 
     def test_getsample(self):
-        for w in 1, 2, 4:
+        for w in 1, 2, 3, 4:
             data = packs[w](0, 1, -1, maxvalues[w], minvalues[w])
             self.assertEqual(audioop.getsample(data, w, 0), 0)
+            self.assertEqual(audioop.getsample(bytearray(data), w, 0), 0)
+            self.assertEqual(audioop.getsample(memoryview(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_byteswap(self):
+        swapped_datas = {
+            1: datas[1],
+            2: packs[2](0, 0x3412, 0x6745, -0x6646, -0x81, 0x80, -1),
+            3: packs[3](0, 0x563412, -0x7698bb, 0x7798ba, -0x81, 0x80, -1),
+            4: packs[4](0, 0x78563412, -0x547698bb, 0x557698ba,
+                        -0x81, 0x80, -1),
+        }
+        for w in 1, 2, 3, 4:
+            self.assertEqual(audioop.byteswap(b'', w), b'')
+            self.assertEqual(audioop.byteswap(datas[w], w), swapped_datas[w])
+            self.assertEqual(audioop.byteswap(swapped_datas[w], w), datas[w])
+            self.assertEqual(audioop.byteswap(bytearray(datas[w]), w),
+                             swapped_datas[w])
+            self.assertEqual(audioop.byteswap(memoryview(datas[w]), w),
+                             swapped_datas[w])
+
     def test_negativelen(self):
         # from issue 3306, previously it segfaulted
         self.assertRaises(audioop.error,
@@ -365,10 +499,33 @@
             self.assertRaises(audioop.error, audioop.lin2alaw, data, size)
             self.assertRaises(audioop.error, audioop.lin2adpcm, data, size, state)
 
+    def test_string(self):
+        data = 'abcd'
+        size = 2
+        self.assertRaises(TypeError, audioop.getsample, data, size, 0)
+        self.assertRaises(TypeError, audioop.max, data, size)
+        self.assertRaises(TypeError, audioop.minmax, data, size)
+        self.assertRaises(TypeError, audioop.avg, data, size)
+        self.assertRaises(TypeError, audioop.rms, data, size)
+        self.assertRaises(TypeError, audioop.avgpp, data, size)
+        self.assertRaises(TypeError, audioop.maxpp, data, size)
+        self.assertRaises(TypeError, audioop.cross, data, size)
+        self.assertRaises(TypeError, audioop.mul, data, size, 1.0)
+        self.assertRaises(TypeError, audioop.tomono, data, size, 0.5, 0.5)
+        self.assertRaises(TypeError, audioop.tostereo, data, size, 0.5, 0.5)
+        self.assertRaises(TypeError, audioop.add, data, data, size)
+        self.assertRaises(TypeError, audioop.bias, data, size, 0)
+        self.assertRaises(TypeError, audioop.reverse, data, size)
+        self.assertRaises(TypeError, audioop.lin2lin, data, size, size)
+        self.assertRaises(TypeError, audioop.ratecv, data, size, 1, 1, 1, None)
+        self.assertRaises(TypeError, audioop.lin2ulaw, data, size)
+        self.assertRaises(TypeError, audioop.lin2alaw, data, size)
+        self.assertRaises(TypeError, audioop.lin2adpcm, data, size, None)
+
     def test_wrongsize(self):
         data = b'abcdefgh'
         state = None
-        for size in (-1, 0, 3, 5, 1024):
+        for size in (-1, 0, 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 --git a/Lib/test/test_base64.py b/Lib/test/test_base64.py
index 13695de..b9738dd 100644
--- a/Lib/test/test_base64.py
+++ b/Lib/test/test_base64.py
@@ -5,10 +5,21 @@
 import os
 import sys
 import subprocess
-
+import struct
+from array import array
 
 
 class LegacyBase64TestCase(unittest.TestCase):
+
+    # Legacy API is not as permissive as the modern API
+    def check_type_errors(self, f):
+        self.assertRaises(TypeError, f, "")
+        self.assertRaises(TypeError, f, [])
+        multidimensional = memoryview(b"1234").cast('B', (2, 2))
+        self.assertRaises(TypeError, f, multidimensional)
+        int_data = memoryview(b"1234").cast('I')
+        self.assertRaises(TypeError, f, int_data)
+
     def test_encodebytes(self):
         eq = self.assertEqual
         eq(base64.encodebytes(b"www.python.org"), b"d3d3LnB5dGhvbi5vcmc=\n")
@@ -24,7 +35,9 @@
            b"Y3ODkhQCMwXiYqKCk7Ojw+LC4gW117fQ==\n")
         # Non-bytes
         eq(base64.encodebytes(bytearray(b'abc')), b'YWJj\n')
-        self.assertRaises(TypeError, base64.encodebytes, "")
+        eq(base64.encodebytes(memoryview(b'abc')), b'YWJj\n')
+        eq(base64.encodebytes(array('B', b'abc')), b'YWJj\n')
+        self.check_type_errors(base64.encodebytes)
 
     def test_decodebytes(self):
         eq = self.assertEqual
@@ -41,7 +54,9 @@
         eq(base64.decodebytes(b''), b'')
         # Non-bytes
         eq(base64.decodebytes(bytearray(b'YWJj\n')), b'abc')
-        self.assertRaises(TypeError, base64.decodebytes, "")
+        eq(base64.decodebytes(memoryview(b'YWJj\n')), b'abc')
+        eq(base64.decodebytes(array('B', b'YWJj\n')), b'abc')
+        self.check_type_errors(base64.decodebytes)
 
     def test_encode(self):
         eq = self.assertEqual
@@ -73,6 +88,42 @@
 
 
 class BaseXYTestCase(unittest.TestCase):
+
+    # Modern API completely ignores exported dimension and format data and
+    # treats any buffer as a stream of bytes
+    def check_encode_type_errors(self, f):
+        self.assertRaises(TypeError, f, "")
+        self.assertRaises(TypeError, f, [])
+
+    def check_decode_type_errors(self, f):
+        self.assertRaises(TypeError, f, [])
+
+    def check_other_types(self, f, bytes_data, expected):
+        eq = self.assertEqual
+        b = bytearray(bytes_data)
+        eq(f(b), expected)
+        # The bytearray wasn't mutated
+        eq(b, bytes_data)
+        eq(f(memoryview(bytes_data)), expected)
+        eq(f(array('B', bytes_data)), expected)
+        # XXX why is b64encode hardcoded here?
+        self.check_nonbyte_element_format(base64.b64encode, bytes_data)
+        self.check_multidimensional(base64.b64encode, bytes_data)
+
+    def check_multidimensional(self, f, data):
+        padding = b"\x00" if len(data) % 2 else b""
+        bytes_data = data + padding # Make sure cast works
+        shape = (len(bytes_data) // 2, 2)
+        multidimensional = memoryview(bytes_data).cast('B', shape)
+        self.assertEqual(f(multidimensional), f(bytes_data))
+
+    def check_nonbyte_element_format(self, f, data):
+        padding = b"\x00" * ((4 - len(data)) % 4)
+        bytes_data = data + padding # Make sure cast works
+        int_data = memoryview(bytes_data).cast('I')
+        self.assertEqual(f(int_data), f(bytes_data))
+
+
     def test_b64encode(self):
         eq = self.assertEqual
         # Test default alphabet
@@ -90,13 +141,16 @@
            b"Y3ODkhQCMwXiYqKCk7Ojw+LC4gW117fQ==")
         # Test with arbitrary alternative characters
         eq(base64.b64encode(b'\xd3V\xbeo\xf7\x1d', altchars=b'*$'), b'01a*b$cd')
-        # Non-bytes
-        eq(base64.b64encode(bytearray(b'abcd')), b'YWJjZA==')
         eq(base64.b64encode(b'\xd3V\xbeo\xf7\x1d', altchars=bytearray(b'*$')),
            b'01a*b$cd')
-        # Check if passing a str object raises an error
-        self.assertRaises(TypeError, base64.b64encode, "")
-        self.assertRaises(TypeError, base64.b64encode, b"", altchars="")
+        eq(base64.b64encode(b'\xd3V\xbeo\xf7\x1d', altchars=memoryview(b'*$')),
+           b'01a*b$cd')
+        eq(base64.b64encode(b'\xd3V\xbeo\xf7\x1d', altchars=array('B', b'*$')),
+           b'01a*b$cd')
+        # Non-bytes
+        self.check_other_types(base64.b64encode, b'abcd', b'YWJjZA==')
+        self.check_encode_type_errors(base64.b64encode)
+        self.assertRaises(TypeError, base64.b64encode, b"", altchars="*$")
         # Test standard alphabet
         eq(base64.standard_b64encode(b"www.python.org"), b"d3d3LnB5dGhvbi5vcmc=")
         eq(base64.standard_b64encode(b"a"), b"YQ==")
@@ -110,15 +164,15 @@
            b"RUZHSElKS0xNTk9QUVJTVFVWV1hZWjAxMjM0NT"
            b"Y3ODkhQCMwXiYqKCk7Ojw+LC4gW117fQ==")
         # Non-bytes
-        eq(base64.standard_b64encode(bytearray(b'abcd')), b'YWJjZA==')
-        # Check if passing a str object raises an error
-        self.assertRaises(TypeError, base64.standard_b64encode, "")
+        self.check_other_types(base64.standard_b64encode,
+                               b'abcd', b'YWJjZA==')
+        self.check_encode_type_errors(base64.standard_b64encode)
         # Test with 'URL safe' alternative characters
         eq(base64.urlsafe_b64encode(b'\xd3V\xbeo\xf7\x1d'), b'01a-b_cd')
         # Non-bytes
-        eq(base64.urlsafe_b64encode(bytearray(b'\xd3V\xbeo\xf7\x1d')), b'01a-b_cd')
-        # Check if passing a str object raises an error
-        self.assertRaises(TypeError, base64.urlsafe_b64encode, "")
+        self.check_other_types(base64.urlsafe_b64encode,
+                               b'\xd3V\xbeo\xf7\x1d', b'01a-b_cd')
+        self.check_encode_type_errors(base64.urlsafe_b64encode)
 
     def test_b64decode(self):
         eq = self.assertEqual
@@ -141,7 +195,8 @@
             eq(base64.b64decode(data), res)
             eq(base64.b64decode(data.decode('ascii')), res)
         # Non-bytes
-        eq(base64.b64decode(bytearray(b"YWJj")), b"abc")
+        self.check_other_types(base64.b64decode, b"YWJj", b"abc")
+        self.check_decode_type_errors(base64.b64decode)
 
         # Test with arbitrary alternative characters
         tests_altchars = {(b'01a*b$cd', b'*$'): b'\xd3V\xbeo\xf7\x1d',
@@ -160,7 +215,8 @@
             eq(base64.standard_b64decode(data), res)
             eq(base64.standard_b64decode(data.decode('ascii')), res)
         # Non-bytes
-        eq(base64.standard_b64decode(bytearray(b"YWJj")), b"abc")
+        self.check_other_types(base64.standard_b64decode, b"YWJj", b"abc")
+        self.check_decode_type_errors(base64.standard_b64decode)
 
         # Test with 'URL safe' alternative characters
         tests_urlsafe = {b'01a-b_cd': b'\xd3V\xbeo\xf7\x1d',
@@ -170,7 +226,9 @@
             eq(base64.urlsafe_b64decode(data), res)
             eq(base64.urlsafe_b64decode(data.decode('ascii')), res)
         # Non-bytes
-        eq(base64.urlsafe_b64decode(bytearray(b'01a-b_cd')), b'\xd3V\xbeo\xf7\x1d')
+        self.check_other_types(base64.urlsafe_b64decode, b'01a-b_cd',
+                               b'\xd3V\xbeo\xf7\x1d')
+        self.check_decode_type_errors(base64.urlsafe_b64decode)
 
     def test_b64decode_padding_error(self):
         self.assertRaises(binascii.Error, base64.b64decode, b'abc')
@@ -205,8 +263,8 @@
         eq(base64.b32encode(b'abcd'), b'MFRGGZA=')
         eq(base64.b32encode(b'abcde'), b'MFRGGZDF')
         # Non-bytes
-        eq(base64.b32encode(bytearray(b'abcd')), b'MFRGGZA=')
-        self.assertRaises(TypeError, base64.b32encode, "")
+        self.check_other_types(base64.b32encode, b'abcd', b'MFRGGZA=')
+        self.check_encode_type_errors(base64.b32encode)
 
     def test_b32decode(self):
         eq = self.assertEqual
@@ -222,7 +280,8 @@
             eq(base64.b32decode(data), res)
             eq(base64.b32decode(data.decode('ascii')), res)
         # Non-bytes
-        eq(base64.b32decode(bytearray(b'MFRGG===')), b'abc')
+        self.check_other_types(base64.b32decode, b'MFRGG===', b"abc")
+        self.check_decode_type_errors(base64.b32decode)
 
     def test_b32decode_casefold(self):
         eq = self.assertEqual
@@ -277,8 +336,9 @@
         eq(base64.b16encode(b'\x01\x02\xab\xcd\xef'), b'0102ABCDEF')
         eq(base64.b16encode(b'\x00'), b'00')
         # Non-bytes
-        eq(base64.b16encode(bytearray(b'\x01\x02\xab\xcd\xef')), b'0102ABCDEF')
-        self.assertRaises(TypeError, base64.b16encode, "")
+        self.check_other_types(base64.b16encode, b'\x01\x02\xab\xcd\xef',
+                               b'0102ABCDEF')
+        self.check_encode_type_errors(base64.b16encode)
 
     def test_b16decode(self):
         eq = self.assertEqual
@@ -293,14 +353,268 @@
         eq(base64.b16decode(b'0102abcdef', True), b'\x01\x02\xab\xcd\xef')
         eq(base64.b16decode('0102abcdef', True), b'\x01\x02\xab\xcd\xef')
         # Non-bytes
-        eq(base64.b16decode(bytearray(b"0102ABCDEF")), b'\x01\x02\xab\xcd\xef')
+        self.check_other_types(base64.b16decode, b"0102ABCDEF",
+                               b'\x01\x02\xab\xcd\xef')
+        self.check_decode_type_errors(base64.b16decode)
+        eq(base64.b16decode(bytearray(b"0102abcdef"), True),
+           b'\x01\x02\xab\xcd\xef')
+        eq(base64.b16decode(memoryview(b"0102abcdef"), True),
+           b'\x01\x02\xab\xcd\xef')
+        eq(base64.b16decode(array('B', b"0102abcdef"), True),
+           b'\x01\x02\xab\xcd\xef')
+
+    def test_a85encode(self):
+        eq = self.assertEqual
+
+        tests = {
+            b'': b'',
+            b"www.python.org": b'GB\\6`E-ZP=Df.1GEb>',
+            bytes(range(255)): b"""!!*-'"9eu7#RLhG$k3[W&.oNg'GVB"(`=52*$$"""
+               b"""(B+<_pR,UFcb-n-Vr/1iJ-0JP==1c70M3&s#]4?Ykm5X@_(6q'R884cE"""
+               b"""H9MJ8X:f1+h<)lt#=BSg3>[:ZC?t!MSA7]@cBPD3sCi+'.E,fo>FEMbN"""
+               b"""G^4U^I!pHnJ:W<)KS>/9Ll%"IN/`jYOHG]iPa.Q$R$jD4S=Q7DTV8*TU"""
+               b"""nsrdW2ZetXKAY/Yd(L?['d?O\\@K2_]Y2%o^qmn*`5Ta:aN;TJbg"GZd"""
+               b"""*^:jeCE.%f\\,!5gtgiEi8N\\UjQ5OekiqBum-X60nF?)@o_%qPq"ad`"""
+               b"""r;HT""",
+            b"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
+                b"0123456789!@#0^&*();:<>,. []{}":
+                b'@:E_WAS,RgBkhF"D/O92EH6,BF`qtRH$VbC6UX@47n?3D92&&T'
+                b":Jand;cHat='/U/0JP==1c70M3&r-I,;<FN.OZ`-3]oSW/g+A(H[P",
+            b"no padding..": b'DJpY:@:Wn_DJ(RS',
+            b"zero compression\0\0\0\0": b'H=_,8+Cf>,E,oN2F(oQ1z',
+            b"zero compression\0\0\0": b'H=_,8+Cf>,E,oN2F(oQ1!!!!',
+            b"Boundary:\0\0\0\0": b'6>q!aA79M(3WK-[!!',
+            b"Space compr:    ": b';fH/TAKYK$D/aMV+<VdL',
+            b'\xff': b'rr',
+            b'\xff'*2: b's8N',
+            b'\xff'*3: b's8W*',
+            b'\xff'*4: b's8W-!',
+            }
+
+        for data, res in tests.items():
+            eq(base64.a85encode(data), res, data)
+            eq(base64.a85encode(data, adobe=False), res, data)
+            eq(base64.a85encode(data, adobe=True), b'<~' + res + b'~>', data)
+
+        self.check_other_types(base64.a85encode, b"www.python.org",
+                               b'GB\\6`E-ZP=Df.1GEb>')
+
+        self.assertRaises(TypeError, base64.a85encode, "")
+
+        eq(base64.a85encode(b"www.python.org", wrapcol=7, adobe=False),
+           b'GB\\6`E-\nZP=Df.1\nGEb>')
+        eq(base64.a85encode(b"\0\0\0\0www.python.org", wrapcol=7, adobe=False),
+           b'zGB\\6`E\n-ZP=Df.\n1GEb>')
+        eq(base64.a85encode(b"www.python.org", wrapcol=7, adobe=True),
+           b'<~GB\\6`\nE-ZP=Df\n.1GEb>\n~>')
+
+        eq(base64.a85encode(b' '*8, foldspaces=True, adobe=False), b'yy')
+        eq(base64.a85encode(b' '*7, foldspaces=True, adobe=False), b'y+<Vd')
+        eq(base64.a85encode(b' '*6, foldspaces=True, adobe=False), b'y+<U')
+        eq(base64.a85encode(b' '*5, foldspaces=True, adobe=False), b'y+9')
+
+    def test_b85encode(self):
+        eq = self.assertEqual
+
+        tests = {
+            b'': b'',
+            b'www.python.org': b'cXxL#aCvlSZ*DGca%T',
+            bytes(range(255)): b"""009C61O)~M2nh-c3=Iws5D^j+6crX17#SKH9337X"""
+                b"""AR!_nBqb&%C@Cr{EG;fCFflSSG&MFiI5|2yJUu=?KtV!7L`6nNNJ&ad"""
+                b"""OifNtP*GA-R8>}2SXo+ITwPvYU}0ioWMyV&XlZI|Y;A6DaB*^Tbai%j"""
+                b"""czJqze0_d@fPsR8goTEOh>41ejE#<ukdcy;l$Dm3n3<ZJoSmMZprN9p"""
+                b"""q@|{(sHv)}tgWuEu(7hUw6(UkxVgH!yuH4^z`?@9#Kp$P$jQpf%+1cv"""
+                b"""(9zP<)YaD4*xB0K+}+;a;Njxq<mKk)=;`X~?CtLF@bU8V^!4`l`1$(#"""
+                b"""{Qdp""",
+            b"""abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"""
+                b"""0123456789!@#0^&*();:<>,. []{}""":
+                b"""VPa!sWoBn+X=-b1ZEkOHadLBXb#`}nd3r%YLqtVJM@UIZOH55pPf$@("""
+                b"""Q&d$}S6EqEFflSSG&MFiI5{CeBQRbjDkv#CIy^osE+AW7dwl""",
+            b'no padding..': b'Zf_uPVPs@!Zf7no',
+            b'zero compression\x00\x00\x00\x00': b'dS!BNAY*TBaB^jHb7^mG00000',
+            b'zero compression\x00\x00\x00': b'dS!BNAY*TBaB^jHb7^mG0000',
+            b"""Boundary:\x00\x00\x00\x00""": b"""LT`0$WMOi7IsgCw00""",
+            b'Space compr:    ': b'Q*dEpWgug3ZE$irARr(h',
+            b'\xff': b'{{',
+            b'\xff'*2: b'|Nj',
+            b'\xff'*3: b'|Ns9',
+            b'\xff'*4: b'|NsC0',
+        }
+
+        for data, res in tests.items():
+            eq(base64.b85encode(data), res)
+
+        self.check_other_types(base64.b85encode, b"www.python.org",
+                               b'cXxL#aCvlSZ*DGca%T')
+
+    def test_a85decode(self):
+        eq = self.assertEqual
+
+        tests = {
+            b'': b'',
+            b'GB\\6`E-ZP=Df.1GEb>': b'www.python.org',
+            b"""! ! * -'"\n\t\t9eu\r\n7#  RL\vhG$k3[W&.oNg'GVB"(`=52*$$"""
+               b"""(B+<_pR,UFcb-n-Vr/1iJ-0JP==1c70M3&s#]4?Ykm5X@_(6q'R884cE"""
+               b"""H9MJ8X:f1+h<)lt#=BSg3>[:ZC?t!MSA7]@cBPD3sCi+'.E,fo>FEMbN"""
+               b"""G^4U^I!pHnJ:W<)KS>/9Ll%"IN/`jYOHG]iPa.Q$R$jD4S=Q7DTV8*TU"""
+               b"""nsrdW2ZetXKAY/Yd(L?['d?O\\@K2_]Y2%o^qmn*`5Ta:aN;TJbg"GZd"""
+               b"""*^:jeCE.%f\\,!5gtgiEi8N\\UjQ5OekiqBum-X60nF?)@o_%qPq"ad`"""
+               b"""r;HT""": bytes(range(255)),
+            b"""@:E_WAS,RgBkhF"D/O92EH6,BF`qtRH$VbC6UX@47n?3D92&&T:Jand;c"""
+                b"""Hat='/U/0JP==1c70M3&r-I,;<FN.OZ`-3]oSW/g+A(H[P""":
+                b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234'
+                b'56789!@#0^&*();:<>,. []{}',
+            b'DJpY:@:Wn_DJ(RS': b'no padding..',
+            b'H=_,8+Cf>,E,oN2F(oQ1z': b'zero compression\x00\x00\x00\x00',
+            b'H=_,8+Cf>,E,oN2F(oQ1!!!!': b'zero compression\x00\x00\x00',
+            b'6>q!aA79M(3WK-[!!': b"Boundary:\x00\x00\x00\x00",
+            b';fH/TAKYK$D/aMV+<VdL': b'Space compr:    ',
+            b'rr': b'\xff',
+            b's8N': b'\xff'*2,
+            b's8W*': b'\xff'*3,
+            b's8W-!': b'\xff'*4,
+            }
+
+        for data, res in tests.items():
+            eq(base64.a85decode(data), res, data)
+            eq(base64.a85decode(data, adobe=False), res, data)
+            eq(base64.a85decode(data.decode("ascii"), adobe=False), res, data)
+            eq(base64.a85decode(b'<~' + data + b'~>', adobe=True), res, data)
+            eq(base64.a85decode('<~%s~>' % data.decode("ascii"), adobe=True),
+               res, data)
+
+        eq(base64.a85decode(b'yy', foldspaces=True, adobe=False), b' '*8)
+        eq(base64.a85decode(b'y+<Vd', foldspaces=True, adobe=False), b' '*7)
+        eq(base64.a85decode(b'y+<U', foldspaces=True, adobe=False), b' '*6)
+        eq(base64.a85decode(b'y+9', foldspaces=True, adobe=False), b' '*5)
+
+        self.check_other_types(base64.a85decode, b'GB\\6`E-ZP=Df.1GEb>',
+                               b"www.python.org")
+
+    def test_b85decode(self):
+        eq = self.assertEqual
+
+        tests = {
+            b'': b'',
+            b'cXxL#aCvlSZ*DGca%T': b'www.python.org',
+            b"""009C61O)~M2nh-c3=Iws5D^j+6crX17#SKH9337X"""
+                b"""AR!_nBqb&%C@Cr{EG;fCFflSSG&MFiI5|2yJUu=?KtV!7L`6nNNJ&ad"""
+                b"""OifNtP*GA-R8>}2SXo+ITwPvYU}0ioWMyV&XlZI|Y;A6DaB*^Tbai%j"""
+                b"""czJqze0_d@fPsR8goTEOh>41ejE#<ukdcy;l$Dm3n3<ZJoSmMZprN9p"""
+                b"""q@|{(sHv)}tgWuEu(7hUw6(UkxVgH!yuH4^z`?@9#Kp$P$jQpf%+1cv"""
+                b"""(9zP<)YaD4*xB0K+}+;a;Njxq<mKk)=;`X~?CtLF@bU8V^!4`l`1$(#"""
+                b"""{Qdp""": bytes(range(255)),
+            b"""VPa!sWoBn+X=-b1ZEkOHadLBXb#`}nd3r%YLqtVJM@UIZOH55pPf$@("""
+                b"""Q&d$}S6EqEFflSSG&MFiI5{CeBQRbjDkv#CIy^osE+AW7dwl""":
+                b"""abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"""
+                b"""0123456789!@#0^&*();:<>,. []{}""",
+            b'Zf_uPVPs@!Zf7no': b'no padding..',
+            b'dS!BNAY*TBaB^jHb7^mG00000': b'zero compression\x00\x00\x00\x00',
+            b'dS!BNAY*TBaB^jHb7^mG0000': b'zero compression\x00\x00\x00',
+            b"""LT`0$WMOi7IsgCw00""": b"""Boundary:\x00\x00\x00\x00""",
+            b'Q*dEpWgug3ZE$irARr(h': b'Space compr:    ',
+            b'{{': b'\xff',
+            b'|Nj': b'\xff'*2,
+            b'|Ns9': b'\xff'*3,
+            b'|NsC0': b'\xff'*4,
+        }
+
+        for data, res in tests.items():
+            eq(base64.b85decode(data), res)
+            eq(base64.b85decode(data.decode("ascii")), res)
+
+        self.check_other_types(base64.b85decode, b'cXxL#aCvlSZ*DGca%T',
+                               b"www.python.org")
+
+    def test_a85_padding(self):
+        eq = self.assertEqual
+
+        eq(base64.a85encode(b"x", pad=True), b'GQ7^D')
+        eq(base64.a85encode(b"xx", pad=True), b"G^'2g")
+        eq(base64.a85encode(b"xxx", pad=True), b'G^+H5')
+        eq(base64.a85encode(b"xxxx", pad=True), b'G^+IX')
+        eq(base64.a85encode(b"xxxxx", pad=True), b'G^+IXGQ7^D')
+
+        eq(base64.a85decode(b'GQ7^D'), b"x\x00\x00\x00")
+        eq(base64.a85decode(b"G^'2g"), b"xx\x00\x00")
+        eq(base64.a85decode(b'G^+H5'), b"xxx\x00")
+        eq(base64.a85decode(b'G^+IX'), b"xxxx")
+        eq(base64.a85decode(b'G^+IXGQ7^D'), b"xxxxx\x00\x00\x00")
+
+    def test_b85_padding(self):
+        eq = self.assertEqual
+
+        eq(base64.b85encode(b"x", pad=True), b'cmMzZ')
+        eq(base64.b85encode(b"xx", pad=True), b'cz6H+')
+        eq(base64.b85encode(b"xxx", pad=True), b'czAdK')
+        eq(base64.b85encode(b"xxxx", pad=True), b'czAet')
+        eq(base64.b85encode(b"xxxxx", pad=True), b'czAetcmMzZ')
+
+        eq(base64.b85decode(b'cmMzZ'), b"x\x00\x00\x00")
+        eq(base64.b85decode(b'cz6H+'), b"xx\x00\x00")
+        eq(base64.b85decode(b'czAdK'), b"xxx\x00")
+        eq(base64.b85decode(b'czAet'), b"xxxx")
+        eq(base64.b85decode(b'czAetcmMzZ'), b"xxxxx\x00\x00\x00")
+
+    def test_a85decode_errors(self):
+        illegal = (set(range(32)) | set(range(118, 256))) - set(b' \t\n\r\v')
+        for c in illegal:
+            with self.assertRaises(ValueError, msg=bytes([c])):
+                base64.a85decode(b'!!!!' + bytes([c]))
+            with self.assertRaises(ValueError, msg=bytes([c])):
+                base64.a85decode(b'!!!!' + bytes([c]), adobe=False)
+            with self.assertRaises(ValueError, msg=bytes([c])):
+                base64.a85decode(b'<~!!!!' + bytes([c]) + b'~>', adobe=True)
+
+        self.assertRaises(ValueError, base64.a85decode,
+                                      b"malformed", adobe=True)
+        self.assertRaises(ValueError, base64.a85decode,
+                                      b"<~still malformed", adobe=True)
+        self.assertRaises(ValueError, base64.a85decode,
+                                      b"also malformed~>", adobe=True)
+
+        # With adobe=False (the default), Adobe framing markers are disallowed
+        self.assertRaises(ValueError, base64.a85decode,
+                                      b"<~~>")
+        self.assertRaises(ValueError, base64.a85decode,
+                                      b"<~~>", adobe=False)
+        base64.a85decode(b"<~~>", adobe=True)  # sanity check
+
+        self.assertRaises(ValueError, base64.a85decode,
+                                      b"abcx", adobe=False)
+        self.assertRaises(ValueError, base64.a85decode,
+                                      b"abcdey", adobe=False)
+        self.assertRaises(ValueError, base64.a85decode,
+                                      b"a b\nc", adobe=False, ignorechars=b"")
+
+        self.assertRaises(ValueError, base64.a85decode, b's', adobe=False)
+        self.assertRaises(ValueError, base64.a85decode, b's8', adobe=False)
+        self.assertRaises(ValueError, base64.a85decode, b's8W', adobe=False)
+        self.assertRaises(ValueError, base64.a85decode, b's8W-', adobe=False)
+        self.assertRaises(ValueError, base64.a85decode, b's8W-"', adobe=False)
+
+    def test_b85decode_errors(self):
+        illegal = list(range(33)) + \
+                  list(b'"\',./:[\\]') + \
+                  list(range(128, 256))
+        for c in illegal:
+            with self.assertRaises(ValueError, msg=bytes([c])):
+                base64.b85decode(b'0000' + bytes([c]))
+
+        self.assertRaises(ValueError, base64.b85decode, b'|')
+        self.assertRaises(ValueError, base64.b85decode, b'|N')
+        self.assertRaises(ValueError, base64.b85decode, b'|Ns')
+        self.assertRaises(ValueError, base64.b85decode, b'|NsC')
+        self.assertRaises(ValueError, base64.b85decode, b'|NsC1')
 
     def test_decode_nonascii_str(self):
         decode_funcs = (base64.b64decode,
                         base64.standard_b64decode,
                         base64.urlsafe_b64decode,
                         base64.b32decode,
-                        base64.b16decode)
+                        base64.b16decode,
+                        base64.b85decode,
+                        base64.a85decode)
         for f in decode_funcs:
             self.assertRaises(ValueError, f, 'with non-ascii \xcb')
 
diff --git a/Lib/test/test_binascii.py b/Lib/test/test_binascii.py
index 04d8f9d..22d53af 100644
--- a/Lib/test/test_binascii.py
+++ b/Lib/test/test_binascii.py
@@ -162,7 +162,9 @@
         self.assertRaises(binascii.Error, binascii.a2b_hex, t[:-1])
         self.assertRaises(binascii.Error, binascii.a2b_hex, t[:-1] + b'q')
 
-        self.assertEqual(binascii.hexlify(b'a'), b'61')
+        # Confirm that b2a_hex == hexlify and a2b_hex == unhexlify
+        self.assertEqual(binascii.hexlify(self.type2test(s)), t)
+        self.assertEqual(binascii.unhexlify(self.type2test(t)), u)
 
     def test_qp(self):
         # A test for SF bug 534347 (segfaults without the proper fix)
diff --git a/Lib/test/test_binop.py b/Lib/test/test_binop.py
index 8417916..9c4c18e 100644
--- a/Lib/test/test_binop.py
+++ b/Lib/test/test_binop.py
@@ -194,10 +194,6 @@
             return float(self) == other
         return NotImplemented
 
-    def __ne__(self, other):
-        """Compare two Rats for inequality."""
-        return not self == other
-
 class RatTestCase(unittest.TestCase):
     """Unit tests for Rat class and its support utilities."""
 
diff --git a/Lib/test/test_bisect.py b/Lib/test/test_bisect.py
index 7b9bd19..580a963 100644
--- a/Lib/test/test_bisect.py
+++ b/Lib/test/test_bisect.py
@@ -7,7 +7,7 @@
 c_bisect = support.import_fresh_module('bisect', fresh=['_bisect'])
 
 class Range(object):
-    """A trivial range()-like object without any integer width limitations."""
+    """A trivial range()-like object that has an insert() method."""
     def __init__(self, start, stop):
         self.start = start
         self.stop = stop
@@ -120,10 +120,10 @@
     def test_negative_lo(self):
         # Issue 3301
         mod = self.module
-        self.assertRaises(ValueError, mod.bisect_left, [1, 2, 3], 5, -1, 3),
-        self.assertRaises(ValueError, mod.bisect_right, [1, 2, 3], 5, -1, 3),
-        self.assertRaises(ValueError, mod.insort_left, [1, 2, 3], 5, -1, 3),
-        self.assertRaises(ValueError, mod.insort_right, [1, 2, 3], 5, -1, 3),
+        self.assertRaises(ValueError, mod.bisect_left, [1, 2, 3], 5, -1, 3)
+        self.assertRaises(ValueError, mod.bisect_right, [1, 2, 3], 5, -1, 3)
+        self.assertRaises(ValueError, mod.insort_left, [1, 2, 3], 5, -1, 3)
+        self.assertRaises(ValueError, mod.insort_right, [1, 2, 3], 5, -1, 3)
 
     def test_large_range(self):
         # Issue 13496
diff --git a/Lib/test/test_bool.py b/Lib/test/test_bool.py
index 4bab28b..2507439 100644
--- a/Lib/test/test_bool.py
+++ b/Lib/test/test_bool.py
@@ -269,10 +269,9 @@
 
     def test_pickle(self):
         import pickle
-        self.assertIs(pickle.loads(pickle.dumps(True)), True)
-        self.assertIs(pickle.loads(pickle.dumps(False)), False)
-        self.assertIs(pickle.loads(pickle.dumps(True, True)), True)
-        self.assertIs(pickle.loads(pickle.dumps(False, True)), False)
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            self.assertIs(pickle.loads(pickle.dumps(True, proto)), True)
+            self.assertIs(pickle.loads(pickle.dumps(False, proto)), False)
 
     def test_picklevalues(self):
         # Test for specific backwards-compatible pickle values
diff --git a/Lib/test/test_buffer.py b/Lib/test/test_buffer.py
index 04e3f61..1667847 100644
--- a/Lib/test/test_buffer.py
+++ b/Lib/test/test_buffer.py
@@ -4290,9 +4290,5 @@
         self.assertRaises(BufferError, memoryview, x)
 
 
-def test_main():
-    support.run_unittest(TestBufferProtocol)
-
-
 if __name__ == "__main__":
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py
index c342a43..14366c6 100644
--- a/Lib/test/test_builtin.py
+++ b/Lib/test/test_builtin.py
@@ -16,6 +16,7 @@
 import warnings
 from operator import neg
 from test.support import TESTFN, unlink,  run_unittest, check_warnings
+from test.script_helper import assert_python_ok
 try:
     import pty, signal
 except ImportError:
@@ -120,9 +121,9 @@
 
 class BuiltinTest(unittest.TestCase):
     # Helper to check picklability
-    def check_iter_pickle(self, it, seq):
+    def check_iter_pickle(self, it, seq, proto):
         itorg = it
-        d = pickle.dumps(it)
+        d = pickle.dumps(it, proto)
         it = pickle.loads(d)
         self.assertEqual(type(itorg), type(it))
         self.assertEqual(list(it), seq)
@@ -133,7 +134,7 @@
             next(it)
         except StopIteration:
             return
-        d = pickle.dumps(it)
+        d = pickle.dumps(it, proto)
         it = pickle.loads(d)
         self.assertEqual(list(it), seq[1:])
 
@@ -464,6 +465,11 @@
         self.assertRaises(TypeError, eval, ())
         self.assertRaises(SyntaxError, eval, bom[:2] + b'a')
 
+        class X:
+            def __getitem__(self, key):
+                raise ValueError
+        self.assertRaises(ValueError, eval, "foo", {}, X())
+
     def test_general_eval(self):
         # Tests that general mappings can be used for the locals argument
 
@@ -579,7 +585,10 @@
                 raise frozendict_error("frozendict is readonly")
 
         # read-only builtins
-        frozen_builtins = frozendict(__builtins__)
+        if isinstance(__builtins__, types.ModuleType):
+            frozen_builtins = frozendict(__builtins__.__dict__)
+        else:
+            frozen_builtins = frozendict(__builtins__)
         code = compile("__builtins__['superglobal']=2; print(superglobal)", "test", "exec")
         self.assertRaises(frozendict_error,
                           exec, code, {'__builtins__': frozen_builtins})
@@ -627,9 +636,10 @@
         self.assertRaises(TypeError, list, filter(42, (1, 2)))
 
     def test_filter_pickle(self):
-        f1 = filter(filter_char, "abcdeabcde")
-        f2 = filter(filter_char, "abcdeabcde")
-        self.check_iter_pickle(f1, list(f2))
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            f1 = filter(filter_char, "abcdeabcde")
+            f2 = filter(filter_char, "abcdeabcde")
+            self.check_iter_pickle(f1, list(f2), proto)
 
     def test_getattr(self):
         self.assertTrue(getattr(sys, 'stdout') is sys.stdout)
@@ -825,9 +835,10 @@
         self.assertRaises(RuntimeError, list, map(badfunc, range(5)))
 
     def test_map_pickle(self):
-        m1 = map(map_char, "Is this the real life?")
-        m2 = map(map_char, "Is this the real life?")
-        self.check_iter_pickle(m1, list(m2))
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            m1 = map(map_char, "Is this the real life?")
+            m2 = map(map_char, "Is this the real life?")
+            self.check_iter_pickle(m1, list(m2), proto)
 
     def test_max(self):
         self.assertEqual(max('123123'), '3')
@@ -839,8 +850,19 @@
         self.assertEqual(max(1, 2.0, 3), 3)
         self.assertEqual(max(1.0, 2, 3), 3)
 
+        self.assertRaises(TypeError, max)
+        self.assertRaises(TypeError, max, 42)
+        self.assertRaises(ValueError, max, ())
+        class BadSeq:
+            def __getitem__(self, index):
+                raise ValueError
+        self.assertRaises(ValueError, max, BadSeq())
+
         for stmt in (
             "max(key=int)",                 # no args
+            "max(default=None)",
+            "max(1, 2, default=None)",      # require container for default
+            "max(default=None, key=int)",
             "max(1, key=int)",              # single arg not iterable
             "max(1, 2, keystone=int)",      # wrong keyword
             "max(1, 2, key=int, abc=int)",  # two many keywords
@@ -857,6 +879,13 @@
         self.assertEqual(max((1,2), key=neg), 1)    # two elem iterable
         self.assertEqual(max(1, 2, key=neg), 1)     # two elems
 
+        self.assertEqual(max((), default=None), None)    # zero elem iterable
+        self.assertEqual(max((1,), default=None), 1)     # one elem iterable
+        self.assertEqual(max((1,2), default=None), 2)    # two elem iterable
+
+        self.assertEqual(max((), default=1, key=neg), 1)
+        self.assertEqual(max((1, 2), default=3, key=neg), 1)
+
         data = [random.randrange(200) for i in range(100)]
         keys = dict((elem, random.randrange(50)) for elem in data)
         f = keys.__getitem__
@@ -883,6 +912,9 @@
 
         for stmt in (
             "min(key=int)",                 # no args
+            "min(default=None)",
+            "min(1, 2, default=None)",      # require container for default
+            "min(default=None, key=int)",
             "min(1, key=int)",              # single arg not iterable
             "min(1, 2, keystone=int)",      # wrong keyword
             "min(1, 2, key=int, abc=int)",  # two many keywords
@@ -899,6 +931,13 @@
         self.assertEqual(min((1,2), key=neg), 2)    # two elem iterable
         self.assertEqual(min(1, 2, key=neg), 2)     # two elems
 
+        self.assertEqual(min((), default=None), None)    # zero elem iterable
+        self.assertEqual(min((1,), default=None), 1)     # one elem iterable
+        self.assertEqual(min((1,2), default=None), 1)    # two elem iterable
+
+        self.assertEqual(min((), default=1, key=neg), 1)
+        self.assertEqual(min((1, 2), default=1, key=neg), 2)
+
         data = [random.randrange(200) for i in range(100)]
         keys = dict((elem, random.randrange(50)) for elem in data)
         f = keys.__getitem__
@@ -940,29 +979,25 @@
     def write_testfile(self):
         # NB the first 4 lines are also used to test input, below
         fp = open(TESTFN, 'w')
-        try:
+        self.addCleanup(unlink, TESTFN)
+        with fp:
             fp.write('1+1\n')
             fp.write('The quick brown fox jumps over the lazy dog')
             fp.write('.\n')
             fp.write('Dear John\n')
             fp.write('XXX'*100)
             fp.write('YYY'*100)
-        finally:
-            fp.close()
 
     def test_open(self):
         self.write_testfile()
         fp = open(TESTFN, 'r')
-        try:
+        with fp:
             self.assertEqual(fp.readline(4), '1+1\n')
             self.assertEqual(fp.readline(), 'The quick brown fox jumps over the lazy dog.\n')
             self.assertEqual(fp.readline(4), 'Dear')
             self.assertEqual(fp.readline(100), ' John\n')
             self.assertEqual(fp.read(300), 'XXX'*100)
             self.assertEqual(fp.read(1000), 'YYY'*100)
-        finally:
-            fp.close()
-            unlink(TESTFN)
 
     def test_open_default_encoding(self):
         old_environ = dict(os.environ)
@@ -977,15 +1012,17 @@
             self.write_testfile()
             current_locale_encoding = locale.getpreferredencoding(False)
             fp = open(TESTFN, 'w')
-            try:
+            with fp:
                 self.assertEqual(fp.encoding, current_locale_encoding)
-            finally:
-                fp.close()
-                unlink(TESTFN)
         finally:
             os.environ.clear()
             os.environ.update(old_environ)
 
+    def test_open_non_inheritable(self):
+        fileobj = open(__file__)
+        with fileobj:
+            self.assertFalse(os.get_inheritable(fileobj.fileno()))
+
     def test_ord(self):
         self.assertEqual(ord(' '), 32)
         self.assertEqual(ord('A'), 65)
@@ -1096,7 +1133,6 @@
             sys.stdin = savestdin
             sys.stdout = savestdout
             fp.close()
-            unlink(TESTFN)
 
     @unittest.skipUnless(pty, "the pty and signal modules must be available")
     def check_input_tty(self, prompt, terminal_input, stdio_encoding=None):
@@ -1399,8 +1435,9 @@
         a = (1, 2, 3)
         b = (4, 5, 6)
         t = [(1, 4), (2, 5), (3, 6)]
-        z1 = zip(a, b)
-        self.check_iter_pickle(z1, t)
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            z1 = zip(a, b)
+            self.check_iter_pickle(z1, t, proto)
 
     def test_format(self):
         # Test the basic machinery of the format() builtin.  Don't test
@@ -1476,17 +1513,11 @@
         # --------------------------------------------------------------------
         # Issue #7994: object.__format__ with a non-empty format string is
         #  deprecated
-        def test_deprecated_format_string(obj, fmt_str, should_raise_warning):
-            with warnings.catch_warnings(record=True) as w:
-                warnings.simplefilter("always", DeprecationWarning)
-                format(obj, fmt_str)
-            if should_raise_warning:
-                self.assertEqual(len(w), 1)
-                self.assertIsInstance(w[0].message, DeprecationWarning)
-                self.assertIn('object.__format__ with a non-empty format '
-                              'string', str(w[0].message))
+        def test_deprecated_format_string(obj, fmt_str, should_raise):
+            if should_raise:
+                self.assertRaises(TypeError, format, obj, fmt_str)
             else:
-                self.assertEqual(len(w), 0)
+                format(obj, fmt_str)
 
         fmt_strs = ['', 's']
 
@@ -1565,21 +1596,45 @@
         data = 'The quick Brown fox Jumped over The lazy Dog'.split()
         self.assertRaises(TypeError, sorted, data, None, lambda x,y: 0)
 
-def test_main(verbose=None):
-    test_classes = (BuiltinTest, TestSorted)
 
-    run_unittest(*test_classes)
+class ShutdownTest(unittest.TestCase):
 
-    # verify reference counting
-    if verbose and hasattr(sys, "gettotalrefcount"):
-        import gc
-        counts = [None] * 5
-        for i in range(len(counts)):
-            run_unittest(*test_classes)
-            gc.collect()
-            counts[i] = sys.gettotalrefcount()
-        print(counts)
+    def test_cleanup(self):
+        # Issue #19255: builtins are still available at shutdown
+        code = """if 1:
+            import builtins
+            import sys
 
+            class C:
+                def __del__(self):
+                    print("before")
+                    # Check that builtins still exist
+                    len(())
+                    print("after")
+
+            c = C()
+            # Make this module survive until builtins and sys are cleaned
+            builtins.here = sys.modules[__name__]
+            sys.here = sys.modules[__name__]
+            # Create a reference loop so that this module needs to go
+            # through a GC phase.
+            here = sys.modules[__name__]
+            """
+        # Issue #20599: Force ASCII encoding to get a codec implemented in C,
+        # otherwise the codec may be unloaded before C.__del__() is called, and
+        # so print("before") fails because the codec cannot be used to encode
+        # "before" to sys.stdout.encoding. For example, on Windows,
+        # sys.stdout.encoding is the OEM code page and these code pages are
+        # implemented in Python
+        rc, out, err = assert_python_ok("-c", code,
+                                        PYTHONIOENCODING="ascii")
+        self.assertEqual(["before", "after"], out.decode().splitlines())
+
+
+def load_tests(loader, tests, pattern):
+    from doctest import DocTestSuite
+    tests.addTest(DocTestSuite(builtins))
+    return tests
 
 if __name__ == "__main__":
-    test_main(verbose=True)
+    unittest.main()
diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py
index 3c09141..e15807e 100644
--- a/Lib/test/test_bytes.py
+++ b/Lib/test/test_bytes.py
@@ -13,9 +13,11 @@
 import pickle
 import tempfile
 import unittest
+
 import test.support
 import test.string_tests
 import test.buffer_tests
+from test.support import bigaddrspacetest, MAX_Py_ssize_t
 
 
 if sys.flags.bytes_warning:
@@ -98,6 +100,14 @@
         self.assertRaises(TypeError, self.type2test, [0.0])
         self.assertRaises(TypeError, self.type2test, [None])
         self.assertRaises(TypeError, self.type2test, [C()])
+        self.assertRaises(TypeError, self.type2test, 0, 'ascii')
+        self.assertRaises(TypeError, self.type2test, b'', 'ascii')
+        self.assertRaises(TypeError, self.type2test, 0, errors='ignore')
+        self.assertRaises(TypeError, self.type2test, b'', errors='ignore')
+        self.assertRaises(TypeError, self.type2test, '')
+        self.assertRaises(TypeError, self.type2test, '', errors='ignore')
+        self.assertRaises(TypeError, self.type2test, '', b'ascii')
+        self.assertRaises(TypeError, self.type2test, '', 'ascii', b'ignore')
 
     def test_constructor_value_errors(self):
         self.assertRaises(ValueError, self.type2test, [-1])
@@ -111,6 +121,17 @@
         self.assertRaises(ValueError, self.type2test, [sys.maxsize+1])
         self.assertRaises(ValueError, self.type2test, [10**100])
 
+    @bigaddrspacetest
+    def test_constructor_overflow(self):
+        size = MAX_Py_ssize_t
+        self.assertRaises((OverflowError, MemoryError), self.type2test, size)
+        try:
+            # Should either pass or raise an error (e.g. on debug builds with
+            # additional malloc() overhead), but shouldn't crash.
+            bytearray(size - 4)
+        except (OverflowError, MemoryError):
+            pass
+
     def test_compare(self):
         b1 = self.type2test([1, 2, 3])
         b2 = self.type2test([1, 2, 3])
@@ -288,8 +309,23 @@
             self.assertEqual(self.type2test(b"").join(lst), b"abc")
             self.assertEqual(self.type2test(b"").join(tuple(lst)), b"abc")
             self.assertEqual(self.type2test(b"").join(iter(lst)), b"abc")
-        self.assertEqual(self.type2test(b".").join([b"ab", b"cd"]), b"ab.cd")
-        # XXX more...
+        dot_join = self.type2test(b".:").join
+        self.assertEqual(dot_join([b"ab", b"cd"]), b"ab.:cd")
+        self.assertEqual(dot_join([memoryview(b"ab"), b"cd"]), b"ab.:cd")
+        self.assertEqual(dot_join([b"ab", memoryview(b"cd")]), b"ab.:cd")
+        self.assertEqual(dot_join([bytearray(b"ab"), b"cd"]), b"ab.:cd")
+        self.assertEqual(dot_join([b"ab", bytearray(b"cd")]), b"ab.:cd")
+        # Stress it with many items
+        seq = [b"abc"] * 1000
+        expected = b"abc" + b".:abc" * 999
+        self.assertEqual(dot_join(seq), expected)
+        self.assertRaises(TypeError, self.type2test(b" ").join, None)
+        # Error handling and cleanup when some item in the middle of the
+        # sequence has the wrong type.
+        with self.assertRaises(TypeError):
+            dot_join([bytearray(b"ab"), "cd", b"ef"])
+        with self.assertRaises(TypeError):
+            dot_join([memoryview(b"ab"), "cd", b"ef"])
 
     def test_count(self):
         b = self.type2test(b'mississippi')
@@ -519,22 +555,23 @@
                 self.assertEqual(b, q)
 
     def test_iterator_pickling(self):
-        for b in b"", b"a", b"abc", b"\xffab\x80", b"\0\0\377\0\0":
-            it = itorg = iter(self.type2test(b))
-            data = list(self.type2test(b))
-            d = pickle.dumps(it)
-            it = pickle.loads(d)
-            self.assertEqual(type(itorg), type(it))
-            self.assertEqual(list(it), data)
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            for b in b"", b"a", b"abc", b"\xffab\x80", b"\0\0\377\0\0":
+                it = itorg = iter(self.type2test(b))
+                data = list(self.type2test(b))
+                d = pickle.dumps(it, proto)
+                it = pickle.loads(d)
+                self.assertEqual(type(itorg), type(it))
+                self.assertEqual(list(it), data)
 
-            it = pickle.loads(d)
-            try:
-                next(it)
-            except StopIteration:
-                continue
-            d = pickle.dumps(it)
-            it = pickle.loads(d)
-            self.assertEqual(list(it), data[1:])
+                it = pickle.loads(d)
+                try:
+                    next(it)
+                except StopIteration:
+                    continue
+                d = pickle.dumps(it, proto)
+                it = pickle.loads(d)
+                self.assertEqual(list(it), data[1:])
 
     def test_strip(self):
         b = self.type2test(b'mississippi')
@@ -686,7 +723,7 @@
     type2test = bytes
 
     def test_buffer_is_readonly(self):
-        fd = os.dup(sys.stdin.fileno())
+        fd = os.open(__file__, os.O_RDONLY)
         with open(fd, "rb", buffering=0) as f:
             self.assertRaises(TypeError, f.readinto, b"")
 
@@ -765,7 +802,7 @@
         finally:
             try:
                 os.remove(tfn)
-            except os.error:
+            except OSError:
                 pass
 
     def test_reverse(self):
@@ -901,6 +938,15 @@
             with self.assertRaises(ValueError):
                 b[3:4] = elem
 
+    def test_setslice_extend(self):
+        # Exercise the resizing logic (see issue #19087)
+        b = bytearray(range(100))
+        self.assertEqual(list(b), list(range(100)))
+        del b[:10]
+        self.assertEqual(list(b), list(range(10, 100)))
+        b.extend(range(100, 110))
+        self.assertEqual(list(b), list(range(10, 110)))
+
     def test_extended_set_del_slice(self):
         indices = (0, None, 1, 3, 19, 300, 1<<333, -1, -2, -31, -300)
         for start in indices:
@@ -1280,6 +1326,11 @@
             self.assertEqual(val, newval)
             self.assertTrue(val is not newval,
                             expr+' returned val on a mutable object')
+        sep = self.marshal(b'')
+        newval = sep.join([val])
+        self.assertEqual(val, newval)
+        self.assertIsNot(val, newval)
+
 
 class FixedStringTest(test.string_tests.BaseTest):
 
diff --git a/Lib/test/test_bz2.py b/Lib/test/test_bz2.py
index c8c9351..ce012d6 100644
--- a/Lib/test/test_bz2.py
+++ b/Lib/test/test_bz2.py
@@ -1,5 +1,5 @@
 from test import support
-from test.support import TESTFN, bigmemtest, _4G
+from test.support import bigmemtest, _4G
 
 import unittest
 from io import BytesIO
@@ -8,6 +8,7 @@
 import random
 import subprocess
 import sys
+from test.support import unlink
 
 try:
     import threading
@@ -18,10 +19,10 @@
 bz2 = support.import_module('bz2')
 from bz2 import BZ2File, BZ2Compressor, BZ2Decompressor
 
-has_cmdline_bunzip2 = sys.platform not in ("win32", "os2emx")
 
 class BaseTest(unittest.TestCase):
     "Base for other testcases."
+
     TEXT_LINES = [
         b'root:x:0:0:root:/root:/bin/bash\n',
         b'bin:x:1:1:bin:/bin:\n',
@@ -51,13 +52,17 @@
     BAD_DATA = b'this is not a valid bzip2 file'
 
     def setUp(self):
-        self.filename = TESTFN
+        self.filename = support.TESTFN
 
     def tearDown(self):
         if os.path.isfile(self.filename):
             os.unlink(self.filename)
 
-    if has_cmdline_bunzip2:
+    if sys.platform == "win32":
+        # bunzip2 isn't available to run on Windows.
+        def decompress(self, data):
+            return bz2.decompress(data)
+    else:
         def decompress(self, data):
             pop = subprocess.Popen("bunzip2", shell=True,
                                    stdin=subprocess.PIPE,
@@ -71,13 +76,9 @@
                 ret = bz2.decompress(data)
             return ret
 
-    else:
-        # bunzip2 isn't available to run on Windows.
-        def decompress(self, data):
-            return bz2.decompress(data)
 
 class BZ2FileTest(BaseTest):
-    "Test BZ2File type miscellaneous methods."
+    "Test the BZ2File class."
 
     def createTempFile(self, streams=1, suffix=b""):
         with open(self.filename, "wb") as f:
@@ -85,18 +86,12 @@
             f.write(suffix)
 
     def testBadArgs(self):
-        with self.assertRaises(TypeError):
-            BZ2File(123.456)
-        with self.assertRaises(ValueError):
-            BZ2File("/dev/null", "z")
-        with self.assertRaises(ValueError):
-            BZ2File("/dev/null", "rx")
-        with self.assertRaises(ValueError):
-            BZ2File("/dev/null", "rbt")
-        with self.assertRaises(ValueError):
-            BZ2File("/dev/null", compresslevel=0)
-        with self.assertRaises(ValueError):
-            BZ2File("/dev/null", compresslevel=10)
+        self.assertRaises(TypeError, BZ2File, 123.456)
+        self.assertRaises(ValueError, BZ2File, "/dev/null", "z")
+        self.assertRaises(ValueError, BZ2File, "/dev/null", "rx")
+        self.assertRaises(ValueError, BZ2File, "/dev/null", "rbt")
+        self.assertRaises(ValueError, BZ2File, "/dev/null", compresslevel=0)
+        self.assertRaises(ValueError, BZ2File, "/dev/null", compresslevel=10)
 
     def testRead(self):
         self.createTempFile()
@@ -232,9 +227,8 @@
         self.createTempFile()
         bz2f = BZ2File(self.filename)
         bz2f.close()
-        self.assertRaises(ValueError, bz2f.__next__)
-        # This call will deadlock if the above .__next__ call failed to
-        # release the lock.
+        self.assertRaises(ValueError, next, bz2f)
+        # This call will deadlock if the above call failed to release the lock.
         self.assertRaises(ValueError, bz2f.readlines)
 
     def testWrite(self):
@@ -278,8 +272,8 @@
             bz2f.write(b"abc")
 
         with BZ2File(self.filename, "r") as bz2f:
-            self.assertRaises(IOError, bz2f.write, b"a")
-            self.assertRaises(IOError, bz2f.writelines, [b"a"])
+            self.assertRaises(OSError, bz2f.write, b"a")
+            self.assertRaises(OSError, bz2f.writelines, [b"a"])
 
     def testAppend(self):
         with BZ2File(self.filename, "w") as bz2f:
@@ -397,7 +391,7 @@
             bz2f.close()
         self.assertRaises(ValueError, bz2f.seekable)
 
-        bz2f = BZ2File(BytesIO(), mode="w")
+        bz2f = BZ2File(BytesIO(), "w")
         try:
             self.assertFalse(bz2f.seekable())
         finally:
@@ -423,7 +417,7 @@
             bz2f.close()
         self.assertRaises(ValueError, bz2f.readable)
 
-        bz2f = BZ2File(BytesIO(), mode="w")
+        bz2f = BZ2File(BytesIO(), "w")
         try:
             self.assertFalse(bz2f.readable())
         finally:
@@ -440,7 +434,7 @@
             bz2f.close()
         self.assertRaises(ValueError, bz2f.writable)
 
-        bz2f = BZ2File(BytesIO(), mode="w")
+        bz2f = BZ2File(BytesIO(), "w")
         try:
             self.assertTrue(bz2f.writable())
         finally:
@@ -454,7 +448,7 @@
             del o
 
     def testOpenNonexistent(self):
-        self.assertRaises(IOError, BZ2File, "/non/existent")
+        self.assertRaises(OSError, BZ2File, "/non/existent")
 
     def testReadlinesNoNewline(self):
         # Issue #1191043: readlines() fails on a file containing no newline.
@@ -494,7 +488,7 @@
         # Issue #7205: Using a BZ2File from several threads shouldn't deadlock.
         data = b"1" * 2**20
         nthreads = 10
-        with bz2.BZ2File(self.filename, 'wb') as f:
+        with BZ2File(self.filename, 'wb') as f:
             def comp():
                 for i in range(5):
                     f.write(data)
@@ -505,28 +499,27 @@
                 t.join()
 
     def testWithoutThreading(self):
-        bz2 = support.import_fresh_module("bz2", blocked=("threading",))
-        with bz2.BZ2File(self.filename, "wb") as f:
+        module = support.import_fresh_module("bz2", blocked=("threading",))
+        with module.BZ2File(self.filename, "wb") as f:
             f.write(b"abc")
-        with bz2.BZ2File(self.filename, "rb") as f:
+        with module.BZ2File(self.filename, "rb") as f:
             self.assertEqual(f.read(), b"abc")
 
     def testMixedIterationAndReads(self):
         self.createTempFile()
         linelen = len(self.TEXT_LINES[0])
         halflen = linelen // 2
-        with bz2.BZ2File(self.filename) as bz2f:
+        with BZ2File(self.filename) as bz2f:
             bz2f.read(halflen)
             self.assertEqual(next(bz2f), self.TEXT_LINES[0][halflen:])
             self.assertEqual(bz2f.read(), self.TEXT[linelen:])
-        with bz2.BZ2File(self.filename) as bz2f:
+        with BZ2File(self.filename) as bz2f:
             bz2f.readline()
             self.assertEqual(next(bz2f), self.TEXT_LINES[1])
             self.assertEqual(bz2f.readline(), self.TEXT_LINES[2])
-        with bz2.BZ2File(self.filename) as bz2f:
+        with BZ2File(self.filename) as bz2f:
             bz2f.readlines()
-            with self.assertRaises(StopIteration):
-                next(bz2f)
+            self.assertRaises(StopIteration, next, bz2f)
             self.assertEqual(bz2f.readlines(), [])
 
     def testMultiStreamOrdering(self):
@@ -594,6 +587,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()
@@ -639,8 +646,9 @@
             data = None
 
     def testPickle(self):
-        with self.assertRaises(TypeError):
-            pickle.dumps(BZ2Compressor())
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            with self.assertRaises(TypeError):
+                pickle.dumps(BZ2Compressor(), proto)
 
 
 class BZ2DecompressorTest(BaseTest):
@@ -695,8 +703,9 @@
             decompressed = None
 
     def testPickle(self):
-        with self.assertRaises(TypeError):
-            pickle.dumps(BZ2Decompressor())
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            with self.assertRaises(TypeError):
+                pickle.dumps(BZ2Decompressor(), proto)
 
 
 class CompressDecompressTest(BaseTest):
@@ -740,97 +749,122 @@
 
 
 class OpenTest(BaseTest):
+    "Test the open function."
+
+    def open(self, *args, **kwargs):
+        return bz2.open(*args, **kwargs)
+
     def test_binary_modes(self):
-        with bz2.open(self.filename, "wb") as f:
-            f.write(self.TEXT)
-        with open(self.filename, "rb") as f:
-            file_data = bz2.decompress(f.read())
-            self.assertEqual(file_data, self.TEXT)
-        with bz2.open(self.filename, "rb") as f:
-            self.assertEqual(f.read(), self.TEXT)
-        with bz2.open(self.filename, "ab") as f:
-            f.write(self.TEXT)
-        with open(self.filename, "rb") as f:
-            file_data = bz2.decompress(f.read())
-            self.assertEqual(file_data, self.TEXT * 2)
+        for mode in ("wb", "xb"):
+            if mode == "xb":
+                unlink(self.filename)
+            with self.open(self.filename, mode) as f:
+                f.write(self.TEXT)
+            with open(self.filename, "rb") as f:
+                file_data = self.decompress(f.read())
+                self.assertEqual(file_data, self.TEXT)
+            with self.open(self.filename, "rb") as f:
+                self.assertEqual(f.read(), self.TEXT)
+            with self.open(self.filename, "ab") as f:
+                f.write(self.TEXT)
+            with open(self.filename, "rb") as f:
+                file_data = self.decompress(f.read())
+                self.assertEqual(file_data, self.TEXT * 2)
 
     def test_implicit_binary_modes(self):
         # Test implicit binary modes (no "b" or "t" in mode string).
-        with bz2.open(self.filename, "w") as f:
-            f.write(self.TEXT)
-        with open(self.filename, "rb") as f:
-            file_data = bz2.decompress(f.read())
-            self.assertEqual(file_data, self.TEXT)
-        with bz2.open(self.filename, "r") as f:
-            self.assertEqual(f.read(), self.TEXT)
-        with bz2.open(self.filename, "a") as f:
-            f.write(self.TEXT)
-        with open(self.filename, "rb") as f:
-            file_data = bz2.decompress(f.read())
-            self.assertEqual(file_data, self.TEXT * 2)
+        for mode in ("w", "x"):
+            if mode == "x":
+                unlink(self.filename)
+            with self.open(self.filename, mode) as f:
+                f.write(self.TEXT)
+            with open(self.filename, "rb") as f:
+                file_data = self.decompress(f.read())
+                self.assertEqual(file_data, self.TEXT)
+            with self.open(self.filename, "r") as f:
+                self.assertEqual(f.read(), self.TEXT)
+            with self.open(self.filename, "a") as f:
+                f.write(self.TEXT)
+            with open(self.filename, "rb") as f:
+                file_data = self.decompress(f.read())
+                self.assertEqual(file_data, self.TEXT * 2)
 
     def test_text_modes(self):
         text = self.TEXT.decode("ascii")
         text_native_eol = text.replace("\n", os.linesep)
-        with bz2.open(self.filename, "wt") as f:
-            f.write(text)
-        with open(self.filename, "rb") as f:
-            file_data = bz2.decompress(f.read()).decode("ascii")
-            self.assertEqual(file_data, text_native_eol)
-        with bz2.open(self.filename, "rt") as f:
-            self.assertEqual(f.read(), text)
-        with bz2.open(self.filename, "at") as f:
-            f.write(text)
-        with open(self.filename, "rb") as f:
-            file_data = bz2.decompress(f.read()).decode("ascii")
-            self.assertEqual(file_data, text_native_eol * 2)
+        for mode in ("wt", "xt"):
+            if mode == "xt":
+                unlink(self.filename)
+            with self.open(self.filename, mode) as f:
+                f.write(text)
+            with open(self.filename, "rb") as f:
+                file_data = self.decompress(f.read()).decode("ascii")
+                self.assertEqual(file_data, text_native_eol)
+            with self.open(self.filename, "rt") as f:
+                self.assertEqual(f.read(), text)
+            with self.open(self.filename, "at") as f:
+                f.write(text)
+            with open(self.filename, "rb") as f:
+                file_data = self.decompress(f.read()).decode("ascii")
+                self.assertEqual(file_data, text_native_eol * 2)
+
+    def test_x_mode(self):
+        for mode in ("x", "xb", "xt"):
+            unlink(self.filename)
+            with self.open(self.filename, mode) as f:
+                pass
+            with self.assertRaises(FileExistsError):
+                with self.open(self.filename, mode) as f:
+                    pass
 
     def test_fileobj(self):
-        with bz2.open(BytesIO(self.DATA), "r") as f:
+        with self.open(BytesIO(self.DATA), "r") as f:
             self.assertEqual(f.read(), self.TEXT)
-        with bz2.open(BytesIO(self.DATA), "rb") as f:
+        with self.open(BytesIO(self.DATA), "rb") as f:
             self.assertEqual(f.read(), self.TEXT)
         text = self.TEXT.decode("ascii")
-        with bz2.open(BytesIO(self.DATA), "rt") as f:
+        with self.open(BytesIO(self.DATA), "rt") as f:
             self.assertEqual(f.read(), text)
 
     def test_bad_params(self):
         # Test invalid parameter combinations.
-        with self.assertRaises(ValueError):
-            bz2.open(self.filename, "wbt")
-        with self.assertRaises(ValueError):
-            bz2.open(self.filename, "rb", encoding="utf-8")
-        with self.assertRaises(ValueError):
-            bz2.open(self.filename, "rb", errors="ignore")
-        with self.assertRaises(ValueError):
-            bz2.open(self.filename, "rb", newline="\n")
+        self.assertRaises(ValueError,
+                          self.open, self.filename, "wbt")
+        self.assertRaises(ValueError,
+                          self.open, self.filename, "xbt")
+        self.assertRaises(ValueError,
+                          self.open, self.filename, "rb", encoding="utf-8")
+        self.assertRaises(ValueError,
+                          self.open, self.filename, "rb", errors="ignore")
+        self.assertRaises(ValueError,
+                          self.open, self.filename, "rb", newline="\n")
 
     def test_encoding(self):
         # Test non-default encoding.
         text = self.TEXT.decode("ascii")
         text_native_eol = text.replace("\n", os.linesep)
-        with bz2.open(self.filename, "wt", encoding="utf-16-le") as f:
+        with self.open(self.filename, "wt", encoding="utf-16-le") as f:
             f.write(text)
         with open(self.filename, "rb") as f:
-            file_data = bz2.decompress(f.read()).decode("utf-16-le")
+            file_data = self.decompress(f.read()).decode("utf-16-le")
             self.assertEqual(file_data, text_native_eol)
-        with bz2.open(self.filename, "rt", encoding="utf-16-le") as f:
+        with self.open(self.filename, "rt", encoding="utf-16-le") as f:
             self.assertEqual(f.read(), text)
 
     def test_encoding_error_handler(self):
         # Test with non-default encoding error handler.
-        with bz2.open(self.filename, "wb") as f:
+        with self.open(self.filename, "wb") as f:
             f.write(b"foo\xffbar")
-        with bz2.open(self.filename, "rt", encoding="ascii", errors="ignore") \
+        with self.open(self.filename, "rt", encoding="ascii", errors="ignore") \
                 as f:
             self.assertEqual(f.read(), "foobar")
 
     def test_newline(self):
         # Test with explicit newline (universal newline mode disabled).
         text = self.TEXT.decode("ascii")
-        with bz2.open(self.filename, "wt", newline="\n") as f:
+        with self.open(self.filename, "wt", newline="\n") as f:
             f.write(text)
-        with bz2.open(self.filename, "rt", newline="\r") as f:
+        with self.open(self.filename, "rt", newline="\r") as f:
             self.assertEqual(f.readlines(), [text])
 
 
diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py
index 50c4bba..ba7c38d 100644
--- a/Lib/test/test_capi.py
+++ b/Lib/test/test_capi.py
@@ -9,6 +9,7 @@
 import time
 import unittest
 from test import support
+from test.support import MISSING_C_DOCSTRINGS
 try:
     import _posixsubprocess
 except ImportError:
@@ -44,7 +45,7 @@
 
     @unittest.skipUnless(threading, 'Threading required for this test.')
     def test_no_FatalError_infinite_loop(self):
-        with support.suppress_crash_popup():
+        with support.SuppressCrashReport():
             p = subprocess.Popen([sys.executable, "-c",
                                   'import _testcapi;'
                                   '_testcapi.crash_no_current_thread()'],
@@ -110,6 +111,46 @@
         self.assertRaises(TypeError, _posixsubprocess.fork_exec,
                           Z(),[b'1'],3,[1, 2],5,6,7,8,9,10,11,12,13,14,15,16,17)
 
+    @unittest.skipIf(MISSING_C_DOCSTRINGS,
+                     "Signature information for builtins requires docstrings")
+    def test_docstring_signature_parsing(self):
+
+        self.assertEqual(_testcapi.no_docstring.__doc__, None)
+        self.assertEqual(_testcapi.no_docstring.__text_signature__, None)
+
+        self.assertEqual(_testcapi.docstring_empty.__doc__, "")
+        self.assertEqual(_testcapi.docstring_empty.__text_signature__, None)
+
+        self.assertEqual(_testcapi.docstring_no_signature.__doc__,
+            "This docstring has no signature.")
+        self.assertEqual(_testcapi.docstring_no_signature.__text_signature__, None)
+
+        self.assertEqual(_testcapi.docstring_with_invalid_signature.__doc__,
+            "docstring_with_invalid_signature($module, /, boo)\n"
+            "\n"
+            "This docstring has an invalid signature."
+            )
+        self.assertEqual(_testcapi.docstring_with_invalid_signature.__text_signature__, None)
+
+        self.assertEqual(_testcapi.docstring_with_invalid_signature2.__doc__,
+            "docstring_with_invalid_signature2($module, /, boo)\n"
+            "\n"
+            "--\n"
+            "\n"
+            "This docstring also has an invalid signature."
+            )
+        self.assertEqual(_testcapi.docstring_with_invalid_signature2.__text_signature__, None)
+
+        self.assertEqual(_testcapi.docstring_with_signature.__doc__,
+            "This docstring has a valid signature.")
+        self.assertEqual(_testcapi.docstring_with_signature.__text_signature__, "($module, /, sig)")
+
+        self.assertEqual(_testcapi.docstring_with_signature_and_extra_newlines.__doc__,
+            "\nThis docstring has a valid signature and some extra newlines.")
+        self.assertEqual(_testcapi.docstring_with_signature_and_extra_newlines.__text_signature__,
+            "($module, /, parameter)")
+
+
 @unittest.skipUnless(threading, 'Threading required for this test.')
 class TestPendingCalls(unittest.TestCase):
 
@@ -193,6 +234,9 @@
         self.pendingcalls_submit(l, n)
         self.pendingcalls_wait(l, n)
 
+
+class SubinterpreterTest(unittest.TestCase):
+
     def test_subinterps(self):
         import builtins
         r, w = os.pipe()
@@ -203,47 +247,109 @@
                 pickle.dump(id(builtins), f)
             """.format(w)
         with open(r, "rb") as f:
-            ret = _testcapi.run_in_subinterp(code)
+            ret = support.run_in_subinterp(code)
             self.assertEqual(ret, 0)
             self.assertNotEqual(pickle.load(f), id(sys.modules))
             self.assertNotEqual(pickle.load(f), id(builtins))
 
+
 # Bug #6012
 class Test6012(unittest.TestCase):
     def test(self):
         self.assertEqual(_testcapi.argparsing("Hello", "World"), 1)
 
 
-class EmbeddingTest(unittest.TestCase):
-
-    @unittest.skipIf(
-        sys.platform.startswith('win'),
-        "test doesn't work under Windows")
-    def test_subinterps(self):
-        # XXX only tested under Unix checkouts
+class EmbeddingTests(unittest.TestCase):
+    def setUp(self):
         basepath = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
-        oldcwd = os.getcwd()
+        exename = "_testembed"
+        if sys.platform.startswith("win"):
+            ext = ("_d" if "_d" in sys.executable else "") + ".exe"
+            exename += ext
+            exepath = os.path.dirname(sys.executable)
+        else:
+            exepath = os.path.join(basepath, "Modules")
+        self.test_exe = exe = os.path.join(exepath, exename)
+        if not os.path.exists(exe):
+            self.skipTest("%r doesn't exist" % exe)
         # This is needed otherwise we get a fatal error:
         # "Py_Initialize: Unable to get the locale encoding
         # LookupError: no codec search functions registered: can't find encoding"
+        self.oldcwd = os.getcwd()
         os.chdir(basepath)
+
+    def tearDown(self):
+        os.chdir(self.oldcwd)
+
+    def run_embedded_interpreter(self, *args):
+        """Runs a test in the embedded interpreter"""
+        cmd = [self.test_exe]
+        cmd.extend(args)
+        p = subprocess.Popen(cmd,
+                             stdout=subprocess.PIPE,
+                             stderr=subprocess.PIPE)
+        (out, err) = p.communicate()
+        self.assertEqual(p.returncode, 0,
+                         "bad returncode %d, stderr is %r" %
+                         (p.returncode, err))
+        return out.decode("latin1"), err.decode("latin1")
+
+    def test_subinterps(self):
+        # This is just a "don't crash" test
+        out, err = self.run_embedded_interpreter()
+        if support.verbose:
+            print()
+            print(out)
+            print(err)
+
+    @staticmethod
+    def _get_default_pipe_encoding():
+        rp, wp = os.pipe()
         try:
-            exe = os.path.join(basepath, "Modules", "_testembed")
-            if not os.path.exists(exe):
-                self.skipTest("%r doesn't exist" % exe)
-            p = subprocess.Popen([exe],
-                                 stdout=subprocess.PIPE,
-                                 stderr=subprocess.PIPE)
-            (out, err) = p.communicate()
-            self.assertEqual(p.returncode, 0,
-                             "bad returncode %d, stderr is %r" %
-                             (p.returncode, err))
-            if support.verbose:
-                print()
-                print(out.decode('latin1'))
-                print(err.decode('latin1'))
+            with os.fdopen(wp, 'w') as w:
+                default_pipe_encoding = w.encoding
         finally:
-            os.chdir(oldcwd)
+            os.close(rp)
+        return default_pipe_encoding
+
+    def test_forced_io_encoding(self):
+        # Checks forced configuration of embedded interpreter IO streams
+        out, err = self.run_embedded_interpreter("forced_io_encoding")
+        if support.verbose:
+            print()
+            print(out)
+            print(err)
+        expected_stdin_encoding = sys.__stdin__.encoding
+        expected_pipe_encoding = self._get_default_pipe_encoding()
+        expected_output = os.linesep.join([
+        "--- Use defaults ---",
+        "Expected encoding: default",
+        "Expected errors: default",
+        "stdin: {0}:strict",
+        "stdout: {1}:strict",
+        "stderr: {1}:backslashreplace",
+        "--- Set errors only ---",
+        "Expected encoding: default",
+        "Expected errors: surrogateescape",
+        "stdin: {0}:surrogateescape",
+        "stdout: {1}:surrogateescape",
+        "stderr: {1}:backslashreplace",
+        "--- Set encoding only ---",
+        "Expected encoding: latin-1",
+        "Expected errors: default",
+        "stdin: latin-1:strict",
+        "stdout: latin-1:strict",
+        "stderr: latin-1:backslashreplace",
+        "--- Set encoding and errors ---",
+        "Expected encoding: latin-1",
+        "Expected errors: surrogateescape",
+        "stdin: latin-1:surrogateescape",
+        "stdout: latin-1:surrogateescape",
+        "stderr: latin-1:backslashreplace"]).format(expected_stdin_encoding,
+                                                    expected_pipe_encoding)
+        # This is useful if we ever trip over odd platform behaviour
+        self.maxDiff = None
+        self.assertEqual(out.strip(), expected_output)
 
 class SkipitemTest(unittest.TestCase):
 
@@ -355,8 +461,9 @@
     def test__testcapi(self):
         for name in dir(_testcapi):
             if name.startswith('test_'):
-                test = getattr(_testcapi, name)
-                test()
+                with self.subTest("internal", name=name):
+                    test = getattr(_testcapi, name)
+                    test()
 
 if __name__ == "__main__":
     unittest.main()
diff --git a/Lib/test/test_cmd.py b/Lib/test/test_cmd.py
index e9a0211..0c31454 100644
--- a/Lib/test/test_cmd.py
+++ b/Lib/test/test_cmd.py
@@ -229,7 +229,7 @@
     trace = support.import_module('trace')
     tracer=trace.Trace(ignoredirs=[sys.base_prefix, sys.base_exec_prefix,],
                         trace=0, count=1)
-    tracer.run('reload(cmd);test_main()')
+    tracer.run('import importlib; importlib.reload(cmd); test_main()')
     r=tracer.results()
     print("Writing coverage results...")
     r.write_results(show_missing=True, summary=True, coverdir=coverdir)
diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py
index a89d7e4..327c145 100644
--- a/Lib/test/test_cmd_line.py
+++ b/Lib/test/test_cmd_line.py
@@ -4,6 +4,7 @@
 
 import test.support, unittest
 import os
+import shutil
 import sys
 import subprocess
 import tempfile
@@ -41,8 +42,10 @@
 
     def test_version(self):
         version = ('Python %d.%d' % sys.version_info[:2]).encode("ascii")
-        rc, out, err = assert_python_ok('-V')
-        self.assertTrue(err.startswith(version))
+        for switch in '-V', '--version':
+            rc, out, err = assert_python_ok(switch)
+            self.assertFalse(err.startswith(version))
+            self.assertTrue(out.startswith(version))
 
     def test_verbose(self):
         # -v causes imports to write to stderr.  If the write to
@@ -54,14 +57,49 @@
         self.assertNotIn(b'stack overflow', err)
 
     def test_xoptions(self):
-        rc, out, err = assert_python_ok('-c', 'import sys; print(sys._xoptions)')
-        opts = eval(out.splitlines()[0])
+        def get_xoptions(*args):
+            # use subprocess module directly because test.script_helper adds
+            # "-X faulthandler" to the command line
+            args = (sys.executable, '-E') + args
+            args += ('-c', 'import sys; print(sys._xoptions)')
+            out = subprocess.check_output(args)
+            opts = eval(out.splitlines()[0])
+            return opts
+
+        opts = get_xoptions()
         self.assertEqual(opts, {})
-        rc, out, err = assert_python_ok(
-            '-Xa', '-Xb=c,d=e', '-c', 'import sys; print(sys._xoptions)')
-        opts = eval(out.splitlines()[0])
+
+        opts = get_xoptions('-Xa', '-Xb=c,d=e')
         self.assertEqual(opts, {'a': True, 'b': 'c,d=e'})
 
+    def test_showrefcount(self):
+        def run_python(*args):
+            # this is similar to assert_python_ok but doesn't strip
+            # the refcount from stderr.  It can be replaced once
+            # assert_python_ok stops doing that.
+            cmd = [sys.executable]
+            cmd.extend(args)
+            PIPE = subprocess.PIPE
+            p = subprocess.Popen(cmd, stdout=PIPE, stderr=PIPE)
+            out, err = p.communicate()
+            p.stdout.close()
+            p.stderr.close()
+            rc = p.returncode
+            self.assertEqual(rc, 0)
+            return rc, out, err
+        code = 'import sys; print(sys._xoptions)'
+        # normally the refcount is hidden
+        rc, out, err = run_python('-c', code)
+        self.assertEqual(out.rstrip(), b'{}')
+        self.assertEqual(err, b'')
+        # "-X showrefcount" shows the refcount, but only in debug builds
+        rc, out, err = run_python('-X', 'showrefcount', '-c', code)
+        self.assertEqual(out.rstrip(), b"{'showrefcount': True}")
+        if hasattr(sys, 'gettotalrefcount'):  # debug build
+            self.assertRegex(err, br'^\[\d+ refs, \d+ blocks\]')
+        else:
+            self.assertEqual(err, b'')
+
     def test_run_module(self):
         # Test expected operation of the '-m' switch
         # Switch needs an argument
@@ -70,9 +108,9 @@
         assert_python_failure('-m', 'fnord43520xyz')
         # Check the runpy module also gives an error for
         # a nonexistent module
-        assert_python_failure('-m', 'runpy', 'fnord43520xyz'),
+        assert_python_failure('-m', 'runpy', 'fnord43520xyz')
         # All good if module is located and run successfully
-        assert_python_ok('-m', 'timeit', '-n', '1'),
+        assert_python_ok('-m', 'timeit', '-n', '1')
 
     def test_run_module_bug1764407(self):
         # -m and -i need to play well together
@@ -213,6 +251,23 @@
         self.assertIn(path1.encode('ascii'), out)
         self.assertIn(path2.encode('ascii'), out)
 
+    def test_empty_PYTHONPATH_issue16309(self):
+        # On Posix, it is documented that setting PATH to the
+        # empty string is equivalent to not setting PATH at all,
+        # which is an exception to the rule that in a string like
+        # "/bin::/usr/bin" the empty string in the middle gets
+        # interpreted as '.'
+        code = """if 1:
+            import sys
+            path = ":".join(sys.path)
+            path = path.encode("ascii", "backslashreplace")
+            sys.stdout.buffer.write(path)"""
+        rc1, out1, err1 = assert_python_ok('-c', code, PYTHONPATH="")
+        rc2, out2, err2 = assert_python_ok('-c', code, __isolated=False)
+        # regarding to Posix specification, outputs should be equal
+        # for empty and unset PYTHONPATH
+        self.assertEqual(out1, out2)
+
     def test_displayhook_unencodable(self):
         for encoding in ('ascii', 'latin-1', 'utf-8'):
             env = os.environ.copy()
@@ -290,7 +345,7 @@
         rc, out, err = assert_python_ok('-c', code)
         self.assertEqual(b'', out)
         self.assertRegex(err.decode('ascii', 'ignore'),
-                         'Exception OSError: .* ignored')
+                         'Exception ignored in.*\nOSError: .*')
 
     def test_closed_stdout(self):
         # Issue #13444: if stdout has been explicitly closed, we should
@@ -385,6 +440,31 @@
         self.assertEqual(b'', out)
 
 
+    def test_isolatedmode(self):
+        self.verify_valid_flag('-I')
+        self.verify_valid_flag('-IEs')
+        rc, out, err = assert_python_ok('-I', '-c',
+            'from sys import flags as f; '
+            'print(f.no_user_site, f.ignore_environment, f.isolated)',
+            # dummyvar to prevent extranous -E
+            dummyvar="")
+        self.assertEqual(out.strip(), b'1 1 1')
+        with test.support.temp_cwd() as tmpdir:
+            fake = os.path.join(tmpdir, "uuid.py")
+            main = os.path.join(tmpdir, "main.py")
+            with open(fake, "w") as f:
+                f.write("raise RuntimeError('isolated mode test')\n")
+            with open(main, "w") as f:
+                f.write("import uuid\n")
+                f.write("print('ok')\n")
+            self.assertRaises(subprocess.CalledProcessError,
+                              subprocess.check_output,
+                              [sys.executable, main], cwd=tmpdir,
+                              stderr=subprocess.DEVNULL)
+            out = subprocess.check_output([sys.executable, "-I", main],
+                                          cwd=tmpdir)
+            self.assertEqual(out.strip(), b"ok")
+
 def test_main():
     test.support.run_unittest(CmdLineTest)
     test.support.reap_children()
diff --git a/Lib/test/test_cmd_line_script.py b/Lib/test/test_cmd_line_script.py
index b4269b9..88a9e2b 100644
--- a/Lib/test/test_cmd_line_script.py
+++ b/Lib/test/test_cmd_line_script.py
@@ -1,5 +1,6 @@
 # tests command line execution of scripts
 
+import contextlib
 import importlib
 import importlib.machinery
 import zipimport
@@ -8,6 +9,7 @@
 import os
 import os.path
 import py_compile
+import subprocess
 
 import textwrap
 from test import support
@@ -41,11 +43,28 @@
 _loader = __loader__ if __loader__ is BuiltinImporter else type(__loader__)
 print('__loader__==%a' % _loader)
 print('__file__==%a' % __file__)
-assertEqual(__cached__, None)
+print('__cached__==%a' % __cached__)
 print('__package__==%r' % __package__)
+# Check PEP 451 details
+import os.path
+if __package__ is not None:
+    print('__main__ was located through the import system')
+    assertIdentical(__spec__.loader, __loader__)
+    expected_spec_name = os.path.splitext(os.path.basename(__file__))[0]
+    if __package__:
+        expected_spec_name = __package__ + "." + expected_spec_name
+    assertEqual(__spec__.name, expected_spec_name)
+    assertEqual(__spec__.parent, __package__)
+    assertIdentical(__spec__.submodule_search_locations, None)
+    assertEqual(__spec__.origin, __file__)
+    if __spec__.cached is not None:
+        assertEqual(__spec__.cached, __cached__)
 # Check the sys module
 import sys
 assertIdentical(globals(), sys.modules[__name__].__dict__)
+if __spec__ is not None:
+    # XXX: We're not currently making __main__ available under its real name
+    pass # assertIdentical(globals(), sys.modules[__spec__.name].__dict__)
 from test import test_cmd_line_script
 example_args_list = test_cmd_line_script.example_args
 assertEqual(sys.argv[1:], example_args_list)
@@ -123,7 +142,7 @@
         if not __debug__:
             cmd_line_switches += ('-' + 'O' * sys.flags.optimize,)
         run_args = cmd_line_switches + (script_name,) + tuple(example_args)
-        rc, out, err = assert_python_ok(*run_args)
+        rc, out, err = assert_python_ok(*run_args, __isolated=False)
         self._check_output(script_name, rc, out + err, expected_file,
                            expected_argv0, expected_path0,
                            expected_package, expected_loader)
@@ -156,6 +175,53 @@
         expected = repr(importlib.machinery.BuiltinImporter).encode("utf-8")
         self.assertIn(expected, out)
 
+    @contextlib.contextmanager
+    def interactive_python(self, separate_stderr=False):
+        if separate_stderr:
+            p = spawn_python('-i', bufsize=1, stderr=subprocess.PIPE)
+            stderr = p.stderr
+        else:
+            p = spawn_python('-i', bufsize=1, stderr=subprocess.STDOUT)
+            stderr = p.stdout
+        try:
+            # Drain stderr until prompt
+            while True:
+                data = stderr.read(4)
+                if data == b">>> ":
+                    break
+                stderr.readline()
+            yield p
+        finally:
+            kill_python(p)
+            stderr.close()
+
+    def check_repl_stdout_flush(self, separate_stderr=False):
+        with self.interactive_python(separate_stderr) as p:
+            p.stdin.write(b"print('foo')\n")
+            p.stdin.flush()
+            self.assertEqual(b'foo', p.stdout.readline().strip())
+
+    def check_repl_stderr_flush(self, separate_stderr=False):
+        with self.interactive_python(separate_stderr) as p:
+            p.stdin.write(b"1/0\n")
+            p.stdin.flush()
+            stderr = p.stderr if separate_stderr else p.stdout
+            self.assertIn(b'Traceback ', stderr.readline())
+            self.assertIn(b'File "<stdin>"', stderr.readline())
+            self.assertIn(b'ZeroDivisionError', stderr.readline())
+
+    def test_repl_stdout_flush(self):
+        self.check_repl_stdout_flush()
+
+    def test_repl_stdout_flush_separate_stderr(self):
+        self.check_repl_stdout_flush(True)
+
+    def test_repl_stderr_flush(self):
+        self.check_repl_stderr_flush()
+
+    def test_repl_stderr_flush_separate_stderr(self):
+        self.check_repl_stderr_flush(True)
+
     def test_basic_script(self):
         with temp_dir() as script_dir:
             script_name = _make_test_script(script_dir, 'script')
@@ -294,7 +360,7 @@
                 pkg_dir = os.path.join(script_dir, 'test_pkg')
                 make_pkg(pkg_dir, "import sys; print('init_argv0==%r' % sys.argv[0])")
                 script_name = _make_test_script(pkg_dir, 'script')
-                rc, out, err = assert_python_ok('-m', 'test_pkg.script', *example_args)
+                rc, out, err = assert_python_ok('-m', 'test_pkg.script', *example_args, __isolated=False)
                 if verbose > 1:
                     print(out)
                 expected = "init_argv0==%r" % '-m'
@@ -311,7 +377,8 @@
                 with open("-c", "w") as f:
                     f.write("data")
                     rc, out, err = assert_python_ok('-c',
-                        'import sys; print("sys.path[0]==%r" % sys.path[0])')
+                        'import sys; print("sys.path[0]==%r" % sys.path[0])',
+                        __isolated=False)
                     if verbose > 1:
                         print(out)
                     expected = "sys.path[0]==%r" % ''
@@ -325,7 +392,8 @@
             with support.change_cwd(path=script_dir):
                 with open("-m", "w") as f:
                     f.write("data")
-                    rc, out, err = assert_python_ok('-m', 'other', *example_args)
+                    rc, out, err = assert_python_ok('-m', 'other', *example_args,
+                                                    __isolated=False)
                     self._check_output(script_name, rc, out,
                                       script_name, script_name, '', '',
                                       importlib.machinery.SourceFileLoader)
@@ -386,6 +454,24 @@
             'stdout=%r stderr=%r' % (stdout, stderr))
         self.assertEqual(0, rc)
 
+    def test_issue20500_exit_with_exception_value(self):
+        script = textwrap.dedent("""\
+            import sys
+            error = None
+            try:
+                raise ValueError('some text')
+            except ValueError as err:
+                error = err
+
+            if error:
+                sys.exit(error)
+            """)
+        with temp_dir() as script_dir:
+            script_name = _make_test_script(script_dir, 'script', script)
+            exitcode, stdout, stderr = assert_python_failure(script_name)
+            text = stderr.decode('ascii')
+            self.assertEqual(text, "some text")
+
 
 def test_main():
     support.run_unittest(CmdLineTest)
diff --git a/Lib/test/test_code_module.py b/Lib/test/test_code_module.py
index adef170..7a80a80 100644
--- a/Lib/test/test_code_module.py
+++ b/Lib/test/test_code_module.py
@@ -51,7 +51,7 @@
         self.infunc.side_effect = ["undefined", EOFError('Finished')]
         self.console.interact()
         for call in self.stderr.method_calls:
-            if 'NameError:' in ''.join(call[1]):
+            if 'NameError' in ''.join(call[1]):
                 break
         else:
             raise AssertionError("No syntax error from console")
@@ -64,6 +64,20 @@
         self.console.interact()
         self.assertTrue(hook.called)
 
+    def test_banner(self):
+        # with banner
+        self.infunc.side_effect = EOFError('Finished')
+        self.console.interact(banner='Foo')
+        self.assertEqual(len(self.stderr.method_calls), 2)
+        banner_call = self.stderr.method_calls[0]
+        self.assertEqual(banner_call, ['write', ('Foo\n',), {}])
+
+        # no banner
+        self.stderr.reset_mock()
+        self.infunc.side_effect = EOFError('Finished')
+        self.console.interact(banner='')
+        self.assertEqual(len(self.stderr.method_calls), 1)
+
 
 def test_main():
     support.run_unittest(TestInteractiveConsole)
diff --git a/Lib/test/test_codeccallbacks.py b/Lib/test/test_codeccallbacks.py
index fd88505..84804bb 100644
--- a/Lib/test/test_codeccallbacks.py
+++ b/Lib/test/test_codeccallbacks.py
@@ -875,8 +875,6 @@
                 with self.assertRaises(TypeError):
                     data.decode(encoding, "test.replacing")
 
-def test_main():
-    test.support.run_unittest(CodecCallbackTest)
 
 if __name__ == "__main__":
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_codecmaps_cn.py b/Lib/test/test_codecmaps_cn.py
index 76632a2..f1bd384 100644
--- a/Lib/test/test_codecmaps_cn.py
+++ b/Lib/test/test_codecmaps_cn.py
@@ -10,23 +10,18 @@
 class TestGB2312Map(multibytecodec_support.TestBase_Mapping,
                    unittest.TestCase):
     encoding = 'gb2312'
-    mapfileurl = 'http://people.freebsd.org/~perky/i18n/EUC-CN.TXT'
+    mapfileurl = 'http://www.pythontest.net/unicode/EUC-CN.TXT'
 
 class TestGBKMap(multibytecodec_support.TestBase_Mapping,
                    unittest.TestCase):
     encoding = 'gbk'
-    mapfileurl = 'http://www.unicode.org/Public/MAPPINGS/VENDORS/' \
-                 'MICSFT/WINDOWS/CP936.TXT'
+    mapfileurl = 'http://www.pythontest.net/unicode/CP936.TXT'
 
 class TestGB18030Map(multibytecodec_support.TestBase_Mapping,
                      unittest.TestCase):
     encoding = 'gb18030'
-    mapfileurl = 'http://source.icu-project.org/repos/icu/data/' \
-                 'trunk/charset/data/xml/gb-18030-2000.xml'
+    mapfileurl = 'http://www.pythontest.net/unicode/gb-18030-2000.xml'
 
 
-def test_main():
-    support.run_unittest(__name__)
-
 if __name__ == "__main__":
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_codecmaps_hk.py b/Lib/test/test_codecmaps_hk.py
index 278ae2f..4c0c415 100644
--- a/Lib/test/test_codecmaps_hk.py
+++ b/Lib/test/test_codecmaps_hk.py
@@ -10,11 +10,7 @@
 class TestBig5HKSCSMap(multibytecodec_support.TestBase_Mapping,
                        unittest.TestCase):
     encoding = 'big5hkscs'
-    mapfileurl = 'http://people.freebsd.org/~perky/i18n/BIG5HKSCS-2004.TXT'
-
-def test_main():
-    support.run_unittest(__name__)
+    mapfileurl = 'http://www.pythontest.net/unicode/BIG5HKSCS-2004.TXT'
 
 if __name__ == "__main__":
-    support.use_resources = ['urlfetch']
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_codecmaps_jp.py b/Lib/test/test_codecmaps_jp.py
index fa93f12..5773823 100644
--- a/Lib/test/test_codecmaps_jp.py
+++ b/Lib/test/test_codecmaps_jp.py
@@ -10,8 +10,7 @@
 class TestCP932Map(multibytecodec_support.TestBase_Mapping,
                    unittest.TestCase):
     encoding = 'cp932'
-    mapfileurl = 'http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/' \
-                 'WINDOWS/CP932.TXT'
+    mapfileurl = 'http://www.pythontest.net/unicode/CP932.TXT'
     supmaps = [
         (b'\x80', '\u0080'),
         (b'\xa0', '\uf8f0'),
@@ -27,15 +26,14 @@
                          unittest.TestCase):
     encoding = 'euc_jp'
     mapfilename = 'EUC-JP.TXT'
-    mapfileurl = 'http://people.freebsd.org/~perky/i18n/EUC-JP.TXT'
+    mapfileurl = 'http://www.pythontest.net/unicode/EUC-JP.TXT'
 
 
 class TestSJISCOMPATMap(multibytecodec_support.TestBase_Mapping,
                         unittest.TestCase):
     encoding = 'shift_jis'
     mapfilename = 'SHIFTJIS.TXT'
-    mapfileurl = 'http://www.unicode.org/Public/MAPPINGS/OBSOLETE' \
-                 '/EASTASIA/JIS/SHIFTJIS.TXT'
+    mapfileurl = 'http://www.pythontest.net/unicode/SHIFTJIS.TXT'
     pass_enctest = [
         (b'\x81_', '\\'),
     ]
@@ -49,18 +47,15 @@
                          unittest.TestCase):
     encoding = 'euc_jisx0213'
     mapfilename = 'EUC-JISX0213.TXT'
-    mapfileurl = 'http://people.freebsd.org/~perky/i18n/EUC-JISX0213.TXT'
+    mapfileurl = 'http://www.pythontest.net/unicode/EUC-JISX0213.TXT'
 
 
 class TestSJISX0213Map(multibytecodec_support.TestBase_Mapping,
                        unittest.TestCase):
     encoding = 'shift_jisx0213'
     mapfilename = 'SHIFT_JISX0213.TXT'
-    mapfileurl = 'http://people.freebsd.org/~perky/i18n/SHIFT_JISX0213.TXT'
+    mapfileurl = 'http://www.pythontest.net/unicode/SHIFT_JISX0213.TXT'
 
 
-def test_main():
-    support.run_unittest(__name__)
-
 if __name__ == "__main__":
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_codecmaps_kr.py b/Lib/test/test_codecmaps_kr.py
index e0bf716..6cb41c8 100644
--- a/Lib/test/test_codecmaps_kr.py
+++ b/Lib/test/test_codecmaps_kr.py
@@ -10,14 +10,13 @@
 class TestCP949Map(multibytecodec_support.TestBase_Mapping,
                    unittest.TestCase):
     encoding = 'cp949'
-    mapfileurl = 'http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT' \
-                 '/WINDOWS/CP949.TXT'
+    mapfileurl = 'http://www.pythontest.net/unicode/CP949.TXT'
 
 
 class TestEUCKRMap(multibytecodec_support.TestBase_Mapping,
                    unittest.TestCase):
     encoding = 'euc_kr'
-    mapfileurl = 'http://people.freebsd.org/~perky/i18n/EUC-KR.TXT'
+    mapfileurl = 'http://www.pythontest.net/unicode/EUC-KR.TXT'
 
     # A4D4 HANGUL FILLER indicates the begin of 8-bytes make-up sequence.
     pass_enctest = [(b'\xa4\xd4', '\u3164')]
@@ -27,8 +26,7 @@
 class TestJOHABMap(multibytecodec_support.TestBase_Mapping,
                    unittest.TestCase):
     encoding = 'johab'
-    mapfileurl = 'http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/' \
-                 'KSC/JOHAB.TXT'
+    mapfileurl = 'http://www.pythontest.net/unicode/JOHAB.TXT'
     # KS X 1001 standard assigned 0x5c as WON SIGN.
     # but, in early 90s that is the only era used johab widely,
     # the most softwares implements it as REVERSE SOLIDUS.
@@ -36,8 +34,5 @@
     pass_enctest = [(b'\\', '\u20a9')]
     pass_dectest = [(b'\\', '\u20a9')]
 
-def test_main():
-    support.run_unittest(__name__)
-
 if __name__ == "__main__":
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_codecmaps_tw.py b/Lib/test/test_codecmaps_tw.py
index 4d27080..2ea44b5 100644
--- a/Lib/test/test_codecmaps_tw.py
+++ b/Lib/test/test_codecmaps_tw.py
@@ -10,14 +10,12 @@
 class TestBIG5Map(multibytecodec_support.TestBase_Mapping,
                   unittest.TestCase):
     encoding = 'big5'
-    mapfileurl = 'http://www.unicode.org/Public/MAPPINGS/OBSOLETE/' \
-                 'EASTASIA/OTHER/BIG5.TXT'
+    mapfileurl = 'http://www.pythontest.net/unicode/BIG5.TXT'
 
 class TestCP950Map(multibytecodec_support.TestBase_Mapping,
                    unittest.TestCase):
     encoding = 'cp950'
-    mapfileurl = 'http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/' \
-                 'WINDOWS/CP950.TXT'
+    mapfileurl = 'http://www.pythontest.net/unicode/CP950.TXT'
     pass_enctest = [
         (b'\xa2\xcc', '\u5341'),
         (b'\xa2\xce', '\u5345'),
@@ -26,8 +24,5 @@
         (b"\xFFxy", "replace",  "\ufffdxy"),
     )
 
-def test_main():
-    support.run_unittest(__name__)
-
 if __name__ == "__main__":
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_codecs.py b/Lib/test/test_codecs.py
index a8b3da0..6629ccd 100644
--- a/Lib/test/test_codecs.py
+++ b/Lib/test/test_codecs.py
@@ -1,4 +1,5 @@
 import codecs
+import contextlib
 import io
 import locale
 import sys
@@ -342,8 +343,46 @@
         self.assertEqual(reader.readline(), s5)
         self.assertEqual(reader.readline(), "")
 
+    ill_formed_sequence_replace = "\ufffd"
+
+    def test_lone_surrogates(self):
+        self.assertRaises(UnicodeEncodeError, "\ud800".encode, self.encoding)
+        self.assertEqual("[\uDC80]".encode(self.encoding, "backslashreplace"),
+                         "[\\udc80]".encode(self.encoding))
+        self.assertEqual("[\uDC80]".encode(self.encoding, "xmlcharrefreplace"),
+                         "[&#56448;]".encode(self.encoding))
+        self.assertEqual("[\uDC80]".encode(self.encoding, "ignore"),
+                         "[]".encode(self.encoding))
+        self.assertEqual("[\uDC80]".encode(self.encoding, "replace"),
+                         "[?]".encode(self.encoding))
+
+        bom = "".encode(self.encoding)
+        for before, after in [("\U00010fff", "A"), ("[", "]"),
+                              ("A", "\U00010fff")]:
+            before_sequence = before.encode(self.encoding)[len(bom):]
+            after_sequence = after.encode(self.encoding)[len(bom):]
+            test_string = before + "\uDC80" + after
+            test_sequence = (bom + before_sequence +
+                             self.ill_formed_sequence + after_sequence)
+            self.assertRaises(UnicodeDecodeError, test_sequence.decode,
+                              self.encoding)
+            self.assertEqual(test_string.encode(self.encoding,
+                                                "surrogatepass"),
+                             test_sequence)
+            self.assertEqual(test_sequence.decode(self.encoding,
+                                                  "surrogatepass"),
+                             test_string)
+            self.assertEqual(test_sequence.decode(self.encoding, "ignore"),
+                             before + after)
+            self.assertEqual(test_sequence.decode(self.encoding, "replace"),
+                             before + self.ill_formed_sequence_replace + after)
+
 class UTF32Test(ReadTest, unittest.TestCase):
     encoding = "utf-32"
+    if sys.byteorder == 'little':
+        ill_formed_sequence = b"\x80\xdc\x00\x00"
+    else:
+        ill_formed_sequence = b"\x00\x00\xdc\x80"
 
     spamle = (b'\xff\xfe\x00\x00'
               b's\x00\x00\x00p\x00\x00\x00a\x00\x00\x00m\x00\x00\x00'
@@ -435,6 +474,7 @@
 
 class UTF32LETest(ReadTest, unittest.TestCase):
     encoding = "utf-32-le"
+    ill_formed_sequence = b"\x80\xdc\x00\x00"
 
     def test_partial(self):
         self.check_partial(
@@ -479,6 +519,7 @@
 
 class UTF32BETest(ReadTest, unittest.TestCase):
     encoding = "utf-32-be"
+    ill_formed_sequence = b"\x00\x00\xdc\x80"
 
     def test_partial(self):
         self.check_partial(
@@ -524,6 +565,10 @@
 
 class UTF16Test(ReadTest, unittest.TestCase):
     encoding = "utf-16"
+    if sys.byteorder == 'little':
+        ill_formed_sequence = b"\x80\xdc"
+    else:
+        ill_formed_sequence = b"\xdc\x80"
 
     spamle = b'\xff\xfes\x00p\x00a\x00m\x00s\x00p\x00a\x00m\x00'
     spambe = b'\xfe\xff\x00s\x00p\x00a\x00m\x00s\x00p\x00a\x00m'
@@ -599,11 +644,14 @@
         self.addCleanup(support.unlink, support.TESTFN)
         with open(support.TESTFN, 'wb') as fp:
             fp.write(s)
-        with codecs.open(support.TESTFN, 'U', encoding=self.encoding) as reader:
+        with support.check_warnings(('', DeprecationWarning)):
+            reader = codecs.open(support.TESTFN, 'U', encoding=self.encoding)
+        with reader:
             self.assertEqual(reader.read(), s1)
 
 class UTF16LETest(ReadTest, unittest.TestCase):
     encoding = "utf-16-le"
+    ill_formed_sequence = b"\x80\xdc"
 
     def test_partial(self):
         self.check_partial(
@@ -647,6 +695,7 @@
 
 class UTF16BETest(ReadTest, unittest.TestCase):
     encoding = "utf-16-be"
+    ill_formed_sequence = b"\xdc\x80"
 
     def test_partial(self):
         self.check_partial(
@@ -690,6 +739,8 @@
 
 class UTF8Test(ReadTest, unittest.TestCase):
     encoding = "utf-8"
+    ill_formed_sequence = b"\xed\xb2\x80"
+    ill_formed_sequence_replace = "\ufffd" * 3
 
     def test_partial(self):
         self.check_partial(
@@ -719,18 +770,11 @@
                                          u, u.encode(self.encoding))
 
     def test_lone_surrogates(self):
-        self.assertRaises(UnicodeEncodeError, "\ud800".encode, "utf-8")
-        self.assertRaises(UnicodeDecodeError, b"\xed\xa0\x80".decode, "utf-8")
-        self.assertEqual("[\uDC80]".encode("utf-8", "backslashreplace"),
-                         b'[\\udc80]')
-        self.assertEqual("[\uDC80]".encode("utf-8", "xmlcharrefreplace"),
-                         b'[&#56448;]')
-        self.assertEqual("[\uDC80]".encode("utf-8", "surrogateescape"),
+        super().test_lone_surrogates()
+        # not sure if this is making sense for
+        # UTF-16 and UTF-32
+        self.assertEqual("[\uDC80]".encode('utf-8', "surrogateescape"),
                          b'[\x80]')
-        self.assertEqual("[\uDC80]".encode("utf-8", "ignore"),
-                         b'[]')
-        self.assertEqual("[\uDC80]".encode("utf-8", "replace"),
-                         b'[?]')
 
     def test_surrogatepass_handler(self):
         self.assertEqual("abc\ud800def".encode("utf-8", "surrogatepass"),
@@ -913,15 +957,19 @@
             (b'a+////,+IKw-b', 'a\uffff\ufffd\u20acb'),
         ]
         for raw, expected in tests:
-            self.assertRaises(UnicodeDecodeError, codecs.utf_7_decode,
-                              raw, 'strict', True)
-            self.assertEqual(raw.decode('utf-7', 'replace'), expected)
+            with self.subTest(raw=raw):
+                self.assertRaises(UnicodeDecodeError, codecs.utf_7_decode,
+                                raw, 'strict', True)
+                self.assertEqual(raw.decode('utf-7', 'replace'), expected)
 
     def test_nonbmp(self):
         self.assertEqual('\U000104A0'.encode(self.encoding), b'+2AHcoA-')
         self.assertEqual('\ud801\udca0'.encode(self.encoding), b'+2AHcoA-')
         self.assertEqual(b'+2AHcoA-'.decode(self.encoding), '\U000104A0')
 
+    test_lone_surrogates = None
+
+
 class UTF16ExTest(unittest.TestCase):
 
     def test_errors(self):
@@ -946,7 +994,7 @@
         self.assertRaises(TypeError, codecs.readbuffer_encode)
         self.assertRaises(TypeError, codecs.readbuffer_encode, 42)
 
-class UTF8SigTest(ReadTest, unittest.TestCase):
+class UTF8SigTest(UTF8Test, unittest.TestCase):
     encoding = "utf-8-sig"
 
     def test_partial(self):
@@ -1091,6 +1139,8 @@
         # Python used to crash on this at exit because of a refcount
         # bug in _codecsmodule.c
 
+        self.assertTrue(f.closed)
+
 # From RFC 3492
 punycode_testcases = [
     # A Arabic (Egyptian):
@@ -1543,6 +1593,16 @@
         self.assertEqual(encoder.encode("ample.org."), b"xn--xample-9ta.org.")
         self.assertEqual(encoder.encode("", True), b"")
 
+    def test_errors(self):
+        """Only supports "strict" error handler"""
+        "python.org".encode("idna", "strict")
+        b"python.org".decode("idna", "strict")
+        for errors in ("ignore", "replace", "backslashreplace",
+                "surrogateescape"):
+            self.assertRaises(Exception, "python.org".encode, "idna", errors)
+            self.assertRaises(Exception,
+                b"python.org".decode, "idna", errors)
+
 class CodecsModuleTest(unittest.TestCase):
 
     def test_decode(self):
@@ -1598,6 +1658,46 @@
         c = codecs.lookup('ASCII')
         self.assertEqual(c.name, 'ascii')
 
+    def test_all(self):
+        api = (
+            "encode", "decode",
+            "register", "CodecInfo", "Codec", "IncrementalEncoder",
+            "IncrementalDecoder", "StreamReader", "StreamWriter", "lookup",
+            "getencoder", "getdecoder", "getincrementalencoder",
+            "getincrementaldecoder", "getreader", "getwriter",
+            "register_error", "lookup_error",
+            "strict_errors", "replace_errors", "ignore_errors",
+            "xmlcharrefreplace_errors", "backslashreplace_errors",
+            "open", "EncodedFile",
+            "iterencode", "iterdecode",
+            "BOM", "BOM_BE", "BOM_LE",
+            "BOM_UTF8", "BOM_UTF16", "BOM_UTF16_BE", "BOM_UTF16_LE",
+            "BOM_UTF32", "BOM_UTF32_BE", "BOM_UTF32_LE",
+            "BOM32_BE", "BOM32_LE", "BOM64_BE", "BOM64_LE",  # Undocumented
+            "StreamReaderWriter", "StreamRecoder",
+        )
+        self.assertCountEqual(api, codecs.__all__)
+        for api in codecs.__all__:
+            getattr(codecs, api)
+
+    def test_open(self):
+        self.addCleanup(support.unlink, support.TESTFN)
+        for mode in ('w', 'r', 'r+', 'w+', 'a', 'a+'):
+            with self.subTest(mode), \
+                    codecs.open(support.TESTFN, mode, 'ascii') as file:
+                self.assertIsInstance(file, codecs.StreamReaderWriter)
+
+    def test_undefined(self):
+        self.assertRaises(UnicodeError, codecs.encode, 'abc', 'undefined')
+        self.assertRaises(UnicodeError, codecs.decode, b'abc', 'undefined')
+        self.assertRaises(UnicodeError, codecs.encode, '', 'undefined')
+        self.assertRaises(UnicodeError, codecs.decode, b'', 'undefined')
+        for errors in ('strict', 'ignore', 'replace', 'backslashreplace'):
+            self.assertRaises(UnicodeError,
+                codecs.encode, 'abc', 'undefined', errors)
+            self.assertRaises(UnicodeError,
+                codecs.decode, b'abc', 'undefined', errors)
+
 class StreamReaderTest(unittest.TestCase):
 
     def setUp(self):
@@ -1628,6 +1728,7 @@
     "cp037",
     "cp1006",
     "cp1026",
+    "cp1125",
     "cp1140",
     "cp1250",
     "cp1251",
@@ -1730,13 +1831,10 @@
 #    "undefined"
 
 # The following encodings don't work in stateful mode
-broken_unicode_with_streams = [
+broken_unicode_with_stateful = [
     "punycode",
     "unicode_internal"
 ]
-broken_incremental_coders = broken_unicode_with_streams + [
-    "idna",
-]
 
 class BasicUnicodeTest(unittest.TestCase, MixInCheckStateHandling):
     def test_basics(self):
@@ -1756,7 +1854,7 @@
                 (chars, size) = codecs.getdecoder(encoding)(b)
                 self.assertEqual(chars, s, "encoding=%r" % encoding)
 
-            if encoding not in broken_unicode_with_streams:
+            if encoding not in broken_unicode_with_stateful:
                 # check stream reader/writer
                 q = Queue(b"")
                 writer = codecs.getwriter(encoding)(q)
@@ -1774,7 +1872,7 @@
                     decodedresult += reader.read()
                 self.assertEqual(decodedresult, s, "encoding=%r" % encoding)
 
-            if encoding not in broken_incremental_coders:
+            if encoding not in broken_unicode_with_stateful:
                 # check incremental decoder/encoder and iterencode()/iterdecode()
                 try:
                     encoder = codecs.getincrementalencoder(encoding)()
@@ -1823,7 +1921,7 @@
         from _testcapi import codec_incrementalencoder, codec_incrementaldecoder
         s = "abc123"  # all codecs should be able to encode these
         for encoding in all_unicode_encodings:
-            if encoding not in broken_incremental_coders:
+            if encoding not in broken_unicode_with_stateful:
                 # check incremental decoder/encoder (fetched via the C API)
                 try:
                     cencoder = codec_incrementalencoder(encoding)
@@ -1863,7 +1961,7 @@
         for encoding in all_unicode_encodings:
             if encoding == "idna": # FIXME: See SF bug #1163178
                 continue
-            if encoding in broken_unicode_with_streams:
+            if encoding in broken_unicode_with_stateful:
                 continue
             reader = codecs.getreader(encoding)(io.BytesIO(s.encode(encoding)))
             for t in range(5):
@@ -1896,7 +1994,7 @@
         # Check that getstate() and setstate() handle the state properly
         u = "abc123"
         for encoding in all_unicode_encodings:
-            if encoding not in broken_incremental_coders:
+            if encoding not in broken_unicode_with_stateful:
                 self.check_state_handling_decode(encoding, u, u.encode(encoding))
                 self.check_state_handling_encode(encoding, u, u.encode(encoding))
 
@@ -2100,6 +2198,7 @@
         f = io.BytesIO(b"\xc3\xbc")
         with codecs.EncodedFile(f, "latin-1", "utf-8") as ef:
             self.assertEqual(ef.read(), b"\xfc")
+        self.assertTrue(f.closed)
 
     def test_streamreaderwriter(self):
         f = io.BytesIO(b"\xc3\xbc")
@@ -2370,60 +2469,93 @@
     "quopri_codec",
     "hex_codec",
 ]
+
+transform_aliases = {
+    "base64_codec": ["base64", "base_64"],
+    "uu_codec": ["uu"],
+    "quopri_codec": ["quopri", "quoted_printable", "quotedprintable"],
+    "hex_codec": ["hex"],
+    "rot_13": ["rot13"],
+}
+
 try:
     import zlib
 except ImportError:
-    pass
+    zlib = None
 else:
     bytes_transform_encodings.append("zlib_codec")
+    transform_aliases["zlib_codec"] = ["zip", "zlib"]
 try:
     import bz2
 except ImportError:
     pass
 else:
     bytes_transform_encodings.append("bz2_codec")
+    transform_aliases["bz2_codec"] = ["bz2"]
 
 class TransformCodecTest(unittest.TestCase):
 
     def test_basics(self):
         binput = bytes(range(256))
         for encoding in bytes_transform_encodings:
-            # generic codecs interface
-            (o, size) = codecs.getencoder(encoding)(binput)
-            self.assertEqual(size, len(binput))
-            (i, size) = codecs.getdecoder(encoding)(o)
-            self.assertEqual(size, len(o))
-            self.assertEqual(i, binput)
+            with self.subTest(encoding=encoding):
+                # generic codecs interface
+                (o, size) = codecs.getencoder(encoding)(binput)
+                self.assertEqual(size, len(binput))
+                (i, size) = codecs.getdecoder(encoding)(o)
+                self.assertEqual(size, len(o))
+                self.assertEqual(i, binput)
 
     def test_read(self):
         for encoding in bytes_transform_encodings:
-            sin = codecs.encode(b"\x80", encoding)
-            reader = codecs.getreader(encoding)(io.BytesIO(sin))
-            sout = reader.read()
-            self.assertEqual(sout, b"\x80")
+            with self.subTest(encoding=encoding):
+                sin = codecs.encode(b"\x80", encoding)
+                reader = codecs.getreader(encoding)(io.BytesIO(sin))
+                sout = reader.read()
+                self.assertEqual(sout, b"\x80")
 
     def test_readline(self):
         for encoding in bytes_transform_encodings:
-            sin = codecs.encode(b"\x80", encoding)
-            reader = codecs.getreader(encoding)(io.BytesIO(sin))
-            sout = reader.readline()
-            self.assertEqual(sout, b"\x80")
+            with self.subTest(encoding=encoding):
+                sin = codecs.encode(b"\x80", encoding)
+                reader = codecs.getreader(encoding)(io.BytesIO(sin))
+                sout = reader.readline()
+                self.assertEqual(sout, b"\x80")
+
+    def test_buffer_api_usage(self):
+        # We check all the transform codecs accept memoryview input
+        # for encoding and decoding
+        # and also that they roundtrip correctly
+        original = b"12345\x80"
+        for encoding in bytes_transform_encodings:
+            with self.subTest(encoding=encoding):
+                data = original
+                view = memoryview(data)
+                data = codecs.encode(data, encoding)
+                view_encoded = codecs.encode(view, encoding)
+                self.assertEqual(view_encoded, data)
+                view = memoryview(data)
+                data = codecs.decode(data, encoding)
+                self.assertEqual(data, original)
+                view_decoded = codecs.decode(view, encoding)
+                self.assertEqual(view_decoded, data)
 
     def test_text_to_binary_blacklists_binary_transforms(self):
         # Check binary -> binary codecs give a good error for str input
         bad_input = "bad input type"
         for encoding in bytes_transform_encodings:
-            fmt = (r"{!r} is not a text encoding; "
-                   r"use codecs.encode\(\) to handle arbitrary codecs")
-            msg = fmt.format(encoding)
-            with self.assertRaisesRegex(LookupError, msg) as failure:
-                bad_input.encode(encoding)
-            self.assertIsNone(failure.exception.__cause__)
+            with self.subTest(encoding=encoding):
+                fmt = ( "{!r} is not a text encoding; "
+                        "use codecs.encode\(\) to handle arbitrary codecs")
+                msg = fmt.format(encoding)
+                with self.assertRaisesRegex(LookupError, msg) as failure:
+                    bad_input.encode(encoding)
+                self.assertIsNone(failure.exception.__cause__)
 
     def test_text_to_binary_blacklists_text_transforms(self):
         # Check str.encode gives a good error message for str -> str codecs
         msg = (r"^'rot_13' is not a text encoding; "
-               r"use codecs.encode\(\) to handle arbitrary codecs")
+                "use codecs.encode\(\) to handle arbitrary codecs")
         with self.assertRaisesRegex(LookupError, msg):
             "just an example message".encode("rot_13")
 
@@ -2432,23 +2564,242 @@
         # message for binary -> binary codecs
         data = b"encode first to ensure we meet any format restrictions"
         for encoding in bytes_transform_encodings:
-            encoded_data = codecs.encode(data, encoding)
-            fmt = (r"{!r} is not a text encoding; "
-                   r"use codecs.decode\(\) to handle arbitrary codecs")
-            msg = fmt.format(encoding)
-            with self.assertRaisesRegex(LookupError, msg):
-                encoded_data.decode(encoding)
-            with self.assertRaisesRegex(LookupError, msg):
-                bytearray(encoded_data).decode(encoding)
+            with self.subTest(encoding=encoding):
+                encoded_data = codecs.encode(data, encoding)
+                fmt = (r"{!r} is not a text encoding; "
+                        "use codecs.decode\(\) to handle arbitrary codecs")
+                msg = fmt.format(encoding)
+                with self.assertRaisesRegex(LookupError, msg):
+                    encoded_data.decode(encoding)
+                with self.assertRaisesRegex(LookupError, msg):
+                    bytearray(encoded_data).decode(encoding)
 
     def test_binary_to_text_blacklists_text_transforms(self):
         # Check str -> str codec gives a good error for binary input
         for bad_input in (b"immutable", bytearray(b"mutable")):
-            msg = (r"^'rot_13' is not a text encoding; "
-                   r"use codecs.decode\(\) to handle arbitrary codecs")
-            with self.assertRaisesRegex(LookupError, msg) as failure:
-                bad_input.decode("rot_13")
-            self.assertIsNone(failure.exception.__cause__)
+            with self.subTest(bad_input=bad_input):
+                msg = (r"^'rot_13' is not a text encoding; "
+                        "use codecs.decode\(\) to handle arbitrary codecs")
+                with self.assertRaisesRegex(LookupError, msg) as failure:
+                    bad_input.decode("rot_13")
+                self.assertIsNone(failure.exception.__cause__)
+
+    @unittest.skipUnless(zlib, "Requires zlib support")
+    def test_custom_zlib_error_is_wrapped(self):
+        # Check zlib codec gives a good error for malformed input
+        msg = "^decoding with 'zlib_codec' codec failed"
+        with self.assertRaisesRegex(Exception, msg) as failure:
+            codecs.decode(b"hello", "zlib_codec")
+        self.assertIsInstance(failure.exception.__cause__,
+                                                type(failure.exception))
+
+    def test_custom_hex_error_is_wrapped(self):
+        # Check hex codec gives a good error for malformed input
+        msg = "^decoding with 'hex_codec' codec failed"
+        with self.assertRaisesRegex(Exception, msg) as failure:
+            codecs.decode(b"hello", "hex_codec")
+        self.assertIsInstance(failure.exception.__cause__,
+                                                type(failure.exception))
+
+    # Unfortunately, the bz2 module throws OSError, which the codec
+    # machinery currently can't wrap :(
+
+    # Ensure codec aliases from http://bugs.python.org/issue7475 work
+    def test_aliases(self):
+        for codec_name, aliases in transform_aliases.items():
+            expected_name = codecs.lookup(codec_name).name
+            for alias in aliases:
+                with self.subTest(alias=alias):
+                    info = codecs.lookup(alias)
+                    self.assertEqual(info.name, expected_name)
+
+    def test_uu_invalid(self):
+        # Missing "begin" line
+        self.assertRaises(ValueError, codecs.decode, b"", "uu-codec")
+
+
+# The codec system tries to wrap exceptions in order to ensure the error
+# mentions the operation being performed and the codec involved. We
+# currently *only* want this to happen for relatively stateless
+# exceptions, where the only significant information they contain is their
+# type and a single str argument.
+
+# Use a local codec registry to avoid appearing to leak objects when
+# registering multiple seach functions
+_TEST_CODECS = {}
+
+def _get_test_codec(codec_name):
+    return _TEST_CODECS.get(codec_name)
+codecs.register(_get_test_codec) # Returns None, not usable as a decorator
+
+try:
+    # Issue #22166: Also need to clear the internal cache in CPython
+    from _codecs import _forget_codec
+except ImportError:
+    def _forget_codec(codec_name):
+        pass
+
+
+class ExceptionChainingTest(unittest.TestCase):
+
+    def setUp(self):
+        # There's no way to unregister a codec search function, so we just
+        # ensure we render this one fairly harmless after the test
+        # case finishes by using the test case repr as the codec name
+        # The codecs module normalizes codec names, although this doesn't
+        # appear to be formally documented...
+        # We also make sure we use a truly unique id for the custom codec
+        # to avoid issues with the codec cache when running these tests
+        # multiple times (e.g. when hunting for refleaks)
+        unique_id = repr(self) + str(id(self))
+        self.codec_name = encodings.normalize_encoding(unique_id).lower()
+
+        # We store the object to raise on the instance because of a bad
+        # interaction between the codec caching (which means we can't
+        # recreate the codec entry) and regrtest refleak hunting (which
+        # runs the same test instance multiple times). This means we
+        # need to ensure the codecs call back in to the instance to find
+        # out which exception to raise rather than binding them in a
+        # closure to an object that may change on the next run
+        self.obj_to_raise = RuntimeError
+
+    def tearDown(self):
+        _TEST_CODECS.pop(self.codec_name, None)
+        # Issue #22166: Also pop from caches to avoid appearance of ref leaks
+        encodings._cache.pop(self.codec_name, None)
+        try:
+            _forget_codec(self.codec_name)
+        except KeyError:
+            pass
+
+    def set_codec(self, encode, decode):
+        codec_info = codecs.CodecInfo(encode, decode,
+                                      name=self.codec_name)
+        _TEST_CODECS[self.codec_name] = codec_info
+
+    @contextlib.contextmanager
+    def assertWrapped(self, operation, exc_type, msg):
+        full_msg = r"{} with {!r} codec failed \({}: {}\)".format(
+                  operation, self.codec_name, exc_type.__name__, msg)
+        with self.assertRaisesRegex(exc_type, full_msg) as caught:
+            yield caught
+        self.assertIsInstance(caught.exception.__cause__, exc_type)
+        self.assertIsNotNone(caught.exception.__cause__.__traceback__)
+
+    def raise_obj(self, *args, **kwds):
+        # Helper to dynamically change the object raised by a test codec
+        raise self.obj_to_raise
+
+    def check_wrapped(self, obj_to_raise, msg, exc_type=RuntimeError):
+        self.obj_to_raise = obj_to_raise
+        self.set_codec(self.raise_obj, self.raise_obj)
+        with self.assertWrapped("encoding", exc_type, msg):
+            "str_input".encode(self.codec_name)
+        with self.assertWrapped("encoding", exc_type, msg):
+            codecs.encode("str_input", self.codec_name)
+        with self.assertWrapped("decoding", exc_type, msg):
+            b"bytes input".decode(self.codec_name)
+        with self.assertWrapped("decoding", exc_type, msg):
+            codecs.decode(b"bytes input", self.codec_name)
+
+    def test_raise_by_type(self):
+        self.check_wrapped(RuntimeError, "")
+
+    def test_raise_by_value(self):
+        msg = "This should be wrapped"
+        self.check_wrapped(RuntimeError(msg), msg)
+
+    def test_raise_grandchild_subclass_exact_size(self):
+        msg = "This should be wrapped"
+        class MyRuntimeError(RuntimeError):
+            __slots__ = ()
+        self.check_wrapped(MyRuntimeError(msg), msg, MyRuntimeError)
+
+    def test_raise_subclass_with_weakref_support(self):
+        msg = "This should be wrapped"
+        class MyRuntimeError(RuntimeError):
+            pass
+        self.check_wrapped(MyRuntimeError(msg), msg, MyRuntimeError)
+
+    def check_not_wrapped(self, obj_to_raise, msg):
+        def raise_obj(*args, **kwds):
+            raise obj_to_raise
+        self.set_codec(raise_obj, raise_obj)
+        with self.assertRaisesRegex(RuntimeError, msg):
+            "str input".encode(self.codec_name)
+        with self.assertRaisesRegex(RuntimeError, msg):
+            codecs.encode("str input", self.codec_name)
+        with self.assertRaisesRegex(RuntimeError, msg):
+            b"bytes input".decode(self.codec_name)
+        with self.assertRaisesRegex(RuntimeError, msg):
+            codecs.decode(b"bytes input", self.codec_name)
+
+    def test_init_override_is_not_wrapped(self):
+        class CustomInit(RuntimeError):
+            def __init__(self):
+                pass
+        self.check_not_wrapped(CustomInit, "")
+
+    def test_new_override_is_not_wrapped(self):
+        class CustomNew(RuntimeError):
+            def __new__(cls):
+                return super().__new__(cls)
+        self.check_not_wrapped(CustomNew, "")
+
+    def test_instance_attribute_is_not_wrapped(self):
+        msg = "This should NOT be wrapped"
+        exc = RuntimeError(msg)
+        exc.attr = 1
+        self.check_not_wrapped(exc, "^{}$".format(msg))
+
+    def test_non_str_arg_is_not_wrapped(self):
+        self.check_not_wrapped(RuntimeError(1), "1")
+
+    def test_multiple_args_is_not_wrapped(self):
+        msg_re = r"^\('a', 'b', 'c'\)$"
+        self.check_not_wrapped(RuntimeError('a', 'b', 'c'), msg_re)
+
+    # http://bugs.python.org/issue19609
+    def test_codec_lookup_failure_not_wrapped(self):
+        msg = "^unknown encoding: {}$".format(self.codec_name)
+        # The initial codec lookup should not be wrapped
+        with self.assertRaisesRegex(LookupError, msg):
+            "str input".encode(self.codec_name)
+        with self.assertRaisesRegex(LookupError, msg):
+            codecs.encode("str input", self.codec_name)
+        with self.assertRaisesRegex(LookupError, msg):
+            b"bytes input".decode(self.codec_name)
+        with self.assertRaisesRegex(LookupError, msg):
+            codecs.decode(b"bytes input", self.codec_name)
+
+    def test_unflagged_non_text_codec_handling(self):
+        # The stdlib non-text codecs are now marked so they're
+        # pre-emptively skipped by the text model related methods
+        # However, third party codecs won't be flagged, so we still make
+        # sure the case where an inappropriate output type is produced is
+        # handled appropriately
+        def encode_to_str(*args, **kwds):
+            return "not bytes!", 0
+        def decode_to_bytes(*args, **kwds):
+            return b"not str!", 0
+        self.set_codec(encode_to_str, decode_to_bytes)
+        # No input or output type checks on the codecs module functions
+        encoded = codecs.encode(None, self.codec_name)
+        self.assertEqual(encoded, "not bytes!")
+        decoded = codecs.decode(None, self.codec_name)
+        self.assertEqual(decoded, b"not str!")
+        # Text model methods should complain
+        fmt = (r"^{!r} encoder returned 'str' instead of 'bytes'; "
+                "use codecs.encode\(\) to encode to arbitrary types$")
+        msg = fmt.format(self.codec_name)
+        with self.assertRaisesRegex(TypeError, msg):
+            "str_input".encode(self.codec_name)
+        fmt = (r"^{!r} decoder returned 'bytes' instead of 'str'; "
+                "use codecs.decode\(\) to decode to arbitrary types$")
+        msg = fmt.format(self.codec_name)
+        with self.assertRaisesRegex(TypeError, msg):
+            b"bytes input".decode(self.codec_name)
+
 
 
 @unittest.skipUnless(sys.platform == 'win32',
@@ -2460,8 +2811,8 @@
     def test_invalid_code_page(self):
         self.assertRaises(ValueError, codecs.code_page_encode, -1, 'a')
         self.assertRaises(ValueError, codecs.code_page_decode, -1, b'a')
-        self.assertRaises(WindowsError, codecs.code_page_encode, 123, 'a')
-        self.assertRaises(WindowsError, codecs.code_page_decode, 123, b'a')
+        self.assertRaises(OSError, codecs.code_page_encode, 123, 'a')
+        self.assertRaises(OSError, codecs.code_page_decode, 123, b'a')
 
     def test_code_page_name(self):
         self.assertRaisesRegex(UnicodeEncodeError, 'cp932',
diff --git a/Lib/test/test_coding.py b/Lib/test/test_coding.py
deleted file mode 100644
index bdbb51f..0000000
--- a/Lib/test/test_coding.py
+++ /dev/null
@@ -1,71 +0,0 @@
-import unittest
-from test.support import TESTFN, unlink, unload
-import importlib, os, sys, subprocess
-
-class CodingTest(unittest.TestCase):
-    def test_bad_coding(self):
-        module_name = 'bad_coding'
-        self.verify_bad_module(module_name)
-
-    def test_bad_coding2(self):
-        module_name = 'bad_coding2'
-        self.verify_bad_module(module_name)
-
-    def verify_bad_module(self, module_name):
-        self.assertRaises(SyntaxError, __import__, 'test.' + module_name)
-
-        path = os.path.dirname(__file__)
-        filename = os.path.join(path, module_name + '.py')
-        with open(filename, "rb") as fp:
-            bytes = fp.read()
-        self.assertRaises(SyntaxError, compile, bytes, filename, 'exec')
-
-    def test_exec_valid_coding(self):
-        d = {}
-        exec(b'# coding: cp949\na = "\xaa\xa7"\n', d)
-        self.assertEqual(d['a'], '\u3047')
-
-    def test_file_parse(self):
-        # issue1134: all encodings outside latin-1 and utf-8 fail on
-        # multiline strings and long lines (>512 columns)
-        unload(TESTFN)
-        filename = TESTFN + ".py"
-        f = open(filename, "w", encoding="cp1252")
-        sys.path.insert(0, os.curdir)
-        try:
-            with f:
-                f.write("# -*- coding: cp1252 -*-\n")
-                f.write("'''A short string\n")
-                f.write("'''\n")
-                f.write("'A very long string %s'\n" % ("X" * 1000))
-
-            importlib.invalidate_caches()
-            __import__(TESTFN)
-        finally:
-            del sys.path[0]
-            unlink(filename)
-            unlink(filename + "c")
-            unlink(filename + "o")
-            unload(TESTFN)
-
-    def test_error_from_string(self):
-        # See http://bugs.python.org/issue6289
-        input = "# coding: ascii\n\N{SNOWMAN}".encode('utf-8')
-        with self.assertRaises(SyntaxError) as c:
-            compile(input, "<string>", "exec")
-        expected = "'ascii' codec can't decode byte 0xe2 in position 16: " \
-                   "ordinal not in range(128)"
-        self.assertTrue(c.exception.args[0].startswith(expected),
-                        msg=c.exception.args[0])
-
-    def test_20731(self):
-        sub = subprocess.Popen([sys.executable,
-                        os.path.join(os.path.dirname(__file__),
-                                     'coding20731.py')],
-                        stderr=subprocess.PIPE)
-        err = sub.communicate()[1]
-        self.assertEqual(sub.returncode, 0)
-        self.assertNotIn(b'SyntaxError', err)
-
-if __name__ == "__main__":
-    unittest.main()
diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py
index ff52755..df1c63c 100644
--- a/Lib/test/test_collections.py
+++ b/Lib/test/test_collections.py
@@ -63,10 +63,17 @@
             for m1, m2 in zip(d.maps[1:], e.maps[1:]):
                 self.assertIs(m1, m2)
 
-        for e in [pickle.loads(pickle.dumps(d)),
-                  copy.deepcopy(d),
+        # check deep copies
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            e = pickle.loads(pickle.dumps(d, proto))
+            self.assertEqual(d, e)
+            self.assertEqual(d.maps, e.maps)
+            self.assertIsNot(d, e)
+            for m1, m2 in zip(d.maps, e.maps):
+                self.assertIsNot(m1, m2, e)
+        for e in [copy.deepcopy(d),
                   eval(repr(d))
-                ]:                                                    # check deep copies
+                ]:
             self.assertEqual(d, e)
             self.assertEqual(d.maps, e.maps)
             self.assertIsNot(d, e)
@@ -112,6 +119,38 @@
         self.assertEqual(dict(d), dict(a=1, b=2, c=30))
         self.assertEqual(dict(d.items()), dict(a=1, b=2, c=30))
 
+    def test_new_child(self):
+        'Tests for changes for issue #16613.'
+        c = ChainMap()
+        c['a'] = 1
+        c['b'] = 2
+        m = {'b':20, 'c': 30}
+        d = c.new_child(m)
+        self.assertEqual(d.maps, [{'b':20, 'c':30}, {'a':1, 'b':2}])  # check internal state
+        self.assertIs(m, d.maps[0])
+
+        # Use a different map than a dict
+        class lowerdict(dict):
+            def __getitem__(self, key):
+                if isinstance(key, str):
+                    key = key.lower()
+                return dict.__getitem__(self, key)
+            def __contains__(self, key):
+                if isinstance(key, str):
+                    key = key.lower()
+                return dict.__contains__(self, key)
+
+        c = ChainMap()
+        c['a'] = 1
+        c['b'] = 2
+        m = lowerdict(b=20, c=30)
+        d = c.new_child(m)
+        self.assertIs(m, d.maps[0])
+        for key in 'abc':                                             # check contains
+            self.assertIn(key, d)
+        for k, v in dict(a=1, B=20, C=30, z=100).items():             # check get
+            self.assertEqual(d.get(k, 100), v)
+
 
 ################################################################################
 ### Named Tuples
@@ -269,7 +308,7 @@
         for module in (pickle,):
             loads = getattr(module, 'loads')
             dumps = getattr(module, 'dumps')
-            for protocol in -1, 0, 1, 2:
+            for protocol in range(-1, module.HIGHEST_PROTOCOL + 1):
                 q = loads(dumps(p, protocol))
                 self.assertEqual(p, q)
                 self.assertEqual(p._fields, q._fields)
@@ -688,14 +727,166 @@
 
         cs = MyComparableSet()
         ncs = MyNonComparableSet()
+        self.assertFalse(ncs < cs)
+        self.assertTrue(ncs <= cs)
+        self.assertFalse(ncs > cs)
+        self.assertTrue(ncs >= cs)
+
+    def assertSameSet(self, s1, s2):
+        # coerce both to a real set then check equality
+        self.assertSetEqual(set(s1), set(s2))
+
+    def test_Set_interoperability_with_real_sets(self):
+        # Issue: 8743
+        class ListSet(Set):
+            def __init__(self, elements=()):
+                self.data = []
+                for elem in elements:
+                    if elem not in self.data:
+                        self.data.append(elem)
+            def __contains__(self, elem):
+                return elem in self.data
+            def __iter__(self):
+                return iter(self.data)
+            def __len__(self):
+                return len(self.data)
+            def __repr__(self):
+                return 'Set({!r})'.format(self.data)
+
+        r1 = set('abc')
+        r2 = set('bcd')
+        r3 = set('abcde')
+        f1 = ListSet('abc')
+        f2 = ListSet('bcd')
+        f3 = ListSet('abcde')
+        l1 = list('abccba')
+        l2 = list('bcddcb')
+        l3 = list('abcdeedcba')
+
+        target = r1 & r2
+        self.assertSameSet(f1 & f2, target)
+        self.assertSameSet(f1 & r2, target)
+        self.assertSameSet(r2 & f1, target)
+        self.assertSameSet(f1 & l2, target)
+
+        target = r1 | r2
+        self.assertSameSet(f1 | f2, target)
+        self.assertSameSet(f1 | r2, target)
+        self.assertSameSet(r2 | f1, target)
+        self.assertSameSet(f1 | l2, target)
+
+        fwd_target = r1 - r2
+        rev_target = r2 - r1
+        self.assertSameSet(f1 - f2, fwd_target)
+        self.assertSameSet(f2 - f1, rev_target)
+        self.assertSameSet(f1 - r2, fwd_target)
+        self.assertSameSet(f2 - r1, rev_target)
+        self.assertSameSet(r1 - f2, fwd_target)
+        self.assertSameSet(r2 - f1, rev_target)
+        self.assertSameSet(f1 - l2, fwd_target)
+        self.assertSameSet(f2 - l1, rev_target)
+
+        target = r1 ^ r2
+        self.assertSameSet(f1 ^ f2, target)
+        self.assertSameSet(f1 ^ r2, target)
+        self.assertSameSet(r2 ^ f1, target)
+        self.assertSameSet(f1 ^ l2, target)
+
+        # Don't change the following to use assertLess or other
+        # "more specific" unittest assertions.  The current
+        # assertTrue/assertFalse style makes the pattern of test
+        # case combinations clear and allows us to know for sure
+        # the exact operator being invoked.
+
+        # proper subset
+        self.assertTrue(f1 < f3)
+        self.assertFalse(f1 < f1)
+        self.assertFalse(f1 < f2)
+        self.assertTrue(r1 < f3)
+        self.assertFalse(r1 < f1)
+        self.assertFalse(r1 < f2)
+        self.assertTrue(r1 < r3)
+        self.assertFalse(r1 < r1)
+        self.assertFalse(r1 < r2)
         with self.assertRaises(TypeError):
-            ncs < cs
+            f1 < l3
         with self.assertRaises(TypeError):
-            ncs <= cs
+            f1 < l1
         with self.assertRaises(TypeError):
-            cs > ncs
+            f1 < l2
+
+        # any subset
+        self.assertTrue(f1 <= f3)
+        self.assertTrue(f1 <= f1)
+        self.assertFalse(f1 <= f2)
+        self.assertTrue(r1 <= f3)
+        self.assertTrue(r1 <= f1)
+        self.assertFalse(r1 <= f2)
+        self.assertTrue(r1 <= r3)
+        self.assertTrue(r1 <= r1)
+        self.assertFalse(r1 <= r2)
         with self.assertRaises(TypeError):
-            cs >= ncs
+            f1 <= l3
+        with self.assertRaises(TypeError):
+            f1 <= l1
+        with self.assertRaises(TypeError):
+            f1 <= l2
+
+        # proper superset
+        self.assertTrue(f3 > f1)
+        self.assertFalse(f1 > f1)
+        self.assertFalse(f2 > f1)
+        self.assertTrue(r3 > r1)
+        self.assertFalse(f1 > r1)
+        self.assertFalse(f2 > r1)
+        self.assertTrue(r3 > r1)
+        self.assertFalse(r1 > r1)
+        self.assertFalse(r2 > r1)
+        with self.assertRaises(TypeError):
+            f1 > l3
+        with self.assertRaises(TypeError):
+            f1 > l1
+        with self.assertRaises(TypeError):
+            f1 > l2
+
+        # any superset
+        self.assertTrue(f3 >= f1)
+        self.assertTrue(f1 >= f1)
+        self.assertFalse(f2 >= f1)
+        self.assertTrue(r3 >= r1)
+        self.assertTrue(f1 >= r1)
+        self.assertFalse(f2 >= r1)
+        self.assertTrue(r3 >= r1)
+        self.assertTrue(r1 >= r1)
+        self.assertFalse(r2 >= r1)
+        with self.assertRaises(TypeError):
+            f1 >= l3
+        with self.assertRaises(TypeError):
+            f1 >=l1
+        with self.assertRaises(TypeError):
+            f1 >= l2
+
+        # equality
+        self.assertTrue(f1 == f1)
+        self.assertTrue(r1 == f1)
+        self.assertTrue(f1 == r1)
+        self.assertFalse(f1 == f3)
+        self.assertFalse(r1 == f3)
+        self.assertFalse(f1 == r3)
+        self.assertFalse(f1 == l3)
+        self.assertFalse(f1 == l1)
+        self.assertFalse(f1 == l2)
+
+        # inequality
+        self.assertFalse(f1 != f1)
+        self.assertFalse(r1 != f1)
+        self.assertFalse(f1 != r1)
+        self.assertTrue(f1 != f3)
+        self.assertTrue(r1 != f3)
+        self.assertTrue(f1 != r3)
+        self.assertTrue(f1 != l3)
+        self.assertTrue(f1 != l1)
+        self.assertTrue(f1 != l2)
 
     def test_Mapping(self):
         for sample in [dict]:
@@ -750,6 +941,8 @@
             self.assertTrue(issubclass(sample, Sequence))
         self.assertIsInstance(range(10), Sequence)
         self.assertTrue(issubclass(range, Sequence))
+        self.assertIsInstance(memoryview(b""), Sequence)
+        self.assertTrue(issubclass(memoryview, Sequence))
         self.assertTrue(issubclass(str, Sequence))
         self.validate_abstract_methods(Sequence, '__contains__', '__iter__', '__len__',
             '__getitem__')
@@ -898,29 +1091,47 @@
         self.assertEqual(c.setdefault('e', 5), 5)
         self.assertEqual(c['e'], 5)
 
+    def test_init(self):
+        self.assertEqual(list(Counter(self=42).items()), [('self', 42)])
+        self.assertEqual(list(Counter(iterable=42).items()), [('iterable', 42)])
+        self.assertEqual(list(Counter(iterable=None).items()), [('iterable', None)])
+        self.assertRaises(TypeError, Counter, 42)
+        self.assertRaises(TypeError, Counter, (), ())
+        self.assertRaises(TypeError, Counter.__init__)
+
+    def test_update(self):
+        c = Counter()
+        c.update(self=42)
+        self.assertEqual(list(c.items()), [('self', 42)])
+        c = Counter()
+        c.update(iterable=42)
+        self.assertEqual(list(c.items()), [('iterable', 42)])
+        c = Counter()
+        c.update(iterable=None)
+        self.assertEqual(list(c.items()), [('iterable', None)])
+        self.assertRaises(TypeError, Counter().update, 42)
+        self.assertRaises(TypeError, Counter().update, {}, {})
+        self.assertRaises(TypeError, Counter.update)
+
     def test_copying(self):
         # Check that counters are copyable, deepcopyable, picklable, and
         #have a repr/eval round-trip
         words = Counter('which witch had which witches wrist watch'.split())
+        def check(dup):
+            msg = "\ncopy: %s\nwords: %s" % (dup, words)
+            self.assertIsNot(dup, words, msg)
+            self.assertEqual(dup, words)
+        check(words.copy())
+        check(copy.copy(words))
+        check(copy.deepcopy(words))
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            with self.subTest(proto=proto):
+                check(pickle.loads(pickle.dumps(words, proto)))
+        check(eval(repr(words)))
         update_test = Counter()
         update_test.update(words)
-        for i, dup in enumerate([
-                    words.copy(),
-                    copy.copy(words),
-                    copy.deepcopy(words),
-                    pickle.loads(pickle.dumps(words, 0)),
-                    pickle.loads(pickle.dumps(words, 1)),
-                    pickle.loads(pickle.dumps(words, 2)),
-                    pickle.loads(pickle.dumps(words, -1)),
-                    eval(repr(words)),
-                    update_test,
-                    Counter(words),
-                    ]):
-            msg = (i, dup, words)
-            self.assertTrue(dup is not words)
-            self.assertEqual(dup, words)
-            self.assertEqual(len(dup), len(words))
-            self.assertEqual(type(dup), type(words))
+        check(update_test)
+        check(Counter(words))
 
     def test_copy_subclass(self):
         class MyCounter(Counter):
@@ -1016,6 +1227,16 @@
         c.subtract('aaaabbcce')
         self.assertEqual(c, Counter(a=-1, b=0, c=-1, d=1, e=-1))
 
+        c = Counter()
+        c.subtract(self=42)
+        self.assertEqual(list(c.items()), [('self', -42)])
+        c = Counter()
+        c.subtract(iterable=42)
+        self.assertEqual(list(c.items()), [('iterable', -42)])
+        self.assertRaises(TypeError, Counter().subtract, 42)
+        self.assertRaises(TypeError, Counter().subtract, {}, {})
+        self.assertRaises(TypeError, Counter.subtract)
+
     def test_unary(self):
         c = Counter(a=-5, b=0, c=5, d=10, e=15,g=40)
         self.assertEqual(dict(+c), dict(c=5, d=10, e=15, g=40))
@@ -1043,8 +1264,10 @@
         # test fidelity to the pure python version
         c = CounterSubclassWithSetItem('abracadabra')
         self.assertTrue(c.called)
+        self.assertEqual(dict(c), {'a': 5, 'b': 2, 'c': 1, 'd': 1, 'r':2 })
         c = CounterSubclassWithGet('abracadabra')
         self.assertTrue(c.called)
+        self.assertEqual(dict(c), {'a': 5, 'b': 2, 'c': 1, 'd': 1, 'r':2 })
 
 
 ################################################################################
@@ -1064,8 +1287,11 @@
                                           c=3, e=5).items()), pairs)                # mixed input
 
         # make sure no positional args conflict with possible kwdargs
-        self.assertEqual(inspect.getargspec(OrderedDict.__dict__['__init__']).args,
-                         ['self'])
+        self.assertEqual(list(OrderedDict(self=42).items()), [('self', 42)])
+        self.assertEqual(list(OrderedDict(other=42).items()), [('other', 42)])
+        self.assertRaises(TypeError, OrderedDict, 42)
+        self.assertRaises(TypeError, OrderedDict, (), ())
+        self.assertRaises(TypeError, OrderedDict.__init__)
 
         # Make sure that direct calls to __init__ do not clear previous contents
         d = OrderedDict([('a', 1), ('b', 2), ('c', 3), ('d', 44), ('e', 55)])
@@ -1110,6 +1336,10 @@
         self.assertEqual(list(d.items()),
             [('a', 1), ('b', 2), ('c', 3), ('d', 4), ('e', 5), ('f', 6), ('g', 7)])
 
+        self.assertRaises(TypeError, OrderedDict().update, 42)
+        self.assertRaises(TypeError, OrderedDict().update, (), ())
+        self.assertRaises(TypeError, OrderedDict.update)
+
     def test_abc(self):
         self.assertIsInstance(OrderedDict(), MutableMapping)
         self.assertTrue(issubclass(OrderedDict, MutableMapping))
@@ -1203,26 +1433,21 @@
         # and have a repr/eval round-trip
         pairs = [('c', 1), ('b', 2), ('a', 3), ('d', 4), ('e', 5), ('f', 6)]
         od = OrderedDict(pairs)
+        def check(dup):
+            msg = "\ncopy: %s\nod: %s" % (dup, od)
+            self.assertIsNot(dup, od, msg)
+            self.assertEqual(dup, od)
+        check(od.copy())
+        check(copy.copy(od))
+        check(copy.deepcopy(od))
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            with self.subTest(proto=proto):
+                check(pickle.loads(pickle.dumps(od, proto)))
+        check(eval(repr(od)))
         update_test = OrderedDict()
         update_test.update(od)
-        for i, dup in enumerate([
-                    od.copy(),
-                    copy.copy(od),
-                    copy.deepcopy(od),
-                    pickle.loads(pickle.dumps(od, 0)),
-                    pickle.loads(pickle.dumps(od, 1)),
-                    pickle.loads(pickle.dumps(od, 2)),
-                    pickle.loads(pickle.dumps(od, 3)),
-                    pickle.loads(pickle.dumps(od, -1)),
-                    eval(repr(od)),
-                    update_test,
-                    OrderedDict(od),
-                    ]):
-            self.assertTrue(dup is not od)
-            self.assertEqual(dup, od)
-            self.assertEqual(list(dup.items()), list(od.items()))
-            self.assertEqual(len(dup), len(od))
-            self.assertEqual(type(dup), type(od))
+        check(update_test)
+        check(OrderedDict(od))
 
     def test_yaml_linkage(self):
         # Verify that __reduce__ is setup in a way that supports PyYAML's dump() feature.
@@ -1237,9 +1462,18 @@
         # do not save instance dictionary if not needed
         pairs = [('c', 1), ('b', 2), ('a', 3), ('d', 4), ('e', 5), ('f', 6)]
         od = OrderedDict(pairs)
-        self.assertEqual(len(od.__reduce__()), 2)
+        self.assertIsNone(od.__reduce__()[2])
         od.x = 10
-        self.assertEqual(len(od.__reduce__()), 3)
+        self.assertIsNotNone(od.__reduce__()[2])
+
+    def test_pickle_recursive(self):
+        od = OrderedDict()
+        od[1] = od
+        for proto in range(-1, pickle.HIGHEST_PROTOCOL + 1):
+            dup = pickle.loads(pickle.dumps(od, proto))
+            self.assertIsNot(dup, od)
+            self.assertEqual(list(dup.keys()), [1])
+            self.assertIs(dup[1], dup)
 
     def test_repr(self):
         od = OrderedDict([('c', 1), ('b', 2), ('a', 3), ('d', 4), ('e', 5), ('f', 6)])
diff --git a/Lib/test/test_colorsys.py b/Lib/test/test_colorsys.py
index e405b8a..a24e3ad 100644
--- a/Lib/test/test_colorsys.py
+++ b/Lib/test/test_colorsys.py
@@ -1,4 +1,4 @@
-import unittest, test.support
+import unittest
 import colorsys
 
 def frange(start, stop, step):
@@ -69,8 +69,32 @@
             self.assertTripleEqual(hls, colorsys.rgb_to_hls(*rgb))
             self.assertTripleEqual(rgb, colorsys.hls_to_rgb(*hls))
 
-def test_main():
-    test.support.run_unittest(ColorsysTest)
+    def test_yiq_roundtrip(self):
+        for r in frange(0.0, 1.0, 0.2):
+            for g in frange(0.0, 1.0, 0.2):
+                for b in frange(0.0, 1.0, 0.2):
+                    rgb = (r, g, b)
+                    self.assertTripleEqual(
+                        rgb,
+                        colorsys.yiq_to_rgb(*colorsys.rgb_to_yiq(*rgb))
+                    )
+
+    def test_yiq_values(self):
+        values = [
+            # rgb, yiq
+            ((0.0, 0.0, 0.0), (0.0, 0.0, 0.0)), # black
+            ((0.0, 0.0, 1.0), (0.11, -0.3217, 0.3121)), # blue
+            ((0.0, 1.0, 0.0), (0.59, -0.2773, -0.5251)), # green
+            ((0.0, 1.0, 1.0), (0.7, -0.599, -0.213)), # cyan
+            ((1.0, 0.0, 0.0), (0.3, 0.599, 0.213)), # red
+            ((1.0, 0.0, 1.0), (0.41, 0.2773, 0.5251)), # purple
+            ((1.0, 1.0, 0.0), (0.89, 0.3217, -0.3121)), # yellow
+            ((1.0, 1.0, 1.0), (1.0, 0.0, 0.0)), # white
+            ((0.5, 0.5, 0.5), (0.5, 0.0, 0.0)), # grey
+        ]
+        for (rgb, yiq) in values:
+            self.assertTripleEqual(yiq, colorsys.rgb_to_yiq(*rgb))
+            self.assertTripleEqual(rgb, colorsys.yiq_to_rgb(*yiq))
 
 if __name__ == "__main__":
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_compare.py b/Lib/test/test_compare.py
index ee3794a..a663832 100644
--- a/Lib/test/test_compare.py
+++ b/Lib/test/test_compare.py
@@ -48,8 +48,69 @@
     def test_ne_defaults_to_not_eq(self):
         a = Cmp(1)
         b = Cmp(1)
-        self.assertTrue(a == b)
-        self.assertFalse(a != b)
+        c = Cmp(2)
+        self.assertIs(a == b, True)
+        self.assertIs(a != b, False)
+        self.assertIs(a != c, True)
+
+    def test_ne_high_priority(self):
+        """object.__ne__() should allow reflected __ne__() to be tried"""
+        calls = []
+        class Left:
+            # Inherits object.__ne__()
+            def __eq__(*args):
+                calls.append('Left.__eq__')
+                return NotImplemented
+        class Right:
+            def __eq__(*args):
+                calls.append('Right.__eq__')
+                return NotImplemented
+            def __ne__(*args):
+                calls.append('Right.__ne__')
+                return NotImplemented
+        Left() != Right()
+        self.assertSequenceEqual(calls, ['Left.__eq__', 'Right.__ne__'])
+
+    def test_ne_low_priority(self):
+        """object.__ne__() should not invoke reflected __eq__()"""
+        calls = []
+        class Base:
+            # Inherits object.__ne__()
+            def __eq__(*args):
+                calls.append('Base.__eq__')
+                return NotImplemented
+        class Derived(Base):  # Subclassing forces higher priority
+            def __eq__(*args):
+                calls.append('Derived.__eq__')
+                return NotImplemented
+            def __ne__(*args):
+                calls.append('Derived.__ne__')
+                return NotImplemented
+        Base() != Derived()
+        self.assertSequenceEqual(calls, ['Derived.__ne__', 'Base.__eq__'])
+
+    def test_other_delegation(self):
+        """No default delegation between operations except __ne__()"""
+        ops = (
+            ('__eq__', lambda a, b: a == b),
+            ('__lt__', lambda a, b: a < b),
+            ('__le__', lambda a, b: a <= b),
+            ('__gt__', lambda a, b: a > b),
+            ('__ge__', lambda a, b: a >= b),
+        )
+        for name, func in ops:
+            with self.subTest(name):
+                def unexpected(*args):
+                    self.fail('Unexpected operator method called')
+                class C:
+                    __ne__ = unexpected
+                for other, _ in ops:
+                    if other != name:
+                        setattr(C, other, unexpected)
+                if name == '__eq__':
+                    self.assertIs(func(C(), object()), False)
+                else:
+                    self.assertRaises(TypeError, func, C(), object())
 
     def test_issue_1393(self):
         x = lambda: None
diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py
index ccd08db..6116676 100644
--- a/Lib/test/test_compile.py
+++ b/Lib/test/test_compile.py
@@ -1,3 +1,4 @@
+import math
 import unittest
 import sys
 import _ast
@@ -303,9 +304,26 @@
         l = lambda: "foo"
         self.assertIsNone(l.__doc__)
 
-##     def test_unicode_encoding(self):
-##         code = "# -*- coding: utf-8 -*-\npass\n"
-##         self.assertRaises(SyntaxError, compile, code, "tmp", "exec")
+    def test_encoding(self):
+        code = b'# -*- coding: badencoding -*-\npass\n'
+        self.assertRaises(SyntaxError, compile, code, 'tmp', 'exec')
+        code = '# -*- coding: badencoding -*-\n"\xc2\xa4"\n'
+        compile(code, 'tmp', 'exec')
+        self.assertEqual(eval(code), '\xc2\xa4')
+        code = '"\xc2\xa4"\n'
+        self.assertEqual(eval(code), '\xc2\xa4')
+        code = b'"\xc2\xa4"\n'
+        self.assertEqual(eval(code), '\xa4')
+        code = b'# -*- coding: latin1 -*-\n"\xc2\xa4"\n'
+        self.assertEqual(eval(code), '\xc2\xa4')
+        code = b'# -*- coding: utf-8 -*-\n"\xc2\xa4"\n'
+        self.assertEqual(eval(code), '\xa4')
+        code = b'# -*- coding: iso8859-15 -*-\n"\xc2\xa4"\n'
+        self.assertEqual(eval(code), '\xc2\u20ac')
+        code = '"""\\\n# -*- coding: iso8859-15 -*-\n\xc2\xa4"""\n'
+        self.assertEqual(eval(code), '# -*- coding: iso8859-15 -*-\n\xc2\xa4')
+        code = b'"""\\\n# -*- coding: iso8859-15 -*-\n\xc2\xa4"""\n'
+        self.assertEqual(eval(code), '# -*- coding: iso8859-15 -*-\n\xa4')
 
     def test_subscripts(self):
         # SF bug 1448804
@@ -501,8 +519,43 @@
         check_limit("a", "*a")
 
 
-def test_main():
-    support.run_unittest(TestSpecifics)
+class TestStackSize(unittest.TestCase):
+    # These tests check that the computed stack size for a code object
+    # stays within reasonable bounds (see issue #21523 for an example
+    # dysfunction).
+    N = 100
+
+    def check_stack_size(self, code):
+        # To assert that the alleged stack size is not O(N), we
+        # check that it is smaller than log(N).
+        if isinstance(code, str):
+            code = compile(code, "<foo>", "single")
+        max_size = math.ceil(math.log(len(code.co_code)))
+        self.assertLessEqual(code.co_stacksize, max_size)
+
+    def test_and(self):
+        self.check_stack_size("x and " * self.N + "x")
+
+    def test_or(self):
+        self.check_stack_size("x or " * self.N + "x")
+
+    def test_and_or(self):
+        self.check_stack_size("x and x or " * self.N + "x")
+
+    def test_chained_comparison(self):
+        self.check_stack_size("x < " * self.N + "x")
+
+    def test_if_else(self):
+        self.check_stack_size("x if x else " * self.N + "x")
+
+    def test_binop(self):
+        self.check_stack_size("x + " * self.N + "x")
+
+    def test_func_and(self):
+        code = "def f(x):\n"
+        code += "   x and x\n" * self.N
+        self.check_stack_size(code)
+
 
 if __name__ == "__main__":
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_compileall.py b/Lib/test/test_compileall.py
index 0505c52..2a42238 100644
--- a/Lib/test/test_compileall.py
+++ b/Lib/test/test_compileall.py
@@ -1,11 +1,10 @@
 import sys
 import compileall
-import imp
+import importlib.util
 import os
 import py_compile
 import shutil
 import struct
-import subprocess
 import tempfile
 import time
 import unittest
@@ -18,11 +17,11 @@
     def setUp(self):
         self.directory = tempfile.mkdtemp()
         self.source_path = os.path.join(self.directory, '_test.py')
-        self.bc_path = imp.cache_from_source(self.source_path)
+        self.bc_path = importlib.util.cache_from_source(self.source_path)
         with open(self.source_path, 'w') as file:
             file.write('x = 123\n')
         self.source_path2 = os.path.join(self.directory, '_test2.py')
-        self.bc_path2 = imp.cache_from_source(self.source_path2)
+        self.bc_path2 = importlib.util.cache_from_source(self.source_path2)
         shutil.copyfile(self.source_path, self.source_path2)
         self.subdirectory = os.path.join(self.directory, '_subdir')
         os.mkdir(self.subdirectory)
@@ -36,7 +35,7 @@
         with open(self.bc_path, 'rb') as file:
             data = file.read(8)
         mtime = int(os.stat(self.source_path).st_mtime)
-        compare = struct.pack('<4sl', imp.get_magic(), mtime)
+        compare = struct.pack('<4sl', importlib.util.MAGIC_NUMBER, mtime)
         return data, compare
 
     @unittest.skipUnless(hasattr(os, 'stat'), 'test needs os.stat()')
@@ -56,7 +55,8 @@
 
     def test_mtime(self):
         # Test a change in mtime leads to a new .pyc.
-        self.recreation_check(struct.pack('<4sl', imp.get_magic(), 1))
+        self.recreation_check(struct.pack('<4sl', importlib.util.MAGIC_NUMBER,
+                                          1))
 
     def test_magic_number(self):
         # Test a change in mtime leads to a new .pyc.
@@ -96,14 +96,14 @@
         # interpreter's creates the correct file names
         optimize = 1 if __debug__ else 0
         compileall.compile_dir(self.directory, quiet=True, optimize=optimize)
-        cached = imp.cache_from_source(self.source_path,
-                                       debug_override=not optimize)
+        cached = importlib.util.cache_from_source(self.source_path,
+                                                  debug_override=not optimize)
         self.assertTrue(os.path.isfile(cached))
-        cached2 = imp.cache_from_source(self.source_path2,
-                                       debug_override=not optimize)
+        cached2 = importlib.util.cache_from_source(self.source_path2,
+                                                   debug_override=not optimize)
         self.assertTrue(os.path.isfile(cached2))
-        cached3 = imp.cache_from_source(self.source_path3,
-                                       debug_override=not optimize)
+        cached3 = importlib.util.cache_from_source(self.source_path3,
+                                                   debug_override=not optimize)
         self.assertTrue(os.path.isfile(cached3))
 
 
@@ -151,10 +151,12 @@
         return rc, out, err
 
     def assertCompiled(self, fn):
-        self.assertTrue(os.path.exists(imp.cache_from_source(fn)))
+        path = importlib.util.cache_from_source(fn)
+        self.assertTrue(os.path.exists(path))
 
     def assertNotCompiled(self, fn):
-        self.assertFalse(os.path.exists(imp.cache_from_source(fn)))
+        path = importlib.util.cache_from_source(fn)
+        self.assertFalse(os.path.exists(path))
 
     def setUp(self):
         self.addCleanup(self._cleanup)
@@ -180,7 +182,7 @@
     def test_no_args_respects_force_flag(self):
         bazfn = script_helper.make_script(self.directory, 'baz', '')
         self.assertRunOK(PYTHONPATH=self.directory)
-        pycpath = imp.cache_from_source(bazfn)
+        pycpath = importlib.util.cache_from_source(bazfn)
         # Set atime/mtime backward to avoid file timestamp resolution issues
         os.utime(pycpath, (time.time()-60,)*2)
         mtime = os.stat(pycpath).st_mtime
@@ -212,8 +214,8 @@
                 ['-m', 'compileall', '-q', self.pkgdir]))
             # Verify the __pycache__ directory contents.
             self.assertTrue(os.path.exists(self.pkgdir_cachedir))
-            expected = sorted(base.format(imp.get_tag(), ext) for base in
-                              ('__init__.{}.{}', 'bar.{}.{}'))
+            expected = sorted(base.format(sys.implementation.cache_tag, ext)
+                              for base in ('__init__.{}.{}', 'bar.{}.{}'))
             self.assertEqual(sorted(os.listdir(self.pkgdir_cachedir)), expected)
             # Make sure there are no .pyc files in the source directory.
             self.assertFalse([fn for fn in os.listdir(self.pkgdir)
@@ -246,7 +248,7 @@
 
     def test_force(self):
         self.assertRunOK('-q', self.pkgdir)
-        pycpath = imp.cache_from_source(self.barfn)
+        pycpath = importlib.util.cache_from_source(self.barfn)
         # set atime/mtime backward to avoid file timestamp resolution issues
         os.utime(pycpath, (time.time()-60,)*2)
         mtime = os.stat(pycpath).st_mtime
@@ -310,10 +312,10 @@
         bazfn = script_helper.make_script(self.pkgdir, 'baz', 'raise Exception')
         self.assertRunOK('-q', '-d', 'dinsdale', self.pkgdir)
         fn = script_helper.make_script(self.pkgdir, 'bing', 'import baz')
-        pyc = imp.cache_from_source(bazfn)
+        pyc = importlib.util.cache_from_source(bazfn)
         os.rename(pyc, os.path.join(self.pkgdir, 'baz.pyc'))
         os.remove(bazfn)
-        rc, out, err = script_helper.assert_python_failure(fn)
+        rc, out, err = script_helper.assert_python_failure(fn, __isolated=False)
         self.assertRegex(err, b'File "dinsdale')
 
     def test_include_bad_file(self):
@@ -321,7 +323,7 @@
             '-i', os.path.join(self.directory, 'nosuchfile'), self.pkgdir)
         self.assertRegex(out, b'rror.*nosuchfile')
         self.assertNotRegex(err, b'Traceback')
-        self.assertFalse(os.path.exists(imp.cache_from_source(
+        self.assertFalse(os.path.exists(importlib.util.cache_from_source(
                                             self.pkgdir_cachedir)))
 
     def test_include_file_with_arg(self):
@@ -378,13 +380,5 @@
         self.assertRegex(out, b"Can't list 'badfilename'")
 
 
-def test_main():
-    support.run_unittest(
-        CommandLineTests,
-        CompileallTests,
-        EncodingTest,
-        )
-
-
 if __name__ == "__main__":
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_complex.py b/Lib/test/test_complex.py
index 1bf4097..0ef9a7a 100644
--- a/Lib/test/test_complex.py
+++ b/Lib/test/test_complex.py
@@ -27,7 +27,7 @@
                 unittest.TestCase.assertAlmostEqual(self, a, b)
 
     def assertCloseAbs(self, x, y, eps=1e-9):
-        """Return true iff floats x and y "are close\""""
+        """Return true iff floats x and y "are close"."""
         # put the one with larger magnitude second
         if abs(x) > abs(y):
             x, y = y, x
@@ -62,7 +62,7 @@
         self.fail(msg.format(x, y))
 
     def assertClose(self, x, y, eps=1e-9):
-        """Return true iff complexes x and y "are close\""""
+        """Return true iff complexes x and y "are close"."""
         self.assertCloseAbs(x.real, y.real, eps)
         self.assertCloseAbs(x.imag, y.imag, eps)
 
@@ -104,6 +104,11 @@
         self.assertAlmostEqual(complex.__truediv__(2+0j, 1+1j), 1-1j)
         self.assertRaises(ZeroDivisionError, complex.__truediv__, 1+1j, 0+0j)
 
+        for denom_real, denom_imag in [(0, NAN), (NAN, 0), (NAN, NAN)]:
+            z = complex(0, 0) / complex(denom_real, denom_imag)
+            self.assertTrue(isnan(z.real))
+            self.assertTrue(isnan(z.imag))
+
     def test_floordiv(self):
         self.assertRaises(TypeError, complex.__floordiv__, 3+0j, 1.5+0j)
         self.assertRaises(TypeError, complex.__floordiv__, 3+0j, 0+0j)
@@ -220,6 +225,8 @@
         self.assertRaises(TypeError, complex, OS(None))
         self.assertRaises(TypeError, complex, NS(None))
         self.assertRaises(TypeError, complex, {})
+        self.assertRaises(TypeError, complex, NS(1.5))
+        self.assertRaises(TypeError, complex, NS(1))
 
         self.assertAlmostEqual(complex("1+10j"), 1+10j)
         self.assertAlmostEqual(complex(10), 10+0j)
@@ -301,6 +308,7 @@
         self.assertRaises(TypeError, float, 5+3j)
         self.assertRaises(ValueError, complex, "")
         self.assertRaises(TypeError, complex, None)
+        self.assertRaisesRegex(TypeError, "not 'NoneType'", complex, None)
         self.assertRaises(ValueError, complex, "\0")
         self.assertRaises(ValueError, complex, "3\09")
         self.assertRaises(TypeError, complex, "1", "2")
diff --git a/Lib/test/test_concurrent_futures.py b/Lib/test/test_concurrent_futures.py
index 04c4c37..c74b2ca 100644
--- a/Lib/test/test_concurrent_futures.py
+++ b/Lib/test/test_concurrent_futures.py
@@ -15,6 +15,7 @@
 import threading
 import time
 import unittest
+import weakref
 
 from concurrent import futures
 from concurrent.futures._base import (
@@ -52,6 +53,11 @@
     sys.stdout.flush()
 
 
+class MyObject(object):
+    def my_method(self):
+        pass
+
+
 class ExecutorMixin:
     worker_count = 5
 
@@ -403,6 +409,22 @@
         self.executor.map(str, [2] * (self.worker_count + 1))
         self.executor.shutdown()
 
+    @test.support.cpython_only
+    def test_no_stale_references(self):
+        # Issue #16284: check that the executors don't unnecessarily hang onto
+        # references.
+        my_object = MyObject()
+        my_object_collected = threading.Event()
+        my_object_callback = weakref.ref(
+            my_object, lambda obj: my_object_collected.set())
+        # Deliberately discarding the future.
+        self.executor.submit(my_object.my_method)
+        del my_object
+
+        collected = my_object_collected.wait(timeout=5.0)
+        self.assertTrue(collected,
+                        "Stale reference not collected within timeout.")
+
 
 class ThreadPoolExecutorTest(ThreadPoolMixin, ExecutorTest, unittest.TestCase):
     def test_map_submits_without_iteration(self):
diff --git a/Lib/test/test_configparser.py b/Lib/test/test_configparser.py
index 78bd315..09c229a 100644
--- a/Lib/test/test_configparser.py
+++ b/Lib/test/test_configparser.py
@@ -1591,104 +1591,113 @@
     def test_error(self):
         import pickle
         e1 = configparser.Error('value')
-        pickled = pickle.dumps(e1)
-        e2 = pickle.loads(pickled)
-        self.assertEqual(e1.message, e2.message)
-        self.assertEqual(repr(e1), repr(e2))
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            pickled = pickle.dumps(e1, proto)
+            e2 = pickle.loads(pickled)
+            self.assertEqual(e1.message, e2.message)
+            self.assertEqual(repr(e1), repr(e2))
 
     def test_nosectionerror(self):
         import pickle
         e1 = configparser.NoSectionError('section')
-        pickled = pickle.dumps(e1)
-        e2 = pickle.loads(pickled)
-        self.assertEqual(e1.message, e2.message)
-        self.assertEqual(e1.args, e2.args)
-        self.assertEqual(e1.section, e2.section)
-        self.assertEqual(repr(e1), repr(e2))
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            pickled = pickle.dumps(e1, proto)
+            e2 = pickle.loads(pickled)
+            self.assertEqual(e1.message, e2.message)
+            self.assertEqual(e1.args, e2.args)
+            self.assertEqual(e1.section, e2.section)
+            self.assertEqual(repr(e1), repr(e2))
 
     def test_nooptionerror(self):
         import pickle
         e1 = configparser.NoOptionError('option', 'section')
-        pickled = pickle.dumps(e1)
-        e2 = pickle.loads(pickled)
-        self.assertEqual(e1.message, e2.message)
-        self.assertEqual(e1.args, e2.args)
-        self.assertEqual(e1.section, e2.section)
-        self.assertEqual(e1.option, e2.option)
-        self.assertEqual(repr(e1), repr(e2))
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            pickled = pickle.dumps(e1, proto)
+            e2 = pickle.loads(pickled)
+            self.assertEqual(e1.message, e2.message)
+            self.assertEqual(e1.args, e2.args)
+            self.assertEqual(e1.section, e2.section)
+            self.assertEqual(e1.option, e2.option)
+            self.assertEqual(repr(e1), repr(e2))
 
     def test_duplicatesectionerror(self):
         import pickle
         e1 = configparser.DuplicateSectionError('section', 'source', 123)
-        pickled = pickle.dumps(e1)
-        e2 = pickle.loads(pickled)
-        self.assertEqual(e1.message, e2.message)
-        self.assertEqual(e1.args, e2.args)
-        self.assertEqual(e1.section, e2.section)
-        self.assertEqual(e1.source, e2.source)
-        self.assertEqual(e1.lineno, e2.lineno)
-        self.assertEqual(repr(e1), repr(e2))
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            pickled = pickle.dumps(e1, proto)
+            e2 = pickle.loads(pickled)
+            self.assertEqual(e1.message, e2.message)
+            self.assertEqual(e1.args, e2.args)
+            self.assertEqual(e1.section, e2.section)
+            self.assertEqual(e1.source, e2.source)
+            self.assertEqual(e1.lineno, e2.lineno)
+            self.assertEqual(repr(e1), repr(e2))
 
     def test_duplicateoptionerror(self):
         import pickle
         e1 = configparser.DuplicateOptionError('section', 'option', 'source',
             123)
-        pickled = pickle.dumps(e1)
-        e2 = pickle.loads(pickled)
-        self.assertEqual(e1.message, e2.message)
-        self.assertEqual(e1.args, e2.args)
-        self.assertEqual(e1.section, e2.section)
-        self.assertEqual(e1.option, e2.option)
-        self.assertEqual(e1.source, e2.source)
-        self.assertEqual(e1.lineno, e2.lineno)
-        self.assertEqual(repr(e1), repr(e2))
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            pickled = pickle.dumps(e1, proto)
+            e2 = pickle.loads(pickled)
+            self.assertEqual(e1.message, e2.message)
+            self.assertEqual(e1.args, e2.args)
+            self.assertEqual(e1.section, e2.section)
+            self.assertEqual(e1.option, e2.option)
+            self.assertEqual(e1.source, e2.source)
+            self.assertEqual(e1.lineno, e2.lineno)
+            self.assertEqual(repr(e1), repr(e2))
 
     def test_interpolationerror(self):
         import pickle
         e1 = configparser.InterpolationError('option', 'section', 'msg')
-        pickled = pickle.dumps(e1)
-        e2 = pickle.loads(pickled)
-        self.assertEqual(e1.message, e2.message)
-        self.assertEqual(e1.args, e2.args)
-        self.assertEqual(e1.section, e2.section)
-        self.assertEqual(e1.option, e2.option)
-        self.assertEqual(repr(e1), repr(e2))
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            pickled = pickle.dumps(e1, proto)
+            e2 = pickle.loads(pickled)
+            self.assertEqual(e1.message, e2.message)
+            self.assertEqual(e1.args, e2.args)
+            self.assertEqual(e1.section, e2.section)
+            self.assertEqual(e1.option, e2.option)
+            self.assertEqual(repr(e1), repr(e2))
 
     def test_interpolationmissingoptionerror(self):
         import pickle
         e1 = configparser.InterpolationMissingOptionError('option', 'section',
             'rawval', 'reference')
-        pickled = pickle.dumps(e1)
-        e2 = pickle.loads(pickled)
-        self.assertEqual(e1.message, e2.message)
-        self.assertEqual(e1.args, e2.args)
-        self.assertEqual(e1.section, e2.section)
-        self.assertEqual(e1.option, e2.option)
-        self.assertEqual(e1.reference, e2.reference)
-        self.assertEqual(repr(e1), repr(e2))
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            pickled = pickle.dumps(e1, proto)
+            e2 = pickle.loads(pickled)
+            self.assertEqual(e1.message, e2.message)
+            self.assertEqual(e1.args, e2.args)
+            self.assertEqual(e1.section, e2.section)
+            self.assertEqual(e1.option, e2.option)
+            self.assertEqual(e1.reference, e2.reference)
+            self.assertEqual(repr(e1), repr(e2))
 
     def test_interpolationsyntaxerror(self):
         import pickle
         e1 = configparser.InterpolationSyntaxError('option', 'section', 'msg')
-        pickled = pickle.dumps(e1)
-        e2 = pickle.loads(pickled)
-        self.assertEqual(e1.message, e2.message)
-        self.assertEqual(e1.args, e2.args)
-        self.assertEqual(e1.section, e2.section)
-        self.assertEqual(e1.option, e2.option)
-        self.assertEqual(repr(e1), repr(e2))
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            pickled = pickle.dumps(e1, proto)
+            e2 = pickle.loads(pickled)
+            self.assertEqual(e1.message, e2.message)
+            self.assertEqual(e1.args, e2.args)
+            self.assertEqual(e1.section, e2.section)
+            self.assertEqual(e1.option, e2.option)
+            self.assertEqual(repr(e1), repr(e2))
 
     def test_interpolationdeptherror(self):
         import pickle
         e1 = configparser.InterpolationDepthError('option', 'section',
             'rawval')
-        pickled = pickle.dumps(e1)
-        e2 = pickle.loads(pickled)
-        self.assertEqual(e1.message, e2.message)
-        self.assertEqual(e1.args, e2.args)
-        self.assertEqual(e1.section, e2.section)
-        self.assertEqual(e1.option, e2.option)
-        self.assertEqual(repr(e1), repr(e2))
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            pickled = pickle.dumps(e1, proto)
+            e2 = pickle.loads(pickled)
+            self.assertEqual(e1.message, e2.message)
+            self.assertEqual(e1.args, e2.args)
+            self.assertEqual(e1.section, e2.section)
+            self.assertEqual(e1.option, e2.option)
+            self.assertEqual(repr(e1), repr(e2))
 
     def test_parsingerror(self):
         import pickle
@@ -1696,36 +1705,39 @@
         e1.append(1, 'line1')
         e1.append(2, 'line2')
         e1.append(3, 'line3')
-        pickled = pickle.dumps(e1)
-        e2 = pickle.loads(pickled)
-        self.assertEqual(e1.message, e2.message)
-        self.assertEqual(e1.args, e2.args)
-        self.assertEqual(e1.source, e2.source)
-        self.assertEqual(e1.errors, e2.errors)
-        self.assertEqual(repr(e1), repr(e2))
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            pickled = pickle.dumps(e1, proto)
+            e2 = pickle.loads(pickled)
+            self.assertEqual(e1.message, e2.message)
+            self.assertEqual(e1.args, e2.args)
+            self.assertEqual(e1.source, e2.source)
+            self.assertEqual(e1.errors, e2.errors)
+            self.assertEqual(repr(e1), repr(e2))
         e1 = configparser.ParsingError(filename='filename')
         e1.append(1, 'line1')
         e1.append(2, 'line2')
         e1.append(3, 'line3')
-        pickled = pickle.dumps(e1)
-        e2 = pickle.loads(pickled)
-        self.assertEqual(e1.message, e2.message)
-        self.assertEqual(e1.args, e2.args)
-        self.assertEqual(e1.source, e2.source)
-        self.assertEqual(e1.errors, e2.errors)
-        self.assertEqual(repr(e1), repr(e2))
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            pickled = pickle.dumps(e1, proto)
+            e2 = pickle.loads(pickled)
+            self.assertEqual(e1.message, e2.message)
+            self.assertEqual(e1.args, e2.args)
+            self.assertEqual(e1.source, e2.source)
+            self.assertEqual(e1.errors, e2.errors)
+            self.assertEqual(repr(e1), repr(e2))
 
     def test_missingsectionheadererror(self):
         import pickle
         e1 = configparser.MissingSectionHeaderError('filename', 123, 'line')
-        pickled = pickle.dumps(e1)
-        e2 = pickle.loads(pickled)
-        self.assertEqual(e1.message, e2.message)
-        self.assertEqual(e1.args, e2.args)
-        self.assertEqual(e1.line, e2.line)
-        self.assertEqual(e1.source, e2.source)
-        self.assertEqual(e1.lineno, e2.lineno)
-        self.assertEqual(repr(e1), repr(e2))
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            pickled = pickle.dumps(e1, proto)
+            e2 = pickle.loads(pickled)
+            self.assertEqual(e1.message, e2.message)
+            self.assertEqual(e1.args, e2.args)
+            self.assertEqual(e1.line, e2.line)
+            self.assertEqual(e1.source, e2.source)
+            self.assertEqual(e1.lineno, e2.lineno)
+            self.assertEqual(repr(e1), repr(e2))
 
 
 class InlineCommentStrippingTestCase(unittest.TestCase):
diff --git a/Lib/test/test_contextlib.py b/Lib/test/test_contextlib.py
index e38d043..39cc776 100644
--- a/Lib/test/test_contextlib.py
+++ b/Lib/test/test_contextlib.py
@@ -1,5 +1,6 @@
 """Unit tests for contextlib.py, and other context managers."""
 
+import io
 import sys
 import tempfile
 import unittest
@@ -100,15 +101,25 @@
         self.assertEqual(baz.__name__,'baz')
         self.assertEqual(baz.foo, 'bar')
 
-    @unittest.skipIf(sys.flags.optimize >= 2,
-                     "Docstrings are omitted with -O2 and above")
+    @support.requires_docstrings
     def test_contextmanager_doc_attrib(self):
         baz = self._create_contextmanager_attribs()
         self.assertEqual(baz.__doc__, "Whee!")
 
+    @support.requires_docstrings
+    def test_instance_docstring_given_cm_docstring(self):
+        baz = self._create_contextmanager_attribs()(None)
+        self.assertEqual(baz.__doc__, "Whee!")
+
+
 class ClosingTestCase(unittest.TestCase):
 
-    # XXX This needs more work
+    @support.requires_docstrings
+    def test_instance_docs(self):
+        # Issue 19330: ensure context manager instances have good docstrings
+        cm_docstring = closing.__doc__
+        obj = closing(None)
+        self.assertEqual(obj.__doc__, cm_docstring)
 
     def test_closing(self):
         state = []
@@ -204,6 +215,7 @@
 
 
 class mycontext(ContextDecorator):
+    """Example decoration-compatible context manager for testing"""
     started = False
     exc = None
     catch = False
@@ -219,6 +231,13 @@
 
 class TestContextDecorator(unittest.TestCase):
 
+    @support.requires_docstrings
+    def test_instance_docs(self):
+        # Issue 19330: ensure context manager instances have good docstrings
+        cm_docstring = mycontext.__doc__
+        obj = mycontext()
+        self.assertEqual(obj.__doc__, cm_docstring)
+
     def test_contextdecorator(self):
         context = mycontext()
         with context as result:
@@ -372,6 +391,13 @@
 
 class TestExitStack(unittest.TestCase):
 
+    @support.requires_docstrings
+    def test_instance_docs(self):
+        # Issue 19330: ensure context manager instances have good docstrings
+        cm_docstring = ExitStack.__doc__
+        obj = ExitStack()
+        self.assertEqual(obj.__doc__, cm_docstring)
+
     def test_no_resources(self):
         with ExitStack():
             pass
@@ -692,10 +718,111 @@
         stack.push(cm)
         self.assertIs(stack._exit_callbacks[-1], cm)
 
+class TestRedirectStdout(unittest.TestCase):
 
-# This is needed to make the test actually run under regrtest.py!
-def test_main():
-    support.run_unittest(__name__)
+    @support.requires_docstrings
+    def test_instance_docs(self):
+        # Issue 19330: ensure context manager instances have good docstrings
+        cm_docstring = redirect_stdout.__doc__
+        obj = redirect_stdout(None)
+        self.assertEqual(obj.__doc__, cm_docstring)
+
+    def test_no_redirect_in_init(self):
+        orig_stdout = sys.stdout
+        redirect_stdout(None)
+        self.assertIs(sys.stdout, orig_stdout)
+
+    def test_redirect_to_string_io(self):
+        f = io.StringIO()
+        msg = "Consider an API like help(), which prints directly to stdout"
+        orig_stdout = sys.stdout
+        with redirect_stdout(f):
+            print(msg)
+        self.assertIs(sys.stdout, orig_stdout)
+        s = f.getvalue().strip()
+        self.assertEqual(s, msg)
+
+    def test_enter_result_is_target(self):
+        f = io.StringIO()
+        with redirect_stdout(f) as enter_result:
+            self.assertIs(enter_result, f)
+
+    def test_cm_is_reusable(self):
+        f = io.StringIO()
+        write_to_f = redirect_stdout(f)
+        orig_stdout = sys.stdout
+        with write_to_f:
+            print("Hello", end=" ")
+        with write_to_f:
+            print("World!")
+        self.assertIs(sys.stdout, orig_stdout)
+        s = f.getvalue()
+        self.assertEqual(s, "Hello World!\n")
+
+    def test_cm_is_reentrant(self):
+        f = io.StringIO()
+        write_to_f = redirect_stdout(f)
+        orig_stdout = sys.stdout
+        with write_to_f:
+            print("Hello", end=" ")
+            with write_to_f:
+                print("World!")
+        self.assertIs(sys.stdout, orig_stdout)
+        s = f.getvalue()
+        self.assertEqual(s, "Hello World!\n")
+
+
+class TestSuppress(unittest.TestCase):
+
+    @support.requires_docstrings
+    def test_instance_docs(self):
+        # Issue 19330: ensure context manager instances have good docstrings
+        cm_docstring = suppress.__doc__
+        obj = suppress()
+        self.assertEqual(obj.__doc__, cm_docstring)
+
+    def test_no_result_from_enter(self):
+        with suppress(ValueError) as enter_result:
+            self.assertIsNone(enter_result)
+
+    def test_no_exception(self):
+        with suppress(ValueError):
+            self.assertEqual(pow(2, 5), 32)
+
+    def test_exact_exception(self):
+        with suppress(TypeError):
+            len(5)
+
+    def test_exception_hierarchy(self):
+        with suppress(LookupError):
+            'Hello'[50]
+
+    def test_other_exception(self):
+        with self.assertRaises(ZeroDivisionError):
+            with suppress(TypeError):
+                1/0
+
+    def test_no_args(self):
+        with self.assertRaises(ZeroDivisionError):
+            with suppress():
+                1/0
+
+    def test_multiple_exception_args(self):
+        with suppress(ZeroDivisionError, TypeError):
+            1/0
+        with suppress(ZeroDivisionError, TypeError):
+            len(5)
+
+    def test_cm_is_reentrant(self):
+        ignore_exceptions = suppress(Exception)
+        with ignore_exceptions:
+            pass
+        with ignore_exceptions:
+            len(5)
+        with ignore_exceptions:
+            1/0
+            with ignore_exceptions: # Check nested usage
+                len(5)
 
 if __name__ == "__main__":
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_cprofile.py b/Lib/test/test_cprofile.py
index 5676668..ce5d27e 100644
--- a/Lib/test/test_cprofile.py
+++ b/Lib/test/test_cprofile.py
@@ -6,9 +6,11 @@
 # rip off all interesting stuff from test_profile
 import cProfile
 from test.test_profile import ProfileTest, regenerate_expected_output
+from test.profilee import testfunc
 
 class CProfileTest(ProfileTest):
     profilerclass = cProfile.Profile
+    profilermodule = cProfile
     expected_max_output = "{built-in method max}"
 
     def get_expected_output(self):
@@ -27,6 +29,7 @@
                     obj.enable()
                     obj = _lsprof.Profiler(1)
                     obj.disable()
+                    obj.clear()
                 finally:
                     sys.stderr = orig_stderr
         finally:
diff --git a/Lib/test/test_crypt.py b/Lib/test/test_crypt.py
index cfb7341..624d702 100644
--- a/Lib/test/test_crypt.py
+++ b/Lib/test/test_crypt.py
@@ -1,11 +1,7 @@
 from test import support
 import unittest
 
-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')
+crypt = support.import_module('crypt')
 
 class CryptTestCase(unittest.TestCase):
 
diff --git a/Lib/test/test_csv.py b/Lib/test/test_csv.py
index 83f8cb3..7e2485f 100644
--- a/Lib/test/test_csv.py
+++ b/Lib/test/test_csv.py
@@ -136,12 +136,12 @@
                 return 10;
             def __getitem__(self, i):
                 if i > 2:
-                    raise IOError
-        self.assertRaises(IOError, self._write_test, BadList(), '')
+                    raise OSError
+        self.assertRaises(OSError, self._write_test, BadList(), '')
         class BadItem:
             def __str__(self):
-                raise IOError
-        self.assertRaises(IOError, self._write_test, [BadItem()], '')
+                raise OSError
+        self.assertRaises(OSError, self._write_test, [BadItem()], '')
 
     def test_write_bigfield(self):
         # This exercises the buffer realloc functionality
@@ -186,9 +186,9 @@
     def test_writerows(self):
         class BrokenFile:
             def write(self, buf):
-                raise IOError
+                raise OSError
         writer = csv.writer(BrokenFile())
-        self.assertRaises(IOError, writer.writerows, [['a']])
+        self.assertRaises(OSError, writer.writerows, [['a']])
 
         with TemporaryFile("w+", newline='') as fileobj:
             writer = csv.writer(fileobj)
@@ -308,6 +308,15 @@
             for i, row in enumerate(csv.reader(fileobj)):
                 self.assertEqual(row, rows[i])
 
+    def test_roundtrip_escaped_unquoted_newlines(self):
+        with TemporaryFile("w+", newline='') as fileobj:
+            writer = csv.writer(fileobj,quoting=csv.QUOTE_NONE,escapechar="\\")
+            rows = [['a\nb','b'],['c','x\r\nd']]
+            writer.writerows(rows)
+            fileobj.seek(0)
+            for i, row in enumerate(csv.reader(fileobj,quoting=csv.QUOTE_NONE,escapechar="\\")):
+                self.assertEqual(row,rows[i])
+
 class TestDialectRegistry(unittest.TestCase):
     def test_registry_badargs(self):
         self.assertRaises(TypeError, csv.list_dialects, None)
@@ -836,10 +845,11 @@
             d = mydialect()
 
         for field_name in ("delimiter", "escapechar", "quotechar"):
-            self.assertRaises(csv.Error, create_invalid, field_name, "")
-            self.assertRaises(csv.Error, create_invalid, field_name, "abc")
-            self.assertRaises(csv.Error, create_invalid, field_name, b'x')
-            self.assertRaises(csv.Error, create_invalid, field_name, 5)
+            with self.subTest(field_name=field_name):
+                self.assertRaises(csv.Error, create_invalid, field_name, "")
+                self.assertRaises(csv.Error, create_invalid, field_name, "abc")
+                self.assertRaises(csv.Error, create_invalid, field_name, b'x')
+                self.assertRaises(csv.Error, create_invalid, field_name, 5)
 
 
 class TestSniffer(unittest.TestCase):
diff --git a/Lib/test/test_ctypes.py b/Lib/test/test_ctypes.py
index 496355e..6826899 100644
--- a/Lib/test/test_ctypes.py
+++ b/Lib/test/test_ctypes.py
@@ -1,16 +1,9 @@
 import unittest
-
 from test.support import import_module
 
-# Skip tests if _ctypes module was not built.
-import_module('_ctypes')
+ctypes_test = import_module('ctypes.test')
 
-import ctypes.test
-
-def load_tests(*args):
-    skipped, testcases = ctypes.test.get_tests(ctypes.test, "test_*.py", verbosity=0)
-    suites = [unittest.makeSuite(t) for t in testcases]
-    return unittest.TestSuite(suites)
+load_tests = ctypes_test.load_tests
 
 if __name__ == "__main__":
     unittest.main()
diff --git a/Lib/test/test_curses.py b/Lib/test/test_curses.py
index 7310afc..bd7d4fc 100644
--- a/Lib/test/test_curses.py
+++ b/Lib/test/test_curses.py
@@ -2,364 +2,374 @@
 # Test script for the curses module
 #
 # This script doesn't actually display anything very coherent. but it
-# does call every method and function.
+# does call (nearly) every method and function.
 #
 # Functions not tested: {def,reset}_{shell,prog}_mode, getch(), getstr(),
 # init_color()
 # Only called, not tested: getmouse(), ungetmouse()
 #
 
-import sys, tempfile, os
+import os
+import sys
+import tempfile
+import unittest
+
+from test.support import requires, import_module, verbose
 
 # Optionally test curses module.  This currently requires that the
 # 'curses' resource be given on the regrtest command line using the -u
 # option.  If not available, nothing after this line will be executed.
-
-import unittest
-from test.support import requires, import_module
+import inspect
 requires('curses')
 
 # If either of these don't exist, skip the tests.
 curses = import_module('curses')
 curses.panel = import_module('curses.panel')
 
+term = os.environ.get('TERM', 'unknown')
 
-# XXX: if newterm was supported we could use it instead of initscr and not exit
-term = os.environ.get('TERM')
-if not term or term == 'unknown':
-    raise unittest.SkipTest("$TERM=%r, calling initscr() may cause exit" % term)
+@unittest.skipUnless(sys.__stdout__.isatty(), 'sys.__stdout__ is not a tty')
+@unittest.skipIf(term == 'unknown',
+                 "$TERM=%r, calling initscr() may cause exit" % term)
+@unittest.skipIf(sys.platform == "cygwin",
+                 "cygwin's curses mostly just hangs")
+class TestCurses(unittest.TestCase):
+    @classmethod
+    def setUpClass(cls):
+        curses.setupterm(fd=sys.__stdout__.fileno())
 
-if sys.platform == "cygwin":
-    raise unittest.SkipTest("cygwin's curses mostly just hangs")
+    def setUp(self):
+        if verbose:
+            # just to make the test output a little more readable
+            print()
+        self.stdscr = curses.initscr()
+        curses.savetty()
 
-def window_funcs(stdscr):
-    "Test the methods of windows"
-    win = curses.newwin(10,10)
-    win = curses.newwin(5,5, 5,5)
-    win2 = curses.newwin(15,15, 5,5)
-
-    for meth in [stdscr.addch, stdscr.addstr]:
-        for args in [('a'), ('a', curses.A_BOLD),
-                     (4,4, 'a'), (5,5, 'a', curses.A_BOLD)]:
-            meth(*args)
-
-    for meth in [stdscr.box, stdscr.clear, stdscr.clrtobot,
-                 stdscr.clrtoeol, stdscr.cursyncup, stdscr.delch,
-                 stdscr.deleteln, stdscr.erase, stdscr.getbegyx,
-                 stdscr.getbkgd, stdscr.getkey, stdscr.getmaxyx,
-                 stdscr.getparyx, stdscr.getyx, stdscr.inch,
-                 stdscr.insertln, stdscr.instr, stdscr.is_wintouched,
-                 win.noutrefresh, stdscr.redrawwin, stdscr.refresh,
-                 stdscr.standout, stdscr.standend, stdscr.syncdown,
-                 stdscr.syncup, stdscr.touchwin, stdscr.untouchwin]:
-        meth()
-
-    stdscr.addnstr('1234', 3)
-    stdscr.addnstr('1234', 3, curses.A_BOLD)
-    stdscr.addnstr(4,4, '1234', 3)
-    stdscr.addnstr(5,5, '1234', 3, curses.A_BOLD)
-
-    stdscr.attron(curses.A_BOLD)
-    stdscr.attroff(curses.A_BOLD)
-    stdscr.attrset(curses.A_BOLD)
-    stdscr.bkgd(' ')
-    stdscr.bkgd(' ', curses.A_REVERSE)
-    stdscr.bkgdset(' ')
-    stdscr.bkgdset(' ', curses.A_REVERSE)
-
-    win.border(65, 66, 67, 68,
-               69, 70, 71, 72)
-    win.border('|', '!', '-', '_',
-               '+', '\\', '#', '/')
-    try:
-        win.border(65, 66, 67, 68,
-                   69, [], 71, 72)
-    except TypeError:
-        pass
-    else:
-        raise RuntimeError("Expected win.border() to raise TypeError")
-
-    stdscr.clearok(1)
-
-    win4 = stdscr.derwin(2,2)
-    win4 = stdscr.derwin(1,1, 5,5)
-    win4.mvderwin(9,9)
-
-    stdscr.echochar('a')
-    stdscr.echochar('a', curses.A_BOLD)
-    stdscr.hline('-', 5)
-    stdscr.hline('-', 5, curses.A_BOLD)
-    stdscr.hline(1,1,'-', 5)
-    stdscr.hline(1,1,'-', 5, curses.A_BOLD)
-
-    stdscr.idcok(1)
-    stdscr.idlok(1)
-    stdscr.immedok(1)
-    stdscr.insch('c')
-    stdscr.insdelln(1)
-    stdscr.insnstr('abc', 3)
-    stdscr.insnstr('abc', 3, curses.A_BOLD)
-    stdscr.insnstr(5, 5, 'abc', 3)
-    stdscr.insnstr(5, 5, 'abc', 3, curses.A_BOLD)
-
-    stdscr.insstr('def')
-    stdscr.insstr('def', curses.A_BOLD)
-    stdscr.insstr(5, 5, 'def')
-    stdscr.insstr(5, 5, 'def', curses.A_BOLD)
-    stdscr.is_linetouched(0)
-    stdscr.keypad(1)
-    stdscr.leaveok(1)
-    stdscr.move(3,3)
-    win.mvwin(2,2)
-    stdscr.nodelay(1)
-    stdscr.notimeout(1)
-    win2.overlay(win)
-    win2.overwrite(win)
-    win2.overlay(win, 1, 2, 3, 3, 2, 1)
-    win2.overwrite(win, 1, 2, 3, 3, 2, 1)
-    stdscr.redrawln(1,2)
-
-    stdscr.scrollok(1)
-    stdscr.scroll()
-    stdscr.scroll(2)
-    stdscr.scroll(-3)
-
-    stdscr.move(12, 2)
-    stdscr.setscrreg(10,15)
-    win3 = stdscr.subwin(10,10)
-    win3 = stdscr.subwin(10,10, 5,5)
-    stdscr.syncok(1)
-    stdscr.timeout(5)
-    stdscr.touchline(5,5)
-    stdscr.touchline(5,5,0)
-    stdscr.vline('a', 3)
-    stdscr.vline('a', 3, curses.A_STANDOUT)
-    stdscr.chgat(5, 2, 3, curses.A_BLINK)
-    stdscr.chgat(3, curses.A_BOLD)
-    stdscr.chgat(5, 8, curses.A_UNDERLINE)
-    stdscr.chgat(curses.A_BLINK)
-    stdscr.refresh()
-
-    stdscr.vline(1,1, 'a', 3)
-    stdscr.vline(1,1, 'a', 3, curses.A_STANDOUT)
-
-    if hasattr(curses, 'resize'):
-        stdscr.resize()
-    if hasattr(curses, 'enclose'):
-        stdscr.enclose()
-
-
-def module_funcs(stdscr):
-    "Test module-level functions"
-
-    for func in [curses.baudrate, curses.beep, curses.can_change_color,
-                 curses.cbreak, curses.def_prog_mode, curses.doupdate,
-                 curses.filter, curses.flash, curses.flushinp,
-                 curses.has_colors, curses.has_ic, curses.has_il,
-                 curses.isendwin, curses.killchar, curses.longname,
-                 curses.nocbreak, curses.noecho, curses.nonl,
-                 curses.noqiflush, curses.noraw,
-                 curses.reset_prog_mode, curses.termattrs,
-                 curses.termname, curses.erasechar, curses.getsyx]:
-        func()
-
-    # Functions that actually need arguments
-    if curses.tigetstr("cnorm"):
-        curses.curs_set(1)
-    curses.delay_output(1)
-    curses.echo() ; curses.echo(1)
-
-    f = tempfile.TemporaryFile()
-    stdscr.putwin(f)
-    f.seek(0)
-    curses.getwin(f)
-    f.close()
-
-    curses.halfdelay(1)
-    curses.intrflush(1)
-    curses.meta(1)
-    curses.napms(100)
-    curses.newpad(50,50)
-    win = curses.newwin(5,5)
-    win = curses.newwin(5,5, 1,1)
-    curses.nl() ; curses.nl(1)
-    curses.putp(b'abc')
-    curses.qiflush()
-    curses.raw() ; curses.raw(1)
-    curses.setsyx(5,5)
-    curses.tigetflag('hc')
-    curses.tigetnum('co')
-    curses.tigetstr('cr')
-    curses.tparm(b'cr')
-    curses.typeahead(sys.__stdin__.fileno())
-    curses.unctrl('a')
-    curses.ungetch('a')
-    curses.use_env(1)
-
-    # Functions only available on a few platforms
-    if curses.has_colors():
-        curses.start_color()
-        curses.init_pair(2, 1,1)
-        curses.color_content(1)
-        curses.color_pair(2)
-        curses.pair_content(curses.COLOR_PAIRS - 1)
-        curses.pair_number(0)
-
-        if hasattr(curses, 'use_default_colors'):
-            curses.use_default_colors()
-
-    if hasattr(curses, 'keyname'):
-        curses.keyname(13)
-
-    if hasattr(curses, 'has_key'):
-        curses.has_key(13)
-
-    if hasattr(curses, 'getmouse'):
-        (availmask, oldmask) = curses.mousemask(curses.BUTTON1_PRESSED)
-        # availmask indicates that mouse stuff not available.
-        if availmask != 0:
-            curses.mouseinterval(10)
-            # just verify these don't cause errors
-            curses.ungetmouse(0, 0, 0, 0, curses.BUTTON1_PRESSED)
-            m = curses.getmouse()
-
-    if hasattr(curses, 'is_term_resized'):
-        curses.is_term_resized(*stdscr.getmaxyx())
-    if hasattr(curses, 'resizeterm'):
-        curses.resizeterm(*stdscr.getmaxyx())
-    if hasattr(curses, 'resize_term'):
-        curses.resize_term(*stdscr.getmaxyx())
-
-def unit_tests():
-    from curses import ascii
-    for ch, expected in [('a', 'a'), ('A', 'A'),
-                         (';', ';'), (' ', ' '),
-                         ('\x7f', '^?'), ('\n', '^J'), ('\0', '^@'),
-                         # Meta-bit characters
-                         ('\x8a', '!^J'), ('\xc1', '!A'),
-                         ]:
-        if ascii.unctrl(ch) != expected:
-            print('curses.unctrl fails on character', repr(ch))
-
-
-def test_userptr_without_set(stdscr):
-    w = curses.newwin(10, 10)
-    p = curses.panel.new_panel(w)
-    # try to access userptr() before calling set_userptr() -- segfaults
-    try:
-        p.userptr()
-        raise RuntimeError('userptr should fail since not set')
-    except curses.panel.error:
-        pass
-
-def test_userptr_memory_leak(stdscr):
-    w = curses.newwin(10, 10)
-    p = curses.panel.new_panel(w)
-    obj = object()
-    nrefs = sys.getrefcount(obj)
-    for i in range(100):
-        p.set_userptr(obj)
-
-    p.set_userptr(None)
-    if sys.getrefcount(obj) != nrefs:
-        raise RuntimeError("set_userptr leaked references")
-
-def test_userptr_segfault(stdscr):
-    panel = curses.panel.new_panel(stdscr)
-    class A:
-        def __del__(self):
-            panel.set_userptr(None)
-    panel.set_userptr(A())
-    panel.set_userptr(None)
-
-def test_resize_term(stdscr):
-    if hasattr(curses, 'resizeterm'):
-        lines, cols = curses.LINES, curses.COLS
-        curses.resizeterm(lines - 1, cols + 1)
-
-        if curses.LINES != lines - 1 or curses.COLS != cols + 1:
-            raise RuntimeError("Expected resizeterm to update LINES and COLS")
-
-def test_issue6243(stdscr):
-    curses.ungetch(1025)
-    stdscr.getkey()
-
-def test_unget_wch(stdscr):
-    if not hasattr(curses, 'unget_wch'):
-        return
-    encoding = stdscr.encoding
-    for ch in ('a', '\xe9', '\u20ac', '\U0010FFFF'):
-        try:
-            ch.encode(encoding)
-        except UnicodeEncodeError:
-            continue
-        try:
-            curses.unget_wch(ch)
-        except Exception as err:
-            raise Exception("unget_wch(%a) failed with encoding %s: %s"
-                            % (ch, stdscr.encoding, err))
-        read = stdscr.get_wch()
-        if read != ch:
-            raise AssertionError("%r != %r" % (read, ch))
-
-        code = ord(ch)
-        curses.unget_wch(code)
-        read = stdscr.get_wch()
-        if read != ch:
-            raise AssertionError("%r != %r" % (read, ch))
-
-def test_issue10570():
-    b = curses.tparm(curses.tigetstr("cup"), 5, 3)
-    assert type(b) is bytes
-    curses.putp(b)
-
-def test_encoding(stdscr):
-    import codecs
-    encoding = stdscr.encoding
-    codecs.lookup(encoding)
-    try:
-        stdscr.encoding = 10
-    except TypeError:
-        pass
-    else:
-        raise AssertionError("TypeError not raised")
-    stdscr.encoding = encoding
-    try:
-        del stdscr.encoding
-    except TypeError:
-        pass
-    else:
-        raise AssertionError("TypeError not raised")
-
-def main(stdscr):
-    curses.savetty()
-    try:
-        module_funcs(stdscr)
-        window_funcs(stdscr)
-        test_userptr_without_set(stdscr)
-        test_userptr_memory_leak(stdscr)
-        test_userptr_segfault(stdscr)
-        test_resize_term(stdscr)
-        test_issue6243(stdscr)
-        test_unget_wch(stdscr)
-        test_issue10570()
-        test_encoding(stdscr)
-    finally:
+    def tearDown(self):
         curses.resetty()
-
-def test_main():
-    if not sys.__stdout__.isatty():
-        raise unittest.SkipTest("sys.__stdout__ is not a tty")
-    # testing setupterm() inside initscr/endwin
-    # causes terminal breakage
-    curses.setupterm(fd=sys.__stdout__.fileno())
-    try:
-        stdscr = curses.initscr()
-        main(stdscr)
-    finally:
         curses.endwin()
-    unit_tests()
+
+    def test_window_funcs(self):
+        "Test the methods of windows"
+        stdscr = self.stdscr
+        win = curses.newwin(10,10)
+        win = curses.newwin(5,5, 5,5)
+        win2 = curses.newwin(15,15, 5,5)
+
+        for meth in [stdscr.addch, stdscr.addstr]:
+            for args in [('a'), ('a', curses.A_BOLD),
+                         (4,4, 'a'), (5,5, 'a', curses.A_BOLD)]:
+                meth(*args)
+
+        for meth in [stdscr.box, stdscr.clear, stdscr.clrtobot,
+                     stdscr.clrtoeol, stdscr.cursyncup, stdscr.delch,
+                     stdscr.deleteln, stdscr.erase, stdscr.getbegyx,
+                     stdscr.getbkgd, stdscr.getkey, stdscr.getmaxyx,
+                     stdscr.getparyx, stdscr.getyx, stdscr.inch,
+                     stdscr.insertln, stdscr.instr, stdscr.is_wintouched,
+                     win.noutrefresh, stdscr.redrawwin, stdscr.refresh,
+                     stdscr.standout, stdscr.standend, stdscr.syncdown,
+                     stdscr.syncup, stdscr.touchwin, stdscr.untouchwin]:
+            meth()
+
+        stdscr.addnstr('1234', 3)
+        stdscr.addnstr('1234', 3, curses.A_BOLD)
+        stdscr.addnstr(4,4, '1234', 3)
+        stdscr.addnstr(5,5, '1234', 3, curses.A_BOLD)
+
+        stdscr.attron(curses.A_BOLD)
+        stdscr.attroff(curses.A_BOLD)
+        stdscr.attrset(curses.A_BOLD)
+        stdscr.bkgd(' ')
+        stdscr.bkgd(' ', curses.A_REVERSE)
+        stdscr.bkgdset(' ')
+        stdscr.bkgdset(' ', curses.A_REVERSE)
+
+        win.border(65, 66, 67, 68,
+                   69, 70, 71, 72)
+        win.border('|', '!', '-', '_',
+                   '+', '\\', '#', '/')
+        with self.assertRaises(TypeError,
+                               msg="Expected win.border() to raise TypeError"):
+            win.border(65, 66, 67, 68,
+                       69, [], 71, 72)
+
+        stdscr.clearok(1)
+
+        win4 = stdscr.derwin(2,2)
+        win4 = stdscr.derwin(1,1, 5,5)
+        win4.mvderwin(9,9)
+
+        stdscr.echochar('a')
+        stdscr.echochar('a', curses.A_BOLD)
+        stdscr.hline('-', 5)
+        stdscr.hline('-', 5, curses.A_BOLD)
+        stdscr.hline(1,1,'-', 5)
+        stdscr.hline(1,1,'-', 5, curses.A_BOLD)
+
+        stdscr.idcok(1)
+        stdscr.idlok(1)
+        stdscr.immedok(1)
+        stdscr.insch('c')
+        stdscr.insdelln(1)
+        stdscr.insnstr('abc', 3)
+        stdscr.insnstr('abc', 3, curses.A_BOLD)
+        stdscr.insnstr(5, 5, 'abc', 3)
+        stdscr.insnstr(5, 5, 'abc', 3, curses.A_BOLD)
+
+        stdscr.insstr('def')
+        stdscr.insstr('def', curses.A_BOLD)
+        stdscr.insstr(5, 5, 'def')
+        stdscr.insstr(5, 5, 'def', curses.A_BOLD)
+        stdscr.is_linetouched(0)
+        stdscr.keypad(1)
+        stdscr.leaveok(1)
+        stdscr.move(3,3)
+        win.mvwin(2,2)
+        stdscr.nodelay(1)
+        stdscr.notimeout(1)
+        win2.overlay(win)
+        win2.overwrite(win)
+        win2.overlay(win, 1, 2, 2, 1, 3, 3)
+        win2.overwrite(win, 1, 2, 2, 1, 3, 3)
+        stdscr.redrawln(1,2)
+
+        stdscr.scrollok(1)
+        stdscr.scroll()
+        stdscr.scroll(2)
+        stdscr.scroll(-3)
+
+        stdscr.move(12, 2)
+        stdscr.setscrreg(10,15)
+        win3 = stdscr.subwin(10,10)
+        win3 = stdscr.subwin(10,10, 5,5)
+        stdscr.syncok(1)
+        stdscr.timeout(5)
+        stdscr.touchline(5,5)
+        stdscr.touchline(5,5,0)
+        stdscr.vline('a', 3)
+        stdscr.vline('a', 3, curses.A_STANDOUT)
+        stdscr.chgat(5, 2, 3, curses.A_BLINK)
+        stdscr.chgat(3, curses.A_BOLD)
+        stdscr.chgat(5, 8, curses.A_UNDERLINE)
+        stdscr.chgat(curses.A_BLINK)
+        stdscr.refresh()
+
+        stdscr.vline(1,1, 'a', 3)
+        stdscr.vline(1,1, 'a', 3, curses.A_STANDOUT)
+
+        if hasattr(curses, 'resize'):
+            stdscr.resize()
+        if hasattr(curses, 'enclose'):
+            stdscr.enclose()
+
+
+    def test_module_funcs(self):
+        "Test module-level functions"
+        stdscr = self.stdscr
+        for func in [curses.baudrate, curses.beep, curses.can_change_color,
+                     curses.cbreak, curses.def_prog_mode, curses.doupdate,
+                     curses.filter, curses.flash, curses.flushinp,
+                     curses.has_colors, curses.has_ic, curses.has_il,
+                     curses.isendwin, curses.killchar, curses.longname,
+                     curses.nocbreak, curses.noecho, curses.nonl,
+                     curses.noqiflush, curses.noraw,
+                     curses.reset_prog_mode, curses.termattrs,
+                     curses.termname, curses.erasechar, curses.getsyx]:
+            func()
+
+        # Functions that actually need arguments
+        if curses.tigetstr("cnorm"):
+            curses.curs_set(1)
+        curses.delay_output(1)
+        curses.echo() ; curses.echo(1)
+
+        f = tempfile.TemporaryFile()
+        stdscr.putwin(f)
+        f.seek(0)
+        curses.getwin(f)
+        f.close()
+
+        curses.halfdelay(1)
+        curses.intrflush(1)
+        curses.meta(1)
+        curses.napms(100)
+        curses.newpad(50,50)
+        win = curses.newwin(5,5)
+        win = curses.newwin(5,5, 1,1)
+        curses.nl() ; curses.nl(1)
+        curses.putp(b'abc')
+        curses.qiflush()
+        curses.raw() ; curses.raw(1)
+        curses.setsyx(5,5)
+        curses.tigetflag('hc')
+        curses.tigetnum('co')
+        curses.tigetstr('cr')
+        curses.tparm(b'cr')
+        curses.typeahead(sys.__stdin__.fileno())
+        curses.unctrl('a')
+        curses.ungetch('a')
+        curses.use_env(1)
+
+        # Functions only available on a few platforms
+        if curses.has_colors():
+            curses.start_color()
+            curses.init_pair(2, 1,1)
+            curses.color_content(1)
+            curses.color_pair(2)
+            curses.pair_content(curses.COLOR_PAIRS - 1)
+            curses.pair_number(0)
+
+            if hasattr(curses, 'use_default_colors'):
+                curses.use_default_colors()
+
+        if hasattr(curses, 'keyname'):
+            curses.keyname(13)
+
+        if hasattr(curses, 'has_key'):
+            curses.has_key(13)
+
+        if hasattr(curses, 'getmouse'):
+            (availmask, oldmask) = curses.mousemask(curses.BUTTON1_PRESSED)
+            # availmask indicates that mouse stuff not available.
+            if availmask != 0:
+                curses.mouseinterval(10)
+                # just verify these don't cause errors
+                curses.ungetmouse(0, 0, 0, 0, curses.BUTTON1_PRESSED)
+                m = curses.getmouse()
+
+        if hasattr(curses, 'is_term_resized'):
+            curses.is_term_resized(*stdscr.getmaxyx())
+        if hasattr(curses, 'resizeterm'):
+            curses.resizeterm(*stdscr.getmaxyx())
+        if hasattr(curses, 'resize_term'):
+            curses.resize_term(*stdscr.getmaxyx())
+
+    def test_unctrl(self):
+        from curses import ascii
+        for ch, expected in [('a', 'a'), ('A', 'A'),
+                             (';', ';'), (' ', ' '),
+                             ('\x7f', '^?'), ('\n', '^J'), ('\0', '^@'),
+                             # Meta-bit characters
+                             ('\x8a', '!^J'), ('\xc1', '!A'),
+                             ]:
+            self.assertEqual(ascii.unctrl(ch), expected,
+                             'curses.unctrl fails on character %r' % ch)
+
+
+    def test_userptr_without_set(self):
+        w = curses.newwin(10, 10)
+        p = curses.panel.new_panel(w)
+        # try to access userptr() before calling set_userptr() -- segfaults
+        with self.assertRaises(curses.panel.error,
+                               msg='userptr should fail since not set'):
+            p.userptr()
+
+    def test_userptr_memory_leak(self):
+        w = curses.newwin(10, 10)
+        p = curses.panel.new_panel(w)
+        obj = object()
+        nrefs = sys.getrefcount(obj)
+        for i in range(100):
+            p.set_userptr(obj)
+
+        p.set_userptr(None)
+        self.assertEqual(sys.getrefcount(obj), nrefs,
+                         "set_userptr leaked references")
+
+    def test_userptr_segfault(self):
+        panel = curses.panel.new_panel(self.stdscr)
+        class A:
+            def __del__(self):
+                panel.set_userptr(None)
+        panel.set_userptr(A())
+        panel.set_userptr(None)
+
+    @unittest.skipUnless(hasattr(curses, 'resizeterm'),
+                           'resizeterm not available')
+    def test_resize_term(self):
+        lines, cols = curses.LINES, curses.COLS
+        new_lines = lines - 1
+        new_cols = cols + 1
+        curses.resizeterm(new_lines, new_cols)
+
+        self.assertEqual(curses.LINES, new_lines)
+        self.assertEqual(curses.COLS, new_cols)
+
+    def test_issue6243(self):
+        curses.ungetch(1025)
+        self.stdscr.getkey()
+
+    @unittest.skipUnless(hasattr(curses, 'unget_wch'),
+                         'unget_wch not available')
+    def test_unget_wch(self):
+        stdscr = self.stdscr
+        encoding = stdscr.encoding
+        for ch in ('a', '\xe9', '\u20ac', '\U0010FFFF'):
+            try:
+                ch.encode(encoding)
+            except UnicodeEncodeError:
+                continue
+            try:
+                curses.unget_wch(ch)
+            except Exception as err:
+                self.fail("unget_wch(%a) failed with encoding %s: %s"
+                          % (ch, stdscr.encoding, err))
+            read = stdscr.get_wch()
+            self.assertEqual(read, ch)
+
+            code = ord(ch)
+            curses.unget_wch(code)
+            read = stdscr.get_wch()
+            self.assertEqual(read, ch)
+
+    def test_issue10570(self):
+        b = curses.tparm(curses.tigetstr("cup"), 5, 3)
+        self.assertIs(type(b), bytes)
+        curses.putp(b)
+
+    def test_encoding(self):
+        stdscr = self.stdscr
+        import codecs
+        encoding = stdscr.encoding
+        codecs.lookup(encoding)
+
+        with self.assertRaises(TypeError):
+            stdscr.encoding = 10
+
+        stdscr.encoding = encoding
+        with self.assertRaises(TypeError):
+            del stdscr.encoding
+
+    def test_issue21088(self):
+        stdscr = self.stdscr
+        #
+        # http://bugs.python.org/issue21088
+        #
+        # the bug:
+        # when converting curses.window.addch to Argument Clinic
+        # the first two parameters were switched.
+
+        # if someday we can represent the signature of addch
+        # we will need to rewrite this test.
+        try:
+            signature = inspect.signature(stdscr.addch)
+            self.assertFalse(signature)
+        except ValueError:
+            # not generating a signature is fine.
+            pass
+
+        # So.  No signature for addch.
+        # But Argument Clinic gave us a human-readable equivalent
+        # as the first line of the docstring.  So we parse that,
+        # and ensure that the parameters appear in the correct order.
+        # Since this is parsing output from Argument Clinic, we can
+        # be reasonably certain the generated parsing code will be
+        # correct too.
+        human_readable_signature = stdscr.addch.__doc__.split("\n")[0]
+        offset = human_readable_signature.find("[y, x,]")
+        assert offset >= 0, ""
+
 
 if __name__ == '__main__':
-    curses.wrapper(main)
-    unit_tests()
+    unittest.main()
diff --git a/Lib/test/test_dbm.py b/Lib/test/test_dbm.py
index d11d924..623d992 100644
--- a/Lib/test/test_dbm.py
+++ b/Lib/test/test_dbm.py
@@ -61,7 +61,7 @@
         return keys
 
     def test_error(self):
-        self.assertTrue(issubclass(self.module.error, IOError))
+        self.assertTrue(issubclass(self.module.error, OSError))
 
     def test_anydbm_not_existing(self):
         self.assertRaises(dbm.error, dbm.open, _fname)
diff --git a/Lib/test/test_dbm_dumb.py b/Lib/test/test_dbm_dumb.py
index 4f03ae7..29f48a3 100644
--- a/Lib/test/test_dbm_dumb.py
+++ b/Lib/test/test_dbm_dumb.py
@@ -3,10 +3,12 @@
 """
 
 import io
+import operator
 import os
 import unittest
 import dbm.dumb as dumbdbm
 from test import support
+from functools import partial
 
 _fname = support.TESTFN
 
@@ -183,6 +185,38 @@
             self.assertEqual(expected, got)
             f.close()
 
+    def test_context_manager(self):
+        with dumbdbm.open(_fname, 'c') as db:
+            db["dumbdbm context manager"] = "context manager"
+
+        with dumbdbm.open(_fname, 'r') as db:
+            self.assertEqual(list(db.keys()), [b"dumbdbm context manager"])
+
+        with self.assertRaises(dumbdbm.error):
+            db.keys()
+
+    def test_check_closed(self):
+        f = dumbdbm.open(_fname, 'c')
+        f.close()
+
+        for meth in (partial(operator.delitem, f),
+                     partial(operator.setitem, f, 'b'),
+                     partial(operator.getitem, f),
+                     partial(operator.contains, f)):
+            with self.assertRaises(dumbdbm.error) as cm:
+                meth('test')
+            self.assertEqual(str(cm.exception),
+                             "DBM object has already been closed")
+
+        for meth in (operator.methodcaller('keys'),
+                     operator.methodcaller('iterkeys'),
+                     operator.methodcaller('items'),
+                     len):
+            with self.assertRaises(dumbdbm.error) as cm:
+                meth(f)
+            self.assertEqual(str(cm.exception),
+                             "DBM object has already been closed")
+
     def tearDown(self):
         _delete_files()
 
diff --git a/Lib/test/test_dbm_gnu.py b/Lib/test/test_dbm_gnu.py
index 4fb66c5..a7808f5 100644
--- a/Lib/test/test_dbm_gnu.py
+++ b/Lib/test/test_dbm_gnu.py
@@ -81,6 +81,17 @@
         size2 = os.path.getsize(filename)
         self.assertTrue(size1 > size2 >= size0)
 
+    def test_context_manager(self):
+        with gdbm.open(filename, 'c') as db:
+            db["gdbm context manager"] = "context manager"
+
+        with gdbm.open(filename, 'r') as db:
+            self.assertEqual(list(db.keys()), [b"gdbm context manager"])
+
+        with self.assertRaises(gdbm.error) as cm:
+            db.keys()
+        self.assertEqual(str(cm.exception),
+                         "GDBM object has already been closed")
 
 if __name__ == '__main__':
     unittest.main()
diff --git a/Lib/test/test_dbm_ndbm.py b/Lib/test/test_dbm_ndbm.py
index b57e1f0..2291561 100644
--- a/Lib/test/test_dbm_ndbm.py
+++ b/Lib/test/test_dbm_ndbm.py
@@ -37,5 +37,18 @@
             except error:
                 self.fail()
 
+    def test_context_manager(self):
+        with dbm.ndbm.open(self.filename, 'c') as db:
+            db["ndbm context manager"] = "context manager"
+
+        with dbm.ndbm.open(self.filename, 'r') as db:
+            self.assertEqual(list(db.keys()), [b"ndbm context manager"])
+
+        with self.assertRaises(dbm.ndbm.error) as cm:
+            db.keys()
+        self.assertEqual(str(cm.exception),
+                         "DBM object has already been closed")
+
+
 if __name__ == '__main__':
     unittest.main()
diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py
index 4031347..a178f6f 100644
--- a/Lib/test/test_decimal.py
+++ b/Lib/test/test_decimal.py
@@ -1057,6 +1057,11 @@
 
             # issue 6850
             ('a=-7.0', '0.12345', 'aaaa0.1'),
+
+            # issue 22090
+            ('<^+15.20%', 'inf', '<<+Infinity%<<<'),
+            ('\x07>,%', 'sNaN1234567', 'sNaN1234567%'),
+            ('=10.10%', 'NaN123', '   NaN123%'),
             ]
         for fmt, d, result in test_values:
             self.assertEqual(format(Decimal(d), fmt), result)
@@ -2401,37 +2406,55 @@
         self.assertNotIsInstance(Decimal(0), numbers.Real)
 
     def test_pickle(self):
-        Decimal = self.decimal.Decimal
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            Decimal = self.decimal.Decimal
 
-        savedecimal = sys.modules['decimal']
+            savedecimal = sys.modules['decimal']
 
-        # Round trip
-        sys.modules['decimal'] = self.decimal
-        d = Decimal('-3.141590000')
-        p = pickle.dumps(d)
-        e = pickle.loads(p)
-        self.assertEqual(d, e)
+            # Round trip
+            sys.modules['decimal'] = self.decimal
+            d = Decimal('-3.141590000')
+            p = pickle.dumps(d, proto)
+            e = pickle.loads(p)
+            self.assertEqual(d, e)
 
-        if C:
-            # Test interchangeability
-            x = C.Decimal('-3.123e81723')
-            y = P.Decimal('-3.123e81723')
+            if C:
+                # Test interchangeability
+                x = C.Decimal('-3.123e81723')
+                y = P.Decimal('-3.123e81723')
 
-            sys.modules['decimal'] = C
-            sx = pickle.dumps(x)
-            sys.modules['decimal'] = P
-            r = pickle.loads(sx)
-            self.assertIsInstance(r, P.Decimal)
-            self.assertEqual(r, y)
+                sys.modules['decimal'] = C
+                sx = pickle.dumps(x, proto)
+                sys.modules['decimal'] = P
+                r = pickle.loads(sx)
+                self.assertIsInstance(r, P.Decimal)
+                self.assertEqual(r, y)
 
-            sys.modules['decimal'] = P
-            sy = pickle.dumps(y)
-            sys.modules['decimal'] = C
-            r = pickle.loads(sy)
-            self.assertIsInstance(r, C.Decimal)
-            self.assertEqual(r, x)
+                sys.modules['decimal'] = P
+                sy = pickle.dumps(y, proto)
+                sys.modules['decimal'] = C
+                r = pickle.loads(sy)
+                self.assertIsInstance(r, C.Decimal)
+                self.assertEqual(r, x)
 
-        sys.modules['decimal'] = savedecimal
+                x = C.Decimal('-3.123e81723').as_tuple()
+                y = P.Decimal('-3.123e81723').as_tuple()
+
+                sys.modules['decimal'] = C
+                sx = pickle.dumps(x, proto)
+                sys.modules['decimal'] = P
+                r = pickle.loads(sx)
+                self.assertIsInstance(r, P.DecimalTuple)
+                self.assertEqual(r, y)
+
+                sys.modules['decimal'] = P
+                sy = pickle.dumps(y, proto)
+                sys.modules['decimal'] = C
+                r = pickle.loads(sy)
+                self.assertIsInstance(r, C.DecimalTuple)
+                self.assertEqual(r, x)
+
+            sys.modules['decimal'] = savedecimal
 
     def test_int(self):
         Decimal = self.decimal.Decimal
@@ -2755,63 +2778,64 @@
 
     def test_pickle(self):
 
-        Context = self.decimal.Context
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            Context = self.decimal.Context
 
-        savedecimal = sys.modules['decimal']
+            savedecimal = sys.modules['decimal']
 
-        # Round trip
-        sys.modules['decimal'] = self.decimal
-        c = Context()
-        e = pickle.loads(pickle.dumps(c))
+            # Round trip
+            sys.modules['decimal'] = self.decimal
+            c = Context()
+            e = pickle.loads(pickle.dumps(c, proto))
 
-        self.assertEqual(c.prec, e.prec)
-        self.assertEqual(c.Emin, e.Emin)
-        self.assertEqual(c.Emax, e.Emax)
-        self.assertEqual(c.rounding, e.rounding)
-        self.assertEqual(c.capitals, e.capitals)
-        self.assertEqual(c.clamp, e.clamp)
-        self.assertEqual(c.flags, e.flags)
-        self.assertEqual(c.traps, e.traps)
+            self.assertEqual(c.prec, e.prec)
+            self.assertEqual(c.Emin, e.Emin)
+            self.assertEqual(c.Emax, e.Emax)
+            self.assertEqual(c.rounding, e.rounding)
+            self.assertEqual(c.capitals, e.capitals)
+            self.assertEqual(c.clamp, e.clamp)
+            self.assertEqual(c.flags, e.flags)
+            self.assertEqual(c.traps, e.traps)
 
-        # Test interchangeability
-        combinations = [(C, P), (P, C)] if C else [(P, P)]
-        for dumper, loader in combinations:
-            for ri, _ in enumerate(RoundingModes):
-                for fi, _ in enumerate(OrderedSignals[dumper]):
-                    for ti, _ in enumerate(OrderedSignals[dumper]):
+            # Test interchangeability
+            combinations = [(C, P), (P, C)] if C else [(P, P)]
+            for dumper, loader in combinations:
+                for ri, _ in enumerate(RoundingModes):
+                    for fi, _ in enumerate(OrderedSignals[dumper]):
+                        for ti, _ in enumerate(OrderedSignals[dumper]):
 
-                        prec = random.randrange(1, 100)
-                        emin = random.randrange(-100, 0)
-                        emax = random.randrange(1, 100)
-                        caps = random.randrange(2)
-                        clamp = random.randrange(2)
+                            prec = random.randrange(1, 100)
+                            emin = random.randrange(-100, 0)
+                            emax = random.randrange(1, 100)
+                            caps = random.randrange(2)
+                            clamp = random.randrange(2)
 
-                        # One module dumps
-                        sys.modules['decimal'] = dumper
-                        c = dumper.Context(
-                              prec=prec, Emin=emin, Emax=emax,
-                              rounding=RoundingModes[ri],
-                              capitals=caps, clamp=clamp,
-                              flags=OrderedSignals[dumper][:fi],
-                              traps=OrderedSignals[dumper][:ti]
-                        )
-                        s = pickle.dumps(c)
+                            # One module dumps
+                            sys.modules['decimal'] = dumper
+                            c = dumper.Context(
+                                  prec=prec, Emin=emin, Emax=emax,
+                                  rounding=RoundingModes[ri],
+                                  capitals=caps, clamp=clamp,
+                                  flags=OrderedSignals[dumper][:fi],
+                                  traps=OrderedSignals[dumper][:ti]
+                            )
+                            s = pickle.dumps(c, proto)
 
-                        # The other module loads
-                        sys.modules['decimal'] = loader
-                        d = pickle.loads(s)
-                        self.assertIsInstance(d, loader.Context)
+                            # The other module loads
+                            sys.modules['decimal'] = loader
+                            d = pickle.loads(s)
+                            self.assertIsInstance(d, loader.Context)
 
-                        self.assertEqual(d.prec, prec)
-                        self.assertEqual(d.Emin, emin)
-                        self.assertEqual(d.Emax, emax)
-                        self.assertEqual(d.rounding, RoundingModes[ri])
-                        self.assertEqual(d.capitals, caps)
-                        self.assertEqual(d.clamp, clamp)
-                        assert_signals(self, d, 'flags', OrderedSignals[loader][:fi])
-                        assert_signals(self, d, 'traps', OrderedSignals[loader][:ti])
+                            self.assertEqual(d.prec, prec)
+                            self.assertEqual(d.Emin, emin)
+                            self.assertEqual(d.Emax, emax)
+                            self.assertEqual(d.rounding, RoundingModes[ri])
+                            self.assertEqual(d.capitals, caps)
+                            self.assertEqual(d.clamp, clamp)
+                            assert_signals(self, d, 'flags', OrderedSignals[loader][:fi])
+                            assert_signals(self, d, 'traps', OrderedSignals[loader][:ti])
 
-        sys.modules['decimal'] = savedecimal
+            sys.modules['decimal'] = savedecimal
 
     def test_equality_with_other_types(self):
         Decimal = self.decimal.Decimal
@@ -5412,7 +5436,7 @@
     all_tests.insert(0, CheckAttributes)
 
 
-def test_main(arith=False, verbose=None, todo_tests=None, debug=None):
+def test_main(arith=None, verbose=None, todo_tests=None, debug=None):
     """ Execute the tests.
 
     Runs all arithmetic tests if arith is True or if the "decimal" resource
@@ -5422,7 +5446,7 @@
     init(C)
     init(P)
     global TEST_ALL, DEBUG
-    TEST_ALL = arith or is_resource_enabled('decimal')
+    TEST_ALL = arith if arith is not None else is_resource_enabled('decimal')
     DEBUG = debug
 
     if todo_tests is None:
diff --git a/Lib/test/test_deque.py b/Lib/test/test_deque.py
index a8487d2..5ecbc73 100644
--- a/Lib/test/test_deque.py
+++ b/Lib/test/test_deque.py
@@ -474,16 +474,17 @@
 
     def test_iterator_pickle(self):
         data = deque(range(200))
-        it = itorg = iter(data)
-        d = pickle.dumps(it)
-        it = pickle.loads(d)
-        self.assertEqual(type(itorg), type(it))
-        self.assertEqual(list(it), list(data))
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            it = itorg = iter(data)
+            d = pickle.dumps(it, proto)
+            it = pickle.loads(d)
+            self.assertEqual(type(itorg), type(it))
+            self.assertEqual(list(it), list(data))
 
-        it = pickle.loads(d)
-        next(it)
-        d = pickle.dumps(it)
-        self.assertEqual(list(it), list(data)[1:])
+            it = pickle.loads(d)
+            next(it)
+            d = pickle.dumps(it, proto)
+            self.assertEqual(list(it), list(data)[1:])
 
     def test_deepcopy(self):
         mut = [10]
@@ -543,8 +544,8 @@
         check = self.check_sizeof
         check(deque(), basesize + blocksize)
         check(deque('a'), basesize + blocksize)
-        check(deque('a' * (BLOCKLEN // 2)), basesize + blocksize)
-        check(deque('a' * (BLOCKLEN // 2 + 1)), basesize + 2 * blocksize)
+        check(deque('a' * (BLOCKLEN - 1)), basesize + blocksize)
+        check(deque('a' * BLOCKLEN), basesize + 2 * blocksize)
         check(deque('a' * (42 * BLOCKLEN)), basesize + 43 * blocksize)
 
 class TestVariousIteratorArgs(unittest.TestCase):
@@ -614,11 +615,12 @@
         self.assertEqual(type(d), type(e))
         self.assertEqual(list(d), list(e))
 
-        s = pickle.dumps(d)
-        e = pickle.loads(s)
-        self.assertNotEqual(id(d), id(e))
-        self.assertEqual(type(d), type(e))
-        self.assertEqual(list(d), list(e))
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            s = pickle.dumps(d, proto)
+            e = pickle.loads(s)
+            self.assertNotEqual(id(d), id(e))
+            self.assertEqual(type(d), type(e))
+            self.assertEqual(list(d), list(e))
 
         d = Deque('abcde', maxlen=4)
 
@@ -630,11 +632,12 @@
         self.assertEqual(type(d), type(e))
         self.assertEqual(list(d), list(e))
 
-        s = pickle.dumps(d)
-        e = pickle.loads(s)
-        self.assertNotEqual(id(d), id(e))
-        self.assertEqual(type(d), type(e))
-        self.assertEqual(list(d), list(e))
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            s = pickle.dumps(d, proto)
+            e = pickle.loads(s)
+            self.assertNotEqual(id(d), id(e))
+            self.assertEqual(type(d), type(e))
+            self.assertEqual(list(d), list(e))
 
 ##    def test_pickle(self):
 ##        d = Deque('abc')
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
index 1a891a8..26c273a 100644
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -1,8 +1,11 @@
 import builtins
+import copyreg
 import gc
+import itertools
+import math
+import pickle
 import sys
 import types
-import math
 import unittest
 import weakref
 
@@ -1146,7 +1149,7 @@
         except (TypeError, UnicodeEncodeError):
             pass
         else:
-            raise TestFailed("[chr(128)] slots not caught")
+            self.fail("[chr(128)] slots not caught")
 
         # Test leaks
         class Counted(object):
@@ -1797,6 +1800,7 @@
             ("__trunc__", int, zero, set(), {}),
             ("__ceil__", math.ceil, zero, set(), {}),
             ("__dir__", dir, empty_seq, set(), {}),
+            ("__round__", round, zero, set(), {}),
             ]
 
         class Checker(object):
@@ -2258,7 +2262,9 @@
         minstance = M("m")
         minstance.b = 2
         minstance.a = 1
-        names = [x for x in dir(minstance) if x not in ["__name__", "__doc__"]]
+        default_attributes = ['__name__', '__doc__', '__package__',
+                              '__loader__', '__spec__']
+        names = [x for x in dir(minstance) if x not in default_attributes]
         self.assertEqual(names, ['a', 'b'])
 
         class M2(M):
@@ -3151,176 +3157,6 @@
             self.assertEqual(e.a, 1)
             self.assertEqual(can_delete_dict(e), can_delete_dict(ValueError()))
 
-    def test_pickles(self):
-        # Testing pickling and copying new-style classes and objects...
-        import pickle
-
-        def sorteditems(d):
-            L = list(d.items())
-            L.sort()
-            return L
-
-        global C
-        class C(object):
-            def __init__(self, a, b):
-                super(C, self).__init__()
-                self.a = a
-                self.b = b
-            def __repr__(self):
-                return "C(%r, %r)" % (self.a, self.b)
-
-        global C1
-        class C1(list):
-            def __new__(cls, a, b):
-                return super(C1, cls).__new__(cls)
-            def __getnewargs__(self):
-                return (self.a, self.b)
-            def __init__(self, a, b):
-                self.a = a
-                self.b = b
-            def __repr__(self):
-                return "C1(%r, %r)<%r>" % (self.a, self.b, list(self))
-
-        global C2
-        class C2(int):
-            def __new__(cls, a, b, val=0):
-                return super(C2, cls).__new__(cls, val)
-            def __getnewargs__(self):
-                return (self.a, self.b, int(self))
-            def __init__(self, a, b, val=0):
-                self.a = a
-                self.b = b
-            def __repr__(self):
-                return "C2(%r, %r)<%r>" % (self.a, self.b, int(self))
-
-        global C3
-        class C3(object):
-            def __init__(self, foo):
-                self.foo = foo
-            def __getstate__(self):
-                return self.foo
-            def __setstate__(self, foo):
-                self.foo = foo
-
-        global C4classic, C4
-        class C4classic: # classic
-            pass
-        class C4(C4classic, object): # mixed inheritance
-            pass
-
-        for bin in 0, 1:
-            for cls in C, C1, C2:
-                s = pickle.dumps(cls, bin)
-                cls2 = pickle.loads(s)
-                self.assertIs(cls2, cls)
-
-            a = C1(1, 2); a.append(42); a.append(24)
-            b = C2("hello", "world", 42)
-            s = pickle.dumps((a, b), bin)
-            x, y = pickle.loads(s)
-            self.assertEqual(x.__class__, a.__class__)
-            self.assertEqual(sorteditems(x.__dict__), sorteditems(a.__dict__))
-            self.assertEqual(y.__class__, b.__class__)
-            self.assertEqual(sorteditems(y.__dict__), sorteditems(b.__dict__))
-            self.assertEqual(repr(x), repr(a))
-            self.assertEqual(repr(y), repr(b))
-            # Test for __getstate__ and __setstate__ on new style class
-            u = C3(42)
-            s = pickle.dumps(u, bin)
-            v = pickle.loads(s)
-            self.assertEqual(u.__class__, v.__class__)
-            self.assertEqual(u.foo, v.foo)
-            # Test for picklability of hybrid class
-            u = C4()
-            u.foo = 42
-            s = pickle.dumps(u, bin)
-            v = pickle.loads(s)
-            self.assertEqual(u.__class__, v.__class__)
-            self.assertEqual(u.foo, v.foo)
-
-        # Testing copy.deepcopy()
-        import copy
-        for cls in C, C1, C2:
-            cls2 = copy.deepcopy(cls)
-            self.assertIs(cls2, cls)
-
-        a = C1(1, 2); a.append(42); a.append(24)
-        b = C2("hello", "world", 42)
-        x, y = copy.deepcopy((a, b))
-        self.assertEqual(x.__class__, a.__class__)
-        self.assertEqual(sorteditems(x.__dict__), sorteditems(a.__dict__))
-        self.assertEqual(y.__class__, b.__class__)
-        self.assertEqual(sorteditems(y.__dict__), sorteditems(b.__dict__))
-        self.assertEqual(repr(x), repr(a))
-        self.assertEqual(repr(y), repr(b))
-
-    def test_pickle_slots(self):
-        # Testing pickling of classes with __slots__ ...
-        import pickle
-        # Pickling of classes with __slots__ but without __getstate__ should fail
-        # (if using protocol 0 or 1)
-        global B, C, D, E
-        class B(object):
-            pass
-        for base in [object, B]:
-            class C(base):
-                __slots__ = ['a']
-            class D(C):
-                pass
-            try:
-                pickle.dumps(C(), 0)
-            except TypeError:
-                pass
-            else:
-                self.fail("should fail: pickle C instance - %s" % base)
-            try:
-                pickle.dumps(C(), 0)
-            except TypeError:
-                pass
-            else:
-                self.fail("should fail: pickle D instance - %s" % base)
-            # Give C a nice generic __getstate__ and __setstate__
-            class C(base):
-                __slots__ = ['a']
-                def __getstate__(self):
-                    try:
-                        d = self.__dict__.copy()
-                    except AttributeError:
-                        d = {}
-                    for cls in self.__class__.__mro__:
-                        for sn in cls.__dict__.get('__slots__', ()):
-                            try:
-                                d[sn] = getattr(self, sn)
-                            except AttributeError:
-                                pass
-                    return d
-                def __setstate__(self, d):
-                    for k, v in list(d.items()):
-                        setattr(self, k, v)
-            class D(C):
-                pass
-            # Now it should work
-            x = C()
-            y = pickle.loads(pickle.dumps(x))
-            self.assertNotHasAttr(y, 'a')
-            x.a = 42
-            y = pickle.loads(pickle.dumps(x))
-            self.assertEqual(y.a, 42)
-            x = D()
-            x.a = 42
-            x.b = 100
-            y = pickle.loads(pickle.dumps(x))
-            self.assertEqual(y.a + y.b, 142)
-            # A subclass that adds a slot should also work
-            class E(C):
-                __slots__ = ['b']
-            x = E()
-            x.a = 42
-            x.b = "foo"
-            y = pickle.loads(pickle.dumps(x))
-            self.assertEqual(y.a, x.a)
-            self.assertEqual(y.b, x.b)
-
     def test_binary_operator_override(self):
         # Testing overrides of binary operations...
         class I(int):
@@ -3745,18 +3581,8 @@
         # bug).
         del c
 
-        # If that didn't blow up, it's also interesting to see whether clearing
-        # the last container slot works: that will attempt to delete c again,
-        # which will cause c to get appended back to the container again
-        # "during" the del.  (On non-CPython implementations, however, __del__
-        # is typically not called again.)
         support.gc_collect()
         self.assertEqual(len(C.container), 1)
-        del C.container[-1]
-        if support.check_impl_detail():
-            support.gc_collect()
-            self.assertEqual(len(C.container), 1)
-            self.assertEqual(C.container[-1].attr, 42)
 
         # Make c mortal again, so that the test framework with -l doesn't report
         # it as a leak.
@@ -4536,6 +4362,13 @@
         self.assertRaises(TypeError, type.__dict__['__qualname__'].__set__,
                           str, 'Oink')
 
+        global Y
+        class Y:
+            class Inside:
+                pass
+        self.assertEqual(Y.__qualname__, 'Y')
+        self.assertEqual(Y.Inside.__qualname__, 'Y.Inside')
+
     def test_qualname_dict(self):
         ns = {'__qualname__': 'some.name'}
         tp = type('Foo', (), ns)
@@ -4581,6 +4414,14 @@
             self.assertRaises(TypeError, case, 1, 2, 3)
             self.assertRaises(TypeError, case, 1, 2, foo=3)
 
+    def test_subclassing_does_not_duplicate_dict_descriptors(self):
+        class Base:
+            pass
+        class Sub(Base):
+            pass
+        self.assertIn("__dict__", Base.__dict__)
+        self.assertNotIn("__dict__", Sub.__dict__)
+
 
 class DictProxyTests(unittest.TestCase):
     def setUp(self):
@@ -4691,11 +4532,475 @@
         self.assertEqual(X.mykey2, 'from Base2')
 
 
+class PicklingTests(unittest.TestCase):
+
+    def _check_reduce(self, proto, obj, args=(), kwargs={}, state=None,
+                      listitems=None, dictitems=None):
+        if proto >= 4:
+            reduce_value = obj.__reduce_ex__(proto)
+            self.assertEqual(reduce_value[:3],
+                             (copyreg.__newobj_ex__,
+                              (type(obj), args, kwargs),
+                              state))
+            if listitems is not None:
+                self.assertListEqual(list(reduce_value[3]), listitems)
+            else:
+                self.assertIsNone(reduce_value[3])
+            if dictitems is not None:
+                self.assertDictEqual(dict(reduce_value[4]), dictitems)
+            else:
+                self.assertIsNone(reduce_value[4])
+        elif proto >= 2:
+            reduce_value = obj.__reduce_ex__(proto)
+            self.assertEqual(reduce_value[:3],
+                             (copyreg.__newobj__,
+                              (type(obj),) + args,
+                              state))
+            if listitems is not None:
+                self.assertListEqual(list(reduce_value[3]), listitems)
+            else:
+                self.assertIsNone(reduce_value[3])
+            if dictitems is not None:
+                self.assertDictEqual(dict(reduce_value[4]), dictitems)
+            else:
+                self.assertIsNone(reduce_value[4])
+        else:
+            base_type = type(obj).__base__
+            reduce_value = (copyreg._reconstructor,
+                            (type(obj),
+                             base_type,
+                             None if base_type is object else base_type(obj)))
+            if state is not None:
+                reduce_value += (state,)
+            self.assertEqual(obj.__reduce_ex__(proto), reduce_value)
+            self.assertEqual(obj.__reduce__(), reduce_value)
+
+    def test_reduce(self):
+        protocols = range(pickle.HIGHEST_PROTOCOL + 1)
+        args = (-101, "spam")
+        kwargs = {'bacon': -201, 'fish': -301}
+        state = {'cheese': -401}
+
+        class C1:
+            def __getnewargs__(self):
+                return args
+        obj = C1()
+        for proto in protocols:
+            self._check_reduce(proto, obj, args)
+
+        for name, value in state.items():
+            setattr(obj, name, value)
+        for proto in protocols:
+            self._check_reduce(proto, obj, args, state=state)
+
+        class C2:
+            def __getnewargs__(self):
+                return "bad args"
+        obj = C2()
+        for proto in protocols:
+            if proto >= 2:
+                with self.assertRaises(TypeError):
+                    obj.__reduce_ex__(proto)
+
+        class C3:
+            def __getnewargs_ex__(self):
+                return (args, kwargs)
+        obj = C3()
+        for proto in protocols:
+            if proto >= 4:
+                self._check_reduce(proto, obj, args, kwargs)
+            elif proto >= 2:
+                with self.assertRaises(ValueError):
+                    obj.__reduce_ex__(proto)
+
+        class C4:
+            def __getnewargs_ex__(self):
+                return (args, "bad dict")
+        class C5:
+            def __getnewargs_ex__(self):
+                return ("bad tuple", kwargs)
+        class C6:
+            def __getnewargs_ex__(self):
+                return ()
+        class C7:
+            def __getnewargs_ex__(self):
+                return "bad args"
+        for proto in protocols:
+            for cls in C4, C5, C6, C7:
+                obj = cls()
+                if proto >= 2:
+                    with self.assertRaises((TypeError, ValueError)):
+                        obj.__reduce_ex__(proto)
+
+        class C8:
+            def __getnewargs_ex__(self):
+                return (args, kwargs)
+        obj = C8()
+        for proto in protocols:
+            if 2 <= proto < 4:
+                with self.assertRaises(ValueError):
+                    obj.__reduce_ex__(proto)
+        class C9:
+            def __getnewargs_ex__(self):
+                return (args, {})
+        obj = C9()
+        for proto in protocols:
+            self._check_reduce(proto, obj, args)
+
+        class C10:
+            def __getnewargs_ex__(self):
+                raise IndexError
+        obj = C10()
+        for proto in protocols:
+            if proto >= 2:
+                with self.assertRaises(IndexError):
+                    obj.__reduce_ex__(proto)
+
+        class C11:
+            def __getstate__(self):
+                return state
+        obj = C11()
+        for proto in protocols:
+            self._check_reduce(proto, obj, state=state)
+
+        class C12:
+            def __getstate__(self):
+                return "not dict"
+        obj = C12()
+        for proto in protocols:
+            self._check_reduce(proto, obj, state="not dict")
+
+        class C13:
+            def __getstate__(self):
+                raise IndexError
+        obj = C13()
+        for proto in protocols:
+            with self.assertRaises(IndexError):
+                obj.__reduce_ex__(proto)
+            if proto < 2:
+                with self.assertRaises(IndexError):
+                    obj.__reduce__()
+
+        class C14:
+            __slots__ = tuple(state)
+            def __init__(self):
+                for name, value in state.items():
+                    setattr(self, name, value)
+
+        obj = C14()
+        for proto in protocols:
+            if proto >= 2:
+                self._check_reduce(proto, obj, state=(None, state))
+            else:
+                with self.assertRaises(TypeError):
+                    obj.__reduce_ex__(proto)
+                with self.assertRaises(TypeError):
+                    obj.__reduce__()
+
+        class C15(dict):
+            pass
+        obj = C15({"quebec": -601})
+        for proto in protocols:
+            self._check_reduce(proto, obj, dictitems=dict(obj))
+
+        class C16(list):
+            pass
+        obj = C16(["yukon"])
+        for proto in protocols:
+            self._check_reduce(proto, obj, listitems=list(obj))
+
+    def test_special_method_lookup(self):
+        protocols = range(pickle.HIGHEST_PROTOCOL + 1)
+        class Picky:
+            def __getstate__(self):
+                return {}
+
+            def __getattr__(self, attr):
+                if attr in ("__getnewargs__", "__getnewargs_ex__"):
+                    raise AssertionError(attr)
+                return None
+        for protocol in protocols:
+            state = {} if protocol >= 2 else None
+            self._check_reduce(protocol, Picky(), state=state)
+
+    def _assert_is_copy(self, obj, objcopy, msg=None):
+        """Utility method to verify if two objects are copies of each others.
+        """
+        if msg is None:
+            msg = "{!r} is not a copy of {!r}".format(obj, objcopy)
+        if type(obj).__repr__ is object.__repr__:
+            # We have this limitation for now because we use the object's repr
+            # to help us verify that the two objects are copies. This allows
+            # us to delegate the non-generic verification logic to the objects
+            # themselves.
+            raise ValueError("object passed to _assert_is_copy must " +
+                             "override the __repr__ method.")
+        self.assertIsNot(obj, objcopy, msg=msg)
+        self.assertIs(type(obj), type(objcopy), msg=msg)
+        if hasattr(obj, '__dict__'):
+            self.assertDictEqual(obj.__dict__, objcopy.__dict__, msg=msg)
+            self.assertIsNot(obj.__dict__, objcopy.__dict__, msg=msg)
+        if hasattr(obj, '__slots__'):
+            self.assertListEqual(obj.__slots__, objcopy.__slots__, msg=msg)
+            for slot in obj.__slots__:
+                self.assertEqual(
+                    hasattr(obj, slot), hasattr(objcopy, slot), msg=msg)
+                self.assertEqual(getattr(obj, slot, None),
+                                 getattr(objcopy, slot, None), msg=msg)
+        self.assertEqual(repr(obj), repr(objcopy), msg=msg)
+
+    @staticmethod
+    def _generate_pickle_copiers():
+        """Utility method to generate the many possible pickle configurations.
+        """
+        class PickleCopier:
+            "This class copies object using pickle."
+            def __init__(self, proto, dumps, loads):
+                self.proto = proto
+                self.dumps = dumps
+                self.loads = loads
+            def copy(self, obj):
+                return self.loads(self.dumps(obj, self.proto))
+            def __repr__(self):
+                # We try to be as descriptive as possible here since this is
+                # the string which we will allow us to tell the pickle
+                # configuration we are using during debugging.
+                return ("PickleCopier(proto={}, dumps={}.{}, loads={}.{})"
+                        .format(self.proto,
+                                self.dumps.__module__, self.dumps.__qualname__,
+                                self.loads.__module__, self.loads.__qualname__))
+        return (PickleCopier(*args) for args in
+                   itertools.product(range(pickle.HIGHEST_PROTOCOL + 1),
+                                     {pickle.dumps, pickle._dumps},
+                                     {pickle.loads, pickle._loads}))
+
+    def test_pickle_slots(self):
+        # Tests pickling of classes with __slots__.
+
+        # Pickling of classes with __slots__ but without __getstate__ should
+        # fail (if using protocol 0 or 1)
+        global C
+        class C:
+            __slots__ = ['a']
+        with self.assertRaises(TypeError):
+            pickle.dumps(C(), 0)
+
+        global D
+        class D(C):
+            pass
+        with self.assertRaises(TypeError):
+            pickle.dumps(D(), 0)
+
+        class C:
+            "A class with __getstate__ and __setstate__ implemented."
+            __slots__ = ['a']
+            def __getstate__(self):
+                state = getattr(self, '__dict__', {}).copy()
+                for cls in type(self).__mro__:
+                    for slot in cls.__dict__.get('__slots__', ()):
+                        try:
+                            state[slot] = getattr(self, slot)
+                        except AttributeError:
+                            pass
+                return state
+            def __setstate__(self, state):
+                for k, v in state.items():
+                    setattr(self, k, v)
+            def __repr__(self):
+                return "%s()<%r>" % (type(self).__name__, self.__getstate__())
+
+        class D(C):
+            "A subclass of a class with slots."
+            pass
+
+        global E
+        class E(C):
+            "A subclass with an extra slot."
+            __slots__ = ['b']
+
+        # Now it should work
+        for pickle_copier in self._generate_pickle_copiers():
+            with self.subTest(pickle_copier=pickle_copier):
+                x = C()
+                y = pickle_copier.copy(x)
+                self._assert_is_copy(x, y)
+
+                x.a = 42
+                y = pickle_copier.copy(x)
+                self._assert_is_copy(x, y)
+
+                x = D()
+                x.a = 42
+                x.b = 100
+                y = pickle_copier.copy(x)
+                self._assert_is_copy(x, y)
+
+                x = E()
+                x.a = 42
+                x.b = "foo"
+                y = pickle_copier.copy(x)
+                self._assert_is_copy(x, y)
+
+    def test_reduce_copying(self):
+        # Tests pickling and copying new-style classes and objects.
+        global C1
+        class C1:
+            "The state of this class is copyable via its instance dict."
+            ARGS = (1, 2)
+            NEED_DICT_COPYING = True
+            def __init__(self, a, b):
+                super().__init__()
+                self.a = a
+                self.b = b
+            def __repr__(self):
+                return "C1(%r, %r)" % (self.a, self.b)
+
+        global C2
+        class C2(list):
+            "A list subclass copyable via __getnewargs__."
+            ARGS = (1, 2)
+            NEED_DICT_COPYING = False
+            def __new__(cls, a, b):
+                self = super().__new__(cls)
+                self.a = a
+                self.b = b
+                return self
+            def __init__(self, *args):
+                super().__init__()
+                # This helps testing that __init__ is not called during the
+                # unpickling process, which would cause extra appends.
+                self.append("cheese")
+            @classmethod
+            def __getnewargs__(cls):
+                return cls.ARGS
+            def __repr__(self):
+                return "C2(%r, %r)<%r>" % (self.a, self.b, list(self))
+
+        global C3
+        class C3(list):
+            "A list subclass copyable via __getstate__."
+            ARGS = (1, 2)
+            NEED_DICT_COPYING = False
+            def __init__(self, a, b):
+                self.a = a
+                self.b = b
+                # This helps testing that __init__ is not called during the
+                # unpickling process, which would cause extra appends.
+                self.append("cheese")
+            @classmethod
+            def __getstate__(cls):
+                return cls.ARGS
+            def __setstate__(self, state):
+                a, b = state
+                self.a = a
+                self.b = b
+            def __repr__(self):
+                return "C3(%r, %r)<%r>" % (self.a, self.b, list(self))
+
+        global C4
+        class C4(int):
+            "An int subclass copyable via __getnewargs__."
+            ARGS = ("hello", "world", 1)
+            NEED_DICT_COPYING = False
+            def __new__(cls, a, b, value):
+                self = super().__new__(cls, value)
+                self.a = a
+                self.b = b
+                return self
+            @classmethod
+            def __getnewargs__(cls):
+                return cls.ARGS
+            def __repr__(self):
+                return "C4(%r, %r)<%r>" % (self.a, self.b, int(self))
+
+        global C5
+        class C5(int):
+            "An int subclass copyable via __getnewargs_ex__."
+            ARGS = (1, 2)
+            KWARGS = {'value': 3}
+            NEED_DICT_COPYING = False
+            def __new__(cls, a, b, *, value=0):
+                self = super().__new__(cls, value)
+                self.a = a
+                self.b = b
+                return self
+            @classmethod
+            def __getnewargs_ex__(cls):
+                return (cls.ARGS, cls.KWARGS)
+            def __repr__(self):
+                return "C5(%r, %r)<%r>" % (self.a, self.b, int(self))
+
+        test_classes = (C1, C2, C3, C4, C5)
+        # Testing copying through pickle
+        pickle_copiers = self._generate_pickle_copiers()
+        for cls, pickle_copier in itertools.product(test_classes, pickle_copiers):
+            with self.subTest(cls=cls, pickle_copier=pickle_copier):
+                kwargs = getattr(cls, 'KWARGS', {})
+                obj = cls(*cls.ARGS, **kwargs)
+                proto = pickle_copier.proto
+                if 2 <= proto < 4 and hasattr(cls, '__getnewargs_ex__'):
+                    with self.assertRaises(ValueError):
+                        pickle_copier.dumps(obj, proto)
+                    continue
+                objcopy = pickle_copier.copy(obj)
+                self._assert_is_copy(obj, objcopy)
+                # For test classes that supports this, make sure we didn't go
+                # around the reduce protocol by simply copying the attribute
+                # dictionary. We clear attributes using the previous copy to
+                # not mutate the original argument.
+                if proto >= 2 and not cls.NEED_DICT_COPYING:
+                    objcopy.__dict__.clear()
+                    objcopy2 = pickle_copier.copy(objcopy)
+                    self._assert_is_copy(obj, objcopy2)
+
+        # Testing copying through copy.deepcopy()
+        for cls in test_classes:
+            with self.subTest(cls=cls):
+                kwargs = getattr(cls, 'KWARGS', {})
+                obj = cls(*cls.ARGS, **kwargs)
+                # XXX: We need to modify the copy module to support PEP 3154's
+                # reduce protocol 4.
+                if hasattr(cls, '__getnewargs_ex__'):
+                    continue
+                objcopy = deepcopy(obj)
+                self._assert_is_copy(obj, objcopy)
+                # For test classes that supports this, make sure we didn't go
+                # around the reduce protocol by simply copying the attribute
+                # dictionary. We clear attributes using the previous copy to
+                # not mutate the original argument.
+                if not cls.NEED_DICT_COPYING:
+                    objcopy.__dict__.clear()
+                    objcopy2 = deepcopy(objcopy)
+                    self._assert_is_copy(obj, objcopy2)
+
+
+class SharedKeyTests(unittest.TestCase):
+
+    @support.cpython_only
+    def test_subclasses(self):
+        # Verify that subclasses can share keys (per PEP 412)
+        class A:
+            pass
+        class B(A):
+            pass
+
+        a, b = A(), B()
+        self.assertEqual(sys.getsizeof(vars(a)), sys.getsizeof(vars(b)))
+        self.assertLess(sys.getsizeof(vars(a)), sys.getsizeof({}))
+        a.x, a.y, a.z, a.w = range(4)
+        self.assertNotEqual(sys.getsizeof(vars(a)), sys.getsizeof(vars(b)))
+        a2 = A()
+        self.assertEqual(sys.getsizeof(vars(a)), sys.getsizeof(vars(a2)))
+        self.assertLess(sys.getsizeof(vars(a)), sys.getsizeof({}))
+        b.u, b.v, b.w, b.t = range(4)
+        self.assertLess(sys.getsizeof(vars(b)), sys.getsizeof({}))
+
+
 def test_main():
     # Run all local test cases, with PTypesLongInitTest first.
     support.run_unittest(PTypesLongInitTest, OperatorsTest,
                          ClassPropertiesAndMethods, DictProxyTests,
-                         MiscTests)
+                         MiscTests, PicklingTests, SharedKeyTests)
 
 if __name__ == "__main__":
     test_main()
diff --git a/Lib/test/test_devpoll.py b/Lib/test/test_devpoll.py
index 9129ac0..955618a 100644
--- a/Lib/test/test_devpoll.py
+++ b/Lib/test/test_devpoll.py
@@ -2,13 +2,15 @@
 
 # Initial tests are copied as is from "test_poll.py"
 
-import os, select, random, unittest, sys
+import os
+import random
+import select
+import sys
+import unittest
 from test.support import TESTFN, run_unittest, cpython_only
 
-try:
-    select.devpoll
-except AttributeError:
-    raise unittest.SkipTest("select.devpoll not defined -- skipping test_devpoll")
+if not hasattr(select, 'devpoll') :
+    raise unittest.SkipTest('test works only on Solaris OS family')
 
 
 def find_ready_matching(ready, flag):
@@ -87,6 +89,35 @@
         self.assertRaises(OverflowError, pollster.poll, 1 << 63)
         self.assertRaises(OverflowError, pollster.poll, 1 << 64)
 
+    def test_close(self):
+        open_file = open(__file__, "rb")
+        self.addCleanup(open_file.close)
+        fd = open_file.fileno()
+        devpoll = select.devpoll()
+
+        # test fileno() method and closed attribute
+        self.assertIsInstance(devpoll.fileno(), int)
+        self.assertFalse(devpoll.closed)
+
+        # test close()
+        devpoll.close()
+        self.assertTrue(devpoll.closed)
+        self.assertRaises(ValueError, devpoll.fileno)
+
+        # close() can be called more than once
+        devpoll.close()
+
+        # operations must fail with ValueError("I/O operation on closed ...")
+        self.assertRaises(ValueError, devpoll.modify, fd, select.POLLIN)
+        self.assertRaises(ValueError, devpoll.poll)
+        self.assertRaises(ValueError, devpoll.register, fd, fd, select.POLLIN)
+        self.assertRaises(ValueError, devpoll.unregister, fd)
+
+    def test_fd_non_inheritable(self):
+        devpoll = select.devpoll()
+        self.addCleanup(devpoll.close)
+        self.assertEqual(os.get_inheritable(devpoll.fileno()), False)
+
     def test_events_mask_overflow(self):
         pollster = select.devpoll()
         w, r = os.pipe()
diff --git a/Lib/test/test_dict.py b/Lib/test/test_dict.py
index a388959..c96d000 100644
--- a/Lib/test/test_dict.py
+++ b/Lib/test/test_dict.py
@@ -837,57 +837,60 @@
         self._tracked(MyDict())
 
     def test_iterator_pickling(self):
-        data = {1:"a", 2:"b", 3:"c"}
-        it = iter(data)
-        d = pickle.dumps(it)
-        it = pickle.loads(d)
-        self.assertEqual(sorted(it), sorted(data))
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            data = {1:"a", 2:"b", 3:"c"}
+            it = iter(data)
+            d = pickle.dumps(it, proto)
+            it = pickle.loads(d)
+            self.assertEqual(sorted(it), sorted(data))
 
-        it = pickle.loads(d)
-        try:
-            drop = next(it)
-        except StopIteration:
-            return
-        d = pickle.dumps(it)
-        it = pickle.loads(d)
-        del data[drop]
-        self.assertEqual(sorted(it), sorted(data))
+            it = pickle.loads(d)
+            try:
+                drop = next(it)
+            except StopIteration:
+                continue
+            d = pickle.dumps(it, proto)
+            it = pickle.loads(d)
+            del data[drop]
+            self.assertEqual(sorted(it), sorted(data))
 
     def test_itemiterator_pickling(self):
-        data = {1:"a", 2:"b", 3:"c"}
-        # dictviews aren't picklable, only their iterators
-        itorg = iter(data.items())
-        d = pickle.dumps(itorg)
-        it = pickle.loads(d)
-        # note that the type of type of the unpickled iterator
-        # is not necessarily the same as the original.  It is
-        # merely an object supporting the iterator protocol, yielding
-        # the same objects as the original one.
-        # self.assertEqual(type(itorg), type(it))
-        self.assertTrue(isinstance(it, collections.abc.Iterator))
-        self.assertEqual(dict(it), data)
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            data = {1:"a", 2:"b", 3:"c"}
+            # dictviews aren't picklable, only their iterators
+            itorg = iter(data.items())
+            d = pickle.dumps(itorg, proto)
+            it = pickle.loads(d)
+            # note that the type of type of the unpickled iterator
+            # is not necessarily the same as the original.  It is
+            # merely an object supporting the iterator protocol, yielding
+            # the same objects as the original one.
+            # self.assertEqual(type(itorg), type(it))
+            self.assertIsInstance(it, collections.abc.Iterator)
+            self.assertEqual(dict(it), data)
 
-        it = pickle.loads(d)
-        drop = next(it)
-        d = pickle.dumps(it)
-        it = pickle.loads(d)
-        del data[drop[0]]
-        self.assertEqual(dict(it), data)
+            it = pickle.loads(d)
+            drop = next(it)
+            d = pickle.dumps(it, proto)
+            it = pickle.loads(d)
+            del data[drop[0]]
+            self.assertEqual(dict(it), data)
 
     def test_valuesiterator_pickling(self):
-        data = {1:"a", 2:"b", 3:"c"}
-        # data.values() isn't picklable, only its iterator
-        it = iter(data.values())
-        d = pickle.dumps(it)
-        it = pickle.loads(d)
-        self.assertEqual(sorted(list(it)), sorted(list(data.values())))
+        for proto in range(pickle.HIGHEST_PROTOCOL):
+            data = {1:"a", 2:"b", 3:"c"}
+            # data.values() isn't picklable, only its iterator
+            it = iter(data.values())
+            d = pickle.dumps(it, proto)
+            it = pickle.loads(d)
+            self.assertEqual(sorted(list(it)), sorted(list(data.values())))
 
-        it = pickle.loads(d)
-        drop = next(it)
-        d = pickle.dumps(it)
-        it = pickle.loads(d)
-        values = list(it) + [drop]
-        self.assertEqual(sorted(values), sorted(list(data.values())))
+            it = pickle.loads(d)
+            drop = next(it)
+            d = pickle.dumps(it, proto)
+            it = pickle.loads(d)
+            values = list(it) + [drop]
+            self.assertEqual(sorted(values), sorted(list(data.values())))
 
     def test_instance_dict_getattr_str_subclass(self):
         class Foo:
@@ -906,6 +909,35 @@
         f.a = 'a'
         self.assertEqual(f.__dict__, {1:1, 'a':'a'})
 
+    def check_reentrant_insertion(self, mutate):
+        # This object will trigger mutation of the dict when replaced
+        # by another value.  Note this relies on refcounting: the test
+        # won't achieve its purpose on fully-GCed Python implementations.
+        class Mutating:
+            def __del__(self):
+                mutate(d)
+
+        d = {k: Mutating() for k in 'abcdefghijklmnopqr'}
+        for k in list(d):
+            d[k] = k
+
+    def test_reentrant_insertion(self):
+        # Reentrant insertion shouldn't crash (see issue #22653)
+        def mutate(d):
+            d['b'] = 5
+        self.check_reentrant_insertion(mutate)
+
+        def mutate(d):
+            d.update(self.__dict__)
+            d.clear()
+        self.check_reentrant_insertion(mutate)
+
+        def mutate(d):
+            while d:
+                d.popitem()
+        self.check_reentrant_insertion(mutate)
+
+
 from test import mapping_tests
 
 class GeneralMappingTests(mapping_tests.BasicTestMappingProtocol):
diff --git a/Lib/test/test_difflib.py b/Lib/test/test_difflib.py
index 325449a..0ba8f0e 100644
--- a/Lib/test/test_difflib.py
+++ b/Lib/test/test_difflib.py
@@ -76,6 +76,15 @@
         diff_gen = difflib.unified_diff([], [])
         self.assertRaises(StopIteration, next, diff_gen)
 
+    def test_matching_blocks_cache(self):
+        # Issue #21635
+        s = difflib.SequenceMatcher(None, "abxcd", "abcd")
+        first = s.get_matching_blocks()
+        second = s.get_matching_blocks()
+        self.assertEqual(second[0].size, 2)
+        self.assertEqual(second[1].size, 2)
+        self.assertEqual(second[2].size, 0)
+
     def test_added_tab_hint(self):
         # Check fix for bug #1488943
         diff = list(difflib.Differ().compare(["\tI am a buggy"],["\t\tI am a bug"]))
diff --git a/Lib/test/test_dis.py b/Lib/test/test_dis.py
index b86cc86..b8daff7 100644
--- a/Lib/test/test_dis.py
+++ b/Lib/test/test_dis.py
@@ -1,12 +1,30 @@
 # Minimal tests for dis module
 
 from test.support import run_unittest, captured_stdout
+from test.bytecode_helper import BytecodeTestCase
 import difflib
 import unittest
 import sys
 import dis
 import io
 import re
+import types
+import contextlib
+
+def get_tb():
+    def _error():
+        try:
+            1 / 0
+        except Exception as e:
+            tb = e.__traceback__
+        return tb
+
+    tb = _error()
+    while tb.tb_next:
+        tb = tb.tb_next
+    return tb
+
+TRACEBACK_CODE = get_tb().tb_frame.f_code
 
 class _C:
     def __init__(self, x):
@@ -23,12 +41,12 @@
 """ % (_C.__init__.__code__.co_firstlineno + 1,)
 
 dis_c_instance_method_bytes = """\
-          0 LOAD_FAST           1 (1)
-          3 LOAD_CONST          1 (1)
-          6 COMPARE_OP          2 (==)
-          9 LOAD_FAST           0 (0)
-         12 STORE_ATTR          0 (0)
-         15 LOAD_CONST          0 (0)
+          0 LOAD_FAST                1 (1)
+          3 LOAD_CONST               1 (1)
+          6 COMPARE_OP               2 (==)
+          9 LOAD_FAST                0 (0)
+         12 STORE_ATTR               0 (0)
+         15 LOAD_CONST               0 (0)
          18 RETURN_VALUE
 """
 
@@ -49,11 +67,11 @@
 
 
 dis_f_co_code = """\
-          0 LOAD_GLOBAL         0 (0)
-          3 LOAD_FAST           0 (0)
-          6 CALL_FUNCTION       1 (1 positional, 0 keyword pair)
+          0 LOAD_GLOBAL              0 (0)
+          3 LOAD_FAST                0 (0)
+          6 CALL_FUNCTION            1 (1 positional, 0 keyword pair)
           9 POP_TOP
-         10 LOAD_CONST          1 (1)
+         10 LOAD_CONST               1 (1)
          13 RETURN_VALUE
 """
 
@@ -89,7 +107,7 @@
     pass
 
 dis_bug1333982 = """\
- %-4d         0 LOAD_CONST               1 (0)
+%3d           0 LOAD_CONST               1 (0)
               3 POP_JUMP_IF_TRUE        35
               6 LOAD_GLOBAL              0 (AssertionError)
               9 LOAD_CONST               2 (<code object <listcomp> at 0x..., file "%s", line %d>)
@@ -99,12 +117,12 @@
              21 GET_ITER
              22 CALL_FUNCTION            1 (1 positional, 0 keyword pair)
 
- %-4d        25 LOAD_CONST               4 (1)
+%3d          25 LOAD_CONST               4 (1)
              28 BINARY_ADD
              29 CALL_FUNCTION            1 (1 positional, 0 keyword pair)
              32 RAISE_VARARGS            1
 
- %-4d   >>   35 LOAD_CONST               0 (None)
+%3d     >>   35 LOAD_CONST               0 (None)
              38 RETURN_VALUE
 """ % (bug1333982.__code__.co_firstlineno + 1,
        __file__,
@@ -160,49 +178,81 @@
   1           0 LOAD_CONST               0 (0)
               3 STORE_NAME               0 (x)
 
-  2           6 SETUP_LOOP              13 (to 22)
+  2           6 SETUP_LOOP              14 (to 23)
 
   3     >>    9 LOAD_NAME                0 (x)
              12 LOAD_CONST               1 (1)
              15 INPLACE_ADD
              16 STORE_NAME               0 (x)
              19 JUMP_ABSOLUTE            9
-        >>   22 LOAD_CONST               2 (None)
-             25 RETURN_VALUE
+             22 POP_BLOCK
+        >>   23 LOAD_CONST               2 (None)
+             26 RETURN_VALUE
 """
 
+dis_traceback = """\
+ %-4d         0 SETUP_EXCEPT            12 (to 15)
+
+ %-4d         3 LOAD_CONST               1 (1)
+              6 LOAD_CONST               2 (0)
+    -->       9 BINARY_TRUE_DIVIDE
+             10 POP_TOP
+             11 POP_BLOCK
+             12 JUMP_FORWARD            46 (to 61)
+
+ %-4d   >>   15 DUP_TOP
+             16 LOAD_GLOBAL              0 (Exception)
+             19 COMPARE_OP              10 (exception match)
+             22 POP_JUMP_IF_FALSE       60
+             25 POP_TOP
+             26 STORE_FAST               0 (e)
+             29 POP_TOP
+             30 SETUP_FINALLY           14 (to 47)
+
+ %-4d        33 LOAD_FAST                0 (e)
+             36 LOAD_ATTR                1 (__traceback__)
+             39 STORE_FAST               1 (tb)
+             42 POP_BLOCK
+             43 POP_EXCEPT
+             44 LOAD_CONST               0 (None)
+        >>   47 LOAD_CONST               0 (None)
+             50 STORE_FAST               0 (e)
+             53 DELETE_FAST              0 (e)
+             56 END_FINALLY
+             57 JUMP_FORWARD             1 (to 61)
+        >>   60 END_FINALLY
+
+ %-4d   >>   61 LOAD_FAST                1 (tb)
+             64 RETURN_VALUE
+""" % (TRACEBACK_CODE.co_firstlineno + 1,
+       TRACEBACK_CODE.co_firstlineno + 2,
+       TRACEBACK_CODE.co_firstlineno + 3,
+       TRACEBACK_CODE.co_firstlineno + 4,
+       TRACEBACK_CODE.co_firstlineno + 5)
+
 class DisTests(unittest.TestCase):
 
     def get_disassembly(self, func, lasti=-1, wrapper=True):
-        s = io.StringIO()
-        save_stdout = sys.stdout
-        sys.stdout = s
-        try:
+        # We want to test the default printing behaviour, not the file arg
+        output = io.StringIO()
+        with contextlib.redirect_stdout(output):
             if wrapper:
                 dis.dis(func)
             else:
                 dis.disassemble(func, lasti)
-        finally:
-            sys.stdout = save_stdout
-        # Trim trailing blanks (if any).
-        return [line.rstrip() for line in s.getvalue().splitlines()]
+        return output.getvalue()
 
     def get_disassemble_as_string(self, func, lasti=-1):
-        return '\n'.join(self.get_disassembly(func, lasti, False))
+        return self.get_disassembly(func, lasti, False)
+
+    def strip_addresses(self, text):
+        return re.sub(r'\b0x[0-9A-Fa-f]+\b', '0x...', text)
 
     def do_disassembly_test(self, func, expected):
-        lines = self.get_disassembly(func)
-        expected = expected.splitlines()
-        if expected == lines:
-            return
-        else:
-            lines = [re.sub('0x[0-9A-Fa-f]+', '0x...', l) for l in lines]
-            if expected == lines:
-                return
-        self.fail(
-                "events did not match expectation:\n" +
-                "\n".join(difflib.ndiff(expected,
-                                        lines)))
+        got = self.get_disassembly(func)
+        if got != expected:
+            got = self.strip_addresses(got)
+        self.assertEqual(got, expected)
 
     def test_opmap(self):
         self.assertEqual(dis.opmap["NOP"], 9)
@@ -290,35 +340,35 @@
     def test_dis_object(self):
         self.assertRaises(TypeError, dis.dis, object())
 
+class DisWithFileTests(DisTests):
+
+    # Run the tests again, using the file arg instead of print
+    def get_disassembly(self, func, lasti=-1, wrapper=True):
+        output = io.StringIO()
+        if wrapper:
+            dis.dis(func, file=output)
+        else:
+            dis.disassemble(func, lasti, file=output)
+        return output.getvalue()
+
+
+
 code_info_code_info = """\
 Name:              code_info
 Filename:          (.*)
 Argument count:    1
 Kw-only arguments: 0
 Number of locals:  1
-Stack size:        4
+Stack size:        3
 Flags:             OPTIMIZED, NEWLOCALS, NOFREE
 Constants:
    0: %r
-   1: '__func__'
-   2: '__code__'
-   3: '<code_info>'
-   4: 'co_code'
-   5: "don't know how to disassemble %%s objects"
-%sNames:
-   0: hasattr
-   1: __func__
-   2: __code__
-   3: isinstance
-   4: str
-   5: _try_compile
-   6: _format_code_info
-   7: TypeError
-   8: type
-   9: __name__
+Names:
+   0: _format_code_info
+   1: _get_code_object
 Variable names:
-   0: x""" % (('Formatted details of methods, functions, or code.', '   6: None\n')
-              if sys.flags.optimize < 2 else (None, ''))
+   0: x""" % (('Formatted details of methods, functions, or code.',)
+              if sys.flags.optimize < 2 else (None,))
 
 @staticmethod
 def tricky(x, y, z=True, *args, c, d, e=[], **kwds):
@@ -382,7 +432,7 @@
 
 code_info_expr_str = """\
 Name:              <module>
-Filename:          <code_info>
+Filename:          <disassembly>
 Argument count:    0
 Kw-only arguments: 0
 Number of locals:  0
@@ -395,7 +445,7 @@
 
 code_info_simple_stmt_str = """\
 Name:              <module>
-Filename:          <code_info>
+Filename:          <disassembly>
 Argument count:    0
 Kw-only arguments: 0
 Number of locals:  0
@@ -409,7 +459,7 @@
 
 code_info_compound_stmt_str = """\
 Name:              <module>
-Filename:          <code_info>
+Filename:          <disassembly>
 Argument count:    0
 Kw-only arguments: 0
 Number of locals:  0
@@ -443,6 +493,9 @@
             with captured_stdout() as output:
                 dis.show_code(x)
             self.assertRegex(output.getvalue(), expected+"\n")
+            output = io.StringIO()
+            dis.show_code(x, file=output)
+            self.assertRegex(output.getvalue(), expected)
 
     def test_code_info_object(self):
         self.assertRaises(TypeError, dis.code_info, object())
@@ -451,5 +504,330 @@
         self.assertEqual(dis.pretty_flags(0), '0x0')
 
 
+# Fodder for instruction introspection tests
+#   Editing any of these may require recalculating the expected output
+def outer(a=1, b=2):
+    def f(c=3, d=4):
+        def inner(e=5, f=6):
+            print(a, b, c, d, e, f)
+        print(a, b, c, d)
+        return inner
+    print(a, b, '', 1, [], {}, "Hello world!")
+    return f
+
+def jumpy():
+    # This won't actually run (but that's OK, we only disassemble it)
+    for i in range(10):
+        print(i)
+        if i < 4:
+            continue
+        if i > 6:
+            break
+    else:
+        print("I can haz else clause?")
+    while i:
+        print(i)
+        i -= 1
+        if i > 6:
+            continue
+        if i < 4:
+            break
+    else:
+        print("Who let lolcatz into this test suite?")
+    try:
+        1 / 0
+    except ZeroDivisionError:
+        print("Here we go, here we go, here we go...")
+    else:
+        with i as dodgy:
+            print("Never reach this")
+    finally:
+        print("OK, now we're done")
+
+# End fodder for opinfo generation tests
+expected_outer_line = 1
+_line_offset = outer.__code__.co_firstlineno - 1
+code_object_f = outer.__code__.co_consts[3]
+expected_f_line = code_object_f.co_firstlineno - _line_offset
+code_object_inner = code_object_f.co_consts[3]
+expected_inner_line = code_object_inner.co_firstlineno - _line_offset
+expected_jumpy_line = 1
+
+# The following lines are useful to regenerate the expected results after
+# either the fodder is modified or the bytecode generation changes
+# After regeneration, update the references to code_object_f and
+# code_object_inner before rerunning the tests
+
+#_instructions = dis.get_instructions(outer, first_line=expected_outer_line)
+#print('expected_opinfo_outer = [\n  ',
+      #',\n  '.join(map(str, _instructions)), ',\n]', sep='')
+#_instructions = dis.get_instructions(outer(), first_line=expected_outer_line)
+#print('expected_opinfo_f = [\n  ',
+      #',\n  '.join(map(str, _instructions)), ',\n]', sep='')
+#_instructions = dis.get_instructions(outer()(), first_line=expected_outer_line)
+#print('expected_opinfo_inner = [\n  ',
+      #',\n  '.join(map(str, _instructions)), ',\n]', sep='')
+#_instructions = dis.get_instructions(jumpy, first_line=expected_jumpy_line)
+#print('expected_opinfo_jumpy = [\n  ',
+      #',\n  '.join(map(str, _instructions)), ',\n]', sep='')
+
+
+Instruction = dis.Instruction
+expected_opinfo_outer = [
+  Instruction(opname='LOAD_CONST', opcode=100, arg=1, argval=3, argrepr='3', offset=0, starts_line=2, is_jump_target=False),
+  Instruction(opname='LOAD_CONST', opcode=100, arg=2, argval=4, argrepr='4', offset=3, starts_line=None, is_jump_target=False),
+  Instruction(opname='LOAD_CLOSURE', opcode=135, arg=0, argval='a', argrepr='a', offset=6, starts_line=None, is_jump_target=False),
+  Instruction(opname='LOAD_CLOSURE', opcode=135, arg=1, argval='b', argrepr='b', offset=9, starts_line=None, is_jump_target=False),
+  Instruction(opname='BUILD_TUPLE', opcode=102, arg=2, argval=2, argrepr='', offset=12, starts_line=None, is_jump_target=False),
+  Instruction(opname='LOAD_CONST', opcode=100, arg=3, argval=code_object_f, argrepr=repr(code_object_f), offset=15, starts_line=None, is_jump_target=False),
+  Instruction(opname='LOAD_CONST', opcode=100, arg=4, argval='outer.<locals>.f', argrepr="'outer.<locals>.f'", offset=18, starts_line=None, is_jump_target=False),
+  Instruction(opname='MAKE_CLOSURE', opcode=134, arg=2, argval=2, argrepr='', offset=21, starts_line=None, is_jump_target=False),
+  Instruction(opname='STORE_FAST', opcode=125, arg=2, argval='f', argrepr='f', offset=24, starts_line=None, is_jump_target=False),
+  Instruction(opname='LOAD_GLOBAL', opcode=116, arg=0, argval='print', argrepr='print', offset=27, starts_line=7, is_jump_target=False),
+  Instruction(opname='LOAD_DEREF', opcode=136, arg=0, argval='a', argrepr='a', offset=30, starts_line=None, is_jump_target=False),
+  Instruction(opname='LOAD_DEREF', opcode=136, arg=1, argval='b', argrepr='b', offset=33, starts_line=None, is_jump_target=False),
+  Instruction(opname='LOAD_CONST', opcode=100, arg=5, argval='', argrepr="''", offset=36, starts_line=None, is_jump_target=False),
+  Instruction(opname='LOAD_CONST', opcode=100, arg=6, argval=1, argrepr='1', offset=39, starts_line=None, is_jump_target=False),
+  Instruction(opname='BUILD_LIST', opcode=103, arg=0, argval=0, argrepr='', offset=42, starts_line=None, is_jump_target=False),
+  Instruction(opname='BUILD_MAP', opcode=105, arg=0, argval=0, argrepr='', offset=45, starts_line=None, is_jump_target=False),
+  Instruction(opname='LOAD_CONST', opcode=100, arg=7, argval='Hello world!', argrepr="'Hello world!'", offset=48, starts_line=None, is_jump_target=False),
+  Instruction(opname='CALL_FUNCTION', opcode=131, arg=7, argval=7, argrepr='7 positional, 0 keyword pair', offset=51, starts_line=None, is_jump_target=False),
+  Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=54, starts_line=None, is_jump_target=False),
+  Instruction(opname='LOAD_FAST', opcode=124, arg=2, argval='f', argrepr='f', offset=55, starts_line=8, is_jump_target=False),
+  Instruction(opname='RETURN_VALUE', opcode=83, arg=None, argval=None, argrepr='', offset=58, starts_line=None, is_jump_target=False),
+]
+
+expected_opinfo_f = [
+  Instruction(opname='LOAD_CONST', opcode=100, arg=1, argval=5, argrepr='5', offset=0, starts_line=3, is_jump_target=False),
+  Instruction(opname='LOAD_CONST', opcode=100, arg=2, argval=6, argrepr='6', offset=3, starts_line=None, is_jump_target=False),
+  Instruction(opname='LOAD_CLOSURE', opcode=135, arg=2, argval='a', argrepr='a', offset=6, starts_line=None, is_jump_target=False),
+  Instruction(opname='LOAD_CLOSURE', opcode=135, arg=3, argval='b', argrepr='b', offset=9, starts_line=None, is_jump_target=False),
+  Instruction(opname='LOAD_CLOSURE', opcode=135, arg=0, argval='c', argrepr='c', offset=12, starts_line=None, is_jump_target=False),
+  Instruction(opname='LOAD_CLOSURE', opcode=135, arg=1, argval='d', argrepr='d', offset=15, starts_line=None, is_jump_target=False),
+  Instruction(opname='BUILD_TUPLE', opcode=102, arg=4, argval=4, argrepr='', offset=18, starts_line=None, is_jump_target=False),
+  Instruction(opname='LOAD_CONST', opcode=100, arg=3, argval=code_object_inner, argrepr=repr(code_object_inner), offset=21, starts_line=None, is_jump_target=False),
+  Instruction(opname='LOAD_CONST', opcode=100, arg=4, argval='outer.<locals>.f.<locals>.inner', argrepr="'outer.<locals>.f.<locals>.inner'", offset=24, starts_line=None, is_jump_target=False),
+  Instruction(opname='MAKE_CLOSURE', opcode=134, arg=2, argval=2, argrepr='', offset=27, starts_line=None, is_jump_target=False),
+  Instruction(opname='STORE_FAST', opcode=125, arg=2, argval='inner', argrepr='inner', offset=30, starts_line=None, is_jump_target=False),
+  Instruction(opname='LOAD_GLOBAL', opcode=116, arg=0, argval='print', argrepr='print', offset=33, starts_line=5, is_jump_target=False),
+  Instruction(opname='LOAD_DEREF', opcode=136, arg=2, argval='a', argrepr='a', offset=36, starts_line=None, is_jump_target=False),
+  Instruction(opname='LOAD_DEREF', opcode=136, arg=3, argval='b', argrepr='b', offset=39, starts_line=None, is_jump_target=False),
+  Instruction(opname='LOAD_DEREF', opcode=136, arg=0, argval='c', argrepr='c', offset=42, starts_line=None, is_jump_target=False),
+  Instruction(opname='LOAD_DEREF', opcode=136, arg=1, argval='d', argrepr='d', offset=45, starts_line=None, is_jump_target=False),
+  Instruction(opname='CALL_FUNCTION', opcode=131, arg=4, argval=4, argrepr='4 positional, 0 keyword pair', offset=48, starts_line=None, is_jump_target=False),
+  Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=51, starts_line=None, is_jump_target=False),
+  Instruction(opname='LOAD_FAST', opcode=124, arg=2, argval='inner', argrepr='inner', offset=52, starts_line=6, is_jump_target=False),
+  Instruction(opname='RETURN_VALUE', opcode=83, arg=None, argval=None, argrepr='', offset=55, starts_line=None, is_jump_target=False),
+]
+
+expected_opinfo_inner = [
+  Instruction(opname='LOAD_GLOBAL', opcode=116, arg=0, argval='print', argrepr='print', offset=0, starts_line=4, is_jump_target=False),
+  Instruction(opname='LOAD_DEREF', opcode=136, arg=0, argval='a', argrepr='a', offset=3, starts_line=None, is_jump_target=False),
+  Instruction(opname='LOAD_DEREF', opcode=136, arg=1, argval='b', argrepr='b', offset=6, starts_line=None, is_jump_target=False),
+  Instruction(opname='LOAD_DEREF', opcode=136, arg=2, argval='c', argrepr='c', offset=9, starts_line=None, is_jump_target=False),
+  Instruction(opname='LOAD_DEREF', opcode=136, arg=3, argval='d', argrepr='d', offset=12, starts_line=None, is_jump_target=False),
+  Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='e', argrepr='e', offset=15, starts_line=None, is_jump_target=False),
+  Instruction(opname='LOAD_FAST', opcode=124, arg=1, argval='f', argrepr='f', offset=18, starts_line=None, is_jump_target=False),
+  Instruction(opname='CALL_FUNCTION', opcode=131, arg=6, argval=6, argrepr='6 positional, 0 keyword pair', offset=21, starts_line=None, is_jump_target=False),
+  Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=24, starts_line=None, is_jump_target=False),
+  Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, argrepr='None', offset=25, starts_line=None, is_jump_target=False),
+  Instruction(opname='RETURN_VALUE', opcode=83, arg=None, argval=None, argrepr='', offset=28, starts_line=None, is_jump_target=False),
+]
+
+expected_opinfo_jumpy = [
+  Instruction(opname='SETUP_LOOP', opcode=120, arg=74, argval=77, argrepr='to 77', offset=0, starts_line=3, is_jump_target=False),
+  Instruction(opname='LOAD_GLOBAL', opcode=116, arg=0, argval='range', argrepr='range', offset=3, starts_line=None, is_jump_target=False),
+  Instruction(opname='LOAD_CONST', opcode=100, arg=1, argval=10, argrepr='10', offset=6, starts_line=None, is_jump_target=False),
+  Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, argrepr='1 positional, 0 keyword pair', offset=9, starts_line=None, is_jump_target=False),
+  Instruction(opname='GET_ITER', opcode=68, arg=None, argval=None, argrepr='', offset=12, starts_line=None, is_jump_target=False),
+  Instruction(opname='FOR_ITER', opcode=93, arg=50, argval=66, argrepr='to 66', offset=13, starts_line=None, is_jump_target=True),
+  Instruction(opname='STORE_FAST', opcode=125, arg=0, argval='i', argrepr='i', offset=16, starts_line=None, is_jump_target=False),
+  Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', argrepr='print', offset=19, starts_line=4, is_jump_target=False),
+  Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=22, starts_line=None, is_jump_target=False),
+  Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, argrepr='1 positional, 0 keyword pair', offset=25, starts_line=None, is_jump_target=False),
+  Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=28, starts_line=None, is_jump_target=False),
+  Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=29, starts_line=5, is_jump_target=False),
+  Instruction(opname='LOAD_CONST', opcode=100, arg=2, argval=4, argrepr='4', offset=32, starts_line=None, is_jump_target=False),
+  Instruction(opname='COMPARE_OP', opcode=107, arg=0, argval='<', argrepr='<', offset=35, starts_line=None, is_jump_target=False),
+  Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=47, argval=47, argrepr='', offset=38, starts_line=None, is_jump_target=False),
+  Instruction(opname='JUMP_ABSOLUTE', opcode=113, arg=13, argval=13, argrepr='', offset=41, starts_line=6, is_jump_target=False),
+  Instruction(opname='JUMP_FORWARD', opcode=110, arg=0, argval=47, argrepr='to 47', offset=44, starts_line=None, is_jump_target=False),
+  Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=47, starts_line=7, is_jump_target=True),
+  Instruction(opname='LOAD_CONST', opcode=100, arg=3, argval=6, argrepr='6', offset=50, starts_line=None, is_jump_target=False),
+  Instruction(opname='COMPARE_OP', opcode=107, arg=4, argval='>', argrepr='>', offset=53, starts_line=None, is_jump_target=False),
+  Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=13, argval=13, argrepr='', offset=56, starts_line=None, is_jump_target=False),
+  Instruction(opname='BREAK_LOOP', opcode=80, arg=None, argval=None, argrepr='', offset=59, starts_line=8, is_jump_target=False),
+  Instruction(opname='JUMP_ABSOLUTE', opcode=113, arg=13, argval=13, argrepr='', offset=60, starts_line=None, is_jump_target=False),
+  Instruction(opname='JUMP_ABSOLUTE', opcode=113, arg=13, argval=13, argrepr='', offset=63, starts_line=None, is_jump_target=False),
+  Instruction(opname='POP_BLOCK', opcode=87, arg=None, argval=None, argrepr='', offset=66, starts_line=None, is_jump_target=True),
+  Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', argrepr='print', offset=67, starts_line=10, is_jump_target=False),
+  Instruction(opname='LOAD_CONST', opcode=100, arg=4, argval='I can haz else clause?', argrepr="'I can haz else clause?'", offset=70, starts_line=None, is_jump_target=False),
+  Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, argrepr='1 positional, 0 keyword pair', offset=73, starts_line=None, is_jump_target=False),
+  Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=76, starts_line=None, is_jump_target=False),
+  Instruction(opname='SETUP_LOOP', opcode=120, arg=74, argval=154, argrepr='to 154', offset=77, starts_line=11, is_jump_target=True),
+  Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=80, starts_line=None, is_jump_target=True),
+  Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=143, argval=143, argrepr='', offset=83, starts_line=None, is_jump_target=False),
+  Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', argrepr='print', offset=86, starts_line=12, is_jump_target=False),
+  Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=89, starts_line=None, is_jump_target=False),
+  Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, argrepr='1 positional, 0 keyword pair', offset=92, starts_line=None, is_jump_target=False),
+  Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=95, starts_line=None, is_jump_target=False),
+  Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=96, starts_line=13, is_jump_target=False),
+  Instruction(opname='LOAD_CONST', opcode=100, arg=5, argval=1, argrepr='1', offset=99, starts_line=None, is_jump_target=False),
+  Instruction(opname='INPLACE_SUBTRACT', opcode=56, arg=None, argval=None, argrepr='', offset=102, starts_line=None, is_jump_target=False),
+  Instruction(opname='STORE_FAST', opcode=125, arg=0, argval='i', argrepr='i', offset=103, starts_line=None, is_jump_target=False),
+  Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=106, starts_line=14, is_jump_target=False),
+  Instruction(opname='LOAD_CONST', opcode=100, arg=3, argval=6, argrepr='6', offset=109, starts_line=None, is_jump_target=False),
+  Instruction(opname='COMPARE_OP', opcode=107, arg=4, argval='>', argrepr='>', offset=112, starts_line=None, is_jump_target=False),
+  Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=124, argval=124, argrepr='', offset=115, starts_line=None, is_jump_target=False),
+  Instruction(opname='JUMP_ABSOLUTE', opcode=113, arg=80, argval=80, argrepr='', offset=118, starts_line=15, is_jump_target=False),
+  Instruction(opname='JUMP_FORWARD', opcode=110, arg=0, argval=124, argrepr='to 124', offset=121, starts_line=None, is_jump_target=False),
+  Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=124, starts_line=16, is_jump_target=True),
+  Instruction(opname='LOAD_CONST', opcode=100, arg=2, argval=4, argrepr='4', offset=127, starts_line=None, is_jump_target=False),
+  Instruction(opname='COMPARE_OP', opcode=107, arg=0, argval='<', argrepr='<', offset=130, starts_line=None, is_jump_target=False),
+  Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=80, argval=80, argrepr='', offset=133, starts_line=None, is_jump_target=False),
+  Instruction(opname='BREAK_LOOP', opcode=80, arg=None, argval=None, argrepr='', offset=136, starts_line=17, is_jump_target=False),
+  Instruction(opname='JUMP_ABSOLUTE', opcode=113, arg=80, argval=80, argrepr='', offset=137, starts_line=None, is_jump_target=False),
+  Instruction(opname='JUMP_ABSOLUTE', opcode=113, arg=80, argval=80, argrepr='', offset=140, starts_line=None, is_jump_target=False),
+  Instruction(opname='POP_BLOCK', opcode=87, arg=None, argval=None, argrepr='', offset=143, starts_line=None, is_jump_target=True),
+  Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', argrepr='print', offset=144, starts_line=19, is_jump_target=False),
+  Instruction(opname='LOAD_CONST', opcode=100, arg=6, argval='Who let lolcatz into this test suite?', argrepr="'Who let lolcatz into this test suite?'", offset=147, starts_line=None, is_jump_target=False),
+  Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, argrepr='1 positional, 0 keyword pair', offset=150, starts_line=None, is_jump_target=False),
+  Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=153, starts_line=None, is_jump_target=False),
+  Instruction(opname='SETUP_FINALLY', opcode=122, arg=72, argval=229, argrepr='to 229', offset=154, starts_line=20, is_jump_target=True),
+  Instruction(opname='SETUP_EXCEPT', opcode=121, arg=12, argval=172, argrepr='to 172', offset=157, starts_line=None, is_jump_target=False),
+  Instruction(opname='LOAD_CONST', opcode=100, arg=5, argval=1, argrepr='1', offset=160, starts_line=21, is_jump_target=False),
+  Instruction(opname='LOAD_CONST', opcode=100, arg=7, argval=0, argrepr='0', offset=163, starts_line=None, is_jump_target=False),
+  Instruction(opname='BINARY_TRUE_DIVIDE', opcode=27, arg=None, argval=None, argrepr='', offset=166, starts_line=None, is_jump_target=False),
+  Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=167, starts_line=None, is_jump_target=False),
+  Instruction(opname='POP_BLOCK', opcode=87, arg=None, argval=None, argrepr='', offset=168, starts_line=None, is_jump_target=False),
+  Instruction(opname='JUMP_FORWARD', opcode=110, arg=28, argval=200, argrepr='to 200', offset=169, starts_line=None, is_jump_target=False),
+  Instruction(opname='DUP_TOP', opcode=4, arg=None, argval=None, argrepr='', offset=172, starts_line=22, is_jump_target=True),
+  Instruction(opname='LOAD_GLOBAL', opcode=116, arg=2, argval='ZeroDivisionError', argrepr='ZeroDivisionError', offset=173, starts_line=None, is_jump_target=False),
+  Instruction(opname='COMPARE_OP', opcode=107, arg=10, argval='exception match', argrepr='exception match', offset=176, starts_line=None, is_jump_target=False),
+  Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=199, argval=199, argrepr='', offset=179, starts_line=None, is_jump_target=False),
+  Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=182, starts_line=None, is_jump_target=False),
+  Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=183, starts_line=None, is_jump_target=False),
+  Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=184, starts_line=None, is_jump_target=False),
+  Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', argrepr='print', offset=185, starts_line=23, is_jump_target=False),
+  Instruction(opname='LOAD_CONST', opcode=100, arg=8, argval='Here we go, here we go, here we go...', argrepr="'Here we go, here we go, here we go...'", offset=188, starts_line=None, is_jump_target=False),
+  Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, argrepr='1 positional, 0 keyword pair', offset=191, starts_line=None, is_jump_target=False),
+  Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=194, starts_line=None, is_jump_target=False),
+  Instruction(opname='POP_EXCEPT', opcode=89, arg=None, argval=None, argrepr='', offset=195, starts_line=None, is_jump_target=False),
+  Instruction(opname='JUMP_FORWARD', opcode=110, arg=26, argval=225, argrepr='to 225', offset=196, starts_line=None, is_jump_target=False),
+  Instruction(opname='END_FINALLY', opcode=88, arg=None, argval=None, argrepr='', offset=199, starts_line=None, is_jump_target=True),
+  Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=200, starts_line=25, is_jump_target=True),
+  Instruction(opname='SETUP_WITH', opcode=143, arg=17, argval=223, argrepr='to 223', offset=203, starts_line=None, is_jump_target=False),
+  Instruction(opname='STORE_FAST', opcode=125, arg=1, argval='dodgy', argrepr='dodgy', offset=206, starts_line=None, is_jump_target=False),
+  Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', argrepr='print', offset=209, starts_line=26, is_jump_target=False),
+  Instruction(opname='LOAD_CONST', opcode=100, arg=9, argval='Never reach this', argrepr="'Never reach this'", offset=212, starts_line=None, is_jump_target=False),
+  Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, argrepr='1 positional, 0 keyword pair', offset=215, starts_line=None, is_jump_target=False),
+  Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=218, starts_line=None, is_jump_target=False),
+  Instruction(opname='POP_BLOCK', opcode=87, arg=None, argval=None, argrepr='', offset=219, starts_line=None, is_jump_target=False),
+  Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, argrepr='None', offset=220, starts_line=None, is_jump_target=False),
+  Instruction(opname='WITH_CLEANUP', opcode=81, arg=None, argval=None, argrepr='', offset=223, starts_line=None, is_jump_target=True),
+  Instruction(opname='END_FINALLY', opcode=88, arg=None, argval=None, argrepr='', offset=224, starts_line=None, is_jump_target=False),
+  Instruction(opname='POP_BLOCK', opcode=87, arg=None, argval=None, argrepr='', offset=225, starts_line=None, is_jump_target=True),
+  Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, argrepr='None', offset=226, starts_line=None, is_jump_target=False),
+  Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', argrepr='print', offset=229, starts_line=28, is_jump_target=True),
+  Instruction(opname='LOAD_CONST', opcode=100, arg=10, argval="OK, now we're done", argrepr='"OK, now we\'re done"', offset=232, starts_line=None, is_jump_target=False),
+  Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, argrepr='1 positional, 0 keyword pair', offset=235, starts_line=None, is_jump_target=False),
+  Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=238, starts_line=None, is_jump_target=False),
+  Instruction(opname='END_FINALLY', opcode=88, arg=None, argval=None, argrepr='', offset=239, starts_line=None, is_jump_target=False),
+  Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, argrepr='None', offset=240, starts_line=None, is_jump_target=False),
+  Instruction(opname='RETURN_VALUE', opcode=83, arg=None, argval=None, argrepr='', offset=243, starts_line=None, is_jump_target=False),
+]
+
+# One last piece of inspect fodder to check the default line number handling
+def simple(): pass
+expected_opinfo_simple = [
+  Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, argrepr='None', offset=0, starts_line=simple.__code__.co_firstlineno, is_jump_target=False),
+  Instruction(opname='RETURN_VALUE', opcode=83, arg=None, argval=None, argrepr='', offset=3, starts_line=None, is_jump_target=False)
+]
+
+
+class InstructionTests(BytecodeTestCase):
+
+    def test_default_first_line(self):
+        actual = dis.get_instructions(simple)
+        self.assertEqual(list(actual), expected_opinfo_simple)
+
+    def test_first_line_set_to_None(self):
+        actual = dis.get_instructions(simple, first_line=None)
+        self.assertEqual(list(actual), expected_opinfo_simple)
+
+    def test_outer(self):
+        actual = dis.get_instructions(outer, first_line=expected_outer_line)
+        self.assertEqual(list(actual), expected_opinfo_outer)
+
+    def test_nested(self):
+        with captured_stdout():
+            f = outer()
+        actual = dis.get_instructions(f, first_line=expected_f_line)
+        self.assertEqual(list(actual), expected_opinfo_f)
+
+    def test_doubly_nested(self):
+        with captured_stdout():
+            inner = outer()()
+        actual = dis.get_instructions(inner, first_line=expected_inner_line)
+        self.assertEqual(list(actual), expected_opinfo_inner)
+
+    def test_jumpy(self):
+        actual = dis.get_instructions(jumpy, first_line=expected_jumpy_line)
+        self.assertEqual(list(actual), expected_opinfo_jumpy)
+
+# get_instructions has its own tests above, so can rely on it to validate
+# the object oriented API
+class BytecodeTests(unittest.TestCase):
+    def test_instantiation(self):
+        # Test with function, method, code string and code object
+        for obj in [_f, _C(1).__init__, "a=1", _f.__code__]:
+            with self.subTest(obj=obj):
+                b = dis.Bytecode(obj)
+                self.assertIsInstance(b.codeobj, types.CodeType)
+
+        self.assertRaises(TypeError, dis.Bytecode, object())
+
+    def test_iteration(self):
+        for obj in [_f, _C(1).__init__, "a=1", _f.__code__]:
+            with self.subTest(obj=obj):
+                via_object = list(dis.Bytecode(obj))
+                via_generator = list(dis.get_instructions(obj))
+                self.assertEqual(via_object, via_generator)
+
+    def test_explicit_first_line(self):
+        actual = dis.Bytecode(outer, first_line=expected_outer_line)
+        self.assertEqual(list(actual), expected_opinfo_outer)
+
+    def test_source_line_in_disassembly(self):
+        # Use the line in the source code
+        actual = dis.Bytecode(simple).dis()[:3]
+        expected = "{:>3}".format(simple.__code__.co_firstlineno)
+        self.assertEqual(actual, expected)
+        # Use an explicit first line number
+        actual = dis.Bytecode(simple, first_line=350).dis()[:3]
+        self.assertEqual(actual, "350")
+
+    def test_info(self):
+        self.maxDiff = 1000
+        for x, expected in CodeInfoTests.test_pairs:
+            b = dis.Bytecode(x)
+            self.assertRegex(b.info(), expected)
+
+    def test_disassembled(self):
+        actual = dis.Bytecode(_f).dis()
+        self.assertEqual(actual, dis_f)
+
+    def test_from_traceback(self):
+        tb = get_tb()
+        b = dis.Bytecode.from_traceback(tb)
+        while tb.tb_next: tb = tb.tb_next
+
+        self.assertEqual(b.current_offset, tb.tb_lasti)
+
+    def test_from_traceback_dis(self):
+        tb = get_tb()
+        b = dis.Bytecode.from_traceback(tb)
+        self.assertEqual(b.dis(), dis_traceback)
+
 if __name__ == "__main__":
     unittest.main()
diff --git a/Lib/test/test_doctest.py b/Lib/test/test_doctest.py
index 86259c3..4137d5a 100644
--- a/Lib/test/test_doctest.py
+++ b/Lib/test/test_doctest.py
@@ -409,7 +409,8 @@
 
 """
 
-def test_DocTestFinder(): r"""
+class test_DocTestFinder:
+    def basics(): r"""
 Unit tests for the `DocTestFinder` class.
 
 DocTestFinder is used to extract DocTests from an object's docstring
@@ -646,6 +647,39 @@
     [1, 9, 12]
 """
 
+    if int.__doc__: # simple check for --without-doc-strings, skip if lacking
+        def non_Python_modules(): r"""
+
+Finding Doctests in Modules Not Written in Python
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+DocTestFinder can also find doctests in most modules not written in Python.
+We'll use builtins as an example, since it almost certainly isn't written in
+plain ol' Python and is guaranteed to be available.
+
+    >>> import builtins
+    >>> tests = doctest.DocTestFinder().find(builtins)
+    >>> 790 < len(tests) < 800 # approximate number of objects with docstrings
+    True
+    >>> real_tests = [t for t in tests if len(t.examples) > 0]
+    >>> len(real_tests) # objects that actually have doctests
+    8
+    >>> for t in real_tests:
+    ...     print('{}  {}'.format(len(t.examples), t.name))
+    ...
+    1  builtins.bin
+    3  builtins.float.as_integer_ratio
+    2  builtins.float.fromhex
+    2  builtins.float.hex
+    1  builtins.hex
+    1  builtins.int
+    2  builtins.int.bit_length
+    1  builtins.oct
+
+Note here that 'bin', 'oct', and 'hex' are functions; 'float.as_integer_ratio',
+'float.hex', and 'int.bit_length' are methods; 'float.fromhex' is a classmethod,
+and 'int' is a type.
+"""
+
 def test_DocTestParser(): r"""
 Unit tests for the `DocTestParser` class.
 
@@ -1436,8 +1470,40 @@
         2
     TestResults(failed=3, attempted=5)
 
-For the purposes of REPORT_ONLY_FIRST_FAILURE, unexpected exceptions
-count as failures:
+The FAIL_FAST flag causes the runner to exit after the first failing example,
+so subsequent examples are not even attempted:
+
+    >>> flags = doctest.FAIL_FAST
+    >>> doctest.DocTestRunner(verbose=False, optionflags=flags).run(test)
+    ... # doctest: +ELLIPSIS
+    **********************************************************************
+    File ..., line 5, in f
+    Failed example:
+        print(2) # first failure
+    Expected:
+        200
+    Got:
+        2
+    TestResults(failed=1, attempted=2)
+
+Specifying both FAIL_FAST and REPORT_ONLY_FIRST_FAILURE is equivalent to
+FAIL_FAST only:
+
+    >>> flags = doctest.FAIL_FAST | doctest.REPORT_ONLY_FIRST_FAILURE
+    >>> doctest.DocTestRunner(verbose=False, optionflags=flags).run(test)
+    ... # doctest: +ELLIPSIS
+    **********************************************************************
+    File ..., line 5, in f
+    Failed example:
+        print(2) # first failure
+    Expected:
+        200
+    Got:
+        2
+    TestResults(failed=1, attempted=2)
+
+For the purposes of both REPORT_ONLY_FIRST_FAILURE and FAIL_FAST, unexpected
+exceptions count as failures:
 
     >>> def f(x):
     ...     r'''
@@ -1464,6 +1530,17 @@
         ...
         ValueError: 2
     TestResults(failed=3, attempted=5)
+    >>> flags = doctest.FAIL_FAST
+    >>> doctest.DocTestRunner(verbose=False, optionflags=flags).run(test)
+    ... # doctest: +ELLIPSIS
+    **********************************************************************
+    File ..., line 5, in f
+    Failed example:
+        raise ValueError(2) # first failure
+    Exception raised:
+        ...
+        ValueError: 2
+    TestResults(failed=1, attempted=2)
 
 New option flags can also be registered, via register_optionflag().  Here
 we reach into doctest's internals a bit.
@@ -2536,6 +2613,36 @@
     >>> sys.argv = save_argv
 """
 
+def test_lineendings(): r"""
+*nix systems use \n line endings, while Windows systems use \r\n.  Python
+handles this using universal newline mode for reading files.  Let's make
+sure doctest does so (issue 8473) by creating temporary test files using each
+of the two line disciplines.  One of the two will be the "wrong" one for the
+platform the test is run on.
+
+Windows line endings first:
+
+    >>> import tempfile, os
+    >>> fn = tempfile.mktemp()
+    >>> with open(fn, 'w') as f:
+    ...    f.write('Test:\r\n\r\n  >>> x = 1 + 1\r\n\r\nDone.\r\n')
+    35
+    >>> doctest.testfile(fn, False)
+    TestResults(failed=0, attempted=1)
+    >>> os.remove(fn)
+
+And now *nix line endings:
+
+    >>> fn = tempfile.mktemp()
+    >>> with open(fn, 'w') as f:
+    ...     f.write('Test:\n\n  >>> x = 1 + 1\n\nDone.\n')
+    30
+    >>> doctest.testfile(fn, False)
+    TestResults(failed=0, attempted=1)
+    >>> os.remove(fn)
+
+"""
+
 def test_testmod(): r"""
 Tests for the testmod function.  More might be useful, but for now we're just
 testing the case raised by Issue 6195, where trying to doctest a C module would
@@ -2580,6 +2687,240 @@
     TestResults(failed=1, attempted=1)
     """
 
+def test_CLI(): r"""
+The doctest module can be used to run doctests against an arbitrary file.
+These tests test this CLI functionality.
+
+We'll use the support module's script_helpers for this, and write a test files
+to a temp dir to run the command against.  Due to a current limitation in
+script_helpers, though, we need a little utility function to turn the returned
+output into something we can doctest against:
+
+    >>> def normalize(s):
+    ...     return '\n'.join(s.decode().splitlines())
+
+Note: we also pass TERM='' to all the assert_python calls to avoid a bug
+in the readline library that is triggered in these tests because we are
+running them in a new python process.  See:
+
+  http://lists.gnu.org/archive/html/bug-readline/2013-06/msg00000.html
+
+With those preliminaries out of the way, we'll start with a file with two
+simple tests and no errors.  We'll run both the unadorned doctest command, and
+the verbose version, and then check the output:
+
+    >>> from test import script_helper
+    >>> with script_helper.temp_dir() as tmpdir:
+    ...     fn = os.path.join(tmpdir, 'myfile.doc')
+    ...     with open(fn, 'w') as f:
+    ...         _ = f.write('This is a very simple test file.\n')
+    ...         _ = f.write('   >>> 1 + 1\n')
+    ...         _ = f.write('   2\n')
+    ...         _ = f.write('   >>> "a"\n')
+    ...         _ = f.write("   'a'\n")
+    ...         _ = f.write('\n')
+    ...         _ = f.write('And that is it.\n')
+    ...     rc1, out1, err1 = script_helper.assert_python_ok(
+    ...             '-m', 'doctest', fn, TERM='')
+    ...     rc2, out2, err2 = script_helper.assert_python_ok(
+    ...             '-m', 'doctest', '-v', fn, TERM='')
+
+With no arguments and passing tests, we should get no output:
+
+    >>> rc1, out1, err1
+    (0, b'', b'')
+
+With the verbose flag, we should see the test output, but no error output:
+
+    >>> rc2, err2
+    (0, b'')
+    >>> print(normalize(out2))
+    Trying:
+        1 + 1
+    Expecting:
+        2
+    ok
+    Trying:
+        "a"
+    Expecting:
+        'a'
+    ok
+    1 items passed all tests:
+       2 tests in myfile.doc
+    2 tests in 1 items.
+    2 passed and 0 failed.
+    Test passed.
+
+Now we'll write a couple files, one with three tests, the other a python module
+with two tests, both of the files having "errors" in the tests that can be made
+non-errors by applying the appropriate doctest options to the run (ELLIPSIS in
+the first file, NORMALIZE_WHITESPACE in the second).  This combination will
+allow to thoroughly test the -f and -o flags, as well as the doctest command's
+ability to process more than one file on the command line and, since the second
+file ends in '.py', its handling of python module files (as opposed to straight
+text files).
+
+    >>> from test import script_helper
+    >>> with script_helper.temp_dir() as tmpdir:
+    ...     fn = os.path.join(tmpdir, 'myfile.doc')
+    ...     with open(fn, 'w') as f:
+    ...         _ = f.write('This is another simple test file.\n')
+    ...         _ = f.write('   >>> 1 + 1\n')
+    ...         _ = f.write('   2\n')
+    ...         _ = f.write('   >>> "abcdef"\n')
+    ...         _ = f.write("   'a...f'\n")
+    ...         _ = f.write('   >>> "ajkml"\n')
+    ...         _ = f.write("   'a...l'\n")
+    ...         _ = f.write('\n')
+    ...         _ = f.write('And that is it.\n')
+    ...     fn2 = os.path.join(tmpdir, 'myfile2.py')
+    ...     with open(fn2, 'w') as f:
+    ...         _ = f.write('def test_func():\n')
+    ...         _ = f.write('   \"\"\"\n')
+    ...         _ = f.write('   This is simple python test function.\n')
+    ...         _ = f.write('       >>> 1 + 1\n')
+    ...         _ = f.write('       2\n')
+    ...         _ = f.write('       >>> "abc   def"\n')
+    ...         _ = f.write("       'abc def'\n")
+    ...         _ = f.write("\n")
+    ...         _ = f.write('   \"\"\"\n')
+    ...     import shutil
+    ...     rc1, out1, err1 = script_helper.assert_python_failure(
+    ...             '-m', 'doctest', fn, fn2, TERM='')
+    ...     rc2, out2, err2 = script_helper.assert_python_ok(
+    ...             '-m', 'doctest', '-o', 'ELLIPSIS', fn, TERM='')
+    ...     rc3, out3, err3 = script_helper.assert_python_ok(
+    ...             '-m', 'doctest', '-o', 'ELLIPSIS',
+    ...             '-o', 'NORMALIZE_WHITESPACE', fn, fn2, TERM='')
+    ...     rc4, out4, err4 = script_helper.assert_python_failure(
+    ...             '-m', 'doctest', '-f', fn, fn2, TERM='')
+    ...     rc5, out5, err5 = script_helper.assert_python_ok(
+    ...             '-m', 'doctest', '-v', '-o', 'ELLIPSIS',
+    ...             '-o', 'NORMALIZE_WHITESPACE', fn, fn2, TERM='')
+
+Our first test run will show the errors from the first file (doctest stops if a
+file has errors).  Note that doctest test-run error output appears on stdout,
+not stderr:
+
+    >>> rc1, err1
+    (1, b'')
+    >>> print(normalize(out1))                # doctest: +ELLIPSIS
+    **********************************************************************
+    File "...myfile.doc", line 4, in myfile.doc
+    Failed example:
+        "abcdef"
+    Expected:
+        'a...f'
+    Got:
+        'abcdef'
+    **********************************************************************
+    File "...myfile.doc", line 6, in myfile.doc
+    Failed example:
+        "ajkml"
+    Expected:
+        'a...l'
+    Got:
+        'ajkml'
+    **********************************************************************
+    1 items had failures:
+       2 of   3 in myfile.doc
+    ***Test Failed*** 2 failures.
+
+With -o ELLIPSIS specified, the second run, against just the first file, should
+produce no errors, and with -o NORMALIZE_WHITESPACE also specified, neither
+should the third, which ran against both files:
+
+    >>> rc2, out2, err2
+    (0, b'', b'')
+    >>> rc3, out3, err3
+    (0, b'', b'')
+
+The fourth run uses FAIL_FAST, so we should see only one error:
+
+    >>> rc4, err4
+    (1, b'')
+    >>> print(normalize(out4))                # doctest: +ELLIPSIS
+    **********************************************************************
+    File "...myfile.doc", line 4, in myfile.doc
+    Failed example:
+        "abcdef"
+    Expected:
+        'a...f'
+    Got:
+        'abcdef'
+    **********************************************************************
+    1 items had failures:
+       1 of   2 in myfile.doc
+    ***Test Failed*** 1 failures.
+
+The fifth test uses verbose with the two options, so we should get verbose
+success output for the tests in both files:
+
+    >>> rc5, err5
+    (0, b'')
+    >>> print(normalize(out5))
+    Trying:
+        1 + 1
+    Expecting:
+        2
+    ok
+    Trying:
+        "abcdef"
+    Expecting:
+        'a...f'
+    ok
+    Trying:
+        "ajkml"
+    Expecting:
+        'a...l'
+    ok
+    1 items passed all tests:
+       3 tests in myfile.doc
+    3 tests in 1 items.
+    3 passed and 0 failed.
+    Test passed.
+    Trying:
+        1 + 1
+    Expecting:
+        2
+    ok
+    Trying:
+        "abc   def"
+    Expecting:
+        'abc def'
+    ok
+    1 items had no tests:
+        myfile2
+    1 items passed all tests:
+       2 tests in myfile2.test_func
+    2 tests in 2 items.
+    2 passed and 0 failed.
+    Test passed.
+
+We should also check some typical error cases.
+
+Invalid file name:
+
+    >>> rc, out, err = script_helper.assert_python_failure(
+    ...         '-m', 'doctest', 'nosuchfile', TERM='')
+    >>> rc, out
+    (1, b'')
+    >>> print(normalize(err))                    # doctest: +ELLIPSIS
+    Traceback (most recent call last):
+      ...
+    FileNotFoundError: [Errno ...] No such file or directory: 'nosuchfile'
+
+Invalid doctest option:
+
+    >>> rc, out, err = script_helper.assert_python_failure(
+    ...         '-m', 'doctest', '-o', 'nosuchoption', TERM='')
+    >>> rc, out
+    (2, b'')
+    >>> print(normalize(err))                    # doctest: +ELLIPSIS
+    usage...invalid...nosuchoption...
+
+"""
+
 ######################################################################
 ## Main
 ######################################################################
diff --git a/Lib/test/test_docxmlrpc.py b/Lib/test/test_docxmlrpc.py
index cb6366c..06161f2 100644
--- a/Lib/test/test_docxmlrpc.py
+++ b/Lib/test/test_docxmlrpc.py
@@ -10,7 +10,7 @@
 PORT = None
 
 def make_request_and_skipIf(condition, reason):
-    # If we skip the test, we have to make a request because the
+    # If we skip the test, we have to make a request because
     # the server created in setUp blocks expecting one to come in.
     if not condition:
         return lambda func: func
diff --git a/Lib/test/test_dynamicclassattribute.py b/Lib/test/test_dynamicclassattribute.py
new file mode 100644
index 0000000..079d6c3
--- /dev/null
+++ b/Lib/test/test_dynamicclassattribute.py
@@ -0,0 +1,304 @@
+# Test case for DynamicClassAttribute
+# more tests are in test_descr
+
+import abc
+import sys
+import unittest
+from test.support import run_unittest
+from types import DynamicClassAttribute
+
+class PropertyBase(Exception):
+    pass
+
+class PropertyGet(PropertyBase):
+    pass
+
+class PropertySet(PropertyBase):
+    pass
+
+class PropertyDel(PropertyBase):
+    pass
+
+class BaseClass(object):
+    def __init__(self):
+        self._spam = 5
+
+    @DynamicClassAttribute
+    def spam(self):
+        """BaseClass.getter"""
+        return self._spam
+
+    @spam.setter
+    def spam(self, value):
+        self._spam = value
+
+    @spam.deleter
+    def spam(self):
+        del self._spam
+
+class SubClass(BaseClass):
+
+    spam = BaseClass.__dict__['spam']
+
+    @spam.getter
+    def spam(self):
+        """SubClass.getter"""
+        raise PropertyGet(self._spam)
+
+    @spam.setter
+    def spam(self, value):
+        raise PropertySet(self._spam)
+
+    @spam.deleter
+    def spam(self):
+        raise PropertyDel(self._spam)
+
+class PropertyDocBase(object):
+    _spam = 1
+    def _get_spam(self):
+        return self._spam
+    spam = DynamicClassAttribute(_get_spam, doc="spam spam spam")
+
+class PropertyDocSub(PropertyDocBase):
+    spam = PropertyDocBase.__dict__['spam']
+    @spam.getter
+    def spam(self):
+        """The decorator does not use this doc string"""
+        return self._spam
+
+class PropertySubNewGetter(BaseClass):
+    spam = BaseClass.__dict__['spam']
+    @spam.getter
+    def spam(self):
+        """new docstring"""
+        return 5
+
+class PropertyNewGetter(object):
+    @DynamicClassAttribute
+    def spam(self):
+        """original docstring"""
+        return 1
+    @spam.getter
+    def spam(self):
+        """new docstring"""
+        return 8
+
+class ClassWithAbstractVirtualProperty(metaclass=abc.ABCMeta):
+    @DynamicClassAttribute
+    @abc.abstractmethod
+    def color():
+        pass
+
+class ClassWithPropertyAbstractVirtual(metaclass=abc.ABCMeta):
+    @abc.abstractmethod
+    @DynamicClassAttribute
+    def color():
+        pass
+
+class PropertyTests(unittest.TestCase):
+    def test_property_decorator_baseclass(self):
+        # see #1620
+        base = BaseClass()
+        self.assertEqual(base.spam, 5)
+        self.assertEqual(base._spam, 5)
+        base.spam = 10
+        self.assertEqual(base.spam, 10)
+        self.assertEqual(base._spam, 10)
+        delattr(base, "spam")
+        self.assertTrue(not hasattr(base, "spam"))
+        self.assertTrue(not hasattr(base, "_spam"))
+        base.spam = 20
+        self.assertEqual(base.spam, 20)
+        self.assertEqual(base._spam, 20)
+
+    def test_property_decorator_subclass(self):
+        # see #1620
+        sub = SubClass()
+        self.assertRaises(PropertyGet, getattr, sub, "spam")
+        self.assertRaises(PropertySet, setattr, sub, "spam", None)
+        self.assertRaises(PropertyDel, delattr, sub, "spam")
+
+    @unittest.skipIf(sys.flags.optimize >= 2,
+                     "Docstrings are omitted with -O2 and above")
+    def test_property_decorator_subclass_doc(self):
+        sub = SubClass()
+        self.assertEqual(sub.__class__.__dict__['spam'].__doc__, "SubClass.getter")
+
+    @unittest.skipIf(sys.flags.optimize >= 2,
+                     "Docstrings are omitted with -O2 and above")
+    def test_property_decorator_baseclass_doc(self):
+        base = BaseClass()
+        self.assertEqual(base.__class__.__dict__['spam'].__doc__, "BaseClass.getter")
+
+    def test_property_decorator_doc(self):
+        base = PropertyDocBase()
+        sub = PropertyDocSub()
+        self.assertEqual(base.__class__.__dict__['spam'].__doc__, "spam spam spam")
+        self.assertEqual(sub.__class__.__dict__['spam'].__doc__, "spam spam spam")
+
+    @unittest.skipIf(sys.flags.optimize >= 2,
+                     "Docstrings are omitted with -O2 and above")
+    def test_property_getter_doc_override(self):
+        newgettersub = PropertySubNewGetter()
+        self.assertEqual(newgettersub.spam, 5)
+        self.assertEqual(newgettersub.__class__.__dict__['spam'].__doc__, "new docstring")
+        newgetter = PropertyNewGetter()
+        self.assertEqual(newgetter.spam, 8)
+        self.assertEqual(newgetter.__class__.__dict__['spam'].__doc__, "new docstring")
+
+    def test_property___isabstractmethod__descriptor(self):
+        for val in (True, False, [], [1], '', '1'):
+            class C(object):
+                def foo(self):
+                    pass
+                foo.__isabstractmethod__ = val
+                foo = DynamicClassAttribute(foo)
+            self.assertIs(C.__dict__['foo'].__isabstractmethod__, bool(val))
+
+        # check that the DynamicClassAttribute's __isabstractmethod__ descriptor does the
+        # right thing when presented with a value that fails truth testing:
+        class NotBool(object):
+            def __nonzero__(self):
+                raise ValueError()
+            __len__ = __nonzero__
+        with self.assertRaises(ValueError):
+            class C(object):
+                def foo(self):
+                    pass
+                foo.__isabstractmethod__ = NotBool()
+                foo = DynamicClassAttribute(foo)
+
+    def test_abstract_virtual(self):
+        self.assertRaises(TypeError, ClassWithAbstractVirtualProperty)
+        self.assertRaises(TypeError, ClassWithPropertyAbstractVirtual)
+        class APV(ClassWithPropertyAbstractVirtual):
+            pass
+        self.assertRaises(TypeError, APV)
+        class AVP(ClassWithAbstractVirtualProperty):
+            pass
+        self.assertRaises(TypeError, AVP)
+        class Okay1(ClassWithAbstractVirtualProperty):
+            @DynamicClassAttribute
+            def color(self):
+                return self._color
+            def __init__(self):
+                self._color = 'cyan'
+        with self.assertRaises(AttributeError):
+            Okay1.color
+        self.assertEqual(Okay1().color, 'cyan')
+        class Okay2(ClassWithAbstractVirtualProperty):
+            @DynamicClassAttribute
+            def color(self):
+                return self._color
+            def __init__(self):
+                self._color = 'magenta'
+        with self.assertRaises(AttributeError):
+            Okay2.color
+        self.assertEqual(Okay2().color, 'magenta')
+
+
+# Issue 5890: subclasses of DynamicClassAttribute do not preserve method __doc__ strings
+class PropertySub(DynamicClassAttribute):
+    """This is a subclass of DynamicClassAttribute"""
+
+class PropertySubSlots(DynamicClassAttribute):
+    """This is a subclass of DynamicClassAttribute that defines __slots__"""
+    __slots__ = ()
+
+class PropertySubclassTests(unittest.TestCase):
+
+    @unittest.skipIf(hasattr(PropertySubSlots, '__doc__'),
+            "__doc__ is already present, __slots__ will have no effect")
+    def test_slots_docstring_copy_exception(self):
+        try:
+            class Foo(object):
+                @PropertySubSlots
+                def spam(self):
+                    """Trying to copy this docstring will raise an exception"""
+                    return 1
+                print('\n',spam.__doc__)
+        except AttributeError:
+            pass
+        else:
+            raise Exception("AttributeError not raised")
+
+    @unittest.skipIf(sys.flags.optimize >= 2,
+                     "Docstrings are omitted with -O2 and above")
+    def test_docstring_copy(self):
+        class Foo(object):
+            @PropertySub
+            def spam(self):
+                """spam wrapped in DynamicClassAttribute subclass"""
+                return 1
+        self.assertEqual(
+            Foo.__dict__['spam'].__doc__,
+            "spam wrapped in DynamicClassAttribute subclass")
+
+    @unittest.skipIf(sys.flags.optimize >= 2,
+                     "Docstrings are omitted with -O2 and above")
+    def test_property_setter_copies_getter_docstring(self):
+        class Foo(object):
+            def __init__(self): self._spam = 1
+            @PropertySub
+            def spam(self):
+                """spam wrapped in DynamicClassAttribute subclass"""
+                return self._spam
+            @spam.setter
+            def spam(self, value):
+                """this docstring is ignored"""
+                self._spam = value
+        foo = Foo()
+        self.assertEqual(foo.spam, 1)
+        foo.spam = 2
+        self.assertEqual(foo.spam, 2)
+        self.assertEqual(
+            Foo.__dict__['spam'].__doc__,
+            "spam wrapped in DynamicClassAttribute subclass")
+        class FooSub(Foo):
+            spam = Foo.__dict__['spam']
+            @spam.setter
+            def spam(self, value):
+                """another ignored docstring"""
+                self._spam = 'eggs'
+        foosub = FooSub()
+        self.assertEqual(foosub.spam, 1)
+        foosub.spam = 7
+        self.assertEqual(foosub.spam, 'eggs')
+        self.assertEqual(
+            FooSub.__dict__['spam'].__doc__,
+            "spam wrapped in DynamicClassAttribute subclass")
+
+    @unittest.skipIf(sys.flags.optimize >= 2,
+                     "Docstrings are omitted with -O2 and above")
+    def test_property_new_getter_new_docstring(self):
+
+        class Foo(object):
+            @PropertySub
+            def spam(self):
+                """a docstring"""
+                return 1
+            @spam.getter
+            def spam(self):
+                """a new docstring"""
+                return 2
+        self.assertEqual(Foo.__dict__['spam'].__doc__, "a new docstring")
+        class FooBase(object):
+            @PropertySub
+            def spam(self):
+                """a docstring"""
+                return 1
+        class Foo2(FooBase):
+            spam = FooBase.__dict__['spam']
+            @spam.getter
+            def spam(self):
+                """a new docstring"""
+                return 2
+        self.assertEqual(Foo.__dict__['spam'].__doc__, "a new docstring")
+
+
+
+def test_main():
+    run_unittest(PropertyTests, PropertySubclassTests)
+
+if __name__ == '__main__':
+    test_main()
diff --git a/Lib/test/test_email/__init__.py b/Lib/test/test_email/__init__.py
index f206ace..a59775c 100644
--- a/Lib/test/test_email/__init__.py
+++ b/Lib/test/test_email/__init__.py
@@ -1,30 +1,16 @@
 import os
 import sys
 import unittest
-import test.support
+import collections
 import email
 from email.message import Message
 from email._policybase import compat32
+from test.support import load_package_tests
 from test.test_email import __file__ as landmark
 
-# Run all tests in package for '-m unittest test.test_email'
-def load_tests(loader, standard_tests, pattern):
-    this_dir = os.path.dirname(__file__)
-    if pattern is None:
-        pattern = "test*"
-    package_tests = loader.discover(start_dir=this_dir, pattern=pattern)
-    standard_tests.addTests(package_tests)
-    return standard_tests
-
-
-# used by regrtest and __main__.
-def test_main():
-    here = os.path.dirname(__file__)
-    # Unittest mucks with the path, so we have to save and restore
-    # it to keep regrtest happy.
-    savepath = sys.path[:]
-    test.support._run_suite(unittest.defaultTestLoader.discover(here))
-    sys.path[:] = savepath
+# Load all tests in package
+def load_tests(*args):
+    return load_package_tests(os.path.dirname(__file__), *args)
 
 
 # helper code used by a number of test modules.
@@ -42,6 +28,8 @@
     # here we make minimal changes in the test_email tests compared to their
     # pre-3.3 state.
     policy = compat32
+    # Likewise, the default message object is Message.
+    message = Message
 
     def __init__(self, *args, **kw):
         super().__init__(*args, **kw)
@@ -54,11 +42,23 @@
         with openfile(filename) as fp:
             return email.message_from_file(fp, policy=self.policy)
 
-    def _str_msg(self, string, message=Message, policy=None):
+    def _str_msg(self, string, message=None, policy=None):
         if policy is None:
             policy = self.policy
+        if message is None:
+            message = self.message
         return email.message_from_string(string, message, policy=policy)
 
+    def _bytes_msg(self, bytestring, message=None, policy=None):
+        if policy is None:
+            policy = self.policy
+        if message is None:
+            message = self.message
+        return email.message_from_bytes(bytestring, message, policy=policy)
+
+    def _make_message(self):
+        return self.message(policy=self.policy)
+
     def _bytes_repr(self, b):
         return [repr(x) for x in b.splitlines(keepends=True)]
 
@@ -123,6 +123,7 @@
 
     """
     paramdicts = {}
+    testers = collections.defaultdict(list)
     for name, attr in cls.__dict__.items():
         if name.endswith('_params'):
             if not hasattr(attr, 'keys'):
@@ -134,7 +135,15 @@
                     d[n] = x
                 attr = d
             paramdicts[name[:-7] + '_as_'] = attr
+        if '_as_' in name:
+            testers[name.split('_as_')[0] + '_as_'].append(name)
     testfuncs = {}
+    for name in paramdicts:
+        if name not in testers:
+            raise ValueError("No tester found for {}".format(name))
+    for name in testers:
+        if name not in paramdicts:
+            raise ValueError("No params found for {}".format(name))
     for name, attr in cls.__dict__.items():
         for paramsname, paramsdict in paramdicts.items():
             if name.startswith(paramsname):
diff --git a/Lib/test/test_email/__main__.py b/Lib/test/test_email/__main__.py
index 98af9ec..4b14f77 100644
--- a/Lib/test/test_email/__main__.py
+++ b/Lib/test/test_email/__main__.py
@@ -1,3 +1,4 @@
-from test.test_email import test_main
+from test.test_email import load_tests
+import unittest
 
-test_main()
+unittest.main()
diff --git a/Lib/test/test_email/test__header_value_parser.py b/Lib/test/test_email/test__header_value_parser.py
index 32996ca..5404d19 100644
--- a/Lib/test/test_email/test__header_value_parser.py
+++ b/Lib/test/test_email/test__header_value_parser.py
@@ -2443,6 +2443,18 @@
         self.assertEqual(str(address_list.addresses[1]),
                          str(address_list.mailboxes[2]))
 
+    def test_invalid_content_disposition(self):
+        content_disp = self._test_parse_x(
+            parser.parse_content_disposition_header,
+            ";attachment", "; attachment", ";attachment",
+            [errors.InvalidHeaderDefect]*2
+        )
+
+    def test_invalid_content_transfer_encoding(self):
+        cte = self._test_parse_x(
+            parser.parse_content_transfer_encoding_header,
+            ";foo", ";foo", ";foo", [errors.InvalidHeaderDefect]*3
+        )
 
 @parameterize
 class Test_parse_mime_version(TestParserMixin, TestEmailBase):
diff --git a/Lib/test/test_email/test_contentmanager.py b/Lib/test/test_email/test_contentmanager.py
new file mode 100644
index 0000000..cdb04e4
--- /dev/null
+++ b/Lib/test/test_email/test_contentmanager.py
@@ -0,0 +1,796 @@
+import unittest
+from test.test_email import TestEmailBase, parameterize
+import textwrap
+from email import policy
+from email.message import EmailMessage
+from email.contentmanager import ContentManager, raw_data_manager
+
+
+@parameterize
+class TestContentManager(TestEmailBase):
+
+    policy = policy.default
+    message = EmailMessage
+
+    get_key_params = {
+        'full_type':        (1, 'text/plain',),
+        'maintype_only':    (2, 'text',),
+        'null_key':         (3, '',),
+        }
+
+    def get_key_as_get_content_key(self, order, key):
+        def foo_getter(msg, foo=None):
+            bar = msg['X-Bar-Header']
+            return foo, bar
+        cm = ContentManager()
+        cm.add_get_handler(key, foo_getter)
+        m = self._make_message()
+        m['Content-Type'] = 'text/plain'
+        m['X-Bar-Header'] = 'foo'
+        self.assertEqual(cm.get_content(m, foo='bar'), ('bar', 'foo'))
+
+    def get_key_as_get_content_key_order(self, order, key):
+        def bar_getter(msg):
+            return msg['X-Bar-Header']
+        def foo_getter(msg):
+            return msg['X-Foo-Header']
+        cm = ContentManager()
+        cm.add_get_handler(key, foo_getter)
+        for precedence, key in self.get_key_params.values():
+            if precedence > order:
+                cm.add_get_handler(key, bar_getter)
+        m = self._make_message()
+        m['Content-Type'] = 'text/plain'
+        m['X-Bar-Header'] = 'bar'
+        m['X-Foo-Header'] = 'foo'
+        self.assertEqual(cm.get_content(m), ('foo'))
+
+    def test_get_content_raises_if_unknown_mimetype_and_no_default(self):
+        cm = ContentManager()
+        m = self._make_message()
+        m['Content-Type'] = 'text/plain'
+        with self.assertRaisesRegex(KeyError, 'text/plain'):
+            cm.get_content(m)
+
+    class BaseThing(str):
+        pass
+    baseobject_full_path = __name__ + '.' + 'TestContentManager.BaseThing'
+    class Thing(BaseThing):
+        pass
+    testobject_full_path = __name__ + '.' + 'TestContentManager.Thing'
+
+    set_key_params = {
+        'type':             (0,  Thing,),
+        'full_path':        (1,  testobject_full_path,),
+        'qualname':         (2,  'TestContentManager.Thing',),
+        'name':             (3,  'Thing',),
+        'base_type':        (4,  BaseThing,),
+        'base_full_path':   (5,  baseobject_full_path,),
+        'base_qualname':    (6,  'TestContentManager.BaseThing',),
+        'base_name':        (7,  'BaseThing',),
+        'str_type':         (8,  str,),
+        'str_full_path':    (9,  'builtins.str',),
+        'str_name':         (10, 'str',),   # str name and qualname are the same
+        'null_key':         (11, None,),
+        }
+
+    def set_key_as_set_content_key(self, order, key):
+        def foo_setter(msg, obj, foo=None):
+            msg['X-Foo-Header'] = foo
+            msg.set_payload(obj)
+        cm = ContentManager()
+        cm.add_set_handler(key, foo_setter)
+        m = self._make_message()
+        msg_obj = self.Thing()
+        cm.set_content(m, msg_obj, foo='bar')
+        self.assertEqual(m['X-Foo-Header'], 'bar')
+        self.assertEqual(m.get_payload(), msg_obj)
+
+    def set_key_as_set_content_key_order(self, order, key):
+        def foo_setter(msg, obj):
+            msg['X-FooBar-Header'] = 'foo'
+            msg.set_payload(obj)
+        def bar_setter(msg, obj):
+            msg['X-FooBar-Header'] = 'bar'
+        cm = ContentManager()
+        cm.add_set_handler(key, foo_setter)
+        for precedence, key in self.get_key_params.values():
+            if precedence > order:
+                cm.add_set_handler(key, bar_setter)
+        m = self._make_message()
+        msg_obj = self.Thing()
+        cm.set_content(m, msg_obj)
+        self.assertEqual(m['X-FooBar-Header'], 'foo')
+        self.assertEqual(m.get_payload(), msg_obj)
+
+    def test_set_content_raises_if_unknown_type_and_no_default(self):
+        cm = ContentManager()
+        m = self._make_message()
+        msg_obj = self.Thing()
+        with self.assertRaisesRegex(KeyError, self.testobject_full_path):
+            cm.set_content(m, msg_obj)
+
+    def test_set_content_raises_if_called_on_multipart(self):
+        cm = ContentManager()
+        m = self._make_message()
+        m['Content-Type'] = 'multipart/foo'
+        with self.assertRaises(TypeError):
+            cm.set_content(m, 'test')
+
+    def test_set_content_calls_clear_content(self):
+        m = self._make_message()
+        m['Content-Foo'] = 'bar'
+        m['Content-Type'] = 'text/html'
+        m['To'] = 'test'
+        m.set_payload('abc')
+        cm = ContentManager()
+        cm.add_set_handler(str, lambda *args, **kw: None)
+        m.set_content('xyz', content_manager=cm)
+        self.assertIsNone(m['Content-Foo'])
+        self.assertIsNone(m['Content-Type'])
+        self.assertEqual(m['To'], 'test')
+        self.assertIsNone(m.get_payload())
+
+
+@parameterize
+class TestRawDataManager(TestEmailBase):
+    # Note: these tests are dependent on the order in which headers are added
+    # to the message objects by the code.  There's no defined ordering in
+    # RFC5322/MIME, so this makes the tests more fragile than the standards
+    # require.  However, if the header order changes it is best to understand
+    # *why*, and make sure it isn't a subtle bug in whatever change was
+    # applied.
+
+    policy = policy.default.clone(max_line_length=60,
+                                  content_manager=raw_data_manager)
+    message = EmailMessage
+
+    def test_get_text_plain(self):
+        m = self._str_msg(textwrap.dedent("""\
+            Content-Type: text/plain
+
+            Basic text.
+            """))
+        self.assertEqual(raw_data_manager.get_content(m), "Basic text.\n")
+
+    def test_get_text_html(self):
+        m = self._str_msg(textwrap.dedent("""\
+            Content-Type: text/html
+
+            <p>Basic text.</p>
+            """))
+        self.assertEqual(raw_data_manager.get_content(m),
+                         "<p>Basic text.</p>\n")
+
+    def test_get_text_plain_latin1(self):
+        m = self._bytes_msg(textwrap.dedent("""\
+            Content-Type: text/plain; charset=latin1
+
+            Basìc tëxt.
+            """).encode('latin1'))
+        self.assertEqual(raw_data_manager.get_content(m), "Basìc tëxt.\n")
+
+    def test_get_text_plain_latin1_quoted_printable(self):
+        m = self._str_msg(textwrap.dedent("""\
+            Content-Type: text/plain; charset="latin-1"
+            Content-Transfer-Encoding: quoted-printable
+
+            Bas=ECc t=EBxt.
+            """))
+        self.assertEqual(raw_data_manager.get_content(m), "Basìc tëxt.\n")
+
+    def test_get_text_plain_utf8_base64(self):
+        m = self._str_msg(textwrap.dedent("""\
+            Content-Type: text/plain; charset="utf8"
+            Content-Transfer-Encoding: base64
+
+            QmFzw6xjIHTDq3h0Lgo=
+            """))
+        self.assertEqual(raw_data_manager.get_content(m), "Basìc tëxt.\n")
+
+    def test_get_text_plain_bad_utf8_quoted_printable(self):
+        m = self._str_msg(textwrap.dedent("""\
+            Content-Type: text/plain; charset="utf8"
+            Content-Transfer-Encoding: quoted-printable
+
+            Bas=c3=acc t=c3=abxt=fd.
+            """))
+        self.assertEqual(raw_data_manager.get_content(m), "Basìc tëxt�.\n")
+
+    def test_get_text_plain_bad_utf8_quoted_printable_ignore_errors(self):
+        m = self._str_msg(textwrap.dedent("""\
+            Content-Type: text/plain; charset="utf8"
+            Content-Transfer-Encoding: quoted-printable
+
+            Bas=c3=acc t=c3=abxt=fd.
+            """))
+        self.assertEqual(raw_data_manager.get_content(m, errors='ignore'),
+                         "Basìc tëxt.\n")
+
+    def test_get_text_plain_utf8_base64_recoverable_bad_CTE_data(self):
+        m = self._str_msg(textwrap.dedent("""\
+            Content-Type: text/plain; charset="utf8"
+            Content-Transfer-Encoding: base64
+
+            QmFzw6xjIHTDq3h0Lgo\xFF=
+            """))
+        self.assertEqual(raw_data_manager.get_content(m, errors='ignore'),
+                         "Basìc tëxt.\n")
+
+    def test_get_text_invalid_keyword(self):
+        m = self._str_msg(textwrap.dedent("""\
+            Content-Type: text/plain
+
+            Basic text.
+            """))
+        with self.assertRaises(TypeError):
+            raw_data_manager.get_content(m, foo='ignore')
+
+    def test_get_non_text(self):
+        template = textwrap.dedent("""\
+            Content-Type: {}
+            Content-Transfer-Encoding: base64
+
+            Ym9ndXMgZGF0YQ==
+            """)
+        for maintype in 'audio image video application'.split():
+            with self.subTest(maintype=maintype):
+                m = self._str_msg(template.format(maintype+'/foo'))
+                self.assertEqual(raw_data_manager.get_content(m), b"bogus data")
+
+    def test_get_non_text_invalid_keyword(self):
+        m = self._str_msg(textwrap.dedent("""\
+            Content-Type: image/jpg
+            Content-Transfer-Encoding: base64
+
+            Ym9ndXMgZGF0YQ==
+            """))
+        with self.assertRaises(TypeError):
+            raw_data_manager.get_content(m, errors='ignore')
+
+    def test_get_raises_on_multipart(self):
+        m = self._str_msg(textwrap.dedent("""\
+            Content-Type: multipart/mixed; boundary="==="
+
+            --===
+            --===--
+            """))
+        with self.assertRaises(KeyError):
+            raw_data_manager.get_content(m)
+
+    def test_get_message_rfc822_and_external_body(self):
+        template = textwrap.dedent("""\
+            Content-Type: message/{}
+
+            To: foo@example.com
+            From: bar@example.com
+            Subject: example
+
+            an example message
+            """)
+        for subtype in 'rfc822 external-body'.split():
+            with self.subTest(subtype=subtype):
+                m = self._str_msg(template.format(subtype))
+                sub_msg = raw_data_manager.get_content(m)
+                self.assertIsInstance(sub_msg, self.message)
+                self.assertEqual(raw_data_manager.get_content(sub_msg),
+                                 "an example message\n")
+                self.assertEqual(sub_msg['to'], 'foo@example.com')
+                self.assertEqual(sub_msg['from'].addresses[0].username, 'bar')
+
+    def test_get_message_non_rfc822_or_external_body_yields_bytes(self):
+        m = self._str_msg(textwrap.dedent("""\
+            Content-Type: message/partial
+
+            To: foo@example.com
+            From: bar@example.com
+            Subject: example
+
+            The real body is in another message.
+            """))
+        self.assertEqual(raw_data_manager.get_content(m)[:10], b'To: foo@ex')
+
+    def test_set_text_plain(self):
+        m = self._make_message()
+        content = "Simple message.\n"
+        raw_data_manager.set_content(m, content)
+        self.assertEqual(str(m), textwrap.dedent("""\
+            Content-Type: text/plain; charset="utf-8"
+            Content-Transfer-Encoding: 7bit
+
+            Simple message.
+            """))
+        self.assertEqual(m.get_payload(decode=True).decode('utf-8'), content)
+        self.assertEqual(m.get_content(), content)
+
+    def test_set_text_html(self):
+        m = self._make_message()
+        content = "<p>Simple message.</p>\n"
+        raw_data_manager.set_content(m, content, subtype='html')
+        self.assertEqual(str(m), textwrap.dedent("""\
+            Content-Type: text/html; charset="utf-8"
+            Content-Transfer-Encoding: 7bit
+
+            <p>Simple message.</p>
+            """))
+        self.assertEqual(m.get_payload(decode=True).decode('utf-8'), content)
+        self.assertEqual(m.get_content(), content)
+
+    def test_set_text_charset_latin_1(self):
+        m = self._make_message()
+        content = "Simple message.\n"
+        raw_data_manager.set_content(m, content, charset='latin-1')
+        self.assertEqual(str(m), textwrap.dedent("""\
+            Content-Type: text/plain; charset="iso-8859-1"
+            Content-Transfer-Encoding: 7bit
+
+            Simple message.
+            """))
+        self.assertEqual(m.get_payload(decode=True).decode('utf-8'), content)
+        self.assertEqual(m.get_content(), content)
+
+    def test_set_text_short_line_minimal_non_ascii_heuristics(self):
+        m = self._make_message()
+        content = "et là il est monté sur moi et il commence à m'éto.\n"
+        raw_data_manager.set_content(m, content)
+        self.assertEqual(bytes(m), textwrap.dedent("""\
+            Content-Type: text/plain; charset="utf-8"
+            Content-Transfer-Encoding: 8bit
+
+            et là il est monté sur moi et il commence à m'éto.
+            """).encode('utf-8'))
+        self.assertEqual(m.get_payload(decode=True).decode('utf-8'), content)
+        self.assertEqual(m.get_content(), content)
+
+    def test_set_text_long_line_minimal_non_ascii_heuristics(self):
+        m = self._make_message()
+        content = ("j'ai un problème de python. il est sorti de son"
+                   " vivarium.  et là il est monté sur moi et il commence"
+                   " à m'éto.\n")
+        raw_data_manager.set_content(m, content)
+        self.assertEqual(bytes(m), textwrap.dedent("""\
+            Content-Type: text/plain; charset="utf-8"
+            Content-Transfer-Encoding: quoted-printable
+
+            j'ai un probl=C3=A8me de python. il est sorti de son vivari=
+            um.  et l=C3=A0 il est mont=C3=A9 sur moi et il commence =
+            =C3=A0 m'=C3=A9to.
+            """).encode('utf-8'))
+        self.assertEqual(m.get_payload(decode=True).decode('utf-8'), content)
+        self.assertEqual(m.get_content(), content)
+
+    def test_set_text_11_lines_long_line_minimal_non_ascii_heuristics(self):
+        m = self._make_message()
+        content = '\n'*10 + (
+                  "j'ai un problème de python. il est sorti de son"
+                  " vivarium.  et là il est monté sur moi et il commence"
+                  " à m'éto.\n")
+        raw_data_manager.set_content(m, content)
+        self.assertEqual(bytes(m), textwrap.dedent("""\
+            Content-Type: text/plain; charset="utf-8"
+            Content-Transfer-Encoding: quoted-printable
+            """ + '\n'*10 + """
+            j'ai un probl=C3=A8me de python. il est sorti de son vivari=
+            um.  et l=C3=A0 il est mont=C3=A9 sur moi et il commence =
+            =C3=A0 m'=C3=A9to.
+            """).encode('utf-8'))
+        self.assertEqual(m.get_payload(decode=True).decode('utf-8'), content)
+        self.assertEqual(m.get_content(), content)
+
+    def test_set_text_maximal_non_ascii_heuristics(self):
+        m = self._make_message()
+        content = "áàäéèęöő.\n"
+        raw_data_manager.set_content(m, content)
+        self.assertEqual(bytes(m), textwrap.dedent("""\
+            Content-Type: text/plain; charset="utf-8"
+            Content-Transfer-Encoding: 8bit
+
+            áàäéèęöő.
+            """).encode('utf-8'))
+        self.assertEqual(m.get_payload(decode=True).decode('utf-8'), content)
+        self.assertEqual(m.get_content(), content)
+
+    def test_set_text_11_lines_maximal_non_ascii_heuristics(self):
+        m = self._make_message()
+        content = '\n'*10 + "áàäéèęöő.\n"
+        raw_data_manager.set_content(m, content)
+        self.assertEqual(bytes(m), textwrap.dedent("""\
+            Content-Type: text/plain; charset="utf-8"
+            Content-Transfer-Encoding: 8bit
+            """ + '\n'*10 + """
+            áàäéèęöő.
+            """).encode('utf-8'))
+        self.assertEqual(m.get_payload(decode=True).decode('utf-8'), content)
+        self.assertEqual(m.get_content(), content)
+
+    def test_set_text_long_line_maximal_non_ascii_heuristics(self):
+        m = self._make_message()
+        content = ("áàäéèęöőáàäéèęöőáàäéèęöőáàäéèęöő"
+                   "áàäéèęöőáàäéèęöőáàäéèęöőáàäéèęöő"
+                   "áàäéèęöőáàäéèęöőáàäéèęöőáàäéèęöő.\n")
+        raw_data_manager.set_content(m, content)
+        self.assertEqual(bytes(m), textwrap.dedent("""\
+            Content-Type: text/plain; charset="utf-8"
+            Content-Transfer-Encoding: base64
+
+            w6HDoMOkw6nDqMSZw7bFkcOhw6DDpMOpw6jEmcO2xZHDocOgw6TDqcOoxJnD
+            tsWRw6HDoMOkw6nDqMSZw7bFkcOhw6DDpMOpw6jEmcO2xZHDocOgw6TDqcOo
+            xJnDtsWRw6HDoMOkw6nDqMSZw7bFkcOhw6DDpMOpw6jEmcO2xZHDocOgw6TD
+            qcOoxJnDtsWRw6HDoMOkw6nDqMSZw7bFkcOhw6DDpMOpw6jEmcO2xZHDocOg
+            w6TDqcOoxJnDtsWRLgo=
+            """).encode('utf-8'))
+        self.assertEqual(m.get_payload(decode=True).decode('utf-8'), content)
+        self.assertEqual(m.get_content(), content)
+
+    def test_set_text_11_lines_long_line_maximal_non_ascii_heuristics(self):
+        # Yes, it chooses "wrong" here.  It's a heuristic.  So this result
+        # could change if we come up with a better heuristic.
+        m = self._make_message()
+        content = ('\n'*10 +
+                   "áàäéèęöőáàäéèęöőáàäéèęöőáàäéèęöő"
+                   "áàäéèęöőáàäéèęöőáàäéèęöőáàäéèęöő"
+                   "áàäéèęöőáàäéèęöőáàäéèęöőáàäéèęöő.\n")
+        raw_data_manager.set_content(m, "\n"*10 +
+                                        "áàäéèęöőáàäéèęöőáàäéèęöőáàäéèęöő"
+                                        "áàäéèęöőáàäéèęöőáàäéèęöőáàäéèęöő"
+                                        "áàäéèęöőáàäéèęöőáàäéèęöőáàäéèęöő.\n")
+        self.assertEqual(bytes(m), textwrap.dedent("""\
+            Content-Type: text/plain; charset="utf-8"
+            Content-Transfer-Encoding: quoted-printable
+            """ + '\n'*10 + """
+            =C3=A1=C3=A0=C3=A4=C3=A9=C3=A8=C4=99=C3=B6=C5=91=C3=A1=C3=
+            =A0=C3=A4=C3=A9=C3=A8=C4=99=C3=B6=C5=91=C3=A1=C3=A0=C3=A4=
+            =C3=A9=C3=A8=C4=99=C3=B6=C5=91=C3=A1=C3=A0=C3=A4=C3=A9=C3=
+            =A8=C4=99=C3=B6=C5=91=C3=A1=C3=A0=C3=A4=C3=A9=C3=A8=C4=99=
+            =C3=B6=C5=91=C3=A1=C3=A0=C3=A4=C3=A9=C3=A8=C4=99=C3=B6=C5=
+            =91=C3=A1=C3=A0=C3=A4=C3=A9=C3=A8=C4=99=C3=B6=C5=91=C3=A1=
+            =C3=A0=C3=A4=C3=A9=C3=A8=C4=99=C3=B6=C5=91=C3=A1=C3=A0=C3=
+            =A4=C3=A9=C3=A8=C4=99=C3=B6=C5=91=C3=A1=C3=A0=C3=A4=C3=A9=
+            =C3=A8=C4=99=C3=B6=C5=91=C3=A1=C3=A0=C3=A4=C3=A9=C3=A8=C4=
+            =99=C3=B6=C5=91=C3=A1=C3=A0=C3=A4=C3=A9=C3=A8=C4=99=C3=B6=
+            =C5=91.
+            """).encode('utf-8'))
+        self.assertEqual(m.get_payload(decode=True).decode('utf-8'), content)
+        self.assertEqual(m.get_content(), content)
+
+    def test_set_text_non_ascii_with_cte_7bit_raises(self):
+        m = self._make_message()
+        with self.assertRaises(UnicodeError):
+            raw_data_manager.set_content(m,"áàäéèęöő.\n", cte='7bit')
+
+    def test_set_text_non_ascii_with_charset_ascii_raises(self):
+        m = self._make_message()
+        with self.assertRaises(UnicodeError):
+            raw_data_manager.set_content(m,"áàäéèęöő.\n", charset='ascii')
+
+    def test_set_text_non_ascii_with_cte_7bit_and_charset_ascii_raises(self):
+        m = self._make_message()
+        with self.assertRaises(UnicodeError):
+            raw_data_manager.set_content(m,"áàäéèęöő.\n", cte='7bit', charset='ascii')
+
+    def test_set_message(self):
+        m = self._make_message()
+        m['Subject'] = "Forwarded message"
+        content = self._make_message()
+        content['To'] = 'python@vivarium.org'
+        content['From'] = 'police@monty.org'
+        content['Subject'] = "get back in your box"
+        content.set_content("Or face the comfy chair.")
+        raw_data_manager.set_content(m, content)
+        self.assertEqual(str(m), textwrap.dedent("""\
+            Subject: Forwarded message
+            Content-Type: message/rfc822
+            Content-Transfer-Encoding: 8bit
+
+            To: python@vivarium.org
+            From: police@monty.org
+            Subject: get back in your box
+            Content-Type: text/plain; charset="utf-8"
+            Content-Transfer-Encoding: 7bit
+            MIME-Version: 1.0
+
+            Or face the comfy chair.
+            """))
+        payload = m.get_payload(0)
+        self.assertIsInstance(payload, self.message)
+        self.assertEqual(str(payload), str(content))
+        self.assertIsInstance(m.get_content(), self.message)
+        self.assertEqual(str(m.get_content()), str(content))
+
+    def test_set_message_with_non_ascii_and_coercion_to_7bit(self):
+        m = self._make_message()
+        m['Subject'] = "Escape report"
+        content = self._make_message()
+        content['To'] = 'police@monty.org'
+        content['From'] = 'victim@monty.org'
+        content['Subject'] = "Help"
+        content.set_content("j'ai un problème de python. il est sorti de son"
+                            " vivarium.")
+        raw_data_manager.set_content(m, content)
+        self.assertEqual(bytes(m), textwrap.dedent("""\
+            Subject: Escape report
+            Content-Type: message/rfc822
+            Content-Transfer-Encoding: 8bit
+
+            To: police@monty.org
+            From: victim@monty.org
+            Subject: Help
+            Content-Type: text/plain; charset="utf-8"
+            Content-Transfer-Encoding: 8bit
+            MIME-Version: 1.0
+
+            j'ai un problème de python. il est sorti de son vivarium.
+            """).encode('utf-8'))
+        # The choice of base64 for the body encoding is because generator
+        # doesn't bother with heuristics and uses it unconditionally for utf-8
+        # text.
+        # XXX: the first cte should be 7bit, too...that's a generator bug.
+        # XXX: the line length in the body also looks like a generator bug.
+        self.assertEqual(m.as_string(maxheaderlen=self.policy.max_line_length),
+                         textwrap.dedent("""\
+            Subject: Escape report
+            Content-Type: message/rfc822
+            Content-Transfer-Encoding: 8bit
+
+            To: police@monty.org
+            From: victim@monty.org
+            Subject: Help
+            Content-Type: text/plain; charset="utf-8"
+            Content-Transfer-Encoding: base64
+            MIME-Version: 1.0
+
+            aidhaSB1biBwcm9ibMOobWUgZGUgcHl0aG9uLiBpbCBlc3Qgc29ydGkgZGUgc29uIHZpdmFyaXVt
+            Lgo=
+            """))
+        self.assertIsInstance(m.get_content(), self.message)
+        self.assertEqual(str(m.get_content()), str(content))
+
+    def test_set_message_invalid_cte_raises(self):
+        m = self._make_message()
+        content = self._make_message()
+        for cte in 'quoted-printable base64'.split():
+            for subtype in 'rfc822 external-body'.split():
+                with self.subTest(cte=cte, subtype=subtype):
+                    with self.assertRaises(ValueError) as ar:
+                        m.set_content(content, subtype, cte=cte)
+                    exc = str(ar.exception)
+                    self.assertIn(cte, exc)
+                    self.assertIn(subtype, exc)
+        subtype = 'external-body'
+        for cte in '8bit binary'.split():
+            with self.subTest(cte=cte, subtype=subtype):
+                with self.assertRaises(ValueError) as ar:
+                    m.set_content(content, subtype, cte=cte)
+                exc = str(ar.exception)
+                self.assertIn(cte, exc)
+                self.assertIn(subtype, exc)
+
+    def test_set_image_jpg(self):
+        for content in (b"bogus content",
+                        bytearray(b"bogus content"),
+                        memoryview(b"bogus content")):
+            with self.subTest(content=content):
+                m = self._make_message()
+                raw_data_manager.set_content(m, content, 'image', 'jpeg')
+                self.assertEqual(str(m), textwrap.dedent("""\
+                    Content-Type: image/jpeg
+                    Content-Transfer-Encoding: base64
+
+                    Ym9ndXMgY29udGVudA==
+                    """))
+                self.assertEqual(m.get_payload(decode=True), content)
+                self.assertEqual(m.get_content(), content)
+
+    def test_set_audio_aif_with_quoted_printable_cte(self):
+        # Why you would use qp, I don't know, but it is technically supported.
+        # XXX: the incorrect line length is because binascii.b2a_qp doesn't
+        # support a line length parameter, but we must use it to get newline
+        # encoding.
+        # XXX: what about that lack of tailing newline?  Do we actually handle
+        # that correctly in all cases?  That is, if the *source* has an
+        # unencoded newline, do we add an extra newline to the returned payload
+        # or not?  And can that actually be disambiguated based on the RFC?
+        m = self._make_message()
+        content = b'b\xFFgus\tcon\nt\rent ' + b'z'*100
+        m.set_content(content, 'audio', 'aif', cte='quoted-printable')
+        self.assertEqual(bytes(m), textwrap.dedent("""\
+            Content-Type: audio/aif
+            Content-Transfer-Encoding: quoted-printable
+            MIME-Version: 1.0
+
+            b=FFgus=09con=0At=0Dent=20zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz=
+            zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz""").encode('latin-1'))
+        self.assertEqual(m.get_payload(decode=True), content)
+        self.assertEqual(m.get_content(), content)
+
+    def test_set_video_mpeg_with_binary_cte(self):
+        m = self._make_message()
+        content = b'b\xFFgus\tcon\nt\rent ' + b'z'*100
+        m.set_content(content, 'video', 'mpeg', cte='binary')
+        self.assertEqual(bytes(m), textwrap.dedent("""\
+            Content-Type: video/mpeg
+            Content-Transfer-Encoding: binary
+            MIME-Version: 1.0
+
+            """).encode('ascii') +
+            # XXX: the second \n ought to be a \r, but generator gets it wrong.
+            # THIS MEANS WE DON'T ACTUALLY SUPPORT THE 'binary' CTE.
+            b'b\xFFgus\tcon\nt\nent zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz' +
+            b'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz')
+        self.assertEqual(m.get_payload(decode=True), content)
+        self.assertEqual(m.get_content(), content)
+
+    def test_set_application_octet_stream_with_8bit_cte(self):
+        # In 8bit mode, univeral line end logic applies.  It is up to the
+        # application to make sure the lines are short enough; we don't check.
+        m = self._make_message()
+        content = b'b\xFFgus\tcon\nt\rent\n' + b'z'*60 + b'\n'
+        m.set_content(content, 'application', 'octet-stream', cte='8bit')
+        self.assertEqual(bytes(m), textwrap.dedent("""\
+            Content-Type: application/octet-stream
+            Content-Transfer-Encoding: 8bit
+            MIME-Version: 1.0
+
+            """).encode('ascii') +
+            b'b\xFFgus\tcon\nt\nent\n' +
+            b'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\n')
+        self.assertEqual(m.get_payload(decode=True), content)
+        self.assertEqual(m.get_content(), content)
+
+    def test_set_headers_from_header_objects(self):
+        m = self._make_message()
+        content = "Simple message.\n"
+        header_factory = self.policy.header_factory
+        raw_data_manager.set_content(m, content, headers=(
+            header_factory("To", "foo@example.com"),
+            header_factory("From", "foo@example.com"),
+            header_factory("Subject", "I'm talking to myself.")))
+        self.assertEqual(str(m), textwrap.dedent("""\
+            Content-Type: text/plain; charset="utf-8"
+            To: foo@example.com
+            From: foo@example.com
+            Subject: I'm talking to myself.
+            Content-Transfer-Encoding: 7bit
+
+            Simple message.
+            """))
+
+    def test_set_headers_from_strings(self):
+        m = self._make_message()
+        content = "Simple message.\n"
+        raw_data_manager.set_content(m, content, headers=(
+            "X-Foo-Header: foo",
+            "X-Bar-Header: bar",))
+        self.assertEqual(str(m), textwrap.dedent("""\
+            Content-Type: text/plain; charset="utf-8"
+            X-Foo-Header: foo
+            X-Bar-Header: bar
+            Content-Transfer-Encoding: 7bit
+
+            Simple message.
+            """))
+
+    def test_set_headers_with_invalid_duplicate_string_header_raises(self):
+        m = self._make_message()
+        content = "Simple message.\n"
+        with self.assertRaisesRegex(ValueError, 'Content-Type'):
+            raw_data_manager.set_content(m, content, headers=(
+                "Content-Type: foo/bar",)
+                )
+
+    def test_set_headers_with_invalid_duplicate_header_header_raises(self):
+        m = self._make_message()
+        content = "Simple message.\n"
+        header_factory = self.policy.header_factory
+        with self.assertRaisesRegex(ValueError, 'Content-Type'):
+            raw_data_manager.set_content(m, content, headers=(
+                header_factory("Content-Type", " foo/bar"),)
+                )
+
+    def test_set_headers_with_defective_string_header_raises(self):
+        m = self._make_message()
+        content = "Simple message.\n"
+        with self.assertRaisesRegex(ValueError, 'a@fairly@@invalid@address'):
+            raw_data_manager.set_content(m, content, headers=(
+                'To: a@fairly@@invalid@address',)
+                )
+            print(m['To'].defects)
+
+    def test_set_headers_with_defective_header_header_raises(self):
+        m = self._make_message()
+        content = "Simple message.\n"
+        header_factory = self.policy.header_factory
+        with self.assertRaisesRegex(ValueError, 'a@fairly@@invalid@address'):
+            raw_data_manager.set_content(m, content, headers=(
+                header_factory('To', 'a@fairly@@invalid@address'),)
+                )
+            print(m['To'].defects)
+
+    def test_set_disposition_inline(self):
+        m = self._make_message()
+        m.set_content('foo', disposition='inline')
+        self.assertEqual(m['Content-Disposition'], 'inline')
+
+    def test_set_disposition_attachment(self):
+        m = self._make_message()
+        m.set_content('foo', disposition='attachment')
+        self.assertEqual(m['Content-Disposition'], 'attachment')
+
+    def test_set_disposition_foo(self):
+        m = self._make_message()
+        m.set_content('foo', disposition='foo')
+        self.assertEqual(m['Content-Disposition'], 'foo')
+
+    # XXX: we should have a 'strict' policy mode (beyond raise_on_defect) that
+    # would cause 'foo' above to raise.
+
+    def test_set_filename(self):
+        m = self._make_message()
+        m.set_content('foo', filename='bar.txt')
+        self.assertEqual(m['Content-Disposition'],
+                         'attachment; filename="bar.txt"')
+
+    def test_set_filename_and_disposition_inline(self):
+        m = self._make_message()
+        m.set_content('foo', disposition='inline', filename='bar.txt')
+        self.assertEqual(m['Content-Disposition'], 'inline; filename="bar.txt"')
+
+    def test_set_non_ascii_filename(self):
+        m = self._make_message()
+        m.set_content('foo', filename='ábárî.txt')
+        self.assertEqual(bytes(m), textwrap.dedent("""\
+            Content-Type: text/plain; charset="utf-8"
+            Content-Transfer-Encoding: 7bit
+            Content-Disposition: attachment;
+             filename*=utf-8''%C3%A1b%C3%A1r%C3%AE.txt
+            MIME-Version: 1.0
+
+            foo
+            """).encode('ascii'))
+
+    content_object_params = {
+        'text_plain': ('content', ()),
+        'text_html': ('content', ('html',)),
+        'application_octet_stream': (b'content',
+                                     ('application', 'octet_stream')),
+        'image_jpeg': (b'content', ('image', 'jpeg')),
+        'message_rfc822': (message(), ()),
+        'message_external_body': (message(), ('external-body',)),
+        }
+
+    def content_object_as_header_receiver(self, obj, mimetype):
+        m = self._make_message()
+        m.set_content(obj, *mimetype, headers=(
+            'To: foo@example.com',
+            'From: bar@simple.net'))
+        self.assertEqual(m['to'], 'foo@example.com')
+        self.assertEqual(m['from'], 'bar@simple.net')
+
+    def content_object_as_disposition_inline_receiver(self, obj, mimetype):
+        m = self._make_message()
+        m.set_content(obj, *mimetype, disposition='inline')
+        self.assertEqual(m['Content-Disposition'], 'inline')
+
+    def content_object_as_non_ascii_filename_receiver(self, obj, mimetype):
+        m = self._make_message()
+        m.set_content(obj, *mimetype, disposition='inline', filename='bár.txt')
+        self.assertEqual(m['Content-Disposition'], 'inline; filename="bár.txt"')
+        self.assertEqual(m.get_filename(), "bár.txt")
+        self.assertEqual(m['Content-Disposition'].params['filename'], "bár.txt")
+
+    def content_object_as_cid_receiver(self, obj, mimetype):
+        m = self._make_message()
+        m.set_content(obj, *mimetype, cid='some_random_stuff')
+        self.assertEqual(m['Content-ID'], 'some_random_stuff')
+
+    def content_object_as_params_receiver(self, obj, mimetype):
+        m = self._make_message()
+        params = {'foo': 'bár', 'abc': 'xyz'}
+        m.set_content(obj, *mimetype, params=params)
+        if isinstance(obj, str):
+            params['charset'] = 'utf-8'
+        self.assertEqual(m['Content-Type'].params, params)
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Lib/test/test_email/test_email.py b/Lib/test/test_email/test_email.py
index 51fe756..227110f 100644
--- a/Lib/test/test_email/test_email.py
+++ b/Lib/test/test_email/test_email.py
@@ -10,6 +10,7 @@
 
 from io import StringIO, BytesIO
 from itertools import chain
+from random import choice
 
 import email
 import email.policy
@@ -124,6 +125,14 @@
         msg.set_payload([])
         self.assertEqual(msg.get_payload(), [])
 
+    def test_attach_when_payload_is_string(self):
+        msg = Message()
+        msg['Content-Type'] = 'multipart/mixed'
+        msg.set_payload('string payload')
+        sub_msg = MIMEMessage(Message())
+        self.assertRaisesRegex(TypeError, "[Aa]ttach.*non-multipart",
+                               msg.attach, sub_msg)
+
     def test_get_charsets(self):
         eq = self.assertEqual
 
@@ -281,15 +290,42 @@
         self.assertIn('TO', msg)
 
     def test_as_string(self):
-        eq = self.ndiffAssertEqual
         msg = self._msgobj('msg_01.txt')
         with openfile('msg_01.txt') as fp:
             text = fp.read()
-        eq(text, str(msg))
+        self.assertEqual(text, str(msg))
         fullrepr = msg.as_string(unixfrom=True)
         lines = fullrepr.split('\n')
         self.assertTrue(lines[0].startswith('From '))
-        eq(text, NL.join(lines[1:]))
+        self.assertEqual(text, NL.join(lines[1:]))
+
+    def test_as_string_policy(self):
+        msg = self._msgobj('msg_01.txt')
+        newpolicy = msg.policy.clone(linesep='\r\n')
+        fullrepr = msg.as_string(policy=newpolicy)
+        s = StringIO()
+        g = Generator(s, policy=newpolicy)
+        g.flatten(msg)
+        self.assertEqual(fullrepr, s.getvalue())
+
+    def test_as_bytes(self):
+        msg = self._msgobj('msg_01.txt')
+        with openfile('msg_01.txt') as fp:
+            data = fp.read().encode('ascii')
+        self.assertEqual(data, bytes(msg))
+        fullrepr = msg.as_bytes(unixfrom=True)
+        lines = fullrepr.split(b'\n')
+        self.assertTrue(lines[0].startswith(b'From '))
+        self.assertEqual(data, b'\n'.join(lines[1:]))
+
+    def test_as_bytes_policy(self):
+        msg = self._msgobj('msg_01.txt')
+        newpolicy = msg.policy.clone(linesep='\r\n')
+        fullrepr = msg.as_bytes(policy=newpolicy)
+        s = BytesIO()
+        g = BytesGenerator(s,policy=newpolicy)
+        g.flatten(msg)
+        self.assertEqual(fullrepr, s.getvalue())
 
     # test_headerregistry.TestContentTypeHeader.bad_params
     def test_bad_param(self):
@@ -742,8 +778,15 @@
         # whose output character set is 7bit gets a transfer-encoding
         # of 7bit.
         eq = self.assertEqual
-        msg = MIMEText('文', _charset='euc-jp')
+        msg = MIMEText('文\n', _charset='euc-jp')
         eq(msg['content-transfer-encoding'], '7bit')
+        eq(msg.as_string(), textwrap.dedent("""\
+            MIME-Version: 1.0
+            Content-Type: text/plain; charset="iso-2022-jp"
+            Content-Transfer-Encoding: 7bit
+
+            \x1b$BJ8\x1b(B
+            """))
 
     def test_qp_encode_latin1(self):
         msg = MIMEText('\xe1\xf6\n', 'text', 'ISO-8859-1')
@@ -3311,16 +3354,77 @@
             bsf.push(il)
             nt += n
             n1 = 0
-            while True:
-                ol = bsf.readline()
-                if ol == NeedMoreData:
-                    break
+            for ol in iter(bsf.readline, NeedMoreData):
                 om.append(ol)
                 n1 += 1
             self.assertEqual(n, n1)
         self.assertEqual(len(om), nt)
         self.assertEqual(''.join([il for il, n in imt]), ''.join(om))
 
+    def test_push_random(self):
+        from email.feedparser import BufferedSubFile, NeedMoreData
+
+        n = 10000
+        chunksize = 5
+        chars = 'abcd \t\r\n'
+
+        s = ''.join(choice(chars) for i in range(n)) + '\n'
+        target = s.splitlines(True)
+
+        bsf = BufferedSubFile()
+        lines = []
+        for i in range(0, len(s), chunksize):
+            chunk = s[i:i+chunksize]
+            bsf.push(chunk)
+            lines.extend(iter(bsf.readline, NeedMoreData))
+        self.assertEqual(lines, target)
+
+
+class TestFeedParsers(TestEmailBase):
+
+    def parse(self, chunks):
+        from email.feedparser import FeedParser
+        feedparser = FeedParser()
+        for chunk in chunks:
+            feedparser.feed(chunk)
+        return feedparser.close()
+
+    def test_empty_header_name_handled(self):
+        # Issue 19996
+        msg = self.parse("First: val\n: bad\nSecond: val")
+        self.assertEqual(msg['First'], 'val')
+        self.assertEqual(msg['Second'], 'val')
+
+    def test_newlines(self):
+        m = self.parse(['a:\nb:\rc:\r\nd:\n'])
+        self.assertEqual(m.keys(), ['a', 'b', 'c', 'd'])
+        m = self.parse(['a:\nb:\rc:\r\nd:'])
+        self.assertEqual(m.keys(), ['a', 'b', 'c', 'd'])
+        m = self.parse(['a:\rb', 'c:\n'])
+        self.assertEqual(m.keys(), ['a', 'bc'])
+        m = self.parse(['a:\r', 'b:\n'])
+        self.assertEqual(m.keys(), ['a', 'b'])
+        m = self.parse(['a:\r', '\nb:\n'])
+        self.assertEqual(m.keys(), ['a', 'b'])
+        m = self.parse(['a:\x85b:\u2028c:\n'])
+        self.assertEqual(m.items(), [('a', '\x85'), ('b', '\u2028'), ('c', '')])
+        m = self.parse(['a:\r', 'b:\x85', 'c:\n'])
+        self.assertEqual(m.items(), [('a', ''), ('b', '\x85'), ('c', '')])
+
+    def test_long_lines(self):
+        # Expected peak memory use on 32-bit platform: 6*N*M bytes.
+        M, N = 1000, 20000
+        m = self.parse(['a:b\n\n'] + ['x'*M] * N)
+        self.assertEqual(m.items(), [('a', 'b')])
+        self.assertEqual(m.get_payload(), 'x'*M*N)
+        m = self.parse(['a:b\r\r'] + ['x'*M] * N)
+        self.assertEqual(m.items(), [('a', 'b')])
+        self.assertEqual(m.get_payload(), 'x'*M*N)
+        m = self.parse(['a:b\r\r'] + ['x'*M+'\x85'] * N)
+        self.assertEqual(m.items(), [('a', 'b')])
+        self.assertEqual(m.get_payload(), ('x'*M+'\x85')*N)
+        m = self.parse(['a:\r', 'b: '] + ['x'*M] * N)
+        self.assertEqual(m.items(), [('a', ''), ('b', 'x'*M*N)])
 
 
 class TestParsers(TestEmailBase):
@@ -3348,6 +3452,31 @@
         self.assertIsInstance(msg.get_payload(), str)
         self.assertIsInstance(msg.get_payload(decode=True), bytes)
 
+    def test_bytes_parser_does_not_close_file(self):
+        with openfile('msg_02.txt', 'rb') as fp:
+            email.parser.BytesParser().parse(fp)
+            self.assertFalse(fp.closed)
+
+    def test_bytes_parser_on_exception_does_not_close_file(self):
+        with openfile('msg_15.txt', 'rb') as fp:
+            bytesParser = email.parser.BytesParser
+            self.assertRaises(email.errors.StartBoundaryNotFoundDefect,
+                              bytesParser(policy=email.policy.strict).parse,
+                              fp)
+            self.assertFalse(fp.closed)
+
+    def test_parser_does_not_close_file(self):
+        with openfile('msg_02.txt', 'r') as fp:
+            email.parser.Parser().parse(fp)
+            self.assertFalse(fp.closed)
+
+    def test_parser_on_exception_does_not_close_file(self):
+        with openfile('msg_15.txt', 'r') as fp:
+            parser = email.parser.Parser
+            self.assertRaises(email.errors.StartBoundaryNotFoundDefect,
+                              parser(policy=email.policy.strict).parse, fp)
+            self.assertFalse(fp.closed)
+
     def test_whitespace_continuation(self):
         eq = self.assertEqual
         # This message contains a line after the Subject: header that has only
diff --git a/Lib/test/test_email/test_headerregistry.py b/Lib/test/test_email/test_headerregistry.py
index adaf3e8..55ecdea 100644
--- a/Lib/test/test_email/test_headerregistry.py
+++ b/Lib/test/test_email/test_headerregistry.py
@@ -1,6 +1,7 @@
 import datetime
 import textwrap
 import unittest
+import types
 from email import errors
 from email import policy
 from email.message import Message
@@ -235,6 +236,8 @@
         self.assertEqual(h.maintype, maintype)
         self.assertEqual(h.subtype, subtype)
         self.assertEqual(h.params, parmdict)
+        with self.assertRaises(TypeError):
+            h.params['abc'] = 'xyz'   # params is read-only.
         self.assertDefectsEqual(h.defects, defects)
         self.assertEqual(h, decoded)
         self.assertEqual(h.fold(policy=policy.default), folded)
@@ -661,7 +664,7 @@
             'text/plain; name="ascii_is_the_default"'),
 
         'rfc2231_bad_character_in_charset_parameter_value': (
-            "text/plain; charset*=ascii''utf-8%E2%80%9D",
+            "text/plain; charset*=ascii''utf-8%F1%F2%F3",
             'text/plain',
             'text',
             'plain',
@@ -669,6 +672,18 @@
             [errors.UndecodableBytesDefect],
             'text/plain; charset="utf-8\uFFFD\uFFFD\uFFFD"'),
 
+        'rfc2231_utf_8_in_supposedly_ascii_charset_parameter_value': (
+            "text/plain; charset*=ascii''utf-8%E2%80%9D",
+            'text/plain',
+            'text',
+            'plain',
+            {'charset': 'utf-8”'},
+            [errors.UndecodableBytesDefect],
+            'text/plain; charset="utf-8”"',
+            ),
+            # XXX: if the above were *re*folded, it would get tagged as utf-8
+            # instead of ascii in the param, since it now contains non-ASCII.
+
         'rfc2231_encoded_then_unencoded_segments': (
             ('application/x-foo;'
                 '\tname*0*="us-ascii\'en-us\'My";'
diff --git a/Lib/test/test_email/test_message.py b/Lib/test/test_email/test_message.py
index 8cc3f80..50e1a63 100644
--- a/Lib/test/test_email/test_message.py
+++ b/Lib/test/test_email/test_message.py
@@ -1,6 +1,13 @@
 import unittest
-from email import policy
-from test.test_email import TestEmailBase
+import textwrap
+from email import policy, message_from_string
+from email.message import EmailMessage, MIMEPart
+from test.test_email import TestEmailBase, parameterize
+
+
+# Helper.
+def first(iterable):
+    return next(filter(lambda x: x is not None, iterable), None)
 
 
 class Test(TestEmailBase):
@@ -13,6 +20,764 @@
         with self.assertRaises(ValueError):
             m['To'] = 'xyz@abc'
 
+    def test_rfc2043_auto_decoded_and_emailmessage_used(self):
+        m = message_from_string(textwrap.dedent("""\
+            Subject: Ayons asperges pour le =?utf-8?q?d=C3=A9jeuner?=
+            From: =?utf-8?q?Pep=C3=A9?= Le Pew <pepe@example.com>
+            To: "Penelope Pussycat" <"penelope@example.com">
+            MIME-Version: 1.0
+            Content-Type: text/plain; charset="utf-8"
+
+            sample text
+            """), policy=policy.default)
+        self.assertEqual(m['subject'], "Ayons asperges pour le déjeuner")
+        self.assertEqual(m['from'], "Pepé Le Pew <pepe@example.com>")
+        self.assertIsInstance(m, EmailMessage)
+
+
+@parameterize
+class TestEmailMessageBase:
+
+    policy = policy.default
+
+    # The first argument is a triple (related, html, plain) of indices into the
+    # list returned by 'walk' called on a Message constructed from the third.
+    # The indices indicate which part should match the corresponding part-type
+    # when passed to get_body (ie: the "first" part of that type in the
+    # message).  The second argument is a list of indices into the 'walk' list
+    # of the attachments that should be returned by a call to
+    # 'iter_attachments'.  The third argument is a list of indices into 'walk'
+    # that should be returned by a call to 'iter_parts'.  Note that the first
+    # item returned by 'walk' is the Message itself.
+
+    message_params = {
+
+        'empty_message': (
+            (None, None, 0),
+            (),
+            (),
+            ""),
+
+        'non_mime_plain': (
+            (None, None, 0),
+            (),
+            (),
+            textwrap.dedent("""\
+                To: foo@example.com
+
+                simple text body
+                """)),
+
+        'mime_non_text': (
+            (None, None, None),
+            (),
+            (),
+            textwrap.dedent("""\
+                To: foo@example.com
+                MIME-Version: 1.0
+                Content-Type: image/jpg
+
+                bogus body.
+                """)),
+
+        'plain_html_alternative': (
+            (None, 2, 1),
+            (),
+            (1, 2),
+            textwrap.dedent("""\
+                To: foo@example.com
+                MIME-Version: 1.0
+                Content-Type: multipart/alternative; boundary="==="
+
+                preamble
+
+                --===
+                Content-Type: text/plain
+
+                simple body
+
+                --===
+                Content-Type: text/html
+
+                <p>simple body</p>
+                --===--
+                """)),
+
+        'plain_html_mixed': (
+            (None, 2, 1),
+            (),
+            (1, 2),
+            textwrap.dedent("""\
+                To: foo@example.com
+                MIME-Version: 1.0
+                Content-Type: multipart/mixed; boundary="==="
+
+                preamble
+
+                --===
+                Content-Type: text/plain
+
+                simple body
+
+                --===
+                Content-Type: text/html
+
+                <p>simple body</p>
+
+                --===--
+                """)),
+
+        'plain_html_attachment_mixed': (
+            (None, None, 1),
+            (2,),
+            (1, 2),
+            textwrap.dedent("""\
+                To: foo@example.com
+                MIME-Version: 1.0
+                Content-Type: multipart/mixed; boundary="==="
+
+                --===
+                Content-Type: text/plain
+
+                simple body
+
+                --===
+                Content-Type: text/html
+                Content-Disposition: attachment
+
+                <p>simple body</p>
+
+                --===--
+                """)),
+
+        'html_text_attachment_mixed': (
+            (None, 2, None),
+            (1,),
+            (1, 2),
+            textwrap.dedent("""\
+                To: foo@example.com
+                MIME-Version: 1.0
+                Content-Type: multipart/mixed; boundary="==="
+
+                --===
+                Content-Type: text/plain
+                Content-Disposition: AtTaChment
+
+                simple body
+
+                --===
+                Content-Type: text/html
+
+                <p>simple body</p>
+
+                --===--
+                """)),
+
+        'html_text_attachment_inline_mixed': (
+            (None, 2, 1),
+            (),
+            (1, 2),
+            textwrap.dedent("""\
+                To: foo@example.com
+                MIME-Version: 1.0
+                Content-Type: multipart/mixed; boundary="==="
+
+                --===
+                Content-Type: text/plain
+                Content-Disposition: InLine
+
+                simple body
+
+                --===
+                Content-Type: text/html
+                Content-Disposition: inline
+
+                <p>simple body</p>
+
+                --===--
+                """)),
+
+        # RFC 2387
+        'related': (
+            (0, 1, None),
+            (2,),
+            (1, 2),
+            textwrap.dedent("""\
+                To: foo@example.com
+                MIME-Version: 1.0
+                Content-Type: multipart/related; boundary="==="; type=text/html
+
+                --===
+                Content-Type: text/html
+
+                <p>simple body</p>
+
+                --===
+                Content-Type: image/jpg
+                Content-ID: <image1>
+
+                bogus data
+
+                --===--
+                """)),
+
+        # This message structure will probably never be seen in the wild, but
+        # it proves we distinguish between text parts based on 'start'.  The
+        # content would not, of course, actually work :)
+        'related_with_start': (
+            (0, 2, None),
+            (1,),
+            (1, 2),
+            textwrap.dedent("""\
+                To: foo@example.com
+                MIME-Version: 1.0
+                Content-Type: multipart/related; boundary="==="; type=text/html;
+                 start="<body>"
+
+                --===
+                Content-Type: text/html
+                Content-ID: <include>
+
+                useless text
+
+                --===
+                Content-Type: text/html
+                Content-ID: <body>
+
+                <p>simple body</p>
+                <!--#include file="<include>"-->
+
+                --===--
+                """)),
+
+
+        'mixed_alternative_plain_related': (
+            (3, 4, 2),
+            (6, 7),
+            (1, 6, 7),
+            textwrap.dedent("""\
+                To: foo@example.com
+                MIME-Version: 1.0
+                Content-Type: multipart/mixed; boundary="==="
+
+                --===
+                Content-Type: multipart/alternative; boundary="+++"
+
+                --+++
+                Content-Type: text/plain
+
+                simple body
+
+                --+++
+                Content-Type: multipart/related; boundary="___"
+
+                --___
+                Content-Type: text/html
+
+                <p>simple body</p>
+
+                --___
+                Content-Type: image/jpg
+                Content-ID: <image1@cid>
+
+                bogus jpg body
+
+                --___--
+
+                --+++--
+
+                --===
+                Content-Type: image/jpg
+                Content-Disposition: attachment
+
+                bogus jpg body
+
+                --===
+                Content-Type: image/jpg
+                Content-Disposition: AttacHmenT
+
+                another bogus jpg body
+
+                --===--
+                """)),
+
+        # This structure suggested by Stephen J. Turnbull...may not exist/be
+        # supported in the wild, but we want to support it.
+        'mixed_related_alternative_plain_html': (
+            (1, 4, 3),
+            (6, 7),
+            (1, 6, 7),
+            textwrap.dedent("""\
+                To: foo@example.com
+                MIME-Version: 1.0
+                Content-Type: multipart/mixed; boundary="==="
+
+                --===
+                Content-Type: multipart/related; boundary="+++"
+
+                --+++
+                Content-Type: multipart/alternative; boundary="___"
+
+                --___
+                Content-Type: text/plain
+
+                simple body
+
+                --___
+                Content-Type: text/html
+
+                <p>simple body</p>
+
+                --___--
+
+                --+++
+                Content-Type: image/jpg
+                Content-ID: <image1@cid>
+
+                bogus jpg body
+
+                --+++--
+
+                --===
+                Content-Type: image/jpg
+                Content-Disposition: attachment
+
+                bogus jpg body
+
+                --===
+                Content-Type: image/jpg
+                Content-Disposition: attachment
+
+                another bogus jpg body
+
+                --===--
+                """)),
+
+        # Same thing, but proving we only look at the root part, which is the
+        # first one if there isn't any start parameter.  That is, this is a
+        # broken related.
+        'mixed_related_alternative_plain_html_wrong_order': (
+            (1, None, None),
+            (6, 7),
+            (1, 6, 7),
+            textwrap.dedent("""\
+                To: foo@example.com
+                MIME-Version: 1.0
+                Content-Type: multipart/mixed; boundary="==="
+
+                --===
+                Content-Type: multipart/related; boundary="+++"
+
+                --+++
+                Content-Type: image/jpg
+                Content-ID: <image1@cid>
+
+                bogus jpg body
+
+                --+++
+                Content-Type: multipart/alternative; boundary="___"
+
+                --___
+                Content-Type: text/plain
+
+                simple body
+
+                --___
+                Content-Type: text/html
+
+                <p>simple body</p>
+
+                --___--
+
+                --+++--
+
+                --===
+                Content-Type: image/jpg
+                Content-Disposition: attachment
+
+                bogus jpg body
+
+                --===
+                Content-Type: image/jpg
+                Content-Disposition: attachment
+
+                another bogus jpg body
+
+                --===--
+                """)),
+
+        'message_rfc822': (
+            (None, None, None),
+            (),
+            (),
+            textwrap.dedent("""\
+                To: foo@example.com
+                MIME-Version: 1.0
+                Content-Type: message/rfc822
+
+                To: bar@example.com
+                From: robot@examp.com
+
+                this is a message body.
+                """)),
+
+        'mixed_text_message_rfc822': (
+            (None, None, 1),
+            (2,),
+            (1, 2),
+            textwrap.dedent("""\
+                To: foo@example.com
+                MIME-Version: 1.0
+                Content-Type: multipart/mixed; boundary="==="
+
+                --===
+                Content-Type: text/plain
+
+                Your message has bounced, ser.
+
+                --===
+                Content-Type: message/rfc822
+
+                To: bar@example.com
+                From: robot@examp.com
+
+                this is a message body.
+
+                --===--
+                """)),
+
+         }
+
+    def message_as_get_body(self, body_parts, attachments, parts, msg):
+        m = self._str_msg(msg)
+        allparts = list(m.walk())
+        expected = [None if n is None else allparts[n] for n in body_parts]
+        related = 0; html = 1; plain = 2
+        self.assertEqual(m.get_body(), first(expected))
+        self.assertEqual(m.get_body(preferencelist=(
+                                        'related', 'html', 'plain')),
+                         first(expected))
+        self.assertEqual(m.get_body(preferencelist=('related', 'html')),
+                         first(expected[related:html+1]))
+        self.assertEqual(m.get_body(preferencelist=('related', 'plain')),
+                         first([expected[related], expected[plain]]))
+        self.assertEqual(m.get_body(preferencelist=('html', 'plain')),
+                         first(expected[html:plain+1]))
+        self.assertEqual(m.get_body(preferencelist=['related']),
+                         expected[related])
+        self.assertEqual(m.get_body(preferencelist=['html']), expected[html])
+        self.assertEqual(m.get_body(preferencelist=['plain']), expected[plain])
+        self.assertEqual(m.get_body(preferencelist=('plain', 'html')),
+                         first(expected[plain:html-1:-1]))
+        self.assertEqual(m.get_body(preferencelist=('plain', 'related')),
+                         first([expected[plain], expected[related]]))
+        self.assertEqual(m.get_body(preferencelist=('html', 'related')),
+                         first(expected[html::-1]))
+        self.assertEqual(m.get_body(preferencelist=('plain', 'html', 'related')),
+                         first(expected[::-1]))
+        self.assertEqual(m.get_body(preferencelist=('html', 'plain', 'related')),
+                         first([expected[html],
+                                expected[plain],
+                                expected[related]]))
+
+    def message_as_iter_attachment(self, body_parts, attachments, parts, msg):
+        m = self._str_msg(msg)
+        allparts = list(m.walk())
+        attachments = [allparts[n] for n in attachments]
+        self.assertEqual(list(m.iter_attachments()), attachments)
+
+    def message_as_iter_parts(self, body_parts, attachments, parts, msg):
+        m = self._str_msg(msg)
+        allparts = list(m.walk())
+        parts = [allparts[n] for n in parts]
+        self.assertEqual(list(m.iter_parts()), parts)
+
+    class _TestContentManager:
+        def get_content(self, msg, *args, **kw):
+            return msg, args, kw
+        def set_content(self, msg, *args, **kw):
+            self.msg = msg
+            self.args = args
+            self.kw = kw
+
+    def test_get_content_with_cm(self):
+        m = self._str_msg('')
+        cm = self._TestContentManager()
+        self.assertEqual(m.get_content(content_manager=cm), (m, (), {}))
+        msg, args, kw = m.get_content('foo', content_manager=cm, bar=1, k=2)
+        self.assertEqual(msg, m)
+        self.assertEqual(args, ('foo',))
+        self.assertEqual(kw, dict(bar=1, k=2))
+
+    def test_get_content_default_cm_comes_from_policy(self):
+        p = policy.default.clone(content_manager=self._TestContentManager())
+        m = self._str_msg('', policy=p)
+        self.assertEqual(m.get_content(), (m, (), {}))
+        msg, args, kw = m.get_content('foo', bar=1, k=2)
+        self.assertEqual(msg, m)
+        self.assertEqual(args, ('foo',))
+        self.assertEqual(kw, dict(bar=1, k=2))
+
+    def test_set_content_with_cm(self):
+        m = self._str_msg('')
+        cm = self._TestContentManager()
+        m.set_content(content_manager=cm)
+        self.assertEqual(cm.msg, m)
+        self.assertEqual(cm.args, ())
+        self.assertEqual(cm.kw, {})
+        m.set_content('foo', content_manager=cm, bar=1, k=2)
+        self.assertEqual(cm.msg, m)
+        self.assertEqual(cm.args, ('foo',))
+        self.assertEqual(cm.kw, dict(bar=1, k=2))
+
+    def test_set_content_default_cm_comes_from_policy(self):
+        cm = self._TestContentManager()
+        p = policy.default.clone(content_manager=cm)
+        m = self._str_msg('', policy=p)
+        m.set_content()
+        self.assertEqual(cm.msg, m)
+        self.assertEqual(cm.args, ())
+        self.assertEqual(cm.kw, {})
+        m.set_content('foo', bar=1, k=2)
+        self.assertEqual(cm.msg, m)
+        self.assertEqual(cm.args, ('foo',))
+        self.assertEqual(cm.kw, dict(bar=1, k=2))
+
+    # outcome is whether xxx_method should raise ValueError error when called
+    # on multipart/subtype.  Blank outcome means it depends on xxx (add
+    # succeeds, make raises).  Note: 'none' means there are content-type
+    # headers but payload is None...this happening in practice would be very
+    # unusual, so treating it as if there were content seems reasonable.
+    #    method          subtype           outcome
+    subtype_params = (
+        ('related',      'no_content',     'succeeds'),
+        ('related',      'none',           'succeeds'),
+        ('related',      'plain',          'succeeds'),
+        ('related',      'related',        ''),
+        ('related',      'alternative',    'raises'),
+        ('related',      'mixed',          'raises'),
+        ('alternative',  'no_content',     'succeeds'),
+        ('alternative',  'none',           'succeeds'),
+        ('alternative',  'plain',          'succeeds'),
+        ('alternative',  'related',        'succeeds'),
+        ('alternative',  'alternative',    ''),
+        ('alternative',  'mixed',          'raises'),
+        ('mixed',        'no_content',     'succeeds'),
+        ('mixed',        'none',           'succeeds'),
+        ('mixed',        'plain',          'succeeds'),
+        ('mixed',        'related',        'succeeds'),
+        ('mixed',        'alternative',    'succeeds'),
+        ('mixed',        'mixed',          ''),
+        )
+
+    def _make_subtype_test_message(self, subtype):
+        m = self.message()
+        payload = None
+        msg_headers =  [
+            ('To', 'foo@bar.com'),
+            ('From', 'bar@foo.com'),
+            ]
+        if subtype != 'no_content':
+            ('content-shadow', 'Logrus'),
+        msg_headers.append(('X-Random-Header', 'Corwin'))
+        if subtype == 'text':
+            payload = ''
+            msg_headers.append(('Content-Type', 'text/plain'))
+            m.set_payload('')
+        elif subtype != 'no_content':
+            payload = []
+            msg_headers.append(('Content-Type', 'multipart/' + subtype))
+        msg_headers.append(('X-Trump', 'Random'))
+        m.set_payload(payload)
+        for name, value in msg_headers:
+            m[name] = value
+        return m, msg_headers, payload
+
+    def _check_disallowed_subtype_raises(self, m, method_name, subtype, method):
+        with self.assertRaises(ValueError) as ar:
+            getattr(m, method)()
+        exc_text = str(ar.exception)
+        self.assertIn(subtype, exc_text)
+        self.assertIn(method_name, exc_text)
+
+    def _check_make_multipart(self, m, msg_headers, payload):
+        count = 0
+        for name, value in msg_headers:
+            if not name.lower().startswith('content-'):
+                self.assertEqual(m[name], value)
+                count += 1
+        self.assertEqual(len(m), count+1) # +1 for new Content-Type
+        part = next(m.iter_parts())
+        count = 0
+        for name, value in msg_headers:
+            if name.lower().startswith('content-'):
+                self.assertEqual(part[name], value)
+                count += 1
+        self.assertEqual(len(part), count)
+        self.assertEqual(part.get_payload(), payload)
+
+    def subtype_as_make(self, method, subtype, outcome):
+        m, msg_headers, payload = self._make_subtype_test_message(subtype)
+        make_method = 'make_' + method
+        if outcome in ('', 'raises'):
+            self._check_disallowed_subtype_raises(m, method, subtype, make_method)
+            return
+        getattr(m, make_method)()
+        self.assertEqual(m.get_content_maintype(), 'multipart')
+        self.assertEqual(m.get_content_subtype(), method)
+        if subtype == 'no_content':
+            self.assertEqual(len(m.get_payload()), 0)
+            self.assertEqual(m.items(),
+                             msg_headers + [('Content-Type',
+                                             'multipart/'+method)])
+        else:
+            self.assertEqual(len(m.get_payload()), 1)
+            self._check_make_multipart(m, msg_headers, payload)
+
+    def subtype_as_make_with_boundary(self, method, subtype, outcome):
+        # Doing all variation is a bit of overkill...
+        m = self.message()
+        if outcome in ('', 'raises'):
+            m['Content-Type'] = 'multipart/' + subtype
+            with self.assertRaises(ValueError) as cm:
+                getattr(m, 'make_' + method)()
+            return
+        if subtype == 'plain':
+            m['Content-Type'] = 'text/plain'
+        elif subtype != 'no_content':
+            m['Content-Type'] = 'multipart/' + subtype
+        getattr(m, 'make_' + method)(boundary="abc")
+        self.assertTrue(m.is_multipart())
+        self.assertEqual(m.get_boundary(), 'abc')
+
+    def test_policy_on_part_made_by_make_comes_from_message(self):
+        for method in ('make_related', 'make_alternative', 'make_mixed'):
+            m = self.message(policy=self.policy.clone(content_manager='foo'))
+            m['Content-Type'] = 'text/plain'
+            getattr(m, method)()
+            self.assertEqual(m.get_payload(0).policy.content_manager, 'foo')
+
+    class _TestSetContentManager:
+        def set_content(self, msg, content, *args, **kw):
+            msg['Content-Type'] = 'text/plain'
+            msg.set_payload(content)
+
+    def subtype_as_add(self, method, subtype, outcome):
+        m, msg_headers, payload = self._make_subtype_test_message(subtype)
+        cm = self._TestSetContentManager()
+        add_method = 'add_attachment' if method=='mixed' else 'add_' + method
+        if outcome == 'raises':
+            self._check_disallowed_subtype_raises(m, method, subtype, add_method)
+            return
+        getattr(m, add_method)('test', content_manager=cm)
+        self.assertEqual(m.get_content_maintype(), 'multipart')
+        self.assertEqual(m.get_content_subtype(), method)
+        if method == subtype or subtype == 'no_content':
+            self.assertEqual(len(m.get_payload()), 1)
+            for name, value in msg_headers:
+                self.assertEqual(m[name], value)
+            part = m.get_payload()[0]
+        else:
+            self.assertEqual(len(m.get_payload()), 2)
+            self._check_make_multipart(m, msg_headers, payload)
+            part = m.get_payload()[1]
+        self.assertEqual(part.get_content_type(), 'text/plain')
+        self.assertEqual(part.get_payload(), 'test')
+        if method=='mixed':
+            self.assertEqual(part['Content-Disposition'], 'attachment')
+        elif method=='related':
+            self.assertEqual(part['Content-Disposition'], 'inline')
+        else:
+            # Otherwise we don't guess.
+            self.assertIsNone(part['Content-Disposition'])
+
+    class _TestSetRaisingContentManager:
+        def set_content(self, msg, content, *args, **kw):
+            raise Exception('test')
+
+    def test_default_content_manager_for_add_comes_from_policy(self):
+        cm = self._TestSetRaisingContentManager()
+        m = self.message(policy=self.policy.clone(content_manager=cm))
+        for method in ('add_related', 'add_alternative', 'add_attachment'):
+            with self.assertRaises(Exception) as ar:
+                getattr(m, method)('')
+            self.assertEqual(str(ar.exception), 'test')
+
+    def message_as_clear(self, body_parts, attachments, parts, msg):
+        m = self._str_msg(msg)
+        m.clear()
+        self.assertEqual(len(m), 0)
+        self.assertEqual(list(m.items()), [])
+        self.assertIsNone(m.get_payload())
+        self.assertEqual(list(m.iter_parts()), [])
+
+    def message_as_clear_content(self, body_parts, attachments, parts, msg):
+        m = self._str_msg(msg)
+        expected_headers = [h for h in m.keys()
+                            if not h.lower().startswith('content-')]
+        m.clear_content()
+        self.assertEqual(list(m.keys()), expected_headers)
+        self.assertIsNone(m.get_payload())
+        self.assertEqual(list(m.iter_parts()), [])
+
+    def test_is_attachment(self):
+        m = self._make_message()
+        self.assertFalse(m.is_attachment())
+        with self.assertWarns(DeprecationWarning):
+            self.assertFalse(m.is_attachment)
+        m['Content-Disposition'] = 'inline'
+        self.assertFalse(m.is_attachment())
+        with self.assertWarns(DeprecationWarning):
+            self.assertFalse(m.is_attachment)
+        m.replace_header('Content-Disposition', 'attachment')
+        self.assertTrue(m.is_attachment())
+        with self.assertWarns(DeprecationWarning):
+            self.assertTrue(m.is_attachment)
+        m.replace_header('Content-Disposition', 'AtTachMent')
+        self.assertTrue(m.is_attachment())
+        with self.assertWarns(DeprecationWarning):
+            self.assertTrue(m.is_attachment)
+        m.set_param('filename', 'abc.png', 'Content-Disposition')
+        self.assertTrue(m.is_attachment())
+        with self.assertWarns(DeprecationWarning):
+            self.assertTrue(m.is_attachment)
+
+
+class TestEmailMessage(TestEmailMessageBase, TestEmailBase):
+    message = EmailMessage
+
+    def test_set_content_adds_MIME_Version(self):
+        m = self._str_msg('')
+        cm = self._TestContentManager()
+        self.assertNotIn('MIME-Version', m)
+        m.set_content(content_manager=cm)
+        self.assertEqual(m['MIME-Version'], '1.0')
+
+    class _MIME_Version_adding_CM:
+        def set_content(self, msg, *args, **kw):
+            msg['MIME-Version'] = '1.0'
+
+    def test_set_content_does_not_duplicate_MIME_Version(self):
+        m = self._str_msg('')
+        cm = self._MIME_Version_adding_CM()
+        self.assertNotIn('MIME-Version', m)
+        m.set_content(content_manager=cm)
+        self.assertEqual(m['MIME-Version'], '1.0')
+
+
+class TestMIMEPart(TestEmailMessageBase, TestEmailBase):
+    # Doing the full test run here may seem a bit redundant, since the two
+    # classes are almost identical.  But what if they drift apart?  So we do
+    # the full tests so that any future drift doesn't introduce bugs.
+    message = MIMEPart
+
+    def test_set_content_does_not_add_MIME_Version(self):
+        m = self._str_msg('')
+        cm = self._TestContentManager()
+        self.assertNotIn('MIME-Version', m)
+        m.set_content(content_manager=cm)
+        self.assertNotIn('MIME-Version', m)
+
 
 if __name__ == '__main__':
     unittest.main()
diff --git a/Lib/test/test_email/test_pickleable.py b/Lib/test/test_email/test_pickleable.py
index daa8d25..16b4467 100644
--- a/Lib/test/test_email/test_pickleable.py
+++ b/Lib/test/test_email/test_pickleable.py
@@ -30,9 +30,10 @@
 
     def header_as_pickle(self, name, value):
         header = self.header_factory(name, value)
-        p = pickle.dumps(header)
-        h = pickle.loads(p)
-        self.assertEqual(str(h), str(header))
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            p = pickle.dumps(header, proto)
+            h = pickle.loads(p)
+            self.assertEqual(str(h), str(header))
 
 
 @parameterize
@@ -65,9 +66,10 @@
         self.assertEqual(msg2.as_string(), msg.as_string())
 
     def msg_as_pickle(self, msg):
-        p = pickle.dumps(msg)
-        msg2 = pickle.loads(p)
-        self.assertEqual(msg2.as_string(), msg.as_string())
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            p = pickle.dumps(msg, proto)
+            msg2 = pickle.loads(p)
+            self.assertEqual(msg2.as_string(), msg.as_string())
 
 
 if __name__ == '__main__':
diff --git a/Lib/test/test_email/test_policy.py b/Lib/test/test_email/test_policy.py
index 983bd49..e797f36 100644
--- a/Lib/test/test_email/test_policy.py
+++ b/Lib/test/test_email/test_policy.py
@@ -30,6 +30,7 @@
         'raise_on_defect':          False,
         'header_factory':           email.policy.EmailPolicy.header_factory,
         'refold_source':            'long',
+        'content_manager':          email.policy.EmailPolicy.content_manager,
         })
 
     # For each policy under test, we give here what we expect the defaults to
@@ -318,5 +319,14 @@
         self.assertEqual(msg.as_string(), "Subject: testXTo: fooXX")
 
 
+class TestConcretePolicies(unittest.TestCase):
+
+    def test_header_store_parse_rejects_newlines(self):
+        instance = email.policy.EmailPolicy()
+        self.assertRaises(ValueError,
+                          instance.header_store_parse,
+                          'From', 'spam\negg@foo.py')
+
+
 if __name__ == '__main__':
     unittest.main()
diff --git a/Lib/test/test_email/torture_test.py b/Lib/test/test_email/torture_test.py
index 544b1bb..19cf64f 100644
--- a/Lib/test/test_email/torture_test.py
+++ b/Lib/test/test_email/torture_test.py
@@ -27,7 +27,7 @@
 # Prevent this test from running in the Python distro
 try:
     openfile('crispin-torture.txt')
-except IOError:
+except OSError:
     raise TestSkipped
 
 
diff --git a/Lib/test/test_ensurepip.py b/Lib/test/test_ensurepip.py
new file mode 100644
index 0000000..759168e
--- /dev/null
+++ b/Lib/test/test_ensurepip.py
@@ -0,0 +1,345 @@
+import unittest
+import unittest.mock
+import test.support
+import os
+import os.path
+import contextlib
+import sys
+
+import ensurepip
+import ensurepip._uninstall
+
+# pip currently requires ssl support, so we ensure we handle
+# it being missing (http://bugs.python.org/issue19744)
+ensurepip_no_ssl = test.support.import_fresh_module("ensurepip",
+                                                    blocked=["ssl"])
+try:
+    import ssl
+except ImportError:
+    def requires_usable_pip(f):
+        deco = unittest.skip(ensurepip._MISSING_SSL_MESSAGE)
+        return deco(f)
+else:
+    def requires_usable_pip(f):
+        return f
+
+class TestEnsurePipVersion(unittest.TestCase):
+
+    def test_returns_version(self):
+        self.assertEqual(ensurepip._PIP_VERSION, ensurepip.version())
+
+class EnsurepipMixin:
+
+    def setUp(self):
+        run_pip_patch = unittest.mock.patch("ensurepip._run_pip")
+        self.run_pip = run_pip_patch.start()
+        self.addCleanup(run_pip_patch.stop)
+
+        # Avoid side effects on the actual os module
+        real_devnull = os.devnull
+        os_patch = unittest.mock.patch("ensurepip.os")
+        patched_os = os_patch.start()
+        self.addCleanup(os_patch.stop)
+        patched_os.devnull = real_devnull
+        patched_os.path = os.path
+        self.os_environ = patched_os.environ = os.environ.copy()
+
+
+class TestBootstrap(EnsurepipMixin, unittest.TestCase):
+
+    @requires_usable_pip
+    def test_basic_bootstrapping(self):
+        ensurepip.bootstrap()
+
+        self.run_pip.assert_called_once_with(
+            [
+                "install", "--no-index", "--find-links",
+                unittest.mock.ANY, "setuptools", "pip",
+            ],
+            unittest.mock.ANY,
+        )
+
+        additional_paths = self.run_pip.call_args[0][1]
+        self.assertEqual(len(additional_paths), 2)
+
+    @requires_usable_pip
+    def test_bootstrapping_with_root(self):
+        ensurepip.bootstrap(root="/foo/bar/")
+
+        self.run_pip.assert_called_once_with(
+            [
+                "install", "--no-index", "--find-links",
+                unittest.mock.ANY, "--root", "/foo/bar/",
+                "setuptools", "pip",
+            ],
+            unittest.mock.ANY,
+        )
+
+    @requires_usable_pip
+    def test_bootstrapping_with_user(self):
+        ensurepip.bootstrap(user=True)
+
+        self.run_pip.assert_called_once_with(
+            [
+                "install", "--no-index", "--find-links",
+                unittest.mock.ANY, "--user", "setuptools", "pip",
+            ],
+            unittest.mock.ANY,
+        )
+
+    @requires_usable_pip
+    def test_bootstrapping_with_upgrade(self):
+        ensurepip.bootstrap(upgrade=True)
+
+        self.run_pip.assert_called_once_with(
+            [
+                "install", "--no-index", "--find-links",
+                unittest.mock.ANY, "--upgrade", "setuptools", "pip",
+            ],
+            unittest.mock.ANY,
+        )
+
+    @requires_usable_pip
+    def test_bootstrapping_with_verbosity_1(self):
+        ensurepip.bootstrap(verbosity=1)
+
+        self.run_pip.assert_called_once_with(
+            [
+                "install", "--no-index", "--find-links",
+                unittest.mock.ANY, "-v", "setuptools", "pip",
+            ],
+            unittest.mock.ANY,
+        )
+
+    @requires_usable_pip
+    def test_bootstrapping_with_verbosity_2(self):
+        ensurepip.bootstrap(verbosity=2)
+
+        self.run_pip.assert_called_once_with(
+            [
+                "install", "--no-index", "--find-links",
+                unittest.mock.ANY, "-vv", "setuptools", "pip",
+            ],
+            unittest.mock.ANY,
+        )
+
+    @requires_usable_pip
+    def test_bootstrapping_with_verbosity_3(self):
+        ensurepip.bootstrap(verbosity=3)
+
+        self.run_pip.assert_called_once_with(
+            [
+                "install", "--no-index", "--find-links",
+                unittest.mock.ANY, "-vvv", "setuptools", "pip",
+            ],
+            unittest.mock.ANY,
+        )
+
+    @requires_usable_pip
+    def test_bootstrapping_with_regular_install(self):
+        ensurepip.bootstrap()
+        self.assertEqual(self.os_environ["ENSUREPIP_OPTIONS"], "install")
+
+    @requires_usable_pip
+    def test_bootstrapping_with_alt_install(self):
+        ensurepip.bootstrap(altinstall=True)
+        self.assertEqual(self.os_environ["ENSUREPIP_OPTIONS"], "altinstall")
+
+    @requires_usable_pip
+    def test_bootstrapping_with_default_pip(self):
+        ensurepip.bootstrap(default_pip=True)
+        self.assertNotIn("ENSUREPIP_OPTIONS", self.os_environ)
+
+    def test_altinstall_default_pip_conflict(self):
+        with self.assertRaises(ValueError):
+            ensurepip.bootstrap(altinstall=True, default_pip=True)
+        self.assertFalse(self.run_pip.called)
+
+    @requires_usable_pip
+    def test_pip_environment_variables_removed(self):
+        # ensurepip deliberately ignores all pip environment variables
+        # See http://bugs.python.org/issue19734 for details
+        self.os_environ["PIP_THIS_SHOULD_GO_AWAY"] = "test fodder"
+        ensurepip.bootstrap()
+        self.assertNotIn("PIP_THIS_SHOULD_GO_AWAY", self.os_environ)
+
+    @requires_usable_pip
+    def test_pip_config_file_disabled(self):
+        # ensurepip deliberately ignores the pip config file
+        # See http://bugs.python.org/issue20053 for details
+        ensurepip.bootstrap()
+        self.assertEqual(self.os_environ["PIP_CONFIG_FILE"], os.devnull)
+
+@contextlib.contextmanager
+def fake_pip(version=ensurepip._PIP_VERSION):
+    if version is None:
+        pip = None
+    else:
+        class FakePip():
+            __version__ = version
+        pip = FakePip()
+    sentinel = object()
+    orig_pip = sys.modules.get("pip", sentinel)
+    sys.modules["pip"] = pip
+    try:
+        yield pip
+    finally:
+        if orig_pip is sentinel:
+            del sys.modules["pip"]
+        else:
+            sys.modules["pip"] = orig_pip
+
+class TestUninstall(EnsurepipMixin, unittest.TestCase):
+
+    def test_uninstall_skipped_when_not_installed(self):
+        with fake_pip(None):
+            ensurepip._uninstall_helper()
+        self.assertFalse(self.run_pip.called)
+
+    def test_uninstall_skipped_with_warning_for_wrong_version(self):
+        with fake_pip("not a valid version"):
+            with test.support.captured_stderr() as stderr:
+                ensurepip._uninstall_helper()
+        warning = stderr.getvalue().strip()
+        self.assertIn("only uninstall a matching version", warning)
+        self.assertFalse(self.run_pip.called)
+
+
+    @requires_usable_pip
+    def test_uninstall(self):
+        with fake_pip():
+            ensurepip._uninstall_helper()
+
+        self.run_pip.assert_called_once_with(
+            ["uninstall", "-y", "pip", "setuptools"]
+        )
+
+    @requires_usable_pip
+    def test_uninstall_with_verbosity_1(self):
+        with fake_pip():
+            ensurepip._uninstall_helper(verbosity=1)
+
+        self.run_pip.assert_called_once_with(
+            ["uninstall", "-y", "-v", "pip", "setuptools"]
+        )
+
+    @requires_usable_pip
+    def test_uninstall_with_verbosity_2(self):
+        with fake_pip():
+            ensurepip._uninstall_helper(verbosity=2)
+
+        self.run_pip.assert_called_once_with(
+            ["uninstall", "-y", "-vv", "pip", "setuptools"]
+        )
+
+    @requires_usable_pip
+    def test_uninstall_with_verbosity_3(self):
+        with fake_pip():
+            ensurepip._uninstall_helper(verbosity=3)
+
+        self.run_pip.assert_called_once_with(
+            ["uninstall", "-y", "-vvv", "pip", "setuptools"]
+        )
+
+    @requires_usable_pip
+    def test_pip_environment_variables_removed(self):
+        # ensurepip deliberately ignores all pip environment variables
+        # See http://bugs.python.org/issue19734 for details
+        self.os_environ["PIP_THIS_SHOULD_GO_AWAY"] = "test fodder"
+        with fake_pip():
+            ensurepip._uninstall_helper()
+        self.assertNotIn("PIP_THIS_SHOULD_GO_AWAY", self.os_environ)
+
+    @requires_usable_pip
+    def test_pip_config_file_disabled(self):
+        # ensurepip deliberately ignores the pip config file
+        # See http://bugs.python.org/issue20053 for details
+        with fake_pip():
+            ensurepip._uninstall_helper()
+        self.assertEqual(self.os_environ["PIP_CONFIG_FILE"], os.devnull)
+
+
+class TestMissingSSL(EnsurepipMixin, unittest.TestCase):
+
+    def setUp(self):
+        sys.modules["ensurepip"] = ensurepip_no_ssl
+        @self.addCleanup
+        def restore_module():
+            sys.modules["ensurepip"] = ensurepip
+        super().setUp()
+
+    def test_bootstrap_requires_ssl(self):
+        self.os_environ["PIP_THIS_SHOULD_STAY"] = "test fodder"
+        with self.assertRaisesRegex(RuntimeError, "requires SSL/TLS"):
+            ensurepip_no_ssl.bootstrap()
+        self.assertFalse(self.run_pip.called)
+        self.assertIn("PIP_THIS_SHOULD_STAY", self.os_environ)
+
+    def test_uninstall_requires_ssl(self):
+        self.os_environ["PIP_THIS_SHOULD_STAY"] = "test fodder"
+        with self.assertRaisesRegex(RuntimeError, "requires SSL/TLS"):
+            with fake_pip():
+                ensurepip_no_ssl._uninstall_helper()
+        self.assertFalse(self.run_pip.called)
+        self.assertIn("PIP_THIS_SHOULD_STAY", self.os_environ)
+
+    def test_main_exits_early_with_warning(self):
+        with test.support.captured_stderr() as stderr:
+            ensurepip_no_ssl._main(["--version"])
+        warning = stderr.getvalue().strip()
+        self.assertTrue(warning.endswith("requires SSL/TLS"), warning)
+        self.assertFalse(self.run_pip.called)
+
+# Basic testing of the main functions and their argument parsing
+
+EXPECTED_VERSION_OUTPUT = "pip " + ensurepip._PIP_VERSION
+
+class TestBootstrappingMainFunction(EnsurepipMixin, unittest.TestCase):
+
+    @requires_usable_pip
+    def test_bootstrap_version(self):
+        with test.support.captured_stdout() as stdout:
+            with self.assertRaises(SystemExit):
+                ensurepip._main(["--version"])
+        result = stdout.getvalue().strip()
+        self.assertEqual(result, EXPECTED_VERSION_OUTPUT)
+        self.assertFalse(self.run_pip.called)
+
+    @requires_usable_pip
+    def test_basic_bootstrapping(self):
+        ensurepip._main([])
+
+        self.run_pip.assert_called_once_with(
+            [
+                "install", "--no-index", "--find-links",
+                unittest.mock.ANY, "setuptools", "pip",
+            ],
+            unittest.mock.ANY,
+        )
+
+        additional_paths = self.run_pip.call_args[0][1]
+        self.assertEqual(len(additional_paths), 2)
+
+class TestUninstallationMainFunction(EnsurepipMixin, unittest.TestCase):
+
+    def test_uninstall_version(self):
+        with test.support.captured_stdout() as stdout:
+            with self.assertRaises(SystemExit):
+                ensurepip._uninstall._main(["--version"])
+        result = stdout.getvalue().strip()
+        self.assertEqual(result, EXPECTED_VERSION_OUTPUT)
+        self.assertFalse(self.run_pip.called)
+
+    @requires_usable_pip
+    def test_basic_uninstall(self):
+        with fake_pip():
+            ensurepip._uninstall._main([])
+
+        self.run_pip.assert_called_once_with(
+            ["uninstall", "-y", "pip", "setuptools"]
+        )
+
+
+
+if __name__ == "__main__":
+    test.support.run_unittest(__name__)
diff --git a/Lib/test/test_enum.py b/Lib/test/test_enum.py
new file mode 100644
index 0000000..dccaa4f
--- /dev/null
+++ b/Lib/test/test_enum.py
@@ -0,0 +1,1604 @@
+import enum
+import inspect
+import pydoc
+import unittest
+from collections import OrderedDict
+from enum import Enum, IntEnum, EnumMeta, unique
+from io import StringIO
+from pickle import dumps, loads, PicklingError, HIGHEST_PROTOCOL
+
+# for pickle tests
+try:
+    class Stooges(Enum):
+        LARRY = 1
+        CURLY = 2
+        MOE = 3
+except Exception as exc:
+    Stooges = exc
+
+try:
+    class IntStooges(int, Enum):
+        LARRY = 1
+        CURLY = 2
+        MOE = 3
+except Exception as exc:
+    IntStooges = exc
+
+try:
+    class FloatStooges(float, Enum):
+        LARRY = 1.39
+        CURLY = 2.72
+        MOE = 3.142596
+except Exception as exc:
+    FloatStooges = exc
+
+# for pickle test and subclass tests
+try:
+    class StrEnum(str, Enum):
+        'accepts only string values'
+    class Name(StrEnum):
+        BDFL = 'Guido van Rossum'
+        FLUFL = 'Barry Warsaw'
+except Exception as exc:
+    Name = exc
+
+try:
+    Question = Enum('Question', 'who what when where why', module=__name__)
+except Exception as exc:
+    Question = exc
+
+try:
+    Answer = Enum('Answer', 'him this then there because')
+except Exception as exc:
+    Answer = exc
+
+try:
+    Theory = Enum('Theory', 'rule law supposition', qualname='spanish_inquisition')
+except Exception as exc:
+    Theory = exc
+
+# for doctests
+try:
+    class Fruit(Enum):
+        tomato = 1
+        banana = 2
+        cherry = 3
+except Exception:
+    pass
+
+def test_pickle_dump_load(assertion, source, target=None,
+        *, protocol=(0, HIGHEST_PROTOCOL)):
+    start, stop = protocol
+    if target is None:
+        target = source
+    for protocol in range(start, stop+1):
+        assertion(loads(dumps(source, protocol=protocol)), target)
+
+def test_pickle_exception(assertion, exception, obj,
+        *, protocol=(0, HIGHEST_PROTOCOL)):
+    start, stop = protocol
+    for protocol in range(start, stop+1):
+        with assertion(exception):
+            dumps(obj, protocol=protocol)
+
+class TestHelpers(unittest.TestCase):
+    # _is_descriptor, _is_sunder, _is_dunder
+
+    def test_is_descriptor(self):
+        class foo:
+            pass
+        for attr in ('__get__','__set__','__delete__'):
+            obj = foo()
+            self.assertFalse(enum._is_descriptor(obj))
+            setattr(obj, attr, 1)
+            self.assertTrue(enum._is_descriptor(obj))
+
+    def test_is_sunder(self):
+        for s in ('_a_', '_aa_'):
+            self.assertTrue(enum._is_sunder(s))
+
+        for s in ('a', 'a_', '_a', '__a', 'a__', '__a__', '_a__', '__a_', '_',
+                '__', '___', '____', '_____',):
+            self.assertFalse(enum._is_sunder(s))
+
+    def test_is_dunder(self):
+        for s in ('__a__', '__aa__'):
+            self.assertTrue(enum._is_dunder(s))
+        for s in ('a', 'a_', '_a', '__a', 'a__', '_a_', '_a__', '__a_', '_',
+                '__', '___', '____', '_____',):
+            self.assertFalse(enum._is_dunder(s))
+
+
+class TestEnum(unittest.TestCase):
+
+    def setUp(self):
+        class Season(Enum):
+            SPRING = 1
+            SUMMER = 2
+            AUTUMN = 3
+            WINTER = 4
+        self.Season = Season
+
+        class Konstants(float, Enum):
+            E = 2.7182818
+            PI = 3.1415926
+            TAU = 2 * PI
+        self.Konstants = Konstants
+
+        class Grades(IntEnum):
+            A = 5
+            B = 4
+            C = 3
+            D = 2
+            F = 0
+        self.Grades = Grades
+
+        class Directional(str, Enum):
+            EAST = 'east'
+            WEST = 'west'
+            NORTH = 'north'
+            SOUTH = 'south'
+        self.Directional = Directional
+
+        from datetime import date
+        class Holiday(date, Enum):
+            NEW_YEAR = 2013, 1, 1
+            IDES_OF_MARCH = 2013, 3, 15
+        self.Holiday = Holiday
+
+    def test_dir_on_class(self):
+        Season = self.Season
+        self.assertEqual(
+            set(dir(Season)),
+            set(['__class__', '__doc__', '__members__', '__module__',
+                'SPRING', 'SUMMER', 'AUTUMN', 'WINTER']),
+            )
+
+    def test_dir_on_item(self):
+        Season = self.Season
+        self.assertEqual(
+            set(dir(Season.WINTER)),
+            set(['__class__', '__doc__', '__module__', 'name', 'value']),
+            )
+
+    def test_dir_with_added_behavior(self):
+        class Test(Enum):
+            this = 'that'
+            these = 'those'
+            def wowser(self):
+                return ("Wowser! I'm %s!" % self.name)
+        self.assertEqual(
+                set(dir(Test)),
+                set(['__class__', '__doc__', '__members__', '__module__', 'this', 'these']),
+                )
+        self.assertEqual(
+                set(dir(Test.this)),
+                set(['__class__', '__doc__', '__module__', 'name', 'value', 'wowser']),
+                )
+
+    def test_dir_on_sub_with_behavior_on_super(self):
+        # see issue22506
+        class SuperEnum(Enum):
+            def invisible(self):
+                return "did you see me?"
+        class SubEnum(SuperEnum):
+            sample = 5
+        self.assertEqual(
+                set(dir(SubEnum.sample)),
+                set(['__class__', '__doc__', '__module__', 'name', 'value', 'invisible']),
+                )
+
+    def test_enum_in_enum_out(self):
+        Season = self.Season
+        self.assertIs(Season(Season.WINTER), Season.WINTER)
+
+    def test_enum_value(self):
+        Season = self.Season
+        self.assertEqual(Season.SPRING.value, 1)
+
+    def test_intenum_value(self):
+        self.assertEqual(IntStooges.CURLY.value, 2)
+
+    def test_enum(self):
+        Season = self.Season
+        lst = list(Season)
+        self.assertEqual(len(lst), len(Season))
+        self.assertEqual(len(Season), 4, Season)
+        self.assertEqual(
+            [Season.SPRING, Season.SUMMER, Season.AUTUMN, Season.WINTER], lst)
+
+        for i, season in enumerate('SPRING SUMMER AUTUMN WINTER'.split(), 1):
+            e = Season(i)
+            self.assertEqual(e, getattr(Season, season))
+            self.assertEqual(e.value, i)
+            self.assertNotEqual(e, i)
+            self.assertEqual(e.name, season)
+            self.assertIn(e, Season)
+            self.assertIs(type(e), Season)
+            self.assertIsInstance(e, Season)
+            self.assertEqual(str(e), 'Season.' + season)
+            self.assertEqual(
+                    repr(e),
+                    '<Season.{0}: {1}>'.format(season, i),
+                    )
+
+    def test_value_name(self):
+        Season = self.Season
+        self.assertEqual(Season.SPRING.name, 'SPRING')
+        self.assertEqual(Season.SPRING.value, 1)
+        with self.assertRaises(AttributeError):
+            Season.SPRING.name = 'invierno'
+        with self.assertRaises(AttributeError):
+            Season.SPRING.value = 2
+
+    def test_changing_member(self):
+        Season = self.Season
+        with self.assertRaises(AttributeError):
+            Season.WINTER = 'really cold'
+
+    def test_attribute_deletion(self):
+        class Season(Enum):
+            SPRING = 1
+            SUMMER = 2
+            AUTUMN = 3
+            WINTER = 4
+
+            def spam(cls):
+                pass
+
+        self.assertTrue(hasattr(Season, 'spam'))
+        del Season.spam
+        self.assertFalse(hasattr(Season, 'spam'))
+
+        with self.assertRaises(AttributeError):
+            del Season.SPRING
+        with self.assertRaises(AttributeError):
+            del Season.DRY
+        with self.assertRaises(AttributeError):
+            del Season.SPRING.name
+
+    def test_invalid_names(self):
+        with self.assertRaises(ValueError):
+            class Wrong(Enum):
+                mro = 9
+        with self.assertRaises(ValueError):
+            class Wrong(Enum):
+                _create_= 11
+        with self.assertRaises(ValueError):
+            class Wrong(Enum):
+                _get_mixins_ = 9
+        with self.assertRaises(ValueError):
+            class Wrong(Enum):
+                _find_new_ = 1
+        with self.assertRaises(ValueError):
+            class Wrong(Enum):
+                _any_name_ = 9
+
+    def test_contains(self):
+        Season = self.Season
+        self.assertIn(Season.AUTUMN, Season)
+        self.assertNotIn(3, Season)
+
+        val = Season(3)
+        self.assertIn(val, Season)
+
+        class OtherEnum(Enum):
+            one = 1; two = 2
+        self.assertNotIn(OtherEnum.two, Season)
+
+    def test_comparisons(self):
+        Season = self.Season
+        with self.assertRaises(TypeError):
+            Season.SPRING < Season.WINTER
+        with self.assertRaises(TypeError):
+            Season.SPRING > 4
+
+        self.assertNotEqual(Season.SPRING, 1)
+
+        class Part(Enum):
+            SPRING = 1
+            CLIP = 2
+            BARREL = 3
+
+        self.assertNotEqual(Season.SPRING, Part.SPRING)
+        with self.assertRaises(TypeError):
+            Season.SPRING < Part.CLIP
+
+    def test_enum_duplicates(self):
+        class Season(Enum):
+            SPRING = 1
+            SUMMER = 2
+            AUTUMN = FALL = 3
+            WINTER = 4
+            ANOTHER_SPRING = 1
+        lst = list(Season)
+        self.assertEqual(
+            lst,
+            [Season.SPRING, Season.SUMMER,
+             Season.AUTUMN, Season.WINTER,
+            ])
+        self.assertIs(Season.FALL, Season.AUTUMN)
+        self.assertEqual(Season.FALL.value, 3)
+        self.assertEqual(Season.AUTUMN.value, 3)
+        self.assertIs(Season(3), Season.AUTUMN)
+        self.assertIs(Season(1), Season.SPRING)
+        self.assertEqual(Season.FALL.name, 'AUTUMN')
+        self.assertEqual(
+                [k for k,v in Season.__members__.items() if v.name != k],
+                ['FALL', 'ANOTHER_SPRING'],
+                )
+
+    def test_duplicate_name(self):
+        with self.assertRaises(TypeError):
+            class Color(Enum):
+                red = 1
+                green = 2
+                blue = 3
+                red = 4
+
+        with self.assertRaises(TypeError):
+            class Color(Enum):
+                red = 1
+                green = 2
+                blue = 3
+                def red(self):
+                    return 'red'
+
+        with self.assertRaises(TypeError):
+            class Color(Enum):
+                @property
+                def red(self):
+                    return 'redder'
+                red = 1
+                green = 2
+                blue = 3
+
+
+    def test_enum_with_value_name(self):
+        class Huh(Enum):
+            name = 1
+            value = 2
+        self.assertEqual(
+            list(Huh),
+            [Huh.name, Huh.value],
+            )
+        self.assertIs(type(Huh.name), Huh)
+        self.assertEqual(Huh.name.name, 'name')
+        self.assertEqual(Huh.name.value, 1)
+
+    def test_format_enum(self):
+        Season = self.Season
+        self.assertEqual('{}'.format(Season.SPRING),
+                         '{}'.format(str(Season.SPRING)))
+        self.assertEqual( '{:}'.format(Season.SPRING),
+                          '{:}'.format(str(Season.SPRING)))
+        self.assertEqual('{:20}'.format(Season.SPRING),
+                         '{:20}'.format(str(Season.SPRING)))
+        self.assertEqual('{:^20}'.format(Season.SPRING),
+                         '{:^20}'.format(str(Season.SPRING)))
+        self.assertEqual('{:>20}'.format(Season.SPRING),
+                         '{:>20}'.format(str(Season.SPRING)))
+        self.assertEqual('{:<20}'.format(Season.SPRING),
+                         '{:<20}'.format(str(Season.SPRING)))
+
+    def test_format_enum_custom(self):
+        class TestFloat(float, Enum):
+            one = 1.0
+            two = 2.0
+            def __format__(self, spec):
+                return 'TestFloat success!'
+        self.assertEqual('{}'.format(TestFloat.one), 'TestFloat success!')
+
+    def assertFormatIsValue(self, spec, member):
+        self.assertEqual(spec.format(member), spec.format(member.value))
+
+    def test_format_enum_date(self):
+        Holiday = self.Holiday
+        self.assertFormatIsValue('{}', Holiday.IDES_OF_MARCH)
+        self.assertFormatIsValue('{:}', Holiday.IDES_OF_MARCH)
+        self.assertFormatIsValue('{:20}', Holiday.IDES_OF_MARCH)
+        self.assertFormatIsValue('{:^20}', Holiday.IDES_OF_MARCH)
+        self.assertFormatIsValue('{:>20}', Holiday.IDES_OF_MARCH)
+        self.assertFormatIsValue('{:<20}', Holiday.IDES_OF_MARCH)
+        self.assertFormatIsValue('{:%Y %m}', Holiday.IDES_OF_MARCH)
+        self.assertFormatIsValue('{:%Y %m %M:00}', Holiday.IDES_OF_MARCH)
+
+    def test_format_enum_float(self):
+        Konstants = self.Konstants
+        self.assertFormatIsValue('{}', Konstants.TAU)
+        self.assertFormatIsValue('{:}', Konstants.TAU)
+        self.assertFormatIsValue('{:20}', Konstants.TAU)
+        self.assertFormatIsValue('{:^20}', Konstants.TAU)
+        self.assertFormatIsValue('{:>20}', Konstants.TAU)
+        self.assertFormatIsValue('{:<20}', Konstants.TAU)
+        self.assertFormatIsValue('{:n}', Konstants.TAU)
+        self.assertFormatIsValue('{:5.2}', Konstants.TAU)
+        self.assertFormatIsValue('{:f}', Konstants.TAU)
+
+    def test_format_enum_int(self):
+        Grades = self.Grades
+        self.assertFormatIsValue('{}', Grades.C)
+        self.assertFormatIsValue('{:}', Grades.C)
+        self.assertFormatIsValue('{:20}', Grades.C)
+        self.assertFormatIsValue('{:^20}', Grades.C)
+        self.assertFormatIsValue('{:>20}', Grades.C)
+        self.assertFormatIsValue('{:<20}', Grades.C)
+        self.assertFormatIsValue('{:+}', Grades.C)
+        self.assertFormatIsValue('{:08X}', Grades.C)
+        self.assertFormatIsValue('{:b}', Grades.C)
+
+    def test_format_enum_str(self):
+        Directional = self.Directional
+        self.assertFormatIsValue('{}', Directional.WEST)
+        self.assertFormatIsValue('{:}', Directional.WEST)
+        self.assertFormatIsValue('{:20}', Directional.WEST)
+        self.assertFormatIsValue('{:^20}', Directional.WEST)
+        self.assertFormatIsValue('{:>20}', Directional.WEST)
+        self.assertFormatIsValue('{:<20}', Directional.WEST)
+
+    def test_hash(self):
+        Season = self.Season
+        dates = {}
+        dates[Season.WINTER] = '1225'
+        dates[Season.SPRING] = '0315'
+        dates[Season.SUMMER] = '0704'
+        dates[Season.AUTUMN] = '1031'
+        self.assertEqual(dates[Season.AUTUMN], '1031')
+
+    def test_intenum_from_scratch(self):
+        class phy(int, Enum):
+            pi = 3
+            tau = 2 * pi
+        self.assertTrue(phy.pi < phy.tau)
+
+    def test_intenum_inherited(self):
+        class IntEnum(int, Enum):
+            pass
+        class phy(IntEnum):
+            pi = 3
+            tau = 2 * pi
+        self.assertTrue(phy.pi < phy.tau)
+
+    def test_floatenum_from_scratch(self):
+        class phy(float, Enum):
+            pi = 3.1415926
+            tau = 2 * pi
+        self.assertTrue(phy.pi < phy.tau)
+
+    def test_floatenum_inherited(self):
+        class FloatEnum(float, Enum):
+            pass
+        class phy(FloatEnum):
+            pi = 3.1415926
+            tau = 2 * pi
+        self.assertTrue(phy.pi < phy.tau)
+
+    def test_strenum_from_scratch(self):
+        class phy(str, Enum):
+            pi = 'Pi'
+            tau = 'Tau'
+        self.assertTrue(phy.pi < phy.tau)
+
+    def test_strenum_inherited(self):
+        class StrEnum(str, Enum):
+            pass
+        class phy(StrEnum):
+            pi = 'Pi'
+            tau = 'Tau'
+        self.assertTrue(phy.pi < phy.tau)
+
+
+    def test_intenum(self):
+        class WeekDay(IntEnum):
+            SUNDAY = 1
+            MONDAY = 2
+            TUESDAY = 3
+            WEDNESDAY = 4
+            THURSDAY = 5
+            FRIDAY = 6
+            SATURDAY = 7
+
+        self.assertEqual(['a', 'b', 'c'][WeekDay.MONDAY], 'c')
+        self.assertEqual([i for i in range(WeekDay.TUESDAY)], [0, 1, 2])
+
+        lst = list(WeekDay)
+        self.assertEqual(len(lst), len(WeekDay))
+        self.assertEqual(len(WeekDay), 7)
+        target = 'SUNDAY MONDAY TUESDAY WEDNESDAY THURSDAY FRIDAY SATURDAY'
+        target = target.split()
+        for i, weekday in enumerate(target, 1):
+            e = WeekDay(i)
+            self.assertEqual(e, i)
+            self.assertEqual(int(e), i)
+            self.assertEqual(e.name, weekday)
+            self.assertIn(e, WeekDay)
+            self.assertEqual(lst.index(e)+1, i)
+            self.assertTrue(0 < e < 8)
+            self.assertIs(type(e), WeekDay)
+            self.assertIsInstance(e, int)
+            self.assertIsInstance(e, Enum)
+
+    def test_intenum_duplicates(self):
+        class WeekDay(IntEnum):
+            SUNDAY = 1
+            MONDAY = 2
+            TUESDAY = TEUSDAY = 3
+            WEDNESDAY = 4
+            THURSDAY = 5
+            FRIDAY = 6
+            SATURDAY = 7
+        self.assertIs(WeekDay.TEUSDAY, WeekDay.TUESDAY)
+        self.assertEqual(WeekDay(3).name, 'TUESDAY')
+        self.assertEqual([k for k,v in WeekDay.__members__.items()
+                if v.name != k], ['TEUSDAY', ])
+
+    def test_pickle_enum(self):
+        if isinstance(Stooges, Exception):
+            raise Stooges
+        test_pickle_dump_load(self.assertIs, Stooges.CURLY)
+        test_pickle_dump_load(self.assertIs, Stooges)
+
+    def test_pickle_int(self):
+        if isinstance(IntStooges, Exception):
+            raise IntStooges
+        test_pickle_dump_load(self.assertIs, IntStooges.CURLY)
+        test_pickle_dump_load(self.assertIs, IntStooges)
+
+    def test_pickle_float(self):
+        if isinstance(FloatStooges, Exception):
+            raise FloatStooges
+        test_pickle_dump_load(self.assertIs, FloatStooges.CURLY)
+        test_pickle_dump_load(self.assertIs, FloatStooges)
+
+    def test_pickle_enum_function(self):
+        if isinstance(Answer, Exception):
+            raise Answer
+        test_pickle_dump_load(self.assertIs, Answer.him)
+        test_pickle_dump_load(self.assertIs, Answer)
+
+    def test_pickle_enum_function_with_module(self):
+        if isinstance(Question, Exception):
+            raise Question
+        test_pickle_dump_load(self.assertIs, Question.who)
+        test_pickle_dump_load(self.assertIs, Question)
+
+    def test_enum_function_with_qualname(self):
+        if isinstance(Theory, Exception):
+            raise Theory
+        self.assertEqual(Theory.__qualname__, 'spanish_inquisition')
+
+    def test_class_nested_enum_and_pickle_protocol_four(self):
+        # would normally just have this directly in the class namespace
+        class NestedEnum(Enum):
+            twigs = 'common'
+            shiny = 'rare'
+
+        self.__class__.NestedEnum = NestedEnum
+        self.NestedEnum.__qualname__ = '%s.NestedEnum' % self.__class__.__name__
+        test_pickle_exception(
+                self.assertRaises, PicklingError, self.NestedEnum.twigs,
+                protocol=(0, 3))
+        test_pickle_dump_load(self.assertIs, self.NestedEnum.twigs,
+                protocol=(4, HIGHEST_PROTOCOL))
+
+    def test_exploding_pickle(self):
+        BadPickle = Enum(
+                'BadPickle', 'dill sweet bread-n-butter', module=__name__)
+        globals()['BadPickle'] = BadPickle
+        # now break BadPickle to test exception raising
+        enum._make_class_unpicklable(BadPickle)
+        test_pickle_exception(self.assertRaises, TypeError, BadPickle.dill)
+        test_pickle_exception(self.assertRaises, PicklingError, BadPickle)
+
+    def test_string_enum(self):
+        class SkillLevel(str, Enum):
+            master = 'what is the sound of one hand clapping?'
+            journeyman = 'why did the chicken cross the road?'
+            apprentice = 'knock, knock!'
+        self.assertEqual(SkillLevel.apprentice, 'knock, knock!')
+
+    def test_getattr_getitem(self):
+        class Period(Enum):
+            morning = 1
+            noon = 2
+            evening = 3
+            night = 4
+        self.assertIs(Period(2), Period.noon)
+        self.assertIs(getattr(Period, 'night'), Period.night)
+        self.assertIs(Period['morning'], Period.morning)
+
+    def test_getattr_dunder(self):
+        Season = self.Season
+        self.assertTrue(getattr(Season, '__eq__'))
+
+    def test_iteration_order(self):
+        class Season(Enum):
+            SUMMER = 2
+            WINTER = 4
+            AUTUMN = 3
+            SPRING = 1
+        self.assertEqual(
+                list(Season),
+                [Season.SUMMER, Season.WINTER, Season.AUTUMN, Season.SPRING],
+                )
+
+    def test_reversed_iteration_order(self):
+        self.assertEqual(
+                list(reversed(self.Season)),
+                [self.Season.WINTER, self.Season.AUTUMN, self.Season.SUMMER,
+                 self.Season.SPRING]
+                )
+
+    def test_programatic_function_string(self):
+        SummerMonth = Enum('SummerMonth', 'june july august')
+        lst = list(SummerMonth)
+        self.assertEqual(len(lst), len(SummerMonth))
+        self.assertEqual(len(SummerMonth), 3, SummerMonth)
+        self.assertEqual(
+                [SummerMonth.june, SummerMonth.july, SummerMonth.august],
+                lst,
+                )
+        for i, month in enumerate('june july august'.split(), 1):
+            e = SummerMonth(i)
+            self.assertEqual(int(e.value), i)
+            self.assertNotEqual(e, i)
+            self.assertEqual(e.name, month)
+            self.assertIn(e, SummerMonth)
+            self.assertIs(type(e), SummerMonth)
+
+    def test_programatic_function_string_list(self):
+        SummerMonth = Enum('SummerMonth', ['june', 'july', 'august'])
+        lst = list(SummerMonth)
+        self.assertEqual(len(lst), len(SummerMonth))
+        self.assertEqual(len(SummerMonth), 3, SummerMonth)
+        self.assertEqual(
+                [SummerMonth.june, SummerMonth.july, SummerMonth.august],
+                lst,
+                )
+        for i, month in enumerate('june july august'.split(), 1):
+            e = SummerMonth(i)
+            self.assertEqual(int(e.value), i)
+            self.assertNotEqual(e, i)
+            self.assertEqual(e.name, month)
+            self.assertIn(e, SummerMonth)
+            self.assertIs(type(e), SummerMonth)
+
+    def test_programatic_function_iterable(self):
+        SummerMonth = Enum(
+                'SummerMonth',
+                (('june', 1), ('july', 2), ('august', 3))
+                )
+        lst = list(SummerMonth)
+        self.assertEqual(len(lst), len(SummerMonth))
+        self.assertEqual(len(SummerMonth), 3, SummerMonth)
+        self.assertEqual(
+                [SummerMonth.june, SummerMonth.july, SummerMonth.august],
+                lst,
+                )
+        for i, month in enumerate('june july august'.split(), 1):
+            e = SummerMonth(i)
+            self.assertEqual(int(e.value), i)
+            self.assertNotEqual(e, i)
+            self.assertEqual(e.name, month)
+            self.assertIn(e, SummerMonth)
+            self.assertIs(type(e), SummerMonth)
+
+    def test_programatic_function_from_dict(self):
+        SummerMonth = Enum(
+                'SummerMonth',
+                OrderedDict((('june', 1), ('july', 2), ('august', 3)))
+                )
+        lst = list(SummerMonth)
+        self.assertEqual(len(lst), len(SummerMonth))
+        self.assertEqual(len(SummerMonth), 3, SummerMonth)
+        self.assertEqual(
+                [SummerMonth.june, SummerMonth.july, SummerMonth.august],
+                lst,
+                )
+        for i, month in enumerate('june july august'.split(), 1):
+            e = SummerMonth(i)
+            self.assertEqual(int(e.value), i)
+            self.assertNotEqual(e, i)
+            self.assertEqual(e.name, month)
+            self.assertIn(e, SummerMonth)
+            self.assertIs(type(e), SummerMonth)
+
+    def test_programatic_function_type(self):
+        SummerMonth = Enum('SummerMonth', 'june july august', type=int)
+        lst = list(SummerMonth)
+        self.assertEqual(len(lst), len(SummerMonth))
+        self.assertEqual(len(SummerMonth), 3, SummerMonth)
+        self.assertEqual(
+                [SummerMonth.june, SummerMonth.july, SummerMonth.august],
+                lst,
+                )
+        for i, month in enumerate('june july august'.split(), 1):
+            e = SummerMonth(i)
+            self.assertEqual(e, i)
+            self.assertEqual(e.name, month)
+            self.assertIn(e, SummerMonth)
+            self.assertIs(type(e), SummerMonth)
+
+    def test_programatic_function_type_from_subclass(self):
+        SummerMonth = IntEnum('SummerMonth', 'june july august')
+        lst = list(SummerMonth)
+        self.assertEqual(len(lst), len(SummerMonth))
+        self.assertEqual(len(SummerMonth), 3, SummerMonth)
+        self.assertEqual(
+                [SummerMonth.june, SummerMonth.july, SummerMonth.august],
+                lst,
+                )
+        for i, month in enumerate('june july august'.split(), 1):
+            e = SummerMonth(i)
+            self.assertEqual(e, i)
+            self.assertEqual(e.name, month)
+            self.assertIn(e, SummerMonth)
+            self.assertIs(type(e), SummerMonth)
+
+    def test_subclassing(self):
+        if isinstance(Name, Exception):
+            raise Name
+        self.assertEqual(Name.BDFL, 'Guido van Rossum')
+        self.assertTrue(Name.BDFL, Name('Guido van Rossum'))
+        self.assertIs(Name.BDFL, getattr(Name, 'BDFL'))
+        test_pickle_dump_load(self.assertIs, Name.BDFL)
+
+    def test_extending(self):
+        class Color(Enum):
+            red = 1
+            green = 2
+            blue = 3
+        with self.assertRaises(TypeError):
+            class MoreColor(Color):
+                cyan = 4
+                magenta = 5
+                yellow = 6
+
+    def test_exclude_methods(self):
+        class whatever(Enum):
+            this = 'that'
+            these = 'those'
+            def really(self):
+                return 'no, not %s' % self.value
+        self.assertIsNot(type(whatever.really), whatever)
+        self.assertEqual(whatever.this.really(), 'no, not that')
+
+    def test_wrong_inheritance_order(self):
+        with self.assertRaises(TypeError):
+            class Wrong(Enum, str):
+                NotHere = 'error before this point'
+
+    def test_intenum_transitivity(self):
+        class number(IntEnum):
+            one = 1
+            two = 2
+            three = 3
+        class numero(IntEnum):
+            uno = 1
+            dos = 2
+            tres = 3
+        self.assertEqual(number.one, numero.uno)
+        self.assertEqual(number.two, numero.dos)
+        self.assertEqual(number.three, numero.tres)
+
+    def test_wrong_enum_in_call(self):
+        class Monochrome(Enum):
+            black = 0
+            white = 1
+        class Gender(Enum):
+            male = 0
+            female = 1
+        self.assertRaises(ValueError, Monochrome, Gender.male)
+
+    def test_wrong_enum_in_mixed_call(self):
+        class Monochrome(IntEnum):
+            black = 0
+            white = 1
+        class Gender(Enum):
+            male = 0
+            female = 1
+        self.assertRaises(ValueError, Monochrome, Gender.male)
+
+    def test_mixed_enum_in_call_1(self):
+        class Monochrome(IntEnum):
+            black = 0
+            white = 1
+        class Gender(IntEnum):
+            male = 0
+            female = 1
+        self.assertIs(Monochrome(Gender.female), Monochrome.white)
+
+    def test_mixed_enum_in_call_2(self):
+        class Monochrome(Enum):
+            black = 0
+            white = 1
+        class Gender(IntEnum):
+            male = 0
+            female = 1
+        self.assertIs(Monochrome(Gender.male), Monochrome.black)
+
+    def test_flufl_enum(self):
+        class Fluflnum(Enum):
+            def __int__(self):
+                return int(self.value)
+        class MailManOptions(Fluflnum):
+            option1 = 1
+            option2 = 2
+            option3 = 3
+        self.assertEqual(int(MailManOptions.option1), 1)
+
+    def test_introspection(self):
+        class Number(IntEnum):
+            one = 100
+            two = 200
+        self.assertIs(Number.one._member_type_, int)
+        self.assertIs(Number._member_type_, int)
+        class String(str, Enum):
+            yarn = 'soft'
+            rope = 'rough'
+            wire = 'hard'
+        self.assertIs(String.yarn._member_type_, str)
+        self.assertIs(String._member_type_, str)
+        class Plain(Enum):
+            vanilla = 'white'
+            one = 1
+        self.assertIs(Plain.vanilla._member_type_, object)
+        self.assertIs(Plain._member_type_, object)
+
+    def test_no_such_enum_member(self):
+        class Color(Enum):
+            red = 1
+            green = 2
+            blue = 3
+        with self.assertRaises(ValueError):
+            Color(4)
+        with self.assertRaises(KeyError):
+            Color['chartreuse']
+
+    def test_new_repr(self):
+        class Color(Enum):
+            red = 1
+            green = 2
+            blue = 3
+            def __repr__(self):
+                return "don't you just love shades of %s?" % self.name
+        self.assertEqual(
+                repr(Color.blue),
+                "don't you just love shades of blue?",
+                )
+
+    def test_inherited_repr(self):
+        class MyEnum(Enum):
+            def __repr__(self):
+                return "My name is %s." % self.name
+        class MyIntEnum(int, MyEnum):
+            this = 1
+            that = 2
+            theother = 3
+        self.assertEqual(repr(MyIntEnum.that), "My name is that.")
+
+    def test_multiple_mixin_mro(self):
+        class auto_enum(type(Enum)):
+            def __new__(metacls, cls, bases, classdict):
+                temp = type(classdict)()
+                names = set(classdict._member_names)
+                i = 0
+                for k in classdict._member_names:
+                    v = classdict[k]
+                    if v is Ellipsis:
+                        v = i
+                    else:
+                        i = v
+                    i += 1
+                    temp[k] = v
+                for k, v in classdict.items():
+                    if k not in names:
+                        temp[k] = v
+                return super(auto_enum, metacls).__new__(
+                        metacls, cls, bases, temp)
+
+        class AutoNumberedEnum(Enum, metaclass=auto_enum):
+            pass
+
+        class AutoIntEnum(IntEnum, metaclass=auto_enum):
+            pass
+
+        class TestAutoNumber(AutoNumberedEnum):
+            a = ...
+            b = 3
+            c = ...
+
+        class TestAutoInt(AutoIntEnum):
+            a = ...
+            b = 3
+            c = ...
+
+    def test_subclasses_with_getnewargs(self):
+        class NamedInt(int):
+            __qualname__ = 'NamedInt'       # needed for pickle protocol 4
+            def __new__(cls, *args):
+                _args = args
+                name, *args = args
+                if len(args) == 0:
+                    raise TypeError("name and value must be specified")
+                self = int.__new__(cls, *args)
+                self._intname = name
+                self._args = _args
+                return self
+            def __getnewargs__(self):
+                return self._args
+            @property
+            def __name__(self):
+                return self._intname
+            def __repr__(self):
+                # repr() is updated to include the name and type info
+                return "{}({!r}, {})".format(type(self).__name__,
+                                             self.__name__,
+                                             int.__repr__(self))
+            def __str__(self):
+                # str() is unchanged, even if it relies on the repr() fallback
+                base = int
+                base_str = base.__str__
+                if base_str.__objclass__ is object:
+                    return base.__repr__(self)
+                return base_str(self)
+            # for simplicity, we only define one operator that
+            # propagates expressions
+            def __add__(self, other):
+                temp = int(self) + int( other)
+                if isinstance(self, NamedInt) and isinstance(other, NamedInt):
+                    return NamedInt(
+                        '({0} + {1})'.format(self.__name__, other.__name__),
+                        temp )
+                else:
+                    return temp
+
+        class NEI(NamedInt, Enum):
+            __qualname__ = 'NEI'      # needed for pickle protocol 4
+            x = ('the-x', 1)
+            y = ('the-y', 2)
+
+
+        self.assertIs(NEI.__new__, Enum.__new__)
+        self.assertEqual(repr(NEI.x + NEI.y), "NamedInt('(the-x + the-y)', 3)")
+        globals()['NamedInt'] = NamedInt
+        globals()['NEI'] = NEI
+        NI5 = NamedInt('test', 5)
+        self.assertEqual(NI5, 5)
+        test_pickle_dump_load(self.assertEqual, NI5, 5)
+        self.assertEqual(NEI.y.value, 2)
+        test_pickle_dump_load(self.assertIs, NEI.y)
+        test_pickle_dump_load(self.assertIs, NEI)
+
+    def test_subclasses_with_getnewargs_ex(self):
+        class NamedInt(int):
+            __qualname__ = 'NamedInt'       # needed for pickle protocol 4
+            def __new__(cls, *args):
+                _args = args
+                name, *args = args
+                if len(args) == 0:
+                    raise TypeError("name and value must be specified")
+                self = int.__new__(cls, *args)
+                self._intname = name
+                self._args = _args
+                return self
+            def __getnewargs_ex__(self):
+                return self._args, {}
+            @property
+            def __name__(self):
+                return self._intname
+            def __repr__(self):
+                # repr() is updated to include the name and type info
+                return "{}({!r}, {})".format(type(self).__name__,
+                                             self.__name__,
+                                             int.__repr__(self))
+            def __str__(self):
+                # str() is unchanged, even if it relies on the repr() fallback
+                base = int
+                base_str = base.__str__
+                if base_str.__objclass__ is object:
+                    return base.__repr__(self)
+                return base_str(self)
+            # for simplicity, we only define one operator that
+            # propagates expressions
+            def __add__(self, other):
+                temp = int(self) + int( other)
+                if isinstance(self, NamedInt) and isinstance(other, NamedInt):
+                    return NamedInt(
+                        '({0} + {1})'.format(self.__name__, other.__name__),
+                        temp )
+                else:
+                    return temp
+
+        class NEI(NamedInt, Enum):
+            __qualname__ = 'NEI'      # needed for pickle protocol 4
+            x = ('the-x', 1)
+            y = ('the-y', 2)
+
+
+        self.assertIs(NEI.__new__, Enum.__new__)
+        self.assertEqual(repr(NEI.x + NEI.y), "NamedInt('(the-x + the-y)', 3)")
+        globals()['NamedInt'] = NamedInt
+        globals()['NEI'] = NEI
+        NI5 = NamedInt('test', 5)
+        self.assertEqual(NI5, 5)
+        test_pickle_dump_load(self.assertEqual, NI5, 5, protocol=(4, 4))
+        self.assertEqual(NEI.y.value, 2)
+        test_pickle_dump_load(self.assertIs, NEI.y, protocol=(4, 4))
+        test_pickle_dump_load(self.assertIs, NEI)
+
+    def test_subclasses_with_reduce(self):
+        class NamedInt(int):
+            __qualname__ = 'NamedInt'       # needed for pickle protocol 4
+            def __new__(cls, *args):
+                _args = args
+                name, *args = args
+                if len(args) == 0:
+                    raise TypeError("name and value must be specified")
+                self = int.__new__(cls, *args)
+                self._intname = name
+                self._args = _args
+                return self
+            def __reduce__(self):
+                return self.__class__, self._args
+            @property
+            def __name__(self):
+                return self._intname
+            def __repr__(self):
+                # repr() is updated to include the name and type info
+                return "{}({!r}, {})".format(type(self).__name__,
+                                             self.__name__,
+                                             int.__repr__(self))
+            def __str__(self):
+                # str() is unchanged, even if it relies on the repr() fallback
+                base = int
+                base_str = base.__str__
+                if base_str.__objclass__ is object:
+                    return base.__repr__(self)
+                return base_str(self)
+            # for simplicity, we only define one operator that
+            # propagates expressions
+            def __add__(self, other):
+                temp = int(self) + int( other)
+                if isinstance(self, NamedInt) and isinstance(other, NamedInt):
+                    return NamedInt(
+                        '({0} + {1})'.format(self.__name__, other.__name__),
+                        temp )
+                else:
+                    return temp
+
+        class NEI(NamedInt, Enum):
+            __qualname__ = 'NEI'      # needed for pickle protocol 4
+            x = ('the-x', 1)
+            y = ('the-y', 2)
+
+
+        self.assertIs(NEI.__new__, Enum.__new__)
+        self.assertEqual(repr(NEI.x + NEI.y), "NamedInt('(the-x + the-y)', 3)")
+        globals()['NamedInt'] = NamedInt
+        globals()['NEI'] = NEI
+        NI5 = NamedInt('test', 5)
+        self.assertEqual(NI5, 5)
+        test_pickle_dump_load(self.assertEqual, NI5, 5)
+        self.assertEqual(NEI.y.value, 2)
+        test_pickle_dump_load(self.assertIs, NEI.y)
+        test_pickle_dump_load(self.assertIs, NEI)
+
+    def test_subclasses_with_reduce_ex(self):
+        class NamedInt(int):
+            __qualname__ = 'NamedInt'       # needed for pickle protocol 4
+            def __new__(cls, *args):
+                _args = args
+                name, *args = args
+                if len(args) == 0:
+                    raise TypeError("name and value must be specified")
+                self = int.__new__(cls, *args)
+                self._intname = name
+                self._args = _args
+                return self
+            def __reduce_ex__(self, proto):
+                return self.__class__, self._args
+            @property
+            def __name__(self):
+                return self._intname
+            def __repr__(self):
+                # repr() is updated to include the name and type info
+                return "{}({!r}, {})".format(type(self).__name__,
+                                             self.__name__,
+                                             int.__repr__(self))
+            def __str__(self):
+                # str() is unchanged, even if it relies on the repr() fallback
+                base = int
+                base_str = base.__str__
+                if base_str.__objclass__ is object:
+                    return base.__repr__(self)
+                return base_str(self)
+            # for simplicity, we only define one operator that
+            # propagates expressions
+            def __add__(self, other):
+                temp = int(self) + int( other)
+                if isinstance(self, NamedInt) and isinstance(other, NamedInt):
+                    return NamedInt(
+                        '({0} + {1})'.format(self.__name__, other.__name__),
+                        temp )
+                else:
+                    return temp
+
+        class NEI(NamedInt, Enum):
+            __qualname__ = 'NEI'      # needed for pickle protocol 4
+            x = ('the-x', 1)
+            y = ('the-y', 2)
+
+
+        self.assertIs(NEI.__new__, Enum.__new__)
+        self.assertEqual(repr(NEI.x + NEI.y), "NamedInt('(the-x + the-y)', 3)")
+        globals()['NamedInt'] = NamedInt
+        globals()['NEI'] = NEI
+        NI5 = NamedInt('test', 5)
+        self.assertEqual(NI5, 5)
+        test_pickle_dump_load(self.assertEqual, NI5, 5)
+        self.assertEqual(NEI.y.value, 2)
+        test_pickle_dump_load(self.assertIs, NEI.y)
+        test_pickle_dump_load(self.assertIs, NEI)
+
+    def test_subclasses_without_direct_pickle_support(self):
+        class NamedInt(int):
+            __qualname__ = 'NamedInt'
+            def __new__(cls, *args):
+                _args = args
+                name, *args = args
+                if len(args) == 0:
+                    raise TypeError("name and value must be specified")
+                self = int.__new__(cls, *args)
+                self._intname = name
+                self._args = _args
+                return self
+            @property
+            def __name__(self):
+                return self._intname
+            def __repr__(self):
+                # repr() is updated to include the name and type info
+                return "{}({!r}, {})".format(type(self).__name__,
+                                             self.__name__,
+                                             int.__repr__(self))
+            def __str__(self):
+                # str() is unchanged, even if it relies on the repr() fallback
+                base = int
+                base_str = base.__str__
+                if base_str.__objclass__ is object:
+                    return base.__repr__(self)
+                return base_str(self)
+            # for simplicity, we only define one operator that
+            # propagates expressions
+            def __add__(self, other):
+                temp = int(self) + int( other)
+                if isinstance(self, NamedInt) and isinstance(other, NamedInt):
+                    return NamedInt(
+                        '({0} + {1})'.format(self.__name__, other.__name__),
+                        temp )
+                else:
+                    return temp
+
+        class NEI(NamedInt, Enum):
+            __qualname__ = 'NEI'
+            x = ('the-x', 1)
+            y = ('the-y', 2)
+
+        self.assertIs(NEI.__new__, Enum.__new__)
+        self.assertEqual(repr(NEI.x + NEI.y), "NamedInt('(the-x + the-y)', 3)")
+        globals()['NamedInt'] = NamedInt
+        globals()['NEI'] = NEI
+        NI5 = NamedInt('test', 5)
+        self.assertEqual(NI5, 5)
+        self.assertEqual(NEI.y.value, 2)
+        test_pickle_exception(self.assertRaises, TypeError, NEI.x)
+        test_pickle_exception(self.assertRaises, PicklingError, NEI)
+
+    def test_subclasses_without_direct_pickle_support_using_name(self):
+        class NamedInt(int):
+            __qualname__ = 'NamedInt'
+            def __new__(cls, *args):
+                _args = args
+                name, *args = args
+                if len(args) == 0:
+                    raise TypeError("name and value must be specified")
+                self = int.__new__(cls, *args)
+                self._intname = name
+                self._args = _args
+                return self
+            @property
+            def __name__(self):
+                return self._intname
+            def __repr__(self):
+                # repr() is updated to include the name and type info
+                return "{}({!r}, {})".format(type(self).__name__,
+                                             self.__name__,
+                                             int.__repr__(self))
+            def __str__(self):
+                # str() is unchanged, even if it relies on the repr() fallback
+                base = int
+                base_str = base.__str__
+                if base_str.__objclass__ is object:
+                    return base.__repr__(self)
+                return base_str(self)
+            # for simplicity, we only define one operator that
+            # propagates expressions
+            def __add__(self, other):
+                temp = int(self) + int( other)
+                if isinstance(self, NamedInt) and isinstance(other, NamedInt):
+                    return NamedInt(
+                        '({0} + {1})'.format(self.__name__, other.__name__),
+                        temp )
+                else:
+                    return temp
+
+        class NEI(NamedInt, Enum):
+            __qualname__ = 'NEI'
+            x = ('the-x', 1)
+            y = ('the-y', 2)
+            def __reduce_ex__(self, proto):
+                return getattr, (self.__class__, self._name_)
+
+        self.assertIs(NEI.__new__, Enum.__new__)
+        self.assertEqual(repr(NEI.x + NEI.y), "NamedInt('(the-x + the-y)', 3)")
+        globals()['NamedInt'] = NamedInt
+        globals()['NEI'] = NEI
+        NI5 = NamedInt('test', 5)
+        self.assertEqual(NI5, 5)
+        self.assertEqual(NEI.y.value, 2)
+        test_pickle_dump_load(self.assertIs, NEI.y)
+        test_pickle_dump_load(self.assertIs, NEI)
+
+    def test_tuple_subclass(self):
+        class SomeTuple(tuple, Enum):
+            __qualname__ = 'SomeTuple'      # needed for pickle protocol 4
+            first = (1, 'for the money')
+            second = (2, 'for the show')
+            third = (3, 'for the music')
+        self.assertIs(type(SomeTuple.first), SomeTuple)
+        self.assertIsInstance(SomeTuple.second, tuple)
+        self.assertEqual(SomeTuple.third, (3, 'for the music'))
+        globals()['SomeTuple'] = SomeTuple
+        test_pickle_dump_load(self.assertIs, SomeTuple.first)
+
+    def test_duplicate_values_give_unique_enum_items(self):
+        class AutoNumber(Enum):
+            first = ()
+            second = ()
+            third = ()
+            def __new__(cls):
+                value = len(cls.__members__) + 1
+                obj = object.__new__(cls)
+                obj._value_ = value
+                return obj
+            def __int__(self):
+                return int(self._value_)
+        self.assertEqual(
+                list(AutoNumber),
+                [AutoNumber.first, AutoNumber.second, AutoNumber.third],
+                )
+        self.assertEqual(int(AutoNumber.second), 2)
+        self.assertEqual(AutoNumber.third.value, 3)
+        self.assertIs(AutoNumber(1), AutoNumber.first)
+
+    def test_inherited_new_from_enhanced_enum(self):
+        class AutoNumber(Enum):
+            def __new__(cls):
+                value = len(cls.__members__) + 1
+                obj = object.__new__(cls)
+                obj._value_ = value
+                return obj
+            def __int__(self):
+                return int(self._value_)
+        class Color(AutoNumber):
+            red = ()
+            green = ()
+            blue = ()
+        self.assertEqual(list(Color), [Color.red, Color.green, Color.blue])
+        self.assertEqual(list(map(int, Color)), [1, 2, 3])
+
+    def test_inherited_new_from_mixed_enum(self):
+        class AutoNumber(IntEnum):
+            def __new__(cls):
+                value = len(cls.__members__) + 1
+                obj = int.__new__(cls, value)
+                obj._value_ = value
+                return obj
+        class Color(AutoNumber):
+            red = ()
+            green = ()
+            blue = ()
+        self.assertEqual(list(Color), [Color.red, Color.green, Color.blue])
+        self.assertEqual(list(map(int, Color)), [1, 2, 3])
+
+    def test_equality(self):
+        class AlwaysEqual:
+            def __eq__(self, other):
+                return True
+        class OrdinaryEnum(Enum):
+            a = 1
+        self.assertEqual(AlwaysEqual(), OrdinaryEnum.a)
+        self.assertEqual(OrdinaryEnum.a, AlwaysEqual())
+
+    def test_ordered_mixin(self):
+        class OrderedEnum(Enum):
+            def __ge__(self, other):
+                if self.__class__ is other.__class__:
+                    return self._value_ >= other._value_
+                return NotImplemented
+            def __gt__(self, other):
+                if self.__class__ is other.__class__:
+                    return self._value_ > other._value_
+                return NotImplemented
+            def __le__(self, other):
+                if self.__class__ is other.__class__:
+                    return self._value_ <= other._value_
+                return NotImplemented
+            def __lt__(self, other):
+                if self.__class__ is other.__class__:
+                    return self._value_ < other._value_
+                return NotImplemented
+        class Grade(OrderedEnum):
+            A = 5
+            B = 4
+            C = 3
+            D = 2
+            F = 1
+        self.assertGreater(Grade.A, Grade.B)
+        self.assertLessEqual(Grade.F, Grade.C)
+        self.assertLess(Grade.D, Grade.A)
+        self.assertGreaterEqual(Grade.B, Grade.B)
+        self.assertEqual(Grade.B, Grade.B)
+        self.assertNotEqual(Grade.C, Grade.D)
+
+    def test_extending2(self):
+        class Shade(Enum):
+            def shade(self):
+                print(self.name)
+        class Color(Shade):
+            red = 1
+            green = 2
+            blue = 3
+        with self.assertRaises(TypeError):
+            class MoreColor(Color):
+                cyan = 4
+                magenta = 5
+                yellow = 6
+
+    def test_extending3(self):
+        class Shade(Enum):
+            def shade(self):
+                return self.name
+        class Color(Shade):
+            def hex(self):
+                return '%s hexlified!' % self.value
+        class MoreColor(Color):
+            cyan = 4
+            magenta = 5
+            yellow = 6
+        self.assertEqual(MoreColor.magenta.hex(), '5 hexlified!')
+
+
+    def test_no_duplicates(self):
+        class UniqueEnum(Enum):
+            def __init__(self, *args):
+                cls = self.__class__
+                if any(self.value == e.value for e in cls):
+                    a = self.name
+                    e = cls(self.value).name
+                    raise ValueError(
+                            "aliases not allowed in UniqueEnum:  %r --> %r"
+                            % (a, e)
+                            )
+        class Color(UniqueEnum):
+            red = 1
+            green = 2
+            blue = 3
+        with self.assertRaises(ValueError):
+            class Color(UniqueEnum):
+                red = 1
+                green = 2
+                blue = 3
+                grene = 2
+
+    def test_init(self):
+        class Planet(Enum):
+            MERCURY = (3.303e+23, 2.4397e6)
+            VENUS   = (4.869e+24, 6.0518e6)
+            EARTH   = (5.976e+24, 6.37814e6)
+            MARS    = (6.421e+23, 3.3972e6)
+            JUPITER = (1.9e+27,   7.1492e7)
+            SATURN  = (5.688e+26, 6.0268e7)
+            URANUS  = (8.686e+25, 2.5559e7)
+            NEPTUNE = (1.024e+26, 2.4746e7)
+            def __init__(self, mass, radius):
+                self.mass = mass       # in kilograms
+                self.radius = radius   # in meters
+            @property
+            def surface_gravity(self):
+                # universal gravitational constant  (m3 kg-1 s-2)
+                G = 6.67300E-11
+                return G * self.mass / (self.radius * self.radius)
+        self.assertEqual(round(Planet.EARTH.surface_gravity, 2), 9.80)
+        self.assertEqual(Planet.EARTH.value, (5.976e+24, 6.37814e6))
+
+    def test_nonhash_value(self):
+        class AutoNumberInAList(Enum):
+            def __new__(cls):
+                value = [len(cls.__members__) + 1]
+                obj = object.__new__(cls)
+                obj._value_ = value
+                return obj
+        class ColorInAList(AutoNumberInAList):
+            red = ()
+            green = ()
+            blue = ()
+        self.assertEqual(list(ColorInAList), [ColorInAList.red, ColorInAList.green, ColorInAList.blue])
+        for enum, value in zip(ColorInAList, range(3)):
+            value += 1
+            self.assertEqual(enum.value, [value])
+            self.assertIs(ColorInAList([value]), enum)
+
+    def test_conflicting_types_resolved_in_new(self):
+        class LabelledIntEnum(int, Enum):
+            def __new__(cls, *args):
+                value, label = args
+                obj = int.__new__(cls, value)
+                obj.label = label
+                obj._value_ = value
+                return obj
+
+        class LabelledList(LabelledIntEnum):
+            unprocessed = (1, "Unprocessed")
+            payment_complete = (2, "Payment Complete")
+
+        self.assertEqual(list(LabelledList), [LabelledList.unprocessed, LabelledList.payment_complete])
+        self.assertEqual(LabelledList.unprocessed, 1)
+        self.assertEqual(LabelledList(1), LabelledList.unprocessed)
+
+
+class TestUnique(unittest.TestCase):
+
+    def test_unique_clean(self):
+        @unique
+        class Clean(Enum):
+            one = 1
+            two = 'dos'
+            tres = 4.0
+        @unique
+        class Cleaner(IntEnum):
+            single = 1
+            double = 2
+            triple = 3
+
+    def test_unique_dirty(self):
+        with self.assertRaisesRegex(ValueError, 'tres.*one'):
+            @unique
+            class Dirty(Enum):
+                one = 1
+                two = 'dos'
+                tres = 1
+        with self.assertRaisesRegex(
+                ValueError,
+                'double.*single.*turkey.*triple',
+                ):
+            @unique
+            class Dirtier(IntEnum):
+                single = 1
+                double = 1
+                triple = 3
+                turkey = 3
+
+
+expected_help_output = """
+Help on class Color in module %s:
+
+class Color(enum.Enum)
+ |  Method resolution order:
+ |      Color
+ |      enum.Enum
+ |      builtins.object
+ |\x20\x20
+ |  Data and other attributes defined here:
+ |\x20\x20
+ |  blue = <Color.blue: 3>
+ |\x20\x20
+ |  green = <Color.green: 2>
+ |\x20\x20
+ |  red = <Color.red: 1>
+ |\x20\x20
+ |  ----------------------------------------------------------------------
+ |  Data descriptors inherited from enum.Enum:
+ |\x20\x20
+ |  name
+ |      The name of the Enum member.
+ |\x20\x20
+ |  value
+ |      The value of the Enum member.
+ |\x20\x20
+ |  ----------------------------------------------------------------------
+ |  Data descriptors inherited from enum.EnumMeta:
+ |\x20\x20
+ |  __members__
+ |      Returns a mapping of member name->value.
+ |\x20\x20\x20\x20\x20\x20
+ |      This mapping lists all enum members, including aliases. Note that this
+ |      is a read-only view of the internal mapping.
+""".strip()
+
+class TestStdLib(unittest.TestCase):
+
+    class Color(Enum):
+        red = 1
+        green = 2
+        blue = 3
+
+    def test_pydoc(self):
+        # indirectly test __objclass__
+        expected_text = expected_help_output % __name__
+        output = StringIO()
+        helper = pydoc.Helper(output=output)
+        helper(self.Color)
+        result = output.getvalue().strip()
+        self.assertEqual(result, expected_text)
+
+    def test_inspect_getmembers(self):
+        values = dict((
+                ('__class__', EnumMeta),
+                ('__doc__', None),
+                ('__members__', self.Color.__members__),
+                ('__module__', __name__),
+                ('blue', self.Color.blue),
+                ('green', self.Color.green),
+                ('name', Enum.__dict__['name']),
+                ('red', self.Color.red),
+                ('value', Enum.__dict__['value']),
+                ))
+        result = dict(inspect.getmembers(self.Color))
+        self.assertEqual(values.keys(), result.keys())
+        failed = False
+        for k in values.keys():
+            if result[k] != values[k]:
+                print()
+                print('\n%s\n     key: %s\n  result: %s\nexpected: %s\n%s\n' %
+                        ('=' * 75, k, result[k], values[k], '=' * 75), sep='')
+                failed = True
+        if failed:
+            self.fail("result does not equal expected, see print above")
+
+    def test_inspect_classify_class_attrs(self):
+        # indirectly test __objclass__
+        from inspect import Attribute
+        values = [
+                Attribute(name='__class__', kind='data',
+                    defining_class=object, object=EnumMeta),
+                Attribute(name='__doc__', kind='data',
+                    defining_class=self.Color, object=None),
+                Attribute(name='__members__', kind='property',
+                    defining_class=EnumMeta, object=EnumMeta.__members__),
+                Attribute(name='__module__', kind='data',
+                    defining_class=self.Color, object=__name__),
+                Attribute(name='blue', kind='data',
+                    defining_class=self.Color, object=self.Color.blue),
+                Attribute(name='green', kind='data',
+                    defining_class=self.Color, object=self.Color.green),
+                Attribute(name='red', kind='data',
+                    defining_class=self.Color, object=self.Color.red),
+                Attribute(name='name', kind='data',
+                    defining_class=Enum, object=Enum.__dict__['name']),
+                Attribute(name='value', kind='data',
+                    defining_class=Enum, object=Enum.__dict__['value']),
+                ]
+        values.sort(key=lambda item: item.name)
+        result = list(inspect.classify_class_attrs(self.Color))
+        result.sort(key=lambda item: item.name)
+        failed = False
+        for v, r in zip(values, result):
+            if r != v:
+                print('\n%s\n%s\n%s\n%s\n' % ('=' * 75, r, v, '=' * 75), sep='')
+                failed = True
+        if failed:
+            self.fail("result does not equal expected, see print above")
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Lib/test/test_enumerate.py b/Lib/test/test_enumerate.py
index 4af217b..e85254c 100644
--- a/Lib/test/test_enumerate.py
+++ b/Lib/test/test_enumerate.py
@@ -1,4 +1,5 @@
 import unittest
+import operator
 import sys
 import pickle
 
@@ -65,20 +66,21 @@
 class PickleTest:
     # Helper to check picklability
     def check_pickle(self, itorg, seq):
-        d = pickle.dumps(itorg)
-        it = pickle.loads(d)
-        self.assertEqual(type(itorg), type(it))
-        self.assertEqual(list(it), seq)
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            d = pickle.dumps(itorg, proto)
+            it = pickle.loads(d)
+            self.assertEqual(type(itorg), type(it))
+            self.assertEqual(list(it), seq)
 
-        it = pickle.loads(d)
-        try:
-            next(it)
-        except StopIteration:
-            self.assertFalse(seq[1:])
-            return
-        d = pickle.dumps(it)
-        it = pickle.loads(d)
-        self.assertEqual(list(it), seq[1:])
+            it = pickle.loads(d)
+            try:
+                next(it)
+            except StopIteration:
+                self.assertFalse(seq[1:])
+                continue
+            d = pickle.dumps(it, proto)
+            it = pickle.loads(d)
+            self.assertEqual(list(it), seq[1:])
 
 class EnumerateTestCase(unittest.TestCase, PickleTest):
 
@@ -168,15 +170,12 @@
         x = range(1)
         self.assertEqual(type(reversed(x)), type(iter(x)))
 
-    @support.cpython_only
     def test_len(self):
-        # This is an implementation detail, not an interface requirement
-        from test.test_iterlen import len
         for s in ('hello', tuple('hello'), list('hello'), range(5)):
-            self.assertEqual(len(reversed(s)), len(s))
+            self.assertEqual(operator.length_hint(reversed(s)), len(s))
             r = reversed(s)
             list(r)
-            self.assertEqual(len(r), 0)
+            self.assertEqual(operator.length_hint(r), 0)
         class SeqWithWeirdLen:
             called = False
             def __len__(self):
@@ -187,7 +186,7 @@
             def __getitem__(self, index):
                 return index
         r = reversed(SeqWithWeirdLen())
-        self.assertRaises(ZeroDivisionError, len, r)
+        self.assertRaises(ZeroDivisionError, operator.length_hint, r)
 
 
     def test_gc(self):
diff --git a/Lib/test/test_epoll.py b/Lib/test/test_epoll.py
index 871efb2..b37f033 100644
--- a/Lib/test/test_epoll.py
+++ b/Lib/test/test_epoll.py
@@ -21,10 +21,11 @@
 """
 Tests for epoll wrapper.
 """
-import socket
 import errno
-import time
+import os
 import select
+import socket
+import time
 import unittest
 
 from test import support
@@ -33,7 +34,7 @@
 
 try:
     select.epoll()
-except IOError as e:
+except OSError as e:
     if e.errno == errno.ENOSYS:
         raise unittest.SkipTest("kernel doesn't support epoll()")
     raise
@@ -55,7 +56,7 @@
         client.setblocking(False)
         try:
             client.connect(('127.0.0.1', self.serverSocket.getsockname()[1]))
-        except socket.error as e:
+        except OSError as e:
             self.assertEqual(e.args[0], errno.EINPROGRESS)
         else:
             raise AssertionError("Connect should have raised EINPROGRESS")
@@ -86,6 +87,13 @@
         self.assertRaises(TypeError, select.epoll, ['foo'])
         self.assertRaises(TypeError, select.epoll, {})
 
+    def test_context_manager(self):
+        with select.epoll(16) as ep:
+            self.assertGreater(ep.fileno(), 0)
+            self.assertFalse(ep.closed)
+        self.assertTrue(ep.closed)
+        self.assertRaises(ValueError, ep.fileno)
+
     def test_add(self):
         server, client = self._connected_pair()
 
@@ -114,12 +122,12 @@
             # ValueError: file descriptor cannot be a negative integer (-1)
             self.assertRaises(ValueError, ep.register, -1,
                 select.EPOLLIN | select.EPOLLOUT)
-            # IOError: [Errno 9] Bad file descriptor
-            self.assertRaises(IOError, ep.register, 10000,
+            # OSError: [Errno 9] Bad file descriptor
+            self.assertRaises(OSError, ep.register, 10000,
                 select.EPOLLIN | select.EPOLLOUT)
             # registering twice also raises an exception
             ep.register(server, select.EPOLLIN | select.EPOLLOUT)
-            self.assertRaises(IOError, ep.register, server,
+            self.assertRaises(OSError, ep.register, server,
                 select.EPOLLIN | select.EPOLLOUT)
         finally:
             ep.close()
@@ -141,7 +149,7 @@
         ep.close()
         try:
             ep2.poll(1, 4)
-        except IOError as e:
+        except OSError as e:
             self.assertEqual(e.args[0], errno.EBADF, e)
         else:
             self.fail("epoll on closed fd didn't raise EBADF")
@@ -155,9 +163,9 @@
         ep.register(client.fileno(),
                    select.EPOLLIN | select.EPOLLOUT | select.EPOLLET)
 
-        now = time.time()
+        now = time.monotonic()
         events = ep.poll(1, 4)
-        then = time.time()
+        then = time.monotonic()
         self.assertFalse(then - now > 0.1, then - now)
 
         events.sort()
@@ -166,19 +174,16 @@
         expected.sort()
 
         self.assertEqual(events, expected)
-        self.assertFalse(then - now > 0.01, then - now)
 
-        now = time.time()
         events = ep.poll(timeout=2.1, maxevents=4)
-        then = time.time()
         self.assertFalse(events)
 
         client.send(b"Hello!")
         server.send(b"world!!!")
 
-        now = time.time()
+        now = time.monotonic()
         events = ep.poll(1, 4)
-        then = time.time()
+        then = time.monotonic()
         self.assertFalse(then - now > 0.01)
 
         events.sort()
@@ -190,9 +195,9 @@
 
         ep.unregister(client.fileno())
         ep.modify(server.fileno(), select.EPOLLOUT)
-        now = time.time()
+        now = time.monotonic()
         events = ep.poll(1, 4)
-        then = time.time()
+        then = time.monotonic()
         self.assertFalse(then - now > 0.01)
 
         expected = [(server.fileno(), select.EPOLLOUT)]
@@ -209,14 +214,43 @@
         ep = select.epoll(16)
         ep.register(server)
 
-        now = time.time()
+        now = time.monotonic()
         events = ep.poll(1, 4)
-        then = time.time()
+        then = time.monotonic()
         self.assertFalse(then - now > 0.01)
 
         server.close()
         ep.unregister(fd)
 
+    def test_close(self):
+        open_file = open(__file__, "rb")
+        self.addCleanup(open_file.close)
+        fd = open_file.fileno()
+        epoll = select.epoll()
+
+        # test fileno() method and closed attribute
+        self.assertIsInstance(epoll.fileno(), int)
+        self.assertFalse(epoll.closed)
+
+        # test close()
+        epoll.close()
+        self.assertTrue(epoll.closed)
+        self.assertRaises(ValueError, epoll.fileno)
+
+        # close() can be called more than once
+        epoll.close()
+
+        # operations must fail with ValueError("I/O operation on closed ...")
+        self.assertRaises(ValueError, epoll.modify, fd, select.EPOLLIN)
+        self.assertRaises(ValueError, epoll.poll, 1.0)
+        self.assertRaises(ValueError, epoll.register, fd, select.EPOLLIN)
+        self.assertRaises(ValueError, epoll.unregister, fd)
+
+    def test_fd_non_inheritable(self):
+        epoll = select.epoll()
+        self.addCleanup(epoll.close)
+        self.assertEqual(os.get_inheritable(epoll.fileno()), False)
+
 
 def test_main():
     support.run_unittest(TestEPoll)
diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py
index 8d11d90..28801bd 100644
--- a/Lib/test/test_exceptions.py
+++ b/Lib/test/test_exceptions.py
@@ -8,8 +8,8 @@
 import errno
 
 from test.support import (TESTFN, captured_output, check_impl_detail,
-                          check_warnings, cpython_only, gc_collect,
-                          no_tracing, run_unittest, unlink)
+                          check_warnings, cpython_only, gc_collect, run_unittest,
+                          no_tracing, unlink)
 
 class NaiveException(Exception):
     def __init__(self, x):
@@ -257,22 +257,22 @@
                 {'args' : ('foo', 1)}),
             (SystemExit, ('foo',),
                 {'args' : ('foo',), 'code' : 'foo'}),
-            (IOError, ('foo',),
+            (OSError, ('foo',),
                 {'args' : ('foo',), 'filename' : None,
                  'errno' : None, 'strerror' : None}),
-            (IOError, ('foo', 'bar'),
+            (OSError, ('foo', 'bar'),
                 {'args' : ('foo', 'bar'), 'filename' : None,
                  'errno' : 'foo', 'strerror' : 'bar'}),
-            (IOError, ('foo', 'bar', 'baz'),
+            (OSError, ('foo', 'bar', 'baz'),
                 {'args' : ('foo', 'bar'), 'filename' : 'baz',
                  'errno' : 'foo', 'strerror' : 'bar'}),
-            (IOError, ('foo', 'bar', 'baz', 'quux'),
-                {'args' : ('foo', 'bar', 'baz', 'quux')}),
-            (EnvironmentError, ('errnoStr', 'strErrorStr', 'filenameStr'),
+            (OSError, ('foo', 'bar', 'baz', None, 'quux'),
+                {'args' : ('foo', 'bar'), 'filename' : 'baz', 'filename2': 'quux'}),
+            (OSError, ('errnoStr', 'strErrorStr', 'filenameStr'),
                 {'args' : ('errnoStr', 'strErrorStr'),
                  'strerror' : 'strErrorStr', 'errno' : 'errnoStr',
                  'filename' : 'filenameStr'}),
-            (EnvironmentError, (1, 'strErrorStr', 'filenameStr'),
+            (OSError, (1, 'strErrorStr', 'filenameStr'),
                 {'args' : (1, 'strErrorStr'), 'errno' : 1,
                  'strerror' : 'strErrorStr', 'filename' : 'filenameStr'}),
             (SyntaxError, (), {'msg' : None, 'text' : None,
@@ -422,7 +422,7 @@
         self.assertIsNone(e.__context__)
         self.assertIsNone(e.__cause__)
 
-        class MyException(EnvironmentError):
+        class MyException(OSError):
             pass
 
         e = MyException()
@@ -763,7 +763,7 @@
             pass
         self.assertEqual(e, (None, None, None))
 
-    def testUnicodeChangeAttributes(self):
+    def test_unicode_change_attributes(self):
         # See issue 7309. This was a crasher.
 
         u = UnicodeEncodeError('baz', 'xxxxx', 1, 5, 'foo')
@@ -800,6 +800,12 @@
         u.start = 1000
         self.assertEqual(str(u), "can't translate characters in position 1000-4: 965230951443685724997")
 
+    def test_unicode_errors_no_object(self):
+        # See issue #21134.
+        klasses = UnicodeEncodeError, UnicodeDecodeError, UnicodeTranslateError
+        for klass in klasses:
+            self.assertEqual(str(klass.__new__(klass)), "")
+
     @no_tracing
     def test_badisinstance(self):
         # Bug #2542: if issubclass(e, MyException) raises an exception,
@@ -968,8 +974,5 @@
             self.assertEqual(str(arg), str(exc))
 
 
-def test_main():
-    run_unittest(ExceptionTests, ImportErrorTests)
-
 if __name__ == '__main__':
     unittest.main()
diff --git a/Lib/test/test_faulthandler.py b/Lib/test/test_faulthandler.py
index 770e70c..e68a09e 100644
--- a/Lib/test/test_faulthandler.py
+++ b/Lib/test/test_faulthandler.py
@@ -10,6 +10,7 @@
 from test.script_helper import assert_python_ok
 import tempfile
 import unittest
+from textwrap import dedent
 
 try:
     import threading
@@ -19,18 +20,6 @@
 
 TIMEOUT = 0.5
 
-try:
-    from resource import setrlimit, RLIMIT_CORE, error as resource_error
-except ImportError:
-    prepare_subprocess = None
-else:
-    def prepare_subprocess():
-        # don't create core file
-        try:
-            setrlimit(RLIMIT_CORE, (0, 0))
-        except (ValueError, resource_error):
-            pass
-
 def expected_traceback(lineno1, lineno2, header, min_count=1):
     regex = header
     regex += '  File "<string>", line %s in func\n' % lineno1
@@ -59,10 +48,9 @@
         build, and replace "Current thread 0x00007f8d8fbd9700" by "Current
         thread XXX".
         """
-        options = {}
-        if prepare_subprocess:
-            options['preexec_fn'] = prepare_subprocess
-        process = script_helper.spawn_python('-c', code, **options)
+        code = dedent(code).strip()
+        with support.SuppressCrashReport():
+            process = script_helper.spawn_python('-c', code)
         stdout, stderr = process.communicate()
         exitcode = process.wait()
         output = support.strip_python_stderr(stdout)
@@ -86,23 +74,22 @@
         Raise an error if the output doesn't match the expected format.
         """
         if all_threads:
-            header = 'Current thread XXX'
+            header = 'Current thread XXX (most recent call first)'
         else:
-            header = 'Traceback (most recent call first)'
+            header = 'Stack (most recent call first)'
         regex = """
-^Fatal Python error: {name}
+            ^Fatal Python error: {name}
 
-{header}:
-  File "<string>", line {lineno} in <module>
-""".strip()
-        regex = regex.format(
+            {header}:
+              File "<string>", line {lineno} in <module>
+            """
+        regex = dedent(regex.format(
             lineno=line_number,
             name=name_regex,
-            header=re.escape(header))
+            header=re.escape(header))).strip()
         if other_regex:
             regex += '|' + other_regex
-        with support.suppress_crash_popup():
-            output, exitcode = self.get_output(code, filename)
+        output, exitcode = self.get_output(code, filename)
         output = '\n'.join(output)
         self.assertRegex(output, regex)
         self.assertNotEqual(exitcode, 0)
@@ -111,29 +98,29 @@
                      "the first page of memory is a mapped read-only on AIX")
     def test_read_null(self):
         self.check_fatal_error("""
-import faulthandler
-faulthandler.enable()
-faulthandler._read_null()
-""".strip(),
+            import faulthandler
+            faulthandler.enable()
+            faulthandler._read_null()
+            """,
             3,
             # Issue #12700: Read NULL raises SIGILL on Mac OS X Lion
             '(?:Segmentation fault|Bus error|Illegal instruction)')
 
     def test_sigsegv(self):
         self.check_fatal_error("""
-import faulthandler
-faulthandler.enable()
-faulthandler._sigsegv()
-""".strip(),
+            import faulthandler
+            faulthandler.enable()
+            faulthandler._sigsegv()
+            """,
             3,
             'Segmentation fault')
 
     def test_sigabrt(self):
         self.check_fatal_error("""
-import faulthandler
-faulthandler.enable()
-faulthandler._sigabrt()
-""".strip(),
+            import faulthandler
+            faulthandler.enable()
+            faulthandler._sigabrt()
+            """,
             3,
             'Aborted')
 
@@ -141,10 +128,10 @@
                      "SIGFPE cannot be caught on Windows")
     def test_sigfpe(self):
         self.check_fatal_error("""
-import faulthandler
-faulthandler.enable()
-faulthandler._sigfpe()
-""".strip(),
+            import faulthandler
+            faulthandler.enable()
+            faulthandler._sigfpe()
+            """,
             3,
             'Floating point exception')
 
@@ -152,10 +139,10 @@
                      "need faulthandler._sigbus()")
     def test_sigbus(self):
         self.check_fatal_error("""
-import faulthandler
-faulthandler.enable()
-faulthandler._sigbus()
-""".strip(),
+            import faulthandler
+            faulthandler.enable()
+            faulthandler._sigbus()
+            """,
             3,
             'Bus error')
 
@@ -163,18 +150,18 @@
                      "need faulthandler._sigill()")
     def test_sigill(self):
         self.check_fatal_error("""
-import faulthandler
-faulthandler.enable()
-faulthandler._sigill()
-""".strip(),
+            import faulthandler
+            faulthandler.enable()
+            faulthandler._sigill()
+            """,
             3,
             'Illegal instruction')
 
     def test_fatal_error(self):
         self.check_fatal_error("""
-import faulthandler
-faulthandler._fatal_error(b'xyz')
-""".strip(),
+            import faulthandler
+            faulthandler._fatal_error(b'xyz')
+            """,
             2,
             'xyz')
 
@@ -185,56 +172,55 @@
                      'need faulthandler._stack_overflow()')
     def test_stack_overflow(self):
         self.check_fatal_error("""
-import faulthandler
-faulthandler.enable()
-faulthandler._stack_overflow()
-""".strip(),
+            import faulthandler
+            faulthandler.enable()
+            faulthandler._stack_overflow()
+            """,
             3,
             '(?:Segmentation fault|Bus error)',
             other_regex='unable to raise a stack overflow')
 
     def test_gil_released(self):
         self.check_fatal_error("""
-import faulthandler
-faulthandler.enable()
-faulthandler._read_null(True)
-""".strip(),
+            import faulthandler
+            faulthandler.enable()
+            faulthandler._sigsegv(True)
+            """,
             3,
-            '(?:Segmentation fault|Bus error|Illegal instruction)')
+            'Segmentation fault')
 
     def test_enable_file(self):
         with temporary_filename() as filename:
             self.check_fatal_error("""
-import faulthandler
-output = open({filename}, 'wb')
-faulthandler.enable(output)
-faulthandler._sigsegv()
-""".strip().format(filename=repr(filename)),
+                import faulthandler
+                output = open({filename}, 'wb')
+                faulthandler.enable(output)
+                faulthandler._sigsegv()
+                """.format(filename=repr(filename)),
                 4,
                 'Segmentation fault',
                 filename=filename)
 
     def test_enable_single_thread(self):
         self.check_fatal_error("""
-import faulthandler
-faulthandler.enable(all_threads=False)
-faulthandler._sigsegv()
-""".strip(),
+            import faulthandler
+            faulthandler.enable(all_threads=False)
+            faulthandler._sigsegv()
+            """,
             3,
             'Segmentation fault',
             all_threads=False)
 
     def test_disable(self):
         code = """
-import faulthandler
-faulthandler.enable()
-faulthandler.disable()
-faulthandler._sigsegv()
-""".strip()
+            import faulthandler
+            faulthandler.enable()
+            faulthandler.disable()
+            faulthandler._sigsegv()
+            """
         not_expected = 'Fatal Python error'
-        with support.suppress_crash_popup():
-            stderr, exitcode = self.get_output(code)
-        stder = '\n'.join(stderr)
+        stderr, exitcode = self.get_output(code)
+        stderr = '\n'.join(stderr)
         self.assertTrue(not_expected not in stderr,
                      "%r is present in %r" % (not_expected, stderr))
         self.assertNotEqual(exitcode, 0)
@@ -264,16 +250,42 @@
     def test_disabled_by_default(self):
         # By default, the module should be disabled
         code = "import faulthandler; print(faulthandler.is_enabled())"
-        rc, stdout, stderr = assert_python_ok("-c", code)
-        stdout = (stdout + stderr).strip()
-        self.assertEqual(stdout, b"False")
+        args = filter(None, (sys.executable,
+                             "-E" if sys.flags.ignore_environment else "",
+                             "-c", code))
+        env = os.environ.copy()
+        env.pop("PYTHONFAULTHANDLER", None)
+        # don't use assert_python_ok() because it always enables faulthandler
+        output = subprocess.check_output(args, env=env)
+        self.assertEqual(output.rstrip(), b"False")
 
     def test_sys_xoptions(self):
         # Test python -X faulthandler
         code = "import faulthandler; print(faulthandler.is_enabled())"
-        rc, stdout, stderr = assert_python_ok("-X", "faulthandler", "-c", code)
-        stdout = (stdout + stderr).strip()
-        self.assertEqual(stdout, b"True")
+        args = filter(None, (sys.executable,
+                             "-E" if sys.flags.ignore_environment else "",
+                             "-X", "faulthandler", "-c", code))
+        env = os.environ.copy()
+        env.pop("PYTHONFAULTHANDLER", None)
+        # don't use assert_python_ok() because it always enables faulthandler
+        output = subprocess.check_output(args, env=env)
+        self.assertEqual(output.rstrip(), b"True")
+
+    def test_env_var(self):
+        # empty env var
+        code = "import faulthandler; print(faulthandler.is_enabled())"
+        args = (sys.executable, "-c", code)
+        env = os.environ.copy()
+        env['PYTHONFAULTHANDLER'] = ''
+        # don't use assert_python_ok() because it always enables faulthandler
+        output = subprocess.check_output(args, env=env)
+        self.assertEqual(output.rstrip(), b"False")
+
+        # non-empty env var
+        env = os.environ.copy()
+        env['PYTHONFAULTHANDLER'] = '1'
+        output = subprocess.check_output(args, env=env)
+        self.assertEqual(output.rstrip(), b"True")
 
     def check_dump_traceback(self, filename):
         """
@@ -281,20 +293,20 @@
         Raise an error if the output doesn't match the expected format.
         """
         code = """
-import faulthandler
+            import faulthandler
 
-def funcB():
-    if {has_filename}:
-        with open({filename}, "wb") as fp:
-            faulthandler.dump_traceback(fp, all_threads=False)
-    else:
-        faulthandler.dump_traceback(all_threads=False)
+            def funcB():
+                if {has_filename}:
+                    with open({filename}, "wb") as fp:
+                        faulthandler.dump_traceback(fp, all_threads=False)
+                else:
+                    faulthandler.dump_traceback(all_threads=False)
 
-def funcA():
-    funcB()
+            def funcA():
+                funcB()
 
-funcA()
-""".strip()
+            funcA()
+            """
         code = code.format(
             filename=repr(filename),
             has_filename=bool(filename),
@@ -304,7 +316,7 @@
         else:
             lineno = 8
         expected = [
-            'Traceback (most recent call first):',
+            'Stack (most recent call first):',
             '  File "<string>", line %s in funcB' % lineno,
             '  File "<string>", line 11 in funcA',
             '  File "<string>", line 13 in <module>'
@@ -325,18 +337,18 @@
         func_name = 'x' * (maxlen + 50)
         truncated = 'x' * maxlen + '...'
         code = """
-import faulthandler
+            import faulthandler
 
-def {func_name}():
-    faulthandler.dump_traceback(all_threads=False)
+            def {func_name}():
+                faulthandler.dump_traceback(all_threads=False)
 
-{func_name}()
-""".strip()
+            {func_name}()
+            """
         code = code.format(
             func_name=func_name,
         )
         expected = [
-            'Traceback (most recent call first):',
+            'Stack (most recent call first):',
             '  File "<string>", line 4 in %s' % truncated,
             '  File "<string>", line 6 in <module>'
         ]
@@ -351,37 +363,37 @@
         Raise an error if the output doesn't match the expected format.
         """
         code = """
-import faulthandler
-from threading import Thread, Event
-import time
+            import faulthandler
+            from threading import Thread, Event
+            import time
 
-def dump():
-    if {filename}:
-        with open({filename}, "wb") as fp:
-            faulthandler.dump_traceback(fp, all_threads=True)
-    else:
-        faulthandler.dump_traceback(all_threads=True)
+            def dump():
+                if {filename}:
+                    with open({filename}, "wb") as fp:
+                        faulthandler.dump_traceback(fp, all_threads=True)
+                else:
+                    faulthandler.dump_traceback(all_threads=True)
 
-class Waiter(Thread):
-    # avoid blocking if the main thread raises an exception.
-    daemon = True
+            class Waiter(Thread):
+                # avoid blocking if the main thread raises an exception.
+                daemon = True
 
-    def __init__(self):
-        Thread.__init__(self)
-        self.running = Event()
-        self.stop = Event()
+                def __init__(self):
+                    Thread.__init__(self)
+                    self.running = Event()
+                    self.stop = Event()
 
-    def run(self):
-        self.running.set()
-        self.stop.wait()
+                def run(self):
+                    self.running.set()
+                    self.stop.wait()
 
-waiter = Waiter()
-waiter.start()
-waiter.running.wait()
-dump()
-waiter.stop.set()
-waiter.join()
-""".strip()
+            waiter = Waiter()
+            waiter.start()
+            waiter.running.wait()
+            dump()
+            waiter.stop.set()
+            waiter.join()
+            """
         code = code.format(filename=repr(filename))
         output, exitcode = self.get_output(code, filename)
         output = '\n'.join(output)
@@ -390,17 +402,17 @@
         else:
             lineno = 10
         regex = """
-^Thread 0x[0-9a-f]+:
-(?:  File ".*threading.py", line [0-9]+ in [_a-z]+
-){{1,3}}  File "<string>", line 23 in run
-  File ".*threading.py", line [0-9]+ in _bootstrap_inner
-  File ".*threading.py", line [0-9]+ in _bootstrap
+            ^Thread 0x[0-9a-f]+ \(most recent call first\):
+            (?:  File ".*threading.py", line [0-9]+ in [_a-z]+
+            ){{1,3}}  File "<string>", line 23 in run
+              File ".*threading.py", line [0-9]+ in _bootstrap_inner
+              File ".*threading.py", line [0-9]+ in _bootstrap
 
-Current thread XXX:
-  File "<string>", line {lineno} in dump
-  File "<string>", line 28 in <module>$
-""".strip()
-        regex = regex.format(lineno=lineno)
+            Current thread XXX \(most recent call first\):
+              File "<string>", line {lineno} in dump
+              File "<string>", line 28 in <module>$
+            """
+        regex = dedent(regex.format(lineno=lineno)).strip()
         self.assertRegex(output, regex)
         self.assertEqual(exitcode, 0)
 
@@ -421,29 +433,29 @@
         """
         timeout_str = str(datetime.timedelta(seconds=TIMEOUT))
         code = """
-import faulthandler
-import time
+            import faulthandler
+            import time
 
-def func(timeout, repeat, cancel, file, loops):
-    for loop in range(loops):
-        faulthandler.dump_traceback_later(timeout, repeat=repeat, file=file)
-        if cancel:
-            faulthandler.cancel_dump_traceback_later()
-        time.sleep(timeout * 5)
-        faulthandler.cancel_dump_traceback_later()
+            def func(timeout, repeat, cancel, file, loops):
+                for loop in range(loops):
+                    faulthandler.dump_traceback_later(timeout, repeat=repeat, file=file)
+                    if cancel:
+                        faulthandler.cancel_dump_traceback_later()
+                    time.sleep(timeout * 5)
+                    faulthandler.cancel_dump_traceback_later()
 
-timeout = {timeout}
-repeat = {repeat}
-cancel = {cancel}
-loops = {loops}
-if {has_filename}:
-    file = open({filename}, "wb")
-else:
-    file = None
-func(timeout, repeat, cancel, file, loops)
-if file is not None:
-    file.close()
-""".strip()
+            timeout = {timeout}
+            repeat = {repeat}
+            cancel = {cancel}
+            loops = {loops}
+            if {has_filename}:
+                file = open({filename}, "wb")
+            else:
+                file = None
+            func(timeout, repeat, cancel, file, loops)
+            if file is not None:
+                file.close()
+            """
         code = code.format(
             timeout=TIMEOUT,
             repeat=repeat,
@@ -459,7 +471,7 @@
             count = loops
             if repeat:
                 count *= 2
-            header = r'Timeout \(%s\)!\nThread 0x[0-9a-f]+:\n' % timeout_str
+            header = r'Timeout \(%s\)!\nThread 0x[0-9a-f]+ \(most recent call first\):\n' % timeout_str
             regex = expected_traceback(9, 20, header, min_count=count)
             self.assertRegex(trace, regex)
         else:
@@ -510,45 +522,45 @@
         """
         signum = signal.SIGUSR1
         code = """
-import faulthandler
-import os
-import signal
-import sys
+            import faulthandler
+            import os
+            import signal
+            import sys
 
-def func(signum):
-    os.kill(os.getpid(), signum)
+            def func(signum):
+                os.kill(os.getpid(), signum)
 
-def handler(signum, frame):
-    handler.called = True
-handler.called = False
+            def handler(signum, frame):
+                handler.called = True
+            handler.called = False
 
-exitcode = 0
-signum = {signum}
-unregister = {unregister}
-chain = {chain}
+            exitcode = 0
+            signum = {signum}
+            unregister = {unregister}
+            chain = {chain}
 
-if {has_filename}:
-    file = open({filename}, "wb")
-else:
-    file = None
-if chain:
-    signal.signal(signum, handler)
-faulthandler.register(signum, file=file,
-                      all_threads={all_threads}, chain={chain})
-if unregister:
-    faulthandler.unregister(signum)
-func(signum)
-if chain and not handler.called:
-    if file is not None:
-        output = file
-    else:
-        output = sys.stderr
-    print("Error: signal handler not called!", file=output)
-    exitcode = 1
-if file is not None:
-    file.close()
-sys.exit(exitcode)
-""".strip()
+            if {has_filename}:
+                file = open({filename}, "wb")
+            else:
+                file = None
+            if chain:
+                signal.signal(signum, handler)
+            faulthandler.register(signum, file=file,
+                                  all_threads={all_threads}, chain={chain})
+            if unregister:
+                faulthandler.unregister(signum)
+            func(signum)
+            if chain and not handler.called:
+                if file is not None:
+                    output = file
+                else:
+                    output = sys.stderr
+                print("Error: signal handler not called!", file=output)
+                exitcode = 1
+            if file is not None:
+                file.close()
+            sys.exit(exitcode)
+            """
         code = code.format(
             filename=repr(filename),
             has_filename=bool(filename),
@@ -561,9 +573,9 @@
         trace = '\n'.join(trace)
         if not unregister:
             if all_threads:
-                regex = 'Current thread XXX:\n'
+                regex = 'Current thread XXX \(most recent call first\):\n'
             else:
-                regex = 'Traceback \(most recent call first\):\n'
+                regex = 'Stack \(most recent call first\):\n'
             regex = expected_traceback(7, 28, regex)
             self.assertRegex(trace, regex)
         else:
@@ -589,9 +601,31 @@
     def test_register_chain(self):
         self.check_register(chain=True)
 
+    @contextmanager
+    def check_stderr_none(self):
+        stderr = sys.stderr
+        try:
+            sys.stderr = None
+            with self.assertRaises(RuntimeError) as cm:
+                yield
+            self.assertEqual(str(cm.exception), "sys.stderr is None")
+        finally:
+            sys.stderr = stderr
 
-def test_main():
-    support.run_unittest(FaultHandlerTests)
+    def test_stderr_None(self):
+        # Issue #21497: provide an helpful error if sys.stderr is None,
+        # instead of just an attribute error: "None has no attribute fileno".
+        with self.check_stderr_none():
+            faulthandler.enable()
+        with self.check_stderr_none():
+            faulthandler.dump_traceback()
+        if hasattr(faulthandler, 'dump_traceback_later'):
+            with self.check_stderr_none():
+                faulthandler.dump_traceback_later(1e-3)
+        if hasattr(faulthandler, "register"):
+            with self.check_stderr_none():
+                faulthandler.register(signal.SIGUSR1)
+
 
 if __name__ == "__main__":
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_fcntl.py b/Lib/test/test_fcntl.py
index 1810c4e..e3b7ed2 100644
--- a/Lib/test/test_fcntl.py
+++ b/Lib/test/test_fcntl.py
@@ -1,7 +1,4 @@
 """Test program for the fcntl C module.
-
-OS/2+EMX doesn't support the file locking operations.
-
 """
 import platform
 import os
@@ -39,8 +36,6 @@
         lockdata = struct.pack('qqihhi', 0, 0, 0, fcntl.F_WRLCK, 0, 0)
     elif sys.platform in ['aix3', 'aix4', 'hp-uxB', 'unixware7']:
         lockdata = struct.pack('hhlllii', fcntl.F_WRLCK, 0, 0, 0, 0, 0, 0)
-    elif sys.platform in ['os2emx']:
-        lockdata = None
     else:
         lockdata = struct.pack('hh'+start_len+'hh', fcntl.F_WRLCK, 0, 0, 0, 0, 0)
     if lockdata:
@@ -72,18 +67,20 @@
         rv = fcntl.fcntl(self.f.fileno(), fcntl.F_SETFL, os.O_NONBLOCK)
         if verbose:
             print('Status from fcntl with O_NONBLOCK: ', rv)
-        if sys.platform not in ['os2emx']:
-            rv = fcntl.fcntl(self.f.fileno(), fcntl.F_SETLKW, lockdata)
-            if verbose:
-                print('String from fcntl with F_SETLKW: ', repr(rv))
+        rv = fcntl.fcntl(self.f.fileno(), fcntl.F_SETLKW, lockdata)
+        if verbose:
+            print('String from fcntl with F_SETLKW: ', repr(rv))
         self.f.close()
 
     def test_fcntl_file_descriptor(self):
         # again, but pass the file rather than numeric descriptor
         self.f = open(TESTFN, 'wb')
         rv = fcntl.fcntl(self.f, fcntl.F_SETFL, os.O_NONBLOCK)
-        if sys.platform not in ['os2emx']:
-            rv = fcntl.fcntl(self.f, fcntl.F_SETLKW, lockdata)
+        if verbose:
+            print('Status from fcntl with O_NONBLOCK: ', rv)
+        rv = fcntl.fcntl(self.f, fcntl.F_SETLKW, lockdata)
+        if verbose:
+            print('String from fcntl with F_SETLKW: ', repr(rv))
         self.f.close()
 
     def test_fcntl_bad_file(self):
@@ -127,6 +124,26 @@
         finally:
             os.close(fd)
 
+    def test_flock(self):
+        # Solaris needs readable file for shared lock
+        self.f = open(TESTFN, 'wb+')
+        fileno = self.f.fileno()
+        fcntl.flock(fileno, fcntl.LOCK_SH)
+        fcntl.flock(fileno, fcntl.LOCK_UN)
+        fcntl.flock(self.f, fcntl.LOCK_SH | fcntl.LOCK_NB)
+        fcntl.flock(self.f, fcntl.LOCK_UN)
+        fcntl.flock(fileno, fcntl.LOCK_EX)
+        fcntl.flock(fileno, fcntl.LOCK_UN)
+
+        self.assertRaises(ValueError, fcntl.flock, -1, fcntl.LOCK_SH)
+        self.assertRaises(TypeError, fcntl.flock, 'spam', fcntl.LOCK_SH)
+
+    @cpython_only
+    def test_flock_overflow(self):
+        import _testcapi
+        self.assertRaises(OverflowError, fcntl.flock, _testcapi.INT_MAX+1,
+                          fcntl.LOCK_SH)
+
 
 def test_main():
     run_unittest(TestFcntl)
diff --git a/Lib/test/test_file.py b/Lib/test/test_file.py
index 76b1694..d54e976 100644
--- a/Lib/test/test_file.py
+++ b/Lib/test/test_file.py
@@ -87,7 +87,7 @@
         self.assertTrue(not f.closed)
 
         if hasattr(f, "readinto"):
-            self.assertRaises((IOError, TypeError), f.readinto, "")
+            self.assertRaises((OSError, TypeError), f.readinto, "")
         f.close()
         self.assertTrue(f.closed)
 
@@ -126,7 +126,7 @@
             self.assertEqual(self.f.__exit__(*sys.exc_info()), None)
 
     def testReadWhenWriting(self):
-        self.assertRaises(IOError, self.f.read)
+        self.assertRaises(OSError, self.f.read)
 
 class CAutoFileTests(AutoFileTests, unittest.TestCase):
     open = io.open
@@ -177,7 +177,7 @@
                 d = int(f.read().decode("ascii"))
                 f.close()
                 f.close()
-            except IOError as msg:
+            except OSError as msg:
                 self.fail('error setting buffer size %d: %s' % (s, str(msg)))
             self.assertEqual(d, s)
 
diff --git a/Lib/test/test_filecmp.py b/Lib/test/test_filecmp.py
index 0959979..b5b24a2 100644
--- a/Lib/test/test_filecmp.py
+++ b/Lib/test/test_filecmp.py
@@ -1,8 +1,12 @@
-
-import os, filecmp, shutil, tempfile
+import filecmp
+import os
+import shutil
+import tempfile
 import unittest
+
 from test import support
 
+
 class FileCompareTestCase(unittest.TestCase):
     def setUp(self):
         self.name = support.TESTFN
@@ -10,13 +14,11 @@
         self.name_diff = support.TESTFN + '-diff'
         data = 'Contents of file go here.\n'
         for name in [self.name, self.name_same, self.name_diff]:
-            output = open(name, 'w')
-            output.write(data)
-            output.close()
+            with open(name, 'w') as output:
+                output.write(data)
 
-        output = open(self.name_diff, 'a+')
-        output.write('An extra line.\n')
-        output.close()
+        with open(self.name_diff, 'a+') as output:
+            output.write('An extra line.\n')
         self.dir = tempfile.gettempdir()
 
     def tearDown(self):
@@ -25,13 +27,13 @@
         os.unlink(self.name_diff)
 
     def test_matching(self):
-        self.assertTrue(filecmp.cmp(self.name, self.name_same),
-                        "Comparing file to itself fails")
-        self.assertTrue(filecmp.cmp(self.name, self.name_same, shallow=False),
+        self.assertTrue(filecmp.cmp(self.name, self.name),
                         "Comparing file to itself fails")
         self.assertTrue(filecmp.cmp(self.name, self.name, shallow=False),
+                        "Comparing file to itself fails")
+        self.assertTrue(filecmp.cmp(self.name, self.name_same),
                         "Comparing file to identical file fails")
-        self.assertTrue(filecmp.cmp(self.name, self.name),
+        self.assertTrue(filecmp.cmp(self.name, self.name_same, shallow=False),
                         "Comparing file to identical file fails")
 
     def test_different(self):
@@ -40,33 +42,45 @@
         self.assertFalse(filecmp.cmp(self.name, self.dir),
                     "File and directory compare as equal")
 
+    def test_cache_clear(self):
+        first_compare = filecmp.cmp(self.name, self.name_same, shallow=False)
+        second_compare = filecmp.cmp(self.name, self.name_diff, shallow=False)
+        filecmp.clear_cache()
+        self.assertTrue(len(filecmp._cache) == 0,
+                        "Cache not cleared after calling clear_cache")
+
 class DirCompareTestCase(unittest.TestCase):
     def setUp(self):
         tmpdir = tempfile.gettempdir()
         self.dir = os.path.join(tmpdir, 'dir')
         self.dir_same = os.path.join(tmpdir, 'dir-same')
         self.dir_diff = os.path.join(tmpdir, 'dir-diff')
+
+        # Another dir is created under dir_same, but it has a name from the
+        # ignored list so it should not affect testing results.
+        self.dir_ignored = os.path.join(self.dir_same, '.hg')
+
         self.caseinsensitive = os.path.normcase('A') == os.path.normcase('a')
         data = 'Contents of file go here.\n'
-        for dir in [self.dir, self.dir_same, self.dir_diff]:
+        for dir in (self.dir, self.dir_same, self.dir_diff, self.dir_ignored):
             shutil.rmtree(dir, True)
             os.mkdir(dir)
             if self.caseinsensitive and dir is self.dir_same:
                 fn = 'FiLe'     # Verify case-insensitive comparison
             else:
                 fn = 'file'
-            output = open(os.path.join(dir, fn), 'w')
-            output.write(data)
-            output.close()
+            with open(os.path.join(dir, fn), 'w') as output:
+                output.write(data)
 
-        output = open(os.path.join(self.dir_diff, 'file2'), 'w')
-        output.write('An extra file.\n')
-        output.close()
+        with open(os.path.join(self.dir_diff, 'file2'), 'w') as output:
+            output.write('An extra file.\n')
 
     def tearDown(self):
-        shutil.rmtree(self.dir)
-        shutil.rmtree(self.dir_same)
-        shutil.rmtree(self.dir_diff)
+        for dir in (self.dir, self.dir_same, self.dir_diff):
+            shutil.rmtree(dir)
+
+    def test_default_ignores(self):
+        self.assertIn('.hg', filecmp.DEFAULT_IGNORES)
 
     def test_cmpfiles(self):
         self.assertTrue(filecmp.cmpfiles(self.dir, self.dir, ['file']) ==
@@ -86,9 +100,8 @@
                         "Comparing directory to same fails")
 
         # Add different file2
-        output = open(os.path.join(self.dir, 'file2'), 'w')
-        output.write('Different contents.\n')
-        output.close()
+        with open(os.path.join(self.dir, 'file2'), 'w') as output:
+            output.write('Different contents.\n')
 
         self.assertFalse(filecmp.cmpfiles(self.dir, self.dir_same,
                                      ['file', 'file2']) ==
@@ -107,30 +120,94 @@
         else:
             self.assertEqual([d.left_list, d.right_list],[['file'], ['file']])
         self.assertEqual(d.common, ['file'])
-        self.assertTrue(d.left_only == d.right_only == [])
+        self.assertEqual(d.left_only, [])
+        self.assertEqual(d.right_only, [])
         self.assertEqual(d.same_files, ['file'])
         self.assertEqual(d.diff_files, [])
+        expected_report = [
+            "diff {} {}".format(self.dir, self.dir_same),
+            "Identical files : ['file']",
+        ]
+        self._assert_report(d.report, expected_report)
 
-        # Check attributes for comparison of two different directories
+        # Check attributes for comparison of two different directories (right)
         left_dir, right_dir = self.dir, self.dir_diff
         d = filecmp.dircmp(left_dir, right_dir)
         self.assertEqual(d.left, left_dir)
         self.assertEqual(d.right, right_dir)
         self.assertEqual(d.left_list, ['file'])
-        self.assertTrue(d.right_list == ['file', 'file2'])
+        self.assertEqual(d.right_list, ['file', 'file2'])
         self.assertEqual(d.common, ['file'])
         self.assertEqual(d.left_only, [])
         self.assertEqual(d.right_only, ['file2'])
         self.assertEqual(d.same_files, ['file'])
         self.assertEqual(d.diff_files, [])
+        expected_report = [
+            "diff {} {}".format(self.dir, self.dir_diff),
+            "Only in {} : ['file2']".format(self.dir_diff),
+            "Identical files : ['file']",
+        ]
+        self._assert_report(d.report, expected_report)
+
+        # Check attributes for comparison of two different directories (left)
+        left_dir, right_dir = self.dir, self.dir_diff
+        shutil.move(
+            os.path.join(self.dir_diff, 'file2'),
+            os.path.join(self.dir, 'file2')
+        )
+        d = filecmp.dircmp(left_dir, right_dir)
+        self.assertEqual(d.left, left_dir)
+        self.assertEqual(d.right, right_dir)
+        self.assertEqual(d.left_list, ['file', 'file2'])
+        self.assertEqual(d.right_list, ['file'])
+        self.assertEqual(d.common, ['file'])
+        self.assertEqual(d.left_only, ['file2'])
+        self.assertEqual(d.right_only, [])
+        self.assertEqual(d.same_files, ['file'])
+        self.assertEqual(d.diff_files, [])
+        expected_report = [
+            "diff {} {}".format(self.dir, self.dir_diff),
+            "Only in {} : ['file2']".format(self.dir),
+            "Identical files : ['file']",
+        ]
+        self._assert_report(d.report, expected_report)
 
         # Add different file2
-        output = open(os.path.join(self.dir, 'file2'), 'w')
-        output.write('Different contents.\n')
-        output.close()
+        with open(os.path.join(self.dir_diff, 'file2'), 'w') as output:
+            output.write('Different contents.\n')
         d = filecmp.dircmp(self.dir, self.dir_diff)
         self.assertEqual(d.same_files, ['file'])
         self.assertEqual(d.diff_files, ['file2'])
+        expected_report = [
+            "diff {} {}".format(self.dir, self.dir_diff),
+            "Identical files : ['file']",
+            "Differing files : ['file2']",
+        ]
+        self._assert_report(d.report, expected_report)
+
+    def test_report_partial_closure(self):
+        left_dir, right_dir = self.dir, self.dir_same
+        d = filecmp.dircmp(left_dir, right_dir)
+        expected_report = [
+            "diff {} {}".format(self.dir, self.dir_same),
+            "Identical files : ['file']",
+        ]
+        self._assert_report(d.report_partial_closure, expected_report)
+
+    def test_report_full_closure(self):
+        left_dir, right_dir = self.dir, self.dir_same
+        d = filecmp.dircmp(left_dir, right_dir)
+        expected_report = [
+            "diff {} {}".format(self.dir, self.dir_same),
+            "Identical files : ['file']",
+        ]
+        self._assert_report(d.report_full_closure, expected_report)
+
+    def _assert_report(self, dircmp_report, expected_report_lines):
+        with support.captured_stdout() as stdout:
+            dircmp_report()
+            report_lines = stdout.getvalue().strip().split('\n')
+            self.assertEqual(report_lines, expected_report_lines)
 
 
 def test_main():
diff --git a/Lib/test/test_fileinput.py b/Lib/test/test_fileinput.py
index b9523cc..1d089f5 100644
--- a/Lib/test/test_fileinput.py
+++ b/Lib/test/test_fileinput.py
@@ -19,11 +19,12 @@
 except ImportError:
     gzip = None
 
-from io import StringIO
+from io import BytesIO, StringIO
 from fileinput import FileInput, hook_encoded
 
-from test.support import verbose, TESTFN, run_unittest
+from test.support import verbose, TESTFN, run_unittest, check_warnings
 from test.support import unlink as safe_unlink
+from unittest import mock
 
 
 # The fileinput module has 2 interfaces: the FileInput class which does
@@ -224,12 +225,21 @@
         try:
             # try opening in universal newline mode
             t1 = writeTmp(1, [b"A\nB\r\nC\rD"], mode="wb")
-            fi = FileInput(files=t1, mode="U")
-            lines = list(fi)
+            with check_warnings(('', DeprecationWarning)):
+                fi = FileInput(files=t1, mode="U")
+            with check_warnings(('', DeprecationWarning)):
+                lines = list(fi)
             self.assertEqual(lines, ["A\n", "B\n", "C\n", "D"])
         finally:
             remove_tempfiles(t1)
 
+    def test_stdin_binary_mode(self):
+        with mock.patch('sys.stdin') as m_stdin:
+            m_stdin.buffer = BytesIO(b'spam, bacon, sausage, and spam')
+            fi = FileInput(files=['-'], mode='rb')
+            lines = list(fi)
+            self.assertEqual(lines, [b'spam, bacon, sausage, and spam'])
+
     def test_file_opening_hook(self):
         try:
             # cannot use openhook and inplace mode
@@ -296,8 +306,8 @@
         try:
             t1 = writeTmp(1, [""])
             with FileInput(files=t1) as fi:
-                raise IOError
-        except IOError:
+                raise OSError
+        except OSError:
             self.assertEqual(fi._files, ())
         finally:
             remove_tempfiles(t1)
@@ -869,27 +879,13 @@
             self.assertEqual(lines, expected_lines)
 
         check('r', ['A\n', 'B\n', 'C\n', 'D\u20ac'])
-        check('rU', ['A\n', 'B\n', 'C\n', 'D\u20ac'])
-        check('U', ['A\n', 'B\n', 'C\n', 'D\u20ac'])
+        with self.assertWarns(DeprecationWarning):
+            check('rU', ['A\n', 'B\n', 'C\n', 'D\u20ac'])
+        with self.assertWarns(DeprecationWarning):
+            check('U', ['A\n', 'B\n', 'C\n', 'D\u20ac'])
         with self.assertRaises(ValueError):
             check('rb', ['A\n', 'B\r\n', 'C\r', 'D\u20ac'])
 
-def test_main():
-    run_unittest(
-        BufferSizesTests,
-        FileInputTests,
-        Test_fileinput_input,
-        Test_fileinput_close,
-        Test_fileinput_nextfile,
-        Test_fileinput_filename,
-        Test_fileinput_lineno,
-        Test_fileinput_filelineno,
-        Test_fileinput_fileno,
-        Test_fileinput_isfirstline,
-        Test_fileinput_isstdin,
-        Test_hook_compressed,
-        Test_hook_encoded,
-    )
 
 if __name__ == "__main__":
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_fileio.py b/Lib/test/test_fileio.py
index 444be91..c37482e 100644
--- a/Lib/test/test_fileio.py
+++ b/Lib/test/test_fileio.py
@@ -144,16 +144,16 @@
         # Unix calls dircheck() and returns "[Errno 21]: Is a directory"
         try:
             _FileIO('.', 'r')
-        except IOError as e:
+        except OSError as e:
             self.assertNotEqual(e.errno, 0)
             self.assertEqual(e.filename, ".")
         else:
-            self.fail("Should have raised IOError")
+            self.fail("Should have raised OSError")
 
     @unittest.skipIf(os.name == 'nt', "test only works on a POSIX-like system")
     def testOpenDirFD(self):
         fd = os.open('.', os.O_RDONLY)
-        with self.assertRaises(IOError) as cm:
+        with self.assertRaises(OSError) as cm:
             _FileIO(fd, 'r')
         os.close(fd)
         self.assertEqual(cm.exception.errno, errno.EISDIR)
@@ -171,7 +171,7 @@
             finally:
                 try:
                     self.f.close()
-                except IOError:
+                except OSError:
                     pass
         return wrapper
 
@@ -183,14 +183,14 @@
             os.close(f.fileno())
             try:
                 func(self, f)
-            except IOError as e:
+            except OSError as e:
                 self.assertEqual(e.errno, errno.EBADF)
             else:
-                self.fail("Should have raised IOError")
+                self.fail("Should have raised OSError")
             finally:
                 try:
                     self.f.close()
-                except IOError:
+                except OSError:
                     pass
         return wrapper
 
@@ -237,7 +237,7 @@
     def ReopenForRead(self):
         try:
             self.f.close()
-        except IOError:
+        except OSError:
             pass
         self.f = _FileIO(TESTFN, 'r')
         os.close(self.f.fileno())
@@ -285,7 +285,7 @@
             if sys.platform != "win32":
                 try:
                     f = _FileIO("/dev/tty", "a")
-                except EnvironmentError:
+                except OSError:
                     # When run in a cron job there just aren't any
                     # ttys, so skip the test.  This also handles other
                     # OS'es that don't support /dev/tty.
@@ -360,7 +360,7 @@
         self.assertRaises(OSError, _FileIO, make_bad_fd())
         if sys.platform == 'win32':
             import msvcrt
-            self.assertRaises(IOError, msvcrt.get_osfhandle, make_bad_fd())
+            self.assertRaises(OSError, msvcrt.get_osfhandle, make_bad_fd())
 
     @cpython_only
     def testInvalidFd_overflow(self):
diff --git a/Lib/test/test_finalization.py b/Lib/test/test_finalization.py
new file mode 100644
index 0000000..03ac1aa
--- /dev/null
+++ b/Lib/test/test_finalization.py
@@ -0,0 +1,522 @@
+"""
+Tests for object finalization semantics, as outlined in PEP 442.
+"""
+
+import contextlib
+import gc
+import unittest
+import weakref
+
+try:
+    from _testcapi import with_tp_del
+except ImportError:
+    def with_tp_del(cls):
+        class C(object):
+            def __new__(cls, *args, **kwargs):
+                raise TypeError('requires _testcapi.with_tp_del')
+        return C
+
+from test import support
+
+
+class NonGCSimpleBase:
+    """
+    The base class for all the objects under test, equipped with various
+    testing features.
+    """
+
+    survivors = []
+    del_calls = []
+    tp_del_calls = []
+    errors = []
+
+    _cleaning = False
+
+    __slots__ = ()
+
+    @classmethod
+    def _cleanup(cls):
+        cls.survivors.clear()
+        cls.errors.clear()
+        gc.garbage.clear()
+        gc.collect()
+        cls.del_calls.clear()
+        cls.tp_del_calls.clear()
+
+    @classmethod
+    @contextlib.contextmanager
+    def test(cls):
+        """
+        A context manager to use around all finalization tests.
+        """
+        with support.disable_gc():
+            cls.del_calls.clear()
+            cls.tp_del_calls.clear()
+            NonGCSimpleBase._cleaning = False
+            try:
+                yield
+                if cls.errors:
+                    raise cls.errors[0]
+            finally:
+                NonGCSimpleBase._cleaning = True
+                cls._cleanup()
+
+    def check_sanity(self):
+        """
+        Check the object is sane (non-broken).
+        """
+
+    def __del__(self):
+        """
+        PEP 442 finalizer.  Record that this was called, check the
+        object is in a sane state, and invoke a side effect.
+        """
+        try:
+            if not self._cleaning:
+                self.del_calls.append(id(self))
+                self.check_sanity()
+                self.side_effect()
+        except Exception as e:
+            self.errors.append(e)
+
+    def side_effect(self):
+        """
+        A side effect called on destruction.
+        """
+
+
+class SimpleBase(NonGCSimpleBase):
+
+    def __init__(self):
+        self.id_ = id(self)
+
+    def check_sanity(self):
+        assert self.id_ == id(self)
+
+
+class NonGC(NonGCSimpleBase):
+    __slots__ = ()
+
+class NonGCResurrector(NonGCSimpleBase):
+    __slots__ = ()
+
+    def side_effect(self):
+        """
+        Resurrect self by storing self in a class-wide list.
+        """
+        self.survivors.append(self)
+
+class Simple(SimpleBase):
+    pass
+
+class SimpleResurrector(NonGCResurrector, SimpleBase):
+    pass
+
+
+class TestBase:
+
+    def setUp(self):
+        self.old_garbage = gc.garbage[:]
+        gc.garbage[:] = []
+
+    def tearDown(self):
+        # None of the tests here should put anything in gc.garbage
+        try:
+            self.assertEqual(gc.garbage, [])
+        finally:
+            del self.old_garbage
+            gc.collect()
+
+    def assert_del_calls(self, ids):
+        self.assertEqual(sorted(SimpleBase.del_calls), sorted(ids))
+
+    def assert_tp_del_calls(self, ids):
+        self.assertEqual(sorted(SimpleBase.tp_del_calls), sorted(ids))
+
+    def assert_survivors(self, ids):
+        self.assertEqual(sorted(id(x) for x in SimpleBase.survivors), sorted(ids))
+
+    def assert_garbage(self, ids):
+        self.assertEqual(sorted(id(x) for x in gc.garbage), sorted(ids))
+
+    def clear_survivors(self):
+        SimpleBase.survivors.clear()
+
+
+class SimpleFinalizationTest(TestBase, unittest.TestCase):
+    """
+    Test finalization without refcycles.
+    """
+
+    def test_simple(self):
+        with SimpleBase.test():
+            s = Simple()
+            ids = [id(s)]
+            wr = weakref.ref(s)
+            del s
+            gc.collect()
+            self.assert_del_calls(ids)
+            self.assert_survivors([])
+            self.assertIs(wr(), None)
+            gc.collect()
+            self.assert_del_calls(ids)
+            self.assert_survivors([])
+
+    def test_simple_resurrect(self):
+        with SimpleBase.test():
+            s = SimpleResurrector()
+            ids = [id(s)]
+            wr = weakref.ref(s)
+            del s
+            gc.collect()
+            self.assert_del_calls(ids)
+            self.assert_survivors(ids)
+            self.assertIsNot(wr(), None)
+            self.clear_survivors()
+            gc.collect()
+            self.assert_del_calls(ids)
+            self.assert_survivors([])
+        self.assertIs(wr(), None)
+
+    def test_non_gc(self):
+        with SimpleBase.test():
+            s = NonGC()
+            self.assertFalse(gc.is_tracked(s))
+            ids = [id(s)]
+            del s
+            gc.collect()
+            self.assert_del_calls(ids)
+            self.assert_survivors([])
+            gc.collect()
+            self.assert_del_calls(ids)
+            self.assert_survivors([])
+
+    def test_non_gc_resurrect(self):
+        with SimpleBase.test():
+            s = NonGCResurrector()
+            self.assertFalse(gc.is_tracked(s))
+            ids = [id(s)]
+            del s
+            gc.collect()
+            self.assert_del_calls(ids)
+            self.assert_survivors(ids)
+            self.clear_survivors()
+            gc.collect()
+            self.assert_del_calls(ids * 2)
+            self.assert_survivors(ids)
+
+
+class SelfCycleBase:
+
+    def __init__(self):
+        super().__init__()
+        self.ref = self
+
+    def check_sanity(self):
+        super().check_sanity()
+        assert self.ref is self
+
+class SimpleSelfCycle(SelfCycleBase, Simple):
+    pass
+
+class SelfCycleResurrector(SelfCycleBase, SimpleResurrector):
+    pass
+
+class SuicidalSelfCycle(SelfCycleBase, Simple):
+
+    def side_effect(self):
+        """
+        Explicitly break the reference cycle.
+        """
+        self.ref = None
+
+
+class SelfCycleFinalizationTest(TestBase, unittest.TestCase):
+    """
+    Test finalization of an object having a single cyclic reference to
+    itself.
+    """
+
+    def test_simple(self):
+        with SimpleBase.test():
+            s = SimpleSelfCycle()
+            ids = [id(s)]
+            wr = weakref.ref(s)
+            del s
+            gc.collect()
+            self.assert_del_calls(ids)
+            self.assert_survivors([])
+            self.assertIs(wr(), None)
+            gc.collect()
+            self.assert_del_calls(ids)
+            self.assert_survivors([])
+
+    def test_simple_resurrect(self):
+        # Test that __del__ can resurrect the object being finalized.
+        with SimpleBase.test():
+            s = SelfCycleResurrector()
+            ids = [id(s)]
+            wr = weakref.ref(s)
+            del s
+            gc.collect()
+            self.assert_del_calls(ids)
+            self.assert_survivors(ids)
+            # XXX is this desirable?
+            self.assertIs(wr(), None)
+            # When trying to destroy the object a second time, __del__
+            # isn't called anymore (and the object isn't resurrected).
+            self.clear_survivors()
+            gc.collect()
+            self.assert_del_calls(ids)
+            self.assert_survivors([])
+            self.assertIs(wr(), None)
+
+    def test_simple_suicide(self):
+        # Test the GC is able to deal with an object that kills its last
+        # reference during __del__.
+        with SimpleBase.test():
+            s = SuicidalSelfCycle()
+            ids = [id(s)]
+            wr = weakref.ref(s)
+            del s
+            gc.collect()
+            self.assert_del_calls(ids)
+            self.assert_survivors([])
+            self.assertIs(wr(), None)
+            gc.collect()
+            self.assert_del_calls(ids)
+            self.assert_survivors([])
+            self.assertIs(wr(), None)
+
+
+class ChainedBase:
+
+    def chain(self, left):
+        self.suicided = False
+        self.left = left
+        left.right = self
+
+    def check_sanity(self):
+        super().check_sanity()
+        if self.suicided:
+            assert self.left is None
+            assert self.right is None
+        else:
+            left = self.left
+            if left.suicided:
+                assert left.right is None
+            else:
+                assert left.right is self
+            right = self.right
+            if right.suicided:
+                assert right.left is None
+            else:
+                assert right.left is self
+
+class SimpleChained(ChainedBase, Simple):
+    pass
+
+class ChainedResurrector(ChainedBase, SimpleResurrector):
+    pass
+
+class SuicidalChained(ChainedBase, Simple):
+
+    def side_effect(self):
+        """
+        Explicitly break the reference cycle.
+        """
+        self.suicided = True
+        self.left = None
+        self.right = None
+
+
+class CycleChainFinalizationTest(TestBase, unittest.TestCase):
+    """
+    Test finalization of a cyclic chain.  These tests are similar in
+    spirit to the self-cycle tests above, but the collectable object
+    graph isn't trivial anymore.
+    """
+
+    def build_chain(self, classes):
+        nodes = [cls() for cls in classes]
+        for i in range(len(nodes)):
+            nodes[i].chain(nodes[i-1])
+        return nodes
+
+    def check_non_resurrecting_chain(self, classes):
+        N = len(classes)
+        with SimpleBase.test():
+            nodes = self.build_chain(classes)
+            ids = [id(s) for s in nodes]
+            wrs = [weakref.ref(s) for s in nodes]
+            del nodes
+            gc.collect()
+            self.assert_del_calls(ids)
+            self.assert_survivors([])
+            self.assertEqual([wr() for wr in wrs], [None] * N)
+            gc.collect()
+            self.assert_del_calls(ids)
+
+    def check_resurrecting_chain(self, classes):
+        N = len(classes)
+        with SimpleBase.test():
+            nodes = self.build_chain(classes)
+            N = len(nodes)
+            ids = [id(s) for s in nodes]
+            survivor_ids = [id(s) for s in nodes if isinstance(s, SimpleResurrector)]
+            wrs = [weakref.ref(s) for s in nodes]
+            del nodes
+            gc.collect()
+            self.assert_del_calls(ids)
+            self.assert_survivors(survivor_ids)
+            # XXX desirable?
+            self.assertEqual([wr() for wr in wrs], [None] * N)
+            self.clear_survivors()
+            gc.collect()
+            self.assert_del_calls(ids)
+            self.assert_survivors([])
+
+    def test_homogenous(self):
+        self.check_non_resurrecting_chain([SimpleChained] * 3)
+
+    def test_homogenous_resurrect(self):
+        self.check_resurrecting_chain([ChainedResurrector] * 3)
+
+    def test_homogenous_suicidal(self):
+        self.check_non_resurrecting_chain([SuicidalChained] * 3)
+
+    def test_heterogenous_suicidal_one(self):
+        self.check_non_resurrecting_chain([SuicidalChained, SimpleChained] * 2)
+
+    def test_heterogenous_suicidal_two(self):
+        self.check_non_resurrecting_chain(
+            [SuicidalChained] * 2 + [SimpleChained] * 2)
+
+    def test_heterogenous_resurrect_one(self):
+        self.check_resurrecting_chain([ChainedResurrector, SimpleChained] * 2)
+
+    def test_heterogenous_resurrect_two(self):
+        self.check_resurrecting_chain(
+            [ChainedResurrector, SimpleChained, SuicidalChained] * 2)
+
+    def test_heterogenous_resurrect_three(self):
+        self.check_resurrecting_chain(
+            [ChainedResurrector] * 2 + [SimpleChained] * 2 + [SuicidalChained] * 2)
+
+
+# NOTE: the tp_del slot isn't automatically inherited, so we have to call
+# with_tp_del() for each instantiated class.
+
+class LegacyBase(SimpleBase):
+
+    def __del__(self):
+        try:
+            # Do not invoke side_effect here, since we are now exercising
+            # the tp_del slot.
+            if not self._cleaning:
+                self.del_calls.append(id(self))
+                self.check_sanity()
+        except Exception as e:
+            self.errors.append(e)
+
+    def __tp_del__(self):
+        """
+        Legacy (pre-PEP 442) finalizer, mapped to a tp_del slot.
+        """
+        try:
+            if not self._cleaning:
+                self.tp_del_calls.append(id(self))
+                self.check_sanity()
+                self.side_effect()
+        except Exception as e:
+            self.errors.append(e)
+
+@with_tp_del
+class Legacy(LegacyBase):
+    pass
+
+@with_tp_del
+class LegacyResurrector(LegacyBase):
+
+    def side_effect(self):
+        """
+        Resurrect self by storing self in a class-wide list.
+        """
+        self.survivors.append(self)
+
+@with_tp_del
+class LegacySelfCycle(SelfCycleBase, LegacyBase):
+    pass
+
+
+@support.cpython_only
+class LegacyFinalizationTest(TestBase, unittest.TestCase):
+    """
+    Test finalization of objects with a tp_del.
+    """
+
+    def tearDown(self):
+        # These tests need to clean up a bit more, since they create
+        # uncollectable objects.
+        gc.garbage.clear()
+        gc.collect()
+        super().tearDown()
+
+    def test_legacy(self):
+        with SimpleBase.test():
+            s = Legacy()
+            ids = [id(s)]
+            wr = weakref.ref(s)
+            del s
+            gc.collect()
+            self.assert_del_calls(ids)
+            self.assert_tp_del_calls(ids)
+            self.assert_survivors([])
+            self.assertIs(wr(), None)
+            gc.collect()
+            self.assert_del_calls(ids)
+            self.assert_tp_del_calls(ids)
+
+    def test_legacy_resurrect(self):
+        with SimpleBase.test():
+            s = LegacyResurrector()
+            ids = [id(s)]
+            wr = weakref.ref(s)
+            del s
+            gc.collect()
+            self.assert_del_calls(ids)
+            self.assert_tp_del_calls(ids)
+            self.assert_survivors(ids)
+            # weakrefs are cleared before tp_del is called.
+            self.assertIs(wr(), None)
+            self.clear_survivors()
+            gc.collect()
+            self.assert_del_calls(ids)
+            self.assert_tp_del_calls(ids * 2)
+            self.assert_survivors(ids)
+        self.assertIs(wr(), None)
+
+    def test_legacy_self_cycle(self):
+        # Self-cycles with legacy finalizers end up in gc.garbage.
+        with SimpleBase.test():
+            s = LegacySelfCycle()
+            ids = [id(s)]
+            wr = weakref.ref(s)
+            del s
+            gc.collect()
+            self.assert_del_calls([])
+            self.assert_tp_del_calls([])
+            self.assert_survivors([])
+            self.assert_garbage(ids)
+            self.assertIsNot(wr(), None)
+            # Break the cycle to allow collection
+            gc.garbage[0].ref = None
+        self.assert_garbage([])
+        self.assertIs(wr(), None)
+
+
+def test_main():
+    support.run_unittest(__name__)
+
+if __name__ == "__main__":
+    test_main()
diff --git a/Lib/test/test_float.py b/Lib/test/test_float.py
index 96d907a..e1e1f04 100644
--- a/Lib/test/test_float.py
+++ b/Lib/test/test_float.py
@@ -41,6 +41,7 @@
         self.assertRaises(ValueError, float, "-.")
         self.assertRaises(ValueError, float, b"-")
         self.assertRaises(TypeError, float, {})
+        self.assertRaisesRegex(TypeError, "not 'dict'", float, {})
         # Lone surrogate
         self.assertRaises(UnicodeEncodeError, float, '\uD8F0')
         # check that we don't accept alternate exponent markers
diff --git a/Lib/test/test_fork1.py b/Lib/test/test_fork1.py
index 8192c38..e0626df 100644
--- a/Lib/test/test_fork1.py
+++ b/Lib/test/test_fork1.py
@@ -1,7 +1,7 @@
 """This test checks for correct fork() behavior.
 """
 
-import imp
+import _imp as imp
 import os
 import signal
 import sys
diff --git a/Lib/test/test_format.py b/Lib/test/test_format.py
index ea5a731..fc71e48 100644
--- a/Lib/test/test_format.py
+++ b/Lib/test/test_format.py
@@ -142,7 +142,8 @@
         testformat("%#+027.23X", big, "+0X0001234567890ABCDEF12345")
         # same, except no 0 flag
         testformat("%#+27.23X", big, " +0X001234567890ABCDEF12345")
-        testformat("%x", float(big), "123456_______________", 6)
+        with self.assertWarns(DeprecationWarning):
+            testformat("%x", float(big), "123456_______________", 6)
         big = 0o12345670123456701234567012345670  # 32 octal digits
         testformat("%o", big, "12345670123456701234567012345670")
         testformat("%o", -big, "-12345670123456701234567012345670")
@@ -182,7 +183,8 @@
         testformat("%034.33o", big, "0012345670123456701234567012345670")
         # base marker shouldn't change that
         testformat("%0#34.33o", big, "0o012345670123456701234567012345670")
-        testformat("%o", float(big), "123456__________________________", 6)
+        with self.assertWarns(DeprecationWarning):
+            testformat("%o", float(big), "123456__________________________", 6)
         # Some small ints, in both Python int and flavors).
         testformat("%d", 42, "42")
         testformat("%d", -42, "-42")
@@ -193,7 +195,8 @@
         testformat("%#x", 1, "0x1")
         testformat("%#X", 1, "0X1")
         testformat("%#X", 1, "0X1")
-        testformat("%#x", 1.0, "0x1")
+        with self.assertWarns(DeprecationWarning):
+            testformat("%#x", 1.0, "0x1")
         testformat("%#o", 1, "0o1")
         testformat("%#o", 1, "0o1")
         testformat("%#o", 0, "0o0")
@@ -210,12 +213,14 @@
         testformat("%x", -0x42, "-42")
         testformat("%x", 0x42, "42")
         testformat("%x", -0x42, "-42")
-        testformat("%x", float(0x42), "42")
+        with self.assertWarns(DeprecationWarning):
+            testformat("%x", float(0x42), "42")
         testformat("%o", 0o42, "42")
         testformat("%o", -0o42, "-42")
         testformat("%o", 0o42, "42")
         testformat("%o", -0o42, "-42")
-        testformat("%o", float(0o42), "42")
+        with self.assertWarns(DeprecationWarning):
+            testformat("%o", float(0o42), "42")
         testformat("%r", "\u0378", "'\\u0378'")  # non printable
         testformat("%a", "\u0378", "'\\u0378'")  # non printable
         testformat("%r", "\u0374", "'\u0374'")   # printable
@@ -307,10 +312,25 @@
         finally:
             locale.setlocale(locale.LC_ALL, oldloc)
 
+    @support.cpython_only
+    def test_optimisations(self):
+        text = "abcde" # 5 characters
 
+        self.assertIs("%s" % text, text)
+        self.assertIs("%.5s" % text, text)
+        self.assertIs("%.10s" % text, text)
+        self.assertIs("%1s" % text, text)
+        self.assertIs("%5s" % text, text)
 
-def test_main():
-    support.run_unittest(FormatTest)
+        self.assertIs("{0}".format(text), text)
+        self.assertIs("{0:s}".format(text), text)
+        self.assertIs("{0:.5s}".format(text), text)
+        self.assertIs("{0:.10s}".format(text), text)
+        self.assertIs("{0:1s}".format(text), text)
+        self.assertIs("{0:5s}".format(text), text)
+
+        self.assertIs(text % (), text)
+        self.assertIs(text.format(), text)
 
     def test_precision(self):
         f = 1.2
@@ -318,14 +338,12 @@
         self.assertEqual(format(f, ".3f"), "1.200")
         with self.assertRaises(ValueError) as cm:
             format(f, ".%sf" % (sys.maxsize + 1))
-        self.assertEqual(str(cm.exception), "precision too big")
 
         c = complex(f)
         self.assertEqual(format(c, ".0f"), "1+0j")
         self.assertEqual(format(c, ".3f"), "1.200+0.000j")
         with self.assertRaises(ValueError) as cm:
             format(c, ".%sf" % (sys.maxsize + 1))
-        self.assertEqual(str(cm.exception), "precision too big")
 
     @support.cpython_only
     def test_precision_c_limits(self):
diff --git a/Lib/test/test_fractions.py b/Lib/test/test_fractions.py
index 1fad921..3336532 100644
--- a/Lib/test/test_fractions.py
+++ b/Lib/test/test_fractions.py
@@ -146,9 +146,10 @@
         self.assertEqual((0, 1), _components(F(-0.0)))
         self.assertEqual((3602879701896397, 36028797018963968),
                          _components(F(0.1)))
-        self.assertRaises(TypeError, F, float('nan'))
-        self.assertRaises(TypeError, F, float('inf'))
-        self.assertRaises(TypeError, F, float('-inf'))
+        # bug 16469: error types should be consistent with float -> int
+        self.assertRaises(ValueError, F, float('nan'))
+        self.assertRaises(OverflowError, F, float('inf'))
+        self.assertRaises(OverflowError, F, float('-inf'))
 
     def testInitFromDecimal(self):
         self.assertEqual((11, 10),
@@ -157,10 +158,11 @@
                          _components(F(Decimal('3.5e-2'))))
         self.assertEqual((0, 1),
                          _components(F(Decimal('.000e20'))))
-        self.assertRaises(TypeError, F, Decimal('nan'))
-        self.assertRaises(TypeError, F, Decimal('snan'))
-        self.assertRaises(TypeError, F, Decimal('inf'))
-        self.assertRaises(TypeError, F, Decimal('-inf'))
+        # bug 16469: error types should be consistent with decimal -> int
+        self.assertRaises(ValueError, F, Decimal('nan'))
+        self.assertRaises(ValueError, F, Decimal('snan'))
+        self.assertRaises(OverflowError, F, Decimal('inf'))
+        self.assertRaises(OverflowError, F, Decimal('-inf'))
 
     def testFromString(self):
         self.assertEqual((5, 1), _components(F("5")))
@@ -248,14 +250,15 @@
 
         inf = 1e1000
         nan = inf - inf
+        # bug 16469: error types should be consistent with float -> int
         self.assertRaisesMessage(
-            TypeError, "Cannot convert inf to Fraction.",
+            OverflowError, "Cannot convert inf to Fraction.",
             F.from_float, inf)
         self.assertRaisesMessage(
-            TypeError, "Cannot convert -inf to Fraction.",
+            OverflowError, "Cannot convert -inf to Fraction.",
             F.from_float, -inf)
         self.assertRaisesMessage(
-            TypeError, "Cannot convert nan to Fraction.",
+            ValueError, "Cannot convert nan to Fraction.",
             F.from_float, nan)
 
     def testFromDecimal(self):
@@ -268,17 +271,18 @@
         self.assertEqual(1 - F(1, 10**30),
                          F.from_decimal(Decimal("0." + "9" * 30)))
 
+        # bug 16469: error types should be consistent with decimal -> int
         self.assertRaisesMessage(
-            TypeError, "Cannot convert Infinity to Fraction.",
+            OverflowError, "Cannot convert Infinity to Fraction.",
             F.from_decimal, Decimal("inf"))
         self.assertRaisesMessage(
-            TypeError, "Cannot convert -Infinity to Fraction.",
+            OverflowError, "Cannot convert -Infinity to Fraction.",
             F.from_decimal, Decimal("-inf"))
         self.assertRaisesMessage(
-            TypeError, "Cannot convert NaN to Fraction.",
+            ValueError, "Cannot convert NaN to Fraction.",
             F.from_decimal, Decimal("nan"))
         self.assertRaisesMessage(
-            TypeError, "Cannot convert sNaN to Fraction.",
+            ValueError, "Cannot convert sNaN to Fraction.",
             F.from_decimal, Decimal("snan"))
 
     def testLimitDenominator(self):
diff --git a/Lib/test/test_frame.py b/Lib/test/test_frame.py
new file mode 100644
index 0000000..c402ec3
--- /dev/null
+++ b/Lib/test/test_frame.py
@@ -0,0 +1,168 @@
+import gc
+import sys
+import types
+import unittest
+import weakref
+
+from test import support
+
+
+class ClearTest(unittest.TestCase):
+    """
+    Tests for frame.clear().
+    """
+
+    def inner(self, x=5, **kwargs):
+        1/0
+
+    def outer(self, **kwargs):
+        try:
+            self.inner(**kwargs)
+        except ZeroDivisionError as e:
+            exc = e
+        return exc
+
+    def clear_traceback_frames(self, tb):
+        """
+        Clear all frames in a traceback.
+        """
+        while tb is not None:
+            tb.tb_frame.clear()
+            tb = tb.tb_next
+
+    def test_clear_locals(self):
+        class C:
+            pass
+        c = C()
+        wr = weakref.ref(c)
+        exc = self.outer(c=c)
+        del c
+        support.gc_collect()
+        # A reference to c is held through the frames
+        self.assertIsNot(None, wr())
+        self.clear_traceback_frames(exc.__traceback__)
+        support.gc_collect()
+        # The reference was released by .clear()
+        self.assertIs(None, wr())
+
+    def test_clear_generator(self):
+        endly = False
+        def g():
+            nonlocal endly
+            try:
+                yield
+                inner()
+            finally:
+                endly = True
+        gen = g()
+        next(gen)
+        self.assertFalse(endly)
+        # Clearing the frame closes the generator
+        gen.gi_frame.clear()
+        self.assertTrue(endly)
+
+    def test_clear_executing(self):
+        # Attempting to clear an executing frame is forbidden.
+        try:
+            1/0
+        except ZeroDivisionError as e:
+            f = e.__traceback__.tb_frame
+        with self.assertRaises(RuntimeError):
+            f.clear()
+        with self.assertRaises(RuntimeError):
+            f.f_back.clear()
+
+    def test_clear_executing_generator(self):
+        # Attempting to clear an executing generator frame is forbidden.
+        endly = False
+        def g():
+            nonlocal endly
+            try:
+                1/0
+            except ZeroDivisionError as e:
+                f = e.__traceback__.tb_frame
+                with self.assertRaises(RuntimeError):
+                    f.clear()
+                with self.assertRaises(RuntimeError):
+                    f.f_back.clear()
+                yield f
+            finally:
+                endly = True
+        gen = g()
+        f = next(gen)
+        self.assertFalse(endly)
+        # Clearing the frame closes the generator
+        f.clear()
+        self.assertTrue(endly)
+
+    @support.cpython_only
+    def test_clear_refcycles(self):
+        # .clear() doesn't leave any refcycle behind
+        with support.disable_gc():
+            class C:
+                pass
+            c = C()
+            wr = weakref.ref(c)
+            exc = self.outer(c=c)
+            del c
+            self.assertIsNot(None, wr())
+            self.clear_traceback_frames(exc.__traceback__)
+            self.assertIs(None, wr())
+
+
+class FrameLocalsTest(unittest.TestCase):
+    """
+    Tests for the .f_locals attribute.
+    """
+
+    def make_frames(self):
+        def outer():
+            x = 5
+            y = 6
+            def inner():
+                z = x + 2
+                1/0
+                t = 9
+            return inner()
+        try:
+            outer()
+        except ZeroDivisionError as e:
+            tb = e.__traceback__
+            frames = []
+            while tb:
+                frames.append(tb.tb_frame)
+                tb = tb.tb_next
+        return frames
+
+    def test_locals(self):
+        f, outer, inner = self.make_frames()
+        outer_locals = outer.f_locals
+        self.assertIsInstance(outer_locals.pop('inner'), types.FunctionType)
+        self.assertEqual(outer_locals, {'x': 5, 'y': 6})
+        inner_locals = inner.f_locals
+        self.assertEqual(inner_locals, {'x': 5, 'z': 7})
+
+    def test_clear_locals(self):
+        # Test f_locals after clear() (issue #21897)
+        f, outer, inner = self.make_frames()
+        outer.clear()
+        inner.clear()
+        self.assertEqual(outer.f_locals, {})
+        self.assertEqual(inner.f_locals, {})
+
+    def test_locals_clear_locals(self):
+        # Test f_locals before and after clear() (to exercise caching)
+        f, outer, inner = self.make_frames()
+        outer.f_locals
+        inner.f_locals
+        outer.clear()
+        inner.clear()
+        self.assertEqual(outer.f_locals, {})
+        self.assertEqual(inner.f_locals, {})
+
+
+def test_main():
+    support.run_unittest(__name__)
+
+if __name__ == "__main__":
+    test_main()
diff --git a/Lib/test/test_frozen.py b/Lib/test/test_frozen.py
deleted file mode 100644
index fd6761c..0000000
--- a/Lib/test/test_frozen.py
+++ /dev/null
@@ -1,79 +0,0 @@
-# Test the frozen module defined in frozen.c.
-
-from test.support import captured_stdout, run_unittest
-import unittest
-import sys
-
-class FrozenTests(unittest.TestCase):
-
-    module_attrs = frozenset(['__builtins__', '__cached__', '__doc__',
-                              '__loader__', '__name__',
-                              '__package__'])
-    package_attrs = frozenset(list(module_attrs) + ['__path__'])
-
-    def test_frozen(self):
-        with captured_stdout() as stdout:
-            try:
-                import __hello__
-            except ImportError as x:
-                self.fail("import __hello__ failed:" + str(x))
-            self.assertEqual(__hello__.initialized, True)
-            expect = set(self.module_attrs)
-            expect.add('initialized')
-            self.assertEqual(set(dir(__hello__)), expect)
-            self.assertEqual(stdout.getvalue(), 'Hello world!\n')
-
-        with captured_stdout() as stdout:
-            try:
-                import __phello__
-            except ImportError as x:
-                self.fail("import __phello__ failed:" + str(x))
-            self.assertEqual(__phello__.initialized, True)
-            expect = set(self.package_attrs)
-            expect.add('initialized')
-            if not "__phello__.spam" in sys.modules:
-                self.assertEqual(set(dir(__phello__)), expect)
-            else:
-                expect.add('spam')
-                self.assertEqual(set(dir(__phello__)), expect)
-            self.assertEqual(__phello__.__path__, [__phello__.__name__])
-            self.assertEqual(stdout.getvalue(), 'Hello world!\n')
-
-        with captured_stdout() as stdout:
-            try:
-                import __phello__.spam
-            except ImportError as x:
-                self.fail("import __phello__.spam failed:" + str(x))
-            self.assertEqual(__phello__.spam.initialized, True)
-            spam_expect = set(self.module_attrs)
-            spam_expect.add('initialized')
-            self.assertEqual(set(dir(__phello__.spam)), spam_expect)
-            phello_expect = set(self.package_attrs)
-            phello_expect.add('initialized')
-            phello_expect.add('spam')
-            self.assertEqual(set(dir(__phello__)), phello_expect)
-            self.assertEqual(stdout.getvalue(), 'Hello world!\n')
-
-        try:
-            import __phello__.foo
-        except ImportError:
-            pass
-        else:
-            self.fail("import __phello__.foo should have failed")
-
-            try:
-                import __phello__.foo
-            except ImportError:
-                pass
-            else:
-                self.fail("import __phello__.foo should have failed")
-
-        del sys.modules['__hello__']
-        del sys.modules['__phello__']
-        del sys.modules['__phello__.spam']
-
-def test_main():
-    run_unittest(FrozenTests)
-
-if __name__ == "__main__":
-    test_main()
diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py
index 6c95c49..d3be7d6 100644
--- a/Lib/test/test_ftplib.py
+++ b/Lib/test/test_ftplib.py
@@ -21,6 +21,7 @@
 from test.support import HOST, HOSTv6
 threading = support.import_module('threading')
 
+TIMEOUT = 3
 # the dummy data returned by server over the data channel when
 # RETR, LIST, NLST, MLSD commands are issued
 RETR_DATA = 'abcde12345\r\n' * 1000
@@ -126,7 +127,7 @@
         addr = list(map(int, arg.split(',')))
         ip = '%d.%d.%d.%d' %tuple(addr[:4])
         port = (addr[4] * 256) + addr[5]
-        s = socket.create_connection((ip, port), timeout=2)
+        s = socket.create_connection((ip, port), timeout=TIMEOUT)
         self.dtp = self.dtp_handler(s, baseclass=self)
         self.push('200 active data connection established')
 
@@ -134,7 +135,7 @@
         with socket.socket() as sock:
             sock.bind((self.socket.getsockname()[0], 0))
             sock.listen(5)
-            sock.settimeout(10)
+            sock.settimeout(TIMEOUT)
             ip, port = sock.getsockname()[:2]
             ip = ip.replace('.', ','); p1 = port / 256; p2 = port % 256
             self.push('227 entering passive mode (%s,%d,%d)' %(ip, p1, p2))
@@ -144,7 +145,7 @@
     def cmd_eprt(self, arg):
         af, ip, port = arg.split(arg[0])[1:-1]
         port = int(port)
-        s = socket.create_connection((ip, port), timeout=2)
+        s = socket.create_connection((ip, port), timeout=TIMEOUT)
         self.dtp = self.dtp_handler(s, baseclass=self)
         self.push('200 active data connection established')
 
@@ -152,7 +153,7 @@
         with socket.socket(socket.AF_INET6) as sock:
             sock.bind((self.socket.getsockname()[0], 0))
             sock.listen(5)
-            sock.settimeout(10)
+            sock.settimeout(TIMEOUT)
             port = sock.getsockname()[1]
             self.push('229 entering extended passive mode (|||%d|)' %port)
             conn, addr = sock.accept()
@@ -300,7 +301,8 @@
 
 if ssl is not None:
 
-    CERTFILE = os.path.join(os.path.dirname(__file__), "keycert.pem")
+    CERTFILE = os.path.join(os.path.dirname(__file__), "keycert3.pem")
+    CAFILE = os.path.join(os.path.dirname(__file__), "pycacert.pem")
 
     class SSLConnection(asyncore.dispatcher):
         """An asyncore.dispatcher subclass supporting TLS/SSL."""
@@ -327,7 +329,7 @@
                 elif err.args[0] == ssl.SSL_ERROR_EOF:
                     return self.handle_close()
                 raise
-            except socket.error as err:
+            except OSError as err:
                 if err.args[0] == errno.ECONNABORTED:
                     return self.handle_close()
             else:
@@ -341,7 +343,7 @@
                 if err.args[0] in (ssl.SSL_ERROR_WANT_READ,
                                    ssl.SSL_ERROR_WANT_WRITE):
                     return
-            except socket.error as err:
+            except OSError as err:
                 # Any "socket error" corresponds to a SSL_ERROR_SYSCALL return
                 # from OpenSSL's SSL_shutdown(), corresponding to a
                 # closed socket condition. See also:
@@ -460,7 +462,7 @@
     def setUp(self):
         self.server = DummyFTPServer((HOST, 0))
         self.server.start()
-        self.client = ftplib.FTP(timeout=2)
+        self.client = ftplib.FTP(timeout=TIMEOUT)
         self.client.connect(self.server.host, self.server.port)
 
     def tearDown(self):
@@ -488,7 +490,7 @@
 
     def test_all_errors(self):
         exceptions = (ftplib.error_reply, ftplib.error_temp, ftplib.error_perm,
-                      ftplib.error_proto, ftplib.Error, IOError, EOFError)
+                      ftplib.error_proto, ftplib.Error, OSError, EOFError)
         for x in exceptions:
             try:
                 raise x('exception not included in all_errors set')
@@ -678,7 +680,7 @@
 
     def test_makepasv(self):
         host, port = self.client.makepasv()
-        conn = socket.create_connection((host, port), 10)
+        conn = socket.create_connection((host, port), timeout=TIMEOUT)
         conn.close()
         # IPv4 is in use, just make sure send_epsv has not been used
         self.assertEqual(self.server.handler_instance.last_received_cmd, 'pasv')
@@ -691,12 +693,12 @@
                 return False
             try:
                 self.client.sendcmd('noop')
-            except (socket.error, EOFError):
+            except (OSError, EOFError):
                 return False
             return True
 
         # base test
-        with ftplib.FTP(timeout=2) as self.client:
+        with ftplib.FTP(timeout=TIMEOUT) as self.client:
             self.client.connect(self.server.host, self.server.port)
             self.client.sendcmd('noop')
             self.assertTrue(is_client_connected())
@@ -704,7 +706,7 @@
         self.assertFalse(is_client_connected())
 
         # QUIT sent inside the with block
-        with ftplib.FTP(timeout=2) as self.client:
+        with ftplib.FTP(timeout=TIMEOUT) as self.client:
             self.client.connect(self.server.host, self.server.port)
             self.client.sendcmd('noop')
             self.client.quit()
@@ -714,7 +716,7 @@
         # force a wrong response code to be sent on QUIT: error_perm
         # is expected and the connection is supposed to be closed
         try:
-            with ftplib.FTP(timeout=2) as self.client:
+            with ftplib.FTP(timeout=TIMEOUT) as self.client:
                 self.client.connect(self.server.host, self.server.port)
                 self.client.sendcmd('noop')
                 self.server.handler_instance.next_response = '550 error on quit'
@@ -736,7 +738,7 @@
                                 source_address=(HOST, port))
             self.assertEqual(self.client.sock.getsockname()[1], port)
             self.client.quit()
-        except IOError as e:
+        except OSError as e:
             if e.errno == errno.EADDRINUSE:
                 self.skipTest("couldn't bind to port %d" % port)
             raise
@@ -747,7 +749,7 @@
         try:
             with self.client.transfercmd('list') as sock:
                 self.assertEqual(sock.getsockname()[1], port)
-        except IOError as e:
+        except OSError as e:
             if e.errno == errno.EADDRINUSE:
                 self.skipTest("couldn't bind to port %d" % port)
             raise
@@ -785,7 +787,7 @@
     def setUp(self):
         self.server = DummyFTPServer((HOSTv6, 0), af=socket.AF_INET6)
         self.server.start()
-        self.client = ftplib.FTP()
+        self.client = ftplib.FTP(timeout=TIMEOUT)
         self.client.connect(self.server.host, self.server.port)
 
     def tearDown(self):
@@ -802,7 +804,7 @@
 
     def test_makepasv(self):
         host, port = self.client.makepasv()
-        conn = socket.create_connection((host, port), 10)
+        conn = socket.create_connection((host, port), timeout=TIMEOUT)
         conn.close()
         self.assertEqual(self.server.handler_instance.last_received_cmd, 'epsv')
 
@@ -829,7 +831,7 @@
     def setUp(self):
         self.server = DummyTLS_FTPServer((HOST, 0))
         self.server.start()
-        self.client = ftplib.FTP_TLS(timeout=2)
+        self.client = ftplib.FTP_TLS(timeout=TIMEOUT)
         self.client.connect(self.server.host, self.server.port)
         # enable TLS
         self.client.auth()
@@ -843,7 +845,7 @@
     def setUp(self):
         self.server = DummyTLS_FTPServer((HOST, 0))
         self.server.start()
-        self.client = ftplib.FTP_TLS(timeout=2)
+        self.client = ftplib.FTP_TLS(timeout=TIMEOUT)
         self.client.connect(self.server.host, self.server.port)
 
     def tearDown(self):
@@ -887,7 +889,7 @@
 
     def test_auth_ssl(self):
         try:
-            self.client.ssl_version = ssl.PROTOCOL_SSLv3
+            self.client.ssl_version = ssl.PROTOCOL_SSLv23
             self.client.auth()
             self.assertRaises(ValueError, self.client.auth)
         finally:
@@ -903,7 +905,7 @@
         self.assertRaises(ValueError, ftplib.FTP_TLS, certfile=CERTFILE,
                           keyfile=CERTFILE, context=ctx)
 
-        self.client = ftplib.FTP_TLS(context=ctx, timeout=2)
+        self.client = ftplib.FTP_TLS(context=ctx, timeout=TIMEOUT)
         self.client.connect(self.server.host, self.server.port)
         self.assertNotIsInstance(self.client.sock, ssl.SSLSocket)
         self.client.auth()
@@ -922,6 +924,36 @@
         self.client.ccc()
         self.assertRaises(ValueError, self.client.sock.unwrap)
 
+    def test_check_hostname(self):
+        self.client.quit()
+        ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+        ctx.verify_mode = ssl.CERT_REQUIRED
+        ctx.check_hostname = True
+        ctx.load_verify_locations(CAFILE)
+        self.client = ftplib.FTP_TLS(context=ctx, timeout=TIMEOUT)
+
+        # 127.0.0.1 doesn't match SAN
+        self.client.connect(self.server.host, self.server.port)
+        with self.assertRaises(ssl.CertificateError):
+            self.client.auth()
+        # exception quits connection
+
+        self.client.connect(self.server.host, self.server.port)
+        self.client.prot_p()
+        with self.assertRaises(ssl.CertificateError):
+            with self.client.transfercmd("list") as sock:
+                pass
+        self.client.quit()
+
+        self.client.connect("localhost", self.server.port)
+        self.client.auth()
+        self.client.quit()
+
+        self.client.connect("localhost", self.server.port)
+        self.client.prot_p()
+        with self.client.transfercmd("list") as sock:
+            pass
+
 
 class TestTimeouts(TestCase):
 
@@ -1017,8 +1049,19 @@
         ftp.close()
 
 
+class TestNetrcDeprecation(TestCase):
+
+    def test_deprecation(self):
+        with support.temp_cwd(), support.EnvironmentVarGuard() as env:
+            env['HOME'] = os.getcwd()
+            open('.netrc', 'w').close()
+            with self.assertWarns(DeprecationWarning):
+                ftplib.Netrc()
+
+
+
 def test_main():
-    tests = [TestFTPClass, TestTimeouts,
+    tests = [TestFTPClass, TestTimeouts, TestNetrcDeprecation,
              TestIPv6Environment,
              TestTLS_FTPClassMixin, TestTLS_FTPClass]
 
diff --git a/Lib/test/test_funcattrs.py b/Lib/test/test_funcattrs.py
index c8ed830..5094f7b 100644
--- a/Lib/test/test_funcattrs.py
+++ b/Lib/test/test_funcattrs.py
@@ -7,6 +7,11 @@
     def inner_function():
         class LocalClass:
             pass
+        global inner_global_function
+        def inner_global_function():
+            def inner_function2():
+                pass
+            return inner_function2
         return LocalClass
     return lambda: inner_function
 
@@ -116,6 +121,8 @@
                          'global_function.<locals>.inner_function')
         self.assertEqual(global_function()()().__qualname__,
                          'global_function.<locals>.inner_function.<locals>.LocalClass')
+        self.assertEqual(inner_global_function.__qualname__, 'inner_global_function')
+        self.assertEqual(inner_global_function().__qualname__, 'inner_global_function.<locals>.inner_function2')
         self.b.__qualname__ = 'c'
         self.assertEqual(self.b.__qualname__, 'c')
         self.b.__qualname__ = 'd'
diff --git a/Lib/test/test_functools.py b/Lib/test/test_functools.py
index d1ce2a9..1012053 100644
--- a/Lib/test/test_functools.py
+++ b/Lib/test/test_functools.py
@@ -1,66 +1,52 @@
-import functools
+import abc
 import collections
-import sys
-import unittest
-from test import support
-from weakref import proxy
+from itertools import permutations
 import pickle
 from random import choice
+import sys
+from test import support
+import unittest
+from weakref import proxy
 
-@staticmethod
-def PythonPartial(func, *args, **keywords):
-    'Pure Python approximation of partial()'
-    def newfunc(*fargs, **fkeywords):
-        newkeywords = keywords.copy()
-        newkeywords.update(fkeywords)
-        return func(*(args + fargs), **newkeywords)
-    newfunc.func = func
-    newfunc.args = args
-    newfunc.keywords = keywords
-    return newfunc
+import functools
+
+py_functools = support.import_fresh_module('functools', blocked=['_functools'])
+c_functools = support.import_fresh_module('functools', fresh=['_functools'])
+
+decimal = support.import_fresh_module('decimal', fresh=['_decimal'])
+
 
 def capture(*args, **kw):
     """capture all positional and keyword arguments"""
     return args, kw
 
+
 def signature(part):
     """ return the signature of a partial object """
     return (part.func, part.args, part.keywords, part.__dict__)
 
-class TestPartial(unittest.TestCase):
 
-    thetype = functools.partial
+class TestPartial:
 
     def test_basic_examples(self):
-        p = self.thetype(capture, 1, 2, a=10, b=20)
+        p = self.partial(capture, 1, 2, a=10, b=20)
+        self.assertTrue(callable(p))
         self.assertEqual(p(3, 4, b=30, c=40),
                          ((1, 2, 3, 4), dict(a=10, b=30, c=40)))
-        p = self.thetype(map, lambda x: x*10)
+        p = self.partial(map, lambda x: x*10)
         self.assertEqual(list(p([1,2,3,4])), [10, 20, 30, 40])
 
     def test_attributes(self):
-        p = self.thetype(capture, 1, 2, a=10, b=20)
+        p = self.partial(capture, 1, 2, a=10, b=20)
         # attributes should be readable
         self.assertEqual(p.func, capture)
         self.assertEqual(p.args, (1, 2))
         self.assertEqual(p.keywords, dict(a=10, b=20))
-        # attributes should not be writable
-        self.assertRaises(AttributeError, setattr, p, 'func', map)
-        self.assertRaises(AttributeError, setattr, p, 'args', (1, 2))
-        self.assertRaises(AttributeError, setattr, p, 'keywords', dict(a=1, b=2))
-
-        p = self.thetype(hex)
-        try:
-            del p.__dict__
-        except TypeError:
-            pass
-        else:
-            self.fail('partial object allowed __dict__ to be deleted')
 
     def test_argument_checking(self):
-        self.assertRaises(TypeError, self.thetype)     # need at least a func arg
+        self.assertRaises(TypeError, self.partial)     # need at least a func arg
         try:
-            self.thetype(2)()
+            self.partial(2)()
         except TypeError:
             pass
         else:
@@ -71,7 +57,7 @@
         def func(a=10, b=20):
             return a
         d = {'a':3}
-        p = self.thetype(func, a=5)
+        p = self.partial(func, a=5)
         self.assertEqual(p(**d), 3)
         self.assertEqual(d, {'a':3})
         p(b=7)
@@ -80,20 +66,20 @@
     def test_arg_combinations(self):
         # exercise special code paths for zero args in either partial
         # object or the caller
-        p = self.thetype(capture)
+        p = self.partial(capture)
         self.assertEqual(p(), ((), {}))
         self.assertEqual(p(1,2), ((1,2), {}))
-        p = self.thetype(capture, 1, 2)
+        p = self.partial(capture, 1, 2)
         self.assertEqual(p(), ((1,2), {}))
         self.assertEqual(p(3,4), ((1,2,3,4), {}))
 
     def test_kw_combinations(self):
         # exercise special code paths for no keyword args in
         # either the partial object or the caller
-        p = self.thetype(capture)
+        p = self.partial(capture)
         self.assertEqual(p(), ((), {}))
         self.assertEqual(p(a=1), ((), {'a':1}))
-        p = self.thetype(capture, a=1)
+        p = self.partial(capture, a=1)
         self.assertEqual(p(), ((), {'a':1}))
         self.assertEqual(p(b=2), ((), {'a':1, 'b':2}))
         # keyword args in the call override those in the partial object
@@ -102,7 +88,7 @@
     def test_positional(self):
         # make sure positional arguments are captured correctly
         for args in [(), (0,), (0,1), (0,1,2), (0,1,2,3)]:
-            p = self.thetype(capture, *args)
+            p = self.partial(capture, *args)
             expected = args + ('x',)
             got, empty = p('x')
             self.assertTrue(expected == got and empty == {})
@@ -110,14 +96,14 @@
     def test_keyword(self):
         # make sure keyword arguments are captured correctly
         for a in ['a', 0, None, 3.5]:
-            p = self.thetype(capture, a=a)
+            p = self.partial(capture, a=a)
             expected = {'a':a,'x':None}
             empty, got = p(x=None)
             self.assertTrue(expected == got and empty == ())
 
     def test_no_side_effects(self):
         # make sure there are no side effects that affect subsequent calls
-        p = self.thetype(capture, 0, a=1)
+        p = self.partial(capture, 0, a=1)
         args1, kw1 = p(1, b=2)
         self.assertTrue(args1 == (0,1) and kw1 == {'a':1,'b':2})
         args2, kw2 = p()
@@ -126,13 +112,13 @@
     def test_error_propagation(self):
         def f(x, y):
             x / y
-        self.assertRaises(ZeroDivisionError, self.thetype(f, 1, 0))
-        self.assertRaises(ZeroDivisionError, self.thetype(f, 1), 0)
-        self.assertRaises(ZeroDivisionError, self.thetype(f), 1, 0)
-        self.assertRaises(ZeroDivisionError, self.thetype(f, y=0), 1)
+        self.assertRaises(ZeroDivisionError, self.partial(f, 1, 0))
+        self.assertRaises(ZeroDivisionError, self.partial(f, 1), 0)
+        self.assertRaises(ZeroDivisionError, self.partial(f), 1, 0)
+        self.assertRaises(ZeroDivisionError, self.partial(f, y=0), 1)
 
     def test_weakref(self):
-        f = self.thetype(int, base=16)
+        f = self.partial(int, base=16)
         p = proxy(f)
         self.assertEqual(f.func, p.func)
         f = None
@@ -140,42 +126,65 @@
 
     def test_with_bound_and_unbound_methods(self):
         data = list(map(str, range(10)))
-        join = self.thetype(str.join, '')
+        join = self.partial(str.join, '')
         self.assertEqual(join(data), '0123456789')
-        join = self.thetype(''.join)
+        join = self.partial(''.join)
         self.assertEqual(join(data), '0123456789')
 
+
+@unittest.skipUnless(c_functools, 'requires the C _functools module')
+class TestPartialC(TestPartial, unittest.TestCase):
+    if c_functools:
+        partial = c_functools.partial
+
+    def test_attributes_unwritable(self):
+        # attributes should not be writable
+        p = self.partial(capture, 1, 2, a=10, b=20)
+        self.assertRaises(AttributeError, setattr, p, 'func', map)
+        self.assertRaises(AttributeError, setattr, p, 'args', (1, 2))
+        self.assertRaises(AttributeError, setattr, p, 'keywords', dict(a=1, b=2))
+
+        p = self.partial(hex)
+        try:
+            del p.__dict__
+        except TypeError:
+            pass
+        else:
+            self.fail('partial object allowed __dict__ to be deleted')
+
     def test_repr(self):
         args = (object(), object())
         args_repr = ', '.join(repr(a) for a in args)
-        kwargs = {'a': object(), 'b': object()}
+        #kwargs = {'a': object(), 'b': object()}
+        kwargs = {'a': object()}
         kwargs_repr = ', '.join("%s=%r" % (k, v) for k, v in kwargs.items())
-        if self.thetype is functools.partial:
+        if self.partial is c_functools.partial:
             name = 'functools.partial'
         else:
-            name = self.thetype.__name__
+            name = self.partial.__name__
 
-        f = self.thetype(capture)
+        f = self.partial(capture)
         self.assertEqual('{}({!r})'.format(name, capture),
                          repr(f))
 
-        f = self.thetype(capture, *args)
+        f = self.partial(capture, *args)
         self.assertEqual('{}({!r}, {})'.format(name, capture, args_repr),
                          repr(f))
 
-        f = self.thetype(capture, **kwargs)
+        f = self.partial(capture, **kwargs)
         self.assertEqual('{}({!r}, {})'.format(name, capture, kwargs_repr),
                          repr(f))
 
-        f = self.thetype(capture, *args, **kwargs)
+        f = self.partial(capture, *args, **kwargs)
         self.assertEqual('{}({!r}, {}, {})'.format(name, capture, args_repr, kwargs_repr),
                          repr(f))
 
     def test_pickle(self):
-        f = self.thetype(signature, 'asdf', bar=True)
+        f = self.partial(signature, 'asdf', bar=True)
         f.add_something_to__dict__ = True
-        f_copy = pickle.loads(pickle.dumps(f))
-        self.assertEqual(signature(f), signature(f_copy))
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            f_copy = pickle.loads(pickle.dumps(f, proto))
+            self.assertEqual(signature(f), signature(f_copy))
 
     # Issue 6083: Reference counting bug
     def test_setstate_refcount(self):
@@ -191,30 +200,140 @@
                     return {}
                 raise IndexError
 
-        f = self.thetype(object)
+        f = self.partial(object)
         self.assertRaisesRegex(SystemError,
                 "new style getargs format but argument is not a tuple",
                 f.__setstate__, BadSequence())
 
-class PartialSubclass(functools.partial):
-    pass
 
-class TestPartialSubclass(TestPartial):
+class TestPartialPy(TestPartial, unittest.TestCase):
+    partial = staticmethod(py_functools.partial)
 
-    thetype = PartialSubclass
 
-class TestPythonPartial(TestPartial):
+if c_functools:
+    class PartialSubclass(c_functools.partial):
+        pass
 
-    thetype = PythonPartial
 
-    # the python version hasn't a nice repr
-    test_repr = None
+@unittest.skipUnless(c_functools, 'requires the C _functools module')
+class TestPartialCSubclass(TestPartialC):
+    if c_functools:
+        partial = PartialSubclass
 
-    # the python version isn't picklable
-    test_pickle = test_setstate_refcount = None
 
-    # the python version isn't a type
-    test_attributes = None
+class TestPartialMethod(unittest.TestCase):
+
+    class A(object):
+        nothing = functools.partialmethod(capture)
+        positional = functools.partialmethod(capture, 1)
+        keywords = functools.partialmethod(capture, a=2)
+        both = functools.partialmethod(capture, 3, b=4)
+
+        nested = functools.partialmethod(positional, 5)
+
+        over_partial = functools.partialmethod(functools.partial(capture, c=6), 7)
+
+        static = functools.partialmethod(staticmethod(capture), 8)
+        cls = functools.partialmethod(classmethod(capture), d=9)
+
+    a = A()
+
+    def test_arg_combinations(self):
+        self.assertEqual(self.a.nothing(), ((self.a,), {}))
+        self.assertEqual(self.a.nothing(5), ((self.a, 5), {}))
+        self.assertEqual(self.a.nothing(c=6), ((self.a,), {'c': 6}))
+        self.assertEqual(self.a.nothing(5, c=6), ((self.a, 5), {'c': 6}))
+
+        self.assertEqual(self.a.positional(), ((self.a, 1), {}))
+        self.assertEqual(self.a.positional(5), ((self.a, 1, 5), {}))
+        self.assertEqual(self.a.positional(c=6), ((self.a, 1), {'c': 6}))
+        self.assertEqual(self.a.positional(5, c=6), ((self.a, 1, 5), {'c': 6}))
+
+        self.assertEqual(self.a.keywords(), ((self.a,), {'a': 2}))
+        self.assertEqual(self.a.keywords(5), ((self.a, 5), {'a': 2}))
+        self.assertEqual(self.a.keywords(c=6), ((self.a,), {'a': 2, 'c': 6}))
+        self.assertEqual(self.a.keywords(5, c=6), ((self.a, 5), {'a': 2, 'c': 6}))
+
+        self.assertEqual(self.a.both(), ((self.a, 3), {'b': 4}))
+        self.assertEqual(self.a.both(5), ((self.a, 3, 5), {'b': 4}))
+        self.assertEqual(self.a.both(c=6), ((self.a, 3), {'b': 4, 'c': 6}))
+        self.assertEqual(self.a.both(5, c=6), ((self.a, 3, 5), {'b': 4, 'c': 6}))
+
+        self.assertEqual(self.A.both(self.a, 5, c=6), ((self.a, 3, 5), {'b': 4, 'c': 6}))
+
+    def test_nested(self):
+        self.assertEqual(self.a.nested(), ((self.a, 1, 5), {}))
+        self.assertEqual(self.a.nested(6), ((self.a, 1, 5, 6), {}))
+        self.assertEqual(self.a.nested(d=7), ((self.a, 1, 5), {'d': 7}))
+        self.assertEqual(self.a.nested(6, d=7), ((self.a, 1, 5, 6), {'d': 7}))
+
+        self.assertEqual(self.A.nested(self.a, 6, d=7), ((self.a, 1, 5, 6), {'d': 7}))
+
+    def test_over_partial(self):
+        self.assertEqual(self.a.over_partial(), ((self.a, 7), {'c': 6}))
+        self.assertEqual(self.a.over_partial(5), ((self.a, 7, 5), {'c': 6}))
+        self.assertEqual(self.a.over_partial(d=8), ((self.a, 7), {'c': 6, 'd': 8}))
+        self.assertEqual(self.a.over_partial(5, d=8), ((self.a, 7, 5), {'c': 6, 'd': 8}))
+
+        self.assertEqual(self.A.over_partial(self.a, 5, d=8), ((self.a, 7, 5), {'c': 6, 'd': 8}))
+
+    def test_bound_method_introspection(self):
+        obj = self.a
+        self.assertIs(obj.both.__self__, obj)
+        self.assertIs(obj.nested.__self__, obj)
+        self.assertIs(obj.over_partial.__self__, obj)
+        self.assertIs(obj.cls.__self__, self.A)
+        self.assertIs(self.A.cls.__self__, self.A)
+
+    def test_unbound_method_retrieval(self):
+        obj = self.A
+        self.assertFalse(hasattr(obj.both, "__self__"))
+        self.assertFalse(hasattr(obj.nested, "__self__"))
+        self.assertFalse(hasattr(obj.over_partial, "__self__"))
+        self.assertFalse(hasattr(obj.static, "__self__"))
+        self.assertFalse(hasattr(self.a.static, "__self__"))
+
+    def test_descriptors(self):
+        for obj in [self.A, self.a]:
+            with self.subTest(obj=obj):
+                self.assertEqual(obj.static(), ((8,), {}))
+                self.assertEqual(obj.static(5), ((8, 5), {}))
+                self.assertEqual(obj.static(d=8), ((8,), {'d': 8}))
+                self.assertEqual(obj.static(5, d=8), ((8, 5), {'d': 8}))
+
+                self.assertEqual(obj.cls(), ((self.A,), {'d': 9}))
+                self.assertEqual(obj.cls(5), ((self.A, 5), {'d': 9}))
+                self.assertEqual(obj.cls(c=8), ((self.A,), {'c': 8, 'd': 9}))
+                self.assertEqual(obj.cls(5, c=8), ((self.A, 5), {'c': 8, 'd': 9}))
+
+    def test_overriding_keywords(self):
+        self.assertEqual(self.a.keywords(a=3), ((self.a,), {'a': 3}))
+        self.assertEqual(self.A.keywords(self.a, a=3), ((self.a,), {'a': 3}))
+
+    def test_invalid_args(self):
+        with self.assertRaises(TypeError):
+            class B(object):
+                method = functools.partialmethod(None, 1)
+
+    def test_repr(self):
+        self.assertEqual(repr(vars(self.A)['both']),
+                         'functools.partialmethod({}, 3, b=4)'.format(capture))
+
+    def test_abstract(self):
+        class Abstract(abc.ABCMeta):
+
+            @abc.abstractmethod
+            def add(self, x, y):
+                pass
+
+            add5 = functools.partialmethod(add, 5)
+
+        self.assertTrue(Abstract.add.__isabstractmethod__)
+        self.assertTrue(Abstract.add5.__isabstractmethod__)
+
+        for func in [self.A.static, self.A.cls, self.A.over_partial, self.A.nested, self.A.both]:
+            self.assertFalse(getattr(func, '__isabstractmethod__', False))
+
 
 class TestUpdateWrapper(unittest.TestCase):
 
@@ -223,19 +342,26 @@
                       updated=functools.WRAPPER_UPDATES):
         # Check attributes were assigned
         for name in assigned:
-            self.assertTrue(getattr(wrapper, name) is getattr(wrapped, name))
+            self.assertIs(getattr(wrapper, name), getattr(wrapped, name))
         # Check attributes were updated
         for name in updated:
             wrapper_attr = getattr(wrapper, name)
             wrapped_attr = getattr(wrapped, name)
             for key in wrapped_attr:
-                self.assertTrue(wrapped_attr[key] is wrapper_attr[key])
+                if name == "__dict__" and key == "__wrapped__":
+                    # __wrapped__ is overwritten by the update code
+                    continue
+                self.assertIs(wrapped_attr[key], wrapper_attr[key])
+        # Check __wrapped__
+        self.assertIs(wrapper.__wrapped__, wrapped)
+
 
     def _default_update(self):
         def f(a:'This is a new annotation'):
             """This is a test"""
             pass
         f.attr = 'This is also a test'
+        f.__wrapped__ = "This is a bald faced lie"
         def wrapper(b:'This is the prior annotation'):
             pass
         functools.update_wrapper(wrapper, f)
@@ -322,6 +448,7 @@
         self.assertTrue(wrapper.__doc__.startswith('max('))
         self.assertEqual(wrapper.__annotations__, {})
 
+
 class TestWraps(TestUpdateWrapper):
 
     def _default_update(self):
@@ -329,14 +456,15 @@
             """This is a test"""
             pass
         f.attr = 'This is also a test'
+        f.__wrapped__ = "This is still a bald faced lie"
         @functools.wraps(f)
         def wrapper():
             pass
-        self.check_wrapper(wrapper, f)
         return wrapper, f
 
     def test_default_update(self):
         wrapper, f = self._default_update()
+        self.check_wrapper(wrapper, f)
         self.assertEqual(wrapper.__name__, 'f')
         self.assertEqual(wrapper.__qualname__, f.__qualname__)
         self.assertEqual(wrapper.attr, 'This is also a test')
@@ -382,6 +510,7 @@
         self.assertEqual(wrapper.attr, 'This is a different test')
         self.assertEqual(wrapper.dict_attr, f.dict_attr)
 
+
 class TestReduce(unittest.TestCase):
     func = functools.reduce
 
@@ -462,24 +591,29 @@
         d = {"one": 1, "two": 2, "three": 3}
         self.assertEqual(self.func(add, d), "".join(d.keys()))
 
-class TestCmpToKey(unittest.TestCase):
+
+class TestCmpToKey:
 
     def test_cmp_to_key(self):
         def cmp1(x, y):
             return (x > y) - (x < y)
-        key = functools.cmp_to_key(cmp1)
+        key = self.cmp_to_key(cmp1)
         self.assertEqual(key(3), key(3))
         self.assertGreater(key(3), key(1))
+        self.assertGreaterEqual(key(3), key(3))
+
         def cmp2(x, y):
             return int(x) - int(y)
-        key = functools.cmp_to_key(cmp2)
+        key = self.cmp_to_key(cmp2)
         self.assertEqual(key(4.0), key('4'))
         self.assertLess(key(2), key('35'))
+        self.assertLessEqual(key(2), key('35'))
+        self.assertNotEqual(key(2), key('35'))
 
     def test_cmp_to_key_arguments(self):
         def cmp1(x, y):
             return (x > y) - (x < y)
-        key = functools.cmp_to_key(mycmp=cmp1)
+        key = self.cmp_to_key(mycmp=cmp1)
         self.assertEqual(key(obj=3), key(obj=3))
         self.assertGreater(key(obj=3), key(obj=1))
         with self.assertRaises((TypeError, AttributeError)):
@@ -487,10 +621,10 @@
         with self.assertRaises((TypeError, AttributeError)):
             1 < key(3)    # lhs is not a K object
         with self.assertRaises(TypeError):
-            key = functools.cmp_to_key()             # too few args
+            key = self.cmp_to_key()             # too few args
         with self.assertRaises(TypeError):
-            key = functools.cmp_to_key(cmp1, None)   # too many args
-        key = functools.cmp_to_key(cmp1)
+            key = self.cmp_to_key(cmp1, None)   # too many args
+        key = self.cmp_to_key(cmp1)
         with self.assertRaises(TypeError):
             key()                                    # too few args
         with self.assertRaises(TypeError):
@@ -499,7 +633,7 @@
     def test_bad_cmp(self):
         def cmp1(x, y):
             raise ZeroDivisionError
-        key = functools.cmp_to_key(cmp1)
+        key = self.cmp_to_key(cmp1)
         with self.assertRaises(ZeroDivisionError):
             key(3) > key(1)
 
@@ -514,13 +648,13 @@
     def test_obj_field(self):
         def cmp1(x, y):
             return (x > y) - (x < y)
-        key = functools.cmp_to_key(mycmp=cmp1)
+        key = self.cmp_to_key(mycmp=cmp1)
         self.assertEqual(key(50).obj, 50)
 
     def test_sort_int(self):
         def mycmp(x, y):
             return y - x
-        self.assertEqual(sorted(range(5), key=functools.cmp_to_key(mycmp)),
+        self.assertEqual(sorted(range(5), key=self.cmp_to_key(mycmp)),
                          [4, 3, 2, 1, 0])
 
     def test_sort_int_str(self):
@@ -528,18 +662,29 @@
             x, y = int(x), int(y)
             return (x > y) - (x < y)
         values = [5, '3', 7, 2, '0', '1', 4, '10', 1]
-        values = sorted(values, key=functools.cmp_to_key(mycmp))
+        values = sorted(values, key=self.cmp_to_key(mycmp))
         self.assertEqual([int(value) for value in values],
                          [0, 1, 1, 2, 3, 4, 5, 7, 10])
 
     def test_hash(self):
         def mycmp(x, y):
             return y - x
-        key = functools.cmp_to_key(mycmp)
+        key = self.cmp_to_key(mycmp)
         k = key(10)
         self.assertRaises(TypeError, hash, k)
         self.assertNotIsInstance(k, collections.Hashable)
 
+
+@unittest.skipUnless(c_functools, 'requires the C _functools module')
+class TestCmpToKeyC(TestCmpToKey, unittest.TestCase):
+    if c_functools:
+        cmp_to_key = c_functools.cmp_to_key
+
+
+class TestCmpToKeyPy(TestCmpToKey, unittest.TestCase):
+    cmp_to_key = staticmethod(py_functools.cmp_to_key)
+
+
 class TestTotalOrdering(unittest.TestCase):
 
     def test_total_ordering_lt(self):
@@ -557,6 +702,7 @@
         self.assertTrue(A(2) >= A(1))
         self.assertTrue(A(2) <= A(2))
         self.assertTrue(A(2) >= A(2))
+        self.assertFalse(A(1) > A(2))
 
     def test_total_ordering_le(self):
         @functools.total_ordering
@@ -573,6 +719,7 @@
         self.assertTrue(A(2) >= A(1))
         self.assertTrue(A(2) <= A(2))
         self.assertTrue(A(2) >= A(2))
+        self.assertFalse(A(1) >= A(2))
 
     def test_total_ordering_gt(self):
         @functools.total_ordering
@@ -589,6 +736,7 @@
         self.assertTrue(A(2) >= A(1))
         self.assertTrue(A(2) <= A(2))
         self.assertTrue(A(2) >= A(2))
+        self.assertFalse(A(2) < A(1))
 
     def test_total_ordering_ge(self):
         @functools.total_ordering
@@ -605,6 +753,7 @@
         self.assertTrue(A(2) >= A(1))
         self.assertTrue(A(2) <= A(2))
         self.assertTrue(A(2) >= A(2))
+        self.assertFalse(A(2) <= A(1))
 
     def test_total_ordering_no_overwrite(self):
         # new methods should not overwrite existing
@@ -624,27 +773,118 @@
             class A:
                 pass
 
-    def test_bug_10042(self):
+    def test_type_error_when_not_implemented(self):
+        # bug 10042; ensure stack overflow does not occur
+        # when decorated types return NotImplemented
         @functools.total_ordering
-        class TestTO:
+        class ImplementsLessThan:
             def __init__(self, value):
                 self.value = value
             def __eq__(self, other):
-                if isinstance(other, TestTO):
+                if isinstance(other, ImplementsLessThan):
                     return self.value == other.value
                 return False
             def __lt__(self, other):
-                if isinstance(other, TestTO):
+                if isinstance(other, ImplementsLessThan):
                     return self.value < other.value
-                raise TypeError
-        with self.assertRaises(TypeError):
-            TestTO(8) <= ()
+                return NotImplemented
+
+        @functools.total_ordering
+        class ImplementsGreaterThan:
+            def __init__(self, value):
+                self.value = value
+            def __eq__(self, other):
+                if isinstance(other, ImplementsGreaterThan):
+                    return self.value == other.value
+                return False
+            def __gt__(self, other):
+                if isinstance(other, ImplementsGreaterThan):
+                    return self.value > other.value
+                return NotImplemented
+
+        @functools.total_ordering
+        class ImplementsLessThanEqualTo:
+            def __init__(self, value):
+                self.value = value
+            def __eq__(self, other):
+                if isinstance(other, ImplementsLessThanEqualTo):
+                    return self.value == other.value
+                return False
+            def __le__(self, other):
+                if isinstance(other, ImplementsLessThanEqualTo):
+                    return self.value <= other.value
+                return NotImplemented
+
+        @functools.total_ordering
+        class ImplementsGreaterThanEqualTo:
+            def __init__(self, value):
+                self.value = value
+            def __eq__(self, other):
+                if isinstance(other, ImplementsGreaterThanEqualTo):
+                    return self.value == other.value
+                return False
+            def __ge__(self, other):
+                if isinstance(other, ImplementsGreaterThanEqualTo):
+                    return self.value >= other.value
+                return NotImplemented
+
+        @functools.total_ordering
+        class ComparatorNotImplemented:
+            def __init__(self, value):
+                self.value = value
+            def __eq__(self, other):
+                if isinstance(other, ComparatorNotImplemented):
+                    return self.value == other.value
+                return False
+            def __lt__(self, other):
+                return NotImplemented
+
+        with self.subTest("LT < 1"), self.assertRaises(TypeError):
+            ImplementsLessThan(-1) < 1
+
+        with self.subTest("LT < LE"), self.assertRaises(TypeError):
+            ImplementsLessThan(0) < ImplementsLessThanEqualTo(0)
+
+        with self.subTest("LT < GT"), self.assertRaises(TypeError):
+            ImplementsLessThan(1) < ImplementsGreaterThan(1)
+
+        with self.subTest("LE <= LT"), self.assertRaises(TypeError):
+            ImplementsLessThanEqualTo(2) <= ImplementsLessThan(2)
+
+        with self.subTest("LE <= GE"), self.assertRaises(TypeError):
+            ImplementsLessThanEqualTo(3) <= ImplementsGreaterThanEqualTo(3)
+
+        with self.subTest("GT > GE"), self.assertRaises(TypeError):
+            ImplementsGreaterThan(4) > ImplementsGreaterThanEqualTo(4)
+
+        with self.subTest("GT > LT"), self.assertRaises(TypeError):
+            ImplementsGreaterThan(5) > ImplementsLessThan(5)
+
+        with self.subTest("GE >= GT"), self.assertRaises(TypeError):
+            ImplementsGreaterThanEqualTo(6) >= ImplementsGreaterThan(6)
+
+        with self.subTest("GE >= LE"), self.assertRaises(TypeError):
+            ImplementsGreaterThanEqualTo(7) >= ImplementsLessThanEqualTo(7)
+
+        with self.subTest("GE when equal"):
+            a = ComparatorNotImplemented(8)
+            b = ComparatorNotImplemented(8)
+            self.assertEqual(a, b)
+            with self.assertRaises(TypeError):
+                a >= b
+
+        with self.subTest("LE when equal"):
+            a = ComparatorNotImplemented(9)
+            b = ComparatorNotImplemented(9)
+            self.assertEqual(a, b)
+            with self.assertRaises(TypeError):
+                a <= b
 
 class TestLRU(unittest.TestCase):
 
     def test_lru(self):
         def orig(x, y):
-            return 3*x+y
+            return 3 * x + y
         f = functools.lru_cache(maxsize=20)(orig)
         hits, misses, maxsize, currsize = f.cache_info()
         self.assertEqual(maxsize, 20)
@@ -749,7 +989,7 @@
         # Verify that user_function exceptions get passed through without
         # creating a hard-to-read chained exception.
         # http://bugs.python.org/issue13177
-        for maxsize in (None, 100):
+        for maxsize in (None, 128):
             @functools.lru_cache(maxsize)
             def func(i):
                 return 'abc'[i]
@@ -762,7 +1002,7 @@
                 func(15)
 
     def test_lru_with_types(self):
-        for maxsize in (None, 100):
+        for maxsize in (None, 128):
             @functools.lru_cache(maxsize=maxsize, typed=True)
             def square(x):
                 return x * x
@@ -777,6 +1017,36 @@
             self.assertEqual(square.cache_info().hits, 4)
             self.assertEqual(square.cache_info().misses, 4)
 
+    def test_lru_with_keyword_args(self):
+        @functools.lru_cache()
+        def fib(n):
+            if n < 2:
+                return n
+            return fib(n=n-1) + fib(n=n-2)
+        self.assertEqual(
+            [fib(n=number) for number in range(16)],
+            [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610]
+        )
+        self.assertEqual(fib.cache_info(),
+            functools._CacheInfo(hits=28, misses=16, maxsize=128, currsize=16))
+        fib.cache_clear()
+        self.assertEqual(fib.cache_info(),
+            functools._CacheInfo(hits=0, misses=0, maxsize=128, currsize=0))
+
+    def test_lru_with_keyword_args_maxsize_none(self):
+        @functools.lru_cache(maxsize=None)
+        def fib(n):
+            if n < 2:
+                return n
+            return fib(n=n-1) + fib(n=n-2)
+        self.assertEqual([fib(n=number) for number in range(16)],
+            [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610])
+        self.assertEqual(fib.cache_info(),
+            functools._CacheInfo(hits=28, misses=16, maxsize=None, currsize=16))
+        fib.cache_clear()
+        self.assertEqual(fib.cache_info(),
+            functools._CacheInfo(hits=0, misses=0, maxsize=None, currsize=0))
+
     def test_need_for_rlock(self):
         # This will deadlock on an LRU cache that uses a regular lock
 
@@ -801,18 +1071,503 @@
         self.assertEqual(test_func(DoubleEq(2)),    # Trigger a re-entrant __eq__ call
                          DoubleEq(2))               # Verify the correct return value
 
+    def test_early_detection_of_bad_call(self):
+        # Issue #22184
+        with self.assertRaises(TypeError):
+            @functools.lru_cache
+            def f():
+                pass
+
+
+class TestSingleDispatch(unittest.TestCase):
+    def test_simple_overloads(self):
+        @functools.singledispatch
+        def g(obj):
+            return "base"
+        def g_int(i):
+            return "integer"
+        g.register(int, g_int)
+        self.assertEqual(g("str"), "base")
+        self.assertEqual(g(1), "integer")
+        self.assertEqual(g([1,2,3]), "base")
+
+    def test_mro(self):
+        @functools.singledispatch
+        def g(obj):
+            return "base"
+        class A:
+            pass
+        class C(A):
+            pass
+        class B(A):
+            pass
+        class D(C, B):
+            pass
+        def g_A(a):
+            return "A"
+        def g_B(b):
+            return "B"
+        g.register(A, g_A)
+        g.register(B, g_B)
+        self.assertEqual(g(A()), "A")
+        self.assertEqual(g(B()), "B")
+        self.assertEqual(g(C()), "A")
+        self.assertEqual(g(D()), "B")
+
+    def test_register_decorator(self):
+        @functools.singledispatch
+        def g(obj):
+            return "base"
+        @g.register(int)
+        def g_int(i):
+            return "int %s" % (i,)
+        self.assertEqual(g(""), "base")
+        self.assertEqual(g(12), "int 12")
+        self.assertIs(g.dispatch(int), g_int)
+        self.assertIs(g.dispatch(object), g.dispatch(str))
+        # Note: in the assert above this is not g.
+        # @singledispatch returns the wrapper.
+
+    def test_wrapping_attributes(self):
+        @functools.singledispatch
+        def g(obj):
+            "Simple test"
+            return "Test"
+        self.assertEqual(g.__name__, "g")
+        if sys.flags.optimize < 2:
+            self.assertEqual(g.__doc__, "Simple test")
+
+    @unittest.skipUnless(decimal, 'requires _decimal')
+    @support.cpython_only
+    def test_c_classes(self):
+        @functools.singledispatch
+        def g(obj):
+            return "base"
+        @g.register(decimal.DecimalException)
+        def _(obj):
+            return obj.args
+        subn = decimal.Subnormal("Exponent < Emin")
+        rnd = decimal.Rounded("Number got rounded")
+        self.assertEqual(g(subn), ("Exponent < Emin",))
+        self.assertEqual(g(rnd), ("Number got rounded",))
+        @g.register(decimal.Subnormal)
+        def _(obj):
+            return "Too small to care."
+        self.assertEqual(g(subn), "Too small to care.")
+        self.assertEqual(g(rnd), ("Number got rounded",))
+
+    def test_compose_mro(self):
+        # None of the examples in this test depend on haystack ordering.
+        c = collections
+        mro = functools._compose_mro
+        bases = [c.Sequence, c.MutableMapping, c.Mapping, c.Set]
+        for haystack in permutations(bases):
+            m = mro(dict, haystack)
+            self.assertEqual(m, [dict, c.MutableMapping, c.Mapping, c.Sized,
+                                 c.Iterable, c.Container, object])
+        bases = [c.Container, c.Mapping, c.MutableMapping, c.OrderedDict]
+        for haystack in permutations(bases):
+            m = mro(c.ChainMap, haystack)
+            self.assertEqual(m, [c.ChainMap, c.MutableMapping, c.Mapping,
+                                 c.Sized, c.Iterable, c.Container, object])
+
+        # If there's a generic function with implementations registered for
+        # both Sized and Container, passing a defaultdict to it results in an
+        # ambiguous dispatch which will cause a RuntimeError (see
+        # test_mro_conflicts).
+        bases = [c.Container, c.Sized, str]
+        for haystack in permutations(bases):
+            m = mro(c.defaultdict, [c.Sized, c.Container, str])
+            self.assertEqual(m, [c.defaultdict, dict, c.Sized, c.Container,
+                                 object])
+
+        # MutableSequence below is registered directly on D. In other words, it
+        # preceeds MutableMapping which means single dispatch will always
+        # choose MutableSequence here.
+        class D(c.defaultdict):
+            pass
+        c.MutableSequence.register(D)
+        bases = [c.MutableSequence, c.MutableMapping]
+        for haystack in permutations(bases):
+            m = mro(D, bases)
+            self.assertEqual(m, [D, c.MutableSequence, c.Sequence,
+                                 c.defaultdict, dict, c.MutableMapping,
+                                 c.Mapping, c.Sized, c.Iterable, c.Container,
+                                 object])
+
+        # Container and Callable are registered on different base classes and
+        # a generic function supporting both should always pick the Callable
+        # implementation if a C instance is passed.
+        class C(c.defaultdict):
+            def __call__(self):
+                pass
+        bases = [c.Sized, c.Callable, c.Container, c.Mapping]
+        for haystack in permutations(bases):
+            m = mro(C, haystack)
+            self.assertEqual(m, [C, c.Callable, c.defaultdict, dict, c.Mapping,
+                                 c.Sized, c.Iterable, c.Container, object])
+
+    def test_register_abc(self):
+        c = collections
+        d = {"a": "b"}
+        l = [1, 2, 3]
+        s = {object(), None}
+        f = frozenset(s)
+        t = (1, 2, 3)
+        @functools.singledispatch
+        def g(obj):
+            return "base"
+        self.assertEqual(g(d), "base")
+        self.assertEqual(g(l), "base")
+        self.assertEqual(g(s), "base")
+        self.assertEqual(g(f), "base")
+        self.assertEqual(g(t), "base")
+        g.register(c.Sized, lambda obj: "sized")
+        self.assertEqual(g(d), "sized")
+        self.assertEqual(g(l), "sized")
+        self.assertEqual(g(s), "sized")
+        self.assertEqual(g(f), "sized")
+        self.assertEqual(g(t), "sized")
+        g.register(c.MutableMapping, lambda obj: "mutablemapping")
+        self.assertEqual(g(d), "mutablemapping")
+        self.assertEqual(g(l), "sized")
+        self.assertEqual(g(s), "sized")
+        self.assertEqual(g(f), "sized")
+        self.assertEqual(g(t), "sized")
+        g.register(c.ChainMap, lambda obj: "chainmap")
+        self.assertEqual(g(d), "mutablemapping")  # irrelevant ABCs registered
+        self.assertEqual(g(l), "sized")
+        self.assertEqual(g(s), "sized")
+        self.assertEqual(g(f), "sized")
+        self.assertEqual(g(t), "sized")
+        g.register(c.MutableSequence, lambda obj: "mutablesequence")
+        self.assertEqual(g(d), "mutablemapping")
+        self.assertEqual(g(l), "mutablesequence")
+        self.assertEqual(g(s), "sized")
+        self.assertEqual(g(f), "sized")
+        self.assertEqual(g(t), "sized")
+        g.register(c.MutableSet, lambda obj: "mutableset")
+        self.assertEqual(g(d), "mutablemapping")
+        self.assertEqual(g(l), "mutablesequence")
+        self.assertEqual(g(s), "mutableset")
+        self.assertEqual(g(f), "sized")
+        self.assertEqual(g(t), "sized")
+        g.register(c.Mapping, lambda obj: "mapping")
+        self.assertEqual(g(d), "mutablemapping")  # not specific enough
+        self.assertEqual(g(l), "mutablesequence")
+        self.assertEqual(g(s), "mutableset")
+        self.assertEqual(g(f), "sized")
+        self.assertEqual(g(t), "sized")
+        g.register(c.Sequence, lambda obj: "sequence")
+        self.assertEqual(g(d), "mutablemapping")
+        self.assertEqual(g(l), "mutablesequence")
+        self.assertEqual(g(s), "mutableset")
+        self.assertEqual(g(f), "sized")
+        self.assertEqual(g(t), "sequence")
+        g.register(c.Set, lambda obj: "set")
+        self.assertEqual(g(d), "mutablemapping")
+        self.assertEqual(g(l), "mutablesequence")
+        self.assertEqual(g(s), "mutableset")
+        self.assertEqual(g(f), "set")
+        self.assertEqual(g(t), "sequence")
+        g.register(dict, lambda obj: "dict")
+        self.assertEqual(g(d), "dict")
+        self.assertEqual(g(l), "mutablesequence")
+        self.assertEqual(g(s), "mutableset")
+        self.assertEqual(g(f), "set")
+        self.assertEqual(g(t), "sequence")
+        g.register(list, lambda obj: "list")
+        self.assertEqual(g(d), "dict")
+        self.assertEqual(g(l), "list")
+        self.assertEqual(g(s), "mutableset")
+        self.assertEqual(g(f), "set")
+        self.assertEqual(g(t), "sequence")
+        g.register(set, lambda obj: "concrete-set")
+        self.assertEqual(g(d), "dict")
+        self.assertEqual(g(l), "list")
+        self.assertEqual(g(s), "concrete-set")
+        self.assertEqual(g(f), "set")
+        self.assertEqual(g(t), "sequence")
+        g.register(frozenset, lambda obj: "frozen-set")
+        self.assertEqual(g(d), "dict")
+        self.assertEqual(g(l), "list")
+        self.assertEqual(g(s), "concrete-set")
+        self.assertEqual(g(f), "frozen-set")
+        self.assertEqual(g(t), "sequence")
+        g.register(tuple, lambda obj: "tuple")
+        self.assertEqual(g(d), "dict")
+        self.assertEqual(g(l), "list")
+        self.assertEqual(g(s), "concrete-set")
+        self.assertEqual(g(f), "frozen-set")
+        self.assertEqual(g(t), "tuple")
+
+    def test_c3_abc(self):
+        c = collections
+        mro = functools._c3_mro
+        class A(object):
+            pass
+        class B(A):
+            def __len__(self):
+                return 0   # implies Sized
+        @c.Container.register
+        class C(object):
+            pass
+        class D(object):
+            pass   # unrelated
+        class X(D, C, B):
+            def __call__(self):
+                pass   # implies Callable
+        expected = [X, c.Callable, D, C, c.Container, B, c.Sized, A, object]
+        for abcs in permutations([c.Sized, c.Callable, c.Container]):
+            self.assertEqual(mro(X, abcs=abcs), expected)
+        # unrelated ABCs don't appear in the resulting MRO
+        many_abcs = [c.Mapping, c.Sized, c.Callable, c.Container, c.Iterable]
+        self.assertEqual(mro(X, abcs=many_abcs), expected)
+
+    def test_mro_conflicts(self):
+        c = collections
+        @functools.singledispatch
+        def g(arg):
+            return "base"
+        class O(c.Sized):
+            def __len__(self):
+                return 0
+        o = O()
+        self.assertEqual(g(o), "base")
+        g.register(c.Iterable, lambda arg: "iterable")
+        g.register(c.Container, lambda arg: "container")
+        g.register(c.Sized, lambda arg: "sized")
+        g.register(c.Set, lambda arg: "set")
+        self.assertEqual(g(o), "sized")
+        c.Iterable.register(O)
+        self.assertEqual(g(o), "sized")   # because it's explicitly in __mro__
+        c.Container.register(O)
+        self.assertEqual(g(o), "sized")   # see above: Sized is in __mro__
+        c.Set.register(O)
+        self.assertEqual(g(o), "set")     # because c.Set is a subclass of
+                                          # c.Sized and c.Container
+        class P:
+            pass
+        p = P()
+        self.assertEqual(g(p), "base")
+        c.Iterable.register(P)
+        self.assertEqual(g(p), "iterable")
+        c.Container.register(P)
+        with self.assertRaises(RuntimeError) as re_one:
+            g(p)
+        self.assertIn(
+            str(re_one.exception),
+            (("Ambiguous dispatch: <class 'collections.abc.Container'> "
+              "or <class 'collections.abc.Iterable'>"),
+             ("Ambiguous dispatch: <class 'collections.abc.Iterable'> "
+              "or <class 'collections.abc.Container'>")),
+        )
+        class Q(c.Sized):
+            def __len__(self):
+                return 0
+        q = Q()
+        self.assertEqual(g(q), "sized")
+        c.Iterable.register(Q)
+        self.assertEqual(g(q), "sized")   # because it's explicitly in __mro__
+        c.Set.register(Q)
+        self.assertEqual(g(q), "set")     # because c.Set is a subclass of
+                                          # c.Sized and c.Iterable
+        @functools.singledispatch
+        def h(arg):
+            return "base"
+        @h.register(c.Sized)
+        def _(arg):
+            return "sized"
+        @h.register(c.Container)
+        def _(arg):
+            return "container"
+        # Even though Sized and Container are explicit bases of MutableMapping,
+        # this ABC is implicitly registered on defaultdict which makes all of
+        # MutableMapping's bases implicit as well from defaultdict's
+        # perspective.
+        with self.assertRaises(RuntimeError) as re_two:
+            h(c.defaultdict(lambda: 0))
+        self.assertIn(
+            str(re_two.exception),
+            (("Ambiguous dispatch: <class 'collections.abc.Container'> "
+              "or <class 'collections.abc.Sized'>"),
+             ("Ambiguous dispatch: <class 'collections.abc.Sized'> "
+              "or <class 'collections.abc.Container'>")),
+        )
+        class R(c.defaultdict):
+            pass
+        c.MutableSequence.register(R)
+        @functools.singledispatch
+        def i(arg):
+            return "base"
+        @i.register(c.MutableMapping)
+        def _(arg):
+            return "mapping"
+        @i.register(c.MutableSequence)
+        def _(arg):
+            return "sequence"
+        r = R()
+        self.assertEqual(i(r), "sequence")
+        class S:
+            pass
+        class T(S, c.Sized):
+            def __len__(self):
+                return 0
+        t = T()
+        self.assertEqual(h(t), "sized")
+        c.Container.register(T)
+        self.assertEqual(h(t), "sized")   # because it's explicitly in the MRO
+        class U:
+            def __len__(self):
+                return 0
+        u = U()
+        self.assertEqual(h(u), "sized")   # implicit Sized subclass inferred
+                                          # from the existence of __len__()
+        c.Container.register(U)
+        # There is no preference for registered versus inferred ABCs.
+        with self.assertRaises(RuntimeError) as re_three:
+            h(u)
+        self.assertIn(
+            str(re_three.exception),
+            (("Ambiguous dispatch: <class 'collections.abc.Container'> "
+              "or <class 'collections.abc.Sized'>"),
+             ("Ambiguous dispatch: <class 'collections.abc.Sized'> "
+              "or <class 'collections.abc.Container'>")),
+        )
+        class V(c.Sized, S):
+            def __len__(self):
+                return 0
+        @functools.singledispatch
+        def j(arg):
+            return "base"
+        @j.register(S)
+        def _(arg):
+            return "s"
+        @j.register(c.Container)
+        def _(arg):
+            return "container"
+        v = V()
+        self.assertEqual(j(v), "s")
+        c.Container.register(V)
+        self.assertEqual(j(v), "container")   # because it ends up right after
+                                              # Sized in the MRO
+
+    def test_cache_invalidation(self):
+        from collections import UserDict
+        class TracingDict(UserDict):
+            def __init__(self, *args, **kwargs):
+                super(TracingDict, self).__init__(*args, **kwargs)
+                self.set_ops = []
+                self.get_ops = []
+            def __getitem__(self, key):
+                result = self.data[key]
+                self.get_ops.append(key)
+                return result
+            def __setitem__(self, key, value):
+                self.set_ops.append(key)
+                self.data[key] = value
+            def clear(self):
+                self.data.clear()
+        _orig_wkd = functools.WeakKeyDictionary
+        td = TracingDict()
+        functools.WeakKeyDictionary = lambda: td
+        c = collections
+        @functools.singledispatch
+        def g(arg):
+            return "base"
+        d = {}
+        l = []
+        self.assertEqual(len(td), 0)
+        self.assertEqual(g(d), "base")
+        self.assertEqual(len(td), 1)
+        self.assertEqual(td.get_ops, [])
+        self.assertEqual(td.set_ops, [dict])
+        self.assertEqual(td.data[dict], g.registry[object])
+        self.assertEqual(g(l), "base")
+        self.assertEqual(len(td), 2)
+        self.assertEqual(td.get_ops, [])
+        self.assertEqual(td.set_ops, [dict, list])
+        self.assertEqual(td.data[dict], g.registry[object])
+        self.assertEqual(td.data[list], g.registry[object])
+        self.assertEqual(td.data[dict], td.data[list])
+        self.assertEqual(g(l), "base")
+        self.assertEqual(g(d), "base")
+        self.assertEqual(td.get_ops, [list, dict])
+        self.assertEqual(td.set_ops, [dict, list])
+        g.register(list, lambda arg: "list")
+        self.assertEqual(td.get_ops, [list, dict])
+        self.assertEqual(len(td), 0)
+        self.assertEqual(g(d), "base")
+        self.assertEqual(len(td), 1)
+        self.assertEqual(td.get_ops, [list, dict])
+        self.assertEqual(td.set_ops, [dict, list, dict])
+        self.assertEqual(td.data[dict],
+                         functools._find_impl(dict, g.registry))
+        self.assertEqual(g(l), "list")
+        self.assertEqual(len(td), 2)
+        self.assertEqual(td.get_ops, [list, dict])
+        self.assertEqual(td.set_ops, [dict, list, dict, list])
+        self.assertEqual(td.data[list],
+                         functools._find_impl(list, g.registry))
+        class X:
+            pass
+        c.MutableMapping.register(X)   # Will not invalidate the cache,
+                                       # not using ABCs yet.
+        self.assertEqual(g(d), "base")
+        self.assertEqual(g(l), "list")
+        self.assertEqual(td.get_ops, [list, dict, dict, list])
+        self.assertEqual(td.set_ops, [dict, list, dict, list])
+        g.register(c.Sized, lambda arg: "sized")
+        self.assertEqual(len(td), 0)
+        self.assertEqual(g(d), "sized")
+        self.assertEqual(len(td), 1)
+        self.assertEqual(td.get_ops, [list, dict, dict, list])
+        self.assertEqual(td.set_ops, [dict, list, dict, list, dict])
+        self.assertEqual(g(l), "list")
+        self.assertEqual(len(td), 2)
+        self.assertEqual(td.get_ops, [list, dict, dict, list])
+        self.assertEqual(td.set_ops, [dict, list, dict, list, dict, list])
+        self.assertEqual(g(l), "list")
+        self.assertEqual(g(d), "sized")
+        self.assertEqual(td.get_ops, [list, dict, dict, list, list, dict])
+        self.assertEqual(td.set_ops, [dict, list, dict, list, dict, list])
+        g.dispatch(list)
+        g.dispatch(dict)
+        self.assertEqual(td.get_ops, [list, dict, dict, list, list, dict,
+                                      list, dict])
+        self.assertEqual(td.set_ops, [dict, list, dict, list, dict, list])
+        c.MutableSet.register(X)       # Will invalidate the cache.
+        self.assertEqual(len(td), 2)   # Stale cache.
+        self.assertEqual(g(l), "list")
+        self.assertEqual(len(td), 1)
+        g.register(c.MutableMapping, lambda arg: "mutablemapping")
+        self.assertEqual(len(td), 0)
+        self.assertEqual(g(d), "mutablemapping")
+        self.assertEqual(len(td), 1)
+        self.assertEqual(g(l), "list")
+        self.assertEqual(len(td), 2)
+        g.register(dict, lambda arg: "dict")
+        self.assertEqual(g(d), "dict")
+        self.assertEqual(g(l), "list")
+        g._clear_cache()
+        self.assertEqual(len(td), 0)
+        functools.WeakKeyDictionary = _orig_wkd
+
 
 def test_main(verbose=None):
     test_classes = (
-        TestPartial,
-        TestPartialSubclass,
-        TestPythonPartial,
+        TestPartialC,
+        TestPartialPy,
+        TestPartialCSubclass,
+        TestPartialMethod,
         TestUpdateWrapper,
         TestTotalOrdering,
-        TestCmpToKey,
+        TestCmpToKeyC,
+        TestCmpToKeyPy,
         TestWraps,
         TestReduce,
         TestLRU,
+        TestSingleDispatch,
     )
     support.run_unittest(*test_classes)
 
diff --git a/Lib/test/test_future.py b/Lib/test/test_future.py
index a0c156f..beac993 100644
--- a/Lib/test/test_future.py
+++ b/Lib/test/test_future.py
@@ -82,6 +82,14 @@
         else:
             self.fail("expected exception didn't occur")
 
+    def test_badfuture10(self):
+        try:
+            from test import badsyntax_future10
+        except SyntaxError as msg:
+            self.assertEqual(get_error_location(msg), ("badsyntax_future10", '3'))
+        else:
+            self.fail("expected exception didn't occur")
+
     def test_parserhack(self):
         # test that the parser.c::future_hack function works as expected
         # Note: although this test must pass, it's not testing the original
diff --git a/Lib/test/test_gc.py b/Lib/test/test_gc.py
index c59b72e..c0be537 100644
--- a/Lib/test/test_gc.py
+++ b/Lib/test/test_gc.py
@@ -1,6 +1,8 @@
 import unittest
 from test.support import (verbose, refcount_test, run_unittest,
-                            strip_python_stderr)
+                            strip_python_stderr, cpython_only)
+from test.script_helper import assert_python_ok, make_script, temp_dir
+
 import sys
 import time
 import gc
@@ -11,6 +13,15 @@
 except ImportError:
     threading = None
 
+try:
+    from _testcapi import with_tp_del
+except ImportError:
+    def with_tp_del(cls):
+        class C(object):
+            def __new__(cls, *args, **kwargs):
+                raise TypeError('requires _testcapi.with_tp_del')
+        return C
+
 ### Support code
 ###############################################################################
 
@@ -38,6 +49,7 @@
         # gc collects it.
         self.wr = weakref.ref(C1055820(666), it_happened)
 
+@with_tp_del
 class Uncollectable(object):
     """Create a reference cycle with multiple __del__ methods.
 
@@ -50,7 +62,7 @@
             self.partner = Uncollectable(partner=self)
         else:
             self.partner = partner
-    def __del__(self):
+    def __tp_del__(self):
         pass
 
 ### Tests
@@ -139,11 +151,13 @@
         del a
         self.assertNotEqual(gc.collect(), 0)
 
-    def test_finalizer(self):
+    @cpython_only
+    def test_legacy_finalizer(self):
         # A() is uncollectable if it is part of a cycle, make sure it shows up
         # in gc.garbage.
+        @with_tp_del
         class A:
-            def __del__(self): pass
+            def __tp_del__(self): pass
         class B:
             pass
         a = A()
@@ -163,11 +177,13 @@
             self.fail("didn't find obj in garbage (finalizer)")
         gc.garbage.remove(obj)
 
-    def test_finalizer_newclass(self):
+    @cpython_only
+    def test_legacy_finalizer_newclass(self):
         # A() is uncollectable if it is part of a cycle, make sure it shows up
         # in gc.garbage.
+        @with_tp_del
         class A(object):
-            def __del__(self): pass
+            def __tp_del__(self): pass
         class B(object):
             pass
         a = A()
@@ -564,16 +580,51 @@
             # would be damaged, with an empty __dict__.
             self.assertEqual(x, None)
 
+    def test_bug21435(self):
+        # This is a poor test - its only virtue is that it happened to
+        # segfault on Tim's Windows box before the patch for 21435 was
+        # applied.  That's a nasty bug relying on specific pieces of cyclic
+        # trash appearing in exactly the right order in finalize_garbage()'s
+        # input list.
+        # But there's no reliable way to force that order from Python code,
+        # so over time chances are good this test won't really be testing much
+        # of anything anymore.  Still, if it blows up, there's _some_
+        # problem ;-)
+        gc.collect()
+
+        class A:
+            pass
+
+        class B:
+            def __init__(self, x):
+                self.x = x
+
+            def __del__(self):
+                self.attr = None
+
+        def do_work():
+            a = A()
+            b = B(A())
+
+            a.attr = b
+            b.attr = a
+
+        do_work()
+        gc.collect() # this blows up (bad C pointer) when it fails
+
+    @cpython_only
     def test_garbage_at_shutdown(self):
         import subprocess
         code = """if 1:
             import gc
+            import _testcapi
+            @_testcapi.with_tp_del
             class X:
                 def __init__(self, name):
                     self.name = name
                 def __repr__(self):
                     return "<X %%r>" %% self.name
-                def __del__(self):
+                def __tp_del__(self):
                     pass
 
             x = X('first')
@@ -610,6 +661,66 @@
         stderr = run_command(code % "gc.DEBUG_SAVEALL")
         self.assertNotIn(b"uncollectable objects at shutdown", stderr)
 
+    def test_gc_main_module_at_shutdown(self):
+        # Create a reference cycle through the __main__ module and check
+        # it gets collected at interpreter shutdown.
+        code = """if 1:
+            import weakref
+            class C:
+                def __del__(self):
+                    print('__del__ called')
+            l = [C()]
+            l.append(l)
+            """
+        rc, out, err = assert_python_ok('-c', code)
+        self.assertEqual(out.strip(), b'__del__ called')
+
+    def test_gc_ordinary_module_at_shutdown(self):
+        # Same as above, but with a non-__main__ module.
+        with temp_dir() as script_dir:
+            module = """if 1:
+                import weakref
+                class C:
+                    def __del__(self):
+                        print('__del__ called')
+                l = [C()]
+                l.append(l)
+                """
+            code = """if 1:
+                import sys
+                sys.path.insert(0, %r)
+                import gctest
+                """ % (script_dir,)
+            make_script(script_dir, 'gctest', module)
+            rc, out, err = assert_python_ok('-c', code)
+            self.assertEqual(out.strip(), b'__del__ called')
+
+    def test_get_stats(self):
+        stats = gc.get_stats()
+        self.assertEqual(len(stats), 3)
+        for st in stats:
+            self.assertIsInstance(st, dict)
+            self.assertEqual(set(st),
+                             {"collected", "collections", "uncollectable"})
+            self.assertGreaterEqual(st["collected"], 0)
+            self.assertGreaterEqual(st["collections"], 0)
+            self.assertGreaterEqual(st["uncollectable"], 0)
+        # Check that collection counts are incremented correctly
+        if gc.isenabled():
+            self.addCleanup(gc.enable)
+            gc.disable()
+        old = gc.get_stats()
+        gc.collect(0)
+        new = gc.get_stats()
+        self.assertEqual(new[0]["collections"], old[0]["collections"] + 1)
+        self.assertEqual(new[1]["collections"], old[1]["collections"])
+        self.assertEqual(new[2]["collections"], old[2]["collections"])
+        gc.collect(2)
+        new = gc.get_stats()
+        self.assertEqual(new[0]["collections"], old[0]["collections"] + 1)
+        self.assertEqual(new[1]["collections"], old[1]["collections"])
+        self.assertEqual(new[2]["collections"], old[2]["collections"] + 1)
+
 
 class GCCallbackTests(unittest.TestCase):
     def setUp(self):
@@ -696,6 +807,7 @@
             info = v[2]
             self.assertEqual(info["generation"], 2)
 
+    @cpython_only
     def test_collect_garbage(self):
         self.preclean()
         # Each of these cause four objects to be garbage: Two
diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py
index 846422b..2db9cd5 100644
--- a/Lib/test/test_gdb.py
+++ b/Lib/test/test_gdb.py
@@ -5,6 +5,7 @@
 
 import os
 import re
+import pprint
 import subprocess
 import sys
 import sysconfig
@@ -17,10 +18,11 @@
 except ImportError:
     _thread = None
 
+from test import support
 from test.support import run_unittest, findfile, python_is_optimized
 
 try:
-    gdb_version, _ = subprocess.Popen(["gdb", "--version"],
+    gdb_version, _ = subprocess.Popen(["gdb", "-nx", "--version"],
                                       stdout=subprocess.PIPE).communicate()
 except OSError:
     # This is what "no gdb" looks like.  There may, however, be other
@@ -40,6 +42,8 @@
 checkout_hook_path = os.path.join(os.path.dirname(sys.executable),
                                   'python-gdb.py')
 
+PYTHONHASHSEED = '123'
+
 def run_gdb(*args, **env_vars):
     """Runs gdb in --batch mode with the additional arguments given by *args.
 
@@ -50,7 +54,9 @@
         env.update(env_vars)
     else:
         env = None
-    base_cmd = ('gdb', '--batch')
+    # -nx: Do not execute commands from any .gdbinit initialization files
+    #      (issue #22188)
+    base_cmd = ('gdb', '--batch', '-nx')
     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,
@@ -117,6 +123,25 @@
         # Generate a list of commands in gdb's language:
         commands = ['set breakpoint pending yes',
                     'break %s' % breakpoint,
+
+                    # GDB as of 7.4 (?) onwards can distinguish between the
+                    # value of a variable at entry vs current value:
+                    #   http://sourceware.org/gdb/onlinedocs/gdb/Variables.html
+                    # which leads to the selftests failing with errors like this:
+                    #   AssertionError: 'v@entry=()' != '()'
+                    # Disable this:
+                    'set print entry-values no',
+
+                    # The tests assume that the first frame of printed
+                    #  backtrace will not contain program counter,
+                    #  that is however not guaranteed by gdb
+                    #  therefore we need to use 'set print address off' to
+                    #  make sure the counter is not there. For example:
+                    # #0 in PyObject_Print ...
+                    #  is assumed, but sometimes this can be e.g.
+                    # #0 0x00003fffb7dd1798 in PyObject_Print ...
+                    'set print address off',
+
                     'run']
         if cmds_after_breakpoint:
             commands += cmds_after_breakpoint
@@ -126,7 +151,7 @@
         # print commands
 
         # Use "commands" to generate the arguments with which to invoke "gdb":
-        args = ["gdb", "--batch"]
+        args = ["gdb", "--batch", "-nx"]
         args += ['--eval-command=%s' % cmd for cmd in commands]
         args += ["--args",
                  sys.executable]
@@ -144,7 +169,7 @@
         # print (' '.join(args))
 
         # Use "args" to invoke gdb, capturing stdout, stderr:
-        out, err = run_gdb(*args, PYTHONHASHSEED='0')
+        out, err = run_gdb(*args, PYTHONHASHSEED=PYTHONHASHSEED)
 
         errlines = err.splitlines()
         unexpected_errlines = []
@@ -165,6 +190,10 @@
             'linux-gate.so',
             'Do you need "set solib-search-path" or '
             '"set sysroot"?',
+            'warning: Source file is more recent than executable.',
+            # Issue #19753: missing symbols on System Z
+            'Missing separate debuginfo for ',
+            'Try: zypper install -C ',
             )
         for line in errlines:
             if not line.startswith(ignore_patterns):
@@ -248,9 +277,8 @@
     def test_dicts(self):
         'Verify the pretty-printing of dictionaries'
         self.assertGdbRepr({})
-        self.assertGdbRepr({'foo': 'bar'})
-        self.assertGdbRepr({'foo': 'bar', 'douglas': 42},
-                           "{'foo': 'bar', 'douglas': 42}")
+        self.assertGdbRepr({'foo': 'bar'}, "{'foo': 'bar'}")
+        self.assertGdbRepr({'foo': 'bar', 'douglas': 42}, "{'douglas': 42, 'foo': 'bar'}")
 
     def test_lists(self):
         'Verify the pretty-printing of lists'
@@ -305,26 +333,30 @@
 
     def test_tuples(self):
         'Verify the pretty-printing of tuples'
-        self.assertGdbRepr(tuple())
+        self.assertGdbRepr(tuple(), '()')
         self.assertGdbRepr((1,), '(1,)')
         self.assertGdbRepr(('foo', 'bar', 'baz'))
 
     def test_sets(self):
         'Verify the pretty-printing of sets'
-        self.assertGdbRepr(set())
+        if (gdb_major_version, gdb_minor_version) < (7, 3):
+            self.skipTest("pretty-printing of sets needs gdb 7.3 or later")
+        self.assertGdbRepr(set(), 'set()')
         self.assertGdbRepr(set(['a', 'b']), "{'a', 'b'}")
         self.assertGdbRepr(set([4, 5, 6]), "{4, 5, 6}")
 
         # Ensure that we handle sets containing the "dummy" key value,
         # which happens on deletion:
         gdb_repr, gdb_output = self.get_gdb_repr('''s = set(['a','b'])
-s.pop()
+s.remove('a')
 id(s)''')
         self.assertEqual(gdb_repr, "{'b'}")
 
     def test_frozensets(self):
         'Verify the pretty-printing of frozensets'
-        self.assertGdbRepr(frozenset())
+        if (gdb_major_version, gdb_minor_version) < (7, 3):
+            self.skipTest("pretty-printing of frozensets needs gdb 7.3 or later")
+        self.assertGdbRepr(frozenset(), 'frozenset()')
         self.assertGdbRepr(frozenset(['a', 'b']), "frozenset({'a', 'b'})")
         self.assertGdbRepr(frozenset([4, 5, 6]), "frozenset({4, 5, 6})")
 
@@ -841,6 +873,10 @@
                                     r".*\na = 1\nb = 2\nc = 3\n.*")
 
 def test_main():
+    if support.verbose:
+        print("GDB version:")
+        for line in os.fsdecode(gdb_version).splitlines():
+            print(" " * 4 + line)
     run_unittest(PrettyPrintTests,
                  PyListTests,
                  StackNavigationTests,
diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py
index 958054a..7825a77 100644
--- a/Lib/test/test_generators.py
+++ b/Lib/test/test_generators.py
@@ -1,3 +1,164 @@
+import gc
+import sys
+import unittest
+import weakref
+
+from test import support
+
+
+class FinalizationTest(unittest.TestCase):
+
+    def test_frame_resurrect(self):
+        # A generator frame can be resurrected by a generator's finalization.
+        def gen():
+            nonlocal frame
+            try:
+                yield
+            finally:
+                frame = sys._getframe()
+
+        g = gen()
+        wr = weakref.ref(g)
+        next(g)
+        del g
+        support.gc_collect()
+        self.assertIs(wr(), None)
+        self.assertTrue(frame)
+        del frame
+        support.gc_collect()
+
+    def test_refcycle(self):
+        # A generator caught in a refcycle gets finalized anyway.
+        old_garbage = gc.garbage[:]
+        finalized = False
+        def gen():
+            nonlocal finalized
+            try:
+                g = yield
+                yield 1
+            finally:
+                finalized = True
+
+        g = gen()
+        next(g)
+        g.send(g)
+        self.assertGreater(sys.getrefcount(g), 2)
+        self.assertFalse(finalized)
+        del g
+        support.gc_collect()
+        self.assertTrue(finalized)
+        self.assertEqual(gc.garbage, old_garbage)
+
+
+class ExceptionTest(unittest.TestCase):
+    # Tests for the issue #23353: check that the currently handled exception
+    # is correctly saved/restored in PyEval_EvalFrameEx().
+
+    def test_except_throw(self):
+        def store_raise_exc_generator():
+            try:
+                self.assertEqual(sys.exc_info()[0], None)
+                yield
+            except Exception as exc:
+                # exception raised by gen.throw(exc)
+                self.assertEqual(sys.exc_info()[0], ValueError)
+                self.assertIsNone(exc.__context__)
+                yield
+
+                # ensure that the exception is not lost
+                self.assertEqual(sys.exc_info()[0], ValueError)
+                yield
+
+                # we should be able to raise back the ValueError
+                raise
+
+        make = store_raise_exc_generator()
+        next(make)
+
+        try:
+            raise ValueError()
+        except Exception as exc:
+            try:
+                make.throw(exc)
+            except Exception:
+                pass
+
+        next(make)
+        with self.assertRaises(ValueError) as cm:
+            next(make)
+        self.assertIsNone(cm.exception.__context__)
+
+        self.assertEqual(sys.exc_info(), (None, None, None))
+
+    def test_except_next(self):
+        def gen():
+            self.assertEqual(sys.exc_info()[0], ValueError)
+            yield "done"
+
+        g = gen()
+        try:
+            raise ValueError
+        except Exception:
+            self.assertEqual(next(g), "done")
+        self.assertEqual(sys.exc_info(), (None, None, None))
+
+    def test_except_gen_except(self):
+        def gen():
+            try:
+                self.assertEqual(sys.exc_info()[0], None)
+                yield
+                # we are called from "except ValueError:", TypeError must
+                # inherit ValueError in its context
+                raise TypeError()
+            except TypeError as exc:
+                self.assertEqual(sys.exc_info()[0], TypeError)
+                self.assertEqual(type(exc.__context__), ValueError)
+            # here we are still called from the "except ValueError:"
+            self.assertEqual(sys.exc_info()[0], ValueError)
+            yield
+            self.assertIsNone(sys.exc_info()[0])
+            yield "done"
+
+        g = gen()
+        next(g)
+        try:
+            raise ValueError
+        except Exception:
+            next(g)
+
+        self.assertEqual(next(g), "done")
+        self.assertEqual(sys.exc_info(), (None, None, None))
+
+    def test_except_throw_exception_context(self):
+        def gen():
+            try:
+                try:
+                    self.assertEqual(sys.exc_info()[0], None)
+                    yield
+                except ValueError:
+                    # we are called from "except ValueError:"
+                    self.assertEqual(sys.exc_info()[0], ValueError)
+                    raise TypeError()
+            except Exception as exc:
+                self.assertEqual(sys.exc_info()[0], TypeError)
+                self.assertEqual(type(exc.__context__), ValueError)
+            # we are still called from "except ValueError:"
+            self.assertEqual(sys.exc_info()[0], ValueError)
+            yield
+            self.assertIsNone(sys.exc_info()[0])
+            yield "done"
+
+        g = gen()
+        next(g)
+        try:
+            raise ValueError
+        except Exception as exc:
+            g.throw(exc)
+
+        self.assertEqual(next(g), "done")
+        self.assertEqual(sys.exc_info(), (None, None, None))
+
+
 tutorial_tests = """
 Let's try a simple generator:
 
@@ -384,8 +545,8 @@
 >>> [s for s in dir(i) if not s.startswith('_')]
 ['close', 'gi_code', 'gi_frame', 'gi_running', 'send', 'throw']
 >>> from test.support import HAVE_DOCSTRINGS
->>> print(i.__next__.__doc__ if HAVE_DOCSTRINGS else 'x.__next__() <==> next(x)')
-x.__next__() <==> next(x)
+>>> print(i.__next__.__doc__ if HAVE_DOCSTRINGS else 'Implement next(self).')
+Implement next(self).
 >>> iter(i) is i
 True
 >>> import types
@@ -1729,9 +1890,7 @@
 >>> g = f()
 >>> next(g)
 >>> del g
->>> sys.stderr.getvalue().startswith(
-...     "Exception RuntimeError: 'generator ignored GeneratorExit' in "
-... )
+>>> "RuntimeError: generator ignored GeneratorExit" in sys.stderr.getvalue()
 True
 >>> sys.stderr = old
 
@@ -1841,22 +2000,23 @@
 ...     sys.stderr = io.StringIO()
 ...     class Leaker:
 ...         def __del__(self):
-...             raise RuntimeError
+...             def invoke(message):
+...                 raise RuntimeError(message)
+...             invoke("test")
 ...
 ...     l = Leaker()
 ...     del l
 ...     err = sys.stderr.getvalue().strip()
-...     err.startswith(
-...         "Exception RuntimeError: RuntimeError() in <"
-...     )
-...     err.endswith("> ignored")
-...     len(err.splitlines())
+...     "Exception ignored in" in err
+...     "RuntimeError: test" in err
+...     "Traceback" in err
+...     "in invoke" in err
 ... finally:
 ...     sys.stderr = old
 True
 True
-1
-
+True
+True
 
 
 These refleak tests should perhaps be in a testfile of their own,
@@ -1881,6 +2041,7 @@
 # so this works as expected in both ways of running regrtest.
 def test_main(verbose=None):
     from test import support, test_generators
+    support.run_unittest(__name__)
     support.run_doctest(test_generators, verbose)
 
 # This part isn't needed for regrtest, but for running the test directly.
diff --git a/Lib/test/test_genericpath.py b/Lib/test/test_genericpath.py
index b5068e4..e59ed4d 100644
--- a/Lib/test/test_genericpath.py
+++ b/Lib/test/test_genericpath.py
@@ -188,12 +188,93 @@
             support.unlink(support.TESTFN)
             safe_rmdir(support.TESTFN)
 
+    @staticmethod
+    def _create_file(filename):
+        with open(filename, 'wb') as f:
+            f.write(b'foo')
+
+    def test_samefile(self):
+        try:
+            test_fn = support.TESTFN + "1"
+            self._create_file(test_fn)
+            self.assertTrue(self.pathmodule.samefile(test_fn, test_fn))
+            self.assertRaises(TypeError, self.pathmodule.samefile)
+        finally:
+            os.remove(test_fn)
+
+    @support.skip_unless_symlink
+    def test_samefile_on_symlink(self):
+        self._test_samefile_on_link_func(os.symlink)
+
+    def test_samefile_on_link(self):
+        self._test_samefile_on_link_func(os.link)
+
+    def _test_samefile_on_link_func(self, func):
+        try:
+            test_fn1 = support.TESTFN + "1"
+            test_fn2 = support.TESTFN + "2"
+            self._create_file(test_fn1)
+
+            func(test_fn1, test_fn2)
+            self.assertTrue(self.pathmodule.samefile(test_fn1, test_fn2))
+            os.remove(test_fn2)
+
+            self._create_file(test_fn2)
+            self.assertFalse(self.pathmodule.samefile(test_fn1, test_fn2))
+        finally:
+            os.remove(test_fn1)
+            os.remove(test_fn2)
+
+    def test_samestat(self):
+        try:
+            test_fn = support.TESTFN + "1"
+            self._create_file(test_fn)
+            test_fns = [test_fn]*2
+            stats = map(os.stat, test_fns)
+            self.assertTrue(self.pathmodule.samestat(*stats))
+        finally:
+            os.remove(test_fn)
+
+    @support.skip_unless_symlink
+    def test_samestat_on_symlink(self):
+        self._test_samestat_on_link_func(os.symlink)
+
+    def test_samestat_on_link(self):
+        self._test_samestat_on_link_func(os.link)
+
+    def _test_samestat_on_link_func(self, func):
+        try:
+            test_fn1 = support.TESTFN + "1"
+            test_fn2 = support.TESTFN + "2"
+            self._create_file(test_fn1)
+            test_fns = (test_fn1, test_fn2)
+            func(*test_fns)
+            stats = map(os.stat, test_fns)
+            self.assertTrue(self.pathmodule.samestat(*stats))
+            os.remove(test_fn2)
+
+            self._create_file(test_fn2)
+            stats = map(os.stat, test_fns)
+            self.assertFalse(self.pathmodule.samestat(*stats))
+
+            self.assertRaises(TypeError, self.pathmodule.samestat)
+        finally:
+            os.remove(test_fn1)
+            os.remove(test_fn2)
+
+    def test_sameopenfile(self):
+        fname = support.TESTFN + "1"
+        with open(fname, "wb") as a, open(fname, "wb") as b:
+            self.assertTrue(self.pathmodule.sameopenfile(
+                                a.fileno(), b.fileno()))
+
 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).
 
@@ -348,7 +429,6 @@
         else:
             self.skipTest("need support.TESTFN_NONASCII")
 
-        # Test non-ASCII, non-UTF8 bytes in the path.
         with warnings.catch_warnings():
             warnings.simplefilter("ignore", DeprecationWarning)
             with support.temp_cwd(name):
diff --git a/Lib/test/test_genexps.py b/Lib/test/test_genexps.py
index 203b336..fb531d6 100644
--- a/Lib/test/test_genexps.py
+++ b/Lib/test/test_genexps.py
@@ -222,8 +222,8 @@
     True
 
     >>> from test.support import HAVE_DOCSTRINGS
-    >>> print(g.__next__.__doc__ if HAVE_DOCSTRINGS else 'x.__next__() <==> next(x)')
-    x.__next__() <==> next(x)
+    >>> print(g.__next__.__doc__ if HAVE_DOCSTRINGS else 'Implement next(self).')
+    Implement next(self).
     >>> import types
     >>> isinstance(g, types.GeneratorType)
     True
diff --git a/Lib/test/test_getargs2.py b/Lib/test/test_getargs2.py
index fe64ee1..1853a2d 100644
--- a/Lib/test/test_getargs2.py
+++ b/Lib/test/test_getargs2.py
@@ -3,38 +3,40 @@
 # Skip this test if the _testcapi module isn't available.
 support.import_module('_testcapi')
 from _testcapi import getargs_keywords, getargs_keyword_only
+try:
+    from _testcapi import getargs_L, getargs_K
+except ImportError:
+    getargs_L = None # PY_LONG_LONG not available
 
-"""
-> How about the following counterproposal. This also changes some of
-> the other format codes to be a little more regular.
->
-> Code C type Range check
->
-> b unsigned char 0..UCHAR_MAX
-> h signed short SHRT_MIN..SHRT_MAX
-> B unsigned char none **
-> H unsigned short none **
-> k * unsigned long none
-> I * unsigned int 0..UINT_MAX
-
-
-> i int INT_MIN..INT_MAX
-> l long LONG_MIN..LONG_MAX
-
-> K * unsigned long long none
-> L long long LLONG_MIN..LLONG_MAX
-
-> Notes:
->
-> * New format codes.
->
-> ** Changed from previous "range-and-a-half" to "none"; the
-> range-and-a-half checking wasn't particularly useful.
-
-Plus a C API or two, e.g. PyInt_AsLongMask() ->
-unsigned long and PyInt_AsLongLongMask() -> unsigned
-long long (if that exists).
-"""
+# > How about the following counterproposal. This also changes some of
+# > the other format codes to be a little more regular.
+# >
+# > Code C type Range check
+# >
+# > b unsigned char 0..UCHAR_MAX
+# > h signed short SHRT_MIN..SHRT_MAX
+# > B unsigned char none **
+# > H unsigned short none **
+# > k * unsigned long none
+# > I * unsigned int 0..UINT_MAX
+#
+#
+# > i int INT_MIN..INT_MAX
+# > l long LONG_MIN..LONG_MAX
+#
+# > K * unsigned long long none
+# > L long long LLONG_MIN..LLONG_MAX
+#
+# > Notes:
+# >
+# > * New format codes.
+# >
+# > ** Changed from previous "range-and-a-half" to "none"; the
+# > range-and-a-half checking wasn't particularly useful.
+#
+# Plus a C API or two, e.g. PyInt_AsLongMask() ->
+# unsigned long and PyInt_AsLongLongMask() -> unsigned
+# long long (if that exists).
 
 LARGE = 0x7FFFFFFF
 VERY_LARGE = 0xFF0000121212121212121242
@@ -77,7 +79,8 @@
         self.assertEqual(99, getargs_b(Int()))
         self.assertEqual(0, getargs_b(IntSubclass()))
         self.assertRaises(TypeError, getargs_b, BadInt())
-        self.assertEqual(1, getargs_b(BadInt2()))
+        with self.assertWarns(DeprecationWarning):
+            self.assertEqual(1, getargs_b(BadInt2()))
         self.assertEqual(0, getargs_b(BadInt3()))
 
         self.assertRaises(OverflowError, getargs_b, -1)
@@ -95,7 +98,8 @@
         self.assertEqual(99, getargs_B(Int()))
         self.assertEqual(0, getargs_B(IntSubclass()))
         self.assertRaises(TypeError, getargs_B, BadInt())
-        self.assertEqual(1, getargs_B(BadInt2()))
+        with self.assertWarns(DeprecationWarning):
+            self.assertEqual(1, getargs_B(BadInt2()))
         self.assertEqual(0, getargs_B(BadInt3()))
 
         self.assertEqual(UCHAR_MAX, getargs_B(-1))
@@ -113,7 +117,8 @@
         self.assertEqual(99, getargs_H(Int()))
         self.assertEqual(0, getargs_H(IntSubclass()))
         self.assertRaises(TypeError, getargs_H, BadInt())
-        self.assertEqual(1, getargs_H(BadInt2()))
+        with self.assertWarns(DeprecationWarning):
+            self.assertEqual(1, getargs_H(BadInt2()))
         self.assertEqual(0, getargs_H(BadInt3()))
 
         self.assertEqual(USHRT_MAX, getargs_H(-1))
@@ -132,7 +137,8 @@
         self.assertEqual(99, getargs_I(Int()))
         self.assertEqual(0, getargs_I(IntSubclass()))
         self.assertRaises(TypeError, getargs_I, BadInt())
-        self.assertEqual(1, getargs_I(BadInt2()))
+        with self.assertWarns(DeprecationWarning):
+            self.assertEqual(1, getargs_I(BadInt2()))
         self.assertEqual(0, getargs_I(BadInt3()))
 
         self.assertEqual(UINT_MAX, getargs_I(-1))
@@ -172,7 +178,8 @@
         self.assertEqual(99, getargs_h(Int()))
         self.assertEqual(0, getargs_h(IntSubclass()))
         self.assertRaises(TypeError, getargs_h, BadInt())
-        self.assertEqual(1, getargs_h(BadInt2()))
+        with self.assertWarns(DeprecationWarning):
+            self.assertEqual(1, getargs_h(BadInt2()))
         self.assertEqual(0, getargs_h(BadInt3()))
 
         self.assertRaises(OverflowError, getargs_h, SHRT_MIN-1)
@@ -190,7 +197,8 @@
         self.assertEqual(99, getargs_i(Int()))
         self.assertEqual(0, getargs_i(IntSubclass()))
         self.assertRaises(TypeError, getargs_i, BadInt())
-        self.assertEqual(1, getargs_i(BadInt2()))
+        with self.assertWarns(DeprecationWarning):
+            self.assertEqual(1, getargs_i(BadInt2()))
         self.assertEqual(0, getargs_i(BadInt3()))
 
         self.assertRaises(OverflowError, getargs_i, INT_MIN-1)
@@ -208,7 +216,8 @@
         self.assertEqual(99, getargs_l(Int()))
         self.assertEqual(0, getargs_l(IntSubclass()))
         self.assertRaises(TypeError, getargs_l, BadInt())
-        self.assertEqual(1, getargs_l(BadInt2()))
+        with self.assertWarns(DeprecationWarning):
+            self.assertEqual(1, getargs_l(BadInt2()))
         self.assertEqual(0, getargs_l(BadInt3()))
 
         self.assertRaises(OverflowError, getargs_l, LONG_MIN-1)
@@ -239,6 +248,7 @@
         self.assertRaises(OverflowError, getargs_n, VERY_LARGE)
 
 
+@unittest.skipIf(getargs_L is None, 'PY_LONG_LONG is not available')
 class LongLong_TestCase(unittest.TestCase):
     def test_L(self):
         from _testcapi import getargs_L
@@ -249,7 +259,8 @@
         self.assertEqual(99, getargs_L(Int()))
         self.assertEqual(0, getargs_L(IntSubclass()))
         self.assertRaises(TypeError, getargs_L, BadInt())
-        self.assertEqual(1, getargs_L(BadInt2()))
+        with self.assertWarns(DeprecationWarning):
+            self.assertEqual(1, getargs_L(BadInt2()))
         self.assertEqual(0, getargs_L(BadInt3()))
 
         self.assertRaises(OverflowError, getargs_L, LLONG_MIN-1)
@@ -600,24 +611,5 @@
         self.assertIsNone(getargs_Z_hash(None))
 
 
-def test_main():
-    tests = [
-        Signed_TestCase,
-        Unsigned_TestCase,
-        Boolean_TestCase,
-        Tuple_TestCase,
-        Keywords_TestCase,
-        KeywordOnly_TestCase,
-        Bytes_TestCase,
-        Unicode_TestCase,
-    ]
-    try:
-        from _testcapi import getargs_L, getargs_K
-    except ImportError:
-        pass # PY_LONG_LONG not available
-    else:
-        tests.append(LongLong_TestCase)
-    support.run_unittest(*tests)
-
 if __name__ == "__main__":
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_getpass.py b/Lib/test/test_getpass.py
index 1731bd4..3452e46 100644
--- a/Lib/test/test_getpass.py
+++ b/Lib/test/test_getpass.py
@@ -1,7 +1,7 @@
 import getpass
 import os
 import unittest
-from io import BytesIO, StringIO
+from io import BytesIO, StringIO, TextIOWrapper
 from unittest import mock
 from test import support
 
@@ -69,6 +69,14 @@
         getpass._raw_input(stream=StringIO())
         mock_input.readline.assert_called_once_with()
 
+    @mock.patch('sys.stdin')
+    def test_uses_stdin_as_different_locale(self, mock_input):
+        stream = TextIOWrapper(BytesIO(), encoding="ascii")
+        mock_input.readline.return_value = "Hasło: "
+        getpass._raw_input(prompt="Hasło: ",stream=stream)
+        mock_input.readline.assert_called_once_with()
+
+
     def test_raises_on_empty_input(self):
         input = StringIO('')
         self.assertRaises(EOFError, getpass._raw_input, input=input)
diff --git a/Lib/test/test_gettext.py b/Lib/test/test_gettext.py
index 5456948..abb312f 100644
--- a/Lib/test/test_gettext.py
+++ b/Lib/test/test_gettext.py
@@ -77,7 +77,7 @@
     def tearDown(self):
         self.env.__exit__()
         del self.env
-        shutil.rmtree(os.path.split(LOCALEDIR)[0])
+        support.rmtree(os.path.split(LOCALEDIR)[0])
 
 
 class GettextTestCase1(GettextBaseTest):
diff --git a/Lib/test/test_glob.py b/Lib/test/test_glob.py
index eb9aeb5..a5ab8d6 100644
--- a/Lib/test/test_glob.py
+++ b/Lib/test/test_glob.py
@@ -169,6 +169,28 @@
         eq(glob.glob('\\\\*\\*\\'), [])
         eq(glob.glob(b'\\\\*\\*\\'), [])
 
+    def check_escape(self, arg, expected):
+        self.assertEqual(glob.escape(arg), expected)
+        self.assertEqual(glob.escape(os.fsencode(arg)), os.fsencode(expected))
+
+    def test_escape(self):
+        check = self.check_escape
+        check('abc', 'abc')
+        check('[', '[[]')
+        check('?', '[?]')
+        check('*', '[*]')
+        check('[[_/*?*/_]]', '[[][[]_/[*][?][*]/_]]')
+        check('/[[_/*?*/_]]/', '/[[][[]_/[*][?][*]/_]]/')
+
+    @unittest.skipUnless(sys.platform == "win32", "Win32 specific test")
+    def test_escape_windows(self):
+        check = self.check_escape
+        check('?:?', '?:[?]')
+        check('*:*', '*:[*]')
+        check(r'\\?\c:\?', r'\\?\c:\[?]')
+        check(r'\\*\*\*', r'\\*\*\[*]')
+        check('//?/c:/?', '//?/c:/[?]')
+        check('//*/*/*', '//*/*/[*]')
 
 def test_main():
     run_unittest(GlobTests)
diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py
index 6b326bd..70d85b1 100644
--- a/Lib/test/test_grammar.py
+++ b/Lib/test/test_grammar.py
@@ -80,6 +80,12 @@
         x = .3e14
         x = 3.1e4
 
+    def test_float_exponent_tokenization(self):
+        # See issue 21642.
+        self.assertEqual(1 if 1else 0, 1)
+        self.assertEqual(1 if 0else 0, 0)
+        self.assertRaises(SyntaxError, eval, "0 if 1Else 0")
+
     def test_string_literals(self):
         x = ''; y = ""; self.assertTrue(len(x) == 0 and x == y)
         x = '\''; y = "'"; self.assertTrue(len(x) == 1 and x == y and ord(x) == 39)
@@ -314,6 +320,13 @@
         self.assertEqual(f.__annotations__,
                           {'b': 1, 'c': 2, 'e': 3, 'g': 6, 'h': 7, 'j': 9,
                            'k': 11, 'return': 12})
+        # Check for issue #20625 -- annotations mangling
+        class Spam:
+            def f(self, *, __kw:1):
+                pass
+        class Ham(Spam): pass
+        self.assertEqual(Spam.f.__annotations__, {'_Spam__kw': 1})
+        self.assertEqual(Ham.f.__annotations__, {'_Spam__kw': 1})
         # Check for SF Bug #1697248 - mixing decorators and a return annotation
         def null(x): return x
         @null
@@ -377,6 +390,31 @@
         check_syntax_error(self, "x + 1 = 1")
         check_syntax_error(self, "a + 1 = b + 2")
 
+    # Check the heuristic for print & exec covers significant cases
+    # As well as placing some limits on false positives
+    def test_former_statements_refer_to_builtins(self):
+        keywords = "print", "exec"
+        # Cases where we want the custom error
+        cases = [
+            "{} foo",
+            "{} {{1:foo}}",
+            "if 1: {} foo",
+            "if 1: {} {{1:foo}}",
+            "if 1:\n    {} foo",
+            "if 1:\n    {} {{1:foo}}",
+        ]
+        for keyword in keywords:
+            custom_msg = "call to '{}'".format(keyword)
+            for case in cases:
+                source = case.format(keyword)
+                with self.subTest(source=source):
+                    with self.assertRaisesRegex(SyntaxError, custom_msg):
+                        exec(source)
+                source = source.replace("foo", "(foo.)")
+                with self.subTest(source=source):
+                    with self.assertRaisesRegex(SyntaxError, "invalid syntax"):
+                        exec(source)
+
     def test_del_stmt(self):
         # 'del' exprlist
         abc = [1,2,3]
diff --git a/Lib/test/test_gzip.py b/Lib/test/test_gzip.py
index 034acb0..b7a7e03 100644
--- a/Lib/test/test_gzip.py
+++ b/Lib/test/test_gzip.py
@@ -130,6 +130,14 @@
                 if not ztxt: break
         self.assertEqual(contents, b'a'*201)
 
+    def test_exclusive_write(self):
+        with gzip.GzipFile(self.filename, 'xb') as f:
+            f.write(data1 * 50)
+        with gzip.GzipFile(self.filename, 'rb') as f:
+            self.assertEqual(f.read(), data1 * 50)
+        with self.assertRaises(FileExistsError):
+            gzip.GzipFile(self.filename, 'xb')
+
     def test_buffered_reader(self):
         # Issue #7471: a GzipFile can be wrapped in a BufferedReader for
         # performance.
@@ -205,6 +213,9 @@
         self.test_write()
         with gzip.GzipFile(self.filename, 'r') as f:
             self.assertEqual(f.myfileobj.mode, 'rb')
+        support.unlink(self.filename)
+        with gzip.GzipFile(self.filename, 'x') as f:
+            self.assertEqual(f.myfileobj.mode, 'xb')
 
     def test_1647484(self):
         for mode in ('wb', 'rb'):
@@ -388,6 +399,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)
+
     def test_read_with_extra(self):
         # Gzip data with an extra field
         gzdata = (b'\x1f\x8b\x08\x04\xb2\x17cQ\x02\xff'
@@ -406,35 +431,59 @@
 class TestOpen(BaseTest):
     def test_binary_modes(self):
         uncompressed = data1 * 50
+
         with gzip.open(self.filename, "wb") as f:
             f.write(uncompressed)
         with open(self.filename, "rb") as f:
             file_data = gzip.decompress(f.read())
             self.assertEqual(file_data, uncompressed)
+
         with gzip.open(self.filename, "rb") as f:
             self.assertEqual(f.read(), uncompressed)
+
         with gzip.open(self.filename, "ab") as f:
             f.write(uncompressed)
         with open(self.filename, "rb") as f:
             file_data = gzip.decompress(f.read())
             self.assertEqual(file_data, uncompressed * 2)
 
+        with self.assertRaises(FileExistsError):
+            gzip.open(self.filename, "xb")
+        support.unlink(self.filename)
+        with gzip.open(self.filename, "xb") as f:
+            f.write(uncompressed)
+        with open(self.filename, "rb") as f:
+            file_data = gzip.decompress(f.read())
+            self.assertEqual(file_data, uncompressed)
+
     def test_implicit_binary_modes(self):
         # Test implicit binary modes (no "b" or "t" in mode string).
         uncompressed = data1 * 50
+
         with gzip.open(self.filename, "w") as f:
             f.write(uncompressed)
         with open(self.filename, "rb") as f:
             file_data = gzip.decompress(f.read())
             self.assertEqual(file_data, uncompressed)
+
         with gzip.open(self.filename, "r") as f:
             self.assertEqual(f.read(), uncompressed)
+
         with gzip.open(self.filename, "a") as f:
             f.write(uncompressed)
         with open(self.filename, "rb") as f:
             file_data = gzip.decompress(f.read())
             self.assertEqual(file_data, uncompressed * 2)
 
+        with self.assertRaises(FileExistsError):
+            gzip.open(self.filename, "x")
+        support.unlink(self.filename)
+        with gzip.open(self.filename, "x") as f:
+            f.write(uncompressed)
+        with open(self.filename, "rb") as f:
+            file_data = gzip.decompress(f.read())
+            self.assertEqual(file_data, uncompressed)
+
     def test_text_modes(self):
         uncompressed = data1.decode("ascii") * 50
         uncompressed_raw = uncompressed.replace("\n", os.linesep)
@@ -469,6 +518,8 @@
         with self.assertRaises(ValueError):
             gzip.open(self.filename, "wbt")
         with self.assertRaises(ValueError):
+            gzip.open(self.filename, "xbt")
+        with self.assertRaises(ValueError):
             gzip.open(self.filename, "rb", encoding="utf-8")
         with self.assertRaises(ValueError):
             gzip.open(self.filename, "rb", errors="ignore")
diff --git a/Lib/test/test_hash.py b/Lib/test/test_hash.py
index 22ebbcc..f647c6f 100644
--- a/Lib/test/test_hash.py
+++ b/Lib/test/test_hash.py
@@ -12,6 +12,40 @@
 
 IS_64BIT = sys.maxsize > 2**32
 
+def lcg(x, length=16):
+    """Linear congruential generator"""
+    if x == 0:
+        return bytes(length)
+    out = bytearray(length)
+    for i in range(length):
+        x = (214013 * x + 2531011) & 0x7fffffff
+        out[i] = (x >> 16) & 0xff
+    return bytes(out)
+
+def pysiphash(uint64):
+    """Convert SipHash24 output to Py_hash_t
+    """
+    assert 0 <= uint64 < (1 << 64)
+    # simple unsigned to signed int64
+    if uint64 > (1 << 63) - 1:
+        int64 = uint64 - (1 << 64)
+    else:
+        int64 = uint64
+    # mangle uint64 to uint32
+    uint32 = (uint64 ^ uint64 >> 32) & 0xffffffff
+    # simple unsigned to signed int32
+    if uint32 > (1 << 31) - 1:
+        int32 = uint32 - (1 << 32)
+    else:
+        int32 = uint32
+    return int32, int64
+
+def skip_unless_internalhash(test):
+    """Skip decorator for tests that depend on SipHash24 or FNV"""
+    ok = sys.hash_info.algorithm in {"fnv", "siphash24"}
+    msg = "Requires SipHash24 or FNV"
+    return test if ok else unittest.skip(msg)(test)
+
 
 class HashEqualityTestCase(unittest.TestCase):
 
@@ -161,12 +195,64 @@
         self.assertNotEqual(run1, run2)
 
 class StringlikeHashRandomizationTests(HashRandomizationTests):
+    repr_ = None
+    repr_long = None
+
+    # 32bit little, 64bit little, 32bit big, 64bit big
+    known_hashes = {
+        'djba33x': [ # only used for small strings
+            # seed 0, 'abc'
+            [193485960, 193485960,  193485960, 193485960],
+            # seed 42, 'abc'
+            [-678966196, 573763426263223372, -820489388, -4282905804826039665],
+            ],
+        'siphash24': [
+            # NOTE: PyUCS2 layout depends on endianess
+            # seed 0, 'abc'
+            [1198583518, 4596069200710135518, 1198583518, 4596069200710135518],
+            # seed 42, 'abc'
+            [273876886, -4501618152524544106, 273876886, -4501618152524544106],
+            # seed 42, 'abcdefghijk'
+            [-1745215313, 4436719588892876975, -1745215313, 4436719588892876975],
+            # seed 0, 'äú∑ℇ'
+            [493570806, 5749986484189612790, -1006381564, -5915111450199468540],
+            # seed 42, 'äú∑ℇ'
+            [-1677110816, -2947981342227738144, -1860207793, -4296699217652516017],
+        ],
+        'fnv': [
+            # seed 0, 'abc'
+            [-1600925533, 1453079729188098211, -1600925533,
+             1453079729188098211],
+            # seed 42, 'abc'
+            [-206076799, -4410911502303878509, -1024014457,
+             -3570150969479994130],
+            # seed 42, 'abcdefghijk'
+            [811136751, -5046230049376118746, -77208053 ,
+             -4779029615281019666],
+            # seed 0, 'äú∑ℇ'
+            [44402817, 8998297579845987431, -1956240331,
+             -782697888614047887],
+            # seed 42, 'äú∑ℇ'
+            [-283066365, -4576729883824601543, -271871407,
+             -3927695501187247084],
+        ]
+    }
+
+    def get_expected_hash(self, position, length):
+        if length < sys.hash_info.cutoff:
+            algorithm = "djba33x"
+        else:
+            algorithm = sys.hash_info.algorithm
+        if sys.byteorder == 'little':
+            platform = 1 if IS_64BIT else 0
+        else:
+            assert(sys.byteorder == 'big')
+            platform = 3 if IS_64BIT else 2
+        return self.known_hashes[algorithm][position][platform]
+
     def test_null_hash(self):
         # PYTHONHASHSEED=0 disables the randomized hash
-        if IS_64BIT:
-            known_hash_of_obj = 1453079729188098211
-        else:
-            known_hash_of_obj = -1600925533
+        known_hash_of_obj = self.get_expected_hash(0, 3)
 
         # Randomization is enabled by default:
         self.assertNotEqual(self.get_hash(self.repr_), known_hash_of_obj)
@@ -174,39 +260,53 @@
         # It can also be disabled by setting the seed to 0:
         self.assertEqual(self.get_hash(self.repr_, seed=0), known_hash_of_obj)
 
+    @skip_unless_internalhash
     def test_fixed_hash(self):
         # test a fixed seed for the randomized hash
         # Note that all types share the same values:
-        if IS_64BIT:
-            if sys.byteorder == 'little':
-                h = -4410911502303878509
-            else:
-                h = -3570150969479994130
-        else:
-            if sys.byteorder == 'little':
-                h = -206076799
-            else:
-                h = -1024014457
+        h = self.get_expected_hash(1, 3)
         self.assertEqual(self.get_hash(self.repr_, seed=42), h)
 
+    @skip_unless_internalhash
+    def test_long_fixed_hash(self):
+        if self.repr_long is None:
+            return
+        h = self.get_expected_hash(2, 11)
+        self.assertEqual(self.get_hash(self.repr_long, seed=42), h)
+
+
 class StrHashRandomizationTests(StringlikeHashRandomizationTests,
                                 unittest.TestCase):
     repr_ = repr('abc')
+    repr_long = repr('abcdefghijk')
+    repr_ucs2 = repr('äú∑ℇ')
 
+    @skip_unless_internalhash
     def test_empty_string(self):
         self.assertEqual(hash(""), 0)
 
+    @skip_unless_internalhash
+    def test_ucs2_string(self):
+        h = self.get_expected_hash(3, 6)
+        self.assertEqual(self.get_hash(self.repr_ucs2, seed=0), h)
+        h = self.get_expected_hash(4, 6)
+        self.assertEqual(self.get_hash(self.repr_ucs2, seed=42), h)
+
 class BytesHashRandomizationTests(StringlikeHashRandomizationTests,
                                   unittest.TestCase):
     repr_ = repr(b'abc')
+    repr_long = repr(b'abcdefghijk')
 
+    @skip_unless_internalhash
     def test_empty_string(self):
         self.assertEqual(hash(b""), 0)
 
 class MemoryviewHashRandomizationTests(StringlikeHashRandomizationTests,
                                        unittest.TestCase):
     repr_ = "memoryview(b'abc')"
+    repr_long = "memoryview(b'abcdefghijk')"
 
+    @skip_unless_internalhash
     def test_empty_string(self):
         self.assertEqual(hash(memoryview(b"")), 0)
 
@@ -224,5 +324,23 @@
     repr_ = repr(datetime.time(0))
 
 
+class HashDistributionTestCase(unittest.TestCase):
+
+    def test_hash_distribution(self):
+        # check for hash collision
+        base = "abcdefghabcdefg"
+        for i in range(1, len(base)):
+            prefix = base[:i]
+            with self.subTest(prefix=prefix):
+                s15 = set()
+                s255 = set()
+                for c in range(256):
+                    h = hash(prefix + chr(c))
+                    s15.add(h & 0xf)
+                    s255.add(h & 0xff)
+                # SipHash24 distribution depends on key, usually > 60%
+                self.assertGreater(len(s15), 8, prefix)
+                self.assertGreater(len(s255), 128, prefix)
+
 if __name__ == "__main__":
     unittest.main()
diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py
index c0470d6..85ec2f9 100644
--- a/Lib/test/test_hashlib.py
+++ b/Lib/test/test_hashlib.py
@@ -18,11 +18,13 @@
 import unittest
 import warnings
 from test import support
-from test.support import _4G, bigmemtest
+from test.support import _4G, bigmemtest, import_fresh_module
 
 # Were we compiled --with-pydebug or with #define Py_DEBUG?
 COMPILED_WITH_PYDEBUG = hasattr(sys, 'gettotalrefcount')
 
+c_hashlib = import_fresh_module('hashlib', fresh=['_hashlib'])
+py_hashlib = import_fresh_module('hashlib', blocked=['_hashlib'])
 
 def hexstr(s):
     assert isinstance(s, bytes), repr(s)
@@ -36,7 +38,7 @@
 class HashLibTestCase(unittest.TestCase):
     supported_hash_names = ( 'md5', 'MD5', 'sha1', 'SHA1',
                              'sha224', 'SHA224', 'sha256', 'SHA256',
-                             'sha384', 'SHA384', 'sha512', 'SHA512' )
+                             'sha384', 'SHA384', 'sha512', 'SHA512')
 
     # Issue #14693: fallback modules are always compiled under POSIX
     _warn_on_extension_import = os.name == 'posix' or COMPILED_WITH_PYDEBUG
@@ -72,27 +74,31 @@
         if _hashlib:
             # These two algorithms should always be present when this module
             # is compiled.  If not, something was compiled wrong.
-            assert hasattr(_hashlib, 'openssl_md5')
-            assert hasattr(_hashlib, 'openssl_sha1')
+            self.assertTrue(hasattr(_hashlib, 'openssl_md5'))
+            self.assertTrue(hasattr(_hashlib, 'openssl_sha1'))
             for algorithm, constructors in self.constructors_to_test.items():
                 constructor = getattr(_hashlib, 'openssl_'+algorithm, None)
                 if constructor:
                     constructors.add(constructor)
 
+        def add_builtin_constructor(name):
+            constructor = getattr(hashlib, "__get_builtin_constructor")(name)
+            self.constructors_to_test[name].add(constructor)
+
         _md5 = self._conditional_import_module('_md5')
         if _md5:
-            self.constructors_to_test['md5'].add(_md5.md5)
+            add_builtin_constructor('md5')
         _sha1 = self._conditional_import_module('_sha1')
         if _sha1:
-            self.constructors_to_test['sha1'].add(_sha1.sha1)
+            add_builtin_constructor('sha1')
         _sha256 = self._conditional_import_module('_sha256')
         if _sha256:
-            self.constructors_to_test['sha224'].add(_sha256.sha224)
-            self.constructors_to_test['sha256'].add(_sha256.sha256)
+            add_builtin_constructor('sha224')
+            add_builtin_constructor('sha256')
         _sha512 = self._conditional_import_module('_sha512')
         if _sha512:
-            self.constructors_to_test['sha384'].add(_sha512.sha384)
-            self.constructors_to_test['sha512'].add(_sha512.sha512)
+            add_builtin_constructor('sha384')
+            add_builtin_constructor('sha512')
 
         super(HashLibTestCase, self).__init__(*args, **kwargs)
 
@@ -121,8 +127,10 @@
         self.assertRaises(TypeError, hashlib.new, 1)
 
     def test_get_builtin_constructor(self):
-        get_builtin_constructor = hashlib.__dict__[
-                '__get_builtin_constructor']
+        get_builtin_constructor = getattr(hashlib,
+                                          '__get_builtin_constructor')
+        builtin_constructor_cache = getattr(hashlib,
+                                            '__builtin_constructor_cache')
         self.assertRaises(ValueError, get_builtin_constructor, 'test')
         try:
             import _md5
@@ -130,6 +138,8 @@
             pass
         # This forces an ImportError for "import _md5" statements
         sys.modules['_md5'] = None
+        # clear the cache
+        builtin_constructor_cache.clear()
         try:
             self.assertRaises(ValueError, get_builtin_constructor, 'md5')
         finally:
@@ -138,13 +148,23 @@
             else:
                 del sys.modules['_md5']
         self.assertRaises(TypeError, get_builtin_constructor, 3)
+        constructor = get_builtin_constructor('md5')
+        self.assertIs(constructor, _md5.md5)
+        self.assertEqual(sorted(builtin_constructor_cache), ['MD5', 'md5'])
 
     def test_hexdigest(self):
         for cons in self.hash_constructors:
             h = cons()
-            assert isinstance(h.digest(), bytes), name
+            self.assertIsInstance(h.digest(), bytes)
             self.assertEqual(hexstr(h.digest()), h.hexdigest())
 
+    def test_name_attribute(self):
+        for cons in self.hash_constructors:
+            h = cons()
+            self.assertIsInstance(h.name, str)
+            self.assertIn(h.name, self.supported_hash_names)
+            self.assertEqual(h.name, hashlib.new(h.name).name)
+
     def test_large_update(self):
         aas = b'a' * 128
         bees = b'b' * 127
@@ -213,8 +233,9 @@
             self.assertEqual(m.block_size, block_size)
             self.assertEqual(m.digest_size, digest_size)
             self.assertEqual(len(m.digest()), digest_size)
-            self.assertEqual(m.name.lower(), name.lower())
-            self.assertIn(name.split("_")[0], repr(m).lower())
+            self.assertEqual(m.name, name)
+            # split for sha3_512 / _sha3.sha3 object
+            self.assertIn(name.split("_")[0], repr(m))
 
     def test_blocksize_name(self):
         self.check_blocksize_name('md5', 64, 16)
@@ -400,8 +421,8 @@
         events = []
         for threadnum in range(num_threads):
             chunk_size = len(data) // (10**threadnum)
-            assert chunk_size > 0
-            assert chunk_size % len(smallest_data) == 0
+            self.assertGreater(chunk_size, 0)
+            self.assertEqual(chunk_size % len(smallest_data), 0)
             event = threading.Event()
             events.append(event)
             threading.Thread(target=hash_in_chunks,
@@ -412,8 +433,95 @@
 
         self.assertEqual(expected_hash, hasher.hexdigest())
 
-def test_main():
-    support.run_unittest(HashLibTestCase)
+
+class KDFTests(unittest.TestCase):
+
+    pbkdf2_test_vectors = [
+        (b'password', b'salt', 1, None),
+        (b'password', b'salt', 2, None),
+        (b'password', b'salt', 4096, None),
+        # too slow, it takes over a minute on a fast CPU.
+        #(b'password', b'salt', 16777216, None),
+        (b'passwordPASSWORDpassword', b'saltSALTsaltSALTsaltSALTsaltSALTsalt',
+         4096, -1),
+        (b'pass\0word', b'sa\0lt', 4096, 16),
+    ]
+
+    pbkdf2_results = {
+        "sha1": [
+            # offical test vectors from RFC 6070
+            (bytes.fromhex('0c60c80f961f0e71f3a9b524af6012062fe037a6'), None),
+            (bytes.fromhex('ea6c014dc72d6f8ccd1ed92ace1d41f0d8de8957'), None),
+            (bytes.fromhex('4b007901b765489abead49d926f721d065a429c1'), None),
+            #(bytes.fromhex('eefe3d61cd4da4e4e9945b3d6ba2158c2634e984'), None),
+            (bytes.fromhex('3d2eec4fe41c849b80c8d83662c0e44a8b291a964c'
+                           'f2f07038'), 25),
+            (bytes.fromhex('56fa6aa75548099dcc37d7f03425e0c3'), None),],
+        "sha256": [
+            (bytes.fromhex('120fb6cffcf8b32c43e7225256c4f837'
+                           'a86548c92ccc35480805987cb70be17b'), None),
+            (bytes.fromhex('ae4d0c95af6b46d32d0adff928f06dd0'
+                           '2a303f8ef3c251dfd6e2d85a95474c43'), None),
+            (bytes.fromhex('c5e478d59288c841aa530db6845c4c8d'
+                           '962893a001ce4e11a4963873aa98134a'), None),
+            #(bytes.fromhex('cf81c66fe8cfc04d1f31ecb65dab4089'
+            #               'f7f179e89b3b0bcb17ad10e3ac6eba46'), None),
+            (bytes.fromhex('348c89dbcbd32b2f32d814b8116e84cf2b17'
+                           '347ebc1800181c4e2a1fb8dd53e1c635518c7dac47e9'), 40),
+            (bytes.fromhex('89b69d0516f829893c696226650a8687'), None),],
+        "sha512": [
+            (bytes.fromhex('867f70cf1ade02cff3752599a3a53dc4af34c7a669815ae5'
+                           'd513554e1c8cf252c02d470a285a0501bad999bfe943c08f'
+                           '050235d7d68b1da55e63f73b60a57fce'), None),
+            (bytes.fromhex('e1d9c16aa681708a45f5c7c4e215ceb66e011a2e9f004071'
+                           '3f18aefdb866d53cf76cab2868a39b9f7840edce4fef5a82'
+                           'be67335c77a6068e04112754f27ccf4e'), None),
+            (bytes.fromhex('d197b1b33db0143e018b12f3d1d1479e6cdebdcc97c5c0f8'
+                           '7f6902e072f457b5143f30602641b3d55cd335988cb36b84'
+                           '376060ecd532e039b742a239434af2d5'), None),
+            (bytes.fromhex('8c0511f4c6e597c6ac6315d8f0362e225f3c501495ba23b8'
+                           '68c005174dc4ee71115b59f9e60cd9532fa33e0f75aefe30'
+                           '225c583a186cd82bd4daea9724a3d3b8'), 64),
+            (bytes.fromhex('9d9e9c4cd21fe4be24d5b8244c759665'), None),],
+    }
+
+    def _test_pbkdf2_hmac(self, pbkdf2):
+        for digest_name, results in self.pbkdf2_results.items():
+            for i, vector in enumerate(self.pbkdf2_test_vectors):
+                password, salt, rounds, dklen = vector
+                expected, overwrite_dklen = results[i]
+                if overwrite_dklen:
+                    dklen = overwrite_dklen
+                out = pbkdf2(digest_name, password, salt, rounds, dklen)
+                self.assertEqual(out, expected,
+                                 (digest_name, password, salt, rounds, dklen))
+                out = pbkdf2(digest_name, memoryview(password),
+                             memoryview(salt), rounds, dklen)
+                out = pbkdf2(digest_name, bytearray(password),
+                             bytearray(salt), rounds, dklen)
+                self.assertEqual(out, expected)
+                if dklen is None:
+                    out = pbkdf2(digest_name, password, salt, rounds)
+                    self.assertEqual(out, expected,
+                                     (digest_name, password, salt, rounds))
+
+        self.assertRaises(TypeError, pbkdf2, b'sha1', b'pass', b'salt', 1)
+        self.assertRaises(TypeError, pbkdf2, 'sha1', 'pass', 'salt', 1)
+        self.assertRaises(ValueError, pbkdf2, 'sha1', b'pass', b'salt', 0)
+        self.assertRaises(ValueError, pbkdf2, 'sha1', b'pass', b'salt', -1)
+        self.assertRaises(ValueError, pbkdf2, 'sha1', b'pass', b'salt', 1, 0)
+        self.assertRaises(ValueError, pbkdf2, 'sha1', b'pass', b'salt', 1, -1)
+        with self.assertRaisesRegex(ValueError, 'unsupported hash type'):
+            pbkdf2('unknown', b'pass', b'salt', 1)
+
+    def test_pbkdf2_hmac_py(self):
+        self._test_pbkdf2_hmac(py_hashlib.pbkdf2_hmac)
+
+    @unittest.skipUnless(hasattr(c_hashlib, 'pbkdf2_hmac'),
+                     '   test requires OpenSSL > 1.0')
+    def test_pbkdf2_hmac_c(self):
+        self._test_pbkdf2_hmac(c_hashlib.pbkdf2_hmac)
+
 
 if __name__ == "__main__":
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_hmac.py b/Lib/test/test_hmac.py
index 4ca7cec..cde56fd 100644
--- a/Lib/test/test_hmac.py
+++ b/Lib/test/test_hmac.py
@@ -1,17 +1,39 @@
+import functools
 import hmac
 import hashlib
 import unittest
 import warnings
 from test import support
 
+
+def ignore_warning(func):
+    @functools.wraps(func)
+    def wrapper(*args, **kwargs):
+        with warnings.catch_warnings():
+            warnings.filterwarnings("ignore",
+                                    category=PendingDeprecationWarning)
+            return func(*args, **kwargs)
+    return wrapper
+
+
 class TestVectorsTestCase(unittest.TestCase):
 
     def test_md5_vectors(self):
         # Test the HMAC module against test vectors from the RFC.
 
         def md5test(key, data, digest):
-            h = hmac.HMAC(key, data)
+            h = hmac.HMAC(key, data, digestmod=hashlib.md5)
             self.assertEqual(h.hexdigest().upper(), digest.upper())
+            self.assertEqual(h.name, "hmac-md5")
+            self.assertEqual(h.digest_size, 16)
+            self.assertEqual(h.block_size, 64)
+
+            h = hmac.HMAC(key, data, digestmod='md5')
+            self.assertEqual(h.hexdigest().upper(), digest.upper())
+            self.assertEqual(h.name, "hmac-md5")
+            self.assertEqual(h.digest_size, 16)
+            self.assertEqual(h.block_size, 64)
+
 
         md5test(b"\x0b" * 16,
                 b"Hi There",
@@ -46,6 +68,16 @@
         def shatest(key, data, digest):
             h = hmac.HMAC(key, data, digestmod=hashlib.sha1)
             self.assertEqual(h.hexdigest().upper(), digest.upper())
+            self.assertEqual(h.name, "hmac-sha1")
+            self.assertEqual(h.digest_size, 20)
+            self.assertEqual(h.block_size, 64)
+
+            h = hmac.HMAC(key, data, digestmod='sha1')
+            self.assertEqual(h.hexdigest().upper(), digest.upper())
+            self.assertEqual(h.name, "hmac-sha1")
+            self.assertEqual(h.digest_size, 20)
+            self.assertEqual(h.block_size, 64)
+
 
         shatest(b"\x0b" * 20,
                 b"Hi There",
@@ -76,10 +108,21 @@
                  b"and Larger Than One Block-Size Data"),
                 "e8e99d0f45237d786d6bbaa7965c7808bbff1a91")
 
-    def _rfc4231_test_cases(self, hashfunc):
+    def _rfc4231_test_cases(self, hashfunc, hash_name, digest_size, block_size):
         def hmactest(key, data, hexdigests):
+            hmac_name = "hmac-" + hash_name
             h = hmac.HMAC(key, data, digestmod=hashfunc)
             self.assertEqual(h.hexdigest().lower(), hexdigests[hashfunc])
+            self.assertEqual(h.name, hmac_name)
+            self.assertEqual(h.digest_size, digest_size)
+            self.assertEqual(h.block_size, block_size)
+
+            h = hmac.HMAC(key, data, digestmod=hash_name)
+            self.assertEqual(h.hexdigest().lower(), hexdigests[hashfunc])
+            self.assertEqual(h.name, hmac_name)
+            self.assertEqual(h.digest_size, digest_size)
+            self.assertEqual(h.block_size, block_size)
+
 
         # 4.2.  Test Case 1
         hmactest(key = b'\x0b'*20,
@@ -189,16 +232,16 @@
                  })
 
     def test_sha224_rfc4231(self):
-        self._rfc4231_test_cases(hashlib.sha224)
+        self._rfc4231_test_cases(hashlib.sha224, 'sha224', 28, 64)
 
     def test_sha256_rfc4231(self):
-        self._rfc4231_test_cases(hashlib.sha256)
+        self._rfc4231_test_cases(hashlib.sha256, 'sha256', 32, 64)
 
     def test_sha384_rfc4231(self):
-        self._rfc4231_test_cases(hashlib.sha384)
+        self._rfc4231_test_cases(hashlib.sha384, 'sha384', 48, 128)
 
     def test_sha512_rfc4231(self):
-        self._rfc4231_test_cases(hashlib.sha512)
+        self._rfc4231_test_cases(hashlib.sha512, 'sha512', 64, 128)
 
     def test_legacy_block_size_warnings(self):
         class MockCrazyHash(object):
@@ -222,46 +265,74 @@
                 hmac.HMAC(b'a', b'b', digestmod=MockCrazyHash)
                 self.fail('Expected warning about small block_size')
 
+    def test_with_digestmod_warning(self):
+        with self.assertWarns(PendingDeprecationWarning):
+            key = b"\x0b" * 16
+            data = b"Hi There"
+            digest = "9294727A3638BB1C13F48EF8158BFC9D"
+            h = hmac.HMAC(key, data)
+            self.assertEqual(h.hexdigest().upper(), digest)
 
 
 class ConstructorTestCase(unittest.TestCase):
 
+    @ignore_warning
     def test_normal(self):
         # Standard constructor call.
         failed = 0
         try:
             h = hmac.HMAC(b"key")
-        except:
+        except Exception:
             self.fail("Standard constructor call raised exception.")
 
+    @ignore_warning
     def test_with_str_key(self):
         # Pass a key of type str, which is an error, because it expects a key
         # of type bytes
         with self.assertRaises(TypeError):
             h = hmac.HMAC("key")
 
+    @ignore_warning
     def test_dot_new_with_str_key(self):
         # Pass a key of type str, which is an error, because it expects a key
         # of type bytes
         with self.assertRaises(TypeError):
             h = hmac.new("key")
 
+    @ignore_warning
     def test_withtext(self):
         # Constructor call with text.
         try:
             h = hmac.HMAC(b"key", b"hash this!")
-        except:
+        except Exception:
             self.fail("Constructor call with text argument raised exception.")
+        self.assertEqual(h.hexdigest(), '34325b639da4cfd95735b381e28cb864')
+
+    def test_with_bytearray(self):
+        try:
+            h = hmac.HMAC(bytearray(b"key"), bytearray(b"hash this!"),
+                          digestmod="md5")
+        except Exception:
+            self.fail("Constructor call with bytearray arguments raised exception.")
+        self.assertEqual(h.hexdigest(), '34325b639da4cfd95735b381e28cb864')
+
+    def test_with_memoryview_msg(self):
+        try:
+            h = hmac.HMAC(b"key", memoryview(b"hash this!"), digestmod="md5")
+        except Exception:
+            self.fail("Constructor call with memoryview msg raised exception.")
+        self.assertEqual(h.hexdigest(), '34325b639da4cfd95735b381e28cb864')
 
     def test_withmodule(self):
         # Constructor call with text and digest module.
         try:
             h = hmac.HMAC(b"key", b"", hashlib.sha1)
-        except:
+        except Exception:
             self.fail("Constructor call with hashlib.sha1 raised exception.")
 
 class SanityTestCase(unittest.TestCase):
 
+    @ignore_warning
     def test_default_is_md5(self):
         # Testing if HMAC defaults to MD5 algorithm.
         # NOTE: this whitebox test depends on the hmac class internals
@@ -272,19 +343,19 @@
         # Exercising all methods once.
         # This must not raise any exceptions
         try:
-            h = hmac.HMAC(b"my secret key")
+            h = hmac.HMAC(b"my secret key", digestmod="md5")
             h.update(b"compute the hash of this text!")
             dig = h.digest()
             dig = h.hexdigest()
             h2 = h.copy()
-        except:
+        except Exception:
             self.fail("Exception raised during normal usage of HMAC class.")
 
 class CopyTestCase(unittest.TestCase):
 
     def test_attributes(self):
         # Testing if attributes are of same type.
-        h1 = hmac.HMAC(b"key")
+        h1 = hmac.HMAC(b"key", digestmod="md5")
         h2 = h1.copy()
         self.assertTrue(h1.digest_cons == h2.digest_cons,
             "digest constructors don't match.")
@@ -295,7 +366,7 @@
 
     def test_realcopy(self):
         # Testing if the copy method created a real copy.
-        h1 = hmac.HMAC(b"key")
+        h1 = hmac.HMAC(b"key", digestmod="md5")
         h2 = h1.copy()
         # Using id() in case somebody has overridden __eq__/__ne__.
         self.assertTrue(id(h1) != id(h2), "No real copy of the HMAC instance.")
@@ -306,7 +377,7 @@
 
     def test_equality(self):
         # Testing if the copy has the same digests.
-        h1 = hmac.HMAC(b"key")
+        h1 = hmac.HMAC(b"key", digestmod="md5")
         h1.update(b"some random text")
         h2 = h1.copy()
         self.assertEqual(h1.digest(), h2.digest(),
diff --git a/Lib/test/test_html.py b/Lib/test/test_html.py
index 30dac58..d6f0ae8 100644
--- a/Lib/test/test_html.py
+++ b/Lib/test/test_html.py
@@ -16,9 +16,89 @@
             html.escape('\'<script>"&foo;"</script>\'', False),
             '\'&lt;script&gt;"&amp;foo;"&lt;/script&gt;\'')
 
+    def test_unescape(self):
+        numeric_formats = ['&#%d', '&#%d;', '&#x%x', '&#x%x;']
+        errmsg = 'unescape(%r) should have returned %r'
+        def check(text, expected):
+            self.assertEqual(html.unescape(text), expected,
+                             msg=errmsg % (text, expected))
+        def check_num(num, expected):
+            for format in numeric_formats:
+                text = format % num
+                self.assertEqual(html.unescape(text), expected,
+                                 msg=errmsg % (text, expected))
+        # check text with no character references
+        check('no character references', 'no character references')
+        # check & followed by invalid chars
+        check('&\n&\t& &&', '&\n&\t& &&')
+        # check & followed by numbers and letters
+        check('&0 &9 &a &0; &9; &a;', '&0 &9 &a &0; &9; &a;')
+        # check incomplete entities at the end of the string
+        for x in ['&', '&#', '&#x', '&#X', '&#y', '&#xy', '&#Xy']:
+            check(x, x)
+            check(x+';', x+';')
+        # check several combinations of numeric character references,
+        # possibly followed by different characters
+        formats = ['&#%d', '&#%07d', '&#%d;', '&#%07d;',
+                   '&#x%x', '&#x%06x', '&#x%x;', '&#x%06x;',
+                   '&#x%X', '&#x%06X', '&#X%x;', '&#X%06x;']
+        for num, char in zip([65, 97, 34, 38, 0x2603, 0x101234],
+                             ['A', 'a', '"', '&', '\u2603', '\U00101234']):
+            for s in formats:
+                check(s % num, char)
+                for end in [' ', 'X']:
+                    check((s+end) % num, char+end)
+        # check invalid code points
+        for cp in [0xD800, 0xDB00, 0xDC00, 0xDFFF, 0x110000]:
+            check_num(cp, '\uFFFD')
+        # check more invalid code points
+        for cp in [0x1, 0xb, 0xe, 0x7f, 0xfffe, 0xffff, 0x10fffe, 0x10ffff]:
+            check_num(cp, '')
+        # check invalid numbers
+        for num, ch in zip([0x0d, 0x80, 0x95, 0x9d], '\r\u20ac\u2022\x9d'):
+            check_num(num, ch)
+        # check small numbers
+        check_num(0, '\uFFFD')
+        check_num(9, '\t')
+        # check a big number
+        check_num(1000000000000000000, '\uFFFD')
+        # check that multiple trailing semicolons are handled correctly
+        for e in ['&quot;;', '&#34;;', '&#x22;;', '&#X22;;']:
+            check(e, '";')
+        # check that semicolons in the middle don't create problems
+        for e in ['&quot;quot;', '&#34;quot;', '&#x22;quot;', '&#X22;quot;']:
+            check(e, '"quot;')
+        # check triple adjacent charrefs
+        for e in ['&quot', '&#34', '&#x22', '&#X22']:
+            check(e*3, '"""')
+            check((e+';')*3, '"""')
+        # check that the case is respected
+        for e in ['&amp', '&amp;', '&AMP', '&AMP;']:
+            check(e, '&')
+        for e in ['&Amp', '&Amp;']:
+            check(e, e)
+        # check that non-existent named entities are returned unchanged
+        check('&svadilfari;', '&svadilfari;')
+        # the following examples are in the html5 specs
+        check('&notit', '¬it')
+        check('&notit;', '¬it;')
+        check('&notin', '¬in')
+        check('&notin;', '∉')
+        # a similar example with a long name
+        check('&notReallyAnExistingNamedCharacterReference;',
+              '¬ReallyAnExistingNamedCharacterReference;')
+        # longest valid name
+        check('&CounterClockwiseContourIntegral;', '∳')
+        # check a charref that maps to two unicode chars
+        check('&acE;', '\u223E\u0333')
+        check('&acE', '&acE')
+        # see #12888
+        check('&#123; ' * 1050, '{ ' * 1050)
+        # see #15156
+        check('&Eacuteric&Eacute;ric&alphacentauri&alpha;centauri',
+              'ÉricÉric&alphacentauriαcentauri')
+        check('&co;', '&co;')
 
-def test_main():
-    run_unittest(HtmlTests)
 
 if __name__ == '__main__':
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_htmlparser.py b/Lib/test/test_htmlparser.py
index 11d9c9c..2d771a2 100644
--- a/Lib/test/test_htmlparser.py
+++ b/Lib/test/test_htmlparser.py
@@ -70,6 +70,18 @@
         self.append(("starttag_text", self.get_starttag_text()))
 
 
+class EventCollectorCharrefs(EventCollector):
+
+    def get_events(self):
+        return self.events
+
+    def handle_charref(self, data):
+        self.fail('This should never be called with convert_charrefs=True')
+
+    def handle_entityref(self, data):
+        self.fail('This should never be called with convert_charrefs=True')
+
+
 class TestCaseBase(unittest.TestCase):
 
     def get_collector(self):
@@ -84,26 +96,30 @@
         parser.close()
         events = parser.get_events()
         if events != expected_events:
-            self.fail("received events did not match expected events\n"
-                      "Expected:\n" + pprint.pformat(expected_events) +
+            self.fail("received events did not match expected events" +
+                      "\nSource:\n" + repr(source) +
+                      "\nExpected:\n" + pprint.pformat(expected_events) +
                       "\nReceived:\n" + pprint.pformat(events))
 
     def _run_check_extra(self, source, events):
-        self._run_check(source, events, EventCollectorExtra())
+        self._run_check(source, events,
+                        EventCollectorExtra(convert_charrefs=False))
 
     def _parse_error(self, source):
         def parse(source=source):
             parser = self.get_collector()
             parser.feed(source)
             parser.close()
-        self.assertRaises(html.parser.HTMLParseError, parse)
+        with self.assertRaises(html.parser.HTMLParseError):
+            with self.assertWarns(DeprecationWarning):
+                parse()
 
 
 class HTMLParserStrictTestCase(TestCaseBase):
 
     def get_collector(self):
         with support.check_warnings(("", DeprecationWarning), quite=False):
-            return EventCollector(strict=True)
+            return EventCollector(strict=True, convert_charrefs=False)
 
     def test_processing_instruction_only(self):
         self._run_check("<?processing instruction>", [
@@ -339,7 +355,7 @@
             self._run_check(s, [("starttag", element_lower, []),
                                 ("data", content),
                                 ("endtag", element_lower)],
-                            collector=Collector())
+                            collector=Collector(convert_charrefs=False))
 
     def test_comments(self):
         html = ("<!-- I'm a valid comment -->"
@@ -367,11 +383,60 @@
                     ('comment', '[if lte IE 7]>pretty?<![endif]')]
         self._run_check(html, expected)
 
+    def test_convert_charrefs(self):
+        collector = lambda: EventCollectorCharrefs(convert_charrefs=True)
+        self.assertTrue(collector().convert_charrefs)
+        charrefs = ['&quot;', '&#34;', '&#x22;', '&quot', '&#34', '&#x22']
+        # check charrefs in the middle of the text/attributes
+        expected = [('starttag', 'a', [('href', 'foo"zar')]),
+                    ('data', 'a"z'), ('endtag', 'a')]
+        for charref in charrefs:
+            self._run_check('<a href="foo{0}zar">a{0}z</a>'.format(charref),
+                            expected, collector=collector())
+        # check charrefs at the beginning/end of the text/attributes
+        expected = [('data', '"'),
+                    ('starttag', 'a', [('x', '"'), ('y', '"X'), ('z', 'X"')]),
+                    ('data', '"'), ('endtag', 'a'), ('data', '"')]
+        for charref in charrefs:
+            self._run_check('{0}<a x="{0}" y="{0}X" z="X{0}">'
+                            '{0}</a>{0}'.format(charref),
+                            expected, collector=collector())
+        # check charrefs in <script>/<style> elements
+        for charref in charrefs:
+            text = 'X'.join([charref]*3)
+            expected = [('data', '"'),
+                        ('starttag', 'script', []), ('data', text),
+                        ('endtag', 'script'), ('data', '"'),
+                        ('starttag', 'style', []), ('data', text),
+                        ('endtag', 'style'), ('data', '"')]
+            self._run_check('{1}<script>{0}</script>{1}'
+                            '<style>{0}</style>{1}'.format(text, charref),
+                            expected, collector=collector())
+        # check truncated charrefs at the end of the file
+        html = '&quo &# &#x'
+        for x in range(1, len(html)):
+            self._run_check(html[:x], [('data', html[:x])],
+                            collector=collector())
+        # check a string with no charrefs
+        self._run_check('no charrefs here', [('data', 'no charrefs here')],
+                        collector=collector())
+
 
 class HTMLParserTolerantTestCase(HTMLParserStrictTestCase):
 
     def get_collector(self):
-        return EventCollector(strict=False)
+        return EventCollector(convert_charrefs=False)
+
+    def test_deprecation_warnings(self):
+        with self.assertWarns(DeprecationWarning):
+            EventCollector()  # convert_charrefs not passed explicitly
+        with self.assertWarns(DeprecationWarning):
+            EventCollector(strict=True)
+        with self.assertWarns(DeprecationWarning):
+            EventCollector(strict=False)
+        with self.assertRaises(html.parser.HTMLParseError):
+            with self.assertWarns(DeprecationWarning):
+                EventCollector().error('test')
 
     def test_tolerant_parsing(self):
         self._run_check('<html <html>te>>xt&a<<bc</a></html>\n'
@@ -564,17 +629,12 @@
         for html, expected in data:
             self._run_check(html, expected)
 
-    def test_unescape_function(self):
+    def test_unescape_method(self):
+        from html import unescape
         p = self.get_collector()
-        self.assertEqual(p.unescape('&#bad;'),'&#bad;')
-        self.assertEqual(p.unescape('&#0038;'),'&')
-        # see #12888
-        self.assertEqual(p.unescape('&#123; ' * 1050), '{ ' * 1050)
-        # see #15156
-        self.assertEqual(p.unescape('&Eacuteric&Eacute;ric'
-                                    '&alphacentauri&alpha;centauri'),
-                                    'ÉricÉric&alphacentauriαcentauri')
-        self.assertEqual(p.unescape('&co;'), '&co;')
+        with self.assertWarns(DeprecationWarning):
+            s = '&quot;&#34;&#x22;&quot&#34&#x22&#bad;'
+            self.assertEqual(p.unescape(s), unescape(s))
 
     def test_broken_comments(self):
         html = ('<! not really a comment >'
@@ -630,7 +690,7 @@
 
     def get_collector(self):
         with support.check_warnings(("", DeprecationWarning), quite=False):
-            return EventCollector(strict=True)
+            return EventCollector(strict=True, convert_charrefs=False)
 
     def test_attr_syntax(self):
         output = [
@@ -691,7 +751,7 @@
 class AttributesTolerantTestCase(AttributesStrictTestCase):
 
     def get_collector(self):
-        return EventCollector(strict=False)
+        return EventCollector(convert_charrefs=False)
 
     def test_attr_funky_names2(self):
         self._run_check(
diff --git a/Lib/test/test_http_cookies.py b/Lib/test/test_http_cookies.py
index 76e5e9c..e984252 100644
--- a/Lib/test/test_http_cookies.py
+++ b/Lib/test/test_http_cookies.py
@@ -3,7 +3,7 @@
 from test.support import run_unittest, run_doctest, check_warnings
 import unittest
 from http import cookies
-
+import pickle
 import warnings
 
 class CookieTests(unittest.TestCase):
@@ -114,7 +114,7 @@
         C['Customer']['secure'] = True
         C['Customer']['httponly'] = True
         self.assertEqual(C.output(),
-            'Set-Cookie: Customer="WILE_E_COYOTE"; httponly; secure')
+            'Set-Cookie: Customer="WILE_E_COYOTE"; HttpOnly; Secure')
 
     def test_secure_httponly_false_if_not_present(self):
         C = cookies.SimpleCookie()
@@ -152,7 +152,7 @@
         C = cookies.SimpleCookie()
         C.load('eggs  =  scrambled  ;  secure  ;  path  =  bar   ; foo=foo   ')
         self.assertEqual(C.output(),
-            'Set-Cookie: eggs=scrambled; Path=bar; secure\r\nSet-Cookie: foo=foo')
+            'Set-Cookie: eggs=scrambled; Path=bar; Secure\r\nSet-Cookie: foo=foo')
 
     def test_quoted_meta(self):
         # Try cookie with quoted meta-data
@@ -187,6 +187,19 @@
             self.assertEqual(dict(C), {})
             self.assertEqual(C.output(), '')
 
+    def test_pickle(self):
+        rawdata = 'Customer="WILE_E_COYOTE"; Path=/acme; Version=1'
+        expected_output = 'Set-Cookie: %s' % rawdata
+
+        C = cookies.SimpleCookie()
+        C.load(rawdata)
+        self.assertEqual(C.output(), expected_output)
+
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            with self.subTest(proto=proto):
+                C1 = pickle.loads(pickle.dumps(C, protocol=proto))
+                self.assertEqual(C1.output(), expected_output)
+
 
 class MorselTests(unittest.TestCase):
     """Tests for the Morsel object."""
diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py
index c8ded92..3fc3466 100644
--- a/Lib/test/test_httplib.py
+++ b/Lib/test/test_httplib.py
@@ -15,26 +15,40 @@
 CERT_localhost = os.path.join(here, 'keycert.pem')
 # Self-signed cert file for 'fakehostname'
 CERT_fakehostname = os.path.join(here, 'keycert2.pem')
-# Root cert file (CA) for svn.python.org's cert
-CACERT_svn_python_org = os.path.join(here, 'https_svn_python_org_root.pem')
+# Self-signed cert file for self-signed.pythontest.net
+CERT_selfsigned_pythontestdotnet = os.path.join(here, 'selfsigned_pythontestdotnet.pem')
 
 HOST = support.HOST
 
 class FakeSocket:
-    def __init__(self, text, fileclass=io.BytesIO):
+    def __init__(self, text, fileclass=io.BytesIO, host=None, port=None):
         if isinstance(text, str):
             text = text.encode("ascii")
         self.text = text
         self.fileclass = fileclass
         self.data = b''
+        self.sendall_calls = 0
+        self.file_closed = False
+        self.host = host
+        self.port = port
 
     def sendall(self, data):
+        self.sendall_calls += 1
         self.data += data
 
     def makefile(self, mode, bufsize=None):
         if mode != 'r' and mode != 'rb':
             raise client.UnimplementedFileMode()
-        return self.fileclass(self.text)
+        # keep the file around so we can check how much was read from it
+        self.file = self.fileclass(self.text)
+        self.file.close = self.file_close #nerf close ()
+        return self.file
+
+    def file_close(self):
+        self.file_closed = True
+
+    def close(self):
+        pass
 
 class EPipeSocket(FakeSocket):
 
@@ -45,7 +59,7 @@
 
     def sendall(self, data):
         if self.pipe_trigger in data:
-            raise socket.error(errno.EPIPE, "gotcha")
+            raise OSError(errno.EPIPE, "gotcha")
         self.data += data
 
     def close(self):
@@ -153,6 +167,16 @@
         conn.request('GET', '/foo')
         self.assertTrue(sock.data.startswith(expected))
 
+    def test_malformed_headers_coped_with(self):
+        # Issue 19996
+        body = "HTTP/1.1 200 OK\r\nFirst: val\r\n: nval\r\nSecond: val\r\n\r\n"
+        sock = FakeSocket(body)
+        resp = client.HTTPResponse(sock)
+        resp.begin()
+
+        self.assertEqual(resp.getheader('First'), 'val')
+        self.assertEqual(resp.getheader('Second'), 'val')
+
 
 class BasicTest(TestCase):
     def test_status_lines(self):
@@ -600,7 +624,7 @@
             b"Content-Length")
         conn = client.HTTPConnection("example.com")
         conn.sock = sock
-        self.assertRaises(socket.error,
+        self.assertRaises(OSError,
                           lambda: conn.request("PUT", "/url", "body"))
         resp = conn.getresponse()
         self.assertEqual(401, resp.status)
@@ -646,6 +670,44 @@
         resp.close()
         self.assertTrue(resp.closed)
 
+    def test_delayed_ack_opt(self):
+        # Test that Nagle/delayed_ack optimistaion works correctly.
+
+        # For small payloads, it should coalesce the body with
+        # headers, resulting in a single sendall() call
+        conn = client.HTTPConnection('example.com')
+        sock = FakeSocket(None)
+        conn.sock = sock
+        body = b'x' * (conn.mss - 1)
+        conn.request('POST', '/', body)
+        self.assertEqual(sock.sendall_calls, 1)
+
+        # For large payloads, it should send the headers and
+        # then the body, resulting in more than one sendall()
+        # call
+        conn = client.HTTPConnection('example.com')
+        sock = FakeSocket(None)
+        conn.sock = sock
+        body = b'x' * conn.mss
+        conn.request('POST', '/', body)
+        self.assertGreater(sock.sendall_calls, 1)
+
+    def test_error_leak(self):
+        # Test that the socket is not leaked if getresponse() fails
+        conn = client.HTTPConnection('example.com')
+        response = None
+        class Response(client.HTTPResponse):
+            def __init__(self, *pos, **kw):
+                nonlocal response
+                response = self  # Avoid garbage collector closing the socket
+                client.HTTPResponse.__init__(self, *pos, **kw)
+        conn.response_class = Response
+        conn.sock = FakeSocket('')  # Emulate server dropping connection
+        conn.request('GET', '/')
+        self.assertRaises(client.BadStatusLine, conn.getresponse)
+        self.assertTrue(response.closed)
+        self.assertTrue(conn.sock.file_closed)
+
 class OfflineTest(TestCase):
     def test_responses(self):
         self.assertEqual(client.responses[client.NOT_FOUND], "Not Found")
@@ -736,51 +798,81 @@
 
     def make_server(self, certfile):
         from test.ssl_servers import make_https_server
-        return make_https_server(self, certfile)
+        return make_https_server(self, certfile=certfile)
 
     def test_attributes(self):
         # simple test to check it's storing the timeout
         h = client.HTTPSConnection(HOST, TimeoutTest.PORT, timeout=30)
         self.assertEqual(h.timeout, 30)
 
-    def _check_svn_python_org(self, resp):
-        # Just a simple check that everything went fine
-        server_string = resp.getheader('server')
-        self.assertIn('Apache', server_string)
-
     def test_networked(self):
-        # Default settings: no cert verification is done
-        support.requires('network')
-        with support.transient_internet('svn.python.org'):
-            h = client.HTTPSConnection('svn.python.org', 443)
-            h.request('GET', '/')
-            resp = h.getresponse()
-            self._check_svn_python_org(resp)
-
-    def test_networked_good_cert(self):
-        # We feed a CA cert that validates the server's cert
+        # Default settings: requires a valid cert from a trusted CA
         import ssl
         support.requires('network')
-        with support.transient_internet('svn.python.org'):
-            context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-            context.verify_mode = ssl.CERT_REQUIRED
-            context.load_verify_locations(CACERT_svn_python_org)
-            h = client.HTTPSConnection('svn.python.org', 443, context=context)
+        with support.transient_internet('self-signed.pythontest.net'):
+            h = client.HTTPSConnection('self-signed.pythontest.net', 443)
+            with self.assertRaises(ssl.SSLError) as exc_info:
+                h.request('GET', '/')
+            self.assertEqual(exc_info.exception.reason, 'CERTIFICATE_VERIFY_FAILED')
+
+    def test_networked_noverification(self):
+        # Switch off cert verification
+        import ssl
+        support.requires('network')
+        with support.transient_internet('self-signed.pythontest.net'):
+            context = ssl._create_unverified_context()
+            h = client.HTTPSConnection('self-signed.pythontest.net', 443,
+                                       context=context)
             h.request('GET', '/')
             resp = h.getresponse()
-            self._check_svn_python_org(resp)
+            self.assertIn('nginx', resp.getheader('server'))
+
+    @support.system_must_validate_cert
+    def test_networked_trusted_by_default_cert(self):
+        # Default settings: requires a valid cert from a trusted CA
+        support.requires('network')
+        with support.transient_internet('www.python.org'):
+            h = client.HTTPSConnection('www.python.org', 443)
+            h.request('GET', '/')
+            resp = h.getresponse()
+            content_type = resp.getheader('content-type')
+            self.assertIn('text/html', content_type)
+
+    def test_networked_good_cert(self):
+        # We feed the server's cert as a validating cert
+        import ssl
+        support.requires('network')
+        with support.transient_internet('self-signed.pythontest.net'):
+            context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+            context.verify_mode = ssl.CERT_REQUIRED
+            context.load_verify_locations(CERT_selfsigned_pythontestdotnet)
+            h = client.HTTPSConnection('self-signed.pythontest.net', 443, context=context)
+            h.request('GET', '/')
+            resp = h.getresponse()
+            server_string = resp.getheader('server')
+            self.assertIn('nginx', server_string)
 
     def test_networked_bad_cert(self):
         # We feed a "CA" cert that is unrelated to the server's cert
         import ssl
         support.requires('network')
-        with support.transient_internet('svn.python.org'):
+        with support.transient_internet('self-signed.pythontest.net'):
             context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
             context.verify_mode = ssl.CERT_REQUIRED
             context.load_verify_locations(CERT_localhost)
-            h = client.HTTPSConnection('svn.python.org', 443, context=context)
-            with self.assertRaises(ssl.SSLError):
+            h = client.HTTPSConnection('self-signed.pythontest.net', 443, context=context)
+            with self.assertRaises(ssl.SSLError) as exc_info:
                 h.request('GET', '/')
+            self.assertEqual(exc_info.exception.reason, 'CERTIFICATE_VERIFY_FAILED')
+
+    def test_local_unknown_cert(self):
+        # The custom cert isn't known to the default trust bundle
+        import ssl
+        server = self.make_server(CERT_localhost)
+        h = client.HTTPSConnection('localhost', server.port)
+        with self.assertRaises(ssl.SSLError) as exc_info:
+            h.request('GET', '/')
+        self.assertEqual(exc_info.exception.reason, 'CERTIFICATE_VERIFY_FAILED')
 
     def test_local_good_hostname(self):
         # The (valid) cert validates the HTTP hostname
@@ -793,7 +885,6 @@
         h.request('GET', '/nonexistent')
         resp = h.getresponse()
         self.assertEqual(resp.status, 404)
-        del server
 
     def test_local_bad_hostname(self):
         # The (valid) cert doesn't validate the HTTP hostname
@@ -801,6 +892,7 @@
         server = self.make_server(CERT_fakehostname)
         context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
         context.verify_mode = ssl.CERT_REQUIRED
+        context.check_hostname = True
         context.load_verify_locations(CERT_fakehostname)
         h = client.HTTPSConnection('localhost', server.port, context=context)
         with self.assertRaises(ssl.CertificateError):
@@ -811,12 +903,24 @@
         with self.assertRaises(ssl.CertificateError):
             h.request('GET', '/')
         # With check_hostname=False, the mismatching is ignored
+        context.check_hostname = False
         h = client.HTTPSConnection('localhost', server.port, context=context,
                                    check_hostname=False)
         h.request('GET', '/nonexistent')
         resp = h.getresponse()
         self.assertEqual(resp.status, 404)
-        del server
+        # The context's check_hostname setting is used if one isn't passed to
+        # HTTPSConnection.
+        context.check_hostname = False
+        h = client.HTTPSConnection('localhost', server.port, context=context)
+        h.request('GET', '/nonexistent')
+        self.assertEqual(h.getresponse().status, 404)
+        # Passing check_hostname to HTTPSConnection should override the
+        # context's setting.
+        h = client.HTTPSConnection('localhost', server.port, context=context,
+                                   check_hostname=True)
+        with self.assertRaises(ssl.CertificateError):
+            h.request('GET', '/')
 
     @unittest.skipIf(not hasattr(client, 'HTTPSConnection'),
                      'http.client.HTTPSConnection not available')
@@ -946,10 +1050,71 @@
         header = self.resp.getheader('No-Such-Header',default=42)
         self.assertEqual(header, 42)
 
+class TunnelTests(TestCase):
+    def setUp(self):
+        response_text = (
+            'HTTP/1.0 200 OK\r\n\r\n' # Reply to CONNECT
+            'HTTP/1.1 200 OK\r\n' # Reply to HEAD
+            'Content-Length: 42\r\n\r\n'
+        )
+
+        def create_connection(address, timeout=None, source_address=None):
+            return FakeSocket(response_text, host=address[0], port=address[1])
+
+        self.host = 'proxy.com'
+        self.conn = client.HTTPConnection(self.host)
+        self.conn._create_connection = create_connection
+
+    def tearDown(self):
+        self.conn.close()
+
+    def test_set_tunnel_host_port_headers(self):
+        tunnel_host = 'destination.com'
+        tunnel_port = 8888
+        tunnel_headers = {'User-Agent': 'Mozilla/5.0 (compatible, MSIE 11)'}
+        self.conn.set_tunnel(tunnel_host, port=tunnel_port,
+                             headers=tunnel_headers)
+        self.conn.request('HEAD', '/', '')
+        self.assertEqual(self.conn.sock.host, self.host)
+        self.assertEqual(self.conn.sock.port, client.HTTP_PORT)
+        self.assertEqual(self.conn._tunnel_host, tunnel_host)
+        self.assertEqual(self.conn._tunnel_port, tunnel_port)
+        self.assertEqual(self.conn._tunnel_headers, tunnel_headers)
+
+    def test_disallow_set_tunnel_after_connect(self):
+        # Once connected, we shouldn't be able to tunnel anymore
+        self.conn.connect()
+        self.assertRaises(RuntimeError, self.conn.set_tunnel,
+                          'destination.com')
+
+    def test_connect_with_tunnel(self):
+        self.conn.set_tunnel('destination.com')
+        self.conn.request('HEAD', '/', '')
+        self.assertEqual(self.conn.sock.host, self.host)
+        self.assertEqual(self.conn.sock.port, client.HTTP_PORT)
+        self.assertIn(b'CONNECT destination.com', self.conn.sock.data)
+        # issue22095
+        self.assertNotIn(b'Host: destination.com:None', self.conn.sock.data)
+        self.assertIn(b'Host: destination.com', self.conn.sock.data)
+
+        # This test should be removed when CONNECT gets the HTTP/1.1 blessing
+        self.assertNotIn(b'Host: proxy.com', self.conn.sock.data)
+
+    def test_connect_put_request(self):
+        self.conn.set_tunnel('destination.com')
+        self.conn.request('PUT', '/', '')
+        self.assertEqual(self.conn.sock.host, self.host)
+        self.assertEqual(self.conn.sock.port, client.HTTP_PORT)
+        self.assertIn(b'CONNECT destination.com', self.conn.sock.data)
+        self.assertIn(b'Host: destination.com', self.conn.sock.data)
+
+
+
+@support.reap_threads
 def test_main(verbose=None):
     support.run_unittest(HeaderTests, OfflineTest, BasicTest, TimeoutTest,
                          HTTPSTest, RequestBodyTest, SourceAddressTest,
-                         HTTPResponseTest)
+                         HTTPResponseTest, TunnelTests)
 
 if __name__ == '__main__':
     test_main()
diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py
index be5d8de..569341d 100644
--- a/Lib/test/test_httpservers.py
+++ b/Lib/test/test_httpservers.py
@@ -14,6 +14,7 @@
 import base64
 import shutil
 import urllib.parse
+import html
 import http.client
 import tempfile
 from io import BytesIO
@@ -92,6 +93,13 @@
         def do_KEYERROR(self):
             self.send_error(999)
 
+        def do_NOTFOUND(self):
+            self.send_error(404)
+
+        def do_EXPLAINERROR(self):
+            self.send_error(999, "Short Message",
+                            "This is a long \n explaination")
+
         def do_CUSTOM(self):
             self.send_response(999)
             self.send_header('Content-Type', 'text/html')
@@ -118,7 +126,7 @@
 
     def test_request_line_trimming(self):
         self.con._http_vsn_str = 'HTTP/1.1\n'
-        self.con.putrequest('GET', '/')
+        self.con.putrequest('XYZBOGUS', '/')
         self.con.endheaders()
         res = self.con.getresponse()
         self.assertEqual(res.status, 501)
@@ -145,8 +153,9 @@
         self.assertEqual(res.status, 501)
 
     def test_version_none(self):
+        # Test that a valid method is rejected when not HTTP/1.x
         self.con._http_vsn_str = ''
-        self.con.putrequest('PUT', '/')
+        self.con.putrequest('CUSTOM', '/')
         self.con.endheaders()
         res = self.con.getresponse()
         self.assertEqual(res.status, 400)
@@ -203,6 +212,12 @@
         res = self.con.getresponse()
         self.assertEqual(res.status, 999)
 
+    def test_return_explain_error(self):
+        self.con.request('EXPLAINERROR', '/')
+        res = self.con.getresponse()
+        self.assertEqual(res.status, 999)
+        self.assertTrue(int(res.getheader('Content-Length')))
+
     def test_latin1_header(self):
         self.con.request('LATINONEHEADER', '/', headers={
             'X-Special-Incoming':       'Ärger mit Unicode'
@@ -211,6 +226,14 @@
         self.assertEqual(res.getheader('X-Special'), 'Dängerous Mind')
         self.assertEqual(res.read(), 'Ärger mit Unicode'.encode('utf-8'))
 
+    def test_error_content_length(self):
+        # Issue #16088: standard error responses should have a content-length
+        self.con.request('NOTFOUND', '/')
+        res = self.con.getresponse()
+        self.assertEqual(res.status, 404)
+        data = res.read()
+        self.assertEqual(int(res.getheader('Content-Length')), len(data))
+
 
 class SimpleHTTPServerTestCase(BaseTestCase):
     class request_handler(NoLogRequestHandler, SimpleHTTPRequestHandler):
@@ -244,6 +267,33 @@
         self.assertIsNotNone(response.reason)
         if data:
             self.assertEqual(data, body)
+        return body
+
+    @support.requires_mac_ver(10, 5)
+    @unittest.skipUnless(support.TESTFN_UNDECODABLE,
+                         'need support.TESTFN_UNDECODABLE')
+    def test_undecodable_filename(self):
+        enc = sys.getfilesystemencoding()
+        filename = os.fsdecode(support.TESTFN_UNDECODABLE) + '.txt'
+        with open(os.path.join(self.tempdir, filename), 'wb') as f:
+            f.write(support.TESTFN_UNDECODABLE)
+        response = self.request(self.tempdir_name + '/')
+        if sys.platform == 'darwin':
+            # On Mac OS the HFS+ filesystem replaces bytes that aren't valid
+            # UTF-8 into a percent-encoded value.
+            for name in os.listdir(self.tempdir):
+                if name != 'test': # Ignore a filename created in setUp().
+                    filename = name
+                    break
+        body = self.check_status_and_reason(response, 200)
+        quotedname = urllib.parse.quote(filename, errors='surrogatepass')
+        self.assertIn(('href="%s"' % quotedname)
+                      .encode(enc, 'surrogateescape'), body)
+        self.assertIn(('>%s<' % html.escape(filename))
+                      .encode(enc, 'surrogateescape'), body)
+        response = self.request(self.tempdir_name + '/' + quotedname)
+        self.check_status_and_reason(response, 200,
+                                     data=support.TESTFN_UNDECODABLE)
 
     def test_get(self):
         #constructs the path relative to the root directory of the HTTPServer
@@ -256,6 +306,12 @@
         self.check_status_and_reason(response, 200)
         response = self.request(self.tempdir_name)
         self.check_status_and_reason(response, 301)
+        response = self.request(self.tempdir_name + '/?hi=2')
+        self.check_status_and_reason(response, 200)
+        response = self.request(self.tempdir_name + '?hi=1')
+        self.check_status_and_reason(response, 301)
+        self.assertEqual(response.getheader("Location"),
+                         self.tempdir_name + "/?hi=1")
         response = self.request('/ThisDoesNotExist')
         self.check_status_and_reason(response, 404)
         response = self.request('/' + 'ThisDoesNotExist' + '/')
@@ -284,7 +340,7 @@
         response = self.request('/', method='FOO')
         self.check_status_and_reason(response, 501)
         # requests must be case sensitive,so this should fail too
-        response = self.request('/', method='get')
+        response = self.request('/', method='custom')
         self.check_status_and_reason(response, 501)
         response = self.request('/', method='GETs')
         self.check_status_and_reason(response, 501)
diff --git a/Lib/test/test_idle.py b/Lib/test/test_idle.py
index 7770ee5..141e89e 100644
--- a/Lib/test/test_idle.py
+++ b/Lib/test/test_idle.py
@@ -1,32 +1,16 @@
 import unittest
 from test import support
-from test.support import import_module, use_resources
+from test.support import import_module
 
 # Skip test if _thread or _tkinter wasn't built or idlelib was deleted.
 import_module('threading')  # imported by PyShell, imports _thread
 tk = import_module('tkinter')  # imports _tkinter
 idletest = import_module('idlelib.idle_test')
 
-# If buildbot improperly sets gui resource (#18365, #18441), remove it
-# so requires('gui') tests are skipped while non-gui tests still run.
-# If there is a problem with Macs, see #18441, msg 193805
-if use_resources and 'gui' in use_resources:
-    try:
-        root = tk.Tk()
-        root.destroy()
-        del root
-    except tk.TclError:
-        while 'gui' in use_resources:
-            use_resources.remove('gui')
-
 # Without test_main present, regrtest.runtest_inner (line1219) calls
 # unittest.TestLoader().loadTestsFromModule(this_module) which calls
 # load_tests() if it finds it. (Unittest.main does the same.)
 load_tests = idletest.load_tests
 
 if __name__ == '__main__':
-    # Until unittest supports resources, we emulate regrtest's -ugui
-    # so loaded tests run the same as if textually present here.
-    # If any Idle test ever needs another resource, add it to the list.
-    support.use_resources = ['gui']  # use_resources is initially None
     unittest.main(verbosity=2, exit=False)
diff --git a/Lib/test/test_imaplib.py b/Lib/test/test_imaplib.py
index 7c9afd9..b34e652 100644
--- a/Lib/test/test_imaplib.py
+++ b/Lib/test/test_imaplib.py
@@ -20,6 +20,7 @@
     ssl = None
 
 CERTFILE = None
+CAFILE = None
 
 
 class TestImaplib(unittest.TestCase):
@@ -125,7 +126,7 @@
                         # Naked sockets return empty strings..
                         return
                     line += part
-                except IOError:
+                except OSError:
                     # ..but SSLSockets raise exceptions.
                     return
                 if line.endswith(b'\r\n'):
@@ -347,6 +348,25 @@
     server_class = SecureTCPServer
     imap_class = IMAP4_SSL
 
+    @reap_threads
+    def test_ssl_verified(self):
+        ssl_context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+        ssl_context.verify_mode = ssl.CERT_REQUIRED
+        ssl_context.check_hostname = True
+        ssl_context.load_verify_locations(CAFILE)
+
+        with self.assertRaisesRegex(ssl.CertificateError,
+                                    "hostname '127.0.0.1' doesn't match 'localhost'"):
+            with self.reaped_server(SimpleIMAPHandler) as server:
+                client = self.imap_class(*server.server_address,
+                                         ssl_context=ssl_context)
+                client.shutdown()
+
+        with self.reaped_server(SimpleIMAPHandler) as server:
+            client = self.imap_class("localhost", server.server_address[1],
+                                     ssl_context=ssl_context)
+            client.shutdown()
+
 
 class RemoteIMAPTest(unittest.TestCase):
     host = 'cyrus.andrew.cmu.edu'
@@ -459,11 +479,15 @@
 
     if support.is_resource_enabled('network'):
         if ssl:
-            global CERTFILE
+            global CERTFILE, CAFILE
             CERTFILE = os.path.join(os.path.dirname(__file__) or os.curdir,
-                                    "keycert.pem")
+                                    "keycert3.pem")
             if not os.path.exists(CERTFILE):
                 raise support.TestFailed("Can't read certificate files!")
+            CAFILE = os.path.join(os.path.dirname(__file__) or os.curdir,
+                                 "pycacert.pem")
+            if not os.path.exists(CAFILE):
+                raise support.TestFailed("Can't read CA file!")
         tests.extend([
             ThreadedNetworkedTests, ThreadedNetworkedTestsSSL,
             RemoteIMAPTest, RemoteIMAP_SSLTest, RemoteIMAP_STARTTLSTest,
@@ -473,5 +497,4 @@
 
 
 if __name__ == "__main__":
-    support.use_resources = ['network']
     unittest.main()
diff --git a/Lib/test/test_imp.py b/Lib/test/test_imp.py
index 71c220f..80b9ec3 100644
--- a/Lib/test/test_imp.py
+++ b/Lib/test/test_imp.py
@@ -1,14 +1,29 @@
-import imp
+try:
+    import _thread
+except ImportError:
+    _thread = None
 import importlib
 import os
 import os.path
 import shutil
 import sys
 from test import support
-from test.test_importlib import util
 import unittest
 import warnings
+with warnings.catch_warnings():
+    warnings.simplefilter('ignore', PendingDeprecationWarning)
+    import imp
 
+
+def requires_load_dynamic(meth):
+    """Decorator to skip a test if not running under CPython or lacking
+    imp.load_dynamic()."""
+    meth = support.cpython_only(meth)
+    return unittest.skipIf(not hasattr(imp, 'load_dynamic'),
+                           'imp.load_dynamic() required')(meth)
+
+
+@unittest.skipIf(_thread is None, '_thread module is required')
 class LockTests(unittest.TestCase):
 
     """Very basic test of import lock functions."""
@@ -150,7 +165,7 @@
                 self.assertIsNotNone(file)
                 self.assertTrue(filename[:-3].endswith(temp_mod_name))
                 self.assertEqual(info[0], '.py')
-                self.assertEqual(info[1], 'U')
+                self.assertEqual(info[1], 'r')
                 self.assertEqual(info[2], imp.PY_SOURCE)
 
                 mod = imp.load_module(temp_mod_name, file, filename, info)
@@ -183,6 +198,7 @@
                 support.unlink(temp_mod_name + ext)
                 support.unlink(init_file_name + ext)
             support.rmtree(test_package_name)
+            support.rmtree('__pycache__')
 
     def test_issue9319(self):
         path = os.path.dirname(__file__)
@@ -208,9 +224,7 @@
             self.assertIs(orig_path, new_os.path)
             self.assertIsNot(orig_getenv, new_os.getenv)
 
-    @support.cpython_only
-    @unittest.skipIf(not hasattr(imp, 'load_dynamic'),
-                     'imp.load_dynamic() required')
+    @requires_load_dynamic
     def test_issue15828_load_extensions(self):
         # Issue 15828 picked up that the adapter between the old imp API
         # and importlib couldn't handle C extensions
@@ -222,6 +236,22 @@
         mod = imp.load_module(example, *x)
         self.assertEqual(mod.__name__, example)
 
+    @requires_load_dynamic
+    def test_issue16421_multiple_modules_in_one_dll(self):
+        # Issue 16421: loading several modules from the same compiled file fails
+        m = '_testimportmultiple'
+        fileobj, pathname, description = imp.find_module(m)
+        fileobj.close()
+        mod0 = imp.load_dynamic(m, pathname)
+        mod1 = imp.load_dynamic('_testimportmultiple_foo', pathname)
+        mod2 = imp.load_dynamic('_testimportmultiple_bar', pathname)
+        self.assertEqual(mod0.__name__, m)
+        self.assertEqual(mod1.__name__, '_testimportmultiple_foo')
+        self.assertEqual(mod2.__name__, '_testimportmultiple_bar')
+        with self.assertRaises(ImportError):
+            imp.load_dynamic('nonexistent', pathname)
+
+    @requires_load_dynamic
     def test_load_dynamic_ImportError_path(self):
         # Issue #1559549 added `name` and `path` attributes to ImportError
         # in order to provide better detail. Issue #10854 implemented those
@@ -233,14 +263,12 @@
         self.assertIn(path, err.exception.path)
         self.assertEqual(name, err.exception.name)
 
-    @support.cpython_only
-    @unittest.skipIf(not hasattr(imp, 'load_dynamic'),
-                     'imp.load_dynamic() required')
+    @requires_load_dynamic
     def test_load_module_extension_file_is_None(self):
         # When loading an extension module and the file is None, open one
         # on the behalf of imp.load_dynamic().
         # Issue #15902
-        name = '_heapq'
+        name = '_testimportmultiple'
         found = imp.find_module(name)
         if found[0] is not None:
             found[0].close()
@@ -248,6 +276,15 @@
             self.skipTest("found module doesn't appear to be a C extension")
         imp.load_module(name, None, *found[1:])
 
+    @unittest.skipIf(sys.dont_write_bytecode,
+        "test meaningful only when writing bytecode")
+    def test_bug7732(self):
+        with support.temp_cwd():
+            source = support.TESTFN + '.py'
+            os.mkdir(source)
+            self.assertRaisesRegex(ImportError, '^No module',
+                imp.find_module, support.TESTFN, ["."])
+
     def test_multiple_calls_to_get_data(self):
         # Issue #18755: make sure multiple calls to get_data() can succeed.
         loader = imp._LoadSourceCompatibility('imp', imp.__file__,
@@ -293,22 +330,6 @@
         with self.assertRaisesRegex(ImportError, 'html'):
             imp.reload(parser)
 
-    def test_module_replaced(self):
-        # see #18698
-        def code():
-            module = type(sys)('top_level')
-            module.spam = 3
-            sys.modules['top_level'] = module
-        mock = util.mock_modules('top_level',
-                                 module_code={'top_level': code})
-        with mock:
-            with util.import_state(meta_path=[mock]):
-                module = importlib.import_module('top_level')
-                reloaded = imp.reload(module)
-                actual = sys.modules['top_level']
-                self.assertEqual(actual.spam, 3)
-                self.assertEqual(reloaded.spam, 3)
-
 
 class PEP3147Tests(unittest.TestCase):
     """Tests of PEP 3147."""
@@ -461,20 +482,5 @@
             os.rmdir(name)
 
 
-def test_main():
-    tests = [
-        ImportTests,
-        PEP3147Tests,
-        ReloadTests,
-        NullImporterTests,
-        ]
-    try:
-        import _thread
-    except ImportError:
-        pass
-    else:
-        tests.append(LockTests)
-    support.run_unittest(*tests)
-
 if __name__ == "__main__":
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_import.py b/Lib/test/test_import.py
index df08e6a..b4842c5 100644
--- a/Lib/test/test_import.py
+++ b/Lib/test/test_import.py
@@ -1,9 +1,8 @@
 # We import importlib *ASAP* in order to test #15386
 import importlib
+import importlib.util
 from importlib._bootstrap import _get_sourcefile
 import builtins
-import imp
-from test.test_importlib.import_ import util as importlib_util
 import marshal
 import os
 import platform
@@ -22,7 +21,7 @@
 from test.support import (
     EnvironmentVarGuard, TESTFN, check_warnings, forget, is_jython,
     make_legacy_pyc, rmtree, run_unittest, swap_attr, swap_item, temp_umask,
-    unlink, unload, create_empty_file, cpython_only)
+    unlink, unload, create_empty_file, cpython_only, TESTFN_UNENCODABLE)
 from test import script_helper
 
 
@@ -70,8 +69,6 @@
     def tearDown(self):
         unload(TESTFN)
 
-    setUp = tearDown
-
     def test_case_sensitivity(self):
         # Brief digression to test that import is case-sensitive:  if we got
         # this far, we know for sure that "random" exists.
@@ -129,16 +126,6 @@
         finally:
             del sys.path[0]
 
-    @skip_if_dont_write_bytecode
-    def test_bug7732(self):
-        source = TESTFN + '.py'
-        os.mkdir(source)
-        try:
-            self.assertRaisesRegex(ImportError, '^No module',
-                imp.find_module, TESTFN, ["."])
-        finally:
-            os.rmdir(source)
-
     def test_module_with_large_stack(self, module='longlist'):
         # Regression test for http://bugs.python.org/issue561858.
         filename = module + '.py'
@@ -161,16 +148,24 @@
         sys.path.append('')
         importlib.invalidate_caches()
 
+        namespace = {}
         try:
             make_legacy_pyc(filename)
             # This used to crash.
-            exec('import ' + module)
+            exec('import ' + module, None, namespace)
         finally:
             # Cleanup.
             del sys.path[-1]
             unlink(filename + 'c')
             unlink(filename + 'o')
 
+            # Remove references to the module (unload the module)
+            namespace.clear()
+            try:
+                del sys.modules[module]
+            except KeyError:
+                pass
+
     def test_failing_import_sticks(self):
         source = TESTFN + ".py"
         with open(source, "w") as f:
@@ -195,12 +190,12 @@
         # import x.y.z binds x in the current namespace
         import test as x
         import test.support
-        self.assertTrue(x is test, x.__name__)
+        self.assertIs(x, test, x.__name__)
         self.assertTrue(hasattr(test.support, "__file__"))
 
         # import x.y.z as w binds z as w
         import test.support as y
-        self.assertTrue(y is test.support, y.__name__)
+        self.assertIs(y, test.support, y.__name__)
 
     def test_failing_reload(self):
         # A failing reload should leave the module object in sys.modules.
@@ -225,10 +220,10 @@
             with open(source, "w") as f:
                 f.write("a = 10\nb=20//0\n")
 
-            self.assertRaises(ZeroDivisionError, imp.reload, mod)
+            self.assertRaises(ZeroDivisionError, importlib.reload, mod)
             # But we still expect the module to be in sys.modules.
             mod = sys.modules.get(TESTFN)
-            self.assertIsNot(mod, None, "expected module to be in sys.modules")
+            self.assertIsNotNone(mod, "expected module to be in sys.modules")
 
             # We should have replaced a w/ 10, but the old b value should
             # stick.
@@ -280,7 +275,7 @@
             import sys
             class C:
                def __del__(self):
-                  import imp
+                  import importlib
             sys.argv.insert(0, C())
             """))
         script_helper.assert_python_ok(testfn)
@@ -291,7 +286,7 @@
         sys.path.insert(0, os.curdir)
         try:
             source = TESTFN + ".py"
-            compiled = imp.cache_from_source(source)
+            compiled = importlib.util.cache_from_source(source)
             with open(source, 'w') as f:
                 pass
             try:
@@ -322,6 +317,14 @@
         stdout, stderr = popen.communicate()
         self.assertIn(b"ImportError", stdout)
 
+    def test_from_import_message_for_nonexistent_module(self):
+        with self.assertRaisesRegex(ImportError, "^No module named 'bogus'"):
+            from bogus import foo
+
+    def test_from_import_message_for_existing_module(self):
+        with self.assertRaisesRegex(ImportError, "^cannot import name 'bogus'"):
+            from re import bogus
+
 
 @skip_if_dont_write_bytecode
 class FilePermissionTests(unittest.TestCase):
@@ -332,7 +335,7 @@
     def test_creation_mode(self):
         mask = 0o022
         with temp_umask(mask), _ready_to_import() as (name, path):
-            cached_path = imp.cache_from_source(path)
+            cached_path = importlib.util.cache_from_source(path)
             module = __import__(name)
             if not os.path.exists(cached_path):
                 self.fail("__import__ did not result in creation of "
@@ -350,7 +353,7 @@
         # 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)
+            cached_path = importlib.util.cache_from_source(path)
             os.chmod(path, mode)
             __import__(name)
             if not os.path.exists(cached_path):
@@ -365,7 +368,7 @@
     def test_cached_readonly(self):
         mode = 0o400
         with temp_umask(0o022), _ready_to_import() as (name, path):
-            cached_path = imp.cache_from_source(path)
+            cached_path = importlib.util.cache_from_source(path)
             os.chmod(path, mode)
             __import__(name)
             if not os.path.exists(cached_path):
@@ -405,7 +408,7 @@
                 bytecode_only = path + "c"
             else:
                 bytecode_only = path + "o"
-            os.rename(imp.cache_from_source(path), bytecode_only)
+            os.rename(importlib.util.cache_from_source(path), bytecode_only)
             m = __import__(name)
             self.assertEqual(m.x, 'rewritten')
 
@@ -427,7 +430,7 @@
 """
     dir_name = os.path.abspath(TESTFN)
     file_name = os.path.join(dir_name, module_name) + os.extsep + "py"
-    compiled_name = imp.cache_from_source(file_name)
+    compiled_name = importlib.util.cache_from_source(file_name)
 
     def setUp(self):
         self.sys_path = sys.path[:]
@@ -488,7 +491,7 @@
             header = f.read(12)
             code = marshal.load(f)
         constants = list(code.co_consts)
-        foreign_code = test_main.__code__
+        foreign_code = importlib.import_module.__code__
         pos = constants.index(1)
         constants[pos] = foreign_code
         code = type(code)(code.co_argcount, code.co_kwonlyargcount,
@@ -630,7 +633,7 @@
 class PycacheTests(unittest.TestCase):
     # Test the various PEP 3147 related behaviors.
 
-    tag = imp.get_tag()
+    tag = sys.implementation.cache_tag
 
     def _clean(self):
         forget(TESTFN)
@@ -678,10 +681,11 @@
         # With PEP 3147 cache layout, removing the source but leaving the pyc
         # file does not satisfy the import.
         __import__(TESTFN)
-        pyc_file = imp.cache_from_source(self.source)
+        pyc_file = importlib.util.cache_from_source(self.source)
         self.assertTrue(os.path.exists(pyc_file))
         os.remove(self.source)
         forget(TESTFN)
+        importlib.invalidate_caches()
         self.assertRaises(ImportError, __import__, TESTFN)
 
     @skip_if_dont_write_bytecode
@@ -703,7 +707,7 @@
     def test___cached__(self):
         # Modules now also have an __cached__ that points to the pyc file.
         m = __import__(TESTFN)
-        pyc_file = imp.cache_from_source(TESTFN + '.py')
+        pyc_file = importlib.util.cache_from_source(TESTFN + '.py')
         self.assertEqual(m.__cached__, os.path.join(os.curdir, pyc_file))
 
     @skip_if_dont_write_bytecode
@@ -738,10 +742,10 @@
             pass
         importlib.invalidate_caches()
         m = __import__('pep3147.foo')
-        init_pyc = imp.cache_from_source(
+        init_pyc = importlib.util.cache_from_source(
             os.path.join('pep3147', '__init__.py'))
         self.assertEqual(m.__cached__, os.path.join(os.curdir, init_pyc))
-        foo_pyc = imp.cache_from_source(os.path.join('pep3147', 'foo.py'))
+        foo_pyc = importlib.util.cache_from_source(os.path.join('pep3147', 'foo.py'))
         self.assertEqual(sys.modules['pep3147.foo'].__cached__,
                          os.path.join(os.curdir, foo_pyc))
 
@@ -765,10 +769,10 @@
         unload('pep3147')
         importlib.invalidate_caches()
         m = __import__('pep3147.foo')
-        init_pyc = imp.cache_from_source(
+        init_pyc = importlib.util.cache_from_source(
             os.path.join('pep3147', '__init__.py'))
         self.assertEqual(m.__cached__, os.path.join(os.curdir, init_pyc))
-        foo_pyc = imp.cache_from_source(os.path.join('pep3147', 'foo.py'))
+        foo_pyc = importlib.util.cache_from_source(os.path.join('pep3147', 'foo.py'))
         self.assertEqual(sys.modules['pep3147.foo'].__cached__,
                          os.path.join(os.curdir, foo_pyc))
 
@@ -852,7 +856,6 @@
         from importlib import machinery
         mod = sys.modules['_frozen_importlib']
         self.assertIs(machinery.FileFinder, mod.FileFinder)
-        self.assertIs(imp.new_module, mod.new_module)
 
 
 @cpython_only
@@ -1033,11 +1036,14 @@
         # away from the traceback.
         self.create_module("foo", "")
         importlib = sys.modules['_frozen_importlib']
-        old_load_module = importlib.SourceLoader.load_module
+        if 'load_module' in vars(importlib.SourceLoader):
+            old_exec_module = importlib.SourceLoader.exec_module
+        else:
+            old_exec_module = None
         try:
-            def load_module(*args):
+            def exec_module(*args):
                 1/0
-            importlib.SourceLoader.load_module = load_module
+            importlib.SourceLoader.exec_module = exec_module
             try:
                 import foo
             except ZeroDivisionError as e:
@@ -1046,19 +1052,22 @@
                 self.fail("ZeroDivisionError should have been raised")
             self.assert_traceback(tb, [__file__, '<frozen importlib', __file__])
         finally:
-            importlib.SourceLoader.load_module = old_load_module
+            if old_exec_module is None:
+                del importlib.SourceLoader.exec_module
+            else:
+                importlib.SourceLoader.exec_module = old_exec_module
 
-
-def test_main(verbose=None):
-    run_unittest(ImportTests, PycacheTests, FilePermissionTests,
-                 PycRewritingTests, PathsTests, RelativeImportTests,
-                 OverridingImportBuiltinTests,
-                 ImportlibBootstrapTests, GetSourcefileTests,
-                 TestSymbolicallyLinkedPackage,
-                 ImportTracebackTests)
+    @unittest.skipUnless(TESTFN_UNENCODABLE, 'need TESTFN_UNENCODABLE')
+    def test_unencodable_filename(self):
+        # Issue #11619: The Python parser and the import machinery must not
+        # encode filenames, especially on Windows
+        pyname = script_helper.make_script('', TESTFN_UNENCODABLE, 'pass')
+        self.addCleanup(unlink, pyname)
+        name = pyname[:-3]
+        script_helper.assert_python_ok("-c", "mod = __import__(%a)" % name,
+                                       __isolated=False)
 
 
 if __name__ == '__main__':
     # Test needs to be a package, so we can do relative imports.
-    from test.test_import import test_main
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_importhooks.py b/Lib/test/test_importhooks.py
deleted file mode 100644
index 2a22d1a..0000000
--- a/Lib/test/test_importhooks.py
+++ /dev/null
@@ -1,250 +0,0 @@
-import sys
-import imp
-import os
-import unittest
-from test import support
-
-
-test_src = """\
-def get_name():
-    return __name__
-def get_file():
-    return __file__
-"""
-
-absimp = "import sub\n"
-relimp = "from . import sub\n"
-deeprelimp = "from .... import sub\n"
-futimp = "from __future__ import absolute_import\n"
-
-reload_src = test_src+"""\
-reloaded = True
-"""
-
-test_co = compile(test_src, "<???>", "exec")
-reload_co = compile(reload_src, "<???>", "exec")
-
-test2_oldabs_co = compile(absimp + test_src, "<???>", "exec")
-test2_newabs_co = compile(futimp + absimp + test_src, "<???>", "exec")
-test2_newrel_co = compile(relimp + test_src, "<???>", "exec")
-test2_deeprel_co = compile(deeprelimp + test_src, "<???>", "exec")
-test2_futrel_co = compile(futimp + relimp + test_src, "<???>", "exec")
-
-test_path = "!!!_test_!!!"
-
-
-class TestImporter:
-
-    modules = {
-        "hooktestmodule": (False, test_co),
-        "hooktestpackage": (True, test_co),
-        "hooktestpackage.sub": (True, test_co),
-        "hooktestpackage.sub.subber": (True, test_co),
-        "hooktestpackage.oldabs": (False, test2_oldabs_co),
-        "hooktestpackage.newabs": (False, test2_newabs_co),
-        "hooktestpackage.newrel": (False, test2_newrel_co),
-        "hooktestpackage.sub.subber.subest": (True, test2_deeprel_co),
-        "hooktestpackage.futrel": (False, test2_futrel_co),
-        "sub": (False, test_co),
-        "reloadmodule": (False, test_co),
-    }
-
-    def __init__(self, path=test_path):
-        if path != test_path:
-            # if our class is on sys.path_hooks, we must raise
-            # ImportError for any path item that we can't handle.
-            raise ImportError
-        self.path = path
-
-    def _get__path__(self):
-        raise NotImplementedError
-
-    def find_module(self, fullname, path=None):
-        if fullname in self.modules:
-            return self
-        else:
-            return None
-
-    def load_module(self, fullname):
-        ispkg, code = self.modules[fullname]
-        mod = sys.modules.setdefault(fullname,imp.new_module(fullname))
-        mod.__file__ = "<%s>" % self.__class__.__name__
-        mod.__loader__ = self
-        if ispkg:
-            mod.__path__ = self._get__path__()
-        exec(code, mod.__dict__)
-        return mod
-
-
-class MetaImporter(TestImporter):
-    def _get__path__(self):
-        return []
-
-class PathImporter(TestImporter):
-    def _get__path__(self):
-        return [self.path]
-
-
-class ImportBlocker:
-    """Place an ImportBlocker instance on sys.meta_path and you
-    can be sure the modules you specified can't be imported, even
-    if it's a builtin."""
-    def __init__(self, *namestoblock):
-        self.namestoblock = dict.fromkeys(namestoblock)
-    def find_module(self, fullname, path=None):
-        if fullname in self.namestoblock:
-            return self
-        return None
-    def load_module(self, fullname):
-        raise ImportError("I dare you")
-
-
-class ImpWrapper:
-
-    def __init__(self, path=None):
-        if path is not None and not os.path.isdir(path):
-            raise ImportError
-        self.path = path
-
-    def find_module(self, fullname, path=None):
-        subname = fullname.split(".")[-1]
-        if subname != fullname and self.path is None:
-            return None
-        if self.path is None:
-            path = None
-        else:
-            path = [self.path]
-        try:
-            file, filename, stuff = imp.find_module(subname, path)
-        except ImportError:
-            return None
-        return ImpLoader(file, filename, stuff)
-
-
-class ImpLoader:
-
-    def __init__(self, file, filename, stuff):
-        self.file = file
-        self.filename = filename
-        self.stuff = stuff
-
-    def load_module(self, fullname):
-        mod = imp.load_module(fullname, self.file, self.filename, self.stuff)
-        if self.file:
-            self.file.close()
-        mod.__loader__ = self  # for introspection
-        return mod
-
-
-class ImportHooksBaseTestCase(unittest.TestCase):
-
-    def setUp(self):
-        self.path = sys.path[:]
-        self.meta_path = sys.meta_path[:]
-        self.path_hooks = sys.path_hooks[:]
-        sys.path_importer_cache.clear()
-        self.modules_before = support.modules_setup()
-
-    def tearDown(self):
-        sys.path[:] = self.path
-        sys.meta_path[:] = self.meta_path
-        sys.path_hooks[:] = self.path_hooks
-        sys.path_importer_cache.clear()
-        support.modules_cleanup(*self.modules_before)
-
-
-class ImportHooksTestCase(ImportHooksBaseTestCase):
-
-    def doTestImports(self, importer=None):
-        import hooktestmodule
-        import hooktestpackage
-        import hooktestpackage.sub
-        import hooktestpackage.sub.subber
-        self.assertEqual(hooktestmodule.get_name(),
-                         "hooktestmodule")
-        self.assertEqual(hooktestpackage.get_name(),
-                         "hooktestpackage")
-        self.assertEqual(hooktestpackage.sub.get_name(),
-                         "hooktestpackage.sub")
-        self.assertEqual(hooktestpackage.sub.subber.get_name(),
-                         "hooktestpackage.sub.subber")
-        if importer:
-            self.assertEqual(hooktestmodule.__loader__, importer)
-            self.assertEqual(hooktestpackage.__loader__, importer)
-            self.assertEqual(hooktestpackage.sub.__loader__, importer)
-            self.assertEqual(hooktestpackage.sub.subber.__loader__, importer)
-
-        TestImporter.modules['reloadmodule'] = (False, test_co)
-        import reloadmodule
-        self.assertFalse(hasattr(reloadmodule,'reloaded'))
-
-        import hooktestpackage.newrel
-        self.assertEqual(hooktestpackage.newrel.get_name(),
-                         "hooktestpackage.newrel")
-        self.assertEqual(hooktestpackage.newrel.sub,
-                         hooktestpackage.sub)
-
-        import hooktestpackage.sub.subber.subest as subest
-        self.assertEqual(subest.get_name(),
-                         "hooktestpackage.sub.subber.subest")
-        self.assertEqual(subest.sub,
-                         hooktestpackage.sub)
-
-        import hooktestpackage.futrel
-        self.assertEqual(hooktestpackage.futrel.get_name(),
-                         "hooktestpackage.futrel")
-        self.assertEqual(hooktestpackage.futrel.sub,
-                         hooktestpackage.sub)
-
-        import sub
-        self.assertEqual(sub.get_name(), "sub")
-
-        import hooktestpackage.oldabs
-        self.assertEqual(hooktestpackage.oldabs.get_name(),
-                         "hooktestpackage.oldabs")
-        self.assertEqual(hooktestpackage.oldabs.sub, sub)
-
-        import hooktestpackage.newabs
-        self.assertEqual(hooktestpackage.newabs.get_name(),
-                         "hooktestpackage.newabs")
-        self.assertEqual(hooktestpackage.newabs.sub, sub)
-
-    def testMetaPath(self):
-        i = MetaImporter()
-        sys.meta_path.append(i)
-        self.doTestImports(i)
-
-    def testPathHook(self):
-        sys.path_hooks.insert(0, PathImporter)
-        sys.path.append(test_path)
-        self.doTestImports()
-
-    def testBlocker(self):
-        mname = "exceptions"  # an arbitrary harmless builtin module
-        support.unload(mname)
-        sys.meta_path.append(ImportBlocker(mname))
-        self.assertRaises(ImportError, __import__, mname)
-
-    def testImpWrapper(self):
-        i = ImpWrapper()
-        sys.meta_path.append(i)
-        sys.path_hooks.insert(0, ImpWrapper)
-        mnames = (
-            "colorsys", "urllib.parse", "distutils.core", "sys",
-        )
-        for mname in mnames:
-            parent = mname.split(".")[0]
-            for n in list(sys.modules):
-                if n.startswith(parent):
-                    del sys.modules[n]
-        for mname in mnames:
-            m = __import__(mname, globals(), locals(), ["__dummy__"])
-            # to make sure we actually handled the import
-            self.assertTrue(hasattr(m, "__loader__"))
-
-
-def test_main():
-    support.run_unittest(ImportHooksTestCase)
-
-if __name__ == "__main__":
-    test_main()
diff --git a/Lib/test/test_importlib/__init__.py b/Lib/test/test_importlib/__init__.py
index 0e345cd..4b16ecc 100644
--- a/Lib/test/test_importlib/__init__.py
+++ b/Lib/test/test_importlib/__init__.py
@@ -1,33 +1,5 @@
 import os
-import sys
-from test import support
-import unittest
+from test.support import load_package_tests
 
-def test_suite(package=__package__, directory=os.path.dirname(__file__)):
-    suite = unittest.TestSuite()
-    for name in os.listdir(directory):
-        if name.startswith(('.', '__')):
-            continue
-        path = os.path.join(directory, name)
-        if (os.path.isfile(path) and name.startswith('test_') and
-                name.endswith('.py')):
-            submodule_name = os.path.splitext(name)[0]
-            module_name = "{0}.{1}".format(package, submodule_name)
-            __import__(module_name, level=0)
-            module_tests = unittest.findTestCases(sys.modules[module_name])
-            suite.addTest(module_tests)
-        elif os.path.isdir(path):
-            package_name = "{0}.{1}".format(package, name)
-            __import__(package_name, level=0)
-            package_tests = getattr(sys.modules[package_name], 'test_suite')()
-            suite.addTest(package_tests)
-        else:
-            continue
-    return suite
-
-
-def test_main():
-    start_dir = os.path.dirname(__file__)
-    top_dir = os.path.dirname(os.path.dirname(start_dir))
-    test_loader = unittest.TestLoader()
-    support.run_unittest(test_loader.discover(start_dir, top_level_dir=top_dir))
+def load_tests(*args):
+    return load_package_tests(os.path.dirname(__file__), *args)
diff --git a/Lib/test/test_importlib/__main__.py b/Lib/test/test_importlib/__main__.py
index c397128..40a23a2 100644
--- a/Lib/test/test_importlib/__main__.py
+++ b/Lib/test/test_importlib/__main__.py
@@ -1,20 +1,4 @@
-"""Run importlib's test suite.
+from . import load_tests
+import unittest
 
-Specifying the ``--builtin`` flag will run tests, where applicable, with
-builtins.__import__ instead of importlib.__import__.
-
-"""
-from . import test_main
-
-
-if __name__ == '__main__':
-    import argparse
-
-    parser = argparse.ArgumentParser(description='Execute the importlib test '
-                                                  'suite')
-    parser.add_argument('-b', '--builtin', action='store_true', default=False,
-                        help='use builtins.__import__() instead of importlib')
-    args = parser.parse_args()
-    if args.builtin:
-        util.using___import__ = True
-    test_main()
+unittest.main()
diff --git a/Lib/test/test_importlib/abc.py b/Lib/test/test_importlib/abc.py
index 2c17ac3..2070dad 100644
--- a/Lib/test/test_importlib/abc.py
+++ b/Lib/test/test_importlib/abc.py
@@ -2,7 +2,7 @@
 import unittest
 
 
-class FinderTests(unittest.TestCase, metaclass=abc.ABCMeta):
+class FinderTests(metaclass=abc.ABCMeta):
 
     """Basic tests for a finder to pass."""
 
@@ -39,7 +39,7 @@
         pass
 
 
-class LoaderTests(unittest.TestCase, metaclass=abc.ABCMeta):
+class LoaderTests(metaclass=abc.ABCMeta):
 
     @abc.abstractmethod
     def test_module(self):
@@ -81,11 +81,6 @@
         pass
 
     @abc.abstractmethod
-    def test_module_reuse(self):
-        """If a module is already in sys.modules, it should be reused."""
-        pass
-
-    @abc.abstractmethod
     def test_state_after_failure(self):
         """If a module is already in sys.modules and a reload fails
         (e.g. a SyntaxError), the module should be in the state it was before
diff --git a/Lib/test/test_importlib/builtin/__init__.py b/Lib/test/test_importlib/builtin/__init__.py
index 15c0ade..4b16ecc 100644
--- a/Lib/test/test_importlib/builtin/__init__.py
+++ b/Lib/test/test_importlib/builtin/__init__.py
@@ -1,12 +1,5 @@
-from .. import test_suite
 import os
+from test.support import load_package_tests
 
-
-def test_suite():
-    directory = os.path.dirname(__file__)
-    return test_suite('importlib.test.builtin', directory)
-
-
-if __name__ == '__main__':
-    from test.support import run_unittest
-    run_unittest(test_suite())
+def load_tests(*args):
+    return load_package_tests(os.path.dirname(__file__), *args)
diff --git a/Lib/test/test_importlib/builtin/__main__.py b/Lib/test/test_importlib/builtin/__main__.py
new file mode 100644
index 0000000..40a23a2
--- /dev/null
+++ b/Lib/test/test_importlib/builtin/__main__.py
@@ -0,0 +1,4 @@
+from . import load_tests
+import unittest
+
+unittest.main()
diff --git a/Lib/test/test_importlib/builtin/test_finder.py b/Lib/test/test_importlib/builtin/test_finder.py
index da0ef28..934562f 100644
--- a/Lib/test/test_importlib/builtin/test_finder.py
+++ b/Lib/test/test_importlib/builtin/test_finder.py
@@ -1,11 +1,53 @@
-from importlib import machinery
 from .. import abc
 from .. import util
 from . import util as builtin_util
 
+frozen_machinery, source_machinery = util.import_importlib('importlib.machinery')
+
 import sys
 import unittest
 
+
+class FindSpecTests(abc.FinderTests):
+
+    """Test find_spec() for built-in modules."""
+
+    def test_module(self):
+        # Common case.
+        with util.uncache(builtin_util.NAME):
+            found = self.machinery.BuiltinImporter.find_spec(builtin_util.NAME)
+            self.assertTrue(found)
+            self.assertEqual(found.origin, 'built-in')
+
+    # Built-in modules cannot be a package.
+    test_package = None
+
+    # Built-in modules cannobt be in a package.
+    test_module_in_package = None
+
+    # Built-in modules cannot be a package.
+    test_package_in_package = None
+
+    # Built-in modules cannot be a package.
+    test_package_over_module = None
+
+    def test_failure(self):
+        name = 'importlib'
+        assert name not in sys.builtin_module_names
+        spec = self.machinery.BuiltinImporter.find_spec(name)
+        self.assertIsNone(spec)
+
+    def test_ignore_path(self):
+        # The value for 'path' should always trigger a failed import.
+        with util.uncache(builtin_util.NAME):
+            spec = self.machinery.BuiltinImporter.find_spec(builtin_util.NAME,
+                                                            ['pkg'])
+            self.assertIsNone(spec)
+
+Frozen_FindSpecTests, Source_FindSpecTests = util.test_both(FindSpecTests,
+        machinery=[frozen_machinery, source_machinery])
+
+
 class FinderTests(abc.FinderTests):
 
     """Test find_module() for built-in modules."""
@@ -13,8 +55,9 @@
     def test_module(self):
         # Common case.
         with util.uncache(builtin_util.NAME):
-            found = machinery.BuiltinImporter.find_module(builtin_util.NAME)
+            found = self.machinery.BuiltinImporter.find_module(builtin_util.NAME)
             self.assertTrue(found)
+            self.assertTrue(hasattr(found, 'load_module'))
 
     # Built-in modules cannot be a package.
     test_package = test_package_in_package = test_package_over_module = None
@@ -24,22 +67,19 @@
 
     def test_failure(self):
         assert 'importlib' not in sys.builtin_module_names
-        loader = machinery.BuiltinImporter.find_module('importlib')
+        loader = self.machinery.BuiltinImporter.find_module('importlib')
         self.assertIsNone(loader)
 
     def test_ignore_path(self):
         # The value for 'path' should always trigger a failed import.
         with util.uncache(builtin_util.NAME):
-            loader = machinery.BuiltinImporter.find_module(builtin_util.NAME,
+            loader = self.machinery.BuiltinImporter.find_module(builtin_util.NAME,
                                                             ['pkg'])
             self.assertIsNone(loader)
 
-
-
-def test_main():
-    from test.support import run_unittest
-    run_unittest(FinderTests)
+Frozen_FinderTests, Source_FinderTests = util.test_both(FinderTests,
+        machinery=[frozen_machinery, source_machinery])
 
 
 if __name__ == '__main__':
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_importlib/builtin/test_loader.py b/Lib/test/test_importlib/builtin/test_loader.py
index 12a79c6..1f83574 100644
--- a/Lib/test/test_importlib/builtin/test_loader.py
+++ b/Lib/test/test_importlib/builtin/test_loader.py
@@ -1,9 +1,9 @@
-import importlib
-from importlib import machinery
 from .. import abc
 from .. import util
 from . import util as builtin_util
 
+frozen_machinery, source_machinery = util.import_importlib('importlib.machinery')
+
 import sys
 import types
 import unittest
@@ -13,8 +13,9 @@
 
     """Test load_module() for built-in modules."""
 
-    verification = {'__name__': 'errno', '__package__': '',
-                    '__loader__': machinery.BuiltinImporter}
+    def setUp(self):
+        self.verification = {'__name__': 'errno', '__package__': '',
+                             '__loader__': self.machinery.BuiltinImporter}
 
     def verify(self, module):
         """Verify that the module matches against what it should have."""
@@ -23,8 +24,8 @@
             self.assertEqual(getattr(module, attr), value)
         self.assertIn(module.__name__, sys.modules)
 
-    load_module = staticmethod(lambda name:
-                                machinery.BuiltinImporter.load_module(name))
+    def load_module(self, name):
+        return self.machinery.BuiltinImporter.load_module(name)
 
     def test_module(self):
         # Common case.
@@ -55,45 +56,51 @@
     def test_already_imported(self):
         # Using the name of a module already imported but not a built-in should
         # still fail.
-        assert hasattr(importlib, '__file__')  # Not a built-in.
+        module_name = 'builtin_reload_test'
+        assert module_name not in sys.builtin_module_names
+        with util.uncache(module_name):
+            module = types.ModuleType(module_name)
+            sys.modules[module_name] = module
         with self.assertRaises(ImportError) as cm:
-            self.load_module('importlib')
-        self.assertEqual(cm.exception.name, 'importlib')
+            self.load_module(module_name)
+        self.assertEqual(cm.exception.name, module_name)
 
 
-class InspectLoaderTests(unittest.TestCase):
+Frozen_LoaderTests, Source_LoaderTests = util.test_both(LoaderTests,
+        machinery=[frozen_machinery, source_machinery])
+
+
+class InspectLoaderTests:
 
     """Tests for InspectLoader methods for BuiltinImporter."""
 
     def test_get_code(self):
         # There is no code object.
-        result = machinery.BuiltinImporter.get_code(builtin_util.NAME)
+        result = self.machinery.BuiltinImporter.get_code(builtin_util.NAME)
         self.assertIsNone(result)
 
     def test_get_source(self):
         # There is no source.
-        result = machinery.BuiltinImporter.get_source(builtin_util.NAME)
+        result = self.machinery.BuiltinImporter.get_source(builtin_util.NAME)
         self.assertIsNone(result)
 
     def test_is_package(self):
         # Cannot be a package.
-        result = machinery.BuiltinImporter.is_package(builtin_util.NAME)
-        self.assertTrue(not result)
+        result = self.machinery.BuiltinImporter.is_package(builtin_util.NAME)
+        self.assertFalse(result)
 
     def test_not_builtin(self):
         # Modules not built-in should raise ImportError.
         for meth_name in ('get_code', 'get_source', 'is_package'):
-            method = getattr(machinery.BuiltinImporter, meth_name)
+            method = getattr(self.machinery.BuiltinImporter, meth_name)
         with self.assertRaises(ImportError) as cm:
             method(builtin_util.BAD_NAME)
         self.assertRaises(builtin_util.BAD_NAME)
 
-
-
-def test_main():
-    from test.support import run_unittest
-    run_unittest(LoaderTests, InspectLoaderTests)
+Frozen_InspectLoaderTests, Source_InspectLoaderTests = util.test_both(
+        InspectLoaderTests,
+        machinery=[frozen_machinery, source_machinery])
 
 
 if __name__ == '__main__':
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_importlib/extension/__init__.py b/Lib/test/test_importlib/extension/__init__.py
index c033923..4b16ecc 100644
--- a/Lib/test/test_importlib/extension/__init__.py
+++ b/Lib/test/test_importlib/extension/__init__.py
@@ -1,13 +1,5 @@
-from .. import test_suite
-import os.path
-import unittest
+import os
+from test.support import load_package_tests
 
-
-def test_suite():
-    directory = os.path.dirname(__file__)
-    return test_suite('importlib.test.extension', directory)
-
-
-if __name__ == '__main__':
-    from test.support import run_unittest
-    run_unittest(test_suite())
+def load_tests(*args):
+    return load_package_tests(os.path.dirname(__file__), *args)
diff --git a/Lib/test/test_importlib/extension/__main__.py b/Lib/test/test_importlib/extension/__main__.py
new file mode 100644
index 0000000..40a23a2
--- /dev/null
+++ b/Lib/test/test_importlib/extension/__main__.py
@@ -0,0 +1,4 @@
+from . import load_tests
+import unittest
+
+unittest.main()
diff --git a/Lib/test/test_importlib/extension/test_case_sensitivity.py b/Lib/test/test_importlib/extension/test_case_sensitivity.py
index 76c53e4..bb2528e 100644
--- a/Lib/test/test_importlib/extension/test_case_sensitivity.py
+++ b/Lib/test/test_importlib/extension/test_case_sensitivity.py
@@ -1,22 +1,27 @@
-import imp
+from importlib import _bootstrap
 import sys
 from test import support
 import unittest
-from importlib import _bootstrap
+
 from .. import util
 from . import util as ext_util
 
+frozen_machinery, source_machinery = util.import_importlib('importlib.machinery')
 
+
+# XXX find_spec tests
+
+@unittest.skipIf(ext_util.FILENAME is None, '_testcapi not available')
 @util.case_insensitive_tests
-class ExtensionModuleCaseSensitivityTest(unittest.TestCase):
+class ExtensionModuleCaseSensitivityTest:
 
     def find_module(self):
         good_name = ext_util.NAME
         bad_name = good_name.upper()
         assert good_name != bad_name
-        finder = _bootstrap.FileFinder(ext_util.PATH,
-                                        (_bootstrap.ExtensionFileLoader,
-                                         _bootstrap.EXTENSION_SUFFIXES))
+        finder = self.machinery.FileFinder(ext_util.PATH,
+                                          (self.machinery.ExtensionFileLoader,
+                                           self.machinery.EXTENSION_SUFFIXES))
         return finder.find_module(bad_name)
 
     def test_case_sensitive(self):
@@ -37,14 +42,10 @@
             loader = self.find_module()
             self.assertTrue(hasattr(loader, 'load_module'))
 
-
-
-
-def test_main():
-    if ext_util.FILENAME is None:
-        return
-    support.run_unittest(ExtensionModuleCaseSensitivityTest)
+Frozen_ExtensionCaseSensitivity, Source_ExtensionCaseSensitivity = util.test_both(
+        ExtensionModuleCaseSensitivityTest,
+        machinery=[frozen_machinery, source_machinery])
 
 
 if __name__ == '__main__':
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_importlib/extension/test_finder.py b/Lib/test/test_importlib/extension/test_finder.py
index 37f6772..990f29c 100644
--- a/Lib/test/test_importlib/extension/test_finder.py
+++ b/Lib/test/test_importlib/extension/test_finder.py
@@ -1,18 +1,25 @@
-from importlib import machinery
 from .. import abc
+from .. import util as test_util
 from . import util
 
+machinery = test_util.import_importlib('importlib.machinery')
+
 import unittest
+import warnings
+
+# XXX find_spec tests
 
 class FinderTests(abc.FinderTests):
 
     """Test the finder for extension modules."""
 
     def find_module(self, fullname):
-        importer = machinery.FileFinder(util.PATH,
-                                        (machinery.ExtensionFileLoader,
-                                         machinery.EXTENSION_SUFFIXES))
-        return importer.find_module(fullname)
+        importer = self.machinery.FileFinder(util.PATH,
+                                            (self.machinery.ExtensionFileLoader,
+                                             self.machinery.EXTENSION_SUFFIXES))
+        with warnings.catch_warnings():
+            warnings.simplefilter('ignore', DeprecationWarning)
+            return importer.find_module(fullname)
 
     def test_module(self):
         self.assertTrue(self.find_module(util.NAME))
@@ -29,11 +36,9 @@
     def test_failure(self):
         self.assertIsNone(self.find_module('asdfjkl;'))
 
-
-def test_main():
-    from test.support import run_unittest
-    run_unittest(FinderTests)
+Frozen_FinderTests, Source_FinderTests = test_util.test_both(
+        FinderTests, machinery=machinery)
 
 
 if __name__ == '__main__':
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_importlib/extension/test_loader.py b/Lib/test/test_importlib/extension/test_loader.py
index e790675..fd9abf2 100644
--- a/Lib/test/test_importlib/extension/test_loader.py
+++ b/Lib/test/test_importlib/extension/test_loader.py
@@ -1,10 +1,12 @@
-from importlib import machinery
 from . import util as ext_util
 from .. import abc
 from .. import util
 
+machinery = util.import_importlib('importlib.machinery')
+
 import os.path
 import sys
+import types
 import unittest
 
 
@@ -13,8 +15,8 @@
     """Test load_module() for extension modules."""
 
     def setUp(self):
-        self.loader = machinery.ExtensionFileLoader(ext_util.NAME,
-                                                     ext_util.FILEPATH)
+        self.loader = self.machinery.ExtensionFileLoader(ext_util.NAME,
+                                                         ext_util.FILEPATH)
 
     def load_module(self, fullname):
         return self.loader.load_module(fullname)
@@ -26,6 +28,15 @@
         with self.assertRaises(ImportError):
             self.load_module('XXX')
 
+    def test_equality(self):
+        other = self.machinery.ExtensionFileLoader(ext_util.NAME,
+                                                   ext_util.FILEPATH)
+        self.assertEqual(self.loader, other)
+
+    def test_inequality(self):
+        other = self.machinery.ExtensionFileLoader('_' + ext_util.NAME,
+                                                   ext_util.FILEPATH)
+        self.assertNotEqual(self.loader, other)
 
     def test_module(self):
         with util.uncache(ext_util.NAME):
@@ -36,7 +47,7 @@
                 self.assertEqual(getattr(module, attr), value)
             self.assertIn(ext_util.NAME, sys.modules)
             self.assertIsInstance(module.__loader__,
-                                  machinery.ExtensionFileLoader)
+                                  self.machinery.ExtensionFileLoader)
 
     # No extension module as __init__ available for testing.
     test_package = None
@@ -61,16 +72,15 @@
 
     def test_is_package(self):
         self.assertFalse(self.loader.is_package(ext_util.NAME))
-        for suffix in machinery.EXTENSION_SUFFIXES:
+        for suffix in self.machinery.EXTENSION_SUFFIXES:
             path = os.path.join('some', 'path', 'pkg', '__init__' + suffix)
-            loader = machinery.ExtensionFileLoader('pkg', path)
+            loader = self.machinery.ExtensionFileLoader('pkg', path)
             self.assertTrue(loader.is_package('pkg'))
 
+Frozen_LoaderTests, Source_LoaderTests = util.test_both(
+        LoaderTests, machinery=machinery)
 
-def test_main():
-    from test.support import run_unittest
-    run_unittest(LoaderTests)
 
 
 if __name__ == '__main__':
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_importlib/extension/test_path_hook.py b/Lib/test/test_importlib/extension/test_path_hook.py
index 1d969a1..49d6734 100644
--- a/Lib/test/test_importlib/extension/test_path_hook.py
+++ b/Lib/test/test_importlib/extension/test_path_hook.py
@@ -1,32 +1,32 @@
-from importlib import machinery
+from .. import util as test_util
 from . import util
 
+machinery = test_util.import_importlib('importlib.machinery')
+
 import collections
-import imp
 import sys
 import unittest
 
 
-class PathHookTests(unittest.TestCase):
+class PathHookTests:
 
     """Test the path hook for extension modules."""
     # XXX Should it only succeed for pre-existing directories?
     # XXX Should it only work for directories containing an extension module?
 
     def hook(self, entry):
-        return machinery.FileFinder.path_hook((machinery.ExtensionFileLoader,
-            machinery.EXTENSION_SUFFIXES))(entry)
+        return self.machinery.FileFinder.path_hook(
+                (self.machinery.ExtensionFileLoader,
+                 self.machinery.EXTENSION_SUFFIXES))(entry)
 
     def test_success(self):
         # Path hook should handle a directory where a known extension module
         # exists.
         self.assertTrue(hasattr(self.hook(util.PATH), 'find_module'))
 
-
-def test_main():
-    from test.support import run_unittest
-    run_unittest(PathHookTests)
+Frozen_PathHooksTests, Source_PathHooksTests = test_util.test_both(
+        PathHookTests, machinery=machinery)
 
 
 if __name__ == '__main__':
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_importlib/extension/util.py b/Lib/test/test_importlib/extension/util.py
index a266dd9..8d089f0 100644
--- a/Lib/test/test_importlib/extension/util.py
+++ b/Lib/test/test_importlib/extension/util.py
@@ -1,4 +1,3 @@
-import imp
 from importlib import machinery
 import os
 import sys
diff --git a/Lib/test/test_importlib/frozen/__init__.py b/Lib/test/test_importlib/frozen/__init__.py
index 9ef103b..4b16ecc 100644
--- a/Lib/test/test_importlib/frozen/__init__.py
+++ b/Lib/test/test_importlib/frozen/__init__.py
@@ -1,13 +1,5 @@
-from .. import test_suite
-import os.path
-import unittest
+import os
+from test.support import load_package_tests
 
-
-def test_suite():
-    directory = os.path.dirname(__file__)
-    return test_suite('importlib.test.frozen', directory)
-
-
-if __name__ == '__main__':
-    from test.support import run_unittest
-    run_unittest(test_suite())
+def load_tests(*args):
+    return load_package_tests(os.path.dirname(__file__), *args)
diff --git a/Lib/test/test_importlib/frozen/__main__.py b/Lib/test/test_importlib/frozen/__main__.py
new file mode 100644
index 0000000..40a23a2
--- /dev/null
+++ b/Lib/test/test_importlib/frozen/__main__.py
@@ -0,0 +1,4 @@
+from . import load_tests
+import unittest
+
+unittest.main()
diff --git a/Lib/test/test_importlib/frozen/test_finder.py b/Lib/test/test_importlib/frozen/test_finder.py
index f0abe0e..f9f97f3 100644
--- a/Lib/test/test_importlib/frozen/test_finder.py
+++ b/Lib/test/test_importlib/frozen/test_finder.py
@@ -1,15 +1,52 @@
-from importlib import machinery
 from .. import abc
+from .. import util
+
+machinery = util.import_importlib('importlib.machinery')
 
 import unittest
 
 
+class FindSpecTests(abc.FinderTests):
+
+    """Test finding frozen modules."""
+
+    def find(self, name, path=None):
+        finder = self.machinery.FrozenImporter
+        return finder.find_spec(name, path)
+
+    def test_module(self):
+        name = '__hello__'
+        spec = self.find(name)
+        self.assertEqual(spec.origin, 'frozen')
+
+    def test_package(self):
+        spec = self.find('__phello__')
+        self.assertIsNotNone(spec)
+
+    def test_module_in_package(self):
+        spec = self.find('__phello__.spam', ['__phello__'])
+        self.assertIsNotNone(spec)
+
+    # No frozen package within another package to test with.
+    test_package_in_package = None
+
+    # No easy way to test.
+    test_package_over_module = None
+
+    def test_failure(self):
+        spec = self.find('<not real>')
+        self.assertIsNone(spec)
+
+Frozen_FindSpecTests, Source_FindSpecTests = util.test_both(FindSpecTests,
+                                                            machinery=machinery)
+
+
 class FinderTests(abc.FinderTests):
 
     """Test finding frozen modules."""
 
     def find(self, name, path=None):
-        finder = machinery.FrozenImporter
+        finder = self.machinery.FrozenImporter
         return finder.find_module(name, path)
 
     def test_module(self):
@@ -35,11 +72,9 @@
         loader = self.find('<not real>')
         self.assertIsNone(loader)
 
-
-def test_main():
-    from test.support import run_unittest
-    run_unittest(FinderTests)
+Frozen_FinderTests, Source_FinderTests = util.test_both(FinderTests,
+                                                        machinery=machinery)
 
 
 if __name__ == '__main__':
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_importlib/frozen/test_loader.py b/Lib/test/test_importlib/frozen/test_loader.py
index f3a8bf6..7c01464 100644
--- a/Lib/test/test_importlib/frozen/test_loader.py
+++ b/Lib/test/test_importlib/frozen/test_loader.py
@@ -1,18 +1,104 @@
-from importlib import machinery
-import imp
-import unittest
 from .. import abc
 from .. import util
+
+machinery = util.import_importlib('importlib.machinery')
+
+
+import sys
 from test.support import captured_stdout
+import types
+import unittest
+import warnings
+
+
+class ExecModuleTests(abc.LoaderTests):
+
+    def exec_module(self, name):
+        with util.uncache(name), captured_stdout() as stdout:
+            spec = self.machinery.ModuleSpec(
+                    name, self.machinery.FrozenImporter, origin='frozen',
+                    is_package=self.machinery.FrozenImporter.is_package(name))
+            module = types.ModuleType(name)
+            module.__spec__ = spec
+            assert not hasattr(module, 'initialized')
+            self.machinery.FrozenImporter.exec_module(module)
+            self.assertTrue(module.initialized)
+            self.assertTrue(hasattr(module, '__spec__'))
+            self.assertEqual(module.__spec__.origin, 'frozen')
+            return module, stdout.getvalue()
+
+    def test_module(self):
+        name = '__hello__'
+        module, output = self.exec_module(name)
+        check = {'__name__': name}
+        for attr, value in check.items():
+            self.assertEqual(getattr(module, attr), value)
+        self.assertEqual(output, 'Hello world!\n')
+        self.assertTrue(hasattr(module, '__spec__'))
+
+    def test_package(self):
+        name = '__phello__'
+        module, output = self.exec_module(name)
+        check = {'__name__': name}
+        for attr, value in check.items():
+            attr_value = getattr(module, attr)
+            self.assertEqual(attr_value, value,
+                        'for {name}.{attr}, {given!r} != {expected!r}'.format(
+                                 name=name, attr=attr, given=attr_value,
+                                 expected=value))
+        self.assertEqual(output, 'Hello world!\n')
+
+    def test_lacking_parent(self):
+        name = '__phello__.spam'
+        with util.uncache('__phello__'):
+            module, output = self.exec_module(name)
+            check = {'__name__': name}
+            for attr, value in check.items():
+                attr_value = getattr(module, attr)
+                self.assertEqual(attr_value, value,
+                        'for {name}.{attr}, {given} != {expected!r}'.format(
+                                 name=name, attr=attr, given=attr_value,
+                                 expected=value))
+            self.assertEqual(output, 'Hello world!\n')
+
+    def test_module_repr(self):
+        name = '__hello__'
+        module, output = self.exec_module(name)
+        with warnings.catch_warnings():
+            warnings.simplefilter('ignore', DeprecationWarning)
+            repr_str = self.machinery.FrozenImporter.module_repr(module)
+        self.assertEqual(repr_str,
+                         "<module '__hello__' (frozen)>")
+
+    def test_module_repr_indirect(self):
+        name = '__hello__'
+        module, output = self.exec_module(name)
+        self.assertEqual(repr(module),
+                         "<module '__hello__' (frozen)>")
+
+    # No way to trigger an error in a frozen module.
+    test_state_after_failure = None
+
+    def test_unloadable(self):
+        assert self.machinery.FrozenImporter.find_module('_not_real') is None
+        with self.assertRaises(ImportError) as cm:
+            self.exec_module('_not_real')
+        self.assertEqual(cm.exception.name, '_not_real')
+
+Frozen_ExecModuleTests, Source_ExecModuleTests = util.test_both(ExecModuleTests,
+                                                        machinery=machinery)
+
 
 class LoaderTests(abc.LoaderTests):
 
     def test_module(self):
         with util.uncache('__hello__'), captured_stdout() as stdout:
-            module = machinery.FrozenImporter.load_module('__hello__')
+            with warnings.catch_warnings():
+                warnings.simplefilter('ignore', DeprecationWarning)
+                module = self.machinery.FrozenImporter.load_module('__hello__')
             check = {'__name__': '__hello__',
                     '__package__': '',
-                    '__loader__': machinery.FrozenImporter,
+                    '__loader__': self.machinery.FrozenImporter,
                     }
             for attr, value in check.items():
                 self.assertEqual(getattr(module, attr), value)
@@ -21,11 +107,13 @@
 
     def test_package(self):
         with util.uncache('__phello__'),  captured_stdout() as stdout:
-            module = machinery.FrozenImporter.load_module('__phello__')
+            with warnings.catch_warnings():
+                warnings.simplefilter('ignore', DeprecationWarning)
+                module = self.machinery.FrozenImporter.load_module('__phello__')
             check = {'__name__': '__phello__',
                      '__package__': '__phello__',
-                     '__path__': ['__phello__'],
-                     '__loader__': machinery.FrozenImporter,
+                     '__path__': [],
+                     '__loader__': self.machinery.FrozenImporter,
                      }
             for attr, value in check.items():
                 attr_value = getattr(module, attr)
@@ -38,10 +126,12 @@
     def test_lacking_parent(self):
         with util.uncache('__phello__', '__phello__.spam'), \
              captured_stdout() as stdout:
-            module = machinery.FrozenImporter.load_module('__phello__.spam')
+            with warnings.catch_warnings():
+                warnings.simplefilter('ignore', DeprecationWarning)
+                module = self.machinery.FrozenImporter.load_module('__phello__.spam')
             check = {'__name__': '__phello__.spam',
                     '__package__': '__phello__',
-                    '__loader__': machinery.FrozenImporter,
+                    '__loader__': self.machinery.FrozenImporter,
                     }
             for attr, value in check.items():
                 attr_value = getattr(module, attr)
@@ -53,29 +143,43 @@
 
     def test_module_reuse(self):
         with util.uncache('__hello__'), captured_stdout() as stdout:
-            module1 = machinery.FrozenImporter.load_module('__hello__')
-            module2 = machinery.FrozenImporter.load_module('__hello__')
+            with warnings.catch_warnings():
+                warnings.simplefilter('ignore', DeprecationWarning)
+                module1 = self.machinery.FrozenImporter.load_module('__hello__')
+                module2 = self.machinery.FrozenImporter.load_module('__hello__')
             self.assertIs(module1, module2)
             self.assertEqual(stdout.getvalue(),
                              'Hello world!\nHello world!\n')
 
     def test_module_repr(self):
         with util.uncache('__hello__'), captured_stdout():
-            module = machinery.FrozenImporter.load_module('__hello__')
-            self.assertEqual(repr(module),
+            with warnings.catch_warnings():
+                warnings.simplefilter('ignore', DeprecationWarning)
+                module = self.machinery.FrozenImporter.load_module('__hello__')
+                repr_str = self.machinery.FrozenImporter.module_repr(module)
+            self.assertEqual(repr_str,
                              "<module '__hello__' (frozen)>")
 
+    def test_module_repr_indirect(self):
+        with util.uncache('__hello__'), captured_stdout():
+            module = self.machinery.FrozenImporter.load_module('__hello__')
+        self.assertEqual(repr(module),
+                         "<module '__hello__' (frozen)>")
+
     # No way to trigger an error in a frozen module.
     test_state_after_failure = None
 
     def test_unloadable(self):
-        assert machinery.FrozenImporter.find_module('_not_real') is None
+        assert self.machinery.FrozenImporter.find_module('_not_real') is None
         with self.assertRaises(ImportError) as cm:
-            machinery.FrozenImporter.load_module('_not_real')
+            self.machinery.FrozenImporter.load_module('_not_real')
         self.assertEqual(cm.exception.name, '_not_real')
 
+Frozen_LoaderTests, Source_LoaderTests = util.test_both(LoaderTests,
+                                                        machinery=machinery)
 
-class InspectLoaderTests(unittest.TestCase):
+
+class InspectLoaderTests:
 
     """Tests for the InspectLoader methods for FrozenImporter."""
 
@@ -83,15 +187,15 @@
         # Make sure that the code object is good.
         name = '__hello__'
         with captured_stdout() as stdout:
-            code = machinery.FrozenImporter.get_code(name)
-            mod = imp.new_module(name)
+            code = self.machinery.FrozenImporter.get_code(name)
+            mod = types.ModuleType(name)
             exec(code, mod.__dict__)
             self.assertTrue(hasattr(mod, 'initialized'))
             self.assertEqual(stdout.getvalue(), 'Hello world!\n')
 
     def test_get_source(self):
         # Should always return None.
-        result = machinery.FrozenImporter.get_source('__hello__')
+        result = self.machinery.FrozenImporter.get_source('__hello__')
         self.assertIsNone(result)
 
     def test_is_package(self):
@@ -99,22 +203,20 @@
         test_for = (('__hello__', False), ('__phello__', True),
                     ('__phello__.spam', False))
         for name, is_package in test_for:
-            result = machinery.FrozenImporter.is_package(name)
+            result = self.machinery.FrozenImporter.is_package(name)
             self.assertEqual(bool(result), is_package)
 
     def test_failure(self):
         # Raise ImportError for modules that are not frozen.
         for meth_name in ('get_code', 'get_source', 'is_package'):
-            method = getattr(machinery.FrozenImporter, meth_name)
+            method = getattr(self.machinery.FrozenImporter, meth_name)
             with self.assertRaises(ImportError) as cm:
                 method('importlib')
             self.assertEqual(cm.exception.name, 'importlib')
 
-
-def test_main():
-    from test.support import run_unittest
-    run_unittest(LoaderTests, InspectLoaderTests)
+Frozen_ILTests, Source_ILTests = util.test_both(InspectLoaderTests,
+                                                machinery=machinery)
 
 
 if __name__ == '__main__':
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_importlib/import_/__init__.py b/Lib/test/test_importlib/import_/__init__.py
index 366e531..4b16ecc 100644
--- a/Lib/test/test_importlib/import_/__init__.py
+++ b/Lib/test/test_importlib/import_/__init__.py
@@ -1,13 +1,5 @@
-from .. import test_suite
-import os.path
-import unittest
+import os
+from test.support import load_package_tests
 
-
-def test_suite():
-    directory = os.path.dirname(__file__)
-    return test_suite('importlib.test.import_', directory)
-
-
-if __name__ == '__main__':
-    from test.support import run_unittest
-    run_unittest(test_suite())
+def load_tests(*args):
+    return load_package_tests(os.path.dirname(__file__), *args)
diff --git a/Lib/test/test_importlib/import_/__main__.py b/Lib/test/test_importlib/import_/__main__.py
new file mode 100644
index 0000000..40a23a2
--- /dev/null
+++ b/Lib/test/test_importlib/import_/__main__.py
@@ -0,0 +1,4 @@
+from . import load_tests
+import unittest
+
+unittest.main()
diff --git a/Lib/test/test_importlib/import_/test___loader__.py b/Lib/test/test_importlib/import_/test___loader__.py
new file mode 100644
index 0000000..6df8010
--- /dev/null
+++ b/Lib/test/test_importlib/import_/test___loader__.py
@@ -0,0 +1,70 @@
+from importlib import machinery
+import sys
+import types
+import unittest
+
+from .. import util
+from . import util as import_util
+
+
+class SpecLoaderMock:
+
+    def find_spec(self, fullname, path=None, target=None):
+        return machinery.ModuleSpec(fullname, self)
+
+    def exec_module(self, module):
+        pass
+
+
+class SpecLoaderAttributeTests:
+
+    def test___loader__(self):
+        loader = SpecLoaderMock()
+        with util.uncache('blah'), util.import_state(meta_path=[loader]):
+            module = self.__import__('blah')
+        self.assertEqual(loader, module.__loader__)
+
+Frozen_SpecTests, Source_SpecTests = util.test_both(
+        SpecLoaderAttributeTests, __import__=import_util.__import__)
+
+
+class LoaderMock:
+
+    def find_module(self, fullname, path=None):
+        return self
+
+    def load_module(self, fullname):
+        sys.modules[fullname] = self.module
+        return self.module
+
+
+class LoaderAttributeTests:
+
+    def test___loader___missing(self):
+        module = types.ModuleType('blah')
+        try:
+            del module.__loader__
+        except AttributeError:
+            pass
+        loader = LoaderMock()
+        loader.module = module
+        with util.uncache('blah'), util.import_state(meta_path=[loader]):
+            module = self.__import__('blah')
+        self.assertEqual(loader, module.__loader__)
+
+    def test___loader___is_None(self):
+        module = types.ModuleType('blah')
+        module.__loader__ = None
+        loader = LoaderMock()
+        loader.module = module
+        with util.uncache('blah'), util.import_state(meta_path=[loader]):
+            returned_module = self.__import__('blah')
+        self.assertEqual(loader, module.__loader__)
+
+
+Frozen_Tests, Source_Tests = util.test_both(LoaderAttributeTests,
+                                            __import__=import_util.__import__)
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Lib/test/test_importlib/import_/test___package__.py b/Lib/test/test_importlib/import_/test___package__.py
index 783cde1..2e19725 100644
--- a/Lib/test/test_importlib/import_/test___package__.py
+++ b/Lib/test/test_importlib/import_/test___package__.py
@@ -9,7 +9,7 @@
 from . import util as import_util
 
 
-class Using__package__(unittest.TestCase):
+class Using__package__:
 
     """Use of __package__ supercedes the use of __name__/__path__ to calculate
     what package a module belongs to. The basic algorithm is [__package__]::
@@ -36,10 +36,10 @@
 
     def test_using___package__(self):
         # [__package__]
-        with util.mock_modules('pkg.__init__', 'pkg.fake') as importer:
+        with self.mock_modules('pkg.__init__', 'pkg.fake') as importer:
             with util.import_state(meta_path=[importer]):
-                import_util.import_('pkg.fake')
-                module = import_util.import_('',
+                self.__import__('pkg.fake')
+                module = self.__import__('',
                                             globals={'__package__': 'pkg.fake'},
                                             fromlist=['attr'], level=2)
         self.assertEqual(module.__name__, 'pkg')
@@ -49,10 +49,10 @@
         globals_ = {'__name__': 'pkg.fake', '__path__': []}
         if package_as_None:
             globals_['__package__'] = None
-        with util.mock_modules('pkg.__init__', 'pkg.fake') as importer:
+        with self.mock_modules('pkg.__init__', 'pkg.fake') as importer:
             with util.import_state(meta_path=[importer]):
-                import_util.import_('pkg.fake')
-                module = import_util.import_('', globals= globals_,
+                self.__import__('pkg.fake')
+                module = self.__import__('', globals= globals_,
                                                 fromlist=['attr'], level=2)
             self.assertEqual(module.__name__, 'pkg')
 
@@ -63,16 +63,27 @@
     def test_bad__package__(self):
         globals = {'__package__': '<not real>'}
         with self.assertRaises(SystemError):
-            import_util.import_('', globals, {}, ['relimport'], 1)
+            self.__import__('', globals, {}, ['relimport'], 1)
 
     def test_bunk__package__(self):
         globals = {'__package__': 42}
         with self.assertRaises(TypeError):
-            import_util.import_('', globals, {}, ['relimport'], 1)
+            self.__import__('', globals, {}, ['relimport'], 1)
+
+class Using__package__PEP302(Using__package__):
+    mock_modules = util.mock_modules
+
+Frozen_UsingPackagePEP302, Source_UsingPackagePEP302 = util.test_both(
+        Using__package__PEP302, __import__=import_util.__import__)
+
+class Using__package__PEP302(Using__package__):
+    mock_modules = util.mock_spec
+
+Frozen_UsingPackagePEP451, Source_UsingPackagePEP451 = util.test_both(
+        Using__package__PEP302, __import__=import_util.__import__)
 
 
-@import_util.importlib_only
-class Setting__package__(unittest.TestCase):
+class Setting__package__:
 
     """Because __package__ is a new feature, it is not always set by a loader.
     Import will set it as needed to help with the transition to relying on
@@ -84,36 +95,39 @@
 
     """
 
+    __import__ = import_util.__import__[1]
+
     # [top-level]
     def test_top_level(self):
-        with util.mock_modules('top_level') as mock:
+        with self.mock_modules('top_level') as mock:
             with util.import_state(meta_path=[mock]):
                 del mock['top_level'].__package__
-                module = import_util.import_('top_level')
+                module = self.__import__('top_level')
                 self.assertEqual(module.__package__, '')
 
     # [package]
     def test_package(self):
-        with util.mock_modules('pkg.__init__') as mock:
+        with self.mock_modules('pkg.__init__') as mock:
             with util.import_state(meta_path=[mock]):
                 del mock['pkg'].__package__
-                module = import_util.import_('pkg')
+                module = self.__import__('pkg')
                 self.assertEqual(module.__package__, 'pkg')
 
     # [submodule]
     def test_submodule(self):
-        with util.mock_modules('pkg.__init__', 'pkg.mod') as mock:
+        with self.mock_modules('pkg.__init__', 'pkg.mod') as mock:
             with util.import_state(meta_path=[mock]):
                 del mock['pkg.mod'].__package__
-                pkg = import_util.import_('pkg.mod')
+                pkg = self.__import__('pkg.mod')
                 module = getattr(pkg, 'mod')
                 self.assertEqual(module.__package__, 'pkg')
 
+class Setting__package__PEP302(Setting__package__, unittest.TestCase):
+    mock_modules = util.mock_modules
 
-def test_main():
-    from test.support import run_unittest
-    run_unittest(Using__package__, Setting__package__)
+class Setting__package__PEP451(Setting__package__, unittest.TestCase):
+    mock_modules = util.mock_spec
 
 
 if __name__ == '__main__':
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_importlib/import_/test_api.py b/Lib/test/test_importlib/import_/test_api.py
index 3d4cd94..439c105 100644
--- a/Lib/test/test_importlib/import_/test_api.py
+++ b/Lib/test/test_importlib/import_/test_api.py
@@ -1,23 +1,41 @@
-from .. import util as importlib_test_util
-from . import util
-import imp
+from .. import util
+from . import util as import_util
+
+from importlib import machinery
 import sys
+import types
 import unittest
 
+PKG_NAME = 'fine'
+SUBMOD_NAME = 'fine.bogus'
 
-class BadLoaderFinder:
-    bad = 'fine.bogus'
+
+class BadSpecFinderLoader:
     @classmethod
-    def find_module(cls, fullname, path):
-        if fullname == cls.bad:
-            return cls
-    @classmethod
-    def load_module(cls, fullname):
-        if fullname == cls.bad:
+    def find_spec(cls, fullname, path=None, target=None):
+        if fullname == SUBMOD_NAME:
+            spec = machinery.ModuleSpec(fullname, cls)
+            return spec
+
+    @staticmethod
+    def exec_module(module):
+        if module.__name__ == SUBMOD_NAME:
             raise ImportError('I cannot be loaded!')
 
 
-class APITest(unittest.TestCase):
+class BadLoaderFinder:
+    @classmethod
+    def find_module(cls, fullname, path):
+        if fullname == SUBMOD_NAME:
+            return cls
+
+    @classmethod
+    def load_module(cls, fullname):
+        if fullname == SUBMOD_NAME:
+            raise ImportError('I cannot be loaded!')
+
+
+class APITest:
 
     """Test API-specific details for __import__ (e.g. raising the right
     exception when passing in an int for the module name)."""
@@ -25,43 +43,52 @@
     def test_name_requires_rparition(self):
         # Raise TypeError if a non-string is passed in for the module name.
         with self.assertRaises(TypeError):
-            util.import_(42)
+            self.__import__(42)
 
     def test_negative_level(self):
         # Raise ValueError when a negative level is specified.
         # PEP 328 did away with sys.module None entries and the ambiguity of
         # absolute/relative imports.
         with self.assertRaises(ValueError):
-            util.import_('os', globals(), level=-1)
+            self.__import__('os', globals(), level=-1)
 
     def test_nonexistent_fromlist_entry(self):
         # If something in fromlist doesn't exist, that's okay.
         # issue15715
-        mod = imp.new_module('fine')
+        mod = types.ModuleType(PKG_NAME)
         mod.__path__ = ['XXX']
-        with importlib_test_util.import_state(meta_path=[BadLoaderFinder]):
-            with importlib_test_util.uncache('fine'):
-                sys.modules['fine'] = mod
-                util.import_('fine', fromlist=['not here'])
+        with util.import_state(meta_path=[self.bad_finder_loader]):
+            with util.uncache(PKG_NAME):
+                sys.modules[PKG_NAME] = mod
+                self.__import__(PKG_NAME, fromlist=['not here'])
 
     def test_fromlist_load_error_propagates(self):
         # If something in fromlist triggers an exception not related to not
         # existing, let that exception propagate.
         # issue15316
-        mod = imp.new_module('fine')
+        mod = types.ModuleType(PKG_NAME)
         mod.__path__ = ['XXX']
-        with importlib_test_util.import_state(meta_path=[BadLoaderFinder]):
-            with importlib_test_util.uncache('fine'):
-                sys.modules['fine'] = mod
+        with util.import_state(meta_path=[self.bad_finder_loader]):
+            with util.uncache(PKG_NAME):
+                sys.modules[PKG_NAME] = mod
                 with self.assertRaises(ImportError):
-                    util.import_('fine', fromlist=['bogus'])
+                    self.__import__(PKG_NAME,
+                                    fromlist=[SUBMOD_NAME.rpartition('.')[-1]])
 
 
+class OldAPITests(APITest):
+    bad_finder_loader = BadLoaderFinder
 
-def test_main():
-    from test.support import run_unittest
-    run_unittest(APITest)
+Frozen_OldAPITests, Source_OldAPITests = util.test_both(
+        OldAPITests, __import__=import_util.__import__)
+
+
+class SpecAPITests(APITest):
+    bad_finder_loader = BadSpecFinderLoader
+
+Frozen_SpecAPITests, Source_SpecAPITests = util.test_both(
+        SpecAPITests, __import__=import_util.__import__)
 
 
 if __name__ == '__main__':
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_importlib/import_/test_caching.py b/Lib/test/test_importlib/import_/test_caching.py
index 207378a..c292ee4 100644
--- a/Lib/test/test_importlib/import_/test_caching.py
+++ b/Lib/test/test_importlib/import_/test_caching.py
@@ -6,7 +6,7 @@
 import unittest
 
 
-class UseCache(unittest.TestCase):
+class UseCache:
 
     """When it comes to sys.modules, import prefers it over anything else.
 
@@ -21,12 +21,13 @@
     ImportError is raised [None in cache].
 
     """
+
     def test_using_cache(self):
         # [use cache]
         module_to_use = "some module found!"
         with util.uncache('some_module'):
             sys.modules['some_module'] = module_to_use
-            module = import_util.import_('some_module')
+            module = self.__import__('some_module')
             self.assertEqual(id(module_to_use), id(module))
 
     def test_None_in_cache(self):
@@ -35,9 +36,19 @@
         with util.uncache(name):
             sys.modules[name] = None
             with self.assertRaises(ImportError) as cm:
-                import_util.import_(name)
+                self.__import__(name)
             self.assertEqual(cm.exception.name, name)
 
+Frozen_UseCache, Source_UseCache = util.test_both(
+        UseCache, __import__=import_util.__import__)
+
+
+class ImportlibUseCache(UseCache, unittest.TestCase):
+
+    # Pertinent only to PEP 302; exec_module() doesn't return a module.
+
+    __import__ = import_util.__import__[1]
+
     def create_mock(self, *names, return_=None):
         mock = util.mock_modules(*names)
         original_load = mock.load_module
@@ -49,40 +60,33 @@
 
     # __import__ inconsistent between loaders and built-in import when it comes
     #   to when to use the module in sys.modules and when not to.
-    @import_util.importlib_only
     def test_using_cache_after_loader(self):
         # [from cache on return]
         with self.create_mock('module') as mock:
             with util.import_state(meta_path=[mock]):
-                module = import_util.import_('module')
+                module = self.__import__('module')
                 self.assertEqual(id(module), id(sys.modules['module']))
 
     # See test_using_cache_after_loader() for reasoning.
-    @import_util.importlib_only
     def test_using_cache_for_assigning_to_attribute(self):
         # [from cache to attribute]
         with self.create_mock('pkg.__init__', 'pkg.module') as importer:
             with util.import_state(meta_path=[importer]):
-                module = import_util.import_('pkg.module')
+                module = self.__import__('pkg.module')
                 self.assertTrue(hasattr(module, 'module'))
                 self.assertEqual(id(module.module),
                                  id(sys.modules['pkg.module']))
 
     # See test_using_cache_after_loader() for reasoning.
-    @import_util.importlib_only
     def test_using_cache_for_fromlist(self):
         # [from cache for fromlist]
         with self.create_mock('pkg.__init__', 'pkg.module') as importer:
             with util.import_state(meta_path=[importer]):
-                module = import_util.import_('pkg', fromlist=['module'])
+                module = self.__import__('pkg', fromlist=['module'])
                 self.assertTrue(hasattr(module, 'module'))
                 self.assertEqual(id(module.module),
                                  id(sys.modules['pkg.module']))
 
 
-def test_main():
-    from test.support import run_unittest
-    run_unittest(UseCache)
-
 if __name__ == '__main__':
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_importlib/import_/test_fromlist.py b/Lib/test/test_importlib/import_/test_fromlist.py
index c16c337..a755b75 100644
--- a/Lib/test/test_importlib/import_/test_fromlist.py
+++ b/Lib/test/test_importlib/import_/test_fromlist.py
@@ -1,10 +1,10 @@
 """Test that the semantics relating to the 'fromlist' argument are correct."""
 from .. import util
 from . import util as import_util
-import imp
 import unittest
 
-class ReturnValue(unittest.TestCase):
+
+class ReturnValue:
 
     """The use of fromlist influences what import returns.
 
@@ -17,20 +17,23 @@
 
     def test_return_from_import(self):
         # [import return]
-        with util.mock_modules('pkg.__init__', 'pkg.module') as importer:
+        with util.mock_spec('pkg.__init__', 'pkg.module') as importer:
             with util.import_state(meta_path=[importer]):
-                module = import_util.import_('pkg.module')
+                module = self.__import__('pkg.module')
                 self.assertEqual(module.__name__, 'pkg')
 
     def test_return_from_from_import(self):
         # [from return]
         with util.mock_modules('pkg.__init__', 'pkg.module')as importer:
             with util.import_state(meta_path=[importer]):
-                module = import_util.import_('pkg.module', fromlist=['attr'])
+                module = self.__import__('pkg.module', fromlist=['attr'])
                 self.assertEqual(module.__name__, 'pkg.module')
 
+Frozen_ReturnValue, Source_ReturnValue = util.test_both(
+        ReturnValue, __import__=import_util.__import__)
 
-class HandlingFromlist(unittest.TestCase):
+
+class HandlingFromlist:
 
     """Using fromlist triggers different actions based on what is being asked
     of it.
@@ -49,22 +52,22 @@
         # [object case]
         with util.mock_modules('module') as importer:
             with util.import_state(meta_path=[importer]):
-                module = import_util.import_('module', fromlist=['attr'])
+                module = self.__import__('module', fromlist=['attr'])
                 self.assertEqual(module.__name__, 'module')
 
     def test_nonexistent_object(self):
         # [bad object]
         with util.mock_modules('module') as importer:
             with util.import_state(meta_path=[importer]):
-                module = import_util.import_('module', fromlist=['non_existent'])
+                module = self.__import__('module', fromlist=['non_existent'])
                 self.assertEqual(module.__name__, 'module')
-                self.assertTrue(not hasattr(module, 'non_existent'))
+                self.assertFalse(hasattr(module, 'non_existent'))
 
     def test_module_from_package(self):
         # [module]
         with util.mock_modules('pkg.__init__', 'pkg.module') as importer:
             with util.import_state(meta_path=[importer]):
-                module = import_util.import_('pkg', fromlist=['module'])
+                module = self.__import__('pkg', fromlist=['module'])
                 self.assertEqual(module.__name__, 'pkg')
                 self.assertTrue(hasattr(module, 'module'))
                 self.assertEqual(module.module.__name__, 'pkg.module')
@@ -79,13 +82,13 @@
                                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.__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]):
-                module = import_util.import_('pkg.mod', fromlist=[''])
+                module = self.__import__('pkg.mod', fromlist=[''])
                 self.assertEqual(module.__name__, 'pkg.mod')
 
     def basic_star_test(self, fromlist=['*']):
@@ -93,7 +96,7 @@
         with util.mock_modules('pkg.__init__', 'pkg.module') as mock:
             with util.import_state(meta_path=[mock]):
                 mock['pkg'].__all__ = ['module']
-                module = import_util.import_('pkg', fromlist=fromlist)
+                module = self.__import__('pkg', fromlist=fromlist)
                 self.assertEqual(module.__name__, 'pkg')
                 self.assertTrue(hasattr(module, 'module'))
                 self.assertEqual(module.module.__name__, 'pkg.module')
@@ -111,17 +114,16 @@
         with context as mock:
             with util.import_state(meta_path=[mock]):
                 mock['pkg'].__all__ = ['module1']
-                module = import_util.import_('pkg', fromlist=['module2', '*'])
+                module = self.__import__('pkg', fromlist=['module2', '*'])
                 self.assertEqual(module.__name__, 'pkg')
                 self.assertTrue(hasattr(module, 'module1'))
                 self.assertTrue(hasattr(module, 'module2'))
                 self.assertEqual(module.module1.__name__, 'pkg.module1')
                 self.assertEqual(module.module2.__name__, 'pkg.module2')
 
+Frozen_FromList, Source_FromList = util.test_both(
+        HandlingFromlist, __import__=import_util.__import__)
 
-def test_main():
-    from test.support import run_unittest
-    run_unittest(ReturnValue, HandlingFromlist)
 
 if __name__ == '__main__':
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_importlib/import_/test_meta_path.py b/Lib/test/test_importlib/import_/test_meta_path.py
index 4d85f80..5eeb145 100644
--- a/Lib/test/test_importlib/import_/test_meta_path.py
+++ b/Lib/test/test_importlib/import_/test_meta_path.py
@@ -7,7 +7,7 @@
 import warnings
 
 
-class CallingOrder(unittest.TestCase):
+class CallingOrder:
 
     """Calls to the importers on sys.meta_path happen in order that they are
     specified in the sequence, starting with the first importer
@@ -18,23 +18,18 @@
     def test_first_called(self):
         # [first called]
         mod = 'top_level'
-        first = util.mock_modules(mod)
-        second = util.mock_modules(mod)
-        with util.mock_modules(mod) as first, util.mock_modules(mod) as second:
-            first.modules[mod] = 42
-            second.modules[mod] = -13
+        with util.mock_spec(mod) as first, util.mock_spec(mod) as second:
             with util.import_state(meta_path=[first, second]):
-                self.assertEqual(import_util.import_(mod), 42)
+                self.assertIs(self.__import__(mod), first.modules[mod])
 
     def test_continuing(self):
         # [continuing]
         mod_name = 'for_real'
-        with util.mock_modules('nonexistent') as first, \
-             util.mock_modules(mod_name) as second:
-            first.find_module = lambda self, fullname, path=None: None
-            second.modules[mod_name] = 42
+        with util.mock_spec('nonexistent') as first, \
+             util.mock_spec(mod_name) as second:
+            first.find_spec = lambda self, fullname, path=None, parent=None: None
             with util.import_state(meta_path=[first, second]):
-                self.assertEqual(import_util.import_(mod_name), 42)
+                self.assertIs(self.__import__(mod_name), second.modules[mod_name])
 
     def test_empty(self):
         # Raise an ImportWarning if sys.meta_path is empty.
@@ -46,41 +41,42 @@
         with util.import_state(meta_path=[]):
             with warnings.catch_warnings(record=True) as w:
                 warnings.simplefilter('always')
-                self.assertIsNone(importlib._bootstrap._find_module('nothing',
-                                                                    None))
+                self.assertIsNone(importlib._bootstrap._find_spec('nothing',
+                                                                  None))
                 self.assertEqual(len(w), 1)
                 self.assertTrue(issubclass(w[-1].category, ImportWarning))
 
+Frozen_CallingOrder, Source_CallingOrder = util.test_both(
+        CallingOrder, __import__=import_util.__import__)
 
-class CallSignature(unittest.TestCase):
+
+class CallSignature:
 
     """If there is no __path__ entry on the parent module, then 'path' is None
     [no path]. Otherwise, the value for __path__ is passed in for the 'path'
     argument [path set]."""
 
-    def log(self, fxn):
+    def log_finder(self, importer):
+        fxn = getattr(importer, self.finder_name)
         log = []
         def wrapper(self, *args, **kwargs):
             log.append([args, kwargs])
             return fxn(*args, **kwargs)
         return log, wrapper
 
-
     def test_no_path(self):
         # [no path]
         mod_name = 'top_level'
         assert '.' not in mod_name
-        with util.mock_modules(mod_name) as importer:
-            log, wrapped_call = self.log(importer.find_module)
-            importer.find_module = MethodType(wrapped_call, importer)
+        with self.mock_modules(mod_name) as importer:
+            log, wrapped_call = self.log_finder(importer)
+            setattr(importer, self.finder_name, MethodType(wrapped_call, importer))
             with util.import_state(meta_path=[importer]):
-                import_util.import_(mod_name)
+                self.__import__(mod_name)
                 assert len(log) == 1
                 args = log[0][0]
                 kwargs = log[0][1]
                 # Assuming all arguments are positional.
-                self.assertEqual(len(args), 2)
-                self.assertEqual(len(kwargs), 0)
                 self.assertEqual(args[0], mod_name)
                 self.assertIsNone(args[1])
 
@@ -90,26 +86,34 @@
         mod_name = pkg_name + '.module'
         path = [42]
         assert '.' in mod_name
-        with util.mock_modules(pkg_name+'.__init__', mod_name) as importer:
+        with self.mock_modules(pkg_name+'.__init__', mod_name) as importer:
             importer.modules[pkg_name].__path__ = path
-            log, wrapped_call = self.log(importer.find_module)
-            importer.find_module = MethodType(wrapped_call, importer)
+            log, wrapped_call = self.log_finder(importer)
+            setattr(importer, self.finder_name, MethodType(wrapped_call, importer))
             with util.import_state(meta_path=[importer]):
-                import_util.import_(mod_name)
+                self.__import__(mod_name)
                 assert len(log) == 2
                 args = log[1][0]
                 kwargs = log[1][1]
                 # Assuming all arguments are positional.
-                self.assertTrue(not kwargs)
+                self.assertFalse(kwargs)
                 self.assertEqual(args[0], mod_name)
                 self.assertIs(args[1], path)
 
+class CallSignaturePEP302(CallSignature):
+    mock_modules = util.mock_modules
+    finder_name = 'find_module'
 
+Frozen_CallSignaturePEP302, Source_CallSignaturePEP302 = util.test_both(
+        CallSignaturePEP302, __import__=import_util.__import__)
 
-def test_main():
-    from test.support import run_unittest
-    run_unittest(CallingOrder, CallSignature)
+class CallSignaturePEP451(CallSignature):
+    mock_modules = util.mock_spec
+    finder_name = 'find_spec'
+
+Frozen_CallSignaturePEP451, Source_CallSignaturePEP451 = util.test_both(
+        CallSignaturePEP451, __import__=import_util.__import__)
 
 
 if __name__ == '__main__':
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_importlib/import_/test_packages.py b/Lib/test/test_importlib/import_/test_packages.py
index bfa18dc..55a5d14 100644
--- a/Lib/test/test_importlib/import_/test_packages.py
+++ b/Lib/test/test_importlib/import_/test_packages.py
@@ -6,37 +6,37 @@
 from test import support
 
 
-class ParentModuleTests(unittest.TestCase):
+class ParentModuleTests:
 
     """Importing a submodule should import the parent modules."""
 
     def test_import_parent(self):
-        with util.mock_modules('pkg.__init__', 'pkg.module') as mock:
+        with util.mock_spec('pkg.__init__', 'pkg.module') as mock:
             with util.import_state(meta_path=[mock]):
-                module = import_util.import_('pkg.module')
+                module = self.__import__('pkg.module')
                 self.assertIn('pkg', sys.modules)
 
     def test_bad_parent(self):
-        with util.mock_modules('pkg.module') as mock:
+        with util.mock_spec('pkg.module') as mock:
             with util.import_state(meta_path=[mock]):
                 with self.assertRaises(ImportError) as cm:
-                    import_util.import_('pkg.module')
+                    self.__import__('pkg.module')
                 self.assertEqual(cm.exception.name, 'pkg')
 
     def test_raising_parent_after_importing_child(self):
         def __init__():
             import pkg.module
             1/0
-        mock = util.mock_modules('pkg.__init__', 'pkg.module',
+        mock = util.mock_spec('pkg.__init__', 'pkg.module',
                                  module_code={'pkg': __init__})
         with mock:
             with util.import_state(meta_path=[mock]):
                 with self.assertRaises(ZeroDivisionError):
-                    import_util.import_('pkg')
+                    self.__import__('pkg')
                 self.assertNotIn('pkg', sys.modules)
                 self.assertIn('pkg.module', sys.modules)
                 with self.assertRaises(ZeroDivisionError):
-                    import_util.import_('pkg.module')
+                    self.__import__('pkg.module')
                 self.assertNotIn('pkg', sys.modules)
                 self.assertIn('pkg.module', sys.modules)
 
@@ -44,17 +44,17 @@
         def __init__():
             from . import module
             1/0
-        mock = util.mock_modules('pkg.__init__', 'pkg.module',
+        mock = util.mock_spec('pkg.__init__', 'pkg.module',
                                  module_code={'pkg': __init__})
         with mock:
             with util.import_state(meta_path=[mock]):
                 with self.assertRaises((ZeroDivisionError, ImportError)):
                     # This raises ImportError on the "from . import module"
                     # line, not sure why.
-                    import_util.import_('pkg')
+                    self.__import__('pkg')
                 self.assertNotIn('pkg', sys.modules)
                 with self.assertRaises((ZeroDivisionError, ImportError)):
-                    import_util.import_('pkg.module')
+                    self.__import__('pkg.module')
                 self.assertNotIn('pkg', sys.modules)
                 # XXX False
                 #self.assertIn('pkg.module', sys.modules)
@@ -63,7 +63,7 @@
         def __init__():
             from ..subpkg import module
             1/0
-        mock = util.mock_modules('pkg.__init__', 'pkg.subpkg.__init__',
+        mock = util.mock_spec('pkg.__init__', 'pkg.subpkg.__init__',
                                  'pkg.subpkg.module',
                                  module_code={'pkg.subpkg': __init__})
         with mock:
@@ -71,10 +71,10 @@
                 with self.assertRaises((ZeroDivisionError, ImportError)):
                     # This raises ImportError on the "from ..subpkg import module"
                     # line, not sure why.
-                    import_util.import_('pkg.subpkg')
+                    self.__import__('pkg.subpkg')
                 self.assertNotIn('pkg.subpkg', sys.modules)
                 with self.assertRaises((ZeroDivisionError, ImportError)):
-                    import_util.import_('pkg.subpkg.module')
+                    self.__import__('pkg.subpkg.module')
                 self.assertNotIn('pkg.subpkg', sys.modules)
                 # XXX False
                 #self.assertIn('pkg.subpkg.module', sys.modules)
@@ -83,7 +83,7 @@
         # Try to import a submodule from a non-package should raise ImportError.
         assert not hasattr(sys, '__path__')
         with self.assertRaises(ImportError) as cm:
-            import_util.import_('sys.no_submodules_here')
+            self.__import__('sys.no_submodules_here')
         self.assertEqual(cm.exception.name, 'sys.no_submodules_here')
 
     def test_module_not_package_but_side_effects(self):
@@ -93,20 +93,18 @@
         subname = name + '.b'
         def module_injection():
             sys.modules[subname] = 'total bunk'
-        mock_modules = util.mock_modules('mod',
+        mock_spec = util.mock_spec('mod',
                                          module_code={'mod': module_injection})
-        with mock_modules as mock:
+        with mock_spec as mock:
             with util.import_state(meta_path=[mock]):
                 try:
-                    submodule = import_util.import_(subname)
+                    submodule = self.__import__(subname)
                 finally:
                     support.unload(subname)
 
-
-def test_main():
-    from test.support import run_unittest
-    run_unittest(ParentModuleTests)
+Frozen_ParentTests, Source_ParentTests = util.test_both(
+        ParentModuleTests, __import__=import_util.__import__)
 
 
 if __name__ == '__main__':
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_importlib/import_/test_path.py b/Lib/test/test_importlib/import_/test_path.py
index d82b7f6..1274f8c 100644
--- a/Lib/test/test_importlib/import_/test_path.py
+++ b/Lib/test/test_importlib/import_/test_path.py
@@ -1,8 +1,9 @@
-from importlib import _bootstrap
-from importlib import machinery
-from importlib import import_module
 from .. import util
 from . import util as import_util
+
+importlib = util.import_importlib('importlib')
+machinery = util.import_importlib('importlib.machinery')
+
 import os
 import sys
 from types import ModuleType
@@ -11,25 +12,25 @@
 import zipimport
 
 
-class FinderTests(unittest.TestCase):
+class FinderTests:
 
     """Tests for PathFinder."""
 
     def test_failure(self):
-        # Test None returned upon not finding a suitable finder.
+        # Test None returned upon not finding a suitable loader.
         module = '<test module>'
         with util.import_state():
-            self.assertIsNone(machinery.PathFinder.find_module(module))
+            self.assertIsNone(self.machinery.PathFinder.find_module(module))
 
     def test_sys_path(self):
         # Test that sys.path is used when 'path' is None.
         # Implicitly tests that sys.path_importer_cache is used.
         module = '<test module>'
         path = '<test path>'
-        importer = util.mock_modules(module)
+        importer = util.mock_spec(module)
         with util.import_state(path_importer_cache={path: importer},
                                path=[path]):
-            loader = machinery.PathFinder.find_module(module)
+            loader = self.machinery.PathFinder.find_module(module)
             self.assertIs(loader, importer)
 
     def test_path(self):
@@ -37,29 +38,29 @@
         # Implicitly tests that sys.path_importer_cache is used.
         module = '<test module>'
         path = '<test path>'
-        importer = util.mock_modules(module)
+        importer = util.mock_spec(module)
         with util.import_state(path_importer_cache={path: importer}):
-            loader = machinery.PathFinder.find_module(module, [path])
+            loader = self.machinery.PathFinder.find_module(module, [path])
             self.assertIs(loader, importer)
 
     def test_empty_list(self):
         # An empty list should not count as asking for sys.path.
         module = 'module'
         path = '<test path>'
-        importer = util.mock_modules(module)
+        importer = util.mock_spec(module)
         with util.import_state(path_importer_cache={path: importer},
                                path=[path]):
-            self.assertIsNone(machinery.PathFinder.find_module('module', []))
+            self.assertIsNone(self.machinery.PathFinder.find_module('module', []))
 
     def test_path_hooks(self):
         # Test that sys.path_hooks is used.
         # Test that sys.path_importer_cache is set.
         module = '<test module>'
         path = '<test path>'
-        importer = util.mock_modules(module)
+        importer = util.mock_spec(module)
         hook = import_util.mock_path_hook(path, importer=importer)
         with util.import_state(path_hooks=[hook]):
-            loader = machinery.PathFinder.find_module(module, [path])
+            loader = self.machinery.PathFinder.find_module(module, [path])
             self.assertIs(loader, importer)
             self.assertIn(path, sys.path_importer_cache)
             self.assertIs(sys.path_importer_cache[path], importer)
@@ -72,7 +73,7 @@
                                path=[path_entry]):
             with warnings.catch_warnings(record=True) as w:
                 warnings.simplefilter('always')
-                self.assertIsNone(machinery.PathFinder.find_module('os'))
+                self.assertIsNone(self.machinery.PathFinder.find_module('os'))
                 self.assertIsNone(sys.path_importer_cache[path_entry])
                 self.assertEqual(len(w), 1)
                 self.assertTrue(issubclass(w[-1].category, ImportWarning))
@@ -81,12 +82,12 @@
         # The empty string should create a finder using the cwd.
         path = ''
         module = '<test module>'
-        importer = util.mock_modules(module)
-        hook = import_util.mock_path_hook(os.curdir, importer=importer)
+        importer = util.mock_spec(module)
+        hook = import_util.mock_path_hook(os.getcwd(), importer=importer)
         with util.import_state(path=[path], path_hooks=[hook]):
-            loader = machinery.PathFinder.find_module(module)
+            loader = self.machinery.PathFinder.find_module(module)
             self.assertIs(loader, importer)
-            self.assertIn(os.curdir, sys.path_importer_cache)
+            self.assertIn(os.getcwd(), sys.path_importer_cache)
 
     def test_None_on_sys_path(self):
         # Putting None in sys.path[0] caused an import regression from Python
@@ -96,8 +97,8 @@
         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())]
+                          self.machinery.FileFinder.path_hook(
+                              *self.importlib._bootstrap._get_supported_file_loaders())]
         missing = object()
         email = sys.modules.pop('email', missing)
         try:
@@ -105,16 +106,39 @@
                                    path=new_path,
                                    path_importer_cache=new_path_importer_cache,
                                    path_hooks=new_path_hooks):
-                module = import_module('email')
+                module = self.importlib.import_module('email')
                 self.assertIsInstance(module, ModuleType)
         finally:
             if email is not missing:
                 sys.modules['email'] = email
 
+Frozen_FinderTests, Source_FinderTests = util.test_both(
+        FinderTests, importlib=importlib, machinery=machinery)
 
-def test_main():
-    from test.support import run_unittest
-    run_unittest(FinderTests)
+
+class PathEntryFinderTests:
+
+    def test_finder_with_failing_find_module(self):
+        # PathEntryFinder with find_module() defined should work.
+        # Issue #20763.
+        class Finder:
+            path_location = 'test_finder_with_find_module'
+            def __init__(self, path):
+                if path != self.path_location:
+                    raise ImportError
+
+            @staticmethod
+            def find_module(fullname):
+                return None
+
+
+        with util.import_state(path=[Finder.path_location]+sys.path[:],
+                               path_hooks=[Finder]):
+            self.machinery.PathFinder.find_spec('importlib')
+
+Frozen_PEFTests, Source_PEFTests = util.test_both(
+        PathEntryFinderTests, machinery=machinery)
+
 
 if __name__ == '__main__':
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_importlib/import_/test_relative_imports.py b/Lib/test/test_importlib/import_/test_relative_imports.py
index 4569c26..b216e9c 100644
--- a/Lib/test/test_importlib/import_/test_relative_imports.py
+++ b/Lib/test/test_importlib/import_/test_relative_imports.py
@@ -4,7 +4,7 @@
 import sys
 import unittest
 
-class RelativeImports(unittest.TestCase):
+class RelativeImports:
 
     """PEP 328 introduced relative imports. This allows for imports to occur
     from within a package without having to specify the actual package name.
@@ -64,7 +64,7 @@
                 uncache_names.append(name)
             else:
                 uncache_names.append(name[:-len('.__init__')])
-        with util.mock_modules(*create) as importer:
+        with util.mock_spec(*create) as importer:
             with util.import_state(meta_path=[importer]):
                 for global_ in globals_:
                     with util.uncache(*uncache_names):
@@ -76,8 +76,8 @@
         create = 'pkg.__init__', 'pkg.mod2'
         globals_ = {'__package__': 'pkg'}, {'__name__': 'pkg.mod1'}
         def callback(global_):
-            import_util.import_('pkg')  # For __import__().
-            module = import_util.import_('', global_, fromlist=['mod2'], level=1)
+            self.__import__('pkg')  # For __import__().
+            module = self.__import__('', global_, fromlist=['mod2'], level=1)
             self.assertEqual(module.__name__, 'pkg')
             self.assertTrue(hasattr(module, 'mod2'))
             self.assertEqual(module.mod2.attr, 'pkg.mod2')
@@ -88,8 +88,8 @@
         create = 'pkg.__init__', 'pkg.mod2'
         globals_ = {'__package__': 'pkg'}, {'__name__': 'pkg.mod1'}
         def callback(global_):
-            import_util.import_('pkg')  # For __import__().
-            module = import_util.import_('mod2', global_, fromlist=['attr'],
+            self.__import__('pkg')  # For __import__().
+            module = self.__import__('mod2', global_, fromlist=['attr'],
                                             level=1)
             self.assertEqual(module.__name__, 'pkg.mod2')
             self.assertEqual(module.attr, 'pkg.mod2')
@@ -101,8 +101,8 @@
         globals_ = ({'__package__': 'pkg'},
                     {'__name__': 'pkg', '__path__': ['blah']})
         def callback(global_):
-            import_util.import_('pkg')  # For __import__().
-            module = import_util.import_('', global_, fromlist=['module'],
+            self.__import__('pkg')  # For __import__().
+            module = self.__import__('', global_, fromlist=['module'],
                              level=1)
             self.assertEqual(module.__name__, 'pkg')
             self.assertTrue(hasattr(module, 'module'))
@@ -114,8 +114,8 @@
         create = 'pkg.__init__', 'pkg.module'
         globals_ = {'__package__': 'pkg'}, {'__name__': 'pkg.module'}
         def callback(global_):
-            import_util.import_('pkg')  # For __import__().
-            module = import_util.import_('', global_, fromlist=['attr'], level=1)
+            self.__import__('pkg')  # For __import__().
+            module = self.__import__('', global_, fromlist=['attr'], level=1)
             self.assertEqual(module.__name__, 'pkg')
         self.relative_import_test(create, globals_, callback)
 
@@ -126,7 +126,7 @@
         globals_ =  ({'__package__': 'pkg.subpkg1'},
                      {'__name__': 'pkg.subpkg1', '__path__': ['blah']})
         def callback(global_):
-            module = import_util.import_('', global_, fromlist=['subpkg2'],
+            module = self.__import__('', global_, fromlist=['subpkg2'],
                                             level=2)
             self.assertEqual(module.__name__, 'pkg')
             self.assertTrue(hasattr(module, 'subpkg2'))
@@ -142,8 +142,8 @@
                     {'__name__': 'pkg.pkg1.pkg2.pkg3.pkg4.pkg5',
                         '__path__': ['blah']})
         def callback(global_):
-            import_util.import_(globals_[0]['__package__'])
-            module = import_util.import_('', global_, fromlist=['attr'], level=6)
+            self.__import__(globals_[0]['__package__'])
+            module = self.__import__('', global_, fromlist=['attr'], level=6)
             self.assertEqual(module.__name__, 'pkg')
         self.relative_import_test(create, globals_, callback)
 
@@ -153,9 +153,9 @@
         globals_ = ({'__package__': 'pkg'},
                     {'__name__': 'pkg', '__path__': ['blah']})
         def callback(global_):
-            import_util.import_('pkg')
+            self.__import__('pkg')
             with self.assertRaises(ValueError):
-                import_util.import_('', global_, fromlist=['top_level'],
+                self.__import__('', global_, fromlist=['top_level'],
                                     level=2)
         self.relative_import_test(create, globals_, callback)
 
@@ -164,16 +164,16 @@
         create = ['top_level', 'pkg.__init__', 'pkg.module']
         globals_ = {'__package__': 'pkg'}, {'__name__': 'pkg.module'}
         def callback(global_):
-            import_util.import_('pkg')
+            self.__import__('pkg')
             with self.assertRaises(ValueError):
-                import_util.import_('', global_, fromlist=['top_level'],
+                self.__import__('', global_, fromlist=['top_level'],
                                     level=2)
         self.relative_import_test(create, globals_, callback)
 
     def test_empty_name_w_level_0(self):
         # [empty name]
         with self.assertRaises(ValueError):
-            import_util.import_('')
+            self.__import__('')
 
     def test_import_from_different_package(self):
         # Test importing from a different package than the caller.
@@ -186,8 +186,8 @@
                     '__runpy_pkg__.uncle.cousin.nephew']
         globals_ = {'__package__': '__runpy_pkg__.__runpy_pkg__'}
         def callback(global_):
-            import_util.import_('__runpy_pkg__.__runpy_pkg__')
-            module = import_util.import_('uncle.cousin', globals_, {},
+            self.__import__('__runpy_pkg__.__runpy_pkg__')
+            module = self.__import__('uncle.cousin', globals_, {},
                                     fromlist=['nephew'],
                                 level=2)
             self.assertEqual(module.__name__, '__runpy_pkg__.uncle.cousin')
@@ -198,20 +198,19 @@
         create = ['crash.__init__', 'crash.mod']
         globals_ = [{'__package__': 'crash', '__name__': 'crash'}]
         def callback(global_):
-            import_util.import_('crash')
-            mod = import_util.import_('mod', global_, {}, [], 1)
+            self.__import__('crash')
+            mod = self.__import__('mod', global_, {}, [], 1)
             self.assertEqual(mod.__name__, 'crash.mod')
         self.relative_import_test(create, globals_, callback)
 
     def test_relative_import_no_globals(self):
         # No globals for a relative import is an error.
         with self.assertRaises(KeyError):
-            import_util.import_('sys', level=1)
+            self.__import__('sys', level=1)
 
+Frozen_RelativeImports, Source_RelativeImports = util.test_both(
+        RelativeImports, __import__=import_util.__import__)
 
-def test_main():
-    from test.support import run_unittest
-    run_unittest(RelativeImports)
 
 if __name__ == '__main__':
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_importlib/import_/util.py b/Lib/test/test_importlib/import_/util.py
index 86ac065..dcb490f 100644
--- a/Lib/test/test_importlib/import_/util.py
+++ b/Lib/test/test_importlib/import_/util.py
@@ -1,22 +1,14 @@
+from .. import util
+
+frozen_importlib, source_importlib = util.import_importlib('importlib')
+
+import builtins
 import functools
 import importlib
 import unittest
 
 
-using___import__ = False
-
-
-def import_(*args, **kwargs):
-    """Delegate to allow for injecting different implementations of import."""
-    if using___import__:
-        return __import__(*args, **kwargs)
-    else:
-        return importlib.__import__(*args, **kwargs)
-
-
-def importlib_only(fxn):
-    """Decorator to skip a test if using __builtins__.__import__."""
-    return unittest.skipIf(using___import__, "importlib-specific test")(fxn)
+__import__ = staticmethod(builtins.__import__), staticmethod(source_importlib.__import__)
 
 
 def mock_path_hook(*entries, importer):
diff --git a/Lib/test/namespace_pkgs/both_portions/foo/one.py b/Lib/test/test_importlib/namespace_pkgs/both_portions/foo/one.py
similarity index 100%
rename from Lib/test/namespace_pkgs/both_portions/foo/one.py
rename to Lib/test/test_importlib/namespace_pkgs/both_portions/foo/one.py
diff --git a/Lib/test/namespace_pkgs/both_portions/foo/two.py b/Lib/test/test_importlib/namespace_pkgs/both_portions/foo/two.py
similarity index 100%
rename from Lib/test/namespace_pkgs/both_portions/foo/two.py
rename to Lib/test/test_importlib/namespace_pkgs/both_portions/foo/two.py
diff --git a/Lib/test/namespace_pkgs/missing_directory.zip b/Lib/test/test_importlib/namespace_pkgs/missing_directory.zip
similarity index 100%
rename from Lib/test/namespace_pkgs/missing_directory.zip
rename to Lib/test/test_importlib/namespace_pkgs/missing_directory.zip
Binary files differ
diff --git a/Lib/test/namespace_pkgs/module_and_namespace_package/a_test.py b/Lib/test/test_importlib/namespace_pkgs/module_and_namespace_package/a_test.py
similarity index 100%
rename from Lib/test/namespace_pkgs/module_and_namespace_package/a_test.py
rename to Lib/test/test_importlib/namespace_pkgs/module_and_namespace_package/a_test.py
diff --git a/Lib/test/namespace_pkgs/module_and_namespace_package/a_test/empty b/Lib/test/test_importlib/namespace_pkgs/module_and_namespace_package/a_test/empty
similarity index 100%
rename from Lib/test/namespace_pkgs/module_and_namespace_package/a_test/empty
rename to Lib/test/test_importlib/namespace_pkgs/module_and_namespace_package/a_test/empty
diff --git a/Lib/test/namespace_pkgs/nested_portion1.zip b/Lib/test/test_importlib/namespace_pkgs/nested_portion1.zip
similarity index 100%
rename from Lib/test/namespace_pkgs/nested_portion1.zip
rename to Lib/test/test_importlib/namespace_pkgs/nested_portion1.zip
Binary files differ
diff --git a/Lib/test/namespace_pkgs/not_a_namespace_pkg/foo/__init__.py b/Lib/test/test_importlib/namespace_pkgs/not_a_namespace_pkg/foo/__init__.py
similarity index 100%
rename from Lib/test/namespace_pkgs/not_a_namespace_pkg/foo/__init__.py
rename to Lib/test/test_importlib/namespace_pkgs/not_a_namespace_pkg/foo/__init__.py
diff --git a/Lib/test/namespace_pkgs/not_a_namespace_pkg/foo/one.py b/Lib/test/test_importlib/namespace_pkgs/not_a_namespace_pkg/foo/one.py
similarity index 100%
rename from Lib/test/namespace_pkgs/not_a_namespace_pkg/foo/one.py
rename to Lib/test/test_importlib/namespace_pkgs/not_a_namespace_pkg/foo/one.py
diff --git a/Lib/test/namespace_pkgs/portion1/foo/one.py b/Lib/test/test_importlib/namespace_pkgs/portion1/foo/one.py
similarity index 100%
rename from Lib/test/namespace_pkgs/portion1/foo/one.py
rename to Lib/test/test_importlib/namespace_pkgs/portion1/foo/one.py
diff --git a/Lib/test/namespace_pkgs/portion2/foo/two.py b/Lib/test/test_importlib/namespace_pkgs/portion2/foo/two.py
similarity index 100%
rename from Lib/test/namespace_pkgs/portion2/foo/two.py
rename to Lib/test/test_importlib/namespace_pkgs/portion2/foo/two.py
diff --git a/Lib/test/namespace_pkgs/project1/parent/child/one.py b/Lib/test/test_importlib/namespace_pkgs/project1/parent/child/one.py
similarity index 100%
rename from Lib/test/namespace_pkgs/project1/parent/child/one.py
rename to Lib/test/test_importlib/namespace_pkgs/project1/parent/child/one.py
diff --git a/Lib/test/namespace_pkgs/project2/parent/child/two.py b/Lib/test/test_importlib/namespace_pkgs/project2/parent/child/two.py
similarity index 100%
rename from Lib/test/namespace_pkgs/project2/parent/child/two.py
rename to Lib/test/test_importlib/namespace_pkgs/project2/parent/child/two.py
diff --git a/Lib/test/namespace_pkgs/project3/parent/child/three.py b/Lib/test/test_importlib/namespace_pkgs/project3/parent/child/three.py
similarity index 100%
rename from Lib/test/namespace_pkgs/project3/parent/child/three.py
rename to Lib/test/test_importlib/namespace_pkgs/project3/parent/child/three.py
diff --git a/Lib/test/namespace_pkgs/top_level_portion1.zip b/Lib/test/test_importlib/namespace_pkgs/top_level_portion1.zip
similarity index 100%
rename from Lib/test/namespace_pkgs/top_level_portion1.zip
rename to Lib/test/test_importlib/namespace_pkgs/top_level_portion1.zip
Binary files differ
diff --git a/Lib/test/test_importlib/source/__init__.py b/Lib/test/test_importlib/source/__init__.py
index 3ef97f3..4b16ecc 100644
--- a/Lib/test/test_importlib/source/__init__.py
+++ b/Lib/test/test_importlib/source/__init__.py
@@ -1,13 +1,5 @@
-from .. import test_suite
-import os.path
-import unittest
+import os
+from test.support import load_package_tests
 
-
-def test_suite():
-    directory = os.path.dirname(__file__)
-    return test.test_suite('importlib.test.source', directory)
-
-
-if __name__ == '__main__':
-    from test.support import run_unittest
-    run_unittest(test_suite())
+def load_tests(*args):
+    return load_package_tests(os.path.dirname(__file__), *args)
diff --git a/Lib/test/test_importlib/source/__main__.py b/Lib/test/test_importlib/source/__main__.py
new file mode 100644
index 0000000..40a23a2
--- /dev/null
+++ b/Lib/test/test_importlib/source/__main__.py
@@ -0,0 +1,4 @@
+from . import load_tests
+import unittest
+
+unittest.main()
diff --git a/Lib/test/test_importlib/source/test_abc_loader.py b/Lib/test/test_importlib/source/test_abc_loader.py
deleted file mode 100644
index 0d912b6..0000000
--- a/Lib/test/test_importlib/source/test_abc_loader.py
+++ /dev/null
@@ -1,906 +0,0 @@
-import importlib
-from importlib import abc
-
-from .. import abc as testing_abc
-from .. import util
-from . import util as source_util
-
-import imp
-import inspect
-import io
-import marshal
-import os
-import sys
-import types
-import unittest
-import warnings
-
-
-class SourceOnlyLoaderMock(abc.SourceLoader):
-
-    # Globals that should be defined for all modules.
-    source = (b"_ = '::'.join([__name__, __file__, __cached__, __package__, "
-              b"repr(__loader__)])")
-
-    def __init__(self, path):
-        self.path = path
-
-    def get_data(self, path):
-        assert self.path == path
-        return self.source
-
-    def get_filename(self, fullname):
-        return self.path
-
-    def module_repr(self, module):
-        return '<module>'
-
-
-class SourceLoaderMock(SourceOnlyLoaderMock):
-
-    source_mtime = 1
-
-    def __init__(self, path, magic=imp.get_magic()):
-        super().__init__(path)
-        self.bytecode_path = imp.cache_from_source(self.path)
-        self.source_size = len(self.source)
-        data = bytearray(magic)
-        data.extend(importlib._w_long(self.source_mtime))
-        data.extend(importlib._w_long(self.source_size))
-        code_object = compile(self.source, self.path, 'exec',
-                                dont_inherit=True)
-        data.extend(marshal.dumps(code_object))
-        self.bytecode = bytes(data)
-        self.written = {}
-
-    def get_data(self, path):
-        if path == self.path:
-            return super().get_data(path)
-        elif path == self.bytecode_path:
-            return self.bytecode
-        else:
-            raise IOError
-
-    def path_stats(self, path):
-        assert path == self.path
-        return {'mtime': self.source_mtime, 'size': self.source_size}
-
-    def set_data(self, path, data):
-        self.written[path] = bytes(data)
-        return path == self.bytecode_path
-
-
-class PyLoaderMock(abc.PyLoader):
-
-    # Globals that should be defined for all modules.
-    source = (b"_ = '::'.join([__name__, __file__, __package__, "
-              b"repr(__loader__)])")
-
-    def __init__(self, data):
-        """Take a dict of 'module_name: path' pairings.
-
-        Paths should have no file extension, allowing packages to be denoted by
-        ending in '__init__'.
-
-        """
-        self.module_paths = data
-        self.path_to_module = {val:key for key,val in data.items()}
-
-    def get_data(self, path):
-        if path not in self.path_to_module:
-            raise IOError
-        return self.source
-
-    def is_package(self, name):
-        filename = os.path.basename(self.get_filename(name))
-        return os.path.splitext(filename)[0] == '__init__'
-
-    def source_path(self, name):
-        try:
-            return self.module_paths[name]
-        except KeyError:
-            raise ImportError
-
-    def get_filename(self, name):
-        """Silence deprecation warning."""
-        with warnings.catch_warnings(record=True) as w:
-            warnings.simplefilter("always")
-            path = super().get_filename(name)
-            assert len(w) == 1
-            assert issubclass(w[0].category, DeprecationWarning)
-            return path
-
-    def module_repr(self):
-        return '<module>'
-
-
-class PyLoaderCompatMock(PyLoaderMock):
-
-    """Mock that matches what is suggested to have a loader that is compatible
-    from Python 3.1 onwards."""
-
-    def get_filename(self, fullname):
-        try:
-            return self.module_paths[fullname]
-        except KeyError:
-            raise ImportError
-
-    def source_path(self, fullname):
-        try:
-            return self.get_filename(fullname)
-        except ImportError:
-            return None
-
-
-class PyPycLoaderMock(abc.PyPycLoader, PyLoaderMock):
-
-    default_mtime = 1
-
-    def __init__(self, source, bc={}):
-        """Initialize mock.
-
-        'bc' is a dict keyed on a module's name. The value is dict with
-        possible keys of 'path', 'mtime', 'magic', and 'bc'. Except for 'path',
-        each of those keys control if any part of created bytecode is to
-        deviate from default values.
-
-        """
-        super().__init__(source)
-        self.module_bytecode = {}
-        self.path_to_bytecode = {}
-        self.bytecode_to_path = {}
-        for name, data in bc.items():
-            self.path_to_bytecode[data['path']] = name
-            self.bytecode_to_path[name] = data['path']
-            magic = data.get('magic', imp.get_magic())
-            mtime = importlib._w_long(data.get('mtime', self.default_mtime))
-            source_size = importlib._w_long(len(self.source) & 0xFFFFFFFF)
-            if 'bc' in data:
-                bc = data['bc']
-            else:
-                bc = self.compile_bc(name)
-            self.module_bytecode[name] = magic + mtime + source_size + bc
-
-    def compile_bc(self, name):
-        source_path = self.module_paths.get(name, '<test>') or '<test>'
-        code = compile(self.source, source_path, 'exec')
-        return marshal.dumps(code)
-
-    def source_mtime(self, name):
-        if name in self.module_paths:
-            return self.default_mtime
-        elif name in self.module_bytecode:
-            return None
-        else:
-            raise ImportError
-
-    def bytecode_path(self, name):
-        try:
-            return self.bytecode_to_path[name]
-        except KeyError:
-            if name in self.module_paths:
-                return None
-            else:
-                raise ImportError
-
-    def write_bytecode(self, name, bytecode):
-        self.module_bytecode[name] = bytecode
-        return True
-
-    def get_data(self, path):
-        if path in self.path_to_module:
-            return super().get_data(path)
-        elif path in self.path_to_bytecode:
-            name = self.path_to_bytecode[path]
-            return self.module_bytecode[name]
-        else:
-            raise IOError
-
-    def is_package(self, name):
-        try:
-            return super().is_package(name)
-        except TypeError:
-            return '__init__' in self.bytecode_to_path[name]
-
-    def get_code(self, name):
-        with warnings.catch_warnings(record=True) as w:
-            warnings.simplefilter("always")
-            code_object = super().get_code(name)
-            assert len(w) == 1
-            assert issubclass(w[0].category, DeprecationWarning)
-            return code_object
-
-class PyLoaderTests(testing_abc.LoaderTests):
-
-    """Tests for importlib.abc.PyLoader."""
-
-    mocker = PyLoaderMock
-
-    def eq_attrs(self, ob, **kwargs):
-        for attr, val in kwargs.items():
-            found = getattr(ob, attr)
-            self.assertEqual(found, val,
-                    "{} attribute: {} != {}".format(attr, found, val))
-
-    def test_module(self):
-        name = '<module>'
-        path = os.path.join('', 'path', 'to', 'module')
-        mock = self.mocker({name: path})
-        with util.uncache(name):
-            module = mock.load_module(name)
-            self.assertIn(name, sys.modules)
-        self.eq_attrs(module, __name__=name, __file__=path, __package__='',
-                        __loader__=mock)
-        self.assertTrue(not hasattr(module, '__path__'))
-        return mock, name
-
-    def test_package(self):
-        name = '<pkg>'
-        path = os.path.join('path', 'to', name, '__init__')
-        mock = self.mocker({name: path})
-        with util.uncache(name):
-            module = mock.load_module(name)
-            self.assertIn(name, sys.modules)
-        self.eq_attrs(module, __name__=name, __file__=path,
-                __path__=[os.path.dirname(path)], __package__=name,
-                __loader__=mock)
-        return mock, name
-
-    def test_lacking_parent(self):
-        name = 'pkg.mod'
-        path = os.path.join('path', 'to', 'pkg', 'mod')
-        mock = self.mocker({name: path})
-        with util.uncache(name):
-            module = mock.load_module(name)
-            self.assertIn(name, sys.modules)
-        self.eq_attrs(module, __name__=name, __file__=path, __package__='pkg',
-                        __loader__=mock)
-        self.assertFalse(hasattr(module, '__path__'))
-        return mock, name
-
-    def test_module_reuse(self):
-        name = 'mod'
-        path = os.path.join('path', 'to', 'mod')
-        module = imp.new_module(name)
-        mock = self.mocker({name: path})
-        with util.uncache(name):
-            sys.modules[name] = module
-            loaded_module = mock.load_module(name)
-            self.assertIs(loaded_module, module)
-            self.assertIs(sys.modules[name], module)
-        return mock, name
-
-    def test_state_after_failure(self):
-        name = "mod"
-        module = imp.new_module(name)
-        module.blah = None
-        mock = self.mocker({name: os.path.join('path', 'to', 'mod')})
-        mock.source = b"1/0"
-        with util.uncache(name):
-            sys.modules[name] = module
-            with self.assertRaises(ZeroDivisionError):
-                mock.load_module(name)
-            self.assertIs(sys.modules[name], module)
-            self.assertTrue(hasattr(module, 'blah'))
-        return mock
-
-    def test_unloadable(self):
-        name = "mod"
-        mock = self.mocker({name: os.path.join('path', 'to', 'mod')})
-        mock.source = b"1/0"
-        with util.uncache(name):
-            with self.assertRaises(ZeroDivisionError):
-                mock.load_module(name)
-            self.assertNotIn(name, sys.modules)
-        return mock
-
-
-class PyLoaderCompatTests(PyLoaderTests):
-
-    """Test that the suggested code to make a loader that is compatible from
-    Python 3.1 forward works."""
-
-    mocker = PyLoaderCompatMock
-
-
-class PyLoaderInterfaceTests(unittest.TestCase):
-
-    """Tests for importlib.abc.PyLoader to make sure that when source_path()
-    doesn't return a path everything works as expected."""
-
-    def test_no_source_path(self):
-        # No source path should lead to ImportError.
-        name = 'mod'
-        mock = PyLoaderMock({})
-        with util.uncache(name), self.assertRaises(ImportError):
-            mock.load_module(name)
-
-    def test_source_path_is_None(self):
-        name = 'mod'
-        mock = PyLoaderMock({name: None})
-        with util.uncache(name), self.assertRaises(ImportError):
-            mock.load_module(name)
-
-    def test_get_filename_with_source_path(self):
-        # get_filename() should return what source_path() returns.
-        name = 'mod'
-        path = os.path.join('path', 'to', 'source')
-        mock = PyLoaderMock({name: path})
-        with util.uncache(name):
-            self.assertEqual(mock.get_filename(name), path)
-
-    def test_get_filename_no_source_path(self):
-        # get_filename() should raise ImportError if source_path returns None.
-        name = 'mod'
-        mock = PyLoaderMock({name: None})
-        with util.uncache(name), self.assertRaises(ImportError):
-            mock.get_filename(name)
-
-
-class PyPycLoaderTests(PyLoaderTests):
-
-    """Tests for importlib.abc.PyPycLoader."""
-
-    mocker = PyPycLoaderMock
-
-    @source_util.writes_bytecode_files
-    def verify_bytecode(self, mock, name):
-        assert name in mock.module_paths
-        self.assertIn(name, mock.module_bytecode)
-        magic = mock.module_bytecode[name][:4]
-        self.assertEqual(magic, imp.get_magic())
-        mtime = importlib._r_long(mock.module_bytecode[name][4:8])
-        self.assertEqual(mtime, 1)
-        source_size = mock.module_bytecode[name][8:12]
-        self.assertEqual(len(mock.source) & 0xFFFFFFFF,
-                         importlib._r_long(source_size))
-        bc = mock.module_bytecode[name][12:]
-        self.assertEqual(bc, mock.compile_bc(name))
-
-    def test_module(self):
-        mock, name = super().test_module()
-        self.verify_bytecode(mock, name)
-
-    def test_package(self):
-        mock, name = super().test_package()
-        self.verify_bytecode(mock, name)
-
-    def test_lacking_parent(self):
-        mock, name = super().test_lacking_parent()
-        self.verify_bytecode(mock, name)
-
-    def test_module_reuse(self):
-        mock, name = super().test_module_reuse()
-        self.verify_bytecode(mock, name)
-
-    def test_state_after_failure(self):
-        super().test_state_after_failure()
-
-    def test_unloadable(self):
-        super().test_unloadable()
-
-
-class PyPycLoaderInterfaceTests(unittest.TestCase):
-
-    """Test for the interface of importlib.abc.PyPycLoader."""
-
-    def get_filename_check(self, src_path, bc_path, expect):
-        name = 'mod'
-        mock = PyPycLoaderMock({name: src_path}, {name: {'path': bc_path}})
-        with util.uncache(name):
-            assert mock.source_path(name) == src_path
-            assert mock.bytecode_path(name) == bc_path
-            self.assertEqual(mock.get_filename(name), expect)
-
-    def test_filename_with_source_bc(self):
-        # When source and bytecode paths present, return the source path.
-        self.get_filename_check('source_path', 'bc_path', 'source_path')
-
-    def test_filename_with_source_no_bc(self):
-        # With source but no bc, return source path.
-        self.get_filename_check('source_path', None, 'source_path')
-
-    def test_filename_with_no_source_bc(self):
-        # With not source but bc, return the bc path.
-        self.get_filename_check(None, 'bc_path', 'bc_path')
-
-    def test_filename_with_no_source_or_bc(self):
-        # With no source or bc, raise ImportError.
-        name = 'mod'
-        mock = PyPycLoaderMock({name: None}, {name: {'path': None}})
-        with util.uncache(name), self.assertRaises(ImportError):
-            mock.get_filename(name)
-
-
-class SkipWritingBytecodeTests(unittest.TestCase):
-
-    """Test that bytecode is properly handled based on
-    sys.dont_write_bytecode."""
-
-    @source_util.writes_bytecode_files
-    def run_test(self, dont_write_bytecode):
-        name = 'mod'
-        mock = PyPycLoaderMock({name: os.path.join('path', 'to', 'mod')})
-        sys.dont_write_bytecode = dont_write_bytecode
-        with util.uncache(name):
-            mock.load_module(name)
-        self.assertIsNot(name in mock.module_bytecode, dont_write_bytecode)
-
-    def test_no_bytecode_written(self):
-        self.run_test(True)
-
-    def test_bytecode_written(self):
-        self.run_test(False)
-
-
-class RegeneratedBytecodeTests(unittest.TestCase):
-
-    """Test that bytecode is regenerated as expected."""
-
-    @source_util.writes_bytecode_files
-    def test_different_magic(self):
-        # A different magic number should lead to new bytecode.
-        name = 'mod'
-        bad_magic = b'\x00\x00\x00\x00'
-        assert bad_magic != imp.get_magic()
-        mock = PyPycLoaderMock({name: os.path.join('path', 'to', 'mod')},
-                                {name: {'path': os.path.join('path', 'to',
-                                                    'mod.bytecode'),
-                                        'magic': bad_magic}})
-        with util.uncache(name):
-            mock.load_module(name)
-        self.assertIn(name, mock.module_bytecode)
-        magic = mock.module_bytecode[name][:4]
-        self.assertEqual(magic, imp.get_magic())
-
-    @source_util.writes_bytecode_files
-    def test_old_mtime(self):
-        # Bytecode with an older mtime should be regenerated.
-        name = 'mod'
-        old_mtime = PyPycLoaderMock.default_mtime - 1
-        mock = PyPycLoaderMock({name: os.path.join('path', 'to', 'mod')},
-                {name: {'path': 'path/to/mod.bytecode', 'mtime': old_mtime}})
-        with util.uncache(name):
-            mock.load_module(name)
-        self.assertIn(name, mock.module_bytecode)
-        mtime = importlib._r_long(mock.module_bytecode[name][4:8])
-        self.assertEqual(mtime, PyPycLoaderMock.default_mtime)
-
-
-class BadBytecodeFailureTests(unittest.TestCase):
-
-    """Test import failures when there is no source and parts of the bytecode
-    is bad."""
-
-    def test_bad_magic(self):
-        # A bad magic number should lead to an ImportError.
-        name = 'mod'
-        bad_magic = b'\x00\x00\x00\x00'
-        bc = {name:
-                {'path': os.path.join('path', 'to', 'mod'),
-                 'magic': bad_magic}}
-        mock = PyPycLoaderMock({name: None}, bc)
-        with util.uncache(name), self.assertRaises(ImportError) as cm:
-            mock.load_module(name)
-        self.assertEqual(cm.exception.name, name)
-
-    def test_no_bytecode(self):
-        # Missing code object bytecode should lead to an EOFError.
-        name = 'mod'
-        bc = {name: {'path': os.path.join('path', 'to', 'mod'), 'bc': b''}}
-        mock = PyPycLoaderMock({name: None}, bc)
-        with util.uncache(name), self.assertRaises(EOFError):
-            mock.load_module(name)
-
-    def test_bad_bytecode(self):
-        # Malformed code object bytecode should lead to a ValueError.
-        name = 'mod'
-        bc = {name: {'path': os.path.join('path', 'to', 'mod'), 'bc': b'1234'}}
-        mock = PyPycLoaderMock({name: None}, bc)
-        with util.uncache(name), self.assertRaises(ValueError):
-            mock.load_module(name)
-
-
-def raise_ImportError(*args, **kwargs):
-    raise ImportError
-
-class MissingPathsTests(unittest.TestCase):
-
-    """Test what happens when a source or bytecode path does not exist (either
-    from *_path returning None or raising ImportError)."""
-
-    def test_source_path_None(self):
-        # Bytecode should be used when source_path returns None, along with
-        # __file__ being set to the bytecode path.
-        name = 'mod'
-        bytecode_path = 'path/to/mod'
-        mock = PyPycLoaderMock({name: None}, {name: {'path': bytecode_path}})
-        with util.uncache(name):
-            module = mock.load_module(name)
-        self.assertEqual(module.__file__, bytecode_path)
-
-    # Testing for bytecode_path returning None handled by all tests where no
-    # bytecode initially exists.
-
-    def test_all_paths_None(self):
-        # If all *_path methods return None, raise ImportError.
-        name = 'mod'
-        mock = PyPycLoaderMock({name: None})
-        with util.uncache(name), self.assertRaises(ImportError) as cm:
-            mock.load_module(name)
-        self.assertEqual(cm.exception.name, name)
-
-    def test_source_path_ImportError(self):
-        # An ImportError from source_path should trigger an ImportError.
-        name = 'mod'
-        mock = PyPycLoaderMock({}, {name: {'path': os.path.join('path', 'to',
-                                                                'mod')}})
-        with util.uncache(name), self.assertRaises(ImportError):
-            mock.load_module(name)
-
-    def test_bytecode_path_ImportError(self):
-        # An ImportError from bytecode_path should trigger an ImportError.
-        name = 'mod'
-        mock = PyPycLoaderMock({name: os.path.join('path', 'to', 'mod')})
-        bad_meth = types.MethodType(raise_ImportError, mock)
-        mock.bytecode_path = bad_meth
-        with util.uncache(name), self.assertRaises(ImportError) as cm:
-            mock.load_module(name)
-
-
-class SourceLoaderTestHarness(unittest.TestCase):
-
-    def setUp(self, *, is_package=True, **kwargs):
-        self.package = 'pkg'
-        if is_package:
-            self.path = os.path.join(self.package, '__init__.py')
-            self.name = self.package
-        else:
-            module_name = 'mod'
-            self.path = os.path.join(self.package, '.'.join(['mod', 'py']))
-            self.name = '.'.join([self.package, module_name])
-        self.cached = imp.cache_from_source(self.path)
-        self.loader = self.loader_mock(self.path, **kwargs)
-
-    def verify_module(self, module):
-        self.assertEqual(module.__name__, self.name)
-        self.assertEqual(module.__file__, self.path)
-        self.assertEqual(module.__cached__, self.cached)
-        self.assertEqual(module.__package__, self.package)
-        self.assertEqual(module.__loader__, self.loader)
-        values = module._.split('::')
-        self.assertEqual(values[0], self.name)
-        self.assertEqual(values[1], self.path)
-        self.assertEqual(values[2], self.cached)
-        self.assertEqual(values[3], self.package)
-        self.assertEqual(values[4], repr(self.loader))
-
-    def verify_code(self, code_object):
-        module = imp.new_module(self.name)
-        module.__file__ = self.path
-        module.__cached__ = self.cached
-        module.__package__ = self.package
-        module.__loader__ = self.loader
-        module.__path__ = []
-        exec(code_object, module.__dict__)
-        self.verify_module(module)
-
-
-class SourceOnlyLoaderTests(SourceLoaderTestHarness):
-
-    """Test importlib.abc.SourceLoader for source-only loading.
-
-    Reload testing is subsumed by the tests for
-    importlib.util.module_for_loader.
-
-    """
-
-    loader_mock = SourceOnlyLoaderMock
-
-    def test_get_source(self):
-        # Verify the source code is returned as a string.
-        # If an IOError is raised by get_data then raise ImportError.
-        expected_source = self.loader.source.decode('utf-8')
-        self.assertEqual(self.loader.get_source(self.name), expected_source)
-        def raise_IOError(path):
-            raise IOError
-        self.loader.get_data = raise_IOError
-        with self.assertRaises(ImportError) as cm:
-            self.loader.get_source(self.name)
-        self.assertEqual(cm.exception.name, self.name)
-
-    def test_is_package(self):
-        # Properly detect when loading a package.
-        self.setUp(is_package=False)
-        self.assertFalse(self.loader.is_package(self.name))
-        self.setUp(is_package=True)
-        self.assertTrue(self.loader.is_package(self.name))
-        self.assertFalse(self.loader.is_package(self.name + '.__init__'))
-
-    def test_get_code(self):
-        # Verify the code object is created.
-        code_object = self.loader.get_code(self.name)
-        self.verify_code(code_object)
-
-    def test_load_module(self):
-        # Loading a module should set __name__, __loader__, __package__,
-        # __path__ (for packages), __file__, and __cached__.
-        # The module should also be put into sys.modules.
-        with util.uncache(self.name):
-            module = self.loader.load_module(self.name)
-            self.verify_module(module)
-            self.assertEqual(module.__path__, [os.path.dirname(self.path)])
-            self.assertIn(self.name, sys.modules)
-
-    def test_package_settings(self):
-        # __package__ needs to be set, while __path__ is set on if the module
-        # is a package.
-        # Testing the values for a package are covered by test_load_module.
-        self.setUp(is_package=False)
-        with util.uncache(self.name):
-            module = self.loader.load_module(self.name)
-            self.verify_module(module)
-            self.assertTrue(not hasattr(module, '__path__'))
-
-    def test_get_source_encoding(self):
-        # Source is considered encoded in UTF-8 by default unless otherwise
-        # specified by an encoding line.
-        source = "_ = 'ü'"
-        self.loader.source = source.encode('utf-8')
-        returned_source = self.loader.get_source(self.name)
-        self.assertEqual(returned_source, source)
-        source = "# coding: latin-1\n_ = ü"
-        self.loader.source = source.encode('latin-1')
-        returned_source = self.loader.get_source(self.name)
-        self.assertEqual(returned_source, source)
-
-
-@unittest.skipIf(sys.dont_write_bytecode, "sys.dont_write_bytecode is true")
-class SourceLoaderBytecodeTests(SourceLoaderTestHarness):
-
-    """Test importlib.abc.SourceLoader's use of bytecode.
-
-    Source-only testing handled by SourceOnlyLoaderTests.
-
-    """
-
-    loader_mock = SourceLoaderMock
-
-    def verify_code(self, code_object, *, bytecode_written=False):
-        super().verify_code(code_object)
-        if bytecode_written:
-            self.assertIn(self.cached, self.loader.written)
-            data = bytearray(imp.get_magic())
-            data.extend(importlib._w_long(self.loader.source_mtime))
-            data.extend(importlib._w_long(self.loader.source_size))
-            data.extend(marshal.dumps(code_object))
-            self.assertEqual(self.loader.written[self.cached], bytes(data))
-
-    def test_code_with_everything(self):
-        # When everything should work.
-        code_object = self.loader.get_code(self.name)
-        self.verify_code(code_object)
-
-    def test_no_bytecode(self):
-        # If no bytecode exists then move on to the source.
-        self.loader.bytecode_path = "<does not exist>"
-        # Sanity check
-        with self.assertRaises(IOError):
-            bytecode_path = imp.cache_from_source(self.path)
-            self.loader.get_data(bytecode_path)
-        code_object = self.loader.get_code(self.name)
-        self.verify_code(code_object, bytecode_written=True)
-
-    def test_code_bad_timestamp(self):
-        # Bytecode is only used when the timestamp matches the source EXACTLY.
-        for source_mtime in (0, 2):
-            assert source_mtime != self.loader.source_mtime
-            original = self.loader.source_mtime
-            self.loader.source_mtime = source_mtime
-            # If bytecode is used then EOFError would be raised by marshal.
-            self.loader.bytecode = self.loader.bytecode[8:]
-            code_object = self.loader.get_code(self.name)
-            self.verify_code(code_object, bytecode_written=True)
-            self.loader.source_mtime = original
-
-    def test_code_bad_magic(self):
-        # Skip over bytecode with a bad magic number.
-        self.setUp(magic=b'0000')
-        # If bytecode is used then EOFError would be raised by marshal.
-        self.loader.bytecode = self.loader.bytecode[8:]
-        code_object = self.loader.get_code(self.name)
-        self.verify_code(code_object, bytecode_written=True)
-
-    def test_dont_write_bytecode(self):
-        # Bytecode is not written if sys.dont_write_bytecode is true.
-        # Can assume it is false already thanks to the skipIf class decorator.
-        try:
-            sys.dont_write_bytecode = True
-            self.loader.bytecode_path = "<does not exist>"
-            code_object = self.loader.get_code(self.name)
-            self.assertNotIn(self.cached, self.loader.written)
-        finally:
-            sys.dont_write_bytecode = False
-
-    def test_no_set_data(self):
-        # If set_data is not defined, one can still read bytecode.
-        self.setUp(magic=b'0000')
-        original_set_data = self.loader.__class__.set_data
-        try:
-            del self.loader.__class__.set_data
-            code_object = self.loader.get_code(self.name)
-            self.verify_code(code_object)
-        finally:
-            self.loader.__class__.set_data = original_set_data
-
-    def test_set_data_raises_exceptions(self):
-        # Raising NotImplementedError or IOError is okay for set_data.
-        def raise_exception(exc):
-            def closure(*args, **kwargs):
-                raise exc
-            return closure
-
-        self.setUp(magic=b'0000')
-        self.loader.set_data = raise_exception(NotImplementedError)
-        code_object = self.loader.get_code(self.name)
-        self.verify_code(code_object)
-
-
-class SourceLoaderGetSourceTests(unittest.TestCase):
-
-    """Tests for importlib.abc.SourceLoader.get_source()."""
-
-    def test_default_encoding(self):
-        # Should have no problems with UTF-8 text.
-        name = 'mod'
-        mock = SourceOnlyLoaderMock('mod.file')
-        source = 'x = "ü"'
-        mock.source = source.encode('utf-8')
-        returned_source = mock.get_source(name)
-        self.assertEqual(returned_source, source)
-
-    def test_decoded_source(self):
-        # Decoding should work.
-        name = 'mod'
-        mock = SourceOnlyLoaderMock("mod.file")
-        source = "# coding: Latin-1\nx='ü'"
-        assert source.encode('latin-1') != source.encode('utf-8')
-        mock.source = source.encode('latin-1')
-        returned_source = mock.get_source(name)
-        self.assertEqual(returned_source, source)
-
-    def test_universal_newlines(self):
-        # PEP 302 says universal newlines should be used.
-        name = 'mod'
-        mock = SourceOnlyLoaderMock('mod.file')
-        source = "x = 42\r\ny = -13\r\n"
-        mock.source = source.encode('utf-8')
-        expect = io.IncrementalNewlineDecoder(None, True).decode(source)
-        self.assertEqual(mock.get_source(name), expect)
-
-
-class AbstractMethodImplTests(unittest.TestCase):
-
-    """Test the concrete abstractmethod implementations."""
-
-    class MetaPathFinder(abc.MetaPathFinder):
-        def find_module(self, fullname, path):
-            super().find_module(fullname, path)
-
-    class PathEntryFinder(abc.PathEntryFinder):
-        def find_module(self, _):
-            super().find_module(_)
-
-        def find_loader(self, _):
-            super().find_loader(_)
-
-    class Finder(abc.Finder):
-        def find_module(self, fullname, path):
-            super().find_module(fullname, path)
-
-    class Loader(abc.Loader):
-        def load_module(self, fullname):
-            super().load_module(fullname)
-        def module_repr(self, module):
-            super().module_repr(module)
-
-    class ResourceLoader(Loader, abc.ResourceLoader):
-        def get_data(self, _):
-            super().get_data(_)
-
-    class InspectLoader(Loader, abc.InspectLoader):
-        def is_package(self, _):
-            super().is_package(_)
-
-        def get_code(self, _):
-            super().get_code(_)
-
-        def get_source(self, _):
-            super().get_source(_)
-
-    class ExecutionLoader(InspectLoader, abc.ExecutionLoader):
-        def get_filename(self, _):
-            super().get_filename(_)
-
-    class SourceLoader(ResourceLoader, ExecutionLoader, abc.SourceLoader):
-        pass
-
-    class PyLoader(ResourceLoader, InspectLoader, abc.PyLoader):
-        def source_path(self, _):
-            super().source_path(_)
-
-    class PyPycLoader(PyLoader, abc.PyPycLoader):
-        def bytecode_path(self, _):
-            super().bytecode_path(_)
-
-        def source_mtime(self, _):
-            super().source_mtime(_)
-
-        def write_bytecode(self, _, _2):
-            super().write_bytecode(_, _2)
-
-    def raises_NotImplementedError(self, ins, *args):
-        for method_name in args:
-            method = getattr(ins, method_name)
-            arg_count = len(inspect.getfullargspec(method)[0]) - 1
-            args = [''] * arg_count
-            try:
-                method(*args)
-            except NotImplementedError:
-                pass
-            else:
-                msg = "{}.{} did not raise NotImplementedError"
-                self.fail(msg.format(ins.__class__.__name__, method_name))
-
-    def test_Loader(self):
-        self.raises_NotImplementedError(self.Loader(), 'load_module')
-
-    # XXX misplaced; should be somewhere else
-    def test_Finder(self):
-        self.raises_NotImplementedError(self.Finder(), 'find_module')
-
-    def test_ResourceLoader(self):
-        self.raises_NotImplementedError(self.ResourceLoader(), 'load_module',
-                                        'get_data')
-
-    def test_InspectLoader(self):
-        self.raises_NotImplementedError(self.InspectLoader(), 'load_module',
-                                        'is_package', 'get_code', 'get_source')
-
-    def test_ExecutionLoader(self):
-        self.raises_NotImplementedError(self.ExecutionLoader(), 'load_module',
-                                        'is_package', 'get_code', 'get_source',
-                                        'get_filename')
-
-    def test_SourceLoader(self):
-        ins = self.SourceLoader()
-        # Required abstractmethods.
-        self.raises_NotImplementedError(ins, 'get_filename', 'get_data')
-        # Optional abstractmethods.
-        self.raises_NotImplementedError(ins,'path_stats', 'set_data')
-
-    def test_PyLoader(self):
-        self.raises_NotImplementedError(self.PyLoader(), 'source_path',
-                                        'get_data', 'is_package')
-
-    def test_PyPycLoader(self):
-        self.raises_NotImplementedError(self.PyPycLoader(), 'source_path',
-                                        'source_mtime', 'bytecode_path',
-                                        'write_bytecode')
-
-
-def test_main():
-    from test.support import run_unittest
-    run_unittest(PyLoaderTests, PyLoaderCompatTests,
-                    PyLoaderInterfaceTests,
-                    PyPycLoaderTests, PyPycLoaderInterfaceTests,
-                    SkipWritingBytecodeTests, RegeneratedBytecodeTests,
-                    BadBytecodeFailureTests, MissingPathsTests,
-                    SourceOnlyLoaderTests,
-                    SourceLoaderBytecodeTests,
-                    SourceLoaderGetSourceTests,
-                    AbstractMethodImplTests)
-
-
-if __name__ == '__main__':
-    test_main()
diff --git a/Lib/test/test_importlib/source/test_case_sensitivity.py b/Lib/test/test_importlib/source/test_case_sensitivity.py
index 241173f..efd3146 100644
--- a/Lib/test/test_importlib/source/test_case_sensitivity.py
+++ b/Lib/test/test_importlib/source/test_case_sensitivity.py
@@ -1,9 +1,10 @@
 """Test case-sensitivity (PEP 235)."""
-from importlib import _bootstrap
-from importlib import machinery
 from .. import util
 from . import util as source_util
-import imp
+
+importlib = util.import_importlib('importlib')
+machinery = util.import_importlib('importlib.machinery')
+
 import os
 import sys
 from test import support as test_support
@@ -11,7 +12,7 @@
 
 
 @util.case_insensitive_tests
-class CaseSensitivityTest(unittest.TestCase):
+class CaseSensitivityTest:
 
     """PEP 235 dictates that on case-preserving, case-insensitive file systems
     that imports are case-sensitive unless the PYTHONCASEOK environment
@@ -20,13 +21,12 @@
     name = 'MoDuLe'
     assert name != name.lower()
 
-    def find(self, path):
-        finder = machinery.FileFinder(path,
-                                      (machinery.SourceFileLoader,
-                                            machinery.SOURCE_SUFFIXES),
-                                        (machinery.SourcelessFileLoader,
-                                            machinery.BYTECODE_SUFFIXES))
-        return finder.find_module(self.name)
+    def finder(self, path):
+        return self.machinery.FileFinder(path,
+                                      (self.machinery.SourceFileLoader,
+                                            self.machinery.SOURCE_SUFFIXES),
+                                        (self.machinery.SourcelessFileLoader,
+                                            self.machinery.BYTECODE_SUFFIXES))
 
     def sensitivity_test(self):
         """Look for a module with matching and non-matching sensitivity."""
@@ -36,35 +36,48 @@
         with context as mapping:
             sensitive_path = os.path.join(mapping['.root'], 'sensitive')
             insensitive_path = os.path.join(mapping['.root'], 'insensitive')
-            return self.find(sensitive_path), self.find(insensitive_path)
+            sensitive_finder = self.finder(sensitive_path)
+            insensitive_finder = self.finder(insensitive_path)
+            return self.find(sensitive_finder), self.find(insensitive_finder)
 
     def test_sensitive(self):
         with test_support.EnvironmentVarGuard() as env:
             env.unset('PYTHONCASEOK')
-            if b'PYTHONCASEOK' in _bootstrap._os.environ:
+            if b'PYTHONCASEOK' in self.importlib._bootstrap._os.environ:
                 self.skipTest('os.environ changes not reflected in '
                               '_os.environ')
             sensitive, insensitive = self.sensitivity_test()
-            self.assertTrue(hasattr(sensitive, 'load_module'))
+            self.assertIsNotNone(sensitive)
             self.assertIn(self.name, sensitive.get_filename(self.name))
             self.assertIsNone(insensitive)
 
     def test_insensitive(self):
         with test_support.EnvironmentVarGuard() as env:
             env.set('PYTHONCASEOK', '1')
-            if b'PYTHONCASEOK' not in _bootstrap._os.environ:
+            if b'PYTHONCASEOK' not in self.importlib._bootstrap._os.environ:
                 self.skipTest('os.environ changes not reflected in '
                               '_os.environ')
             sensitive, insensitive = self.sensitivity_test()
-            self.assertTrue(hasattr(sensitive, 'load_module'))
+            self.assertIsNotNone(sensitive)
             self.assertIn(self.name, sensitive.get_filename(self.name))
-            self.assertTrue(hasattr(insensitive, 'load_module'))
+            self.assertIsNotNone(insensitive)
             self.assertIn(self.name, insensitive.get_filename(self.name))
 
+class CaseSensitivityTestPEP302(CaseSensitivityTest):
+    def find(self, finder):
+        return finder.find_module(self.name)
 
-def test_main():
-    test_support.run_unittest(CaseSensitivityTest)
+Frozen_CaseSensitivityTestPEP302, Source_CaseSensitivityTestPEP302 = util.test_both(
+    CaseSensitivityTestPEP302, importlib=importlib, machinery=machinery)
+
+class CaseSensitivityTestPEP451(CaseSensitivityTest):
+    def find(self, finder):
+        found = finder.find_spec(self.name)
+        return found.loader if found is not None else found
+
+Frozen_CaseSensitivityTestPEP451, Source_CaseSensitivityTestPEP451 = util.test_both(
+    CaseSensitivityTestPEP451, importlib=importlib, machinery=machinery)
 
 
 if __name__ == '__main__':
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_importlib/source/test_file_loader.py b/Lib/test/test_importlib/source/test_file_loader.py
index d711cb3..2d415f9 100644
--- a/Lib/test/test_importlib/source/test_file_loader.py
+++ b/Lib/test/test_importlib/source/test_file_loader.py
@@ -1,52 +1,52 @@
-from importlib import machinery
-import importlib
-import importlib.abc
 from .. import abc
 from .. import util
 from . import util as source_util
 
+importlib = util.import_importlib('importlib')
+importlib_abc = util.import_importlib('importlib.abc')
+machinery = util.import_importlib('importlib.machinery')
+importlib_util = util.import_importlib('importlib.util')
+
 import errno
-import imp
 import marshal
 import os
 import py_compile
 import shutil
 import stat
 import sys
+import types
 import unittest
+import warnings
 
-from test.support import make_legacy_pyc
+from test.support import make_legacy_pyc, unload
 
 
-class SimpleTest(unittest.TestCase):
+class SimpleTest(abc.LoaderTests):
 
     """Should have no issue importing a source module [basic]. And if there is
     a syntax error, it should raise a SyntaxError [syntax error].
 
     """
 
+    def setUp(self):
+        self.name = 'spam'
+        self.filepath = os.path.join('ham', self.name + '.py')
+        self.loader = self.machinery.SourceFileLoader(self.name, self.filepath)
+
     def test_load_module_API(self):
-        # If fullname is not specified that assume self.name is desired.
-        class TesterMixin(importlib.abc.Loader):
-            def load_module(self, fullname): return fullname
-            def module_repr(self, module): return '<module>'
+        class Tester(self.abc.FileLoader):
+            def get_source(self, _): return 'attr = 42'
+            def is_package(self, _): return False
 
-        class Tester(importlib.abc.FileLoader, TesterMixin):
-            def get_code(self, _): pass
-            def get_source(self, _): pass
-            def is_package(self, _): pass
-
-        name = 'mod_name'
-        loader = Tester(name, 'some_path')
-        self.assertEqual(name, loader.load_module())
-        self.assertEqual(name, loader.load_module(None))
-        self.assertEqual(name, loader.load_module(name))
-        with self.assertRaises(ImportError):
-            loader.load_module(loader.name + 'XXX')
+        loader = Tester('blah', 'blah.py')
+        self.addCleanup(unload, 'blah')
+        with warnings.catch_warnings():
+            warnings.simplefilter('ignore', DeprecationWarning)
+            module = loader.load_module()  # Should not raise an exception.
 
     def test_get_filename_API(self):
         # If fullname is not set then assume self.path is desired.
-        class Tester(importlib.abc.FileLoader):
+        class Tester(self.abc.FileLoader):
             def get_code(self, _): pass
             def get_source(self, _): pass
             def is_package(self, _): pass
@@ -61,11 +61,21 @@
         with self.assertRaises(ImportError):
             loader.get_filename(name + 'XXX')
 
+    def test_equality(self):
+        other = self.machinery.SourceFileLoader(self.name, self.filepath)
+        self.assertEqual(self.loader, other)
+
+    def test_inequality(self):
+        other = self.machinery.SourceFileLoader('_' + self.name, self.filepath)
+        self.assertNotEqual(self.loader, other)
+
     # [basic]
     def test_module(self):
         with source_util.create_modules('_temp') as mapping:
-            loader = machinery.SourceFileLoader('_temp', mapping['_temp'])
-            module = loader.load_module('_temp')
+            loader = self.machinery.SourceFileLoader('_temp', mapping['_temp'])
+            with warnings.catch_warnings():
+                warnings.simplefilter('ignore', DeprecationWarning)
+                module = loader.load_module('_temp')
             self.assertIn('_temp', sys.modules)
             check = {'__name__': '_temp', '__file__': mapping['_temp'],
                      '__package__': ''}
@@ -74,9 +84,11 @@
 
     def test_package(self):
         with source_util.create_modules('_pkg.__init__') as mapping:
-            loader = machinery.SourceFileLoader('_pkg',
+            loader = self.machinery.SourceFileLoader('_pkg',
                                                  mapping['_pkg.__init__'])
-            module = loader.load_module('_pkg')
+            with warnings.catch_warnings():
+                warnings.simplefilter('ignore', DeprecationWarning)
+                module = loader.load_module('_pkg')
             self.assertIn('_pkg', sys.modules)
             check = {'__name__': '_pkg', '__file__': mapping['_pkg.__init__'],
                      '__path__': [os.path.dirname(mapping['_pkg.__init__'])],
@@ -87,9 +99,11 @@
 
     def test_lacking_parent(self):
         with source_util.create_modules('_pkg.__init__', '_pkg.mod')as mapping:
-            loader = machinery.SourceFileLoader('_pkg.mod',
+            loader = self.machinery.SourceFileLoader('_pkg.mod',
                                                     mapping['_pkg.mod'])
-            module = loader.load_module('_pkg.mod')
+            with warnings.catch_warnings():
+                warnings.simplefilter('ignore', DeprecationWarning)
+                module = loader.load_module('_pkg.mod')
             self.assertIn('_pkg.mod', sys.modules)
             check = {'__name__': '_pkg.mod', '__file__': mapping['_pkg.mod'],
                      '__package__': '_pkg'}
@@ -102,13 +116,17 @@
 
     def test_module_reuse(self):
         with source_util.create_modules('_temp') as mapping:
-            loader = machinery.SourceFileLoader('_temp', mapping['_temp'])
-            module = loader.load_module('_temp')
+            loader = self.machinery.SourceFileLoader('_temp', mapping['_temp'])
+            with warnings.catch_warnings():
+                warnings.simplefilter('ignore', DeprecationWarning)
+                module = loader.load_module('_temp')
             module_id = id(module)
             module_dict_id = id(module.__dict__)
             with open(mapping['_temp'], 'w') as file:
                 file.write("testing_var = 42\n")
-            module = loader.load_module('_temp')
+            with warnings.catch_warnings():
+                warnings.simplefilter('ignore', DeprecationWarning)
+                module = loader.load_module('_temp')
             self.assertIn('testing_var', module.__dict__,
                          "'testing_var' not in "
                             "{0}".format(list(module.__dict__.keys())))
@@ -122,14 +140,20 @@
         value = '<test>'
         name = '_temp'
         with source_util.create_modules(name) as mapping:
-            orig_module = imp.new_module(name)
+            orig_module = types.ModuleType(name)
             for attr in attributes:
                 setattr(orig_module, attr, value)
             with open(mapping[name], 'w') as file:
                 file.write('+++ bad syntax +++')
-            loader = machinery.SourceFileLoader('_temp', mapping['_temp'])
+            loader = self.machinery.SourceFileLoader('_temp', mapping['_temp'])
             with self.assertRaises(SyntaxError):
-                loader.load_module(name)
+                loader.exec_module(orig_module)
+            for attr in attributes:
+                self.assertEqual(getattr(orig_module, attr), value)
+            with self.assertRaises(SyntaxError):
+                with warnings.catch_warnings():
+                    warnings.simplefilter('ignore', DeprecationWarning)
+                    loader.load_module(name)
             for attr in attributes:
                 self.assertEqual(getattr(orig_module, attr), value)
 
@@ -138,9 +162,11 @@
         with source_util.create_modules('_temp') as mapping:
             with open(mapping['_temp'], 'w') as file:
                 file.write('=')
-            loader = machinery.SourceFileLoader('_temp', mapping['_temp'])
+            loader = self.machinery.SourceFileLoader('_temp', mapping['_temp'])
             with self.assertRaises(SyntaxError):
-                loader.load_module('_temp')
+                with warnings.catch_warnings():
+                    warnings.simplefilter('ignore', DeprecationWarning)
+                    loader.load_module('_temp')
             self.assertNotIn('_temp', sys.modules)
 
     def test_file_from_empty_string_dir(self):
@@ -151,14 +177,16 @@
             file.write("# test file for importlib")
         try:
             with util.uncache('_temp'):
-                loader = machinery.SourceFileLoader('_temp', file_path)
-                mod = loader.load_module('_temp')
+                loader = self.machinery.SourceFileLoader('_temp', file_path)
+                with warnings.catch_warnings():
+                    warnings.simplefilter('ignore', DeprecationWarning)
+                    mod = loader.load_module('_temp')
                 self.assertEqual(file_path, mod.__file__)
-                self.assertEqual(imp.cache_from_source(file_path),
+                self.assertEqual(self.util.cache_from_source(file_path),
                                  mod.__cached__)
         finally:
             os.unlink(file_path)
-            pycache = os.path.dirname(imp.cache_from_source(file_path))
+            pycache = os.path.dirname(self.util.cache_from_source(file_path))
             if os.path.exists(pycache):
                 shutil.rmtree(pycache)
 
@@ -168,7 +196,7 @@
         # truncated rather than raise an OverflowError.
         with source_util.create_modules('_temp') as mapping:
             source = mapping['_temp']
-            compiled = imp.cache_from_source(source)
+            compiled = self.util.cache_from_source(source)
             with open(source, 'w') as f:
                 f.write("x = 5")
             try:
@@ -179,20 +207,48 @@
                 if e.errno != getattr(errno, 'EOVERFLOW', None):
                     raise
                 self.skipTest("cannot set modification time to large integer ({})".format(e))
-            loader = machinery.SourceFileLoader('_temp', mapping['_temp'])
-            mod = loader.load_module('_temp')
+            loader = self.machinery.SourceFileLoader('_temp', mapping['_temp'])
+            # PEP 451
+            module = types.ModuleType('_temp')
+            module.__spec__ = self.util.spec_from_loader('_temp', loader)
+            loader.exec_module(module)
+            self.assertEqual(module.x, 5)
+            self.assertTrue(os.path.exists(compiled))
+            os.unlink(compiled)
+            # PEP 302
+            with warnings.catch_warnings():
+                warnings.simplefilter('ignore', DeprecationWarning)
+                mod = loader.load_module('_temp') # XXX
             # Sanity checks.
             self.assertEqual(mod.__cached__, compiled)
             self.assertEqual(mod.x, 5)
             # The pyc file was created.
-            os.stat(compiled)
+            self.assertTrue(os.path.exists(compiled))
+
+    def test_unloadable(self):
+        loader = self.machinery.SourceFileLoader('good name', {})
+        module = types.ModuleType('bad name')
+        module.__spec__ = self.machinery.ModuleSpec('bad name', loader)
+        with self.assertRaises(ImportError):
+            loader.exec_module(module)
+        with self.assertRaises(ImportError):
+            with warnings.catch_warnings():
+                warnings.simplefilter('ignore', DeprecationWarning)
+                loader.load_module('bad name')
+
+Frozen_SimpleTest, Source_SimpleTest = util.test_both(
+        SimpleTest, importlib=importlib, machinery=machinery, abc=importlib_abc,
+        util=importlib_util)
 
 
-class BadBytecodeTest(unittest.TestCase):
+class BadBytecodeTest:
 
     def import_(self, file, module_name):
         loader = self.loader(module_name, file)
-        module = loader.load_module(module_name)
+        with warnings.catch_warnings():
+            warnings.simplefilter('ignore', DeprecationWarning)
+            # XXX Change to use exec_module().
+            module = loader.load_module(module_name)
         self.assertIn(module_name, sys.modules)
 
     def manipulate_bytecode(self, name, mapping, manipulator, *,
@@ -205,7 +261,7 @@
             pass
         py_compile.compile(mapping[name])
         if not del_source:
-            bytecode_path = imp.cache_from_source(mapping[name])
+            bytecode_path = self.util.cache_from_source(mapping[name])
         else:
             os.unlink(mapping[name])
             bytecode_path = make_legacy_pyc(mapping[name])
@@ -291,10 +347,29 @@
                                     lambda bc: b'\x00\x00\x00\x00' + bc[4:])
             test('_temp', mapping, bc_path)
 
+class BadBytecodeTestPEP451(BadBytecodeTest):
 
-class SourceLoaderBadBytecodeTest(BadBytecodeTest):
+    def import_(self, file, module_name):
+        loader = self.loader(module_name, file)
+        module = types.ModuleType(module_name)
+        module.__spec__ = self.util.spec_from_loader(module_name, loader)
+        loader.exec_module(module)
 
-    loader = machinery.SourceFileLoader
+class BadBytecodeTestPEP302(BadBytecodeTest):
+
+    def import_(self, file, module_name):
+        loader = self.loader(module_name, file)
+        with warnings.catch_warnings():
+            warnings.simplefilter('ignore', DeprecationWarning)
+            module = loader.load_module(module_name)
+        self.assertIn(module_name, sys.modules)
+
+
+class SourceLoaderBadBytecodeTest:
+
+    @classmethod
+    def setUpClass(cls):
+        cls.loader = cls.machinery.SourceFileLoader
 
     @source_util.writes_bytecode_files
     def test_empty_file(self):
@@ -333,7 +408,8 @@
         def test(name, mapping, bytecode_path):
             self.import_(mapping[name], name)
             with open(bytecode_path, 'rb') as bytecode_file:
-                self.assertEqual(bytecode_file.read(4), imp.get_magic())
+                self.assertEqual(bytecode_file.read(4),
+                                 self.util.MAGIC_NUMBER)
 
         self._test_bad_magic(test)
 
@@ -383,13 +459,13 @@
         zeros = b'\x00\x00\x00\x00'
         with source_util.create_modules('_temp') as mapping:
             py_compile.compile(mapping['_temp'])
-            bytecode_path = imp.cache_from_source(mapping['_temp'])
+            bytecode_path = self.util.cache_from_source(mapping['_temp'])
             with open(bytecode_path, 'r+b') as bytecode_file:
                 bytecode_file.seek(4)
                 bytecode_file.write(zeros)
             self.import_(mapping['_temp'], '_temp')
             source_mtime = os.path.getmtime(mapping['_temp'])
-            source_timestamp = importlib._w_long(source_mtime)
+            source_timestamp = self.importlib._w_long(source_mtime)
             with open(bytecode_path, 'rb') as bytecode_file:
                 bytecode_file.seek(4)
                 self.assertEqual(bytecode_file.read(4), source_timestamp)
@@ -401,7 +477,7 @@
         with source_util.create_modules('_temp') as mapping:
             # Create bytecode that will need to be re-created.
             py_compile.compile(mapping['_temp'])
-            bytecode_path = imp.cache_from_source(mapping['_temp'])
+            bytecode_path = self.util.cache_from_source(mapping['_temp'])
             with open(bytecode_path, 'r+b') as bytecode_file:
                 bytecode_file.seek(0)
                 bytecode_file.write(b'\x00\x00\x00\x00')
@@ -409,16 +485,34 @@
             os.chmod(bytecode_path,
                         stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH)
             try:
-                # Should not raise IOError!
+                # Should not raise OSError!
                 self.import_(mapping['_temp'], '_temp')
             finally:
                 # Make writable for eventual clean-up.
                 os.chmod(bytecode_path, stat.S_IWUSR)
 
+class SourceLoaderBadBytecodeTestPEP451(
+        SourceLoaderBadBytecodeTest, BadBytecodeTestPEP451):
+    pass
 
-class SourcelessLoaderBadBytecodeTest(BadBytecodeTest):
+Frozen_SourceBadBytecodePEP451, Source_SourceBadBytecodePEP451 = util.test_both(
+        SourceLoaderBadBytecodeTestPEP451, importlib=importlib, machinery=machinery,
+        abc=importlib_abc, util=importlib_util)
 
-    loader = machinery.SourcelessFileLoader
+class SourceLoaderBadBytecodeTestPEP302(
+        SourceLoaderBadBytecodeTest, BadBytecodeTestPEP302):
+    pass
+
+Frozen_SourceBadBytecodePEP302, Source_SourceBadBytecodePEP302 = util.test_both(
+        SourceLoaderBadBytecodeTestPEP302, importlib=importlib, machinery=machinery,
+        abc=importlib_abc, util=importlib_util)
+
+
+class SourcelessLoaderBadBytecodeTest:
+
+    @classmethod
+    def setUpClass(cls):
+        cls.loader = cls.machinery.SourcelessFileLoader
 
     def test_empty_file(self):
         def test(name, mapping, bytecode_path):
@@ -473,14 +567,22 @@
     def test_non_code_marshal(self):
         self._test_non_code_marshal(del_source=True)
 
+class SourcelessLoaderBadBytecodeTestPEP451(SourcelessLoaderBadBytecodeTest,
+        BadBytecodeTestPEP451):
+    pass
 
-def test_main():
-    from test.support import run_unittest
-    run_unittest(SimpleTest,
-                 SourceLoaderBadBytecodeTest,
-                 SourcelessLoaderBadBytecodeTest
-                )
+Frozen_SourcelessBadBytecodePEP451, Source_SourcelessBadBytecodePEP451 = util.test_both(
+        SourcelessLoaderBadBytecodeTestPEP451, importlib=importlib,
+        machinery=machinery, abc=importlib_abc, util=importlib_util)
+
+class SourcelessLoaderBadBytecodeTestPEP302(SourcelessLoaderBadBytecodeTest,
+        BadBytecodeTestPEP302):
+    pass
+
+Frozen_SourcelessBadBytecodePEP302, Source_SourcelessBadBytecodePEP302 = util.test_both(
+        SourcelessLoaderBadBytecodeTestPEP302, importlib=importlib,
+        machinery=machinery, abc=importlib_abc, util=importlib_util)
 
 
 if __name__ == '__main__':
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_importlib/source/test_finder.py b/Lib/test/test_importlib/source/test_finder.py
index 8e49868..473297b 100644
--- a/Lib/test/test_importlib/source/test_finder.py
+++ b/Lib/test/test_importlib/source/test_finder.py
@@ -1,9 +1,10 @@
 from .. import abc
+from .. import util
 from . import util as source_util
 
-from importlib import machinery
+machinery = util.import_importlib('importlib.machinery')
+
 import errno
-import imp
 import os
 import py_compile
 import stat
@@ -39,14 +40,15 @@
     """
 
     def get_finder(self, root):
-        loader_details = [(machinery.SourceFileLoader,
-                            machinery.SOURCE_SUFFIXES),
-                          (machinery.SourcelessFileLoader,
-                            machinery.BYTECODE_SUFFIXES)]
-        return machinery.FileFinder(root, *loader_details)
+        loader_details = [(self.machinery.SourceFileLoader,
+                            self.machinery.SOURCE_SUFFIXES),
+                          (self.machinery.SourcelessFileLoader,
+                            self.machinery.BYTECODE_SUFFIXES)]
+        return self.machinery.FileFinder(root, *loader_details)
 
     def import_(self, root, module):
-        return self.get_finder(root).find_module(module)
+        finder = self.get_finder(root)
+        return self._find(finder, module, loader_only=True)
 
     def run_test(self, test, create=None, *, compile_=None, unlink=None):
         """Test the finding of 'test' with the creation of modules listed in
@@ -124,20 +126,20 @@
 
     def test_empty_string_for_dir(self):
         # The empty string from sys.path means to search in the cwd.
-        finder = machinery.FileFinder('', (machinery.SourceFileLoader,
-            machinery.SOURCE_SUFFIXES))
+        finder = self.machinery.FileFinder('', (self.machinery.SourceFileLoader,
+            self.machinery.SOURCE_SUFFIXES))
         with open('mod.py', 'w') as file:
             file.write("# test file for importlib")
         try:
-            loader = finder.find_module('mod')
+            loader = self._find(finder, 'mod', loader_only=True)
             self.assertTrue(hasattr(loader, 'load_module'))
         finally:
             os.unlink('mod.py')
 
     def test_invalidate_caches(self):
         # invalidate_caches() should reset the mtime.
-        finder = machinery.FileFinder('', (machinery.SourceFileLoader,
-            machinery.SOURCE_SUFFIXES))
+        finder = self.machinery.FileFinder('', (self.machinery.SourceFileLoader,
+            self.machinery.SOURCE_SUFFIXES))
         finder._path_mtime = 42
         finder.invalidate_caches()
         self.assertEqual(finder._path_mtime, -1)
@@ -147,8 +149,10 @@
         mod = 'mod'
         with source_util.create_modules(mod) as mapping:
             finder = self.get_finder(mapping['.root'])
-            self.assertIsNotNone(finder.find_module(mod))
-        self.assertIsNone(finder.find_module(mod))
+            found = self._find(finder, 'mod', loader_only=True)
+            self.assertIsNotNone(found)
+        found = self._find(finder, 'mod', loader_only=True)
+        self.assertIsNone(found)
 
     @unittest.skipUnless(sys.platform != 'win32',
             'os.chmod() does not support the needed arguments under Windows')
@@ -172,20 +176,57 @@
         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'))
+        found = self._find(finder, 'doesnotexist')
+        self.assertEqual(found, self.NOT_FOUND)
 
     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'))
+            found = self._find(finder, 'doesnotexist')
+            self.assertEqual(found, self.NOT_FOUND)
 
 
-def test_main():
-    from test.support import run_unittest
-    run_unittest(FinderTests)
+class FinderTestsPEP451(FinderTests):
+
+    NOT_FOUND = None
+
+    def _find(self, finder, name, loader_only=False):
+        spec = finder.find_spec(name)
+        return spec.loader if spec is not None else spec
+
+Frozen_FinderTestsPEP451, Source_FinderTestsPEP451 = util.test_both(
+        FinderTestsPEP451, machinery=machinery)
+
+
+class FinderTestsPEP420(FinderTests):
+
+    NOT_FOUND = (None, [])
+
+    def _find(self, finder, name, loader_only=False):
+        with warnings.catch_warnings():
+            warnings.simplefilter("ignore", DeprecationWarning)
+            loader_portions = finder.find_loader(name)
+            return loader_portions[0] if loader_only else loader_portions
+
+Frozen_FinderTestsPEP420, Source_FinderTestsPEP420 = util.test_both(
+        FinderTestsPEP420, machinery=machinery)
+
+
+class FinderTestsPEP302(FinderTests):
+
+    NOT_FOUND = None
+
+    def _find(self, finder, name, loader_only=False):
+        with warnings.catch_warnings():
+            warnings.simplefilter("ignore", DeprecationWarning)
+            return finder.find_module(name)
+
+Frozen_FinderTestsPEP302, Source_FinderTestsPEP302 = util.test_both(
+        FinderTestsPEP302, machinery=machinery)
+
 
 
 if __name__ == '__main__':
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_importlib/source/test_path_hook.py b/Lib/test/test_importlib/source/test_path_hook.py
index 6a78792..92da772 100644
--- a/Lib/test/test_importlib/source/test_path_hook.py
+++ b/Lib/test/test_importlib/source/test_path_hook.py
@@ -1,17 +1,18 @@
+from .. import util
 from . import util as source_util
 
-from importlib import machinery
-import imp
+machinery = util.import_importlib('importlib.machinery')
+
 import unittest
 
 
-class PathHookTest(unittest.TestCase):
+class PathHookTest:
 
     """Test the path hook for source."""
 
     def path_hook(self):
-        return machinery.FileFinder.path_hook((machinery.SourceFileLoader,
-            machinery.SOURCE_SUFFIXES))
+        return self.machinery.FileFinder.path_hook((self.machinery.SourceFileLoader,
+            self.machinery.SOURCE_SUFFIXES))
 
     def test_success(self):
         with source_util.create_modules('dummy') as mapping:
@@ -22,11 +23,8 @@
         # The empty string represents the cwd.
         self.assertTrue(hasattr(self.path_hook()(''), 'find_module'))
 
-
-def test_main():
-    from test.support import run_unittest
-    run_unittest(PathHookTest)
+Frozen_PathHookTest, Source_PathHooktest = util.test_both(PathHookTest, machinery=machinery)
 
 
 if __name__ == '__main__':
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_importlib/source/test_source_encoding.py b/Lib/test/test_importlib/source/test_source_encoding.py
index ba02b44..c62dfa1 100644
--- a/Lib/test/test_importlib/source/test_source_encoding.py
+++ b/Lib/test/test_importlib/source/test_source_encoding.py
@@ -1,19 +1,24 @@
+from .. import util
 from . import util as source_util
 
-from importlib import _bootstrap
+machinery = util.import_importlib('importlib.machinery')
+
 import codecs
+import importlib.util
 import re
 import sys
+import types
 # Because sys.path gets essentially blanked, need to have unicodedata already
 # imported for the parser to use.
 import unicodedata
 import unittest
+import warnings
 
 
 CODING_RE = re.compile(r'^[ \t\f]*#.*coding[:=][ \t]*([-\w.]+)', re.ASCII)
 
 
-class EncodingTest(unittest.TestCase):
+class EncodingTest:
 
     """PEP 3120 makes UTF-8 the default encoding for source code
     [default encoding].
@@ -35,9 +40,9 @@
         with source_util.create_modules(self.module_name) as mapping:
             with open(mapping[self.module_name], 'wb') as file:
                 file.write(source)
-            loader = _bootstrap.SourceFileLoader(self.module_name,
+            loader = self.machinery.SourceFileLoader(self.module_name,
                                                   mapping[self.module_name])
-            return loader.load_module(self.module_name)
+            return self.load(loader)
 
     def create_source(self, encoding):
         encoding_line = "# coding={0}".format(encoding)
@@ -84,8 +89,29 @@
         with self.assertRaises(SyntaxError):
             self.run_test(source)
 
+class EncodingTestPEP451(EncodingTest):
 
-class LineEndingTest(unittest.TestCase):
+    def load(self, loader):
+        module = types.ModuleType(self.module_name)
+        module.__spec__ = importlib.util.spec_from_loader(self.module_name, loader)
+        loader.exec_module(module)
+        return module
+
+Frozen_EncodingTestPEP451, Source_EncodingTestPEP451 = util.test_both(
+        EncodingTestPEP451, machinery=machinery)
+
+class EncodingTestPEP302(EncodingTest):
+
+    def load(self, loader):
+        with warnings.catch_warnings():
+            warnings.simplefilter('ignore', DeprecationWarning)
+            return loader.load_module(self.module_name)
+
+Frozen_EncodingTestPEP302, Source_EncodingTestPEP302 = util.test_both(
+        EncodingTestPEP302, machinery=machinery)
+
+
+class LineEndingTest:
 
     r"""Source written with the three types of line endings (\n, \r\n, \r)
     need to be readable [cr][crlf][lf]."""
@@ -97,9 +123,9 @@
         with source_util.create_modules(module_name) as mapping:
             with open(mapping[module_name], 'wb') as file:
                 file.write(source)
-            loader = _bootstrap.SourceFileLoader(module_name,
-                                                 mapping[module_name])
-            return loader.load_module(module_name)
+            loader = self.machinery.SourceFileLoader(module_name,
+                                                     mapping[module_name])
+            return self.load(loader, module_name)
 
     # [cr]
     def test_cr(self):
@@ -113,11 +139,27 @@
     def test_lf(self):
         self.run_test(b'\n')
 
+class LineEndingTestPEP451(LineEndingTest):
 
-def test_main():
-    from test.support import run_unittest
-    run_unittest(EncodingTest, LineEndingTest)
+    def load(self, loader, module_name):
+        module = types.ModuleType(module_name)
+        module.__spec__ = importlib.util.spec_from_loader(module_name, loader)
+        loader.exec_module(module)
+        return module
+
+Frozen_LineEndingTestPEP451, Source_LineEndingTestPEP451 = util.test_both(
+        LineEndingTestPEP451, machinery=machinery)
+
+class LineEndingTestPEP302(LineEndingTest):
+
+    def load(self, loader, module_name):
+        with warnings.catch_warnings():
+            warnings.simplefilter('ignore', DeprecationWarning)
+            return loader.load_module(module_name)
+
+Frozen_LineEndingTestPEP302, Source_LineEndingTestPEP302 = util.test_both(
+        LineEndingTestPEP302, machinery=machinery)
 
 
 if __name__ == '__main__':
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_importlib/source/util.py b/Lib/test/test_importlib/source/util.py
index ae65663..63cd25a 100644
--- a/Lib/test/test_importlib/source/util.py
+++ b/Lib/test/test_importlib/source/util.py
@@ -2,7 +2,6 @@
 import contextlib
 import errno
 import functools
-import imp
 import os
 import os.path
 import sys
diff --git a/Lib/test/test_importlib/test_abc.py b/Lib/test/test_importlib/test_abc.py
index c620c37..a1f8e76 100644
--- a/Lib/test/test_importlib/test_abc.py
+++ b/Lib/test/test_importlib/test_abc.py
@@ -1,9 +1,23 @@
-from importlib import abc
-from importlib import machinery
+import contextlib
 import inspect
+import io
+import marshal
+import os
+import sys
+from test import support
+import types
 import unittest
+from unittest import mock
+import warnings
 
+from . import util
 
+frozen_init, source_init = util.import_importlib('importlib')
+frozen_abc, source_abc = util.import_importlib('importlib.abc')
+machinery = util.import_importlib('importlib.machinery')
+frozen_util, source_util = util.import_importlib('importlib.util')
+
+##### Inheritance ##############################################################
 class InheritanceTests:
 
     """Test that the specified class is a subclass/superclass of the expected
@@ -14,8 +28,19 @@
 
     def __init__(self, *args, **kwargs):
         super().__init__(*args, **kwargs)
+        self.superclasses = [getattr(self.abc, class_name)
+                             for class_name in self.superclass_names]
+        if hasattr(self, 'subclass_names'):
+            # Because test.support.import_fresh_module() creates a new
+            # importlib._bootstrap per module, inheritance checks fail when
+            # checking across module boundaries (i.e. the _bootstrap in abc is
+            # not the same as the one in machinery). That means stealing one of
+            # the modules from the other to make sure the same instance is used.
+            self.subclasses = [getattr(self.abc.machinery, class_name)
+                                for class_name in self.subclass_names]
         assert self.subclasses or self.superclasses, self.__class__
-        self.__test = getattr(abc, self.__class__.__name__)
+        testing = self.__class__.__name__.partition('_')[2]
+        self.__test = getattr(self.abc, testing)
 
     def test_subclasses(self):
         # Test that the expected subclasses inherit.
@@ -29,75 +54,898 @@
             self.assertTrue(issubclass(self.__test, superclass),
                "{0} is not a superclass of {1}".format(superclass, self.__test))
 
+def create_inheritance_tests(base_class):
+    def set_frozen(ns):
+        ns['abc'] = frozen_abc
+    def set_source(ns):
+        ns['abc'] = source_abc
 
-class MetaPathFinder(InheritanceTests, unittest.TestCase):
-
-    superclasses = [abc.Finder]
-    subclasses = [machinery.BuiltinImporter, machinery.FrozenImporter,
-                    machinery.PathFinder, machinery.WindowsRegistryFinder]
-
-
-class PathEntryFinder(InheritanceTests, unittest.TestCase):
-
-    superclasses = [abc.Finder]
-    subclasses = [machinery.FileFinder]
-
-
-class Loader(InheritanceTests, unittest.TestCase):
-
-    subclasses = [abc.PyLoader]
-
-
-class ResourceLoader(InheritanceTests, unittest.TestCase):
-
-    superclasses = [abc.Loader]
-
-
-class InspectLoader(InheritanceTests, unittest.TestCase):
-
-    superclasses = [abc.Loader]
-    subclasses = [abc.PyLoader, machinery.BuiltinImporter,
-                    machinery.FrozenImporter, machinery.ExtensionFileLoader]
-
-
-class ExecutionLoader(InheritanceTests, unittest.TestCase):
-
-    superclasses = [abc.InspectLoader]
-    subclasses = [abc.PyLoader]
-
-
-class FileLoader(InheritanceTests, unittest.TestCase):
-
-    superclasses = [abc.ResourceLoader, abc.ExecutionLoader]
-    subclasses = [machinery.SourceFileLoader, machinery.SourcelessFileLoader]
-
-
-class SourceLoader(InheritanceTests, unittest.TestCase):
-
-    superclasses = [abc.ResourceLoader, abc.ExecutionLoader]
-    subclasses = [machinery.SourceFileLoader]
-
-
-class PyLoader(InheritanceTests, unittest.TestCase):
-
-    superclasses = [abc.Loader, abc.ResourceLoader, abc.ExecutionLoader]
-
-
-class PyPycLoader(InheritanceTests, unittest.TestCase):
-
-    superclasses = [abc.PyLoader]
-
-
-def test_main():
-    from test.support import run_unittest
     classes = []
-    for class_ in globals().values():
-        if (inspect.isclass(class_) and
-                issubclass(class_, unittest.TestCase) and
-                issubclass(class_, InheritanceTests)):
-            classes.append(class_)
-    run_unittest(*classes)
+    for prefix, ns_set in [('Frozen', set_frozen), ('Source', set_source)]:
+        classes.append(types.new_class('_'.join([prefix, base_class.__name__]),
+                                       (base_class, unittest.TestCase),
+                                       exec_body=ns_set))
+    return classes
+
+
+class MetaPathFinder(InheritanceTests):
+    superclass_names = ['Finder']
+    subclass_names = ['BuiltinImporter', 'FrozenImporter', 'PathFinder',
+                      'WindowsRegistryFinder']
+
+tests = create_inheritance_tests(MetaPathFinder)
+Frozen_MetaPathFinderInheritanceTests, Source_MetaPathFinderInheritanceTests = tests
+
+
+class PathEntryFinder(InheritanceTests):
+    superclass_names = ['Finder']
+    subclass_names = ['FileFinder']
+
+tests = create_inheritance_tests(PathEntryFinder)
+Frozen_PathEntryFinderInheritanceTests, Source_PathEntryFinderInheritanceTests = tests
+
+
+class ResourceLoader(InheritanceTests):
+    superclass_names = ['Loader']
+
+tests = create_inheritance_tests(ResourceLoader)
+Frozen_ResourceLoaderInheritanceTests, Source_ResourceLoaderInheritanceTests = tests
+
+
+class InspectLoader(InheritanceTests):
+    superclass_names = ['Loader']
+    subclass_names = ['BuiltinImporter', 'FrozenImporter', 'ExtensionFileLoader']
+
+tests = create_inheritance_tests(InspectLoader)
+Frozen_InspectLoaderInheritanceTests, Source_InspectLoaderInheritanceTests = tests
+
+
+class ExecutionLoader(InheritanceTests):
+    superclass_names = ['InspectLoader']
+    subclass_names = ['ExtensionFileLoader']
+
+tests = create_inheritance_tests(ExecutionLoader)
+Frozen_ExecutionLoaderInheritanceTests, Source_ExecutionLoaderInheritanceTests = tests
+
+
+class FileLoader(InheritanceTests):
+    superclass_names = ['ResourceLoader', 'ExecutionLoader']
+    subclass_names = ['SourceFileLoader', 'SourcelessFileLoader']
+
+tests = create_inheritance_tests(FileLoader)
+Frozen_FileLoaderInheritanceTests, Source_FileLoaderInheritanceTests = tests
+
+
+class SourceLoader(InheritanceTests):
+    superclass_names = ['ResourceLoader', 'ExecutionLoader']
+    subclass_names = ['SourceFileLoader']
+
+tests = create_inheritance_tests(SourceLoader)
+Frozen_SourceLoaderInheritanceTests, Source_SourceLoaderInheritanceTests = tests
+
+##### Default return values ####################################################
+def make_abc_subclasses(base_class):
+    classes = []
+    for kind, abc in [('Frozen', frozen_abc), ('Source', source_abc)]:
+        name = '_'.join([kind, base_class.__name__])
+        base_classes = base_class, getattr(abc, base_class.__name__)
+        classes.append(types.new_class(name, base_classes))
+    return classes
+
+def make_return_value_tests(base_class, test_class):
+    frozen_class, source_class = make_abc_subclasses(base_class)
+    tests = []
+    for prefix, class_in_test in [('Frozen', frozen_class), ('Source', source_class)]:
+        def set_ns(ns):
+            ns['ins'] = class_in_test()
+        tests.append(types.new_class('_'.join([prefix, test_class.__name__]),
+                                     (test_class, unittest.TestCase),
+                                     exec_body=set_ns))
+    return tests
+
+
+class MetaPathFinder:
+
+    def find_module(self, fullname, path):
+        return super().find_module(fullname, path)
+
+Frozen_MPF, Source_MPF = make_abc_subclasses(MetaPathFinder)
+
+
+class MetaPathFinderDefaultsTests:
+
+    def test_find_module(self):
+        # Default should return None.
+        self.assertIsNone(self.ins.find_module('something', None))
+
+    def test_invalidate_caches(self):
+        # Calling the method is a no-op.
+        self.ins.invalidate_caches()
+
+
+tests = make_return_value_tests(MetaPathFinder, MetaPathFinderDefaultsTests)
+Frozen_MPFDefaultTests, Source_MPFDefaultTests = tests
+
+
+class PathEntryFinder:
+
+    def find_loader(self, fullname):
+        return super().find_loader(fullname)
+
+Frozen_PEF, Source_PEF = make_abc_subclasses(PathEntryFinder)
+
+
+class PathEntryFinderDefaultsTests:
+
+    def test_find_loader(self):
+        self.assertEqual((None, []), self.ins.find_loader('something'))
+
+    def find_module(self):
+        self.assertEqual(None, self.ins.find_module('something'))
+
+    def test_invalidate_caches(self):
+        # Should be a no-op.
+        self.ins.invalidate_caches()
+
+
+tests = make_return_value_tests(PathEntryFinder, PathEntryFinderDefaultsTests)
+Frozen_PEFDefaultTests, Source_PEFDefaultTests = tests
+
+
+class Loader:
+
+    def load_module(self, fullname):
+        return super().load_module(fullname)
+
+
+Frozen_L, Source_L = make_abc_subclasses(Loader)
+
+
+class LoaderDefaultsTests:
+
+    def test_load_module(self):
+        with self.assertRaises(ImportError):
+            self.ins.load_module('something')
+
+    def test_module_repr(self):
+        mod = types.ModuleType('blah')
+        with self.assertRaises(NotImplementedError):
+            self.ins.module_repr(mod)
+        original_repr = repr(mod)
+        mod.__loader__ = self.ins
+        # Should still return a proper repr.
+        self.assertTrue(repr(mod))
+
+
+tests = make_return_value_tests(Loader, LoaderDefaultsTests)
+Frozen_LDefaultTests, SourceLDefaultTests = tests
+
+
+class ResourceLoader(Loader):
+
+    def get_data(self, path):
+        return super().get_data(path)
+
+
+Frozen_RL, Source_RL = make_abc_subclasses(ResourceLoader)
+
+
+class ResourceLoaderDefaultsTests:
+
+    def test_get_data(self):
+        with self.assertRaises(IOError):
+            self.ins.get_data('/some/path')
+
+
+tests = make_return_value_tests(ResourceLoader, ResourceLoaderDefaultsTests)
+Frozen_RLDefaultTests, Source_RLDefaultTests = tests
+
+
+class InspectLoader(Loader):
+
+    def is_package(self, fullname):
+        return super().is_package(fullname)
+
+    def get_source(self, fullname):
+        return super().get_source(fullname)
+
+
+Frozen_IL, Source_IL = make_abc_subclasses(InspectLoader)
+
+
+class InspectLoaderDefaultsTests:
+
+    def test_is_package(self):
+        with self.assertRaises(ImportError):
+            self.ins.is_package('blah')
+
+    def test_get_source(self):
+        with self.assertRaises(ImportError):
+            self.ins.get_source('blah')
+
+
+tests = make_return_value_tests(InspectLoader, InspectLoaderDefaultsTests)
+Frozen_ILDefaultTests, Source_ILDefaultTests = tests
+
+
+class ExecutionLoader(InspectLoader):
+
+    def get_filename(self, fullname):
+        return super().get_filename(fullname)
+
+Frozen_EL, Source_EL = make_abc_subclasses(ExecutionLoader)
+
+
+class ExecutionLoaderDefaultsTests:
+
+    def test_get_filename(self):
+        with self.assertRaises(ImportError):
+            self.ins.get_filename('blah')
+
+
+tests = make_return_value_tests(ExecutionLoader, InspectLoaderDefaultsTests)
+Frozen_ELDefaultTests, Source_ELDefaultsTests = tests
+
+##### MetaPathFinder concrete methods ##########################################
+
+class MetaPathFinderFindModuleTests:
+
+    @classmethod
+    def finder(cls, spec):
+        class MetaPathSpecFinder(cls.abc.MetaPathFinder):
+
+            def find_spec(self, fullname, path, target=None):
+                self.called_for = fullname, path
+                return spec
+
+        return MetaPathSpecFinder()
+
+    def test_no_spec(self):
+        finder = self.finder(None)
+        path = ['a', 'b', 'c']
+        name = 'blah'
+        found = finder.find_module(name, path)
+        self.assertIsNone(found)
+        self.assertEqual(name, finder.called_for[0])
+        self.assertEqual(path, finder.called_for[1])
+
+    def test_spec(self):
+        loader = object()
+        spec = self.util.spec_from_loader('blah', loader)
+        finder = self.finder(spec)
+        found = finder.find_module('blah', None)
+        self.assertIs(found, spec.loader)
+
+
+Frozen_MPFFindModuleTests, Source_MPFFindModuleTests = util.test_both(
+        MetaPathFinderFindModuleTests,
+        abc=(frozen_abc, source_abc),
+        util=(frozen_util, source_util))
+
+##### PathEntryFinder concrete methods #########################################
+
+class PathEntryFinderFindLoaderTests:
+
+    @classmethod
+    def finder(cls, spec):
+        class PathEntrySpecFinder(cls.abc.PathEntryFinder):
+
+            def find_spec(self, fullname, target=None):
+                self.called_for = fullname
+                return spec
+
+        return PathEntrySpecFinder()
+
+    def test_no_spec(self):
+        finder = self.finder(None)
+        name = 'blah'
+        found = finder.find_loader(name)
+        self.assertIsNone(found[0])
+        self.assertEqual([], found[1])
+        self.assertEqual(name, finder.called_for)
+
+    def test_spec_with_loader(self):
+        loader = object()
+        spec = self.util.spec_from_loader('blah', loader)
+        finder = self.finder(spec)
+        found = finder.find_loader('blah')
+        self.assertIs(found[0], spec.loader)
+
+    def test_spec_with_portions(self):
+        spec = self.machinery.ModuleSpec('blah', None)
+        paths = ['a', 'b', 'c']
+        spec.submodule_search_locations = paths
+        finder = self.finder(spec)
+        found = finder.find_loader('blah')
+        self.assertIsNone(found[0])
+        self.assertEqual(paths, found[1])
+
+
+Frozen_PEFFindLoaderTests, Source_PEFFindLoaderTests = util.test_both(
+        PathEntryFinderFindLoaderTests,
+        abc=(frozen_abc, source_abc),
+        machinery=machinery,
+        util=(frozen_util, source_util))
+
+
+##### Loader concrete methods ##################################################
+class LoaderLoadModuleTests:
+
+    def loader(self):
+        class SpecLoader(self.abc.Loader):
+            found = None
+            def exec_module(self, module):
+                self.found = module
+
+            def is_package(self, fullname):
+                """Force some non-default module state to be set."""
+                return True
+
+        return SpecLoader()
+
+    def test_fresh(self):
+        loader = self.loader()
+        name = 'blah'
+        with util.uncache(name):
+            loader.load_module(name)
+            module = loader.found
+            self.assertIs(sys.modules[name], module)
+        self.assertEqual(loader, module.__loader__)
+        self.assertEqual(loader, module.__spec__.loader)
+        self.assertEqual(name, module.__name__)
+        self.assertEqual(name, module.__spec__.name)
+        self.assertIsNotNone(module.__path__)
+        self.assertIsNotNone(module.__path__,
+                             module.__spec__.submodule_search_locations)
+
+    def test_reload(self):
+        name = 'blah'
+        loader = self.loader()
+        module = types.ModuleType(name)
+        module.__spec__ = self.util.spec_from_loader(name, loader)
+        module.__loader__ = loader
+        with util.uncache(name):
+            sys.modules[name] = module
+            loader.load_module(name)
+            found = loader.found
+            self.assertIs(found, sys.modules[name])
+            self.assertIs(module, sys.modules[name])
+
+
+Frozen_LoaderLoadModuleTests, Source_LoaderLoadModuleTests = util.test_both(
+        LoaderLoadModuleTests,
+        abc=(frozen_abc, source_abc),
+        util=(frozen_util, source_util))
+
+
+##### InspectLoader concrete methods ###########################################
+class InspectLoaderSourceToCodeTests:
+
+    def source_to_module(self, data, path=None):
+        """Help with source_to_code() tests."""
+        module = types.ModuleType('blah')
+        loader = self.InspectLoaderSubclass()
+        if path is None:
+            code = loader.source_to_code(data)
+        else:
+            code = loader.source_to_code(data, path)
+        exec(code, module.__dict__)
+        return module
+
+    def test_source_to_code_source(self):
+        # Since compile() can handle strings, so should source_to_code().
+        source = 'attr = 42'
+        module = self.source_to_module(source)
+        self.assertTrue(hasattr(module, 'attr'))
+        self.assertEqual(module.attr, 42)
+
+    def test_source_to_code_bytes(self):
+        # Since compile() can handle bytes, so should source_to_code().
+        source = b'attr = 42'
+        module = self.source_to_module(source)
+        self.assertTrue(hasattr(module, 'attr'))
+        self.assertEqual(module.attr, 42)
+
+    def test_source_to_code_path(self):
+        # Specifying a path should set it for the code object.
+        path = 'path/to/somewhere'
+        loader = self.InspectLoaderSubclass()
+        code = loader.source_to_code('', path)
+        self.assertEqual(code.co_filename, path)
+
+    def test_source_to_code_no_path(self):
+        # Not setting a path should still work and be set to <string> since that
+        # is a pre-existing practice as a default to compile().
+        loader = self.InspectLoaderSubclass()
+        code = loader.source_to_code('')
+        self.assertEqual(code.co_filename, '<string>')
+
+
+class Frozen_ILSourceToCodeTests(InspectLoaderSourceToCodeTests, unittest.TestCase):
+    InspectLoaderSubclass = Frozen_IL
+
+class Source_ILSourceToCodeTests(InspectLoaderSourceToCodeTests, unittest.TestCase):
+    InspectLoaderSubclass = Source_IL
+
+
+class InspectLoaderGetCodeTests:
+
+    def test_get_code(self):
+        # Test success.
+        module = types.ModuleType('blah')
+        with mock.patch.object(self.InspectLoaderSubclass, 'get_source') as mocked:
+            mocked.return_value = 'attr = 42'
+            loader = self.InspectLoaderSubclass()
+            code = loader.get_code('blah')
+        exec(code, module.__dict__)
+        self.assertEqual(module.attr, 42)
+
+    def test_get_code_source_is_None(self):
+        # If get_source() is None then this should be None.
+        with mock.patch.object(self.InspectLoaderSubclass, 'get_source') as mocked:
+            mocked.return_value = None
+            loader = self.InspectLoaderSubclass()
+            code = loader.get_code('blah')
+        self.assertIsNone(code)
+
+    def test_get_code_source_not_found(self):
+        # If there is no source then there is no code object.
+        loader = self.InspectLoaderSubclass()
+        with self.assertRaises(ImportError):
+            loader.get_code('blah')
+
+
+class Frozen_ILGetCodeTests(InspectLoaderGetCodeTests, unittest.TestCase):
+    InspectLoaderSubclass = Frozen_IL
+
+class Source_ILGetCodeTests(InspectLoaderGetCodeTests, unittest.TestCase):
+    InspectLoaderSubclass = Source_IL
+
+
+class InspectLoaderLoadModuleTests:
+
+    """Test InspectLoader.load_module()."""
+
+    module_name = 'blah'
+
+    def setUp(self):
+        support.unload(self.module_name)
+        self.addCleanup(support.unload, self.module_name)
+
+    def mock_get_code(self):
+        return mock.patch.object(self.InspectLoaderSubclass, 'get_code')
+
+    def test_get_code_ImportError(self):
+        # If get_code() raises ImportError, it should propagate.
+        with self.mock_get_code() as mocked_get_code:
+            mocked_get_code.side_effect = ImportError
+            with self.assertRaises(ImportError):
+                loader = self.InspectLoaderSubclass()
+                with warnings.catch_warnings():
+                    warnings.simplefilter('ignore', DeprecationWarning)
+                    loader.load_module(self.module_name)
+
+    def test_get_code_None(self):
+        # If get_code() returns None, raise ImportError.
+        with self.mock_get_code() as mocked_get_code:
+            mocked_get_code.return_value = None
+            with self.assertRaises(ImportError):
+                loader = self.InspectLoaderSubclass()
+                loader.load_module(self.module_name)
+
+    def test_module_returned(self):
+        # The loaded module should be returned.
+        code = compile('attr = 42', '<string>', 'exec')
+        with self.mock_get_code() as mocked_get_code:
+            mocked_get_code.return_value = code
+            loader = self.InspectLoaderSubclass()
+            module = loader.load_module(self.module_name)
+            self.assertEqual(module, sys.modules[self.module_name])
+
+
+class Frozen_ILLoadModuleTests(InspectLoaderLoadModuleTests, unittest.TestCase):
+    InspectLoaderSubclass = Frozen_IL
+
+class Source_ILLoadModuleTests(InspectLoaderLoadModuleTests, unittest.TestCase):
+    InspectLoaderSubclass = Source_IL
+
+
+##### ExecutionLoader concrete methods #########################################
+class ExecutionLoaderGetCodeTests:
+
+    def mock_methods(self, *, get_source=False, get_filename=False):
+        source_mock_context, filename_mock_context = None, None
+        if get_source:
+            source_mock_context = mock.patch.object(self.ExecutionLoaderSubclass,
+                                                    'get_source')
+        if get_filename:
+            filename_mock_context = mock.patch.object(self.ExecutionLoaderSubclass,
+                                                      'get_filename')
+        return source_mock_context, filename_mock_context
+
+    def test_get_code(self):
+        path = 'blah.py'
+        source_mock_context, filename_mock_context = self.mock_methods(
+                get_source=True, get_filename=True)
+        with source_mock_context as source_mock, filename_mock_context as name_mock:
+            source_mock.return_value = 'attr = 42'
+            name_mock.return_value = path
+            loader = self.ExecutionLoaderSubclass()
+            code = loader.get_code('blah')
+        self.assertEqual(code.co_filename, path)
+        module = types.ModuleType('blah')
+        exec(code, module.__dict__)
+        self.assertEqual(module.attr, 42)
+
+    def test_get_code_source_is_None(self):
+        # If get_source() is None then this should be None.
+        source_mock_context, _ = self.mock_methods(get_source=True)
+        with source_mock_context as mocked:
+            mocked.return_value = None
+            loader = self.ExecutionLoaderSubclass()
+            code = loader.get_code('blah')
+        self.assertIsNone(code)
+
+    def test_get_code_source_not_found(self):
+        # If there is no source then there is no code object.
+        loader = self.ExecutionLoaderSubclass()
+        with self.assertRaises(ImportError):
+            loader.get_code('blah')
+
+    def test_get_code_no_path(self):
+        # If get_filename() raises ImportError then simply skip setting the path
+        # on the code object.
+        source_mock_context, filename_mock_context = self.mock_methods(
+                get_source=True, get_filename=True)
+        with source_mock_context as source_mock, filename_mock_context as name_mock:
+            source_mock.return_value = 'attr = 42'
+            name_mock.side_effect = ImportError
+            loader = self.ExecutionLoaderSubclass()
+            code = loader.get_code('blah')
+        self.assertEqual(code.co_filename, '<string>')
+        module = types.ModuleType('blah')
+        exec(code, module.__dict__)
+        self.assertEqual(module.attr, 42)
+
+
+class Frozen_ELGetCodeTests(ExecutionLoaderGetCodeTests, unittest.TestCase):
+    ExecutionLoaderSubclass = Frozen_EL
+
+class Source_ELGetCodeTests(ExecutionLoaderGetCodeTests, unittest.TestCase):
+    ExecutionLoaderSubclass = Source_EL
+
+
+##### SourceLoader concrete methods ############################################
+class SourceLoader:
+
+    # Globals that should be defined for all modules.
+    source = (b"_ = '::'.join([__name__, __file__, __cached__, __package__, "
+              b"repr(__loader__)])")
+
+    def __init__(self, path):
+        self.path = path
+
+    def get_data(self, path):
+        if path != self.path:
+            raise IOError
+        return self.source
+
+    def get_filename(self, fullname):
+        return self.path
+
+    def module_repr(self, module):
+        return '<module>'
+
+
+Frozen_SourceOnlyL, Source_SourceOnlyL = make_abc_subclasses(SourceLoader)
+
+
+class SourceLoader(SourceLoader):
+
+    source_mtime = 1
+
+    def __init__(self, path, magic=None):
+        super().__init__(path)
+        self.bytecode_path = self.util.cache_from_source(self.path)
+        self.source_size = len(self.source)
+        if magic is None:
+            magic = self.util.MAGIC_NUMBER
+        data = bytearray(magic)
+        data.extend(self.init._w_long(self.source_mtime))
+        data.extend(self.init._w_long(self.source_size))
+        code_object = compile(self.source, self.path, 'exec',
+                                dont_inherit=True)
+        data.extend(marshal.dumps(code_object))
+        self.bytecode = bytes(data)
+        self.written = {}
+
+    def get_data(self, path):
+        if path == self.path:
+            return super().get_data(path)
+        elif path == self.bytecode_path:
+            return self.bytecode
+        else:
+            raise OSError
+
+    def path_stats(self, path):
+        if path != self.path:
+            raise IOError
+        return {'mtime': self.source_mtime, 'size': self.source_size}
+
+    def set_data(self, path, data):
+        self.written[path] = bytes(data)
+        return path == self.bytecode_path
+
+
+Frozen_SL, Source_SL = make_abc_subclasses(SourceLoader)
+Frozen_SL.util = frozen_util
+Source_SL.util = source_util
+Frozen_SL.init = frozen_init
+Source_SL.init = source_init
+
+
+class SourceLoaderTestHarness:
+
+    def setUp(self, *, is_package=True, **kwargs):
+        self.package = 'pkg'
+        if is_package:
+            self.path = os.path.join(self.package, '__init__.py')
+            self.name = self.package
+        else:
+            module_name = 'mod'
+            self.path = os.path.join(self.package, '.'.join(['mod', 'py']))
+            self.name = '.'.join([self.package, module_name])
+        self.cached = self.util.cache_from_source(self.path)
+        self.loader = self.loader_mock(self.path, **kwargs)
+
+    def verify_module(self, module):
+        self.assertEqual(module.__name__, self.name)
+        self.assertEqual(module.__file__, self.path)
+        self.assertEqual(module.__cached__, self.cached)
+        self.assertEqual(module.__package__, self.package)
+        self.assertEqual(module.__loader__, self.loader)
+        values = module._.split('::')
+        self.assertEqual(values[0], self.name)
+        self.assertEqual(values[1], self.path)
+        self.assertEqual(values[2], self.cached)
+        self.assertEqual(values[3], self.package)
+        self.assertEqual(values[4], repr(self.loader))
+
+    def verify_code(self, code_object):
+        module = types.ModuleType(self.name)
+        module.__file__ = self.path
+        module.__cached__ = self.cached
+        module.__package__ = self.package
+        module.__loader__ = self.loader
+        module.__path__ = []
+        exec(code_object, module.__dict__)
+        self.verify_module(module)
+
+
+class SourceOnlyLoaderTests(SourceLoaderTestHarness):
+
+    """Test importlib.abc.SourceLoader for source-only loading.
+
+    Reload testing is subsumed by the tests for
+    importlib.util.module_for_loader.
+
+    """
+
+    def test_get_source(self):
+        # Verify the source code is returned as a string.
+        # If an OSError is raised by get_data then raise ImportError.
+        expected_source = self.loader.source.decode('utf-8')
+        self.assertEqual(self.loader.get_source(self.name), expected_source)
+        def raise_OSError(path):
+            raise OSError
+        self.loader.get_data = raise_OSError
+        with self.assertRaises(ImportError) as cm:
+            self.loader.get_source(self.name)
+        self.assertEqual(cm.exception.name, self.name)
+
+    def test_is_package(self):
+        # Properly detect when loading a package.
+        self.setUp(is_package=False)
+        self.assertFalse(self.loader.is_package(self.name))
+        self.setUp(is_package=True)
+        self.assertTrue(self.loader.is_package(self.name))
+        self.assertFalse(self.loader.is_package(self.name + '.__init__'))
+
+    def test_get_code(self):
+        # Verify the code object is created.
+        code_object = self.loader.get_code(self.name)
+        self.verify_code(code_object)
+
+    def test_source_to_code(self):
+        # Verify the compiled code object.
+        code = self.loader.source_to_code(self.loader.source, self.path)
+        self.verify_code(code)
+
+    def test_load_module(self):
+        # Loading a module should set __name__, __loader__, __package__,
+        # __path__ (for packages), __file__, and __cached__.
+        # The module should also be put into sys.modules.
+        with util.uncache(self.name):
+            with warnings.catch_warnings():
+                warnings.simplefilter('ignore', DeprecationWarning)
+                module = self.loader.load_module(self.name)
+            self.verify_module(module)
+            self.assertEqual(module.__path__, [os.path.dirname(self.path)])
+            self.assertIn(self.name, sys.modules)
+
+    def test_package_settings(self):
+        # __package__ needs to be set, while __path__ is set on if the module
+        # is a package.
+        # Testing the values for a package are covered by test_load_module.
+        self.setUp(is_package=False)
+        with util.uncache(self.name):
+            with warnings.catch_warnings():
+                warnings.simplefilter('ignore', DeprecationWarning)
+                module = self.loader.load_module(self.name)
+            self.verify_module(module)
+            self.assertFalse(hasattr(module, '__path__'))
+
+    def test_get_source_encoding(self):
+        # Source is considered encoded in UTF-8 by default unless otherwise
+        # specified by an encoding line.
+        source = "_ = 'ü'"
+        self.loader.source = source.encode('utf-8')
+        returned_source = self.loader.get_source(self.name)
+        self.assertEqual(returned_source, source)
+        source = "# coding: latin-1\n_ = ü"
+        self.loader.source = source.encode('latin-1')
+        returned_source = self.loader.get_source(self.name)
+        self.assertEqual(returned_source, source)
+
+
+class Frozen_SourceOnlyLTests(SourceOnlyLoaderTests, unittest.TestCase):
+    loader_mock = Frozen_SourceOnlyL
+    util = frozen_util
+
+class Source_SourceOnlyLTests(SourceOnlyLoaderTests, unittest.TestCase):
+    loader_mock = Source_SourceOnlyL
+    util = source_util
+
+
+@unittest.skipIf(sys.dont_write_bytecode, "sys.dont_write_bytecode is true")
+class SourceLoaderBytecodeTests(SourceLoaderTestHarness):
+
+    """Test importlib.abc.SourceLoader's use of bytecode.
+
+    Source-only testing handled by SourceOnlyLoaderTests.
+
+    """
+
+    def verify_code(self, code_object, *, bytecode_written=False):
+        super().verify_code(code_object)
+        if bytecode_written:
+            self.assertIn(self.cached, self.loader.written)
+            data = bytearray(self.util.MAGIC_NUMBER)
+            data.extend(self.init._w_long(self.loader.source_mtime))
+            data.extend(self.init._w_long(self.loader.source_size))
+            data.extend(marshal.dumps(code_object))
+            self.assertEqual(self.loader.written[self.cached], bytes(data))
+
+    def test_code_with_everything(self):
+        # When everything should work.
+        code_object = self.loader.get_code(self.name)
+        self.verify_code(code_object)
+
+    def test_no_bytecode(self):
+        # If no bytecode exists then move on to the source.
+        self.loader.bytecode_path = "<does not exist>"
+        # Sanity check
+        with self.assertRaises(OSError):
+            bytecode_path = self.util.cache_from_source(self.path)
+            self.loader.get_data(bytecode_path)
+        code_object = self.loader.get_code(self.name)
+        self.verify_code(code_object, bytecode_written=True)
+
+    def test_code_bad_timestamp(self):
+        # Bytecode is only used when the timestamp matches the source EXACTLY.
+        for source_mtime in (0, 2):
+            assert source_mtime != self.loader.source_mtime
+            original = self.loader.source_mtime
+            self.loader.source_mtime = source_mtime
+            # If bytecode is used then EOFError would be raised by marshal.
+            self.loader.bytecode = self.loader.bytecode[8:]
+            code_object = self.loader.get_code(self.name)
+            self.verify_code(code_object, bytecode_written=True)
+            self.loader.source_mtime = original
+
+    def test_code_bad_magic(self):
+        # Skip over bytecode with a bad magic number.
+        self.setUp(magic=b'0000')
+        # If bytecode is used then EOFError would be raised by marshal.
+        self.loader.bytecode = self.loader.bytecode[8:]
+        code_object = self.loader.get_code(self.name)
+        self.verify_code(code_object, bytecode_written=True)
+
+    def test_dont_write_bytecode(self):
+        # Bytecode is not written if sys.dont_write_bytecode is true.
+        # Can assume it is false already thanks to the skipIf class decorator.
+        try:
+            sys.dont_write_bytecode = True
+            self.loader.bytecode_path = "<does not exist>"
+            code_object = self.loader.get_code(self.name)
+            self.assertNotIn(self.cached, self.loader.written)
+        finally:
+            sys.dont_write_bytecode = False
+
+    def test_no_set_data(self):
+        # If set_data is not defined, one can still read bytecode.
+        self.setUp(magic=b'0000')
+        original_set_data = self.loader.__class__.mro()[1].set_data
+        try:
+            del self.loader.__class__.mro()[1].set_data
+            code_object = self.loader.get_code(self.name)
+            self.verify_code(code_object)
+        finally:
+            self.loader.__class__.mro()[1].set_data = original_set_data
+
+    def test_set_data_raises_exceptions(self):
+        # Raising NotImplementedError or OSError is okay for set_data.
+        def raise_exception(exc):
+            def closure(*args, **kwargs):
+                raise exc
+            return closure
+
+        self.setUp(magic=b'0000')
+        self.loader.set_data = raise_exception(NotImplementedError)
+        code_object = self.loader.get_code(self.name)
+        self.verify_code(code_object)
+
+
+class Frozen_SLBytecodeTests(SourceLoaderBytecodeTests, unittest.TestCase):
+    loader_mock = Frozen_SL
+    init = frozen_init
+    util = frozen_util
+
+class SourceSLBytecodeTests(SourceLoaderBytecodeTests, unittest.TestCase):
+    loader_mock = Source_SL
+    init = source_init
+    util = source_util
+
+
+class SourceLoaderGetSourceTests:
+
+    """Tests for importlib.abc.SourceLoader.get_source()."""
+
+    def test_default_encoding(self):
+        # Should have no problems with UTF-8 text.
+        name = 'mod'
+        mock = self.SourceOnlyLoaderMock('mod.file')
+        source = 'x = "ü"'
+        mock.source = source.encode('utf-8')
+        returned_source = mock.get_source(name)
+        self.assertEqual(returned_source, source)
+
+    def test_decoded_source(self):
+        # Decoding should work.
+        name = 'mod'
+        mock = self.SourceOnlyLoaderMock("mod.file")
+        source = "# coding: Latin-1\nx='ü'"
+        assert source.encode('latin-1') != source.encode('utf-8')
+        mock.source = source.encode('latin-1')
+        returned_source = mock.get_source(name)
+        self.assertEqual(returned_source, source)
+
+    def test_universal_newlines(self):
+        # PEP 302 says universal newlines should be used.
+        name = 'mod'
+        mock = self.SourceOnlyLoaderMock('mod.file')
+        source = "x = 42\r\ny = -13\r\n"
+        mock.source = source.encode('utf-8')
+        expect = io.IncrementalNewlineDecoder(None, True).decode(source)
+        self.assertEqual(mock.get_source(name), expect)
+
+
+class Frozen_SourceOnlyLGetSourceTests(SourceLoaderGetSourceTests, unittest.TestCase):
+    SourceOnlyLoaderMock = Frozen_SourceOnlyL
+
+class Source_SourceOnlyLGetSourceTests(SourceLoaderGetSourceTests, unittest.TestCase):
+    SourceOnlyLoaderMock = Source_SourceOnlyL
 
 
 if __name__ == '__main__':
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_importlib/test_api.py b/Lib/test/test_importlib/test_api.py
index b1a5894..2a2d42b 100644
--- a/Lib/test/test_importlib/test_api.py
+++ b/Lib/test/test_importlib/test_api.py
@@ -1,14 +1,18 @@
 from . import util
-import imp
-import importlib
-from importlib import machinery
+
+frozen_init, source_init = util.import_importlib('importlib')
+frozen_util, source_util = util.import_importlib('importlib.util')
+frozen_machinery, source_machinery = util.import_importlib('importlib.machinery')
+
+import os.path
 import sys
 from test import support
 import types
 import unittest
+import warnings
 
 
-class ImportModuleTests(unittest.TestCase):
+class ImportModuleTests:
 
     """Test importlib.import_module."""
 
@@ -16,7 +20,7 @@
         # Test importing a top-level module.
         with util.mock_modules('top_level') as mock:
             with util.import_state(meta_path=[mock]):
-                module = importlib.import_module('top_level')
+                module = self.init.import_module('top_level')
                 self.assertEqual(module.__name__, 'top_level')
 
     def test_absolute_package_import(self):
@@ -26,7 +30,7 @@
         name = '{0}.mod'.format(pkg_name)
         with util.mock_modules(pkg_long_name, name) as mock:
             with util.import_state(meta_path=[mock]):
-                module = importlib.import_module(name)
+                module = self.init.import_module(name)
                 self.assertEqual(module.__name__, name)
 
     def test_shallow_relative_package_import(self):
@@ -38,17 +42,17 @@
         relative_name = '.{0}'.format(module_name)
         with util.mock_modules(pkg_long_name, absolute_name) as mock:
             with util.import_state(meta_path=[mock]):
-                importlib.import_module(pkg_name)
-                module = importlib.import_module(relative_name, pkg_name)
+                self.init.import_module(pkg_name)
+                module = self.init.import_module(relative_name, pkg_name)
                 self.assertEqual(module.__name__, absolute_name)
 
     def test_deep_relative_package_import(self):
         modules = ['a.__init__', 'a.b.__init__', 'a.c']
         with util.mock_modules(*modules) as mock:
             with util.import_state(meta_path=[mock]):
-                importlib.import_module('a')
-                importlib.import_module('a.b')
-                module = importlib.import_module('..c', 'a.b')
+                self.init.import_module('a')
+                self.init.import_module('a.b')
+                module = self.init.import_module('..c', 'a.b')
                 self.assertEqual(module.__name__, 'a.c')
 
     def test_absolute_import_with_package(self):
@@ -59,15 +63,15 @@
         name = '{0}.mod'.format(pkg_name)
         with util.mock_modules(pkg_long_name, name) as mock:
             with util.import_state(meta_path=[mock]):
-                importlib.import_module(pkg_name)
-                module = importlib.import_module(name, pkg_name)
+                self.init.import_module(pkg_name)
+                module = self.init.import_module(name, pkg_name)
                 self.assertEqual(module.__name__, name)
 
     def test_relative_import_wo_package(self):
         # Relative imports cannot happen without the 'package' argument being
         # set.
         with self.assertRaises(TypeError):
-            importlib.import_module('.support')
+            self.init.import_module('.support')
 
 
     def test_loaded_once(self):
@@ -76,7 +80,7 @@
         # module currently being imported.
         b_load_count = 0
         def load_a():
-            importlib.import_module('a.b')
+            self.init.import_module('a.b')
         def load_b():
             nonlocal b_load_count
             b_load_count += 1
@@ -84,11 +88,17 @@
         modules = ['a.__init__', 'a.b']
         with util.mock_modules(*modules, module_code=code) as mock:
             with util.import_state(meta_path=[mock]):
-                importlib.import_module('a.b')
+                self.init.import_module('a.b')
         self.assertEqual(b_load_count, 1)
 
+class Frozen_ImportModuleTests(ImportModuleTests, unittest.TestCase):
+    init = frozen_init
 
-class FindLoaderTests(unittest.TestCase):
+class Source_ImportModuleTests(ImportModuleTests, unittest.TestCase):
+    init = source_init
+
+
+class FindLoaderTests:
 
     class FakeMetaFinder:
         @staticmethod
@@ -98,29 +108,51 @@
         # If a module with __loader__ is in sys.modules, then return it.
         name = 'some_mod'
         with util.uncache(name):
-            module = imp.new_module(name)
+            module = types.ModuleType(name)
             loader = 'a loader!'
             module.__loader__ = loader
             sys.modules[name] = module
-            found = importlib.find_loader(name)
+            with warnings.catch_warnings():
+                warnings.simplefilter('ignore', DeprecationWarning)
+                found = self.init.find_loader(name)
             self.assertEqual(loader, found)
 
     def test_sys_modules_loader_is_None(self):
         # If sys.modules[name].__loader__ is None, raise ValueError.
         name = 'some_mod'
         with util.uncache(name):
-            module = imp.new_module(name)
+            module = types.ModuleType(name)
             module.__loader__ = None
             sys.modules[name] = module
             with self.assertRaises(ValueError):
-                importlib.find_loader(name)
+                with warnings.catch_warnings():
+                    warnings.simplefilter('ignore', DeprecationWarning)
+                    self.init.find_loader(name)
+
+    def test_sys_modules_loader_is_not_set(self):
+        # Should raise ValueError
+        # Issue #17099
+        name = 'some_mod'
+        with util.uncache(name):
+            module = types.ModuleType(name)
+            try:
+                del module.__loader__
+            except AttributeError:
+                pass
+            sys.modules[name] = module
+            with self.assertRaises(ValueError):
+                with warnings.catch_warnings():
+                    warnings.simplefilter('ignore', DeprecationWarning)
+                    self.init.find_loader(name)
 
     def test_success(self):
         # Return the loader found on sys.meta_path.
         name = 'some_mod'
         with util.uncache(name):
             with util.import_state(meta_path=[self.FakeMetaFinder]):
-                self.assertEqual((name, None), importlib.find_loader(name))
+                with warnings.catch_warnings():
+                    warnings.simplefilter('ignore', DeprecationWarning)
+                    self.assertEqual((name, None), self.init.find_loader(name))
 
     def test_success_path(self):
         # Searching on a path should work.
@@ -128,15 +160,201 @@
         path = 'path to some place'
         with util.uncache(name):
             with util.import_state(meta_path=[self.FakeMetaFinder]):
-                self.assertEqual((name, path),
-                                 importlib.find_loader(name, path))
+                with warnings.catch_warnings():
+                    warnings.simplefilter('ignore', DeprecationWarning)
+                    self.assertEqual((name, path),
+                                     self.init.find_loader(name, path))
 
     def test_nothing(self):
         # None is returned upon failure to find a loader.
-        self.assertIsNone(importlib.find_loader('nevergoingtofindthismodule'))
+        with warnings.catch_warnings():
+            warnings.simplefilter('ignore', DeprecationWarning)
+            self.assertIsNone(self.init.find_loader('nevergoingtofindthismodule'))
+
+class Frozen_FindLoaderTests(FindLoaderTests, unittest.TestCase):
+    init = frozen_init
+
+class Source_FindLoaderTests(FindLoaderTests, unittest.TestCase):
+    init = source_init
 
 
-class InvalidateCacheTests(unittest.TestCase):
+class ReloadTests:
+
+    """Test module reloading for builtin and extension modules."""
+
+    def test_reload_modules(self):
+        for mod in ('tokenize', 'time', 'marshal'):
+            with self.subTest(module=mod):
+                with support.CleanImport(mod):
+                    module = self.init.import_module(mod)
+                    self.init.reload(module)
+
+    def test_module_replaced(self):
+        def code():
+            import sys
+            module = type(sys)('top_level')
+            module.spam = 3
+            sys.modules['top_level'] = module
+        mock = util.mock_modules('top_level',
+                                 module_code={'top_level': code})
+        with mock:
+            with util.import_state(meta_path=[mock]):
+                module = self.init.import_module('top_level')
+                reloaded = self.init.reload(module)
+                actual = sys.modules['top_level']
+                self.assertEqual(actual.spam, 3)
+                self.assertEqual(reloaded.spam, 3)
+
+    def test_reload_missing_loader(self):
+        with support.CleanImport('types'):
+            import types
+            loader = types.__loader__
+            del types.__loader__
+            reloaded = self.init.reload(types)
+
+            self.assertIs(reloaded, types)
+            self.assertIs(sys.modules['types'], types)
+            self.assertEqual(reloaded.__loader__.path, loader.path)
+
+    def test_reload_loader_replaced(self):
+        with support.CleanImport('types'):
+            import types
+            types.__loader__ = None
+            self.init.invalidate_caches()
+            reloaded = self.init.reload(types)
+
+            self.assertIsNot(reloaded.__loader__, None)
+            self.assertIs(reloaded, types)
+            self.assertIs(sys.modules['types'], types)
+
+    def test_reload_location_changed(self):
+        name = 'spam'
+        with support.temp_cwd(None) as cwd:
+            with util.uncache('spam'):
+                with support.DirsOnSysPath(cwd):
+                    # Start as a plain module.
+                    self.init.invalidate_caches()
+                    path = os.path.join(cwd, name + '.py')
+                    cached = self.util.cache_from_source(path)
+                    expected = {'__name__': name,
+                                '__package__': '',
+                                '__file__': path,
+                                '__cached__': cached,
+                                '__doc__': None,
+                                }
+                    support.create_empty_file(path)
+                    module = self.init.import_module(name)
+                    ns = vars(module).copy()
+                    loader = ns.pop('__loader__')
+                    spec = ns.pop('__spec__')
+                    ns.pop('__builtins__', None)  # An implementation detail.
+                    self.assertEqual(spec.name, name)
+                    self.assertEqual(spec.loader, loader)
+                    self.assertEqual(loader.path, path)
+                    self.assertEqual(ns, expected)
+
+                    # Change to a package.
+                    self.init.invalidate_caches()
+                    init_path = os.path.join(cwd, name, '__init__.py')
+                    cached = self.util.cache_from_source(init_path)
+                    expected = {'__name__': name,
+                                '__package__': name,
+                                '__file__': init_path,
+                                '__cached__': cached,
+                                '__path__': [os.path.dirname(init_path)],
+                                '__doc__': None,
+                                }
+                    os.mkdir(name)
+                    os.rename(path, init_path)
+                    reloaded = self.init.reload(module)
+                    ns = vars(reloaded).copy()
+                    loader = ns.pop('__loader__')
+                    spec = ns.pop('__spec__')
+                    ns.pop('__builtins__', None)  # An implementation detail.
+                    self.assertEqual(spec.name, name)
+                    self.assertEqual(spec.loader, loader)
+                    self.assertIs(reloaded, module)
+                    self.assertEqual(loader.path, init_path)
+                    self.maxDiff = None
+                    self.assertEqual(ns, expected)
+
+    def test_reload_namespace_changed(self):
+        name = 'spam'
+        with support.temp_cwd(None) as cwd:
+            with util.uncache('spam'):
+                with support.DirsOnSysPath(cwd):
+                    # Start as a namespace package.
+                    self.init.invalidate_caches()
+                    bad_path = os.path.join(cwd, name, '__init.py')
+                    cached = self.util.cache_from_source(bad_path)
+                    expected = {'__name__': name,
+                                '__package__': name,
+                                '__doc__': None,
+                                }
+                    os.mkdir(name)
+                    with open(bad_path, 'w') as init_file:
+                        init_file.write('eggs = None')
+                    module = self.init.import_module(name)
+                    ns = vars(module).copy()
+                    loader = ns.pop('__loader__')
+                    path = ns.pop('__path__')
+                    spec = ns.pop('__spec__')
+                    ns.pop('__builtins__', None)  # An implementation detail.
+                    self.assertEqual(spec.name, name)
+                    self.assertIs(spec.loader, None)
+                    self.assertIsNot(loader, None)
+                    self.assertEqual(set(path),
+                                     set([os.path.dirname(bad_path)]))
+                    with self.assertRaises(AttributeError):
+                        # a NamespaceLoader
+                        loader.path
+                    self.assertEqual(ns, expected)
+
+                    # Change to a regular package.
+                    self.init.invalidate_caches()
+                    init_path = os.path.join(cwd, name, '__init__.py')
+                    cached = self.util.cache_from_source(init_path)
+                    expected = {'__name__': name,
+                                '__package__': name,
+                                '__file__': init_path,
+                                '__cached__': cached,
+                                '__path__': [os.path.dirname(init_path)],
+                                '__doc__': None,
+                                'eggs': None,
+                                }
+                    os.rename(bad_path, init_path)
+                    reloaded = self.init.reload(module)
+                    ns = vars(reloaded).copy()
+                    loader = ns.pop('__loader__')
+                    spec = ns.pop('__spec__')
+                    ns.pop('__builtins__', None)  # An implementation detail.
+                    self.assertEqual(spec.name, name)
+                    self.assertEqual(spec.loader, loader)
+                    self.assertIs(reloaded, module)
+                    self.assertEqual(loader.path, init_path)
+                    self.assertEqual(ns, expected)
+
+    def test_reload_submodule(self):
+        # See #19851.
+        name = 'spam'
+        subname = 'ham'
+        with util.temp_module(name, pkg=True) as pkg_dir:
+            fullname, _ = util.submodule(name, subname, pkg_dir)
+            ham = self.init.import_module(fullname)
+            reloaded = self.init.reload(ham)
+            self.assertIs(reloaded, ham)
+
+
+class Frozen_ReloadTests(ReloadTests, unittest.TestCase):
+    init = frozen_init
+    util = frozen_util
+
+class Source_ReloadTests(ReloadTests, unittest.TestCase):
+    init = source_init
+    util = source_util
+
+
+class InvalidateCacheTests:
 
     def test_method_called(self):
         # If defined the method should be called.
@@ -155,48 +373,65 @@
         self.addCleanup(lambda: sys.path_importer_cache.__delitem__(key))
         sys.path_importer_cache[key] = path_ins
         self.addCleanup(lambda: sys.meta_path.remove(meta_ins))
-        importlib.invalidate_caches()
+        self.init.invalidate_caches()
         self.assertTrue(meta_ins.called)
         self.assertTrue(path_ins.called)
 
     def test_method_lacking(self):
         # There should be no issues if the method is not defined.
         key = 'gobbledeegook'
-        sys.path_importer_cache[key] = imp.NullImporter('abc')
+        sys.path_importer_cache[key] = None
         self.addCleanup(lambda: sys.path_importer_cache.__delitem__(key))
-        importlib.invalidate_caches()  # Shouldn't trigger an exception.
+        self.init.invalidate_caches()  # Shouldn't trigger an exception.
+
+class Frozen_InvalidateCacheTests(InvalidateCacheTests, unittest.TestCase):
+    init = frozen_init
+
+class Source_InvalidateCacheTests(InvalidateCacheTests, unittest.TestCase):
+    init = source_init
 
 
 class FrozenImportlibTests(unittest.TestCase):
 
     def test_no_frozen_importlib(self):
         # Should be able to import w/o _frozen_importlib being defined.
-        module = support.import_fresh_module('importlib', blocked=['_frozen_importlib'])
-        self.assertFalse(isinstance(module.__loader__,
-                                    machinery.FrozenImporter))
+        # Can't do an isinstance() check since separate copies of importlib
+        # may have been used for import, so just check the name is not for the
+        # frozen loader.
+        self.assertNotEqual(source_init.__loader__.__class__.__name__,
+                            'FrozenImporter')
 
 
-class StartupTests(unittest.TestCase):
+class StartupTests:
 
     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__)
+                with self.subTest(name=name):
+                    self.assertTrue(hasattr(module, '__loader__'),
+                                    '{!r} lacks a __loader__ attribute'.format(name))
+                    if self.machinery.BuiltinImporter.find_module(name):
+                        self.assertIsNot(module.__loader__, None)
+                    elif self.machinery.FrozenImporter.find_module(name):
+                        self.assertIsNot(module.__loader__, None)
 
-def test_main():
-    from test.support import run_unittest
-    run_unittest(ImportModuleTests,
-                 FindLoaderTests,
-                 InvalidateCacheTests,
-                 FrozenImportlibTests,
-                 StartupTests)
+    def test_everyone_has___spec__(self):
+        for name, module in sys.modules.items():
+            if isinstance(module, types.ModuleType):
+                with self.subTest(name=name):
+                    self.assertTrue(hasattr(module, '__spec__'))
+                    if self.machinery.BuiltinImporter.find_module(name):
+                        self.assertIsNot(module.__spec__, None)
+                    elif self.machinery.FrozenImporter.find_module(name):
+                        self.assertIsNot(module.__spec__, None)
+
+class Frozen_StartupTests(StartupTests, unittest.TestCase):
+    machinery = frozen_machinery
+
+class Source_StartupTests(StartupTests, unittest.TestCase):
+    machinery = source_machinery
 
 
 if __name__ == '__main__':
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_importlib/test_locks.py b/Lib/test/test_importlib/test_locks.py
index c373b11..dc97ba1 100644
--- a/Lib/test/test_importlib/test_locks.py
+++ b/Lib/test/test_importlib/test_locks.py
@@ -1,4 +1,8 @@
-from importlib import _bootstrap
+from . import util
+frozen_init, source_init = util.import_importlib('importlib')
+frozen_bootstrap = frozen_init._bootstrap
+source_bootstrap = source_init._bootstrap
+
 import sys
 import time
 import unittest
@@ -13,14 +17,9 @@
 else:
     from test import lock_tests
 
-
-LockType = _bootstrap._ModuleLock
-DeadlockError = _bootstrap._DeadlockError
-
-
 if threading is not None:
-    class ModuleLockAsRLockTests(lock_tests.RLockTests):
-        locktype = staticmethod(lambda: LockType("some_lock"))
+    class ModuleLockAsRLockTests:
+        locktype = classmethod(lambda cls: cls.LockType("some_lock"))
 
         # _is_owned() unsupported
         test__is_owned = None
@@ -34,13 +33,21 @@
         # _release_save() unsupported
         test_release_save_unacquired = None
 
+    class Frozen_ModuleLockAsRLockTests(ModuleLockAsRLockTests, lock_tests.RLockTests):
+        LockType = frozen_bootstrap._ModuleLock
+
+    class Source_ModuleLockAsRLockTests(ModuleLockAsRLockTests, lock_tests.RLockTests):
+        LockType = source_bootstrap._ModuleLock
+
 else:
-    class ModuleLockAsRLockTests(unittest.TestCase):
+    class Frozen_ModuleLockAsRLockTests(unittest.TestCase):
+        pass
+
+    class Source_ModuleLockAsRLockTests(unittest.TestCase):
         pass
 
 
-@unittest.skipUnless(threading, "threads needed for this test")
-class DeadlockAvoidanceTests(unittest.TestCase):
+class DeadlockAvoidanceTests:
 
     def setUp(self):
         try:
@@ -55,7 +62,7 @@
 
     def run_deadlock_avoidance_test(self, create_deadlock):
         NLOCKS = 10
-        locks = [LockType(str(i)) for i in range(NLOCKS)]
+        locks = [self.LockType(str(i)) for i in range(NLOCKS)]
         pairs = [(locks[i], locks[(i+1)%NLOCKS]) for i in range(NLOCKS)]
         if create_deadlock:
             NTHREADS = NLOCKS
@@ -67,7 +74,7 @@
             """Try to acquire the lock. Return True on success, False on deadlock."""
             try:
                 lock.acquire()
-            except DeadlockError:
+            except self.DeadlockError:
                 return False
             else:
                 return True
@@ -99,30 +106,50 @@
         self.assertEqual(results.count((True, False)), 0)
         self.assertEqual(results.count((True, True)), len(results))
 
+@unittest.skipUnless(threading, "threads needed for this test")
+class Frozen_DeadlockAvoidanceTests(DeadlockAvoidanceTests, unittest.TestCase):
+    LockType = frozen_bootstrap._ModuleLock
+    DeadlockError = frozen_bootstrap._DeadlockError
 
-class LifetimeTests(unittest.TestCase):
+@unittest.skipUnless(threading, "threads needed for this test")
+class Source_DeadlockAvoidanceTests(DeadlockAvoidanceTests, unittest.TestCase):
+    LockType = source_bootstrap._ModuleLock
+    DeadlockError = source_bootstrap._DeadlockError
+
+
+class LifetimeTests:
 
     def test_lock_lifetime(self):
         name = "xyzzy"
-        self.assertNotIn(name, _bootstrap._module_locks)
-        lock = _bootstrap._get_module_lock(name)
-        self.assertIn(name, _bootstrap._module_locks)
+        self.assertNotIn(name, self.bootstrap._module_locks)
+        lock = self.bootstrap._get_module_lock(name)
+        self.assertIn(name, self.bootstrap._module_locks)
         wr = weakref.ref(lock)
         del lock
         support.gc_collect()
-        self.assertNotIn(name, _bootstrap._module_locks)
+        self.assertNotIn(name, self.bootstrap._module_locks)
         self.assertIsNone(wr())
 
     def test_all_locks(self):
         support.gc_collect()
-        self.assertEqual(0, len(_bootstrap._module_locks), _bootstrap._module_locks)
+        self.assertEqual(0, len(self.bootstrap._module_locks),
+                         self.bootstrap._module_locks)
+
+class Frozen_LifetimeTests(LifetimeTests, unittest.TestCase):
+    bootstrap = frozen_bootstrap
+
+class Source_LifetimeTests(LifetimeTests, unittest.TestCase):
+    bootstrap = source_bootstrap
 
 
 @support.reap_threads
 def test_main():
-    support.run_unittest(ModuleLockAsRLockTests,
-                         DeadlockAvoidanceTests,
-                         LifetimeTests)
+    support.run_unittest(Frozen_ModuleLockAsRLockTests,
+                         Source_ModuleLockAsRLockTests,
+                         Frozen_DeadlockAvoidanceTests,
+                         Source_DeadlockAvoidanceTests,
+                         Frozen_LifetimeTests,
+                         Source_LifetimeTests)
 
 
 if __name__ == '__main__':
diff --git a/Lib/test/test_namespace_pkgs.py b/Lib/test/test_importlib/test_namespace_pkgs.py
similarity index 98%
rename from Lib/test/test_namespace_pkgs.py
rename to Lib/test/test_importlib/test_namespace_pkgs.py
index 7067b12..6639612 100644
--- a/Lib/test/test_namespace_pkgs.py
+++ b/Lib/test/test_importlib/test_namespace_pkgs.py
@@ -1,7 +1,10 @@
-import sys
 import contextlib
-import unittest
+import importlib.abc
+import importlib.machinery
 import os
+import sys
+import types
+import unittest
 
 from test.test_importlib import util
 from test.support import run_unittest
@@ -286,9 +289,5 @@
         self.assertEqual(a_test.attr, 'in module')
 
 
-def test_main():
-    run_unittest(*NamespacePackageTest.__subclasses__())
-
-
 if __name__ == "__main__":
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_importlib/test_spec.py b/Lib/test/test_importlib/test_spec.py
new file mode 100644
index 0000000..71541f6
--- /dev/null
+++ b/Lib/test/test_importlib/test_spec.py
@@ -0,0 +1,957 @@
+from . import util
+
+frozen_init, source_init = util.import_importlib('importlib')
+frozen_bootstrap = frozen_init._bootstrap
+source_bootstrap = source_init._bootstrap
+frozen_machinery, source_machinery = util.import_importlib('importlib.machinery')
+frozen_util, source_util = util.import_importlib('importlib.util')
+
+import os.path
+from test.support import CleanImport
+import unittest
+import sys
+import warnings
+
+
+
+class TestLoader:
+
+    def __init__(self, path=None, is_package=None):
+        self.path = path
+        self.package = is_package
+
+    def __repr__(self):
+        return '<TestLoader object>'
+
+    def __getattr__(self, name):
+        if name == 'get_filename' and self.path is not None:
+            return self._get_filename
+        if name == 'is_package':
+            return self._is_package
+        raise AttributeError(name)
+
+    def _get_filename(self, name):
+        return self.path
+
+    def _is_package(self, name):
+        return self.package
+
+
+class NewLoader(TestLoader):
+
+    EGGS = 1
+
+    def exec_module(self, module):
+        module.eggs = self.EGGS
+
+
+class LegacyLoader(TestLoader):
+
+    HAM = -1
+
+    with warnings.catch_warnings():
+        warnings.simplefilter("ignore", DeprecationWarning)
+
+        @frozen_util.module_for_loader
+        def load_module(self, module):
+            module.ham = self.HAM
+            return module
+
+
+class ModuleSpecTests:
+
+    def setUp(self):
+        self.name = 'spam'
+        self.path = 'spam.py'
+        self.cached = self.util.cache_from_source(self.path)
+        self.loader = TestLoader()
+        self.spec = self.machinery.ModuleSpec(self.name, self.loader)
+        self.loc_spec = self.machinery.ModuleSpec(self.name, self.loader,
+                                                  origin=self.path)
+        self.loc_spec._set_fileattr = True
+
+    def test_default(self):
+        spec = self.machinery.ModuleSpec(self.name, self.loader)
+
+        self.assertEqual(spec.name, self.name)
+        self.assertEqual(spec.loader, self.loader)
+        self.assertIs(spec.origin, None)
+        self.assertIs(spec.loader_state, None)
+        self.assertIs(spec.submodule_search_locations, None)
+        self.assertIs(spec.cached, None)
+        self.assertFalse(spec.has_location)
+
+    def test_default_no_loader(self):
+        spec = self.machinery.ModuleSpec(self.name, None)
+
+        self.assertEqual(spec.name, self.name)
+        self.assertIs(spec.loader, None)
+        self.assertIs(spec.origin, None)
+        self.assertIs(spec.loader_state, None)
+        self.assertIs(spec.submodule_search_locations, None)
+        self.assertIs(spec.cached, None)
+        self.assertFalse(spec.has_location)
+
+    def test_default_is_package_false(self):
+        spec = self.machinery.ModuleSpec(self.name, self.loader,
+                                         is_package=False)
+
+        self.assertEqual(spec.name, self.name)
+        self.assertEqual(spec.loader, self.loader)
+        self.assertIs(spec.origin, None)
+        self.assertIs(spec.loader_state, None)
+        self.assertIs(spec.submodule_search_locations, None)
+        self.assertIs(spec.cached, None)
+        self.assertFalse(spec.has_location)
+
+    def test_default_is_package_true(self):
+        spec = self.machinery.ModuleSpec(self.name, self.loader,
+                                         is_package=True)
+
+        self.assertEqual(spec.name, self.name)
+        self.assertEqual(spec.loader, self.loader)
+        self.assertIs(spec.origin, None)
+        self.assertIs(spec.loader_state, None)
+        self.assertEqual(spec.submodule_search_locations, [])
+        self.assertIs(spec.cached, None)
+        self.assertFalse(spec.has_location)
+
+    def test_has_location_setter(self):
+        spec = self.machinery.ModuleSpec(self.name, self.loader,
+                                         origin='somewhere')
+        self.assertFalse(spec.has_location)
+        spec.has_location = True
+        self.assertTrue(spec.has_location)
+
+    def test_equality(self):
+        other = type(sys.implementation)(name=self.name,
+                                         loader=self.loader,
+                                         origin=None,
+                                         submodule_search_locations=None,
+                                         has_location=False,
+                                         cached=None,
+                                         )
+
+        self.assertTrue(self.spec == other)
+
+    def test_equality_location(self):
+        other = type(sys.implementation)(name=self.name,
+                                         loader=self.loader,
+                                         origin=self.path,
+                                         submodule_search_locations=None,
+                                         has_location=True,
+                                         cached=self.cached,
+                                         )
+
+        self.assertEqual(self.loc_spec, other)
+
+    def test_inequality(self):
+        other = type(sys.implementation)(name='ham',
+                                         loader=self.loader,
+                                         origin=None,
+                                         submodule_search_locations=None,
+                                         has_location=False,
+                                         cached=None,
+                                         )
+
+        self.assertNotEqual(self.spec, other)
+
+    def test_inequality_incomplete(self):
+        other = type(sys.implementation)(name=self.name,
+                                         loader=self.loader,
+                                         )
+
+        self.assertNotEqual(self.spec, other)
+
+    def test_package(self):
+        spec = self.machinery.ModuleSpec('spam.eggs', self.loader)
+
+        self.assertEqual(spec.parent, 'spam')
+
+    def test_package_is_package(self):
+        spec = self.machinery.ModuleSpec('spam.eggs', self.loader,
+                                         is_package=True)
+
+        self.assertEqual(spec.parent, 'spam.eggs')
+
+    # cached
+
+    def test_cached_set(self):
+        before = self.spec.cached
+        self.spec.cached = 'there'
+        after = self.spec.cached
+
+        self.assertIs(before, None)
+        self.assertEqual(after, 'there')
+
+    def test_cached_no_origin(self):
+        spec = self.machinery.ModuleSpec(self.name, self.loader)
+
+        self.assertIs(spec.cached, None)
+
+    def test_cached_with_origin_not_location(self):
+        spec = self.machinery.ModuleSpec(self.name, self.loader,
+                                         origin=self.path)
+
+        self.assertIs(spec.cached, None)
+
+    def test_cached_source(self):
+        expected = self.util.cache_from_source(self.path)
+
+        self.assertEqual(self.loc_spec.cached, expected)
+
+    def test_cached_source_unknown_suffix(self):
+        self.loc_spec.origin = 'spam.spamspamspam'
+
+        self.assertIs(self.loc_spec.cached, None)
+
+    def test_cached_source_missing_cache_tag(self):
+        original = sys.implementation.cache_tag
+        sys.implementation.cache_tag = None
+        try:
+            cached = self.loc_spec.cached
+        finally:
+            sys.implementation.cache_tag = original
+
+        self.assertIs(cached, None)
+
+    def test_cached_sourceless(self):
+        self.loc_spec.origin = 'spam.pyc'
+
+        self.assertEqual(self.loc_spec.cached, 'spam.pyc')
+
+
+class Frozen_ModuleSpecTests(ModuleSpecTests, unittest.TestCase):
+    util = frozen_util
+    machinery = frozen_machinery
+
+
+class Source_ModuleSpecTests(ModuleSpecTests, unittest.TestCase):
+    util = source_util
+    machinery = source_machinery
+
+
+class ModuleSpecMethodsTests:
+
+    def setUp(self):
+        self.name = 'spam'
+        self.path = 'spam.py'
+        self.cached = self.util.cache_from_source(self.path)
+        self.loader = TestLoader()
+        self.spec = self.machinery.ModuleSpec(self.name, self.loader)
+        self.loc_spec = self.machinery.ModuleSpec(self.name, self.loader,
+                                                  origin=self.path)
+        self.loc_spec._set_fileattr = True
+
+    # init_module_attrs
+
+    def test_init_module_attrs(self):
+        module = type(sys)(self.name)
+        spec = self.machinery.ModuleSpec(self.name, self.loader)
+        self.bootstrap._SpecMethods(spec).init_module_attrs(module)
+
+        self.assertEqual(module.__name__, spec.name)
+        self.assertIs(module.__loader__, spec.loader)
+        self.assertEqual(module.__package__, spec.parent)
+        self.assertIs(module.__spec__, spec)
+        self.assertFalse(hasattr(module, '__path__'))
+        self.assertFalse(hasattr(module, '__file__'))
+        self.assertFalse(hasattr(module, '__cached__'))
+
+    def test_init_module_attrs_package(self):
+        module = type(sys)(self.name)
+        spec = self.machinery.ModuleSpec(self.name, self.loader)
+        spec.submodule_search_locations = ['spam', 'ham']
+        self.bootstrap._SpecMethods(spec).init_module_attrs(module)
+
+        self.assertEqual(module.__name__, spec.name)
+        self.assertIs(module.__loader__, spec.loader)
+        self.assertEqual(module.__package__, spec.parent)
+        self.assertIs(module.__spec__, spec)
+        self.assertIs(module.__path__, spec.submodule_search_locations)
+        self.assertFalse(hasattr(module, '__file__'))
+        self.assertFalse(hasattr(module, '__cached__'))
+
+    def test_init_module_attrs_location(self):
+        module = type(sys)(self.name)
+        spec = self.loc_spec
+        self.bootstrap._SpecMethods(spec).init_module_attrs(module)
+
+        self.assertEqual(module.__name__, spec.name)
+        self.assertIs(module.__loader__, spec.loader)
+        self.assertEqual(module.__package__, spec.parent)
+        self.assertIs(module.__spec__, spec)
+        self.assertFalse(hasattr(module, '__path__'))
+        self.assertEqual(module.__file__, spec.origin)
+        self.assertEqual(module.__cached__,
+                         self.util.cache_from_source(spec.origin))
+
+    def test_init_module_attrs_different_name(self):
+        module = type(sys)('eggs')
+        spec = self.machinery.ModuleSpec(self.name, self.loader)
+        self.bootstrap._SpecMethods(spec).init_module_attrs(module)
+
+        self.assertEqual(module.__name__, spec.name)
+
+    def test_init_module_attrs_different_spec(self):
+        module = type(sys)(self.name)
+        module.__spec__ = self.machinery.ModuleSpec('eggs', object())
+        spec = self.machinery.ModuleSpec(self.name, self.loader)
+        self.bootstrap._SpecMethods(spec).init_module_attrs(module)
+
+        self.assertEqual(module.__name__, spec.name)
+        self.assertIs(module.__loader__, spec.loader)
+        self.assertEqual(module.__package__, spec.parent)
+        self.assertIs(module.__spec__, spec)
+
+    def test_init_module_attrs_already_set(self):
+        module = type(sys)('ham.eggs')
+        module.__loader__ = object()
+        module.__package__ = 'ham'
+        module.__path__ = ['eggs']
+        module.__file__ = 'ham/eggs/__init__.py'
+        module.__cached__ = self.util.cache_from_source(module.__file__)
+        original = vars(module).copy()
+        spec = self.loc_spec
+        spec.submodule_search_locations = ['']
+        self.bootstrap._SpecMethods(spec).init_module_attrs(module)
+
+        self.assertIs(module.__loader__, original['__loader__'])
+        self.assertEqual(module.__package__, original['__package__'])
+        self.assertIs(module.__path__, original['__path__'])
+        self.assertEqual(module.__file__, original['__file__'])
+        self.assertEqual(module.__cached__, original['__cached__'])
+
+    def test_init_module_attrs_immutable(self):
+        module = object()
+        spec = self.loc_spec
+        spec.submodule_search_locations = ['']
+        self.bootstrap._SpecMethods(spec).init_module_attrs(module)
+
+        self.assertFalse(hasattr(module, '__name__'))
+        self.assertFalse(hasattr(module, '__loader__'))
+        self.assertFalse(hasattr(module, '__package__'))
+        self.assertFalse(hasattr(module, '__spec__'))
+        self.assertFalse(hasattr(module, '__path__'))
+        self.assertFalse(hasattr(module, '__file__'))
+        self.assertFalse(hasattr(module, '__cached__'))
+
+    # create()
+
+    def test_create(self):
+        created = self.bootstrap._SpecMethods(self.spec).create()
+
+        self.assertEqual(created.__name__, self.spec.name)
+        self.assertIs(created.__loader__, self.spec.loader)
+        self.assertEqual(created.__package__, self.spec.parent)
+        self.assertIs(created.__spec__, self.spec)
+        self.assertFalse(hasattr(created, '__path__'))
+        self.assertFalse(hasattr(created, '__file__'))
+        self.assertFalse(hasattr(created, '__cached__'))
+
+    def test_create_from_loader(self):
+        module = type(sys.implementation)()
+        class CreatingLoader(TestLoader):
+            def create_module(self, spec):
+                return module
+        self.spec.loader = CreatingLoader()
+        created = self.bootstrap._SpecMethods(self.spec).create()
+
+        self.assertIs(created, module)
+        self.assertEqual(created.__name__, self.spec.name)
+        self.assertIs(created.__loader__, self.spec.loader)
+        self.assertEqual(created.__package__, self.spec.parent)
+        self.assertIs(created.__spec__, self.spec)
+        self.assertFalse(hasattr(created, '__path__'))
+        self.assertFalse(hasattr(created, '__file__'))
+        self.assertFalse(hasattr(created, '__cached__'))
+
+    def test_create_from_loader_not_handled(self):
+        class CreatingLoader(TestLoader):
+            def create_module(self, spec):
+                return None
+        self.spec.loader = CreatingLoader()
+        created = self.bootstrap._SpecMethods(self.spec).create()
+
+        self.assertEqual(created.__name__, self.spec.name)
+        self.assertIs(created.__loader__, self.spec.loader)
+        self.assertEqual(created.__package__, self.spec.parent)
+        self.assertIs(created.__spec__, self.spec)
+        self.assertFalse(hasattr(created, '__path__'))
+        self.assertFalse(hasattr(created, '__file__'))
+        self.assertFalse(hasattr(created, '__cached__'))
+
+    # exec()
+
+    def test_exec(self):
+        self.spec.loader = NewLoader()
+        module = self.bootstrap._SpecMethods(self.spec).create()
+        sys.modules[self.name] = module
+        self.assertFalse(hasattr(module, 'eggs'))
+        self.bootstrap._SpecMethods(self.spec).exec(module)
+
+        self.assertEqual(module.eggs, 1)
+
+    # load()
+
+    def test_load(self):
+        self.spec.loader = NewLoader()
+        with CleanImport(self.spec.name):
+            loaded = self.bootstrap._SpecMethods(self.spec).load()
+            installed = sys.modules[self.spec.name]
+
+        self.assertEqual(loaded.eggs, 1)
+        self.assertIs(loaded, installed)
+
+    def test_load_replaced(self):
+        replacement = object()
+        class ReplacingLoader(TestLoader):
+            def exec_module(self, module):
+                sys.modules[module.__name__] = replacement
+        self.spec.loader = ReplacingLoader()
+        with CleanImport(self.spec.name):
+            loaded = self.bootstrap._SpecMethods(self.spec).load()
+            installed = sys.modules[self.spec.name]
+
+        self.assertIs(loaded, replacement)
+        self.assertIs(installed, replacement)
+
+    def test_load_failed(self):
+        class FailedLoader(TestLoader):
+            def exec_module(self, module):
+                raise RuntimeError
+        self.spec.loader = FailedLoader()
+        with CleanImport(self.spec.name):
+            with self.assertRaises(RuntimeError):
+                loaded = self.bootstrap._SpecMethods(self.spec).load()
+            self.assertNotIn(self.spec.name, sys.modules)
+
+    def test_load_failed_removed(self):
+        class FailedLoader(TestLoader):
+            def exec_module(self, module):
+                del sys.modules[module.__name__]
+                raise RuntimeError
+        self.spec.loader = FailedLoader()
+        with CleanImport(self.spec.name):
+            with self.assertRaises(RuntimeError):
+                loaded = self.bootstrap._SpecMethods(self.spec).load()
+            self.assertNotIn(self.spec.name, sys.modules)
+
+    def test_load_legacy(self):
+        self.spec.loader = LegacyLoader()
+        with CleanImport(self.spec.name):
+            loaded = self.bootstrap._SpecMethods(self.spec).load()
+
+        self.assertEqual(loaded.ham, -1)
+
+    def test_load_legacy_attributes(self):
+        self.spec.loader = LegacyLoader()
+        with CleanImport(self.spec.name):
+            loaded = self.bootstrap._SpecMethods(self.spec).load()
+
+        self.assertIs(loaded.__loader__, self.spec.loader)
+        self.assertEqual(loaded.__package__, self.spec.parent)
+        self.assertIs(loaded.__spec__, self.spec)
+
+    def test_load_legacy_attributes_immutable(self):
+        module = object()
+        class ImmutableLoader(TestLoader):
+            def load_module(self, name):
+                sys.modules[name] = module
+                return module
+        self.spec.loader = ImmutableLoader()
+        with CleanImport(self.spec.name):
+            loaded = self.bootstrap._SpecMethods(self.spec).load()
+
+            self.assertIs(sys.modules[self.spec.name], module)
+
+    # reload()
+
+    def test_reload(self):
+        self.spec.loader = NewLoader()
+        with CleanImport(self.spec.name):
+            loaded = self.bootstrap._SpecMethods(self.spec).load()
+            reloaded = self.bootstrap._SpecMethods(self.spec).exec(loaded)
+            installed = sys.modules[self.spec.name]
+
+        self.assertEqual(loaded.eggs, 1)
+        self.assertIs(reloaded, loaded)
+        self.assertIs(installed, loaded)
+
+    def test_reload_modified(self):
+        self.spec.loader = NewLoader()
+        with CleanImport(self.spec.name):
+            loaded = self.bootstrap._SpecMethods(self.spec).load()
+            loaded.eggs = 2
+            reloaded = self.bootstrap._SpecMethods(self.spec).exec(loaded)
+
+        self.assertEqual(loaded.eggs, 1)
+        self.assertIs(reloaded, loaded)
+
+    def test_reload_extra_attributes(self):
+        self.spec.loader = NewLoader()
+        with CleanImport(self.spec.name):
+            loaded = self.bootstrap._SpecMethods(self.spec).load()
+            loaded.available = False
+            reloaded = self.bootstrap._SpecMethods(self.spec).exec(loaded)
+
+        self.assertFalse(loaded.available)
+        self.assertIs(reloaded, loaded)
+
+    def test_reload_init_module_attrs(self):
+        self.spec.loader = NewLoader()
+        with CleanImport(self.spec.name):
+            loaded = self.bootstrap._SpecMethods(self.spec).load()
+            loaded.__name__ = 'ham'
+            del loaded.__loader__
+            del loaded.__package__
+            del loaded.__spec__
+            self.bootstrap._SpecMethods(self.spec).exec(loaded)
+
+        self.assertEqual(loaded.__name__, self.spec.name)
+        self.assertIs(loaded.__loader__, self.spec.loader)
+        self.assertEqual(loaded.__package__, self.spec.parent)
+        self.assertIs(loaded.__spec__, self.spec)
+        self.assertFalse(hasattr(loaded, '__path__'))
+        self.assertFalse(hasattr(loaded, '__file__'))
+        self.assertFalse(hasattr(loaded, '__cached__'))
+
+    def test_reload_legacy(self):
+        self.spec.loader = LegacyLoader()
+        with CleanImport(self.spec.name):
+            loaded = self.bootstrap._SpecMethods(self.spec).load()
+            reloaded = self.bootstrap._SpecMethods(self.spec).exec(loaded)
+            installed = sys.modules[self.spec.name]
+
+        self.assertEqual(loaded.ham, -1)
+        self.assertIs(reloaded, loaded)
+        self.assertIs(installed, loaded)
+
+
+class Frozen_ModuleSpecMethodsTests(ModuleSpecMethodsTests, unittest.TestCase):
+    bootstrap = frozen_bootstrap
+    machinery = frozen_machinery
+    util = frozen_util
+
+
+class Source_ModuleSpecMethodsTests(ModuleSpecMethodsTests, unittest.TestCase):
+    bootstrap = source_bootstrap
+    machinery = source_machinery
+    util = source_util
+
+
+class ModuleReprTests:
+
+    def setUp(self):
+        self.module = type(os)('spam')
+        self.spec = self.machinery.ModuleSpec('spam', TestLoader())
+
+    def test_module___loader___module_repr(self):
+        class Loader:
+            def module_repr(self, module):
+                return '<delicious {}>'.format(module.__name__)
+        self.module.__loader__ = Loader()
+        modrepr = self.bootstrap._module_repr(self.module)
+
+        self.assertEqual(modrepr, '<delicious spam>')
+
+    def test_module___loader___module_repr_bad(self):
+        class Loader(TestLoader):
+            def module_repr(self, module):
+                raise Exception
+        self.module.__loader__ = Loader()
+        modrepr = self.bootstrap._module_repr(self.module)
+
+        self.assertEqual(modrepr,
+                         '<module {!r} (<TestLoader object>)>'.format('spam'))
+
+    def test_module___spec__(self):
+        origin = 'in a hole, in the ground'
+        self.spec.origin = origin
+        self.module.__spec__ = self.spec
+        modrepr = self.bootstrap._module_repr(self.module)
+
+        self.assertEqual(modrepr, '<module {!r} ({})>'.format('spam', origin))
+
+    def test_module___spec___location(self):
+        location = 'in_a_galaxy_far_far_away.py'
+        self.spec.origin = location
+        self.spec._set_fileattr = True
+        self.module.__spec__ = self.spec
+        modrepr = self.bootstrap._module_repr(self.module)
+
+        self.assertEqual(modrepr,
+                         '<module {!r} from {!r}>'.format('spam', location))
+
+    def test_module___spec___no_origin(self):
+        self.spec.loader = TestLoader()
+        self.module.__spec__ = self.spec
+        modrepr = self.bootstrap._module_repr(self.module)
+
+        self.assertEqual(modrepr,
+                         '<module {!r} (<TestLoader object>)>'.format('spam'))
+
+    def test_module___spec___no_origin_no_loader(self):
+        self.spec.loader = None
+        self.module.__spec__ = self.spec
+        modrepr = self.bootstrap._module_repr(self.module)
+
+        self.assertEqual(modrepr, '<module {!r}>'.format('spam'))
+
+    def test_module_no_name(self):
+        del self.module.__name__
+        modrepr = self.bootstrap._module_repr(self.module)
+
+        self.assertEqual(modrepr, '<module {!r}>'.format('?'))
+
+    def test_module_with_file(self):
+        filename = 'e/i/e/i/o/spam.py'
+        self.module.__file__ = filename
+        modrepr = self.bootstrap._module_repr(self.module)
+
+        self.assertEqual(modrepr,
+                         '<module {!r} from {!r}>'.format('spam', filename))
+
+    def test_module_no_file(self):
+        self.module.__loader__ = TestLoader()
+        modrepr = self.bootstrap._module_repr(self.module)
+
+        self.assertEqual(modrepr,
+                         '<module {!r} (<TestLoader object>)>'.format('spam'))
+
+    def test_module_no_file_no_loader(self):
+        modrepr = self.bootstrap._module_repr(self.module)
+
+        self.assertEqual(modrepr, '<module {!r}>'.format('spam'))
+
+
+class Frozen_ModuleReprTests(ModuleReprTests, unittest.TestCase):
+    bootstrap = frozen_bootstrap
+    machinery = frozen_machinery
+    util = frozen_util
+
+
+class Source_ModuleReprTests(ModuleReprTests, unittest.TestCase):
+    bootstrap = source_bootstrap
+    machinery = source_machinery
+    util = source_util
+
+
+class FactoryTests:
+
+    def setUp(self):
+        self.name = 'spam'
+        self.path = 'spam.py'
+        self.cached = self.util.cache_from_source(self.path)
+        self.loader = TestLoader()
+        self.fileloader = TestLoader(self.path)
+        self.pkgloader = TestLoader(self.path, True)
+
+    # spec_from_loader()
+
+    def test_spec_from_loader_default(self):
+        spec = self.util.spec_from_loader(self.name, self.loader)
+
+        self.assertEqual(spec.name, self.name)
+        self.assertEqual(spec.loader, self.loader)
+        self.assertIs(spec.origin, None)
+        self.assertIs(spec.loader_state, None)
+        self.assertIs(spec.submodule_search_locations, None)
+        self.assertIs(spec.cached, None)
+        self.assertFalse(spec.has_location)
+
+    def test_spec_from_loader_default_with_bad_is_package(self):
+        class Loader:
+            def is_package(self, name):
+                raise ImportError
+        loader = Loader()
+        spec = self.util.spec_from_loader(self.name, loader)
+
+        self.assertEqual(spec.name, self.name)
+        self.assertEqual(spec.loader, loader)
+        self.assertIs(spec.origin, None)
+        self.assertIs(spec.loader_state, None)
+        self.assertIs(spec.submodule_search_locations, None)
+        self.assertIs(spec.cached, None)
+        self.assertFalse(spec.has_location)
+
+    def test_spec_from_loader_origin(self):
+        origin = 'somewhere over the rainbow'
+        spec = self.util.spec_from_loader(self.name, self.loader,
+                                          origin=origin)
+
+        self.assertEqual(spec.name, self.name)
+        self.assertEqual(spec.loader, self.loader)
+        self.assertIs(spec.origin, origin)
+        self.assertIs(spec.loader_state, None)
+        self.assertIs(spec.submodule_search_locations, None)
+        self.assertIs(spec.cached, None)
+        self.assertFalse(spec.has_location)
+
+    def test_spec_from_loader_is_package_false(self):
+        spec = self.util.spec_from_loader(self.name, self.loader,
+                                          is_package=False)
+
+        self.assertEqual(spec.name, self.name)
+        self.assertEqual(spec.loader, self.loader)
+        self.assertIs(spec.origin, None)
+        self.assertIs(spec.loader_state, None)
+        self.assertIs(spec.submodule_search_locations, None)
+        self.assertIs(spec.cached, None)
+        self.assertFalse(spec.has_location)
+
+    def test_spec_from_loader_is_package_true(self):
+        spec = self.util.spec_from_loader(self.name, self.loader,
+                                          is_package=True)
+
+        self.assertEqual(spec.name, self.name)
+        self.assertEqual(spec.loader, self.loader)
+        self.assertIs(spec.origin, None)
+        self.assertIs(spec.loader_state, None)
+        self.assertEqual(spec.submodule_search_locations, [])
+        self.assertIs(spec.cached, None)
+        self.assertFalse(spec.has_location)
+
+    def test_spec_from_loader_origin_and_is_package(self):
+        origin = 'where the streets have no name'
+        spec = self.util.spec_from_loader(self.name, self.loader,
+                                          origin=origin, is_package=True)
+
+        self.assertEqual(spec.name, self.name)
+        self.assertEqual(spec.loader, self.loader)
+        self.assertIs(spec.origin, origin)
+        self.assertIs(spec.loader_state, None)
+        self.assertEqual(spec.submodule_search_locations, [])
+        self.assertIs(spec.cached, None)
+        self.assertFalse(spec.has_location)
+
+    def test_spec_from_loader_is_package_with_loader_false(self):
+        loader = TestLoader(is_package=False)
+        spec = self.util.spec_from_loader(self.name, loader)
+
+        self.assertEqual(spec.name, self.name)
+        self.assertEqual(spec.loader, loader)
+        self.assertIs(spec.origin, None)
+        self.assertIs(spec.loader_state, None)
+        self.assertIs(spec.submodule_search_locations, None)
+        self.assertIs(spec.cached, None)
+        self.assertFalse(spec.has_location)
+
+    def test_spec_from_loader_is_package_with_loader_true(self):
+        loader = TestLoader(is_package=True)
+        spec = self.util.spec_from_loader(self.name, loader)
+
+        self.assertEqual(spec.name, self.name)
+        self.assertEqual(spec.loader, loader)
+        self.assertIs(spec.origin, None)
+        self.assertIs(spec.loader_state, None)
+        self.assertEqual(spec.submodule_search_locations, [])
+        self.assertIs(spec.cached, None)
+        self.assertFalse(spec.has_location)
+
+    def test_spec_from_loader_default_with_file_loader(self):
+        spec = self.util.spec_from_loader(self.name, self.fileloader)
+
+        self.assertEqual(spec.name, self.name)
+        self.assertEqual(spec.loader, self.fileloader)
+        self.assertEqual(spec.origin, self.path)
+        self.assertIs(spec.loader_state, None)
+        self.assertIs(spec.submodule_search_locations, None)
+        self.assertEqual(spec.cached, self.cached)
+        self.assertTrue(spec.has_location)
+
+    def test_spec_from_loader_is_package_false_with_fileloader(self):
+        spec = self.util.spec_from_loader(self.name, self.fileloader,
+                                          is_package=False)
+
+        self.assertEqual(spec.name, self.name)
+        self.assertEqual(spec.loader, self.fileloader)
+        self.assertEqual(spec.origin, self.path)
+        self.assertIs(spec.loader_state, None)
+        self.assertIs(spec.submodule_search_locations, None)
+        self.assertEqual(spec.cached, self.cached)
+        self.assertTrue(spec.has_location)
+
+    def test_spec_from_loader_is_package_true_with_fileloader(self):
+        spec = self.util.spec_from_loader(self.name, self.fileloader,
+                                          is_package=True)
+
+        self.assertEqual(spec.name, self.name)
+        self.assertEqual(spec.loader, self.fileloader)
+        self.assertEqual(spec.origin, self.path)
+        self.assertIs(spec.loader_state, None)
+        self.assertEqual(spec.submodule_search_locations, [''])
+        self.assertEqual(spec.cached, self.cached)
+        self.assertTrue(spec.has_location)
+
+    # spec_from_file_location()
+
+    def test_spec_from_file_location_default(self):
+        if self.machinery is source_machinery:
+            raise unittest.SkipTest('not sure why this is breaking...')
+        spec = self.util.spec_from_file_location(self.name, self.path)
+
+        self.assertEqual(spec.name, self.name)
+        self.assertIsInstance(spec.loader,
+                              self.machinery.SourceFileLoader)
+        self.assertEqual(spec.loader.name, self.name)
+        self.assertEqual(spec.loader.path, self.path)
+        self.assertEqual(spec.origin, self.path)
+        self.assertIs(spec.loader_state, None)
+        self.assertIs(spec.submodule_search_locations, None)
+        self.assertEqual(spec.cached, self.cached)
+        self.assertTrue(spec.has_location)
+
+    def test_spec_from_file_location_default_without_location(self):
+        spec = self.util.spec_from_file_location(self.name)
+
+        self.assertIs(spec, None)
+
+    def test_spec_from_file_location_default_bad_suffix(self):
+        spec = self.util.spec_from_file_location(self.name, 'spam.eggs')
+
+        self.assertIs(spec, None)
+
+    def test_spec_from_file_location_loader_no_location(self):
+        spec = self.util.spec_from_file_location(self.name,
+                                                 loader=self.fileloader)
+
+        self.assertEqual(spec.name, self.name)
+        self.assertEqual(spec.loader, self.fileloader)
+        self.assertEqual(spec.origin, self.path)
+        self.assertIs(spec.loader_state, None)
+        self.assertIs(spec.submodule_search_locations, None)
+        self.assertEqual(spec.cached, self.cached)
+        self.assertTrue(spec.has_location)
+
+    def test_spec_from_file_location_loader_no_location_no_get_filename(self):
+        spec = self.util.spec_from_file_location(self.name,
+                                                 loader=self.loader)
+
+        self.assertEqual(spec.name, self.name)
+        self.assertEqual(spec.loader, self.loader)
+        self.assertEqual(spec.origin, '<unknown>')
+        self.assertIs(spec.loader_state, None)
+        self.assertIs(spec.submodule_search_locations, None)
+        self.assertIs(spec.cached, None)
+        self.assertTrue(spec.has_location)
+
+    def test_spec_from_file_location_loader_no_location_bad_get_filename(self):
+        class Loader:
+            def get_filename(self, name):
+                raise ImportError
+        loader = Loader()
+        spec = self.util.spec_from_file_location(self.name, loader=loader)
+
+        self.assertEqual(spec.name, self.name)
+        self.assertEqual(spec.loader, loader)
+        self.assertEqual(spec.origin, '<unknown>')
+        self.assertIs(spec.loader_state, None)
+        self.assertIs(spec.submodule_search_locations, None)
+        self.assertIs(spec.cached, None)
+        self.assertTrue(spec.has_location)
+
+    def test_spec_from_file_location_smsl_none(self):
+        spec = self.util.spec_from_file_location(self.name, self.path,
+                                       loader=self.fileloader,
+                                       submodule_search_locations=None)
+
+        self.assertEqual(spec.name, self.name)
+        self.assertEqual(spec.loader, self.fileloader)
+        self.assertEqual(spec.origin, self.path)
+        self.assertIs(spec.loader_state, None)
+        self.assertIs(spec.submodule_search_locations, None)
+        self.assertEqual(spec.cached, self.cached)
+        self.assertTrue(spec.has_location)
+
+    def test_spec_from_file_location_smsl_empty(self):
+        spec = self.util.spec_from_file_location(self.name, self.path,
+                                       loader=self.fileloader,
+                                       submodule_search_locations=[])
+
+        self.assertEqual(spec.name, self.name)
+        self.assertEqual(spec.loader, self.fileloader)
+        self.assertEqual(spec.origin, self.path)
+        self.assertIs(spec.loader_state, None)
+        self.assertEqual(spec.submodule_search_locations, [''])
+        self.assertEqual(spec.cached, self.cached)
+        self.assertTrue(spec.has_location)
+
+    def test_spec_from_file_location_smsl_not_empty(self):
+        spec = self.util.spec_from_file_location(self.name, self.path,
+                                       loader=self.fileloader,
+                                       submodule_search_locations=['eggs'])
+
+        self.assertEqual(spec.name, self.name)
+        self.assertEqual(spec.loader, self.fileloader)
+        self.assertEqual(spec.origin, self.path)
+        self.assertIs(spec.loader_state, None)
+        self.assertEqual(spec.submodule_search_locations, ['eggs'])
+        self.assertEqual(spec.cached, self.cached)
+        self.assertTrue(spec.has_location)
+
+    def test_spec_from_file_location_smsl_default(self):
+        spec = self.util.spec_from_file_location(self.name, self.path,
+                                       loader=self.pkgloader)
+
+        self.assertEqual(spec.name, self.name)
+        self.assertEqual(spec.loader, self.pkgloader)
+        self.assertEqual(spec.origin, self.path)
+        self.assertIs(spec.loader_state, None)
+        self.assertEqual(spec.submodule_search_locations, [''])
+        self.assertEqual(spec.cached, self.cached)
+        self.assertTrue(spec.has_location)
+
+    def test_spec_from_file_location_smsl_default_not_package(self):
+        class Loader:
+            def is_package(self, name):
+                return False
+        loader = Loader()
+        spec = self.util.spec_from_file_location(self.name, self.path,
+                                                 loader=loader)
+
+        self.assertEqual(spec.name, self.name)
+        self.assertEqual(spec.loader, loader)
+        self.assertEqual(spec.origin, self.path)
+        self.assertIs(spec.loader_state, None)
+        self.assertIs(spec.submodule_search_locations, None)
+        self.assertEqual(spec.cached, self.cached)
+        self.assertTrue(spec.has_location)
+
+    def test_spec_from_file_location_smsl_default_no_is_package(self):
+        spec = self.util.spec_from_file_location(self.name, self.path,
+                                       loader=self.fileloader)
+
+        self.assertEqual(spec.name, self.name)
+        self.assertEqual(spec.loader, self.fileloader)
+        self.assertEqual(spec.origin, self.path)
+        self.assertIs(spec.loader_state, None)
+        self.assertIs(spec.submodule_search_locations, None)
+        self.assertEqual(spec.cached, self.cached)
+        self.assertTrue(spec.has_location)
+
+    def test_spec_from_file_location_smsl_default_bad_is_package(self):
+        class Loader:
+            def is_package(self, name):
+                raise ImportError
+        loader = Loader()
+        spec = self.util.spec_from_file_location(self.name, self.path,
+                                                 loader=loader)
+
+        self.assertEqual(spec.name, self.name)
+        self.assertEqual(spec.loader, loader)
+        self.assertEqual(spec.origin, self.path)
+        self.assertIs(spec.loader_state, None)
+        self.assertIs(spec.submodule_search_locations, None)
+        self.assertEqual(spec.cached, self.cached)
+        self.assertTrue(spec.has_location)
+
+
+class Frozen_FactoryTests(FactoryTests, unittest.TestCase):
+    util = frozen_util
+    machinery = frozen_machinery
+
+
+class Source_FactoryTests(FactoryTests, unittest.TestCase):
+    util = source_util
+    machinery = source_machinery
diff --git a/Lib/test/test_importlib/test_util.py b/Lib/test/test_importlib/test_util.py
index efc8977..b2823c6 100644
--- a/Lib/test/test_importlib/test_util.py
+++ b/Lib/test/test_importlib/test_util.py
@@ -1,23 +1,66 @@
 from importlib import util
 from . import util as test_util
-import imp
+frozen_init, source_init = test_util.import_importlib('importlib')
+frozen_machinery, source_machinery = test_util.import_importlib('importlib.machinery')
+frozen_util, source_util = test_util.import_importlib('importlib.util')
+
+import os
 import sys
+from test import support
 import types
 import unittest
+import warnings
 
 
-class ModuleForLoaderTests(unittest.TestCase):
+class DecodeSourceBytesTests:
+
+    source = "string ='ü'"
+
+    def test_ut8_default(self):
+        source_bytes = self.source.encode('utf-8')
+        self.assertEqual(self.util.decode_source(source_bytes), self.source)
+
+    def test_specified_encoding(self):
+        source = '# coding=latin-1\n' + self.source
+        source_bytes = source.encode('latin-1')
+        assert source_bytes != source.encode('utf-8')
+        self.assertEqual(self.util.decode_source(source_bytes), source)
+
+    def test_universal_newlines(self):
+        source = '\r\n'.join([self.source, self.source])
+        source_bytes = source.encode('utf-8')
+        self.assertEqual(self.util.decode_source(source_bytes),
+                         '\n'.join([self.source, self.source]))
+
+Frozen_DecodeSourceBytesTests, Source_DecodeSourceBytesTests = test_util.test_both(
+        DecodeSourceBytesTests, util=[frozen_util, source_util])
+
+
+class ModuleForLoaderTests:
 
     """Tests for importlib.util.module_for_loader."""
 
+    @classmethod
+    def module_for_loader(cls, func):
+        with warnings.catch_warnings():
+            warnings.simplefilter('ignore', DeprecationWarning)
+            return cls.util.module_for_loader(func)
+
+    def test_warning(self):
+        # Should raise a PendingDeprecationWarning when used.
+        with warnings.catch_warnings():
+            warnings.simplefilter('error', DeprecationWarning)
+            with self.assertRaises(DeprecationWarning):
+                func = self.util.module_for_loader(lambda x: x)
+
     def return_module(self, name):
-        fxn = util.module_for_loader(lambda self, module: module)
+        fxn = self.module_for_loader(lambda self, module: module)
         return fxn(self, name)
 
     def raise_exception(self, name):
         def to_wrap(self, module):
             raise ImportError
-        fxn = util.module_for_loader(to_wrap)
+        fxn = self.module_for_loader(to_wrap)
         try:
             fxn(self, name)
         except ImportError:
@@ -35,12 +78,23 @@
 
     def test_reload(self):
         # Test that a module is reused if already in sys.modules.
+        class FakeLoader:
+            def is_package(self, name):
+                return True
+            @self.module_for_loader
+            def load_module(self, module):
+                return module
         name = 'a.b.c'
-        module = imp.new_module('a.b.c')
+        module = types.ModuleType('a.b.c')
+        module.__loader__ = 42
+        module.__package__ = 42
         with test_util.uncache(name):
             sys.modules[name] = module
-            returned_module = self.return_module(name)
+            loader = FakeLoader()
+            returned_module = loader.load_module(name)
             self.assertIs(returned_module, sys.modules[name])
+            self.assertEqual(module.__loader__, loader)
+            self.assertEqual(module.__package__, name)
 
     def test_new_module_failure(self):
         # Test that a module is removed from sys.modules if added but an
@@ -53,7 +107,7 @@
     def test_reload_failure(self):
         # Test that a failure on reload leaves the module in-place.
         name = 'a.b.c'
-        module = imp.new_module(name)
+        module = types.ModuleType(name)
         with test_util.uncache(name):
             sys.modules[name] = module
             self.raise_exception(name)
@@ -61,7 +115,7 @@
 
     def test_decorator_attrs(self):
         def fxn(self, module): pass
-        wrapped = util.module_for_loader(fxn)
+        wrapped = self.module_for_loader(fxn)
         self.assertEqual(wrapped.__name__, fxn.__name__)
         self.assertEqual(wrapped.__qualname__, fxn.__qualname__)
 
@@ -87,7 +141,7 @@
                 self._pkg = is_package
             def is_package(self, name):
                 return self._pkg
-            @util.module_for_loader
+            @self.module_for_loader
             def load_module(self, module):
                 return module
 
@@ -107,8 +161,11 @@
             self.assertIs(module.__loader__, loader)
             self.assertEqual(module.__package__, name)
 
+Frozen_ModuleForLoaderTests, Source_ModuleForLoaderTests = test_util.test_both(
+        ModuleForLoaderTests, util=[frozen_util, source_util])
 
-class SetPackageTests(unittest.TestCase):
+
+class SetPackageTests:
 
     """Tests for importlib.util.set_package."""
 
@@ -116,34 +173,36 @@
         """Verify the module has the expected value for __package__ after
         passing through set_package."""
         fxn = lambda: module
-        wrapped = util.set_package(fxn)
-        wrapped()
+        wrapped = self.util.set_package(fxn)
+        with warnings.catch_warnings():
+            warnings.simplefilter('ignore', DeprecationWarning)
+            wrapped()
         self.assertTrue(hasattr(module, '__package__'))
         self.assertEqual(expect, module.__package__)
 
     def test_top_level(self):
         # __package__ should be set to the empty string if a top-level module.
         # Implicitly tests when package is set to None.
-        module = imp.new_module('module')
+        module = types.ModuleType('module')
         module.__package__ = None
         self.verify(module, '')
 
     def test_package(self):
         # Test setting __package__ for a package.
-        module = imp.new_module('pkg')
+        module = types.ModuleType('pkg')
         module.__path__ = ['<path>']
         module.__package__ = None
         self.verify(module, 'pkg')
 
     def test_submodule(self):
         # Test __package__ for a module in a package.
-        module = imp.new_module('pkg.mod')
+        module = types.ModuleType('pkg.mod')
         module.__package__ = None
         self.verify(module, 'pkg')
 
     def test_setting_if_missing(self):
         # __package__ should be set if it is missing.
-        module = imp.new_module('mod')
+        module = types.ModuleType('mod')
         if hasattr(module, '__package__'):
             delattr(module, '__package__')
         self.verify(module, '')
@@ -151,58 +210,383 @@
     def test_leaving_alone(self):
         # If __package__ is set and not None then leave it alone.
         for value in (True, False):
-            module = imp.new_module('mod')
+            module = types.ModuleType('mod')
             module.__package__ = value
             self.verify(module, value)
 
     def test_decorator_attrs(self):
         def fxn(module): pass
-        wrapped = util.set_package(fxn)
+        with warnings.catch_warnings():
+            warnings.simplefilter('ignore', DeprecationWarning)
+            wrapped = self.util.set_package(fxn)
         self.assertEqual(wrapped.__name__, fxn.__name__)
         self.assertEqual(wrapped.__qualname__, fxn.__qualname__)
 
+Frozen_SetPackageTests, Source_SetPackageTests = test_util.test_both(
+        SetPackageTests, util=[frozen_util, source_util])
 
-class ResolveNameTests(unittest.TestCase):
+
+class SetLoaderTests:
+
+    """Tests importlib.util.set_loader()."""
+
+    class DummyLoader:
+        @util.set_loader
+        def load_module(self, module):
+            return self.module
+
+    def test_no_attribute(self):
+        loader = self.DummyLoader()
+        loader.module = types.ModuleType('blah')
+        try:
+            del loader.module.__loader__
+        except AttributeError:
+            pass
+        with warnings.catch_warnings():
+            warnings.simplefilter('ignore', DeprecationWarning)
+            self.assertEqual(loader, loader.load_module('blah').__loader__)
+
+    def test_attribute_is_None(self):
+        loader = self.DummyLoader()
+        loader.module = types.ModuleType('blah')
+        loader.module.__loader__ = None
+        with warnings.catch_warnings():
+            warnings.simplefilter('ignore', DeprecationWarning)
+            self.assertEqual(loader, loader.load_module('blah').__loader__)
+
+    def test_not_reset(self):
+        loader = self.DummyLoader()
+        loader.module = types.ModuleType('blah')
+        loader.module.__loader__ = 42
+        with warnings.catch_warnings():
+            warnings.simplefilter('ignore', DeprecationWarning)
+            self.assertEqual(42, loader.load_module('blah').__loader__)
+
+class Frozen_SetLoaderTests(SetLoaderTests, unittest.TestCase):
+    class DummyLoader:
+        @frozen_util.set_loader
+        def load_module(self, module):
+            return self.module
+
+class Source_SetLoaderTests(SetLoaderTests, unittest.TestCase):
+    class DummyLoader:
+        @source_util.set_loader
+        def load_module(self, module):
+            return self.module
+
+
+class ResolveNameTests:
 
     """Tests importlib.util.resolve_name()."""
 
     def test_absolute(self):
         # bacon
-        self.assertEqual('bacon', util.resolve_name('bacon', None))
+        self.assertEqual('bacon', self.util.resolve_name('bacon', None))
 
     def test_aboslute_within_package(self):
         # bacon in spam
-        self.assertEqual('bacon', util.resolve_name('bacon', 'spam'))
+        self.assertEqual('bacon', self.util.resolve_name('bacon', 'spam'))
 
     def test_no_package(self):
         # .bacon in ''
         with self.assertRaises(ValueError):
-            util.resolve_name('.bacon', '')
+            self.util.resolve_name('.bacon', '')
 
     def test_in_package(self):
         # .bacon in spam
         self.assertEqual('spam.eggs.bacon',
-                         util.resolve_name('.bacon', 'spam.eggs'))
+                         self.util.resolve_name('.bacon', 'spam.eggs'))
 
     def test_other_package(self):
         # ..bacon in spam.bacon
         self.assertEqual('spam.bacon',
-                         util.resolve_name('..bacon', 'spam.eggs'))
+                         self.util.resolve_name('..bacon', 'spam.eggs'))
 
     def test_escape(self):
         # ..bacon in spam
         with self.assertRaises(ValueError):
-            util.resolve_name('..bacon', 'spam')
+            self.util.resolve_name('..bacon', 'spam')
+
+Frozen_ResolveNameTests, Source_ResolveNameTests = test_util.test_both(
+        ResolveNameTests,
+        util=[frozen_util, source_util])
 
 
-def test_main():
-    from test import support
-    support.run_unittest(
-            ModuleForLoaderTests,
-            SetPackageTests,
-            ResolveNameTests
-        )
+class FindSpecTests:
+
+    class FakeMetaFinder:
+        @staticmethod
+        def find_spec(name, path=None, target=None): return name, path, target
+
+    def test_sys_modules(self):
+        name = 'some_mod'
+        with test_util.uncache(name):
+            module = types.ModuleType(name)
+            loader = 'a loader!'
+            spec = self.machinery.ModuleSpec(name, loader)
+            module.__loader__ = loader
+            module.__spec__ = spec
+            sys.modules[name] = module
+            found = self.util.find_spec(name)
+            self.assertEqual(found, spec)
+
+    def test_sys_modules_without___loader__(self):
+        name = 'some_mod'
+        with test_util.uncache(name):
+            module = types.ModuleType(name)
+            del module.__loader__
+            loader = 'a loader!'
+            spec = self.machinery.ModuleSpec(name, loader)
+            module.__spec__ = spec
+            sys.modules[name] = module
+            found = self.util.find_spec(name)
+            self.assertEqual(found, spec)
+
+    def test_sys_modules_spec_is_None(self):
+        name = 'some_mod'
+        with test_util.uncache(name):
+            module = types.ModuleType(name)
+            module.__spec__ = None
+            sys.modules[name] = module
+            with self.assertRaises(ValueError):
+                self.util.find_spec(name)
+
+    def test_sys_modules_loader_is_None(self):
+        name = 'some_mod'
+        with test_util.uncache(name):
+            module = types.ModuleType(name)
+            spec = self.machinery.ModuleSpec(name, None)
+            module.__spec__ = spec
+            sys.modules[name] = module
+            found = self.util.find_spec(name)
+            self.assertEqual(found, spec)
+
+    def test_sys_modules_spec_is_not_set(self):
+        name = 'some_mod'
+        with test_util.uncache(name):
+            module = types.ModuleType(name)
+            try:
+                del module.__spec__
+            except AttributeError:
+                pass
+            sys.modules[name] = module
+            with self.assertRaises(ValueError):
+                self.util.find_spec(name)
+
+    def test_success(self):
+        name = 'some_mod'
+        with test_util.uncache(name):
+            with test_util.import_state(meta_path=[self.FakeMetaFinder]):
+                self.assertEqual((name, None, None),
+                                 self.util.find_spec(name))
+
+#    def test_success_path(self):
+#        # Searching on a path should work.
+#        name = 'some_mod'
+#        path = 'path to some place'
+#        with test_util.uncache(name):
+#            with test_util.import_state(meta_path=[self.FakeMetaFinder]):
+#                self.assertEqual((name, path, None),
+#                                 self.util.find_spec(name, path))
+
+    def test_nothing(self):
+        # None is returned upon failure to find a loader.
+        self.assertIsNone(self.util.find_spec('nevergoingtofindthismodule'))
+
+    def test_find_submodule(self):
+        name = 'spam'
+        subname = 'ham'
+        with test_util.temp_module(name, pkg=True) as pkg_dir:
+            fullname, _ = test_util.submodule(name, subname, pkg_dir)
+            spec = self.util.find_spec(fullname)
+            self.assertIsNot(spec, None)
+            self.assertIn(name, sorted(sys.modules))
+            self.assertNotIn(fullname, sorted(sys.modules))
+            # Ensure successive calls behave the same.
+            spec_again = self.util.find_spec(fullname)
+            self.assertEqual(spec_again, spec)
+
+    def test_find_submodule_parent_already_imported(self):
+        name = 'spam'
+        subname = 'ham'
+        with test_util.temp_module(name, pkg=True) as pkg_dir:
+            self.init.import_module(name)
+            fullname, _ = test_util.submodule(name, subname, pkg_dir)
+            spec = self.util.find_spec(fullname)
+            self.assertIsNot(spec, None)
+            self.assertIn(name, sorted(sys.modules))
+            self.assertNotIn(fullname, sorted(sys.modules))
+            # Ensure successive calls behave the same.
+            spec_again = self.util.find_spec(fullname)
+            self.assertEqual(spec_again, spec)
+
+    def test_find_relative_module(self):
+        name = 'spam'
+        subname = 'ham'
+        with test_util.temp_module(name, pkg=True) as pkg_dir:
+            fullname, _ = test_util.submodule(name, subname, pkg_dir)
+            relname = '.' + subname
+            spec = self.util.find_spec(relname, name)
+            self.assertIsNot(spec, None)
+            self.assertIn(name, sorted(sys.modules))
+            self.assertNotIn(fullname, sorted(sys.modules))
+            # Ensure successive calls behave the same.
+            spec_again = self.util.find_spec(fullname)
+            self.assertEqual(spec_again, spec)
+
+    def test_find_relative_module_missing_package(self):
+        name = 'spam'
+        subname = 'ham'
+        with test_util.temp_module(name, pkg=True) as pkg_dir:
+            fullname, _ = test_util.submodule(name, subname, pkg_dir)
+            relname = '.' + subname
+            with self.assertRaises(ValueError):
+                self.util.find_spec(relname)
+            self.assertNotIn(name, sorted(sys.modules))
+            self.assertNotIn(fullname, sorted(sys.modules))
+
+
+class Frozen_FindSpecTests(FindSpecTests, unittest.TestCase):
+    init = frozen_init
+    machinery = frozen_machinery
+    util = frozen_util
+
+class Source_FindSpecTests(FindSpecTests, unittest.TestCase):
+    init = source_init
+    machinery = source_machinery
+    util = source_util
+
+
+class MagicNumberTests:
+
+    def test_length(self):
+        # Should be 4 bytes.
+        self.assertEqual(len(self.util.MAGIC_NUMBER), 4)
+
+    def test_incorporates_rn(self):
+        # The magic number uses \r\n to come out wrong when splitting on lines.
+        self.assertTrue(self.util.MAGIC_NUMBER.endswith(b'\r\n'))
+
+Frozen_MagicNumberTests, Source_MagicNumberTests = test_util.test_both(
+        MagicNumberTests, util=[frozen_util, source_util])
+
+
+class PEP3147Tests:
+
+    """Tests of PEP 3147-related functions: cache_from_source and source_from_cache."""
+
+    tag = sys.implementation.cache_tag
+
+    @unittest.skipUnless(sys.implementation.cache_tag is not None,
+                         'requires sys.implementation.cache_tag not be None')
+    def test_cache_from_source(self):
+        # Given the path to a .py file, return the path to its PEP 3147
+        # defined .pyc file (i.e. under __pycache__).
+        path = os.path.join('foo', 'bar', 'baz', 'qux.py')
+        expect = os.path.join('foo', 'bar', 'baz', '__pycache__',
+                              'qux.{}.pyc'.format(self.tag))
+        self.assertEqual(self.util.cache_from_source(path, True), expect)
+
+    def test_cache_from_source_no_cache_tag(self):
+        # No cache tag means NotImplementedError.
+        with support.swap_attr(sys.implementation, 'cache_tag', None):
+            with self.assertRaises(NotImplementedError):
+                self.util.cache_from_source('whatever.py')
+
+    def test_cache_from_source_no_dot(self):
+        # Directory with a dot, filename without dot.
+        path = os.path.join('foo.bar', 'file')
+        expect = os.path.join('foo.bar', '__pycache__',
+                              'file{}.pyc'.format(self.tag))
+        self.assertEqual(self.util.cache_from_source(path, True), expect)
+
+    def test_cache_from_source_optimized(self):
+        # Given the path to a .py file, return the path to its PEP 3147
+        # defined .pyo file (i.e. under __pycache__).
+        path = os.path.join('foo', 'bar', 'baz', 'qux.py')
+        expect = os.path.join('foo', 'bar', 'baz', '__pycache__',
+                              'qux.{}.pyo'.format(self.tag))
+        self.assertEqual(self.util.cache_from_source(path, False), expect)
+
+    def test_cache_from_source_cwd(self):
+        path = 'foo.py'
+        expect = os.path.join('__pycache__', 'foo.{}.pyc'.format(self.tag))
+        self.assertEqual(self.util.cache_from_source(path, True), expect)
+
+    def test_cache_from_source_override(self):
+        # When debug_override is not None, it can be any true-ish or false-ish
+        # value.
+        path = os.path.join('foo', 'bar', 'baz.py')
+        partial_expect = os.path.join('foo', 'bar', '__pycache__',
+                                      'baz.{}.py'.format(self.tag))
+        self.assertEqual(self.util.cache_from_source(path, []), partial_expect + 'o')
+        self.assertEqual(self.util.cache_from_source(path, [17]),
+                         partial_expect + 'c')
+        # However if the bool-ishness can't be determined, the exception
+        # propagates.
+        class Bearish:
+            def __bool__(self): raise RuntimeError
+        with self.assertRaises(RuntimeError):
+            self.util.cache_from_source('/foo/bar/baz.py', Bearish())
+
+    @unittest.skipUnless(os.sep == '\\' and os.altsep == '/',
+                     'test meaningful only where os.altsep is defined')
+    def test_sep_altsep_and_sep_cache_from_source(self):
+        # Windows path and PEP 3147 where sep is right of altsep.
+        self.assertEqual(
+            self.util.cache_from_source('\\foo\\bar\\baz/qux.py', True),
+            '\\foo\\bar\\baz\\__pycache__\\qux.{}.pyc'.format(self.tag))
+
+    @unittest.skipUnless(sys.implementation.cache_tag is not None,
+                         'requires sys.implementation.cache_tag to not be '
+                         'None')
+    def test_source_from_cache(self):
+        # Given the path to a PEP 3147 defined .pyc file, return the path to
+        # its source.  This tests the good path.
+        path = os.path.join('foo', 'bar', 'baz', '__pycache__',
+                            'qux.{}.pyc'.format(self.tag))
+        expect = os.path.join('foo', 'bar', 'baz', 'qux.py')
+        self.assertEqual(self.util.source_from_cache(path), expect)
+
+    def test_source_from_cache_no_cache_tag(self):
+        # If sys.implementation.cache_tag is None, raise NotImplementedError.
+        path = os.path.join('blah', '__pycache__', 'whatever.pyc')
+        with support.swap_attr(sys.implementation, 'cache_tag', None):
+            with self.assertRaises(NotImplementedError):
+                self.util.source_from_cache(path)
+
+    def test_source_from_cache_bad_path(self):
+        # When the path to a pyc file is not in PEP 3147 format, a ValueError
+        # is raised.
+        self.assertRaises(
+            ValueError, self.util.source_from_cache, '/foo/bar/bazqux.pyc')
+
+    def test_source_from_cache_no_slash(self):
+        # No slashes at all in path -> ValueError
+        self.assertRaises(
+            ValueError, self.util.source_from_cache, 'foo.cpython-32.pyc')
+
+    def test_source_from_cache_too_few_dots(self):
+        # Too few dots in final path component -> ValueError
+        self.assertRaises(
+            ValueError, self.util.source_from_cache, '__pycache__/foo.pyc')
+
+    def test_source_from_cache_too_many_dots(self):
+        # Too many dots in final path component -> ValueError
+        self.assertRaises(
+            ValueError, self.util.source_from_cache,
+            '__pycache__/foo.cpython-32.foo.pyc')
+
+    def test_source_from_cache_no__pycache__(self):
+        # Another problem with the path -> ValueError
+        self.assertRaises(
+            ValueError, self.util.source_from_cache,
+            '/foo/bar/foo.cpython-32.foo.pyc')
+
+Frozen_PEP3147Tests, Source_PEP3147Tests = test_util.test_both(
+        PEP3147Tests,
+        util=[frozen_util, source_util])
 
 
 if __name__ == '__main__':
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_importlib/test_windows.py b/Lib/test/test_importlib/test_windows.py
new file mode 100644
index 0000000..96b4adc
--- /dev/null
+++ b/Lib/test/test_importlib/test_windows.py
@@ -0,0 +1,29 @@
+from . import util
+frozen_machinery, source_machinery = util.import_importlib('importlib.machinery')
+
+import sys
+import unittest
+
+
+@unittest.skipUnless(sys.platform.startswith('win'), 'requires Windows')
+class WindowsRegistryFinderTests:
+
+    # XXX Need a test that finds the spec via the registry.
+
+    def test_find_spec_missing(self):
+        spec = self.machinery.WindowsRegistryFinder.find_spec('spam')
+        self.assertIs(spec, None)
+
+    def test_find_module_missing(self):
+        loader = self.machinery.WindowsRegistryFinder.find_module('spam')
+        self.assertIs(loader, None)
+
+
+class Frozen_WindowsRegistryFinderTests(WindowsRegistryFinderTests,
+                                        unittest.TestCase):
+    machinery = frozen_machinery
+
+
+class Source_WindowsRegistryFinderTests(WindowsRegistryFinderTests,
+                                        unittest.TestCase):
+    machinery = source_machinery
diff --git a/Lib/test/test_importlib/util.py b/Lib/test/test_importlib/util.py
index ef32f7d..885cec3 100644
--- a/Lib/test/test_importlib/util.py
+++ b/Lib/test/test_importlib/util.py
@@ -1,9 +1,31 @@
 from contextlib import contextmanager
-import imp
+from importlib import util, invalidate_caches
 import os.path
 from test import support
 import unittest
 import sys
+import types
+
+
+def import_importlib(module_name):
+    """Import a module from importlib both w/ and w/o _frozen_importlib."""
+    fresh = ('importlib',) if '.' in module_name else ()
+    frozen = support.import_fresh_module(module_name)
+    source = support.import_fresh_module(module_name, fresh=fresh,
+                                         blocked=('_frozen_importlib',))
+    return frozen, source
+
+
+def test_both(test_class, **kwargs):
+    frozen_tests = types.new_class('Frozen_'+test_class.__name__,
+                                   (test_class, unittest.TestCase))
+    source_tests = types.new_class('Source_'+test_class.__name__,
+                                   (test_class, unittest.TestCase))
+    frozen_tests.__module__ = source_tests.__module__ = test_class.__module__
+    for attr, (frozen_value, source_value) in kwargs.items():
+        setattr(frozen_tests, attr, frozen_value)
+        setattr(source_tests, attr, source_value)
+    return frozen_tests, source_tests
 
 
 CASE_INSENSITIVE_FS = True
@@ -24,6 +46,13 @@
                             "requires a case-insensitive filesystem")(test)
 
 
+def submodule(parent, name, pkg_dir, content=''):
+    path = os.path.join(pkg_dir, name + '.py')
+    with open(path, 'w') as subfile:
+        subfile.write(content)
+    return '{}.{}'.format(parent, name), path
+
+
 @contextmanager
 def uncache(*names):
     """Uncache a module from sys.modules.
@@ -49,6 +78,31 @@
             except KeyError:
                 pass
 
+
+@contextmanager
+def temp_module(name, content='', *, pkg=False):
+    conflicts = [n for n in sys.modules if n.partition('.')[0] == name]
+    with support.temp_cwd(None) as cwd:
+        with uncache(name, *conflicts):
+            with support.DirsOnSysPath(cwd):
+                invalidate_caches()
+
+                location = os.path.join(cwd, name)
+                if pkg:
+                    modpath = os.path.join(location, '__init__.py')
+                    os.mkdir(name)
+                else:
+                    modpath = location + '.py'
+                    if content is None:
+                        # Make sure the module file gets created.
+                        content = ''
+                if content is not None:
+                    # not a namespace package
+                    with open(modpath, 'w') as modfile:
+                        modfile.write(content)
+                yield location
+
+
 @contextmanager
 def import_state(**kwargs):
     """Context manager to manage the various importers and stored state in the
@@ -80,9 +134,9 @@
             setattr(sys, attr, value)
 
 
-class mock_modules:
+class _ImporterMock:
 
-    """A mock importer/loader."""
+    """Base class to help with creating importer mocks."""
 
     def __init__(self, *names, module_code={}):
         self.modules = {}
@@ -98,7 +152,7 @@
                 package = name.rsplit('.', 1)[0]
             else:
                 package = import_name
-            module = imp.new_module(import_name)
+            module = types.ModuleType(import_name)
             module.__loader__ = self
             module.__file__ = '<mock __file__>'
             module.__package__ = package
@@ -112,6 +166,19 @@
     def __getitem__(self, name):
         return self.modules[name]
 
+    def __enter__(self):
+        self._uncache = uncache(*self.modules.keys())
+        self._uncache.__enter__()
+        return self
+
+    def __exit__(self, *exc_info):
+        self._uncache.__exit__(None, None, None)
+
+
+class mock_modules(_ImporterMock):
+
+    """Importer mock using PEP 302 APIs."""
+
     def find_module(self, fullname, path=None):
         if fullname not in self.modules:
             return None
@@ -131,10 +198,28 @@
                     raise
             return self.modules[fullname]
 
-    def __enter__(self):
-        self._uncache = uncache(*self.modules.keys())
-        self._uncache.__enter__()
-        return self
+class mock_spec(_ImporterMock):
 
-    def __exit__(self, *exc_info):
-        self._uncache.__exit__(None, None, None)
+    """Importer mock using PEP 451 APIs."""
+
+    def find_spec(self, fullname, path=None, parent=None):
+        try:
+            module = self.modules[fullname]
+        except KeyError:
+            return None
+        is_package = hasattr(module, '__path__')
+        spec = util.spec_from_file_location(
+                fullname, module.__file__, loader=self,
+                submodule_search_locations=getattr(module, '__path__', None))
+        return spec
+
+    def create_module(self, spec):
+        if spec.name not in self.modules:
+            raise ImportError
+        return self.modules[spec.name]
+
+    def exec_module(self, module):
+        try:
+            self.module_code[module.__spec__.name]()
+        except KeyError:
+            pass
diff --git a/Lib/test/test_index.py b/Lib/test/test_index.py
index 8785711..a2ac321 100644
--- a/Lib/test/test_index.py
+++ b/Lib/test/test_index.py
@@ -81,7 +81,8 @@
                 return True
 
         bad_int = BadInt()
-        n = operator.index(bad_int)
+        with self.assertWarns(DeprecationWarning):
+            n = operator.index(bad_int)
         self.assertEqual(n, 1)
 
         bad_int = BadInt2()
diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py
index 5cbec9b..fc3bf07 100644
--- a/Lib/test/test_inspect.py
+++ b/Lib/test/test_inspect.py
@@ -1,22 +1,35 @@
+import collections
+import datetime
+import functools
+import importlib
+import inspect
+import io
+import linecache
+import os
+from os.path import normcase
+import _pickle
 import re
+import shutil
 import sys
 import types
+import textwrap
+import unicodedata
 import unittest
-import inspect
-import linecache
-import datetime
-import collections
-import os
-import shutil
-from os.path import normcase
+import unittest.mock
 
-from test.support import run_unittest, TESTFN, DirsOnSysPath
+try:
+    from concurrent.futures import ThreadPoolExecutor
+except ImportError:
+    ThreadPoolExecutor = None
 
+from test.support import run_unittest, TESTFN, DirsOnSysPath, cpython_only
+from test.support import MISSING_C_DOCSTRINGS
+from test.script_helper import assert_python_ok, assert_python_failure
 from test import inspect_fodder as mod
 from test import inspect_fodder2 as mod2
 
-# C module for test_findsource_binary
-import unicodedata
+from test.test_import import _ready_to_import
+
 
 # Functions tested in this suite:
 # ismodule, isclass, ismethod, isfunction, istraceback, isframe, iscode,
@@ -120,7 +133,6 @@
     def test_get_slot_members(self):
         class C(object):
             __slots__ = ("a", "b")
-
         x = C()
         x.a = 42
         members = dict(inspect.getmembers(x))
@@ -310,6 +322,16 @@
     def test_getfile(self):
         self.assertEqual(inspect.getfile(mod.StupidGit), mod.__file__)
 
+    def test_getfile_class_without_module(self):
+        class CM(type):
+            @property
+            def __module__(cls):
+                raise AttributeError
+        class C(metaclass=CM):
+            pass
+        with self.assertRaises(TypeError):
+            inspect.getfile(C)
+
     def test_getmodule_recursion(self):
         from types import ModuleType
         name = '__inspect_dummy'
@@ -413,19 +435,20 @@
     def test_method_in_dynamic_class(self):
         self.assertSourceEqual(mod2.method_in_dynamic_class, 95, 97)
 
-    @unittest.skipIf(
-        not hasattr(unicodedata, '__file__') or
-            unicodedata.__file__[-4:] in (".pyc", ".pyo"),
-        "unicodedata is not an external binary module")
+    # This should not skip for CPython, but might on a repackaged python where
+    # unicodedata is not an external module, or on pypy.
+    @unittest.skipIf(not hasattr(unicodedata, '__file__') or
+                                 unicodedata.__file__.endswith('.py'),
+                     "unicodedata is not an external binary module")
     def test_findsource_binary(self):
-        self.assertRaises(IOError, inspect.getsource, unicodedata)
-        self.assertRaises(IOError, inspect.findsource, unicodedata)
+        self.assertRaises(OSError, inspect.getsource, unicodedata)
+        self.assertRaises(OSError, inspect.findsource, unicodedata)
 
     def test_findsource_code_in_linecache(self):
         lines = ["x=1"]
         co = compile(lines[0], "_dynamically_created_file", "exec")
-        self.assertRaises(IOError, inspect.findsource, co)
-        self.assertRaises(IOError, inspect.getsource, co)
+        self.assertRaises(OSError, inspect.findsource, co)
+        self.assertRaises(OSError, inspect.getsource, co)
         linecache.cache[co.co_filename] = (1, None, lines, co.co_filename)
         try:
             self.assertEqual(inspect.findsource(co), (lines,0))
@@ -463,13 +486,13 @@
     A broken data descriptor. See bug #1785.
     """
     def __get__(*args):
-        raise AssertionError("should not __get__ data descriptors")
+        raise AttributeError("broken data descriptor")
 
     def __set__(*args):
         raise RuntimeError
 
     def __getattr__(*args):
-        raise AssertionError("should not __getattr__ data descriptors")
+        raise AttributeError("broken data descriptor")
 
 
 class _BrokenMethodDescriptor(object):
@@ -477,10 +500,10 @@
     A broken method descriptor. See bug #1785.
     """
     def __get__(*args):
-        raise AssertionError("should not __get__ method descriptors")
+        raise AttributeError("broken method descriptor")
 
     def __getattr__(*args):
-        raise AssertionError("should not __getattr__ method descriptors")
+        raise AttributeError("broken method descriptor")
 
 
 # Helper for testing classify_class_attrs.
@@ -559,6 +582,96 @@
                                      kwonlyargs_e=['arg'],
                                      formatted='(*, arg)')
 
+    def test_argspec_api_ignores_wrapped(self):
+        # Issue 20684: low level introspection API must ignore __wrapped__
+        @functools.wraps(mod.spam)
+        def ham(x, y):
+            pass
+        # Basic check
+        self.assertArgSpecEquals(ham, ['x', 'y'], formatted='(x, y)')
+        self.assertFullArgSpecEquals(ham, ['x', 'y'], formatted='(x, y)')
+        self.assertFullArgSpecEquals(functools.partial(ham),
+                                     ['x', 'y'], formatted='(x, y)')
+        # Other variants
+        def check_method(f):
+            self.assertArgSpecEquals(f, ['self', 'x', 'y'],
+                                        formatted='(self, x, y)')
+        class C:
+            @functools.wraps(mod.spam)
+            def ham(self, x, y):
+                pass
+            pham = functools.partialmethod(ham)
+            @functools.wraps(mod.spam)
+            def __call__(self, x, y):
+                pass
+        check_method(C())
+        check_method(C.ham)
+        check_method(C().ham)
+        check_method(C.pham)
+        check_method(C().pham)
+
+        class C_new:
+            @functools.wraps(mod.spam)
+            def __new__(self, x, y):
+                pass
+        check_method(C_new)
+
+        class C_init:
+            @functools.wraps(mod.spam)
+            def __init__(self, x, y):
+                pass
+        check_method(C_init)
+
+    def test_getfullargspec_signature_attr(self):
+        def test():
+            pass
+        spam_param = inspect.Parameter('spam', inspect.Parameter.POSITIONAL_ONLY)
+        test.__signature__ = inspect.Signature(parameters=(spam_param,))
+
+        self.assertFullArgSpecEquals(test, args_e=['spam'], formatted='(spam)')
+
+    def test_getfullargspec_signature_annos(self):
+        def test(a:'spam') -> 'ham': pass
+        spec = inspect.getfullargspec(test)
+        self.assertEqual(test.__annotations__, spec.annotations)
+
+        def test(): pass
+        spec = inspect.getfullargspec(test)
+        self.assertEqual(test.__annotations__, spec.annotations)
+
+    @unittest.skipIf(MISSING_C_DOCSTRINGS,
+                     "Signature information for builtins requires docstrings")
+    def test_getfullargspec_builtin_methods(self):
+        self.assertFullArgSpecEquals(_pickle.Pickler.dump,
+                                     args_e=['self', 'obj'], formatted='(self, obj)')
+
+        self.assertFullArgSpecEquals(_pickle.Pickler(io.BytesIO()).dump,
+                                     args_e=['self', 'obj'], formatted='(self, obj)')
+
+        self.assertFullArgSpecEquals(
+             os.stat,
+             args_e=['path'],
+             kwonlyargs_e=['dir_fd', 'follow_symlinks'],
+             kwonlydefaults_e={'dir_fd': None, 'follow_symlinks': True},
+             formatted='(path, *, dir_fd=None, follow_symlinks=True)')
+
+    @cpython_only
+    @unittest.skipIf(MISSING_C_DOCSTRINGS,
+                     "Signature information for builtins requires docstrings")
+    def test_getfullagrspec_builtin_func(self):
+        import _testcapi
+        builtin = _testcapi.docstring_with_signature_with_defaults
+        spec = inspect.getfullargspec(builtin)
+        self.assertEqual(spec.defaults[0], 'avocado')
+
+    @cpython_only
+    @unittest.skipIf(MISSING_C_DOCSTRINGS,
+                     "Signature information for builtins requires docstrings")
+    def test_getfullagrspec_builtin_func_no_signature(self):
+        import _testcapi
+        builtin = _testcapi.docstring_no_signature
+        with self.assertRaises(TypeError):
+            inspect.getfullargspec(builtin)
 
     def test_getargspec_method(self):
         class A(object):
@@ -588,6 +701,10 @@
             md = _BrokenMethodDescriptor()
 
         attrs = attrs_wo_objs(A)
+
+        self.assertIn(('__new__', 'method', object), attrs, 'missing __new__')
+        self.assertIn(('__init__', 'method', object), attrs, 'missing __init__')
+
         self.assertIn(('s', 'static method', A), attrs, 'missing static method')
         self.assertIn(('c', 'class method', A), attrs, 'missing class method')
         self.assertIn(('p', 'property', A), attrs, 'missing property')
@@ -650,6 +767,88 @@
             if isinstance(builtin, type):
                 inspect.classify_class_attrs(builtin)
 
+    def test_classify_DynamicClassAttribute(self):
+        class Meta(type):
+            def __getattr__(self, name):
+                if name == 'ham':
+                    return 'spam'
+                return super().__getattr__(name)
+        class VA(metaclass=Meta):
+            @types.DynamicClassAttribute
+            def ham(self):
+                return 'eggs'
+        should_find_dca = inspect.Attribute('ham', 'data', VA, VA.__dict__['ham'])
+        self.assertIn(should_find_dca, inspect.classify_class_attrs(VA))
+        should_find_ga = inspect.Attribute('ham', 'data', Meta, 'spam')
+        self.assertIn(should_find_ga, inspect.classify_class_attrs(VA))
+
+    def test_classify_metaclass_class_attribute(self):
+        class Meta(type):
+            fish = 'slap'
+            def __dir__(self):
+                return ['__class__', '__modules__', '__name__', 'fish']
+        class Class(metaclass=Meta):
+            pass
+        should_find = inspect.Attribute('fish', 'data', Meta, 'slap')
+        self.assertIn(should_find, inspect.classify_class_attrs(Class))
+
+    def test_classify_VirtualAttribute(self):
+        class Meta(type):
+            def __dir__(cls):
+                return ['__class__', '__module__', '__name__', 'BOOM']
+            def __getattr__(self, name):
+                if name =='BOOM':
+                    return 42
+                return super().__getattr(name)
+        class Class(metaclass=Meta):
+            pass
+        should_find = inspect.Attribute('BOOM', 'data', Meta, 42)
+        self.assertIn(should_find, inspect.classify_class_attrs(Class))
+
+    def test_classify_VirtualAttribute_multi_classes(self):
+        class Meta1(type):
+            def __dir__(cls):
+                return ['__class__', '__module__', '__name__', 'one']
+            def __getattr__(self, name):
+                if name =='one':
+                    return 1
+                return super().__getattr__(name)
+        class Meta2(type):
+            def __dir__(cls):
+                return ['__class__', '__module__', '__name__', 'two']
+            def __getattr__(self, name):
+                if name =='two':
+                    return 2
+                return super().__getattr__(name)
+        class Meta3(Meta1, Meta2):
+            def __dir__(cls):
+                return list(sorted(set(['__class__', '__module__', '__name__', 'three'] +
+                    Meta1.__dir__(cls) + Meta2.__dir__(cls))))
+            def __getattr__(self, name):
+                if name =='three':
+                    return 3
+                return super().__getattr__(name)
+        class Class1(metaclass=Meta1):
+            pass
+        class Class2(Class1, metaclass=Meta3):
+            pass
+
+        should_find1 = inspect.Attribute('one', 'data', Meta1, 1)
+        should_find2 = inspect.Attribute('two', 'data', Meta2, 2)
+        should_find3 = inspect.Attribute('three', 'data', Meta3, 3)
+        cca = inspect.classify_class_attrs(Class2)
+        for sf in (should_find1, should_find2, should_find3):
+            self.assertIn(sf, cca)
+
+    def test_classify_class_attrs_with_buggy_dir(self):
+        class M(type):
+            def __dir__(cls):
+                return ['__class__', '__name__', 'missing']
+        class C(metaclass=M):
+            pass
+        attrs = [a[0] for a in inspect.classify_class_attrs(C)]
+        self.assertNotIn('missing', attrs)
+
     def test_getmembers_descriptors(self):
         class A(object):
             dd = _BrokenDataDescriptor()
@@ -693,6 +892,28 @@
         self.assertIn(('f', b.f), inspect.getmembers(b))
         self.assertIn(('f', b.f), inspect.getmembers(b, inspect.ismethod))
 
+    def test_getmembers_VirtualAttribute(self):
+        class M(type):
+            def __getattr__(cls, name):
+                if name == 'eggs':
+                    return 'scrambled'
+                return super().__getattr__(name)
+        class A(metaclass=M):
+            @types.DynamicClassAttribute
+            def eggs(self):
+                return 'spam'
+        self.assertIn(('eggs', 'scrambled'), inspect.getmembers(A))
+        self.assertIn(('eggs', 'spam'), inspect.getmembers(A()))
+
+    def test_getmembers_with_buggy_dir(self):
+        class M(type):
+            def __dir__(cls):
+                return ['__class__', '__name__', 'missing']
+        class C(metaclass=M):
+            pass
+        attrs = [a[0] for a in inspect.getmembers(C)]
+        self.assertNotIn('missing', attrs)
+
 
 _global_ref = object()
 class TestGetClosureVars(unittest.TestCase):
@@ -989,6 +1210,20 @@
         self.assertEqualException(f3, '1, 2')
         self.assertEqualException(f3, '1, 2, a=1, b=2')
 
+        # issue #20816: getcallargs() fails to iterate over non-existent
+        # kwonlydefaults and raises a wrong TypeError
+        def f5(*, a): pass
+        with self.assertRaisesRegex(TypeError,
+                                    'missing 1 required keyword-only'):
+            inspect.getcallargs(f5)
+
+
+        # issue20817:
+        def f6(a, b, c):
+            pass
+        with self.assertRaisesRegex(TypeError, "'a', 'b' and 'c'"):
+            inspect.getcallargs(f6)
+
 class TestGetcallargsMethods(TestGetcallargsFunctions):
 
     def setUp(self):
@@ -1080,6 +1315,15 @@
 
         self.assertEqual(inspect.getattr_static(Thing, 'x'), Thing.x)
 
+    def test_classVirtualAttribute(self):
+        class Thing(object):
+            @types.DynamicClassAttribute
+            def x(self):
+                return self._x
+            _x = object()
+
+        self.assertEqual(inspect.getattr_static(Thing, 'x'), Thing.__dict__['x'])
+
     def test_inherited_classattribute(self):
         class Thing(object):
             x = object()
@@ -1390,11 +1634,13 @@
 
         self.assertEqual(str(S()), '()')
 
-        def test(po, pk, *args, ko, **kwargs):
+        def test(po, pk, pod=42, pkd=100, *args, ko, **kwargs):
             pass
         sig = inspect.signature(test)
         po = sig.parameters['po'].replace(kind=P.POSITIONAL_ONLY)
+        pod = sig.parameters['pod'].replace(kind=P.POSITIONAL_ONLY)
         pk = sig.parameters['pk']
+        pkd = sig.parameters['pkd']
         args = sig.parameters['args']
         ko = sig.parameters['ko']
         kwargs = sig.parameters['kwargs']
@@ -1417,6 +1663,15 @@
         with self.assertRaisesRegex(ValueError, 'duplicate parameter name'):
             S((po, pk, args, kwargs2, ko))
 
+        with self.assertRaisesRegex(ValueError, 'follows default argument'):
+            S((pod, po))
+
+        with self.assertRaisesRegex(ValueError, 'follows default argument'):
+            S((po, pkd, pk))
+
+        with self.assertRaisesRegex(ValueError, 'follows default argument'):
+            S((pkd, pk))
+
     def test_signature_immutability(self):
         def test(a):
             pass
@@ -1461,19 +1716,100 @@
                            ('kwargs', ..., int, "var_keyword")),
                           ...))
 
-    def test_signature_on_builtin_function(self):
-        with self.assertRaisesRegex(ValueError, 'not supported by signature'):
-            inspect.signature(type)
-        with self.assertRaisesRegex(ValueError, 'not supported by signature'):
-            # support for 'wrapper_descriptor'
-            inspect.signature(type.__call__)
-        with self.assertRaisesRegex(ValueError, 'not supported by signature'):
-            # support for 'method-wrapper'
-            inspect.signature(min.__call__)
-        with self.assertRaisesRegex(ValueError,
-                                     'no signature found for builtin function'):
-            # support for 'method-wrapper'
-            inspect.signature(min)
+    @cpython_only
+    @unittest.skipIf(MISSING_C_DOCSTRINGS,
+                     "Signature information for builtins requires docstrings")
+    def test_signature_on_builtins(self):
+        import _testcapi
+
+        def test_unbound_method(o):
+            """Use this to test unbound methods (things that should have a self)"""
+            signature = inspect.signature(o)
+            self.assertTrue(isinstance(signature, inspect.Signature))
+            self.assertEqual(list(signature.parameters.values())[0].name, 'self')
+            return signature
+
+        def test_callable(o):
+            """Use this to test bound methods or normal callables (things that don't expect self)"""
+            signature = inspect.signature(o)
+            self.assertTrue(isinstance(signature, inspect.Signature))
+            if signature.parameters:
+                self.assertNotEqual(list(signature.parameters.values())[0].name, 'self')
+            return signature
+
+        signature = test_callable(_testcapi.docstring_with_signature_with_defaults)
+        def p(name): return signature.parameters[name].default
+        self.assertEqual(p('s'), 'avocado')
+        self.assertEqual(p('b'), b'bytes')
+        self.assertEqual(p('d'), 3.14)
+        self.assertEqual(p('i'), 35)
+        self.assertEqual(p('n'), None)
+        self.assertEqual(p('t'), True)
+        self.assertEqual(p('f'), False)
+        self.assertEqual(p('local'), 3)
+        self.assertEqual(p('sys'), sys.maxsize)
+        self.assertEqual(p('exp'), sys.maxsize - 1)
+
+        test_callable(object)
+
+        # normal method
+        # (PyMethodDescr_Type, "method_descriptor")
+        test_unbound_method(_pickle.Pickler.dump)
+        d = _pickle.Pickler(io.StringIO())
+        test_callable(d.dump)
+
+        # static method
+        test_callable(str.maketrans)
+        test_callable('abc'.maketrans)
+
+        # class method
+        test_callable(dict.fromkeys)
+        test_callable({}.fromkeys)
+
+        # wrapper around slot (PyWrapperDescr_Type, "wrapper_descriptor")
+        test_unbound_method(type.__call__)
+        test_unbound_method(int.__add__)
+        test_callable((3).__add__)
+
+        # _PyMethodWrapper_Type
+        # support for 'method-wrapper'
+        test_callable(min.__call__)
+
+        # This doesn't work now.
+        # (We don't have a valid signature for "type" in 3.4)
+        with self.assertRaisesRegex(ValueError, "no signature found"):
+            class ThisWorksNow:
+                __call__ = type
+            test_callable(ThisWorksNow())
+
+        # Regression test for issue #20786
+        test_unbound_method(dict.__delitem__)
+        test_unbound_method(property.__delete__)
+
+
+    @cpython_only
+    @unittest.skipIf(MISSING_C_DOCSTRINGS,
+                     "Signature information for builtins requires docstrings")
+    def test_signature_on_decorated_builtins(self):
+        import _testcapi
+        func = _testcapi.docstring_with_signature_with_defaults
+
+        def decorator(func):
+            @functools.wraps(func)
+            def wrapper(*args, **kwargs) -> int:
+                return func(*args, **kwargs)
+            return wrapper
+
+        decorated_func = decorator(func)
+
+        self.assertEqual(inspect.signature(func),
+                         inspect.signature(decorated_func))
+
+    @cpython_only
+    def test_signature_on_builtins_no_signature(self):
+        import _testcapi
+        with self.assertRaisesRegex(ValueError, 'no signature found for builtin'):
+            inspect.signature(_testcapi.docstring_no_signature)
 
     def test_signature_on_non_function(self):
         with self.assertRaisesRegex(TypeError, 'is not a callable object'):
@@ -1482,18 +1818,112 @@
         with self.assertRaisesRegex(TypeError, 'is not a Python function'):
             inspect.Signature.from_function(42)
 
-    def test_signature_on_method(self):
-        class Test:
-            def foo(self, arg1, arg2=1) -> int:
+    def test_signature_from_builtin_errors(self):
+        with self.assertRaisesRegex(TypeError, 'is not a Python builtin'):
+            inspect.Signature.from_builtin(42)
+
+    def test_signature_from_functionlike_object(self):
+        def func(a,b, *args, kwonly=True, kwonlyreq, **kwargs):
+            pass
+
+        class funclike:
+            # Has to be callable, and have correct
+            # __code__, __annotations__, __defaults__, __name__,
+            # and __kwdefaults__ attributes
+
+            def __init__(self, func):
+                self.__name__ = func.__name__
+                self.__code__ = func.__code__
+                self.__annotations__ = func.__annotations__
+                self.__defaults__ = func.__defaults__
+                self.__kwdefaults__ = func.__kwdefaults__
+                self.func = func
+
+            def __call__(self, *args, **kwargs):
+                return self.func(*args, **kwargs)
+
+        sig_func = inspect.Signature.from_function(func)
+
+        sig_funclike = inspect.Signature.from_function(funclike(func))
+        self.assertEqual(sig_funclike, sig_func)
+
+        sig_funclike = inspect.signature(funclike(func))
+        self.assertEqual(sig_funclike, sig_func)
+
+        # If object is not a duck type of function, then
+        # signature will try to get a signature for its '__call__'
+        # method
+        fl = funclike(func)
+        del fl.__defaults__
+        self.assertEqual(self.signature(fl),
+                         ((('args', ..., ..., "var_positional"),
+                           ('kwargs', ..., ..., "var_keyword")),
+                           ...))
+
+        # Test with cython-like builtins:
+        _orig_isdesc = inspect.ismethoddescriptor
+        def _isdesc(obj):
+            if hasattr(obj, '_builtinmock'):
+                return True
+            return _orig_isdesc(obj)
+
+        with unittest.mock.patch('inspect.ismethoddescriptor', _isdesc):
+            builtin_func = funclike(func)
+            # Make sure that our mock setup is working
+            self.assertFalse(inspect.ismethoddescriptor(builtin_func))
+            builtin_func._builtinmock = True
+            self.assertTrue(inspect.ismethoddescriptor(builtin_func))
+            self.assertEqual(inspect.signature(builtin_func), sig_func)
+
+    def test_signature_functionlike_class(self):
+        # We only want to duck type function-like objects,
+        # not classes.
+
+        def func(a,b, *args, kwonly=True, kwonlyreq, **kwargs):
+            pass
+
+        class funclike:
+            def __init__(self, marker):
                 pass
 
-        meth = Test().foo
+            __name__ = func.__name__
+            __code__ = func.__code__
+            __annotations__ = func.__annotations__
+            __defaults__ = func.__defaults__
+            __kwdefaults__ = func.__kwdefaults__
 
-        self.assertEqual(self.signature(meth),
+        with self.assertRaisesRegex(TypeError, 'is not a Python function'):
+            inspect.Signature.from_function(funclike)
+
+        self.assertEqual(str(inspect.signature(funclike)), '(marker)')
+
+    def test_signature_on_method(self):
+        class Test:
+            def __init__(*args):
+                pass
+            def m1(self, arg1, arg2=1) -> int:
+                pass
+            def m2(*args):
+                pass
+            def __call__(*, a):
+                pass
+
+        self.assertEqual(self.signature(Test().m1),
                          ((('arg1', ..., ..., "positional_or_keyword"),
                            ('arg2', 1, ..., "positional_or_keyword")),
                           int))
 
+        self.assertEqual(self.signature(Test().m2),
+                         ((('args', ..., ..., "var_positional"),),
+                          ...))
+
+        self.assertEqual(self.signature(Test),
+                         ((('args', ..., ..., "var_positional"),),
+                          ...))
+
+        with self.assertRaisesRegex(ValueError, 'invalid method signature'):
+            self.signature(Test())
+
     def test_signature_on_classmethod(self):
         class Test:
             @classmethod
@@ -1533,6 +1963,8 @@
     def test_signature_on_partial(self):
         from functools import partial
 
+        Parameter = inspect.Parameter
+
         def test():
             pass
 
@@ -1568,15 +2000,22 @@
 
         self.assertEqual(self.signature(partial(test, b=1, c=2)),
                          ((('a', ..., ..., "positional_or_keyword"),
-                           ('b', 1, ..., "positional_or_keyword"),
+                           ('b', 1, ..., "keyword_only"),
                            ('c', 2, ..., "keyword_only"),
                            ('d', ..., ..., "keyword_only")),
                           ...))
 
         self.assertEqual(self.signature(partial(test, 0, b=1, c=2)),
-                         ((('b', 1, ..., "positional_or_keyword"),
+                         ((('b', 1, ..., "keyword_only"),
                            ('c', 2, ..., "keyword_only"),
-                           ('d', ..., ..., "keyword_only"),),
+                           ('d', ..., ..., "keyword_only")),
+                          ...))
+
+        self.assertEqual(self.signature(partial(test, a=1)),
+                         ((('a', 1, ..., "keyword_only"),
+                           ('b', ..., ..., "keyword_only"),
+                           ('c', ..., ..., "keyword_only"),
+                           ('d', ..., ..., "keyword_only")),
                           ...))
 
         def test(a, *args, b, **kwargs):
@@ -1588,13 +2027,18 @@
                            ('kwargs', ..., ..., "var_keyword")),
                           ...))
 
+        self.assertEqual(self.signature(partial(test, a=1)),
+                         ((('a', 1, ..., "keyword_only"),
+                           ('b', ..., ..., "keyword_only"),
+                           ('kwargs', ..., ..., "var_keyword")),
+                          ...))
+
         self.assertEqual(self.signature(partial(test, 1, 2, 3)),
                          ((('args', ..., ..., "var_positional"),
                            ('b', ..., ..., "keyword_only"),
                            ('kwargs', ..., ..., "var_keyword")),
                           ...))
 
-
         self.assertEqual(self.signature(partial(test, 1, 2, 3, test=True)),
                          ((('args', ..., ..., "var_positional"),
                            ('b', ..., ..., "keyword_only"),
@@ -1641,7 +2085,7 @@
             return a
         _foo = partial(partial(foo, a=10), a=20)
         self.assertEqual(self.signature(_foo),
-                         ((('a', 20, ..., "positional_or_keyword"),),
+                         ((('a', 20, ..., "keyword_only"),),
                           ...))
         # check that we don't have any side-effects in signature(),
         # and the partial object is still functioning
@@ -1650,42 +2094,119 @@
         def foo(a, b, c):
             return a, b, c
         _foo = partial(partial(foo, 1, b=20), b=30)
+
         self.assertEqual(self.signature(_foo),
-                         ((('b', 30, ..., "positional_or_keyword"),
-                           ('c', ..., ..., "positional_or_keyword")),
+                         ((('b', 30, ..., "keyword_only"),
+                           ('c', ..., ..., "keyword_only")),
                           ...))
         self.assertEqual(_foo(c=10), (1, 30, 10))
-        _foo = partial(_foo, 2) # now 'b' has two values -
-                                # positional and keyword
-        with self.assertRaisesRegex(ValueError, "has incorrect arguments"):
-            inspect.signature(_foo)
 
         def foo(a, b, c, *, d):
             return a, b, c, d
         _foo = partial(partial(foo, d=20, c=20), b=10, d=30)
         self.assertEqual(self.signature(_foo),
                          ((('a', ..., ..., "positional_or_keyword"),
-                           ('b', 10, ..., "positional_or_keyword"),
-                           ('c', 20, ..., "positional_or_keyword"),
-                           ('d', 30, ..., "keyword_only")),
+                           ('b', 10, ..., "keyword_only"),
+                           ('c', 20, ..., "keyword_only"),
+                           ('d', 30, ..., "keyword_only"),
+                           ),
                           ...))
         ba = inspect.signature(_foo).bind(a=200, b=11)
         self.assertEqual(_foo(*ba.args, **ba.kwargs), (200, 11, 20, 30))
 
         def foo(a=1, b=2, c=3):
             return a, b, c
-        _foo = partial(foo, a=10, c=13)
-        ba = inspect.signature(_foo).bind(11)
+        _foo = partial(foo, c=13) # (a=1, b=2, *, c=13)
+
+        ba = inspect.signature(_foo).bind(a=11)
         self.assertEqual(_foo(*ba.args, **ba.kwargs), (11, 2, 13))
+
         ba = inspect.signature(_foo).bind(11, 12)
         self.assertEqual(_foo(*ba.args, **ba.kwargs), (11, 12, 13))
+
         ba = inspect.signature(_foo).bind(11, b=12)
         self.assertEqual(_foo(*ba.args, **ba.kwargs), (11, 12, 13))
+
         ba = inspect.signature(_foo).bind(b=12)
-        self.assertEqual(_foo(*ba.args, **ba.kwargs), (10, 12, 13))
-        _foo = partial(_foo, b=10)
-        ba = inspect.signature(_foo).bind(12, 14)
-        self.assertEqual(_foo(*ba.args, **ba.kwargs), (12, 14, 13))
+        self.assertEqual(_foo(*ba.args, **ba.kwargs), (1, 12, 13))
+
+        _foo = partial(_foo, b=10, c=20)
+        ba = inspect.signature(_foo).bind(12)
+        self.assertEqual(_foo(*ba.args, **ba.kwargs), (12, 10, 20))
+
+
+        def foo(a, b, c, d, **kwargs):
+            pass
+        sig = inspect.signature(foo)
+        params = sig.parameters.copy()
+        params['a'] = params['a'].replace(kind=Parameter.POSITIONAL_ONLY)
+        params['b'] = params['b'].replace(kind=Parameter.POSITIONAL_ONLY)
+        foo.__signature__ = inspect.Signature(params.values())
+        sig = inspect.signature(foo)
+        self.assertEqual(str(sig), '(a, b, /, c, d, **kwargs)')
+
+        self.assertEqual(self.signature(partial(foo, 1)),
+                         ((('b', ..., ..., 'positional_only'),
+                           ('c', ..., ..., 'positional_or_keyword'),
+                           ('d', ..., ..., 'positional_or_keyword'),
+                           ('kwargs', ..., ..., 'var_keyword')),
+                         ...))
+
+        self.assertEqual(self.signature(partial(foo, 1, 2)),
+                         ((('c', ..., ..., 'positional_or_keyword'),
+                           ('d', ..., ..., 'positional_or_keyword'),
+                           ('kwargs', ..., ..., 'var_keyword')),
+                         ...))
+
+        self.assertEqual(self.signature(partial(foo, 1, 2, 3)),
+                         ((('d', ..., ..., 'positional_or_keyword'),
+                           ('kwargs', ..., ..., 'var_keyword')),
+                         ...))
+
+        self.assertEqual(self.signature(partial(foo, 1, 2, c=3)),
+                         ((('c', 3, ..., 'keyword_only'),
+                           ('d', ..., ..., 'keyword_only'),
+                           ('kwargs', ..., ..., 'var_keyword')),
+                         ...))
+
+        self.assertEqual(self.signature(partial(foo, 1, c=3)),
+                         ((('b', ..., ..., 'positional_only'),
+                           ('c', 3, ..., 'keyword_only'),
+                           ('d', ..., ..., 'keyword_only'),
+                           ('kwargs', ..., ..., 'var_keyword')),
+                         ...))
+
+    def test_signature_on_partialmethod(self):
+        from functools import partialmethod
+
+        class Spam:
+            def test():
+                pass
+            ham = partialmethod(test)
+
+        with self.assertRaisesRegex(ValueError, "has incorrect arguments"):
+            inspect.signature(Spam.ham)
+
+        class Spam:
+            def test(it, a, *, c) -> 'spam':
+                pass
+            ham = partialmethod(test, c=1)
+
+        self.assertEqual(self.signature(Spam.ham),
+                         ((('it', ..., ..., 'positional_or_keyword'),
+                           ('a', ..., ..., 'positional_or_keyword'),
+                           ('c', 1, ..., 'keyword_only')),
+                          'spam'))
+
+        self.assertEqual(self.signature(Spam().ham),
+                         ((('a', ..., ..., 'positional_or_keyword'),
+                           ('c', 1, ..., 'keyword_only')),
+                          'spam'))
+
+    def test_signature_on_fake_partialmethod(self):
+        def foo(a): pass
+        foo._partialmethod = 'spam'
+        self.assertEqual(str(inspect.signature(foo)), '(a)')
 
     def test_signature_on_decorated(self):
         import functools
@@ -1736,6 +2257,17 @@
                          ((('b', ..., ..., "positional_or_keyword"),),
                           ...))
 
+        # Test we handle __signature__ partway down the wrapper stack
+        def wrapped_foo_call():
+            pass
+        wrapped_foo_call.__wrapped__ = Foo.__call__
+
+        self.assertEqual(self.signature(wrapped_foo_call),
+                         ((('a', ..., ..., "positional_or_keyword"),
+                           ('b', ..., ..., "positional_or_keyword")),
+                          ...))
+
+
     def test_signature_on_class(self):
         class C:
             def __init__(self, a):
@@ -1817,6 +2349,49 @@
                            ('bar', 2, ..., "keyword_only")),
                           ...))
 
+    @unittest.skipIf(MISSING_C_DOCSTRINGS,
+                     "Signature information for builtins requires docstrings")
+    def test_signature_on_class_without_init(self):
+        # Test classes without user-defined __init__ or __new__
+        class C: pass
+        self.assertEqual(str(inspect.signature(C)), '()')
+        class D(C): pass
+        self.assertEqual(str(inspect.signature(D)), '()')
+
+        # Test meta-classes without user-defined __init__ or __new__
+        class C(type): pass
+        class D(C): pass
+        with self.assertRaisesRegex(ValueError, "callable.*is not supported"):
+            self.assertEqual(inspect.signature(C), None)
+        with self.assertRaisesRegex(ValueError, "callable.*is not supported"):
+            self.assertEqual(inspect.signature(D), None)
+
+    @unittest.skipIf(MISSING_C_DOCSTRINGS,
+                     "Signature information for builtins requires docstrings")
+    def test_signature_on_builtin_class(self):
+        self.assertEqual(str(inspect.signature(_pickle.Pickler)),
+                         '(file, protocol=None, fix_imports=True)')
+
+        class P(_pickle.Pickler): pass
+        class EmptyTrait: pass
+        class P2(EmptyTrait, P): pass
+        self.assertEqual(str(inspect.signature(P)),
+                         '(file, protocol=None, fix_imports=True)')
+        self.assertEqual(str(inspect.signature(P2)),
+                         '(file, protocol=None, fix_imports=True)')
+
+        class P3(P2):
+            def __init__(self, spam):
+                pass
+        self.assertEqual(str(inspect.signature(P3)), '(spam)')
+
+        class MetaP(type):
+            def __call__(cls, foo, bar):
+                pass
+        class P4(P2, metaclass=MetaP):
+            pass
+        self.assertEqual(str(inspect.signature(P4)), '(foo, bar)')
+
     def test_signature_on_callable_objects(self):
         class Foo:
             def __call__(self, a):
@@ -1838,18 +2413,16 @@
                          ((('a', ..., ..., "positional_or_keyword"),),
                           ...))
 
-        class ToFail:
-            __call__ = type
-        with self.assertRaisesRegex(ValueError, "not supported by signature"):
-            inspect.signature(ToFail())
-
-
         class Wrapped:
             pass
         Wrapped.__wrapped__ = lambda a: None
         self.assertEqual(self.signature(Wrapped),
                          ((('a', ..., ..., "positional_or_keyword"),),
                           ...))
+        # wrapper loop:
+        Wrapped.__wrapped__ = Wrapped
+        with self.assertRaisesRegex(ValueError, 'wrapper loop'):
+            self.signature(Wrapped)
 
     def test_signature_on_lambdas(self):
         self.assertEqual(self.signature((lambda a=10: a)),
@@ -1923,6 +2496,7 @@
 
     def test_signature_str_positional_only(self):
         P = inspect.Parameter
+        S = inspect.Signature
 
         def test(a_po, *, b, **kwargs):
             return a_po, kwargs
@@ -1933,14 +2507,20 @@
         test.__signature__ = sig.replace(parameters=new_params)
 
         self.assertEqual(str(inspect.signature(test)),
-                         '(<a_po>, *, b, **kwargs)')
+                         '(a_po, /, *, b, **kwargs)')
 
-        sig = inspect.signature(test)
-        new_params = list(sig.parameters.values())
-        new_params[0] = new_params[0].replace(name=None)
-        test.__signature__ = sig.replace(parameters=new_params)
-        self.assertEqual(str(inspect.signature(test)),
-                         '(<0>, *, b, **kwargs)')
+        self.assertEqual(str(S(parameters=[P('foo', P.POSITIONAL_ONLY)])),
+                         '(foo, /)')
+
+        self.assertEqual(str(S(parameters=[
+                                P('foo', P.POSITIONAL_ONLY),
+                                P('bar', P.VAR_KEYWORD)])),
+                         '(foo, /, **bar)')
+
+        self.assertEqual(str(S(parameters=[
+                                P('foo', P.POSITIONAL_ONLY),
+                                P('bar', P.VAR_POSITIONAL)])),
+                         '(foo, /, *bar)')
 
     def test_signature_replace_anno(self):
         def test() -> 42:
@@ -1955,6 +2535,22 @@
         self.assertEqual(sig.return_annotation, 42)
         self.assertEqual(sig, inspect.signature(test))
 
+    def test_signature_on_mangled_parameters(self):
+        class Spam:
+            def foo(self, __p1:1=2, *, __p2:2=3):
+                pass
+        class Ham(Spam):
+            pass
+
+        self.assertEqual(self.signature(Spam.foo),
+                         ((('self', ..., ..., "positional_or_keyword"),
+                           ('_Spam__p1', 2, 1, "positional_or_keyword"),
+                           ('_Spam__p2', 3, 2, "keyword_only")),
+                          ...))
+
+        self.assertEqual(self.signature(Spam.foo),
+                         self.signature(Ham.foo))
+
 
 class TestParameterObject(unittest.TestCase):
     def test_signature_parameter_kinds(self):
@@ -1979,10 +2575,13 @@
         with self.assertRaisesRegex(ValueError, 'not a valid parameter name'):
             inspect.Parameter('1', kind=inspect.Parameter.VAR_KEYWORD)
 
-        with self.assertRaisesRegex(ValueError,
-                                     'non-positional-only parameter'):
+        with self.assertRaisesRegex(TypeError, 'name must be a str'):
             inspect.Parameter(None, kind=inspect.Parameter.VAR_KEYWORD)
 
+        with self.assertRaisesRegex(ValueError,
+                                    'is not a valid parameter name'):
+            inspect.Parameter('$', kind=inspect.Parameter.VAR_KEYWORD)
+
         with self.assertRaisesRegex(ValueError, 'cannot have default values'):
             inspect.Parameter('a', default=42,
                               kind=inspect.Parameter.VAR_KEYWORD)
@@ -2031,7 +2630,8 @@
         self.assertEqual(p2.name, 'bar')
         self.assertNotEqual(p2, p)
 
-        with self.assertRaisesRegex(ValueError, 'not a valid parameter name'):
+        with self.assertRaisesRegex(ValueError,
+                                    'name is a required attribute'):
             p2 = p2.replace(name=p2.empty)
 
         p2 = p2.replace(name='foo', default=None)
@@ -2053,14 +2653,11 @@
         self.assertEqual(p2, p)
 
     def test_signature_parameter_positional_only(self):
-        p = inspect.Parameter(None, kind=inspect.Parameter.POSITIONAL_ONLY)
-        self.assertEqual(str(p), '<>')
-
-        p = p.replace(name='1')
-        self.assertEqual(str(p), '<1>')
+        with self.assertRaisesRegex(TypeError, 'name must be a str'):
+            inspect.Parameter(None, kind=inspect.Parameter.POSITIONAL_ONLY)
 
     def test_signature_parameter_immutability(self):
-        p = inspect.Parameter(None, kind=inspect.Parameter.POSITIONAL_ONLY)
+        p = inspect.Parameter('spam', kind=inspect.Parameter.KEYWORD_ONLY)
 
         with self.assertRaises(AttributeError):
             p.foo = 'bar'
@@ -2258,6 +2855,15 @@
         self.assertEqual(self.call(test, 1, 2, 4, 5, bar=6),
                          (1, 2, 4, 5, 6, {}))
 
+        self.assertEqual(self.call(test, 1, 2),
+                         (1, 2, 3, 42, 50, {}))
+
+        self.assertEqual(self.call(test, 1, 2, foo=4, bar=5),
+                         (1, 2, 3, 4, 5, {}))
+
+        with self.assertRaisesRegex(TypeError, "but was passed as a keyword"):
+            self.call(test, 1, 2, foo=4, bar=5, c_po=10)
+
         with self.assertRaisesRegex(TypeError, "parameter is positional only"):
             self.call(test, 1, 2, c_po=4)
 
@@ -2274,6 +2880,22 @@
         ba = sig.bind(1, self=2, b=3)
         self.assertEqual(ba.args, (1, 2, 3))
 
+    def test_signature_bind_vararg_name(self):
+        def test(a, *args):
+            return a, args
+        sig = inspect.signature(test)
+
+        with self.assertRaisesRegex(TypeError, "too many keyword arguments"):
+            sig.bind(a=0, args=1)
+
+        def test(*args, **kwargs):
+            return args, kwargs
+        self.assertEqual(self.call(test, args=1), ((), {'args': 1}))
+
+        sig = inspect.signature(test)
+        ba = sig.bind(args=1)
+        self.assertEqual(ba.arguments, {'kwargs': {'args': 1}})
+
 
 class TestBoundArguments(unittest.TestCase):
     def test_signature_bound_arguments_unhashable(self):
@@ -2301,6 +2923,203 @@
         self.assertNotEqual(ba, ba4)
 
 
+class TestSignaturePrivateHelpers(unittest.TestCase):
+    def test_signature_get_bound_param(self):
+        getter = inspect._signature_get_bound_param
+
+        self.assertEqual(getter('($self)'), 'self')
+        self.assertEqual(getter('($self, obj)'), 'self')
+        self.assertEqual(getter('($cls, /, obj)'), 'cls')
+
+    def _strip_non_python_syntax(self, input,
+        clean_signature, self_parameter, last_positional_only):
+        computed_clean_signature, \
+            computed_self_parameter, \
+            computed_last_positional_only = \
+            inspect._signature_strip_non_python_syntax(input)
+        self.assertEqual(computed_clean_signature, clean_signature)
+        self.assertEqual(computed_self_parameter, self_parameter)
+        self.assertEqual(computed_last_positional_only, last_positional_only)
+
+    def test_signature_strip_non_python_syntax(self):
+        self._strip_non_python_syntax(
+            "($module, /, path, mode, *, dir_fd=None, " +
+                "effective_ids=False,\n       follow_symlinks=True)",
+            "(module, path, mode, *, dir_fd=None, " +
+                "effective_ids=False, follow_symlinks=True)",
+            0,
+            0)
+
+        self._strip_non_python_syntax(
+            "($module, word, salt, /)",
+            "(module, word, salt)",
+            0,
+            2)
+
+        self._strip_non_python_syntax(
+            "(x, y=None, z=None, /)",
+            "(x, y=None, z=None)",
+            None,
+            2)
+
+        self._strip_non_python_syntax(
+            "(x, y=None, z=None)",
+            "(x, y=None, z=None)",
+            None,
+            None)
+
+        self._strip_non_python_syntax(
+            "(x,\n    y=None,\n      z = None  )",
+            "(x, y=None, z=None)",
+            None,
+            None)
+
+        self._strip_non_python_syntax(
+            "",
+            "",
+            None,
+            None)
+
+        self._strip_non_python_syntax(
+            None,
+            None,
+            None,
+            None)
+
+
+class TestUnwrap(unittest.TestCase):
+
+    def test_unwrap_one(self):
+        def func(a, b):
+            return a + b
+        wrapper = functools.lru_cache(maxsize=20)(func)
+        self.assertIs(inspect.unwrap(wrapper), func)
+
+    def test_unwrap_several(self):
+        def func(a, b):
+            return a + b
+        wrapper = func
+        for __ in range(10):
+            @functools.wraps(wrapper)
+            def wrapper():
+                pass
+        self.assertIsNot(wrapper.__wrapped__, func)
+        self.assertIs(inspect.unwrap(wrapper), func)
+
+    def test_stop(self):
+        def func1(a, b):
+            return a + b
+        @functools.wraps(func1)
+        def func2():
+            pass
+        @functools.wraps(func2)
+        def wrapper():
+            pass
+        func2.stop_here = 1
+        unwrapped = inspect.unwrap(wrapper,
+                                   stop=(lambda f: hasattr(f, "stop_here")))
+        self.assertIs(unwrapped, func2)
+
+    def test_cycle(self):
+        def func1(): pass
+        func1.__wrapped__ = func1
+        with self.assertRaisesRegex(ValueError, 'wrapper loop'):
+            inspect.unwrap(func1)
+
+        def func2(): pass
+        func2.__wrapped__ = func1
+        func1.__wrapped__ = func2
+        with self.assertRaisesRegex(ValueError, 'wrapper loop'):
+            inspect.unwrap(func1)
+        with self.assertRaisesRegex(ValueError, 'wrapper loop'):
+            inspect.unwrap(func2)
+
+    def test_unhashable(self):
+        def func(): pass
+        func.__wrapped__ = None
+        class C:
+            __hash__ = None
+            __wrapped__ = func
+        self.assertIsNone(inspect.unwrap(C()))
+
+class TestMain(unittest.TestCase):
+    def test_only_source(self):
+        module = importlib.import_module('unittest')
+        rc, out, err = assert_python_ok('-m', 'inspect',
+                                        'unittest')
+        lines = out.decode().splitlines()
+        # ignore the final newline
+        self.assertEqual(lines[:-1], inspect.getsource(module).splitlines())
+        self.assertEqual(err, b'')
+
+    def test_custom_getattr(self):
+        def foo():
+            pass
+        foo.__signature__ = 42
+        with self.assertRaises(TypeError):
+            inspect.signature(foo)
+
+    @unittest.skipIf(ThreadPoolExecutor is None,
+            'threads required to test __qualname__ for source files')
+    def test_qualname_source(self):
+        rc, out, err = assert_python_ok('-m', 'inspect',
+                                     'concurrent.futures:ThreadPoolExecutor')
+        lines = out.decode().splitlines()
+        # ignore the final newline
+        self.assertEqual(lines[:-1],
+                         inspect.getsource(ThreadPoolExecutor).splitlines())
+        self.assertEqual(err, b'')
+
+    def test_builtins(self):
+        module = importlib.import_module('unittest')
+        _, out, err = assert_python_failure('-m', 'inspect',
+                                            'sys')
+        lines = err.decode().splitlines()
+        self.assertEqual(lines, ["Can't get info for builtin modules."])
+
+    def test_details(self):
+        module = importlib.import_module('unittest')
+        rc, out, err = assert_python_ok('-m', 'inspect',
+                                        'unittest', '--details')
+        output = out.decode()
+        # Just a quick sanity check on the output
+        self.assertIn(module.__name__, output)
+        self.assertIn(module.__file__, output)
+        if not sys.flags.optimize:
+            self.assertIn(module.__cached__, output)
+        self.assertEqual(err, b'')
+
+
+class TestReload(unittest.TestCase):
+
+    src_before = textwrap.dedent("""\
+def foo():
+    print("Bla")
+    """)
+
+    src_after = textwrap.dedent("""\
+def foo():
+    print("Oh no!")
+    """)
+
+    def assertInspectEqual(self, path, source):
+        inspected_src = inspect.getsource(source)
+        with open(path) as src:
+            self.assertEqual(
+                src.read().splitlines(True),
+                inspected_src.splitlines(True)
+            )
+
+    def test_getsource_reload(self):
+        # see issue 1218234
+        with _ready_to_import('reload_bug', self.src_before) as (name, path):
+            module = importlib.import_module(name)
+            self.assertInspectEqual(path, module)
+            with open(path, 'w') as src:
+                src.write(self.src_after)
+            self.assertInspectEqual(path, module)
+
+
 def test_main():
     run_unittest(
         TestDecorators, TestRetrievingSourceCode, TestOneliners, TestBuggyCases,
@@ -2308,7 +3127,8 @@
         TestGetcallargsFunctions, TestGetcallargsMethods,
         TestGetcallargsUnboundMethods, TestGetattrStatic, TestGetGeneratorState,
         TestNoEOL, TestSignatureObject, TestSignatureBind, TestParameterObject,
-        TestBoundArguments, TestGetClosureVars
+        TestBoundArguments, TestSignaturePrivateHelpers, TestGetClosureVars,
+        TestUnwrap, TestMain, TestReload
     )
 
 if __name__ == "__main__":
diff --git a/Lib/test/test_int.py b/Lib/test/test_int.py
index c489510..e94602e 100644
--- a/Lib/test/test_int.py
+++ b/Lib/test/test_int.py
@@ -228,6 +228,47 @@
         self.assertRaises(TypeError, int, base=10)
         self.assertRaises(TypeError, int, base=0)
 
+    def test_int_base_limits(self):
+        """Testing the supported limits of the int() base parameter."""
+        self.assertEqual(int('0', 5), 0)
+        with self.assertRaises(ValueError):
+            int('0', 1)
+        with self.assertRaises(ValueError):
+            int('0', 37)
+        with self.assertRaises(ValueError):
+            int('0', -909)  # An old magic value base from Python 2.
+        with self.assertRaises(ValueError):
+            int('0', base=0-(2**234))
+        with self.assertRaises(ValueError):
+            int('0', base=2**234)
+        # Bases 2 through 36 are supported.
+        for base in range(2,37):
+            self.assertEqual(int('0', base=base), 0)
+
+    def test_int_base_bad_types(self):
+        """Not integer types are not valid bases; issue16772."""
+        with self.assertRaises(TypeError):
+            int('0', 5.5)
+        with self.assertRaises(TypeError):
+            int('0', 5.0)
+
+    def test_int_base_indexable(self):
+        class MyIndexable(object):
+            def __init__(self, value):
+                self.value = value
+            def __index__(self):
+                return self.value
+
+        # Check out of range bases.
+        for base in 2**100, -2**100, 1, 37:
+            with self.assertRaises(ValueError):
+                int('43', base)
+
+        # Check in-range bases.
+        self.assertEqual(int('101', base=MyIndexable(2)), 5)
+        self.assertEqual(int('101', base=MyIndexable(10)), 101)
+        self.assertEqual(int('101', base=MyIndexable(36)), 1 + 36**2)
+
     def test_non_numeric_input_types(self):
         # Test possible non-numeric types for the argument x, including
         # subclasses of the explicitly documented accepted types.
@@ -359,15 +400,18 @@
                 return True
 
         bad_int = BadInt()
-        n = int(bad_int)
+        with self.assertWarns(DeprecationWarning):
+            n = int(bad_int)
         self.assertEqual(n, 1)
 
         bad_int = BadInt2()
-        n = int(bad_int)
+        with self.assertWarns(DeprecationWarning):
+            n = int(bad_int)
         self.assertEqual(n, 1)
 
         bad_int = TruncReturnsBadInt()
-        n = int(bad_int)
+        with self.assertWarns(DeprecationWarning):
+            n = int(bad_int)
         self.assertEqual(n, 1)
 
         good_int = TruncReturnsIntSubclass()
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py
index 4b49d33..a424f76 100644
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -35,6 +35,7 @@
 from collections import deque, UserList
 from itertools import cycle, count
 from test import support
+from test.script_helper import assert_python_ok
 
 import codecs
 import io  # C implementation of io
@@ -164,7 +165,7 @@
     def close(self):
         if not self.closed:
             self.closed = 1
-            raise IOError
+            raise OSError
 
 class CCloseFailureIO(CloseFailureIO, io.RawIOBase):
     pass
@@ -595,9 +596,9 @@
     def test_flush_error_on_close(self):
         f = self.open(support.TESTFN, "wb", buffering=0)
         def bad_flush():
-            raise IOError()
+            raise OSError()
         f.flush = bad_flush
-        self.assertRaises(IOError, f.close) # exception not swallowed
+        self.assertRaises(OSError, f.close) # exception not swallowed
         self.assertTrue(f.closed)
 
     def test_multi_close(self):
@@ -652,6 +653,20 @@
             fileio.close()
             f2.readline()
 
+    def test_nonbuffered_textio(self):
+        with warnings.catch_warnings(record=True) as recorded:
+            with self.assertRaises(ValueError):
+                self.open(support.TESTFN, 'w', buffering=0)
+            support.gc_collect()
+        self.assertEqual(recorded, [])
+
+    def test_invalid_newline(self):
+        with warnings.catch_warnings(record=True) as recorded:
+            with self.assertRaises(ValueError):
+                self.open(support.TESTFN, 'w', newline='invalid')
+            support.gc_collect()
+        self.assertEqual(recorded, [])
+
 
 class CIOTest(IOTest):
 
@@ -686,6 +701,8 @@
         self.assertIs(buf.detach(), raw)
         self.assertRaises(ValueError, buf.detach)
 
+        repr(buf)  # Should still work
+
     def test_fileno(self):
         rawio = self.MockRawIO()
         bufio = self.tp(rawio)
@@ -757,7 +774,7 @@
         if s:
             # The destructor *may* have printed an unraisable error, check it
             self.assertEqual(len(s.splitlines()), 1)
-            self.assertTrue(s.startswith("Exception IOError: "), s)
+            self.assertTrue(s.startswith("Exception OSError: "), s)
             self.assertTrue(s.endswith(" ignored"), s)
 
     def test_repr(self):
@@ -773,27 +790,45 @@
     def test_flush_error_on_close(self):
         raw = self.MockRawIO()
         def bad_flush():
-            raise IOError()
+            raise OSError()
         raw.flush = bad_flush
         b = self.tp(raw)
-        self.assertRaises(IOError, b.close) # exception not swallowed
+        self.assertRaises(OSError, 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')
+            raise OSError('flush')
         def bad_close():
-            raise IOError('close')
+            raise OSError('close')
         raw.close = bad_close
         b = self.tp(raw)
         b.flush = bad_flush
-        with self.assertRaises(IOError) as err: # exception not swallowed
+        with self.assertRaises(OSError) as err: # exception not swallowed
             b.close()
         self.assertEqual(err.exception.args, ('close',))
+        self.assertIsInstance(err.exception.__context__, OSError)
         self.assertEqual(err.exception.__context__.args, ('flush',))
         self.assertFalse(b.closed)
 
+    def test_nonnormalized_close_error_on_close(self):
+        # Issue #21677
+        raw = self.MockRawIO()
+        def bad_flush():
+            raise non_existing_flush
+        def bad_close():
+            raise non_existing_close
+        raw.close = bad_close
+        b = self.tp(raw)
+        b.flush = bad_flush
+        with self.assertRaises(NameError) as err: # exception not swallowed
+            b.close()
+        self.assertIn('non_existing_close', str(err.exception))
+        self.assertIsInstance(err.exception.__context__, NameError)
+        self.assertIn('non_existing_flush', str(err.exception.__context__))
+        self.assertFalse(b.closed)
+
     def test_multi_close(self):
         raw = self.MockRawIO()
         b = self.tp(raw)
@@ -828,6 +863,14 @@
         bufio = self.tp(rawio, buffer_size=bufsize2)
         self.assertEqual(sys.getsizeof(bufio), size + bufsize2)
 
+    @support.cpython_only
+    def test_buffer_freeing(self) :
+        bufsize = 4096
+        rawio = self.MockRawIO()
+        bufio = self.tp(rawio, buffer_size=bufsize)
+        size = sys.getsizeof(bufio) - bufsize
+        bufio.close()
+        self.assertEqual(sys.getsizeof(bufio), size)
 
 class BufferedReaderTest(unittest.TestCase, CommonBufferedTests):
     read_mode = "rb"
@@ -1012,8 +1055,8 @@
     def test_misbehaved_io(self):
         rawio = self.MisbehavedRawIO((b"abc", b"d", b"efg"))
         bufio = self.tp(rawio)
-        self.assertRaises(IOError, bufio.seek, 0)
-        self.assertRaises(IOError, bufio.tell)
+        self.assertRaises(OSError, bufio.seek, 0)
+        self.assertRaises(OSError, bufio.tell)
 
     def test_no_extraneous_read(self):
         # Issue #9550; when the raw IO object has satisfied the read request,
@@ -1064,17 +1107,18 @@
         bufio = self.tp(rawio)
         # _pyio.BufferedReader seems to implement reading different, so that
         # checking this is not so easy.
-        self.assertRaises(IOError, bufio.read, 10)
+        self.assertRaises(OSError, bufio.read, 10)
 
     def test_garbage_collection(self):
         # C BufferedReader objects are collected.
         # The Python version has __del__, so it ends into gc.garbage instead
-        rawio = self.FileIO(support.TESTFN, "w+b")
-        f = self.tp(rawio)
-        f.f = f
-        wr = weakref.ref(f)
-        del f
-        support.gc_collect()
+        with support.check_warnings(('', ResourceWarning)):
+            rawio = self.FileIO(support.TESTFN, "w+b")
+            f = self.tp(rawio)
+            f.f = f
+            wr = weakref.ref(f)
+            del f
+            support.gc_collect()
         self.assertTrue(wr() is None, wr)
 
     def test_args_error(self):
@@ -1327,9 +1371,9 @@
     def test_misbehaved_io(self):
         rawio = self.MisbehavedRawIO()
         bufio = self.tp(rawio, 5)
-        self.assertRaises(IOError, bufio.seek, 0)
-        self.assertRaises(IOError, bufio.tell)
-        self.assertRaises(IOError, bufio.write, b"abcdef")
+        self.assertRaises(OSError, bufio.seek, 0)
+        self.assertRaises(OSError, bufio.tell)
+        self.assertRaises(OSError, bufio.write, b"abcdef")
 
     def test_max_buffer_size_removal(self):
         with self.assertRaises(TypeError):
@@ -1338,11 +1382,11 @@
     def test_write_error_on_close(self):
         raw = self.MockRawIO()
         def bad_write(b):
-            raise IOError()
+            raise OSError()
         raw.write = bad_write
         b = self.tp(raw)
         b.write(b'spam')
-        self.assertRaises(IOError, b.close) # exception not swallowed
+        self.assertRaises(OSError, b.close) # exception not swallowed
         self.assertTrue(b.closed)
 
 
@@ -1373,13 +1417,14 @@
         # C BufferedWriter objects are collected, and collecting them flushes
         # all data to disk.
         # The Python version has __del__, so it ends into gc.garbage instead
-        rawio = self.FileIO(support.TESTFN, "w+b")
-        f = self.tp(rawio)
-        f.write(b"123xxx")
-        f.x = f
-        wr = weakref.ref(f)
-        del f
-        support.gc_collect()
+        with support.check_warnings(('', ResourceWarning)):
+            rawio = self.FileIO(support.TESTFN, "w+b")
+            f = self.tp(rawio)
+            f.write(b"123xxx")
+            f.x = f
+            wr = weakref.ref(f)
+            del f
+            support.gc_collect()
         self.assertTrue(wr() is None, wr)
         with self.open(support.TESTFN, "rb") as f:
             self.assertEqual(f.read(), b"123xxx")
@@ -1426,14 +1471,14 @@
             def readable(self):
                 return False
 
-        self.assertRaises(IOError, self.tp, NotReadable(), self.MockRawIO())
+        self.assertRaises(OSError, self.tp, NotReadable(), self.MockRawIO())
 
     def test_constructor_with_not_writeable(self):
         class NotWriteable(MockRawIO):
             def writable(self):
                 return False
 
-        self.assertRaises(IOError, self.tp, self.MockRawIO(), NotWriteable())
+        self.assertRaises(OSError, self.tp, self.MockRawIO(), NotWriteable())
 
     def test_read(self):
         pair = self.tp(self.BytesIO(b"abcdef"), self.MockRawIO())
@@ -1968,7 +2013,7 @@
         r = self.BytesIO()
         b = self.BufferedWriter(r)
         with self.assertRaisesRegex(LookupError, "is not a text encoding"):
-            self.TextIOWrapper(b, encoding="hex_codec")
+            self.TextIOWrapper(b, encoding="hex")
 
     def test_detach(self):
         r = self.BytesIO()
@@ -1983,6 +2028,12 @@
         self.assertEqual(r.getvalue(), b"howdy")
         self.assertRaises(ValueError, t.detach)
 
+        # Operations independent of the detached stream should still work
+        repr(t)
+        self.assertEqual(t.encoding, "ascii")
+        self.assertEqual(t.errors, "strict")
+        self.assertFalse(t.line_buffering)
+
     def test_repr(self):
         raw = self.BytesIO("hello".encode("utf-8"))
         b = self.BufferedReader(raw)
@@ -2000,6 +2051,9 @@
         self.assertEqual(repr(t),
                          "<%s.TextIOWrapper name=b'dummy' mode='r' encoding='utf-8'>" % modname)
 
+        t.buffer.detach()
+        repr(t)  # Should not raise an exception
+
     def test_line_buffering(self):
         r = self.BytesIO()
         b = self.BufferedWriter(r, 1000)
@@ -2215,7 +2269,7 @@
         if s:
             # The destructor *may* have printed an unraisable error, check it
             self.assertEqual(len(s.splitlines()), 1)
-            self.assertTrue(s.startswith("Exception IOError: "), s)
+            self.assertTrue(s.startswith("Exception OSError: "), s)
             self.assertTrue(s.endswith(" ignored"), s)
 
     # Systematic tests of the text I/O API
@@ -2287,7 +2341,7 @@
         f.seek(0)
         for line in f:
             self.assertEqual(line, "\xff\n")
-            self.assertRaises(IOError, f.tell)
+            self.assertRaises(OSError, f.tell)
         self.assertEqual(f.tell(), p2)
         f.close()
 
@@ -2391,7 +2445,7 @@
             def readable(self):
                 return False
         txt = self.TextIOWrapper(UnReadable())
-        self.assertRaises(IOError, txt.read)
+        self.assertRaises(OSError, txt.read)
 
     def test_read_one_by_one(self):
         txt = self.TextIOWrapper(self.BytesIO(b"AA\r\nBB"))
@@ -2566,11 +2620,44 @@
     def test_flush_error_on_close(self):
         txt = self.TextIOWrapper(self.BytesIO(self.testdata), encoding="ascii")
         def bad_flush():
-            raise IOError()
+            raise OSError()
         txt.flush = bad_flush
-        self.assertRaises(IOError, txt.close) # exception not swallowed
+        self.assertRaises(OSError, txt.close) # exception not swallowed
         self.assertTrue(txt.closed)
 
+    def test_close_error_on_close(self):
+        buffer = self.BytesIO(self.testdata)
+        def bad_flush():
+            raise OSError('flush')
+        def bad_close():
+            raise OSError('close')
+        buffer.close = bad_close
+        txt = self.TextIOWrapper(buffer, encoding="ascii")
+        txt.flush = bad_flush
+        with self.assertRaises(OSError) as err: # exception not swallowed
+            txt.close()
+        self.assertEqual(err.exception.args, ('close',))
+        self.assertIsInstance(err.exception.__context__, OSError)
+        self.assertEqual(err.exception.__context__.args, ('flush',))
+        self.assertFalse(txt.closed)
+
+    def test_nonnormalized_close_error_on_close(self):
+        # Issue #21677
+        buffer = self.BytesIO(self.testdata)
+        def bad_flush():
+            raise non_existing_flush
+        def bad_close():
+            raise non_existing_close
+        buffer.close = bad_close
+        txt = self.TextIOWrapper(buffer, encoding="ascii")
+        txt.flush = bad_flush
+        with self.assertRaises(NameError) as err: # exception not swallowed
+            txt.close()
+        self.assertIn('non_existing_close', str(err.exception))
+        self.assertIsInstance(err.exception.__context__, NameError)
+        self.assertIn('non_existing_flush', str(err.exception.__context__))
+        self.assertFalse(txt.closed)
+
     def test_multi_close(self):
         txt = self.TextIOWrapper(self.BytesIO(self.testdata), encoding="ascii")
         txt.close()
@@ -2610,6 +2697,38 @@
         txt.write('5')
         self.assertEqual(b''.join(raw._write_stack), b'123\n45')
 
+    def test_bufio_write_through(self):
+        # Issue #21396: write_through=True doesn't force a flush()
+        # on the underlying binary buffered object.
+        flush_called, write_called = [], []
+        class BufferedWriter(self.BufferedWriter):
+            def flush(self, *args, **kwargs):
+                flush_called.append(True)
+                return super().flush(*args, **kwargs)
+            def write(self, *args, **kwargs):
+                write_called.append(True)
+                return super().write(*args, **kwargs)
+
+        rawio = self.BytesIO()
+        data = b"a"
+        bufio = BufferedWriter(rawio, len(data)*2)
+        textio = self.TextIOWrapper(bufio, encoding='ascii',
+                                    write_through=True)
+        # write to the buffered io but don't overflow the buffer
+        text = data.decode('ascii')
+        textio.write(text)
+
+        # buffer.flush is not called with write_through=True
+        self.assertFalse(flush_called)
+        # buffer.write *is* called with write_through=True
+        self.assertTrue(write_called)
+        self.assertEqual(rawio.getvalue(), b"") # no flush
+
+        write_called = [] # reset
+        textio.write(text * 10) # total content is larger than bufio buffer
+        self.assertTrue(write_called)
+        self.assertEqual(rawio.getvalue(), data * 11) # all flushed
+
     def test_read_nonbytes(self):
         # Issue #17106
         # Crash when underlying read() returns non-bytes
@@ -2624,11 +2743,11 @@
         # Issue #17106
         # Bypass the early encoding check added in issue 20404
         def _make_illegal_wrapper():
-            quopri = codecs.lookup("quopri_codec")
+            quopri = codecs.lookup("quopri")
             quopri._is_text_encoding = True
             try:
                 t = self.TextIOWrapper(self.BytesIO(b'aaaaaa'),
-                                       newline='\n', encoding="quopri_codec")
+                                       newline='\n', encoding="quopri")
             finally:
                 quopri._is_text_encoding = False
             return t
@@ -2640,8 +2759,61 @@
         t = _make_illegal_wrapper()
         self.assertRaises(TypeError, t.read)
 
+    def _check_create_at_shutdown(self, **kwargs):
+        # Issue #20037: creating a TextIOWrapper at shutdown
+        # shouldn't crash the interpreter.
+        iomod = self.io.__name__
+        code = """if 1:
+            import codecs
+            import {iomod} as io
+
+            # Avoid looking up codecs at shutdown
+            codecs.lookup('utf-8')
+
+            class C:
+                def __init__(self):
+                    self.buf = io.BytesIO()
+                def __del__(self):
+                    io.TextIOWrapper(self.buf, **{kwargs})
+                    print("ok")
+            c = C()
+            """.format(iomod=iomod, kwargs=kwargs)
+        return assert_python_ok("-c", code)
+
+    def test_create_at_shutdown_without_encoding(self):
+        rc, out, err = self._check_create_at_shutdown()
+        if err:
+            # Can error out with a RuntimeError if the module state
+            # isn't found.
+            self.assertIn(self.shutdown_error, err.decode())
+        else:
+            self.assertEqual("ok", out.decode().strip())
+
+    def test_create_at_shutdown_with_encoding(self):
+        rc, out, err = self._check_create_at_shutdown(encoding='utf-8',
+                                                      errors='strict')
+        self.assertFalse(err)
+        self.assertEqual("ok", out.decode().strip())
+
+    def test_issue22849(self):
+        class F(object):
+            def readable(self): return True
+            def writable(self): return True
+            def seekable(self): return True
+
+        for i in range(10):
+            try:
+                self.TextIOWrapper(F(), encoding='utf-8')
+            except Exception:
+                pass
+
+        F.tell = lambda x: 0
+        t = self.TextIOWrapper(F(), encoding='utf-8')
+
 
 class CTextIOWrapperTest(TextIOWrapperTest):
+    io = io
+    shutdown_error = "RuntimeError: could not find io module state"
 
     def test_initialization(self):
         r = self.BytesIO(b"\xc3\xa9\n\n")
@@ -2652,18 +2824,22 @@
         self.assertRaises(ValueError, t.__init__, b, newline='xyzzy')
         self.assertRaises(ValueError, t.read)
 
+        t = self.TextIOWrapper.__new__(self.TextIOWrapper)
+        self.assertRaises(Exception, repr, t)
+
     def test_garbage_collection(self):
         # C TextIOWrapper objects are collected, and collecting them flushes
         # all data to disk.
         # The Python version has __del__, so it ends in gc.garbage instead.
-        rawio = io.FileIO(support.TESTFN, "wb")
-        b = self.BufferedWriter(rawio)
-        t = self.TextIOWrapper(b, encoding="ascii")
-        t.write("456def")
-        t.x = t
-        wr = weakref.ref(t)
-        del t
-        support.gc_collect()
+        with support.check_warnings(('', ResourceWarning)):
+            rawio = io.FileIO(support.TESTFN, "wb")
+            b = self.BufferedWriter(rawio)
+            t = self.TextIOWrapper(b, encoding="ascii")
+            t.write("456def")
+            t.x = t
+            wr = weakref.ref(t)
+            del t
+            support.gc_collect()
         self.assertTrue(wr() is None, wr)
         with self.open(support.TESTFN, "rb") as f:
             self.assertEqual(f.read(), b"456def")
@@ -2684,7 +2860,9 @@
 
 
 class PyTextIOWrapperTest(TextIOWrapperTest):
-    pass
+    io = pyio
+    #shutdown_error = "LookupError: unknown encoding: ascii"
+    shutdown_error = "TypeError: 'NoneType' object is not iterable"
 
 
 class IncrementalNewlineDecoderTest(unittest.TestCase):
@@ -2823,7 +3001,8 @@
         self.assertEqual(f.mode, "wb")
         f.close()
 
-        f = self.open(support.TESTFN, "U")
+        with support.check_warnings(('', DeprecationWarning)):
+            f = self.open(support.TESTFN, "U")
         self.assertEqual(f.name,            support.TESTFN)
         self.assertEqual(f.buffer.name,     support.TESTFN)
         self.assertEqual(f.buffer.raw.name, support.TESTFN)
@@ -2953,7 +3132,7 @@
             for fd in fds:
                 try:
                     os.close(fd)
-                except EnvironmentError as e:
+                except OSError as e:
                     if e.errno != errno.EBADF:
                         raise
         self.addCleanup(cleanup_fds)
@@ -3075,7 +3254,6 @@
 
 class CMiscIOTest(MiscIOTest):
     io = io
-    shutdown_error = "RuntimeError: could not find io module state"
 
     def test_readinto_buffer_overflow(self):
         # Issue #18025
@@ -3088,7 +3266,6 @@
 
 class PyMiscIOTest(MiscIOTest):
     io = pyio
-    shutdown_error = "LookupError: unknown encoding: ascii"
 
 
 @unittest.skipIf(os.name == 'nt', 'POSIX signals required for this test.')
@@ -3121,15 +3298,18 @@
         try:
             wio = self.io.open(w, **fdopen_kwargs)
             t.start()
-            signal.alarm(1)
             # Fill the pipe enough that the write will be blocking.
             # It will be interrupted by the timer armed above.  Since the
             # other thread has read one byte, the low-level write will
             # return with a successful (partial) result rather than an EINTR.
             # The buffered IO layer must check for pending signal
             # handlers, which in this case will invoke alarm_interrupt().
-            self.assertRaises(ZeroDivisionError,
-                        wio.write, item * (support.PIPE_MAX_SIZE // len(item) + 1))
+            signal.alarm(1)
+            try:
+                self.assertRaises(ZeroDivisionError,
+                            wio.write, item * (support.PIPE_MAX_SIZE // len(item) + 1))
+            finally:
+                signal.alarm(0)
             t.join()
             # We got one byte, get another one and check that it isn't a
             # repeat of the first one.
@@ -3143,7 +3323,7 @@
             # buffer, and block again.
             try:
                 wio.close()
-            except IOError as e:
+            except OSError as e:
                 if e.errno != errno.EBADF:
                     raise
 
@@ -3153,6 +3333,8 @@
     def test_interrupted_write_buffered(self):
         self.check_interrupted_write(b"xy", b"xy", mode="wb")
 
+    # Issue #22331: The test hangs on FreeBSD 7.2
+    @support.requires_freebsd_version(8)
     def test_interrupted_write_text(self):
         self.check_interrupted_write("xy", b"xy", mode="w", encoding="ascii")
 
@@ -3271,7 +3453,7 @@
             # buffer, and could block (in case of failure).
             try:
                 wio.close()
-            except IOError as e:
+            except OSError as e:
                 if e.errno != errno.EBADF:
                     raise
 
diff --git a/Lib/test/test_ioctl.py b/Lib/test/test_ioctl.py
index 531c9af..efe9f51 100644
--- a/Lib/test/test_ioctl.py
+++ b/Lib/test/test_ioctl.py
@@ -8,7 +8,7 @@
 
 try:
     tty = open("/dev/tty", "rb")
-except IOError:
+except OSError:
     raise unittest.SkipTest("Unable to open /dev/tty")
 else:
     # Skip if another process is in foreground
@@ -86,8 +86,6 @@
             os.close(mfd)
             os.close(sfd)
 
-def test_main():
-    run_unittest(IoctlTests)
 
 if __name__ == "__main__":
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_ipaddress.py b/Lib/test/test_ipaddress.py
index 5bfcf41..bfb5699 100644
--- a/Lib/test/test_ipaddress.py
+++ b/Lib/test/test_ipaddress.py
@@ -7,9 +7,11 @@
 import unittest
 import re
 import contextlib
+import functools
 import operator
 import ipaddress
 
+
 class BaseTestCase(unittest.TestCase):
     # One big change in ipaddress over the original ipaddr module is
     # error reporting that tries to assume users *don't know the rules*
@@ -52,17 +54,18 @@
     def assertAddressError(self, details, *args):
         """Ensure a clean AddressValueError"""
         return self.assertCleanError(ipaddress.AddressValueError,
-                                       details, *args)
+                                     details, *args)
 
     def assertNetmaskError(self, details, *args):
         """Ensure a clean NetmaskValueError"""
         return self.assertCleanError(ipaddress.NetmaskValueError,
-                                details, *args)
+                                     details, *args)
 
     def assertInstancesEqual(self, lhs, rhs):
         """Check constructor arguments produce equivalent instances"""
         self.assertEqual(self.factory(lhs), self.factory(rhs))
 
+
 class CommonTestMixin:
 
     def test_empty_address(self):
@@ -115,6 +118,7 @@
         assertBadLength(3)
         assertBadLength(5)
 
+
 class CommonTestMixin_v6(CommonTestMixin):
 
     def test_leading_zeros(self):
@@ -195,7 +199,7 @@
     def test_empty_octet(self):
         def assertBadOctet(addr):
             with self.assertAddressError("Empty octet not permitted in %r",
-                                          addr):
+                                         addr):
                 ipaddress.IPv4Address(addr)
 
         assertBadOctet("42..42.42")
@@ -443,6 +447,7 @@
 class InterfaceTestCase_v4(BaseTestCase, NetmaskTestMixin_v4):
     factory = ipaddress.IPv4Interface
 
+
 class NetworkTestCase_v4(BaseTestCase, NetmaskTestMixin_v4):
     factory = ipaddress.IPv4Network
 
@@ -496,9 +501,11 @@
         assertBadNetmask("::1", "pudding")
         assertBadNetmask("::", "::")
 
+
 class InterfaceTestCase_v6(BaseTestCase, NetmaskTestMixin_v6):
     factory = ipaddress.IPv6Interface
 
+
 class NetworkTestCase_v6(BaseTestCase, NetmaskTestMixin_v6):
     factory = ipaddress.IPv6Network
 
@@ -522,6 +529,20 @@
         self.assertFactoryError(ipaddress.ip_network, "network")
 
 
+@functools.total_ordering
+class LargestObject:
+    def __eq__(self, other):
+        return isinstance(other, LargestObject)
+    def __lt__(self, other):
+        return False
+
+@functools.total_ordering
+class SmallestObject:
+    def __eq__(self, other):
+        return isinstance(other, SmallestObject)
+    def __gt__(self, other):
+        return False
+
 class ComparisonTests(unittest.TestCase):
 
     v4addr = ipaddress.IPv4Address(1)
@@ -575,6 +596,28 @@
                 self.assertRaises(TypeError, lambda: lhs <= rhs)
                 self.assertRaises(TypeError, lambda: lhs >= rhs)
 
+    def test_foreign_type_ordering(self):
+        other = object()
+        smallest = SmallestObject()
+        largest = LargestObject()
+        for obj in self.objects:
+            with self.assertRaises(TypeError):
+                obj < other
+            with self.assertRaises(TypeError):
+                obj > other
+            with self.assertRaises(TypeError):
+                obj <= other
+            with self.assertRaises(TypeError):
+                obj >= other
+            self.assertTrue(obj < largest)
+            self.assertFalse(obj > largest)
+            self.assertTrue(obj <= largest)
+            self.assertFalse(obj >= largest)
+            self.assertFalse(obj < smallest)
+            self.assertTrue(obj > smallest)
+            self.assertFalse(obj <= smallest)
+            self.assertTrue(obj >= smallest)
+
     def test_mixed_type_key(self):
         # with get_mixed_type_key, you can sort addresses and network.
         v4_ordered = [self.v4addr, self.v4net, self.v4intf]
@@ -595,7 +638,7 @@
         v4addr = ipaddress.ip_address('1.1.1.1')
         v4net = ipaddress.ip_network('1.1.1.1')
         v6addr = ipaddress.ip_address('::1')
-        v6net = ipaddress.ip_address('::1')
+        v6net = ipaddress.ip_network('::1')
 
         self.assertRaises(TypeError, v4addr.__lt__, v6addr)
         self.assertRaises(TypeError, v4addr.__gt__, v6addr)
@@ -608,7 +651,6 @@
         self.assertRaises(TypeError, v6net.__gt__, v4net)
 
 
-
 class IpaddrUnitTest(unittest.TestCase):
 
     def setUp(self):
@@ -1243,10 +1285,10 @@
         unsorted = [ip4, ip1, ip3, ip2]
         unsorted.sort()
         self.assertEqual(sorted, unsorted)
-        self.assertRaises(TypeError, ip1.__lt__,
-                          ipaddress.ip_address('10.10.10.0'))
-        self.assertRaises(TypeError, ip2.__lt__,
-                          ipaddress.ip_address('10.10.10.0'))
+        self.assertIs(ip1.__lt__(ipaddress.ip_address('10.10.10.0')),
+                      NotImplemented)
+        self.assertIs(ip2.__lt__(ipaddress.ip_address('10.10.10.0')),
+                      NotImplemented)
 
         # <=, >=
         self.assertTrue(ipaddress.ip_network('1.1.1.1') <=
@@ -1358,6 +1400,14 @@
         self.assertEqual(True, ipaddress.ip_network(
                 '127.42.0.0/16').is_loopback)
         self.assertEqual(False, ipaddress.ip_network('128.0.0.0').is_loopback)
+        self.assertEqual(False,
+                         ipaddress.ip_network('100.64.0.0/10').is_private)
+        self.assertEqual(False, ipaddress.ip_network('100.64.0.0/10').is_global)
+
+        self.assertEqual(True,
+                         ipaddress.ip_network('192.0.2.128/25').is_private)
+        self.assertEqual(True,
+                         ipaddress.ip_network('192.0.3.0/24').is_global)
 
         # test addresses
         self.assertEqual(True, ipaddress.ip_address('0.0.0.0').is_unspecified)
@@ -1423,6 +1473,10 @@
         self.assertEqual(False, ipaddress.ip_network('::1').is_unspecified)
         self.assertEqual(False, ipaddress.ip_network('::/127').is_unspecified)
 
+        self.assertEqual(True,
+                         ipaddress.ip_network('2001::1/128').is_private)
+        self.assertEqual(True,
+                         ipaddress.ip_network('200::1/128').is_global)
         # test addresses
         self.assertEqual(True, ipaddress.ip_address('ffff::').is_multicast)
         self.assertEqual(True, ipaddress.ip_address(2**128 - 1).is_multicast)
diff --git a/Lib/test/test_iter.py b/Lib/test/test_iter.py
index 43f8e15..e06f239 100644
--- a/Lib/test/test_iter.py
+++ b/Lib/test/test_iter.py
@@ -76,22 +76,23 @@
 
     # Helper to check picklability
     def check_pickle(self, itorg, seq):
-        d = pickle.dumps(itorg)
-        it = pickle.loads(d)
-        # Cannot assert type equality because dict iterators unpickle as list
-        # iterators.
-        # self.assertEqual(type(itorg), type(it))
-        self.assertTrue(isinstance(it, collections.abc.Iterator))
-        self.assertEqual(list(it), seq)
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            d = pickle.dumps(itorg, proto)
+            it = pickle.loads(d)
+            # Cannot assert type equality because dict iterators unpickle as list
+            # iterators.
+            # self.assertEqual(type(itorg), type(it))
+            self.assertTrue(isinstance(it, collections.abc.Iterator))
+            self.assertEqual(list(it), seq)
 
-        it = pickle.loads(d)
-        try:
-            next(it)
-        except StopIteration:
-            return
-        d = pickle.dumps(it)
-        it = pickle.loads(d)
-        self.assertEqual(list(it), seq[1:])
+            it = pickle.loads(d)
+            try:
+                next(it)
+            except StopIteration:
+                continue
+            d = pickle.dumps(it, proto)
+            it = pickle.loads(d)
+            self.assertEqual(list(it), seq[1:])
 
     # Test basic use of iter() function
     def test_iter_basic(self):
diff --git a/Lib/test/test_iterlen.py b/Lib/test/test_iterlen.py
index 9101f6c..152f5fc 100644
--- a/Lib/test/test_iterlen.py
+++ b/Lib/test/test_iterlen.py
@@ -45,31 +45,21 @@
 from test import support
 from itertools import repeat
 from collections import deque
-from builtins import len as _len
+from operator import length_hint
 
 n = 10
 
-def len(obj):
-    try:
-        return _len(obj)
-    except TypeError:
-        try:
-            # note: this is an internal undocumented API,
-            # don't rely on it in your own programs
-            return obj.__length_hint__()
-        except AttributeError:
-            raise TypeError
 
 class TestInvariantWithoutMutations:
 
     def test_invariant(self):
         it = self.it
         for i in reversed(range(1, n+1)):
-            self.assertEqual(len(it), i)
+            self.assertEqual(length_hint(it), i)
             next(it)
-        self.assertEqual(len(it), 0)
+        self.assertEqual(length_hint(it), 0)
         self.assertRaises(StopIteration, next, it)
-        self.assertEqual(len(it), 0)
+        self.assertEqual(length_hint(it), 0)
 
 class TestTemporarilyImmutable(TestInvariantWithoutMutations):
 
@@ -78,12 +68,12 @@
         # length immutability  during iteration
 
         it = self.it
-        self.assertEqual(len(it), n)
+        self.assertEqual(length_hint(it), n)
         next(it)
-        self.assertEqual(len(it), n-1)
+        self.assertEqual(length_hint(it), n-1)
         self.mutate()
         self.assertRaises(RuntimeError, next, it)
-        self.assertEqual(len(it), 0)
+        self.assertEqual(length_hint(it), 0)
 
 ## ------- Concrete Type Tests -------
 
@@ -92,10 +82,6 @@
     def setUp(self):
         self.it = repeat(None, n)
 
-    def test_no_len_for_infinite_repeat(self):
-        # The repeat() object can also be infinite
-        self.assertRaises(TypeError, len, repeat(None))
-
 class TestXrange(TestInvariantWithoutMutations, unittest.TestCase):
 
     def setUp(self):
@@ -167,14 +153,15 @@
         it = iter(d)
         next(it)
         next(it)
-        self.assertEqual(len(it), n-2)
+        self.assertEqual(length_hint(it), n - 2)
         d.append(n)
-        self.assertEqual(len(it), n-1)  # grow with append
+        self.assertEqual(length_hint(it), n - 1)  # grow with append
         d[1:] = []
-        self.assertEqual(len(it), 0)
+        self.assertEqual(length_hint(it), 0)
         self.assertEqual(list(it), [])
         d.extend(range(20))
-        self.assertEqual(len(it), 0)
+        self.assertEqual(length_hint(it), 0)
+
 
 class TestListReversed(TestInvariantWithoutMutations, unittest.TestCase):
 
@@ -186,32 +173,41 @@
         it = reversed(d)
         next(it)
         next(it)
-        self.assertEqual(len(it), n-2)
+        self.assertEqual(length_hint(it), n - 2)
         d.append(n)
-        self.assertEqual(len(it), n-2)  # ignore append
+        self.assertEqual(length_hint(it), n - 2)  # ignore append
         d[1:] = []
-        self.assertEqual(len(it), 0)
+        self.assertEqual(length_hint(it), 0)
         self.assertEqual(list(it), [])  # confirm invariant
         d.extend(range(20))
-        self.assertEqual(len(it), 0)
+        self.assertEqual(length_hint(it), 0)
 
 ## -- Check to make sure exceptions are not suppressed by __length_hint__()
 
 
 class BadLen(object):
-    def __iter__(self): return iter(range(10))
+    def __iter__(self):
+        return iter(range(10))
+
     def __len__(self):
         raise RuntimeError('hello')
 
+
 class BadLengthHint(object):
-    def __iter__(self): return iter(range(10))
+    def __iter__(self):
+        return iter(range(10))
+
     def __length_hint__(self):
         raise RuntimeError('hello')
 
+
 class NoneLengthHint(object):
-    def __iter__(self): return iter(range(10))
+    def __iter__(self):
+        return iter(range(10))
+
     def __length_hint__(self):
-        return None
+        return NotImplemented
+
 
 class TestLengthHintExceptions(unittest.TestCase):
 
diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py
index bb3b61f..244598b 100644
--- a/Lib/test/test_itertools.py
+++ b/Lib/test/test_itertools.py
@@ -1,7 +1,7 @@
 import unittest
 from test import support
 from itertools import *
-from weakref import proxy
+import weakref
 from decimal import Decimal
 from fractions import Fraction
 import sys
@@ -10,6 +10,8 @@
 import copy
 import pickle
 from functools import reduce
+import sys
+import struct
 maxsize = support.MAX_Py_ssize_t
 minsize = -maxsize-1
 
@@ -72,9 +74,12 @@
 def underten(x):
     return x<10
 
+picklecopiers = [lambda s, proto=proto: pickle.loads(pickle.dumps(s, proto))
+                 for proto in range(pickle.HIGHEST_PROTOCOL + 1)]
+
 class TestBasicOps(unittest.TestCase):
 
-    def pickletest(self, it, stop=4, take=1, compare=None):
+    def pickletest(self, protocol, it, stop=4, take=1, compare=None):
         """Test that an iterator is the same after pickling, also when part-consumed"""
         def expand(it, i=0):
             # Recursively expand iterables, within sensible bounds
@@ -89,7 +94,7 @@
             return [expand(e, i+1) for e in l]
 
         # Test the initial copy against the original
-        dump = pickle.dumps(it)
+        dump = pickle.dumps(it, protocol)
         i2 = pickle.loads(dump)
         self.assertEqual(type(it), type(i2))
         a, b = expand(it), expand(i2)
@@ -107,7 +112,7 @@
                 took += 1
         except StopIteration:
             pass #in case there is less data than 'take'
-        dump = pickle.dumps(i3)
+        dump = pickle.dumps(i3, protocol)
         i4 = pickle.loads(dump)
         a, b = expand(i3), expand(i4)
         self.assertEqual(a, b)
@@ -141,7 +146,8 @@
                          [2, 16, 144, 720, 5040, 0, 0, 0, 0, 0])
         with self.assertRaises(TypeError):
             list(accumulate(s, chr))                                # unary-operation
-        self.pickletest(accumulate(range(10)))                      # test pickling
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            self.pickletest(proto, accumulate(range(10)))           # test pickling
 
     def test_chain(self):
 
@@ -166,9 +172,7 @@
         self.assertRaises(TypeError, list, chain.from_iterable([2, 3]))
 
     def test_chain_reducible(self):
-        operators = [copy.deepcopy,
-                     lambda s: pickle.loads(pickle.dumps(s))]
-        for oper in operators:
+        for oper in [copy.deepcopy] + picklecopiers:
             it = chain('abc', 'def')
             self.assertEqual(list(oper(it)), list('abcdef'))
             self.assertEqual(next(it), 'a')
@@ -177,7 +181,8 @@
             self.assertEqual(list(oper(chain(''))), [])
             self.assertEqual(take(4, oper(chain('abc', 'def'))), list('abcd'))
             self.assertRaises(TypeError, list, oper(chain(2, 3)))
-        self.pickletest(chain('abc', 'def'), compare=list('abcdef'))
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            self.pickletest(proto, chain('abc', 'def'), compare=list('abcdef'))
 
     def test_combinations(self):
         self.assertRaises(TypeError, combinations, 'abc')       # missing r argument
@@ -185,7 +190,7 @@
         self.assertRaises(TypeError, combinations, None)        # pool is not iterable
         self.assertRaises(ValueError, combinations, 'abc', -2)  # r is negative
 
-        for op in (lambda a:a, lambda a:pickle.loads(pickle.dumps(a))):
+        for op in [lambda a:a] + picklecopiers:
             self.assertEqual(list(op(combinations('abc', 32))), [])     # r > n
 
             self.assertEqual(list(op(combinations('ABCD', 2))),
@@ -256,7 +261,8 @@
                 self.assertEqual(result, list(combinations2(values, r))) # matches second pure python version
                 self.assertEqual(result, list(combinations3(values, r))) # matches second pure python version
 
-                self.pickletest(combinations(values, r))                 # test pickling
+                for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+                    self.pickletest(proto, combinations(values, r))      # test pickling
 
     @support.bigaddrspacetest
     def test_combinations_overflow(self):
@@ -276,7 +282,7 @@
         self.assertRaises(TypeError, cwr, None)        # pool is not iterable
         self.assertRaises(ValueError, cwr, 'abc', -2)  # r is negative
 
-        for op in (lambda a:a, lambda a:pickle.loads(pickle.dumps(a))):
+        for op in [lambda a:a] + picklecopiers:
             self.assertEqual(list(op(cwr('ABC', 2))),
                              [('A','A'), ('A','B'), ('A','C'), ('B','B'), ('B','C'), ('C','C')])
             testIntermediate = cwr('ABC', 2)
@@ -342,7 +348,8 @@
                 self.assertEqual(result, list(cwr1(values, r)))         # matches first pure python version
                 self.assertEqual(result, list(cwr2(values, r)))         # matches second pure python version
 
-                self.pickletest(cwr(values,r))                          # test pickling
+                for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+                    self.pickletest(proto, cwr(values,r))               # test pickling
 
     @support.bigaddrspacetest
     def test_combinations_with_replacement_overflow(self):
@@ -416,14 +423,15 @@
                     self.assertEqual(result, list(permutations(values, None))) # test r as None
                     self.assertEqual(result, list(permutations(values)))       # test default r
 
-                self.pickletest(permutations(values, r))                # test pickling
+                for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+                    self.pickletest(proto, permutations(values, r))     # test pickling
 
     @support.bigaddrspacetest
     def test_permutations_overflow(self):
         with self.assertRaises((OverflowError, MemoryError)):
             permutations("A", 2**30)
 
-    @support.impl_detail("tuple resuse is CPython specific")
+    @support.impl_detail("tuple reuse is specific to CPython")
     def test_permutations_tuple_reuse(self):
         self.assertEqual(len(set(map(id, permutations('abcde', 3)))), 1)
         self.assertNotEqual(len(set(map(id, list(permutations('abcde', 3))))), 1)
@@ -478,7 +486,7 @@
         self.assertRaises(TypeError, compress, range(6), None)      # too many args
 
         # check copy, deepcopy, pickle
-        for op in (lambda a:copy.copy(a), lambda a:copy.deepcopy(a), lambda a:pickle.loads(pickle.dumps(a))):
+        for op in [lambda a:copy.copy(a), lambda a:copy.deepcopy(a)] + picklecopiers:
             for data, selectors, result1, result2 in [
                 ('ABCDEF', [1,0,1,0,1,1], 'ACEF', 'CEF'),
                 ('ABCDEF', [0,0,0,0,0,0], '', ''),
@@ -529,7 +537,8 @@
             c = count(value)
             self.assertEqual(next(copy.copy(c)), value)
             self.assertEqual(next(copy.deepcopy(c)), value)
-            self.pickletest(count(value))
+            for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+                self.pickletest(proto, count(value))
 
         #check proper internal error handling for large "step' sizes
         count(1, maxsize+5); sys.exc_info()
@@ -576,7 +585,8 @@
                 else:
                     r2 = ('count(%r, %r)' % (i, j))
                 self.assertEqual(r1, r2)
-                self.pickletest(count(i, j))
+                for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+                    self.pickletest(proto, count(i, j))
 
     def test_cycle(self):
         self.assertEqual(take(10, cycle('abc')), list('abcabcabca'))
@@ -592,10 +602,16 @@
         #an internal iterator
         #self.assertEqual(take(10, copy.copy(c)), list('bcabcabcab'))
         self.assertEqual(take(10, copy.deepcopy(c)), list('bcabcabcab'))
-        self.assertEqual(take(10, pickle.loads(pickle.dumps(c))), list('bcabcabcab'))
-        next(c)
-        self.assertEqual(take(10, pickle.loads(pickle.dumps(c))), list('cabcabcabc'))
-        self.pickletest(cycle('abc'))
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            self.assertEqual(take(10, pickle.loads(pickle.dumps(c, proto))),
+                             list('bcabcabcab'))
+            next(c)
+            self.assertEqual(take(10, pickle.loads(pickle.dumps(c, proto))),
+                             list('cabcabcabc'))
+            next(c)
+            next(c)
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            self.pickletest(proto, cycle('abc'))
 
     def test_groupby(self):
         # Check whether it accepts arguments correctly
@@ -616,12 +632,13 @@
         self.assertEqual(s, dup)
 
         # Check normal pickled
-        dup = []
-        for k, g in pickle.loads(pickle.dumps(groupby(s, testR))):
-            for elem in g:
-                self.assertEqual(k, elem[0])
-                dup.append(elem)
-        self.assertEqual(s, dup)
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            dup = []
+            for k, g in pickle.loads(pickle.dumps(groupby(s, testR), proto)):
+                for elem in g:
+                    self.assertEqual(k, elem[0])
+                    dup.append(elem)
+            self.assertEqual(s, dup)
 
         # Check nested case
         dup = []
@@ -634,14 +651,15 @@
         self.assertEqual(s, dup)
 
         # Check nested and pickled
-        dup = []
-        for k, g in pickle.loads(pickle.dumps(groupby(s, testR))):
-            for ik, ig in pickle.loads(pickle.dumps(groupby(g, testR2))):
-                for elem in ig:
-                    self.assertEqual(k, elem[0])
-                    self.assertEqual(ik, elem[2])
-                    dup.append(elem)
-        self.assertEqual(s, dup)
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            dup = []
+            for k, g in pickle.loads(pickle.dumps(groupby(s, testR), proto)):
+                for ik, ig in pickle.loads(pickle.dumps(groupby(g, testR2), proto)):
+                    for elem in ig:
+                        self.assertEqual(k, elem[0])
+                        self.assertEqual(ik, elem[2])
+                        dup.append(elem)
+            self.assertEqual(s, dup)
 
 
         # Check case where inner iterator is not used
@@ -723,12 +741,14 @@
         self.assertEqual(list(copy.copy(c)), ans)
         c = filter(isEven, range(6))
         self.assertEqual(list(copy.deepcopy(c)), ans)
-        c = filter(isEven, range(6))
-        self.assertEqual(list(pickle.loads(pickle.dumps(c))), ans)
-        next(c)
-        self.assertEqual(list(pickle.loads(pickle.dumps(c))), ans[1:])
-        c = filter(isEven, range(6))
-        self.pickletest(c)
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            c = filter(isEven, range(6))
+            self.assertEqual(list(pickle.loads(pickle.dumps(c, proto))), ans)
+            next(c)
+            self.assertEqual(list(pickle.loads(pickle.dumps(c, proto))), ans[1:])
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            c = filter(isEven, range(6))
+            self.pickletest(proto, c)
 
     def test_filterfalse(self):
         self.assertEqual(list(filterfalse(isEven, range(6))), [1,3,5])
@@ -740,7 +760,8 @@
         self.assertRaises(TypeError, filterfalse, lambda x:x, range(6), 7)
         self.assertRaises(TypeError, filterfalse, isEven, 3)
         self.assertRaises(TypeError, next, filterfalse(range(6), range(6)))
-        self.pickletest(filterfalse(isEven, range(6)))
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            self.pickletest(proto, filterfalse(isEven, range(6)))
 
     def test_zip(self):
         # XXX This is rather silly now that builtin zip() calls zip()...
@@ -772,15 +793,18 @@
         ans = [(x,y) for x, y in copy.deepcopy(zip('abc',count()))]
         self.assertEqual(ans, [('a', 0), ('b', 1), ('c', 2)])
 
-        ans = [(x,y) for x, y in pickle.loads(pickle.dumps(zip('abc',count())))]
-        self.assertEqual(ans, [('a', 0), ('b', 1), ('c', 2)])
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            ans = [(x,y) for x, y in pickle.loads(pickle.dumps(zip('abc',count()), proto))]
+            self.assertEqual(ans, [('a', 0), ('b', 1), ('c', 2)])
 
-        testIntermediate = zip('abc',count())
-        next(testIntermediate)
-        ans = [(x,y) for x, y in pickle.loads(pickle.dumps(testIntermediate))]
-        self.assertEqual(ans, [('b', 1), ('c', 2)])
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            testIntermediate = zip('abc',count())
+            next(testIntermediate)
+            ans = [(x,y) for x, y in pickle.loads(pickle.dumps(testIntermediate, proto))]
+            self.assertEqual(ans, [('b', 1), ('c', 2)])
 
-        self.pickletest(zip('abc', count()))
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            self.pickletest(proto, zip('abc', count()))
 
     def test_ziplongest(self):
         for args in [
@@ -832,10 +856,11 @@
         self.assertEqual(len(dict.fromkeys(ids)), len(ids))
 
     def test_zip_longest_pickling(self):
-        self.pickletest(zip_longest("abc", "def"))
-        self.pickletest(zip_longest("abc", "defgh"))
-        self.pickletest(zip_longest("abc", "defgh", fillvalue=1))
-        self.pickletest(zip_longest("", "defgh"))
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            self.pickletest(proto, zip_longest("abc", "def"))
+            self.pickletest(proto, zip_longest("abc", "defgh"))
+            self.pickletest(proto, zip_longest("abc", "defgh", fillvalue=1))
+            self.pickletest(proto, zip_longest("", "defgh"))
 
     def test_bug_7244(self):
 
@@ -957,7 +982,8 @@
             ]:
             self.assertEqual(list(copy.copy(product(*args))), result)
             self.assertEqual(list(copy.deepcopy(product(*args))), result)
-            self.pickletest(product(*args))
+            for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+                self.pickletest(proto, product(*args))
 
     def test_repeat(self):
         self.assertEqual(list(repeat(object='a', times=3)), ['a', 'a', 'a'])
@@ -982,7 +1008,14 @@
         self.assertEqual(next(c), 'a')
         self.assertEqual(take(2, copy.copy(c)), list('a' * 2))
         self.assertEqual(take(2, copy.deepcopy(c)), list('a' * 2))
-        self.pickletest(repeat(object='a', times=10))
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            self.pickletest(proto, repeat(object='a', times=10))
+
+    def test_repeat_with_negative_times(self):
+        self.assertEqual(repr(repeat('a', -1)), "repeat('a', 0)")
+        self.assertEqual(repr(repeat('a', -2)), "repeat('a', 0)")
+        self.assertEqual(repr(repeat('a', times=-1)), "repeat('a', 0)")
+        self.assertEqual(repr(repeat('a', times=-2)), "repeat('a', 0)")
 
     def test_map(self):
         self.assertEqual(list(map(operator.pow, range(3), range(1,7))),
@@ -1010,8 +1043,9 @@
         c = map(tupleize, 'abc', count())
         self.assertEqual(list(copy.deepcopy(c)), ans)
 
-        c = map(tupleize, 'abc', count())
-        self.pickletest(c)
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            c = map(tupleize, 'abc', count())
+            self.pickletest(proto, c)
 
     def test_starmap(self):
         self.assertEqual(list(starmap(operator.pow, zip(range(3), range(1,7)))),
@@ -1036,8 +1070,9 @@
         c = starmap(operator.pow, zip(range(3), range(1,7)))
         self.assertEqual(list(copy.deepcopy(c)), ans)
 
-        c = starmap(operator.pow, zip(range(3), range(1,7)))
-        self.pickletest(c)
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            c = starmap(operator.pow, zip(range(3), range(1,7)))
+            self.pickletest(proto, c)
 
     def test_islice(self):
         for args in [          # islice(args) should agree with range(args)
@@ -1102,7 +1137,18 @@
                              list(range(*args)))
             self.assertEqual(list(copy.deepcopy(islice(range(100), *args))),
                              list(range(*args)))
-            self.pickletest(islice(range(100), *args))
+            for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+                self.pickletest(proto, islice(range(100), *args))
+
+        # Issue #21321: check source iterator is not referenced
+        # from islice() after the latter has been exhausted
+        it = (x for x in (1, 2))
+        wr = weakref.ref(it)
+        it = islice(it, 1)
+        self.assertIsNotNone(wr())
+        list(it) # exhaust the iterator
+        support.gc_collect()
+        self.assertIsNone(wr())
 
     def test_takewhile(self):
         data = [1, 3, 5, 20, 2, 4, 6, 8]
@@ -1121,7 +1167,8 @@
         self.assertEqual(list(copy.copy(takewhile(underten, data))), [1, 3, 5])
         self.assertEqual(list(copy.deepcopy(takewhile(underten, data))),
                         [1, 3, 5])
-        self.pickletest(takewhile(underten, data))
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            self.pickletest(proto, takewhile(underten, data))
 
     def test_dropwhile(self):
         data = [1, 3, 5, 20, 2, 4, 6, 8]
@@ -1137,7 +1184,8 @@
         self.assertEqual(list(copy.copy(dropwhile(underten, data))), [20, 2, 4, 6, 8])
         self.assertEqual(list(copy.deepcopy(dropwhile(underten, data))),
                         [20, 2, 4, 6, 8])
-        self.pickletest(dropwhile(underten, data))
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            self.pickletest(proto, dropwhile(underten, data))
 
     def test_tee(self):
         n = 200
@@ -1220,7 +1268,7 @@
 
         # test that tee objects are weak referencable
         a, b = tee(range(10))
-        p = proxy(a)
+        p = weakref.proxy(a)
         self.assertEqual(getattr(p, '__class__'), type(b))
         del a
         self.assertRaises(ReferenceError, getattr, p, '__class__')
@@ -1281,10 +1329,11 @@
         self.assertEqual(list(b), long_ans[60:])
 
         # check pickle
-        self.pickletest(iter(tee('abc')))
-        a, b = tee('abc')
-        self.pickletest(a, compare=ans)
-        self.pickletest(b, compare=ans)
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            self.pickletest(proto, iter(tee('abc')))
+            a, b = tee('abc')
+            self.pickletest(proto, a, compare=ans)
+            self.pickletest(proto, b, compare=ans)
 
     # Issue 13454: Crash when deleting backward iterator from tee()
     def test_tee_del_backward(self):
@@ -1324,11 +1373,14 @@
         # check copy, deepcopy, pickle
         data = [1, 2, 3, 4, 5]
         accumulated = [1, 3, 6, 10, 15]
-        it = accumulate(data)
 
-        self.assertEqual(list(pickle.loads(pickle.dumps(it))), accumulated[:])
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            it = accumulate(data)
+            self.assertEqual(list(pickle.loads(pickle.dumps(it, proto))), accumulated[:])
+            self.assertEqual(next(it), 1)
+            self.assertEqual(list(pickle.loads(pickle.dumps(it, proto))), accumulated[1:])
+        it = accumulate(data)
         self.assertEqual(next(it), 1)
-        self.assertEqual(list(pickle.loads(pickle.dumps(it))), accumulated[1:])
         self.assertEqual(list(copy.deepcopy(it)), accumulated[1:])
         self.assertEqual(list(copy.copy(it)), accumulated[1:])
 
@@ -1748,9 +1800,15 @@
 class LengthTransparency(unittest.TestCase):
 
     def test_repeat(self):
-        from test.test_iterlen import len
-        self.assertEqual(len(repeat(None, 50)), 50)
-        self.assertRaises(TypeError, len, repeat(None))
+        self.assertEqual(operator.length_hint(repeat(None, 50)), 50)
+        self.assertEqual(operator.length_hint(repeat(None, 0)), 0)
+        self.assertEqual(operator.length_hint(repeat(None), 12), 12)
+
+    def test_repeat_with_negative_times(self):
+        self.assertEqual(operator.length_hint(repeat(None, -1)), 0)
+        self.assertEqual(operator.length_hint(repeat(None, -2)), 0)
+        self.assertEqual(operator.length_hint(repeat(None, times=-1)), 0)
+        self.assertEqual(operator.length_hint(repeat(None, times=-2)), 0)
 
 class RegressionTests(unittest.TestCase):
 
@@ -1827,6 +1885,44 @@
                 # we expect type errors because of wrong argument count
                 self.assertNotIn("does not take keyword arguments", err.args[0])
 
+@support.cpython_only
+class SizeofTest(unittest.TestCase):
+    def setUp(self):
+        self.ssize_t = struct.calcsize('n')
+
+    check_sizeof = support.check_sizeof
+
+    def test_product_sizeof(self):
+        basesize = support.calcobjsize('3Pi')
+        check = self.check_sizeof
+        check(product('ab', '12'), basesize + 2 * self.ssize_t)
+        check(product(*(('abc',) * 10)), basesize + 10 * self.ssize_t)
+
+    def test_combinations_sizeof(self):
+        basesize = support.calcobjsize('3Pni')
+        check = self.check_sizeof
+        check(combinations('abcd', 3), basesize + 3 * self.ssize_t)
+        check(combinations(range(10), 4), basesize + 4 * self.ssize_t)
+
+    def test_combinations_with_replacement_sizeof(self):
+        cwr = combinations_with_replacement
+        basesize = support.calcobjsize('3Pni')
+        check = self.check_sizeof
+        check(cwr('abcd', 3), basesize + 3 * self.ssize_t)
+        check(cwr(range(10), 4), basesize + 4 * self.ssize_t)
+
+    def test_permutations_sizeof(self):
+        basesize = support.calcobjsize('4Pni')
+        check = self.check_sizeof
+        check(permutations('abcd'),
+              basesize + 4 * self.ssize_t + 4 * self.ssize_t)
+        check(permutations('abcd', 3),
+              basesize + 4 * self.ssize_t + 3 * self.ssize_t)
+        check(permutations('abcde', 3),
+              basesize + 5 * self.ssize_t + 3 * self.ssize_t)
+        check(permutations(range(10), 4),
+              basesize + 10 * self.ssize_t + 4 * self.ssize_t)
+
 
 libreftest = """ Doctest for examples in the library reference: libitertools.tex
 
@@ -1978,6 +2074,19 @@
 ...     # unique_justseen('ABBCcAD', str.lower) --> A B C A D
 ...     return map(next, map(itemgetter(1), groupby(iterable, key)))
 
+>>> def first_true(iterable, default=False, pred=None):
+...     '''Returns the first true value in the iterable.
+...
+...     If no true value is found, returns *default*
+...
+...     If *pred* is not None, returns the first item
+...     for which pred(item) is true.
+...
+...     '''
+...     # first_true([a,b,c], x) --> a or b or c or x
+...     # first_true([a,b], x, f) --> a if f(a) else b if f(b) else x
+...     return next(filter(pred, iterable), default)
+
 This is not part of the examples but it tests to make sure the definitions
 perform as purported.
 
@@ -2055,6 +2164,9 @@
 >>> list(unique_justseen('ABBCcAD', str.lower))
 ['A', 'B', 'C', 'A', 'D']
 
+>>> first_true('ABC0DEF1', '9', str.isdigit)
+'0'
+
 """
 
 __test__ = {'libreftest' : libreftest}
@@ -2062,7 +2174,8 @@
 def test_main(verbose=None):
     test_classes = (TestBasicOps, TestVariousIteratorArgs, TestGC,
                     RegressionTests, LengthTransparency,
-                    SubclassWithKwargsTest, TestExamples)
+                    SubclassWithKwargsTest, TestExamples,
+                    SizeofTest)
     support.run_unittest(*test_classes)
 
     # verify reference counting
diff --git a/Lib/test/test_json/__init__.py b/Lib/test/test_json/__init__.py
index f994f9b..2cf1032 100644
--- a/Lib/test/test_json/__init__.py
+++ b/Lib/test/test_json/__init__.py
@@ -42,23 +42,12 @@
                          '_json')
 
 
-here = os.path.dirname(__file__)
-
-def load_tests(*args):
-    suite = additional_tests()
-    loader = unittest.TestLoader()
-    for fn in os.listdir(here):
-        if fn.startswith("test") and fn.endswith(".py"):
-            modname = "test.test_json." + fn[:-3]
-            __import__(modname)
-            module = sys.modules[modname]
-            suite.addTests(loader.loadTestsFromModule(module))
-    return suite
-
-def additional_tests():
+def load_tests(loader, _, pattern):
     suite = unittest.TestSuite()
     for mod in (json, json.encoder, json.decoder):
         suite.addTest(doctest.DocTestSuite(mod))
     suite.addTest(TestPyTest('test_pyjson'))
     suite.addTest(TestCTest('test_cjson'))
-    return suite
+
+    pkg_dir = os.path.dirname(__file__)
+    return support.load_package_tests(pkg_dir, loader, suite, pattern)
diff --git a/Lib/test/test_json/test_decode.py b/Lib/test/test_json/test_decode.py
index 17245eb..591b2e2 100644
--- a/Lib/test/test_json/test_decode.py
+++ b/Lib/test/test_json/test_decode.py
@@ -1,5 +1,5 @@
 import decimal
-from io import StringIO
+from io import StringIO, BytesIO
 from collections import OrderedDict
 from test.test_json import PyTest, CTest
 
@@ -70,6 +70,27 @@
         msg = 'escape'
         self.assertRaisesRegex(ValueError, msg, self.loads, s)
 
+    def test_invalid_input_type(self):
+        msg = 'the JSON object must be str'
+        for value in [1, 3.14, b'bytes', b'\xff\x00', [], {}, None]:
+            self.assertRaisesRegex(TypeError, msg, self.loads, value)
+        with self.assertRaisesRegex(TypeError, msg):
+            self.json.load(BytesIO(b'[1,2,3]'))
+
+    def test_string_with_utf8_bom(self):
+        # see #18958
+        bom_json = "[1,2,3]".encode('utf-8-sig').decode('utf-8')
+        with self.assertRaises(ValueError) as cm:
+            self.loads(bom_json)
+        self.assertIn('BOM', str(cm.exception))
+        with self.assertRaises(ValueError) as cm:
+            self.json.load(StringIO(bom_json))
+        self.assertIn('BOM', str(cm.exception))
+        # make sure that the BOM is not detected in the middle of a string
+        bom_in_str = '"{}"'.format(''.encode('utf-8-sig').decode('utf-8'))
+        self.assertEqual(self.loads(bom_in_str), '\ufeff')
+        self.assertEqual(self.json.load(StringIO(bom_in_str)), '\ufeff')
+
     def test_negative_index(self):
         d = self.json.JSONDecoder()
         self.assertRaises(ValueError, d.raw_decode, 'a'*42, -50000)
diff --git a/Lib/test/test_json/test_enum.py b/Lib/test/test_json/test_enum.py
new file mode 100644
index 0000000..10f4148
--- /dev/null
+++ b/Lib/test/test_json/test_enum.py
@@ -0,0 +1,120 @@
+from enum import Enum, IntEnum
+from math import isnan
+from test.test_json import PyTest, CTest
+
+SMALL = 1
+BIG = 1<<32
+HUGE = 1<<64
+REALLY_HUGE = 1<<96
+
+class BigNum(IntEnum):
+    small = SMALL
+    big = BIG
+    huge = HUGE
+    really_huge = REALLY_HUGE
+
+E = 2.718281
+PI = 3.141593
+TAU = 2 * PI
+
+class FloatNum(float, Enum):
+    e = E
+    pi = PI
+    tau = TAU
+
+INF = float('inf')
+NEG_INF = float('-inf')
+NAN = float('nan')
+
+class WierdNum(float, Enum):
+    inf = INF
+    neg_inf = NEG_INF
+    nan = NAN
+
+class TestEnum:
+
+    def test_floats(self):
+        for enum in FloatNum:
+            self.assertEqual(self.dumps(enum), repr(enum.value))
+            self.assertEqual(float(self.dumps(enum)), enum)
+            self.assertEqual(self.loads(self.dumps(enum)), enum)
+
+    def test_weird_floats(self):
+        for enum, expected in zip(WierdNum, ('Infinity', '-Infinity', 'NaN')):
+            self.assertEqual(self.dumps(enum), expected)
+            if not isnan(enum):
+                self.assertEqual(float(self.dumps(enum)), enum)
+                self.assertEqual(self.loads(self.dumps(enum)), enum)
+            else:
+                self.assertTrue(isnan(float(self.dumps(enum))))
+                self.assertTrue(isnan(self.loads(self.dumps(enum))))
+
+    def test_ints(self):
+        for enum in BigNum:
+            self.assertEqual(self.dumps(enum), str(enum.value))
+            self.assertEqual(int(self.dumps(enum)), enum)
+            self.assertEqual(self.loads(self.dumps(enum)), enum)
+
+    def test_list(self):
+        self.assertEqual(self.dumps(list(BigNum)),
+                         str([SMALL, BIG, HUGE, REALLY_HUGE]))
+        self.assertEqual(self.loads(self.dumps(list(BigNum))),
+                         list(BigNum))
+        self.assertEqual(self.dumps(list(FloatNum)),
+                         str([E, PI, TAU]))
+        self.assertEqual(self.loads(self.dumps(list(FloatNum))),
+                         list(FloatNum))
+        self.assertEqual(self.dumps(list(WierdNum)),
+                        '[Infinity, -Infinity, NaN]')
+        self.assertEqual(self.loads(self.dumps(list(WierdNum)))[:2],
+                         list(WierdNum)[:2])
+        self.assertTrue(isnan(self.loads(self.dumps(list(WierdNum)))[2]))
+
+    def test_dict_keys(self):
+        s, b, h, r = BigNum
+        e, p, t = FloatNum
+        i, j, n = WierdNum
+        d = {
+            s:'tiny', b:'large', h:'larger', r:'largest',
+            e:"Euler's number", p:'pi', t:'tau',
+            i:'Infinity', j:'-Infinity', n:'NaN',
+            }
+        nd = self.loads(self.dumps(d))
+        self.assertEqual(nd[str(SMALL)], 'tiny')
+        self.assertEqual(nd[str(BIG)], 'large')
+        self.assertEqual(nd[str(HUGE)], 'larger')
+        self.assertEqual(nd[str(REALLY_HUGE)], 'largest')
+        self.assertEqual(nd[repr(E)], "Euler's number")
+        self.assertEqual(nd[repr(PI)], 'pi')
+        self.assertEqual(nd[repr(TAU)], 'tau')
+        self.assertEqual(nd['Infinity'], 'Infinity')
+        self.assertEqual(nd['-Infinity'], '-Infinity')
+        self.assertEqual(nd['NaN'], 'NaN')
+
+    def test_dict_values(self):
+        d = dict(
+                tiny=BigNum.small,
+                large=BigNum.big,
+                larger=BigNum.huge,
+                largest=BigNum.really_huge,
+                e=FloatNum.e,
+                pi=FloatNum.pi,
+                tau=FloatNum.tau,
+                i=WierdNum.inf,
+                j=WierdNum.neg_inf,
+                n=WierdNum.nan,
+                )
+        nd = self.loads(self.dumps(d))
+        self.assertEqual(nd['tiny'], SMALL)
+        self.assertEqual(nd['large'], BIG)
+        self.assertEqual(nd['larger'], HUGE)
+        self.assertEqual(nd['largest'], REALLY_HUGE)
+        self.assertEqual(nd['e'], E)
+        self.assertEqual(nd['pi'], PI)
+        self.assertEqual(nd['tau'], TAU)
+        self.assertEqual(nd['i'], INF)
+        self.assertEqual(nd['j'], NEG_INF)
+        self.assertTrue(isnan(nd['n']))
+
+class TestPyEnum(TestEnum, PyTest): pass
+class TestCEnum(TestEnum, CTest): pass
diff --git a/Lib/test/test_json/test_fail.py b/Lib/test/test_json/test_fail.py
index 3dd877a..7caafdb 100644
--- a/Lib/test/test_json/test_fail.py
+++ b/Lib/test/test_json/test_fail.py
@@ -1,4 +1,5 @@
 from test.test_json import PyTest, CTest
+import re
 
 # 2007-10-05
 JSONDOCS = [
@@ -100,6 +101,94 @@
         #This is for python encoder
         self.assertRaises(TypeError, self.dumps, data, indent=True)
 
+    def test_truncated_input(self):
+        test_cases = [
+            ('', 'Expecting value', 0),
+            ('[', 'Expecting value', 1),
+            ('[42', "Expecting ',' delimiter", 3),
+            ('[42,', 'Expecting value', 4),
+            ('["', 'Unterminated string starting at', 1),
+            ('["spam', 'Unterminated string starting at', 1),
+            ('["spam"', "Expecting ',' delimiter", 7),
+            ('["spam",', 'Expecting value', 8),
+            ('{', 'Expecting property name enclosed in double quotes', 1),
+            ('{"', 'Unterminated string starting at', 1),
+            ('{"spam', 'Unterminated string starting at', 1),
+            ('{"spam"', "Expecting ':' delimiter", 7),
+            ('{"spam":', 'Expecting value', 8),
+            ('{"spam":42', "Expecting ',' delimiter", 10),
+            ('{"spam":42,', 'Expecting property name enclosed in double quotes', 11),
+        ]
+        test_cases += [
+            ('"', 'Unterminated string starting at', 0),
+            ('"spam', 'Unterminated string starting at', 0),
+        ]
+        for data, msg, idx in test_cases:
+            self.assertRaisesRegex(ValueError,
+                r'^{0}: line 1 column {1} \(char {2}\)'.format(
+                    re.escape(msg), idx + 1, idx),
+                self.loads, data)
+
+    def test_unexpected_data(self):
+        test_cases = [
+            ('[,', 'Expecting value', 1),
+            ('{"spam":[}', 'Expecting value', 9),
+            ('[42:', "Expecting ',' delimiter", 3),
+            ('[42 "spam"', "Expecting ',' delimiter", 4),
+            ('[42,]', 'Expecting value', 4),
+            ('{"spam":[42}', "Expecting ',' delimiter", 11),
+            ('["]', 'Unterminated string starting at', 1),
+            ('["spam":', "Expecting ',' delimiter", 7),
+            ('["spam",]', 'Expecting value', 8),
+            ('{:', 'Expecting property name enclosed in double quotes', 1),
+            ('{,', 'Expecting property name enclosed in double quotes', 1),
+            ('{42', 'Expecting property name enclosed in double quotes', 1),
+            ('[{]', 'Expecting property name enclosed in double quotes', 2),
+            ('{"spam",', "Expecting ':' delimiter", 7),
+            ('{"spam"}', "Expecting ':' delimiter", 7),
+            ('[{"spam"]', "Expecting ':' delimiter", 8),
+            ('{"spam":}', 'Expecting value', 8),
+            ('[{"spam":]', 'Expecting value', 9),
+            ('{"spam":42 "ham"', "Expecting ',' delimiter", 11),
+            ('[{"spam":42]', "Expecting ',' delimiter", 11),
+            ('{"spam":42,}', 'Expecting property name enclosed in double quotes', 11),
+        ]
+        for data, msg, idx in test_cases:
+            self.assertRaisesRegex(ValueError,
+                r'^{0}: line 1 column {1} \(char {2}\)'.format(
+                    re.escape(msg), idx + 1, idx),
+                self.loads, data)
+
+    def test_extra_data(self):
+        test_cases = [
+            ('[]]', 'Extra data', 2),
+            ('{}}', 'Extra data', 2),
+            ('[],[]', 'Extra data', 2),
+            ('{},{}', 'Extra data', 2),
+        ]
+        test_cases += [
+            ('42,"spam"', 'Extra data', 2),
+            ('"spam",42', 'Extra data', 6),
+        ]
+        for data, msg, idx in test_cases:
+            self.assertRaisesRegex(ValueError,
+                r'^{0}: line 1 column {1} - line 1 column {2}'
+                r' \(char {3} - {4}\)'.format(
+                    re.escape(msg), idx + 1, len(data) + 1, idx, len(data)),
+                self.loads, data)
+
+    def test_linecol(self):
+        test_cases = [
+            ('!', 1, 1, 0),
+            (' !', 1, 2, 1),
+            ('\n!', 2, 1, 1),
+            ('\n  \n\n     !', 4, 6, 10),
+        ]
+        for data, line, col, idx in test_cases:
+            self.assertRaisesRegex(ValueError,
+                r'^Expecting value: line {0} column {1}'
+                r' \(char {2}\)$'.format(line, col, idx),
+                self.loads, data)
 
 class TestPyFail(TestFail, PyTest): pass
 class TestCFail(TestFail, CTest): pass
diff --git a/Lib/test/test_json/test_indent.py b/Lib/test/test_json/test_indent.py
index a4d4d20..e07856f 100644
--- a/Lib/test/test_json/test_indent.py
+++ b/Lib/test/test_json/test_indent.py
@@ -32,6 +32,8 @@
         d1 = self.dumps(h)
         d2 = self.dumps(h, indent=2, sort_keys=True, separators=(',', ': '))
         d3 = self.dumps(h, indent='\t', sort_keys=True, separators=(',', ': '))
+        d4 = self.dumps(h, indent=2, sort_keys=True)
+        d5 = self.dumps(h, indent='\t', sort_keys=True)
 
         h1 = self.loads(d1)
         h2 = self.loads(d2)
@@ -42,6 +44,8 @@
         self.assertEqual(h3, h)
         self.assertEqual(d2, expect.expandtabs(2))
         self.assertEqual(d3, expect)
+        self.assertEqual(d4, d2)
+        self.assertEqual(d5, d3)
 
     def test_indent0(self):
         h = {3: 1}
diff --git a/Lib/test/test_keyword.py b/Lib/test/test_keyword.py
new file mode 100644
index 0000000..af99f52
--- /dev/null
+++ b/Lib/test/test_keyword.py
@@ -0,0 +1,138 @@
+import keyword
+import unittest
+from test import support
+import filecmp
+import os
+import sys
+import subprocess
+import shutil
+import textwrap
+
+KEYWORD_FILE             = support.findfile('keyword.py')
+GRAMMAR_FILE             = os.path.join(os.path.split(__file__)[0],
+                                        '..', '..', 'Python', 'graminit.c')
+TEST_PY_FILE             = 'keyword_test.py'
+GRAMMAR_TEST_FILE        = 'graminit_test.c'
+PY_FILE_WITHOUT_KEYWORDS = 'minimal_keyword.py'
+NONEXISTENT_FILE         = 'not_here.txt'
+
+
+class Test_iskeyword(unittest.TestCase):
+    def test_true_is_a_keyword(self):
+        self.assertTrue(keyword.iskeyword('True'))
+
+    def test_uppercase_true_is_not_a_keyword(self):
+        self.assertFalse(keyword.iskeyword('TRUE'))
+
+    def test_none_value_is_not_a_keyword(self):
+        self.assertFalse(keyword.iskeyword(None))
+
+    # This is probably an accident of the current implementation, but should be
+    # preserved for backward compatibility.
+    def test_changing_the_kwlist_does_not_affect_iskeyword(self):
+        oldlist = keyword.kwlist
+        self.addCleanup(setattr, keyword, 'kwlist', oldlist)
+        keyword.kwlist = ['its', 'all', 'eggs', 'beans', 'and', 'a', 'slice']
+        self.assertFalse(keyword.iskeyword('eggs'))
+
+
+class TestKeywordGeneration(unittest.TestCase):
+
+    def _copy_file_without_generated_keywords(self, source_file, dest_file):
+        with open(source_file, 'rb') as fp:
+            lines = fp.readlines()
+        nl = lines[0][len(lines[0].strip()):]
+        with open(dest_file, 'wb') as fp:
+            fp.writelines(lines[:lines.index(b"#--start keywords--" + nl) + 1])
+            fp.writelines(lines[lines.index(b"#--end keywords--" + nl):])
+
+    def _generate_keywords(self, grammar_file, target_keyword_py_file):
+        proc = subprocess.Popen([sys.executable,
+                                 KEYWORD_FILE,
+                                 grammar_file,
+                                 target_keyword_py_file], stderr=subprocess.PIPE)
+        stderr = proc.communicate()[1]
+        return proc.returncode, stderr
+
+    @unittest.skipIf(not os.path.exists(GRAMMAR_FILE),
+                     'test only works from source build directory')
+    def test_real_grammar_and_keyword_file(self):
+        self._copy_file_without_generated_keywords(KEYWORD_FILE, TEST_PY_FILE)
+        self.addCleanup(support.unlink, TEST_PY_FILE)
+        self.assertFalse(filecmp.cmp(KEYWORD_FILE, TEST_PY_FILE))
+        self.assertEqual((0, b''), self._generate_keywords(GRAMMAR_FILE,
+                                                           TEST_PY_FILE))
+        self.assertTrue(filecmp.cmp(KEYWORD_FILE, TEST_PY_FILE))
+
+    def test_grammar(self):
+        self._copy_file_without_generated_keywords(KEYWORD_FILE, TEST_PY_FILE)
+        self.addCleanup(support.unlink, TEST_PY_FILE)
+        with open(GRAMMAR_TEST_FILE, 'w') as fp:
+            # Some of these are probably implementation accidents.
+            fp.writelines(textwrap.dedent("""\
+                {2, 1},
+                    {11, "encoding_decl", 0, 2, states_79,
+                     "\000\000\040\000\000\000\000\000\000\000\000\000"
+                     "\000\000\000\000\000\000\000\000\000"},
+                    {1, "jello"},
+                    {326, 0},
+                    {1, "turnip"},
+                \t{1, "This one is tab indented"
+                    {278, 0},
+                    {1, "crazy but legal"
+                "also legal" {1, "
+                    {1, "continue"},
+                   {1, "lemon"},
+                     {1, "tomato"},
+                {1, "wigii"},
+                    {1, 'no good'}
+                    {283, 0},
+                    {1,  "too many spaces"}"""))
+        self.addCleanup(support.unlink, GRAMMAR_TEST_FILE)
+        self._generate_keywords(GRAMMAR_TEST_FILE, TEST_PY_FILE)
+        expected = [
+            "        'This one is tab indented',",
+            "        'also legal',",
+            "        'continue',",
+            "        'crazy but legal',",
+            "        'jello',",
+            "        'lemon',",
+            "        'tomato',",
+            "        'turnip',",
+            "        'wigii',",
+            ]
+        with open(TEST_PY_FILE) as fp:
+            lines = fp.read().splitlines()
+        start = lines.index("#--start keywords--") + 1
+        end = lines.index("#--end keywords--")
+        actual = lines[start:end]
+        self.assertEqual(actual, expected)
+
+    def test_empty_grammar_results_in_no_keywords(self):
+        self._copy_file_without_generated_keywords(KEYWORD_FILE,
+                                                   PY_FILE_WITHOUT_KEYWORDS)
+        self.addCleanup(support.unlink, PY_FILE_WITHOUT_KEYWORDS)
+        shutil.copyfile(KEYWORD_FILE, TEST_PY_FILE)
+        self.addCleanup(support.unlink, TEST_PY_FILE)
+        self.assertEqual((0, b''), self._generate_keywords(os.devnull,
+                                                           TEST_PY_FILE))
+        self.assertTrue(filecmp.cmp(TEST_PY_FILE, PY_FILE_WITHOUT_KEYWORDS))
+
+    def test_keywords_py_without_markers_produces_error(self):
+        rc, stderr = self._generate_keywords(os.devnull, os.devnull)
+        self.assertNotEqual(rc, 0)
+        self.assertRegex(stderr, b'does not contain format markers')
+
+    def test_missing_grammar_file_produces_error(self):
+        rc, stderr = self._generate_keywords(NONEXISTENT_FILE, KEYWORD_FILE)
+        self.assertNotEqual(rc, 0)
+        self.assertRegex(stderr, b'(?ms)' + NONEXISTENT_FILE.encode())
+
+    def test_missing_keywords_py_file_produces_error(self):
+        rc, stderr = self._generate_keywords(os.devnull, NONEXISTENT_FILE)
+        self.assertNotEqual(rc, 0)
+        self.assertRegex(stderr, b'(?ms)' + NONEXISTENT_FILE.encode())
+
+
+if __name__ == "__main__":
+    unittest.main()
diff --git a/Lib/test/test_keywordonlyarg.py b/Lib/test/test_keywordonlyarg.py
index 6c2ff00..7f315d4 100644
--- a/Lib/test/test_keywordonlyarg.py
+++ b/Lib/test/test_keywordonlyarg.py
@@ -174,6 +174,18 @@
                 return __a
         self.assertEqual(X().f(), 42)
 
+    def test_default_evaluation_order(self):
+        # See issue 16967
+        a = 42
+        with self.assertRaises(NameError) as err:
+            def f(v=a, x=b, *, y=c, z=d):
+                pass
+        self.assertEqual(str(err.exception), "name 'b' is not defined")
+        with self.assertRaises(NameError) as err:
+            f = lambda v=a, x=b, *, y=c, z=d: None
+        self.assertEqual(str(err.exception), "name 'b' is not defined")
+
+
 def test_main():
     run_unittest(KeywordOnlyArgTestCase)
 
diff --git a/Lib/test/test_kqueue.py b/Lib/test/test_kqueue.py
index e5e6058..f79bd89 100644
--- a/Lib/test/test_kqueue.py
+++ b/Lib/test/test_kqueue.py
@@ -86,6 +86,31 @@
         self.assertEqual(ev, ev)
         self.assertNotEqual(ev, other)
 
+        # Issue 11973
+        bignum = 0xffff
+        ev = select.kevent(0, 1, bignum)
+        self.assertEqual(ev.ident, 0)
+        self.assertEqual(ev.filter, 1)
+        self.assertEqual(ev.flags, bignum)
+        self.assertEqual(ev.fflags, 0)
+        self.assertEqual(ev.data, 0)
+        self.assertEqual(ev.udata, 0)
+        self.assertEqual(ev, ev)
+        self.assertNotEqual(ev, other)
+
+        # Issue 11973
+        bignum = 0xffffffff
+        ev = select.kevent(0, 1, 2, bignum)
+        self.assertEqual(ev.ident, 0)
+        self.assertEqual(ev.filter, 1)
+        self.assertEqual(ev.flags, 2)
+        self.assertEqual(ev.fflags, bignum)
+        self.assertEqual(ev.data, 0)
+        self.assertEqual(ev.udata, 0)
+        self.assertEqual(ev, ev)
+        self.assertNotEqual(ev, other)
+
+
     def test_queue_event(self):
         serverSocket = socket.socket()
         serverSocket.bind(('127.0.0.1', 0))
@@ -94,7 +119,7 @@
         client.setblocking(False)
         try:
             client.connect(('127.0.0.1', serverSocket.getsockname()[1]))
-        except socket.error as e:
+        except OSError as e:
             self.assertEqual(e.args[0], errno.EINPROGRESS)
         else:
             #raise AssertionError("Connect should have raised EINPROGRESS")
@@ -185,6 +210,33 @@
         b.close()
         kq.close()
 
+    def test_close(self):
+        open_file = open(__file__, "rb")
+        self.addCleanup(open_file.close)
+        fd = open_file.fileno()
+        kqueue = select.kqueue()
+
+        # test fileno() method and closed attribute
+        self.assertIsInstance(kqueue.fileno(), int)
+        self.assertFalse(kqueue.closed)
+
+        # test close()
+        kqueue.close()
+        self.assertTrue(kqueue.closed)
+        self.assertRaises(ValueError, kqueue.fileno)
+
+        # close() can be called more than once
+        kqueue.close()
+
+        # operations must fail with ValueError("I/O operation on closed ...")
+        self.assertRaises(ValueError, kqueue.control, None, 4)
+
+    def test_fd_non_inheritable(self):
+        kqueue = select.kqueue()
+        self.addCleanup(kqueue.close)
+        self.assertEqual(os.get_inheritable(kqueue.fileno()), False)
+
+
 def test_main():
     support.run_unittest(TestKQueue)
 
diff --git a/Lib/test/test_largefile.py b/Lib/test/test_largefile.py
index 63ee697..5b276e7 100644
--- a/Lib/test/test_largefile.py
+++ b/Lib/test/test_largefile.py
@@ -159,7 +159,7 @@
             # Seeking is not enough of a test: you must write and flush, too!
             f.write(b'x')
             f.flush()
-        except (IOError, OverflowError):
+        except (OSError, OverflowError):
             raise unittest.SkipTest("filesystem does not have "
                                     "largefile support")
         finally:
diff --git a/Lib/test/test_lib2to3.py b/Lib/test/test_lib2to3.py
index df4c37b..5eaa516 100644
--- a/Lib/test/test_lib2to3.py
+++ b/Lib/test/test_lib2to3.py
@@ -1,22 +1,5 @@
-# Skipping test_parser and test_all_fixers
-# because of running
-from lib2to3.tests import (test_fixers, test_pytree, test_util, test_refactor,
-                           test_parser,
-                           test_main as test_main_)
+from lib2to3.tests import load_tests
 import unittest
-from test.support import run_unittest
-
-def suite():
-    tests = unittest.TestSuite()
-    loader = unittest.TestLoader()
-    for m in (test_fixers, test_pytree, test_util, test_refactor, test_parser,
-              test_main_):
-        tests.addTests(loader.loadTestsFromModule(m))
-    return tests
-
-def test_main():
-    run_unittest(suite())
-
 
 if __name__ == '__main__':
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_list.py b/Lib/test/test_list.py
index 5df27d3..3b94700 100644
--- a/Lib/test/test_list.py
+++ b/Lib/test/test_list.py
@@ -74,29 +74,31 @@
         # Userlist iterators don't support pickling yet since
         # they are based on generators.
         data = self.type2test([4, 5, 6, 7])
-        it = itorg = iter(data)
-        d = pickle.dumps(it)
-        it = pickle.loads(d)
-        self.assertEqual(type(itorg), type(it))
-        self.assertEqual(self.type2test(it), self.type2test(data))
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            it = itorg = iter(data)
+            d = pickle.dumps(it, proto)
+            it = pickle.loads(d)
+            self.assertEqual(type(itorg), type(it))
+            self.assertEqual(self.type2test(it), self.type2test(data))
 
-        it = pickle.loads(d)
-        next(it)
-        d = pickle.dumps(it)
-        self.assertEqual(self.type2test(it), self.type2test(data)[1:])
+            it = pickle.loads(d)
+            next(it)
+            d = pickle.dumps(it, proto)
+            self.assertEqual(self.type2test(it), self.type2test(data)[1:])
 
     def test_reversed_pickle(self):
         data = self.type2test([4, 5, 6, 7])
-        it = itorg = reversed(data)
-        d = pickle.dumps(it)
-        it = pickle.loads(d)
-        self.assertEqual(type(itorg), type(it))
-        self.assertEqual(self.type2test(it), self.type2test(reversed(data)))
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            it = itorg = reversed(data)
+            d = pickle.dumps(it, proto)
+            it = pickle.loads(d)
+            self.assertEqual(type(itorg), type(it))
+            self.assertEqual(self.type2test(it), self.type2test(reversed(data)))
 
-        it = pickle.loads(d)
-        next(it)
-        d = pickle.dumps(it)
-        self.assertEqual(self.type2test(it), self.type2test(reversed(data))[1:])
+            it = pickle.loads(d)
+            next(it)
+            d = pickle.dumps(it, proto)
+            self.assertEqual(self.type2test(it), self.type2test(reversed(data))[1:])
 
     def test_no_comdat_folding(self):
         # Issue 8847: In the PGO build, the MSVC linker's COMDAT folding
diff --git a/Lib/test/test_locale.py b/Lib/test/test_locale.py
index 76347b7..e979753 100644
--- a/Lib/test/test_locale.py
+++ b/Lib/test/test_locale.py
@@ -371,7 +371,8 @@
 
     def test_locale_alias(self):
         for localename, alias in locale.locale_alias.items():
-            self.check(localename, alias)
+            with self.subTest(locale=(localename, alias)):
+                self.check(localename, alias)
 
     def test_empty(self):
         self.check('', '')
@@ -383,6 +384,7 @@
     def test_english(self):
         self.check('en', 'en_US.ISO8859-1')
         self.check('EN', 'en_US.ISO8859-1')
+        self.check('en.iso88591', 'en_US.ISO8859-1')
         self.check('en_US', 'en_US.ISO8859-1')
         self.check('en_us', 'en_US.ISO8859-1')
         self.check('en_GB', 'en_GB.ISO8859-1')
@@ -391,7 +393,10 @@
         self.check('en_US:UTF-8', 'en_US.UTF-8')
         self.check('en_US.ISO8859-1', 'en_US.ISO8859-1')
         self.check('en_US.US-ASCII', 'en_US.ISO8859-1')
+        self.check('en_US.88591', 'en_US.ISO8859-1')
+        self.check('en_US.885915', 'en_US.ISO8859-15')
         self.check('english', 'en_EN.ISO8859-1')
+        self.check('english_uk.ascii', 'en_GB.ISO8859-1')
 
     def test_hyphenated_encoding(self):
         self.check('az_AZ.iso88599e', 'az_AZ.ISO8859-9E')
@@ -411,14 +416,16 @@
     def test_euro_modifier(self):
         self.check('de_DE@euro', 'de_DE.ISO8859-15')
         self.check('en_US.ISO8859-15@euro', 'en_US.ISO8859-15')
+        self.check('de_DE.utf8@euro', 'de_DE.UTF-8')
 
     def test_latin_modifier(self):
         self.check('be_BY.UTF-8@latin', 'be_BY.UTF-8@latin')
         self.check('sr_RS.UTF-8@latin', 'sr_RS.UTF-8@latin')
+        self.check('sr_RS.UTF-8@latn', 'sr_RS.UTF-8@latin')
 
     def test_valencia_modifier(self):
         self.check('ca_ES.UTF-8@valencia', 'ca_ES.UTF-8@valencia')
-        self.check('ca_ES@valencia', 'ca_ES.ISO8859-1@valencia')
+        self.check('ca_ES@valencia', 'ca_ES.ISO8859-15@valencia')
         self.check('ca@valencia', 'ca_ES.ISO8859-1@valencia')
 
     def test_devanagari_modifier(self):
@@ -435,6 +442,39 @@
         self.check('sd_IN', 'sd_IN.UTF-8')
         self.check('sd', 'sd_IN.UTF-8')
 
+    def test_euc_encoding(self):
+        self.check('ja_jp.euc', 'ja_JP.eucJP')
+        self.check('ja_jp.eucjp', 'ja_JP.eucJP')
+        self.check('ko_kr.euc', 'ko_KR.eucKR')
+        self.check('ko_kr.euckr', 'ko_KR.eucKR')
+        self.check('zh_cn.euc', 'zh_CN.eucCN')
+        self.check('zh_tw.euc', 'zh_TW.eucTW')
+        self.check('zh_tw.euctw', 'zh_TW.eucTW')
+
+    def test_japanese(self):
+        self.check('ja', 'ja_JP.eucJP')
+        self.check('ja.jis', 'ja_JP.JIS7')
+        self.check('ja.sjis', 'ja_JP.SJIS')
+        self.check('ja_jp', 'ja_JP.eucJP')
+        self.check('ja_jp.ajec', 'ja_JP.eucJP')
+        self.check('ja_jp.euc', 'ja_JP.eucJP')
+        self.check('ja_jp.eucjp', 'ja_JP.eucJP')
+        self.check('ja_jp.iso-2022-jp', 'ja_JP.JIS7')
+        self.check('ja_jp.iso2022jp', 'ja_JP.JIS7')
+        self.check('ja_jp.jis', 'ja_JP.JIS7')
+        self.check('ja_jp.jis7', 'ja_JP.JIS7')
+        self.check('ja_jp.mscode', 'ja_JP.SJIS')
+        self.check('ja_jp.pck', 'ja_JP.SJIS')
+        self.check('ja_jp.sjis', 'ja_JP.SJIS')
+        self.check('ja_jp.ujis', 'ja_JP.eucJP')
+        self.check('ja_jp.utf8', 'ja_JP.UTF-8')
+        self.check('japan', 'ja_JP.eucJP')
+        self.check('japanese', 'ja_JP.eucJP')
+        self.check('japanese-euc', 'ja_JP.eucJP')
+        self.check('japanese.euc', 'ja_JP.eucJP')
+        self.check('japanese.sjis', 'ja_JP.SJIS')
+        self.check('jp_jp', 'ja_JP.eucJP')
+
 
 class TestMiscellaneous(unittest.TestCase):
     def test_getpreferredencoding(self):
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py
index f34172a..54be217 100644
--- a/Lib/test/test_logging.py
+++ b/Lib/test/test_logging.py
@@ -24,6 +24,7 @@
 import logging.config
 
 import codecs
+import configparser
 import datetime
 import pickle
 import io
@@ -38,8 +39,9 @@
 import struct
 import sys
 import tempfile
+from test.script_helper import assert_python_ok
 from test.support import (captured_stdout, run_with_locale, run_unittest,
-                          patch, requires_zlib, TestHandler, Matcher)
+                          patch, requires_zlib, TestHandler, Matcher, HOST)
 import textwrap
 import time
 import unittest
@@ -56,7 +58,9 @@
     import smtpd
     from urllib.parse import urlparse, parse_qs
     from socketserver import (ThreadingUDPServer, DatagramRequestHandler,
-                              ThreadingTCPServer, StreamRequestHandler)
+                              ThreadingTCPServer, StreamRequestHandler,
+                              ThreadingUnixStreamServer,
+                              ThreadingUnixDatagramServer)
 except ImportError:
     threading = None
 try:
@@ -73,13 +77,12 @@
 except ImportError:
     pass
 
-
 class BaseTest(unittest.TestCase):
 
     """Base class for logging tests."""
 
     log_format = "%(name)s -> %(levelname)s: %(message)s"
-    expected_log_pat = r"^([\w.]+) -> ([\w]+): ([\d]+)$"
+    expected_log_pat = r"^([\w.]+) -> (\w+): (\d+)$"
     message_num = 0
 
     def setUp(self):
@@ -91,7 +94,8 @@
             self.saved_handlers = logging._handlers.copy()
             self.saved_handler_list = logging._handlerList[:]
             self.saved_loggers = saved_loggers = logger_dict.copy()
-            self.saved_level_names = logging._levelNames.copy()
+            self.saved_name_to_level = logging._nameToLevel.copy()
+            self.saved_level_to_name = logging._levelToName.copy()
             self.logger_states = logger_states = {}
             for name in saved_loggers:
                 logger_states[name] = getattr(saved_loggers[name],
@@ -133,8 +137,10 @@
         self.root_logger.setLevel(self.original_logging_level)
         logging._acquireLock()
         try:
-            logging._levelNames.clear()
-            logging._levelNames.update(self.saved_level_names)
+            logging._levelToName.clear()
+            logging._levelToName.update(self.saved_level_to_name)
+            logging._nameToLevel.clear()
+            logging._nameToLevel.update(self.saved_name_to_level)
             logging._handlers.clear()
             logging._handlers.update(self.saved_handlers)
             logging._handlerList[:] = self.saved_handler_list
@@ -148,12 +154,12 @@
         finally:
             logging._releaseLock()
 
-    def assert_log_lines(self, expected_values, stream=None):
+    def assert_log_lines(self, expected_values, stream=None, pat=None):
         """Match the collected log lines against the regular expression
         self.expected_log_pat, and compare the extracted group values to
         the expected_values list of tuples."""
         stream = stream or self.stream
-        pat = re.compile(self.expected_log_pat)
+        pat = re.compile(pat or self.expected_log_pat)
         actual_lines = stream.getvalue().splitlines()
         self.assertEqual(len(actual_lines), len(expected_values))
         for actual, expected in zip(actual_lines, expected_values):
@@ -307,6 +313,10 @@
             ('INF.BADPARENT', 'INFO', '4'),
         ])
 
+    def test_regression_22386(self):
+        """See issue #22386 for more information."""
+        self.assertEqual(logging.getLevelName('INFO'), logging.INFO)
+        self.assertEqual(logging.getLevelName(logging.INFO), 'INFO')
 
 class BasicFilterTest(BaseTest):
 
@@ -428,7 +438,7 @@
     """Test various filtering possibilities with custom logging levels."""
 
     # Skip the logger name group.
-    expected_log_pat = r"^[\w.]+ -> ([\w]+): ([\d]+)$"
+    expected_log_pat = r"^[\w.]+ -> (\w+): (\d+)$"
 
     def setUp(self):
         BaseTest.setUp(self)
@@ -558,7 +568,7 @@
                 self.assertEqual(h.facility, h.LOG_USER)
                 self.assertTrue(h.unixsocket)
                 h.close()
-            except socket.error: # syslogd might not be available
+            except OSError: # syslogd might not be available
                 pass
         for method in ('GET', 'POST', 'PUT'):
             if method == 'PUT':
@@ -583,6 +593,7 @@
             for _ in range(tries):
                 try:
                     os.unlink(fname)
+                    self.deletion_time = time.time()
                 except OSError:
                     pass
                 time.sleep(0.004 * random.randint(0, 4))
@@ -590,6 +601,9 @@
         del_count = 500
         log_count = 500
 
+        self.handle_time = None
+        self.deletion_time = None
+
         for delay in (False, True):
             fd, fn = tempfile.mkstemp('.log', 'test_logging-3-')
             os.close(fd)
@@ -603,7 +617,14 @@
                 for _ in range(log_count):
                     time.sleep(0.005)
                     r = logging.makeLogRecord({'msg': 'testing' })
-                    h.handle(r)
+                    try:
+                        self.handle_time = time.time()
+                        h.handle(r)
+                    except Exception:
+                        print('Deleted at %s, '
+                              'opened at %s' % (self.deletion_time,
+                                                self.handle_time))
+                        raise
             finally:
                 remover.join()
                 h.close()
@@ -645,41 +666,6 @@
 # -- if it proves to be of wider utility than just test_logging
 
 if threading:
-    class TestSMTPChannel(smtpd.SMTPChannel):
-        """
-        This derived class has had to be created because smtpd does not
-        support use of custom channel maps, although they are allowed by
-        asyncore's design. Issue #11959 has been raised to address this,
-        and if resolved satisfactorily, some of this code can be removed.
-        """
-        def __init__(self, server, conn, addr, sockmap):
-            asynchat.async_chat.__init__(self, conn, sockmap)
-            self.smtp_server = server
-            self.conn = conn
-            self.addr = addr
-            self.data_size_limit = None
-            self.received_lines = []
-            self.smtp_state = self.COMMAND
-            self.seen_greeting = ''
-            self.mailfrom = None
-            self.rcpttos = []
-            self.received_data = ''
-            self.fqdn = socket.getfqdn()
-            self.num_bytes = 0
-            try:
-                self.peer = conn.getpeername()
-            except socket.error as err:
-                # a race condition  may occur if the other end is closing
-                # before we can get the peername
-                self.close()
-                if err.args[0] != errno.ENOTCONN:
-                    raise
-                return
-            self.push('220 %s %s' % (self.fqdn, smtpd.__version__))
-            self.set_terminator(b'\r\n')
-            self.extended_smtp = False
-
-
     class TestSMTPServer(smtpd.SMTPServer):
         """
         This class implements a test SMTP server.
@@ -700,37 +686,14 @@
                         :func:`asyncore.loop`. This avoids changing the
                         :mod:`asyncore` module's global state.
         """
-        channel_class = TestSMTPChannel
 
         def __init__(self, addr, handler, poll_interval, sockmap):
-            self._localaddr = addr
-            self._remoteaddr = None
-            self.data_size_limit = None
-            self.sockmap = sockmap
-            asyncore.dispatcher.__init__(self, map=sockmap)
-            try:
-                sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-                sock.setblocking(0)
-                self.set_socket(sock, map=sockmap)
-                # try to re-use a server port if possible
-                self.set_reuse_addr()
-                self.bind(addr)
-                self.port = sock.getsockname()[1]
-                self.listen(5)
-            except:
-                self.close()
-                raise
+            smtpd.SMTPServer.__init__(self, addr, None, map=sockmap)
+            self.port = self.socket.getsockname()[1]
             self._handler = handler
             self._thread = None
             self.poll_interval = poll_interval
 
-        def handle_accepted(self, conn, addr):
-            """
-            Redefined only because the base class does not pass in a
-            map, forcing use of a global in :mod:`asyncore`.
-            """
-            channel = self.channel_class(self, conn, addr, self.sockmap)
-
         def process_message(self, peer, mailfrom, rcpttos, data):
             """
             Delegates to the handler passed in to the server's constructor.
@@ -761,8 +724,8 @@
                                   :func:`asyncore.loop`.
             """
             try:
-                asyncore.loop(poll_interval, map=self.sockmap)
-            except select.error:
+                asyncore.loop(poll_interval, map=self._map)
+            except OSError:
                 # On FreeBSD 8, closing the server repeatably
                 # raises this error. We swallow it if the
                 # server has been closed.
@@ -869,7 +832,7 @@
                 sock, addr = self.socket.accept()
                 if self.sslctx:
                     sock = self.sslctx.wrap_socket(sock, server_side=True)
-            except socket.error as e:
+            except OSError as e:
                 # socket errors are silenced by the caller, print them here
                 sys.stderr.write("Got an error:\n%s\n" % e)
                 raise
@@ -935,7 +898,7 @@
                     if data:
                         try:
                             super(DelegatingUDPRequestHandler, self).finish()
-                        except socket.error:
+                        except OSError:
                             if not self.server._closed:
                                 raise
 
@@ -953,6 +916,13 @@
             super(TestUDPServer, self).server_close()
             self._closed = True
 
+    if hasattr(socket, "AF_UNIX"):
+        class TestUnixStreamServer(TestTCPServer):
+            address_family = socket.AF_UNIX
+
+        class TestUnixDatagramServer(TestUDPServer):
+            address_family = socket.AF_UNIX
+
 # - end of server_helper section
 
 @unittest.skipUnless(threading, 'Threading required for this test.')
@@ -960,10 +930,10 @@
     TIMEOUT = 8.0
     def test_basic(self):
         sockmap = {}
-        server = TestSMTPServer(('localhost', 0), self.process_message, 0.001,
+        server = TestSMTPServer((HOST, 0), self.process_message, 0.001,
                                 sockmap)
         server.start()
-        addr = ('localhost', server.port)
+        addr = (HOST, server.port)
         h = logging.handlers.SMTPHandler(addr, 'me', 'you', 'Log',
                                          timeout=self.TIMEOUT)
         self.assertEqual(h.toaddrs, ['you'])
@@ -991,7 +961,7 @@
     """Tests for the MemoryHandler."""
 
     # Do not bother with a logger name group.
-    expected_log_pat = r"^[\w.]+ -> ([\w]+): ([\d]+)$"
+    expected_log_pat = r"^[\w.]+ -> (\w+): (\d+)$"
 
     def setUp(self):
         BaseTest.setUp(self)
@@ -1044,7 +1014,7 @@
 
     """Reading logging config from a .ini-style config file."""
 
-    expected_log_pat = r"^([\w]+) \+\+ ([\w]+)$"
+    expected_log_pat = r"^(\w+) \+\+ (\w+)$"
 
     # config0 is a standard configuration.
     config0 = """
@@ -1292,6 +1262,24 @@
             # Original logger output is empty.
             self.assert_log_lines([])
 
+    def test_config0_using_cp_ok(self):
+        # A simple config file which overrides the default settings.
+        with captured_stdout() as output:
+            file = io.StringIO(textwrap.dedent(self.config0))
+            cp = configparser.ConfigParser()
+            cp.read_file(file)
+            logging.config.fileConfig(cp)
+            logger = logging.getLogger()
+            # Won't output anything
+            logger.info(self.next_message())
+            # Outputs a message
+            logger.error(self.next_message())
+            self.assert_log_lines([
+                ('ERROR', '2'),
+            ], stream=output)
+            # Original logger output is empty.
+            self.assert_log_lines([])
+
     def test_config1_ok(self, config=config1):
         # A config file defining a sub-parser as well.
         with captured_stdout() as output:
@@ -1381,7 +1369,7 @@
 
     def test_logger_disabling(self):
         self.apply_config(self.disable_test)
-        logger = logging.getLogger('foo')
+        logger = logging.getLogger('some_pristine_logger')
         self.assertFalse(logger.disabled)
         self.apply_config(self.disable_test)
         self.assertTrue(logger.disabled)
@@ -1394,17 +1382,23 @@
 
     """Test for SocketHandler objects."""
 
+    if threading:
+        server_class = TestTCPServer
+        address = ('localhost', 0)
+
     def setUp(self):
         """Set up a TCP server to receive log messages, and a SocketHandler
         pointing to that server's address and port."""
         BaseTest.setUp(self)
-        addr = ('localhost', 0)
-        self.server = server = TestTCPServer(addr, self.handle_socket,
-                                                0.01)
+        self.server = server = self.server_class(self.address,
+                                                 self.handle_socket, 0.01)
         server.start()
         server.ready.wait()
-        self.sock_hdlr = logging.handlers.SocketHandler('localhost',
-                                                        server.port)
+        hcls = logging.handlers.SocketHandler
+        if isinstance(server.server_address, tuple):
+            self.sock_hdlr = hcls('localhost', server.port)
+        else:
+            self.sock_hdlr = hcls(server.server_address, None)
         self.log_output = ''
         self.root_logger.removeHandler(self.root_logger.handlers[0])
         self.root_logger.addHandler(self.sock_hdlr)
@@ -1444,35 +1438,70 @@
         self.assertEqual(self.log_output, "spam\neggs\n")
 
     def test_noserver(self):
+        # Avoid timing-related failures due to SocketHandler's own hard-wired
+        # one-second timeout on socket.create_connection() (issue #16264).
+        self.sock_hdlr.retryStart = 2.5
         # Kill the server
         self.server.stop(2.0)
-        #The logging call should try to connect, which should fail
+        # The logging call should try to connect, which should fail
         try:
             raise RuntimeError('Deliberate mistake')
         except RuntimeError:
             self.root_logger.exception('Never sent')
         self.root_logger.error('Never sent, either')
         now = time.time()
-        self.assertTrue(self.sock_hdlr.retryTime > now)
+        self.assertGreater(self.sock_hdlr.retryTime, now)
         time.sleep(self.sock_hdlr.retryTime - now + 0.001)
         self.root_logger.error('Nor this')
 
+def _get_temp_domain_socket():
+    fd, fn = tempfile.mkstemp(prefix='test_logging_', suffix='.sock')
+    os.close(fd)
+    # just need a name - file can't be present, or we'll get an
+    # 'address already in use' error.
+    os.remove(fn)
+    return fn
+
+@unittest.skipUnless(hasattr(socket, "AF_UNIX"), "Unix sockets required")
+@unittest.skipUnless(threading, 'Threading required for this test.')
+class UnixSocketHandlerTest(SocketHandlerTest):
+
+    """Test for SocketHandler with unix sockets."""
+
+    if threading and hasattr(socket, "AF_UNIX"):
+        server_class = TestUnixStreamServer
+
+    def setUp(self):
+        # override the definition in the base class
+        self.address = _get_temp_domain_socket()
+        SocketHandlerTest.setUp(self)
+
+    def tearDown(self):
+        SocketHandlerTest.tearDown(self)
+        os.remove(self.address)
 
 @unittest.skipUnless(threading, 'Threading required for this test.')
 class DatagramHandlerTest(BaseTest):
 
     """Test for DatagramHandler."""
 
+    if threading:
+        server_class = TestUDPServer
+        address = ('localhost', 0)
+
     def setUp(self):
         """Set up a UDP server to receive log messages, and a DatagramHandler
         pointing to that server's address and port."""
         BaseTest.setUp(self)
-        addr = ('localhost', 0)
-        self.server = server = TestUDPServer(addr, self.handle_datagram, 0.01)
+        self.server = server = self.server_class(self.address,
+                                                 self.handle_datagram, 0.01)
         server.start()
         server.ready.wait()
-        self.sock_hdlr = logging.handlers.DatagramHandler('localhost',
-                                                          server.port)
+        hcls = logging.handlers.DatagramHandler
+        if isinstance(server.server_address, tuple):
+            self.sock_hdlr = hcls('localhost', server.port)
+        else:
+            self.sock_hdlr = hcls(server.server_address, None)
         self.log_output = ''
         self.root_logger.removeHandler(self.root_logger.handlers[0])
         self.root_logger.addHandler(self.sock_hdlr)
@@ -1505,23 +1534,46 @@
         self.handled.wait()
         self.assertEqual(self.log_output, "spam\neggs\n")
 
+@unittest.skipUnless(hasattr(socket, "AF_UNIX"), "Unix sockets required")
+@unittest.skipUnless(threading, 'Threading required for this test.')
+class UnixDatagramHandlerTest(DatagramHandlerTest):
+
+    """Test for DatagramHandler using Unix sockets."""
+
+    if threading and hasattr(socket, "AF_UNIX"):
+        server_class = TestUnixDatagramServer
+
+    def setUp(self):
+        # override the definition in the base class
+        self.address = _get_temp_domain_socket()
+        DatagramHandlerTest.setUp(self)
+
+    def tearDown(self):
+        DatagramHandlerTest.tearDown(self)
+        os.remove(self.address)
 
 @unittest.skipUnless(threading, 'Threading required for this test.')
 class SysLogHandlerTest(BaseTest):
 
     """Test for SysLogHandler using UDP."""
 
+    if threading:
+        server_class = TestUDPServer
+        address = ('localhost', 0)
+
     def setUp(self):
         """Set up a UDP server to receive log messages, and a SysLogHandler
         pointing to that server's address and port."""
         BaseTest.setUp(self)
-        addr = ('localhost', 0)
-        self.server = server = TestUDPServer(addr, self.handle_datagram,
-                                                0.01)
+        self.server = server = self.server_class(self.address,
+                                                 self.handle_datagram, 0.01)
         server.start()
         server.ready.wait()
-        self.sl_hdlr = logging.handlers.SysLogHandler(('localhost',
-                                                       server.port))
+        hcls = logging.handlers.SysLogHandler
+        if isinstance(server.server_address, tuple):
+            self.sl_hdlr = hcls(('localhost', server.port))
+        else:
+            self.sl_hdlr = hcls(server.server_address)
         self.log_output = ''
         self.root_logger.removeHandler(self.root_logger.handlers[0])
         self.root_logger.addHandler(self.sl_hdlr)
@@ -1557,41 +1609,28 @@
         self.handled.wait()
         self.assertEqual(self.log_output, b'<11>h\xc3\xa4m-sp\xc3\xa4m')
 
+@unittest.skipUnless(hasattr(socket, "AF_UNIX"), "Unix sockets required")
+@unittest.skipUnless(threading, 'Threading required for this test.')
+class UnixSysLogHandlerTest(SysLogHandlerTest):
+
+    """Test for SysLogHandler with Unix sockets."""
+
+    if threading and hasattr(socket, "AF_UNIX"):
+        server_class = TestUnixDatagramServer
+
+    def setUp(self):
+        # override the definition in the base class
+        self.address = _get_temp_domain_socket()
+        SysLogHandlerTest.setUp(self)
+
+    def tearDown(self):
+        SysLogHandlerTest.tearDown(self)
+        os.remove(self.address)
 
 @unittest.skipUnless(threading, 'Threading required for this test.')
 class HTTPHandlerTest(BaseTest):
     """Test for HTTPHandler."""
 
-    PEMFILE = """-----BEGIN RSA PRIVATE KEY-----
-MIICXQIBAAKBgQDGT4xS5r91rbLJQK2nUDenBhBG6qFk+bVOjuAGC/LSHlAoBnvG
-zQG3agOG+e7c5z2XT8m2ktORLqG3E4mYmbxgyhDrzP6ei2Anc+pszmnxPoK3Puh5
-aXV+XKt0bU0C1m2+ACmGGJ0t3P408art82nOxBw8ZHgIg9Dtp6xIUCyOqwIDAQAB
-AoGBAJFTnFboaKh5eUrIzjmNrKsG44jEyy+vWvHN/FgSC4l103HxhmWiuL5Lv3f7
-0tMp1tX7D6xvHwIG9VWvyKb/Cq9rJsDibmDVIOslnOWeQhG+XwJyitR0pq/KlJIB
-5LjORcBw795oKWOAi6RcOb1ON59tysEFYhAGQO9k6VL621gRAkEA/Gb+YXULLpbs
-piXN3q4zcHzeaVANo69tUZ6TjaQqMeTxE4tOYM0G0ZoSeHEdaP59AOZGKXXNGSQy
-2z/MddcYGQJBAMkjLSYIpOLJY11ja8OwwswFG2hEzHe0cS9bzo++R/jc1bHA5R0Y
-i6vA5iPi+wopPFvpytdBol7UuEBe5xZrxWMCQQCWxELRHiP2yWpEeLJ3gGDzoXMN
-PydWjhRju7Bx3AzkTtf+D6lawz1+eGTuEss5i0JKBkMEwvwnN2s1ce+EuF4JAkBb
-E96h1lAzkVW5OAfYOPY8RCPA90ZO/hoyg7PpSxR0ECuDrgERR8gXIeYUYfejBkEa
-rab4CfRoVJKKM28Yq/xZAkBvuq670JRCwOgfUTdww7WpdOQBYPkzQccsKNCslQW8
-/DyW6y06oQusSENUvynT6dr3LJxt/NgZPhZX2+k1eYDV
------END RSA PRIVATE KEY-----
------BEGIN CERTIFICATE-----
-MIICGzCCAYSgAwIBAgIJAIq84a2Q/OvlMA0GCSqGSIb3DQEBBQUAMBQxEjAQBgNV
-BAMTCWxvY2FsaG9zdDAeFw0xMTA1MjExMDIzMzNaFw03NTAzMjEwMzU1MTdaMBQx
-EjAQBgNVBAMTCWxvY2FsaG9zdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA
-xk+MUua/da2yyUCtp1A3pwYQRuqhZPm1To7gBgvy0h5QKAZ7xs0Bt2oDhvnu3Oc9
-l0/JtpLTkS6htxOJmJm8YMoQ68z+notgJ3PqbM5p8T6Ctz7oeWl1flyrdG1NAtZt
-vgAphhidLdz+NPGq7fNpzsQcPGR4CIPQ7aesSFAsjqsCAwEAAaN1MHMwHQYDVR0O
-BBYEFLWaUPO6N7efGiuoS9i3DVYcUwn0MEQGA1UdIwQ9MDuAFLWaUPO6N7efGiuo
-S9i3DVYcUwn0oRikFjAUMRIwEAYDVQQDEwlsb2NhbGhvc3SCCQCKvOGtkPzr5TAM
-BgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4GBAMK5whPjLNQK1Ivvk88oqJqq
-4f889OwikGP0eUhOBhbFlsZs+jq5YZC2UzHz+evzKBlgAP1u4lP/cB85CnjvWqM+
-1c/lywFHQ6HOdDeQ1L72tSYMrNOG4XNmLn0h7rx6GoTU7dcFRfseahBCq8mv0IDt
-IRbTpvlHWPjsSvHz0ZOH
------END CERTIFICATE-----"""
-
     def setUp(self):
         """Set up an HTTP server to receive log messages, and a HTTPHandler
         pointing to that server's address and port."""
@@ -1621,17 +1660,18 @@
             if secure:
                 try:
                     import ssl
-                    fd, fn = tempfile.mkstemp()
-                    os.close(fd)
-                    with open(fn, 'w') as f:
-                        f.write(self.PEMFILE)
-                    sslctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
-                    sslctx.load_cert_chain(fn)
-                    os.unlink(fn)
                 except ImportError:
                     sslctx = None
+                else:
+                    here = os.path.dirname(__file__)
+                    localhost_cert = os.path.join(here, "keycert.pem")
+                    sslctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+                    sslctx.load_cert_chain(localhost_cert)
+
+                    context = ssl.create_default_context(cafile=localhost_cert)
             else:
                 sslctx = None
+                context = None
             self.server = server = TestHTTPServer(addr, self.handle_request,
                                                     0.01, sslctx=sslctx)
             server.start()
@@ -1639,7 +1679,8 @@
             host = 'localhost:%d' % server.server_port
             secure_client = secure and sslctx
             self.h_hdlr = logging.handlers.HTTPHandler(host, '/frob',
-                                                       secure=secure_client)
+                                                       secure=secure_client,
+                                                       context=context)
             self.log_data = None
             root_logger.addHandler(self.h_hdlr)
 
@@ -1779,7 +1820,7 @@
             logger.removeHandler(h)
             s = stream.getvalue()
             h.close()
-            self.assertTrue(s.find("UserWarning: I'm warning you...\n") > 0)
+            self.assertGreater(s.find("UserWarning: I'm warning you...\n"), 0)
 
             #See if an explicit file uses the original implementation
             a_file = io.StringIO()
@@ -1817,7 +1858,7 @@
 
     """Reading logging config from a dictionary."""
 
-    expected_log_pat = r"^([\w]+) \+\+ ([\w]+)$"
+    expected_log_pat = r"^(\w+) \+\+ (\w+)$"
 
     # config0 is a standard configuration.
     config0 = {
@@ -2389,6 +2430,32 @@
         },
     }
 
+    # As config0, but with properties
+    config14 = {
+        'version': 1,
+        'formatters': {
+            'form1' : {
+                'format' : '%(levelname)s ++ %(message)s',
+            },
+        },
+        'handlers' : {
+            'hand1' : {
+                'class' : 'logging.StreamHandler',
+                'formatter' : 'form1',
+                'level' : 'NOTSET',
+                'stream'  : 'ext://sys.stdout',
+                '.': {
+                    'foo': 'bar',
+                    'terminator': '!\n',
+                }
+            },
+        },
+        'root' : {
+            'level' : 'WARNING',
+            'handlers' : ['hand1'],
+        },
+    }
+
     out_of_order = {
         "version": 1,
         "formatters": {
@@ -2656,11 +2723,20 @@
     def test_config13_failure(self):
         self.assertRaises(Exception, self.apply_config, self.config13)
 
+    def test_config14_ok(self):
+        with captured_stdout() as output:
+            self.apply_config(self.config14)
+            h = logging._handlers['hand1']
+            self.assertEqual(h.foo, 'bar')
+            self.assertEqual(h.terminator, '!\n')
+            logging.warning('Exclamation')
+            self.assertTrue(output.getvalue().endswith('Exclamation!\n'))
+
     @unittest.skipUnless(threading, 'listen() needs threading to work')
-    def setup_via_listener(self, text):
+    def setup_via_listener(self, text, verify=None):
         text = text.encode("utf-8")
         # Ask for a randomly assigned port (by using port 0)
-        t = logging.config.listen(0)
+        t = logging.config.listen(0, verify)
         t.start()
         t.ready.wait()
         # Now get the port allocated
@@ -2720,6 +2796,69 @@
             # Original logger output is empty.
             self.assert_log_lines([])
 
+    @unittest.skipUnless(threading, 'Threading required for this test.')
+    def test_listen_verify(self):
+
+        def verify_fail(stuff):
+            return None
+
+        def verify_reverse(stuff):
+            return stuff[::-1]
+
+        logger = logging.getLogger("compiler.parser")
+        to_send = textwrap.dedent(ConfigFileTest.config1)
+        # First, specify a verification function that will fail.
+        # We expect to see no output, since our configuration
+        # never took effect.
+        with captured_stdout() as output:
+            self.setup_via_listener(to_send, verify_fail)
+            # Both will output a message
+            logger.info(self.next_message())
+            logger.error(self.next_message())
+        self.assert_log_lines([], stream=output)
+        # Original logger output has the stuff we logged.
+        self.assert_log_lines([
+            ('INFO', '1'),
+            ('ERROR', '2'),
+        ], pat=r"^[\w.]+ -> (\w+): (\d+)$")
+
+        # Now, perform no verification. Our configuration
+        # should take effect.
+
+        with captured_stdout() as output:
+            self.setup_via_listener(to_send)    # no verify callable specified
+            logger = logging.getLogger("compiler.parser")
+            # Both will output a message
+            logger.info(self.next_message())
+            logger.error(self.next_message())
+        self.assert_log_lines([
+            ('INFO', '3'),
+            ('ERROR', '4'),
+        ], stream=output)
+        # Original logger output still has the stuff we logged before.
+        self.assert_log_lines([
+            ('INFO', '1'),
+            ('ERROR', '2'),
+        ], pat=r"^[\w.]+ -> (\w+): (\d+)$")
+
+        # Now, perform verification which transforms the bytes.
+
+        with captured_stdout() as output:
+            self.setup_via_listener(to_send[::-1], verify_reverse)
+            logger = logging.getLogger("compiler.parser")
+            # Both will output a message
+            logger.info(self.next_message())
+            logger.error(self.next_message())
+        self.assert_log_lines([
+            ('INFO', '5'),
+            ('ERROR', '6'),
+        ], stream=output)
+        # Original logger output still has the stuff we logged before.
+        self.assert_log_lines([
+            ('INFO', '1'),
+            ('ERROR', '2'),
+        ], pat=r"^[\w.]+ -> (\w+): (\d+)$")
+
     def test_out_of_order(self):
         self.apply_config(self.out_of_order)
         handler = logging.getLogger('mymodule').handlers[0]
@@ -2779,14 +2918,14 @@
         l2 = logging.getLogger('def.ghi')
         c1 = r.getChild('xyz')
         c2 = r.getChild('uvw.xyz')
-        self.assertTrue(c1 is logging.getLogger('xyz'))
-        self.assertTrue(c2 is logging.getLogger('uvw.xyz'))
+        self.assertIs(c1, logging.getLogger('xyz'))
+        self.assertIs(c2, logging.getLogger('uvw.xyz'))
         c1 = l1.getChild('def')
         c2 = c1.getChild('ghi')
         c3 = l1.getChild('def.ghi')
-        self.assertTrue(c1 is logging.getLogger('abc.def'))
-        self.assertTrue(c2 is logging.getLogger('abc.def.ghi'))
-        self.assertTrue(c2 is c3)
+        self.assertIs(c1, logging.getLogger('abc.def'))
+        self.assertIs(c2, logging.getLogger('abc.def.ghi'))
+        self.assertIs(c2, c3)
 
 
 class DerivedLogRecord(logging.LogRecord):
@@ -2829,7 +2968,7 @@
 
 class QueueHandlerTest(BaseTest):
     # Do not bother with a logger name group.
-    expected_log_pat = r"^[\w.]+ -> ([\w]+): ([\d]+)$"
+    expected_log_pat = r"^[\w.]+ -> (\w+): (\d+)$"
 
     def setUp(self):
         BaseTest.setUp(self)
@@ -3123,13 +3262,13 @@
         self.assertEqual('0 - release', self.called[-1])
 
     def test_with_ioerror_in_acquire(self):
-        self._test_with_failure_in_method('acquire', IOError)
+        self._test_with_failure_in_method('acquire', OSError)
 
     def test_with_ioerror_in_flush(self):
-        self._test_with_failure_in_method('flush', IOError)
+        self._test_with_failure_in_method('flush', OSError)
 
     def test_with_ioerror_in_close(self):
-        self._test_with_failure_in_method('close', IOError)
+        self._test_with_failure_in_method('close', OSError)
 
     def test_with_valueerror_in_acquire(self):
         self._test_with_failure_in_method('acquire', ValueError)
@@ -3235,6 +3374,25 @@
         logging.setLoggerClass(logging.Logger)
         self.assertEqual(logging.getLoggerClass(), logging.Logger)
 
+    def test_logging_at_shutdown(self):
+        # Issue #20037
+        code = """if 1:
+            import logging
+
+            class A:
+                def __del__(self):
+                    try:
+                        raise ValueError("some error")
+                    except Exception:
+                        logging.exception("exception in __del__")
+
+            a = A()"""
+        rc, out, err = assert_python_ok("-c", code)
+        err = err.decode()
+        self.assertIn("exception in __del__", err)
+        self.assertIn("ValueError: some error", err)
+
+
 class LogRecordTest(BaseTest):
     def test_str_rep(self):
         r = logging.makeLogRecord({})
@@ -3352,6 +3510,12 @@
                 "ERROR:root:Log an error")
 
     def test_filename(self):
+
+        def cleanup(h1, h2, fn):
+            h1.close()
+            h2.close()
+            os.remove(fn)
+
         logging.basicConfig(filename='test.log')
 
         self.assertEqual(len(logging.root.handlers), 1)
@@ -3359,17 +3523,23 @@
         self.assertIsInstance(handler, logging.FileHandler)
 
         expected = logging.FileHandler('test.log', 'a')
-        self.addCleanup(expected.close)
         self.assertEqual(handler.stream.mode, expected.stream.mode)
         self.assertEqual(handler.stream.name, expected.stream.name)
+        self.addCleanup(cleanup, handler, expected, 'test.log')
 
     def test_filemode(self):
+
+        def cleanup(h1, h2, fn):
+            h1.close()
+            h2.close()
+            os.remove(fn)
+
         logging.basicConfig(filename='test.log', filemode='wb')
 
         handler = logging.root.handlers[0]
         expected = logging.FileHandler('test.log', 'wb')
-        self.addCleanup(expected.close)
         self.assertEqual(handler.stream.mode, expected.stream.mode)
+        self.addCleanup(cleanup, handler, expected, 'test.log')
 
     def test_stream(self):
         stream = io.StringIO()
@@ -3825,6 +3995,63 @@
         assertRaises(ValueError, logging.handlers.TimedRotatingFileHandler,
                      self.fn, 'W7', delay=True)
 
+    def test_compute_rollover_daily_attime(self):
+        currentTime = 0
+        atTime = datetime.time(12, 0, 0)
+        rh = logging.handlers.TimedRotatingFileHandler(
+            self.fn, when='MIDNIGHT', interval=1, backupCount=0, utc=True,
+            atTime=atTime)
+        try:
+            actual = rh.computeRollover(currentTime)
+            self.assertEqual(actual, currentTime + 12 * 60 * 60)
+
+            actual = rh.computeRollover(currentTime + 13 * 60 * 60)
+            self.assertEqual(actual, currentTime + 36 * 60 * 60)
+        finally:
+            rh.close()
+
+    #@unittest.skipIf(True, 'Temporarily skipped while failures investigated.')
+    def test_compute_rollover_weekly_attime(self):
+        currentTime = int(time.time())
+        today = currentTime - currentTime % 86400
+
+        atTime = datetime.time(12, 0, 0)
+
+        wday = time.gmtime(today).tm_wday
+        for day in range(7):
+            rh = logging.handlers.TimedRotatingFileHandler(
+                self.fn, when='W%d' % day, interval=1, backupCount=0, utc=True,
+                atTime=atTime)
+            try:
+                if wday > day:
+                    # The rollover day has already passed this week, so we
+                    # go over into next week
+                    expected = (7 - wday + day)
+                else:
+                    expected = (day - wday)
+                # At this point expected is in days from now, convert to seconds
+                expected *= 24 * 60 * 60
+                # Add in the rollover time
+                expected += 12 * 60 * 60
+                # Add in adjustment for today
+                expected += today
+                actual = rh.computeRollover(today)
+                if actual != expected:
+                    print('failed in timezone: %d' % time.timezone)
+                    print('local vars: %s' % locals())
+                self.assertEqual(actual, expected)
+                if day == wday:
+                    # goes into following week
+                    expected += 7 * 24 * 60 * 60
+                actual = rh.computeRollover(today + 13 * 60 * 60)
+                if actual != expected:
+                    print('failed in timezone: %d' % time.timezone)
+                    print('local vars: %s' % locals())
+                self.assertEqual(actual, expected)
+            finally:
+                rh.close()
+
+
 def secs(**kw):
     return datetime.timedelta(**kw) // datetime.timedelta(seconds=1)
 
@@ -3883,7 +4110,7 @@
         h.handle(r)
         h.close()
         # Now see if the event is recorded
-        self.assertTrue(num_recs < win32evtlog.GetNumberOfEventLogRecords(elh))
+        self.assertLess(num_recs, win32evtlog.GetNumberOfEventLogRecords(elh))
         flags = win32evtlog.EVENTLOG_BACKWARDS_READ | \
                 win32evtlog.EVENTLOG_SEQUENTIAL_READ
         found = False
@@ -3916,7 +4143,8 @@
                  SMTPHandlerTest, FileHandlerTest, RotatingFileHandlerTest,
                  LastResortTest, LogRecordTest, ExceptionTest,
                  SysLogHandlerTest, HTTPHandlerTest, NTEventLogHandlerTest,
-                 TimedRotatingFileHandlerTest
+                 TimedRotatingFileHandlerTest, UnixSocketHandlerTest,
+                 UnixDatagramHandlerTest, UnixSysLogHandlerTest
                 )
 
 if __name__ == "__main__":
diff --git a/Lib/test/test_long.py b/Lib/test/test_long.py
index 3f9c1e2..5f14795 100644
--- a/Lib/test/test_long.py
+++ b/Lib/test/test_long.py
@@ -1079,7 +1079,7 @@
         self.assertRaises(OverflowError, (256).to_bytes, 1, 'big', signed=True)
         self.assertRaises(OverflowError, (256).to_bytes, 1, 'little', signed=False)
         self.assertRaises(OverflowError, (256).to_bytes, 1, 'little', signed=True)
-        self.assertRaises(OverflowError, (-1).to_bytes, 2, 'big', signed=False),
+        self.assertRaises(OverflowError, (-1).to_bytes, 2, 'big', signed=False)
         self.assertRaises(OverflowError, (-1).to_bytes, 2, 'little', signed=False)
         self.assertEqual((0).to_bytes(0, 'big'), b'')
         self.assertEqual((1).to_bytes(5, 'big'), b'\x00\x00\x00\x00\x01')
@@ -1235,6 +1235,13 @@
         for n in map(int, integers):
             self.assertEqual(n, 0)
 
+    def test_shift_bool(self):
+        # Issue #21422: ensure that bool << int and bool >> int return int
+        for value in (True, False):
+            for shift in (0, 2):
+                self.assertEqual(type(value << shift), int)
+                self.assertEqual(type(value >> shift), int)
+
 
 def test_main():
     support.run_unittest(LongTest)
diff --git a/Lib/test/test_lzma.py b/Lib/test/test_lzma.py
index 160b0e8..07fadbd 100644
--- a/Lib/test/test_lzma.py
+++ b/Lib/test/test_lzma.py
@@ -220,10 +220,11 @@
     # Pickling raises an exception; there's no way to serialize an lzma_stream.
 
     def test_pickle(self):
-        with self.assertRaises(TypeError):
-            pickle.dumps(LZMACompressor())
-        with self.assertRaises(TypeError):
-            pickle.dumps(LZMADecompressor())
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            with self.assertRaises(TypeError):
+                pickle.dumps(LZMACompressor(), proto)
+            with self.assertRaises(TypeError):
+                pickle.dumps(LZMADecompressor(), proto)
 
 
 class CompressDecompressFunctionTestCase(unittest.TestCase):
@@ -383,6 +384,8 @@
             pass
         with LZMAFile(BytesIO(), "w") as f:
             pass
+        with LZMAFile(BytesIO(), "x") as f:
+            pass
         with LZMAFile(BytesIO(), "a") as f:
             pass
 
@@ -410,13 +413,29 @@
             with LZMAFile(TESTFN, "ab"):
                 pass
 
+    def test_init_with_x_mode(self):
+        self.addCleanup(unlink, TESTFN)
+        for mode in ("x", "xb"):
+            unlink(TESTFN)
+            with LZMAFile(TESTFN, mode):
+                pass
+            with self.assertRaises(FileExistsError):
+                with LZMAFile(TESTFN, mode):
+                    pass
+
     def test_init_bad_mode(self):
         with self.assertRaises(ValueError):
             LZMAFile(BytesIO(COMPRESSED_XZ), (3, "x"))
         with self.assertRaises(ValueError):
             LZMAFile(BytesIO(COMPRESSED_XZ), "")
         with self.assertRaises(ValueError):
-            LZMAFile(BytesIO(COMPRESSED_XZ), "x")
+            LZMAFile(BytesIO(COMPRESSED_XZ), "xt")
+        with self.assertRaises(ValueError):
+            LZMAFile(BytesIO(COMPRESSED_XZ), "x+")
+        with self.assertRaises(ValueError):
+            LZMAFile(BytesIO(COMPRESSED_XZ), "rx")
+        with self.assertRaises(ValueError):
+            LZMAFile(BytesIO(COMPRESSED_XZ), "wx")
         with self.assertRaises(ValueError):
             LZMAFile(BytesIO(COMPRESSED_XZ), "rt")
         with self.assertRaises(ValueError):
@@ -698,6 +717,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()
@@ -1041,8 +1074,6 @@
         with self.assertRaises(ValueError):
             lzma.open(TESTFN, "")
         with self.assertRaises(ValueError):
-            lzma.open(TESTFN, "x")
-        with self.assertRaises(ValueError):
             lzma.open(TESTFN, "rbt")
         with self.assertRaises(ValueError):
             lzma.open(TESTFN, "rb", encoding="utf-8")
@@ -1091,6 +1122,16 @@
             with lzma.open(bio, "rt", newline="\r") as f:
                 self.assertEqual(f.readlines(), [text])
 
+    def test_x_mode(self):
+        self.addCleanup(unlink, TESTFN)
+        for mode in ("x", "xb", "xt"):
+            unlink(TESTFN)
+            with lzma.open(TESTFN, mode):
+                pass
+            with self.assertRaises(FileExistsError):
+                with lzma.open(TESTFN, mode):
+                    pass
+
 
 class MiscellaneousTestCase(unittest.TestCase):
 
diff --git a/Lib/test/test_macpath.py b/Lib/test/test_macpath.py
index ae4e564..22f8491 100644
--- a/Lib/test/test_macpath.py
+++ b/Lib/test/test_macpath.py
@@ -49,16 +49,40 @@
     def test_join(self):
         join = macpath.join
         self.assertEqual(join('a', 'b'), ':a:b')
+        self.assertEqual(join(':a', 'b'), ':a:b')
+        self.assertEqual(join(':a:', 'b'), ':a:b')
+        self.assertEqual(join(':a::', 'b'), ':a::b')
+        self.assertEqual(join(':a', '::b'), ':a::b')
+        self.assertEqual(join('a', ':'), ':a:')
+        self.assertEqual(join('a:', ':'), 'a:')
+        self.assertEqual(join('a', ''), ':a:')
+        self.assertEqual(join('a:', ''), 'a:')
+        self.assertEqual(join('', ''), '')
         self.assertEqual(join('', 'a:b'), 'a:b')
+        self.assertEqual(join('', 'a', 'b'), ':a:b')
         self.assertEqual(join('a:b', 'c'), 'a:b:c')
         self.assertEqual(join('a:b', ':c'), 'a:b:c')
         self.assertEqual(join('a', ':b', ':c'), ':a:b:c')
+        self.assertEqual(join('a', 'b:'), 'b:')
+        self.assertEqual(join('a:', 'b:'), 'b:')
 
         self.assertEqual(join(b'a', b'b'), b':a:b')
+        self.assertEqual(join(b':a', b'b'), b':a:b')
+        self.assertEqual(join(b':a:', b'b'), b':a:b')
+        self.assertEqual(join(b':a::', b'b'), b':a::b')
+        self.assertEqual(join(b':a', b'::b'), b':a::b')
+        self.assertEqual(join(b'a', b':'), b':a:')
+        self.assertEqual(join(b'a:', b':'), b'a:')
+        self.assertEqual(join(b'a', b''), b':a:')
+        self.assertEqual(join(b'a:', b''), b'a:')
+        self.assertEqual(join(b'', b''), b'')
         self.assertEqual(join(b'', b'a:b'), b'a:b')
+        self.assertEqual(join(b'', b'a', b'b'), b':a:b')
         self.assertEqual(join(b'a:b', b'c'), b'a:b:c')
         self.assertEqual(join(b'a:b', b':c'), b'a:b:c')
         self.assertEqual(join(b'a', b':b', b':c'), b':a:b:c')
+        self.assertEqual(join(b'a', b'b:'), b'b:')
+        self.assertEqual(join(b'a:', b'b:'), b'b:')
 
     def test_splitext(self):
         splitext = macpath.splitext
diff --git a/Lib/test/test_mailbox.py b/Lib/test/test_mailbox.py
index 5e9e30a..0991f74 100644
--- a/Lib/test/test_mailbox.py
+++ b/Lib/test/test_mailbox.py
@@ -300,7 +300,7 @@
 
     def test_iterkeys(self):
         # Get keys using iterkeys()
-        self._check_iteration(self._box.keys, do_keys=True, do_values=False)
+        self._check_iteration(self._box.iterkeys, do_keys=True, do_values=False)
 
     def test_keys(self):
         # Get keys using keys()
@@ -308,7 +308,7 @@
 
     def test_itervalues(self):
         # Get values using itervalues()
-        self._check_iteration(self._box.values, do_keys=False,
+        self._check_iteration(self._box.itervalues, do_keys=False,
                               do_values=True)
 
     def test_iter(self):
@@ -322,7 +322,7 @@
 
     def test_iteritems(self):
         # Get keys and values using iteritems()
-        self._check_iteration(self._box.items, do_keys=True,
+        self._check_iteration(self._box.iteritems, do_keys=True,
                               do_values=True)
 
     def test_items(self):
@@ -564,12 +564,12 @@
         self.assertRaises(NotImplementedError, lambda: box.__delitem__(''))
         self.assertRaises(NotImplementedError, lambda: box.discard(''))
         self.assertRaises(NotImplementedError, lambda: box.__setitem__('', ''))
+        self.assertRaises(NotImplementedError, lambda: box.iterkeys())
         self.assertRaises(NotImplementedError, lambda: box.keys())
-        self.assertRaises(NotImplementedError, lambda: box.keys())
-        self.assertRaises(NotImplementedError, lambda: box.values().__next__())
+        self.assertRaises(NotImplementedError, lambda: box.itervalues().__next__())
         self.assertRaises(NotImplementedError, lambda: box.__iter__().__next__())
         self.assertRaises(NotImplementedError, lambda: box.values())
-        self.assertRaises(NotImplementedError, lambda: box.items().next())
+        self.assertRaises(NotImplementedError, lambda: box.iteritems().__next__())
         self.assertRaises(NotImplementedError, lambda: box.items())
         self.assertRaises(NotImplementedError, lambda: box.get(''))
         self.assertRaises(NotImplementedError, lambda: box.__getitem__(''))
@@ -596,7 +596,7 @@
 
     def setUp(self):
         TestMailbox.setUp(self)
-        if os.name in ('nt', 'os2') or sys.platform == 'cygwin':
+        if (os.name == 'nt') or (sys.platform == 'cygwin'):
             self._box.colon = '!'
 
     def assertMailboxEmpty(self):
@@ -1020,7 +1020,7 @@
         mtime = os.path.getmtime(self._path)
         self._box = self._factory(self._path)
         self.assertEqual(len(self._box), 3)
-        for key in self._box.keys():
+        for key in self._box.iterkeys():
             self.assertIn(self._box.get_string(key), values)
         self._box.close()
         self.assertEqual(mtime, os.path.getmtime(self._path))
diff --git a/Lib/test/test_marshal.py b/Lib/test/test_marshal.py
index 0b14137..068c471 100644
--- a/Lib/test/test_marshal.py
+++ b/Lib/test/test_marshal.py
@@ -22,37 +22,13 @@
 
 class IntTestCase(unittest.TestCase, HelperMixin):
     def test_ints(self):
-        # Test the full range of Python ints.
-        n = sys.maxsize
+        # Test a range of Python ints larger than the machine word size.
+        n = sys.maxsize ** 2
         while n:
             for expected in (-n, n):
                 self.helper(expected)
             n = n >> 1
 
-    def test_int64(self):
-        # Simulate int marshaling on a 64-bit box.  This is most interesting if
-        # we're running the test on a 32-bit box, of course.
-
-        def to_little_endian_string(value, nbytes):
-            b = bytearray()
-            for i in range(nbytes):
-                b.append(value & 0xff)
-                value >>= 8
-            return b
-
-        maxint64 = (1 << 63) - 1
-        minint64 = -maxint64-1
-
-        for base in maxint64, minint64, -maxint64, -(minint64 >> 1):
-            while base:
-                s = b'I' + to_little_endian_string(base, 8)
-                got = marshal.loads(s)
-                self.assertEqual(base, got)
-                if base == -1:  # a fixed-point for shifting right 1
-                    base = 0
-                else:
-                    base >>= 1
-
     def test_bool(self):
         for b in (True, False):
             self.helper(b)
@@ -199,10 +175,14 @@
             except Exception:
                 pass
 
-    def test_loads_recursion(self):
+    def test_loads_2x_code(self):
         s = b'c' + (b'X' * 4*4) + b'{' * 2**20
         self.assertRaises(ValueError, marshal.loads, s)
 
+    def test_loads_recursion(self):
+        s = b'c' + (b'X' * 4*5) + b'{' * 2**20
+        self.assertRaises(ValueError, marshal.loads, s)
+
     def test_recursion_limit(self):
         # Create a deeply nested structure.
         head = last = []
@@ -280,15 +260,20 @@
 
     def test_bad_reader(self):
         class BadReader(io.BytesIO):
-            def read(self, n=-1):
-                b = super().read(n)
+            def readinto(self, buf):
+                n = super().readinto(buf)
                 if n is not None and n > 4:
-                    b += b' ' * 10**6
-                return b
+                    n += 10**6
+                return n
         for value in (1.0, 1j, b'0123456789', '0123456789'):
             self.assertRaises(ValueError, marshal.load,
                               BadReader(marshal.dumps(value)))
 
+    def _test_eof(self):
+        data = marshal.dumps(("hello", "dolly", None))
+        for i in range(len(data)):
+            self.assertRaises(EOFError, marshal.loads, data[0: i])
+
 LARGE_SIZE = 2**31
 pointer_size = 8 if sys.maxsize > 0xFFFFFFFF else 4
 
@@ -333,6 +318,122 @@
     def test_bytearray(self, size):
         self.check_unmarshallable(bytearray(size))
 
+def CollectObjectIDs(ids, obj):
+    """Collect object ids seen in a structure"""
+    if id(obj) in ids:
+        return
+    ids.add(id(obj))
+    if isinstance(obj, (list, tuple, set, frozenset)):
+        for e in obj:
+            CollectObjectIDs(ids, e)
+    elif isinstance(obj, dict):
+        for k, v in obj.items():
+            CollectObjectIDs(ids, k)
+            CollectObjectIDs(ids, v)
+    return len(ids)
+
+class InstancingTestCase(unittest.TestCase, HelperMixin):
+    intobj = 123321
+    floatobj = 1.2345
+    strobj = "abcde"*3
+    dictobj = {"hello":floatobj, "goodbye":floatobj, floatobj:"hello"}
+
+    def helper3(self, rsample, recursive=False, simple=False):
+        #we have two instances
+        sample = (rsample, rsample)
+
+        n0 = CollectObjectIDs(set(), sample)
+
+        s3 = marshal.dumps(sample, 3)
+        n3 = CollectObjectIDs(set(), marshal.loads(s3))
+
+        #same number of instances generated
+        self.assertEqual(n3, n0)
+
+        if not recursive:
+            #can compare with version 2
+            s2 = marshal.dumps(sample, 2)
+            n2 = CollectObjectIDs(set(), marshal.loads(s2))
+            #old format generated more instances
+            self.assertGreater(n2, n0)
+
+            #if complex objects are in there, old format is larger
+            if not simple:
+                self.assertGreater(len(s2), len(s3))
+            else:
+                self.assertGreaterEqual(len(s2), len(s3))
+
+    def testInt(self):
+        self.helper(self.intobj)
+        self.helper3(self.intobj, simple=True)
+
+    def testFloat(self):
+        self.helper(self.floatobj)
+        self.helper3(self.floatobj)
+
+    def testStr(self):
+        self.helper(self.strobj)
+        self.helper3(self.strobj)
+
+    def testDict(self):
+        self.helper(self.dictobj)
+        self.helper3(self.dictobj)
+
+    def testModule(self):
+        with open(__file__, "rb") as f:
+            code = f.read()
+        if __file__.endswith(".py"):
+            code = compile(code, __file__, "exec")
+        self.helper(code)
+        self.helper3(code)
+
+    def testRecursion(self):
+        d = dict(self.dictobj)
+        d["self"] = d
+        self.helper3(d, recursive=True)
+        l = [self.dictobj]
+        l.append(l)
+        self.helper3(l, recursive=True)
+
+class CompatibilityTestCase(unittest.TestCase):
+    def _test(self, version):
+        with open(__file__, "rb") as f:
+            code = f.read()
+        if __file__.endswith(".py"):
+            code = compile(code, __file__, "exec")
+        data = marshal.dumps(code, version)
+        marshal.loads(data)
+
+    def test0To3(self):
+        self._test(0)
+
+    def test1To3(self):
+        self._test(1)
+
+    def test2To3(self):
+        self._test(2)
+
+    def test3To3(self):
+        self._test(3)
+
+class InterningTestCase(unittest.TestCase, HelperMixin):
+    strobj = "this is an interned string"
+    strobj = sys.intern(strobj)
+
+    def testIntern(self):
+        s = marshal.loads(marshal.dumps(self.strobj))
+        self.assertEqual(s, self.strobj)
+        self.assertEqual(id(s), id(self.strobj))
+        s2 = sys.intern(s)
+        self.assertEqual(id(s2), id(s))
+
+    def testNoIntern(self):
+        s = marshal.loads(marshal.dumps(self.strobj, 2))
+        self.assertEqual(s, self.strobj)
+        self.assertNotEqual(id(s), id(self.strobj))
+        s2 = sys.intern(s)
+        self.assertNotEqual(id(s2), id(s))
+
 
 def test_main():
     support.run_unittest(IntTestCase,
diff --git a/Lib/test/test_memoryio.py b/Lib/test/test_memoryio.py
index 4fa9a19..7cae8b2 100644
--- a/Lib/test/test_memoryio.py
+++ b/Lib/test/test_memoryio.py
@@ -366,13 +366,14 @@
         # the module-level.
         import __main__
         PickleTestMemIO.__module__ = '__main__'
+        PickleTestMemIO.__qualname__ = PickleTestMemIO.__name__
         __main__.PickleTestMemIO = PickleTestMemIO
         submemio = PickleTestMemIO(buf, 80)
         submemio.seek(2)
 
         # We only support pickle protocol 2 and onward since we use extended
         # __reduce__ API of PEP 307 to provide pickling support.
-        for proto in range(2, pickle.HIGHEST_PROTOCOL):
+        for proto in range(2, pickle.HIGHEST_PROTOCOL + 1):
             for obj in (memio, submemio):
                 obj2 = pickle.loads(pickle.dumps(obj, protocol=proto))
                 self.assertEqual(obj.getvalue(), obj2.getvalue())
@@ -520,12 +521,12 @@
     def test_relative_seek(self):
         memio = self.ioclass()
 
-        self.assertRaises(IOError, memio.seek, -1, 1)
-        self.assertRaises(IOError, memio.seek, 3, 1)
-        self.assertRaises(IOError, memio.seek, -3, 1)
-        self.assertRaises(IOError, memio.seek, -1, 2)
-        self.assertRaises(IOError, memio.seek, 1, 1)
-        self.assertRaises(IOError, memio.seek, 1, 2)
+        self.assertRaises(OSError, memio.seek, -1, 1)
+        self.assertRaises(OSError, memio.seek, 3, 1)
+        self.assertRaises(OSError, memio.seek, -3, 1)
+        self.assertRaises(OSError, memio.seek, -1, 2)
+        self.assertRaises(OSError, memio.seek, 1, 1)
+        self.assertRaises(OSError, memio.seek, 1, 2)
 
     def test_textio_properties(self):
         memio = self.ioclass()
diff --git a/Lib/test/test_memoryview.py b/Lib/test/test_memoryview.py
index bf0eaad..4bc3133 100644
--- a/Lib/test/test_memoryview.py
+++ b/Lib/test/test_memoryview.py
@@ -352,6 +352,36 @@
             self.assertIs(wr(), None)
             self.assertIs(L[0], b)
 
+    def test_reversed(self):
+        for tp in self._types:
+            b = tp(self._source)
+            m = self._view(b)
+            aslist = list(reversed(m.tolist()))
+            self.assertEqual(list(reversed(m)), aslist)
+            self.assertEqual(list(reversed(m)), list(m[::-1]))
+
+    def test_issue22668(self):
+        a = array.array('H', [256, 256, 256, 256])
+        x = memoryview(a)
+        m = x.cast('B')
+        b = m.cast('H')
+        c = b[0:2]
+        d = memoryview(b)
+
+        del b
+ 
+        self.assertEqual(c[0], 256)
+        self.assertEqual(d[0], 256)
+        self.assertEqual(c.format, "H")
+        self.assertEqual(d.format, "H")
+ 
+        _ = m.cast('I')
+        self.assertEqual(c[0], 256)
+        self.assertEqual(d[0], 256)
+        self.assertEqual(c.format, "H")
+        self.assertEqual(d.format, "H")
+
+
 # Variations on source objects for the buffer: bytes-like objects, then arrays
 # with itemsize > 1.
 # NOTE: support for multi-dimensional objects is unimplemented.
diff --git a/Lib/test/test_minidom.py b/Lib/test/test_minidom.py
index 113c7fd..d06a83d 100644
--- a/Lib/test/test_minidom.py
+++ b/Lib/test/test_minidom.py
@@ -360,6 +360,15 @@
                 and el.getAttribute("spam2") == "bam2")
         dom.unlink()
 
+    def testGetAttrList(self):
+        pass
+
+    def testGetAttrValues(self):
+        pass
+
+    def testGetAttrLength(self):
+        pass
+
     def testGetAttribute(self):
         dom = Document()
         child = dom.appendChild(
@@ -380,6 +389,8 @@
         self.assertEqual(child2.getAttributeNS("http://www.python.org", "missing"),
                          '')
 
+    def testGetAttributeNode(self): pass
+
     def testGetElementsByTagNameNS(self):
         d="""<foo xmlns:minidom='http://pyxml.sf.net/minidom'>
         <minidom:myelem/>
@@ -450,6 +461,8 @@
         self.confirm(str(node) == repr(node))
         dom.unlink()
 
+    def testTextNodeRepr(self): pass
+
     def testWriteXML(self):
         str = '<?xml version="1.0" ?><a b="c"/>'
         dom = parseString(str)
@@ -513,6 +526,14 @@
                 and pi.localName is None
                 and pi.namespaceURI == xml.dom.EMPTY_NAMESPACE)
 
+    def testProcessingInstructionRepr(self): pass
+
+    def testTextRepr(self): pass
+
+    def testWriteText(self): pass
+
+    def testDocumentElement(self): pass
+
     def testTooManyDocumentElements(self):
         doc = parseString("<doc/>")
         elem = doc.createElement("extra")
@@ -521,6 +542,26 @@
         elem.unlink()
         doc.unlink()
 
+    def testCreateElementNS(self): pass
+
+    def testCreateAttributeNS(self): pass
+
+    def testParse(self): pass
+
+    def testParseString(self): pass
+
+    def testComment(self): pass
+
+    def testAttrListItem(self): pass
+
+    def testAttrListItems(self): pass
+
+    def testAttrListItemNS(self): pass
+
+    def testAttrListKeys(self): pass
+
+    def testAttrListKeysNS(self): pass
+
     def testRemoveNamedItem(self):
         doc = parseString("<doc a=''/>")
         e = doc.documentElement
@@ -540,6 +581,30 @@
         self.assertRaises(xml.dom.NotFoundErr, attrs.removeNamedItemNS,
                           "http://xml.python.org/", "b")
 
+    def testAttrListValues(self): pass
+
+    def testAttrListLength(self): pass
+
+    def testAttrList__getitem__(self): pass
+
+    def testAttrList__setitem__(self): pass
+
+    def testSetAttrValueandNodeValue(self): pass
+
+    def testParseElement(self): pass
+
+    def testParseAttributes(self): pass
+
+    def testParseElementNamespaces(self): pass
+
+    def testParseAttributeNamespaces(self): pass
+
+    def testParseProcessingInstructions(self): pass
+
+    def testChildNodes(self): pass
+
+    def testFirstChild(self): pass
+
     def testHasChildNodes(self):
         dom = parseString("<doc><foo/></doc>")
         doc = dom.documentElement
@@ -1403,43 +1468,44 @@
                     "  <!ENTITY ent SYSTEM 'http://xml.python.org/entity'>\n"
                     "]><doc attr='value'> text\n"
                     "<?pi sample?> <!-- comment --> <e/> </doc>")
-        s = pickle.dumps(doc)
-        doc2 = pickle.loads(s)
-        stack = [(doc, doc2)]
-        while stack:
-            n1, n2 = stack.pop()
-            self.confirm(n1.nodeType == n2.nodeType
-                    and len(n1.childNodes) == len(n2.childNodes)
-                    and n1.nodeName == n2.nodeName
-                    and not n1.isSameNode(n2)
-                    and not n2.isSameNode(n1))
-            if n1.nodeType == Node.DOCUMENT_TYPE_NODE:
-                len(n1.entities)
-                len(n2.entities)
-                len(n1.notations)
-                len(n2.notations)
-                self.confirm(len(n1.entities) == len(n2.entities)
-                        and len(n1.notations) == len(n2.notations))
-                for i in range(len(n1.notations)):
-                    # XXX this loop body doesn't seem to be executed?
-                    no1 = n1.notations.item(i)
-                    no2 = n1.notations.item(i)
-                    self.confirm(no1.name == no2.name
-                            and no1.publicId == no2.publicId
-                            and no1.systemId == no2.systemId)
-                    stack.append((no1, no2))
-                for i in range(len(n1.entities)):
-                    e1 = n1.entities.item(i)
-                    e2 = n2.entities.item(i)
-                    self.confirm(e1.notationName == e2.notationName
-                            and e1.publicId == e2.publicId
-                            and e1.systemId == e2.systemId)
-                    stack.append((e1, e2))
-            if n1.nodeType != Node.DOCUMENT_NODE:
-                self.confirm(n1.ownerDocument.isSameNode(doc)
-                        and n2.ownerDocument.isSameNode(doc2))
-            for i in range(len(n1.childNodes)):
-                stack.append((n1.childNodes[i], n2.childNodes[i]))
+        for proto in range(2, pickle.HIGHEST_PROTOCOL + 1):
+            s = pickle.dumps(doc, proto)
+            doc2 = pickle.loads(s)
+            stack = [(doc, doc2)]
+            while stack:
+                n1, n2 = stack.pop()
+                self.confirm(n1.nodeType == n2.nodeType
+                        and len(n1.childNodes) == len(n2.childNodes)
+                        and n1.nodeName == n2.nodeName
+                        and not n1.isSameNode(n2)
+                        and not n2.isSameNode(n1))
+                if n1.nodeType == Node.DOCUMENT_TYPE_NODE:
+                    len(n1.entities)
+                    len(n2.entities)
+                    len(n1.notations)
+                    len(n2.notations)
+                    self.confirm(len(n1.entities) == len(n2.entities)
+                            and len(n1.notations) == len(n2.notations))
+                    for i in range(len(n1.notations)):
+                        # XXX this loop body doesn't seem to be executed?
+                        no1 = n1.notations.item(i)
+                        no2 = n1.notations.item(i)
+                        self.confirm(no1.name == no2.name
+                                and no1.publicId == no2.publicId
+                                and no1.systemId == no2.systemId)
+                        stack.append((no1, no2))
+                    for i in range(len(n1.entities)):
+                        e1 = n1.entities.item(i)
+                        e2 = n2.entities.item(i)
+                        self.confirm(e1.notationName == e2.notationName
+                                and e1.publicId == e2.publicId
+                                and e1.systemId == e2.systemId)
+                        stack.append((e1, e2))
+                if n1.nodeType != Node.DOCUMENT_NODE:
+                    self.confirm(n1.ownerDocument.isSameNode(doc)
+                            and n2.ownerDocument.isSameNode(doc2))
+                for i in range(len(n1.childNodes)):
+                    stack.append((n1.childNodes[i], n2.childNodes[i]))
 
     def testSerializeCommentNodeWithDoubleHyphen(self):
         doc = create_doc_without_doctype()
@@ -1453,6 +1519,10 @@
         doc2 = parseString(doc.toxml())
         self.confirm(doc2.namespaceURI == xml.dom.EMPTY_NAMESPACE)
 
+    def testExceptionOnSpacesInXMLNSValue(self):
+        with self.assertRaisesRegex(ValueError, 'Unsupported syntax'):
+            parseString('<element xmlns:abc="http:abc.com/de f g/hi/j k"><abc:foo /></element>')
+
     def testDocRemoveChild(self):
         doc = parse(tstfile)
         title_tag = doc.documentElement.getElementsByTagName("TITLE")[0]
@@ -1462,6 +1532,13 @@
         num_children_after = len(doc.childNodes)
         self.assertTrue(num_children_after == num_children_before - 1)
 
+    def testProcessingInstructionNameError(self):
+        # wrong variable in .nodeValue property will
+        # lead to "NameError: name 'data' is not defined"
+        doc = parse(tstfile)
+        pi = doc.createProcessingInstruction("y", "z")
+        pi.nodeValue = "crash"
+
 def test_main():
     run_unittest(MinidomTest)
 
diff --git a/Lib/test/test_mmap.py b/Lib/test/test_mmap.py
index 899df8d..4d23f16 100644
--- a/Lib/test/test_mmap.py
+++ b/Lib/test/test_mmap.py
@@ -1,11 +1,12 @@
 from test.support import (TESTFN, run_unittest, import_module, unlink,
-                          requires, _2G, _4G)
+                          requires, _2G, _4G, gc_collect, cpython_only)
 import unittest
 import os
 import re
 import itertools
 import socket
 import sys
+import weakref
 
 # Skip test if we can't import mmap.
 mmap = import_module('mmap')
@@ -245,7 +246,7 @@
 
     def test_bad_file_desc(self):
         # Try opening a bad file descriptor...
-        self.assertRaises(mmap.error, mmap.mmap, -2, 4096)
+        self.assertRaises(OSError, mmap.mmap, -2, 4096)
 
     def test_tougher_find(self):
         # Do a tougher .find() test.  SF bug 515943 pointed out that, in 2.2,
@@ -638,6 +639,15 @@
         m2.close()
         m1.close()
 
+    @cpython_only
+    @unittest.skipUnless(os.name == 'nt', 'requires Windows')
+    def test_sizeof(self):
+        m1 = mmap.mmap(-1, 100)
+        tagname = "foo"
+        m2 = mmap.mmap(-1, 100, tagname=tagname)
+        self.assertEqual(sys.getsizeof(m2),
+                         sys.getsizeof(m1) + len(tagname) + 1)
+
     @unittest.skipUnless(os.name == 'nt', 'requires Windows')
     def test_crasher_on_windows(self):
         # Should not crash (Issue 1733986)
@@ -655,7 +665,7 @@
         m = mmap.mmap(f.fileno(), 0)
         f.close()
         try:
-            m.resize(0) # will raise WindowsError
+            m.resize(0) # will raise OSError
         except:
             pass
         try:
@@ -671,7 +681,7 @@
         # parameters to _get_osfhandle.
         s = socket.socket()
         try:
-            with self.assertRaises(mmap.error):
+            with self.assertRaises(OSError):
                 m = mmap.mmap(s.fileno(), 10)
         finally:
             s.close()
@@ -682,14 +692,23 @@
         self.assertTrue(m.closed)
 
     def test_context_manager_exception(self):
-        # Test that the IOError gets passed through
+        # Test that the OSError gets passed through
         with self.assertRaises(Exception) as exc:
             with mmap.mmap(-1, 10) as m:
-                raise IOError
-        self.assertIsInstance(exc.exception, IOError,
+                raise OSError
+        self.assertIsInstance(exc.exception, OSError,
                               "wrong exception raised in context manager")
         self.assertTrue(m.closed, "context manager failed")
 
+    def test_weakref(self):
+        # Check mmap objects are weakrefable
+        mm = mmap.mmap(-1, 16)
+        wr = weakref.ref(mm)
+        self.assertIs(wr(), mm)
+        del mm
+        gc_collect()
+        self.assertIs(wr(), None)
+
 class LargeMmapTests(unittest.TestCase):
 
     def setUp(self):
@@ -707,7 +726,7 @@
             f.seek(num_zeroes)
             f.write(tail)
             f.flush()
-        except (IOError, OverflowError):
+        except (OSError, OverflowError):
             f.close()
             raise unittest.SkipTest("filesystem does not have largefile support")
         return f
diff --git a/Lib/test/test_module.py b/Lib/test/test_module.py
index e5a2525..1230293 100644
--- a/Lib/test/test_module.py
+++ b/Lib/test/test_module.py
@@ -1,6 +1,8 @@
 # Test the module type
 import unittest
+import weakref
 from test.support import run_unittest, gc_collect
+from test.script_helper import assert_python_ok
 
 import sys
 ModuleType = type(sys)
@@ -33,7 +35,12 @@
         foo = ModuleType("foo")
         self.assertEqual(foo.__name__, "foo")
         self.assertEqual(foo.__doc__, None)
-        self.assertEqual(foo.__dict__, {"__name__": "foo", "__doc__": None})
+        self.assertIs(foo.__loader__, None)
+        self.assertIs(foo.__package__, None)
+        self.assertIs(foo.__spec__, None)
+        self.assertEqual(foo.__dict__, {"__name__": "foo", "__doc__": None,
+                                        "__loader__": None, "__package__": None,
+                                        "__spec__": None})
 
     def test_ascii_docstring(self):
         # ASCII docstring
@@ -41,7 +48,9 @@
         self.assertEqual(foo.__name__, "foo")
         self.assertEqual(foo.__doc__, "foodoc")
         self.assertEqual(foo.__dict__,
-                         {"__name__": "foo", "__doc__": "foodoc"})
+                         {"__name__": "foo", "__doc__": "foodoc",
+                          "__loader__": None, "__package__": None,
+                          "__spec__": None})
 
     def test_unicode_docstring(self):
         # Unicode docstring
@@ -49,7 +58,9 @@
         self.assertEqual(foo.__name__, "foo")
         self.assertEqual(foo.__doc__, "foodoc\u1234")
         self.assertEqual(foo.__dict__,
-                         {"__name__": "foo", "__doc__": "foodoc\u1234"})
+                         {"__name__": "foo", "__doc__": "foodoc\u1234",
+                          "__loader__": None, "__package__": None,
+                          "__spec__": None})
 
     def test_reinit(self):
         # Reinitialization should not replace the __dict__
@@ -61,10 +72,10 @@
         self.assertEqual(foo.__doc__, "foodoc")
         self.assertEqual(foo.bar, 42)
         self.assertEqual(foo.__dict__,
-              {"__name__": "foo", "__doc__": "foodoc", "bar": 42})
+              {"__name__": "foo", "__doc__": "foodoc", "bar": 42,
+               "__loader__": None, "__package__": None, "__spec__": None})
         self.assertTrue(foo.__dict__ is d)
 
-    @unittest.expectedFailure
     def test_dont_clear_dict(self):
         # See issue 7140.
         def f():
@@ -89,6 +100,14 @@
         gc_collect()
         self.assertEqual(destroyed, [1])
 
+    def test_weakref(self):
+        m = ModuleType("foo")
+        wr = weakref.ref(m)
+        self.assertIs(wr(), m)
+        del m
+        gc_collect()
+        self.assertIs(wr(), None)
+
     def test_module_repr_minimal(self):
         # reprs when modules have no __file__, __name__, or __loader__
         m = ModuleType('foo')
@@ -110,13 +129,19 @@
         m.__file__ = '/tmp/foo.py'
         self.assertEqual(repr(m), "<module '?' from '/tmp/foo.py'>")
 
+    def test_module_repr_with_loader_as_None(self):
+        m = ModuleType('foo')
+        assert m.__loader__ is None
+        self.assertEqual(repr(m), "<module 'foo'>")
+
     def test_module_repr_with_bare_loader_but_no_name(self):
         m = ModuleType('foo')
         del m.__name__
         # Yes, a class not an instance.
         m.__loader__ = BareLoader
+        loader_repr = repr(BareLoader)
         self.assertEqual(
-            repr(m), "<module '?' (<class 'test.test_module.BareLoader'>)>")
+            repr(m), "<module '?' ({})>".format(loader_repr))
 
     def test_module_repr_with_full_loader_but_no_name(self):
         # m.__loader__.module_repr() will fail because the module has no
@@ -126,15 +151,17 @@
         del m.__name__
         # Yes, a class not an instance.
         m.__loader__ = FullLoader
+        loader_repr = repr(FullLoader)
         self.assertEqual(
-            repr(m), "<module '?' (<class 'test.test_module.FullLoader'>)>")
+            repr(m), "<module '?' ({})>".format(loader_repr))
 
     def test_module_repr_with_bare_loader(self):
         m = ModuleType('foo')
         # Yes, a class not an instance.
         m.__loader__ = BareLoader
+        module_repr = repr(BareLoader)
         self.assertEqual(
-            repr(m), "<module 'foo' (<class 'test.test_module.BareLoader'>)>")
+            repr(m), "<module 'foo' ({})>".format(module_repr))
 
     def test_module_repr_with_full_loader(self):
         m = ModuleType('foo')
@@ -164,8 +191,25 @@
 
     def test_module_repr_source(self):
         r = repr(unittest)
-        self.assertEqual(r[:25], "<module 'unittest' from '")
-        self.assertEqual(r[-13:], "__init__.py'>")
+        starts_with = "<module 'unittest' from '"
+        ends_with = "__init__.py'>"
+        self.assertEqual(r[:len(starts_with)], starts_with,
+                         '{!r} does not start with {!r}'.format(r, starts_with))
+        self.assertEqual(r[-len(ends_with):], ends_with,
+                         '{!r} does not end with {!r}'.format(r, ends_with))
+
+    def test_module_finalization_at_shutdown(self):
+        # Module globals and builtins should still be available during shutdown
+        rc, out, err = assert_python_ok("-c", "from test import final_a")
+        self.assertFalse(err)
+        lines = out.splitlines()
+        self.assertEqual(set(lines), {
+            b"x = a",
+            b"x = b",
+            b"final_a.x = a",
+            b"final_b.x = b",
+            b"len = len",
+            b"shutil.rmtree = rmtree"})
 
     # frozen and namespace module reprs are tested in importlib.
 
diff --git a/Lib/test/test_modulefinder.py b/Lib/test/test_modulefinder.py
index ed30d6f..4c49e9a 100644
--- a/Lib/test/test_modulefinder.py
+++ b/Lib/test/test_modulefinder.py
@@ -245,11 +245,12 @@
 
 
 class ModuleFinderTest(unittest.TestCase):
-    def _do_test(self, info, report=False):
+    def _do_test(self, info, report=False, debug=0, replace_paths=[]):
         import_this, modules, missing, maybe_missing, source = info
         create_package(source)
         try:
-            mf = modulefinder.ModuleFinder(path=TEST_PATH)
+            mf = modulefinder.ModuleFinder(path=TEST_PATH, debug=debug,
+                                           replace_paths=replace_paths)
             mf.import_hook(import_this)
             if report:
                 mf.report()
@@ -308,9 +309,16 @@
         os.remove(source_path)
         self._do_test(bytecode_test)
 
+    def test_replace_paths(self):
+        old_path = os.path.join(TEST_DIR, 'a', 'module.py')
+        new_path = os.path.join(TEST_DIR, 'a', 'spam.py')
+        with support.captured_stdout() as output:
+            self._do_test(maybe_test, debug=2,
+                          replace_paths=[(old_path, new_path)])
+        output = output.getvalue()
+        expected = "co_filename %r changed to %r" % (old_path, new_path)
+        self.assertIn(expected, output)
 
-def test_main():
-    support.run_unittest(ModuleFinderTest)
 
 if __name__ == "__main__":
     unittest.main()
diff --git a/Lib/test/test_multibytecodec.py b/Lib/test/test_multibytecodec.py
index 6889184..ce267dd 100644
--- a/Lib/test/test_multibytecodec.py
+++ b/Lib/test/test_multibytecodec.py
@@ -80,7 +80,7 @@
         self.assertEqual(encoder.reset(), None)
 
     def test_stateful(self):
-        # jisx0213 encoder is stateful for a few codepoints. eg)
+        # jisx0213 encoder is stateful for a few code points. eg)
         #   U+00E6 => A9DC
         #   U+00E6 U+0300 => ABC4
         #   U+0300 => ABDC
@@ -175,57 +175,28 @@
             support.unlink(TESTFN)
 
 class Test_StreamWriter(unittest.TestCase):
-    if len('\U00012345') == 2: # UCS2
-        def test_gb18030(self):
-            s= io.BytesIO()
-            c = codecs.getwriter('gb18030')(s)
-            c.write('123')
-            self.assertEqual(s.getvalue(), b'123')
-            c.write('\U00012345')
-            self.assertEqual(s.getvalue(), b'123\x907\x959')
-            c.write('\U00012345'[0])
-            self.assertEqual(s.getvalue(), b'123\x907\x959')
-            c.write('\U00012345'[1] + '\U00012345' + '\uac00\u00ac')
-            self.assertEqual(s.getvalue(),
-                    b'123\x907\x959\x907\x959\x907\x959\x827\xcf5\x810\x851')
-            c.write('\U00012345'[0])
-            self.assertEqual(s.getvalue(),
-                    b'123\x907\x959\x907\x959\x907\x959\x827\xcf5\x810\x851')
-            self.assertRaises(UnicodeError, c.reset)
-            self.assertEqual(s.getvalue(),
-                    b'123\x907\x959\x907\x959\x907\x959\x827\xcf5\x810\x851')
+    def test_gb18030(self):
+        s= io.BytesIO()
+        c = codecs.getwriter('gb18030')(s)
+        c.write('123')
+        self.assertEqual(s.getvalue(), b'123')
+        c.write('\U00012345')
+        self.assertEqual(s.getvalue(), b'123\x907\x959')
+        c.write('\uac00\u00ac')
+        self.assertEqual(s.getvalue(),
+                b'123\x907\x959\x827\xcf5\x810\x851')
 
-        def test_utf_8(self):
-            s= io.BytesIO()
-            c = codecs.getwriter('utf-8')(s)
-            c.write('123')
-            self.assertEqual(s.getvalue(), b'123')
-            c.write('\U00012345')
-            self.assertEqual(s.getvalue(), b'123\xf0\x92\x8d\x85')
-
-            # Python utf-8 codec can't buffer surrogate pairs yet.
-            if 0:
-                c.write('\U00012345'[0])
-                self.assertEqual(s.getvalue(), b'123\xf0\x92\x8d\x85')
-                c.write('\U00012345'[1] + '\U00012345' + '\uac00\u00ac')
-                self.assertEqual(s.getvalue(),
-                    b'123\xf0\x92\x8d\x85\xf0\x92\x8d\x85\xf0\x92\x8d\x85'
-                    b'\xea\xb0\x80\xc2\xac')
-                c.write('\U00012345'[0])
-                self.assertEqual(s.getvalue(),
-                    b'123\xf0\x92\x8d\x85\xf0\x92\x8d\x85\xf0\x92\x8d\x85'
-                    b'\xea\xb0\x80\xc2\xac')
-                c.reset()
-                self.assertEqual(s.getvalue(),
-                    b'123\xf0\x92\x8d\x85\xf0\x92\x8d\x85\xf0\x92\x8d\x85'
-                    b'\xea\xb0\x80\xc2\xac\xed\xa0\x88')
-                c.write('\U00012345'[1])
-                self.assertEqual(s.getvalue(),
-                    b'123\xf0\x92\x8d\x85\xf0\x92\x8d\x85\xf0\x92\x8d\x85'
-                    b'\xea\xb0\x80\xc2\xac\xed\xa0\x88\xed\xbd\x85')
-
-    else: # UCS4
-        pass
+    def test_utf_8(self):
+        s= io.BytesIO()
+        c = codecs.getwriter('utf-8')(s)
+        c.write('123')
+        self.assertEqual(s.getvalue(), b'123')
+        c.write('\U00012345')
+        self.assertEqual(s.getvalue(), b'123\xf0\x92\x8d\x85')
+        c.write('\uac00\u00ac')
+        self.assertEqual(s.getvalue(),
+            b'123\xf0\x92\x8d\x85'
+            b'\xea\xb0\x80\xc2\xac')
 
     def test_streamwriter_strwrite(self):
         s = io.BytesIO()
diff --git a/Lib/test/test_multiprocessing_fork.py b/Lib/test/test_multiprocessing_fork.py
new file mode 100644
index 0000000..2bf4e75
--- /dev/null
+++ b/Lib/test/test_multiprocessing_fork.py
@@ -0,0 +1,7 @@
+import unittest
+import test._test_multiprocessing
+
+test._test_multiprocessing.install_tests_in_module_dict(globals(), 'fork')
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Lib/test/test_multiprocessing_forkserver.py b/Lib/test/test_multiprocessing_forkserver.py
new file mode 100644
index 0000000..193a04a
--- /dev/null
+++ b/Lib/test/test_multiprocessing_forkserver.py
@@ -0,0 +1,7 @@
+import unittest
+import test._test_multiprocessing
+
+test._test_multiprocessing.install_tests_in_module_dict(globals(), 'forkserver')
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Lib/test/test_multiprocessing_main_handling.py b/Lib/test/test_multiprocessing_main_handling.py
new file mode 100644
index 0000000..97539e0
--- /dev/null
+++ b/Lib/test/test_multiprocessing_main_handling.py
@@ -0,0 +1,289 @@
+# tests __main__ module handling in multiprocessing
+from test import support
+# Skip tests if _thread or _multiprocessing wasn't built.
+support.import_module('_thread')
+support.import_module('_multiprocessing')
+
+import importlib
+import importlib.machinery
+import zipimport
+import unittest
+import sys
+import os
+import os.path
+import py_compile
+
+from test.script_helper import (
+    make_pkg, make_script, make_zip_pkg, make_zip_script,
+    assert_python_ok, assert_python_failure, temp_dir,
+    spawn_python, kill_python)
+
+# Look up which start methods are available to test
+import multiprocessing
+AVAILABLE_START_METHODS = set(multiprocessing.get_all_start_methods())
+
+# Issue #22332: Skip tests if sem_open implementation is broken.
+support.import_module('multiprocessing.synchronize')
+
+verbose = support.verbose
+
+test_source = """\
+# multiprocessing includes all sorts of shenanigans to make __main__
+# attributes accessible in the subprocess in a pickle compatible way.
+
+# We run the "doesn't work in the interactive interpreter" example from
+# the docs to make sure it *does* work from an executed __main__,
+# regardless of the invocation mechanism
+
+import sys
+import time
+from multiprocessing import Pool, set_start_method
+
+# We use this __main__ defined function in the map call below in order to
+# check that multiprocessing in correctly running the unguarded
+# code in child processes and then making it available as __main__
+def f(x):
+    return x*x
+
+# Check explicit relative imports
+if "check_sibling" in __file__:
+    # We're inside a package and not in a __main__.py file
+    # so make sure explicit relative imports work correctly
+    from . import sibling
+
+if __name__ == '__main__':
+    start_method = sys.argv[1]
+    set_start_method(start_method)
+    p = Pool(5)
+    results = []
+    p.map_async(f, [1, 2, 3], callback=results.extend)
+    deadline = time.time() + 10 # up to 10 s to report the results
+    while not results:
+        time.sleep(0.05)
+        if time.time() > deadline:
+            raise RuntimeError("Timed out waiting for results")
+    results.sort()
+    print(start_method, "->", results)
+"""
+
+test_source_main_skipped_in_children = """\
+# __main__.py files have an implied "if __name__ == '__main__'" so
+# multiprocessing should always skip running them in child processes
+
+# This means we can't use __main__ defined functions in child processes,
+# so we just use "int" as a passthrough operation below
+
+if __name__ != "__main__":
+    raise RuntimeError("Should only be called as __main__!")
+
+import sys
+import time
+from multiprocessing import Pool, set_start_method
+
+start_method = sys.argv[1]
+set_start_method(start_method)
+p = Pool(5)
+results = []
+p.map_async(int, [1, 4, 9], callback=results.extend)
+deadline = time.time() + 10 # up to 10 s to report the results
+while not results:
+    time.sleep(0.05)
+    if time.time() > deadline:
+        raise RuntimeError("Timed out waiting for results")
+results.sort()
+print(start_method, "->", results)
+"""
+
+# These helpers were copied from test_cmd_line_script & tweaked a bit...
+
+def _make_test_script(script_dir, script_basename,
+                      source=test_source, omit_suffix=False):
+    to_return = make_script(script_dir, script_basename,
+                            source, omit_suffix)
+    # Hack to check explicit relative imports
+    if script_basename == "check_sibling":
+        make_script(script_dir, "sibling", "")
+    importlib.invalidate_caches()
+    return to_return
+
+def _make_test_zip_pkg(zip_dir, zip_basename, pkg_name, script_basename,
+                       source=test_source, depth=1):
+    to_return = make_zip_pkg(zip_dir, zip_basename, pkg_name, script_basename,
+                             source, depth)
+    importlib.invalidate_caches()
+    return to_return
+
+# There's no easy way to pass the script directory in to get
+# -m to work (avoiding that is the whole point of making
+# directories and zipfiles executable!)
+# So we fake it for testing purposes with a custom launch script
+launch_source = """\
+import sys, os.path, runpy
+sys.path.insert(0, %s)
+runpy._run_module_as_main(%r)
+"""
+
+def _make_launch_script(script_dir, script_basename, module_name, path=None):
+    if path is None:
+        path = "os.path.dirname(__file__)"
+    else:
+        path = repr(path)
+    source = launch_source % (path, module_name)
+    to_return = make_script(script_dir, script_basename, source)
+    importlib.invalidate_caches()
+    return to_return
+
+class MultiProcessingCmdLineMixin():
+    maxDiff = None # Show full tracebacks on subprocess failure
+
+    def setUp(self):
+        if self.start_method not in AVAILABLE_START_METHODS:
+            self.skipTest("%r start method not available" % self.start_method)
+
+    def _check_output(self, script_name, exit_code, out, err):
+        if verbose > 1:
+            print("Output from test script %r:" % script_name)
+            print(out)
+        self.assertEqual(exit_code, 0)
+        self.assertEqual(err.decode('utf-8'), '')
+        expected_results = "%s -> [1, 4, 9]" % self.start_method
+        self.assertEqual(out.decode('utf-8').strip(), expected_results)
+
+    def _check_script(self, script_name, *cmd_line_switches):
+        if not __debug__:
+            cmd_line_switches += ('-' + 'O' * sys.flags.optimize,)
+        run_args = cmd_line_switches + (script_name, self.start_method)
+        rc, out, err = assert_python_ok(*run_args, __isolated=False)
+        self._check_output(script_name, rc, out, err)
+
+    def test_basic_script(self):
+        with temp_dir() as script_dir:
+            script_name = _make_test_script(script_dir, 'script')
+            self._check_script(script_name)
+
+    def test_basic_script_no_suffix(self):
+        with temp_dir() as script_dir:
+            script_name = _make_test_script(script_dir, 'script',
+                                            omit_suffix=True)
+            self._check_script(script_name)
+
+    def test_ipython_workaround(self):
+        # Some versions of the IPython launch script are missing the
+        # __name__ = "__main__" guard, and multiprocessing has long had
+        # a workaround for that case
+        # See https://github.com/ipython/ipython/issues/4698
+        source = test_source_main_skipped_in_children
+        with temp_dir() as script_dir:
+            script_name = _make_test_script(script_dir, 'ipython',
+                                            source=source)
+            self._check_script(script_name)
+            script_no_suffix = _make_test_script(script_dir, 'ipython',
+                                                 source=source,
+                                                 omit_suffix=True)
+            self._check_script(script_no_suffix)
+
+    def test_script_compiled(self):
+        with temp_dir() as script_dir:
+            script_name = _make_test_script(script_dir, 'script')
+            py_compile.compile(script_name, doraise=True)
+            os.remove(script_name)
+            pyc_file = support.make_legacy_pyc(script_name)
+            self._check_script(pyc_file)
+
+    def test_directory(self):
+        source = self.main_in_children_source
+        with temp_dir() as script_dir:
+            script_name = _make_test_script(script_dir, '__main__',
+                                            source=source)
+            self._check_script(script_dir)
+
+    def test_directory_compiled(self):
+        source = self.main_in_children_source
+        with temp_dir() as script_dir:
+            script_name = _make_test_script(script_dir, '__main__',
+                                            source=source)
+            py_compile.compile(script_name, doraise=True)
+            os.remove(script_name)
+            pyc_file = support.make_legacy_pyc(script_name)
+            self._check_script(script_dir)
+
+    def test_zipfile(self):
+        source = self.main_in_children_source
+        with temp_dir() as script_dir:
+            script_name = _make_test_script(script_dir, '__main__',
+                                            source=source)
+            zip_name, run_name = make_zip_script(script_dir, 'test_zip', script_name)
+            self._check_script(zip_name)
+
+    def test_zipfile_compiled(self):
+        source = self.main_in_children_source
+        with temp_dir() as script_dir:
+            script_name = _make_test_script(script_dir, '__main__',
+                                            source=source)
+            compiled_name = py_compile.compile(script_name, doraise=True)
+            zip_name, run_name = make_zip_script(script_dir, 'test_zip', compiled_name)
+            self._check_script(zip_name)
+
+    def test_module_in_package(self):
+        with temp_dir() as script_dir:
+            pkg_dir = os.path.join(script_dir, 'test_pkg')
+            make_pkg(pkg_dir)
+            script_name = _make_test_script(pkg_dir, 'check_sibling')
+            launch_name = _make_launch_script(script_dir, 'launch',
+                                              'test_pkg.check_sibling')
+            self._check_script(launch_name)
+
+    def test_module_in_package_in_zipfile(self):
+        with temp_dir() as script_dir:
+            zip_name, run_name = _make_test_zip_pkg(script_dir, 'test_zip', 'test_pkg', 'script')
+            launch_name = _make_launch_script(script_dir, 'launch', 'test_pkg.script', zip_name)
+            self._check_script(launch_name)
+
+    def test_module_in_subpackage_in_zipfile(self):
+        with temp_dir() as script_dir:
+            zip_name, run_name = _make_test_zip_pkg(script_dir, 'test_zip', 'test_pkg', 'script', depth=2)
+            launch_name = _make_launch_script(script_dir, 'launch', 'test_pkg.test_pkg.script', zip_name)
+            self._check_script(launch_name)
+
+    def test_package(self):
+        source = self.main_in_children_source
+        with temp_dir() as script_dir:
+            pkg_dir = os.path.join(script_dir, 'test_pkg')
+            make_pkg(pkg_dir)
+            script_name = _make_test_script(pkg_dir, '__main__',
+                                            source=source)
+            launch_name = _make_launch_script(script_dir, 'launch', 'test_pkg')
+            self._check_script(launch_name)
+
+    def test_package_compiled(self):
+        source = self.main_in_children_source
+        with temp_dir() as script_dir:
+            pkg_dir = os.path.join(script_dir, 'test_pkg')
+            make_pkg(pkg_dir)
+            script_name = _make_test_script(pkg_dir, '__main__',
+                                            source=source)
+            compiled_name = py_compile.compile(script_name, doraise=True)
+            os.remove(script_name)
+            pyc_file = support.make_legacy_pyc(script_name)
+            launch_name = _make_launch_script(script_dir, 'launch', 'test_pkg')
+            self._check_script(launch_name)
+
+# Test all supported start methods (setupClass skips as appropriate)
+
+class SpawnCmdLineTest(MultiProcessingCmdLineMixin, unittest.TestCase):
+    start_method = 'spawn'
+    main_in_children_source = test_source_main_skipped_in_children
+
+class ForkCmdLineTest(MultiProcessingCmdLineMixin, unittest.TestCase):
+    start_method = 'fork'
+    main_in_children_source = test_source
+
+class ForkServerCmdLineTest(MultiProcessingCmdLineMixin, unittest.TestCase):
+    start_method = 'forkserver'
+    main_in_children_source = test_source_main_skipped_in_children
+
+def tearDownModule():
+    support.reap_children()
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Lib/test/test_multiprocessing_spawn.py b/Lib/test/test_multiprocessing_spawn.py
new file mode 100644
index 0000000..334ae9e
--- /dev/null
+++ b/Lib/test/test_multiprocessing_spawn.py
@@ -0,0 +1,7 @@
+import unittest
+import test._test_multiprocessing
+
+test._test_multiprocessing.install_tests_in_module_dict(globals(), 'spawn')
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Lib/test/test_nntplib.py b/Lib/test/test_nntplib.py
index 1d52713..fb216c1 100644
--- a/Lib/test/test_nntplib.py
+++ b/Lib/test/test_nntplib.py
@@ -266,7 +266,7 @@
                 return False
             try:
                 server.help()
-            except (socket.error, EOFError):
+            except (OSError, EOFError):
                 return False
             return True
 
@@ -1412,11 +1412,18 @@
     def test_ssl_support(self):
         self.assertTrue(hasattr(nntplib, 'NNTP_SSL'))
 
-def test_main():
-    tests = [MiscTests, NNTPv1Tests, NNTPv2Tests, CapsAfterLoginNNTPv2Tests,
-            SendReaderNNTPv2Tests, NetworkedNNTPTests, NetworkedNNTP_SSLTests]
-    support.run_unittest(*tests)
 
+class PublicAPITests(unittest.TestCase):
+    """Ensures that the correct values are exposed in the public API."""
+
+    def test_module_all_attribute(self):
+        self.assertTrue(hasattr(nntplib, '__all__'))
+        target_api = ['NNTP', 'NNTPError', 'NNTPReplyError',
+                      'NNTPTemporaryError', 'NNTPPermanentError',
+                      'NNTPProtocolError', 'NNTPDataError', 'decode_header']
+        if ssl is not None:
+            target_api.append('NNTP_SSL')
+        self.assertEqual(set(nntplib.__all__), set(target_api))
 
 if __name__ == "__main__":
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_normalization.py b/Lib/test/test_normalization.py
index 28ede34..5dac5db 100644
--- a/Lib/test/test_normalization.py
+++ b/Lib/test/test_normalization.py
@@ -7,7 +7,7 @@
 from unicodedata import normalize, unidata_version
 
 TESTDATAFILE = "NormalizationTest.txt"
-TESTDATAURL = "http://www.unicode.org/Public/" + unidata_version + "/ucd/" + TESTDATAFILE
+TESTDATAURL = "http://www.pythontest.net/unicode/" + unidata_version + "/" + TESTDATAFILE
 
 def check_version(testfile):
     hdr = testfile.readline()
@@ -43,7 +43,7 @@
         try:
             testdata = open_urlresource(TESTDATAURL, encoding="utf-8",
                                         check=check_version)
-        except (IOError, HTTPException):
+        except (OSError, HTTPException):
             self.skipTest("Could not retrieve " + TESTDATAURL)
         self.addCleanup(testdata.close)
         for line in testdata:
diff --git a/Lib/test/test_ntpath.py b/Lib/test/test_ntpath.py
index e9e1d71..c8d84a7 100644
--- a/Lib/test/test_ntpath.py
+++ b/Lib/test/test_ntpath.py
@@ -258,6 +258,41 @@
             check('%spam%bar', '%sbar' % nonascii)
             check('%{}%bar'.format(nonascii), 'ham%sbar' % nonascii)
 
+    def test_expanduser(self):
+        tester('ntpath.expanduser("test")', 'test')
+
+        with support.EnvironmentVarGuard() as env:
+            env.clear()
+            tester('ntpath.expanduser("~test")', '~test')
+
+            env['HOMEPATH'] = 'eric\\idle'
+            env['HOMEDRIVE'] = 'C:\\'
+            tester('ntpath.expanduser("~test")', 'C:\\eric\\test')
+            tester('ntpath.expanduser("~")', 'C:\\eric\\idle')
+
+            del env['HOMEDRIVE']
+            tester('ntpath.expanduser("~test")', 'eric\\test')
+            tester('ntpath.expanduser("~")', 'eric\\idle')
+
+            env.clear()
+            env['USERPROFILE'] = 'C:\\eric\\idle'
+            tester('ntpath.expanduser("~test")', 'C:\\eric\\test')
+            tester('ntpath.expanduser("~")', 'C:\\eric\\idle')
+
+            env.clear()
+            env['HOME'] = 'C:\\idle\\eric'
+            tester('ntpath.expanduser("~test")', 'C:\\idle\\test')
+            tester('ntpath.expanduser("~")', 'C:\\idle\\eric')
+
+            tester('ntpath.expanduser("~test\\foo\\bar")',
+                   'C:\\idle\\test\\foo\\bar')
+            tester('ntpath.expanduser("~test/foo/bar")',
+                   'C:\\idle\\test/foo/bar')
+            tester('ntpath.expanduser("~\\foo\\bar")',
+                   'C:\\idle\\eric\\foo\\bar')
+            tester('ntpath.expanduser("~/foo/bar")',
+                   'C:\\idle\\eric/foo/bar')
+
     def test_abspath(self):
         # ntpath.abspath() can only be used on a system with the "nt" module
         # (reasonably), so we protect this test with "import nt".  This allows
@@ -271,13 +306,14 @@
             self.skipTest('nt module not available')
 
     def test_relpath(self):
-        currentdir = os.path.split(os.getcwd())[-1]
         tester('ntpath.relpath("a")', 'a')
         tester('ntpath.relpath(os.path.abspath("a"))', 'a')
         tester('ntpath.relpath("a/b")', 'a\\b')
         tester('ntpath.relpath("../a/b")', '..\\a\\b')
-        tester('ntpath.relpath("a", "../b")', '..\\'+currentdir+'\\a')
-        tester('ntpath.relpath("a/b", "../c")', '..\\'+currentdir+'\\a\\b')
+        with support.temp_cwd(support.TESTFN) as cwd_dir:
+            currentdir = os.path.basename(cwd_dir)
+            tester('ntpath.relpath("a", "../b")', '..\\'+currentdir+'\\a')
+            tester('ntpath.relpath("a/b", "../c")', '..\\'+currentdir+'\\a\\b')
         tester('ntpath.relpath("a", "b/c")', '..\\..\\a')
         tester('ntpath.relpath("c:/foo/bar/bat", "c:/x/y")', '..\\..\\foo\\bar\\bat')
         tester('ntpath.relpath("//conky/mountpoint/a", "//conky/mountpoint/b/c")', '..\\..\\a')
@@ -306,6 +342,40 @@
                     # dialogs (#4804)
                     ntpath.sameopenfile(-1, -1)
 
+    def test_ismount(self):
+        self.assertTrue(ntpath.ismount("c:\\"))
+        self.assertTrue(ntpath.ismount("C:\\"))
+        self.assertTrue(ntpath.ismount("c:/"))
+        self.assertTrue(ntpath.ismount("C:/"))
+        self.assertTrue(ntpath.ismount("\\\\.\\c:\\"))
+        self.assertTrue(ntpath.ismount("\\\\.\\C:\\"))
+
+        self.assertTrue(ntpath.ismount(b"c:\\"))
+        self.assertTrue(ntpath.ismount(b"C:\\"))
+        self.assertTrue(ntpath.ismount(b"c:/"))
+        self.assertTrue(ntpath.ismount(b"C:/"))
+        self.assertTrue(ntpath.ismount(b"\\\\.\\c:\\"))
+        self.assertTrue(ntpath.ismount(b"\\\\.\\C:\\"))
+
+        with support.temp_dir() as d:
+            self.assertFalse(ntpath.ismount(d))
+
+        if sys.platform == "win32":
+            #
+            # Make sure the current folder isn't the root folder
+            # (or any other volume root). The drive-relative
+            # locations below cannot then refer to mount points
+            #
+            drive, path = ntpath.splitdrive(sys.executable)
+            with support.change_cwd(os.path.dirname(sys.executable)):
+                self.assertFalse(ntpath.ismount(drive.lower()))
+                self.assertFalse(ntpath.ismount(drive.upper()))
+
+            self.assertTrue(ntpath.ismount("\\\\localhost\\c$"))
+            self.assertTrue(ntpath.ismount("\\\\localhost\\c$\\"))
+
+            self.assertTrue(ntpath.ismount(b"\\\\localhost\\c$"))
+            self.assertTrue(ntpath.ismount(b"\\\\localhost\\c$\\"))
 
 class NtCommonTest(test_genericpath.CommonTest, unittest.TestCase):
     pathmodule = ntpath
diff --git a/Lib/test/test_openpty.py b/Lib/test/test_openpty.py
index 6384370..4785107 100644
--- a/Lib/test/test_openpty.py
+++ b/Lib/test/test_openpty.py
@@ -4,7 +4,7 @@
 from test.support import run_unittest
 
 if not hasattr(os, "openpty"):
-    raise unittest.SkipTest("No openpty() available.")
+    raise unittest.SkipTest("os.openpty() not available.")
 
 
 class OpenptyTest(unittest.TestCase):
diff --git a/Lib/test/test_operator.py b/Lib/test/test_operator.py
index fa608b9..ab58a98 100644
--- a/Lib/test/test_operator.py
+++ b/Lib/test/test_operator.py
@@ -1,8 +1,10 @@
-import operator
 import unittest
 
 from test import support
 
+py_operator = support.import_fresh_module('operator', blocked=['_operator'])
+c_operator = support.import_fresh_module('operator', fresh=['_operator'])
+
 class Seq1:
     def __init__(self, lst):
         self.lst = lst
@@ -32,8 +34,9 @@
         return other * self.lst
 
 
-class OperatorTestCase(unittest.TestCase):
+class OperatorTestCase:
     def test_lt(self):
+        operator = self.module
         self.assertRaises(TypeError, operator.lt)
         self.assertRaises(TypeError, operator.lt, 1j, 2j)
         self.assertFalse(operator.lt(1, 0))
@@ -44,6 +47,7 @@
         self.assertTrue(operator.lt(1, 2.0))
 
     def test_le(self):
+        operator = self.module
         self.assertRaises(TypeError, operator.le)
         self.assertRaises(TypeError, operator.le, 1j, 2j)
         self.assertFalse(operator.le(1, 0))
@@ -54,6 +58,7 @@
         self.assertTrue(operator.le(1, 2.0))
 
     def test_eq(self):
+        operator = self.module
         class C(object):
             def __eq__(self, other):
                 raise SyntaxError
@@ -67,6 +72,7 @@
         self.assertFalse(operator.eq(1, 2.0))
 
     def test_ne(self):
+        operator = self.module
         class C(object):
             def __ne__(self, other):
                 raise SyntaxError
@@ -80,6 +86,7 @@
         self.assertTrue(operator.ne(1, 2.0))
 
     def test_ge(self):
+        operator = self.module
         self.assertRaises(TypeError, operator.ge)
         self.assertRaises(TypeError, operator.ge, 1j, 2j)
         self.assertTrue(operator.ge(1, 0))
@@ -90,6 +97,7 @@
         self.assertFalse(operator.ge(1, 2.0))
 
     def test_gt(self):
+        operator = self.module
         self.assertRaises(TypeError, operator.gt)
         self.assertRaises(TypeError, operator.gt, 1j, 2j)
         self.assertTrue(operator.gt(1, 0))
@@ -100,22 +108,26 @@
         self.assertFalse(operator.gt(1, 2.0))
 
     def test_abs(self):
+        operator = self.module
         self.assertRaises(TypeError, operator.abs)
         self.assertRaises(TypeError, operator.abs, None)
         self.assertEqual(operator.abs(-1), 1)
         self.assertEqual(operator.abs(1), 1)
 
     def test_add(self):
+        operator = self.module
         self.assertRaises(TypeError, operator.add)
         self.assertRaises(TypeError, operator.add, None, None)
         self.assertTrue(operator.add(3, 4) == 7)
 
     def test_bitwise_and(self):
+        operator = self.module
         self.assertRaises(TypeError, operator.and_)
         self.assertRaises(TypeError, operator.and_, None, None)
         self.assertTrue(operator.and_(0xf, 0xa) == 0xa)
 
     def test_concat(self):
+        operator = self.module
         self.assertRaises(TypeError, operator.concat)
         self.assertRaises(TypeError, operator.concat, None, None)
         self.assertTrue(operator.concat('py', 'thon') == 'python')
@@ -125,12 +137,14 @@
         self.assertRaises(TypeError, operator.concat, 13, 29)
 
     def test_countOf(self):
+        operator = self.module
         self.assertRaises(TypeError, operator.countOf)
         self.assertRaises(TypeError, operator.countOf, None, None)
         self.assertTrue(operator.countOf([1, 2, 1, 3, 1, 4], 3) == 1)
         self.assertTrue(operator.countOf([1, 2, 1, 3, 1, 4], 5) == 0)
 
     def test_delitem(self):
+        operator = self.module
         a = [4, 3, 2, 1]
         self.assertRaises(TypeError, operator.delitem, a)
         self.assertRaises(TypeError, operator.delitem, a, None)
@@ -138,33 +152,39 @@
         self.assertTrue(a == [4, 2, 1])
 
     def test_floordiv(self):
+        operator = self.module
         self.assertRaises(TypeError, operator.floordiv, 5)
         self.assertRaises(TypeError, operator.floordiv, None, None)
         self.assertTrue(operator.floordiv(5, 2) == 2)
 
     def test_truediv(self):
+        operator = self.module
         self.assertRaises(TypeError, operator.truediv, 5)
         self.assertRaises(TypeError, operator.truediv, None, None)
         self.assertTrue(operator.truediv(5, 2) == 2.5)
 
     def test_getitem(self):
+        operator = self.module
         a = range(10)
         self.assertRaises(TypeError, operator.getitem)
         self.assertRaises(TypeError, operator.getitem, a, None)
         self.assertTrue(operator.getitem(a, 2) == 2)
 
     def test_indexOf(self):
+        operator = self.module
         self.assertRaises(TypeError, operator.indexOf)
         self.assertRaises(TypeError, operator.indexOf, None, None)
         self.assertTrue(operator.indexOf([4, 3, 2, 1], 3) == 1)
         self.assertRaises(ValueError, operator.indexOf, [4, 3, 2, 1], 0)
 
     def test_invert(self):
+        operator = self.module
         self.assertRaises(TypeError, operator.invert)
         self.assertRaises(TypeError, operator.invert, None)
         self.assertEqual(operator.inv(4), -5)
 
     def test_lshift(self):
+        operator = self.module
         self.assertRaises(TypeError, operator.lshift)
         self.assertRaises(TypeError, operator.lshift, None, 42)
         self.assertTrue(operator.lshift(5, 1) == 10)
@@ -172,16 +192,19 @@
         self.assertRaises(ValueError, operator.lshift, 2, -1)
 
     def test_mod(self):
+        operator = self.module
         self.assertRaises(TypeError, operator.mod)
         self.assertRaises(TypeError, operator.mod, None, 42)
         self.assertTrue(operator.mod(5, 2) == 1)
 
     def test_mul(self):
+        operator = self.module
         self.assertRaises(TypeError, operator.mul)
         self.assertRaises(TypeError, operator.mul, None, None)
         self.assertTrue(operator.mul(5, 2) == 10)
 
     def test_neg(self):
+        operator = self.module
         self.assertRaises(TypeError, operator.neg)
         self.assertRaises(TypeError, operator.neg, None)
         self.assertEqual(operator.neg(5), -5)
@@ -190,11 +213,13 @@
         self.assertEqual(operator.neg(-0), 0)
 
     def test_bitwise_or(self):
+        operator = self.module
         self.assertRaises(TypeError, operator.or_)
         self.assertRaises(TypeError, operator.or_, None, None)
         self.assertTrue(operator.or_(0xa, 0x5) == 0xf)
 
     def test_pos(self):
+        operator = self.module
         self.assertRaises(TypeError, operator.pos)
         self.assertRaises(TypeError, operator.pos, None)
         self.assertEqual(operator.pos(5), 5)
@@ -203,14 +228,15 @@
         self.assertEqual(operator.pos(-0), 0)
 
     def test_pow(self):
+        operator = self.module
         self.assertRaises(TypeError, operator.pow)
         self.assertRaises(TypeError, operator.pow, None, None)
         self.assertEqual(operator.pow(3,5), 3**5)
-        self.assertEqual(operator.__pow__(3,5), 3**5)
         self.assertRaises(TypeError, operator.pow, 1)
         self.assertRaises(TypeError, operator.pow, 1, 2, 3)
 
     def test_rshift(self):
+        operator = self.module
         self.assertRaises(TypeError, operator.rshift)
         self.assertRaises(TypeError, operator.rshift, None, 42)
         self.assertTrue(operator.rshift(5, 1) == 2)
@@ -218,12 +244,14 @@
         self.assertRaises(ValueError, operator.rshift, 2, -1)
 
     def test_contains(self):
+        operator = self.module
         self.assertRaises(TypeError, operator.contains)
         self.assertRaises(TypeError, operator.contains, None, None)
         self.assertTrue(operator.contains(range(4), 2))
         self.assertFalse(operator.contains(range(4), 5))
 
     def test_setitem(self):
+        operator = self.module
         a = list(range(3))
         self.assertRaises(TypeError, operator.setitem, a)
         self.assertRaises(TypeError, operator.setitem, a, None, None)
@@ -232,11 +260,13 @@
         self.assertRaises(IndexError, operator.setitem, a, 4, 2)
 
     def test_sub(self):
+        operator = self.module
         self.assertRaises(TypeError, operator.sub)
         self.assertRaises(TypeError, operator.sub, None, None)
         self.assertTrue(operator.sub(5, 2) == 3)
 
     def test_truth(self):
+        operator = self.module
         class C(object):
             def __bool__(self):
                 raise SyntaxError
@@ -248,11 +278,13 @@
         self.assertFalse(operator.truth([]))
 
     def test_bitwise_xor(self):
+        operator = self.module
         self.assertRaises(TypeError, operator.xor)
         self.assertRaises(TypeError, operator.xor, None, None)
         self.assertTrue(operator.xor(0xb, 0xc) == 0x7)
 
     def test_is(self):
+        operator = self.module
         a = b = 'xyzpdq'
         c = a[:3] + b[3:]
         self.assertRaises(TypeError, operator.is_)
@@ -260,6 +292,7 @@
         self.assertFalse(operator.is_(a,c))
 
     def test_is_not(self):
+        operator = self.module
         a = b = 'xyzpdq'
         c = a[:3] + b[3:]
         self.assertRaises(TypeError, operator.is_not)
@@ -267,6 +300,7 @@
         self.assertTrue(operator.is_not(a,c))
 
     def test_attrgetter(self):
+        operator = self.module
         class A:
             pass
         a = A()
@@ -316,6 +350,7 @@
         self.assertEqual(f(a), ('arthur', 'thomas', 'johnson'))
 
     def test_itemgetter(self):
+        operator = self.module
         a = 'ABCDE'
         f = operator.itemgetter(2)
         self.assertEqual(f(a), 'C')
@@ -350,12 +385,15 @@
         self.assertRaises(TypeError, operator.itemgetter(2, 'x', 5), data)
 
     def test_methodcaller(self):
+        operator = self.module
         self.assertRaises(TypeError, operator.methodcaller)
         class A:
             def foo(self, *args, **kwds):
                 return args[0] + args[1]
             def bar(self, f=42):
                 return f
+            def baz(*args, **kwds):
+                return kwds['name'], kwds['self']
         a = A()
         f = operator.methodcaller('foo')
         self.assertRaises(IndexError, f, a)
@@ -366,8 +404,11 @@
         self.assertRaises(TypeError, f, a, a)
         f = operator.methodcaller('bar', f=5)
         self.assertEqual(f(a), 5)
+        f = operator.methodcaller('baz', name='spam', self='eggs')
+        self.assertEqual(f(a), ('spam', 'eggs'))
 
     def test_inplace(self):
+        operator = self.module
         class C(object):
             def __iadd__     (self, other): return "iadd"
             def __iand__     (self, other): return "iand"
@@ -396,37 +437,48 @@
         self.assertEqual(operator.itruediv (c, 5), "itruediv")
         self.assertEqual(operator.ixor     (c, 5), "ixor")
         self.assertEqual(operator.iconcat  (c, c), "iadd")
-        self.assertEqual(operator.__iadd__     (c, 5), "iadd")
-        self.assertEqual(operator.__iand__     (c, 5), "iand")
-        self.assertEqual(operator.__ifloordiv__(c, 5), "ifloordiv")
-        self.assertEqual(operator.__ilshift__  (c, 5), "ilshift")
-        self.assertEqual(operator.__imod__     (c, 5), "imod")
-        self.assertEqual(operator.__imul__     (c, 5), "imul")
-        self.assertEqual(operator.__ior__      (c, 5), "ior")
-        self.assertEqual(operator.__ipow__     (c, 5), "ipow")
-        self.assertEqual(operator.__irshift__  (c, 5), "irshift")
-        self.assertEqual(operator.__isub__     (c, 5), "isub")
-        self.assertEqual(operator.__itruediv__ (c, 5), "itruediv")
-        self.assertEqual(operator.__ixor__     (c, 5), "ixor")
-        self.assertEqual(operator.__iconcat__  (c, c), "iadd")
 
-def test_main(verbose=None):
-    import sys
-    test_classes = (
-        OperatorTestCase,
-    )
+    def test_length_hint(self):
+        operator = self.module
+        class X(object):
+            def __init__(self, value):
+                self.value = value
 
-    support.run_unittest(*test_classes)
+            def __length_hint__(self):
+                if type(self.value) is type:
+                    raise self.value
+                else:
+                    return self.value
 
-    # 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)
+        self.assertEqual(operator.length_hint([], 2), 0)
+        self.assertEqual(operator.length_hint(iter([1, 2, 3])), 3)
+
+        self.assertEqual(operator.length_hint(X(2)), 2)
+        self.assertEqual(operator.length_hint(X(NotImplemented), 4), 4)
+        self.assertEqual(operator.length_hint(X(TypeError), 12), 12)
+        with self.assertRaises(TypeError):
+            operator.length_hint(X("abc"))
+        with self.assertRaises(ValueError):
+            operator.length_hint(X(-2))
+        with self.assertRaises(LookupError):
+            operator.length_hint(X(LookupError))
+
+    def test_dunder_is_original(self):
+        operator = self.module
+
+        names = [name for name in dir(operator) if not name.startswith('_')]
+        for name in names:
+            orig = getattr(operator, name)
+            dunder = getattr(operator, '__' + name.strip('_') + '__', None)
+            if dunder:
+                self.assertIs(dunder, orig)
+
+class PyOperatorTestCase(OperatorTestCase, unittest.TestCase):
+    module = py_operator
+
+@unittest.skipUnless(c_operator, 'requires _operator')
+class COperatorTestCase(OperatorTestCase, unittest.TestCase):
+    module = c_operator
 
 if __name__ == "__main__":
-    test_main(verbose=True)
+    unittest.main()
diff --git a/Lib/test/test_optparse.py b/Lib/test/test_optparse.py
index eaee504..7621c24 100644
--- a/Lib/test/test_optparse.py
+++ b/Lib/test/test_optparse.py
@@ -395,6 +395,7 @@
         self.assertRaises(self.parser.remove_option, ('foo',), None,
                           ValueError, "no such option 'foo'")
 
+    @support.impl_detail('Relies on sys.getrefcount', cpython=True)
     def test_refleak(self):
         # If an OptionParser is carrying around a reference to a large
         # object, various cycles can prevent it from being GC'd in
@@ -730,7 +731,7 @@
     def test_short_and_long_option_split(self):
         self.assertParseOK(["-a", "xyz", "--foo", "bar"],
                            {'a': 'xyz', 'boo': None, 'foo': ["bar"]},
-                           []),
+                           [])
 
     def test_short_option_split_long_option_append(self):
         self.assertParseOK(["--foo=bar", "-b", "123", "--foo", "baz"],
@@ -740,15 +741,15 @@
     def test_short_option_split_one_positional_arg(self):
         self.assertParseOK(["-a", "foo", "bar"],
                            {'a': "foo", 'boo': None, 'foo': None},
-                           ["bar"]),
+                           ["bar"])
 
     def test_short_option_consumes_separator(self):
         self.assertParseOK(["-a", "--", "foo", "bar"],
                            {'a': "--", 'boo': None, 'foo': None},
-                           ["foo", "bar"]),
+                           ["foo", "bar"])
         self.assertParseOK(["-a", "--", "--foo", "bar"],
                            {'a': "--", 'boo': None, 'foo': ["bar"]},
-                           []),
+                           [])
 
     def test_short_option_joined_and_separator(self):
         self.assertParseOK(["-ab", "--", "--foo", "bar"],
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index 56309bf..152ba93 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -24,6 +24,10 @@
 import stat
 import locale
 import codecs
+import decimal
+import fractions
+import pickle
+import sysconfig
 try:
     import threading
 except ImportError:
@@ -32,6 +36,10 @@
     import resource
 except ImportError:
     resource = None
+try:
+    import fcntl
+except ImportError:
+    fcntl = None
 
 from test.script_helper import assert_python_ok
 
@@ -256,6 +264,16 @@
             warnings.simplefilter("ignore", DeprecationWarning)
             self.check_stat_attributes(fname)
 
+    def test_stat_result_pickle(self):
+        result = os.stat(self.fname)
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            p = pickle.dumps(result, proto)
+            self.assertIn(b'stat_result', p)
+            if proto < 4:
+                self.assertIn(b'cos\nstat_result\n', p)
+            unpickled = pickle.loads(p)
+            self.assertEqual(result, unpickled)
+
     @unittest.skipUnless(hasattr(os, 'statvfs'), 'test needs os.statvfs()')
     def test_statvfs_attributes(self):
         try:
@@ -263,7 +281,7 @@
         except OSError as e:
             # On AtheOS, glibc always returns ENOSYS
             if e.errno == errno.ENOSYS:
-                self.skipTest('glibc always returns ENOSYS on AtheOS')
+                self.skipTest('os.statvfs() failed with ENOSYS')
 
         # Make sure direct access works
         self.assertEqual(result.f_bfree, result[3])
@@ -300,6 +318,24 @@
         except TypeError:
             pass
 
+    @unittest.skipUnless(hasattr(os, 'statvfs'),
+                         "need os.statvfs()")
+    def test_statvfs_result_pickle(self):
+        try:
+            result = os.statvfs(self.fname)
+        except OSError as e:
+            # On AtheOS, glibc always returns ENOSYS
+            if e.errno == errno.ENOSYS:
+                self.skipTest('os.statvfs() failed with ENOSYS')
+
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            p = pickle.dumps(result, proto)
+            self.assertIn(b'statvfs_result', p)
+            if proto < 4:
+                self.assertIn(b'cos\nstatvfs_result\n', p)
+            unpickled = pickle.loads(p)
+            self.assertEqual(result, unpickled)
+
     def test_utime_dir(self):
         delta = 1000000
         st = os.stat(support.TESTFN)
@@ -478,9 +514,9 @@
         # Verify that an open file can be stat'ed
         try:
             os.stat(r"c:\pagefile.sys")
-        except WindowsError as e:
-            if e.errno == 2: # file does not exist; cannot run test
-                self.skipTest(r'c:\pagefile.sys does not exist')
+        except FileNotFoundError:
+            self.skipTest(r'c:\pagefile.sys does not exist')
+        except OSError as e:
             self.fail("Could not stat pagefile.sys")
 
     @unittest.skipUnless(sys.platform == "win32", "Win32 specific tests")
@@ -876,6 +912,17 @@
         os.makedirs(path, mode=mode, exist_ok=True)
         os.umask(old_mask)
 
+    @unittest.skipUnless(hasattr(os, 'chown'), 'test needs os.chown')
+    def test_chown_uid_gid_arguments_must_be_index(self):
+        stat = os.stat(support.TESTFN)
+        uid = stat.st_uid
+        gid = stat.st_gid
+        for value in (-1.0, -1j, decimal.Decimal(-1), fractions.Fraction(-2, 2)):
+            self.assertRaises(TypeError, os.chown, support.TESTFN, value, gid)
+            self.assertRaises(TypeError, os.chown, support.TESTFN, uid, value)
+        self.assertIsNone(os.chown(support.TESTFN, uid, gid))
+        self.assertIsNone(os.chown(support.TESTFN, -1, -1))
+
     def test_exist_ok_s_isgid_directory(self):
         path = os.path.join(support.TESTFN, 'dir1')
         S_ISGID = stat.S_ISGID
@@ -1007,6 +1054,12 @@
         data2 = self.get_urandom_subprocess(16)
         self.assertNotEqual(data1, data2)
 
+
+HAVE_GETENTROPY = (sysconfig.get_config_var('HAVE_GETENTROPY') == 1)
+
+@unittest.skipIf(HAVE_GETENTROPY,
+                 "getentropy() does not use a file descriptor")
+class URandomFDTests(unittest.TestCase):
     @unittest.skipUnless(resource, "test requires the resource module")
     def test_urandom_failure(self):
         # Check urandom() failing when it is not able to open /dev/random.
@@ -1030,6 +1083,49 @@
             """
         assert_python_ok('-c', code)
 
+    def test_urandom_fd_closed(self):
+        # Issue #21207: urandom() should reopen its fd to /dev/urandom if
+        # closed.
+        code = """if 1:
+            import os
+            import sys
+            os.urandom(4)
+            os.closerange(3, 256)
+            sys.stdout.buffer.write(os.urandom(4))
+            """
+        rc, out, err = assert_python_ok('-Sc', code)
+
+    def test_urandom_fd_reopened(self):
+        # Issue #21207: urandom() should detect its fd to /dev/urandom
+        # changed to something else, and reopen it.
+        with open(support.TESTFN, 'wb') as f:
+            f.write(b"x" * 256)
+        self.addCleanup(os.unlink, support.TESTFN)
+        code = """if 1:
+            import os
+            import sys
+            os.urandom(4)
+            for fd in range(3, 256):
+                try:
+                    os.close(fd)
+                except OSError:
+                    pass
+                else:
+                    # Found the urandom fd (XXX hopefully)
+                    break
+            os.closerange(3, 256)
+            with open({TESTFN!r}, 'rb') as f:
+                os.dup2(f.fileno(), fd)
+                sys.stdout.buffer.write(os.urandom(4))
+                sys.stdout.buffer.write(os.urandom(4))
+            """.format(TESTFN=support.TESTFN)
+        rc, out, err = assert_python_ok('-Sc', code)
+        self.assertEqual(len(out), 8)
+        self.assertNotEqual(out[0:4], out[4:8])
+        rc, out2, err2 = assert_python_ok('-Sc', code)
+        self.assertEqual(len(out2), 8)
+        self.assertNotEqual(out2, out)
+
 
 @contextlib.contextmanager
 def _execvpe_mockup(defpath=None):
@@ -1132,27 +1228,27 @@
 @unittest.skipUnless(sys.platform == "win32", "Win32 specific tests")
 class Win32ErrorTests(unittest.TestCase):
     def test_rename(self):
-        self.assertRaises(WindowsError, os.rename, support.TESTFN, support.TESTFN+".bak")
+        self.assertRaises(OSError, os.rename, support.TESTFN, support.TESTFN+".bak")
 
     def test_remove(self):
-        self.assertRaises(WindowsError, os.remove, support.TESTFN)
+        self.assertRaises(OSError, os.remove, support.TESTFN)
 
     def test_chdir(self):
-        self.assertRaises(WindowsError, os.chdir, support.TESTFN)
+        self.assertRaises(OSError, os.chdir, support.TESTFN)
 
     def test_mkdir(self):
         f = open(support.TESTFN, "w")
         try:
-            self.assertRaises(WindowsError, os.mkdir, support.TESTFN)
+            self.assertRaises(OSError, os.mkdir, support.TESTFN)
         finally:
             f.close()
             os.unlink(support.TESTFN)
 
     def test_utime(self):
-        self.assertRaises(WindowsError, os.utime, support.TESTFN, None)
+        self.assertRaises(OSError, os.utime, support.TESTFN, None)
 
     def test_chmod(self):
-        self.assertRaises(WindowsError, os.chmod, support.TESTFN, 0)
+        self.assertRaises(OSError, os.chmod, support.TESTFN, 0)
 
 class TestInvalidFD(unittest.TestCase):
     singles = ["fchdir", "dup", "fdopen", "fdatasync", "fstat",
@@ -1286,41 +1382,57 @@
     @unittest.skipUnless(hasattr(os, 'setuid'), 'test needs os.setuid()')
     def test_setuid(self):
         if os.getuid() != 0:
-            self.assertRaises(os.error, os.setuid, 0)
+            self.assertRaises(OSError, os.setuid, 0)
         self.assertRaises(OverflowError, os.setuid, 1<<32)
 
     @unittest.skipUnless(hasattr(os, 'setgid'), 'test needs os.setgid()')
     def test_setgid(self):
         if os.getuid() != 0 and not HAVE_WHEEL_GROUP:
-            self.assertRaises(os.error, os.setgid, 0)
+            self.assertRaises(OSError, os.setgid, 0)
         self.assertRaises(OverflowError, os.setgid, 1<<32)
 
     @unittest.skipUnless(hasattr(os, 'seteuid'), 'test needs os.seteuid()')
     def test_seteuid(self):
         if os.getuid() != 0:
-            self.assertRaises(os.error, os.seteuid, 0)
+            self.assertRaises(OSError, os.seteuid, 0)
         self.assertRaises(OverflowError, os.seteuid, 1<<32)
 
     @unittest.skipUnless(hasattr(os, 'setegid'), 'test needs os.setegid()')
     def test_setegid(self):
         if os.getuid() != 0 and not HAVE_WHEEL_GROUP:
-            self.assertRaises(os.error, os.setegid, 0)
+            self.assertRaises(OSError, os.setegid, 0)
         self.assertRaises(OverflowError, os.setegid, 1<<32)
 
     @unittest.skipUnless(hasattr(os, 'setreuid'), 'test needs os.setreuid()')
     def test_setreuid(self):
         if os.getuid() != 0:
-            self.assertRaises(os.error, os.setreuid, 0, 0)
+            self.assertRaises(OSError, os.setreuid, 0, 0)
         self.assertRaises(OverflowError, os.setreuid, 1<<32, 0)
         self.assertRaises(OverflowError, os.setreuid, 0, 1<<32)
 
+    @unittest.skipUnless(hasattr(os, 'setreuid'), 'test needs os.setreuid()')
+    def test_setreuid_neg1(self):
+        # Needs to accept -1.  We run this in a subprocess to avoid
+        # altering the test runner's process state (issue8045).
+        subprocess.check_call([
+                sys.executable, '-c',
+                'import os,sys;os.setreuid(-1,-1);sys.exit(0)'])
+
     @unittest.skipUnless(hasattr(os, 'setregid'), 'test needs os.setregid()')
     def test_setregid(self):
         if os.getuid() != 0 and not HAVE_WHEEL_GROUP:
-            self.assertRaises(os.error, os.setregid, 0, 0)
+            self.assertRaises(OSError, os.setregid, 0, 0)
         self.assertRaises(OverflowError, os.setregid, 1<<32, 0)
         self.assertRaises(OverflowError, os.setregid, 0, 1<<32)
 
+    @unittest.skipUnless(hasattr(os, 'setregid'), 'test needs os.setregid()')
+    def test_setregid_neg1(self):
+        # Needs to accept -1.  We run this in a subprocess to avoid
+        # altering the test runner's process state (issue8045).
+        subprocess.check_call([
+                sys.executable, '-c',
+                'import os,sys;os.setregid(-1,-1);sys.exit(0)'])
+
 @unittest.skipIf(sys.platform == "win32", "Posix specific tests")
 class Pep383Tests(unittest.TestCase):
     def setUp(self):
@@ -1510,6 +1622,52 @@
 
 
 @unittest.skipUnless(sys.platform == "win32", "Win32 specific tests")
+class Win32ListdirTests(unittest.TestCase):
+    """Test listdir on Windows."""
+
+    def setUp(self):
+        self.created_paths = []
+        for i in range(2):
+            dir_name = 'SUB%d' % i
+            dir_path = os.path.join(support.TESTFN, dir_name)
+            file_name = 'FILE%d' % i
+            file_path = os.path.join(support.TESTFN, file_name)
+            os.makedirs(dir_path)
+            with open(file_path, 'w') as f:
+                f.write("I'm %s and proud of it. Blame test_os.\n" % file_path)
+            self.created_paths.extend([dir_name, file_name])
+        self.created_paths.sort()
+
+    def tearDown(self):
+        shutil.rmtree(support.TESTFN)
+
+    def test_listdir_no_extended_path(self):
+        """Test when the path is not an "extended" path."""
+        # unicode
+        self.assertEqual(
+                sorted(os.listdir(support.TESTFN)),
+                self.created_paths)
+        # bytes
+        self.assertEqual(
+                sorted(os.listdir(os.fsencode(support.TESTFN))),
+                [os.fsencode(path) for path in self.created_paths])
+
+    def test_listdir_extended_path(self):
+        """Test when the path starts with '\\\\?\\'."""
+        # See: http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#maxpath
+        # unicode
+        path = '\\\\?\\' + os.path.abspath(support.TESTFN)
+        self.assertEqual(
+                sorted(os.listdir(path)),
+                self.created_paths)
+        # bytes
+        path = b'\\\\?\\' + os.fsencode(os.path.abspath(support.TESTFN))
+        self.assertEqual(
+                sorted(os.listdir(path)),
+                [os.fsencode(path) for path in self.created_paths])
+
+
+@unittest.skipUnless(sys.platform == "win32", "Win32 specific tests")
 @support.skip_unless_symlink
 class Win32SymlinkTests(unittest.TestCase):
     filelink = 'filelinktest'
@@ -2174,6 +2332,197 @@
         self.assertEqual(expected, actual)
 
 
+class OSErrorTests(unittest.TestCase):
+    def setUp(self):
+        class Str(str):
+            pass
+
+        self.bytes_filenames = []
+        self.unicode_filenames = []
+        if support.TESTFN_UNENCODABLE is not None:
+            decoded = support.TESTFN_UNENCODABLE
+        else:
+            decoded = support.TESTFN
+        self.unicode_filenames.append(decoded)
+        self.unicode_filenames.append(Str(decoded))
+        if support.TESTFN_UNDECODABLE is not None:
+            encoded = support.TESTFN_UNDECODABLE
+        else:
+            encoded = os.fsencode(support.TESTFN)
+        self.bytes_filenames.append(encoded)
+        self.bytes_filenames.append(memoryview(encoded))
+
+        self.filenames = self.bytes_filenames + self.unicode_filenames
+
+    def test_oserror_filename(self):
+        funcs = [
+            (self.filenames, os.chdir,),
+            (self.filenames, os.chmod, 0o777),
+            (self.filenames, os.lstat,),
+            (self.filenames, os.open, os.O_RDONLY),
+            (self.filenames, os.rmdir,),
+            (self.filenames, os.stat,),
+            (self.filenames, os.unlink,),
+        ]
+        if sys.platform == "win32":
+            funcs.extend((
+                (self.bytes_filenames, os.rename, b"dst"),
+                (self.bytes_filenames, os.replace, b"dst"),
+                (self.unicode_filenames, os.rename, "dst"),
+                (self.unicode_filenames, os.replace, "dst"),
+                # Issue #16414: Don't test undecodable names with listdir()
+                # because of a Windows bug.
+                #
+                # With the ANSI code page 932, os.listdir(b'\xe7') return an
+                # empty list (instead of failing), whereas os.listdir(b'\xff')
+                # raises a FileNotFoundError. It looks like a Windows bug:
+                # b'\xe7' directory does not exist, FindFirstFileA(b'\xe7')
+                # fails with ERROR_FILE_NOT_FOUND (2), instead of
+                # ERROR_PATH_NOT_FOUND (3).
+                (self.unicode_filenames, os.listdir,),
+            ))
+        else:
+            funcs.extend((
+                (self.filenames, os.listdir,),
+                (self.filenames, os.rename, "dst"),
+                (self.filenames, os.replace, "dst"),
+            ))
+        if hasattr(os, "chown"):
+            funcs.append((self.filenames, os.chown, 0, 0))
+        if hasattr(os, "lchown"):
+            funcs.append((self.filenames, os.lchown, 0, 0))
+        if hasattr(os, "truncate"):
+            funcs.append((self.filenames, os.truncate, 0))
+        if hasattr(os, "chflags"):
+            funcs.append((self.filenames, os.chflags, 0))
+        if hasattr(os, "lchflags"):
+            funcs.append((self.filenames, os.lchflags, 0))
+        if hasattr(os, "chroot"):
+            funcs.append((self.filenames, os.chroot,))
+        if hasattr(os, "link"):
+            if sys.platform == "win32":
+                funcs.append((self.bytes_filenames, os.link, b"dst"))
+                funcs.append((self.unicode_filenames, os.link, "dst"))
+            else:
+                funcs.append((self.filenames, os.link, "dst"))
+        if hasattr(os, "listxattr"):
+            funcs.extend((
+                (self.filenames, os.listxattr,),
+                (self.filenames, os.getxattr, "user.test"),
+                (self.filenames, os.setxattr, "user.test", b'user'),
+                (self.filenames, os.removexattr, "user.test"),
+            ))
+        if hasattr(os, "lchmod"):
+            funcs.append((self.filenames, os.lchmod, 0o777))
+        if hasattr(os, "readlink"):
+            if sys.platform == "win32":
+                funcs.append((self.unicode_filenames, os.readlink,))
+            else:
+                funcs.append((self.filenames, os.readlink,))
+
+        for filenames, func, *func_args in funcs:
+            for name in filenames:
+                try:
+                    func(name, *func_args)
+                except OSError as err:
+                    self.assertIs(err.filename, name)
+                else:
+                    self.fail("No exception thrown by {}".format(func))
+
+class CPUCountTests(unittest.TestCase):
+    def test_cpu_count(self):
+        cpus = os.cpu_count()
+        if cpus is not None:
+            self.assertIsInstance(cpus, int)
+            self.assertGreater(cpus, 0)
+        else:
+            self.skipTest("Could not determine the number of CPUs")
+
+
+class FDInheritanceTests(unittest.TestCase):
+    def test_get_set_inheritable(self):
+        fd = os.open(__file__, os.O_RDONLY)
+        self.addCleanup(os.close, fd)
+        self.assertEqual(os.get_inheritable(fd), False)
+
+        os.set_inheritable(fd, True)
+        self.assertEqual(os.get_inheritable(fd), True)
+
+    @unittest.skipIf(fcntl is None, "need fcntl")
+    def test_get_inheritable_cloexec(self):
+        fd = os.open(__file__, os.O_RDONLY)
+        self.addCleanup(os.close, fd)
+        self.assertEqual(os.get_inheritable(fd), False)
+
+        # clear FD_CLOEXEC flag
+        flags = fcntl.fcntl(fd, fcntl.F_GETFD)
+        flags &= ~fcntl.FD_CLOEXEC
+        fcntl.fcntl(fd, fcntl.F_SETFD, flags)
+
+        self.assertEqual(os.get_inheritable(fd), True)
+
+    @unittest.skipIf(fcntl is None, "need fcntl")
+    def test_set_inheritable_cloexec(self):
+        fd = os.open(__file__, os.O_RDONLY)
+        self.addCleanup(os.close, fd)
+        self.assertEqual(fcntl.fcntl(fd, fcntl.F_GETFD) & fcntl.FD_CLOEXEC,
+                         fcntl.FD_CLOEXEC)
+
+        os.set_inheritable(fd, True)
+        self.assertEqual(fcntl.fcntl(fd, fcntl.F_GETFD) & fcntl.FD_CLOEXEC,
+                         0)
+
+    def test_open(self):
+        fd = os.open(__file__, os.O_RDONLY)
+        self.addCleanup(os.close, fd)
+        self.assertEqual(os.get_inheritable(fd), False)
+
+    @unittest.skipUnless(hasattr(os, 'pipe'), "need os.pipe()")
+    def test_pipe(self):
+        rfd, wfd = os.pipe()
+        self.addCleanup(os.close, rfd)
+        self.addCleanup(os.close, wfd)
+        self.assertEqual(os.get_inheritable(rfd), False)
+        self.assertEqual(os.get_inheritable(wfd), False)
+
+    def test_dup(self):
+        fd1 = os.open(__file__, os.O_RDONLY)
+        self.addCleanup(os.close, fd1)
+
+        fd2 = os.dup(fd1)
+        self.addCleanup(os.close, fd2)
+        self.assertEqual(os.get_inheritable(fd2), False)
+
+    @unittest.skipUnless(hasattr(os, 'dup2'), "need os.dup2()")
+    def test_dup2(self):
+        fd = os.open(__file__, os.O_RDONLY)
+        self.addCleanup(os.close, fd)
+
+        # inheritable by default
+        fd2 = os.open(__file__, os.O_RDONLY)
+        try:
+            os.dup2(fd, fd2)
+            self.assertEqual(os.get_inheritable(fd2), True)
+        finally:
+            os.close(fd2)
+
+        # force non-inheritable
+        fd3 = os.open(__file__, os.O_RDONLY)
+        try:
+            os.dup2(fd, fd3, inheritable=False)
+            self.assertEqual(os.get_inheritable(fd3), False)
+        finally:
+            os.close(fd3)
+
+    @unittest.skipUnless(hasattr(os, 'openpty'), "need os.openpty()")
+    def test_openpty(self):
+        master_fd, slave_fd = os.openpty()
+        self.addCleanup(os.close, master_fd)
+        self.addCleanup(os.close, slave_fd)
+        self.assertEqual(os.get_inheritable(master_fd), False)
+        self.assertEqual(os.get_inheritable(slave_fd), False)
+
+
 @support.reap_threads
 def test_main():
     support.run_unittest(
@@ -2191,6 +2540,7 @@
         PosixUidGidTests,
         Pep383Tests,
         Win32KillTests,
+        Win32ListdirTests,
         Win32SymlinkTests,
         NonLocalSymlinkTests,
         FSEncodingTests,
@@ -2203,7 +2553,10 @@
         ExtendedAttributeTests,
         Win32DeprecatedBytesAPI,
         TermsizeTests,
+        OSErrorTests,
         RemoveDirsTests,
+        CPUCountTests,
+        FDInheritanceTests,
     )
 
 if __name__ == "__main__":
diff --git a/Lib/test/test_ossaudiodev.py b/Lib/test/test_ossaudiodev.py
index 3908a05..c9e2a24 100644
--- a/Lib/test/test_ossaudiodev.py
+++ b/Lib/test/test_ossaudiodev.py
@@ -44,7 +44,7 @@
     def play_sound_file(self, data, rate, ssize, nchannels):
         try:
             dsp = ossaudiodev.open('w')
-        except IOError as msg:
+        except OSError as msg:
             if msg.args[0] in (errno.EACCES, errno.ENOENT,
                                errno.ENODEV, errno.EBUSY):
                 raise unittest.SkipTest(msg)
@@ -190,7 +190,7 @@
 def test_main():
     try:
         dsp = ossaudiodev.open('w')
-    except (ossaudiodev.error, IOError) as msg:
+    except (ossaudiodev.error, OSError) as msg:
         if msg.args[0] in (errno.EACCES, errno.ENOENT,
                            errno.ENODEV, errno.EBUSY):
             raise unittest.SkipTest(msg)
diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py
new file mode 100644
index 0000000..ab88c34
--- /dev/null
+++ b/Lib/test/test_pathlib.py
@@ -0,0 +1,1894 @@
+import collections
+import io
+import os
+import errno
+import pathlib
+import pickle
+import shutil
+import socket
+import stat
+import sys
+import tempfile
+import unittest
+from contextlib import contextmanager
+
+from test import support
+TESTFN = support.TESTFN
+
+try:
+    import grp, pwd
+except ImportError:
+    grp = pwd = None
+
+
+class _BaseFlavourTest(object):
+
+    def _check_parse_parts(self, arg, expected):
+        f = self.flavour.parse_parts
+        sep = self.flavour.sep
+        altsep = self.flavour.altsep
+        actual = f([x.replace('/', sep) for x in arg])
+        self.assertEqual(actual, expected)
+        if altsep:
+            actual = f([x.replace('/', altsep) for x in arg])
+            self.assertEqual(actual, expected)
+
+    def test_parse_parts_common(self):
+        check = self._check_parse_parts
+        sep = self.flavour.sep
+        # Unanchored parts
+        check([],                   ('', '', []))
+        check(['a'],                ('', '', ['a']))
+        check(['a/'],               ('', '', ['a']))
+        check(['a', 'b'],           ('', '', ['a', 'b']))
+        # Expansion
+        check(['a/b'],              ('', '', ['a', 'b']))
+        check(['a/b/'],             ('', '', ['a', 'b']))
+        check(['a', 'b/c', 'd'],    ('', '', ['a', 'b', 'c', 'd']))
+        # Collapsing and stripping excess slashes
+        check(['a', 'b//c', 'd'],   ('', '', ['a', 'b', 'c', 'd']))
+        check(['a', 'b/c/', 'd'],   ('', '', ['a', 'b', 'c', 'd']))
+        # Eliminating standalone dots
+        check(['.'],                ('', '', []))
+        check(['.', '.', 'b'],      ('', '', ['b']))
+        check(['a', '.', 'b'],      ('', '', ['a', 'b']))
+        check(['a', '.', '.'],      ('', '', ['a']))
+        # The first part is anchored
+        check(['/a/b'],             ('', sep, [sep, 'a', 'b']))
+        check(['/a', 'b'],          ('', sep, [sep, 'a', 'b']))
+        check(['/a/', 'b'],         ('', sep, [sep, 'a', 'b']))
+        # Ignoring parts before an anchored part
+        check(['a', '/b', 'c'],     ('', sep, [sep, 'b', 'c']))
+        check(['a', '/b', '/c'],    ('', sep, [sep, 'c']))
+
+
+class PosixFlavourTest(_BaseFlavourTest, unittest.TestCase):
+    flavour = pathlib._posix_flavour
+
+    def test_parse_parts(self):
+        check = self._check_parse_parts
+        # Collapsing of excess leading slashes, except for the double-slash
+        # special case.
+        check(['//a', 'b'],             ('', '//', ['//', 'a', 'b']))
+        check(['///a', 'b'],            ('', '/', ['/', 'a', 'b']))
+        check(['////a', 'b'],           ('', '/', ['/', 'a', 'b']))
+        # Paths which look like NT paths aren't treated specially
+        check(['c:a'],                  ('', '', ['c:a']))
+        check(['c:\\a'],                ('', '', ['c:\\a']))
+        check(['\\a'],                  ('', '', ['\\a']))
+
+    def test_splitroot(self):
+        f = self.flavour.splitroot
+        self.assertEqual(f(''), ('', '', ''))
+        self.assertEqual(f('a'), ('', '', 'a'))
+        self.assertEqual(f('a/b'), ('', '', 'a/b'))
+        self.assertEqual(f('a/b/'), ('', '', 'a/b/'))
+        self.assertEqual(f('/a'), ('', '/', 'a'))
+        self.assertEqual(f('/a/b'), ('', '/', 'a/b'))
+        self.assertEqual(f('/a/b/'), ('', '/', 'a/b/'))
+        # The root is collapsed when there are redundant slashes
+        # except when there are exactly two leading slashes, which
+        # is a special case in POSIX.
+        self.assertEqual(f('//a'), ('', '//', 'a'))
+        self.assertEqual(f('///a'), ('', '/', 'a'))
+        self.assertEqual(f('///a/b'), ('', '/', 'a/b'))
+        # Paths which look like NT paths aren't treated specially
+        self.assertEqual(f('c:/a/b'), ('', '', 'c:/a/b'))
+        self.assertEqual(f('\\/a/b'), ('', '', '\\/a/b'))
+        self.assertEqual(f('\\a\\b'), ('', '', '\\a\\b'))
+
+
+class NTFlavourTest(_BaseFlavourTest, unittest.TestCase):
+    flavour = pathlib._windows_flavour
+
+    def test_parse_parts(self):
+        check = self._check_parse_parts
+        # First part is anchored
+        check(['c:'],                   ('c:', '', ['c:']))
+        check(['c:\\'],                 ('c:', '\\', ['c:\\']))
+        check(['\\'],                   ('', '\\', ['\\']))
+        check(['c:a'],                  ('c:', '', ['c:', 'a']))
+        check(['c:\\a'],                ('c:', '\\', ['c:\\', 'a']))
+        check(['\\a'],                  ('', '\\', ['\\', 'a']))
+        # UNC paths
+        check(['\\\\a\\b'],             ('\\\\a\\b', '\\', ['\\\\a\\b\\']))
+        check(['\\\\a\\b\\'],           ('\\\\a\\b', '\\', ['\\\\a\\b\\']))
+        check(['\\\\a\\b\\c'],          ('\\\\a\\b', '\\', ['\\\\a\\b\\', 'c']))
+        # Second part is anchored, so that the first part is ignored
+        check(['a', 'Z:b', 'c'],        ('Z:', '', ['Z:', 'b', 'c']))
+        check(['a', 'Z:\\b', 'c'],      ('Z:', '\\', ['Z:\\', 'b', 'c']))
+        check(['a', '\\b', 'c'],        ('', '\\', ['\\', 'b', 'c']))
+        # UNC paths
+        check(['a', '\\\\b\\c', 'd'],   ('\\\\b\\c', '\\', ['\\\\b\\c\\', 'd']))
+        # Collapsing and stripping excess slashes
+        check(['a', 'Z:\\\\b\\\\c\\', 'd\\'], ('Z:', '\\', ['Z:\\', 'b', 'c', 'd']))
+        # UNC paths
+        check(['a', '\\\\b\\c\\\\', 'd'], ('\\\\b\\c', '\\', ['\\\\b\\c\\', 'd']))
+        # Extended paths
+        check(['\\\\?\\c:\\'],          ('\\\\?\\c:', '\\', ['\\\\?\\c:\\']))
+        check(['\\\\?\\c:\\a'],         ('\\\\?\\c:', '\\', ['\\\\?\\c:\\', 'a']))
+        # Extended UNC paths (format is "\\?\UNC\server\share")
+        check(['\\\\?\\UNC\\b\\c'],     ('\\\\?\\UNC\\b\\c', '\\', ['\\\\?\\UNC\\b\\c\\']))
+        check(['\\\\?\\UNC\\b\\c\\d'],  ('\\\\?\\UNC\\b\\c', '\\', ['\\\\?\\UNC\\b\\c\\', 'd']))
+
+    def test_splitroot(self):
+        f = self.flavour.splitroot
+        self.assertEqual(f(''), ('', '', ''))
+        self.assertEqual(f('a'), ('', '', 'a'))
+        self.assertEqual(f('a\\b'), ('', '', 'a\\b'))
+        self.assertEqual(f('\\a'), ('', '\\', 'a'))
+        self.assertEqual(f('\\a\\b'), ('', '\\', 'a\\b'))
+        self.assertEqual(f('c:a\\b'), ('c:', '', 'a\\b'))
+        self.assertEqual(f('c:\\a\\b'), ('c:', '\\', 'a\\b'))
+        # Redundant slashes in the root are collapsed
+        self.assertEqual(f('\\\\a'), ('', '\\', 'a'))
+        self.assertEqual(f('\\\\\\a/b'), ('', '\\', 'a/b'))
+        self.assertEqual(f('c:\\\\a'), ('c:', '\\', 'a'))
+        self.assertEqual(f('c:\\\\\\a/b'), ('c:', '\\', 'a/b'))
+        # Valid UNC paths
+        self.assertEqual(f('\\\\a\\b'), ('\\\\a\\b', '\\', ''))
+        self.assertEqual(f('\\\\a\\b\\'), ('\\\\a\\b', '\\', ''))
+        self.assertEqual(f('\\\\a\\b\\c\\d'), ('\\\\a\\b', '\\', 'c\\d'))
+        # These are non-UNC paths (according to ntpath.py and test_ntpath)
+        # However, command.com says such paths are invalid, so it's
+        # difficult to know what the right semantics are
+        self.assertEqual(f('\\\\\\a\\b'), ('', '\\', 'a\\b'))
+        self.assertEqual(f('\\\\a'), ('', '\\', 'a'))
+
+
+#
+# Tests for the pure classes
+#
+
+class _BasePurePathTest(object):
+
+    # keys are canonical paths, values are list of tuples of arguments
+    # supposed to produce equal paths
+    equivalences = {
+        'a/b': [
+            ('a', 'b'), ('a/', 'b'), ('a', 'b/'), ('a/', 'b/'),
+            ('a/b/',), ('a//b',), ('a//b//',),
+            # empty components get removed
+            ('', 'a', 'b'), ('a', '', 'b'), ('a', 'b', ''),
+            ],
+        '/b/c/d': [
+            ('a', '/b/c', 'd'), ('a', '///b//c', 'd/'),
+            ('/a', '/b/c', 'd'),
+            # empty components get removed
+            ('/', 'b', '', 'c/d'), ('/', '', 'b/c/d'), ('', '/b/c/d'),
+            ],
+    }
+
+    def setUp(self):
+        p = self.cls('a')
+        self.flavour = p._flavour
+        self.sep = self.flavour.sep
+        self.altsep = self.flavour.altsep
+
+    def test_constructor_common(self):
+        P = self.cls
+        p = P('a')
+        self.assertIsInstance(p, P)
+        P('a', 'b', 'c')
+        P('/a', 'b', 'c')
+        P('a/b/c')
+        P('/a/b/c')
+        self.assertEqual(P(P('a')), P('a'))
+        self.assertEqual(P(P('a'), 'b'), P('a/b'))
+        self.assertEqual(P(P('a'), P('b')), P('a/b'))
+
+    def _check_str_subclass(self, *args):
+        # Issue #21127: it should be possible to construct a PurePath object
+        # from an str subclass instance, and it then gets converted to
+        # a pure str object.
+        class StrSubclass(str):
+            pass
+        P = self.cls
+        p = P(*(StrSubclass(x) for x in args))
+        self.assertEqual(p, P(*args))
+        for part in p.parts:
+            self.assertIs(type(part), str)
+
+    def test_str_subclass_common(self):
+        self._check_str_subclass('')
+        self._check_str_subclass('.')
+        self._check_str_subclass('a')
+        self._check_str_subclass('a/b.txt')
+        self._check_str_subclass('/a/b.txt')
+
+    def test_join_common(self):
+        P = self.cls
+        p = P('a/b')
+        pp = p.joinpath('c')
+        self.assertEqual(pp, P('a/b/c'))
+        self.assertIs(type(pp), type(p))
+        pp = p.joinpath('c', 'd')
+        self.assertEqual(pp, P('a/b/c/d'))
+        pp = p.joinpath(P('c'))
+        self.assertEqual(pp, P('a/b/c'))
+        pp = p.joinpath('/c')
+        self.assertEqual(pp, P('/c'))
+
+    def test_div_common(self):
+        # Basically the same as joinpath()
+        P = self.cls
+        p = P('a/b')
+        pp = p / 'c'
+        self.assertEqual(pp, P('a/b/c'))
+        self.assertIs(type(pp), type(p))
+        pp = p / 'c/d'
+        self.assertEqual(pp, P('a/b/c/d'))
+        pp = p / 'c' / 'd'
+        self.assertEqual(pp, P('a/b/c/d'))
+        pp = 'c' / p / 'd'
+        self.assertEqual(pp, P('c/a/b/d'))
+        pp = p / P('c')
+        self.assertEqual(pp, P('a/b/c'))
+        pp = p/ '/c'
+        self.assertEqual(pp, P('/c'))
+
+    def _check_str(self, expected, args):
+        p = self.cls(*args)
+        self.assertEqual(str(p), expected.replace('/', self.sep))
+
+    def test_str_common(self):
+        # Canonicalized paths roundtrip
+        for pathstr in ('a', 'a/b', 'a/b/c', '/', '/a/b', '/a/b/c'):
+            self._check_str(pathstr, (pathstr,))
+        # Special case for the empty path
+        self._check_str('.', ('',))
+        # Other tests for str() are in test_equivalences()
+
+    def test_as_posix_common(self):
+        P = self.cls
+        for pathstr in ('a', 'a/b', 'a/b/c', '/', '/a/b', '/a/b/c'):
+            self.assertEqual(P(pathstr).as_posix(), pathstr)
+        # Other tests for as_posix() are in test_equivalences()
+
+    def test_as_bytes_common(self):
+        sep = os.fsencode(self.sep)
+        P = self.cls
+        self.assertEqual(bytes(P('a/b')), b'a' + sep + b'b')
+
+    def test_as_uri_common(self):
+        P = self.cls
+        with self.assertRaises(ValueError):
+            P('a').as_uri()
+        with self.assertRaises(ValueError):
+            P().as_uri()
+
+    def test_repr_common(self):
+        for pathstr in ('a', 'a/b', 'a/b/c', '/', '/a/b', '/a/b/c'):
+            p = self.cls(pathstr)
+            clsname = p.__class__.__name__
+            r = repr(p)
+            # The repr() is in the form ClassName("forward-slashes path")
+            self.assertTrue(r.startswith(clsname + '('), r)
+            self.assertTrue(r.endswith(')'), r)
+            inner = r[len(clsname) + 1 : -1]
+            self.assertEqual(eval(inner), p.as_posix())
+            # The repr() roundtrips
+            q = eval(r, pathlib.__dict__)
+            self.assertIs(q.__class__, p.__class__)
+            self.assertEqual(q, p)
+            self.assertEqual(repr(q), r)
+
+    def test_eq_common(self):
+        P = self.cls
+        self.assertEqual(P('a/b'), P('a/b'))
+        self.assertEqual(P('a/b'), P('a', 'b'))
+        self.assertNotEqual(P('a/b'), P('a'))
+        self.assertNotEqual(P('a/b'), P('/a/b'))
+        self.assertNotEqual(P('a/b'), P())
+        self.assertNotEqual(P('/a/b'), P('/'))
+        self.assertNotEqual(P(), P('/'))
+        self.assertNotEqual(P(), "")
+        self.assertNotEqual(P(), {})
+        self.assertNotEqual(P(), int)
+
+    def test_match_common(self):
+        P = self.cls
+        self.assertRaises(ValueError, P('a').match, '')
+        self.assertRaises(ValueError, P('a').match, '.')
+        # Simple relative pattern
+        self.assertTrue(P('b.py').match('b.py'))
+        self.assertTrue(P('a/b.py').match('b.py'))
+        self.assertTrue(P('/a/b.py').match('b.py'))
+        self.assertFalse(P('a.py').match('b.py'))
+        self.assertFalse(P('b/py').match('b.py'))
+        self.assertFalse(P('/a.py').match('b.py'))
+        self.assertFalse(P('b.py/c').match('b.py'))
+        # Wilcard relative pattern
+        self.assertTrue(P('b.py').match('*.py'))
+        self.assertTrue(P('a/b.py').match('*.py'))
+        self.assertTrue(P('/a/b.py').match('*.py'))
+        self.assertFalse(P('b.pyc').match('*.py'))
+        self.assertFalse(P('b./py').match('*.py'))
+        self.assertFalse(P('b.py/c').match('*.py'))
+        # Multi-part relative pattern
+        self.assertTrue(P('ab/c.py').match('a*/*.py'))
+        self.assertTrue(P('/d/ab/c.py').match('a*/*.py'))
+        self.assertFalse(P('a.py').match('a*/*.py'))
+        self.assertFalse(P('/dab/c.py').match('a*/*.py'))
+        self.assertFalse(P('ab/c.py/d').match('a*/*.py'))
+        # Absolute pattern
+        self.assertTrue(P('/b.py').match('/*.py'))
+        self.assertFalse(P('b.py').match('/*.py'))
+        self.assertFalse(P('a/b.py').match('/*.py'))
+        self.assertFalse(P('/a/b.py').match('/*.py'))
+        # Multi-part absolute pattern
+        self.assertTrue(P('/a/b.py').match('/a/*.py'))
+        self.assertFalse(P('/ab.py').match('/a/*.py'))
+        self.assertFalse(P('/a/b/c.py').match('/a/*.py'))
+
+    def test_ordering_common(self):
+        # Ordering is tuple-alike
+        def assertLess(a, b):
+            self.assertLess(a, b)
+            self.assertGreater(b, a)
+        P = self.cls
+        a = P('a')
+        b = P('a/b')
+        c = P('abc')
+        d = P('b')
+        assertLess(a, b)
+        assertLess(a, c)
+        assertLess(a, d)
+        assertLess(b, c)
+        assertLess(c, d)
+        P = self.cls
+        a = P('/a')
+        b = P('/a/b')
+        c = P('/abc')
+        d = P('/b')
+        assertLess(a, b)
+        assertLess(a, c)
+        assertLess(a, d)
+        assertLess(b, c)
+        assertLess(c, d)
+        with self.assertRaises(TypeError):
+            P() < {}
+
+    def test_parts_common(self):
+        # `parts` returns a tuple
+        sep = self.sep
+        P = self.cls
+        p = P('a/b')
+        parts = p.parts
+        self.assertEqual(parts, ('a', 'b'))
+        # The object gets reused
+        self.assertIs(parts, p.parts)
+        # When the path is absolute, the anchor is a separate part
+        p = P('/a/b')
+        parts = p.parts
+        self.assertEqual(parts, (sep, 'a', 'b'))
+
+    def test_equivalences(self):
+        for k, tuples in self.equivalences.items():
+            canon = k.replace('/', self.sep)
+            posix = k.replace(self.sep, '/')
+            if canon != posix:
+                tuples = tuples + [
+                    tuple(part.replace('/', self.sep) for part in t)
+                    for t in tuples
+                    ]
+                tuples.append((posix, ))
+            pcanon = self.cls(canon)
+            for t in tuples:
+                p = self.cls(*t)
+                self.assertEqual(p, pcanon, "failed with args {}".format(t))
+                self.assertEqual(hash(p), hash(pcanon))
+                self.assertEqual(str(p), canon)
+                self.assertEqual(p.as_posix(), posix)
+
+    def test_parent_common(self):
+        # Relative
+        P = self.cls
+        p = P('a/b/c')
+        self.assertEqual(p.parent, P('a/b'))
+        self.assertEqual(p.parent.parent, P('a'))
+        self.assertEqual(p.parent.parent.parent, P())
+        self.assertEqual(p.parent.parent.parent.parent, P())
+        # Anchored
+        p = P('/a/b/c')
+        self.assertEqual(p.parent, P('/a/b'))
+        self.assertEqual(p.parent.parent, P('/a'))
+        self.assertEqual(p.parent.parent.parent, P('/'))
+        self.assertEqual(p.parent.parent.parent.parent, P('/'))
+
+    def test_parents_common(self):
+        # Relative
+        P = self.cls
+        p = P('a/b/c')
+        par = p.parents
+        self.assertEqual(len(par), 3)
+        self.assertEqual(par[0], P('a/b'))
+        self.assertEqual(par[1], P('a'))
+        self.assertEqual(par[2], P('.'))
+        self.assertEqual(list(par), [P('a/b'), P('a'), P('.')])
+        with self.assertRaises(IndexError):
+            par[-1]
+        with self.assertRaises(IndexError):
+            par[3]
+        with self.assertRaises(TypeError):
+            par[0] = p
+        # Anchored
+        p = P('/a/b/c')
+        par = p.parents
+        self.assertEqual(len(par), 3)
+        self.assertEqual(par[0], P('/a/b'))
+        self.assertEqual(par[1], P('/a'))
+        self.assertEqual(par[2], P('/'))
+        self.assertEqual(list(par), [P('/a/b'), P('/a'), P('/')])
+        with self.assertRaises(IndexError):
+            par[3]
+
+    def test_drive_common(self):
+        P = self.cls
+        self.assertEqual(P('a/b').drive, '')
+        self.assertEqual(P('/a/b').drive, '')
+        self.assertEqual(P('').drive, '')
+
+    def test_root_common(self):
+        P = self.cls
+        sep = self.sep
+        self.assertEqual(P('').root, '')
+        self.assertEqual(P('a/b').root, '')
+        self.assertEqual(P('/').root, sep)
+        self.assertEqual(P('/a/b').root, sep)
+
+    def test_anchor_common(self):
+        P = self.cls
+        sep = self.sep
+        self.assertEqual(P('').anchor, '')
+        self.assertEqual(P('a/b').anchor, '')
+        self.assertEqual(P('/').anchor, sep)
+        self.assertEqual(P('/a/b').anchor, sep)
+
+    def test_name_common(self):
+        P = self.cls
+        self.assertEqual(P('').name, '')
+        self.assertEqual(P('.').name, '')
+        self.assertEqual(P('/').name, '')
+        self.assertEqual(P('a/b').name, 'b')
+        self.assertEqual(P('/a/b').name, 'b')
+        self.assertEqual(P('/a/b/.').name, 'b')
+        self.assertEqual(P('a/b.py').name, 'b.py')
+        self.assertEqual(P('/a/b.py').name, 'b.py')
+
+    def test_suffix_common(self):
+        P = self.cls
+        self.assertEqual(P('').suffix, '')
+        self.assertEqual(P('.').suffix, '')
+        self.assertEqual(P('..').suffix, '')
+        self.assertEqual(P('/').suffix, '')
+        self.assertEqual(P('a/b').suffix, '')
+        self.assertEqual(P('/a/b').suffix, '')
+        self.assertEqual(P('/a/b/.').suffix, '')
+        self.assertEqual(P('a/b.py').suffix, '.py')
+        self.assertEqual(P('/a/b.py').suffix, '.py')
+        self.assertEqual(P('a/.hgrc').suffix, '')
+        self.assertEqual(P('/a/.hgrc').suffix, '')
+        self.assertEqual(P('a/.hg.rc').suffix, '.rc')
+        self.assertEqual(P('/a/.hg.rc').suffix, '.rc')
+        self.assertEqual(P('a/b.tar.gz').suffix, '.gz')
+        self.assertEqual(P('/a/b.tar.gz').suffix, '.gz')
+        self.assertEqual(P('a/Some name. Ending with a dot.').suffix, '')
+        self.assertEqual(P('/a/Some name. Ending with a dot.').suffix, '')
+
+    def test_suffixes_common(self):
+        P = self.cls
+        self.assertEqual(P('').suffixes, [])
+        self.assertEqual(P('.').suffixes, [])
+        self.assertEqual(P('/').suffixes, [])
+        self.assertEqual(P('a/b').suffixes, [])
+        self.assertEqual(P('/a/b').suffixes, [])
+        self.assertEqual(P('/a/b/.').suffixes, [])
+        self.assertEqual(P('a/b.py').suffixes, ['.py'])
+        self.assertEqual(P('/a/b.py').suffixes, ['.py'])
+        self.assertEqual(P('a/.hgrc').suffixes, [])
+        self.assertEqual(P('/a/.hgrc').suffixes, [])
+        self.assertEqual(P('a/.hg.rc').suffixes, ['.rc'])
+        self.assertEqual(P('/a/.hg.rc').suffixes, ['.rc'])
+        self.assertEqual(P('a/b.tar.gz').suffixes, ['.tar', '.gz'])
+        self.assertEqual(P('/a/b.tar.gz').suffixes, ['.tar', '.gz'])
+        self.assertEqual(P('a/Some name. Ending with a dot.').suffixes, [])
+        self.assertEqual(P('/a/Some name. Ending with a dot.').suffixes, [])
+
+    def test_stem_common(self):
+        P = self.cls
+        self.assertEqual(P('').stem, '')
+        self.assertEqual(P('.').stem, '')
+        self.assertEqual(P('..').stem, '..')
+        self.assertEqual(P('/').stem, '')
+        self.assertEqual(P('a/b').stem, 'b')
+        self.assertEqual(P('a/b.py').stem, 'b')
+        self.assertEqual(P('a/.hgrc').stem, '.hgrc')
+        self.assertEqual(P('a/.hg.rc').stem, '.hg')
+        self.assertEqual(P('a/b.tar.gz').stem, 'b.tar')
+        self.assertEqual(P('a/Some name. Ending with a dot.').stem,
+                         'Some name. Ending with a dot.')
+
+    def test_with_name_common(self):
+        P = self.cls
+        self.assertEqual(P('a/b').with_name('d.xml'), P('a/d.xml'))
+        self.assertEqual(P('/a/b').with_name('d.xml'), P('/a/d.xml'))
+        self.assertEqual(P('a/b.py').with_name('d.xml'), P('a/d.xml'))
+        self.assertEqual(P('/a/b.py').with_name('d.xml'), P('/a/d.xml'))
+        self.assertEqual(P('a/Dot ending.').with_name('d.xml'), P('a/d.xml'))
+        self.assertEqual(P('/a/Dot ending.').with_name('d.xml'), P('/a/d.xml'))
+        self.assertRaises(ValueError, P('').with_name, 'd.xml')
+        self.assertRaises(ValueError, P('.').with_name, 'd.xml')
+        self.assertRaises(ValueError, P('/').with_name, 'd.xml')
+        self.assertRaises(ValueError, P('a/b').with_name, '')
+        self.assertRaises(ValueError, P('a/b').with_name, '/c')
+        self.assertRaises(ValueError, P('a/b').with_name, 'c/')
+        self.assertRaises(ValueError, P('a/b').with_name, 'c/d')
+
+    def test_with_suffix_common(self):
+        P = self.cls
+        self.assertEqual(P('a/b').with_suffix('.gz'), P('a/b.gz'))
+        self.assertEqual(P('/a/b').with_suffix('.gz'), P('/a/b.gz'))
+        self.assertEqual(P('a/b.py').with_suffix('.gz'), P('a/b.gz'))
+        self.assertEqual(P('/a/b.py').with_suffix('.gz'), P('/a/b.gz'))
+        # Stripping suffix
+        self.assertEqual(P('a/b.py').with_suffix(''), P('a/b'))
+        self.assertEqual(P('/a/b').with_suffix(''), P('/a/b'))
+        # Path doesn't have a "filename" component
+        self.assertRaises(ValueError, P('').with_suffix, '.gz')
+        self.assertRaises(ValueError, P('.').with_suffix, '.gz')
+        self.assertRaises(ValueError, P('/').with_suffix, '.gz')
+        # Invalid suffix
+        self.assertRaises(ValueError, P('a/b').with_suffix, 'gz')
+        self.assertRaises(ValueError, P('a/b').with_suffix, '/')
+        self.assertRaises(ValueError, P('a/b').with_suffix, '.')
+        self.assertRaises(ValueError, P('a/b').with_suffix, '/.gz')
+        self.assertRaises(ValueError, P('a/b').with_suffix, 'c/d')
+        self.assertRaises(ValueError, P('a/b').with_suffix, '.c/.d')
+        self.assertRaises(ValueError, P('a/b').with_suffix, './.d')
+        self.assertRaises(ValueError, P('a/b').with_suffix, '.d/.')
+
+    def test_relative_to_common(self):
+        P = self.cls
+        p = P('a/b')
+        self.assertRaises(TypeError, p.relative_to)
+        self.assertRaises(TypeError, p.relative_to, b'a')
+        self.assertEqual(p.relative_to(P()), P('a/b'))
+        self.assertEqual(p.relative_to(''), P('a/b'))
+        self.assertEqual(p.relative_to(P('a')), P('b'))
+        self.assertEqual(p.relative_to('a'), P('b'))
+        self.assertEqual(p.relative_to('a/'), P('b'))
+        self.assertEqual(p.relative_to(P('a/b')), P())
+        self.assertEqual(p.relative_to('a/b'), P())
+        # With several args
+        self.assertEqual(p.relative_to('a', 'b'), P())
+        # Unrelated paths
+        self.assertRaises(ValueError, p.relative_to, P('c'))
+        self.assertRaises(ValueError, p.relative_to, P('a/b/c'))
+        self.assertRaises(ValueError, p.relative_to, P('a/c'))
+        self.assertRaises(ValueError, p.relative_to, P('/a'))
+        p = P('/a/b')
+        self.assertEqual(p.relative_to(P('/')), P('a/b'))
+        self.assertEqual(p.relative_to('/'), P('a/b'))
+        self.assertEqual(p.relative_to(P('/a')), P('b'))
+        self.assertEqual(p.relative_to('/a'), P('b'))
+        self.assertEqual(p.relative_to('/a/'), P('b'))
+        self.assertEqual(p.relative_to(P('/a/b')), P())
+        self.assertEqual(p.relative_to('/a/b'), P())
+        # Unrelated paths
+        self.assertRaises(ValueError, p.relative_to, P('/c'))
+        self.assertRaises(ValueError, p.relative_to, P('/a/b/c'))
+        self.assertRaises(ValueError, p.relative_to, P('/a/c'))
+        self.assertRaises(ValueError, p.relative_to, P())
+        self.assertRaises(ValueError, p.relative_to, '')
+        self.assertRaises(ValueError, p.relative_to, P('a'))
+
+    def test_pickling_common(self):
+        P = self.cls
+        p = P('/a/b')
+        for proto in range(0, pickle.HIGHEST_PROTOCOL + 1):
+            dumped = pickle.dumps(p, proto)
+            pp = pickle.loads(dumped)
+            self.assertIs(pp.__class__, p.__class__)
+            self.assertEqual(pp, p)
+            self.assertEqual(hash(pp), hash(p))
+            self.assertEqual(str(pp), str(p))
+
+
+class PurePosixPathTest(_BasePurePathTest, unittest.TestCase):
+    cls = pathlib.PurePosixPath
+
+    def test_root(self):
+        P = self.cls
+        self.assertEqual(P('/a/b').root, '/')
+        self.assertEqual(P('///a/b').root, '/')
+        # POSIX special case for two leading slashes
+        self.assertEqual(P('//a/b').root, '//')
+
+    def test_eq(self):
+        P = self.cls
+        self.assertNotEqual(P('a/b'), P('A/b'))
+        self.assertEqual(P('/a'), P('///a'))
+        self.assertNotEqual(P('/a'), P('//a'))
+
+    def test_as_uri(self):
+        P = self.cls
+        self.assertEqual(P('/').as_uri(), 'file:///')
+        self.assertEqual(P('/a/b.c').as_uri(), 'file:///a/b.c')
+        self.assertEqual(P('/a/b%#c').as_uri(), 'file:///a/b%25%23c')
+
+    def test_as_uri_non_ascii(self):
+        from urllib.parse import quote_from_bytes
+        P = self.cls
+        try:
+            os.fsencode('\xe9')
+        except UnicodeEncodeError:
+            self.skipTest("\\xe9 cannot be encoded to the filesystem encoding")
+        self.assertEqual(P('/a/b\xe9').as_uri(),
+                         'file:///a/b' + quote_from_bytes(os.fsencode('\xe9')))
+
+    def test_match(self):
+        P = self.cls
+        self.assertFalse(P('A.py').match('a.PY'))
+
+    def test_is_absolute(self):
+        P = self.cls
+        self.assertFalse(P().is_absolute())
+        self.assertFalse(P('a').is_absolute())
+        self.assertFalse(P('a/b/').is_absolute())
+        self.assertTrue(P('/').is_absolute())
+        self.assertTrue(P('/a').is_absolute())
+        self.assertTrue(P('/a/b/').is_absolute())
+        self.assertTrue(P('//a').is_absolute())
+        self.assertTrue(P('//a/b').is_absolute())
+
+    def test_is_reserved(self):
+        P = self.cls
+        self.assertIs(False, P('').is_reserved())
+        self.assertIs(False, P('/').is_reserved())
+        self.assertIs(False, P('/foo/bar').is_reserved())
+        self.assertIs(False, P('/dev/con/PRN/NUL').is_reserved())
+
+    def test_join(self):
+        P = self.cls
+        p = P('//a')
+        pp = p.joinpath('b')
+        self.assertEqual(pp, P('//a/b'))
+        pp = P('/a').joinpath('//c')
+        self.assertEqual(pp, P('//c'))
+        pp = P('//a').joinpath('/c')
+        self.assertEqual(pp, P('/c'))
+
+    def test_div(self):
+        # Basically the same as joinpath()
+        P = self.cls
+        p = P('//a')
+        pp = p / 'b'
+        self.assertEqual(pp, P('//a/b'))
+        pp = P('/a') / '//c'
+        self.assertEqual(pp, P('//c'))
+        pp = P('//a') / '/c'
+        self.assertEqual(pp, P('/c'))
+
+
+class PureWindowsPathTest(_BasePurePathTest, unittest.TestCase):
+    cls = pathlib.PureWindowsPath
+
+    equivalences = _BasePurePathTest.equivalences.copy()
+    equivalences.update({
+        'c:a': [ ('c:', 'a'), ('c:', 'a/'), ('/', 'c:', 'a') ],
+        'c:/a': [
+            ('c:/', 'a'), ('c:', '/', 'a'), ('c:', '/a'),
+            ('/z', 'c:/', 'a'), ('//x/y', 'c:/', 'a'),
+            ],
+        '//a/b/': [ ('//a/b',) ],
+        '//a/b/c': [
+            ('//a/b', 'c'), ('//a/b/', 'c'),
+            ],
+    })
+
+    def test_str(self):
+        p = self.cls('a/b/c')
+        self.assertEqual(str(p), 'a\\b\\c')
+        p = self.cls('c:/a/b/c')
+        self.assertEqual(str(p), 'c:\\a\\b\\c')
+        p = self.cls('//a/b')
+        self.assertEqual(str(p), '\\\\a\\b\\')
+        p = self.cls('//a/b/c')
+        self.assertEqual(str(p), '\\\\a\\b\\c')
+        p = self.cls('//a/b/c/d')
+        self.assertEqual(str(p), '\\\\a\\b\\c\\d')
+
+    def test_str_subclass(self):
+        self._check_str_subclass('c:')
+        self._check_str_subclass('c:a')
+        self._check_str_subclass('c:a\\b.txt')
+        self._check_str_subclass('c:\\')
+        self._check_str_subclass('c:\\a')
+        self._check_str_subclass('c:\\a\\b.txt')
+        self._check_str_subclass('\\\\some\\share')
+        self._check_str_subclass('\\\\some\\share\\a')
+        self._check_str_subclass('\\\\some\\share\\a\\b.txt')
+
+    def test_eq(self):
+        P = self.cls
+        self.assertEqual(P('c:a/b'), P('c:a/b'))
+        self.assertEqual(P('c:a/b'), P('c:', 'a', 'b'))
+        self.assertNotEqual(P('c:a/b'), P('d:a/b'))
+        self.assertNotEqual(P('c:a/b'), P('c:/a/b'))
+        self.assertNotEqual(P('/a/b'), P('c:/a/b'))
+        # Case-insensitivity
+        self.assertEqual(P('a/B'), P('A/b'))
+        self.assertEqual(P('C:a/B'), P('c:A/b'))
+        self.assertEqual(P('//Some/SHARE/a/B'), P('//somE/share/A/b'))
+
+    def test_as_uri(self):
+        from urllib.parse import quote_from_bytes
+        P = self.cls
+        with self.assertRaises(ValueError):
+            P('/a/b').as_uri()
+        with self.assertRaises(ValueError):
+            P('c:a/b').as_uri()
+        self.assertEqual(P('c:/').as_uri(), 'file:///c:/')
+        self.assertEqual(P('c:/a/b.c').as_uri(), 'file:///c:/a/b.c')
+        self.assertEqual(P('c:/a/b%#c').as_uri(), 'file:///c:/a/b%25%23c')
+        self.assertEqual(P('c:/a/b\xe9').as_uri(), 'file:///c:/a/b%C3%A9')
+        self.assertEqual(P('//some/share/').as_uri(), 'file://some/share/')
+        self.assertEqual(P('//some/share/a/b.c').as_uri(),
+                         'file://some/share/a/b.c')
+        self.assertEqual(P('//some/share/a/b%#c\xe9').as_uri(),
+                         'file://some/share/a/b%25%23c%C3%A9')
+
+    def test_match_common(self):
+        P = self.cls
+        # Absolute patterns
+        self.assertTrue(P('c:/b.py').match('/*.py'))
+        self.assertTrue(P('c:/b.py').match('c:*.py'))
+        self.assertTrue(P('c:/b.py').match('c:/*.py'))
+        self.assertFalse(P('d:/b.py').match('c:/*.py'))  # wrong drive
+        self.assertFalse(P('b.py').match('/*.py'))
+        self.assertFalse(P('b.py').match('c:*.py'))
+        self.assertFalse(P('b.py').match('c:/*.py'))
+        self.assertFalse(P('c:b.py').match('/*.py'))
+        self.assertFalse(P('c:b.py').match('c:/*.py'))
+        self.assertFalse(P('/b.py').match('c:*.py'))
+        self.assertFalse(P('/b.py').match('c:/*.py'))
+        # UNC patterns
+        self.assertTrue(P('//some/share/a.py').match('/*.py'))
+        self.assertTrue(P('//some/share/a.py').match('//some/share/*.py'))
+        self.assertFalse(P('//other/share/a.py').match('//some/share/*.py'))
+        self.assertFalse(P('//some/share/a/b.py').match('//some/share/*.py'))
+        # Case-insensitivity
+        self.assertTrue(P('B.py').match('b.PY'))
+        self.assertTrue(P('c:/a/B.Py').match('C:/A/*.pY'))
+        self.assertTrue(P('//Some/Share/B.Py').match('//somE/sharE/*.pY'))
+
+    def test_ordering_common(self):
+        # Case-insensitivity
+        def assertOrderedEqual(a, b):
+            self.assertLessEqual(a, b)
+            self.assertGreaterEqual(b, a)
+        P = self.cls
+        p = P('c:A/b')
+        q = P('C:a/B')
+        assertOrderedEqual(p, q)
+        self.assertFalse(p < q)
+        self.assertFalse(p > q)
+        p = P('//some/Share/A/b')
+        q = P('//Some/SHARE/a/B')
+        assertOrderedEqual(p, q)
+        self.assertFalse(p < q)
+        self.assertFalse(p > q)
+
+    def test_parts(self):
+        P = self.cls
+        p = P('c:a/b')
+        parts = p.parts
+        self.assertEqual(parts, ('c:', 'a', 'b'))
+        p = P('c:/a/b')
+        parts = p.parts
+        self.assertEqual(parts, ('c:\\', 'a', 'b'))
+        p = P('//a/b/c/d')
+        parts = p.parts
+        self.assertEqual(parts, ('\\\\a\\b\\', 'c', 'd'))
+
+    def test_parent(self):
+        # Anchored
+        P = self.cls
+        p = P('z:a/b/c')
+        self.assertEqual(p.parent, P('z:a/b'))
+        self.assertEqual(p.parent.parent, P('z:a'))
+        self.assertEqual(p.parent.parent.parent, P('z:'))
+        self.assertEqual(p.parent.parent.parent.parent, P('z:'))
+        p = P('z:/a/b/c')
+        self.assertEqual(p.parent, P('z:/a/b'))
+        self.assertEqual(p.parent.parent, P('z:/a'))
+        self.assertEqual(p.parent.parent.parent, P('z:/'))
+        self.assertEqual(p.parent.parent.parent.parent, P('z:/'))
+        p = P('//a/b/c/d')
+        self.assertEqual(p.parent, P('//a/b/c'))
+        self.assertEqual(p.parent.parent, P('//a/b'))
+        self.assertEqual(p.parent.parent.parent, P('//a/b'))
+
+    def test_parents(self):
+        # Anchored
+        P = self.cls
+        p = P('z:a/b/')
+        par = p.parents
+        self.assertEqual(len(par), 2)
+        self.assertEqual(par[0], P('z:a'))
+        self.assertEqual(par[1], P('z:'))
+        self.assertEqual(list(par), [P('z:a'), P('z:')])
+        with self.assertRaises(IndexError):
+            par[2]
+        p = P('z:/a/b/')
+        par = p.parents
+        self.assertEqual(len(par), 2)
+        self.assertEqual(par[0], P('z:/a'))
+        self.assertEqual(par[1], P('z:/'))
+        self.assertEqual(list(par), [P('z:/a'), P('z:/')])
+        with self.assertRaises(IndexError):
+            par[2]
+        p = P('//a/b/c/d')
+        par = p.parents
+        self.assertEqual(len(par), 2)
+        self.assertEqual(par[0], P('//a/b/c'))
+        self.assertEqual(par[1], P('//a/b'))
+        self.assertEqual(list(par), [P('//a/b/c'), P('//a/b')])
+        with self.assertRaises(IndexError):
+            par[2]
+
+    def test_drive(self):
+        P = self.cls
+        self.assertEqual(P('c:').drive, 'c:')
+        self.assertEqual(P('c:a/b').drive, 'c:')
+        self.assertEqual(P('c:/').drive, 'c:')
+        self.assertEqual(P('c:/a/b/').drive, 'c:')
+        self.assertEqual(P('//a/b').drive, '\\\\a\\b')
+        self.assertEqual(P('//a/b/').drive, '\\\\a\\b')
+        self.assertEqual(P('//a/b/c/d').drive, '\\\\a\\b')
+
+    def test_root(self):
+        P = self.cls
+        self.assertEqual(P('c:').root, '')
+        self.assertEqual(P('c:a/b').root, '')
+        self.assertEqual(P('c:/').root, '\\')
+        self.assertEqual(P('c:/a/b/').root, '\\')
+        self.assertEqual(P('//a/b').root, '\\')
+        self.assertEqual(P('//a/b/').root, '\\')
+        self.assertEqual(P('//a/b/c/d').root, '\\')
+
+    def test_anchor(self):
+        P = self.cls
+        self.assertEqual(P('c:').anchor, 'c:')
+        self.assertEqual(P('c:a/b').anchor, 'c:')
+        self.assertEqual(P('c:/').anchor, 'c:\\')
+        self.assertEqual(P('c:/a/b/').anchor, 'c:\\')
+        self.assertEqual(P('//a/b').anchor, '\\\\a\\b\\')
+        self.assertEqual(P('//a/b/').anchor, '\\\\a\\b\\')
+        self.assertEqual(P('//a/b/c/d').anchor, '\\\\a\\b\\')
+
+    def test_name(self):
+        P = self.cls
+        self.assertEqual(P('c:').name, '')
+        self.assertEqual(P('c:/').name, '')
+        self.assertEqual(P('c:a/b').name, 'b')
+        self.assertEqual(P('c:/a/b').name, 'b')
+        self.assertEqual(P('c:a/b.py').name, 'b.py')
+        self.assertEqual(P('c:/a/b.py').name, 'b.py')
+        self.assertEqual(P('//My.py/Share.php').name, '')
+        self.assertEqual(P('//My.py/Share.php/a/b').name, 'b')
+
+    def test_suffix(self):
+        P = self.cls
+        self.assertEqual(P('c:').suffix, '')
+        self.assertEqual(P('c:/').suffix, '')
+        self.assertEqual(P('c:a/b').suffix, '')
+        self.assertEqual(P('c:/a/b').suffix, '')
+        self.assertEqual(P('c:a/b.py').suffix, '.py')
+        self.assertEqual(P('c:/a/b.py').suffix, '.py')
+        self.assertEqual(P('c:a/.hgrc').suffix, '')
+        self.assertEqual(P('c:/a/.hgrc').suffix, '')
+        self.assertEqual(P('c:a/.hg.rc').suffix, '.rc')
+        self.assertEqual(P('c:/a/.hg.rc').suffix, '.rc')
+        self.assertEqual(P('c:a/b.tar.gz').suffix, '.gz')
+        self.assertEqual(P('c:/a/b.tar.gz').suffix, '.gz')
+        self.assertEqual(P('c:a/Some name. Ending with a dot.').suffix, '')
+        self.assertEqual(P('c:/a/Some name. Ending with a dot.').suffix, '')
+        self.assertEqual(P('//My.py/Share.php').suffix, '')
+        self.assertEqual(P('//My.py/Share.php/a/b').suffix, '')
+
+    def test_suffixes(self):
+        P = self.cls
+        self.assertEqual(P('c:').suffixes, [])
+        self.assertEqual(P('c:/').suffixes, [])
+        self.assertEqual(P('c:a/b').suffixes, [])
+        self.assertEqual(P('c:/a/b').suffixes, [])
+        self.assertEqual(P('c:a/b.py').suffixes, ['.py'])
+        self.assertEqual(P('c:/a/b.py').suffixes, ['.py'])
+        self.assertEqual(P('c:a/.hgrc').suffixes, [])
+        self.assertEqual(P('c:/a/.hgrc').suffixes, [])
+        self.assertEqual(P('c:a/.hg.rc').suffixes, ['.rc'])
+        self.assertEqual(P('c:/a/.hg.rc').suffixes, ['.rc'])
+        self.assertEqual(P('c:a/b.tar.gz').suffixes, ['.tar', '.gz'])
+        self.assertEqual(P('c:/a/b.tar.gz').suffixes, ['.tar', '.gz'])
+        self.assertEqual(P('//My.py/Share.php').suffixes, [])
+        self.assertEqual(P('//My.py/Share.php/a/b').suffixes, [])
+        self.assertEqual(P('c:a/Some name. Ending with a dot.').suffixes, [])
+        self.assertEqual(P('c:/a/Some name. Ending with a dot.').suffixes, [])
+
+    def test_stem(self):
+        P = self.cls
+        self.assertEqual(P('c:').stem, '')
+        self.assertEqual(P('c:.').stem, '')
+        self.assertEqual(P('c:..').stem, '..')
+        self.assertEqual(P('c:/').stem, '')
+        self.assertEqual(P('c:a/b').stem, 'b')
+        self.assertEqual(P('c:a/b.py').stem, 'b')
+        self.assertEqual(P('c:a/.hgrc').stem, '.hgrc')
+        self.assertEqual(P('c:a/.hg.rc').stem, '.hg')
+        self.assertEqual(P('c:a/b.tar.gz').stem, 'b.tar')
+        self.assertEqual(P('c:a/Some name. Ending with a dot.').stem,
+                         'Some name. Ending with a dot.')
+
+    def test_with_name(self):
+        P = self.cls
+        self.assertEqual(P('c:a/b').with_name('d.xml'), P('c:a/d.xml'))
+        self.assertEqual(P('c:/a/b').with_name('d.xml'), P('c:/a/d.xml'))
+        self.assertEqual(P('c:a/Dot ending.').with_name('d.xml'), P('c:a/d.xml'))
+        self.assertEqual(P('c:/a/Dot ending.').with_name('d.xml'), P('c:/a/d.xml'))
+        self.assertRaises(ValueError, P('c:').with_name, 'd.xml')
+        self.assertRaises(ValueError, P('c:/').with_name, 'd.xml')
+        self.assertRaises(ValueError, P('//My/Share').with_name, 'd.xml')
+        self.assertRaises(ValueError, P('c:a/b').with_name, 'd:')
+        self.assertRaises(ValueError, P('c:a/b').with_name, 'd:e')
+        self.assertRaises(ValueError, P('c:a/b').with_name, 'd:/e')
+        self.assertRaises(ValueError, P('c:a/b').with_name, '//My/Share')
+
+    def test_with_suffix(self):
+        P = self.cls
+        self.assertEqual(P('c:a/b').with_suffix('.gz'), P('c:a/b.gz'))
+        self.assertEqual(P('c:/a/b').with_suffix('.gz'), P('c:/a/b.gz'))
+        self.assertEqual(P('c:a/b.py').with_suffix('.gz'), P('c:a/b.gz'))
+        self.assertEqual(P('c:/a/b.py').with_suffix('.gz'), P('c:/a/b.gz'))
+        # Path doesn't have a "filename" component
+        self.assertRaises(ValueError, P('').with_suffix, '.gz')
+        self.assertRaises(ValueError, P('.').with_suffix, '.gz')
+        self.assertRaises(ValueError, P('/').with_suffix, '.gz')
+        self.assertRaises(ValueError, P('//My/Share').with_suffix, '.gz')
+        # Invalid suffix
+        self.assertRaises(ValueError, P('c:a/b').with_suffix, 'gz')
+        self.assertRaises(ValueError, P('c:a/b').with_suffix, '/')
+        self.assertRaises(ValueError, P('c:a/b').with_suffix, '\\')
+        self.assertRaises(ValueError, P('c:a/b').with_suffix, 'c:')
+        self.assertRaises(ValueError, P('c:a/b').with_suffix, '/.gz')
+        self.assertRaises(ValueError, P('c:a/b').with_suffix, '\\.gz')
+        self.assertRaises(ValueError, P('c:a/b').with_suffix, 'c:.gz')
+        self.assertRaises(ValueError, P('c:a/b').with_suffix, 'c/d')
+        self.assertRaises(ValueError, P('c:a/b').with_suffix, 'c\\d')
+        self.assertRaises(ValueError, P('c:a/b').with_suffix, '.c/d')
+        self.assertRaises(ValueError, P('c:a/b').with_suffix, '.c\\d')
+
+    def test_relative_to(self):
+        P = self.cls
+        p = P('C:Foo/Bar')
+        self.assertEqual(p.relative_to(P('c:')), P('Foo/Bar'))
+        self.assertEqual(p.relative_to('c:'), P('Foo/Bar'))
+        self.assertEqual(p.relative_to(P('c:foO')), P('Bar'))
+        self.assertEqual(p.relative_to('c:foO'), P('Bar'))
+        self.assertEqual(p.relative_to('c:foO/'), P('Bar'))
+        self.assertEqual(p.relative_to(P('c:foO/baR')), P())
+        self.assertEqual(p.relative_to('c:foO/baR'), P())
+        # Unrelated paths
+        self.assertRaises(ValueError, p.relative_to, P())
+        self.assertRaises(ValueError, p.relative_to, '')
+        self.assertRaises(ValueError, p.relative_to, P('d:'))
+        self.assertRaises(ValueError, p.relative_to, P('/'))
+        self.assertRaises(ValueError, p.relative_to, P('Foo'))
+        self.assertRaises(ValueError, p.relative_to, P('/Foo'))
+        self.assertRaises(ValueError, p.relative_to, P('C:/Foo'))
+        self.assertRaises(ValueError, p.relative_to, P('C:Foo/Bar/Baz'))
+        self.assertRaises(ValueError, p.relative_to, P('C:Foo/Baz'))
+        p = P('C:/Foo/Bar')
+        self.assertEqual(p.relative_to(P('c:')), P('/Foo/Bar'))
+        self.assertEqual(p.relative_to('c:'), P('/Foo/Bar'))
+        self.assertEqual(str(p.relative_to(P('c:'))), '\\Foo\\Bar')
+        self.assertEqual(str(p.relative_to('c:')), '\\Foo\\Bar')
+        self.assertEqual(p.relative_to(P('c:/')), P('Foo/Bar'))
+        self.assertEqual(p.relative_to('c:/'), P('Foo/Bar'))
+        self.assertEqual(p.relative_to(P('c:/foO')), P('Bar'))
+        self.assertEqual(p.relative_to('c:/foO'), P('Bar'))
+        self.assertEqual(p.relative_to('c:/foO/'), P('Bar'))
+        self.assertEqual(p.relative_to(P('c:/foO/baR')), P())
+        self.assertEqual(p.relative_to('c:/foO/baR'), P())
+        # Unrelated paths
+        self.assertRaises(ValueError, p.relative_to, P('C:/Baz'))
+        self.assertRaises(ValueError, p.relative_to, P('C:/Foo/Bar/Baz'))
+        self.assertRaises(ValueError, p.relative_to, P('C:/Foo/Baz'))
+        self.assertRaises(ValueError, p.relative_to, P('C:Foo'))
+        self.assertRaises(ValueError, p.relative_to, P('d:'))
+        self.assertRaises(ValueError, p.relative_to, P('d:/'))
+        self.assertRaises(ValueError, p.relative_to, P('/'))
+        self.assertRaises(ValueError, p.relative_to, P('/Foo'))
+        self.assertRaises(ValueError, p.relative_to, P('//C/Foo'))
+        # UNC paths
+        p = P('//Server/Share/Foo/Bar')
+        self.assertEqual(p.relative_to(P('//sErver/sHare')), P('Foo/Bar'))
+        self.assertEqual(p.relative_to('//sErver/sHare'), P('Foo/Bar'))
+        self.assertEqual(p.relative_to('//sErver/sHare/'), P('Foo/Bar'))
+        self.assertEqual(p.relative_to(P('//sErver/sHare/Foo')), P('Bar'))
+        self.assertEqual(p.relative_to('//sErver/sHare/Foo'), P('Bar'))
+        self.assertEqual(p.relative_to('//sErver/sHare/Foo/'), P('Bar'))
+        self.assertEqual(p.relative_to(P('//sErver/sHare/Foo/Bar')), P())
+        self.assertEqual(p.relative_to('//sErver/sHare/Foo/Bar'), P())
+        # Unrelated paths
+        self.assertRaises(ValueError, p.relative_to, P('/Server/Share/Foo'))
+        self.assertRaises(ValueError, p.relative_to, P('c:/Server/Share/Foo'))
+        self.assertRaises(ValueError, p.relative_to, P('//z/Share/Foo'))
+        self.assertRaises(ValueError, p.relative_to, P('//Server/z/Foo'))
+
+    def test_is_absolute(self):
+        P = self.cls
+        # Under NT, only paths with both a drive and a root are absolute
+        self.assertFalse(P().is_absolute())
+        self.assertFalse(P('a').is_absolute())
+        self.assertFalse(P('a/b/').is_absolute())
+        self.assertFalse(P('/').is_absolute())
+        self.assertFalse(P('/a').is_absolute())
+        self.assertFalse(P('/a/b/').is_absolute())
+        self.assertFalse(P('c:').is_absolute())
+        self.assertFalse(P('c:a').is_absolute())
+        self.assertFalse(P('c:a/b/').is_absolute())
+        self.assertTrue(P('c:/').is_absolute())
+        self.assertTrue(P('c:/a').is_absolute())
+        self.assertTrue(P('c:/a/b/').is_absolute())
+        # UNC paths are absolute by definition
+        self.assertTrue(P('//a/b').is_absolute())
+        self.assertTrue(P('//a/b/').is_absolute())
+        self.assertTrue(P('//a/b/c').is_absolute())
+        self.assertTrue(P('//a/b/c/d').is_absolute())
+
+    def test_join(self):
+        P = self.cls
+        p = P('C:/a/b')
+        pp = p.joinpath('x/y')
+        self.assertEqual(pp, P('C:/a/b/x/y'))
+        pp = p.joinpath('/x/y')
+        self.assertEqual(pp, P('C:/x/y'))
+        # Joining with a different drive => the first path is ignored, even
+        # if the second path is relative.
+        pp = p.joinpath('D:x/y')
+        self.assertEqual(pp, P('D:x/y'))
+        pp = p.joinpath('D:/x/y')
+        self.assertEqual(pp, P('D:/x/y'))
+        pp = p.joinpath('//host/share/x/y')
+        self.assertEqual(pp, P('//host/share/x/y'))
+        # Joining with the same drive => the first path is appended to if
+        # the second path is relative.
+        pp = p.joinpath('c:x/y')
+        self.assertEqual(pp, P('C:/a/b/x/y'))
+        pp = p.joinpath('c:/x/y')
+        self.assertEqual(pp, P('C:/x/y'))
+
+    def test_div(self):
+        # Basically the same as joinpath()
+        P = self.cls
+        p = P('C:/a/b')
+        self.assertEqual(p / 'x/y', P('C:/a/b/x/y'))
+        self.assertEqual(p / 'x' / 'y', P('C:/a/b/x/y'))
+        self.assertEqual(p / '/x/y', P('C:/x/y'))
+        self.assertEqual(p / '/x' / 'y', P('C:/x/y'))
+        # Joining with a different drive => the first path is ignored, even
+        # if the second path is relative.
+        self.assertEqual(p / 'D:x/y', P('D:x/y'))
+        self.assertEqual(p / 'D:' / 'x/y', P('D:x/y'))
+        self.assertEqual(p / 'D:/x/y', P('D:/x/y'))
+        self.assertEqual(p / 'D:' / '/x/y', P('D:/x/y'))
+        self.assertEqual(p / '//host/share/x/y', P('//host/share/x/y'))
+        # Joining with the same drive => the first path is appended to if
+        # the second path is relative.
+        self.assertEqual(p / 'c:x/y', P('C:/a/b/x/y'))
+        self.assertEqual(p / 'c:/x/y', P('C:/x/y'))
+
+    def test_is_reserved(self):
+        P = self.cls
+        self.assertIs(False, P('').is_reserved())
+        self.assertIs(False, P('/').is_reserved())
+        self.assertIs(False, P('/foo/bar').is_reserved())
+        self.assertIs(True, P('con').is_reserved())
+        self.assertIs(True, P('NUL').is_reserved())
+        self.assertIs(True, P('NUL.txt').is_reserved())
+        self.assertIs(True, P('com1').is_reserved())
+        self.assertIs(True, P('com9.bar').is_reserved())
+        self.assertIs(False, P('bar.com9').is_reserved())
+        self.assertIs(True, P('lpt1').is_reserved())
+        self.assertIs(True, P('lpt9.bar').is_reserved())
+        self.assertIs(False, P('bar.lpt9').is_reserved())
+        # Only the last component matters
+        self.assertIs(False, P('c:/NUL/con/baz').is_reserved())
+        # UNC paths are never reserved
+        self.assertIs(False, P('//my/share/nul/con/aux').is_reserved())
+
+
+class PurePathTest(_BasePurePathTest, unittest.TestCase):
+    cls = pathlib.PurePath
+
+    def test_concrete_class(self):
+        p = self.cls('a')
+        self.assertIs(type(p),
+            pathlib.PureWindowsPath if os.name == 'nt' else pathlib.PurePosixPath)
+
+    def test_different_flavours_unequal(self):
+        p = pathlib.PurePosixPath('a')
+        q = pathlib.PureWindowsPath('a')
+        self.assertNotEqual(p, q)
+
+    def test_different_flavours_unordered(self):
+        p = pathlib.PurePosixPath('a')
+        q = pathlib.PureWindowsPath('a')
+        with self.assertRaises(TypeError):
+            p < q
+        with self.assertRaises(TypeError):
+            p <= q
+        with self.assertRaises(TypeError):
+            p > q
+        with self.assertRaises(TypeError):
+            p >= q
+
+
+#
+# Tests for the concrete classes
+#
+
+# Make sure any symbolic links in the base test path are resolved
+BASE = os.path.realpath(TESTFN)
+join = lambda *x: os.path.join(BASE, *x)
+rel_join = lambda *x: os.path.join(TESTFN, *x)
+
+def symlink_skip_reason():
+    if not pathlib.supports_symlinks:
+        return "no system support for symlinks"
+    try:
+        os.symlink(__file__, BASE)
+    except OSError as e:
+        return str(e)
+    else:
+        support.unlink(BASE)
+    return None
+
+symlink_skip_reason = symlink_skip_reason()
+
+only_nt = unittest.skipIf(os.name != 'nt',
+                          'test requires a Windows-compatible system')
+only_posix = unittest.skipIf(os.name == 'nt',
+                             'test requires a POSIX-compatible system')
+with_symlinks = unittest.skipIf(symlink_skip_reason, symlink_skip_reason)
+
+
+@only_posix
+class PosixPathAsPureTest(PurePosixPathTest):
+    cls = pathlib.PosixPath
+
+@only_nt
+class WindowsPathAsPureTest(PureWindowsPathTest):
+    cls = pathlib.WindowsPath
+
+
+class _BasePathTest(object):
+    """Tests for the FS-accessing functionalities of the Path classes."""
+
+    # (BASE)
+    #  |
+    #  |-- dirA/
+    #       |-- linkC -> "../dirB"
+    #  |-- dirB/
+    #  |    |-- fileB
+    #       |-- linkD -> "../dirB"
+    #  |-- dirC/
+    #  |    |-- fileC
+    #  |    |-- fileD
+    #  |-- fileA
+    #  |-- linkA -> "fileA"
+    #  |-- linkB -> "dirB"
+    #
+
+    def setUp(self):
+        os.mkdir(BASE)
+        self.addCleanup(support.rmtree, BASE)
+        os.mkdir(join('dirA'))
+        os.mkdir(join('dirB'))
+        os.mkdir(join('dirC'))
+        os.mkdir(join('dirC', 'dirD'))
+        with open(join('fileA'), 'wb') as f:
+            f.write(b"this is file A\n")
+        with open(join('dirB', 'fileB'), 'wb') as f:
+            f.write(b"this is file B\n")
+        with open(join('dirC', 'fileC'), 'wb') as f:
+            f.write(b"this is file C\n")
+        with open(join('dirC', 'dirD', 'fileD'), 'wb') as f:
+            f.write(b"this is file D\n")
+        if not symlink_skip_reason:
+            # Relative symlinks
+            os.symlink('fileA', join('linkA'))
+            os.symlink('non-existing', join('brokenLink'))
+            self.dirlink('dirB', join('linkB'))
+            self.dirlink(os.path.join('..', 'dirB'), join('dirA', 'linkC'))
+            # This one goes upwards but doesn't create a loop
+            self.dirlink(os.path.join('..', 'dirB'), join('dirB', 'linkD'))
+
+    if os.name == 'nt':
+        # Workaround for http://bugs.python.org/issue13772
+        def dirlink(self, src, dest):
+            os.symlink(src, dest, target_is_directory=True)
+    else:
+        def dirlink(self, src, dest):
+            os.symlink(src, dest)
+
+    def assertSame(self, path_a, path_b):
+        self.assertTrue(os.path.samefile(str(path_a), str(path_b)),
+                        "%r and %r don't point to the same file" %
+                        (path_a, path_b))
+
+    def assertFileNotFound(self, func, *args, **kwargs):
+        with self.assertRaises(FileNotFoundError) as cm:
+            func(*args, **kwargs)
+        self.assertEqual(cm.exception.errno, errno.ENOENT)
+
+    def _test_cwd(self, p):
+        q = self.cls(os.getcwd())
+        self.assertEqual(p, q)
+        self.assertEqual(str(p), str(q))
+        self.assertIs(type(p), type(q))
+        self.assertTrue(p.is_absolute())
+
+    def test_cwd(self):
+        p = self.cls.cwd()
+        self._test_cwd(p)
+
+    def test_empty_path(self):
+        # The empty path points to '.'
+        p = self.cls('')
+        self.assertEqual(p.stat(), os.stat('.'))
+
+    def test_exists(self):
+        P = self.cls
+        p = P(BASE)
+        self.assertIs(True, p.exists())
+        self.assertIs(True, (p / 'dirA').exists())
+        self.assertIs(True, (p / 'fileA').exists())
+        self.assertIs(False, (p / 'fileA' / 'bah').exists())
+        if not symlink_skip_reason:
+            self.assertIs(True, (p / 'linkA').exists())
+            self.assertIs(True, (p / 'linkB').exists())
+            self.assertIs(True, (p / 'linkB' / 'fileB').exists())
+            self.assertIs(False, (p / 'linkA' / 'bah').exists())
+        self.assertIs(False, (p / 'foo').exists())
+        self.assertIs(False, P('/xyzzy').exists())
+
+    def test_open_common(self):
+        p = self.cls(BASE)
+        with (p / 'fileA').open('r') as f:
+            self.assertIsInstance(f, io.TextIOBase)
+            self.assertEqual(f.read(), "this is file A\n")
+        with (p / 'fileA').open('rb') as f:
+            self.assertIsInstance(f, io.BufferedIOBase)
+            self.assertEqual(f.read().strip(), b"this is file A")
+        with (p / 'fileA').open('rb', buffering=0) as f:
+            self.assertIsInstance(f, io.RawIOBase)
+            self.assertEqual(f.read().strip(), b"this is file A")
+
+    def test_iterdir(self):
+        P = self.cls
+        p = P(BASE)
+        it = p.iterdir()
+        paths = set(it)
+        expected = ['dirA', 'dirB', 'dirC', 'fileA']
+        if not symlink_skip_reason:
+            expected += ['linkA', 'linkB', 'brokenLink']
+        self.assertEqual(paths, { P(BASE, q) for q in expected })
+
+    @with_symlinks
+    def test_iterdir_symlink(self):
+        # __iter__ on a symlink to a directory
+        P = self.cls
+        p = P(BASE, 'linkB')
+        paths = set(p.iterdir())
+        expected = { P(BASE, 'linkB', q) for q in ['fileB', 'linkD'] }
+        self.assertEqual(paths, expected)
+
+    def test_iterdir_nodir(self):
+        # __iter__ on something that is not a directory
+        p = self.cls(BASE, 'fileA')
+        with self.assertRaises(OSError) as cm:
+            next(p.iterdir())
+        # ENOENT or EINVAL under Windows, ENOTDIR otherwise
+        # (see issue #12802)
+        self.assertIn(cm.exception.errno, (errno.ENOTDIR,
+                                           errno.ENOENT, errno.EINVAL))
+
+    def test_glob_common(self):
+        def _check(glob, expected):
+            self.assertEqual(set(glob), { P(BASE, q) for q in expected })
+        P = self.cls
+        p = P(BASE)
+        it = p.glob("fileA")
+        self.assertIsInstance(it, collections.Iterator)
+        _check(it, ["fileA"])
+        _check(p.glob("fileB"), [])
+        _check(p.glob("dir*/file*"), ["dirB/fileB", "dirC/fileC"])
+        if symlink_skip_reason:
+            _check(p.glob("*A"), ['dirA', 'fileA'])
+        else:
+            _check(p.glob("*A"), ['dirA', 'fileA', 'linkA'])
+        if symlink_skip_reason:
+            _check(p.glob("*B/*"), ['dirB/fileB'])
+        else:
+            _check(p.glob("*B/*"), ['dirB/fileB', 'dirB/linkD',
+                                    'linkB/fileB', 'linkB/linkD'])
+        if symlink_skip_reason:
+            _check(p.glob("*/fileB"), ['dirB/fileB'])
+        else:
+            _check(p.glob("*/fileB"), ['dirB/fileB', 'linkB/fileB'])
+
+    def test_rglob_common(self):
+        def _check(glob, expected):
+            self.assertEqual(set(glob), { P(BASE, q) for q in expected })
+        P = self.cls
+        p = P(BASE)
+        it = p.rglob("fileA")
+        self.assertIsInstance(it, collections.Iterator)
+        # XXX cannot test because of symlink loops in the test setup
+        #_check(it, ["fileA"])
+        #_check(p.rglob("fileB"), ["dirB/fileB"])
+        #_check(p.rglob("*/fileA"), [""])
+        #_check(p.rglob("*/fileB"), ["dirB/fileB"])
+        #_check(p.rglob("file*"), ["fileA", "dirB/fileB"])
+        # No symlink loops here
+        p = P(BASE, "dirC")
+        _check(p.rglob("file*"), ["dirC/fileC", "dirC/dirD/fileD"])
+        _check(p.rglob("*/*"), ["dirC/dirD/fileD"])
+
+    def test_glob_dotdot(self):
+        # ".." is not special in globs
+        P = self.cls
+        p = P(BASE)
+        self.assertEqual(set(p.glob("..")), { P(BASE, "..") })
+        self.assertEqual(set(p.glob("dirA/../file*")), { P(BASE, "dirA/../fileA") })
+        self.assertEqual(set(p.glob("../xyzzy")), set())
+
+    def _check_resolve_relative(self, p, expected):
+        q = p.resolve()
+        self.assertEqual(q, expected)
+
+    def _check_resolve_absolute(self, p, expected):
+        q = p.resolve()
+        self.assertEqual(q, expected)
+
+    @with_symlinks
+    def test_resolve_common(self):
+        P = self.cls
+        p = P(BASE, 'foo')
+        with self.assertRaises(OSError) as cm:
+            p.resolve()
+        self.assertEqual(cm.exception.errno, errno.ENOENT)
+        # These are all relative symlinks
+        p = P(BASE, 'dirB', 'fileB')
+        self._check_resolve_relative(p, p)
+        p = P(BASE, 'linkA')
+        self._check_resolve_relative(p, P(BASE, 'fileA'))
+        p = P(BASE, 'dirA', 'linkC', 'fileB')
+        self._check_resolve_relative(p, P(BASE, 'dirB', 'fileB'))
+        p = P(BASE, 'dirB', 'linkD', 'fileB')
+        self._check_resolve_relative(p, P(BASE, 'dirB', 'fileB'))
+        # Now create absolute symlinks
+        d = tempfile.mkdtemp(suffix='-dirD')
+        self.addCleanup(support.rmtree, d)
+        os.symlink(os.path.join(d), join('dirA', 'linkX'))
+        os.symlink(join('dirB'), os.path.join(d, 'linkY'))
+        p = P(BASE, 'dirA', 'linkX', 'linkY', 'fileB')
+        self._check_resolve_absolute(p, P(BASE, 'dirB', 'fileB'))
+
+    @with_symlinks
+    def test_resolve_dot(self):
+        # See https://bitbucket.org/pitrou/pathlib/issue/9/pathresolve-fails-on-complex-symlinks
+        p = self.cls(BASE)
+        self.dirlink('.', join('0'))
+        self.dirlink(os.path.join('0', '0'), join('1'))
+        self.dirlink(os.path.join('1', '1'), join('2'))
+        q = p / '2'
+        self.assertEqual(q.resolve(), p)
+
+    def test_with(self):
+        p = self.cls(BASE)
+        it = p.iterdir()
+        it2 = p.iterdir()
+        next(it2)
+        with p:
+            pass
+        # I/O operation on closed path
+        self.assertRaises(ValueError, next, it)
+        self.assertRaises(ValueError, next, it2)
+        self.assertRaises(ValueError, p.open)
+        self.assertRaises(ValueError, p.resolve)
+        self.assertRaises(ValueError, p.absolute)
+        self.assertRaises(ValueError, p.__enter__)
+
+    def test_chmod(self):
+        p = self.cls(BASE) / 'fileA'
+        mode = p.stat().st_mode
+        # Clear writable bit
+        new_mode = mode & ~0o222
+        p.chmod(new_mode)
+        self.assertEqual(p.stat().st_mode, new_mode)
+        # Set writable bit
+        new_mode = mode | 0o222
+        p.chmod(new_mode)
+        self.assertEqual(p.stat().st_mode, new_mode)
+
+    # XXX also need a test for lchmod
+
+    def test_stat(self):
+        p = self.cls(BASE) / 'fileA'
+        st = p.stat()
+        self.assertEqual(p.stat(), st)
+        # Change file mode by flipping write bit
+        p.chmod(st.st_mode ^ 0o222)
+        self.addCleanup(p.chmod, st.st_mode)
+        self.assertNotEqual(p.stat(), st)
+
+    @with_symlinks
+    def test_lstat(self):
+        p = self.cls(BASE)/ 'linkA'
+        st = p.stat()
+        self.assertNotEqual(st, p.lstat())
+
+    def test_lstat_nosymlink(self):
+        p = self.cls(BASE) / 'fileA'
+        st = p.stat()
+        self.assertEqual(st, p.lstat())
+
+    @unittest.skipUnless(pwd, "the pwd module is needed for this test")
+    def test_owner(self):
+        p = self.cls(BASE) / 'fileA'
+        uid = p.stat().st_uid
+        try:
+            name = pwd.getpwuid(uid).pw_name
+        except KeyError:
+            self.skipTest(
+                "user %d doesn't have an entry in the system database" % uid)
+        self.assertEqual(name, p.owner())
+
+    @unittest.skipUnless(grp, "the grp module is needed for this test")
+    def test_group(self):
+        p = self.cls(BASE) / 'fileA'
+        gid = p.stat().st_gid
+        try:
+            name = grp.getgrgid(gid).gr_name
+        except KeyError:
+            self.skipTest(
+                "group %d doesn't have an entry in the system database" % gid)
+        self.assertEqual(name, p.group())
+
+    def test_unlink(self):
+        p = self.cls(BASE) / 'fileA'
+        p.unlink()
+        self.assertFileNotFound(p.stat)
+        self.assertFileNotFound(p.unlink)
+
+    def test_rmdir(self):
+        p = self.cls(BASE) / 'dirA'
+        for q in p.iterdir():
+            q.unlink()
+        p.rmdir()
+        self.assertFileNotFound(p.stat)
+        self.assertFileNotFound(p.unlink)
+
+    def test_rename(self):
+        P = self.cls(BASE)
+        p = P / 'fileA'
+        size = p.stat().st_size
+        # Renaming to another path
+        q = P / 'dirA' / 'fileAA'
+        p.rename(q)
+        self.assertEqual(q.stat().st_size, size)
+        self.assertFileNotFound(p.stat)
+        # Renaming to a str of a relative path
+        r = rel_join('fileAAA')
+        q.rename(r)
+        self.assertEqual(os.stat(r).st_size, size)
+        self.assertFileNotFound(q.stat)
+
+    def test_replace(self):
+        P = self.cls(BASE)
+        p = P / 'fileA'
+        size = p.stat().st_size
+        # Replacing a non-existing path
+        q = P / 'dirA' / 'fileAA'
+        p.replace(q)
+        self.assertEqual(q.stat().st_size, size)
+        self.assertFileNotFound(p.stat)
+        # Replacing another (existing) path
+        r = rel_join('dirB', 'fileB')
+        q.replace(r)
+        self.assertEqual(os.stat(r).st_size, size)
+        self.assertFileNotFound(q.stat)
+
+    def test_touch_common(self):
+        P = self.cls(BASE)
+        p = P / 'newfileA'
+        self.assertFalse(p.exists())
+        p.touch()
+        self.assertTrue(p.exists())
+        st = p.stat()
+        old_mtime = st.st_mtime
+        old_mtime_ns = st.st_mtime_ns
+        # Rewind the mtime sufficiently far in the past to work around
+        # filesystem-specific timestamp granularity.
+        os.utime(str(p), (old_mtime - 10, old_mtime - 10))
+        # The file mtime should be refreshed by calling touch() again
+        p.touch()
+        st = p.stat()
+        self.assertGreaterEqual(st.st_mtime_ns, old_mtime_ns)
+        self.assertGreaterEqual(st.st_mtime, old_mtime)
+        # Now with exist_ok=False
+        p = P / 'newfileB'
+        self.assertFalse(p.exists())
+        p.touch(mode=0o700, exist_ok=False)
+        self.assertTrue(p.exists())
+        self.assertRaises(OSError, p.touch, exist_ok=False)
+
+    def test_touch_nochange(self):
+        P = self.cls(BASE)
+        p = P / 'fileA'
+        p.touch()
+        with p.open('rb') as f:
+            self.assertEqual(f.read().strip(), b"this is file A")
+
+    def test_mkdir(self):
+        P = self.cls(BASE)
+        p = P / 'newdirA'
+        self.assertFalse(p.exists())
+        p.mkdir()
+        self.assertTrue(p.exists())
+        self.assertTrue(p.is_dir())
+        with self.assertRaises(OSError) as cm:
+            p.mkdir()
+        self.assertEqual(cm.exception.errno, errno.EEXIST)
+
+    def test_mkdir_parents(self):
+        # Creating a chain of directories
+        p = self.cls(BASE, 'newdirB', 'newdirC')
+        self.assertFalse(p.exists())
+        with self.assertRaises(OSError) as cm:
+            p.mkdir()
+        self.assertEqual(cm.exception.errno, errno.ENOENT)
+        p.mkdir(parents=True)
+        self.assertTrue(p.exists())
+        self.assertTrue(p.is_dir())
+        with self.assertRaises(OSError) as cm:
+            p.mkdir(parents=True)
+        self.assertEqual(cm.exception.errno, errno.EEXIST)
+        # test `mode` arg
+        mode = stat.S_IMODE(p.stat().st_mode) # default mode
+        p = self.cls(BASE, 'newdirD', 'newdirE')
+        p.mkdir(0o555, parents=True)
+        self.assertTrue(p.exists())
+        self.assertTrue(p.is_dir())
+        if os.name != 'nt':
+            # the directory's permissions follow the mode argument
+            self.assertEqual(stat.S_IMODE(p.stat().st_mode), 0o7555 & mode)
+        # the parent's permissions follow the default process settings
+        self.assertEqual(stat.S_IMODE(p.parent.stat().st_mode), mode)
+
+    @with_symlinks
+    def test_symlink_to(self):
+        P = self.cls(BASE)
+        target = P / 'fileA'
+        # Symlinking a path target
+        link = P / 'dirA' / 'linkAA'
+        link.symlink_to(target)
+        self.assertEqual(link.stat(), target.stat())
+        self.assertNotEqual(link.lstat(), target.stat())
+        # Symlinking a str target
+        link = P / 'dirA' / 'linkAAA'
+        link.symlink_to(str(target))
+        self.assertEqual(link.stat(), target.stat())
+        self.assertNotEqual(link.lstat(), target.stat())
+        self.assertFalse(link.is_dir())
+        # Symlinking to a directory
+        target = P / 'dirB'
+        link = P / 'dirA' / 'linkAAAA'
+        link.symlink_to(target, target_is_directory=True)
+        self.assertEqual(link.stat(), target.stat())
+        self.assertNotEqual(link.lstat(), target.stat())
+        self.assertTrue(link.is_dir())
+        self.assertTrue(list(link.iterdir()))
+
+    def test_is_dir(self):
+        P = self.cls(BASE)
+        self.assertTrue((P / 'dirA').is_dir())
+        self.assertFalse((P / 'fileA').is_dir())
+        self.assertFalse((P / 'non-existing').is_dir())
+        self.assertFalse((P / 'fileA' / 'bah').is_dir())
+        if not symlink_skip_reason:
+            self.assertFalse((P / 'linkA').is_dir())
+            self.assertTrue((P / 'linkB').is_dir())
+            self.assertFalse((P/ 'brokenLink').is_dir())
+
+    def test_is_file(self):
+        P = self.cls(BASE)
+        self.assertTrue((P / 'fileA').is_file())
+        self.assertFalse((P / 'dirA').is_file())
+        self.assertFalse((P / 'non-existing').is_file())
+        self.assertFalse((P / 'fileA' / 'bah').is_file())
+        if not symlink_skip_reason:
+            self.assertTrue((P / 'linkA').is_file())
+            self.assertFalse((P / 'linkB').is_file())
+            self.assertFalse((P/ 'brokenLink').is_file())
+
+    def test_is_symlink(self):
+        P = self.cls(BASE)
+        self.assertFalse((P / 'fileA').is_symlink())
+        self.assertFalse((P / 'dirA').is_symlink())
+        self.assertFalse((P / 'non-existing').is_symlink())
+        self.assertFalse((P / 'fileA' / 'bah').is_symlink())
+        if not symlink_skip_reason:
+            self.assertTrue((P / 'linkA').is_symlink())
+            self.assertTrue((P / 'linkB').is_symlink())
+            self.assertTrue((P/ 'brokenLink').is_symlink())
+
+    def test_is_fifo_false(self):
+        P = self.cls(BASE)
+        self.assertFalse((P / 'fileA').is_fifo())
+        self.assertFalse((P / 'dirA').is_fifo())
+        self.assertFalse((P / 'non-existing').is_fifo())
+        self.assertFalse((P / 'fileA' / 'bah').is_fifo())
+
+    @unittest.skipUnless(hasattr(os, "mkfifo"), "os.mkfifo() required")
+    def test_is_fifo_true(self):
+        P = self.cls(BASE, 'myfifo')
+        os.mkfifo(str(P))
+        self.assertTrue(P.is_fifo())
+        self.assertFalse(P.is_socket())
+        self.assertFalse(P.is_file())
+
+    def test_is_socket_false(self):
+        P = self.cls(BASE)
+        self.assertFalse((P / 'fileA').is_socket())
+        self.assertFalse((P / 'dirA').is_socket())
+        self.assertFalse((P / 'non-existing').is_socket())
+        self.assertFalse((P / 'fileA' / 'bah').is_socket())
+
+    @unittest.skipUnless(hasattr(socket, "AF_UNIX"), "Unix sockets required")
+    def test_is_socket_true(self):
+        P = self.cls(BASE, 'mysock')
+        sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
+        self.addCleanup(sock.close)
+        try:
+            sock.bind(str(P))
+        except OSError as e:
+            if "AF_UNIX path too long" in str(e):
+                self.skipTest("cannot bind Unix socket: " + str(e))
+        self.assertTrue(P.is_socket())
+        self.assertFalse(P.is_fifo())
+        self.assertFalse(P.is_file())
+
+    def test_is_block_device_false(self):
+        P = self.cls(BASE)
+        self.assertFalse((P / 'fileA').is_block_device())
+        self.assertFalse((P / 'dirA').is_block_device())
+        self.assertFalse((P / 'non-existing').is_block_device())
+        self.assertFalse((P / 'fileA' / 'bah').is_block_device())
+
+    def test_is_char_device_false(self):
+        P = self.cls(BASE)
+        self.assertFalse((P / 'fileA').is_char_device())
+        self.assertFalse((P / 'dirA').is_char_device())
+        self.assertFalse((P / 'non-existing').is_char_device())
+        self.assertFalse((P / 'fileA' / 'bah').is_char_device())
+
+    def test_is_char_device_true(self):
+        # Under Unix, /dev/null should generally be a char device
+        P = self.cls('/dev/null')
+        if not P.exists():
+            self.skipTest("/dev/null required")
+        self.assertTrue(P.is_char_device())
+        self.assertFalse(P.is_block_device())
+        self.assertFalse(P.is_file())
+
+    def test_pickling_common(self):
+        p = self.cls(BASE, 'fileA')
+        for proto in range(0, pickle.HIGHEST_PROTOCOL + 1):
+            dumped = pickle.dumps(p, proto)
+            pp = pickle.loads(dumped)
+            self.assertEqual(pp.stat(), p.stat())
+
+    def test_parts_interning(self):
+        P = self.cls
+        p = P('/usr/bin/foo')
+        q = P('/usr/local/bin')
+        # 'usr'
+        self.assertIs(p.parts[1], q.parts[1])
+        # 'bin'
+        self.assertIs(p.parts[2], q.parts[3])
+
+    def _check_complex_symlinks(self, link0_target):
+        # Test solving a non-looping chain of symlinks (issue #19887)
+        P = self.cls(BASE)
+        self.dirlink(os.path.join('link0', 'link0'), join('link1'))
+        self.dirlink(os.path.join('link1', 'link1'), join('link2'))
+        self.dirlink(os.path.join('link2', 'link2'), join('link3'))
+        self.dirlink(link0_target, join('link0'))
+
+        # Resolve absolute paths
+        p = (P / 'link0').resolve()
+        self.assertEqual(p, P)
+        self.assertEqual(str(p), BASE)
+        p = (P / 'link1').resolve()
+        self.assertEqual(p, P)
+        self.assertEqual(str(p), BASE)
+        p = (P / 'link2').resolve()
+        self.assertEqual(p, P)
+        self.assertEqual(str(p), BASE)
+        p = (P / 'link3').resolve()
+        self.assertEqual(p, P)
+        self.assertEqual(str(p), BASE)
+
+        # Resolve relative paths
+        old_path = os.getcwd()
+        os.chdir(BASE)
+        try:
+            p = self.cls('link0').resolve()
+            self.assertEqual(p, P)
+            self.assertEqual(str(p), BASE)
+            p = self.cls('link1').resolve()
+            self.assertEqual(p, P)
+            self.assertEqual(str(p), BASE)
+            p = self.cls('link2').resolve()
+            self.assertEqual(p, P)
+            self.assertEqual(str(p), BASE)
+            p = self.cls('link3').resolve()
+            self.assertEqual(p, P)
+            self.assertEqual(str(p), BASE)
+        finally:
+            os.chdir(old_path)
+
+    @with_symlinks
+    def test_complex_symlinks_absolute(self):
+        self._check_complex_symlinks(BASE)
+
+    @with_symlinks
+    def test_complex_symlinks_relative(self):
+        self._check_complex_symlinks('.')
+
+    @with_symlinks
+    def test_complex_symlinks_relative_dot_dot(self):
+        self._check_complex_symlinks(os.path.join('dirA', '..'))
+
+
+class PathTest(_BasePathTest, unittest.TestCase):
+    cls = pathlib.Path
+
+    def test_concrete_class(self):
+        p = self.cls('a')
+        self.assertIs(type(p),
+            pathlib.WindowsPath if os.name == 'nt' else pathlib.PosixPath)
+
+    def test_unsupported_flavour(self):
+        if os.name == 'nt':
+            self.assertRaises(NotImplementedError, pathlib.PosixPath)
+        else:
+            self.assertRaises(NotImplementedError, pathlib.WindowsPath)
+
+
+@only_posix
+class PosixPathTest(_BasePathTest, unittest.TestCase):
+    cls = pathlib.PosixPath
+
+    def _check_symlink_loop(self, *args):
+        path = self.cls(*args)
+        with self.assertRaises(RuntimeError):
+            print(path.resolve())
+
+    def test_open_mode(self):
+        old_mask = os.umask(0)
+        self.addCleanup(os.umask, old_mask)
+        p = self.cls(BASE)
+        with (p / 'new_file').open('wb'):
+            pass
+        st = os.stat(join('new_file'))
+        self.assertEqual(stat.S_IMODE(st.st_mode), 0o666)
+        os.umask(0o022)
+        with (p / 'other_new_file').open('wb'):
+            pass
+        st = os.stat(join('other_new_file'))
+        self.assertEqual(stat.S_IMODE(st.st_mode), 0o644)
+
+    def test_touch_mode(self):
+        old_mask = os.umask(0)
+        self.addCleanup(os.umask, old_mask)
+        p = self.cls(BASE)
+        (p / 'new_file').touch()
+        st = os.stat(join('new_file'))
+        self.assertEqual(stat.S_IMODE(st.st_mode), 0o666)
+        os.umask(0o022)
+        (p / 'other_new_file').touch()
+        st = os.stat(join('other_new_file'))
+        self.assertEqual(stat.S_IMODE(st.st_mode), 0o644)
+        (p / 'masked_new_file').touch(mode=0o750)
+        st = os.stat(join('masked_new_file'))
+        self.assertEqual(stat.S_IMODE(st.st_mode), 0o750)
+
+    @with_symlinks
+    def test_resolve_loop(self):
+        # Loop detection for broken symlinks under POSIX
+        P = self.cls
+        # Loops with relative symlinks
+        os.symlink('linkX/inside', join('linkX'))
+        self._check_symlink_loop(BASE, 'linkX')
+        os.symlink('linkY', join('linkY'))
+        self._check_symlink_loop(BASE, 'linkY')
+        os.symlink('linkZ/../linkZ', join('linkZ'))
+        self._check_symlink_loop(BASE, 'linkZ')
+        # Loops with absolute symlinks
+        os.symlink(join('linkU/inside'), join('linkU'))
+        self._check_symlink_loop(BASE, 'linkU')
+        os.symlink(join('linkV'), join('linkV'))
+        self._check_symlink_loop(BASE, 'linkV')
+        os.symlink(join('linkW/../linkW'), join('linkW'))
+        self._check_symlink_loop(BASE, 'linkW')
+
+    def test_glob(self):
+        P = self.cls
+        p = P(BASE)
+        given = set(p.glob("FILEa"))
+        expect = set() if not support.fs_is_case_insensitive(BASE) else given
+        self.assertEqual(given, expect)
+        self.assertEqual(set(p.glob("FILEa*")), set())
+
+    def test_rglob(self):
+        P = self.cls
+        p = P(BASE, "dirC")
+        given = set(p.rglob("FILEd"))
+        expect = set() if not support.fs_is_case_insensitive(BASE) else given
+        self.assertEqual(given, expect)
+        self.assertEqual(set(p.rglob("FILEd*")), set())
+
+
+@only_nt
+class WindowsPathTest(_BasePathTest, unittest.TestCase):
+    cls = pathlib.WindowsPath
+
+    def test_glob(self):
+        P = self.cls
+        p = P(BASE)
+        self.assertEqual(set(p.glob("FILEa")), { P(BASE, "fileA") })
+
+    def test_rglob(self):
+        P = self.cls
+        p = P(BASE, "dirC")
+        self.assertEqual(set(p.rglob("FILEd")), { P(BASE, "dirC/dirD/fileD") })
+
+
+if __name__ == "__main__":
+    unittest.main()
diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py
index 03084e4..edc9e75 100644
--- a/Lib/test/test_pdb.py
+++ b/Lib/test/test_pdb.py
@@ -1,9 +1,9 @@
 # A test suite for pdb; not very comprehensive at the moment.
 
 import doctest
-import imp
 import pdb
 import sys
+import types
 import unittest
 import subprocess
 import textwrap
@@ -205,7 +205,8 @@
     ...     'enable 1',
     ...     'clear 1',
     ...     'commands 2',
-    ...     'print 42',
+    ...     'p "42"',
+    ...     'print("42", 7*6)',     # Issue 18764 (not about breakpoints)
     ...     'end',
     ...     'continue',  # will stop at breakpoint 2 (line 4)
     ...     'clear',     # clear all!
@@ -252,11 +253,13 @@
     (Pdb) clear 1
     Deleted breakpoint 1 at <doctest test.test_pdb.test_pdb_breakpoint_commands[0]>:3
     (Pdb) commands 2
-    (com) print 42
+    (com) p "42"
+    (com) print("42", 7*6)
     (com) end
     (Pdb) continue
     1
-    42
+    '42'
+    42 42
     > <doctest test.test_pdb.test_pdb_breakpoint_commands[0]>(4)test_function()
     -> print(2)
     (Pdb) clear
@@ -464,7 +467,7 @@
 
 
 # Module for testing skipping of module that makes a callback
-mod = imp.new_module('module_to_skip')
+mod = types.ModuleType('module_to_skip')
 exec('def foo_pony(callback): x = 1; callback(); return None', mod.__dict__)
 
 
@@ -597,6 +600,313 @@
     (Pdb) continue
     """
 
+def test_next_until_return_at_return_event():
+    """Test that pdb stops after a next/until/return issued at a return debug event.
+
+    >>> def test_function_2():
+    ...     x = 1
+    ...     x = 2
+
+    >>> def test_function():
+    ...     import pdb; pdb.Pdb(nosigint=True).set_trace()
+    ...     test_function_2()
+    ...     test_function_2()
+    ...     test_function_2()
+    ...     end = 1
+
+    >>> from bdb import Breakpoint
+    >>> Breakpoint.next = 1
+    >>> with PdbTestInput(['break test_function_2',
+    ...                    'continue',
+    ...                    'return',
+    ...                    'next',
+    ...                    'continue',
+    ...                    'return',
+    ...                    'until',
+    ...                    'continue',
+    ...                    'return',
+    ...                    'return',
+    ...                    'continue']):
+    ...     test_function()
+    > <doctest test.test_pdb.test_next_until_return_at_return_event[1]>(3)test_function()
+    -> test_function_2()
+    (Pdb) break test_function_2
+    Breakpoint 1 at <doctest test.test_pdb.test_next_until_return_at_return_event[0]>:1
+    (Pdb) continue
+    > <doctest test.test_pdb.test_next_until_return_at_return_event[0]>(2)test_function_2()
+    -> x = 1
+    (Pdb) return
+    --Return--
+    > <doctest test.test_pdb.test_next_until_return_at_return_event[0]>(3)test_function_2()->None
+    -> x = 2
+    (Pdb) next
+    > <doctest test.test_pdb.test_next_until_return_at_return_event[1]>(4)test_function()
+    -> test_function_2()
+    (Pdb) continue
+    > <doctest test.test_pdb.test_next_until_return_at_return_event[0]>(2)test_function_2()
+    -> x = 1
+    (Pdb) return
+    --Return--
+    > <doctest test.test_pdb.test_next_until_return_at_return_event[0]>(3)test_function_2()->None
+    -> x = 2
+    (Pdb) until
+    > <doctest test.test_pdb.test_next_until_return_at_return_event[1]>(5)test_function()
+    -> test_function_2()
+    (Pdb) continue
+    > <doctest test.test_pdb.test_next_until_return_at_return_event[0]>(2)test_function_2()
+    -> x = 1
+    (Pdb) return
+    --Return--
+    > <doctest test.test_pdb.test_next_until_return_at_return_event[0]>(3)test_function_2()->None
+    -> x = 2
+    (Pdb) return
+    > <doctest test.test_pdb.test_next_until_return_at_return_event[1]>(6)test_function()
+    -> end = 1
+    (Pdb) continue
+    """
+
+def test_pdb_next_command_for_generator():
+    """Testing skip unwindng stack on yield for generators for "next" command
+
+    >>> def test_gen():
+    ...     yield 0
+    ...     return 1
+    ...     yield 2
+
+    >>> def test_function():
+    ...     import pdb; pdb.Pdb(nosigint=True).set_trace()
+    ...     it = test_gen()
+    ...     try:
+    ...         assert next(it) == 0
+    ...         next(it)
+    ...     except StopIteration as ex:
+    ...         assert ex.value == 1
+    ...     print("finished")
+
+    >>> with PdbTestInput(['step',
+    ...                    'step',
+    ...                    'step',
+    ...                    'next',
+    ...                    'next',
+    ...                    'step',
+    ...                    'step',
+    ...                    'continue']):
+    ...     test_function()
+    > <doctest test.test_pdb.test_pdb_next_command_for_generator[1]>(3)test_function()
+    -> it = test_gen()
+    (Pdb) step
+    > <doctest test.test_pdb.test_pdb_next_command_for_generator[1]>(4)test_function()
+    -> try:
+    (Pdb) step
+    > <doctest test.test_pdb.test_pdb_next_command_for_generator[1]>(5)test_function()
+    -> assert next(it) == 0
+    (Pdb) step
+    --Call--
+    > <doctest test.test_pdb.test_pdb_next_command_for_generator[0]>(1)test_gen()
+    -> def test_gen():
+    (Pdb) next
+    > <doctest test.test_pdb.test_pdb_next_command_for_generator[0]>(2)test_gen()
+    -> yield 0
+    (Pdb) next
+    > <doctest test.test_pdb.test_pdb_next_command_for_generator[0]>(3)test_gen()
+    -> return 1
+    (Pdb) step
+    --Return--
+    > <doctest test.test_pdb.test_pdb_next_command_for_generator[0]>(3)test_gen()->1
+    -> return 1
+    (Pdb) step
+    StopIteration: 1
+    > <doctest test.test_pdb.test_pdb_next_command_for_generator[1]>(6)test_function()
+    -> next(it)
+    (Pdb) continue
+    finished
+    """
+
+def test_pdb_return_command_for_generator():
+    """Testing no unwindng stack on yield for generators
+       for "return" command
+
+    >>> def test_gen():
+    ...     yield 0
+    ...     return 1
+    ...     yield 2
+
+    >>> def test_function():
+    ...     import pdb; pdb.Pdb(nosigint=True).set_trace()
+    ...     it = test_gen()
+    ...     try:
+    ...         assert next(it) == 0
+    ...         next(it)
+    ...     except StopIteration as ex:
+    ...         assert ex.value == 1
+    ...     print("finished")
+
+    >>> with PdbTestInput(['step',
+    ...                    'step',
+    ...                    'step',
+    ...                    'return',
+    ...                    'step',
+    ...                    'step',
+    ...                    'continue']):
+    ...     test_function()
+    > <doctest test.test_pdb.test_pdb_return_command_for_generator[1]>(3)test_function()
+    -> it = test_gen()
+    (Pdb) step
+    > <doctest test.test_pdb.test_pdb_return_command_for_generator[1]>(4)test_function()
+    -> try:
+    (Pdb) step
+    > <doctest test.test_pdb.test_pdb_return_command_for_generator[1]>(5)test_function()
+    -> assert next(it) == 0
+    (Pdb) step
+    --Call--
+    > <doctest test.test_pdb.test_pdb_return_command_for_generator[0]>(1)test_gen()
+    -> def test_gen():
+    (Pdb) return
+    StopIteration: 1
+    > <doctest test.test_pdb.test_pdb_return_command_for_generator[1]>(6)test_function()
+    -> next(it)
+    (Pdb) step
+    > <doctest test.test_pdb.test_pdb_return_command_for_generator[1]>(7)test_function()
+    -> except StopIteration as ex:
+    (Pdb) step
+    > <doctest test.test_pdb.test_pdb_return_command_for_generator[1]>(8)test_function()
+    -> assert ex.value == 1
+    (Pdb) continue
+    finished
+    """
+
+def test_pdb_until_command_for_generator():
+    """Testing no unwindng stack on yield for generators
+       for "until" command if target breakpoing is not reached
+
+    >>> def test_gen():
+    ...     yield 0
+    ...     yield 1
+    ...     yield 2
+
+    >>> def test_function():
+    ...     import pdb; pdb.Pdb(nosigint=True).set_trace()
+    ...     for i in test_gen():
+    ...         print(i)
+    ...     print("finished")
+
+    >>> with PdbTestInput(['step',
+    ...                    'until 4',
+    ...                    'step',
+    ...                    'step',
+    ...                    'continue']):
+    ...     test_function()
+    > <doctest test.test_pdb.test_pdb_until_command_for_generator[1]>(3)test_function()
+    -> for i in test_gen():
+    (Pdb) step
+    --Call--
+    > <doctest test.test_pdb.test_pdb_until_command_for_generator[0]>(1)test_gen()
+    -> def test_gen():
+    (Pdb) until 4
+    0
+    1
+    > <doctest test.test_pdb.test_pdb_until_command_for_generator[0]>(4)test_gen()
+    -> yield 2
+    (Pdb) step
+    --Return--
+    > <doctest test.test_pdb.test_pdb_until_command_for_generator[0]>(4)test_gen()->2
+    -> yield 2
+    (Pdb) step
+    > <doctest test.test_pdb.test_pdb_until_command_for_generator[1]>(4)test_function()
+    -> print(i)
+    (Pdb) continue
+    2
+    finished
+    """
+
+def test_pdb_next_command_in_generator_for_loop():
+    """The next command on returning from a generator controled by a for loop.
+
+    >>> def test_gen():
+    ...     yield 0
+    ...     return 1
+
+    >>> def test_function():
+    ...     import pdb; pdb.Pdb(nosigint=True).set_trace()
+    ...     for i in test_gen():
+    ...         print('value', i)
+    ...     x = 123
+
+    >>> with PdbTestInput(['break test_gen',
+    ...                    'continue',
+    ...                    'next',
+    ...                    'next',
+    ...                    'next',
+    ...                    'continue']):
+    ...     test_function()
+    > <doctest test.test_pdb.test_pdb_next_command_in_generator_for_loop[1]>(3)test_function()
+    -> for i in test_gen():
+    (Pdb) break test_gen
+    Breakpoint 6 at <doctest test.test_pdb.test_pdb_next_command_in_generator_for_loop[0]>:1
+    (Pdb) continue
+    > <doctest test.test_pdb.test_pdb_next_command_in_generator_for_loop[0]>(2)test_gen()
+    -> yield 0
+    (Pdb) next
+    value 0
+    > <doctest test.test_pdb.test_pdb_next_command_in_generator_for_loop[0]>(3)test_gen()
+    -> return 1
+    (Pdb) next
+    Internal StopIteration: 1
+    > <doctest test.test_pdb.test_pdb_next_command_in_generator_for_loop[1]>(3)test_function()
+    -> for i in test_gen():
+    (Pdb) next
+    > <doctest test.test_pdb.test_pdb_next_command_in_generator_for_loop[1]>(5)test_function()
+    -> x = 123
+    (Pdb) continue
+    """
+
+def test_pdb_next_command_subiterator():
+    """The next command in a generator with a subiterator.
+
+    >>> def test_subgenerator():
+    ...     yield 0
+    ...     return 1
+
+    >>> def test_gen():
+    ...     x = yield from test_subgenerator()
+    ...     return x
+
+    >>> def test_function():
+    ...     import pdb; pdb.Pdb(nosigint=True).set_trace()
+    ...     for i in test_gen():
+    ...         print('value', i)
+    ...     x = 123
+
+    >>> with PdbTestInput(['step',
+    ...                    'step',
+    ...                    'next',
+    ...                    'next',
+    ...                    'next',
+    ...                    'continue']):
+    ...     test_function()
+    > <doctest test.test_pdb.test_pdb_next_command_subiterator[2]>(3)test_function()
+    -> for i in test_gen():
+    (Pdb) step
+    --Call--
+    > <doctest test.test_pdb.test_pdb_next_command_subiterator[1]>(1)test_gen()
+    -> def test_gen():
+    (Pdb) step
+    > <doctest test.test_pdb.test_pdb_next_command_subiterator[1]>(2)test_gen()
+    -> x = yield from test_subgenerator()
+    (Pdb) next
+    value 0
+    > <doctest test.test_pdb.test_pdb_next_command_subiterator[1]>(3)test_gen()
+    -> return x
+    (Pdb) next
+    Internal StopIteration: 1
+    > <doctest test.test_pdb.test_pdb_next_command_subiterator[2]>(3)test_function()
+    -> for i in test_gen():
+    (Pdb) next
+    > <doctest test.test_pdb.test_pdb_next_command_subiterator[2]>(5)test_function()
+    -> x = 123
+    (Pdb) continue
+    """
+
 
 class PdbTestCase(unittest.TestCase):
 
@@ -606,6 +916,7 @@
         with open(filename, 'w') as f:
             f.write(textwrap.dedent(script))
         self.addCleanup(support.unlink, filename)
+        self.addCleanup(support.rmtree, '__pycache__')
         cmd = [sys.executable, '-m', 'pdb', filename]
         stdout = stderr = None
         with subprocess.Popen(cmd, stdout=subprocess.PIPE,
@@ -617,6 +928,36 @@
         stderr = stderr and bytes.decode(stderr)
         return stdout, stderr
 
+    def _assert_find_function(self, file_content, func_name, expected):
+        file_content = textwrap.dedent(file_content)
+
+        with open(support.TESTFN, 'w') as f:
+            f.write(file_content)
+
+        expected = None if not expected else (
+            expected[0], support.TESTFN, expected[1])
+        self.assertEqual(
+            expected, pdb.find_function(func_name, support.TESTFN))
+
+    def test_find_function_empty_file(self):
+        self._assert_find_function('', 'foo', None)
+
+    def test_find_function_found(self):
+        self._assert_find_function(
+            """\
+            def foo():
+                pass
+
+            def bar():
+                pass
+
+            def quux():
+                pass
+            """,
+            'bar',
+            ('bar', 4),
+        )
+
     def test_issue7964(self):
         # open the file as binary so we can force \r\n newline
         with open(support.TESTFN, 'wb') as f:
diff --git a/Lib/test/test_peepholer.py b/Lib/test/test_peepholer.py
index 1cacdea..5025792 100644
--- a/Lib/test/test_peepholer.py
+++ b/Lib/test/test_peepholer.py
@@ -5,44 +5,28 @@
 import unittest
 from math import copysign
 
-def disassemble(func):
-    f = StringIO()
-    tmp = sys.stdout
-    sys.stdout = f
-    try:
-        dis.dis(func)
-    finally:
-        sys.stdout = tmp
-    result = f.getvalue()
-    f.close()
-    return result
+from test.bytecode_helper import BytecodeTestCase
 
-def dis_single(line):
-    return disassemble(compile(line, '', 'single'))
-
-
-class TestTranforms(unittest.TestCase):
+class TestTranforms(BytecodeTestCase):
 
     def test_unot(self):
         # UNARY_NOT POP_JUMP_IF_FALSE  -->  POP_JUMP_IF_TRUE'
         def unot(x):
             if not x == 2:
                 del x
-        asm = disassemble(unot)
-        for elem in ('UNARY_NOT', 'POP_JUMP_IF_FALSE'):
-            self.assertNotIn(elem, asm)
-        for elem in ('POP_JUMP_IF_TRUE',):
-            self.assertIn(elem, asm)
+        self.assertNotInBytecode(unot, 'UNARY_NOT')
+        self.assertNotInBytecode(unot, 'POP_JUMP_IF_FALSE')
+        self.assertInBytecode(unot, 'POP_JUMP_IF_TRUE')
 
     def test_elim_inversion_of_is_or_in(self):
-        for line, elem in (
-            ('not a is b', '(is not)',),
-            ('not a in b', '(not in)',),
-            ('not a is not b', '(is)',),
-            ('not a not in b', '(in)',),
+        for line, cmp_op in (
+            ('not a is b', 'is not',),
+            ('not a in b', 'not in',),
+            ('not a is not b', 'is',),
+            ('not a not in b', 'in',),
             ):
-            asm = dis_single(line)
-            self.assertIn(elem, asm)
+            code = compile(line, '', 'single')
+            self.assertInBytecode(code, 'COMPARE_OP', cmp_op)
 
     def test_global_as_constant(self):
         # LOAD_GLOBAL None/True/False  -->  LOAD_CONST None/True/False
@@ -56,17 +40,14 @@
         def h(x):
             False
             return x
-        for func, name in ((f, 'None'), (g, 'True'), (h, 'False')):
-            asm = disassemble(func)
-            for elem in ('LOAD_GLOBAL',):
-                self.assertNotIn(elem, asm)
-            for elem in ('LOAD_CONST', '('+name+')'):
-                self.assertIn(elem, asm)
+        for func, elem in ((f, None), (g, True), (h, False)):
+            self.assertNotInBytecode(func, 'LOAD_GLOBAL')
+            self.assertInBytecode(func, 'LOAD_CONST', elem)
         def f():
             'Adding a docstring made this test fail in Py2.5.0'
             return None
-        self.assertIn('LOAD_CONST', disassemble(f))
-        self.assertNotIn('LOAD_GLOBAL', disassemble(f))
+        self.assertNotInBytecode(f, 'LOAD_GLOBAL')
+        self.assertInBytecode(f, 'LOAD_CONST', None)
 
     def test_while_one(self):
         # Skip over:  LOAD_CONST trueconst  POP_JUMP_IF_FALSE xx
@@ -74,11 +55,10 @@
             while 1:
                 pass
             return list
-        asm = disassemble(f)
         for elem in ('LOAD_CONST', 'POP_JUMP_IF_FALSE'):
-            self.assertNotIn(elem, asm)
+            self.assertNotInBytecode(f, elem)
         for elem in ('JUMP_ABSOLUTE',):
-            self.assertIn(elem, asm)
+            self.assertInBytecode(f, elem)
 
     def test_pack_unpack(self):
         for line, elem in (
@@ -86,28 +66,30 @@
             ('a, b = a, b', 'ROT_TWO',),
             ('a, b, c = a, b, c', 'ROT_THREE',),
             ):
-            asm = dis_single(line)
-            self.assertIn(elem, asm)
-            self.assertNotIn('BUILD_TUPLE', asm)
-            self.assertNotIn('UNPACK_TUPLE', asm)
+            code = compile(line,'','single')
+            self.assertInBytecode(code, elem)
+            self.assertNotInBytecode(code, 'BUILD_TUPLE')
+            self.assertNotInBytecode(code, 'UNPACK_TUPLE')
 
     def test_folding_of_tuples_of_constants(self):
         for line, elem in (
-            ('a = 1,2,3', '((1, 2, 3))'),
-            ('("a","b","c")', "(('a', 'b', 'c'))"),
-            ('a,b,c = 1,2,3', '((1, 2, 3))'),
-            ('(None, 1, None)', '((None, 1, None))'),
-            ('((1, 2), 3, 4)', '(((1, 2), 3, 4))'),
+            ('a = 1,2,3', (1, 2, 3)),
+            ('("a","b","c")', ('a', 'b', 'c')),
+            ('a,b,c = 1,2,3', (1, 2, 3)),
+            ('(None, 1, None)', (None, 1, None)),
+            ('((1, 2), 3, 4)', ((1, 2), 3, 4)),
             ):
-            asm = dis_single(line)
-            self.assertIn(elem, asm)
-            self.assertNotIn('BUILD_TUPLE', asm)
+            code = compile(line,'','single')
+            self.assertInBytecode(code, 'LOAD_CONST', elem)
+            self.assertNotInBytecode(code, 'BUILD_TUPLE')
 
         # Long tuples should be folded too.
-        asm = dis_single(repr(tuple(range(10000))))
+        code = compile(repr(tuple(range(10000))),'','single')
+        self.assertNotInBytecode(code, 'BUILD_TUPLE')
         # One LOAD_CONST for the tuple, one for the None return value
-        self.assertEqual(asm.count('LOAD_CONST'), 2)
-        self.assertNotIn('BUILD_TUPLE', asm)
+        load_consts = [instr for instr in dis.get_instructions(code)
+                              if instr.opname == 'LOAD_CONST']
+        self.assertEqual(len(load_consts), 2)
 
         # Bug 1053819:  Tuple of constants misidentified when presented with:
         # . . . opcode_with_arg 100   unary_opcode   BUILD_TUPLE 1  . . .
@@ -129,14 +111,14 @@
     def test_folding_of_lists_of_constants(self):
         for line, elem in (
             # in/not in constants with BUILD_LIST should be folded to a tuple:
-            ('a in [1,2,3]', '(1, 2, 3)'),
-            ('a not in ["a","b","c"]', "(('a', 'b', 'c'))"),
-            ('a in [None, 1, None]', '((None, 1, None))'),
-            ('a not in [(1, 2), 3, 4]', '(((1, 2), 3, 4))'),
+            ('a in [1,2,3]', (1, 2, 3)),
+            ('a not in ["a","b","c"]', ('a', 'b', 'c')),
+            ('a in [None, 1, None]', (None, 1, None)),
+            ('a not in [(1, 2), 3, 4]', ((1, 2), 3, 4)),
             ):
-            asm = dis_single(line)
-            self.assertIn(elem, asm)
-            self.assertNotIn('BUILD_LIST', asm)
+            code = compile(line, '', 'single')
+            self.assertInBytecode(code, 'LOAD_CONST', elem)
+            self.assertNotInBytecode(code, 'BUILD_LIST')
 
     def test_folding_of_sets_of_constants(self):
         for line, elem in (
@@ -147,18 +129,9 @@
             ('a not in {(1, 2), 3, 4}', frozenset({(1, 2), 3, 4})),
             ('a in {1, 2, 3, 3, 2, 1}', frozenset({1, 2, 3})),
             ):
-            asm = dis_single(line)
-            self.assertNotIn('BUILD_SET', asm)
-
-            # Verify that the frozenset 'elem' is in the disassembly
-            # The ordering of the elements in repr( frozenset ) isn't
-            # guaranteed, so we jump through some hoops to ensure that we have
-            # the frozenset we expect:
-            self.assertIn('frozenset', asm)
-            # Extract the frozenset literal from the disassembly:
-            m = re.match(r'.*(frozenset\({.*}\)).*', asm, re.DOTALL)
-            self.assertTrue(m)
-            self.assertEqual(eval(m.group(1)), elem)
+            code = compile(line, '', 'single')
+            self.assertNotInBytecode(code, 'BUILD_SET')
+            self.assertInBytecode(code, 'LOAD_CONST', elem)
 
         # Ensure that the resulting code actually works:
         def f(a):
@@ -176,98 +149,103 @@
 
     def test_folding_of_binops_on_constants(self):
         for line, elem in (
-            ('a = 2+3+4', '(9)'),                   # chained fold
-            ('"@"*4', "('@@@@')"),                  # check string ops
-            ('a="abc" + "def"', "('abcdef')"),      # check string ops
-            ('a = 3**4', '(81)'),                   # binary power
-            ('a = 3*4', '(12)'),                    # binary multiply
-            ('a = 13//4', '(3)'),                   # binary floor divide
-            ('a = 14%4', '(2)'),                    # binary modulo
-            ('a = 2+3', '(5)'),                     # binary add
-            ('a = 13-4', '(9)'),                    # binary subtract
-            ('a = (12,13)[1]', '(13)'),             # binary subscr
-            ('a = 13 << 2', '(52)'),                # binary lshift
-            ('a = 13 >> 2', '(3)'),                 # binary rshift
-            ('a = 13 & 7', '(5)'),                  # binary and
-            ('a = 13 ^ 7', '(10)'),                 # binary xor
-            ('a = 13 | 7', '(15)'),                 # binary or
+            ('a = 2+3+4', 9),                   # chained fold
+            ('"@"*4', '@@@@'),                  # check string ops
+            ('a="abc" + "def"', 'abcdef'),      # check string ops
+            ('a = 3**4', 81),                   # binary power
+            ('a = 3*4', 12),                    # binary multiply
+            ('a = 13//4', 3),                   # binary floor divide
+            ('a = 14%4', 2),                    # binary modulo
+            ('a = 2+3', 5),                     # binary add
+            ('a = 13-4', 9),                    # binary subtract
+            ('a = (12,13)[1]', 13),             # binary subscr
+            ('a = 13 << 2', 52),                # binary lshift
+            ('a = 13 >> 2', 3),                 # binary rshift
+            ('a = 13 & 7', 5),                  # binary and
+            ('a = 13 ^ 7', 10),                 # binary xor
+            ('a = 13 | 7', 15),                 # binary or
             ):
-            asm = dis_single(line)
-            self.assertIn(elem, asm, asm)
-            self.assertNotIn('BINARY_', asm)
+            code = compile(line, '', 'single')
+            self.assertInBytecode(code, 'LOAD_CONST', elem)
+            for instr in dis.get_instructions(code):
+                self.assertFalse(instr.opname.startswith('BINARY_'))
 
         # Verify that unfoldables are skipped
-        asm = dis_single('a=2+"b"')
-        self.assertIn('(2)', asm)
-        self.assertIn("('b')", asm)
+        code = compile('a=2+"b"', '', 'single')
+        self.assertInBytecode(code, 'LOAD_CONST', 2)
+        self.assertInBytecode(code, 'LOAD_CONST', 'b')
 
         # Verify that large sequences do not result from folding
-        asm = dis_single('a="x"*1000')
-        self.assertIn('(1000)', asm)
+        code = compile('a="x"*1000', '', 'single')
+        self.assertInBytecode(code, 'LOAD_CONST', 1000)
 
     def test_binary_subscr_on_unicode(self):
         # valid code get optimized
-        asm = dis_single('"foo"[0]')
-        self.assertIn("('f')", asm)
-        self.assertNotIn('BINARY_SUBSCR', asm)
-        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)
+        code = compile('"foo"[0]', '', 'single')
+        self.assertInBytecode(code, 'LOAD_CONST', 'f')
+        self.assertNotInBytecode(code, 'BINARY_SUBSCR')
+        code = compile('"\u0061\uffff"[1]', '', 'single')
+        self.assertInBytecode(code, 'LOAD_CONST', '\uffff')
+        self.assertNotInBytecode(code,'BINARY_SUBSCR')
+
+        # With PEP 393, non-BMP char get optimized
+        code = compile('"\U00012345"[0]', '', 'single')
+        self.assertInBytecode(code, 'LOAD_CONST', '\U00012345')
+        self.assertNotInBytecode(code, 'BINARY_SUBSCR')
 
         # invalid code doesn't get optimized
         # out of range
-        asm = dis_single('"fuu"[10]')
-        self.assertIn('BINARY_SUBSCR', asm)
+        code = compile('"fuu"[10]', '', 'single')
+        self.assertInBytecode(code, 'BINARY_SUBSCR')
 
     def test_folding_of_unaryops_on_constants(self):
         for line, elem in (
-            ('-0.5', '(-0.5)'),                     # unary negative
-            ('-0.0', '(-0.0)'),                     # -0.0
-            ('-(1.0-1.0)','(-0.0)'),                # -0.0 after folding
-            ('-0', '(0)'),                          # -0
-            ('~-2', '(1)'),                         # unary invert
-            ('+1', '(1)'),                          # unary positive
+            ('-0.5', -0.5),                     # unary negative
+            ('-0.0', -0.0),                     # -0.0
+            ('-(1.0-1.0)', -0.0),               # -0.0 after folding
+            ('-0', 0),                          # -0
+            ('~-2', 1),                         # unary invert
+            ('+1', 1),                          # unary positive
         ):
-            asm = dis_single(line)
-            self.assertIn(elem, asm, asm)
-            self.assertNotIn('UNARY_', asm)
+            code = compile(line, '', 'single')
+            self.assertInBytecode(code, 'LOAD_CONST', elem)
+            for instr in dis.get_instructions(code):
+                self.assertFalse(instr.opname.startswith('UNARY_'))
 
         # Check that -0.0 works after marshaling
         def negzero():
             return -(1.0-1.0)
 
-        self.assertNotIn('UNARY_', disassemble(negzero))
-        self.assertTrue(copysign(1.0, negzero()) < 0)
+        for instr in dis.get_instructions(code):
+            self.assertFalse(instr.opname.startswith('UNARY_'))
 
         # Verify that unfoldables are skipped
-        for line, elem in (
-            ('-"abc"', "('abc')"),                  # unary negative
-            ('~"abc"', "('abc')"),                  # unary invert
+        for line, elem, opname in (
+            ('-"abc"', 'abc', 'UNARY_NEGATIVE'),
+            ('~"abc"', 'abc', 'UNARY_INVERT'),
         ):
-            asm = dis_single(line)
-            self.assertIn(elem, asm, asm)
-            self.assertIn('UNARY_', asm)
+            code = compile(line, '', 'single')
+            self.assertInBytecode(code, 'LOAD_CONST', elem)
+            self.assertInBytecode(code, opname)
 
     def test_elim_extra_return(self):
         # RETURN LOAD_CONST None RETURN  -->  RETURN
         def f(x):
             return x
-        asm = disassemble(f)
-        self.assertNotIn('LOAD_CONST', asm)
-        self.assertNotIn('(None)', asm)
-        self.assertEqual(asm.split().count('RETURN_VALUE'), 1)
+        self.assertNotInBytecode(f, 'LOAD_CONST', None)
+        returns = [instr for instr in dis.get_instructions(f)
+                          if instr.opname == 'RETURN_VALUE']
+        self.assertEqual(len(returns), 1)
 
     def test_elim_jump_to_return(self):
         # JUMP_FORWARD to RETURN -->  RETURN
         def f(cond, true_value, false_value):
             return true_value if cond else false_value
-        asm = disassemble(f)
-        self.assertNotIn('JUMP_FORWARD', asm)
-        self.assertNotIn('JUMP_ABSOLUTE', asm)
-        self.assertEqual(asm.split().count('RETURN_VALUE'), 2)
+        self.assertNotInBytecode(f, 'JUMP_FORWARD')
+        self.assertNotInBytecode(f, 'JUMP_ABSOLUTE')
+        returns = [instr for instr in dis.get_instructions(f)
+                          if instr.opname == 'RETURN_VALUE']
+        self.assertEqual(len(returns), 2)
 
     def test_elim_jump_after_return1(self):
         # Eliminate dead code: jumps immediately after returns can't be reached
@@ -280,48 +258,53 @@
                 if cond1: return 4
                 return 5
             return 6
-        asm = disassemble(f)
-        self.assertNotIn('JUMP_FORWARD', asm)
-        self.assertNotIn('JUMP_ABSOLUTE', asm)
-        self.assertEqual(asm.split().count('RETURN_VALUE'), 6)
+        self.assertNotInBytecode(f, 'JUMP_FORWARD')
+        self.assertNotInBytecode(f, 'JUMP_ABSOLUTE')
+        returns = [instr for instr in dis.get_instructions(f)
+                          if instr.opname == 'RETURN_VALUE']
+        self.assertEqual(len(returns), 6)
 
     def test_elim_jump_after_return2(self):
         # Eliminate dead code: jumps immediately after returns can't be reached
         def f(cond1, cond2):
             while 1:
                 if cond1: return 4
-        asm = disassemble(f)
-        self.assertNotIn('JUMP_FORWARD', asm)
+        self.assertNotInBytecode(f, 'JUMP_FORWARD')
         # There should be one jump for the while loop.
-        self.assertEqual(asm.split().count('JUMP_ABSOLUTE'), 1)
-        self.assertEqual(asm.split().count('RETURN_VALUE'), 2)
+        returns = [instr for instr in dis.get_instructions(f)
+                          if instr.opname == 'JUMP_ABSOLUTE']
+        self.assertEqual(len(returns), 1)
+        returns = [instr for instr in dis.get_instructions(f)
+                          if instr.opname == 'RETURN_VALUE']
+        self.assertEqual(len(returns), 2)
 
     def test_make_function_doesnt_bail(self):
         def f():
             def g()->1+1:
                 pass
             return g
-        asm = disassemble(f)
-        self.assertNotIn('BINARY_ADD', asm)
+        self.assertNotInBytecode(f, 'BINARY_ADD')
 
     def test_constant_folding(self):
         # Issue #11244: aggressive constant folding.
         exprs = [
-            "3 * -5",
-            "-3 * 5",
-            "2 * (3 * 4)",
-            "(2 * 3) * 4",
-            "(-1, 2, 3)",
-            "(1, -2, 3)",
-            "(1, 2, -3)",
-            "(1, 2, -3) * 6",
-            "lambda x: x in {(3 * -5) + (-1 - 6), (1, -2, 3) * 2, None}",
+            '3 * -5',
+            '-3 * 5',
+            '2 * (3 * 4)',
+            '(2 * 3) * 4',
+            '(-1, 2, 3)',
+            '(1, -2, 3)',
+            '(1, 2, -3)',
+            '(1, 2, -3) * 6',
+            'lambda x: x in {(3 * -5) + (-1 - 6), (1, -2, 3) * 2, None}',
         ]
         for e in exprs:
-            asm = dis_single(e)
-            self.assertNotIn('UNARY_', asm, e)
-            self.assertNotIn('BINARY_', asm, e)
-            self.assertNotIn('BUILD_', asm, e)
+            code = compile(e, '', 'single')
+            for instr in dis.get_instructions(code):
+                self.assertFalse(instr.opname.startswith('UNARY_'))
+                self.assertFalse(instr.opname.startswith('BINARY_'))
+                self.assertFalse(instr.opname.startswith('BUILD_'))
+
 
 class TestBuglets(unittest.TestCase):
 
@@ -343,7 +326,7 @@
     support.run_unittest(*test_classes)
 
     # verify reference counting
-    if verbose and hasattr(sys, "gettotalrefcount"):
+    if verbose and hasattr(sys, 'gettotalrefcount'):
         import gc
         counts = [None] * 5
         for i in range(len(counts)):
diff --git a/Lib/test/test_pep247.py b/Lib/test/test_pep247.py
index 7f10472..b85a26a 100644
--- a/Lib/test/test_pep247.py
+++ b/Lib/test/test_pep247.py
@@ -15,12 +15,14 @@
         self.assertTrue(module.digest_size is None or module.digest_size > 0)
         self.check_object(module.new, module.digest_size, key)
 
-    def check_object(self, cls, digest_size, key):
+    def check_object(self, cls, digest_size, key, digestmod=None):
         if key is not None:
-            obj1 = cls(key)
-            obj2 = cls(key, b'string')
-            h1 = cls(key, b'string').digest()
-            obj3 = cls(key)
+            if digestmod is None:
+                digestmod = md5
+            obj1 = cls(key, digestmod=digestmod)
+            obj2 = cls(key, b'string', digestmod=digestmod)
+            h1 = cls(key, b'string', digestmod=digestmod).digest()
+            obj3 = cls(key, digestmod=digestmod)
             obj3.update(b'string')
             h2 = obj3.digest()
         else:
diff --git a/Lib/test/test_pep263.py b/Lib/test/test_pep263.py
deleted file mode 100644
index 324ae386..0000000
--- a/Lib/test/test_pep263.py
+++ /dev/null
@@ -1,80 +0,0 @@
-# -*- coding: koi8-r -*-
-
-import unittest
-from test import support
-
-class PEP263Test(unittest.TestCase):
-
-    def test_pep263(self):
-        self.assertEqual(
-            "ðÉÔÏÎ".encode("utf-8"),
-            b'\xd0\x9f\xd0\xb8\xd1\x82\xd0\xbe\xd0\xbd'
-        )
-        self.assertEqual(
-            "\ð".encode("utf-8"),
-            b'\\\xd0\x9f'
-        )
-
-    def test_compilestring(self):
-        # see #1882
-        c = compile(b"\n# coding: utf-8\nu = '\xc3\xb3'\n", "dummy", "exec")
-        d = {}
-        exec(c, d)
-        self.assertEqual(d['u'], '\xf3')
-
-    def test_issue2301(self):
-        try:
-            compile(b"# coding: cp932\nprint '\x94\x4e'", "dummy", "exec")
-        except SyntaxError as v:
-            self.assertEqual(v.text, "print '\u5e74'\n")
-        else:
-            self.fail()
-
-    def test_issue4626(self):
-        c = compile("# coding=latin-1\n\u00c6 = '\u00c6'", "dummy", "exec")
-        d = {}
-        exec(c, d)
-        self.assertEqual(d['\xc6'], '\xc6')
-
-    def test_issue3297(self):
-        c = compile("a, b = '\U0001010F', '\\U0001010F'", "dummy", "exec")
-        d = {}
-        exec(c, d)
-        self.assertEqual(d['a'], d['b'])
-        self.assertEqual(len(d['a']), len(d['b']))
-        self.assertEqual(ascii(d['a']), ascii(d['b']))
-
-    def test_issue7820(self):
-        # Ensure that check_bom() restores all bytes in the right order if
-        # check_bom() fails in pydebug mode: a buffer starts with the first
-        # byte of a valid BOM, but next bytes are different
-
-        # one byte in common with the UTF-16-LE BOM
-        self.assertRaises(SyntaxError, eval, b'\xff\x20')
-
-        # two bytes in common with the UTF-8 BOM
-        self.assertRaises(SyntaxError, eval, b'\xef\xbb\x20')
-
-    def test_error_message(self):
-        compile(b'# -*- coding: iso-8859-15 -*-\n', 'dummy', 'exec')
-        compile(b'\xef\xbb\xbf\n', 'dummy', 'exec')
-        compile(b'\xef\xbb\xbf# -*- coding: utf-8 -*-\n', 'dummy', 'exec')
-        with self.assertRaisesRegex(SyntaxError, 'fake'):
-            compile(b'# -*- coding: fake -*-\n', 'dummy', 'exec')
-        with self.assertRaisesRegex(SyntaxError, 'iso-8859-15'):
-            compile(b'\xef\xbb\xbf# -*- coding: iso-8859-15 -*-\n',
-                    'dummy', 'exec')
-        with self.assertRaisesRegex(SyntaxError, 'BOM'):
-            compile(b'\xef\xbb\xbf# -*- coding: iso-8859-15 -*-\n',
-                    'dummy', 'exec')
-        with self.assertRaisesRegex(SyntaxError, 'fake'):
-            compile(b'\xef\xbb\xbf# -*- coding: fake -*-\n', 'dummy', 'exec')
-        with self.assertRaisesRegex(SyntaxError, 'BOM'):
-            compile(b'\xef\xbb\xbf# -*- coding: fake -*-\n', 'dummy', 'exec')
-
-
-def test_main():
-    support.run_unittest(PEP263Test)
-
-if __name__=="__main__":
-    test_main()
diff --git a/Lib/test/test_pep277.py b/Lib/test/test_pep277.py
index 4b16cbb..6c833a8 100644
--- a/Lib/test/test_pep277.py
+++ b/Lib/test/test_pep277.py
@@ -56,17 +56,6 @@
                                 "Unicode-friendly filesystem encoding")
 
 
-# Destroy directory dirname and all files under it, to one level.
-def deltree(dirname):
-    # Don't hide legitimate errors:  if one of these suckers exists, it's
-    # an error if we can't remove it.
-    if os.path.exists(dirname):
-        # must pass unicode to os.listdir() so we get back unicode results.
-        for fname in os.listdir(str(dirname)):
-            os.unlink(os.path.join(dirname, fname))
-        os.rmdir(dirname)
-
-
 class UnicodeFileTests(unittest.TestCase):
     files = set(filenames)
     normal_form = None
@@ -76,6 +65,8 @@
             os.mkdir(support.TESTFN)
         except FileExistsError:
             pass
+        self.addCleanup(support.rmtree, support.TESTFN)
+
         files = set()
         for name in self.files:
             name = os.path.join(support.TESTFN, self.norm(name))
@@ -85,9 +76,6 @@
             files.add(name)
         self.files = files
 
-    def tearDown(self):
-        deltree(support.TESTFN)
-
     def norm(self, s):
         if self.normal_form:
             return normalize(self.normal_form, s)
@@ -99,10 +87,6 @@
         with self.assertRaises(expected_exception) as c:
             fn(filename)
         exc_filename = c.exception.filename
-        # listdir may append a wildcard to the filename
-        if fn is os.listdir and sys.platform == 'win32':
-            exc_filename, _, wildcard = exc_filename.rpartition(os.sep)
-            self.assertEqual(wildcard, '*.*')
         if check_filename:
             self.assertEqual(exc_filename, filename, "Function '%s(%a) failed "
                              "with bad filename in the exception: %a" %
@@ -204,16 +188,13 @@
 
 
 def test_main():
-    try:
-        support.run_unittest(
-            UnicodeFileTests,
-            UnicodeNFCFileTests,
-            UnicodeNFDFileTests,
-            UnicodeNFKCFileTests,
-            UnicodeNFKDFileTests,
-        )
-    finally:
-        deltree(support.TESTFN)
+    support.run_unittest(
+        UnicodeFileTests,
+        UnicodeNFCFileTests,
+        UnicodeNFDFileTests,
+        UnicodeNFKCFileTests,
+        UnicodeNFKDFileTests,
+    )
 
 
 if __name__ == "__main__":
diff --git a/Lib/test/test_pep3151.py b/Lib/test/test_pep3151.py
index 2792c10..7d4a5d8 100644
--- a/Lib/test/test_pep3151.py
+++ b/Lib/test/test_pep3151.py
@@ -157,8 +157,6 @@
         e.characters_written = 5
         self.assertEqual(e.characters_written, 5)
 
-    # XXX VMSError not tested
-
 
 class ExplicitSubclassingTest(unittest.TestCase):
 
diff --git a/Lib/test/test_pep352.py b/Lib/test/test_pep352.py
index 558cdb5..7c98c46 100644
--- a/Lib/test/test_pep352.py
+++ b/Lib/test/test_pep352.py
@@ -1,7 +1,6 @@
 import unittest
 import builtins
 import warnings
-from test.support import run_unittest
 import os
 from platform import system as platform_system
 
@@ -180,8 +179,6 @@
         # Catching a string is bad.
         self.catch_fails("spam")
 
-def test_main():
-    run_unittest(ExceptionClassTests, UsageTests)
 
 if __name__ == '__main__':
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_pep380.py b/Lib/test/test_pep380.py
index 4a43b7d..69194df 100644
--- a/Lib/test/test_pep380.py
+++ b/Lib/test/test_pep380.py
@@ -993,6 +993,25 @@
             del inner_gen
             gc_collect()
 
+    def test_send_tuple_with_custom_generator(self):
+        # See issue #21209.
+        class MyGen:
+            def __iter__(self):
+                return self
+            def __next__(self):
+                return 42
+            def send(self, what):
+                nonlocal v
+                v = what
+                return None
+        def outer():
+            v = yield from MyGen()
+        g = outer()
+        next(g)
+        v = None
+        g.send((1, 2, 3, 4))
+        self.assertEqual(v, (1, 2, 3, 4))
+
 
 def test_main():
     from test import support
diff --git a/Lib/test/test_pickle.py b/Lib/test/test_pickle.py
index fbe96ac..e1a88b6 100644
--- a/Lib/test/test_pickle.py
+++ b/Lib/test/test_pickle.py
@@ -1,7 +1,10 @@
 import pickle
 import io
 import collections
+import struct
+import sys
 
+import unittest
 from test import support
 
 from test.pickletester import AbstractPickleTests
@@ -83,13 +86,17 @@
 
 
 class PyDispatchTableTests(AbstractDispatchTableTests):
+
     pickler_class = pickle._Pickler
+
     def get_dispatch_table(self):
         return pickle.dispatch_table.copy()
 
 
 class PyChainDispatchTableTests(AbstractDispatchTableTests):
+
     pickler_class = pickle._Pickler
+
     def get_dispatch_table(self):
         return collections.ChainMap({}, pickle.dispatch_table)
 
@@ -134,6 +141,71 @@
         def get_dispatch_table(self):
             return collections.ChainMap({}, pickle.dispatch_table)
 
+    @support.cpython_only
+    class SizeofTests(unittest.TestCase):
+        check_sizeof = support.check_sizeof
+
+        def test_pickler(self):
+            basesize = support.calcobjsize('5P2n3i2n3iP')
+            p = _pickle.Pickler(io.BytesIO())
+            self.assertEqual(object.__sizeof__(p), basesize)
+            MT_size = struct.calcsize('3nP0n')
+            ME_size = struct.calcsize('Pn0P')
+            check = self.check_sizeof
+            check(p, basesize +
+                MT_size + 8 * ME_size +  # Minimal memo table size.
+                sys.getsizeof(b'x'*4096))  # Minimal write buffer size.
+            for i in range(6):
+                p.dump(chr(i))
+            check(p, basesize +
+                MT_size + 32 * ME_size +  # Size of memo table required to
+                                          # save references to 6 objects.
+                0)  # Write buffer is cleared after every dump().
+
+        def test_unpickler(self):
+            basesize = support.calcobjsize('2Pn2P 2P2n2i5P 2P3n6P2n2i')
+            unpickler = _pickle.Unpickler
+            P = struct.calcsize('P')  # Size of memo table entry.
+            n = struct.calcsize('n')  # Size of mark table entry.
+            check = self.check_sizeof
+            for encoding in 'ASCII', 'UTF-16', 'latin-1':
+                for errors in 'strict', 'replace':
+                    u = unpickler(io.BytesIO(),
+                                  encoding=encoding, errors=errors)
+                    self.assertEqual(object.__sizeof__(u), basesize)
+                    check(u, basesize +
+                             32 * P +  # Minimal memo table size.
+                             len(encoding) + 1 + len(errors) + 1)
+
+            stdsize = basesize + len('ASCII') + 1 + len('strict') + 1
+            def check_unpickler(data, memo_size, marks_size):
+                dump = pickle.dumps(data)
+                u = unpickler(io.BytesIO(dump),
+                              encoding='ASCII', errors='strict')
+                u.load()
+                check(u, stdsize + memo_size * P + marks_size * n)
+
+            check_unpickler(0, 32, 0)
+            # 20 is minimal non-empty mark stack size.
+            check_unpickler([0] * 100, 32, 20)
+            # 128 is memo table size required to save references to 100 objects.
+            check_unpickler([chr(i) for i in range(100)], 128, 20)
+            def recurse(deep):
+                data = 0
+                for i in range(deep):
+                    data = [data, data]
+                return data
+            check_unpickler(recurse(0), 32, 0)
+            check_unpickler(recurse(1), 32, 20)
+            check_unpickler(recurse(20), 32, 58)
+            check_unpickler(recurse(50), 64, 58)
+            check_unpickler(recurse(100), 128, 134)
+
+            u = unpickler(io.BytesIO(pickle.dumps('a', 0)),
+                          encoding='ASCII', errors='strict')
+            u.load()
+            check(u, stdsize + 32 * P + 2 + 1)
+
 
 def test_main():
     tests = [PickleTests, PyPicklerTests, PyPersPicklerTests,
@@ -144,7 +216,7 @@
                       PyPicklerUnpicklerObjectTests,
                       CPicklerUnpicklerObjectTests,
                       CDispatchTableTests, CChainDispatchTableTests,
-                      InMemoryPickleTests])
+                      InMemoryPickleTests, SizeofTests])
     support.run_unittest(*tests)
     support.run_doctest(pickle)
 
diff --git a/Lib/test/test_pickletools.py b/Lib/test/test_pickletools.py
index d37ac26..bbe6875 100644
--- a/Lib/test/test_pickletools.py
+++ b/Lib/test/test_pickletools.py
@@ -1,3 +1,4 @@
+import struct
 import pickle
 import pickletools
 from test import support
@@ -15,6 +16,48 @@
     # Test relies on precise output of dumps()
     test_pickle_to_2x = None
 
+    def test_optimize_long_binget(self):
+        data = [str(i) for i in range(257)]
+        data.append(data[-1])
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            pickled = pickle.dumps(data, proto)
+            unpickled = pickle.loads(pickled)
+            self.assertEqual(unpickled, data)
+            self.assertIs(unpickled[-1], unpickled[-2])
+
+            pickled2 = pickletools.optimize(pickled)
+            unpickled2 = pickle.loads(pickled2)
+            self.assertEqual(unpickled2, data)
+            self.assertIs(unpickled2[-1], unpickled2[-2])
+            self.assertNotIn(pickle.LONG_BINGET, pickled2)
+            self.assertNotIn(pickle.LONG_BINPUT, pickled2)
+
+    def test_optimize_binput_and_memoize(self):
+        pickled = (b'\x80\x04\x95\x15\x00\x00\x00\x00\x00\x00\x00'
+                   b']\x94(\x8c\x04spamq\x01\x8c\x03ham\x94h\x02e.')
+        #    0: \x80 PROTO      4
+        #    2: \x95 FRAME      21
+        #   11: ]    EMPTY_LIST
+        #   12: \x94 MEMOIZE
+        #   13: (    MARK
+        #   14: \x8c     SHORT_BINUNICODE 'spam'
+        #   20: q        BINPUT     1
+        #   22: \x8c     SHORT_BINUNICODE 'ham'
+        #   27: \x94     MEMOIZE
+        #   28: h        BINGET     2
+        #   30: e        APPENDS    (MARK at 13)
+        #   31: .    STOP
+        self.assertIn(pickle.BINPUT, pickled)
+        unpickled = pickle.loads(pickled)
+        self.assertEqual(unpickled, ['spam', 'ham', 'ham'])
+        self.assertIs(unpickled[1], unpickled[2])
+
+        pickled2 = pickletools.optimize(pickled)
+        unpickled2 = pickle.loads(pickled2)
+        self.assertEqual(unpickled2, ['spam', 'ham', 'ham'])
+        self.assertIs(unpickled2[1], unpickled2[2])
+        self.assertNotIn(pickle.BINPUT, pickled2)
+
 
 def test_main():
     support.run_unittest(OptimizedPickleTests)
diff --git a/Lib/test/test_pkg.py b/Lib/test/test_pkg.py
index 355efe7..9883000 100644
--- a/Lib/test/test_pkg.py
+++ b/Lib/test/test_pkg.py
@@ -199,14 +199,14 @@
         import t5
         self.assertEqual(fixdir(dir(t5)),
                          ['__cached__', '__doc__', '__file__', '__loader__',
-                          '__name__', '__package__', '__path__', 'foo',
-                          'string', 't5'])
+                          '__name__', '__package__', '__path__', '__spec__',
+                          'foo', 'string', 't5'])
         self.assertEqual(fixdir(dir(t5.foo)),
                          ['__cached__', '__doc__', '__file__', '__loader__',
-                          '__name__', '__package__', 'string'])
+                          '__name__', '__package__', '__spec__', 'string'])
         self.assertEqual(fixdir(dir(t5.string)),
                          ['__cached__', '__doc__', '__file__', '__loader__',
-                          '__name__', '__package__', 'spam'])
+                          '__name__', '__package__', '__spec__', 'spam'])
 
     def test_6(self):
         hier = [
@@ -222,14 +222,15 @@
         import t6
         self.assertEqual(fixdir(dir(t6)),
                          ['__all__', '__cached__', '__doc__', '__file__',
-                          '__loader__', '__name__', '__package__', '__path__'])
+                          '__loader__', '__name__', '__package__', '__path__',
+                          '__spec__'])
         s = """
             import t6
             from t6 import *
             self.assertEqual(fixdir(dir(t6)),
                              ['__all__', '__cached__', '__doc__', '__file__',
                               '__loader__', '__name__', '__package__',
-                              '__path__', 'eggs', 'ham', 'spam'])
+                              '__path__', '__spec__', 'eggs', 'ham', 'spam'])
             self.assertEqual(dir(), ['eggs', 'ham', 'self', 'spam', 't6'])
             """
         self.run_code(s)
@@ -256,18 +257,19 @@
         import t7 as tas
         self.assertEqual(fixdir(dir(tas)),
                          ['__cached__', '__doc__', '__file__', '__loader__',
-                          '__name__', '__package__', '__path__'])
+                          '__name__', '__package__', '__path__', '__spec__'])
         self.assertFalse(t7)
         from t7 import sub as subpar
         self.assertEqual(fixdir(dir(subpar)),
                          ['__cached__', '__doc__', '__file__', '__loader__',
-                          '__name__', '__package__', '__path__'])
+                          '__name__', '__package__', '__path__', '__spec__'])
         self.assertFalse(t7)
         self.assertFalse(sub)
         from t7.sub import subsub as subsubsub
         self.assertEqual(fixdir(dir(subsubsub)),
                          ['__cached__', '__doc__', '__file__', '__loader__',
-                          '__name__', '__package__', '__path__', 'spam'])
+                          '__name__', '__package__', '__path__', '__spec__',
+                          'spam'])
         self.assertFalse(t7)
         self.assertFalse(sub)
         self.assertFalse(subsub)
diff --git a/Lib/test/test_pkgimport.py b/Lib/test/test_pkgimport.py
index a8426b5..370b2aa 100644
--- a/Lib/test/test_pkgimport.py
+++ b/Lib/test/test_pkgimport.py
@@ -6,7 +6,7 @@
 import tempfile
 import unittest
 
-from imp import cache_from_source
+from importlib.util import cache_from_source
 from test.support import run_unittest, create_empty_file
 
 class TestImport(unittest.TestCase):
diff --git a/Lib/test/test_pkgutil.py b/Lib/test/test_pkgutil.py
index fd06614..e0c8635de 100644
--- a/Lib/test/test_pkgutil.py
+++ b/Lib/test/test_pkgutil.py
@@ -1,12 +1,13 @@
-from test.support import run_unittest, unload, check_warnings
+from test.support import run_unittest, unload, check_warnings, CleanImport
 import unittest
 import sys
-import imp
 import importlib
+from importlib.util import spec_from_file_location
 import pkgutil
 import os
 import os.path
 import tempfile
+import types
 import shutil
 import zipfile
 
@@ -103,23 +104,20 @@
 class PkgutilPEP302Tests(unittest.TestCase):
 
     class MyTestLoader(object):
-        def load_module(self, fullname):
-            # Create an empty module
-            mod = sys.modules.setdefault(fullname, imp.new_module(fullname))
-            mod.__file__ = "<%s>" % self.__class__.__name__
-            mod.__loader__ = self
-            # Make it a package
-            mod.__path__ = []
+        def exec_module(self, mod):
             # Count how many times the module is reloaded
-            mod.__dict__['loads'] = mod.__dict__.get('loads',0) + 1
-            return mod
+            mod.__dict__['loads'] = mod.__dict__.get('loads', 0) + 1
 
         def get_data(self, path):
             return "Hello, world!"
 
     class MyTestImporter(object):
-        def find_module(self, fullname, path=None):
-            return PkgutilPEP302Tests.MyTestLoader()
+        def find_spec(self, fullname, path=None, target=None):
+            loader = PkgutilPEP302Tests.MyTestLoader()
+            return spec_from_file_location(fullname,
+                                           '<%s>' % loader.__class__.__name__,
+                                           loader=loader,
+                                           submodule_search_locations=[])
 
     def setUp(self):
         sys.meta_path.insert(0, self.MyTestImporter())
@@ -200,6 +198,8 @@
         dirname = self.create_init(pkgname)
         pathitem = os.path.join(dirname, pkgname)
         fullname = '{}.{}'.format(pkgname, modname)
+        sys.modules.pop(fullname, None)
+        sys.modules.pop(pkgname, None)
         try:
             self.create_submodule(dirname, pkgname, modname, 0)
 
@@ -208,11 +208,19 @@
             importers = list(iter_importers(fullname))
             expected_importer = get_importer(pathitem)
             for finder in importers:
+                spec = pkgutil._get_spec(finder, fullname)
+                loader = spec.loader
+                try:
+                    loader = loader.loader
+                except AttributeError:
+                    # For now we still allow raw loaders from
+                    # find_module().
+                    pass
                 self.assertIsInstance(finder, importlib.machinery.FileFinder)
                 self.assertEqual(finder, expected_importer)
-                self.assertIsInstance(finder.find_module(fullname),
+                self.assertIsInstance(loader,
                                       importlib.machinery.SourceFileLoader)
-                self.assertIsNone(finder.find_module(pkgname))
+                self.assertIsNone(pkgutil._get_spec(finder, pkgname))
 
             with self.assertRaises(ImportError):
                 list(iter_importers('invalid.module'))
@@ -222,8 +230,11 @@
         finally:
             shutil.rmtree(dirname)
             del sys.path[0]
-            del sys.modules['spam']
-            del sys.modules['spam.eggs']
+            try:
+                del sys.modules['spam']
+                del sys.modules['spam.eggs']
+            except KeyError:
+                pass
 
 
     def test_mixed_namespace(self):
@@ -323,6 +334,56 @@
             self.assertIsNotNone(pkgutil.get_loader("test.support"))
             self.assertEqual(len(w.warnings), 0)
 
+    def test_get_loader_handles_missing_loader_attribute(self):
+        global __loader__
+        this_loader = __loader__
+        del __loader__
+        try:
+            with check_warnings() as w:
+                self.assertIsNotNone(pkgutil.get_loader(__name__))
+                self.assertEqual(len(w.warnings), 0)
+        finally:
+            __loader__ = this_loader
+
+    def test_get_loader_handles_missing_spec_attribute(self):
+        name = 'spam'
+        mod = type(sys)(name)
+        del mod.__spec__
+        with CleanImport(name):
+            sys.modules[name] = mod
+            loader = pkgutil.get_loader(name)
+        self.assertIsNone(loader)
+
+    def test_get_loader_handles_spec_attribute_none(self):
+        name = 'spam'
+        mod = type(sys)(name)
+        mod.__spec__ = None
+        with CleanImport(name):
+            sys.modules[name] = mod
+            loader = pkgutil.get_loader(name)
+        self.assertIsNone(loader)
+
+    def test_get_loader_None_in_sys_modules(self):
+        name = 'totally bogus'
+        sys.modules[name] = None
+        try:
+            loader = pkgutil.get_loader(name)
+        finally:
+            del sys.modules[name]
+        self.assertIsNone(loader)
+
+    def test_find_loader_missing_module(self):
+        name = 'totally bogus'
+        loader = pkgutil.find_loader(name)
+        self.assertIsNone(loader)
+
+    def test_find_loader_avoids_emulation(self):
+        with check_warnings() as w:
+            self.assertIsNotNone(pkgutil.find_loader("sys"))
+            self.assertIsNotNone(pkgutil.find_loader("os"))
+            self.assertIsNotNone(pkgutil.find_loader("test.support"))
+            self.assertEqual(len(w.warnings), 0)
+
     def test_get_importer_avoids_emulation(self):
         # We use an illegal path so *none* of the path hooks should fire
         with check_warnings() as w:
diff --git a/Lib/test/test_plistlib.py b/Lib/test/test_plistlib.py
index 9e86b3d..fef9f39 100644
--- a/Lib/test/test_plistlib.py
+++ b/Lib/test/test_plistlib.py
@@ -1,94 +1,95 @@
-# Copyright (C) 2003 Python Software Foundation
+# Copyright (C) 2003-2013 Python Software Foundation
 
 import unittest
 import plistlib
 import os
 import datetime
+import codecs
+import binascii
+import collections
+import struct
 from test import support
+from io import BytesIO
 
+ALL_FORMATS=(plistlib.FMT_XML, plistlib.FMT_BINARY)
 
-# This test data was generated through Cocoa's NSDictionary class
-TESTDATA = b"""<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" \
-"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-        <key>aDate</key>
-        <date>2004-10-26T10:33:33Z</date>
-        <key>aDict</key>
-        <dict>
-                <key>aFalseValue</key>
-                <false/>
-                <key>aTrueValue</key>
-                <true/>
-                <key>aUnicodeValue</key>
-                <string>M\xc3\xa4ssig, Ma\xc3\x9f</string>
-                <key>anotherString</key>
-                <string>&lt;hello &amp; 'hi' there!&gt;</string>
-                <key>deeperDict</key>
-                <dict>
-                        <key>a</key>
-                        <integer>17</integer>
-                        <key>b</key>
-                        <real>32.5</real>
-                        <key>c</key>
-                        <array>
-                                <integer>1</integer>
-                                <integer>2</integer>
-                                <string>text</string>
-                        </array>
-                </dict>
-        </dict>
-        <key>aFloat</key>
-        <real>0.5</real>
-        <key>aList</key>
-        <array>
-                <string>A</string>
-                <string>B</string>
-                <integer>12</integer>
-                <real>32.5</real>
-                <array>
-                        <integer>1</integer>
-                        <integer>2</integer>
-                        <integer>3</integer>
-                </array>
-        </array>
-        <key>aString</key>
-        <string>Doodah</string>
-        <key>anEmptyDict</key>
-        <dict/>
-        <key>anEmptyList</key>
-        <array/>
-        <key>anInt</key>
-        <integer>728</integer>
-        <key>nestedData</key>
-        <array>
-                <data>
-                PGxvdHMgb2YgYmluYXJ5IGd1bms+AAECAzxsb3RzIG9mIGJpbmFyeSBndW5r
-                PgABAgM8bG90cyBvZiBiaW5hcnkgZ3Vuaz4AAQIDPGxvdHMgb2YgYmluYXJ5
-                IGd1bms+AAECAzxsb3RzIG9mIGJpbmFyeSBndW5rPgABAgM8bG90cyBvZiBi
-                aW5hcnkgZ3Vuaz4AAQIDPGxvdHMgb2YgYmluYXJ5IGd1bms+AAECAzxsb3Rz
-                IG9mIGJpbmFyeSBndW5rPgABAgM8bG90cyBvZiBiaW5hcnkgZ3Vuaz4AAQID
-                PGxvdHMgb2YgYmluYXJ5IGd1bms+AAECAw==
-                </data>
-        </array>
-        <key>someData</key>
-        <data>
-        PGJpbmFyeSBndW5rPg==
-        </data>
-        <key>someMoreData</key>
-        <data>
-        PGxvdHMgb2YgYmluYXJ5IGd1bms+AAECAzxsb3RzIG9mIGJpbmFyeSBndW5rPgABAgM8
-        bG90cyBvZiBiaW5hcnkgZ3Vuaz4AAQIDPGxvdHMgb2YgYmluYXJ5IGd1bms+AAECAzxs
-        b3RzIG9mIGJpbmFyeSBndW5rPgABAgM8bG90cyBvZiBiaW5hcnkgZ3Vuaz4AAQIDPGxv
-        dHMgb2YgYmluYXJ5IGd1bms+AAECAzxsb3RzIG9mIGJpbmFyeSBndW5rPgABAgM8bG90
-        cyBvZiBiaW5hcnkgZ3Vuaz4AAQIDPGxvdHMgb2YgYmluYXJ5IGd1bms+AAECAw==
-        </data>
-        <key>\xc3\x85benraa</key>
-        <string>That was a unicode key.</string>
-</dict>
-</plist>
-""".replace(b" " * 8, b"\t")  # Apple as well as plistlib.py output hard tabs
+# The testdata is generated using Mac/Tools/plistlib_generate_testdata.py
+# (which using PyObjC to control the Cocoa classes for generating plists)
+TESTDATA={
+    plistlib.FMT_XML: binascii.a2b_base64(b'''
+        PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPCFET0NU
+        WVBFIHBsaXN0IFBVQkxJQyAiLS8vQXBwbGUvL0RURCBQTElTVCAxLjAvL0VO
+        IiAiaHR0cDovL3d3dy5hcHBsZS5jb20vRFREcy9Qcm9wZXJ0eUxpc3QtMS4w
+        LmR0ZCI+CjxwbGlzdCB2ZXJzaW9uPSIxLjAiPgo8ZGljdD4KCTxrZXk+YUJp
+        Z0ludDwva2V5PgoJPGludGVnZXI+OTIyMzM3MjAzNjg1NDc3NTc2NDwvaW50
+        ZWdlcj4KCTxrZXk+YUJpZ0ludDI8L2tleT4KCTxpbnRlZ2VyPjkyMjMzNzIw
+        MzY4NTQ3NzU4NTI8L2ludGVnZXI+Cgk8a2V5PmFEYXRlPC9rZXk+Cgk8ZGF0
+        ZT4yMDA0LTEwLTI2VDEwOjMzOjMzWjwvZGF0ZT4KCTxrZXk+YURpY3Q8L2tl
+        eT4KCTxkaWN0PgoJCTxrZXk+YUZhbHNlVmFsdWU8L2tleT4KCQk8ZmFsc2Uv
+        PgoJCTxrZXk+YVRydWVWYWx1ZTwva2V5PgoJCTx0cnVlLz4KCQk8a2V5PmFV
+        bmljb2RlVmFsdWU8L2tleT4KCQk8c3RyaW5nPk3DpHNzaWcsIE1hw588L3N0
+        cmluZz4KCQk8a2V5PmFub3RoZXJTdHJpbmc8L2tleT4KCQk8c3RyaW5nPiZs
+        dDtoZWxsbyAmYW1wOyAnaGknIHRoZXJlISZndDs8L3N0cmluZz4KCQk8a2V5
+        PmRlZXBlckRpY3Q8L2tleT4KCQk8ZGljdD4KCQkJPGtleT5hPC9rZXk+CgkJ
+        CTxpbnRlZ2VyPjE3PC9pbnRlZ2VyPgoJCQk8a2V5PmI8L2tleT4KCQkJPHJl
+        YWw+MzIuNTwvcmVhbD4KCQkJPGtleT5jPC9rZXk+CgkJCTxhcnJheT4KCQkJ
+        CTxpbnRlZ2VyPjE8L2ludGVnZXI+CgkJCQk8aW50ZWdlcj4yPC9pbnRlZ2Vy
+        PgoJCQkJPHN0cmluZz50ZXh0PC9zdHJpbmc+CgkJCTwvYXJyYXk+CgkJPC9k
+        aWN0PgoJPC9kaWN0PgoJPGtleT5hRmxvYXQ8L2tleT4KCTxyZWFsPjAuNTwv
+        cmVhbD4KCTxrZXk+YUxpc3Q8L2tleT4KCTxhcnJheT4KCQk8c3RyaW5nPkE8
+        L3N0cmluZz4KCQk8c3RyaW5nPkI8L3N0cmluZz4KCQk8aW50ZWdlcj4xMjwv
+        aW50ZWdlcj4KCQk8cmVhbD4zMi41PC9yZWFsPgoJCTxhcnJheT4KCQkJPGlu
+        dGVnZXI+MTwvaW50ZWdlcj4KCQkJPGludGVnZXI+MjwvaW50ZWdlcj4KCQkJ
+        PGludGVnZXI+MzwvaW50ZWdlcj4KCQk8L2FycmF5PgoJPC9hcnJheT4KCTxr
+        ZXk+YU5lZ2F0aXZlQmlnSW50PC9rZXk+Cgk8aW50ZWdlcj4tODAwMDAwMDAw
+        MDA8L2ludGVnZXI+Cgk8a2V5PmFOZWdhdGl2ZUludDwva2V5PgoJPGludGVn
+        ZXI+LTU8L2ludGVnZXI+Cgk8a2V5PmFTdHJpbmc8L2tleT4KCTxzdHJpbmc+
+        RG9vZGFoPC9zdHJpbmc+Cgk8a2V5PmFuRW1wdHlEaWN0PC9rZXk+Cgk8ZGlj
+        dC8+Cgk8a2V5PmFuRW1wdHlMaXN0PC9rZXk+Cgk8YXJyYXkvPgoJPGtleT5h
+        bkludDwva2V5PgoJPGludGVnZXI+NzI4PC9pbnRlZ2VyPgoJPGtleT5uZXN0
+        ZWREYXRhPC9rZXk+Cgk8YXJyYXk+CgkJPGRhdGE+CgkJUEd4dmRITWdiMlln
+        WW1sdVlYSjVJR2QxYm1zK0FBRUNBenhzYjNSeklHOW1JR0pwYm1GeWVTQm5k
+        VzVyCgkJUGdBQkFnTThiRzkwY3lCdlppQmlhVzVoY25rZ1ozVnVhejRBQVFJ
+        RFBHeHZkSE1nYjJZZ1ltbHVZWEo1CgkJSUdkMWJtcytBQUVDQXp4c2IzUnpJ
+        RzltSUdKcGJtRnllU0JuZFc1clBnQUJBZ004Ykc5MGN5QnZaaUJpCgkJYVc1
+        aGNua2daM1Z1YXo0QUFRSURQR3h2ZEhNZ2IyWWdZbWx1WVhKNUlHZDFibXMr
+        QUFFQ0F6eHNiM1J6CgkJSUc5bUlHSnBibUZ5ZVNCbmRXNXJQZ0FCQWdNOGJH
+        OTBjeUJ2WmlCaWFXNWhjbmtnWjNWdWF6NEFBUUlECgkJUEd4dmRITWdiMlln
+        WW1sdVlYSjVJR2QxYm1zK0FBRUNBdz09CgkJPC9kYXRhPgoJPC9hcnJheT4K
+        CTxrZXk+c29tZURhdGE8L2tleT4KCTxkYXRhPgoJUEdKcGJtRnllU0JuZFc1
+        clBnPT0KCTwvZGF0YT4KCTxrZXk+c29tZU1vcmVEYXRhPC9rZXk+Cgk8ZGF0
+        YT4KCVBHeHZkSE1nYjJZZ1ltbHVZWEo1SUdkMWJtcytBQUVDQXp4c2IzUnpJ
+        RzltSUdKcGJtRnllU0JuZFc1clBnQUJBZ004CgliRzkwY3lCdlppQmlhVzVo
+        Y25rZ1ozVnVhejRBQVFJRFBHeHZkSE1nYjJZZ1ltbHVZWEo1SUdkMWJtcytB
+        QUVDQXp4cwoJYjNSeklHOW1JR0pwYm1GeWVTQm5kVzVyUGdBQkFnTThiRzkw
+        Y3lCdlppQmlhVzVoY25rZ1ozVnVhejRBQVFJRFBHeHYKCWRITWdiMllnWW1s
+        dVlYSjVJR2QxYm1zK0FBRUNBenhzYjNSeklHOW1JR0pwYm1GeWVTQm5kVzVy
+        UGdBQkFnTThiRzkwCgljeUJ2WmlCaWFXNWhjbmtnWjNWdWF6NEFBUUlEUEd4
+        dmRITWdiMllnWW1sdVlYSjVJR2QxYm1zK0FBRUNBdz09Cgk8L2RhdGE+Cgk8
+        a2V5PsOFYmVucmFhPC9rZXk+Cgk8c3RyaW5nPlRoYXQgd2FzIGEgdW5pY29k
+        ZSBrZXkuPC9zdHJpbmc+CjwvZGljdD4KPC9wbGlzdD4K'''),
+    plistlib.FMT_BINARY: binascii.a2b_base64(b'''
+        YnBsaXN0MDDfEBABAgMEBQYHCAkKCwwNDg8QERITFCgpLzAxMjM0NTc2OFdh
+        QmlnSW50WGFCaWdJbnQyVWFEYXRlVWFEaWN0VmFGbG9hdFVhTGlzdF8QD2FO
+        ZWdhdGl2ZUJpZ0ludFxhTmVnYXRpdmVJbnRXYVN0cmluZ1thbkVtcHR5RGlj
+        dFthbkVtcHR5TGlzdFVhbkludFpuZXN0ZWREYXRhWHNvbWVEYXRhXHNvbWVN
+        b3JlRGF0YWcAxQBiAGUAbgByAGEAYRN/////////1BQAAAAAAAAAAIAAAAAA
+        AAAsM0GcuX30AAAA1RUWFxgZGhscHR5bYUZhbHNlVmFsdWVaYVRydWVWYWx1
+        ZV1hVW5pY29kZVZhbHVlXWFub3RoZXJTdHJpbmdaZGVlcGVyRGljdAgJawBN
+        AOQAcwBzAGkAZwAsACAATQBhAN9fEBU8aGVsbG8gJiAnaGknIHRoZXJlIT7T
+        HyAhIiMkUWFRYlFjEBEjQEBAAAAAAACjJSYnEAEQAlR0ZXh0Iz/gAAAAAAAA
+        pSorLCMtUUFRQhAMoyUmLhADE////+1foOAAE//////////7VkRvb2RhaNCg
+        EQLYoTZPEPo8bG90cyBvZiBiaW5hcnkgZ3Vuaz4AAQIDPGxvdHMgb2YgYmlu
+        YXJ5IGd1bms+AAECAzxsb3RzIG9mIGJpbmFyeSBndW5rPgABAgM8bG90cyBv
+        ZiBiaW5hcnkgZ3Vuaz4AAQIDPGxvdHMgb2YgYmluYXJ5IGd1bms+AAECAzxs
+        b3RzIG9mIGJpbmFyeSBndW5rPgABAgM8bG90cyBvZiBiaW5hcnkgZ3Vuaz4A
+        AQIDPGxvdHMgb2YgYmluYXJ5IGd1bms+AAECAzxsb3RzIG9mIGJpbmFyeSBn
+        dW5rPgABAgM8bG90cyBvZiBiaW5hcnkgZ3Vuaz4AAQIDTTxiaW5hcnkgZ3Vu
+        az5fEBdUaGF0IHdhcyBhIHVuaWNvZGUga2V5LgAIACsAMwA8AEIASABPAFUA
+        ZwB0AHwAiACUAJoApQCuALsAygDTAOQA7QD4AQQBDwEdASsBNgE3ATgBTwFn
+        AW4BcAFyAXQBdgF/AYMBhQGHAYwBlQGbAZ0BnwGhAaUBpwGwAbkBwAHBAcIB
+        xQHHAsQC0gAAAAAAAAIBAAAAAAAAADkAAAAAAAAAAAAAAAAAAALs'''),
+}
 
 
 class TestPlistlib(unittest.TestCase):
@@ -99,12 +100,16 @@
         except:
             pass
 
-    def _create(self):
+    def _create(self, fmt=None):
         pl = dict(
             aString="Doodah",
             aList=["A", "B", 12, 32.5, [1, 2, 3]],
             aFloat = 0.5,
             anInt = 728,
+            aBigInt = 2 ** 63 - 44,
+            aBigInt2 = 2 ** 63 + 44,
+            aNegativeInt = -5,
+            aNegativeBigInt = -80000000000,
             aDict=dict(
                 anotherString="<hello & 'hi' there!>",
                 aUnicodeValue='M\xe4ssig, Ma\xdf',
@@ -112,9 +117,9 @@
                 aFalseValue=False,
                 deeperDict=dict(a=17, b=32.5, c=[1, 2, "text"]),
             ),
-            someData = plistlib.Data(b"<binary gunk>"),
-            someMoreData = plistlib.Data(b"<lots of binary gunk>\0\1\2\3" * 10),
-            nestedData = [plistlib.Data(b"<lots of binary gunk>\0\1\2\3" * 10)],
+            someData = b"<binary gunk>",
+            someMoreData = b"<lots of binary gunk>\0\1\2\3" * 10,
+            nestedData = [b"<lots of binary gunk>\0\1\2\3" * 10],
             aDate = datetime.datetime(2004, 10, 26, 10, 33, 33),
             anEmptyDict = dict(),
             anEmptyList = list()
@@ -129,49 +134,220 @@
 
     def test_io(self):
         pl = self._create()
-        plistlib.writePlist(pl, support.TESTFN)
-        pl2 = plistlib.readPlist(support.TESTFN)
+        with open(support.TESTFN, 'wb') as fp:
+            plistlib.dump(pl, fp)
+
+        with open(support.TESTFN, 'rb') as fp:
+            pl2 = plistlib.load(fp)
+
         self.assertEqual(dict(pl), dict(pl2))
 
+        self.assertRaises(AttributeError, plistlib.dump, pl, 'filename')
+        self.assertRaises(AttributeError, plistlib.load, 'filename')
+
+    def test_invalid_type(self):
+        pl = [ object() ]
+
+        for fmt in ALL_FORMATS:
+            with self.subTest(fmt=fmt):
+                self.assertRaises(TypeError, plistlib.dumps, pl, fmt=fmt)
+
+    def test_int(self):
+        for pl in [0, 2**8-1, 2**8, 2**16-1, 2**16, 2**32-1, 2**32,
+                   2**63-1, 2**64-1, 1, -2**63]:
+            for fmt in ALL_FORMATS:
+                with self.subTest(pl=pl, fmt=fmt):
+                    data = plistlib.dumps(pl, fmt=fmt)
+                    pl2 = plistlib.loads(data)
+                    self.assertIsInstance(pl2, int)
+                    self.assertEqual(pl, pl2)
+                    data2 = plistlib.dumps(pl2, fmt=fmt)
+                    self.assertEqual(data, data2)
+
+        for fmt in ALL_FORMATS:
+            for pl in (2 ** 64 + 1, 2 ** 127-1, -2**64, -2 ** 127):
+                with self.subTest(pl=pl, fmt=fmt):
+                    self.assertRaises(OverflowError, plistlib.dumps,
+                                      pl, fmt=fmt)
+
     def test_bytes(self):
         pl = self._create()
-        data = plistlib.writePlistToBytes(pl)
-        pl2 = plistlib.readPlistFromBytes(data)
+        data = plistlib.dumps(pl)
+        pl2 = plistlib.loads(data)
+        self.assertNotIsInstance(pl, plistlib._InternalDict)
         self.assertEqual(dict(pl), dict(pl2))
-        data2 = plistlib.writePlistToBytes(pl2)
+        data2 = plistlib.dumps(pl2)
         self.assertEqual(data, data2)
 
     def test_indentation_array(self):
-        data = [[[[[[[[{'test': plistlib.Data(b'aaaaaa')}]]]]]]]]
-        self.assertEqual(plistlib.readPlistFromBytes(plistlib.writePlistToBytes(data)), data)
+        data = [[[[[[[[{'test': b'aaaaaa'}]]]]]]]]
+        self.assertEqual(plistlib.loads(plistlib.dumps(data)), data)
 
     def test_indentation_dict(self):
-        data = {'1': {'2': {'3': {'4': {'5': {'6': {'7': {'8': {'9': plistlib.Data(b'aaaaaa')}}}}}}}}}
-        self.assertEqual(plistlib.readPlistFromBytes(plistlib.writePlistToBytes(data)), data)
+        data = {'1': {'2': {'3': {'4': {'5': {'6': {'7': {'8': {'9': b'aaaaaa'}}}}}}}}}
+        self.assertEqual(plistlib.loads(plistlib.dumps(data)), data)
 
     def test_indentation_dict_mix(self):
-        data = {'1': {'2': [{'3': [[[[[{'test': plistlib.Data(b'aaaaaa')}]]]]]}]}}
-        self.assertEqual(plistlib.readPlistFromBytes(plistlib.writePlistToBytes(data)), data)
+        data = {'1': {'2': [{'3': [[[[[{'test': b'aaaaaa'}]]]]]}]}}
+        self.assertEqual(plistlib.loads(plistlib.dumps(data)), data)
 
     def test_appleformatting(self):
-        pl = plistlib.readPlistFromBytes(TESTDATA)
-        data = plistlib.writePlistToBytes(pl)
-        self.assertEqual(data, TESTDATA,
-                         "generated data was not identical to Apple's output")
+        for use_builtin_types in (True, False):
+            for fmt in ALL_FORMATS:
+                with self.subTest(fmt=fmt, use_builtin_types=use_builtin_types):
+                    pl = plistlib.loads(TESTDATA[fmt],
+                        use_builtin_types=use_builtin_types)
+                    data = plistlib.dumps(pl, fmt=fmt)
+                    self.assertEqual(data, TESTDATA[fmt],
+                        "generated data was not identical to Apple's output")
+
 
     def test_appleformattingfromliteral(self):
-        pl = self._create()
-        pl2 = plistlib.readPlistFromBytes(TESTDATA)
-        self.assertEqual(dict(pl), dict(pl2),
-                         "generated data was not identical to Apple's output")
+        self.maxDiff = None
+        for fmt in ALL_FORMATS:
+            with self.subTest(fmt=fmt):
+                pl = self._create(fmt=fmt)
+                pl2 = plistlib.loads(TESTDATA[fmt], fmt=fmt)
+                self.assertEqual(dict(pl), dict(pl2),
+                    "generated data was not identical to Apple's output")
+                pl2 = plistlib.loads(TESTDATA[fmt])
+                self.assertEqual(dict(pl), dict(pl2),
+                    "generated data was not identical to Apple's output")
 
     def test_bytesio(self):
-        from io import BytesIO
-        b = BytesIO()
-        pl = self._create()
-        plistlib.writePlist(pl, b)
-        pl2 = plistlib.readPlist(BytesIO(b.getvalue()))
-        self.assertEqual(dict(pl), dict(pl2))
+        for fmt in ALL_FORMATS:
+            with self.subTest(fmt=fmt):
+                b = BytesIO()
+                pl = self._create(fmt=fmt)
+                plistlib.dump(pl, b, fmt=fmt)
+                pl2 = plistlib.load(BytesIO(b.getvalue()), fmt=fmt)
+                self.assertEqual(dict(pl), dict(pl2))
+                pl2 = plistlib.load(BytesIO(b.getvalue()))
+                self.assertEqual(dict(pl), dict(pl2))
+
+    def test_keysort_bytesio(self):
+        pl = collections.OrderedDict()
+        pl['b'] = 1
+        pl['a'] = 2
+        pl['c'] = 3
+
+        for fmt in ALL_FORMATS:
+            for sort_keys in (False, True):
+                with self.subTest(fmt=fmt, sort_keys=sort_keys):
+                    b = BytesIO()
+
+                    plistlib.dump(pl, b, fmt=fmt, sort_keys=sort_keys)
+                    pl2 = plistlib.load(BytesIO(b.getvalue()),
+                        dict_type=collections.OrderedDict)
+
+                    self.assertEqual(dict(pl), dict(pl2))
+                    if sort_keys:
+                        self.assertEqual(list(pl2.keys()), ['a', 'b', 'c'])
+                    else:
+                        self.assertEqual(list(pl2.keys()), ['b', 'a', 'c'])
+
+    def test_keysort(self):
+        pl = collections.OrderedDict()
+        pl['b'] = 1
+        pl['a'] = 2
+        pl['c'] = 3
+
+        for fmt in ALL_FORMATS:
+            for sort_keys in (False, True):
+                with self.subTest(fmt=fmt, sort_keys=sort_keys):
+                    data = plistlib.dumps(pl, fmt=fmt, sort_keys=sort_keys)
+                    pl2 = plistlib.loads(data, dict_type=collections.OrderedDict)
+
+                    self.assertEqual(dict(pl), dict(pl2))
+                    if sort_keys:
+                        self.assertEqual(list(pl2.keys()), ['a', 'b', 'c'])
+                    else:
+                        self.assertEqual(list(pl2.keys()), ['b', 'a', 'c'])
+
+    def test_keys_no_string(self):
+        pl = { 42: 'aNumber' }
+
+        for fmt in ALL_FORMATS:
+            with self.subTest(fmt=fmt):
+                self.assertRaises(TypeError, plistlib.dumps, pl, fmt=fmt)
+
+                b = BytesIO()
+                self.assertRaises(TypeError, plistlib.dump, pl, b, fmt=fmt)
+
+    def test_skipkeys(self):
+        pl = {
+            42: 'aNumber',
+            'snake': 'aWord',
+        }
+
+        for fmt in ALL_FORMATS:
+            with self.subTest(fmt=fmt):
+                data = plistlib.dumps(
+                    pl, fmt=fmt, skipkeys=True, sort_keys=False)
+
+                pl2 = plistlib.loads(data)
+                self.assertEqual(pl2, {'snake': 'aWord'})
+
+                fp = BytesIO()
+                plistlib.dump(
+                    pl, fp, fmt=fmt, skipkeys=True, sort_keys=False)
+                data = fp.getvalue()
+                pl2 = plistlib.loads(fp.getvalue())
+                self.assertEqual(pl2, {'snake': 'aWord'})
+
+    def test_tuple_members(self):
+        pl = {
+            'first': (1, 2),
+            'second': (1, 2),
+            'third': (3, 4),
+        }
+
+        for fmt in ALL_FORMATS:
+            with self.subTest(fmt=fmt):
+                data = plistlib.dumps(pl, fmt=fmt)
+                pl2 = plistlib.loads(data)
+                self.assertEqual(pl2, {
+                    'first': [1, 2],
+                    'second': [1, 2],
+                    'third': [3, 4],
+                })
+                self.assertIsNot(pl2['first'], pl2['second'])
+
+    def test_list_members(self):
+        pl = {
+            'first': [1, 2],
+            'second': [1, 2],
+            'third': [3, 4],
+        }
+
+        for fmt in ALL_FORMATS:
+            with self.subTest(fmt=fmt):
+                data = plistlib.dumps(pl, fmt=fmt)
+                pl2 = plistlib.loads(data)
+                self.assertEqual(pl2, {
+                    'first': [1, 2],
+                    'second': [1, 2],
+                    'third': [3, 4],
+                })
+                self.assertIsNot(pl2['first'], pl2['second'])
+
+    def test_dict_members(self):
+        pl = {
+            'first': {'a': 1},
+            'second': {'a': 1},
+            'third': {'b': 2 },
+        }
+
+        for fmt in ALL_FORMATS:
+            with self.subTest(fmt=fmt):
+                data = plistlib.dumps(pl, fmt=fmt)
+                pl2 = plistlib.loads(data)
+                self.assertEqual(pl2, {
+                    'first': {'a': 1},
+                    'second': {'a': 1},
+                    'third': {'b': 2 },
+                })
+                self.assertIsNot(pl2['first'], pl2['second'])
 
     def test_controlcharacters(self):
         for i in range(128):
@@ -179,25 +355,27 @@
             testString = "string containing %s" % c
             if i >= 32 or c in "\r\n\t":
                 # \r, \n and \t are the only legal control chars in XML
-                plistlib.writePlistToBytes(testString)
+                plistlib.dumps(testString, fmt=plistlib.FMT_XML)
             else:
                 self.assertRaises(ValueError,
-                                  plistlib.writePlistToBytes,
+                                  plistlib.dumps,
                                   testString)
 
     def test_nondictroot(self):
-        test1 = "abc"
-        test2 = [1, 2, 3, "abc"]
-        result1 = plistlib.readPlistFromBytes(plistlib.writePlistToBytes(test1))
-        result2 = plistlib.readPlistFromBytes(plistlib.writePlistToBytes(test2))
-        self.assertEqual(test1, result1)
-        self.assertEqual(test2, result2)
+        for fmt in ALL_FORMATS:
+            with self.subTest(fmt=fmt):
+                test1 = "abc"
+                test2 = [1, 2, 3, "abc"]
+                result1 = plistlib.loads(plistlib.dumps(test1, fmt=fmt))
+                result2 = plistlib.loads(plistlib.dumps(test2, fmt=fmt))
+                self.assertEqual(test1, result1)
+                self.assertEqual(test2, result2)
 
     def test_invalidarray(self):
         for i in ["<key>key inside an array</key>",
                   "<key>key inside an array2</key><real>3</real>",
                   "<true/><key>key inside an array3</key>"]:
-            self.assertRaises(ValueError, plistlib.readPlistFromBytes,
+            self.assertRaises(ValueError, plistlib.loads,
                               ("<plist><array>%s</array></plist>"%i).encode())
 
     def test_invaliddict(self):
@@ -206,22 +384,142 @@
                   "<string>missing key</string>",
                   "<key>k1</key><string>v1</string><real>5.3</real>"
                   "<key>k1</key><key>k2</key><string>double key</string>"]:
-            self.assertRaises(ValueError, plistlib.readPlistFromBytes,
+            self.assertRaises(ValueError, plistlib.loads,
                               ("<plist><dict>%s</dict></plist>"%i).encode())
-            self.assertRaises(ValueError, plistlib.readPlistFromBytes,
+            self.assertRaises(ValueError, plistlib.loads,
                               ("<plist><array><dict>%s</dict></array></plist>"%i).encode())
 
     def test_invalidinteger(self):
-        self.assertRaises(ValueError, plistlib.readPlistFromBytes,
+        self.assertRaises(ValueError, plistlib.loads,
                           b"<plist><integer>not integer</integer></plist>")
 
     def test_invalidreal(self):
-        self.assertRaises(ValueError, plistlib.readPlistFromBytes,
+        self.assertRaises(ValueError, plistlib.loads,
                           b"<plist><integer>not real</integer></plist>")
 
+    def test_xml_encodings(self):
+        base = TESTDATA[plistlib.FMT_XML]
+
+        for xml_encoding, encoding, bom in [
+                    (b'utf-8', 'utf-8', codecs.BOM_UTF8),
+                    (b'utf-16', 'utf-16-le', codecs.BOM_UTF16_LE),
+                    (b'utf-16', 'utf-16-be', codecs.BOM_UTF16_BE),
+                    # Expat does not support UTF-32
+                    #(b'utf-32', 'utf-32-le', codecs.BOM_UTF32_LE),
+                    #(b'utf-32', 'utf-32-be', codecs.BOM_UTF32_BE),
+                ]:
+
+            pl = self._create(fmt=plistlib.FMT_XML)
+            with self.subTest(encoding=encoding):
+                data = base.replace(b'UTF-8', xml_encoding)
+                data = bom + data.decode('utf-8').encode(encoding)
+                pl2 = plistlib.loads(data)
+                self.assertEqual(dict(pl), dict(pl2))
+
+    def test_nonstandard_refs_size(self):
+        # Issue #21538: Refs and offsets are 24-bit integers
+        data = (b'bplist00'
+                b'\xd1\x00\x00\x01\x00\x00\x02QaQb'
+                b'\x00\x00\x08\x00\x00\x0f\x00\x00\x11'
+                b'\x00\x00\x00\x00\x00\x00'
+                b'\x03\x03'
+                b'\x00\x00\x00\x00\x00\x00\x00\x03'
+                b'\x00\x00\x00\x00\x00\x00\x00\x00'
+                b'\x00\x00\x00\x00\x00\x00\x00\x13')
+        self.assertEqual(plistlib.loads(data), {'a': 'b'})
+
+
+class TestPlistlibDeprecated(unittest.TestCase):
+    def test_io_deprecated(self):
+        pl_in = {
+            'key': 42,
+            'sub': {
+                'key': 9,
+                'alt': 'value',
+                'data': b'buffer',
+            }
+        }
+        pl_out = plistlib._InternalDict({
+            'key': 42,
+            'sub': plistlib._InternalDict({
+                'key': 9,
+                'alt': 'value',
+                'data': plistlib.Data(b'buffer'),
+            })
+        })
+
+        self.addCleanup(support.unlink, support.TESTFN)
+        with self.assertWarns(DeprecationWarning):
+            plistlib.writePlist(pl_in, support.TESTFN)
+
+        with self.assertWarns(DeprecationWarning):
+            pl2 = plistlib.readPlist(support.TESTFN)
+
+        self.assertEqual(pl_out, pl2)
+
+        os.unlink(support.TESTFN)
+
+        with open(support.TESTFN, 'wb') as fp:
+            with self.assertWarns(DeprecationWarning):
+                plistlib.writePlist(pl_in, fp)
+
+        with open(support.TESTFN, 'rb') as fp:
+            with self.assertWarns(DeprecationWarning):
+                pl2 = plistlib.readPlist(fp)
+
+        self.assertEqual(pl_out, pl2)
+
+    def test_bytes_deprecated(self):
+        pl = {
+            'key': 42,
+            'sub': {
+                'key': 9,
+                'alt': 'value',
+                'data': b'buffer',
+            }
+        }
+        with self.assertWarns(DeprecationWarning):
+            data = plistlib.writePlistToBytes(pl)
+
+        with self.assertWarns(DeprecationWarning):
+            pl2 = plistlib.readPlistFromBytes(data)
+
+        self.assertIsInstance(pl2, plistlib._InternalDict)
+        self.assertEqual(pl2, plistlib._InternalDict(
+            key=42,
+            sub=plistlib._InternalDict(
+                key=9,
+                alt='value',
+                data=plistlib.Data(b'buffer'),
+            )
+        ))
+
+        with self.assertWarns(DeprecationWarning):
+            data2 = plistlib.writePlistToBytes(pl2)
+        self.assertEqual(data, data2)
+
+    def test_dataobject_deprecated(self):
+        in_data = { 'key': plistlib.Data(b'hello') }
+        out_data = { 'key': b'hello' }
+
+        buf = plistlib.dumps(in_data)
+
+        cur = plistlib.loads(buf)
+        self.assertEqual(cur, out_data)
+        self.assertNotEqual(cur, in_data)
+
+        cur = plistlib.loads(buf, use_builtin_types=False)
+        self.assertNotEqual(cur, out_data)
+        self.assertEqual(cur, in_data)
+
+        with self.assertWarns(DeprecationWarning):
+            cur = plistlib.readPlistFromBytes(buf)
+        self.assertNotEqual(cur, out_data)
+        self.assertEqual(cur, in_data)
+
 
 def test_main():
-    support.run_unittest(TestPlistlib)
+    support.run_unittest(TestPlistlib, TestPlistlibDeprecated)
 
 
 if __name__ == '__main__':
diff --git a/Lib/test/test_poll.py b/Lib/test/test_poll.py
index a07a719..a0a332b 100644
--- 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
+import subprocess
 import random
 import select
 try:
@@ -14,7 +15,7 @@
 try:
     select.poll
 except AttributeError:
-    raise unittest.SkipTest("select.poll not defined -- skipping test_poll")
+    raise unittest.SkipTest("select.poll not defined")
 
 
 def find_ready_matching(ready, flag):
@@ -75,13 +76,11 @@
 
         self.assertEqual(bufs, [MSG] * NUM_PIPES)
 
-    def poll_unit_tests(self):
+    def test_poll_unit_tests(self):
         # returns NVAL for invalid file descriptor
-        FD = 42
-        try:
-            os.close(FD)
-        except OSError:
-            pass
+        FD, w = os.pipe()
+        os.close(FD)
+        os.close(w)
         p = select.poll()
         p.register(FD)
         r = p.poll()
@@ -124,7 +123,9 @@
 
     def test_poll2(self):
         cmd = 'for i in 0 1 2 3 4 5 6 7 8 9; do echo testing...; sleep 1; done'
-        p = os.popen(cmd, 'r')
+        proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE,
+                                bufsize=0)
+        p = proc.stdout
         pollster = select.poll()
         pollster.register( p, select.POLLIN )
         for tout in (0, 1000, 2000, 4000, 8000, 16000) + (-1,)*10:
@@ -134,7 +135,7 @@
             fd, flags = fdlist[0]
             if flags & select.POLLHUP:
                 line = p.readline()
-                if line != "":
+                if line != b"":
                     self.fail('error: pipe seems to be closed, but still returns data')
                 continue
 
@@ -142,6 +143,7 @@
                 line = p.readline()
                 if not line:
                     break
+                self.assertEqual(line, b'testing...\n')
                 continue
             else:
                 self.fail('Unexpected return value from select.poll: %s' % fdlist)
diff --git a/Lib/test/test_poplib.py b/Lib/test/test_poplib.py
index 5809be6..8a3c9f4 100644
--- a/Lib/test/test_poplib.py
+++ b/Lib/test/test_poplib.py
@@ -18,6 +18,16 @@
 HOST = test_support.HOST
 PORT = 0
 
+SUPPORTS_SSL = False
+if hasattr(poplib, 'POP3_SSL'):
+    import ssl
+
+    SUPPORTS_SSL = True
+    CERTFILE = os.path.join(os.path.dirname(__file__) or os.curdir, "keycert3.pem")
+    CAFILE = os.path.join(os.path.dirname(__file__) or os.curdir, "pycacert.pem")
+
+requires_ssl = skipUnless(SUPPORTS_SSL, 'SSL not supported')
+
 # the dummy data returned by server when LIST and RETR commands are issued
 LIST_RESP = b'1 1\r\n2 2\r\n3 3\r\n4 4\r\n5 5\r\n.\r\n'
 RETR_RESP = b"""From: postmaster@python.org\
@@ -33,11 +43,15 @@
 
 class DummyPOP3Handler(asynchat.async_chat):
 
+    CAPAS = {'UIDL': [], 'IMPLEMENTATION': ['python-testlib-pop-server']}
+
     def __init__(self, conn):
         asynchat.async_chat.__init__(self, conn)
         self.set_terminator(b"\r\n")
         self.in_buffer = []
         self.push('+OK dummy pop3 server ready. <timestamp>')
+        self.tls_active = False
+        self.tls_starting = False
 
     def collect_incoming_data(self, data):
         self.in_buffer.append(data)
@@ -112,6 +126,65 @@
         self.push('+OK closing.')
         self.close_when_done()
 
+    def _get_capas(self):
+        _capas = dict(self.CAPAS)
+        if not self.tls_active and SUPPORTS_SSL:
+            _capas['STLS'] = []
+        return _capas
+
+    def cmd_capa(self, arg):
+        self.push('+OK Capability list follows')
+        if self._get_capas():
+            for cap, params in self._get_capas().items():
+                _ln = [cap]
+                if params:
+                    _ln.extend(params)
+                self.push(' '.join(_ln))
+        self.push('.')
+
+    if SUPPORTS_SSL:
+
+        def cmd_stls(self, arg):
+            if self.tls_active is False:
+                self.push('+OK Begin TLS negotiation')
+                tls_sock = ssl.wrap_socket(self.socket, certfile=CERTFILE,
+                                           server_side=True,
+                                           do_handshake_on_connect=False,
+                                           suppress_ragged_eofs=False)
+                self.del_channel()
+                self.set_socket(tls_sock)
+                self.tls_active = True
+                self.tls_starting = True
+                self.in_buffer = []
+                self._do_tls_handshake()
+            else:
+                self.push('-ERR Command not permitted when TLS active')
+
+        def _do_tls_handshake(self):
+            try:
+                self.socket.do_handshake()
+            except ssl.SSLError as err:
+                if err.args[0] in (ssl.SSL_ERROR_WANT_READ,
+                                   ssl.SSL_ERROR_WANT_WRITE):
+                    return
+                elif err.args[0] == ssl.SSL_ERROR_EOF:
+                    return self.handle_close()
+                raise
+            except OSError as err:
+                if err.args[0] == errno.ECONNABORTED:
+                    return self.handle_close()
+            else:
+                self.tls_active = True
+                self.tls_starting = False
+
+        def handle_read(self):
+            if self.tls_starting:
+                self._do_tls_handshake()
+            else:
+                try:
+                    asynchat.async_chat.handle_read(self)
+                except ssl.SSLEOFError:
+                    self.handle_close()
 
 class DummyPOP3Server(asyncore.dispatcher, threading.Thread):
 
@@ -236,19 +309,42 @@
         self.client.uidl()
         self.client.uidl('foo')
 
+    def test_capa(self):
+        capa = self.client.capa()
+        self.assertTrue('IMPLEMENTATION' in capa.keys())
+
     def test_quit(self):
         resp = self.client.quit()
         self.assertTrue(resp)
         self.assertIsNone(self.client.sock)
         self.assertIsNone(self.client.file)
 
+    @requires_ssl
+    def test_stls_capa(self):
+        capa = self.client.capa()
+        self.assertTrue('STLS' in capa.keys())
 
-SUPPORTS_SSL = False
-if hasattr(poplib, 'POP3_SSL'):
-    import ssl
+    @requires_ssl
+    def test_stls(self):
+        expected = b'+OK Begin TLS negotiation'
+        resp = self.client.stls()
+        self.assertEqual(resp, expected)
 
-    SUPPORTS_SSL = True
-    CERTFILE = os.path.join(os.path.dirname(__file__) or os.curdir, "keycert.pem")
+    @requires_ssl
+    def test_stls_context(self):
+        expected = b'+OK Begin TLS negotiation'
+        ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+        ctx.load_verify_locations(CAFILE)
+        ctx.verify_mode = ssl.CERT_REQUIRED
+        ctx.check_hostname = True
+        with self.assertRaises(ssl.CertificateError):
+            resp = self.client.stls(context=ctx)
+        self.client = poplib.POP3("localhost", self.server.port, timeout=3)
+        resp = self.client.stls(context=ctx)
+        self.assertEqual(resp, expected)
+
+
+if SUPPORTS_SSL:
 
     class DummyPOP3_SSLHandler(DummyPOP3Handler):
 
@@ -260,35 +356,13 @@
             self.del_channel()
             self.set_socket(ssl_socket)
             # Must try handshake before calling push()
-            self._ssl_accepting = True
-            self._do_ssl_handshake()
+            self.tls_active = True
+            self.tls_starting = True
+            self._do_tls_handshake()
             self.set_terminator(b"\r\n")
             self.in_buffer = []
             self.push('+OK dummy pop3 server ready. <timestamp>')
 
-        def _do_ssl_handshake(self):
-            try:
-                self.socket.do_handshake()
-            except ssl.SSLError as err:
-                if err.args[0] in (ssl.SSL_ERROR_WANT_READ,
-                                   ssl.SSL_ERROR_WANT_WRITE):
-                    return
-                elif err.args[0] == ssl.SSL_ERROR_EOF:
-                    return self.handle_close()
-                raise
-            except socket.error as err:
-                if err.args[0] == errno.ECONNABORTED:
-                    return self.handle_close()
-            else:
-                self._ssl_accepting = False
-
-        def handle_read(self):
-            if self._ssl_accepting:
-                self._do_ssl_handshake()
-            else:
-                DummyPOP3Handler.handle_read(self)
-
-requires_ssl = skipUnless(SUPPORTS_SSL, 'SSL not supported')
 
 @requires_ssl
 class TestPOP3_SSLClass(TestPOP3Class):
@@ -306,20 +380,60 @@
     def test_context(self):
         ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
         self.assertRaises(ValueError, poplib.POP3_SSL, self.server.host,
-                          self.server.port, keyfile=CERTFILE, context=ctx)
+                            self.server.port, keyfile=CERTFILE, context=ctx)
         self.assertRaises(ValueError, poplib.POP3_SSL, self.server.host,
-                          self.server.port, certfile=CERTFILE, context=ctx)
+                            self.server.port, certfile=CERTFILE, context=ctx)
         self.assertRaises(ValueError, poplib.POP3_SSL, self.server.host,
-                          self.server.port, keyfile=CERTFILE,
-                          certfile=CERTFILE, context=ctx)
+                            self.server.port, keyfile=CERTFILE,
+                            certfile=CERTFILE, context=ctx)
 
         self.client.quit()
         self.client = poplib.POP3_SSL(self.server.host, self.server.port,
-                                      context=ctx)
+                                        context=ctx)
         self.assertIsInstance(self.client.sock, ssl.SSLSocket)
         self.assertIs(self.client.sock.context, ctx)
         self.assertTrue(self.client.noop().startswith(b'+OK'))
 
+    def test_stls(self):
+        self.assertRaises(poplib.error_proto, self.client.stls)
+
+    test_stls_context = test_stls
+
+    def test_stls_capa(self):
+        capa = self.client.capa()
+        self.assertFalse('STLS' in capa.keys())
+
+
+@requires_ssl
+class TestPOP3_TLSClass(TestPOP3Class):
+    # repeat previous tests by using poplib.POP3.stls()
+
+    def setUp(self):
+        self.server = DummyPOP3Server((HOST, PORT))
+        self.server.start()
+        self.client = poplib.POP3(self.server.host, self.server.port, timeout=3)
+        self.client.stls()
+
+    def tearDown(self):
+        if self.client.file is not None and self.client.sock is not None:
+            try:
+                self.client.quit()
+            except poplib.error_proto:
+                # happens in the test_too_long_lines case; the overlong
+                # response will be treated as response to QUIT and raise
+                # this exception
+                self.client.close()
+        self.server.stop()
+
+    def test_stls(self):
+        self.assertRaises(poplib.error_proto, self.client.stls)
+
+    test_stls_context = test_stls
+
+    def test_stls_capa(self):
+        capa = self.client.capa()
+        self.assertFalse(b'STLS' in capa.keys())
+
 
 class TestTimeouts(TestCase):
 
@@ -377,7 +491,7 @@
 
 def test_main():
     tests = [TestPOP3Class, TestTimeouts,
-             TestPOP3_SSLClass]
+             TestPOP3_SSLClass, TestPOP3_TLSClass]
     thread_info = test_support.threading_setup()
     try:
         test_support.run_unittest(*tests)
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py
index 5c09ebf..72fdd16 100644
--- a/Lib/test/test_posix.py
+++ b/Lib/test/test_posix.py
@@ -603,8 +603,10 @@
         r, w = os.pipe2(os.O_CLOEXEC|os.O_NONBLOCK)
         self.addCleanup(os.close, r)
         self.addCleanup(os.close, w)
-        self.assertTrue(fcntl.fcntl(r, fcntl.F_GETFD) & fcntl.FD_CLOEXEC)
-        self.assertTrue(fcntl.fcntl(w, fcntl.F_GETFD) & fcntl.FD_CLOEXEC)
+        self.assertFalse(os.get_inheritable(r))
+        self.assertFalse(os.get_inheritable(w))
+        self.assertTrue(fcntl.fcntl(r, fcntl.F_GETFL) & os.O_NONBLOCK)
+        self.assertTrue(fcntl.fcntl(w, fcntl.F_GETFL) & os.O_NONBLOCK)
         # try reading from an empty pipe: this should fail, not block
         self.assertRaises(OSError, os.read, r, 1)
         # try a write big enough to fill-up the pipe: this should either
@@ -652,7 +654,7 @@
             self.assertEqual(st.st_flags | stat.UF_IMMUTABLE, new_st.st_flags)
             try:
                 fd = open(target_file, 'w+')
-            except IOError as e:
+            except OSError as e:
                 self.assertEqual(e.errno, errno.EPERM)
         finally:
             posix.chflags(target_file, st.st_flags)
@@ -710,41 +712,39 @@
 
     @unittest.skipUnless(hasattr(posix, 'getcwd'), 'test needs posix.getcwd()')
     def test_getcwd_long_pathnames(self):
-        if hasattr(posix, 'getcwd'):
-            dirname = 'getcwd-test-directory-0123456789abcdef-01234567890abcdef'
-            curdir = os.getcwd()
-            base_path = os.path.abspath(support.TESTFN) + '.getcwd'
+        dirname = 'getcwd-test-directory-0123456789abcdef-01234567890abcdef'
+        curdir = os.getcwd()
+        base_path = os.path.abspath(support.TESTFN) + '.getcwd'
 
-            try:
-                os.mkdir(base_path)
-                os.chdir(base_path)
-            except:
-#               Just returning nothing instead of the SkipTest exception,
-#               because the test results in Error in that case.
-#               Is that ok?
-#                raise unittest.SkipTest("cannot create directory for testing")
-                return
+        try:
+            os.mkdir(base_path)
+            os.chdir(base_path)
+        except:
+            #  Just returning nothing instead of the SkipTest exception, because
+            #  the test results in Error in that case.  Is that ok?
+            #  raise unittest.SkipTest("cannot create directory for testing")
+            return
 
-                def _create_and_do_getcwd(dirname, current_path_length = 0):
-                    try:
-                        os.mkdir(dirname)
-                    except:
-                        raise unittest.SkipTest("mkdir cannot create directory sufficiently deep for getcwd test")
+            def _create_and_do_getcwd(dirname, current_path_length = 0):
+                try:
+                    os.mkdir(dirname)
+                except:
+                    raise unittest.SkipTest("mkdir cannot create directory sufficiently deep for getcwd test")
 
-                    os.chdir(dirname)
-                    try:
-                        os.getcwd()
-                        if current_path_length < 1027:
-                            _create_and_do_getcwd(dirname, current_path_length + len(dirname) + 1)
-                    finally:
-                        os.chdir('..')
-                        os.rmdir(dirname)
+                os.chdir(dirname)
+                try:
+                    os.getcwd()
+                    if current_path_length < 1027:
+                        _create_and_do_getcwd(dirname, current_path_length + len(dirname) + 1)
+                finally:
+                    os.chdir('..')
+                    os.rmdir(dirname)
 
-                _create_and_do_getcwd(dirname)
+            _create_and_do_getcwd(dirname)
 
-            finally:
-                os.chdir(curdir)
-                support.rmtree(base_path)
+        finally:
+            os.chdir(curdir)
+            support.rmtree(base_path)
 
     @unittest.skipUnless(hasattr(posix, 'getgrouplist'), "test needs posix.getgrouplist()")
     @unittest.skipUnless(hasattr(pwd, 'getpwuid'), "test needs pwd.getpwuid()")
@@ -757,7 +757,7 @@
 
     @unittest.skipUnless(hasattr(os, 'getegid'), "test needs os.getegid()")
     def test_getgroups(self):
-        with os.popen('id -G') as idg:
+        with os.popen('id -G 2>/dev/null') as idg:
             groups = idg.read().strip()
             ret = idg.close()
 
@@ -768,7 +768,7 @@
         if sys.platform == 'darwin':
             import sysconfig
             dt = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET') or '10.0'
-            if float(dt) < 10.6:
+            if tuple(int(n) for n in dt.split('.')[0:2]) < (10, 6):
                 raise unittest.SkipTest("getgroups(2) is broken prior to 10.6")
 
         # 'id -G' and 'os.getgroups()' should return the same
@@ -1121,6 +1121,24 @@
                 # http://lists.freebsd.org/pipermail/freebsd-amd64/2012-January/014332.html
                 raise unittest.SkipTest("OSError raised!")
 
+    def test_path_error2(self):
+        """
+        Test functions that call path_error2(), providing two filenames in their exceptions.
+        """
+        for name in ("rename", "replace", "link"):
+            function = getattr(os, name, None)
+            if function is None:
+                continue
+
+            for dst in ("noodly2", support.TESTFN):
+                try:
+                    function('doesnotexistfilename', dst)
+                except OSError as e:
+                    self.assertIn("'doesnotexistfilename' -> '{}'".format(dst), str(e))
+                    break
+            else:
+                self.fail("No valid path_error2() test for os." + name)
+
 class PosixGroupsTester(unittest.TestCase):
 
     def setUp(self):
diff --git a/Lib/test/test_posixpath.py b/Lib/test/test_posixpath.py
index 0e7d866..ec2fbae 100644
--- a/Lib/test/test_posixpath.py
+++ b/Lib/test/test_posixpath.py
@@ -57,21 +57,17 @@
         self.assertEqual(posixpath.join(b"/foo/", b"bar/", b"baz/"),
                          b"/foo/bar/baz/")
 
-        def check_error_msg(list_of_args, msg):
-            """Check posixpath.join raises friendly TypeErrors."""
-            for args in (item for perm in list_of_args
-                              for item in itertools.permutations(perm)):
-                with self.assertRaises(TypeError) as cm:
-                    posixpath.join(*args)
-                self.assertEqual(msg, cm.exception.args[0])
-
-        check_error_msg([[b'bytes', 'str'], [bytearray(b'bytes'), 'str']],
-                        "Can't mix strings and bytes in path components.")
+    def test_join_errors(self):
+        # Check posixpath.join raises friendly TypeErrors.
+        errmsg = "Can't mix strings and bytes in path components"
+        with self.assertRaisesRegex(TypeError, errmsg):
+            posixpath.join(b'bytes', 'str')
+        with self.assertRaisesRegex(TypeError, errmsg):
+            posixpath.join('str', b'bytes')
         # regression, see #15377
         with self.assertRaises(TypeError) as cm:
             posixpath.join(None, 'str')
-        self.assertNotEqual("Can't mix strings and bytes in path components.",
-                            cm.exception.args[0])
+        self.assertNotEqual(cm.exception.args[0], errmsg)
 
     def test_split(self):
         self.assertEqual(posixpath.split("/foo/bar"), ("/foo", "bar"))
@@ -186,63 +182,6 @@
             if not f.close():
                 f.close()
 
-    @staticmethod
-    def _create_file(filename):
-        with open(filename, 'wb') as f:
-            f.write(b'foo')
-
-    def test_samefile(self):
-        test_fn = support.TESTFN + "1"
-        self._create_file(test_fn)
-        self.assertTrue(posixpath.samefile(test_fn, test_fn))
-        self.assertRaises(TypeError, posixpath.samefile)
-
-    @unittest.skipIf(
-        sys.platform.startswith('win'),
-        "posixpath.samefile does not work on links in Windows")
-    @unittest.skipUnless(hasattr(os, "symlink"),
-                         "Missing symlink implementation")
-    def test_samefile_on_links(self):
-        test_fn1 = support.TESTFN + "1"
-        test_fn2 = support.TESTFN + "2"
-        self._create_file(test_fn1)
-
-        os.symlink(test_fn1, test_fn2)
-        self.assertTrue(posixpath.samefile(test_fn1, test_fn2))
-        os.remove(test_fn2)
-
-        self._create_file(test_fn2)
-        self.assertFalse(posixpath.samefile(test_fn1, test_fn2))
-
-
-    def test_samestat(self):
-        test_fn = support.TESTFN + "1"
-        self._create_file(test_fn)
-        test_fns = [test_fn]*2
-        stats = map(os.stat, test_fns)
-        self.assertTrue(posixpath.samestat(*stats))
-
-    @unittest.skipIf(
-        sys.platform.startswith('win'),
-        "posixpath.samestat does not work on links in Windows")
-    @unittest.skipUnless(hasattr(os, "symlink"),
-                         "Missing symlink implementation")
-    def test_samestat_on_links(self):
-        test_fn1 = support.TESTFN + "1"
-        test_fn2 = support.TESTFN + "2"
-        self._create_file(test_fn1)
-        test_fns = (test_fn1, test_fn2)
-        os.symlink(*test_fns)
-        stats = map(os.stat, test_fns)
-        self.assertTrue(posixpath.samestat(*stats))
-        os.remove(test_fn2)
-
-        self._create_file(test_fn2)
-        stats = map(os.stat, test_fns)
-        self.assertFalse(posixpath.samestat(*stats))
-
-        self.assertRaises(TypeError, posixpath.samestat)
-
     def test_ismount(self):
         self.assertIs(posixpath.ismount("/"), True)
         with warnings.catch_warnings():
@@ -595,11 +534,6 @@
         finally:
             os.getcwdb = real_getcwdb
 
-    def test_sameopenfile(self):
-        fname = support.TESTFN + "1"
-        with open(fname, "wb") as a, open(fname, "wb") as b:
-            self.assertTrue(posixpath.sameopenfile(a.fileno(), b.fileno()))
-
 
 class PosixCommonTest(test_genericpath.CommonTest, unittest.TestCase):
     pathmodule = posixpath
diff --git a/Lib/test/test_pprint.py b/Lib/test/test_pprint.py
index a85298e..ad6a7a1 100644
--- a/Lib/test/test_pprint.py
+++ b/Lib/test/test_pprint.py
@@ -1,3 +1,5 @@
+# -*- coding: utf-8 -*-
+
 import pprint
 import test.support
 import unittest
@@ -530,6 +532,57 @@
         self.assertEqual(pprint.pformat(dict.fromkeys(keys, 0)),
                          '{%r: 0, %r: 0}' % tuple(sorted(keys, key=id)))
 
+    def test_str_wrap(self):
+        # pprint tries to wrap strings intelligently
+        fox = 'the quick brown fox jumped over a lazy dog'
+        self.assertEqual(pprint.pformat(fox, width=20), """\
+('the quick '
+ 'brown fox '
+ 'jumped over a '
+ 'lazy dog')""")
+        self.assertEqual(pprint.pformat({'a': 1, 'b': fox, 'c': 2},
+                                        width=26), """\
+{'a': 1,
+ 'b': 'the quick brown '
+      'fox jumped over '
+      'a lazy dog',
+ 'c': 2}""")
+        # With some special characters
+        # - \n always triggers a new line in the pprint
+        # - \t and \n are escaped
+        # - non-ASCII is allowed
+        # - an apostrophe doesn't disrupt the pprint
+        special = "Portons dix bons \"whiskys\"\nà l'avocat goujat\t qui fumait au zoo"
+        self.assertEqual(pprint.pformat(special, width=21), """\
+('Portons dix '
+ 'bons "whiskys"\\n'
+ "à l'avocat "
+ 'goujat\\t qui '
+ 'fumait au zoo')""")
+        # An unwrappable string is formatted as its repr
+        unwrappable = "x" * 100
+        self.assertEqual(pprint.pformat(unwrappable, width=80), repr(unwrappable))
+        self.assertEqual(pprint.pformat(''), "''")
+        # Check that the pprint is a usable repr
+        special *= 10
+        for width in range(3, 40):
+            formatted = pprint.pformat(special, width=width)
+            self.assertEqual(eval(formatted), special)
+            formatted = pprint.pformat([special] * 2, width=width)
+            self.assertEqual(eval(formatted), [special] * 2)
+
+    def test_compact(self):
+        o = ([list(range(i * i)) for i in range(5)] +
+             [list(range(i)) for i in range(6)])
+        expected = """\
+[[], [0], [0, 1, 2, 3],
+ [0, 1, 2, 3, 4, 5, 6, 7, 8],
+ [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
+  14, 15],
+ [], [0], [0, 1], [0, 1, 2], [0, 1, 2, 3],
+ [0, 1, 2, 3, 4]]"""
+        self.assertEqual(pprint.pformat(o, width=48, compact=True), expected)
+
 
 class DottedPrettyPrinter(pprint.PrettyPrinter):
 
diff --git a/Lib/test/test_print.py b/Lib/test/test_print.py
index 9d6dbea..7eea349 100644
--- a/Lib/test/test_print.py
+++ b/Lib/test/test_print.py
@@ -1,62 +1,55 @@
-"""Test correct operation of the print function.
-"""
-
-# In 2.6, this gives us the behavior we want.  In 3.0, it has
-#  no function, but it still must parse correctly.
-from __future__ import print_function
-
 import unittest
-from test import support
+from io import StringIO
 
-try:
-    # 3.x
-    from io import StringIO
-except ImportError:
-    # 2.x
-    from StringIO import StringIO
+from test import support
 
 NotDefined = object()
 
 # A dispatch table all 8 combinations of providing
-#  sep, end, and file
+# sep, end, and file.
 # I use this machinery so that I'm not just passing default
-#  values to print, I'm either passing or not passing in the
-#  arguments
+# values to print, I'm either passing or not passing in the
+# arguments.
 dispatch = {
     (False, False, False):
-     lambda args, sep, end, file: print(*args),
+        lambda args, sep, end, file: print(*args),
     (False, False, True):
-     lambda args, sep, end, file: print(file=file, *args),
+        lambda args, sep, end, file: print(file=file, *args),
     (False, True,  False):
-     lambda args, sep, end, file: print(end=end, *args),
+        lambda args, sep, end, file: print(end=end, *args),
     (False, True,  True):
-     lambda args, sep, end, file: print(end=end, file=file, *args),
+        lambda args, sep, end, file: print(end=end, file=file, *args),
     (True,  False, False):
-     lambda args, sep, end, file: print(sep=sep, *args),
+        lambda args, sep, end, file: print(sep=sep, *args),
     (True,  False, True):
-     lambda args, sep, end, file: print(sep=sep, file=file, *args),
+        lambda args, sep, end, file: print(sep=sep, file=file, *args),
     (True,  True,  False):
-     lambda args, sep, end, file: print(sep=sep, end=end, *args),
+        lambda args, sep, end, file: print(sep=sep, end=end, *args),
     (True,  True,  True):
-     lambda args, sep, end, file: print(sep=sep, end=end, file=file, *args),
-    }
+        lambda args, sep, end, file: print(sep=sep, end=end, file=file, *args),
+}
+
 
 # Class used to test __str__ and print
 class ClassWith__str__:
     def __init__(self, x):
         self.x = x
+
     def __str__(self):
         return self.x
 
-class TestPrint(unittest.TestCase):
-    def check(self, expected, args,
-            sep=NotDefined, end=NotDefined, file=NotDefined):
-        # Capture sys.stdout in a StringIO.  Call print with args,
-        #  and with sep, end, and file, if they're defined.  Result
-        #  must match expected.
 
-        # Look up the actual function to call, based on if sep, end, and file
-        #  are defined
+class TestPrint(unittest.TestCase):
+    """Test correct operation of the print function."""
+
+    def check(self, expected, args,
+              sep=NotDefined, end=NotDefined, file=NotDefined):
+        # Capture sys.stdout in a StringIO.  Call print with args,
+        # and with sep, end, and file, if they're defined.  Result
+        # must match expected.
+
+        # Look up the actual function to call, based on if sep, end,
+        # and file are defined.
         fn = dispatch[(sep is not NotDefined,
                        end is not NotDefined,
                        file is not NotDefined)]
@@ -69,7 +62,7 @@
     def test_print(self):
         def x(expected, args, sep=NotDefined, end=NotDefined):
             # Run the test 2 ways: not using file, and using
-            #  file directed to a StringIO
+            # file directed to a StringIO.
 
             self.check(expected, args, sep=sep, end=end)
 
@@ -101,11 +94,6 @@
         x('*\n', (ClassWith__str__('*'),))
         x('abc 1\n', (ClassWith__str__('abc'), 1))
 
-#        # 2.x unicode tests
-#        x(u'1 2\n', ('1', u'2'))
-#        x(u'u\1234\n', (u'u\1234',))
-#        x(u'  abc 1\n', (' ', ClassWith__str__(u'abc'), 1))
-
         # errors
         self.assertRaises(TypeError, print, '', sep=3)
         self.assertRaises(TypeError, print, '', end=3)
@@ -113,12 +101,14 @@
 
     def test_print_flush(self):
         # operation of the flush flag
-        class filelike():
+        class filelike:
             def __init__(self):
                 self.written = ''
                 self.flushed = 0
+
             def write(self, str):
                 self.written += str
+
             def flush(self):
                 self.flushed += 1
 
@@ -130,15 +120,13 @@
         self.assertEqual(f.flushed, 2)
 
         # ensure exceptions from flush are passed through
-        class noflush():
+        class noflush:
             def write(self, str):
                 pass
+
             def flush(self):
                 raise RuntimeError
         self.assertRaises(RuntimeError, print, 1, file=noflush(), flush=True)
 
-def test_main():
-    support.run_unittest(TestPrint)
-
 if __name__ == "__main__":
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_profile.py b/Lib/test/test_profile.py
index cd7ec58..1fc3c42 100644
--- a/Lib/test/test_profile.py
+++ b/Lib/test/test_profile.py
@@ -3,9 +3,11 @@
 import sys
 import pstats
 import unittest
+import os
 from difflib import unified_diff
 from io import StringIO
-from test.support import run_unittest
+from test.support import TESTFN, run_unittest, unlink
+from contextlib import contextmanager
 
 import profile
 from test.profilee import testfunc, timer
@@ -14,9 +16,13 @@
 class ProfileTest(unittest.TestCase):
 
     profilerclass = profile.Profile
+    profilermodule = profile
     methodnames = ['print_stats', 'print_callers', 'print_callees']
     expected_max_output = ':0(max)'
 
+    def tearDown(self):
+        unlink(TESTFN)
+
     def get_expected_output(self):
         return _ProfileOutput
 
@@ -74,6 +80,19 @@
             self.assertIn(self.expected_max_output, res,
                 "Profiling {0!r} didn't report max:\n{1}".format(stmt, res))
 
+    def test_run(self):
+        with silent():
+            self.profilermodule.run("int('1')")
+        self.profilermodule.run("int('1')", filename=TESTFN)
+        self.assertTrue(os.path.exists(TESTFN))
+
+    def test_runctx(self):
+        with silent():
+            self.profilermodule.runctx("testfunc()", globals(), locals())
+        self.profilermodule.runctx("testfunc()", globals(), locals(),
+                                  filename=TESTFN)
+        self.assertTrue(os.path.exists(TESTFN))
+
 
 def regenerate_expected_output(filename, cls):
     filename = filename.rstrip('co')
@@ -95,6 +114,14 @@
                     method, results[i+1]))
         f.write('\nif __name__ == "__main__":\n    main()\n')
 
+@contextmanager
+def silent():
+    stdout = sys.stdout
+    try:
+        sys.stdout = StringIO()
+        yield
+    finally:
+        sys.stdout = stdout
 
 def test_main():
     run_unittest(ProfileTest)
diff --git a/Lib/test/test_pty.py b/Lib/test/test_pty.py
index 29297f8..8916861 100644
--- a/Lib/test/test_pty.py
+++ b/Lib/test/test_pty.py
@@ -187,7 +187,7 @@
             ##debug("Reading from master_fd now that the child has exited")
             ##try:
             ##    s1 = os.read(master_fd, 1024)
-            ##except os.error:
+            ##except OSError:
             ##    pass
             ##else:
             ##    raise TestFailed("Read from master_fd did not raise exception")
diff --git a/Lib/test/test_py_compile.py b/Lib/test/test_py_compile.py
index f3c1a6a..1abea27 100644
--- a/Lib/test/test_py_compile.py
+++ b/Lib/test/test_py_compile.py
@@ -1,11 +1,14 @@
-import imp
+import importlib.util
 import os
 import py_compile
 import shutil
+import stat
+import sys
 import tempfile
 import unittest
 
-from test import support, script_helper
+from test import support
+
 
 class PyCompileTests(unittest.TestCase):
 
@@ -13,7 +16,7 @@
         self.directory = tempfile.mkdtemp()
         self.source_path = os.path.join(self.directory, '_test.py')
         self.pyc_path = self.source_path + 'c'
-        self.cache_path = imp.cache_from_source(self.source_path)
+        self.cache_path = importlib.util.cache_from_source(self.source_path)
         self.cwd_drive = os.path.splitdrive(os.getcwd())[0]
         # In these tests we compute relative paths.  When using Windows, the
         # current working directory path and the 'self.source_path' might be
@@ -35,6 +38,26 @@
         self.assertTrue(os.path.exists(self.pyc_path))
         self.assertFalse(os.path.exists(self.cache_path))
 
+    def test_do_not_overwrite_symlinks(self):
+        # In the face of a cfile argument being a symlink, bail out.
+        # Issue #17222
+        try:
+            os.symlink(self.pyc_path + '.actual', self.pyc_path)
+        except (NotImplementedError, OSError):
+            self.skipTest('need to be able to create a symlink for a file')
+        else:
+            assert os.path.islink(self.pyc_path)
+            with self.assertRaises(FileExistsError):
+                py_compile.compile(self.source_path, self.pyc_path)
+
+    @unittest.skipIf(not os.path.exists(os.devnull) or os.path.isfile(os.devnull),
+                     'requires os.devnull and for it to be a non-regular file')
+    def test_do_not_overwrite_nonregular_files(self):
+        # In the face of a cfile argument being a non-regular file, bail out.
+        # Issue #17222
+        with self.assertRaises(FileExistsError):
+            py_compile.compile(self.source_path, os.devnull)
+
     def test_cache_path(self):
         py_compile.compile(self.source_path)
         self.assertTrue(os.path.exists(self.cache_path))
@@ -54,8 +77,48 @@
         self.assertTrue(os.path.exists(self.pyc_path))
         self.assertFalse(os.path.exists(self.cache_path))
 
-def test_main():
-    support.run_unittest(PyCompileTests)
+    @unittest.skipIf(hasattr(os, 'geteuid') and os.geteuid() == 0,
+                     'non-root user required')
+    @unittest.skipIf(os.name == 'nt',
+                     'cannot control directory permissions on Windows')
+    def test_exceptions_propagate(self):
+        # Make sure that exceptions raised thanks to issues with writing
+        # bytecode.
+        # http://bugs.python.org/issue17244
+        mode = os.stat(self.directory)
+        os.chmod(self.directory, stat.S_IREAD)
+        try:
+            with self.assertRaises(IOError):
+                py_compile.compile(self.source_path, self.pyc_path)
+        finally:
+            os.chmod(self.directory, mode.st_mode)
+
+    def test_bad_coding(self):
+        bad_coding = os.path.join(os.path.dirname(__file__), 'bad_coding2.py')
+        with support.captured_stderr():
+            self.assertIsNone(py_compile.compile(bad_coding, doraise=False))
+        self.assertFalse(os.path.exists(
+            importlib.util.cache_from_source(bad_coding)))
+
+    def test_double_dot_no_clobber(self):
+        # http://bugs.python.org/issue22966
+        # py_compile foo.bar.py -> __pycache__/foo.cpython-34.pyc
+        weird_path = os.path.join(self.directory, 'foo.bar.py')
+        cache_path = importlib.util.cache_from_source(weird_path)
+        pyc_path = weird_path + 'c'
+        head, tail = os.path.split(cache_path)
+        penultimate_tail = os.path.basename(head)
+        self.assertEqual(
+            os.path.join(penultimate_tail, tail),
+            os.path.join(
+                '__pycache__',
+                'foo.bar.{}.pyc'.format(sys.implementation.cache_tag)))
+        with open(weird_path, 'w') as file:
+            file.write('x = 123\n')
+        py_compile.compile(weird_path)
+        self.assertTrue(os.path.exists(cache_path))
+        self.assertFalse(os.path.exists(pyc_path))
+
 
 if __name__ == "__main__":
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_pyclbr.py b/Lib/test/test_pyclbr.py
index e83989e..39eb65f 100644
--- a/Lib/test/test_pyclbr.py
+++ b/Lib/test/test_pyclbr.py
@@ -142,7 +142,7 @@
         self.checkModule('pyclbr')
         self.checkModule('ast')
         self.checkModule('doctest', ignore=("TestResults", "_SpoofOut",
-                                            "DocTestCase"))
+                                            "DocTestCase", '_DocTestSuite'))
         self.checkModule('difflib', ignore=("Match",))
 
     def test_decorators(self):
@@ -158,8 +158,8 @@
         cm('random', ignore=('Random',))  # from _random import Random as CoreGenerator
         cm('cgi', ignore=('log',))      # set with = in module
         cm('pickle')
-        cm('aifc', ignore=('openfp',))  # set with = in module
-        cm('sre_parse', ignore=('dump',)) # from sre_constants import *
+        cm('aifc', ignore=('openfp', '_aifc_params'))  # set with = in module
+        cm('sre_parse', ignore=('dump', 'groups')) # from sre_constants import *; property
         cm('pdb')
         cm('pydoc')
 
diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py
index ce46d60..8bf9b20 100644
--- a/Lib/test/test_pydoc.py
+++ b/Lib/test/test_pydoc.py
@@ -6,12 +6,15 @@
 import inspect
 import pydoc
 import keyword
+import _pickle
 import pkgutil
 import re
 import string
 import test.support
 import time
+import types
 import unittest
+import urllib.parse
 import xml.etree
 import textwrap
 from io import StringIO
@@ -20,7 +23,7 @@
 from test.support import (
     TESTFN, rmtree,
     reap_children, reap_threads, captured_output, captured_stdout,
-    captured_stderr, unlink
+    captured_stderr, unlink, requires_docstrings
 )
 from test import pydoc_mod
 
@@ -29,10 +32,6 @@
 except ImportError:
     threading = None
 
-# Just in case sys.modules["test"] has the optional attribute __loader__.
-if hasattr(pydoc_mod, "__loader__"):
-    del pydoc_mod.__loader__
-
 if test.support.HAVE_DOCSTRINGS:
     expected_data_docstrings = (
         'dictionary for instance variables (if defined)',
@@ -49,6 +48,7 @@
     builtins.object
         A
         B
+        C
 \x20\x20\x20\x20
     class A(builtins.object)
      |  Hello and goodbye
@@ -76,6 +76,26 @@
      |  Data and other attributes defined here:
      |\x20\x20
      |  NO_MEANING = 'eggs'
+\x20\x20\x20\x20
+    class C(builtins.object)
+     |  Methods defined here:
+     |\x20\x20
+     |  get_answer(self)
+     |      Return say_no()
+     |\x20\x20
+     |  is_it_true(self)
+     |      Return self.get_answer()
+     |\x20\x20
+     |  say_no(self)
+     |\x20\x20
+     |  ----------------------------------------------------------------------
+     |  Data descriptors defined here:
+     |\x20\x20
+     |  __dict__
+     |      dictionary for instance variables (if defined)
+     |\x20\x20
+     |  __weakref__
+     |      list of weak references to the object (if defined)
 
 FUNCTIONS
     doc_func()
@@ -126,6 +146,7 @@
 <dl>
 <dt><font face="helvetica, arial"><a href="test.pydoc_mod.html#A">A</a>
 </font></dt><dt><font face="helvetica, arial"><a href="test.pydoc_mod.html#B">B</a>
+</font></dt><dt><font face="helvetica, arial"><a href="test.pydoc_mod.html#C">C</a>
 </font></dt></dl>
 </dd>
 </dl>
@@ -167,6 +188,28 @@
 Data and other attributes defined here:<br>
 <dl><dt><strong>NO_MEANING</strong> = 'eggs'</dl>
 
+</td></tr></table> <p>
+<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="section">
+<tr bgcolor="#ffc8d8">
+<td colspan=3 valign=bottom>&nbsp;<br>
+<font color="#000000" face="helvetica, arial"><a name="C">class <strong>C</strong></a>(<a href="builtins.html#object">builtins.object</a>)</font></td></tr>
+\x20\x20\x20\x20
+<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
+<td width="100%%">Methods defined here:<br>
+<dl><dt><a name="C-get_answer"><strong>get_answer</strong></a>(self)</dt><dd><tt>Return&nbsp;<a href="#C-say_no">say_no</a>()</tt></dd></dl>
+
+<dl><dt><a name="C-is_it_true"><strong>is_it_true</strong></a>(self)</dt><dd><tt>Return&nbsp;self.<a href="#C-get_answer">get_answer</a>()</tt></dd></dl>
+
+<dl><dt><a name="C-say_no"><strong>say_no</strong></a>(self)</dt></dl>
+
+<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>
+</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>
+</dl>
 </td></tr></table></td></tr></table><p>
 <table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="section">
 <tr bgcolor="#eeaa77">
@@ -212,6 +255,75 @@
 # output pattern for module with bad imports
 badimport_pattern = "problem in %s - ImportError: No module named %r"
 
+expected_dynamicattribute_pattern = """
+Help on class DA in module %s:
+
+class DA(builtins.object)
+ |  Data descriptors defined here:
+ |\x20\x20
+ |  __dict__%s
+ |\x20\x20
+ |  __weakref__%s
+ |\x20\x20
+ |  ham
+ |\x20\x20
+ |  ----------------------------------------------------------------------
+ |  Data and other attributes inherited from Meta:
+ |\x20\x20
+ |  ham = 'spam'
+""".strip()
+
+expected_virtualattribute_pattern1 = """
+Help on class Class in module %s:
+
+class Class(builtins.object)
+ |  Data and other attributes inherited from Meta:
+ |\x20\x20
+ |  LIFE = 42
+""".strip()
+
+expected_virtualattribute_pattern2 = """
+Help on class Class1 in module %s:
+
+class Class1(builtins.object)
+ |  Data and other attributes inherited from Meta1:
+ |\x20\x20
+ |  one = 1
+""".strip()
+
+expected_virtualattribute_pattern3 = """
+Help on class Class2 in module %s:
+
+class Class2(Class1)
+ |  Method resolution order:
+ |      Class2
+ |      Class1
+ |      builtins.object
+ |\x20\x20
+ |  Data and other attributes inherited from Meta1:
+ |\x20\x20
+ |  one = 1
+ |\x20\x20
+ |  ----------------------------------------------------------------------
+ |  Data and other attributes inherited from Meta3:
+ |\x20\x20
+ |  three = 3
+ |\x20\x20
+ |  ----------------------------------------------------------------------
+ |  Data and other attributes inherited from Meta2:
+ |\x20\x20
+ |  two = 2
+""".strip()
+
+expected_missingattribute_pattern = """
+Help on class C in module %s:
+
+class C(builtins.object)
+ |  Data and other attributes defined here:
+ |\x20\x20
+ |  here = 'present!'
+""".strip()
+
 def run_pydoc(module_name, *args, **env):
     """
     Runs pydoc on the specified module. Returns the stripped
@@ -291,14 +403,11 @@
                      "Docstrings are omitted with -O2 and above")
     @unittest.skipIf(hasattr(sys, 'gettrace') and sys.gettrace(),
                      'trace function introduces __locals__ unexpectedly')
+    @requires_docstrings
     def test_html_doc(self):
         result, doc_loc = get_pydoc_html(pydoc_mod)
         mod_file = inspect.getabsfile(pydoc_mod)
-        if sys.platform == 'win32':
-            import nturl2path
-            mod_url = nturl2path.pathname2url(mod_file)
-        else:
-            mod_url = mod_file
+        mod_url = urllib.parse.quote(mod_file)
         expected_html = expected_html_pattern % (
                         (mod_url, mod_file, doc_loc) +
                         expected_html_data_docstrings)
@@ -310,6 +419,7 @@
                      "Docstrings are omitted with -O2 and above")
     @unittest.skipIf(hasattr(sys, 'gettrace') and sys.gettrace(),
                      'trace function introduces __locals__ unexpectedly')
+    @requires_docstrings
     def test_text_doc(self):
         result, doc_loc = get_pydoc_text(pydoc_mod)
         expected_text = expected_text_pattern % (
@@ -320,11 +430,29 @@
             print_diffs(expected_text, result)
             self.fail("outputs are not equal, see diff above")
 
+    def test_text_enum_member_with_value_zero(self):
+        # Test issue #20654 to ensure enum member with value 0 can be
+        # displayed. It used to throw KeyError: 'zero'.
+        import enum
+        class BinaryInteger(enum.IntEnum):
+            zero = 0
+            one = 1
+        doc = pydoc.render_doc(BinaryInteger)
+        self.assertIn('<BinaryInteger.zero: 0>', doc)
+
     def test_issue8225(self):
         # Test issue8225 to ensure no doc link appears for xml.etree
         result, doc_loc = get_pydoc_text(xml.etree)
         self.assertEqual(doc_loc, "", "MODULE DOCS incorrectly includes a link")
 
+    def test_getpager_with_stdin_none(self):
+        previous_stdin = sys.stdin
+        try:
+            sys.stdin = None
+            pydoc.getpager() # Shouldn't fail.
+        finally:
+            sys.stdin = previous_stdin
+
     def test_non_str_name(self):
         # issue14638
         # Treat illegal (non-str) name like no name
@@ -366,6 +494,7 @@
                      'Docstrings are omitted with -O2 and above')
     @unittest.skipIf(hasattr(sys, 'gettrace') and sys.gettrace(),
                      'trace function introduces __locals__ unexpectedly')
+    @requires_docstrings
     def test_help_output_redirect(self):
         # issue 940286, if output is set in Helper, then all output from
         # Helper.help should be redirected
@@ -421,6 +550,38 @@
             synopsis = pydoc.synopsis(TESTFN, {})
             self.assertEqual(synopsis, 'line 1: h\xe9')
 
+    def test_synopsis_sourceless(self):
+        expected = os.__doc__.splitlines()[0]
+        filename = os.__cached__
+        synopsis = pydoc.synopsis(filename)
+
+        self.assertEqual(synopsis, expected)
+
+    def test_splitdoc_with_description(self):
+        example_string = "I Am A Doc\n\n\nHere is my description"
+        self.assertEqual(pydoc.splitdoc(example_string),
+                         ('I Am A Doc', '\nHere is my description'))
+
+    def test_is_object_or_method(self):
+        doc = pydoc.Doc()
+        # Bound Method
+        self.assertTrue(pydoc._is_some_method(doc.fail))
+        # Method Descriptor
+        self.assertTrue(pydoc._is_some_method(int.__add__))
+        # String
+        self.assertFalse(pydoc._is_some_method("I am not a method"))
+
+    def test_is_package_when_not_package(self):
+        with test.support.temp_cwd() as test_dir:
+            self.assertFalse(pydoc.ispackage(test_dir))
+
+    def test_is_package_when_is_package(self):
+        with test.support.temp_cwd() as test_dir:
+            init_path = os.path.join(test_dir, '__init__.py')
+            open(init_path, 'w').close()
+            self.assertTrue(pydoc.ispackage(test_dir))
+            os.remove(init_path)
+
     def test_allmethods(self):
         # issue 17476: allmethods was no longer returning unbound methods.
         # This test is a bit fragile in the face of changes to object and type,
@@ -509,6 +670,55 @@
         self.assertEqual(out.getvalue(), '')
         self.assertEqual(err.getvalue(), '')
 
+    @unittest.skip('causes undesireable side-effects (#20128)')
+    def test_modules(self):
+        # See Helper.listmodules().
+        num_header_lines = 2
+        num_module_lines_min = 5  # Playing it safe.
+        num_footer_lines = 3
+        expected = num_header_lines + num_module_lines_min + num_footer_lines
+
+        output = StringIO()
+        helper = pydoc.Helper(output=output)
+        helper('modules')
+        result = output.getvalue().strip()
+        num_lines = len(result.splitlines())
+
+        self.assertGreaterEqual(num_lines, expected)
+
+    @unittest.skip('causes undesireable side-effects (#20128)')
+    def test_modules_search(self):
+        # See Helper.listmodules().
+        expected = 'pydoc - '
+
+        output = StringIO()
+        helper = pydoc.Helper(output=output)
+        with captured_stdout() as help_io:
+            helper('modules pydoc')
+        result = help_io.getvalue()
+
+        self.assertIn(expected, result)
+
+    @unittest.skip('some buildbots are not cooperating (#20128)')
+    def test_modules_search_builtin(self):
+        expected = 'gc - '
+
+        output = StringIO()
+        helper = pydoc.Helper(output=output)
+        with captured_stdout() as help_io:
+            helper('modules garbage')
+        result = help_io.getvalue()
+
+        self.assertTrue(result.startswith(expected))
+
+    def test_importfile(self):
+        loaded_pydoc = pydoc.importfile(pydoc.__file__)
+
+        self.assertIsNot(loaded_pydoc, pydoc)
+        self.assertEqual(loaded_pydoc.__name__, 'pydoc')
+        self.assertEqual(loaded_pydoc.__file__, pydoc.__file__)
+        self.assertEqual(loaded_pydoc.__spec__, pydoc.__spec__)
+
 
 class TestDescriptions(unittest.TestCase):
 
@@ -536,7 +746,7 @@
             try:
                 pydoc.render_doc(name)
             except ImportError:
-                self.fail('finding the doc of {!r} failed'.format(o))
+                self.fail('finding the doc of {!r} failed'.format(name))
 
         for name in ('notbuiltins', 'strrr', 'strr.translate',
                      'str.trrrranslate', 'builtins.strrr',
@@ -544,6 +754,42 @@
             self.assertIsNone(pydoc.locate(name))
             self.assertRaises(ImportError, pydoc.render_doc, name)
 
+    @staticmethod
+    def _get_summary_line(o):
+        text = pydoc.plain(pydoc.render_doc(o))
+        lines = text.split('\n')
+        assert len(lines) >= 2
+        return lines[2]
+
+    # these should include "self"
+    def test_unbound_python_method(self):
+        self.assertEqual(self._get_summary_line(textwrap.TextWrapper.wrap),
+            "wrap(self, text)")
+
+    @requires_docstrings
+    def test_unbound_builtin_method(self):
+        self.assertEqual(self._get_summary_line(_pickle.Pickler.dump),
+            "dump(self, obj, /)")
+
+    # these no longer include "self"
+    def test_bound_python_method(self):
+        t = textwrap.TextWrapper()
+        self.assertEqual(self._get_summary_line(t.wrap),
+            "wrap(text) method of textwrap.TextWrapper instance")
+
+    @requires_docstrings
+    def test_bound_builtin_method(self):
+        s = StringIO()
+        p = _pickle.Pickler(s)
+        self.assertEqual(self._get_summary_line(p.dump),
+            "dump(obj, /) method of _pickle.Pickler instance")
+
+    # this should *never* include self!
+    @requires_docstrings
+    def test_module_level_callable(self):
+        self.assertEqual(self._get_summary_line(os.stat),
+            "stat(path, *, dir_fd=None, follow_symlinks=True)")
+
 
 @unittest.skipUnless(threading, 'Threading required for this test.')
 class PydocServerTest(unittest.TestCase):
@@ -617,6 +863,128 @@
         self.assertEqual(sorted(pydoc.Helper.keywords),
                          sorted(keyword.kwlist))
 
+class PydocWithMetaClasses(unittest.TestCase):
+    @unittest.skipIf(sys.flags.optimize >= 2,
+                     "Docstrings are omitted with -O2 and above")
+    @unittest.skipIf(hasattr(sys, 'gettrace') and sys.gettrace(),
+                     'trace function introduces __locals__ unexpectedly')
+    def test_DynamicClassAttribute(self):
+        class Meta(type):
+            def __getattr__(self, name):
+                if name == 'ham':
+                    return 'spam'
+                return super().__getattr__(name)
+        class DA(metaclass=Meta):
+            @types.DynamicClassAttribute
+            def ham(self):
+                return 'eggs'
+        expected_text_data_docstrings = tuple('\n |      ' + s if s else ''
+                                      for s in expected_data_docstrings)
+        output = StringIO()
+        helper = pydoc.Helper(output=output)
+        helper(DA)
+        expected_text = expected_dynamicattribute_pattern % (
+                (__name__,) + expected_text_data_docstrings[:2])
+        result = output.getvalue().strip()
+        if result != expected_text:
+            print_diffs(expected_text, result)
+            self.fail("outputs are not equal, see diff above")
+
+    @unittest.skipIf(sys.flags.optimize >= 2,
+                     "Docstrings are omitted with -O2 and above")
+    @unittest.skipIf(hasattr(sys, 'gettrace') and sys.gettrace(),
+                     'trace function introduces __locals__ unexpectedly')
+    def test_virtualClassAttributeWithOneMeta(self):
+        class Meta(type):
+            def __dir__(cls):
+                return ['__class__', '__module__', '__name__', 'LIFE']
+            def __getattr__(self, name):
+                if name =='LIFE':
+                    return 42
+                return super().__getattr(name)
+        class Class(metaclass=Meta):
+            pass
+        output = StringIO()
+        helper = pydoc.Helper(output=output)
+        helper(Class)
+        expected_text = expected_virtualattribute_pattern1 % __name__
+        result = output.getvalue().strip()
+        if result != expected_text:
+            print_diffs(expected_text, result)
+            self.fail("outputs are not equal, see diff above")
+
+    @unittest.skipIf(sys.flags.optimize >= 2,
+                     "Docstrings are omitted with -O2 and above")
+    @unittest.skipIf(hasattr(sys, 'gettrace') and sys.gettrace(),
+                     'trace function introduces __locals__ unexpectedly')
+    def test_virtualClassAttributeWithTwoMeta(self):
+        class Meta1(type):
+            def __dir__(cls):
+                return ['__class__', '__module__', '__name__', 'one']
+            def __getattr__(self, name):
+                if name =='one':
+                    return 1
+                return super().__getattr__(name)
+        class Meta2(type):
+            def __dir__(cls):
+                return ['__class__', '__module__', '__name__', 'two']
+            def __getattr__(self, name):
+                if name =='two':
+                    return 2
+                return super().__getattr__(name)
+        class Meta3(Meta1, Meta2):
+            def __dir__(cls):
+                return list(sorted(set(
+                    ['__class__', '__module__', '__name__', 'three'] +
+                    Meta1.__dir__(cls) + Meta2.__dir__(cls))))
+            def __getattr__(self, name):
+                if name =='three':
+                    return 3
+                return super().__getattr__(name)
+        class Class1(metaclass=Meta1):
+            pass
+        class Class2(Class1, metaclass=Meta3):
+            pass
+        fail1 = fail2 = False
+        output = StringIO()
+        helper = pydoc.Helper(output=output)
+        helper(Class1)
+        expected_text1 = expected_virtualattribute_pattern2 % __name__
+        result1 = output.getvalue().strip()
+        if result1 != expected_text1:
+            print_diffs(expected_text1, result1)
+            fail1 = True
+        output = StringIO()
+        helper = pydoc.Helper(output=output)
+        helper(Class2)
+        expected_text2 = expected_virtualattribute_pattern3 % __name__
+        result2 = output.getvalue().strip()
+        if result2 != expected_text2:
+            print_diffs(expected_text2, result2)
+            fail2 = True
+        if fail1 or fail2:
+            self.fail("outputs are not equal, see diff above")
+
+    @unittest.skipIf(sys.flags.optimize >= 2,
+                     "Docstrings are omitted with -O2 and above")
+    @unittest.skipIf(hasattr(sys, 'gettrace') and sys.gettrace(),
+                     'trace function introduces __locals__ unexpectedly')
+    def test_buggy_dir(self):
+        class M(type):
+            def __dir__(cls):
+                return ['__class__', '__name__', 'missing', 'here']
+        class C(metaclass=M):
+            here = 'present!'
+        output = StringIO()
+        helper = pydoc.Helper(output=output)
+        helper(C)
+        expected_text = expected_missingattribute_pattern % __name__
+        result = output.getvalue().strip()
+        if result != expected_text:
+            print_diffs(expected_text, result)
+            self.fail("outputs are not equal, see diff above")
+
+
 @reap_threads
 def test_main():
     try:
@@ -626,6 +994,7 @@
                                   PydocServerTest,
                                   PydocUrlHandlerTest,
                                   TestHelper,
+                                  PydocWithMetaClasses,
                                   )
     finally:
         reap_children()
diff --git a/Lib/test/test_pyexpat.py b/Lib/test/test_pyexpat.py
index 8ef3917..c233bc1 100644
--- a/Lib/test/test_pyexpat.py
+++ b/Lib/test/test_pyexpat.py
@@ -2,7 +2,10 @@
 # handler, are obscure and unhelpful.
 
 from io import BytesIO
+import os
+import sysconfig
 import unittest
+import traceback
 
 from xml.parsers import expat
 from xml.parsers.expat import errors
@@ -236,6 +239,18 @@
         operations = out.out
         self._verify_parse_output(operations)
 
+    def test_parse_again(self):
+        parser = expat.ParserCreate()
+        file = BytesIO(data)
+        parser.ParseFile(file)
+        # Issue 6676: ensure a meaningful exception is raised when attempting
+        # to parse more than one XML document per xmlparser instance,
+        # a limitation of the Expat library.
+        with self.assertRaises(expat.error) as cm:
+            parser.ParseFile(file)
+        self.assertEqual(expat.ErrorString(cm.exception.code),
+                          expat.errors.XML_ERROR_FINISHED)
+
 class NamespaceSeparatorTest(unittest.TestCase):
     def test_legal(self):
         # Tests that make sure we get errors when the namespace_separator value
@@ -407,7 +422,11 @@
     def StartElementHandler(self, name, attrs):
         raise RuntimeError(name)
 
-    def test(self):
+    def check_traceback_entry(self, entry, filename, funcname):
+        self.assertEqual(os.path.basename(entry[0]), filename)
+        self.assertEqual(entry[2], funcname)
+
+    def test_exception(self):
         parser = expat.ParserCreate()
         parser.StartElementHandler = self.StartElementHandler
         try:
@@ -417,6 +436,17 @@
             self.assertEqual(e.args[0], 'a',
                              "Expected RuntimeError for element 'a', but" + \
                              " found %r" % e.args[0])
+            # Check that the traceback contains the relevant line in pyexpat.c
+            entries = traceback.extract_tb(e.__traceback__)
+            self.assertEqual(len(entries), 3)
+            self.check_traceback_entry(entries[0],
+                                       "test_pyexpat.py", "test_exception")
+            self.check_traceback_entry(entries[1],
+                                       "pyexpat.c", "StartElement")
+            self.check_traceback_entry(entries[2],
+                                       "test_pyexpat.py", "StartElementHandler")
+            if sysconfig.is_python_build():
+                self.assertIn('call_with_frame("StartElement"', entries[1][3])
 
 
 # Test Current* members:
diff --git a/Lib/test/test_random.py b/Lib/test/test_random.py
index a475207..e648045 100644
--- a/Lib/test/test_random.py
+++ b/Lib/test/test_random.py
@@ -1,8 +1,10 @@
 import unittest
+import unittest.mock
 import random
 import time
 import pickle
 import warnings
+from functools import partial
 from math import log, exp, pi, fsum, sin
 from test import support
 
@@ -44,6 +46,48 @@
         self.assertRaises(TypeError, self.gen.seed, 1, 2, 3, 4)
         self.assertRaises(TypeError, type(self.gen), [])
 
+    @unittest.mock.patch('random._urandom') # os.urandom
+    def test_seed_when_randomness_source_not_found(self, urandom_mock):
+        # Random.seed() uses time.time() when an operating system specific
+        # randomness source is not found. To test this on machines were it
+        # exists, run the above test, test_seedargs(), again after mocking
+        # os.urandom() so that it raises the exception expected when the
+        # randomness source is not available.
+        urandom_mock.side_effect = NotImplementedError
+        self.test_seedargs()
+
+    def test_shuffle(self):
+        shuffle = self.gen.shuffle
+        lst = []
+        shuffle(lst)
+        self.assertEqual(lst, [])
+        lst = [37]
+        shuffle(lst)
+        self.assertEqual(lst, [37])
+        seqs = [list(range(n)) for n in range(10)]
+        shuffled_seqs = [list(range(n)) for n in range(10)]
+        for shuffled_seq in shuffled_seqs:
+            shuffle(shuffled_seq)
+        for (seq, shuffled_seq) in zip(seqs, shuffled_seqs):
+            self.assertEqual(len(seq), len(shuffled_seq))
+            self.assertEqual(set(seq), set(shuffled_seq))
+        # The above tests all would pass if the shuffle was a
+        # no-op. The following non-deterministic test covers that.  It
+        # asserts that the shuffled sequence of 1000 distinct elements
+        # must be different from the original one. Although there is
+        # mathematically a non-zero probability that this could
+        # actually happen in a genuinely random shuffle, it is
+        # completely negligible, given that the number of possible
+        # permutations of 1000 objects is 1000! (factorial of 1000),
+        # which is considerably larger than the number of atoms in the
+        # universe...
+        lst = list(range(1000))
+        shuffled_lst = list(range(1000))
+        shuffle(shuffled_lst)
+        self.assertTrue(lst != shuffled_lst)
+        shuffle(lst)
+        self.assertTrue(lst != shuffled_lst)
+
     def test_choice(self):
         choice = self.gen.choice
         with self.assertRaises(IndexError):
@@ -63,6 +107,8 @@
             self.assertEqual(len(uniq), k)
             self.assertTrue(uniq <= set(population))
         self.assertEqual(self.gen.sample([], 0), [])  # test edge case N==k==0
+        # Exception raised if size of sample exceeds that of population
+        self.assertRaises(ValueError, self.gen.sample, population, N+1)
 
     def test_sample_distribution(self):
         # For the entire allowable range of 0 <= k <= N, validate that
@@ -113,11 +159,12 @@
             self.assertEqual(y1, y2)
 
     def test_pickling(self):
-        state = pickle.dumps(self.gen)
-        origseq = [self.gen.random() for i in range(10)]
-        newgen = pickle.loads(state)
-        restoredseq = [newgen.random() for i in range(10)]
-        self.assertEqual(origseq, restoredseq)
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            state = pickle.dumps(self.gen, proto)
+            origseq = [self.gen.random() for i in range(10)]
+            newgen = pickle.loads(state)
+            restoredseq = [newgen.random() for i in range(10)]
+            self.assertEqual(origseq, restoredseq)
 
     def test_bug_1727780(self):
         # verify that version-2-pickles can be loaded
@@ -169,7 +216,8 @@
         self.assertEqual(self.gen.gauss_next, None)
 
     def test_pickling(self):
-        self.assertRaises(NotImplementedError, pickle.dumps, self.gen)
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            self.assertRaises(NotImplementedError, pickle.dumps, self.gen, proto)
 
     def test_53_bits_per_float(self):
         # This should pass whenever a C double has 53 bit precision.
@@ -203,6 +251,25 @@
             self.assertEqual(set(range(start,stop)),
                 set([self.gen.randrange(start,stop) for i in range(100)]))
 
+    def test_randrange_nonunit_step(self):
+        rint = self.gen.randrange(0, 10, 2)
+        self.assertIn(rint, (0, 2, 4, 6, 8))
+        rint = self.gen.randrange(0, 2, 2)
+        self.assertEqual(rint, 0)
+
+    def test_randrange_errors(self):
+        raises = partial(self.assertRaises, ValueError, self.gen.randrange)
+        # Empty range
+        raises(3, 3)
+        raises(-721)
+        raises(0, 100, -12)
+        # Non-integer start/stop
+        raises(3.14159)
+        raises(0, 2.71828)
+        # Zero and non-integer step
+        raises(0, 42, 0)
+        raises(0, 42, 3.14159)
+
     def test_genrandbits(self):
         # Verify ranges
         for k in range(1, 1000):
@@ -272,6 +339,16 @@
         # Last element s/b an int also
         self.assertRaises(TypeError, self.gen.setstate, (2, (0,)*624+('a',), None))
 
+        # Little trick to make "tuple(x % (2**32) for x in internalstate)"
+        # raise ValueError. I cannot think of a simple way to achieve this, so
+        # I am opting for using a generator as the middle argument of setstate
+        # which attempts to cast a NaN to integer.
+        state_values = self.gen.getstate()[1]
+        state_values = list(state_values)
+        state_values[-1] = float('nan')
+        state = (int(x) for x in state_values)
+        self.assertRaises(TypeError, self.gen.setstate, (2, state, None))
+
     def test_referenceImplementation(self):
         # Compare the python implementation with results from the original
         # code.  Create 2000 53-bit precision random floats.  Compare only
@@ -411,6 +488,38 @@
             self.assertEqual(k, numbits)        # note the stronger assertion
             self.assertTrue(2**k > n > 2**(k-1))   # note the stronger assertion
 
+    @unittest.mock.patch('random.Random.random')
+    def test_randbelow_overriden_random(self, random_mock):
+        # Random._randbelow() can only use random() when the built-in one
+        # has been overridden but no new getrandbits() method was supplied.
+        random_mock.side_effect = random.SystemRandom().random
+        maxsize = 1<<random.BPF
+        with warnings.catch_warnings():
+            warnings.simplefilter("ignore", UserWarning)
+            # Population range too large (n >= maxsize)
+            self.gen._randbelow(maxsize+1, maxsize = maxsize)
+        self.gen._randbelow(5640, maxsize = maxsize)
+
+        # This might be going too far to test a single line, but because of our
+        # noble aim of achieving 100% test coverage we need to write a case in
+        # which the following line in Random._randbelow() gets executed:
+        #
+        # rem = maxsize % n
+        # limit = (maxsize - rem) / maxsize
+        # r = random()
+        # while r >= limit:
+        #     r = random() # <== *This line* <==<
+        #
+        # Therefore, to guarantee that the while loop is executed at least
+        # once, we need to mock random() so that it returns a number greater
+        # than 'limit' the first time it gets called.
+
+        n = 42
+        epsilon = 0.01
+        limit = (maxsize - (maxsize % n)) / maxsize
+        random_mock.side_effect = [limit + epsilon, limit - epsilon]
+        self.gen._randbelow(n, maxsize = maxsize)
+
     def test_randrange_bug_1590891(self):
         start = 1000000000000
         stop = -100000000000000000000
@@ -495,7 +604,7 @@
         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.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),
@@ -528,6 +637,106 @@
         random.vonmisesvariate(0, 1e15)
         random.vonmisesvariate(0, 1e100)
 
+    def test_gammavariate_errors(self):
+        # Both alpha and beta must be > 0.0
+        self.assertRaises(ValueError, random.gammavariate, -1, 3)
+        self.assertRaises(ValueError, random.gammavariate, 0, 2)
+        self.assertRaises(ValueError, random.gammavariate, 2, 0)
+        self.assertRaises(ValueError, random.gammavariate, 1, -3)
+
+    @unittest.mock.patch('random.Random.random')
+    def test_gammavariate_full_code_coverage(self, random_mock):
+        # There are three different possibilities in the current implementation
+        # of random.gammavariate(), depending on the value of 'alpha'. What we
+        # are going to do here is to fix the values returned by random() to
+        # generate test cases that provide 100% line coverage of the method.
+
+        # #1: alpha > 1.0: we want the first random number to be outside the
+        # [1e-7, .9999999] range, so that the continue statement executes
+        # once. The values of u1 and u2 will be 0.5 and 0.3, respectively.
+        random_mock.side_effect = [1e-8, 0.5, 0.3]
+        returned_value = random.gammavariate(1.1, 2.3)
+        self.assertAlmostEqual(returned_value, 2.53)
+
+        # #2: alpha == 1: first random number less than 1e-7 to that the body
+        # of the while loop executes once. Then random.random() returns 0.45,
+        # which causes while to stop looping and the algorithm to terminate.
+        random_mock.side_effect = [1e-8, 0.45]
+        returned_value = random.gammavariate(1.0, 3.14)
+        self.assertAlmostEqual(returned_value, 2.507314166123803)
+
+        # #3: 0 < alpha < 1. This is the most complex region of code to cover,
+        # as there are multiple if-else statements. Let's take a look at the
+        # source code, and determine the values that we need accordingly:
+        #
+        # while 1:
+        #     u = random()
+        #     b = (_e + alpha)/_e
+        #     p = b*u
+        #     if p <= 1.0: # <=== (A)
+        #         x = p ** (1.0/alpha)
+        #     else: # <=== (B)
+        #         x = -_log((b-p)/alpha)
+        #     u1 = random()
+        #     if p > 1.0: # <=== (C)
+        #         if u1 <= x ** (alpha - 1.0): # <=== (D)
+        #             break
+        #     elif u1 <= _exp(-x): # <=== (E)
+        #         break
+        # return x * beta
+        #
+        # First, we want (A) to be True. For that we need that:
+        # b*random() <= 1.0
+        # r1 = random() <= 1.0 / b
+        #
+        # We now get to the second if-else branch, and here, since p <= 1.0,
+        # (C) is False and we take the elif branch, (E). For it to be True,
+        # so that the break is executed, we need that:
+        # r2 = random() <= _exp(-x)
+        # r2 <= _exp(-(p ** (1.0/alpha)))
+        # r2 <= _exp(-((b*r1) ** (1.0/alpha)))
+
+        _e = random._e
+        _exp = random._exp
+        _log = random._log
+        alpha = 0.35
+        beta = 1.45
+        b = (_e + alpha)/_e
+        epsilon = 0.01
+
+        r1 = 0.8859296441566 # 1.0 / b
+        r2 = 0.3678794411714 # _exp(-((b*r1) ** (1.0/alpha)))
+
+        # These four "random" values result in the following trace:
+        # (A) True, (E) False --> [next iteration of while]
+        # (A) True, (E) True --> [while loop breaks]
+        random_mock.side_effect = [r1, r2 + epsilon, r1, r2]
+        returned_value = random.gammavariate(alpha, beta)
+        self.assertAlmostEqual(returned_value, 1.4499999999997544)
+
+        # Let's now make (A) be False. If this is the case, when we get to the
+        # second if-else 'p' is greater than 1, so (C) evaluates to True. We
+        # now encounter a second if statement, (D), which in order to execute
+        # must satisfy the following condition:
+        # r2 <= x ** (alpha - 1.0)
+        # r2 <= (-_log((b-p)/alpha)) ** (alpha - 1.0)
+        # r2 <= (-_log((b-(b*r1))/alpha)) ** (alpha - 1.0)
+        r1 = 0.8959296441566 # (1.0 / b) + epsilon -- so that (A) is False
+        r2 = 0.9445400408898141
+
+        # And these four values result in the following trace:
+        # (B) and (C) True, (D) False --> [next iteration of while]
+        # (B) and (C) True, (D) True [while loop breaks]
+        random_mock.side_effect = [r1, r2 + epsilon, r1, r2]
+        returned_value = random.gammavariate(alpha, beta)
+        self.assertAlmostEqual(returned_value, 1.5830349561760781)
+
+    @unittest.mock.patch('random.Random.gammavariate')
+    def test_betavariate_return_zero(self, gammavariate_mock):
+        # betavariate() returns zero when the Gamma distribution
+        # that it uses internally returns this same value.
+        gammavariate_mock.return_value = 0.0
+        self.assertEqual(0.0, random.betavariate(2.71828, 3.14159))
 
 class TestModule(unittest.TestCase):
     def testMagicConstants(self):
diff --git a/Lib/test/test_range.py b/Lib/test/test_range.py
index aab98ab..2dbcebc 100644
--- a/Lib/test/test_range.py
+++ b/Lib/test/test_range.py
@@ -313,7 +313,7 @@
         self.assertRaises(TypeError, range, IN())
 
         # Test use of user-defined classes in slice indices.
-        self.assertEqual(list(range(10)[:I(5)]), list(range(5)))
+        self.assertEqual(range(10)[:I(5)], range(5))
 
         with self.assertRaises(RuntimeError):
             range(0, 10)[:IX()]
@@ -353,9 +353,10 @@
                      (13, 21, 3), (-2, 2, 2), (2**65, 2**65+2)]
         for proto in range(pickle.HIGHEST_PROTOCOL + 1):
             for t in testcases:
-                r = range(*t)
-                self.assertEqual(list(pickle.loads(pickle.dumps(r, proto))),
-                                 list(r))
+                with self.subTest(proto=proto, test=t):
+                    r = range(*t)
+                    self.assertEqual(list(pickle.loads(pickle.dumps(r, proto))),
+                                     list(r))
 
     def test_iterator_pickling(self):
         testcases = [(13,), (0, 11), (-22, 10), (20, 3, -1),
@@ -365,7 +366,7 @@
                 it = itorg = iter(range(*t))
                 data = list(range(*t))
 
-                d = pickle.dumps(it)
+                d = pickle.dumps(it, proto)
                 it = pickle.loads(d)
                 self.assertEqual(type(itorg), type(it))
                 self.assertEqual(list(it), data)
@@ -375,33 +376,35 @@
                     next(it)
                 except StopIteration:
                     continue
-                d = pickle.dumps(it)
+                d = pickle.dumps(it, proto)
                 it = pickle.loads(d)
                 self.assertEqual(list(it), data[1:])
 
     def test_exhausted_iterator_pickling(self):
-        r = range(2**65, 2**65+2)
-        i = iter(r)
-        while True:
-            r = next(i)
-            if r == 2**65+1:
-                break
-        d = pickle.dumps(i)
-        i2 = pickle.loads(d)
-        self.assertEqual(list(i), [])
-        self.assertEqual(list(i2), [])
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            r = range(2**65, 2**65+2)
+            i = iter(r)
+            while True:
+                r = next(i)
+                if r == 2**65+1:
+                    break
+            d = pickle.dumps(i, proto)
+            i2 = pickle.loads(d)
+            self.assertEqual(list(i), [])
+            self.assertEqual(list(i2), [])
 
     def test_large_exhausted_iterator_pickling(self):
-        r = range(20)
-        i = iter(r)
-        while True:
-            r = next(i)
-            if r == 19:
-                break
-        d = pickle.dumps(i)
-        i2 = pickle.loads(d)
-        self.assertEqual(list(i), [])
-        self.assertEqual(list(i2), [])
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            r = range(20)
+            i = iter(r)
+            while True:
+                r = next(i)
+                if r == 19:
+                    break
+            d = pickle.dumps(i, proto)
+            i2 = pickle.loads(d)
+            self.assertEqual(list(i), [])
+            self.assertEqual(list(i2), [])
 
     def test_odd_bug(self):
         # This used to raise a "SystemError: NULL result without error"
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py
index 5466b20..d2547d4 100644
--- a/Lib/test/test_re.py
+++ b/Lib/test/test_re.py
@@ -1,12 +1,15 @@
 from test.support import verbose, run_unittest, gc_collect, bigmemtest, _2G, \
         cpython_only, captured_stdout
 import io
+import locale
 import re
 from re import Scanner
+import sre_compile
 import sre_constants
 import sys
 import string
 import traceback
+import unittest
 from weakref import proxy
 
 # Misc tests from Tim Peters' re.doc
@@ -15,10 +18,26 @@
 # what you're doing. Some of these tests were carefully modeled to
 # cover most of the code.
 
-import unittest
+class S(str):
+    def __getitem__(self, index):
+        return S(super().__getitem__(index))
+
+class B(bytes):
+    def __getitem__(self, index):
+        return B(super().__getitem__(index))
 
 class ReTests(unittest.TestCase):
 
+    def assertTypedEqual(self, actual, expect, msg=None):
+        self.assertEqual(actual, expect, msg)
+        def recurse(actual, expect):
+            if isinstance(expect, (tuple, list)):
+                for x, y in zip(actual, expect):
+                    recurse(x, y)
+            else:
+                self.assertIs(type(actual), type(expect), msg)
+        recurse(actual, expect)
+
     def test_keep_buffer(self):
         # See bug 14212
         b = bytearray(b'x')
@@ -41,18 +60,27 @@
         self.assertEqual(re.search('x*', 'axx').span(), (0, 0))
         self.assertEqual(re.search('x+', 'axx').span(0), (1, 3))
         self.assertEqual(re.search('x+', 'axx').span(), (1, 3))
-        self.assertEqual(re.search('x', 'aaa'), None)
+        self.assertIsNone(re.search('x', 'aaa'))
         self.assertEqual(re.match('a*', 'xxx').span(0), (0, 0))
         self.assertEqual(re.match('a*', 'xxx').span(), (0, 0))
         self.assertEqual(re.match('x*', 'xxxa').span(0), (0, 3))
         self.assertEqual(re.match('x*', 'xxxa').span(), (0, 3))
-        self.assertEqual(re.match('a+', 'xxx'), None)
+        self.assertIsNone(re.match('a+', 'xxx'))
 
     def bump_num(self, matchobj):
         int_value = int(matchobj.group(0))
         return str(int_value + 1)
 
     def test_basic_re_sub(self):
+        self.assertTypedEqual(re.sub('y', 'a', 'xyz'), 'xaz')
+        self.assertTypedEqual(re.sub('y', S('a'), S('xyz')), 'xaz')
+        self.assertTypedEqual(re.sub(b'y', b'a', b'xyz'), b'xaz')
+        self.assertTypedEqual(re.sub(b'y', B(b'a'), B(b'xyz')), b'xaz')
+        self.assertTypedEqual(re.sub(b'y', bytearray(b'a'), bytearray(b'xyz')), b'xaz')
+        self.assertTypedEqual(re.sub(b'y', memoryview(b'a'), memoryview(b'xyz')), b'xaz')
+        for y in ("\xe0", "\u0430", "\U0001d49c"):
+            self.assertEqual(re.sub(y, 'a', 'x%sz' % y), 'xaz')
+
         self.assertEqual(re.sub("(?i)b+", "x", "bbbb BBBB"), 'x x')
         self.assertEqual(re.sub(r'\d+', self.bump_num, '08.2 -2 23x99y'),
                          '9.3 -3 24x100y')
@@ -210,10 +238,29 @@
         self.assertEqual(re.subn("b*", "x", "xyz", 2), ('xxxyz', 2))
 
     def test_re_split(self):
-        self.assertEqual(re.split(":", ":a:b::c"), ['', 'a', 'b', '', 'c'])
-        self.assertEqual(re.split(":*", ":a:b::c"), ['', 'a', 'b', 'c'])
-        self.assertEqual(re.split("(:*)", ":a:b::c"),
-                         ['', ':', 'a', ':', 'b', '::', 'c'])
+        for string in ":a:b::c", S(":a:b::c"):
+            self.assertTypedEqual(re.split(":", string),
+                                  ['', 'a', 'b', '', 'c'])
+            self.assertTypedEqual(re.split(":*", string),
+                                  ['', 'a', 'b', 'c'])
+            self.assertTypedEqual(re.split("(:*)", string),
+                                  ['', ':', 'a', ':', 'b', '::', 'c'])
+        for string in (b":a:b::c", B(b":a:b::c"), bytearray(b":a:b::c"),
+                       memoryview(b":a:b::c")):
+            self.assertTypedEqual(re.split(b":", string),
+                                  [b'', b'a', b'b', b'', b'c'])
+            self.assertTypedEqual(re.split(b":*", string),
+                                  [b'', b'a', b'b', b'c'])
+            self.assertTypedEqual(re.split(b"(:*)", string),
+                                  [b'', b':', b'a', b':', b'b', b'::', b'c'])
+        for a, b, c in ("\xe0\xdf\xe7", "\u0430\u0431\u0432",
+                        "\U0001d49c\U0001d49e\U0001d4b5"):
+            string = ":%s:%s::%s" % (a, b, c)
+            self.assertEqual(re.split(":", string), ['', a, b, '', c])
+            self.assertEqual(re.split(":*", string), ['', a, b, c])
+            self.assertEqual(re.split("(:*)", string),
+                             ['', ':', a, ':', b, '::', c])
+
         self.assertEqual(re.split("(?::*)", ":a:b::c"), ['', 'a', 'b', 'c'])
         self.assertEqual(re.split("(:)*", ":a:b::c"),
                          ['', ':', 'a', ':', 'b', ':', 'c'])
@@ -235,22 +282,53 @@
 
     def test_re_findall(self):
         self.assertEqual(re.findall(":+", "abc"), [])
-        self.assertEqual(re.findall(":+", "a:b::c:::d"), [":", "::", ":::"])
-        self.assertEqual(re.findall("(:+)", "a:b::c:::d"), [":", "::", ":::"])
-        self.assertEqual(re.findall("(:)(:*)", "a:b::c:::d"), [(":", ""),
-                                                               (":", ":"),
-                                                               (":", "::")])
+        for string in "a:b::c:::d", S("a:b::c:::d"):
+            self.assertTypedEqual(re.findall(":+", string),
+                                  [":", "::", ":::"])
+            self.assertTypedEqual(re.findall("(:+)", string),
+                                  [":", "::", ":::"])
+            self.assertTypedEqual(re.findall("(:)(:*)", string),
+                                  [(":", ""), (":", ":"), (":", "::")])
+        for string in (b"a:b::c:::d", B(b"a:b::c:::d"), bytearray(b"a:b::c:::d"),
+                       memoryview(b"a:b::c:::d")):
+            self.assertTypedEqual(re.findall(b":+", string),
+                                  [b":", b"::", b":::"])
+            self.assertTypedEqual(re.findall(b"(:+)", string),
+                                  [b":", b"::", b":::"])
+            self.assertTypedEqual(re.findall(b"(:)(:*)", string),
+                                  [(b":", b""), (b":", b":"), (b":", b"::")])
+        for x in ("\xe0", "\u0430", "\U0001d49c"):
+            xx = x * 2
+            xxx = x * 3
+            string = "a%sb%sc%sd" % (x, xx, xxx)
+            self.assertEqual(re.findall("%s+" % x, string), [x, xx, xxx])
+            self.assertEqual(re.findall("(%s+)" % x, string), [x, xx, xxx])
+            self.assertEqual(re.findall("(%s)(%s*)" % (x, x), string),
+                             [(x, ""), (x, x), (x, xx)])
 
     def test_bug_117612(self):
         self.assertEqual(re.findall(r"(a|(b))", "aba"),
                          [("a", ""),("b", "b"),("a", "")])
 
     def test_re_match(self):
-        self.assertEqual(re.match('a', 'a').groups(), ())
-        self.assertEqual(re.match('(a)', 'a').groups(), ('a',))
-        self.assertEqual(re.match(r'(a)', 'a').group(0), 'a')
-        self.assertEqual(re.match(r'(a)', 'a').group(1), 'a')
-        self.assertEqual(re.match(r'(a)', 'a').group(1, 1), ('a', 'a'))
+        for string in 'a', S('a'):
+            self.assertEqual(re.match('a', string).groups(), ())
+            self.assertEqual(re.match('(a)', string).groups(), ('a',))
+            self.assertEqual(re.match('(a)', string).group(0), 'a')
+            self.assertEqual(re.match('(a)', string).group(1), 'a')
+            self.assertEqual(re.match('(a)', string).group(1, 1), ('a', 'a'))
+        for string in b'a', B(b'a'), bytearray(b'a'), memoryview(b'a'):
+            self.assertEqual(re.match(b'a', string).groups(), ())
+            self.assertEqual(re.match(b'(a)', string).groups(), (b'a',))
+            self.assertEqual(re.match(b'(a)', string).group(0), b'a')
+            self.assertEqual(re.match(b'(a)', string).group(1), b'a')
+            self.assertEqual(re.match(b'(a)', string).group(1, 1), (b'a', b'a'))
+        for a in ("\xe0", "\u0430", "\U0001d49c"):
+            self.assertEqual(re.match(a, a).groups(), ())
+            self.assertEqual(re.match('(%s)' % a, a).groups(), (a,))
+            self.assertEqual(re.match('(%s)' % a, a).group(0), a)
+            self.assertEqual(re.match('(%s)' % a, a).group(1), a)
+            self.assertEqual(re.match('(%s)' % a, a).group(1, 1), (a, a))
 
         pat = re.compile('((a)|(b))(c)?')
         self.assertEqual(pat.match('a').groups(), ('a', 'a', None, None))
@@ -272,13 +350,43 @@
                          (None, 'b', None))
         self.assertEqual(pat.match('ac').group(1, 'b2', 3), ('a', None, 'c'))
 
+    def test_re_fullmatch(self):
+        # Issue 16203: Proposal: add re.fullmatch() method.
+        self.assertEqual(re.fullmatch(r"a", "a").span(), (0, 1))
+        for string in "ab", S("ab"):
+            self.assertEqual(re.fullmatch(r"a|ab", string).span(), (0, 2))
+        for string in b"ab", B(b"ab"), bytearray(b"ab"), memoryview(b"ab"):
+            self.assertEqual(re.fullmatch(br"a|ab", string).span(), (0, 2))
+        for a, b in "\xe0\xdf", "\u0430\u0431", "\U0001d49c\U0001d49e":
+            r = r"%s|%s" % (a, a + b)
+            self.assertEqual(re.fullmatch(r, a + b).span(), (0, 2))
+        self.assertEqual(re.fullmatch(r".*?$", "abc").span(), (0, 3))
+        self.assertEqual(re.fullmatch(r".*?", "abc").span(), (0, 3))
+        self.assertEqual(re.fullmatch(r"a.*?b", "ab").span(), (0, 2))
+        self.assertEqual(re.fullmatch(r"a.*?b", "abb").span(), (0, 3))
+        self.assertEqual(re.fullmatch(r"a.*?b", "axxb").span(), (0, 4))
+        self.assertIsNone(re.fullmatch(r"a+", "ab"))
+        self.assertIsNone(re.fullmatch(r"abc$", "abc\n"))
+        self.assertIsNone(re.fullmatch(r"abc\Z", "abc\n"))
+        self.assertIsNone(re.fullmatch(r"(?m)abc$", "abc\n"))
+        self.assertEqual(re.fullmatch(r"ab(?=c)cd", "abcd").span(), (0, 4))
+        self.assertEqual(re.fullmatch(r"ab(?<=b)cd", "abcd").span(), (0, 4))
+        self.assertEqual(re.fullmatch(r"(?=a|ab)ab", "ab").span(), (0, 2))
+
+        self.assertEqual(
+            re.compile(r"bc").fullmatch("abcd", pos=1, endpos=3).span(), (1, 3))
+        self.assertEqual(
+            re.compile(r".*?$").fullmatch("abcd", pos=1, endpos=3).span(), (1, 3))
+        self.assertEqual(
+            re.compile(r".*?").fullmatch("abcd", pos=1, endpos=3).span(), (1, 3))
+
     def test_re_groupref_exists(self):
         self.assertEqual(re.match('^(\()?([^()]+)(?(1)\))$', '(a)').groups(),
                          ('(', 'a'))
         self.assertEqual(re.match('^(\()?([^()]+)(?(1)\))$', 'a').groups(),
                          (None, 'a'))
-        self.assertEqual(re.match('^(\()?([^()]+)(?(1)\))$', 'a)'), None)
-        self.assertEqual(re.match('^(\()?([^()]+)(?(1)\))$', '(a'), None)
+        self.assertIsNone(re.match('^(\()?([^()]+)(?(1)\))$', 'a)'))
+        self.assertIsNone(re.match('^(\()?([^()]+)(?(1)\))$', '(a'))
         self.assertEqual(re.match('^(?:(a)|c)((?(1)b|d))$', 'ab').groups(),
                          ('a', 'b'))
         self.assertEqual(re.match('^(?:(a)|c)((?(1)b|d))$', 'cd').groups(),
@@ -294,8 +402,8 @@
                          ('a', 'b', 'c'))
         self.assertEqual(p.match('ad').groups(),
                          ('a', None, 'd'))
-        self.assertEqual(p.match('abd'), None)
-        self.assertEqual(p.match('ac'), None)
+        self.assertIsNone(p.match('abd'))
+        self.assertIsNone(p.match('ac'))
 
 
     def test_re_groupref(self):
@@ -303,8 +411,8 @@
                          ('|', 'a'))
         self.assertEqual(re.match(r'^(\|)?([^()]+)\1?$', 'a').groups(),
                          (None, 'a'))
-        self.assertEqual(re.match(r'^(\|)?([^()]+)\1$', 'a|'), None)
-        self.assertEqual(re.match(r'^(\|)?([^()]+)\1$', '|a'), None)
+        self.assertIsNone(re.match(r'^(\|)?([^()]+)\1$', 'a|'))
+        self.assertIsNone(re.match(r'^(\|)?([^()]+)\1$', '|a'))
         self.assertEqual(re.match(r'^(?:(a)|c)(\1)$', 'aa').groups(),
                          ('a', 'a'))
         self.assertEqual(re.match(r'^(?:(a)|c)(\1)?$', 'c').groups(),
@@ -322,10 +430,10 @@
                          "second first second first")
 
     def test_repeat_minmax(self):
-        self.assertEqual(re.match("^(\w){1}$", "abc"), None)
-        self.assertEqual(re.match("^(\w){1}?$", "abc"), None)
-        self.assertEqual(re.match("^(\w){1,2}$", "abc"), None)
-        self.assertEqual(re.match("^(\w){1,2}?$", "abc"), None)
+        self.assertIsNone(re.match("^(\w){1}$", "abc"))
+        self.assertIsNone(re.match("^(\w){1}?$", "abc"))
+        self.assertIsNone(re.match("^(\w){1,2}$", "abc"))
+        self.assertIsNone(re.match("^(\w){1,2}?$", "abc"))
 
         self.assertEqual(re.match("^(\w){3}$", "abc").group(1), "c")
         self.assertEqual(re.match("^(\w){1,3}$", "abc").group(1), "c")
@@ -336,22 +444,22 @@
         self.assertEqual(re.match("^(\w){1,4}?$", "abc").group(1), "c")
         self.assertEqual(re.match("^(\w){3,4}?$", "abc").group(1), "c")
 
-        self.assertEqual(re.match("^x{1}$", "xxx"), None)
-        self.assertEqual(re.match("^x{1}?$", "xxx"), None)
-        self.assertEqual(re.match("^x{1,2}$", "xxx"), None)
-        self.assertEqual(re.match("^x{1,2}?$", "xxx"), None)
+        self.assertIsNone(re.match("^x{1}$", "xxx"))
+        self.assertIsNone(re.match("^x{1}?$", "xxx"))
+        self.assertIsNone(re.match("^x{1,2}$", "xxx"))
+        self.assertIsNone(re.match("^x{1,2}?$", "xxx"))
 
-        self.assertNotEqual(re.match("^x{3}$", "xxx"), None)
-        self.assertNotEqual(re.match("^x{1,3}$", "xxx"), None)
-        self.assertNotEqual(re.match("^x{1,4}$", "xxx"), None)
-        self.assertNotEqual(re.match("^x{3,4}?$", "xxx"), None)
-        self.assertNotEqual(re.match("^x{3}?$", "xxx"), None)
-        self.assertNotEqual(re.match("^x{1,3}?$", "xxx"), None)
-        self.assertNotEqual(re.match("^x{1,4}?$", "xxx"), None)
-        self.assertNotEqual(re.match("^x{3,4}?$", "xxx"), None)
+        self.assertTrue(re.match("^x{3}$", "xxx"))
+        self.assertTrue(re.match("^x{1,3}$", "xxx"))
+        self.assertTrue(re.match("^x{1,4}$", "xxx"))
+        self.assertTrue(re.match("^x{3,4}?$", "xxx"))
+        self.assertTrue(re.match("^x{3}?$", "xxx"))
+        self.assertTrue(re.match("^x{1,3}?$", "xxx"))
+        self.assertTrue(re.match("^x{1,4}?$", "xxx"))
+        self.assertTrue(re.match("^x{3,4}?$", "xxx"))
 
-        self.assertEqual(re.match("^x{}$", "xxx"), None)
-        self.assertNotEqual(re.match("^x{}$", "x{}"), None)
+        self.assertIsNone(re.match("^x{}$", "xxx"))
+        self.assertTrue(re.match("^x{}$", "x{}"))
 
     def test_getattr(self):
         self.assertEqual(re.compile("(?i)(a)(b)").pattern, "(?i)(a)(b)")
@@ -365,7 +473,7 @@
         self.assertEqual(re.match("(a)", "a").endpos, 1)
         self.assertEqual(re.match("(a)", "a").string, "a")
         self.assertEqual(re.match("(a)", "a").regs, ((0, 1), (0, 1)))
-        self.assertNotEqual(re.match("(a)", "a").re, None)
+        self.assertTrue(re.match("(a)", "a").re)
 
     def test_special_escapes(self):
         self.assertEqual(re.search(r"\b(b.)\b",
@@ -373,29 +481,37 @@
         self.assertEqual(re.search(r"\B(b.)\B",
                                    "abc bcd bc abxd").group(1), "bx")
         self.assertEqual(re.search(r"\b(b.)\b",
+                                   "abcd abc bcd bx", re.ASCII).group(1), "bx")
+        self.assertEqual(re.search(r"\B(b.)\B",
+                                   "abc bcd bc abxd", re.ASCII).group(1), "bx")
+        self.assertEqual(re.search(r"\b(b.)\b",
                                    "abcd abc bcd bx", re.LOCALE).group(1), "bx")
         self.assertEqual(re.search(r"\B(b.)\B",
                                    "abc bcd bc abxd", re.LOCALE).group(1), "bx")
-        self.assertEqual(re.search(r"\b(b.)\b",
-                                   "abcd abc bcd bx", re.UNICODE).group(1), "bx")
-        self.assertEqual(re.search(r"\B(b.)\B",
-                                   "abc bcd bc abxd", re.UNICODE).group(1), "bx")
         self.assertEqual(re.search(r"^abc$", "\nabc\n", re.M).group(0), "abc")
         self.assertEqual(re.search(r"^\Aabc\Z$", "abc", re.M).group(0), "abc")
-        self.assertEqual(re.search(r"^\Aabc\Z$", "\nabc\n", re.M), None)
-        self.assertEqual(re.search(r"\b(b.)\b",
-                                   "abcd abc bcd bx").group(1), "bx")
-        self.assertEqual(re.search(r"\B(b.)\B",
-                                   "abc bcd bc abxd").group(1), "bx")
-        self.assertEqual(re.search(r"^abc$", "\nabc\n", re.M).group(0), "abc")
-        self.assertEqual(re.search(r"^\Aabc\Z$", "abc", re.M).group(0), "abc")
-        self.assertEqual(re.search(r"^\Aabc\Z$", "\nabc\n", re.M), None)
+        self.assertIsNone(re.search(r"^\Aabc\Z$", "\nabc\n", re.M))
+        self.assertEqual(re.search(br"\b(b.)\b",
+                                   b"abcd abc bcd bx").group(1), b"bx")
+        self.assertEqual(re.search(br"\B(b.)\B",
+                                   b"abc bcd bc abxd").group(1), b"bx")
+        self.assertEqual(re.search(br"\b(b.)\b",
+                                   b"abcd abc bcd bx", re.LOCALE).group(1), b"bx")
+        self.assertEqual(re.search(br"\B(b.)\B",
+                                   b"abc bcd bc abxd", re.LOCALE).group(1), b"bx")
+        self.assertEqual(re.search(br"^abc$", b"\nabc\n", re.M).group(0), b"abc")
+        self.assertEqual(re.search(br"^\Aabc\Z$", b"abc", re.M).group(0), b"abc")
+        self.assertIsNone(re.search(br"^\Aabc\Z$", b"\nabc\n", re.M))
         self.assertEqual(re.search(r"\d\D\w\W\s\S",
                                    "1aa! a").group(0), "1aa! a")
+        self.assertEqual(re.search(br"\d\D\w\W\s\S",
+                                   b"1aa! a").group(0), b"1aa! a")
+        self.assertEqual(re.search(r"\d\D\w\W\s\S",
+                                   "1aa! a", re.ASCII).group(0), "1aa! a")
         self.assertEqual(re.search(r"\d\D\w\W\s\S",
                                    "1aa! a", re.LOCALE).group(0), "1aa! a")
-        self.assertEqual(re.search(r"\d\D\w\W\s\S",
-                                   "1aa! a", re.UNICODE).group(0), "1aa! a")
+        self.assertEqual(re.search(br"\d\D\w\W\s\S",
+                                   b"1aa! a", re.LOCALE).group(0), b"1aa! a")
 
     def test_string_boundaries(self):
         # See http://bugs.python.org/issue10713
@@ -409,10 +525,10 @@
         self.assertFalse(re.match(r"\B", "abc"))
         # However, an empty string contains no word boundaries, and also no
         # non-boundaries.
-        self.assertEqual(re.search(r"\B", ""), None)
+        self.assertIsNone(re.search(r"\B", ""))
         # This one is questionable and different from the perlre behaviour,
         # but describes current behavior.
-        self.assertEqual(re.search(r"\b", ""), None)
+        self.assertIsNone(re.search(r"\b", ""))
         # A single word-character string has two boundaries, but no
         # non-boundary gaps.
         self.assertEqual(len(re.findall(r"\b", "a")), 2)
@@ -426,17 +542,14 @@
     def test_bigcharset(self):
         self.assertEqual(re.match("([\u2222\u2223])",
                                   "\u2222").group(1), "\u2222")
-        self.assertEqual(re.match("([\u2222\u2223])",
-                                  "\u2222", re.UNICODE).group(1), "\u2222")
         r = '[%s]' % ''.join(map(chr, range(256, 2**16, 255)))
-        self.assertEqual(re.match(r,
-                                  "\uff01", re.UNICODE).group(), "\uff01")
+        self.assertEqual(re.match(r, "\uff01").group(), "\uff01")
 
     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'))
+        self.assertTrue(r.match('1000'))
+        self.assertTrue(r.match('9999'))
 
     def test_anyall(self):
         self.assertEqual(re.match("a.b", "a\nb", re.DOTALL).group(0),
@@ -460,7 +573,7 @@
 
     def test_ignore_case(self):
         self.assertEqual(re.match("abc", "ABC", re.I).group(0), "ABC")
-        self.assertEqual(re.match("abc", "ABC", re.I).group(0), "ABC")
+        self.assertEqual(re.match(b"abc", b"ABC", re.I).group(0), b"ABC")
         self.assertEqual(re.match(r"(a\s[^a])", "a b", re.I).group(1), "a b")
         self.assertEqual(re.match(r"(a\s[^a]*)", "a bb", re.I).group(1), "a bb")
         self.assertEqual(re.match(r"(a\s[abc])", "a b", re.I).group(1), "a b")
@@ -470,6 +583,76 @@
         self.assertEqual(re.match(r"((a)\s(abc|a))", "a a", re.I).group(1), "a a")
         self.assertEqual(re.match(r"((a)\s(abc|a)*)", "a aa", re.I).group(1), "a aa")
 
+        assert '\u212a'.lower() == 'k' # 'K'
+        self.assertTrue(re.match(r'K', '\u212a', re.I))
+        self.assertTrue(re.match(r'k', '\u212a', re.I))
+        self.assertTrue(re.match(r'\u212a', 'K', re.I))
+        self.assertTrue(re.match(r'\u212a', 'k', re.I))
+        assert '\u017f'.upper() == 'S' # 'ſ'
+        self.assertTrue(re.match(r'S', '\u017f', re.I))
+        self.assertTrue(re.match(r's', '\u017f', re.I))
+        self.assertTrue(re.match(r'\u017f', 'S', re.I))
+        self.assertTrue(re.match(r'\u017f', 's', re.I))
+        assert '\ufb05'.upper() == '\ufb06'.upper() == 'ST' # 'ſt', 'st'
+        self.assertTrue(re.match(r'\ufb05', '\ufb06', re.I))
+        self.assertTrue(re.match(r'\ufb06', '\ufb05', re.I))
+
+    def test_ignore_case_set(self):
+        self.assertTrue(re.match(r'[19A]', 'A', re.I))
+        self.assertTrue(re.match(r'[19a]', 'a', re.I))
+        self.assertTrue(re.match(r'[19a]', 'A', re.I))
+        self.assertTrue(re.match(r'[19A]', 'a', re.I))
+        self.assertTrue(re.match(br'[19A]', b'A', re.I))
+        self.assertTrue(re.match(br'[19a]', b'a', re.I))
+        self.assertTrue(re.match(br'[19a]', b'A', re.I))
+        self.assertTrue(re.match(br'[19A]', b'a', re.I))
+        assert '\u212a'.lower() == 'k' # 'K'
+        self.assertTrue(re.match(r'[19K]', '\u212a', re.I))
+        self.assertTrue(re.match(r'[19k]', '\u212a', re.I))
+        self.assertTrue(re.match(r'[19\u212a]', 'K', re.I))
+        self.assertTrue(re.match(r'[19\u212a]', 'k', re.I))
+        assert '\u017f'.upper() == 'S' # 'ſ'
+        self.assertTrue(re.match(r'[19S]', '\u017f', re.I))
+        self.assertTrue(re.match(r'[19s]', '\u017f', re.I))
+        self.assertTrue(re.match(r'[19\u017f]', 'S', re.I))
+        self.assertTrue(re.match(r'[19\u017f]', 's', re.I))
+        assert '\ufb05'.upper() == '\ufb06'.upper() == 'ST' # 'ſt', 'st'
+        self.assertTrue(re.match(r'[19\ufb05]', '\ufb06', re.I))
+        self.assertTrue(re.match(r'[19\ufb06]', '\ufb05', re.I))
+
+    def test_ignore_case_range(self):
+        # Issues #3511, #17381.
+        self.assertTrue(re.match(r'[9-a]', '_', re.I))
+        self.assertIsNone(re.match(r'[9-A]', '_', re.I))
+        self.assertTrue(re.match(br'[9-a]', b'_', re.I))
+        self.assertIsNone(re.match(br'[9-A]', b'_', re.I))
+        self.assertTrue(re.match(r'[\xc0-\xde]', '\xd7', re.I))
+        self.assertIsNone(re.match(r'[\xc0-\xde]', '\xf7', re.I))
+        self.assertTrue(re.match(r'[\xe0-\xfe]', '\xf7', re.I))
+        self.assertIsNone(re.match(r'[\xe0-\xfe]', '\xd7', re.I))
+        self.assertTrue(re.match(r'[\u0430-\u045f]', '\u0450', re.I))
+        self.assertTrue(re.match(r'[\u0430-\u045f]', '\u0400', re.I))
+        self.assertTrue(re.match(r'[\u0400-\u042f]', '\u0450', re.I))
+        self.assertTrue(re.match(r'[\u0400-\u042f]', '\u0400', re.I))
+        self.assertTrue(re.match(r'[\U00010428-\U0001044f]', '\U00010428', re.I))
+        self.assertTrue(re.match(r'[\U00010428-\U0001044f]', '\U00010400', re.I))
+        self.assertTrue(re.match(r'[\U00010400-\U00010427]', '\U00010428', re.I))
+        self.assertTrue(re.match(r'[\U00010400-\U00010427]', '\U00010400', re.I))
+
+        assert '\u212a'.lower() == 'k' # 'K'
+        self.assertTrue(re.match(r'[J-M]', '\u212a', re.I))
+        self.assertTrue(re.match(r'[j-m]', '\u212a', re.I))
+        self.assertTrue(re.match(r'[\u2129-\u212b]', 'K', re.I))
+        self.assertTrue(re.match(r'[\u2129-\u212b]', 'k', re.I))
+        assert '\u017f'.upper() == 'S' # 'ſ'
+        self.assertTrue(re.match(r'[R-T]', '\u017f', re.I))
+        self.assertTrue(re.match(r'[r-t]', '\u017f', re.I))
+        self.assertTrue(re.match(r'[\u017e-\u0180]', 'S', re.I))
+        self.assertTrue(re.match(r'[\u017e-\u0180]', 's', re.I))
+        assert '\ufb05'.upper() == '\ufb06'.upper() == 'ST' # 'ſt', 'st'
+        self.assertTrue(re.match(r'[\ufb04-\ufb05]', '\ufb06', re.I))
+        self.assertTrue(re.match(r'[\ufb06-\ufb07]', '\ufb05', re.I))
+
     def test_category(self):
         self.assertEqual(re.match(r"(\s)", " ").group(1), " ")
 
@@ -480,7 +663,7 @@
         self.assertEqual(_sre.getlower(ord('A'), re.UNICODE), ord('a'))
 
         self.assertEqual(re.match("abc", "ABC", re.I).group(0), "ABC")
-        self.assertEqual(re.match("abc", "ABC", re.I).group(0), "ABC")
+        self.assertEqual(re.match(b"abc", b"ABC", re.I).group(0), b"ABC")
 
     def test_not_literal(self):
         self.assertEqual(re.search("\s([^a])", " b").group(1), "b")
@@ -547,11 +730,15 @@
         res = re.findall(re.escape('\u2620'.encode('utf-8')), b)
         self.assertEqual(len(res), 2)
 
-    def pickle_test(self, pickle):
-        oldpat = re.compile('a(?:b|(c|e){1,2}?|d)+?(.)')
-        s = pickle.dumps(oldpat)
-        newpat = pickle.loads(s)
-        self.assertEqual(oldpat, newpat)
+    def test_pickling(self):
+        import pickle
+        oldpat = re.compile('a(?:b|(c|e){1,2}?|d)+?(.)', re.UNICODE)
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            pickled = pickle.dumps(oldpat, proto)
+            newpat = pickle.loads(pickled)
+            self.assertEqual(newpat, oldpat)
+        # current pickle expects the _compile() reconstructor in re module
+        from re import _compile
 
     def test_constants(self):
         self.assertEqual(re.I, re.IGNORECASE)
@@ -562,29 +749,29 @@
 
     def test_flags(self):
         for flag in [re.I, re.M, re.X, re.S, re.L]:
-            self.assertNotEqual(re.compile('^pattern$', flag), None)
+            self.assertTrue(re.compile('^pattern$', flag))
 
     def test_sre_character_literals(self):
         for i in [0, 8, 16, 32, 64, 127, 128, 255, 256, 0xFFFF, 0x10000, 0x10FFFF]:
             if i < 256:
-                self.assertIsNotNone(re.match(r"\%03o" % i, chr(i)))
-                self.assertIsNotNone(re.match(r"\%03o0" % i, chr(i)+"0"))
-                self.assertIsNotNone(re.match(r"\%03o8" % i, chr(i)+"8"))
-                self.assertIsNotNone(re.match(r"\x%02x" % i, chr(i)))
-                self.assertIsNotNone(re.match(r"\x%02x0" % i, chr(i)+"0"))
-                self.assertIsNotNone(re.match(r"\x%02xz" % i, chr(i)+"z"))
+                self.assertTrue(re.match(r"\%03o" % i, chr(i)))
+                self.assertTrue(re.match(r"\%03o0" % i, chr(i)+"0"))
+                self.assertTrue(re.match(r"\%03o8" % i, chr(i)+"8"))
+                self.assertTrue(re.match(r"\x%02x" % i, chr(i)))
+                self.assertTrue(re.match(r"\x%02x0" % i, chr(i)+"0"))
+                self.assertTrue(re.match(r"\x%02xz" % i, chr(i)+"z"))
             if i < 0x10000:
-                self.assertIsNotNone(re.match(r"\u%04x" % i, chr(i)))
-                self.assertIsNotNone(re.match(r"\u%04x0" % i, chr(i)+"0"))
-                self.assertIsNotNone(re.match(r"\u%04xz" % i, chr(i)+"z"))
-            self.assertIsNotNone(re.match(r"\U%08x" % i, chr(i)))
-            self.assertIsNotNone(re.match(r"\U%08x0" % i, chr(i)+"0"))
-            self.assertIsNotNone(re.match(r"\U%08xz" % i, chr(i)+"z"))
-        self.assertIsNotNone(re.match(r"\0", "\000"))
-        self.assertIsNotNone(re.match(r"\08", "\0008"))
-        self.assertIsNotNone(re.match(r"\01", "\001"))
-        self.assertIsNotNone(re.match(r"\018", "\0018"))
-        self.assertIsNotNone(re.match(r"\567", chr(0o167)))
+                self.assertTrue(re.match(r"\u%04x" % i, chr(i)))
+                self.assertTrue(re.match(r"\u%04x0" % i, chr(i)+"0"))
+                self.assertTrue(re.match(r"\u%04xz" % i, chr(i)+"z"))
+            self.assertTrue(re.match(r"\U%08x" % i, chr(i)))
+            self.assertTrue(re.match(r"\U%08x0" % i, chr(i)+"0"))
+            self.assertTrue(re.match(r"\U%08xz" % i, chr(i)+"z"))
+        self.assertTrue(re.match(r"\0", "\000"))
+        self.assertTrue(re.match(r"\08", "\0008"))
+        self.assertTrue(re.match(r"\01", "\001"))
+        self.assertTrue(re.match(r"\018", "\0018"))
+        self.assertTrue(re.match(r"\567", chr(0o167)))
         self.assertRaises(re.error, re.match, r"\911", "")
         self.assertRaises(re.error, re.match, r"\x1", "")
         self.assertRaises(re.error, re.match, r"\x1z", "")
@@ -597,22 +784,22 @@
     def test_sre_character_class_literals(self):
         for i in [0, 8, 16, 32, 64, 127, 128, 255, 256, 0xFFFF, 0x10000, 0x10FFFF]:
             if i < 256:
-                self.assertIsNotNone(re.match(r"[\%o]" % i, chr(i)))
-                self.assertIsNotNone(re.match(r"[\%o8]" % i, chr(i)))
-                self.assertIsNotNone(re.match(r"[\%03o]" % i, chr(i)))
-                self.assertIsNotNone(re.match(r"[\%03o0]" % i, chr(i)))
-                self.assertIsNotNone(re.match(r"[\%03o8]" % i, chr(i)))
-                self.assertIsNotNone(re.match(r"[\x%02x]" % i, chr(i)))
-                self.assertIsNotNone(re.match(r"[\x%02x0]" % i, chr(i)))
-                self.assertIsNotNone(re.match(r"[\x%02xz]" % i, chr(i)))
+                self.assertTrue(re.match(r"[\%o]" % i, chr(i)))
+                self.assertTrue(re.match(r"[\%o8]" % i, chr(i)))
+                self.assertTrue(re.match(r"[\%03o]" % i, chr(i)))
+                self.assertTrue(re.match(r"[\%03o0]" % i, chr(i)))
+                self.assertTrue(re.match(r"[\%03o8]" % i, chr(i)))
+                self.assertTrue(re.match(r"[\x%02x]" % i, chr(i)))
+                self.assertTrue(re.match(r"[\x%02x0]" % i, chr(i)))
+                self.assertTrue(re.match(r"[\x%02xz]" % i, chr(i)))
             if i < 0x10000:
-                self.assertIsNotNone(re.match(r"[\u%04x]" % i, chr(i)))
-                self.assertIsNotNone(re.match(r"[\u%04x0]" % i, chr(i)))
-                self.assertIsNotNone(re.match(r"[\u%04xz]" % i, chr(i)))
-            self.assertIsNotNone(re.match(r"[\U%08x]" % i, chr(i)))
-            self.assertIsNotNone(re.match(r"[\U%08x0]" % i, chr(i)+"0"))
-            self.assertIsNotNone(re.match(r"[\U%08xz]" % i, chr(i)+"z"))
-        self.assertIsNotNone(re.match(r"[\U0001d49c-\U0001d4b5]", "\U0001d49e"))
+                self.assertTrue(re.match(r"[\u%04x]" % i, chr(i)))
+                self.assertTrue(re.match(r"[\u%04x0]" % i, chr(i)))
+                self.assertTrue(re.match(r"[\u%04xz]" % i, chr(i)))
+            self.assertTrue(re.match(r"[\U%08x]" % i, chr(i)))
+            self.assertTrue(re.match(r"[\U%08x0]" % i, chr(i)+"0"))
+            self.assertTrue(re.match(r"[\U%08xz]" % i, chr(i)+"z"))
+        self.assertTrue(re.match(r"[\U0001d49c-\U0001d4b5]", "\U0001d49e"))
         self.assertRaises(re.error, re.match, r"[\911]", "")
         self.assertRaises(re.error, re.match, r"[\x1z]", "")
         self.assertRaises(re.error, re.match, r"[\u123z]", "")
@@ -621,37 +808,37 @@
 
     def test_sre_byte_literals(self):
         for i in [0, 8, 16, 32, 64, 127, 128, 255]:
-            self.assertIsNotNone(re.match((r"\%03o" % i).encode(), bytes([i])))
-            self.assertIsNotNone(re.match((r"\%03o0" % i).encode(), bytes([i])+b"0"))
-            self.assertIsNotNone(re.match((r"\%03o8" % i).encode(), bytes([i])+b"8"))
-            self.assertIsNotNone(re.match((r"\x%02x" % i).encode(), bytes([i])))
-            self.assertIsNotNone(re.match((r"\x%02x0" % i).encode(), bytes([i])+b"0"))
-            self.assertIsNotNone(re.match((r"\x%02xz" % i).encode(), bytes([i])+b"z"))
-        self.assertIsNotNone(re.match(br"\u", b'u'))
-        self.assertIsNotNone(re.match(br"\U", b'U'))
-        self.assertIsNotNone(re.match(br"\0", b"\000"))
-        self.assertIsNotNone(re.match(br"\08", b"\0008"))
-        self.assertIsNotNone(re.match(br"\01", b"\001"))
-        self.assertIsNotNone(re.match(br"\018", b"\0018"))
-        self.assertIsNotNone(re.match(br"\567", bytes([0o167])))
+            self.assertTrue(re.match((r"\%03o" % i).encode(), bytes([i])))
+            self.assertTrue(re.match((r"\%03o0" % i).encode(), bytes([i])+b"0"))
+            self.assertTrue(re.match((r"\%03o8" % i).encode(), bytes([i])+b"8"))
+            self.assertTrue(re.match((r"\x%02x" % i).encode(), bytes([i])))
+            self.assertTrue(re.match((r"\x%02x0" % i).encode(), bytes([i])+b"0"))
+            self.assertTrue(re.match((r"\x%02xz" % i).encode(), bytes([i])+b"z"))
+        self.assertTrue(re.match(br"\u", b'u'))
+        self.assertTrue(re.match(br"\U", b'U'))
+        self.assertTrue(re.match(br"\0", b"\000"))
+        self.assertTrue(re.match(br"\08", b"\0008"))
+        self.assertTrue(re.match(br"\01", b"\001"))
+        self.assertTrue(re.match(br"\018", b"\0018"))
+        self.assertTrue(re.match(br"\567", bytes([0o167])))
         self.assertRaises(re.error, re.match, br"\911", b"")
         self.assertRaises(re.error, re.match, br"\x1", b"")
         self.assertRaises(re.error, re.match, br"\x1z", b"")
 
     def test_sre_byte_class_literals(self):
         for i in [0, 8, 16, 32, 64, 127, 128, 255]:
-            self.assertIsNotNone(re.match((r"[\%o]" % i).encode(), bytes([i])))
-            self.assertIsNotNone(re.match((r"[\%o8]" % i).encode(), bytes([i])))
-            self.assertIsNotNone(re.match((r"[\%03o]" % i).encode(), bytes([i])))
-            self.assertIsNotNone(re.match((r"[\%03o0]" % i).encode(), bytes([i])))
-            self.assertIsNotNone(re.match((r"[\%03o8]" % i).encode(), bytes([i])))
-            self.assertIsNotNone(re.match((r"[\x%02x]" % i).encode(), bytes([i])))
-            self.assertIsNotNone(re.match((r"[\x%02x0]" % i).encode(), bytes([i])))
-            self.assertIsNotNone(re.match((r"[\x%02xz]" % i).encode(), bytes([i])))
-        self.assertIsNotNone(re.match(br"[\u]", b'u'))
-        self.assertIsNotNone(re.match(br"[\U]", b'U'))
-        self.assertRaises(re.error, re.match, br"[\911]", "")
-        self.assertRaises(re.error, re.match, br"[\x1z]", "")
+            self.assertTrue(re.match((r"[\%o]" % i).encode(), bytes([i])))
+            self.assertTrue(re.match((r"[\%o8]" % i).encode(), bytes([i])))
+            self.assertTrue(re.match((r"[\%03o]" % i).encode(), bytes([i])))
+            self.assertTrue(re.match((r"[\%03o0]" % i).encode(), bytes([i])))
+            self.assertTrue(re.match((r"[\%03o8]" % i).encode(), bytes([i])))
+            self.assertTrue(re.match((r"[\x%02x]" % i).encode(), bytes([i])))
+            self.assertTrue(re.match((r"[\x%02x0]" % i).encode(), bytes([i])))
+            self.assertTrue(re.match((r"[\x%02xz]" % i).encode(), bytes([i])))
+        self.assertTrue(re.match(br"[\u]", b'u'))
+        self.assertTrue(re.match(br"[\U]", b'U'))
+        self.assertRaises(re.error, re.match, br"[\911]", b"")
+        self.assertRaises(re.error, re.match, br"[\x1z]", b"")
 
     def test_bug_113254(self):
         self.assertEqual(re.match(r'(a)|(b)', 'b').start(1), -1)
@@ -660,7 +847,7 @@
 
     def test_bug_527371(self):
         # bug described in patches 527371/672491
-        self.assertEqual(re.match(r'(a)?a','a').lastindex, None)
+        self.assertIsNone(re.match(r'(a)?a','a').lastindex)
         self.assertEqual(re.match(r'(a)(b)?b','ab').lastindex, 1)
         self.assertEqual(re.match(r'(?P<a>a)(?P<b>b)?b','ab').lastgroup, 'a')
         self.assertEqual(re.match("(?P<a>a(b))", "ab").lastgroup, 'a')
@@ -717,7 +904,7 @@
             (r"\s+", None),
             ])
 
-        self.assertNotEqual(scanner.scanner.scanner("").pattern, None)
+        self.assertTrue(scanner.scanner.scanner("").pattern)
 
         self.assertEqual(scanner.scan("sum = 3*foo + 312.50 + bar"),
                          (['sum', 'op=', 3, 'op*', 'foo', 'op+', 312.5,
@@ -762,7 +949,7 @@
         # bug 764548, re.compile() barfs on str/unicode subclasses
         class my_unicode(str): pass
         pat = re.compile(my_unicode("abc"))
-        self.assertEqual(pat.match("xyz"), None)
+        self.assertIsNone(pat.match("xyz"))
 
     def test_finditer(self):
         iter = re.finditer(r":+", "a:b::c:::d")
@@ -790,11 +977,11 @@
                          ["::", "::"])
 
     def test_bug_926075(self):
-        self.assertTrue(re.compile('bug_926075') is not
-                     re.compile(b'bug_926075'))
+        self.assertIsNot(re.compile('bug_926075'),
+                         re.compile(b'bug_926075'))
 
     def test_bug_931848(self):
-        pattern = eval('"[\u002E\u3002\uFF0E\uFF61]"')
+        pattern = "[\u002E\u3002\uFF0E\uFF61]"
         self.assertEqual(re.compile(pattern).split("a.b.c"),
                          ['a','b','c'])
 
@@ -805,7 +992,7 @@
 
         scanner = re.compile(r"\s").scanner("a b")
         self.assertEqual(scanner.search().span(), (1, 2))
-        self.assertEqual(scanner.search(), None)
+        self.assertIsNone(scanner.search())
 
     def test_bug_817234(self):
         iter = re.finditer(r".*", "asdf")
@@ -839,7 +1026,7 @@
         import array
         for typecode in 'bBuhHiIlLfd':
             a = array.array(typecode)
-            self.assertEqual(re.compile(b"bla").match(a), None)
+            self.assertIsNone(re.compile(b"bla").match(a))
             self.assertEqual(re.compile(b"").match(a).groups(), ())
 
     def test_inline_flags(self):
@@ -849,27 +1036,27 @@
 
         p = re.compile(upper_char, re.I | re.U)
         q = p.match(lower_char)
-        self.assertNotEqual(q, None)
+        self.assertTrue(q)
 
         p = re.compile(lower_char, re.I | re.U)
         q = p.match(upper_char)
-        self.assertNotEqual(q, None)
+        self.assertTrue(q)
 
         p = re.compile('(?i)' + upper_char, re.U)
         q = p.match(lower_char)
-        self.assertNotEqual(q, None)
+        self.assertTrue(q)
 
         p = re.compile('(?i)' + lower_char, re.U)
         q = p.match(upper_char)
-        self.assertNotEqual(q, None)
+        self.assertTrue(q)
 
         p = re.compile('(?iu)' + upper_char)
         q = p.match(lower_char)
-        self.assertNotEqual(q, None)
+        self.assertTrue(q)
 
         p = re.compile('(?iu)' + lower_char)
         q = p.match(upper_char)
-        self.assertNotEqual(q, None)
+        self.assertTrue(q)
 
     def test_dollar_matches_twice(self):
         "$ matches the end of string, and just before the terminating \n"
@@ -900,23 +1087,23 @@
         # String patterns
         for flags in (0, re.UNICODE):
             pat = re.compile('\xc0', flags | re.IGNORECASE)
-            self.assertNotEqual(pat.match('\xe0'), None)
+            self.assertTrue(pat.match('\xe0'))
             pat = re.compile('\w', flags)
-            self.assertNotEqual(pat.match('\xe0'), None)
+            self.assertTrue(pat.match('\xe0'))
         pat = re.compile('\xc0', re.ASCII | re.IGNORECASE)
-        self.assertEqual(pat.match('\xe0'), None)
+        self.assertIsNone(pat.match('\xe0'))
         pat = re.compile('(?a)\xc0', re.IGNORECASE)
-        self.assertEqual(pat.match('\xe0'), None)
+        self.assertIsNone(pat.match('\xe0'))
         pat = re.compile('\w', re.ASCII)
-        self.assertEqual(pat.match('\xe0'), None)
+        self.assertIsNone(pat.match('\xe0'))
         pat = re.compile('(?a)\w')
-        self.assertEqual(pat.match('\xe0'), None)
+        self.assertIsNone(pat.match('\xe0'))
         # Bytes patterns
         for flags in (0, re.ASCII):
-            pat = re.compile(b'\xc0', re.IGNORECASE)
-            self.assertEqual(pat.match(b'\xe0'), None)
-            pat = re.compile(b'\w')
-            self.assertEqual(pat.match(b'\xe0'), None)
+            pat = re.compile(b'\xc0', flags | re.IGNORECASE)
+            self.assertIsNone(pat.match(b'\xe0'))
+            pat = re.compile(b'\w', flags)
+            self.assertIsNone(pat.match(b'\xe0'))
         # Incompatibilities
         self.assertRaises(ValueError, re.compile, b'\w', re.UNICODE)
         self.assertRaises(ValueError, re.compile, b'(?u)\w')
@@ -956,11 +1143,11 @@
         self.assertRaises(TypeError, _sre.compile, {}, 0, [])
 
     def test_search_dot_unicode(self):
-        self.assertIsNotNone(re.search("123.*-", '123abc-'))
-        self.assertIsNotNone(re.search("123.*-", '123\xe9-'))
-        self.assertIsNotNone(re.search("123.*-", '123\u20ac-'))
-        self.assertIsNotNone(re.search("123.*-", '123\U0010ffff-'))
-        self.assertIsNotNone(re.search("123.*-", '123\xe9\u20ac\U0010ffff-'))
+        self.assertTrue(re.search("123.*-", '123abc-'))
+        self.assertTrue(re.search("123.*-", '123\xe9-'))
+        self.assertTrue(re.search("123.*-", '123\u20ac-'))
+        self.assertTrue(re.search("123.*-", '123\U0010ffff-'))
+        self.assertTrue(re.search("123.*-", '123\xe9\u20ac\U0010ffff-'))
 
     def test_compile(self):
         # Test return value when given string and pattern as parameter
@@ -1053,6 +1240,28 @@
                 self.assertEqual(re.compile(pattern, re.S).findall(b'xyz'),
                                  [b'xyz'], msg=pattern)
 
+    def test_match_repr(self):
+        for string in '[abracadabra]', S('[abracadabra]'):
+            m = re.search(r'(.+)(.*?)\1', string)
+            self.assertEqual(repr(m), "<%s.%s object; "
+                             "span=(1, 12), match='abracadabra'>" %
+                             (type(m).__module__, type(m).__qualname__))
+        for string in (b'[abracadabra]', B(b'[abracadabra]'),
+                       bytearray(b'[abracadabra]'),
+                       memoryview(b'[abracadabra]')):
+            m = re.search(rb'(.+)(.*?)\1', string)
+            self.assertEqual(repr(m), "<%s.%s object; "
+                             "span=(1, 12), match=b'abracadabra'>" %
+                             (type(m).__module__, type(m).__qualname__))
+
+        first, second = list(re.finditer("(aa)|(bb)", "aa bb"))
+        self.assertEqual(repr(first), "<%s.%s object; "
+                         "span=(0, 2), match='aa'>" %
+                         (type(second).__module__, type(first).__qualname__))
+        self.assertEqual(repr(second), "<%s.%s object; "
+                         "span=(3, 5), match='bb'>" %
+                         (type(second).__module__, type(second).__qualname__))
+
 
     def test_bug_2537(self):
         # issue 2537: empty submatches
@@ -1065,16 +1274,33 @@
                 self.assertEqual(m.group(2), "y")
 
     def test_debug_flag(self):
+        pat = r'(\.)(?:[ch]|py)(?(1)$|: )'
         with captured_stdout() as out:
-            re.compile('foo', re.DEBUG)
-        self.assertEqual(out.getvalue().splitlines(),
-                         ['literal 102 ', 'literal 111 ', 'literal 111 '])
+            re.compile(pat, re.DEBUG)
+        dump = '''\
+subpattern 1
+  literal 46
+subpattern None
+  branch
+    in
+      literal 99
+      literal 104
+  or
+    literal 112
+    literal 121
+subpattern None
+  groupref_exists 1
+    at at_end
+  else
+    literal 58
+    literal 32
+'''
+        self.assertEqual(out.getvalue(), dump)
         # Debug output is output again even a second time (bypassing
         # the cache -- issue #20426).
         with captured_stdout() as out:
-            re.compile('foo', re.DEBUG)
-        self.assertEqual(out.getvalue().splitlines(),
-                         ['literal 102 ', 'literal 111 ', 'literal 111 '])
+            re.compile(pat, re.DEBUG)
+        self.assertEqual(out.getvalue(), dump)
 
     def test_keyword_parameters(self):
         # Issue #20283: Accepting the string keyword parameter.
@@ -1082,6 +1308,8 @@
         self.assertEqual(
             pat.match(string='abracadabra', pos=7, endpos=10).span(), (7, 9))
         self.assertEqual(
+            pat.fullmatch(string='abracadabra', pos=7, endpos=9).span(), (7, 9))
+        self.assertEqual(
             pat.search(string='abracadabra', pos=3, endpos=10).span(), (7, 9))
         self.assertEqual(
             pat.findall(string='abracadabra', pos=3, endpos=10), ['ab'])
@@ -1092,56 +1320,174 @@
             pat.scanner(string='abracadabra', pos=3, endpos=10).search().span(),
             (7, 9))
 
+    def test_bug_20998(self):
+        # Issue #20998: Fullmatch of repeated single character pattern
+        # with ignore case.
+        self.assertEqual(re.fullmatch('[a-c]+', 'ABC', re.I).span(), (0, 3))
 
-def run_re_tests():
-    from test.re_tests import tests, SUCCEED, FAIL, SYNTAX_ERROR
-    if verbose:
-        print('Running re_tests test suite')
-    else:
-        # To save time, only run the first and last 10 tests
-        #tests = tests[:10] + tests[-10:]
-        pass
-
-    for t in tests:
-        sys.stdout.flush()
-        pattern = s = outcome = repl = expected = None
-        if len(t) == 5:
-            pattern, s, outcome, repl, expected = t
-        elif len(t) == 3:
-            pattern, s, outcome = t
-        else:
-            raise ValueError('Test tuples should have 3 or 5 fields', t)
-
-        try:
-            obj = re.compile(pattern)
-        except re.error:
-            if outcome == SYNTAX_ERROR: pass  # Expected a syntax error
-            else:
-                print('=== Syntax error:', t)
-        except KeyboardInterrupt: raise KeyboardInterrupt
-        except:
-            print('*** Unexpected error ***', t)
-            if verbose:
-                traceback.print_exc(file=sys.stdout)
-        else:
+    def test_locale_caching(self):
+        # Issue #22410
+        oldlocale = locale.setlocale(locale.LC_CTYPE)
+        self.addCleanup(locale.setlocale, locale.LC_CTYPE, oldlocale)
+        for loc in 'en_US.iso88591', 'en_US.utf8':
             try:
+                locale.setlocale(locale.LC_CTYPE, loc)
+            except locale.Error:
+                # Unsupported locale on this system
+                self.skipTest('test needs %s locale' % loc)
+
+        re.purge()
+        self.check_en_US_iso88591()
+        self.check_en_US_utf8()
+        re.purge()
+        self.check_en_US_utf8()
+        self.check_en_US_iso88591()
+
+    def check_en_US_iso88591(self):
+        locale.setlocale(locale.LC_CTYPE, 'en_US.iso88591')
+        self.assertTrue(re.match(b'\xc5\xe5', b'\xc5\xe5', re.L|re.I))
+        self.assertTrue(re.match(b'\xc5', b'\xe5', re.L|re.I))
+        self.assertTrue(re.match(b'\xe5', b'\xc5', re.L|re.I))
+        self.assertTrue(re.match(b'(?Li)\xc5\xe5', b'\xc5\xe5'))
+        self.assertTrue(re.match(b'(?Li)\xc5', b'\xe5'))
+        self.assertTrue(re.match(b'(?Li)\xe5', b'\xc5'))
+
+    def check_en_US_utf8(self):
+        locale.setlocale(locale.LC_CTYPE, 'en_US.utf8')
+        self.assertTrue(re.match(b'\xc5\xe5', b'\xc5\xe5', re.L|re.I))
+        self.assertIsNone(re.match(b'\xc5', b'\xe5', re.L|re.I))
+        self.assertIsNone(re.match(b'\xe5', b'\xc5', re.L|re.I))
+        self.assertTrue(re.match(b'(?Li)\xc5\xe5', b'\xc5\xe5'))
+        self.assertIsNone(re.match(b'(?Li)\xc5', b'\xe5'))
+        self.assertIsNone(re.match(b'(?Li)\xe5', b'\xc5'))
+
+
+class PatternReprTests(unittest.TestCase):
+    def check(self, pattern, expected):
+        self.assertEqual(repr(re.compile(pattern)), expected)
+
+    def check_flags(self, pattern, flags, expected):
+        self.assertEqual(repr(re.compile(pattern, flags)), expected)
+
+    def test_without_flags(self):
+        self.check('random pattern',
+                   "re.compile('random pattern')")
+
+    def test_single_flag(self):
+        self.check_flags('random pattern', re.IGNORECASE,
+            "re.compile('random pattern', re.IGNORECASE)")
+
+    def test_multiple_flags(self):
+        self.check_flags('random pattern', re.I|re.S|re.X,
+            "re.compile('random pattern', "
+            "re.IGNORECASE|re.DOTALL|re.VERBOSE)")
+
+    def test_unicode_flag(self):
+        self.check_flags('random pattern', re.U,
+                         "re.compile('random pattern')")
+        self.check_flags('random pattern', re.I|re.S|re.U,
+                         "re.compile('random pattern', "
+                         "re.IGNORECASE|re.DOTALL)")
+
+    def test_inline_flags(self):
+        self.check('(?i)pattern',
+                   "re.compile('(?i)pattern', re.IGNORECASE)")
+
+    def test_unknown_flags(self):
+        self.check_flags('random pattern', 0x123000,
+                         "re.compile('random pattern', 0x123000)")
+        self.check_flags('random pattern', 0x123000|re.I,
+            "re.compile('random pattern', re.IGNORECASE|0x123000)")
+
+    def test_bytes(self):
+        self.check(b'bytes pattern',
+                   "re.compile(b'bytes pattern')")
+        self.check_flags(b'bytes pattern', re.A,
+                         "re.compile(b'bytes pattern', re.ASCII)")
+
+    def test_quotes(self):
+        self.check('random "double quoted" pattern',
+            '''re.compile('random "double quoted" pattern')''')
+        self.check("random 'single quoted' pattern",
+            '''re.compile("random 'single quoted' pattern")''')
+        self.check('''both 'single' and "double" quotes''',
+            '''re.compile('both \\'single\\' and "double" quotes')''')
+
+    def test_long_pattern(self):
+        pattern = 'Very %spattern' % ('long ' * 1000)
+        r = repr(re.compile(pattern))
+        self.assertLess(len(r), 300)
+        self.assertEqual(r[:30], "re.compile('Very long long lon")
+        r = repr(re.compile(pattern, re.I))
+        self.assertLess(len(r), 300)
+        self.assertEqual(r[:30], "re.compile('Very long long lon")
+        self.assertEqual(r[-16:], ", re.IGNORECASE)")
+
+
+class ImplementationTest(unittest.TestCase):
+    """
+    Test implementation details of the re module.
+    """
+
+    def test_overlap_table(self):
+        f = sre_compile._generate_overlap_table
+        self.assertEqual(f(""), [])
+        self.assertEqual(f("a"), [0])
+        self.assertEqual(f("abcd"), [0, 0, 0, 0])
+        self.assertEqual(f("aaaa"), [0, 1, 2, 3])
+        self.assertEqual(f("ababba"), [0, 0, 1, 2, 0, 1])
+        self.assertEqual(f("abcabdac"), [0, 0, 0, 1, 2, 0, 1, 0])
+
+
+class ExternalTests(unittest.TestCase):
+
+    def test_re_benchmarks(self):
+        're_tests benchmarks'
+        from test.re_tests import benchmarks
+        for pattern, s in benchmarks:
+            with self.subTest(pattern=pattern, string=s):
+                p = re.compile(pattern)
+                self.assertTrue(p.search(s))
+                self.assertTrue(p.match(s))
+                self.assertTrue(p.fullmatch(s))
+                s2 = ' '*10000 + s + ' '*10000
+                self.assertTrue(p.search(s2))
+                self.assertTrue(p.match(s2, 10000))
+                self.assertTrue(p.match(s2, 10000, 10000 + len(s)))
+                self.assertTrue(p.fullmatch(s2, 10000, 10000 + len(s)))
+
+    def test_re_tests(self):
+        're_tests test suite'
+        from test.re_tests import tests, SUCCEED, FAIL, SYNTAX_ERROR
+        for t in tests:
+            pattern = s = outcome = repl = expected = None
+            if len(t) == 5:
+                pattern, s, outcome, repl, expected = t
+            elif len(t) == 3:
+                pattern, s, outcome = t
+            else:
+                raise ValueError('Test tuples should have 3 or 5 fields', t)
+
+            with self.subTest(pattern=pattern, string=s):
+                if outcome == SYNTAX_ERROR:  # Expected a syntax error
+                    with self.assertRaises(re.error):
+                        re.compile(pattern)
+                    continue
+
+                obj = re.compile(pattern)
                 result = obj.search(s)
-            except re.error as msg:
-                print('=== Unexpected exception', t, repr(msg))
-            if outcome == SYNTAX_ERROR:
-                # This should have been a syntax error; forget it.
-                pass
-            elif outcome == FAIL:
-                if result is None: pass   # No match, as expected
-                else: print('=== Succeeded incorrectly', t)
-            elif outcome == SUCCEED:
-                if result is not None:
+                if outcome == FAIL:
+                    self.assertIsNone(result, 'Succeeded incorrectly')
+                    continue
+
+                with self.subTest():
+                    self.assertTrue(result, 'Failed incorrectly')
                     # Matched, as expected, so now we compute the
                     # result string and compare it to our expected result.
                     start, end = result.span(0)
-                    vardict={'found': result.group(0),
-                             'groups': result.group(),
-                             'flags': result.re.flags}
+                    vardict = {'found': result.group(0),
+                               'groups': result.group(),
+                               'flags': result.re.flags}
                     for i in range(1, 100):
                         try:
                             gi = result.group(i)
@@ -1159,12 +1505,8 @@
                         except IndexError:
                             gi = "Error"
                         vardict[i] = gi
-                    repl = eval(repl, vardict)
-                    if repl != expected:
-                        print('=== grouping error', t, end=' ')
-                        print(repr(repl) + ' should be ' + repr(expected))
-                else:
-                    print('=== Failed incorrectly', t)
+                    self.assertEqual(eval(repl, vardict), expected,
+                                     'grouping error')
 
                 # Try the match with both pattern and string converted to
                 # bytes, and check that it still succeeds.
@@ -1175,55 +1517,39 @@
                     # skip non-ascii tests
                     pass
                 else:
-                    try:
+                    with self.subTest('bytes pattern match'):
                         bpat = re.compile(bpat)
-                    except Exception:
-                        print('=== Fails on bytes pattern compile', t)
-                        if verbose:
-                            traceback.print_exc(file=sys.stdout)
-                    else:
-                        bytes_result = bpat.search(bs)
-                        if bytes_result is None:
-                            print('=== Fails on bytes pattern match', t)
+                        self.assertTrue(bpat.search(bs))
 
                 # Try the match with the search area limited to the extent
                 # of the match and see if it still succeeds.  \B will
                 # break (because it won't match at the end or start of a
                 # string), so we'll ignore patterns that feature it.
-
-                if pattern[:2] != '\\B' and pattern[-2:] != '\\B' \
-                               and result is not None:
-                    obj = re.compile(pattern)
-                    result = obj.search(s, result.start(0), result.end(0) + 1)
-                    if result is None:
-                        print('=== Failed on range-limited match', t)
+                if (pattern[:2] != r'\B' and pattern[-2:] != r'\B'
+                            and result is not None):
+                    with self.subTest('range-limited match'):
+                        obj = re.compile(pattern)
+                        self.assertTrue(obj.search(s, start, end + 1))
 
                 # Try the match with IGNORECASE enabled, and check that it
                 # still succeeds.
-                obj = re.compile(pattern, re.IGNORECASE)
-                result = obj.search(s)
-                if result is None:
-                    print('=== Fails on case-insensitive match', t)
+                with self.subTest('case-insensitive match'):
+                    obj = re.compile(pattern, re.IGNORECASE)
+                    self.assertTrue(obj.search(s))
 
                 # Try the match with LOCALE enabled, and check that it
                 # still succeeds.
                 if '(?u)' not in pattern:
-                    obj = re.compile(pattern, re.LOCALE)
-                    result = obj.search(s)
-                    if result is None:
-                        print('=== Fails on locale-sensitive match', t)
+                    with self.subTest('locale-sensitive match'):
+                        obj = re.compile(pattern, re.LOCALE)
+                        self.assertTrue(obj.search(s))
 
                 # Try the match with UNICODE locale enabled, and check
                 # that it still succeeds.
-                obj = re.compile(pattern, re.UNICODE)
-                result = obj.search(s)
-                if result is None:
-                    print('=== Fails on unicode-sensitive match', t)
+                with self.subTest('unicode-sensitive match'):
+                    obj = re.compile(pattern, re.UNICODE)
+                    self.assertTrue(obj.search(s))
 
 
-def test_main():
-    run_unittest(ReTests)
-    run_re_tests()
-
 if __name__ == "__main__":
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_readline.py b/Lib/test/test_readline.py
index 5483dd3..0b2b0a5 100644
--- a/Lib/test/test_readline.py
+++ b/Lib/test/test_readline.py
@@ -1,21 +1,24 @@
 """
 Very minimal unittests for parts of the readline module.
-
-These tests were added to check that the libedit emulation on OSX and
-the "real" readline have the same interface for history manipulation. That's
-why the tests cover only a small subset of the interface.
 """
+import os
 import unittest
 from test.support import run_unittest, import_module
+from test.script_helper import assert_python_ok
 
 # Skip tests if there is no readline module
 readline = import_module('readline')
 
 class TestHistoryManipulation (unittest.TestCase):
+    """
+    These tests were added to check that the libedit emulation on OSX and the
+    "real" readline have the same interface for history manipulation. That's
+    why the tests cover only a small subset of the interface.
+    """
 
-    @unittest.skipIf(not hasattr(readline, 'clear_history'),
-                     "The history update test cannot be run because the "
-                     "clear_history method is not available.")
+    @unittest.skipUnless(hasattr(readline, "clear_history"),
+                         "The history update test cannot be run because the "
+                         "clear_history method is not available.")
     def testHistoryUpdates(self):
         readline.clear_history()
 
@@ -40,8 +43,22 @@
         self.assertEqual(readline.get_current_history_length(), 1)
 
 
+class TestReadline(unittest.TestCase):
+
+    @unittest.skipIf(readline._READLINE_VERSION < 0x0600
+                     and "libedit" not in readline.__doc__,
+                     "not supported in this library version")
+    def test_init(self):
+        # Issue #19884: Ensure that the ANSI sequence "\033[1034h" is not
+        # written into stdout when the readline module is imported and stdout
+        # is redirected to a pipe.
+        rc, stdout, stderr = assert_python_ok('-c', 'import readline',
+                                              TERM='xterm-256color')
+        self.assertEqual(stdout, b'')
+
+
 def test_main():
-    run_unittest(TestHistoryManipulation)
+    run_unittest(TestHistoryManipulation, TestReadline)
 
 if __name__ == "__main__":
     test_main()
diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py
new file mode 100644
index 0000000..a398a4f
--- /dev/null
+++ b/Lib/test/test_regrtest.py
@@ -0,0 +1,275 @@
+"""
+Tests of regrtest.py.
+"""
+
+import argparse
+import faulthandler
+import getopt
+import os.path
+import unittest
+from test import regrtest, support
+
+class ParseArgsTestCase(unittest.TestCase):
+
+    """Test regrtest's argument parsing."""
+
+    def checkError(self, args, msg):
+        with support.captured_stderr() as err, self.assertRaises(SystemExit):
+            regrtest._parse_args(args)
+        self.assertIn(msg, err.getvalue())
+
+    def test_help(self):
+        for opt in '-h', '--help':
+            with self.subTest(opt=opt):
+                with support.captured_stdout() as out, \
+                     self.assertRaises(SystemExit):
+                    regrtest._parse_args([opt])
+                self.assertIn('Run Python regression tests.', out.getvalue())
+
+    @unittest.skipUnless(hasattr(faulthandler, 'dump_traceback_later'),
+                         "faulthandler.dump_traceback_later() required")
+    def test_timeout(self):
+        ns = regrtest._parse_args(['--timeout', '4.2'])
+        self.assertEqual(ns.timeout, 4.2)
+        self.checkError(['--timeout'], 'expected one argument')
+        self.checkError(['--timeout', 'foo'], 'invalid float value')
+
+    def test_wait(self):
+        ns = regrtest._parse_args(['--wait'])
+        self.assertTrue(ns.wait)
+
+    def test_slaveargs(self):
+        ns = regrtest._parse_args(['--slaveargs', '[[], {}]'])
+        self.assertEqual(ns.slaveargs, '[[], {}]')
+        self.checkError(['--slaveargs'], 'expected one argument')
+
+    def test_start(self):
+        for opt in '-S', '--start':
+            with self.subTest(opt=opt):
+                ns = regrtest._parse_args([opt, 'foo'])
+                self.assertEqual(ns.start, 'foo')
+                self.checkError([opt], 'expected one argument')
+
+    def test_verbose(self):
+        ns = regrtest._parse_args(['-v'])
+        self.assertEqual(ns.verbose, 1)
+        ns = regrtest._parse_args(['-vvv'])
+        self.assertEqual(ns.verbose, 3)
+        ns = regrtest._parse_args(['--verbose'])
+        self.assertEqual(ns.verbose, 1)
+        ns = regrtest._parse_args(['--verbose'] * 3)
+        self.assertEqual(ns.verbose, 3)
+        ns = regrtest._parse_args([])
+        self.assertEqual(ns.verbose, 0)
+
+    def test_verbose2(self):
+        for opt in '-w', '--verbose2':
+            with self.subTest(opt=opt):
+                ns = regrtest._parse_args([opt])
+                self.assertTrue(ns.verbose2)
+
+    def test_verbose3(self):
+        for opt in '-W', '--verbose3':
+            with self.subTest(opt=opt):
+                ns = regrtest._parse_args([opt])
+                self.assertTrue(ns.verbose3)
+
+    def test_quiet(self):
+        for opt in '-q', '--quiet':
+            with self.subTest(opt=opt):
+                ns = regrtest._parse_args([opt])
+                self.assertTrue(ns.quiet)
+                self.assertEqual(ns.verbose, 0)
+
+    def test_slow(self):
+        for opt in '-o', '--slow':
+            with self.subTest(opt=opt):
+                ns = regrtest._parse_args([opt])
+                self.assertTrue(ns.print_slow)
+
+    def test_header(self):
+        ns = regrtest._parse_args(['--header'])
+        self.assertTrue(ns.header)
+
+    def test_randomize(self):
+        for opt in '-r', '--randomize':
+            with self.subTest(opt=opt):
+                ns = regrtest._parse_args([opt])
+                self.assertTrue(ns.randomize)
+
+    def test_randseed(self):
+        ns = regrtest._parse_args(['--randseed', '12345'])
+        self.assertEqual(ns.random_seed, 12345)
+        self.assertTrue(ns.randomize)
+        self.checkError(['--randseed'], 'expected one argument')
+        self.checkError(['--randseed', 'foo'], 'invalid int value')
+
+    def test_fromfile(self):
+        for opt in '-f', '--fromfile':
+            with self.subTest(opt=opt):
+                ns = regrtest._parse_args([opt, 'foo'])
+                self.assertEqual(ns.fromfile, 'foo')
+                self.checkError([opt], 'expected one argument')
+                self.checkError([opt, 'foo', '-s'], "don't go together")
+
+    def test_exclude(self):
+        for opt in '-x', '--exclude':
+            with self.subTest(opt=opt):
+                ns = regrtest._parse_args([opt])
+                self.assertTrue(ns.exclude)
+
+    def test_single(self):
+        for opt in '-s', '--single':
+            with self.subTest(opt=opt):
+                ns = regrtest._parse_args([opt])
+                self.assertTrue(ns.single)
+                self.checkError([opt, '-f', 'foo'], "don't go together")
+
+    def test_match(self):
+        for opt in '-m', '--match':
+            with self.subTest(opt=opt):
+                ns = regrtest._parse_args([opt, 'pattern'])
+                self.assertEqual(ns.match_tests, 'pattern')
+                self.checkError([opt], 'expected one argument')
+
+    def test_failfast(self):
+        for opt in '-G', '--failfast':
+            with self.subTest(opt=opt):
+                ns = regrtest._parse_args([opt, '-v'])
+                self.assertTrue(ns.failfast)
+                ns = regrtest._parse_args([opt, '-W'])
+                self.assertTrue(ns.failfast)
+                self.checkError([opt], '-G/--failfast needs either -v or -W')
+
+    def test_use(self):
+        for opt in '-u', '--use':
+            with self.subTest(opt=opt):
+                ns = regrtest._parse_args([opt, 'gui,network'])
+                self.assertEqual(ns.use_resources, ['gui', 'network'])
+                ns = regrtest._parse_args([opt, 'gui,none,network'])
+                self.assertEqual(ns.use_resources, ['network'])
+                expected = list(regrtest.RESOURCE_NAMES)
+                expected.remove('gui')
+                ns = regrtest._parse_args([opt, 'all,-gui'])
+                self.assertEqual(ns.use_resources, expected)
+                self.checkError([opt], 'expected one argument')
+                self.checkError([opt, 'foo'], 'invalid resource')
+
+    def test_memlimit(self):
+        for opt in '-M', '--memlimit':
+            with self.subTest(opt=opt):
+                ns = regrtest._parse_args([opt, '4G'])
+                self.assertEqual(ns.memlimit, '4G')
+                self.checkError([opt], 'expected one argument')
+
+    def test_testdir(self):
+        ns = regrtest._parse_args(['--testdir', 'foo'])
+        self.assertEqual(ns.testdir, os.path.join(support.SAVEDCWD, 'foo'))
+        self.checkError(['--testdir'], 'expected one argument')
+
+    def test_runleaks(self):
+        for opt in '-L', '--runleaks':
+            with self.subTest(opt=opt):
+                ns = regrtest._parse_args([opt])
+                self.assertTrue(ns.runleaks)
+
+    def test_huntrleaks(self):
+        for opt in '-R', '--huntrleaks':
+            with self.subTest(opt=opt):
+                ns = regrtest._parse_args([opt, ':'])
+                self.assertEqual(ns.huntrleaks, (5, 4, 'reflog.txt'))
+                ns = regrtest._parse_args([opt, '6:'])
+                self.assertEqual(ns.huntrleaks, (6, 4, 'reflog.txt'))
+                ns = regrtest._parse_args([opt, ':3'])
+                self.assertEqual(ns.huntrleaks, (5, 3, 'reflog.txt'))
+                ns = regrtest._parse_args([opt, '6:3:leaks.log'])
+                self.assertEqual(ns.huntrleaks, (6, 3, 'leaks.log'))
+                self.checkError([opt], 'expected one argument')
+                self.checkError([opt, '6'],
+                                'needs 2 or 3 colon-separated arguments')
+                self.checkError([opt, 'foo:'], 'invalid huntrleaks value')
+                self.checkError([opt, '6:foo'], 'invalid huntrleaks value')
+
+    def test_multiprocess(self):
+        for opt in '-j', '--multiprocess':
+            with self.subTest(opt=opt):
+                ns = regrtest._parse_args([opt, '2'])
+                self.assertEqual(ns.use_mp, 2)
+                self.checkError([opt], 'expected one argument')
+                self.checkError([opt, 'foo'], 'invalid int value')
+                self.checkError([opt, '2', '-T'], "don't go together")
+                self.checkError([opt, '2', '-l'], "don't go together")
+                self.checkError([opt, '2', '-M', '4G'], "don't go together")
+
+    def test_coverage(self):
+        for opt in '-T', '--coverage':
+            with self.subTest(opt=opt):
+                ns = regrtest._parse_args([opt])
+                self.assertTrue(ns.trace)
+
+    def test_coverdir(self):
+        for opt in '-D', '--coverdir':
+            with self.subTest(opt=opt):
+                ns = regrtest._parse_args([opt, 'foo'])
+                self.assertEqual(ns.coverdir,
+                                 os.path.join(support.SAVEDCWD, 'foo'))
+                self.checkError([opt], 'expected one argument')
+
+    def test_nocoverdir(self):
+        for opt in '-N', '--nocoverdir':
+            with self.subTest(opt=opt):
+                ns = regrtest._parse_args([opt])
+                self.assertIsNone(ns.coverdir)
+
+    def test_threshold(self):
+        for opt in '-t', '--threshold':
+            with self.subTest(opt=opt):
+                ns = regrtest._parse_args([opt, '1000'])
+                self.assertEqual(ns.threshold, 1000)
+                self.checkError([opt], 'expected one argument')
+                self.checkError([opt, 'foo'], 'invalid int value')
+
+    def test_nowindows(self):
+        for opt in '-n', '--nowindows':
+            with self.subTest(opt=opt):
+                ns = regrtest._parse_args([opt])
+                self.assertTrue(ns.nowindows)
+
+    def test_forever(self):
+        for opt in '-F', '--forever':
+            with self.subTest(opt=opt):
+                ns = regrtest._parse_args([opt])
+                self.assertTrue(ns.forever)
+
+
+    def test_unrecognized_argument(self):
+        self.checkError(['--xxx'], 'usage:')
+
+    def test_long_option__partial(self):
+        ns = regrtest._parse_args(['--qui'])
+        self.assertTrue(ns.quiet)
+        self.assertEqual(ns.verbose, 0)
+
+    def test_two_options(self):
+        ns = regrtest._parse_args(['--quiet', '--exclude'])
+        self.assertTrue(ns.quiet)
+        self.assertEqual(ns.verbose, 0)
+        self.assertTrue(ns.exclude)
+
+    def test_option_with_empty_string_value(self):
+        ns = regrtest._parse_args(['--start', ''])
+        self.assertEqual(ns.start, '')
+
+    def test_arg(self):
+        ns = regrtest._parse_args(['foo'])
+        self.assertEqual(ns.args, ['foo'])
+
+    def test_option_and_arg(self):
+        ns = regrtest._parse_args(['--quiet', 'foo'])
+        self.assertTrue(ns.quiet)
+        self.assertEqual(ns.verbose, 0)
+        self.assertEqual(ns.args, ['foo'])
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Lib/test/test_reprlib.py b/Lib/test/test_reprlib.py
index c233b1d..ae67f06 100644
--- a/Lib/test/test_reprlib.py
+++ b/Lib/test/test_reprlib.py
@@ -3,11 +3,11 @@
   Nick Mathewson
 """
 
-import imp
 import sys
 import os
 import shutil
 import importlib
+import importlib.util
 import unittest
 
 from test.support import run_unittest, create_empty_file, verbose
@@ -248,7 +248,8 @@
         source_path_len += 2 * (len(self.longname) + 1)
         # a path separator + `module_name` + ".py"
         source_path_len += len(module_name) + 1 + len(".py")
-        cached_path_len = source_path_len + len(imp.cache_from_source("x.py")) - len("x.py")
+        cached_path_len = (source_path_len +
+            len(importlib.util.cache_from_source("x.py")) - len("x.py"))
         if os.name == 'nt' and cached_path_len >= 258:
             # Under Windows, the max path len is 260 including C's terminating
             # NUL character.
@@ -259,6 +260,7 @@
             print("cached_path_len =", cached_path_len)
 
     def test_module(self):
+        self.maxDiff = None
         self._check_path_limitations(self.pkgname)
         create_empty_file(os.path.join(self.subpkgname, self.pkgname + '.py'))
         importlib.invalidate_caches()
diff --git a/Lib/test/test_resource.py b/Lib/test/test_resource.py
index 0cf61cb..2ecae0f 100644
--- a/Lib/test/test_resource.py
+++ b/Lib/test/test_resource.py
@@ -1,3 +1,6 @@
+import contextlib
+import sys
+import os
 import unittest
 from test import support
 import time
@@ -61,7 +64,7 @@
                         for i in range(5):
                             time.sleep(.1)
                             f.flush()
-                    except IOError:
+                    except OSError:
                         if not limit_set:
                             raise
                     if limit_set:
@@ -129,6 +132,33 @@
         self.assertIsInstance(pagesize, int)
         self.assertGreaterEqual(pagesize, 0)
 
+    @unittest.skipUnless(sys.platform == 'linux', 'test requires Linux')
+    def test_linux_constants(self):
+        for attr in ['MSGQUEUE', 'NICE', 'RTPRIO', 'RTTIME', 'SIGPENDING']:
+            with contextlib.suppress(AttributeError):
+                self.assertIsInstance(getattr(resource, 'RLIMIT_' + attr), int)
+
+    @support.requires_freebsd_version(9)
+    def test_freebsd_contants(self):
+        for attr in ['SWAP', 'SBSIZE', 'NPTS']:
+            with contextlib.suppress(AttributeError):
+                self.assertIsInstance(getattr(resource, 'RLIMIT_' + attr), int)
+
+    @unittest.skipUnless(hasattr(resource, 'prlimit'), 'no prlimit')
+    @support.requires_linux_version(2, 6, 36)
+    def test_prlimit(self):
+        self.assertRaises(TypeError, resource.prlimit)
+        if os.geteuid() != 0:
+            self.assertRaises(PermissionError, resource.prlimit,
+                              1, resource.RLIMIT_AS)
+        self.assertRaises(ProcessLookupError, resource.prlimit,
+                          -1, resource.RLIMIT_AS)
+        limit = resource.getrlimit(resource.RLIMIT_AS)
+        self.assertEqual(resource.prlimit(0, resource.RLIMIT_AS), limit)
+        self.assertEqual(resource.prlimit(0, resource.RLIMIT_AS, limit),
+                         limit)
+
+
 def test_main(verbose=None):
     support.run_unittest(ResourceTest)
 
diff --git a/Lib/test/test_robotparser.py b/Lib/test/test_robotparser.py
index ebc819c..d01266f 100644
--- a/Lib/test/test_robotparser.py
+++ b/Lib/test/test_robotparser.py
@@ -4,6 +4,12 @@
 from urllib.error import URLError, HTTPError
 from urllib.request import urlopen
 from test import support
+from http.server import BaseHTTPRequestHandler, HTTPServer
+try:
+    import threading
+except ImportError:
+    threading = None
+
 
 class RobotTestCase(unittest.TestCase):
     def __init__(self, index=None, parser=None, url=None, good=None, agent=None):
@@ -247,33 +253,52 @@
 RobotTest(16, doc, good, bad)
 
 
-class NetworkTestCase(unittest.TestCase):
+class RobotHandler(BaseHTTPRequestHandler):
+
+    def do_GET(self):
+        self.send_error(403, "Forbidden access")
+
+    def log_message(self, format, *args):
+        pass
+
+
+@unittest.skipUnless(threading, 'threading required for this test')
+class PasswordProtectedSiteTestCase(unittest.TestCase):
+
+    def setUp(self):
+        self.server = HTTPServer((support.HOST, 0), RobotHandler)
+
+        self.t = threading.Thread(
+            name='HTTPServer serving',
+            target=self.server.serve_forever,
+            # Short poll interval to make the test finish quickly.
+            # Time between requests is short enough that we won't wake
+            # up spuriously too many times.
+            kwargs={'poll_interval':0.01})
+        self.t.daemon = True  # In case this function raises.
+        self.t.start()
+
+    def tearDown(self):
+        self.server.shutdown()
+        self.t.join()
+        self.server.server_close()
+
+    def runTest(self):
+        self.testPasswordProtectedSite()
 
     def testPasswordProtectedSite(self):
-        support.requires('network')
-        with support.transient_internet('mueblesmoraleda.com'):
-            url = 'http://mueblesmoraleda.com'
-            robots_url = url + "/robots.txt"
-            # First check the URL is usable for our purposes, since the
-            # test site is a bit flaky.
-            try:
-                urlopen(robots_url)
-            except HTTPError as e:
-                if e.code not in {401, 403}:
-                    self.skipTest(
-                        "%r should return a 401 or 403 HTTP error, not %r"
-                        % (robots_url, e.code))
-            else:
-                self.skipTest(
-                    "%r should return a 401 or 403 HTTP error, not succeed"
-                    % (robots_url))
-            parser = urllib.robotparser.RobotFileParser()
-            parser.set_url(url)
-            try:
-                parser.read()
-            except URLError:
-                self.skipTest('%s is unavailable' % url)
-            self.assertEqual(parser.can_fetch("*", robots_url), False)
+        addr = self.server.server_address
+        url = 'http://' + support.HOST + ':' + str(addr[1])
+        robots_url = url + "/robots.txt"
+        parser = urllib.robotparser.RobotFileParser()
+        parser.set_url(url)
+        parser.read()
+        self.assertFalse(parser.can_fetch("*", robots_url))
+
+    def __str__(self):
+        return '%s' % self.__class__.__name__
+
+class NetworkTestCase(unittest.TestCase):
 
     @unittest.skip('does not handle the gzip encoding delivered by pydotorg')
     def testPythonOrg(self):
@@ -288,8 +313,8 @@
 def load_tests(loader, suite, pattern):
     suite = unittest.makeSuite(NetworkTestCase)
     suite.addTest(tests)
+    suite.addTest(PasswordProtectedSiteTestCase())
     return suite
 
 if __name__=='__main__':
-    support.use_resources = ['network']
     unittest.main()
diff --git a/Lib/test/test_runpy.py b/Lib/test/test_runpy.py
index 2ddba34..786b813 100644
--- a/Lib/test/test_runpy.py
+++ b/Lib/test/test_runpy.py
@@ -5,7 +5,7 @@
 import sys
 import re
 import tempfile
-import importlib
+import importlib, importlib.machinery, importlib.util
 import py_compile
 from test.support import (
     forget, make_legacy_pyc, run_unittest, unload, verbose, no_tracing,
@@ -47,6 +47,7 @@
     "__cached__": None,
     "__package__": None,
     "__doc__": None,
+    "__spec__": None
 }
 example_namespace =  {
     "sys": sys,
@@ -67,11 +68,19 @@
     # testing occurs at those upper layers as well, not just at the utility
     # layer
 
+    # Figuring out the loader details in advance is hard to do, so we skip
+    # checking the full details of loader and loader_state
+    CHECKED_SPEC_ATTRIBUTES = ["name", "parent", "origin", "cached",
+                               "has_location", "submodule_search_locations"]
+
     def assertNamespaceMatches(self, result_ns, expected_ns):
         """Check two namespaces match.
 
            Ignores any unspecified interpreter created names
         """
+        # Avoid side effects
+        result_ns = result_ns.copy()
+        expected_ns = expected_ns.copy()
         # Impls are permitted to add extra names, so filter them out
         for k in list(result_ns):
             if k.startswith("__") and k.endswith("__"):
@@ -79,7 +88,25 @@
                     result_ns.pop(k)
                 if k not in expected_ns["nested"]:
                     result_ns["nested"].pop(k)
-        # Don't use direct dict comparison - the diffs are too hard to debug
+        # Spec equality includes the loader, so we take the spec out of the
+        # result namespace and check that separately
+        result_spec = result_ns.pop("__spec__")
+        expected_spec = expected_ns.pop("__spec__")
+        if expected_spec is None:
+            self.assertIsNone(result_spec)
+        else:
+            # If an expected loader is set, we just check we got the right
+            # type, rather than checking for full equality
+            if expected_spec.loader is not None:
+                self.assertEqual(type(result_spec.loader),
+                                 type(expected_spec.loader))
+            for attr in self.CHECKED_SPEC_ATTRIBUTES:
+                k = "__spec__." + attr
+                actual = (k, getattr(result_spec, attr))
+                expected = (k, getattr(expected_spec, attr))
+                self.assertEqual(actual, expected)
+        # For the rest, we still don't use direct dict comparison on the
+        # namespace, as the diffs are too hard to debug if anything breaks
         self.assertEqual(set(result_ns), set(expected_ns))
         for k in result_ns:
             actual = (k, result_ns[k])
@@ -130,12 +157,16 @@
         mod_fname = "Some other nonsense"
         mod_loader = "Now you're just being silly"
         mod_package = '' # Treat as a top level module
+        mod_spec = importlib.machinery.ModuleSpec(mod_name,
+                                                  origin=mod_fname,
+                                                  loader=mod_loader)
         expected_ns = example_namespace.copy()
         expected_ns.update({
             "__name__": mod_name,
             "__file__": mod_fname,
             "__loader__": mod_loader,
             "__package__": mod_package,
+            "__spec__": mod_spec,
             "run_argv0": mod_fname,
             "run_name_in_sys_modules": True,
             "module_in_sys_modules": True,
@@ -144,9 +175,7 @@
             return _run_module_code(example_source,
                                     init_globals,
                                     mod_name,
-                                    mod_fname,
-                                    mod_loader,
-                                    mod_package)
+                                    mod_spec)
         self.check_code_execution(create_ns, expected_ns)
 
 # TODO: Use self.addCleanup to get rid of a lot of try-finally blocks
@@ -176,31 +205,43 @@
     def test_library_module(self):
         self.assertEqual(run_module("runpy")["__name__"], "runpy")
 
-    def _add_pkg_dir(self, pkg_dir):
+    def _add_pkg_dir(self, pkg_dir, namespace=False):
         os.mkdir(pkg_dir)
+        if namespace:
+            return None
         pkg_fname = os.path.join(pkg_dir, "__init__.py")
         create_empty_file(pkg_fname)
         return pkg_fname
 
-    def _make_pkg(self, source, depth, mod_base="runpy_test"):
+    def _make_pkg(self, source, depth, mod_base="runpy_test",
+                     *, namespace=False, parent_namespaces=False):
+        # Enforce a couple of internal sanity checks on test cases
+        if (namespace or parent_namespaces) and not depth:
+            raise RuntimeError("Can't mark top level module as a "
+                               "namespace package")
         pkg_name = "__runpy_pkg__"
         test_fname = mod_base+os.extsep+"py"
         pkg_dir = sub_dir = os.path.realpath(tempfile.mkdtemp())
         if verbose > 1: print("  Package tree in:", sub_dir)
         sys.path.insert(0, pkg_dir)
         if verbose > 1: print("  Updated sys.path:", sys.path[0])
-        for i in range(depth):
-            sub_dir = os.path.join(sub_dir, pkg_name)
-            pkg_fname = self._add_pkg_dir(sub_dir)
-            if verbose > 1: print("  Next level in:", sub_dir)
-            if verbose > 1: print("  Created:", pkg_fname)
+        if depth:
+            namespace_flags = [parent_namespaces] * depth
+            namespace_flags[-1] = namespace
+            for namespace_flag in namespace_flags:
+                sub_dir = os.path.join(sub_dir, pkg_name)
+                pkg_fname = self._add_pkg_dir(sub_dir, namespace_flag)
+                if verbose > 1: print("  Next level in:", sub_dir)
+                if verbose > 1: print("  Created:", pkg_fname)
         mod_fname = os.path.join(sub_dir, test_fname)
         mod_file = open(mod_fname, "w")
         mod_file.write(source)
         mod_file.close()
         if verbose > 1: print("  Created:", mod_fname)
         mod_name = (pkg_name+".")*depth + mod_base
-        return pkg_dir, mod_fname, mod_name
+        mod_spec = importlib.util.spec_from_file_location(mod_name,
+                                                          mod_fname)
+        return pkg_dir, mod_fname, mod_name, mod_spec
 
     def _del_pkg(self, top, depth, mod_name):
         for entry in list(sys.modules):
@@ -230,19 +271,29 @@
     def _fix_ns_for_legacy_pyc(self, ns, alter_sys):
         char_to_add = "c" if __debug__ else "o"
         ns["__file__"] += char_to_add
+        ns["__cached__"] = ns["__file__"]
+        spec = ns["__spec__"]
+        new_spec = importlib.util.spec_from_file_location(spec.name,
+                                                          ns["__file__"])
+        ns["__spec__"] = new_spec
         if alter_sys:
             ns["run_argv0"] += char_to_add
 
 
-    def _check_module(self, depth, alter_sys=False):
-        pkg_dir, mod_fname, mod_name = (
-               self._make_pkg(example_source, depth))
+    def _check_module(self, depth, alter_sys=False,
+                         *, namespace=False, parent_namespaces=False):
+        pkg_dir, mod_fname, mod_name, mod_spec = (
+               self._make_pkg(example_source, depth,
+                              namespace=namespace,
+                              parent_namespaces=parent_namespaces))
         forget(mod_name)
         expected_ns = example_namespace.copy()
         expected_ns.update({
             "__name__": mod_name,
             "__file__": mod_fname,
+            "__cached__": mod_spec.cached,
             "__package__": mod_name.rpartition(".")[0],
+            "__spec__": mod_spec,
         })
         if alter_sys:
             expected_ns.update({
@@ -269,16 +320,21 @@
             self._del_pkg(pkg_dir, depth, mod_name)
         if verbose > 1: print("Module executed successfully")
 
-    def _check_package(self, depth, alter_sys=False):
-        pkg_dir, mod_fname, mod_name = (
-               self._make_pkg(example_source, depth, "__main__"))
+    def _check_package(self, depth, alter_sys=False,
+                          *, namespace=False, parent_namespaces=False):
+        pkg_dir, mod_fname, mod_name, mod_spec = (
+               self._make_pkg(example_source, depth, "__main__",
+                              namespace=namespace,
+                              parent_namespaces=parent_namespaces))
         pkg_name = mod_name.rpartition(".")[0]
         forget(mod_name)
         expected_ns = example_namespace.copy()
         expected_ns.update({
             "__name__": mod_name,
             "__file__": mod_fname,
+            "__cached__": importlib.util.cache_from_source(mod_fname),
             "__package__": pkg_name,
+            "__spec__": mod_spec,
         })
         if alter_sys:
             expected_ns.update({
@@ -334,7 +390,7 @@
 from . import sibling
 from ..uncle.cousin import nephew
 """
-        pkg_dir, mod_fname, mod_name = (
+        pkg_dir, mod_fname, mod_name, mod_spec = (
                self._make_pkg(contents, depth))
         if run_name is None:
             expected_name = mod_name
@@ -373,11 +429,31 @@
             if verbose > 1: print("Testing package depth:", depth)
             self._check_module(depth)
 
+    def test_run_module_in_namespace_package(self):
+        for depth in range(1, 4):
+            if verbose > 1: print("Testing package depth:", depth)
+            self._check_module(depth, namespace=True, parent_namespaces=True)
+
     def test_run_package(self):
         for depth in range(1, 4):
             if verbose > 1: print("Testing package depth:", depth)
             self._check_package(depth)
 
+    def test_run_package_in_namespace_package(self):
+        for depth in range(1, 4):
+            if verbose > 1: print("Testing package depth:", depth)
+            self._check_package(depth, parent_namespaces=True)
+
+    def test_run_namespace_package(self):
+        for depth in range(1, 4):
+            if verbose > 1: print("Testing package depth:", depth)
+            self._check_package(depth, namespace=True)
+
+    def test_run_namespace_package_in_namespace_package(self):
+        for depth in range(1, 4):
+            if verbose > 1: print("Testing package depth:", depth)
+            self._check_package(depth, namespace=True, parent_namespaces=True)
+
     def test_run_module_alter_sys(self):
         for depth in range(4):
             if verbose > 1: print("Testing package depth:", depth)
@@ -401,14 +477,16 @@
     def test_run_name(self):
         depth = 1
         run_name = "And now for something completely different"
-        pkg_dir, mod_fname, mod_name = (
+        pkg_dir, mod_fname, mod_name, mod_spec = (
                self._make_pkg(example_source, depth))
         forget(mod_name)
         expected_ns = example_namespace.copy()
         expected_ns.update({
             "__name__": run_name,
             "__file__": mod_fname,
+            "__cached__": importlib.util.cache_from_source(mod_fname),
             "__package__": mod_name.rpartition(".")[0],
+            "__spec__": mod_spec,
         })
         def create_ns(init_globals):
             return run_module(mod_name, init_globals, run_name)
@@ -437,7 +515,7 @@
         pkg_name = ".".join([base_name] * max_depth)
         expected_packages.add(pkg_name)
         expected_modules.add(pkg_name + ".runpy_test")
-        pkg_dir, mod_fname, mod_name = (
+        pkg_dir, mod_fname, mod_name, mod_spec = (
                self._make_pkg("", max_depth))
         self.addCleanup(self._del_pkg, pkg_dir, max_depth, mod_name)
         for depth in range(2, max_depth+1):
@@ -455,21 +533,39 @@
 class RunPathTestCase(unittest.TestCase, CodeExecutionMixin):
     """Unit tests for runpy.run_path"""
 
-    def _make_test_script(self, script_dir, script_basename, source=None):
+    def _make_test_script(self, script_dir, script_basename,
+                          source=None, omit_suffix=False):
         if source is None:
             source = example_source
-        return make_script(script_dir, script_basename, source)
+        return make_script(script_dir, script_basename,
+                           source, omit_suffix)
 
     def _check_script(self, script_name, expected_name, expected_file,
-                            expected_argv0):
+                            expected_argv0, mod_name=None,
+                            expect_spec=True, check_loader=True):
         # First check is without run_name
         def create_ns(init_globals):
             return run_path(script_name, init_globals)
         expected_ns = example_namespace.copy()
+        if mod_name is None:
+            spec_name = expected_name
+        else:
+            spec_name = mod_name
+        if expect_spec:
+            mod_spec = importlib.util.spec_from_file_location(spec_name,
+                                                              expected_file)
+            mod_cached = mod_spec.cached
+            if not check_loader:
+                mod_spec.loader = None
+        else:
+            mod_spec = mod_cached = None
+
         expected_ns.update({
             "__name__": expected_name,
             "__file__": expected_file,
+            "__cached__": mod_cached,
             "__package__": "",
+            "__spec__": mod_spec,
             "run_argv0": expected_argv0,
             "run_name_in_sys_modules": True,
             "module_in_sys_modules": True,
@@ -479,6 +575,12 @@
         run_name = "prove.issue15230.is.fixed"
         def create_ns(init_globals):
             return run_path(script_name, init_globals, run_name)
+        if expect_spec and mod_name is None:
+            mod_spec = importlib.util.spec_from_file_location(run_name,
+                                                              expected_file)
+            if not check_loader:
+                mod_spec.loader = None
+            expected_ns["__spec__"] = mod_spec
         expected_ns["__name__"] = run_name
         expected_ns["__package__"] = run_name.rpartition(".")[0]
         self.check_code_execution(create_ns, expected_ns)
@@ -492,7 +594,15 @@
             mod_name = 'script'
             script_name = self._make_test_script(script_dir, mod_name)
             self._check_script(script_name, "<run_path>", script_name,
-                               script_name)
+                               script_name, expect_spec=False)
+
+    def test_basic_script_no_suffix(self):
+        with temp_dir() as script_dir:
+            mod_name = 'script'
+            script_name = self._make_test_script(script_dir, mod_name,
+                                                 omit_suffix=True)
+            self._check_script(script_name, "<run_path>", script_name,
+                               script_name, expect_spec=False)
 
     def test_script_compiled(self):
         with temp_dir() as script_dir:
@@ -501,14 +611,14 @@
             compiled_name = py_compile.compile(script_name, doraise=True)
             os.remove(script_name)
             self._check_script(compiled_name, "<run_path>", compiled_name,
-                               compiled_name)
+                               compiled_name, expect_spec=False)
 
     def test_directory(self):
         with temp_dir() as script_dir:
             mod_name = '__main__'
             script_name = self._make_test_script(script_dir, mod_name)
             self._check_script(script_dir, "<run_path>", script_name,
-                               script_dir)
+                               script_dir, mod_name=mod_name)
 
     def test_directory_compiled(self):
         with temp_dir() as script_dir:
@@ -519,7 +629,7 @@
             if not sys.dont_write_bytecode:
                 legacy_pyc = make_legacy_pyc(script_name)
                 self._check_script(script_dir, "<run_path>", legacy_pyc,
-                                   script_dir)
+                                   script_dir, mod_name=mod_name)
 
     def test_directory_error(self):
         with temp_dir() as script_dir:
@@ -533,7 +643,8 @@
             mod_name = '__main__'
             script_name = self._make_test_script(script_dir, mod_name)
             zip_name, fname = make_zip_script(script_dir, 'test_zip', script_name)
-            self._check_script(zip_name, "<run_path>", fname, zip_name)
+            self._check_script(zip_name, "<run_path>", fname, zip_name,
+                               mod_name=mod_name, check_loader=False)
 
     def test_zipfile_compiled(self):
         with temp_dir() as script_dir:
@@ -542,7 +653,8 @@
             compiled_name = py_compile.compile(script_name, doraise=True)
             zip_name, fname = make_zip_script(script_dir, 'test_zip',
                                               compiled_name)
-            self._check_script(zip_name, "<run_path>", fname, zip_name)
+            self._check_script(zip_name, "<run_path>", fname, zip_name,
+                               mod_name=mod_name, check_loader=False)
 
     def test_zipfile_error(self):
         with temp_dir() as script_dir:
@@ -575,12 +687,5 @@
             self.assertEqual(result['s'], "non-ASCII: h\xe9")
 
 
-def test_main():
-    run_unittest(
-                 ExecutionLayerTestCase,
-                 RunModuleTestCase,
-                 RunPathTestCase
-                 )
-
 if __name__ == "__main__":
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_sax.py b/Lib/test/test_sax.py
index cfa18f7..a6238b2 100644
--- a/Lib/test/test_sax.py
+++ b/Lib/test/test_sax.py
@@ -648,6 +648,30 @@
 
         self.assertEqual(result.getvalue(), xml_test_out)
 
+    def test_expat_binary_file_bytes_name(self):
+        fname = os.fsencode(TEST_XMLFILE)
+        parser = create_parser()
+        result = BytesIO()
+        xmlgen = XMLGenerator(result)
+
+        parser.setContentHandler(xmlgen)
+        with open(fname, 'rb') as f:
+            parser.parse(f)
+
+        self.assertEqual(result.getvalue(), xml_test_out)
+
+    def test_expat_binary_file_int_name(self):
+        parser = create_parser()
+        result = BytesIO()
+        xmlgen = XMLGenerator(result)
+
+        parser.setContentHandler(xmlgen)
+        with open(TEST_XMLFILE, 'rb') as f:
+            with open(f.fileno(), 'rb', closefd=False) as f2:
+                parser.parse(f2)
+
+        self.assertEqual(result.getvalue(), xml_test_out)
+
     # ===== DTDHandler support
 
     class TestDTDHandler:
diff --git a/Lib/test/test_sched.py b/Lib/test/test_sched.py
index 79fa7d3..fe8e785 100644
--- a/Lib/test/test_sched.py
+++ b/Lib/test/test_sched.py
@@ -195,8 +195,5 @@
         self.assertEqual(l, [])
 
 
-def test_main():
-    support.run_unittest(TestCase)
-
 if __name__ == "__main__":
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_scope.py b/Lib/test/test_scope.py
index 26ce042..b325545 100644
--- a/Lib/test/test_scope.py
+++ b/Lib/test/test_scope.py
@@ -715,6 +715,19 @@
         def b():
             global a
 
+    def testClassNamespaceOverridesClosure(self):
+        # See #17853.
+        x = 42
+        class X:
+            locals()["x"] = 43
+            y = x
+        self.assertEqual(X.y, 43)
+        class X:
+            locals()["x"] = 43
+            del x
+        self.assertFalse(hasattr(X, "x"))
+        self.assertEqual(x, 42)
+
     @cpython_only
     def testCellLeak(self):
         # Issue 17927.
@@ -743,10 +756,6 @@
         del tester
         self.assertIsNone(ref())
 
-    def test__Class__Global(self):
-        s = "class X:\n    global __class__\n    def f(self): super()"
-        self.assertRaises(SyntaxError, exec, s)
-
 
 def test_main():
     run_unittest(ScopeTests)
diff --git a/Lib/test/test_script_helper.py b/Lib/test/test_script_helper.py
new file mode 100755
index 0000000..ea73fd8
--- /dev/null
+++ b/Lib/test/test_script_helper.py
@@ -0,0 +1,35 @@
+"""Unittests for test.script_helper.  Who tests the test helper?"""
+
+from test import script_helper
+import unittest
+
+
+class TestScriptHelper(unittest.TestCase):
+    def test_assert_python_expect_success(self):
+        t = script_helper._assert_python(True, '-c', 'import sys; sys.exit(0)')
+        self.assertEqual(0, t[0], 'return code was not 0')
+
+    def test_assert_python_expect_failure(self):
+        # I didn't import the sys module so this child will fail.
+        rc, out, err = script_helper._assert_python(False, '-c', 'sys.exit(0)')
+        self.assertNotEqual(0, rc, 'return code should not be 0')
+
+    def test_assert_python_raises_expect_success(self):
+        # I didn't import the sys module so this child will fail.
+        with self.assertRaises(AssertionError) as error_context:
+            script_helper._assert_python(True, '-c', 'sys.exit(0)')
+        error_msg = str(error_context.exception)
+        self.assertIn('command line was:', error_msg)
+        self.assertIn('sys.exit(0)', error_msg, msg='unexpected command line')
+
+    def test_assert_python_raises_expect_failure(self):
+        with self.assertRaises(AssertionError) as error_context:
+            script_helper._assert_python(False, '-c', 'import sys; sys.exit(0)')
+        error_msg = str(error_context.exception)
+        self.assertIn('Process return code is 0,', error_msg)
+        self.assertIn('import sys; sys.exit(0)', error_msg,
+                      msg='unexpected command line.')
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Lib/test/test_select.py b/Lib/test/test_select.py
index ddb9a0f..8f9a1c9 100644
--- a/Lib/test/test_select.py
+++ b/Lib/test/test_select.py
@@ -5,7 +5,7 @@
 import unittest
 from test import support
 
-@unittest.skipIf(sys.platform[:3] in ('win', 'os2', 'riscos'),
+@unittest.skipIf((sys.platform[:3]=='win'),
                  "can't easily test on this system")
 class SelectTestCase(unittest.TestCase):
 
@@ -32,7 +32,7 @@
             fp.close()
             try:
                 select.select([fd], [], [], 0)
-            except select.error as err:
+            except OSError as err:
                 self.assertEqual(err.errno, errno.EBADF)
             else:
                 self.fail("exception not raised")
diff --git a/Lib/test/test_selectors.py b/Lib/test/test_selectors.py
new file mode 100644
index 0000000..952fda6
--- /dev/null
+++ b/Lib/test/test_selectors.py
@@ -0,0 +1,467 @@
+import errno
+import os
+import random
+import selectors
+import signal
+import socket
+import sys
+from test import support
+from time import sleep
+import unittest
+import unittest.mock
+try:
+    from time import monotonic as time
+except ImportError:
+    from time import time as time
+try:
+    import resource
+except ImportError:
+    resource = None
+
+
+if hasattr(socket, 'socketpair'):
+    socketpair = socket.socketpair
+else:
+    def socketpair(family=socket.AF_INET, type=socket.SOCK_STREAM, proto=0):
+        with socket.socket(family, type, proto) as l:
+            l.bind((support.HOST, 0))
+            l.listen(3)
+            c = socket.socket(family, type, proto)
+            try:
+                c.connect(l.getsockname())
+                caddr = c.getsockname()
+                while True:
+                    a, addr = l.accept()
+                    # check that we've got the correct client
+                    if addr == caddr:
+                        return c, a
+                    a.close()
+            except OSError:
+                c.close()
+                raise
+
+
+def find_ready_matching(ready, flag):
+    match = []
+    for key, events in ready:
+        if events & flag:
+            match.append(key.fileobj)
+    return match
+
+
+class BaseSelectorTestCase(unittest.TestCase):
+
+    def make_socketpair(self):
+        rd, wr = socketpair()
+        self.addCleanup(rd.close)
+        self.addCleanup(wr.close)
+        return rd, wr
+
+    def test_register(self):
+        s = self.SELECTOR()
+        self.addCleanup(s.close)
+
+        rd, wr = self.make_socketpair()
+
+        key = s.register(rd, selectors.EVENT_READ, "data")
+        self.assertIsInstance(key, selectors.SelectorKey)
+        self.assertEqual(key.fileobj, rd)
+        self.assertEqual(key.fd, rd.fileno())
+        self.assertEqual(key.events, selectors.EVENT_READ)
+        self.assertEqual(key.data, "data")
+
+        # register an unknown event
+        self.assertRaises(ValueError, s.register, 0, 999999)
+
+        # register an invalid FD
+        self.assertRaises(ValueError, s.register, -10, selectors.EVENT_READ)
+
+        # register twice
+        self.assertRaises(KeyError, s.register, rd, selectors.EVENT_READ)
+
+        # register the same FD, but with a different object
+        self.assertRaises(KeyError, s.register, rd.fileno(),
+                          selectors.EVENT_READ)
+
+    def test_unregister(self):
+        s = self.SELECTOR()
+        self.addCleanup(s.close)
+
+        rd, wr = self.make_socketpair()
+
+        s.register(rd, selectors.EVENT_READ)
+        s.unregister(rd)
+
+        # unregister an unknown file obj
+        self.assertRaises(KeyError, s.unregister, 999999)
+
+        # unregister twice
+        self.assertRaises(KeyError, s.unregister, rd)
+
+    def test_unregister_after_fd_close(self):
+        s = self.SELECTOR()
+        self.addCleanup(s.close)
+        rd, wr = self.make_socketpair()
+        r, w = rd.fileno(), wr.fileno()
+        s.register(r, selectors.EVENT_READ)
+        s.register(w, selectors.EVENT_WRITE)
+        rd.close()
+        wr.close()
+        s.unregister(r)
+        s.unregister(w)
+
+    @unittest.skipUnless(os.name == 'posix', "requires posix")
+    def test_unregister_after_fd_close_and_reuse(self):
+        s = self.SELECTOR()
+        self.addCleanup(s.close)
+        rd, wr = self.make_socketpair()
+        r, w = rd.fileno(), wr.fileno()
+        s.register(r, selectors.EVENT_READ)
+        s.register(w, selectors.EVENT_WRITE)
+        rd2, wr2 = self.make_socketpair()
+        rd.close()
+        wr.close()
+        os.dup2(rd2.fileno(), r)
+        os.dup2(wr2.fileno(), w)
+        self.addCleanup(os.close, r)
+        self.addCleanup(os.close, w)
+        s.unregister(r)
+        s.unregister(w)
+
+    def test_unregister_after_socket_close(self):
+        s = self.SELECTOR()
+        self.addCleanup(s.close)
+        rd, wr = self.make_socketpair()
+        s.register(rd, selectors.EVENT_READ)
+        s.register(wr, selectors.EVENT_WRITE)
+        rd.close()
+        wr.close()
+        s.unregister(rd)
+        s.unregister(wr)
+
+    def test_modify(self):
+        s = self.SELECTOR()
+        self.addCleanup(s.close)
+
+        rd, wr = self.make_socketpair()
+
+        key = s.register(rd, selectors.EVENT_READ)
+
+        # modify events
+        key2 = s.modify(rd, selectors.EVENT_WRITE)
+        self.assertNotEqual(key.events, key2.events)
+        self.assertEqual(key2, s.get_key(rd))
+
+        s.unregister(rd)
+
+        # modify data
+        d1 = object()
+        d2 = object()
+
+        key = s.register(rd, selectors.EVENT_READ, d1)
+        key2 = s.modify(rd, selectors.EVENT_READ, d2)
+        self.assertEqual(key.events, key2.events)
+        self.assertNotEqual(key.data, key2.data)
+        self.assertEqual(key2, s.get_key(rd))
+        self.assertEqual(key2.data, d2)
+
+        # modify unknown file obj
+        self.assertRaises(KeyError, s.modify, 999999, selectors.EVENT_READ)
+
+        # modify use a shortcut
+        d3 = object()
+        s.register = unittest.mock.Mock()
+        s.unregister = unittest.mock.Mock()
+
+        s.modify(rd, selectors.EVENT_READ, d3)
+        self.assertFalse(s.register.called)
+        self.assertFalse(s.unregister.called)
+
+    def test_close(self):
+        s = self.SELECTOR()
+        self.addCleanup(s.close)
+
+        mapping = s.get_map()
+        rd, wr = self.make_socketpair()
+
+        s.register(rd, selectors.EVENT_READ)
+        s.register(wr, selectors.EVENT_WRITE)
+
+        s.close()
+        self.assertRaises(KeyError, s.get_key, rd)
+        self.assertRaises(KeyError, s.get_key, wr)
+        self.assertRaises(KeyError, mapping.__getitem__, rd)
+        self.assertRaises(KeyError, mapping.__getitem__, wr)
+
+    def test_get_key(self):
+        s = self.SELECTOR()
+        self.addCleanup(s.close)
+
+        rd, wr = self.make_socketpair()
+
+        key = s.register(rd, selectors.EVENT_READ, "data")
+        self.assertEqual(key, s.get_key(rd))
+
+        # unknown file obj
+        self.assertRaises(KeyError, s.get_key, 999999)
+
+    def test_get_map(self):
+        s = self.SELECTOR()
+        self.addCleanup(s.close)
+
+        rd, wr = self.make_socketpair()
+
+        keys = s.get_map()
+        self.assertFalse(keys)
+        self.assertEqual(len(keys), 0)
+        self.assertEqual(list(keys), [])
+        key = s.register(rd, selectors.EVENT_READ, "data")
+        self.assertIn(rd, keys)
+        self.assertEqual(key, keys[rd])
+        self.assertEqual(len(keys), 1)
+        self.assertEqual(list(keys), [rd.fileno()])
+        self.assertEqual(list(keys.values()), [key])
+
+        # unknown file obj
+        with self.assertRaises(KeyError):
+            keys[999999]
+
+        # Read-only mapping
+        with self.assertRaises(TypeError):
+            del keys[rd]
+
+    def test_select(self):
+        s = self.SELECTOR()
+        self.addCleanup(s.close)
+
+        rd, wr = self.make_socketpair()
+
+        s.register(rd, selectors.EVENT_READ)
+        wr_key = s.register(wr, selectors.EVENT_WRITE)
+
+        result = s.select()
+        for key, events in result:
+            self.assertTrue(isinstance(key, selectors.SelectorKey))
+            self.assertTrue(events)
+            self.assertFalse(events & ~(selectors.EVENT_READ |
+                                        selectors.EVENT_WRITE))
+
+        self.assertEqual([(wr_key, selectors.EVENT_WRITE)], result)
+
+    def test_context_manager(self):
+        s = self.SELECTOR()
+        self.addCleanup(s.close)
+
+        rd, wr = self.make_socketpair()
+
+        with s as sel:
+            sel.register(rd, selectors.EVENT_READ)
+            sel.register(wr, selectors.EVENT_WRITE)
+
+        self.assertRaises(KeyError, s.get_key, rd)
+        self.assertRaises(KeyError, s.get_key, wr)
+
+    def test_fileno(self):
+        s = self.SELECTOR()
+        self.addCleanup(s.close)
+
+        if hasattr(s, 'fileno'):
+            fd = s.fileno()
+            self.assertTrue(isinstance(fd, int))
+            self.assertGreaterEqual(fd, 0)
+
+    def test_selector(self):
+        s = self.SELECTOR()
+        self.addCleanup(s.close)
+
+        NUM_SOCKETS = 12
+        MSG = b" This is a test."
+        MSG_LEN = len(MSG)
+        readers = []
+        writers = []
+        r2w = {}
+        w2r = {}
+
+        for i in range(NUM_SOCKETS):
+            rd, wr = self.make_socketpair()
+            s.register(rd, selectors.EVENT_READ)
+            s.register(wr, selectors.EVENT_WRITE)
+            readers.append(rd)
+            writers.append(wr)
+            r2w[rd] = wr
+            w2r[wr] = rd
+
+        bufs = []
+
+        while writers:
+            ready = s.select()
+            ready_writers = find_ready_matching(ready, selectors.EVENT_WRITE)
+            if not ready_writers:
+                self.fail("no sockets ready for writing")
+            wr = random.choice(ready_writers)
+            wr.send(MSG)
+
+            for i in range(10):
+                ready = s.select()
+                ready_readers = find_ready_matching(ready,
+                                                    selectors.EVENT_READ)
+                if ready_readers:
+                    break
+                # there might be a delay between the write to the write end and
+                # the read end is reported ready
+                sleep(0.1)
+            else:
+                self.fail("no sockets ready for reading")
+            self.assertEqual([w2r[wr]], ready_readers)
+            rd = ready_readers[0]
+            buf = rd.recv(MSG_LEN)
+            self.assertEqual(len(buf), MSG_LEN)
+            bufs.append(buf)
+            s.unregister(r2w[rd])
+            s.unregister(rd)
+            writers.remove(r2w[rd])
+
+        self.assertEqual(bufs, [MSG] * NUM_SOCKETS)
+
+    @unittest.skipIf(sys.platform == 'win32',
+                     'select.select() cannot be used with empty fd sets')
+    def test_empty_select(self):
+        # Issue #23009: Make sure EpollSelector.select() works when no FD is
+        # registered.
+        s = self.SELECTOR()
+        self.addCleanup(s.close)
+        self.assertEqual(s.select(timeout=0), [])
+
+    def test_timeout(self):
+        s = self.SELECTOR()
+        self.addCleanup(s.close)
+
+        rd, wr = self.make_socketpair()
+
+        s.register(wr, selectors.EVENT_WRITE)
+        t = time()
+        self.assertEqual(1, len(s.select(0)))
+        self.assertEqual(1, len(s.select(-1)))
+        self.assertLess(time() - t, 0.5)
+
+        s.unregister(wr)
+        s.register(rd, selectors.EVENT_READ)
+        t = time()
+        self.assertFalse(s.select(0))
+        self.assertFalse(s.select(-1))
+        self.assertLess(time() - t, 0.5)
+
+        t0 = time()
+        self.assertFalse(s.select(1))
+        t1 = time()
+        dt = t1 - t0
+        # Tolerate 2.0 seconds for very slow buildbots
+        self.assertTrue(0.8 <= dt <= 2.0, dt)
+
+    @unittest.skipUnless(hasattr(signal, "alarm"),
+                         "signal.alarm() required for this test")
+    def test_select_interrupt(self):
+        s = self.SELECTOR()
+        self.addCleanup(s.close)
+
+        rd, wr = self.make_socketpair()
+
+        orig_alrm_handler = signal.signal(signal.SIGALRM, lambda *args: None)
+        self.addCleanup(signal.signal, signal.SIGALRM, orig_alrm_handler)
+        self.addCleanup(signal.alarm, 0)
+
+        signal.alarm(1)
+
+        s.register(rd, selectors.EVENT_READ)
+        t = time()
+        self.assertFalse(s.select(2))
+        self.assertLess(time() - t, 2.5)
+
+
+class ScalableSelectorMixIn:
+
+    # see issue #18963 for why it's skipped on older OS X versions
+    @support.requires_mac_ver(10, 5)
+    @unittest.skipUnless(resource, "Test needs resource module")
+    def test_above_fd_setsize(self):
+        # A scalable implementation should have no problem with more than
+        # FD_SETSIZE file descriptors. Since we don't know the value, we just
+        # try to set the soft RLIMIT_NOFILE to the hard RLIMIT_NOFILE ceiling.
+        soft, hard = resource.getrlimit(resource.RLIMIT_NOFILE)
+        try:
+            resource.setrlimit(resource.RLIMIT_NOFILE, (hard, hard))
+            self.addCleanup(resource.setrlimit, resource.RLIMIT_NOFILE,
+                            (soft, hard))
+            NUM_FDS = min(hard, 2**16)
+        except (OSError, ValueError):
+            NUM_FDS = soft
+
+        # guard for already allocated FDs (stdin, stdout...)
+        NUM_FDS -= 32
+
+        s = self.SELECTOR()
+        self.addCleanup(s.close)
+
+        for i in range(NUM_FDS // 2):
+            try:
+                rd, wr = self.make_socketpair()
+            except OSError:
+                # too many FDs, skip - note that we should only catch EMFILE
+                # here, but apparently *BSD and Solaris can fail upon connect()
+                # or bind() with EADDRNOTAVAIL, so let's be safe
+                self.skipTest("FD limit reached")
+
+            try:
+                s.register(rd, selectors.EVENT_READ)
+                s.register(wr, selectors.EVENT_WRITE)
+            except OSError as e:
+                if e.errno == errno.ENOSPC:
+                    # this can be raised by epoll if we go over
+                    # fs.epoll.max_user_watches sysctl
+                    self.skipTest("FD limit reached")
+                raise
+
+        self.assertEqual(NUM_FDS // 2, len(s.select()))
+
+
+class DefaultSelectorTestCase(BaseSelectorTestCase):
+
+    SELECTOR = selectors.DefaultSelector
+
+
+class SelectSelectorTestCase(BaseSelectorTestCase):
+
+    SELECTOR = selectors.SelectSelector
+
+
+@unittest.skipUnless(hasattr(selectors, 'PollSelector'),
+                     "Test needs selectors.PollSelector")
+class PollSelectorTestCase(BaseSelectorTestCase, ScalableSelectorMixIn):
+
+    SELECTOR = getattr(selectors, 'PollSelector', None)
+
+
+@unittest.skipUnless(hasattr(selectors, 'EpollSelector'),
+                     "Test needs selectors.EpollSelector")
+class EpollSelectorTestCase(BaseSelectorTestCase, ScalableSelectorMixIn):
+
+    SELECTOR = getattr(selectors, 'EpollSelector', None)
+
+
+@unittest.skipUnless(hasattr(selectors, 'KqueueSelector'),
+                     "Test needs selectors.KqueueSelector)")
+class KqueueSelectorTestCase(BaseSelectorTestCase, ScalableSelectorMixIn):
+
+    SELECTOR = getattr(selectors, 'KqueueSelector', None)
+
+
+def test_main():
+    tests = [DefaultSelectorTestCase, SelectSelectorTestCase,
+             PollSelectorTestCase, EpollSelectorTestCase,
+             KqueueSelectorTestCase]
+    support.run_unittest(*tests)
+    support.reap_children()
+
+
+if __name__ == "__main__":
+    test_main()
diff --git a/Lib/test/test_set.py b/Lib/test/test_set.py
index c0bca2f..65e4243 100644
--- a/Lib/test/test_set.py
+++ b/Lib/test/test_set.py
@@ -231,29 +231,30 @@
             self.assertEqual(self.s, dup, "%s != %s" % (self.s, dup))
             if type(self.s) not in (set, frozenset):
                 self.s.x = 10
-                p = pickle.dumps(self.s)
+                p = pickle.dumps(self.s, i)
                 dup = pickle.loads(p)
                 self.assertEqual(self.s.x, dup.x)
 
     def test_iterator_pickling(self):
-        itorg = iter(self.s)
-        data = self.thetype(self.s)
-        d = pickle.dumps(itorg)
-        it = pickle.loads(d)
-        # Set iterators unpickle as list iterators due to the
-        # undefined order of set items.
-        # self.assertEqual(type(itorg), type(it))
-        self.assertTrue(isinstance(it, collections.abc.Iterator))
-        self.assertEqual(self.thetype(it), data)
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            itorg = iter(self.s)
+            data = self.thetype(self.s)
+            d = pickle.dumps(itorg, proto)
+            it = pickle.loads(d)
+            # Set iterators unpickle as list iterators due to the
+            # undefined order of set items.
+            # self.assertEqual(type(itorg), type(it))
+            self.assertIsInstance(it, collections.abc.Iterator)
+            self.assertEqual(self.thetype(it), data)
 
-        it = pickle.loads(d)
-        try:
-            drop = next(it)
-        except StopIteration:
-            return
-        d = pickle.dumps(it)
-        it = pickle.loads(d)
-        self.assertEqual(self.thetype(it), data - self.thetype((drop,)))
+            it = pickle.loads(d)
+            try:
+                drop = next(it)
+            except StopIteration:
+                continue
+            d = pickle.dumps(it, proto)
+            it = pickle.loads(d)
+            self.assertEqual(self.thetype(it), data - self.thetype((drop,)))
 
     def test_deepcopy(self):
         class Tracer:
@@ -848,15 +849,14 @@
         for v in self.set:
             self.assertIn(v, self.values)
         setiter = iter(self.set)
-        # note: __length_hint__ is an internal undocumented API,
-        # don't rely on it in your own programs
         self.assertEqual(setiter.__length_hint__(), len(self.set))
 
     def test_pickling(self):
-        p = pickle.dumps(self.set)
-        copy = pickle.loads(p)
-        self.assertEqual(self.set, copy,
-                         "%s != %s" % (self.set, copy))
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            p = pickle.dumps(self.set, proto)
+            copy = pickle.loads(p)
+            self.assertEqual(self.set, copy,
+                             "%s != %s" % (self.set, copy))
 
 #------------------------------------------------------------------------------
 
diff --git a/Lib/test/test_shelve.py b/Lib/test/test_shelve.py
index 13c1265..bd51d86 100644
--- a/Lib/test/test_shelve.py
+++ b/Lib/test/test_shelve.py
@@ -148,6 +148,19 @@
         p2 = d[encodedkey]
         self.assertNotEqual(p1, p2)  # Write creates new object in store
 
+    def test_with(self):
+        d1 = {}
+        with shelve.Shelf(d1, protocol=2, writeback=False) as s:
+            s['key1'] = [1,2,3,4]
+            self.assertEqual(s['key1'], [1,2,3,4])
+            self.assertEqual(len(s), 1)
+        self.assertRaises(ValueError, len, s)
+        try:
+            s['key1']
+        except ValueError:
+            pass
+        else:
+            self.fail('Closed shelf should not find a key')
 
 from test import mapping_tests
 
diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py
index c3fb8a7..9325bc7 100644
--- a/Lib/test/test_shutil.py
+++ b/Lib/test/test_shutil.py
@@ -1,6 +1,7 @@
 # Copyright (C) 2003 Python Software Foundation
 
 import unittest
+import unittest.mock
 import shutil
 import tempfile
 import sys
@@ -10,6 +11,7 @@
 import errno
 import functools
 import subprocess
+from contextlib import ExitStack
 from test import support
 from test.support import TESTFN
 from os.path import splitdrive
@@ -18,7 +20,8 @@
                     register_archive_format, unregister_archive_format,
                     get_archive_formats, Error, unpack_archive,
                     register_unpack_format, RegistryError,
-                    unregister_unpack_format, get_unpack_formats)
+                    unregister_unpack_format, get_unpack_formats,
+                    SameFileError)
 import tarfile
 import warnings
 
@@ -115,7 +118,9 @@
         write_file(os.path.join(victim, 'somefile'), 'foo')
         victim = os.fsencode(victim)
         self.assertIsInstance(victim, bytes)
-        shutil.rmtree(victim)
+        win = (os.name == 'nt')
+        with self.assertWarns(DeprecationWarning) if win else ExitStack():
+            shutil.rmtree(victim)
 
     @support.skip_unless_symlink
     def test_rmtree_fails_on_symlink(self):
@@ -746,13 +751,27 @@
         shutil.copytree(src_dir, dst_dir)
         self.assertEqual(os.stat(src_dir).st_mode, os.stat(dst_dir).st_mode)
         self.assertEqual(os.stat(os.path.join(src_dir, 'permissive.txt')).st_mode,
-                         os.stat(os.path.join(dst_dir, 'permissive.txt')).st_mode)
+                          os.stat(os.path.join(dst_dir, 'permissive.txt')).st_mode)
         self.assertEqual(os.stat(os.path.join(src_dir, 'restrictive.txt')).st_mode,
-                         os.stat(os.path.join(dst_dir, 'restrictive.txt')).st_mode)
+                          os.stat(os.path.join(dst_dir, 'restrictive.txt')).st_mode)
         restrictive_subdir_dst = os.path.join(dst_dir,
                                               os.path.split(restrictive_subdir)[1])
         self.assertEqual(os.stat(restrictive_subdir).st_mode,
-                         os.stat(restrictive_subdir_dst).st_mode)
+                          os.stat(restrictive_subdir_dst).st_mode)
+
+    @unittest.mock.patch('os.chmod')
+    def test_copytree_winerror(self, mock_patch):
+        # When copying to VFAT, copystat() raises OSError. On Windows, the
+        # exception object has a meaningful 'winerror' attribute, but not
+        # on other operating systems. Do not assume 'winerror' is set.
+        src_dir = tempfile.mkdtemp()
+        dst_dir = os.path.join(tempfile.mkdtemp(), 'destination')
+        self.addCleanup(shutil.rmtree, src_dir)
+        self.addCleanup(shutil.rmtree, os.path.dirname(dst_dir))
+
+        mock_patch.side_effect = PermissionError('ka-boom')
+        with self.assertRaises(shutil.Error):
+            shutil.copytree(src_dir, dst_dir)
 
     @unittest.skipIf(os.name == 'nt', 'temporarily disabled on Windows')
     @unittest.skipUnless(hasattr(os, 'link'), 'requires os.link')
@@ -765,7 +784,7 @@
             with open(src, 'w') as f:
                 f.write('cheddar')
             os.link(src, dst)
-            self.assertRaises(shutil.Error, shutil.copyfile, src, dst)
+            self.assertRaises(shutil.SameFileError, shutil.copyfile, src, dst)
             with open(src, 'r') as f:
                 self.assertEqual(f.read(), 'cheddar')
             os.remove(dst)
@@ -785,7 +804,7 @@
             # to TESTFN/TESTFN/cheese, while it should point at
             # TESTFN/cheese.
             os.symlink('cheese', dst)
-            self.assertRaises(shutil.Error, shutil.copyfile, src, dst)
+            self.assertRaises(shutil.SameFileError, shutil.copyfile, src, dst)
             with open(src, 'r') as f:
                 self.assertEqual(f.read(), 'cheddar')
             os.remove(dst)
@@ -1122,6 +1141,21 @@
         finally:
             unregister_archive_format('xxx')
 
+    def test_make_tarfile_in_curdir(self):
+        # Issue #21280
+        root_dir = self.mkdtemp()
+        with support.change_cwd(root_dir):
+            self.assertEqual(make_archive('test', 'tar'), 'test.tar')
+            self.assertTrue(os.path.isfile('test.tar'))
+
+    @requires_zlib
+    def test_make_zipfile_in_curdir(self):
+        # Issue #21280
+        root_dir = self.mkdtemp()
+        with support.change_cwd(root_dir):
+            self.assertEqual(make_archive('test', 'zip'), 'test.zip')
+            self.assertTrue(os.path.isfile('test.zip'))
+
     def test_register_archive_format(self):
 
         self.assertRaises(TypeError, register_archive_format, 'xxx', 1)
@@ -1293,6 +1327,16 @@
         self.assertTrue(os.path.exists(rv))
         self.assertEqual(read_file(src_file), read_file(dst_file))
 
+    def test_copyfile_same_file(self):
+        # copyfile() should raise SameFileError if the source and destination
+        # are the same.
+        src_dir = self.mkdtemp()
+        src_file = os.path.join(src_dir, 'foo')
+        write_file(src_file, 'foo')
+        self.assertRaises(SameFileError, shutil.copyfile, src_file, src_file)
+        # But Error should work too, to stay backward compatible.
+        self.assertRaises(Error, shutil.copyfile, src_file, src_file)
+
     def test_copytree_return_value(self):
         # copytree returns its destination path.
         src_dir = self.mkdtemp()
@@ -1601,7 +1645,7 @@
             self._exited_with = exc_type, exc_val, exc_tb
             if self._raise_in_exit:
                 self._raised = True
-                raise IOError("Cannot close")
+                raise OSError("Cannot close")
             return self._suppress_at_exit
 
     def tearDown(self):
@@ -1615,12 +1659,12 @@
     def test_w_source_open_fails(self):
         def _open(filename, mode='r'):
             if filename == 'srcfile':
-                raise IOError('Cannot open "srcfile"')
+                raise OSError('Cannot open "srcfile"')
             assert 0  # shouldn't reach here.
 
         self._set_shutil_open(_open)
 
-        self.assertRaises(IOError, shutil.copyfile, 'srcfile', 'destfile')
+        self.assertRaises(OSError, shutil.copyfile, 'srcfile', 'destfile')
 
     def test_w_dest_open_fails(self):
 
@@ -1630,14 +1674,14 @@
             if filename == 'srcfile':
                 return srcfile
             if filename == 'destfile':
-                raise IOError('Cannot open "destfile"')
+                raise OSError('Cannot open "destfile"')
             assert 0  # shouldn't reach here.
 
         self._set_shutil_open(_open)
 
         shutil.copyfile('srcfile', 'destfile')
         self.assertTrue(srcfile._entered)
-        self.assertTrue(srcfile._exited_with[0] is IOError)
+        self.assertTrue(srcfile._exited_with[0] is OSError)
         self.assertEqual(srcfile._exited_with[1].args,
                          ('Cannot open "destfile"',))
 
@@ -1659,7 +1703,7 @@
         self.assertTrue(srcfile._entered)
         self.assertTrue(destfile._entered)
         self.assertTrue(destfile._raised)
-        self.assertTrue(srcfile._exited_with[0] is IOError)
+        self.assertTrue(srcfile._exited_with[0] is OSError)
         self.assertEqual(srcfile._exited_with[1].args,
                          ('Cannot close',))
 
@@ -1677,7 +1721,7 @@
 
         self._set_shutil_open(_open)
 
-        self.assertRaises(IOError,
+        self.assertRaises(OSError,
                           shutil.copyfile, 'srcfile', 'destfile')
         self.assertTrue(srcfile._entered)
         self.assertTrue(destfile._entered)
@@ -1748,9 +1792,23 @@
         self.assertEqual(expected, actual)
 
 
-def test_main():
-    support.run_unittest(TestShutil, TestMove, TestCopyFile,
-                         TermsizeTests, TestWhich)
+class PublicAPITests(unittest.TestCase):
+    """Ensures that the correct values are exposed in the public API."""
+
+    def test_module_all_attribute(self):
+        self.assertTrue(hasattr(shutil, '__all__'))
+        target_api = ['copyfileobj', 'copyfile', 'copymode', 'copystat',
+                      'copy', 'copy2', 'copytree', 'move', 'rmtree', 'Error',
+                      'SpecialFileError', 'ExecError', 'make_archive',
+                      'get_archive_formats', 'register_archive_format',
+                      'unregister_archive_format', 'get_unpack_formats',
+                      'register_unpack_format', 'unregister_unpack_format',
+                      'unpack_archive', 'ignore_patterns', 'chown', 'which',
+                      'get_terminal_size', 'SameFileError']
+        if hasattr(os, 'statvfs') or os.name == 'nt':
+            target_api.append('disk_usage')
+        self.assertEqual(set(shutil.__all__), set(target_api))
+
 
 if __name__ == '__main__':
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py
index 191d4cf..74f74af 100644
--- a/Lib/test/test_signal.py
+++ b/Lib/test/test_signal.py
@@ -15,9 +15,6 @@
 except ImportError:
     threading = None
 
-if sys.platform in ('os2', 'riscos'):
-    raise unittest.SkipTest("Can't test signal on %s" % sys.platform)
-
 
 class HandlerBCalled(Exception):
     pass
@@ -36,7 +33,7 @@
 def ignoring_eintr(__func, *args, **kwargs):
     try:
         return __func(*args, **kwargs)
-    except EnvironmentError as e:
+    except OSError as e:
         if e.errno != errno.EINTR:
             raise
         return None
@@ -278,6 +275,57 @@
 
         assert_python_ok('-c', code)
 
+    def test_wakeup_write_error(self):
+        # Issue #16105: write() errors in the C signal handler should not
+        # pass silently.
+        # Use a subprocess to have only one thread.
+        code = """if 1:
+        import errno
+        import fcntl
+        import os
+        import signal
+        import sys
+        import time
+        from test.support import captured_stderr
+
+        def handler(signum, frame):
+            1/0
+
+        signal.signal(signal.SIGALRM, handler)
+        r, w = os.pipe()
+        flags = fcntl.fcntl(r, fcntl.F_GETFL, 0)
+        fcntl.fcntl(r, fcntl.F_SETFL, flags | os.O_NONBLOCK)
+
+        # Set wakeup_fd a read-only file descriptor to trigger the error
+        signal.set_wakeup_fd(r)
+        try:
+            with captured_stderr() as err:
+                signal.alarm(1)
+                time.sleep(5.0)
+        except ZeroDivisionError:
+            # An ignored exception should have been printed out on stderr
+            err = err.getvalue()
+            if ('Exception ignored when trying to write to the signal wakeup fd'
+                not in err):
+                raise AssertionError(err)
+            if ('OSError: [Errno %d]' % errno.EBADF) not in err:
+                raise AssertionError(err)
+        else:
+            raise AssertionError("ZeroDivisionError not raised")
+        """
+        r, w = os.pipe()
+        try:
+            os.write(r, b'x')
+        except OSError:
+            pass
+        else:
+            self.skipTest("OS doesn't report write() error on the read end of a pipe")
+        finally:
+            os.close(r)
+            os.close(w)
+
+        assert_python_ok('-c', code)
+
     def test_wakeup_fd_early(self):
         self.check_wakeup("""def test():
             import select
@@ -315,10 +363,10 @@
             # We attempt to get a signal during the select call
             try:
                 select.select([read], [], [], TIMEOUT_FULL)
-            except select.error:
+            except OSError:
                 pass
             else:
-                raise Exception("select.error not raised")
+                raise Exception("OSError not raised")
             after_time = time.time()
             dt = after_time - before_time
             if dt >= TIMEOUT_HALF:
@@ -406,7 +454,7 @@
                 stdout = first_line + stdout
                 exitcode = process.wait()
                 if exitcode not in (2, 3):
-                    raise Exception("Child error (exit code %s): %s"
+                    raise Exception("Child error (exit code %s): %r"
                                     % (exitcode, stdout))
                 return (exitcode == 3)
 
diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py
index f3bd168..f71cf73 100644
--- a/Lib/test/test_site.py
+++ b/Lib/test/test_site.py
@@ -230,11 +230,7 @@
         site.PREFIXES = ['xoxo']
         dirs = site.getsitepackages()
 
-        if sys.platform in ('os2emx', 'riscos'):
-            self.assertEqual(len(dirs), 1)
-            wanted = os.path.join('xoxo', 'Lib', 'site-packages')
-            self.assertEqual(dirs[0], wanted)
-        elif (sys.platform == "darwin" and
+        if (sys.platform == "darwin" and
             sysconfig.get_config_var("PYTHONFRAMEWORK")):
             # OS X framework builds
             site.PREFIXES = ['Python.framework']
@@ -416,8 +412,11 @@
                 self.fail("sitecustomize not imported automatically")
 
     @test.support.requires_resource('network')
+    @test.support.system_must_validate_cert
     @unittest.skipUnless(sys.version_info[3] == 'final',
                          'only for released versions')
+    @unittest.skipUnless(hasattr(urllib.request, "HTTPSHandler"),
+                         'need SSL support to download license')
     def test_license_exists_at_url(self):
         # This test is a bit fragile since it depends on the format of the
         # string displayed by license in the absence of a LICENSE file.
@@ -432,5 +431,39 @@
         self.assertEqual(code, 200, msg="Can't find " + url)
 
 
+class StartupImportTests(unittest.TestCase):
+
+    def test_startup_imports(self):
+        # This tests checks which modules are loaded by Python when it
+        # initially starts upon startup.
+        popen = subprocess.Popen([sys.executable, '-I', '-v', '-c',
+                                  'import sys; print(set(sys.modules))'],
+                                 stdout=subprocess.PIPE,
+                                 stderr=subprocess.PIPE)
+        stdout, stderr = popen.communicate()
+        stdout = stdout.decode('utf-8')
+        stderr = stderr.decode('utf-8')
+        modules = eval(stdout)
+
+        self.assertIn('site', modules)
+
+        # http://bugs.python.org/issue19205
+        re_mods = {'re', '_sre', 'sre_compile', 'sre_constants', 'sre_parse'}
+        # _osx_support uses the re module in many placs
+        if sys.platform != 'darwin':
+            self.assertFalse(modules.intersection(re_mods), stderr)
+        # http://bugs.python.org/issue9548
+        self.assertNotIn('locale', modules, stderr)
+        if sys.platform != 'darwin':
+            # http://bugs.python.org/issue19209
+            self.assertNotIn('copyreg', modules, stderr)
+        # http://bugs.python.org/issue19218>
+        collection_mods = {'_collections', 'collections', 'functools',
+                           'heapq', 'itertools', 'keyword', 'operator',
+                           'reprlib', 'types', 'weakref'
+                          }.difference(sys.builtin_module_names)
+        self.assertFalse(modules.intersection(collection_mods), stderr)
+
+
 if __name__ == "__main__":
     unittest.main()
diff --git a/Lib/test/test_slice.py b/Lib/test/test_slice.py
index 2df9271..9203d5e 100644
--- a/Lib/test/test_slice.py
+++ b/Lib/test/test_slice.py
@@ -4,8 +4,70 @@
 from test import support
 from pickle import loads, dumps
 
+import itertools
+import operator
 import sys
 
+
+def evaluate_slice_index(arg):
+    """
+    Helper function to convert a slice argument to an integer, and raise
+    TypeError with a suitable message on failure.
+
+    """
+    if hasattr(arg, '__index__'):
+        return operator.index(arg)
+    else:
+        raise TypeError(
+            "slice indices must be integers or "
+            "None or have an __index__ method")
+
+def slice_indices(slice, length):
+    """
+    Reference implementation for the slice.indices method.
+
+    """
+    # Compute step and length as integers.
+    length = operator.index(length)
+    step = 1 if slice.step is None else evaluate_slice_index(slice.step)
+
+    # Raise ValueError for negative length or zero step.
+    if length < 0:
+        raise ValueError("length should not be negative")
+    if step == 0:
+        raise ValueError("slice step cannot be zero")
+
+    # Find lower and upper bounds for start and stop.
+    lower = -1 if step < 0 else 0
+    upper = length - 1 if step < 0 else length
+
+    # Compute start.
+    if slice.start is None:
+        start = upper if step < 0 else lower
+    else:
+        start = evaluate_slice_index(slice.start)
+        start = max(start + length, lower) if start < 0 else min(start, upper)
+
+    # Compute stop.
+    if slice.stop is None:
+        stop = lower if step < 0 else upper
+    else:
+        stop = evaluate_slice_index(slice.stop)
+        stop = max(stop + length, lower) if stop < 0 else min(stop, upper)
+
+    return start, stop, step
+
+
+# Class providing an __index__ method.  Used for testing slice.indices.
+
+class MyIndexable(object):
+    def __init__(self, value):
+        self.value = value
+
+    def __index__(self):
+        return self.value
+
+
 class SliceTest(unittest.TestCase):
 
     def test_constructor(self):
@@ -75,6 +137,22 @@
         s = slice(obj)
         self.assertTrue(s.stop is obj)
 
+    def check_indices(self, slice, length):
+        try:
+            actual = slice.indices(length)
+        except ValueError:
+            actual = "valueerror"
+        try:
+            expected = slice_indices(slice, length)
+        except ValueError:
+            expected = "valueerror"
+        self.assertEqual(actual, expected)
+
+        if length >= 0 and slice.step != 0:
+            actual = range(*slice.indices(length))
+            expected = range(length)[slice]
+            self.assertEqual(actual, expected)
+
     def test_indices(self):
         self.assertEqual(slice(None           ).indices(10), (0, 10,  1))
         self.assertEqual(slice(None,  None,  2).indices(10), (0, 10,  2))
@@ -108,7 +186,41 @@
 
         self.assertEqual(list(range(10))[::sys.maxsize - 1], [0])
 
-        self.assertRaises(OverflowError, slice(None).indices, 1<<100)
+        # Check a variety of start, stop, step and length values, including
+        # values exceeding sys.maxsize (see issue #14794).
+        vals = [None, -2**100, -2**30, -53, -7, -1, 0, 1, 7, 53, 2**30, 2**100]
+        lengths = [0, 1, 7, 53, 2**30, 2**100]
+        for slice_args in itertools.product(vals, repeat=3):
+            s = slice(*slice_args)
+            for length in lengths:
+                self.check_indices(s, length)
+        self.check_indices(slice(0, 10, 1), -3)
+
+        # Negative length should raise ValueError
+        with self.assertRaises(ValueError):
+            slice(None).indices(-1)
+
+        # Zero step should raise ValueError
+        with self.assertRaises(ValueError):
+            slice(0, 10, 0).indices(5)
+
+        # Using a start, stop or step or length that can't be interpreted as an
+        # integer should give a TypeError ...
+        with self.assertRaises(TypeError):
+            slice(0.0, 10, 1).indices(5)
+        with self.assertRaises(TypeError):
+            slice(0, 10.0, 1).indices(5)
+        with self.assertRaises(TypeError):
+            slice(0, 10, 1.0).indices(5)
+        with self.assertRaises(TypeError):
+            slice(0, 10, 1).indices(5.0)
+
+        # ... but it should be fine to use a custom class that provides index.
+        self.assertEqual(slice(0, 10, 1).indices(5), (0, 5, 1))
+        self.assertEqual(slice(MyIndexable(0), 10, 1).indices(5), (0, 5, 1))
+        self.assertEqual(slice(0, MyIndexable(10), 1).indices(5), (0, 5, 1))
+        self.assertEqual(slice(0, 10, MyIndexable(1)).indices(5), (0, 5, 1))
+        self.assertEqual(slice(0, 10, 1).indices(MyIndexable(5)), (0, 5, 1))
 
     def test_setslice_without_getslice(self):
         tmp = []
diff --git a/Lib/test/test_smtplib.py b/Lib/test/test_smtplib.py
index 3bbc6b7..95a9dbe 100644
--- a/Lib/test/test_smtplib.py
+++ b/Lib/test/test_smtplib.py
@@ -222,7 +222,7 @@
             self.assertEqual(smtp.source_address, ('127.0.0.1', port))
             self.assertEqual(smtp.local_hostname, 'localhost')
             smtp.quit()
-        except IOError as e:
+        except OSError as e:
             if e.errno == errno.EADDRINUSE:
                 self.skipTest("couldn't bind to port %d" % port)
             raise
@@ -524,12 +524,6 @@
 
 class NonConnectingTests(unittest.TestCase):
 
-    def setUp(self):
-        smtplib.socket = mock_socket
-
-    def tearDown(self):
-        smtplib.socket = socket
-
     def testNotConnected(self):
         # Test various operations on an unconnected SMTP object that
         # should raise exceptions (at present the attempt in SMTP.send
@@ -541,10 +535,10 @@
                           smtp.send, 'test msg')
 
     def testNonnumericPort(self):
-        # check that non-numeric port raises socket.error
-        self.assertRaises(mock_socket.error, smtplib.SMTP,
+        # check that non-numeric port raises OSError
+        self.assertRaises(OSError, smtplib.SMTP,
                           "localhost", "bogus")
-        self.assertRaises(mock_socket.error, smtplib.SMTP,
+        self.assertRaises(OSError, smtplib.SMTP,
                           "localhost:bogus")
 
 
@@ -625,6 +619,7 @@
     data_response = None
     rcpt_count = 0
     rset_count = 0
+    disconnect = 0
 
     def __init__(self, extra_features, *args, **kw):
         self._extrafeatures = ''.join(
@@ -690,6 +685,8 @@
             super().smtp_MAIL(arg)
         else:
             self.push(self.mail_response)
+            if self.disconnect:
+                self.close_when_done()
 
     def smtp_RCPT(self, arg):
         if self.rcpt_response is None:
@@ -852,6 +849,30 @@
             self.assertIn(sim_auth_credentials['cram-md5'], str(err))
         smtp.close()
 
+    def testAUTH_multiple(self):
+        # Test that multiple authentication methods are tried.
+        self.serv.add_feature("AUTH BOGUS PLAIN LOGIN CRAM-MD5")
+        smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15)
+        try: smtp.login(sim_auth[0], sim_auth[1])
+        except smtplib.SMTPAuthenticationError as err:
+            self.assertIn(sim_auth_login_password, str(err))
+        smtp.close()
+
+    def test_quit_resets_greeting(self):
+        smtp = smtplib.SMTP(HOST, self.port,
+                            local_hostname='localhost',
+                            timeout=15)
+        code, message = smtp.ehlo()
+        self.assertEqual(code, 250)
+        self.assertIn('size', smtp.esmtp_features)
+        smtp.quit()
+        self.assertNotIn('size', smtp.esmtp_features)
+        smtp.connect(HOST, self.port)
+        self.assertNotIn('size', smtp.esmtp_features)
+        smtp.ehlo_or_helo_if_needed()
+        self.assertIn('size', smtp.esmtp_features)
+        smtp.quit()
+
     def test_with_statement(self):
         with smtplib.SMTP(HOST, self.port) as smtp:
             code, message = smtp.noop()
@@ -872,6 +893,16 @@
     #TODO: add tests for correct AUTH method fallback now that the
     #test infrastructure can support it.
 
+    # Issue 17498: make sure _rset does not raise SMTPServerDisconnected exception
+    def test__rest_from_mail_cmd(self):
+        smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15)
+        smtp.noop()
+        self.serv._SMTPchannel.mail_response = '451 Requested action aborted'
+        self.serv._SMTPchannel.disconnect = True
+        with self.assertRaises(smtplib.SMTPSenderRefused):
+            smtp.sendmail('John', 'Sally', 'test message')
+        self.assertIsNone(smtp.sock)
+
     # Issue 5713: make sure close, not rset, is called if we get a 421 error
     def test_421_from_mail_cmd(self):
         smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15)
diff --git a/Lib/test/test_smtpnet.py b/Lib/test/test_smtpnet.py
index e97cf36..03bf93b 100644
--- a/Lib/test/test_smtpnet.py
+++ b/Lib/test/test_smtpnet.py
@@ -1,23 +1,35 @@
 import unittest
 from test import support
 import smtplib
+import socket
 
 ssl = support.import_module("ssl")
 
 support.requires("network")
 
+def check_ssl_verifiy(host, port):
+    context = ssl.create_default_context()
+    with socket.create_connection((host, port)) as sock:
+        try:
+            sock = context.wrap_socket(sock, server_hostname=host)
+        except Exception:
+            return False
+        else:
+            sock.close()
+            return True
+
 
 class SmtpTest(unittest.TestCase):
     testServer = 'smtp.gmail.com'
     remotePort = 25
-    context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
 
     def test_connect_starttls(self):
         support.get_attribute(smtplib, 'SMTP_SSL')
+        context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
         with support.transient_internet(self.testServer):
             server = smtplib.SMTP(self.testServer, self.remotePort)
             try:
-                server.starttls(context=self.context)
+                server.starttls(context=context)
             except smtplib.SMTPException as e:
                 if e.args[0] == 'STARTTLS extension not supported by server.':
                     unittest.skip(e.args[0])
@@ -30,7 +42,6 @@
 class SmtpSSLTest(unittest.TestCase):
     testServer = 'smtp.gmail.com'
     remotePort = 465
-    context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
 
     def test_connect(self):
         support.get_attribute(smtplib, 'SMTP_SSL')
@@ -47,9 +58,23 @@
             server.quit()
 
     def test_connect_using_sslcontext(self):
+        context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
         support.get_attribute(smtplib, 'SMTP_SSL')
         with support.transient_internet(self.testServer):
-            server = smtplib.SMTP_SSL(self.testServer, self.remotePort, context=self.context)
+            server = smtplib.SMTP_SSL(self.testServer, self.remotePort, context=context)
+            server.ehlo()
+            server.quit()
+
+    def test_connect_using_sslcontext_verified(self):
+        with support.transient_internet(self.testServer):
+            can_verify = check_ssl_verifiy(self.testServer, self.remotePort)
+            if not can_verify:
+                self.skipTest("SSL certificate can't be verified")
+
+        support.get_attribute(smtplib, 'SMTP_SSL')
+        context = ssl.create_default_context()
+        with support.transient_internet(self.testServer):
+            server = smtplib.SMTP_SSL(self.testServer, self.remotePort, context=context)
             server.ehlo()
             server.quit()
 
diff --git a/Lib/test/test_sndhdr.py b/Lib/test/test_sndhdr.py
index 1004688..5e0abe0 100644
--- a/Lib/test/test_sndhdr.py
+++ b/Lib/test/test_sndhdr.py
@@ -12,7 +12,7 @@
             ('sndhdr.hcom', ('hcom', 22050.0, 1, -1, 8)),
             ('sndhdr.sndt', ('sndt', 44100, 1, 5, 8)),
             ('sndhdr.voc', ('voc', 0, 1, -1, 8)),
-            ('sndhdr.wav', ('wav', 44100, 2, -1, 16)),
+            ('sndhdr.wav', ('wav', 44100, 2, 5, 16)),
         ):
             filename = findfile(filename, subdir="sndhdrdata")
             what = sndhdr.what(filename)
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index ee4aea3..b412386 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -1,9 +1,9 @@
 import unittest
 from test import support
-from unittest.case import _ExpectedFailure
 
 import errno
 import io
+import itertools
 import socket
 import select
 import tempfile
@@ -21,13 +21,13 @@
 import pickle
 import struct
 try:
-    import fcntl
-except ImportError:
-    fcntl = False
-try:
     import multiprocessing
 except ImportError:
     multiprocessing = False
+try:
+    import fcntl
+except ImportError:
+    fcntl = None
 
 HOST = support.HOST
 MSG = 'Michael Gilfix was here\u1234\r\n'.encode('utf-8') ## test unicode string and carriage return
@@ -38,12 +38,17 @@
 except ImportError:
     thread = None
     threading = None
+try:
+    import _socket
+except ImportError:
+    _socket = None
+
 
 def _have_socket_can():
     """Check whether CAN sockets are supported on this host."""
     try:
         s = socket.socket(socket.PF_CAN, socket.SOCK_RAW, socket.CAN_RAW)
-    except (AttributeError, socket.error, OSError):
+    except (AttributeError, OSError):
         return False
     else:
         s.close()
@@ -118,12 +123,42 @@
     interface = 'vcan0'
     bufsize = 128
 
+    """The CAN frame structure is defined in <linux/can.h>:
+
+    struct can_frame {
+        canid_t can_id;  /* 32 bit CAN_ID + EFF/RTR/ERR flags */
+        __u8    can_dlc; /* data length code: 0 .. 8 */
+        __u8    data[8] __attribute__((aligned(8)));
+    };
+    """
+    can_frame_fmt = "=IB3x8s"
+    can_frame_size = struct.calcsize(can_frame_fmt)
+
+    """The Broadcast Management Command frame structure is defined
+    in <linux/can/bcm.h>:
+
+    struct bcm_msg_head {
+        __u32 opcode;
+        __u32 flags;
+        __u32 count;
+        struct timeval ival1, ival2;
+        canid_t can_id;
+        __u32 nframes;
+        struct can_frame frames[0];
+    }
+
+    `bcm_msg_head` must be 8 bytes aligned because of the `frames` member (see
+    `struct can_frame` definition). Must use native not standard types for packing.
+    """
+    bcm_cmd_msg_fmt = "@3I4l2I"
+    bcm_cmd_msg_fmt += "x" * (struct.calcsize(bcm_cmd_msg_fmt) % 8)
+
     def setUp(self):
         self.s = socket.socket(socket.PF_CAN, socket.SOCK_RAW, socket.CAN_RAW)
         self.addCleanup(self.s.close)
         try:
             self.s.bind((self.interface,))
-        except socket.error:
+        except OSError:
             self.skipTest('network interface `%s` does not exist' %
                            self.interface)
 
@@ -239,9 +274,6 @@
             raise TypeError("test_func must be a callable function")
         try:
             test_func()
-        except _ExpectedFailure:
-            # We deliberately ignore expected failures
-            pass
         except BaseException as e:
             self.queue.put(e)
         finally:
@@ -292,7 +324,7 @@
         self.cli = socket.socket(socket.PF_CAN, socket.SOCK_RAW, socket.CAN_RAW)
         try:
             self.cli.bind((self.interface,))
-        except socket.error:
+        except OSError:
             # skipTest should not be called here, and will be called in the
             # server instead
             pass
@@ -540,11 +572,7 @@
 class Inet6TestBase(InetTestBase):
     """Base class for IPv6 socket tests."""
 
-    # Don't use "localhost" here - it may not have an IPv6 address
-    # assigned to it by default (e.g. in /etc/hosts), and if someone
-    # has assigned it an IPv4-mapped address, then it's unlikely to
-    # work with the full IPv6 API.
-    host = "::1"
+    host = support.HOSTv6
 
 class UDP6TestBase(Inet6TestBase):
     """Base class for UDP-over-IPv6 tests."""
@@ -605,7 +633,7 @@
                     for obj in args]
         try:
             s = socket.socket(*callargs)
-        except socket.error as e:
+        except OSError as e:
             # XXX: check errno?
             err = str(e)
         else:
@@ -621,10 +649,39 @@
 
 class GeneralModuleTests(unittest.TestCase):
 
+    def test_SocketType_is_socketobject(self):
+        import _socket
+        self.assertTrue(socket.SocketType is _socket.socket)
+        s = socket.socket()
+        self.assertIsInstance(s, socket.SocketType)
+        s.close()
+
     def test_repr(self):
         s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-        self.addCleanup(s.close)
-        self.assertTrue(repr(s).startswith("<socket.socket object"))
+        with s:
+            self.assertIn('fd=%i' % s.fileno(), repr(s))
+            self.assertIn('family=%s' % socket.AF_INET, repr(s))
+            self.assertIn('type=%s' % socket.SOCK_STREAM, repr(s))
+            self.assertIn('proto=0', repr(s))
+            self.assertNotIn('raddr', repr(s))
+            s.bind(('127.0.0.1', 0))
+            self.assertIn('laddr', repr(s))
+            self.assertIn(str(s.getsockname()), repr(s))
+        self.assertIn('[closed]', repr(s))
+        self.assertNotIn('laddr', repr(s))
+
+    @unittest.skipUnless(_socket is not None, 'need _socket module')
+    def test_csocket_repr(self):
+        s = _socket.socket(_socket.AF_INET, _socket.SOCK_STREAM)
+        try:
+            expected = ('<socket object, fd=%s, family=%s, type=%s, proto=%s>'
+                        % (s.fileno(), s.family, s.type, s.proto))
+            self.assertEqual(repr(s), expected)
+        finally:
+            s.close()
+        expected = ('<socket object, fd=-1, family=%s, type=%s, proto=%s>'
+                    % (s.family, s.type, s.proto))
+        self.assertEqual(repr(s), expected)
 
     def test_weakref(self):
         s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
@@ -642,11 +699,11 @@
     def testSocketError(self):
         # Testing socket module exceptions
         msg = "Error raising socket exception (%s)."
-        with self.assertRaises(socket.error, msg=msg % 'socket.error'):
-            raise socket.error
-        with self.assertRaises(socket.error, msg=msg % 'socket.herror'):
+        with self.assertRaises(OSError, msg=msg % 'OSError'):
+            raise OSError
+        with self.assertRaises(OSError, msg=msg % 'socket.herror'):
             raise socket.herror
-        with self.assertRaises(socket.error, msg=msg % 'socket.gaierror'):
+        with self.assertRaises(OSError, msg=msg % 'socket.gaierror'):
             raise socket.gaierror
 
     def testSendtoErrors(self):
@@ -709,13 +766,13 @@
         hostname = socket.gethostname()
         try:
             ip = socket.gethostbyname(hostname)
-        except socket.error:
+        except OSError:
             # Probably name lookup wasn't set up right; skip this test
             self.skipTest('name lookup failure')
         self.assertTrue(ip.find('.') >= 0, "Error resolving host to ip.")
         try:
             hname, aliases, ipaddrs = socket.gethostbyaddr(ip)
-        except socket.error:
+        except OSError:
             # Probably a similar problem as above; skip this test
             self.skipTest('name lookup failure')
         all_host_names = [hostname, hname] + aliases
@@ -723,13 +780,27 @@
         if not fqhn in all_host_names:
             self.fail("Error testing host resolution mechanisms. (fqdn: %s, all: %s)" % (fqhn, repr(all_host_names)))
 
+    def test_host_resolution(self):
+        for addr in ['0.1.1.~1', '1+.1.1.1', '::1q', '::1::2',
+                     '1:1:1:1:1:1:1:1:1']:
+            self.assertRaises(OSError, socket.gethostbyname, addr)
+            self.assertRaises(OSError, socket.gethostbyaddr, addr)
+
+        for addr in [support.HOST, '10.0.0.1', '255.255.255.255']:
+            self.assertEqual(socket.gethostbyname(addr), addr)
+
+        # we don't test support.HOSTv6 because there's a chance it doesn't have
+        # a matching name entry (e.g. 'ip6-localhost')
+        for host in [support.HOST]:
+            self.assertIn(host, socket.gethostbyaddr(host)[2])
+
     @unittest.skipUnless(hasattr(socket, 'sethostname'), "test needs socket.sethostname()")
     @unittest.skipUnless(hasattr(socket, 'gethostname'), "test needs socket.gethostname()")
     def test_sethostname(self):
         oldhn = socket.gethostname()
         try:
             socket.sethostname('new')
-        except socket.error as e:
+        except OSError as e:
             if e.errno == errno.EPERM:
                 self.skipTest("test should be run as root")
             else:
@@ -763,8 +834,8 @@
                          'socket.if_nameindex() not available.')
     def testInvalidInterfaceNameIndex(self):
         # test nonexistent interface index/name
-        self.assertRaises(socket.error, socket.if_indextoname, 0)
-        self.assertRaises(socket.error, socket.if_nametoindex, '_DEADBEEF')
+        self.assertRaises(OSError, socket.if_indextoname, 0)
+        self.assertRaises(OSError, socket.if_nametoindex, '_DEADBEEF')
         # test with invalid values
         self.assertRaises(TypeError, socket.if_nametoindex, 0)
         self.assertRaises(TypeError, socket.if_indextoname, '_DEADBEEF')
@@ -786,7 +857,7 @@
         try:
             # On some versions, this crashes the interpreter.
             socket.getnameinfo(('x', 0, 0, 0), 0)
-        except socket.error:
+        except OSError:
             pass
 
     def testNtoH(self):
@@ -822,7 +893,7 @@
         # Find one service that exists, then check all the related interfaces.
         # I've ordered this by protocols that have both a tcp and udp
         # protocol, at least for modern Linuxes.
-        if (sys.platform.startswith(('freebsd', 'netbsd'))
+        if (sys.platform.startswith(('freebsd', 'netbsd', 'gnukfreebsd'))
             or sys.platform in ('linux', 'darwin')):
             # avoid the 'echo' service on this platform, as there is an
             # assumption breaking non-standard port/protocol entry
@@ -833,17 +904,17 @@
             try:
                 port = socket.getservbyname(service, 'tcp')
                 break
-            except socket.error:
+            except OSError:
                 pass
         else:
-            raise socket.error
+            raise OSError
         # Try same call with optional protocol omitted
         port2 = socket.getservbyname(service)
         eq(port, port2)
         # Try udp, but don't barf if it doesn't exist
         try:
             udpport = socket.getservbyname(service, 'udp')
-        except socket.error:
+        except OSError:
             udpport = None
         else:
             eq(udpport, port)
@@ -899,7 +970,7 @@
         g = lambda a: inet_pton(AF_INET, a)
 
         assertInvalid = lambda func,a: self.assertRaises(
-            (socket.error, ValueError), func, a
+            (OSError, ValueError), func, a
         )
 
         self.assertEqual(b'\x00\x00\x00\x00', f('0.0.0.0'))
@@ -932,9 +1003,17 @@
                 self.skipTest('IPv6 not available')
         except ImportError:
             self.skipTest('could not import needed symbols from socket')
+
+        if sys.platform == "win32":
+            try:
+                inet_pton(AF_INET6, '::')
+            except OSError as e:
+                if e.winerror == 10022:
+                    self.skipTest('IPv6 might not be supported')
+
         f = lambda a: inet_pton(AF_INET6, a)
         assertInvalid = lambda a: self.assertRaises(
-            (socket.error, ValueError), f, a
+            (OSError, ValueError), f, a
         )
 
         self.assertEqual(b'\x00' * 16, f('::'))
@@ -983,7 +1062,7 @@
         from socket import inet_ntoa as f, inet_ntop, AF_INET
         g = lambda a: inet_ntop(AF_INET, a)
         assertInvalid = lambda func,a: self.assertRaises(
-            (socket.error, ValueError), func, a
+            (OSError, ValueError), func, a
         )
 
         self.assertEqual('1.0.1.0', f(b'\x01\x00\x01\x00'))
@@ -1010,9 +1089,17 @@
                 self.skipTest('IPv6 not available')
         except ImportError:
             self.skipTest('could not import needed symbols from socket')
+
+        if sys.platform == "win32":
+            try:
+                inet_ntop(AF_INET6, b'\x00' * 16)
+            except OSError as e:
+                if e.winerror == 10022:
+                    self.skipTest('IPv6 might not be supported')
+
         f = lambda a: inet_ntop(AF_INET6, a)
         assertInvalid = lambda a: self.assertRaises(
-            (socket.error, ValueError), f, a
+            (OSError, ValueError), f, a
         )
 
         self.assertEqual('::', f(b'\x00' * 16))
@@ -1040,7 +1127,7 @@
         # At least for eCos.  This is required for the S/390 to pass.
         try:
             my_ip_addr = socket.gethostbyname(socket.gethostname())
-        except socket.error:
+        except OSError:
             # Probably name lookup wasn't set up right; skip this test
             self.skipTest('name lookup failure')
         self.assertIn(name[0], ("0.0.0.0", my_ip_addr), '%s invalid' % name[0])
@@ -1067,28 +1154,41 @@
         sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
         sock.settimeout(1)
         sock.close()
-        self.assertRaises(socket.error, sock.send, b"spam")
+        self.assertRaises(OSError, sock.send, b"spam")
 
     def testNewAttributes(self):
         # testing .family, .type and .protocol
+
         sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
         self.assertEqual(sock.family, socket.AF_INET)
-        self.assertEqual(sock.type, socket.SOCK_STREAM)
+        if hasattr(socket, 'SOCK_CLOEXEC'):
+            self.assertIn(sock.type,
+                          (socket.SOCK_STREAM | socket.SOCK_CLOEXEC,
+                           socket.SOCK_STREAM))
+        else:
+            self.assertEqual(sock.type, socket.SOCK_STREAM)
         self.assertEqual(sock.proto, 0)
         sock.close()
 
     def test_getsockaddrarg(self):
-        host = '0.0.0.0'
+        sock = socket.socket()
+        self.addCleanup(sock.close)
         port = support.find_unused_port()
         big_port = port + 65536
         neg_port = port - 65536
-        sock = socket.socket()
-        try:
-            self.assertRaises(OverflowError, sock.bind, (host, big_port))
-            self.assertRaises(OverflowError, sock.bind, (host, neg_port))
-            sock.bind((host, port))
-        finally:
-            sock.close()
+        self.assertRaises(OverflowError, sock.bind, (HOST, big_port))
+        self.assertRaises(OverflowError, sock.bind, (HOST, neg_port))
+        # Since find_unused_port() is inherently subject to race conditions, we
+        # call it a couple times if necessary.
+        for i in itertools.count():
+            port = support.find_unused_port()
+            try:
+                sock.bind((HOST, port))
+            except OSError as e:
+                if e.errno != errno.EADDRINUSE or i == 5:
+                    raise
+            else:
+                break
 
     @unittest.skipUnless(os.name == "nt", "Windows specific")
     def test_sock_ioctl(self):
@@ -1126,9 +1226,12 @@
         socket.getaddrinfo(HOST, 80)
         socket.getaddrinfo(HOST, None)
         # test family and socktype filters
-        infos = socket.getaddrinfo(HOST, None, socket.AF_INET)
-        for family, _, _, _, _ in infos:
+        infos = socket.getaddrinfo(HOST, 80, socket.AF_INET, socket.SOCK_STREAM)
+        for family, type, _, _, _ in infos:
             self.assertEqual(family, socket.AF_INET)
+            self.assertEqual(str(family), 'AddressFamily.AF_INET')
+            self.assertEqual(type, socket.SOCK_STREAM)
+            self.assertEqual(str(type), 'SocketKind.SOCK_STREAM')
         infos = socket.getaddrinfo(HOST, None, 0, socket.SOCK_STREAM)
         for _, socktype, _, _, _ in infos:
             self.assertEqual(socktype, socket.SOCK_STREAM)
@@ -1176,7 +1279,7 @@
 
     def test_getnameinfo(self):
         # only IP addresses are allowed
-        self.assertRaises(socket.error, socket.getnameinfo, ('mail.python.org',0), 0)
+        self.assertRaises(OSError, socket.getnameinfo, ('mail.python.org',0), 0)
 
     @unittest.skipUnless(support.is_resource_enabled('network'),
                          'network is not enabled')
@@ -1292,10 +1395,31 @@
     @unittest.skipUnless(support.IPV6_ENABLED, 'IPv6 required for this test.')
     def test_flowinfo(self):
         self.assertRaises(OverflowError, socket.getnameinfo,
-                          ('::1',0, 0xffffffff), 0)
+                          (support.HOSTv6, 0, 0xffffffff), 0)
         with socket.socket(socket.AF_INET6, socket.SOCK_STREAM) as s:
-            self.assertRaises(OverflowError, s.bind, ('::1', 0, -10))
+            self.assertRaises(OverflowError, s.bind, (support.HOSTv6, 0, -10))
 
+    def test_str_for_enums(self):
+        # Make sure that the AF_* and SOCK_* constants have enum-like string
+        # reprs.
+        with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
+            self.assertEqual(str(s.family), 'AddressFamily.AF_INET')
+            self.assertEqual(str(s.type), 'SocketKind.SOCK_STREAM')
+
+    @unittest.skipIf(os.name == 'nt', 'Will not work on Windows')
+    def test_uknown_socket_family_repr(self):
+        # Test that when created with a family that's not one of the known
+        # AF_*/SOCK_* constants, socket.family just returns the number.
+        #
+        # To do this we fool socket.socket into believing it already has an
+        # open fd because on this path it doesn't actually verify the family and
+        # type and populates the socket object.
+        #
+        # On Windows this trick won't work, so the test is skipped.
+        fd, _ = tempfile.mkstemp()
+        with socket.socket(family=42424, type=13331, fileno=fd) as s:
+            self.assertEqual(s.family, 42424)
+            self.assertEqual(s.type, 13331)
 
 @unittest.skipUnless(HAVE_SOCKET_CAN, 'SocketCan required for this test.')
 class BasicCANTest(unittest.TestCase):
@@ -1305,10 +1429,35 @@
         socket.PF_CAN
         socket.CAN_RAW
 
+    @unittest.skipUnless(hasattr(socket, "CAN_BCM"),
+                         'socket.CAN_BCM required for this test.')
+    def testBCMConstants(self):
+        socket.CAN_BCM
+
+        # opcodes
+        socket.CAN_BCM_TX_SETUP     # create (cyclic) transmission task
+        socket.CAN_BCM_TX_DELETE    # remove (cyclic) transmission task
+        socket.CAN_BCM_TX_READ      # read properties of (cyclic) transmission task
+        socket.CAN_BCM_TX_SEND      # send one CAN frame
+        socket.CAN_BCM_RX_SETUP     # create RX content filter subscription
+        socket.CAN_BCM_RX_DELETE    # remove RX content filter subscription
+        socket.CAN_BCM_RX_READ      # read properties of RX content filter subscription
+        socket.CAN_BCM_TX_STATUS    # reply to TX_READ request
+        socket.CAN_BCM_TX_EXPIRED   # notification on performed transmissions (count=0)
+        socket.CAN_BCM_RX_STATUS    # reply to RX_READ request
+        socket.CAN_BCM_RX_TIMEOUT   # cyclic message is absent
+        socket.CAN_BCM_RX_CHANGED   # updated CAN frame (detected content change)
+
     def testCreateSocket(self):
         with socket.socket(socket.PF_CAN, socket.SOCK_RAW, socket.CAN_RAW) as s:
             pass
 
+    @unittest.skipUnless(hasattr(socket, "CAN_BCM"),
+                         'socket.CAN_BCM required for this test.')
+    def testCreateBCMSocket(self):
+        with socket.socket(socket.PF_CAN, socket.SOCK_DGRAM, socket.CAN_BCM) as s:
+            pass
+
     def testBindAny(self):
         with socket.socket(socket.PF_CAN, socket.SOCK_RAW, socket.CAN_RAW) as s:
             s.bind(('', ))
@@ -1316,7 +1465,7 @@
     def testTooLongInterfaceName(self):
         # most systems limit IFNAMSIZ to 16, take 1024 to be sure
         with socket.socket(socket.PF_CAN, socket.SOCK_RAW, socket.CAN_RAW) as s:
-            self.assertRaisesRegex(socket.error, 'interface name too long',
+            self.assertRaisesRegex(OSError, 'interface name too long',
                                    s.bind, ('x' * 1024,))
 
     @unittest.skipUnless(hasattr(socket, "CAN_RAW_LOOPBACK"),
@@ -1344,16 +1493,6 @@
 @unittest.skipUnless(thread, 'Threading required for this test.')
 class CANTest(ThreadedCANSocketTest):
 
-    """The CAN frame structure is defined in <linux/can.h>:
-
-    struct can_frame {
-        canid_t can_id;  /* 32 bit CAN_ID + EFF/RTR/ERR flags */
-        __u8    can_dlc; /* data length code: 0 .. 8 */
-        __u8    data[8] __attribute__((aligned(8)));
-    };
-    """
-    can_frame_fmt = "=IB3x8s"
-
     def __init__(self, methodName='runTest'):
         ThreadedCANSocketTest.__init__(self, methodName=methodName)
 
@@ -1402,6 +1541,46 @@
         self.cf2 = self.build_can_frame(0x12, b'\x99\x22\x33')
         self.cli.send(self.cf2)
 
+    @unittest.skipUnless(hasattr(socket, "CAN_BCM"),
+                         'socket.CAN_BCM required for this test.')
+    def _testBCM(self):
+        cf, addr = self.cli.recvfrom(self.bufsize)
+        self.assertEqual(self.cf, cf)
+        can_id, can_dlc, data = self.dissect_can_frame(cf)
+        self.assertEqual(self.can_id, can_id)
+        self.assertEqual(self.data, data)
+
+    @unittest.skipUnless(hasattr(socket, "CAN_BCM"),
+                         'socket.CAN_BCM required for this test.')
+    def testBCM(self):
+        bcm = socket.socket(socket.PF_CAN, socket.SOCK_DGRAM, socket.CAN_BCM)
+        self.addCleanup(bcm.close)
+        bcm.connect((self.interface,))
+        self.can_id = 0x123
+        self.data = bytes([0xc0, 0xff, 0xee])
+        self.cf = self.build_can_frame(self.can_id, self.data)
+        opcode = socket.CAN_BCM_TX_SEND
+        flags = 0
+        count = 0
+        ival1_seconds = ival1_usec = ival2_seconds = ival2_usec = 0
+        bcm_can_id = 0x0222
+        nframes = 1
+        assert len(self.cf) == 16
+        header = struct.pack(self.bcm_cmd_msg_fmt,
+                    opcode,
+                    flags,
+                    count,
+                    ival1_seconds,
+                    ival1_usec,
+                    ival2_seconds,
+                    ival2_usec,
+                    bcm_can_id,
+                    nframes,
+                    )
+        header_plus_frame = header + self.cf
+        bytes_sent = bcm.send(header_plus_frame)
+        self.assertEqual(bytes_sent, len(header_plus_frame))
+
 
 @unittest.skipUnless(HAVE_SOCKET_RDS, 'RDS sockets required for this test.')
 class BasicRDSTest(unittest.TestCase):
@@ -1624,7 +1803,7 @@
         self.assertEqual(f, fileno)
         # cli_conn cannot be used anymore...
         self.assertTrue(self.cli_conn._closed)
-        self.assertRaises(socket.error, self.cli_conn.recv, 1024)
+        self.assertRaises(OSError, self.cli_conn.recv, 1024)
         self.cli_conn.close()
         # ...but we can create another socket using the (still open)
         # file descriptor
@@ -1993,7 +2172,7 @@
     def _testSendmsgExcessCmsgReject(self):
         if not hasattr(socket, "CMSG_SPACE"):
             # Can only send one item
-            with self.assertRaises(socket.error) as cm:
+            with self.assertRaises(OSError) as cm:
                 self.sendmsgToServer([MSG], [(0, 0, b""), (0, 0, b"")])
             self.assertIsNone(cm.exception.errno)
         self.sendToServer(b"done")
@@ -2004,7 +2183,7 @@
 
     def _testSendmsgAfterClose(self):
         self.cli_sock.close()
-        self.assertRaises(socket.error, self.sendmsgToServer, [MSG])
+        self.assertRaises(OSError, self.sendmsgToServer, [MSG])
 
 
 class SendmsgStreamTests(SendmsgTests):
@@ -2037,7 +2216,7 @@
     # Linux supports MSG_DONTWAIT when sending, but in general, it
     # only works when receiving.  Could add other platforms if they
     # support it too.
-    @skipWithClientIf(sys.platform not in {"linux2"},
+    @skipWithClientIf(sys.platform not in {"linux"},
                       "MSG_DONTWAIT not known to work on this platform when "
                       "sending")
     def testSendmsgDontWait(self):
@@ -2048,7 +2227,7 @@
     @testSendmsgDontWait.client_skip
     def _testSendmsgDontWait(self):
         try:
-            with self.assertRaises(socket.error) as cm:
+            with self.assertRaises(OSError) as cm:
                 while True:
                     self.sendmsgToServer([b"a"*512], [], socket.MSG_DONTWAIT)
             self.assertIn(cm.exception.errno,
@@ -2068,9 +2247,9 @@
         pass
 
     def _testSendmsgNoDestAddr(self):
-        self.assertRaises(socket.error, self.cli_sock.sendmsg,
+        self.assertRaises(OSError, self.cli_sock.sendmsg,
                           [MSG])
-        self.assertRaises(socket.error, self.cli_sock.sendmsg,
+        self.assertRaises(OSError, self.cli_sock.sendmsg,
                           [MSG], [], 0, None)
 
 
@@ -2156,7 +2335,7 @@
     def testRecvmsgAfterClose(self):
         # Check that recvmsg[_into]() fails on a closed socket.
         self.serv_sock.close()
-        self.assertRaises(socket.error, self.doRecvmsg, self.serv_sock, 1024)
+        self.assertRaises(OSError, self.doRecvmsg, self.serv_sock, 1024)
 
     def _testRecvmsgAfterClose(self):
         pass
@@ -2607,7 +2786,7 @@
         # call fails, just send msg with no ancillary data.
         try:
             nbytes = self.sendmsgToServer([msg], ancdata)
-        except socket.error as e:
+        except OSError as e:
             # Check that it was the system call that failed
             self.assertIsInstance(e.errno, int)
             nbytes = self.sendmsgToServer([msg])
@@ -2985,7 +3164,7 @@
                   array.array("i", [self.traffic_class]).tobytes() + b"\x00"),
                  (socket.IPPROTO_IPV6, socket.IPV6_HOPLIMIT,
                   array.array("i", [self.hop_limit]))])
-        except socket.error as e:
+        except OSError as e:
             self.assertIsInstance(e.errno, int)
             nbytes = self.sendmsgToServer(
                 [MSG],
@@ -3443,10 +3622,10 @@
         self.serv.settimeout(self.timeout)
 
     def checkInterruptedRecv(self, func, *args, **kwargs):
-        # Check that func(*args, **kwargs) raises socket.error with an
+        # Check that func(*args, **kwargs) raises OSError with an
         # errno of EINTR when interrupted by a signal.
         self.setAlarm(self.alarm_time)
-        with self.assertRaises(socket.error) as cm:
+        with self.assertRaises(OSError) as cm:
             func(*args, **kwargs)
         self.assertNotIsInstance(cm.exception, socket.timeout)
         self.assertEqual(cm.exception.errno, errno.EINTR)
@@ -3503,9 +3682,9 @@
 
     def checkInterruptedSend(self, func, *args, **kwargs):
         # Check that func(*args, **kwargs), run in a loop, raises
-        # socket.error with an errno of EINTR when interrupted by a
+        # OSError with an errno of EINTR when interrupted by a
         # signal.
-        with self.assertRaises(socket.error) as cm:
+        with self.assertRaises(OSError) as cm:
             while True:
                 self.setAlarm(self.alarm_time)
                 func(*args, **kwargs)
@@ -3604,7 +3783,7 @@
         start = time.time()
         try:
             self.serv.accept()
-        except socket.error:
+        except OSError:
             pass
         end = time.time()
         self.assertTrue((end - start) < 1.0, "Error setting non-blocking mode.")
@@ -3639,7 +3818,7 @@
         start = time.time()
         try:
             self.serv.accept()
-        except socket.error:
+        except OSError:
             pass
         end = time.time()
         self.assertTrue((end - start) < 1.0, "Error creating with non-blocking mode.")
@@ -3669,7 +3848,7 @@
         self.serv.setblocking(0)
         try:
             conn, addr = self.serv.accept()
-        except socket.error:
+        except OSError:
             pass
         else:
             self.fail("Error trying to do non-blocking accept.")
@@ -3699,7 +3878,7 @@
         conn.setblocking(0)
         try:
             msg = conn.recv(len(MSG))
-        except socket.error:
+        except OSError:
             pass
         else:
             self.fail("Error trying to do non-blocking recv.")
@@ -3782,7 +3961,7 @@
         # First read raises a timeout
         self.assertRaises(socket.timeout, self.read_file.read, 1)
         # Second read is disallowed
-        with self.assertRaises(IOError) as ctx:
+        with self.assertRaises(OSError) as ctx:
             self.read_file.read(1)
         self.assertIn("cannot read from timed out object", str(ctx.exception))
 
@@ -3874,7 +4053,7 @@
         self.read_file.close()
         self.assertRaises(ValueError, self.read_file.fileno)
         self.cli_conn.close()
-        self.assertRaises(socket.error, self.cli_conn.getsockname)
+        self.assertRaises(OSError, self.cli_conn.getsockname)
 
     def _testRealClose(self):
         pass
@@ -3911,7 +4090,7 @@
 
     @staticmethod
     def _raise_eintr():
-        raise socket.error(errno.EINTR, "interrupted")
+        raise OSError(errno.EINTR, "interrupted")
 
     def _textiowrap_mock_socket(self, mock, buffering=-1):
         raw = socket.SocketIO(mock, "r")
@@ -4023,7 +4202,7 @@
         self.assertEqual(msg, self.read_msg)
         # ...until the file is itself closed
         self.read_file.close()
-        self.assertRaises(socket.error, self.cli_conn.recv, 1024)
+        self.assertRaises(OSError, self.cli_conn.recv, 1024)
 
     def _testMakefileClose(self):
         self.write_file.write(self.write_msg)
@@ -4172,7 +4351,7 @@
         port = support.find_unused_port()
         cli = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
         self.addCleanup(cli.close)
-        with self.assertRaises(socket.error) as cm:
+        with self.assertRaises(OSError) as cm:
             cli.connect((HOST, port))
         self.assertEqual(cm.exception.errno, errno.ECONNREFUSED)
 
@@ -4180,7 +4359,7 @@
         # Issue #9792: errors raised by create_connection() should have
         # a proper errno attribute.
         port = support.find_unused_port()
-        with self.assertRaises(socket.error) as cm:
+        with self.assertRaises(OSError) as cm:
             socket.create_connection((HOST, port))
 
         # Issue #16257: create_connection() calls getaddrinfo() against
@@ -4328,7 +4507,7 @@
             foo = self.serv.accept()
         except socket.timeout:
             self.fail("caught timeout instead of error (TCP)")
-        except socket.error:
+        except OSError:
             ok = True
         except:
             self.fail("caught unexpected exception (TCP)")
@@ -4385,7 +4564,7 @@
             foo = self.serv.recv(1024)
         except socket.timeout:
             self.fail("caught timeout instead of error (UDP)")
-        except socket.error:
+        except OSError:
             ok = True
         except:
             self.fail("caught unexpected exception (UDP)")
@@ -4395,10 +4574,10 @@
 class TestExceptions(unittest.TestCase):
 
     def testExceptionTree(self):
-        self.assertTrue(issubclass(socket.error, Exception))
-        self.assertTrue(issubclass(socket.herror, socket.error))
-        self.assertTrue(issubclass(socket.gaierror, socket.error))
-        self.assertTrue(issubclass(socket.timeout, socket.error))
+        self.assertTrue(issubclass(OSError, Exception))
+        self.assertTrue(issubclass(socket.herror, OSError))
+        self.assertTrue(issubclass(socket.gaierror, OSError))
+        self.assertTrue(issubclass(socket.timeout, OSError))
 
 @unittest.skipUnless(sys.platform == 'linux', 'Linux specific test')
 class TestLinuxAbstractNamespace(unittest.TestCase):
@@ -4425,7 +4604,7 @@
     def testNameOverflow(self):
         address = "\x00" + "h" * self.UNIX_PATH_MAX
         with socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) as s:
-            self.assertRaises(socket.error, s.bind, address)
+            self.assertRaises(OSError, s.bind, address)
 
     def testStrName(self):
         # Check that an abstract name can be passed as a string.
@@ -4682,7 +4861,7 @@
         self.assertTrue(sock._closed)
         # exception inside with block
         with socket.socket() as sock:
-            self.assertRaises(socket.error, sock.sendall, b'foo')
+            self.assertRaises(OSError, sock.sendall, b'foo')
         self.assertTrue(sock._closed)
 
     def testCreateConnectionBase(self):
@@ -4710,19 +4889,76 @@
         with socket.create_connection(address) as sock:
             sock.close()
         self.assertTrue(sock._closed)
-        self.assertRaises(socket.error, sock.sendall, b'foo')
+        self.assertRaises(OSError, sock.sendall, b'foo')
 
 
-@unittest.skipUnless(hasattr(socket, "SOCK_CLOEXEC"),
-                     "SOCK_CLOEXEC not defined")
-@unittest.skipUnless(fcntl, "module fcntl not available")
-class CloexecConstantTest(unittest.TestCase):
+class InheritanceTest(unittest.TestCase):
+    @unittest.skipUnless(hasattr(socket, "SOCK_CLOEXEC"),
+                         "SOCK_CLOEXEC not defined")
     @support.requires_linux_version(2, 6, 28)
     def test_SOCK_CLOEXEC(self):
         with socket.socket(socket.AF_INET,
                            socket.SOCK_STREAM | socket.SOCK_CLOEXEC) as s:
             self.assertTrue(s.type & socket.SOCK_CLOEXEC)
-            self.assertTrue(fcntl.fcntl(s, fcntl.F_GETFD) & fcntl.FD_CLOEXEC)
+            self.assertFalse(s.get_inheritable())
+
+    def test_default_inheritable(self):
+        sock = socket.socket()
+        with sock:
+            self.assertEqual(sock.get_inheritable(), False)
+
+    def test_dup(self):
+        sock = socket.socket()
+        with sock:
+            newsock = sock.dup()
+            sock.close()
+            with newsock:
+                self.assertEqual(newsock.get_inheritable(), False)
+
+    def test_set_inheritable(self):
+        sock = socket.socket()
+        with sock:
+            sock.set_inheritable(True)
+            self.assertEqual(sock.get_inheritable(), True)
+
+            sock.set_inheritable(False)
+            self.assertEqual(sock.get_inheritable(), False)
+
+    @unittest.skipIf(fcntl is None, "need fcntl")
+    def test_get_inheritable_cloexec(self):
+        sock = socket.socket()
+        with sock:
+            fd = sock.fileno()
+            self.assertEqual(sock.get_inheritable(), False)
+
+            # clear FD_CLOEXEC flag
+            flags = fcntl.fcntl(fd, fcntl.F_GETFD)
+            flags &= ~fcntl.FD_CLOEXEC
+            fcntl.fcntl(fd, fcntl.F_SETFD, flags)
+
+            self.assertEqual(sock.get_inheritable(), True)
+
+    @unittest.skipIf(fcntl is None, "need fcntl")
+    def test_set_inheritable_cloexec(self):
+        sock = socket.socket()
+        with sock:
+            fd = sock.fileno()
+            self.assertEqual(fcntl.fcntl(fd, fcntl.F_GETFD) & fcntl.FD_CLOEXEC,
+                             fcntl.FD_CLOEXEC)
+
+            sock.set_inheritable(True)
+            self.assertEqual(fcntl.fcntl(fd, fcntl.F_GETFD) & fcntl.FD_CLOEXEC,
+                             0)
+
+
+    @unittest.skipUnless(hasattr(socket, "socketpair"),
+                         "need socket.socketpair()")
+    def test_socketpair(self):
+        s1, s2 = socket.socketpair()
+        self.addCleanup(s1.close)
+        self.addCleanup(s2.close)
+        self.assertEqual(s1.get_inheritable(), False)
+        self.assertEqual(s2.get_inheritable(), False)
 
 
 @unittest.skipUnless(hasattr(socket, "SOCK_NONBLOCK"),
@@ -4891,7 +5127,7 @@
         NetworkConnectionAttributesTest,
         NetworkConnectionBehaviourTest,
         ContextManagersTest,
-        CloexecConstantTest,
+        InheritanceTest,
         NonblockConstantTest
     ])
     tests.append(BasicSocketPairTest)
diff --git a/Lib/test/test_socketserver.py b/Lib/test/test_socketserver.py
index 59d8e5d..0276f99 100644
--- a/Lib/test/test_socketserver.py
+++ b/Lib/test/test_socketserver.py
@@ -2,8 +2,8 @@
 Test suite for socketserver.
 """
 
+import _imp as imp
 import contextlib
-import imp
 import os
 import select
 import signal
@@ -29,7 +29,7 @@
 HAVE_UNIX_SOCKETS = hasattr(socket, "AF_UNIX")
 requires_unix_sockets = unittest.skipUnless(HAVE_UNIX_SOCKETS,
                                             'requires Unix sockets')
-HAVE_FORKING = hasattr(os, "fork") and os.name != "os2"
+HAVE_FORKING = hasattr(os, "fork")
 requires_forking = unittest.skipUnless(HAVE_FORKING, 'requires forking')
 
 def signal_alarm(n):
@@ -85,7 +85,7 @@
         for fn in self.test_files:
             try:
                 os.remove(fn)
-            except os.error:
+            except OSError:
                 pass
         self.test_files[:] = []
 
@@ -96,21 +96,7 @@
             # XXX: We need a way to tell AF_UNIX to pick its own name
             # like AF_INET provides port==0.
             dir = None
-            if os.name == 'os2':
-                dir = '\socket'
             fn = tempfile.mktemp(prefix='unix_socket.', dir=dir)
-            if os.name == 'os2':
-                # AF_UNIX socket names on OS/2 require a specific prefix
-                # which can't include a drive letter and must also use
-                # backslashes as directory separators
-                if fn[1] == ':':
-                    fn = fn[2:]
-                if fn[0] in (os.sep, os.altsep):
-                    fn = fn[1:]
-                if os.sep == '/':
-                    fn = fn.replace(os.sep, os.altsep)
-                else:
-                    fn = fn.replace(os.altsep, os.sep)
             self.test_files.append(fn)
             return fn
 
@@ -316,6 +302,16 @@
             t.join()
             s.server_close()
 
+    def test_tcpserver_bind_leak(self):
+        # Issue #22435: the server socket wouldn't be closed if bind()/listen()
+        # failed.
+        # Create many servers for which bind() will fail, to see if this result
+        # in FD exhaustion.
+        for i in range(1024):
+            with self.assertRaises(OverflowError):
+                socketserver.TCPServer((HOST, -1),
+                                       socketserver.StreamRequestHandler)
+
 
 def test_main():
     if imp.lock_held():
diff --git a/Lib/test/test_source_encoding.py b/Lib/test/test_source_encoding.py
new file mode 100644
index 0000000..39a7c56
--- /dev/null
+++ b/Lib/test/test_source_encoding.py
@@ -0,0 +1,146 @@
+# -*- coding: koi8-r -*-
+
+import unittest
+from test.support import TESTFN, unlink, unload, rmtree
+import importlib
+import os
+import sys
+import subprocess
+
+class SourceEncodingTest(unittest.TestCase):
+
+    def test_pep263(self):
+        self.assertEqual(
+            "ðÉÔÏÎ".encode("utf-8"),
+            b'\xd0\x9f\xd0\xb8\xd1\x82\xd0\xbe\xd0\xbd'
+        )
+        self.assertEqual(
+            "\ð".encode("utf-8"),
+            b'\\\xd0\x9f'
+        )
+
+    def test_compilestring(self):
+        # see #1882
+        c = compile(b"\n# coding: utf-8\nu = '\xc3\xb3'\n", "dummy", "exec")
+        d = {}
+        exec(c, d)
+        self.assertEqual(d['u'], '\xf3')
+
+    def test_issue2301(self):
+        try:
+            compile(b"# coding: cp932\nprint '\x94\x4e'", "dummy", "exec")
+        except SyntaxError as v:
+            self.assertEqual(v.text, "print '\u5e74'\n")
+        else:
+            self.fail()
+
+    def test_issue4626(self):
+        c = compile("# coding=latin-1\n\u00c6 = '\u00c6'", "dummy", "exec")
+        d = {}
+        exec(c, d)
+        self.assertEqual(d['\xc6'], '\xc6')
+
+    def test_issue3297(self):
+        c = compile("a, b = '\U0001010F', '\\U0001010F'", "dummy", "exec")
+        d = {}
+        exec(c, d)
+        self.assertEqual(d['a'], d['b'])
+        self.assertEqual(len(d['a']), len(d['b']))
+        self.assertEqual(ascii(d['a']), ascii(d['b']))
+
+    def test_issue7820(self):
+        # Ensure that check_bom() restores all bytes in the right order if
+        # check_bom() fails in pydebug mode: a buffer starts with the first
+        # byte of a valid BOM, but next bytes are different
+
+        # one byte in common with the UTF-16-LE BOM
+        self.assertRaises(SyntaxError, eval, b'\xff\x20')
+
+        # two bytes in common with the UTF-8 BOM
+        self.assertRaises(SyntaxError, eval, b'\xef\xbb\x20')
+
+    def test_20731(self):
+        sub = subprocess.Popen([sys.executable,
+                        os.path.join(os.path.dirname(__file__),
+                                     'coding20731.py')],
+                        stderr=subprocess.PIPE)
+        err = sub.communicate()[1]
+        self.assertEqual(sub.returncode, 0)
+        self.assertNotIn(b'SyntaxError', err)
+
+    def test_error_message(self):
+        compile(b'# -*- coding: iso-8859-15 -*-\n', 'dummy', 'exec')
+        compile(b'\xef\xbb\xbf\n', 'dummy', 'exec')
+        compile(b'\xef\xbb\xbf# -*- coding: utf-8 -*-\n', 'dummy', 'exec')
+        with self.assertRaisesRegex(SyntaxError, 'fake'):
+            compile(b'# -*- coding: fake -*-\n', 'dummy', 'exec')
+        with self.assertRaisesRegex(SyntaxError, 'iso-8859-15'):
+            compile(b'\xef\xbb\xbf# -*- coding: iso-8859-15 -*-\n',
+                    'dummy', 'exec')
+        with self.assertRaisesRegex(SyntaxError, 'BOM'):
+            compile(b'\xef\xbb\xbf# -*- coding: iso-8859-15 -*-\n',
+                    'dummy', 'exec')
+        with self.assertRaisesRegex(SyntaxError, 'fake'):
+            compile(b'\xef\xbb\xbf# -*- coding: fake -*-\n', 'dummy', 'exec')
+        with self.assertRaisesRegex(SyntaxError, 'BOM'):
+            compile(b'\xef\xbb\xbf# -*- coding: fake -*-\n', 'dummy', 'exec')
+
+    def test_bad_coding(self):
+        module_name = 'bad_coding'
+        self.verify_bad_module(module_name)
+
+    def test_bad_coding2(self):
+        module_name = 'bad_coding2'
+        self.verify_bad_module(module_name)
+
+    def verify_bad_module(self, module_name):
+        self.assertRaises(SyntaxError, __import__, 'test.' + module_name)
+
+        path = os.path.dirname(__file__)
+        filename = os.path.join(path, module_name + '.py')
+        with open(filename, "rb") as fp:
+            bytes = fp.read()
+        self.assertRaises(SyntaxError, compile, bytes, filename, 'exec')
+
+    def test_exec_valid_coding(self):
+        d = {}
+        exec(b'# coding: cp949\na = "\xaa\xa7"\n', d)
+        self.assertEqual(d['a'], '\u3047')
+
+    def test_file_parse(self):
+        # issue1134: all encodings outside latin-1 and utf-8 fail on
+        # multiline strings and long lines (>512 columns)
+        unload(TESTFN)
+        filename = TESTFN + ".py"
+        f = open(filename, "w", encoding="cp1252")
+        sys.path.insert(0, os.curdir)
+        try:
+            with f:
+                f.write("# -*- coding: cp1252 -*-\n")
+                f.write("'''A short string\n")
+                f.write("'''\n")
+                f.write("'A very long string %s'\n" % ("X" * 1000))
+
+            importlib.invalidate_caches()
+            __import__(TESTFN)
+        finally:
+            del sys.path[0]
+            unlink(filename)
+            unlink(filename + "c")
+            unlink(filename + "o")
+            unload(TESTFN)
+            rmtree('__pycache__')
+
+    def test_error_from_string(self):
+        # See http://bugs.python.org/issue6289
+        input = "# coding: ascii\n\N{SNOWMAN}".encode('utf-8')
+        with self.assertRaises(SyntaxError) as c:
+            compile(input, "<string>", "exec")
+        expected = "'ascii' codec can't decode byte 0xe2 in position 16: " \
+                   "ordinal not in range(128)"
+        self.assertTrue(c.exception.args[0].startswith(expected),
+                        msg=c.exception.args[0])
+
+
+if __name__ == "__main__":
+    unittest.main()
diff --git a/Lib/test/test_spwd.py b/Lib/test/test_spwd.py
new file mode 100644
index 0000000..bea7ab1
--- /dev/null
+++ b/Lib/test/test_spwd.py
@@ -0,0 +1,60 @@
+import os
+import unittest
+from test import support
+
+spwd = support.import_module('spwd')
+
+
+@unittest.skipUnless(hasattr(os, 'geteuid') and os.geteuid() == 0,
+                     'root privileges required')
+class TestSpwdRoot(unittest.TestCase):
+
+    def test_getspall(self):
+        entries = spwd.getspall()
+        self.assertIsInstance(entries, list)
+        for entry in entries:
+            self.assertIsInstance(entry, spwd.struct_spwd)
+
+    def test_getspnam(self):
+        entries = spwd.getspall()
+        if not entries:
+            self.skipTest('empty shadow password database')
+        random_name = entries[0].sp_namp
+        entry = spwd.getspnam(random_name)
+        self.assertIsInstance(entry, spwd.struct_spwd)
+        self.assertEqual(entry.sp_namp, random_name)
+        self.assertEqual(entry.sp_namp, entry[0])
+        self.assertEqual(entry.sp_namp, entry.sp_nam)
+        self.assertIsInstance(entry.sp_pwdp, str)
+        self.assertEqual(entry.sp_pwdp, entry[1])
+        self.assertEqual(entry.sp_pwdp, entry.sp_pwd)
+        self.assertIsInstance(entry.sp_lstchg, int)
+        self.assertEqual(entry.sp_lstchg, entry[2])
+        self.assertIsInstance(entry.sp_min, int)
+        self.assertEqual(entry.sp_min, entry[3])
+        self.assertIsInstance(entry.sp_max, int)
+        self.assertEqual(entry.sp_max, entry[4])
+        self.assertIsInstance(entry.sp_warn, int)
+        self.assertEqual(entry.sp_warn, entry[5])
+        self.assertIsInstance(entry.sp_inact, int)
+        self.assertEqual(entry.sp_inact, entry[6])
+        self.assertIsInstance(entry.sp_expire, int)
+        self.assertEqual(entry.sp_expire, entry[7])
+        self.assertIsInstance(entry.sp_flag, int)
+        self.assertEqual(entry.sp_flag, entry[8])
+        with self.assertRaises(KeyError) as cx:
+            spwd.getspnam('invalid user name')
+        self.assertEqual(str(cx.exception), "'getspnam(): name not found'")
+        self.assertRaises(TypeError, spwd.getspnam)
+        self.assertRaises(TypeError, spwd.getspnam, 0)
+        self.assertRaises(TypeError, spwd.getspnam, random_name, 0)
+        try:
+            bytes_name = os.fsencode(random_name)
+        except UnicodeEncodeError:
+            pass
+        else:
+            self.assertRaises(TypeError, spwd.getspnam, bytes_name)
+
+
+if __name__ == "__main__":
+    unittest.main()
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index e52a71c..0a7b905 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -6,6 +6,7 @@
 import socket
 import select
 import time
+import datetime
 import gc
 import os
 import errno
@@ -17,19 +18,15 @@
 import weakref
 import platform
 import functools
+from unittest import mock
 
 ssl = support.import_module("ssl")
 
-PROTOCOLS = [
-    ssl.PROTOCOL_SSLv3,
-    ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1
-]
-if hasattr(ssl, 'PROTOCOL_SSLv2'):
-    PROTOCOLS.append(ssl.PROTOCOL_SSLv2)
-
+PROTOCOLS = sorted(ssl._PROTOCOL_NAMES)
 HOST = support.HOST
 
-data_file = lambda name: os.path.join(os.path.dirname(__file__), name)
+def data_file(*name):
+    return os.path.join(os.path.dirname(__file__), *name)
 
 # The custom key and certificate files used in test_ssl are generated
 # using Lib/test/make_ssl_certs.py.
@@ -47,6 +44,17 @@
 KEY_PASSWORD = "somepass"
 CAPATH = data_file("capath")
 BYTES_CAPATH = os.fsencode(CAPATH)
+CAFILE_NEURONIO = data_file("capath", "4e1295a3.0")
+CAFILE_CACERT = data_file("capath", "5ed36f99.0")
+
+
+# empty CRL
+CRLFILE = data_file("revocation.crl")
+
+# Two keys and certs signed by the same CA (for SNI tests)
+SIGNED_CERTFILE = data_file("keycert3.pem")
+SIGNED_CERTFILE2 = data_file("keycert4.pem")
+SIGNING_CA = data_file("pycacert.pem")
 
 SVN_PYTHON_ORG_ROOT_CERT = data_file("https_svn_python_org_root.pem")
 
@@ -60,6 +68,7 @@
 DHFILE = data_file("dh512.pem")
 BYTES_DHFILE = os.fsencode(DHFILE)
 
+
 def handle_error(prefix):
     exc_format = ' '.join(traceback.format_exception(*sys.exc_info()))
     if support.verbose:
@@ -73,6 +82,23 @@
     # 0.9.7h or higher
     return ssl.OPENSSL_VERSION_INFO >= (0, 9, 7, 8, 15)
 
+def have_verify_flags():
+    # 0.9.8 or higher
+    return ssl.OPENSSL_VERSION_INFO >= (0, 9, 8, 0, 15)
+
+def asn1time(cert_time):
+    # Some versions of OpenSSL ignore seconds, see #18207
+    # 0.9.8.i
+    if ssl._OPENSSL_API_VERSION == (0, 9, 8, 9, 15):
+        fmt = "%b %d %H:%M:%S %Y GMT"
+        dt = datetime.datetime.strptime(cert_time, fmt)
+        dt = dt.replace(second=0)
+        cert_time = dt.strftime(fmt)
+        # %d adds leading zero but ASN1_TIME_print() uses leading space
+        if cert_time[4] == "0":
+            cert_time = cert_time[:4] + " " + cert_time[5:]
+
+    return cert_time
 
 # Issue #9415: Ubuntu hijacks their OpenSSL and forcefully disables SSLv2
 def skip_if_broken_ubuntu_ssl(func):
@@ -90,14 +116,12 @@
     else:
         return func
 
+needs_sni = unittest.skipUnless(ssl.HAS_SNI, "SNI support needed for this test")
+
 
 class BasicSocketTests(unittest.TestCase):
 
     def test_constants(self):
-        #ssl.PROTOCOL_SSLv2
-        ssl.PROTOCOL_SSLv23
-        ssl.PROTOCOL_SSLv3
-        ssl.PROTOCOL_TLSv1
         ssl.CERT_NONE
         ssl.CERT_OPTIONAL
         ssl.CERT_REQUIRED
@@ -130,8 +154,9 @@
         self.assertRaises(ValueError, ssl.RAND_bytes, -5)
         self.assertRaises(ValueError, ssl.RAND_pseudo_bytes, -5)
 
-        self.assertRaises(TypeError, ssl.RAND_egd, 1)
-        self.assertRaises(TypeError, ssl.RAND_egd, 'foo', 1)
+        if hasattr(ssl, 'RAND_egd'):
+            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)
 
     @unittest.skipUnless(os.name == 'posix', 'requires posix')
@@ -179,8 +204,9 @@
                           (('organizationName', 'Python Software Foundation'),),
                           (('commonName', 'localhost'),))
                         )
-        self.assertEqual(p['notAfter'], 'Oct  5 23:01:56 2020 GMT')
-        self.assertEqual(p['notBefore'], 'Oct  8 23:01:56 2010 GMT')
+        # Note the next three asserts will fail if the keys are regenerated
+        self.assertEqual(p['notAfter'], asn1time('Oct  5 23:01:56 2020 GMT'))
+        self.assertEqual(p['notBefore'], asn1time('Oct  8 23:01:56 2010 GMT'))
         self.assertEqual(p['serialNumber'], 'D7C7381919AFC24E')
         self.assertEqual(p['subject'],
                          ((('countryName', 'XY'),),
@@ -198,6 +224,12 @@
                          (('DNS', 'projects.developer.nokia.com'),
                           ('DNS', 'projects.forum.nokia.com'))
                         )
+        # extra OCSP and AIA fields
+        self.assertEqual(p['OCSP'], ('http://ocsp.verisign.com',))
+        self.assertEqual(p['caIssuers'],
+                         ('http://SVRIntl-G3-aia.verisign.com/SVRIntlG3.cer',))
+        self.assertEqual(p['crlDistributionPoints'],
+                         ('http://SVRIntl-G3-crl.verisign.com/SVRIntlG3.crl',))
 
     def test_parse_cert_CVE_2013_4238(self):
         p = ssl._ssl._test_decode_cert(NULLBYTECERT)
@@ -250,11 +282,11 @@
         # Some sanity checks follow
         # >= 0.9
         self.assertGreaterEqual(n, 0x900000)
-        # < 2.0
-        self.assertLess(n, 0x20000000)
+        # < 3.0
+        self.assertLess(n, 0x30000000)
         major, minor, fix, patch, status = t
         self.assertGreaterEqual(major, 0)
-        self.assertLess(major, 2)
+        self.assertLess(major, 3)
         self.assertGreaterEqual(minor, 0)
         self.assertLess(minor, 256)
         self.assertGreaterEqual(fix, 0)
@@ -263,9 +295,13 @@
         self.assertLessEqual(patch, 26)
         self.assertGreaterEqual(status, 0)
         self.assertLessEqual(status, 15)
-        # Version string as returned by OpenSSL, the format might change
-        self.assertTrue(s.startswith("OpenSSL {:d}.{:d}.{:d}".format(major, minor, fix)),
-                        (s, t))
+        # Version string as returned by {Open,Libre}SSL, the format might change
+        if "LibreSSL" in s:
+            self.assertTrue(s.startswith("LibreSSL {:d}.{:d}".format(major, minor)),
+                            (s, t))
+        else:
+            self.assertTrue(s.startswith("OpenSSL {:d}.{:d}.{:d}".format(major, minor, fix)),
+                            (s, t))
 
     @support.cpython_only
     def test_refcycle(self):
@@ -280,15 +316,15 @@
 
     def test_wrapped_unconnected(self):
         # Methods on an unconnected SSLSocket propagate the original
-        # socket.error raise by the underlying socket object.
+        # OSError raise by the underlying socket object.
         s = socket.socket(socket.AF_INET)
         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))
+            self.assertRaises(OSError, ss.recv, 1)
+            self.assertRaises(OSError, ss.recv_into, bytearray(b'x'))
+            self.assertRaises(OSError, ss.recvfrom, 1)
+            self.assertRaises(OSError, ss.recvfrom_into, bytearray(b'x'), 1)
+            self.assertRaises(OSError, ss.send, b'x')
+            self.assertRaises(OSError, ss.sendto, b'x', ('0.0.0.0', 0))
 
     def test_timeout(self):
         # Issue #8524: when creating an SSL socket, the timeout of the
@@ -313,15 +349,15 @@
         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 self.assertRaises(OSError) as cm:
             with socket.socket() as sock:
                 ssl.wrap_socket(sock, certfile=WRONGCERT)
         self.assertEqual(cm.exception.errno, errno.ENOENT)
-        with self.assertRaises(IOError) as cm:
+        with self.assertRaises(OSError) as cm:
             with socket.socket() as sock:
                 ssl.wrap_socket(sock, certfile=CERTFILE, keyfile=WRONGCERT)
         self.assertEqual(cm.exception.errno, errno.ENOENT)
-        with self.assertRaises(IOError) as cm:
+        with self.assertRaises(OSError) as cm:
             with socket.socket() as sock:
                 ssl.wrap_socket(sock, certfile=WRONGCERT, keyfile=WRONGCERT)
         self.assertEqual(cm.exception.errno, errno.ENOENT)
@@ -493,6 +529,114 @@
             support.gc_collect()
         self.assertIn(r, str(cm.warning.args[0]))
 
+    def test_get_default_verify_paths(self):
+        paths = ssl.get_default_verify_paths()
+        self.assertEqual(len(paths), 6)
+        self.assertIsInstance(paths, ssl.DefaultVerifyPaths)
+
+        with support.EnvironmentVarGuard() as env:
+            env["SSL_CERT_DIR"] = CAPATH
+            env["SSL_CERT_FILE"] = CERTFILE
+            paths = ssl.get_default_verify_paths()
+            self.assertEqual(paths.cafile, CERTFILE)
+            self.assertEqual(paths.capath, CAPATH)
+
+    @unittest.skipUnless(sys.platform == "win32", "Windows specific")
+    def test_enum_certificates(self):
+        self.assertTrue(ssl.enum_certificates("CA"))
+        self.assertTrue(ssl.enum_certificates("ROOT"))
+
+        self.assertRaises(TypeError, ssl.enum_certificates)
+        self.assertRaises(WindowsError, ssl.enum_certificates, "")
+
+        trust_oids = set()
+        for storename in ("CA", "ROOT"):
+            store = ssl.enum_certificates(storename)
+            self.assertIsInstance(store, list)
+            for element in store:
+                self.assertIsInstance(element, tuple)
+                self.assertEqual(len(element), 3)
+                cert, enc, trust = element
+                self.assertIsInstance(cert, bytes)
+                self.assertIn(enc, {"x509_asn", "pkcs_7_asn"})
+                self.assertIsInstance(trust, (set, bool))
+                if isinstance(trust, set):
+                    trust_oids.update(trust)
+
+        serverAuth = "1.3.6.1.5.5.7.3.1"
+        self.assertIn(serverAuth, trust_oids)
+
+    @unittest.skipUnless(sys.platform == "win32", "Windows specific")
+    def test_enum_crls(self):
+        self.assertTrue(ssl.enum_crls("CA"))
+        self.assertRaises(TypeError, ssl.enum_crls)
+        self.assertRaises(WindowsError, ssl.enum_crls, "")
+
+        crls = ssl.enum_crls("CA")
+        self.assertIsInstance(crls, list)
+        for element in crls:
+            self.assertIsInstance(element, tuple)
+            self.assertEqual(len(element), 2)
+            self.assertIsInstance(element[0], bytes)
+            self.assertIn(element[1], {"x509_asn", "pkcs_7_asn"})
+
+
+    def test_asn1object(self):
+        expected = (129, 'serverAuth', 'TLS Web Server Authentication',
+                    '1.3.6.1.5.5.7.3.1')
+
+        val = ssl._ASN1Object('1.3.6.1.5.5.7.3.1')
+        self.assertEqual(val, expected)
+        self.assertEqual(val.nid, 129)
+        self.assertEqual(val.shortname, 'serverAuth')
+        self.assertEqual(val.longname, 'TLS Web Server Authentication')
+        self.assertEqual(val.oid, '1.3.6.1.5.5.7.3.1')
+        self.assertIsInstance(val, ssl._ASN1Object)
+        self.assertRaises(ValueError, ssl._ASN1Object, 'serverAuth')
+
+        val = ssl._ASN1Object.fromnid(129)
+        self.assertEqual(val, expected)
+        self.assertIsInstance(val, ssl._ASN1Object)
+        self.assertRaises(ValueError, ssl._ASN1Object.fromnid, -1)
+        with self.assertRaisesRegex(ValueError, "unknown NID 100000"):
+            ssl._ASN1Object.fromnid(100000)
+        for i in range(1000):
+            try:
+                obj = ssl._ASN1Object.fromnid(i)
+            except ValueError:
+                pass
+            else:
+                self.assertIsInstance(obj.nid, int)
+                self.assertIsInstance(obj.shortname, str)
+                self.assertIsInstance(obj.longname, str)
+                self.assertIsInstance(obj.oid, (str, type(None)))
+
+        val = ssl._ASN1Object.fromname('TLS Web Server Authentication')
+        self.assertEqual(val, expected)
+        self.assertIsInstance(val, ssl._ASN1Object)
+        self.assertEqual(ssl._ASN1Object.fromname('serverAuth'), expected)
+        self.assertEqual(ssl._ASN1Object.fromname('1.3.6.1.5.5.7.3.1'),
+                         expected)
+        with self.assertRaisesRegex(ValueError, "unknown object 'serverauth'"):
+            ssl._ASN1Object.fromname('serverauth')
+
+    def test_purpose_enum(self):
+        val = ssl._ASN1Object('1.3.6.1.5.5.7.3.1')
+        self.assertIsInstance(ssl.Purpose.SERVER_AUTH, ssl._ASN1Object)
+        self.assertEqual(ssl.Purpose.SERVER_AUTH, val)
+        self.assertEqual(ssl.Purpose.SERVER_AUTH.nid, 129)
+        self.assertEqual(ssl.Purpose.SERVER_AUTH.shortname, 'serverAuth')
+        self.assertEqual(ssl.Purpose.SERVER_AUTH.oid,
+                              '1.3.6.1.5.5.7.3.1')
+
+        val = ssl._ASN1Object('1.3.6.1.5.5.7.3.2')
+        self.assertIsInstance(ssl.Purpose.CLIENT_AUTH, ssl._ASN1Object)
+        self.assertEqual(ssl.Purpose.CLIENT_AUTH, val)
+        self.assertEqual(ssl.Purpose.CLIENT_AUTH.nid, 130)
+        self.assertEqual(ssl.Purpose.CLIENT_AUTH.shortname, 'clientAuth')
+        self.assertEqual(ssl.Purpose.CLIENT_AUTH.oid,
+                              '1.3.6.1.5.5.7.3.2')
+
     def test_unsupported_dtls(self):
         s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
         self.addCleanup(s.close)
@@ -509,11 +653,8 @@
 
     @skip_if_broken_ubuntu_ssl
     def test_constructor(self):
-        if hasattr(ssl, 'PROTOCOL_SSLv2'):
-            ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv2)
-        ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
-        ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv3)
-        ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+        for protocol in PROTOCOLS:
+            ssl.SSLContext(protocol)
         self.assertRaises(TypeError, ssl.SSLContext)
         self.assertRaises(ValueError, ssl.SSLContext, -1)
         self.assertRaises(ValueError, ssl.SSLContext, 42)
@@ -550,7 +691,7 @@
             with self.assertRaises(ValueError):
                 ctx.options = 0
 
-    def test_verify(self):
+    def test_verify_mode(self):
         ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
         # Default value
         self.assertEqual(ctx.verify_mode, ssl.CERT_NONE)
@@ -565,13 +706,32 @@
         with self.assertRaises(ValueError):
             ctx.verify_mode = 42
 
+    @unittest.skipUnless(have_verify_flags(),
+                         "verify_flags need OpenSSL > 0.9.8")
+    def test_verify_flags(self):
+        ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+        # default value by OpenSSL
+        self.assertEqual(ctx.verify_flags, ssl.VERIFY_DEFAULT)
+        ctx.verify_flags = ssl.VERIFY_CRL_CHECK_LEAF
+        self.assertEqual(ctx.verify_flags, ssl.VERIFY_CRL_CHECK_LEAF)
+        ctx.verify_flags = ssl.VERIFY_CRL_CHECK_CHAIN
+        self.assertEqual(ctx.verify_flags, ssl.VERIFY_CRL_CHECK_CHAIN)
+        ctx.verify_flags = ssl.VERIFY_DEFAULT
+        self.assertEqual(ctx.verify_flags, ssl.VERIFY_DEFAULT)
+        # supports any value
+        ctx.verify_flags = ssl.VERIFY_CRL_CHECK_LEAF | ssl.VERIFY_X509_STRICT
+        self.assertEqual(ctx.verify_flags,
+                         ssl.VERIFY_CRL_CHECK_LEAF | ssl.VERIFY_X509_STRICT)
+        with self.assertRaises(TypeError):
+            ctx.verify_flags = None
+
     def test_load_cert_chain(self):
         ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
         # Combined key and cert in a single file
-        ctx.load_cert_chain(CERTFILE)
+        ctx.load_cert_chain(CERTFILE, keyfile=None)
         ctx.load_cert_chain(CERTFILE, keyfile=CERTFILE)
         self.assertRaises(TypeError, ctx.load_cert_chain, keyfile=CERTFILE)
-        with self.assertRaises(IOError) as cm:
+        with self.assertRaises(OSError) as cm:
             ctx.load_cert_chain(WRONGCERT)
         self.assertEqual(cm.exception.errno, errno.ENOENT)
         with self.assertRaisesRegex(ssl.SSLError, "PEM lib"):
@@ -655,8 +815,8 @@
         ctx.load_verify_locations(BYTES_CERTFILE)
         ctx.load_verify_locations(cafile=BYTES_CERTFILE, capath=None)
         self.assertRaises(TypeError, ctx.load_verify_locations)
-        self.assertRaises(TypeError, ctx.load_verify_locations, None, None)
-        with self.assertRaises(IOError) as cm:
+        self.assertRaises(TypeError, ctx.load_verify_locations, None, None, None)
+        with self.assertRaises(OSError) as cm:
             ctx.load_verify_locations(WRONGCERT)
         self.assertEqual(cm.exception.errno, errno.ENOENT)
         with self.assertRaisesRegex(ssl.SSLError, "PEM lib"):
@@ -667,6 +827,64 @@
         # Issue #10989: crash if the second argument type is invalid
         self.assertRaises(TypeError, ctx.load_verify_locations, None, True)
 
+    def test_load_verify_cadata(self):
+        # test cadata
+        with open(CAFILE_CACERT) as f:
+            cacert_pem = f.read()
+        cacert_der = ssl.PEM_cert_to_DER_cert(cacert_pem)
+        with open(CAFILE_NEURONIO) as f:
+            neuronio_pem = f.read()
+        neuronio_der = ssl.PEM_cert_to_DER_cert(neuronio_pem)
+
+        # test PEM
+        ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+        self.assertEqual(ctx.cert_store_stats()["x509_ca"], 0)
+        ctx.load_verify_locations(cadata=cacert_pem)
+        self.assertEqual(ctx.cert_store_stats()["x509_ca"], 1)
+        ctx.load_verify_locations(cadata=neuronio_pem)
+        self.assertEqual(ctx.cert_store_stats()["x509_ca"], 2)
+        # cert already in hash table
+        ctx.load_verify_locations(cadata=neuronio_pem)
+        self.assertEqual(ctx.cert_store_stats()["x509_ca"], 2)
+
+        # combined
+        ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+        combined = "\n".join((cacert_pem, neuronio_pem))
+        ctx.load_verify_locations(cadata=combined)
+        self.assertEqual(ctx.cert_store_stats()["x509_ca"], 2)
+
+        # with junk around the certs
+        ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+        combined = ["head", cacert_pem, "other", neuronio_pem, "again",
+                    neuronio_pem, "tail"]
+        ctx.load_verify_locations(cadata="\n".join(combined))
+        self.assertEqual(ctx.cert_store_stats()["x509_ca"], 2)
+
+        # test DER
+        ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+        ctx.load_verify_locations(cadata=cacert_der)
+        ctx.load_verify_locations(cadata=neuronio_der)
+        self.assertEqual(ctx.cert_store_stats()["x509_ca"], 2)
+        # cert already in hash table
+        ctx.load_verify_locations(cadata=cacert_der)
+        self.assertEqual(ctx.cert_store_stats()["x509_ca"], 2)
+
+        # combined
+        ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+        combined = b"".join((cacert_der, neuronio_der))
+        ctx.load_verify_locations(cadata=combined)
+        self.assertEqual(ctx.cert_store_stats()["x509_ca"], 2)
+
+        # error cases
+        ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+        self.assertRaises(TypeError, ctx.load_verify_locations, cadata=object)
+
+        with self.assertRaisesRegex(ssl.SSLError, "no start line"):
+            ctx.load_verify_locations(cadata="broken")
+        with self.assertRaisesRegex(ssl.SSLError, "not enough data"):
+            ctx.load_verify_locations(cadata=b"broken")
+
+
     def test_load_dh_params(self):
         ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
         ctx.load_dh_params(DHFILE)
@@ -714,6 +932,201 @@
         self.assertRaises(ValueError, ctx.set_ecdh_curve, "foo")
         self.assertRaises(ValueError, ctx.set_ecdh_curve, b"foo")
 
+    @needs_sni
+    def test_sni_callback(self):
+        ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+
+        # set_servername_callback expects a callable, or None
+        self.assertRaises(TypeError, ctx.set_servername_callback)
+        self.assertRaises(TypeError, ctx.set_servername_callback, 4)
+        self.assertRaises(TypeError, ctx.set_servername_callback, "")
+        self.assertRaises(TypeError, ctx.set_servername_callback, ctx)
+
+        def dummycallback(sock, servername, ctx):
+            pass
+        ctx.set_servername_callback(None)
+        ctx.set_servername_callback(dummycallback)
+
+    @needs_sni
+    def test_sni_callback_refcycle(self):
+        # Reference cycles through the servername callback are detected
+        # and cleared.
+        ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+        def dummycallback(sock, servername, ctx, cycle=ctx):
+            pass
+        ctx.set_servername_callback(dummycallback)
+        wr = weakref.ref(ctx)
+        del ctx, dummycallback
+        gc.collect()
+        self.assertIs(wr(), None)
+
+    def test_cert_store_stats(self):
+        ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+        self.assertEqual(ctx.cert_store_stats(),
+            {'x509_ca': 0, 'crl': 0, 'x509': 0})
+        ctx.load_cert_chain(CERTFILE)
+        self.assertEqual(ctx.cert_store_stats(),
+            {'x509_ca': 0, 'crl': 0, 'x509': 0})
+        ctx.load_verify_locations(CERTFILE)
+        self.assertEqual(ctx.cert_store_stats(),
+            {'x509_ca': 0, 'crl': 0, 'x509': 1})
+        ctx.load_verify_locations(SVN_PYTHON_ORG_ROOT_CERT)
+        self.assertEqual(ctx.cert_store_stats(),
+            {'x509_ca': 1, 'crl': 0, 'x509': 2})
+
+    def test_get_ca_certs(self):
+        ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+        self.assertEqual(ctx.get_ca_certs(), [])
+        # CERTFILE is not flagged as X509v3 Basic Constraints: CA:TRUE
+        ctx.load_verify_locations(CERTFILE)
+        self.assertEqual(ctx.get_ca_certs(), [])
+        # but SVN_PYTHON_ORG_ROOT_CERT is a CA cert
+        ctx.load_verify_locations(SVN_PYTHON_ORG_ROOT_CERT)
+        self.assertEqual(ctx.get_ca_certs(),
+            [{'issuer': ((('organizationName', 'Root CA'),),
+                         (('organizationalUnitName', 'http://www.cacert.org'),),
+                         (('commonName', 'CA Cert Signing Authority'),),
+                         (('emailAddress', 'support@cacert.org'),)),
+              'notAfter': asn1time('Mar 29 12:29:49 2033 GMT'),
+              'notBefore': asn1time('Mar 30 12:29:49 2003 GMT'),
+              'serialNumber': '00',
+              'crlDistributionPoints': ('https://www.cacert.org/revoke.crl',),
+              'subject': ((('organizationName', 'Root CA'),),
+                          (('organizationalUnitName', 'http://www.cacert.org'),),
+                          (('commonName', 'CA Cert Signing Authority'),),
+                          (('emailAddress', 'support@cacert.org'),)),
+              'version': 3}])
+
+        with open(SVN_PYTHON_ORG_ROOT_CERT) as f:
+            pem = f.read()
+        der = ssl.PEM_cert_to_DER_cert(pem)
+        self.assertEqual(ctx.get_ca_certs(True), [der])
+
+    def test_load_default_certs(self):
+        ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+        ctx.load_default_certs()
+
+        ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+        ctx.load_default_certs(ssl.Purpose.SERVER_AUTH)
+        ctx.load_default_certs()
+
+        ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+        ctx.load_default_certs(ssl.Purpose.CLIENT_AUTH)
+
+        ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+        self.assertRaises(TypeError, ctx.load_default_certs, None)
+        self.assertRaises(TypeError, ctx.load_default_certs, 'SERVER_AUTH')
+
+    @unittest.skipIf(sys.platform == "win32", "not-Windows specific")
+    def test_load_default_certs_env(self):
+        ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+        with support.EnvironmentVarGuard() as env:
+            env["SSL_CERT_DIR"] = CAPATH
+            env["SSL_CERT_FILE"] = CERTFILE
+            ctx.load_default_certs()
+            self.assertEqual(ctx.cert_store_stats(), {"crl": 0, "x509": 1, "x509_ca": 0})
+
+    @unittest.skipUnless(sys.platform == "win32", "Windows specific")
+    def test_load_default_certs_env_windows(self):
+        ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+        ctx.load_default_certs()
+        stats = ctx.cert_store_stats()
+
+        ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+        with support.EnvironmentVarGuard() as env:
+            env["SSL_CERT_DIR"] = CAPATH
+            env["SSL_CERT_FILE"] = CERTFILE
+            ctx.load_default_certs()
+            stats["x509"] += 1
+            self.assertEqual(ctx.cert_store_stats(), stats)
+
+    def test_create_default_context(self):
+        ctx = ssl.create_default_context()
+        self.assertEqual(ctx.protocol, ssl.PROTOCOL_SSLv23)
+        self.assertEqual(ctx.verify_mode, ssl.CERT_REQUIRED)
+        self.assertTrue(ctx.check_hostname)
+        self.assertEqual(ctx.options & ssl.OP_NO_SSLv2, ssl.OP_NO_SSLv2)
+        self.assertEqual(
+            ctx.options & getattr(ssl, "OP_NO_COMPRESSION", 0),
+            getattr(ssl, "OP_NO_COMPRESSION", 0),
+        )
+
+        with open(SIGNING_CA) as f:
+            cadata = f.read()
+        ctx = ssl.create_default_context(cafile=SIGNING_CA, capath=CAPATH,
+                                         cadata=cadata)
+        self.assertEqual(ctx.protocol, ssl.PROTOCOL_SSLv23)
+        self.assertEqual(ctx.verify_mode, ssl.CERT_REQUIRED)
+        self.assertEqual(ctx.options & ssl.OP_NO_SSLv2, ssl.OP_NO_SSLv2)
+        self.assertEqual(
+            ctx.options & getattr(ssl, "OP_NO_COMPRESSION", 0),
+            getattr(ssl, "OP_NO_COMPRESSION", 0),
+        )
+
+        ctx = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
+        self.assertEqual(ctx.protocol, ssl.PROTOCOL_SSLv23)
+        self.assertEqual(ctx.verify_mode, ssl.CERT_NONE)
+        self.assertEqual(ctx.options & ssl.OP_NO_SSLv2, ssl.OP_NO_SSLv2)
+        self.assertEqual(
+            ctx.options & getattr(ssl, "OP_NO_COMPRESSION", 0),
+            getattr(ssl, "OP_NO_COMPRESSION", 0),
+        )
+        self.assertEqual(
+            ctx.options & getattr(ssl, "OP_SINGLE_DH_USE", 0),
+            getattr(ssl, "OP_SINGLE_DH_USE", 0),
+        )
+        self.assertEqual(
+            ctx.options & getattr(ssl, "OP_SINGLE_ECDH_USE", 0),
+            getattr(ssl, "OP_SINGLE_ECDH_USE", 0),
+        )
+
+    def test__create_stdlib_context(self):
+        ctx = ssl._create_stdlib_context()
+        self.assertEqual(ctx.protocol, ssl.PROTOCOL_SSLv23)
+        self.assertEqual(ctx.verify_mode, ssl.CERT_NONE)
+        self.assertFalse(ctx.check_hostname)
+        self.assertEqual(ctx.options & ssl.OP_NO_SSLv2, ssl.OP_NO_SSLv2)
+
+        ctx = ssl._create_stdlib_context(ssl.PROTOCOL_TLSv1)
+        self.assertEqual(ctx.protocol, ssl.PROTOCOL_TLSv1)
+        self.assertEqual(ctx.verify_mode, ssl.CERT_NONE)
+        self.assertEqual(ctx.options & ssl.OP_NO_SSLv2, ssl.OP_NO_SSLv2)
+
+        ctx = ssl._create_stdlib_context(ssl.PROTOCOL_TLSv1,
+                                         cert_reqs=ssl.CERT_REQUIRED,
+                                         check_hostname=True)
+        self.assertEqual(ctx.protocol, ssl.PROTOCOL_TLSv1)
+        self.assertEqual(ctx.verify_mode, ssl.CERT_REQUIRED)
+        self.assertTrue(ctx.check_hostname)
+        self.assertEqual(ctx.options & ssl.OP_NO_SSLv2, ssl.OP_NO_SSLv2)
+
+        ctx = ssl._create_stdlib_context(purpose=ssl.Purpose.CLIENT_AUTH)
+        self.assertEqual(ctx.protocol, ssl.PROTOCOL_SSLv23)
+        self.assertEqual(ctx.verify_mode, ssl.CERT_NONE)
+        self.assertEqual(ctx.options & ssl.OP_NO_SSLv2, ssl.OP_NO_SSLv2)
+
+    def test_check_hostname(self):
+        ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+        self.assertFalse(ctx.check_hostname)
+
+        # Requires CERT_REQUIRED or CERT_OPTIONAL
+        with self.assertRaises(ValueError):
+            ctx.check_hostname = True
+        ctx.verify_mode = ssl.CERT_REQUIRED
+        self.assertFalse(ctx.check_hostname)
+        ctx.check_hostname = True
+        self.assertTrue(ctx.check_hostname)
+
+        ctx.verify_mode = ssl.CERT_OPTIONAL
+        ctx.check_hostname = True
+        self.assertTrue(ctx.check_hostname)
+
+        # Cannot set CERT_NONE with check_hostname enabled
+        with self.assertRaises(ValueError):
+            ctx.verify_mode = ssl.CERT_NONE
+        ctx.check_hostname = False
+        self.assertFalse(ctx.check_hostname)
+
 
 class SSLErrorTests(unittest.TestCase):
 
@@ -869,11 +1282,8 @@
             # Same with a server hostname
             s = ctx.wrap_socket(socket.socket(socket.AF_INET),
                                 server_hostname="svn.python.org")
-            if ssl.HAS_SNI:
-                s.connect(("svn.python.org", 443))
-                s.close()
-            else:
-                self.assertRaises(ValueError, s.connect, ("svn.python.org", 443))
+            s.connect(("svn.python.org", 443))
+            s.close()
             # This should fail because we have no verification certs
             ctx.verify_mode = ssl.CERT_REQUIRED
             s = ctx.wrap_socket(socket.socket(socket.AF_INET))
@@ -919,6 +1329,28 @@
             finally:
                 s.close()
 
+    def test_connect_cadata(self):
+        with open(CAFILE_CACERT) as f:
+            pem = f.read()
+        der = ssl.PEM_cert_to_DER_cert(pem)
+        with support.transient_internet("svn.python.org"):
+            ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+            ctx.verify_mode = ssl.CERT_REQUIRED
+            ctx.load_verify_locations(cadata=pem)
+            with ctx.wrap_socket(socket.socket(socket.AF_INET)) as s:
+                s.connect(("svn.python.org", 443))
+                cert = s.getpeercert()
+                self.assertTrue(cert)
+
+            # same with DER
+            ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+            ctx.verify_mode = ssl.CERT_REQUIRED
+            ctx.load_verify_locations(cadata=der)
+            with ctx.wrap_socket(socket.socket(socket.AF_INET)) as s:
+                s.connect(("svn.python.org", 443))
+                cert = s.getpeercert()
+                self.assertTrue(cert)
+
     @unittest.skipIf(os.name == "nt", "Can't use a socket as a file under Windows")
     def test_makefile_close(self):
         # Issue #5238: creating a file-like object with makefile() shouldn't
@@ -1036,6 +1468,36 @@
             finally:
                 s.close()
 
+    def test_get_ca_certs_capath(self):
+        # capath certs are loaded on request
+        with support.transient_internet("svn.python.org"):
+            ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+            ctx.verify_mode = ssl.CERT_REQUIRED
+            ctx.load_verify_locations(capath=CAPATH)
+            self.assertEqual(ctx.get_ca_certs(), [])
+            s = ctx.wrap_socket(socket.socket(socket.AF_INET))
+            s.connect(("svn.python.org", 443))
+            try:
+                cert = s.getpeercert()
+                self.assertTrue(cert)
+            finally:
+                s.close()
+            self.assertEqual(len(ctx.get_ca_certs()), 1)
+
+    @needs_sni
+    def test_context_setget(self):
+        # Check that the context of a connected socket can be replaced.
+        with support.transient_internet("svn.python.org"):
+            ctx1 = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+            ctx2 = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+            s = socket.socket(socket.AF_INET)
+            with ctx1.wrap_socket(s) as ss:
+                ss.connect(("svn.python.org", 443))
+                self.assertIs(ss.context, ctx1)
+                self.assertIs(ss._sslobj.context, ctx1)
+                ss.context = ctx2
+                self.assertIs(ss.context, ctx2)
+                self.assertIs(ss._sslobj.context, ctx2)
 
 try:
     import threading
@@ -1163,7 +1625,7 @@
                                 sys.stdout.write(" server: read %r (%s), sending back %r (%s)...\n"
                                                  % (msg, ctype, msg.lower(), ctype))
                             self.write(msg.lower())
-                    except socket.error:
+                    except OSError:
                         if self.server.chatty:
                             handle_error("Test server failure:\n")
                         self.close()
@@ -1273,7 +1735,7 @@
                         return self.handle_close()
                     except ssl.SSLError:
                         raise
-                    except socket.error as err:
+                    except OSError as err:
                         if err.args[0] == errno.ECONNABORTED:
                             return self.handle_close()
                     else:
@@ -1377,19 +1839,19 @@
             except ssl.SSLError as x:
                 if support.verbose:
                     sys.stdout.write("\nSSLError is %s\n" % x.args[1])
-            except socket.error as x:
+            except OSError as x:
                 if support.verbose:
-                    sys.stdout.write("\nsocket.error is %s\n" % x.args[1])
-            except IOError as x:
+                    sys.stdout.write("\nOSError is %s\n" % x.args[1])
+            except OSError as x:
                 if x.errno != errno.ENOENT:
                     raise
                 if support.verbose:
-                    sys.stdout.write("\IOError is %s\n" % str(x))
+                    sys.stdout.write("\OSError is %s\n" % str(x))
             else:
                 raise AssertionError("Use of invalid cert should have failed!")
 
     def server_params_test(client_context, server_context, indata=b"FOO\n",
-                           chatty=True, connectionchatty=False):
+                           chatty=True, connectionchatty=False, sni_name=None):
         """
         Launch a server, connect a client to it and try various reads
         and writes.
@@ -1399,7 +1861,8 @@
                                     chatty=chatty,
                                     connectionchatty=False)
         with server:
-            with client_context.wrap_socket(socket.socket()) as s:
+            with client_context.wrap_socket(socket.socket(),
+                    server_hostname=sni_name) as s:
                 s.connect((HOST, server.port))
                 for arg in [indata, bytearray(indata), memoryview(indata)]:
                     if connectionchatty:
@@ -1423,6 +1886,7 @@
                 stats.update({
                     'compression': s.compression(),
                     'cipher': s.cipher(),
+                    'peercert': s.getpeercert(),
                     'client_npn_protocol': s.selected_npn_protocol()
                 })
                 s.close()
@@ -1448,12 +1912,15 @@
         client_context.options |= client_options
         server_context = ssl.SSLContext(server_protocol)
         server_context.options |= server_options
+
+        # NOTE: we must enable "ALL" ciphers on the client, otherwise an
+        # SSLv23 client will send an SSLv3 hello (rather than SSLv2)
+        # starting from OpenSSL 1.0.0 (see issue #8322).
+        if client_context.protocol == ssl.PROTOCOL_SSLv23:
+            client_context.set_ciphers("ALL")
+
         for ctx in (client_context, server_context):
             ctx.verify_mode = certsreqs
-            # NOTE: we must enable "ALL" ciphers, otherwise an SSLv23 client
-            # will send an SSLv3 hello (rather than SSLv2) starting from
-            # OpenSSL 1.0.0 (see issue #8322).
-            ctx.set_ciphers("ALL")
             ctx.load_cert_chain(CERTFILE)
             ctx.load_verify_locations(CERTFILE)
         try:
@@ -1464,7 +1931,7 @@
         except ssl.SSLError:
             if expect_success:
                 raise
-        except socket.error as e:
+        except OSError as e:
             if expect_success or e.errno != errno.ECONNRESET:
                 raise
         else:
@@ -1483,10 +1950,11 @@
             if support.verbose:
                 sys.stdout.write("\n")
             for protocol in PROTOCOLS:
-                context = ssl.SSLContext(protocol)
-                context.load_cert_chain(CERTFILE)
-                server_params_test(context, context,
-                                   chatty=True, connectionchatty=True)
+                with self.subTest(protocol=ssl._PROTOCOL_NAMES[protocol]):
+                    context = ssl.SSLContext(protocol)
+                    context.load_cert_chain(CERTFILE)
+                    server_params_test(context, context,
+                                       chatty=True, connectionchatty=True)
 
         def test_getpeercert(self):
             if support.verbose:
@@ -1497,8 +1965,14 @@
             context.load_cert_chain(CERTFILE)
             server = ThreadedEchoServer(context=context, chatty=False)
             with server:
-                s = context.wrap_socket(socket.socket())
+                s = context.wrap_socket(socket.socket(),
+                                        do_handshake_on_connect=False)
                 s.connect((HOST, server.port))
+                # getpeercert() raise ValueError while the handshake isn't
+                # done.
+                with self.assertRaises(ValueError):
+                    s.getpeercert()
+                s.do_handshake()
                 cert = s.getpeercert()
                 self.assertTrue(cert, "Can't get peer certificate.")
                 cipher = s.cipher()
@@ -1520,6 +1994,86 @@
                 self.assertLess(before, after)
                 s.close()
 
+        @unittest.skipUnless(have_verify_flags(),
+                            "verify_flags need OpenSSL > 0.9.8")
+        def test_crl_check(self):
+            if support.verbose:
+                sys.stdout.write("\n")
+
+            server_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+            server_context.load_cert_chain(SIGNED_CERTFILE)
+
+            context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+            context.verify_mode = ssl.CERT_REQUIRED
+            context.load_verify_locations(SIGNING_CA)
+            self.assertEqual(context.verify_flags, ssl.VERIFY_DEFAULT)
+
+            # VERIFY_DEFAULT should pass
+            server = ThreadedEchoServer(context=server_context, chatty=True)
+            with server:
+                with context.wrap_socket(socket.socket()) as s:
+                    s.connect((HOST, server.port))
+                    cert = s.getpeercert()
+                    self.assertTrue(cert, "Can't get peer certificate.")
+
+            # VERIFY_CRL_CHECK_LEAF without a loaded CRL file fails
+            context.verify_flags |= ssl.VERIFY_CRL_CHECK_LEAF
+
+            server = ThreadedEchoServer(context=server_context, chatty=True)
+            with server:
+                with context.wrap_socket(socket.socket()) as s:
+                    with self.assertRaisesRegex(ssl.SSLError,
+                                                "certificate verify failed"):
+                        s.connect((HOST, server.port))
+
+            # now load a CRL file. The CRL file is signed by the CA.
+            context.load_verify_locations(CRLFILE)
+
+            server = ThreadedEchoServer(context=server_context, chatty=True)
+            with server:
+                with context.wrap_socket(socket.socket()) as s:
+                    s.connect((HOST, server.port))
+                    cert = s.getpeercert()
+                    self.assertTrue(cert, "Can't get peer certificate.")
+
+        def test_check_hostname(self):
+            if support.verbose:
+                sys.stdout.write("\n")
+
+            server_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+            server_context.load_cert_chain(SIGNED_CERTFILE)
+
+            context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+            context.verify_mode = ssl.CERT_REQUIRED
+            context.check_hostname = True
+            context.load_verify_locations(SIGNING_CA)
+
+            # correct hostname should verify
+            server = ThreadedEchoServer(context=server_context, chatty=True)
+            with server:
+                with context.wrap_socket(socket.socket(),
+                                         server_hostname="localhost") as s:
+                    s.connect((HOST, server.port))
+                    cert = s.getpeercert()
+                    self.assertTrue(cert, "Can't get peer certificate.")
+
+            # incorrect hostname should raise an exception
+            server = ThreadedEchoServer(context=server_context, chatty=True)
+            with server:
+                with context.wrap_socket(socket.socket(),
+                                         server_hostname="invalid") as s:
+                    with self.assertRaisesRegex(ssl.CertificateError,
+                                                "hostname 'invalid' doesn't match 'localhost'"):
+                        s.connect((HOST, server.port))
+
+            # missing server_hostname arg should cause an exception, too
+            server = ThreadedEchoServer(context=server_context, chatty=True)
+            with server:
+                with socket.socket() as s:
+                    with self.assertRaisesRegex(ValueError,
+                                                "check_hostname requires server_hostname"):
+                        context.wrap_socket(s)
+
         def test_empty_cert(self):
             """Connecting with an empty cert file"""
             bad_cert_test(os.path.join(os.path.dirname(__file__) or os.curdir,
@@ -1538,7 +2092,7 @@
                                        "badkey.pem"))
 
         def test_rude_shutdown(self):
-            """A brutal shutdown of an SSL server should raise an IOError
+            """A brutal shutdown of an SSL server should raise an OSError
             in the client when attempting handshake.
             """
             listener_ready = threading.Event()
@@ -1566,7 +2120,7 @@
                     listener_gone.wait()
                     try:
                         ssl_sock = ssl.wrap_socket(c)
-                    except IOError:
+                    except OSError:
                         pass
                     else:
                         self.fail('connecting to closed SSL socket should have failed')
@@ -1589,7 +2143,8 @@
             try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv2, True, ssl.CERT_OPTIONAL)
             try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv2, True, ssl.CERT_REQUIRED)
             try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv23, False)
-            try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv3, False)
+            if hasattr(ssl, 'PROTOCOL_SSLv3'):
+                try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv3, False)
             try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_TLSv1, False)
             # SSLv23 client with specific SSL options
             if no_sslv2_implies_sslv3_hello():
@@ -1609,26 +2164,30 @@
             if hasattr(ssl, 'PROTOCOL_SSLv2'):
                 try:
                     try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv2, True)
-                except (ssl.SSLError, socket.error) as x:
+                except OSError as x:
                     # this fails on some older versions of OpenSSL (0.9.7l, for instance)
                     if support.verbose:
                         sys.stdout.write(
                             " SSL2 client to SSL23 server test unexpectedly failed:\n %s\n"
                             % str(x))
-            try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv3, True)
+            if hasattr(ssl, 'PROTOCOL_SSLv3'):
+                try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv3, True)
             try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv23, True)
             try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1, True)
 
-            try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv3, True, ssl.CERT_OPTIONAL)
+            if hasattr(ssl, 'PROTOCOL_SSLv3'):
+                try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv3, True, ssl.CERT_OPTIONAL)
             try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv23, True, ssl.CERT_OPTIONAL)
             try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1, True, ssl.CERT_OPTIONAL)
 
-            try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv3, True, ssl.CERT_REQUIRED)
+            if hasattr(ssl, 'PROTOCOL_SSLv3'):
+                try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv3, True, ssl.CERT_REQUIRED)
             try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv23, True, ssl.CERT_REQUIRED)
             try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1, True, ssl.CERT_REQUIRED)
 
             # Server with specific SSL options
-            try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv3, False,
+            if hasattr(ssl, 'PROTOCOL_SSLv3'):
+                try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv3, False,
                                server_options=ssl.OP_NO_SSLv3)
             # Will choose TLSv1
             try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv23, True,
@@ -1638,6 +2197,8 @@
 
 
         @skip_if_broken_ubuntu_ssl
+        @unittest.skipUnless(hasattr(ssl, 'PROTOCOL_SSLv3'),
+                             "OpenSSL is compiled without SSLv3 support")
         def test_protocol_sslv3(self):
             """Connecting to an SSLv3 server with various client options"""
             if support.verbose:
@@ -1665,10 +2226,56 @@
             try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_TLSv1, True, ssl.CERT_REQUIRED)
             if hasattr(ssl, 'PROTOCOL_SSLv2'):
                 try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_SSLv2, False)
-            try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_SSLv3, False)
+            if hasattr(ssl, 'PROTOCOL_SSLv3'):
+                try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_SSLv3, False)
             try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_SSLv23, False,
                                client_options=ssl.OP_NO_TLSv1)
 
+        @skip_if_broken_ubuntu_ssl
+        @unittest.skipUnless(hasattr(ssl, "PROTOCOL_TLSv1_1"),
+                             "TLS version 1.1 not supported.")
+        def test_protocol_tlsv1_1(self):
+            """Connecting to a TLSv1.1 server with various client options.
+               Testing against older TLS versions."""
+            if support.verbose:
+                sys.stdout.write("\n")
+            try_protocol_combo(ssl.PROTOCOL_TLSv1_1, ssl.PROTOCOL_TLSv1_1, True)
+            if hasattr(ssl, 'PROTOCOL_SSLv2'):
+                try_protocol_combo(ssl.PROTOCOL_TLSv1_1, ssl.PROTOCOL_SSLv2, False)
+            if hasattr(ssl, 'PROTOCOL_SSLv3'):
+                try_protocol_combo(ssl.PROTOCOL_TLSv1_1, ssl.PROTOCOL_SSLv3, False)
+            try_protocol_combo(ssl.PROTOCOL_TLSv1_1, ssl.PROTOCOL_SSLv23, False,
+                               client_options=ssl.OP_NO_TLSv1_1)
+
+            try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1_1, True)
+            try_protocol_combo(ssl.PROTOCOL_TLSv1_1, ssl.PROTOCOL_TLSv1, False)
+            try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_TLSv1_1, False)
+
+
+        @skip_if_broken_ubuntu_ssl
+        @unittest.skipUnless(hasattr(ssl, "PROTOCOL_TLSv1_2"),
+                             "TLS version 1.2 not supported.")
+        def test_protocol_tlsv1_2(self):
+            """Connecting to a TLSv1.2 server with various client options.
+               Testing against older TLS versions."""
+            if support.verbose:
+                sys.stdout.write("\n")
+            try_protocol_combo(ssl.PROTOCOL_TLSv1_2, ssl.PROTOCOL_TLSv1_2, True,
+                               server_options=ssl.OP_NO_SSLv3|ssl.OP_NO_SSLv2,
+                               client_options=ssl.OP_NO_SSLv3|ssl.OP_NO_SSLv2,)
+            if hasattr(ssl, 'PROTOCOL_SSLv2'):
+                try_protocol_combo(ssl.PROTOCOL_TLSv1_2, ssl.PROTOCOL_SSLv2, False)
+            if hasattr(ssl, 'PROTOCOL_SSLv3'):
+                try_protocol_combo(ssl.PROTOCOL_TLSv1_2, ssl.PROTOCOL_SSLv3, False)
+            try_protocol_combo(ssl.PROTOCOL_TLSv1_2, ssl.PROTOCOL_SSLv23, False,
+                               client_options=ssl.OP_NO_TLSv1_2)
+
+            try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1_2, True)
+            try_protocol_combo(ssl.PROTOCOL_TLSv1_2, ssl.PROTOCOL_TLSv1, False)
+            try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_TLSv1_2, False)
+            try_protocol_combo(ssl.PROTOCOL_TLSv1_2, ssl.PROTOCOL_TLSv1_1, False)
+            try_protocol_combo(ssl.PROTOCOL_TLSv1_1, ssl.PROTOCOL_TLSv1_2, False)
+
         def test_starttls(self):
             """Switching from clear text to encrypted and back again."""
             msgs = (b"msg 1", b"MSG 2", b"STARTTLS", b"MSG 3", b"msg 4", b"ENDTLS", b"msg 5", b"msg 6")
@@ -1729,7 +2336,7 @@
 
         def test_socketserver(self):
             """Using a SocketServer to create and manage SSL connections."""
-            server = make_https_server(self, CERTFILE)
+            server = make_https_server(self, certfile=CERTFILE)
             # try to connect
             if support.verbose:
                 sys.stdout.write('\n')
@@ -1737,9 +2344,10 @@
                 d1 = f.read()
             d2 = ''
             # now fetch the same data from the HTTPS server
-            url = 'https://%s:%d/%s' % (
-                HOST, server.port, os.path.split(CERTFILE)[1])
-            f = urllib.request.urlopen(url)
+            url = 'https://localhost:%d/%s' % (
+                server.port, os.path.split(CERTFILE)[1])
+            context = ssl.create_default_context(cafile=CERTFILE)
+            f = urllib.request.urlopen(url, context=context)
             try:
                 dlen = f.info().get("content-length")
                 if dlen and (int(dlen) > 0):
@@ -1985,6 +2593,20 @@
             self.assertIsInstance(remote, ssl.SSLSocket)
             self.assertEqual(peer, client_addr)
 
+        def test_getpeercert_enotconn(self):
+            context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+            with context.wrap_socket(socket.socket()) as sock:
+                with self.assertRaises(OSError) as cm:
+                    sock.getpeercert()
+                self.assertEqual(cm.exception.errno, errno.ENOTCONN)
+
+        def test_do_handshake_enotconn(self):
+            context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+            with context.wrap_socket(socket.socket()) as sock:
+                with self.assertRaises(OSError) as cm:
+                    sock.do_handshake()
+                self.assertEqual(cm.exception.errno, errno.ENOTCONN)
+
         def test_default_ciphers(self):
             context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
             try:
@@ -1996,10 +2618,27 @@
                                     ssl_version=ssl.PROTOCOL_SSLv23,
                                     chatty=False) as server:
                 with context.wrap_socket(socket.socket()) as s:
-                    with self.assertRaises((OSError, ssl.SSLError)):
+                    with self.assertRaises(OSError):
                         s.connect((HOST, server.port))
             self.assertIn("no shared cipher", str(server.conn_errors[0]))
 
+        @unittest.skipUnless(ssl.HAS_ECDH, "test requires ECDH-enabled OpenSSL")
+        def test_default_ecdh_curve(self):
+            # Issue #21015: elliptic curve-based Diffie Hellman key exchange
+            # should be enabled by default on SSL contexts.
+            context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+            context.load_cert_chain(CERTFILE)
+            # Prior to OpenSSL 1.0.0, ECDH ciphers have to be enabled
+            # explicitly using the 'ECCdraft' cipher alias.  Otherwise,
+            # our default cipher list should prefer ECDH-based ciphers
+            # automatically.
+            if ssl.OPENSSL_VERSION_INFO < (1, 0, 0):
+                context.set_ciphers("ECCdraft:ECDH")
+            with ThreadedEchoServer(context=context) as server:
+                with context.wrap_socket(socket.socket()) as s:
+                    s.connect((HOST, server.port))
+                    self.assertIn("ECDH", s.cipher()[0])
+
         @unittest.skipUnless("tls-unique" in ssl.CHANNEL_BINDING_TYPES,
                              "'tls-unique' channel binding not available")
         def test_tls_unique_channel_binding(self):
@@ -2129,6 +2768,124 @@
                     if len(stats['server_npn_protocols']) else 'nothing'
                 self.assertEqual(server_result, expected, msg % (server_result, "server"))
 
+        def sni_contexts(self):
+            server_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+            server_context.load_cert_chain(SIGNED_CERTFILE)
+            other_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+            other_context.load_cert_chain(SIGNED_CERTFILE2)
+            client_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+            client_context.verify_mode = ssl.CERT_REQUIRED
+            client_context.load_verify_locations(SIGNING_CA)
+            return server_context, other_context, client_context
+
+        def check_common_name(self, stats, name):
+            cert = stats['peercert']
+            self.assertIn((('commonName', name),), cert['subject'])
+
+        @needs_sni
+        def test_sni_callback(self):
+            calls = []
+            server_context, other_context, client_context = self.sni_contexts()
+
+            def servername_cb(ssl_sock, server_name, initial_context):
+                calls.append((server_name, initial_context))
+                if server_name is not None:
+                    ssl_sock.context = other_context
+            server_context.set_servername_callback(servername_cb)
+
+            stats = server_params_test(client_context, server_context,
+                                       chatty=True,
+                                       sni_name='supermessage')
+            # The hostname was fetched properly, and the certificate was
+            # changed for the connection.
+            self.assertEqual(calls, [("supermessage", server_context)])
+            # CERTFILE4 was selected
+            self.check_common_name(stats, 'fakehostname')
+
+            calls = []
+            # The callback is called with server_name=None
+            stats = server_params_test(client_context, server_context,
+                                       chatty=True,
+                                       sni_name=None)
+            self.assertEqual(calls, [(None, server_context)])
+            self.check_common_name(stats, 'localhost')
+
+            # Check disabling the callback
+            calls = []
+            server_context.set_servername_callback(None)
+
+            stats = server_params_test(client_context, server_context,
+                                       chatty=True,
+                                       sni_name='notfunny')
+            # Certificate didn't change
+            self.check_common_name(stats, 'localhost')
+            self.assertEqual(calls, [])
+
+        @needs_sni
+        def test_sni_callback_alert(self):
+            # Returning a TLS alert is reflected to the connecting client
+            server_context, other_context, client_context = self.sni_contexts()
+
+            def cb_returning_alert(ssl_sock, server_name, initial_context):
+                return ssl.ALERT_DESCRIPTION_ACCESS_DENIED
+            server_context.set_servername_callback(cb_returning_alert)
+
+            with self.assertRaises(ssl.SSLError) as cm:
+                stats = server_params_test(client_context, server_context,
+                                           chatty=False,
+                                           sni_name='supermessage')
+            self.assertEqual(cm.exception.reason, 'TLSV1_ALERT_ACCESS_DENIED')
+
+        @needs_sni
+        def test_sni_callback_raising(self):
+            # Raising fails the connection with a TLS handshake failure alert.
+            server_context, other_context, client_context = self.sni_contexts()
+
+            def cb_raising(ssl_sock, server_name, initial_context):
+                1/0
+            server_context.set_servername_callback(cb_raising)
+
+            with self.assertRaises(ssl.SSLError) as cm, \
+                 support.captured_stderr() as stderr:
+                stats = server_params_test(client_context, server_context,
+                                           chatty=False,
+                                           sni_name='supermessage')
+            self.assertEqual(cm.exception.reason, 'SSLV3_ALERT_HANDSHAKE_FAILURE')
+            self.assertIn("ZeroDivisionError", stderr.getvalue())
+
+        @needs_sni
+        def test_sni_callback_wrong_return_type(self):
+            # Returning the wrong return type terminates the TLS connection
+            # with an internal error alert.
+            server_context, other_context, client_context = self.sni_contexts()
+
+            def cb_wrong_return_type(ssl_sock, server_name, initial_context):
+                return "foo"
+            server_context.set_servername_callback(cb_wrong_return_type)
+
+            with self.assertRaises(ssl.SSLError) as cm, \
+                 support.captured_stderr() as stderr:
+                stats = server_params_test(client_context, server_context,
+                                           chatty=False,
+                                           sni_name='supermessage')
+            self.assertEqual(cm.exception.reason, 'TLSV1_ALERT_INTERNAL_ERROR')
+            self.assertIn("TypeError", stderr.getvalue())
+
+        def test_read_write_after_close_raises_valuerror(self):
+            context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+            context.verify_mode = ssl.CERT_REQUIRED
+            context.load_verify_locations(CERTFILE)
+            context.load_cert_chain(CERTFILE)
+            server = ThreadedEchoServer(context=context, chatty=False)
+
+            with server:
+                s = context.wrap_socket(socket.socket())
+                s.connect((HOST, server.port))
+                s.close()
+
+                self.assertRaises(ValueError, s.read, 1024)
+                self.assertRaises(ValueError, s.write, b'hello')
+
 
 def test_main(verbose=False):
     if support.verbose:
@@ -2148,10 +2905,16 @@
             (ssl.OPENSSL_VERSION, ssl.OPENSSL_VERSION_INFO))
         print("          under %s" % plat)
         print("          HAS_SNI = %r" % ssl.HAS_SNI)
+        print("          OP_ALL = 0x%8x" % ssl.OP_ALL)
+        try:
+            print("          OP_NO_TLSv1_1 = 0x%8x" % ssl.OP_NO_TLSv1_1)
+        except AttributeError:
+            pass
 
     for filename in [
         CERTFILE, SVN_PYTHON_ORG_ROOT_CERT, BYTES_CERTFILE,
         ONLYCERT, ONLYKEY, BYTES_ONLYCERT, BYTES_ONLYKEY,
+        SIGNED_CERTFILE, SIGNED_CERTFILE2, SIGNING_CA,
         BADCERT, BADKEY, EMPTYCERT]:
         if not os.path.exists(filename):
             raise support.TestFailed("Can't read certificate file %r" % filename)
diff --git a/Lib/test/test_stat.py b/Lib/test/test_stat.py
index eb3f07a..af6ced4 100644
--- a/Lib/test/test_stat.py
+++ b/Lib/test/test_stat.py
@@ -1,9 +1,13 @@
 import unittest
 import os
-from test.support import TESTFN, run_unittest, import_fresh_module
-import stat
+from test.support import TESTFN, import_fresh_module
 
-class TestFilemode(unittest.TestCase):
+c_stat = import_fresh_module('stat', fresh=['_stat'])
+py_stat = import_fresh_module('stat', blocked=['_stat'])
+
+class TestFilemode:
+    statmod = None
+
     file_flags = {'SF_APPEND', 'SF_ARCHIVED', 'SF_IMMUTABLE', 'SF_NOUNLINK',
                   'SF_SNAPSHOT', 'UF_APPEND', 'UF_COMPRESSED', 'UF_HIDDEN',
                   'UF_IMMUTABLE', 'UF_NODUMP', 'UF_NOUNLINK', 'UF_OPAQUE'}
@@ -63,17 +67,17 @@
             st_mode = os.lstat(fname).st_mode
         else:
             st_mode = os.stat(fname).st_mode
-        modestr = stat.filemode(st_mode)
+        modestr = self.statmod.filemode(st_mode)
         return st_mode, modestr
 
     def assertS_IS(self, name, mode):
         # test format, lstrip is for S_IFIFO
-        fmt = getattr(stat, "S_IF" + name.lstrip("F"))
-        self.assertEqual(stat.S_IFMT(mode), fmt)
+        fmt = getattr(self.statmod, "S_IF" + name.lstrip("F"))
+        self.assertEqual(self.statmod.S_IFMT(mode), fmt)
         # test that just one function returns true
         testname = "S_IS" + name
         for funcname in self.format_funcs:
-            func = getattr(stat, funcname, None)
+            func = getattr(self.statmod, funcname, None)
             if func is None:
                 if funcname == testname:
                     raise ValueError(funcname)
@@ -91,35 +95,35 @@
             st_mode, modestr = self.get_mode()
             self.assertEqual(modestr, '-rwx------')
             self.assertS_IS("REG", st_mode)
-            self.assertEqual(stat.S_IMODE(st_mode),
-                             stat.S_IRWXU)
+            self.assertEqual(self.statmod.S_IMODE(st_mode),
+                             self.statmod.S_IRWXU)
 
             os.chmod(TESTFN, 0o070)
             st_mode, modestr = self.get_mode()
             self.assertEqual(modestr, '----rwx---')
             self.assertS_IS("REG", st_mode)
-            self.assertEqual(stat.S_IMODE(st_mode),
-                             stat.S_IRWXG)
+            self.assertEqual(self.statmod.S_IMODE(st_mode),
+                             self.statmod.S_IRWXG)
 
             os.chmod(TESTFN, 0o007)
             st_mode, modestr = self.get_mode()
             self.assertEqual(modestr, '-------rwx')
             self.assertS_IS("REG", st_mode)
-            self.assertEqual(stat.S_IMODE(st_mode),
-                             stat.S_IRWXO)
+            self.assertEqual(self.statmod.S_IMODE(st_mode),
+                             self.statmod.S_IRWXO)
 
             os.chmod(TESTFN, 0o444)
             st_mode, modestr = self.get_mode()
             self.assertS_IS("REG", st_mode)
             self.assertEqual(modestr, '-r--r--r--')
-            self.assertEqual(stat.S_IMODE(st_mode), 0o444)
+            self.assertEqual(self.statmod.S_IMODE(st_mode), 0o444)
         else:
             os.chmod(TESTFN, 0o700)
             st_mode, modestr = self.get_mode()
             self.assertEqual(modestr[:3], '-rw')
             self.assertS_IS("REG", st_mode)
-            self.assertEqual(stat.S_IFMT(st_mode),
-                             stat.S_IFREG)
+            self.assertEqual(self.statmod.S_IFMT(st_mode),
+                             self.statmod.S_IFREG)
 
     def test_directory(self):
         os.mkdir(TESTFN)
@@ -165,25 +169,34 @@
 
     def test_module_attributes(self):
         for key, value in self.stat_struct.items():
-            modvalue = getattr(stat, key)
+            modvalue = getattr(self.statmod, key)
             self.assertEqual(value, modvalue, key)
         for key, value in self.permission_bits.items():
-            modvalue = getattr(stat, key)
+            modvalue = getattr(self.statmod, key)
             self.assertEqual(value, modvalue, key)
         for key in self.file_flags:
-            modvalue = getattr(stat, key)
+            modvalue = getattr(self.statmod, key)
             self.assertIsInstance(modvalue, int)
         for key in self.formats:
-            modvalue = getattr(stat, key)
+            modvalue = getattr(self.statmod, key)
             self.assertIsInstance(modvalue, int)
         for key in self.format_funcs:
-            func = getattr(stat, key)
+            func = getattr(self.statmod, key)
             self.assertTrue(callable(func))
             self.assertEqual(func(0), 0)
 
 
-def test_main():
-    run_unittest(TestFilemode)
+class TestFilemodeCStat(TestFilemode, unittest.TestCase):
+    statmod = c_stat
+
+    formats = TestFilemode.formats | {'S_IFDOOR', 'S_IFPORT', 'S_IFWHT'}
+    format_funcs = TestFilemode.format_funcs | {'S_ISDOOR', 'S_ISPORT',
+                                                'S_ISWHT'}
+
+
+class TestFilemodePyStat(TestFilemode, unittest.TestCase):
+    statmod = py_stat
+
 
 if __name__ == '__main__':
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_statistics.py b/Lib/test/test_statistics.py
new file mode 100644
index 0000000..f1da21e
--- /dev/null
+++ b/Lib/test/test_statistics.py
@@ -0,0 +1,1574 @@
+"""Test suite for statistics module, including helper NumericTestCase and
+approx_equal function.
+
+"""
+
+import collections
+import decimal
+import doctest
+import math
+import random
+import sys
+import types
+import unittest
+
+from decimal import Decimal
+from fractions import Fraction
+
+
+# Module to be tested.
+import statistics
+
+
+# === Helper functions and class ===
+
+def _calc_errors(actual, expected):
+    """Return the absolute and relative errors between two numbers.
+
+    >>> _calc_errors(100, 75)
+    (25, 0.25)
+    >>> _calc_errors(100, 100)
+    (0, 0.0)
+
+    Returns the (absolute error, relative error) between the two arguments.
+    """
+    base = max(abs(actual), abs(expected))
+    abs_err = abs(actual - expected)
+    rel_err = abs_err/base if base else float('inf')
+    return (abs_err, rel_err)
+
+
+def approx_equal(x, y, tol=1e-12, rel=1e-7):
+    """approx_equal(x, y [, tol [, rel]]) => True|False
+
+    Return True if numbers x and y are approximately equal, to within some
+    margin of error, otherwise return False. Numbers which compare equal
+    will also compare approximately equal.
+
+    x is approximately equal to y if the difference between them is less than
+    an absolute error tol or a relative error rel, whichever is bigger.
+
+    If given, both tol and rel must be finite, non-negative numbers. If not
+    given, default values are tol=1e-12 and rel=1e-7.
+
+    >>> approx_equal(1.2589, 1.2587, tol=0.0003, rel=0)
+    True
+    >>> approx_equal(1.2589, 1.2587, tol=0.0001, rel=0)
+    False
+
+    Absolute error is defined as abs(x-y); if that is less than or equal to
+    tol, x and y are considered approximately equal.
+
+    Relative error is defined as abs((x-y)/x) or abs((x-y)/y), whichever is
+    smaller, provided x or y are not zero. If that figure is less than or
+    equal to rel, x and y are considered approximately equal.
+
+    Complex numbers are not directly supported. If you wish to compare to
+    complex numbers, extract their real and imaginary parts and compare them
+    individually.
+
+    NANs always compare unequal, even with themselves. Infinities compare
+    approximately equal if they have the same sign (both positive or both
+    negative). Infinities with different signs compare unequal; so do
+    comparisons of infinities with finite numbers.
+    """
+    if tol < 0 or rel < 0:
+        raise ValueError('error tolerances must be non-negative')
+    # NANs are never equal to anything, approximately or otherwise.
+    if math.isnan(x) or math.isnan(y):
+        return False
+    # Numbers which compare equal also compare approximately equal.
+    if x == y:
+        # This includes the case of two infinities with the same sign.
+        return True
+    if math.isinf(x) or math.isinf(y):
+        # This includes the case of two infinities of opposite sign, or
+        # one infinity and one finite number.
+        return False
+    # Two finite numbers.
+    actual_error = abs(x - y)
+    allowed_error = max(tol, rel*max(abs(x), abs(y)))
+    return actual_error <= allowed_error
+
+
+# This class exists only as somewhere to stick a docstring containing
+# doctests. The following docstring and tests were originally in a separate
+# module. Now that it has been merged in here, I need somewhere to hang the.
+# docstring. Ultimately, this class will die, and the information below will
+# either become redundant, or be moved into more appropriate places.
+class _DoNothing:
+    """
+    When doing numeric work, especially with floats, exact equality is often
+    not what you want. Due to round-off error, it is often a bad idea to try
+    to compare floats with equality. Instead the usual procedure is to test
+    them with some (hopefully small!) allowance for error.
+
+    The ``approx_equal`` function allows you to specify either an absolute
+    error tolerance, or a relative error, or both.
+
+    Absolute error tolerances are simple, but you need to know the magnitude
+    of the quantities being compared:
+
+    >>> approx_equal(12.345, 12.346, tol=1e-3)
+    True
+    >>> approx_equal(12.345e6, 12.346e6, tol=1e-3)  # tol is too small.
+    False
+
+    Relative errors are more suitable when the values you are comparing can
+    vary in magnitude:
+
+    >>> approx_equal(12.345, 12.346, rel=1e-4)
+    True
+    >>> approx_equal(12.345e6, 12.346e6, rel=1e-4)
+    True
+
+    but a naive implementation of relative error testing can run into trouble
+    around zero.
+
+    If you supply both an absolute tolerance and a relative error, the
+    comparison succeeds if either individual test succeeds:
+
+    >>> approx_equal(12.345e6, 12.346e6, tol=1e-3, rel=1e-4)
+    True
+
+    """
+    pass
+
+
+
+# We prefer this for testing numeric values that may not be exactly equal,
+# and avoid using TestCase.assertAlmostEqual, because it sucks :-)
+
+class NumericTestCase(unittest.TestCase):
+    """Unit test class for numeric work.
+
+    This subclasses TestCase. In addition to the standard method
+    ``TestCase.assertAlmostEqual``,  ``assertApproxEqual`` is provided.
+    """
+    # By default, we expect exact equality, unless overridden.
+    tol = rel = 0
+
+    def assertApproxEqual(
+            self, first, second, tol=None, rel=None, msg=None
+            ):
+        """Test passes if ``first`` and ``second`` are approximately equal.
+
+        This test passes if ``first`` and ``second`` are equal to
+        within ``tol``, an absolute error, or ``rel``, a relative error.
+
+        If either ``tol`` or ``rel`` are None or not given, they default to
+        test attributes of the same name (by default, 0).
+
+        The objects may be either numbers, or sequences of numbers. Sequences
+        are tested element-by-element.
+
+        >>> class MyTest(NumericTestCase):
+        ...     def test_number(self):
+        ...         x = 1.0/6
+        ...         y = sum([x]*6)
+        ...         self.assertApproxEqual(y, 1.0, tol=1e-15)
+        ...     def test_sequence(self):
+        ...         a = [1.001, 1.001e-10, 1.001e10]
+        ...         b = [1.0, 1e-10, 1e10]
+        ...         self.assertApproxEqual(a, b, rel=1e-3)
+        ...
+        >>> import unittest
+        >>> from io import StringIO  # Suppress test runner output.
+        >>> suite = unittest.TestLoader().loadTestsFromTestCase(MyTest)
+        >>> unittest.TextTestRunner(stream=StringIO()).run(suite)
+        <unittest.runner.TextTestResult run=2 errors=0 failures=0>
+
+        """
+        if tol is None:
+            tol = self.tol
+        if rel is None:
+            rel = self.rel
+        if (
+                isinstance(first, collections.Sequence) and
+                isinstance(second, collections.Sequence)
+            ):
+            check = self._check_approx_seq
+        else:
+            check = self._check_approx_num
+        check(first, second, tol, rel, msg)
+
+    def _check_approx_seq(self, first, second, tol, rel, msg):
+        if len(first) != len(second):
+            standardMsg = (
+                "sequences differ in length: %d items != %d items"
+                % (len(first), len(second))
+                )
+            msg = self._formatMessage(msg, standardMsg)
+            raise self.failureException(msg)
+        for i, (a,e) in enumerate(zip(first, second)):
+            self._check_approx_num(a, e, tol, rel, msg, i)
+
+    def _check_approx_num(self, first, second, tol, rel, msg, idx=None):
+        if approx_equal(first, second, tol, rel):
+            # Test passes. Return early, we are done.
+            return None
+        # Otherwise we failed.
+        standardMsg = self._make_std_err_msg(first, second, tol, rel, idx)
+        msg = self._formatMessage(msg, standardMsg)
+        raise self.failureException(msg)
+
+    @staticmethod
+    def _make_std_err_msg(first, second, tol, rel, idx):
+        # Create the standard error message for approx_equal failures.
+        assert first != second
+        template = (
+            '  %r != %r\n'
+            '  values differ by more than tol=%r and rel=%r\n'
+            '  -> absolute error = %r\n'
+            '  -> relative error = %r'
+            )
+        if idx is not None:
+            header = 'numeric sequences first differ at index %d.\n' % idx
+            template = header + template
+        # Calculate actual errors:
+        abs_err, rel_err = _calc_errors(first, second)
+        return template % (first, second, tol, rel, abs_err, rel_err)
+
+
+# ========================
+# === Test the helpers ===
+# ========================
+
+
+# --- Tests for approx_equal ---
+
+class ApproxEqualSymmetryTest(unittest.TestCase):
+    # Test symmetry of approx_equal.
+
+    def test_relative_symmetry(self):
+        # Check that approx_equal treats relative error symmetrically.
+        # (a-b)/a is usually not equal to (a-b)/b. Ensure that this
+        # doesn't matter.
+        #
+        #   Note: the reason for this test is that an early version
+        #   of approx_equal was not symmetric. A relative error test
+        #   would pass, or fail, depending on which value was passed
+        #   as the first argument.
+        #
+        args1 = [2456, 37.8, -12.45, Decimal('2.54'), Fraction(17, 54)]
+        args2 = [2459, 37.2, -12.41, Decimal('2.59'), Fraction(15, 54)]
+        assert len(args1) == len(args2)
+        for a, b in zip(args1, args2):
+            self.do_relative_symmetry(a, b)
+
+    def do_relative_symmetry(self, a, b):
+        a, b = min(a, b), max(a, b)
+        assert a < b
+        delta = b - a  # The absolute difference between the values.
+        rel_err1, rel_err2 = abs(delta/a), abs(delta/b)
+        # Choose an error margin halfway between the two.
+        rel = (rel_err1 + rel_err2)/2
+        # Now see that values a and b compare approx equal regardless of
+        # which is given first.
+        self.assertTrue(approx_equal(a, b, tol=0, rel=rel))
+        self.assertTrue(approx_equal(b, a, tol=0, rel=rel))
+
+    def test_symmetry(self):
+        # Test that approx_equal(a, b) == approx_equal(b, a)
+        args = [-23, -2, 5, 107, 93568]
+        delta = 2
+        for a in args:
+            for type_ in (int, float, Decimal, Fraction):
+                x = type_(a)*100
+                y = x + delta
+                r = abs(delta/max(x, y))
+                # There are five cases to check:
+                # 1) actual error <= tol, <= rel
+                self.do_symmetry_test(x, y, tol=delta, rel=r)
+                self.do_symmetry_test(x, y, tol=delta+1, rel=2*r)
+                # 2) actual error > tol, > rel
+                self.do_symmetry_test(x, y, tol=delta-1, rel=r/2)
+                # 3) actual error <= tol, > rel
+                self.do_symmetry_test(x, y, tol=delta, rel=r/2)
+                # 4) actual error > tol, <= rel
+                self.do_symmetry_test(x, y, tol=delta-1, rel=r)
+                self.do_symmetry_test(x, y, tol=delta-1, rel=2*r)
+                # 5) exact equality test
+                self.do_symmetry_test(x, x, tol=0, rel=0)
+                self.do_symmetry_test(x, y, tol=0, rel=0)
+
+    def do_symmetry_test(self, a, b, tol, rel):
+        template = "approx_equal comparisons don't match for %r"
+        flag1 = approx_equal(a, b, tol, rel)
+        flag2 = approx_equal(b, a, tol, rel)
+        self.assertEqual(flag1, flag2, template.format((a, b, tol, rel)))
+
+
+class ApproxEqualExactTest(unittest.TestCase):
+    # Test the approx_equal function with exactly equal values.
+    # Equal values should compare as approximately equal.
+    # Test cases for exactly equal values, which should compare approx
+    # equal regardless of the error tolerances given.
+
+    def do_exactly_equal_test(self, x, tol, rel):
+        result = approx_equal(x, x, tol=tol, rel=rel)
+        self.assertTrue(result, 'equality failure for x=%r' % x)
+        result = approx_equal(-x, -x, tol=tol, rel=rel)
+        self.assertTrue(result, 'equality failure for x=%r' % -x)
+
+    def test_exactly_equal_ints(self):
+        # Test that equal int values are exactly equal.
+        for n in [42, 19740, 14974, 230, 1795, 700245, 36587]:
+            self.do_exactly_equal_test(n, 0, 0)
+
+    def test_exactly_equal_floats(self):
+        # Test that equal float values are exactly equal.
+        for x in [0.42, 1.9740, 1497.4, 23.0, 179.5, 70.0245, 36.587]:
+            self.do_exactly_equal_test(x, 0, 0)
+
+    def test_exactly_equal_fractions(self):
+        # Test that equal Fraction values are exactly equal.
+        F = Fraction
+        for f in [F(1, 2), F(0), F(5, 3), F(9, 7), F(35, 36), F(3, 7)]:
+            self.do_exactly_equal_test(f, 0, 0)
+
+    def test_exactly_equal_decimals(self):
+        # Test that equal Decimal values are exactly equal.
+        D = Decimal
+        for d in map(D, "8.2 31.274 912.04 16.745 1.2047".split()):
+            self.do_exactly_equal_test(d, 0, 0)
+
+    def test_exactly_equal_absolute(self):
+        # Test that equal values are exactly equal with an absolute error.
+        for n in [16, 1013, 1372, 1198, 971, 4]:
+            # Test as ints.
+            self.do_exactly_equal_test(n, 0.01, 0)
+            # Test as floats.
+            self.do_exactly_equal_test(n/10, 0.01, 0)
+            # Test as Fractions.
+            f = Fraction(n, 1234)
+            self.do_exactly_equal_test(f, 0.01, 0)
+
+    def test_exactly_equal_absolute_decimals(self):
+        # Test equal Decimal values are exactly equal with an absolute error.
+        self.do_exactly_equal_test(Decimal("3.571"), Decimal("0.01"), 0)
+        self.do_exactly_equal_test(-Decimal("81.3971"), Decimal("0.01"), 0)
+
+    def test_exactly_equal_relative(self):
+        # Test that equal values are exactly equal with a relative error.
+        for x in [8347, 101.3, -7910.28, Fraction(5, 21)]:
+            self.do_exactly_equal_test(x, 0, 0.01)
+        self.do_exactly_equal_test(Decimal("11.68"), 0, Decimal("0.01"))
+
+    def test_exactly_equal_both(self):
+        # Test that equal values are equal when both tol and rel are given.
+        for x in [41017, 16.742, -813.02, Fraction(3, 8)]:
+            self.do_exactly_equal_test(x, 0.1, 0.01)
+        D = Decimal
+        self.do_exactly_equal_test(D("7.2"), D("0.1"), D("0.01"))
+
+
+class ApproxEqualUnequalTest(unittest.TestCase):
+    # Unequal values should compare unequal with zero error tolerances.
+    # Test cases for unequal values, with exact equality test.
+
+    def do_exactly_unequal_test(self, x):
+        for a in (x, -x):
+            result = approx_equal(a, a+1, tol=0, rel=0)
+            self.assertFalse(result, 'inequality failure for x=%r' % a)
+
+    def test_exactly_unequal_ints(self):
+        # Test unequal int values are unequal with zero error tolerance.
+        for n in [951, 572305, 478, 917, 17240]:
+            self.do_exactly_unequal_test(n)
+
+    def test_exactly_unequal_floats(self):
+        # Test unequal float values are unequal with zero error tolerance.
+        for x in [9.51, 5723.05, 47.8, 9.17, 17.24]:
+            self.do_exactly_unequal_test(x)
+
+    def test_exactly_unequal_fractions(self):
+        # Test that unequal Fractions are unequal with zero error tolerance.
+        F = Fraction
+        for f in [F(1, 5), F(7, 9), F(12, 11), F(101, 99023)]:
+            self.do_exactly_unequal_test(f)
+
+    def test_exactly_unequal_decimals(self):
+        # Test that unequal Decimals are unequal with zero error tolerance.
+        for d in map(Decimal, "3.1415 298.12 3.47 18.996 0.00245".split()):
+            self.do_exactly_unequal_test(d)
+
+
+class ApproxEqualInexactTest(unittest.TestCase):
+    # Inexact test cases for approx_error.
+    # Test cases when comparing two values that are not exactly equal.
+
+    # === Absolute error tests ===
+
+    def do_approx_equal_abs_test(self, x, delta):
+        template = "Test failure for x={!r}, y={!r}"
+        for y in (x + delta, x - delta):
+            msg = template.format(x, y)
+            self.assertTrue(approx_equal(x, y, tol=2*delta, rel=0), msg)
+            self.assertFalse(approx_equal(x, y, tol=delta/2, rel=0), msg)
+
+    def test_approx_equal_absolute_ints(self):
+        # Test approximate equality of ints with an absolute error.
+        for n in [-10737, -1975, -7, -2, 0, 1, 9, 37, 423, 9874, 23789110]:
+            self.do_approx_equal_abs_test(n, 10)
+            self.do_approx_equal_abs_test(n, 2)
+
+    def test_approx_equal_absolute_floats(self):
+        # Test approximate equality of floats with an absolute error.
+        for x in [-284.126, -97.1, -3.4, -2.15, 0.5, 1.0, 7.8, 4.23, 3817.4]:
+            self.do_approx_equal_abs_test(x, 1.5)
+            self.do_approx_equal_abs_test(x, 0.01)
+            self.do_approx_equal_abs_test(x, 0.0001)
+
+    def test_approx_equal_absolute_fractions(self):
+        # Test approximate equality of Fractions with an absolute error.
+        delta = Fraction(1, 29)
+        numerators = [-84, -15, -2, -1, 0, 1, 5, 17, 23, 34, 71]
+        for f in (Fraction(n, 29) for n in numerators):
+            self.do_approx_equal_abs_test(f, delta)
+            self.do_approx_equal_abs_test(f, float(delta))
+
+    def test_approx_equal_absolute_decimals(self):
+        # Test approximate equality of Decimals with an absolute error.
+        delta = Decimal("0.01")
+        for d in map(Decimal, "1.0 3.5 36.08 61.79 7912.3648".split()):
+            self.do_approx_equal_abs_test(d, delta)
+            self.do_approx_equal_abs_test(-d, delta)
+
+    def test_cross_zero(self):
+        # Test for the case of the two values having opposite signs.
+        self.assertTrue(approx_equal(1e-5, -1e-5, tol=1e-4, rel=0))
+
+    # === Relative error tests ===
+
+    def do_approx_equal_rel_test(self, x, delta):
+        template = "Test failure for x={!r}, y={!r}"
+        for y in (x*(1+delta), x*(1-delta)):
+            msg = template.format(x, y)
+            self.assertTrue(approx_equal(x, y, tol=0, rel=2*delta), msg)
+            self.assertFalse(approx_equal(x, y, tol=0, rel=delta/2), msg)
+
+    def test_approx_equal_relative_ints(self):
+        # Test approximate equality of ints with a relative error.
+        self.assertTrue(approx_equal(64, 47, tol=0, rel=0.36))
+        self.assertTrue(approx_equal(64, 47, tol=0, rel=0.37))
+        # ---
+        self.assertTrue(approx_equal(449, 512, tol=0, rel=0.125))
+        self.assertTrue(approx_equal(448, 512, tol=0, rel=0.125))
+        self.assertFalse(approx_equal(447, 512, tol=0, rel=0.125))
+
+    def test_approx_equal_relative_floats(self):
+        # Test approximate equality of floats with a relative error.
+        for x in [-178.34, -0.1, 0.1, 1.0, 36.97, 2847.136, 9145.074]:
+            self.do_approx_equal_rel_test(x, 0.02)
+            self.do_approx_equal_rel_test(x, 0.0001)
+
+    def test_approx_equal_relative_fractions(self):
+        # Test approximate equality of Fractions with a relative error.
+        F = Fraction
+        delta = Fraction(3, 8)
+        for f in [F(3, 84), F(17, 30), F(49, 50), F(92, 85)]:
+            for d in (delta, float(delta)):
+                self.do_approx_equal_rel_test(f, d)
+                self.do_approx_equal_rel_test(-f, d)
+
+    def test_approx_equal_relative_decimals(self):
+        # Test approximate equality of Decimals with a relative error.
+        for d in map(Decimal, "0.02 1.0 5.7 13.67 94.138 91027.9321".split()):
+            self.do_approx_equal_rel_test(d, Decimal("0.001"))
+            self.do_approx_equal_rel_test(-d, Decimal("0.05"))
+
+    # === Both absolute and relative error tests ===
+
+    # There are four cases to consider:
+    #   1) actual error <= both absolute and relative error
+    #   2) actual error <= absolute error but > relative error
+    #   3) actual error <= relative error but > absolute error
+    #   4) actual error > both absolute and relative error
+
+    def do_check_both(self, a, b, tol, rel, tol_flag, rel_flag):
+        check = self.assertTrue if tol_flag else self.assertFalse
+        check(approx_equal(a, b, tol=tol, rel=0))
+        check = self.assertTrue if rel_flag else self.assertFalse
+        check(approx_equal(a, b, tol=0, rel=rel))
+        check = self.assertTrue if (tol_flag or rel_flag) else self.assertFalse
+        check(approx_equal(a, b, tol=tol, rel=rel))
+
+    def test_approx_equal_both1(self):
+        # Test actual error <= both absolute and relative error.
+        self.do_check_both(7.955, 7.952, 0.004, 3.8e-4, True, True)
+        self.do_check_both(-7.387, -7.386, 0.002, 0.0002, True, True)
+
+    def test_approx_equal_both2(self):
+        # Test actual error <= absolute error but > relative error.
+        self.do_check_both(7.955, 7.952, 0.004, 3.7e-4, True, False)
+
+    def test_approx_equal_both3(self):
+        # Test actual error <= relative error but > absolute error.
+        self.do_check_both(7.955, 7.952, 0.001, 3.8e-4, False, True)
+
+    def test_approx_equal_both4(self):
+        # Test actual error > both absolute and relative error.
+        self.do_check_both(2.78, 2.75, 0.01, 0.001, False, False)
+        self.do_check_both(971.44, 971.47, 0.02, 3e-5, False, False)
+
+
+class ApproxEqualSpecialsTest(unittest.TestCase):
+    # Test approx_equal with NANs and INFs and zeroes.
+
+    def test_inf(self):
+        for type_ in (float, Decimal):
+            inf = type_('inf')
+            self.assertTrue(approx_equal(inf, inf))
+            self.assertTrue(approx_equal(inf, inf, 0, 0))
+            self.assertTrue(approx_equal(inf, inf, 1, 0.01))
+            self.assertTrue(approx_equal(-inf, -inf))
+            self.assertFalse(approx_equal(inf, -inf))
+            self.assertFalse(approx_equal(inf, 1000))
+
+    def test_nan(self):
+        for type_ in (float, Decimal):
+            nan = type_('nan')
+            for other in (nan, type_('inf'), 1000):
+                self.assertFalse(approx_equal(nan, other))
+
+    def test_float_zeroes(self):
+        nzero = math.copysign(0.0, -1)
+        self.assertTrue(approx_equal(nzero, 0.0, tol=0.1, rel=0.1))
+
+    def test_decimal_zeroes(self):
+        nzero = Decimal("-0.0")
+        self.assertTrue(approx_equal(nzero, Decimal(0), tol=0.1, rel=0.1))
+
+
+class TestApproxEqualErrors(unittest.TestCase):
+    # Test error conditions of approx_equal.
+
+    def test_bad_tol(self):
+        # Test negative tol raises.
+        self.assertRaises(ValueError, approx_equal, 100, 100, -1, 0.1)
+
+    def test_bad_rel(self):
+        # Test negative rel raises.
+        self.assertRaises(ValueError, approx_equal, 100, 100, 1, -0.1)
+
+
+# --- Tests for NumericTestCase ---
+
+# The formatting routine that generates the error messages is complex enough
+# that it too needs testing.
+
+class TestNumericTestCase(unittest.TestCase):
+    # The exact wording of NumericTestCase error messages is *not* guaranteed,
+    # but we need to give them some sort of test to ensure that they are
+    # generated correctly. As a compromise, we look for specific substrings
+    # that are expected to be found even if the overall error message changes.
+
+    def do_test(self, args):
+        actual_msg = NumericTestCase._make_std_err_msg(*args)
+        expected = self.generate_substrings(*args)
+        for substring in expected:
+            self.assertIn(substring, actual_msg)
+
+    def test_numerictestcase_is_testcase(self):
+        # Ensure that NumericTestCase actually is a TestCase.
+        self.assertTrue(issubclass(NumericTestCase, unittest.TestCase))
+
+    def test_error_msg_numeric(self):
+        # Test the error message generated for numeric comparisons.
+        args = (2.5, 4.0, 0.5, 0.25, None)
+        self.do_test(args)
+
+    def test_error_msg_sequence(self):
+        # Test the error message generated for sequence comparisons.
+        args = (3.75, 8.25, 1.25, 0.5, 7)
+        self.do_test(args)
+
+    def generate_substrings(self, first, second, tol, rel, idx):
+        """Return substrings we expect to see in error messages."""
+        abs_err, rel_err = _calc_errors(first, second)
+        substrings = [
+                'tol=%r' % tol,
+                'rel=%r' % rel,
+                'absolute error = %r' % abs_err,
+                'relative error = %r' % rel_err,
+                ]
+        if idx is not None:
+            substrings.append('differ at index %d' % idx)
+        return substrings
+
+
+# =======================================
+# === Tests for the statistics module ===
+# =======================================
+
+
+class GlobalsTest(unittest.TestCase):
+    module = statistics
+    expected_metadata = ["__doc__", "__all__"]
+
+    def test_meta(self):
+        # Test for the existence of metadata.
+        for meta in self.expected_metadata:
+            self.assertTrue(hasattr(self.module, meta),
+                            "%s not present" % meta)
+
+    def test_check_all(self):
+        # Check everything in __all__ exists and is public.
+        module = self.module
+        for name in module.__all__:
+            # No private names in __all__:
+            self.assertFalse(name.startswith("_"),
+                             'private name "%s" in __all__' % name)
+            # And anything in __all__ must exist:
+            self.assertTrue(hasattr(module, name),
+                            'missing name "%s" in __all__' % name)
+
+
+class DocTests(unittest.TestCase):
+    @unittest.skipIf(sys.flags.optimize >= 2,
+                     "Docstrings are omitted with -OO and above")
+    def test_doc_tests(self):
+        failed, tried = doctest.testmod(statistics)
+        self.assertGreater(tried, 0)
+        self.assertEqual(failed, 0)
+
+class StatisticsErrorTest(unittest.TestCase):
+    def test_has_exception(self):
+        errmsg = (
+                "Expected StatisticsError to be a ValueError, but got a"
+                " subclass of %r instead."
+                )
+        self.assertTrue(hasattr(statistics, 'StatisticsError'))
+        self.assertTrue(
+                issubclass(statistics.StatisticsError, ValueError),
+                errmsg % statistics.StatisticsError.__base__
+                )
+
+
+# === Tests for private utility functions ===
+
+class ExactRatioTest(unittest.TestCase):
+    # Test _exact_ratio utility.
+
+    def test_int(self):
+        for i in (-20, -3, 0, 5, 99, 10**20):
+            self.assertEqual(statistics._exact_ratio(i), (i, 1))
+
+    def test_fraction(self):
+        numerators = (-5, 1, 12, 38)
+        for n in numerators:
+            f = Fraction(n, 37)
+            self.assertEqual(statistics._exact_ratio(f), (n, 37))
+
+    def test_float(self):
+        self.assertEqual(statistics._exact_ratio(0.125), (1, 8))
+        self.assertEqual(statistics._exact_ratio(1.125), (9, 8))
+        data = [random.uniform(-100, 100) for _ in range(100)]
+        for x in data:
+            num, den = statistics._exact_ratio(x)
+            self.assertEqual(x, num/den)
+
+    def test_decimal(self):
+        D = Decimal
+        _exact_ratio = statistics._exact_ratio
+        self.assertEqual(_exact_ratio(D("0.125")), (125, 1000))
+        self.assertEqual(_exact_ratio(D("12.345")), (12345, 1000))
+        self.assertEqual(_exact_ratio(D("-1.98")), (-198, 100))
+
+
+class DecimalToRatioTest(unittest.TestCase):
+    # Test _decimal_to_ratio private function.
+
+    def testSpecialsRaise(self):
+        # Test that NANs and INFs raise ValueError.
+        # Non-special values are covered by _exact_ratio above.
+        for d in (Decimal('NAN'), Decimal('sNAN'), Decimal('INF')):
+            self.assertRaises(ValueError, statistics._decimal_to_ratio, d)
+
+    def test_sign(self):
+        # Test sign is calculated correctly.
+        numbers = [Decimal("9.8765e12"), Decimal("9.8765e-12")]
+        for d in numbers:
+            # First test positive decimals.
+            assert d > 0
+            num, den = statistics._decimal_to_ratio(d)
+            self.assertGreaterEqual(num, 0)
+            self.assertGreater(den, 0)
+            # Then test negative decimals.
+            num, den = statistics._decimal_to_ratio(-d)
+            self.assertLessEqual(num, 0)
+            self.assertGreater(den, 0)
+
+    def test_negative_exponent(self):
+        # Test result when the exponent is negative.
+        t = statistics._decimal_to_ratio(Decimal("0.1234"))
+        self.assertEqual(t, (1234, 10000))
+
+    def test_positive_exponent(self):
+        # Test results when the exponent is positive.
+        t = statistics._decimal_to_ratio(Decimal("1.234e7"))
+        self.assertEqual(t, (12340000, 1))
+
+    def test_regression_20536(self):
+        # Regression test for issue 20536.
+        # See http://bugs.python.org/issue20536
+        t = statistics._decimal_to_ratio(Decimal("1e2"))
+        self.assertEqual(t, (100, 1))
+        t = statistics._decimal_to_ratio(Decimal("1.47e5"))
+        self.assertEqual(t, (147000, 1))
+
+
+class CheckTypeTest(unittest.TestCase):
+    # Test _check_type private function.
+
+    def test_allowed(self):
+        # Test that a type which should be allowed is allowed.
+        allowed = set([int, float])
+        statistics._check_type(int, allowed)
+        statistics._check_type(float, allowed)
+
+    def test_not_allowed(self):
+        # Test that a type which should not be allowed raises.
+        allowed = set([int, float])
+        self.assertRaises(TypeError, statistics._check_type, Decimal, allowed)
+
+    def test_add_to_allowed(self):
+        # Test that a second type will be added to the allowed set.
+        allowed = set([int])
+        statistics._check_type(float, allowed)
+        self.assertEqual(allowed, set([int, float]))
+
+
+# === Tests for public functions ===
+
+class UnivariateCommonMixin:
+    # Common tests for most univariate functions that take a data argument.
+
+    def test_no_args(self):
+        # Fail if given no arguments.
+        self.assertRaises(TypeError, self.func)
+
+    def test_empty_data(self):
+        # Fail when the data argument (first argument) is empty.
+        for empty in ([], (), iter([])):
+            self.assertRaises(statistics.StatisticsError, self.func, empty)
+
+    def prepare_data(self):
+        """Return int data for various tests."""
+        data = list(range(10))
+        while data == sorted(data):
+            random.shuffle(data)
+        return data
+
+    def test_no_inplace_modifications(self):
+        # Test that the function does not modify its input data.
+        data = self.prepare_data()
+        assert len(data) != 1  # Necessary to avoid infinite loop.
+        assert data != sorted(data)
+        saved = data[:]
+        assert data is not saved
+        _ = self.func(data)
+        self.assertListEqual(data, saved, "data has been modified")
+
+    def test_order_doesnt_matter(self):
+        # Test that the order of data points doesn't change the result.
+
+        # CAUTION: due to floating point rounding errors, the result actually
+        # may depend on the order. Consider this test representing an ideal.
+        # To avoid this test failing, only test with exact values such as ints
+        # or Fractions.
+        data = [1, 2, 3, 3, 3, 4, 5, 6]*100
+        expected = self.func(data)
+        random.shuffle(data)
+        actual = self.func(data)
+        self.assertEqual(expected, actual)
+
+    def test_type_of_data_collection(self):
+        # Test that the type of iterable data doesn't effect the result.
+        class MyList(list):
+            pass
+        class MyTuple(tuple):
+            pass
+        def generator(data):
+            return (obj for obj in data)
+        data = self.prepare_data()
+        expected = self.func(data)
+        for kind in (list, tuple, iter, MyList, MyTuple, generator):
+            result = self.func(kind(data))
+            self.assertEqual(result, expected)
+
+    def test_range_data(self):
+        # Test that functions work with range objects.
+        data = range(20, 50, 3)
+        expected = self.func(list(data))
+        self.assertEqual(self.func(data), expected)
+
+    def test_bad_arg_types(self):
+        # Test that function raises when given data of the wrong type.
+
+        # Don't roll the following into a loop like this:
+        #   for bad in list_of_bad:
+        #       self.check_for_type_error(bad)
+        #
+        # Since assertRaises doesn't show the arguments that caused the test
+        # failure, it is very difficult to debug these test failures when the
+        # following are in a loop.
+        self.check_for_type_error(None)
+        self.check_for_type_error(23)
+        self.check_for_type_error(42.0)
+        self.check_for_type_error(object())
+
+    def check_for_type_error(self, *args):
+        self.assertRaises(TypeError, self.func, *args)
+
+    def test_type_of_data_element(self):
+        # Check the type of data elements doesn't affect the numeric result.
+        # This is a weaker test than UnivariateTypeMixin.testTypesConserved,
+        # because it checks the numeric result by equality, but not by type.
+        class MyFloat(float):
+            def __truediv__(self, other):
+                return type(self)(super().__truediv__(other))
+            def __add__(self, other):
+                return type(self)(super().__add__(other))
+            __radd__ = __add__
+
+        raw = self.prepare_data()
+        expected = self.func(raw)
+        for kind in (float, MyFloat, Decimal, Fraction):
+            data = [kind(x) for x in raw]
+            result = type(expected)(self.func(data))
+            self.assertEqual(result, expected)
+
+
+class UnivariateTypeMixin:
+    """Mixin class for type-conserving functions.
+
+    This mixin class holds test(s) for functions which conserve the type of
+    individual data points. E.g. the mean of a list of Fractions should itself
+    be a Fraction.
+
+    Not all tests to do with types need go in this class. Only those that
+    rely on the function returning the same type as its input data.
+    """
+    def test_types_conserved(self):
+        # Test that functions keeps the same type as their data points.
+        # (Excludes mixed data types.) This only tests the type of the return
+        # result, not the value.
+        class MyFloat(float):
+            def __truediv__(self, other):
+                return type(self)(super().__truediv__(other))
+            def __sub__(self, other):
+                return type(self)(super().__sub__(other))
+            def __rsub__(self, other):
+                return type(self)(super().__rsub__(other))
+            def __pow__(self, other):
+                return type(self)(super().__pow__(other))
+            def __add__(self, other):
+                return type(self)(super().__add__(other))
+            __radd__ = __add__
+
+        data = self.prepare_data()
+        for kind in (float, Decimal, Fraction, MyFloat):
+            d = [kind(x) for x in data]
+            result = self.func(d)
+            self.assertIs(type(result), kind)
+
+
+class TestSum(NumericTestCase, UnivariateCommonMixin, UnivariateTypeMixin):
+    # Test cases for statistics._sum() function.
+
+    def setUp(self):
+        self.func = statistics._sum
+
+    def test_empty_data(self):
+        # Override test for empty data.
+        for data in ([], (), iter([])):
+            self.assertEqual(self.func(data), 0)
+            self.assertEqual(self.func(data, 23), 23)
+            self.assertEqual(self.func(data, 2.3), 2.3)
+
+    def test_ints(self):
+        self.assertEqual(self.func([1, 5, 3, -4, -8, 20, 42, 1]), 60)
+        self.assertEqual(self.func([4, 2, 3, -8, 7], 1000), 1008)
+
+    def test_floats(self):
+        self.assertEqual(self.func([0.25]*20), 5.0)
+        self.assertEqual(self.func([0.125, 0.25, 0.5, 0.75], 1.5), 3.125)
+
+    def test_fractions(self):
+        F = Fraction
+        self.assertEqual(self.func([Fraction(1, 1000)]*500), Fraction(1, 2))
+
+    def test_decimals(self):
+        D = Decimal
+        data = [D("0.001"), D("5.246"), D("1.702"), D("-0.025"),
+                D("3.974"), D("2.328"), D("4.617"), D("2.843"),
+                ]
+        self.assertEqual(self.func(data), Decimal("20.686"))
+
+    def test_compare_with_math_fsum(self):
+        # Compare with the math.fsum function.
+        # Ideally we ought to get the exact same result, but sometimes
+        # we differ by a very slight amount :-(
+        data = [random.uniform(-100, 1000) for _ in range(1000)]
+        self.assertApproxEqual(self.func(data), math.fsum(data), rel=2e-16)
+
+    def test_start_argument(self):
+        # Test that the optional start argument works correctly.
+        data = [random.uniform(1, 1000) for _ in range(100)]
+        t = self.func(data)
+        self.assertEqual(t+42, self.func(data, 42))
+        self.assertEqual(t-23, self.func(data, -23))
+        self.assertEqual(t+1e20, self.func(data, 1e20))
+
+    def test_strings_fail(self):
+        # Sum of strings should fail.
+        self.assertRaises(TypeError, self.func, [1, 2, 3], '999')
+        self.assertRaises(TypeError, self.func, [1, 2, 3, '999'])
+
+    def test_bytes_fail(self):
+        # Sum of bytes should fail.
+        self.assertRaises(TypeError, self.func, [1, 2, 3], b'999')
+        self.assertRaises(TypeError, self.func, [1, 2, 3, b'999'])
+
+    def test_mixed_sum(self):
+        # Mixed input types are not (currently) allowed.
+        # Check that mixed data types fail.
+        self.assertRaises(TypeError, self.func, [1, 2.0, Fraction(1, 2)])
+        # And so does mixed start argument.
+        self.assertRaises(TypeError, self.func, [1, 2.0], Decimal(1))
+
+
+class SumTortureTest(NumericTestCase):
+    def test_torture(self):
+        # Tim Peters' torture test for sum, and variants of same.
+        self.assertEqual(statistics._sum([1, 1e100, 1, -1e100]*10000), 20000.0)
+        self.assertEqual(statistics._sum([1e100, 1, 1, -1e100]*10000), 20000.0)
+        self.assertApproxEqual(
+            statistics._sum([1e-100, 1, 1e-100, -1]*10000), 2.0e-96, rel=5e-16
+            )
+
+
+class SumSpecialValues(NumericTestCase):
+    # Test that sum works correctly with IEEE-754 special values.
+
+    def test_nan(self):
+        for type_ in (float, Decimal):
+            nan = type_('nan')
+            result = statistics._sum([1, nan, 2])
+            self.assertIs(type(result), type_)
+            self.assertTrue(math.isnan(result))
+
+    def check_infinity(self, x, inf):
+        """Check x is an infinity of the same type and sign as inf."""
+        self.assertTrue(math.isinf(x))
+        self.assertIs(type(x), type(inf))
+        self.assertEqual(x > 0, inf > 0)
+        assert x == inf
+
+    def do_test_inf(self, inf):
+        # Adding a single infinity gives infinity.
+        result = statistics._sum([1, 2, inf, 3])
+        self.check_infinity(result, inf)
+        # Adding two infinities of the same sign also gives infinity.
+        result = statistics._sum([1, 2, inf, 3, inf, 4])
+        self.check_infinity(result, inf)
+
+    def test_float_inf(self):
+        inf = float('inf')
+        for sign in (+1, -1):
+            self.do_test_inf(sign*inf)
+
+    def test_decimal_inf(self):
+        inf = Decimal('inf')
+        for sign in (+1, -1):
+            self.do_test_inf(sign*inf)
+
+    def test_float_mismatched_infs(self):
+        # Test that adding two infinities of opposite sign gives a NAN.
+        inf = float('inf')
+        result = statistics._sum([1, 2, inf, 3, -inf, 4])
+        self.assertTrue(math.isnan(result))
+
+    def test_decimal_extendedcontext_mismatched_infs_to_nan(self):
+        # Test adding Decimal INFs with opposite sign returns NAN.
+        inf = Decimal('inf')
+        data = [1, 2, inf, 3, -inf, 4]
+        with decimal.localcontext(decimal.ExtendedContext):
+            self.assertTrue(math.isnan(statistics._sum(data)))
+
+    def test_decimal_basiccontext_mismatched_infs_to_nan(self):
+        # Test adding Decimal INFs with opposite sign raises InvalidOperation.
+        inf = Decimal('inf')
+        data = [1, 2, inf, 3, -inf, 4]
+        with decimal.localcontext(decimal.BasicContext):
+            self.assertRaises(decimal.InvalidOperation, statistics._sum, data)
+
+    def test_decimal_snan_raises(self):
+        # Adding sNAN should raise InvalidOperation.
+        sNAN = Decimal('sNAN')
+        data = [1, sNAN, 2]
+        self.assertRaises(decimal.InvalidOperation, statistics._sum, data)
+
+
+# === Tests for averages ===
+
+class AverageMixin(UnivariateCommonMixin):
+    # Mixin class holding common tests for averages.
+
+    def test_single_value(self):
+        # Average of a single value is the value itself.
+        for x in (23, 42.5, 1.3e15, Fraction(15, 19), Decimal('0.28')):
+            self.assertEqual(self.func([x]), x)
+
+    def test_repeated_single_value(self):
+        # The average of a single repeated value is the value itself.
+        for x in (3.5, 17, 2.5e15, Fraction(61, 67), Decimal('4.9712')):
+            for count in (2, 5, 10, 20):
+                data = [x]*count
+                self.assertEqual(self.func(data), x)
+
+
+class TestMean(NumericTestCase, AverageMixin, UnivariateTypeMixin):
+    def setUp(self):
+        self.func = statistics.mean
+
+    def test_torture_pep(self):
+        # "Torture Test" from PEP-450.
+        self.assertEqual(self.func([1e100, 1, 3, -1e100]), 1)
+
+    def test_ints(self):
+        # Test mean with ints.
+        data = [0, 1, 2, 3, 3, 3, 4, 5, 5, 6, 7, 7, 7, 7, 8, 9]
+        random.shuffle(data)
+        self.assertEqual(self.func(data), 4.8125)
+
+    def test_floats(self):
+        # Test mean with floats.
+        data = [17.25, 19.75, 20.0, 21.5, 21.75, 23.25, 25.125, 27.5]
+        random.shuffle(data)
+        self.assertEqual(self.func(data), 22.015625)
+
+    def test_decimals(self):
+        # Test mean with ints.
+        D = Decimal
+        data = [D("1.634"), D("2.517"), D("3.912"), D("4.072"), D("5.813")]
+        random.shuffle(data)
+        self.assertEqual(self.func(data), D("3.5896"))
+
+    def test_fractions(self):
+        # Test mean with Fractions.
+        F = Fraction
+        data = [F(1, 2), F(2, 3), F(3, 4), F(4, 5), F(5, 6), F(6, 7), F(7, 8)]
+        random.shuffle(data)
+        self.assertEqual(self.func(data), F(1479, 1960))
+
+    def test_inf(self):
+        # Test mean with infinities.
+        raw = [1, 3, 5, 7, 9]  # Use only ints, to avoid TypeError later.
+        for kind in (float, Decimal):
+            for sign in (1, -1):
+                inf = kind("inf")*sign
+                data = raw + [inf]
+                result = self.func(data)
+                self.assertTrue(math.isinf(result))
+                self.assertEqual(result, inf)
+
+    def test_mismatched_infs(self):
+        # Test mean with infinities of opposite sign.
+        data = [2, 4, 6, float('inf'), 1, 3, 5, float('-inf')]
+        result = self.func(data)
+        self.assertTrue(math.isnan(result))
+
+    def test_nan(self):
+        # Test mean with NANs.
+        raw = [1, 3, 5, 7, 9]  # Use only ints, to avoid TypeError later.
+        for kind in (float, Decimal):
+            inf = kind("nan")
+            data = raw + [inf]
+            result = self.func(data)
+            self.assertTrue(math.isnan(result))
+
+    def test_big_data(self):
+        # Test adding a large constant to every data point.
+        c = 1e9
+        data = [3.4, 4.5, 4.9, 6.7, 6.8, 7.2, 8.0, 8.1, 9.4]
+        expected = self.func(data) + c
+        assert expected != c
+        result = self.func([x+c for x in data])
+        self.assertEqual(result, expected)
+
+    def test_doubled_data(self):
+        # Mean of [a,b,c...z] should be same as for [a,a,b,b,c,c...z,z].
+        data = [random.uniform(-3, 5) for _ in range(1000)]
+        expected = self.func(data)
+        actual = self.func(data*2)
+        self.assertApproxEqual(actual, expected)
+
+    def test_regression_20561(self):
+        # Regression test for issue 20561.
+        # See http://bugs.python.org/issue20561
+        d = Decimal('1e4')
+        self.assertEqual(statistics.mean([d]), d)
+
+
+class TestMedian(NumericTestCase, AverageMixin):
+    # Common tests for median and all median.* functions.
+    def setUp(self):
+        self.func = statistics.median
+
+    def prepare_data(self):
+        """Overload method from UnivariateCommonMixin."""
+        data = super().prepare_data()
+        if len(data)%2 != 1:
+            data.append(2)
+        return data
+
+    def test_even_ints(self):
+        # Test median with an even number of int data points.
+        data = [1, 2, 3, 4, 5, 6]
+        assert len(data)%2 == 0
+        self.assertEqual(self.func(data), 3.5)
+
+    def test_odd_ints(self):
+        # Test median with an odd number of int data points.
+        data = [1, 2, 3, 4, 5, 6, 9]
+        assert len(data)%2 == 1
+        self.assertEqual(self.func(data), 4)
+
+    def test_odd_fractions(self):
+        # Test median works with an odd number of Fractions.
+        F = Fraction
+        data = [F(1, 7), F(2, 7), F(3, 7), F(4, 7), F(5, 7)]
+        assert len(data)%2 == 1
+        random.shuffle(data)
+        self.assertEqual(self.func(data), F(3, 7))
+
+    def test_even_fractions(self):
+        # Test median works with an even number of Fractions.
+        F = Fraction
+        data = [F(1, 7), F(2, 7), F(3, 7), F(4, 7), F(5, 7), F(6, 7)]
+        assert len(data)%2 == 0
+        random.shuffle(data)
+        self.assertEqual(self.func(data), F(1, 2))
+
+    def test_odd_decimals(self):
+        # Test median works with an odd number of Decimals.
+        D = Decimal
+        data = [D('2.5'), D('3.1'), D('4.2'), D('5.7'), D('5.8')]
+        assert len(data)%2 == 1
+        random.shuffle(data)
+        self.assertEqual(self.func(data), D('4.2'))
+
+    def test_even_decimals(self):
+        # Test median works with an even number of Decimals.
+        D = Decimal
+        data = [D('1.2'), D('2.5'), D('3.1'), D('4.2'), D('5.7'), D('5.8')]
+        assert len(data)%2 == 0
+        random.shuffle(data)
+        self.assertEqual(self.func(data), D('3.65'))
+
+
+class TestMedianDataType(NumericTestCase, UnivariateTypeMixin):
+    # Test conservation of data element type for median.
+    def setUp(self):
+        self.func = statistics.median
+
+    def prepare_data(self):
+        data = list(range(15))
+        assert len(data)%2 == 1
+        while data == sorted(data):
+            random.shuffle(data)
+        return data
+
+
+class TestMedianLow(TestMedian, UnivariateTypeMixin):
+    def setUp(self):
+        self.func = statistics.median_low
+
+    def test_even_ints(self):
+        # Test median_low with an even number of ints.
+        data = [1, 2, 3, 4, 5, 6]
+        assert len(data)%2 == 0
+        self.assertEqual(self.func(data), 3)
+
+    def test_even_fractions(self):
+        # Test median_low works with an even number of Fractions.
+        F = Fraction
+        data = [F(1, 7), F(2, 7), F(3, 7), F(4, 7), F(5, 7), F(6, 7)]
+        assert len(data)%2 == 0
+        random.shuffle(data)
+        self.assertEqual(self.func(data), F(3, 7))
+
+    def test_even_decimals(self):
+        # Test median_low works with an even number of Decimals.
+        D = Decimal
+        data = [D('1.1'), D('2.2'), D('3.3'), D('4.4'), D('5.5'), D('6.6')]
+        assert len(data)%2 == 0
+        random.shuffle(data)
+        self.assertEqual(self.func(data), D('3.3'))
+
+
+class TestMedianHigh(TestMedian, UnivariateTypeMixin):
+    def setUp(self):
+        self.func = statistics.median_high
+
+    def test_even_ints(self):
+        # Test median_high with an even number of ints.
+        data = [1, 2, 3, 4, 5, 6]
+        assert len(data)%2 == 0
+        self.assertEqual(self.func(data), 4)
+
+    def test_even_fractions(self):
+        # Test median_high works with an even number of Fractions.
+        F = Fraction
+        data = [F(1, 7), F(2, 7), F(3, 7), F(4, 7), F(5, 7), F(6, 7)]
+        assert len(data)%2 == 0
+        random.shuffle(data)
+        self.assertEqual(self.func(data), F(4, 7))
+
+    def test_even_decimals(self):
+        # Test median_high works with an even number of Decimals.
+        D = Decimal
+        data = [D('1.1'), D('2.2'), D('3.3'), D('4.4'), D('5.5'), D('6.6')]
+        assert len(data)%2 == 0
+        random.shuffle(data)
+        self.assertEqual(self.func(data), D('4.4'))
+
+
+class TestMedianGrouped(TestMedian):
+    # Test median_grouped.
+    # Doesn't conserve data element types, so don't use TestMedianType.
+    def setUp(self):
+        self.func = statistics.median_grouped
+
+    def test_odd_number_repeated(self):
+        # Test median.grouped with repeated median values.
+        data = [12, 13, 14, 14, 14, 15, 15]
+        assert len(data)%2 == 1
+        self.assertEqual(self.func(data), 14)
+        #---
+        data = [12, 13, 14, 14, 14, 14, 15]
+        assert len(data)%2 == 1
+        self.assertEqual(self.func(data), 13.875)
+        #---
+        data = [5, 10, 10, 15, 20, 20, 20, 20, 25, 25, 30]
+        assert len(data)%2 == 1
+        self.assertEqual(self.func(data, 5), 19.375)
+        #---
+        data = [16, 18, 18, 18, 18, 20, 20, 20, 22, 22, 22, 24, 24, 26, 28]
+        assert len(data)%2 == 1
+        self.assertApproxEqual(self.func(data, 2), 20.66666667, tol=1e-8)
+
+    def test_even_number_repeated(self):
+        # Test median.grouped with repeated median values.
+        data = [5, 10, 10, 15, 20, 20, 20, 25, 25, 30]
+        assert len(data)%2 == 0
+        self.assertApproxEqual(self.func(data, 5), 19.16666667, tol=1e-8)
+        #---
+        data = [2, 3, 4, 4, 4, 5]
+        assert len(data)%2 == 0
+        self.assertApproxEqual(self.func(data), 3.83333333, tol=1e-8)
+        #---
+        data = [2, 3, 3, 4, 4, 4, 5, 5, 5, 5, 6, 6]
+        assert len(data)%2 == 0
+        self.assertEqual(self.func(data), 4.5)
+        #---
+        data = [3, 4, 4, 4, 5, 5, 5, 5, 6, 6]
+        assert len(data)%2 == 0
+        self.assertEqual(self.func(data), 4.75)
+
+    def test_repeated_single_value(self):
+        # Override method from AverageMixin.
+        # Yet again, failure of median_grouped to conserve the data type
+        # causes me headaches :-(
+        for x in (5.3, 68, 4.3e17, Fraction(29, 101), Decimal('32.9714')):
+            for count in (2, 5, 10, 20):
+                data = [x]*count
+                self.assertEqual(self.func(data), float(x))
+
+    def test_odd_fractions(self):
+        # Test median_grouped works with an odd number of Fractions.
+        F = Fraction
+        data = [F(5, 4), F(9, 4), F(13, 4), F(13, 4), F(17, 4)]
+        assert len(data)%2 == 1
+        random.shuffle(data)
+        self.assertEqual(self.func(data), 3.0)
+
+    def test_even_fractions(self):
+        # Test median_grouped works with an even number of Fractions.
+        F = Fraction
+        data = [F(5, 4), F(9, 4), F(13, 4), F(13, 4), F(17, 4), F(17, 4)]
+        assert len(data)%2 == 0
+        random.shuffle(data)
+        self.assertEqual(self.func(data), 3.25)
+
+    def test_odd_decimals(self):
+        # Test median_grouped works with an odd number of Decimals.
+        D = Decimal
+        data = [D('5.5'), D('6.5'), D('6.5'), D('7.5'), D('8.5')]
+        assert len(data)%2 == 1
+        random.shuffle(data)
+        self.assertEqual(self.func(data), 6.75)
+
+    def test_even_decimals(self):
+        # Test median_grouped works with an even number of Decimals.
+        D = Decimal
+        data = [D('5.5'), D('5.5'), D('6.5'), D('6.5'), D('7.5'), D('8.5')]
+        assert len(data)%2 == 0
+        random.shuffle(data)
+        self.assertEqual(self.func(data), 6.5)
+        #---
+        data = [D('5.5'), D('5.5'), D('6.5'), D('7.5'), D('7.5'), D('8.5')]
+        assert len(data)%2 == 0
+        random.shuffle(data)
+        self.assertEqual(self.func(data), 7.0)
+
+    def test_interval(self):
+        # Test median_grouped with interval argument.
+        data = [2.25, 2.5, 2.5, 2.75, 2.75, 3.0, 3.0, 3.25, 3.5, 3.75]
+        self.assertEqual(self.func(data, 0.25), 2.875)
+        data = [2.25, 2.5, 2.5, 2.75, 2.75, 2.75, 3.0, 3.0, 3.25, 3.5, 3.75]
+        self.assertApproxEqual(self.func(data, 0.25), 2.83333333, tol=1e-8)
+        data = [220, 220, 240, 260, 260, 260, 260, 280, 280, 300, 320, 340]
+        self.assertEqual(self.func(data, 20), 265.0)
+
+
+class TestMode(NumericTestCase, AverageMixin, UnivariateTypeMixin):
+    # Test cases for the discrete version of mode.
+    def setUp(self):
+        self.func = statistics.mode
+
+    def prepare_data(self):
+        """Overload method from UnivariateCommonMixin."""
+        # Make sure test data has exactly one mode.
+        return [1, 1, 1, 1, 3, 4, 7, 9, 0, 8, 2]
+
+    def test_range_data(self):
+        # Override test from UnivariateCommonMixin.
+        data = range(20, 50, 3)
+        self.assertRaises(statistics.StatisticsError, self.func, data)
+
+    def test_nominal_data(self):
+        # Test mode with nominal data.
+        data = 'abcbdb'
+        self.assertEqual(self.func(data), 'b')
+        data = 'fe fi fo fum fi fi'.split()
+        self.assertEqual(self.func(data), 'fi')
+
+    def test_discrete_data(self):
+        # Test mode with discrete numeric data.
+        data = list(range(10))
+        for i in range(10):
+            d = data + [i]
+            random.shuffle(d)
+            self.assertEqual(self.func(d), i)
+
+    def test_bimodal_data(self):
+        # Test mode with bimodal data.
+        data = [1, 1, 2, 2, 2, 2, 3, 4, 5, 6, 6, 6, 6, 7, 8, 9, 9]
+        assert data.count(2) == data.count(6) == 4
+        # Check for an exception.
+        self.assertRaises(statistics.StatisticsError, self.func, data)
+
+    def test_unique_data_failure(self):
+        # Test mode exception when data points are all unique.
+        data = list(range(10))
+        self.assertRaises(statistics.StatisticsError, self.func, data)
+
+    def test_none_data(self):
+        # Test that mode raises TypeError if given None as data.
+
+        # This test is necessary because the implementation of mode uses
+        # collections.Counter, which accepts None and returns an empty dict.
+        self.assertRaises(TypeError, self.func, None)
+
+    def test_counter_data(self):
+        # Test that a Counter is treated like any other iterable.
+        data = collections.Counter([1, 1, 1, 2])
+        # Since the keys of the counter are treated as data points, not the
+        # counts, this should raise.
+        self.assertRaises(statistics.StatisticsError, self.func, data)
+
+
+
+# === Tests for variances and standard deviations ===
+
+class VarianceStdevMixin(UnivariateCommonMixin):
+    # Mixin class holding common tests for variance and std dev.
+
+    # Subclasses should inherit from this before NumericTestClass, in order
+    # to see the rel attribute below. See testShiftData for an explanation.
+
+    rel = 1e-12
+
+    def test_single_value(self):
+        # Deviation of a single value is zero.
+        for x in (11, 19.8, 4.6e14, Fraction(21, 34), Decimal('8.392')):
+            self.assertEqual(self.func([x]), 0)
+
+    def test_repeated_single_value(self):
+        # The deviation of a single repeated value is zero.
+        for x in (7.2, 49, 8.1e15, Fraction(3, 7), Decimal('62.4802')):
+            for count in (2, 3, 5, 15):
+                data = [x]*count
+                self.assertEqual(self.func(data), 0)
+
+    def test_domain_error_regression(self):
+        # Regression test for a domain error exception.
+        # (Thanks to Geremy Condra.)
+        data = [0.123456789012345]*10000
+        # All the items are identical, so variance should be exactly zero.
+        # We allow some small round-off error, but not much.
+        result = self.func(data)
+        self.assertApproxEqual(result, 0.0, tol=5e-17)
+        self.assertGreaterEqual(result, 0)  # A negative result must fail.
+
+    def test_shift_data(self):
+        # Test that shifting the data by a constant amount does not affect
+        # the variance or stdev. Or at least not much.
+
+        # Due to rounding, this test should be considered an ideal. We allow
+        # some tolerance away from "no change at all" by setting tol and/or rel
+        # attributes. Subclasses may set tighter or looser error tolerances.
+        raw = [1.03, 1.27, 1.94, 2.04, 2.58, 3.14, 4.75, 4.98, 5.42, 6.78]
+        expected = self.func(raw)
+        # Don't set shift too high, the bigger it is, the more rounding error.
+        shift = 1e5
+        data = [x + shift for x in raw]
+        self.assertApproxEqual(self.func(data), expected)
+
+    def test_shift_data_exact(self):
+        # Like test_shift_data, but result is always exact.
+        raw = [1, 3, 3, 4, 5, 7, 9, 10, 11, 16]
+        assert all(x==int(x) for x in raw)
+        expected = self.func(raw)
+        shift = 10**9
+        data = [x + shift for x in raw]
+        self.assertEqual(self.func(data), expected)
+
+    def test_iter_list_same(self):
+        # Test that iter data and list data give the same result.
+
+        # This is an explicit test that iterators and lists are treated the
+        # same; justification for this test over and above the similar test
+        # in UnivariateCommonMixin is that an earlier design had variance and
+        # friends swap between one- and two-pass algorithms, which would
+        # sometimes give different results.
+        data = [random.uniform(-3, 8) for _ in range(1000)]
+        expected = self.func(data)
+        self.assertEqual(self.func(iter(data)), expected)
+
+
+class TestPVariance(VarianceStdevMixin, NumericTestCase, UnivariateTypeMixin):
+    # Tests for population variance.
+    def setUp(self):
+        self.func = statistics.pvariance
+
+    def test_exact_uniform(self):
+        # Test the variance against an exact result for uniform data.
+        data = list(range(10000))
+        random.shuffle(data)
+        expected = (10000**2 - 1)/12  # Exact value.
+        self.assertEqual(self.func(data), expected)
+
+    def test_ints(self):
+        # Test population variance with int data.
+        data = [4, 7, 13, 16]
+        exact = 22.5
+        self.assertEqual(self.func(data), exact)
+
+    def test_fractions(self):
+        # Test population variance with Fraction data.
+        F = Fraction
+        data = [F(1, 4), F(1, 4), F(3, 4), F(7, 4)]
+        exact = F(3, 8)
+        result = self.func(data)
+        self.assertEqual(result, exact)
+        self.assertIsInstance(result, Fraction)
+
+    def test_decimals(self):
+        # Test population variance with Decimal data.
+        D = Decimal
+        data = [D("12.1"), D("12.2"), D("12.5"), D("12.9")]
+        exact = D('0.096875')
+        result = self.func(data)
+        self.assertEqual(result, exact)
+        self.assertIsInstance(result, Decimal)
+
+
+class TestVariance(VarianceStdevMixin, NumericTestCase, UnivariateTypeMixin):
+    # Tests for sample variance.
+    def setUp(self):
+        self.func = statistics.variance
+
+    def test_single_value(self):
+        # Override method from VarianceStdevMixin.
+        for x in (35, 24.7, 8.2e15, Fraction(19, 30), Decimal('4.2084')):
+            self.assertRaises(statistics.StatisticsError, self.func, [x])
+
+    def test_ints(self):
+        # Test sample variance with int data.
+        data = [4, 7, 13, 16]
+        exact = 30
+        self.assertEqual(self.func(data), exact)
+
+    def test_fractions(self):
+        # Test sample variance with Fraction data.
+        F = Fraction
+        data = [F(1, 4), F(1, 4), F(3, 4), F(7, 4)]
+        exact = F(1, 2)
+        result = self.func(data)
+        self.assertEqual(result, exact)
+        self.assertIsInstance(result, Fraction)
+
+    def test_decimals(self):
+        # Test sample variance with Decimal data.
+        D = Decimal
+        data = [D(2), D(2), D(7), D(9)]
+        exact = 4*D('9.5')/D(3)
+        result = self.func(data)
+        self.assertEqual(result, exact)
+        self.assertIsInstance(result, Decimal)
+
+
+class TestPStdev(VarianceStdevMixin, NumericTestCase):
+    # Tests for population standard deviation.
+    def setUp(self):
+        self.func = statistics.pstdev
+
+    def test_compare_to_variance(self):
+        # Test that stdev is, in fact, the square root of variance.
+        data = [random.uniform(-17, 24) for _ in range(1000)]
+        expected = math.sqrt(statistics.pvariance(data))
+        self.assertEqual(self.func(data), expected)
+
+
+class TestStdev(VarianceStdevMixin, NumericTestCase):
+    # Tests for sample standard deviation.
+    def setUp(self):
+        self.func = statistics.stdev
+
+    def test_single_value(self):
+        # Override method from VarianceStdevMixin.
+        for x in (81, 203.74, 3.9e14, Fraction(5, 21), Decimal('35.719')):
+            self.assertRaises(statistics.StatisticsError, self.func, [x])
+
+    def test_compare_to_variance(self):
+        # Test that stdev is, in fact, the square root of variance.
+        data = [random.uniform(-2, 9) for _ in range(1000)]
+        expected = math.sqrt(statistics.variance(data))
+        self.assertEqual(self.func(data), expected)
+
+
+# === Run tests ===
+
+def load_tests(loader, tests, ignore):
+    """Used for doctest/unittest integration."""
+    tests.addTests(doctest.DocTestSuite())
+    return tests
+
+
+if __name__ == "__main__":
+    unittest.main()
diff --git a/Lib/test/test_strftime.py b/Lib/test/test_strftime.py
index 4f39cc7..772cd06 100644
--- a/Lib/test/test_strftime.py
+++ b/Lib/test/test_strftime.py
@@ -182,15 +182,15 @@
     a date before 1900 is passed with a format string containing "%y"
     """
 
-    @unittest.skipUnless(sys.platform == "win32", "Only applies to Windows")
-    def test_y_before_1900_win(self):
-        with self.assertRaises(ValueError):
-            time.strftime("%y", (1899, 1, 1, 0, 0, 0, 0, 0, 0))
-
-    @unittest.skipIf(sys.platform == "win32", "Doesn't apply on Windows")
-    def test_y_before_1900_nonwin(self):
-        self.assertEqual(
-            time.strftime("%y", (1899, 1, 1, 0, 0, 0, 0, 0, 0)), "99")
+    def test_y_before_1900(self):
+        # Issue #13674, #19634
+        t = (1899, 1, 1, 0, 0, 0, 0, 0, 0)
+        if (sys.platform == "win32"
+        or sys.platform.startswith(("aix", "sunos", "solaris"))):
+            with self.assertRaises(ValueError):
+                time.strftime("%y", t)
+        else:
+            self.assertEqual(time.strftime("%y", t), "99")
 
     def test_y_1900(self):
         self.assertEqual(
@@ -200,8 +200,5 @@
         self.assertEqual(
             time.strftime("%y", (2013, 1, 1, 0, 0, 0, 0, 0, 0)), "13")
 
-def test_main():
-    support.run_unittest(StrftimeTest, Y1900Tests)
-
 if __name__ == '__main__':
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_string.py b/Lib/test/test_string.py
index c2bdfdb..3e65071 100644
--- a/Lib/test/test_string.py
+++ b/Lib/test/test_string.py
@@ -32,6 +32,23 @@
         self.assertEqual(fmt.format("foo{0}", "bar"), "foobar")
         self.assertEqual(fmt.format("foo{1}{0}-{1}", "bar", 6), "foo6bar-6")
 
+    def test_auto_numbering(self):
+        fmt = string.Formatter()
+        self.assertEqual(fmt.format('foo{}{}', 'bar', 6),
+                         'foo{}{}'.format('bar', 6))
+        self.assertEqual(fmt.format('foo{1}{num}{1}', None, 'bar', num=6),
+                         'foo{1}{num}{1}'.format(None, 'bar', num=6))
+        self.assertEqual(fmt.format('{:^{}}', 'bar', 6),
+                         '{:^{}}'.format('bar', 6))
+        self.assertEqual(fmt.format('{:^{pad}}{}', 'foo', 'bar', pad=6),
+                         '{:^{pad}}{}'.format('foo', 'bar', pad=6))
+
+        with self.assertRaises(ValueError):
+            fmt.format('foo{1}{}', 'bar', 6)
+
+        with self.assertRaises(ValueError):
+            fmt.format('foo{}{1}', 'bar', 6)
+
     def test_conversion_specifiers(self):
         fmt = string.Formatter()
         self.assertEqual(fmt.format("-{arg!r}-", arg='test'), "-'test'-")
diff --git a/Lib/test/test_stringprep.py b/Lib/test/test_stringprep.py
index aa71221..e763635 100644
--- a/Lib/test/test_stringprep.py
+++ b/Lib/test/test_stringprep.py
@@ -1,5 +1,5 @@
 # To fully test this module, we would need a copy of the stringprep tables.
-# Since we don't have them, this test checks only a few codepoints.
+# Since we don't have them, this test checks only a few code points.
 
 import unittest
 from test import support
diff --git a/Lib/test/test_strtod.py b/Lib/test/test_strtod.py
index c5979fc..41b6e5f 100644
--- a/Lib/test/test_strtod.py
+++ b/Lib/test/test_strtod.py
@@ -248,7 +248,7 @@
                     else:
                         assert False, "expected ValueError"
 
-    @test.support.bigmemtest(size=test.support._2G+10, memuse=4, dry_run=False)
+    @test.support.bigmemtest(size=test.support._2G+10, memuse=3, dry_run=False)
     def test_oversized_digit_strings(self, maxsize):
         # Input string whose length doesn't fit in an INT.
         s = "1." + "1" * maxsize
diff --git a/Lib/test/test_struct.py b/Lib/test/test_struct.py
index 50cae05..0107eeb 100644
--- a/Lib/test/test_struct.py
+++ b/Lib/test/test_struct.py
@@ -1,4 +1,6 @@
+from collections import abc
 import array
+import operator
 import unittest
 import struct
 import sys
@@ -6,7 +8,6 @@
 from test import support
 
 ISBIGENDIAN = sys.byteorder == "big"
-IS32BIT = sys.maxsize == 0x7fffffff
 
 integer_codes = 'b', 'B', 'h', 'H', 'i', 'I', 'l', 'L', 'q', 'Q', 'n', 'N'
 byteorders = '', '@', '=', '<', '>', '!'
@@ -489,7 +490,7 @@
     def test_bool(self):
         class ExplodingBool(object):
             def __bool__(self):
-                raise IOError
+                raise OSError
         for prefix in tuple("<>!=")+('',):
             false = (), [], [], '', 0
             true = [1], 'test', 5, -1, 0xffffffff+1, 0xffffffff/2
@@ -520,10 +521,10 @@
 
             try:
                 struct.pack(prefix + '?', ExplodingBool())
-            except IOError:
+            except OSError:
                 pass
             else:
-                self.fail("Expected IOError: struct.pack(%r, "
+                self.fail("Expected OSError: struct.pack(%r, "
                           "ExplodingBool())" % (prefix + '?'))
 
         for c in [b'\x01', b'\x7f', b'\xff', b'\x0f', b'\xf0']:
@@ -536,10 +537,6 @@
         hugecount2 = '{}b{}H'.format(sys.maxsize//2, sys.maxsize//2)
         self.assertRaises(struct.error, struct.calcsize, hugecount2)
 
-    if IS32BIT:
-        def test_crasher(self):
-            self.assertRaises(MemoryError, struct.pack, "357913941b", "a")
-
     def test_trailing_counter(self):
         store = array.array('b', b' '*100)
 
@@ -576,7 +573,7 @@
         # The size of 'PyStructObject'
         totalsize = support.calcobjsize('2n3P')
         # The size taken up by the 'formatcode' dynamic array
-        totalsize += struct.calcsize('P2n0P') * (number_of_codes + 1)
+        totalsize += struct.calcsize('P3n0P') * (number_of_codes + 1)
         support.check_sizeof(self, struct.Struct(format_str), totalsize)
 
     @support.cpython_only
@@ -587,14 +584,84 @@
         self.check_sizeof('B' * 1234, 1234)
         self.check_sizeof('fd', 2)
         self.check_sizeof('xxxxxxxxxxxxxx', 0)
-        self.check_sizeof('100H', 100)
+        self.check_sizeof('100H', 1)
         self.check_sizeof('187s', 1)
         self.check_sizeof('20p', 1)
         self.check_sizeof('0s', 1)
         self.check_sizeof('0c', 0)
 
+
+class UnpackIteratorTest(unittest.TestCase):
+    """
+    Tests for iterative unpacking (struct.Struct.iter_unpack).
+    """
+
+    def test_construct(self):
+        def _check_iterator(it):
+            self.assertIsInstance(it, abc.Iterator)
+            self.assertIsInstance(it, abc.Iterable)
+        s = struct.Struct('>ibcp')
+        it = s.iter_unpack(b"")
+        _check_iterator(it)
+        it = s.iter_unpack(b"1234567")
+        _check_iterator(it)
+        # Wrong bytes length
+        with self.assertRaises(struct.error):
+            s.iter_unpack(b"123456")
+        with self.assertRaises(struct.error):
+            s.iter_unpack(b"12345678")
+        # Zero-length struct
+        s = struct.Struct('>')
+        with self.assertRaises(struct.error):
+            s.iter_unpack(b"")
+        with self.assertRaises(struct.error):
+            s.iter_unpack(b"12")
+
+    def test_iterate(self):
+        s = struct.Struct('>IB')
+        b = bytes(range(1, 16))
+        it = s.iter_unpack(b)
+        self.assertEqual(next(it), (0x01020304, 5))
+        self.assertEqual(next(it), (0x06070809, 10))
+        self.assertEqual(next(it), (0x0b0c0d0e, 15))
+        self.assertRaises(StopIteration, next, it)
+        self.assertRaises(StopIteration, next, it)
+
+    def test_arbitrary_buffer(self):
+        s = struct.Struct('>IB')
+        b = bytes(range(1, 11))
+        it = s.iter_unpack(memoryview(b))
+        self.assertEqual(next(it), (0x01020304, 5))
+        self.assertEqual(next(it), (0x06070809, 10))
+        self.assertRaises(StopIteration, next, it)
+        self.assertRaises(StopIteration, next, it)
+
+    def test_length_hint(self):
+        lh = operator.length_hint
+        s = struct.Struct('>IB')
+        b = bytes(range(1, 16))
+        it = s.iter_unpack(b)
+        self.assertEqual(lh(it), 3)
+        next(it)
+        self.assertEqual(lh(it), 2)
+        next(it)
+        self.assertEqual(lh(it), 1)
+        next(it)
+        self.assertEqual(lh(it), 0)
+        self.assertRaises(StopIteration, next, it)
+        self.assertEqual(lh(it), 0)
+
+    def test_module_func(self):
+        # Sanity check for the global struct.iter_unpack()
+        it = struct.iter_unpack('>IB', bytes(range(1, 11)))
+        self.assertEqual(next(it), (0x01020304, 5))
+        self.assertEqual(next(it), (0x06070809, 10))
+        self.assertRaises(StopIteration, next, it)
+        self.assertRaises(StopIteration, next, it)
+
+
 def test_main():
-    support.run_unittest(StructTest)
+    support.run_unittest(__name__)
 
 if __name__ == '__main__':
     test_main()
diff --git a/Lib/test/test_structseq.py b/Lib/test/test_structseq.py
index a89e955..353d0ea 100644
--- a/Lib/test/test_structseq.py
+++ b/Lib/test/test_structseq.py
@@ -38,7 +38,7 @@
         # os.stat() gives a complicated struct sequence.
         st = os.stat(__file__)
         rep = repr(st)
-        self.assertTrue(rep.startswith(os.name + ".stat_result"))
+        self.assertTrue(rep.startswith("os.stat_result"))
         self.assertIn("st_mode=", rep)
         self.assertIn("st_ino=", rep)
         self.assertIn("st_dev=", rep)
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
index f5a70a3..5381115 100644
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -11,6 +11,7 @@
 import tempfile
 import time
 import re
+import selectors
 import sysconfig
 import warnings
 import select
@@ -19,10 +20,6 @@
 import textwrap
 
 try:
-    import resource
-except ImportError:
-    resource = None
-try:
     import threading
 except ImportError:
     threading = None
@@ -162,8 +159,28 @@
                 stderr=subprocess.STDOUT)
         self.assertIn(b'BDFL', output)
 
+    def test_check_output_stdin_arg(self):
+        # check_output() can be called with stdin set to a file
+        tf = tempfile.TemporaryFile()
+        self.addCleanup(tf.close)
+        tf.write(b'pear')
+        tf.seek(0)
+        output = subprocess.check_output(
+                [sys.executable, "-c",
+                 "import sys; sys.stdout.write(sys.stdin.read().upper())"],
+                stdin=tf)
+        self.assertIn(b'PEAR', output)
+
+    def test_check_output_input_arg(self):
+        # check_output() can be called with input set to a string
+        output = subprocess.check_output(
+                [sys.executable, "-c",
+                 "import sys; sys.stdout.write(sys.stdin.read().upper())"],
+                input=b'pear')
+        self.assertIn(b'PEAR', output)
+
     def test_check_output_stdout_arg(self):
-        # check_output() function stderr redirected to stdout
+        # check_output() refuses to accept 'stdout' argument
         with self.assertRaises(ValueError) as c:
             output = subprocess.check_output(
                     [sys.executable, "-c", "print('will not be run')"],
@@ -171,6 +188,20 @@
             self.fail("Expected ValueError when stdout arg supplied.")
         self.assertIn('stdout', c.exception.args[0])
 
+    def test_check_output_stdin_with_input_arg(self):
+        # check_output() refuses to accept 'stdin' with 'input'
+        tf = tempfile.TemporaryFile()
+        self.addCleanup(tf.close)
+        tf.write(b'pear')
+        tf.seek(0)
+        with self.assertRaises(ValueError) as c:
+            output = subprocess.check_output(
+                    [sys.executable, "-c", "print('will not be run')"],
+                    stdin=tf, input=b'hare')
+            self.fail("Expected ValueError when stdin and input args supplied.")
+        self.assertIn('stdin', c.exception.args[0])
+        self.assertIn('input', c.exception.args[0])
+
     def test_check_output_timeout(self):
         # check_output() function with timeout arg
         with self.assertRaises(subprocess.TimeoutExpired) as c:
@@ -755,6 +786,7 @@
                              stdout=subprocess.PIPE,
                              universal_newlines=1)
         p.stdin.write("line1\n")
+        p.stdin.flush()
         self.assertEqual(p.stdout.readline(), "line1\n")
         p.stdin.write("line3\n")
         p.stdin.close()
@@ -853,8 +885,9 @@
         #
         # UTF-16 and UTF-32-BE are sufficient to check both with BOM and
         # without, and UTF-16 and UTF-32.
+        import _bootlocale
         for encoding in ['utf-16', 'utf-32-be']:
-            old_getpreferredencoding = locale.getpreferredencoding
+            old_getpreferredencoding = _bootlocale.getpreferredencoding
             # Indirectly via io.TextIOWrapper, Popen() defaults to
             # locale.getpreferredencoding(False) and earlier in Python 3.2 to
             # locale.getpreferredencoding().
@@ -865,7 +898,7 @@
                     encoding)
             args = [sys.executable, '-c', code]
             try:
-                locale.getpreferredencoding = getpreferredencoding
+                _bootlocale.getpreferredencoding = getpreferredencoding
                 # We set stdin to be non-None because, as of this writing,
                 # a different code path is used when the number of pipes is
                 # zero or one.
@@ -874,7 +907,7 @@
                                          stdout=subprocess.PIPE)
                 stdout, stderr = popen.communicate(input='')
             finally:
-                locale.getpreferredencoding = old_getpreferredencoding
+                _bootlocale.getpreferredencoding = old_getpreferredencoding
             self.assertEqual(stdout, '1\n2\n3\n4')
 
     def test_no_leaking(self):
@@ -975,6 +1008,39 @@
         p = subprocess.Popen([sys.executable, "-c", "pass"], bufsize=None)
         self.assertEqual(p.wait(), 0)
 
+    def _test_bufsize_equal_one(self, line, expected, universal_newlines):
+        # subprocess may deadlock with bufsize=1, see issue #21332
+        with subprocess.Popen([sys.executable, "-c", "import sys;"
+                               "sys.stdout.write(sys.stdin.readline());"
+                               "sys.stdout.flush()"],
+                              stdin=subprocess.PIPE,
+                              stdout=subprocess.PIPE,
+                              stderr=subprocess.DEVNULL,
+                              bufsize=1,
+                              universal_newlines=universal_newlines) as p:
+            p.stdin.write(line) # expect that it flushes the line in text mode
+            os.close(p.stdin.fileno()) # close it without flushing the buffer
+            read_line = p.stdout.readline()
+            try:
+                p.stdin.close()
+            except OSError:
+                pass
+            p.stdin = None
+        self.assertEqual(p.returncode, 0)
+        self.assertEqual(read_line, expected)
+
+    def test_bufsize_equal_one_text_mode(self):
+        # line is flushed in text mode with bufsize=1.
+        # we should get the full line in return
+        line = "line\n"
+        self._test_bufsize_equal_one(line, line, universal_newlines=True)
+
+    def test_bufsize_equal_one_binary_mode(self):
+        # line is not flushed in binary mode with bufsize=1.
+        # we should get empty response
+        line = b'line' + os.linesep.encode() # assume ascii-based locale
+        self._test_bufsize_equal_one(line, b'', universal_newlines=False)
+
     def test_leaking_fds_on_error(self):
         # see bug #5179: Popen leaks file descriptors to PIPEs if
         # the child fails to execute; this will eventually exhaust
@@ -982,8 +1048,7 @@
         # value for that limit, but Windows has 2048, so we loop
         # 1024 times (each call leaked two fds).
         for i in range(1024):
-            # Windows raises IOError.  Others raise OSError.
-            with self.assertRaises(EnvironmentError) as c:
+            with self.assertRaises(OSError) as c:
                 subprocess.Popen(['nonexisting_i_hope'],
                                  stdout=subprocess.PIPE,
                                  stderr=subprocess.PIPE)
@@ -1021,6 +1086,59 @@
             if exc is not None:
                 raise exc
 
+    @unittest.skipIf(threading is None, "threading required")
+    def test_threadsafe_wait(self):
+        """Issue21291: Popen.wait() needs to be threadsafe for returncode."""
+        proc = subprocess.Popen([sys.executable, '-c',
+                                 'import time; time.sleep(12)'])
+        self.assertEqual(proc.returncode, None)
+        results = []
+
+        def kill_proc_timer_thread():
+            results.append(('thread-start-poll-result', proc.poll()))
+            # terminate it from the thread and wait for the result.
+            proc.kill()
+            proc.wait()
+            results.append(('thread-after-kill-and-wait', proc.returncode))
+            # this wait should be a no-op given the above.
+            proc.wait()
+            results.append(('thread-after-second-wait', proc.returncode))
+
+        # This is a timing sensitive test, the failure mode is
+        # triggered when both the main thread and this thread are in
+        # the wait() call at once.  The delay here is to allow the
+        # main thread to most likely be blocked in its wait() call.
+        t = threading.Timer(0.2, kill_proc_timer_thread)
+        t.start()
+
+        if mswindows:
+            expected_errorcode = 1
+        else:
+            # Should be -9 because of the proc.kill() from the thread.
+            expected_errorcode = -9
+
+        # Wait for the process to finish; the thread should kill it
+        # long before it finishes on its own.  Supplying a timeout
+        # triggers a different code path for better coverage.
+        proc.wait(timeout=20)
+        self.assertEqual(proc.returncode, expected_errorcode,
+                         msg="unexpected result in wait from main thread")
+
+        # This should be a no-op with no change in returncode.
+        proc.wait()
+        self.assertEqual(proc.returncode, expected_errorcode,
+                         msg="unexpected result in second main wait.")
+
+        t.join()
+        # Ensure that all of the thread results are as expected.
+        # When a race condition occurs in wait(), the returncode could
+        # be set by the wrong thread that doesn't actually have it
+        # leading to an incorrect value.
+        self.assertEqual([('thread-start-poll-result', None),
+                          ('thread-after-kill-and-wait', expected_errorcode),
+                          ('thread-after-second-wait', expected_errorcode)],
+                         results)
+
     def test_issue8780(self):
         # Ensure that stdout is inherited from the parent
         # if stdout=PIPE is not used
@@ -1114,47 +1232,6 @@
         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."""
-    old_limit = None
-
-    def __enter__(self):
-        """Try to save previous ulimit, then set it to (0, 0)."""
-        if resource is not None:
-            try:
-                self.old_limit = resource.getrlimit(resource.RLIMIT_CORE)
-                resource.setrlimit(resource.RLIMIT_CORE, (0, 0))
-            except (ValueError, resource.error):
-                pass
-
-        if sys.platform == 'darwin':
-            # Check if the 'Crash Reporter' on OSX was configured
-            # in 'Developer' mode and warn that it will get triggered
-            # when it is.
-            #
-            # This assumes that this context manager is used in tests
-            # that might trigger the next manager.
-            value = subprocess.Popen(['/usr/bin/defaults', 'read',
-                    'com.apple.CrashReporter', 'DialogType'],
-                    stdout=subprocess.PIPE).communicate()[0]
-            if value.strip() == b'developer':
-                print("this tests triggers the Crash Reporter, "
-                      "that is intentional", end='')
-                sys.stdout.flush()
-
-    def __exit__(self, *args):
-        """Return core file behavior to default."""
-        if self.old_limit is None:
-            return
-        if resource is not None:
-            try:
-                resource.setrlimit(resource.RLIMIT_CORE, self.old_limit)
-            except (ValueError, resource.error):
-                pass
-
-
 @unittest.skipIf(mswindows, "POSIX specific tests")
 class POSIXProcessTestCase(BaseTestCase):
 
@@ -1243,7 +1320,7 @@
 
     def test_run_abort(self):
         # returncode handles signal termination
-        with _SuppressCoreFiles():
+        with support.SuppressCrashReport():
             p = subprocess.Popen([sys.executable, "-c",
                                   'import os; os.abort()'])
             p.wait()
@@ -1266,7 +1343,7 @@
         try:
             p = subprocess.Popen([sys.executable, "-c", ""],
                                  preexec_fn=raise_it)
-        except RuntimeError as e:
+        except subprocess.SubprocessError as e:
             self.assertTrue(
                     subprocess._posixsubprocess,
                     "Expected a ValueError from the preexec_fn")
@@ -1306,9 +1383,10 @@
         """Issue16140: Don't double close pipes on preexec error."""
 
         def raise_it():
-            raise RuntimeError("force the _execute_child() errpipe_data path.")
+            raise subprocess.SubprocessError(
+                    "force the _execute_child() errpipe_data path.")
 
-        with self.assertRaises(RuntimeError):
+        with self.assertRaises(subprocess.SubprocessError):
             self._TestExecuteChildPopen(
                         self, [sys.executable, "-c", "pass"],
                         stdin=subprocess.PIPE, stdout=subprocess.PIPE,
@@ -1507,16 +1585,28 @@
         # Terminating a dead process
         self._kill_dead_process('terminate')
 
+    def _save_fds(self, save_fds):
+        fds = []
+        for fd in save_fds:
+            inheritable = os.get_inheritable(fd)
+            saved = os.dup(fd)
+            fds.append((fd, saved, inheritable))
+        return fds
+
+    def _restore_fds(self, fds):
+        for fd, saved, inheritable in fds:
+            os.dup2(saved, fd, inheritable=inheritable)
+            os.close(saved)
+
     def check_close_std_fds(self, fds):
         # Issue #9905: test that subprocess pipes still work properly with
         # some standard fds closed
         stdin = 0
-        newfds = []
-        for a in fds:
-            b = os.dup(a)
-            newfds.append(b)
-            if a == 0:
-                stdin = b
+        saved_fds = self._save_fds(fds)
+        for fd, saved, inheritable in saved_fds:
+            if fd == 0:
+                stdin = saved
+                break
         try:
             for fd in fds:
                 os.close(fd)
@@ -1531,10 +1621,7 @@
             err = support.strip_python_stderr(err)
             self.assertEqual((out, err), (b'apple', b'orange'))
         finally:
-            for b, a in zip(newfds, fds):
-                os.dup2(b, a)
-            for b in newfds:
-                os.close(b)
+            self._restore_fds(saved_fds)
 
     def test_close_fd_0(self):
         self.check_close_std_fds([0])
@@ -1595,7 +1682,7 @@
             os.lseek(temp_fds[1], 0, 0)
 
             # move the standard file descriptors out of the way
-            saved_fds = [os.dup(fd) for fd in range(3)]
+            saved_fds = self._save_fds(range(3))
             try:
                 # duplicate the file objects over the standard fd's
                 for fd, temp_fd in enumerate(temp_fds):
@@ -1611,10 +1698,7 @@
                     stderr=temp_fds[0])
                 p.wait()
             finally:
-                # restore the original fd's underneath sys.stdin, etc.
-                for std, saved in enumerate(saved_fds):
-                    os.dup2(saved, std)
-                    os.close(saved)
+                self._restore_fds(saved_fds)
 
             for fd in temp_fds:
                 os.lseek(fd, 0, 0)
@@ -1638,7 +1722,7 @@
                 os.unlink(fname)
 
             # save a copy of the standard file descriptors
-            saved_fds = [os.dup(fd) for fd in range(3)]
+            saved_fds = self._save_fds(range(3))
             try:
                 # duplicate the temp files over the standard fd's 0, 1, 2
                 for fd, temp_fd in enumerate(temp_fds):
@@ -1664,9 +1748,7 @@
                 out = os.read(stdout_no, 1024)
                 err = support.strip_python_stderr(os.read(stderr_no, 1024))
             finally:
-                for std, saved in enumerate(saved_fds):
-                    os.dup2(saved, std)
-                    os.close(saved)
+                self._restore_fds(saved_fds)
 
             self.assertEqual(out, b"got STDIN")
             self.assertEqual(err, b"err")
@@ -1698,40 +1780,47 @@
             # Pure Python implementations keeps the message
             self.assertIsNone(subprocess._posixsubprocess)
             self.assertEqual(str(err), "surrogate:\uDCff")
-        except RuntimeError as err:
+        except subprocess.SubprocessError as err:
             # _posixsubprocess uses a default message
             self.assertIsNotNone(subprocess._posixsubprocess)
             self.assertEqual(str(err), "Exception occurred in preexec_fn.")
         else:
-            self.fail("Expected ValueError or RuntimeError")
+            self.fail("Expected ValueError or subprocess.SubprocessError")
 
     def test_undecodable_env(self):
         for key, value in (('test', 'abc\uDCFF'), ('test\uDCFF', '42')):
+            encoded_value = value.encode("ascii", "surrogateescape")
+
             # test str with surrogates
             script = "import os; print(ascii(os.getenv(%s)))" % repr(key)
             env = os.environ.copy()
             env[key] = value
-            # Use C locale to get ascii for the locale encoding to force
+            # Use C locale to get ASCII for the locale encoding to force
             # surrogate-escaping of \xFF in the child process; otherwise it can
             # be decoded as-is if the default locale is latin-1.
             env['LC_ALL'] = 'C'
+            if sys.platform.startswith("aix"):
+                # On AIX, the C locale uses the Latin1 encoding
+                decoded_value = encoded_value.decode("latin1", "surrogateescape")
+            else:
+                # On other UNIXes, the C locale uses the ASCII encoding
+                decoded_value = value
             stdout = subprocess.check_output(
                 [sys.executable, "-c", script],
                 env=env)
             stdout = stdout.rstrip(b'\n\r')
-            self.assertEqual(stdout.decode('ascii'), ascii(value))
+            self.assertEqual(stdout.decode('ascii'), ascii(decoded_value))
 
             # test bytes
             key = key.encode("ascii", "surrogateescape")
-            value = value.encode("ascii", "surrogateescape")
             script = "import os; print(ascii(os.getenvb(%s)))" % repr(key)
             env = os.environ.copy()
-            env[key] = value
+            env[key] = encoded_value
             stdout = subprocess.check_output(
                 [sys.executable, "-c", script],
                 env=env)
             stdout = stdout.rstrip(b'\n\r')
-            self.assertEqual(stdout.decode('ascii'), ascii(value))
+            self.assertEqual(stdout.decode('ascii'), ascii(encoded_value))
 
     def test_bytes_program(self):
         abs_program = os.fsencode(sys.executable)
@@ -1837,6 +1926,9 @@
             self.addCleanup(os.close, fd)
             open_fds.add(fd)
 
+        for fd in open_fds:
+            os.set_inheritable(fd, True)
+
         p = subprocess.Popen([sys.executable, fd_status],
                              stdout=subprocess.PIPE, close_fds=False)
         output, ignored = p.communicate()
@@ -1867,6 +1959,86 @@
                          "Some fds not in pass_fds were left open")
         self.assertIn(1, remaining_fds, "Subprocess failed")
 
+
+    @unittest.skipIf(sys.platform.startswith("freebsd") and
+                     os.stat("/dev").st_dev == os.stat("/dev/fd").st_dev,
+                     "Requires fdescfs mounted on /dev/fd on FreeBSD.")
+    def test_close_fds_when_max_fd_is_lowered(self):
+        """Confirm that issue21618 is fixed (may fail under valgrind)."""
+        fd_status = support.findfile("fd_status.py", subdir="subprocessdata")
+
+        # This launches the meat of the test in a child process to
+        # avoid messing with the larger unittest processes maximum
+        # number of file descriptors.
+        #  This process launches:
+        #  +--> Process that lowers its RLIMIT_NOFILE aftr setting up
+        #    a bunch of high open fds above the new lower rlimit.
+        #    Those are reported via stdout before launching a new
+        #    process with close_fds=False to run the actual test:
+        #    +--> The TEST: This one launches a fd_status.py
+        #      subprocess with close_fds=True so we can find out if
+        #      any of the fds above the lowered rlimit are still open.
+        p = subprocess.Popen([sys.executable, '-c', textwrap.dedent(
+        '''
+        import os, resource, subprocess, sys, textwrap
+        open_fds = set()
+        # Add a bunch more fds to pass down.
+        for _ in range(40):
+            fd = os.open("/dev/null", os.O_RDONLY)
+            open_fds.add(fd)
+
+        # Leave a two pairs of low ones available for use by the
+        # internal child error pipe and the stdout pipe.
+        # We also leave 10 more open as some Python buildbots run into
+        # "too many open files" errors during the test if we do not.
+        for fd in sorted(open_fds)[:14]:
+            os.close(fd)
+            open_fds.remove(fd)
+
+        for fd in open_fds:
+            #self.addCleanup(os.close, fd)
+            os.set_inheritable(fd, True)
+
+        max_fd_open = max(open_fds)
+
+        # Communicate the open_fds to the parent unittest.TestCase process.
+        print(','.join(map(str, sorted(open_fds))))
+        sys.stdout.flush()
+
+        rlim_cur, rlim_max = resource.getrlimit(resource.RLIMIT_NOFILE)
+        try:
+            # 29 is lower than the highest fds we are leaving open.
+            resource.setrlimit(resource.RLIMIT_NOFILE, (29, rlim_max))
+            # Launch a new Python interpreter with our low fd rlim_cur that
+            # inherits open fds above that limit.  It then uses subprocess
+            # with close_fds=True to get a report of open fds in the child.
+            # An explicit list of fds to check is passed to fd_status.py as
+            # letting fd_status rely on its default logic would miss the
+            # fds above rlim_cur as it normally only checks up to that limit.
+            subprocess.Popen(
+                [sys.executable, '-c',
+                 textwrap.dedent("""
+                     import subprocess, sys
+                     subprocess.Popen([sys.executable, %r] +
+                                      [str(x) for x in range({max_fd})],
+                                      close_fds=True).wait()
+                     """.format(max_fd=max_fd_open+1))],
+                close_fds=False).wait()
+        finally:
+            resource.setrlimit(resource.RLIMIT_NOFILE, (rlim_cur, rlim_max))
+        ''' % fd_status)], stdout=subprocess.PIPE)
+
+        output, unused_stderr = p.communicate()
+        output_lines = output.splitlines()
+        self.assertEqual(len(output_lines), 2,
+                         msg="expected exactly two lines of output:\n%r" % output)
+        opened_fds = set(map(int, output_lines[0].strip().split(b',')))
+        remaining_fds = set(map(int, output_lines[1].strip().split(b',')))
+
+        self.assertFalse(remaining_fds & opened_fds,
+                         msg="Some fds were left open.")
+
+
     # Mac OS X Tiger (10.4) has a kernel bug: sometimes, the file
     # descriptor of a pipe closed in the parent process is valid in the
     # child process according to fstat(), but the mode of the file
@@ -1881,6 +2053,8 @@
             fds = os.pipe()
             self.addCleanup(os.close, fds[0])
             self.addCleanup(os.close, fds[1])
+            os.set_inheritable(fds[0], True)
+            os.set_inheritable(fds[1], True)
             open_fds.update(fds)
 
         for fd in open_fds:
@@ -1903,6 +2077,32 @@
                         close_fds=False, pass_fds=(fd, )))
             self.assertIn('overriding close_fds', str(context.warning))
 
+    def test_pass_fds_inheritable(self):
+        script = support.findfile("fd_status.py", subdir="subprocessdata")
+
+        inheritable, non_inheritable = os.pipe()
+        self.addCleanup(os.close, inheritable)
+        self.addCleanup(os.close, non_inheritable)
+        os.set_inheritable(inheritable, True)
+        os.set_inheritable(non_inheritable, False)
+        pass_fds = (inheritable, non_inheritable)
+        args = [sys.executable, script]
+        args += list(map(str, pass_fds))
+
+        p = subprocess.Popen(args,
+                             stdout=subprocess.PIPE, close_fds=True,
+                             pass_fds=pass_fds)
+        output, ignored = p.communicate()
+        fds = set(map(int, output.split(b',')))
+
+        # the inheritable file descriptor must be inherited, so its inheritable
+        # flag must be set in the child process after fork() and before exec()
+        self.assertEqual(fds, set(pass_fds), "output=%a" % output)
+
+        # inheritable flag must not be changed in the parent process
+        self.assertEqual(os.get_inheritable(inheritable), True)
+        self.assertEqual(os.get_inheritable(non_inheritable), False)
+
     def test_stdout_stdin_are_single_inout_fd(self):
         with io.open(os.devnull, "r+") as inout:
             p = subprocess.Popen([sys.executable, "-c", "import sys; sys.exit(0)"],
@@ -1990,7 +2190,7 @@
         # let some time for the process to exit, and create a new Popen: this
         # should trigger the wait() of p
         time.sleep(0.2)
-        with self.assertRaises(EnvironmentError) as c:
+        with self.assertRaises(OSError) as c:
             with subprocess.Popen(['nonexisting_i_hope'],
                                   stdout=subprocess.PIPE,
                                   stderr=subprocess.PIPE) as proc:
@@ -2016,6 +2216,39 @@
 
         self.assertNotIn(fd, remaining_fds)
 
+    @support.cpython_only
+    def test_fork_exec(self):
+        # Issue #22290: fork_exec() must not crash on memory allocation failure
+        # or other errors
+        import _posixsubprocess
+        gc_enabled = gc.isenabled()
+        try:
+            # Use a preexec function and enable the garbage collector
+            # to force fork_exec() to re-enable the garbage collector
+            # on error.
+            func = lambda: None
+            gc.enable()
+
+            executable_list = "exec"   # error: must be a sequence
+
+            for args, exe_list, cwd, env_list in (
+                (123,      [b"exe"], None, [b"env"]),
+                ([b"arg"], 123,      None, [b"env"]),
+                ([b"arg"], [b"exe"], 123,  [b"env"]),
+                ([b"arg"], [b"exe"], None, 123),
+            ):
+                with self.assertRaises(TypeError):
+                    _posixsubprocess.fork_exec(
+                        args, exe_list,
+                        True, [], cwd, env_list,
+                        -1, -1, -1, -1,
+                        1, 2, 3, 4,
+                        True, True, func)
+        finally:
+            if not gc_enabled:
+                gc.disable()
+
+
 
 @unittest.skipUnless(mswindows, "Windows specific tests")
 class Win32ProcessTestCase(BaseTestCase):
@@ -2175,15 +2408,16 @@
                 os.rmdir(dir)
 
 
-@unittest.skipUnless(getattr(subprocess, '_has_poll', False),
-                     "poll system call not supported")
+@unittest.skipUnless(hasattr(selectors, 'PollSelector'),
+                     "Test needs selectors.PollSelector")
 class ProcessTestCaseNoPoll(ProcessTestCase):
     def setUp(self):
-        subprocess._has_poll = False
+        self.orig_selector = subprocess._PopenSelector
+        subprocess._PopenSelector = selectors.SelectSelector
         ProcessTestCase.setUp(self)
 
     def tearDown(self):
-        subprocess._has_poll = True
+        subprocess._PopenSelector = self.orig_selector
         ProcessTestCase.tearDown(self)
 
 
diff --git a/Lib/test/test_sunau.py b/Lib/test/test_sunau.py
index 1655317..0f4134e 100644
--- a/Lib/test/test_sunau.py
+++ b/Lib/test/test_sunau.py
@@ -1,6 +1,7 @@
 from test.support import TESTFN
 import unittest
 from test import audiotests
+from audioop import byteswap
 import sys
 import sunau
 
@@ -46,6 +47,31 @@
       """)
 
 
+class SunauPCM24Test(SunauTest, unittest.TestCase):
+    sndfilename = 'pluck-pcm24.au'
+    sndfilenframes = 3307
+    nchannels = 2
+    sampwidth = 3
+    framerate = 11025
+    nframes = 48
+    comptype = 'NONE'
+    compname = 'not compressed'
+    frames = bytes.fromhex("""\
+      022D65FFEB9D 4B5A0F00FA54 3113C304EE2B 80DCD6084303 \
+      CBDEC006B261 48A99803F2F8 BFE82401B07D 036BFBFE7B5D \
+      B85756FA3EC9 B4B055F3502B 299830EBCB62 1A5CA7E6D99A \
+      EDFA3EE491BD C625EBE27884 0E05A9E0B6CF EF2929E02922 \
+      5758D8E27067 FB3557E83E16 1377BFEF8402 D82C5BF7272A \
+      978F16FB7745 F5F865FC1013 086635FB9C4E DF30FCFB40EE \
+      117FE0FA3438 3EE6B8FB5AC3 BC77A3FCB2F4 66D6DAFF5F32 \
+      CF13B9041275 431D69097A8C C1BB600EC74E 5120B912A2BA \
+      EEDF641754C0 8207001664B7 7FFFFF14453F 8000001294E6 \
+      499C1B0EB3B2 52B73E0DBCA0 EFB2B20F5FD8 CE3CDB0FBE12 \
+      E4B49C0CEA2D 6344A80A5A7C 08C8FE0A1FFE 2BB9860B0A0E \
+      51486F0E44E1 8BCC64113B05 B6F4EC0EEB36 4413170A5B48 \
+      """)
+
+
 class SunauPCM32Test(SunauTest, unittest.TestCase):
     sndfilename = 'pluck-pcm32.au'
     sndfilenframes = 3307
@@ -89,7 +115,7 @@
       E5040CBC 617C0A3C 08BC0A3C 2C7C0B3C 517C0E3C 8A8410FC B6840EBC 457C0A3C \
       """)
     if sys.byteorder != 'big':
-        frames = audiotests.byteswap2(frames)
+        frames = byteswap(frames, 2)
 
 
 if __name__ == "__main__":
diff --git a/Lib/test/test_sundry.py b/Lib/test/test_sundry.py
index 8808c47..e99ca9e 100644
--- a/Lib/test/test_sundry.py
+++ b/Lib/test/test_sundry.py
@@ -1,19 +1,26 @@
 """Do a minimal test of all the modules that aren't otherwise tested."""
-
-from test import support
+import importlib
 import sys
+from test import support
 import unittest
 
 class TestUntestedModules(unittest.TestCase):
-    def test_at_least_import_untested_modules(self):
+    def test_untested_modules_can_be_imported(self):
+        untested = ('bdb', 'encodings', 'formatter',
+                    'nturl2path', 'tabnanny')
         with support.check_warnings(quiet=True):
-            import bdb
-            import cgitb
+            for name in untested:
+                try:
+                    support.import_module('test.test_{}'.format(name))
+                except unittest.SkipTest:
+                    importlib.import_module(name)
+                else:
+                    self.fail('{} has tests even though test_sundry claims '
+                              'otherwise'.format(name))
 
             import distutils.bcppcompiler
             import distutils.ccompiler
             import distutils.cygwinccompiler
-            import distutils.emxccompiler
             import distutils.filelist
             if sys.platform.startswith('win'):
                 import distutils.msvccompiler
@@ -39,26 +46,14 @@
             import distutils.command.sdist
             import distutils.command.upload
 
-            import encodings
-            import formatter
             import html.entities
-            import keyword
-            import mailcap
-            import nturl2path
-            import os2emxpath
-            import pstats
-            import py_compile
-            import sndhdr
-            import tabnanny
+
             try:
-                import tty     # not available on Windows
+                import tty  # Not available on Windows
             except ImportError:
                 if support.verbose:
                     print("skipping tty")
 
 
-def test_main():
-    support.run_unittest(TestUntestedModules)
-
 if __name__ == "__main__":
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_super.py b/Lib/test/test_super.py
index 1e272ee..37fc2d9 100644
--- a/Lib/test/test_super.py
+++ b/Lib/test/test_super.py
@@ -44,6 +44,11 @@
 
 class TestSuper(unittest.TestCase):
 
+    def tearDown(self):
+        # This fixes the damage that test_various___class___pathologies does.
+        nonlocal __class__
+        __class__ = TestSuper
+
     def test_basics_working(self):
         self.assertEqual(D().f(), 'ABCD')
 
@@ -81,8 +86,7 @@
 
         self.assertEqual(E().f(), 'AE')
 
-    @unittest.expectedFailure
-    def test___class___set(self):
+    def test_various___class___pathologies(self):
         # See issue #12370
         class X(A):
             def f(self):
@@ -91,6 +95,31 @@
         x = X()
         self.assertEqual(x.f(), 'A')
         self.assertEqual(x.__class__, 413)
+        class X:
+            x = __class__
+            def f():
+                __class__
+        self.assertIs(X.x, type(self))
+        with self.assertRaises(NameError) as e:
+            exec("""class X:
+                __class__
+                def f():
+                    __class__""", globals(), {})
+        self.assertIs(type(e.exception), NameError) # Not UnboundLocalError
+        class X:
+            global __class__
+            __class__ = 42
+            def f():
+                __class__
+        self.assertEqual(globals()["__class__"], 42)
+        del globals()["__class__"]
+        self.assertNotIn("__class__", X.__dict__)
+        class X:
+            nonlocal __class__
+            __class__ = 42
+            def f():
+                __class__
+        self.assertEqual(__class__, 42)
 
     def test___class___instancemethod(self):
         # See issue #14857
diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py
index cb6f84e..03ce9d1 100644
--- a/Lib/test/test_support.py
+++ b/Lib/test/test_support.py
@@ -69,6 +69,7 @@
         finally:
             del sys.path[0]
             support.unlink(mod_filename)
+            support.rmtree('__pycache__')
 
     def test_HOST(self):
         s = socket.socket()
@@ -304,6 +305,7 @@
     # args_from_interpreter_flags
     # can_symlink
     # skip_unless_symlink
+    # SuppressCrashReport
 
 
 def test_main():
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py
index 5926b69..a9d3628 100644
--- a/Lib/test/test_syntax.py
+++ b/Lib/test/test_syntax.py
@@ -33,7 +33,7 @@
 
 >>> None = 1
 Traceback (most recent call last):
-SyntaxError: assignment to keyword
+SyntaxError: can't assign to keyword
 
 It's a syntax error to assign to the empty tuple.  Why isn't it an
 error to assign to the empty list?  It will always raise some error at
@@ -233,7 +233,7 @@
 SyntaxError: can't assign to generator expression
 >>> None += 1
 Traceback (most recent call last):
-SyntaxError: assignment to keyword
+SyntaxError: can't assign to keyword
 >>> f() += 1
 Traceback (most recent call last):
 SyntaxError: can't assign to function call
diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py
index f768e9b..2f66eb7 100644
--- a/Lib/test/test_sys.py
+++ b/Lib/test/test_sys.py
@@ -7,6 +7,9 @@
 import warnings
 import operator
 import codecs
+import gc
+import sysconfig
+import platform
 
 # count the number of test runs, used to create unique
 # strings to intern in test_intern()
@@ -227,7 +230,7 @@
 
             sys.setrecursionlimit(%d)
             f()""")
-        with test.support.suppress_crash_popup():
+        with test.support.SuppressCrashReport():
             for i in (50, 1000):
                 sub = subprocess.Popen([sys.executable, '-c', code % i],
                     stderr=subprocess.PIPE)
@@ -408,7 +411,7 @@
         self.assertEqual(type(sys.int_info.sizeof_digit), int)
         self.assertIsInstance(sys.hexversion, int)
 
-        self.assertEqual(len(sys.hash_info), 5)
+        self.assertEqual(len(sys.hash_info), 9)
         self.assertLess(sys.hash_info.modulus, 2**sys.hash_info.width)
         # sys.hash_info.modulus should be a prime; we do a quick
         # probable primality test (doesn't exclude the possibility of
@@ -423,6 +426,22 @@
         self.assertIsInstance(sys.hash_info.inf, int)
         self.assertIsInstance(sys.hash_info.nan, int)
         self.assertIsInstance(sys.hash_info.imag, int)
+        algo = sysconfig.get_config_var("Py_HASH_ALGORITHM")
+        if sys.hash_info.algorithm in {"fnv", "siphash24"}:
+            self.assertIn(sys.hash_info.hash_bits, {32, 64})
+            self.assertIn(sys.hash_info.seed_bits, {32, 64, 128})
+
+            if algo == 1:
+                self.assertEqual(sys.hash_info.algorithm, "siphash24")
+            elif algo == 2:
+                self.assertEqual(sys.hash_info.algorithm, "fnv")
+            else:
+                self.assertIn(sys.hash_info.algorithm, {"fnv", "siphash24"})
+        else:
+            # PY_HASH_EXTERNAL
+            self.assertEqual(algo, 0)
+        self.assertGreaterEqual(sys.hash_info.cutoff, 0)
+        self.assertLess(sys.hash_info.cutoff, 8)
 
         self.assertIsInstance(sys.maxsize, int)
         self.assertIsInstance(sys.maxunicode, int)
@@ -460,7 +479,7 @@
     def test_thread_info(self):
         info = sys.thread_info
         self.assertEqual(len(info), 3)
-        self.assertIn(info.name, ('nt', 'os2', 'pthread', 'solaris', None))
+        self.assertIn(info.name, ('nt', 'pthread', 'solaris', None))
         self.assertIn(info.lock, ('semaphore', 'mutex+cond', None))
 
     def test_43581(self):
@@ -493,13 +512,34 @@
         attrs = ("debug",
                  "inspect", "interactive", "optimize", "dont_write_bytecode",
                  "no_user_site", "no_site", "ignore_environment", "verbose",
-                 "bytes_warning", "quiet", "hash_randomization")
+                 "bytes_warning", "quiet", "hash_randomization", "isolated")
         for attr in attrs:
             self.assertTrue(hasattr(sys.flags, attr), attr)
             self.assertEqual(type(getattr(sys.flags, attr)), int, attr)
         self.assertTrue(repr(sys.flags))
         self.assertEqual(len(sys.flags), len(attrs))
 
+    def assert_raise_on_new_sys_type(self, sys_attr):
+        # Users are intentionally prevented from creating new instances of
+        # sys.flags, sys.version_info, and sys.getwindowsversion.
+        attr_type = type(sys_attr)
+        with self.assertRaises(TypeError):
+            attr_type()
+        with self.assertRaises(TypeError):
+            attr_type.__new__(attr_type)
+
+    def test_sys_flags_no_instantiation(self):
+        self.assert_raise_on_new_sys_type(sys.flags)
+
+    def test_sys_version_info_no_instantiation(self):
+        self.assert_raise_on_new_sys_type(sys.version_info)
+
+    def test_sys_getwindowsversion_no_instantiation(self):
+        # Skip if not being run on Windows.
+        test.support.get_attribute(sys, "getwindowsversion")
+        self.assert_raise_on_new_sys_type(sys.getwindowsversion())
+
+    @test.support.cpython_only
     def test_clear_type_cache(self):
         sys._clear_type_cache()
 
@@ -522,6 +562,42 @@
         out = p.communicate()[0].strip()
         self.assertEqual(out, b'?')
 
+        env["PYTHONIOENCODING"] = "ascii"
+        p = subprocess.Popen([sys.executable, "-c", 'print(chr(0xa2))'],
+                             stdout=subprocess.PIPE, stderr=subprocess.PIPE,
+                             env=env)
+        out, err = p.communicate()
+        self.assertEqual(out, b'')
+        self.assertIn(b'UnicodeEncodeError:', err)
+        self.assertIn(rb"'\xa2'", err)
+
+        env["PYTHONIOENCODING"] = "ascii:"
+        p = subprocess.Popen([sys.executable, "-c", 'print(chr(0xa2))'],
+                             stdout=subprocess.PIPE, stderr=subprocess.PIPE,
+                             env=env)
+        out, err = p.communicate()
+        self.assertEqual(out, b'')
+        self.assertIn(b'UnicodeEncodeError:', err)
+        self.assertIn(rb"'\xa2'", err)
+
+        env["PYTHONIOENCODING"] = ":surrogateescape"
+        p = subprocess.Popen([sys.executable, "-c", 'print(chr(0xdcbd))'],
+                             stdout=subprocess.PIPE, env=env)
+        out = p.communicate()[0].strip()
+        self.assertEqual(out, b'\xbd')
+
+    @unittest.skipUnless(test.support.FS_NONASCII,
+                         'requires OS support of non-ASCII encodings')
+    def test_ioencoding_nonascii(self):
+        env = dict(os.environ)
+
+        env["PYTHONIOENCODING"] = ""
+        p = subprocess.Popen([sys.executable, "-c",
+                                'print(%a)' % test.support.FS_NONASCII],
+                                stdout=subprocess.PIPE, env=env)
+        out = p.communicate()[0].strip()
+        self.assertEqual(out, os.fsencode(test.support.FS_NONASCII))
+
     @unittest.skipIf(sys.base_prefix != sys.prefix,
                      'Test is not venv-compatible')
     def test_executable(self):
@@ -582,6 +658,7 @@
         self.assertEqual(sys.implementation.name,
                          sys.implementation.name.lower())
 
+    @test.support.cpython_only
     def test_debugmallocstats(self):
         # Test sys._debugmallocstats()
         from test.script_helper import assert_python_ok
@@ -589,6 +666,39 @@
         ret, out, err = assert_python_ok(*args)
         self.assertIn(b"free PyDictObjects", err)
 
+        # The function has no parameter
+        self.assertRaises(TypeError, sys._debugmallocstats, True)
+
+    @unittest.skipUnless(hasattr(sys, "getallocatedblocks"),
+                         "sys.getallocatedblocks unavailable on this build")
+    def test_getallocatedblocks(self):
+        # Some sanity checks
+        with_pymalloc = sysconfig.get_config_var('WITH_PYMALLOC')
+        a = sys.getallocatedblocks()
+        self.assertIs(type(a), int)
+        if with_pymalloc:
+            self.assertGreater(a, 0)
+        else:
+            # When WITH_PYMALLOC isn't available, we don't know anything
+            # about the underlying implementation: the function might
+            # return 0 or something greater.
+            self.assertGreaterEqual(a, 0)
+        try:
+            # While we could imagine a Python session where the number of
+            # multiple buffer objects would exceed the sharing of references,
+            # it is unlikely to happen in a normal test run.
+            self.assertLess(a, sys.gettotalrefcount())
+        except AttributeError:
+            # gettotalrefcount() not available
+            pass
+        gc.collect()
+        b = sys.getallocatedblocks()
+        self.assertLessEqual(b, a)
+        gc.collect()
+        c = sys.getallocatedblocks()
+        self.assertIn(c, range(b - 50, b + 50))
+
+
 @test.support.cpython_only
 class SizeofTest(unittest.TestCase):
 
@@ -614,6 +724,37 @@
         # but lists are
         self.assertEqual(sys.getsizeof([]), vsize('Pn') + gc_header_size)
 
+    def test_errors(self):
+        class BadSizeof:
+            def __sizeof__(self):
+                raise ValueError
+        self.assertRaises(ValueError, sys.getsizeof, BadSizeof())
+
+        class InvalidSizeof:
+            def __sizeof__(self):
+                return None
+        self.assertRaises(TypeError, sys.getsizeof, InvalidSizeof())
+        sentinel = ["sentinel"]
+        self.assertIs(sys.getsizeof(InvalidSizeof(), sentinel), sentinel)
+
+        class FloatSizeof:
+            def __sizeof__(self):
+                return 4.5
+        self.assertRaises(TypeError, sys.getsizeof, FloatSizeof())
+        self.assertIs(sys.getsizeof(FloatSizeof(), sentinel), sentinel)
+
+        class OverflowSizeof(int):
+            def __sizeof__(self):
+                return int(self)
+        self.assertEqual(sys.getsizeof(OverflowSizeof(sys.maxsize)),
+                         sys.maxsize + self.gc_headsize)
+        with self.assertRaises(OverflowError):
+            sys.getsizeof(OverflowSizeof(sys.maxsize + 1))
+        with self.assertRaises(ValueError):
+            sys.getsizeof(OverflowSizeof(-1))
+        with self.assertRaises((ValueError, OverflowError)):
+            sys.getsizeof(OverflowSizeof(-sys.maxsize - 1))
+
     def test_default(self):
         size = test.support.calcvobjsize
         self.assertEqual(sys.getsizeof(True), size('') + self.longdigit)
@@ -634,7 +775,7 @@
         samples = [b'', b'u'*100000]
         for sample in samples:
             x = bytearray(sample)
-            check(x, vsize('inP') + x.__alloc__())
+            check(x, vsize('n2Pi') + x.__alloc__())
         # bytearray_iterator
         check(iter(bytearray()), size('nP'))
         # cell
@@ -713,7 +854,7 @@
         nfrees = len(x.f_code.co_freevars)
         extras = x.f_code.co_stacksize + x.f_code.co_nlocals +\
                   ncells + nfrees - 1
-        check(x, vsize('12P3i' + CO_MAXBLOCKS*'3i' + 'P' + extras*'P'))
+        check(x, vsize('12P3ic' + CO_MAXBLOCKS*'3i' + 'P' + extras*'P'))
         # function
         def func(): pass
         check(func, size('12P'))
@@ -759,7 +900,7 @@
         # memoryview
         check(memoryview(b''), size('Pnin 2P2n2i5P 3cPn'))
         # module
-        check(unittest, size('PnP'))
+        check(unittest, size('PnPPP'))
         # None
         check(None, size(''))
         # NotImplementedType
@@ -813,11 +954,11 @@
         check((1,2,3), vsize('') + 3*self.P)
         # type
         # static type: PyTypeObject
-        s = vsize('P2n15Pl4Pn9Pn11PI')
+        s = vsize('P2n15Pl4Pn9Pn11PIP')
         check(int, s)
         # (PyTypeObject + PyNumberMethods + PyMappingMethods +
         #  PySequenceMethods + PyBufferProcs + 4P)
-        s = vsize('P2n15Pl4Pn9Pn11PI') + struct.calcsize('34P 3P 10P 2P 4P')
+        s = vsize('P2n15Pl4Pn9Pn11PIP') + struct.calcsize('34P 3P 10P 2P 4P')
         # Separate block for PyDictKeysObject with 4 entries
         s += struct.calcsize("2nPn") + 4*struct.calcsize("n2P")
         # class
diff --git a/Lib/test/test_sys_settrace.py b/Lib/test/test_sys_settrace.py
index f0b0b82..ae8f845 100644
--- a/Lib/test/test_sys_settrace.py
+++ b/Lib/test/test_sys_settrace.py
@@ -579,6 +579,15 @@
 jump_in_nested_finally.jump = (4, 9)
 jump_in_nested_finally.output = [2, 9]
 
+def jump_infinite_while_loop(output):
+    output.append(1)
+    while 1:
+        output.append(2)
+    output.append(3)
+
+jump_infinite_while_loop.jump = (3, 4)
+jump_infinite_while_loop.output = [1, 3]
+
 # The second set of 'jump' tests are for things that are not allowed:
 
 def no_jump_too_far_forwards(output):
@@ -755,6 +764,8 @@
         self.run_test(jump_to_same_line)
     def test_07_jump_in_nested_finally(self):
         self.run_test(jump_in_nested_finally)
+    def test_jump_infinite_while_loop(self):
+        self.run_test(jump_infinite_while_loop)
     def test_08_no_jump_too_far_forwards(self):
         self.run_test(no_jump_too_far_forwards)
     def test_09_no_jump_too_far_backwards(self):
diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py
index 03f67fd..804c446 100644
--- a/Lib/test/test_sysconfig.py
+++ b/Lib/test/test_sysconfig.py
@@ -5,7 +5,7 @@
 import shutil
 from copy import copy
 
-from test.support import (run_unittest, TESTFN, unlink,
+from test.support import (run_unittest, TESTFN, unlink, check_warnings,
                           captured_stdout, skip_unless_symlink)
 
 import sysconfig
@@ -234,7 +234,7 @@
         self.assertTrue(os.path.isfile(config_h), config_h)
 
     def test_get_scheme_names(self):
-        wanted = ('nt', 'nt_user', 'os2', 'os2_home', 'osx_framework_user',
+        wanted = ('nt', 'nt_user', 'osx_framework_user',
                   'posix_home', 'posix_prefix', 'posix_user')
         self.assertEqual(get_scheme_names(), wanted)
 
@@ -305,14 +305,13 @@
         if 'MACOSX_DEPLOYMENT_TARGET' in env:
             del env['MACOSX_DEPLOYMENT_TARGET']
 
-        with open('/dev/null', 'w') as devnull_fp:
-            p = subprocess.Popen([
-                    sys.executable, '-c',
-                    'import sysconfig; print(sysconfig.get_platform())',
-                ],
-                stdout=subprocess.PIPE,
-                stderr=devnull_fp,
-                env=env)
+        p = subprocess.Popen([
+                sys.executable, '-c',
+                'import sysconfig; print(sysconfig.get_platform())',
+            ],
+            stdout=subprocess.PIPE,
+            stderr=subprocess.DEVNULL,
+            env=env)
         test_platform = p.communicate()[0].strip()
         test_platform = test_platform.decode('utf-8')
         status = p.wait()
@@ -325,20 +324,19 @@
         env = os.environ.copy()
         env['MACOSX_DEPLOYMENT_TARGET'] = '10.1'
 
-        with open('/dev/null') as dev_null:
-            p = subprocess.Popen([
-                    sys.executable, '-c',
-                    'import sysconfig; print(sysconfig.get_platform())',
-                ],
-                stdout=subprocess.PIPE,
-                stderr=dev_null,
-                env=env)
-            test_platform = p.communicate()[0].strip()
-            test_platform = test_platform.decode('utf-8')
-            status = p.wait()
+        p = subprocess.Popen([
+                sys.executable, '-c',
+                'import sysconfig; print(sysconfig.get_platform())',
+            ],
+            stdout=subprocess.PIPE,
+            stderr=subprocess.DEVNULL,
+            env=env)
+        test_platform = p.communicate()[0].strip()
+        test_platform = test_platform.decode('utf-8')
+        status = p.wait()
 
-            self.assertEqual(status, 0)
-            self.assertEqual(my_platform, test_platform)
+        self.assertEqual(status, 0)
+        self.assertEqual(my_platform, test_platform)
 
     def test_srcdir(self):
         # See Issues #15322, #15364.
@@ -371,6 +369,26 @@
             os.chdir(cwd)
         self.assertEqual(srcdir, srcdir2)
 
+    @unittest.skipIf(sysconfig.get_config_var('EXT_SUFFIX') is None,
+                     'EXT_SUFFIX required for this test')
+    def test_SO_deprecation(self):
+        self.assertWarns(DeprecationWarning,
+                         sysconfig.get_config_var, 'SO')
+
+    @unittest.skipIf(sysconfig.get_config_var('EXT_SUFFIX') is None,
+                     'EXT_SUFFIX required for this test')
+    def test_SO_value(self):
+        with check_warnings(('', DeprecationWarning)):
+            self.assertEqual(sysconfig.get_config_var('SO'),
+                             sysconfig.get_config_var('EXT_SUFFIX'))
+
+    @unittest.skipIf(sysconfig.get_config_var('EXT_SUFFIX') is None,
+                     'EXT_SUFFIX required for this test')
+    def test_SO_in_vars(self):
+        vars = sysconfig.get_config_vars()
+        self.assertIsNotNone(vars['SO'])
+        self.assertEqual(vars['SO'], vars['EXT_SUFFIX'])
+
 
 class MakefileTests(unittest.TestCase):
 
diff --git a/Lib/test/test_syslog.py b/Lib/test/test_syslog.py
index 4e7621e5..b7fd2bd 100644
--- a/Lib/test/test_syslog.py
+++ b/Lib/test/test_syslog.py
@@ -32,6 +32,10 @@
     def test_log_upto(self):
         syslog.LOG_UPTO(syslog.LOG_INFO)
 
+    def test_openlog_noargs(self):
+        syslog.openlog()
+        syslog.syslog('test message from python test_syslog')
+
 def test_main():
     support.run_unittest(__name__)
 
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
index 68fe608..e527e40 100644
--- a/Lib/test/test_tarfile.py
+++ b/Lib/test/test_tarfile.py
@@ -1,13 +1,12 @@
 import sys
 import os
 import io
-import shutil
 from hashlib import md5
 
 import unittest
 import tarfile
 
-from test import support
+from test import support, script_helper
 
 # Check for our compression modules.
 try:
@@ -27,11 +26,13 @@
     return md5(data).hexdigest()
 
 TEMPDIR = os.path.abspath(support.TESTFN) + "-tardir"
+tarextdir = TEMPDIR + '-extract-test'
 tarname = support.findfile("testtar.tar")
 gzipname = os.path.join(TEMPDIR, "testtar.tar.gz")
 bz2name = os.path.join(TEMPDIR, "testtar.tar.bz2")
 xzname = os.path.join(TEMPDIR, "testtar.tar.xz")
 tmpname = os.path.join(TEMPDIR, "tmp.tar")
+dotlessname = os.path.join(TEMPDIR, "testtar")
 
 md5_regtype = "65f477c818ad9e15f7feab0c6d37742f"
 md5_sparse = "a54fbc4ca4f4399a90e1b27164012fc6"
@@ -271,7 +272,7 @@
         # ?rw-r--r-- tarfile/tarfile     7011 2003-01-06 07:19:43 ustar/conttype
         # ?rw-r--r-- tarfile/tarfile     7011 2003-01-06 07:19:43 ustar/regtype
         # ...
-        self.assertRegex(out, (br'-rw-r--r-- tarfile/tarfile\s+7011 '
+        self.assertRegex(out, (br'\?rw-r--r-- tarfile/tarfile\s+7011 '
                                br'\d{4}-\d\d-\d\d\s+\d\d:\d\d:\d\d '
                                br'ustar/\w+type ?\r?\n') * 2)
         # Make sure it prints the source of link with verbose flag
@@ -319,12 +320,7 @@
     def test_non_existent_tarfile(self):
         # Test for issue11513: prevent non-existent gzipped tarfiles raising
         # multiple exceptions.
-        test = 'xxx'
-        if sys.platform == 'win32' and '|' in self.mode:
-            # Issue #20384: On Windows os.open() error message doesn't
-            # contain file name.
-            test = ''
-        with self.assertRaisesRegex(FileNotFoundError, test):
+        with self.assertRaisesRegex(FileNotFoundError, "xxx"):
             tarfile.open("xxx", self.mode)
 
     def test_null_tarfile(self):
@@ -355,10 +351,16 @@
 
 
 class MiscReadTestBase(CommonReadTest):
+    def requires_name_attribute(self):
+        pass
+
     def test_no_name_argument(self):
+        self.requires_name_attribute()
         with open(self.tarname, "rb") as fobj:
-            tar = tarfile.open(fileobj=fobj, mode=self.mode)
-            self.assertEqual(tar.name, os.path.abspath(fobj.name))
+            self.assertIsInstance(fobj.name, str)
+            with tarfile.open(fileobj=fobj, mode=self.mode) as tar:
+                self.assertIsInstance(tar.name, str)
+                self.assertEqual(tar.name, os.path.abspath(fobj.name))
 
     def test_no_name_attribute(self):
         with open(self.tarname, "rb") as fobj:
@@ -366,7 +368,7 @@
         fobj = io.BytesIO(data)
         self.assertRaises(AttributeError, getattr, fobj, "name")
         tar = tarfile.open(fileobj=fobj, mode=self.mode)
-        self.assertEqual(tar.name, None)
+        self.assertIsNone(tar.name)
 
     def test_empty_name_attribute(self):
         with open(self.tarname, "rb") as fobj:
@@ -374,7 +376,25 @@
         fobj = io.BytesIO(data)
         fobj.name = ""
         with tarfile.open(fileobj=fobj, mode=self.mode) as tar:
-            self.assertEqual(tar.name, None)
+            self.assertIsNone(tar.name)
+
+    def test_int_name_attribute(self):
+        # Issue 21044: tarfile.open() should handle fileobj with an integer
+        # 'name' attribute.
+        fd = os.open(self.tarname, os.O_RDONLY)
+        with open(fd, 'rb') as fobj:
+            self.assertIsInstance(fobj.name, int)
+            with tarfile.open(fileobj=fobj, mode=self.mode) as tar:
+                self.assertIsNone(tar.name)
+
+    def test_bytes_name_attribute(self):
+        self.requires_name_attribute()
+        tarname = os.fsencode(self.tarname)
+        with open(tarname, 'rb') as fobj:
+            self.assertIsInstance(fobj.name, bytes)
+            with tarfile.open(fileobj=fobj, mode=self.mode) as tar:
+                self.assertIsInstance(tar.name, bytes)
+                self.assertEqual(tar.name, os.path.abspath(fobj.name))
 
     def test_illegal_mode_arg(self):
         with open(tmpname, 'wb'):
@@ -459,16 +479,16 @@
         # Test hardlink extraction (e.g. bug #857297).
         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"))
+            self.addCleanup(support.unlink, os.path.join(TEMPDIR, "ustar/regtype"))
 
             tar.extract("ustar/lnktype", TEMPDIR)
-            self.addCleanup(os.remove, os.path.join(TEMPDIR, "ustar/lnktype"))
+            self.addCleanup(support.unlink, 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)
 
             tar.extract("ustar/symtype", TEMPDIR)
-            self.addCleanup(os.remove, os.path.join(TEMPDIR, "ustar/symtype"))
+            self.addCleanup(support.unlink, 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)
@@ -501,7 +521,7 @@
                 self.assertEqual(tarinfo.mtime, file_mtime, errmsg)
         finally:
             tar.close()
-            shutil.rmtree(DIR)
+            support.rmtree(DIR)
 
     def test_extract_directory(self):
         dirtype = "ustar/dirtype"
@@ -516,7 +536,7 @@
                 if sys.platform != "win32":
                     self.assertEqual(os.stat(extracted).st_mode & 0o777, 0o755)
         finally:
-            shutil.rmtree(DIR)
+            support.rmtree(DIR)
 
     def test_init_close_fobj(self):
         # Issue #7341: Close the internal file object in the TarFile
@@ -552,11 +572,11 @@
     pass
 
 class Bz2MiscReadTest(Bz2Test, MiscReadTestBase, unittest.TestCase):
-    def test_no_name_argument(self):
+    def requires_name_attribute(self):
         self.skipTest("BZ2File have no name attribute")
 
 class LzmaMiscReadTest(LzmaTest, MiscReadTestBase, unittest.TestCase):
-    def test_no_name_argument(self):
+    def requires_name_attribute(self):
         self.skipTest("LZMAFile have no name attribute")
 
 
@@ -880,7 +900,7 @@
                 fobj.seek(4096)
                 fobj.truncate()
             s = os.stat(name)
-            os.remove(name)
+            support.unlink(name)
             return s.st_blocks == 0
         else:
             return False
@@ -1013,7 +1033,7 @@
             finally:
                 tar.close()
         finally:
-            os.rmdir(path)
+            support.rmdir(path)
 
     @unittest.skipUnless(hasattr(os, "link"),
                          "Missing hardlink implementation")
@@ -1033,8 +1053,8 @@
             finally:
                 tar.close()
         finally:
-            os.remove(target)
-            os.remove(link)
+            support.unlink(target)
+            support.unlink(link)
 
     @support.skip_unless_symlink
     def test_symlink_size(self):
@@ -1048,7 +1068,7 @@
             finally:
                 tar.close()
         finally:
-            os.remove(path)
+            support.unlink(path)
 
     def test_add_self(self):
         # Test for #1257255.
@@ -1095,7 +1115,7 @@
             finally:
                 tar.close()
         finally:
-            shutil.rmtree(tempdir)
+            support.rmtree(tempdir)
 
     def test_filter(self):
         tempdir = os.path.join(TEMPDIR, "filter")
@@ -1131,7 +1151,7 @@
             finally:
                 tar.close()
         finally:
-            shutil.rmtree(tempdir)
+            support.rmtree(tempdir)
 
     # Guarantee that stored pathnames are not modified. Don't
     # remove ./ or ../ or double slashes. Still make absolute
@@ -1159,9 +1179,9 @@
             tar.close()
 
         if not dir:
-            os.remove(foo)
+            support.unlink(foo)
         else:
-            os.rmdir(foo)
+            support.rmdir(foo)
 
         self.assertEqual(t.name, cmp_path or path.replace(os.sep, "/"))
 
@@ -1192,8 +1212,8 @@
             finally:
                 tar.close()
         finally:
-            os.unlink(temparchive)
-            shutil.rmtree(tempdir)
+            support.unlink(temparchive)
+            support.rmtree(tempdir)
 
     def test_pathnames(self):
         self._test_pathname("foo")
@@ -1293,7 +1313,7 @@
         # Test for issue #8464: Create files with correct
         # permissions.
         if os.path.exists(tmpname):
-            os.remove(tmpname)
+            support.unlink(tmpname)
 
         original_umask = os.umask(0o022)
         try:
@@ -1647,7 +1667,7 @@
     def setUp(self):
         self.tarname = tmpname
         if os.path.exists(self.tarname):
-            os.remove(self.tarname)
+            support.unlink(self.tarname)
 
     def _create_testtar(self, mode="w:"):
         with tarfile.open(tarname, encoding="iso8859-1") as src:
@@ -1847,6 +1867,171 @@
             tarfile.itn(0x10000000000, 6, tarfile.GNU_FORMAT)
 
 
+class CommandLineTest(unittest.TestCase):
+
+    def tarfilecmd(self, *args, **kwargs):
+        rc, out, err = script_helper.assert_python_ok('-m', 'tarfile', *args,
+                                                      **kwargs)
+        return out.replace(os.linesep.encode(), b'\n')
+
+    def tarfilecmd_failure(self, *args):
+        return script_helper.assert_python_failure('-m', 'tarfile', *args)
+
+    def make_simple_tarfile(self, tar_name):
+        files = [support.findfile('tokenize_tests.txt'),
+                 support.findfile('tokenize_tests-no-coding-cookie-'
+                                  'and-utf8-bom-sig-only.txt')]
+        self.addCleanup(support.unlink, tar_name)
+        with tarfile.open(tar_name, 'w') as tf:
+            for tardata in files:
+                tf.add(tardata, arcname=os.path.basename(tardata))
+
+    def test_test_command(self):
+        for tar_name in testtarnames:
+            for opt in '-t', '--test':
+                out = self.tarfilecmd(opt, tar_name)
+                self.assertEqual(out, b'')
+
+    def test_test_command_verbose(self):
+        for tar_name in testtarnames:
+            for opt in '-v', '--verbose':
+                out = self.tarfilecmd(opt, '-t', tar_name)
+                self.assertIn(b'is a tar archive.\n', out)
+
+    def test_test_command_invalid_file(self):
+        zipname = support.findfile('zipdir.zip')
+        rc, out, err = self.tarfilecmd_failure('-t', zipname)
+        self.assertIn(b' is not a tar archive.', err)
+        self.assertEqual(out, b'')
+        self.assertEqual(rc, 1)
+
+        for tar_name in testtarnames:
+            with self.subTest(tar_name=tar_name):
+                with open(tar_name, 'rb') as f:
+                    data = f.read()
+                try:
+                    with open(tmpname, 'wb') as f:
+                        f.write(data[:511])
+                    rc, out, err = self.tarfilecmd_failure('-t', tmpname)
+                    self.assertEqual(out, b'')
+                    self.assertEqual(rc, 1)
+                finally:
+                    support.unlink(tmpname)
+
+    def test_list_command(self):
+        for tar_name in testtarnames:
+            with support.captured_stdout() as t:
+                with tarfile.open(tar_name, 'r') as tf:
+                    tf.list(verbose=False)
+            expected = t.getvalue().encode('ascii', 'backslashreplace')
+            for opt in '-l', '--list':
+                out = self.tarfilecmd(opt, tar_name,
+                                      PYTHONIOENCODING='ascii')
+                self.assertEqual(out, expected)
+
+    def test_list_command_verbose(self):
+        for tar_name in testtarnames:
+            with support.captured_stdout() as t:
+                with tarfile.open(tar_name, 'r') as tf:
+                    tf.list(verbose=True)
+            expected = t.getvalue().encode('ascii', 'backslashreplace')
+            for opt in '-v', '--verbose':
+                out = self.tarfilecmd(opt, '-l', tar_name,
+                                      PYTHONIOENCODING='ascii')
+                self.assertEqual(out, expected)
+
+    def test_list_command_invalid_file(self):
+        zipname = support.findfile('zipdir.zip')
+        rc, out, err = self.tarfilecmd_failure('-l', zipname)
+        self.assertIn(b' is not a tar archive.', err)
+        self.assertEqual(out, b'')
+        self.assertEqual(rc, 1)
+
+    def test_create_command(self):
+        files = [support.findfile('tokenize_tests.txt'),
+                 support.findfile('tokenize_tests-no-coding-cookie-'
+                                  'and-utf8-bom-sig-only.txt')]
+        for opt in '-c', '--create':
+            try:
+                out = self.tarfilecmd(opt, tmpname, *files)
+                self.assertEqual(out, b'')
+                with tarfile.open(tmpname) as tar:
+                    tar.getmembers()
+            finally:
+                support.unlink(tmpname)
+
+    def test_create_command_verbose(self):
+        files = [support.findfile('tokenize_tests.txt'),
+                 support.findfile('tokenize_tests-no-coding-cookie-'
+                                  'and-utf8-bom-sig-only.txt')]
+        for opt in '-v', '--verbose':
+            try:
+                out = self.tarfilecmd(opt, '-c', tmpname, *files)
+                self.assertIn(b' file created.', out)
+                with tarfile.open(tmpname) as tar:
+                    tar.getmembers()
+            finally:
+                support.unlink(tmpname)
+
+    def test_create_command_dotless_filename(self):
+        files = [support.findfile('tokenize_tests.txt')]
+        try:
+            out = self.tarfilecmd('-c', dotlessname, *files)
+            self.assertEqual(out, b'')
+            with tarfile.open(dotlessname) as tar:
+                tar.getmembers()
+        finally:
+            support.unlink(dotlessname)
+
+    def test_create_command_dot_started_filename(self):
+        tar_name = os.path.join(TEMPDIR, ".testtar")
+        files = [support.findfile('tokenize_tests.txt')]
+        try:
+            out = self.tarfilecmd('-c', tar_name, *files)
+            self.assertEqual(out, b'')
+            with tarfile.open(tar_name) as tar:
+                tar.getmembers()
+        finally:
+            support.unlink(tar_name)
+
+    def test_extract_command(self):
+        self.make_simple_tarfile(tmpname)
+        for opt in '-e', '--extract':
+            try:
+                with support.temp_cwd(tarextdir):
+                    out = self.tarfilecmd(opt, tmpname)
+                self.assertEqual(out, b'')
+            finally:
+                support.rmtree(tarextdir)
+
+    def test_extract_command_verbose(self):
+        self.make_simple_tarfile(tmpname)
+        for opt in '-v', '--verbose':
+            try:
+                with support.temp_cwd(tarextdir):
+                    out = self.tarfilecmd(opt, '-e', tmpname)
+                self.assertIn(b' file is extracted.', out)
+            finally:
+                support.rmtree(tarextdir)
+
+    def test_extract_command_different_directory(self):
+        self.make_simple_tarfile(tmpname)
+        try:
+            with support.temp_cwd(tarextdir):
+                out = self.tarfilecmd('-e', tmpname, 'spamdir')
+            self.assertEqual(out, b'')
+        finally:
+            support.rmtree(tarextdir)
+
+    def test_extract_command_invalid_file(self):
+        zipname = support.findfile('zipdir.zip')
+        with support.temp_cwd(tarextdir):
+            rc, out, err = self.tarfilecmd_failure('-e', zipname)
+        self.assertIn(b' is not a tar archive.', err)
+        self.assertEqual(out, b'')
+        self.assertEqual(rc, 1)
+
+
 class ContextManagerTest(unittest.TestCase):
 
     def test_basic(self):
@@ -1855,20 +2040,20 @@
         self.assertTrue(tar.closed, "context manager failed")
 
     def test_closed(self):
-        # The __enter__() method is supposed to raise IOError
+        # The __enter__() method is supposed to raise OSError
         # if the TarFile object is already closed.
         tar = tarfile.open(tarname)
         tar.close()
-        with self.assertRaises(IOError):
+        with self.assertRaises(OSError):
             with tar:
                 pass
 
     def test_exception(self):
-        # Test if the IOError exception is passed through properly.
+        # Test if the OSError exception is passed through properly.
         with self.assertRaises(Exception) as exc:
             with tarfile.open(tarname) as tar:
-                raise IOError
-        self.assertIsInstance(exc.exception, IOError,
+                raise OSError
+        self.assertIsInstance(exc.exception, OSError,
                               "wrong exception raised in context manager")
         self.assertTrue(tar.closed, "context manager failed")
 
@@ -1974,6 +2159,8 @@
     support.unlink(TEMPDIR)
     os.makedirs(TEMPDIR)
 
+    global testtarnames
+    testtarnames = [tarname]
     with open(tarname, "rb") as fobj:
         data = fobj.read()
 
@@ -1981,12 +2168,13 @@
     for c in GzipTest, Bz2Test, LzmaTest:
         if c.open:
             support.unlink(c.tarname)
+            testtarnames.append(c.tarname)
             with c.open(c.tarname, "wb") as tar:
                 tar.write(data)
 
 def tearDownModule():
     if os.path.exists(TEMPDIR):
-        shutil.rmtree(TEMPDIR)
+        support.rmtree(TEMPDIR)
 
 if __name__ == "__main__":
     unittest.main()
diff --git a/Lib/test/test_tcl.py b/Lib/test/test_tcl.py
index 5226ee6..da8f629 100644
--- a/Lib/test/test_tcl.py
+++ b/Lib/test/test_tcl.py
@@ -7,7 +7,7 @@
 _tkinter = support.import_module('_tkinter')
 
 # Make sure tkinter._fix runs to set up the environment
-support.import_fresh_module('tkinter')
+tkinter = support.import_fresh_module('tkinter')
 
 from tkinter import Tcl
 from _tkinter import TclError
@@ -133,6 +133,50 @@
         tcl = self.interp
         self.assertRaises(TclError,tcl.unsetvar,'a')
 
+    def test_getint(self):
+        tcl = self.interp.tk
+        self.assertEqual(tcl.getint(' 42 '), 42)
+        self.assertEqual(tcl.getint(42), 42)
+        self.assertRaises(TypeError, tcl.getint)
+        self.assertRaises(TypeError, tcl.getint, '42', '10')
+        self.assertRaises(TypeError, tcl.getint, b'42')
+        self.assertRaises(TypeError, tcl.getint, 42.0)
+        self.assertRaises(TclError, tcl.getint, 'a')
+        self.assertRaises((TypeError, ValueError, TclError),
+                          tcl.getint, '42\0')
+        self.assertRaises((UnicodeEncodeError, ValueError, TclError),
+                          tcl.getint, '42\ud800')
+
+    def test_getdouble(self):
+        tcl = self.interp.tk
+        self.assertEqual(tcl.getdouble(' 42 '), 42.0)
+        self.assertEqual(tcl.getdouble(' 42.5 '), 42.5)
+        self.assertEqual(tcl.getdouble(42.5), 42.5)
+        self.assertRaises(TypeError, tcl.getdouble)
+        self.assertRaises(TypeError, tcl.getdouble, '42.5', '10')
+        self.assertRaises(TypeError, tcl.getdouble, b'42.5')
+        self.assertRaises(TypeError, tcl.getdouble, 42)
+        self.assertRaises(TclError, tcl.getdouble, 'a')
+        self.assertRaises((TypeError, ValueError, TclError),
+                          tcl.getdouble, '42.5\0')
+        self.assertRaises((UnicodeEncodeError, ValueError, TclError),
+                          tcl.getdouble, '42.5\ud800')
+
+    def test_getboolean(self):
+        tcl = self.interp.tk
+        self.assertIs(tcl.getboolean('on'), True)
+        self.assertIs(tcl.getboolean('1'), True)
+        self.assertEqual(tcl.getboolean(42), 42)
+        self.assertRaises(TypeError, tcl.getboolean)
+        self.assertRaises(TypeError, tcl.getboolean, 'on', '1')
+        self.assertRaises(TypeError, tcl.getboolean, b'on')
+        self.assertRaises(TypeError, tcl.getboolean, 1.0)
+        self.assertRaises(TclError, tcl.getboolean, 'a')
+        self.assertRaises((TypeError, ValueError, TclError),
+                          tcl.getboolean, 'on\0')
+        self.assertRaises((UnicodeEncodeError, ValueError, TclError),
+                          tcl.getboolean, 'on\ud800')
+
     def testEvalFile(self):
         tcl = self.interp
         with open(support.TESTFN, 'w') as f:
@@ -345,8 +389,12 @@
         self.assertEqual(passValue('str\x00ing'), 'str\x00ing')
         self.assertEqual(passValue('str\x00ing\xbd'), 'str\x00ing\xbd')
         self.assertEqual(passValue('str\x00ing\u20ac'), 'str\x00ing\u20ac')
-        self.assertEqual(passValue(b'str\x00ing'), 'str\x00ing')
-        self.assertEqual(passValue(b'str\xc0\x80ing'), 'str\x00ing')
+        self.assertEqual(passValue(b'str\x00ing'),
+                         b'str\x00ing' if self.wantobjects else 'str\x00ing')
+        self.assertEqual(passValue(b'str\xc0\x80ing'),
+                         b'str\xc0\x80ing' if self.wantobjects else 'str\xc0\x80ing')
+        self.assertEqual(passValue(b'str\xbding'),
+                         b'str\xbding' if self.wantobjects else 'str\xbding')
         for i in (0, 1, -1, 2**31-1, -2**31):
             self.assertEqual(passValue(i), i if self.wantobjects else str(i))
         for f in (0.0, 1.0, -1.0, 1/3,
@@ -362,10 +410,9 @@
             self.assertEqual(passValue(float('inf')), float('inf'))
             self.assertEqual(passValue(-float('inf')), -float('inf'))
         else:
-            f = float(passValue(float('nan')))
-            self.assertNotEqual(f, f)
             self.assertEqual(float(passValue(float('inf'))), float('inf'))
             self.assertEqual(float(passValue(-float('inf'))), -float('inf'))
+            # XXX NaN representation can be not parsable by float()
         self.assertEqual(passValue((1, '2', (3.4,))),
                          (1, '2', (3.4,)) if self.wantobjects else '1 2 3.4')
 
@@ -377,42 +424,46 @@
             return arg
         self.interp.createcommand('testfunc', testfunc)
         self.addCleanup(self.interp.tk.deletecommand, 'testfunc')
-        def check(value, expected, eq=self.assertEqual):
+        def check(value, expected=None, *, eq=self.assertEqual):
+            if expected is None:
+                expected = value
+            nonlocal result
+            result = None
             r = self.interp.call('testfunc', value)
             self.assertIsInstance(result, str)
             eq(result, expected)
             self.assertIsInstance(r, str)
             eq(r, expected)
         def float_eq(actual, expected):
-            expected = float(expected)
             self.assertAlmostEqual(float(actual), expected,
                                    delta=abs(expected) * 1e-10)
-        def nan_eq(actual, expected):
-            actual = float(actual)
-            self.assertNotEqual(actual, actual)
 
         check(True, '1')
         check(False, '0')
-        check('string', 'string')
-        check('string\xbd', 'string\xbd')
-        check('string\u20ac', 'string\u20ac')
+        check('string')
+        check('string\xbd')
+        check('string\u20ac')
+        check('')
         check(b'string', 'string')
-        check(b'string\xe2\x82\xac', 'string\u20ac')
-        check('str\x00ing', 'str\x00ing')
-        check('str\x00ing\xbd', 'str\x00ing\xbd')
-        check('str\x00ing\u20ac', 'str\x00ing\u20ac')
-        check(b'str\xc0\x80ing', 'str\x00ing')
-        check(b'str\xc0\x80ing\xe2\x82\xac', 'str\x00ing\u20ac')
+        check(b'string\xe2\x82\xac', 'string\xe2\x82\xac')
+        check(b'string\xbd', 'string\xbd')
+        check(b'', '')
+        check('str\x00ing')
+        check('str\x00ing\xbd')
+        check('str\x00ing\u20ac')
+        check(b'str\x00ing', 'str\x00ing')
+        check(b'str\xc0\x80ing', 'str\xc0\x80ing')
+        check(b'str\xc0\x80ing\xe2\x82\xac', 'str\xc0\x80ing\xe2\x82\xac')
         for i in (0, 1, -1, 2**31-1, -2**31):
             check(i, str(i))
         for f in (0.0, 1.0, -1.0):
             check(f, repr(f))
         for f in (1/3.0, sys.float_info.min, sys.float_info.max,
                   -sys.float_info.min, -sys.float_info.max):
-            check(f, f, eq=float_eq)
-        check(float('inf'), 'Inf', eq=float_eq)
-        check(-float('inf'), '-Inf', eq=float_eq)
-        check(float('nan'), 'NaN', eq=nan_eq)
+            check(f, eq=float_eq)
+        check(float('inf'), eq=float_eq)
+        check(-float('inf'), eq=float_eq)
+        # XXX NaN representation can be not parsable by float()
         check((), '')
         check((1, (2,), (3, 4), '5 6', ()), '1 2 {3 4} {5 6} {}')
 
@@ -447,9 +498,9 @@
         if tcl_version >= (8, 5):
             if not self.wantobjects or get_tk_patchlevel() < (8, 5, 5):
                 # Before 8.5.5 dicts were converted to lists through string
-                expected = ('12', '\u20ac', '\u20ac', '3.4')
+                expected = ('12', '\u20ac', '\xe2\x82\xac', '3.4')
             else:
-                expected = (12, '\u20ac', '\u20ac', (3.4,))
+                expected = (12, '\u20ac', b'\xe2\x82\xac', (3.4,))
             testcases += [
                 (call('dict', 'create', 12, '\u20ac', b'\xe2\x82\xac', (3.4,)),
                     expected),
@@ -494,9 +545,9 @@
         if tcl_version >= (8, 5):
             if not self.wantobjects or get_tk_patchlevel() < (8, 5, 5):
                 # Before 8.5.5 dicts were converted to lists through string
-                expected = ('12', '\u20ac', '\u20ac', '3.4')
+                expected = ('12', '\u20ac', '\xe2\x82\xac', '3.4')
             else:
-                expected = (12, '\u20ac', '\u20ac', (3.4,))
+                expected = (12, '\u20ac', b'\xe2\x82\xac', (3.4,))
             testcases += [
                 (call('dict', 'create', 12, '\u20ac', b'\xe2\x82\xac', (3.4,)),
                     expected),
@@ -504,39 +555,40 @@
         for arg, res in testcases:
             self.assertEqual(split(arg), res, msg=arg)
 
-    def test_merge(self):
-        with support.check_warnings(('merge is deprecated',
-                                     DeprecationWarning)):
-            merge = self.interp.tk.merge
-            call = self.interp.tk.call
-            testcases = [
-                ((), ''),
-                (('a',), 'a'),
-                ((2,), '2'),
-                (('',), '{}'),
-                ('{', '\\{'),
-                (('a', 'b', 'c'), 'a b c'),
-                ((' ', '\t', '\r', '\n'), '{ } {\t} {\r} {\n}'),
-                (('a', ' ', 'c'), 'a { } c'),
-                (('a', '€'), 'a €'),
-                (('a', '\U000104a2'), 'a \U000104a2'),
-                (('a', b'\xe2\x82\xac'), 'a €'),
-                (('a', ('b', 'c')), 'a {b c}'),
-                (('a', 2), 'a 2'),
-                (('a', 3.4), 'a 3.4'),
-                (('a', (2, 3.4)), 'a {2 3.4}'),
-                ((), ''),
-                ((call('list', 1, '2', (3.4,)),), '{1 2 3.4}'),
-            ]
-            if tcl_version >= (8, 5):
-                testcases += [
-                    ((call('dict', 'create', 12, '\u20ac', b'\xe2\x82\xac', (3.4,)),),
-                     '{12 € € 3.4}'),
-                ]
-            for args, res in testcases:
-                self.assertEqual(merge(*args), res, msg=args)
-            self.assertRaises(UnicodeDecodeError, merge, b'\x80')
-            self.assertRaises(UnicodeEncodeError, merge, '\udc80')
+    def test_splitdict(self):
+        splitdict = tkinter._splitdict
+        tcl = self.interp.tk
+
+        arg = '-a {1 2 3} -something foo status {}'
+        self.assertEqual(splitdict(tcl, arg, False),
+            {'-a': '1 2 3', '-something': 'foo', 'status': ''})
+        self.assertEqual(splitdict(tcl, arg),
+            {'a': '1 2 3', 'something': 'foo', 'status': ''})
+
+        arg = ('-a', (1, 2, 3), '-something', 'foo', 'status', '{}')
+        self.assertEqual(splitdict(tcl, arg, False),
+            {'-a': (1, 2, 3), '-something': 'foo', 'status': '{}'})
+        self.assertEqual(splitdict(tcl, arg),
+            {'a': (1, 2, 3), 'something': 'foo', 'status': '{}'})
+
+        self.assertRaises(RuntimeError, splitdict, tcl, '-a b -c ')
+        self.assertRaises(RuntimeError, splitdict, tcl, ('-a', 'b', '-c'))
+
+        arg = tcl.call('list',
+                        '-a', (1, 2, 3), '-something', 'foo', 'status', ())
+        self.assertEqual(splitdict(tcl, arg),
+            {'a': (1, 2, 3) if self.wantobjects else '1 2 3',
+             'something': 'foo', 'status': ''})
+
+        if tcl_version >= (8, 5):
+            arg = tcl.call('dict', 'create',
+                           '-a', (1, 2, 3), '-something', 'foo', 'status', ())
+            if not self.wantobjects or get_tk_patchlevel() < (8, 5, 5):
+                # Before 8.5.5 dicts were converted to lists through string
+                expected = {'a': '1 2 3', 'something': 'foo', 'status': ''}
+            else:
+                expected = {'a': (1, 2, 3), 'something': 'foo', 'status': ''}
+            self.assertEqual(splitdict(tcl, arg), expected)
 
 
 class BigmemTclTest(unittest.TestCase):
@@ -547,10 +599,35 @@
     @support.cpython_only
     @unittest.skipUnless(INT_MAX < PY_SSIZE_T_MAX, "needs UINT_MAX < SIZE_MAX")
     @support.bigmemtest(size=INT_MAX + 1, memuse=5, dry_run=False)
-    def test_huge_string(self, size):
+    def test_huge_string_call(self, size):
         value = ' ' * size
         self.assertRaises(OverflowError, self.interp.call, 'set', '_', value)
 
+    @support.cpython_only
+    @unittest.skipUnless(INT_MAX < PY_SSIZE_T_MAX, "needs UINT_MAX < SIZE_MAX")
+    @support.bigmemtest(size=INT_MAX + 1, memuse=9, dry_run=False)
+    def test_huge_string_builtins(self, size):
+        value = '1' + ' ' * size
+        self.assertRaises(OverflowError, self.interp.tk.getint, value)
+        self.assertRaises(OverflowError, self.interp.tk.getdouble, value)
+        self.assertRaises(OverflowError, self.interp.tk.getboolean, value)
+        self.assertRaises(OverflowError, self.interp.eval, value)
+        self.assertRaises(OverflowError, self.interp.evalfile, value)
+        self.assertRaises(OverflowError, self.interp.record, value)
+        self.assertRaises(OverflowError, self.interp.adderrorinfo, value)
+        self.assertRaises(OverflowError, self.interp.setvar, value, 'x', 'a')
+        self.assertRaises(OverflowError, self.interp.setvar, 'x', value, 'a')
+        self.assertRaises(OverflowError, self.interp.unsetvar, value)
+        self.assertRaises(OverflowError, self.interp.unsetvar, 'x', value)
+        self.assertRaises(OverflowError, self.interp.adderrorinfo, value)
+        self.assertRaises(OverflowError, self.interp.exprstring, value)
+        self.assertRaises(OverflowError, self.interp.exprlong, value)
+        self.assertRaises(OverflowError, self.interp.exprboolean, value)
+        self.assertRaises(OverflowError, self.interp.splitlist, value)
+        self.assertRaises(OverflowError, self.interp.split, value)
+        self.assertRaises(OverflowError, self.interp.createcommand, value, max)
+        self.assertRaises(OverflowError, self.interp.deletecommand, value)
+
 
 def setUpModule():
     if support.verbose:
diff --git a/Lib/test/test_telnetlib.py b/Lib/test/test_telnetlib.py
index c9f2ccb..ee1c357 100644
--- a/Lib/test/test_telnetlib.py
+++ b/Lib/test/test_telnetlib.py
@@ -1,10 +1,9 @@
 import socket
-import select
+import selectors
 import telnetlib
 import time
 import contextlib
 
-import unittest
 from unittest import TestCase
 from test import support
 threading = support.import_module('threading')
@@ -112,40 +111,37 @@
         self._messages += out.getvalue()
         return
 
-def mock_select(*s_args):
-    block = False
-    for l in s_args:
-        for fob in l:
-            if isinstance(fob, TelnetAlike):
-                block = fob.sock.block
-    if block:
-        return [[], [], []]
-    else:
-        return s_args
-
-class MockPoller(object):
-    test_case = None  # Set during TestCase setUp.
+class MockSelector(selectors.BaseSelector):
 
     def __init__(self):
-        self._file_objs = []
+        self.keys = {}
 
-    def register(self, fd, eventmask):
-        self.test_case.assertTrue(hasattr(fd, 'fileno'), fd)
-        self.test_case.assertEqual(eventmask, select.POLLIN|select.POLLPRI)
-        self._file_objs.append(fd)
+    @property
+    def resolution(self):
+        return 1e-3
 
-    def poll(self, timeout=None):
+    def register(self, fileobj, events, data=None):
+        key = selectors.SelectorKey(fileobj, 0, events, data)
+        self.keys[fileobj] = key
+        return key
+
+    def unregister(self, fileobj):
+        return self.keys.pop(fileobj)
+
+    def select(self, timeout=None):
         block = False
-        for fob in self._file_objs:
-            if isinstance(fob, TelnetAlike):
-                block = fob.sock.block
+        for fileobj in self.keys:
+            if isinstance(fileobj, TelnetAlike):
+                block = fileobj.sock.block
+                break
         if block:
             return []
         else:
-            return zip(self._file_objs, [select.POLLIN]*len(self._file_objs))
+            return [(key, key.events) for key in self.keys.values()]
 
-    def unregister(self, fd):
-        self._file_objs.remove(fd)
+    def get_map(self):
+        return self.keys
+
 
 @contextlib.contextmanager
 def test_socket(reads):
@@ -159,7 +155,7 @@
         socket.create_connection = old_conn
     return
 
-def test_telnet(reads=(), cls=TelnetAlike, use_poll=None):
+def test_telnet(reads=(), cls=TelnetAlike):
     ''' return a telnetlib.Telnet object that uses a SocketStub with
         reads queued up to be read '''
     for x in reads:
@@ -167,29 +163,14 @@
     with test_socket(reads):
         telnet = cls('dummy', 0)
         telnet._messages = '' # debuglevel output
-        if use_poll is not None:
-            if use_poll and not telnet._has_poll:
-                raise unittest.SkipTest('select.poll() required.')
-            telnet._has_poll = use_poll
     return telnet
 
-
 class ExpectAndReadTestCase(TestCase):
     def setUp(self):
-        self.old_select = select.select
-        select.select = mock_select
-        self.old_poll = False
-        if hasattr(select, 'poll'):
-            self.old_poll = select.poll
-            select.poll = MockPoller
-            MockPoller.test_case = self
-
+        self.old_selector = telnetlib._TelnetSelector
+        telnetlib._TelnetSelector = MockSelector
     def tearDown(self):
-        if self.old_poll:
-            MockPoller.test_case = None
-            select.poll = self.old_poll
-        select.select = self.old_select
-
+        telnetlib._TelnetSelector = self.old_selector
 
 class ReadTests(ExpectAndReadTestCase):
     def test_read_until(self):
@@ -208,22 +189,6 @@
         data = telnet.read_until(b'match')
         self.assertEqual(data, expect)
 
-    def test_read_until_with_poll(self):
-        """Use select.poll() to implement telnet.read_until()."""
-        want = [b'x' * 10, b'match', b'y' * 10]
-        telnet = test_telnet(want, use_poll=True)
-        select.select = lambda *_: self.fail('unexpected select() call.')
-        data = telnet.read_until(b'match')
-        self.assertEqual(data, b''.join(want[:-1]))
-
-    def test_read_until_with_select(self):
-        """Use select.select() to implement telnet.read_until()."""
-        want = [b'x' * 10, b'match', b'y' * 10]
-        telnet = test_telnet(want, use_poll=False)
-        if self.old_poll:
-            select.poll = lambda *_: self.fail('unexpected poll() call.')
-        data = telnet.read_until(b'match')
-        self.assertEqual(data, b''.join(want[:-1]))
 
     def test_read_all(self):
         """
@@ -427,23 +392,6 @@
         (_,_,data) = telnet.expect([b'match'])
         self.assertEqual(data, b''.join(want[:-1]))
 
-    def test_expect_with_poll(self):
-        """Use select.poll() to implement telnet.expect()."""
-        want = [b'x' * 10, b'match', b'y' * 10]
-        telnet = test_telnet(want, use_poll=True)
-        select.select = lambda *_: self.fail('unexpected select() call.')
-        (_,_,data) = telnet.expect([b'match'])
-        self.assertEqual(data, b''.join(want[:-1]))
-
-    def test_expect_with_select(self):
-        """Use select.select() to implement telnet.expect()."""
-        want = [b'x' * 10, b'match', b'y' * 10]
-        telnet = test_telnet(want, use_poll=False)
-        if self.old_poll:
-            select.poll = lambda *_: self.fail('unexpected poll() call.')
-        (_,_,data) = telnet.expect([b'match'])
-        self.assertEqual(data, b''.join(want[:-1]))
-
 
 def test_main(verbose=None):
     support.run_unittest(GeneralTests, ReadTests, WriteTests, OptionTests,
diff --git a/Lib/test/test_tempfile.py b/Lib/test/test_tempfile.py
index 5a97035..2e10fdd 100644
--- a/Lib/test/test_tempfile.py
+++ b/Lib/test/test_tempfile.py
@@ -9,6 +9,7 @@
 import warnings
 import contextlib
 import weakref
+from unittest import mock
 
 import unittest
 from test import support, script_helper
@@ -37,7 +38,7 @@
 # Common functionality.
 class BaseTestCase(unittest.TestCase):
 
-    str_check = re.compile(r"[a-zA-Z0-9_-]{6}$")
+    str_check = re.compile(r"^[a-z0-9_-]{8}$")
 
     def setUp(self):
         self._warnings_manager = support.check_warnings()
@@ -64,7 +65,7 @@
 
         nbase = nbase[len(pre):len(nbase)-len(suf)]
         self.assertTrue(self.str_check.match(nbase),
-                     "random string '%s' does not match /^[a-zA-Z0-9_-]{6}$/"
+                     "random string '%s' does not match ^[a-z0-9_-]{8}$"
                      % nbase)
 
 
@@ -153,7 +154,7 @@
                 # via any bugs above
                 try:
                     os.kill(pid, signal.SIGKILL)
-                except EnvironmentError:
+                except OSError:
                     pass
             os.close(read_fd)
             os.close(write_fd)
@@ -192,7 +193,7 @@
 
             try:
                 dirname = os.getcwd()
-            except (AttributeError, os.error):
+            except (AttributeError, OSError):
                 dirname = os.curdir
 
             self.assertIn(dirname, cand)
@@ -332,7 +333,7 @@
         file = self.do_create()
         mode = stat.S_IMODE(os.stat(file.name).st_mode)
         expected = 0o600
-        if sys.platform in ('win32', 'os2emx'):
+        if sys.platform == 'win32':
             # There's no distinction among 'user', 'group' and 'world';
             # replicate the 'user' bits.
             user = expected >> 6
@@ -349,6 +350,7 @@
             v="q"
 
         file = self.do_create()
+        self.assertEqual(os.get_inheritable(file.fd), False)
         fd = "%d" % file.fd
 
         try:
@@ -365,7 +367,7 @@
         # On Windows a spawn* /path/ with embedded spaces shouldn't be quoted,
         # but an arg with embedded spaces should be decorated with double
         # quotes on each end
-        if sys.platform in ('win32',):
+        if sys.platform == 'win32':
             decorated = '"%s"' % sys.executable
             tester = '"%s"' % tester
         else:
@@ -475,6 +477,20 @@
 
         self.assertTrue(a is b)
 
+    def test_case_sensitive(self):
+        # gettempdir should not flatten its case
+        # even on a case-insensitive file system
+        case_sensitive_tempdir = tempfile.mkdtemp("-Temp")
+        _tempdir, tempfile.tempdir = tempfile.tempdir, None
+        try:
+            with support.EnvironmentVarGuard() as env:
+                # Fake the first env var which is checked as a candidate
+                env["TMPDIR"] = case_sensitive_tempdir
+                self.assertEqual(tempfile.gettempdir(), case_sensitive_tempdir)
+        finally:
+            tempfile.tempdir = _tempdir
+            support.rmdir(case_sensitive_tempdir)
+
 
 class TestMkstemp(BaseTestCase):
     """Test mkstemp()."""
@@ -563,7 +579,7 @@
             mode = stat.S_IMODE(os.stat(dir).st_mode)
             mode &= 0o777 # Mask off sticky bits inherited from /tmp
             expected = 0o700
-            if sys.platform in ('win32', 'os2emx'):
+            if sys.platform == 'win32':
                 # There's no distinction among 'user', 'group' and 'world';
                 # replicate the 'user' bits.
                 user = expected >> 6
@@ -743,6 +759,19 @@
                 pass
         self.assertRaises(ValueError, use_closed)
 
+    def test_no_leak_fd(self):
+        # Issue #21058: don't leak file descriptor when io.open() fails
+        closed = []
+        os_close = os.close
+        def close(fd):
+            closed.append(fd)
+            os_close(fd)
+
+        with mock.patch('os.close', side_effect=close):
+            with mock.patch('io.open', side_effect=ValueError):
+                self.assertRaises(ValueError, tempfile.NamedTemporaryFile)
+                self.assertEqual(len(closed), 1)
+
     # How to test the mode and bufsize parameters?
 
 
@@ -1046,6 +1075,20 @@
             roundtrip("\u039B", "w+", encoding="utf-16")
             roundtrip("foo\r\n", "w+", newline="")
 
+        def test_no_leak_fd(self):
+            # Issue #21058: don't leak file descriptor when io.open() fails
+            closed = []
+            os_close = os.close
+            def close(fd):
+                closed.append(fd)
+                os_close(fd)
+
+            with mock.patch('os.close', side_effect=close):
+                with mock.patch('io.open', side_effect=ValueError):
+                    self.assertRaises(ValueError, tempfile.TemporaryFile)
+                    self.assertEqual(len(closed), 1)
+
+
 
 # Helper for test_del_on_shutdown
 class NulledModules:
@@ -1139,8 +1182,9 @@
     def test_del_on_shutdown(self):
         # A TemporaryDirectory may be cleaned up during shutdown
         with self.do_create() as dir:
-            for mod in ('os', 'shutil', 'sys', 'tempfile', 'warnings'):
+            for mod in ('builtins', 'os', 'shutil', 'sys', 'tempfile', 'warnings'):
                 code = """if True:
+                    import builtins
                     import os
                     import shutil
                     import sys
@@ -1165,6 +1209,31 @@
                             "TemporaryDirectory %s exists after cleanup" % tmp_name)
                 err = err.decode('utf-8', 'backslashreplace')
                 self.assertNotIn("Exception ", err)
+                self.assertIn("ResourceWarning: Implicitly cleaning up", err)
+
+    def test_exit_on_shutdown(self):
+        # Issue #22427
+        with self.do_create() as dir:
+            code = """if True:
+                import sys
+                import tempfile
+                import warnings
+
+                def generator():
+                    with tempfile.TemporaryDirectory(dir={dir!r}) as tmp:
+                        yield tmp
+                g = generator()
+                sys.stdout.buffer.write(next(g).encode())
+
+                warnings.filterwarnings("always", category=ResourceWarning)
+                """.format(dir=dir)
+            rc, out, err = script_helper.assert_python_ok("-c", code)
+            tmp_name = out.decode().strip()
+            self.assertFalse(os.path.exists(tmp_name),
+                        "TemporaryDirectory %s exists after cleanup" % tmp_name)
+            err = err.decode('utf-8', 'backslashreplace')
+            self.assertNotIn("Exception ", err)
+            self.assertIn("ResourceWarning: Implicitly cleaning up", err)
 
     def test_warnings_on_cleanup(self):
         # ResourceWarning will be triggered by __del__
diff --git a/Lib/test/test_textwrap.py b/Lib/test/test_textwrap.py
index c86f5cf..1bba77e 100644
--- a/Lib/test/test_textwrap.py
+++ b/Lib/test/test_textwrap.py
@@ -9,9 +9,8 @@
 #
 
 import unittest
-from test import support
 
-from textwrap import TextWrapper, wrap, fill, dedent, indent
+from textwrap import TextWrapper, wrap, fill, dedent, indent, shorten
 
 
 class BaseTestCase(unittest.TestCase):
@@ -430,6 +429,90 @@
         self.check_wrap(text, 7, ["aa \xe4\xe4-", "\xe4\xe4"])
 
 
+class MaxLinesTestCase(BaseTestCase):
+    text = "Hello there, how are you this fine day?  I'm glad to hear it!"
+
+    def test_simple(self):
+        self.check_wrap(self.text, 12,
+                        ["Hello [...]"],
+                        max_lines=0)
+        self.check_wrap(self.text, 12,
+                        ["Hello [...]"],
+                        max_lines=1)
+        self.check_wrap(self.text, 12,
+                        ["Hello there,",
+                         "how [...]"],
+                        max_lines=2)
+        self.check_wrap(self.text, 13,
+                        ["Hello there,",
+                         "how are [...]"],
+                        max_lines=2)
+        self.check_wrap(self.text, 80, [self.text], max_lines=1)
+        self.check_wrap(self.text, 12,
+                        ["Hello there,",
+                         "how are you",
+                         "this fine",
+                         "day?  I'm",
+                         "glad to hear",
+                         "it!"],
+                        max_lines=6)
+
+    def test_spaces(self):
+        # strip spaces before placeholder
+        self.check_wrap(self.text, 12,
+                        ["Hello there,",
+                         "how are you",
+                         "this fine",
+                         "day? [...]"],
+                        max_lines=4)
+        # placeholder at the start of line
+        self.check_wrap(self.text, 6,
+                        ["Hello",
+                         "[...]"],
+                        max_lines=2)
+        # final spaces
+        self.check_wrap(self.text + ' ' * 10, 12,
+                        ["Hello there,",
+                         "how are you",
+                         "this fine",
+                         "day?  I'm",
+                         "glad to hear",
+                         "it!"],
+                        max_lines=6)
+
+    def test_placeholder(self):
+        self.check_wrap(self.text, 12,
+                        ["Hello..."],
+                        max_lines=1,
+                        placeholder='...')
+        self.check_wrap(self.text, 12,
+                        ["Hello there,",
+                         "how are..."],
+                        max_lines=2,
+                        placeholder='...')
+        # long placeholder and indentation
+        with self.assertRaises(ValueError):
+            wrap(self.text, 16, initial_indent='    ',
+                 max_lines=1, placeholder=' [truncated]...')
+        with self.assertRaises(ValueError):
+            wrap(self.text, 16, subsequent_indent='    ',
+                 max_lines=2, placeholder=' [truncated]...')
+        self.check_wrap(self.text, 16,
+                        ["    Hello there,",
+                         "  [truncated]..."],
+                        max_lines=2,
+                        initial_indent='    ',
+                        subsequent_indent='  ',
+                        placeholder=' [truncated]...')
+        self.check_wrap(self.text, 16,
+                        ["  [truncated]..."],
+                        max_lines=1,
+                        initial_indent='  ',
+                        subsequent_indent='    ',
+                        placeholder=' [truncated]...')
+        self.check_wrap(self.text, 80, [self.text], placeholder='.' * 1000)
+
+
 class LongWordTestCase (BaseTestCase):
     def setUp(self):
         self.wrapper = TextWrapper()
@@ -490,6 +573,14 @@
         result = wrap(self.text, width=30, break_long_words=0)
         self.check(result, expect)
 
+    def test_max_lines_long(self):
+        self.check_wrap(self.text, 12,
+                        ['Did you say ',
+                         '"supercalifr',
+                         'agilisticexp',
+                         '[...]'],
+                        max_lines=4)
+
 
 class IndentTestCases(BaseTestCase):
 
@@ -777,12 +868,62 @@
             self.assertEqual(indent(text, prefix, predicate), expect)
 
 
-def test_main():
-    support.run_unittest(WrapTestCase,
-                              LongWordTestCase,
-                              IndentTestCases,
-                              DedentTestCase,
-                              IndentTestCase)
+class ShortenTestCase(BaseTestCase):
+
+    def check_shorten(self, text, width, expect, **kwargs):
+        result = shorten(text, width, **kwargs)
+        self.check(result, expect)
+
+    def test_simple(self):
+        # Simple case: just words, spaces, and a bit of punctuation
+        text = "Hello there, how are you this fine day? I'm glad to hear it!"
+
+        self.check_shorten(text, 18, "Hello there, [...]")
+        self.check_shorten(text, len(text), text)
+        self.check_shorten(text, len(text) - 1,
+            "Hello there, how are you this fine day? "
+            "I'm glad to [...]")
+
+    def test_placeholder(self):
+        text = "Hello there, how are you this fine day? I'm glad to hear it!"
+
+        self.check_shorten(text, 17, "Hello there,$$", placeholder='$$')
+        self.check_shorten(text, 18, "Hello there, how$$", placeholder='$$')
+        self.check_shorten(text, 18, "Hello there, $$", placeholder=' $$')
+        self.check_shorten(text, len(text), text, placeholder='$$')
+        self.check_shorten(text, len(text) - 1,
+            "Hello there, how are you this fine day? "
+            "I'm glad to hear$$", placeholder='$$')
+
+    def test_empty_string(self):
+        self.check_shorten("", 6, "")
+
+    def test_whitespace(self):
+        # Whitespace collapsing
+        text = """
+            This is a  paragraph that  already has
+            line breaks and \t tabs too."""
+        self.check_shorten(text, 62,
+                             "This is a paragraph that already has line "
+                             "breaks and tabs too.")
+        self.check_shorten(text, 61,
+                             "This is a paragraph that already has line "
+                             "breaks and [...]")
+
+        self.check_shorten("hello      world!  ", 12, "hello world!")
+        self.check_shorten("hello      world!  ", 11, "hello [...]")
+        # The leading space is trimmed from the placeholder
+        # (it would be ugly otherwise).
+        self.check_shorten("hello      world!  ", 10, "[...]")
+
+    def test_width_too_small_for_placeholder(self):
+        shorten("x" * 20, width=8, placeholder="(......)")
+        with self.assertRaises(ValueError):
+            shorten("x" * 20, width=8, placeholder="(.......)")
+
+    def test_first_word_too_long_but_placeholder_fits(self):
+        self.check_shorten("Helloo", 5, "[...]")
+
 
 if __name__ == '__main__':
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_thread.py b/Lib/test/test_thread.py
index 5437281..6144901 100644
--- a/Lib/test/test_thread.py
+++ b/Lib/test/test_thread.py
@@ -68,7 +68,7 @@
         thread.stack_size(0)
         self.assertEqual(thread.stack_size(), 0, "stack_size not reset to default")
 
-    @unittest.skipIf(os.name not in ("nt", "os2", "posix"), 'test meant for nt, os2, and posix')
+    @unittest.skipIf(os.name not in ("nt", "posix"), 'test meant for nt and posix')
     def test_nt_and_posix_stack_size(self):
         try:
             thread.stack_size(4096)
diff --git a/Lib/test/test_threaded_import.py b/Lib/test/test_threaded_import.py
index 6c2965b..192fa08 100644
--- a/Lib/test/test_threaded_import.py
+++ b/Lib/test/test_threaded_import.py
@@ -5,15 +5,16 @@
 # complains several times about module random having no attribute
 # randrange, and then Python hangs.
 
+import _imp as imp
 import os
-import imp
 import importlib
 import sys
 import time
 import shutil
 import unittest
 from test.support import (
-    verbose, import_module, run_unittest, TESTFN, reap_threads, forget, unlink)
+    verbose, import_module, run_unittest, TESTFN, reap_threads,
+    forget, unlink, rmtree)
 threading = import_module('threading')
 
 def task(N, done, done_tasks, errors):
@@ -57,7 +58,7 @@
 }
 
 class Finder:
-    """A dummy finder to detect concurrent access to its find_module()
+    """A dummy finder to detect concurrent access to its find_spec()
     method."""
 
     def __init__(self):
@@ -65,8 +66,8 @@
         self.x = 0
         self.lock = threading.Lock()
 
-    def find_module(self, name, path=None):
-        # Simulate some thread-unsafe behaviour. If calls to find_module()
+    def find_spec(self, name, path=None, target=None):
+        # Simulate some thread-unsafe behaviour. If calls to find_spec()
         # are properly serialized, `x` will end up the same as `numcalls`.
         # Otherwise not.
         assert imp.lock_held()
@@ -80,7 +81,7 @@
     """A dummy finder which flushes sys.path_importer_cache when it gets
     called."""
 
-    def find_module(self, name, path=None):
+    def find_spec(self, name, path=None, target=None):
         sys.path_importer_cache.clear()
 
 
@@ -145,13 +146,13 @@
         # dedicated meta_path entry.
         flushing_finder = FlushingFinder()
         def path_hook(path):
-            finder.find_module('')
+            finder.find_spec('')
             raise ImportError
         sys.path_hooks.insert(0, path_hook)
         sys.meta_path.append(flushing_finder)
         try:
             # Flush the cache a first time
-            flushing_finder.find_module('')
+            flushing_finder.find_spec('')
             numtests = self.check_parallel_module_init()
             self.assertGreater(finder.numcalls, 0)
             self.assertEqual(finder.x, finder.numcalls)
@@ -222,6 +223,7 @@
             f.write(code.encode('utf-8'))
         self.addCleanup(unlink, filename)
         self.addCleanup(forget, TESTFN)
+        self.addCleanup(rmtree, '__pycache__')
         importlib.invalidate_caches()
         __import__(TESTFN)
 
diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
index 11c8979..98f01ee 100644
--- a/Lib/test/test_threading.py
+++ b/Lib/test/test_threading.py
@@ -4,7 +4,7 @@
 
 import test.support
 from test.support import verbose, strip_python_stderr, import_module, cpython_only
-from test.script_helper import assert_python_ok
+from test.script_helper import assert_python_ok, assert_python_failure
 
 import random
 import re
@@ -15,15 +15,19 @@
 import unittest
 import weakref
 import os
-from test.script_helper import assert_python_ok, assert_python_failure
 import subprocess
-try:
-    import _testcapi
-except ImportError:
-    _testcapi = None
 
 from test import lock_tests
 
+
+# Between fork() and exec(), only async-safe functions are allowed (issues
+# #12316 and #11870), and fork() from a worker thread is known to trigger
+# problems with some operating systems (issue #3863): skip problematic tests
+# on platforms known to behave badly.
+platforms_to_skip = ('freebsd4', 'freebsd5', 'freebsd6', 'netbsd5',
+                     'hp-ux11')
+
+
 # A trivial mutable counter.
 class Counter(object):
     def __init__(self):
@@ -103,7 +107,7 @@
         if verbose:
             print('waiting for all tasks to complete')
         for t in threads:
-            t.join(NUMTASKS)
+            t.join()
             self.assertTrue(not t.is_alive())
             self.assertNotEqual(t.ident, 0)
             self.assertFalse(t.ident is None)
@@ -471,6 +475,127 @@
                 pid, status = os.waitpid(pid, 0)
                 self.assertEqual(0, status)
 
+    def test_main_thread(self):
+        main = threading.main_thread()
+        self.assertEqual(main.name, 'MainThread')
+        self.assertEqual(main.ident, threading.current_thread().ident)
+        self.assertEqual(main.ident, threading.get_ident())
+
+        def f():
+            self.assertNotEqual(threading.main_thread().ident,
+                                threading.current_thread().ident)
+        th = threading.Thread(target=f)
+        th.start()
+        th.join()
+
+    @unittest.skipUnless(hasattr(os, 'fork'), "test needs os.fork()")
+    @unittest.skipUnless(hasattr(os, 'waitpid'), "test needs os.waitpid()")
+    def test_main_thread_after_fork(self):
+        code = """if 1:
+            import os, threading
+
+            pid = os.fork()
+            if pid == 0:
+                main = threading.main_thread()
+                print(main.name)
+                print(main.ident == threading.current_thread().ident)
+                print(main.ident == threading.get_ident())
+            else:
+                os.waitpid(pid, 0)
+        """
+        _, out, err = assert_python_ok("-c", code)
+        data = out.decode().replace('\r', '')
+        self.assertEqual(err, b"")
+        self.assertEqual(data, "MainThread\nTrue\nTrue\n")
+
+    @unittest.skipIf(sys.platform in platforms_to_skip, "due to known OS bug")
+    @unittest.skipUnless(hasattr(os, 'fork'), "test needs os.fork()")
+    @unittest.skipUnless(hasattr(os, 'waitpid'), "test needs os.waitpid()")
+    def test_main_thread_after_fork_from_nonmain_thread(self):
+        code = """if 1:
+            import os, threading, sys
+
+            def f():
+                pid = os.fork()
+                if pid == 0:
+                    main = threading.main_thread()
+                    print(main.name)
+                    print(main.ident == threading.current_thread().ident)
+                    print(main.ident == threading.get_ident())
+                    # stdout is fully buffered because not a tty,
+                    # we have to flush before exit.
+                    sys.stdout.flush()
+                else:
+                    os.waitpid(pid, 0)
+
+            th = threading.Thread(target=f)
+            th.start()
+            th.join()
+        """
+        _, out, err = assert_python_ok("-c", code)
+        data = out.decode().replace('\r', '')
+        self.assertEqual(err, b"")
+        self.assertEqual(data, "Thread-1\nTrue\nTrue\n")
+
+    def test_tstate_lock(self):
+        # Test an implementation detail of Thread objects.
+        started = _thread.allocate_lock()
+        finish = _thread.allocate_lock()
+        started.acquire()
+        finish.acquire()
+        def f():
+            started.release()
+            finish.acquire()
+            time.sleep(0.01)
+        # The tstate lock is None until the thread is started
+        t = threading.Thread(target=f)
+        self.assertIs(t._tstate_lock, None)
+        t.start()
+        started.acquire()
+        self.assertTrue(t.is_alive())
+        # The tstate lock can't be acquired when the thread is running
+        # (or suspended).
+        tstate_lock = t._tstate_lock
+        self.assertFalse(tstate_lock.acquire(timeout=0), False)
+        finish.release()
+        # When the thread ends, the state_lock can be successfully
+        # acquired.
+        self.assertTrue(tstate_lock.acquire(timeout=5), False)
+        # But is_alive() is still True:  we hold _tstate_lock now, which
+        # prevents is_alive() from knowing the thread's end-of-life C code
+        # is done.
+        self.assertTrue(t.is_alive())
+        # Let is_alive() find out the C code is done.
+        tstate_lock.release()
+        self.assertFalse(t.is_alive())
+        # And verify the thread disposed of _tstate_lock.
+        self.assertTrue(t._tstate_lock is None)
+
+    def test_repr_stopped(self):
+        # Verify that "stopped" shows up in repr(Thread) appropriately.
+        started = _thread.allocate_lock()
+        finish = _thread.allocate_lock()
+        started.acquire()
+        finish.acquire()
+        def f():
+            started.release()
+            finish.acquire()
+        t = threading.Thread(target=f)
+        t.start()
+        started.acquire()
+        self.assertIn("started", repr(t))
+        finish.release()
+        # "stopped" should appear in the repr in a reasonable amount of time.
+        # Implementation detail:  as of this writing, that's trivially true
+        # if .join() is called, and almost trivially true if .is_alive() is
+        # called.  The detail we're testing here is that "stopped" shows up
+        # "all on its own".
+        LOOKING_FOR = "stopped"
+        for i in range(500):
+            if LOOKING_FOR in repr(t):
+                break
+            time.sleep(0.01)
+        self.assertIn(LOOKING_FOR, repr(t)) # we waited at least 5 seconds
 
     def test_BoundedSemaphore_limit(self):
         # BoundedSemaphore should raise ValueError if released too often.
@@ -490,14 +615,48 @@
                 t.join()
             self.assertRaises(ValueError, bs.release)
 
-class ThreadJoinOnShutdown(BaseTestCase):
+    @cpython_only
+    def test_frame_tstate_tracing(self):
+        # Issue #14432: Crash when a generator is created in a C thread that is
+        # destroyed while the generator is still used. The issue was that a
+        # generator contains a frame, and the frame kept a reference to the
+        # Python state of the destroyed C thread. The crash occurs when a trace
+        # function is setup.
 
-    # Between fork() and exec(), only async-safe functions are allowed (issues
-    # #12316 and #11870), and fork() from a worker thread is known to trigger
-    # problems with some operating systems (issue #3863): skip problematic tests
-    # on platforms known to behave badly.
-    platforms_to_skip = ('freebsd4', 'freebsd5', 'freebsd6', 'netbsd5',
-                         'os2emx', 'hp-ux11')
+        def noop_trace(frame, event, arg):
+            # no operation
+            return noop_trace
+
+        def generator():
+            while 1:
+                yield "genereator"
+
+        def callback():
+            if callback.gen is None:
+                callback.gen = generator()
+            return next(callback.gen)
+        callback.gen = None
+
+        old_trace = sys.gettrace()
+        sys.settrace(noop_trace)
+        try:
+            # Install a trace function
+            threading.settrace(noop_trace)
+
+            # Create a generator in a C thread which exits after the call
+            import _testcapi
+            _testcapi.call_in_temporary_c_thread(callback)
+
+            # Call the generator in a different Python thread, check that the
+            # generator didn't keep a reference to the destroyed thread state
+            for test in range(3):
+                # The trace function is still called here
+                callback()
+        finally:
+            sys.settrace(old_trace)
+
+
+class ThreadJoinOnShutdown(BaseTestCase):
 
     def _run_and_join(self, script):
         script = """if 1:
@@ -570,144 +729,8 @@
             """
         self._run_and_join(script)
 
-    def assertScriptHasOutput(self, script, expected_output):
-        rc, out, err = assert_python_ok("-c", script)
-        data = out.decode().replace('\r', '')
-        self.assertEqual(data, expected_output)
-
-    @unittest.skipUnless(hasattr(os, 'fork'), "needs os.fork()")
     @unittest.skipIf(sys.platform in platforms_to_skip, "due to known OS bug")
-    def test_4_joining_across_fork_in_worker_thread(self):
-        # There used to be a possible deadlock when forking from a child
-        # thread.  See http://bugs.python.org/issue6643.
-
-        # The script takes the following steps:
-        # - The main thread in the parent process starts a new thread and then
-        #   tries to join it.
-        # - The join operation acquires the Lock inside the thread's _block
-        #   Condition.  (See threading.py:Thread.join().)
-        # - We stub out the acquire method on the condition to force it to wait
-        #   until the child thread forks.  (See LOCK ACQUIRED HERE)
-        # - The child thread forks.  (See LOCK HELD and WORKER THREAD FORKS
-        #   HERE)
-        # - The main thread of the parent process enters Condition.wait(),
-        #   which releases the lock on the child thread.
-        # - The child process returns.  Without the necessary fix, when the
-        #   main thread of the child process (which used to be the child thread
-        #   in the parent process) attempts to exit, it will try to acquire the
-        #   lock in the Thread._block Condition object and hang, because the
-        #   lock was held across the fork.
-
-        script = """if 1:
-            import os, time, threading
-
-            finish_join = False
-            start_fork = False
-
-            def worker():
-                # Wait until this thread's lock is acquired before forking to
-                # create the deadlock.
-                global finish_join
-                while not start_fork:
-                    time.sleep(0.01)
-                # LOCK HELD: Main thread holds lock across this call.
-                childpid = os.fork()
-                finish_join = True
-                if childpid != 0:
-                    # Parent process just waits for child.
-                    os.waitpid(childpid, 0)
-                # Child process should just return.
-
-            w = threading.Thread(target=worker)
-
-            # Stub out the private condition variable's lock acquire method.
-            # This acquires the lock and then waits until the child has forked
-            # before returning, which will release the lock soon after.  If
-            # someone else tries to fix this test case by acquiring this lock
-            # before forking instead of resetting it, the test case will
-            # deadlock when it shouldn't.
-            condition = w._block
-            orig_acquire = condition.acquire
-            call_count_lock = threading.Lock()
-            call_count = 0
-            def my_acquire():
-                global call_count
-                global start_fork
-                orig_acquire()  # LOCK ACQUIRED HERE
-                start_fork = True
-                if call_count == 0:
-                    while not finish_join:
-                        time.sleep(0.01)  # WORKER THREAD FORKS HERE
-                with call_count_lock:
-                    call_count += 1
-            condition.acquire = my_acquire
-
-            w.start()
-            w.join()
-            print('end of main')
-            """
-        self.assertScriptHasOutput(script, "end of main\n")
-
-    @unittest.skipUnless(hasattr(os, 'fork'), "needs os.fork()")
-    @unittest.skipIf(sys.platform in platforms_to_skip, "due to known OS bug")
-    def test_5_clear_waiter_locks_to_avoid_crash(self):
-        # Check that a spawned thread that forks doesn't segfault on certain
-        # platforms, namely OS X.  This used to happen if there was a waiter
-        # lock in the thread's condition variable's waiters list.  Even though
-        # we know the lock will be held across the fork, it is not safe to
-        # release locks held across forks on all platforms, so releasing the
-        # waiter lock caused a segfault on OS X.  Furthermore, since locks on
-        # OS X are (as of this writing) implemented with a mutex + condition
-        # variable instead of a semaphore, while we know that the Python-level
-        # lock will be acquired, we can't know if the internal mutex will be
-        # acquired at the time of the fork.
-
-        script = """if True:
-            import os, time, threading
-
-            start_fork = False
-
-            def worker():
-                # Wait until the main thread has attempted to join this thread
-                # before continuing.
-                while not start_fork:
-                    time.sleep(0.01)
-                childpid = os.fork()
-                if childpid != 0:
-                    # Parent process just waits for child.
-                    (cpid, rc) = os.waitpid(childpid, 0)
-                    assert cpid == childpid
-                    assert rc == 0
-                    print('end of worker thread')
-                else:
-                    # Child process should just return.
-                    pass
-
-            w = threading.Thread(target=worker)
-
-            # Stub out the private condition variable's _release_save method.
-            # This releases the condition's lock and flips the global that
-            # causes the worker to fork.  At this point, the problematic waiter
-            # lock has been acquired once by the waiter and has been put onto
-            # the waiters list.
-            condition = w._block
-            orig_release_save = condition._release_save
-            def my_release_save():
-                global start_fork
-                orig_release_save()
-                # Waiter lock held here, condition lock released.
-                start_fork = True
-            condition._release_save = my_release_save
-
-            w.start()
-            w.join()
-            print('end of main thread')
-            """
-        output = "end of worker thread\nend of main thread\n"
-        self.assertScriptHasOutput(script, output)
-
-    @unittest.skipIf(sys.platform in platforms_to_skip, "due to known OS bug")
-    def test_6_daemon_threads(self):
+    def test_4_daemon_threads(self):
         # Check that a daemon thread cannot crash the interpreter on shutdown
         # by manipulating internal structures that are being disposed of in
         # the main thread.
@@ -773,45 +796,111 @@
         for t in threads:
             t.join()
 
+    @unittest.skipUnless(hasattr(os, 'fork'), "needs os.fork()")
+    def test_clear_threads_states_after_fork(self):
+        # Issue #17094: check that threads states are cleared after fork()
+
+        # start a bunch of threads
+        threads = []
+        for i in range(16):
+            t = threading.Thread(target=lambda : time.sleep(0.3))
+            threads.append(t)
+            t.start()
+
+        pid = os.fork()
+        if pid == 0:
+            # check that threads states have been cleared
+            if len(sys._current_frames()) == 1:
+                os._exit(0)
+            else:
+                os._exit(1)
+        else:
+            _, status = os.waitpid(pid, 0)
+            self.assertEqual(0, status)
+
+        for t in threads:
+            t.join()
+
+
+class SubinterpThreadingTests(BaseTestCase):
+
+    def test_threads_join(self):
+        # Non-daemon threads should be joined at subinterpreter shutdown
+        # (issue #18808)
+        r, w = os.pipe()
+        self.addCleanup(os.close, r)
+        self.addCleanup(os.close, w)
+        code = r"""if 1:
+            import os
+            import threading
+            import time
+
+            def f():
+                # Sleep a bit so that the thread is still running when
+                # Py_EndInterpreter is called.
+                time.sleep(0.05)
+                os.write(%d, b"x")
+            threading.Thread(target=f).start()
+            """ % (w,)
+        ret = test.support.run_in_subinterp(code)
+        self.assertEqual(ret, 0)
+        # The thread was joined properly.
+        self.assertEqual(os.read(r, 1), b"x")
+
+    def test_threads_join_2(self):
+        # Same as above, but a delay gets introduced after the thread's
+        # Python code returned but before the thread state is deleted.
+        # To achieve this, we register a thread-local object which sleeps
+        # a bit when deallocated.
+        r, w = os.pipe()
+        self.addCleanup(os.close, r)
+        self.addCleanup(os.close, w)
+        code = r"""if 1:
+            import os
+            import threading
+            import time
+
+            class Sleeper:
+                def __del__(self):
+                    time.sleep(0.05)
+
+            tls = threading.local()
+
+            def f():
+                # Sleep a bit so that the thread is still running when
+                # Py_EndInterpreter is called.
+                time.sleep(0.05)
+                tls.x = Sleeper()
+                os.write(%d, b"x")
+            threading.Thread(target=f).start()
+            """ % (w,)
+        ret = test.support.run_in_subinterp(code)
+        self.assertEqual(ret, 0)
+        # The thread was joined properly.
+        self.assertEqual(os.read(r, 1), b"x")
+
     @cpython_only
-    @unittest.skipIf(_testcapi is None, "need _testcapi module")
-    def test_frame_tstate_tracing(self):
-        # Issue #14432: Crash when a generator is created in a C thread that is
-        # destroyed while the generator is still used. The issue was that a
-        # generator contains a frame, and the frame kept a reference to the
-        # Python state of the destroyed C thread. The crash occurs when a trace
-        # function is setup.
+    def test_daemon_threads_fatal_error(self):
+        subinterp_code = r"""if 1:
+            import os
+            import threading
+            import time
 
-        def noop_trace(frame, event, arg):
-            # no operation
-            return noop_trace
+            def f():
+                # Make sure the daemon thread is still running when
+                # Py_EndInterpreter is called.
+                time.sleep(10)
+            threading.Thread(target=f, daemon=True).start()
+            """
+        script = r"""if 1:
+            import _testcapi
 
-        def generator():
-            while 1:
-                yield "genereator"
-
-        def callback():
-            if callback.gen is None:
-                callback.gen = generator()
-            return next(callback.gen)
-        callback.gen = None
-
-        old_trace = sys.gettrace()
-        sys.settrace(noop_trace)
-        try:
-            # Install a trace function
-            threading.settrace(noop_trace)
-
-            # Create a generator in a C thread which exits after the call
-            _testcapi.call_in_temporary_c_thread(callback)
-
-            # Call the generator in a different Python thread, check that the
-            # generator didn't keep a reference to the destroyed thread state
-            for test in range(3):
-                # The trace function is still called here
-                callback()
-        finally:
-            sys.settrace(old_trace)
+            _testcapi.run_in_subinterp(%r)
+            """ % (subinterp_code,)
+        with test.support.SuppressCrashReport():
+            rc, out, err = assert_python_failure("-c", script)
+        self.assertIn("Fatal Python error: Py_EndInterpreter: "
+                      "not the last thread", err.decode())
 
 
 class ThreadingExceptionTests(BaseTestCase):
@@ -872,6 +961,88 @@
         self.assertEqual(p.returncode, 0, "Unexpected error: " + stderr.decode())
         self.assertEqual(data, expected_output)
 
+    def test_print_exception(self):
+        script = r"""if True:
+            import threading
+            import time
+
+            running = False
+            def run():
+                global running
+                running = True
+                while running:
+                    time.sleep(0.01)
+                1/0
+            t = threading.Thread(target=run)
+            t.start()
+            while not running:
+                time.sleep(0.01)
+            running = False
+            t.join()
+            """
+        rc, out, err = assert_python_ok("-c", script)
+        self.assertEqual(out, b'')
+        err = err.decode()
+        self.assertIn("Exception in thread", err)
+        self.assertIn("Traceback (most recent call last):", err)
+        self.assertIn("ZeroDivisionError", err)
+        self.assertNotIn("Unhandled exception", err)
+
+    def test_print_exception_stderr_is_none_1(self):
+        script = r"""if True:
+            import sys
+            import threading
+            import time
+
+            running = False
+            def run():
+                global running
+                running = True
+                while running:
+                    time.sleep(0.01)
+                1/0
+            t = threading.Thread(target=run)
+            t.start()
+            while not running:
+                time.sleep(0.01)
+            sys.stderr = None
+            running = False
+            t.join()
+            """
+        rc, out, err = assert_python_ok("-c", script)
+        self.assertEqual(out, b'')
+        err = err.decode()
+        self.assertIn("Exception in thread", err)
+        self.assertIn("Traceback (most recent call last):", err)
+        self.assertIn("ZeroDivisionError", err)
+        self.assertNotIn("Unhandled exception", err)
+
+    def test_print_exception_stderr_is_none_2(self):
+        script = r"""if True:
+            import sys
+            import threading
+            import time
+
+            running = False
+            def run():
+                global running
+                running = True
+                while running:
+                    time.sleep(0.01)
+                1/0
+            sys.stderr = None
+            t = threading.Thread(target=run)
+            t.start()
+            while not running:
+                time.sleep(0.01)
+            running = False
+            t.join()
+            """
+        rc, out, err = assert_python_ok("-c", script)
+        self.assertEqual(out, b'')
+        self.assertNotIn("Unhandled exception", err.decode())
+
+
 class TimerTests(BaseTestCase):
 
     def setUp(self):
diff --git a/Lib/test/test_threadsignals.py b/Lib/test/test_threadsignals.py
index f975a75..9d92742 100644
--- a/Lib/test/test_threadsignals.py
+++ b/Lib/test/test_threadsignals.py
@@ -8,7 +8,7 @@
 thread = import_module('_thread')
 import time
 
-if sys.platform[:3] in ('win', 'os2') or sys.platform=='riscos':
+if (sys.platform[:3] == 'win'):
     raise unittest.SkipTest("Can't test signal on %s" % sys.platform)
 
 process_pid = os.getpid()
@@ -74,6 +74,9 @@
 
     @unittest.skipIf(USING_PTHREAD_COND,
                      'POSIX condition variables cannot be interrupted')
+    # Issue #20564: sem_timedwait() cannot be interrupted on OpenBSD
+    @unittest.skipIf(sys.platform.startswith('openbsd'),
+                     'lock cannot be interrupted on OpenBSD')
     def test_lock_acquire_interruption(self):
         # Mimic receiving a SIGINT (KeyboardInterrupt) with SIGALRM while stuck
         # in a deadlock.
@@ -97,6 +100,9 @@
 
     @unittest.skipIf(USING_PTHREAD_COND,
                      'POSIX condition variables cannot be interrupted')
+    # Issue #20564: sem_timedwait() cannot be interrupted on OpenBSD
+    @unittest.skipIf(sys.platform.startswith('openbsd'),
+                     'lock cannot be interrupted on OpenBSD')
     def test_rlock_acquire_interruption(self):
         # Mimic receiving a SIGINT (KeyboardInterrupt) with SIGALRM while stuck
         # in a deadlock.
diff --git a/Lib/test/test_time.py b/Lib/test/test_time.py
index 1a4d873..be7ddcc 100644
--- a/Lib/test/test_time.py
+++ b/Lib/test/test_time.py
@@ -14,6 +14,8 @@
 SIZEOF_INT = sysconfig.get_config_var('SIZEOF_INT') or 4
 TIME_MAXYEAR = (1 << 8 * SIZEOF_INT - 1) - 1
 TIME_MINYEAR = -TIME_MAXYEAR - 1
+_PyTime_ROUND_DOWN = 0
+_PyTime_ROUND_UP = 1
 
 
 class TimeTestCase(unittest.TestCase):
@@ -226,7 +228,7 @@
         self.assertEqual(time.ctime(t), 'Sun Sep 16 01:03:52 1973')
         t = time.mktime((2000, 1, 1, 0, 0, 0, 0, 0, -1))
         self.assertEqual(time.ctime(t), 'Sat Jan  1 00:00:00 2000')
-        for year in [-100, 100, 1000, 2000, 10000]:
+        for year in [-100, 100, 1000, 2000, 2050, 10000]:
             try:
                 testval = time.mktime((year, 1, 10) + (0,)*6)
             except (ValueError, OverflowError):
@@ -344,6 +346,13 @@
     def test_mktime(self):
         # Issue #1726687
         for t in (-2, -1, 0, 1):
+            if sys.platform.startswith('aix') and t == -1:
+                # Issue #11188, #19748: mktime() returns -1 on error. On Linux,
+                # the tm_wday field is used as a sentinel () to detect if -1 is
+                # really an error or a valid timestamp. On AIX, tm_wday is
+                # unchanged even on success and so cannot be used as a
+                # sentinel.
+                continue
             try:
                 tt = time.localtime(t)
             except (OverflowError, OSError):
@@ -371,6 +380,14 @@
     @unittest.skipUnless(hasattr(time, 'monotonic'),
                          'need time.monotonic')
     def test_monotonic(self):
+        # monotonic() should not go backward
+        times = [time.monotonic() for n in range(100)]
+        t1 = times[0]
+        for t2 in times[1:]:
+            self.assertGreaterEqual(t2, t1, "times=%s" % times)
+            t1 = t2
+
+        # monotonic() includes time elapsed during a sleep
         t1 = time.monotonic()
         time.sleep(0.5)
         t2 = time.monotonic()
@@ -379,6 +396,7 @@
         # Issue #20101: On some Windows machines, dt may be slightly low
         self.assertTrue(0.45 <= dt <= 1.0, dt)
 
+        # monotonic() is a monotonic but non adjustable clock
         info = time.get_clock_info('monotonic')
         self.assertTrue(info.monotonic)
         self.assertFalse(info.adjustable)
@@ -576,58 +594,116 @@
     @support.cpython_only
     def test_time_t(self):
         from _testcapi import pytime_object_to_time_t
-        for obj, time_t in (
-            (0, 0),
-            (-1, -1),
-            (-1.0, -1),
-            (-1.9, -1),
-            (1.0, 1),
-            (1.9, 1),
+        for obj, time_t, rnd in (
+            # Round towards zero
+            (0, 0, _PyTime_ROUND_DOWN),
+            (-1, -1, _PyTime_ROUND_DOWN),
+            (-1.0, -1, _PyTime_ROUND_DOWN),
+            (-1.9, -1, _PyTime_ROUND_DOWN),
+            (1.0, 1, _PyTime_ROUND_DOWN),
+            (1.9, 1, _PyTime_ROUND_DOWN),
+            # Round away from zero
+            (0, 0, _PyTime_ROUND_UP),
+            (-1, -1, _PyTime_ROUND_UP),
+            (-1.0, -1, _PyTime_ROUND_UP),
+            (-1.9, -2, _PyTime_ROUND_UP),
+            (1.0, 1, _PyTime_ROUND_UP),
+            (1.9, 2, _PyTime_ROUND_UP),
         ):
-            self.assertEqual(pytime_object_to_time_t(obj), time_t)
+            self.assertEqual(pytime_object_to_time_t(obj, rnd), time_t)
 
+        rnd = _PyTime_ROUND_DOWN
         for invalid in self.invalid_values:
-            self.assertRaises(OverflowError, pytime_object_to_time_t, invalid)
+            self.assertRaises(OverflowError,
+                              pytime_object_to_time_t, invalid, rnd)
 
     @support.cpython_only
     def test_timeval(self):
         from _testcapi import pytime_object_to_timeval
-        for obj, timeval in (
-            (0, (0, 0)),
-            (-1, (-1, 0)),
-            (-1.0, (-1, 0)),
-            (1e-6, (0, 1)),
-            (-1e-6, (-1, 999999)),
-            (-1.2, (-2, 800000)),
-            (1.1234560, (1, 123456)),
-            (1.1234569, (1, 123456)),
-            (-1.1234560, (-2, 876544)),
-            (-1.1234561, (-2, 876543)),
+        for obj, timeval, rnd in (
+            # Round towards zero
+            (0, (0, 0), _PyTime_ROUND_DOWN),
+            (-1, (-1, 0), _PyTime_ROUND_DOWN),
+            (-1.0, (-1, 0), _PyTime_ROUND_DOWN),
+            (1e-6, (0, 1), _PyTime_ROUND_DOWN),
+            (1e-7, (0, 0), _PyTime_ROUND_DOWN),
+            (-1e-6, (-1, 999999), _PyTime_ROUND_DOWN),
+            (-1e-7, (-1, 999999), _PyTime_ROUND_DOWN),
+            (-1.2, (-2, 800000), _PyTime_ROUND_DOWN),
+            (0.9999999, (0, 999999), _PyTime_ROUND_DOWN),
+            (0.0000041, (0, 4), _PyTime_ROUND_DOWN),
+            (1.1234560, (1, 123456), _PyTime_ROUND_DOWN),
+            (1.1234569, (1, 123456), _PyTime_ROUND_DOWN),
+            (-0.0000040, (-1, 999996), _PyTime_ROUND_DOWN),
+            (-0.0000041, (-1, 999995), _PyTime_ROUND_DOWN),
+            (-1.1234560, (-2, 876544), _PyTime_ROUND_DOWN),
+            (-1.1234561, (-2, 876543), _PyTime_ROUND_DOWN),
+            # Round away from zero
+            (0, (0, 0), _PyTime_ROUND_UP),
+            (-1, (-1, 0), _PyTime_ROUND_UP),
+            (-1.0, (-1, 0), _PyTime_ROUND_UP),
+            (1e-6, (0, 1), _PyTime_ROUND_UP),
+            (1e-7, (0, 1), _PyTime_ROUND_UP),
+            (-1e-6, (-1, 999999), _PyTime_ROUND_UP),
+            (-1e-7, (-1, 999999), _PyTime_ROUND_UP),
+            (-1.2, (-2, 800000), _PyTime_ROUND_UP),
+            (0.9999999, (1, 0), _PyTime_ROUND_UP),
+            (0.0000041, (0, 5), _PyTime_ROUND_UP),
+            (1.1234560, (1, 123457), _PyTime_ROUND_UP),
+            (1.1234569, (1, 123457), _PyTime_ROUND_UP),
+            (-0.0000040, (-1, 999996), _PyTime_ROUND_UP),
+            (-0.0000041, (-1, 999995), _PyTime_ROUND_UP),
+            (-1.1234560, (-2, 876544), _PyTime_ROUND_UP),
+            (-1.1234561, (-2, 876543), _PyTime_ROUND_UP),
         ):
-            self.assertEqual(pytime_object_to_timeval(obj), timeval)
+            with self.subTest(obj=obj, round=rnd, timeval=timeval):
+                self.assertEqual(pytime_object_to_timeval(obj, rnd), timeval)
 
+        rnd = _PyTime_ROUND_DOWN
         for invalid in self.invalid_values:
-            self.assertRaises(OverflowError, pytime_object_to_timeval, invalid)
+            self.assertRaises(OverflowError,
+                              pytime_object_to_timeval, invalid, rnd)
 
     @support.cpython_only
     def test_timespec(self):
         from _testcapi import pytime_object_to_timespec
-        for obj, timespec in (
-            (0, (0, 0)),
-            (-1, (-1, 0)),
-            (-1.0, (-1, 0)),
-            (1e-9, (0, 1)),
-            (-1e-9, (-1, 999999999)),
-            (-1.2, (-2, 800000000)),
-            (1.1234567890, (1, 123456789)),
-            (1.1234567899, (1, 123456789)),
-            (-1.1234567890, (-2, 876543211)),
-            (-1.1234567891, (-2, 876543210)),
+        for obj, timespec, rnd in (
+            # Round towards zero
+            (0, (0, 0), _PyTime_ROUND_DOWN),
+            (-1, (-1, 0), _PyTime_ROUND_DOWN),
+            (-1.0, (-1, 0), _PyTime_ROUND_DOWN),
+            (1e-9, (0, 1), _PyTime_ROUND_DOWN),
+            (1e-10, (0, 0), _PyTime_ROUND_DOWN),
+            (-1e-9, (-1, 999999999), _PyTime_ROUND_DOWN),
+            (-1e-10, (-1, 999999999), _PyTime_ROUND_DOWN),
+            (-1.2, (-2, 800000000), _PyTime_ROUND_DOWN),
+            (0.9999999999, (0, 999999999), _PyTime_ROUND_DOWN),
+            (1.1234567890, (1, 123456789), _PyTime_ROUND_DOWN),
+            (1.1234567899, (1, 123456789), _PyTime_ROUND_DOWN),
+            (-1.1234567890, (-2, 876543211), _PyTime_ROUND_DOWN),
+            (-1.1234567891, (-2, 876543210), _PyTime_ROUND_DOWN),
+            # Round away from zero
+            (0, (0, 0), _PyTime_ROUND_UP),
+            (-1, (-1, 0), _PyTime_ROUND_UP),
+            (-1.0, (-1, 0), _PyTime_ROUND_UP),
+            (1e-9, (0, 1), _PyTime_ROUND_UP),
+            (1e-10, (0, 1), _PyTime_ROUND_UP),
+            (-1e-9, (-1, 999999999), _PyTime_ROUND_UP),
+            (-1e-10, (-1, 999999999), _PyTime_ROUND_UP),
+            (-1.2, (-2, 800000000), _PyTime_ROUND_UP),
+            (0.9999999999, (1, 0), _PyTime_ROUND_UP),
+            (1.1234567890, (1, 123456790), _PyTime_ROUND_UP),
+            (1.1234567899, (1, 123456790), _PyTime_ROUND_UP),
+            (-1.1234567890, (-2, 876543211), _PyTime_ROUND_UP),
+            (-1.1234567891, (-2, 876543210), _PyTime_ROUND_UP),
         ):
-            self.assertEqual(pytime_object_to_timespec(obj), timespec)
+            with self.subTest(obj=obj, round=rnd, timespec=timespec):
+                self.assertEqual(pytime_object_to_timespec(obj, rnd), timespec)
 
+        rnd = _PyTime_ROUND_DOWN
         for invalid in self.invalid_values:
-            self.assertRaises(OverflowError, pytime_object_to_timespec, invalid)
+            self.assertRaises(OverflowError,
+                              pytime_object_to_timespec, invalid, rnd)
 
     @unittest.skipUnless(time._STRUCT_TM_ITEMS == 11, "needs tm_zone support")
     def test_localtime_timezone(self):
diff --git a/Lib/test/test_timeit.py b/Lib/test/test_timeit.py
index 625fb8d..09e76e0 100644
--- a/Lib/test/test_timeit.py
+++ b/Lib/test/test_timeit.py
@@ -73,9 +73,21 @@
 
     def test_timer_invalid_stmt(self):
         self.assertRaises(ValueError, timeit.Timer, stmt=None)
+        self.assertRaises(SyntaxError, timeit.Timer, stmt='return')
+        self.assertRaises(SyntaxError, timeit.Timer, stmt='yield')
+        self.assertRaises(SyntaxError, timeit.Timer, stmt='yield from ()')
+        self.assertRaises(SyntaxError, timeit.Timer, stmt='break')
+        self.assertRaises(SyntaxError, timeit.Timer, stmt='continue')
+        self.assertRaises(SyntaxError, timeit.Timer, stmt='from timeit import *')
 
     def test_timer_invalid_setup(self):
         self.assertRaises(ValueError, timeit.Timer, setup=None)
+        self.assertRaises(SyntaxError, timeit.Timer, setup='return')
+        self.assertRaises(SyntaxError, timeit.Timer, setup='yield')
+        self.assertRaises(SyntaxError, timeit.Timer, setup='yield from ()')
+        self.assertRaises(SyntaxError, timeit.Timer, setup='break')
+        self.assertRaises(SyntaxError, timeit.Timer, setup='continue')
+        self.assertRaises(SyntaxError, timeit.Timer, setup='from timeit import *')
 
     fake_setup = "import timeit; timeit._fake_timer.setup()"
     fake_stmt = "import timeit; timeit._fake_timer.inc()"
diff --git a/Lib/test/test_timeout.py b/Lib/test/test_timeout.py
index dcf201b..703c43a 100644
--- a/Lib/test/test_timeout.py
+++ b/Lib/test/test_timeout.py
@@ -207,7 +207,7 @@
             sock.connect((whitehole))
         except socket.timeout:
             pass
-        except IOError as err:
+        except OSError as err:
             if err.errno == errno.ECONNREFUSED:
                 skip = False
         finally:
diff --git a/Lib/test/test_tk.py b/Lib/test/test_tk.py
index 7551a7f..62729f0 100644
--- a/Lib/test/test_tk.py
+++ b/Lib/test/test_tk.py
@@ -6,20 +6,13 @@
 support.import_fresh_module('tkinter')
 
 # Skip test if tk cannot be initialized.
-from tkinter.test.support import check_tk_availability
-check_tk_availability()
+support.requires('gui')
 
 from tkinter.test import runtktests
 
-def test_main(enable_gui=False):
-    if enable_gui:
-        if support.use_resources is None:
-            support.use_resources = ['gui']
-        elif 'gui' not in support.use_resources:
-            support.use_resources.append('gui')
-
+def test_main():
     support.run_unittest(
             *runtktests.get_tests(text=False, packages=['test_tkinter']))
 
 if __name__ == '__main__':
-    test_main(enable_gui=True)
+    test_main()
diff --git a/Lib/test/test_tools/__init__.py b/Lib/test/test_tools/__init__.py
new file mode 100644
index 0000000..04c8726
--- /dev/null
+++ b/Lib/test/test_tools/__init__.py
@@ -0,0 +1,25 @@
+"""Support functions for testing scripts in the Tools directory."""
+import os
+import unittest
+import importlib
+from test import support
+from fnmatch import fnmatch
+
+basepath = os.path.dirname(                 # <src/install dir>
+                os.path.dirname(                # Lib
+                    os.path.dirname(                # test
+                        os.path.dirname(__file__))))    # test_tools
+
+toolsdir = os.path.join(basepath, 'Tools')
+scriptsdir = os.path.join(toolsdir, 'scripts')
+
+def skip_if_missing():
+    if not os.path.isdir(scriptsdir):
+        raise unittest.SkipTest('scripts directory could not be found')
+
+def import_tool(toolname):
+    with support.DirsOnSysPath(scriptsdir):
+        return importlib.import_module(toolname)
+
+def load_tests(*args):
+    return support.load_package_tests(os.path.dirname(__file__), *args)
diff --git a/Lib/test/test_tools/__main__.py b/Lib/test/test_tools/__main__.py
new file mode 100644
index 0000000..b6f13e5
--- /dev/null
+++ b/Lib/test/test_tools/__main__.py
@@ -0,0 +1,4 @@
+from test.test_tools import load_tests
+import unittest
+
+unittest.main()
diff --git a/Lib/test/test_tools/test_gprof2html.py b/Lib/test/test_tools/test_gprof2html.py
new file mode 100644
index 0000000..845a2a8
--- /dev/null
+++ b/Lib/test/test_tools/test_gprof2html.py
@@ -0,0 +1,36 @@
+"""Tests for the gprof2html script in the Tools directory."""
+
+import os
+import sys
+import importlib
+import unittest
+from unittest import mock
+import tempfile
+
+from test.test_tools import scriptsdir, skip_if_missing, import_tool
+
+skip_if_missing()
+
+class Gprof2htmlTests(unittest.TestCase):
+
+    def setUp(self):
+        self.gprof = import_tool('gprof2html')
+        oldargv = sys.argv
+        def fixup():
+            sys.argv = oldargv
+        self.addCleanup(fixup)
+        sys.argv = []
+
+    def test_gprof(self):
+        # Issue #14508: this used to fail with an NameError.
+        with mock.patch.object(self.gprof, 'webbrowser') as wmock, \
+                tempfile.TemporaryDirectory() as tmpdir:
+            fn = os.path.join(tmpdir, 'abc')
+            open(fn, 'w').close()
+            sys.argv = ['gprof2html', fn]
+            self.gprof.main()
+        self.assertTrue(wmock.open.called)
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Lib/test/test_tools/test_md5sum.py b/Lib/test/test_tools/test_md5sum.py
new file mode 100644
index 0000000..59ea149
--- /dev/null
+++ b/Lib/test/test_tools/test_md5sum.py
@@ -0,0 +1,77 @@
+"""Tests for the md5sum script in the Tools directory."""
+
+import os
+import sys
+import unittest
+from test import support
+from test.script_helper import assert_python_ok, assert_python_failure
+
+from test.test_tools import scriptsdir, import_tool, skip_if_missing
+
+skip_if_missing()
+
+class MD5SumTests(unittest.TestCase):
+    @classmethod
+    def setUpClass(cls):
+        cls.script = os.path.join(scriptsdir, 'md5sum.py')
+        os.mkdir(support.TESTFN)
+        cls.fodder = os.path.join(support.TESTFN, 'md5sum.fodder')
+        with open(cls.fodder, 'wb') as f:
+            f.write(b'md5sum\r\ntest file\r\n')
+        cls.fodder_md5 = b'd38dae2eb1ab346a292ef6850f9e1a0d'
+        cls.fodder_textmode_md5 = b'a8b07894e2ca3f2a4c3094065fa6e0a5'
+
+    @classmethod
+    def tearDownClass(cls):
+        support.rmtree(support.TESTFN)
+
+    def test_noargs(self):
+        rc, out, err = assert_python_ok(self.script)
+        self.assertEqual(rc, 0)
+        self.assertTrue(
+            out.startswith(b'd41d8cd98f00b204e9800998ecf8427e <stdin>'))
+        self.assertFalse(err)
+
+    def test_checksum_fodder(self):
+        rc, out, err = assert_python_ok(self.script, self.fodder)
+        self.assertEqual(rc, 0)
+        self.assertTrue(out.startswith(self.fodder_md5))
+        for part in self.fodder.split(os.path.sep):
+            self.assertIn(part.encode(), out)
+        self.assertFalse(err)
+
+    def test_dash_l(self):
+        rc, out, err = assert_python_ok(self.script, '-l', self.fodder)
+        self.assertEqual(rc, 0)
+        self.assertIn(self.fodder_md5, out)
+        parts = self.fodder.split(os.path.sep)
+        self.assertIn(parts[-1].encode(), out)
+        self.assertNotIn(parts[-2].encode(), out)
+
+    def test_dash_t(self):
+        rc, out, err = assert_python_ok(self.script, '-t', self.fodder)
+        self.assertEqual(rc, 0)
+        self.assertTrue(out.startswith(self.fodder_textmode_md5))
+        self.assertNotIn(self.fodder_md5, out)
+
+    def test_dash_s(self):
+        rc, out, err = assert_python_ok(self.script, '-s', '512', self.fodder)
+        self.assertEqual(rc, 0)
+        self.assertIn(self.fodder_md5, out)
+
+    def test_multiple_files(self):
+        rc, out, err = assert_python_ok(self.script, self.fodder, self.fodder)
+        self.assertEqual(rc, 0)
+        lines = out.splitlines()
+        self.assertEqual(len(lines), 2)
+        self.assertEqual(*lines)
+
+    def test_usage(self):
+        rc, out, err = assert_python_failure(self.script, '-h')
+        self.assertEqual(rc, 2)
+        self.assertEqual(out, b'')
+        self.assertGreater(err, b'')
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Lib/test/test_tools/test_pdeps.py b/Lib/test/test_tools/test_pdeps.py
new file mode 100644
index 0000000..091fa6a
--- /dev/null
+++ b/Lib/test/test_tools/test_pdeps.py
@@ -0,0 +1,34 @@
+"""Tests for the pdeps script in the Tools directory."""
+
+import os
+import sys
+import unittest
+import tempfile
+from test import support
+
+from test.test_tools import scriptsdir, skip_if_missing, import_tool
+
+skip_if_missing()
+
+
+class PdepsTests(unittest.TestCase):
+
+    @classmethod
+    def setUpClass(self):
+        self.pdeps = import_tool('pdeps')
+
+    def test_process_errors(self):
+        # Issue #14492: m_import.match(line) can be None.
+        with tempfile.TemporaryDirectory() as tmpdir:
+            fn = os.path.join(tmpdir, 'foo')
+            with open(fn, 'w') as stream:
+                stream.write("#!/this/will/fail")
+            self.pdeps.process(fn, {})
+
+    def test_inverse_attribute_error(self):
+        # Issue #14492: this used to fail with an AttributeError.
+        self.pdeps.inverse({'a': []})
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Lib/test/test_tools.py b/Lib/test/test_tools/test_pindent.py
similarity index 65%
rename from Lib/test/test_tools.py
rename to Lib/test/test_tools/test_pindent.py
index f971515..14a0aa2 100644
--- a/Lib/test/test_tools.py
+++ b/Lib/test/test_tools/test_pindent.py
@@ -1,42 +1,16 @@
-"""Tests for scripts in the Tools directory.
-
-This file contains regression tests for some of the scripts found in the
-Tools directory of a Python checkout or tarball, such as reindent.py.
-"""
+"""Tests for the pindent script in the Tools directory."""
 
 import os
 import sys
-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, temp_dir
+from test.script_helper import assert_python_ok
 
-if not sysconfig.is_python_build():
-    # XXX some installers do contain the tools, should we detect that
-    # and run the tests in that case too?
-    raise unittest.SkipTest('test irrelevant for an installed Python')
+from test.test_tools import scriptsdir, skip_if_missing
 
-basepath = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))),
-                        'Tools')
-scriptsdir = os.path.join(basepath, 'scripts')
-
-
-class ReindentTests(unittest.TestCase):
-    script = os.path.join(scriptsdir, 'reindent.py')
-
-    def test_noargs(self):
-        assert_python_ok(self.script)
-
-    def test_help(self):
-        rc, out, err = assert_python_ok(self.script, '-h')
-        self.assertEqual(out, b'')
-        self.assertGreater(err, b'')
+skip_if_missing()
 
 
 class PindentTests(unittest.TestCase):
@@ -60,7 +34,7 @@
 
     def test_selftest(self):
         self.maxDiff = None
-        with temp_dir() as directory:
+        with support.temp_dir() as directory:
             data_path = os.path.join(directory, '_test.py')
             with open(self.script) as f:
                 closed = f.read()
@@ -361,104 +335,5 @@
         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.
-
-    # scripts that have independent tests.
-    whitelist = ['reindent.py', 'pdeps.py', 'gprof2html']
-    # scripts that can't be imported without running
-    blacklist = ['make_ctype.py']
-    # scripts that use windows-only modules
-    windows_only = ['win_add2path.py']
-    # blacklisted for other reasons
-    other = ['analyze_dxp.py']
-
-    skiplist = blacklist + whitelist + windows_only + other
-
-    def setUp(self):
-        cm = support.DirsOnSysPath(scriptsdir)
-        cm.__enter__()
-        self.addCleanup(cm.__exit__)
-
-    def test_sundry(self):
-        for fn in os.listdir(scriptsdir):
-            if fn.endswith('.py') and fn not in self.skiplist:
-                __import__(fn[:-3])
-
-    @unittest.skipIf(sys.platform != "win32", "Windows-only test")
-    def test_sundry_windows(self):
-        for fn in self.windows_only:
-            __import__(fn[:-3])
-
-    @unittest.skipIf(not support.threading, "test requires _thread module")
-    def test_analyze_dxp_import(self):
-        if hasattr(sys, 'getdxp'):
-            import analyze_dxp
-        else:
-            with self.assertRaises(RuntimeError):
-                import analyze_dxp
-
-
-class PdepsTests(unittest.TestCase):
-
-    @classmethod
-    def setUpClass(self):
-        path = os.path.join(scriptsdir, 'pdeps.py')
-        loader = importlib.machinery.SourceFileLoader('pdeps', path)
-        self.pdeps = loader.load_module()
-
-    @classmethod
-    def tearDownClass(self):
-        if 'pdeps' in sys.modules:
-            del sys.modules['pdeps']
-
-    def test_process_errors(self):
-        # Issue #14492: m_import.match(line) can be None.
-        with tempfile.TemporaryDirectory() as tmpdir:
-            fn = os.path.join(tmpdir, 'foo')
-            with open(fn, 'w') as stream:
-                stream.write("#!/this/will/fail")
-            self.pdeps.process(fn, {})
-
-    def test_inverse_attribute_error(self):
-        # Issue #14492: this used to fail with an AttributeError.
-        self.pdeps.inverse({'a': []})
-
-
-class Gprof2htmlTests(unittest.TestCase):
-
-    def setUp(self):
-        path = os.path.join(scriptsdir, 'gprof2html.py')
-        loader = importlib.machinery.SourceFileLoader('gprof2html', path)
-        self.gprof = loader.load_module()
-        oldargv = sys.argv
-        def fixup():
-            sys.argv = oldargv
-        self.addCleanup(fixup)
-        sys.argv = []
-
-    def test_gprof(self):
-        # Issue #14508: this used to fail with an NameError.
-        with mock.patch.object(self.gprof, 'webbrowser') as wmock, \
-                tempfile.TemporaryDirectory() as tmpdir:
-            fn = os.path.join(tmpdir, 'abc')
-            open(fn, 'w').close()
-            sys.argv = ['gprof2html', fn]
-            self.gprof.main()
-        self.assertTrue(wmock.open.called)
-
-
-# Run the tests in Tools/parser/test_unparse.py
-with support.DirsOnSysPath(os.path.join(basepath, 'parser')):
-    from test_unparse import UnparseTestCase
-    from test_unparse import DirectoryTestCase
-
-
-def test_main():
-    support.run_unittest(*[obj for obj in globals().values()
-                               if isinstance(obj, type)])
-
-
 if __name__ == '__main__':
     unittest.main()
diff --git a/Lib/test/test_tools/test_reindent.py b/Lib/test/test_tools/test_reindent.py
new file mode 100644
index 0000000..45cebf7
--- /dev/null
+++ b/Lib/test/test_tools/test_reindent.py
@@ -0,0 +1,28 @@
+"""Tests for scripts in the Tools directory.
+
+This file contains regression tests for some of the scripts found in the
+Tools directory of a Python checkout or tarball, such as reindent.py.
+"""
+
+import os
+import unittest
+from test.script_helper import assert_python_ok
+
+from test.test_tools import scriptsdir, skip_if_missing
+
+skip_if_missing()
+
+class ReindentTests(unittest.TestCase):
+    script = os.path.join(scriptsdir, 'reindent.py')
+
+    def test_noargs(self):
+        assert_python_ok(self.script)
+
+    def test_help(self):
+        rc, out, err = assert_python_ok(self.script, '-h')
+        self.assertEqual(out, b'')
+        self.assertGreater(err, b'')
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Lib/test/test_tools/test_sundry.py b/Lib/test/test_tools/test_sundry.py
new file mode 100644
index 0000000..39e541b
--- /dev/null
+++ b/Lib/test/test_tools/test_sundry.py
@@ -0,0 +1,53 @@
+"""Tests for scripts in the Tools directory.
+
+This file contains extremely basic regression tests for the scripts found in
+the Tools directory of a Python checkout or tarball which don't have separate
+tests of their own, such as h2py.py.
+"""
+
+import os
+import sys
+import unittest
+from test import support
+
+from test.test_tools import scriptsdir, import_tool, skip_if_missing
+
+skip_if_missing()
+
+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.
+
+    # scripts that have independent tests.
+    whitelist = ['reindent', 'pdeps', 'gprof2html', 'md5sum']
+    # scripts that can't be imported without running
+    blacklist = ['make_ctype']
+    # scripts that use windows-only modules
+    windows_only = ['win_add2path']
+    # blacklisted for other reasons
+    other = ['analyze_dxp']
+
+    skiplist = blacklist + whitelist + windows_only + other
+
+    def test_sundry(self):
+        for fn in os.listdir(scriptsdir):
+            name = fn[:-3]
+            if fn.endswith('.py') and name not in self.skiplist:
+                import_tool(name)
+
+    @unittest.skipIf(sys.platform != "win32", "Windows-only test")
+    def test_sundry_windows(self):
+        for name in self.windows_only:
+            import_tool(name)
+
+    @unittest.skipIf(not support.threading, "test requires _thread module")
+    def test_analyze_dxp_import(self):
+        if hasattr(sys, 'getdxp'):
+            import_tool('analyze_dxp')
+        else:
+            with self.assertRaises(RuntimeError):
+                import_tool('analyze_dxp')
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Tools/parser/test_unparse.py b/Lib/test/test_tools/test_unparse.py
similarity index 94%
rename from Tools/parser/test_unparse.py
rename to Lib/test/test_tools/test_unparse.py
index be84400..976a6c5 100644
--- a/Tools/parser/test_unparse.py
+++ b/Lib/test/test_tools/test_unparse.py
@@ -1,12 +1,22 @@
+"""Tests for the unparse.py script in the Tools/parser directory."""
+
 import unittest
 import test.support
 import io
 import os
 import random
 import tokenize
-import unparse
 import ast
 
+from test.test_tools import basepath, toolsdir, skip_if_missing
+
+skip_if_missing()
+
+parser_path = os.path.join(toolsdir, "parser")
+
+with test.support.DirsOnSysPath(parser_path):
+    import unparse
+
 def read_pyfile(filename):
     """Read and return the contents of a Python source file (as a
     string), taking into account the file encoding."""
@@ -249,11 +259,10 @@
 
     def test_files(self):
         # get names of files to test
-        dist_dir = os.path.join(os.path.dirname(__file__), os.pardir, os.pardir)
 
         names = []
         for d in self.test_directories:
-            test_dir = os.path.join(dist_dir, d)
+            test_dir = os.path.join(basepath, d)
             for n in os.listdir(test_dir):
                 if n.endswith('.py') and not n.startswith('bad'):
                     names.append(os.path.join(test_dir, n))
@@ -269,8 +278,5 @@
             self.check_roundtrip(source)
 
 
-def test_main():
-    test.support.run_unittest(UnparseTestCase, DirectoryTestCase)
-
 if __name__ == '__main__':
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_traceback.py b/Lib/test/test_traceback.py
index c38c65b..c295563 100644
--- a/Lib/test/test_traceback.py
+++ b/Lib/test/test_traceback.py
@@ -172,32 +172,76 @@
 
 class TracebackFormatTests(unittest.TestCase):
 
+    def some_exception(self):
+        raise KeyError('blah')
+
     @cpython_only
-    def test_traceback_format(self):
+    def check_traceback_format(self, cleanup_func=None):
         from _testcapi import traceback_print
         try:
-            raise KeyError('blah')
+            self.some_exception()
         except KeyError:
             type_, value, tb = sys.exc_info()
+            if cleanup_func is not None:
+                # Clear the inner frames, not this one
+                cleanup_func(tb.tb_next)
             traceback_fmt = 'Traceback (most recent call last):\n' + \
                             ''.join(traceback.format_tb(tb))
             file_ = StringIO()
             traceback_print(tb, file_)
             python_fmt  = file_.getvalue()
+            # Call all _tb and _exc functions
+            with captured_output("stderr") as tbstderr:
+                traceback.print_tb(tb)
+            tbfile = StringIO()
+            traceback.print_tb(tb, file=tbfile)
+            with captured_output("stderr") as excstderr:
+                traceback.print_exc()
+            excfmt = traceback.format_exc()
+            excfile = StringIO()
+            traceback.print_exc(file=excfile)
         else:
             raise Error("unable to create test traceback string")
 
         # Make sure that Python and the traceback module format the same thing
         self.assertEqual(traceback_fmt, python_fmt)
+        # Now verify the _tb func output
+        self.assertEqual(tbstderr.getvalue(), tbfile.getvalue())
+        # Now verify the _exc func output
+        self.assertEqual(excstderr.getvalue(), excfile.getvalue())
+        self.assertEqual(excfmt, excfile.getvalue())
 
         # Make sure that the traceback is properly indented.
         tb_lines = python_fmt.splitlines()
-        self.assertEqual(len(tb_lines), 3)
-        banner, location, source_line = tb_lines
+        self.assertEqual(len(tb_lines), 5)
+        banner = tb_lines[0]
+        location, source_line = tb_lines[-2:]
         self.assertTrue(banner.startswith('Traceback'))
         self.assertTrue(location.startswith('  File'))
         self.assertTrue(source_line.startswith('    raise'))
 
+    def test_traceback_format(self):
+        self.check_traceback_format()
+
+    def test_traceback_format_with_cleared_frames(self):
+        # Check that traceback formatting also works with a clear()ed frame
+        def cleanup_tb(tb):
+            tb.tb_frame.clear()
+        self.check_traceback_format(cleanup_tb)
+
+    def test_stack_format(self):
+        # Verify _stack functions. Note we have to use _getframe(1) to
+        # compare them without this frame appearing in the output
+        with captured_output("stderr") as ststderr:
+            traceback.print_stack(sys._getframe(1))
+        stfile = StringIO()
+        traceback.print_stack(sys._getframe(1), file=stfile)
+        self.assertEqual(ststderr.getvalue(), stfile.getvalue())
+
+        stfmt = traceback.format_stack(sys._getframe(1))
+
+        self.assertEqual(ststderr.getvalue(), "".join(stfmt))
+
 
 cause_message = (
     "\nThe above exception was the direct cause "
@@ -370,6 +414,36 @@
         return s.getvalue()
 
 
+class MiscTracebackCases(unittest.TestCase):
+    #
+    # Check non-printing functions in traceback module
+    #
+
+    def test_clear(self):
+        def outer():
+            middle()
+        def middle():
+            inner()
+        def inner():
+            i = 1
+            1/0
+
+        try:
+            outer()
+        except:
+            type_, value, tb = sys.exc_info()
+
+        # Initial assertion: there's one local in the inner frame.
+        inner_frame = tb.tb_next.tb_next.tb_next.tb_frame
+        self.assertEqual(len(inner_frame.f_locals), 1)
+
+        # Clear traceback frames
+        traceback.clear_frames(tb)
+
+        # Local variable dict should now be empty.
+        self.assertEqual(len(inner_frame.f_locals), 0)
+
+
 def test_main():
     run_unittest(__name__)
 
diff --git a/Lib/test/test_tracemalloc.py b/Lib/test/test_tracemalloc.py
new file mode 100644
index 0000000..bc22450
--- /dev/null
+++ b/Lib/test/test_tracemalloc.py
@@ -0,0 +1,828 @@
+import contextlib
+import os
+import sys
+import tracemalloc
+import unittest
+from unittest.mock import patch
+from test.script_helper import assert_python_ok, assert_python_failure
+from test import support
+try:
+    import threading
+except ImportError:
+    threading = None
+
+EMPTY_STRING_SIZE = sys.getsizeof(b'')
+
+def get_frames(nframe, lineno_delta):
+    frames = []
+    frame = sys._getframe(1)
+    for index in range(nframe):
+        code = frame.f_code
+        lineno = frame.f_lineno + lineno_delta
+        frames.append((code.co_filename, lineno))
+        lineno_delta = 0
+        frame = frame.f_back
+        if frame is None:
+            break
+    return tuple(frames)
+
+def allocate_bytes(size):
+    nframe = tracemalloc.get_traceback_limit()
+    bytes_len = (size - EMPTY_STRING_SIZE)
+    frames = get_frames(nframe, 1)
+    data = b'x' * bytes_len
+    return data, tracemalloc.Traceback(frames)
+
+def create_snapshots():
+    traceback_limit = 2
+
+    raw_traces = [
+        (10, (('a.py', 2), ('b.py', 4))),
+        (10, (('a.py', 2), ('b.py', 4))),
+        (10, (('a.py', 2), ('b.py', 4))),
+
+        (2, (('a.py', 5), ('b.py', 4))),
+
+        (66, (('b.py', 1),)),
+
+        (7, (('<unknown>', 0),)),
+    ]
+    snapshot = tracemalloc.Snapshot(raw_traces, traceback_limit)
+
+    raw_traces2 = [
+        (10, (('a.py', 2), ('b.py', 4))),
+        (10, (('a.py', 2), ('b.py', 4))),
+        (10, (('a.py', 2), ('b.py', 4))),
+
+        (2, (('a.py', 5), ('b.py', 4))),
+        (5000, (('a.py', 5), ('b.py', 4))),
+
+        (400, (('c.py', 578),)),
+    ]
+    snapshot2 = tracemalloc.Snapshot(raw_traces2, traceback_limit)
+
+    return (snapshot, snapshot2)
+
+def frame(filename, lineno):
+    return tracemalloc._Frame((filename, lineno))
+
+def traceback(*frames):
+    return tracemalloc.Traceback(frames)
+
+def traceback_lineno(filename, lineno):
+    return traceback((filename, lineno))
+
+def traceback_filename(filename):
+    return traceback_lineno(filename, 0)
+
+
+class TestTracemallocEnabled(unittest.TestCase):
+    def setUp(self):
+        if tracemalloc.is_tracing():
+            self.skipTest("tracemalloc must be stopped before the test")
+
+        tracemalloc.start(1)
+
+    def tearDown(self):
+        tracemalloc.stop()
+
+    def test_get_tracemalloc_memory(self):
+        data = [allocate_bytes(123) for count in range(1000)]
+        size = tracemalloc.get_tracemalloc_memory()
+        self.assertGreaterEqual(size, 0)
+
+        tracemalloc.clear_traces()
+        size2 = tracemalloc.get_tracemalloc_memory()
+        self.assertGreaterEqual(size2, 0)
+        self.assertLessEqual(size2, size)
+
+    def test_get_object_traceback(self):
+        tracemalloc.clear_traces()
+        obj_size = 12345
+        obj, obj_traceback = allocate_bytes(obj_size)
+        traceback = tracemalloc.get_object_traceback(obj)
+        self.assertEqual(traceback, obj_traceback)
+
+    def test_set_traceback_limit(self):
+        obj_size = 10
+
+        tracemalloc.stop()
+        self.assertRaises(ValueError, tracemalloc.start, -1)
+
+        tracemalloc.stop()
+        tracemalloc.start(10)
+        obj2, obj2_traceback = allocate_bytes(obj_size)
+        traceback = tracemalloc.get_object_traceback(obj2)
+        self.assertEqual(len(traceback), 10)
+        self.assertEqual(traceback, obj2_traceback)
+
+        tracemalloc.stop()
+        tracemalloc.start(1)
+        obj, obj_traceback = allocate_bytes(obj_size)
+        traceback = tracemalloc.get_object_traceback(obj)
+        self.assertEqual(len(traceback), 1)
+        self.assertEqual(traceback, obj_traceback)
+
+    def find_trace(self, traces, traceback):
+        for trace in traces:
+            if trace[1] == traceback._frames:
+                return trace
+
+        self.fail("trace not found")
+
+    def test_get_traces(self):
+        tracemalloc.clear_traces()
+        obj_size = 12345
+        obj, obj_traceback = allocate_bytes(obj_size)
+
+        traces = tracemalloc._get_traces()
+        trace = self.find_trace(traces, obj_traceback)
+
+        self.assertIsInstance(trace, tuple)
+        size, traceback = trace
+        self.assertEqual(size, obj_size)
+        self.assertEqual(traceback, obj_traceback._frames)
+
+        tracemalloc.stop()
+        self.assertEqual(tracemalloc._get_traces(), [])
+
+    def test_get_traces_intern_traceback(self):
+        # dummy wrappers to get more useful and identical frames in the traceback
+        def allocate_bytes2(size):
+            return allocate_bytes(size)
+        def allocate_bytes3(size):
+            return allocate_bytes2(size)
+        def allocate_bytes4(size):
+            return allocate_bytes3(size)
+
+        # Ensure that two identical tracebacks are not duplicated
+        tracemalloc.stop()
+        tracemalloc.start(4)
+        obj_size = 123
+        obj1, obj1_traceback = allocate_bytes4(obj_size)
+        obj2, obj2_traceback = allocate_bytes4(obj_size)
+
+        traces = tracemalloc._get_traces()
+
+        trace1 = self.find_trace(traces, obj1_traceback)
+        trace2 = self.find_trace(traces, obj2_traceback)
+        size1, traceback1 = trace1
+        size2, traceback2 = trace2
+        self.assertEqual(traceback2, traceback1)
+        self.assertIs(traceback2, traceback1)
+
+    def test_get_traced_memory(self):
+        # Python allocates some internals objects, so the test must tolerate
+        # a small difference between the expected size and the real usage
+        max_error = 2048
+
+        # allocate one object
+        obj_size = 1024 * 1024
+        tracemalloc.clear_traces()
+        obj, obj_traceback = allocate_bytes(obj_size)
+        size, peak_size = tracemalloc.get_traced_memory()
+        self.assertGreaterEqual(size, obj_size)
+        self.assertGreaterEqual(peak_size, size)
+
+        self.assertLessEqual(size - obj_size, max_error)
+        self.assertLessEqual(peak_size - size, max_error)
+
+        # destroy the object
+        obj = None
+        size2, peak_size2 = tracemalloc.get_traced_memory()
+        self.assertLess(size2, size)
+        self.assertGreaterEqual(size - size2, obj_size - max_error)
+        self.assertGreaterEqual(peak_size2, peak_size)
+
+        # clear_traces() must reset traced memory counters
+        tracemalloc.clear_traces()
+        self.assertEqual(tracemalloc.get_traced_memory(), (0, 0))
+
+        # allocate another object
+        obj, obj_traceback = allocate_bytes(obj_size)
+        size, peak_size = tracemalloc.get_traced_memory()
+        self.assertGreaterEqual(size, obj_size)
+
+        # stop() also resets traced memory counters
+        tracemalloc.stop()
+        self.assertEqual(tracemalloc.get_traced_memory(), (0, 0))
+
+    def test_clear_traces(self):
+        obj, obj_traceback = allocate_bytes(123)
+        traceback = tracemalloc.get_object_traceback(obj)
+        self.assertIsNotNone(traceback)
+
+        tracemalloc.clear_traces()
+        traceback2 = tracemalloc.get_object_traceback(obj)
+        self.assertIsNone(traceback2)
+
+    def test_is_tracing(self):
+        tracemalloc.stop()
+        self.assertFalse(tracemalloc.is_tracing())
+
+        tracemalloc.start()
+        self.assertTrue(tracemalloc.is_tracing())
+
+    def test_snapshot(self):
+        obj, source = allocate_bytes(123)
+
+        # take a snapshot
+        snapshot = tracemalloc.take_snapshot()
+
+        # write on disk
+        snapshot.dump(support.TESTFN)
+        self.addCleanup(support.unlink, support.TESTFN)
+
+        # load from disk
+        snapshot2 = tracemalloc.Snapshot.load(support.TESTFN)
+        self.assertEqual(snapshot2.traces, snapshot.traces)
+
+        # tracemalloc must be tracing memory allocations to take a snapshot
+        tracemalloc.stop()
+        with self.assertRaises(RuntimeError) as cm:
+            tracemalloc.take_snapshot()
+        self.assertEqual(str(cm.exception),
+                         "the tracemalloc module must be tracing memory "
+                         "allocations to take a snapshot")
+
+    def test_snapshot_save_attr(self):
+        # take a snapshot with a new attribute
+        snapshot = tracemalloc.take_snapshot()
+        snapshot.test_attr = "new"
+        snapshot.dump(support.TESTFN)
+        self.addCleanup(support.unlink, support.TESTFN)
+
+        # load() should recreates the attribute
+        snapshot2 = tracemalloc.Snapshot.load(support.TESTFN)
+        self.assertEqual(snapshot2.test_attr, "new")
+
+    def fork_child(self):
+        if not tracemalloc.is_tracing():
+            return 2
+
+        obj_size = 12345
+        obj, obj_traceback = allocate_bytes(obj_size)
+        traceback = tracemalloc.get_object_traceback(obj)
+        if traceback is None:
+            return 3
+
+        # everything is fine
+        return 0
+
+    @unittest.skipUnless(hasattr(os, 'fork'), 'need os.fork()')
+    def test_fork(self):
+        # check that tracemalloc is still working after fork
+        pid = os.fork()
+        if not pid:
+            # child
+            exitcode = 1
+            try:
+                exitcode = self.fork_child()
+            finally:
+                os._exit(exitcode)
+        else:
+            pid2, status = os.waitpid(pid, 0)
+            self.assertTrue(os.WIFEXITED(status))
+            exitcode = os.WEXITSTATUS(status)
+            self.assertEqual(exitcode, 0)
+
+
+class TestSnapshot(unittest.TestCase):
+    maxDiff = 4000
+
+    def test_create_snapshot(self):
+        raw_traces = [(5, (('a.py', 2),))]
+
+        with contextlib.ExitStack() as stack:
+            stack.enter_context(patch.object(tracemalloc, 'is_tracing',
+                                             return_value=True))
+            stack.enter_context(patch.object(tracemalloc, 'get_traceback_limit',
+                                             return_value=5))
+            stack.enter_context(patch.object(tracemalloc, '_get_traces',
+                                             return_value=raw_traces))
+
+            snapshot = tracemalloc.take_snapshot()
+            self.assertEqual(snapshot.traceback_limit, 5)
+            self.assertEqual(len(snapshot.traces), 1)
+            trace = snapshot.traces[0]
+            self.assertEqual(trace.size, 5)
+            self.assertEqual(len(trace.traceback), 1)
+            self.assertEqual(trace.traceback[0].filename, 'a.py')
+            self.assertEqual(trace.traceback[0].lineno, 2)
+
+    def test_filter_traces(self):
+        snapshot, snapshot2 = create_snapshots()
+        filter1 = tracemalloc.Filter(False, "b.py")
+        filter2 = tracemalloc.Filter(True, "a.py", 2)
+        filter3 = tracemalloc.Filter(True, "a.py", 5)
+
+        original_traces = list(snapshot.traces._traces)
+
+        # exclude b.py
+        snapshot3 = snapshot.filter_traces((filter1,))
+        self.assertEqual(snapshot3.traces._traces, [
+            (10, (('a.py', 2), ('b.py', 4))),
+            (10, (('a.py', 2), ('b.py', 4))),
+            (10, (('a.py', 2), ('b.py', 4))),
+            (2, (('a.py', 5), ('b.py', 4))),
+            (7, (('<unknown>', 0),)),
+        ])
+
+        # filter_traces() must not touch the original snapshot
+        self.assertEqual(snapshot.traces._traces, original_traces)
+
+        # only include two lines of a.py
+        snapshot4 = snapshot3.filter_traces((filter2, filter3))
+        self.assertEqual(snapshot4.traces._traces, [
+            (10, (('a.py', 2), ('b.py', 4))),
+            (10, (('a.py', 2), ('b.py', 4))),
+            (10, (('a.py', 2), ('b.py', 4))),
+            (2, (('a.py', 5), ('b.py', 4))),
+        ])
+
+        # No filter: just duplicate the snapshot
+        snapshot5 = snapshot.filter_traces(())
+        self.assertIsNot(snapshot5, snapshot)
+        self.assertIsNot(snapshot5.traces, snapshot.traces)
+        self.assertEqual(snapshot5.traces, snapshot.traces)
+
+        self.assertRaises(TypeError, snapshot.filter_traces, filter1)
+
+    def test_snapshot_group_by_line(self):
+        snapshot, snapshot2 = create_snapshots()
+        tb_0 = traceback_lineno('<unknown>', 0)
+        tb_a_2 = traceback_lineno('a.py', 2)
+        tb_a_5 = traceback_lineno('a.py', 5)
+        tb_b_1 = traceback_lineno('b.py', 1)
+        tb_c_578 = traceback_lineno('c.py', 578)
+
+        # stats per file and line
+        stats1 = snapshot.statistics('lineno')
+        self.assertEqual(stats1, [
+            tracemalloc.Statistic(tb_b_1, 66, 1),
+            tracemalloc.Statistic(tb_a_2, 30, 3),
+            tracemalloc.Statistic(tb_0, 7, 1),
+            tracemalloc.Statistic(tb_a_5, 2, 1),
+        ])
+
+        # stats per file and line (2)
+        stats2 = snapshot2.statistics('lineno')
+        self.assertEqual(stats2, [
+            tracemalloc.Statistic(tb_a_5, 5002, 2),
+            tracemalloc.Statistic(tb_c_578, 400, 1),
+            tracemalloc.Statistic(tb_a_2, 30, 3),
+        ])
+
+        # stats diff per file and line
+        statistics = snapshot2.compare_to(snapshot, 'lineno')
+        self.assertEqual(statistics, [
+            tracemalloc.StatisticDiff(tb_a_5, 5002, 5000, 2, 1),
+            tracemalloc.StatisticDiff(tb_c_578, 400, 400, 1, 1),
+            tracemalloc.StatisticDiff(tb_b_1, 0, -66, 0, -1),
+            tracemalloc.StatisticDiff(tb_0, 0, -7, 0, -1),
+            tracemalloc.StatisticDiff(tb_a_2, 30, 0, 3, 0),
+        ])
+
+    def test_snapshot_group_by_file(self):
+        snapshot, snapshot2 = create_snapshots()
+        tb_0 = traceback_filename('<unknown>')
+        tb_a = traceback_filename('a.py')
+        tb_b = traceback_filename('b.py')
+        tb_c = traceback_filename('c.py')
+
+        # stats per file
+        stats1 = snapshot.statistics('filename')
+        self.assertEqual(stats1, [
+            tracemalloc.Statistic(tb_b, 66, 1),
+            tracemalloc.Statistic(tb_a, 32, 4),
+            tracemalloc.Statistic(tb_0, 7, 1),
+        ])
+
+        # stats per file (2)
+        stats2 = snapshot2.statistics('filename')
+        self.assertEqual(stats2, [
+            tracemalloc.Statistic(tb_a, 5032, 5),
+            tracemalloc.Statistic(tb_c, 400, 1),
+        ])
+
+        # stats diff per file
+        diff = snapshot2.compare_to(snapshot, 'filename')
+        self.assertEqual(diff, [
+            tracemalloc.StatisticDiff(tb_a, 5032, 5000, 5, 1),
+            tracemalloc.StatisticDiff(tb_c, 400, 400, 1, 1),
+            tracemalloc.StatisticDiff(tb_b, 0, -66, 0, -1),
+            tracemalloc.StatisticDiff(tb_0, 0, -7, 0, -1),
+        ])
+
+    def test_snapshot_group_by_traceback(self):
+        snapshot, snapshot2 = create_snapshots()
+
+        # stats per file
+        tb1 = traceback(('a.py', 2), ('b.py', 4))
+        tb2 = traceback(('a.py', 5), ('b.py', 4))
+        tb3 = traceback(('b.py', 1))
+        tb4 = traceback(('<unknown>', 0))
+        stats1 = snapshot.statistics('traceback')
+        self.assertEqual(stats1, [
+            tracemalloc.Statistic(tb3, 66, 1),
+            tracemalloc.Statistic(tb1, 30, 3),
+            tracemalloc.Statistic(tb4, 7, 1),
+            tracemalloc.Statistic(tb2, 2, 1),
+        ])
+
+        # stats per file (2)
+        tb5 = traceback(('c.py', 578))
+        stats2 = snapshot2.statistics('traceback')
+        self.assertEqual(stats2, [
+            tracemalloc.Statistic(tb2, 5002, 2),
+            tracemalloc.Statistic(tb5, 400, 1),
+            tracemalloc.Statistic(tb1, 30, 3),
+        ])
+
+        # stats diff per file
+        diff = snapshot2.compare_to(snapshot, 'traceback')
+        self.assertEqual(diff, [
+            tracemalloc.StatisticDiff(tb2, 5002, 5000, 2, 1),
+            tracemalloc.StatisticDiff(tb5, 400, 400, 1, 1),
+            tracemalloc.StatisticDiff(tb3, 0, -66, 0, -1),
+            tracemalloc.StatisticDiff(tb4, 0, -7, 0, -1),
+            tracemalloc.StatisticDiff(tb1, 30, 0, 3, 0),
+        ])
+
+        self.assertRaises(ValueError,
+                          snapshot.statistics, 'traceback', cumulative=True)
+
+    def test_snapshot_group_by_cumulative(self):
+        snapshot, snapshot2 = create_snapshots()
+        tb_0 = traceback_filename('<unknown>')
+        tb_a = traceback_filename('a.py')
+        tb_b = traceback_filename('b.py')
+        tb_a_2 = traceback_lineno('a.py', 2)
+        tb_a_5 = traceback_lineno('a.py', 5)
+        tb_b_1 = traceback_lineno('b.py', 1)
+        tb_b_4 = traceback_lineno('b.py', 4)
+
+        # per file
+        stats = snapshot.statistics('filename', True)
+        self.assertEqual(stats, [
+            tracemalloc.Statistic(tb_b, 98, 5),
+            tracemalloc.Statistic(tb_a, 32, 4),
+            tracemalloc.Statistic(tb_0, 7, 1),
+        ])
+
+        # per line
+        stats = snapshot.statistics('lineno', True)
+        self.assertEqual(stats, [
+            tracemalloc.Statistic(tb_b_1, 66, 1),
+            tracemalloc.Statistic(tb_b_4, 32, 4),
+            tracemalloc.Statistic(tb_a_2, 30, 3),
+            tracemalloc.Statistic(tb_0, 7, 1),
+            tracemalloc.Statistic(tb_a_5, 2, 1),
+        ])
+
+    def test_trace_format(self):
+        snapshot, snapshot2 = create_snapshots()
+        trace = snapshot.traces[0]
+        self.assertEqual(str(trace), 'a.py:2: 10 B')
+        traceback = trace.traceback
+        self.assertEqual(str(traceback), 'a.py:2')
+        frame = traceback[0]
+        self.assertEqual(str(frame), 'a.py:2')
+
+    def test_statistic_format(self):
+        snapshot, snapshot2 = create_snapshots()
+        stats = snapshot.statistics('lineno')
+        stat = stats[0]
+        self.assertEqual(str(stat),
+                         'b.py:1: size=66 B, count=1, average=66 B')
+
+    def test_statistic_diff_format(self):
+        snapshot, snapshot2 = create_snapshots()
+        stats = snapshot2.compare_to(snapshot, 'lineno')
+        stat = stats[0]
+        self.assertEqual(str(stat),
+                         'a.py:5: size=5002 B (+5000 B), count=2 (+1), average=2501 B')
+
+    def test_slices(self):
+        snapshot, snapshot2 = create_snapshots()
+        self.assertEqual(snapshot.traces[:2],
+                         (snapshot.traces[0], snapshot.traces[1]))
+
+        traceback = snapshot.traces[0].traceback
+        self.assertEqual(traceback[:2],
+                         (traceback[0], traceback[1]))
+
+    def test_format_traceback(self):
+        snapshot, snapshot2 = create_snapshots()
+        def getline(filename, lineno):
+            return '  <%s, %s>' % (filename, lineno)
+        with unittest.mock.patch('tracemalloc.linecache.getline',
+                                 side_effect=getline):
+            tb = snapshot.traces[0].traceback
+            self.assertEqual(tb.format(),
+                             ['  File "a.py", line 2',
+                              '    <a.py, 2>',
+                              '  File "b.py", line 4',
+                              '    <b.py, 4>'])
+
+            self.assertEqual(tb.format(limit=1),
+                             ['  File "a.py", line 2',
+                              '    <a.py, 2>'])
+
+            self.assertEqual(tb.format(limit=-1),
+                             [])
+
+
+class TestFilters(unittest.TestCase):
+    maxDiff = 2048
+
+    def test_filter_attributes(self):
+        # test default values
+        f = tracemalloc.Filter(True, "abc")
+        self.assertEqual(f.inclusive, True)
+        self.assertEqual(f.filename_pattern, "abc")
+        self.assertIsNone(f.lineno)
+        self.assertEqual(f.all_frames, False)
+
+        # test custom values
+        f = tracemalloc.Filter(False, "test.py", 123, True)
+        self.assertEqual(f.inclusive, False)
+        self.assertEqual(f.filename_pattern, "test.py")
+        self.assertEqual(f.lineno, 123)
+        self.assertEqual(f.all_frames, True)
+
+        # parameters passed by keyword
+        f = tracemalloc.Filter(inclusive=False, filename_pattern="test.py", lineno=123, all_frames=True)
+        self.assertEqual(f.inclusive, False)
+        self.assertEqual(f.filename_pattern, "test.py")
+        self.assertEqual(f.lineno, 123)
+        self.assertEqual(f.all_frames, True)
+
+        # read-only attribute
+        self.assertRaises(AttributeError, setattr, f, "filename_pattern", "abc")
+
+    def test_filter_match(self):
+        # filter without line number
+        f = tracemalloc.Filter(True, "abc")
+        self.assertTrue(f._match_frame("abc", 0))
+        self.assertTrue(f._match_frame("abc", 5))
+        self.assertTrue(f._match_frame("abc", 10))
+        self.assertFalse(f._match_frame("12356", 0))
+        self.assertFalse(f._match_frame("12356", 5))
+        self.assertFalse(f._match_frame("12356", 10))
+
+        f = tracemalloc.Filter(False, "abc")
+        self.assertFalse(f._match_frame("abc", 0))
+        self.assertFalse(f._match_frame("abc", 5))
+        self.assertFalse(f._match_frame("abc", 10))
+        self.assertTrue(f._match_frame("12356", 0))
+        self.assertTrue(f._match_frame("12356", 5))
+        self.assertTrue(f._match_frame("12356", 10))
+
+        # filter with line number > 0
+        f = tracemalloc.Filter(True, "abc", 5)
+        self.assertFalse(f._match_frame("abc", 0))
+        self.assertTrue(f._match_frame("abc", 5))
+        self.assertFalse(f._match_frame("abc", 10))
+        self.assertFalse(f._match_frame("12356", 0))
+        self.assertFalse(f._match_frame("12356", 5))
+        self.assertFalse(f._match_frame("12356", 10))
+
+        f = tracemalloc.Filter(False, "abc", 5)
+        self.assertTrue(f._match_frame("abc", 0))
+        self.assertFalse(f._match_frame("abc", 5))
+        self.assertTrue(f._match_frame("abc", 10))
+        self.assertTrue(f._match_frame("12356", 0))
+        self.assertTrue(f._match_frame("12356", 5))
+        self.assertTrue(f._match_frame("12356", 10))
+
+        # filter with line number 0
+        f = tracemalloc.Filter(True, "abc", 0)
+        self.assertTrue(f._match_frame("abc", 0))
+        self.assertFalse(f._match_frame("abc", 5))
+        self.assertFalse(f._match_frame("abc", 10))
+        self.assertFalse(f._match_frame("12356", 0))
+        self.assertFalse(f._match_frame("12356", 5))
+        self.assertFalse(f._match_frame("12356", 10))
+
+        f = tracemalloc.Filter(False, "abc", 0)
+        self.assertFalse(f._match_frame("abc", 0))
+        self.assertTrue(f._match_frame("abc", 5))
+        self.assertTrue(f._match_frame("abc", 10))
+        self.assertTrue(f._match_frame("12356", 0))
+        self.assertTrue(f._match_frame("12356", 5))
+        self.assertTrue(f._match_frame("12356", 10))
+
+    def test_filter_match_filename(self):
+        def fnmatch(inclusive, filename, pattern):
+            f = tracemalloc.Filter(inclusive, pattern)
+            return f._match_frame(filename, 0)
+
+        self.assertTrue(fnmatch(True, "abc", "abc"))
+        self.assertFalse(fnmatch(True, "12356", "abc"))
+        self.assertFalse(fnmatch(True, "<unknown>", "abc"))
+
+        self.assertFalse(fnmatch(False, "abc", "abc"))
+        self.assertTrue(fnmatch(False, "12356", "abc"))
+        self.assertTrue(fnmatch(False, "<unknown>", "abc"))
+
+    def test_filter_match_filename_joker(self):
+        def fnmatch(filename, pattern):
+            filter = tracemalloc.Filter(True, pattern)
+            return filter._match_frame(filename, 0)
+
+        # empty string
+        self.assertFalse(fnmatch('abc', ''))
+        self.assertFalse(fnmatch('', 'abc'))
+        self.assertTrue(fnmatch('', ''))
+        self.assertTrue(fnmatch('', '*'))
+
+        # no *
+        self.assertTrue(fnmatch('abc', 'abc'))
+        self.assertFalse(fnmatch('abc', 'abcd'))
+        self.assertFalse(fnmatch('abc', 'def'))
+
+        # a*
+        self.assertTrue(fnmatch('abc', 'a*'))
+        self.assertTrue(fnmatch('abc', 'abc*'))
+        self.assertFalse(fnmatch('abc', 'b*'))
+        self.assertFalse(fnmatch('abc', 'abcd*'))
+
+        # a*b
+        self.assertTrue(fnmatch('abc', 'a*c'))
+        self.assertTrue(fnmatch('abcdcx', 'a*cx'))
+        self.assertFalse(fnmatch('abb', 'a*c'))
+        self.assertFalse(fnmatch('abcdce', 'a*cx'))
+
+        # a*b*c
+        self.assertTrue(fnmatch('abcde', 'a*c*e'))
+        self.assertTrue(fnmatch('abcbdefeg', 'a*bd*eg'))
+        self.assertFalse(fnmatch('abcdd', 'a*c*e'))
+        self.assertFalse(fnmatch('abcbdefef', 'a*bd*eg'))
+
+        # replace .pyc and .pyo suffix with .py
+        self.assertTrue(fnmatch('a.pyc', 'a.py'))
+        self.assertTrue(fnmatch('a.pyo', 'a.py'))
+        self.assertTrue(fnmatch('a.py', 'a.pyc'))
+        self.assertTrue(fnmatch('a.py', 'a.pyo'))
+
+        if os.name == 'nt':
+            # case insensitive
+            self.assertTrue(fnmatch('aBC', 'ABc'))
+            self.assertTrue(fnmatch('aBcDe', 'Ab*dE'))
+
+            self.assertTrue(fnmatch('a.pyc', 'a.PY'))
+            self.assertTrue(fnmatch('a.PYO', 'a.py'))
+            self.assertTrue(fnmatch('a.py', 'a.PYC'))
+            self.assertTrue(fnmatch('a.PY', 'a.pyo'))
+        else:
+            # case sensitive
+            self.assertFalse(fnmatch('aBC', 'ABc'))
+            self.assertFalse(fnmatch('aBcDe', 'Ab*dE'))
+
+            self.assertFalse(fnmatch('a.pyc', 'a.PY'))
+            self.assertFalse(fnmatch('a.PYO', 'a.py'))
+            self.assertFalse(fnmatch('a.py', 'a.PYC'))
+            self.assertFalse(fnmatch('a.PY', 'a.pyo'))
+
+        if os.name == 'nt':
+            # normalize alternate separator "/" to the standard separator "\"
+            self.assertTrue(fnmatch(r'a/b', r'a\b'))
+            self.assertTrue(fnmatch(r'a\b', r'a/b'))
+            self.assertTrue(fnmatch(r'a/b\c', r'a\b/c'))
+            self.assertTrue(fnmatch(r'a/b/c', r'a\b\c'))
+        else:
+            # there is no alternate separator
+            self.assertFalse(fnmatch(r'a/b', r'a\b'))
+            self.assertFalse(fnmatch(r'a\b', r'a/b'))
+            self.assertFalse(fnmatch(r'a/b\c', r'a\b/c'))
+            self.assertFalse(fnmatch(r'a/b/c', r'a\b\c'))
+
+    def test_filter_match_trace(self):
+        t1 = (("a.py", 2), ("b.py", 3))
+        t2 = (("b.py", 4), ("b.py", 5))
+        t3 = (("c.py", 5), ('<unknown>', 0))
+        unknown = (('<unknown>', 0),)
+
+        f = tracemalloc.Filter(True, "b.py", all_frames=True)
+        self.assertTrue(f._match_traceback(t1))
+        self.assertTrue(f._match_traceback(t2))
+        self.assertFalse(f._match_traceback(t3))
+        self.assertFalse(f._match_traceback(unknown))
+
+        f = tracemalloc.Filter(True, "b.py", all_frames=False)
+        self.assertFalse(f._match_traceback(t1))
+        self.assertTrue(f._match_traceback(t2))
+        self.assertFalse(f._match_traceback(t3))
+        self.assertFalse(f._match_traceback(unknown))
+
+        f = tracemalloc.Filter(False, "b.py", all_frames=True)
+        self.assertFalse(f._match_traceback(t1))
+        self.assertFalse(f._match_traceback(t2))
+        self.assertTrue(f._match_traceback(t3))
+        self.assertTrue(f._match_traceback(unknown))
+
+        f = tracemalloc.Filter(False, "b.py", all_frames=False)
+        self.assertTrue(f._match_traceback(t1))
+        self.assertFalse(f._match_traceback(t2))
+        self.assertTrue(f._match_traceback(t3))
+        self.assertTrue(f._match_traceback(unknown))
+
+        f = tracemalloc.Filter(False, "<unknown>", all_frames=False)
+        self.assertTrue(f._match_traceback(t1))
+        self.assertTrue(f._match_traceback(t2))
+        self.assertTrue(f._match_traceback(t3))
+        self.assertFalse(f._match_traceback(unknown))
+
+        f = tracemalloc.Filter(True, "<unknown>", all_frames=True)
+        self.assertFalse(f._match_traceback(t1))
+        self.assertFalse(f._match_traceback(t2))
+        self.assertTrue(f._match_traceback(t3))
+        self.assertTrue(f._match_traceback(unknown))
+
+        f = tracemalloc.Filter(False, "<unknown>", all_frames=True)
+        self.assertTrue(f._match_traceback(t1))
+        self.assertTrue(f._match_traceback(t2))
+        self.assertFalse(f._match_traceback(t3))
+        self.assertFalse(f._match_traceback(unknown))
+
+
+class TestCommandLine(unittest.TestCase):
+    def test_env_var_disabled_by_default(self):
+        # not tracing by default
+        code = 'import tracemalloc; print(tracemalloc.is_tracing())'
+        ok, stdout, stderr = assert_python_ok('-c', code)
+        stdout = stdout.rstrip()
+        self.assertEqual(stdout, b'False')
+
+    def test_env_var_ignored_with_E(self):
+        """PYTHON* environment variables must be ignored when -E is present."""
+        code = 'import tracemalloc; print(tracemalloc.is_tracing())'
+        ok, stdout, stderr = assert_python_ok('-E', '-c', code, PYTHONTRACEMALLOC='1')
+        stdout = stdout.rstrip()
+        self.assertEqual(stdout, b'False')
+
+    def test_env_var_enabled_at_startup(self):
+        # tracing at startup
+        code = 'import tracemalloc; print(tracemalloc.is_tracing())'
+        ok, stdout, stderr = assert_python_ok('-c', code, PYTHONTRACEMALLOC='1')
+        stdout = stdout.rstrip()
+        self.assertEqual(stdout, b'True')
+
+    def test_env_limit(self):
+        # start and set the number of frames
+        code = 'import tracemalloc; print(tracemalloc.get_traceback_limit())'
+        ok, stdout, stderr = assert_python_ok('-c', code, PYTHONTRACEMALLOC='10')
+        stdout = stdout.rstrip()
+        self.assertEqual(stdout, b'10')
+
+    def test_env_var_invalid(self):
+        for nframe in (-1, 0, 2**30):
+            with self.subTest(nframe=nframe):
+                with support.SuppressCrashReport():
+                    ok, stdout, stderr = assert_python_failure(
+                        '-c', 'pass',
+                        PYTHONTRACEMALLOC=str(nframe))
+                    self.assertIn(b'PYTHONTRACEMALLOC: invalid '
+                                  b'number of frames',
+                                  stderr)
+
+    def test_sys_xoptions(self):
+        for xoptions, nframe in (
+            ('tracemalloc', 1),
+            ('tracemalloc=1', 1),
+            ('tracemalloc=15', 15),
+        ):
+            with self.subTest(xoptions=xoptions, nframe=nframe):
+                code = 'import tracemalloc; print(tracemalloc.get_traceback_limit())'
+                ok, stdout, stderr = assert_python_ok('-X', xoptions, '-c', code)
+                stdout = stdout.rstrip()
+                self.assertEqual(stdout, str(nframe).encode('ascii'))
+
+    def test_sys_xoptions_invalid(self):
+        for nframe in (-1, 0, 2**30):
+            with self.subTest(nframe=nframe):
+                with support.SuppressCrashReport():
+                    args = ('-X', 'tracemalloc=%s' % nframe, '-c', 'pass')
+                    ok, stdout, stderr = assert_python_failure(*args)
+                    self.assertIn(b'-X tracemalloc=NFRAME: invalid '
+                                  b'number of frames',
+                                  stderr)
+
+    def test_pymem_alloc0(self):
+        # Issue #21639: Check that PyMem_Malloc(0) with tracemalloc enabled
+        # does not crash.
+        code = 'import _testcapi; _testcapi.test_pymem_alloc0(); 1'
+        assert_python_ok('-X', 'tracemalloc', '-c', code)
+
+
+def test_main():
+    support.run_unittest(
+        TestTracemallocEnabled,
+        TestSnapshot,
+        TestFilters,
+        TestCommandLine,
+    )
+
+if __name__ == "__main__":
+    test_main()
diff --git a/Lib/test/test_ttk_guionly.py b/Lib/test/test_ttk_guionly.py
index 3a3459b..fcdedac 100644
--- a/Lib/test/test_ttk_guionly.py
+++ b/Lib/test/test_ttk_guionly.py
@@ -6,35 +6,32 @@
 support.import_module('_tkinter')
 
 # Make sure tkinter._fix runs to set up the environment
-support.import_fresh_module('tkinter')
+tkinter = support.import_fresh_module('tkinter')
 
 # Skip test if tk cannot be initialized.
-from tkinter.test.support import check_tk_availability
-check_tk_availability()
+support.requires('gui')
 
 from _tkinter import TclError
 from tkinter import ttk
 from tkinter.test import runtktests
-from tkinter.test.support import get_tk_root
 
+root = None
 try:
-    ttk.Button()
+    root = tkinter.Tk()
+    button = ttk.Button(root)
+    button.destroy()
+    del button
 except TclError as msg:
     # assuming ttk is not available
     raise unittest.SkipTest("ttk not available: %s" % msg)
+finally:
+    if root is not None:
+        root.destroy()
+    del root
 
-def test_main(enable_gui=False):
-    if enable_gui:
-        if support.use_resources is None:
-            support.use_resources = ['gui']
-        elif 'gui' not in support.use_resources:
-            support.use_resources.append('gui')
-
-    try:
-        support.run_unittest(
-                *runtktests.get_tests(text=False, packages=['test_ttk']))
-    finally:
-        get_tk_root().destroy()
+def test_main():
+    support.run_unittest(
+            *runtktests.get_tests(text=False, packages=['test_ttk']))
 
 if __name__ == '__main__':
-    test_main(enable_gui=True)
+    test_main()
diff --git a/Lib/test/test_tuple.py b/Lib/test/test_tuple.py
index e41711c..51875a1 100644
--- a/Lib/test/test_tuple.py
+++ b/Lib/test/test_tuple.py
@@ -169,29 +169,31 @@
         # Userlist iterators don't support pickling yet since
         # they are based on generators.
         data = self.type2test([4, 5, 6, 7])
-        itorg = iter(data)
-        d = pickle.dumps(itorg)
-        it = pickle.loads(d)
-        self.assertEqual(type(itorg), type(it))
-        self.assertEqual(self.type2test(it), self.type2test(data))
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            itorg = iter(data)
+            d = pickle.dumps(itorg, proto)
+            it = pickle.loads(d)
+            self.assertEqual(type(itorg), type(it))
+            self.assertEqual(self.type2test(it), self.type2test(data))
 
-        it = pickle.loads(d)
-        next(it)
-        d = pickle.dumps(it)
-        self.assertEqual(self.type2test(it), self.type2test(data)[1:])
+            it = pickle.loads(d)
+            next(it)
+            d = pickle.dumps(it, proto)
+            self.assertEqual(self.type2test(it), self.type2test(data)[1:])
 
     def test_reversed_pickle(self):
         data = self.type2test([4, 5, 6, 7])
-        itorg = reversed(data)
-        d = pickle.dumps(itorg)
-        it = pickle.loads(d)
-        self.assertEqual(type(itorg), type(it))
-        self.assertEqual(self.type2test(it), self.type2test(reversed(data)))
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            itorg = reversed(data)
+            d = pickle.dumps(itorg, proto)
+            it = pickle.loads(d)
+            self.assertEqual(type(itorg), type(it))
+            self.assertEqual(self.type2test(it), self.type2test(reversed(data)))
 
-        it = pickle.loads(d)
-        next(it)
-        d = pickle.dumps(it)
-        self.assertEqual(self.type2test(it), self.type2test(reversed(data))[1:])
+            it = pickle.loads(d)
+            next(it)
+            d = pickle.dumps(it, proto)
+            self.assertEqual(self.type2test(it), self.type2test(reversed(data))[1:])
 
     def test_no_comdat_folding(self):
         # Issue 8847: In the PGO build, the MSVC linker's COMDAT folding
diff --git a/Lib/test/test_types.py b/Lib/test/test_types.py
index 3ee4c6b..ec10752 100644
--- a/Lib/test/test_types.py
+++ b/Lib/test/test_types.py
@@ -2,6 +2,7 @@
 
 from test.support import run_unittest, run_with_locale
 import collections
+import pickle
 import locale
 import sys
 import types
@@ -1077,9 +1078,19 @@
         ns2 = types.SimpleNamespace()
         ns2.x = "spam"
         ns2._y = 5
+        name = "namespace"
 
-        self.assertEqual(repr(ns1), "namespace(w=3, x=1, y=2)")
-        self.assertEqual(repr(ns2), "namespace(_y=5, x='spam')")
+        self.assertEqual(repr(ns1), "{name}(w=3, x=1, y=2)".format(name=name))
+        self.assertEqual(repr(ns2), "{name}(_y=5, x='spam')".format(name=name))
+
+    def test_equal(self):
+        ns1 = types.SimpleNamespace(x=1)
+        ns2 = types.SimpleNamespace()
+        ns2.x = 1
+
+        self.assertEqual(types.SimpleNamespace(), types.SimpleNamespace())
+        self.assertEqual(ns1, ns2)
+        self.assertNotEqual(ns2, types.SimpleNamespace())
 
     def test_nested(self):
         ns1 = types.SimpleNamespace(a=1, b=2)
@@ -1117,11 +1128,12 @@
         ns1.spam = ns1
         ns2.spam = ns3
         ns3.spam = ns2
+        name = "namespace"
+        repr1 = "{name}(c='cookie', spam={name}(...))".format(name=name)
+        repr2 = "{name}(spam={name}(spam={name}(...), x=1))".format(name=name)
 
-        self.assertEqual(repr(ns1),
-                         "namespace(c='cookie', spam=namespace(...))")
-        self.assertEqual(repr(ns2),
-                         "namespace(spam=namespace(spam=namespace(...), x=1))")
+        self.assertEqual(repr(ns1), repr1)
+        self.assertEqual(repr(ns2), repr2)
 
     def test_as_dict(self):
         ns = types.SimpleNamespace(spam='spamspamspam')
@@ -1144,6 +1156,19 @@
         self.assertIs(type(spam), Spam)
         self.assertEqual(vars(spam), {'ham': 8, 'eggs': 9})
 
+    def test_pickle(self):
+        ns = types.SimpleNamespace(breakfast="spam", lunch="spam")
+
+        for protocol in range(pickle.HIGHEST_PROTOCOL + 1):
+            pname = "protocol {}".format(protocol)
+            try:
+                ns_pickled = pickle.dumps(ns, protocol)
+            except TypeError as e:
+                raise TypeError(pname) from e
+            ns_roundtrip = pickle.loads(ns_pickled)
+
+            self.assertEqual(ns, ns_roundtrip, pname)
+
 
 def test_main():
     run_unittest(TypesTests, MappingProxyTests, ClassCreationTests,
diff --git a/Lib/test/test_ucn.py b/Lib/test/test_ucn.py
index de71680..1e07f66 100644
--- a/Lib/test/test_ucn.py
+++ b/Lib/test/test_ucn.py
@@ -172,12 +172,12 @@
 
     def test_named_sequences_full(self):
         # Check all the named sequences
-        url = ("http://www.unicode.org/Public/%s/ucd/NamedSequences.txt" %
+        url = ("http://www.pythontest.net/unicode/%s/NamedSequences.txt" %
                unicodedata.unidata_version)
         try:
             testdata = support.open_urlresource(url, encoding="utf-8",
                                                 check=check_version)
-        except (IOError, HTTPException):
+        except (OSError, HTTPException):
             self.skipTest("Could not retrieve " + url)
         self.addCleanup(testdata.close)
         for line in testdata:
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py
index f359082..7735a6b 100644
--- a/Lib/test/test_unicode.py
+++ b/Lib/test/test_unicode.py
@@ -7,6 +7,7 @@
 """#"
 import _string
 import codecs
+import itertools
 import struct
 import sys
 import unittest
@@ -31,6 +32,16 @@
         return None
 codecs.register(search_function)
 
+def duplicate_string(text):
+    """
+    Try to get a fresh clone of the specified text:
+    new object with a reference count of 1.
+
+    This is a best-effort: latin1 single letters and the empty
+    string ('') are singletons and cannot be cloned.
+    """
+    return text.encode().decode()
+
 class UnicodeTest(string_tests.CommonTest,
         string_tests.MixinStrUnicodeUserStringTest,
         string_tests.MixinStrUnicodeTest,
@@ -840,6 +851,27 @@
         self.assertEqual('{0:10000}'.format(''), ' ' * 10000)
         self.assertEqual('{0:10000000}'.format(''), ' ' * 10000000)
 
+        # issue 12546: use \x00 as a fill character
+        self.assertEqual('{0:\x00<6s}'.format('foo'), 'foo\x00\x00\x00')
+        self.assertEqual('{0:\x01<6s}'.format('foo'), 'foo\x01\x01\x01')
+        self.assertEqual('{0:\x00^6s}'.format('foo'), '\x00foo\x00\x00')
+        self.assertEqual('{0:^6s}'.format('foo'), ' foo  ')
+
+        self.assertEqual('{0:\x00<6}'.format(3), '3\x00\x00\x00\x00\x00')
+        self.assertEqual('{0:\x01<6}'.format(3), '3\x01\x01\x01\x01\x01')
+        self.assertEqual('{0:\x00^6}'.format(3), '\x00\x003\x00\x00\x00')
+        self.assertEqual('{0:<6}'.format(3), '3     ')
+
+        self.assertEqual('{0:\x00<6}'.format(3.14), '3.14\x00\x00')
+        self.assertEqual('{0:\x01<6}'.format(3.14), '3.14\x01\x01')
+        self.assertEqual('{0:\x00^6}'.format(3.14), '\x003.14\x00')
+        self.assertEqual('{0:^6}'.format(3.14), ' 3.14 ')
+
+        self.assertEqual('{0:\x00<12}'.format(3+2.0j), '(3+2j)\x00\x00\x00\x00\x00\x00')
+        self.assertEqual('{0:\x01<12}'.format(3+2.0j), '(3+2j)\x01\x01\x01\x01\x01\x01')
+        self.assertEqual('{0:\x00^12}'.format(3+2.0j), '\x00\x00\x00(3+2j)\x00\x00\x00')
+        self.assertEqual('{0:^12}'.format(3+2.0j), '   (3+2j)   ')
+
         # format specifiers for user defined type
         self.assertEqual('{0:abc}'.format(C()), 'abc')
 
@@ -869,11 +901,9 @@
         self.assertEqual('{0:d}'.format(G('data')), 'G(data)')
         self.assertEqual('{0!s}'.format(G('data')), 'string is data')
 
-        msg = 'object.__format__ with a non-empty format string is deprecated'
-        with support.check_warnings((msg, DeprecationWarning)):
-            self.assertEqual('{0:^10}'.format(E('data')), ' E(data)  ')
-            self.assertEqual('{0:^10s}'.format(E('data')), ' E(data)  ')
-            self.assertEqual('{0:>15s}'.format(G('data')), ' string is data')
+        self.assertRaises(TypeError, '{0:^10}'.format, E('data'))
+        self.assertRaises(TypeError, '{0:^10s}'.format, E('data'))
+        self.assertRaises(TypeError, '{0:>15s}'.format, G('data'))
 
         self.assertEqual("{0:date: %Y-%m-%d}".format(I(year=2007,
                                                        month=8,
@@ -909,7 +939,7 @@
         self.assertRaises(ValueError, "{0".format)
         self.assertRaises(IndexError, "{0.}".format)
         self.assertRaises(ValueError, "{0.}".format, 0)
-        self.assertRaises(IndexError, "{0[}".format)
+        self.assertRaises(ValueError, "{0[}".format)
         self.assertRaises(ValueError, "{0[}".format, [])
         self.assertRaises(KeyError,   "{0]}".format)
         self.assertRaises(ValueError, "{0.[]}".format, 0)
@@ -961,6 +991,15 @@
                          '')
 
         self.assertEqual("{[{}]}".format({"{}": 5}), "5")
+        self.assertEqual("{[{}]}".format({"{}" : "a"}), "a")
+        self.assertEqual("{[{]}".format({"{" : "a"}), "a")
+        self.assertEqual("{[}]}".format({"}" : "a"}), "a")
+        self.assertEqual("{[[]}".format({"[" : "a"}), "a")
+        self.assertEqual("{[!]}".format({"!" : "a"}), "a")
+        self.assertRaises(ValueError, "{a{}b}".format, 42)
+        self.assertRaises(ValueError, "{a{b}".format, 42)
+        self.assertRaises(ValueError, "{[}".format, 42)
+
         self.assertEqual("0x{:0{:d}X}".format(0x0,16), "0x0000000000000000")
 
     def test_format_map(self):
@@ -1114,6 +1153,67 @@
         self.assertEqual('%.1s' % "a\xe9\u20ac", 'a')
         self.assertEqual('%.2s' % "a\xe9\u20ac", 'a\xe9')
 
+        #issue 19995
+        class PsuedoInt:
+            def __init__(self, value):
+                self.value = int(value)
+            def __int__(self):
+                return self.value
+            def __index__(self):
+                return self.value
+        class PsuedoFloat:
+            def __init__(self, value):
+                self.value = float(value)
+            def __int__(self):
+                return int(self.value)
+        pi = PsuedoFloat(3.1415)
+        letter_m = PsuedoInt(109)
+        self.assertEqual('%x' % 42, '2a')
+        self.assertEqual('%X' % 15, 'F')
+        self.assertEqual('%o' % 9, '11')
+        self.assertEqual('%c' % 109, 'm')
+        self.assertEqual('%x' % letter_m, '6d')
+        self.assertEqual('%X' % letter_m, '6D')
+        self.assertEqual('%o' % letter_m, '155')
+        self.assertEqual('%c' % letter_m, 'm')
+        self.assertWarns(DeprecationWarning, '%x'.__mod__, pi),
+        self.assertWarns(DeprecationWarning, '%x'.__mod__, 3.14),
+        self.assertWarns(DeprecationWarning, '%X'.__mod__, 2.11),
+        self.assertWarns(DeprecationWarning, '%o'.__mod__, 1.79),
+        self.assertWarns(DeprecationWarning, '%c'.__mod__, pi),
+
+    def test_formatting_with_enum(self):
+        # issue18780
+        import enum
+        class Float(float, enum.Enum):
+            PI = 3.1415926
+        class Int(enum.IntEnum):
+            IDES = 15
+        class Str(str, enum.Enum):
+            ABC = 'abc'
+        # Testing Unicode formatting strings...
+        self.assertEqual("%s, %s" % (Str.ABC, Str.ABC),
+                         'Str.ABC, Str.ABC')
+        self.assertEqual("%s, %s, %d, %i, %u, %f, %5.2f" %
+                        (Str.ABC, Str.ABC,
+                         Int.IDES, Int.IDES, Int.IDES,
+                         Float.PI, Float.PI),
+                         'Str.ABC, Str.ABC, 15, 15, 15, 3.141593,  3.14')
+
+        # formatting jobs delegated from the string implementation:
+        self.assertEqual('...%(foo)s...' % {'foo':Str.ABC},
+                         '...Str.ABC...')
+        self.assertEqual('...%(foo)s...' % {'foo':Int.IDES},
+                         '...Int.IDES...')
+        self.assertEqual('...%(foo)i...' % {'foo':Int.IDES},
+                         '...15...')
+        self.assertEqual('...%(foo)d...' % {'foo':Int.IDES},
+                         '...15...')
+        self.assertEqual('...%(foo)u...' % {'foo':Int.IDES, 'def':Float.PI},
+                         '...15...')
+        self.assertEqual('...%(foo)f...' % {'foo':Float.PI,'def':123},
+                         '...3.141593...')
+
     def test_formatting_huge_precision(self):
         format_string = "%.{}f".format(sys.maxsize + 1)
         with self.assertRaises(ValueError):
@@ -1341,9 +1441,9 @@
     def test_utf8_decode_invalid_sequences(self):
         # continuation bytes in a sequence of 2, 3, or 4 bytes
         continuation_bytes = [bytes([x]) for x in range(0x80, 0xC0)]
-        # start bytes of a 2-byte sequence equivalent to codepoints < 0x7F
+        # start bytes of a 2-byte sequence equivalent to code points < 0x7F
         invalid_2B_seq_start_bytes = [bytes([x]) for x in range(0xC0, 0xC2)]
-        # start bytes of a 4-byte sequence equivalent to codepoints > 0x10FFFF
+        # start bytes of a 4-byte sequence equivalent to code points > 0x10FFFF
         invalid_4B_seq_start_bytes = [bytes([x]) for x in range(0xF5, 0xF8)]
         invalid_start_bytes = (
             continuation_bytes + invalid_2B_seq_start_bytes +
@@ -1794,10 +1894,10 @@
         # 0-127
         s = bytes(range(128))
         for encoding in (
-            'cp037', 'cp1026',
+            'cp037', 'cp1026', 'cp273',
             'cp437', 'cp500', 'cp720', 'cp737', 'cp775', 'cp850',
             'cp852', 'cp855', 'cp858', 'cp860', 'cp861', 'cp862',
-            'cp863', 'cp865', 'cp866',
+            'cp863', 'cp865', 'cp866', 'cp1125',
             'iso8859_10', 'iso8859_13', 'iso8859_14', 'iso8859_15',
             'iso8859_2', 'iso8859_3', 'iso8859_4', 'iso8859_5', 'iso8859_6',
             'iso8859_7', 'iso8859_9', 'koi8_r', 'latin_1',
@@ -1822,10 +1922,10 @@
         # 128-255
         s = bytes(range(128, 256))
         for encoding in (
-            'cp037', 'cp1026',
+            'cp037', 'cp1026', 'cp273',
             'cp437', 'cp500', 'cp720', 'cp737', 'cp775', 'cp850',
             'cp852', 'cp855', 'cp858', 'cp860', 'cp861', 'cp862',
-            'cp863', 'cp865', 'cp866',
+            'cp863', 'cp865', 'cp866', 'cp1125',
             'iso8859_10', 'iso8859_13', 'iso8859_14', 'iso8859_15',
             'iso8859_2', 'iso8859_4', 'iso8859_5',
             'iso8859_9', 'koi8_r', 'latin_1',
@@ -2068,13 +2168,82 @@
         check_format('%abc',
                      b'%%%s', b'abc')
 
-        # test %S
-        check_format("repr=\u20acABC",
-                     b'repr=%S', '\u20acABC')
+        # truncated string
+        check_format('abc',
+                     b'%.3s', b'abcdef')
+        check_format('abc[\ufffd',
+                     b'%.5s', 'abc[\u20ac]'.encode('utf8'))
+        check_format("'\\u20acABC'",
+                     b'%A', '\u20acABC')
+        check_format("'\\u20",
+                     b'%.5A', '\u20acABCDEF')
+        check_format("'\u20acABC'",
+                     b'%R', '\u20acABC')
+        check_format("'\u20acA",
+                     b'%.3R', '\u20acABCDEF')
+        check_format('\u20acAB',
+                     b'%.3S', '\u20acABCDEF')
+        check_format('\u20acAB',
+                     b'%.3U', '\u20acABCDEF')
+        check_format('\u20acAB',
+                     b'%.3V', '\u20acABCDEF', None)
+        check_format('abc[\ufffd',
+                     b'%.5V', None, 'abc[\u20ac]'.encode('utf8'))
 
-        # test %R
-        check_format("repr='\u20acABC'",
-                     b'repr=%R', '\u20acABC')
+        # following tests comes from #7330
+        # test width modifier and precision modifier with %S
+        check_format("repr=  abc",
+                     b'repr=%5S', 'abc')
+        check_format("repr=ab",
+                     b'repr=%.2S', 'abc')
+        check_format("repr=   ab",
+                     b'repr=%5.2S', 'abc')
+
+        # test width modifier and precision modifier with %R
+        check_format("repr=   'abc'",
+                     b'repr=%8R', 'abc')
+        check_format("repr='ab",
+                     b'repr=%.3R', 'abc')
+        check_format("repr=  'ab",
+                     b'repr=%5.3R', 'abc')
+
+        # test width modifier and precision modifier with %A
+        check_format("repr=   'abc'",
+                     b'repr=%8A', 'abc')
+        check_format("repr='ab",
+                     b'repr=%.3A', 'abc')
+        check_format("repr=  'ab",
+                     b'repr=%5.3A', 'abc')
+
+        # test width modifier and precision modifier with %s
+        check_format("repr=  abc",
+                     b'repr=%5s', b'abc')
+        check_format("repr=ab",
+                     b'repr=%.2s', b'abc')
+        check_format("repr=   ab",
+                     b'repr=%5.2s', b'abc')
+
+        # test width modifier and precision modifier with %U
+        check_format("repr=  abc",
+                     b'repr=%5U', 'abc')
+        check_format("repr=ab",
+                     b'repr=%.2U', 'abc')
+        check_format("repr=   ab",
+                     b'repr=%5.2U', 'abc')
+
+        # test width modifier and precision modifier with %V
+        check_format("repr=  abc",
+                     b'repr=%5V', 'abc', b'123')
+        check_format("repr=ab",
+                     b'repr=%.2V', 'abc', b'123')
+        check_format("repr=   ab",
+                     b'repr=%5.2V', 'abc', b'123')
+        check_format("repr=  123",
+                     b'repr=%5V', None, b'123')
+        check_format("repr=12",
+                     b'repr=%.2V', None, b'123')
+        check_format("repr=   12",
+                     b'repr=%5.2V', None, b'123')
 
         # test integer formats (%i, %d, %u)
         check_format('010',
@@ -2125,8 +2294,8 @@
                      b'%010i', c_int(123))
         check_format('123'.rjust(100),
                      b'%100i', c_int(123))
-        check_format('123'.rjust(300, '0'),
-                     b'%.300i', c_int(123))
+        check_format('123'.rjust(100, '0'),
+                     b'%.100i', c_int(123))
         check_format('123'.rjust(80, '0').rjust(100),
                      b'%100.80i', c_int(123))
 
@@ -2134,8 +2303,8 @@
                      b'%010u', c_uint(123))
         check_format('123'.rjust(100),
                      b'%100u', c_uint(123))
-        check_format('123'.rjust(300, '0'),
-                     b'%.300u', c_uint(123))
+        check_format('123'.rjust(100, '0'),
+                     b'%.100u', c_uint(123))
         check_format('123'.rjust(80, '0').rjust(100),
                      b'%100.80u', c_uint(123))
 
@@ -2143,8 +2312,8 @@
                      b'%010x', c_int(0x123))
         check_format('123'.rjust(100),
                      b'%100x', c_int(0x123))
-        check_format('123'.rjust(300, '0'),
-                     b'%.300x', c_int(0x123))
+        check_format('123'.rjust(100, '0'),
+                     b'%.100x', c_int(0x123))
         check_format('123'.rjust(80, '0').rjust(100),
                      b'%100.80x', c_int(0x123))
 
@@ -2303,6 +2472,80 @@
                 self.assertNotEqual(abc, abcdef)
                 self.assertEqual(abcdef.decode('unicode_internal'), text)
 
+    def test_compare(self):
+        # Issue #17615
+        N = 10
+        ascii = 'a' * N
+        ascii2 = 'z' * N
+        latin = '\x80' * N
+        latin2 = '\xff' * N
+        bmp = '\u0100' * N
+        bmp2 = '\uffff' * N
+        astral = '\U00100000' * N
+        astral2 = '\U0010ffff' * N
+        strings = (
+            ascii, ascii2,
+            latin, latin2,
+            bmp, bmp2,
+            astral, astral2)
+        for text1, text2 in itertools.combinations(strings, 2):
+            equal = (text1 is text2)
+            self.assertEqual(text1 == text2, equal)
+            self.assertEqual(text1 != text2, not equal)
+
+            if equal:
+                self.assertTrue(text1 <= text2)
+                self.assertTrue(text1 >= text2)
+
+                # text1 is text2: duplicate strings to skip the "str1 == str2"
+                # optimization in unicode_compare_eq() and really compare
+                # character per character
+                copy1 = duplicate_string(text1)
+                copy2 = duplicate_string(text2)
+                self.assertIsNot(copy1, copy2)
+
+                self.assertTrue(copy1 == copy2)
+                self.assertFalse(copy1 != copy2)
+
+                self.assertTrue(copy1 <= copy2)
+                self.assertTrue(copy2 >= copy2)
+
+        self.assertTrue(ascii < ascii2)
+        self.assertTrue(ascii < latin)
+        self.assertTrue(ascii < bmp)
+        self.assertTrue(ascii < astral)
+        self.assertFalse(ascii >= ascii2)
+        self.assertFalse(ascii >= latin)
+        self.assertFalse(ascii >= bmp)
+        self.assertFalse(ascii >= astral)
+
+        self.assertFalse(latin < ascii)
+        self.assertTrue(latin < latin2)
+        self.assertTrue(latin < bmp)
+        self.assertTrue(latin < astral)
+        self.assertTrue(latin >= ascii)
+        self.assertFalse(latin >= latin2)
+        self.assertFalse(latin >= bmp)
+        self.assertFalse(latin >= astral)
+
+        self.assertFalse(bmp < ascii)
+        self.assertFalse(bmp < latin)
+        self.assertTrue(bmp < bmp2)
+        self.assertTrue(bmp < astral)
+        self.assertTrue(bmp >= ascii)
+        self.assertTrue(bmp >= latin)
+        self.assertFalse(bmp >= bmp2)
+        self.assertFalse(bmp >= astral)
+
+        self.assertFalse(astral < ascii)
+        self.assertFalse(astral < latin)
+        self.assertFalse(astral < bmp2)
+        self.assertTrue(astral < astral2)
+        self.assertTrue(astral >= ascii)
+        self.assertTrue(astral >= latin)
+        self.assertTrue(astral >= bmp2)
+        self.assertFalse(astral >= astral2)
+
 
 class StringModuleTest(unittest.TestCase):
     def test_formatter_parser(self):
diff --git a/Lib/test/test_unicodedata.py b/Lib/test/test_unicodedata.py
index 99aa003..707b30e 100644
--- a/Lib/test/test_unicodedata.py
+++ b/Lib/test/test_unicodedata.py
@@ -21,7 +21,7 @@
 class UnicodeMethodsTest(unittest.TestCase):
 
     # update this, if the database changes
-    expectedchecksum = 'bf7a78f1a532421b5033600102e23a92044dbba9'
+    expectedchecksum = 'e74e878de71b6e780ffac271785c3cb58f6251f3'
 
     def test_method_checksum(self):
         h = hashlib.sha1()
@@ -80,7 +80,7 @@
 class UnicodeFunctionsTest(UnicodeDatabaseTest):
 
     # update this, if the database changes
-    expectedchecksum = '17fe2f12b788e4fff5479b469c4404bb6ecf841f'
+    expectedchecksum = 'f0b74d26776331cc7bdc3a4698f037d73f2cee2b'
     def test_function_checksum(self):
         data = []
         h = hashlib.sha1()
diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py
index 2dec4e9..4f38f0f 100644
--- a/Lib/test/test_urllib.py
+++ b/Lib/test/test_urllib.py
@@ -7,8 +7,10 @@
 import email.message
 import io
 import unittest
+from unittest.mock import patch
 from test import support
 import os
+import ssl
 import sys
 import tempfile
 from nturl2path import url2pathname, pathname2url
@@ -16,6 +18,7 @@
 from base64 import b64encode
 import collections
 
+
 def hexescape(char):
     """Escape char as RFC 2396 specifies"""
     hex_repr = hex(ord(char))[2:].upper()
@@ -46,48 +49,73 @@
         return opener.open(url, data)
 
 
+def fakehttp(fakedata):
+    class FakeSocket(io.BytesIO):
+        io_refs = 1
+
+        def sendall(self, data):
+            FakeHTTPConnection.buf = data
+
+        def makefile(self, *args, **kwds):
+            self.io_refs += 1
+            return self
+
+        def read(self, amt=None):
+            if self.closed:
+                return b""
+            return io.BytesIO.read(self, amt)
+
+        def readline(self, length=None):
+            if self.closed:
+                return b""
+            return io.BytesIO.readline(self, length)
+
+        def close(self):
+            self.io_refs -= 1
+            if self.io_refs == 0:
+                io.BytesIO.close(self)
+
+    class FakeHTTPConnection(http.client.HTTPConnection):
+
+        # buffer to store data for verification in urlopen tests.
+        buf = None
+        fakesock = FakeSocket(fakedata)
+
+        def connect(self):
+            self.sock = self.fakesock
+
+    return FakeHTTPConnection
+
+
 class FakeHTTPMixin(object):
     def fakehttp(self, fakedata):
-        class FakeSocket(io.BytesIO):
-            io_refs = 1
-
-            def sendall(self, data):
-                FakeHTTPConnection.buf = data
-
-            def makefile(self, *args, **kwds):
-                self.io_refs += 1
-                return self
-
-            def read(self, amt=None):
-                if self.closed:
-                    return b""
-                return io.BytesIO.read(self, amt)
-
-            def readline(self, length=None):
-                if self.closed:
-                    return b""
-                return io.BytesIO.readline(self, length)
-
-            def close(self):
-                self.io_refs -= 1
-                if self.io_refs == 0:
-                    io.BytesIO.close(self)
-
-        class FakeHTTPConnection(http.client.HTTPConnection):
-
-            # buffer to store data for verification in urlopen tests.
-            buf = None
-
-            def connect(self):
-                self.sock = FakeSocket(fakedata)
-
         self._connection_class = http.client.HTTPConnection
-        http.client.HTTPConnection = FakeHTTPConnection
+        http.client.HTTPConnection = fakehttp(fakedata)
 
     def unfakehttp(self):
         http.client.HTTPConnection = self._connection_class
 
 
+class FakeFTPMixin(object):
+    def fakeftp(self):
+        class FakeFtpWrapper(object):
+            def __init__(self,  user, passwd, host, port, dirs, timeout=None,
+                     persistent=True):
+                pass
+
+            def retrfile(self, file, type):
+                return io.BytesIO(), 0
+
+            def close(self):
+                pass
+
+        self._ftpwrapper_class = urllib.request.ftpwrapper
+        urllib.request.ftpwrapper = FakeFtpWrapper
+
+    def unfakeftp(self):
+        urllib.request.ftpwrapper = self._ftpwrapper_class
+
+
 class urlopen_FileTests(unittest.TestCase):
     """Test urlopen() opening a temporary file.
 
@@ -194,7 +222,7 @@
         self.env.set('NO_PROXY', 'localhost, anotherdomain.com, newdomain.com')
         self.assertTrue(urllib.request.proxy_bypass_environment('anotherdomain.com'))
 
-class urlopen_HttpTests(unittest.TestCase, FakeHTTPMixin):
+class urlopen_HttpTests(unittest.TestCase, FakeHTTPMixin, FakeFTPMixin):
     """Test urlopen() opening a fake http connection."""
 
     def check_read(self, ver):
@@ -238,7 +266,7 @@
         self.check_read(b"1.1")
 
     def test_read_bogus(self):
-        # urlopen() should raise IOError for many error codes.
+        # urlopen() should raise OSError for many error codes.
         self.fakehttp(b'''HTTP/1.1 401 Authentication Required
 Date: Wed, 02 Jan 2008 03:03:54 GMT
 Server: Apache/1.3.33 (Debian GNU/Linux) mod_ssl/2.8.22 OpenSSL/0.9.7e
@@ -246,12 +274,12 @@
 Content-Type: text/html; charset=iso-8859-1
 ''')
         try:
-            self.assertRaises(IOError, urlopen, "http://python.org/")
+            self.assertRaises(OSError, urlopen, "http://python.org/")
         finally:
             self.unfakehttp()
 
     def test_invalid_redirect(self):
-        # urlopen() should raise IOError for many error codes.
+        # urlopen() should raise OSError for many error codes.
         self.fakehttp(b'''HTTP/1.1 302 Found
 Date: Wed, 02 Jan 2008 03:03:54 GMT
 Server: Apache/1.3.33 (Debian GNU/Linux) mod_ssl/2.8.22 OpenSSL/0.9.7e
@@ -266,19 +294,20 @@
             self.unfakehttp()
 
     def test_empty_socket(self):
-        # urlopen() raises IOError if the underlying socket does not send any
+        # urlopen() raises OSError if the underlying socket does not send any
         # data. (#1680230)
         self.fakehttp(b'')
         try:
-            self.assertRaises(IOError, urlopen, "http://something")
+            self.assertRaises(OSError, urlopen, "http://something")
         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):
+        with self.assertRaises(urllib.error.URLError) as e:
             urlopen('file://localhost/a/file/which/doesnot/exists.py')
+        self.assertTrue(e.exception.filename)
+        self.assertTrue(e.exception.reason)
 
     def test_file_notexists(self):
         fd, tmp_file = tempfile.mkstemp()
@@ -291,20 +320,30 @@
             os.close(fd)
             os.unlink(tmp_file)
         self.assertFalse(os.path.exists(tmp_file))
-        # 3.3 - IOError instead of URLError
-        with self.assertRaises(IOError):
+        with self.assertRaises(urllib.error.URLError):
             urlopen(tmp_fileurl)
 
     def test_ftp_nohost(self):
         test_ftp_url = 'ftp:///path'
-        # 3.3 - IOError instead of URLError
-        with self.assertRaises(IOError):
+        with self.assertRaises(urllib.error.URLError) as e:
             urlopen(test_ftp_url)
+        self.assertFalse(e.exception.filename)
+        self.assertTrue(e.exception.reason)
 
     def test_ftp_nonexisting(self):
-        # 3.3 - IOError instead of URLError
-        with self.assertRaises(IOError):
+        with self.assertRaises(urllib.error.URLError) as e:
             urlopen('ftp://localhost/a/file/which/doesnot/exists.py')
+        self.assertFalse(e.exception.filename)
+        self.assertTrue(e.exception.reason)
+
+    @patch.object(urllib.request, 'MAXFTPCACHE', 0)
+    def test_ftp_cache_pruning(self):
+        self.fakeftp()
+        try:
+            urllib.request.ftpcache['test'] = urllib.request.ftpwrapper('user', 'pass', 'localhost', 21, [])
+            urlopen('ftp://localhost')
+        finally:
+            self.unfakeftp()
 
 
     def test_userpass_inurl(self):
@@ -341,6 +380,86 @@
         with support.check_warnings(('',DeprecationWarning)):
             urllib.request.URLopener()
 
+    def test_cafile_and_context(self):
+        context = ssl.create_default_context()
+        with self.assertRaises(ValueError):
+            urllib.request.urlopen(
+                "https://localhost", cafile="/nonexistent/path", context=context
+            )
+
+class urlopen_DataTests(unittest.TestCase):
+    """Test urlopen() opening a data URL."""
+
+    def setUp(self):
+        # text containing URL special- and unicode-characters
+        self.text = "test data URLs :;,%=& \u00f6 \u00c4 "
+        # 2x1 pixel RGB PNG image with one black and one white pixel
+        self.image = (
+            b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x02\x00\x00\x00'
+            b'\x01\x08\x02\x00\x00\x00{@\xe8\xdd\x00\x00\x00\x01sRGB\x00\xae'
+            b'\xce\x1c\xe9\x00\x00\x00\x0fIDAT\x08\xd7c```\xf8\xff\xff?\x00'
+            b'\x06\x01\x02\xfe\no/\x1e\x00\x00\x00\x00IEND\xaeB`\x82')
+
+        self.text_url = (
+            "data:text/plain;charset=UTF-8,test%20data%20URLs%20%3A%3B%2C%25%3"
+            "D%26%20%C3%B6%20%C3%84%20")
+        self.text_url_base64 = (
+            "data:text/plain;charset=ISO-8859-1;base64,dGVzdCBkYXRhIFVSTHMgOjs"
+            "sJT0mIPYgxCA%3D")
+        # base64 encoded data URL that contains ignorable spaces,
+        # such as "\n", " ", "%0A", and "%20".
+        self.image_url = (
+            "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAABCAIAAAB7\n"
+            "QOjdAAAAAXNSR0IArs4c6QAAAA9JREFUCNdj%0AYGBg%2BP//PwAGAQL%2BCm8 "
+            "vHgAAAABJRU5ErkJggg%3D%3D%0A%20")
+
+        self.text_url_resp = urllib.request.urlopen(self.text_url)
+        self.text_url_base64_resp = urllib.request.urlopen(
+            self.text_url_base64)
+        self.image_url_resp = urllib.request.urlopen(self.image_url)
+
+    def test_interface(self):
+        # Make sure object returned by urlopen() has the specified methods
+        for attr in ("read", "readline", "readlines",
+                     "close", "info", "geturl", "getcode", "__iter__"):
+            self.assertTrue(hasattr(self.text_url_resp, attr),
+                         "object returned by urlopen() lacks %s attribute" %
+                         attr)
+
+    def test_info(self):
+        self.assertIsInstance(self.text_url_resp.info(), email.message.Message)
+        self.assertEqual(self.text_url_base64_resp.info().get_params(),
+            [('text/plain', ''), ('charset', 'ISO-8859-1')])
+        self.assertEqual(self.image_url_resp.info()['content-length'],
+            str(len(self.image)))
+        self.assertEqual(urllib.request.urlopen("data:,").info().get_params(),
+            [('text/plain', ''), ('charset', 'US-ASCII')])
+
+    def test_geturl(self):
+        self.assertEqual(self.text_url_resp.geturl(), self.text_url)
+        self.assertEqual(self.text_url_base64_resp.geturl(),
+            self.text_url_base64)
+        self.assertEqual(self.image_url_resp.geturl(), self.image_url)
+
+    def test_read_text(self):
+        self.assertEqual(self.text_url_resp.read().decode(
+            dict(self.text_url_resp.info().get_params())['charset']), self.text)
+
+    def test_read_text_base64(self):
+        self.assertEqual(self.text_url_base64_resp.read().decode(
+            dict(self.text_url_base64_resp.info().get_params())['charset']),
+            self.text)
+
+    def test_read_image(self):
+        self.assertEqual(self.image_url_resp.read(), self.image)
+
+    def test_missing_comma(self):
+        self.assertRaises(ValueError,urllib.request.urlopen,'data:text/plain')
+
+    def test_invalid_base64_data(self):
+        # missing padding character
+        self.assertRaises(ValueError,urllib.request.urlopen,'data:;base64,Cg=')
+
 class urlretrieve_FileTests(unittest.TestCase):
     """Test urllib.urlretrieve() on local files"""
 
@@ -1291,6 +1410,7 @@
 #         self.assertEqual(ftp.ftp.sock.gettimeout(), 30)
 #         ftp.close()
 
+
 class RequestTests(unittest.TestCase):
     """Unit tests for urllib.request.Request."""
 
diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py
index d069139..c746b9a 100644
--- a/Lib/test/test_urllib2.py
+++ b/Lib/test/test_urllib2.py
@@ -1,5 +1,6 @@
 import unittest
 from test import support
+from test import test_urllib
 
 import os
 import io
@@ -10,8 +11,10 @@
 import urllib.request
 # The proxy bypass method imported below has logic specific to the OSX
 # proxy config data structure but is testable on all platforms.
-from urllib.request import Request, OpenerDirector, _proxy_bypass_macosx_sysconf
+from urllib.request import Request, OpenerDirector, _parse_proxy, _proxy_bypass_macosx_sysconf
+from urllib.parse import urlparse
 import urllib.error
+import http.client
 
 # XXX
 # Request
@@ -41,7 +44,7 @@
         self.assertRaises(ValueError, urllib.request.urlopen, 'bogus url')
 
         # XXX Name hacking to get this to work on Windows.
-        fname = os.path.abspath(urllib.request.__file__).replace('\\', '/')
+        fname = os.path.abspath(urllib.request.__file__).replace(os.sep, '/')
 
         if os.name == 'nt':
             file_url = "file:///%s" % fname
@@ -118,6 +121,15 @@
         self.assertIsNone(req.get_header("Not-there"))
         self.assertEqual(req.get_header("Not-there", "default"), "default")
 
+        req.remove_header("Spam-eggs")
+        self.assertFalse(req.has_header("Spam-eggs"))
+
+        req.add_unredirected_header("Unredirected-spam", "Eggs")
+        self.assertTrue(req.has_header("Unredirected-spam"))
+
+        req.remove_header("Unredirected-spam")
+        self.assertFalse(req.has_header("Unredirected-spam"))
+
 
     def test_password_manager(self):
         mgr = urllib.request.HTTPPasswordMgr()
@@ -311,8 +323,7 @@
         if body:
             self.data = body
         if self.raise_on_endheaders:
-            import socket
-            raise socket.error()
+            raise OSError()
     def getresponse(self):
         return MockHTTPResponse(MockFile(), {}, 200, "OK")
 
@@ -597,27 +608,6 @@
                 if args[1] is not None:
                     self.assertIsInstance(args[1], MockResponse)
 
-    def test_method_deprecations(self):
-        req = Request("http://www.example.com")
-
-        with self.assertWarns(DeprecationWarning):
-            req.add_data("data")
-        with self.assertWarns(DeprecationWarning):
-            req.get_data()
-        with self.assertWarns(DeprecationWarning):
-            req.has_data()
-        with self.assertWarns(DeprecationWarning):
-            req.get_host()
-        with self.assertWarns(DeprecationWarning):
-            req.get_selector()
-        with self.assertWarns(DeprecationWarning):
-            req.is_unverifiable()
-        with self.assertWarns(DeprecationWarning):
-            req.get_origin_req_host()
-        with self.assertWarns(DeprecationWarning):
-            req.get_type()
-
-
 def sanepathname2url(path):
     try:
         path.encode("utf-8")
@@ -690,7 +680,7 @@
             self.assertEqual(int(headers["Content-length"]), len(data))
 
     def test_file(self):
-        import email.utils, socket
+        import email.utils
         h = urllib.request.FileHandler()
         o = h.parent = MockOpener()
 
@@ -737,6 +727,7 @@
         for url in [
             "file://localhost:80%s" % urlpath,
             "file:///file_does_not_exist.txt",
+            "file://not-a-local-host.com//dir/file.txt",
             "file://%s:80%s/%s" % (socket.gethostbyname('localhost'),
                                    os.getcwd(), TESTFN),
             "file://somerandomhost.ontheinternet.com%s/%s" %
@@ -812,7 +803,7 @@
                               ("Foo", "bar"), ("Spam", "eggs")])
             self.assertEqual(http.data, data)
 
-        # check socket.error converted to URLError
+        # check OSError converted to URLError
         http.raise_on_endheaders = True
         self.assertRaises(urllib.error.URLError, h.do_open, http, req)
 
@@ -917,6 +908,36 @@
             p_ds_req = h.do_request_(ds_req)
             self.assertEqual(p_ds_req.unredirected_hdrs["Host"],"example.com")
 
+    def test_full_url_setter(self):
+        # Checks to ensure that components are set correctly after setting the
+        # full_url of a Request object
+
+        urls = [
+            'http://example.com?foo=bar#baz',
+            'http://example.com?foo=bar&spam=eggs#bash',
+            'http://example.com',
+        ]
+
+        # testing a reusable request instance, but the url parameter is
+        # required, so just use a dummy one to instantiate
+        r = Request('http://example.com')
+        for url in urls:
+            r.full_url = url
+            parsed = urlparse(url)
+
+            self.assertEqual(r.get_full_url(), url)
+            # full_url setter uses splittag to split into components.
+            # splittag sets the fragment as None while urlparse sets it to ''
+            self.assertEqual(r.fragment or '', parsed.fragment)
+            self.assertEqual(urlparse(r.get_full_url()).query, parsed.query)
+
+    def test_full_url_deleter(self):
+        r = Request('http://www.example.com')
+        del r.full_url
+        self.assertIsNone(r.full_url)
+        self.assertIsNone(r.fragment)
+        self.assertEqual(r.selector, '')
+
     def test_fixpath_in_weirdurls(self):
         # Issue4493: urllib2 to supply '/' when to urls where path does not
         # start with'/'
@@ -1374,6 +1395,33 @@
         self.assertEqual(len(http_handler.requests), 1)
         self.assertFalse(http_handler.requests[0].has_header(auth_header))
 
+    def test_http_closed(self):
+        """Test the connection is cleaned up when the response is closed"""
+        for (transfer, data) in (
+            ("Connection: close", b"data"),
+            ("Transfer-Encoding: chunked", b"4\r\ndata\r\n0\r\n\r\n"),
+            ("Content-Length: 4", b"data"),
+        ):
+            header = "HTTP/1.1 200 OK\r\n{}\r\n\r\n".format(transfer)
+            conn = test_urllib.fakehttp(header.encode() + data)
+            handler = urllib.request.AbstractHTTPHandler()
+            req = Request("http://dummy/")
+            req.timeout = None
+            with handler.do_open(conn, req) as resp:
+                resp.read()
+            self.assertTrue(conn.fakesock.closed,
+                "Connection not closed with {!r}".format(transfer))
+
+    def test_invalid_closed(self):
+        """Test the connection is cleaned up after an invalid response"""
+        conn = test_urllib.fakehttp(b"")
+        handler = urllib.request.AbstractHTTPHandler()
+        req = Request("http://dummy/")
+        req.timeout = None
+        with self.assertRaises(http.client.BadStatusLine):
+            handler.do_open(conn, req)
+        self.assertTrue(conn.fakesock.closed, "Connection not closed")
+
 
 class MiscTests(unittest.TestCase):
 
@@ -1418,6 +1466,21 @@
         self.opener_has_handler(o, MyHTTPHandler)
         self.opener_has_handler(o, MyOtherHTTPHandler)
 
+    @unittest.skipUnless(support.is_resource_enabled('network'),
+                         'test requires network access')
+    def test_issue16464(self):
+        opener = urllib.request.build_opener()
+        request = urllib.request.Request("http://www.example.com/")
+        self.assertEqual(None, request.data)
+
+        opener.open(request, "1".encode("us-ascii"))
+        self.assertEqual(b"1", request.data)
+        self.assertEqual("1", request.get_header("Content-length"))
+
+        opener.open(request, "1234567890".encode("us-ascii"))
+        self.assertEqual(b"1234567890", request.data)
+        self.assertEqual("10", request.get_header("Content-length"))
+
     def test_HTTPError_interface(self):
         """
         Issue 13211 reveals that HTTPError didn't implement the URLError
@@ -1429,23 +1492,68 @@
         err = urllib.error.HTTPError(url, code, msg, hdrs, fp)
         self.assertTrue(hasattr(err, 'reason'))
         self.assertEqual(err.reason, 'something bad happened')
-        self.assertTrue(hasattr(err, 'hdrs'))
-        self.assertEqual(err.hdrs, 'Content-Length: 42')
+        self.assertTrue(hasattr(err, 'headers'))
+        self.assertEqual(err.headers, 'Content-Length: 42')
         expected_errmsg = 'HTTP Error %s: %s' % (err.code, err.msg)
         self.assertEqual(str(err), expected_errmsg)
 
+    def test_parse_proxy(self):
+        parse_proxy_test_cases = [
+            ('proxy.example.com',
+             (None, None, None, 'proxy.example.com')),
+            ('proxy.example.com:3128',
+             (None, None, None, 'proxy.example.com:3128')),
+            ('proxy.example.com', (None, None, None, 'proxy.example.com')),
+            ('proxy.example.com:3128',
+             (None, None, None, 'proxy.example.com:3128')),
+            # The authority component may optionally include userinfo
+            # (assumed to be # username:password):
+            ('joe:password@proxy.example.com',
+             (None, 'joe', 'password', 'proxy.example.com')),
+            ('joe:password@proxy.example.com:3128',
+             (None, 'joe', 'password', 'proxy.example.com:3128')),
+            #Examples with URLS
+            ('http://proxy.example.com/',
+             ('http', None, None, 'proxy.example.com')),
+            ('http://proxy.example.com:3128/',
+             ('http', None, None, 'proxy.example.com:3128')),
+            ('http://joe:password@proxy.example.com/',
+             ('http', 'joe', 'password', 'proxy.example.com')),
+            ('http://joe:password@proxy.example.com:3128',
+             ('http', 'joe', 'password', 'proxy.example.com:3128')),
+            # Everything after the authority is ignored
+            ('ftp://joe:password@proxy.example.com/rubbish:3128',
+             ('ftp', 'joe', 'password', 'proxy.example.com')),
+            # Test for no trailing '/' case
+            ('http://joe:password@proxy.example.com',
+             ('http', 'joe', 'password', 'proxy.example.com'))
+        ]
+
+        for tc, expected in parse_proxy_test_cases:
+            self.assertEqual(_parse_proxy(tc), expected)
+
+        self.assertRaises(ValueError, _parse_proxy, 'file:/ftp.example.com'),
 
 class RequestTests(unittest.TestCase):
+    class PutRequest(Request):
+        method='PUT'
 
     def setUp(self):
         self.get = Request("http://www.python.org/~jeremy/")
         self.post = Request("http://www.python.org/~jeremy/",
                             "data",
                             headers={"X-Test": "test"})
+        self.head = Request("http://www.python.org/~jeremy/", method='HEAD')
+        self.put = self.PutRequest("http://www.python.org/~jeremy/")
+        self.force_post = self.PutRequest("http://www.python.org/~jeremy/",
+            method="POST")
 
     def test_method(self):
         self.assertEqual("POST", self.post.get_method())
         self.assertEqual("GET", self.get.get_method())
+        self.assertEqual("HEAD", self.head.get_method())
+        self.assertEqual("PUT", self.put.get_method())
+        self.assertEqual("POST", self.force_post.get_method())
 
     def test_data(self):
         self.assertFalse(self.get.data)
@@ -1454,6 +1562,25 @@
         self.assertTrue(self.get.data)
         self.assertEqual("POST", self.get.get_method())
 
+    # issue 16464
+    # if we change data we need to remove content-length header
+    # (cause it's most probably calculated for previous value)
+    def test_setting_data_should_remove_content_length(self):
+        self.assertNotIn("Content-length", self.get.unredirected_hdrs)
+        self.get.add_unredirected_header("Content-length", 42)
+        self.assertEqual(42, self.get.unredirected_hdrs["Content-length"])
+        self.get.data = "spam"
+        self.assertNotIn("Content-length", self.get.unredirected_hdrs)
+
+    # issue 17485 same for deleting data.
+    def test_deleting_data_should_remove_content_length(self):
+        self.assertNotIn("Content-length", self.get.unredirected_hdrs)
+        self.get.data = 'foo'
+        self.get.add_unredirected_header("Content-length", 3)
+        self.assertEqual(3, self.get.unredirected_hdrs["Content-length"])
+        del self.get.data
+        self.assertNotIn("Content-length", self.get.unredirected_hdrs)
+
     def test_get_full_url(self):
         self.assertEqual("http://www.python.org/~jeremy/",
                          self.get.get_full_url())
@@ -1495,21 +1622,13 @@
         req = Request(url)
         self.assertEqual(req.get_full_url(), url)
 
-    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_url_fullurl_get_full_url(self):
+        urls = ['http://docs.python.org',
+                'http://docs.python.org/library/urllib2.html#OK',
+                'http://www.python.org/?qs=query#fragment=true' ]
+        for url in urls:
+            req = Request(url)
+            self.assertEqual(req.get_full_url(), req.full_url)
 
 def test_main(verbose=None):
     from test import test_urllib2
diff --git a/Lib/test/test_urllib2_localnet.py b/Lib/test/test_urllib2_localnet.py
index 31c638f..0650aa2 100644
--- a/Lib/test/test_urllib2_localnet.py
+++ b/Lib/test/test_urllib2_localnet.py
@@ -1,3 +1,4 @@
+import base64
 import os
 import email
 import urllib.parse
@@ -5,9 +6,15 @@
 import http.server
 import unittest
 import hashlib
+
 from test import support
+
 threading = support.import_module('threading')
 
+try:
+    import ssl
+except ImportError:
+    ssl = None
 
 here = os.path.dirname(__file__)
 # Self-signed cert file for 'localhost'
@@ -15,6 +22,7 @@
 # Self-signed cert file for 'fakehostname'
 CERT_fakehostname = os.path.join(here, 'keycert2.pem')
 
+
 # Loopback http server infrastructure
 
 class LoopbackHttpServer(http.server.HTTPServer):
@@ -53,14 +61,11 @@
         request_handler.protocol_version = "HTTP/1.0"
         self.httpd = LoopbackHttpServer(("127.0.0.1", 0),
                                         request_handler)
-        #print "Serving HTTP on %s port %s" % (self.httpd.server_name,
-        #                                      self.httpd.server_port)
         self.port = self.httpd.server_port
 
     def stop(self):
         """Stops the webserver if it's currently running."""
 
-        # Set the stop flag.
         self._stop_server = True
 
         self.join()
@@ -193,6 +198,49 @@
                 return self._return_auth_challenge(request_handler)
             return True
 
+
+class BasicAuthHandler(http.server.BaseHTTPRequestHandler):
+    """Handler for performing basic authentication."""
+    # Server side values
+    USER = 'testUser'
+    PASSWD = 'testPass'
+    REALM = 'Test'
+    USER_PASSWD = "%s:%s" % (USER, PASSWD)
+    ENCODED_AUTH = base64.b64encode(USER_PASSWD.encode('ascii')).decode('ascii')
+
+    def __init__(self, *args, **kwargs):
+        http.server.BaseHTTPRequestHandler.__init__(self, *args, **kwargs)
+
+    def log_message(self, format, *args):
+        # Suppress console log message
+        pass
+
+    def do_HEAD(self):
+        self.send_response(200)
+        self.send_header("Content-type", "text/html")
+        self.end_headers()
+
+    def do_AUTHHEAD(self):
+        self.send_response(401)
+        self.send_header("WWW-Authenticate", "Basic realm=\"%s\"" % self.REALM)
+        self.send_header("Content-type", "text/html")
+        self.end_headers()
+
+    def do_GET(self):
+        if not self.headers.get("Authorization", ""):
+            self.do_AUTHHEAD()
+            self.wfile.write(b"No Auth header received")
+        elif self.headers.get(
+                "Authorization", "") == "Basic " + self.ENCODED_AUTH:
+            self.send_response(200)
+            self.end_headers()
+            self.wfile.write(b"It works")
+        else:
+            # Request Unauthorized
+            self.do_AUTHHEAD()
+
+
+
 # Proxy test infrastructure
 
 class FakeProxyHandler(http.server.BaseHTTPRequestHandler):
@@ -228,6 +276,44 @@
 
 # Test cases
 
+@unittest.skipUnless(threading, "Threading required for this test.")
+class BasicAuthTests(unittest.TestCase):
+    USER = "testUser"
+    PASSWD = "testPass"
+    INCORRECT_PASSWD = "Incorrect"
+    REALM = "Test"
+
+    def setUp(self):
+        super(BasicAuthTests, self).setUp()
+        # With Basic Authentication
+        def http_server_with_basic_auth_handler(*args, **kwargs):
+            return BasicAuthHandler(*args, **kwargs)
+        self.server = LoopbackHttpServerThread(http_server_with_basic_auth_handler)
+        self.server_url = 'http://127.0.0.1:%s' % self.server.port
+        self.server.start()
+        self.server.ready.wait()
+
+    def tearDown(self):
+        self.server.stop()
+        super(BasicAuthTests, self).tearDown()
+
+    def test_basic_auth_success(self):
+        ah = urllib.request.HTTPBasicAuthHandler()
+        ah.add_password(self.REALM, self.server_url, self.USER, self.PASSWD)
+        urllib.request.install_opener(urllib.request.build_opener(ah))
+        try:
+            self.assertTrue(urllib.request.urlopen(self.server_url))
+        except urllib.error.HTTPError:
+            self.fail("Basic auth failed for the url: %s", self.server_url)
+
+    def test_basic_auth_httperror(self):
+        ah = urllib.request.HTTPBasicAuthHandler()
+        ah.add_password(self.REALM, self.server_url, self.USER, self.INCORRECT_PASSWD)
+        urllib.request.install_opener(urllib.request.build_opener(ah))
+        self.assertRaises(urllib.error.HTTPError, urllib.request.urlopen, self.server_url)
+
+
+@unittest.skipUnless(threading, "Threading required for this test.")
 class ProxyAuthTests(unittest.TestCase):
     URL = "http://localhost"
 
@@ -240,6 +326,7 @@
         self.digest_auth_handler = DigestAuthHandler()
         self.digest_auth_handler.set_users({self.USER: self.PASSWD})
         self.digest_auth_handler.set_realm(self.REALM)
+        # With Digest Authentication.
         def create_fake_proxy_handler(*args, **kwargs):
             return FakeProxyHandler(self.digest_auth_handler, *args, **kwargs)
 
@@ -339,6 +426,7 @@
     return FakeHTTPRequestHandler
 
 
+@unittest.skipUnless(threading, "Threading required for this test.")
 class TestUrlopen(unittest.TestCase):
     """Tests urllib.request.urlopen using the network.
 
@@ -387,14 +475,14 @@
         handler.port = port
         return handler
 
-    def start_https_server(self, responses=None, certfile=CERT_localhost):
+    def start_https_server(self, responses=None, **kwargs):
         if not hasattr(urllib.request, 'HTTPSHandler'):
             self.skipTest('ssl support required')
         from test.ssl_servers import make_https_server
         if responses is None:
             responses = [(200, [], b"we care a bit")]
         handler = GetRequestHandler(responses)
-        server = make_https_server(self, certfile=certfile, handler_class=handler)
+        server = make_https_server(self, handler_class=handler, **kwargs)
         handler.port = server.port
         return handler
 
@@ -457,12 +545,12 @@
 
     def test_https(self):
         handler = self.start_https_server()
-        data = self.urlopen("https://localhost:%s/bizarre" % handler.port)
+        context = ssl.create_default_context(cafile=CERT_localhost)
+        data = self.urlopen("https://localhost:%s/bizarre" % handler.port, context=context)
         self.assertEqual(data, b"we care a bit")
 
     def test_https_with_cafile(self):
         handler = self.start_https_server(certfile=CERT_localhost)
-        import ssl
         # Good cert
         data = self.urlopen("https://localhost:%s/bizarre" % handler.port,
                             cafile=CERT_localhost)
@@ -484,6 +572,22 @@
             self.urlopen("https://localhost:%s/bizarre" % handler.port,
                          cadefault=True)
 
+    def test_https_sni(self):
+        if ssl is None:
+            self.skipTest("ssl module required")
+        if not ssl.HAS_SNI:
+            self.skipTest("SNI support required in OpenSSL")
+        sni_name = None
+        def cb_sni(ssl_sock, server_name, initial_context):
+            nonlocal sni_name
+            sni_name = server_name
+        context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+        context.set_servername_callback(cb_sni)
+        handler = self.start_https_server(context=context, certfile=CERT_localhost)
+        context = ssl.create_default_context(cafile=CERT_localhost)
+        self.urlopen("https://localhost:%s" % handler.port, context=context)
+        self.assertEqual(sni_name, "localhost")
+
     def test_sending_headers(self):
         handler = self.start_server()
         req = urllib.request.Request("http://localhost:%s/" % handler.port,
@@ -530,7 +634,7 @@
         # so we run the test only when -unetwork/-uall is specified to
         # mitigate the problem a bit (see #17564)
         support.requires('network')
-        self.assertRaises(IOError,
+        self.assertRaises(OSError,
                           # Given that both VeriSign and various ISPs have in
                           # the past or are presently hijacking various invalid
                           # domain name requests in an attempt to boost traffic
@@ -571,9 +675,17 @@
         self.assertEqual(index + 1, len(lines))
 
 
-@support.reap_threads
-def test_main():
-    support.run_unittest(ProxyAuthTests, TestUrlopen)
+threads_key = None
+
+def setUpModule():
+    # Store the threading_setup in a key and ensure that it is cleaned up
+    # in the tearDown
+    global threads_key
+    threads_key = support.threading_setup()
+
+def tearDownModule():
+    if threads_key:
+        support.threading_cleanup(threads_key)
 
 if __name__ == "__main__":
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_urllib2net.py b/Lib/test/test_urllib2net.py
index f618ecf..fc21408 100644
--- a/Lib/test/test_urllib2net.py
+++ b/Lib/test/test_urllib2net.py
@@ -7,10 +7,8 @@
 import urllib.error
 import urllib.request
 import sys
-try:
-    import ssl
-except ImportError:
-    ssl = None
+
+support.requires("network")
 
 TIMEOUT = 60  # seconds
 
@@ -81,7 +79,7 @@
     def test_close(self):
         # calling .close() on urllib2's response objects should close the
         # underlying socket
-        url = "http://www.python.org/"
+        url = "http://www.example.com/"
         with support.transient_internet(url):
             response = _urlopen_with_retry(url)
             sock = response.fp
@@ -101,9 +99,9 @@
 
     def test_ftp(self):
         urls = [
-            'ftp://ftp.kernel.org/pub/linux/kernel/README',
-            'ftp://ftp.kernel.org/pub/linux/kernel/non-existent-file',
-            #'ftp://ftp.kernel.org/pub/leenox/kernel/test',
+            'ftp://ftp.debian.org/debian/README',
+            ('ftp://ftp.debian.org/debian/non-existent-file',
+             None, urllib.error.URLError),
             'ftp://gatekeeper.research.compaq.com/pub/DEC/SRC'
                 '/research-reports/00README-Legal-Rules-Regs',
             ]
@@ -162,6 +160,14 @@
             self.assertEqual(res.geturl(),
                     "http://www.pythontest.net/index.html#frag")
 
+    def test_redirect_url_withfrag(self):
+        redirect_url_with_frag = "http://www.pythontest.net/redir/with_frag/"
+        with support.transient_internet(redirect_url_with_frag):
+            req = urllib.request.Request(redirect_url_with_frag)
+            res = urllib.request.urlopen(req)
+            self.assertEqual(res.geturl(),
+                    "http://www.pythontest.net/elsewhere/#frag")
+
     def test_custom_headers(self):
         url = "http://www.example.com"
         with support.transient_internet(url):
@@ -205,39 +211,34 @@
             urlopen = _wrap_with_retry_thrice(urlopen, urllib.error.URLError)
 
         for url in urls:
-            if isinstance(url, tuple):
-                url, req, expected_err = url
-            else:
-                req = expected_err = None
-
-            with support.transient_internet(url):
-                debug(url)
-                try:
-                    f = urlopen(url, req, TIMEOUT)
-                except EnvironmentError as err:
-                    debug(err)
-                    if expected_err:
-                        msg = ("Didn't get expected error(s) %s for %s %s, got %s: %s" %
-                               (expected_err, url, req, type(err), err))
-                        self.assertIsInstance(err, expected_err, msg)
-                except urllib.error.URLError as err:
-                    if isinstance(err[0], socket.timeout):
-                        print("<timeout: %s>" % url, file=sys.stderr)
-                        continue
-                    else:
-                        raise
+            with self.subTest(url=url):
+                if isinstance(url, tuple):
+                    url, req, expected_err = url
                 else:
+                    req = expected_err = None
+
+                with support.transient_internet(url):
                     try:
-                        with support.time_out, \
-                             support.socket_peer_reset, \
-                             support.ioerror_peer_reset:
-                            buf = f.read()
-                            debug("read %d bytes" % len(buf))
-                    except socket.timeout:
-                        print("<timeout: %s>" % url, file=sys.stderr)
-                    f.close()
-            debug("******** next url coming up...")
-            time.sleep(0.1)
+                        f = urlopen(url, req, TIMEOUT)
+                    # urllib.error.URLError is a subclass of OSError
+                    except OSError as err:
+                        if expected_err:
+                            msg = ("Didn't get expected error(s) %s for %s %s, got %s: %s" %
+                                   (expected_err, url, req, type(err), err))
+                            self.assertIsInstance(err, expected_err, msg)
+                        else:
+                            raise
+                    else:
+                        try:
+                            with support.time_out, \
+                                 support.socket_peer_reset, \
+                                 support.ioerror_peer_reset:
+                                buf = f.read()
+                                debug("read %d bytes" % len(buf))
+                        except socket.timeout:
+                            print("<timeout: %s>" % url, file=sys.stderr)
+                        f.close()
+                time.sleep(0.1)
 
     def _extra_handlers(self):
         handlers = []
@@ -253,7 +254,7 @@
 class TimeoutTest(unittest.TestCase):
     def test_http_basic(self):
         self.assertIsNone(socket.getdefaulttimeout())
-        url = "http://www.python.org"
+        url = "http://www.example.com"
         with support.transient_internet(url, timeout=None):
             u = _urlopen_with_retry(url)
             self.addCleanup(u.close)
@@ -261,7 +262,7 @@
 
     def test_http_default_timeout(self):
         self.assertIsNone(socket.getdefaulttimeout())
-        url = "http://www.python.org"
+        url = "http://www.example.com"
         with support.transient_internet(url):
             socket.setdefaulttimeout(60)
             try:
@@ -273,7 +274,7 @@
 
     def test_http_no_timeout(self):
         self.assertIsNone(socket.getdefaulttimeout())
-        url = "http://www.python.org"
+        url = "http://www.example.com"
         with support.transient_internet(url):
             socket.setdefaulttimeout(60)
             try:
@@ -284,7 +285,7 @@
             self.assertIsNone(u.fp.raw._sock.gettimeout())
 
     def test_http_timeout(self):
-        url = "http://www.python.org"
+        url = "http://www.example.com"
         with support.transient_internet(url):
             u = _urlopen_with_retry(url, timeout=120)
             self.addCleanup(u.close)
@@ -328,35 +329,5 @@
             self.assertEqual(u.fp.fp.raw._sock.gettimeout(), 60)
 
 
-@unittest.skipUnless(ssl, "requires SSL support")
-class HTTPSTests(unittest.TestCase):
-
-    def test_sni(self):
-        self.skipTest("test disabled - test server needed")
-        # Checks that Server Name Indication works, if supported by the
-        # OpenSSL linked to.
-        # The ssl module itself doesn't have server-side support for SNI,
-        # so we rely on a third-party test site.
-        expect_sni = ssl.HAS_SNI
-        with support.transient_internet("XXX"):
-            u = urllib.request.urlopen("XXX")
-            contents = u.readall()
-            if expect_sni:
-                self.assertIn(b"Great", contents)
-                self.assertNotIn(b"Unfortunately", contents)
-            else:
-                self.assertNotIn(b"Great", contents)
-                self.assertIn(b"Unfortunately", contents)
-
-
-def test_main():
-    support.requires("network")
-    support.run_unittest(AuthTests,
-                         HTTPSTests,
-                         OtherNetworkTests,
-                         CloseSocketTest,
-                         TimeoutTest,
-                         )
-
 if __name__ == "__main__":
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_urllib_response.py b/Lib/test/test_urllib_response.py
index fdd3325..0eb5942 100644
--- a/Lib/test/test_urllib_response.py
+++ b/Lib/test/test_urllib_response.py
@@ -1,42 +1,59 @@
 """Unit tests for code in urllib.response."""
 
-import test.support
+import socket
+import tempfile
 import urllib.response
 import unittest
 
-class TestFile(object):
-
-    def __init__(self):
-        self.closed = False
-
-    def read(self, bytes):
-        pass
-
-    def readline(self):
-        pass
-
-    def close(self):
-        self.closed = True
-
-class Testaddbase(unittest.TestCase):
-
-    # TODO(jhylton): Write tests for other functionality of addbase()
+class TestResponse(unittest.TestCase):
 
     def setUp(self):
-        self.fp = TestFile()
-        self.addbase = urllib.response.addbase(self.fp)
+        self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+        self.fp = self.sock.makefile('rb')
+        self.test_headers = {"Host": "www.python.org",
+                             "Connection": "close"}
 
     def test_with(self):
+        addbase = urllib.response.addbase(self.fp)
+
+        self.assertIsInstance(addbase, tempfile._TemporaryFileWrapper)
+
         def f():
-            with self.addbase as spam:
+            with addbase as spam:
                 pass
         self.assertFalse(self.fp.closed)
         f()
         self.assertTrue(self.fp.closed)
         self.assertRaises(ValueError, f)
 
-def test_main():
-    test.support.run_unittest(Testaddbase)
+    def test_addclosehook(self):
+        closehook_called = False
+
+        def closehook():
+            nonlocal closehook_called
+            closehook_called = True
+
+        closehook = urllib.response.addclosehook(self.fp, closehook)
+        closehook.close()
+
+        self.assertTrue(self.fp.closed)
+        self.assertTrue(closehook_called)
+
+    def test_addinfo(self):
+        info = urllib.response.addinfo(self.fp, self.test_headers)
+        self.assertEqual(info.info(), self.test_headers)
+
+    def test_addinfourl(self):
+        url = "http://www.python.org"
+        code = 200
+        infourl = urllib.response.addinfourl(self.fp, self.test_headers,
+                                             url, code)
+        self.assertEqual(infourl.info(), self.test_headers)
+        self.assertEqual(infourl.geturl(), url)
+        self.assertEqual(infourl.getcode(), code)
+
+    def tearDown(self):
+        self.sock.close()
 
 if __name__ == '__main__':
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_urllibnet.py b/Lib/test/test_urllibnet.py
index 31b61f1..4c8ba2d 100644
--- a/Lib/test/test_urllibnet.py
+++ b/Lib/test/test_urllibnet.py
@@ -10,6 +10,8 @@
 import time
 
 
+support.requires('network')
+
 class URLTimeoutTest(unittest.TestCase):
     # XXX this test doesn't seem to test anything useful.
 
@@ -22,8 +24,8 @@
         socket.setdefaulttimeout(None)
 
     def testURLread(self):
-        with support.transient_internet("www.python.org"):
-            f = urllib.request.urlopen("http://www.python.org/")
+        with support.transient_internet("www.example.com"):
+            f = urllib.request.urlopen("http://www.example.com/")
             x = f.read()
 
 
@@ -36,7 +38,7 @@
     for transparent redirection have been written.
 
     setUp is not used for always constructing a connection to
-    http://www.python.org/ since there a few tests that don't use that address
+    http://www.example.com/ since there a few tests that don't use that address
     and making a connection is expensive enough to warrant minimizing unneeded
     connections.
 
@@ -54,7 +56,7 @@
 
     def test_basic(self):
         # Simple test expected to pass.
-        with self.urlopen("http://www.python.org/") as open_url:
+        with self.urlopen("http://www.example.com/") as open_url:
             for attr in ("read", "readline", "readlines", "fileno", "close",
                          "info", "geturl"):
                 self.assertTrue(hasattr(open_url, attr), "object returned from "
@@ -63,7 +65,7 @@
 
     def test_readlines(self):
         # Test both readline and readlines.
-        with self.urlopen("http://www.python.org/") as open_url:
+        with self.urlopen("http://www.example.com/") as open_url:
             self.assertIsInstance(open_url.readline(), bytes,
                                   "readline did not return a string")
             self.assertIsInstance(open_url.readlines(), list,
@@ -71,7 +73,7 @@
 
     def test_info(self):
         # Test 'info'.
-        with self.urlopen("http://www.python.org/") as open_url:
+        with self.urlopen("http://www.example.com/") as open_url:
             info_obj = open_url.info()
             self.assertIsInstance(info_obj, email.message.Message,
                                   "object returned by 'info' is not an "
@@ -80,14 +82,14 @@
 
     def test_geturl(self):
         # Make sure same URL as opened is returned by geturl.
-        URL = "https://www.python.org/"
+        URL = "http://www.example.com/"
         with self.urlopen(URL) as open_url:
             gotten_url = open_url.geturl()
             self.assertEqual(gotten_url, URL)
 
     def test_getcode(self):
         # test getcode() with the fancy opener to get 404 error codes
-        URL = "http://www.python.org/XXXinvalidXXX"
+        URL = "http://www.example.com/XXXinvalidXXX"
         with support.transient_internet(URL):
             open_url = urllib.request.FancyURLopener().open(URL)
             try:
@@ -101,7 +103,7 @@
     @unittest.skipIf(sys.platform in ('win32',), 'not appropriate for Windows')
     def test_fileno(self):
         # Make sure fd returned by fileno is valid.
-        with self.urlopen("http://www.python.org/", timeout=None) as open_url:
+        with self.urlopen("http://www.google.com/", timeout=None) as open_url:
             fd = open_url.fileno()
             with os.fdopen(fd, 'rb') as f:
                 self.assertTrue(f.read(), "reading from file created using fd "
@@ -121,16 +123,15 @@
         else:
             # This happens with some overzealous DNS providers such as OpenDNS
             self.skipTest("%r should not resolve for test to work" % bogus_domain)
-        self.assertRaises(IOError,
-                          # SF patch 809915:  In Sep 2003, VeriSign started
-                          # highjacking invalid .com and .net addresses to
-                          # boost traffic to their own site.  This test
-                          # started failing then.  One hopes the .invalid
-                          # domain will be spared to serve its defined
-                          # purpose.
-                          # urllib.urlopen, "http://www.sadflkjsasadf.com/")
-                          urllib.request.urlopen,
-                          "http://sadflkjsasf.i.nvali.d/")
+        failure_explanation = ('opening an invalid URL did not raise OSError; '
+                               'can be caused by a broken DNS server '
+                               '(e.g. returns 404 or hijacks page)')
+        with self.assertRaises(OSError, msg=failure_explanation):
+            # SF patch 809915:  In Sep 2003, VeriSign started highjacking
+            # invalid .com and .net addresses to boost traffic to their own
+            # site.  This test started failing then.  One hopes the .invalid
+            # domain will be spared to serve its defined purpose.
+            urllib.request.urlopen("http://sadflkjsasf.i.nvali.d/")
 
 
 class urlretrieveNetworkTests(unittest.TestCase):
@@ -148,7 +149,7 @@
 
     def test_basic(self):
         # Test basic functionality.
-        with self.urlretrieve("http://www.python.org/") as (file_location, info):
+        with self.urlretrieve("http://www.example.com/") as (file_location, info):
             self.assertTrue(os.path.exists(file_location), "file location returned by"
                             " urlretrieve is not a valid path")
             with open(file_location, 'rb') as f:
@@ -157,7 +158,7 @@
 
     def test_specified_path(self):
         # Make sure that specifying the location of the file to write to works.
-        with self.urlretrieve("http://www.python.org/",
+        with self.urlretrieve("http://www.example.com/",
                               support.TESTFN) as (file_location, info):
             self.assertEqual(file_location, support.TESTFN)
             self.assertTrue(os.path.exists(file_location))
@@ -166,11 +167,11 @@
 
     def test_header(self):
         # Make sure header returned as 2nd value from urlretrieve is good.
-        with self.urlretrieve("http://www.python.org/") as (file_location, info):
+        with self.urlretrieve("http://www.example.com/") as (file_location, info):
             self.assertIsInstance(info, email.message.Message,
                                   "info is not an instance of email.message.Message")
 
-    logo = "http://www.python.org/static/community_logos/python-logo-master-v3-TM.png"
+    logo = "http://www.example.com/"
 
     def test_data_header(self):
         with self.urlretrieve(self.logo) as (file_location, fileheaders):
@@ -207,11 +208,5 @@
                                 " >= total size in %s" % records_repr)
 
 
-def test_main():
-    support.requires('network')
-    support.run_unittest(URLTimeoutTest,
-                         urlopenNetworkTests,
-                         urlretrieveNetworkTests)
-
 if __name__ == "__main__":
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_urlparse.py b/Lib/test/test_urlparse.py
index d67cf25..3934811 100644
--- a/Lib/test/test_urlparse.py
+++ b/Lib/test/test_urlparse.py
@@ -863,6 +863,14 @@
         self.assertEqual(p1.path, '863-1234')
         self.assertEqual(p1.params, 'phone-context=+1-914-555')
 
+    def test_unwrap(self):
+        url = urllib.parse.unwrap('<URL:type://host/path>')
+        self.assertEqual(url, 'type://host/path')
+
+    def test_Quoter_repr(self):
+        quoter = urllib.parse.Quoter(urllib.parse._ALWAYS_SAFE)
+        self.assertIn('Quoter', repr(quoter))
+
 
 def test_main():
     support.run_unittest(UrlParseTestCase)
diff --git a/Lib/test/test_userdict.py b/Lib/test/test_userdict.py
index 137c445..2ca9929 100644
--- a/Lib/test/test_userdict.py
+++ b/Lib/test/test_userdict.py
@@ -45,7 +45,8 @@
         # Test __repr__
         self.assertEqual(str(u0), str(d0))
         self.assertEqual(repr(u1), repr(d1))
-        self.assertEqual(repr(u2), repr(d2))
+        self.assertIn(repr(u2), ("{'one': 1, 'two': 2}",
+                                 "{'two': 2, 'one': 1}"))
 
         # Test rich comparison and __len__
         all = [d0, d1, d2, u, u0, u1, u2, uu, uu0, uu1, uu2]
@@ -89,9 +90,9 @@
         self.assertNotEqual(m2a, m2)
 
         # Test keys, items, values
-        self.assertEqual(u2.keys(), d2.keys())
-        self.assertEqual(u2.items(), d2.items())
-        self.assertEqual(list(u2.values()), list(d2.values()))
+        self.assertEqual(sorted(u2.keys()), sorted(d2.keys()))
+        self.assertEqual(sorted(u2.items()), sorted(d2.items()))
+        self.assertEqual(sorted(u2.values()), sorted(d2.values()))
 
         # Test "in".
         for i in u2.keys():
diff --git a/Lib/test/test_userstring.py b/Lib/test/test_userstring.py
index 34c629c..9bc8edd 100644
--- a/Lib/test/test_userstring.py
+++ b/Lib/test/test_userstring.py
@@ -28,14 +28,12 @@
             realresult
         )
 
-    def checkraises(self, exc, object, methodname, *args):
-        object = self.fixtype(object)
+    def checkraises(self, exc, obj, methodname, *args):
+        obj = self.fixtype(obj)
         # we don't fix the arguments, because UserString can't cope with it
-        self.assertRaises(
-            exc,
-            getattr(object, methodname),
-            *args
-        )
+        with self.assertRaises(exc) as cm:
+            getattr(obj, methodname)(*args)
+        self.assertNotEqual(str(cm.exception), '')
 
     def checkcall(self, object, methodname, *args):
         object = self.fixtype(object)
diff --git a/Lib/test/test_uu.py b/Lib/test/test_uu.py
index cbf6724..25fffbf 100644
--- a/Lib/test/test_uu.py
+++ b/Lib/test/test_uu.py
@@ -93,6 +93,28 @@
         except uu.Error as e:
             self.assertEqual(str(e), "No valid begin line found in input file")
 
+    def test_garbage_padding(self):
+        # Issue #22406
+        encodedtext = (
+            b"begin 644 file\n"
+            # length 1; bits 001100 111111 111111 111111
+            b"\x21\x2C\x5F\x5F\x5F\n"
+            b"\x20\n"
+            b"end\n"
+        )
+        plaintext = b"\x33"  # 00110011
+
+        with self.subTest("uu.decode()"):
+            inp = io.BytesIO(encodedtext)
+            out = io.BytesIO()
+            uu.decode(inp, out, quiet=True)
+            self.assertEqual(out.getvalue(), plaintext)
+
+        with self.subTest("uu_codec"):
+            import codecs
+            decoded = codecs.decode(encodedtext, "uu_codec")
+            self.assertEqual(decoded, plaintext)
+
 class UUStdIOTest(unittest.TestCase):
 
     def setUp(self):
diff --git a/Lib/test/test_uuid.py b/Lib/test/test_uuid.py
index 7264808..1e8cba3 100644
--- a/Lib/test/test_uuid.py
+++ b/Lib/test/test_uuid.py
@@ -14,9 +14,6 @@
         return False
 
 class TestUUID(unittest.TestCase):
-    last_node = None
-    source2node = {}
-
     def test_UUID(self):
         equal = self.assertEqual
         ascending = []
@@ -294,95 +291,13 @@
         badtype(lambda: setattr(u, 'clock_seq_low', 0))
         badtype(lambda: setattr(u, 'node', 0))
 
-    def check_node(self, node, source):
-        message = "%012x is not an RFC 4122 node ID" % node
-        self.assertTrue(0 < node, message)
-        self.assertTrue(node < (1 << 48), message)
-
-        TestUUID.source2node[source] = node
-        if TestUUID.last_node:
-            if TestUUID.last_node != node:
-                msg = "different sources disagree on node:\n"
-                for s, n in TestUUID.source2node.items():
-                    msg += "    from source %r, node was %012x\n" % (s, n)
-                # There's actually no reason to expect the MAC addresses
-                # to agree across various methods -- e.g., a box may have
-                # multiple network interfaces, and different ways of getting
-                # a MAC address may favor different HW.
-                ##self.fail(msg)
-        else:
-            TestUUID.last_node = node
-
-    @unittest.skipUnless(os.name == 'posix', 'requires Posix')
-    def test_ifconfig_getnode(self):
-        node = uuid._ifconfig_getnode()
-        if node is not None:
-            self.check_node(node, 'ifconfig')
-
-    @unittest.skipUnless(os.name == 'nt', 'requires Windows')
-    def test_ipconfig_getnode(self):
-        node = uuid._ipconfig_getnode()
-        if node is not None:
-            self.check_node(node, 'ipconfig')
-
-    @unittest.skipUnless(importable('win32wnet'), 'requires win32wnet')
-    @unittest.skipUnless(importable('netbios'), 'requires netbios')
-    def test_netbios_getnode(self):
-        self.check_node(uuid._netbios_getnode(), 'netbios')
-
-    def test_random_getnode(self):
-        node = uuid._random_getnode()
-        # Least significant bit of first octet must be set.
-        self.assertTrue(node & 0x010000000000)
-        self.assertTrue(node < (1 << 48))
-
-    @unittest.skipUnless(os.name == 'posix', 'requires Posix')
-    @unittest.skipUnless(importable('ctypes'), 'requires ctypes')
-    def test_unixdll_getnode(self):
-        try: # Issues 1481, 3581: _uuid_generate_time() might be None.
-            self.check_node(uuid._unixdll_getnode(), 'unixdll')
-        except TypeError:
-            pass
-
-    @unittest.skipUnless(os.name == 'nt', 'requires Windows')
-    @unittest.skipUnless(importable('ctypes'), 'requires ctypes')
-    def test_windll_getnode(self):
-        self.check_node(uuid._windll_getnode(), 'windll')
-
     def test_getnode(self):
         node1 = uuid.getnode()
-        self.check_node(node1, "getnode1")
+        self.assertTrue(0 < node1 < (1 << 48), '%012x' % node1)
 
         # Test it again to ensure consistency.
         node2 = uuid.getnode()
-        self.check_node(node2, "getnode2")
-
-        self.assertEqual(node1, node2)
-
-    @unittest.skipUnless(os.name == 'posix', 'requires Posix')
-    def test_find_mac(self):
-        data = '''\
-
-fake hwaddr
-cscotun0  Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
-eth0      Link encap:Ethernet  HWaddr 12:34:56:78:90:ab
-'''
-        def mock_popen(cmd):
-            return io.StringIO(data)
-
-        if shutil.which('ifconfig') is None:
-            path = os.pathsep.join(('/sbin', '/usr/sbin'))
-            if shutil.which('ifconfig', path=path) is None:
-                self.skipTest('requires ifconfig')
-
-        with support.swap_attr(os, 'popen', mock_popen):
-            mac = uuid._find_mac(
-                command='ifconfig',
-                args='',
-                hw_identifiers=['hwaddr'],
-                get_index=lambda x: x + 1,
-            )
-            self.assertEqual(mac, 0x1234567890ab)
+        self.assertEqual(node1, node2, '%012x != %012x' % (node1, node2))
 
     @unittest.skipUnless(importable('ctypes'), 'requires ctypes')
     def test_uuid1(self):
@@ -494,5 +409,97 @@
             self.assertNotEqual(parent_value, child_value)
 
 
+class TestInternals(unittest.TestCase):
+    @unittest.skipUnless(os.name == 'posix', 'requires Posix')
+    def test_find_mac(self):
+        data = '''\
+
+fake hwaddr
+cscotun0  Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
+eth0      Link encap:Ethernet  HWaddr 12:34:56:78:90:ab
+'''
+        def mock_popen(cmd):
+            return io.StringIO(data)
+
+        if shutil.which('ifconfig') is None:
+            path = os.pathsep.join(('/sbin', '/usr/sbin'))
+            if shutil.which('ifconfig', path=path) is None:
+                self.skipTest('requires ifconfig')
+
+        with support.swap_attr(os, 'popen', mock_popen):
+            mac = uuid._find_mac(
+                command='ifconfig',
+                args='',
+                hw_identifiers=['hwaddr'],
+                get_index=lambda x: x + 1,
+            )
+            self.assertEqual(mac, 0x1234567890ab)
+
+    def check_node(self, node, requires=None, network=False):
+        if requires and node is None:
+            self.skipTest('requires ' + requires)
+        hex = '%012x' % node
+        if support.verbose >= 2:
+            print(hex, end=' ')
+        if network:
+            # 47 bit will never be set in IEEE 802 addresses obtained
+            # from network cards.
+            self.assertFalse(node & 0x010000000000, hex)
+        self.assertTrue(0 < node < (1 << 48),
+                        "%s is not an RFC 4122 node ID" % hex)
+
+    @unittest.skipUnless(os.name == 'posix', 'requires Posix')
+    def test_ifconfig_getnode(self):
+        node = uuid._ifconfig_getnode()
+        self.check_node(node, 'ifconfig', True)
+
+    @unittest.skipUnless(os.name == 'posix', 'requires Posix')
+    def test_arp_getnode(self):
+        node = uuid._arp_getnode()
+        self.check_node(node, 'arp', True)
+
+    @unittest.skipUnless(os.name == 'posix', 'requires Posix')
+    def test_lanscan_getnode(self):
+        node = uuid._lanscan_getnode()
+        self.check_node(node, 'lanscan', True)
+
+    @unittest.skipUnless(os.name == 'posix', 'requires Posix')
+    def test_netstat_getnode(self):
+        node = uuid._netstat_getnode()
+        self.check_node(node, 'netstat', True)
+
+    @unittest.skipUnless(os.name == 'nt', 'requires Windows')
+    def test_ipconfig_getnode(self):
+        node = uuid._ipconfig_getnode()
+        self.check_node(node, 'ipconfig', True)
+
+    @unittest.skipUnless(importable('win32wnet'), 'requires win32wnet')
+    @unittest.skipUnless(importable('netbios'), 'requires netbios')
+    def test_netbios_getnode(self):
+        node = uuid._netbios_getnode()
+        self.check_node(node, network=True)
+
+    def test_random_getnode(self):
+        node = uuid._random_getnode()
+        # Least significant bit of first octet must be set.
+        self.assertTrue(node & 0x010000000000, '%012x' % node)
+        self.check_node(node)
+
+    @unittest.skipUnless(os.name == 'posix', 'requires Posix')
+    @unittest.skipUnless(importable('ctypes'), 'requires ctypes')
+    def test_unixdll_getnode(self):
+        try: # Issues 1481, 3581: _uuid_generate_time() might be None.
+            node = uuid._unixdll_getnode()
+        except TypeError:
+            self.skipTest('requires uuid_generate_time')
+        self.check_node(node)
+
+    @unittest.skipUnless(os.name == 'nt', 'requires Windows')
+    @unittest.skipUnless(importable('ctypes'), 'requires ctypes')
+    def test_windll_getnode(self):
+        node = uuid._windll_getnode()
+        self.check_node(node)
+
+
 if __name__ == '__main__':
     unittest.main()
diff --git a/Lib/test/test_venv.py b/Lib/test/test_venv.py
index 0fae88b..b462588 100644
--- a/Lib/test/test_venv.py
+++ b/Lib/test/test_venv.py
@@ -5,17 +5,36 @@
 Licensed to the PSF under a contributor agreement.
 """
 
+import ensurepip
 import os
 import os.path
-import shutil
+import struct
 import subprocess
 import sys
 import tempfile
 from test.support import (captured_stdout, captured_stderr, run_unittest,
-                          can_symlink)
+                          can_symlink, EnvironmentVarGuard, rmtree)
+import textwrap
 import unittest
 import venv
 
+# pip currently requires ssl support, so we ensure we handle
+# it being missing (http://bugs.python.org/issue19744)
+try:
+    import ssl
+except ImportError:
+    ssl = None
+
+skipInVenv = unittest.skipIf(sys.prefix != sys.base_prefix,
+                             'Test not appropriate in a venv')
+
+# os.path.exists('nul') is False: http://bugs.python.org/issue20541
+if os.devnull.lower() == 'nul':
+    failsOnWindows = unittest.expectedFailure
+else:
+    def failsOnWindows(f):
+        return f
+
 class BaseTest(unittest.TestCase):
     """Base class for venv tests."""
 
@@ -36,7 +55,7 @@
         self.exe = os.path.split(executable)[-1]
 
     def tearDown(self):
-        shutil.rmtree(self.env_dir)
+        rmtree(self.env_dir)
 
     def run_with_capture(self, func, *args, **kwargs):
         with captured_stdout() as output:
@@ -63,11 +82,19 @@
         """
         Test the create function with default arguments.
         """
-        shutil.rmtree(self.env_dir)
+        rmtree(self.env_dir)
         self.run_with_capture(venv.create, self.env_dir)
         self.isdir(self.bindir)
         self.isdir(self.include)
         self.isdir(*self.lib)
+        # Issue 21197
+        p = self.get_env_file('lib64')
+        conditions = ((struct.calcsize('P') == 8) and (os.name == 'posix') and
+                      (sys.platform != 'darwin'))
+        if conditions:
+            self.assertTrue(os.path.islink(p))
+        else:
+            self.assertFalse(os.path.exists(p))
         data = self.get_text_file_contents('pyvenv.cfg')
         if sys.platform == 'darwin' and ('__PYVENV_LAUNCHER__'
                                          in os.environ):
@@ -83,8 +110,7 @@
             print('    %r' % os.listdir(bd))
         self.assertTrue(os.path.exists(fn), 'File %r should exist.' % fn)
 
-    @unittest.skipIf(sys.prefix != sys.base_prefix, 'Test not appropriate '
-                     'in a venv')
+    @skipInVenv
     def test_prefixes(self):
         """
         Test that the prefix values are as expected.
@@ -94,7 +120,7 @@
         self.assertEqual(sys.base_exec_prefix, sys.exec_prefix)
 
         # check a venv's prefixes
-        shutil.rmtree(self.env_dir)
+        rmtree(self.env_dir)
         self.run_with_capture(venv.create, self.env_dir)
         envpy = os.path.join(self.env_dir, self.bindir, self.exe)
         cmd = [envpy, '-c', None]
@@ -109,29 +135,89 @@
             out, err = p.communicate()
             self.assertEqual(out.strip(), expected.encode())
 
+    if sys.platform == 'win32':
+        ENV_SUBDIRS = (
+            ('Scripts',),
+            ('Include',),
+            ('Lib',),
+            ('Lib', 'site-packages'),
+        )
+    else:
+        ENV_SUBDIRS = (
+            ('bin',),
+            ('include',),
+            ('lib',),
+            ('lib', 'python%d.%d' % sys.version_info[:2]),
+            ('lib', 'python%d.%d' % sys.version_info[:2], 'site-packages'),
+        )
+
+    def create_contents(self, paths, filename):
+        """
+        Create some files in the environment which are unrelated
+        to the virtual environment.
+        """
+        for subdirs in paths:
+            d = os.path.join(self.env_dir, *subdirs)
+            os.mkdir(d)
+            fn = os.path.join(d, filename)
+            with open(fn, 'wb') as f:
+                f.write(b'Still here?')
+
     def test_overwrite_existing(self):
         """
-        Test control of overwriting an existing environment directory.
+        Test creating environment in an existing directory.
         """
-        self.assertRaises(ValueError, venv.create, self.env_dir)
+        self.create_contents(self.ENV_SUBDIRS, 'foo')
+        venv.create(self.env_dir)
+        for subdirs in self.ENV_SUBDIRS:
+            fn = os.path.join(self.env_dir, *(subdirs + ('foo',)))
+            self.assertTrue(os.path.exists(fn))
+            with open(fn, 'rb') as f:
+                self.assertEqual(f.read(), b'Still here?')
+
         builder = venv.EnvBuilder(clear=True)
         builder.create(self.env_dir)
+        for subdirs in self.ENV_SUBDIRS:
+            fn = os.path.join(self.env_dir, *(subdirs + ('foo',)))
+            self.assertFalse(os.path.exists(fn))
+
+    def clear_directory(self, path):
+        for fn in os.listdir(path):
+            fn = os.path.join(path, fn)
+            if os.path.islink(fn) or os.path.isfile(fn):
+                os.remove(fn)
+            elif os.path.isdir(fn):
+                rmtree(fn)
+
+    def test_unoverwritable_fails(self):
+        #create a file clashing with directories in the env dir
+        for paths in self.ENV_SUBDIRS[:3]:
+            fn = os.path.join(self.env_dir, *paths)
+            with open(fn, 'wb') as f:
+                f.write(b'')
+            self.assertRaises((ValueError, OSError), venv.create, self.env_dir)
+            self.clear_directory(self.env_dir)
 
     def test_upgrade(self):
         """
         Test upgrading an existing environment directory.
         """
-        builder = venv.EnvBuilder(upgrade=True)
-        self.run_with_capture(builder.create, self.env_dir)
-        self.isdir(self.bindir)
-        self.isdir(self.include)
-        self.isdir(*self.lib)
-        fn = self.get_env_file(self.bindir, self.exe)
-        if not os.path.exists(fn):  # diagnostics for Windows buildbot failures
-            bd = self.get_env_file(self.bindir)
-            print('Contents of %r:' % bd)
-            print('    %r' % os.listdir(bd))
-        self.assertTrue(os.path.exists(fn), 'File %r should exist.' % fn)
+        # See Issue #21643: the loop needs to run twice to ensure
+        # that everything works on the upgrade (the first run just creates
+        # the venv).
+        for upgrade in (False, True):
+            builder = venv.EnvBuilder(upgrade=upgrade)
+            self.run_with_capture(builder.create, self.env_dir)
+            self.isdir(self.bindir)
+            self.isdir(self.include)
+            self.isdir(*self.lib)
+            fn = self.get_env_file(self.bindir, self.exe)
+            if not os.path.exists(fn):
+                # diagnostics for Windows buildbot failures
+                bd = self.get_env_file(self.bindir)
+                print('Contents of %r:' % bd)
+                print('    %r' % os.listdir(bd))
+            self.assertTrue(os.path.exists(fn), 'File %r should exist.' % fn)
 
     def test_isolation(self):
         """
@@ -162,13 +248,12 @@
     # run the test, the pyvenv.cfg in the venv created in the test will
     # point to the venv being used to run the test, and we lose the link
     # to the source build - so Python can't initialise properly.
-    @unittest.skipIf(sys.prefix != sys.base_prefix, 'Test not appropriate '
-                     'in a venv')
+    @skipInVenv
     def test_executable(self):
         """
         Test that the sys.executable value is as expected.
         """
-        shutil.rmtree(self.env_dir)
+        rmtree(self.env_dir)
         self.run_with_capture(venv.create, self.env_dir)
         envpy = os.path.join(os.path.realpath(self.env_dir), self.bindir, self.exe)
         cmd = [envpy, '-c', 'import sys; print(sys.executable)']
@@ -182,7 +267,7 @@
         """
         Test that the sys.executable value is as expected.
         """
-        shutil.rmtree(self.env_dir)
+        rmtree(self.env_dir)
         builder = venv.EnvBuilder(clear=True, symlinks=True)
         builder.create(self.env_dir)
         envpy = os.path.join(os.path.realpath(self.env_dir), self.bindir, self.exe)
@@ -192,8 +277,129 @@
         out, err = p.communicate()
         self.assertEqual(out.strip(), envpy.encode())
 
+
+@skipInVenv
+class EnsurePipTest(BaseTest):
+    """Test venv module installation of pip."""
+    def assert_pip_not_installed(self):
+        envpy = os.path.join(os.path.realpath(self.env_dir),
+                             self.bindir, self.exe)
+        try_import = 'try:\n import pip\nexcept ImportError:\n print("OK")'
+        cmd = [envpy, '-c', try_import]
+        p = subprocess.Popen(cmd, stdout=subprocess.PIPE,
+                             stderr=subprocess.PIPE)
+        out, err = p.communicate()
+        # We force everything to text, so unittest gives the detailed diff
+        # if we get unexpected results
+        err = err.decode("latin-1") # Force to text, prevent decoding errors
+        self.assertEqual(err, "")
+        out = out.decode("latin-1") # Force to text, prevent decoding errors
+        self.assertEqual(out.strip(), "OK")
+
+
+    def test_no_pip_by_default(self):
+        rmtree(self.env_dir)
+        self.run_with_capture(venv.create, self.env_dir)
+        self.assert_pip_not_installed()
+
+    def test_explicit_no_pip(self):
+        rmtree(self.env_dir)
+        self.run_with_capture(venv.create, self.env_dir, with_pip=False)
+        self.assert_pip_not_installed()
+
+    @failsOnWindows
+    def test_devnull_exists_and_is_empty(self):
+        # Fix for issue #20053 uses os.devnull to force a config file to
+        # appear empty. However http://bugs.python.org/issue20541 means
+        # that doesn't currently work properly on Windows. Once that is
+        # fixed, the "win_location" part of test_with_pip should be restored
+        self.assertTrue(os.path.exists(os.devnull))
+        with open(os.devnull, "rb") as f:
+            self.assertEqual(f.read(), b"")
+
+    # Requesting pip fails without SSL (http://bugs.python.org/issue19744)
+    @unittest.skipIf(ssl is None, ensurepip._MISSING_SSL_MESSAGE)
+    def test_with_pip(self):
+        rmtree(self.env_dir)
+        with EnvironmentVarGuard() as envvars:
+            # pip's cross-version compatibility may trigger deprecation
+            # warnings in current versions of Python. Ensure related
+            # environment settings don't cause venv to fail.
+            envvars["PYTHONWARNINGS"] = "e"
+            # ensurepip is different enough from a normal pip invocation
+            # that we want to ensure it ignores the normal pip environment
+            # variable settings. We set PIP_NO_INSTALL here specifically
+            # to check that ensurepip (and hence venv) ignores it.
+            # See http://bugs.python.org/issue19734
+            envvars["PIP_NO_INSTALL"] = "1"
+            # Also check that we ignore the pip configuration file
+            # See http://bugs.python.org/issue20053
+            with tempfile.TemporaryDirectory() as home_dir:
+                envvars["HOME"] = home_dir
+                bad_config = "[global]\nno-install=1"
+                # Write to both config file names on all platforms to reduce
+                # cross-platform variation in test code behaviour
+                win_location = ("pip", "pip.ini")
+                posix_location = (".pip", "pip.conf")
+                # Skips win_location due to http://bugs.python.org/issue20541
+                for dirname, fname in (posix_location,):
+                    dirpath = os.path.join(home_dir, dirname)
+                    os.mkdir(dirpath)
+                    fpath = os.path.join(dirpath, fname)
+                    with open(fpath, 'w') as f:
+                        f.write(bad_config)
+
+                # Actually run the create command with all that unhelpful
+                # config in place to ensure we ignore it
+                try:
+                    self.run_with_capture(venv.create, self.env_dir,
+                                          with_pip=True)
+                except subprocess.CalledProcessError as exc:
+                    # The output this produces can be a little hard to read,
+                    # but at least it has all the details
+                    details = exc.output.decode(errors="replace")
+                    msg = "{}\n\n**Subprocess Output**\n{}"
+                    self.fail(msg.format(exc, details))
+        # Ensure pip is available in the virtual environment
+        envpy = os.path.join(os.path.realpath(self.env_dir), self.bindir, self.exe)
+        cmd = [envpy, '-Im', 'pip', '--version']
+        p = subprocess.Popen(cmd, stdout=subprocess.PIPE,
+                                  stderr=subprocess.PIPE)
+        out, err = p.communicate()
+        # We force everything to text, so unittest gives the detailed diff
+        # if we get unexpected results
+        err = err.decode("latin-1") # Force to text, prevent decoding errors
+        self.assertEqual(err, "")
+        out = out.decode("latin-1") # Force to text, prevent decoding errors
+        expected_version = "pip {}".format(ensurepip.version())
+        self.assertEqual(out[:len(expected_version)], expected_version)
+        env_dir = os.fsencode(self.env_dir).decode("latin-1")
+        self.assertIn(env_dir, out)
+
+        # http://bugs.python.org/issue19728
+        # Check the private uninstall command provided for the Windows
+        # installers works (at least in a virtual environment)
+        cmd = [envpy, '-Im', 'ensurepip._uninstall']
+        with EnvironmentVarGuard() as envvars:
+            p = subprocess.Popen(cmd, stdout=subprocess.PIPE,
+                                      stderr=subprocess.PIPE)
+            out, err = p.communicate()
+        # We force everything to text, so unittest gives the detailed diff
+        # if we get unexpected results
+        err = err.decode("latin-1") # Force to text, prevent decoding errors
+        self.assertEqual(err, "")
+        # Being fairly specific regarding the expected behaviour for the
+        # initial bundling phase in Python 3.4. If the output changes in
+        # future pip versions, this test can likely be relaxed further.
+        out = out.decode("latin-1") # Force to text, prevent decoding errors
+        self.assertIn("Successfully uninstalled pip", out)
+        self.assertIn("Successfully uninstalled setuptools", out)
+        # Check pip is now gone from the virtual environment
+        self.assert_pip_not_installed()
+
+
 def test_main():
-    run_unittest(BasicTest)
+    run_unittest(BasicTest, EnsurePipTest)
 
 if __name__ == "__main__":
     test_main()
diff --git a/Lib/test/test_wait3.py b/Lib/test/test_wait3.py
index bd06c8d..f6a065d 100644
--- a/Lib/test/test_wait3.py
+++ b/Lib/test/test_wait3.py
@@ -7,15 +7,11 @@
 from test.fork_wait import ForkWait
 from test.support import run_unittest, reap_children
 
-try:
-    os.fork
-except AttributeError:
-    raise unittest.SkipTest("os.fork not defined -- skipping test_wait3")
+if not hasattr(os, 'fork'):
+    raise unittest.SkipTest("os.fork not defined")
 
-try:
-    os.wait3
-except AttributeError:
-    raise unittest.SkipTest("os.wait3 not defined -- skipping test_wait3")
+if not hasattr(os, 'wait3'):
+    raise unittest.SkipTest("os.wait3 not defined")
 
 class Wait3Test(ForkWait):
     def wait_impl(self, cpid):
diff --git a/Lib/test/test_warnings.py b/Lib/test/test_warnings.py
index 10076af..fb01b83 100644
--- a/Lib/test/test_warnings.py
+++ b/Lib/test/test_warnings.py
@@ -61,6 +61,25 @@
         sys.modules['warnings'] = original_warnings
         super(BaseTest, self).tearDown()
 
+class PublicAPITests(BaseTest):
+
+    """Ensures that the correct values are exposed in the
+    public API.
+    """
+
+    def test_module_all_attribute(self):
+        self.assertTrue(hasattr(self.module, '__all__'))
+        target_api = ["warn", "warn_explicit", "showwarning",
+                      "formatwarning", "filterwarnings", "simplefilter",
+                      "resetwarnings", "catch_warnings"]
+        self.assertSetEqual(set(self.module.__all__),
+                            set(target_api))
+
+class CPublicAPITests(PublicAPITests, unittest.TestCase):
+    module = c_warnings
+
+class PyPublicAPITests(PublicAPITests, unittest.TestCase):
+    module = py_warnings
 
 class FilterTests(BaseTest):
 
@@ -73,6 +92,16 @@
             self.assertRaises(UserWarning, self.module.warn,
                                 "FilterTests.test_error")
 
+    def test_error_after_default(self):
+        with original_warnings.catch_warnings(module=self.module) as w:
+            self.module.resetwarnings()
+            message = "FilterTests.test_ignore_after_default"
+            def f():
+                self.module.warn(message, UserWarning)
+            f()
+            self.module.filterwarnings("error", category=UserWarning)
+            self.assertRaises(UserWarning, f)
+
     def test_ignore(self):
         with original_warnings.catch_warnings(record=True,
                 module=self.module) as w:
@@ -81,6 +110,19 @@
             self.module.warn("FilterTests.test_ignore", UserWarning)
             self.assertEqual(len(w), 0)
 
+    def test_ignore_after_default(self):
+        with original_warnings.catch_warnings(record=True,
+                module=self.module) as w:
+            self.module.resetwarnings()
+            message = "FilterTests.test_ignore_after_default"
+            def f():
+                self.module.warn(message, UserWarning)
+            f()
+            self.module.filterwarnings("ignore", category=UserWarning)
+            f()
+            f()
+            self.assertEqual(len(w), 1)
+
     def test_always(self):
         with original_warnings.catch_warnings(record=True,
                 module=self.module) as w:
@@ -92,6 +134,26 @@
             self.module.warn(message, UserWarning)
             self.assertTrue(w[-1].message, message)
 
+    def test_always_after_default(self):
+        with original_warnings.catch_warnings(record=True,
+                module=self.module) as w:
+            self.module.resetwarnings()
+            message = "FilterTests.test_always_after_ignore"
+            def f():
+                self.module.warn(message, UserWarning)
+            f()
+            self.assertEqual(len(w), 1)
+            self.assertEqual(w[-1].message.args[0], message)
+            f()
+            self.assertEqual(len(w), 1)
+            self.module.filterwarnings("always", category=UserWarning)
+            f()
+            self.assertEqual(len(w), 2)
+            self.assertEqual(w[-1].message.args[0], message)
+            f()
+            self.assertEqual(len(w), 3)
+            self.assertEqual(w[-1].message.args[0], message)
+
     def test_default(self):
         with original_warnings.catch_warnings(record=True,
                 module=self.module) as w:
@@ -329,6 +391,19 @@
             warning_tests.__name__ = module_name
             sys.argv = argv
 
+    def test_warn_explicit_non_ascii_filename(self):
+        with original_warnings.catch_warnings(record=True,
+                module=self.module) as w:
+            self.module.resetwarnings()
+            self.module.filterwarnings("always", category=UserWarning)
+            for filename in ("nonascii\xe9\u20ac", "surrogate\udc80"):
+                try:
+                    os.fsencode(filename)
+                except UnicodeEncodeError:
+                    continue
+                self.module.warn_explicit("text", UserWarning, filename, 1)
+                self.assertEqual(w[-1].filename, filename)
+
     def test_warn_explicit_type_errors(self):
         # warn_explicit() should error out gracefully if it is given objects
         # of the wrong types.
@@ -474,7 +549,9 @@
                                             registry=registry)
                 self.assertEqual(w[-1].message, message)
                 self.assertEqual(len(w), 1)
-                self.assertEqual(len(registry), 1)
+                # One actual registry key plus the "version" key
+                self.assertEqual(len(registry), 2)
+                self.assertIn("version", registry)
                 del w[:]
                 # Test removal.
                 del self.module.defaultaction
@@ -484,7 +561,7 @@
                                             registry=registry)
                 self.assertEqual(w[-1].message, message)
                 self.assertEqual(len(w), 1)
-                self.assertEqual(len(registry), 1)
+                self.assertEqual(len(registry), 2)
                 del w[:]
                 # Test setting.
                 self.module.defaultaction = "ignore"
@@ -554,6 +631,15 @@
         finally:
             globals_dict['__file__'] = oldfile
 
+    def test_stderr_none(self):
+        rc, stdout, stderr = assert_python_ok("-c",
+            "import sys; sys.stderr = None; "
+            "import warnings; warnings.simplefilter('always'); "
+            "warnings.warn('Warning!')")
+        self.assertEqual(stdout, b'')
+        self.assertNotIn(b'Warning!', stderr)
+        self.assertNotIn(b'Error', stderr)
+
 
 class WarningsDisplayTests(BaseTest):
 
@@ -766,6 +852,25 @@
             # Use -W to load warnings module at startup
             assert_python_ok('-c', 'pass', '-W', 'always', PYTHONPATH=cwd)
 
+class FinalizationTest(unittest.TestCase):
+    def test_finalization(self):
+        # Issue #19421: warnings.warn() should not crash
+        # during Python finalization
+        code = """
+import warnings
+warn = warnings.warn
+
+class A:
+    def __del__(self):
+        warn("test")
+
+a=A()
+        """
+        rc, out, err = assert_python_ok("-c", code)
+        # note: "__main__" filename is not correct, it should be the name
+        # of the script
+        self.assertEqual(err, b'__main__:7: UserWarning: test')
+
 
 def setUpModule():
     py_warnings.onceregistry.clear()
diff --git a/Lib/test/test_wave.py b/Lib/test/test_wave.py
index f64201f..3eff773 100644
--- a/Lib/test/test_wave.py
+++ b/Lib/test/test_wave.py
@@ -1,6 +1,7 @@
 from test.support import TESTFN
 import unittest
 from test import audiotests
+from audioop import byteswap
 import sys
 import wave
 
@@ -8,9 +9,6 @@
 class WaveTest(audiotests.AudioWriteTests,
                audiotests.AudioTestsWithSourceFile):
     module = wave
-    test_unseekable_write = None
-    test_unseekable_overflowed_write = None
-    test_unseekable_incompleted_write = None
 
 
 class WavePCM8Test(WaveTest, unittest.TestCase):
@@ -48,13 +46,7 @@
       E4B50CEB 63440A5A 08CA0A1F 2BBA0B0B 51460E47 8BCB113C B6F50EEA 44150A59 \
       """)
     if sys.byteorder != 'big':
-        frames = audiotests.byteswap2(frames)
-
-    if sys.byteorder == 'big':
-        @unittest.expectedFailure
-        def test_unseekable_incompleted_write(self):
-            super().test_unseekable_incompleted_write()
-
+        frames = byteswap(frames, 2)
 
 
 class WavePCM24Test(WaveTest, unittest.TestCase):
@@ -81,7 +73,7 @@
       51486F0E44E1 8BCC64113B05 B6F4EC0EEB36 4413170A5B48 \
       """)
     if sys.byteorder != 'big':
-        frames = audiotests.byteswap3(frames)
+        frames = byteswap(frames, 3)
 
 
 class WavePCM32Test(WaveTest, unittest.TestCase):
@@ -108,12 +100,7 @@
       51486F800E44E190 8BCC6480113B0580 B6F4EC000EEB3630 441317800A5B48A0 \
       """)
     if sys.byteorder != 'big':
-        frames = audiotests.byteswap4(frames)
-
-    if sys.byteorder == 'big':
-        @unittest.expectedFailure
-        def test_unseekable_incompleted_write(self):
-            super().test_unseekable_incompleted_write()
+        frames = byteswap(frames, 4)
 
 
 if __name__ == '__main__':
diff --git a/Lib/test/test_weakref.py b/Lib/test/test_weakref.py
index 85ab717..3e7347c 100644
--- a/Lib/test/test_weakref.py
+++ b/Lib/test/test_weakref.py
@@ -7,11 +7,15 @@
 import contextlib
 import copy
 
-from test import support
+from test import support, script_helper
 
 # Used in ReferencesTestCase.test_ref_created_during_del() .
 ref_from_del = None
 
+# Used by FinalizeTestCase as a global that may be replaced by None
+# when the interpreter shuts down.
+_global_var = 'foobar'
+
 class C:
     def method(self):
         pass
@@ -47,6 +51,11 @@
         return NotImplemented
     def __hash__(self):
         return hash(self.arg)
+    def some_method(self):
+        return 4
+    def other_method(self):
+        return 5
+
 
 class RefCycle:
     def __init__(self):
@@ -794,6 +803,30 @@
         del root
         gc.collect()
 
+    def test_callback_attribute(self):
+        x = Object(1)
+        callback = lambda ref: None
+        ref1 = weakref.ref(x, callback)
+        self.assertIs(ref1.__callback__, callback)
+
+        ref2 = weakref.ref(x)
+        self.assertIsNone(ref2.__callback__)
+
+    def test_callback_attribute_after_deletion(self):
+        x = Object(1)
+        ref = weakref.ref(x, self.callback)
+        self.assertIsNotNone(ref.__callback__)
+        del x
+        support.gc_collect()
+        self.assertIsNone(ref.__callback__)
+
+    def test_set_callback_attribute(self):
+        x = Object(1)
+        callback = lambda ref: None
+        ref1 = weakref.ref(x, callback)
+        with self.assertRaises(AttributeError):
+            ref1.__callback__ = lambda ref: None
+
 
 class SubclassableWeakrefTestCase(TestBase):
 
@@ -898,6 +931,140 @@
         self.assertEqual(self.cbcalled, 0)
 
 
+class WeakMethodTestCase(unittest.TestCase):
+
+    def _subclass(self):
+        """Return a Object subclass overriding `some_method`."""
+        class C(Object):
+            def some_method(self):
+                return 6
+        return C
+
+    def test_alive(self):
+        o = Object(1)
+        r = weakref.WeakMethod(o.some_method)
+        self.assertIsInstance(r, weakref.ReferenceType)
+        self.assertIsInstance(r(), type(o.some_method))
+        self.assertIs(r().__self__, o)
+        self.assertIs(r().__func__, o.some_method.__func__)
+        self.assertEqual(r()(), 4)
+
+    def test_object_dead(self):
+        o = Object(1)
+        r = weakref.WeakMethod(o.some_method)
+        del o
+        gc.collect()
+        self.assertIs(r(), None)
+
+    def test_method_dead(self):
+        C = self._subclass()
+        o = C(1)
+        r = weakref.WeakMethod(o.some_method)
+        del C.some_method
+        gc.collect()
+        self.assertIs(r(), None)
+
+    def test_callback_when_object_dead(self):
+        # Test callback behaviour when object dies first.
+        C = self._subclass()
+        calls = []
+        def cb(arg):
+            calls.append(arg)
+        o = C(1)
+        r = weakref.WeakMethod(o.some_method, cb)
+        del o
+        gc.collect()
+        self.assertEqual(calls, [r])
+        # Callback is only called once.
+        C.some_method = Object.some_method
+        gc.collect()
+        self.assertEqual(calls, [r])
+
+    def test_callback_when_method_dead(self):
+        # Test callback behaviour when method dies first.
+        C = self._subclass()
+        calls = []
+        def cb(arg):
+            calls.append(arg)
+        o = C(1)
+        r = weakref.WeakMethod(o.some_method, cb)
+        del C.some_method
+        gc.collect()
+        self.assertEqual(calls, [r])
+        # Callback is only called once.
+        del o
+        gc.collect()
+        self.assertEqual(calls, [r])
+
+    @support.cpython_only
+    def test_no_cycles(self):
+        # A WeakMethod doesn't create any reference cycle to itself.
+        o = Object(1)
+        def cb(_):
+            pass
+        r = weakref.WeakMethod(o.some_method, cb)
+        wr = weakref.ref(r)
+        del r
+        self.assertIs(wr(), None)
+
+    def test_equality(self):
+        def _eq(a, b):
+            self.assertTrue(a == b)
+            self.assertFalse(a != b)
+        def _ne(a, b):
+            self.assertTrue(a != b)
+            self.assertFalse(a == b)
+        x = Object(1)
+        y = Object(1)
+        a = weakref.WeakMethod(x.some_method)
+        b = weakref.WeakMethod(y.some_method)
+        c = weakref.WeakMethod(x.other_method)
+        d = weakref.WeakMethod(y.other_method)
+        # Objects equal, same method
+        _eq(a, b)
+        _eq(c, d)
+        # Objects equal, different method
+        _ne(a, c)
+        _ne(a, d)
+        _ne(b, c)
+        _ne(b, d)
+        # Objects unequal, same or different method
+        z = Object(2)
+        e = weakref.WeakMethod(z.some_method)
+        f = weakref.WeakMethod(z.other_method)
+        _ne(a, e)
+        _ne(a, f)
+        _ne(b, e)
+        _ne(b, f)
+        del x, y, z
+        gc.collect()
+        # Dead WeakMethods compare by identity
+        refs = a, b, c, d, e, f
+        for q in refs:
+            for r in refs:
+                self.assertEqual(q == r, q is r)
+                self.assertEqual(q != r, q is not r)
+
+    def test_hashing(self):
+        # Alive WeakMethods are hashable if the underlying object is
+        # hashable.
+        x = Object(1)
+        y = Object(1)
+        a = weakref.WeakMethod(x.some_method)
+        b = weakref.WeakMethod(y.some_method)
+        c = weakref.WeakMethod(y.other_method)
+        # Since WeakMethod objects are equal, the hashes should be equal.
+        self.assertEqual(hash(a), hash(b))
+        ha = hash(a)
+        # Dead WeakMethods retain their old hash value
+        del x, y
+        gc.collect()
+        self.assertEqual(hash(a), ha)
+        self.assertEqual(hash(b), ha)
+        # If it wasn't hashed when alive, a dead WeakMethod cannot be hashed.
+        self.assertRaises(TypeError, hash, c)
+
+
 class MappingTestCase(TestBase):
 
     COUNT = 10
@@ -1131,6 +1298,36 @@
             dict.clear()
         self.assertEqual(len(dict), 0)
 
+    def check_weak_del_and_len_while_iterating(self, dict, testcontext):
+        # Check that len() works when both iterating and removing keys
+        # explicitly through various means (.pop(), .clear()...), while
+        # implicit mutation is deferred because an iterator is alive.
+        # (each call to testcontext() should schedule one item for removal
+        #  for this test to work properly)
+        o = Object(123456)
+        with testcontext():
+            n = len(dict)
+            dict.popitem()
+            self.assertEqual(len(dict), n - 1)
+            dict[o] = o
+            self.assertEqual(len(dict), n)
+        with testcontext():
+            self.assertEqual(len(dict), n - 1)
+            dict.pop(next(dict.keys()))
+            self.assertEqual(len(dict), n - 2)
+        with testcontext():
+            self.assertEqual(len(dict), n - 3)
+            del dict[next(dict.keys())]
+            self.assertEqual(len(dict), n - 4)
+        with testcontext():
+            self.assertEqual(len(dict), n - 5)
+            dict.popitem()
+            self.assertEqual(len(dict), n - 6)
+        with testcontext():
+            dict.clear()
+            self.assertEqual(len(dict), 0)
+        self.assertEqual(len(dict), 0)
+
     def test_weak_keys_destroy_while_iterating(self):
         # Issue #7105: iterators shouldn't crash when a key is implicitly removed
         dict, objects = self.make_weak_keyed_dict()
@@ -1150,7 +1347,12 @@
                 yield Object(v), v
             finally:
                 it = None           # should commit all removals
+                gc.collect()
         self.check_weak_destroy_and_mutate_while_iterating(dict, testcontext)
+        # Issue #21173: len() fragile when keys are both implicitly and
+        # explicitly removed.
+        dict, objects = self.make_weak_keyed_dict()
+        self.check_weak_del_and_len_while_iterating(dict, testcontext)
 
     def test_weak_values_destroy_while_iterating(self):
         # Issue #7105: iterators shouldn't crash when a key is implicitly removed
@@ -1172,7 +1374,10 @@
                 yield k, Object(k)
             finally:
                 it = None           # should commit all removals
+                gc.collect()
         self.check_weak_destroy_and_mutate_while_iterating(dict, testcontext)
+        dict, objects = self.make_weak_valued_dict()
+        self.check_weak_del_and_len_while_iterating(dict, testcontext)
 
     def test_make_weak_keyed_dict_from_dict(self):
         o = Object(3)
@@ -1385,6 +1590,151 @@
     def _reference(self):
         return self.__ref.copy()
 
+
+class FinalizeTestCase(unittest.TestCase):
+
+    class A:
+        pass
+
+    def _collect_if_necessary(self):
+        # we create no ref-cycles so in CPython no gc should be needed
+        if sys.implementation.name != 'cpython':
+            support.gc_collect()
+
+    def test_finalize(self):
+        def add(x,y,z):
+            res.append(x + y + z)
+            return x + y + z
+
+        a = self.A()
+
+        res = []
+        f = weakref.finalize(a, add, 67, 43, z=89)
+        self.assertEqual(f.alive, True)
+        self.assertEqual(f.peek(), (a, add, (67,43), {'z':89}))
+        self.assertEqual(f(), 199)
+        self.assertEqual(f(), None)
+        self.assertEqual(f(), None)
+        self.assertEqual(f.peek(), None)
+        self.assertEqual(f.detach(), None)
+        self.assertEqual(f.alive, False)
+        self.assertEqual(res, [199])
+
+        res = []
+        f = weakref.finalize(a, add, 67, 43, 89)
+        self.assertEqual(f.peek(), (a, add, (67,43,89), {}))
+        self.assertEqual(f.detach(), (a, add, (67,43,89), {}))
+        self.assertEqual(f(), None)
+        self.assertEqual(f(), None)
+        self.assertEqual(f.peek(), None)
+        self.assertEqual(f.detach(), None)
+        self.assertEqual(f.alive, False)
+        self.assertEqual(res, [])
+
+        res = []
+        f = weakref.finalize(a, add, x=67, y=43, z=89)
+        del a
+        self._collect_if_necessary()
+        self.assertEqual(f(), None)
+        self.assertEqual(f(), None)
+        self.assertEqual(f.peek(), None)
+        self.assertEqual(f.detach(), None)
+        self.assertEqual(f.alive, False)
+        self.assertEqual(res, [199])
+
+    def test_order(self):
+        a = self.A()
+        res = []
+
+        f1 = weakref.finalize(a, res.append, 'f1')
+        f2 = weakref.finalize(a, res.append, 'f2')
+        f3 = weakref.finalize(a, res.append, 'f3')
+        f4 = weakref.finalize(a, res.append, 'f4')
+        f5 = weakref.finalize(a, res.append, 'f5')
+
+        # make sure finalizers can keep themselves alive
+        del f1, f4
+
+        self.assertTrue(f2.alive)
+        self.assertTrue(f3.alive)
+        self.assertTrue(f5.alive)
+
+        self.assertTrue(f5.detach())
+        self.assertFalse(f5.alive)
+
+        f5()                       # nothing because previously unregistered
+        res.append('A')
+        f3()                       # => res.append('f3')
+        self.assertFalse(f3.alive)
+        res.append('B')
+        f3()                       # nothing because previously called
+        res.append('C')
+        del a
+        self._collect_if_necessary()
+                                   # => res.append('f4')
+                                   # => res.append('f2')
+                                   # => res.append('f1')
+        self.assertFalse(f2.alive)
+        res.append('D')
+        f2()                       # nothing because previously called by gc
+
+        expected = ['A', 'f3', 'B', 'C', 'f4', 'f2', 'f1', 'D']
+        self.assertEqual(res, expected)
+
+    def test_all_freed(self):
+        # we want a weakrefable subclass of weakref.finalize
+        class MyFinalizer(weakref.finalize):
+            pass
+
+        a = self.A()
+        res = []
+        def callback():
+            res.append(123)
+        f = MyFinalizer(a, callback)
+
+        wr_callback = weakref.ref(callback)
+        wr_f = weakref.ref(f)
+        del callback, f
+
+        self.assertIsNotNone(wr_callback())
+        self.assertIsNotNone(wr_f())
+
+        del a
+        self._collect_if_necessary()
+
+        self.assertIsNone(wr_callback())
+        self.assertIsNone(wr_f())
+        self.assertEqual(res, [123])
+
+    @classmethod
+    def run_in_child(cls):
+        def error():
+            # Create an atexit finalizer from inside a finalizer called
+            # at exit.  This should be the next to be run.
+            g1 = weakref.finalize(cls, print, 'g1')
+            print('f3 error')
+            1/0
+
+        # cls should stay alive till atexit callbacks run
+        f1 = weakref.finalize(cls, print, 'f1', _global_var)
+        f2 = weakref.finalize(cls, print, 'f2', _global_var)
+        f3 = weakref.finalize(cls, error)
+        f4 = weakref.finalize(cls, print, 'f4', _global_var)
+
+        assert f1.atexit == True
+        f2.atexit = False
+        assert f3.atexit == True
+        assert f4.atexit == True
+
+    def test_atexit(self):
+        prog = ('from test.test_weakref import FinalizeTestCase;'+
+                'FinalizeTestCase.run_in_child()')
+        rc, out, err = script_helper.assert_python_ok('-c', prog)
+        out = out.decode('ascii').splitlines()
+        self.assertEqual(out, ['f4 foobar', 'f3 error', 'g1', 'f1 foobar'])
+        self.assertTrue(b'ZeroDivisionError' in err)
+
+
 libreftest = """ Doctest for examples in the library reference: weakref.rst
 
 >>> import weakref
@@ -1473,10 +1823,12 @@
 def test_main():
     support.run_unittest(
         ReferencesTestCase,
+        WeakMethodTestCase,
         MappingTestCase,
         WeakValueDictionaryTestCase,
         WeakKeyDictionaryTestCase,
         SubclassableWeakrefTestCase,
+        FinalizeTestCase,
         )
     support.run_doctest(sys.modules[__name__])
 
diff --git a/Lib/test/test_winreg.py b/Lib/test/test_winreg.py
index cb4cde9..2c4ac08 100644
--- a/Lib/test/test_winreg.py
+++ b/Lib/test/test_winreg.py
@@ -8,7 +8,7 @@
 from platform import machine
 
 # Do this first so test will be skipped if module doesn't exist
-support.import_module('winreg')
+support.import_module('winreg', required_on=['win'])
 # Now import everything
 from winreg import *
 
@@ -57,13 +57,13 @@
     def delete_tree(self, root, subkey):
         try:
             hkey = OpenKey(root, subkey, KEY_ALL_ACCESS)
-        except WindowsError:
+        except OSError:
             # subkey does not exist
             return
         while True:
             try:
                 subsubkey = EnumKey(hkey, 0)
-            except WindowsError:
+            except OSError:
                 # no more subkeys
                 break
             self.delete_tree(hkey, subsubkey)
@@ -100,7 +100,7 @@
             QueryInfoKey(int_sub_key)
             self.fail("It appears the CloseKey() function does "
                       "not close the actual key!")
-        except EnvironmentError:
+        except OSError:
             pass
         # ... and close that key that way :-)
         int_key = int(key)
@@ -109,7 +109,7 @@
             QueryInfoKey(int_key)
             self.fail("It appears the key.Close() function "
                       "does not close the actual key!")
-        except EnvironmentError:
+        except OSError:
             pass
 
     def _read_test_data(self, root_key, subkeystr="sub_key", OpenKey=OpenKey):
@@ -126,7 +126,7 @@
             while 1:
                 try:
                     data = EnumValue(sub_key, index)
-                except EnvironmentError:
+                except OSError:
                     break
                 self.assertEqual(data in test_data, True,
                                  "Didn't read back the correct test data")
@@ -147,7 +147,7 @@
         try:
             EnumKey(key, 1)
             self.fail("Was able to get a second key when I only have one!")
-        except EnvironmentError:
+        except OSError:
             pass
 
         key.Close()
@@ -171,7 +171,7 @@
             # Shouldnt be able to delete it twice!
             DeleteKey(key, subkeystr)
             self.fail("Deleting the key twice succeeded")
-        except EnvironmentError:
+        except OSError:
             pass
         key.Close()
         DeleteKey(root_key, test_key_name)
@@ -179,7 +179,7 @@
         try:
             key = OpenKey(root_key, test_key_name)
             self.fail("Could open the non-existent key")
-        except WindowsError: # Use this error name this time
+        except OSError: # Use this error name this time
             pass
 
     def _test_all(self, root_key, subkeystr="sub_key"):
@@ -230,7 +230,7 @@
 
     def test_inexistant_remote_registry(self):
         connect = lambda: ConnectRegistry("abcdefghijkl", HKEY_CURRENT_USER)
-        self.assertRaises(WindowsError, connect)
+        self.assertRaises(OSError, connect)
 
     def testExpandEnvironmentStrings(self):
         r = ExpandEnvironmentStrings("%windir%\\test")
@@ -242,8 +242,8 @@
         try:
             with ConnectRegistry(None, HKEY_LOCAL_MACHINE) as h:
                 self.assertNotEqual(h.handle, 0)
-                raise WindowsError
-        except WindowsError:
+                raise OSError
+        except OSError:
             self.assertEqual(h.handle, 0)
 
     def test_changing_value(self):
@@ -341,7 +341,7 @@
     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
+        # generated by PyLong_FromLong. The implementation now uses
         # PyLong_FromUnsignedLong to match DWORD's size.
         try:
             with CreateKey(HKEY_CURRENT_USER, test_key_name) as ck:
@@ -354,6 +354,19 @@
         finally:
             DeleteKey(HKEY_CURRENT_USER, test_key_name)
 
+    def test_setvalueex_crash_with_none_arg(self):
+        # Test for Issue #21151, segfault when None is passed to SetValueEx
+        try:
+            with CreateKey(HKEY_CURRENT_USER, test_key_name) as ck:
+                self.assertNotEqual(ck.handle, 0)
+                test_val = None
+                SetValueEx(ck, "test_name", 0, REG_BINARY, test_val)
+                ret_val, ret_type = QueryValueEx(ck, "test_name")
+                self.assertEqual(ret_type, REG_BINARY)
+                self.assertEqual(ret_val, test_val)
+        finally:
+            DeleteKey(HKEY_CURRENT_USER, test_key_name)
+
 
 
 @unittest.skipUnless(REMOTE_NAME, "Skipping remote registry tests")
@@ -407,7 +420,7 @@
                 open_fail = lambda: OpenKey(HKEY_CURRENT_USER,
                                             test_reflect_key_name, 0,
                                             KEY_READ | KEY_WOW64_64KEY)
-                self.assertRaises(WindowsError, open_fail)
+                self.assertRaises(OSError, open_fail)
 
             # Now explicitly open the 64-bit version of the key
             with OpenKey(HKEY_CURRENT_USER, test_reflect_key_name, 0,
@@ -447,7 +460,7 @@
             open_fail = lambda: OpenKeyEx(HKEY_CURRENT_USER,
                                           test_reflect_key_name, 0,
                                           KEY_READ | KEY_WOW64_64KEY)
-            self.assertRaises(WindowsError, open_fail)
+            self.assertRaises(OSError, open_fail)
 
             # Make sure the 32-bit key is actually there
             with OpenKeyEx(HKEY_CURRENT_USER, test_reflect_key_name, 0,
diff --git a/Lib/test/test_winsound.py b/Lib/test/test_winsound.py
index 069adc3..83618b6 100644
--- a/Lib/test/test_winsound.py
+++ b/Lib/test/test_winsound.py
@@ -22,7 +22,7 @@
         key = winreg.OpenKeyEx(winreg.HKEY_CURRENT_USER,
                 "AppEvents\Schemes\Apps\.Default\{0}\.Default".format(sound))
         return winreg.EnumValue(key, 0)[1] != ""
-    except WindowsError:
+    except OSError:
         return False
 
 class BeepTest(unittest.TestCase):
diff --git a/Lib/test/test_xdrlib.py b/Lib/test/test_xdrlib.py
index 6004c9f..70496d6 100644
--- a/Lib/test/test_xdrlib.py
+++ b/Lib/test/test_xdrlib.py
@@ -51,8 +51,32 @@
         up.done()
         self.assertRaises(EOFError, up.unpack_uint)
 
+class ConversionErrorTest(unittest.TestCase):
+
+    def setUp(self):
+        self.packer = xdrlib.Packer()
+
+    def assertRaisesConversion(self, *args):
+        self.assertRaises(xdrlib.ConversionError, *args)
+
+    def test_pack_int(self):
+        self.assertRaisesConversion(self.packer.pack_int, 'string')
+
+    def test_pack_uint(self):
+        self.assertRaisesConversion(self.packer.pack_uint, 'string')
+
+    def test_float(self):
+        self.assertRaisesConversion(self.packer.pack_float, 'string')
+
+    def test_double(self):
+        self.assertRaisesConversion(self.packer.pack_double, 'string')
+
+    def test_uhyper(self):
+        self.assertRaisesConversion(self.packer.pack_uhyper, 'string')
+
 def test_main():
     support.run_unittest(XDRTest)
+    support.run_unittest(ConversionErrorTest)
 
 if __name__ == "__main__":
     test_main()
diff --git a/Lib/test/test_xml_dom_minicompat.py b/Lib/test/test_xml_dom_minicompat.py
index 085e52a..47c4de6 100644
--- a/Lib/test/test_xml_dom_minicompat.py
+++ b/Lib/test/test_xml_dom_minicompat.py
@@ -84,18 +84,19 @@
     def test_nodelist_pickle_roundtrip(self):
         # Test pickling and unpickling of a NodeList.
 
-        # Empty NodeList.
-        node_list = NodeList()
-        pickled = pickle.dumps(node_list)
-        unpickled = pickle.loads(pickled)
-        self.assertEqual(unpickled, node_list)
+        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+            # Empty NodeList.
+            node_list = NodeList()
+            pickled = pickle.dumps(node_list, proto)
+            unpickled = pickle.loads(pickled)
+            self.assertEqual(unpickled, node_list)
 
-        # Non-empty NodeList.
-        node_list.append(1)
-        node_list.append(2)
-        pickled = pickle.dumps(node_list)
-        unpickled = pickle.loads(pickled)
-        self.assertEqual(unpickled, node_list)
+            # Non-empty NodeList.
+            node_list.append(1)
+            node_list.append(2)
+            pickled = pickle.dumps(node_list, proto)
+            unpickled = pickle.loads(pickled)
+            self.assertEqual(unpickled, node_list)
 
 if __name__ == '__main__':
     unittest.main()
diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py
index 7bd8a2c..d3c0da0 100644
--- a/Lib/test/test_xml_etree.py
+++ b/Lib/test/test_xml_etree.py
@@ -10,6 +10,7 @@
 import operator
 import pickle
 import sys
+import types
 import unittest
 import weakref
 
@@ -120,11 +121,11 @@
     def setUpClass(cls):
         cls.modules = {pyET, ET}
 
-    def pickleRoundTrip(self, obj, name, dumper, loader):
+    def pickleRoundTrip(self, obj, name, dumper, loader, proto):
         save_m = sys.modules[name]
         try:
             sys.modules[name] = dumper
-            temp = pickle.dumps(obj)
+            temp = pickle.dumps(obj, proto)
             sys.modules[name] = loader
             result = pickle.loads(temp)
         except pickle.PicklingError as pe:
@@ -240,7 +241,6 @@
 
         self.assertEqual(ET.XML, ET.fromstring)
         self.assertEqual(ET.PI, ET.ProcessingInstruction)
-        self.assertEqual(ET.XMLParser, ET.XMLTreeBuilder)
 
     def test_simpleops(self):
         # Basic method sanity checks.
@@ -433,15 +433,6 @@
                 '   <empty-element />\n'
                 '</root>')
 
-        parser = ET.XMLTreeBuilder() # 1.2 compatibility
-        parser.feed(data)
-        self.serialize_check(parser.close(),
-                '<root>\n'
-                '   <element key="value">text</element>\n'
-                '   <element>text</element>tail\n'
-                '   <empty-element />\n'
-                '</root>')
-
         target = ET.TreeBuilder()
         parser = ET.XMLParser(target=target)
         parser.feed(data)
@@ -706,9 +697,9 @@
             'iso8859-13', 'iso8859-14', 'iso8859-15', 'iso8859-16',
             'cp437', 'cp720', 'cp737', 'cp775', 'cp850', 'cp852',
             'cp855', 'cp856', 'cp857', 'cp858', 'cp860', 'cp861', 'cp862',
-            'cp863', 'cp865', 'cp866', 'cp869', 'cp874', 'cp1006', 'cp1250',
-            'cp1251', 'cp1252', 'cp1253', 'cp1254', 'cp1255', 'cp1256',
-            'cp1257', 'cp1258',
+            'cp863', 'cp865', 'cp866', 'cp869', 'cp874', 'cp1006', 'cp1125',
+            'cp1250', 'cp1251', 'cp1252', 'cp1253', 'cp1254', 'cp1255',
+            'cp1256', 'cp1257', 'cp1258',
             'mac-cyrillic', 'mac-greek', 'mac-iceland', 'mac-latin2',
             'mac-roman', 'mac-turkish',
             'iso2022-jp', 'iso2022-jp-1', 'iso2022-jp-2', 'iso2022-jp-2004',
@@ -964,6 +955,160 @@
                 self.assertEqual(serialized, expected)
 
 
+class XMLPullParserTest(unittest.TestCase):
+
+    def _feed(self, parser, data, chunk_size=None):
+        if chunk_size is None:
+            parser.feed(data)
+        else:
+            for i in range(0, len(data), chunk_size):
+                parser.feed(data[i:i+chunk_size])
+
+    def assert_event_tags(self, parser, expected):
+        events = parser.read_events()
+        self.assertEqual([(action, elem.tag) for action, elem in events],
+                         expected)
+
+    def test_simple_xml(self):
+        for chunk_size in (None, 1, 5):
+            with self.subTest(chunk_size=chunk_size):
+                parser = ET.XMLPullParser()
+                self.assert_event_tags(parser, [])
+                self._feed(parser, "<!-- comment -->\n", chunk_size)
+                self.assert_event_tags(parser, [])
+                self._feed(parser,
+                           "<root>\n  <element key='value'>text</element",
+                           chunk_size)
+                self.assert_event_tags(parser, [])
+                self._feed(parser, ">\n", chunk_size)
+                self.assert_event_tags(parser, [('end', 'element')])
+                self._feed(parser, "<element>text</element>tail\n", chunk_size)
+                self._feed(parser, "<empty-element/>\n", chunk_size)
+                self.assert_event_tags(parser, [
+                    ('end', 'element'),
+                    ('end', 'empty-element'),
+                    ])
+                self._feed(parser, "</root>\n", chunk_size)
+                self.assert_event_tags(parser, [('end', 'root')])
+                self.assertIsNone(parser.close())
+
+    def test_feed_while_iterating(self):
+        parser = ET.XMLPullParser()
+        it = parser.read_events()
+        self._feed(parser, "<root>\n  <element key='value'>text</element>\n")
+        action, elem = next(it)
+        self.assertEqual((action, elem.tag), ('end', 'element'))
+        self._feed(parser, "</root>\n")
+        action, elem = next(it)
+        self.assertEqual((action, elem.tag), ('end', 'root'))
+        with self.assertRaises(StopIteration):
+            next(it)
+
+    def test_simple_xml_with_ns(self):
+        parser = ET.XMLPullParser()
+        self.assert_event_tags(parser, [])
+        self._feed(parser, "<!-- comment -->\n")
+        self.assert_event_tags(parser, [])
+        self._feed(parser, "<root xmlns='namespace'>\n")
+        self.assert_event_tags(parser, [])
+        self._feed(parser, "<element key='value'>text</element")
+        self.assert_event_tags(parser, [])
+        self._feed(parser, ">\n")
+        self.assert_event_tags(parser, [('end', '{namespace}element')])
+        self._feed(parser, "<element>text</element>tail\n")
+        self._feed(parser, "<empty-element/>\n")
+        self.assert_event_tags(parser, [
+            ('end', '{namespace}element'),
+            ('end', '{namespace}empty-element'),
+            ])
+        self._feed(parser, "</root>\n")
+        self.assert_event_tags(parser, [('end', '{namespace}root')])
+        self.assertIsNone(parser.close())
+
+    def test_ns_events(self):
+        parser = ET.XMLPullParser(events=('start-ns', 'end-ns'))
+        self._feed(parser, "<!-- comment -->\n")
+        self._feed(parser, "<root xmlns='namespace'>\n")
+        self.assertEqual(
+            list(parser.read_events()),
+            [('start-ns', ('', 'namespace'))])
+        self._feed(parser, "<element key='value'>text</element")
+        self._feed(parser, ">\n")
+        self._feed(parser, "<element>text</element>tail\n")
+        self._feed(parser, "<empty-element/>\n")
+        self._feed(parser, "</root>\n")
+        self.assertEqual(list(parser.read_events()), [('end-ns', None)])
+        self.assertIsNone(parser.close())
+
+    def test_events(self):
+        parser = ET.XMLPullParser(events=())
+        self._feed(parser, "<root/>\n")
+        self.assert_event_tags(parser, [])
+
+        parser = ET.XMLPullParser(events=('start', 'end'))
+        self._feed(parser, "<!-- comment -->\n")
+        self.assert_event_tags(parser, [])
+        self._feed(parser, "<root>\n")
+        self.assert_event_tags(parser, [('start', 'root')])
+        self._feed(parser, "<element key='value'>text</element")
+        self.assert_event_tags(parser, [('start', 'element')])
+        self._feed(parser, ">\n")
+        self.assert_event_tags(parser, [('end', 'element')])
+        self._feed(parser,
+                   "<element xmlns='foo'>text<empty-element/></element>tail\n")
+        self.assert_event_tags(parser, [
+            ('start', '{foo}element'),
+            ('start', '{foo}empty-element'),
+            ('end', '{foo}empty-element'),
+            ('end', '{foo}element'),
+            ])
+        self._feed(parser, "</root>")
+        self.assertIsNone(parser.close())
+        self.assert_event_tags(parser, [('end', 'root')])
+
+        parser = ET.XMLPullParser(events=('start',))
+        self._feed(parser, "<!-- comment -->\n")
+        self.assert_event_tags(parser, [])
+        self._feed(parser, "<root>\n")
+        self.assert_event_tags(parser, [('start', 'root')])
+        self._feed(parser, "<element key='value'>text</element")
+        self.assert_event_tags(parser, [('start', 'element')])
+        self._feed(parser, ">\n")
+        self.assert_event_tags(parser, [])
+        self._feed(parser,
+                   "<element xmlns='foo'>text<empty-element/></element>tail\n")
+        self.assert_event_tags(parser, [
+            ('start', '{foo}element'),
+            ('start', '{foo}empty-element'),
+            ])
+        self._feed(parser, "</root>")
+        self.assertIsNone(parser.close())
+
+    def test_events_sequence(self):
+        # Test that events can be some sequence that's not just a tuple or list
+        eventset = {'end', 'start'}
+        parser = ET.XMLPullParser(events=eventset)
+        self._feed(parser, "<foo>bar</foo>")
+        self.assert_event_tags(parser, [('start', 'foo'), ('end', 'foo')])
+
+        class DummyIter:
+            def __init__(self):
+                self.events = iter(['start', 'end', 'start-ns'])
+            def __iter__(self):
+                return self
+            def __next__(self):
+                return next(self.events)
+
+        parser = ET.XMLPullParser(events=DummyIter())
+        self._feed(parser, "<foo>bar</foo>")
+        self.assert_event_tags(parser, [('start', 'foo'), ('end', 'foo')])
+
+
+    def test_unknown_event(self):
+        with self.assertRaises(ValueError):
+            ET.XMLPullParser(events=('start', 'end', 'bogus'))
+
+
 #
 # xinclude tests (samples from appendix C of the xinclude specification)
 
@@ -1305,7 +1450,7 @@
         # Don't crash when using custom entities.
 
         ENTITIES = {'rsquo': '\u2019', 'lsquo': '\u2018'}
-        parser = ET.XMLTreeBuilder()
+        parser = ET.XMLParser()
         parser.entity.update(ENTITIES)
         parser.feed("""<?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE patent-application-publication SYSTEM "pap-v15-2001-01-31.dtd" []>
@@ -1532,33 +1677,36 @@
 
     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')
+        for proto in range(2, pickle.HIGHEST_PROTOCOL + 1):
+            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)
+                e2 = self.pickleRoundTrip(e, 'xml.etree.ElementTree',
+                                          dumper, loader, proto)
 
-            self.assertEqual(e2.tag, 'foo')
-            self.assertEqual(e2.attrib['bar'], 42)
-            self.assertEqual(len(e2), 2)
-            self.assertEqualElements(e, e2)
+                self.assertEqual(e2.tag, 'foo')
+                self.assertEqual(e2.attrib['bar'], 42)
+                self.assertEqual(len(e2), 2)
+                self.assertEqualElements(e, e2)
 
     def test_pickle_issue18997(self):
-        for dumper, loader in product(self.modules, repeat=2):
-            XMLTEXT = """<?xml version="1.0"?>
-                <group><dogs>4</dogs>
-                </group>"""
-            e1 = dumper.fromstring(XMLTEXT)
-            if hasattr(e1, '__getstate__'):
-                self.assertEqual(e1.__getstate__()['tag'], 'group')
-            e2 = self.pickleRoundTrip(e1, 'xml.etree.ElementTree', dumper, loader)
-            self.assertEqual(e2.tag, 'group')
-            self.assertEqual(e2[0].tag, 'dogs')
+        for proto in range(2, pickle.HIGHEST_PROTOCOL + 1):
+            for dumper, loader in product(self.modules, repeat=2):
+                XMLTEXT = """<?xml version="1.0"?>
+                    <group><dogs>4</dogs>
+                    </group>"""
+                e1 = dumper.fromstring(XMLTEXT)
+                if hasattr(e1, '__getstate__'):
+                    self.assertEqual(e1.__getstate__()['tag'], 'group')
+                e2 = self.pickleRoundTrip(e1, 'xml.etree.ElementTree',
+                                          dumper, loader, proto)
+                self.assertEqual(e2.tag, 'group')
+                self.assertEqual(e2[0].tag, 'dogs')
 
 
 class ElementTreeTypeTest(unittest.TestCase):
@@ -1643,6 +1791,11 @@
         self.assertEqual(e.find('./tag[last()-1]').attrib['class'], 'c')
         self.assertEqual(e.find('./tag[last()-2]').attrib['class'], 'b')
 
+        self.assertRaisesRegex(SyntaxError, 'XPath', e.find, './tag[0]')
+        self.assertRaisesRegex(SyntaxError, 'XPath', e.find, './tag[-1]')
+        self.assertRaisesRegex(SyntaxError, 'XPath', e.find, './tag[last()-0]')
+        self.assertRaisesRegex(SyntaxError, 'XPath', e.find, './tag[last()+1]')
+
     def test_findall(self):
         e = ET.XML(SAMPLE_XML)
         e[2] = ET.XML(SAMPLE_SECTION)
@@ -1902,7 +2055,7 @@
         # 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
+        base = ET._Element_Py
         # Not from a C extension
         self.assertEqual(base.__module__, 'xml.etree.ElementTree')
         # Force some multiple inheritance with a C class to make things
@@ -2261,6 +2414,18 @@
             ET.tostring(root, 'utf-16'),
             b''.join(ET.tostringlist(root, 'utf-16')))
 
+    def test_short_empty_elements(self):
+        root = ET.fromstring('<tag>a<x />b<y></y>c</tag>')
+        self.assertEqual(
+            ET.tostring(root, 'unicode'),
+            '<tag>a<x />b<y />c</tag>')
+        self.assertEqual(
+            ET.tostring(root, 'unicode', short_empty_elements=True),
+            '<tag>a<x />b<y />c</tag>')
+        self.assertEqual(
+            ET.tostring(root, 'unicode', short_empty_elements=False),
+            '<tag>a<x></x>b<y></y>c</tag>')
+
 
 class ParseErrorTest(unittest.TestCase):
     def test_subclass(self):
@@ -2326,8 +2491,11 @@
 
     # Test that the C accelerator was not imported for pyET
     def test_correct_import_pyET(self):
-        self.assertEqual(pyET.Element.__module__, 'xml.etree.ElementTree')
-        self.assertEqual(pyET.SubElement.__module__, 'xml.etree.ElementTree')
+        # The type of methods defined in Python code is types.FunctionType,
+        # while the type of methods defined inside _elementtree is
+        # <class 'wrapper_descriptor'>
+        self.assertIsInstance(pyET.Element.__init__, types.FunctionType)
+        self.assertIsInstance(pyET.XMLParser.__init__, types.FunctionType)
 
 # --------------------------------------------------------------------
 
@@ -2397,6 +2565,7 @@
         ElementIterTest,
         TreeBuilderTest,
         XMLParserTest,
+        XMLPullParserTest,
         BugsTest,
         ]
 
diff --git a/Lib/test/test_xml_etree_c.py b/Lib/test/test_xml_etree_c.py
index d04b7dc..816aa86 100644
--- a/Lib/test/test_xml_etree_c.py
+++ b/Lib/test/test_xml_etree_c.py
@@ -2,6 +2,7 @@
 import sys, struct
 from test import support
 from test.support import import_fresh_module
+import types
 import unittest
 
 cET = import_fresh_module('xml.etree.ElementTree',
@@ -31,14 +32,22 @@
 
 
 @unittest.skipUnless(cET, 'requires _elementtree')
+@support.cpython_only
 class TestAcceleratorImported(unittest.TestCase):
     # Test that the C accelerator was imported, as expected
     def test_correct_import_cET(self):
+        # SubElement is a function so it retains _elementtree as its module.
         self.assertEqual(cET.SubElement.__module__, '_elementtree')
 
     def test_correct_import_cET_alias(self):
         self.assertEqual(cET_alias.SubElement.__module__, '_elementtree')
 
+    def test_parser_comes_from_C(self):
+        # The type of methods defined in Python code is types.FunctionType,
+        # while the type of methods defined inside _elementtree is
+        # <class 'wrapper_descriptor'>
+        self.assertNotIsInstance(cET.Element.__init__, types.FunctionType)
+
 
 @unittest.skipUnless(cET, 'requires _elementtree')
 @support.cpython_only
diff --git a/Lib/test/test_xmlrpc.py b/Lib/test/test_xmlrpc.py
index fe2bf03..71b590c 100644
--- a/Lib/test/test_xmlrpc.py
+++ b/Lib/test/test_xmlrpc.py
@@ -15,6 +15,10 @@
 from test import support
 
 try:
+    import gzip
+except ImportError:
+    gzip = None
+try:
     import threading
 except ImportError:
     threading = None
@@ -216,7 +220,7 @@
             xmlrpc.client.ServerProxy('https://localhost:9999').bad_function()
         except NotImplementedError:
             self.assertFalse(has_ssl, "xmlrpc client's error with SSL support")
-        except socket.error:
+        except OSError:
             self.assertTrue(has_ssl)
 
 class HelperTestCase(unittest.TestCase):
@@ -376,6 +380,11 @@
             if name == 'div':
                 return 'This is the div function'
 
+        class Fixture:
+            @staticmethod
+            def getData():
+                return '42'
+
     def my_function():
         '''This is my function'''
         return True
@@ -407,7 +416,8 @@
         serv.register_function(pow)
         serv.register_function(lambda x,y: x+y, 'add')
         serv.register_function(my_function)
-        serv.register_instance(TestInstanceClass())
+        testInstance = TestInstanceClass()
+        serv.register_instance(testInstance, allow_dotted_names=True)
         evt.set()
 
         # handle up to 'numrequests' requests
@@ -500,14 +510,14 @@
             return True
         exc_mess = e.headers.get('X-exception')
     except AttributeError:
-        # Ignore socket.errors here.
+        # Ignore OSErrors here.
         exc_mess = str(e)
 
     if exc_mess and 'temporarily unavailable' in exc_mess.lower():
         return True
 
 def make_request_and_skipIf(condition, reason):
-    # If we skip the test, we have to make a request because the
+    # If we skip the test, we have to make a request because
     # the server created in setUp blocks expecting one to come in.
     if not condition:
         return lambda func: func
@@ -515,7 +525,7 @@
         def make_request_and_skip(self):
             try:
                 xmlrpclib.ServerProxy(URL).my_function()
-            except (xmlrpclib.ProtocolError, socket.error) as e:
+            except (xmlrpclib.ProtocolError, OSError) as e:
                 if not is_unavailable_exception(e):
                     raise
             raise unittest.SkipTest(reason)
@@ -553,7 +563,7 @@
         try:
             p = xmlrpclib.ServerProxy(URL)
             self.assertEqual(p.pow(6,8), 6**8)
-        except (xmlrpclib.ProtocolError, socket.error) as e:
+        except (xmlrpclib.ProtocolError, OSError) as e:
             # ignore failures due to non-blocking socket 'unavailable' errors
             if not is_unavailable_exception(e):
                 # protocol error; provide additional information in test output
@@ -566,7 +576,7 @@
             p = xmlrpclib.ServerProxy(URL)
             self.assertEqual(p.add(start_string, end_string),
                              start_string + end_string)
-        except (xmlrpclib.ProtocolError, socket.error) as e:
+        except (xmlrpclib.ProtocolError, OSError) as e:
             # ignore failures due to non-blocking socket 'unavailable' errors
             if not is_unavailable_exception(e):
                 # protocol error; provide additional information in test output
@@ -587,12 +597,13 @@
     def test_introspection1(self):
         expected_methods = set(['pow', 'div', 'my_function', 'add',
                                 'system.listMethods', 'system.methodHelp',
-                                'system.methodSignature', 'system.multicall'])
+                                'system.methodSignature', 'system.multicall',
+                                'Fixture'])
         try:
             p = xmlrpclib.ServerProxy(URL)
             meth = p.system.listMethods()
             self.assertEqual(set(meth), expected_methods)
-        except (xmlrpclib.ProtocolError, socket.error) as e:
+        except (xmlrpclib.ProtocolError, OSError) as e:
             # ignore failures due to non-blocking socket 'unavailable' errors
             if not is_unavailable_exception(e):
                 # protocol error; provide additional information in test output
@@ -605,7 +616,7 @@
             p = xmlrpclib.ServerProxy(URL)
             divhelp = p.system.methodHelp('div')
             self.assertEqual(divhelp, 'This is the div function')
-        except (xmlrpclib.ProtocolError, socket.error) as e:
+        except (xmlrpclib.ProtocolError, OSError) as e:
             # ignore failures due to non-blocking socket 'unavailable' errors
             if not is_unavailable_exception(e):
                 # protocol error; provide additional information in test output
@@ -619,7 +630,7 @@
             p = xmlrpclib.ServerProxy(URL)
             myfunction = p.system.methodHelp('my_function')
             self.assertEqual(myfunction, 'This is my function')
-        except (xmlrpclib.ProtocolError, socket.error) as e:
+        except (xmlrpclib.ProtocolError, OSError) as e:
             # ignore failures due to non-blocking socket 'unavailable' errors
             if not is_unavailable_exception(e):
                 # protocol error; provide additional information in test output
@@ -632,7 +643,7 @@
             p = xmlrpclib.ServerProxy(URL)
             divsig = p.system.methodSignature('div')
             self.assertEqual(divsig, 'signatures not supported')
-        except (xmlrpclib.ProtocolError, socket.error) as e:
+        except (xmlrpclib.ProtocolError, OSError) as e:
             # ignore failures due to non-blocking socket 'unavailable' errors
             if not is_unavailable_exception(e):
                 # protocol error; provide additional information in test output
@@ -649,7 +660,7 @@
             self.assertEqual(add_result, 2+3)
             self.assertEqual(pow_result, 6**8)
             self.assertEqual(div_result, 127//42)
-        except (xmlrpclib.ProtocolError, socket.error) as e:
+        except (xmlrpclib.ProtocolError, OSError) as e:
             # ignore failures due to non-blocking socket 'unavailable' errors
             if not is_unavailable_exception(e):
                 # protocol error; provide additional information in test output
@@ -670,7 +681,7 @@
             self.assertEqual(result.results[0]['faultString'],
                 '<class \'Exception\'>:method "this_is_not_exists" '
                 'is not supported')
-        except (xmlrpclib.ProtocolError, socket.error) as e:
+        except (xmlrpclib.ProtocolError, OSError) as e:
             # ignore failures due to non-blocking socket 'unavailable' errors
             if not is_unavailable_exception(e):
                 # protocol error; provide additional information in test output
@@ -686,6 +697,12 @@
         # This avoids waiting for the socket timeout.
         self.test_simple1()
 
+    def test_allow_dotted_names_true(self):
+        # XXX also need allow_dotted_names_false test.
+        server = xmlrpclib.ServerProxy("http://%s:%d/RPC2" % (ADDR, PORT))
+        data = server.Fixture.getData()
+        self.assertEqual(data, '42')
+
     def test_unicode_host(self):
         server = xmlrpclib.ServerProxy("http://%s:%d/RPC2" % (ADDR, PORT))
         self.assertEqual(server.add("a", "\xe9"), "a\xe9")
@@ -793,6 +810,7 @@
 
 #A test case that verifies that gzip encoding works in both directions
 #(for a request and the response)
+@unittest.skipIf(gzip is None, 'requires gzip')
 class GzipServerTestCase(BaseServerTestCase):
     #a request handler that supports keep-alive and logs requests into a
     #class variable
@@ -860,6 +878,7 @@
         self.assertTrue(a>b)
 
 
+@unittest.skipIf(gzip is None, 'requires gzip')
 class GzipUtilTestCase(unittest.TestCase):
 
     def test_gzip_decode_limit(self):
@@ -943,7 +962,7 @@
         try:
             p = xmlrpclib.ServerProxy(URL)
             self.assertEqual(p.pow(6,8), 6**8)
-        except (xmlrpclib.ProtocolError, socket.error) as e:
+        except (xmlrpclib.ProtocolError, OSError) as e:
             # ignore failures due to non-blocking socket 'unavailable' errors
             if not is_unavailable_exception(e):
                 # protocol error; provide additional information in test output
@@ -956,7 +975,7 @@
         try:
             p = xmlrpclib.ServerProxy(URL)
             p.pow(6,8)
-        except (xmlrpclib.ProtocolError, socket.error) as e:
+        except (xmlrpclib.ProtocolError, OSError) as e:
             # ignore failures due to non-blocking socket 'unavailable' errors
             if not is_unavailable_exception(e) and hasattr(e, "headers"):
                 # The two server-side error headers shouldn't be sent back in this case
@@ -976,7 +995,7 @@
         try:
             p = xmlrpclib.ServerProxy(URL)
             p.pow(6,8)
-        except (xmlrpclib.ProtocolError, socket.error) as e:
+        except (xmlrpclib.ProtocolError, OSError) as e:
             # ignore failures due to non-blocking socket 'unavailable' errors
             if not is_unavailable_exception(e) and hasattr(e, "headers"):
                 # We should get error info in the response
@@ -1104,24 +1123,13 @@
 
 @support.reap_threads
 def test_main():
-    xmlrpc_tests = [XMLRPCTestCase, HelperTestCase, DateTimeTestCase,
-         BinaryTestCase, FaultTestCase]
-    xmlrpc_tests.append(UseBuiltinTypesTestCase)
-    xmlrpc_tests.append(SimpleServerTestCase)
-    xmlrpc_tests.append(KeepaliveServerTestCase1)
-    xmlrpc_tests.append(KeepaliveServerTestCase2)
-    try:
-        import gzip
-        xmlrpc_tests.append(GzipServerTestCase)
-        xmlrpc_tests.append(GzipUtilTestCase)
-    except ImportError:
-        pass #gzip not supported in this build
-    xmlrpc_tests.append(MultiPathServerTestCase)
-    xmlrpc_tests.append(ServerProxyTestCase)
-    xmlrpc_tests.append(FailingServerTestCase)
-    xmlrpc_tests.append(CGIHandlerTestCase)
+    support.run_unittest(XMLRPCTestCase, HelperTestCase, DateTimeTestCase,
+            BinaryTestCase, FaultTestCase, UseBuiltinTypesTestCase,
+            SimpleServerTestCase, KeepaliveServerTestCase1,
+            KeepaliveServerTestCase2, GzipServerTestCase, GzipUtilTestCase,
+            MultiPathServerTestCase, ServerProxyTestCase, FailingServerTestCase,
+            CGIHandlerTestCase)
 
-    support.run_unittest(*xmlrpc_tests)
 
 if __name__ == "__main__":
     test_main()
diff --git a/Lib/test/test_xmlrpc_net.py b/Lib/test/test_xmlrpc_net.py
index 77f66ea..b60b82f 100644
--- a/Lib/test/test_xmlrpc_net.py
+++ b/Lib/test/test_xmlrpc_net.py
@@ -7,31 +7,7 @@
 
 import xmlrpc.client as xmlrpclib
 
-class CurrentTimeTest(unittest.TestCase):
-
-    def test_current_time(self):
-        # Get the current time from xmlrpc.com.  This code exercises
-        # the minimal HTTP functionality in xmlrpclib.
-        self.skipTest("time.xmlrpc.com is unreliable")
-        server = xmlrpclib.ServerProxy("http://time.xmlrpc.com/RPC2")
-        try:
-            t0 = server.currentTime.getCurrentTime()
-        except socket.error as e:
-            self.skipTest("network error: %s" % e)
-
-        # Perform a minimal sanity check on the result, just to be sure
-        # the request means what we think it means.
-        t1 = xmlrpclib.DateTime()
-
-        dt0 = xmlrpclib._datetime_type(t0.value)
-        dt1 = xmlrpclib._datetime_type(t1.value)
-        if dt0 > dt1:
-            delta = dt0 - dt1
-        else:
-            delta = dt1 - dt0
-        # The difference between the system time here and the system
-        # time on the server should not be too big.
-        self.assertTrue(delta.days <= 1)
+class PythonBuildersTest(unittest.TestCase):
 
     def test_python_builders(self):
         # Get the list of builders from the XMLRPC buildbot interface at
@@ -39,7 +15,7 @@
         server = xmlrpclib.ServerProxy("http://buildbot.python.org/all/xmlrpc/")
         try:
             builders = server.getAllBuilders()
-        except socket.error as e:
+        except OSError as e:
             self.skipTest("network error: %s" % e)
         self.addCleanup(lambda: server('close')())
 
@@ -51,7 +27,7 @@
 
 def test_main():
     support.requires("network")
-    support.run_unittest(CurrentTimeTest)
+    support.run_unittest(PythonBuildersTest)
 
 if __name__ == "__main__":
     test_main()
diff --git a/Lib/test/test_zipfile.py b/Lib/test/test_zipfile.py
index 12a0f71..76e32fb 100644
--- a/Lib/test/test_zipfile.py
+++ b/Lib/test/test_zipfile.py
@@ -1,9 +1,9 @@
+import contextlib
 import io
 import os
 import sys
-import imp
+import importlib.util
 import time
-import shutil
 import struct
 import zipfile
 import unittest
@@ -12,9 +12,9 @@
 from tempfile import TemporaryFile
 from random import randint, random, getrandbits
 
-from test.support import (TESTFN, findfile, unlink,
+from test.support import (TESTFN, findfile, unlink, rmtree,
                           requires_zlib, requires_bz2, requires_lzma,
-                          captured_stdout)
+                          captured_stdout, check_warnings)
 
 TESTFN2 = TESTFN + "2"
 TESTFNDIR = TESTFN + "d"
@@ -26,6 +26,9 @@
                    ('ziptest2dir/ziptest3dir/_ziptest3', 'azsxdcfvgb'),
                    ('ziptest2dir/ziptest3dir/ziptest4dir/_ziptest3', '6y7u8i9o0p')]
 
+def getrandbytes(size):
+    return getrandbits(8 * size).to_bytes(size, 'little')
+
 def get_files(test):
     yield TESTFN2
     with TemporaryFile() as f:
@@ -35,6 +38,10 @@
         yield f
         test.assertFalse(f.closed)
 
+def openU(zipfp, fn):
+    with check_warnings(('', DeprecationWarning)):
+        return zipfp.open(fn, 'rU')
+
 class AbstractTestsWithSourceFile:
     @classmethod
     def setUpClass(cls):
@@ -286,7 +293,7 @@
         # than requested.
         for test_size in (1, 4095, 4096, 4097, 16384):
             file_size = test_size + 1
-            junk = getrandbits(8 * file_size).to_bytes(file_size, 'little')
+            junk = getrandbytes(file_size)
             with zipfile.ZipFile(io.BytesIO(), "w", self.compression) as zipf:
                 zipf.writestr('foo', junk)
                 with zipf.open('foo', 'r') as fp:
@@ -459,7 +466,9 @@
 
     def setUp(self):
         self._limit = zipfile.ZIP64_LIMIT
-        zipfile.ZIP64_LIMIT = 5
+        self._filecount_limit = zipfile.ZIP_FILECOUNT_LIMIT
+        zipfile.ZIP64_LIMIT = 1000
+        zipfile.ZIP_FILECOUNT_LIMIT = 9
 
         # Make a source file with some lines
         with open(TESTFN, "wb") as fp:
@@ -526,8 +535,67 @@
         for f in get_files(self):
             self.zip_test(f, self.compression)
 
+    def test_too_many_files(self):
+        # This test checks that more than 64k files can be added to an archive,
+        # and that the resulting archive can be read properly by ZipFile
+        zipf = zipfile.ZipFile(TESTFN, "w", self.compression,
+                               allowZip64=True)
+        zipf.debug = 100
+        numfiles = 15
+        for i in range(numfiles):
+            zipf.writestr("foo%08d" % i, "%d" % (i**3 % 57))
+        self.assertEqual(len(zipf.namelist()), numfiles)
+        zipf.close()
+
+        zipf2 = zipfile.ZipFile(TESTFN, "r", self.compression)
+        self.assertEqual(len(zipf2.namelist()), numfiles)
+        for i in range(numfiles):
+            content = zipf2.read("foo%08d" % i).decode('ascii')
+            self.assertEqual(content, "%d" % (i**3 % 57))
+        zipf2.close()
+
+    def test_too_many_files_append(self):
+        zipf = zipfile.ZipFile(TESTFN, "w", self.compression,
+                               allowZip64=False)
+        zipf.debug = 100
+        numfiles = 9
+        for i in range(numfiles):
+            zipf.writestr("foo%08d" % i, "%d" % (i**3 % 57))
+        self.assertEqual(len(zipf.namelist()), numfiles)
+        with self.assertRaises(zipfile.LargeZipFile):
+            zipf.writestr("foo%08d" % numfiles, b'')
+        self.assertEqual(len(zipf.namelist()), numfiles)
+        zipf.close()
+
+        zipf = zipfile.ZipFile(TESTFN, "a", self.compression,
+                               allowZip64=False)
+        zipf.debug = 100
+        self.assertEqual(len(zipf.namelist()), numfiles)
+        with self.assertRaises(zipfile.LargeZipFile):
+            zipf.writestr("foo%08d" % numfiles, b'')
+        self.assertEqual(len(zipf.namelist()), numfiles)
+        zipf.close()
+
+        zipf = zipfile.ZipFile(TESTFN, "a", self.compression,
+                               allowZip64=True)
+        zipf.debug = 100
+        self.assertEqual(len(zipf.namelist()), numfiles)
+        numfiles2 = 15
+        for i in range(numfiles, numfiles2):
+            zipf.writestr("foo%08d" % i, "%d" % (i**3 % 57))
+        self.assertEqual(len(zipf.namelist()), numfiles2)
+        zipf.close()
+
+        zipf2 = zipfile.ZipFile(TESTFN, "r", self.compression)
+        self.assertEqual(len(zipf2.namelist()), numfiles2)
+        for i in range(numfiles2):
+            content = zipf2.read("foo%08d" % i).decode('ascii')
+            self.assertEqual(content, "%d" % (i**3 % 57))
+        zipf2.close()
+
     def tearDown(self):
         zipfile.ZIP64_LIMIT = self._limit
+        zipfile.ZIP_FILECOUNT_LIMIT = self._filecount_limit
         unlink(TESTFN)
         unlink(TESTFN2)
 
@@ -537,12 +605,12 @@
     compression = zipfile.ZIP_STORED
 
     def large_file_exception_test(self, f, compression):
-        with zipfile.ZipFile(f, "w", compression) as zipfp:
+        with zipfile.ZipFile(f, "w", compression, allowZip64=False) as zipfp:
             self.assertRaises(zipfile.LargeZipFile,
                               zipfp.write, TESTFN, "another.name")
 
     def large_file_exception_test2(self, f, compression):
-        with zipfile.ZipFile(f, "w", compression) as zipfp:
+        with zipfile.ZipFile(f, "w", compression, allowZip64=False) as zipfp:
             self.assertRaises(zipfile.LargeZipFile,
                               zipfp.writestr, "another.name", self.data)
 
@@ -588,7 +656,7 @@
                 if os.altsep is not None:
                     path_split.extend(fn.split(os.altsep))
                 if '__pycache__' in path_split:
-                    fn = imp.source_from_cache(fn)
+                    fn = importlib.util.source_from_cache(fn)
                 else:
                     fn = fn[:-1]
 
@@ -622,6 +690,34 @@
             self.assertCompiledIn('email/__init__.py', names)
             self.assertCompiledIn('email/mime/text.py', names)
 
+    def test_write_filtered_python_package(self):
+        import test
+        packagedir = os.path.dirname(test.__file__)
+
+        with TemporaryFile() as t, zipfile.PyZipFile(t, "w") as zipfp:
+
+            # first make sure that the test folder gives error messages
+            # (on the badsyntax_... files)
+            with captured_stdout() as reportSIO:
+                zipfp.writepy(packagedir)
+            reportStr = reportSIO.getvalue()
+            self.assertTrue('SyntaxError' in reportStr)
+
+            # then check that the filter works on the whole package
+            with captured_stdout() as reportSIO:
+                zipfp.writepy(packagedir, filterfunc=lambda whatever: False)
+            reportStr = reportSIO.getvalue()
+            self.assertTrue('SyntaxError' not in reportStr)
+
+            # then check that the filter works on individual files
+            with captured_stdout() as reportSIO, self.assertWarns(UserWarning):
+                zipfp.writepy(packagedir, filterfunc=lambda fn:
+                                                     'bad' not in fn)
+            reportStr = reportSIO.getvalue()
+            if reportStr:
+                print(reportStr)
+            self.assertTrue('SyntaxError' not in reportStr)
+
     def test_write_with_optimization(self):
         import email
         packagedir = os.path.dirname(email.__file__)
@@ -631,7 +727,7 @@
         ext = '.pyo' if optlevel == 1 else '.pyc'
 
         with TemporaryFile() as t, \
-                 zipfile.PyZipFile(t, "w", optimize=optlevel) as zipfp:
+             zipfile.PyZipFile(t, "w", optimize=optlevel) as zipfp:
             zipfp.writepy(packagedir)
 
             names = zipfp.namelist()
@@ -659,14 +755,34 @@
                 self.assertNotIn('mod2.txt', names)
 
         finally:
-            shutil.rmtree(TESTFN2)
+            rmtree(TESTFN2)
+
+    def test_write_python_directory_filtered(self):
+        os.mkdir(TESTFN2)
+        try:
+            with open(os.path.join(TESTFN2, "mod1.py"), "w") as fp:
+                fp.write("print(42)\n")
+
+            with open(os.path.join(TESTFN2, "mod2.py"), "w") as fp:
+                fp.write("print(42 * 42)\n")
+
+            with TemporaryFile() as t, zipfile.PyZipFile(t, "w") as zipfp:
+                zipfp.writepy(TESTFN2, filterfunc=lambda fn:
+                                                  not fn.endswith('mod2.py'))
+
+                names = zipfp.namelist()
+                self.assertCompiledIn('mod1.py', names)
+                self.assertNotIn('mod2.py', names)
+
+        finally:
+            rmtree(TESTFN2)
 
     def test_write_non_pyfile(self):
         with TemporaryFile() as t, zipfile.PyZipFile(t, "w") as zipfp:
             with open(TESTFN, 'w') as f:
                 f.write('most definitely not a python file')
             self.assertRaises(RuntimeError, zipfp.writepy, TESTFN)
-            os.remove(TESTFN)
+            unlink(TESTFN)
 
     def test_write_pyfile_bad_syntax(self):
         os.mkdir(TESTFN2)
@@ -689,7 +805,7 @@
                 self.assertNotIn('mod1.pyo', names)
 
         finally:
-            shutil.rmtree(TESTFN2)
+            rmtree(TESTFN2)
 
 
 class ExtractTests(unittest.TestCase):
@@ -712,10 +828,10 @@
                 with open(writtenfile, "rb") as f:
                     self.assertEqual(fdata.encode(), f.read())
 
-                os.remove(writtenfile)
+                unlink(writtenfile)
 
         # remove the test file subdirectories
-        shutil.rmtree(os.path.join(os.getcwd(), 'ziptest2dir'))
+        rmtree(os.path.join(os.getcwd(), 'ziptest2dir'))
 
     def test_extract_all(self):
         with zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_STORED) as zipfp:
@@ -730,10 +846,10 @@
                 with open(outfile, "rb") as f:
                     self.assertEqual(fdata.encode(), f.read())
 
-                os.remove(outfile)
+                unlink(outfile)
 
         # remove the test file subdirectories
-        shutil.rmtree(os.path.join(os.getcwd(), 'ziptest2dir'))
+        rmtree(os.path.join(os.getcwd(), 'ziptest2dir'))
 
     def check_file(self, filename, content):
         self.assertTrue(os.path.isfile(filename))
@@ -764,25 +880,25 @@
     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'),
+            (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)
 
@@ -815,12 +931,12 @@
                                  msg='extract %r: %r != %r' %
                                  (arcname, writtenfile, correctfile))
             self.check_file(correctfile, content)
-            shutil.rmtree('target')
+            rmtree('target')
 
             with zipfile.ZipFile(TESTFN2, 'r') as zipfp:
                 zipfp.extractall(targetpath)
             self.check_file(correctfile, content)
-            shutil.rmtree('target')
+            rmtree('target')
 
             correctfile = os.path.join(os.getcwd(), *fixedname.split('/'))
 
@@ -829,14 +945,14 @@
                 self.assertEqual(writtenfile, correctfile,
                                  msg="extract %r" % arcname)
             self.check_file(correctfile, content)
-            shutil.rmtree(fixedname.split('/')[0])
+            rmtree(fixedname.split('/')[0])
 
             with zipfile.ZipFile(TESTFN2, 'r') as zipfp:
                 zipfp.extractall()
             self.check_file(correctfile, content)
-            shutil.rmtree(fixedname.split('/')[0])
+            rmtree(fixedname.split('/')[0])
 
-            os.remove(TESTFN2)
+            unlink(TESTFN2)
 
 
 class OtherTests(unittest.TestCase):
@@ -860,6 +976,17 @@
                 data += zipfp.read(info)
             self.assertIn(data, {b"foobar", b"barfoo"})
 
+    def test_universal_deprecation(self):
+        f = io.BytesIO()
+        with zipfile.ZipFile(f, "w") as zipfp:
+            zipfp.writestr('spam.txt', b'ababagalamaga')
+
+        with zipfile.ZipFile(f, "r") as zipfp:
+            for mode in 'U', 'rU':
+                with self.assertWarns(DeprecationWarning):
+                    zipopen = zipfp.open('spam.txt', mode)
+                zipopen.close()
+
     def test_universal_readaheads(self):
         f = io.BytesIO()
 
@@ -869,7 +996,7 @@
 
         data2 = b''
         with zipfile.ZipFile(f, 'r') as zipfp, \
-             zipfp.open(TESTFN, 'rU') as zipopen:
+             openU(zipfp, TESTFN) as zipopen:
             for line in zipopen:
                 data2 += line
 
@@ -910,10 +1037,10 @@
     def test_unsupported_version(self):
         # File has an extract_version of 120
         data = (b'PK\x03\x04x\x00\x00\x00\x00\x00!p\xa1@\x00\x00\x00\x00\x00\x00'
-        b'\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00xPK\x01\x02x\x03x\x00\x00\x00\x00'
-        b'\x00!p\xa1@\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00'
-        b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x01\x00\x00\x00\x00xPK\x05\x06'
-        b'\x00\x00\x00\x00\x01\x00\x01\x00/\x00\x00\x00\x1f\x00\x00\x00\x00\x00')
+                b'\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00xPK\x01\x02x\x03x\x00\x00\x00\x00'
+                b'\x00!p\xa1@\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00'
+                b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x01\x00\x00\x00\x00xPK\x05\x06'
+                b'\x00\x00\x00\x00\x01\x00\x01\x00/\x00\x00\x00\x1f\x00\x00\x00\x00\x00')
 
         self.assertRaises(NotImplementedError, zipfile.ZipFile,
                           io.BytesIO(data), 'r')
@@ -946,7 +1073,7 @@
         try:
             with zipfile.ZipFile(TESTFN, 'a') as zf:
                 zf.writestr(filename, content)
-        except IOError:
+        except OSError:
             self.fail('Could not append data to a non-existent zip file.')
 
         self.assertTrue(os.path.exists(TESTFN))
@@ -1018,7 +1145,7 @@
         fp.seek(0, 0)
         self.assertTrue(zipfile.is_zipfile(fp))
 
-    def test_non_existent_file_raises_IOError(self):
+    def test_non_existent_file_raises_OSError(self):
         # make sure we don't raise an AttributeError when a partially-constructed
         # ZipFile instance is finalized; this tests for regression on SF tracker
         # bug #403871.
@@ -1030,7 +1157,7 @@
         # it is ignored, but the user should be sufficiently annoyed by
         # the message on the output that regression will be noticed
         # quickly.
-        self.assertRaises(IOError, zipfile.ZipFile, TESTFN)
+        self.assertRaises(OSError, zipfile.ZipFile, TESTFN)
 
     def test_empty_file_raises_BadZipFile(self):
         f = open(TESTFN, 'w')
@@ -1099,11 +1226,11 @@
     def test_unsupported_compression(self):
         # data is declared as shrunk, but actually deflated
         data = (b'PK\x03\x04.\x00\x00\x00\x01\x00\xe4C\xa1@\x00\x00\x00'
-        b'\x00\x02\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00x\x03\x00PK\x01'
-        b'\x02.\x03.\x00\x00\x00\x01\x00\xe4C\xa1@\x00\x00\x00\x00\x02\x00\x00'
-        b'\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
-        b'\x80\x01\x00\x00\x00\x00xPK\x05\x06\x00\x00\x00\x00\x01\x00\x01\x00'
-        b'/\x00\x00\x00!\x00\x00\x00\x00\x00')
+                b'\x00\x02\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00x\x03\x00PK\x01'
+                b'\x02.\x03.\x00\x00\x00\x01\x00\xe4C\xa1@\x00\x00\x00\x00\x02\x00\x00'
+                b'\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
+                b'\x80\x01\x00\x00\x00\x00xPK\x05\x06\x00\x00\x00\x00\x01\x00\x01\x00'
+                b'/\x00\x00\x00!\x00\x00\x00\x00\x00')
         with zipfile.ZipFile(io.BytesIO(data), 'r') as zipf:
             self.assertRaises(NotImplementedError, zipf.open, 'x')
 
@@ -1218,7 +1345,7 @@
     def test_open_empty_file(self):
         # Issue 1710703: Check that opening a file with less than 22 bytes
         # raises a BadZipFile exception (rather than the previously unhelpful
-        # IOError)
+        # OSError)
         f = open(TESTFN, 'w')
         f.close()
         self.assertRaises(zipfile.BadZipFile, zipfile.ZipFile, TESTFN, 'r')
@@ -1227,6 +1354,21 @@
         self.assertRaises(ValueError,
                           zipfile.ZipInfo, 'seventies', (1979, 1, 1, 0, 0, 0))
 
+    def test_zipfile_with_short_extra_field(self):
+        """If an extra field in the header is less than 4 bytes, skip it."""
+        zipdata = (
+            b'PK\x03\x04\x14\x00\x00\x00\x00\x00\x93\x9b\xad@\x8b\x9e'
+            b'\xd9\xd3\x01\x00\x00\x00\x01\x00\x00\x00\x03\x00\x03\x00ab'
+            b'c\x00\x00\x00APK\x01\x02\x14\x03\x14\x00\x00\x00\x00'
+            b'\x00\x93\x9b\xad@\x8b\x9e\xd9\xd3\x01\x00\x00\x00\x01\x00\x00'
+            b'\x00\x03\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x81\x00'
+            b'\x00\x00\x00abc\x00\x00PK\x05\x06\x00\x00\x00\x00'
+            b'\x01\x00\x01\x003\x00\x00\x00%\x00\x00\x00\x00\x00'
+        )
+        with zipfile.ZipFile(io.BytesIO(zipdata), 'r') as zipf:
+            # testzip returns the name of the first corrupt file, or None
+            self.assertIsNone(zipf.testzip())
+
     def tearDown(self):
         unlink(TESTFN)
         unlink(TESTFN2)
@@ -1266,57 +1408,57 @@
 class StoredBadCrcTests(AbstractBadCrcTests, unittest.TestCase):
     compression = zipfile.ZIP_STORED
     zip_with_bad_crc = (
-            b'PK\003\004\024\0\0\0\0\0 \213\212;:r'
-            b'\253\377\f\0\0\0\f\0\0\0\005\0\0\000af'
-            b'ilehello,AworldP'
-            b'K\001\002\024\003\024\0\0\0\0\0 \213\212;:'
-            b'r\253\377\f\0\0\0\f\0\0\0\005\0\0\0\0'
-            b'\0\0\0\0\0\0\0\200\001\0\0\0\000afi'
-            b'lePK\005\006\0\0\0\0\001\0\001\0003\000'
-            b'\0\0/\0\0\0\0\0')
+        b'PK\003\004\024\0\0\0\0\0 \213\212;:r'
+        b'\253\377\f\0\0\0\f\0\0\0\005\0\0\000af'
+        b'ilehello,AworldP'
+        b'K\001\002\024\003\024\0\0\0\0\0 \213\212;:'
+        b'r\253\377\f\0\0\0\f\0\0\0\005\0\0\0\0'
+        b'\0\0\0\0\0\0\0\200\001\0\0\0\000afi'
+        b'lePK\005\006\0\0\0\0\001\0\001\0003\000'
+        b'\0\0/\0\0\0\0\0')
 
 @requires_zlib
 class DeflateBadCrcTests(AbstractBadCrcTests, unittest.TestCase):
     compression = zipfile.ZIP_DEFLATED
     zip_with_bad_crc = (
-            b'PK\x03\x04\x14\x00\x00\x00\x08\x00n}\x0c=FA'
-            b'KE\x10\x00\x00\x00n\x00\x00\x00\x05\x00\x00\x00af'
-            b'ile\xcbH\xcd\xc9\xc9W(\xcf/\xcaI\xc9\xa0'
-            b'=\x13\x00PK\x01\x02\x14\x03\x14\x00\x00\x00\x08\x00n'
-            b'}\x0c=FAKE\x10\x00\x00\x00n\x00\x00\x00\x05'
-            b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x01\x00\x00\x00'
-            b'\x00afilePK\x05\x06\x00\x00\x00\x00\x01\x00'
-            b'\x01\x003\x00\x00\x003\x00\x00\x00\x00\x00')
+        b'PK\x03\x04\x14\x00\x00\x00\x08\x00n}\x0c=FA'
+        b'KE\x10\x00\x00\x00n\x00\x00\x00\x05\x00\x00\x00af'
+        b'ile\xcbH\xcd\xc9\xc9W(\xcf/\xcaI\xc9\xa0'
+        b'=\x13\x00PK\x01\x02\x14\x03\x14\x00\x00\x00\x08\x00n'
+        b'}\x0c=FAKE\x10\x00\x00\x00n\x00\x00\x00\x05'
+        b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x01\x00\x00\x00'
+        b'\x00afilePK\x05\x06\x00\x00\x00\x00\x01\x00'
+        b'\x01\x003\x00\x00\x003\x00\x00\x00\x00\x00')
 
 @requires_bz2
 class Bzip2BadCrcTests(AbstractBadCrcTests, unittest.TestCase):
     compression = zipfile.ZIP_BZIP2
     zip_with_bad_crc = (
-            b'PK\x03\x04\x14\x03\x00\x00\x0c\x00nu\x0c=FA'
-            b'KE8\x00\x00\x00n\x00\x00\x00\x05\x00\x00\x00af'
-            b'ileBZh91AY&SY\xd4\xa8\xca'
-            b'\x7f\x00\x00\x0f\x11\x80@\x00\x06D\x90\x80 \x00 \xa5'
-            b'P\xd9!\x03\x03\x13\x13\x13\x89\xa9\xa9\xc2u5:\x9f'
-            b'\x8b\xb9"\x9c(HjTe?\x80PK\x01\x02\x14'
-            b'\x03\x14\x03\x00\x00\x0c\x00nu\x0c=FAKE8'
-            b'\x00\x00\x00n\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00'
-            b'\x00 \x80\x80\x81\x00\x00\x00\x00afilePK'
-            b'\x05\x06\x00\x00\x00\x00\x01\x00\x01\x003\x00\x00\x00[\x00'
-            b'\x00\x00\x00\x00')
+        b'PK\x03\x04\x14\x03\x00\x00\x0c\x00nu\x0c=FA'
+        b'KE8\x00\x00\x00n\x00\x00\x00\x05\x00\x00\x00af'
+        b'ileBZh91AY&SY\xd4\xa8\xca'
+        b'\x7f\x00\x00\x0f\x11\x80@\x00\x06D\x90\x80 \x00 \xa5'
+        b'P\xd9!\x03\x03\x13\x13\x13\x89\xa9\xa9\xc2u5:\x9f'
+        b'\x8b\xb9"\x9c(HjTe?\x80PK\x01\x02\x14'
+        b'\x03\x14\x03\x00\x00\x0c\x00nu\x0c=FAKE8'
+        b'\x00\x00\x00n\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00'
+        b'\x00 \x80\x80\x81\x00\x00\x00\x00afilePK'
+        b'\x05\x06\x00\x00\x00\x00\x01\x00\x01\x003\x00\x00\x00[\x00'
+        b'\x00\x00\x00\x00')
 
 @requires_lzma
 class LzmaBadCrcTests(AbstractBadCrcTests, unittest.TestCase):
     compression = zipfile.ZIP_LZMA
     zip_with_bad_crc = (
-            b'PK\x03\x04\x14\x03\x00\x00\x0e\x00nu\x0c=FA'
-            b'KE\x1b\x00\x00\x00n\x00\x00\x00\x05\x00\x00\x00af'
-            b'ile\t\x04\x05\x00]\x00\x00\x00\x04\x004\x19I'
-            b'\xee\x8d\xe9\x17\x89:3`\tq!.8\x00PK'
-            b'\x01\x02\x14\x03\x14\x03\x00\x00\x0e\x00nu\x0c=FA'
-            b'KE\x1b\x00\x00\x00n\x00\x00\x00\x05\x00\x00\x00\x00\x00'
-            b'\x00\x00\x00\x00 \x80\x80\x81\x00\x00\x00\x00afil'
-            b'ePK\x05\x06\x00\x00\x00\x00\x01\x00\x01\x003\x00\x00'
-            b'\x00>\x00\x00\x00\x00\x00')
+        b'PK\x03\x04\x14\x03\x00\x00\x0e\x00nu\x0c=FA'
+        b'KE\x1b\x00\x00\x00n\x00\x00\x00\x05\x00\x00\x00af'
+        b'ile\t\x04\x05\x00]\x00\x00\x00\x04\x004\x19I'
+        b'\xee\x8d\xe9\x17\x89:3`\tq!.8\x00PK'
+        b'\x01\x02\x14\x03\x14\x03\x00\x00\x0e\x00nu\x0c=FA'
+        b'KE\x1b\x00\x00\x00n\x00\x00\x00\x05\x00\x00\x00\x00\x00'
+        b'\x00\x00\x00\x00 \x80\x80\x81\x00\x00\x00\x00afil'
+        b'ePK\x05\x06\x00\x00\x00\x00\x01\x00\x01\x003\x00\x00'
+        b'\x00>\x00\x00\x00\x00\x00')
 
 
 class DecryptionTests(unittest.TestCase):
@@ -1325,22 +1467,22 @@
     ZIP file."""
 
     data = (
-    b'PK\x03\x04\x14\x00\x01\x00\x00\x00n\x92i.#y\xef?&\x00\x00\x00\x1a\x00'
-    b'\x00\x00\x08\x00\x00\x00test.txt\xfa\x10\xa0gly|\xfa-\xc5\xc0=\xf9y'
-    b'\x18\xe0\xa8r\xb3Z}Lg\xbc\xae\xf9|\x9b\x19\xe4\x8b\xba\xbb)\x8c\xb0\xdbl'
-    b'PK\x01\x02\x14\x00\x14\x00\x01\x00\x00\x00n\x92i.#y\xef?&\x00\x00\x00'
-    b'\x1a\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x01\x00 \x00\xb6\x81'
-    b'\x00\x00\x00\x00test.txtPK\x05\x06\x00\x00\x00\x00\x01\x00\x01\x006\x00'
-    b'\x00\x00L\x00\x00\x00\x00\x00' )
+        b'PK\x03\x04\x14\x00\x01\x00\x00\x00n\x92i.#y\xef?&\x00\x00\x00\x1a\x00'
+        b'\x00\x00\x08\x00\x00\x00test.txt\xfa\x10\xa0gly|\xfa-\xc5\xc0=\xf9y'
+        b'\x18\xe0\xa8r\xb3Z}Lg\xbc\xae\xf9|\x9b\x19\xe4\x8b\xba\xbb)\x8c\xb0\xdbl'
+        b'PK\x01\x02\x14\x00\x14\x00\x01\x00\x00\x00n\x92i.#y\xef?&\x00\x00\x00'
+        b'\x1a\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x01\x00 \x00\xb6\x81'
+        b'\x00\x00\x00\x00test.txtPK\x05\x06\x00\x00\x00\x00\x01\x00\x01\x006\x00'
+        b'\x00\x00L\x00\x00\x00\x00\x00' )
     data2 = (
-    b'PK\x03\x04\x14\x00\t\x00\x08\x00\xcf}38xu\xaa\xb2\x14\x00\x00\x00\x00\x02'
-    b'\x00\x00\x04\x00\x15\x00zeroUT\t\x00\x03\xd6\x8b\x92G\xda\x8b\x92GUx\x04'
-    b'\x00\xe8\x03\xe8\x03\xc7<M\xb5a\xceX\xa3Y&\x8b{oE\xd7\x9d\x8c\x98\x02\xc0'
-    b'PK\x07\x08xu\xaa\xb2\x14\x00\x00\x00\x00\x02\x00\x00PK\x01\x02\x17\x03'
-    b'\x14\x00\t\x00\x08\x00\xcf}38xu\xaa\xb2\x14\x00\x00\x00\x00\x02\x00\x00'
-    b'\x04\x00\r\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x81\x00\x00\x00\x00ze'
-    b'roUT\x05\x00\x03\xd6\x8b\x92GUx\x00\x00PK\x05\x06\x00\x00\x00\x00\x01'
-    b'\x00\x01\x00?\x00\x00\x00[\x00\x00\x00\x00\x00' )
+        b'PK\x03\x04\x14\x00\t\x00\x08\x00\xcf}38xu\xaa\xb2\x14\x00\x00\x00\x00\x02'
+        b'\x00\x00\x04\x00\x15\x00zeroUT\t\x00\x03\xd6\x8b\x92G\xda\x8b\x92GUx\x04'
+        b'\x00\xe8\x03\xe8\x03\xc7<M\xb5a\xceX\xa3Y&\x8b{oE\xd7\x9d\x8c\x98\x02\xc0'
+        b'PK\x07\x08xu\xaa\xb2\x14\x00\x00\x00\x00\x02\x00\x00PK\x01\x02\x17\x03'
+        b'\x14\x00\t\x00\x08\x00\xcf}38xu\xaa\xb2\x14\x00\x00\x00\x00\x02\x00\x00'
+        b'\x04\x00\r\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x81\x00\x00\x00\x00ze'
+        b'roUT\x05\x00\x03\xd6\x8b\x92GUx\x00\x00PK\x05\x06\x00\x00\x00\x00\x01'
+        b'\x00\x01\x00?\x00\x00\x00[\x00\x00\x00\x00\x00' )
 
     plain = b'zipfile.py encryption test'
     plain2 = b'\x00'*512
@@ -1497,46 +1639,105 @@
 
 @requires_zlib
 class TestsWithMultipleOpens(unittest.TestCase):
-    def setUp(self):
+    @classmethod
+    def setUpClass(cls):
+        cls.data1 = b'111' + getrandbytes(10000)
+        cls.data2 = b'222' + getrandbytes(10000)
+
+    def make_test_archive(self, f):
         # Create the ZIP archive
-        with zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_DEFLATED) as zipfp:
-            zipfp.writestr('ones', '1'*FIXEDTEST_SIZE)
-            zipfp.writestr('twos', '2'*FIXEDTEST_SIZE)
+        with zipfile.ZipFile(f, "w", zipfile.ZIP_DEFLATED) as zipfp:
+            zipfp.writestr('ones', self.data1)
+            zipfp.writestr('twos', self.data2)
 
     def test_same_file(self):
         # Verify that (when the ZipFile is in control of creating file objects)
         # multiple open() calls can be made without interfering with each other.
+        self.make_test_archive(TESTFN2)
         with zipfile.ZipFile(TESTFN2, mode="r") as zipf:
             with zipf.open('ones') as zopen1, zipf.open('ones') as zopen2:
                 data1 = zopen1.read(500)
                 data2 = zopen2.read(500)
-                data1 += zopen1.read(500)
-                data2 += zopen2.read(500)
+                data1 += zopen1.read()
+                data2 += zopen2.read()
             self.assertEqual(data1, data2)
+            self.assertEqual(data1, self.data1)
 
     def test_different_file(self):
         # Verify that (when the ZipFile is in control of creating file objects)
         # multiple open() calls can be made without interfering with each other.
+        self.make_test_archive(TESTFN2)
         with zipfile.ZipFile(TESTFN2, mode="r") as zipf:
             with zipf.open('ones') as zopen1, zipf.open('twos') as zopen2:
                 data1 = zopen1.read(500)
                 data2 = zopen2.read(500)
-                data1 += zopen1.read(500)
-                data2 += zopen2.read(500)
-            self.assertEqual(data1, b'1'*FIXEDTEST_SIZE)
-            self.assertEqual(data2, b'2'*FIXEDTEST_SIZE)
+                data1 += zopen1.read()
+                data2 += zopen2.read()
+            self.assertEqual(data1, self.data1)
+            self.assertEqual(data2, self.data2)
 
     def test_interleaved(self):
         # Verify that (when the ZipFile is in control of creating file objects)
         # multiple open() calls can be made without interfering with each other.
+        self.make_test_archive(TESTFN2)
         with zipfile.ZipFile(TESTFN2, mode="r") as zipf:
             with zipf.open('ones') as zopen1, zipf.open('twos') as zopen2:
                 data1 = zopen1.read(500)
                 data2 = zopen2.read(500)
-                data1 += zopen1.read(500)
-                data2 += zopen2.read(500)
-            self.assertEqual(data1, b'1'*FIXEDTEST_SIZE)
-            self.assertEqual(data2, b'2'*FIXEDTEST_SIZE)
+                data1 += zopen1.read()
+                data2 += zopen2.read()
+            self.assertEqual(data1, self.data1)
+            self.assertEqual(data2, self.data2)
+
+    def test_read_after_close(self):
+        self.make_test_archive(TESTFN2)
+        with contextlib.ExitStack() as stack:
+            with zipfile.ZipFile(TESTFN2, 'r') as zipf:
+                zopen1 = stack.enter_context(zipf.open('ones'))
+                zopen2 = stack.enter_context(zipf.open('twos'))
+            data1 = zopen1.read(500)
+            data2 = zopen2.read(500)
+            data1 += zopen1.read()
+            data2 += zopen2.read()
+        self.assertEqual(data1, self.data1)
+        self.assertEqual(data2, self.data2)
+
+    def test_read_after_write(self):
+        with zipfile.ZipFile(TESTFN2, 'w', zipfile.ZIP_DEFLATED) as zipf:
+            zipf.writestr('ones', self.data1)
+            zipf.writestr('twos', self.data2)
+            with zipf.open('ones') as zopen1:
+                data1 = zopen1.read(500)
+        self.assertEqual(data1, self.data1[:500])
+        with zipfile.ZipFile(TESTFN2, 'r') as zipf:
+            data1 = zipf.read('ones')
+            data2 = zipf.read('twos')
+        self.assertEqual(data1, self.data1)
+        self.assertEqual(data2, self.data2)
+
+    def test_write_after_read(self):
+        with zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_DEFLATED) as zipf:
+            zipf.writestr('ones', self.data1)
+            with zipf.open('ones') as zopen1:
+                zopen1.read(500)
+                zipf.writestr('twos', self.data2)
+        with zipfile.ZipFile(TESTFN2, 'r') as zipf:
+            data1 = zipf.read('ones')
+            data2 = zipf.read('twos')
+        self.assertEqual(data1, self.data1)
+        self.assertEqual(data2, self.data2)
+
+    def test_many_opens(self):
+        # Verify that read() and open() promptly close the file descriptor,
+        # and don't rely on the garbage collector to free resources.
+        self.make_test_archive(TESTFN2)
+        with zipfile.ZipFile(TESTFN2, mode="r") as zipf:
+            for x in range(100):
+                zipf.read('ones')
+                with zipf.open('ones') as zopen1:
+                    pass
+        with open(os.devnull) as f:
+            self.assertLess(f.fileno(), 100)
 
     def tearDown(self):
         unlink(TESTFN2)
@@ -1558,14 +1759,51 @@
         os.mkdir(os.path.join(TESTFN2, "a"))
         self.test_extract_dir()
 
-    def test_store_dir(self):
+    def test_write_dir(self):
+        dirpath = os.path.join(TESTFN2, "x")
+        os.mkdir(dirpath)
+        mode = os.stat(dirpath).st_mode & 0xFFFF
+        with zipfile.ZipFile(TESTFN, "w") as zipf:
+            zipf.write(dirpath)
+            zinfo = zipf.filelist[0]
+            self.assertTrue(zinfo.filename.endswith("/x/"))
+            self.assertEqual(zinfo.external_attr, (mode << 16) | 0x10)
+            zipf.write(dirpath, "y")
+            zinfo = zipf.filelist[1]
+            self.assertTrue(zinfo.filename, "y/")
+            self.assertEqual(zinfo.external_attr, (mode << 16) | 0x10)
+        with zipfile.ZipFile(TESTFN, "r") as zipf:
+            zinfo = zipf.filelist[0]
+            self.assertTrue(zinfo.filename.endswith("/x/"))
+            self.assertEqual(zinfo.external_attr, (mode << 16) | 0x10)
+            zinfo = zipf.filelist[1]
+            self.assertTrue(zinfo.filename, "y/")
+            self.assertEqual(zinfo.external_attr, (mode << 16) | 0x10)
+            target = os.path.join(TESTFN2, "target")
+            os.mkdir(target)
+            zipf.extractall(target)
+            self.assertTrue(os.path.isdir(os.path.join(target, "y")))
+            self.assertEqual(len(os.listdir(target)), 2)
+
+    def test_writestr_dir(self):
         os.mkdir(os.path.join(TESTFN2, "x"))
-        zipf = zipfile.ZipFile(TESTFN, "w")
-        zipf.write(os.path.join(TESTFN2, "x"), "x")
-        self.assertTrue(zipf.filelist[0].filename.endswith("x/"))
+        with zipfile.ZipFile(TESTFN, "w") as zipf:
+            zipf.writestr("x/", b'')
+            zinfo = zipf.filelist[0]
+            self.assertEqual(zinfo.filename, "x/")
+            self.assertEqual(zinfo.external_attr, (0o40775 << 16) | 0x10)
+        with zipfile.ZipFile(TESTFN, "r") as zipf:
+            zinfo = zipf.filelist[0]
+            self.assertTrue(zinfo.filename.endswith("x/"))
+            self.assertEqual(zinfo.external_attr, (0o40775 << 16) | 0x10)
+            target = os.path.join(TESTFN2, "target")
+            os.mkdir(target)
+            zipf.extractall(target)
+            self.assertTrue(os.path.isdir(os.path.join(target, "x")))
+            self.assertEqual(os.listdir(target), ["x"])
 
     def tearDown(self):
-        shutil.rmtree(TESTFN2)
+        rmtree(TESTFN2)
         if os.path.exists(TESTFN):
             unlink(TESTFN)
 
@@ -1599,7 +1837,7 @@
         # Read the ZIP archive
         with zipfile.ZipFile(f, "r") as zipfp:
             for sep, fn in self.arcfiles.items():
-                with zipfp.open(fn, "rU") as fp:
+                with openU(zipfp, fn) as fp:
                     zipdata = fp.read()
                 self.assertEqual(self.arcdata[sep], zipdata)
 
@@ -1613,7 +1851,7 @@
         # Read the ZIP archive
         with zipfile.ZipFile(f, "r") as zipfp:
             for sep, fn in self.arcfiles.items():
-                with zipfp.open(fn, "rU") as zipopen:
+                with openU(zipfp, fn) as zipopen:
                     data = b''
                     while True:
                         read = zipopen.readline()
@@ -1638,7 +1876,7 @@
         # Read the ZIP archive
         with zipfile.ZipFile(f, "r") as zipfp:
             for sep, fn in self.arcfiles.items():
-                with zipfp.open(fn, "rU") as zipopen:
+                with openU(zipfp, fn) as zipopen:
                     for line in self.line_gen:
                         linedata = zipopen.readline()
                         self.assertEqual(linedata, line + b'\n')
@@ -1653,7 +1891,7 @@
         # Read the ZIP archive
         with zipfile.ZipFile(f, "r") as zipfp:
             for sep, fn in self.arcfiles.items():
-                with zipfp.open(fn, "rU") as fp:
+                with openU(zipfp, fn) as fp:
                     ziplines = fp.readlines()
                 for line, zipline in zip(self.line_gen, ziplines):
                     self.assertEqual(zipline, line + b'\n')
@@ -1668,7 +1906,7 @@
         # Read the ZIP archive
         with zipfile.ZipFile(f, "r") as zipfp:
             for sep, fn in self.arcfiles.items():
-                with zipfp.open(fn, "rU") as fp:
+                with openU(zipfp, fn) as fp:
                     for line, zipline in zip(self.line_gen, fp):
                         self.assertEqual(zipline, line + b'\n')
 
@@ -1678,7 +1916,7 @@
 
     def tearDown(self):
         for sep, fn in self.arcfiles.items():
-            os.remove(fn)
+            unlink(fn)
         unlink(TESTFN)
         unlink(TESTFN2)
 
@@ -1702,6 +1940,5 @@
                                 unittest.TestCase):
     compression = zipfile.ZIP_LZMA
 
-
 if __name__ == "__main__":
     unittest.main()
diff --git a/Lib/test/test_zipfile64.py b/Lib/test/test_zipfile64.py
index a8fb7ab..7dea8a3 100644
--- a/Lib/test/test_zipfile64.py
+++ b/Lib/test/test_zipfile64.py
@@ -18,7 +18,7 @@
 from io import StringIO
 from tempfile import TemporaryFile
 
-from test.support import TESTFN, run_unittest, requires_zlib
+from test.support import TESTFN, requires_zlib
 
 TESTFN2 = TESTFN + "2"
 
@@ -38,7 +38,7 @@
 
     def zipTest(self, f, compression):
         # Create the ZIP archive.
-        zipfp = zipfile.ZipFile(f, "w", compression, allowZip64=True)
+        zipfp = zipfile.ZipFile(f, "w", compression)
 
         # It will contain enough copies of self.data to reach about 6GB of
         # raw data to store.
@@ -92,7 +92,7 @@
     def testMoreThan64kFiles(self):
         # This test checks that more than 64k files can be added to an archive,
         # and that the resulting archive can be read properly by ZipFile
-        zipf = zipfile.ZipFile(TESTFN, mode="w")
+        zipf = zipfile.ZipFile(TESTFN, mode="w", allowZip64=True)
         zipf.debug = 100
         numfiles = (1 << 16) * 3//2
         for i in range(numfiles):
@@ -105,14 +105,47 @@
         for i in range(numfiles):
             content = zipf2.read("foo%08d" % i).decode('ascii')
             self.assertEqual(content, "%d" % (i**3 % 57))
+        zipf2.close()
+
+    def testMoreThan64kFilesAppend(self):
+        zipf = zipfile.ZipFile(TESTFN, mode="w", allowZip64=False)
+        zipf.debug = 100
+        numfiles = (1 << 16) - 1
+        for i in range(numfiles):
+            zipf.writestr("foo%08d" % i, "%d" % (i**3 % 57))
+        self.assertEqual(len(zipf.namelist()), numfiles)
+        with self.assertRaises(zipfile.LargeZipFile):
+            zipf.writestr("foo%08d" % numfiles, b'')
+        self.assertEqual(len(zipf.namelist()), numfiles)
         zipf.close()
 
+        zipf = zipfile.ZipFile(TESTFN, mode="a", allowZip64=False)
+        zipf.debug = 100
+        self.assertEqual(len(zipf.namelist()), numfiles)
+        with self.assertRaises(zipfile.LargeZipFile):
+            zipf.writestr("foo%08d" % numfiles, b'')
+        self.assertEqual(len(zipf.namelist()), numfiles)
+        zipf.close()
+
+        zipf = zipfile.ZipFile(TESTFN, mode="a", allowZip64=True)
+        zipf.debug = 100
+        self.assertEqual(len(zipf.namelist()), numfiles)
+        numfiles2 = (1 << 16) * 3//2
+        for i in range(numfiles, numfiles2):
+            zipf.writestr("foo%08d" % i, "%d" % (i**3 % 57))
+        self.assertEqual(len(zipf.namelist()), numfiles2)
+        zipf.close()
+
+        zipf2 = zipfile.ZipFile(TESTFN, mode="r")
+        self.assertEqual(len(zipf2.namelist()), numfiles2)
+        for i in range(numfiles2):
+            content = zipf2.read("foo%08d" % i).decode('ascii')
+            self.assertEqual(content, "%d" % (i**3 % 57))
+        zipf2.close()
+
     def tearDown(self):
         support.unlink(TESTFN)
         support.unlink(TESTFN2)
 
-def test_main():
-    run_unittest(TestsWithSourceFile, OtherTests)
-
 if __name__ == "__main__":
-    test_main()
+    unittest.main()
diff --git a/Lib/test/test_zipimport.py b/Lib/test/test_zipimport.py
index 37603b9..1e351c8 100644
--- a/Lib/test/test_zipimport.py
+++ b/Lib/test/test_zipimport.py
@@ -1,13 +1,12 @@
 import sys
 import os
 import marshal
-import imp
+import importlib.util
 import struct
 import time
 import unittest
 
 from test import support
-from test.test_importhooks import ImportHooksBaseTestCase, test_src, test_co
 
 from zipfile import ZipFile, ZipInfo, ZIP_STORED, ZIP_DEFLATED
 
@@ -17,6 +16,14 @@
 import inspect
 import io
 from traceback import extract_tb, extract_stack, print_tb
+
+test_src = """\
+def get_name():
+    return __name__
+def get_file():
+    return __file__
+"""
+test_co = compile(test_src, "<???>", "exec")
 raise_src = 'def do_raise(): raise TypeError\n'
 
 def make_pyc(co, mtime, size):
@@ -27,7 +34,8 @@
             mtime = int(mtime)
         else:
             mtime = int(-0x100000000 + int(mtime))
-    pyc = imp.get_magic() + struct.pack("<ii", int(mtime), size & 0xFFFFFFFF) + data
+    pyc = (importlib.util.MAGIC_NUMBER +
+        struct.pack("<ii", int(mtime), size & 0xFFFFFFFF) + data)
     return pyc
 
 def module_path_to_dotted_name(path):
@@ -42,10 +50,27 @@
 TESTPACK2 = "ziptestpackage2"
 TEMP_ZIP = os.path.abspath("junk95142.zip")
 
-pyc_file = imp.cache_from_source(TESTMOD + '.py')
+pyc_file = importlib.util.cache_from_source(TESTMOD + '.py')
 pyc_ext = ('.pyc' if __debug__ else '.pyo')
 
 
+class ImportHooksBaseTestCase(unittest.TestCase):
+
+    def setUp(self):
+        self.path = sys.path[:]
+        self.meta_path = sys.meta_path[:]
+        self.path_hooks = sys.path_hooks[:]
+        sys.path_importer_cache.clear()
+        self.modules_before = support.modules_setup()
+
+    def tearDown(self):
+        sys.path[:] = self.path
+        sys.meta_path[:] = self.meta_path
+        sys.path_hooks[:] = self.path_hooks
+        sys.path_importer_cache.clear()
+        support.modules_cleanup(*self.modules_before)
+
+
 class UncompressedZipImportTestCase(ImportHooksBaseTestCase):
 
     compression = ZIP_STORED
@@ -196,6 +221,7 @@
             for name, (mtime, data) in files.items():
                 zinfo = ZipInfo(name, time.localtime(mtime))
                 zinfo.compress_type = self.compression
+                zinfo.comment = b"spam"
                 z.writestr(zinfo, data)
             z.close()
 
@@ -245,6 +271,7 @@
             for name, (mtime, data) in files.items():
                 zinfo = ZipInfo(name, time.localtime(mtime))
                 zinfo.compress_type = self.compression
+                zinfo.comment = b"eggs"
                 z.writestr(zinfo, data)
             z.close()
 
@@ -459,7 +486,7 @@
 
             self.assertRaises(error, z.load_module, 'abc')
             self.assertRaises(error, z.get_code, 'abc')
-            self.assertRaises(IOError, z.get_data, 'abc')
+            self.assertRaises(OSError, z.get_data, 'abc')
             self.assertRaises(error, z.get_source, 'abc')
             self.assertRaises(error, z.is_package, 'abc')
         finally:
diff --git a/Lib/test/test_zipimport_support.py b/Lib/test/test_zipimport_support.py
index f7f3398..66c3557 100644
--- a/Lib/test/test_zipimport_support.py
+++ b/Lib/test/test_zipimport_support.py
@@ -57,7 +57,7 @@
     # This used to use the ImportHooksBaseTestCase to restore
     # the state of the import related information
     # in the sys module after each test. However, that restores
-    # *too much* information and breaks for the invocation of
+    # *too much* information and breaks for the invocation
     # of test_doctest. So we do our own thing and leave
     # sys.modules alone.
     # We also clear the linecache and zipimport cache
@@ -227,13 +227,15 @@
             p = spawn_python(script_name)
             p.stdin.write(b'l\n')
             data = kill_python(p)
-            self.assertIn(script_name.encode('utf-8'), data)
+            # bdb/pdb applies normcase to its filename before displaying
+            self.assertIn(os.path.normcase(script_name.encode('utf-8')), data)
             zip_name, run_name = make_zip_script(d, "test_zip",
                                                 script_name, '__main__.py')
             p = spawn_python(zip_name)
             p.stdin.write(b'l\n')
             data = kill_python(p)
-            self.assertIn(run_name.encode('utf-8'), data)
+            # bdb/pdb applies normcase to its filename before displaying
+            self.assertIn(os.path.normcase(run_name.encode('utf-8')), data)
 
 
 def test_main():
diff --git a/Lib/test/tf_inherit_check.py b/Lib/test/tf_inherit_check.py
index 92ebd95..afe50d2 100644
--- a/Lib/test/tf_inherit_check.py
+++ b/Lib/test/tf_inherit_check.py
@@ -11,7 +11,7 @@
 
     try:
         os.write(fd, b"blat")
-    except os.error:
+    except OSError:
         # Success -- could not write to fd.
         sys.exit(0)
     else:
diff --git a/Lib/test/time_hashlib.py b/Lib/test/time_hashlib.py
index d939463..2585ecb 100644
--- a/Lib/test/time_hashlib.py
+++ b/Lib/test/time_hashlib.py
@@ -1,7 +1,8 @@
 # It's intended that this script be run by hand.  It runs speed tests on
 # hashlib functions; it does not test for correctness.
 
-import sys, time
+import sys
+import time
 import hashlib
 
 
@@ -9,8 +10,8 @@
     raise RuntimeError("eek, creatorFunc not overridden")
 
 def test_scaled_msg(scale, name):
-    iterations = 106201/scale * 20
-    longStr = 'Z'*scale
+    iterations = 106201//scale * 20
+    longStr = b'Z'*scale
 
     localCF = creatorFunc
     start = time.time()
diff --git a/Lib/textwrap.py b/Lib/textwrap.py
index 7024d4d..2489180 100644
--- a/Lib/textwrap.py
+++ b/Lib/textwrap.py
@@ -7,7 +7,7 @@
 
 import re
 
-__all__ = ['TextWrapper', 'wrap', 'fill', 'dedent', 'indent']
+__all__ = ['TextWrapper', 'wrap', 'fill', 'dedent', 'indent', 'shorten']
 
 # Hardcode the recognized whitespace characters to the US-ASCII
 # whitespace characters.  The main reason for doing this is that in
@@ -62,6 +62,10 @@
         compound words.
       drop_whitespace (default: true)
         Drop leading and trailing whitespace from lines.
+      max_lines (default: None)
+        Truncate wrapped lines.
+      placeholder (default: ' [...]')
+        Append to the last line of truncated text.
     """
 
     unicode_whitespace_trans = {}
@@ -104,7 +108,10 @@
                  break_long_words=True,
                  drop_whitespace=True,
                  break_on_hyphens=True,
-                 tabsize=8):
+                 tabsize=8,
+                 *,
+                 max_lines=None,
+                 placeholder=' [...]'):
         self.width = width
         self.initial_indent = initial_indent
         self.subsequent_indent = subsequent_indent
@@ -115,6 +122,8 @@
         self.drop_whitespace = drop_whitespace
         self.break_on_hyphens = break_on_hyphens
         self.tabsize = tabsize
+        self.max_lines = max_lines
+        self.placeholder = placeholder
 
 
     # -- Private methods -----------------------------------------------
@@ -223,6 +232,13 @@
         lines = []
         if self.width <= 0:
             raise ValueError("invalid width %r (must be > 0)" % self.width)
+        if self.max_lines is not None:
+            if self.max_lines > 1:
+                indent = self.subsequent_indent
+            else:
+                indent = self.initial_indent
+            if len(indent) + len(self.placeholder.lstrip()) > self.width:
+                raise ValueError("placeholder too large for max width")
 
         # Arrange in reverse order so items can be efficiently popped
         # from a stack of chucks.
@@ -265,18 +281,47 @@
             # fit on *any* line (not just this one).
             if chunks and len(chunks[-1]) > width:
                 self._handle_long_word(chunks, cur_line, cur_len, width)
+                cur_len = sum(map(len, cur_line))
 
             # If the last chunk on this line is all whitespace, drop it.
             if self.drop_whitespace and cur_line and cur_line[-1].strip() == '':
+                cur_len -= len(cur_line[-1])
                 del cur_line[-1]
 
-            # Convert current line back to a string and store it in list
-            # of all lines (return value).
             if cur_line:
-                lines.append(indent + ''.join(cur_line))
+                if (self.max_lines is None or
+                    len(lines) + 1 < self.max_lines or
+                    (not chunks or
+                     self.drop_whitespace and
+                     len(chunks) == 1 and
+                     not chunks[0].strip()) and cur_len <= width):
+                    # Convert current line back to a string and store it in
+                    # list of all lines (return value).
+                    lines.append(indent + ''.join(cur_line))
+                else:
+                    while cur_line:
+                        if (cur_line[-1].strip() and
+                            cur_len + len(self.placeholder) <= width):
+                            cur_line.append(self.placeholder)
+                            lines.append(indent + ''.join(cur_line))
+                            break
+                        cur_len -= len(cur_line[-1])
+                        del cur_line[-1]
+                    else:
+                        if lines:
+                            prev_line = lines[-1].rstrip()
+                            if (len(prev_line) + len(self.placeholder) <=
+                                    self.width):
+                                lines[-1] = prev_line + self.placeholder
+                                break
+                        lines.append(indent + self.placeholder.lstrip())
+                    break
 
         return lines
 
+    def _split_chunks(self, text):
+        text = self._munge_whitespace(text)
+        return self._split(text)
 
     # -- Public interface ----------------------------------------------
 
@@ -289,8 +334,7 @@
         and all other whitespace characters (including newline) are
         converted to space.
         """
-        text = self._munge_whitespace(text)
-        chunks = self._split(text)
+        chunks = self._split_chunks(text)
         if self.fix_sentence_endings:
             self._fix_sentence_endings(chunks)
         return self._wrap_chunks(chunks)
@@ -332,6 +376,21 @@
     w = TextWrapper(width=width, **kwargs)
     return w.fill(text)
 
+def shorten(text, width, **kwargs):
+    """Collapse and truncate the given text to fit in the given width.
+
+    The text first has its whitespace collapsed.  If it then fits in
+    the *width*, it is returned as is.  Otherwise, as many words
+    as possible are joined and then the placeholder is appended::
+
+        >>> textwrap.shorten("Hello  world!", width=12)
+        'Hello world!'
+        >>> textwrap.shorten("Hello  world!", width=11)
+        'Hello [...]'
+    """
+    w = TextWrapper(width=width, max_lines=1, **kwargs)
+    return w.fill(' '.join(text.strip().split()))
+
 
 # -- Loosely related functionality -------------------------------------
 
diff --git a/Lib/threading.py b/Lib/threading.py
index 625c9b9..37aa3b8 100644
--- a/Lib/threading.py
+++ b/Lib/threading.py
@@ -3,13 +3,17 @@
 import sys as _sys
 import _thread
 
-from time import sleep as _sleep
 try:
     from time import monotonic as _time
 except ImportError:
     from time import time as _time
 from traceback import format_exc as _format_exc
 from _weakrefset import WeakSet
+from itertools import islice as _islice, count as _count
+try:
+    from _collections import deque as _deque
+except ImportError:
+    from collections import deque as _deque
 
 # Note regarding PEP 8 compliant names
 #  This threading model was originally inspired by Java, and inherited
@@ -28,6 +32,7 @@
 # Rename some stuff so "from threading import *" is safe
 _start_new_thread = _thread.start_new_thread
 _allocate_lock = _thread.allocate_lock
+_set_sentinel = _thread._set_sentinel
 get_ident = _thread.get_ident
 ThreadError = _thread.error
 try:
@@ -132,7 +137,7 @@
         """
         me = get_ident()
         if self._owner == me:
-            self._count = self._count + 1
+            self._count += 1
             return 1
         rc = self._block.acquire(blocking, timeout)
         if rc:
@@ -224,7 +229,7 @@
             self._is_owned = lock._is_owned
         except AttributeError:
             pass
-        self._waiters = []
+        self._waiters = _deque()
 
     def __enter__(self):
         return self._lock.__enter__()
@@ -243,7 +248,7 @@
 
     def _is_owned(self):
         # Return True if lock is owned by current_thread.
-        # This method is called only if __lock doesn't have _is_owned().
+        # This method is called only if _lock doesn't have _is_owned().
         if self._lock.acquire(0):
             self._lock.release()
             return False
@@ -279,6 +284,7 @@
         waiter.acquire()
         self._waiters.append(waiter)
         saved_state = self._release_save()
+        gotit = False
         try:    # restore state no matter what (e.g., KeyboardInterrupt)
             if timeout is None:
                 waiter.acquire()
@@ -288,14 +294,14 @@
                     gotit = waiter.acquire(True, timeout)
                 else:
                     gotit = waiter.acquire(False)
-                if not gotit:
-                    try:
-                        self._waiters.remove(waiter)
-                    except ValueError:
-                        pass
             return gotit
         finally:
             self._acquire_restore(saved_state)
+            if not gotit:
+                try:
+                    self._waiters.remove(waiter)
+                except ValueError:
+                    pass
 
     def wait_for(self, predicate, timeout=None):
         """Wait until a condition evaluates to True.
@@ -332,14 +338,14 @@
         """
         if not self._is_owned():
             raise RuntimeError("cannot notify on un-acquired lock")
-        __waiters = self._waiters
-        waiters = __waiters[:n]
-        if not waiters:
+        all_waiters = self._waiters
+        waiters_to_notify = _deque(_islice(all_waiters, n))
+        if not waiters_to_notify:
             return
-        for waiter in waiters:
+        for waiter in waiters_to_notify:
             waiter.release()
             try:
-                __waiters.remove(waiter)
+                all_waiters.remove(waiter)
             except ValueError:
                 pass
 
@@ -414,7 +420,7 @@
                             break
                 self._cond.wait(timeout)
             else:
-                self._value = self._value - 1
+                self._value -= 1
                 rc = True
         return rc
 
@@ -428,7 +434,7 @@
 
         """
         with self._cond:
-            self._value = self._value + 1
+            self._value += 1
             self._cond.notify()
 
     def __exit__(self, t, v, tb):
@@ -720,18 +726,15 @@
 
 
 # Helper to generate new thread names
-_counter = 0
+_counter = _count().__next__
+_counter() # Consume 0 so first non-main thread has id 1.
 def _newname(template="Thread-%d"):
-    global _counter
-    _counter = _counter + 1
-    return template % _counter
+    return template % _counter()
 
 # Active thread administration
 _active_limbo_lock = _allocate_lock()
 _active = {}    # maps thread id to Thread object
 _limbo = {}
-
-# For debug and leak testing
 _dangling = WeakSet()
 
 # Main class for threads
@@ -745,12 +748,12 @@
 
     """
 
-    __initialized = False
+    _initialized = False
     # Need to store a reference to sys.exc_info for printing
     # out exceptions when a thread tries to use a global var. during interp.
     # shutdown and thus raises an exception about trying to perform some
     # operation on/with a NoneType
-    __exc_info = _sys.exc_info
+    _exc_info = _sys.exc_info
     # Keep sys.exc_clear too to clear the exception just before
     # allowing .join() to return.
     #XXX __exc_clear = _sys.exc_clear
@@ -790,28 +793,35 @@
         else:
             self._daemonic = current_thread().daemon
         self._ident = None
+        self._tstate_lock = None
         self._started = Event()
-        self._stopped = False
-        self._block = Condition(Lock())
+        self._is_stopped = False
         self._initialized = True
         # sys.stderr is not stored in the class like
         # sys.exc_info since it can be changed between instances
         self._stderr = _sys.stderr
+        # For debugging and _after_fork()
         _dangling.add(self)
 
-    def _reset_internal_locks(self):
+    def _reset_internal_locks(self, is_alive):
         # private!  Called by _after_fork() to reset our internal locks as
         # they may be in an invalid state leading to a deadlock or crash.
-        if hasattr(self, '_block'):  # DummyThread deletes _block
-            self._block.__init__()
         self._started._reset_internal_locks()
+        if is_alive:
+            self._set_tstate_lock()
+        else:
+            # The thread isn't alive after fork: it doesn't have a tstate
+            # anymore.
+            self._is_stopped = True
+            self._tstate_lock = None
 
     def __repr__(self):
         assert self._initialized, "Thread.__init__() was not called"
         status = "initial"
         if self._started.is_set():
             status = "started"
-        if self._stopped:
+        self.is_alive() # easy way to get ._is_stopped set when appropriate
+        if self._is_stopped:
             status = "stopped"
         if self._daemonic:
             status += " daemon"
@@ -884,9 +894,18 @@
     def _set_ident(self):
         self._ident = get_ident()
 
+    def _set_tstate_lock(self):
+        """
+        Set a lock object which will be released by the interpreter when
+        the underlying thread state (see pystate.h) gets deleted.
+        """
+        self._tstate_lock = _set_sentinel()
+        self._tstate_lock.acquire()
+
     def _bootstrap_inner(self):
         try:
             self._set_ident()
+            self._set_tstate_lock()
             self._started.set()
             with _active_limbo_lock:
                 _active[self._ident] = self
@@ -906,10 +925,10 @@
                 # shutdown) use self._stderr.  Otherwise still use sys (as in
                 # _sys) in case sys.stderr was redefined since the creation of
                 # self.
-                if _sys:
-                    _sys.stderr.write("Exception in thread %s:\n%s\n" %
-                                      (self.name, _format_exc()))
-                else:
+                if _sys and _sys.stderr is not None:
+                    print("Exception in thread %s:\n%s" %
+                          (self.name, _format_exc()), file=self._stderr)
+                elif self._stderr is not None:
                     # Do the best job possible w/o a huge amt. of code to
                     # approximate a traceback (code ideas from
                     # Lib/traceback.py)
@@ -937,11 +956,10 @@
                 # test_threading.test_no_refcycle_through_target when
                 # the exception keeps the target alive past when we
                 # assert that it's dead.
-                #XXX self.__exc_clear()
+                #XXX self._exc_clear()
                 pass
         finally:
             with _active_limbo_lock:
-                self._stop()
                 try:
                     # We don't call self._delete() because it also
                     # grabs _active_limbo_lock.
@@ -950,10 +968,27 @@
                     pass
 
     def _stop(self):
-        self._block.acquire()
-        self._stopped = True
-        self._block.notify_all()
-        self._block.release()
+        # After calling ._stop(), .is_alive() returns False and .join() returns
+        # immediately.  ._tstate_lock must be released before calling ._stop().
+        #
+        # Normal case:  C code at the end of the thread's life
+        # (release_sentinel in _threadmodule.c) releases ._tstate_lock, and
+        # that's detected by our ._wait_for_tstate_lock(), called by .join()
+        # and .is_alive().  Any number of threads _may_ call ._stop()
+        # simultaneously (for example, if multiple threads are blocked in
+        # .join() calls), and they're not serialized.  That's harmless -
+        # they'll just make redundant rebindings of ._is_stopped and
+        # ._tstate_lock.  Obscure:  we rebind ._tstate_lock last so that the
+        # "assert self._is_stopped" in ._wait_for_tstate_lock() always works
+        # (the assert is executed only if ._tstate_lock is None).
+        #
+        # Special case:  _main_thread releases ._tstate_lock via this
+        # module's _shutdown() function.
+        lock = self._tstate_lock
+        if lock is not None:
+            assert not lock.locked()
+        self._is_stopped = True
+        self._tstate_lock = None
 
     def _delete(self):
         "Remove current thread from the dict of currently running threads."
@@ -1021,20 +1056,26 @@
         if self is current_thread():
             raise RuntimeError("cannot join current thread")
 
-        self._block.acquire()
-        try:
-            if timeout is None:
-                while not self._stopped:
-                    self._block.wait()
-            else:
-                deadline = _time() + timeout
-                while not self._stopped:
-                    delay = deadline - _time()
-                    if delay <= 0:
-                        break
-                    self._block.wait(delay)
-        finally:
-            self._block.release()
+        if timeout is None:
+            self._wait_for_tstate_lock()
+        else:
+            # the behavior of a negative timeout isn't documented, but
+            # historically .join(timeout=x) for x<0 has acted as if timeout=0
+            self._wait_for_tstate_lock(timeout=max(timeout, 0))
+
+    def _wait_for_tstate_lock(self, block=True, timeout=-1):
+        # Issue #18808: wait for the thread state to be gone.
+        # At the end of the thread's life, after all knowledge of the thread
+        # is removed from C data structures, C code releases our _tstate_lock.
+        # This method passes its arguments to _tstate_lock.aquire().
+        # If the lock is acquired, the C code is done, and self._stop() is
+        # called.  That sets ._is_stopped to True, and ._tstate_lock to None.
+        lock = self._tstate_lock
+        if lock is None:  # already determined that the C code is done
+            assert self._is_stopped
+        elif lock.acquire(block, timeout):
+            lock.release()
+            self._stop()
 
     @property
     def name(self):
@@ -1073,7 +1114,10 @@
 
         """
         assert self._initialized, "Thread.__init__() not called"
-        return self._started.is_set() and not self._stopped
+        if self._is_stopped or not self._started.is_set():
+            return False
+        self._wait_for_tstate_lock(False)
+        return not self._is_stopped
 
     isAlive = is_alive
 
@@ -1098,7 +1142,7 @@
         if not self._initialized:
             raise RuntimeError("Thread.__init__() not called")
         if self._started.is_set():
-            raise RuntimeError("cannot set daemon status of active thread");
+            raise RuntimeError("cannot set daemon status of active thread")
         self._daemonic = daemonic
 
     def isDaemon(self):
@@ -1149,25 +1193,12 @@
 
     def __init__(self):
         Thread.__init__(self, name="MainThread", daemon=False)
+        self._set_tstate_lock()
         self._started.set()
         self._set_ident()
         with _active_limbo_lock:
             _active[self._ident] = self
 
-    def _exitfunc(self):
-        self._stop()
-        t = _pickSomeNonDaemonThread()
-        while t:
-            t.join()
-            t = _pickSomeNonDaemonThread()
-        self._delete()
-
-def _pickSomeNonDaemonThread():
-    for t in enumerate():
-        if not t.daemon and t.is_alive():
-            return t
-    return None
-
 
 # Dummy thread class to represent threads not started here.
 # These aren't garbage collected when they die, nor can they be waited for.
@@ -1182,11 +1213,6 @@
     def __init__(self):
         Thread.__init__(self, name=_newname("Dummy-%d"), daemon=True)
 
-        # Thread._block consumes an OS-level locking primitive, which
-        # can never be used by a _DummyThread.  Since a _DummyThread
-        # instance is immortal, that's bad, so release this resource.
-        del self._block
-
         self._started.set()
         self._set_ident()
         with _active_limbo_lock:
@@ -1248,7 +1274,40 @@
 # and make it available for the interpreter
 # (Py_Main) as threading._shutdown.
 
-_shutdown = _MainThread()._exitfunc
+_main_thread = _MainThread()
+
+def _shutdown():
+    # Obscure:  other threads may be waiting to join _main_thread.  That's
+    # dubious, but some code does it.  We can't wait for C code to release
+    # the main thread's tstate_lock - that won't happen until the interpreter
+    # is nearly dead.  So we release it here.  Note that just calling _stop()
+    # isn't enough:  other threads may already be waiting on _tstate_lock.
+    tlock = _main_thread._tstate_lock
+    # The main thread isn't finished yet, so its thread state lock can't have
+    # been released.
+    assert tlock is not None
+    assert tlock.locked()
+    tlock.release()
+    _main_thread._stop()
+    t = _pickSomeNonDaemonThread()
+    while t:
+        t.join()
+        t = _pickSomeNonDaemonThread()
+    _main_thread._delete()
+
+def _pickSomeNonDaemonThread():
+    for t in enumerate():
+        if not t.daemon and t.is_alive():
+            return t
+    return None
+
+def main_thread():
+    """Return the main thread object.
+
+    In normal conditions, the main thread is the thread from which the
+    Python interpreter was started.
+    """
+    return _main_thread
 
 # get thread-local implementation, either from the thread
 # module, or from the python fallback
@@ -1266,25 +1325,31 @@
 
     # Reset _active_limbo_lock, in case we forked while the lock was held
     # by another (non-forked) thread.  http://bugs.python.org/issue874900
-    global _active_limbo_lock
+    global _active_limbo_lock, _main_thread
     _active_limbo_lock = _allocate_lock()
 
     # fork() only copied the current thread; clear references to others.
     new_active = {}
     current = current_thread()
+    _main_thread = current
     with _active_limbo_lock:
-        for thread in _enumerate():
+        # Dangling thread instances must still have their locks reset,
+        # because someone may join() them.
+        threads = set(_enumerate())
+        threads.update(_dangling)
+        for thread in threads:
             # Any lock/condition variable may be currently locked or in an
             # invalid state, so we reinitialize them.
-            thread._reset_internal_locks()
             if thread is current:
                 # There is only one active thread. We reset the ident to
                 # its new value since it can have changed.
+                thread._reset_internal_locks(True)
                 ident = get_ident()
                 thread._ident = ident
                 new_active[ident] = thread
             else:
                 # All the others are already stopped.
+                thread._reset_internal_locks(False)
                 thread._stop()
 
         _limbo.clear()
diff --git a/Lib/timeit.py b/Lib/timeit.py
index 4f7d28f..9cec000 100755
--- a/Lib/timeit.py
+++ b/Lib/timeit.py
@@ -31,38 +31,29 @@
 If -n is not given, a suitable number of loops is calculated by trying
 successive powers of 10 until the total time is at least 0.2 seconds.
 
-The difference in default timer function is because on Windows,
-clock() has microsecond granularity but time()'s granularity is 1/60th
-of a second; on Unix, clock() has 1/100th of a second granularity and
-time() is much more precise.  On either platform, the default timer
-functions measure wall clock time, not the CPU time.  This means that
-other processes running on the same computer may interfere with the
-timing.  The best thing to do when accurate timing is necessary is to
-repeat the timing a few times and use the best time.  The -r option is
-good for this; the default of 3 repetitions is probably enough in most
-cases.  On Unix, you can use clock() to measure CPU time.
-
 Note: 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.
+pass statement.  It differs between versions.  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.
 
-The baseline overhead differs between Python versions!  Also, to
-fairly compare older Python versions to Python 2.3, you may want to
-use python -O for the older versions to avoid timing SET_LINENO
-instructions.
+Classes:
+
+    Timer
+
+Functions:
+
+    timeit(string, string) -> float
+    repeat(string, string) -> list
+    default_timer() -> float
+
 """
 
 import gc
 import sys
 import time
-try:
-    import itertools
-except ImportError:
-    # Must be an older Python version (see timeit() below)
-    itertools = None
+import itertools
 
-__all__ = ["Timer"]
+__all__ = ["Timer", "timeit", "repeat", "default_timer"]
 
 dummy_src_name = "<timeit-src>"
 default_number = 1000000
@@ -118,6 +109,12 @@
         self.timer = timer
         ns = {}
         if isinstance(stmt, str):
+            # Check that the code can be compiled outside a function
+            if isinstance(setup, str):
+                compile(setup, dummy_src_name, "exec")
+                compile(setup + '\n' + stmt, dummy_src_name, "exec")
+            else:
+                compile(stmt, dummy_src_name, "exec")
             stmt = reindent(stmt, 8)
             if isinstance(setup, str):
                 setup = reindent(setup, 4)
@@ -180,10 +177,7 @@
         to one million.  The main statement, the setup statement and
         the timer function to be used are passed to the constructor.
         """
-        if itertools:
-            it = itertools.repeat(None, number)
-        else:
-            it = [None] * number
+        it = itertools.repeat(None, number)
         gcold = gc.isenabled()
         gc.disable()
         try:
diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py
index b9e5d2e..a1ffca1 100644
--- a/Lib/tkinter/__init__.py
+++ b/Lib/tkinter/__init__.py
@@ -35,8 +35,6 @@
     # Attempt to configure Tcl/Tk without requiring PATH
     from tkinter import _fix
 
-import warnings
-
 import _tkinter # If this fails your Python may not be configured for Tk
 TclError = _tkinter.TclError
 from tkinter.constants import *
@@ -114,6 +112,29 @@
 try: _cnfmerge = _tkinter._cnfmerge
 except AttributeError: pass
 
+def _splitdict(tk, v, cut_minus=True, conv=None):
+    """Return a properly formatted dict built from Tcl list pairs.
+
+    If cut_minus is True, the supposed '-' prefix will be removed from
+    keys. If conv is specified, it is used to convert values.
+
+    Tcl list is expected to contain an even number of elements.
+    """
+    t = tk.splitlist(v)
+    if len(t) % 2:
+        raise RuntimeError('Tcl list representing a dict is expected '
+                           'to contain an even number of elements')
+    it = iter(t)
+    dict = {}
+    for key, value in zip(it, it):
+        key = str(key)
+        if cut_minus and key[0] == '-':
+            key = key[1:]
+        if conv:
+            value = conv(value)
+        dict[key] = value
+    return dict
+
 class Event:
     """Container for the properties of an event.
 
@@ -193,6 +214,7 @@
     that constrain the type of the value returned from get()."""
     _default = ""
     _tk = None
+    _tclCommands = None
     def __init__(self, master=None, value=None, name=None):
         """Construct a variable
 
@@ -211,7 +233,7 @@
         global _varnum
         if not master:
             master = _default_root
-        self._master = master
+        self._root = master._root()
         self._tk = master.tk
         if name:
             self._name = name
@@ -224,9 +246,15 @@
             self.initialize(self._default)
     def __del__(self):
         """Unset the variable in Tcl."""
-        if (self._tk is not None and
-            self._tk.getboolean(self._tk.call("info", "exists", self._name))):
+        if self._tk is None:
+            return
+        if self._tk.getboolean(self._tk.call("info", "exists", self._name)):
             self._tk.globalunsetvar(self._name)
+        if self._tclCommands is not None:
+            for name in self._tclCommands:
+                #print '- Tkinter: deleted command', name
+                self._tk.deletecommand(name)
+            self._tclCommands = None
     def __str__(self):
         """Return the name of the variable in Tcl."""
         return self._name
@@ -246,7 +274,20 @@
 
         Return the name of the callback.
         """
-        cbname = self._master._register(callback)
+        f = CallWrapper(callback, None, self).__call__
+        cbname = repr(id(f))
+        try:
+            callback = callback.__func__
+        except AttributeError:
+            pass
+        try:
+            cbname = cbname + callback.__name__
+        except AttributeError:
+            pass
+        self._tk.createcommand(cbname, f)
+        if self._tclCommands is None:
+            self._tclCommands = []
+        self._tclCommands.append(cbname)
         self._tk.call("trace", "variable", self._name, mode, cbname)
         return cbname
     trace = trace_variable
@@ -257,7 +298,11 @@
         CBNAME is the name of the callback returned from trace_variable or trace.
         """
         self._tk.call("trace", "vdelete", self._name, mode, cbname)
-        self._master.deletecommand(cbname)
+        self._tk.deletecommand(cbname)
+        try:
+            self._tclCommands.remove(cbname)
+        except ValueError:
+            pass
     def trace_vinfo(self):
         """Return all trace callback information."""
         return [self._tk.split(x) for x in self._tk.splitlist(
@@ -423,7 +468,10 @@
               + _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
+        # obsolete since Tk 4.0
+        import warnings
+        warnings.warn('tk_menuBar() does nothing and will be removed in 3.6',
+                      DeprecationWarning, stacklevel=2)
     def wait_variable(self, name='PY_VAR'):
         """Wait until the variable is modified.
 
@@ -537,6 +585,7 @@
                         self.deletecommand(name)
                     except TclError:
                         pass
+            callit.__name__ = func.__name__
             name = self._register(callit)
             return self.tk.call('after', ms, name)
     def after_idle(self, func, *args):
@@ -1365,15 +1414,10 @@
         else:
             options = self._options(cnf, kw)
         if not options:
-            res = self.tk.call('grid',
-                       command, self._w, index)
-            words = self.tk.splitlist(res)
-            dict = {}
-            for i in range(0, len(words), 2):
-                key = words[i][1:]
-                value = words[i+1]
-                dict[key] = self._gridconvvalue(value)
-            return dict
+            return _splitdict(
+                self.tk,
+                self.tk.call('grid', command, self._w, index),
+                conv=self._gridconvvalue)
         res = self.tk.call(
                   ('grid', command, self._w, index)
                   + options)
@@ -1873,9 +1917,12 @@
         if os.path.isfile(base_py):
             exec(open(base_py).read(), dir)
     def report_callback_exception(self, exc, val, tb):
-        """Internal function. It reports exception on sys.stderr."""
+        """Report callback exception on sys.stderr.
+
+        Applications may want to override this internal function, and
+        should when sys.stderr is None."""
         import traceback
-        sys.stderr.write("Exception in Tkinter callback\n")
+        print("Exception in Tkinter callback", file=sys.stderr)
         sys.last_type = exc
         sys.last_value = val
         sys.last_traceback = tb
@@ -1933,16 +1980,10 @@
     def pack_info(self):
         """Return information about the packing options
         for this widget."""
-        words = self.tk.splitlist(
-            self.tk.call('pack', 'info', self._w))
-        dict = {}
-        for i in range(0, len(words), 2):
-            key = words[i][1:]
-            value = words[i+1]
-            if str(value)[:1] == '.':
-                value = self._nametowidget(value)
-            dict[key] = value
-        return dict
+        d = _splitdict(self.tk, self.tk.call('pack', 'info', self._w))
+        if 'in' in d:
+            d['in'] = self.nametowidget(d['in'])
+        return d
     info = pack_info
     propagate = pack_propagate = Misc.pack_propagate
     slaves = pack_slaves = Misc.pack_slaves
@@ -1984,16 +2025,10 @@
     def place_info(self):
         """Return information about the placing options
         for this widget."""
-        words = self.tk.splitlist(
-            self.tk.call('place', 'info', self._w))
-        dict = {}
-        for i in range(0, len(words), 2):
-            key = words[i][1:]
-            value = words[i+1]
-            if str(value)[:1] == '.':
-                value = self._nametowidget(value)
-            dict[key] = value
-        return dict
+        d = _splitdict(self.tk, self.tk.call('place', 'info', self._w))
+        if 'in' in d:
+            d['in'] = self.nametowidget(d['in'])
+        return d
     info = place_info
     slaves = place_slaves = Misc.place_slaves
 
@@ -2033,16 +2068,10 @@
     def grid_info(self):
         """Return information about the options
         for positioning this widget in a grid."""
-        words = self.tk.splitlist(
-            self.tk.call('grid', 'info', self._w))
-        dict = {}
-        for i in range(0, len(words), 2):
-            key = words[i][1:]
-            value = words[i+1]
-            if str(value)[:1] == '.':
-                value = self._nametowidget(value)
-            dict[key] = value
-        return dict
+        d = _splitdict(self.tk, self.tk.call('grid', 'info', self._w))
+        if 'in' in d:
+            d['in'] = self.nametowidget(d['in'])
+        return d
     info = grid_info
     location = grid_location = Misc.grid_location
     propagate = grid_propagate = Misc.grid_propagate
@@ -2199,45 +2228,6 @@
         """
         return self.tk.call(self._w, 'invoke')
 
-
-# Indices:
-# XXX I don't like these -- take them away
-def AtEnd():
-    warnings.warn("tkinter.AtEnd will be removed in 3.4",
-                  DeprecationWarning, stacklevel=2)
-    return 'end'
-
-
-def AtInsert(*args):
-    warnings.warn("tkinter.AtInsert will be removed in 3.4",
-                  DeprecationWarning, stacklevel=2)
-    s = 'insert'
-    for a in args:
-        if a: s = s + (' ' + a)
-    return s
-
-
-def AtSelFirst():
-    warnings.warn("tkinter.AtSelFirst will be removed in 3.4",
-                  DeprecationWarning, stacklevel=2)
-    return 'sel.first'
-
-
-def AtSelLast():
-    warnings.warn("tkinter.AtSelLast will be removed in 3.4",
-                  DeprecationWarning, stacklevel=2)
-    return 'sel.last'
-
-
-def At(x, y=None):
-    warnings.warn("tkinter.At will be removed in 3.4",
-                  DeprecationWarning, stacklevel=2)
-    if y is None:
-        return '@%r' % (x,)
-    else:
-        return '@%r,%r' % (x, y)
-
-
 class Canvas(Widget, XView, YView):
     """Canvas widget to display graphical elements like lines or text."""
     def __init__(self, master=None, cnf={}, **kw):
@@ -2627,22 +2617,19 @@
     def activate(self, index):
         """Activate item identified by INDEX."""
         self.tk.call(self._w, 'activate', index)
-    def bbox(self, *args):
+    def bbox(self, index):
         """Return a tuple of X1,Y1,X2,Y2 coordinates for a rectangle
-        which encloses the item identified by index in ARGS."""
-        return self._getints(
-            self.tk.call((self._w, 'bbox') + args)) or None
+        which encloses the item identified by the given index."""
+        return self._getints(self.tk.call(self._w, 'bbox', index)) or None
     def curselection(self):
-        """Return list of indices of currently selected item."""
-        # XXX Ought to apply self._getints()...
-        return self.tk.splitlist(self.tk.call(
-            self._w, 'curselection'))
+        """Return the indices of currently selected item."""
+        return self._getints(self.tk.call(self._w, 'curselection')) or ()
     def delete(self, first, last=None):
-        """Delete items from FIRST to LAST (not included)."""
+        """Delete items from FIRST to LAST (included)."""
         self.tk.call(self._w, 'delete', first, last)
     def get(self, first, last=None):
-        """Get list of items from FIRST to LAST (not included)."""
-        if last:
+        """Get list of items from FIRST to LAST (included)."""
+        if last is not None:
             return self.tk.splitlist(self.tk.call(
                 self._w, 'get', first, last))
         else:
@@ -2675,7 +2662,7 @@
         self.tk.call(self._w, 'selection', 'anchor', index)
     select_anchor = selection_anchor
     def selection_clear(self, first, last=None):
-        """Clear the selection from FIRST to LAST (not included)."""
+        """Clear the selection from FIRST to LAST (included)."""
         self.tk.call(self._w,
                  'selection', 'clear', first, last)
     select_clear = selection_clear
@@ -2685,7 +2672,7 @@
             self._w, 'selection', 'includes', index))
     select_includes = selection_includes
     def selection_set(self, first, last=None):
-        """Set the selection from FIRST to LAST (not included) without
+        """Set the selection from FIRST to LAST (included) without
         changing the currently selected elements."""
         self.tk.call(self._w, 'selection', 'set', first, last)
     select_set = selection_set
@@ -2718,7 +2705,11 @@
         selectcolor, takefocus, tearoff, tearoffcommand, title, type."""
         Widget.__init__(self, master, 'menu', cnf, kw)
     def tk_bindForTraversal(self):
-        pass # obsolete since Tk 4.0
+        # obsolete since Tk 4.0
+        import warnings
+        warnings.warn('tk_bindForTraversal() does nothing and '
+                      'will be removed in 3.6',
+                      DeprecationWarning, stacklevel=2)
     def tk_mbPost(self):
         self.tk.call('tk_mbPost', self._w)
     def tk_mbUnpost(self):
@@ -2968,11 +2959,11 @@
 
         """
         Widget.__init__(self, master, 'text', cnf, kw)
-    def bbox(self, *args):
+    def bbox(self, index):
         """Return a tuple of (x,y,width,height) which gives the bounding
-        box of the visible part of the character at the index in ARGS."""
+        box of the visible part of the character at the given index."""
         return self._getints(
-            self.tk.call((self._w, 'bbox') + args)) or None
+                self.tk.call(self._w, 'bbox', index)) or None
     def tk_textSelectTo(self, index):
         self.tk.call('tk_textSelectTo', self._w, index)
     def tk_textBackspace(self):
@@ -3364,7 +3355,7 @@
             master = _default_root
             if not master:
                 raise RuntimeError('Too early to create image')
-        self.tk = master.tk
+        self.tk = getattr(master, 'tk', master)
         if not name:
             Image._last_id += 1
             name = "pyimage%r" % (Image._last_id,) # tk itself would use image<x>
@@ -3435,20 +3426,20 @@
     # XXX copy -from, -to, ...?
     def copy(self):
         """Return a new PhotoImage with the same image as this widget."""
-        destImage = PhotoImage()
+        destImage = PhotoImage(master=self.tk)
         self.tk.call(destImage, 'copy', self.name)
         return destImage
     def zoom(self,x,y=''):
         """Return a new PhotoImage with the same image as this widget
         but zoom it with X and Y."""
-        destImage = PhotoImage()
+        destImage = PhotoImage(master=self.tk)
         if y=='': y=x
         self.tk.call(destImage, 'copy', self.name, '-zoom',x,y)
         return destImage
     def subsample(self,x,y=''):
         """Return a new PhotoImage based on the same image as this widget
         but use only every Xth or Yth pixel."""
-        destImage = PhotoImage()
+        destImage = PhotoImage(master=self.tk)
         if y=='': y=x
         self.tk.call(destImage, 'copy', self.name, '-subsample',x,y)
         return destImage
diff --git a/Lib/tkinter/_fix.py b/Lib/tkinter/_fix.py
index 5f32d25..fa88734 100644
--- a/Lib/tkinter/_fix.py
+++ b/Lib/tkinter/_fix.py
@@ -48,8 +48,8 @@
 
 prefix = os.path.join(sys.base_prefix,"tcl")
 if not os.path.exists(prefix):
-    # devdir/../tcltk/lib
-    prefix = os.path.join(sys.base_prefix, os.path.pardir, "tcltk", "lib")
+    # devdir/externals/tcltk/lib
+    prefix = os.path.join(sys.base_prefix, "externals", "tcltk", "lib")
     prefix = os.path.abspath(prefix)
 # if this does not exist, no further search is needed
 if os.path.exists(prefix):
diff --git a/Lib/tkinter/colorchooser.py b/Lib/tkinter/colorchooser.py
index 6027067..9dc9671 100644
--- a/Lib/tkinter/colorchooser.py
+++ b/Lib/tkinter/colorchooser.py
@@ -1,4 +1,4 @@
-# tk common colour chooser dialogue
+# tk common color chooser dialogue
 #
 # this module provides an interface to the native color dialogue
 # available in Tk 4.2 and newer.
@@ -11,7 +11,7 @@
 #
 # options (all have default values):
 #
-# - initialcolor: colour to mark as selected when dialog is displayed
+# - initialcolor: color to mark as selected when dialog is displayed
 #   (given as an RGB triplet or a Tk color string)
 #
 # - parent: which window to place the dialog on top of
diff --git a/Lib/tkinter/filedialog.py b/Lib/tkinter/filedialog.py
index 3ffb252..a71afb2 100644
--- a/Lib/tkinter/filedialog.py
+++ b/Lib/tkinter/filedialog.py
@@ -166,7 +166,7 @@
         dir, pat = self.get_filter()
         try:
             names = os.listdir(dir)
-        except os.error:
+        except OSError:
             self.master.bell()
             return
         self.directory = dir
@@ -209,7 +209,7 @@
         if not os.path.isabs(dir):
             try:
                 pwd = os.getcwd()
-            except os.error:
+            except OSError:
                 pwd = None
             if pwd:
                 dir = os.path.join(pwd, dir)
diff --git a/Lib/tkinter/font.py b/Lib/tkinter/font.py
index 4929241..b966732 100644
--- a/Lib/tkinter/font.py
+++ b/Lib/tkinter/font.py
@@ -69,9 +69,10 @@
                  **options):
         if not root:
             root = tkinter._default_root
+        tk = getattr(root, 'tk', root)
         if font:
             # get actual settings corresponding to the given font
-            font = root.tk.splitlist(root.tk.call("font", "actual", font))
+            font = tk.splitlist(tk.call("font", "actual", font))
         else:
             font = self._set(options)
         if not name:
@@ -81,20 +82,19 @@
         if exists:
             self.delete_font = False
             # confirm font exists
-            if self.name not in root.tk.call("font", "names"):
+            if self.name not in tk.splitlist(tk.call("font", "names")):
                 raise tkinter._tkinter.TclError(
                     "named font %s does not already exist" % (self.name,))
             # if font config info supplied, apply it
             if font:
-                root.tk.call("font", "configure", self.name, *font)
+                tk.call("font", "configure", self.name, *font)
         else:
             # create new font (raises TclError if the font exists)
-            root.tk.call("font", "create", self.name, *font)
+            tk.call("font", "create", self.name, *font)
             self.delete_font = True
-        # backlinks!
-        self._root  = root
-        self._split = root.tk.splitlist
-        self._call  = root.tk.call
+        self._tk = tk
+        self._split = tk.splitlist
+        self._call  = tk.call
 
     def __str__(self):
         return self.name
@@ -119,7 +119,7 @@
 
     def copy(self):
         "Return a distinct copy of the current font"
-        return Font(self._root, **self.actual())
+        return Font(self._tk, **self.actual())
 
     def actual(self, option=None, displayof=None):
         "Return actual font attributes"
diff --git a/Lib/tkinter/test/runtktests.py b/Lib/tkinter/test/runtktests.py
index e21eca4..ccb3755 100644
--- a/Lib/tkinter/test/runtktests.py
+++ b/Lib/tkinter/test/runtktests.py
@@ -68,5 +68,4 @@
                 yield test
 
 if __name__ == "__main__":
-    test.support.use_resources = ['gui']
     test.support.run_unittest(*get_tests())
diff --git a/Lib/tkinter/test/support.py b/Lib/tkinter/test/support.py
index fcd9ffc..067fc71 100644
--- a/Lib/tkinter/test/support.py
+++ b/Lib/tkinter/test/support.py
@@ -1,74 +1,46 @@
 import sys
 import tkinter
 import unittest
+from test.support import requires
 
-_tk_unavailable = None
+class AbstractTkTest:
 
-def check_tk_availability():
-    """Check that Tk is installed and available."""
-    global _tk_unavailable
+    @classmethod
+    def setUpClass(cls):
+        cls._old_support_default_root = tkinter._support_default_root
+        destroy_default_root()
+        tkinter.NoDefaultRoot()
+        cls.root = tkinter.Tk()
+        cls.wantobjects = cls.root.wantobjects()
+        # De-maximize main window.
+        # Some window managers can maximize new windows.
+        cls.root.wm_state('normal')
+        try:
+            cls.root.wm_attributes('-zoomed', False)
+        except tkinter.TclError:
+            pass
 
-    if _tk_unavailable is None:
-        _tk_unavailable = False
-        if sys.platform == 'darwin':
-            # The Aqua Tk implementations on OS X can abort the process if
-            # being called in an environment where a window server connection
-            # cannot be made, for instance when invoked by a buildbot or ssh
-            # process not running under the same user id as the current console
-            # user.  To avoid that, raise an exception if the window manager
-            # connection is not available.
-            from ctypes import cdll, c_int, pointer, Structure
-            from ctypes.util import find_library
+    @classmethod
+    def tearDownClass(cls):
+        cls.root.update_idletasks()
+        cls.root.destroy()
+        cls.root = None
+        tkinter._default_root = None
+        tkinter._support_default_root = cls._old_support_default_root
 
-            app_services = cdll.LoadLibrary(find_library("ApplicationServices"))
+    def setUp(self):
+        self.root.deiconify()
 
-            if app_services.CGMainDisplayID() == 0:
-                _tk_unavailable = "cannot run without OS X window manager"
-            else:
-                class ProcessSerialNumber(Structure):
-                    _fields_ = [("highLongOfPSN", c_int),
-                                ("lowLongOfPSN", c_int)]
-                psn = ProcessSerialNumber()
-                psn_p = pointer(psn)
-                if (  (app_services.GetCurrentProcess(psn_p) < 0) or
-                      (app_services.SetFrontProcess(psn_p) < 0) ):
-                    _tk_unavailable = "cannot run without OS X gui process"
-        else:   # not OS X
-            import tkinter
-            try:
-                tkinter.Button()
-            except tkinter.TclError as msg:
-                # assuming tk is not available
-                _tk_unavailable = "tk not available: %s" % msg
+    def tearDown(self):
+        for w in self.root.winfo_children():
+            w.destroy()
+        self.root.withdraw()
 
-    if _tk_unavailable:
-        raise unittest.SkipTest(_tk_unavailable)
-    return
-
-def get_tk_root():
-    check_tk_availability()     # raise exception if tk unavailable
-    try:
-        root = tkinter._default_root
-    except AttributeError:
-        # it is possible to disable default root in Tkinter, although
-        # I haven't seen people doing it (but apparently someone did it
-        # here).
-        root = None
-
-    if root is None:
-        # create a new master only if there isn't one already
-        root = tkinter.Tk()
-
-    return root
-
-def root_deiconify():
-    root = get_tk_root()
-    root.deiconify()
-
-def root_withdraw():
-    root = get_tk_root()
-    root.withdraw()
-
+def destroy_default_root():
+    if getattr(tkinter, '_default_root', None):
+        tkinter._default_root.update_idletasks()
+        tkinter._default_root.destroy()
+        tkinter._default_root = None
 
 def simulate_mouse_click(widget, x, y):
     """Generate proper events to click at the x, y position (tries to act
diff --git a/Lib/tkinter/test/test_tkinter/test_font.py b/Lib/tkinter/test/test_tkinter/test_font.py
index dfd630b..09c963e 100644
--- a/Lib/tkinter/test/test_tkinter/test_font.py
+++ b/Lib/tkinter/test/test_tkinter/test_font.py
@@ -2,26 +2,20 @@
 import tkinter
 from tkinter import font
 from test.support import requires, run_unittest
-import tkinter.test.support as support
+from tkinter.test.support import AbstractTkTest
 
 requires('gui')
 
-class FontTest(unittest.TestCase):
-
-    def setUp(self):
-        support.root_deiconify()
-
-    def tearDown(self):
-        support.root_withdraw()
+class FontTest(AbstractTkTest, unittest.TestCase):
 
     def test_font_eq(self):
         fontname = "TkDefaultFont"
         try:
-            f = font.Font(name=fontname, exists=True)
+            f = font.Font(root=self.root, name=fontname, exists=True)
         except tkinter._tkinter.TclError:
-            f = font.Font(name=fontname, exists=False)
-        font1 = font.nametofont(fontname)
-        font2 = font.nametofont(fontname)
+            f = font.Font(root=self.root, name=fontname, exists=False)
+        font1 = font.Font(root=self.root, name=fontname, exists=True)
+        font2 = font.Font(root=self.root, name=fontname, exists=True)
         self.assertIsNot(font1, font2)
         self.assertEqual(font1, font2)
         self.assertNotEqual(font1, font1.copy())
diff --git a/Lib/tkinter/test/test_tkinter/test_geometry_managers.py b/Lib/tkinter/test/test_tkinter/test_geometry_managers.py
new file mode 100644
index 0000000..e42b1be
--- /dev/null
+++ b/Lib/tkinter/test/test_tkinter/test_geometry_managers.py
@@ -0,0 +1,900 @@
+import unittest
+import re
+import tkinter
+from tkinter import TclError
+from test.support import requires
+
+from tkinter.test.support import pixels_conv, tcl_version, requires_tcl
+from tkinter.test.widget_tests import AbstractWidgetTest
+
+requires('gui')
+
+
+class PackTest(AbstractWidgetTest, unittest.TestCase):
+
+    def create2(self):
+        pack = tkinter.Toplevel(self.root, name='pack')
+        pack.wm_geometry('300x200+0+0')
+        pack.wm_minsize(1, 1)
+        a = tkinter.Frame(pack, name='a', width=20, height=40, bg='red')
+        b = tkinter.Frame(pack, name='b', width=50, height=30, bg='blue')
+        c = tkinter.Frame(pack, name='c', width=80, height=80, bg='green')
+        d = tkinter.Frame(pack, name='d', width=40, height=30, bg='yellow')
+        return pack, a, b, c, d
+
+    def test_pack_configure_after(self):
+        pack, a, b, c, d = self.create2()
+        with self.assertRaisesRegex(TclError, 'window "%s" isn\'t packed' % b):
+            a.pack_configure(after=b)
+        with self.assertRaisesRegex(TclError, 'bad window path name ".foo"'):
+            a.pack_configure(after='.foo')
+        a.pack_configure(side='top')
+        b.pack_configure(side='top')
+        c.pack_configure(side='top')
+        d.pack_configure(side='top')
+        self.assertEqual(pack.pack_slaves(), [a, b, c, d])
+        a.pack_configure(after=b)
+        self.assertEqual(pack.pack_slaves(), [b, a, c, d])
+        a.pack_configure(after=a)
+        self.assertEqual(pack.pack_slaves(), [b, a, c, d])
+
+    def test_pack_configure_anchor(self):
+        pack, a, b, c, d = self.create2()
+        def check(anchor, geom):
+            a.pack_configure(side='top', ipadx=5, padx=10, ipady=15, pady=20,
+                             expand=True, anchor=anchor)
+            self.root.update()
+            self.assertEqual(a.winfo_geometry(), geom)
+        check('n', '30x70+135+20')
+        check('ne', '30x70+260+20')
+        check('e', '30x70+260+65')
+        check('se', '30x70+260+110')
+        check('s', '30x70+135+110')
+        check('sw', '30x70+10+110')
+        check('w', '30x70+10+65')
+        check('nw', '30x70+10+20')
+        check('center', '30x70+135+65')
+
+    def test_pack_configure_before(self):
+        pack, a, b, c, d = self.create2()
+        with self.assertRaisesRegex(TclError, 'window "%s" isn\'t packed' % b):
+            a.pack_configure(before=b)
+        with self.assertRaisesRegex(TclError, 'bad window path name ".foo"'):
+            a.pack_configure(before='.foo')
+        a.pack_configure(side='top')
+        b.pack_configure(side='top')
+        c.pack_configure(side='top')
+        d.pack_configure(side='top')
+        self.assertEqual(pack.pack_slaves(), [a, b, c, d])
+        a.pack_configure(before=d)
+        self.assertEqual(pack.pack_slaves(), [b, c, a, d])
+        a.pack_configure(before=a)
+        self.assertEqual(pack.pack_slaves(), [b, c, a, d])
+
+    def test_pack_configure_expand(self):
+        pack, a, b, c, d = self.create2()
+        def check(*geoms):
+            self.root.update()
+            self.assertEqual(a.winfo_geometry(), geoms[0])
+            self.assertEqual(b.winfo_geometry(), geoms[1])
+            self.assertEqual(c.winfo_geometry(), geoms[2])
+            self.assertEqual(d.winfo_geometry(), geoms[3])
+        a.pack_configure(side='left')
+        b.pack_configure(side='top')
+        c.pack_configure(side='right')
+        d.pack_configure(side='bottom')
+        check('20x40+0+80', '50x30+135+0', '80x80+220+75', '40x30+100+170')
+        a.pack_configure(side='left', expand='yes')
+        b.pack_configure(side='top', expand='on')
+        c.pack_configure(side='right', expand=True)
+        d.pack_configure(side='bottom', expand=1)
+        check('20x40+40+80', '50x30+175+35', '80x80+180+110', '40x30+100+135')
+        a.pack_configure(side='left', expand='yes', fill='both')
+        b.pack_configure(side='top', expand='on', fill='both')
+        c.pack_configure(side='right', expand=True, fill='both')
+        d.pack_configure(side='bottom', expand=1, fill='both')
+        check('100x200+0+0', '200x100+100+0', '160x100+140+100', '40x100+100+100')
+
+    def test_pack_configure_in(self):
+        pack, a, b, c, d = self.create2()
+        a.pack_configure(side='top')
+        b.pack_configure(side='top')
+        c.pack_configure(side='top')
+        d.pack_configure(side='top')
+        a.pack_configure(in_=pack)
+        self.assertEqual(pack.pack_slaves(), [b, c, d, a])
+        a.pack_configure(in_=c)
+        self.assertEqual(pack.pack_slaves(), [b, c, d])
+        self.assertEqual(c.pack_slaves(), [a])
+        with self.assertRaisesRegex(TclError,
+                                    'can\'t pack %s inside itself' % (a,)):
+            a.pack_configure(in_=a)
+        with self.assertRaisesRegex(TclError, 'bad window path name ".foo"'):
+            a.pack_configure(in_='.foo')
+
+    def test_pack_configure_padx_ipadx_fill(self):
+        pack, a, b, c, d = self.create2()
+        def check(geom1, geom2, **kwargs):
+            a.pack_forget()
+            b.pack_forget()
+            a.pack_configure(**kwargs)
+            b.pack_configure(expand=True, fill='both')
+            self.root.update()
+            self.assertEqual(a.winfo_geometry(), geom1)
+            self.assertEqual(b.winfo_geometry(), geom2)
+        check('20x40+260+80', '240x200+0+0', side='right', padx=20)
+        check('20x40+250+80', '240x200+0+0', side='right', padx=(10, 30))
+        check('60x40+240+80', '240x200+0+0', side='right', ipadx=20)
+        check('30x40+260+80', '250x200+0+0', side='right', ipadx=5, padx=10)
+        check('20x40+260+80', '240x200+0+0', side='right', padx=20, fill='x')
+        check('20x40+249+80', '240x200+0+0',
+              side='right', padx=(9, 31), fill='x')
+        check('60x40+240+80', '240x200+0+0', side='right', ipadx=20, fill='x')
+        check('30x40+260+80', '250x200+0+0',
+              side='right', ipadx=5, padx=10, fill='x')
+        check('30x40+255+80', '250x200+0+0',
+              side='right', ipadx=5, padx=(5, 15), fill='x')
+        check('20x40+140+0', '300x160+0+40', side='top', padx=20)
+        check('20x40+120+0', '300x160+0+40', side='top', padx=(0, 40))
+        check('60x40+120+0', '300x160+0+40', side='top', ipadx=20)
+        check('30x40+135+0', '300x160+0+40', side='top', ipadx=5, padx=10)
+        check('30x40+130+0', '300x160+0+40', side='top', ipadx=5, padx=(5, 15))
+        check('260x40+20+0', '300x160+0+40', side='top', padx=20, fill='x')
+        check('260x40+25+0', '300x160+0+40',
+              side='top', padx=(25, 15), fill='x')
+        check('300x40+0+0', '300x160+0+40', side='top', ipadx=20, fill='x')
+        check('280x40+10+0', '300x160+0+40',
+              side='top', ipadx=5, padx=10, fill='x')
+        check('280x40+5+0', '300x160+0+40',
+              side='top', ipadx=5, padx=(5, 15), fill='x')
+        a.pack_configure(padx='1c')
+        self.assertEqual(a.pack_info()['padx'],
+                         self._str(pack.winfo_pixels('1c')))
+        a.pack_configure(ipadx='1c')
+        self.assertEqual(a.pack_info()['ipadx'],
+                         self._str(pack.winfo_pixels('1c')))
+
+    def test_pack_configure_pady_ipady_fill(self):
+        pack, a, b, c, d = self.create2()
+        def check(geom1, geom2, **kwargs):
+            a.pack_forget()
+            b.pack_forget()
+            a.pack_configure(**kwargs)
+            b.pack_configure(expand=True, fill='both')
+            self.root.update()
+            self.assertEqual(a.winfo_geometry(), geom1)
+            self.assertEqual(b.winfo_geometry(), geom2)
+        check('20x40+280+80', '280x200+0+0', side='right', pady=20)
+        check('20x40+280+70', '280x200+0+0', side='right', pady=(10, 30))
+        check('20x80+280+60', '280x200+0+0', side='right', ipady=20)
+        check('20x50+280+75', '280x200+0+0', side='right', ipady=5, pady=10)
+        check('20x40+280+80', '280x200+0+0', side='right', pady=20, fill='x')
+        check('20x40+280+69', '280x200+0+0',
+              side='right', pady=(9, 31), fill='x')
+        check('20x80+280+60', '280x200+0+0', side='right', ipady=20, fill='x')
+        check('20x50+280+75', '280x200+0+0',
+              side='right', ipady=5, pady=10, fill='x')
+        check('20x50+280+70', '280x200+0+0',
+              side='right', ipady=5, pady=(5, 15), fill='x')
+        check('20x40+140+20', '300x120+0+80', side='top', pady=20)
+        check('20x40+140+0', '300x120+0+80', side='top', pady=(0, 40))
+        check('20x80+140+0', '300x120+0+80', side='top', ipady=20)
+        check('20x50+140+10', '300x130+0+70', side='top', ipady=5, pady=10)
+        check('20x50+140+5', '300x130+0+70', side='top', ipady=5, pady=(5, 15))
+        check('300x40+0+20', '300x120+0+80', side='top', pady=20, fill='x')
+        check('300x40+0+25', '300x120+0+80',
+              side='top', pady=(25, 15), fill='x')
+        check('300x80+0+0', '300x120+0+80', side='top', ipady=20, fill='x')
+        check('300x50+0+10', '300x130+0+70',
+              side='top', ipady=5, pady=10, fill='x')
+        check('300x50+0+5', '300x130+0+70',
+              side='top', ipady=5, pady=(5, 15), fill='x')
+        a.pack_configure(pady='1c')
+        self.assertEqual(a.pack_info()['pady'],
+                         self._str(pack.winfo_pixels('1c')))
+        a.pack_configure(ipady='1c')
+        self.assertEqual(a.pack_info()['ipady'],
+                         self._str(pack.winfo_pixels('1c')))
+
+    def test_pack_configure_side(self):
+        pack, a, b, c, d = self.create2()
+        def check(side, geom1, geom2):
+            a.pack_configure(side=side)
+            self.assertEqual(a.pack_info()['side'], side)
+            b.pack_configure(expand=True, fill='both')
+            self.root.update()
+            self.assertEqual(a.winfo_geometry(), geom1)
+            self.assertEqual(b.winfo_geometry(), geom2)
+        check('top', '20x40+140+0', '300x160+0+40')
+        check('bottom', '20x40+140+160', '300x160+0+0')
+        check('left', '20x40+0+80', '280x200+20+0')
+        check('right', '20x40+280+80', '280x200+0+0')
+
+    def test_pack_forget(self):
+        pack, a, b, c, d = self.create2()
+        a.pack_configure()
+        b.pack_configure()
+        c.pack_configure()
+        self.assertEqual(pack.pack_slaves(), [a, b, c])
+        b.pack_forget()
+        self.assertEqual(pack.pack_slaves(), [a, c])
+        b.pack_forget()
+        self.assertEqual(pack.pack_slaves(), [a, c])
+        d.pack_forget()
+
+    def test_pack_info(self):
+        pack, a, b, c, d = self.create2()
+        with self.assertRaisesRegex(TclError, 'window "%s" isn\'t packed' % a):
+            a.pack_info()
+        a.pack_configure()
+        b.pack_configure(side='right', in_=a, anchor='s', expand=True, fill='x',
+                         ipadx=5, padx=10, ipady=2, pady=(5, 15))
+        info = a.pack_info()
+        self.assertIsInstance(info, dict)
+        self.assertEqual(info['anchor'], 'center')
+        self.assertEqual(info['expand'], self._str(0))
+        self.assertEqual(info['fill'], 'none')
+        self.assertEqual(info['in'], pack)
+        self.assertEqual(info['ipadx'], self._str(0))
+        self.assertEqual(info['ipady'], self._str(0))
+        self.assertEqual(info['padx'], self._str(0))
+        self.assertEqual(info['pady'], self._str(0))
+        self.assertEqual(info['side'], 'top')
+        info = b.pack_info()
+        self.assertIsInstance(info, dict)
+        self.assertEqual(info['anchor'], 's')
+        self.assertEqual(info['expand'], self._str(1))
+        self.assertEqual(info['fill'], 'x')
+        self.assertEqual(info['in'], a)
+        self.assertEqual(info['ipadx'], self._str(5))
+        self.assertEqual(info['ipady'], self._str(2))
+        self.assertEqual(info['padx'], self._str(10))
+        self.assertEqual(info['pady'], self._str((5, 15)))
+        self.assertEqual(info['side'], 'right')
+
+    def test_pack_propagate(self):
+        pack, a, b, c, d = self.create2()
+        pack.configure(width=300, height=200)
+        a.pack_configure()
+        pack.pack_propagate(False)
+        self.root.update()
+        self.assertEqual(pack.winfo_reqwidth(), 300)
+        self.assertEqual(pack.winfo_reqheight(), 200)
+        pack.pack_propagate(True)
+        self.root.update()
+        self.assertEqual(pack.winfo_reqwidth(), 20)
+        self.assertEqual(pack.winfo_reqheight(), 40)
+
+    def test_pack_slaves(self):
+        pack, a, b, c, d = self.create2()
+        self.assertEqual(pack.pack_slaves(), [])
+        a.pack_configure()
+        self.assertEqual(pack.pack_slaves(), [a])
+        b.pack_configure()
+        self.assertEqual(pack.pack_slaves(), [a, b])
+
+
+class PlaceTest(AbstractWidgetTest, unittest.TestCase):
+
+    def create2(self):
+        t = tkinter.Toplevel(self.root, width=300, height=200, bd=0)
+        t.wm_geometry('300x200+0+0')
+        f = tkinter.Frame(t, width=154, height=84, bd=2, relief='raised')
+        f.place_configure(x=48, y=38)
+        f2 = tkinter.Frame(t, width=30, height=60, bd=2, relief='raised')
+        self.root.update()
+        return t, f, f2
+
+    def test_place_configure_in(self):
+        t, f, f2 = self.create2()
+        self.assertEqual(f2.winfo_manager(), '')
+        with self.assertRaisesRegex(TclError, "can't place %s relative to "
+                                    "itself" % re.escape(str(f2))):
+            f2.place_configure(in_=f2)
+        if tcl_version >= (8, 5):
+            self.assertEqual(f2.winfo_manager(), '')
+        with self.assertRaisesRegex(TclError, 'bad window path name'):
+            f2.place_configure(in_='spam')
+        f2.place_configure(in_=f)
+        self.assertEqual(f2.winfo_manager(), 'place')
+
+    def test_place_configure_x(self):
+        t, f, f2 = self.create2()
+        f2.place_configure(in_=f)
+        self.assertEqual(f2.place_info()['x'], '0')
+        self.root.update()
+        self.assertEqual(f2.winfo_x(), 50)
+        f2.place_configure(x=100)
+        self.assertEqual(f2.place_info()['x'], '100')
+        self.root.update()
+        self.assertEqual(f2.winfo_x(), 150)
+        f2.place_configure(x=-10, relx=1)
+        self.assertEqual(f2.place_info()['x'], '-10')
+        self.root.update()
+        self.assertEqual(f2.winfo_x(), 190)
+        with self.assertRaisesRegex(TclError, 'bad screen distance "spam"'):
+            f2.place_configure(in_=f, x='spam')
+
+    def test_place_configure_y(self):
+        t, f, f2 = self.create2()
+        f2.place_configure(in_=f)
+        self.assertEqual(f2.place_info()['y'], '0')
+        self.root.update()
+        self.assertEqual(f2.winfo_y(), 40)
+        f2.place_configure(y=50)
+        self.assertEqual(f2.place_info()['y'], '50')
+        self.root.update()
+        self.assertEqual(f2.winfo_y(), 90)
+        f2.place_configure(y=-10, rely=1)
+        self.assertEqual(f2.place_info()['y'], '-10')
+        self.root.update()
+        self.assertEqual(f2.winfo_y(), 110)
+        with self.assertRaisesRegex(TclError, 'bad screen distance "spam"'):
+            f2.place_configure(in_=f, y='spam')
+
+    def test_place_configure_relx(self):
+        t, f, f2 = self.create2()
+        f2.place_configure(in_=f)
+        self.assertEqual(f2.place_info()['relx'], '0')
+        self.root.update()
+        self.assertEqual(f2.winfo_x(), 50)
+        f2.place_configure(relx=0.5)
+        self.assertEqual(f2.place_info()['relx'], '0.5')
+        self.root.update()
+        self.assertEqual(f2.winfo_x(), 125)
+        f2.place_configure(relx=1)
+        self.assertEqual(f2.place_info()['relx'], '1')
+        self.root.update()
+        self.assertEqual(f2.winfo_x(), 200)
+        with self.assertRaisesRegex(TclError, 'expected floating-point number '
+                                    'but got "spam"'):
+            f2.place_configure(in_=f, relx='spam')
+
+    def test_place_configure_rely(self):
+        t, f, f2 = self.create2()
+        f2.place_configure(in_=f)
+        self.assertEqual(f2.place_info()['rely'], '0')
+        self.root.update()
+        self.assertEqual(f2.winfo_y(), 40)
+        f2.place_configure(rely=0.5)
+        self.assertEqual(f2.place_info()['rely'], '0.5')
+        self.root.update()
+        self.assertEqual(f2.winfo_y(), 80)
+        f2.place_configure(rely=1)
+        self.assertEqual(f2.place_info()['rely'], '1')
+        self.root.update()
+        self.assertEqual(f2.winfo_y(), 120)
+        with self.assertRaisesRegex(TclError, 'expected floating-point number '
+                                    'but got "spam"'):
+            f2.place_configure(in_=f, rely='spam')
+
+    def test_place_configure_anchor(self):
+        f = tkinter.Frame(self.root)
+        with self.assertRaisesRegex(TclError, 'bad anchor "j"'):
+            f.place_configure(anchor='j')
+        with self.assertRaisesRegex(TclError, 'ambiguous anchor ""'):
+            f.place_configure(anchor='')
+        for value in 'n', 'ne', 'e', 'se', 's', 'sw', 'w', 'nw', 'center':
+            f.place_configure(anchor=value)
+            self.assertEqual(f.place_info()['anchor'], value)
+
+    def test_place_configure_width(self):
+        t, f, f2 = self.create2()
+        f2.place_configure(in_=f, width=120)
+        self.root.update()
+        self.assertEqual(f2.winfo_width(), 120)
+        f2.place_configure(width='')
+        self.root.update()
+        self.assertEqual(f2.winfo_width(), 30)
+        with self.assertRaisesRegex(TclError, 'bad screen distance "abcd"'):
+            f2.place_configure(width='abcd')
+
+    def test_place_configure_height(self):
+        t, f, f2 = self.create2()
+        f2.place_configure(in_=f, height=120)
+        self.root.update()
+        self.assertEqual(f2.winfo_height(), 120)
+        f2.place_configure(height='')
+        self.root.update()
+        self.assertEqual(f2.winfo_height(), 60)
+        with self.assertRaisesRegex(TclError, 'bad screen distance "abcd"'):
+            f2.place_configure(height='abcd')
+
+    def test_place_configure_relwidth(self):
+        t, f, f2 = self.create2()
+        f2.place_configure(in_=f, relwidth=0.5)
+        self.root.update()
+        self.assertEqual(f2.winfo_width(), 75)
+        f2.place_configure(relwidth='')
+        self.root.update()
+        self.assertEqual(f2.winfo_width(), 30)
+        with self.assertRaisesRegex(TclError, 'expected floating-point number '
+                                    'but got "abcd"'):
+            f2.place_configure(relwidth='abcd')
+
+    def test_place_configure_relheight(self):
+        t, f, f2 = self.create2()
+        f2.place_configure(in_=f, relheight=0.5)
+        self.root.update()
+        self.assertEqual(f2.winfo_height(), 40)
+        f2.place_configure(relheight='')
+        self.root.update()
+        self.assertEqual(f2.winfo_height(), 60)
+        with self.assertRaisesRegex(TclError, 'expected floating-point number '
+                                    'but got "abcd"'):
+            f2.place_configure(relheight='abcd')
+
+    def test_place_configure_bordermode(self):
+        f = tkinter.Frame(self.root)
+        with self.assertRaisesRegex(TclError, 'bad bordermode "j"'):
+            f.place_configure(bordermode='j')
+        with self.assertRaisesRegex(TclError, 'ambiguous bordermode ""'):
+            f.place_configure(bordermode='')
+        for value in 'inside', 'outside', 'ignore':
+            f.place_configure(bordermode=value)
+            self.assertEqual(f.place_info()['bordermode'], value)
+
+    def test_place_forget(self):
+        foo = tkinter.Frame(self.root)
+        foo.place_configure(width=50, height=50)
+        self.root.update()
+        foo.place_forget()
+        self.root.update()
+        self.assertFalse(foo.winfo_ismapped())
+        with self.assertRaises(TypeError):
+            foo.place_forget(0)
+
+    def test_place_info(self):
+        t, f, f2 = self.create2()
+        f2.place_configure(in_=f, x=1, y=2, width=3, height=4,
+                           relx=0.1, rely=0.2, relwidth=0.3, relheight=0.4,
+                           anchor='se', bordermode='outside')
+        info = f2.place_info()
+        self.assertIsInstance(info, dict)
+        self.assertEqual(info['x'], '1')
+        self.assertEqual(info['y'], '2')
+        self.assertEqual(info['width'], '3')
+        self.assertEqual(info['height'], '4')
+        self.assertEqual(info['relx'], '0.1')
+        self.assertEqual(info['rely'], '0.2')
+        self.assertEqual(info['relwidth'], '0.3')
+        self.assertEqual(info['relheight'], '0.4')
+        self.assertEqual(info['anchor'], 'se')
+        self.assertEqual(info['bordermode'], 'outside')
+        self.assertEqual(info['x'], '1')
+        self.assertEqual(info['x'], '1')
+        with self.assertRaises(TypeError):
+            f2.place_info(0)
+
+    def test_place_slaves(self):
+        foo = tkinter.Frame(self.root)
+        bar = tkinter.Frame(self.root)
+        self.assertEqual(foo.place_slaves(), [])
+        bar.place_configure(in_=foo)
+        self.assertEqual(foo.place_slaves(), [bar])
+        with self.assertRaises(TypeError):
+            foo.place_slaves(0)
+
+
+class GridTest(AbstractWidgetTest, unittest.TestCase):
+
+    def tearDown(self):
+        cols, rows = self.root.grid_size()
+        for i in range(cols + 1):
+            self.root.grid_columnconfigure(i, weight=0, minsize=0, pad=0, uniform='')
+        for i in range(rows + 1):
+            self.root.grid_rowconfigure(i, weight=0, minsize=0, pad=0, uniform='')
+        self.root.grid_propagate(1)
+        if tcl_version >= (8, 5):
+            self.root.grid_anchor('nw')
+        super().tearDown()
+
+    def test_grid_configure(self):
+        b = tkinter.Button(self.root)
+        self.assertEqual(b.grid_info(), {})
+        b.grid_configure()
+        self.assertEqual(b.grid_info()['in'], self.root)
+        self.assertEqual(b.grid_info()['column'], self._str(0))
+        self.assertEqual(b.grid_info()['row'], self._str(0))
+        b.grid_configure({'column': 1}, row=2)
+        self.assertEqual(b.grid_info()['column'], self._str(1))
+        self.assertEqual(b.grid_info()['row'], self._str(2))
+
+    def test_grid_configure_column(self):
+        b = tkinter.Button(self.root)
+        with self.assertRaisesRegex(TclError, 'bad column value "-1": '
+                                    'must be a non-negative integer'):
+            b.grid_configure(column=-1)
+        b.grid_configure(column=2)
+        self.assertEqual(b.grid_info()['column'], self._str(2))
+
+    def test_grid_configure_columnspan(self):
+        b = tkinter.Button(self.root)
+        with self.assertRaisesRegex(TclError, 'bad columnspan value "0": '
+                                    'must be a positive integer'):
+            b.grid_configure(columnspan=0)
+        b.grid_configure(columnspan=2)
+        self.assertEqual(b.grid_info()['columnspan'], self._str(2))
+
+    def test_grid_configure_in(self):
+        f = tkinter.Frame(self.root)
+        b = tkinter.Button(self.root)
+        self.assertEqual(b.grid_info(), {})
+        b.grid_configure()
+        self.assertEqual(b.grid_info()['in'], self.root)
+        b.grid_configure(in_=f)
+        self.assertEqual(b.grid_info()['in'], f)
+        b.grid_configure({'in': self.root})
+        self.assertEqual(b.grid_info()['in'], self.root)
+
+    def test_grid_configure_ipadx(self):
+        b = tkinter.Button(self.root)
+        with self.assertRaisesRegex(TclError, 'bad ipadx value "-1": '
+                                    'must be positive screen distance'):
+            b.grid_configure(ipadx=-1)
+        b.grid_configure(ipadx=1)
+        self.assertEqual(b.grid_info()['ipadx'], self._str(1))
+        b.grid_configure(ipadx='.5c')
+        self.assertEqual(b.grid_info()['ipadx'],
+                         self._str(round(pixels_conv('.5c') * self.scaling)))
+
+    def test_grid_configure_ipady(self):
+        b = tkinter.Button(self.root)
+        with self.assertRaisesRegex(TclError, 'bad ipady value "-1": '
+                                    'must be positive screen distance'):
+            b.grid_configure(ipady=-1)
+        b.grid_configure(ipady=1)
+        self.assertEqual(b.grid_info()['ipady'], self._str(1))
+        b.grid_configure(ipady='.5c')
+        self.assertEqual(b.grid_info()['ipady'],
+                         self._str(round(pixels_conv('.5c') * self.scaling)))
+
+    def test_grid_configure_padx(self):
+        b = tkinter.Button(self.root)
+        with self.assertRaisesRegex(TclError, 'bad pad value "-1": '
+                                    'must be positive screen distance'):
+            b.grid_configure(padx=-1)
+        b.grid_configure(padx=1)
+        self.assertEqual(b.grid_info()['padx'], self._str(1))
+        b.grid_configure(padx=(10, 5))
+        self.assertEqual(b.grid_info()['padx'], self._str((10, 5)))
+        b.grid_configure(padx='.5c')
+        self.assertEqual(b.grid_info()['padx'],
+                         self._str(round(pixels_conv('.5c') * self.scaling)))
+
+    def test_grid_configure_pady(self):
+        b = tkinter.Button(self.root)
+        with self.assertRaisesRegex(TclError, 'bad pad value "-1": '
+                                    'must be positive screen distance'):
+            b.grid_configure(pady=-1)
+        b.grid_configure(pady=1)
+        self.assertEqual(b.grid_info()['pady'], self._str(1))
+        b.grid_configure(pady=(10, 5))
+        self.assertEqual(b.grid_info()['pady'], self._str((10, 5)))
+        b.grid_configure(pady='.5c')
+        self.assertEqual(b.grid_info()['pady'],
+                         self._str(round(pixels_conv('.5c') * self.scaling)))
+
+    def test_grid_configure_row(self):
+        b = tkinter.Button(self.root)
+        with self.assertRaisesRegex(TclError, 'bad (row|grid) value "-1": '
+                                    'must be a non-negative integer'):
+            b.grid_configure(row=-1)
+        b.grid_configure(row=2)
+        self.assertEqual(b.grid_info()['row'], self._str(2))
+
+    def test_grid_configure_rownspan(self):
+        b = tkinter.Button(self.root)
+        with self.assertRaisesRegex(TclError, 'bad rowspan value "0": '
+                                    'must be a positive integer'):
+            b.grid_configure(rowspan=0)
+        b.grid_configure(rowspan=2)
+        self.assertEqual(b.grid_info()['rowspan'], self._str(2))
+
+    def test_grid_configure_sticky(self):
+        f = tkinter.Frame(self.root, bg='red')
+        with self.assertRaisesRegex(TclError, 'bad stickyness value "glue"'):
+            f.grid_configure(sticky='glue')
+        f.grid_configure(sticky='ne')
+        self.assertEqual(f.grid_info()['sticky'], 'ne')
+        f.grid_configure(sticky='n,s,e,w')
+        self.assertEqual(f.grid_info()['sticky'], 'nesw')
+
+    def test_grid_columnconfigure(self):
+        with self.assertRaises(TypeError):
+            self.root.grid_columnconfigure()
+        self.assertEqual(self.root.grid_columnconfigure(0),
+                         {'minsize': 0, 'pad': 0, 'uniform': None, 'weight': 0})
+        with self.assertRaisesRegex(TclError, 'bad option "-foo"'):
+            self.root.grid_columnconfigure(0, 'foo')
+        self.root.grid_columnconfigure((0, 3), weight=2)
+        with self.assertRaisesRegex(TclError,
+                                    'must specify a single element on retrieval'):
+            self.root.grid_columnconfigure((0, 3))
+        b = tkinter.Button(self.root)
+        b.grid_configure(column=0, row=0)
+        if tcl_version >= (8, 5):
+            self.root.grid_columnconfigure('all', weight=3)
+            with self.assertRaisesRegex(TclError, 'expected integer but got "all"'):
+                self.root.grid_columnconfigure('all')
+            self.assertEqual(self.root.grid_columnconfigure(0, 'weight'), 3)
+        self.assertEqual(self.root.grid_columnconfigure(3, 'weight'), 2)
+        self.assertEqual(self.root.grid_columnconfigure(265, 'weight'), 0)
+        if tcl_version >= (8, 5):
+            self.root.grid_columnconfigure(b, weight=4)
+            self.assertEqual(self.root.grid_columnconfigure(0, 'weight'), 4)
+
+    def test_grid_columnconfigure_minsize(self):
+        with self.assertRaisesRegex(TclError, 'bad screen distance "foo"'):
+            self.root.grid_columnconfigure(0, minsize='foo')
+        self.root.grid_columnconfigure(0, minsize=10)
+        self.assertEqual(self.root.grid_columnconfigure(0, 'minsize'), 10)
+        self.assertEqual(self.root.grid_columnconfigure(0)['minsize'], 10)
+
+    def test_grid_columnconfigure_weight(self):
+        with self.assertRaisesRegex(TclError, 'expected integer but got "bad"'):
+            self.root.grid_columnconfigure(0, weight='bad')
+        with self.assertRaisesRegex(TclError, 'invalid arg "-weight": '
+                                    'should be non-negative'):
+            self.root.grid_columnconfigure(0, weight=-3)
+        self.root.grid_columnconfigure(0, weight=3)
+        self.assertEqual(self.root.grid_columnconfigure(0, 'weight'), 3)
+        self.assertEqual(self.root.grid_columnconfigure(0)['weight'], 3)
+
+    def test_grid_columnconfigure_pad(self):
+        with self.assertRaisesRegex(TclError, 'bad screen distance "foo"'):
+            self.root.grid_columnconfigure(0, pad='foo')
+        with self.assertRaisesRegex(TclError, 'invalid arg "-pad": '
+                                    'should be non-negative'):
+            self.root.grid_columnconfigure(0, pad=-3)
+        self.root.grid_columnconfigure(0, pad=3)
+        self.assertEqual(self.root.grid_columnconfigure(0, 'pad'), 3)
+        self.assertEqual(self.root.grid_columnconfigure(0)['pad'], 3)
+
+    def test_grid_columnconfigure_uniform(self):
+        self.root.grid_columnconfigure(0, uniform='foo')
+        self.assertEqual(self.root.grid_columnconfigure(0, 'uniform'), 'foo')
+        self.assertEqual(self.root.grid_columnconfigure(0)['uniform'], 'foo')
+
+    def test_grid_rowconfigure(self):
+        with self.assertRaises(TypeError):
+            self.root.grid_rowconfigure()
+        self.assertEqual(self.root.grid_rowconfigure(0),
+                         {'minsize': 0, 'pad': 0, 'uniform': None, 'weight': 0})
+        with self.assertRaisesRegex(TclError, 'bad option "-foo"'):
+            self.root.grid_rowconfigure(0, 'foo')
+        self.root.grid_rowconfigure((0, 3), weight=2)
+        with self.assertRaisesRegex(TclError,
+                                    'must specify a single element on retrieval'):
+            self.root.grid_rowconfigure((0, 3))
+        b = tkinter.Button(self.root)
+        b.grid_configure(column=0, row=0)
+        if tcl_version >= (8, 5):
+            self.root.grid_rowconfigure('all', weight=3)
+            with self.assertRaisesRegex(TclError, 'expected integer but got "all"'):
+                self.root.grid_rowconfigure('all')
+            self.assertEqual(self.root.grid_rowconfigure(0, 'weight'), 3)
+        self.assertEqual(self.root.grid_rowconfigure(3, 'weight'), 2)
+        self.assertEqual(self.root.grid_rowconfigure(265, 'weight'), 0)
+        if tcl_version >= (8, 5):
+            self.root.grid_rowconfigure(b, weight=4)
+            self.assertEqual(self.root.grid_rowconfigure(0, 'weight'), 4)
+
+    def test_grid_rowconfigure_minsize(self):
+        with self.assertRaisesRegex(TclError, 'bad screen distance "foo"'):
+            self.root.grid_rowconfigure(0, minsize='foo')
+        self.root.grid_rowconfigure(0, minsize=10)
+        self.assertEqual(self.root.grid_rowconfigure(0, 'minsize'), 10)
+        self.assertEqual(self.root.grid_rowconfigure(0)['minsize'], 10)
+
+    def test_grid_rowconfigure_weight(self):
+        with self.assertRaisesRegex(TclError, 'expected integer but got "bad"'):
+            self.root.grid_rowconfigure(0, weight='bad')
+        with self.assertRaisesRegex(TclError, 'invalid arg "-weight": '
+                                    'should be non-negative'):
+            self.root.grid_rowconfigure(0, weight=-3)
+        self.root.grid_rowconfigure(0, weight=3)
+        self.assertEqual(self.root.grid_rowconfigure(0, 'weight'), 3)
+        self.assertEqual(self.root.grid_rowconfigure(0)['weight'], 3)
+
+    def test_grid_rowconfigure_pad(self):
+        with self.assertRaisesRegex(TclError, 'bad screen distance "foo"'):
+            self.root.grid_rowconfigure(0, pad='foo')
+        with self.assertRaisesRegex(TclError, 'invalid arg "-pad": '
+                                    'should be non-negative'):
+            self.root.grid_rowconfigure(0, pad=-3)
+        self.root.grid_rowconfigure(0, pad=3)
+        self.assertEqual(self.root.grid_rowconfigure(0, 'pad'), 3)
+        self.assertEqual(self.root.grid_rowconfigure(0)['pad'], 3)
+
+    def test_grid_rowconfigure_uniform(self):
+        self.root.grid_rowconfigure(0, uniform='foo')
+        self.assertEqual(self.root.grid_rowconfigure(0, 'uniform'), 'foo')
+        self.assertEqual(self.root.grid_rowconfigure(0)['uniform'], 'foo')
+
+    def test_grid_forget(self):
+        b = tkinter.Button(self.root)
+        c = tkinter.Button(self.root)
+        b.grid_configure(row=2, column=2, rowspan=2, columnspan=2,
+                         padx=3, pady=4, sticky='ns')
+        self.assertEqual(self.root.grid_slaves(), [b])
+        b.grid_forget()
+        c.grid_forget()
+        self.assertEqual(self.root.grid_slaves(), [])
+        self.assertEqual(b.grid_info(), {})
+        b.grid_configure(row=0, column=0)
+        info = b.grid_info()
+        self.assertEqual(info['row'], self._str(0))
+        self.assertEqual(info['column'], self._str(0))
+        self.assertEqual(info['rowspan'], self._str(1))
+        self.assertEqual(info['columnspan'], self._str(1))
+        self.assertEqual(info['padx'], self._str(0))
+        self.assertEqual(info['pady'], self._str(0))
+        self.assertEqual(info['sticky'], '')
+
+    def test_grid_remove(self):
+        b = tkinter.Button(self.root)
+        c = tkinter.Button(self.root)
+        b.grid_configure(row=2, column=2, rowspan=2, columnspan=2,
+                         padx=3, pady=4, sticky='ns')
+        self.assertEqual(self.root.grid_slaves(), [b])
+        b.grid_remove()
+        c.grid_remove()
+        self.assertEqual(self.root.grid_slaves(), [])
+        self.assertEqual(b.grid_info(), {})
+        b.grid_configure(row=0, column=0)
+        info = b.grid_info()
+        self.assertEqual(info['row'], self._str(0))
+        self.assertEqual(info['column'], self._str(0))
+        self.assertEqual(info['rowspan'], self._str(2))
+        self.assertEqual(info['columnspan'], self._str(2))
+        self.assertEqual(info['padx'], self._str(3))
+        self.assertEqual(info['pady'], self._str(4))
+        self.assertEqual(info['sticky'], 'ns')
+
+    def test_grid_info(self):
+        b = tkinter.Button(self.root)
+        self.assertEqual(b.grid_info(), {})
+        b.grid_configure(row=2, column=2, rowspan=2, columnspan=2,
+                         padx=3, pady=4, sticky='ns')
+        info = b.grid_info()
+        self.assertIsInstance(info, dict)
+        self.assertEqual(info['in'], self.root)
+        self.assertEqual(info['row'], self._str(2))
+        self.assertEqual(info['column'], self._str(2))
+        self.assertEqual(info['rowspan'], self._str(2))
+        self.assertEqual(info['columnspan'], self._str(2))
+        self.assertEqual(info['padx'], self._str(3))
+        self.assertEqual(info['pady'], self._str(4))
+        self.assertEqual(info['sticky'], 'ns')
+
+    @requires_tcl(8, 5)
+    def test_grid_anchor(self):
+        with self.assertRaisesRegex(TclError, 'bad anchor "x"'):
+            self.root.grid_anchor('x')
+        with self.assertRaisesRegex(TclError, 'ambiguous anchor ""'):
+            self.root.grid_anchor('')
+        with self.assertRaises(TypeError):
+            self.root.grid_anchor('se', 'nw')
+        self.root.grid_anchor('se')
+        self.assertEqual(self.root.tk.call('grid', 'anchor', self.root), 'se')
+
+    def test_grid_bbox(self):
+        self.assertEqual(self.root.grid_bbox(), (0, 0, 0, 0))
+        self.assertEqual(self.root.grid_bbox(0, 0), (0, 0, 0, 0))
+        self.assertEqual(self.root.grid_bbox(0, 0, 1, 1), (0, 0, 0, 0))
+        with self.assertRaisesRegex(TclError, 'expected integer but got "x"'):
+            self.root.grid_bbox('x', 0)
+        with self.assertRaisesRegex(TclError, 'expected integer but got "x"'):
+            self.root.grid_bbox(0, 'x')
+        with self.assertRaisesRegex(TclError, 'expected integer but got "x"'):
+            self.root.grid_bbox(0, 0, 'x', 0)
+        with self.assertRaisesRegex(TclError, 'expected integer but got "x"'):
+            self.root.grid_bbox(0, 0, 0, 'x')
+        with self.assertRaises(TypeError):
+            self.root.grid_bbox(0, 0, 0, 0, 0)
+        t = self.root
+        # de-maximize
+        t.wm_geometry('1x1+0+0')
+        t.wm_geometry('')
+        f1 = tkinter.Frame(t, width=75, height=75, bg='red')
+        f2 = tkinter.Frame(t, width=90, height=90, bg='blue')
+        f1.grid_configure(row=0, column=0)
+        f2.grid_configure(row=1, column=1)
+        self.root.update()
+        self.assertEqual(t.grid_bbox(), (0, 0, 165, 165))
+        self.assertEqual(t.grid_bbox(0, 0), (0, 0, 75, 75))
+        self.assertEqual(t.grid_bbox(0, 0, 1, 1), (0, 0, 165, 165))
+        self.assertEqual(t.grid_bbox(1, 1), (75, 75, 90, 90))
+        self.assertEqual(t.grid_bbox(10, 10, 0, 0), (0, 0, 165, 165))
+        self.assertEqual(t.grid_bbox(-2, -2, -1, -1), (0, 0, 0, 0))
+        self.assertEqual(t.grid_bbox(10, 10, 12, 12), (165, 165, 0, 0))
+
+    def test_grid_location(self):
+        with self.assertRaises(TypeError):
+            self.root.grid_location()
+        with self.assertRaises(TypeError):
+            self.root.grid_location(0)
+        with self.assertRaises(TypeError):
+            self.root.grid_location(0, 0, 0)
+        with self.assertRaisesRegex(TclError, 'bad screen distance "x"'):
+            self.root.grid_location('x', 'y')
+        with self.assertRaisesRegex(TclError, 'bad screen distance "y"'):
+            self.root.grid_location('1c', 'y')
+        t = self.root
+        # de-maximize
+        t.wm_geometry('1x1+0+0')
+        t.wm_geometry('')
+        f = tkinter.Frame(t, width=200, height=100,
+                          highlightthickness=0, bg='red')
+        self.assertEqual(f.grid_location(10, 10), (-1, -1))
+        f.grid_configure()
+        self.root.update()
+        self.assertEqual(t.grid_location(-10, -10), (-1, -1))
+        self.assertEqual(t.grid_location(-10, 0), (-1, 0))
+        self.assertEqual(t.grid_location(-1, 0), (-1, 0))
+        self.assertEqual(t.grid_location(0, -10), (0, -1))
+        self.assertEqual(t.grid_location(0, -1), (0, -1))
+        self.assertEqual(t.grid_location(0, 0), (0, 0))
+        self.assertEqual(t.grid_location(200, 0), (0, 0))
+        self.assertEqual(t.grid_location(201, 0), (1, 0))
+        self.assertEqual(t.grid_location(0, 100), (0, 0))
+        self.assertEqual(t.grid_location(0, 101), (0, 1))
+        self.assertEqual(t.grid_location(201, 101), (1, 1))
+
+    def test_grid_propagate(self):
+        self.assertEqual(self.root.grid_propagate(), True)
+        with self.assertRaises(TypeError):
+            self.root.grid_propagate(False, False)
+        self.root.grid_propagate(False)
+        self.assertFalse(self.root.grid_propagate())
+        f = tkinter.Frame(self.root, width=100, height=100, bg='red')
+        f.grid_configure(row=0, column=0)
+        self.root.update()
+        self.assertEqual(f.winfo_width(), 100)
+        self.assertEqual(f.winfo_height(), 100)
+        f.grid_propagate(False)
+        g = tkinter.Frame(self.root, width=75, height=85, bg='green')
+        g.grid_configure(in_=f, row=0, column=0)
+        self.root.update()
+        self.assertEqual(f.winfo_width(), 100)
+        self.assertEqual(f.winfo_height(), 100)
+        f.grid_propagate(True)
+        self.root.update()
+        self.assertEqual(f.winfo_width(), 75)
+        self.assertEqual(f.winfo_height(), 85)
+
+    def test_grid_size(self):
+        with self.assertRaises(TypeError):
+            self.root.grid_size(0)
+        self.assertEqual(self.root.grid_size(), (0, 0))
+        f = tkinter.Scale(self.root)
+        f.grid_configure(row=0, column=0)
+        self.assertEqual(self.root.grid_size(), (1, 1))
+        f.grid_configure(row=4, column=5)
+        self.assertEqual(self.root.grid_size(), (6, 5))
+
+    def test_grid_slaves(self):
+        self.assertEqual(self.root.grid_slaves(), [])
+        a = tkinter.Label(self.root)
+        a.grid_configure(row=0, column=1)
+        b = tkinter.Label(self.root)
+        b.grid_configure(row=1, column=0)
+        c = tkinter.Label(self.root)
+        c.grid_configure(row=1, column=1)
+        d = tkinter.Label(self.root)
+        d.grid_configure(row=1, column=1)
+        self.assertEqual(self.root.grid_slaves(), [d, c, b, a])
+        self.assertEqual(self.root.grid_slaves(row=0), [a])
+        self.assertEqual(self.root.grid_slaves(row=1), [d, c, b])
+        self.assertEqual(self.root.grid_slaves(column=0), [b])
+        self.assertEqual(self.root.grid_slaves(column=1), [d, c, a])
+        self.assertEqual(self.root.grid_slaves(row=1, column=1), [d, c])
+
+
+tests_gui = (
+    PackTest, PlaceTest, GridTest,
+)
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Lib/tkinter/test/test_tkinter/test_images.py b/Lib/tkinter/test/test_tkinter/test_images.py
new file mode 100644
index 0000000..85a8cd0
--- /dev/null
+++ b/Lib/tkinter/test/test_tkinter/test_images.py
@@ -0,0 +1,327 @@
+import unittest
+import tkinter
+from test import support
+from tkinter.test.support import AbstractTkTest, requires_tcl
+
+support.requires('gui')
+
+
+class MiscTest(AbstractTkTest, unittest.TestCase):
+
+    def test_image_types(self):
+        image_types = self.root.image_types()
+        self.assertIsInstance(image_types, tuple)
+        self.assertIn('photo', image_types)
+        self.assertIn('bitmap', image_types)
+
+    def test_image_names(self):
+        image_names = self.root.image_names()
+        self.assertIsInstance(image_names, tuple)
+
+
+class BitmapImageTest(AbstractTkTest, unittest.TestCase):
+
+    @classmethod
+    def setUpClass(cls):
+        AbstractTkTest.setUpClass.__func__(cls)
+        cls.testfile = support.findfile('python.xbm', subdir='imghdrdata')
+
+    def test_create_from_file(self):
+        image = tkinter.BitmapImage('::img::test', master=self.root,
+                                    foreground='yellow', background='blue',
+                                    file=self.testfile)
+        self.assertEqual(str(image), '::img::test')
+        self.assertEqual(image.type(), 'bitmap')
+        self.assertEqual(image.width(), 16)
+        self.assertEqual(image.height(), 16)
+        self.assertIn('::img::test', self.root.image_names())
+        del image
+        self.assertNotIn('::img::test', self.root.image_names())
+
+    def test_create_from_data(self):
+        with open(self.testfile, 'rb') as f:
+            data = f.read()
+        image = tkinter.BitmapImage('::img::test', master=self.root,
+                                    foreground='yellow', background='blue',
+                                    data=data)
+        self.assertEqual(str(image), '::img::test')
+        self.assertEqual(image.type(), 'bitmap')
+        self.assertEqual(image.width(), 16)
+        self.assertEqual(image.height(), 16)
+        self.assertIn('::img::test', self.root.image_names())
+        del image
+        self.assertNotIn('::img::test', self.root.image_names())
+
+    def assertEqualStrList(self, actual, expected):
+        self.assertIsInstance(actual, str)
+        self.assertEqual(self.root.splitlist(actual), expected)
+
+    def test_configure_data(self):
+        image = tkinter.BitmapImage('::img::test', master=self.root)
+        self.assertEqual(image['data'], '-data {} {} {} {}')
+        with open(self.testfile, 'rb') as f:
+            data = f.read()
+        image.configure(data=data)
+        self.assertEqualStrList(image['data'],
+                                ('-data', '', '', '', data.decode('ascii')))
+        self.assertEqual(image.width(), 16)
+        self.assertEqual(image.height(), 16)
+
+        self.assertEqual(image['maskdata'], '-maskdata {} {} {} {}')
+        image.configure(maskdata=data)
+        self.assertEqualStrList(image['maskdata'],
+                                ('-maskdata', '', '', '', data.decode('ascii')))
+
+    def test_configure_file(self):
+        image = tkinter.BitmapImage('::img::test', master=self.root)
+        self.assertEqual(image['file'], '-file {} {} {} {}')
+        image.configure(file=self.testfile)
+        self.assertEqualStrList(image['file'],
+                                ('-file', '', '', '',self.testfile))
+        self.assertEqual(image.width(), 16)
+        self.assertEqual(image.height(), 16)
+
+        self.assertEqual(image['maskfile'], '-maskfile {} {} {} {}')
+        image.configure(maskfile=self.testfile)
+        self.assertEqualStrList(image['maskfile'],
+                                ('-maskfile', '', '', '', self.testfile))
+
+    def test_configure_background(self):
+        image = tkinter.BitmapImage('::img::test', master=self.root)
+        self.assertEqual(image['background'], '-background {} {} {} {}')
+        image.configure(background='blue')
+        self.assertEqual(image['background'], '-background {} {} {} blue')
+
+    def test_configure_foreground(self):
+        image = tkinter.BitmapImage('::img::test', master=self.root)
+        self.assertEqual(image['foreground'],
+                         '-foreground {} {} #000000 #000000')
+        image.configure(foreground='yellow')
+        self.assertEqual(image['foreground'],
+                         '-foreground {} {} #000000 yellow')
+
+
+class PhotoImageTest(AbstractTkTest, unittest.TestCase):
+
+    @classmethod
+    def setUpClass(cls):
+        AbstractTkTest.setUpClass.__func__(cls)
+        cls.testfile = support.findfile('python.gif', subdir='imghdrdata')
+
+    def create(self):
+        return tkinter.PhotoImage('::img::test', master=self.root,
+                                  file=self.testfile)
+
+    def colorlist(self, *args):
+        if tkinter.TkVersion >= 8.6 and self.wantobjects:
+            return args
+        else:
+            return tkinter._join(args)
+
+    def check_create_from_file(self, ext):
+        testfile = support.findfile('python.' + ext, subdir='imghdrdata')
+        image = tkinter.PhotoImage('::img::test', master=self.root,
+                                   file=testfile)
+        self.assertEqual(str(image), '::img::test')
+        self.assertEqual(image.type(), 'photo')
+        self.assertEqual(image.width(), 16)
+        self.assertEqual(image.height(), 16)
+        self.assertEqual(image['data'], '')
+        self.assertEqual(image['file'], testfile)
+        self.assertIn('::img::test', self.root.image_names())
+        del image
+        self.assertNotIn('::img::test', self.root.image_names())
+
+    def check_create_from_data(self, ext):
+        testfile = support.findfile('python.' + ext, subdir='imghdrdata')
+        with open(testfile, 'rb') as f:
+            data = f.read()
+        image = tkinter.PhotoImage('::img::test', master=self.root,
+                                   data=data)
+        self.assertEqual(str(image), '::img::test')
+        self.assertEqual(image.type(), 'photo')
+        self.assertEqual(image.width(), 16)
+        self.assertEqual(image.height(), 16)
+        self.assertEqual(image['data'], data if self.wantobjects
+                                        else data.decode('latin1'))
+        self.assertEqual(image['file'], '')
+        self.assertIn('::img::test', self.root.image_names())
+        del image
+        self.assertNotIn('::img::test', self.root.image_names())
+
+    def test_create_from_ppm_file(self):
+        self.check_create_from_file('ppm')
+
+    def test_create_from_ppm_data(self):
+        self.check_create_from_data('ppm')
+
+    def test_create_from_pgm_file(self):
+        self.check_create_from_file('pgm')
+
+    def test_create_from_pgm_data(self):
+        self.check_create_from_data('pgm')
+
+    def test_create_from_gif_file(self):
+        self.check_create_from_file('gif')
+
+    def test_create_from_gif_data(self):
+        self.check_create_from_data('gif')
+
+    @requires_tcl(8, 6)
+    def test_create_from_png_file(self):
+        self.check_create_from_file('png')
+
+    @requires_tcl(8, 6)
+    def test_create_from_png_data(self):
+        self.check_create_from_data('png')
+
+    def test_configure_data(self):
+        image = tkinter.PhotoImage('::img::test', master=self.root)
+        self.assertEqual(image['data'], '')
+        with open(self.testfile, 'rb') as f:
+            data = f.read()
+        image.configure(data=data)
+        self.assertEqual(image['data'], data if self.wantobjects
+                                        else data.decode('latin1'))
+        self.assertEqual(image.width(), 16)
+        self.assertEqual(image.height(), 16)
+
+    def test_configure_format(self):
+        image = tkinter.PhotoImage('::img::test', master=self.root)
+        self.assertEqual(image['format'], '')
+        image.configure(file=self.testfile, format='gif')
+        self.assertEqual(image['format'], ('gif',) if self.wantobjects
+                                          else 'gif')
+        self.assertEqual(image.width(), 16)
+        self.assertEqual(image.height(), 16)
+
+    def test_configure_file(self):
+        image = tkinter.PhotoImage('::img::test', master=self.root)
+        self.assertEqual(image['file'], '')
+        image.configure(file=self.testfile)
+        self.assertEqual(image['file'], self.testfile)
+        self.assertEqual(image.width(), 16)
+        self.assertEqual(image.height(), 16)
+
+    def test_configure_gamma(self):
+        image = tkinter.PhotoImage('::img::test', master=self.root)
+        self.assertEqual(image['gamma'], '1.0')
+        image.configure(gamma=2.0)
+        self.assertEqual(image['gamma'], '2.0')
+
+    def test_configure_width_height(self):
+        image = tkinter.PhotoImage('::img::test', master=self.root)
+        self.assertEqual(image['width'], '0')
+        self.assertEqual(image['height'], '0')
+        image.configure(width=20)
+        image.configure(height=10)
+        self.assertEqual(image['width'], '20')
+        self.assertEqual(image['height'], '10')
+        self.assertEqual(image.width(), 20)
+        self.assertEqual(image.height(), 10)
+
+    def test_configure_palette(self):
+        image = tkinter.PhotoImage('::img::test', master=self.root)
+        self.assertEqual(image['palette'], '')
+        image.configure(palette=256)
+        self.assertEqual(image['palette'], '256')
+        image.configure(palette='3/4/2')
+        self.assertEqual(image['palette'], '3/4/2')
+
+    def test_blank(self):
+        image = self.create()
+        image.blank()
+        self.assertEqual(image.width(), 16)
+        self.assertEqual(image.height(), 16)
+        self.assertEqual(image.get(4, 6), self.colorlist(0, 0, 0))
+
+    def test_copy(self):
+        image = self.create()
+        image2 = image.copy()
+        self.assertEqual(image2.width(), 16)
+        self.assertEqual(image2.height(), 16)
+        self.assertEqual(image.get(4, 6), image.get(4, 6))
+
+    def test_subsample(self):
+        image = self.create()
+        image2 = image.subsample(2, 3)
+        self.assertEqual(image2.width(), 8)
+        self.assertEqual(image2.height(), 6)
+        self.assertEqual(image2.get(2, 2), image.get(4, 6))
+
+        image2 = image.subsample(2)
+        self.assertEqual(image2.width(), 8)
+        self.assertEqual(image2.height(), 8)
+        self.assertEqual(image2.get(2, 3), image.get(4, 6))
+
+    def test_zoom(self):
+        image = self.create()
+        image2 = image.zoom(2, 3)
+        self.assertEqual(image2.width(), 32)
+        self.assertEqual(image2.height(), 48)
+        self.assertEqual(image2.get(8, 18), image.get(4, 6))
+        self.assertEqual(image2.get(9, 20), image.get(4, 6))
+
+        image2 = image.zoom(2)
+        self.assertEqual(image2.width(), 32)
+        self.assertEqual(image2.height(), 32)
+        self.assertEqual(image2.get(8, 12), image.get(4, 6))
+        self.assertEqual(image2.get(9, 13), image.get(4, 6))
+
+    def test_put(self):
+        image = self.create()
+        image.put('{red green} {blue yellow}', to=(4, 6))
+        self.assertEqual(image.get(4, 6), self.colorlist(255, 0, 0))
+        self.assertEqual(image.get(5, 6),
+                         self.colorlist(0, 128 if tkinter.TkVersion >= 8.6
+                                           else 255, 0))
+        self.assertEqual(image.get(4, 7), self.colorlist(0, 0, 255))
+        self.assertEqual(image.get(5, 7), self.colorlist(255, 255, 0))
+
+        image.put((('#f00', '#00ff00'), ('#000000fff', '#ffffffff0000')))
+        self.assertEqual(image.get(0, 0), self.colorlist(255, 0, 0))
+        self.assertEqual(image.get(1, 0), self.colorlist(0, 255, 0))
+        self.assertEqual(image.get(0, 1), self.colorlist(0, 0, 255))
+        self.assertEqual(image.get(1, 1), self.colorlist(255, 255, 0))
+
+    def test_get(self):
+        image = self.create()
+        self.assertEqual(image.get(4, 6), self.colorlist(62, 116, 162))
+        self.assertEqual(image.get(0, 0), self.colorlist(0, 0, 0))
+        self.assertEqual(image.get(15, 15), self.colorlist(0, 0, 0))
+        self.assertRaises(tkinter.TclError, image.get, -1, 0)
+        self.assertRaises(tkinter.TclError, image.get, 0, -1)
+        self.assertRaises(tkinter.TclError, image.get, 16, 15)
+        self.assertRaises(tkinter.TclError, image.get, 15, 16)
+
+    def test_write(self):
+        image = self.create()
+        self.addCleanup(support.unlink, support.TESTFN)
+
+        image.write(support.TESTFN)
+        image2 = tkinter.PhotoImage('::img::test2', master=self.root,
+                                    format='ppm',
+                                    file=support.TESTFN)
+        self.assertEqual(str(image2), '::img::test2')
+        self.assertEqual(image2.type(), 'photo')
+        self.assertEqual(image2.width(), 16)
+        self.assertEqual(image2.height(), 16)
+        self.assertEqual(image2.get(0, 0), image.get(0, 0))
+        self.assertEqual(image2.get(15, 8), image.get(15, 8))
+
+        image.write(support.TESTFN, format='gif', from_coords=(4, 6, 6, 9))
+        image3 = tkinter.PhotoImage('::img::test3', master=self.root,
+                                    format='gif',
+                                    file=support.TESTFN)
+        self.assertEqual(str(image3), '::img::test3')
+        self.assertEqual(image3.type(), 'photo')
+        self.assertEqual(image3.width(), 2)
+        self.assertEqual(image3.height(), 3)
+        self.assertEqual(image3.get(0, 0), image.get(4, 6))
+        self.assertEqual(image3.get(1, 2), image.get(5, 8))
+
+
+tests_gui = (MiscTest, BitmapImageTest, PhotoImageTest,)
+
+if __name__ == "__main__":
+    support.run_unittest(*tests_gui)
diff --git a/Lib/tkinter/test/test_tkinter/test_misc.py b/Lib/tkinter/test/test_tkinter/test_misc.py
index d325b31..d8de949 100644
--- a/Lib/tkinter/test/test_tkinter/test_misc.py
+++ b/Lib/tkinter/test/test_tkinter/test_misc.py
@@ -1,14 +1,11 @@
 import unittest
 import tkinter
-from tkinter import ttk
 from test import support
+from tkinter.test.support import AbstractTkTest
 
 support.requires('gui')
 
-class MiscTest(unittest.TestCase):
-
-    def setUp(self):
-        self.root = ttk.setup_master()
+class MiscTest(AbstractTkTest, unittest.TestCase):
 
     def test_tk_setPalette(self):
         root = self.root
diff --git a/Lib/tkinter/test/test_tkinter/test_text.py b/Lib/tkinter/test/test_tkinter/test_text.py
index 4c3fa04..13b7c56 100644
--- a/Lib/tkinter/test/test_tkinter/test_text.py
+++ b/Lib/tkinter/test/test_tkinter/test_text.py
@@ -1,19 +1,16 @@
 import unittest
 import tkinter
 from test.support import requires, run_unittest
-from tkinter.ttk import setup_master
+from tkinter.test.support import AbstractTkTest
 
 requires('gui')
 
-class TextTest(unittest.TestCase):
+class TextTest(AbstractTkTest, unittest.TestCase):
 
     def setUp(self):
-        self.root = setup_master()
+        super().setUp()
         self.text = tkinter.Text(self.root)
 
-    def tearDown(self):
-        self.text.destroy()
-
     def test_debug(self):
         text = self.text
         olddebug = text.debug()
diff --git a/Lib/tkinter/test/test_tkinter/test_variables.py b/Lib/tkinter/test/test_tkinter/test_variables.py
index 9d910ac..7b7e299 100644
--- a/Lib/tkinter/test/test_tkinter/test_variables.py
+++ b/Lib/tkinter/test/test_tkinter/test_variables.py
@@ -1,6 +1,6 @@
 import unittest
 
-from tkinter import Variable, StringVar, IntVar, DoubleVar, BooleanVar, Tk
+from tkinter import Variable, StringVar, IntVar, DoubleVar, BooleanVar, Tcl
 
 
 class Var(Variable):
@@ -16,10 +16,10 @@
 class TestBase(unittest.TestCase):
 
     def setUp(self):
-        self.root = Tk()
+        self.root = Tcl()
 
     def tearDown(self):
-        self.root.destroy()
+        del self.root
 
 
 class TestVariable(TestBase):
@@ -81,7 +81,7 @@
             self.root.setvar(b'var\x00name', "value")
 
     def test_initialize(self):
-        v = Var()
+        v = Var(self.root)
         self.assertFalse(v.side_effect)
         v.set("value")
         self.assertTrue(v.side_effect)
diff --git a/Lib/tkinter/test/test_tkinter/test_widgets.py b/Lib/tkinter/test/test_tkinter/test_widgets.py
index 6ef7750..58c8ea1 100644
--- a/Lib/tkinter/test/test_tkinter/test_widgets.py
+++ b/Lib/tkinter/test/test_tkinter/test_widgets.py
@@ -1,5 +1,6 @@
 import unittest
 import tkinter
+from tkinter import TclError
 import os
 import sys
 from test.support import requires
@@ -65,7 +66,7 @@
         'takefocus', 'use', 'visual', 'width',
     )
 
-    def _create(self, **kwargs):
+    def create(self, **kwargs):
         return tkinter.Toplevel(self.root, **kwargs)
 
     def test_menu(self):
@@ -104,7 +105,7 @@
         'relief', 'takefocus', 'visual', 'width',
     )
 
-    def _create(self, **kwargs):
+    def create(self, **kwargs):
         return tkinter.Frame(self.root, **kwargs)
 
 
@@ -119,7 +120,7 @@
         'takefocus', 'text', 'visual', 'width',
     )
 
-    def _create(self, **kwargs):
+    def create(self, **kwargs):
         return tkinter.LabelFrame(self.root, **kwargs)
 
     def test_labelanchor(self):
@@ -157,7 +158,7 @@
         'underline', 'width', 'wraplength',
     )
 
-    def _create(self, **kwargs):
+    def create(self, **kwargs):
         return tkinter.Label(self.root, **kwargs)
 
 
@@ -174,7 +175,7 @@
         'state', 'takefocus', 'text', 'textvariable',
         'underline', 'width', 'wraplength')
 
-    def _create(self, **kwargs):
+    def create(self, **kwargs):
         return tkinter.Button(self.root, **kwargs)
 
     def test_default(self):
@@ -198,7 +199,7 @@
         'underline', 'variable', 'width', 'wraplength',
     )
 
-    def _create(self, **kwargs):
+    def create(self, **kwargs):
         return tkinter.Checkbutton(self.root, **kwargs)
 
 
@@ -226,7 +227,7 @@
         'underline', 'value', 'variable', 'width', 'wraplength',
     )
 
-    def _create(self, **kwargs):
+    def create(self, **kwargs):
         return tkinter.Radiobutton(self.root, **kwargs)
 
     def test_value(self):
@@ -249,7 +250,7 @@
     )
     _conv_pixels = staticmethod(pixels_round)
 
-    def _create(self, **kwargs):
+    def create(self, **kwargs):
         return tkinter.Menubutton(self.root, **kwargs)
 
     def test_direction(self):
@@ -267,7 +268,7 @@
                      'crashes with Cocoa Tk (issue19733)')
     def test_image(self):
         widget = self.create()
-        image = tkinter.PhotoImage('image1')
+        image = tkinter.PhotoImage(master=self.root, name='image1')
         self.checkParam(widget, 'image', image, conv=str)
         errmsg = 'image "spam" doesn\'t exist'
         with self.assertRaises(tkinter.TclError) as cm:
@@ -302,7 +303,7 @@
 
 class OptionMenuTest(MenubuttonTest, unittest.TestCase):
 
-    def _create(self, default='b', values=('a', 'b', 'c'), **kwargs):
+    def create(self, default='b', values=('a', 'b', 'c'), **kwargs):
         return tkinter.OptionMenu(self.root, None, default, *values, **kwargs)
 
 
@@ -321,7 +322,7 @@
         'validate', 'validatecommand', 'width', 'xscrollcommand',
     )
 
-    def _create(self, **kwargs):
+    def create(self, **kwargs):
         return tkinter.Entry(self.root, **kwargs)
 
     def test_disabledbackground(self):
@@ -395,7 +396,7 @@
         'width', 'wrap', 'xscrollcommand',
     )
 
-    def _create(self, **kwargs):
+    def create(self, **kwargs):
         return tkinter.Spinbox(self.root, **kwargs)
 
     test_show = None
@@ -466,11 +467,7 @@
 
     def test_bbox(self):
         widget = self.create()
-        bbox = widget.bbox(0)
-        self.assertEqual(len(bbox), 4)
-        for item in bbox:
-            self.assertIsInstance(item, int)
-
+        self.assertIsBoundingBox(widget.bbox(0))
         self.assertRaises(tkinter.TclError, widget.bbox, 'noindex')
         self.assertRaises(tkinter.TclError, widget.bbox, None)
         self.assertRaises(TypeError, widget.bbox)
@@ -493,9 +490,9 @@
         'xscrollcommand', 'yscrollcommand',
     )
     if tcl_version < (8, 5):
-        wantobjects = False
+        _stringify = True
 
-    def _create(self, **kwargs):
+    def create(self, **kwargs):
         return tkinter.Text(self.root, **kwargs)
 
     def test_autoseparators(self):
@@ -623,16 +620,12 @@
 
     def test_bbox(self):
         widget = self.create()
-        bbox = widget.bbox('1.1')
-        self.assertEqual(len(bbox), 4)
-        for item in bbox:
-            self.assertIsInstance(item, int)
-
+        self.assertIsBoundingBox(widget.bbox('1.1'))
         self.assertIsNone(widget.bbox('end'))
         self.assertRaises(tkinter.TclError, widget.bbox, 'noindex')
         self.assertRaises(tkinter.TclError, widget.bbox, None)
-        self.assertRaises(tkinter.TclError, widget.bbox)
-        self.assertRaises(tkinter.TclError, widget.bbox, '1.1', 'end')
+        self.assertRaises(TypeError, widget.bbox)
+        self.assertRaises(TypeError, widget.bbox, '1.1', 'end')
 
 
 @add_standard_options(PixelSizeTests, StandardOptionsTests)
@@ -651,9 +644,9 @@
     )
 
     _conv_pixels = round
-    wantobjects = False
+    _stringify = True
 
-    def _create(self, **kwargs):
+    def create(self, **kwargs):
         return tkinter.Canvas(self.root, **kwargs)
 
     def test_closeenough(self):
@@ -706,7 +699,7 @@
         'takefocus', 'width', 'xscrollcommand', 'yscrollcommand',
     )
 
-    def _create(self, **kwargs):
+    def create(self, **kwargs):
         return tkinter.Listbox(self.root, **kwargs)
 
     def test_activestyle(self):
@@ -716,7 +709,7 @@
 
     def test_listvariable(self):
         widget = self.create()
-        var = tkinter.DoubleVar()
+        var = tkinter.DoubleVar(self.root)
         self.checkVariableParam(widget, 'listvariable', var)
 
     def test_selectmode(self):
@@ -730,6 +723,101 @@
         widget = self.create()
         self.checkEnumParam(widget, 'state', 'disabled', 'normal')
 
+    def test_itemconfigure(self):
+        widget = self.create()
+        with self.assertRaisesRegex(TclError, 'item number "0" out of range'):
+            widget.itemconfigure(0)
+        colors = 'red orange yellow green blue white violet'.split()
+        widget.insert('end', *colors)
+        for i, color in enumerate(colors):
+            widget.itemconfigure(i, background=color)
+        with self.assertRaises(TypeError):
+            widget.itemconfigure()
+        with self.assertRaisesRegex(TclError, 'bad listbox index "red"'):
+            widget.itemconfigure('red')
+        self.assertEqual(widget.itemconfigure(0, 'background'),
+                         ('background', 'background', 'Background', '', 'red'))
+        self.assertEqual(widget.itemconfigure('end', 'background'),
+                         ('background', 'background', 'Background', '', 'violet'))
+        self.assertEqual(widget.itemconfigure('@0,0', 'background'),
+                         ('background', 'background', 'Background', '', 'red'))
+
+        d = widget.itemconfigure(0)
+        self.assertIsInstance(d, dict)
+        for k, v in d.items():
+            self.assertIn(len(v), (2, 5))
+            if len(v) == 5:
+                self.assertEqual(v, widget.itemconfigure(0, k))
+                self.assertEqual(v[4], widget.itemcget(0, k))
+
+    def check_itemconfigure(self, name, value):
+        widget = self.create()
+        widget.insert('end', 'a', 'b', 'c', 'd')
+        widget.itemconfigure(0, **{name: value})
+        self.assertEqual(widget.itemconfigure(0, name)[4], value)
+        self.assertEqual(widget.itemcget(0, name), value)
+        with self.assertRaisesRegex(TclError, 'unknown color name "spam"'):
+            widget.itemconfigure(0, **{name: 'spam'})
+
+    def test_itemconfigure_background(self):
+        self.check_itemconfigure('background', '#ff0000')
+
+    def test_itemconfigure_bg(self):
+        self.check_itemconfigure('bg', '#ff0000')
+
+    def test_itemconfigure_fg(self):
+        self.check_itemconfigure('fg', '#110022')
+
+    def test_itemconfigure_foreground(self):
+        self.check_itemconfigure('foreground', '#110022')
+
+    def test_itemconfigure_selectbackground(self):
+        self.check_itemconfigure('selectbackground', '#110022')
+
+    def test_itemconfigure_selectforeground(self):
+        self.check_itemconfigure('selectforeground', '#654321')
+
+    def test_box(self):
+        lb = self.create()
+        lb.insert(0, *('el%d' % i for i in range(8)))
+        lb.pack()
+        self.assertIsBoundingBox(lb.bbox(0))
+        self.assertIsNone(lb.bbox(-1))
+        self.assertIsNone(lb.bbox(10))
+        self.assertRaises(TclError, lb.bbox, 'noindex')
+        self.assertRaises(TclError, lb.bbox, None)
+        self.assertRaises(TypeError, lb.bbox)
+        self.assertRaises(TypeError, lb.bbox, 0, 1)
+
+    def test_curselection(self):
+        lb = self.create()
+        lb.insert(0, *('el%d' % i for i in range(8)))
+        lb.selection_clear(0, tkinter.END)
+        lb.selection_set(2, 4)
+        lb.selection_set(6)
+        self.assertEqual(lb.curselection(), (2, 3, 4, 6))
+        self.assertRaises(TypeError, lb.curselection, 0)
+
+    def test_get(self):
+        lb = self.create()
+        lb.insert(0, *('el%d' % i for i in range(8)))
+        self.assertEqual(lb.get(0), 'el0')
+        self.assertEqual(lb.get(3), 'el3')
+        self.assertEqual(lb.get('end'), 'el7')
+        self.assertEqual(lb.get(8), '')
+        self.assertEqual(lb.get(-1), '')
+        self.assertEqual(lb.get(3, 5), ('el3', 'el4', 'el5'))
+        self.assertEqual(lb.get(5, 'end'), ('el5', 'el6', 'el7'))
+        self.assertEqual(lb.get(5, 0), ())
+        self.assertEqual(lb.get(0, 0), ('el0',))
+        self.assertRaises(TclError, lb.get, 'noindex')
+        self.assertRaises(TclError, lb.get, None)
+        self.assertRaises(TypeError, lb.get)
+        self.assertRaises(TclError, lb.get, 'end', 'noindex')
+        self.assertRaises(TypeError, lb.get, 1, 2, 3)
+        self.assertRaises(TclError, lb.get, 2.4)
+
+
 @add_standard_options(PixelSizeTests, StandardOptionsTests)
 class ScaleTest(AbstractWidgetTest, unittest.TestCase):
     OPTIONS = (
@@ -743,7 +831,7 @@
     )
     default_orient = 'vertical'
 
-    def _create(self, **kwargs):
+    def create(self, **kwargs):
         return tkinter.Scale(self.root, **kwargs)
 
     def test_bigincrement(self):
@@ -809,10 +897,10 @@
         'takefocus', 'troughcolor', 'width',
     )
     _conv_pixels = round
-    wantobjects = False
+    _stringify = True
     default_orient = 'vertical'
 
-    def _create(self, **kwargs):
+    def create(self, **kwargs):
         return tkinter.Scrollbar(self.root, **kwargs)
 
     def test_activerelief(self):
@@ -828,6 +916,24 @@
         self.checkEnumParam(widget, 'orient', 'vertical', 'horizontal',
                 errmsg='bad orientation "{}": must be vertical or horizontal')
 
+    def test_activate(self):
+        sb = self.create()
+        for e in ('arrow1', 'slider', 'arrow2'):
+            sb.activate(e)
+        sb.activate('')
+        self.assertRaises(TypeError, sb.activate)
+        self.assertRaises(TypeError, sb.activate, 'arrow1', 'arrow2')
+
+    def test_set(self):
+        sb = self.create()
+        sb.set(0.2, 0.4)
+        self.assertEqual(sb.get(), (0.2, 0.4))
+        self.assertRaises(TclError, sb.set, 'abc', 'def')
+        self.assertRaises(TclError, sb.set, 0.6, 'def')
+        self.assertRaises(TclError, sb.set, 0.6, None)
+        self.assertRaises(TclError, sb.set, 0.6)
+        self.assertRaises(TclError, sb.set, 0.6, 0.7, 0.8)
+
 
 @add_standard_options(StandardOptionsTests)
 class PanedWindowTest(AbstractWidgetTest, unittest.TestCase):
@@ -840,7 +946,7 @@
     )
     default_orient = 'horizontal'
 
-    def _create(self, **kwargs):
+    def create(self, **kwargs):
         return tkinter.PanedWindow(self.root, **kwargs)
 
     def test_handlepad(self):
@@ -887,6 +993,105 @@
         self.checkPixelsParam(widget, 'width', 402, 403.4, 404.6, -402, 0, '5i',
                               conv=noconv)
 
+    def create2(self):
+        p = self.create()
+        b = tkinter.Button(p)
+        c = tkinter.Button(p)
+        p.add(b)
+        p.add(c)
+        return p, b, c
+
+    def test_paneconfigure(self):
+        p, b, c = self.create2()
+        self.assertRaises(TypeError, p.paneconfigure)
+        d = p.paneconfigure(b)
+        self.assertIsInstance(d, dict)
+        for k, v in d.items():
+            self.assertEqual(len(v), 5)
+            self.assertEqual(v, p.paneconfigure(b, k))
+            self.assertEqual(v[4], p.panecget(b, k))
+
+    def check_paneconfigure(self, p, b, name, value, expected, stringify=False):
+        conv = lambda x: x
+        if not self.wantobjects or stringify:
+            expected = str(expected)
+        if self.wantobjects and stringify:
+            conv = str
+        p.paneconfigure(b, **{name: value})
+        self.assertEqual(conv(p.paneconfigure(b, name)[4]), expected)
+        self.assertEqual(conv(p.panecget(b, name)), expected)
+
+    def check_paneconfigure_bad(self, p, b, name, msg):
+        with self.assertRaisesRegex(TclError, msg):
+            p.paneconfigure(b, **{name: 'badValue'})
+
+    def test_paneconfigure_after(self):
+        p, b, c = self.create2()
+        self.check_paneconfigure(p, b, 'after', c, str(c))
+        self.check_paneconfigure_bad(p, b, 'after',
+                                     'bad window path name "badValue"')
+
+    def test_paneconfigure_before(self):
+        p, b, c = self.create2()
+        self.check_paneconfigure(p, b, 'before', c, str(c))
+        self.check_paneconfigure_bad(p, b, 'before',
+                                     'bad window path name "badValue"')
+
+    def test_paneconfigure_height(self):
+        p, b, c = self.create2()
+        self.check_paneconfigure(p, b, 'height', 10, 10,
+                                 stringify=tcl_version < (8, 5))
+        self.check_paneconfigure_bad(p, b, 'height',
+                                     'bad screen distance "badValue"')
+
+    @requires_tcl(8, 5)
+    def test_paneconfigure_hide(self):
+        p, b, c = self.create2()
+        self.check_paneconfigure(p, b, 'hide', False, 0)
+        self.check_paneconfigure_bad(p, b, 'hide',
+                                     'expected boolean value but got "badValue"')
+
+    def test_paneconfigure_minsize(self):
+        p, b, c = self.create2()
+        self.check_paneconfigure(p, b, 'minsize', 10, 10)
+        self.check_paneconfigure_bad(p, b, 'minsize',
+                                     'bad screen distance "badValue"')
+
+    def test_paneconfigure_padx(self):
+        p, b, c = self.create2()
+        self.check_paneconfigure(p, b, 'padx', 1.3, 1)
+        self.check_paneconfigure_bad(p, b, 'padx',
+                                     'bad screen distance "badValue"')
+
+    def test_paneconfigure_pady(self):
+        p, b, c = self.create2()
+        self.check_paneconfigure(p, b, 'pady', 1.3, 1)
+        self.check_paneconfigure_bad(p, b, 'pady',
+                                     'bad screen distance "badValue"')
+
+    def test_paneconfigure_sticky(self):
+        p, b, c = self.create2()
+        self.check_paneconfigure(p, b, 'sticky', 'nsew', 'nesw')
+        self.check_paneconfigure_bad(p, b, 'sticky',
+                                     'bad stickyness value "badValue": must '
+                                     'be a string containing zero or more of '
+                                     'n, e, s, and w')
+
+    @requires_tcl(8, 5)
+    def test_paneconfigure_stretch(self):
+        p, b, c = self.create2()
+        self.check_paneconfigure(p, b, 'stretch', 'alw', 'always')
+        self.check_paneconfigure_bad(p, b, 'stretch',
+                                     'bad stretch "badValue": must be '
+                                     'always, first, last, middle, or never')
+
+    def test_paneconfigure_width(self):
+        p, b, c = self.create2()
+        self.check_paneconfigure(p, b, 'width', 10, 10,
+                                 stringify=tcl_version < (8, 5))
+        self.check_paneconfigure_bad(p, b, 'width',
+                                     'bad screen distance "badValue"')
+
 
 @add_standard_options(StandardOptionsTests)
 class MenuTest(AbstractWidgetTest, unittest.TestCase):
@@ -899,7 +1104,7 @@
     )
     _conv_pixels = noconv
 
-    def _create(self, **kwargs):
+    def create(self, **kwargs):
         return tkinter.Menu(self.root, **kwargs)
 
     def test_postcommand(self):
@@ -923,6 +1128,39 @@
         self.checkEnumParam(widget, 'type',
                 'normal', 'tearoff', 'menubar')
 
+    def test_entryconfigure(self):
+        m1 = self.create()
+        m1.add_command(label='test')
+        self.assertRaises(TypeError, m1.entryconfigure)
+        with self.assertRaisesRegex(TclError, 'bad menu entry index "foo"'):
+            m1.entryconfigure('foo')
+        d = m1.entryconfigure(1)
+        self.assertIsInstance(d, dict)
+        for k, v in d.items():
+            self.assertIsInstance(k, str)
+            self.assertIsInstance(v, tuple)
+            self.assertEqual(len(v), 5)
+            self.assertEqual(v[0], k)
+            self.assertEqual(m1.entrycget(1, k), v[4])
+        m1.destroy()
+
+    def test_entryconfigure_label(self):
+        m1 = self.create()
+        m1.add_command(label='test')
+        self.assertEqual(m1.entrycget(1, 'label'), 'test')
+        m1.entryconfigure(1, label='changed')
+        self.assertEqual(m1.entrycget(1, 'label'), 'changed')
+
+    def test_entryconfigure_variable(self):
+        m1 = self.create()
+        v1 = tkinter.BooleanVar(self.root)
+        v2 = tkinter.BooleanVar(self.root)
+        m1.add_checkbutton(variable=v1, onvalue=True, offvalue=False,
+                           label='Nonsense')
+        self.assertEqual(str(m1.entrycget(1, 'variable')), str(v1))
+        m1.entryconfigure(1, variable=v2)
+        self.assertEqual(str(m1.entrycget(1, 'variable')), str(v2))
+
 
 @add_standard_options(PixelSizeTests, StandardOptionsTests)
 class MessageTest(AbstractWidgetTest, unittest.TestCase):
@@ -935,7 +1173,7 @@
     )
     _conv_pad_pixels = noconv
 
-    def _create(self, **kwargs):
+    def create(self, **kwargs):
         return tkinter.Message(self.root, **kwargs)
 
     def test_aspect(self):
diff --git a/Lib/tkinter/test/test_ttk/test_extensions.py b/Lib/tkinter/test/test_ttk/test_extensions.py
index d699546..c3af06c 100644
--- a/Lib/tkinter/test/test_ttk/test_extensions.py
+++ b/Lib/tkinter/test/test_ttk/test_extensions.py
@@ -2,34 +2,30 @@
 import unittest
 import tkinter
 from tkinter import ttk
-from test.support import requires, run_unittest
-
-import tkinter.test.support as support
+from test.support import requires, run_unittest, swap_attr
+from tkinter.test.support import AbstractTkTest, destroy_default_root
 
 requires('gui')
 
-class LabeledScaleTest(unittest.TestCase):
-
-    def setUp(self):
-        support.root_deiconify()
+class LabeledScaleTest(AbstractTkTest, unittest.TestCase):
 
     def tearDown(self):
-        support.root_withdraw()
-
+        self.root.update_idletasks()
+        super().tearDown()
 
     def test_widget_destroy(self):
         # automatically created variable
-        x = ttk.LabeledScale()
+        x = ttk.LabeledScale(self.root)
         var = x._variable._name
         x.destroy()
         self.assertRaises(tkinter.TclError, x.tk.globalgetvar, var)
 
         # manually created variable
-        myvar = tkinter.DoubleVar()
+        myvar = tkinter.DoubleVar(self.root)
         name = myvar._name
-        x = ttk.LabeledScale(variable=myvar)
+        x = ttk.LabeledScale(self.root, variable=myvar)
         x.destroy()
-        if x.tk.wantobjects():
+        if self.wantobjects:
             self.assertEqual(x.tk.globalgetvar(name), myvar.get())
         else:
             self.assertEqual(float(x.tk.globalgetvar(name)), myvar.get())
@@ -37,26 +33,36 @@
         self.assertRaises(tkinter.TclError, x.tk.globalgetvar, name)
 
         # checking that the tracing callback is properly removed
-        myvar = tkinter.IntVar()
+        myvar = tkinter.IntVar(self.root)
         # LabeledScale will start tracing myvar
-        x = ttk.LabeledScale(variable=myvar)
+        x = ttk.LabeledScale(self.root, variable=myvar)
         x.destroy()
         # Unless the tracing callback was removed, creating a new
         # LabeledScale with the same var will cause an error now. This
         # happens because the variable will be set to (possibly) a new
         # value which causes the tracing callback to be called and then
         # it tries calling instance attributes not yet defined.
-        ttk.LabeledScale(variable=myvar)
+        ttk.LabeledScale(self.root, variable=myvar)
         if hasattr(sys, 'last_type'):
             self.assertNotEqual(sys.last_type, tkinter.TclError)
 
 
+    def test_initialization_no_master(self):
+        # no master passing
+        with swap_attr(tkinter, '_default_root', None), \
+             swap_attr(tkinter, '_support_default_root', True):
+            try:
+                x = ttk.LabeledScale()
+                self.assertIsNotNone(tkinter._default_root)
+                self.assertEqual(x.master, tkinter._default_root)
+                self.assertEqual(x.tk, tkinter._default_root.tk)
+                x.destroy()
+            finally:
+                destroy_default_root()
+
     def test_initialization(self):
         # master passing
-        x = ttk.LabeledScale()
-        self.assertEqual(x.master, tkinter._default_root)
-        x.destroy()
-        master = tkinter.Frame()
+        master = tkinter.Frame(self.root)
         x = ttk.LabeledScale(master)
         self.assertEqual(x.master, master)
         x.destroy()
@@ -64,25 +70,25 @@
         # variable initialization/passing
         passed_expected = (('0', 0), (0, 0), (10, 10),
             (-1, -1), (sys.maxsize + 1, sys.maxsize + 1))
-        if x.tk.wantobjects():
+        if self.wantobjects:
             passed_expected += ((2.5, 2),)
         for pair in passed_expected:
-            x = ttk.LabeledScale(from_=pair[0])
+            x = ttk.LabeledScale(self.root, from_=pair[0])
             self.assertEqual(x.value, pair[1])
             x.destroy()
-        x = ttk.LabeledScale(from_='2.5')
+        x = ttk.LabeledScale(self.root, from_='2.5')
         self.assertRaises(ValueError, x._variable.get)
         x.destroy()
-        x = ttk.LabeledScale(from_=None)
+        x = ttk.LabeledScale(self.root, from_=None)
         self.assertRaises(ValueError, x._variable.get)
         x.destroy()
         # variable should have its default value set to the from_ value
-        myvar = tkinter.DoubleVar(value=20)
-        x = ttk.LabeledScale(variable=myvar)
+        myvar = tkinter.DoubleVar(self.root, value=20)
+        x = ttk.LabeledScale(self.root, variable=myvar)
         self.assertEqual(x.value, 0)
         x.destroy()
         # check that it is really using a DoubleVar
-        x = ttk.LabeledScale(variable=myvar, from_=0.5)
+        x = ttk.LabeledScale(self.root, variable=myvar, from_=0.5)
         self.assertEqual(x.value, 0.5)
         self.assertEqual(x._variable._name, myvar._name)
         x.destroy()
@@ -91,25 +97,26 @@
         def check_positions(scale, scale_pos, label, label_pos):
             self.assertEqual(scale.pack_info()['side'], scale_pos)
             self.assertEqual(label.place_info()['anchor'], label_pos)
-        x = ttk.LabeledScale(compound='top')
+        x = ttk.LabeledScale(self.root, compound='top')
         check_positions(x.scale, 'bottom', x.label, 'n')
         x.destroy()
-        x = ttk.LabeledScale(compound='bottom')
+        x = ttk.LabeledScale(self.root, compound='bottom')
         check_positions(x.scale, 'top', x.label, 's')
         x.destroy()
-        x = ttk.LabeledScale(compound='unknown') # invert default positions
+        # invert default positions
+        x = ttk.LabeledScale(self.root, compound='unknown')
         check_positions(x.scale, 'top', x.label, 's')
         x.destroy()
-        x = ttk.LabeledScale() # take default positions
+        x = ttk.LabeledScale(self.root) # take default positions
         check_positions(x.scale, 'bottom', x.label, 'n')
         x.destroy()
 
         # extra, and invalid, kwargs
-        self.assertRaises(tkinter.TclError, ttk.LabeledScale, a='b')
+        self.assertRaises(tkinter.TclError, ttk.LabeledScale, master, a='b')
 
 
     def test_horizontal_range(self):
-        lscale = ttk.LabeledScale(from_=0, to=10)
+        lscale = ttk.LabeledScale(self.root, from_=0, to=10)
         lscale.pack()
         lscale.wait_visibility()
         lscale.update()
@@ -128,7 +135,7 @@
         self.assertNotEqual(prev_xcoord, curr_xcoord)
         # the label widget should have been repositioned too
         linfo_2 = lscale.label.place_info()
-        self.assertEqual(lscale.label['text'], 0 if lscale.tk.wantobjects() else '0')
+        self.assertEqual(lscale.label['text'], 0 if self.wantobjects else '0')
         self.assertEqual(curr_xcoord, int(linfo_2['x']))
         # change the range back
         lscale.scale.configure(from_=0, to=10)
@@ -139,7 +146,7 @@
 
 
     def test_variable_change(self):
-        x = ttk.LabeledScale()
+        x = ttk.LabeledScale(self.root)
         x.pack()
         x.wait_visibility()
         x.update()
@@ -151,13 +158,13 @@
         # at the same time this shouldn't affect test outcome
         x.update()
         self.assertEqual(x.label['text'],
-                         newval if x.tk.wantobjects() else str(newval))
+                         newval if self.wantobjects else str(newval))
         self.assertGreater(x.scale.coords()[0], curr_xcoord)
         self.assertEqual(x.scale.coords()[0],
             int(x.label.place_info()['x']))
 
         # value outside range
-        if x.tk.wantobjects():
+        if self.wantobjects:
             conv = lambda x: x
         else:
             conv = int
@@ -171,7 +178,7 @@
 
 
     def test_resize(self):
-        x = ttk.LabeledScale()
+        x = ttk.LabeledScale(self.root)
         x.pack(expand=True, fill='both')
         x.wait_visibility()
         x.update()
@@ -190,20 +197,20 @@
         x.destroy()
 
 
-class OptionMenuTest(unittest.TestCase):
+class OptionMenuTest(AbstractTkTest, unittest.TestCase):
 
     def setUp(self):
-        support.root_deiconify()
-        self.textvar = tkinter.StringVar()
+        super().setUp()
+        self.textvar = tkinter.StringVar(self.root)
 
     def tearDown(self):
         del self.textvar
-        support.root_withdraw()
+        super().tearDown()
 
 
     def test_widget_destroy(self):
-        var = tkinter.StringVar()
-        optmenu = ttk.OptionMenu(None, var)
+        var = tkinter.StringVar(self.root)
+        optmenu = ttk.OptionMenu(self.root, var)
         name = var._name
         optmenu.update_idletasks()
         optmenu.destroy()
@@ -214,9 +221,9 @@
 
     def test_initialization(self):
         self.assertRaises(tkinter.TclError,
-            ttk.OptionMenu, None, self.textvar, invalid='thing')
+            ttk.OptionMenu, self.root, self.textvar, invalid='thing')
 
-        optmenu = ttk.OptionMenu(None, self.textvar, 'b', 'a', 'b')
+        optmenu = ttk.OptionMenu(self.root, self.textvar, 'b', 'a', 'b')
         self.assertEqual(optmenu._variable.get(), 'b')
 
         self.assertTrue(optmenu['menu'])
@@ -228,7 +235,7 @@
     def test_menu(self):
         items = ('a', 'b', 'c')
         default = 'a'
-        optmenu = ttk.OptionMenu(None, self.textvar, default, *items)
+        optmenu = ttk.OptionMenu(self.root, self.textvar, default, *items)
         found_default = False
         for i in range(len(items)):
             value = optmenu['menu'].entrycget(i, 'value')
@@ -240,7 +247,7 @@
 
         # default shouldn't be in menu if it is not part of values
         default = 'd'
-        optmenu = ttk.OptionMenu(None, self.textvar, default, *items)
+        optmenu = ttk.OptionMenu(self.root, self.textvar, default, *items)
         curr = None
         i = 0
         while True:
@@ -269,7 +276,7 @@
         def cb_test(item):
             self.assertEqual(item, items[1])
             success.append(True)
-        optmenu = ttk.OptionMenu(None, self.textvar, 'a', command=cb_test,
+        optmenu = ttk.OptionMenu(self.root, self.textvar, 'a', command=cb_test,
             *items)
         optmenu['menu'].invoke(1)
         if not success:
diff --git a/Lib/tkinter/test/test_ttk/test_functions.py b/Lib/tkinter/test/test_ttk/test_functions.py
index 1986e66..c9dcf97 100644
--- a/Lib/tkinter/test/test_ttk/test_functions.py
+++ b/Lib/tkinter/test/test_ttk/test_functions.py
@@ -1,7 +1,19 @@
 # -*- encoding: utf-8 -*-
 import unittest
+import tkinter
 from tkinter import ttk
 
+class MockTkApp:
+
+    def splitlist(self, arg):
+        if isinstance(arg, tuple):
+            return arg
+        return arg.split(':')
+
+    def wantobjects(self):
+        return True
+
+
 class MockTclObj(object):
     typename = 'test'
 
@@ -312,26 +324,13 @@
             "-opt {3 2m}")
 
 
-    def test_dict_from_tcltuple(self):
-        fakettuple = ('-a', '{1 2 3}', '-something', 'foo')
-
-        self.assertEqual(ttk._dict_from_tcltuple(fakettuple, False),
-            {'-a': '{1 2 3}', '-something': 'foo'})
-
-        self.assertEqual(ttk._dict_from_tcltuple(fakettuple),
-            {'a': '{1 2 3}', 'something': 'foo'})
-
-        # passing a tuple with a single item should return an empty dict,
-        # since it tries to break the tuple by pairs.
-        self.assertFalse(ttk._dict_from_tcltuple(('single', )))
-
-        sspec = MockStateSpec('a', 'b')
-        self.assertEqual(ttk._dict_from_tcltuple(('-a', (sspec, 'val'))),
-            {'a': [('a', 'b', 'val')]})
-
-        self.assertEqual(ttk._dict_from_tcltuple((MockTclObj('-padding'),
-            [MockTclObj('1'), 2, MockTclObj('3m')])),
-            {'padding': [1, 2, '3m']})
+    def test_tclobj_to_py(self):
+        self.assertEqual(
+            ttk._tclobj_to_py((MockStateSpec('a', 'b'), 'val')),
+            [('a', 'b', 'val')])
+        self.assertEqual(
+            ttk._tclobj_to_py([MockTclObj('1'), 2, MockTclObj('3m')]),
+            [1, 2, '3m'])
 
 
     def test_list_from_statespec(self):
@@ -352,20 +351,22 @@
 
 
     def test_list_from_layouttuple(self):
+        tk = MockTkApp()
+
         # empty layout tuple
-        self.assertFalse(ttk._list_from_layouttuple(()))
+        self.assertFalse(ttk._list_from_layouttuple(tk, ()))
 
         # shortest layout tuple
-        self.assertEqual(ttk._list_from_layouttuple(('name', )),
+        self.assertEqual(ttk._list_from_layouttuple(tk, ('name', )),
             [('name', {})])
 
         # not so interesting ltuple
         sample_ltuple = ('name', '-option', 'value')
-        self.assertEqual(ttk._list_from_layouttuple(sample_ltuple),
+        self.assertEqual(ttk._list_from_layouttuple(tk, sample_ltuple),
             [('name', {'option': 'value'})])
 
         # empty children
-        self.assertEqual(ttk._list_from_layouttuple(
+        self.assertEqual(ttk._list_from_layouttuple(tk,
             ('something', '-children', ())),
             [('something', {'children': []})]
         )
@@ -378,7 +379,7 @@
                 )
             )
         )
-        self.assertEqual(ttk._list_from_layouttuple(ltuple),
+        self.assertEqual(ttk._list_from_layouttuple(tk, ltuple),
             [('name', {'option': 'niceone', 'children':
                 [('otherone', {'otheropt': 'othervalue', 'children':
                     [('child', {})]
@@ -387,29 +388,35 @@
         )
 
         # bad tuples
-        self.assertRaises(ValueError, ttk._list_from_layouttuple,
+        self.assertRaises(ValueError, ttk._list_from_layouttuple, tk,
             ('name', 'no_minus'))
-        self.assertRaises(ValueError, ttk._list_from_layouttuple,
+        self.assertRaises(ValueError, ttk._list_from_layouttuple, tk,
             ('name', 'no_minus', 'value'))
-        self.assertRaises(ValueError, ttk._list_from_layouttuple,
+        self.assertRaises(ValueError, ttk._list_from_layouttuple, tk,
             ('something', '-children')) # no children
-        import tkinter
-        if not tkinter._default_root or tkinter._default_root.wantobjects():
-            self.assertRaises(ValueError, ttk._list_from_layouttuple,
-                ('something', '-children', 'value')) # invalid children
 
 
     def test_val_or_dict(self):
-        def func(opt, val=None):
+        def func(res, opt=None, val=None):
+            if opt is None:
+                return res
             if val is None:
                 return "test val"
             return (opt, val)
 
-        options = {'test': None}
-        self.assertEqual(ttk._val_or_dict(options, func), "test val")
+        tk = MockTkApp()
+        tk.call = func
 
-        options = {'test': 3}
-        self.assertEqual(ttk._val_or_dict(options, func), options)
+        self.assertEqual(ttk._val_or_dict(tk, {}, '-test:3'),
+                         {'test': '3'})
+        self.assertEqual(ttk._val_or_dict(tk, {}, ('-test', 3)),
+                         {'test': 3})
+
+        self.assertEqual(ttk._val_or_dict(tk, {'test': None}, 'x:y'),
+                         'test val')
+
+        self.assertEqual(ttk._val_or_dict(tk, {'test': 3}, 'x:y'),
+                         {'test': 3})
 
 
     def test_convert_stringval(self):
diff --git a/Lib/tkinter/test/test_ttk/test_style.py b/Lib/tkinter/test/test_ttk/test_style.py
index 0da0e5d..3537536 100644
--- a/Lib/tkinter/test/test_ttk/test_style.py
+++ b/Lib/tkinter/test/test_ttk/test_style.py
@@ -2,15 +2,15 @@
 import tkinter
 from tkinter import ttk
 from test.support import requires, run_unittest
-
-import tkinter.test.support as support
+from tkinter.test.support import AbstractTkTest
 
 requires('gui')
 
-class StyleTest(unittest.TestCase):
+class StyleTest(AbstractTkTest, unittest.TestCase):
 
     def setUp(self):
-        self.style = ttk.Style()
+        super().setUp()
+        self.style = ttk.Style(self.root)
 
 
     def test_configure(self):
@@ -25,7 +25,7 @@
         style = self.style
         style.map('TButton', background=[('active', 'background', 'blue')])
         self.assertEqual(style.map('TButton', 'background'),
-            [('active', 'background', 'blue')] if style.tk.wantobjects() else
+            [('active', 'background', 'blue')] if self.wantobjects else
             [('active background', 'blue')])
         self.assertIsInstance(style.map('TButton'), dict)
 
diff --git a/Lib/tkinter/test/test_ttk/test_widgets.py b/Lib/tkinter/test/test_ttk/test_widgets.py
index 3ac14be..8a27324 100644
--- a/Lib/tkinter/test/test_ttk/test_widgets.py
+++ b/Lib/tkinter/test/test_ttk/test_widgets.py
@@ -1,12 +1,12 @@
 import unittest
 import tkinter
-from tkinter import ttk
+from tkinter import ttk, TclError
 from test.support import requires
 import sys
 
-import tkinter.test.support as support
 from tkinter.test.test_ttk.test_functions import MockTclObj
-from tkinter.test.support import tcl_version, get_tk_patchlevel
+from tkinter.test.support import (AbstractTkTest, tcl_version, get_tk_patchlevel,
+                                  simulate_mouse_click)
 from tkinter.test.widget_tests import (add_standard_options, noconv,
     AbstractWidgetTest, StandardOptionsTests, IntegerSizeTests, PixelSizeTests,
     setUpModule)
@@ -53,19 +53,15 @@
         pass
 
 
-class WidgetTest(unittest.TestCase):
+class WidgetTest(AbstractTkTest, unittest.TestCase):
     """Tests methods available in every ttk widget."""
 
     def setUp(self):
-        support.root_deiconify()
-        self.widget = ttk.Button(width=0, text="Text")
+        super().setUp()
+        self.widget = ttk.Button(self.root, width=0, text="Text")
         self.widget.pack()
         self.widget.wait_visibility()
 
-    def tearDown(self):
-        self.widget.destroy()
-        support.root_withdraw()
-
 
     def test_identify(self):
         self.widget.update_idletasks()
@@ -128,7 +124,7 @@
         'width',
     )
 
-    def _create(self, **kwargs):
+    def create(self, **kwargs):
         return ttk.Frame(self.root, **kwargs)
 
 
@@ -141,7 +137,7 @@
         'text', 'underline', 'width',
     )
 
-    def _create(self, **kwargs):
+    def create(self, **kwargs):
         return ttk.LabelFrame(self.root, **kwargs)
 
     def test_labelanchor(self):
@@ -161,8 +157,8 @@
 class AbstractLabelTest(AbstractWidgetTest):
 
     def checkImageParam(self, widget, name):
-        image = tkinter.PhotoImage('image1')
-        image2 = tkinter.PhotoImage('image2')
+        image = tkinter.PhotoImage(master=self.root, name='image1')
+        image2 = tkinter.PhotoImage(master=self.root, name='image2')
         self.checkParam(widget, name, image, expected=('image1',))
         self.checkParam(widget, name, 'image1', expected=('image1',))
         self.checkParam(widget, name, (image,), expected=('image1',))
@@ -199,7 +195,7 @@
     )
     _conv_pixels = noconv
 
-    def _create(self, **kwargs):
+    def create(self, **kwargs):
         return ttk.Label(self.root, **kwargs)
 
     def test_font(self):
@@ -216,7 +212,7 @@
         'underline', 'width',
     )
 
-    def _create(self, **kwargs):
+    def create(self, **kwargs):
         return ttk.Button(self.root, **kwargs)
 
     def test_default(self):
@@ -225,7 +221,7 @@
 
     def test_invoke(self):
         success = []
-        btn = ttk.Button(command=lambda: success.append(1))
+        btn = ttk.Button(self.root, command=lambda: success.append(1))
         btn.invoke()
         self.assertTrue(success)
 
@@ -241,7 +237,7 @@
         'underline', 'variable', 'width',
     )
 
-    def _create(self, **kwargs):
+    def create(self, **kwargs):
         return ttk.Checkbutton(self.root, **kwargs)
 
     def test_offvalue(self):
@@ -258,7 +254,7 @@
             success.append(1)
             return "cb test called"
 
-        cbtn = ttk.Checkbutton(command=cb_test)
+        cbtn = ttk.Checkbutton(self.root, command=cb_test)
         # the variable automatically created by ttk.Checkbutton is actually
         # undefined till we invoke the Checkbutton
         self.assertEqual(cbtn.state(), ('alternate', ))
@@ -289,15 +285,9 @@
 
     def setUp(self):
         super().setUp()
-        support.root_deiconify()
         self.combo = self.create()
 
-    def tearDown(self):
-        self.combo.destroy()
-        support.root_withdraw()
-        super().tearDown()
-
-    def _create(self, **kwargs):
+    def create(self, **kwargs):
         return ttk.Combobox(self.root, **kwargs)
 
     def test_height(self):
@@ -405,7 +395,7 @@
         self.assertRaises(tkinter.TclError, self.combo.current, '')
 
         # testing creating combobox with empty string in values
-        combo2 = ttk.Combobox(values=[1, 2, ''])
+        combo2 = ttk.Combobox(self.root, values=[1, 2, ''])
         self.assertEqual(combo2['values'],
                          ('1', '2', '') if self.wantobjects else '1 2 {}')
         combo2.destroy()
@@ -423,15 +413,9 @@
 
     def setUp(self):
         super().setUp()
-        support.root_deiconify()
         self.entry = self.create()
 
-    def tearDown(self):
-        self.entry.destroy()
-        support.root_withdraw()
-        super().tearDown()
-
-    def _create(self, **kwargs):
+    def create(self, **kwargs):
         return ttk.Entry(self.root, **kwargs)
 
     def test_invalidcommand(self):
@@ -460,10 +444,7 @@
 
 
     def test_bbox(self):
-        self.assertEqual(len(self.entry.bbox(0)), 4)
-        for item in self.entry.bbox(0):
-            self.assertIsInstance(item, int)
-
+        self.assertIsBoundingBox(self.entry.bbox(0))
         self.assertRaises(tkinter.TclError, self.entry.bbox, 'noindex')
         self.assertRaises(tkinter.TclError, self.entry.bbox, None)
 
@@ -561,15 +542,9 @@
 
     def setUp(self):
         super().setUp()
-        support.root_deiconify()
         self.paned = self.create()
 
-    def tearDown(self):
-        self.paned.destroy()
-        support.root_withdraw()
-        super().tearDown()
-
-    def _create(self, **kwargs):
+    def create(self, **kwargs):
         return ttk.PanedWindow(self.root, **kwargs)
 
     def test_orient(self):
@@ -591,13 +566,13 @@
         label.destroy()
         child.destroy()
         # another attempt
-        label = ttk.Label()
+        label = ttk.Label(self.root)
         child = ttk.Label(label)
         self.assertRaises(tkinter.TclError, self.paned.add, child)
         child.destroy()
         label.destroy()
 
-        good_child = ttk.Label()
+        good_child = ttk.Label(self.root)
         self.paned.add(good_child)
         # re-adding a child is not accepted
         self.assertRaises(tkinter.TclError, self.paned.add, good_child)
@@ -615,7 +590,7 @@
         self.assertRaises(tkinter.TclError, self.paned.forget, None)
         self.assertRaises(tkinter.TclError, self.paned.forget, 0)
 
-        self.paned.add(ttk.Label())
+        self.paned.add(ttk.Label(self.root))
         self.paned.forget(0)
         self.assertRaises(tkinter.TclError, self.paned.forget, 0)
 
@@ -625,9 +600,9 @@
         self.assertRaises(tkinter.TclError, self.paned.insert, 0, None)
         self.assertRaises(tkinter.TclError, self.paned.insert, 0, 0)
 
-        child = ttk.Label()
-        child2 = ttk.Label()
-        child3 = ttk.Label()
+        child = ttk.Label(self.root)
+        child2 = ttk.Label(self.root)
+        child3 = ttk.Label(self.root)
 
         self.assertRaises(tkinter.TclError, self.paned.insert, 0, child)
 
@@ -658,7 +633,7 @@
     def test_pane(self):
         self.assertRaises(tkinter.TclError, self.paned.pane, 0)
 
-        child = ttk.Label()
+        child = ttk.Label(self.root)
         self.paned.add(child)
         self.assertIsInstance(self.paned.pane(0), dict)
         self.assertEqual(self.paned.pane(0, weight=None),
@@ -703,7 +678,7 @@
         'underline', 'value', 'variable', 'width',
     )
 
-    def _create(self, **kwargs):
+    def create(self, **kwargs):
         return ttk.Radiobutton(self.root, **kwargs)
 
     def test_value(self):
@@ -716,9 +691,11 @@
             success.append(1)
             return "cb test called"
 
-        myvar = tkinter.IntVar()
-        cbtn = ttk.Radiobutton(command=cb_test, variable=myvar, value=0)
-        cbtn2 = ttk.Radiobutton(command=cb_test, variable=myvar, value=1)
+        myvar = tkinter.IntVar(self.root)
+        cbtn = ttk.Radiobutton(self.root, command=cb_test,
+                               variable=myvar, value=0)
+        cbtn2 = ttk.Radiobutton(self.root, command=cb_test,
+                                variable=myvar, value=1)
 
         if self.wantobjects:
             conv = lambda x: x
@@ -751,7 +728,7 @@
         'underline', 'width',
     )
 
-    def _create(self, **kwargs):
+    def create(self, **kwargs):
         return ttk.Menubutton(self.root, **kwargs)
 
     def test_direction(self):
@@ -777,17 +754,11 @@
 
     def setUp(self):
         super().setUp()
-        support.root_deiconify()
         self.scale = self.create()
         self.scale.pack()
         self.scale.update()
 
-    def tearDown(self):
-        self.scale.destroy()
-        support.root_withdraw()
-        super().tearDown()
-
-    def _create(self, **kwargs):
+    def create(self, **kwargs):
         return ttk.Scale(self.root, **kwargs)
 
     def test_from(self):
@@ -859,7 +830,7 @@
         self.assertEqual(conv(self.scale.get()), min)
 
         # changing directly the variable doesn't impose this limitation tho
-        var = tkinter.DoubleVar()
+        var = tkinter.DoubleVar(self.root)
         self.scale['variable'] = var
         var.set(max + 5)
         self.assertEqual(conv(self.scale.get()), var.get())
@@ -889,7 +860,7 @@
     _conv_pixels = noconv
     default_orient = 'horizontal'
 
-    def _create(self, **kwargs):
+    def create(self, **kwargs):
         return ttk.Progressbar(self.root, **kwargs)
 
     def test_length(self):
@@ -923,7 +894,7 @@
     )
     default_orient = 'vertical'
 
-    def _create(self, **kwargs):
+    def create(self, **kwargs):
         return ttk.Scrollbar(self.root, **kwargs)
 
 
@@ -935,21 +906,13 @@
 
     def setUp(self):
         super().setUp()
-        support.root_deiconify()
         self.nb = self.create(padding=0)
-        self.child1 = ttk.Label()
-        self.child2 = ttk.Label()
+        self.child1 = ttk.Label(self.root)
+        self.child2 = ttk.Label(self.root)
         self.nb.add(self.child1, text='a')
         self.nb.add(self.child2, text='b')
 
-    def tearDown(self):
-        self.child1.destroy()
-        self.child2.destroy()
-        self.nb.destroy()
-        support.root_withdraw()
-        super().tearDown()
-
-    def _create(self, **kwargs):
+    def create(self, **kwargs):
         return ttk.Notebook(self.root, **kwargs)
 
     def test_tab_identifiers(self):
@@ -988,7 +951,7 @@
         self.assertRaises(tkinter.TclError, self.nb.hide, 'hi')
         self.assertRaises(tkinter.TclError, self.nb.hide, None)
         self.assertRaises(tkinter.TclError, self.nb.add, None)
-        self.assertRaises(tkinter.TclError, self.nb.add, ttk.Label(),
+        self.assertRaises(tkinter.TclError, self.nb.add, ttk.Label(self.root),
             unknown='option')
 
         tabs = self.nb.tabs()
@@ -996,7 +959,7 @@
         self.nb.add(self.child1)
         self.assertEqual(self.nb.tabs(), tabs)
 
-        child = ttk.Label()
+        child = ttk.Label(self.root)
         self.nb.add(child, text='c')
         tabs = self.nb.tabs()
 
@@ -1054,7 +1017,7 @@
         self.assertRaises(tkinter.TclError, self.nb.insert, -1, tabs[0])
 
         # new tab
-        child3 = ttk.Label()
+        child3 = ttk.Label(self.root)
         self.nb.insert(1, child3)
         self.assertEqual(self.nb.tabs(), (tabs[0], str(child3), tabs[1]))
         self.nb.forget(child3)
@@ -1120,7 +1083,7 @@
 
         self.nb.select(0)
 
-        support.simulate_mouse_click(self.nb, 5, 5)
+        simulate_mouse_click(self.nb, 5, 5)
         self.nb.focus_force()
         self.nb.event_generate('<Control-Tab>')
         self.assertEqual(self.nb.select(), str(self.child2))
@@ -1134,7 +1097,7 @@
         self.nb.tab(self.child1, text='a', underline=0)
         self.nb.enable_traversal()
         self.nb.focus_force()
-        support.simulate_mouse_click(self.nb, 5, 5)
+        simulate_mouse_click(self.nb, 5, 5)
         if sys.platform == 'darwin':
             self.nb.event_generate('<Option-a>')
         else:
@@ -1152,15 +1115,9 @@
 
     def setUp(self):
         super().setUp()
-        support.root_deiconify()
         self.tv = self.create(padding=0)
 
-    def tearDown(self):
-        self.tv.destroy()
-        support.root_withdraw()
-        super().tearDown()
-
-    def _create(self, **kwargs):
+    def create(self, **kwargs):
         return ttk.Treeview(self.root, **kwargs)
 
     def test_columns(self):
@@ -1216,12 +1173,7 @@
         self.assertTrue(children)
 
         bbox = self.tv.bbox(children[0])
-        self.assertEqual(len(bbox), 4)
-        self.assertIsInstance(bbox, tuple)
-        for item in bbox:
-            if not isinstance(item, int):
-                self.fail("Invalid bounding box: %s" % bbox)
-                break
+        self.assertIsBoundingBox(bbox)
 
         # compare width in bboxes
         self.tv['columns'] = ['test']
@@ -1401,7 +1353,7 @@
 
     def test_heading_callback(self):
         def simulate_heading_click(x, y):
-            support.simulate_mouse_click(self.tv, x, y)
+            simulate_mouse_click(self.tv, x, y)
             self.tv.update()
 
         success = [] # no success for now
@@ -1590,7 +1542,7 @@
 
         self.assertEqual(len(pos_y), 2) # item1 and item2 y pos
         for y in pos_y:
-            support.simulate_mouse_click(self.tv, 0, y)
+            simulate_mouse_click(self.tv, 0, y)
 
         # by now there should be 4 things in the events list, since each
         # item had a bind for two events that were simulated above
@@ -1611,6 +1563,21 @@
             'blue')
         self.assertIsInstance(self.tv.tag_configure('test'), dict)
 
+    def test_tag_has(self):
+        item1 = self.tv.insert('', 'end', text='Item 1', tags=['tag1'])
+        item2 = self.tv.insert('', 'end', text='Item 2', tags=['tag2'])
+        self.assertRaises(TypeError, self.tv.tag_has)
+        self.assertRaises(TclError, self.tv.tag_has, 'tag1', 'non-existing')
+        self.assertTrue(self.tv.tag_has('tag1', item1))
+        self.assertFalse(self.tv.tag_has('tag1', item2))
+        self.assertFalse(self.tv.tag_has('tag2', item1))
+        self.assertTrue(self.tv.tag_has('tag2', item2))
+        self.assertFalse(self.tv.tag_has('tag3', item1))
+        self.assertFalse(self.tv.tag_has('tag3', item2))
+        self.assertEqual(self.tv.tag_has('tag1'), (item1,))
+        self.assertEqual(self.tv.tag_has('tag2'), (item2,))
+        self.assertEqual(self.tv.tag_has('tag3'), ())
+
 
 @add_standard_options(StandardTtkOptionsTests)
 class SeparatorTest(AbstractWidgetTest, unittest.TestCase):
@@ -1620,7 +1587,7 @@
     )
     default_orient = 'horizontal'
 
-    def _create(self, **kwargs):
+    def create(self, **kwargs):
         return ttk.Separator(self.root, **kwargs)
 
 
@@ -1631,7 +1598,7 @@
         # 'state'?
     )
 
-    def _create(self, **kwargs):
+    def create(self, **kwargs):
         return ttk.Sizegrip(self.root, **kwargs)
 
 tests_gui = (
diff --git a/Lib/tkinter/test/widget_tests.py b/Lib/tkinter/test/widget_tests.py
index a9820a7..779538d 100644
--- a/Lib/tkinter/test/widget_tests.py
+++ b/Lib/tkinter/test/widget_tests.py
@@ -3,9 +3,9 @@
 import unittest
 import sys
 import tkinter
-from tkinter.ttk import setup_master, Scale
-from tkinter.test.support import (tcl_version, requires_tcl, get_tk_patchlevel,
-                                  pixels_conv, tcl_obj_eq)
+from tkinter.ttk import Scale
+from tkinter.test.support import (AbstractTkTest, tcl_version, requires_tcl,
+                                  get_tk_patchlevel, pixels_conv, tcl_obj_eq)
 import test.support
 
 
@@ -22,21 +22,25 @@
 
 _sentinel = object()
 
-class AbstractWidgetTest:
+class AbstractWidgetTest(AbstractTkTest):
     _conv_pixels = staticmethod(pixels_round)
     _conv_pad_pixels = None
-    wantobjects = True
+    _stringify = False
 
-    def setUp(self):
-        self.root = setup_master()
-        self.scaling = float(self.root.call('tk', 'scaling'))
-        if not self.root.wantobjects():
-            self.wantobjects = False
+    @property
+    def scaling(self):
+        try:
+            return self._scaling
+        except AttributeError:
+            self._scaling = float(self.root.call('tk', 'scaling'))
+            return self._scaling
 
-    def create(self, **kwargs):
-        widget = self._create(**kwargs)
-        self.addCleanup(widget.destroy)
-        return widget
+    def _str(self, value):
+        if not self._stringify and self.wantobjects and tcl_version >= (8, 6):
+            return value
+        if isinstance(value, tuple):
+            return ' '.join(map(self._str, value))
+        return str(value)
 
     def assertEqual2(self, actual, expected, msg=None, eq=object.__eq__):
         if eq(actual, expected):
@@ -50,7 +54,7 @@
             expected = value
         if conv:
             expected = conv(expected)
-        if not self.wantobjects:
+        if self._stringify or not self.wantobjects:
             if isinstance(expected, tuple):
                 expected = tkinter._join(expected)
             else:
@@ -182,7 +186,7 @@
                 errmsg=errmsg)
 
     def checkImageParam(self, widget, name):
-        image = tkinter.PhotoImage('image1')
+        image = tkinter.PhotoImage(master=self.root, name='image1')
         self.checkParam(widget, name, image, conv=str)
         self.checkInvalidParam(widget, name, 'spam',
                 errmsg='image "spam" doesn\'t exist')
@@ -191,6 +195,16 @@
     def checkVariableParam(self, widget, name, var):
         self.checkParam(widget, name, var, conv=str)
 
+    def assertIsBoundingBox(self, bbox):
+        self.assertIsNotNone(bbox)
+        self.assertIsInstance(bbox, tuple)
+        if len(bbox) != 4:
+            self.fail('Invalid bounding box: %r' % (bbox,))
+        for item in bbox:
+            if not isinstance(item, int):
+                self.fail('Invalid bounding box: %r' % (bbox,))
+                break
+
 
 class StandardOptionsTests:
     STANDARD_OPTIONS = (
@@ -393,7 +407,7 @@
 
     def test_textvariable(self):
         widget = self.create()
-        var = tkinter.StringVar()
+        var = tkinter.StringVar(self.root)
         self.checkVariableParam(widget, 'textvariable', var)
 
     def test_troughcolor(self):
@@ -454,7 +468,7 @@
 
     def test_variable(self):
         widget = self.create()
-        var = tkinter.DoubleVar()
+        var = tkinter.DoubleVar(self.root)
         self.checkVariableParam(widget, 'variable', var)
 
 
diff --git a/Lib/tkinter/tix.py b/Lib/tkinter/tix.py
index 131aa06..c1cdfa7 100644
--- a/Lib/tkinter/tix.py
+++ b/Lib/tkinter/tix.py
@@ -27,7 +27,7 @@
 #
 
 from tkinter import *
-from tkinter import _flatten, _cnfmerge, _default_root
+from tkinter import _cnfmerge, _default_root
 
 # WARNING - TkVersion is a limited precision floating point number
 if TkVersion < 3.999:
diff --git a/Lib/tkinter/ttk.py b/Lib/tkinter/ttk.py
index ca90273..4327dbb 100644
--- a/Lib/tkinter/ttk.py
+++ b/Lib/tkinter/ttk.py
@@ -26,7 +26,7 @@
            "tclobjs_to_py", "setup_master"]
 
 import tkinter
-from tkinter import _flatten, _join, _stringify
+from tkinter import _flatten, _join, _stringify, _splitdict
 
 # Verify if Tk is new enough to not need the Tile package
 _REQUIRE_TILE = True if tkinter.TkVersion < 8.5 else False
@@ -240,21 +240,6 @@
 
     return '\n'.join(script)
 
-def _dict_from_tcltuple(ttuple, cut_minus=True):
-    """Break tuple in pairs, format it properly, then build the return
-    dict. If cut_minus is True, the supposed '-' prefixing options will
-    be removed.
-
-    ttuple is expected to contain an even number of elements."""
-    opt_start = 1 if cut_minus else 0
-
-    retdict = {}
-    it = iter(ttuple)
-    for opt, val in zip(it, it):
-        retdict[str(opt)[opt_start:]] = val
-
-    return tclobjs_to_py(retdict)
-
 def _list_from_statespec(stuple):
     """Construct a list from the given statespec tuple according to the
     accepted statespec accepted by _format_mapdict."""
@@ -272,9 +257,10 @@
     it = iter(nval)
     return [_flatten(spec) for spec in zip(it, it)]
 
-def _list_from_layouttuple(ltuple):
+def _list_from_layouttuple(tk, ltuple):
     """Construct a list from the tuple returned by ttk::layout, this is
     somewhat the reverse of _format_layoutlist."""
+    ltuple = tk.splitlist(ltuple)
     res = []
 
     indx = 0
@@ -293,17 +279,14 @@
             indx += 2
 
             if opt == 'children':
-                if (tkinter._default_root and
-                    not tkinter._default_root.wantobjects()):
-                    val = tkinter._default_root.splitlist(val)
-                val = _list_from_layouttuple(val)
+                val = _list_from_layouttuple(tk, val)
 
             opts[opt] = val
 
     return res
 
-def _val_or_dict(options, func, *args):
-    """Format options then call func with args and options and return
+def _val_or_dict(tk, options, *args):
+    """Format options then call Tk command with args and options and return
     the appropriate result.
 
     If no option is specified, a dict is returned. If a option is
@@ -311,14 +294,12 @@
     Otherwise, the function just sets the passed options and the caller
     shouldn't be expecting a return value anyway."""
     options = _format_optdict(options)
-    res = func(*(args + options))
+    res = tk.call(*(args + options))
 
     if len(options) % 2: # option specified without a value, return its value
         return res
 
-    if tkinter._default_root:
-        res = tkinter._default_root.splitlist(res)
-    return _dict_from_tcltuple(res)
+    return _splitdict(tk, res, conv=_tclobj_to_py)
 
 def _convert_stringval(value):
     """Converts a value to, hopefully, a more appropriate Python object."""
@@ -338,20 +319,24 @@
             x = int(x)
     return x
 
+def _tclobj_to_py(val):
+    """Return value converted from Tcl object to Python object."""
+    if val and hasattr(val, '__len__') and not isinstance(val, str):
+        if getattr(val[0], 'typename', None) == 'StateSpec':
+            val = _list_from_statespec(val)
+        else:
+            val = list(map(_convert_stringval, val))
+
+    elif hasattr(val, 'typename'): # some other (single) Tcl object
+        val = _convert_stringval(val)
+
+    return val
+
 def tclobjs_to_py(adict):
     """Returns adict with its values converted from Tcl objects to Python
     objects."""
     for opt, val in adict.items():
-        if val and hasattr(val, '__len__') and not isinstance(val, str):
-            if getattr(val[0], 'typename', None) == 'StateSpec':
-                val = _list_from_statespec(val)
-            else:
-                val = list(map(_convert_stringval, val))
-
-        elif hasattr(val, 'typename'): # some other (single) Tcl object
-            val = _convert_stringval(val)
-
-        adict[opt] = val
+        adict[opt] = _tclobj_to_py(val)
 
     return adict
 
@@ -396,7 +381,7 @@
         a sequence identifying the value for that option."""
         if query_opt is not None:
             kw[query_opt] = None
-        return _val_or_dict(kw, self.tk.call, self._name, "configure", style)
+        return _val_or_dict(self.tk, kw, self._name, "configure", style)
 
 
     def map(self, style, query_opt=None, **kw):
@@ -411,8 +396,10 @@
             return _list_from_statespec(self.tk.splitlist(
                 self.tk.call(self._name, "map", style, '-%s' % query_opt)))
 
-        return _dict_from_tcltuple(
-            self.tk.call(self._name, "map", style, *(_format_mapdict(kw))))
+        return _splitdict(
+            self.tk,
+            self.tk.call(self._name, "map", style, *_format_mapdict(kw)),
+            conv=_tclobj_to_py)
 
 
     def lookup(self, style, option, state=None, default=None):
@@ -466,8 +453,8 @@
             lspec = "null" # could be any other word, but this may make sense
                            # when calling layout(style) later
 
-        return _list_from_layouttuple(self.tk.splitlist(
-            self.tk.call(self._name, "layout", style, lspec)))
+        return _list_from_layouttuple(self.tk,
+            self.tk.call(self._name, "layout", style, lspec))
 
 
     def element_create(self, elementname, etype, *args, **kw):
@@ -907,7 +894,7 @@
         options to the corresponding values."""
         if option is not None:
             kw[option] = None
-        return _val_or_dict(kw, self.tk.call, self._w, "tab", tab_id)
+        return _val_or_dict(self.tk, kw, self._w, "tab", tab_id)
 
 
     def tabs(self):
@@ -984,7 +971,7 @@
         Otherwise, sets the options to the corresponding values."""
         if option is not None:
             kw[option] = None
-        return _val_or_dict(kw, self.tk.call, self._w, "pane", pane)
+        return _val_or_dict(self.tk, kw, self._w, "pane", pane)
 
 
     def sashpos(self, index, newpos=None):
@@ -1223,7 +1210,7 @@
         Otherwise, sets the options to the corresponding values."""
         if option is not None:
             kw[option] = None
-        return _val_or_dict(kw, self.tk.call, self._w, "column", column)
+        return _val_or_dict(self.tk, kw, self._w, "column", column)
 
 
     def delete(self, *items):
@@ -1282,7 +1269,7 @@
         if option is not None:
             kw[option] = None
 
-        return _val_or_dict(kw, self.tk.call, self._w, 'heading', column)
+        return _val_or_dict(self.tk, kw, self._w, 'heading', column)
 
 
     def identify(self, component, x, y):
@@ -1361,7 +1348,7 @@
         values as given by kw."""
         if option is not None:
             kw[option] = None
-        return _val_or_dict(kw, self.tk.call, self._w, "item", item)
+        return _val_or_dict(self.tk, kw, self._w, "item", item)
 
 
     def move(self, item, parent, index):
@@ -1429,13 +1416,16 @@
 
 
     def set(self, item, column=None, value=None):
-        """With one argument, returns a dictionary of column/value pairs
-        for the specified item. With two arguments, returns the current
-        value of the specified column. With three arguments, sets the
+        """Query or set the value of given item.
+
+        With one argument, return a dictionary of column/value pairs
+        for the specified item. With two arguments, return the current
+        value of the specified column. With three arguments, set the
         value of given column in given item to the specified value."""
         res = self.tk.call(self._w, "set", item, column, value)
         if column is None and value is None:
-            return _dict_from_tcltuple(self.tk.splitlist(res), False)
+            return _splitdict(self.tk, res,
+                              cut_minus=False, conv=_tclobj_to_py)
         else:
             return res
 
@@ -1456,7 +1446,7 @@
         values for the given tagname."""
         if option is not None:
             kw[option] = None
-        return _val_or_dict(kw, self.tk.call, self._w, "tag", "configure",
+        return _val_or_dict(self.tk, kw, self._w, "tag", "configure",
             tagname)
 
 
@@ -1466,7 +1456,11 @@
         all items which have the specified tag.
 
         * Availability: Tk 8.6"""
-        return self.tk.getboolean(
+        if item is None:
+            return self.tk.splitlist(
+                self.tk.call(self._w, "tag", "has", tagname))
+        else:
+            return self.tk.getboolean(
                 self.tk.call(self._w, "tag", "has", tagname, item))
 
 
diff --git a/Lib/token.py b/Lib/token.py
index 31fae0a..7470c8c 100644
--- a/Lib/token.py
+++ b/Lib/token.py
@@ -93,7 +93,7 @@
         outFileName = args[1]
     try:
         fp = open(inFileName)
-    except IOError as err:
+    except OSError as err:
         sys.stdout.write("I/O error: %s\n" % str(err))
         sys.exit(1)
     lines = fp.read().split("\n")
@@ -112,7 +112,7 @@
     # load the output skeleton from the target:
     try:
         fp = open(outFileName)
-    except IOError as err:
+    except OSError as err:
         sys.stderr.write("I/O error: %s\n" % str(err))
         sys.exit(2)
     format = fp.read().split("\n")
@@ -129,7 +129,7 @@
     format[start:end] = lines
     try:
         fp = open(outFileName, 'w')
-    except IOError as err:
+    except OSError as err:
         sys.stderr.write("I/O error: %s\n" % str(err))
         sys.exit(4)
     fp.write("\n".join(format))
diff --git a/Lib/tokenize.py b/Lib/tokenize.py
index 5304de5..5b47ebd 100644
--- a/Lib/tokenize.py
+++ b/Lib/tokenize.py
@@ -24,7 +24,6 @@
 __credits__ = ('GvR, ESR, Tim Peters, Thomas Wouters, Fred Drake, '
                'Skip Montanaro, Raymond Hettinger, Trent Nelson, '
                'Michael Foord')
-import builtins
 from codecs import lookup, BOM_UTF8
 import collections
 from io import TextIOWrapper
@@ -430,11 +429,13 @@
     return default, [first, second]
 
 
+_builtin_open = open
+
 def open(filename):
     """Open a file in read only mode using the encoding detected by
     detect_encoding().
     """
-    buffer = builtins.open(filename, 'rb')
+    buffer = _builtin_open(filename, 'rb')
     encoding, lines = detect_encoding(buffer.readline)
     buffer.seek(0)
     text = TextIOWrapper(buffer, encoding, line_buffering=True)
@@ -657,7 +658,7 @@
         # Tokenize the input
         if args.filename:
             filename = args.filename
-            with builtins.open(filename, 'rb') as f:
+            with _builtin_open(filename, 'rb') as f:
                 tokens = list(tokenize(f.readline))
         else:
             filename = "<stdin>"
@@ -679,7 +680,7 @@
         error(err.args[0], filename, (line, column))
     except SyntaxError as err:
         error(err, filename)
-    except IOError as err:
+    except OSError as err:
         error(err)
     except KeyboardInterrupt:
         print("interrupted\n")
diff --git a/Lib/trace.py b/Lib/trace.py
index c09b365..09fe9ee 100755
--- a/Lib/trace.py
+++ b/Lib/trace.py
@@ -238,7 +238,7 @@
                 counts, calledfuncs, callers = \
                         pickle.load(open(self.infile, 'rb'))
                 self.update(self.__class__(counts, calledfuncs, callers))
-            except (IOError, EOFError, ValueError) as err:
+            except (OSError, EOFError, ValueError) as err:
                 print(("Skipping counts file %r: %s"
                                       % (self.infile, err)), file=sys.stderr)
 
@@ -348,7 +348,7 @@
             try:
                 pickle.dump((self.counts, self.calledfuncs, self.callers),
                             open(self.outfile, 'wb'), 1)
-            except IOError as err:
+            except OSError as err:
                 print("Can't save counts files because %s" % err, file=sys.stderr)
 
     def write_results_file(self, path, lines, lnotab, lines_hit, encoding=None):
@@ -356,7 +356,7 @@
 
         try:
             outfile = open(path, "w", encoding=encoding)
-        except IOError as err:
+        except OSError as err:
             print(("trace: Could not open %r for writing: %s"
                                   "- skipping" % (path, err)), file=sys.stderr)
             return 0, 0
@@ -437,7 +437,7 @@
         with tokenize.open(filename) as f:
             prog = f.read()
             encoding = f.encoding
-    except IOError as err:
+    except OSError as err:
         print(("Not printing coverage data for %r: %s"
                               % (filename, err)), file=sys.stderr)
         return {}
@@ -802,7 +802,7 @@
                 '__cached__': None,
             }
             t.runctx(code, globs, globs)
-        except IOError as err:
+        except OSError as err:
             _err_exit("Cannot run file %r because: %s" % (sys.argv[0], err))
         except SystemExit:
             pass
diff --git a/Lib/traceback.py b/Lib/traceback.py
index f33fced..faf593a 100644
--- a/Lib/traceback.py
+++ b/Lib/traceback.py
@@ -2,26 +2,32 @@
 
 import linecache
 import sys
+import operator
 
 __all__ = ['extract_stack', 'extract_tb', 'format_exception',
            'format_exception_only', 'format_list', 'format_stack',
            'format_tb', 'print_exc', 'format_exc', 'print_exception',
-           'print_last', 'print_stack', 'print_tb']
+           'print_last', 'print_stack', 'print_tb',
+           'clear_frames']
 
-def _print(file, str='', terminator='\n'):
-    file.write(str+terminator)
+#
+# Formatting and printing lists of traceback lines.
+#
 
+def _format_list_iter(extracted_list):
+    for filename, lineno, name, line in extracted_list:
+        item = '  File "{}", line {}, in {}\n'.format(filename, lineno, name)
+        if line:
+            item = item + '    {}\n'.format(line.strip())
+        yield item
 
 def print_list(extracted_list, file=None):
     """Print the list of tuples as returned by extract_tb() or
     extract_stack() as a formatted stack trace to the given file."""
     if file is None:
         file = sys.stderr
-    for filename, lineno, name, line in extracted_list:
-        _print(file,
-               '  File "%s", line %d, in %s' % (filename,lineno,name))
-        if line:
-            _print(file, '    %s' % line.strip())
+    for item in _format_list_iter(extracted_list):
+        print(item, file=file, end="")
 
 def format_list(extracted_list):
     """Format a list of traceback entry tuples for printing.
@@ -33,14 +39,44 @@
     the strings may contain internal newlines as well, for those items
     whose source text line is not None.
     """
-    list = []
-    for filename, lineno, name, line in extracted_list:
-        item = '  File "%s", line %d, in %s\n' % (filename,lineno,name)
-        if line:
-            item = item + '    %s\n' % line.strip()
-        list.append(item)
-    return list
+    return list(_format_list_iter(extracted_list))
 
+#
+# Printing and Extracting Tracebacks.
+#
+
+# extractor takes curr and needs to return a tuple of:
+# - Frame object
+# - Line number
+# - Next item (same type as curr)
+# In practice, curr is either a traceback or a frame.
+def _extract_tb_or_stack_iter(curr, limit, extractor):
+    if limit is None:
+        limit = getattr(sys, 'tracebacklimit', None)
+
+    n = 0
+    while curr is not None and (limit is None or n < limit):
+        f, lineno, next_item = extractor(curr)
+        co = f.f_code
+        filename = co.co_filename
+        name = co.co_name
+
+        linecache.checkcache(filename)
+        line = linecache.getline(filename, lineno, f.f_globals)
+
+        if line:
+            line = line.strip()
+        else:
+            line = None
+
+        yield (filename, lineno, name, line)
+        curr = next_item
+        n += 1
+
+def _extract_tb_iter(tb, limit):
+    return _extract_tb_or_stack_iter(
+                tb, limit,
+                operator.attrgetter("tb_frame", "tb_lineno", "tb_next"))
 
 def print_tb(tb, limit=None, file=None):
     """Print up to 'limit' stack trace entries from the traceback 'tb'.
@@ -50,29 +86,11 @@
     'file' should be an open file or file-like object with a write()
     method.
     """
-    if file is None:
-        file = sys.stderr
-    if limit is None:
-        if hasattr(sys, 'tracebacklimit'):
-            limit = sys.tracebacklimit
-    n = 0
-    while tb is not None and (limit is None or n < limit):
-        f = tb.tb_frame
-        lineno = tb.tb_lineno
-        co = f.f_code
-        filename = co.co_filename
-        name = co.co_name
-        _print(file,
-               '  File "%s", line %d, in %s' % (filename, lineno, name))
-        linecache.checkcache(filename)
-        line = linecache.getline(filename, lineno, f.f_globals)
-        if line: _print(file, '    ' + line.strip())
-        tb = tb.tb_next
-        n = n+1
+    print_list(extract_tb(tb, limit=limit), file=file)
 
 def format_tb(tb, limit=None):
     """A shorthand for 'format_list(extract_tb(tb, limit))'."""
-    return format_list(extract_tb(tb, limit))
+    return format_list(extract_tb(tb, limit=limit))
 
 def extract_tb(tb, limit=None):
     """Return list of up to limit pre-processed entries from traceback.
@@ -85,26 +103,11 @@
     leading and trailing whitespace stripped; if the source is not
     available it is None.
     """
-    if limit is None:
-        if hasattr(sys, 'tracebacklimit'):
-            limit = sys.tracebacklimit
-    list = []
-    n = 0
-    while tb is not None and (limit is None or n < limit):
-        f = tb.tb_frame
-        lineno = tb.tb_lineno
-        co = f.f_code
-        filename = co.co_filename
-        name = co.co_name
-        linecache.checkcache(filename)
-        line = linecache.getline(filename, lineno, f.f_globals)
-        if line: line = line.strip()
-        else: line = None
-        list.append((filename, lineno, name, line))
-        tb = tb.tb_next
-        n = n+1
-    return list
+    return list(_extract_tb_iter(tb, limit=limit))
 
+#
+# Exception formatting and output.
+#
 
 _cause_message = (
     "\nThe above exception was the direct cause "
@@ -132,9 +135,23 @@
     its.append([(exc, custom_tb or exc.__traceback__)])
     # itertools.chain is in an extension module and may be unavailable
     for it in its:
-        for x in it:
-            yield x
+        yield from it
 
+def _format_exception_iter(etype, value, tb, limit, chain):
+    if chain:
+        values = _iter_chain(value, tb)
+    else:
+        values = [(value, tb)]
+
+    for value, tb in values:
+        if isinstance(value, str):
+            # This is a cause/context message line
+            yield value + '\n'
+            continue
+        if tb:
+            yield 'Traceback (most recent call last):\n'
+            yield from _format_list_iter(_extract_tb_iter(tb, limit=limit))
+        yield from _format_exception_only_iter(type(value), value)
 
 def print_exception(etype, value, tb, limit=None, file=None, chain=True):
     """Print exception up to 'limit' stack trace entries from 'tb' to 'file'.
@@ -149,20 +166,8 @@
     """
     if file is None:
         file = sys.stderr
-    if chain:
-        values = _iter_chain(value, tb)
-    else:
-        values = [(value, tb)]
-    for value, tb in values:
-        if isinstance(value, str):
-            _print(file, value)
-            continue
-        if tb:
-            _print(file, 'Traceback (most recent call last):')
-            print_tb(tb, limit, file)
-        lines = format_exception_only(type(value), value)
-        for line in lines:
-            _print(file, line, '')
+    for line in _format_exception_iter(etype, value, tb, limit, chain):
+        print(line, file=file, end="")
 
 def format_exception(etype, value, tb, limit=None, chain=True):
     """Format a stack trace and the exception information.
@@ -173,20 +178,7 @@
     these lines are concatenated and printed, exactly the same text is
     printed as does print_exception().
     """
-    list = []
-    if chain:
-        values = _iter_chain(value, tb)
-    else:
-        values = [(value, tb)]
-    for value, tb in values:
-        if isinstance(value, str):
-            list.append(value + '\n')
-            continue
-        if tb:
-            list.append('Traceback (most recent call last):\n')
-            list.extend(format_tb(tb, limit))
-        list.extend(format_exception_only(type(value), value))
-    return list
+    return list(_format_exception_iter(etype, value, tb, limit, chain))
 
 def format_exception_only(etype, value):
     """Format the exception part of a traceback.
@@ -204,10 +196,14 @@
     string in the list.
 
     """
+    return list(_format_exception_only_iter(etype, value))
+
+def _format_exception_only_iter(etype, value):
     # Gracefully handle (the way Python 2.4 and earlier did) the case of
     # being called with (None, None).
     if etype is None:
-        return [_format_final_exc_line(etype, value)]
+        yield _format_final_exc_line(etype, value)
+        return
 
     stype = etype.__name__
     smod = etype.__module__
@@ -215,27 +211,27 @@
         stype = smod + '.' + stype
 
     if not issubclass(etype, SyntaxError):
-        return [_format_final_exc_line(stype, value)]
+        yield _format_final_exc_line(stype, value)
+        return
 
     # It was a syntax error; show exactly where the problem was found.
-    lines = []
     filename = value.filename or "<string>"
     lineno = str(value.lineno) or '?'
-    lines.append('  File "%s", line %s\n' % (filename, lineno))
+    yield '  File "{}", line {}\n'.format(filename, lineno)
+
     badline = value.text
     offset = value.offset
     if badline is not None:
-        lines.append('    %s\n' % badline.strip())
+        yield '    {}\n'.format(badline.strip())
         if offset is not None:
             caretspace = badline.rstrip('\n')
             offset = min(len(caretspace), offset) - 1
             caretspace = caretspace[:offset].lstrip()
             # non-space whitespace (likes tabs) must be kept for alignment
             caretspace = ((c.isspace() and c or ' ') for c in caretspace)
-            lines.append('    %s^\n' % ''.join(caretspace))
+            yield '    {}^\n'.format(''.join(caretspace))
     msg = value.msg or "<no detail available>"
-    lines.append("%s: %s\n" % (stype, msg))
-    return lines
+    yield "{}: {}\n".format(stype, msg)
 
 def _format_final_exc_line(etype, value):
     valuestr = _some_str(value)
@@ -251,38 +247,34 @@
     except:
         return '<unprintable %s object>' % type(value).__name__
 
-
 def print_exc(limit=None, file=None, chain=True):
     """Shorthand for 'print_exception(*sys.exc_info(), limit, file)'."""
-    if file is None:
-        file = sys.stderr
-    try:
-        etype, value, tb = sys.exc_info()
-        print_exception(etype, value, tb, limit, file, chain)
-    finally:
-        etype = value = tb = None
-
+    print_exception(*sys.exc_info(), limit=limit, file=file, chain=chain)
 
 def format_exc(limit=None, chain=True):
     """Like print_exc() but return a string."""
-    try:
-        etype, value, tb = sys.exc_info()
-        return ''.join(
-            format_exception(etype, value, tb, limit, chain))
-    finally:
-        etype = value = tb = None
-
+    return "".join(format_exception(*sys.exc_info(), limit=limit, chain=chain))
 
 def print_last(limit=None, file=None, chain=True):
     """This is a shorthand for 'print_exception(sys.last_type,
     sys.last_value, sys.last_traceback, limit, file)'."""
     if not hasattr(sys, "last_type"):
         raise ValueError("no last exception")
-    if file is None:
-        file = sys.stderr
     print_exception(sys.last_type, sys.last_value, sys.last_traceback,
                     limit, file, chain)
 
+#
+# Printing and Extracting Stacks.
+#
+
+def _extract_stack_iter(f, limit=None):
+    return _extract_tb_or_stack_iter(
+                f, limit, lambda f: (f, f.f_lineno, f.f_back))
+
+def _get_stack(f):
+    if f is None:
+        f = sys._getframe().f_back.f_back
+    return f
 
 def print_stack(f=None, limit=None, file=None):
     """Print a stack trace from its invocation point.
@@ -291,21 +283,11 @@
     stack frame at which to start. The optional 'limit' and 'file'
     arguments have the same meaning as for print_exception().
     """
-    if f is None:
-        try:
-            raise ZeroDivisionError
-        except ZeroDivisionError:
-            f = sys.exc_info()[2].tb_frame.f_back
-    print_list(extract_stack(f, limit), file)
+    print_list(extract_stack(_get_stack(f), limit=limit), file=file)
 
 def format_stack(f=None, limit=None):
     """Shorthand for 'format_list(extract_stack(f, limit))'."""
-    if f is None:
-        try:
-            raise ZeroDivisionError
-        except ZeroDivisionError:
-            f = sys.exc_info()[2].tb_frame.f_back
-    return format_list(extract_stack(f, limit))
+    return format_list(extract_stack(_get_stack(f), limit=limit))
 
 def extract_stack(f=None, limit=None):
     """Extract the raw traceback from the current stack frame.
@@ -316,27 +298,16 @@
     line number, function name, text), and the entries are in order
     from oldest to newest stack frame.
     """
-    if f is None:
+    stack = list(_extract_stack_iter(_get_stack(f), limit=limit))
+    stack.reverse()
+    return stack
+
+def clear_frames(tb):
+    "Clear all references to local variables in the frames of a traceback."
+    while tb is not None:
         try:
-            raise ZeroDivisionError
-        except ZeroDivisionError:
-            f = sys.exc_info()[2].tb_frame.f_back
-    if limit is None:
-        if hasattr(sys, 'tracebacklimit'):
-            limit = sys.tracebacklimit
-    list = []
-    n = 0
-    while f is not None and (limit is None or n < limit):
-        lineno = f.f_lineno
-        co = f.f_code
-        filename = co.co_filename
-        name = co.co_name
-        linecache.checkcache(filename)
-        line = linecache.getline(filename, lineno, f.f_globals)
-        if line: line = line.strip()
-        else: line = None
-        list.append((filename, lineno, name, line))
-        f = f.f_back
-        n = n+1
-    list.reverse()
-    return list
+            tb.tb_frame.clear()
+        except RuntimeError:
+            # Ignore the exception raised if the frame is still executing.
+            pass
+        tb = tb.tb_next
diff --git a/Lib/tracemalloc.py b/Lib/tracemalloc.py
new file mode 100644
index 0000000..adedfc5
--- /dev/null
+++ b/Lib/tracemalloc.py
@@ -0,0 +1,487 @@
+from collections import Sequence, Iterable
+from functools import total_ordering
+import fnmatch
+import linecache
+import os.path
+import pickle
+
+# Import types and functions implemented in C
+from _tracemalloc import *
+from _tracemalloc import _get_object_traceback, _get_traces
+
+
+def _format_size(size, sign):
+    for unit in ('B', 'KiB', 'MiB', 'GiB', 'TiB'):
+        if abs(size) < 100 and unit != 'B':
+            # 3 digits (xx.x UNIT)
+            if sign:
+                return "%+.1f %s" % (size, unit)
+            else:
+                return "%.1f %s" % (size, unit)
+        if abs(size) < 10 * 1024 or unit == 'TiB':
+            # 4 or 5 digits (xxxx UNIT)
+            if sign:
+                return "%+.0f %s" % (size, unit)
+            else:
+                return "%.0f %s" % (size, unit)
+        size /= 1024
+
+
+class Statistic:
+    """
+    Statistic difference on memory allocations between two Snapshot instance.
+    """
+
+    __slots__ = ('traceback', 'size', 'count')
+
+    def __init__(self, traceback, size, count):
+        self.traceback = traceback
+        self.size = size
+        self.count = count
+
+    def __hash__(self):
+        return hash((self.traceback, self.size, self.count))
+
+    def __eq__(self, other):
+        return (self.traceback == other.traceback
+                and self.size == other.size
+                and self.count == other.count)
+
+    def __str__(self):
+        text = ("%s: size=%s, count=%i"
+                 % (self.traceback,
+                    _format_size(self.size, False),
+                    self.count))
+        if self.count:
+            average = self.size / self.count
+            text += ", average=%s" % _format_size(average, False)
+        return text
+
+    def __repr__(self):
+        return ('<Statistic traceback=%r size=%i count=%i>'
+                % (self.traceback, self.size, self.count))
+
+    def _sort_key(self):
+        return (self.size, self.count, self.traceback)
+
+
+class StatisticDiff:
+    """
+    Statistic difference on memory allocations between an old and a new
+    Snapshot instance.
+    """
+    __slots__ = ('traceback', 'size', 'size_diff', 'count', 'count_diff')
+
+    def __init__(self, traceback, size, size_diff, count, count_diff):
+        self.traceback = traceback
+        self.size = size
+        self.size_diff = size_diff
+        self.count = count
+        self.count_diff = count_diff
+
+    def __hash__(self):
+        return hash((self.traceback, self.size, self.size_diff,
+                     self.count, self.count_diff))
+
+    def __eq__(self, other):
+        return (self.traceback == other.traceback
+                and self.size == other.size
+                and self.size_diff == other.size_diff
+                and self.count == other.count
+                and self.count_diff == other.count_diff)
+
+    def __str__(self):
+        text = ("%s: size=%s (%s), count=%i (%+i)"
+                % (self.traceback,
+                   _format_size(self.size, False),
+                   _format_size(self.size_diff, True),
+                   self.count,
+                   self.count_diff))
+        if self.count:
+            average = self.size / self.count
+            text += ", average=%s" % _format_size(average, False)
+        return text
+
+    def __repr__(self):
+        return ('<StatisticDiff traceback=%r size=%i (%+i) count=%i (%+i)>'
+                % (self.traceback, self.size, self.size_diff,
+                   self.count, self.count_diff))
+
+    def _sort_key(self):
+        return (abs(self.size_diff), self.size,
+                abs(self.count_diff), self.count,
+                self.traceback)
+
+
+def _compare_grouped_stats(old_group, new_group):
+    statistics = []
+    for traceback, stat in new_group.items():
+        previous = old_group.pop(traceback, None)
+        if previous is not None:
+            stat = StatisticDiff(traceback,
+                                 stat.size, stat.size - previous.size,
+                                 stat.count, stat.count - previous.count)
+        else:
+            stat = StatisticDiff(traceback,
+                                 stat.size, stat.size,
+                                 stat.count, stat.count)
+        statistics.append(stat)
+
+    for traceback, stat in old_group.items():
+        stat = StatisticDiff(traceback, 0, -stat.size, 0, -stat.count)
+        statistics.append(stat)
+    return statistics
+
+
+@total_ordering
+class Frame:
+    """
+    Frame of a traceback.
+    """
+    __slots__ = ("_frame",)
+
+    def __init__(self, frame):
+        # frame is a tuple: (filename: str, lineno: int)
+        self._frame = frame
+
+    @property
+    def filename(self):
+        return self._frame[0]
+
+    @property
+    def lineno(self):
+        return self._frame[1]
+
+    def __eq__(self, other):
+        return (self._frame == other._frame)
+
+    def __lt__(self, other):
+        return (self._frame < other._frame)
+
+    def __hash__(self):
+        return hash(self._frame)
+
+    def __str__(self):
+        return "%s:%s" % (self.filename, self.lineno)
+
+    def __repr__(self):
+        return "<Frame filename=%r lineno=%r>" % (self.filename, self.lineno)
+
+
+@total_ordering
+class Traceback(Sequence):
+    """
+    Sequence of Frame instances sorted from the most recent frame
+    to the oldest frame.
+    """
+    __slots__ = ("_frames",)
+
+    def __init__(self, frames):
+        Sequence.__init__(self)
+        # frames is a tuple of frame tuples: see Frame constructor for the
+        # format of a frame tuple
+        self._frames = frames
+
+    def __len__(self):
+        return len(self._frames)
+
+    def __getitem__(self, index):
+        if isinstance(index, slice):
+            return tuple(Frame(trace) for trace in self._frames[index])
+        else:
+            return Frame(self._frames[index])
+
+    def __contains__(self, frame):
+        return frame._frame in self._frames
+
+    def __hash__(self):
+        return hash(self._frames)
+
+    def __eq__(self, other):
+        return (self._frames == other._frames)
+
+    def __lt__(self, other):
+        return (self._frames < other._frames)
+
+    def __str__(self):
+        return str(self[0])
+
+    def __repr__(self):
+        return "<Traceback %r>" % (tuple(self),)
+
+    def format(self, limit=None):
+        lines = []
+        if limit is not None and limit < 0:
+            return lines
+        for frame in self[:limit]:
+            lines.append('  File "%s", line %s'
+                         % (frame.filename, frame.lineno))
+            line = linecache.getline(frame.filename, frame.lineno).strip()
+            if line:
+                lines.append('    %s' % line)
+        return lines
+
+
+def get_object_traceback(obj):
+    """
+    Get the traceback where the Python object *obj* was allocated.
+    Return a Traceback instance.
+
+    Return None if the tracemalloc module is not tracing memory allocations or
+    did not trace the allocation of the object.
+    """
+    frames = _get_object_traceback(obj)
+    if frames is not None:
+        return Traceback(frames)
+    else:
+        return None
+
+
+class Trace:
+    """
+    Trace of a memory block.
+    """
+    __slots__ = ("_trace",)
+
+    def __init__(self, trace):
+        # trace is a tuple: (size, traceback), see Traceback constructor
+        # for the format of the traceback tuple
+        self._trace = trace
+
+    @property
+    def size(self):
+        return self._trace[0]
+
+    @property
+    def traceback(self):
+        return Traceback(self._trace[1])
+
+    def __eq__(self, other):
+        return (self._trace == other._trace)
+
+    def __hash__(self):
+        return hash(self._trace)
+
+    def __str__(self):
+        return "%s: %s" % (self.traceback, _format_size(self.size, False))
+
+    def __repr__(self):
+        return ("<Trace size=%s, traceback=%r>"
+                % (_format_size(self.size, False), self.traceback))
+
+
+class _Traces(Sequence):
+    def __init__(self, traces):
+        Sequence.__init__(self)
+        # traces is a tuple of trace tuples: see Trace constructor
+        self._traces = traces
+
+    def __len__(self):
+        return len(self._traces)
+
+    def __getitem__(self, index):
+        if isinstance(index, slice):
+            return tuple(Trace(trace) for trace in self._traces[index])
+        else:
+            return Trace(self._traces[index])
+
+    def __contains__(self, trace):
+        return trace._trace in self._traces
+
+    def __eq__(self, other):
+        return (self._traces == other._traces)
+
+    def __repr__(self):
+        return "<Traces len=%s>" % len(self)
+
+
+def _normalize_filename(filename):
+    filename = os.path.normcase(filename)
+    if filename.endswith(('.pyc', '.pyo')):
+        filename = filename[:-1]
+    return filename
+
+
+class Filter:
+    def __init__(self, inclusive, filename_pattern,
+                 lineno=None, all_frames=False):
+        self.inclusive = inclusive
+        self._filename_pattern = _normalize_filename(filename_pattern)
+        self.lineno = lineno
+        self.all_frames = all_frames
+
+    @property
+    def filename_pattern(self):
+        return self._filename_pattern
+
+    def __match_frame(self, filename, lineno):
+        filename = _normalize_filename(filename)
+        if not fnmatch.fnmatch(filename, self._filename_pattern):
+            return False
+        if self.lineno is None:
+            return True
+        else:
+            return (lineno == self.lineno)
+
+    def _match_frame(self, filename, lineno):
+        return self.__match_frame(filename, lineno) ^ (not self.inclusive)
+
+    def _match_traceback(self, traceback):
+        if self.all_frames:
+            if any(self.__match_frame(filename, lineno)
+                   for filename, lineno in traceback):
+                return self.inclusive
+            else:
+                return (not self.inclusive)
+        else:
+            filename, lineno = traceback[0]
+            return self._match_frame(filename, lineno)
+
+
+class Snapshot:
+    """
+    Snapshot of traces of memory blocks allocated by Python.
+    """
+
+    def __init__(self, traces, traceback_limit):
+        # traces is a tuple of trace tuples: see _Traces constructor for
+        # the exact format
+        self.traces = _Traces(traces)
+        self.traceback_limit = traceback_limit
+
+    def dump(self, filename):
+        """
+        Write the snapshot into a file.
+        """
+        with open(filename, "wb") as fp:
+            pickle.dump(self, fp, pickle.HIGHEST_PROTOCOL)
+
+    @staticmethod
+    def load(filename):
+        """
+        Load a snapshot from a file.
+        """
+        with open(filename, "rb") as fp:
+            return pickle.load(fp)
+
+    def _filter_trace(self, include_filters, exclude_filters, trace):
+        traceback = trace[1]
+        if include_filters:
+            if not any(trace_filter._match_traceback(traceback)
+                       for trace_filter in include_filters):
+                return False
+        if exclude_filters:
+            if any(not trace_filter._match_traceback(traceback)
+                   for trace_filter in exclude_filters):
+                return False
+        return True
+
+    def filter_traces(self, filters):
+        """
+        Create a new Snapshot instance with a filtered traces sequence, filters
+        is a list of Filter instances.  If filters is an empty list, return a
+        new Snapshot instance with a copy of the traces.
+        """
+        if not isinstance(filters, Iterable):
+            raise TypeError("filters must be a list of filters, not %s"
+                            % type(filters).__name__)
+        if filters:
+            include_filters = []
+            exclude_filters = []
+            for trace_filter in filters:
+                if trace_filter.inclusive:
+                    include_filters.append(trace_filter)
+                else:
+                    exclude_filters.append(trace_filter)
+            new_traces = [trace for trace in self.traces._traces
+                          if self._filter_trace(include_filters,
+                                                exclude_filters,
+                                                trace)]
+        else:
+            new_traces = self.traces._traces.copy()
+        return Snapshot(new_traces, self.traceback_limit)
+
+    def _group_by(self, key_type, cumulative):
+        if key_type not in ('traceback', 'filename', 'lineno'):
+            raise ValueError("unknown key_type: %r" % (key_type,))
+        if cumulative and key_type not in ('lineno', 'filename'):
+            raise ValueError("cumulative mode cannot by used "
+                             "with key type %r" % key_type)
+
+        stats = {}
+        tracebacks = {}
+        if not cumulative:
+            for trace in self.traces._traces:
+                size, trace_traceback = trace
+                try:
+                    traceback = tracebacks[trace_traceback]
+                except KeyError:
+                    if key_type == 'traceback':
+                        frames = trace_traceback
+                    elif key_type == 'lineno':
+                        frames = trace_traceback[:1]
+                    else: # key_type == 'filename':
+                        frames = ((trace_traceback[0][0], 0),)
+                    traceback = Traceback(frames)
+                    tracebacks[trace_traceback] = traceback
+                try:
+                    stat = stats[traceback]
+                    stat.size += size
+                    stat.count += 1
+                except KeyError:
+                    stats[traceback] = Statistic(traceback, size, 1)
+        else:
+            # cumulative statistics
+            for trace in self.traces._traces:
+                size, trace_traceback = trace
+                for frame in trace_traceback:
+                    try:
+                        traceback = tracebacks[frame]
+                    except KeyError:
+                        if key_type == 'lineno':
+                            frames = (frame,)
+                        else: # key_type == 'filename':
+                            frames = ((frame[0], 0),)
+                        traceback = Traceback(frames)
+                        tracebacks[frame] = traceback
+                    try:
+                        stat = stats[traceback]
+                        stat.size += size
+                        stat.count += 1
+                    except KeyError:
+                        stats[traceback] = Statistic(traceback, size, 1)
+        return stats
+
+    def statistics(self, key_type, cumulative=False):
+        """
+        Group statistics by key_type. Return a sorted list of Statistic
+        instances.
+        """
+        grouped = self._group_by(key_type, cumulative)
+        statistics = list(grouped.values())
+        statistics.sort(reverse=True, key=Statistic._sort_key)
+        return statistics
+
+    def compare_to(self, old_snapshot, key_type, cumulative=False):
+        """
+        Compute the differences with an old snapshot old_snapshot. Get
+        statistics as a sorted list of StatisticDiff instances, grouped by
+        group_by.
+        """
+        new_group = self._group_by(key_type, cumulative)
+        old_group = old_snapshot._group_by(key_type, cumulative)
+        statistics = _compare_grouped_stats(old_group, new_group)
+        statistics.sort(reverse=True, key=StatisticDiff._sort_key)
+        return statistics
+
+
+def take_snapshot():
+    """
+    Take a snapshot of traces of memory blocks allocated by Python.
+    """
+    if not is_tracing():
+        raise RuntimeError("the tracemalloc module must be tracing memory "
+                           "allocations to take a snapshot")
+    traces = _get_traces()
+    traceback_limit = get_traceback_limit()
+    return Snapshot(traces, traceback_limit)
diff --git a/Lib/turtle.py b/Lib/turtle.py
index c6ebfa5..f4400c9 100644
--- a/Lib/turtle.py
+++ b/Lib/turtle.py
@@ -109,6 +109,7 @@
 import math
 import time
 import inspect
+import sys
 
 from os.path import isfile, split, join
 from copy import deepcopy
@@ -139,7 +140,7 @@
 _tg_utilities = ['write_docstringdict', 'done']
 
 __all__ = (_tg_classes + _tg_screen_functions + _tg_turtle_functions +
-           _tg_utilities) # + _math_functions)
+           _tg_utilities + ['Terminator']) # + _math_functions)
 
 _alias_list = ['addshape', 'backward', 'bk', 'fd', 'ht', 'lt', 'pd', 'pos',
                'pu', 'rt', 'seth', 'setpos', 'setposition', 'st',
@@ -992,6 +993,13 @@
         self._colormode = _CFG["colormode"]
         self._keys = []
         self.clear()
+        if sys.platform == 'darwin':
+            # Force Turtle window to the front on OS X. This is needed because
+            # the Turtle window will show behind the Terminal window when you
+            # start the demo from the command line.
+            rootwindow = cv.winfo_toplevel()
+            rootwindow.call('wm', 'attributes', '.', '-topmost', '1')
+            rootwindow.call('wm', 'attributes', '.', '-topmost', '0')
 
     def clear(self):
         """Delete all drawings and all turtles from the TurtleScreen.
@@ -2587,7 +2595,7 @@
         Example (for a Turtle instance named turtle):
         >>> turtle.setundobuffer(42)
         """
-        if size is None:
+        if size is None or size <= 0:
             self.undobuffer = None
         else:
             self.undobuffer = Tbuffer(size)
@@ -2938,7 +2946,7 @@
         self._stretchfactor = a11, a22
         self._shearfactor = a12/a22
         self._tilt = alfa
-        self._update()
+        self.pen(resizemode="user")
 
 
     def _polytrafo(self, poly):
@@ -3843,18 +3851,18 @@
         key = "Turtle."+methodname
         docsdict[key] = eval(key).__doc__
 
-    f = open("%s.py" % filename,"w")
-    keys = sorted([x for x in docsdict.keys()
-                        if x.split('.')[1] not in _alias_list])
-    f.write('docsdict = {\n\n')
-    for key in keys[:-1]:
+    with open("%s.py" % filename,"w") as f:
+        keys = sorted([x for x in docsdict.keys()
+                            if x.split('.')[1] not in _alias_list])
+        f.write('docsdict = {\n\n')
+        for key in keys[:-1]:
+            f.write('%s :\n' % repr(key))
+            f.write('        """%s\n""",\n\n' % docsdict[key])
+        key = keys[-1]
         f.write('%s :\n' % repr(key))
-        f.write('        """%s\n""",\n\n' % docsdict[key])
-    key = keys[-1]
-    f.write('%s :\n' % repr(key))
-    f.write('        """%s\n"""\n\n' % docsdict[key])
-    f.write("}\n")
-    f.close()
+        f.write('        """%s\n"""\n\n' % docsdict[key])
+        f.write("}\n")
+        f.close()
 
 def read_docstrings(lang):
     """Read in docstrings from lang-specific docstring dictionary.
diff --git a/Lib/turtledemo/__init__.py b/Lib/turtledemo/__init__.py
index e69de29..77150e2 100644
--- a/Lib/turtledemo/__init__.py
+++ b/Lib/turtledemo/__init__.py
@@ -0,0 +1,14 @@
+"""
+    --------------------------------------
+        About this viewer
+    --------------------------------------
+
+    Tiny demo viewer to view turtle graphics example scripts.
+
+    Quickly and dirtyly assembled by Gregor Lingl.
+    June, 2006
+
+    For more information see: turtledemo - Help
+
+    Have fun!
+"""
diff --git a/Lib/turtledemo/__main__.py b/Lib/turtledemo/__main__.py
index cbf3aeb..6280c84 100755
--- a/Lib/turtledemo/__main__.py
+++ b/Lib/turtledemo/__main__.py
@@ -1,17 +1,104 @@
 #!/usr/bin/env python3
+
+"""
+  ----------------------------------------------
+      turtleDemo - Help
+  ----------------------------------------------
+
+  This document has two sections:
+
+  (1) How to use the demo viewer
+  (2) How to add your own demos to the demo repository
+
+
+  (1) How to use the demo viewer.
+
+  Select a demoscript from the example menu.
+  The (syntax colored) source code appears in the left
+  source code window. IT CANNOT BE EDITED, but ONLY VIEWED!
+
+  The demo viewer windows can be resized. The divider between text
+  and canvas can be moved by grabbing it with the mouse. The text font
+  size can be changed from the menu and with Control/Command '-'/'+'.
+  It can also be changed on most systems with Control-mousewheel
+  when the mouse is over the text.
+
+  Press START button to start the demo.
+  Stop execution by pressing the STOP button.
+  Clear screen by pressing the CLEAR button.
+  Restart by pressing the START button again.
+
+  SPECIAL demos, such as clock.py are those which run EVENTDRIVEN.
+
+      Press START button to start the demo.
+
+      - Until the EVENTLOOP is entered everything works
+      as in an ordinary demo script.
+
+      - When the EVENTLOOP is entered, you control the
+      application by using the mouse and/or keys (or it's
+      controlled by some timer events)
+      To stop it you can and must press the STOP button.
+
+      While the EVENTLOOP is running, the examples menu is disabled.
+
+      - Only after having pressed the STOP button, you may
+      restart it or choose another example script.
+
+   * * * * * * * *
+   In some rare situations there may occur interferences/conflicts
+   between events concerning the demo script and those concerning the
+   demo-viewer. (They run in the same process.) Strange behaviour may be
+   the consequence and in the worst case you must close and restart the
+   viewer.
+   * * * * * * * *
+
+
+   (2) How to add your own demos to the demo repository
+
+   - Place the file in the same directory as turtledemo/__main__.py
+     IMPORTANT! When imported, the demo should not modify the system
+     by calling functions in other modules, such as sys, tkinter, or
+     turtle. Global variables should be initialized in main().
+
+   - The code must contain a main() function which will
+     be executed by the viewer (see provided example scripts).
+     It may return a string which will be displayed in the Label below
+     the source code window (when execution has finished.)
+
+   - In order to run mydemo.py by itself, such as during development,
+     add the following at the end of the file:
+
+    if __name__ == '__main__':
+        main()
+        mainloop()  # keep window open
+
+    python -m turtledemo.mydemo  # will then run it
+
+   - If the demo is EVENT DRIVEN, main must return the string
+     "EVENTLOOP". This informs the demo viewer that the script is
+     still running and must be stopped by the user!
+
+     If an "EVENTLOOP" demo runs by itself, as with clock, which uses
+     ontimer, or minimal_hanoi, which loops by recursion, then the
+     code should catch the turtle.Terminator exception that will be
+     raised when the user presses the STOP button.  (Paint is not such
+     a demo; it only acts in response to mouse clicks and movements.)
+"""
 import sys
 import os
 
 from tkinter import *
 from idlelib.Percolator import Percolator
 from idlelib.ColorDelegator import ColorDelegator
-from idlelib.textView import view_file # TextViewer
-from imp import reload
+from idlelib.textView import view_text
+from turtledemo import __doc__ as about_turtledemo
 
 import turtle
 import time
 
 demo_dir = os.path.dirname(os.path.abspath(__file__))
+darwin = sys.platform == 'darwin'
 
 STARTUP = 1
 READY = 2
@@ -21,170 +108,213 @@
 
 menufont = ("Arial", 12, NORMAL)
 btnfont = ("Arial", 12, 'bold')
-txtfont = ('Lucida Console', 8, 'normal')
+txtfont = ['Lucida Console', 10, 'normal']
+
+MINIMUM_FONT_SIZE = 6
+MAXIMUM_FONT_SIZE = 100
+font_sizes = [8, 9, 10, 11, 12, 14, 18, 20, 22, 24, 30]
 
 def getExampleEntries():
     return [entry[:-3] for entry in os.listdir(demo_dir) if
             entry.endswith(".py") and entry[0] != '_']
 
-def showDemoHelp():
-    view_file(demo.root, "Help on turtleDemo",
-              os.path.join(demo_dir, "demohelp.txt"))
-
-def showAboutDemo():
-    view_file(demo.root, "About turtleDemo",
-              os.path.join(demo_dir, "about_turtledemo.txt"))
-
-def showAboutTurtle():
-    view_file(demo.root, "About the new turtle module.",
-              os.path.join(demo_dir, "about_turtle.txt"))
+help_entries = (  # (help_label,  help_doc)
+    ('Turtledemo help', __doc__),
+    ('About turtledemo', about_turtledemo),
+    ('About turtle module', turtle.__doc__),
+    )
 
 class DemoWindow(object):
 
-    def __init__(self, filename=None):   #, root=None):
+    def __init__(self, filename=None):
         self.root = root = turtle._root = Tk()
+        root.title('Python turtle-graphics examples')
         root.wm_protocol("WM_DELETE_WINDOW", self._destroy)
 
-        #################
-        self.mBar = Frame(root, relief=RAISED, borderwidth=2)
-        self.mBar.pack(fill=X)
+        if darwin:
+            import subprocess
+            # Make sure we are the currently activated OS X application
+            # so that our menu bar appears.
+            p = subprocess.Popen(
+                    [
+                        'osascript',
+                        '-e', 'tell application "System Events"',
+                        '-e', 'set frontmost of the first process whose '
+                              'unix id is {} to true'.format(os.getpid()),
+                        '-e', 'end tell',
+                    ],
+                    stderr=subprocess.DEVNULL,
+                    stdout=subprocess.DEVNULL,)
 
-        self.ExamplesBtn = self.makeLoadDemoMenu()
-        self.OptionsBtn = self.makeHelpMenu()
-        self.mBar.tk_menuBar(self.ExamplesBtn, self.OptionsBtn) #, QuitBtn)
+        root.grid_rowconfigure(0, weight=1)
+        root.grid_columnconfigure(0, weight=1)
+        root.grid_columnconfigure(1, minsize=90, weight=1)
+        root.grid_columnconfigure(2, minsize=90, weight=1)
+        root.grid_columnconfigure(3, minsize=90, weight=1)
 
-        root.title('Python turtle-graphics examples')
-        #################
-        self.left_frame = left_frame = Frame(root)
-        self.text_frame = text_frame = Frame(left_frame)
-        self.vbar = vbar =Scrollbar(text_frame, name='vbar')
-        self.text = text = Text(text_frame,
-                                name='text', padx=5, wrap='none',
-                                width=45)
-        vbar['command'] = text.yview
-        vbar.pack(side=LEFT, fill=Y)
-        #####################
-        self.hbar = hbar =Scrollbar(text_frame, name='hbar', orient=HORIZONTAL)
-        hbar['command'] = text.xview
-        hbar.pack(side=BOTTOM, fill=X)
-        #####################
-        text['yscrollcommand'] = vbar.set
-        text.config(font=txtfont)
-        text.config(xscrollcommand=hbar.set)
-        text.pack(side=LEFT, fill=Y, expand=1)
-        #####################
-        self.output_lbl = Label(left_frame, height= 1,text=" --- ", bg = "#ddf",
-                                font = ("Arial", 16, 'normal'))
-        self.output_lbl.pack(side=BOTTOM, expand=0, fill=X)
-        #####################
-        text_frame.pack(side=LEFT, fill=BOTH, expand=0)
-        left_frame.pack(side=LEFT, fill=BOTH, expand=0)
-        self.graph_frame = g_frame = Frame(root)
+        self.mBar = Menu(root, relief=RAISED, borderwidth=2)
+        self.mBar.add_cascade(menu=self.makeLoadDemoMenu(self.mBar),
+                              label='Examples', underline=0)
+        self.mBar.add_cascade(menu=self.makeFontMenu(self.mBar),
+                              label='Fontsize', underline=0)
+        self.mBar.add_cascade(menu=self.makeHelpMenu(self.mBar),
+                              label='Help', underline=0)
+        root['menu'] = self.mBar
 
-        turtle._Screen._root = g_frame
-        turtle._Screen._canvas = turtle.ScrolledCanvas(g_frame, 800, 600, 1000, 800)
-        #xturtle.Screen._canvas.pack(expand=1, fill="both")
-        self.screen = _s_ = turtle.Screen()
-#####
-        turtle.TurtleScreen.__init__(_s_, _s_._canvas)
-#####
-        self.scanvas = _s_._canvas
-        #xturtle.RawTurtle.canvases = [self.scanvas]
-        turtle.RawTurtle.screens = [_s_]
+        pane = PanedWindow(orient=HORIZONTAL, sashwidth=5,
+                           sashrelief=SOLID, bg='#ddd')
+        pane.add(self.makeTextFrame(pane))
+        pane.add(self.makeGraphFrame(pane))
+        pane.grid(row=0, columnspan=4, sticky='news')
 
-        self.scanvas.pack(side=TOP, fill=BOTH, expand=1)
+        self.output_lbl = Label(root, height= 1, text=" --- ", bg="#ddf",
+                                font=("Arial", 16, 'normal'), borderwidth=2,
+                                relief=RIDGE)
+        self.start_btn = Button(root, text=" START ", font=btnfont,
+                                fg="white", disabledforeground = "#fed",
+                                command=self.startDemo)
+        self.stop_btn = Button(root, text=" STOP ", font=btnfont,
+                               fg="white", disabledforeground = "#fed",
+                               command=self.stopIt)
+        self.clear_btn = Button(root, text=" CLEAR ", font=btnfont,
+                                fg="white", disabledforeground="#fed",
+                                command = self.clearCanvas)
+        self.output_lbl.grid(row=1, column=0, sticky='news', padx=(0,5))
+        self.start_btn.grid(row=1, column=1, sticky='ew')
+        self.stop_btn.grid(row=1, column=2, sticky='ew')
+        self.clear_btn.grid(row=1, column=3, sticky='ew')
 
-        self.btn_frame = btn_frame = Frame(g_frame, height=100)
-        self.start_btn = Button(btn_frame, text=" START ", font=btnfont, fg = "white",
-                                disabledforeground = "#fed", command=self.startDemo)
-        self.start_btn.pack(side=LEFT, fill=X, expand=1)
-        self.stop_btn = Button(btn_frame, text=" STOP ",  font=btnfont, fg = "white",
-                                disabledforeground = "#fed", command = self.stopIt)
-        self.stop_btn.pack(side=LEFT, fill=X, expand=1)
-        self.clear_btn = Button(btn_frame, text=" CLEAR ",  font=btnfont, fg = "white",
-                                disabledforeground = "#fed", command = self.clearCanvas)
-        self.clear_btn.pack(side=LEFT, fill=X, expand=1)
-
-        self.btn_frame.pack(side=TOP, fill=BOTH, expand=0)
-        self.graph_frame.pack(side=TOP, fill=BOTH, expand=1)
-
-        Percolator(text).insertfilter(ColorDelegator())
+        Percolator(self.text).insertfilter(ColorDelegator())
         self.dirty = False
         self.exitflag = False
         if filename:
             self.loadfile(filename)
-        self.configGUI(NORMAL, DISABLED, DISABLED, DISABLED,
+        self.configGUI(DISABLED, DISABLED, DISABLED,
                        "Choose example from menu", "black")
         self.state = STARTUP
 
-    def _destroy(self):
-        self.root.destroy()
-        sys.exit()
 
-    def configGUI(self, menu, start, stop, clear, txt="", color="blue"):
-        self.ExamplesBtn.config(state=menu)
+    def onResize(self, event):
+        cwidth = self._canvas.winfo_width()
+        cheight = self._canvas.winfo_height()
+        self._canvas.xview_moveto(0.5*(self.canvwidth-cwidth)/self.canvwidth)
+        self._canvas.yview_moveto(0.5*(self.canvheight-cheight)/self.canvheight)
 
-        self.start_btn.config(state=start)
-        if start == NORMAL:
-            self.start_btn.config(bg="#d00")
+    def makeTextFrame(self, root):
+        self.text_frame = text_frame = Frame(root)
+        self.text = text = Text(text_frame, name='text', padx=5,
+                                wrap='none', width=45)
+
+        self.vbar = vbar = Scrollbar(text_frame, name='vbar')
+        vbar['command'] = text.yview
+        vbar.pack(side=LEFT, fill=Y)
+        self.hbar = hbar = Scrollbar(text_frame, name='hbar', orient=HORIZONTAL)
+        hbar['command'] = text.xview
+        hbar.pack(side=BOTTOM, fill=X)
+        text['yscrollcommand'] = vbar.set
+        text['xscrollcommand'] = hbar.set
+
+        text['font'] = tuple(txtfont)
+        shortcut = 'Command' if darwin else 'Control'
+        text.bind_all('<%s-minus>' % shortcut, self.decrease_size)
+        text.bind_all('<%s-underscore>' % shortcut, self.decrease_size)
+        text.bind_all('<%s-equal>' % shortcut, self.increase_size)
+        text.bind_all('<%s-plus>' % shortcut, self.increase_size)
+        text.bind('<Control-MouseWheel>', self.update_mousewheel)
+        text.bind('<Control-Button-4>', self.increase_size)
+        text.bind('<Control-Button-5>', self.decrease_size)
+
+        text.pack(side=LEFT, fill=BOTH, expand=1)
+        return text_frame
+
+    def makeGraphFrame(self, root):
+        turtle._Screen._root = root
+        self.canvwidth = 1000
+        self.canvheight = 800
+        turtle._Screen._canvas = self._canvas = canvas = turtle.ScrolledCanvas(
+                root, 800, 600, self.canvwidth, self.canvheight)
+        canvas.adjustScrolls()
+        canvas._rootwindow.bind('<Configure>', self.onResize)
+        canvas._canvas['borderwidth'] = 0
+
+        self.screen = _s_ = turtle.Screen()
+        turtle.TurtleScreen.__init__(_s_, _s_._canvas)
+        self.scanvas = _s_._canvas
+        turtle.RawTurtle.screens = [_s_]
+        return canvas
+
+    def set_txtsize(self, size):
+        txtfont[1] = size
+        self.text['font'] = tuple(txtfont)
+        self.output_lbl['text'] = 'Font size %d' % size
+
+    def decrease_size(self, dummy=None):
+        self.set_txtsize(max(txtfont[1] - 1, MINIMUM_FONT_SIZE))
+        return 'break'
+
+    def increase_size(self, dummy=None):
+        self.set_txtsize(min(txtfont[1] + 1, MAXIMUM_FONT_SIZE))
+        return 'break'
+
+    def update_mousewheel(self, event):
+        # For wheel up, event.delte = 120 on Windows, -1 on darwin.
+        # X-11 sends Control-Button-4 event instead.
+        if (event.delta < 0) == (not darwin):
+            return self.decrease_size()
         else:
-            self.start_btn.config(bg="#fca")
+            return self.increase_size()
 
-        self.stop_btn.config(state=stop)
-        if stop == NORMAL:
-            self.stop_btn.config(bg="#d00")
-        else:
-            self.stop_btn.config(bg="#fca")
-        self.clear_btn.config(state=clear)
-
-        self.clear_btn.config(state=clear)
-        if clear == NORMAL:
-            self.clear_btn.config(bg="#d00")
-        else:
-            self.clear_btn.config(bg="#fca")
-
+    def configGUI(self, start, stop, clear, txt="", color="blue"):
+        self.start_btn.config(state=start,
+                              bg="#d00" if start == NORMAL else "#fca")
+        self.stop_btn.config(state=stop,
+                             bg="#d00" if stop == NORMAL else "#fca")
+        self.clear_btn.config(state=clear,
+                              bg="#d00" if clear == NORMAL else"#fca")
         self.output_lbl.config(text=txt, fg=color)
 
-
-    def makeLoadDemoMenu(self):
-        CmdBtn = Menubutton(self.mBar, text='Examples', underline=0, font=menufont)
-        CmdBtn.pack(side=LEFT, padx="2m")
-        CmdBtn.menu = Menu(CmdBtn)
+    def makeLoadDemoMenu(self, master):
+        menu = Menu(master)
 
         for entry in getExampleEntries():
-            def loadexample(x):
-                def emit():
-                    self.loadfile(x)
-                return emit
-            CmdBtn.menu.add_command(label=entry, underline=0,
-                                    font=menufont, command=loadexample(entry))
+            def load(entry=entry):
+                self.loadfile(entry)
+            menu.add_command(label=entry, underline=0,
+                             font=menufont, command=load)
+        return menu
 
-        CmdBtn['menu'] = CmdBtn.menu
-        return CmdBtn
+    def makeFontMenu(self, master):
+        menu = Menu(master)
+        menu.add_command(label="Decrease (C-'-')", command=self.decrease_size,
+                         font=menufont)
+        menu.add_command(label="Increase (C-'+')", command=self.increase_size,
+                         font=menufont)
+        menu.add_separator()
 
-    def makeHelpMenu(self):
-        CmdBtn = Menubutton(self.mBar, text='Help', underline=0, font=menufont)
-        CmdBtn.pack(side=LEFT, padx='2m')
-        CmdBtn.menu = Menu(CmdBtn)
+        for size in font_sizes:
+            def resize(size=size):
+                self.set_txtsize(size)
+            menu.add_command(label=str(size), underline=0,
+                             font=menufont, command=resize)
+        return menu
 
-        CmdBtn.menu.add_command(label='About turtle.py', font=menufont,
-                                command=showAboutTurtle)
-        CmdBtn.menu.add_command(label='turtleDemo - Help', font=menufont,
-                                command=showDemoHelp)
-        CmdBtn.menu.add_command(label='About turtleDemo', font=menufont,
-                                command=showAboutDemo)
+    def makeHelpMenu(self, master):
+        menu = Menu(master)
 
-        CmdBtn['menu'] = CmdBtn.menu
-        return CmdBtn
+        for help_label, help_file in help_entries:
+            def show(help_label=help_label, help_file=help_file):
+                view_text(self.root, help_label, help_file)
+            menu.add_command(label=help_label, font=menufont, command=show)
+        return menu
 
     def refreshCanvas(self):
-        if not self.dirty: return
-        self.screen.clear()
-        #self.screen.mode("standard")
-        self.dirty=False
+        if self.dirty:
+            self.screen.clear()
+            self.dirty=False
 
     def loadfile(self, filename):
-        self.refreshCanvas()
+        self.clearCanvas()
+        turtle.TurtleScreen._RUNNING = False
         modname = 'turtledemo.' + filename
         __import__(modname)
         self.module = sys.modules[modname]
@@ -193,8 +323,7 @@
         self.text.delete("1.0", "end")
         self.text.insert("1.0", chars)
         self.root.title(filename + " - a Python turtle graphics example")
-        reload(self.module)
-        self.configGUI(NORMAL, NORMAL, DISABLED, DISABLED,
+        self.configGUI(NORMAL, DISABLED, DISABLED,
                        "Press start button", "red")
         self.state = READY
 
@@ -202,7 +331,7 @@
         self.refreshCanvas()
         self.dirty = True
         turtle.TurtleScreen._RUNNING = True
-        self.configGUI(DISABLED, DISABLED, NORMAL, DISABLED,
+        self.configGUI(DISABLED, NORMAL, DISABLED,
                        "demo running...", "black")
         self.screen.clear()
         self.screen.mode("standard")
@@ -218,49 +347,34 @@
             self.state = DONE
             result = "stopped!"
         if self.state == DONE:
-            self.configGUI(NORMAL, NORMAL, DISABLED, NORMAL,
+            self.configGUI(NORMAL, DISABLED, NORMAL,
                            result)
         elif self.state == EVENTDRIVEN:
             self.exitflag = True
-            self.configGUI(DISABLED, DISABLED, NORMAL, DISABLED,
+            self.configGUI(DISABLED, NORMAL, DISABLED,
                            "use mouse/keys or STOP", "red")
 
     def clearCanvas(self):
         self.refreshCanvas()
         self.screen._delete("all")
         self.scanvas.config(cursor="")
-        self.configGUI(NORMAL, NORMAL, DISABLED, DISABLED)
+        self.configGUI(NORMAL, DISABLED, DISABLED)
 
     def stopIt(self):
         if self.exitflag:
             self.clearCanvas()
             self.exitflag = False
-            self.configGUI(NORMAL, NORMAL, DISABLED, DISABLED,
+            self.configGUI(NORMAL, DISABLED, DISABLED,
                            "STOPPED!", "red")
-            turtle.TurtleScreen._RUNNING = False
-            #print "stopIT: exitflag = True"
-        else:
-            turtle.TurtleScreen._RUNNING = False
-            #print "stopIt: exitflag = False"
+        turtle.TurtleScreen._RUNNING = False
+
+    def _destroy(self):
+        self.root.destroy()
+
+
+def main():
+    demo = DemoWindow()
+    demo.root.mainloop()
 
 if __name__ == '__main__':
-    demo = DemoWindow()
-    RUN = True
-    while RUN:
-        try:
-            #print("ENTERING mainloop")
-            demo.root.mainloop()
-        except AttributeError:
-            #print("AttributeError!- WAIT A MOMENT!")
-            time.sleep(0.3)
-            print("GOING ON ..")
-            demo.ckearCanvas()
-        except TypeError:
-            demo.screen._delete("all")
-            #print("CRASH!!!- WAIT A MOMENT!")
-            time.sleep(0.3)
-            #print("GOING ON ..")
-            demo.clearCanvas()
-        except:
-            print("BYE!")
-            RUN = False
+    main()
diff --git a/Lib/turtledemo/about_turtle.txt b/Lib/turtledemo/about_turtle.txt
deleted file mode 100644
index d02c7b3..0000000
--- a/Lib/turtledemo/about_turtle.txt
+++ /dev/null
@@ -1,76 +0,0 @@
-
-========================================================
-    A new turtle module for Python
-========================================================
-
-Turtle graphics is a popular way for introducing programming to
-kids. It was part of the original Logo programming language developed
-by Wally Feurzig and Seymour Papert in 1966.
-
-Imagine a robotic turtle starting at (0, 0) in the x-y plane. After an ``import turtle``, give it
-the command turtle.forward(15), and it moves (on-screen!) 15 pixels in
-the direction it is facing, drawing a line as it moves. Give it the
-command turtle.right(25), and it rotates in-place 25 degrees clockwise.
-
-By combining together these and similar commands, intricate shapes and
-pictures can easily be drawn.
-
------ turtle.py
-
-This module is an extended reimplementation of turtle.py from the
-Python standard distribution up to Python 2.5. (See: http:\\www.python.org)
-
-It tries to keep the merits of turtle.py and to be (nearly) 100%
-compatible with it. This means in the first place to enable the
-learning programmer to use all the commands, classes and methods
-interactively when using the module from within IDLE run with
-the -n switch.
-
-Roughly it has the following features added:
-
-- Better animation of the turtle movements, especially of turning the
-    turtle. So the turtles can more easily be used as a visual feedback
-    instrument by the (beginning) programmer.
-
-- Different turtle shapes, gif-images as turtle shapes, user defined
-    and user controllable turtle shapes, among them compound
-    (multicolored) shapes. Turtle shapes can be stgretched and tilted, which
-    makes turtles zu very versatile geometrical objects.
-
-- Fine control over turtle movement and screen updates via delay(),
-    and enhanced tracer() and speed() methods.
-
-- Aliases for the most commonly used commands, like fd for forward etc.,
-    following the early Logo traditions. This reduces the boring work of
-    typing long sequences of commands, which often occur in a natural way
-    when kids try to program fancy pictures on their first encounter with
-    turtle graphcis.
-
-- Turtles now have an undo()-method with configurable undo-buffer.
-
-- Some simple commands/methods for creating event driven programs
-    (mouse-, key-, timer-events). Especially useful for programming games.
-
-- A scrollable Canvas class. The default scrollable Canvas can be
-    extended interactively as needed while playing around with the turtle(s).
-
-- A TurtleScreen class with methods controlling background color or
-    background image, window and canvas size and other properties of the
-    TurtleScreen.
-
-- There is a method, setworldcoordinates(), to install a user defined
-    coordinate-system for the TurtleScreen.
-
-- The implementation uses a 2-vector class named Vec2D, derived from tuple.
-    This class is public, so it can be imported by the application programmer,
-    which makes certain types of computations very natural and compact.
-
-- Appearance of the TurtleScreen and the Turtles at startup/import can be
-    configured by means of a turtle.cfg configuration file.
-    The default configuration mimics the appearance of the old turtle module.
-
-- If configured appropriately the module reads in docstrings from a docstring
-    dictionary in some different language, supplied separately  and replaces
-    the english ones by those read in. There is a utility function
-    write_docstringdict() to write a dictionary with the original (english)
-    docstrings to disc, so it can serve as a template for translations.
diff --git a/Lib/turtledemo/about_turtledemo.txt b/Lib/turtledemo/about_turtledemo.txt
deleted file mode 100644
index a9009bd..0000000
--- a/Lib/turtledemo/about_turtledemo.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-
-    --------------------------------------
-        About this viewer
-    --------------------------------------
-
-    Tiny demo viewer to view turtle graphics example scripts.
-
-    Quickly and dirtyly assembled by Gregor Lingl.
-    June, 2006
-
-    For more information see: turtleDemo - Help
-
-    Have fun!
diff --git a/Lib/turtledemo/chaos.py b/Lib/turtledemo/chaos.py
index d4656f8..6a45d0d 100644
--- a/Lib/turtledemo/chaos.py
+++ b/Lib/turtledemo/chaos.py
@@ -29,8 +29,8 @@
     line(-1, 0, N+1, 0)
     line(0, -0.1, 0, 1.1)
 
-def plot(fun, start, colour):
-    pencolor(colour)
+def plot(fun, start, color):
+    pencolor(color)
     x = start
     jumpto(0, x)
     pendown()
diff --git a/Lib/turtledemo/clock.py b/Lib/turtledemo/clock.py
index a0d157b..62c8851 100755
--- a/Lib/turtledemo/clock.py
+++ b/Lib/turtledemo/clock.py
@@ -13,8 +13,6 @@
 from turtle import *
 from datetime import datetime
 
-mode("logo")
-
 def jump(distanz, winkel=0):
     penup()
     right(winkel)
@@ -42,7 +40,6 @@
     hand_form = get_poly()
     register_shape(name, hand_form)
 
-
 def clockface(radius):
     reset()
     pensize(7)
@@ -83,7 +80,6 @@
     writer.pu()
     writer.bk(85)
 
-
 def wochentag(t):
     wochentag = ["Monday", "Tuesday", "Wednesday",
         "Thursday", "Friday", "Saturday", "Sunday"]
@@ -102,22 +98,25 @@
     sekunde = t.second + t.microsecond*0.000001
     minute = t.minute + sekunde/60.0
     stunde = t.hour + minute/60.0
-    tracer(False)
-    writer.clear()
-    writer.home()
-    writer.forward(65)
-    writer.write(wochentag(t),
-                 align="center", font=("Courier", 14, "bold"))
-    writer.back(150)
-    writer.write(datum(t),
-                 align="center", font=("Courier", 14, "bold"))
-    writer.forward(85)
-    tracer(True)
-    second_hand.setheading(6*sekunde)
-    minute_hand.setheading(6*minute)
-    hour_hand.setheading(30*stunde)
-    tracer(True)
-    ontimer(tick, 100)
+    try:
+        tracer(False)  # Terminator can occur here
+        writer.clear()
+        writer.home()
+        writer.forward(65)
+        writer.write(wochentag(t),
+                     align="center", font=("Courier", 14, "bold"))
+        writer.back(150)
+        writer.write(datum(t),
+                     align="center", font=("Courier", 14, "bold"))
+        writer.forward(85)
+        tracer(True)
+        second_hand.setheading(6*sekunde)  # or here
+        minute_hand.setheading(6*minute)
+        hour_hand.setheading(30*stunde)
+        tracer(True)
+        ontimer(tick, 100)
+    except Terminator:
+        pass  # turtledemo user pressed STOP
 
 def main():
     tracer(False)
@@ -127,6 +126,7 @@
     return "EVENTLOOP"
 
 if __name__ == "__main__":
+    mode("logo")
     msg = main()
     print(msg)
     mainloop()
diff --git a/Lib/turtledemo/colormixer.py b/Lib/turtledemo/colormixer.py
index f5d308d..448db83 100644
--- a/Lib/turtledemo/colormixer.py
+++ b/Lib/turtledemo/colormixer.py
@@ -1,8 +1,6 @@
 # colormixer
 
 from turtle import Screen, Turtle, mainloop
-import sys
-sys.setrecursionlimit(20000)   # overcomes, for now, an instability of Python 3.0
 
 class ColorTurtle(Turtle):
 
diff --git a/Lib/turtledemo/demohelp.txt b/Lib/turtledemo/demohelp.txt
deleted file mode 100644
index fe83bc7..0000000
--- a/Lib/turtledemo/demohelp.txt
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-  ----------------------------------------------
-
-      turtleDemo - Help
-
-  ----------------------------------------------
-
-  This document has two sections:
-
-  (1) How to use the demo viewer
-  (2) How to add your own demos to the demo repository
-
-
-  (1) How to use the demo viewer.
-
-  Select a demoscript from the example menu.
-  The (syntax coloured) source code appears in the left
-  source code window. IT CANNOT BE EDITED, but ONLY VIEWED!
-
-  - Press START button to start the demo.
-  - Stop execution by pressing the STOP button.
-  - Clear screen by pressing the CLEAR button.
-  - Restart by pressing the START button again.
-
-  SPECIAL demos are those which run EVENTDRIVEN.
-  (For example clock.py - or oldTurtleDemo.py which
-  in the end expects a mouse click.):
-
-      Press START button to start the demo.
-
-      - Until the EVENTLOOP is entered everything works
-      as in an ordinary demo script.
-
-      - When the EVENTLOOP is entered, you control the
-      application by using the mouse and/or keys (or it's
-      controlled by some timer events)
-      To stop it you can and must press the STOP button.
-
-      While the EVENTLOOP is running, the examples menu is disabled.
-
-      - Only after having pressed the STOP button, you may
-      restart it or choose another example script.
-
-   * * * * * * * *
-   In some rare situations there may occur interferences/conflicts
-   between events concerning the demo script and those concerning the
-   demo-viewer. (They run in the same process.) Strange behaviour may be
-   the consequence and in the worst case you must close and restart the
-   viewer.
-   * * * * * * * *
-
-
-   (2) How to add your own demos to the demo repository
-
-   - place: same directory as turtledemo/__main__.py
-
-   - requirements on source code:
-       code must contain a main() function which will
-       be executed by the viewer (see provided example scripts)
-       main() may return a string which will be displayed
-       in the Label below the source code window (when execution
-       has finished.) 
-
-       !! For programs, which are EVENT DRIVEN, main must return
-       !! the string "EVENTLOOP". This informs the viewer, that the
-       !! script is still running and must be stopped by the user!
-
-        
-  
diff --git a/Lib/turtledemo/forest.py b/Lib/turtledemo/forest.py
index a837d84..7fe080e 100755
--- a/Lib/turtledemo/forest.py
+++ b/Lib/turtledemo/forest.py
@@ -3,12 +3,12 @@
 
              tdemo_forest.py
 
-Displays a 'forest' of 3 'breadth-first-trees'
-similar to the one from example tree.
-For further remarks see xtx_tree.py
+Displays a 'forest' of 3 breadth-first-trees
+similar to the one in tree.
+For further remarks see tree.py
 
 This example is a 'breadth-first'-rewrite of
-a Logo program written by Erich Neuwirth. See:
+a Logo program written by Erich Neuwirth. See
 http://homepage.univie.ac.at/erich.neuwirth/
 """
 from turtle import Turtle, colormode, tracer, mainloop
@@ -104,6 +104,5 @@
     return "runtime: %.2f sec." % (b-a)
 
 if __name__ == '__main__':
-    msg = main()
-    print(msg)
+    main()
     mainloop()
diff --git a/Lib/turtledemo/minimal_hanoi.py b/Lib/turtledemo/minimal_hanoi.py
index cfb78dc..4a432f2 100755
--- a/Lib/turtledemo/minimal_hanoi.py
+++ b/Lib/turtledemo/minimal_hanoi.py
@@ -50,9 +50,12 @@
 def play():
     onkey(None,"space")
     clear()
-    hanoi(6, t1, t2, t3)
-    write("press STOP button to exit",
-          align="center", font=("Courier", 16, "bold"))
+    try:
+        hanoi(6, t1, t2, t3)
+        write("press STOP button to exit",
+              align="center", font=("Courier", 16, "bold"))
+    except Terminator:
+        pass  # turtledemo user pressed STOP
 
 def main():
     global t1, t2, t3
diff --git a/Lib/turtledemo/nim.py b/Lib/turtledemo/nim.py
index 792ba51..9ae6cc5 100644
--- a/Lib/turtledemo/nim.py
+++ b/Lib/turtledemo/nim.py
@@ -143,7 +143,6 @@
         self.writer.write(msg1, align="center", font=("Courier",14,"bold"))
         self.screen.tracer(True)
 
-
     def setup(self):
         self.screen.tracer(False)
         for row in range(3):
@@ -181,6 +180,7 @@
         if self.game.state == Nim.OVER:
             self.screen.clear()
 
+
 class NimController(object):
 
     def __init__(self, game):
@@ -201,6 +201,7 @@
         self.game.model.notify_move(row, col)
         self.BUSY = False
 
+
 class Nim(object):
     CREATED = 0
     RUNNING = 1
@@ -213,13 +214,12 @@
         self.controller = NimController(self)
 
 
-mainscreen = turtle.Screen()
-mainscreen.mode("standard")
-mainscreen.setup(SCREENWIDTH, SCREENHEIGHT)
-
 def main():
+    mainscreen = turtle.Screen()
+    mainscreen.mode("standard")
+    mainscreen.setup(SCREENWIDTH, SCREENHEIGHT)
     nim = Nim(mainscreen)
-    return "EVENTLOOP!"
+    return "EVENTLOOP"
 
 if __name__ == "__main__":
     main()
diff --git a/Lib/turtledemo/paint.py b/Lib/turtledemo/paint.py
index 68058ab..dde1691 100755
--- a/Lib/turtledemo/paint.py
+++ b/Lib/turtledemo/paint.py
@@ -3,11 +3,15 @@
 
             tdemo_paint.py
 
-A simple  eventdriven paint program
+A simple  event-driven paint program
 
-- use left mouse button to move turtle
-- middle mouse button to change color
-- right mouse button do turn filling on/off
+- left mouse button moves turtle
+- middle mouse button changes color
+- right mouse button toogles betweem pen up
+(no line drawn when the turtle moves) and
+pen down (line is drawn). If pen up follows
+at least two pen-down moves, the polygon that
+includes the starting point is filled.
  -------------------------------------------
  Play around by clicking into the canvas
  using all three mouse buttons.
diff --git a/Lib/turtledemo/peace.py b/Lib/turtledemo/peace.py
index 63cf7cc..e2ba928 100755
--- a/Lib/turtledemo/peace.py
+++ b/Lib/turtledemo/peace.py
@@ -3,14 +3,10 @@
 
               tdemo_peace.py
 
-A very simple drawing suitable as a beginner's
-programming example.
-
-Uses only commands, which are also available in
-old turtle.py.
-
-Intentionally no variables are used except for the
-colorloop:
+A simple drawing suitable as a beginner's
+programming example. Aside from the
+peacecolors assignment and the for loop,
+it only uses turtle commands.
 """
 
 from turtle import *
@@ -21,7 +17,7 @@
                    "royalblue1", "dodgerblue4")
 
     reset()
-    s = Screen()
+    Screen()
     up()
     goto(-320,-195)
     width(70)
@@ -58,7 +54,7 @@
     up()
 
     goto(0,300) # vanish if hideturtle() is not available ;-)
-    return "Done!!"
+    return "Done!"
 
 if __name__ == "__main__":
     main()
diff --git a/Lib/turtledemo/planet_and_moon.py b/Lib/turtledemo/planet_and_moon.py
index 14c4bbc..26abfdb 100755
--- a/Lib/turtledemo/planet_and_moon.py
+++ b/Lib/turtledemo/planet_and_moon.py
@@ -12,9 +12,9 @@
 Planet has a circular orbit, moon a stable
 orbit around the planet.
 
-You can hold the movement temporarily by pressing
-the left mouse button with mouse over the
-scrollbar of the canvas.
+You can hold the movement temporarily by
+pressing the left mouse button with the
+mouse over the scrollbar of the canvas.
 
 """
 from turtle import Shape, Turtle, mainloop, Vec2D as Vec
@@ -108,6 +108,5 @@
     return "Done!"
 
 if __name__ == '__main__':
-    msg = main()
-    print(msg)
-    #mainloop()
+    main()
+    mainloop()
diff --git a/Lib/turtledemo/tree.py b/Lib/turtledemo/tree.py
index 9c0b1f7..71fff35 100755
--- a/Lib/turtledemo/tree.py
+++ b/Lib/turtledemo/tree.py
@@ -11,9 +11,9 @@
 (1) a tree-generator, where the drawing is
 quasi the side-effect, whereas the generator
 always yields None.
-(2) Turtle-cloning: At each branching point the
-current pen is cloned. So in the end there
-are 1024 turtles.
+(2) Turtle-cloning: At each branching point
+the current pen is cloned. So in the end
+there are 1024 turtles.
 """
 from turtle import Turtle, mainloop
 from time import clock
diff --git a/Lib/turtledemo/two_canvases.py b/Lib/turtledemo/two_canvases.py
index 02d89db..d579876 100755
--- a/Lib/turtledemo/two_canvases.py
+++ b/Lib/turtledemo/two_canvases.py
@@ -1,52 +1,54 @@
-#!/usr/bin/env python3
-## DEMONSTRATES USE OF 2 CANVASES, SO CANNOT BE RUN IN DEMOVIEWER!
-"""turtle example: Using TurtleScreen and RawTurtle
-for drawing on two distinct canvases.
+"""turtledemo.two_canvases
+
+Use TurtleScreen and RawTurtle to draw on two
+distinct canvases in a separate windows. The
+new window must be separately closed in
+addition to pressing the STOP button.
 """
+
 from turtle import TurtleScreen, RawTurtle, TK
 
-root = TK.Tk()
-cv1 = TK.Canvas(root, width=300, height=200, bg="#ddffff")
-cv2 = TK.Canvas(root, width=300, height=200, bg="#ffeeee")
-cv1.pack()
-cv2.pack()
+def main():
+    root = TK.Tk()
+    cv1 = TK.Canvas(root, width=300, height=200, bg="#ddffff")
+    cv2 = TK.Canvas(root, width=300, height=200, bg="#ffeeee")
+    cv1.pack()
+    cv2.pack()
 
-s1 = TurtleScreen(cv1)
-s1.bgcolor(0.85, 0.85, 1)
-s2 = TurtleScreen(cv2)
-s2.bgcolor(1, 0.85, 0.85)
+    s1 = TurtleScreen(cv1)
+    s1.bgcolor(0.85, 0.85, 1)
+    s2 = TurtleScreen(cv2)
+    s2.bgcolor(1, 0.85, 0.85)
 
-p = RawTurtle(s1)
-q = RawTurtle(s2)
+    p = RawTurtle(s1)
+    q = RawTurtle(s2)
 
-p.color("red", (1, 0.85, 0.85))
-p.width(3)
-q.color("blue", (0.85, 0.85, 1))
-q.width(3)
+    p.color("red", (1, 0.85, 0.85))
+    p.width(3)
+    q.color("blue", (0.85, 0.85, 1))
+    q.width(3)
 
-for t in p,q:
-    t.shape("turtle")
-    t.lt(36)
+    for t in p,q:
+        t.shape("turtle")
+        t.lt(36)
 
-q.lt(180)
+    q.lt(180)
 
-for t in p, q:
-    t.begin_fill()
-for i in range(5):
     for t in p, q:
-        t.fd(50)
-        t.lt(72)
-for t in p,q:
-    t.end_fill()
-    t.lt(54)
-    t.pu()
-    t.bk(50)
+        t.begin_fill()
+    for i in range(5):
+        for t in p, q:
+            t.fd(50)
+            t.lt(72)
+    for t in p,q:
+        t.end_fill()
+        t.lt(54)
+        t.pu()
+        t.bk(50)
 
-## Want to get some info?
+    return "EVENTLOOP"
 
-#print(s1, s2)
-#print(p, q)
-#print(s1.turtles())
-#print(s2.turtles())
 
-TK.mainloop()
+if __name__ == '__main__':
+    main()
+    TK.mainloop()  # keep window open until user closes it
diff --git a/Lib/types.py b/Lib/types.py
index cfd09ea..7e4fec2 100644
--- a/Lib/types.py
+++ b/Lib/types.py
@@ -99,3 +99,60 @@
                         "must be a (non-strict) subclass "
                         "of the metaclasses of all its bases")
     return winner
+
+class DynamicClassAttribute:
+    """Route attribute access on a class to __getattr__.
+
+    This is a descriptor, used to define attributes that act differently when
+    accessed through an instance and through a class.  Instance access remains
+    normal, but access to an attribute through a class will be routed to the
+    class's __getattr__ method; this is done by raising AttributeError.
+
+    This allows one to have properties active on an instance, and have virtual
+    attributes on the class with the same name (see Enum for an example).
+
+    """
+    def __init__(self, fget=None, fset=None, fdel=None, doc=None):
+        self.fget = fget
+        self.fset = fset
+        self.fdel = fdel
+        # next two lines make DynamicClassAttribute act the same as property
+        self.__doc__ = doc or fget.__doc__
+        self.overwrite_doc = doc is None
+        # support for abstract methods
+        self.__isabstractmethod__ = bool(getattr(fget, '__isabstractmethod__', False))
+
+    def __get__(self, instance, ownerclass=None):
+        if instance is None:
+            if self.__isabstractmethod__:
+                return self
+            raise AttributeError()
+        elif self.fget is None:
+            raise AttributeError("unreadable attribute")
+        return self.fget(instance)
+
+    def __set__(self, instance, value):
+        if self.fset is None:
+            raise AttributeError("can't set attribute")
+        self.fset(instance, value)
+
+    def __delete__(self, instance):
+        if self.fdel is None:
+            raise AttributeError("can't delete attribute")
+        self.fdel(instance)
+
+    def getter(self, fget):
+        fdoc = fget.__doc__ if self.overwrite_doc else None
+        result = type(self)(fget, self.fset, self.fdel, fdoc or self.__doc__)
+        result.overwrite_doc = self.overwrite_doc
+        return result
+
+    def setter(self, fset):
+        result = type(self)(self.fget, fset, self.fdel, self.__doc__)
+        result.overwrite_doc = self.overwrite_doc
+        return result
+
+    def deleter(self, fdel):
+        result = type(self)(self.fget, self.fset, fdel, self.__doc__)
+        result.overwrite_doc = self.overwrite_doc
+        return result
diff --git a/Lib/unittest/__main__.py b/Lib/unittest/__main__.py
index 798ebc0..2663178 100644
--- a/Lib/unittest/__main__.py
+++ b/Lib/unittest/__main__.py
@@ -13,7 +13,6 @@
 
 __unittest = True
 
-from .main import main, TestProgram, USAGE_AS_MAIN
-TestProgram.USAGE = USAGE_AS_MAIN
+from .main import main, TestProgram
 
 main(module=None)
diff --git a/Lib/unittest/case.py b/Lib/unittest/case.py
index f56af55..69888a5 100644
--- a/Lib/unittest/case.py
+++ b/Lib/unittest/case.py
@@ -3,14 +3,17 @@
 import sys
 import functools
 import difflib
+import logging
 import pprint
 import re
 import warnings
 import collections
+import contextlib
+import traceback
 
 from . import result
 from .util import (strclass, safe_repr, _count_diff_all_purpose,
-                   _count_diff_hashable)
+                   _count_diff_hashable, _common_shorten_repr)
 
 __unittest = True
 
@@ -26,17 +29,11 @@
     instead of raising this directly.
     """
 
-class _ExpectedFailure(Exception):
+class _ShouldStop(Exception):
     """
-    Raise this when a test is expected to fail.
-
-    This is an implementation detail.
+    The test should stop.
     """
 
-    def __init__(self, exc_info):
-        super(_ExpectedFailure, self).__init__()
-        self.exc_info = exc_info
-
 class _UnexpectedSuccess(Exception):
     """
     The test was supposed to fail, but it didn't!
@@ -44,13 +41,43 @@
 
 
 class _Outcome(object):
-    def __init__(self):
+    def __init__(self, result=None):
+        self.expecting_failure = False
+        self.result = result
+        self.result_supports_subtests = hasattr(result, "addSubTest")
         self.success = True
-        self.skipped = None
-        self.unexpectedSuccess = None
+        self.skipped = []
         self.expectedFailure = None
         self.errors = []
-        self.failures = []
+
+    @contextlib.contextmanager
+    def testPartExecutor(self, test_case, isTest=False):
+        old_success = self.success
+        self.success = True
+        try:
+            yield
+        except KeyboardInterrupt:
+            raise
+        except SkipTest as e:
+            self.success = False
+            self.skipped.append((test_case, str(e)))
+        except _ShouldStop:
+            pass
+        except:
+            exc_info = sys.exc_info()
+            if self.expecting_failure:
+                self.expectedFailure = exc_info
+            else:
+                self.success = False
+                self.errors.append((test_case, exc_info))
+            # explicitly break a reference cycle:
+            # exc_info -> frame -> exc_info
+            exc_info = None
+        else:
+            if self.result_supports_subtests and self.success:
+                self.errors.append((test_case, None))
+        finally:
+            self.success = self.success and old_success
 
 
 def _id(obj):
@@ -88,22 +115,26 @@
         return skip(reason)
     return _id
 
-
-def expectedFailure(func):
-    @functools.wraps(func)
-    def wrapper(*args, **kwargs):
-        try:
-            func(*args, **kwargs)
-        except Exception:
-            raise _ExpectedFailure(sys.exc_info())
-        raise _UnexpectedSuccess
-    return wrapper
+def expectedFailure(test_item):
+    test_item.__unittest_expecting_failure__ = True
+    return test_item
 
 
-class _AssertRaisesBaseContext(object):
+class _BaseTestCaseContext:
+
+    def __init__(self, test_case):
+        self.test_case = test_case
+
+    def _raiseFailure(self, standardMsg):
+        msg = self.test_case._formatMessage(self.msg, standardMsg)
+        raise self.test_case.failureException(msg)
+
+
+class _AssertRaisesBaseContext(_BaseTestCaseContext):
 
     def __init__(self, expected, test_case, callable_obj=None,
                  expected_regex=None):
+        _BaseTestCaseContext.__init__(self, test_case)
         self.expected = expected
         self.test_case = test_case
         if callable_obj is not None:
@@ -113,15 +144,11 @@
                 self.obj_name = str(callable_obj)
         else:
             self.obj_name = None
-        if isinstance(expected_regex, (bytes, str)):
+        if expected_regex is not None:
             expected_regex = re.compile(expected_regex)
         self.expected_regex = expected_regex
         self.msg = None
 
-    def _raiseFailure(self, standardMsg):
-        msg = self.test_case._formatMessage(self.msg, standardMsg)
-        raise self.test_case.failureException(msg)
-
     def handle(self, name, callable_obj, args, kwargs):
         """
         If callable_obj is None, assertRaises/Warns is being used as a
@@ -135,7 +162,6 @@
             callable_obj(*args, **kwargs)
 
 
-
 class _AssertRaisesContext(_AssertRaisesBaseContext):
     """A context manager used to implement TestCase.assertRaises* methods."""
 
@@ -153,6 +179,8 @@
                                                                 self.obj_name))
             else:
                 self._raiseFailure("{} not raised".format(exc_name))
+        else:
+            traceback.clear_frames(tb)
         if not issubclass(exc_type, self.expected):
             # let unexpected exceptions pass through
             return False
@@ -217,6 +245,74 @@
             self._raiseFailure("{} not triggered".format(exc_name))
 
 
+
+_LoggingWatcher = collections.namedtuple("_LoggingWatcher",
+                                         ["records", "output"])
+
+
+class _CapturingHandler(logging.Handler):
+    """
+    A logging handler capturing all (raw and formatted) logging output.
+    """
+
+    def __init__(self):
+        logging.Handler.__init__(self)
+        self.watcher = _LoggingWatcher([], [])
+
+    def flush(self):
+        pass
+
+    def emit(self, record):
+        self.watcher.records.append(record)
+        msg = self.format(record)
+        self.watcher.output.append(msg)
+
+
+
+class _AssertLogsContext(_BaseTestCaseContext):
+    """A context manager used to implement TestCase.assertLogs()."""
+
+    LOGGING_FORMAT = "%(levelname)s:%(name)s:%(message)s"
+
+    def __init__(self, test_case, logger_name, level):
+        _BaseTestCaseContext.__init__(self, test_case)
+        self.logger_name = logger_name
+        if level:
+            self.level = logging._nameToLevel.get(level, level)
+        else:
+            self.level = logging.INFO
+        self.msg = None
+
+    def __enter__(self):
+        if isinstance(self.logger_name, logging.Logger):
+            logger = self.logger = self.logger_name
+        else:
+            logger = self.logger = logging.getLogger(self.logger_name)
+        formatter = logging.Formatter(self.LOGGING_FORMAT)
+        handler = _CapturingHandler()
+        handler.setFormatter(formatter)
+        self.watcher = handler.watcher
+        self.old_handlers = logger.handlers[:]
+        self.old_level = logger.level
+        self.old_propagate = logger.propagate
+        logger.handlers = [handler]
+        logger.setLevel(self.level)
+        logger.propagate = False
+        return handler.watcher
+
+    def __exit__(self, exc_type, exc_value, tb):
+        self.logger.handlers = self.old_handlers
+        self.logger.propagate = self.old_propagate
+        self.logger.setLevel(self.old_level)
+        if exc_type is not None:
+            # let unexpected exceptions pass through
+            return False
+        if len(self.watcher.records) == 0:
+            self._raiseFailure(
+                "no logs of level {} or higher triggered on {}"
+                .format(logging.getLevelName(self.level), self.logger.name))
+
+
 class TestCase(object):
     """A class whose instances are single test cases.
 
@@ -270,7 +366,7 @@
            not have a method with the specified name.
         """
         self._testMethodName = methodName
-        self._outcomeForDoCleanups = None
+        self._outcome = None
         self._testMethodDoc = 'No test'
         try:
             testMethod = getattr(self, methodName)
@@ -283,6 +379,7 @@
         else:
             self._testMethodDoc = testMethod.__doc__
         self._cleanups = []
+        self._subtest = None
 
         # Map types to custom assertEqual functions that will compare
         # instances of said type in more detail to generate a more useful
@@ -370,44 +467,80 @@
         return "<%s testMethod=%s>" % \
                (strclass(self.__class__), self._testMethodName)
 
-    def _addSkip(self, result, reason):
+    def _addSkip(self, result, test_case, reason):
         addSkip = getattr(result, 'addSkip', None)
         if addSkip is not None:
-            addSkip(self, reason)
+            addSkip(test_case, reason)
         else:
             warnings.warn("TestResult has no addSkip method, skips not reported",
                           RuntimeWarning, 2)
-            result.addSuccess(self)
+            result.addSuccess(test_case)
 
-    def _executeTestPart(self, function, outcome, isTest=False):
+    @contextlib.contextmanager
+    def subTest(self, msg=None, **params):
+        """Return a context manager that will return the enclosed block
+        of code in a subtest identified by the optional message and
+        keyword parameters.  A failure in the subtest marks the test
+        case as failed but resumes execution at the end of the enclosed
+        block, allowing further test code to be executed.
+        """
+        if not self._outcome.result_supports_subtests:
+            yield
+            return
+        parent = self._subtest
+        if parent is None:
+            params_map = collections.ChainMap(params)
+        else:
+            params_map = parent.params.new_child(params)
+        self._subtest = _SubTest(self, msg, params_map)
         try:
-            function()
-        except KeyboardInterrupt:
-            raise
-        except SkipTest as e:
-            outcome.success = False
-            outcome.skipped = str(e)
-        except _UnexpectedSuccess:
-            exc_info = sys.exc_info()
-            outcome.success = False
-            if isTest:
-                outcome.unexpectedSuccess = exc_info
-            else:
-                outcome.errors.append(exc_info)
-        except _ExpectedFailure:
-            outcome.success = False
-            exc_info = sys.exc_info()
-            if isTest:
-                outcome.expectedFailure = exc_info
-            else:
-                outcome.errors.append(exc_info)
-        except self.failureException:
-            outcome.success = False
-            outcome.failures.append(sys.exc_info())
-            exc_info = sys.exc_info()
-        except:
-            outcome.success = False
-            outcome.errors.append(sys.exc_info())
+            with self._outcome.testPartExecutor(self._subtest, isTest=True):
+                yield
+            if not self._outcome.success:
+                result = self._outcome.result
+                if result is not None and result.failfast:
+                    raise _ShouldStop
+            elif self._outcome.expectedFailure:
+                # If the test is expecting a failure, we really want to
+                # stop now and register the expected failure.
+                raise _ShouldStop
+        finally:
+            self._subtest = parent
+
+    def _feedErrorsToResult(self, result, errors):
+        for test, exc_info in errors:
+            if isinstance(test, _SubTest):
+                result.addSubTest(test.test_case, test, exc_info)
+            elif exc_info is not None:
+                if issubclass(exc_info[0], self.failureException):
+                    result.addFailure(test, exc_info)
+                else:
+                    result.addError(test, exc_info)
+
+    def _addExpectedFailure(self, result, exc_info):
+        try:
+            addExpectedFailure = result.addExpectedFailure
+        except AttributeError:
+            warnings.warn("TestResult has no addExpectedFailure method, reporting as passes",
+                          RuntimeWarning)
+            result.addSuccess(self)
+        else:
+            addExpectedFailure(self, exc_info)
+
+    def _addUnexpectedSuccess(self, result):
+        try:
+            addUnexpectedSuccess = result.addUnexpectedSuccess
+        except AttributeError:
+            warnings.warn("TestResult has no addUnexpectedSuccess method, reporting as failure",
+                          RuntimeWarning)
+            # We need to pass an actual exception and traceback to addFailure,
+            # otherwise the legacy result can choke.
+            try:
+                raise _UnexpectedSuccess from None
+            except _UnexpectedSuccess:
+                result.addFailure(self, sys.exc_info())
+        else:
+            addUnexpectedSuccess(self)
 
     def run(self, result=None):
         orig_result = result
@@ -426,46 +559,38 @@
             try:
                 skip_why = (getattr(self.__class__, '__unittest_skip_why__', '')
                             or getattr(testMethod, '__unittest_skip_why__', ''))
-                self._addSkip(result, skip_why)
+                self._addSkip(result, self, skip_why)
             finally:
                 result.stopTest(self)
             return
+        expecting_failure = getattr(testMethod,
+                                    "__unittest_expecting_failure__", False)
+        outcome = _Outcome(result)
         try:
-            outcome = _Outcome()
-            self._outcomeForDoCleanups = outcome
+            self._outcome = outcome
 
-            self._executeTestPart(self.setUp, outcome)
+            with outcome.testPartExecutor(self):
+                self.setUp()
             if outcome.success:
-                self._executeTestPart(testMethod, outcome, isTest=True)
-                self._executeTestPart(self.tearDown, outcome)
+                outcome.expecting_failure = expecting_failure
+                with outcome.testPartExecutor(self, isTest=True):
+                    testMethod()
+                outcome.expecting_failure = False
+                with outcome.testPartExecutor(self):
+                    self.tearDown()
 
             self.doCleanups()
+            for test, reason in outcome.skipped:
+                self._addSkip(result, test, reason)
+            self._feedErrorsToResult(result, outcome.errors)
             if outcome.success:
-                result.addSuccess(self)
-            else:
-                if outcome.skipped is not None:
-                    self._addSkip(result, outcome.skipped)
-                for exc_info in outcome.errors:
-                    result.addError(self, exc_info)
-                for exc_info in outcome.failures:
-                    result.addFailure(self, exc_info)
-                if outcome.unexpectedSuccess is not None:
-                    addUnexpectedSuccess = getattr(result, 'addUnexpectedSuccess', None)
-                    if addUnexpectedSuccess is not None:
-                        addUnexpectedSuccess(self)
+                if expecting_failure:
+                    if outcome.expectedFailure:
+                        self._addExpectedFailure(result, outcome.expectedFailure)
                     else:
-                        warnings.warn("TestResult has no addUnexpectedSuccess method, reporting as failures",
-                                      RuntimeWarning)
-                        result.addFailure(self, outcome.unexpectedSuccess)
-
-                if outcome.expectedFailure is not None:
-                    addExpectedFailure = getattr(result, 'addExpectedFailure', None)
-                    if addExpectedFailure is not None:
-                        addExpectedFailure(self, outcome.expectedFailure)
-                    else:
-                        warnings.warn("TestResult has no addExpectedFailure method, reporting as passes",
-                                      RuntimeWarning)
-                        result.addSuccess(self)
+                        self._addUnexpectedSuccess(result)
+                else:
+                    result.addSuccess(self)
             return result
         finally:
             result.stopTest(self)
@@ -474,14 +599,23 @@
                 if stopTestRun is not None:
                     stopTestRun()
 
+            # explicitly break reference cycles:
+            # outcome.errors -> frame -> outcome -> outcome.errors
+            # outcome.expectedFailure -> frame -> outcome -> outcome.expectedFailure
+            outcome.errors.clear()
+            outcome.expectedFailure = None
+
+            # clear the outcome, no more needed
+            self._outcome = None
+
     def doCleanups(self):
         """Execute all cleanup functions. Normally called for you after
         tearDown."""
-        outcome = self._outcomeForDoCleanups or _Outcome()
+        outcome = self._outcome or _Outcome()
         while self._cleanups:
             function, args, kwargs = self._cleanups.pop()
-            part = lambda: function(*args, **kwargs)
-            self._executeTestPart(part, outcome)
+            with outcome.testPartExecutor(self):
+                function(*args, **kwargs)
 
         # return this for backwards compatibility
         # even though we no longer us it internally
@@ -600,6 +734,28 @@
         context = _AssertWarnsContext(expected_warning, self, callable_obj)
         return context.handle('assertWarns', callable_obj, args, kwargs)
 
+    def assertLogs(self, logger=None, level=None):
+        """Fail unless a log message of level *level* or higher is emitted
+        on *logger_name* or its children.  If omitted, *level* defaults to
+        INFO and *logger* defaults to the root logger.
+
+        This method must be used as a context manager, and will yield
+        a recording object with two attributes: `output` and `records`.
+        At the end of the context manager, the `output` attribute will
+        be a list of the matching formatted log messages and the
+        `records` attribute will be a list of the corresponding LogRecord
+        objects.
+
+        Example::
+
+            with self.assertLogs('foo', level='INFO') as cm:
+                logging.getLogger('foo').info('first message')
+                logging.getLogger('foo.bar').error('second message')
+            self.assertEqual(cm.output, ['INFO:foo:first message',
+                                         'ERROR:foo.bar:second message'])
+        """
+        return _AssertLogsContext(self, logger, level)
+
     def _getAssertEqualityFunc(self, first, second):
         """Get a detailed comparison function for the types of the two args.
 
@@ -629,7 +785,7 @@
     def _baseAssertEqual(self, first, second, msg=None):
         """The default assertEqual implementation, not type specific."""
         if not first == second:
-            standardMsg = '%s != %s' % (safe_repr(first), safe_repr(second))
+            standardMsg = '%s != %s' % _common_shorten_repr(first, second)
             msg = self._formatMessage(msg, standardMsg)
             raise self.failureException(msg)
 
@@ -764,14 +920,9 @@
             if seq1 == seq2:
                 return
 
-            seq1_repr = safe_repr(seq1)
-            seq2_repr = safe_repr(seq2)
-            if len(seq1_repr) > 30:
-                seq1_repr = seq1_repr[:30] + '...'
-            if len(seq2_repr) > 30:
-                seq2_repr = seq2_repr[:30] + '...'
-            elements = (seq_type_name.capitalize(), seq1_repr, seq2_repr)
-            differing = '%ss differ: %s != %s\n' % elements
+            differing = '%ss differ: %s != %s\n' % (
+                    (seq_type_name.capitalize(),) +
+                    _common_shorten_repr(seq1, seq2))
 
             for i in range(min(len1, len2)):
                 try:
@@ -929,7 +1080,7 @@
         self.assertIsInstance(d2, dict, 'Second argument is not a dictionary')
 
         if d1 != d2:
-            standardMsg = '%s != %s' % (safe_repr(d1, True), safe_repr(d2, True))
+            standardMsg = '%s != %s' % _common_shorten_repr(d1, d2)
             diff = ('\n' + '\n'.join(difflib.ndiff(
                            pprint.pformat(d1).splitlines(),
                            pprint.pformat(d2).splitlines())))
@@ -1013,8 +1164,7 @@
             if len(firstlines) == 1 and first.strip('\r\n') == first:
                 firstlines = [first + '\n']
                 secondlines = [second + '\n']
-            standardMsg = '%s != %s' % (safe_repr(first, True),
-                                        safe_repr(second, True))
+            standardMsg = '%s != %s' % _common_shorten_repr(first, second)
             diff = '\n' + ''.join(difflib.ndiff(firstlines, secondlines))
             standardMsg = self._truncateMessage(standardMsg, diff)
             self.fail(self._formatMessage(msg, standardMsg))
@@ -1192,9 +1342,6 @@
                self._testFunc == other._testFunc and \
                self._description == other._description
 
-    def __ne__(self, other):
-        return not self == other
-
     def __hash__(self):
         return hash((type(self), self._setUpFunc, self._tearDownFunc,
                      self._testFunc, self._description))
@@ -1212,3 +1359,39 @@
             return self._description
         doc = self._testFunc.__doc__
         return doc and doc.split("\n")[0].strip() or None
+
+
+class _SubTest(TestCase):
+
+    def __init__(self, test_case, message, params):
+        super().__init__()
+        self._message = message
+        self.test_case = test_case
+        self.params = params
+        self.failureException = test_case.failureException
+
+    def runTest(self):
+        raise NotImplementedError("subtests cannot be run directly")
+
+    def _subDescription(self):
+        parts = []
+        if self._message:
+            parts.append("[{}]".format(self._message))
+        if self.params:
+            params_desc = ', '.join(
+                "{}={!r}".format(k, v)
+                for (k, v) in sorted(self.params.items()))
+            parts.append("({})".format(params_desc))
+        return " ".join(parts) or '(<subtest>)'
+
+    def id(self):
+        return "{} {}".format(self.test_case.id(), self._subDescription())
+
+    def shortDescription(self):
+        """Returns a one-line description of the subtest, or None if no
+        description has been provided.
+        """
+        return self.test_case.shortDescription()
+
+    def __str__(self):
+        return "{} {}".format(self.test_case, self._subDescription())
diff --git a/Lib/unittest/loader.py b/Lib/unittest/loader.py
index 9ab26c1..808c50e 100644
--- a/Lib/unittest/loader.py
+++ b/Lib/unittest/loader.py
@@ -34,6 +34,14 @@
     TestClass = type(classname, (case.TestCase,), attrs)
     return suiteClass((TestClass(methodname),))
 
+def _make_skipped_test(methodname, exception, suiteClass):
+    @case.skip(str(exception))
+    def testSkipped(self):
+        pass
+    attrs = {methodname: testSkipped}
+    TestClass = type("ModuleSkipped", (case.TestCase,), attrs)
+    return suiteClass((TestClass(methodname),))
+
 def _jython_aware_splitext(path):
     if path.lower().endswith('$py.class'):
         return path[:-9]
@@ -53,8 +61,9 @@
     def loadTestsFromTestCase(self, testCaseClass):
         """Return a suite of all tests cases contained in testCaseClass"""
         if issubclass(testCaseClass, suite.TestSuite):
-            raise TypeError("Test cases should not be derived from TestSuite." \
-                                " Maybe you meant to derive from TestCase?")
+            raise TypeError("Test cases should not be derived from "
+                            "TestSuite. Maybe you meant to derive from "
+                            "TestCase?")
         testCaseNames = self.getTestCaseNames(testCaseClass)
         if not testCaseNames and hasattr(testCaseClass, 'runTest'):
             testCaseNames = ['runTest']
@@ -169,6 +178,9 @@
         The pattern is deliberately not stored as a loader attribute so that
         packages can continue discovery themselves. top_level_dir is stored so
         load_tests does not need to pass this argument in to loader.discover().
+
+        Paths are sorted before being imported to ensure reproducible execution
+        order even on filesystems with non-alphabetical ordering like ext3/4.
         """
         set_implicit_top = False
         if top_level_dir is None and self._top_level_dir is not None:
@@ -189,6 +201,8 @@
         self._top_level_dir = top_level_dir
 
         is_not_importable = False
+        is_namespace = False
+        tests = []
         if os.path.isdir(os.path.abspath(start_dir)):
             start_dir = os.path.abspath(start_dir)
             if start_dir != top_level_dir:
@@ -202,15 +216,52 @@
             else:
                 the_module = sys.modules[start_dir]
                 top_part = start_dir.split('.')[0]
-                start_dir = os.path.abspath(os.path.dirname((the_module.__file__)))
+                try:
+                    start_dir = os.path.abspath(
+                       os.path.dirname((the_module.__file__)))
+                except AttributeError:
+                    # look for namespace packages
+                    try:
+                        spec = the_module.__spec__
+                    except AttributeError:
+                        spec = None
+
+                    if spec and spec.loader is None:
+                        if spec.submodule_search_locations is not None:
+                            is_namespace = True
+
+                            for path in the_module.__path__:
+                                if (not set_implicit_top and
+                                    not path.startswith(top_level_dir)):
+                                    continue
+                                self._top_level_dir = \
+                                    (path.split(the_module.__name__
+                                         .replace(".", os.path.sep))[0])
+                                tests.extend(self._find_tests(path,
+                                                              pattern,
+                                                              namespace=True))
+                    elif the_module.__name__ in sys.builtin_module_names:
+                        # builtin module
+                        raise TypeError('Can not use builtin modules '
+                                        'as dotted module names') from None
+                    else:
+                        raise TypeError(
+                            'don\'t know how to discover from {!r}'
+                            .format(the_module)) from None
+
                 if set_implicit_top:
-                    self._top_level_dir = self._get_directory_containing_module(top_part)
-                    sys.path.remove(top_level_dir)
+                    if not is_namespace:
+                        self._top_level_dir = \
+                           self._get_directory_containing_module(top_part)
+                        sys.path.remove(top_level_dir)
+                    else:
+                        sys.path.remove(top_level_dir)
 
         if is_not_importable:
             raise ImportError('Start directory is not importable: %r' % start_dir)
 
-        tests = list(self._find_tests(start_dir, pattern))
+        if not is_namespace:
+            tests = list(self._find_tests(start_dir, pattern))
         return self.suiteClass(tests)
 
     def _get_directory_containing_module(self, module_name):
@@ -243,9 +294,9 @@
         # override this method to use alternative matching strategy
         return fnmatch(path, pattern)
 
-    def _find_tests(self, start_dir, pattern):
+    def _find_tests(self, start_dir, pattern, namespace=False):
         """Used by discovery. Yields test suites it loads."""
-        paths = os.listdir(start_dir)
+        paths = sorted(os.listdir(start_dir))
 
         for path in paths:
             full_path = os.path.join(start_dir, path)
@@ -259,6 +310,8 @@
                 name = self._get_name_from_path(full_path)
                 try:
                     module = self._get_module_from_name(name)
+                except case.SkipTest as e:
+                    yield _make_skipped_test(name, e, self.suiteClass)
                 except:
                     yield _make_failed_import_test(name, self.suiteClass)
                 else:
@@ -274,7 +327,8 @@
                         raise ImportError(msg % (mod_name, module_dir, expected_dir))
                     yield self.loadTestsFromModule(module)
             elif os.path.isdir(full_path):
-                if not os.path.isfile(os.path.join(full_path, '__init__.py')):
+                if (not namespace and
+                    not os.path.isfile(os.path.join(full_path, '__init__.py'))):
                     continue
 
                 load_tests = None
@@ -291,8 +345,8 @@
                         # tests loaded from package file
                         yield tests
                     # recurse into the package
-                    for test in self._find_tests(full_path, pattern):
-                        yield test
+                    yield from self._find_tests(full_path, pattern,
+                                                namespace=namespace)
                 else:
                     try:
                         yield load_tests(self, tests, pattern)
diff --git a/Lib/unittest/main.py b/Lib/unittest/main.py
index ead6493..180df86 100644
--- a/Lib/unittest/main.py
+++ b/Lib/unittest/main.py
@@ -1,7 +1,7 @@
 """Unittest main program"""
 
 import sys
-import optparse
+import argparse
 import os
 
 from . import loader, runner
@@ -9,53 +9,20 @@
 
 __unittest = True
 
-FAILFAST     = "  -f, --failfast   Stop on first failure\n"
-CATCHBREAK   = "  -c, --catch      Catch control-C and display results\n"
-BUFFEROUTPUT = "  -b, --buffer     Buffer stdout and stderr during test runs\n"
-
-USAGE_AS_MAIN = """\
-Usage: %(progName)s [options] [tests]
-
-Options:
-  -h, --help       Show this message
-  -v, --verbose    Verbose output
-  -q, --quiet      Minimal output
-%(failfast)s%(catchbreak)s%(buffer)s
+MAIN_EXAMPLES = """\
 Examples:
-  %(progName)s test_module               - run tests from test_module
-  %(progName)s module.TestClass          - run tests from module.TestClass
-  %(progName)s module.Class.test_method  - run specified test method
-
-[tests] can be a list of any number of test modules, classes and test
-methods.
-
-Alternative Usage: %(progName)s discover [options]
-
-Options:
-  -v, --verbose    Verbose output
-%(failfast)s%(catchbreak)s%(buffer)s  -s directory     Directory to start discovery ('.' default)
-  -p pattern       Pattern to match test files ('test*.py' default)
-  -t directory     Top level directory of project (default to
-                   start directory)
-
-For test discovery all test modules must be importable from the top
-level directory of the project.
+  %(prog)s test_module               - run tests from test_module
+  %(prog)s module.TestClass          - run tests from module.TestClass
+  %(prog)s module.Class.test_method  - run specified test method
 """
 
-USAGE_FROM_MODULE = """\
-Usage: %(progName)s [options] [test] [...]
-
-Options:
-  -h, --help       Show this message
-  -v, --verbose    Verbose output
-  -q, --quiet      Minimal output
-%(failfast)s%(catchbreak)s%(buffer)s
+MODULE_EXAMPLES = """\
 Examples:
-  %(progName)s                               - run default set of tests
-  %(progName)s MyTestSuite                   - run suite 'MyTestSuite'
-  %(progName)s MyTestCase.testSomething      - run MyTestCase.testSomething
-  %(progName)s MyTestCase                    - run all 'test*' test methods
-                                               in MyTestCase
+  %(prog)s                           - run default set of tests
+  %(prog)s MyTestSuite               - run suite 'MyTestSuite'
+  %(prog)s MyTestCase.testSomething  - run MyTestCase.testSomething
+  %(prog)s MyTestCase                - run all 'test*' test methods
+                                       in MyTestCase
 """
 
 def _convert_name(name):
@@ -82,10 +49,11 @@
     """A command-line program that runs a set of tests; this is primarily
        for making test modules conveniently executable.
     """
-    USAGE = USAGE_FROM_MODULE
-
     # defaults for testing
+    module=None
+    verbosity = 1
     failfast = catchbreak = buffer = progName = warnings = None
+    _discovery_parser = None
 
     def __init__(self, module='__main__', defaultTest=None, argv=None,
                     testRunner=None, testLoader=loader.defaultTestLoader,
@@ -127,44 +95,47 @@
     def usageExit(self, msg=None):
         if msg:
             print(msg)
-        usage = {'progName': self.progName, 'catchbreak': '', 'failfast': '',
-                 'buffer': ''}
-        if self.failfast != False:
-            usage['failfast'] = FAILFAST
-        if self.catchbreak != False:
-            usage['catchbreak'] = CATCHBREAK
-        if self.buffer != False:
-            usage['buffer'] = BUFFEROUTPUT
-        print(self.USAGE % usage)
+        if self._discovery_parser is None:
+            self._initArgParsers()
+        self._print_help()
         sys.exit(2)
 
+    def _print_help(self, *args, **kwargs):
+        if self.module is None:
+            print(self._main_parser.format_help())
+            print(MAIN_EXAMPLES % {'prog': self.progName})
+            self._discovery_parser.print_help()
+        else:
+            print(self._main_parser.format_help())
+            print(MODULE_EXAMPLES % {'prog': self.progName})
+
     def parseArgs(self, argv):
-        if ((len(argv) > 1 and argv[1].lower() == 'discover') or
-            (len(argv) == 1 and self.module is None)):
-            self._do_discovery(argv[2:])
-            return
+        self._initArgParsers()
+        if self.module is None:
+            if len(argv) > 1 and argv[1].lower() == 'discover':
+                self._do_discovery(argv[2:])
+                return
+            self._main_parser.parse_args(argv[1:], self)
+            if not self.tests:
+                # this allows "python -m unittest -v" to still work for
+                # test discovery.
+                self._do_discovery([])
+                return
+        else:
+            self._main_parser.parse_args(argv[1:], self)
 
-        parser = self._getOptParser()
-        options, args = parser.parse_args(argv[1:])
-        self._setAttributesFromOptions(options)
-
-        if len(args) == 0 and self.module is None:
-            # this allows "python -m unittest -v" to still work for
-            # test discovery. This means -c / -b / -v / -f options will
-            # be handled twice, which is harmless but not ideal.
-            self._do_discovery(argv[1:])
-            return
-
-        if len(args) == 0 and self.defaultTest is None:
-            # createTests will load tests from self.module
-            self.testNames = None
-        elif len(args) > 0:
-            self.testNames = _convert_names(args)
+        if self.tests:
+            self.testNames = _convert_names(self.tests)
             if __name__ == '__main__':
                 # to support python -m unittest ...
                 self.module = None
-        else:
+        elif self.defaultTest is None:
+            # createTests will load tests from self.module
+            self.testNames = None
+        elif isinstance(self.defaultTest, str):
             self.testNames = (self.defaultTest,)
+        else:
+            self.testNames = list(self.defaultTest)
         self.createTests()
 
     def createTests(self):
@@ -174,76 +145,84 @@
             self.test = self.testLoader.loadTestsFromNames(self.testNames,
                                                            self.module)
 
-    def _getOptParser(self):
-        import optparse
-        parser = optparse.OptionParser()
-        parser.prog = self.progName
-        parser.add_option('-v', '--verbose', dest='verbose', default=False,
-                          help='Verbose output', action='store_true')
-        parser.add_option('-q', '--quiet', dest='quiet', default=False,
-                          help='Quiet output', action='store_true')
+    def _initArgParsers(self):
+        parent_parser = self._getParentArgParser()
+        self._main_parser = self._getMainArgParser(parent_parser)
+        self._discovery_parser = self._getDiscoveryArgParser(parent_parser)
 
-        if self.failfast != False:
-            parser.add_option('-f', '--failfast', dest='failfast', default=False,
-                              help='Stop on first fail or error',
-                              action='store_true')
-        if self.catchbreak != False:
-            parser.add_option('-c', '--catch', dest='catchbreak', default=False,
-                              help='Catch ctrl-C and display results so far',
-                              action='store_true')
-        if self.buffer != False:
-            parser.add_option('-b', '--buffer', dest='buffer', default=False,
-                              help='Buffer stdout and stderr during tests',
-                              action='store_true')
+    def _getParentArgParser(self):
+        parser = argparse.ArgumentParser(add_help=False)
+
+        parser.add_argument('-v', '--verbose', dest='verbosity',
+                            action='store_const', const=2,
+                            help='Verbose output')
+        parser.add_argument('-q', '--quiet', dest='verbosity',
+                            action='store_const', const=0,
+                            help='Quiet output')
+
+        if self.failfast is None:
+            parser.add_argument('-f', '--failfast', dest='failfast',
+                                action='store_true',
+                                help='Stop on first fail or error')
+            self.failfast = False
+        if self.catchbreak is None:
+            parser.add_argument('-c', '--catch', dest='catchbreak',
+                                action='store_true',
+                                help='Catch ctrl-C and display results so far')
+            self.catchbreak = False
+        if self.buffer is None:
+            parser.add_argument('-b', '--buffer', dest='buffer',
+                                action='store_true',
+                                help='Buffer stdout and stderr during tests')
+            self.buffer = False
+
         return parser
 
-    def _setAttributesFromOptions(self, options):
-        # only set options from the parsing here
-        # if they weren't set explicitly in the constructor
-        if self.failfast is None:
-            self.failfast = options.failfast
-        if self.catchbreak is None:
-            self.catchbreak = options.catchbreak
-        if self.buffer is None:
-            self.buffer = options.buffer
+    def _getMainArgParser(self, parent):
+        parser = argparse.ArgumentParser(parents=[parent])
+        parser.prog = self.progName
+        parser.print_help = self._print_help
 
-        if options.verbose:
-            self.verbosity = 2
-        elif options.quiet:
-            self.verbosity = 0
+        parser.add_argument('tests', nargs='*',
+                            help='a list of any number of test modules, '
+                            'classes and test methods.')
 
-    def _addDiscoveryOptions(self, parser):
-        parser.add_option('-s', '--start-directory', dest='start', default='.',
-                          help="Directory to start discovery ('.' default)")
-        parser.add_option('-p', '--pattern', dest='pattern', default='test*.py',
-                          help="Pattern to match tests ('test*.py' default)")
-        parser.add_option('-t', '--top-level-directory', dest='top', default=None,
-                          help='Top level directory of project (defaults to start directory)')
+        return parser
+
+    def _getDiscoveryArgParser(self, parent):
+        parser = argparse.ArgumentParser(parents=[parent])
+        parser.prog = '%s discover' % self.progName
+        parser.epilog = ('For test discovery all test modules must be '
+                         'importable from the top level directory of the '
+                         'project.')
+
+        parser.add_argument('-s', '--start-directory', dest='start',
+                            help="Directory to start discovery ('.' default)")
+        parser.add_argument('-p', '--pattern', dest='pattern',
+                            help="Pattern to match tests ('test*.py' default)")
+        parser.add_argument('-t', '--top-level-directory', dest='top',
+                            help='Top level directory of project (defaults to '
+                                 'start directory)')
+        for arg in ('start', 'pattern', 'top'):
+            parser.add_argument(arg, nargs='?',
+                                default=argparse.SUPPRESS,
+                                help=argparse.SUPPRESS)
+
+        return parser
 
     def _do_discovery(self, argv, Loader=None):
-        if Loader is None:
-            Loader = lambda: self.testLoader
+        self.start = '.'
+        self.pattern = 'test*.py'
+        self.top = None
+        if argv is not None:
+            # handle command line args for test discovery
+            if self._discovery_parser is None:
+                # for testing
+                self._initArgParsers()
+            self._discovery_parser.parse_args(argv, self)
 
-        # handle command line args for test discovery
-        self.progName = '%s discover' % self.progName
-        parser = self._getOptParser()
-        self._addDiscoveryOptions(parser)
-
-        options, args = parser.parse_args(argv)
-        if len(args) > 3:
-            self.usageExit()
-
-        for name, value in zip(('start', 'pattern', 'top'), args):
-            setattr(options, name, value)
-
-        self._setAttributesFromOptions(options)
-
-        start_dir = options.start
-        pattern = options.pattern
-        top_level_dir = options.top
-
-        loader = Loader()
-        self.test = loader.discover(start_dir, pattern, top_level_dir)
+        loader = self.testLoader if Loader is None else Loader()
+        self.test = loader.discover(self.start, self.pattern, self.top)
 
     def runTests(self):
         if self.catchbreak:
diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py
index 073869a..5555774 100644
--- a/Lib/unittest/mock.py
+++ b/Lib/unittest/mock.py
@@ -27,7 +27,7 @@
 import inspect
 import pprint
 import sys
-from functools import wraps
+from functools import wraps, partial
 
 
 BaseExceptions = (BaseException,)
@@ -66,55 +66,45 @@
 )
 
 
-def _getsignature(func, skipfirst, instance=False):
-    if isinstance(func, type) and not instance:
+def _get_signature_object(func, as_instance, eat_self):
+    """
+    Given an arbitrary, possibly callable object, try to create a suitable
+    signature object.
+    Return a (reduced func, signature) tuple, or None.
+    """
+    if isinstance(func, type) and not as_instance:
+        # If it's a type and should be modelled as a type, use __init__.
         try:
             func = func.__init__
         except AttributeError:
-            return
-        skipfirst = True
+            return None
+        # Skip the `self` argument in __init__
+        eat_self = True
     elif not isinstance(func, FunctionTypes):
-        # for classes where instance is True we end up here too
+        # If we really want to model an instance of the passed type,
+        # __call__ should be looked up, not __init__.
         try:
             func = func.__call__
         except AttributeError:
-            return
-
+            return None
+    if eat_self:
+        sig_func = partial(func, None)
+    else:
+        sig_func = func
     try:
-        argspec = inspect.getfullargspec(func)
-    except TypeError:
-        # C function / method, possibly inherited object().__init__
-        return
-
-    regargs, varargs, varkw, defaults, kwonly, kwonlydef, ann = argspec
-
-
-    # instance methods and classmethods need to lose the self argument
-    if getattr(func, '__self__', None) is not None:
-        regargs = regargs[1:]
-    if skipfirst:
-        # this condition and the above one are never both True - why?
-        regargs = regargs[1:]
-
-    signature = inspect.formatargspec(
-        regargs, varargs, varkw, defaults,
-        kwonly, kwonlydef, ann, formatvalue=lambda value: "")
-    return signature[1:-1], func
+        return func, inspect.signature(sig_func)
+    except ValueError:
+        # Certain callable types are not supported by inspect.signature()
+        return None
 
 
 def _check_signature(func, mock, skipfirst, instance=False):
-    if not _callable(func):
+    sig = _get_signature_object(func, instance, skipfirst)
+    if sig is None:
         return
-
-    result = _getsignature(func, skipfirst, instance)
-    if result is None:
-        return
-    signature, func = result
-
-    # can't use self because "self" is common as an argument name
-    # unfortunately even not in the first place
-    src = "lambda _mock_self, %s: None" % signature
-    checksig = eval(src, {})
+    func, sig = sig
+    def checksig(_mock_self, *args, **kwargs):
+        sig.bind(*args, **kwargs)
     _copy_func_details(func, checksig)
     type(mock)._mock_check_sig = checksig
 
@@ -122,11 +112,24 @@
 def _copy_func_details(func, funcopy):
     funcopy.__name__ = func.__name__
     funcopy.__doc__ = func.__doc__
+    try:
+        funcopy.__text_signature__ = func.__text_signature__
+    except AttributeError:
+        pass
     # we explicitly don't copy func.__dict__ into this copy as it would
     # expose original attributes that should be mocked
-    funcopy.__module__ = func.__module__
-    funcopy.__defaults__ = func.__defaults__
-    funcopy.__kwdefaults__ = func.__kwdefaults__
+    try:
+        funcopy.__module__ = func.__module__
+    except AttributeError:
+        pass
+    try:
+        funcopy.__defaults__ = func.__defaults__
+    except AttributeError:
+        pass
+    try:
+        funcopy.__kwdefaults__ = func.__kwdefaults__
+    except AttributeError:
+        pass
 
 
 def _callable(obj):
@@ -166,15 +169,12 @@
         return
 
     skipfirst = isinstance(original, type)
-    result = _getsignature(original, skipfirst, instance)
+    result = _get_signature_object(original, instance, skipfirst)
     if result is None:
-        # was a C function (e.g. object().__init__ ) that can't be mocked
         return
-
-    signature, func = result
-
-    src = "lambda %s: None" % signature
-    checksig = eval(src, {})
+    func, sig = result
+    def checksig(*args, **kwargs):
+        sig.bind(*args, **kwargs)
     _copy_func_details(func, checksig)
 
     name = original.__name__
@@ -343,7 +343,14 @@
         value._mock_name = name
     return True
 
-
+# Internal class to identify if we wrapped an iterator object or not.
+class _MockIter(object):
+    def __init__(self, obj):
+        self.obj = iter(obj)
+    def __iter__(self):
+        return self
+    def __next__(self):
+        return next(self.obj)
 
 class Base(object):
     _mock_return_value = DEFAULT
@@ -368,7 +375,7 @@
     def __init__(
             self, spec=None, wraps=None, name=None, spec_set=None,
             parent=None, _spec_state=None, _new_name='', _new_parent=None,
-            **kwargs
+            _spec_as_instance=False, _eat_self=None, **kwargs
         ):
         if _new_parent is None:
             _new_parent = parent
@@ -382,8 +389,10 @@
         if spec_set is not None:
             spec = spec_set
             spec_set = True
+        if _eat_self is None:
+            _eat_self = parent is not None
 
-        self._mock_add_spec(spec, spec_set)
+        self._mock_add_spec(spec, spec_set, _spec_as_instance, _eat_self)
 
         __dict__['_mock_children'] = {}
         __dict__['_mock_wraps'] = wraps
@@ -428,20 +437,26 @@
         self._mock_add_spec(spec, spec_set)
 
 
-    def _mock_add_spec(self, spec, spec_set):
+    def _mock_add_spec(self, spec, spec_set, _spec_as_instance=False,
+                       _eat_self=False):
         _spec_class = None
+        _spec_signature = None
 
         if spec is not None and not _is_list(spec):
             if isinstance(spec, type):
                 _spec_class = spec
             else:
                 _spec_class = _get_class(spec)
+            res = _get_signature_object(spec,
+                                        _spec_as_instance, _eat_self)
+            _spec_signature = res and res[1]
 
             spec = dir(spec)
 
         __dict__ = self.__dict__
         __dict__['_spec_class'] = _spec_class
         __dict__['_spec_set'] = spec_set
+        __dict__['_spec_signature'] = _spec_signature
         __dict__['_mock_methods'] = spec
 
 
@@ -487,7 +502,11 @@
         delegated = self._mock_delegate
         if delegated is None:
             return self._mock_side_effect
-        return delegated.side_effect
+        sf = delegated.side_effect
+        if sf is not None and not callable(sf) and not isinstance(sf, _MockIter):
+            sf = _MockIter(sf)
+            delegated.side_effect = sf
+        return sf
 
     def __set_side_effect(self, value):
         value = _try_iter(value)
@@ -695,7 +714,6 @@
         self._mock_children[name] = _deleted
 
 
-
     def _format_mock_call_signature(self, args, kwargs):
         name = self._mock_name or 'mock'
         return _format_call_signature(name, args, kwargs)
@@ -711,6 +729,28 @@
         return message % (expected_string, actual_string)
 
 
+    def _call_matcher(self, _call):
+        """
+        Given a call (or simply a (args, kwargs) tuple), return a
+        comparison key suitable for matching with other calls.
+        This is a best effort method which relies on the spec's signature,
+        if available, or falls back on the arguments themselves.
+        """
+        sig = self._spec_signature
+        if sig is not None:
+            if len(_call) == 2:
+                name = ''
+                args, kwargs = _call
+            else:
+                name, args, kwargs = _call
+            try:
+                return name, sig.bind(*args, **kwargs)
+            except TypeError as e:
+                return e.with_traceback(None)
+        else:
+            return _call
+
+
     def assert_called_with(_mock_self, *args, **kwargs):
         """assert that the mock was called with the specified arguments.
 
@@ -721,9 +761,14 @@
             expected = self._format_mock_call_signature(args, kwargs)
             raise AssertionError('Expected call: %s\nNot called' % (expected,))
 
-        if self.call_args != (args, kwargs):
+        def _error_message():
             msg = self._format_mock_failure_message(args, kwargs)
-            raise AssertionError(msg)
+            return msg
+        expected = self._call_matcher((args, kwargs))
+        actual = self._call_matcher(self.call_args)
+        if expected != actual:
+            cause = expected if isinstance(expected, Exception) else None
+            raise AssertionError(_error_message()) from cause
 
 
     def assert_called_once_with(_mock_self, *args, **kwargs):
@@ -747,18 +792,21 @@
 
         If `any_order` is True then the calls can be in any order, but
         they must all appear in `mock_calls`."""
+        expected = [self._call_matcher(c) for c in calls]
+        cause = expected if isinstance(expected, Exception) else None
+        all_calls = _CallList(self._call_matcher(c) for c in self.mock_calls)
         if not any_order:
-            if calls not in self.mock_calls:
+            if expected not in all_calls:
                 raise AssertionError(
                     'Calls not found.\nExpected: %r\n'
                     'Actual: %r' % (calls, self.mock_calls)
-                )
+                ) from cause
             return
 
-        all_calls = list(self.mock_calls)
+        all_calls = list(all_calls)
 
         not_found = []
-        for kall in calls:
+        for kall in expected:
             try:
                 all_calls.remove(kall)
             except ValueError:
@@ -766,7 +814,7 @@
         if not_found:
             raise AssertionError(
                 '%r not all found in call list' % (tuple(not_found),)
-            )
+            ) from cause
 
 
     def assert_any_call(self, *args, **kwargs):
@@ -775,12 +823,14 @@
         The assert passes if the mock has *ever* been called, unlike
         `assert_called_with` and `assert_called_once_with` that only pass if
         the call is the most recent one."""
-        kall = call(*args, **kwargs)
-        if kall not in self.call_args_list:
+        expected = self._call_matcher((args, kwargs))
+        actual = [self._call_matcher(c) for c in self.call_args_list]
+        if expected not in actual:
+            cause = expected if isinstance(expected, Exception) else None
             expected_string = self._format_mock_call_signature(args, kwargs)
             raise AssertionError(
                 '%s call not found' % expected_string
-            )
+            ) from cause
 
 
     def _get_child_mock(self, **kw):
@@ -850,11 +900,12 @@
         self = _mock_self
         self.called = True
         self.call_count += 1
-        self.call_args = _Call((args, kwargs), two=True)
-        self.call_args_list.append(_Call((args, kwargs), two=True))
-
         _new_name = self._mock_new_name
         _new_parent = self._mock_new_parent
+
+        _call = _Call((args, kwargs), two=True)
+        self.call_args = _call
+        self.call_args_list.append(_call)
         self.mock_calls.append(_Call(('', args, kwargs)))
 
         seen = set()
@@ -909,8 +960,6 @@
                 return result
 
             ret_val = effect(*args, **kwargs)
-            if ret_val is DEFAULT:
-                ret_val = self.return_value
 
         if (self._mock_wraps is not None and
              self._mock_return_value is DEFAULT):
@@ -1001,7 +1050,7 @@
 class _patch(object):
 
     attribute_name = None
-    _active_patches = set()
+    _active_patches = []
 
     def __init__(
             self, getter, attribute, new, spec, create,
@@ -1274,13 +1323,18 @@
     def start(self):
         """Activate a patch, returning any created mock."""
         result = self.__enter__()
-        self._active_patches.add(self)
+        self._active_patches.append(self)
         return result
 
 
     def stop(self):
         """Stop an active patch."""
-        self._active_patches.discard(self)
+        try:
+            self._active_patches.remove(self)
+        except ValueError:
+            # If the patch hasn't been started this will fail
+            pass
+
         return self.__exit__()
 
 
@@ -1573,8 +1627,8 @@
 
 
 def _patch_stopall():
-    """Stop all active patches."""
-    for patch in list(_patch._active_patches):
+    """Stop all active patches. LIFO to unroll nested patches."""
+    for patch in reversed(_patch._active_patches):
         patch.stop()
 
 
@@ -1596,7 +1650,9 @@
     "bool next "
 )
 
-numerics = "add sub mul div floordiv mod lshift rshift and xor or pow "
+numerics = (
+    "add sub mul div floordiv mod lshift rshift and xor or pow truediv"
+)
 inplace = ' '.join('i%s' % n for n in numerics.split())
 right = ' '.join('r%s' % n for n in numerics.split())
 
@@ -2030,6 +2086,8 @@
     elif spec is None:
         # None we mock with a normal mock without a spec
         _kwargs = {}
+    if _kwargs and instance:
+        _kwargs['_spec_as_instance'] = True
 
     _kwargs.update(kwargs)
 
@@ -2043,6 +2101,8 @@
     elif is_type and instance and not _instance_callable(spec):
         Klass = NonCallableMagicMock
 
+    _name = _kwargs.pop('name', _name)
+
     _new_name = _name
     if _parent is None:
         # for a top level object no _new_name should be set
@@ -2096,10 +2156,12 @@
             if isinstance(spec, FunctionTypes):
                 parent = mock.mock
 
-            new = MagicMock(parent=parent, name=entry, _new_name=entry,
-                            _new_parent=parent, **kwargs)
-            mock._mock_children[entry] = new
             skipfirst = _must_skip(spec, entry, is_type)
+            kwargs['_eat_self'] = skipfirst
+            new = MagicMock(parent=parent, name=entry, _new_name=entry,
+                            _new_parent=parent,
+                            **kwargs)
+            mock._mock_children[entry] = new
             _check_signature(original, new, skipfirst=skipfirst)
 
         # so functions created with _set_signature become instance attributes,
@@ -2113,6 +2175,10 @@
 
 
 def _must_skip(spec, entry, is_type):
+    """
+    Return whether we should skip the first argument on spec's `entry`
+    attribute.
+    """
     if not isinstance(spec, type):
         if entry in getattr(spec, '__dict__', {}):
             # instance attribute - shouldn't skip
@@ -2125,7 +2191,12 @@
             continue
         if isinstance(result, (staticmethod, classmethod)):
             return False
-        return is_type
+        elif isinstance(getattr(result, '__get__', None), MethodWrapperTypes):
+            # Normal method => skip if looked up on type
+            # (if looked up on instance, self is already skipped)
+            return is_type
+        else:
+            return False
 
     # shouldn't get here unless function is a dynamically provided attribute
     # XXXX untested behaviour
@@ -2159,9 +2230,31 @@
     type(ANY.__eq__),
 )
 
+MethodWrapperTypes = (
+    type(ANY.__eq__.__get__),
+)
+
 
 file_spec = None
 
+def _iterate_read_data(read_data):
+    # Helper for mock_open:
+    # Retrieve lines from read_data via a generator so that separate calls to
+    # readline, read, and readlines are properly interleaved
+    data_as_list = ['{}\n'.format(l) for l in read_data.split('\n')]
+
+    if data_as_list[-1] == '\n':
+        # If the last line ended in a newline, the list comprehension will have an
+        # extra entry that's just a newline.  Remove this.
+        data_as_list = data_as_list[:-1]
+    else:
+        # If there wasn't an extra newline by itself, then the file being
+        # emulated doesn't have a newline to end the last line  remove the
+        # newline that our naive format() added
+        data_as_list[-1] = data_as_list[-1][:-1]
+
+    for line in data_as_list:
+        yield line
 
 def mock_open(mock=None, read_data=''):
     """
@@ -2172,9 +2265,27 @@
     default) then a `MagicMock` will be created for you, with the API limited
     to methods or attributes available on standard file handles.
 
-    `read_data` is a string for the `read` method of the file handle to return.
-    This is an empty string by default.
+    `read_data` is a string for the `read` methoddline`, and `readlines` of the
+    file handle to return.  This is an empty string by default.
     """
+    def _readlines_side_effect(*args, **kwargs):
+        if handle.readlines.return_value is not None:
+            return handle.readlines.return_value
+        return list(_data)
+
+    def _read_side_effect(*args, **kwargs):
+        if handle.read.return_value is not None:
+            return handle.read.return_value
+        return ''.join(_data)
+
+    def _readline_side_effect():
+        if handle.readline.return_value is not None:
+            while True:
+                yield handle.readline.return_value
+        for line in _data:
+            yield line
+
+
     global file_spec
     if file_spec is None:
         import _io
@@ -2184,9 +2295,18 @@
         mock = MagicMock(name='open', spec=open)
 
     handle = MagicMock(spec=file_spec)
-    handle.write.return_value = None
     handle.__enter__.return_value = handle
-    handle.read.return_value = read_data
+
+    _data = _iterate_read_data(read_data)
+
+    handle.write.return_value = None
+    handle.read.return_value = None
+    handle.readline.return_value = None
+    handle.readlines.return_value = None
+
+    handle.read.side_effect = _read_side_effect
+    handle.readline.side_effect = _readline_side_effect()
+    handle.readlines.side_effect = _readlines_side_effect
 
     mock.return_value = handle
     return mock
diff --git a/Lib/unittest/result.py b/Lib/unittest/result.py
index 97e5426..8e0a643 100644
--- a/Lib/unittest/result.py
+++ b/Lib/unittest/result.py
@@ -121,6 +121,23 @@
         self.failures.append((test, self._exc_info_to_string(err, test)))
         self._mirrorOutput = True
 
+    def addSubTest(self, test, subtest, err):
+        """Called at the end of a subtest.
+        'err' is None if the subtest ended successfully, otherwise it's a
+        tuple of values as returned by sys.exc_info().
+        """
+        # By default, we don't do anything with successful subtests, but
+        # more sophisticated test results might want to record them.
+        if err is not None:
+            if getattr(self, 'failfast', False):
+                self.stop()
+            if issubclass(err[0], test.failureException):
+                errors = self.failures
+            else:
+                errors = self.errors
+            errors.append((subtest, self._exc_info_to_string(err, test)))
+            self._mirrorOutput = True
+
     def addSuccess(self, test):
         "Called when a test has completed successfully"
         pass
@@ -140,11 +157,16 @@
         self.unexpectedSuccesses.append(test)
 
     def wasSuccessful(self):
-        "Tells whether or not this result was a success"
-        return len(self.failures) == len(self.errors) == 0
+        """Tells whether or not this result was a success."""
+        # The hasattr check is for test_result's OldResult test.  That
+        # way this method works on objects that lack the attribute.
+        # (where would such result intances come from? old stored pickles?)
+        return ((len(self.failures) == len(self.errors) == 0) and
+                (not hasattr(self, 'unexpectedSuccesses') or
+                 len(self.unexpectedSuccesses) == 0))
 
     def stop(self):
-        "Indicates that the tests should be aborted"
+        """Indicates that the tests should be aborted."""
         self.shouldStop = True
 
     def _exc_info_to_string(self, err, test):
diff --git a/Lib/unittest/suite.py b/Lib/unittest/suite.py
index cde5d38..76c4725 100644
--- a/Lib/unittest/suite.py
+++ b/Lib/unittest/suite.py
@@ -16,8 +16,11 @@
 class BaseTestSuite(object):
     """A simple test suite that doesn't provide class or module shared fixtures.
     """
+    _cleanup = True
+
     def __init__(self, tests=()):
         self._tests = []
+        self._removed_tests = 0
         self.addTests(tests)
 
     def __repr__(self):
@@ -28,16 +31,14 @@
             return NotImplemented
         return list(self) == list(other)
 
-    def __ne__(self, other):
-        return not self == other
-
     def __iter__(self):
         return iter(self._tests)
 
     def countTestCases(self):
-        cases = 0
+        cases = self._removed_tests
         for test in self:
-            cases += test.countTestCases()
+            if test:
+                cases += test.countTestCases()
         return cases
 
     def addTest(self, test):
@@ -57,12 +58,28 @@
             self.addTest(test)
 
     def run(self, result):
-        for test in self:
+        for index, test in enumerate(self):
             if result.shouldStop:
                 break
             test(result)
+            if self._cleanup:
+                self._removeTestAtIndex(index)
         return result
 
+    def _removeTestAtIndex(self, index):
+        """Stop holding a reference to the TestCase at index."""
+        try:
+            test = self._tests[index]
+        except TypeError:
+            # support for suite implementations that have overriden self._tests
+            pass
+        else:
+            # Some unittest tests add non TestCase/TestSuite objects to
+            # the suite.
+            if hasattr(test, 'countTestCases'):
+                self._removed_tests += test.countTestCases()
+            self._tests[index] = None
+
     def __call__(self, *args, **kwds):
         return self.run(*args, **kwds)
 
@@ -87,7 +104,7 @@
         if getattr(result, '_testRunEntered', False) is False:
             result._testRunEntered = topLevel = True
 
-        for test in self:
+        for index, test in enumerate(self):
             if result.shouldStop:
                 break
 
@@ -106,6 +123,9 @@
             else:
                 test.debug()
 
+            if self._cleanup:
+                self._removeTestAtIndex(index)
+
         if topLevel:
             self._tearDownPreviousClass(None, result)
             self._handleModuleTearDown(result)
diff --git a/Lib/unittest/test/__main__.py b/Lib/unittest/test/__main__.py
new file mode 100644
index 0000000..44d0591
--- /dev/null
+++ b/Lib/unittest/test/__main__.py
@@ -0,0 +1,18 @@
+import os
+import unittest
+
+
+def load_tests(loader, standard_tests, pattern):
+    # top level directory cached on loader instance
+    this_dir = os.path.dirname(__file__)
+    pattern = pattern or "test_*.py"
+    # We are inside unittest.test, so the top-level is two notches up
+    top_level_dir = os.path.dirname(os.path.dirname(this_dir))
+    package_tests = loader.discover(start_dir=this_dir, pattern=pattern,
+                                    top_level_dir=top_level_dir)
+    standard_tests.addTests(package_tests)
+    return standard_tests
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Lib/unittest/test/support.py b/Lib/unittest/test/support.py
index dbe4ddc..02e8f3a 100644
--- a/Lib/unittest/test/support.py
+++ b/Lib/unittest/test/support.py
@@ -41,7 +41,7 @@
                 self.fail("Problem hashing %s and %s: %s" % (obj_1, obj_2, e))
 
 
-class LoggingResult(unittest.TestResult):
+class _BaseLoggingResult(unittest.TestResult):
     def __init__(self, log):
         self._events = log
         super().__init__()
@@ -52,7 +52,7 @@
 
     def startTestRun(self):
         self._events.append('startTestRun')
-        super(LoggingResult, self).startTestRun()
+        super().startTestRun()
 
     def stopTest(self, test):
         self._events.append('stopTest')
@@ -60,7 +60,7 @@
 
     def stopTestRun(self):
         self._events.append('stopTestRun')
-        super(LoggingResult, self).stopTestRun()
+        super().stopTestRun()
 
     def addFailure(self, *args):
         self._events.append('addFailure')
@@ -68,7 +68,7 @@
 
     def addSuccess(self, *args):
         self._events.append('addSuccess')
-        super(LoggingResult, self).addSuccess(*args)
+        super().addSuccess(*args)
 
     def addError(self, *args):
         self._events.append('addError')
@@ -76,15 +76,39 @@
 
     def addSkip(self, *args):
         self._events.append('addSkip')
-        super(LoggingResult, self).addSkip(*args)
+        super().addSkip(*args)
 
     def addExpectedFailure(self, *args):
         self._events.append('addExpectedFailure')
-        super(LoggingResult, self).addExpectedFailure(*args)
+        super().addExpectedFailure(*args)
 
     def addUnexpectedSuccess(self, *args):
         self._events.append('addUnexpectedSuccess')
-        super(LoggingResult, self).addUnexpectedSuccess(*args)
+        super().addUnexpectedSuccess(*args)
+
+
+class LegacyLoggingResult(_BaseLoggingResult):
+    """
+    A legacy TestResult implementation, without an addSubTest method,
+    which records its method calls.
+    """
+
+    @property
+    def addSubTest(self):
+        raise AttributeError
+
+
+class LoggingResult(_BaseLoggingResult):
+    """
+    A TestResult implementation which records its method calls.
+    """
+
+    def addSubTest(self, test, subtest, err):
+        if err is None:
+            self._events.append('addSubTestSuccess')
+        else:
+            self._events.append('addSubTestFailure')
+        super().addSubTest(test, subtest, err)
 
 
 class ResultWithNoStartTestRunStopTestRun(object):
diff --git a/Lib/unittest/test/test_assertions.py b/Lib/unittest/test/test_assertions.py
index 7931cad..c349a95 100644
--- a/Lib/unittest/test/test_assertions.py
+++ b/Lib/unittest/test/test_assertions.py
@@ -1,5 +1,6 @@
 import datetime
 import warnings
+import weakref
 import unittest
 from itertools import product
 
@@ -97,6 +98,36 @@
         else:
             self.fail("assertRaises() didn't let exception pass through")
 
+    def test_assertRaises_frames_survival(self):
+        # Issue #9815: assertRaises should avoid keeping local variables
+        # in a traceback alive.
+        class A:
+            pass
+        wr = None
+
+        class Foo(unittest.TestCase):
+
+            def foo(self):
+                nonlocal wr
+                a = A()
+                wr = weakref.ref(a)
+                try:
+                    raise IOError
+                except IOError:
+                    raise ValueError
+
+            def test_functional(self):
+                self.assertRaises(ValueError, self.foo)
+
+            def test_with(self):
+                with self.assertRaises(ValueError):
+                    self.foo()
+
+        Foo("test_functional").run()
+        self.assertIsNone(wr())
+        Foo("test_with").run()
+        self.assertIsNone(wr())
+
     def testAssertNotRegex(self):
         self.assertNotRegex('Ala ma kota', r'r+')
         try:
@@ -361,3 +392,7 @@
                               ['^"regex" does not match "foo"$', '^oops$',
                                '^"regex" does not match "foo"$',
                                '^"regex" does not match "foo" : oops$'])
+
+
+if __name__ == "__main__":
+    unittest.main()
diff --git a/Lib/unittest/test/test_break.py b/Lib/unittest/test/test_break.py
index 75532f4..0bf1a22 100644
--- a/Lib/unittest/test/test_break.py
+++ b/Lib/unittest/test/test_break.py
@@ -282,3 +282,7 @@
     "if threads have been used")
 class TestBreakSignalDefault(TestBreak):
     int_handler = signal.SIG_DFL
+
+
+if __name__ == "__main__":
+    unittest.main()
diff --git a/Lib/unittest/test/test_case.py b/Lib/unittest/test/test_case.py
index b8cb0c7..c7ff3b0 100644
--- a/Lib/unittest/test/test_case.py
+++ b/Lib/unittest/test/test_case.py
@@ -1,8 +1,10 @@
+import contextlib
 import difflib
 import pprint
 import pickle
 import re
 import sys
+import logging
 import warnings
 import weakref
 import inspect
@@ -12,10 +14,16 @@
 
 import unittest
 
-from .support import (
-    TestEquality, TestHashing, LoggingResult,
+from unittest.test.support import (
+    TestEquality, TestHashing, LoggingResult, LegacyLoggingResult,
     ResultWithNoStartTestRunStopTestRun
 )
+from test.support import captured_stderr
+
+
+log_foo = logging.getLogger('foo')
+log_foobar = logging.getLogger('foo.bar')
+log_quux = logging.getLogger('quux')
 
 
 class Test(object):
@@ -297,6 +305,126 @@
 
         Foo('test').run()
 
+    def _check_call_order__subtests(self, result, events, expected_events):
+        class Foo(Test.LoggingTestCase):
+            def test(self):
+                super(Foo, self).test()
+                for i in [1, 2, 3]:
+                    with self.subTest(i=i):
+                        if i == 1:
+                            self.fail('failure')
+                        for j in [2, 3]:
+                            with self.subTest(j=j):
+                                if i * j == 6:
+                                    raise RuntimeError('raised by Foo.test')
+                1 / 0
+
+        # Order is the following:
+        # i=1 => subtest failure
+        # i=2, j=2 => subtest success
+        # i=2, j=3 => subtest error
+        # i=3, j=2 => subtest error
+        # i=3, j=3 => subtest success
+        # toplevel => error
+        Foo(events).run(result)
+        self.assertEqual(events, expected_events)
+
+    def test_run_call_order__subtests(self):
+        events = []
+        result = LoggingResult(events)
+        expected = ['startTest', 'setUp', 'test', 'tearDown',
+                    'addSubTestFailure', 'addSubTestSuccess',
+                    'addSubTestFailure', 'addSubTestFailure',
+                    'addSubTestSuccess', 'addError', 'stopTest']
+        self._check_call_order__subtests(result, events, expected)
+
+    def test_run_call_order__subtests_legacy(self):
+        # With a legacy result object (without a addSubTest method),
+        # text execution stops after the first subtest failure.
+        events = []
+        result = LegacyLoggingResult(events)
+        expected = ['startTest', 'setUp', 'test', 'tearDown',
+                    'addFailure', 'stopTest']
+        self._check_call_order__subtests(result, events, expected)
+
+    def _check_call_order__subtests_success(self, result, events, expected_events):
+        class Foo(Test.LoggingTestCase):
+            def test(self):
+                super(Foo, self).test()
+                for i in [1, 2]:
+                    with self.subTest(i=i):
+                        for j in [2, 3]:
+                            with self.subTest(j=j):
+                                pass
+
+        Foo(events).run(result)
+        self.assertEqual(events, expected_events)
+
+    def test_run_call_order__subtests_success(self):
+        events = []
+        result = LoggingResult(events)
+        # The 6 subtest successes are individually recorded, in addition
+        # to the whole test success.
+        expected = (['startTest', 'setUp', 'test', 'tearDown']
+                    + 6 * ['addSubTestSuccess']
+                    + ['addSuccess', 'stopTest'])
+        self._check_call_order__subtests_success(result, events, expected)
+
+    def test_run_call_order__subtests_success_legacy(self):
+        # With a legacy result, only the whole test success is recorded.
+        events = []
+        result = LegacyLoggingResult(events)
+        expected = ['startTest', 'setUp', 'test', 'tearDown',
+                    'addSuccess', 'stopTest']
+        self._check_call_order__subtests_success(result, events, expected)
+
+    def test_run_call_order__subtests_failfast(self):
+        events = []
+        result = LoggingResult(events)
+        result.failfast = True
+
+        class Foo(Test.LoggingTestCase):
+            def test(self):
+                super(Foo, self).test()
+                with self.subTest(i=1):
+                    self.fail('failure')
+                with self.subTest(i=2):
+                    self.fail('failure')
+                self.fail('failure')
+
+        expected = ['startTest', 'setUp', 'test', 'tearDown',
+                    'addSubTestFailure', 'stopTest']
+        Foo(events).run(result)
+        self.assertEqual(events, expected)
+
+    def test_subtests_failfast(self):
+        # Ensure proper test flow with subtests and failfast (issue #22894)
+        events = []
+
+        class Foo(unittest.TestCase):
+            def test_a(self):
+                with self.subTest():
+                    events.append('a1')
+                events.append('a2')
+
+            def test_b(self):
+                with self.subTest():
+                    events.append('b1')
+                with self.subTest():
+                    self.fail('failure')
+                events.append('b2')
+
+            def test_c(self):
+                events.append('c')
+
+        result = unittest.TestResult()
+        result.failfast = True
+        suite = unittest.makeSuite(Foo)
+        suite.run(result)
+
+        expected = ['a1', 'a2', 'b1']
+        self.assertEqual(events, expected)
+
     # "This class attribute gives the exception raised by the test() method.
     # If a test framework needs to use a specialized exception, possibly to
     # carry additional information, it must subclass this exception in
@@ -729,18 +857,18 @@
 
         # set a lower threshold value and add a cleanup to restore it
         old_threshold = self._diffThreshold
-        self._diffThreshold = 2**8
+        self._diffThreshold = 2**5
         self.addCleanup(lambda: setattr(self, '_diffThreshold', old_threshold))
 
         # under the threshold: diff marker (^) in error message
-        s = 'x' * (2**7)
+        s = 'x' * (2**4)
         with self.assertRaises(self.failureException) as cm:
             self.assertEqual(s + 'a', s + 'b')
         self.assertIn('^', str(cm.exception))
         self.assertEqual(s + 'a', s + 'a')
 
         # over the threshold: diff not used and marker (^) not in error message
-        s = 'x' * (2**9)
+        s = 'x' * (2**6)
         # if the path that uses difflib is taken, _truncateMessage will be
         # called -- replace it with explodingTruncation to verify that this
         # doesn't happen
@@ -757,6 +885,35 @@
         self.assertEqual(str(cm.exception), '%r != %r' % (s1, s2))
         self.assertEqual(s + 'a', s + 'a')
 
+    def testAssertEqual_shorten(self):
+        # set a lower threshold value and add a cleanup to restore it
+        old_threshold = self._diffThreshold
+        self._diffThreshold = 0
+        self.addCleanup(lambda: setattr(self, '_diffThreshold', old_threshold))
+
+        s = 'x' * 100
+        s1, s2 = s + 'a', s + 'b'
+        with self.assertRaises(self.failureException) as cm:
+            self.assertEqual(s1, s2)
+        c = 'xxxx[35 chars]' + 'x' * 61
+        self.assertEqual(str(cm.exception), "'%sa' != '%sb'" % (c, c))
+        self.assertEqual(s + 'a', s + 'a')
+
+        p = 'y' * 50
+        s1, s2 = s + 'a' + p, s + 'b' + p
+        with self.assertRaises(self.failureException) as cm:
+            self.assertEqual(s1, s2)
+        c = 'xxxx[85 chars]xxxxxxxxxxx'
+        self.assertEqual(str(cm.exception), "'%sa%s' != '%sb%s'" % (c, p, c, p))
+
+        p = 'y' * 100
+        s1, s2 = s + 'a' + p, s + 'b' + p
+        with self.assertRaises(self.failureException) as cm:
+            self.assertEqual(s1, s2)
+        c = 'xxxx[91 chars]xxxxx'
+        d = 'y' * 40 + '[56 chars]yyyy'
+        self.assertEqual(str(cm.exception), "'%sa%s' != '%sb%s'" % (c, d, c, d))
+
     def testAssertCountEqual(self):
         a = object()
         self.assertCountEqual([1, 2, 3], [3, 2, 1])
@@ -997,6 +1154,18 @@
                 self.assertRaisesRegex, Exception, 'x',
                 lambda: None)
 
+    def testAssertRaisesRegexInvalidRegex(self):
+        # Issue 20145.
+        class MyExc(Exception):
+            pass
+        self.assertRaises(TypeError, self.assertRaisesRegex, MyExc, lambda: True)
+
+    def testAssertWarnsRegexInvalidRegex(self):
+        # Issue 20145.
+        class MyWarn(Warning):
+            pass
+        self.assertRaises(TypeError, self.assertWarnsRegex, MyWarn, lambda: True)
+
     def testAssertRaisesRegexMismatch(self):
         def Stub():
             raise Exception('Unexpected')
@@ -1159,6 +1328,94 @@
                 with self.assertWarnsRegex(RuntimeWarning, "o+"):
                     _runtime_warn("barz")
 
+    @contextlib.contextmanager
+    def assertNoStderr(self):
+        with captured_stderr() as buf:
+            yield
+        self.assertEqual(buf.getvalue(), "")
+
+    def assertLogRecords(self, records, matches):
+        self.assertEqual(len(records), len(matches))
+        for rec, match in zip(records, matches):
+            self.assertIsInstance(rec, logging.LogRecord)
+            for k, v in match.items():
+                self.assertEqual(getattr(rec, k), v)
+
+    def testAssertLogsDefaults(self):
+        # defaults: root logger, level INFO
+        with self.assertNoStderr():
+            with self.assertLogs() as cm:
+                log_foo.info("1")
+                log_foobar.debug("2")
+            self.assertEqual(cm.output, ["INFO:foo:1"])
+            self.assertLogRecords(cm.records, [{'name': 'foo'}])
+
+    def testAssertLogsTwoMatchingMessages(self):
+        # Same, but with two matching log messages
+        with self.assertNoStderr():
+            with self.assertLogs() as cm:
+                log_foo.info("1")
+                log_foobar.debug("2")
+                log_quux.warning("3")
+            self.assertEqual(cm.output, ["INFO:foo:1", "WARNING:quux:3"])
+            self.assertLogRecords(cm.records,
+                                   [{'name': 'foo'}, {'name': 'quux'}])
+
+    def checkAssertLogsPerLevel(self, level):
+        # Check level filtering
+        with self.assertNoStderr():
+            with self.assertLogs(level=level) as cm:
+                log_foo.warning("1")
+                log_foobar.error("2")
+                log_quux.critical("3")
+            self.assertEqual(cm.output, ["ERROR:foo.bar:2", "CRITICAL:quux:3"])
+            self.assertLogRecords(cm.records,
+                                   [{'name': 'foo.bar'}, {'name': 'quux'}])
+
+    def testAssertLogsPerLevel(self):
+        self.checkAssertLogsPerLevel(logging.ERROR)
+        self.checkAssertLogsPerLevel('ERROR')
+
+    def checkAssertLogsPerLogger(self, logger):
+        # Check per-logger filtering
+        with self.assertNoStderr():
+            with self.assertLogs(level='DEBUG') as outer_cm:
+                with self.assertLogs(logger, level='DEBUG') as cm:
+                    log_foo.info("1")
+                    log_foobar.debug("2")
+                    log_quux.warning("3")
+                self.assertEqual(cm.output, ["INFO:foo:1", "DEBUG:foo.bar:2"])
+                self.assertLogRecords(cm.records,
+                                       [{'name': 'foo'}, {'name': 'foo.bar'}])
+            # The outer catchall caught the quux log
+            self.assertEqual(outer_cm.output, ["WARNING:quux:3"])
+
+    def testAssertLogsPerLogger(self):
+        self.checkAssertLogsPerLogger(logging.getLogger('foo'))
+        self.checkAssertLogsPerLogger('foo')
+
+    def testAssertLogsFailureNoLogs(self):
+        # Failure due to no logs
+        with self.assertNoStderr():
+            with self.assertRaises(self.failureException):
+                with self.assertLogs():
+                    pass
+
+    def testAssertLogsFailureLevelTooHigh(self):
+        # Failure due to level too high
+        with self.assertNoStderr():
+            with self.assertRaises(self.failureException):
+                with self.assertLogs(level='WARNING'):
+                    log_foo.info("1")
+
+    def testAssertLogsFailureMismatchingLogger(self):
+        # Failure due to mismatching logger (and the logged message is
+        # passed through)
+        with self.assertLogs('quux', level='ERROR'):
+            with self.assertRaises(self.failureException):
+                with self.assertLogs('foo'):
+                    log_quux.error("1")
+
     def testDeprecatedMethodNames(self):
         """
         Test that the deprecated methods raise a DeprecationWarning. See #9424.
@@ -1313,3 +1570,33 @@
         with support.disable_gc():
             del case
             self.assertFalse(wr())
+
+    def test_no_exception_leak(self):
+        # Issue #19880: TestCase.run() should not keep a reference
+        # to the exception
+        class MyException(Exception):
+            ninstance = 0
+
+            def __init__(self):
+                MyException.ninstance += 1
+                Exception.__init__(self)
+
+            def __del__(self):
+                MyException.ninstance -= 1
+
+        class TestCase(unittest.TestCase):
+            def test1(self):
+                raise MyException()
+
+            @unittest.expectedFailure
+            def test2(self):
+                raise MyException()
+
+        for method_name in ('test1', 'test2'):
+            testcase = TestCase(method_name)
+            testcase.run()
+            self.assertEqual(MyException.ninstance, 0)
+
+
+if __name__ == "__main__":
+    unittest.main()
diff --git a/Lib/unittest/test/test_discovery.py b/Lib/unittest/test/test_discovery.py
index ccc7db2..abb9066 100644
--- a/Lib/unittest/test/test_discovery.py
+++ b/Lib/unittest/test/test_discovery.py
@@ -1,12 +1,16 @@
 import os
 import re
 import sys
+import types
+import builtins
+from test import support
 
 import unittest
+import unittest.test
 
 
 class TestableTestProgram(unittest.TestProgram):
-    module = '__main__'
+    module = None
     exit = True
     defaultTest = failfast = catchbreak = buffer = None
     verbosity = 1
@@ -46,9 +50,9 @@
         def restore_isdir():
             os.path.isdir = original_isdir
 
-        path_lists = [['test1.py', 'test2.py', 'not_a_test.py', 'test_dir',
+        path_lists = [['test2.py', 'test1.py', 'not_a_test.py', 'test_dir',
                        'test.foo', 'test-not-a-module.py', 'another_dir'],
-                      ['test3.py', 'test4.py', ]]
+                      ['test4.py', 'test3.py', ]]
         os.listdir = lambda path: path_lists.pop(0)
         self.addCleanup(restore_listdir)
 
@@ -70,6 +74,8 @@
         loader._top_level_dir = top_level
         suite = list(loader._find_tests(top_level, 'test*.py'))
 
+        # The test suites found should be sorted alphabetically for reliable
+        # execution order.
         expected = [name + ' module tests' for name in
                     ('test1', 'test2')]
         expected.extend([('test_dir.%s' % name) + ' module tests' for name in
@@ -132,6 +138,7 @@
         # and directly from the test_directory2 package
         self.assertEqual(suite,
                          ['load_tests', 'test_directory2' + ' module tests'])
+        # The test module paths should be sorted for reliable execution order
         self.assertEqual(Module.paths, ['test_directory', 'test_directory2'])
 
         # load_tests should have been called once with loader, tests and pattern
@@ -169,7 +176,7 @@
         self.addCleanup(restore_isdir)
 
         _find_tests_args = []
-        def _find_tests(start_dir, pattern):
+        def _find_tests(start_dir, pattern, namespace=None):
             _find_tests_args.append((start_dir, pattern))
             return ['tests']
         loader._find_tests = _find_tests
@@ -184,11 +191,9 @@
         self.assertEqual(_find_tests_args, [(start_dir, 'pattern')])
         self.assertIn(top_level_dir, sys.path)
 
-    def test_discover_with_modules_that_fail_to_import(self):
-        loader = unittest.TestLoader()
-
+    def setup_import_issue_tests(self, fakefile):
         listdir = os.listdir
-        os.listdir = lambda _: ['test_this_does_not_exist.py']
+        os.listdir = lambda _: [fakefile]
         isfile = os.path.isfile
         os.path.isfile = lambda _: True
         orig_sys_path = sys.path[:]
@@ -198,6 +203,11 @@
             sys.path[:] = orig_sys_path
         self.addCleanup(restore)
 
+    def test_discover_with_modules_that_fail_to_import(self):
+        loader = unittest.TestLoader()
+
+        self.setup_import_issue_tests('test_this_does_not_exist.py')
+
         suite = loader.discover('.')
         self.assertIn(os.getcwd(), sys.path)
         self.assertEqual(suite.countTestCases(), 1)
@@ -206,62 +216,74 @@
         with self.assertRaises(ImportError):
             test.test_this_does_not_exist()
 
+    def test_discover_with_module_that_raises_SkipTest_on_import(self):
+        loader = unittest.TestLoader()
+
+        def _get_module_from_name(name):
+            raise unittest.SkipTest('skipperoo')
+        loader._get_module_from_name = _get_module_from_name
+
+        self.setup_import_issue_tests('test_skip_dummy.py')
+
+        suite = loader.discover('.')
+        self.assertEqual(suite.countTestCases(), 1)
+
+        result = unittest.TestResult()
+        suite.run(result)
+        self.assertEqual(len(result.skipped), 1)
+
     def test_command_line_handling_parseArgs(self):
         program = TestableTestProgram()
 
         args = []
-        def do_discovery(argv):
-            args.extend(argv)
-        program._do_discovery = do_discovery
+        program._do_discovery = args.append
         program.parseArgs(['something', 'discover'])
-        self.assertEqual(args, [])
+        self.assertEqual(args, [[]])
 
+        args[:] = []
         program.parseArgs(['something', 'discover', 'foo', 'bar'])
-        self.assertEqual(args, ['foo', 'bar'])
+        self.assertEqual(args, [['foo', 'bar']])
 
     def test_command_line_handling_discover_by_default(self):
         program = TestableTestProgram()
-        program.module = None
 
-        self.called = False
-        def do_discovery(argv):
-            self.called = True
-            self.assertEqual(argv, [])
-        program._do_discovery = do_discovery
+        args = []
+        program._do_discovery = args.append
         program.parseArgs(['something'])
-        self.assertTrue(self.called)
+        self.assertEqual(args, [[]])
+        self.assertEqual(program.verbosity, 1)
+        self.assertIs(program.buffer, False)
+        self.assertIs(program.catchbreak, False)
+        self.assertIs(program.failfast, False)
 
     def test_command_line_handling_discover_by_default_with_options(self):
         program = TestableTestProgram()
-        program.module = None
 
-        args = ['something', '-v', '-b', '-v', '-c', '-f']
-        self.called = False
-        def do_discovery(argv):
-            self.called = True
-            self.assertEqual(argv, args[1:])
-        program._do_discovery = do_discovery
-        program.parseArgs(args)
-        self.assertTrue(self.called)
+        args = []
+        program._do_discovery = args.append
+        program.parseArgs(['something', '-v', '-b', '-v', '-c', '-f'])
+        self.assertEqual(args, [[]])
+        self.assertEqual(program.verbosity, 2)
+        self.assertIs(program.buffer, True)
+        self.assertIs(program.catchbreak, True)
+        self.assertIs(program.failfast, True)
 
 
     def test_command_line_handling_do_discovery_too_many_arguments(self):
-        class Stop(Exception):
-            pass
-        def usageExit():
-            raise Stop
-
         program = TestableTestProgram()
-        program.usageExit = usageExit
         program.testLoader = None
 
-        with self.assertRaises(Stop):
+        with support.captured_stderr() as stderr, \
+             self.assertRaises(SystemExit) as cm:
             # too many args
             program._do_discovery(['one', 'two', 'three', 'four'])
+        self.assertEqual(cm.exception.args, (2,))
+        self.assertIn('usage:', stderr.getvalue())
 
 
     def test_command_line_handling_do_discovery_uses_default_loader(self):
         program = object.__new__(unittest.TestProgram)
+        program._initArgParsers()
 
         class Loader(object):
             args = []
@@ -417,7 +439,7 @@
         expectedPath = os.path.abspath(os.path.dirname(unittest.test.__file__))
 
         self.wasRun = False
-        def _find_tests(start_dir, pattern):
+        def _find_tests(start_dir, pattern, namespace=None):
             self.wasRun = True
             self.assertEqual(start_dir, expectedPath)
             return tests
@@ -427,5 +449,79 @@
         self.assertEqual(suite._tests, tests)
 
 
+    def test_discovery_from_dotted_path_builtin_modules(self):
+
+        loader = unittest.TestLoader()
+
+        listdir = os.listdir
+        os.listdir = lambda _: ['test_this_does_not_exist.py']
+        isfile = os.path.isfile
+        isdir = os.path.isdir
+        os.path.isdir = lambda _: False
+        orig_sys_path = sys.path[:]
+        def restore():
+            os.path.isfile = isfile
+            os.path.isdir = isdir
+            os.listdir = listdir
+            sys.path[:] = orig_sys_path
+        self.addCleanup(restore)
+
+        with self.assertRaises(TypeError) as cm:
+            loader.discover('sys')
+        self.assertEqual(str(cm.exception),
+                         'Can not use builtin modules '
+                         'as dotted module names')
+
+    def test_discovery_from_dotted_namespace_packages(self):
+        loader = unittest.TestLoader()
+
+        orig_import = __import__
+        package = types.ModuleType('package')
+        package.__path__ = ['/a', '/b']
+        package.__spec__ = types.SimpleNamespace(
+           loader=None,
+           submodule_search_locations=['/a', '/b']
+        )
+
+        def _import(packagename, *args, **kwargs):
+            sys.modules[packagename] = package
+            return package
+
+        def cleanup():
+            builtins.__import__ = orig_import
+        self.addCleanup(cleanup)
+        builtins.__import__ = _import
+
+        _find_tests_args = []
+        def _find_tests(start_dir, pattern, namespace=None):
+            _find_tests_args.append((start_dir, pattern))
+            return ['%s/tests' % start_dir]
+
+        loader._find_tests = _find_tests
+        loader.suiteClass = list
+        suite = loader.discover('package')
+        self.assertEqual(suite, ['/a/tests', '/b/tests'])
+
+    def test_discovery_failed_discovery(self):
+        loader = unittest.TestLoader()
+        package = types.ModuleType('package')
+        orig_import = __import__
+
+        def _import(packagename, *args, **kwargs):
+            sys.modules[packagename] = package
+            return package
+
+        def cleanup():
+            builtins.__import__ = orig_import
+        self.addCleanup(cleanup)
+        builtins.__import__ = _import
+
+        with self.assertRaises(TypeError) as cm:
+            loader.discover('package')
+        self.assertEqual(str(cm.exception),
+                         'don\'t know how to discover from {!r}'
+                         .format(package))
+
+
 if __name__ == '__main__':
     unittest.main()
diff --git a/Lib/unittest/test/test_functiontestcase.py b/Lib/unittest/test/test_functiontestcase.py
index 9ce5ee3..c5f2bcb 100644
--- a/Lib/unittest/test/test_functiontestcase.py
+++ b/Lib/unittest/test/test_functiontestcase.py
@@ -1,6 +1,6 @@
 import unittest
 
-from .support import LoggingResult
+from unittest.test.support import LoggingResult
 
 
 class Test_FunctionTestCase(unittest.TestCase):
@@ -142,3 +142,7 @@
         test = unittest.FunctionTestCase(lambda: None, description=desc)
 
         self.assertEqual(test.shortDescription(), "this tests foo")
+
+
+if __name__ == "__main__":
+    unittest.main()
diff --git a/Lib/unittest/test/test_loader.py b/Lib/unittest/test/test_loader.py
index fcd2e07..b62a1b5 100644
--- a/Lib/unittest/test/test_loader.py
+++ b/Lib/unittest/test/test_loader.py
@@ -1306,3 +1306,7 @@
     def test_suiteClass__default_value(self):
         loader = unittest.TestLoader()
         self.assertIs(loader.suiteClass, unittest.TestSuite)
+
+
+if __name__ == "__main__":
+    unittest.main()
diff --git a/Lib/unittest/test/test_program.py b/Lib/unittest/test/test_program.py
index 8a4b3fa..725d67f 100644
--- a/Lib/unittest/test/test_program.py
+++ b/Lib/unittest/test/test_program.py
@@ -2,7 +2,9 @@
 
 import os
 import sys
+from test import support
 import unittest
+import unittest.test
 
 
 class Test_TestProgram(unittest.TestCase):
@@ -64,6 +66,41 @@
             return self.suiteClass(
                 [self.loadTestsFromTestCase(Test_TestProgram.FooBar)])
 
+        def loadTestsFromNames(self, names, module):
+            return self.suiteClass(
+                [self.loadTestsFromTestCase(Test_TestProgram.FooBar)])
+
+    def test_defaultTest_with_string(self):
+        class FakeRunner(object):
+            def run(self, test):
+                self.test = test
+                return True
+
+        old_argv = sys.argv
+        sys.argv = ['faketest']
+        runner = FakeRunner()
+        program = unittest.TestProgram(testRunner=runner, exit=False,
+                                       defaultTest='unittest.test',
+                                       testLoader=self.FooBarLoader())
+        sys.argv = old_argv
+        self.assertEqual(('unittest.test',), program.testNames)
+
+    def test_defaultTest_with_iterable(self):
+        class FakeRunner(object):
+            def run(self, test):
+                self.test = test
+                return True
+
+        old_argv = sys.argv
+        sys.argv = ['faketest']
+        runner = FakeRunner()
+        program = unittest.TestProgram(
+            testRunner=runner, exit=False,
+            defaultTest=['unittest.test', 'unittest.test2'],
+            testLoader=self.FooBarLoader())
+        sys.argv = old_argv
+        self.assertEqual(['unittest.test', 'unittest.test2'],
+                          program.testNames)
 
     def test_NonExit(self):
         program = unittest.main(exit=False,
@@ -151,20 +188,38 @@
             if attr == 'catch' and not hasInstallHandler:
                 continue
 
+            setattr(program, attr, None)
+            program.parseArgs([None])
+            self.assertIs(getattr(program, attr), False)
+
+            false = []
+            setattr(program, attr, false)
+            program.parseArgs([None])
+            self.assertIs(getattr(program, attr), false)
+
+            true = [42]
+            setattr(program, attr, true)
+            program.parseArgs([None])
+            self.assertIs(getattr(program, attr), true)
+
             short_opt = '-%s' % arg[0]
             long_opt = '--%s' % arg
             for opt in short_opt, long_opt:
                 setattr(program, attr, None)
-
                 program.parseArgs([None, opt])
-                self.assertTrue(getattr(program, attr))
+                self.assertIs(getattr(program, attr), True)
 
-            for opt in short_opt, long_opt:
-                not_none = object()
-                setattr(program, attr, not_none)
+                setattr(program, attr, False)
+                with support.captured_stderr() as stderr, \
+                    self.assertRaises(SystemExit) as cm:
+                    program.parseArgs([None, opt])
+                self.assertEqual(cm.exception.args, (2,))
 
-                program.parseArgs([None, opt])
-                self.assertEqual(getattr(program, attr), not_none)
+                setattr(program, attr, True)
+                with support.captured_stderr() as stderr, \
+                    self.assertRaises(SystemExit) as cm:
+                    program.parseArgs([None, opt])
+                self.assertEqual(cm.exception.args, (2,))
 
     def testWarning(self):
         """Test the warnings argument"""
diff --git a/Lib/unittest/test/test_result.py b/Lib/unittest/test/test_result.py
index 7d40725..489fe17 100644
--- a/Lib/unittest/test/test_result.py
+++ b/Lib/unittest/test/test_result.py
@@ -227,6 +227,40 @@
         self.assertIs(test_case, test)
         self.assertIsInstance(formatted_exc, str)
 
+    def test_addSubTest(self):
+        class Foo(unittest.TestCase):
+            def test_1(self):
+                nonlocal subtest
+                with self.subTest(foo=1):
+                    subtest = self._subtest
+                    try:
+                        1/0
+                    except ZeroDivisionError:
+                        exc_info_tuple = sys.exc_info()
+                    # Register an error by hand (to check the API)
+                    result.addSubTest(test, subtest, exc_info_tuple)
+                    # Now trigger a failure
+                    self.fail("some recognizable failure")
+
+        subtest = None
+        test = Foo('test_1')
+        result = unittest.TestResult()
+
+        test.run(result)
+
+        self.assertFalse(result.wasSuccessful())
+        self.assertEqual(len(result.errors), 1)
+        self.assertEqual(len(result.failures), 1)
+        self.assertEqual(result.testsRun, 1)
+        self.assertEqual(result.shouldStop, False)
+
+        test_case, formatted_exc = result.errors[0]
+        self.assertIs(test_case, subtest)
+        self.assertIn("ZeroDivisionError", formatted_exc)
+        test_case, formatted_exc = result.failures[0]
+        self.assertIs(test_case, subtest)
+        self.assertIn("some recognizable failure", formatted_exc)
+
     def testGetDescriptionWithoutDocstring(self):
         result = unittest.TextTestResult(None, True, 1)
         self.assertEqual(
@@ -234,6 +268,37 @@
                 'testGetDescriptionWithoutDocstring (' + __name__ +
                 '.Test_TestResult)')
 
+    def testGetSubTestDescriptionWithoutDocstring(self):
+        with self.subTest(foo=1, bar=2):
+            result = unittest.TextTestResult(None, True, 1)
+            self.assertEqual(
+                    result.getDescription(self._subtest),
+                    'testGetSubTestDescriptionWithoutDocstring (' + __name__ +
+                    '.Test_TestResult) (bar=2, foo=1)')
+        with self.subTest('some message'):
+            result = unittest.TextTestResult(None, True, 1)
+            self.assertEqual(
+                    result.getDescription(self._subtest),
+                    'testGetSubTestDescriptionWithoutDocstring (' + __name__ +
+                    '.Test_TestResult) [some message]')
+
+    def testGetSubTestDescriptionWithoutDocstringAndParams(self):
+        with self.subTest():
+            result = unittest.TextTestResult(None, True, 1)
+            self.assertEqual(
+                    result.getDescription(self._subtest),
+                    'testGetSubTestDescriptionWithoutDocstringAndParams '
+                    '(' + __name__ + '.Test_TestResult) (<subtest>)')
+
+    def testGetNestedSubTestDescriptionWithoutDocstring(self):
+        with self.subTest(foo=1):
+            with self.subTest(bar=2):
+                result = unittest.TextTestResult(None, True, 1)
+                self.assertEqual(
+                        result.getDescription(self._subtest),
+                        'testGetNestedSubTestDescriptionWithoutDocstring '
+                        '(' + __name__ + '.Test_TestResult) (bar=2, foo=1)')
+
     @unittest.skipIf(sys.flags.optimize >= 2,
                      "Docstrings are omitted with -O2 and above")
     def testGetDescriptionWithOneLineDocstring(self):
@@ -247,6 +312,18 @@
 
     @unittest.skipIf(sys.flags.optimize >= 2,
                      "Docstrings are omitted with -O2 and above")
+    def testGetSubTestDescriptionWithOneLineDocstring(self):
+        """Tests getDescription() for a method with a docstring."""
+        result = unittest.TextTestResult(None, True, 1)
+        with self.subTest(foo=1, bar=2):
+            self.assertEqual(
+                result.getDescription(self._subtest),
+               ('testGetSubTestDescriptionWithOneLineDocstring '
+                '(' + __name__ + '.Test_TestResult) (bar=2, foo=1)\n'
+                'Tests getDescription() for a method with a docstring.'))
+
+    @unittest.skipIf(sys.flags.optimize >= 2,
+                     "Docstrings are omitted with -O2 and above")
     def testGetDescriptionWithMultiLineDocstring(self):
         """Tests getDescription() for a method with a longer docstring.
         The second line of the docstring.
@@ -259,6 +336,21 @@
                 'Tests getDescription() for a method with a longer '
                 'docstring.'))
 
+    @unittest.skipIf(sys.flags.optimize >= 2,
+                     "Docstrings are omitted with -O2 and above")
+    def testGetSubTestDescriptionWithMultiLineDocstring(self):
+        """Tests getDescription() for a method with a longer docstring.
+        The second line of the docstring.
+        """
+        result = unittest.TextTestResult(None, True, 1)
+        with self.subTest(foo=1, bar=2):
+            self.assertEqual(
+                result.getDescription(self._subtest),
+               ('testGetSubTestDescriptionWithMultiLineDocstring '
+                '(' + __name__ + '.Test_TestResult) (bar=2, foo=1)\n'
+                'Tests getDescription() for a method with a longer '
+                'docstring.'))
+
     def testStackFrameTrimming(self):
         class Frame(object):
             class tb_frame(object):
diff --git a/Lib/unittest/test/test_runner.py b/Lib/unittest/test/test_runner.py
index e22e6bc..7c0bd51 100644
--- a/Lib/unittest/test/test_runner.py
+++ b/Lib/unittest/test/test_runner.py
@@ -5,8 +5,10 @@
 import subprocess
 
 import unittest
+from unittest.case import _Outcome
 
-from .support import LoggingResult, ResultWithNoStartTestRunStopTestRun
+from unittest.test.support import (LoggingResult,
+                                   ResultWithNoStartTestRunStopTestRun)
 
 
 class TestCleanUp(unittest.TestCase):
@@ -42,12 +44,8 @@
             def testNothing(self):
                 pass
 
-        class MockOutcome(object):
-            success = True
-            errors = []
-
         test = TestableTest('testNothing')
-        test._outcomeForDoCleanups = MockOutcome
+        outcome = test._outcome = _Outcome()
 
         exc1 = Exception('foo')
         exc2 = Exception('bar')
@@ -61,9 +59,10 @@
         test.addCleanup(cleanup2)
 
         self.assertFalse(test.doCleanups())
-        self.assertFalse(MockOutcome.success)
+        self.assertFalse(outcome.success)
 
-        (Type1, instance1, _), (Type2, instance2, _) = reversed(MockOutcome.errors)
+        ((_, (Type1, instance1, _)),
+         (_, (Type2, instance2, _))) = reversed(outcome.errors)
         self.assertEqual((Type1, instance1), (Exception, exc1))
         self.assertEqual((Type2, instance2), (Exception, exc2))
 
@@ -341,3 +340,7 @@
         f = io.StringIO()
         runner = unittest.TextTestRunner(f)
         self.assertTrue(runner.stream.stream is f)
+
+
+if __name__ == "__main__":
+    unittest.main()
diff --git a/Lib/unittest/test/test_setups.py b/Lib/unittest/test/test_setups.py
index b8d5aa4..392f95e 100644
--- a/Lib/unittest/test/test_setups.py
+++ b/Lib/unittest/test/test_setups.py
@@ -494,14 +494,13 @@
         Test.__module__ = 'Module'
         sys.modules['Module'] = Module
 
-        _suite = unittest.defaultTestLoader.loadTestsFromTestCase(Test)
-        suite = unittest.TestSuite()
-        suite.addTest(_suite)
-
         messages = ('setUpModule', 'tearDownModule', 'setUpClass', 'tearDownClass', 'test_something')
         for phase, msg in enumerate(messages):
+            _suite = unittest.defaultTestLoader.loadTestsFromTestCase(Test)
+            suite = unittest.TestSuite([_suite])
             with self.assertRaisesRegex(Exception, msg):
                 suite.debug()
 
+
 if __name__ == '__main__':
     unittest.main()
diff --git a/Lib/unittest/test/test_skipping.py b/Lib/unittest/test/test_skipping.py
index 952240e..807510f 100644
--- a/Lib/unittest/test/test_skipping.py
+++ b/Lib/unittest/test/test_skipping.py
@@ -1,6 +1,6 @@
 import unittest
 
-from .support import LoggingResult
+from unittest.test.support import LoggingResult
 
 
 class Test_TestSkipping(unittest.TestCase):
@@ -29,6 +29,31 @@
         self.assertEqual(result.skipped, [(test, "testing")])
         self.assertEqual(result.testsRun, 1)
 
+    def test_skipping_subtests(self):
+        class Foo(unittest.TestCase):
+            def test_skip_me(self):
+                with self.subTest(a=1):
+                    with self.subTest(b=2):
+                        self.skipTest("skip 1")
+                    self.skipTest("skip 2")
+                self.skipTest("skip 3")
+        events = []
+        result = LoggingResult(events)
+        test = Foo("test_skip_me")
+        test.run(result)
+        self.assertEqual(events, ['startTest', 'addSkip', 'addSkip',
+                                  'addSkip', 'stopTest'])
+        self.assertEqual(len(result.skipped), 3)
+        subtest, msg = result.skipped[0]
+        self.assertEqual(msg, "skip 1")
+        self.assertIsInstance(subtest, unittest.TestCase)
+        self.assertIsNot(subtest, test)
+        subtest, msg = result.skipped[1]
+        self.assertEqual(msg, "skip 2")
+        self.assertIsInstance(subtest, unittest.TestCase)
+        self.assertIsNot(subtest, test)
+        self.assertEqual(result.skipped[2], (test, "skip 3"))
+
     def test_skipping_decorators(self):
         op_table = ((unittest.skipUnless, False, True),
                     (unittest.skipIf, True, False))
@@ -95,6 +120,31 @@
         self.assertEqual(result.expectedFailures[0][0], test)
         self.assertTrue(result.wasSuccessful())
 
+    def test_expected_failure_subtests(self):
+        # A failure in any subtest counts as the expected failure of the
+        # whole test.
+        class Foo(unittest.TestCase):
+            @unittest.expectedFailure
+            def test_die(self):
+                with self.subTest():
+                    # This one succeeds
+                    pass
+                with self.subTest():
+                    self.fail("help me!")
+                with self.subTest():
+                    # This one doesn't get executed
+                    self.fail("shouldn't come here")
+        events = []
+        result = LoggingResult(events)
+        test = Foo("test_die")
+        test.run(result)
+        self.assertEqual(events,
+                         ['startTest', 'addSubTestSuccess',
+                          'addExpectedFailure', 'stopTest'])
+        self.assertEqual(len(result.expectedFailures), 1)
+        self.assertIs(result.expectedFailures[0][0], test)
+        self.assertTrue(result.wasSuccessful())
+
     def test_unexpected_success(self):
         class Foo(unittest.TestCase):
             @unittest.expectedFailure
@@ -108,7 +158,31 @@
                          ['startTest', 'addUnexpectedSuccess', 'stopTest'])
         self.assertFalse(result.failures)
         self.assertEqual(result.unexpectedSuccesses, [test])
-        self.assertTrue(result.wasSuccessful())
+        self.assertFalse(result.wasSuccessful())
+
+    def test_unexpected_success_subtests(self):
+        # Success in all subtests counts as the unexpected success of
+        # the whole test.
+        class Foo(unittest.TestCase):
+            @unittest.expectedFailure
+            def test_die(self):
+                with self.subTest():
+                    # This one succeeds
+                    pass
+                with self.subTest():
+                    # So does this one
+                    pass
+        events = []
+        result = LoggingResult(events)
+        test = Foo("test_die")
+        test.run(result)
+        self.assertEqual(events,
+                         ['startTest',
+                          'addSubTestSuccess', 'addSubTestSuccess',
+                          'addUnexpectedSuccess', 'stopTest'])
+        self.assertFalse(result.failures)
+        self.assertEqual(result.unexpectedSuccesses, [test])
+        self.assertFalse(result.wasSuccessful())
 
     def test_skip_doesnt_run_setup(self):
         class Foo(unittest.TestCase):
@@ -147,3 +221,7 @@
         suite = unittest.TestSuite([test])
         suite.run(result)
         self.assertEqual(result.skipped, [(test, "testing")])
+
+
+if __name__ == "__main__":
+    unittest.main()
diff --git a/Lib/unittest/test/test_suite.py b/Lib/unittest/test/test_suite.py
index 2db978d..0551a16 100644
--- a/Lib/unittest/test/test_suite.py
+++ b/Lib/unittest/test/test_suite.py
@@ -1,7 +1,9 @@
 import unittest
 
+import gc
 import sys
-from .support import LoggingResult, TestEquality
+import weakref
+from unittest.test.support import LoggingResult, TestEquality
 
 
 ### Support code for Test_TestSuite
@@ -49,6 +51,9 @@
         suite = unittest.TestSuite()
 
         self.assertEqual(suite.countTestCases(), 0)
+        # countTestCases() still works after tests are run
+        suite.run(unittest.TestResult())
+        self.assertEqual(suite.countTestCases(), 0)
 
     # "class TestSuite([tests])"
     # ...
@@ -61,6 +66,9 @@
         suite = unittest.TestSuite([])
 
         self.assertEqual(suite.countTestCases(), 0)
+        # countTestCases() still works after tests are run
+        suite.run(unittest.TestResult())
+        self.assertEqual(suite.countTestCases(), 0)
 
     # "class TestSuite([tests])"
     # ...
@@ -82,6 +90,14 @@
         suite_3 = unittest.TestSuite(set(suite_1))
         self.assertEqual(suite_3.countTestCases(), 2)
 
+        # countTestCases() still works after tests are run
+        suite_1.run(unittest.TestResult())
+        self.assertEqual(suite_1.countTestCases(), 2)
+        suite_2.run(unittest.TestResult())
+        self.assertEqual(suite_2.countTestCases(), 2)
+        suite_3.run(unittest.TestResult())
+        self.assertEqual(suite_3.countTestCases(), 2)
+
     # "class TestSuite([tests])"
     # ...
     # "If tests is given, it must be an iterable of individual test cases
@@ -97,6 +113,9 @@
 
         suite = unittest.TestSuite(tests())
         self.assertEqual(suite.countTestCases(), 2)
+        # countTestCases() still works after tests are run
+        suite.run(unittest.TestResult())
+        self.assertEqual(suite.countTestCases(), 2)
 
     ################################################################
     ### /Tests for TestSuite.__init__
@@ -143,6 +162,9 @@
         suite = unittest.TestSuite((test1, test2))
 
         self.assertEqual(suite.countTestCases(), 2)
+        # countTestCases() still works after tests are run
+        suite.run(unittest.TestResult())
+        self.assertEqual(suite.countTestCases(), 2)
 
     # "Return the number of tests represented by the this test object.
     # ...this method is also implemented by the TestSuite class, which can
@@ -160,6 +182,10 @@
         parent = unittest.TestSuite((test3, child, Test1('test1')))
 
         self.assertEqual(parent.countTestCases(), 4)
+        # countTestCases() still works after tests are run
+        parent.run(unittest.TestResult())
+        self.assertEqual(parent.countTestCases(), 4)
+        self.assertEqual(child.countTestCases(), 2)
 
     # "Run the tests associated with this suite, collecting the result into
     # the test result object passed as result."
@@ -218,6 +244,9 @@
 
         self.assertEqual(suite.countTestCases(), 1)
         self.assertEqual(list(suite), [test])
+        # countTestCases() still works after tests are run
+        suite.run(unittest.TestResult())
+        self.assertEqual(suite.countTestCases(), 1)
 
     # "Add a ... TestSuite to the suite"
     def test_addTest__TestSuite(self):
@@ -231,6 +260,9 @@
 
         self.assertEqual(suite.countTestCases(), 1)
         self.assertEqual(list(suite), [suite_2])
+        # countTestCases() still works after tests are run
+        suite.run(unittest.TestResult())
+        self.assertEqual(suite.countTestCases(), 1)
 
     # "Add all the tests from an iterable of TestCase and TestSuite
     # instances to this test suite."
@@ -300,7 +332,54 @@
         # when the bug is fixed this line will not crash
         suite.run(unittest.TestResult())
 
+    def test_remove_test_at_index(self):
+        if not unittest.BaseTestSuite._cleanup:
+            raise unittest.SkipTest("Suite cleanup is disabled")
 
+        suite = unittest.TestSuite()
+
+        suite._tests = [1, 2, 3]
+        suite._removeTestAtIndex(1)
+
+        self.assertEqual([1, None, 3], suite._tests)
+
+    def test_remove_test_at_index_not_indexable(self):
+        if not unittest.BaseTestSuite._cleanup:
+            raise unittest.SkipTest("Suite cleanup is disabled")
+
+        suite = unittest.TestSuite()
+        suite._tests = None
+
+        # if _removeAtIndex raises for noniterables this next line will break
+        suite._removeTestAtIndex(2)
+
+    def assert_garbage_collect_test_after_run(self, TestSuiteClass):
+        if not unittest.BaseTestSuite._cleanup:
+            raise unittest.SkipTest("Suite cleanup is disabled")
+
+        class Foo(unittest.TestCase):
+            def test_nothing(self):
+                pass
+
+        test = Foo('test_nothing')
+        wref = weakref.ref(test)
+
+        suite = TestSuiteClass([wref()])
+        suite.run(unittest.TestResult())
+
+        del test
+
+        # for the benefit of non-reference counting implementations
+        gc.collect()
+
+        self.assertEqual(suite._tests, [None])
+        self.assertIsNone(wref())
+
+    def test_garbage_collect_test_after_run_BaseTestSuite(self):
+        self.assert_garbage_collect_test_after_run(unittest.BaseTestSuite)
+
+    def test_garbage_collect_test_after_run_TestSuite(self):
+        self.assert_garbage_collect_test_after_run(unittest.TestSuite)
 
     def test_basetestsuite(self):
         class Test(unittest.TestCase):
@@ -343,6 +422,7 @@
         self.assertEqual(len(result.errors), 1)
         self.assertEqual(len(result.failures), 0)
         self.assertEqual(result.testsRun, 2)
+        self.assertEqual(suite.countTestCases(), 2)
 
 
     def test_overriding_call(self):
@@ -363,6 +443,5 @@
         self.assertFalse(result._testRunEntered)
 
 
-
 if __name__ == '__main__':
     unittest.main()
diff --git a/Lib/unittest/test/testmock/__main__.py b/Lib/unittest/test/testmock/__main__.py
new file mode 100644
index 0000000..45c633a
--- /dev/null
+++ b/Lib/unittest/test/testmock/__main__.py
@@ -0,0 +1,18 @@
+import os
+import unittest
+
+
+def load_tests(loader, standard_tests, pattern):
+    # top level directory cached on loader instance
+    this_dir = os.path.dirname(__file__)
+    pattern = pattern or "test*.py"
+    # We are inside unittest.test.testmock, so the top-level is three notches up
+    top_level_dir = os.path.dirname(os.path.dirname(os.path.dirname(this_dir)))
+    package_tests = loader.discover(start_dir=this_dir, pattern=pattern,
+                                    top_level_dir=top_level_dir)
+    standard_tests.addTests(package_tests)
+    return standard_tests
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Lib/unittest/test/testmock/testcallable.py b/Lib/unittest/test/testmock/testcallable.py
index 7b2dd00..5390a4e 100644
--- a/Lib/unittest/test/testmock/testcallable.py
+++ b/Lib/unittest/test/testmock/testcallable.py
@@ -145,3 +145,7 @@
         mock.wibble.assert_called_once_with()
 
         self.assertRaises(TypeError, mock.wibble, 'some',  'args')
+
+
+if __name__ == "__main__":
+    unittest.main()
diff --git a/Lib/unittest/test/testmock/testhelpers.py b/Lib/unittest/test/testmock/testhelpers.py
index a362a2f..1dbc0b6 100644
--- a/Lib/unittest/test/testmock/testhelpers.py
+++ b/Lib/unittest/test/testmock/testhelpers.py
@@ -337,9 +337,10 @@
 
 
     def test_basic(self):
-        for spec in (SomeClass, SomeClass()):
-            mock = create_autospec(spec)
-            self._check_someclass_mock(mock)
+        mock = create_autospec(SomeClass)
+        self._check_someclass_mock(mock)
+        mock = create_autospec(SomeClass())
+        self._check_someclass_mock(mock)
 
 
     def test_create_autospec_return_value(self):
@@ -576,10 +577,10 @@
 
     def test_spec_inheritance_for_classes(self):
         class Foo(object):
-            def a(self):
+            def a(self, x):
                 pass
             class Bar(object):
-                def f(self):
+                def f(self, y):
                     pass
 
         class_mock = create_autospec(Foo)
@@ -587,26 +588,30 @@
         self.assertIsNot(class_mock, class_mock())
 
         for this_mock in class_mock, class_mock():
-            this_mock.a()
-            this_mock.a.assert_called_with()
-            self.assertRaises(TypeError, this_mock.a, 'foo')
+            this_mock.a(x=5)
+            this_mock.a.assert_called_with(x=5)
+            this_mock.a.assert_called_with(5)
+            self.assertRaises(TypeError, this_mock.a, 'foo', 'bar')
             self.assertRaises(AttributeError, getattr, this_mock, 'b')
 
         instance_mock = create_autospec(Foo())
-        instance_mock.a()
-        instance_mock.a.assert_called_with()
-        self.assertRaises(TypeError, instance_mock.a, 'foo')
+        instance_mock.a(5)
+        instance_mock.a.assert_called_with(5)
+        instance_mock.a.assert_called_with(x=5)
+        self.assertRaises(TypeError, instance_mock.a, 'foo', 'bar')
         self.assertRaises(AttributeError, getattr, instance_mock, 'b')
 
         # The return value isn't isn't callable
         self.assertRaises(TypeError, instance_mock)
 
-        instance_mock.Bar.f()
-        instance_mock.Bar.f.assert_called_with()
+        instance_mock.Bar.f(6)
+        instance_mock.Bar.f.assert_called_with(6)
+        instance_mock.Bar.f.assert_called_with(y=6)
         self.assertRaises(AttributeError, getattr, instance_mock.Bar, 'g')
 
-        instance_mock.Bar().f()
-        instance_mock.Bar().f.assert_called_with()
+        instance_mock.Bar().f(6)
+        instance_mock.Bar().f.assert_called_with(6)
+        instance_mock.Bar().f.assert_called_with(y=6)
         self.assertRaises(AttributeError, getattr, instance_mock.Bar(), 'g')
 
 
@@ -663,12 +668,15 @@
         self.assertRaises(TypeError, mock)
         mock(1, 2)
         mock.assert_called_with(1, 2)
+        mock.assert_called_with(1, b=2)
+        mock.assert_called_with(a=1, b=2)
 
         f.f = f
         mock = create_autospec(f)
         self.assertRaises(TypeError, mock.f)
         mock.f(3, 4)
         mock.f.assert_called_with(3, 4)
+        mock.f.assert_called_with(a=3, b=4)
 
 
     def test_skip_attributeerrors(self):
@@ -704,9 +712,13 @@
         self.assertRaises(TypeError, mock)
         mock(1)
         mock.assert_called_once_with(1)
+        mock.assert_called_once_with(a=1)
+        self.assertRaises(AssertionError, mock.assert_called_once_with, 2)
 
         mock(4, 5)
         mock.assert_called_with(4, 5)
+        mock.assert_called_with(a=4, b=5)
+        self.assertRaises(AssertionError, mock.assert_called_with, a=5, b=4)
 
 
     def test_class_with_no_init(self):
@@ -719,24 +731,27 @@
 
     def test_signature_callable(self):
         class Callable(object):
-            def __init__(self):
+            def __init__(self, x, y):
                 pass
             def __call__(self, a):
                 pass
 
         mock = create_autospec(Callable)
-        mock()
-        mock.assert_called_once_with()
+        mock(1, 2)
+        mock.assert_called_once_with(1, 2)
+        mock.assert_called_once_with(x=1, y=2)
         self.assertRaises(TypeError, mock, 'a')
 
-        instance = mock()
+        instance = mock(1, 2)
         self.assertRaises(TypeError, instance)
         instance(a='a')
+        instance.assert_called_once_with('a')
         instance.assert_called_once_with(a='a')
         instance('a')
         instance.assert_called_with('a')
+        instance.assert_called_with(a='a')
 
-        mock = create_autospec(Callable())
+        mock = create_autospec(Callable(1, 2))
         mock(a='a')
         mock.assert_called_once_with(a='a')
         self.assertRaises(TypeError, mock)
@@ -779,7 +794,11 @@
                 pass
 
         a = create_autospec(Foo)
+        a.f(10)
+        a.f.assert_called_with(10)
+        a.f.assert_called_with(self=10)
         a.f(self=10)
+        a.f.assert_called_with(10)
         a.f.assert_called_with(self=10)
 
 
diff --git a/Lib/unittest/test/testmock/testmagicmethods.py b/Lib/unittest/test/testmock/testmagicmethods.py
index 5ff158d..cc0e707 100644
--- a/Lib/unittest/test/testmock/testmagicmethods.py
+++ b/Lib/unittest/test/testmock/testmagicmethods.py
@@ -126,6 +126,31 @@
         self.assertEqual(7 + mock, mock)
         self.assertEqual(mock.value, 16)
 
+    def test_division(self):
+        original = mock = Mock()
+        mock.value = 32
+        self.assertRaises(TypeError, lambda: mock / 2)
+
+        def truediv(self, other):
+            mock.value /= other
+            return self
+        mock.__truediv__ = truediv
+        self.assertEqual(mock / 2, mock)
+        self.assertEqual(mock.value, 16)
+
+        del mock.__truediv__
+        def itruediv(mock):
+            mock /= 4
+        self.assertRaises(TypeError, itruediv, mock)
+        mock.__itruediv__ = truediv
+        mock /= 8
+        self.assertEqual(mock, original)
+        self.assertEqual(mock.value, 2)
+
+        self.assertRaises(TypeError, lambda: 8 / mock)
+        mock.__rtruediv__ = truediv
+        self.assertEqual(0.5 / mock, mock)
+        self.assertEqual(mock.value, 4)
 
     def test_hash(self):
         mock = Mock()
diff --git a/Lib/unittest/test/testmock/testmock.py b/Lib/unittest/test/testmock/testmock.py
index cef5405..23675b9 100644
--- a/Lib/unittest/test/testmock/testmock.py
+++ b/Lib/unittest/test/testmock/testmock.py
@@ -25,6 +25,18 @@
     __next__ = next
 
 
+class Something(object):
+    def meth(self, a, b, c, d=None):
+        pass
+
+    @classmethod
+    def cmeth(cls, a, b, c, d=None):
+        pass
+
+    @staticmethod
+    def smeth(a, b, c, d=None):
+        pass
+
 
 class MockTest(unittest.TestCase):
 
@@ -142,6 +154,24 @@
         mock = Mock(side_effect=side_effect, return_value=sentinel.RETURN)
         self.assertEqual(mock(), sentinel.RETURN)
 
+    def test_autospec_side_effect(self):
+        # Test for issue17826
+        results = [1, 2, 3]
+        def effect():
+            return results.pop()
+        def f():
+            pass
+
+        mock = create_autospec(f)
+        mock.side_effect = [1, 2, 3]
+        self.assertEqual([mock(), mock(), mock()], [1, 2, 3],
+                          "side effect not used correctly in create_autospec")
+        # Test where side effect is a callable
+        results = [1, 2, 3]
+        mock = create_autospec(f)
+        mock.side_effect = effect
+        self.assertEqual([mock(), mock(), mock()], [3, 2, 1],
+                          "callable side effect not used correctly")
 
     @unittest.skipUnless('java' in sys.platform,
                           'This test only applies to Jython')
@@ -273,6 +303,43 @@
         mock.assert_called_with(1, 2, 3, a='fish', b='nothing')
 
 
+    def test_assert_called_with_function_spec(self):
+        def f(a, b, c, d=None):
+            pass
+
+        mock = Mock(spec=f)
+
+        mock(1, b=2, c=3)
+        mock.assert_called_with(1, 2, 3)
+        mock.assert_called_with(a=1, b=2, c=3)
+        self.assertRaises(AssertionError, mock.assert_called_with,
+                          1, b=3, c=2)
+        # Expected call doesn't match the spec's signature
+        with self.assertRaises(AssertionError) as cm:
+            mock.assert_called_with(e=8)
+        self.assertIsInstance(cm.exception.__cause__, TypeError)
+
+
+    def test_assert_called_with_method_spec(self):
+        def _check(mock):
+            mock(1, b=2, c=3)
+            mock.assert_called_with(1, 2, 3)
+            mock.assert_called_with(a=1, b=2, c=3)
+            self.assertRaises(AssertionError, mock.assert_called_with,
+                              1, b=3, c=2)
+
+        mock = Mock(spec=Something().meth)
+        _check(mock)
+        mock = Mock(spec=Something.cmeth)
+        _check(mock)
+        mock = Mock(spec=Something().cmeth)
+        _check(mock)
+        mock = Mock(spec=Something.smeth)
+        _check(mock)
+        mock = Mock(spec=Something().smeth)
+        _check(mock)
+
+
     def test_assert_called_once_with(self):
         mock = Mock()
         mock()
@@ -297,6 +364,29 @@
         )
 
 
+    def test_assert_called_once_with_function_spec(self):
+        def f(a, b, c, d=None):
+            pass
+
+        mock = Mock(spec=f)
+
+        mock(1, b=2, c=3)
+        mock.assert_called_once_with(1, 2, 3)
+        mock.assert_called_once_with(a=1, b=2, c=3)
+        self.assertRaises(AssertionError, mock.assert_called_once_with,
+                          1, b=3, c=2)
+        # Expected call doesn't match the spec's signature
+        with self.assertRaises(AssertionError) as cm:
+            mock.assert_called_once_with(e=8)
+        self.assertIsInstance(cm.exception.__cause__, TypeError)
+        # Mock called more than once => always fails
+        mock(4, 5, 6)
+        self.assertRaises(AssertionError, mock.assert_called_once_with,
+                          1, 2, 3)
+        self.assertRaises(AssertionError, mock.assert_called_once_with,
+                          4, 5, 6)
+
+
     def test_attribute_access_returns_mocks(self):
         mock = Mock()
         something = mock.something
@@ -995,6 +1085,39 @@
                         )
 
 
+    def test_assert_has_calls_with_function_spec(self):
+        def f(a, b, c, d=None):
+            pass
+
+        mock = Mock(spec=f)
+
+        mock(1, b=2, c=3)
+        mock(4, 5, c=6, d=7)
+        mock(10, 11, c=12)
+        calls = [
+            ('', (1, 2, 3), {}),
+            ('', (4, 5, 6), {'d': 7}),
+            ((10, 11, 12), {}),
+            ]
+        mock.assert_has_calls(calls)
+        mock.assert_has_calls(calls, any_order=True)
+        mock.assert_has_calls(calls[1:])
+        mock.assert_has_calls(calls[1:], any_order=True)
+        mock.assert_has_calls(calls[:-1])
+        mock.assert_has_calls(calls[:-1], any_order=True)
+        # Reversed order
+        calls = list(reversed(calls))
+        with self.assertRaises(AssertionError):
+            mock.assert_has_calls(calls)
+        mock.assert_has_calls(calls, any_order=True)
+        with self.assertRaises(AssertionError):
+            mock.assert_has_calls(calls[1:])
+        mock.assert_has_calls(calls[1:], any_order=True)
+        with self.assertRaises(AssertionError):
+            mock.assert_has_calls(calls[:-1])
+        mock.assert_has_calls(calls[:-1], any_order=True)
+
+
     def test_assert_any_call(self):
         mock = Mock()
         mock(1, 2)
@@ -1021,6 +1144,26 @@
         )
 
 
+    def test_assert_any_call_with_function_spec(self):
+        def f(a, b, c, d=None):
+            pass
+
+        mock = Mock(spec=f)
+
+        mock(1, b=2, c=3)
+        mock(4, 5, c=6, d=7)
+        mock.assert_any_call(1, 2, 3)
+        mock.assert_any_call(a=1, b=2, c=3)
+        mock.assert_any_call(4, 5, 6, 7)
+        mock.assert_any_call(a=4, b=5, c=6, d=7)
+        self.assertRaises(AssertionError, mock.assert_any_call,
+                          1, b=3, c=2)
+        # Expected call doesn't match the spec's signature
+        with self.assertRaises(AssertionError) as cm:
+            mock.assert_any_call(e=8)
+        self.assertIsInstance(cm.exception.__cause__, TypeError)
+
+
     def test_mock_calls_create_autospec(self):
         def f(a, b):
             pass
@@ -1039,6 +1182,10 @@
                 func.mock_calls, [call(1, 2), call(3, 4)]
             )
 
+    #Issue21222
+    def test_create_autospec_with_name(self):
+        m = mock.create_autospec(object(), name='sweet_func')
+        self.assertIn('sweet_func', repr(m))
 
     def test_mock_add_spec(self):
         class _One(object):
@@ -1177,20 +1324,6 @@
             self.assertEqual(m.method_calls, [])
 
 
-    def test_attribute_deletion(self):
-        # this behaviour isn't *useful*, but at least it's now tested...
-        for Klass in Mock, MagicMock, NonCallableMagicMock, NonCallableMock:
-            m = Klass()
-            original = m.foo
-            m.foo = 3
-            del m.foo
-            self.assertEqual(m.foo, original)
-
-            new = m.foo = Mock()
-            del m.foo
-            self.assertEqual(m.foo, new)
-
-
     def test_mock_parents(self):
         for Klass in Mock, MagicMock:
             m = Klass()
@@ -1254,7 +1387,8 @@
 
 
     def test_attribute_deletion(self):
-        for mock in Mock(), MagicMock():
+        for mock in (Mock(), MagicMock(), NonCallableMagicMock(),
+                     NonCallableMock()):
             self.assertTrue(hasattr(mock, 'm'))
 
             del mock.m
@@ -1274,6 +1408,5 @@
             mock.foo
 
 
-
 if __name__ == '__main__':
     unittest.main()
diff --git a/Lib/unittest/test/testmock/testpatch.py b/Lib/unittest/test/testmock/testpatch.py
index c1091b4..b516f42 100644
--- a/Lib/unittest/test/testmock/testpatch.py
+++ b/Lib/unittest/test/testmock/testpatch.py
@@ -12,7 +12,7 @@
 from unittest.mock import (
     NonCallableMock, CallableMixin, patch, sentinel,
     MagicMock, Mock, NonCallableMagicMock, patch, _patch,
-    DEFAULT, call, _get_target
+    DEFAULT, call, _get_target, _patch
 )
 
 
@@ -1779,6 +1779,22 @@
         patched()
         self.assertIs(os.path, path)
 
+    def test_stopall_lifo(self):
+        stopped = []
+        class thing(object):
+            one = two = three = None
+
+        def get_patch(attribute):
+            class mypatch(_patch):
+                def stop(self):
+                    stopped.append(attribute)
+                    return super(mypatch, self).stop()
+            return mypatch(lambda: thing, attribute, None, None,
+                           False, None, None, None, {})
+        [get_patch(val).start() for val in ("one", "two", "three")]
+        patch.stopall()
+
+        self.assertEqual(stopped, ["three", "two", "one"])
 
 
 if __name__ == '__main__':
diff --git a/Lib/unittest/test/testmock/testwith.py b/Lib/unittest/test/testmock/testwith.py
index 0a0cfad..f54e051 100644
--- a/Lib/unittest/test/testmock/testwith.py
+++ b/Lib/unittest/test/testmock/testwith.py
@@ -172,5 +172,88 @@
         self.assertEqual(result, 'foo')
 
 
+    def test_readline_data(self):
+        # Check that readline will return all the lines from the fake file
+        mock = mock_open(read_data='foo\nbar\nbaz\n')
+        with patch('%s.open' % __name__, mock, create=True):
+            h = open('bar')
+            line1 = h.readline()
+            line2 = h.readline()
+            line3 = h.readline()
+        self.assertEqual(line1, 'foo\n')
+        self.assertEqual(line2, 'bar\n')
+        self.assertEqual(line3, 'baz\n')
+
+        # Check that we properly emulate a file that doesn't end in a newline
+        mock = mock_open(read_data='foo')
+        with patch('%s.open' % __name__, mock, create=True):
+            h = open('bar')
+            result = h.readline()
+        self.assertEqual(result, 'foo')
+
+
+    def test_readlines_data(self):
+        # Test that emulating a file that ends in a newline character works
+        mock = mock_open(read_data='foo\nbar\nbaz\n')
+        with patch('%s.open' % __name__, mock, create=True):
+            h = open('bar')
+            result = h.readlines()
+        self.assertEqual(result, ['foo\n', 'bar\n', 'baz\n'])
+
+        # Test that files without a final newline will also be correctly
+        # emulated
+        mock = mock_open(read_data='foo\nbar\nbaz')
+        with patch('%s.open' % __name__, mock, create=True):
+            h = open('bar')
+            result = h.readlines()
+
+        self.assertEqual(result, ['foo\n', 'bar\n', 'baz'])
+
+
+    def test_mock_open_read_with_argument(self):
+        # At one point calling read with an argument was broken
+        # for mocks returned by mock_open
+        some_data = 'foo\nbar\nbaz'
+        mock = mock_open(read_data=some_data)
+        self.assertEqual(mock().read(10), some_data)
+
+
+    def test_interleaved_reads(self):
+        # Test that calling read, readline, and readlines pulls data
+        # sequentially from the data we preload with
+        mock = mock_open(read_data='foo\nbar\nbaz\n')
+        with patch('%s.open' % __name__, mock, create=True):
+            h = open('bar')
+            line1 = h.readline()
+            rest = h.readlines()
+        self.assertEqual(line1, 'foo\n')
+        self.assertEqual(rest, ['bar\n', 'baz\n'])
+
+        mock = mock_open(read_data='foo\nbar\nbaz\n')
+        with patch('%s.open' % __name__, mock, create=True):
+            h = open('bar')
+            line1 = h.readline()
+            rest = h.read()
+        self.assertEqual(line1, 'foo\n')
+        self.assertEqual(rest, 'bar\nbaz\n')
+
+
+    def test_overriding_return_values(self):
+        mock = mock_open(read_data='foo')
+        handle = mock()
+
+        handle.read.return_value = 'bar'
+        handle.readline.return_value = 'bar'
+        handle.readlines.return_value = ['bar']
+
+        self.assertEqual(handle.read(), 'bar')
+        self.assertEqual(handle.readline(), 'bar')
+        self.assertEqual(handle.readlines(), ['bar'])
+
+        # call repeatedly to check that a StopIteration is not propagated
+        self.assertEqual(handle.readline(), 'bar')
+        self.assertEqual(handle.readline(), 'bar')
+
+
 if __name__ == '__main__':
     unittest.main()
diff --git a/Lib/unittest/util.py b/Lib/unittest/util.py
index ccdf0b8..aee498f 100644
--- a/Lib/unittest/util.py
+++ b/Lib/unittest/util.py
@@ -1,10 +1,47 @@
 """Various utility functions."""
 
 from collections import namedtuple, OrderedDict
+from os.path import commonprefix
 
 __unittest = True
 
 _MAX_LENGTH = 80
+_PLACEHOLDER_LEN = 12
+_MIN_BEGIN_LEN = 5
+_MIN_END_LEN = 5
+_MIN_COMMON_LEN = 5
+_MIN_DIFF_LEN = _MAX_LENGTH - \
+               (_MIN_BEGIN_LEN + _PLACEHOLDER_LEN + _MIN_COMMON_LEN +
+                _PLACEHOLDER_LEN + _MIN_END_LEN)
+assert _MIN_DIFF_LEN >= 0
+
+def _shorten(s, prefixlen, suffixlen):
+    skip = len(s) - prefixlen - suffixlen
+    if skip > _PLACEHOLDER_LEN:
+        s = '%s[%d chars]%s' % (s[:prefixlen], skip, s[len(s) - suffixlen:])
+    return s
+
+def _common_shorten_repr(*args):
+    args = tuple(map(safe_repr, args))
+    maxlen = max(map(len, args))
+    if maxlen <= _MAX_LENGTH:
+        return args
+
+    prefix = commonprefix(args)
+    prefixlen = len(prefix)
+
+    common_len = _MAX_LENGTH - \
+                 (maxlen - prefixlen + _MIN_BEGIN_LEN + _PLACEHOLDER_LEN)
+    if common_len > _MIN_COMMON_LEN:
+        assert _MIN_BEGIN_LEN + _PLACEHOLDER_LEN + _MIN_COMMON_LEN + \
+               (maxlen - prefixlen) < _MAX_LENGTH
+        prefix = _shorten(prefix, _MIN_BEGIN_LEN, common_len)
+        return tuple(prefix + s[prefixlen:] for s in args)
+
+    prefix = _shorten(prefix, _MIN_BEGIN_LEN, _MIN_COMMON_LEN)
+    return tuple(prefix + _shorten(s[prefixlen:], _MIN_DIFF_LEN, _MIN_END_LEN)
+                 for s in args)
+
 def safe_repr(obj, short=False):
     try:
         result = repr(obj)
diff --git a/Lib/urllib/error.py b/Lib/urllib/error.py
index b712ebb..45b7169 100644
--- a/Lib/urllib/error.py
+++ b/Lib/urllib/error.py
@@ -1,6 +1,6 @@
 """Exception classes raised by urllib.
 
-The base exception class is URLError, which inherits from IOError.  It
+The base exception class is URLError, which inherits from OSError.  It
 doesn't define any behavior of its own, but is the base class for all
 exceptions defined in this package.
 
@@ -17,11 +17,11 @@
 
 
 # do these error classes make sense?
-# make sure all of the IOError stuff is overridden.  we just want to be
+# make sure all of the OSError stuff is overridden.  we just want to be
 # subtypes.
 
-class URLError(IOError):
-    # URLError is a sub-type of IOError, but it doesn't share any of
+class URLError(OSError):
+    # URLError is a sub-type of OSError, but it doesn't share any of
     # the implementation.  need to override __init__ and __str__.
     # It sets self.args for compatibility with other EnvironmentError
     # subclasses, but args doesn't have the typical format with errno in
@@ -61,9 +61,13 @@
     def reason(self):
         return self.msg
 
-    def info(self):
+    @property
+    def headers(self):
         return self.hdrs
 
+    @headers.setter
+    def headers(self, headers):
+        self.hdrs = headers
 
 # exception raised when downloaded size does not match content-length
 class ContentTooShortError(URLError):
diff --git a/Lib/urllib/parse.py b/Lib/urllib/parse.py
index 975c6ff..d368331 100644
--- a/Lib/urllib/parse.py
+++ b/Lib/urllib/parse.py
@@ -472,8 +472,7 @@
     return _coerce_result(DefragResult(defrag, frag))
 
 _hexdig = '0123456789ABCDEFabcdef'
-_hextobyte = {(a + b).encode(): bytes([int(a + b, 16)])
-              for a in _hexdig for b in _hexdig}
+_hextobyte = None
 
 def unquote_to_bytes(string):
     """unquote_to_bytes('abc%20def') -> b'abc def'."""
@@ -490,6 +489,12 @@
         return string
     res = [bits[0]]
     append = res.append
+    # Delay the initialization of the table to not waste memory
+    # if the function is never called
+    global _hextobyte
+    if _hextobyte is None:
+        _hextobyte = {(a + b).encode(): bytes([int(a + b, 16)])
+                      for a in _hexdig for b in _hexdig}
     for item in bits[1:]:
         try:
             append(_hextobyte[item[:2]])
@@ -665,8 +670,8 @@
     called on a path where the existing slash characters are used as
     reserved characters.
 
-    string and safe may be either str or bytes objects. encoding must
-    not be specified if string is a str.
+    string and safe may be either str or bytes objects. encoding and errors
+    must not be specified if string is a bytes object.
 
     The optional encoding and errors parameters specify how to deal with
     non-ASCII characters, as accepted by the str.encode method.
@@ -738,8 +743,9 @@
     input.
 
     The components of a query arg may each be either a string or a bytes type.
-    When a component is a string, the safe, encoding and error parameters are
-    sent to the quote_plus function for encoding.
+
+    The safe, encoding, and errors parameters are passed down to quote_plus()
+    (encoding and errors only if a component is a str).
     """
 
     if hasattr(query, "items"):
@@ -846,7 +852,6 @@
     """splittype('type:opaquestring') --> 'type', 'opaquestring'."""
     global _typeprog
     if _typeprog is None:
-        import re
         _typeprog = re.compile('^([^/:]+):')
 
     match = _typeprog.match(url)
@@ -860,7 +865,6 @@
     """splithost('//host[:port]/path') --> 'host[:port]', '/path'."""
     global _hostprog
     if _hostprog is None:
-        import re
         _hostprog = re.compile('^//([^/?]*)(.*)$')
 
     match = _hostprog.match(url)
@@ -877,7 +881,6 @@
     """splituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'."""
     global _userprog
     if _userprog is None:
-        import re
         _userprog = re.compile('^(.*)@(.*)$')
 
     match = _userprog.match(host)
@@ -889,7 +892,6 @@
     """splitpasswd('user:passwd') -> 'user', 'passwd'."""
     global _passwdprog
     if _passwdprog is None:
-        import re
         _passwdprog = re.compile('^([^:]*):(.*)$',re.S)
 
     match = _passwdprog.match(user)
@@ -902,7 +904,6 @@
     """splitport('host:port') --> 'host', 'port'."""
     global _portprog
     if _portprog is None:
-        import re
         _portprog = re.compile('^(.*):([0-9]*)$')
 
     match = _portprog.match(host)
@@ -920,7 +921,6 @@
     Return None if ':' but not a valid number."""
     global _nportprog
     if _nportprog is None:
-        import re
         _nportprog = re.compile('^(.*):(.*)$')
 
     match = _nportprog.match(host)
@@ -939,7 +939,6 @@
     """splitquery('/path?query') --> '/path', 'query'."""
     global _queryprog
     if _queryprog is None:
-        import re
         _queryprog = re.compile('^(.*)\?([^?]*)$')
 
     match = _queryprog.match(url)
@@ -951,7 +950,6 @@
     """splittag('/path#tag') --> '/path', 'tag'."""
     global _tagprog
     if _tagprog is None:
-        import re
         _tagprog = re.compile('^(.*)#([^#]*)$')
 
     match = _tagprog.match(url)
@@ -969,7 +967,6 @@
     """splitvalue('attr=value') --> 'attr', 'value'."""
     global _valueprog
     if _valueprog is None:
-        import re
         _valueprog = re.compile('^([^=]*)=(.*)$')
 
     match = _valueprog.match(attr)
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
index ef62acc..6da9007 100644
--- a/Lib/urllib/request.py
+++ b/Lib/urllib/request.py
@@ -18,7 +18,7 @@
 urllib.  pass the url and optionally data to post to an HTTP URL, and
 get a file-like object back.  One difference is that you can also pass
 a Request instance instead of URL.  Raises a URLError (subclass of
-IOError); for HTTP errors, raises an HTTPError, which can also be
+OSError); for HTTP errors, raises an HTTPError, which can also be
 treated as a valid response.
 
 build_opener -- Function that creates a new OpenerDirector instance.
@@ -103,7 +103,8 @@
 from urllib.parse import (
     urlparse, urlsplit, urljoin, unwrap, quote, unquote,
     splittype, splithost, splitport, splituser, splitpasswd,
-    splitattr, splitquery, splitvalue, splittag, to_bytes, urlunparse)
+    splitattr, splitquery, splitvalue, splittag, to_bytes,
+    unquote_to_bytes, urlunparse)
 from urllib.response import addinfourl, addclosehook
 
 # check for SSL
@@ -121,7 +122,7 @@
     'HTTPPasswordMgr', 'HTTPPasswordMgrWithDefaultRealm',
     'AbstractBasicAuthHandler', 'HTTPBasicAuthHandler', 'ProxyBasicAuthHandler',
     'AbstractDigestAuthHandler', 'HTTPDigestAuthHandler', 'ProxyDigestAuthHandler',
-    'HTTPHandler', 'FileHandler', 'FTPHandler', 'CacheFTPHandler',
+    'HTTPHandler', 'FileHandler', 'FTPHandler', 'CacheFTPHandler', 'DataHandler',
     'UnknownHandler', 'HTTPErrorProcessor',
     # Functions
     'urlopen', 'install_opener', 'build_opener',
@@ -135,19 +136,23 @@
 
 _opener = None
 def urlopen(url, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
-            *, cafile=None, capath=None, cadefault=False):
+            *, cafile=None, capath=None, cadefault=False, context=None):
     global _opener
     if cafile or capath or cadefault:
+        if context is not None:
+            raise ValueError(
+                "You can't pass both context and any of cafile, capath, and "
+                "cadefault"
+            )
         if not _have_ssl:
             raise ValueError('SSL support not available')
-        context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
-        context.options |= ssl.OP_NO_SSLv2
-        context.verify_mode = ssl.CERT_REQUIRED
-        if cafile or capath:
-            context.load_verify_locations(cafile, capath)
-        else:
-            context.set_default_verify_paths()
-        https_handler = HTTPSHandler(context=context, check_hostname=True)
+        context = ssl.create_default_context(ssl.Purpose.SERVER_AUTH,
+                                             cafile=cafile,
+                                             capath=capath)
+        https_handler = HTTPSHandler(context=context)
+        opener = build_opener(https_handler)
+    elif context:
+        https_handler = HTTPSHandler(context=context)
         opener = build_opener(https_handler)
     elif _opener is None:
         _opener = opener = build_opener()
@@ -227,7 +232,7 @@
     for temp_file in _url_tempfiles:
         try:
             os.unlink(temp_file)
-        except EnvironmentError:
+        except OSError:
             pass
 
     del _url_tempfiles[:]
@@ -258,24 +263,60 @@
     def __init__(self, url, data=None, headers={},
                  origin_req_host=None, unverifiable=False,
                  method=None):
-        # unwrap('<URL:type://host/path>') --> 'type://host/path'
-        self.full_url = unwrap(url)
-        self.full_url, self.fragment = splittag(self.full_url)
-        self.data = data
+        self.full_url = url
         self.headers = {}
+        self.unredirected_hdrs = {}
+        self._data = None
+        self.data = data
         self._tunnel_host = None
         for key, value in headers.items():
             self.add_header(key, value)
-        self.unredirected_hdrs = {}
         if origin_req_host is None:
             origin_req_host = request_host(self)
         self.origin_req_host = origin_req_host
         self.unverifiable = unverifiable
-        self.method = method
+        if method:
+            self.method = method
+
+    @property
+    def full_url(self):
+        if self.fragment:
+            return '{}#{}'.format(self._full_url, self.fragment)
+        return self._full_url
+
+    @full_url.setter
+    def full_url(self, url):
+        # unwrap('<URL:type://host/path>') --> 'type://host/path'
+        self._full_url = unwrap(url)
+        self._full_url, self.fragment = splittag(self._full_url)
         self._parse()
 
+    @full_url.deleter
+    def full_url(self):
+        self._full_url = None
+        self.fragment = None
+        self.selector = ''
+
+    @property
+    def data(self):
+        return self._data
+
+    @data.setter
+    def data(self, data):
+        if data != self._data:
+            self._data = data
+            # issue 16464
+            # if we change data we need to remove content-length header
+            # (cause it's most probably calculated for previous value)
+            if self.has_header("Content-length"):
+                self.remove_header("Content-length")
+
+    @data.deleter
+    def data(self):
+        self.data = None
+
     def _parse(self):
-        self.type, rest = splittype(self.full_url)
+        self.type, rest = splittype(self._full_url)
         if self.type is None:
             raise ValueError("unknown url type: %r" % self.full_url)
         self.host, self.selector = splithost(rest)
@@ -284,62 +325,11 @@
 
     def get_method(self):
         """Return a string indicating the HTTP request method."""
-        if self.method is not None:
-            return self.method
-        elif self.data is not None:
-            return "POST"
-        else:
-            return "GET"
+        default_method = "POST" if self.data is not None else "GET"
+        return getattr(self, 'method', default_method)
 
     def get_full_url(self):
-        if self.fragment:
-            return '%s#%s' % (self.full_url, self.fragment)
-        else:
-            return self.full_url
-
-    # Begin deprecated methods
-
-    def add_data(self, data):
-        msg = "Request.add_data method is deprecated."
-        warnings.warn(msg, DeprecationWarning, stacklevel=1)
-        self.data = data
-
-    def has_data(self):
-        msg = "Request.has_data method is deprecated."
-        warnings.warn(msg, DeprecationWarning, stacklevel=1)
-        return self.data is not None
-
-    def get_data(self):
-        msg = "Request.get_data method is deprecated."
-        warnings.warn(msg, DeprecationWarning, stacklevel=1)
-        return self.data
-
-    def get_type(self):
-        msg = "Request.get_type method is deprecated."
-        warnings.warn(msg, DeprecationWarning, stacklevel=1)
-        return self.type
-
-    def get_host(self):
-        msg = "Request.get_host method is deprecated."
-        warnings.warn(msg, DeprecationWarning, stacklevel=1)
-        return self.host
-
-    def get_selector(self):
-        msg = "Request.get_selector method is deprecated."
-        warnings.warn(msg, DeprecationWarning, stacklevel=1)
-        return self.selector
-
-    def is_unverifiable(self):
-        msg = "Request.is_unverifiable method is deprecated."
-        warnings.warn(msg, DeprecationWarning, stacklevel=1)
-        return self.unverifiable
-
-    def get_origin_req_host(self):
-        msg = "Request.get_origin_req_host method is deprecated."
-        warnings.warn(msg, DeprecationWarning, stacklevel=1)
-        return self.origin_req_host
-
-    # End deprecated methods
+        return self.full_url
 
     def set_proxy(self, host, type):
         if self.type == 'https' and not self._tunnel_host:
@@ -369,6 +359,10 @@
             header_name,
             self.unredirected_hdrs.get(header_name, default))
 
+    def remove_header(self, header_name):
+        self.headers.pop(header_name, None)
+        self.unredirected_hdrs.pop(header_name, None)
+
     def header_items(self):
         hdrs = self.unredirected_hdrs.copy()
         hdrs.update(self.headers)
@@ -525,19 +519,17 @@
     If any of the handlers passed as arguments are subclasses of the
     default handlers, the default handlers will not be used.
     """
-    def isclass(obj):
-        return isinstance(obj, type) or hasattr(obj, "__bases__")
-
     opener = OpenerDirector()
     default_classes = [ProxyHandler, UnknownHandler, HTTPHandler,
                        HTTPDefaultErrorHandler, HTTPRedirectHandler,
-                       FTPHandler, FileHandler, HTTPErrorProcessor]
+                       FTPHandler, FileHandler, HTTPErrorProcessor,
+                       DataHandler]
     if hasattr(http.client, "HTTPSConnection"):
         default_classes.append(HTTPSHandler)
     skip = set()
     for klass in default_classes:
         for check in handlers:
-            if isclass(check):
+            if isinstance(check, type):
                 if issubclass(check, klass):
                     skip.add(klass)
             elif isinstance(check, klass):
@@ -549,7 +541,7 @@
         opener.add_handler(klass())
 
     for h in handlers:
-        if isclass(h):
+        if isinstance(h, type):
             h = h()
         opener.add_handler(h)
     return opener
@@ -703,50 +695,7 @@
 
     If a URL is supplied, it must have an authority (host:port) component.
     According to RFC 3986, having an authority component means the URL must
-    have two slashes after the scheme:
-
-    >>> _parse_proxy('file:/ftp.example.com/')
-    Traceback (most recent call last):
-    ValueError: proxy URL with no authority: 'file:/ftp.example.com/'
-
-    The first three items of the returned tuple may be None.
-
-    Examples of authority parsing:
-
-    >>> _parse_proxy('proxy.example.com')
-    (None, None, None, 'proxy.example.com')
-    >>> _parse_proxy('proxy.example.com:3128')
-    (None, None, None, 'proxy.example.com:3128')
-
-    The authority component may optionally include userinfo (assumed to be
-    username:password):
-
-    >>> _parse_proxy('joe:password@proxy.example.com')
-    (None, 'joe', 'password', 'proxy.example.com')
-    >>> _parse_proxy('joe:password@proxy.example.com:3128')
-    (None, 'joe', 'password', 'proxy.example.com:3128')
-
-    Same examples, but with URLs instead:
-
-    >>> _parse_proxy('http://proxy.example.com/')
-    ('http', None, None, 'proxy.example.com')
-    >>> _parse_proxy('http://proxy.example.com:3128/')
-    ('http', None, None, 'proxy.example.com:3128')
-    >>> _parse_proxy('http://joe:password@proxy.example.com/')
-    ('http', 'joe', 'password', 'proxy.example.com')
-    >>> _parse_proxy('http://joe:password@proxy.example.com:3128')
-    ('http', 'joe', 'password', 'proxy.example.com:3128')
-
-    Everything after the authority is ignored:
-
-    >>> _parse_proxy('ftp://joe:password@proxy.example.com/rubbish:3128')
-    ('ftp', 'joe', 'password', 'proxy.example.com')
-
-    Test for no trailing '/' case:
-
-    >>> _parse_proxy('http://joe:password@proxy.example.com')
-    ('http', 'joe', 'password', 'proxy.example.com')
-
+    have two slashes after the scheme.
     """
     scheme, r_scheme = splittype(proxy)
     if not r_scheme.startswith("/"):
@@ -905,10 +854,6 @@
             password_mgr = HTTPPasswordMgr()
         self.passwd = password_mgr
         self.add_password = self.passwd.add_password
-        self.retried = 0
-
-    def reset_retry_count(self):
-        self.retried = 0
 
     def http_error_auth_reqed(self, authreq, host, req, headers):
         # host may be an authority (without userinfo) or a URL with an
@@ -916,13 +861,6 @@
         # XXX could be multiple headers
         authreq = headers.get(authreq, None)
 
-        if self.retried > 5:
-            # retry sending the username:password 5 times before failing.
-            raise HTTPError(req.get_full_url(), 401, "basic auth failed",
-                    headers, None)
-        else:
-            self.retried += 1
-
         if authreq:
             scheme = authreq.split()[0]
             if scheme.lower() != 'basic':
@@ -937,17 +875,14 @@
                         warnings.warn("Basic Auth Realm was unquoted",
                                       UserWarning, 2)
                     if scheme.lower() == 'basic':
-                        response = self.retry_http_basic_auth(host, req, realm)
-                        if response and response.code != 401:
-                            self.retried = 0
-                        return response
+                        return self.retry_http_basic_auth(host, req, realm)
 
     def retry_http_basic_auth(self, host, req, realm):
         user, pw = self.passwd.find_user_password(realm, host)
         if pw is not None:
             raw = "%s:%s" % (user, pw)
             auth = "Basic " + base64.b64encode(raw.encode()).decode("ascii")
-            if req.headers.get(self.auth_header, None) == auth:
+            if req.get_header(self.auth_header, None) == auth:
                 return None
             req.add_unredirected_header(self.auth_header, auth)
             return self.parent.open(req, timeout=req.timeout)
@@ -963,7 +898,6 @@
         url = req.full_url
         response = self.http_error_auth_reqed('www-authenticate',
                                           url, req, headers)
-        self.reset_retry_count()
         return response
 
 
@@ -979,7 +913,6 @@
         authority = req.host
         response = self.http_error_auth_reqed('proxy-authenticate',
                                           authority, req, headers)
-        self.reset_retry_count()
         return response
 
 
@@ -1245,18 +1178,21 @@
             h.set_tunnel(req._tunnel_host, headers=tunnel_headers)
 
         try:
-            h.request(req.get_method(), req.selector, req.data, headers)
-        except socket.error as err: # timeout error
-            h.close()
-            raise URLError(err)
-        else:
+            try:
+                h.request(req.get_method(), req.selector, req.data, headers)
+            except OSError as err: # timeout error
+                raise URLError(err)
             r = h.getresponse()
-            # If the server does not send us a 'Connection: close' header,
-            # HTTPConnection assumes the socket should be left open. Manually
-            # mark the socket to be closed when this response object goes away.
-            if h.sock:
-                h.sock.close()
-                h.sock = None
+        except:
+            h.close()
+            raise
+
+        # If the server does not send us a 'Connection: close' header,
+        # HTTPConnection assumes the socket should be left open. Manually
+        # mark the socket to be closed when this response object goes away.
+        if h.sock:
+            h.sock.close()
+            h.sock = None
 
         r.url = req.get_full_url()
         # This line replaces the .msg attribute of the HTTPResponse
@@ -1374,7 +1310,7 @@
         url = req.selector
         if url[:2] == '//' and url[2:3] != '/' and (req.host and
                 req.host != 'localhost'):
-            if not req.host is self.get_names():
+            if not req.host in self.get_names():
                 raise URLError("file:// scheme is supported only on localhost")
         else:
             return self.open_local_file(req)
@@ -1451,7 +1387,7 @@
 
         try:
             host = socket.gethostbyname(host)
-        except socket.error as msg:
+        except OSError as msg:
             raise URLError(msg)
         path, attrs = splitattr(req.selector)
         dirs = path.split('/')
@@ -1537,6 +1473,36 @@
         self.cache.clear()
         self.timeout.clear()
 
+class DataHandler(BaseHandler):
+    def data_open(self, req):
+        # data URLs as specified in RFC 2397.
+        #
+        # ignores POSTed data
+        #
+        # syntax:
+        # dataurl   := "data:" [ mediatype ] [ ";base64" ] "," data
+        # mediatype := [ type "/" subtype ] *( ";" parameter )
+        # data      := *urlchar
+        # parameter := attribute "=" value
+        url = req.full_url
+
+        scheme, data = url.split(":",1)
+        mediatype, data = data.split(",",1)
+
+        # even base64 encoded data URLs might be quoted so unquote in any case:
+        data = unquote_to_bytes(data)
+        if mediatype.endswith(";base64"):
+            data = base64.decodebytes(data)
+            mediatype = mediatype[:-7]
+
+        if not mediatype:
+            mediatype = "text/plain;charset=US-ASCII"
+
+        headers = email.message_from_string("Content-type: %s\nContent-length: %d\n" %
+            (mediatype, len(data)))
+
+        return addinfourl(io.BytesIO(data), headers, url)
+
 
 # Code move from the old urllib module
 
@@ -1660,20 +1626,20 @@
                 return getattr(self, name)(url)
             else:
                 return getattr(self, name)(url, data)
-        except HTTPError:
+        except (HTTPError, URLError):
             raise
-        except socket.error as msg:
-            raise IOError('socket error', msg).with_traceback(sys.exc_info()[2])
+        except OSError as msg:
+            raise OSError('socket error', msg).with_traceback(sys.exc_info()[2])
 
     def open_unknown(self, fullurl, data=None):
         """Overridable interface to open unknown URL type."""
         type, url = splittype(fullurl)
-        raise IOError('url error', 'unknown url type', type)
+        raise OSError('url error', 'unknown url type', type)
 
     def open_unknown_proxy(self, proxy, fullurl, data=None):
         """Overridable interface to open unknown URL type."""
         type, url = splittype(fullurl)
-        raise IOError('url error', 'invalid proxy for %s' % type, proxy)
+        raise OSError('url error', 'invalid proxy for %s' % type, proxy)
 
     # External interface
     def retrieve(self, url, filename=None, reporthook=None, data=None):
@@ -1689,7 +1655,7 @@
                 hdrs = fp.info()
                 fp.close()
                 return url2pathname(splithost(url1)[1]), hdrs
-            except IOError as msg:
+            except OSError as msg:
                 pass
         fp = self.open(url, data)
         try:
@@ -1782,7 +1748,7 @@
                 if proxy_bypass(realhost):
                     host = realhost
 
-        if not host: raise IOError('http error', 'no host given')
+        if not host: raise OSError('http error', 'no host given')
 
         if proxy_passwd:
             proxy_passwd = unquote(proxy_passwd)
@@ -1855,7 +1821,7 @@
         return self.http_error_default(url, fp, errcode, errmsg, headers)
 
     def http_error_default(self, url, fp, errcode, errmsg, headers):
-        """Default error handler: close the connection and raise IOError."""
+        """Default error handler: close the connection and raise OSError."""
         fp.close()
         raise HTTPError(url, errcode, errmsg, headers, None)
 
@@ -1940,7 +1906,7 @@
         # XXX thread unsafe!
         if len(self.ftpcache) > MAXFTPCACHE:
             # Prune the cache, rather arbitrarily
-            for k in self.ftpcache.keys():
+            for k in list(self.ftpcache):
                 if k != key:
                     v = self.ftpcache[k]
                     del self.ftpcache[k]
@@ -1982,7 +1948,7 @@
         try:
             [type, data] = url.split(',', 1)
         except ValueError:
-            raise IOError('data error', 'bad data URL')
+            raise OSError('data error', 'bad data URL')
         if not type:
             type = 'text/plain;charset=US-ASCII'
         semi = type.rfind(';')
@@ -2431,7 +2397,7 @@
                 try:
                     hostIP = socket.gethostbyname(hostonly)
                     hostIP = ip2num(hostIP)
-                except socket.error:
+                except OSError:
                     continue
 
             base = ip2num(m.group(1))
@@ -2517,7 +2483,7 @@
                         proxies['https'] = 'https://%s' % proxyServer
                         proxies['ftp'] = 'ftp://%s' % proxyServer
             internetSettings.Close()
-        except (WindowsError, ValueError, TypeError):
+        except (OSError, ValueError, TypeError):
             # Either registry key not found etc, or the value in an
             # unexpected format.
             # proxies already set up to be empty so nothing to do
@@ -2547,7 +2513,7 @@
             proxyOverride = str(winreg.QueryValueEx(internetSettings,
                                                      'ProxyOverride')[0])
             # ^^^^ Returned as Unicode but problems if not converted to ASCII
-        except WindowsError:
+        except OSError:
             return 0
         if not proxyEnable or not proxyOverride:
             return 0
@@ -2558,13 +2524,13 @@
             addr = socket.gethostbyname(rawHost)
             if addr != rawHost:
                 host.append(addr)
-        except socket.error:
+        except OSError:
             pass
         try:
             fqdn = socket.getfqdn(rawHost)
             if fqdn != rawHost:
                 host.append(fqdn)
-        except socket.error:
+        except OSError:
             pass
         # make a check value list from the registry entry: replace the
         # '<local>' string by the localhost entry and the corresponding
diff --git a/Lib/urllib/response.py b/Lib/urllib/response.py
index 1cf1d1a..4a143b0 100644
--- a/Lib/urllib/response.py
+++ b/Lib/urllib/response.py
@@ -6,60 +6,39 @@
 headers and a geturl() method that returns the url.
 """
 
-class addbase(object):
-    """Base class for addinfo and addclosehook."""
+import tempfile
+
+__all__ = ['addbase', 'addclosehook', 'addinfo', 'addinfourl']
+
+
+class addbase(tempfile._TemporaryFileWrapper):
+    """Base class for addinfo and addclosehook. Is a good idea for garbage collection."""
 
     # XXX Add a method to expose the timeout on the underlying socket?
 
     def __init__(self, fp):
-        # TODO(jhylton): Is there a better way to delegate using io?
+        super(addbase,  self).__init__(fp, '<urllib response>', delete=False)
+        # Keep reference around as this was part of the original API.
         self.fp = fp
-        self.read = self.fp.read
-        self.readline = self.fp.readline
-        # TODO(jhylton): Make sure an object with readlines() is also iterable
-        if hasattr(self.fp, "readlines"):
-            self.readlines = self.fp.readlines
-        if hasattr(self.fp, "fileno"):
-            self.fileno = self.fp.fileno
-        else:
-            self.fileno = lambda: None
-
-    def __iter__(self):
-        # Assigning `__iter__` to the instance doesn't work as intended
-        # because the iter builtin does something like `cls.__iter__(obj)`
-        # and thus fails to find the _bound_ method `obj.__iter__`.
-        # Returning just `self.fp` works for built-in file objects but
-        # might not work for general file-like objects.
-        return iter(self.fp)
 
     def __repr__(self):
         return '<%s at %r whose fp = %r>' % (self.__class__.__name__,
-                                             id(self), self.fp)
-
-    def close(self):
-        if self.fp:
-            self.fp.close()
-        self.fp = None
-        self.read = None
-        self.readline = None
-        self.readlines = None
-        self.fileno = None
-        self.__iter__ = None
-        self.__next__ = None
+                                             id(self), self.file)
 
     def __enter__(self):
-        if self.fp is None:
+        if self.fp.closed:
             raise ValueError("I/O operation on closed file")
         return self
 
     def __exit__(self, type, value, traceback):
         self.close()
 
+
 class addclosehook(addbase):
     """Class to add a close hook to an open file."""
 
     def __init__(self, fp, closehook, *hookargs):
-        addbase.__init__(self, fp)
+        super(addclosehook, self).__init__(fp)
         self.closehook = closehook
         self.hookargs = hookargs
 
@@ -68,30 +47,28 @@
             self.closehook(*self.hookargs)
             self.closehook = None
             self.hookargs = None
-        addbase.close(self)
+        super(addclosehook, self).close()
+
 
 class addinfo(addbase):
     """class to add an info() method to an open file."""
 
     def __init__(self, fp, headers):
-        addbase.__init__(self, fp)
+        super(addinfo, self).__init__(fp)
         self.headers = headers
 
     def info(self):
         return self.headers
 
-class addinfourl(addbase):
+
+class addinfourl(addinfo):
     """class to add info() and geturl() methods to an open file."""
 
     def __init__(self, fp, headers, url, code=None):
-        addbase.__init__(self, fp)
-        self.headers = headers
+        super(addinfourl, self).__init__(fp, headers)
         self.url = url
         self.code = code
 
-    def info(self):
-        return self.headers
-
     def getcode(self):
         return self.code
 
diff --git a/Lib/urllib/robotparser.py b/Lib/urllib/robotparser.py
index 978ba58..1d7b751 100644
--- a/Lib/urllib/robotparser.py
+++ b/Lib/urllib/robotparser.py
@@ -7,7 +7,7 @@
     2) PSF license for Python 2.2
 
     The robots.txt Exclusion Protocol is implemented as specified in
-    http://info.webcrawler.com/mak/projects/robots/norobots-rfc.html
+    http://www.robotstxt.org/norobots-rfc.txt
 """
 
 import urllib.parse, urllib.request
@@ -57,7 +57,7 @@
         except urllib.error.HTTPError as err:
             if err.code in (401, 403):
                 self.disallow_all = True
-            elif err.code >= 400:
+            elif err.code >= 400 and err.code < 500:
                 self.allow_all = True
         else:
             raw = f.read()
@@ -85,6 +85,7 @@
         state = 0
         entry = Entry()
 
+        self.modified()
         for line in lines:
             if not line:
                 if state == 1:
@@ -129,6 +130,12 @@
             return False
         if self.allow_all:
             return True
+        # Until the robots.txt file has been read or found not
+        # to exist, we must assume that no url is allowable.
+        # This prevents false positives when a user erronenously
+        # calls can_fetch() before calling read().
+        if not self.last_checked:
+            return False
         # search for given user agent matches
         # the first match counts
         parsed_url = urllib.parse.urlparse(urllib.parse.unquote(url))
diff --git a/Lib/uuid.py b/Lib/uuid.py
index 9946042..1061bff 100644
--- a/Lib/uuid.py
+++ b/Lib/uuid.py
@@ -147,7 +147,7 @@
             if len(bytes) != 16:
                 raise ValueError('bytes is not a 16-char string')
             assert isinstance(bytes, bytes_), repr(bytes)
-            int = int_(('%02x'*16) % tuple(bytes), 16)
+            int = int_.from_bytes(bytes, byteorder='big')
         if fields is not None:
             if len(fields) != 6:
                 raise ValueError('fields is not a 6-tuple')
@@ -311,7 +311,7 @@
         if self.variant == RFC_4122:
             return int((self.int >> 76) & 0xf)
 
-def _find_mac(command, args, hw_identifiers, get_index):
+def _popen(command, args):
     import os, shutil
     executable = shutil.which(command)
     if executable is None:
@@ -319,19 +319,27 @@
         executable = shutil.which(command, path=path)
         if executable is None:
             return None
+    # LC_ALL to ensure English output, 2>/dev/null to prevent output on
+    # stderr (Note: we don't have an example where the words we search for
+    # are actually localized, but in theory some system could do so.)
+    cmd = 'LC_ALL=C %s %s 2>/dev/null' % (executable, args)
+    return os.popen(cmd)
 
+def _find_mac(command, args, hw_identifiers, get_index):
     try:
-        # LC_ALL to ensure English output, 2>/dev/null to
-        # prevent output on stderr
-        cmd = 'LC_ALL=C %s %s 2>/dev/null' % (executable, args)
-        with os.popen(cmd) as pipe:
+        pipe = _popen(command, args)
+        if not pipe:
+            return
+        with pipe:
             for line in pipe:
-                words = line.lower().split()
+                words = line.lower().rstrip().split()
                 for i in range(len(words)):
                     if words[i] in hw_identifiers:
                         try:
-                            return int(
-                                words[get_index(i)].replace(':', ''), 16)
+                            word = words[get_index(i)]
+                            mac = int(word.replace(':', ''), 16)
+                            if mac:
+                                return mac
                         except (ValueError, IndexError):
                             # Virtual interfaces, such as those provided by
                             # VPNs, do not have a colon-delimited MAC address
@@ -339,32 +347,58 @@
                             # dashes. These should be ignored in favor of a
                             # real MAC address
                             pass
-    except IOError:
+    except OSError:
         pass
 
 def _ifconfig_getnode():
     """Get the hardware address on Unix by running ifconfig."""
-
     # This works on Linux ('' or '-a'), Tru64 ('-av'), but not all Unixes.
     for args in ('', '-a', '-av'):
         mac = _find_mac('ifconfig', args, ['hwaddr', 'ether'], lambda i: i+1)
         if mac:
             return mac
 
-    import socket
-    ip_addr = socket.gethostbyname(socket.gethostname())
+def _arp_getnode():
+    """Get the hardware address on Unix by running arp."""
+    import os, socket
+    try:
+        ip_addr = socket.gethostbyname(socket.gethostname())
+    except OSError:
+        return None
 
     # Try getting the MAC addr from arp based on our IP address (Solaris).
-    mac = _find_mac('arp', '-an', [ip_addr], lambda i: -1)
-    if mac:
-        return mac
+    return _find_mac('arp', '-an', [ip_addr], lambda i: -1)
 
+def _lanscan_getnode():
+    """Get the hardware address on Unix by running lanscan."""
     # This might work on HP-UX.
-    mac = _find_mac('lanscan', '-ai', ['lan0'], lambda i: 0)
-    if mac:
-        return mac
+    return _find_mac('lanscan', '-ai', ['lan0'], lambda i: 0)
 
-    return None
+def _netstat_getnode():
+    """Get the hardware address on Unix by running netstat."""
+    # This might work on AIX, Tru64 UNIX and presumably on IRIX.
+    try:
+        pipe = _popen('netstat', '-ia')
+        if not pipe:
+            return
+        with pipe:
+            words = pipe.readline().rstrip().split()
+            try:
+                i = words.index('Address')
+            except ValueError:
+                return
+            for line in pipe:
+                try:
+                    words = line.rstrip().split()
+                    word = words[i]
+                    if len(word) == 17 and word.count(':') == 5:
+                        mac = int(word.replace(':', ''), 16)
+                        if mac:
+                            return mac
+                except (ValueError, IndexError):
+                    pass
+    except OSError:
+        pass
 
 def _ipconfig_getnode():
     """Get the hardware address on Windows by running ipconfig.exe."""
@@ -380,15 +414,13 @@
     for dir in dirs:
         try:
             pipe = os.popen(os.path.join(dir, 'ipconfig') + ' /all')
-        except IOError:
+        except OSError:
             continue
-        else:
+        with pipe:
             for line in pipe:
                 value = line.split(':')[-1].strip().lower()
                 if re.match('([0-9a-f][0-9a-f]-){5}[0-9a-f][0-9a-f]', value):
                     return int(value.replace('-', ''), 16)
-        finally:
-            pipe.close()
 
 def _netbios_getnode():
     """Get the hardware address on Windows using NetBIOS calls.
@@ -507,7 +539,8 @@
     if sys.platform == 'win32':
         getters = [_windll_getnode, _netbios_getnode, _ipconfig_getnode]
     else:
-        getters = [_unixdll_getnode, _ifconfig_getnode]
+        getters = [_unixdll_getnode, _ifconfig_getnode, _arp_getnode,
+                   _lanscan_getnode, _netstat_getnode]
 
     for getter in getters + [_random_getnode]:
         try:
diff --git a/Lib/venv/__init__.py b/Lib/venv/__init__.py
index 3606370..3a7e8e2 100644
--- a/Lib/venv/__init__.py
+++ b/Lib/venv/__init__.py
@@ -1,7 +1,7 @@
 """
 Virtual environment (venv) package for Python. Based on PEP 405.
 
-Copyright (C) 2011-2012 Vinay Sajip.
+Copyright (C) 2011-2014 Vinay Sajip.
 Licensed to the PSF under a contributor agreement.
 
 usage: python -m venv [-h] [--system-site-packages] [--symlinks] [--clear]
@@ -24,12 +24,14 @@
                         raised.
   --upgrade             Upgrade the environment directory to use this version
                         of Python, assuming Python has been upgraded in-place.
+  --without-pip         Skips installing or upgrading pip in the virtual
+                        environment (pip is bootstrapped by default)
 """
 import logging
 import os
 import shutil
+import subprocess
 import sys
-import sysconfig
 import types
 
 logger = logging.getLogger(__name__)
@@ -56,14 +58,17 @@
     :param symlinks: If True, attempt to symlink rather than copy files into
                      virtual environment.
     :param upgrade: If True, upgrade an existing virtual environment.
+    :param with_pip: If True, ensure pip is installed in the virtual
+                     environment
     """
 
     def __init__(self, system_site_packages=False, clear=False,
-                 symlinks=False, upgrade=False):
+                 symlinks=False, upgrade=False, with_pip=False):
         self.system_site_packages = system_site_packages
         self.clear = clear
         self.symlinks = symlinks
         self.upgrade = upgrade
+        self.with_pip = with_pip
 
     def create(self, env_dir):
         """
@@ -76,10 +81,20 @@
         context = self.ensure_directories(env_dir)
         self.create_configuration(context)
         self.setup_python(context)
+        if self.with_pip:
+            self._setup_pip(context)
         if not self.upgrade:
             self.setup_scripts(context)
             self.post_setup(context)
 
+    def clear_directory(self, path):
+        for fn in os.listdir(path):
+            fn = os.path.join(path, fn)
+            if os.path.islink(fn) or os.path.isfile(fn):
+                os.remove(fn)
+            elif os.path.isdir(fn):
+                shutil.rmtree(fn)
+
     def ensure_directories(self, env_dir):
         """
         Create the directories for the environment.
@@ -91,11 +106,11 @@
         def create_if_needed(d):
             if not os.path.exists(d):
                 os.makedirs(d)
+            elif os.path.islink(d) or os.path.isfile(d):
+                raise ValueError('Unable to create directory %r' % d)
 
-        if os.path.exists(env_dir) and not (self.clear or self.upgrade):
-            raise ValueError('Directory exists: %s' % env_dir)
         if os.path.exists(env_dir) and self.clear:
-            shutil.rmtree(env_dir)
+            self.clear_directory(env_dir)
         context = types.SimpleNamespace()
         context.env_dir = env_dir
         context.env_name = os.path.split(env_dir)[1]
@@ -117,10 +132,19 @@
         else:
             binname = 'bin'
             incpath = 'include'
-            libpath = os.path.join(env_dir, 'lib', 'python%d.%d' % sys.version_info[:2], 'site-packages')
+            libpath = os.path.join(env_dir, 'lib',
+                                   'python%d.%d' % sys.version_info[:2],
+                                   'site-packages')
         context.inc_path = path = os.path.join(env_dir, incpath)
         create_if_needed(path)
         create_if_needed(libpath)
+        # Issue 21197: create lib64 as a symlink to lib on 64-bit non-OS X POSIX
+        if ((sys.maxsize > 2**32) and (os.name == 'posix') and
+            (sys.platform != 'darwin')):
+            p = os.path.join(env_dir, 'lib')
+            link_path = os.path.join(env_dir, 'lib64')
+            if not os.path.exists(link_path):   # Issue #21643
+                os.symlink(p, link_path)
         context.bin_path = binpath = os.path.join(env_dir, binname)
         context.bin_name = binname
         context.env_exe = os.path.join(binpath, exename)
@@ -188,7 +212,11 @@
             for suffix in ('python', 'python3'):
                 path = os.path.join(binpath, suffix)
                 if not os.path.exists(path):
-                    os.symlink(exename, path)
+                    # Issue 18807: make copies if
+                    # symlinks are not wanted
+                    copier(context.env_exe, path)
+                    if not os.path.islink(path):
+                        os.chmod(path, 0o755)
         else:
             subdir = 'DLLs'
             include = self.include_binary
@@ -210,12 +238,22 @@
                 if 'init.tcl' in files:
                     tcldir = os.path.basename(root)
                     tcldir = os.path.join(context.env_dir, 'Lib', tcldir)
-                    os.makedirs(tcldir)
+                    if not os.path.exists(tcldir):
+                        os.makedirs(tcldir)
                     src = os.path.join(root, 'init.tcl')
                     dst = os.path.join(tcldir, 'init.tcl')
                     shutil.copyfile(src, dst)
                     break
 
+    def _setup_pip(self, context):
+        """Installs or upgrades pip in a virtual environment"""
+        # We run ensurepip in isolated mode to avoid side effects from
+        # environment vars, the current directory and anything else
+        # intended for the global Python environment
+        cmd = [context.env_exe, '-Im', 'ensurepip', '--upgrade',
+                                                    '--default-pip']
+        subprocess.check_output(cmd, stderr=subprocess.STDOUT)
+
     def setup_scripts(self, context):
         """
         Set up scripts into the created environment from a directory.
@@ -253,7 +291,8 @@
                         being processed.
         """
         text = text.replace('__VENV_DIR__', context.env_dir)
-        text = text.replace('__VENV_NAME__', context.prompt)
+        text = text.replace('__VENV_NAME__', context.env_name)
+        text = text.replace('__VENV_PROMPT__', context.prompt)
         text = text.replace('__VENV_BIN_NAME__', context.bin_name)
         text = text.replace('__VENV_PYTHON__', context.env_exe)
         return text
@@ -308,7 +347,8 @@
                     shutil.copymode(srcfile, dstfile)
 
 
-def create(env_dir, system_site_packages=False, clear=False, symlinks=False):
+def create(env_dir, system_site_packages=False, clear=False,
+                    symlinks=False, with_pip=False):
     """
     Create a virtual environment in a directory.
 
@@ -324,9 +364,11 @@
                   raised.
     :param symlinks: If True, attempt to symlink rather than copy files into
                      virtual environment.
+    :param with_pip: If True, ensure pip is installed in the virtual
+                     environment
     """
     builder = EnvBuilder(system_site_packages=system_site_packages,
-                                   clear=clear, symlinks=symlinks)
+                         clear=clear, symlinks=symlinks, with_pip=with_pip)
     builder.create(env_dir)
 
 def main(args=None):
@@ -360,28 +402,40 @@
             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.')
+        group = parser.add_mutually_exclusive_group()
+        group.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.')
+        group.add_argument('--copies', default=not use_symlinks,
+                           action='store_false', dest='symlinks',
+                           help='Try to use copies rather than symlinks, '
+                                'even when symlinks are the default for '
+                                'the platform.')
         parser.add_argument('--clear', default=False, action='store_true',
-                            dest='clear', help='Delete the environment '
-                                               'directory if it already '
-                                               'exists. If not specified and '
-                                               'the directory exists, an error'
-                                               ' is raised.')
+                            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('--without-pip', dest='with_pip',
+                            default=True, action='store_false',
+                            help='Skips installing or upgrading pip in the '
+                                 'virtual environment (pip is bootstrapped '
+                                 'by default)')
         options = parser.parse_args(args)
         if options.upgrade and options.clear:
             raise ValueError('you cannot supply --upgrade and --clear together.')
         builder = EnvBuilder(system_site_packages=options.system_site,
-                             clear=options.clear, symlinks=options.symlinks,
-                             upgrade=options.upgrade)
+                             clear=options.clear,
+                             symlinks=options.symlinks,
+                             upgrade=options.upgrade,
+                             with_pip=options.with_pip)
         for d in options.dirs:
             builder.create(d)
 
diff --git a/Lib/venv/scripts/nt/Activate.ps1 b/Lib/venv/scripts/nt/Activate.ps1
index 1c5ef98..b15decb 100644
--- a/Lib/venv/scripts/nt/Activate.ps1
+++ b/Lib/venv/scripts/nt/Activate.ps1
@@ -1,25 +1,40 @@
+function global:deactivate ([switch]$NonDestructive) {

+    # Revert to original values

+    if (Test-Path function:_OLD_VIRTUAL_PROMPT) {

+        copy-item function:_OLD_VIRTUAL_PROMPT function:prompt

+        remove-item function:_OLD_VIRTUAL_PROMPT

+    }

+

+    if (Test-Path env:_OLD_VIRTUAL_PYTHONHOME) {

+        copy-item env:_OLD_VIRTUAL_PYTHONHOME env:PYTHONHOME

+        remove-item env:_OLD_VIRTUAL_PYTHONHOME

+    }

+

+    if (Test-Path env:_OLD_VIRTUAL_PATH) {

+        copy-item env:_OLD_VIRTUAL_PATH env:PATH

+        remove-item env:_OLD_VIRTUAL_PATH

+    }

+

+    if (Test-Path env:VIRTUAL_ENV) {

+        remove-item env:VIRTUAL_ENV

+    }

+

+    if (!$NonDestructive) {

+        # Self destruct!

+        remove-item function:deactivate

+    }

+}

+

+deactivate -nondestructive

+
 $env:VIRTUAL_ENV="__VENV_DIR__"

 

-# Revert to original values

-if (Test-Path function:_OLD_VIRTUAL_PROMPT) {

-    copy-item function:_OLD_VIRTUAL_PROMPT function:prompt

-    remove-item function:_OLD_VIRTUAL_PROMPT

-}

-

-if (Test-Path env:_OLD_VIRTUAL_PYTHONHOME) {

-    copy-item env:_OLD_VIRTUAL_PYTHONHOME env:PYTHONHOME

-    remove-item env:_OLD_VIRTUAL_PYTHONHOME

-}

-

-if (Test-Path env:_OLD_VIRTUAL_PATH) {

-    copy-item env:_OLD_VIRTUAL_PATH env:PATH

-    remove-item env:_OLD_VIRTUAL_PATH

-}

-

 # Set the prompt to include the env name

+# Make sure _OLD_VIRTUAL_PROMPT is global

+function global:_OLD_VIRTUAL_PROMPT {""}

 copy-item function:prompt function:_OLD_VIRTUAL_PROMPT

-function prompt {

-    Write-Host -NoNewline -ForegroundColor Green '[__VENV_NAME__]'

+function global:prompt {

+    Write-Host -NoNewline -ForegroundColor Green '__VENV_PROMPT__'

     _OLD_VIRTUAL_PROMPT

 }

 

diff --git a/Lib/venv/scripts/nt/Deactivate.ps1 b/Lib/venv/scripts/nt/Deactivate.ps1
deleted file mode 100644
index 3d1e96b..0000000
--- a/Lib/venv/scripts/nt/Deactivate.ps1
+++ /dev/null
@@ -1,19 +0,0 @@
-# Revert to original values

-if (Test-Path function:_OLD_VIRTUAL_PROMPT) {

-    copy-item function:_OLD_VIRTUAL_PROMPT function:prompt

-    remove-item function:_OLD_VIRTUAL_PROMPT

-}

-

-if (Test-Path env:_OLD_VIRTUAL_PYTHONHOME) {

-    copy-item env:_OLD_VIRTUAL_PYTHONHOME env:PYTHONHOME

-    remove-item env:_OLD_VIRTUAL_PYTHONHOME

-}

-

-if (Test-Path env:_OLD_VIRTUAL_PATH) {

-    copy-item env:_OLD_VIRTUAL_PATH env:PATH

-    remove-item env:_OLD_VIRTUAL_PATH

-}

-

-if (Test-Path env:VIRTUAL_ENV) {

-    remove-item env:VIRTUAL_ENV

-}

diff --git a/Lib/venv/scripts/nt/activate.bat b/Lib/venv/scripts/nt/activate.bat
index 3cebe26..9eab147 100644
--- a/Lib/venv/scripts/nt/activate.bat
+++ b/Lib/venv/scripts/nt/activate.bat
@@ -14,7 +14,7 @@
 )

 

 set "_OLD_VIRTUAL_PROMPT=%PROMPT%"

-set "PROMPT=__VENV_NAME__%PROMPT%"

+set "PROMPT=__VENV_PROMPT__%PROMPT%"

 

 if defined PYTHONHOME (

     set "_OLD_VIRTUAL_PYTHONHOME=%PYTHONHOME%"

diff --git a/Lib/venv/scripts/posix/activate b/Lib/venv/scripts/posix/activate
index c241450..7bbffd9 100644
--- a/Lib/venv/scripts/posix/activate
+++ b/Lib/venv/scripts/posix/activate
@@ -54,8 +54,8 @@
 
 if [ -z "$VIRTUAL_ENV_DISABLE_PROMPT" ] ; then
     _OLD_VIRTUAL_PS1="$PS1"
-    if [ "x__VENV_NAME__" != x ] ; then
-	PS1="__VENV_NAME__$PS1"
+    if [ "x__VENV_PROMPT__" != x ] ; then
+	PS1="__VENV_PROMPT__$PS1"
     else
     if [ "`basename \"$VIRTUAL_ENV\"`" = "__" ] ; then
         # special case for Aspen magic directories
diff --git a/Lib/venv/scripts/posix/activate.csh b/Lib/venv/scripts/posix/activate.csh
new file mode 100644
index 0000000..99d79e0
--- /dev/null
+++ b/Lib/venv/scripts/posix/activate.csh
@@ -0,0 +1,37 @@
+# This file must be used with "source bin/activate.csh" *from csh*.
+# You cannot run it directly.
+# Created by Davide Di Blasi <davidedb@gmail.com>.
+# Ported to Python 3.3 venv by Andrew Svetlov <andrew.svetlov@gmail.com>
+
+alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; test "\!:*" != "nondestructive" && unalias deactivate'
+
+# Unset irrelavent variables.
+deactivate nondestructive
+
+setenv VIRTUAL_ENV "__VENV_DIR__"
+
+set _OLD_VIRTUAL_PATH="$PATH"
+setenv PATH "$VIRTUAL_ENV/__VENV_BIN_NAME__:$PATH"
+
+
+set _OLD_VIRTUAL_PROMPT="$prompt"
+
+if (! "$?VIRTUAL_ENV_DISABLE_PROMPT") then
+    if ("__VENV_NAME__" != "") then
+        set env_name = "__VENV_NAME__"
+    else
+        if (`basename "VIRTUAL_ENV"` == "__") then
+            # special case for Aspen magic directories
+            # see http://www.zetadev.com/software/aspen/
+            set env_name = `basename \`dirname "$VIRTUAL_ENV"\``
+        else
+            set env_name = `basename "$VIRTUAL_ENV"`
+        endif
+    endif
+    set prompt = "[$env_name] $prompt"
+    unset env_name
+endif
+
+alias pydoc python -m pydoc
+
+rehash
diff --git a/Lib/venv/scripts/posix/activate.fish b/Lib/venv/scripts/posix/activate.fish
new file mode 100644
index 0000000..45391aa
--- /dev/null
+++ b/Lib/venv/scripts/posix/activate.fish
@@ -0,0 +1,74 @@
+# This file must be used with ". bin/activate.fish" *from fish* (http://fishshell.org)
+# you cannot run it directly
+
+function deactivate  -d "Exit virtualenv and return to normal shell environment"
+    # reset old environment variables
+    if test -n "$_OLD_VIRTUAL_PATH"
+        set -gx PATH $_OLD_VIRTUAL_PATH
+        set -e _OLD_VIRTUAL_PATH
+    end
+    if test -n "$_OLD_VIRTUAL_PYTHONHOME"
+        set -gx PYTHONHOME $_OLD_VIRTUAL_PYTHONHOME
+        set -e _OLD_VIRTUAL_PYTHONHOME
+    end
+
+    if test -n "$_OLD_FISH_PROMPT_OVERRIDE"
+        functions -e fish_prompt
+        set -e _OLD_FISH_PROMPT_OVERRIDE
+        . ( begin
+                printf "function fish_prompt\n\t#"
+                functions _old_fish_prompt
+            end | psub )
+        functions -e _old_fish_prompt
+    end
+
+    set -e VIRTUAL_ENV
+    if test "$argv[1]" != "nondestructive"
+        # Self destruct!
+        functions -e deactivate
+    end
+end
+
+# unset irrelavent variables
+deactivate nondestructive
+
+set -gx VIRTUAL_ENV "__VENV_DIR__"
+
+set -gx _OLD_VIRTUAL_PATH $PATH
+set -gx PATH "$VIRTUAL_ENV/__VENV_BIN_NAME__" $PATH
+
+# unset PYTHONHOME if set
+if set -q PYTHONHOME
+    set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME
+    set -e PYTHONHOME
+end
+
+if test -z "$VIRTUAL_ENV_DISABLE_PROMPT"
+    # fish uses a function instead of an env var to generate the prompt.
+
+    # save the current fish_prompt function as the function _old_fish_prompt
+    . ( begin
+            printf "function _old_fish_prompt\n\t#"
+            functions fish_prompt
+        end | psub )
+
+    # with the original prompt function renamed, we can override with our own.
+    function fish_prompt
+        # Prompt override?
+        if test -n "__VENV_PROMPT__"
+            printf "%s%s%s" "__VENV_PROMPT__" (set_color normal) (_old_fish_prompt)
+            return
+        end
+        # ...Otherwise, prepend env
+        set -l _checkbase (basename "$VIRTUAL_ENV")
+        if test $_checkbase = "__"
+            # special case for Aspen magic directories
+            # see http://www.zetadev.com/software/aspen/
+            printf "%s[%s]%s %s" (set_color -b blue white) (basename (dirname "$VIRTUAL_ENV")) (set_color normal) (_old_fish_prompt)
+        else
+            printf "%s(%s)%s%s" (set_color -b blue white) (basename "$VIRTUAL_ENV") (set_color normal) (_old_fish_prompt)
+        end
+    end
+
+    set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV"
+end
diff --git a/Lib/warnings.py b/Lib/warnings.py
index edbbb5e..70d087e 100644
--- a/Lib/warnings.py
+++ b/Lib/warnings.py
@@ -1,12 +1,9 @@
 """Python part of the warnings subsystem."""
 
-# Note: function level imports should *not* be used
-# in this module as it may cause import lock deadlock.
-# See bug 683658.
-import linecache
 import sys
 
-__all__ = ["warn", "showwarning", "formatwarning", "filterwarnings",
+__all__ = ["warn", "warn_explicit", "showwarning",
+           "formatwarning", "filterwarnings", "simplefilter",
            "resetwarnings", "catch_warnings"]
 
 
@@ -14,13 +11,17 @@
     """Hook to write a warning to a file; replace if you like."""
     if file is None:
         file = sys.stderr
+        if file is None:
+            # sys.stderr is None when run with pythonw.exe - warnings get lost
+            return
     try:
         file.write(formatwarning(message, category, filename, lineno, line))
-    except IOError:
+    except OSError:
         pass # the file (probably stderr) is invalid - this warning gets lost.
 
 def formatwarning(message, category, filename, lineno, line=None):
     """Function to format a warning the standard way."""
+    import linecache
     s =  "%s:%s: %s: %s\n" % (filename, lineno, category.__name__, message)
     line = linecache.getline(filename, lineno) if line is None else line
     if line:
@@ -55,6 +56,7 @@
         filters.append(item)
     else:
         filters.insert(0, item)
+    _filters_mutated()
 
 def simplefilter(action, category=Warning, lineno=0, append=False):
     """Insert a simple entry into the list of warnings filters (at the front).
@@ -75,10 +77,12 @@
         filters.append(item)
     else:
         filters.insert(0, item)
+    _filters_mutated()
 
 def resetwarnings():
     """Clear the list of warning filters, so that no filters are active."""
     filters[:] = []
+    _filters_mutated()
 
 class _OptionError(Exception):
     """Exception used by option processing helpers."""
@@ -206,6 +210,9 @@
             module = module[:-3] # XXX What about leading pathname?
     if registry is None:
         registry = {}
+    if registry.get('version', 0) != _filters_version:
+        registry.clear()
+        registry['version'] = _filters_version
     if isinstance(message, Warning):
         text = str(message)
         category = message.__class__
@@ -233,6 +240,7 @@
 
     # Prime the linecache for formatting, in case the
     # "file" is actually in a zipfile or something.
+    import linecache
     linecache.getlines(filename, module_globals)
 
     if action == "error":
@@ -330,6 +338,7 @@
         self._entered = True
         self._filters = self._module.filters
         self._module.filters = self._filters[:]
+        self._module._filters_mutated()
         self._showwarning = self._module.showwarning
         if self._record:
             log = []
@@ -344,6 +353,7 @@
         if not self._entered:
             raise RuntimeError("Cannot exit %r without entering first" % self)
         self._module.filters = self._filters
+        self._module._filters_mutated()
         self._module.showwarning = self._showwarning
 
 
@@ -358,15 +368,22 @@
 _warnings_defaults = False
 try:
     from _warnings import (filters, _defaultaction, _onceregistry,
-                            warn, warn_explicit)
+                           warn, warn_explicit, _filters_mutated)
     defaultaction = _defaultaction
     onceregistry = _onceregistry
     _warnings_defaults = True
+
 except ImportError:
     filters = []
     defaultaction = "default"
     onceregistry = {}
 
+    _filters_version = 1
+
+    def _filters_mutated():
+        global _filters_version
+        _filters_version += 1
+
 
 # Module initialization
 _processoptions(sys.warnoptions)
diff --git a/Lib/wave.py b/Lib/wave.py
index 4a22345..b56395e 100644
--- a/Lib/wave.py
+++ b/Lib/wave.py
@@ -18,7 +18,7 @@
       getcomptype()   -- returns compression type ('NONE' for linear samples)
       getcompname()   -- returns human-readable version of
                          compression type ('not compressed' linear samples)
-      getparams()     -- returns a tuple consisting of all of the
+      getparams()     -- returns a namedtuple consisting of all of the
                          above in the above order
       getmarkers()    -- returns None (for compatibility with the
                          aifc module)
@@ -82,15 +82,14 @@
 
 _array_fmts = None, 'b', 'h', None, 'i'
 
+import audioop
 import struct
 import sys
 from chunk import Chunk
+from collections import namedtuple
 
-def _byteswap3(data):
-    ba = bytearray(data)
-    ba[::3] = data[2::3]
-    ba[2::3] = data[::3]
-    return bytes(ba)
+_wave_params = namedtuple('_wave_params',
+                     'nchannels sampwidth framerate nframes comptype compname')
 
 class Wave_read:
     """Variables used in this class:
@@ -169,6 +168,13 @@
 
     def __del__(self):
         self.close()
+
+    def __enter__(self):
+        return self
+
+    def __exit__(self, *args):
+        self.close()
+
     #
     # User visible methods.
     #
@@ -207,9 +213,9 @@
         return self._compname
 
     def getparams(self):
-        return self.getnchannels(), self.getsampwidth(), \
-               self.getframerate(), self.getnframes(), \
-               self.getcomptype(), self.getcompname()
+        return _wave_params(self.getnchannels(), self.getsampwidth(),
+                       self.getframerate(), self.getnframes(),
+                       self.getcomptype(), self.getcompname())
 
     def getmarkers(self):
         return None
@@ -232,29 +238,9 @@
             self._data_seek_needed = 0
         if nframes == 0:
             return b''
-        if self._sampwidth in (2, 4) and sys.byteorder == 'big':
-            # unfortunately the fromfile() method does not take
-            # something that only looks like a file object, so
-            # we have to reach into the innards of the chunk object
-            import array
-            chunk = self._data_chunk
-            data = array.array(_array_fmts[self._sampwidth])
-            assert data.itemsize == self._sampwidth
-            nitems = nframes * self._nchannels
-            if nitems * self._sampwidth > chunk.chunksize - chunk.size_read:
-                nitems = (chunk.chunksize - chunk.size_read) // self._sampwidth
-            data.fromfile(chunk.file.file, nitems)
-            # "tell" data chunk how much was read
-            chunk.size_read = chunk.size_read + nitems * self._sampwidth
-            # do the same for the outermost chunk
-            chunk = chunk.file
-            chunk.size_read = chunk.size_read + nitems * self._sampwidth
-            data.byteswap()
-            data = data.tobytes()
-        else:
-            data = self._data_chunk.read(nframes * self._framesize)
-            if self._sampwidth == 3 and sys.byteorder == 'big':
-                data = _byteswap3(data)
+        data = self._data_chunk.read(nframes * self._framesize)
+        if self._sampwidth != 1 and sys.byteorder == 'big':
+            data = audioop.byteswap(data, self._sampwidth)
         if self._convert and data:
             data = self._convert(data)
         self._soundpos = self._soundpos + len(data) // (self._nchannels * self._sampwidth)
@@ -328,6 +314,12 @@
     def __del__(self):
         self.close()
 
+    def __enter__(self):
+        return self
+
+    def __exit__(self, *args):
+        self.close()
+
     #
     # User visible methods.
     #
@@ -402,8 +394,8 @@
     def getparams(self):
         if not self._nchannels or not self._sampwidth or not self._framerate:
             raise Error('not all parameters set')
-        return self._nchannels, self._sampwidth, self._framerate, \
-              self._nframes, self._comptype, self._compname
+        return _wave_params(self._nchannels, self._sampwidth, self._framerate,
+              self._nframes, self._comptype, self._compname)
 
     def setmark(self, id, pos, name):
         raise Error('setmark() not supported')
@@ -418,24 +410,16 @@
         return self._nframeswritten
 
     def writeframesraw(self, data):
+        if not isinstance(data, (bytes, bytearray)):
+            data = memoryview(data).cast('B')
         self._ensure_header_written(len(data))
         nframes = len(data) // (self._sampwidth * self._nchannels)
         if self._convert:
             data = self._convert(data)
-        if self._sampwidth in (2, 4) and sys.byteorder == 'big':
-            import array
-            a = array.array(_array_fmts[self._sampwidth])
-            a.frombytes(data)
-            data = a
-            assert data.itemsize == self._sampwidth
-            data.byteswap()
-            data.tofile(self._file)
-            self._datawritten = self._datawritten + len(data) * self._sampwidth
-        else:
-            if self._sampwidth == 3 and sys.byteorder == 'big':
-                data = _byteswap3(data)
-            self._file.write(data)
-            self._datawritten = self._datawritten + len(data)
+        if self._sampwidth != 1 and sys.byteorder == 'big':
+            data = audioop.byteswap(data, self._sampwidth)
+        self._file.write(data)
+        self._datawritten += len(data)
         self._nframeswritten = self._nframeswritten + nframes
 
     def writeframes(self, data):
@@ -476,14 +460,18 @@
         if not self._nframes:
             self._nframes = initlength // (self._nchannels * self._sampwidth)
         self._datalength = self._nframes * self._nchannels * self._sampwidth
-        self._form_length_pos = self._file.tell()
+        try:
+            self._form_length_pos = self._file.tell()
+        except (AttributeError, OSError):
+            self._form_length_pos = None
         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()
+        if self._form_length_pos is not None:
+            self._data_length_pos = self._file.tell()
         self._file.write(struct.pack('<L', self._datalength))
         self._headerwritten = True
 
diff --git a/Lib/weakref.py b/Lib/weakref.py
index fcb6b74..12bf975 100644
--- a/Lib/weakref.py
+++ b/Lib/weakref.py
@@ -21,13 +21,69 @@
 from _weakrefset import WeakSet, _IterationGuard
 
 import collections  # Import after _weakref to avoid circular import.
+import sys
+import itertools
 
 ProxyTypes = (ProxyType, CallableProxyType)
 
 __all__ = ["ref", "proxy", "getweakrefcount", "getweakrefs",
            "WeakKeyDictionary", "ReferenceType", "ProxyType",
            "CallableProxyType", "ProxyTypes", "WeakValueDictionary",
-           "WeakSet"]
+           "WeakSet", "WeakMethod", "finalize"]
+
+
+class WeakMethod(ref):
+    """
+    A custom `weakref.ref` subclass which simulates a weak reference to
+    a bound method, working around the lifetime problem of bound methods.
+    """
+
+    __slots__ = "_func_ref", "_meth_type", "_alive", "__weakref__"
+
+    def __new__(cls, meth, callback=None):
+        try:
+            obj = meth.__self__
+            func = meth.__func__
+        except AttributeError:
+            raise TypeError("argument should be a bound method, not {}"
+                            .format(type(meth))) from None
+        def _cb(arg):
+            # The self-weakref trick is needed to avoid creating a reference
+            # cycle.
+            self = self_wr()
+            if self._alive:
+                self._alive = False
+                if callback is not None:
+                    callback(self)
+        self = ref.__new__(cls, obj, _cb)
+        self._func_ref = ref(func, _cb)
+        self._meth_type = type(meth)
+        self._alive = True
+        self_wr = ref(self)
+        return self
+
+    def __call__(self):
+        obj = super().__call__()
+        func = self._func_ref()
+        if obj is None or func is None:
+            return None
+        return self._meth_type(func, obj)
+
+    def __eq__(self, other):
+        if isinstance(other, WeakMethod):
+            if not self._alive or not other._alive:
+                return self is other
+            return ref.__eq__(self, other) and self._func_ref == other._func_ref
+        return False
+
+    def __ne__(self, other):
+        if isinstance(other, WeakMethod):
+            if not self._alive or not other._alive:
+                return self is not other
+            return ref.__ne__(self, other) or self._func_ref != other._func_ref
+        return True
+
+    __hash__ = ref.__hash__
 
 
 class WeakValueDictionary(collections.MutableMapping):
@@ -153,8 +209,7 @@
 
         """
         with _IterationGuard(self):
-            for wr in self.data.values():
-                yield wr
+            yield from self.data.values()
 
     def values(self):
         with _IterationGuard(self):
@@ -267,6 +322,7 @@
         # A list of dead weakrefs (keys to be removed)
         self._pending_removals = []
         self._iterating = set()
+        self._dirty_len = False
         if dict is not None:
             self.update(dict)
 
@@ -283,13 +339,23 @@
             except KeyError:
                 pass
 
+    def _scrub_removals(self):
+        d = self.data
+        self._pending_removals = [k for k in self._pending_removals if k in d]
+        self._dirty_len = False
+
     def __delitem__(self, key):
+        self._dirty_len = True
         del self.data[ref(key)]
 
     def __getitem__(self, key):
         return self.data[ref(key)]
 
     def __len__(self):
+        if self._dirty_len and self._pending_removals:
+            # self._pending_removals may still contain keys which were
+            # explicitly removed, we have to scrub them (see issue #21173).
+            self._scrub_removals()
         return len(self.data) - len(self._pending_removals)
 
     def __repr__(self):
@@ -362,6 +428,7 @@
         return list(self.data)
 
     def popitem(self):
+        self._dirty_len = True
         while True:
             key, value = self.data.popitem()
             o = key()
@@ -369,6 +436,7 @@
                 return o, value
 
     def pop(self, key, *args):
+        self._dirty_len = True
         return self.data.pop(ref(key), *args)
 
     def setdefault(self, key, default=None):
@@ -383,3 +451,140 @@
                 d[ref(key, self._remove)] = value
         if len(kwargs):
             self.update(kwargs)
+
+
+class finalize:
+    """Class for finalization of weakrefable objects
+
+    finalize(obj, func, *args, **kwargs) returns a callable finalizer
+    object which will be called when obj is garbage collected. The
+    first time the finalizer is called it evaluates func(*arg, **kwargs)
+    and returns the result. After this the finalizer is dead, and
+    calling it just returns None.
+
+    When the program exits any remaining finalizers for which the
+    atexit attribute is true will be run in reverse order of creation.
+    By default atexit is true.
+    """
+
+    # Finalizer objects don't have any state of their own.  They are
+    # just used as keys to lookup _Info objects in the registry.  This
+    # ensures that they cannot be part of a ref-cycle.
+
+    __slots__ = ()
+    _registry = {}
+    _shutdown = False
+    _index_iter = itertools.count()
+    _dirty = False
+    _registered_with_atexit = False
+
+    class _Info:
+        __slots__ = ("weakref", "func", "args", "kwargs", "atexit", "index")
+
+    def __init__(self, obj, func, *args, **kwargs):
+        if not self._registered_with_atexit:
+            # We may register the exit function more than once because
+            # of a thread race, but that is harmless
+            import atexit
+            atexit.register(self._exitfunc)
+            finalize._registered_with_atexit = True
+        info = self._Info()
+        info.weakref = ref(obj, self)
+        info.func = func
+        info.args = args
+        info.kwargs = kwargs or None
+        info.atexit = True
+        info.index = next(self._index_iter)
+        self._registry[self] = info
+        finalize._dirty = True
+
+    def __call__(self, _=None):
+        """If alive then mark as dead and return func(*args, **kwargs);
+        otherwise return None"""
+        info = self._registry.pop(self, None)
+        if info and not self._shutdown:
+            return info.func(*info.args, **(info.kwargs or {}))
+
+    def detach(self):
+        """If alive then mark as dead and return (obj, func, args, kwargs);
+        otherwise return None"""
+        info = self._registry.get(self)
+        obj = info and info.weakref()
+        if obj is not None and self._registry.pop(self, None):
+            return (obj, info.func, info.args, info.kwargs or {})
+
+    def peek(self):
+        """If alive then return (obj, func, args, kwargs);
+        otherwise return None"""
+        info = self._registry.get(self)
+        obj = info and info.weakref()
+        if obj is not None:
+            return (obj, info.func, info.args, info.kwargs or {})
+
+    @property
+    def alive(self):
+        """Whether finalizer is alive"""
+        return self in self._registry
+
+    @property
+    def atexit(self):
+        """Whether finalizer should be called at exit"""
+        info = self._registry.get(self)
+        return bool(info) and info.atexit
+
+    @atexit.setter
+    def atexit(self, value):
+        info = self._registry.get(self)
+        if info:
+            info.atexit = bool(value)
+
+    def __repr__(self):
+        info = self._registry.get(self)
+        obj = info and info.weakref()
+        if obj is None:
+            return '<%s object at %#x; dead>' % (type(self).__name__, id(self))
+        else:
+            return '<%s object at %#x; for %r at %#x>' % \
+                (type(self).__name__, id(self), type(obj).__name__, id(obj))
+
+    @classmethod
+    def _select_for_exit(cls):
+        # Return live finalizers marked for exit, oldest first
+        L = [(f,i) for (f,i) in cls._registry.items() if i.atexit]
+        L.sort(key=lambda item:item[1].index)
+        return [f for (f,i) in L]
+
+    @classmethod
+    def _exitfunc(cls):
+        # At shutdown invoke finalizers for which atexit is true.
+        # This is called once all other non-daemonic threads have been
+        # joined.
+        reenable_gc = False
+        try:
+            if cls._registry:
+                import gc
+                if gc.isenabled():
+                    reenable_gc = True
+                    gc.disable()
+                pending = None
+                while True:
+                    if pending is None or finalize._dirty:
+                        pending = cls._select_for_exit()
+                        finalize._dirty = False
+                    if not pending:
+                        break
+                    f = pending.pop()
+                    try:
+                        # gc is disabled, so (assuming no daemonic
+                        # threads) the following is the only line in
+                        # this function which might trigger creation
+                        # of a new finalizer
+                        f()
+                    except Exception:
+                        sys.excepthook(*sys.exc_info())
+                    assert f not in cls._registry
+        finally:
+            # prevent any more finalizers from executing during shutdown
+            finalize._shutdown = True
+            if reenable_gc:
+                gc.enable()
diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py
index 945eda4..845f1d0 100755
--- a/Lib/webbrowser.py
+++ b/Lib/webbrowser.py
@@ -2,13 +2,11 @@
 """Interfaces for launching and remotely controlling Web browsers."""
 # Maintained by Georg Brandl.
 
-import io
 import os
 import shlex
+import shutil
 import sys
-import stat
 import subprocess
-import time
 
 __all__ = ["Error", "open", "open_new", "open_new_tab", "get", "register"]
 
@@ -83,7 +81,7 @@
 
     """
     cmd = browser.split()[0]
-    if not _iscommand(cmd):
+    if not shutil.which(cmd):
         return [None, None]
     name = os.path.basename(cmd)
     try:
@@ -102,38 +100,6 @@
     return [None, None]
 
 
-if sys.platform[:3] == "win":
-    def _isexecutable(cmd):
-        cmd = cmd.lower()
-        if os.path.isfile(cmd) and cmd.endswith((".exe", ".bat")):
-            return True
-        for ext in ".exe", ".bat":
-            if os.path.isfile(cmd + ext):
-                return True
-        return False
-else:
-    def _isexecutable(cmd):
-        if os.path.isfile(cmd):
-            mode = os.stat(cmd)[stat.ST_MODE]
-            if mode & stat.S_IXUSR or mode & stat.S_IXGRP or mode & stat.S_IXOTH:
-                return True
-        return False
-
-def _iscommand(cmd):
-    """Return True if cmd is executable or can be found on the executable
-    search path."""
-    if _isexecutable(cmd):
-        return True
-    path = os.environ.get("PATH")
-    if not path:
-        return False
-    for d in path.split(os.pathsep):
-        exe = os.path.join(d, cmd)
-        if _isexecutable(exe):
-            return True
-    return False
-
-
 # General parent classes
 
 class BaseBrowser(object):
@@ -193,10 +159,8 @@
             if sys.platform[:3] == 'win':
                 p = subprocess.Popen(cmdline)
             else:
-                setsid = getattr(os, 'setsid', None)
-                if not setsid:
-                    setsid = getattr(os, 'setpgrp', None)
-                p = subprocess.Popen(cmdline, close_fds=True, preexec_fn=setsid)
+                p = subprocess.Popen(cmdline, close_fds=True,
+                                     start_new_session=True)
             return (p.poll() is None)
         except OSError:
             return False
@@ -355,11 +319,6 @@
             action = "openURL"
 
         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)
-        if not setsid:
-            setsid = getattr(os, 'setpgrp', None)
 
         try:
             p = subprocess.Popen(["kfmclient", action, url],
@@ -377,7 +336,7 @@
             p = subprocess.Popen(["konqueror", "--silent", url],
                                  close_fds=True, stdin=devnull,
                                  stdout=devnull, stderr=devnull,
-                                 preexec_fn=setsid)
+                                 start_new_session=True)
         except OSError:
             # fall through to next variant
             pass
@@ -390,7 +349,7 @@
             p = subprocess.Popen(["kfm", "-d", url],
                                  close_fds=True, stdin=devnull,
                                  stdout=devnull, stderr=devnull,
-                                 preexec_fn=setsid)
+                                 start_new_session=True)
         except OSError:
             return False
         else:
@@ -418,11 +377,11 @@
             # need to PING each one until we find one that's live
             try:
                 s.connect(fn)
-            except socket.error:
+            except OSError:
                 # no good; attempt to clean it out, but don't fail:
                 try:
                     os.unlink(fn)
-                except IOError:
+                except OSError:
                     pass
             else:
                 return s
@@ -453,22 +412,22 @@
 def register_X_browsers():
 
     # use xdg-open if around
-    if _iscommand("xdg-open"):
+    if shutil.which("xdg-open"):
         register("xdg-open", None, BackgroundBrowser("xdg-open"))
 
     # The default GNOME3 browser
-    if "GNOME_DESKTOP_SESSION_ID" in os.environ and _iscommand("gvfs-open"):
+    if "GNOME_DESKTOP_SESSION_ID" in os.environ and shutil.which("gvfs-open"):
         register("gvfs-open", None, BackgroundBrowser("gvfs-open"))
 
     # The default GNOME browser
-    if "GNOME_DESKTOP_SESSION_ID" in os.environ and _iscommand("gnome-open"):
+    if "GNOME_DESKTOP_SESSION_ID" in os.environ and shutil.which("gnome-open"):
         register("gnome-open", None, BackgroundBrowser("gnome-open"))
 
     # The default KDE browser
-    if "KDE_FULL_SESSION" in os.environ and _iscommand("kfmclient"):
+    if "KDE_FULL_SESSION" in os.environ and shutil.which("kfmclient"):
         register("kfmclient", Konqueror, Konqueror("kfmclient"))
 
-    if _iscommand("x-www-browser"):
+    if shutil.which("x-www-browser"):
         register("x-www-browser", None, BackgroundBrowser("x-www-browser"))
 
     # The Mozilla/Netscape browsers
@@ -476,39 +435,39 @@
                     "mozilla-firebird", "firebird",
                     "iceweasel", "iceape",
                     "seamonkey", "mozilla", "netscape"):
-        if _iscommand(browser):
+        if shutil.which(browser):
             register(browser, None, Mozilla(browser))
 
     # Konqueror/kfm, the KDE browser.
-    if _iscommand("kfm"):
+    if shutil.which("kfm"):
         register("kfm", Konqueror, Konqueror("kfm"))
-    elif _iscommand("konqueror"):
+    elif shutil.which("konqueror"):
         register("konqueror", Konqueror, Konqueror("konqueror"))
 
     # Gnome's Galeon and Epiphany
     for browser in ("galeon", "epiphany"):
-        if _iscommand(browser):
+        if shutil.which(browser):
             register(browser, None, Galeon(browser))
 
     # Skipstone, another Gtk/Mozilla based browser
-    if _iscommand("skipstone"):
+    if shutil.which("skipstone"):
         register("skipstone", None, BackgroundBrowser("skipstone"))
 
     # Google Chrome/Chromium browsers
     for browser in ("google-chrome", "chrome", "chromium", "chromium-browser"):
-        if _iscommand(browser):
+        if shutil.which(browser):
             register(browser, None, Chrome(browser))
 
     # Opera, quite popular
-    if _iscommand("opera"):
+    if shutil.which("opera"):
         register("opera", None, Opera("opera"))
 
     # Next, Mosaic -- old but still in use.
-    if _iscommand("mosaic"):
+    if shutil.which("mosaic"):
         register("mosaic", None, BackgroundBrowser("mosaic"))
 
     # Grail, the Python browser. Does anybody still use it?
-    if _iscommand("grail"):
+    if shutil.which("grail"):
         register("grail", Grail, None)
 
 # Prefer X browsers if present
@@ -517,18 +476,18 @@
 
 # Also try console browsers
 if os.environ.get("TERM"):
-    if _iscommand("www-browser"):
+    if shutil.which("www-browser"):
         register("www-browser", None, GenericBrowser("www-browser"))
     # The Links/elinks browsers <http://artax.karlin.mff.cuni.cz/~mikulas/links/>
-    if _iscommand("links"):
+    if shutil.which("links"):
         register("links", None, GenericBrowser("links"))
-    if _iscommand("elinks"):
+    if shutil.which("elinks"):
         register("elinks", None, Elinks("elinks"))
     # The Lynx browser <http://lynx.isc.org/>, <http://lynx.browser.org/>
-    if _iscommand("lynx"):
+    if shutil.which("lynx"):
         register("lynx", None, GenericBrowser("lynx"))
     # The w3m browser <http://w3m.sourceforge.net/>
-    if _iscommand("w3m"):
+    if shutil.which("w3m"):
         register("w3m", None, GenericBrowser("w3m"))
 
 #
@@ -540,7 +499,7 @@
         def open(self, url, new=0, autoraise=True):
             try:
                 os.startfile(url)
-            except WindowsError:
+            except OSError:
                 # [Error 22] No application is associated with the specified
                 # file for this operation: '<URL>'
                 return False
@@ -558,7 +517,7 @@
                             "Internet Explorer\\IEXPLORE.EXE")
     for browser in ("firefox", "firebird", "seamonkey", "mozilla",
                     "netscape", "opera", iexplore):
-        if _iscommand(browser):
+        if shutil.which(browser):
             register(browser, None, BackgroundBrowser(browser))
 
 #
@@ -644,17 +603,6 @@
     register("MacOSX", None, MacOSXOSAScript('default'), -1)
 
 
-#
-# Platform support for OS/2
-#
-
-if sys.platform[:3] == "os2" and _iscommand("netscape"):
-    _tryorder = []
-    _browsers = {}
-    register("os2netscape", None,
-             GenericBrowser(["start", "netscape", "%s"]), -1)
-
-
 # OK, now that we know what the default preference orders for each
 # platform are, allow user to override them with the BROWSER variable.
 if "BROWSER" in os.environ:
diff --git a/Lib/wsgiref/__init__.py b/Lib/wsgiref/__init__.py
index 46c579f..1efbba0 100644
--- a/Lib/wsgiref/__init__.py
+++ b/Lib/wsgiref/__init__.py
@@ -1,4 +1,4 @@
-"""wsgiref -- a WSGI (PEP 333) Reference Library
+"""wsgiref -- a WSGI (PEP 3333) Reference Library
 
 Current Contents:
 
diff --git a/Lib/xdrlib.py b/Lib/xdrlib.py
index c05cf87..d6e1aeb 100644
--- a/Lib/xdrlib.py
+++ b/Lib/xdrlib.py
@@ -6,6 +6,7 @@
 
 import struct
 from io import BytesIO
+from functools import wraps
 
 __all__ = ["Error", "Packer", "Unpacker", "ConversionError"]
 
@@ -31,6 +32,16 @@
 class ConversionError(Error):
     pass
 
+def raise_conversion_error(function):
+    """ Wrap any raised struct.errors in a ConversionError. """
+
+    @wraps(function)
+    def result(self, value):
+        try:
+            return function(self, value)
+        except struct.error as e:
+            raise ConversionError(e.args[0]) from None
+    return result
 
 
 class Packer:
@@ -47,9 +58,11 @@
     # backwards compatibility
     get_buf = get_buffer
 
+    @raise_conversion_error
     def pack_uint(self, x):
         self.__buf.write(struct.pack('>L', x))
 
+    @raise_conversion_error
     def pack_int(self, x):
         self.__buf.write(struct.pack('>l', x))
 
@@ -60,20 +73,24 @@
         else: self.__buf.write(b'\0\0\0\0')
 
     def pack_uhyper(self, x):
-        self.pack_uint(x>>32 & 0xffffffff)
-        self.pack_uint(x & 0xffffffff)
+        try:
+            self.pack_uint(x>>32 & 0xffffffff)
+        except (TypeError, struct.error) as e:
+            raise ConversionError(e.args[0]) from None
+        try:
+            self.pack_uint(x & 0xffffffff)
+        except (TypeError, struct.error) as e:
+            raise ConversionError(e.args[0]) from None
 
     pack_hyper = pack_uhyper
 
+    @raise_conversion_error
     def pack_float(self, x):
-        try: self.__buf.write(struct.pack('>f', x))
-        except struct.error as msg:
-            raise ConversionError(msg)
+        self.__buf.write(struct.pack('>f', x))
 
+    @raise_conversion_error
     def pack_double(self, x):
-        try: self.__buf.write(struct.pack('>d', x))
-        except struct.error as msg:
-            raise ConversionError(msg)
+        self.__buf.write(struct.pack('>d', x))
 
     def pack_fstring(self, n, s):
         if n < 0:
diff --git a/Lib/xml/dom/expatbuilder.py b/Lib/xml/dom/expatbuilder.py
index f074ab9..8976144 100644
--- a/Lib/xml/dom/expatbuilder.py
+++ b/Lib/xml/dom/expatbuilder.py
@@ -121,10 +121,12 @@
         qname = "%s:%s" % (prefix, localname)
         qname = intern(qname, qname)
         localname = intern(localname, localname)
-    else:
+    elif len(parts) == 2:
         uri, localname = parts
         prefix = EMPTY_PREFIX
         qname = localname = intern(localname, localname)
+    else:
+        raise ValueError("Unsupported syntax: spaces in URIs not supported: %r" % name)
     return intern(uri, uri), localname, prefix, qname
 
 
@@ -905,11 +907,8 @@
         builder = ExpatBuilder()
 
     if isinstance(file, str):
-        fp = open(file, 'rb')
-        try:
+        with open(file, 'rb') as fp:
             result = builder.parseFile(fp)
-        finally:
-            fp.close()
     else:
         result = builder.parseFile(file)
     return result
@@ -939,11 +938,8 @@
         builder = FragmentBuilder(context)
 
     if isinstance(file, str):
-        fp = open(file, 'rb')
-        try:
+        with open(file, 'rb') as fp:
             result = builder.parseFile(fp)
-        finally:
-            fp.close()
     else:
         result = builder.parseFile(file)
     return result
diff --git a/Lib/xml/dom/minidom.py b/Lib/xml/dom/minidom.py
index 6f71631..c379a33 100644
--- a/Lib/xml/dom/minidom.py
+++ b/Lib/xml/dom/minidom.py
@@ -976,7 +976,7 @@
     def _get_nodeValue(self):
         return self.data
     def _set_nodeValue(self, value):
-        self.data = data
+        self.data = value
     nodeValue = property(_get_nodeValue, _set_nodeValue)
 
     # nodeName is an alias for target
diff --git a/Lib/xml/etree/ElementInclude.py b/Lib/xml/etree/ElementInclude.py
index 71eeb05..963470e 100644
--- a/Lib/xml/etree/ElementInclude.py
+++ b/Lib/xml/etree/ElementInclude.py
@@ -71,8 +71,8 @@
 # @return The expanded resource.  If the parse mode is "xml", this
 #    is an ElementTree instance.  If the parse mode is "text", this
 #    is a Unicode string.  If the loader fails, it can return None
-#    or raise an IOError exception.
-# @throws IOError If the loader fails to load the resource.
+#    or raise an OSError exception.
+# @throws OSError If the loader fails to load the resource.
 
 def default_loader(href, parse, encoding=None):
     if parse == "xml":
@@ -94,7 +94,7 @@
 #     that implements the same interface as <b>default_loader</b>.
 # @throws FatalIncludeError If the function fails to include a given
 #     resource, or if the tree contains malformed XInclude elements.
-# @throws IOError If the function fails to load a given resource.
+# @throws OSError If the function fails to load a given resource.
 
 def include(elem, loader=None):
     if loader is None:
diff --git a/Lib/xml/etree/ElementPath.py b/Lib/xml/etree/ElementPath.py
index e7015c7..d914ddb 100644
--- a/Lib/xml/etree/ElementPath.py
+++ b/Lib/xml/etree/ElementPath.py
@@ -105,14 +105,12 @@
 def prepare_star(next, token):
     def select(context, result):
         for elem in result:
-            for e in elem:
-                yield e
+            yield from elem
     return select
 
 def prepare_self(next, token):
     def select(context, result):
-        for elem in result:
-            yield elem
+        yield from result
     return select
 
 def prepare_descendant(next, token):
@@ -176,7 +174,7 @@
                 if elem.get(key) == value:
                     yield elem
         return select
-    if signature == "-" and not re.match("\d+$", predicate[0]):
+    if signature == "-" and not re.match("\-?\d+$", predicate[0]):
         # [tag]
         tag = predicate[0]
         def select(context, result):
@@ -184,7 +182,7 @@
                 if elem.find(tag) is not None:
                     yield elem
         return select
-    if signature == "-='" and not re.match("\d+$", predicate[0]):
+    if signature == "-='" and not re.match("\-?\d+$", predicate[0]):
         # [tag='value']
         tag = predicate[0]
         value = predicate[-1]
@@ -198,7 +196,10 @@
     if signature == "-" or signature == "-()" or signature == "-()-":
         # [index] or [last()] or [last()-index]
         if signature == "-":
+            # [index]
             index = int(predicate[0]) - 1
+            if index < 0:
+                raise SyntaxError("XPath position >= 1 expected")
         else:
             if predicate[0] != "last":
                 raise SyntaxError("unsupported function")
@@ -207,6 +208,8 @@
                     index = int(predicate[2]) - 1
                 except ValueError:
                     raise SyntaxError("unsupported expression")
+                if index > -2:
+                    raise SyntaxError("XPath offset from last() must be negative")
             else:
                 index = -1
         def select(context, result):
diff --git a/Lib/xml/etree/ElementTree.py b/Lib/xml/etree/ElementTree.py
index a8e5729..a8585b6 100644
--- a/Lib/xml/etree/ElementTree.py
+++ b/Lib/xml/etree/ElementTree.py
@@ -1,28 +1,47 @@
+"""Lightweight XML support for Python.
+
+ XML is an inherently hierarchical data format, and the most natural way to
+ represent it is with a tree.  This module has two classes for this purpose:
+
+    1. ElementTree represents the whole XML document as a tree and
+
+    2. Element represents a single node in this tree.
+
+ Interactions with the whole document (reading and writing to/from files) are
+ usually done on the ElementTree level.  Interactions with a single XML element
+ and its sub-elements are done on the Element level.
+
+ Element is a flexible container object designed to store hierarchical data
+ structures in memory. It can be described as a cross between a list and a
+ dictionary.  Each Element has a number of properties associated with it:
+
+    'tag' - a string containing the element's name.
+
+    'attributes' - a Python dictionary storing the element's attributes.
+
+    'text' - a string containing the element's text content.
+
+    'tail' - an optional string containing text after the element's end tag.
+
+    And a number of child elements stored in a Python sequence.
+
+ To create an element instance, use the Element constructor,
+ or the SubElement factory function.
+
+ You can also use the ElementTree class to wrap an element structure
+ and convert it to and from XML.
+
+"""
+
+#---------------------------------------------------------------------
+# Licensed to PSF under a Contributor Agreement.
+# See http://www.python.org/psf/license for licensing details.
 #
 # ElementTree
-# $Id: ElementTree.py 3440 2008-07-18 14:45:01Z fredrik $
-#
-# light-weight XML support for Python 2.3 and later.
-#
-# history (since 1.2.6):
-# 2005-11-12 fl   added tostringlist/fromstringlist helpers
-# 2006-07-05 fl   merged in selected changes from the 1.3 sandbox
-# 2006-07-05 fl   removed support for 2.1 and earlier
-# 2007-06-21 fl   added deprecation/future warnings
-# 2007-08-25 fl   added doctype hook, added parser version attribute etc
-# 2007-08-26 fl   added new serializer code (better namespace handling, etc)
-# 2007-08-27 fl   warn for broken /tag searches on tree level
-# 2007-09-02 fl   added html/text methods to serializer (experimental)
-# 2007-09-05 fl   added method argument to tostring/tostringlist
-# 2007-09-06 fl   improved error handling
-# 2007-09-13 fl   added itertext, iterfind; assorted cleanups
-# 2007-12-15 fl   added C14N hooks, copy method (experimental)
-#
 # Copyright (c) 1999-2008 by Fredrik Lundh.  All rights reserved.
 #
 # fredrik@pythonware.com
 # http://www.pythonware.com
-#
 # --------------------------------------------------------------------
 # The ElementTree toolkit is
 #
@@ -51,9 +70,6 @@
 # OF THIS SOFTWARE.
 # --------------------------------------------------------------------
 
-# Licensed to PSF under a Contributor Agreement.
-# See http://www.python.org/psf/license for licensing details.
-
 __all__ = [
     # public symbols
     "Comment",
@@ -69,34 +85,12 @@
     "TreeBuilder",
     "VERSION",
     "XML", "XMLID",
-    "XMLParser", "XMLTreeBuilder",
+    "XMLParser",
     "register_namespace",
     ]
 
 VERSION = "1.3.0"
 
-##
-# The <b>Element</b> type is a flexible container object, designed to
-# store hierarchical data structures in memory. The type can be
-# described as a cross between a list and a dictionary.
-# <p>
-# Each element has a number of properties associated with it:
-# <ul>
-# <li>a <i>tag</i>. This is a string identifying what kind of data
-# this element represents (the element type, in other words).</li>
-# <li>a number of <i>attributes</i>, stored in a Python dictionary.</li>
-# <li>a <i>text</i> string.</li>
-# <li>an optional <i>tail</i> string.</li>
-# <li>a number of <i>child elements</i>, stored in a Python sequence</li>
-# </ul>
-#
-# To create an element instance, use the {@link #Element} constructor
-# or the {@link #SubElement} factory function.
-# <p>
-# The {@link #ElementTree} class can be used to wrap an element
-# structure, and convert it from and to XML.
-##
-
 import sys
 import re
 import warnings
@@ -106,81 +100,68 @@
 from . import ElementPath
 
 
-##
-# Parser error.  This is a subclass of <b>SyntaxError</b>.
-# <p>
-# In addition to the exception value, an exception instance contains a
-# specific exception code in the <b>code</b> attribute, and the line and
-# column of the error in the <b>position</b> attribute.
-
 class ParseError(SyntaxError):
+    """An error when parsing an XML document.
+
+    In addition to its exception value, a ParseError contains
+    two extra attributes:
+        'code'     - the specific exception code
+        'position' - the line and column of the error
+
+    """
     pass
 
 # --------------------------------------------------------------------
 
-##
-# Checks if an object appears to be a valid element object.
-#
-# @param An element instance.
-# @return A true value if this is an element object.
-# @defreturn flag
 
 def iselement(element):
-    # FIXME: not sure about this;
-    # isinstance(element, Element) or look for tag/attrib/text attributes
+    """Return True if *element* appears to be an Element."""
     return hasattr(element, 'tag')
 
-##
-# Element class.  This class defines the Element interface, and
-# provides a reference implementation of this interface.
-# <p>
-# The element name, attribute names, and attribute values can be
-# either ASCII strings (ordinary Python strings containing only 7-bit
-# ASCII characters) or Unicode strings.
-#
-# @param tag The element name.
-# @param attrib An optional dictionary, containing element attributes.
-# @param **extra Additional attributes, given as keyword arguments.
-# @see Element
-# @see SubElement
-# @see Comment
-# @see ProcessingInstruction
 
 class Element:
-    # <tag attrib>text<child/>...</tag>tail
+    """An XML element.
 
-    ##
-    # (Attribute) Element tag.
+    This class is the reference implementation of the Element interface.
+
+    An element's length is its number of subelements.  That means if you
+    want to check if an element is truly empty, you should check BOTH
+    its length AND its text attribute.
+
+    The element tag, attribute names, and attribute values can be either
+    bytes or strings.
+
+    *tag* is the element name.  *attrib* is an optional dictionary containing
+    element attributes. *extra* are additional element attributes given as
+    keyword arguments.
+
+    Example form:
+        <tag attrib>text<child/>...</tag>tail
+
+    """
 
     tag = None
-
-    ##
-    # (Attribute) Element attribute dictionary.  Where possible, use
-    # {@link #Element.get},
-    # {@link #Element.set},
-    # {@link #Element.keys}, and
-    # {@link #Element.items} to access
-    # element attributes.
+    """The element's name."""
 
     attrib = None
-
-    ##
-    # (Attribute) Text before first subelement.  This is either a
-    # string or the value None.  Note that if there was no text, this
-    # attribute may be either None or an empty string, depending on
-    # the parser.
+    """Dictionary of the element's attributes."""
 
     text = None
+    """
+    Text before first subelement. This is either a string or the value None.
+    Note that if there is no text, this attribute may be either
+    None or the empty string, depending on the parser.
 
-    ##
-    # (Attribute) Text after this element's end tag, but before the
-    # next sibling element's start tag.  This is either a string or
-    # the value None.  Note that if there was no text, this attribute
-    # may be either None or an empty string, depending on the parser.
+    """
 
-    tail = None # text after end tag, if any
+    tail = None
+    """
+    Text after this element's end tag, but before the next sibling element's
+    start tag.  This is either a string or the value None.  Note that if there
+    was no text, this attribute may be either None or an empty string,
+    depending on the parser.
 
-    # constructor
+    """
 
     def __init__(self, tag, attrib={}, **extra):
         if not isinstance(attrib, dict):
@@ -195,36 +176,30 @@
     def __repr__(self):
         return "<Element %s at 0x%x>" % (repr(self.tag), id(self))
 
-    ##
-    # Creates a new element object of the same type as this element.
-    #
-    # @param tag Element tag.
-    # @param attrib Element attributes, given as a dictionary.
-    # @return A new element instance.
-
     def makeelement(self, tag, attrib):
+        """Create a new element with the same type.
+
+        *tag* is a string containing the element name.
+        *attrib* is a dictionary containing the element attributes.
+
+        Do not call this method, use the SubElement factory function instead.
+
+        """
         return self.__class__(tag, attrib)
 
-    ##
-    # (Experimental) Copies the current element.  This creates a
-    # shallow copy; subelements will be shared with the original tree.
-    #
-    # @return A new element instance.
-
     def copy(self):
+        """Return copy of current element.
+
+        This creates a shallow copy. Subelements will be shared with the
+        original tree.
+
+        """
         elem = self.makeelement(self.tag, self.attrib)
         elem.text = self.text
         elem.tail = self.tail
         elem[:] = self
         return elem
 
-    ##
-    # Returns the number of subelements.  Note that this only counts
-    # full elements; to check if there's any content in an element, you
-    # have to check both the length and the <b>text</b> attribute.
-    #
-    # @return The number of subelements.
-
     def __len__(self):
         return len(self._children)
 
@@ -236,23 +211,9 @@
             )
         return len(self._children) != 0 # emulate old behaviour, for now
 
-    ##
-    # Returns the given subelement, by index.
-    #
-    # @param index What subelement to return.
-    # @return The given subelement.
-    # @exception IndexError If the given element does not exist.
-
     def __getitem__(self, index):
         return self._children[index]
 
-    ##
-    # Replaces the given subelement, by index.
-    #
-    # @param index What subelement to replace.
-    # @param element The new element value.
-    # @exception IndexError If the given element does not exist.
-
     def __setitem__(self, index, element):
         # if isinstance(index, slice):
         #     for elt in element:
@@ -261,76 +222,62 @@
         #     assert iselement(element)
         self._children[index] = element
 
-    ##
-    # Deletes the given subelement, by index.
-    #
-    # @param index What subelement to delete.
-    # @exception IndexError If the given element does not exist.
-
     def __delitem__(self, index):
         del self._children[index]
 
-    ##
-    # Adds a subelement to the end of this element.  In document order,
-    # the new element will appear after the last existing subelement (or
-    # directly after the text, if it's the first subelement), but before
-    # the end tag for this element.
-    #
-    # @param element The element to add.
+    def append(self, subelement):
+        """Add *subelement* to the end of this element.
 
-    def append(self, element):
-        self._assert_is_element(element)
-        self._children.append(element)
+        The new element will appear in document order after the last existing
+        subelement (or directly after the text, if it's the first subelement),
+        but before the end tag for this element.
 
-    ##
-    # Appends subelements from a sequence.
-    #
-    # @param elements A sequence object with zero or more elements.
-    # @since 1.3
+        """
+        self._assert_is_element(subelement)
+        self._children.append(subelement)
 
     def extend(self, elements):
+        """Append subelements from a sequence.
+
+        *elements* is a sequence with zero or more elements.
+
+        """
         for element in elements:
             self._assert_is_element(element)
         self._children.extend(elements)
 
-    ##
-    # Inserts a subelement at the given position in this element.
-    #
-    # @param index Where to insert the new subelement.
-
-    def insert(self, index, element):
-        self._assert_is_element(element)
-        self._children.insert(index, element)
+    def insert(self, index, subelement):
+        """Insert *subelement* at position *index*."""
+        self._assert_is_element(subelement)
+        self._children.insert(index, subelement)
 
     def _assert_is_element(self, e):
         # Need to refer to the actual Python implementation, not the
         # shadowing C implementation.
-        if not isinstance(e, _Element):
+        if not isinstance(e, _Element_Py):
             raise TypeError('expected an Element, not %s' % type(e).__name__)
 
-    ##
-    # Removes a matching subelement.  Unlike the <b>find</b> methods,
-    # this method compares elements based on identity, not on tag
-    # value or contents.  To remove subelements by other means, the
-    # easiest way is often to use a list comprehension to select what
-    # elements to keep, and use slice assignment to update the parent
-    # element.
-    #
-    # @param element What element to remove.
-    # @exception ValueError If a matching element could not be found.
+    def remove(self, subelement):
+        """Remove matching subelement.
 
-    def remove(self, element):
+        Unlike the find methods, this method compares elements based on
+        identity, NOT ON tag value or contents.  To remove subelements by
+        other means, the easiest way is to use a list comprehension to
+        select what elements to keep, and then use slice assignment to update
+        the parent element.
+
+        ValueError is raised if a matching element could not be found.
+
+        """
         # assert iselement(element)
-        self._children.remove(element)
-
-    ##
-    # (Deprecated) Returns all subelements.  The elements are returned
-    # in document order.
-    #
-    # @return A list of subelements.
-    # @defreturn list of Element instances
+        self._children.remove(subelement)
 
     def getchildren(self):
+        """(Deprecated) Return all subelements.
+
+        Elements are returned in document order.
+
+        """
         warnings.warn(
             "This method will be removed in future versions.  "
             "Use 'list(elem)' or iteration over elem instead.",
@@ -338,131 +285,128 @@
             )
         return self._children
 
-    ##
-    # Finds the first matching subelement, by tag name or path.
-    #
-    # @param path What element to look for.
-    # @keyparam namespaces Optional namespace prefix map.
-    # @return The first matching element, or None if no element was found.
-    # @defreturn Element or None
-
     def find(self, path, namespaces=None):
+        """Find first matching element by tag name or path.
+
+        *path* is a string having either an element tag or an XPath,
+        *namespaces* is an optional mapping from namespace prefix to full name.
+
+        Return the first matching element, or None if no element was found.
+
+        """
         return ElementPath.find(self, path, namespaces)
 
-    ##
-    # Finds text for the first matching subelement, by tag name or path.
-    #
-    # @param path What element to look for.
-    # @param default What to return if the element was not found.
-    # @keyparam namespaces Optional namespace prefix map.
-    # @return The text content of the first matching element, or the
-    #     default value no element was found.  Note that if the element
-    #     is found, but has no text content, this method returns an
-    #     empty string.
-    # @defreturn string
-
     def findtext(self, path, default=None, namespaces=None):
+        """Find text for first matching element by tag name or path.
+
+        *path* is a string having either an element tag or an XPath,
+        *default* is the value to return if the element was not found,
+        *namespaces* is an optional mapping from namespace prefix to full name.
+
+        Return text content of first matching element, or default value if
+        none was found.  Note that if an element is found having no text
+        content, the empty string is returned.
+
+        """
         return ElementPath.findtext(self, path, default, namespaces)
 
-    ##
-    # Finds all matching subelements, by tag name or path.
-    #
-    # @param path What element to look for.
-    # @keyparam namespaces Optional namespace prefix map.
-    # @return A list or other sequence containing all matching elements,
-    #    in document order.
-    # @defreturn list of Element instances
-
     def findall(self, path, namespaces=None):
+        """Find all matching subelements by tag name or path.
+
+        *path* is a string having either an element tag or an XPath,
+        *namespaces* is an optional mapping from namespace prefix to full name.
+
+        Returns list containing all matching elements in document order.
+
+        """
         return ElementPath.findall(self, path, namespaces)
 
-    ##
-    # Finds all matching subelements, by tag name or path.
-    #
-    # @param path What element to look for.
-    # @keyparam namespaces Optional namespace prefix map.
-    # @return An iterator or sequence containing all matching elements,
-    #    in document order.
-    # @defreturn a generated sequence of Element instances
-
     def iterfind(self, path, namespaces=None):
+        """Find all matching subelements by tag name or path.
+
+        *path* is a string having either an element tag or an XPath,
+        *namespaces* is an optional mapping from namespace prefix to full name.
+
+        Return an iterable yielding all matching elements in document order.
+
+        """
         return ElementPath.iterfind(self, path, namespaces)
 
-    ##
-    # Resets an element.  This function removes all subelements, clears
-    # all attributes, and sets the <b>text</b> and <b>tail</b> attributes
-    # to None.
-
     def clear(self):
+        """Reset element.
+
+        This function removes all subelements, clears all attributes, and sets
+        the text and tail attributes to None.
+
+        """
         self.attrib.clear()
         self._children = []
         self.text = self.tail = None
 
-    ##
-    # Gets an element attribute.  Equivalent to <b>attrib.get</b>, but
-    # some implementations may handle this a bit more efficiently.
-    #
-    # @param key What attribute to look for.
-    # @param default What to return if the attribute was not found.
-    # @return The attribute value, or the default value, if the
-    #     attribute was not found.
-    # @defreturn string or None
-
     def get(self, key, default=None):
+        """Get element attribute.
+
+        Equivalent to attrib.get, but some implementations may handle this a
+        bit more efficiently.  *key* is what attribute to look for, and
+        *default* is what to return if the attribute was not found.
+
+        Returns a string containing the attribute value, or the default if
+        attribute was not found.
+
+        """
         return self.attrib.get(key, default)
 
-    ##
-    # Sets an element attribute.  Equivalent to <b>attrib[key] = value</b>,
-    # but some implementations may handle this a bit more efficiently.
-    #
-    # @param key What attribute to set.
-    # @param value The attribute value.
-
     def set(self, key, value):
+        """Set element attribute.
+
+        Equivalent to attrib[key] = value, but some implementations may handle
+        this a bit more efficiently.  *key* is what attribute to set, and
+        *value* is the attribute value to set it to.
+
+        """
         self.attrib[key] = value
 
-    ##
-    # Gets a list of attribute names.  The names are returned in an
-    # arbitrary order (just like for an ordinary Python dictionary).
-    # Equivalent to <b>attrib.keys()</b>.
-    #
-    # @return A list of element attribute names.
-    # @defreturn list of strings
-
     def keys(self):
+        """Get list of attribute names.
+
+        Names are returned in an arbitrary order, just like an ordinary
+        Python dict.  Equivalent to attrib.keys()
+
+        """
         return self.attrib.keys()
 
-    ##
-    # Gets element attributes, as a sequence.  The attributes are
-    # returned in an arbitrary order.  Equivalent to <b>attrib.items()</b>.
-    #
-    # @return A list of (name, value) tuples for all attributes.
-    # @defreturn list of (string, string) tuples
-
     def items(self):
+        """Get element attributes as a sequence.
+
+        The attributes are returned in arbitrary order.  Equivalent to
+        attrib.items().
+
+        Return a list of (name, value) tuples.
+
+        """
         return self.attrib.items()
 
-    ##
-    # Creates a tree iterator.  The iterator loops over this element
-    # and all subelements, in document order, and returns all elements
-    # with a matching tag.
-    # <p>
-    # If the tree structure is modified during iteration, new or removed
-    # elements may or may not be included.  To get a stable set, use the
-    # list() function on the iterator, and loop over the resulting list.
-    #
-    # @param tag What tags to look for (default is to return all elements).
-    # @return An iterator containing all the matching elements.
-    # @defreturn iterator
-
     def iter(self, tag=None):
+        """Create tree iterator.
+
+        The iterator loops over the element and all subelements in document
+        order, returning all elements with a matching tag.
+
+        If the tree structure is modified during iteration, new or removed
+        elements may or may not be included.  To get a stable set, use the
+        list() function on the iterator, and loop over the resulting list.
+
+        *tag* is what tags to look for (default is to return all elements)
+
+        Return an iterator containing all the matching elements.
+
+        """
         if tag == "*":
             tag = None
         if tag is None or self.tag == tag:
             yield self
         for e in self._children:
-            for e in e.iter(tag):
-                yield e
+            yield from e.iter(tag)
 
     # compatibility
     def getiterator(self, tag=None):
@@ -474,78 +418,67 @@
         )
         return list(self.iter(tag))
 
-    ##
-    # Creates a text iterator.  The iterator loops over this element
-    # and all subelements, in document order, and returns all inner
-    # text.
-    #
-    # @return An iterator containing all inner text.
-    # @defreturn iterator
-
     def itertext(self):
+        """Create text iterator.
+
+        The iterator loops over the element and all subelements in document
+        order, returning all inner text.
+
+        """
         tag = self.tag
         if not isinstance(tag, str) and tag is not None:
             return
         if self.text:
             yield self.text
         for e in self:
-            for s in e.itertext():
-                yield s
+            yield from e.itertext()
             if e.tail:
                 yield e.tail
 
-# compatibility
-_Element = _ElementInterface = Element
-
-##
-# Subelement factory.  This function creates an element instance, and
-# appends it to an existing element.
-# <p>
-# The element name, attribute names, and attribute values can be
-# either 8-bit ASCII strings or Unicode strings.
-#
-# @param parent The parent element.
-# @param tag The subelement name.
-# @param attrib An optional dictionary, containing element attributes.
-# @param **extra Additional attributes, given as keyword arguments.
-# @return An element instance.
-# @defreturn Element
 
 def SubElement(parent, tag, attrib={}, **extra):
+    """Subelement factory which creates an element instance, and appends it
+    to an existing parent.
+
+    The element tag, attribute names, and attribute values can be either
+    bytes or Unicode strings.
+
+    *parent* is the parent element, *tag* is the subelements name, *attrib* is
+    an optional directory containing element attributes, *extra* are
+    additional attributes given as keyword arguments.
+
+    """
     attrib = attrib.copy()
     attrib.update(extra)
     element = parent.makeelement(tag, attrib)
     parent.append(element)
     return element
 
-##
-# Comment element factory.  This factory function creates a special
-# element that will be serialized as an XML comment by the standard
-# serializer.
-# <p>
-# The comment string can be either an 8-bit ASCII string or a Unicode
-# string.
-#
-# @param text A string containing the comment string.
-# @return An element instance, representing a comment.
-# @defreturn Element
 
 def Comment(text=None):
+    """Comment element factory.
+
+    This function creates a special element which the standard serializer
+    serializes as an XML comment.
+
+    *text* is a string containing the comment string.
+
+    """
     element = Element(Comment)
     element.text = text
     return element
 
-##
-# PI element factory.  This factory function creates a special element
-# that will be serialized as an XML processing instruction by the standard
-# serializer.
-#
-# @param target A string containing the PI target.
-# @param text A string containing the PI contents, if any.
-# @return An element instance, representing a PI.
-# @defreturn Element
 
 def ProcessingInstruction(target, text=None):
+    """Processing Instruction element factory.
+
+    This function creates a special element which the standard serializer
+    serializes as an XML comment.
+
+    *target* is a string containing the processing instruction, *text* is a
+    string containing the processing instruction contents, if any.
+
+    """
     element = Element(ProcessingInstruction)
     element.text = target
     if text:
@@ -554,17 +487,21 @@
 
 PI = ProcessingInstruction
 
-##
-# QName wrapper.  This can be used to wrap a QName attribute value, in
-# order to get proper namespace handling on output.
-#
-# @param text A string containing the QName value, in the form {uri}local,
-#     or, if the tag argument is given, the URI part of a QName.
-# @param tag Optional tag.  If given, the first argument is interpreted as
-#     an URI, and this argument is interpreted as a local name.
-# @return An opaque object, representing the QName.
 
 class QName:
+    """Qualified name wrapper.
+
+    This class can be used to wrap a QName attribute value in order to get
+    proper namespace handing on output.
+
+    *text_or_uri* is a string containing the QName value either in the form
+    {uri}local, or if the tag argument is given, the URI part of a QName.
+
+    *tag* is an optional argument which if given, will make the first
+    argument (text_or_uri) be interpreted as a URI, and this argument (tag)
+    be interpreted as a local name.
+
+    """
     def __init__(self, text_or_uri, tag=None):
         if tag:
             text_or_uri = "{%s}%s" % (text_or_uri, tag)
@@ -602,63 +539,65 @@
 
 # --------------------------------------------------------------------
 
-##
-# ElementTree wrapper class.  This class represents an entire element
-# hierarchy, and adds some extra support for serialization to and from
-# standard XML.
-#
-# @param element Optional root element.
-# @keyparam file Optional file handle or file name.  If given, the
-#     tree is initialized with the contents of this XML file.
 
 class ElementTree:
+    """An XML element hierarchy.
 
+    This class also provides support for serialization to and from
+    standard XML.
+
+    *element* is an optional root element node,
+    *file* is an optional file handle or file name of an XML file whose
+    contents will be used to initialize the tree with.
+
+    """
     def __init__(self, element=None, file=None):
         # assert element is None or iselement(element)
         self._root = element # first node
         if file:
             self.parse(file)
 
-    ##
-    # Gets the root element for this tree.
-    #
-    # @return An element instance.
-    # @defreturn Element
-
     def getroot(self):
+        """Return root element of this tree."""
         return self._root
 
-    ##
-    # Replaces the root element for this tree.  This discards the
-    # current contents of the tree, and replaces it with the given
-    # element.  Use with care.
-    #
-    # @param element An element instance.
-
     def _setroot(self, element):
+        """Replace root element of this tree.
+
+        This will discard the current contents of the tree and replace it
+        with the given element.  Use with care!
+
+        """
         # assert iselement(element)
         self._root = element
 
-    ##
-    # Loads an external XML document into this element tree.
-    #
-    # @param source A file name or file object.  If a file object is
-    #     given, it only has to implement a <b>read(n)</b> method.
-    # @keyparam parser An optional parser instance.  If not given, the
-    #     standard {@link XMLParser} parser is used.
-    # @return The document root element.
-    # @defreturn Element
-    # @exception ParseError If the parser fails to parse the document.
-
     def parse(self, source, parser=None):
+        """Load external XML document into element tree.
+
+        *source* is a file name or file object, *parser* is an optional parser
+        instance that defaults to XMLParser.
+
+        ParseError is raised if the parser fails to parse the document.
+
+        Returns the root element of the given source document.
+
+        """
         close_source = False
         if not hasattr(source, "read"):
             source = open(source, "rb")
             close_source = True
         try:
-            if not parser:
-                parser = XMLParser(target=TreeBuilder())
-            while 1:
+            if parser is None:
+                # If no parser was specified, create a default XMLParser
+                parser = XMLParser()
+                if hasattr(parser, '_parse_whole'):
+                    # The default XMLParser, when it comes from an accelerator,
+                    # can define an internal _parse_whole API for efficiency.
+                    # It can be used to parse the whole source without feeding
+                    # it with chunks.
+                    self._root = parser._parse_whole(source)
+                    return self._root
+            while True:
                 data = source.read(65536)
                 if not data:
                     break
@@ -669,15 +608,15 @@
             if close_source:
                 source.close()
 
-    ##
-    # Creates a tree iterator for the root element.  The iterator loops
-    # over all elements in this tree, in document order.
-    #
-    # @param tag What tags to look for (default is to return all elements)
-    # @return An iterator.
-    # @defreturn iterator
-
     def iter(self, tag=None):
+        """Create and return tree iterator for the root element.
+
+        The iterator loops over all elements in this tree, in document order.
+
+        *tag* is a string with the tag name to iterate over
+        (default is to return all elements).
+
+        """
         # assert self._root is not None
         return self._root.iter(tag)
 
@@ -691,15 +630,17 @@
         )
         return list(self.iter(tag))
 
-    ##
-    # Same as getroot().find(path), starting at the root of the tree.
-    #
-    # @param path What element to look for.
-    # @keyparam namespaces Optional namespace prefix map.
-    # @return The first matching element, or None if no element was found.
-    # @defreturn Element or None
-
     def find(self, path, namespaces=None):
+        """Find first matching element by tag name or path.
+
+        Same as getroot().find(path), which is Element.find()
+
+        *path* is a string having either an element tag or an XPath,
+        *namespaces* is an optional mapping from namespace prefix to full name.
+
+        Return the first matching element, or None if no element was found.
+
+        """
         # assert self._root is not None
         if path[:1] == "/":
             path = "." + path
@@ -711,19 +652,17 @@
                 )
         return self._root.find(path, namespaces)
 
-    ##
-    # Same as getroot().findtext(path), starting at the root of the tree.
-    #
-    # @param path What element to look for.
-    # @param default What to return if the element was not found.
-    # @keyparam namespaces Optional namespace prefix map.
-    # @return The text content of the first matching element, or the
-    #     default value no element was found.  Note that if the element
-    #     is found, but has no text content, this method returns an
-    #     empty string.
-    # @defreturn string
-
     def findtext(self, path, default=None, namespaces=None):
+        """Find first matching element by tag name or path.
+
+        Same as getroot().findtext(path),  which is Element.findtext()
+
+        *path* is a string having either an element tag or an XPath,
+        *namespaces* is an optional mapping from namespace prefix to full name.
+
+        Return the first matching element, or None if no element was found.
+
+        """
         # assert self._root is not None
         if path[:1] == "/":
             path = "." + path
@@ -735,16 +674,17 @@
                 )
         return self._root.findtext(path, default, namespaces)
 
-    ##
-    # Same as getroot().findall(path), starting at the root of the tree.
-    #
-    # @param path What element to look for.
-    # @keyparam namespaces Optional namespace prefix map.
-    # @return A list or iterator containing all matching elements,
-    #    in document order.
-    # @defreturn list of Element instances
-
     def findall(self, path, namespaces=None):
+        """Find all matching subelements by tag name or path.
+
+        Same as getroot().findall(path), which is Element.findall().
+
+        *path* is a string having either an element tag or an XPath,
+        *namespaces* is an optional mapping from namespace prefix to full name.
+
+        Return list containing all matching elements in document order.
+
+        """
         # assert self._root is not None
         if path[:1] == "/":
             path = "." + path
@@ -756,17 +696,17 @@
                 )
         return self._root.findall(path, namespaces)
 
-    ##
-    # Finds all matching subelements, by tag name or path.
-    # Same as getroot().iterfind(path).
-    #
-    # @param path What element to look for.
-    # @keyparam namespaces Optional namespace prefix map.
-    # @return An iterator or sequence containing all matching elements,
-    #    in document order.
-    # @defreturn a generated sequence of Element instances
-
     def iterfind(self, path, namespaces=None):
+        """Find all matching subelements by tag name or path.
+
+        Same as getroot().iterfind(path), which is element.iterfind()
+
+        *path* is a string having either an element tag or an XPath,
+        *namespaces* is an optional mapping from namespace prefix to full name.
+
+        Return an iterable yielding all matching elements in document order.
+
+        """
         # assert self._root is not None
         if path[:1] == "/":
             path = "." + path
@@ -778,26 +718,35 @@
                 )
         return self._root.iterfind(path, namespaces)
 
-    ##
-    # Writes the element tree to a file, as XML.
-    #
-    # @def write(file, **options)
-    # @param file A file name, or a file object opened for writing.
-    # @param **options Options, given as keyword arguments.
-    # @keyparam encoding Optional output encoding (default is US-ASCII).
-    #     Use "unicode" to return a Unicode string.
-    # @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,
               xml_declaration=None,
               default_namespace=None,
-              method=None):
+              method=None, *,
+              short_empty_elements=True):
+        """Write element tree to a file as XML.
+
+        Arguments:
+          *file_or_filename* -- file name or a file object opened for writing
+
+          *encoding* -- the output encoding (default: US-ASCII)
+
+          *xml_declaration* -- bool indicating if an XML declaration should be
+                               added to the output. If None, an XML declaration
+                               is added if encoding IS NOT either of:
+                               US-ASCII, UTF-8, or Unicode
+
+          *default_namespace* -- sets the default XML namespace (for "xmlns")
+
+          *method* -- either "xml" (default), "html, "text", or "c14n"
+
+          *short_empty_elements* -- controls the formatting of elements
+                                    that contain no content. If True (default)
+                                    they are emitted as a single self-closed
+                                    tag, otherwise they are emitted as a pair
+                                    of start/end tags
+
+        """
         if not method:
             method = "xml"
         elif method not in _serialize:
@@ -825,7 +774,8 @@
             else:
                 qnames, namespaces = _namespaces(self._root, default_namespace)
                 serialize = _serialize[method]
-                serialize(write, self._root, qnames, namespaces)
+                serialize(write, self._root, qnames, namespaces,
+                          short_empty_elements=short_empty_elements)
 
     def write_c14n(self, file):
         # lxml.etree compatibility.  use output method instead
@@ -947,7 +897,8 @@
             add_qname(text.text)
     return qnames, namespaces
 
-def _serialize_xml(write, elem, qnames, namespaces):
+def _serialize_xml(write, elem, qnames, namespaces,
+                   short_empty_elements, **kwargs):
     tag = elem.tag
     text = elem.text
     if tag is Comment:
@@ -960,7 +911,8 @@
             if text:
                 write(_escape_cdata(text))
             for e in elem:
-                _serialize_xml(write, e, qnames, None)
+                _serialize_xml(write, e, qnames, None,
+                               short_empty_elements=short_empty_elements)
         else:
             write("<" + tag)
             items = list(elem.items())
@@ -982,12 +934,13 @@
                     else:
                         v = _escape_attrib(v)
                     write(" %s=\"%s\"" % (qnames[k], v))
-            if text or len(elem):
+            if text or len(elem) or not short_empty_elements:
                 write(">")
                 if text:
                     write(_escape_cdata(text))
                 for e in elem:
-                    _serialize_xml(write, e, qnames, None)
+                    _serialize_xml(write, e, qnames, None,
+                                   short_empty_elements=short_empty_elements)
                 write("</" + tag + ">")
             else:
                 write(" />")
@@ -1002,7 +955,7 @@
 except NameError:
     pass
 
-def _serialize_html(write, elem, qnames, namespaces):
+def _serialize_html(write, elem, qnames, namespaces, **kwargs):
     tag = elem.tag
     text = elem.text
     if tag is Comment:
@@ -1066,18 +1019,19 @@
 #   "c14n": _serialize_c14n,
 }
 
-##
-# Registers a namespace prefix.  The registry is global, and any
-# existing mapping for either the given prefix or the namespace URI
-# will be removed.
-#
-# @param prefix Namespace prefix.
-# @param uri Namespace uri.  Tags and attributes in this namespace
-#     will be serialized with the given prefix, if at all possible.
-# @exception ValueError If the prefix is reserved, or is otherwise
-#     invalid.
 
 def register_namespace(prefix, uri):
+    """Register a namespace prefix.
+
+    The registry is global, and any existing mapping for either the
+    given prefix or the namespace URI will be removed.
+
+    *prefix* is the namespace prefix, *uri* is a namespace uri. Tags and
+    attributes in this namespace will be serialized with prefix if possible.
+
+    ValueError is raised if prefix is reserved or is invalid.
+
+    """
     if re.match("ns\d+$", prefix):
         raise ValueError("Prefix format reserved for internal use")
     for k, v in list(_namespace_map.items()):
@@ -1153,40 +1107,27 @@
 
 # --------------------------------------------------------------------
 
-##
-# Generates a string representation of an XML element, including all
-# subelements.  If encoding is "unicode", the return type is a string;
-# otherwise it is a bytes array.
-#
-# @param element An Element instance.
-# @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").
-# @return An (optionally) encoded string containing the XML data.
-# @defreturn string
+def tostring(element, encoding=None, method=None, *,
+             short_empty_elements=True):
+    """Generate string representation of XML element.
 
-def tostring(element, encoding=None, method=None):
+    All subelements are included.  If encoding is "unicode", a string
+    is returned. Otherwise a bytestring is returned.
+
+    *element* is an Element instance, *encoding* is an optional output
+    encoding defaulting to US-ASCII, *method* is an optional output which can
+    be one of "xml" (default), "html", "text" or "c14n".
+
+    Returns an (optionally) encoded string containing the XML data.
+
+    """
     stream = io.StringIO() if encoding == 'unicode' else io.BytesIO()
-    ElementTree(element).write(stream, encoding, method=method)
+    ElementTree(element).write(stream, encoding, method=method,
+                               short_empty_elements=short_empty_elements)
     return stream.getvalue()
 
-##
-# Generates a string representation of an XML element, including all
-# subelements.
-#
-# @param element An Element instance.
-# @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").
-# @return A sequence object containing the XML data.
-# @defreturn sequence
-# @since 1.3
-
 class _ListDataStream(io.BufferedIOBase):
-    """ An auxiliary stream accumulating into a list reference
-    """
+    """An auxiliary stream accumulating into a list reference."""
     def __init__(self, lst):
         self.lst = lst
 
@@ -1202,22 +1143,25 @@
     def tell(self):
         return len(self.lst)
 
-def tostringlist(element, encoding=None, method=None):
+def tostringlist(element, encoding=None, method=None, *,
+                 short_empty_elements=True):
     lst = []
     stream = _ListDataStream(lst)
-    ElementTree(element).write(stream, encoding, method=method)
+    ElementTree(element).write(stream, encoding, method=method,
+                               short_empty_elements=short_empty_elements)
     return lst
 
-##
-# Writes an element tree or element structure to sys.stdout.  This
-# function should be used for debugging only.
-# <p>
-# The exact output format is implementation dependent.  In this
-# version, it's written as an ordinary XML file.
-#
-# @param elem An element tree or an individual element.
 
 def dump(elem):
+    """Write element tree or element structure to sys.stdout.
+
+    This function should be used for debugging only.
+
+    *elem* is either an ElementTree, or a single Element.  The exact output
+    format is implementation dependent.  In this version, it's written as an
+    ordinary XML file.
+
+    """
     # debugging
     if not isinstance(elem, ElementTree):
         elem = ElementTree(elem)
@@ -1229,144 +1173,169 @@
 # --------------------------------------------------------------------
 # parsing
 
-##
-# Parses an XML document into an element tree.
-#
-# @param source A filename or file object containing XML data.
-# @param parser An optional parser instance.  If not given, the
-#     standard {@link XMLParser} parser is used.
-# @return An ElementTree instance
 
 def parse(source, parser=None):
+    """Parse XML document into element tree.
+
+    *source* is a filename or file object containing XML data,
+    *parser* is an optional parser instance defaulting to XMLParser.
+
+    Return an ElementTree instance.
+
+    """
     tree = ElementTree()
     tree.parse(source, parser)
     return tree
 
-##
-# Parses an XML document into an element tree incrementally, and reports
-# what's going on to the user.
-#
-# @param source A filename or file object containing XML data.
-# @param events A list of events to report back.  If omitted, only "end"
-#     events are reported.
-# @param parser An optional parser instance.  If not given, the
-#     standard {@link XMLParser} parser is used.
-# @return A (event, elem) iterator.
 
 def iterparse(source, events=None, parser=None):
+    """Incrementally parse XML document into ElementTree.
+
+    This class also reports what's going on to the user based on the
+    *events* it is initialized with.  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.
+
+    *source* is a filename or file object containing XML data, *events* is
+    a list of events to report back, *parser* is an optional parser instance.
+
+    Returns an iterator providing (event, elem) pairs.
+
+    """
     close_source = False
     if not hasattr(source, "read"):
         source = open(source, "rb")
         close_source = True
-    if not parser:
-        parser = XMLParser(target=TreeBuilder())
     return _IterParseIterator(source, events, parser, close_source)
 
+
+class XMLPullParser:
+
+    def __init__(self, events=None, *, _parser=None):
+        # The _parser argument is for internal use only and must not be relied
+        # upon in user code. It will be removed in a future release.
+        # See http://bugs.python.org/issue17741 for more details.
+
+        # _elementtree.c expects a list, not a deque
+        self._events_queue = []
+        self._index = 0
+        self._parser = _parser or XMLParser(target=TreeBuilder())
+        # wire up the parser for event reporting
+        if events is None:
+            events = ("end",)
+        self._parser._setevents(self._events_queue, events)
+
+    def feed(self, data):
+        """Feed encoded data to parser."""
+        if self._parser is None:
+            raise ValueError("feed() called after end of stream")
+        if data:
+            try:
+                self._parser.feed(data)
+            except SyntaxError as exc:
+                self._events_queue.append(exc)
+
+    def _close_and_return_root(self):
+        # iterparse needs this to set its root attribute properly :(
+        root = self._parser.close()
+        self._parser = None
+        return root
+
+    def close(self):
+        """Finish feeding data to parser.
+
+        Unlike XMLParser, does not return the root element. Use
+        read_events() to consume elements from XMLPullParser.
+        """
+        self._close_and_return_root()
+
+    def read_events(self):
+        """Return an iterator over currently available (event, elem) pairs.
+
+        Events are consumed from the internal event queue as they are
+        retrieved from the iterator.
+        """
+        events = self._events_queue
+        while True:
+            index = self._index
+            try:
+                event = events[self._index]
+                # Avoid retaining references to past events
+                events[self._index] = None
+            except IndexError:
+                break
+            index += 1
+            # Compact the list in a O(1) amortized fashion
+            # As noted above, _elementree.c needs a list, not a deque
+            if index * 2 >= len(events):
+                events[:index] = []
+                self._index = 0
+            else:
+                self._index = index
+            if isinstance(event, Exception):
+                raise event
+            else:
+                yield event
+
+
 class _IterParseIterator:
 
     def __init__(self, source, events, parser, close_source=False):
+        # Use the internal, undocumented _parser argument for now; When the
+        # parser argument of iterparse is removed, this can be killed.
+        self._parser = XMLPullParser(events=events, _parser=parser)
         self._file = source
         self._close_file = close_source
-        self._events = []
-        self._index = 0
-        self._error = None
         self.root = self._root = None
-        self._parser = parser
-        # wire up the parser for event reporting
-        parser = self._parser._parser
-        append = self._events.append
-        if events is None:
-            events = ["end"]
-        for event in events:
-            if event == "start":
-                try:
-                    parser.ordered_attributes = 1
-                    parser.specified_attributes = 1
-                    def handler(tag, attrib_in, event=event, append=append,
-                                start=self._parser._start_list):
-                        append((event, start(tag, attrib_in)))
-                    parser.StartElementHandler = handler
-                except AttributeError:
-                    def handler(tag, attrib_in, event=event, append=append,
-                                start=self._parser._start):
-                        append((event, start(tag, attrib_in)))
-                    parser.StartElementHandler = handler
-            elif event == "end":
-                def handler(tag, event=event, append=append,
-                            end=self._parser._end):
-                    append((event, end(tag)))
-                parser.EndElementHandler = handler
-            elif event == "start-ns":
-                def handler(prefix, uri, event=event, append=append):
-                    append((event, (prefix or "", uri or "")))
-                parser.StartNamespaceDeclHandler = handler
-            elif event == "end-ns":
-                def handler(prefix, event=event, append=append):
-                    append((event, None))
-                parser.EndNamespaceDeclHandler = handler
-            else:
-                raise ValueError("unknown event %r" % event)
 
     def __next__(self):
         while 1:
-            try:
-                item = self._events[self._index]
-                self._index += 1
-                return item
-            except IndexError:
-                pass
-            if self._error:
-                e = self._error
-                self._error = None
-                raise e
-            if self._parser is None:
+            for event in self._parser.read_events():
+                return event
+            if self._parser._parser is None:
                 self.root = self._root
                 if self._close_file:
                     self._file.close()
                 raise StopIteration
             # load event buffer
-            del self._events[:]
-            self._index = 0
-            data = self._file.read(16384)
+            data = self._file.read(16 * 1024)
             if data:
-                try:
-                    self._parser.feed(data)
-                except SyntaxError as exc:
-                    self._error = exc
+                self._parser.feed(data)
             else:
-                self._root = self._parser.close()
-                self._parser = None
+                self._root = self._parser._close_and_return_root()
 
     def __iter__(self):
         return self
 
-##
-# Parses an XML document from a string constant.  This function can
-# be used to embed "XML literals" in Python code.
-#
-# @param source A string containing XML data.
-# @param parser An optional parser instance.  If not given, the
-#     standard {@link XMLParser} parser is used.
-# @return An Element instance.
-# @defreturn Element
 
 def XML(text, parser=None):
+    """Parse XML document from string constant.
+
+    This function can be used to embed "XML Literals" in Python code.
+
+    *text* is a string containing XML data, *parser* is an
+    optional parser instance, defaulting to the standard XMLParser.
+
+    Returns an Element instance.
+
+    """
     if not parser:
         parser = XMLParser(target=TreeBuilder())
     parser.feed(text)
     return parser.close()
 
-##
-# Parses an XML document from a string constant, and also returns
-# a dictionary which maps from element id:s to elements.
-#
-# @param source A string containing XML data.
-# @param parser An optional parser instance.  If not given, the
-#     standard {@link XMLParser} parser is used.
-# @return A tuple containing an Element instance and a dictionary.
-# @defreturn (Element, dictionary)
 
 def XMLID(text, parser=None):
+    """Parse XML document from string constant for its IDs.
+
+    *text* is a string containing XML data, *parser* is an
+    optional parser instance, defaulting to the standard XMLParser.
+
+    Returns an (Element, dict) tuple, in which the
+    dict maps element id:s to elements.
+
+    """
     if not parser:
         parser = XMLParser(target=TreeBuilder())
     parser.feed(text)
@@ -1378,27 +1347,18 @@
             ids[id] = elem
     return tree, ids
 
-##
-# Parses an XML document from a string constant.  Same as {@link #XML}.
-#
-# @def fromstring(text)
-# @param source A string containing XML data.
-# @return An Element instance.
-# @defreturn Element
-
+# Parse XML document from string constant.  Alias for XML().
 fromstring = XML
 
-##
-# Parses an XML document from a sequence of string fragments.
-#
-# @param sequence A list or other sequence containing XML data fragments.
-# @param parser An optional parser instance.  If not given, the
-#     standard {@link XMLParser} parser is used.
-# @return An Element instance.
-# @defreturn Element
-# @since 1.3
-
 def fromstringlist(sequence, parser=None):
+    """Parse XML document from sequence of string fragments.
+
+    *sequence* is a list of other sequence, *parser* is an optional parser
+    instance, defaulting to the standard XMLParser.
+
+    Returns an Element instance.
+
+    """
     if not parser:
         parser = XMLParser(target=TreeBuilder())
     for text in sequence:
@@ -1407,19 +1367,20 @@
 
 # --------------------------------------------------------------------
 
-##
-# Generic element structure builder.  This builder converts a sequence
-# of {@link #TreeBuilder.start}, {@link #TreeBuilder.data}, and {@link
-# #TreeBuilder.end} method calls to a well-formed element structure.
-# <p>
-# You can use this class to build an element structure using a custom XML
-# parser, or a parser for some other XML-like format.
-#
-# @param element_factory Optional element factory.  This factory
-#    is called to create new Element instances, as necessary.
 
 class TreeBuilder:
+    """Generic element structure builder.
 
+    This builder converts a sequence of start, data, and end method
+    calls to a well-formed element structure.
+
+    You can use this class to build an element structure using a custom XML
+    parser, or a parser for some other XML-like format.
+
+    *element_factory* is an optional element factory which is called
+    to create new Element instances, as necessary.
+
+    """
     def __init__(self, element_factory=None):
         self._data = [] # data collector
         self._elem = [] # element stack
@@ -1429,14 +1390,8 @@
             element_factory = Element
         self._factory = element_factory
 
-    ##
-    # Flushes the builder buffers, and returns the toplevel document
-    # element.
-    #
-    # @return An Element instance.
-    # @defreturn Element
-
     def close(self):
+        """Flush builder buffers and return toplevel document Element."""
         assert len(self._elem) == 0, "missing end tags"
         assert self._last is not None, "missing toplevel element"
         return self._last
@@ -1453,24 +1408,17 @@
                     self._last.text = text
             self._data = []
 
-    ##
-    # Adds text to the current element.
-    #
-    # @param data A string.  This should be either an 8-bit string
-    #    containing ASCII text, or a Unicode string.
-
     def data(self, data):
+        """Add text to current element."""
         self._data.append(data)
 
-    ##
-    # Opens a new element.
-    #
-    # @param tag The element name.
-    # @param attrib A dictionary containing element attributes.
-    # @return The opened element.
-    # @defreturn Element
-
     def start(self, tag, attrs):
+        """Open new element and return it.
+
+        *tag* is the element name, *attrs* is a dict containing element
+        attributes.
+
+        """
         self._flush()
         self._last = elem = self._factory(tag, attrs)
         if self._elem:
@@ -1479,14 +1427,12 @@
         self._tail = 0
         return elem
 
-    ##
-    # Closes the current element.
-    #
-    # @param tag The element name.
-    # @return The closed element.
-    # @defreturn Element
-
     def end(self, tag):
+        """Close and return current Element.
+
+        *tag* is the element name.
+
+        """
         self._flush()
         self._last = self._elem.pop()
         assert self._last.tag == tag,\
@@ -1495,20 +1441,18 @@
         self._tail = 1
         return self._last
 
-##
-# Element structure builder for XML source data, based on the
-# <b>expat</b> parser.
-#
-# @keyparam target Target object.  If omitted, the builder uses an
-#     instance of the standard {@link #TreeBuilder} class.
-# @keyparam html Predefine HTML entities.  This flag is not supported
-#     by the current implementation.
-# @keyparam encoding Optional encoding.  If given, the value overrides
-#     the encoding specified in the XML file.
-# @see #ElementTree
-# @see #TreeBuilder
 
+# also see ElementTree and TreeBuilder
 class XMLParser:
+    """Element structure builder for XML source data based on the expat parser.
+
+    *html* are predefined HTML entities (not supported currently),
+    *target* is an optional target object which defaults to an instance of the
+    standard TreeBuilder class, *encoding* is an optional encoding string
+    which if given, overrides the encoding specified in the XML file:
+    http://www.iana.org/assignments/character-sets
+
+    """
 
     def __init__(self, html=0, target=None, encoding=None):
         try:
@@ -1541,19 +1485,10 @@
             parser.CommentHandler = target.comment
         if hasattr(target, 'pi'):
             parser.ProcessingInstructionHandler = target.pi
-        # let expat do the buffering, if supported
-        try:
-            parser.buffer_text = 1
-        except AttributeError:
-            pass
-        # use new-style attribute handling, if supported
-        try:
-            parser.ordered_attributes = 1
-            parser.specified_attributes = 1
-            if hasattr(target, 'start'):
-                parser.StartElementHandler = self._start_list
-        except AttributeError:
-            pass
+        # Configure pyexpat: buffering, new-style attribute handling.
+        parser.buffer_text = 1
+        parser.ordered_attributes = 1
+        parser.specified_attributes = 1
         self._doctype = None
         self.entity = {}
         try:
@@ -1561,6 +1496,39 @@
         except AttributeError:
             pass # unknown
 
+    def _setevents(self, events_queue, events_to_report):
+        # Internal API for XMLPullParser
+        # events_to_report: a list of events to report during parsing (same as
+        # the *events* of XMLPullParser's constructor.
+        # events_queue: a list of actual parsing events that will be populated
+        # by the underlying parser.
+        #
+        parser = self._parser
+        append = events_queue.append
+        for event_name in events_to_report:
+            if event_name == "start":
+                parser.ordered_attributes = 1
+                parser.specified_attributes = 1
+                def handler(tag, attrib_in, event=event_name, append=append,
+                            start=self._start):
+                    append((event, start(tag, attrib_in)))
+                parser.StartElementHandler = handler
+            elif event_name == "end":
+                def handler(tag, event=event_name, append=append,
+                            end=self._end):
+                    append((event, end(tag)))
+                parser.EndElementHandler = handler
+            elif event_name == "start-ns":
+                def handler(prefix, uri, event=event_name, append=append):
+                    append((event, (prefix or "", uri or "")))
+                parser.StartNamespaceDeclHandler = handler
+            elif event_name == "end-ns":
+                def handler(prefix, event=event_name, append=append):
+                    append((event, None))
+                parser.EndNamespaceDeclHandler = handler
+            else:
+                raise ValueError("unknown event %r" % event_name)
+
     def _raiseerror(self, value):
         err = ParseError(value)
         err.code = value.code
@@ -1578,21 +1546,16 @@
             self._names[key] = name
         return name
 
-    def _start(self, tag, attrib_in):
+    def _start(self, tag, attr_list):
+        # Handler for expat's StartElementHandler. Since ordered_attributes
+        # is set, the attributes are reported as a list of alternating
+        # attribute name,value.
         fixname = self._fixname
         tag = fixname(tag)
         attrib = {}
-        for key, value in attrib_in.items():
-            attrib[fixname(key)] = value
-        return self.target.start(tag, attrib)
-
-    def _start_list(self, tag, attrib_in):
-        fixname = self._fixname
-        tag = fixname(tag)
-        attrib = {}
-        if attrib_in:
-            for i in range(0, len(attrib_in), 2):
-                attrib[fixname(attrib_in[i])] = attrib_in[i+1]
+        if attr_list:
+            for i in range(0, len(attr_list), 2):
+                attrib[fixname(attr_list[i])] = attr_list[i+1]
         return self.target.start(tag, attrib)
 
     def _end(self, tag):
@@ -1650,15 +1613,13 @@
                     self.doctype(name, pubid, system[1:-1])
                 self._doctype = None
 
-    ##
-    # (Deprecated) Handles a doctype declaration.
-    #
-    # @param name Doctype name.
-    # @param pubid Public identifier.
-    # @param system System identifier.
-
     def doctype(self, name, pubid, system):
-        """This method of XMLParser is deprecated."""
+        """(Deprecated)  Handle doctype declaration
+
+        *name* is the Doctype name, *pubid* is the public identifier,
+        and *system* is the system identifier.
+
+        """
         warnings.warn(
             "This method of XMLParser is deprecated.  Define doctype() "
             "method on the TreeBuilder target.",
@@ -1668,24 +1629,15 @@
     # sentinel, if doctype is redefined in a subclass
     __doctype = doctype
 
-    ##
-    # Feeds data to the parser.
-    #
-    # @param data Encoded data.
-
     def feed(self, data):
+        """Feed encoded data to parser."""
         try:
             self.parser.Parse(data, 0)
         except self._error as v:
             self._raiseerror(v)
 
-    ##
-    # Finishes feeding data to the parser.
-    #
-    # @return An element structure.
-    # @defreturn Element
-
     def close(self):
+        """Finish feeding data to parser and return element structure."""
         try:
             self.parser.Parse("", 1) # end of data
         except self._error as v:
@@ -1704,103 +1656,12 @@
 
 # Import the C accelerators
 try:
+    # Element is going to be shadowed by the C implementation. We need to keep
+    # the Python version of it accessible for some "creative" by external code
+    # (see tests)
+    _Element_Py = Element
+
     # Element, SubElement, ParseError, TreeBuilder, XMLParser
     from _elementtree import *
 except ImportError:
     pass
-else:
-    # Overwrite 'ElementTree.parse' and 'iterparse' to use the C XMLParser
-
-    class ElementTree(ElementTree):
-        def parse(self, source, parser=None):
-            close_source = False
-            if not hasattr(source, 'read'):
-                source = open(source, 'rb')
-                close_source = True
-            try:
-                if parser is not None:
-                    while True:
-                        data = source.read(65536)
-                        if not data:
-                            break
-                        parser.feed(data)
-                    self._root = parser.close()
-                else:
-                    parser = XMLParser()
-                    self._root = parser._parse(source)
-                return self._root
-            finally:
-                if close_source:
-                    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, parser=None):
-            self._close_file = False
-            if not hasattr(file, 'read'):
-                file = open(file, 'rb')
-                self._close_file = True
-            self._file = file
-            self._events = []
-            self._index = 0
-            self._error = None
-            self.root = self._root = None
-            if parser is None:
-                parser = XMLParser(target=TreeBuilder())
-            self._parser = parser
-            self._parser._setevents(self._events, events)
-
-        def __next__(self):
-            while True:
-                try:
-                    item = self._events[self._index]
-                    self._index += 1
-                    return item
-                except IndexError:
-                    pass
-                if self._error:
-                    e = self._error
-                    self._error = None
-                    raise e
-                if self._parser is None:
-                    self.root = self._root
-                    if self._close_file:
-                        self._file.close()
-                    raise StopIteration
-                # load event buffer
-                del self._events[:]
-                self._index = 0
-                data = self._file.read(16384)
-                if data:
-                    try:
-                        self._parser.feed(data)
-                    except SyntaxError as exc:
-                        self._error = exc
-                else:
-                    self._root = self._parser.close()
-                    self._parser = None
-
-        def __iter__(self):
-            return self
-
-# compatibility
-XMLTreeBuilder = XMLParser
-
-# workaround circular import.
-try:
-    from ElementC14N import _serialize_c14n
-    _serialize["c14n"] = _serialize_c14n
-except ImportError:
-    pass
diff --git a/Lib/xml/sax/saxutils.py b/Lib/xml/sax/saxutils.py
index 74de9b0..1d3d0ec 100644
--- a/Lib/xml/sax/saxutils.py
+++ b/Lib/xml/sax/saxutils.py
@@ -346,7 +346,7 @@
         f = source
         source = xmlreader.InputSource()
         source.setByteStream(f)
-        if hasattr(f, "name"):
+        if hasattr(f, "name") and isinstance(f.name, str):
             source.setSystemId(f.name)
 
     if source.getByteStream() is None:
diff --git a/Lib/xmlrpc/client.py b/Lib/xmlrpc/client.py
index ca2ac9f..e8c1944 100644
--- a/Lib/xmlrpc/client.py
+++ b/Lib/xmlrpc/client.py
@@ -135,7 +135,6 @@
 import http.client
 import urllib.parse
 from xml.parsers import expat
-import socket
 import errno
 from io import BytesIO
 try:
@@ -1052,7 +1051,7 @@
             decoded = gzf.read()
         else:
             decoded = gzf.read(max_decode + 1)
-    except IOError:
+    except OSError:
         raise ValueError("invalid data")
     f.close()
     gzf.close()
@@ -1139,8 +1138,9 @@
         for i in (0, 1):
             try:
                 return self.single_request(host, handler, request_body, verbose)
-            except socket.error as e:
-                if i or e.errno not in (errno.ECONNRESET, errno.ECONNABORTED, errno.EPIPE):
+            except OSError as e:
+                if i or e.errno not in (errno.ECONNRESET, errno.ECONNABORTED,
+                                        errno.EPIPE):
                     raise
             except http.client.BadStatusLine: #close after we sent request
                 if i:
@@ -1332,6 +1332,11 @@
 class SafeTransport(Transport):
     """Handles an HTTPS transaction to an XML-RPC server."""
 
+    def __init__(self, use_datetime=False, use_builtin_types=False, *,
+                 context=None):
+        super().__init__(use_datetime=use_datetime, use_builtin_types=use_builtin_types)
+        self.context = context
+
     # FIXME: mostly untested
 
     def make_connection(self, host):
@@ -1345,7 +1350,7 @@
         # host may be a string, or a (host, x509-dict) tuple
         chost, self._extra_headers, x509 = self.get_host_info(host)
         self._connection = host, http.client.HTTPSConnection(chost,
-            None, **(x509 or {}))
+            None, context=self.context, **(x509 or {}))
         return self._connection[1]
 
 ##
@@ -1388,13 +1393,14 @@
     """
 
     def __init__(self, uri, transport=None, encoding=None, verbose=False,
-                 allow_none=False, use_datetime=False, use_builtin_types=False):
+                 allow_none=False, use_datetime=False, use_builtin_types=False,
+                 *, context=None):
         # establish a "logical" server connection
 
         # get the url
         type, uri = urllib.parse.splittype(uri)
         if type not in ("http", "https"):
-            raise IOError("unsupported XML-RPC protocol")
+            raise OSError("unsupported XML-RPC protocol")
         self.__host, self.__handler = urllib.parse.splithost(uri)
         if not self.__handler:
             self.__handler = "/RPC2"
@@ -1402,10 +1408,13 @@
         if transport is None:
             if type == "https":
                 handler = SafeTransport
+                extra_kwargs = {"context": context}
             else:
                 handler = Transport
+                extra_kwargs = {}
             transport = handler(use_datetime=use_datetime,
-                                use_builtin_types=use_builtin_types)
+                                use_builtin_types=use_builtin_types,
+                                **extra_kwargs)
         self.__transport = transport
 
         self.__encoding = encoding or 'utf-8'
diff --git a/Lib/xmlrpc/server.py b/Lib/xmlrpc/server.py
index d27bf5a..304e218 100644
--- a/Lib/xmlrpc/server.py
+++ b/Lib/xmlrpc/server.py
@@ -584,13 +584,6 @@
         SimpleXMLRPCDispatcher.__init__(self, allow_none, encoding, use_builtin_types)
         socketserver.TCPServer.__init__(self, addr, requestHandler, bind_and_activate)
 
-        # [Bug #1222790] If possible, set close-on-exec flag; if a
-        # method spawns a subprocess, the subprocess shouldn't have
-        # the listening socket open.
-        if fcntl is not None and hasattr(fcntl, 'FD_CLOEXEC'):
-            flags = fcntl.fcntl(self.fileno(), fcntl.F_GETFD)
-            flags |= fcntl.FD_CLOEXEC
-            fcntl.fcntl(self.fileno(), fcntl.F_SETFD, flags)
 
 class MultiPathXMLRPCServer(SimpleXMLRPCServer):
     """Multipath XML-RPC Server
diff --git a/Lib/zipfile.py b/Lib/zipfile.py
index ff64c90..bda6134 100644
--- a/Lib/zipfile.py
+++ b/Lib/zipfile.py
@@ -6,7 +6,7 @@
 import io
 import os
 import re
-import imp
+import importlib.util
 import sys
 import time
 import stat
@@ -50,7 +50,7 @@
 
 
 ZIP64_LIMIT = (1 << 31) - 1
-ZIP_FILECOUNT_LIMIT = 1 << 16
+ZIP_FILECOUNT_LIMIT = (1 << 16) - 1
 ZIP_MAX_COMMENT = (1 << 16) - 1
 
 # constants for Zip file compression methods
@@ -164,7 +164,7 @@
     try:
         if _EndRecData(fp):
             return True         # file has correct magic number
-    except IOError:
+    except OSError:
         pass
     return False
 
@@ -180,7 +180,7 @@
         else:
             with open(filename, "rb") as fp:
                 result = _check_zipfile(fp)
-    except IOError:
+    except OSError:
         pass
     return result
 
@@ -190,7 +190,7 @@
     """
     try:
         fpin.seek(offset - sizeEndCentDir64Locator, 2)
-    except IOError:
+    except OSError:
         # If the seek fails, the file is not large enough to contain a ZIP64
         # end-of-archive record, so just return the end record we were given.
         return endrec
@@ -211,8 +211,8 @@
     if len(data) != sizeEndCentDir64:
         return endrec
     sig, sz, create_version, read_version, disk_num, disk_dir, \
-            dircount, dircount2, dirsize, diroffset = \
-            struct.unpack(structEndArchive64, data)
+        dircount, dircount2, dirsize, diroffset = \
+        struct.unpack(structEndArchive64, data)
     if sig != stringEndArchive64:
         return endrec
 
@@ -242,7 +242,7 @@
     # file if this is the case).
     try:
         fpin.seek(-sizeEndCentDir, 2)
-    except IOError:
+    except OSError:
         return None
     data = fpin.read()
     if (len(data) == sizeEndCentDir and
@@ -292,26 +292,26 @@
     """Class with attributes describing each file in the ZIP archive."""
 
     __slots__ = (
-            'orig_filename',
-            'filename',
-            'date_time',
-            'compress_type',
-            'comment',
-            'extra',
-            'create_system',
-            'create_version',
-            'extract_version',
-            'reserved',
-            'flag_bits',
-            'volume',
-            'internal_attr',
-            'external_attr',
-            'header_offset',
-            'CRC',
-            'compress_size',
-            'file_size',
-            '_raw_time',
-        )
+        'orig_filename',
+        'filename',
+        'date_time',
+        'compress_type',
+        'comment',
+        'extra',
+        'create_system',
+        'create_version',
+        'extract_version',
+        'reserved',
+        'flag_bits',
+        'volume',
+        'internal_attr',
+        'external_attr',
+        'header_offset',
+        'CRC',
+        'compress_size',
+        'file_size',
+        '_raw_time',
+    )
 
     def __init__(self, filename="NoName", date_time=(1980,1,1,0,0,0)):
         self.orig_filename = filename   # Original file name in archive
@@ -376,7 +376,7 @@
         if zip64:
             fmt = '<HHQQ'
             extra = extra + struct.pack(fmt,
-                    1, struct.calcsize(fmt)-4, file_size, compress_size)
+                                        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")
@@ -395,10 +395,10 @@
         self.create_version = max(min_version, self.create_version)
         filename, flag_bits = self._encodeFilenameFlags()
         header = struct.pack(structFileHeader, stringFileHeader,
-                 self.extract_version, self.reserved, flag_bits,
-                 self.compress_type, dostime, dosdate, CRC,
-                 compress_size, file_size,
-                 len(filename), len(extra))
+                             self.extract_version, self.reserved, flag_bits,
+                             self.compress_type, dostime, dosdate, CRC,
+                             compress_size, file_size,
+                             len(filename), len(extra))
         return header + filename + extra
 
     def _encodeFilenameFlags(self):
@@ -411,7 +411,7 @@
         # Try to decode the extra field.
         extra = self.extra
         unpack = struct.unpack
-        while extra:
+        while len(extra) >= 4:
             tp, ln = unpack('<HH', extra[:4])
             if tp == 1:
                 if ln >= 24:
@@ -475,13 +475,15 @@
                     crc = ((crc >> 1) & 0x7FFFFFFF)
             table[i] = crc
         return table
-    crctable = _GenerateCRCTable()
+    crctable = None
 
     def _crc32(self, ch, crc):
         """Compute the CRC32 primitive on one byte."""
         return ((crc >> 8) & 0xffffff) ^ self.crctable[(crc ^ ch) & 0xff]
 
     def __init__(self, pwd):
+        if _ZipDecrypter.crctable is None:
+            _ZipDecrypter.crctable = _ZipDecrypter._GenerateCRCTable()
         self.key0 = 305419896
         self.key1 = 591751049
         self.key2 = 878082192
@@ -511,7 +513,7 @@
     def _init(self):
         props = lzma._encode_filter_properties({'id': lzma.FILTER_LZMA1})
         self._comp = lzma.LZMACompressor(lzma.FORMAT_RAW, filters=[
-                lzma._decode_filter_properties(lzma.FILTER_LZMA1, props)
+            lzma._decode_filter_properties(lzma.FILTER_LZMA1, props)
         ])
         return struct.pack('<BBH', 9, 4, len(props)) + props
 
@@ -543,8 +545,8 @@
                 return b''
 
             self._decomp = lzma.LZMADecompressor(lzma.FORMAT_RAW, filters=[
-                    lzma._decode_filter_properties(lzma.FILTER_LZMA1,
-                            self._unconsumed[4:4 + psize])
+                lzma._decode_filter_properties(lzma.FILTER_LZMA1,
+                                               self._unconsumed[4:4 + psize])
             ])
             data = self._unconsumed[4 + psize:]
             del self._unconsumed
@@ -580,15 +582,15 @@
     elif compression == ZIP_DEFLATED:
         if not zlib:
             raise RuntimeError(
-                    "Compression requires the (missing) zlib module")
+                "Compression requires the (missing) zlib module")
     elif compression == ZIP_BZIP2:
         if not bz2:
             raise RuntimeError(
-                    "Compression requires the (missing) bz2 module")
+                "Compression requires the (missing) bz2 module")
     elif compression == ZIP_LZMA:
         if not lzma:
             raise RuntimeError(
-                    "Compression requires the (missing) lzma module")
+                "Compression requires the (missing) lzma module")
     else:
         raise RuntimeError("That compression method is not supported")
 
@@ -596,7 +598,7 @@
 def _get_compressor(compress_type):
     if compress_type == ZIP_DEFLATED:
         return zlib.compressobj(zlib.Z_DEFAULT_COMPRESSION,
-             zlib.DEFLATED, -15)
+                                zlib.DEFLATED, -15)
     elif compress_type == ZIP_BZIP2:
         return bz2.BZ2Compressor()
     elif compress_type == ZIP_LZMA:
@@ -836,8 +838,8 @@
             n = max(n, self.MIN_READ_SIZE)
             data = self._decompressor.decompress(data, n)
             self._eof = (self._decompressor.eof or
-                    self._compress_left <= 0 and
-                    not self._decompressor.unconsumed_tail)
+                         self._compress_left <= 0 and
+                         not self._decompressor.unconsumed_tail)
             if self._eof:
                 data += self._decompressor.flush()
         else:
@@ -878,7 +880,7 @@
 class ZipFile:
     """ Class with methods to open, read, write, close, list zip files.
 
-    z = ZipFile(file, mode="r", compression=ZIP_STORED, allowZip64=False)
+    z = ZipFile(file, mode="r", compression=ZIP_STORED, allowZip64=True)
 
     file: Either the path to the file, or a file-like object.
           If it is a path, the file will be opened and closed by ZipFile.
@@ -894,7 +896,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):
+    def __init__(self, file, mode="r", compression=ZIP_STORED, allowZip64=True):
         """Open the ZIP file with mode read "r", write "w" or append "a"."""
         if mode not in ("r", "w", "a"):
             raise RuntimeError('ZipFile() requires mode "r", "w", or "a"')
@@ -919,7 +921,7 @@
             modeDict = {'r' : 'rb', 'w': 'wb', 'a' : 'r+b'}
             try:
                 self.fp = io.open(file, modeDict[mode])
-            except IOError:
+            except OSError:
                 if mode == 'a':
                     mode = key = 'w'
                     self.fp = io.open(file, modeDict[mode])
@@ -970,7 +972,7 @@
         fp = self.fp
         try:
             endrec = _EndRecData(fp)
-        except IOError:
+        except OSError:
             raise BadZipFile("File is not a zip file")
         if not endrec:
             raise BadZipFile("File is not a zip file")
@@ -1018,8 +1020,8 @@
             x.comment = fp.read(centdir[_CD_COMMENT_LENGTH])
             x.header_offset = centdir[_CD_LOCAL_HEADER_OFFSET]
             (x.create_version, x.create_system, x.extract_version, x.reserved,
-                x.flag_bits, x.compress_type, t, d,
-                x.CRC, x.compress_size, x.file_size) = centdir[1:12]
+             x.flag_bits, x.compress_type, t, d,
+             x.CRC, x.compress_size, x.file_size) = centdir[1:12]
             if x.extract_version > MAX_EXTRACT_VERSION:
                 raise NotImplementedError("zip file version %.1f" %
                                           (x.extract_version / 10))
@@ -1027,7 +1029,7 @@
             # Convert date/time code to (year, month, day, hour, min, sec)
             x._raw_time = t
             x.date_time = ( (d>>9)+1980, (d>>5)&0xF, d&0x1F,
-                                     t>>11, (t>>5)&0x3F, (t&0x1F) * 2 )
+                            t>>11, (t>>5)&0x3F, (t&0x1F) * 2 )
 
             x._decodeExtra()
             x.header_offset = x.header_offset + concat
@@ -1119,11 +1121,15 @@
         """Return file-like object for 'name'."""
         if mode not in ("r", "U", "rU"):
             raise RuntimeError('open() requires mode "r", "U", or "rU"')
+        if 'U' in mode:
+            import warnings
+            warnings.warn("'U' mode is deprecated",
+                          DeprecationWarning, 2)
         if pwd and not isinstance(pwd, bytes):
             raise TypeError("pwd: expected bytes, got %s" % type(pwd))
         if not self.fp:
             raise RuntimeError(
-                  "Attempt to read ZIP archive that was already closed")
+                "Attempt to read ZIP archive that was already closed")
 
         # Only open a new file for instances where we were not
         # given a file object in the constructor
@@ -1296,22 +1302,26 @@
             raise RuntimeError('write() requires mode "w" or "a"')
         if not self.fp:
             raise RuntimeError(
-                  "Attempt to write ZIP archive that was already closed")
+                "Attempt to write ZIP archive that was already closed")
         _check_compression(zinfo.compress_type)
-        if zinfo.file_size > ZIP64_LIMIT:
-            if not self._allowZip64:
-                raise LargeZipFile("Filesize would require ZIP64 extensions")
-        if zinfo.header_offset > ZIP64_LIMIT:
-            if not self._allowZip64:
-                raise LargeZipFile(
-                      "Zipfile size would require ZIP64 extensions")
+        if not self._allowZip64:
+            requires_zip64 = None
+            if len(self.filelist) >= ZIP_FILECOUNT_LIMIT:
+                requires_zip64 = "Files count"
+            elif zinfo.file_size > ZIP64_LIMIT:
+                requires_zip64 = "Filesize"
+            elif zinfo.header_offset > ZIP64_LIMIT:
+                requires_zip64 = "Zipfile size"
+            if requires_zip64:
+                raise LargeZipFile(requires_zip64 +
+                                   " would require ZIP64 extensions")
 
     def write(self, filename, arcname=None, compress_type=None):
         """Put the bytes from filename into the archive under the name
         arcname."""
         if not self.fp:
             raise RuntimeError(
-                  "Attempt to write to ZIP archive that was already closed")
+                "Attempt to write to ZIP archive that was already closed")
 
         st = os.stat(filename)
         isdir = stat.S_ISDIR(st.st_mode)
@@ -1346,6 +1356,7 @@
             zinfo.file_size = 0
             zinfo.compress_size = 0
             zinfo.CRC = 0
+            zinfo.external_attr |= 0x10  # MS-DOS directory flag
             self.filelist.append(zinfo)
             self.NameToInfo[zinfo.filename] = zinfo
             self.fp.write(zinfo.FileHeader(False))
@@ -1358,7 +1369,7 @@
             zinfo.compress_size = compress_size = 0
             # Compressed size can be larger than uncompressed size
             zip64 = self._allowZip64 and \
-                    zinfo.file_size * 1.05 > ZIP64_LIMIT
+                zinfo.file_size * 1.05 > ZIP64_LIMIT
             self.fp.write(zinfo.FileHeader(zip64))
             file_size = 0
             while 1:
@@ -1406,13 +1417,17 @@
             zinfo = ZipInfo(filename=zinfo_or_arcname,
                             date_time=time.localtime(time.time())[:6])
             zinfo.compress_type = self.compression
-            zinfo.external_attr = 0o600 << 16
+            if zinfo.filename[-1] == '/':
+                zinfo.external_attr = 0o40775 << 16   # drwxrwxr-x
+                zinfo.external_attr |= 0x10           # MS-DOS directory flag
+            else:
+                zinfo.external_attr = 0o600 << 16     # ?rw-------
         else:
             zinfo = zinfo_or_arcname
 
         if not self.fp:
             raise RuntimeError(
-                  "Attempt to write to ZIP archive that was already closed")
+                "Attempt to write to ZIP archive that was already closed")
 
         zinfo.file_size = len(data)            # Uncompressed size
         zinfo.header_offset = self.fp.tell()    # Start of header data
@@ -1432,7 +1447,7 @@
         else:
             zinfo.compress_size = zinfo.file_size
         zip64 = zinfo.file_size > ZIP64_LIMIT or \
-                zinfo.compress_size > ZIP64_LIMIT
+            zinfo.compress_size > ZIP64_LIMIT
         if zip64 and not self._allowZip64:
             raise LargeZipFile("Filesize would require ZIP64 extensions")
         self.fp.write(zinfo.FileHeader(zip64))
@@ -1441,7 +1456,7 @@
             # Write CRC and file sizes after the file data
             fmt = '<LQQ' if zip64 else '<LLL'
             self.fp.write(struct.pack(fmt, zinfo.CRC, zinfo.compress_size,
-                  zinfo.file_size))
+                                      zinfo.file_size))
         self.fp.flush()
         self.filelist.append(zinfo)
         self.NameToInfo[zinfo.filename] = zinfo
@@ -1458,16 +1473,14 @@
 
         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:
+                       or zinfo.compress_size > ZIP64_LIMIT:
                         extra.append(zinfo.file_size)
                         extra.append(zinfo.compress_size)
                         file_size = 0xffffffff
@@ -1487,8 +1500,8 @@
                     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
+                            '<HH' + 'Q'*len(extra),
+                            1, 8*len(extra), *extra) + extra_data
 
                         min_version = ZIP64_VERSION
 
@@ -1502,21 +1515,21 @@
                     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)
+                                              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)
+                               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)
@@ -1525,30 +1538,38 @@
 
                 pos2 = self.fp.tell()
                 # Write end-of-zip-archive record
-                centDirCount = count
+                centDirCount = len(self.filelist)
                 centDirSize = pos2 - pos1
                 centDirOffset = pos1
-                if (centDirCount >= ZIP_FILECOUNT_LIMIT or
-                    centDirOffset > ZIP64_LIMIT or
-                    centDirSize > ZIP64_LIMIT):
+                requires_zip64 = None
+                if centDirCount > ZIP_FILECOUNT_LIMIT:
+                    requires_zip64 = "Files count"
+                elif centDirOffset > ZIP64_LIMIT:
+                    requires_zip64 = "Central directory offset"
+                elif centDirSize > ZIP64_LIMIT:
+                    requires_zip64 = "Central directory size"
+                if requires_zip64:
                     # Need to write the ZIP64 end-of-archive records
+                    if not self._allowZip64:
+                        raise LargeZipFile(requires_zip64 +
+                                           " would require ZIP64 extensions")
                     zip64endrec = struct.pack(
-                            structEndArchive64, stringEndArchive64,
-                            44, 45, 45, 0, 0, centDirCount, centDirCount,
-                            centDirSize, centDirOffset)
+                        structEndArchive64, stringEndArchive64,
+                        44, 45, 45, 0, 0, centDirCount, centDirCount,
+                        centDirSize, centDirOffset)
                     self.fp.write(zip64endrec)
 
                     zip64locrec = struct.pack(
-                            structEndArchive64Locator,
-                            stringEndArchive64Locator, 0, pos2, 1)
+                        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))
+                                     0, 0, centDirCount, centDirCount,
+                                     centDirSize, centDirOffset, len(self._comment))
                 self.fp.write(endrec)
                 self.fp.write(self._comment)
                 self.fp.flush()
@@ -1563,12 +1584,12 @@
     """Class to create ZIP archives with Python library files and packages."""
 
     def __init__(self, file, mode="r", compression=ZIP_STORED,
-                 allowZip64=False, optimize=-1):
+                 allowZip64=True, optimize=-1):
         ZipFile.__init__(self, file, mode=mode, compression=compression,
                          allowZip64=allowZip64)
         self._optimize = optimize
 
-    def writepy(self, pathname, basename=""):
+    def writepy(self, pathname, basename="", filterfunc=None):
         """Add all files from "pathname" to the ZIP archive.
 
         If pathname is a package directory, search the directory and
@@ -1579,7 +1600,14 @@
         archive.  Added modules are always module.pyo or module.pyc.
         This method will compile the module.py into module.pyc if
         necessary.
+        If filterfunc(pathname) is given, it is called with every argument.
+        When it is False, the file or directory is skipped.
         """
+        if filterfunc and not filterfunc(pathname):
+            if self.debug:
+                label = 'path' if os.path.isdir(pathname) else 'file'
+                print('%s "%s" skipped by filterfunc' % (label, pathname))
+            return
         dir, name = os.path.split(pathname)
         if os.path.isdir(pathname):
             initname = os.path.join(pathname, "__init__.py")
@@ -1604,10 +1632,15 @@
                     if os.path.isdir(path):
                         if os.path.isfile(os.path.join(path, "__init__.py")):
                             # This is a package directory, add it
-                            self.writepy(path, basename)  # Recursive call
+                            self.writepy(path, basename,
+                                         filterfunc=filterfunc)  # Recursive call
                     elif ext == ".py":
+                        if filterfunc and not filterfunc(path):
+                            if self.debug:
+                                print('file "%s" skipped by filterfunc' % path)
+                            continue
                         fname, arcname = self._get_codename(path[0:-3],
-                                         basename)
+                                                            basename)
                         if self.debug:
                             print("Adding", arcname)
                         self.write(fname, arcname)
@@ -1619,15 +1652,19 @@
                     path = os.path.join(pathname, filename)
                     root, ext = os.path.splitext(filename)
                     if ext == ".py":
+                        if filterfunc and not filterfunc(path):
+                            if self.debug:
+                                print('file "%s" skipped by filterfunc' % path)
+                            continue
                         fname, arcname = self._get_codename(path[0:-3],
-                                         basename)
+                                                            basename)
                         if self.debug:
                             print("Adding", arcname)
                         self.write(fname, arcname)
         else:
             if pathname[-3:] != ".py":
                 raise RuntimeError(
-                      'Files added with writepy() must end with ".py"')
+                    'Files added with writepy() must end with ".py"')
             fname, arcname = self._get_codename(pathname[0:-3], basename)
             if self.debug:
                 print("Adding file", arcname)
@@ -1654,8 +1691,8 @@
         file_py  = pathname + ".py"
         file_pyc = pathname + ".pyc"
         file_pyo = pathname + ".pyo"
-        pycache_pyc = imp.cache_from_source(file_py, True)
-        pycache_pyo = imp.cache_from_source(file_py, False)
+        pycache_pyc = importlib.util.cache_from_source(file_py, True)
+        pycache_pyo = importlib.util.cache_from_source(file_py, False)
         if self._optimize == -1:
             # legacy mode: use whatever file is present
             if (os.path.isfile(file_pyo) and
@@ -1742,18 +1779,7 @@
             sys.exit(1)
 
         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.extractall(args[2])
 
     elif args[0] == '-c':
         if len(args) < 3:
@@ -1764,14 +1790,21 @@
             if os.path.isfile(path):
                 zf.write(path, zippath, ZIP_DEFLATED)
             elif os.path.isdir(path):
+                if zippath:
+                    zf.write(path, zippath)
                 for nm in os.listdir(path):
                     addToZip(zf,
-                            os.path.join(path, nm), os.path.join(zippath, nm))
+                             os.path.join(path, nm), os.path.join(zippath, nm))
             # else: ignore
 
-        with ZipFile(args[1], 'w', allowZip64=True) as zf:
-            for src in args[2:]:
-                addToZip(zf, src, os.path.basename(src))
+        with ZipFile(args[1], 'w') as zf:
+            for path in args[2:]:
+                zippath = os.path.basename(path)
+                if not zippath:
+                    zippath = os.path.basename(os.path.dirname(path))
+                if zippath in ('', os.curdir, os.pardir):
+                    zippath = ''
+                addToZip(zf, path, zippath)
 
 if __name__ == "__main__":
     main()
diff --git a/Mac/BuildScript/README.txt b/Mac/BuildScript/README.txt
index 56c769a..8eb539c 100644
--- a/Mac/BuildScript/README.txt
+++ b/Mac/BuildScript/README.txt
@@ -1,35 +1,46 @@
 Building a Python Mac OS X distribution
 =======================================
 
-The ``build-install.py`` script creates Python distributions, including
+The ``build-installer.py`` script creates Python distributions, including
 certain third-party libraries as necessary.  It builds a complete 
 framework-based Python out-of-tree, installs it in a funny place with 
 $DESTROOT, massages that installation to remove .pyc files and such, creates 
 an Installer package from the installation plus other files in ``resources`` 
 and ``scripts`` and placed that on a ``.dmg`` disk image.
 
-As of Python 3.3.0, PSF practice is to build two installer variants
-for each release.
+This installers built by this script are legacy bundle installers that have
+been supported from the early days of OS X.  In particular, they are supported
+on OS X 10.3.9, the earliest supported release for builds from this script.
+
+Beginning with Python 3.4.2, PSF practice is to build two installer variants
+using the newer flat package format, supported on 10.5+, and signed with the
+builder's Apple developer key, allowing downloaded packages to satisfy Apple's
+default Gatekeeper policy (e.g. starting with 10.8, Apple store downloads and
+Apple developer ID signed apps and installer packages).  The process for
+transforming the output build artifacts into signed flat packages is not
+yet integrated into ``build-installer.py``.  The steps prior to the flat
+package creation are the same as for 3.4.1 below.
 
 1.  32-bit-only, i386 and PPC universal, capable on running on all machines
-    supported by Mac OS X 10.5 through (at least) 10.8::
+    supported by Mac OS X 10.5 through (at least) 10.9::
 
-        /usr/bin/python build-installer.py \
+        /path/to/bootstrap/python2.7 build-installer.py \
             --sdk-path=/Developer/SDKs/MacOSX10.5.sdk \
             --universal-archs=32-bit \
             --dep-target=10.5
 
     - builds the following third-party libraries
 
+        * libcrypto and libssl from OpenSSL 1.0.1 (new, as of 3.4.3)
         * NCurses 5.9 (http://bugs.python.org/issue15037)
-        * SQLite 3.7.13
-        * XZ 5.0.3
+        * SQLite 3.8.3.1
+        * XZ 5.0.5
 
     - uses system-supplied versions of third-party libraries
 
         * readline module links with Apple BSD editline (libedit)
 
-    - requires ActiveState ``Tcl/Tk 8.4`` (currently 8.4.19) to be installed for building
+    - requires ActiveState ``Tcl/Tk 8.4`` (currently 8.4.20) to be installed for building
 
     - recommended build environment:
 
@@ -38,7 +49,8 @@
         * ``MacOSX10.5`` SDK
         * ``MACOSX_DEPLOYMENT_TARGET=10.5``
         * Apple ``gcc-4.2``
-        * system Python 2.5 for documentation build with Sphinx
+        * bootstrap non-framework Python 2.7 for documentation build with
+          Sphinx (as of 3.4.1)
 
     - alternate build environments:
 
@@ -48,7 +60,7 @@
 
 2.  64-bit / 32-bit, x86_64 and i386 universal, for OS X 10.6 (and later)::
 
-        /usr/bin/python build-installer.py \
+        /path/to/bootstrap/python2.7 build-installer.py \
             --sdk-path=/Developer/SDKs/MacOSX10.6.sdk \
             --universal-archs=intel \
             --dep-target=10.6
@@ -56,14 +68,15 @@
     - builds the following third-party libraries
 
         * NCurses 5.9 (http://bugs.python.org/issue15037)
-        * SQLite 3.7.13
-        * XZ 5.0.3
+        * SQLite 3.8.3.1
+        * XZ 5.0.5
 
     - uses system-supplied versions of third-party libraries
 
+        * libcrypto and libssl from Apple OpenSSL 0.9.8
         * readline module links with Apple BSD editline (libedit)
 
-    - requires ActiveState Tcl/Tk 8.5.9 (or later) to be installed for building
+    - requires ActiveState Tcl/Tk 8.5.15.1 (or later) to be installed for building
 
     - recommended build environment:
 
@@ -72,7 +85,8 @@
         * ``MacOSX10.6`` SDK
         * ``MACOSX_DEPLOYMENT_TARGET=10.6``
         * Apple ``gcc-4.2``
-        * system Python 2.6 for documentation build with Sphinx
+        * bootstrap non-framework Python 2.7 for documentation build with
+          Sphinx (as of 3.4.1)
 
     - alternate build environments:
 
@@ -82,51 +96,10 @@
           considered a migration aid by Apple and is not likely to be fixed,
           its use should be avoided.  The other compiler, ``clang``, has been
           undergoing rapid development.  While it appears to have become
-          production-ready in the most recent Xcode 4 releases (Xcode 4.6.3
-          as of this writing), there are still some open issues when
-          building Python and there has not yet been the level of exposure in
-          production environments that the Xcode 3 gcc-4.2 compiler has had.
-
-
-*   For Python 2.7.x and 3.2.x, the 32-bit-only installer was configured to
-    support Mac OS X 10.3.9 through (at least) 10.6.  Because it is
-    believed that there are few systems still running OS X 10.3 or 10.4
-    and because it has become increasingly difficult to test and
-    support the differences in these earlier systems, as of Python 3.3.0 the PSF
-    32-bit installer no longer supports them.  For reference in building such
-    an installer yourself, the details are::
-
-        /usr/bin/python build-installer.py \
-            --sdk-path=/Developer/SDKs/MacOSX10.4u.sdk \
-            --universal-archs=32-bit \
-            --dep-target=10.3 
-
-    - builds the following third-party libraries
-
-        * Bzip2
-        * NCurses
-        * GNU Readline (GPL)
-        * SQLite 3
-        * XZ
-        * Zlib 1.2.3
-        * Oracle Sleepycat DB 4.8 (Python 2.x only)
-
-    - requires ActiveState ``Tcl/Tk 8.4`` (currently 8.4.19) to be installed for building
-
-    - recommended build environment:
-        
-        * Mac OS X 10.5.8 PPC or Intel
-        * Xcode 3.1.4 (or later)
-        * ``MacOSX10.4u`` SDK (later SDKs do not support PPC G3 processors)
-        * ``MACOSX_DEPLOYMENT_TARGET=10.3``
-        * Apple ``gcc-4.0``
-        * system Python 2.5 for documentation build with Sphinx
-
-    - alternate build environments:
-
-        * Mac OS X 10.6.8 with Xcode 3.2.6
-            - need to change ``/System/Library/Frameworks/{Tcl,Tk}.framework/Version/Current`` to ``8.4``
-
+          production-ready in the most recent Xcode 5 releases, the versions
+          available on the deprecated Xcode 4.x for 10.6 were early releases
+          and did not receive the level of exposure in production environments
+          that the Xcode 3 gcc-4.2 compiler has had.
 
 
 General Prerequisites
@@ -137,7 +110,13 @@
   interfere with the build.
 
 * The documentation for the release is built using Sphinx
-  because it is included in the installer.
+  because it is included in the installer.  For 2.7.x and 3.x.x up to and
+  including 3.4.0, the ``Doc/Makefile`` uses ``svn`` to download repos of
+  ``Sphinx`` and its dependencies.  Beginning with 3.4.1, the ``Doc/Makefile``
+  assumes there is an externally-provided ``sphinx-build`` and requires at
+  least Python 2.6 to run.  Because of this, it is no longer possible to
+  build a 3.4.1 or later installer on OS X 10.5 using the Apple-supplied
+  Python 2.5.
 
 * It is safest to start each variant build with an empty source directory
   populated with a fresh copy of the untarred source.
@@ -195,8 +174,8 @@
 on all supported OS X releases and architectures.  As a practical matter,
 that is generally not possible.  At a minimum, variant 1 should be run on
 a PPC G4 system with OS X 10.5 and at least one Intel system running OS X
-10.8, 10.7, 10.6, or 10.5.  Variant 2 should be run on 10.8, 10.7, and 10.6
-systems in both 32-bit and 64-bit modes.::
+10.9, 10.8, 10.7, 10.6, or 10.5.  Variant 2 should be run on 10.9, 10.8,
+10.7, and 10.6 systems in both 32-bit and 64-bit modes.::
 
     /usr/local/bin/pythonn.n -m test -w -u all,-largefile
     /usr/local/bin/pythonn.n-32 -m test -w -u all
@@ -207,7 +186,7 @@
 during testing and can be ignored.
 
 It is also recommend to launch IDLE and verify that it is at least
-functional.  Double-click on the IDLE app icon in ``/Applications/Pythonn.n``.
+functional.  Double-click on the IDLE app icon in ``/Applications/Python n.n``.
 It should also be tested from the command line::
 
     /usr/local/bin/idlen.n
diff --git a/Mac/BuildScript/build-installer.py b/Mac/BuildScript/build-installer.py
index fd5d5c3..379cb95 100755
--- a/Mac/BuildScript/build-installer.py
+++ b/Mac/BuildScript/build-installer.py
@@ -8,7 +8,9 @@
 Please ensure that this script keeps working with Python 2.5, to avoid
 bootstrap issues (/usr/bin/python is Python 2.5 on OSX 10.5).  Sphinx,
 which is used to build the documentation, currently requires at least
-Python 2.4.
+Python 2.4.  However, as of Python 3.4.1, Doc builds require an external
+sphinx-build and the current versions of Sphinx now require at least
+Python 2.6.
 
 In addition to what is supplied with OS X 10.5+ and Xcode 3+, the script
 requires an installed version of hg and a third-party version of
@@ -21,8 +23,8 @@
 
 32-bit-only installer builds are still possible on OS X 10.4 with Xcode 2.5
 and the installation of additional components, such as a newer Python
-(2.5 is needed for Python parser updates), hg, and svn (for the documentation
-build).
+(2.5 is needed for Python parser updates), hg, and for the documentation
+build either svn (pre-3.4.1) or sphinx-build (3.4.1 and later).
 
 Usage: see USAGE variable in the script.
 """
@@ -60,11 +62,16 @@
     return "'%s'"%(value.replace("'", "'\"'\"'"))
 
 def grepValue(fn, variable):
+    """
+    Return the unquoted value of a variable from a file..
+    QUOTED_VALUE='quotes'    -> str('quotes')
+    UNQUOTED_VALUE=noquotes  -> str('noquotes')
+    """
     variable = variable + '='
     for ln in open(fn, 'r'):
         if ln.startswith(variable):
             value = ln[len(variable):].strip()
-            return value[1:-1]
+            return value.strip("\"'")
     raise RuntimeError("Cannot find variable %s" % variable[:-1])
 
 _cache_getVersion = None
@@ -76,9 +83,6 @@
             os.path.join(SRCDIR, 'configure'), 'PACKAGE_VERSION')
     return _cache_getVersion
 
-def getVersionTuple():
-    return tuple([int(n) for n in getVersion().split('.')])
-
 def getVersionMajorMinor():
     return tuple([int(n) for n in getVersion().split('.', 2)])
 
@@ -95,6 +99,9 @@
             return _cache_getFullVersion
     raise RuntimeError("Cannot find full version??")
 
+FW_PREFIX = ["Library", "Frameworks", "Python.framework"]
+FW_VERSION_PREFIX = "--undefined--" # initialized in parseOptions
+
 # The directory we'll use to create the build (will be erased and recreated)
 WORKDIR = "/tmp/_py"
 
@@ -148,19 +155,21 @@
 # $MACOSX_DEPLOYMENT_TARGET -> minimum OS X level
 DEPTARGET = '10.3'
 
-target_cc_map = {
+def getDeptargetTuple():
+    return tuple([int(n) for n in DEPTARGET.split('.')[0:2]])
+
+def getTargetCompilers():
+    target_cc_map = {
         '10.3': ('gcc-4.0', 'g++-4.0'),
         '10.4': ('gcc-4.0', 'g++-4.0'),
         '10.5': ('gcc-4.2', 'g++-4.2'),
         '10.6': ('gcc-4.2', 'g++-4.2'),
-        '10.7': ('clang', 'clang++'),
-        '10.8': ('clang', 'clang++'),
-        '10.9': ('clang', 'clang++'),
-}
+    }
+    return target_cc_map.get(DEPTARGET, ('clang', 'clang++') )
 
-CC, CXX = target_cc_map[DEPTARGET]
+CC, CXX = getTargetCompilers()
 
-PYTHON_3 = getVersionTuple() >= (3, 0)
+PYTHON_3 = getVersionMajorMinor() >= (3, 0)
 
 USAGE = textwrap.dedent("""\
     Usage: build_python [options]
@@ -184,6 +193,10 @@
 #                       '/Library/Frameworks/Tk.framework/Versions/8.5/Tk']
 EXPECTED_SHARED_LIBS = {}
 
+# List of names of third party software built with this installer.
+# The names will be inserted into the rtf version of the License.
+THIRD_PARTY_LIBS = []
+
 # Instructions for building libraries that are necessary for building a
 # batteries included python.
 #   [The recipes are defined here for convenience but instantiated later after
@@ -191,9 +204,53 @@
 def library_recipes():
     result = []
 
-    LT_10_5 = bool(DEPTARGET < '10.5')
+    LT_10_5 = bool(getDeptargetTuple() < (10, 5))
 
-    if (DEPTARGET > '10.5') and (getVersionTuple() >= (3, 4)):
+    if getDeptargetTuple() < (10, 6):
+        # The OpenSSL libs shipped with OS X 10.5 and earlier are
+        # hopelessly out-of-date and do not include Apple's tie-in to
+        # the root certificates in the user and system keychains via TEA
+        # that was introduced in OS X 10.6.  Note that this applies to
+        # programs built and linked with a 10.5 SDK even when run on
+        # newer versions of OS X.
+        #
+        # Dealing with CAs is messy.  For now, just supply a
+        # local libssl and libcrypto for the older installer variants
+        # (e.g. the python.org 10.5+ 32-bit-only installer) that use the
+        # same default ssl certfile location as the system libs do:
+        #   /System/Library/OpenSSL/cert.pem
+        # Then at least TLS connections can be negotiated with sites that
+        # use sha-256 certs like python.org, assuming the proper CA certs
+        # have been supplied.  The default CA cert management issues for
+        # 10.5 and earlier builds are the same as before, other than it is
+        # now more obvious with cert checking enabled by default in the
+        # standard library.
+        #
+        # For builds with 10.6+ SDKs, continue to use the deprecated but
+        # less out-of-date Apple 0.9.8 libs for now.  While they are less
+        # secure than using an up-to-date 1.0.1 version, doing so
+        # avoids the big problems of forcing users to have to manage
+        # default CAs themselves, thanks to the Apple libs using private TEA
+        # APIs for cert validation from keychains if validation using the
+        # standard OpenSSL locations (/System/Library/OpenSSL, normally empty)
+        # fails.
+
+        result.extend([
+          dict(
+              name="OpenSSL 1.0.1k",
+              url="https://www.openssl.org/source/openssl-1.0.1k.tar.gz",
+              checksum='d4f002bd22a56881340105028842ae1f',
+              patches=[
+                  "openssl_sdk_makedepend.patch",
+                   ],
+              buildrecipe=build_universal_openssl,
+              configure=None,
+              install=None,
+          ),
+        ])
+
+#   Disable for now
+    if False:   # if getDeptargetTuple() > (10, 5):
         result.extend([
           dict(
               name="Tcl 8.5.15",
@@ -234,12 +291,12 @@
                 ),
         ])
 
-    if getVersionTuple() >= (3, 3):
+    if PYTHON_3:
         result.extend([
           dict(
-              name="XZ 5.0.3",
-              url="http://tukaani.org/xz/xz-5.0.3.tar.gz",
-              checksum='fefe52f9ecd521de2a8ce38c21a27574',
+              name="XZ 5.0.5",
+              url="http://tukaani.org/xz/xz-5.0.5.tar.gz",
+              checksum='19d924e066b6fff0bc9d1981b4e53196',
               configure_pre=[
                     '--disable-dependency-tracking',
               ]
@@ -282,9 +339,9 @@
                   ),
           ),
           dict(
-              name="SQLite 3.7.13",
-              url="http://www.sqlite.org/sqlite-autoconf-3071300.tar.gz",
-              checksum='c97df403e8a3d5b67bb408fcd6aabd8e',
+              name="SQLite 3.8.3.1",
+              url="http://www.sqlite.org/2014/sqlite-autoconf-3080301.tar.gz",
+              checksum='509ff98d8dc9729b618b7e96612079c6',
               extra_cflags=('-Os '
                             '-DSQLITE_ENABLE_FTS4 '
                             '-DSQLITE_ENABLE_FTS3_PARENTHESIS '
@@ -301,7 +358,7 @@
           ),
         ])
 
-    if DEPTARGET < '10.5':
+    if getDeptargetTuple() < (10, 5):
         result.extend([
           dict(
               name="Bzip2 1.0.6",
@@ -432,11 +489,24 @@
             topdir="/Library/Frameworks/Python.framework",
             source="/empty-dir",
             required=False,
-            selected=unselected_for_python3,
+            selected='selected',
+        ),
+        dict(
+            name="PythonInstallPip",
+            long_name="Install or upgrade pip",
+            readme="""\
+                This package installs (or upgrades from an earlier version)
+                pip, a tool for installing and managing Python packages.
+                """,
+            postflight="scripts/postflight.ensurepip",
+            topdir="/Library/Frameworks/Python.framework",
+            source="/empty-dir",
+            required=False,
+            selected='selected',
         ),
     ]
 
-    if DEPTARGET < '10.4' and not PYTHON_3:
+    if getDeptargetTuple() < (10, 4) and not PYTHON_3:
         result.append(
             dict(
                 name="PythonSystemFixes",
@@ -453,6 +523,7 @@
                 selected=unselected_for_python3,
             )
         )
+
     return result
 
 def fatal(msg):
@@ -567,20 +638,6 @@
                 % frameworks['Tk'],
             ]
 
-    # For 10.6+ builds, we build two versions of _tkinter:
-    #    - the traditional version (renamed to _tkinter_library.so) linked
-    #       with /Library/Frameworks/{Tcl,Tk}.framework
-    #    - the default version linked with our builtin copies of Tcl and Tk
-    if (DEPTARGET > '10.5') and (getVersionTuple() >= (3, 4)):
-        EXPECTED_SHARED_LIBS['_tkinter_library.so'] = \
-            EXPECTED_SHARED_LIBS['_tkinter.so']
-        EXPECTED_SHARED_LIBS['_tkinter.so'] = [
-                "/Library/Frameworks/Python.framework/Versions/%s/lib/libtcl%s.dylib"
-                    % (getVersion(), frameworks['Tcl']),
-                "/Library/Frameworks/Python.framework/Versions/%s/lib/libtk%s.dylib"
-                    % (getVersion(), frameworks['Tk']),
-                ]
-
     # Remove inherited environment variables which might influence build
     environ_var_prefixes = ['CPATH', 'C_INCLUDE_', 'DYLD_', 'LANG', 'LC_',
                             'LD_', 'LIBRARY_', 'PATH', 'PYTHON']
@@ -601,7 +658,10 @@
         base_path = base_path + ':' + OLD_DEVELOPER_TOOLS
     os.environ['PATH'] = base_path
     print("Setting default PATH: %s"%(os.environ['PATH']))
-
+    # Ensure ws have access to hg and to sphinx-build.
+    # You may have to create links in /usr/bin for them.
+    runCommand('hg --version')
+    runCommand('sphinx-build --version')
 
 def parseOptions(args=None):
     """
@@ -609,6 +669,7 @@
     """
     global WORKDIR, DEPSRC, SDKPATH, SRCDIR, DEPTARGET
     global UNIVERSALOPTS, UNIVERSALARCHS, ARCHLIST, CC, CXX
+    global FW_VERSION_PREFIX
 
     if args is None:
         args = sys.argv[1:]
@@ -666,21 +727,23 @@
     SDKPATH=os.path.abspath(SDKPATH)
     DEPSRC=os.path.abspath(DEPSRC)
 
-    CC, CXX=target_cc_map[DEPTARGET]
+    CC, CXX = getTargetCompilers()
 
-    print("Settings:")
-    print(" * Source directory:", SRCDIR)
-    print(" * Build directory: ", WORKDIR)
-    print(" * SDK location:    ", SDKPATH)
-    print(" * Third-party source:", DEPSRC)
-    print(" * Deployment target:", DEPTARGET)
-    print(" * Universal architectures:", ARCHLIST)
-    print(" * C compiler:", CC)
-    print(" * C++ compiler:", CXX)
+    FW_VERSION_PREFIX = FW_PREFIX[:] + ["Versions", getVersion()]
+
+    print("-- Settings:")
+    print("   * Source directory:    %s" % SRCDIR)
+    print("   * Build directory:     %s" % WORKDIR)
+    print("   * SDK location:        %s" % SDKPATH)
+    print("   * Third-party source:  %s" % DEPSRC)
+    print("   * Deployment target:   %s" % DEPTARGET)
+    print("   * Universal archs:     %s" % str(ARCHLIST))
+    print("   * C compiler:          %s" % CC)
+    print("   * C++ compiler:        %s" % CXX)
     print("")
-
-
-
+    print(" -- Building a Python %s framework at patch level %s"
+                % (getVersion(), getFullVersion()))
+    print("")
 
 def extractArchive(builddir, archiveName):
     """
@@ -772,6 +835,132 @@
                 % (shellQuote(fname), checksum) ):
         fatal('MD5 checksum mismatch for file %s' % fname)
 
+def build_universal_openssl(basedir, archList):
+    """
+    Special case build recipe for universal build of openssl.
+
+    The upstream OpenSSL build system does not directly support
+    OS X universal builds.  We need to build each architecture
+    separately then lipo them together into fat libraries.
+    """
+
+    # OpenSSL fails to build with Xcode 2.5 (on OS X 10.4).
+    # If we are building on a 10.4.x or earlier system,
+    # unilaterally disable assembly code building to avoid the problem.
+    no_asm = int(platform.release().split(".")[0]) < 9
+
+    def build_openssl_arch(archbase, arch):
+        "Build one architecture of openssl"
+        arch_opts = {
+            "i386": ["darwin-i386-cc"],
+            "x86_64": ["darwin64-x86_64-cc", "enable-ec_nistp_64_gcc_128"],
+            "ppc": ["darwin-ppc-cc"],
+            "ppc64": ["darwin64-ppc-cc"],
+        }
+        configure_opts = [
+            "no-krb5",
+            "no-idea",
+            "no-mdc2",
+            "no-rc5",
+            "no-zlib",
+            "enable-tlsext",
+            "no-ssl2",
+            "no-ssl3",
+            "no-ssl3-method",
+            # "enable-unit-test",
+            "shared",
+            "--install_prefix=%s"%shellQuote(archbase),
+            "--prefix=%s"%os.path.join("/", *FW_VERSION_PREFIX),
+            "--openssldir=/System/Library/OpenSSL",
+        ]
+        if no_asm:
+            configure_opts.append("no-asm")
+        runCommand(" ".join(["perl", "Configure"]
+                        + arch_opts[arch] + configure_opts))
+        runCommand("make depend OSX_SDK=%s" % SDKPATH)
+        runCommand("make all OSX_SDK=%s" % SDKPATH)
+        runCommand("make install_sw OSX_SDK=%s" % SDKPATH)
+        # runCommand("make test")
+        return
+
+    srcdir = os.getcwd()
+    universalbase = os.path.join(srcdir, "..",
+                        os.path.basename(srcdir) + "-universal")
+    os.mkdir(universalbase)
+    archbasefws = []
+    for arch in archList:
+        # fresh copy of the source tree
+        archsrc = os.path.join(universalbase, arch, "src")
+        shutil.copytree(srcdir, archsrc, symlinks=True)
+        # install base for this arch
+        archbase = os.path.join(universalbase, arch, "root")
+        os.mkdir(archbase)
+        # Python framework base within install_prefix:
+        # the build will install into this framework..
+        # This is to ensure that the resulting shared libs have
+        # the desired real install paths built into them.
+        archbasefw = os.path.join(archbase, *FW_VERSION_PREFIX)
+
+        # build one architecture
+        os.chdir(archsrc)
+        build_openssl_arch(archbase, arch)
+        os.chdir(srcdir)
+        archbasefws.append(archbasefw)
+
+    # copy arch-independent files from last build into the basedir framework
+    basefw = os.path.join(basedir, *FW_VERSION_PREFIX)
+    shutil.copytree(
+            os.path.join(archbasefw, "include", "openssl"),
+            os.path.join(basefw, "include", "openssl")
+            )
+
+    shlib_version_number = grepValue(os.path.join(archsrc, "Makefile"),
+            "SHLIB_VERSION_NUMBER")
+    #   e.g. -> "1.0.0"
+    libcrypto = "libcrypto.dylib"
+    libcrypto_versioned = libcrypto.replace(".", "."+shlib_version_number+".")
+    #   e.g. -> "libcrypto.1.0.0.dylib"
+    libssl = "libssl.dylib"
+    libssl_versioned = libssl.replace(".", "."+shlib_version_number+".")
+    #   e.g. -> "libssl.1.0.0.dylib"
+
+    try:
+        os.mkdir(os.path.join(basefw, "lib"))
+    except OSError:
+        pass
+
+    # merge the individual arch-dependent shared libs into a fat shared lib
+    archbasefws.insert(0, basefw)
+    for (lib_unversioned, lib_versioned) in [
+                (libcrypto, libcrypto_versioned),
+                (libssl, libssl_versioned)
+            ]:
+        runCommand("lipo -create -output " +
+                    " ".join(shellQuote(
+                            os.path.join(fw, "lib", lib_versioned))
+                                    for fw in archbasefws))
+        # and create an unversioned symlink of it
+        os.symlink(lib_versioned, os.path.join(basefw, "lib", lib_unversioned))
+
+    # Create links in the temp include and lib dirs that will be injected
+    # into the Python build so that setup.py can find them while building
+    # and the versioned links so that the setup.py post-build import test
+    # does not fail.
+    relative_path = os.path.join("..", "..", "..", *FW_VERSION_PREFIX)
+    for fn in [
+            ["include", "openssl"],
+            ["lib", libcrypto],
+            ["lib", libssl],
+            ["lib", libcrypto_versioned],
+            ["lib", libssl_versioned],
+        ]:
+        os.symlink(
+            os.path.join(relative_path, *fn),
+            os.path.join(basedir, "usr", "local", *fn)
+        )
+
+    return
+
 def buildRecipe(recipe, basedir, archList):
     """
     Build software using a recipe. This function does the
@@ -781,8 +970,10 @@
     curdir = os.getcwd()
 
     name = recipe['name']
+    THIRD_PARTY_LIBS.append(name)
     url = recipe['url']
     configure = recipe.get('configure', './configure')
+    buildrecipe = recipe.get('buildrecipe', None)
     install = recipe.get('install', 'make && make install DESTDIR=%s'%(
         shellQuote(basedir)))
 
@@ -854,7 +1045,7 @@
                         ' -arch '.join(archList),
                         shellQuote(SDKPATH)[1:-1],
                         shellQuote(basedir)[1:-1],),
-                "LDFLAGS=-mmacosx-version-min=%s -syslibroot,%s -L%s/usr/local/lib -arch %s"%(
+                "LDFLAGS=-mmacosx-version-min=%s -isysroot %s -L%s/usr/local/lib -arch %s"%(
                     DEPTARGET,
                     shellQuote(SDKPATH)[1:-1],
                     shellQuote(basedir)[1:-1],
@@ -880,8 +1071,13 @@
         print("Running configure for %s"%(name,))
         runCommand(' '.join(configure_args) + ' 2>&1')
 
-    print("Running install for %s"%(name,))
-    runCommand('{ ' + install + ' ;} 2>&1')
+    if buildrecipe is not None:
+        # call special-case build recipe, e.g. for openssl
+        buildrecipe(basedir, archList)
+
+    if install is not None:
+        print("Running install for %s"%(name,))
+        runCommand('{ ' + install + ' ;} 2>&1')
 
     print("Done %s"%(name,))
     print("")
@@ -914,8 +1110,10 @@
     docdir = os.path.join(rootDir, 'pydocs')
     curDir = os.getcwd()
     os.chdir(buildDir)
-    runCommand('make update')
-    runCommand("make html PYTHON='%s'" % os.path.abspath(sys.executable))
+    # The Doc build changed for 3.4 (technically, for 3.4.1) and for 2.7.9
+    runCommand('make clean')
+    # Assume sphinx-build is on our PATH, checked in checkEnvironment
+    runCommand('make html')
     os.chdir(curDir)
     if not os.path.exists(docdir):
         os.mkdir(docdir)
@@ -955,34 +1153,22 @@
     runCommand("%s -C --enable-framework --enable-universalsdk=%s "
                "--with-universal-archs=%s "
                "%s "
+               "%s "
                "LDFLAGS='-g -L%s/libraries/usr/local/lib' "
                "CFLAGS='-g -I%s/libraries/usr/local/include' 2>&1"%(
         shellQuote(os.path.join(SRCDIR, 'configure')), shellQuote(SDKPATH),
         UNIVERSALARCHS,
         (' ', '--with-computed-gotos ')[PYTHON_3],
+        (' ', '--without-ensurepip ')[PYTHON_3],
         shellQuote(WORKDIR)[1:-1],
         shellQuote(WORKDIR)[1:-1]))
 
+    print("Running make touch")
+    runCommand("make touch")
+
     print("Running make")
     runCommand("make")
 
-    # For deployment targets of 10.6 and higher, we build our own version
-    # of Tcl and Cocoa Aqua Tk libs because the Apple-supplied Tk 8.5 is
-    # out-of-date and has critical bugs.  Save the _tkinter.so that was
-    # linked with /Library/Frameworks/{Tck,Tk}.framework and build
-    # another _tkinter.so linked with our builtin Tcl and Tk libs.
-    if (DEPTARGET > '10.5') and (getVersionTuple() >= (3, 4)):
-        runCommand("find build -name '_tkinter.so' "
-                        " -execdir mv '{}' _tkinter_library.so \;")
-        print("Running make to build builtin _tkinter")
-        runCommand("make TCLTK_INCLUDES='-I%s/libraries/usr/local/include' "
-                "TCLTK_LIBS='-L%s/libraries/usr/local/lib -ltcl8.5 -ltk8.5'"%(
-            shellQuote(WORKDIR)[1:-1],
-            shellQuote(WORKDIR)[1:-1]))
-        # make a copy which will be moved to lib-tkinter later
-        runCommand("find build -name '_tkinter.so' "
-                        " -execdir cp -p '{}' _tkinter_builtin.so \;")
-
     print("Running make install")
     runCommand("make install DESTDIR=%s"%(
         shellQuote(rootDir)))
@@ -1007,27 +1193,11 @@
                                 'Python.framework', 'Versions',
                                 version, 'lib', 'python%s'%(version,))
 
-    # If we made multiple versions of _tkinter, move them to
-    # their own directories under python lib.  This allows
-    # users to select which to import by manipulating sys.path
-    # directly or with PYTHONPATH.
-
-    if (DEPTARGET > '10.5') and (getVersionTuple() >= (3, 4)):
-        TKINTERS = ['builtin', 'library']
-        tkinter_moves = [('_tkinter_' + tkn + '.so',
-                             os.path.join(path_to_lib, 'lib-tkinter', tkn))
-                         for tkn in TKINTERS]
-        # Create the destination directories under lib-tkinter.
-        # The permissions and uid/gid will be fixed up next.
-        for tkm in tkinter_moves:
-            os.makedirs(tkm[1])
-
     print("Fix file modes")
     frmDir = os.path.join(rootDir, 'Library', 'Frameworks', 'Python.framework')
     gid = grp.getgrnam('admin').gr_gid
 
     shared_lib_error = False
-    moves_list = []
     for dirpath, dirnames, filenames in os.walk(frmDir):
         for dn in dirnames:
             os.chmod(os.path.join(dirpath, dn), STAT_0o775)
@@ -1053,25 +1223,9 @@
                                 % (sl, p))
                         shared_lib_error = True
 
-            # If this is a _tkinter variant, move it to its own directory
-            # now that we have fixed its permissions and checked that it
-            # was linked properly.  The directory was created earlier.
-            # The files are moved after the entire tree has been walked
-            # since the shared library checking depends on the files
-            # having unique names.
-            if (DEPTARGET > '10.5') and (getVersionTuple() >= (3, 4)):
-                for tkm in tkinter_moves:
-                    if fn == tkm[0]:
-                        moves_list.append(
-                            (p, os.path.join(tkm[1], '_tkinter.so')))
-
     if shared_lib_error:
         fatal("Unexpected shared library errors.")
 
-    # Now do the moves.
-    for ml in moves_list:
-        shutil.move(ml[0], ml[1])
-
     if PYTHON_3:
         LDVERSION=None
         VERSION=None
@@ -1179,6 +1333,7 @@
     data = data.replace('$MACOSX_DEPLOYMENT_TARGET', ''.join((DEPTARGET, ' or later')))
     data = data.replace('$ARCHITECTURES', ", ".join(universal_opts_map[UNIVERSALARCHS]))
     data = data.replace('$INSTALL_SIZE', installSize())
+    data = data.replace('$THIRD_PARTY_LIBS', "\\\n".join(THIRD_PARTY_LIBS))
 
     # This one is not handy as a template variable
     data = data.replace('$PYTHONFRAMEWORKINSTALLDIR', '/Library/Frameworks/Python.framework')
@@ -1187,7 +1342,9 @@
     fp.close()
 
 def patchScript(inPath, outPath):
+    major, minor = getVersionMajorMinor()
     data = fileContents(inPath)
+    data = data.replace('@PYMAJOR@', str(major))
     data = data.replace('@PYVER@', getVersion())
     fp = open(outPath, 'w')
     fp.write(data)
@@ -1359,8 +1516,6 @@
         else:
             patchFile(os.path.join('resources', fn), os.path.join(rsrcDir, fn))
 
-    shutil.copy("../../LICENSE", os.path.join(rsrcDir, 'License.txt'))
-
 
 def installSize(clear=False, _saved=[]):
     if clear:
@@ -1468,12 +1623,14 @@
 
 
     # Prepare the applications folder
-    fn = os.path.join(WORKDIR, "_root", "Applications",
-                "Python %s"%(getVersion(),), "Update Shell Profile.command")
-    patchScript("scripts/postflight.patch-profile",  fn)
-
     folder = os.path.join(WORKDIR, "_root", "Applications", "Python %s"%(
         getVersion(),))
+    fn = os.path.join(folder, "License.rtf")
+    patchFile("resources/License.rtf",  fn)
+    fn = os.path.join(folder, "ReadMe.rtf")
+    patchFile("resources/ReadMe.rtf",  fn)
+    fn = os.path.join(folder, "Update Shell Profile.command")
+    patchScript("scripts/postflight.patch-profile",  fn)
     os.chmod(folder, STAT_0o755)
     setIcon(folder, "../Icons/Python Folder.icns")
 
@@ -1481,10 +1638,12 @@
     buildInstaller()
 
     # And copy the readme into the directory containing the installer
-    patchFile('resources/ReadMe.txt', os.path.join(WORKDIR, 'installer', 'ReadMe.txt'))
+    patchFile('resources/ReadMe.rtf',
+                os.path.join(WORKDIR, 'installer', 'ReadMe.rtf'))
 
     # Ditto for the license file.
-    shutil.copy('../../LICENSE', os.path.join(WORKDIR, 'installer', 'License.txt'))
+    patchFile('resources/License.rtf',
+                os.path.join(WORKDIR, 'installer', 'License.rtf'))
 
     fp = open(os.path.join(WORKDIR, 'installer', 'Build.txt'), 'w')
     fp.write("# BUILD INFO\n")
diff --git a/Mac/BuildScript/openssl_sdk_makedepend.patch b/Mac/BuildScript/openssl_sdk_makedepend.patch
new file mode 100644
index 0000000..a72f5a3
--- /dev/null
+++ b/Mac/BuildScript/openssl_sdk_makedepend.patch
@@ -0,0 +1,50 @@
+# openssl_sdk_makedepend.patch
+#
+# 	using openssl 1.0.1k
+#
+# - support building with an OS X SDK
+# - allow "make depend" to use compilers with names other than "gcc"
+
+diff Configure
+
+diff -r 99ae439a07f1 Configure
+--- a/Configure	Fri Jan 09 12:50:43 2015 -0800
++++ b/Configure	Fri Jan 09 12:53:52 2015 -0800
+@@ -577,11 +577,11 @@
+ 
+ ##### MacOS X (a.k.a. Rhapsody or Darwin) setup
+ "rhapsody-ppc-cc","cc:-O3 -DB_ENDIAN::(unknown):MACOSX_RHAPSODY::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}::",
+-"darwin-ppc-cc","cc:-arch ppc -O3 -DB_ENDIAN -Wa,-force_cpusubtype_ALL::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc32_asm}:osx32:dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
+-"darwin64-ppc-cc","cc:-arch ppc64 -O3 -DB_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc64_asm}:osx64:dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
+-"darwin-i386-cc","cc:-arch i386 -O3 -fomit-frame-pointer -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:".eval{my $asm=$x86_asm;$asm=~s/cast\-586\.o//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
+-"debug-darwin-i386-cc","cc:-arch i386 -g3 -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:${x86_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
+-"darwin64-x86_64-cc","cc:-arch x86_64 -O3 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$x86_64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
++"darwin-ppc-cc","cc:-arch ppc -isysroot \$(OSX_SDK) -O3 -DB_ENDIAN -Wa,-force_cpusubtype_ALL::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc32_asm}:osx32:dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
++"darwin64-ppc-cc","cc:-arch ppc64 -isysroot \$(OSX_SDK) -O3 -DB_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc64_asm}:osx64:dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
++"darwin-i386-cc","cc:-arch i386 -isysroot \$(OSX_SDK) -O3 -fomit-frame-pointer -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:".eval{my $asm=$x86_asm;$asm=~s/cast\-586\.o//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
++"debug-darwin-i386-cc","cc:-arch i386 -isysroot \$(OSX_SDK) -g3 -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:${x86_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
++"darwin64-x86_64-cc","cc:-arch x86_64 -isysroot \$(OSX_SDK) -O3 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$x86_64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
+ "debug-darwin-ppc-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DB_ENDIAN -g -Wall -O::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc32_asm}:osx32:dlfcn:darwin-shared:-fPIC:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
+ # iPhoneOS/iOS
+ "iphoneos-cross","llvm-gcc:-O3 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fomit-frame-pointer -fno-common::-D_REENTRANT:iOS:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
+@@ -1629,7 +1629,7 @@
+ 		s/^CC=.*$/CC= $cc/;
+ 		s/^AR=\s*ar/AR= $ar/;
+ 		s/^RANLIB=.*/RANLIB= $ranlib/;
+-		s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $cc eq "gcc";
++		s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/;
+ 		}
+ 	s/^CFLAG=.*$/CFLAG= $cflags/;
+ 	s/^DEPFLAG=.*$/DEPFLAG=$depflags/;
+diff -r 99ae439a07f1 util/domd
+--- a/util/domd	Fri Jan 09 12:50:43 2015 -0800
++++ b/util/domd	Fri Jan 09 12:53:52 2015 -0800
+@@ -14,7 +14,7 @@
+ cp Makefile Makefile.save
+ # fake the presence of Kerberos
+ touch $TOP/krb5.h
+-if expr "$MAKEDEPEND" : '.*gcc$' > /dev/null; then
++if true ; then  # was: if expr "$MAKEDEPEND" : '.*gcc$' > /dev/null; then
+     args=""
+     while [ $# -gt 0 ]; do
+ 	if [ "$1" != "--" ]; then args="$args $1"; fi
diff --git a/Mac/BuildScript/resources/License.rtf b/Mac/BuildScript/resources/License.rtf
new file mode 100644
index 0000000..fff4d5b
--- /dev/null
+++ b/Mac/BuildScript/resources/License.rtf
@@ -0,0 +1,142 @@
+{\rtf1\ansi\ansicpg1252\cocoartf1343\cocoasubrtf160
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fmodern\fcharset0 CourierNewPS-BoldMT;\f2\fmodern\fcharset0 CourierNewPSMT;
+}
+{\colortbl;\red255\green255\blue255;}
+\margl1440\margr1440\vieww14620\viewh13380\viewkind0
+\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
+
+\f0\b\fs36 \cf0 \ul \ulc0 HISTORY AND LICENSE\
+
+\fs24 \
+HISTORY OF THE SOFTWARE\
+
+\b0 \ulnone \
+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.\
+\
+
+\f1\b Release         Derived     Year        Owner       GPL-\
+                from                                compatible?\
+
+\f2\b0 \
+0.9.0 thru 1.2  n/a         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        no\
+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.1.2           2.1.1       2002        PSF         yes\
+2.1.3           2.1.2       2002        PSF         yes\
+2.2 and above   2.1.1       2001-now    PSF         yes\
+
+\f0 \
+
+\b Note:  
+\b0 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.\
+\
+Thanks to the many outside volunteers who have worked under Guido's direction to make these releases possible.\
+\
+\
+
+\b \ul TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON\
+
+\b0 \ulnone \
+
+\b PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2\
+
+\b0 \
+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, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 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.\
+\
+\
+
+\b BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0\
+
+\b0 \
+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.\
+\
+\
+
+\b CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1\
+
+\b0 \
+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\
+\
+\
+
+\b CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2\
+
+\b0 \
+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.\
+\
+\
+
+\b \ul LICENSES AND ACKNOWLEDGEMENTS FOR INCORPORATED SOFTWARE\
+
+\b0 \ulnone \
+This installer incorporates portions of the following third-party software:\
+\
+
+\f2 $THIRD_PARTY_LIBS\
+\
+
+\f0 For licenses and acknowledgements for these and other third-party software incorporated in this Python distribution, please refer to the on-line documentation {\field{\*\fldinst{HYPERLINK "https://docs.python.org/$VERSION/license.html#licenses-and-acknowledgements-for-incorporated-software"}}{\fldrslt here}}.\
+\
+\
+\
+\
+}
\ No newline at end of file
diff --git a/Mac/BuildScript/resources/ReadMe.rtf b/Mac/BuildScript/resources/ReadMe.rtf
new file mode 100644
index 0000000..1bbdc1a
--- /dev/null
+++ b/Mac/BuildScript/resources/ReadMe.rtf
@@ -0,0 +1,180 @@
+{\rtf1\ansi\ansicpg1252\cocoartf1343\cocoasubrtf160
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fmodern\fcharset0 CourierNewPSMT;}
+{\colortbl;\red255\green255\blue255;}
+\margl1440\margr1440\vieww13380\viewh14600\viewkind0
+\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
+
+\f0\fs24 \cf0 This package will install Python $FULL_VERSION for Mac OS X $MACOSX_DEPLOYMENT_TARGET for the following architecture(s): $ARCHITECTURES.\
+\
+\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
+
+\b \cf0 \ul \ulc0 Which installer variant should I use?
+\b0 \ulnone \
+\
+Python.org provides two installer variants for download: one that installs a 
+\i 64-bit/32-bit Intel
+\i0  Python capable of running on 
+\i Mac OS X 10.6 (Snow Leopard)
+\i0  or later; and one that installs a 
+\i 32-bit-only (Intel and PPC)
+\i0  Python capable of running on 
+\i Mac OS X 10.5 (Leopard)
+\i0  or later.  This ReadMe was installed with the 
+\i $MACOSX_DEPLOYMENT_TARGET
+\i0  variant.  Unless you are installing to an 10.5 system or you need to build applications that can run on 10.5 systems, use the 10.6 variant if possible.  There are some additional operating system functions that are supported starting with 10.6 and you may see better performance using 64-bit mode.  By default, Python will automatically run in 64-bit mode if your system supports it.  Also see 
+\i Certificate verification and OpenSSL
+\i0  below.
+\b \ul \
+\
+Update your version of Tcl/Tk to use IDLE or other Tk applications
+\b0 \ulnone \
+\
+To use IDLE or other programs that use the Tkinter graphical user interface toolkit, you need to install a newer third-party version of the 
+\i Tcl/Tk
+\i0  frameworks.  Visit {\field{\*\fldinst{HYPERLINK "https://www.python.org/download/mac/tcltk/"}}{\fldrslt https://www.python.org/download/mac/tcltk/}} for current information about supported and recommended versions of 
+\i Tcl/Tk
+\i0  for this version of Python and of Mac OS X.\
+
+\b \ul \
+Installing on OS X 10.8 (Mountain Lion) or later systems\
+\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
+\cf0 \ulnone [CHANGED for Python 3.4.2]
+\b0 \
+\
+As of Python 3.4.2, installer packages from python.org are now compatible with the Gatekeeper security feature introduced in OS X 10.8.   Downloaded packages can now be directly installed by double-clicking with the default system security settings.  Python.org installer packages for OS X are signed with the Developer ID of the builder, as identified on {\field{\*\fldinst{HYPERLINK "https://www.python.org/downloads/"}}{\fldrslt the download page}} for this release.  To inspect the digital signature of the package, click on the lock icon in the upper right corner of the 
+\i Install Python
+\i0  installer window.  Refer to Apple\'92s support pages for {\field{\*\fldinst{HYPERLINK "http://support.apple.com/kb/ht5290"}}{\fldrslt more information on Gatekeeper}}.\
+\
+\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
+
+\b \cf0 \ul Simplified web-based installs\
+\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
+\cf0 \ulnone [NEW for Python 3.4.2]
+\b0 \
+\
+With the change to the newer flat format installer package, the download file now has a 
+\f1 .pkg
+\f0  extension as it is no longer necessary to embed the installer within a disk image (
+\f1 .dmg
+\f0 ) container.   If you download the Python installer through a web browser, the OS X installer application may open automatically to allow you to perform the install.  If your browser settings do not allow automatic open, double click on the downloaded installer file.\
+\
+\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
+
+\b \cf0 \ul New Installation Options and Defaults\
+\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
+\cf0 \ulnone [NEW for Python 3.4.0]
+\b0 \
+\
+The Python installer now includes an option to automatically install or upgrade 
+\f1 pip
+\f0 , a tool for installing and managing Python packages.  This option is enabled by default and no Internet access is required.  If you do not want the installer to do this, select the 
+\i Customize
+\i0  option at the 
+\i Installation Type
+\i0  step and uncheck the 
+\i Install or ugprade pip
+\i0  option.\
+\
+To make it easier to use scripts installed by third-party Python packages, with 
+\f1 pip
+\f0  or by other means, the 
+\i Shell profile updater
+\i0  option is now enabled by default, as has been the case with Python 2.7.x installers. You can also turn this option off by selecting 
+\i Customize
+\i0  and unchecking the 
+\i Shell profile updater
+\i0  option. You can also update your shell profile later by launching the 
+\i Update Shell Profile
+\i0  command found in the 
+\f1 /Applications/Python $VERSION 
+\f0 folder.  You may need to start a new terminal window for the changes to take effect.\
+\
+For other changes in this release, see the Release Notes link for this release at {\field{\*\fldinst{HYPERLINK "https://www.python.org/downloads/"}}{\fldrslt https://www.python.org/downloads/}}.\
+\
+\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
+
+\b \cf0 \ul Certificate verification and OpenSSL\
+\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
+\cf0 \ulnone [CHANGED for Python 3.4.3]
+\b0 \
+\
+Python 3.4.3 includes a number of network security enhancements that have been approved for inclusion in Python 3.4 maintenance releases.  {\field{\*\fldinst{HYPERLINK "https://www.python.org/dev/peps/pep-0476/"}}{\fldrslt PEP 476}} changes several standard library modules, like 
+\i httplib
+\i0 , 
+\i urllib
+\i0 , and 
+\i xmlrpclib
+\i0 , to by default verify certificates presented by servers over secure (TLS) connections.  The verification is performed by the OpenSSL libraries that Python is linked to.  Prior to 3.4.3, the python.org installers dynamically linked with Apple-supplied OpenSSL libraries shipped with OS X.  OS X provides a multiple level security framework that stores trust certificates in system and user keychains managed by the 
+\i Keychain Access 
+\i0 application and the 
+\i security
+\i0  command line utility.\
+\
+For OS X 10.5, Apple provides 
+\i OpenSSL 0.9.7
+\i0  libraries.  This version of Apple's OpenSSL 
+\b does not
+\b0  use the certificates from the system security framework, even when used on newer versions of OS X.  Instead it consults a traditional OpenSSL concatenated certificate file (
+\i cafile
+\i0 ) or certificate directory (
+\i capath
+\i0 ), located in 
+\f1 /System/Library/OpenSSL
+\f0 .  These directories are typically empty and not managed by OS X; you must manage them yourself or supply your own SSL contexts.  OpenSSL 0.9.7 is obsolete by current security standards, lacking a number of important features found in later versions.  Among the problems this causes is the inability to verify higher-security certificates now used by python.org services, including 
+\i t{\field{\*\fldinst{HYPERLINK "https://pypi.python.org/pypi"}}{\fldrslt he Python Package Index, PyPI}}
+\i0 .  To solve this problem, as of 3.4.3 the 
+\i 10.5+ 32-bit-only python.org variant
+\i0  is linked with a private copy of 
+\i OpenSSL 1.0.1
+\i0 ; it consults the same default certificate directory, 
+\f1 /System/Library/OpenSSL
+\f0 .   As before, it is still necessary to manage certificates yourself when you use this Python variant and, with certificate verification now enabled by default, you may now need to take additional steps to ensure your Python programs have access to CA certificates you trust.  If you use this Python variant to build standalone applications with third-party tools like {\field{\*\fldinst{HYPERLINK "https://pypi.python.org/pypi/py2app/"}}{\fldrslt 
+\f1 py2app}}, you may now need to bundle CA certificates in them or otherwise supply non-default SSL contexts.\
+\
+For OS X 10.6+, Apple also provides 
+\i OpenSSL
+\i0  
+\i 0.9.8 libraries
+\i0 .  Apple's 0.9.8 version includes an important additional feature: if a certificate cannot be verified using the manually administered certificates in 
+\f1 /System/Library/OpenSSL
+\f0 , the certificates managed by the system security framework In the user and system keychains are also consulted (using Apple private APIs).  For this reason, for 3.4.3 the 
+\i 64-bit/32-bit 10.6+ python.org variant
+\i0  continues to be dynamically linked with Apple's OpenSSL 0.9.8 since it was felt that the loss of the system-provided certificates and management tools outweighs the additional security features provided by newer versions of OpenSSL.  This will likely change in future releases of the python.org installers as Apple has deprecated use of the system-supplied OpenSSL libraries.  If you do need features from newer versions of OpenSSL, there are third-party OpenSSL wrapper packages available through 
+\i PyPI
+\i0 .\
+\
+The bundled 
+\f1 pip
+\f0  included with 3.4.3 has its own default certificate store for verifying download connections.\
+\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
+
+\b \cf0 \ul \
+Python 3 and Python 2 Co-existence\
+
+\b0 \ulnone \
+Python.org Python $VERSION and 2.7.x versions can both be installed on your system and will not conflict. Command names for Python 3 contain a 3 in them, 
+\f1 python3
+\f0  (or
+\f1  python$VERSION
+\f0 ), 
+\f1 idle3
+\f0  (or i
+\f1 dle$VERSION
+\f0 ), 
+\f1 pip3
+\f0  (or 
+\f1 pip$VERSION
+\f0 ), etc.  Python 2.7 command names contain a 2 or no digit: 
+\f1 python2
+\f0  (or 
+\f1 python2.7
+\f0  or 
+\f1 python
+\f0 ), 
+\f1 idle2
+\f0  (or 
+\f1 idle2.7
+\f0  or 
+\f1 idle
+\f0 ), etc.\
+}
\ No newline at end of file
diff --git a/Mac/BuildScript/resources/ReadMe.txt b/Mac/BuildScript/resources/ReadMe.txt
deleted file mode 100644
index 212d963..0000000
--- a/Mac/BuildScript/resources/ReadMe.txt
+++ /dev/null
@@ -1,62 +0,0 @@
-This package will install Python $FULL_VERSION for Mac OS X
-$MACOSX_DEPLOYMENT_TARGET for the following architecture(s):
-$ARCHITECTURES.
-
-               **** IMPORTANT ****
-
-Installing on OS X 10.8 (Mountain Lion) or later systems
-========================================================
-
-If you are attempting to install on an OS X 10.8+ system, you may
-see a message that Python can't be installed because it is from an
-unidentified developer.  This is because this Python installer
-package is not yet compatible with the Gatekeeper security feature
-introduced in OS X 10.8.  To allow Python to be installed, you
-can override the Gatekeeper policy for this install.  In the Finder,
-instead of double-clicking, control-click or right click the "Python"
-installer package icon.  Then select "Open using ... Installer" from
-the contextual menu that appears.
-
-               **** IMPORTANT ****
-
-Update your version of Tcl/Tk to use IDLE or other Tk applications
-==================================================================
-
-To use IDLE or other programs that use the Tkinter graphical user
-interface toolkit, you may need to install a newer third-party version
-of the Tcl/Tk frameworks.  Visit http://www.python.org/download/mac/tcltk/
-for current information about supported and recommended versions of
-Tcl/Tk for this version of Python and of Mac OS X.
-
-
-Using this version of Python on OS X
-====================================
-
-Python consists of the Python programming language interpreter, plus
-a set of programs to allow easy access to it for Mac users including
-an integrated development environment, IDLE, plus a set of pre-built
-extension modules that open up specific Macintosh technologies to
-Python programs.
-
-The installer puts applications, an "Update Shell Profile" command,
-and a link to the optionally installed Python Documentation into the
-"Python $VERSION" subfolder of the system Applications folder,
-and puts the underlying machinery into the folder
-$PYTHONFRAMEWORKINSTALLDIR. It can
-optionally place links to the command-line tools in /usr/local/bin as
-well. Double-click on the "Update Shell Profile" command to add the
-"bin" directory inside the framework to your shell's search path.
-
-You must install onto your current boot disk, even though the
-installer may not enforce this, otherwise things will not work.
-
-You can verify the integrity of the disk image file containing the
-installer package and this ReadMe file by comparing its md5 checksum
-and size with the values published on the release page linked at
-http://www.python.org/download/
-
-Installation requires approximately $INSTALL_SIZE MB of disk space,
-ignore the message that it will take zero bytes.
-
-More information on Python in general can be found at
-http://www.python.org.
diff --git a/Mac/BuildScript/resources/Welcome.rtf b/Mac/BuildScript/resources/Welcome.rtf
index 239d76e..2527787 100644
--- a/Mac/BuildScript/resources/Welcome.rtf
+++ b/Mac/BuildScript/resources/Welcome.rtf
@@ -1,7 +1,7 @@
-{\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf400
-\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\rtf1\ansi\ansicpg1252\cocoartf1343\cocoasubrtf160
+\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fmodern\fcharset0 CourierNewPSMT;}
 {\colortbl;\red255\green255\blue255;}
-\paperw11905\paperh16837\margl1440\margr1440\vieww9640\viewh10620\viewkind0
+\paperw11905\paperh16837\margl1440\margr1440\vieww12200\viewh10880\viewkind0
 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640
 
 \f0\fs24 \cf0 This package will install 
@@ -14,15 +14,13 @@
 \b Python for Mac OS X
 \b0  consists of the Python programming language interpreter, plus a set of programs to allow easy access to it for Mac OS X users including an integrated development environment 
 \b IDLE
-\b0  and a set of pre-built extension modules that open up specific Macintosh technologies to Python programs.\
-\
-See the ReadMe file and the Python documentation for more information.\
+\b0 .\
 \
 
-\b NOTE: 
-\b0 This package will not update your shell profile by default.  Double-click 
-\b Update Shell Profile
-\b0  at any time to make $FULL_VERSION the default Python 3 version.  This version can co-exist with other installed versions of Python 3 and Python 2.\
+\b NEW for Python 3.4.3: 
+\b0  3.4.3 includes network security enhancements that may require changes to your Python applications.  See the 
+\f1 ReadMe
+\f0  file and {\field{\*\fldinst{HYPERLINK "https://docs.python.org/3/whatsnew/3.4.html#changed-in-3-4-3"}}{\fldrslt the Python documentation}} for more information.\
 \
 
 \b IMPORTANT:
@@ -32,4 +30,4 @@
 \b tkinter
 \b0  graphical user interface toolkit require specific versions of the 
 \b Tcl/Tk
-\b0  platform independent windowing toolkit.  Visit {\field{\*\fldinst{HYPERLINK "http://www.python.org/download/mac/tcltk/"}}{\fldrslt http://www.python.org/download/mac/tcltk/}} for current information on supported and recommended versions of Tcl/Tk for this version of Python and Mac OS X.}
\ No newline at end of file
+\b0  platform independent windowing toolkit.  Visit {\field{\*\fldinst{HYPERLINK "https://www.python.org/download/mac/tcltk/"}}{\fldrslt https://www.python.org/download/mac/tcltk/}} for current information on supported and recommended versions of Tcl/Tk for this version of Python and Mac OS X.}
\ No newline at end of file
diff --git a/Mac/BuildScript/scripts/postflight.ensurepip b/Mac/BuildScript/scripts/postflight.ensurepip
new file mode 100755
index 0000000..bf893d1
--- /dev/null
+++ b/Mac/BuildScript/scripts/postflight.ensurepip
@@ -0,0 +1,69 @@
+#!/bin/sh
+#
+# Install/upgrade pip.
+#
+
+PYVER="@PYVER@"
+PYMAJOR="@PYMAJOR@"
+FWK="/Library/Frameworks/Python.framework/Versions/${PYVER}"
+RELFWKBIN="../../..${FWK}/bin"
+
+umask 022
+
+"${FWK}/bin/python${PYVER}" -m ensurepip --upgrade
+
+"${FWK}/bin/python${PYVER}" -Wi \
+    "${FWK}/lib/python${PYVER}/compileall.py" \
+    -f -x badsyntax \
+    "${FWK}/lib/python${PYVER}/site-packages"
+
+"${FWK}/bin/python${PYVER}" -Wi -O \
+    "${FWK}/lib/python${PYVER}/compileall.py" \
+    -f -x badsyntax \
+    "${FWK}/lib/python${PYVER}/site-packages"
+
+chgrp -R admin "${FWK}/lib/python${PYVER}/site-packages" "${FWK}/bin"
+chmod -R g+w "${FWK}/lib/python${PYVER}/site-packages" "${FWK}/bin"
+
+# We do not know if the user selected the Python command-line tools
+# package that installs symlinks to /usr/local/bin.  So we assume
+# that the command-line tools package has already completed or was
+# not selected and we will only install /usr/local/bin symlinks for
+# pip et al if there are /usr/local/bin/python* symlinks to our
+# framework bin directory.
+
+if [ -d /usr/local/bin ] ; then
+    (
+        install_links_if_our_fw() {
+            if [ "$(readlink -n ./$1)" = "${RELFWKBIN}/$1" ] ; then
+                shift
+                for fn ;
+                do
+                    if [ -e "${RELFWKBIN}/${fn}" ] ; then
+                        rm -f ./${fn}
+                        ln -s "${RELFWKBIN}/${fn}" "./${fn}"
+                        chgrp -h admin "./${fn}"
+                        chmod -h g+w "./${fn}"
+                    fi
+                done
+            fi
+        }
+
+        cd /usr/local/bin
+
+        # Create pipx.y and easy_install-x.y links if /usr/local/bin/pythonx.y
+        #   is linked to this framework version
+        install_links_if_our_fw "python${PYVER}" \
+                                    "pip${PYVER}" "easy_install-${PYVER}"
+
+        # Create pipx link if /usr/local/bin/pythonx is linked to this version
+        install_links_if_our_fw "python${PYMAJOR}" \
+                                    "pip${PYMAJOR}"
+
+        # Create pip and easy_install link if /usr/local/bin/python
+        #   is linked to this version
+        install_links_if_our_fw "python" \
+                                    "pip" "easy_install"
+    )
+fi
+exit 0
diff --git a/Mac/IDLE/IDLE.app/Contents/Info.plist b/Mac/IDLE/IDLE.app/Contents/Info.plist
index d0257ba..9538c06 100644
--- 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-2014 Python Software Foundation</string>
+	<string>%version%, © 2001-2015 Python Software Foundation</string>
 	<key>CFBundleIconFile</key>
 	<string>IDLE.icns</string>
 	<key>CFBundleIdentifier</key>
diff --git a/Mac/Makefile.in b/Mac/Makefile.in
index 5cb664d..03ec738 100644
--- a/Mac/Makefile.in
+++ b/Mac/Makefile.in
@@ -3,9 +3,13 @@
 # commandline in that case.
 
 VERSION=@VERSION@
+ABIFLAGS=@ABIFLAGS@
+LDVERSION=@LDVERSION@
+ENSUREPIP=@ENSUREPIP@
 builddir = ..
 srcdir=@srcdir@
 prefix=@prefix@
+exec_prefix=@exec_prefix@
 LIBDEST=$(prefix)/lib/python$(VERSION)
 RUNSHARED=@RUNSHARED@
 BUILDEXE=@BUILDEXEEXT@
@@ -23,7 +27,7 @@
 
 
 # These are normally glimpsed from the previous set
-bindir=$(prefix)/bin
+BINDIR=		@bindir@
 PYTHONAPPSDIR=@FRAMEWORKINSTALLAPPSPREFIX@/$(PYTHONFRAMEWORK) $(VERSION)
 APPINSTALLDIR=$(prefix)/Resources/Python.app
 
@@ -46,19 +50,7 @@
 APPSUBDIRS=MacOS Resources
 compileall=$(srcdir)/../Lib/compileall.py
 
-installapps: install_Python install_pythonw install_PythonLauncher install_IDLE
-
-install_pythonw: pythonw
-	$(INSTALL_PROGRAM) $(STRIPFLAG) pythonw "$(DESTDIR)$(prefix)/bin/pythonw$(VERSION)"
-	$(INSTALL_PROGRAM) $(STRIPFLAG) pythonw "$(DESTDIR)$(prefix)/bin/python$(VERSION)"
-	ln -sf python$(VERSION) "$(DESTDIR)$(prefix)/bin/python3"
-	ln -sf pythonw$(VERSION) "$(DESTDIR)$(prefix)/bin/pythonw3"
-ifneq ($(LIPO_32BIT_FLAGS),)
-	lipo $(LIPO_32BIT_FLAGS) -output $(DESTDIR)$(prefix)/bin/python$(VERSION)-32 pythonw
-	lipo $(LIPO_32BIT_FLAGS) -output $(DESTDIR)$(prefix)/bin/pythonw$(VERSION)-32 pythonw
-	ln -sf pythonw$(VERSION)-32	"$(DESTDIR)$(prefix)/bin/pythonw3-32"
-	ln -sf python$(VERSION)-32	"$(DESTDIR)$(prefix)/bin/python3-32"
-endif
+installapps: install_Python install_PythonLauncher install_IDLE
 
 #
 # Install unix tools in /usr/local/bin. These are just aliases for the 
@@ -68,21 +60,49 @@
 	if [ ! -d "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" ]; then  \
 		$(INSTALL) -d -m $(DIRMODE) "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" ;\
 	fi
-	for fn in python3 pythonw3 idle3 pydoc3 python3-config \
-		  python$(VERSION) pythonw$(VERSION) idle$(VERSION) \
-		  pydoc$(VERSION) python$(VERSION)-config 2to3 \
-		  2to3-$(VERSION) pyvenv pyvenv-$(VERSION) ;\
+	cd "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" && \
+	for fn in \
+			2to3 \
+			idle3 \
+			pydoc3 \
+			python3 \
+			python3-config \
+			pyvenv \
+			; \
 	do \
-		ln -fs "$(prefix)/bin/$${fn}" "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin/$${fn}" ;\
+		rm -f $${fn} ; \
+		$(LN) -s $(BINDIR)/$${fn} $${fn} ;\
 	done
-ifneq ($(LIPO_32BIT_FLAGS),)
-	for fn in python3-32 pythonw3-32 \
-		  python$(VERSION)-32 pythonw$(VERSION)-32 ;\
-	do \
-		ln -fs "$(prefix)/bin/$${fn}" "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin/$${fn}" ;\
-	done
-endif
-
+	-if test "x$(VERSION)" != "x$(LDVERSION)"; then \
+		cd "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" && \
+		for fn in \
+				python$(VERSION)-config \
+				; \
+		do \
+			rm -f $${fn} ;\
+			$(LN) -s $(BINDIR)/$${fn} $${fn} ;\
+		done ;\
+	fi
+	-if test "x$(LIPO_32BIT_FLAGS)" != "x"; then \
+		cd "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" && \
+		for fn in \
+				python3-32 \
+				; \
+		do \
+			rm -f $${fn} ;\
+			$(LN) -s $(BINDIR)/$${fn} $${fn} ;\
+		done ;\
+	fi
+	-if test "x$(ENSUREPIP)" != "xno"  ; then \
+		cd "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" && \
+		for fn in \
+				pip3 \
+				; \
+		do \
+			rm -f $${fn} ;\
+			$(LN) -s $(BINDIR)/$${fn} $${fn} ;\
+		done ;\
+	fi
 
 #
 # Like installunixtools, but only install links to the versioned binaries.
@@ -91,20 +111,55 @@
 	if [ ! -d "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" ]; then  \
 		$(INSTALL) -d -m $(DIRMODE) "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" ;\
 	fi
-	for fn in python$(VERSION) pythonw$(VERSION) idle$(VERSION) \
-		  pydoc$(VERSION) python$(VERSION)-config 2to3-$(VERSION) pyvenv-$(VERSION) ;\
+	cd "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" && \
+	for fn in \
+			2to3-$(VERSION) \
+			idle$(VERSION) \
+			pydoc$(VERSION) \
+			python$(VERSION) \
+			python$(LDVERSION)-config \
+			pyvenv-$(VERSION) \
+			; \
 	do \
-		ln -fs "$(prefix)/bin/$${fn}" "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin/$${fn}" ;\
+		rm -f $${fn} ;\
+		$(LN) -s $(BINDIR)/$${fn} $${fn} ;\
 	done
-ifneq ($(LIPO_32BIT_FLAGS),)
-	for fn in python$(VERSION)-32 pythonw$(VERSION)-32 ;\
-	do \
-		ln -fs "$(prefix)/bin/$${fn}" "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin/$${fn}" ;\
-	done
-endif
+	-if test "x$(VERSION)" != "x$(LDVERSION)"; then \
+		cd "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" && \
+		for fn in \
+				python$(LDVERSION) \
+				; \
+		do \
+			rm -f $${fn} ;\
+			$(LN) -s $(BINDIR)/$${fn} $${fn} ;\
+		done ;\
+	fi
+	-if test "x$(LIPO_32BIT_FLAGS)" != "x"; then \
+		cd "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" && \
+		for fn in \
+				python$(VERSION)-32 \
+				; \
+		do \
+			rm -f $${fn} ;\
+			$(LN) -s $(BINDIR)/$${fn} $${fn} ;\
+		done ;\
+	fi
+	-if test "x$(ENSUREPIP)" != "xno"  ; then \
+		cd "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" && \
+		for fn in \
+				easy_install-$(VERSION) \
+				pip$(VERSION) \
+				; \
+		do \
+			rm -f $${fn} ;\
+			$(LN) -s $(BINDIR)/$${fn} $${fn} ;\
+		done ;\
+	fi
 
 pythonw: $(srcdir)/Tools/pythonw.c Makefile
-	$(CC) $(LDFLAGS) -DPYTHONFRAMEWORK='"$(PYTHONFRAMEWORK)"' -o $@ $(srcdir)/Tools/pythonw.c -I.. -I$(srcdir)/../Include ../$(PYTHONFRAMEWORK).framework/Versions/$(VERSION)/$(PYTHONFRAMEWORK)
+	$(CC) $(LDFLAGS) -DPYTHONFRAMEWORK='"$(PYTHONFRAMEWORK)"' -o $@ \
+		$(srcdir)/Tools/pythonw.c -I.. -I$(srcdir)/../Include \
+		../$(PYTHONFRAMEWORK).framework/Versions/$(VERSION)/$(PYTHONFRAMEWORK)
 
 install_PythonLauncher:
 	cd PythonLauncher && make install DESTDIR=$(DESTDIR)
diff --git a/Mac/PythonLauncher/Info.plist.in b/Mac/PythonLauncher/Info.plist.in
index 0a5a439..42846ea 100644
--- 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-2014 Python Software Foundation</string>
+	<string>%VERSION%, © 2001-2015 Python Software Foundation</string>
 	<key>CFBundleIconFile</key>
 	<string>PythonLauncher.icns</string>
 	<key>CFBundleIdentifier</key>
diff --git a/Mac/PythonLauncher/Makefile.in b/Mac/PythonLauncher/Makefile.in
index 970b83f..f05efdf 100644
--- a/Mac/PythonLauncher/Makefile.in
+++ b/Mac/PythonLauncher/Makefile.in
@@ -53,8 +53,6 @@
 		--resource=$(srcdir)/factorySettings.plist \
 		--plist Info.plist \
 		build
-	find "Python Launcher.app" -name '.svn' -print0 | xargs -0 rm -r
-		
 
 FileSettings.o: $(srcdir)/FileSettings.m
 	$(CC) $(CFLAGS) -o $@ -c $(srcdir)/FileSettings.m
diff --git a/Mac/README b/Mac/README
index 8d4eb3b..0a313d1 100644
--- a/Mac/README
+++ b/Mac/README
@@ -7,11 +7,14 @@
     Ronald Oussoren (2010-04),
     Ned Deily (2012-06)
 
-:Version: 3.3.0
+:Version: 3.4.0
 
 This document provides a quick overview of some Mac OS X specific features in
 the Python distribution.
 
+OS X specific arguments to configure
+====================================
+
 * ``--enable-framework[=DIR]``
 
   If this argument is specified the build will create a Python.framework rather
@@ -106,6 +109,8 @@
 
   * ``intel``:	  ``i386``, ``x86_64``
 
+  * ``intel-32``: ``i386``
+
   * ``32-bit``:   ``ppc``, ``i386``
 
   * ``3-way``:	  ``i386``, ``x86_64``, ``ppc``
@@ -119,7 +124,7 @@
 only be built with an 10.5 SDK because ``ppc64`` support was only included with
 OS X 10.5.  Although legacy ``ppc`` support was included with Xcode 3 on OS X
 10.6, it was removed in Xcode 4, versions of which were released on OS X 10.6
-and which is the current standard for OS X 10.7 and 10.8.  To summarize, the
+and which is the standard for OS X 10.7.  To summarize, the
 following combinations of SDKs and universal-archs flavors are available:
 
   * 10.4u SDK with Xcode 2 supports ``32-bit`` only
@@ -132,7 +137,9 @@
 
   * 10.7 and 10.8 SDKs with Xcode 4 support ``intel`` only
 
-The makefile for a framework build will also install ``python3.3-32``
+  * 10.8 and 10.9 SDKs with Xcode 5 support ``intel`` only
+
+The makefile for a framework build will also install ``python3.4-32``
 binaries when the universal architecture includes at least one 32-bit
 architecture (that is, for all flavors but ``64-bit``).
 
@@ -156,10 +163,9 @@
 not automatically carry through to subprocesses launched by programs and tests
 under that Python.  If you want to ensure that Python interpreters launched in
 subprocesses also run in 32-bit-mode if the main interpreter does, use
-a ``python3.3-32`` binary and use the value of ``sys.executable`` as the
+a ``python3.4-32`` binary and use the value of ``sys.executable`` as the
 ``subprocess`` ``Popen`` executable value.
 
-
 Building and using a framework-based Python on Mac OS X.
 ========================================================
 
@@ -169,14 +175,14 @@
 
 The main reason is because you want to create GUI programs in Python. With the
 exception of X11/XDarwin-based GUI toolkits all GUI programs need to be run 
-from a Mac OSX application bundle (".app").
+from a Mac OS X application bundle (".app").
 
 While it is technically possible to create a .app without using frameworks you
 will have to do the work yourself if you really want this.
 
 A second reason for using frameworks is that they put Python-related items in
 only two places: "/Library/Framework/Python.framework" and 
-"/Applications/Python <VERSION>" where ``<VERSION>`` can be e.g. "3.3",
+"/Applications/Python <VERSION>" where ``<VERSION>`` can be e.g. "3.4",
 "2.7", etc.  This simplifies matters for users installing
 Python from a binary distribution if they want to get rid of it again. Moreover,
 due to the way frameworks work, a user without admin privileges can install a
@@ -194,7 +200,7 @@
 3. Do I need extra packages?
 ----------------------------
 
-Yes, probably.  If you want Tkinter support you need to get the OSX AquaTk 
+Yes, probably.  If you want Tkinter support you need to get the OS X AquaTk
 distribution, this is installed by default on Mac OS X 10.4 or later.  Be
 aware, though, that the Cocoa-based AquaTk's supplied starting with OS X
 10.6 have proven to be unstable.  If possible, you should consider
@@ -210,9 +216,9 @@
 -------------------------------------
 
 This directory contains a Makefile that will create a couple of python-related
-applications (full-blown OSX .app applications, that is) in
+applications (full-blown OS X .app applications, that is) in
 "/Applications/Python <VERSION>", and a hidden helper application Python.app
-inside the Python.framework, and unix tools "python" and "pythonw" into
+inside the Python.framework, and unix tools including "python" into
 /usr/local/bin.  In addition it has a target "installmacsubtree" that installs
 the relevant portions of the Mac subtree into the Python.framework.
 
@@ -250,18 +256,18 @@
 "IDLE.app" is an integrated development environment for Python: editor,
 debugger, etc.
 
-"PythonLauncher.app" is a helper application that will handle things when you
+"Python Launcher.app" is a helper application that will handle things when you
 double-click a .py, .pyc or .pyw file. For the first two it creates a Terminal
 window and runs the scripts with the normal command-line Python. For the
 latter it runs the script in the Python.app interpreter so the script can do
 GUI-things. Keep the ``Option`` key depressed while dragging or double-clicking
 a script to set runtime options. These options can be set persistently
-through PythonLauncher's preferences dialog.
+through Python Launcher's preferences dialog.
 
-The program ``pythonx.x`` runs python scripts from the command line.  Various
-compatibility aliases are also installed, including ``pythonwx.x`` which
-in early releases of Python on OS X was required to run GUI programs.  In
-current releases, the ``pythonx.x`` and ``pythonwx.x`` commands are identical.
+The program ``pythonx.x`` runs python scripts from the command line.
+Previously, various compatibility aliases were also installed, including
+``pythonwx.x`` which in early releases of Python on OS X was required to run
+GUI programs.  As of 3.4.0, the ``pythonwx.x`` aliases are no longer installed.
 
 How do I create a binary distribution?
 ======================================
@@ -306,7 +312,7 @@
    configure: WARNING: libintl.h:     check for missing prerequisite headers?
    configure: WARNING: libintl.h: see the Autoconf documentation
    configure: WARNING: libintl.h:     section "Present But Cannot Be Compiled"
-   configure: WARNING: libintl.h: proceeding with the preprocessor's result   
+   configure: WARNING: libintl.h: proceeding with the preprocessor's result
    configure: WARNING: libintl.h: in the future, the compiler will take precedence
    configure: WARNING:     ## -------------------------------------- ##
    configure: WARNING:     ## Report this to http://bugs.python.org/ ##
diff --git a/Mac/Resources/app/Info.plist.in b/Mac/Resources/app/Info.plist.in
index 93b1c44..cb7e8d7 100644
--- 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-2014 Python Software Foundation.</string>
+	<string>%version%, (c) 2001-2015 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-2014 Python Software Foundation.</string>
+	<string>%version%, (c) 2001-2015 Python Software Foundation.</string>
 	<key>CFBundleName</key>
 	<string>Python</string>
 	<key>CFBundlePackageType</key>
@@ -55,7 +55,7 @@
 	<key>NSAppleScriptEnabled</key>
 	<true/>
 	<key>NSHumanReadableCopyright</key>
-	<string>(c) 2014 Python Software Foundation.</string>
+	<string>(c) 2001-2015 Python Software Foundation.</string>
 	<key>NSHighResolutionCapable</key>
 	<true/>
 </dict>
diff --git a/Mac/Resources/framework/Info.plist.in b/Mac/Resources/framework/Info.plist.in
index 43a5740..a97cc1f 100644
--- 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-2014 Python Software Foundation.</string>
+	<string>%VERSION%, (c) 2001-2015 Python Software Foundation.</string>
 	<key>CFBundleLongVersionString</key>
-	<string>%VERSION%, (c) 2004-2014 Python Software Foundation.</string>
+	<string>%VERSION%, (c) 2001-2015 Python Software Foundation.</string>
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
diff --git a/Mac/Tools/Doc/HelpIndexingTool/Help_Indexing_Tool_Suite.py b/Mac/Tools/Doc/HelpIndexingTool/Help_Indexing_Tool_Suite.py
deleted file mode 100644
index 9b3ace4..0000000
--- a/Mac/Tools/Doc/HelpIndexingTool/Help_Indexing_Tool_Suite.py
+++ /dev/null
@@ -1,110 +0,0 @@
-"""Suite Help Indexing Tool Suite: Special events that just the Help Indexing Tool supports.
-Level 0, version 0
-
-Generated from /Developer/Applications/Apple Help Indexing Tool.app
-AETE/AEUT resource version 1/1, language 0, script 0
-"""
-
-import aetools
-import MacOS
-
-_code = 'HIT '
-
-class Help_Indexing_Tool_Suite_Events:
-
-    def turn_anchor_indexing(self, _object, _attributes={}, **_arguments):
-        """turn anchor indexing: Turns anchor indexing on or off.
-        Required argument: \xd2on\xd3 or \xd2off\xd3, to turn anchor indexing on or off
-        Keyword argument _attributes: AppleEvent attribute dictionary
-        """
-        _code = 'HIT '
-        _subcode = 'tAnc'
-
-        if _arguments: raise TypeError('No optional args expected')
-        _arguments['----'] = _object
-
-
-        _reply, _arguments, _attributes = self.send(_code, _subcode,
-                _arguments, _attributes)
-        if _arguments.get('errn', 0):
-            raise aetools.Error(aetools.decodeerror(_arguments))
-        # XXXX Optionally decode result
-        if _arguments.has_key('----'):
-            return _arguments['----']
-
-    _argmap_turn_remote_root = {
-        'with_root_url' : 'rURL',
-    }
-
-    def turn_remote_root(self, _object, _attributes={}, **_arguments):
-        """turn remote root: Turn usage of remote root for content on the web on or off. If turning \xd2on\xd3, supply a string as second parameter.
-        Required argument: \xd2on\xd3 or \xd2off\xd3, to turn remote root on or off
-        Keyword argument with_root_url: The remote root to use, in the form of \xd2http://www.apple.com/help/\xd3.
-        Keyword argument _attributes: AppleEvent attribute dictionary
-        """
-        _code = 'HIT '
-        _subcode = 'tRem'
-
-        aetools.keysubst(_arguments, self._argmap_turn_remote_root)
-        _arguments['----'] = _object
-
-
-        _reply, _arguments, _attributes = self.send(_code, _subcode,
-                _arguments, _attributes)
-        if _arguments.get('errn', 0):
-            raise aetools.Error(aetools.decodeerror(_arguments))
-        # XXXX Optionally decode result
-        if _arguments.has_key('----'):
-            return _arguments['----']
-
-    def use_tokenizer(self, _object, _attributes={}, **_arguments):
-        """use tokenizer: Tells the indexing tool which tokenizer to use.
-        Required argument: Specify \xd2English\xd3, \xd2European\xd3, \xd2Japanese\xd3, \xd2Korean\xd3, or \xd2Simple\xd3.
-        Keyword argument _attributes: AppleEvent attribute dictionary
-        """
-        _code = 'HIT '
-        _subcode = 'uTok'
-
-        if _arguments: raise TypeError('No optional args expected')
-        _arguments['----'] = _object
-
-
-        _reply, _arguments, _attributes = self.send(_code, _subcode,
-                _arguments, _attributes)
-        if _arguments.get('errn', 0):
-            raise aetools.Error(aetools.decodeerror(_arguments))
-        # XXXX Optionally decode result
-        if _arguments.has_key('----'):
-            return _arguments['----']
-
-
-class application(aetools.ComponentItem):
-    """application - Application class """
-    want = 'capp'
-class _Prop_idleStatus(aetools.NProperty):
-    """idleStatus -  """
-    which = 'sIdl'
-    want = 'bool'
-application._superclassnames = []
-application._privpropdict = {
-    'idleStatus' : _Prop_idleStatus,
-}
-application._privelemdict = {
-}
-
-#
-# Indices of types declared in this module
-#
-_classdeclarations = {
-    'capp' : application,
-}
-
-_propdeclarations = {
-    'sIdl' : _Prop_idleStatus,
-}
-
-_compdeclarations = {
-}
-
-_enumdeclarations = {
-}
diff --git a/Mac/Tools/Doc/HelpIndexingTool/Miscellaneous_Standards.py b/Mac/Tools/Doc/HelpIndexingTool/Miscellaneous_Standards.py
deleted file mode 100644
index 616ae70..0000000
--- a/Mac/Tools/Doc/HelpIndexingTool/Miscellaneous_Standards.py
+++ /dev/null
@@ -1,49 +0,0 @@
-"""Suite Miscellaneous Standards: Useful events that aren\xd5t in any other suite
-Level 0, version 0
-
-Generated from /Developer/Applications/Apple Help Indexing Tool.app
-AETE/AEUT resource version 1/1, language 0, script 0
-"""
-
-import aetools
-import MacOS
-
-_code = 'misc'
-
-class Miscellaneous_Standards_Events:
-
-    def revert(self, _object, _attributes={}, **_arguments):
-        """revert: Revert an object to the most recently saved version
-        Required argument: object to revert
-        Keyword argument _attributes: AppleEvent attribute dictionary
-        """
-        _code = 'misc'
-        _subcode = 'rvrt'
-
-        if _arguments: raise TypeError('No optional args expected')
-        _arguments['----'] = _object
-
-
-        _reply, _arguments, _attributes = self.send(_code, _subcode,
-                _arguments, _attributes)
-        if _arguments.get('errn', 0):
-            raise aetools.Error(aetools.decodeerror(_arguments))
-        # XXXX Optionally decode result
-        if _arguments.has_key('----'):
-            return _arguments['----']
-
-
-#
-# Indices of types declared in this module
-#
-_classdeclarations = {
-}
-
-_propdeclarations = {
-}
-
-_compdeclarations = {
-}
-
-_enumdeclarations = {
-}
diff --git a/Mac/Tools/Doc/HelpIndexingTool/Required_Suite.py b/Mac/Tools/Doc/HelpIndexingTool/Required_Suite.py
deleted file mode 100644
index eb9fee0..0000000
--- a/Mac/Tools/Doc/HelpIndexingTool/Required_Suite.py
+++ /dev/null
@@ -1,32 +0,0 @@
-"""Suite Required Suite: Terms that every application should support
-Level 1, version 1
-
-Generated from /Developer/Applications/Apple Help Indexing Tool.app
-AETE/AEUT resource version 1/1, language 0, script 0
-"""
-
-import aetools
-import MacOS
-
-_code = 'reqd'
-
-from StdSuites.Required_Suite import *
-class Required_Suite_Events(Required_Suite_Events):
-
-    pass
-
-
-#
-# Indices of types declared in this module
-#
-_classdeclarations = {
-}
-
-_propdeclarations = {
-}
-
-_compdeclarations = {
-}
-
-_enumdeclarations = {
-}
diff --git a/Mac/Tools/Doc/HelpIndexingTool/Standard_Suite.py b/Mac/Tools/Doc/HelpIndexingTool/Standard_Suite.py
deleted file mode 100644
index 7f0b63a..0000000
--- a/Mac/Tools/Doc/HelpIndexingTool/Standard_Suite.py
+++ /dev/null
@@ -1,343 +0,0 @@
-"""Suite Standard Suite: Common terms for most applications
-Level 1, version 1
-
-Generated from /Developer/Applications/Apple Help Indexing Tool.app
-AETE/AEUT resource version 1/1, language 0, script 0
-"""
-
-import aetools
-import MacOS
-
-_code = 'CoRe'
-
-from StdSuites.Standard_Suite import *
-class Standard_Suite_Events(Standard_Suite_Events):
-
-    _argmap_close = {
-        'saving' : 'savo',
-        'in_' : 'kfil',
-    }
-
-    def close(self, _object, _attributes={}, **_arguments):
-        """close: Close an object
-        Required argument: the objects to close
-        Keyword argument saving: specifies whether or not changes should be saved before closing
-        Keyword argument in_: the file in which to save the object
-        Keyword argument _attributes: AppleEvent attribute dictionary
-        """
-        _code = 'core'
-        _subcode = 'clos'
-
-        aetools.keysubst(_arguments, self._argmap_close)
-        _arguments['----'] = _object
-
-        aetools.enumsubst(_arguments, 'savo', _Enum_savo)
-
-        _reply, _arguments, _attributes = self.send(_code, _subcode,
-                _arguments, _attributes)
-        if _arguments.get('errn', 0):
-            raise aetools.Error(aetools.decodeerror(_arguments))
-        # XXXX Optionally decode result
-        if _arguments.has_key('----'):
-            return _arguments['----']
-
-    def data_size(self, _object, _attributes={}, **_arguments):
-        """data size: Return the size in bytes of an object
-        Required argument: the object whose data size is to be returned
-        Keyword argument _attributes: AppleEvent attribute dictionary
-        Returns: the size of the object in bytes
-        """
-        _code = 'core'
-        _subcode = 'dsiz'
-
-        if _arguments: raise TypeError('No optional args expected')
-        _arguments['----'] = _object
-
-
-        _reply, _arguments, _attributes = self.send(_code, _subcode,
-                _arguments, _attributes)
-        if _arguments.get('errn', 0):
-            raise aetools.Error(aetools.decodeerror(_arguments))
-        # XXXX Optionally decode result
-        if _arguments.has_key('----'):
-            return _arguments['----']
-
-    def get(self, _object, _attributes={}, **_arguments):
-        """get: Get the data for an object
-        Required argument: the object whose data is to be returned
-        Keyword argument _attributes: AppleEvent attribute dictionary
-        Returns: The data from the object
-        """
-        _code = 'core'
-        _subcode = 'getd'
-
-        if _arguments: raise TypeError('No optional args expected')
-        _arguments['----'] = _object
-
-
-        _reply, _arguments, _attributes = self.send(_code, _subcode,
-                _arguments, _attributes)
-        if _arguments.get('errn', 0):
-            raise aetools.Error(aetools.decodeerror(_arguments))
-        # XXXX Optionally decode result
-        if _arguments.has_key('----'):
-            return _arguments['----']
-
-    _argmap_make = {
-        'new' : 'kocl',
-        'at' : 'insh',
-        'with_data' : 'data',
-        'with_properties' : 'prdt',
-    }
-
-    def make(self, _no_object=None, _attributes={}, **_arguments):
-        """make: Make a new element
-        Keyword argument new: the class of the new element
-        Keyword argument at: the location at which to insert the element
-        Keyword argument with_data: the initial data for the element
-        Keyword argument with_properties: the initial values for the properties of the element
-        Keyword argument _attributes: AppleEvent attribute dictionary
-        Returns: Object specifier for the new element
-        """
-        _code = 'core'
-        _subcode = 'crel'
-
-        aetools.keysubst(_arguments, self._argmap_make)
-        if _no_object is not None: raise TypeError('No direct arg expected')
-
-
-        _reply, _arguments, _attributes = self.send(_code, _subcode,
-                _arguments, _attributes)
-        if _arguments.get('errn', 0):
-            raise aetools.Error(aetools.decodeerror(_arguments))
-        # XXXX Optionally decode result
-        if _arguments.has_key('----'):
-            return _arguments['----']
-
-    def open(self, _object, _attributes={}, **_arguments):
-        """open: Open the specified object(s)
-        Required argument: Objects to open. Can be a list of files or an object specifier.
-        Keyword argument _attributes: AppleEvent attribute dictionary
-        """
-        _code = 'aevt'
-        _subcode = 'odoc'
-
-        if _arguments: raise TypeError('No optional args expected')
-        _arguments['----'] = _object
-
-
-        _reply, _arguments, _attributes = self.send(_code, _subcode,
-                _arguments, _attributes)
-        if _arguments.get('errn', 0):
-            raise aetools.Error(aetools.decodeerror(_arguments))
-        # XXXX Optionally decode result
-        if _arguments.has_key('----'):
-            return _arguments['----']
-
-    def print_(self, _object, _attributes={}, **_arguments):
-        """print: Print the specified object(s)
-        Required argument: Objects to print. Can be a list of files or an object specifier.
-        Keyword argument _attributes: AppleEvent attribute dictionary
-        """
-        _code = 'aevt'
-        _subcode = 'pdoc'
-
-        if _arguments: raise TypeError('No optional args expected')
-        _arguments['----'] = _object
-
-
-        _reply, _arguments, _attributes = self.send(_code, _subcode,
-                _arguments, _attributes)
-        if _arguments.get('errn', 0):
-            raise aetools.Error(aetools.decodeerror(_arguments))
-        # XXXX Optionally decode result
-        if _arguments.has_key('----'):
-            return _arguments['----']
-
-    _argmap_save = {
-        'in_' : 'kfil',
-        'as' : 'fltp',
-    }
-
-    def save(self, _object, _attributes={}, **_arguments):
-        """save: save a set of objects
-        Required argument: Objects to save.
-        Keyword argument in_: the file in which to save the object(s)
-        Keyword argument as: the file type of the document in which to save the data
-        Keyword argument _attributes: AppleEvent attribute dictionary
-        """
-        _code = 'core'
-        _subcode = 'save'
-
-        aetools.keysubst(_arguments, self._argmap_save)
-        _arguments['----'] = _object
-
-
-        _reply, _arguments, _attributes = self.send(_code, _subcode,
-                _arguments, _attributes)
-        if _arguments.get('errn', 0):
-            raise aetools.Error(aetools.decodeerror(_arguments))
-        # XXXX Optionally decode result
-        if _arguments.has_key('----'):
-            return _arguments['----']
-
-    _argmap_set = {
-        'to' : 'data',
-    }
-
-    def set(self, _object, _attributes={}, **_arguments):
-        """set: Set an object\xd5s data
-        Required argument: the object to change
-        Keyword argument to: the new value
-        Keyword argument _attributes: AppleEvent attribute dictionary
-        """
-        _code = 'core'
-        _subcode = 'setd'
-
-        aetools.keysubst(_arguments, self._argmap_set)
-        _arguments['----'] = _object
-
-
-        _reply, _arguments, _attributes = self.send(_code, _subcode,
-                _arguments, _attributes)
-        if _arguments.get('errn', 0):
-            raise aetools.Error(aetools.decodeerror(_arguments))
-        # XXXX Optionally decode result
-        if _arguments.has_key('----'):
-            return _arguments['----']
-
-
-class application(aetools.ComponentItem):
-    """application - An application program """
-    want = 'capp'
-#        element 'cwin' as ['indx', 'name', 'rele']
-#        element 'docu' as ['name']
-
-class window(aetools.ComponentItem):
-    """window - A Window """
-    want = 'cwin'
-class _Prop_bounds(aetools.NProperty):
-    """bounds - the boundary rectangle for the window """
-    which = 'pbnd'
-    want = 'qdrt'
-class _Prop_closeable(aetools.NProperty):
-    """closeable - Does the window have a close box? """
-    which = 'hclb'
-    want = 'bool'
-class _Prop_floating(aetools.NProperty):
-    """floating - Does the window float? """
-    which = 'isfl'
-    want = 'bool'
-class _Prop_index(aetools.NProperty):
-    """index - the number of the window """
-    which = 'pidx'
-    want = 'long'
-class _Prop_modal(aetools.NProperty):
-    """modal - Is the window modal? """
-    which = 'pmod'
-    want = 'bool'
-class _Prop_name(aetools.NProperty):
-    """name - the title of the window """
-    which = 'pnam'
-    want = 'itxt'
-class _Prop_position(aetools.NProperty):
-    """position - upper left coordinates of window """
-    which = 'ppos'
-    want = 'QDpt'
-class _Prop_resizable(aetools.NProperty):
-    """resizable - Is the window resizable? """
-    which = 'prsz'
-    want = 'bool'
-class _Prop_titled(aetools.NProperty):
-    """titled - Does the window have a title bar? """
-    which = 'ptit'
-    want = 'bool'
-class _Prop_visible(aetools.NProperty):
-    """visible - is the window visible? """
-    which = 'pvis'
-    want = 'bool'
-class _Prop_zoomable(aetools.NProperty):
-    """zoomable - Is the window zoomable? """
-    which = 'iszm'
-    want = 'bool'
-class _Prop_zoomed(aetools.NProperty):
-    """zoomed - Is the window zoomed? """
-    which = 'pzum'
-    want = 'bool'
-
-class document(aetools.ComponentItem):
-    """document - A Document """
-    want = 'docu'
-class _Prop_modified(aetools.NProperty):
-    """modified - Has the document been modified since the last save? """
-    which = 'imod'
-    want = 'bool'
-application._superclassnames = []
-application._privpropdict = {
-}
-application._privelemdict = {
-    'document' : document,
-    'window' : window,
-}
-window._superclassnames = []
-window._privpropdict = {
-    'bounds' : _Prop_bounds,
-    'closeable' : _Prop_closeable,
-    'floating' : _Prop_floating,
-    'index' : _Prop_index,
-    'modal' : _Prop_modal,
-    'name' : _Prop_name,
-    'position' : _Prop_position,
-    'resizable' : _Prop_resizable,
-    'titled' : _Prop_titled,
-    'visible' : _Prop_visible,
-    'zoomable' : _Prop_zoomable,
-    'zoomed' : _Prop_zoomed,
-}
-window._privelemdict = {
-}
-document._superclassnames = []
-document._privpropdict = {
-    'modified' : _Prop_modified,
-    'name' : _Prop_name,
-}
-document._privelemdict = {
-}
-_Enum_savo = {
-    'yes' : 'yes ',     # Save objects now
-    'no' : 'no  ',      # Do not save objects
-    'ask' : 'ask ',     # Ask the user whether to save
-}
-
-
-#
-# Indices of types declared in this module
-#
-_classdeclarations = {
-    'capp' : application,
-    'cwin' : window,
-    'docu' : document,
-}
-
-_propdeclarations = {
-    'hclb' : _Prop_closeable,
-    'imod' : _Prop_modified,
-    'isfl' : _Prop_floating,
-    'iszm' : _Prop_zoomable,
-    'pbnd' : _Prop_bounds,
-    'pidx' : _Prop_index,
-    'pmod' : _Prop_modal,
-    'pnam' : _Prop_name,
-    'ppos' : _Prop_position,
-    'prsz' : _Prop_resizable,
-    'ptit' : _Prop_titled,
-    'pvis' : _Prop_visible,
-    'pzum' : _Prop_zoomed,
-}
-
-_compdeclarations = {
-}
-
-_enumdeclarations = {
-    'savo' : _Enum_savo,
-}
diff --git a/Mac/Tools/Doc/HelpIndexingTool/__init__.py b/Mac/Tools/Doc/HelpIndexingTool/__init__.py
deleted file mode 100644
index 5359df5..0000000
--- a/Mac/Tools/Doc/HelpIndexingTool/__init__.py
+++ /dev/null
@@ -1,78 +0,0 @@
-"""
-Package generated from /Developer/Applications/Apple Help Indexing Tool.app
-"""
-import aetools
-Error = aetools.Error
-import Standard_Suite
-import Help_Indexing_Tool_Suite
-import odds_and_ends
-import Miscellaneous_Standards
-import Required_Suite
-
-
-_code_to_module = {
-    'CoRe' : Standard_Suite,
-    'HIT ' : Help_Indexing_Tool_Suite,
-    'Odds' : odds_and_ends,
-    'misc' : Miscellaneous_Standards,
-    'reqd' : Required_Suite,
-}
-
-
-
-_code_to_fullname = {
-    'CoRe' : ('HelpIndexingTool.Standard_Suite', 'Standard_Suite'),
-    'HIT ' : ('HelpIndexingTool.Help_Indexing_Tool_Suite', 'Help_Indexing_Tool_Suite'),
-    'Odds' : ('HelpIndexingTool.odds_and_ends', 'odds_and_ends'),
-    'misc' : ('HelpIndexingTool.Miscellaneous_Standards', 'Miscellaneous_Standards'),
-    'reqd' : ('HelpIndexingTool.Required_Suite', 'Required_Suite'),
-}
-
-from Standard_Suite import *
-from Help_Indexing_Tool_Suite import *
-from odds_and_ends import *
-from Miscellaneous_Standards import *
-from Required_Suite import *
-
-def getbaseclasses(v):
-    if not getattr(v, '_propdict', None):
-        v._propdict = {}
-        v._elemdict = {}
-        for superclassname in getattr(v, '_superclassnames', []):
-            superclass = eval(superclassname)
-            getbaseclasses(superclass)
-            v._propdict.update(getattr(superclass, '_propdict', {}))
-            v._elemdict.update(getattr(superclass, '_elemdict', {}))
-        v._propdict.update(getattr(v, '_privpropdict', {}))
-        v._elemdict.update(getattr(v, '_privelemdict', {}))
-
-import StdSuites
-
-#
-# Set property and element dictionaries now that all classes have been defined
-#
-getbaseclasses(window)
-getbaseclasses(application)
-getbaseclasses(document)
-getbaseclasses(application)
-
-#
-# Indices of types declared in this module
-#
-_classdeclarations = {
-    'cwin' : window,
-    'capp' : application,
-    'docu' : document,
-    'capp' : application,
-}
-
-
-class HelpIndexingTool(Standard_Suite_Events,
-        Help_Indexing_Tool_Suite_Events,
-        odds_and_ends_Events,
-        Miscellaneous_Standards_Events,
-        Required_Suite_Events,
-        aetools.TalkTo):
-    _signature = 'hiti'
-
-    _moduleName = 'HelpIndexingTool'
diff --git a/Mac/Tools/Doc/HelpIndexingTool/odds_and_ends.py b/Mac/Tools/Doc/HelpIndexingTool/odds_and_ends.py
deleted file mode 100644
index 86ecb95..0000000
--- a/Mac/Tools/Doc/HelpIndexingTool/odds_and_ends.py
+++ /dev/null
@@ -1,49 +0,0 @@
-"""Suite odds and ends: Things that should be in some standard suite, but aren\xd5t
-Level 1, version 1
-
-Generated from /Developer/Applications/Apple Help Indexing Tool.app
-AETE/AEUT resource version 1/1, language 0, script 0
-"""
-
-import aetools
-import MacOS
-
-_code = 'Odds'
-
-class odds_and_ends_Events:
-
-    def select(self, _object=None, _attributes={}, **_arguments):
-        """select: Select the specified object
-        Required argument: the object to select
-        Keyword argument _attributes: AppleEvent attribute dictionary
-        """
-        _code = 'misc'
-        _subcode = 'slct'
-
-        if _arguments: raise TypeError('No optional args expected')
-        _arguments['----'] = _object
-
-
-        _reply, _arguments, _attributes = self.send(_code, _subcode,
-                _arguments, _attributes)
-        if _arguments.get('errn', 0):
-            raise aetools.Error(aetools.decodeerror(_arguments))
-        # XXXX Optionally decode result
-        if _arguments.has_key('----'):
-            return _arguments['----']
-
-
-#
-# Indices of types declared in this module
-#
-_classdeclarations = {
-}
-
-_propdeclarations = {
-}
-
-_compdeclarations = {
-}
-
-_enumdeclarations = {
-}
diff --git a/Mac/Tools/Doc/README b/Mac/Tools/Doc/README
deleted file mode 100644
index 4f4d53d..0000000
--- a/Mac/Tools/Doc/README
+++ /dev/null
@@ -1,35 +0,0 @@
-In this directory you can build the Python documentation in a form that
-is suitable for access with Apple Help Viewer. This will enable the
-"Python Documentation" menu entries in the MacPython IDE Help menu.
-
-Unfortunately the procedure to build the docs is not very streamlined.
-
-First, edit setup.py. At the top, edit MAJOR_VERSION and MINOR_VERSION,
-and check that DESTDIR makes sense. The documentation will be installed
-inside PythonIDE.app.
-
-In DocBuild.initialize_options, set self.download to True if you want to
-download the docs. Set it to False if you want to build the docs from
-the source tree, but this requires LaTex and lots of other stuff.
-Doable, but not easy.
-
-Second, if you want to download the docs you may need to do a couple
-more edits. The way the docs are packaged will often change between
-major releases. Fiddle DocBuild.downloadDocs to make it do the right
-thing (download the docs from python.org, unpack them, rename the
-directory to "build/html").
-
-After these edits you should be ready to roll. "pythonw setup.py build"
-should download and unpack (or build) the docs. Next, it will do some
-magic to make the docs indexable. Finally, it will run the Apple Help
-Indexing Tool. (This last step is the reason you must use "pythonw" as
-opposed to "python"). Usually it will time out while waiting for AHIT to
-do its work. Wait until AHIT is done.
-
-Now you're ready to install with "python setup.py install".
-
-After this is done test your work. Fire up PythonIDE, and check that
-Help->Python Documentation brings up the documentation in the Help Viewer.
-Also open an IDE edit window, type something like "import sys", select
-"import", and use Help->Lookup in Python Documentation to check that the
-index has been generated correctly.
diff --git a/Mac/Tools/Doc/setup.py b/Mac/Tools/Doc/setup.py
deleted file mode 100644
index a35152c..0000000
--- a/Mac/Tools/Doc/setup.py
+++ /dev/null
@@ -1,213 +0,0 @@
-# Build and install an Apple Help Viewer compatible version of the Python
-# documentation into the framework.
-# Code by Bill Fancher, with some modifications by Jack Jansen.
-#
-# You must run this as a two-step process
-# 1. python setupDocs.py build
-# 2. Wait for Apple Help Indexing Tool to finish
-# 3. python setupDocs.py install
-#
-# To do:
-# - test whether the docs are available locally before downloading
-# - fix buildDocsFromSource
-# - Get documentation version from sys.version, fallback to 2.2.1
-# - See if we can somehow detect that Apple Help Indexing Tool is finished
-# - data_files to setup() doesn't seem the right way to pass the arguments
-#
-import sys, os, re
-from distutils.cmd import Command
-from distutils.command.build import build
-from distutils.core import setup
-from distutils.file_util import copy_file
-from distutils.dir_util import copy_tree
-from distutils.log import log
-from distutils.spawn import spawn
-from distutils import sysconfig, dep_util
-from distutils.util import change_root
-import HelpIndexingTool
-import Carbon.File
-import time
-
-MAJOR_VERSION='2.4'
-MINOR_VERSION='2.4.1'
-DESTDIR='/Applications/MacPython-%s/PythonIDE.app/Contents/Resources/English.lproj/PythonDocumentation' % MAJOR_VERSION
-
-class DocBuild(build):
-    def initialize_options(self):
-        build.initialize_options(self)
-        self.build_html = None
-        self.build_dest = None
-        self.download = 1
-        self.doc_version = MINOR_VERSION # Only needed if download is true
-
-    def finalize_options(self):
-        build.finalize_options(self)
-        if self.build_html is None:
-            self.build_html = os.path.join(self.build_base, 'html')
-        if self.build_dest is None:
-            self.build_dest = os.path.join(self.build_base, 'PythonDocumentation')
-
-    def spawn(self, *args):
-        spawn(args, 1,  self.verbose, self.dry_run)
-
-    def downloadDocs(self):
-        workdir = os.getcwd()
-        # XXX Note: the next strings may change from version to version
-        url = 'http://www.python.org/ftp/python/doc/%s/html-%s.tar.bz2' % \
-                (self.doc_version,self.doc_version)
-        tarfile = 'html-%s.tar.bz2' % self.doc_version
-        dirname = 'Python-Docs-%s' % self.doc_version
-
-        if os.path.exists(self.build_html):
-            raise RuntimeError('%s: already exists, please remove and try again' % self.build_html)
-        os.chdir(self.build_base)
-        self.spawn('curl','-O', url)
-        self.spawn('tar', '-xjf', tarfile)
-        os.rename(dirname, 'html')
-        os.chdir(workdir)
-##        print "** Please unpack %s" % os.path.join(self.build_base, tarfile)
-##        print "** Unpack the files into %s" % self.build_html
-##        raise RuntimeError, "You need to unpack the docs manually"
-
-    def buildDocsFromSource(self):
-        srcdir = '../../..'
-        docdir = os.path.join(srcdir, 'Doc')
-        htmldir = os.path.join(docdir, 'html')
-        spawn(('make','--directory', docdir, 'html'), 1, self.verbose, self.dry_run)
-        self.mkpath(self.build_html)
-        copy_tree(htmldir, self.build_html)
-
-    def ensureHtml(self):
-        if not os.path.exists(self.build_html):
-            if self.download:
-                self.downloadDocs()
-            else:
-                self.buildDocsFromSource()
-
-    def hackIndex(self):
-        ind_html = 'index.html'
-        #print 'self.build_dest =', self.build_dest
-        hackedIndex = file(os.path.join(self.build_dest, ind_html),'w')
-        origIndex = file(os.path.join(self.build_html,ind_html))
-        r = re.compile('<style type="text/css">.*</style>', re.DOTALL)
-        hackedIndex.write(r.sub('<META NAME="AppleTitle" CONTENT="Python Documentation">',origIndex.read()))
-
-    def hackFile(self,d,f):
-        origPath = os.path.join(d,f)
-        assert(origPath[:len(self.build_html)] == self.build_html)
-        outPath = os.path.join(self.build_dest, d[len(self.build_html)+1:], f)
-        (name, ext) = os.path.splitext(f)
-        if os.path.isdir(origPath):
-            self.mkpath(outPath)
-        elif ext == '.html':
-            if self.verbose: print('hacking %s to %s' % (origPath,outPath))
-            hackedFile = file(outPath, 'w')
-            origFile = file(origPath,'r')
-            hackedFile.write(self.r.sub('<dl><dt><dd>', origFile.read()))
-        else:
-            copy_file(origPath, outPath)
-
-    def hackHtml(self):
-        self.r = re.compile('<dl><dd>')
-        os.walk(self.build_html, self.visit, None)
-
-    def visit(self, dummy, dirname, filenames):
-        for f in filenames:
-            self.hackFile(dirname, f)
-
-    def makeHelpIndex(self):
-        app = '/Developer/Applications/Apple Help Indexing Tool.app'
-        self.spawn('open', '-a', app , self.build_dest)
-        print("Please wait until Apple Help Indexing Tool finishes before installing")
-
-    def makeHelpIndex(self):
-        app = HelpIndexingTool.HelpIndexingTool(start=1)
-        app.open(Carbon.File.FSSpec(self.build_dest))
-        sys.stderr.write("Waiting for Help Indexing Tool to start...")
-        while 1:
-            # This is bad design in the suite generation code!
-            idle = app._get(HelpIndexingTool.Help_Indexing_Tool_Suite._Prop_idleStatus())
-            time.sleep(10)
-            if not idle: break
-            sys.stderr.write(".")
-        sys.stderr.write("\n")
-        sys.stderr.write("Waiting for Help Indexing Tool to finish...")
-        while 1:
-            # This is bad design in the suite generation code!
-            idle = app._get(HelpIndexingTool.Help_Indexing_Tool_Suite._Prop_idleStatus())
-            time.sleep(10)
-            if idle: break
-            sys.stderr.write(".")
-        sys.stderr.write("\n")
-
-
-    def run(self):
-        self.ensure_finalized()
-        self.mkpath(self.build_base)
-        self.ensureHtml()
-        if not os.path.isdir(self.build_html):
-            raise RuntimeError("Can't find source folder for documentation.")
-        self.mkpath(self.build_dest)
-        if dep_util.newer(os.path.join(self.build_html,'index.html'), os.path.join(self.build_dest,'index.html')):
-            self.mkpath(self.build_dest)
-            self.hackHtml()
-            self.hackIndex()
-            self.makeHelpIndex()
-
-class AHVDocInstall(Command):
-    description = "install Apple Help Viewer html files"
-    user_options = [('install-doc=', 'd',
-            'directory to install HTML tree'),
-             ('root=', None,
-             "install everything relative to this alternate root directory"),
-            ]
-
-    def initialize_options(self):
-        self.build_dest = None
-        self.install_doc = None
-        self.prefix = None
-        self.root = None
-
-    def finalize_options(self):
-        self.set_undefined_options('install',
-                ('prefix', 'prefix'),
-                ('root', 'root'))
-#               import pdb ; pdb.set_trace()
-        build_cmd = self.get_finalized_command('build')
-        if self.build_dest is None:
-            build_cmd = self.get_finalized_command('build')
-            self.build_dest = build_cmd.build_dest
-        if self.install_doc is None:
-            self.install_doc = os.path.join(self.prefix, DESTDIR)
-        print('INSTALL', self.build_dest, '->', self.install_doc)
-
-    def run(self):
-        self.finalize_options()
-        self.ensure_finalized()
-        print("Running Installer")
-        instloc = self.install_doc
-        if self.root:
-            instloc = change_root(self.root, instloc)
-        self.mkpath(instloc)
-        copy_tree(self.build_dest, instloc)
-        print("Installation complete")
-
-def mungeVersion(infile, outfile):
-    i = file(infile,'r')
-    o = file(outfile,'w')
-    o.write(re.sub('\$\(VERSION\)',sysconfig.get_config_var('VERSION'),i.read()))
-    i.close()
-    o.close()
-
-def main():
-    # turn off warnings when deprecated modules are imported
-##      import warnings
-##      warnings.filterwarnings("ignore",category=DeprecationWarning)
-    setup(name = 'Documentation',
-            version = '%d.%d' % sys.version_info[:2],
-            cmdclass = {'install_data':AHVDocInstall, 'build':DocBuild},
-            data_files = ['dummy'],
-            )
-
-if __name__ == '__main__':
-    main()
diff --git a/Mac/Tools/bundlebuilder.py b/Mac/Tools/bundlebuilder.py
index 6cc130f..f5679d3 100755
--- a/Mac/Tools/bundlebuilder.py
+++ b/Mac/Tools/bundlebuilder.py
@@ -270,7 +270,7 @@
 del __load
 """
 
-MAYMISS_MODULES = ['mac', 'os2', 'nt', 'ntpath', 'dos', 'dospath',
+MAYMISS_MODULES = ['mac', 'nt', 'ntpath', 'dos', 'dospath',
     'win32api', 'ce', '_winreg', 'nturl2path', 'sitecustomize',
     'org.python.core', 'riscos', 'riscosenviron', 'riscospath'
 ]
diff --git a/Mac/Tools/plistlib_generate_testdata.py b/Mac/Tools/plistlib_generate_testdata.py
new file mode 100755
index 0000000..057b617
--- /dev/null
+++ b/Mac/Tools/plistlib_generate_testdata.py
@@ -0,0 +1,103 @@
+#!/usr/bin/env python3
+
+from Cocoa import NSMutableDictionary, NSMutableArray, NSString, NSDate, NSNumber
+from Cocoa import NSPropertyListSerialization, NSPropertyListOpenStepFormat
+from Cocoa import NSPropertyListXMLFormat_v1_0, NSPropertyListBinaryFormat_v1_0
+from Cocoa import CFUUIDCreateFromString, NSNull, NSUUID, CFPropertyListCreateData
+from Cocoa import NSURL
+
+import datetime
+from collections import OrderedDict
+import binascii
+
+FORMATS=[
+#    ('openstep', NSPropertyListOpenStepFormat),
+    ('plistlib.FMT_XML', NSPropertyListXMLFormat_v1_0),
+    ('plistlib.FMT_BINARY', NSPropertyListBinaryFormat_v1_0),
+]
+
+def nsstr(value):
+    return NSString.alloc().initWithString_(value)
+
+
+def main():
+    pl = OrderedDict()
+
+    # Note: pl is an OrderedDict to control the order
+    # of keys, and hence have some control on the structure
+    # of the output file.
+    # New keys should be added in alphabetical order.
+
+    seconds = datetime.datetime(2004, 10, 26, 10, 33, 33, tzinfo=datetime.timezone(datetime.timedelta(0))).timestamp()
+    pl[nsstr('aBigInt')] = 2 ** 63 - 44
+    pl[nsstr('aBigInt2')] = NSNumber.numberWithUnsignedLongLong_(2 ** 63 + 44)
+    pl[nsstr('aDate')] = NSDate.dateWithTimeIntervalSince1970_(seconds)
+
+    pl[nsstr('aDict')] = d = OrderedDict()
+    d[nsstr('aFalseValue')] = False
+    d[nsstr('aTrueValue')] = True
+    d[nsstr('aUnicodeValue')] = "M\xe4ssig, Ma\xdf"
+    d[nsstr('anotherString')] = "<hello & 'hi' there!>"
+    d[nsstr('deeperDict')] = dd = OrderedDict()
+    dd[nsstr('a')] = 17
+    dd[nsstr('b')] = 32.5
+    dd[nsstr('c')] = a = NSMutableArray.alloc().init()
+    a.append(1)
+    a.append(2)
+    a.append(nsstr('text'))
+
+    pl[nsstr('aFloat')] = 0.5
+
+    pl[nsstr('aList')] = a = NSMutableArray.alloc().init()
+    a.append(nsstr('A'))
+    a.append(nsstr('B'))
+    a.append(12)
+    a.append(32.5)
+    aa = NSMutableArray.alloc().init()
+    a.append(aa)
+    aa.append(1)
+    aa.append(2)
+    aa.append(3)
+
+    pl[nsstr('aNegativeBigInt')] = -80000000000
+    pl[nsstr('aNegativeInt')] = -5
+    pl[nsstr('aString')] = nsstr('Doodah')
+
+    pl[nsstr('anEmptyDict')] = NSMutableDictionary.alloc().init()
+
+    pl[nsstr('anEmptyList')] = NSMutableArray.alloc().init()
+
+    pl[nsstr('anInt')] = 728
+
+    pl[nsstr('nestedData')] = a = NSMutableArray.alloc().init()
+    a.append(b'''<lots of binary gunk>\x00\x01\x02\x03<lots of binary gunk>\x00\x01\x02\x03<lots of binary gunk>\x00\x01\x02\x03<lots of binary gunk>\x00\x01\x02\x03<lots of binary gunk>\x00\x01\x02\x03<lots of binary gunk>\x00\x01\x02\x03<lots of binary gunk>\x00\x01\x02\x03<lots of binary gunk>\x00\x01\x02\x03<lots of binary gunk>\x00\x01\x02\x03<lots of binary gunk>\x00\x01\x02\x03''')
+
+
+    pl[nsstr('someData')] = b'<binary gunk>'
+
+    pl[nsstr('someMoreData')] = b'''<lots of binary gunk>\x00\x01\x02\x03<lots of binary gunk>\x00\x01\x02\x03<lots of binary gunk>\x00\x01\x02\x03<lots of binary gunk>\x00\x01\x02\x03<lots of binary gunk>\x00\x01\x02\x03<lots of binary gunk>\x00\x01\x02\x03<lots of binary gunk>\x00\x01\x02\x03<lots of binary gunk>\x00\x01\x02\x03<lots of binary gunk>\x00\x01\x02\x03<lots of binary gunk>\x00\x01\x02\x03'''
+
+    pl[nsstr('\xc5benraa')] = nsstr("That was a unicode key.")
+
+    print("TESTDATA={")
+    for fmt_name, fmt_key in FORMATS:
+        data, error = NSPropertyListSerialization.dataWithPropertyList_format_options_error_(
+            pl, fmt_key, 0, None)
+        if data is None:
+            print("Cannot serialize", fmt_name, error)
+
+        else:
+            print("    %s: binascii.a2b_base64(b'''\n        %s'''),"%(fmt_name, _encode_base64(bytes(data)).decode('ascii')[:-1]))
+
+    print("}")
+    print()
+
+def _encode_base64(s, maxlinelength=60):
+    maxbinsize = (maxlinelength//4)*3
+    pieces = []
+    for i in range(0, len(s), maxbinsize):
+        chunk = s[i : i + maxbinsize]
+        pieces.append(binascii.b2a_base64(chunk))
+    return b'        '.join(pieces)
+
+main()
diff --git a/Makefile.pre.in b/Makefile.pre.in
index fdca38e..70db601 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -71,12 +71,17 @@
 BASECFLAGS=	@BASECFLAGS@
 BASECPPFLAGS=	@BASECPPFLAGS@
 CONFIGURE_CFLAGS=	@CFLAGS@
+# CFLAGS_NODIST is used for building the interpreter and stdlib C extensions.
+# Use it when a compiler flag should _not_ be part of the distutils CFLAGS
+# once Python is installed (Issue #21121).
+CONFIGURE_CFLAGS_NODIST=@CFLAGS_NODIST@
 CONFIGURE_CPPFLAGS=	@CPPFLAGS@
 CONFIGURE_LDFLAGS=	@LDFLAGS@
 # Avoid assigning CFLAGS, LDFLAGS, etc. so users can use them on the
 # command line to append to these values without stomping the pre-set
 # values.
 PY_CFLAGS=	$(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
+PY_CFLAGS_NODIST=$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST)
 # 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
@@ -91,7 +96,7 @@
 # Extra C flags added for building the interpreter object files.
 CFLAGSFORSHARED=@CFLAGSFORSHARED@
 # C flags used for building the interpreter object files
-PY_CORE_CFLAGS=	$(PY_CFLAGS) $(PY_CPPFLAGS) $(CFLAGSFORSHARED) -DPy_BUILD_CORE
+PY_CORE_CFLAGS=	$(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) $(CFLAGSFORSHARED) -DPy_BUILD_CORE
 
 
 # Machine-dependent subdirectories
@@ -127,7 +132,6 @@
 # Symbols used for using shared libraries
 SHLIB_SUFFIX=	@SHLIB_SUFFIX@
 EXT_SUFFIX=	@EXT_SUFFIX@
-SO=		$(SHLIB_SUFFIX)
 LDSHARED=	@LDSHARED@ $(PY_LDFLAGS)
 BLDSHARED=	@BLDSHARED@ $(PY_LDFLAGS)
 LDCXXSHARED=	@LDCXXSHARED@
@@ -149,12 +153,21 @@
 MACOSX_DEPLOYMENT_TARGET=@CONFIGURE_MACOSX_DEPLOYMENT_TARGET@
 @EXPORT_MACOSX_DEPLOYMENT_TARGET@export MACOSX_DEPLOYMENT_TARGET
 
+# Option to install to strip binaries
+STRIPFLAG=-s
+
+# Flags to lipo to produce a 32-bit-only universal executable
+LIPO_32BIT_FLAGS=@LIPO_32BIT_FLAGS@
+
 # Options to enable prebinding (for fast startup prior to Mac OS X 10.3)
 OTHER_LIBTOOL_OPT=@OTHER_LIBTOOL_OPT@
 
 # Environment to run shared python without installed libraries
 RUNSHARED=       @RUNSHARED@
 
+# ensurepip options
+ENSUREPIP=      @ENSUREPIP@
+
 # Modes for directories, executables and data files created by the
 # install process.  Default to user-only-writable for all file types.
 DIRMODE=	755
@@ -216,6 +229,12 @@
 PROFILE_TASK=	$(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck
 #PROFILE_TASK=	$(srcdir)/Lib/test/regrtest.py
 
+# report files for gcov / lcov coverage report
+COVERAGE_INFO=	$(abs_builddir)/coverage.info
+COVERAGE_REPORT=$(abs_builddir)/lcov-report
+COVERAGE_REPORT_OPTIONS=--no-branch-coverage --title "CPython lcov report"
+
+
 # === Definitions added by makesetup ===
 
 
@@ -317,7 +336,8 @@
 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
+# Note that a build now requires Python to exist before the build starts.
+# Use "hg touch" to fix up screwed up file mtimes in a checkout.
 ASDLGEN=	@ASDLGEN@ $(srcdir)/Parser/asdl_c.py
 
 ##########################################################################
@@ -361,6 +381,7 @@
 		Python/pyarena.o \
 		Python/pyctype.o \
 		Python/pyfpe.o \
+		Python/pyhash.o \
 		Python/pymath.o \
 		Python/pystate.o \
 		Python/pythonrun.o \
@@ -444,7 +465,7 @@
 
 # Default target
 all:		build_all
-build_all:	$(BUILDPYTHON) oldsharedmods sharedmods gdbhooks Modules/_testembed
+build_all:	$(BUILDPYTHON) oldsharedmods sharedmods gdbhooks Modules/_testembed python-config
 
 # Compile a binary with gcc profile guided optimization.
 profile-opt:
@@ -468,11 +489,53 @@
 build_all_use_profile:
 	$(MAKE) all CFLAGS="$(CFLAGS) -fprofile-use -fprofile-correction"
 
+# Compile and run with gcov
+.PHONY=coverage coverage-lcov coverage-report
 coverage:
 	@echo "Building with support for coverage checking:"
-	$(MAKE) clean
+	$(MAKE) clean profile-removal
 	$(MAKE) all CFLAGS="$(CFLAGS) -O0 -pg -fprofile-arcs -ftest-coverage" LIBS="$(LIBS) -lgcov"
 
+coverage-lcov:
+	@echo "Creating Coverage HTML report with LCOV:"
+	@rm -f $(COVERAGE_INFO)
+	@rm -rf $(COVERAGE_REPORT)
+	@lcov --capture --directory $(abs_builddir) \
+	    --base-directory $(realpath $(abs_builddir)) \
+	    --path $(realpath $(abs_srcdir)) \
+	    --output-file $(COVERAGE_INFO)
+	: # remove 3rd party modules and system headers
+	@lcov --remove $(COVERAGE_INFO) \
+	    '*/Modules/_ctypes/libffi*/*' \
+	    '*/Modules/_decimal/libmpdec/*' \
+	    '*/Modules/expat/*' \
+	    '*/Modules/zlib/*' \
+	    '*/Include/*' \
+	    '/usr/include/*' \
+	    '/usr/local/include/*' \
+	    --output-file $(COVERAGE_INFO)
+	@genhtml $(COVERAGE_INFO) --output-directory $(COVERAGE_REPORT) \
+	    $(COVERAGE_REPORT_OPTIONS)
+	@echo
+	@echo "lcov report at $(COVERAGE_REPORT)/index.html"
+	@echo
+
+coverage-report:
+	: # force rebuilding of parser and importlib
+	@touch $(GRAMMAR_INPUT)
+	@touch $(srcdir)/Lib/importlib/_bootstrap.py
+	: # build with coverage info
+	$(MAKE) coverage
+	: # run tests, ignore failures
+	$(TESTRUNNER) $(TESTOPTS) || true
+	: # build lcov report
+	$(MAKE) coverage-lcov
+
+# Run "Argument Clinic" over all source files
+# (depends on python having already been built)
+.PHONY=clinic
+clinic: $(BUILDPYTHON)
+	$(RUNSHARED) $(PYTHON_FOR_BUILD) ./Tools/clinic/clinic.py --make
 
 # Build the interpreter
 $(BUILDPYTHON):	Modules/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY)
@@ -484,8 +547,18 @@
 # 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.
+# Since this step runs before shared modules are built, try to avoid bootstrap
+# problems by creating a dummy pybuilddir.txt just to allow interpreter
+# initialization to succeed.  It will be overwritten by generate-posix-vars
+# or removed in case of failure.
 pybuilddir.txt: $(BUILDPYTHON)
-	$(RUNSHARED) $(PYTHON_FOR_BUILD) -S -m sysconfig --generate-posix-vars
+	@echo "none" > ./pybuilddir.txt
+	$(RUNSHARED) $(PYTHON_FOR_BUILD) -S -m sysconfig --generate-posix-vars ;\
+	if test $$? -ne 0 ; then \
+		echo "generate-posix-vars failed" ; \
+		rm -f ./pybuilddir.txt ; \
+		exit 1 ; \
+	fi
 
 # Build the shared modules
 # Under GNU make, MAKEFLAGS are sorted and normalized; the 's' for
@@ -646,6 +719,8 @@
 Modules/_testembed.o: $(srcdir)/Modules/_testembed.c
 	$(MAINCC) -c $(PY_CORE_CFLAGS) -o $@ $(srcdir)/Modules/_testembed.c
 
+Modules/_sre.o: $(srcdir)/Modules/_sre.c $(srcdir)/Modules/sre.h $(srcdir)/Modules/sre_constants.h $(srcdir)/Modules/sre_lib.h
+
 Modules/posixmodule.o: $(srcdir)/Modules/posixmodule.c $(srcdir)/Modules/posixmodule.h
 
 Modules/grpmodule.o: $(srcdir)/Modules/grpmodule.c $(srcdir)/Modules/posixmodule.h
@@ -713,27 +788,31 @@
 				$(srcdir)/Objects/unicodetype_db.h
 
 BYTESTR_DEPS = \
-		$(srcdir)/Include/bytes_methods.h \
 		$(srcdir)/Objects/stringlib/count.h \
 		$(srcdir)/Objects/stringlib/ctype.h \
-		$(srcdir)/Objects/stringlib/eq.h \
 		$(srcdir)/Objects/stringlib/fastsearch.h \
 		$(srcdir)/Objects/stringlib/find.h \
-		$(srcdir)/Objects/stringlib/find_max_char.h \
+		$(srcdir)/Objects/stringlib/join.h \
 		$(srcdir)/Objects/stringlib/partition.h \
 		$(srcdir)/Objects/stringlib/split.h \
 		$(srcdir)/Objects/stringlib/stringdefs.h \
-		$(srcdir)/Objects/stringlib/transmogrify.h \
-		$(srcdir)/Objects/stringlib/unicodedefs.h \
-		$(srcdir)/Objects/stringlib/localeutil.h \
-		$(srcdir)/Objects/stringlib/undef.h
+		$(srcdir)/Objects/stringlib/transmogrify.h
 
-UNICODE_DEPS = $(BYTESTR_DEPS) \
+UNICODE_DEPS = \
 		$(srcdir)/Objects/stringlib/asciilib.h \
 		$(srcdir)/Objects/stringlib/codecs.h \
+		$(srcdir)/Objects/stringlib/count.h \
+		$(srcdir)/Objects/stringlib/fastsearch.h \
+		$(srcdir)/Objects/stringlib/find.h \
+		$(srcdir)/Objects/stringlib/find_max_char.h \
+		$(srcdir)/Objects/stringlib/localeutil.h \
+		$(srcdir)/Objects/stringlib/partition.h \
+		$(srcdir)/Objects/stringlib/replace.h \
+		$(srcdir)/Objects/stringlib/split.h \
 		$(srcdir)/Objects/stringlib/ucs1lib.h \
 		$(srcdir)/Objects/stringlib/ucs2lib.h \
 		$(srcdir)/Objects/stringlib/ucs4lib.h \
+		$(srcdir)/Objects/stringlib/undef.h \
 		$(srcdir)/Objects/stringlib/unicode_format.h \
 		$(srcdir)/Objects/stringlib/unicodedefs.h
 
@@ -751,9 +830,6 @@
 
 Python/ceval.o: $(OPCODETARGETS_H) $(srcdir)/Python/ceval_gil.h
 
-Python/formatter_unicode.o: $(srcdir)/Python/formatter_unicode.c \
-				$(BYTESTR_DEPS)
-
 Python/frozen.o: Python/importlib.h
 
 Objects/typeobject.o: Objects/typeslots.inc
@@ -823,6 +899,7 @@
 		$(srcdir)/Include/pydebug.h \
 		$(srcdir)/Include/pyerrors.h \
 		$(srcdir)/Include/pyfpe.h \
+		$(srcdir)/Include/pyhash.h \
 		$(srcdir)/Include/pymath.h \
 		$(srcdir)/Include/pygetopt.h \
 		$(srcdir)/Include/pymacro.h \
@@ -901,16 +978,38 @@
 
 QUICKTESTOPTS=	$(TESTOPTS) -x test_subprocess test_io test_lib2to3 \
 		test_multibytecodec test_urllib2_localnet test_itertools \
-		test_multiprocessing test_mailbox test_socket test_poll \
+		test_multiprocessing_fork test_multiprocessing_spawn \
+		test_multiprocessing_forkserver \
+		test_mailbox test_socket test_poll \
 		test_select test_zipfile test_concurrent_futures
 quicktest:	all platform
 		$(TESTRUNNER) $(QUICKTESTOPTS)
 
 
-install: altinstall bininstall maninstall
+install: @FRAMEWORKINSTALLFIRST@ commoninstall bininstall maninstall @FRAMEWORKINSTALLLAST@
+	if test "x$(ENSUREPIP)" != "xno"  ; then \
+		case $(ENSUREPIP) in \
+			upgrade) ensurepip="--upgrade" ;; \
+			install|*) ensurepip="" ;; \
+		esac; \
+		$(RUNSHARED) $(PYTHON_FOR_BUILD) -m ensurepip \
+			$$ensurepip --root=$(DESTDIR)/ ; \
+	fi
 
-altinstall:	@FRAMEWORKALTINSTALLFIRST@ altbininstall libinstall inclinstall libainstall \
-                sharedinstall oldsharedinstall altmaninstall @FRAMEWORKALTINSTALLLAST@
+altinstall: commoninstall
+	if test "x$(ENSUREPIP)" != "xno"  ; then \
+		case $(ENSUREPIP) in \
+			upgrade) ensurepip="--altinstall --upgrade" ;; \
+			install|*) ensurepip="--altinstall" ;; \
+		esac; \
+		$(RUNSHARED) $(PYTHON_FOR_BUILD) -m ensurepip \
+			$$ensurepip --root=$(DESTDIR)/ ; \
+	fi
+
+commoninstall:  @FRAMEWORKALTINSTALLFIRST@ \
+		altbininstall libinstall inclinstall libainstall \
+		sharedinstall oldsharedinstall altmaninstall \
+		@FRAMEWORKALTINSTALLLAST@
 
 # Install shared libraries enabled by Setup
 DESTDIRS=	$(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED)
@@ -935,7 +1034,7 @@
 
 # Install the interpreter with $(VERSION) affixed
 # This goes into $(exec_prefix)
-altbininstall: $(BUILDPYTHON)
+altbininstall: $(BUILDPYTHON) @FRAMEWORKPYTHONW@
 	@for i in $(BINDIR) $(LIBDIR); \
 	do \
 		if test ! -d $(DESTDIR)$$i; then \
@@ -944,14 +1043,18 @@
 		else	true; \
 		fi; \
 	done
-	$(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(EXE)
+	if test "$(PYTHONFRAMEWORKDIR)" = "no-framework" ; then \
+		$(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(EXE); \
+	else \
+		$(INSTALL_PROGRAM) $(STRIPFLAG) Mac/pythonw $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(EXE); \
+	fi
 	-if test "$(VERSION)" != "$(LDVERSION)"; then \
 		if test -f $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE) -o -h $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE); \
 		then rm -f $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE); \
 		fi; \
 		(cd $(DESTDIR)$(BINDIR); $(LN) python$(LDVERSION)$(EXE) python$(VERSION)$(EXE)); \
 	fi
-	if test -f $(LDLIBRARY); then \
+	if test -f $(LDLIBRARY) && test "$(PYTHONFRAMEWORKDIR)" = "no-framework" ; then \
 		if test -n "$(DLLLIBRARY)" ; then \
 			$(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \
 		else \
@@ -965,6 +1068,12 @@
 		fi; \
 	else	true; \
 	fi
+	if test "x$(LIPO_32BIT_FLAGS)" != "x" ; then \
+		rm -f $(DESTDIR)$(BINDIR)python$(VERSION)-32$(EXE); \
+		lipo $(LIPO_32BIT_FLAGS) \
+			-output $(DESTDIR)$(BINDIR)/python$(VERSION)-32$(EXE) \
+			$(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE); \
+	fi
 
 bininstall: altbininstall
 	-if test -f $(DESTDIR)$(BINDIR)/python3$(EXE) -o -h $(DESTDIR)$(BINDIR)/python3$(EXE); \
@@ -990,6 +1099,10 @@
 	(cd $(DESTDIR)$(BINDIR); $(LN) -s 2to3-$(VERSION) 2to3)
 	-rm -f $(DESTDIR)$(BINDIR)/pyvenv
 	(cd $(DESTDIR)$(BINDIR); $(LN) -s pyvenv-$(VERSION) pyvenv)
+	if test "x$(LIPO_32BIT_FLAGS)" != "x" ; then \
+		rm -f $(DESTDIR)$(BINDIR)/python3-32$(EXE); \
+		(cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-32$(EXE) python3-32$(EXE)) \
+	fi
 
 # Install the versioned manual page
 altmaninstall:
@@ -1022,28 +1135,31 @@
 		test/imghdrdata \
 		test/subprocessdata test/sndhdrdata test/support \
 		test/tracedmodules test/encoded_modules \
-		test/namespace_pkgs \
-		test/namespace_pkgs/both_portions \
-		test/namespace_pkgs/both_portions/foo \
-		test/namespace_pkgs/not_a_namespace_pkg \
-		test/namespace_pkgs/not_a_namespace_pkg/foo \
-		test/namespace_pkgs/portion1 \
-		test/namespace_pkgs/portion1/foo \
-		test/namespace_pkgs/portion2 \
-		test/namespace_pkgs/portion2/foo \
-		test/namespace_pkgs/project1 \
-		test/namespace_pkgs/project1/parent \
-		test/namespace_pkgs/project1/parent/child \
-		test/namespace_pkgs/project2 \
-		test/namespace_pkgs/project2/parent \
-		test/namespace_pkgs/project2/parent/child \
-		test/namespace_pkgs/project3 \
-		test/namespace_pkgs/project3/parent \
-		test/namespace_pkgs/project3/parent/child \
-                test/namespace_pkgs/module_and_namespace_package \
-                test/namespace_pkgs/module_and_namespace_package/a_test \
+		test/test_importlib/namespace_pkgs \
+		test/test_importlib/namespace_pkgs/both_portions \
+		test/test_importlib/namespace_pkgs/both_portions/foo \
+		test/test_importlib/namespace_pkgs/not_a_namespace_pkg \
+		test/test_importlib/namespace_pkgs/not_a_namespace_pkg/foo \
+		test/test_importlib/namespace_pkgs/portion1 \
+		test/test_importlib/namespace_pkgs/portion1/foo \
+		test/test_importlib/namespace_pkgs/portion2 \
+		test/test_importlib/namespace_pkgs/portion2/foo \
+		test/test_importlib/namespace_pkgs/project1 \
+		test/test_importlib/namespace_pkgs/project1/parent \
+		test/test_importlib/namespace_pkgs/project1/parent/child \
+		test/test_importlib/namespace_pkgs/project2 \
+		test/test_importlib/namespace_pkgs/project2/parent \
+		test/test_importlib/namespace_pkgs/project2/parent/child \
+		test/test_importlib/namespace_pkgs/project3 \
+		test/test_importlib/namespace_pkgs/project3/parent \
+		test/test_importlib/namespace_pkgs/project3/parent/child \
+                test/test_importlib/namespace_pkgs/module_and_namespace_package \
+                test/test_importlib/namespace_pkgs/module_and_namespace_package/a_test \
+		asyncio \
+		test/test_asyncio \
 		collections concurrent concurrent/futures encodings \
 		email email/mime test/test_email test/test_email/data \
+		ensurepip ensurepip/_bundled \
 		html json test/test_json http dbm xmlrpc \
 		sqlite3 sqlite3/test \
 		logging csv wsgiref urllib \
@@ -1161,10 +1277,19 @@
 	fi; \
 	cd $(srcdir)/Lib/$(PLATDIR); $(RUNSHARED) ./regen
 
-python-config: $(srcdir)/Misc/python-config.in
+python-config: $(srcdir)/Misc/python-config.in Misc/python-config.sh
 	# 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
+	sed -e "s,@EXENAME@,$(BINDIR)/python$(LDVERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config.py
+	# 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
+	# On Darwin, always use the python version of the script, the shell
+	# version doesn't use the compiler customizations that are provided
+	# in python (_osx_support.py).
+	if test `uname -s` = Darwin; then \
+		cp python-config.py python-config; \
+	fi
+
 
 # Install the include files
 INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
@@ -1222,8 +1347,8 @@
 	$(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION).pc
 	$(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
 	$(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
+	$(INSTALL_SCRIPT) python-config.py $(DESTDIR)$(LIBPL)/python-config.py
 	$(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(LDVERSION)-config
-	rm python-config
 	@if [ -s Modules/python.exp -a \
 		"`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \
 		echo; echo "Installing support files for building shared extension modules on AIX:"; \
@@ -1305,7 +1430,14 @@
 frameworkinstallapps:
 	cd Mac && $(MAKE) installapps DESTDIR="$(DESTDIR)"
 
-# This install the unix python and pythonw tools in /usr/local/bin
+# Build the bootstrap executable that will spawn the interpreter inside
+# an app bundle within the framework.  This allows the interpreter to
+# run OS X GUI APIs.
+frameworkpythonw:
+	cd Mac && $(MAKE) pythonw
+
+# This installs the python* and other bin symlinks in $prefix/bin or in
+# a bin directory relative to the framework root
 frameworkinstallunixtools:
 	cd Mac && $(MAKE) installunixtools DESTDIR="$(DESTDIR)"
 
@@ -1369,8 +1501,12 @@
 	etags Include/*.h; \
 	for i in $(SRCDIRS); do etags -a $$i/*.[ch]; done
 
-# Touch generated files
+# This fixes up the mtimes of checked-in generated files, assuming that they
+# only *appear* to be outdated because of checkout order.
+# This is run while preparing a source release tarball, and can be run manually
+# to avoid bootstrap issues.
 touch:
+	cd $(srcdir); \
 	hg --config extensions.touch=Tools/hg/hgtouch.py touch -v
 
 # Sanitation targets -- clean leaves libraries, executables and tags
@@ -1403,6 +1539,8 @@
 
 profile-removal:
 	find . -name '*.gc??' -exec rm -f {} ';'
+	rm -f $(COVERAGE_INFO)
+	rm -rf $(COVERAGE_REPORT)
 
 clobber: clean profile-removal
 	-rm -f $(BUILDPYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
@@ -1410,6 +1548,7 @@
 		config.cache config.log pyconfig.h Modules/config.c
 	-rm -rf build platform
 	-rm -rf $(PYTHONFRAMEWORKDIR)
+	-rm -f python-config.py python-config
 
 # Make things extra clean, before making a distribution:
 # remove all generated files, even Makefile[.pre]
@@ -1481,7 +1620,7 @@
 .PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure
 .PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools
 .PHONY: frameworkaltinstallunixtools recheck autoconf clean clobber distclean
-.PHONY: smelly funny patchcheck touch altmaninstall
+.PHONY: smelly funny patchcheck touch altmaninstall commoninstall
 .PHONY: gdbhooks
 
 # IF YOU PUT ANYTHING HERE IT WILL GO AWAY
diff --git a/Misc/ACKS b/Misc/ACKS
index cc194ab..733683d 100644
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -17,19 +17,25 @@
 David Abrahams
 Marc Abramowitz
 Ron Adam
+Anton Afanasyev
 Ali Afshar
+Nitika Agarwal
 Jim Ahlstrom
 Farhan Ahmad
 Matthew Ahrens
 Nir Aides
+Akira
 Yaniv Aknin
 Jyrki Alakuijala
 Steve Alexander
 Fred Allen
+Jeff Allen
 Ray Allen
 Billy G. Allie
 Kevin Altis
+Skyler Leigh Amador
 Joe Amenta
+Rose Ames
 A. Amoroso
 Mark Anacker
 Shashwat Anand
@@ -57,6 +63,7 @@
 Donovan Baarda
 Arne Babenhauserheide
 Attila Babo
+Matt Bachmann
 Marcin Bachry
 Alfonso Baciero
 Dwayne Bailey
@@ -71,6 +78,7 @@
 Daniel Barclay
 Nicolas Bareil
 Chris Barker
+Steven Barker
 Anton Barkovsky
 Nick Barnes
 Quentin Barnes
@@ -124,6 +132,7 @@
 Michael Birtwell
 Stuart Bishop
 Roy Bixler
+Daniel Black
 Jonathan Black
 Renaud Blanch
 Mike Bland
@@ -142,6 +151,7 @@
 Forest Bond
 Gregory Bond
 Matias Bordese
+Jonas Borgström
 Jurjen Bos
 Peter Bosch
 Dan Boswell
@@ -156,8 +166,10 @@
 Christopher Brannon
 Terrence Brannon
 Germán M. Bravo
+Sven Brauch
 Erik Bray
 Brian Brazil
+Demian Brecht
 Dave Brennan
 Tom Bridgman
 Anthony Briggs
@@ -165,6 +177,7 @@
 Tobias Brink
 Richard Brodie
 Michael Broghton
+Ammar Brohi
 Daniel Brotsky
 Jean Brouwers
 Gary S. Brown
@@ -174,9 +187,11 @@
 Francisco Martín Brugué
 Ian Bruntlett
 Floris Bruynooghe
+Matt Bryant
 Stan Bubrouski
 Erik de Bueger
 Jan-Hein Bührman
+Lars Buitinck
 Dick Bulterman
 Bill Bumgarner
 Jimmy Burgett
@@ -186,6 +201,7 @@
 Alastair Burt
 Tarn Weisner Burton
 Lee Busby
+Katherine Busch
 Ralph Butler
 Zach Byrne
 Nicolas Cadou
@@ -197,6 +213,7 @@
 Mike Carlton
 Pierre Carrier
 Terry Carroll
+Edward Catmur
 Lorenzo M. Catucci
 Donn Cave
 Charles Cazabon
@@ -205,6 +222,7 @@
 Matej Cepl
 Carl Cerecke
 Octavian Cerna
+Michael Cetrulo
 Dave Chambers
 Pascal Chambon
 John Chandler
@@ -220,17 +238,22 @@
 Jerry Chen
 Michael Chermside
 Ingrid Cheung
+Terry Chia
 Albert Chin-A-Young
 Adal Chiriliuc
 Matt Chisholm
+Lita Cho
 Anders Chrigström
 Tom Christiansen
+Renee Chu
 Vadim Chugunov
 Mauro Cicognini
 David Cinege
 Craig Citro
 Gilles Civario
 Chris Clark
+Diana Clarke
+Laurie Clark-Michalek
 Mike Clarkson
 Andrew Clegg
 Brad Clements
@@ -257,6 +280,7 @@
 Garrett Cooper
 Greg Copeland
 Aldo Cortesi
+Ian Cordasco
 David Costanzo
 Scott Cotton
 Greg Couch
@@ -275,6 +299,7 @@
 Joaquin Cuenca Abela
 John Cugini
 Tom Culliton
+Raúl Cumplido
 Antonio Cuni
 Brian Curtin
 Lisandro Dalcin
@@ -289,12 +314,14 @@
 Jonathan Dasteel
 Pierre-Yves David
 A. Jesse Jiryu Davis
+Merlijn van Deen
 John DeGood
 Ned Deily
 Vincent Delft
 Arnaud Delobelle
 Konrad Delong
 Erik Demaine
+Martin Dengler
 John Dennis
 L. Peter Deutsch
 Roger Dev
@@ -324,19 +351,23 @@
 John DuBois
 Paul Dubois
 Jacques Ducasse
+Andrei Dorian Duma
 Graham Dumpleton
 Quinn Dunkan
 Robin Dunn
 Luke Dunstan
 Virgil Dupras
+Bruno Dupuis
 Andy Dustman
 Gary Duzan
+Karmen Dykstra
 Eugene Dvurechenski
 Josip Dzolonga
 Maxim Dzumanenko
 Walter Dörwald
 Hans Eckardt
 Rodolpho Eckhardt
+Ulrich Eckhardt
 David Edelsohn
 John Edmonds
 Grant Edwards
@@ -351,6 +382,7 @@
 David Ely
 Jeff Epler
 Tom Epperly
+Gökcen Eraslan
 Stoffel Erasmus
 Jürgen A. Erhard
 Michael Ernst
@@ -377,17 +409,20 @@
 Boris Feld
 Thomas Fenzl
 Niels Ferguson
+Francisco Fernández Castaño
 Sebastian Fernandez
 Florian Festi
 John Feuerstein
 Carl Feynman
 Vincent Fiack
+Anastasia Filatova
 Tomer Filiba
 Jeffrey Finkelstein
 Russell Finn
 Dan Finnie
 Nils Fischbeck
 Frederik Fix
+Tom Flanagan
 Matt Fleming
 Hernán Martínez Foffani
 Artem Fokin
@@ -395,6 +430,7 @@
 Michael Foord
 Amaury Forgeot d'Arc
 Doug Fort
+Chris Foster
 John Fouhy
 Andrew Francis
 Stefan Franke
@@ -447,6 +483,8 @@
 Matt Giuca
 Wim Glenn
 Michael Goderbauer
+Karan Goel
+Jeroen Van Goey
 Christoph Gohlke
 Tim Golden
 Guilherme Gonçalves
@@ -455,17 +493,19 @@
 Shelley Gooch
 David Goodger
 Hans de Graaff
+Tim Graham
 Nathaniel Gray
 Eddy De Greef
 Grant Griffin
 Andrea Griffini
 Duncan Grisby
+Olivier Grisel
 Fabian Groffen
 Eric Groo
 Dag Gruneau
 Filip Gruszczyński
 Thomas Guettler
-Ajitesh Gupta
+Anuj Gupta
 Michael Guravage
 Lars Gustäbel
 Thomas Güttler
@@ -476,6 +516,7 @@
 Rasmus Hahn
 Peter Haight
 Václav Haisman
+Zbigniew Halas
 Walker Hale IV
 Bob Halley
 Jesse Hallio
@@ -491,6 +532,7 @@
 Lynda Hardman
 Derek Harland
 Jason Harper
+David Harrigan
 Brian Harring
 Jonathan Hartley
 Travis B. Hartwell
@@ -501,6 +543,7 @@
 Rycharde Hawkes
 Ben Hayden
 Jochen Hayek
+Tim Heaney
 Henrik Heimbuerger
 Christian Heimes
 Thomas Heller
@@ -520,6 +563,7 @@
 Magnus L. Hetland
 Raymond Hettinger
 Kevan Heydon
+Wouter van Heyst
 Kelsey Hightower
 Jason Hildebrand
 Richie Hindle
@@ -533,6 +577,7 @@
 Albert Hofkamp
 Tomas Hoger
 Jonathan Hogg
+Kamilla Holanda
 Steve Holden
 Akintayo Holder
 Thomas Holenstein
@@ -550,6 +595,7 @@
 Nadav Horesh
 Alon Horev
 Jan Hosang
+Jonathan Hosmer
 Alan Hourihane
 Ken Howard
 Brad Howes
@@ -561,6 +607,7 @@
 Jim Hugunin
 Greg Humphreys
 Eric Huss
+Nehal Hussain
 Taihyun Hwang
 Jeremy Hylton
 Ludwig Hähne
@@ -573,6 +620,7 @@
 Lars Immisch
 Bobby Impollonia
 Meador Inge
+Peter Ingebretson
 Tony Ingraldi
 John Interrante
 Bob Ippolito
@@ -606,6 +654,7 @@
 Fredrik Johansson
 Gregory K. Johnson
 Kent Johnson
+Michael Johnson
 Simon Johnston
 Matt Joiner
 Thomas Jollans
@@ -625,11 +674,13 @@
 Sarah K.
 Sunny K
 Bohuslav Kabrda
+Alexey Kachayev
 Bob Kahn
 Kurt B. Kaiser
 Tamito Kajiyama
 Jan Kaliszewski
 Peter van Kampen
+Jan Kanis
 Rafe Kaplan
 Jacob Kaplan-Moss
 Janne Karila
@@ -646,10 +697,12 @@
 Magnus Kessler
 Lawrence Kesteloot
 Vivek Khera
+Dhiru Kholia
 Mads Kiilerich
 Jason Killen
 Jan Kim
 Taek Joo Kim
+Sam Kimbrel
 W. Trevor King
 Paul Kippes
 Steve Kirsch
@@ -702,7 +755,9 @@
 Erno Kuusela
 Ross Lagerwall
 Cameron Laird
+David Lam
 Thomas Lamb
+Valerie Lambert
 Jean-Baptiste "Jiba" Lamy
 Ronan Lamy
 Torsten Landschoff
@@ -720,6 +775,8 @@
 Chris Lawrence
 Brian Leair
 Mathieu Leduc-Hamel
+Amandine Lee
+Antony Lee
 Christopher Lee
 Inyeol Lee
 James Lee
@@ -740,9 +797,11 @@
 Mateusz Lenik
 John Lenton
 Kostyantyn Leschenko
+Benno Leslie
 Christopher Tur Lesniewski-Laas
 Alain Leufroy
 Mark Levinson
+Mark Levitt
 William Lewis
 Akira Li
 Xuanji Li
@@ -766,14 +825,17 @@
 Anne Lord
 Tom Loredo
 Justin Love
+Ned Jackson Lovely
 Jason Lowe
 Tony Lownds
 Ray Loyzaga
+Kang-Hao (Kenny) Lu
 Lukas Lueg
 Loren Luke
 Fredrik Lundh
 Zhongyue Luo
 Mark Lutz
+Taras Lyapun
 Jim Lynch
 Mikael Lyngvig
 Martin von Löwis
@@ -784,9 +846,14 @@
 Tim MacKenzie
 Nick Maclaren
 Don MacMillen
+Tomasz Maćkowiak
+Wolfgang Maier
 Steve Majewski
+Marek Majkowski
 Grzegorz Makarewicz
 David Malcolm
+Greg Malcolm
+William Mallard
 Ken Manheimer
 Vladimir Marangozov
 Colin Marc
@@ -809,7 +876,9 @@
 Dieter Maurer
 Daniel May
 Madison May
+Lucas Maystre
 Arnaud Mazin
+Matt McClure
 Rebecca McCreary
 Kirk McDonald
 Chris McDonough
@@ -849,6 +918,7 @@
 Damien Miller
 Jason V. Miller
 Jay T. Miller
+Katie Miller
 Roman Milner
 Julien Miotte
 Andrii V. Mishkovskyi
@@ -858,6 +928,7 @@
 Florian Mladitsch
 Doug Moen
 The Dragon De Monsyne
+Bastien Montagne
 Skip Montanaro
 Peter Moody
 Paul Moore
@@ -865,6 +936,7 @@
 Ben Morgan
 Derek Morr
 James A Morrison
+Martin Morrison
 Derek McTavish Mounce
 Alessandro Moura
 Pablo Mouzo
@@ -879,6 +951,7 @@
 Louis Munro
 R. David Murray
 Matti Mäki
+Jörg Müller
 Dale Nagata
 John Nagle
 Takahiro Nakayama
@@ -917,6 +990,7 @@
 James Oakley
 Elena Oat
 Jon Oberheide
+Milan Oberkirch
 Pascal Oberndoerfer
 Jeffrey Ollie
 Adam Olsen
@@ -926,6 +1000,7 @@
 Tomas Oppelstrup
 Jason Orendorff
 Douglas Orr
+William Orr
 Michele Orrù
 Oleg Oshmyan
 Denis S. Otkidach
@@ -941,6 +1016,9 @@
 Todd R. Palmer
 Juan David Ibáñez Palomar
 Jan Palus
+Yongzhi Pan
+Martin Panter
+Mathias Panzenböck
 M. Papillon
 Peter Parente
 Alexandre Parenteau
@@ -949,6 +1027,7 @@
 Heikki Partanen
 Harri Pasanen
 Gaël Pasgrimaud
+Ashish Nitin Patil
 Randy Pausch
 Samuele Pedroni
 Justin Peel
@@ -967,8 +1046,10 @@
 Benjamin Peterson
 Joe Peterson
 Chris Petrilli
+Roumen Petrov
 Bjorn Pettersen
 Justin D. Pettit
+Esa Peuha
 Ronny Pfannschmidt
 Geoff Philbrick
 Gavrie Philipson
@@ -982,12 +1063,16 @@
 François Pinard
 Tom Pinckney
 Zach Pincus
+Zero Piraeus
 Michael Piotrowski
 Antoine Pitrou
 Jean-François Piéronne
 Oleg Plakhotnyuk
 Remi Pointel
+Jon Poler
+Ariel Poliak
 Guilherme Polo
+Illia Polosukhin
 Michael Pomraning
 Martin Pool
 Iustin Pop
@@ -998,18 +1083,22 @@
 Paul Prescod
 Donovan Preston
 Paul Price
+Iuliia Proskurnia
 Jyrki Pulliainen
 Steve Purcell
 Eduardo Pérez
 Fernando Pérez
 Pierre Quentel
 Brian Quinlan
+Kevin Jing Qiu
 Anders Qvist
 Thomas Rachel
+Ram Rachum
 Jérôme Radix
 Burton Radons
 Jeff Ramnani
 Brodie Rao
+Senko Rasic
 Antti Rasinen
 Nikolaus Rath
 Sridhar Ratnakumar
@@ -1037,12 +1126,13 @@
 Tim Rice
 Jan Pieter Riegel
 Armin Rigo
+Martin Richard
 Arc Riley
 Nicholas Riley
 Jean-Claude Rimbault
 Vlad Riscutia
 Wes Rishel
-Dan Riti
+Daniel Riti
 Juan M. Bello Rivas
 Davide Rizzo
 Anthony Roach
@@ -1102,6 +1192,7 @@
 Ty Sarna
 Hugh Sasse
 Bob Savage
+Dave Sawyer
 Ben Sayer
 sbt
 Marco Scataglini
@@ -1123,6 +1214,7 @@
 Chad J. Schroeder
 Christian Schubert
 Sam Schulenburg
+Andreas Schwab
 Stefan Schwarzer
 Dietmar Schwertberger
 Federico Schwindt
@@ -1144,6 +1236,7 @@
 Ha Shao
 Mark Shannon
 Richard Shapiro
+Varun Sharma
 Vlad Shcherbina
 Justin Sheehy
 Charlie Shepherd
@@ -1173,6 +1266,7 @@
 Kragen Sitaker
 Michael Sloan
 Nick Sloan
+Václav Šmilauer
 Christopher Smith
 Eric V. Smith
 Gregory P. Smith
@@ -1201,6 +1295,7 @@
 Anthony Starks
 Oliver Steele
 Greg Stein
+Marek Stepniowski
 Baruch Sterin
 Chris Stern
 Alex Stewart
@@ -1212,6 +1307,7 @@
 Serhiy Storchaka
 Ken Stox
 Dan Stromberg
+Donald Stufft
 Daniel Stutzbach
 Andreas Stührk
 Colin Su
@@ -1224,10 +1320,13 @@
 Kalle Svensson
 Andrew Svetlov
 Paul Swartz
+Al Sweigart
 Thenault Sylvain
 Péter Szabó
+John Szakmeister
 Amir Szekely
 Arfrever Frehtes Taifersar Arahesis
+Hideaki Takahashi
 Indra Talip
 Neil Tallim
 Geoff Talvola
@@ -1239,6 +1338,7 @@
 Monty Taylor
 Anatoly Techtonik
 Mikhail Terekhov
+Victor Terrón
 Richard M. Tew
 Tobias Thelen
 Févry Thibault
@@ -1246,6 +1346,7 @@
 Nicolas M. Thiéry
 James Thomas
 Robin Thomas
+Brian Thorne
 Stephen Thorne
 Jeremy Thurgood
 Eric Tiedemann
@@ -1326,6 +1427,7 @@
 Rodrigo Steinmuller Wanderley
 Ke Wang
 Greg Ward
+Tom Wardill
 Zachary Ware
 Jonas Wagner
 Barry Warsaw
@@ -1351,6 +1453,7 @@
 Felix Wiemann
 Gerry Wiener
 Frank Wierzbicki
+Santoso Wijaya
 Bryce "Zooko" Wilcox-O'Hearn
 Timothy Wild
 Jakub Wilk
@@ -1358,6 +1461,7 @@
 Jason Williams
 John Williams
 Sue Williams
+Carol Willing
 Steven Willis
 Frank Willison
 Geoff Wilson
@@ -1369,6 +1473,7 @@
 Dik Winter
 Blake Winton
 Jean-Claude Wippler
+Stéphane Wirtel
 Lars Wirzenius
 John Wiseman
 Chris Withers
@@ -1383,6 +1488,7 @@
 Gordon Worley
 Darren Worrall
 Thomas Wouters
+Daniel Wozniak
 Heiko Wundram
 Doug Wyatt
 Robert Xiao
@@ -1395,6 +1501,7 @@
 Danny Yoo
 Rory Yorke
 George Yoshida
+Kazuhiro Yoshida
 Masazumi Yoshikawa
 Arnaud Ysmal
 Bernard Yue
@@ -1410,4 +1517,6 @@
 Cheng Zhang
 Kai Zhu
 Tarek Ziadé
+Gennadiy Zlobin
+Doug Zongker
 Peter Åstrand
diff --git a/Misc/HISTORY b/Misc/HISTORY
index 01c635b..8370d8e 100644
--- a/Misc/HISTORY
+++ b/Misc/HISTORY
@@ -3,13 +3,4110 @@
 
 This file contains the release messages for previous Python releases.
 As you read on you go back to the dark ages of Python's history.
-(Note: news about 2.5c2 and later 2.5 releases is in the Misc/NEWS
-file of the release25-maint branch.)
 
 
 ======================================================================
 
 
+What's New in Python 3.3.0?
+===========================
+
+*Release date: 29-Sep-2012*
+
+Core and Builtins
+-----------------
+
+- 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.
+
+Extension Modules
+-----------------
+
+- Issue #16012: Fix a regression in pyexpat. The parser's UseForeignDTD()
+  method doesn't require an argument again.
+
+
+What's New in Python 3.3.0 Release Candidate 3?
+===============================================
+
+*Release date: 23-Sep-2012*
+
+Core and Builtins
+-----------------
+
+- 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.
+
+- 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
+  not be parsed.
+
+Extension Modules
+-----------------
+
+- Issue #15973: Fix a segmentation fault when comparing datetime timezone
+  objects.
+
+- 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
+  dump_traceback_later() and cancel_dump_tracebacks_later() to
+  cancel_dump_traceback_later().
+
+- _decimal module: use only C 89 style comments.
+
+
+What's New in Python 3.3.0 Release Candidate 2?
+===============================================
+
+*Release date: 09-Sep-2012*
+
+Core and Builtins
+-----------------
+
+- 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.
+
+- 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()
+  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
+  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
+  calling the C function wadd_wch()/mvwadd_wch() if the Python curses is linked
+  to libncursesw.
+
+Build
+-----
+
+- Issue #15822: Really ensure 2to3 grammar pickles are properly installed
+  (replaces fixes for Issue #15645).
+
+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
+
+
+What's New in Python 3.3.0 Release Candidate 1?
+===============================================
+
+*Release date: 25-Aug-2012*
+
+Core and Builtins
+-----------------
+
+- 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,
+  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
+  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
+
+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 #15544: Fix Decimal.__float__ to work with payload-carrying NaNs.
+
+- Issue #15249: 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
+  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 #15793: Stack corruption in ssl.RAND_egd().
+  Patch by Serhiy Storchaka.
+
+- 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 #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).
+
+C API
+-----
+
+Extension Modules
+-----------------
+
+Tools/Demos
+-----------
+
+Documentation
+-------------
+
+- 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
+
+- 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
+  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
+  Jeff Knupp.
+
+- Issue #15615: Add some tests for the json module's handling of invalid
+  input data.  Patch by Kushal Das.
+
+Build
+-----
+
+- Output lib files for PGO build into PGO directory.
+
+- 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
+  build step.
+
+- Issue #15511: Drop explicit dependency on pythonxy.lib from _decimal
+  amd64 configuration.
+
+- Add missing PGI/PGO configurations for pywlauncher.
+
+- Issue #15645: Ensure 2to3 grammar pickles are properly installed.
+
+
+What's New in Python 3.3.0 Beta 2?
+==================================
+
+*Release date: 12-Aug-2012*
+
+Core and Builtins
+-----------------
+
+- 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
+  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
+  value of 0 for 'level' and to not mention negative levels since they are not
+  supported.
+
+- Issue #15425: Eliminated traceback noise from more situations involving
+  importlib.
+
+- Issue #14578: Support modules registered in the Windows registry again.
+
+- Issue #15466: Stop using TYPE_INT64 in marshal, to make importlib.h (and other
+  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
+  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 #15368: An issue that caused bytecode generation to be non-deterministic
+  has been fixed.
+
+- 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
+  startup.
+
+- Issue #15111: When a module imported using 'from import' has an ImportError
+  inside itself, don't mask that fact behind a generic ImportError for the
+  module itself.
+
+- Issue #15293: Add GC support to the AST base node type.
+
+- Issue #15291: Fix a memory leak where AST nodes where not properly
+  deallocated.
+
+- Issue #15110: Fix the tracebacks generated by "import xxx" to not show the
+  importlib stack frames.
+
+- 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,
+  return the proper failure return value (1). Patch contributed by Jeff Knupp.
+
+- 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
+  Mac OS X, like other POSIX builds.
+
+Library
+-------
+
+- 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 #15163: Pydoc shouldn't list __loader__ as module data.
+
+- Issue #15471: Do not use mutable objects as defaults for
+  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)
+
+- 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.
+
+- Issue #15519: Properly expose WindowsRegistryFinder in importlib (and use the
+  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.
+
+- Issue #15499: Launching a webbrowser in Unix used to sleep for a few seconds.
+  Original patch by Anton Barkovsky.
+
+- 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
+  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
+  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 #15094: Incorrectly placed #endif in _tkinter.c.  Patch by Serhiy
+  Storchaka.
+
+- Issue #13922: argparse no longer incorrectly strips '--'s that appear after
+  the first one.
+
+- 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
+  avoid failing due to the select() file descriptor limit.
+
+- Issue #15180: Clarify posixpath.join() error message when mixing str & bytes.
+
+- Issue #15343: pkgutil now includes an iter_importer_modules implementation for
+  importlib.machinery.FileFinder (similar to the way it already handled
+  zipimport.zipimporter).
+
+- Issue #15314: runpy now sets __main__.__loader__ correctly.
+
+- Issue #15357: The import emulation in pkgutil is now deprecated. pkgutil uses
+  importlib internally rather than the emulation.
+
+- 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 #15230: runpy.run_path now correctly sets __package__ as described in
+  the documentation.
+
+- Issue #15315: Support VS 2010 in distutils cygwincompiler.
+
+- 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
+  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 #14814: Implement more consistent ordering and sorting behaviour for
+  ipaddress objects.
+
+- 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
+  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 #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
+  _frozen_importlib in sys.modules, not ImportError.
+
+- 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
+  flush().
+
+- Issue #10571: Fix the "--sign" option of distutils' upload command.  Patch by
+  Jakub Wilk.
+
+- Issue #9559: If messages were only added, a new file is no longer created and
+  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
+  cryptographic purpose.
+
+- Issue #15184: Ensure consistent results of OS X configuration tailoring for
+  universal builds by factoring out common OS X-specific customizations from
+  sysconfig, distutils.sysconfig, distutils.util, and distutils.unixccompiler
+  into a new module _osx_support.
+
+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
+  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.
+
+Extension Modules
+-----------------
+
+- Issue #15676: Now "mmap" check for empty files before doing the
+  offset check.  Patch by Steven Willis.
+
+- 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.
+
+Tools/Demos
+-----------
+
+- Issue #15458: python-config gets a new option --configdir to print the $LIBPL
+  value.
+
+- Move importlib.test.benchmark to Tools/importbench.
+
+- 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
+
+Documentation
+-------------
+
+- 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.
+
+- Issue #15230: Clearly document some of the limitations of the runpy module and
+  nudge readers towards importlib when appropriate.
+
+- Issue #15053: Copy Python 3.3 import lock change notice to all relevant
+  functions in imp instead of just at the top of the relevant section.
+
+- Issue #15288: Link to the term "loader" in notes in pkgutil about how things
+  won't work as expected in Python 3.3 and mark the requisite functions as
+  "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
+  contributed by Chris Jerdonek.
+
+Tests
+-----
+
+- 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 #15091: Reactivate a test on UNIX which was failing thanks to a
+  forgotten importlib.invalidate_caches() call.
+
+- Issue #15230: Adopted a more systematic approach in the runpy tests.
+
+- Issue #15300: Ensure the temporary test working directories are in the same
+  parent folder when running tests in multiprocess mode from a Python build.
+  Patch by Chris Jerdonek.
+
+- Issue #15284: Skip {send,recv}msg tests in test_socket when IPv6 is not
+  enabled. Patch by Brian Brazil.
+
+- Issue #15277: Fix a resource leak in support.py when IPv6 is disabled.  Patch
+  by Brian Brazil.
+
+Build
+-----
+
+- Issue #11715: Fix multiarch detection without having Debian development tools
+  (dpkg-dev) installed.
+
+- Issue #15037: Build OS X installers with local copy of ncurses 5.9 libraries
+  to avoid curses.unget_wch bug present in older versions of ncurses such as
+  those shipped with OS X.
+
+- Issue #15560: Fix building _sqlite3 extension on OS X with an SDK.  Also, for
+  OS X installers, ensure consistent sqlite3 behavior and feature availability
+  by building a local copy of libsqlite3 rather than depending on the wide range
+  of versions supplied with various OS X releases.
+
+- Issue #8847: Disable COMDAT folding in Windows PGO builds.
+
+- Issue #14018: Fix OS X Tcl/Tk framework checking when using OS X SDKs.
+
+- Issue #15431: Add _freeze_importlib project to regenerate importlib.h on
+  Windows. Patch by Kristján Valur Jónsson.
+
+- Issue #14197: For OS X framework builds, ensure links to the shared library
+  are created with the proper ABI suffix.
+
+- Issue #14330: For cross builds, don't use host python, use host search paths
+  for host compiler.
+
+- Issue #15235: Allow Berkley DB versions up to 5.3 to build the dbm module.
+
+- Issue #15268: Search curses.h in /usr/include/ncursesw.
+
+
+What's New in Python 3.3.0 Beta 1?
+==================================
+
+*Release date: 27-Jun-2012*
+
+Core and Builtins
+-----------------
+
+- Fix a (most likely) very rare memory leak when calling main() and not being
+  able to decode a command-line argument.
+
+- Issue #14815: Use Py_ssize_t instead of long for the object hash, to
+  preserve all 64 bits of hash on Win64.
+
+- Issue #12268: File readline, readlines and read() or readall() methods
+  no longer lose data when an underlying read system call is interrupted.
+  IOError is no longer raised due to a read system call returning EINTR
+  from within these methods.
+
+- Issue #11626: Add _SizeT functions to stable ABI.
+
+- Issue #15146: Add PyType_FromSpecWithBases. Patch by Robin Schreiber.
+
+- Issue #15142: Fix reference leak when deallocating instances of types
+  created using PyType_FromSpec().
+
+- Issue #15042: Add PyState_AddModule and PyState_RemoveModule. Add version
+  guard for Py_LIMITED_API additions. Patch by Robin Schreiber.
+
+- Issue #10053: Don't close FDs when FileIO.__init__ fails. Loosely based on
+  the work by Hirokazu Yamamoto.
+
+- Issue #15096: Removed support for ur'' as the raw notation isn't
+  compatible with Python 2.x's raw unicode strings.
+
+- Issue #13783: Generator objects now use the identifier APIs internally
+
+- Issue #14874: Restore charmap decoding speed to pre-PEP 393 levels.
+  Patch by Serhiy Storchaka.
+
+- Issue #15026: utf-16 encoding is now significantly faster (up to 10x).
+  Patch by Serhiy Storchaka.
+
+- Issue #11022: open() and io.TextIOWrapper are now calling
+  locale.getpreferredencoding(False) instead of locale.getpreferredencoding()
+  in text mode if the encoding is not specified. Don't change temporary the
+  locale encoding using locale.setlocale(), use the current locale encoding
+  instead of the user preferred encoding.
+
+- Issue #14673: Add Eric Snow's sys.implementation implementation.
+
+- Issue #15038: Optimize python Locks on Windows.
+
+Library
+-------
+
+- Issue #9803: Don't close IDLE on saving if breakpoint is open.
+  Patch by Roger Serwy.
+
+- Issue #12288: Consider '0' and '0.0' as valid initialvalue
+  for tkinter SimpleDialog.
+
+- Issue #15512: Add a __sizeof__ implementation for parser.
+  Patch by Serhiy Storchaka.
+
+- Issue #15469: Add a __sizeof__ implementation for deque objects.
+  Patch by Serhiy Storchaka.
+
+- Issue #15489: Add a __sizeof__ implementation for BytesIO objects.
+  Patch by Serhiy Storchaka.
+
+- Issue #15487: Add a __sizeof__ implementation for buffered I/O objects.
+  Patch by Serhiy Storchaka.
+
+- Issue #15514: Correct __sizeof__ support for cpu_set.
+  Patch by Serhiy Storchaka.
+
+- Issue #15187: Bugfix: remove temporary directories test_shutil was leaving
+  behind.
+
+- Issue #15177: Added dir_fd parameter to os.fwalk().
+
+- Issue #15176: Clarified behavior, documentation, and implementation
+  of os.listdir().
+
+- Issue #15061: Re-implemented hmac.compare_digest() in C to prevent further
+  timing analysis and to support all buffer protocol aware objects as well as
+  ASCII only str instances safely.
+
+- Issue #15164: Change return value of platform.uname() from a
+  plain tuple to a collections.namedtuple.
+
+- Support Mageia Linux in the platform module.
+
+- Issue #11678: Support Arch linux in the platform module.
+
+- Issue #15118: Change return value of os.uname() and os.times() from
+  plain tuples to immutable iterable objects with named attributes
+  (structseq objects).
+
+- Speed up _decimal by another 10-15% by caching the thread local context
+  that was last accessed. In the pi benchmark (64-bit platform, prec=9),
+  _decimal is now only 1.5x slower than float.
+
+- Remove the packaging module, which is not ready for prime time.
+
+- Issue #15154: Add "dir_fd" parameter to os.rmdir, remove "rmdir"
+  parameter from os.remove / os.unlink.
+
+- Issue #4489: Add a shutil.rmtree that isn't susceptible to symlink attacks.
+  It is used automatically on platforms supporting the necessary os.openat()
+  and os.unlinkat() functions. Main code by Martin von Löwis.
+
+- Issue #15156: HTMLParser now uses the new "html.entities.html5" dictionary.
+
+- Issue #11113: add a new "html5" dictionary containing the named character
+  references defined by the HTML5 standard and the equivalent Unicode
+  character(s) to the html.entities module.
+
+- Issue #15114: the strict mode of HTMLParser and the HTMLParseError exception
+  are deprecated now that the parser is able to parse invalid markup.
+
+- Issue #3665: \u and \U escapes are now supported in unicode regular
+  expressions.  Patch by Serhiy Storchaka.
+
+- Issue #15153: Added inspect.getgeneratorlocals to simplify white box
+  testing of generator state updates
+
+- Issue #13062: Added inspect.getclosurevars to simplify testing stateful
+  closures
+
+- Issue #11024: Fixes and additional tests for Time2Internaldate.
+
+- 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 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;
+  implemented by Larry Hastings.
+
+- Issue #15008: Implement PEP 362 "Signature Objects".
+  Patch by Yury Selivanov.
+
+- Issue: #15138: base64.urlsafe_{en,de}code() are now 3-4x faster.
+
+- Issue #444582: Add shutil.which, for finding programs on the system path.
+  Original patch by Erik Demaine, with later iterations by Jan Killian
+  and Brian Curtin.
+
+- Issue #14837: SSL errors now have ``library`` and ``reason`` attributes
+  describing precisely what happened and in which OpenSSL submodule.  The
+  str() of a SSLError is also enhanced accordingly.
+
+- Issue #9527: datetime.astimezone() method will now supply a class
+  timezone instance corresponding to the system local timezone when
+  called with no arguments.
+
+- Issue #14653: email.utils.mktime_tz() no longer relies on system
+  mktime() when timezone offest is supplied.
+
+- Issue #14684: zlib.compressobj() and zlib.decompressobj() now support the use
+  of predefined compression dictionaries. Original patch by Sam Rushing.
+
+- Fix GzipFile's handling of filenames given as bytes objects.
+
+- Issue #14772: Return destination values from some shutil functions.
+
+- Issue #15064: Implement context management protocol for multiprocessing types
+
+- Issue #15101: Make pool finalizer avoid joining current thread.
+
+- Issue #14657: The frozen instance of importlib used for bootstrap is now
+  also the module imported as importlib._bootstrap.
+
+- Issue #14055: Add __sizeof__ support to _elementtree.
+
+- Issue #15054: A bug in tokenize.tokenize that caused string literals
+  with 'b' prefixes to be incorrectly tokenized has been fixed.
+  Patch by Serhiy Storchaka.
+
+- Issue #15006: Allow equality comparison between naive and aware
+  time or datetime objects.
+
+- Issue #14982: Document that pkgutil's iteration functions require the
+  non-standard iter_modules() method to be defined by an importer (something
+  the importlib importers do not define).
+
+- Issue #15036: Mailbox no longer throws an error if a flush is done
+  between operations when removing or changing multiple items in mbox,
+  MMDF, or Babyl mailboxes.
+
+- Issue #14059: Implement multiprocessing.Barrier.
+
+- Issue #15061: The inappropriately named hmac.secure_compare has been
+  renamed to hmac.compare_digest, restricted to operating on bytes inputs
+  only and had its documentation updated to more accurately reflect both its
+  intent and its limitations
+
+- Issue #13841: Make child processes exit using sys.exit() on Windows.
+
+- Issue #14936: curses_panel was converted to PEP 3121 and PEP 384 API.
+  Patch by Robin Schreiber.
+
+- Issue #1667546: On platforms supporting tm_zone and tm_gmtoff fields
+  in struct tm, time.struct_time objects returned by time.gmtime(),
+  time.localtime() and time.strptime() functions now have tm_zone and
+  tm_gmtoff attributes.  Original patch by Paul Boddie.
+
+- Rename adjusted attribute to adjustable in time.get_clock_info() result.
+
+- Issue #3518: Remove references to non-existent BaseManager.from_address()
+  method.
+
+- Issue #13857: Added textwrap.indent() function (initial patch by Ezra
+  Berch)
+
+- Issue #2736: Added datetime.timestamp() method.
+
+- Issue #13854: Make multiprocessing properly handle non-integer
+  non-string argument to SystemExit.
+
+- Issue #12157: Make pool.map() empty iterables correctly.  Initial
+  patch by mouad.
+
+- Issue #11823: disassembly now shows argument counts on calls with keyword args.
+
+- Issue #14711: os.stat_float_times() has been deprecated.
+
+- LZMAFile now accepts the modes "rb"/"wb"/"ab" as synonyms of "r"/"w"/"a".
+
+- The bz2 and lzma modules now each contain an open() function, allowing
+  compressed files to readily be opened in text mode as well as binary mode.
+
+- BZ2File.__init__() and LZMAFile.__init__() now accept a file object as their
+  first argument, rather than requiring a separate "fileobj" argument.
+
+- gzip.open() now accepts file objects as well as filenames.
+
+- Issue #14992: os.makedirs(path, exist_ok=True) would raise an OSError
+  when the path existed and had the S_ISGID mode bit set when it was
+  not explicitly asked for.  This is no longer an exception as mkdir
+  cannot control if the OS sets that bit for it or not.
+
+- Issue #14989: Make the CGI enable option to http.server available via command
+  line.
+
+- Issue #14987: Add a missing import statement to inspect.
+
+- Issue #1079: email.header.decode_header now correctly parses all the examples
+  in RFC2047.  There is a necessary visible behavior change: the leading and/or
+  trailing whitespace on ASCII parts is now preserved.
+
+- Issue #14969: Better handling of exception chaining in contextlib.ExitStack
+
+- Issue #14962: Update text coloring in IDLE shell window after changing
+  options.  Patch by Roger Serwy.
+
+- Issue #14963: Convert contextlib.ExitStack.__exit__ to use an iterative
+  algorithm (Patch by Alon Horev)
+
+- Issue #14785: Add sys._debugmallocstats() to help debug low-level memory
+  allocation issues
+
+- Issue #14443: Ensure that .py files are byte-compiled with the correct Python
+  executable within bdist_rpm even on older versions of RPM
+
+C-API
+-----
+
+- Issue #13783: Inadvertent additions to the public C API in the PEP 380
+  implementation have either been removed or marked as private interfaces.
+
+Extension Modules
+-----------------
+
+- Issue #15000: Support the "unique" x32 architecture in _posixsubprocess.c.
+
+Documentation
+-------------
+
+- Issue #15081: Document PyState_FindModule.
+  Patch by Robin Schreiber.
+
+- Issue #14814: Added first draft of ipaddress module API reference
+
+Tests
+-----
+
+- Issue #14769: test_capi now has SkipitemTest, which cleverly checks
+  for "parity" between PyArg_ParseTuple() and the Python/getargs.c static
+  function skipitem() for all possible "format units".
+
+- test_nntplib now tolerates being run from behind NNTP gateways that add
+  "X-Antivirus" headers to articles
+
+- Issue #15043: test_gdb is now skipped entirely if gdb security settings
+  block loading of the gdb hooks
+
+- Issue #14963: Add test cases for exception handling behaviour
+  in contextlib.ExitStack (Initial patch by Alon Horev)
+
+Build
+-----
+
+- Issue #13590: Improve support for OS X Xcode 4:
+    * Try to avoid building Python or extension modules with problematic
+      llvm-gcc compiler.
+    * Since Xcode 4 removes ppc support, extension module builds now
+      check for ppc compiler support and automatically remove ppc and
+      ppc64 archs when not available.
+    * Since Xcode 4 no longer install SDKs in default locations,
+      extension module builds now revert to using installed headers
+      and libs if the SDK used to build the interpreter is not
+      available.
+    * Update ./configure to use better defaults for universal builds;
+      in particular, --enable-universalsdk=yes uses the Xcode default
+      SDK and --with-universal-archs now defaults to "intel" if ppc
+      not available.
+
+- Issue #14225: Fix Unicode support for curses (#12567) on OS X
+
+- Issue #14928: Fix importlib bootstrap issues by using a custom executable
+  (Modules/_freeze_importlib) to build Python/importlib.h.
+
+
+What's New in Python 3.3.0 Alpha 4?
+===================================
+
+*Release date: 31-May-2012*
+
+Core and Builtins
+-----------------
+
+- Issue #14835: Make plistlib output empty arrays & dicts like OS X.
+  Patch by Sidney San Martín.
+
+- Issue #14744: Use the new _PyUnicodeWriter internal API to speed up
+  str%args and str.format(args).
+
+- Issue #14930: Make memoryview objects weakrefable.
+
+- Issue #14775: Fix a potential quadratic dict build-up due to the garbage
+  collector repeatedly trying to untrack dicts.
+
+- Issue #14857: fix regression in references to PEP 3135 implicit __class__
+  closure variable (Reopens issue #12370)
+
+- Issue #14712 (PEP 405): Virtual environments. Implemented by Vinay Sajip.
+
+- Issue #14660 (PEP 420): Namespace packages. Implemented by Eric Smith.
+
+- Issue #14494: Fix __future__.py and its documentation to note that
+  absolute imports are the default behavior in 3.0 instead of 2.7.
+  Patch by Sven Marnach.
+
+- Issue #9260: A finer-grained import lock.  Most of the import sequence
+  now uses per-module locks rather than the global import lock, eliminating
+  well-known issues with threads and imports.
+
+- Issue #14624: UTF-16 decoding is now 3x to 4x faster on various inputs.
+  Patch by Serhiy Storchaka.
+
+- asdl_seq and asdl_int_seq are now Py_ssize_t sized.
+
+- Issue #14133 (PEP 415): Implement suppression of __context__ display with an
+  attribute on BaseException. This replaces the original mechanism of PEP 409.
+
+- Issue #14417: Mutating a dict during lookup now restarts the lookup instead
+  of raising a RuntimeError (undoes issue #14205).
+
+- Issue #14738: Speed-up UTF-8 decoding on non-ASCII data.  Patch by Serhiy
+  Storchaka.
+
+- Issue #14700: Fix two broken and undefined-behaviour-inducing overflow checks
+  in old-style string formatting.
+
+- Issue #14705: The PyArg_Parse() family of functions now support the 'p' format
+  unit, which accepts a "boolean predicate" argument.  It converts any Python
+  value into an integer--0 if it is "false", and 1 otherwise.
+
+Library
+-------
+
+- Issue #14690: Use monotonic clock instead of system clock in the sched,
+  subprocess and trace modules.
+
+- Issue #14958: Change IDLE systax highlighting to recognize all string and
+  byte literals supported in Python 3.3.
+
+- Issue #10997: Prevent a duplicate entry in IDLE's "Recent Files" menu.
+
+- Issue #14443: Tell rpmbuild to use the correct version of Python in
+  bdist_rpm. Initial patch by Ross Lagerwall.
+
+- Issue #14929: Stop Idle 3.x from closing on Unicode decode errors when
+  grepping. Patch by Roger Serwy.
+
+- Issue #12515: email now registers a defect if it gets to EOF while parsing
+  a MIME part without seeing the closing MIME boundary.
+
+- Issue #12510: Attempting to get invalid tooltip no longer closes Idle.
+  Other tooltipss have been corrected or improved and the number of tests
+  has been tripled. Original patch by Roger Serwy.
+
+- Issue #1672568: email now always decodes base64 payloads, adding padding and
+  ignoring non-base64-alphabet characters if needed, and registering defects
+  for any such problems.
+
+- Issue #14925: email now registers a defect when the parser decides that there
+  is a missing header/body separator line.  MalformedHeaderDefect, which the
+  existing code would never actually generate, is deprecated.
+
+- Issue #10365: File open dialog now works instead of crashing even when
+  the parent window is closed before the dialog. Patch by Roger Serwy.
+
+- Issue #8739: Updated smtpd to support RFC 5321, and added support for the
+  RFC 1870 SIZE extension.
+
+- Issue #665194: Added a localtime function to email.utils to provide an
+  aware local datetime for use in setting Date headers.
+
+- Issue #12586: Added new provisional policies that implement convenient
+  unicode support for email headers.  See What's New for details.
+
+- Issue #14731: Refactored email Policy framework to support full backward
+  compatibility with Python 3.2 by default yet allow for the introduction of
+  new features through new policies.  Note that Policy.must_be_7bit is renamed
+  to cte_type.
+
+- Issue #14876: Use user-selected font for highlight configuration.
+
+- Issue #14920: Fix the help(urllib.parse) failure on locale C on terminals.
+  Have ascii characters in help.
+
+- Issue #14548: Make multiprocessing finalizers check pid before
+  running to cope with possibility of gc running just after fork.
+
+- Issue #14863: Update the documentation of os.fdopen() to reflect the
+  fact that it's only a thin wrapper around open() anymore.
+
+- Issue #14036: Add an additional check to validate that port in urlparse does
+  not go in illegal range and returns None.
+
+- Issue #14862: Add missing names to os.__all__
+
+- Issue #14875: Use float('inf') instead of float('1e66666') in the json module.
+
+- Issue #13585: Added contextlib.ExitStack
+
+- PEP 3144, Issue #14814: Added the ipaddress module
+
+- Issue #14426: Correct the Date format in Expires attribute of Set-Cookie
+  Header in Cookie.py.
+
+- Issue #14588: The types module now provide new_class() and prepare_class()
+  functions to support PEP 3115 compliant dynamic class creation. Patch by
+  Daniel Urban and Nick Coghlan.
+
+- Issue #13152: Allow to specify a custom tabsize for expanding tabs in
+  textwrap. Patch by John Feuerstein.
+
+- Issue #14721: Send the correct 'Content-length: 0' header when the body is an
+  empty string ''. Initial Patch contributed by Arve Knudsen.
+
+- Issue #14072: Fix parsing of 'tel' URIs in urlparse by making the check for
+  ports stricter.
+
+- Issue #9374: Generic parsing of query and fragment portions of url for any
+  scheme. Supported both by RFC3986 and RFC2396.
+
+- Issue #14798: Fix the functions in pyclbr to raise an ImportError
+  when the first part of a dotted name is not a package. Patch by
+  Xavier de Gaye.
+
+- Issue #12098: multiprocessing on Windows now starts child processes
+  using the same sys.flags as the current process.  Initial patch by
+  Sergey Mezentsev.
+
+- Issue #13031: Small speed-up for tarfile when unzipping tarfiles.
+  Patch by Justin Peel.
+
+- Issue #14780: urllib.request.urlopen() now has a ``cadefault`` argument
+  to use the default certificate store.  Initial patch by James Oakley.
+
+- Issue #14829: Fix bisect and range() indexing with large indices
+  (>= 2 ** 32) under 64-bit Windows.
+
+- Issue #14732: The _csv module now uses PEP 3121 module initialization.
+  Patch by Robin Schreiber.
+
+- Issue #14809: Add HTTP status codes introduced by RFC 6585 to http.server
+  and http.client. Patch by EungJun Yi.
+
+- Issue #14777: tkinter may return undecoded UTF-8 bytes as a string when
+  accessing the Tk clipboard.  Modify clipboad_get() to first request type
+  UTF8_STRING when no specific type is requested in an X11 windowing
+  environment, falling back to the current default type STRING if that fails.
+  Original patch by Thomas Kluyver.
+
+- Issue #14773: Fix os.fwalk() failing on dangling symlinks.
+
+- Issue #12541: Be lenient with quotes around Realm field of HTTP Basic
+  Authentation in urllib2.
+
+- Issue #14807: move undocumented tarfile.filemode() to stat.filemode() and add
+  doc entry. Add tarfile.filemode alias with deprecation warning.
+
+- Issue #13815: TarFile.extractfile() now returns io.BufferedReader objects.
+
+- Issue #14532: Add a secure_compare() helper to the hmac module, to mitigate
+  timing attacks. Patch by Jon Oberheide.
+
+- Add importlib.util.resolve_name().
+
+- Issue #14366: Support lzma compression in zip files.
+  Patch by Serhiy Storchaka.
+
+- Issue #13959: Introduce importlib.find_loader() and document
+  imp.find_module/load_module as deprecated.
+
+- Issue #14082: shutil.copy2() now copies extended attributes, if possible.
+  Patch by Hynek Schlawack.
+
+- Issue #13959: Make importlib.abc.FileLoader.load_module()/get_filename() and
+  importlib.machinery.ExtensionFileLoader.load_module() have their single
+  argument be optional. Allows for the replacement (and thus deprecation) of
+  imp.load_source()/load_package()/load_compiled().
+
+- Issue #13959: imp.get_suffixes() has been deprecated in favour of the new
+  attributes on importlib.machinery: SOURCE_SUFFIXES, DEBUG_BYTECODE_SUFFIXES,
+  OPTIMIZED_BYTECODE_SUFFIXES, BYTECODE_SUFFIXES, and EXTENSION_SUFFIXES. This
+  led to an indirect deprecation of inspect.getmoduleinfo().
+
+- Issue #14662: Prevent shutil failures on OS X when destination does not
+  support chflag operations.  Patch by Hynek Schlawack.
+
+- Issue #14157: Fix time.strptime failing without a year on February 29th.
+  Patch by Hynek Schlawack.
+
+- Issue #14753: Make multiprocessing's handling of negative timeouts
+  the same as it was in Python 3.2.
+
+- Issue #14583: Fix importlib bug when a package's __init__.py would first
+  import one of its modules then raise an error.
+
+- Issue #14741: Fix missing support for Ellipsis ('...') in parser module.
+
+- Issue #14697: Fix missing support for set displays and set comprehensions in
+  parser module.
+
+- Issue #14701: Fix missing support for 'raise ... from' in parser module.
+
+- Add support for timeouts to the acquire() methods of
+  multiprocessing's lock/semaphore/condition proxies.
+
+- Issue #13989: Add support for text mode to gzip.open().
+
+- Issue #14127: The os.stat() result object now provides three additional
+  fields: st_ctime_ns, st_mtime_ns, and st_atime_ns, providing those times as an
+  integer with nanosecond resolution.  The functions os.utime(), os.lutimes(),
+  and os.futimes() now accept a new parameter, ns, which accepts mtime and atime
+  as integers with nanosecond resolution.
+
+- Issue #14127 and #10148: shutil.copystat now preserves exact mtime and atime
+  on filesystems providing nanosecond resolution.
+
+Tools/Demos
+-----------
+
+- Issue #14695: Bring Tools/parser/unparse.py support up to date with
+  the Python 3.3 Grammar.
+
+Build
+-----
+
+- Issue #14472: Update .gitignore. Patch by Matej Cepl.
+
+- Upgrade Windows library versions: bzip 1.0.6, OpenSSL 1.0.1c.
+
+- Issue #14693: Under non-Windows platforms, hashlib's fallback modules are
+  always compiled, even if OpenSSL is present at build time.
+
+- Issue #13210: Windows build now uses VS2010, ported from VS2008.
+
+Documentation
+-------------
+
+- Issue #14588: The language reference now accurately documents the Python 3
+  class definition process. Patch by Nick Coghlan.
+
+- Issue #14943: Correct a default argument value for winreg.OpenKey
+  and correctly list the argument names in the function's explanation.
+
+
+What's New in Python 3.3.0 Alpha 3?
+===================================
+
+*Release date: 01-May-2012*
+
+Core and Builtins
+-----------------
+
+- Issue #14699: Fix calling the classmethod descriptor directly.
+
+- Issue #14433: Prevent msvcrt crash in interactive prompt when stdin is closed.
+
+- Issue #14521: Make result of float('nan') and float('-nan') more consistent
+  across platforms.
+
+- Issue #14646: __import__() sets __loader__ if the loader did not.
+
+- Issue #14605: No longer have implicit entries in sys.meta_path. If
+  sys.meta_path is found to be empty, raise ImportWarning.
+
+- Issue #14605: No longer have implicit entries in sys.path_hooks. If
+  sys.path_hooks is found to be empty, a warning will be raised. None is now
+  inserted into sys.path_importer_cache if no finder was discovered. This also
+  means imp.NullImporter is no longer implicitly used.
+
+- Issue #13903: Implement PEP 412. Individual dictionary instances can now share
+  their keys with other dictionaries. Classes take advantage of this to share
+  their instance dictionary keys for improved memory and performance.
+
+- Issue #11603 (again): Setting __repr__ to __str__ now raises a RuntimeError
+  when repr() or str() is called on such an object.
+
+- Issue #14658: Fix binding a special method to a builtin implementation of a
+  special method with a different name.
+
+- Issue #14630: Fix a memory access bug for instances of a subclass of int
+  with value 0.
+
+- Issue #14339: Speed improvements to bin, oct and hex functions.  Patch by
+  Serhiy Storchaka.
+
+- Issue #14098: New functions PyErr_GetExcInfo and PyErr_SetExcInfo.
+  Patch by Stefan Behnel.
+
+- Issue #14385: It is now possible to use a custom type for the __builtins__
+  namespace, instead of a dict. It can be used for sandboxing for example.
+  Raise also a NameError instead of ImportError if __build_class__ name if not
+  found in __builtins__.
+
+- Issue #12599: Be more strict in accepting None compared to a false-like
+  object for importlib.util.module_for_loader and
+  importlib.machinery.PathFinder.
+
+- Issue #14612: Fix jumping around with blocks by setting f_lineno.
+
+- Issue #14592: Attempting a relative import w/o __package__ or __name__ set in
+  globals raises a KeyError.
+
+- Issue #14607: Fix keyword-only arguments which started with ``__``.
+
+- Issue #10854: The ImportError raised when an extension module on Windows
+  fails to import now uses the new path and name attributes from
+  Issue #1559549.
+
+- Issue #13889: Check and (if necessary) set FPU control word before calling
+  any of the dtoa.c string <-> float conversion functions, on MSVC builds of
+  Python.  This fixes issues when embedding Python in a Delphi app.
+
+- __import__() now matches PEP 328 and documentation by defaulting 'index' to 0
+  instead of -1 and removing support for negative values.
+
+- Issue #2377: Make importlib the implementation of __import__().
+
+- Issue #1559549: ImportError now has 'name' and 'path' attributes that are set
+  using keyword arguments to its constructor. They are currently not set by
+  import as they are meant for use by importlib.
+
+- Issue #14474: Save and restore exception state in thread.start_new_thread()
+  while writing error message if the thread leaves a unhandled exception.
+
+- Issue #13019: Fix potential reference leaks in bytearray.extend().  Patch
+  by Suman Saha.
+
+Library
+-------
+
+- Issue #14768: os.path.expanduser('~/a') doesn't works correctly when HOME is '/'.
+
+- Issue #14371: Support bzip2 in zipfile module.  Patch by Serhiy Storchaka.
+
+- Issue #13183: Fix pdb skipping frames after hitting a breakpoint and running
+  step.  Patch by Xavier de Gaye.
+
+- Issue #14696: Fix parser module to understand 'nonlocal' declarations.
+
+- Issue #10941: Fix imaplib.Internaldate2tuple to produce correct result near
+  the DST transition.  Patch by Joe Peterson.
+
+- Issue #9154: Fix parser module to understand function annotations.
+
+- Issue #6085: In http.server.py SimpleHTTPServer.address_string returns the
+  client ip address instead client hostname. Patch by Charles-François Natali.
+
+- Issue #14309: Deprecate time.clock(), use time.perf_counter() or
+  time.process_time() instead.
+
+- Issue #14428: Implement the PEP 418. Add time.get_clock_info(),
+  time.perf_counter() and time.process_time() functions, and rename
+  time.steady() to time.monotonic().
+
+- Issue #14646: importlib.util.module_for_loader() now sets __loader__ and
+  __package__ (when possible).
+
+- Issue #14664: It is now possible to use @unittest.skip{If,Unless} on a
+  test class that doesn't inherit from TestCase (i.e. a mixin).
+
+- Issue #4892: multiprocessing Connections can now be transferred over
+  multiprocessing Connections.  Patch by Richard Oudkerk (sbt).
+
+- Issue #14160: TarFile.extractfile() failed to resolve symbolic links when
+  the links were not located in an archive subdirectory.
+
+- Issue #14638: pydoc now treats non-string __name__ values as if they
+  were missing, instead of raising an error.
+
+- Issue #13684: Fix httplib tunnel issue of infinite loops for certain sites
+  which send EOF without trailing \r\n.
+
+- Issue #14605: Add importlib.abc.FileLoader, importlib.machinery.(FileFinder,
+  SourceFileLoader, SourcelessFileLoader, ExtensionFileLoader).
+
+- Issue #13959: imp.cache_from_source()/source_from_cache() now follow
+  os.path.join()/split() semantics for path manipulation instead of its prior,
+  custom semantics of caring the right-most path separator forward in path
+  joining.
+
+- Issue #2193: Allow ":" character in Cookie NAME values.
+
+- Issue #14629: tokenizer.detect_encoding will specify the filename in the
+  SyntaxError exception if found at readline.__self__.name.
+
+- Issue #14629: Raise SyntaxError in tokenizer.detect_encoding if the
+  first two lines have non-UTF-8 characters without an encoding declaration.
+
+- Issue #14308: Fix an exception when a "dummy" thread is in the threading
+  module's active list after a fork().
+
+- Issue #11750: The Windows API functions scattered in the _subprocess and
+  _multiprocessing.win32 modules now live in a single module "_winapi".
+  Patch by sbt.
+
+- Issue #14087: multiprocessing: add Condition.wait_for(). Patch by sbt.
+
+- Issue #14538: HTMLParser can now parse correctly start tags that contain
+  a bare '/'.
+
+- Issue #14452: SysLogHandler no longer inserts a UTF-8 BOM into the message.
+
+- Issue #14386: Expose the dict_proxy internal type as types.MappingProxyType.
+
+- Issue #13959: Make imp.reload() always use a module's __loader__ to perform
+  the reload.
+
+- Issue #13959: Add imp.py and rename the built-in module to _imp, allowing for
+  re-implementing parts of the module in pure Python.
+
+- Issue #13496: Fix potential overflow in bisect.bisect algorithm when applied
+  to a collection of size > sys.maxsize / 2.
+
+- Have importlib take advantage of ImportError's new 'name' and 'path'
+  attributes.
+
+- 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 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
+  with "<" and ends with ">" instead of special-casing "<string>" and
+  "<doctest ".
+
+- Issue #12537: The mailbox module no longer depends on knowledge of internal
+  implementation details of the email package Message object.
+
+- Issue #7978: socketserver now restarts the select() call when EINTR is
+  returned.  This avoids crashing the server loop when a signal is received.
+  Patch by Jerzy Kozera.
+
+- Issue #14522: Avoid duplicating socket handles in multiprocessing.connection.
+  Patch by sbt.
+
+- Don't Py_DECREF NULL variable in io.IncrementalNewlineDecoder.
+
+- Issue #8515: Set __file__ when run file in IDLE.
+  Initial patch by Bruce Frederiksen.
+
+- Issue #14496: Fix wrong name in idlelib/tabbedpages.py.
+  Patch by Popa Claudiu.
+
+- Issue #3033: Add displayof parameter to tkinter font. Patch by Guilherme Polo.
+
+- Issue #14482: Raise a ValueError, not a NameError, when trying to create
+  a multiprocessing Client or Listener with an AF_UNIX type address under
+  Windows.  Patch by Popa Claudiu.
+
+- Issue #802310: Generate always unique tkinter font names if not directly passed.
+
+- Issue #14151: Raise a ValueError, not a NameError, when trying to create
+  a multiprocessing Client or Listener with an AF_PIPE type address under
+  non-Windows platforms.  Patch by Popa Claudiu.
+
+- Issue #14493: Use gvfs-open or xdg-open in webbrowser.
+
+Build
+-----
+
+- "make touch" will now touch generated files that are checked into Mercurial,
+  after a "hg update" which failed to bring the timestamps into the right order.
+
+Tests
+-----
+
+- Issue #14026: In test_cmd_line_script, check that sys.argv is populated
+  correctly for the various invocation approaches (Patch by Jason Yeo)
+
+- Issue #14032: Fix incorrect variable name in test_cmd_line_script debugging
+  message (Patch by Jason Yeo)
+
+- Issue #14589: Update certificate chain for sha256.tbs-internet.com, fixing
+  a test failure in test_ssl.
+
+- Issue #14355: Regrtest now supports the standard unittest test loading, and
+  will use it if a test file contains no `test_main` method.
+
+Tools / Demos
+-------------
+
+- Issue #3561: The Windows installer now has an option, off by default, for
+  placing the Python installation into the system "Path" environment variable.
+
+- Issue #13165: stringbench is now available in the Tools/stringbench folder.
+  It used to live in its own SVN project.
+
+
+What's New in Python 3.3.0 Alpha 2?
+===================================
+
+*Release date: 01-Apr-2012*
+
+Core and Builtins
+-----------------
+
+- Issue #1683368: object.__new__ and object.__init__ raise a TypeError if they
+  are passed arguments and their complementary method is not overridden.
+
+- Issue #14378: Fix compiling ast.ImportFrom nodes with a "__future__" string as
+  the module name that was not interned.
+
+- Issue #14331: Use significantly less stack space when importing modules by
+  allocating path buffers on the heap instead of the stack.
+
+- Issue #14334: Prevent in a segfault in type.__getattribute__ when it was not
+  passed strings.
+
+- Issue #1469629: Allow cycles through an object's __dict__ slot to be
+  collected. (For example if ``x.__dict__ is x``).
+
+- Issue #14205: dict lookup raises a RuntimeError if the dict is modified
+  during a lookup.
+
+- Issue #14220: When a generator is delegating to another iterator with the
+  yield from syntax, it needs to have its ``gi_running`` flag set to True.
+
+- Issue #14435: Remove dedicated block allocator from floatobject.c and rely
+  on the PyObject_Malloc() api like all other objects.
+
+- Issue #14471: Fix a possible buffer overrun in the winreg module.
+
+- Issue #14288: Allow the serialization of builtin iterators
+
+Library
+-------
+
+- Issue #14300: Under Windows, sockets created using socket.dup() now allow
+  overlapped I/O.  Patch by sbt.
+
+- Issue #13872: socket.detach() now marks the socket closed (as mirrored
+  in the socket repr()).  Patch by Matt Joiner.
+
+- Issue #14406: Fix a race condition when using ``concurrent.futures.wait(
+  return_when=ALL_COMPLETED)``.  Patch by Matt Joiner.
+
+- Issue #5136: deprecate old, unused functions from tkinter.
+
+- Issue #14409: IDLE now properly executes commands in the Shell window
+  when it cannot read the normal config files on startup and
+  has to use the built-in default key bindings.
+  There was previously a bug in one of the defaults.
+
+- Issue #14416: syslog now defines the LOG_ODELAY and LOG_AUTHPRIV constants
+  if they are defined in <syslog.h>.
+
+- IDLE can be launched as python -m idlelib
+
+- Issue #14295: Add unittest.mock
+
+- Issue #7652: Add --with-system-libmpdec option to configure for linking
+  the _decimal module against an installed libmpdec.
+
+- Issue #14380: MIMEText now defaults to utf-8 when passed non-ASCII unicode
+  with no charset specified.
+
+- Issue #10340: asyncore - properly handle EINVAL in dispatcher constructor on
+  OSX; avoid to call handle_connect in case of a disconnected socket which
+  was not meant to connect.
+
+- Issue #14204: The ssl module now has support for the Next Protocol
+  Negotiation extension, if available in the underlying OpenSSL library.
+  Patch by Colin Marc.
+
+- Issue #3035: Unused functions from tkinter are marked as pending deprecated.
+
+- Issue #12757: Fix the skipping of doctests when python is run with -OO so
+  that it works in unittest's verbose mode as well as non-verbose mode.
+
+- Issue #7652: Integrate the decimal floating point libmpdec library to speed
+  up the decimal module. Performance gains of the new C implementation are
+  between 10x and 100x, depending on the application.
+
+- Issue #3573: IDLE hangs when passing invalid command line args
+  (directory(ies) instead of file(s)) (Patch by Guilherme Polo)
+
+- Issue #14269: SMTPD now conforms to the RFC and requires a HELO command
+  before MAIL, RCPT, or DATA.
+
+- Issue #13694: asynchronous connect in asyncore.dispatcher does not set addr
+  attribute.
+
+- Issue #14344: fixed the repr of email.policy objects.
+
+- Issue #11686: Added missing entries to email package __all__ lists
+  (mostly the new Bytes classes).
+
+- Issue #14335: multiprocessing's custom Pickler subclass now inherits from
+  the C-accelerated implementation.  Patch by sbt.
+
+- Issue #10484: Fix the CGIHTTPServer's PATH_INFO handling problem.
+
+- Issue #11199: Fix the with urllib which hangs on particular ftp urls.
+
+- Improve the memory utilization and speed of functools.lru_cache.
+
+- Issue #14222: Use the new time.steady() function instead of time.time() for
+  timeout in queue and threading modules to not be affected of system time
+  update.
+
+- Issue #13248: Remove lib2to3.pytree.Base.get_prefix/set_prefix.
+
+- Issue #14234: CVE-2012-0876: Randomize hashes of xml attributes in the hash
+  table internal to the pyexpat module's copy of the expat library to avoid a
+  denial of service due to hash collisions.  Patch by David Malcolm with some
+  modifications by the expat project.
+
+- Issue #14200: Idle shell crash on printing non-BMP unicode character.
+
+- Issue #12818: format address no longer needlessly \ escapes ()s in names when
+  the name ends up being quoted.
+
+- Issue #14062: BytesGenerator now correctly folds Header objects,
+  including using linesep when folding.
+
+- Issue #13839: When invoked on the command-line, the pstats module now
+  accepts several filenames of profile stat files and merges them all.
+  Patch by Matt Joiner.
+
+- Issue #14291: Email now defaults to utf-8 for non-ASCII unicode headers
+  instead of raising an error.  This fixes a regression relative to 2.7.
+
+- Issue #989712: Support using Tk without a mainloop.
+
+- Issue #5219: Prevent event handler cascade in IDLE.
+
+- Issue #3835: Refuse to use unthreaded Tcl in threaded Python.
+
+- Issue #2843: Add new Tk API to Tkinter.
+
+- Issue #14184: Increase the default stack size for secondary threads on
+  Mac OS X to avoid interpreter crashes when using threads on 10.7.
+
+- Issue #14180: datetime.date.fromtimestamp(),
+  datetime.datetime.fromtimestamp() and datetime.datetime.utcfromtimestamp()
+  now raise an OSError instead of ValueError if localtime() or gmtime() failed.
+
+- Issue #14180: time.ctime(), gmtime(), time.localtime(),
+  datetime.date.fromtimestamp(), datetime.datetime.fromtimestamp() and
+  datetime.datetime.utcfromtimestamp() now raises an OverflowError, instead of
+  a ValueError, if the timestamp does not fit in time_t.
+
+- Issue #14180: datetime.datetime.fromtimestamp() and
+  datetime.datetime.utcfromtimestamp() now round microseconds towards zero
+  instead of rounding to nearest with ties going away from zero.
+
+- Issue #10543: Fix unittest test discovery with Jython bytecode files.
+
+- Issue #1178863: Separate initialisation from setting when initializing
+  Tkinter.Variables; harmonize exceptions to ValueError; only delete variables
+  that have not been deleted; assert that variable names are strings.
+
+- Issue #14104: Implement time.monotonic() on Mac OS X, patch written by
+  Nicholas Riley.
+
+- Issue #13394: the aifc module now uses warnings.warn() to signal warnings.
+
+- Issue #14252: Fix subprocess.Popen.terminate() to not raise an error under
+  Windows when the child process has already exited.
+
+- Issue #14223: curses.addch() is no more limited to the range 0-255 when the
+  Python curses is not linked to libncursesw. It was a regression introduced
+  in Python 3.3a1.
+
+- Issue #14168: Check for presence of Element._attrs in minidom before
+  accessing it.
+
+- Issue #12328: Fix multiprocessing's use of overlapped I/O on Windows.
+  Also, add a multiprocessing.connection.wait(rlist, timeout=None) function
+  for polling multiple objects at once.  Patch by sbt.
+
+- Issue #14007: Accept incomplete TreeBuilder objects (missing start, end,
+  data or close method) for the Python implementation as well.
+  Drop the no-op TreeBuilder().xml() method from the C implementation.
+
+- Issue #14210: pdb now has tab-completion not only for command names, but
+  also for their arguments, wherever possible.
+
+- Issue #14310: Sockets can now be with other processes on Windows using
+  the api socket.socket.share() and socket.fromshare().
+
+- Issue #10576: The gc module now has a 'callbacks' member that will get
+  called when garbage collection takes place.
+
+Build
+-----
+
+- Issue #14557: Fix extensions build on HP-UX. Patch by Adi Roiban.
+
+- Issue #14387: Do not include accu.h from Python.h.
+
+- Issue #14359: Only use O_CLOEXEC in _posixmodule.c if it is defined.
+  Based on patch from Hervé Coatanhay.
+
+- Issue #14321: Do not run pgen during the build if files are up to date.
+
+Documentation
+-------------
+
+- Issue #14034: added the argparse tutorial.
+
+- Issue #14324: Fix configure tests for cross builds.
+
+- Issue #14327: Call AC_CANONICAL_HOST in configure.ac and check in
+  config.{guess,sub}. Don't use uname calls for cross builds.
+
+Extension Modules
+-----------------
+
+- Issue #9041: An issue in ctypes.c_longdouble, ctypes.c_double, and
+  ctypes.c_float that caused an incorrect exception to be returned in the
+  case of overflow has been fixed.
+
+- Issue #14212: The re module didn't retain a reference to buffers it was
+  scanning, resulting in segfaults.
+
+- Issue #14259: The finditer() method of re objects did not take any
+  keyword arguments, contrary to the documentation.
+
+- Issue #10142: Support for SEEK_HOLE/SEEK_DATA (for example, under ZFS).
+
+Tests
+-----
+
+- Issue #14442: Add missing errno import in test_smtplib.
+
+- Issue #8315: (partial fix) python -m unittest test.test_email now works.
+
+
+What's New in Python 3.3.0 Alpha 1?
+===================================
+
+*Release date: 05-Mar-2012*
+
+Core and Builtins
+-----------------
+
+- Issue #14172: Fix reference leak when marshalling a buffer-like object
+  (other than a bytes object).
+
+- Issue #13521: dict.setdefault() now does only one lookup for the given key,
+  making it "atomic" for many purposes.  Patch by Filip Gruszczyński.
+
+- PEP 409, Issue #6210: "raise X from None" is now supported as a means of
+  suppressing the display of the chained exception context. The chained
+  context still remains available as the __context__ attribute.
+
+- Issue #10181: New memoryview implementation fixes multiple ownership
+  and lifetime issues of dynamically allocated Py_buffer members (#9990)
+  as well as crashes (#8305, #7433). Many new features have been added
+  (See whatsnew/3.3), and the documentation has been updated extensively.
+  The ndarray test object from _testbuffer.c implements all aspects of
+  PEP-3118, so further development towards the complete implementation
+  of the PEP can proceed in a test-driven manner.
+
+  Thanks to Nick Coghlan, Antoine Pitrou and Pauli Virtanen for review
+  and many ideas.
+
+- Issue #12834: Fix incorrect results of memoryview.tobytes() for
+  non-contiguous arrays.
+
+- Issue #5231: Introduce memoryview.cast() method that allows changing
+  format and shape without making a copy of the underlying memory.
+
+- Issue #14084: Fix a file descriptor leak when importing a module with a
+  bad encoding.
+
+- Upgrade Unicode data to Unicode 6.1.
+
+- Issue #14040: Remove rarely used file name suffixes for C extensions
+  (under POSIX mainly).
+
+- Issue #14051: Allow arbitrary attributes to be set of classmethod and
+  staticmethod.
+
+- Issue #13703: oCERT-2011-003: Randomize hashes of str and bytes to protect
+  against denial of service attacks due to hash collisions within the dict and
+  set types.  Patch by David Malcolm, based on work by Victor Stinner.
+
+- Issue #13020: Fix a reference leak when allocating a structsequence object
+  fails.  Patch by Suman Saha.
+
+- Issue #13908: Ready types returned from PyType_FromSpec.
+
+- Issue #11235: Fix OverflowError when trying to import a source file whose
+  modification time doesn't fit in a 32-bit timestamp.
+
+- Issue #12705: A SyntaxError exception is now raised when attempting to
+  compile multiple statements as a single interactive statement.
+
+- Fix the builtin module initialization code to store the init function for
+  future reinitialization.
+
+- Issue #8052: The posix subprocess module would take a long time closing
+  all possible file descriptors in the child process rather than just open
+  file descriptors.  It now closes only the open fds if possible for the
+  default close_fds=True behavior.
+
+- Issue #13629: Renumber the tokens in token.h so that they match the indexes
+  into _PyParser_TokenNames.
+
+- Issue #13752: Add a casefold() method to str.
+
+- Issue #13761: Add a "flush" keyword argument to the print() function,
+  used to ensure flushing the output stream.
+
+- Issue #13645: pyc files now contain the size of the corresponding source
+  code, to avoid timestamp collisions (especially on filesystems with a low
+  timestamp resolution) when checking for freshness of the bytecode.
+
+- PEP 380, Issue #11682: Add "yield from <x>" to support easy delegation to
+  subgenerators (initial patch by Greg Ewing, integration into 3.3 by
+  Renaud Blanch, Ryan Kelly, Zbigniew Jędrzejewski-Szmek and Nick Coghlan)
+
+- Issue #13748: Raw bytes literals can now be written with the ``rb`` prefix
+  as well as ``br``.
+
+- Issue #12736: Use full unicode case mappings for upper, lower, and title case.
+
+- Issue #12760: Add a create mode to open(). Patch by David Townshend.
+
+- Issue #13738: Simplify implementation of bytes.lower() and bytes.upper().
+
+- Issue #13577: Built-in methods and functions now have a __qualname__.
+  Patch by sbt.
+
+- Issue #6695: Full garbage collection runs now clear the freelist of set
+  objects.  Initial patch by Matthias Troffaes.
+
+- Fix OSError.__init__ and OSError.__new__ so that each of them can be
+  overriden and take additional arguments (followup to issue #12555).
+
+- Fix the fix for issue #12149: it was incorrect, although it had the side
+  effect of appearing to resolve the issue.  Thanks to Mark Shannon for
+  noticing.
+
+- Issue #13505: Pickle bytes objects in a way that is compatible with
+  Python 2 when using protocols <= 2.
+
+- Issue #11147: Fix an unused argument in _Py_ANNOTATE_MEMORY_ORDER.  (Fix
+  given by Campbell Barton).
+
+- Issue #13503: Use a more efficient reduction format for bytearrays with
+  pickle protocol >= 3.  The old reduction format is kept with older protocols
+  in order to allow unpickling under Python 2.  Patch by Irmen de Jong.
+
+- Issue #7111: Python can now be run without a stdin, stdout or stderr
+  stream.  It was already the case with Python 2.  However, the corresponding
+  sys module entries are now set to None (instead of an unusable file object).
+
+- Issue #11849: Ensure that free()d memory arenas are really released
+  on POSIX systems supporting anonymous memory mappings.  Patch by
+  Charles-François Natali.
+
+- Issue #13452: PyUnicode_EncodeDecimal() doesn't support error handlers
+  different than "strict" anymore. The caller was unable to compute the
+  size of the output buffer: it depends on the error handler.
+
+- PEP 3155 / issue #13448: Qualified name for classes and functions.
+
+- Issue #13436: Fix a bogus error message when an AST object was passed
+  an invalid integer value.
+
+- Issue #13411: memoryview objects are now hashable when the underlying
+  object is hashable.
+
+- Issue #13338: Handle all enumerations in _Py_ANNOTATE_MEMORY_ORDER
+  to allow compiling extension modules with -Wswitch-enum on gcc.
+  Initial patch by Floris Bruynooghe.
+
+- Issue #10227: Add an allocation cache for a single slice object.  Patch by
+  Stefan Behnel.
+
+- Issue #13393: BufferedReader.read1() now asks the full requested size to
+  the raw stream instead of limiting itself to the buffer size.
+
+- Issue #13392: Writing a pyc file should now be atomic under Windows as well.
+
+- Issue #13333: The UTF-7 decoder now accepts lone surrogates (the encoder
+  already accepts them).
+
+- Issue #13389: Full garbage collection passes now clear the freelists for
+  list and dict objects.  They already cleared other freelists in the
+  interpreter.
+
+- Issue #13327: Remove the need for an explicit None as the second argument
+  to os.utime, os.lutimes, os.futimes, os.futimens, os.futimesat, in
+  order to update to the current time. Also added keyword argument
+  handling to os.utimensat in order to remove the need for explicit None.
+
+- Issue #13350: Simplify some C code by replacing most usages of
+  PyUnicode_Format by PyUnicode_FromFormat.
+
+- Issue #13342: input() used to ignore sys.stdin's and sys.stdout's unicode
+  error handler in interactive mode (when calling into PyOS_Readline()).
+
+- Issue #9896: Add start, stop, and step attributes to range objects.
+
+- Issue #13343: Fix a SystemError when a lambda expression uses a global
+  variable in the default value of a keyword-only argument: ``lambda *,
+  arg=GLOBAL_NAME: None``
+
+- Issue #12797: Added custom opener parameter to builtin open() and
+  FileIO.open().
+
+- Issue #10519: Avoid unnecessary recursive function calls in
+  setobject.c.
+
+- Issue #10363: Deallocate global locks in Py_Finalize().
+
+- Issue #13018: Fix reference leaks in error paths in dictobject.c.
+  Patch by Suman Saha.
+
+- Issue #13201: Define '==' and '!=' to compare range objects based on
+  the sequence of values they define (instead of comparing based on
+  object identity).
+
+- Issue #1294232: In a few cases involving metaclass inheritance, the
+  interpreter would sometimes invoke the wrong metaclass when building a new
+  class object. These cases now behave correctly. Patch by Daniel Urban.
+
+- Issue #12753: Add support for Unicode name aliases and named sequences.
+  Both ``unicodedata.lookup()`` and '\N{...}' now resolve aliases,
+  and ``unicodedata.lookup()`` resolves named sequences too.
+
+- Issue #12170: The count(), find(), rfind(), index() and rindex() methods
+  of bytes and bytearray objects now accept an integer between 0 and 255
+  as their first argument.  Patch by Petri Lehtinen.
+
+- Issue #12604: VTRACE macro expanded to no-op in _sre.c to avoid compiler
+  warnings. Patch by Josh Triplett and Petri Lehtinen.
+
+- Issue #12281: Rewrite the MBCS codec to handle correctly replace and ignore
+  error handlers on all Windows versions. The MBCS codec is now supporting all
+  error handlers, instead of only replace to encode and ignore to decode.
+
+- Issue #13188: When called without an explicit traceback argument,
+  generator.throw() now gets the traceback from the passed exception's
+  ``__traceback__`` attribute.  Patch by Petri Lehtinen.
+
+- Issue #13146: Writing a pyc file is now atomic under POSIX.
+
+- Issue #7833: Extension modules built using distutils on Windows will no
+  longer include a "manifest" to prevent them failing at import time in some
+  embedded situations.
+
+- 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
+  as "The pipe is being closed") is now mapped to POSIX errno EPIPE
+  (previously EINVAL).
+
+- Issue #12911: Fix memory consumption when calculating the repr() of huge
+  tuples or lists.
+
+- PEP 393: flexible string representation. Thanks to Torsten Becker for the
+  initial implementation, and Victor Stinner for various bug fixes.
+
+- Issue #14081: The 'sep' and 'maxsplit' parameter to str.split, bytes.split,
+  and bytearray.split may now be passed as keyword arguments.
+
+- Issue #13012: The 'keepends' parameter to str.splitlines may now be passed
+  as a keyword argument:  "my_string.splitlines(keepends=True)".  The same
+  change also applies to bytes.splitlines and bytearray.splitlines.
+
+- Issue #7732: Don't open a directory as a file anymore while importing a
+  module. Ignore the direcotry if its name matchs the module name (e.g.
+  "__init__.py") and raise a ImportError instead.
+
+- Issue #13021: Missing decref on an error path.  Thanks to Suman Saha for
+  finding the bug and providing a patch.
+
+- Issue #12973: Fix overflow checks that relied on undefined behaviour in
+  list_repeat (listobject.c) and islice_next (itertoolsmodule.c).  These bugs
+  caused test failures with recent versions of Clang.
+
+- Issue #12904: os.utime, os.futimes, os.lutimes, and os.futimesat now write
+  atime and mtime with nanosecond precision on modern POSIX platforms.
+
+- Issue #12802: the Windows error ERROR_DIRECTORY (numbered 267) is now
+  mapped to POSIX errno ENOTDIR (previously EINVAL).
+
+- Issue #9200: The str.is* methods now work with strings that contain non-BMP
+  characters even in narrow Unicode builds.
+
+- Issue #12791: Break reference cycles early when a generator exits with
+  an exception.
+
+- Issue #12773: Make __doc__ mutable on user-defined classes.
+
+- Issue #12766: Raise a ValueError when creating a class with a class variable
+  that conflicts with a name in __slots__.
+
+- Issue #12266: Fix str.capitalize() to correctly uppercase/lowercase
+  titlecased and cased non-letter characters.
+
+- Issue #12732: In narrow unicode builds, allow Unicode identifiers which fall
+  outside the BMP.
+
+- Issue #12575: Validate user-generated AST before it is compiled.
+
+- Make type(None), type(Ellipsis), and type(NotImplemented) callable. They
+  return the respective singleton instances.
+
+- Forbid summing bytes with sum().
+
+- Verify the types of AST strings and identifiers provided by the user before
+  compiling them.
+
+- Issue #12647: The None object now has a __bool__() method that returns False.
+  Formerly, bool(None) returned False only because of special case logic
+  in PyObject_IsTrue().
+
+- Issue #12579: str.format_map() now raises a ValueError if used on a
+  format string that contains positional fields. Initial patch by
+  Julian Berman.
+
+- Issue #10271: Allow warnings.showwarning() be any callable.
+
+- Issue #11627: Fix segfault when __new__ on a exception returns a
+  non-exception class.
+
+- Issue #12149: Update the method cache after a type's dictionary gets
+  cleared by the garbage collector.  This fixes a segfault when an instance
+  and its type get caught in a reference cycle, and the instance's
+  deallocator calls one of the methods on the type (e.g. when subclassing
+  IOBase).  Diagnosis and patch by Davide Rizzo.
+
+- Issue #9611, #9015: FileIO.read() clamps the length to INT_MAX on Windows.
+
+- Issue #9642: Uniformize the tests on the availability of the mbcs codec, add
+  a new HAVE_MBCS define.
+
+- Issue #9642: Fix filesystem encoding initialization: use the ANSI code page
+  on Windows if the mbcs codec is not available, and fail with a fatal error if
+  we cannot get the locale encoding (if nl_langinfo(CODESET) is not available)
+  instead of using UTF-8.
+
+- When a generator yields, do not retain the caller's exception state on the
+  generator.
+
+- Issue #12475: Prevent generators from leaking their exception state into the
+  caller's frame as they return for the last time.
+
+- Issue #12291: You can now load multiple marshalled objects from a stream,
+  with other data interleaved between marshalled objects.
+
+- Issue #12356: When required positional or keyword-only arguments are not
+  given, produce a informative error message which includes the name(s) of the
+  missing arguments.
+
+- Issue #12370: Fix super with no arguments when __class__ is overriden in the
+  class body.
+
+- Issue #12084: os.stat on Windows now works properly with relative symbolic
+  links when called from any directory.
+
+- Loosen type restrictions on the __dir__ method. __dir__ can now return any
+  sequence, which will be converted to a list and sorted by dir().
+
+- Issue #12265: Make error messages produced by passing an invalid set of
+  arguments to a function more informative.
+
+- Issue #12225: Still allow Python to build if Python is not in its hg repo or
+  mercurial is not installed.
+
+- Issue #1195: my_fgets() now always clears errors before calling fgets(). Fix
+  the following case: sys.stdin.read() stopped with CTRL+d (end of file),
+  raw_input() interrupted by CTRL+c.
+
+- Issue #12216: Allow unexpected EOF errors to happen on any line of the file.
+
+- Issue #12199: The TryExcept and TryFinally and AST nodes have been unified
+  into a Try node.
+
+- Issue #9670: Increase the default stack size for secondary threads on
+  Mac OS X and FreeBSD to reduce the chances of a crash instead of a
+  "maximum recursion depth" RuntimeError exception.
+  (patch by Ronald Oussoren)
+
+- Issue #12106: The use of the multiple-with shorthand syntax is now reflected
+  in the AST.
+
+- Issue #12190: Try to use the same filename object when compiling unmarshalling
+  a code objects in the same file.
+
+- Issue #12166: Move implementations of dir() specialized for various types into
+  the __dir__() methods of those types.
+
+- Issue #5715: In socketserver, close the server socket in the child process.
+
+- Correct lookup of __dir__ on objects. Among other things, this causes errors
+  besides AttributeError found on lookup to be propagated.
+
+- Issue #12060: Use sig_atomic_t type and volatile keyword in the signal
+  module. Patch written by Charles-François Natali.
+
+- Issue #1746656: Added the if_nameindex, if_indextoname, if_nametoindex
+  methods to the socket module.
+
+- Issue #12044: Fixed subprocess.Popen when used as a context manager to
+  wait for the process to end when exiting the context to avoid unintentionally
+  leaving zombie processes around.
+
+- Issue #1195: Fix input() if it is interrupted by CTRL+d and then CTRL+c,
+  clear the end-of-file indicator after CTRL+d.
+
+- Issue #1856: Avoid crashes and lockups when daemon threads run while the
+  interpreter is shutting down; instead, these threads are now killed when
+  they try to take the GIL.
+
+- Issue #9756: When calling a method descriptor or a slot wrapper descriptor,
+  the check of the object type doesn't read the __class__ attribute anymore.
+  Fix a crash if a class override its __class__ attribute (e.g. a proxy of the
+  str type). Patch written by Andreas Stührk.
+
+- Issue #10517: After fork(), reinitialize the TLS used by the PyGILState_*
+  APIs, to avoid a crash with the pthread implementation in RHEL 5.  Patch
+  by Charles-François Natali.
+
+- Issue #10914: Initialize correctly the filesystem codec when creating a new
+  subinterpreter to fix a bootstrap issue with codecs implemented in Python, as
+  the ISO-8859-15 codec.
+
+- Issue #11918: OS/2 and VMS are no more supported because of the lack of
+  maintainer.
+
+- Issue #6780: fix starts/endswith error message to mention that tuples are
+  accepted too.
+
+- Issue #5057: fix a bug in the peepholer that led to non-portable pyc files
+  between narrow and wide builds while optimizing BINARY_SUBSCR on non-BMP
+  chars (e.g. "\U00012345"[0]).
+
+- Issue #11845: Fix typo in rangeobject.c that caused a crash in
+  compute_slice_indices.  Patch by Daniel Urban.
+
+- Issue #5673: Added a `timeout` keyword argument to subprocess.Popen.wait,
+  subprocess.Popen.communicated, subprocess.call, subprocess.check_call, and
+  subprocess.check_output.  If the blocking operation takes more than `timeout`
+  seconds, the `subprocess.TimeoutExpired` exception is raised.
+
+- Issue #11650: PyOS_StdioReadline() retries fgets() if it was interrupted
+  (EINTR), for example if the program is stopped with CTRL+z on Mac OS X. Patch
+  written by Charles-Francois Natali.
+
+- Issue #9319: Include the filename in "Non-UTF8 code ..." syntax error.
+
+- Issue #10785: Store the filename as Unicode in the Python parser.
+
+- Issue #11619: _PyImport_LoadDynamicModule() doesn't encode the path to bytes
+  on Windows.
+
+- Issue #10998: Remove mentions of -Q, sys.flags.division_warning and
+  Py_DivisionWarningFlag left over from Python 2.
+
+- Issue #11244: Remove an unnecessary peepholer check that was preventing
+  negative zeros from being constant-folded properly.
+
+- Issue #11395: io.FileIO().write() clamps the data length to 32,767 bytes on
+  Windows if the file is a TTY to workaround a Windows bug. The Windows console
+  returns an error (12: not enough space error) on writing into stdout if
+  stdout mode is binary and the length is greater than 66,000 bytes (or less,
+  depending on heap usage).
+
+- Issue #11320: fix bogus memory management in Modules/getpath.c, leading to
+  a possible crash when calling Py_SetPath().
+
+- Issue #11432: A bug was introduced in subprocess.Popen on posix systems with
+  3.2.0 where the stdout or stderr file descriptor being the same as the stdin
+  file descriptor would raise an exception. webbrowser.open would fail. fixed.
+
+- Issue #9856: Change object.__format__ with a non-empty format string
+  to be a DeprecationWarning. In 3.2 it was a PendingDeprecationWarning.
+  In 3.4 it will be a TypeError.
+
+- Issue #11244: The peephole optimizer is now able to constant-fold
+  arbitrarily complex expressions.  This also fixes a 3.2 regression where
+  operations involving negative numbers were not constant-folded.
+
+- Issue #11450: Don't truncate hg version info in Py_GetBuildInfo() when
+  there are many tags (e.g. when using mq).  Patch by Nadeem Vawda.
+
+- Issue #11335: Fixed a memory leak in list.sort when the key function
+  throws an exception.
+
+- Issue #8923: When a string is encoded to UTF-8 in strict mode, the result is
+  cached into the object. Examples: str.encode(), str.encode('utf-8'),
+  PyUnicode_AsUTF8String() and PyUnicode_AsEncodedString(unicode, "utf-8",
+  NULL).
+
+- Issue #10831: PyUnicode_FromFormat() supports %li, %lli and %zi formats.
+
+- Issue #10829: Refactor PyUnicode_FromFormat(), use the same function to parse
+  the format string in the 3 steps, fix crashs on invalid format strings.
+
+- Issue #13007: whichdb should recognize gdbm 1.9 magic numbers.
+
+- Issue #11246: Fix PyUnicode_FromFormat("%V") to decode the byte string from
+  UTF-8 (with replace error handler) instead of ISO-8859-1 (in strict mode).
+  Patch written by Ray Allen.
+
+- Issue #11286: Raise a ValueError from calling PyMemoryView_FromBuffer with
+  a buffer struct having a NULL data pointer.
+
+- 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 now accept None as slice index.
+  Patch by Torsten Becker.
+
+- Issue #10830: Fix PyUnicode_FromFormatV("%c") for non-BMP characters on
+  narrow build.
+
+- Issue #11168: Remove filename debug variable from PyEval_EvalFrameEx().
+  It encoded the Unicode filename to UTF-8, but the encoding fails on
+  undecodable filename (on surrogate characters) which raises an unexpected
+  UnicodeEncodeError on recursion limit.
+
+- Issue #11187: Remove bootstrap code (use ASCII) of
+  PyUnicode_AsEncodedString(), it was replaced by a better fallback (use the
+  locale encoding) in PyUnicode_EncodeFSDefault().
+
+- Check for NULL result in PyType_FromSpec.
+
+- Issue #10516: New copy() and clear() methods for lists and bytearrays.
+
+- Issue #11386: bytearray.pop() now throws IndexError when the bytearray is
+  empty, instead of OverflowError.
+
+- Issue #12380: The rjust, ljust and center methods of bytes and bytearray
+  now accept a bytearray argument.
+
+Library
+-------
+
+- Issue #14195: An issue that caused weakref.WeakSet instances to incorrectly
+  return True for a WeakSet instance 'a' in both 'a < a' and 'a > a' has been
+  fixed.
+
+- Issue #14166: Pickler objects now have an optional ``dispatch_table``
+  attribute which allows to set custom per-pickler reduction functions.
+  Patch by sbt.
+
+- Issue #14177: marshal.loads() now raises TypeError when given an unicode
+  string.  Patch by Guilherme Gonçalves.
+
+- Issue #13550: Remove the debug machinery from the threading module: remove
+  verbose arguments from all threading classes and functions.
+
+- Issue #14159: Fix the len() of weak containers (WeakSet, WeakKeyDictionary,
+  WeakValueDictionary) to return a better approximation when some objects
+  are dead or dying.  Moreover, the implementation is now O(1) rather than
+  O(n).
+
+- Issue #13125: Silence spurious test_lib2to3 output when in non-verbose mode.
+  Patch by Mikhail Novikov.
+
+- Issue #11841: Fix comparison bug with 'rc' versions in packaging.version.
+  Patch by Filip Gruszczyński.
+
+- Issue #13447: Add a test file to host regression tests for bugs in the
+  scripts found in the Tools directory.
+
+- Issue #6884: Fix long-standing bugs with MANIFEST.in parsing in distutils
+  on Windows.  Also fixed in packaging.
+
+- Issue #8033: sqlite3: Fix 64-bit integer handling in user functions
+  on 32-bit architectures. Initial patch by Philippe Devalkeneer.
+
+- HTMLParser is now able to handle slashes in the start tag.
+
+- Issue #13641: Decoding functions in the base64 module now accept ASCII-only
+  unicode strings.  Patch by Catalin Iacob.
+
+- Issue #14043: Speed up importlib's _FileFinder by at least 8x, and add a
+  new importlib.invalidate_caches() function.
+
+- Issue #14001: CVE-2012-0845: xmlrpc: Fix an endless loop in
+  SimpleXMLRPCServer upon malformed POST request.
+
+- Issue #13961: Move importlib over to using os.replace() for atomic renaming.
+
+- Do away with ambiguous level values (as suggested by PEP 328) in
+  importlib.__import__() by raising ValueError when level < 0.
+
+- Issue #2489: pty.spawn could consume 100% cpu when it encountered an EOF.
+
+- Issue #13014: Fix a possible reference leak in SSLSocket.getpeercert().
+
+- Issue #13777: Add PF_SYSTEM sockets on OS X.
+  Patch by Michael Goderbauer.
+
+- Issue #13015: Fix a possible reference leak in defaultdict.__repr__.
+  Patch by Suman Saha.
+
+- Issue #1326113: distutils' and packaging's build_ext commands option now
+  correctly parses multiple values (separated by whitespace or commas) given
+  to their --libraries option.
+
+- Issue #10287: nntplib now queries the server's CAPABILITIES first before
+  sending MODE READER, and only sends it if not already in READER mode.
+  Patch by Hynek Schlawack.
+
+- Issue #13993: HTMLParser is now able to handle broken end tags when
+  strict=False.
+
+- Issue #13930: lib2to3 now supports writing converted output files to another
+  directory tree as well as copying unchanged files and altering the file
+  suffix.
+
+- Issue #9750: Fix sqlite3.Connection.iterdump on tables and fields
+  with a name that is a keyword or contains quotes. Patch by Marko
+  Kohtala.
+
+- Issue #10287: nntplib now queries the server's CAPABILITIES again after
+  authenticating (since the result may change, according to RFC 4643).
+  Patch by Hynek Schlawack.
+
+- Issue #13989: Document that GzipFile does not support text mode, and give a
+  more helpful error message when opened with an invalid mode string.
+
+- Issue #13590: On OS X 10.7 and 10.6 with Xcode 4.2, building
+  Distutils-based packages with C extension modules may fail because
+  Apple has removed gcc-4.2, the version used to build python.org
+  64-bit/32-bit Pythons.  If the user does not explicitly override
+  the default C compiler by setting the CC environment variable,
+  Distutils will now attempt to compile extension modules with clang
+  if gcc-4.2 is required but not found. Also as a convenience, if
+  the user does explicitly set CC, substitute its value as the default
+  compiler in the Distutils LDSHARED configuration variable for OS X.
+  (Note, the python.org 32-bit-only Pythons use gcc-4.0 and the 10.4u
+  SDK, neither of which are available in Xcode 4.  This change does not
+  attempt to override settings to support their use with Xcode 4.)
+
+- Issue #13960: HTMLParser is now able to handle broken comments when
+  strict=False.
+
+- Issue #13921: Undocument and clean up sqlite3.OptimizedUnicode,
+  which is obsolete in Python 3.x. It's now aliased to str for
+  backwards compatibility.
+
+- When '' is a path (e.g. in sys.path), make sure __file__ uses the current
+  working directory instead of '' in importlib.
+
+- Issue #13609: Add two functions to query the terminal size:
+  os.get_terminal_size (low level) and shutil.get_terminal_size (high level).
+  Patch by Zbigniew Jędrzejewski-Szmek.
+
+- Issue #13845: On Windows, time.time() now uses GetSystemTimeAsFileTime()
+  instead of ftime() to have a resolution of 100 ns instead of 1 ms (the clock
+  accuracy is between 0.5 ms and 15 ms).
+
+- Issue #13846: Add time.monotonic(), monotonic clock.
+
+- Issue #8184: multiprocessing: On Windows, don't set SO_REUSEADDR on
+  Connection sockets, and set FILE_FLAG_FIRST_PIPE_INSTANCE on named pipes, to
+  make sure two listeners can't bind to the same socket/pipe (or any existing
+  socket/pipe).
+
+- Issue #10811: Fix recursive usage of cursors. Instead of crashing,
+  raise a ProgrammingError now.
+
+- Issue #10881: Fix test_site failure with OS X framework builds.
+
+- Issue #964437: Make IDLE help window non-modal.
+  Patch by Guilherme Polo and Roger Serwy.
+
+- Issue #13734: Add os.fwalk(), a directory walking function yielding file
+  descriptors.
+
+- Issue #2945: Make the distutils upload command aware of bdist_rpm products.
+
+- Issue #13712: pysetup create should not convert package_data to extra_files.
+
+- Issue #11805: package_data in setup.cfg should allow more than one value.
+
+- Issue #13933: IDLE auto-complete did not work with some imported
+  module, like hashlib.  (Patch by Roger Serwy)
+
+- Issue #13901: Prevent test_distutils failures on OS X with --enable-shared.
+
+- Issue #13676: Handle strings with embedded zeros correctly in sqlite3.
+
+- Issue #13506: Add '' to path for IDLE Shell when started and restarted with Restart Shell.
+  Original patches by Marco Scataglini and Roger Serwy.
+
+- Issue #8828: Add new function os.replace(), for cross-platform renaming
+  with overwriting.
+
+- Issue #13848: open() and the FileIO constructor now check for NUL
+  characters in the file name.  Patch by Hynek Schlawack.
+
+- Issue #13806: The size check in audioop decompression functions was too
+  strict and could reject valid compressed data.  Patch by Oleg Plakhotnyuk.
+
+- Issue #13812: When a multiprocessing Process child raises an exception,
+  flush stderr after printing the exception traceback.
+
+- Issue #13885: CVE-2011-3389: the _ssl module would always disable the CBC
+  IV attack countermeasure.
+
+- Issue #13847: time.localtime() and time.gmtime() now raise an OSError instead
+  of ValueError on failure. time.ctime() and time.asctime() now raises an
+  OSError if localtime() failed. time.clock() now raises a RuntimeError if the
+  processor time used is not available or its value cannot be represented
+
+- Issue #13862: Fix spurious failure in test_zlib due to runtime/compile time
+  minor versions not matching.
+
+- Issue #12804: Fix test_socket and test_urllib2net failures when running tests
+  on a system without internet access.
+
+- Issue #13772: In os.symlink() under Windows, do not try to guess the link
+  target's type (file or directory).  The detection was buggy and made the
+  call non-atomic (therefore prone to race conditions).
+
+- Issue #6631: Disallow relative file paths in urllib urlopen methods.
+
+- Issue #13722: Avoid silencing ImportErrors when initializing the codecs
+  registry.
+
+- Issue #13781: Fix GzipFile bug that caused an exception to be raised when
+  opening for writing using a fileobj returned by os.fdopen().
+
+- Issue #13803: Under Solaris, distutils doesn't include bitness
+  in the directory name.
+
+- Issue #10278: Add time.wallclock() function, monotonic clock.
+
+- Issue #13809: Fix regression where bz2 module wouldn't work when threads are
+  disabled. Original patch by Amaury Forgeot d'Arc.
+
+- Issue #13589: Fix some serialization primitives in the aifc module.
+  Patch by Oleg Plakhotnyuk.
+
+- Issue #13642: Unquote before b64encoding user:password during Basic
+  Authentication. Patch contributed by Joonas Kuorilehto.
+
+- Issue #13726: Fix the ambiguous -S flag in regrtest. It is -o/--slow for slow
+  tests.
+
+- Issue #12364: Fix a hang in concurrent.futures.ProcessPoolExecutor.
+  The hang would occur when retrieving the result of a scheduled future after
+  the executor had been shut down.
+
+- Issue #13502: threading: Fix a race condition in Event.wait() that made it
+  return False when the event was set and cleared right after.
+
+- Issue #9993: When the source and destination are on different filesystems,
+  and the source is a symlink, shutil.move() now recreates a symlink on the
+  destination instead of copying the file contents.  Patch by Jonathan Niehof
+  and Hynek Schlawack.
+
+- Issue #12926: Fix a bug in tarfile's link extraction.
+
+- Issue #13696: Fix the 302 Relative URL Redirection problem.
+
+- Issue #13636: Weak ciphers are now disabled by default in the ssl module
+  (except when SSLv2 is explicitly asked for).
+
+- Issue #12715: Add an optional symlinks argument to shutil functions
+  (copyfile, copymode, copystat, copy, copy2).  When that parameter is
+  true, symlinks aren't dereferenced and the operation instead acts on the
+  symlink itself (or creates one, if relevant).  Patch by Hynek Schlawack.
+
+- Add a flags parameter to select.epoll.
+
+- 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.
+
+- Issue #11006: Don't issue low level warning in subprocess when pipe2() fails.
+
+- Issue #13620: Support for Chrome browser in webbrowser.  Patch contributed
+  by Arnaud Calmettes.
+
+- Issue #11829: Fix code execution holes in inspect.getattr_static for
+  metaclasses with metaclasses. Patch by Andreas Stührk.
+
+- Issue #12708: Add starmap() and starmap_async() methods (similar to
+  itertools.starmap()) to multiprocessing.Pool.  Patch by Hynek Schlawack.
+
+- Issue #1785: Fix inspect and pydoc with misbehaving descriptors.
+
+- Issue #13637: "a2b" functions in the binascii module now accept ASCII-only
+  unicode strings.
+
+- Issue #13634: Add support for querying and disabling SSL compression.
+
+- Issue #13627: Add support for SSL Elliptic Curve-based Diffie-Hellman
+  key exchange, through the SSLContext.set_ecdh_curve() method and the
+  ssl.OP_SINGLE_ECDH_USE option.
+
+- Issue #13635: Add ssl.OP_CIPHER_SERVER_PREFERENCE, so that SSL servers
+  choose the cipher based on their own preferences, rather than on the
+  client's.
+
+- Issue #11813: Fix inspect.getattr_static for modules. Patch by Andreas
+  Stührk.
+
+- Issue #7502: Fix equality comparison for DocTestCase instances.  Patch by
+  Cédric Krier.
+
+- Issue #11870: threading: Properly reinitialize threads internal locks and
+  condition variables to avoid deadlocks in child processes.
+
+- Issue #8035: urllib: Fix a bug where the client could remain stuck after a
+  redirection or an error.
+
+- Issue #13560: os.strerror() now uses the current locale encoding instead of
+  UTF-8.
+
+- 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.
+
+- Issue #10350: Read and save errno before calling a function which might
+  overwrite it.  Original patch by Hallvard B Furuseth.
+
+- Issue #11610: Introduce a more general way to declare abstract properties.
+
+- Issue #13591: A bug in importlib has been fixed that caused import_module
+  to load a module twice.
+
+- Issue #4625: If IDLE cannot write to its recent file or breakpoint files,
+  display a message popup and continue rather than crash.  Original patch by
+  Roger Serwy.
+
+- Issue #13449 sched.scheduler.run() method has a new "blocking" parameter which
+  when set to False makes run() execute the scheduled events due to expire
+  soonest (if any) and then return.  Patch by Giampaolo Rodolà.
+
+- Issue #8684 sched.scheduler class can be safely used in multi-threaded
+  environments.  Patch by Josiah Carlson and Giampaolo Rodolà.
+
+- Alias resource.error to OSError ala PEP 3151.
+
+- Issue #5689: Add support for lzma compression to the tarfile module.
+
+- Issue #13248: Turn 3.2's PendingDeprecationWarning into 3.3's
+  DeprecationWarning.  It covers 'cgi.escape', 'importlib.abc.PyLoader',
+  'importlib.abc.PyPycLoader', 'nntplib.NNTP.xgtitle', 'nntplib.NNTP.xpath',
+  and private attributes of 'smtpd.SMTPChannel'.
+
+- Issue #5905, #13560: time.strftime() is now using the current locale
+  encoding, instead of UTF-8, if the wcsftime() function is not available.
+
+- Issue #8641: Update IDLE 3 syntax coloring to recognize b".." and not u"..".
+  Patch by Tal Einat.
+
+- Issue #13464: Add a readinto() method to http.client.HTTPResponse.  Patch
+  by Jon Kuhn.
+
+- tarfile.py: Correctly detect bzip2 compressed streams with blocksizes
+  other than 900k.
+
+- Issue #13439: Fix many errors in turtle docstrings.
+
+- Issue #6715: Add a module 'lzma' for compression using the LZMA algorithm.
+  Thanks to Per Øyvind Karlsen for the initial implementation.
+
+- Issue #13487: Make inspect.getmodule robust against changes done to
+  sys.modules while it is iterating over it.
+
+- Issue #12618: Fix a bug that prevented py_compile from creating byte
+  compiled files in the current directory.  Initial patch by Sjoerd de Vries.
+
+- Issue #13444: When stdout has been closed explicitly, we should not attempt
+  to flush it at shutdown and print an error.
+
+- Issue #12567: The curses module uses Unicode functions for Unicode arguments
+  when it is linked to the ncurses library. It encodes also Unicode strings to
+  the locale encoding instead of UTF-8.
+
+- Issue #12856: Ensure child processes do not inherit the parent's random
+  seed for filename generation in the tempfile module.  Patch by Brian
+  Harring.
+
+- Issue #9957: SpooledTemporaryFile.truncate() now accepts an optional size
+  parameter, as other file-like objects.  Patch by Ryan Kelly.
+
+- Issue #13458: Fix a memory leak in the ssl module when decoding a
+  certificate with a subjectAltName.  Patch by Robert Xiao.
+
+- Issue #13415: os.unsetenv() doesn't ignore errors anymore.
+
+- Issue #13245: sched.scheduler class constructor's timefunc and
+  delayfunct parameters are now optional.
+  scheduler.enter and scheduler.enterabs methods gained a new kwargs parameter.
+  Patch contributed by Chris Clark.
+
+- Issue #12328: Under Windows, refactor handling of Ctrl-C events and
+  make _multiprocessing.win32.WaitForMultipleObjects interruptible when
+  the wait_flag parameter is false.  Patch by sbt.
+
+- Issue #13322: Fix BufferedWriter.write() to ensure that BlockingIOError is
+  raised when the wrapped raw file is non-blocking and the write would block.
+  Previous code assumed that the raw write() would raise BlockingIOError, but
+  RawIOBase.write() is defined to returned None when the call would block.
+  Patch by sbt.
+
+- Issue #13358: HTMLParser now calls handle_data only once for each CDATA.
+
+- Issue #4147: minidom's toprettyxml no longer adds whitespace around a text
+  node when it is the only child of an element.  Initial patch by Dan
+  Kenigsberg.
+
+- Issue #13374: The Windows bytes API has been deprecated in the os module. Use
+  Unicode filenames instead of bytes filenames to not depend on the ANSI code
+  page anymore and to support any filename.
+
+- Issue #13297: Use bytes type to send and receive binary data through XMLRPC.
+
+- Issue #6397: Support "/dev/poll" polling objects in select module,
+  under Solaris & derivatives.
+
+- Issues #1745761, #755670, #13357, #12629, #1200313: HTMLParser now correctly
+  handles non-valid attributes, including adjacent and unquoted attributes.
+
+- Issue #13193: Fix distutils.filelist.FileList and packaging.manifest.Manifest
+  under Windows.
+
+- Issue #13384: Remove unnecessary __future__ import in Lib/random.py
+
+- Issue #13149: Speed up append-only StringIO objects.
+
+- Issue #13373: multiprocessing.Queue.get() could sometimes block indefinitely
+  when called with a timeout.  Patch by Arnaud Ysmal.
+
+- Issue #13254: Fix Maildir initialization so that maildir contents
+  are read correctly.
+
+- Issue #3067: locale.setlocale() now raises TypeError if the second
+  argument is an invalid iterable. Its documentation and docstring
+  were also updated. Initial patch by Jyrki Pulliainen.
+
+- Issue #13140: Fix the daemon_threads attribute of ThreadingMixIn.
+
+- Issue #13339: Fix compile error in posixmodule.c due to missing semicolon.
+  Thanks to Robert Xiao.
+
+- Byte compilation in packaging is now isolated from the calling Python -B or
+  -O options, instead of being disallowed under -B or buggy under -O.
+
+- Issue #10570: curses.putp() and curses.tparm() are now expecting a byte
+  string, instead of a Unicode string.
+
+- Issue #13295: http.server now produces valid HTML 4.01 strict.
+
+- Issue #2892: preserve iterparse events in case of SyntaxError.
+
+- Issue #13287: urllib.request and urllib.error now contains an __all__
+  attribute to expose only relevant classes and functions.  Patch by Florent
+  Xicluna.
+
+- Issue #670664: Fix HTMLParser to correctly handle the content of
+  ``<script>...</script>`` and ``<style>...</style>``.
+
+- Issue #10817: Fix urlretrieve function to raise ContentTooShortError even
+  when reporthook is None. Patch by Jyrki Pulliainen.
+
+- Issue #13296: Fix IDLE to clear compile __future__ flags on shell restart.
+  (Patch by Roger Serwy)
+
+- Fix the xmlrpc.client user agent to return something similar to
+  urllib.request user agent: "Python-xmlrpc/3.3".
+
+- Issue #13293: Better error message when trying to marshal bytes using
+  xmlrpc.client.
+
+- Issue #13291: NameError in xmlrpc package.
+
+- Issue #13258: Use callable() built-in in the standard library.
+
+- Issue #13273: fix a bug that prevented HTMLParser to properly detect some
+  tags when strict=False.
+
+- Issue #11183: Add finer-grained exceptions to the ssl module, so that
+  you don't have to inspect the exception's attributes in the common case.
+
+- Issue #13216: Add cp65001 codec, the Windows UTF-8 (CP_UTF8).
+
+- Issue #13226: Add RTLD_xxx constants to the os module. These constants can be
+  used with sys.setdlopenflags().
+
+- Issue #10278: Add clock_getres(), clock_gettime() and CLOCK_xxx constants to
+  the time module. time.clock_gettime(time.CLOCK_MONOTONIC) provides a
+  monotonic clock
+
+- Issue #10332: multiprocessing: fix a race condition when a Pool is closed
+  before all tasks have completed.
+
+- Issue #13255: wrong docstrings in array module.
+
+- Issue #8540: Remove deprecated Context._clamp attribute in Decimal module.
+
+- Issue #13235: Added DeprecationWarning to logging.warn() method and function.
+
+- Issue #9168: now smtpd is able to bind privileged port.
+
+- Issue #12529: fix cgi.parse_header issue on strings with double-quotes and
+  semicolons together. Patch by Ben Darnell and Petri Lehtinen.
+
+- Issue #13227: functools.lru_cache() now has a option to distinguish
+  calls with different argument types.
+
+- Issue #6090: zipfile raises a ValueError when a document with a timestamp
+  earlier than 1980 is provided. Patch contributed by Petri Lehtinen.
+
+- Issue #13150: sysconfig no longer parses the Makefile and config.h files
+  when imported, instead doing it at build time.  This makes importing
+  sysconfig faster and reduces Python startup time by 20%.
+
+- Issue #12448: smtplib now flushes stdout while running ``python -m smtplib``
+  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_sequences files.
+
+- Issue #13194: zlib.compressobj().copy() and zlib.decompressobj().copy() are
+  now available on Windows.
+
+- 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
+  file.
+
+- Issue #13158: Fix decoding and encoding of GNU tar specific base-256 number
+  fields in tarfile.
+
+- Issue #13025: mimetypes is now reading MIME types using the UTF-8 encoding,
+  instead of the locale encoding.
+
+- Issue #10653: On Windows, use strftime() instead of wcsftime() because
+  wcsftime() doesn't format time zone correctly.
+
+- Issue #13150: The tokenize module doesn't compile large regular expressions
+  at startup anymore.
+
+- Issue #11171: Fix distutils.sysconfig.get_makefile_filename when Python was
+  configured with different prefix and exec-prefix.
+
+- Issue #11254: Teach distutils and packaging to compile .pyc and .pyo files in
+  PEP 3147-compliant __pycache__ directories.
+
+- Issue #7367: Fix pkgutil.walk_paths to skip directories whose
+  contents cannot be read.
+
+- Issue #3163: The struct module gets new format characters 'n' and 'N'
+  supporting C integer types ``ssize_t`` and ``size_t``, respectively.
+
+- Issue #13099: Fix sqlite3.Cursor.lastrowid under a Turkish locale.
+  Reported and diagnosed by Thomas Kluyver.
+
+- Issue #13087: BufferedReader.seek() now always raises UnsupportedOperation
+  if the underlying raw stream is unseekable, even if the seek could be
+  satisfied using the internal buffer.  Patch by John O'Connor.
+
+- Issue #7689: Allow pickling of dynamically created classes when their
+  metaclass is registered with copyreg.  Patch by Nicolas M. Thiéry and Craig
+  Citro.
+
+- Issue #13034: When decoding some SSL certificates, the subjectAltName
+  extension could be unreported.
+
+- Issue #9871: Prevent IDLE 3 crash when given byte stings
+  with invalid hex escape sequences, like b'\x0'.
+  (Original patch by Claudiu Popa.)
+
+- Issue #12306: Expose the runtime version of the zlib C library as a constant,
+  ZLIB_RUNTIME_VERSION, in the zlib module. Patch by Torsten Landschoff.
+
+- Issue #12959: Add collections.ChainMap to collections.__all__.
+
+- Issue #8933: distutils' PKG-INFO files and packaging's METADATA files will
+  now correctly report Metadata-Version: 1.1 instead of 1.0 if a Classifier or
+  Download-URL field is present.
+
+- Issue #12567: Add curses.unget_wch() function. Push a character so the next
+  get_wch() will return it.
+
+- Issue #9561: distutils and packaging now writes egg-info files using UTF-8,
+  instead of the locale encoding.
+
+- Issue #8286: The distutils command sdist will print a warning message instead
+  of crashing when an invalid path is given in the manifest template.
+
+- Issue #12841: tarfile unnecessarily checked the existence of numerical user
+  and group ids on extraction. If one of them did not exist the respective id
+  of the current user (i.e. root) was used for the file and ownership
+  information was lost.
+
+- Issue #12888: Fix a bug in HTMLParser.unescape that prevented it to escape
+  more than 128 entities.  Patch by Peter Otten.
+
+- Issue #12878: Expose a __dict__ attribute on io.IOBase and its subclasses.
+
+- Issue #12636: IDLE reads the coding cookie when executing a Python script.
+
+- Issue #12494: On error, call(), check_call(), check_output() and
+  getstatusoutput() functions of the subprocess module now kill the process,
+  read its status (to avoid zombis) and close pipes.
+
+- Issue #12720: Expose low-level Linux extended file attribute functions in os.
+
+- Issue #10946: The distutils commands bdist_dumb, bdist_wininst and bdist_msi
+  now respect a --skip-build option given to bdist.  The packaging commands
+  were fixed too.
+
+- Issue #12847: Fix a crash with negative PUT and LONG_BINPUT arguments in
+  the C pickle implementation.
+
+- Issue #11564: Avoid crashes when trying to pickle huge objects or containers
+  (more than 2**31 items).  Instead, in most cases, an OverflowError is raised.
+
+- Issue #12287: Fix a stack corruption in ossaudiodev module when the FD is
+  greater than FD_SETSIZE.
+
+- Issue #12839: Fix crash in zlib module due to version mismatch.
+  Fix by Richard M. Tew.
+
+- Issue #9923: The mailcap module now correctly uses the platform path
+  separator for the MAILCAP environment variable on non-POSIX platforms.
+
+- Issue #12835: Follow up to #6560 that unconditionally prevents use of the
+  unencrypted sendmsg/recvmsg APIs on SSL wrapped sockets. Patch by David
+  Watson.
+
+- Issue #12803: SSLContext.load_cert_chain() now accepts a password argument
+  to be used if the private key is encrypted.  Patch by Adam Simpkins.
+
+- Issue #11657: Fix sending file descriptors over 255 over a multiprocessing
+  Pipe.
+
+- Issue #12811: tabnanny.check() now promptly closes checked files. Patch by
+  Anthony Briggs.
+
+- Issue #6560: The sendmsg/recvmsg API is now exposed by the socket module
+  when provided by the underlying platform, supporting processing of
+  ancillary data in pure Python code. Patch by David Watson and Heiko Wundram.
+
+- Issue #12326: On Linux, sys.platform doesn't contain the major version
+  anymore. It is now always 'linux', instead of 'linux2' or 'linux3' depending
+  on the Linux version used to build Python.
+
+- Issue #12213: Fix a buffering bug with interleaved reads and writes that
+  could appear on BufferedRandom streams.
+
+- Issue #12778: Reduce memory consumption when JSON-encoding a large
+  container of many small objects.
+
+- Issue #12650: Fix a race condition where a subprocess.Popen could leak
+  resources (FD/zombie) when killed at the wrong time.
+
+- Issue #12744: Fix inefficient representation of integers between 2**31 and
+  2**63 on systems with a 64-bit C "long".
+
+- Issue #12646: Add an 'eof' attribute to zlib.Decompress, to make it easier to
+  detect truncated input streams.
+
+- Issue #11513: Fix exception handling ``tarfile.TarFile.gzopen()`` when
+  the file cannot be opened.
+
+- Issue #12687: Fix a possible buffering bug when unpickling text mode
+  (protocol 0, mostly) pickles.
+
+- Issue #10087: Fix the html output format of the calendar module.
+
+- Issue #12540: Prevent zombie IDLE processes on Windows due to changes
+  in os.kill().
+
+- 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).
+
+- Issue #12655: Expose functions from sched.h in the os module: sched_yield(),
+  sched_setscheduler(), sched_getscheduler(), sched_setparam(),
+  sched_get_min_priority(), sched_get_max_priority(), sched_rr_get_interval(),
+  sched_getaffinity(), sched_setaffinity().
+
+- Add ThreadError to threading.__all__.
+
+- Issues #11104, #8688: Fix the behavior of distutils' sdist command with
+  manually-maintained MANIFEST files.
+
+- Issue #11281: smtplib.STMP gets source_address parameter, which adds the
+  ability to bind to specific source address on a machine with multiple
+  interfaces. Patch by Paulo Scardine.
+
+- Issue #12464: tempfile.TemporaryDirectory.cleanup() should not follow
+  symlinks: fix it. Patch by Petri Lehtinen.
+
+- 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 (Event,
+  Condition, etc.) used to be factory functions returning instances of hidden
+  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
+  lines.
+
+- Issue #12603: Fix pydoc.synopsis() on files with non-negative st_mtime.
+
+- Issue #12514: Use try/finally to assure the timeit module restores garbage
+  collections when it is done.
+
+- Issue #12607: In subprocess, fix issue where if stdin, stdout or stderr is
+  given as a low fd, it gets overwritten.
+
+- Issue #12590: IDLE editor window now always displays the first line
+  when opening a long file.  With Tk 8.5, the first line was hidden.
+
+- Issue #12576: Fix urlopen behavior on sites which do not send (or obfuscates)
+  Connection:close header.
+
+- Issue #12102: Document that buffered files must be flushed before being used
+  with mmap. Patch by Steffen Daode Nurpmeso.
+
+- Issue #12560: Build libpython.so on OpenBSD. Patch by Stefan Sperling.
+
+- Issue #1813: Fix codec lookup under Turkish locales.
+
+- Issue #12591: Improve support of "universal newlines" in the subprocess
+  module: the piped streams can now be properly read from or written to.
+
+- Issue #12591: Allow io.TextIOWrapper to work with raw IO objects (without
+  a read1() method), and add a *write_through* parameter to mandate
+  unbuffered writes.
+
+- Issue #10883: Fix socket leaks in urllib.request when using FTP.
+
+- Issue #12592: Make Python build on OpenBSD 5 (and future major releases).
+
+- Issue #12372: POSIX semaphores are broken on AIX: don't use them.
+
+- Issue #12551: Provide a get_channel_binding() method on SSL sockets so as
+  to get channel binding data for the current SSL session (only the
+  "tls-unique" channel binding is implemented).  This allows the implementation
+  of certain authentication mechanisms such as SCRAM-SHA-1-PLUS.  Patch by
+  Jacek Konieczny.
+
+- Issue #665194: email.utils now has format_datetime and parsedate_to_datetime
+  functions, allowing for round tripping of RFC2822 format dates.
+
+- Issue #12571: Add a plat-linux3 directory mirroring the plat-linux2
+  directory, so that "import DLFCN" and other similar imports work on
+  Linux 3.0.
+
+- Issue #7484: smtplib no longer puts <> around addresses in VRFY and EXPN
+  commands; they aren't required and in fact postfix doesn't support that form.
+
+- Issue #12273: Remove ast.__version__. AST changes can be accounted for by
+  checking sys.version_info or sys._mercurial.
+
+- Silence spurious "broken pipe" tracebacks when shutting down a
+  ProcessPoolExecutor.
+
+- Fix potential resource leaks in concurrent.futures.ProcessPoolExecutor
+  by joining all queues and processes when shutdown() is called.
+
+- Issue #11603: Fix a crash when __str__ is rebound as __repr__.  Patch by
+  Andreas Stührk.
+
+- Issue #11321: Fix a crash with multiple imports of the _pickle module when
+  embedding Python.  Patch by Andreas Stührk.
+
+- Issue #6755: Add get_wch() method to curses.window class. Patch by Iñigo
+  Serna.
+
+- Add cgi.closelog() function to close the log file.
+
+- Issue #12502: asyncore: fix polling loop with AF_UNIX sockets.
+
+- Issue #4376: ctypes now supports nested structures in a endian different than
+  the parent structure. Patch by Vlad Riscutia.
+
+- Raise ValueError when attempting to set the _CHUNK_SIZE attribute of a
+  TextIOWrapper to a huge value, not TypeError.
+
+- Issue #12504: Close file handles in a timely manner in packaging.database.
+  This fixes a bug with the remove (uninstall) feature on Windows.
+
+- Issues #12169 and #10510: Factor out code used by various packaging commands
+  to make HTTP POST requests, and make sure it uses CRLF.
+
+- Issue #12016: 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') gives '\ufffd\n' instead of '\ufffd'.
+
+- Issue #12459: time.sleep() now raises a ValueError if the sleep length is
+  negative, instead of an infinite sleep on Windows or raising an IOError on
+  Linux for example, to have the same behaviour on all platforms.
+
+- Issue #12451: pydoc: html_getfile() now uses tokenize.open() to support
+  Python scripts using a encoding different than UTF-8 (read the coding cookie
+  of the script).
+
+- Issue #12493: subprocess: Popen.communicate() now also handles EINTR errors
+  if the process has only one pipe.
+
+- Issue #12467: warnings: fix a race condition if a warning is emitted at
+  shutdown, if globals()['__file__'] is None.
+
+- Issue #12451: pydoc: importfile() now opens the Python script in binary mode,
+  instead of text mode using the locale encoding, to avoid encoding issues.
+
+- Issue #12451: runpy: run_path() now opens the Python script in binary mode,
+  instead of text mode using the locale encoding, to support other encodings
+  than UTF-8 (scripts using the coding cookie).
+
+- Issue #12451: xml.dom.pulldom: parse() now opens files in binary mode instead
+  of the text mode (using the locale encoding) to avoid encoding issues.
+
+- Issue #12147: Adjust the new-in-3.2 smtplib.send_message method for better
+  conformance to the RFCs:  correctly handle Sender and Resent- headers.
+
+- 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 immediately calls the (Python) signal handler
+  if it is interrupted by a signal, instead of having to wait until the next
+  instruction.
+
+- Issue #12442: new shutil.disk_usage function, providing total, used and free
+  disk space statistics.
+
+- Issue #12451: The XInclude default loader of xml.etree now decodes files from
+  UTF-8 instead of the locale encoding if the encoding is not specified. It now
+  also opens XML files for the parser in binary mode instead of the text mode
+  to avoid encoding issues.
+
+- Issue #12451: doctest.debug_script() doesn't create a temporary file
+  anymore to avoid encoding issues.
+
+- Issue #12451: pydoc.synopsis() now reads the encoding cookie if available,
+  to read the Python script from the right encoding.
+
+- Issue #12451: distutils now opens the setup script in binary mode to read the
+  encoding cookie, instead of opening it in UTF-8.
+
+- Issue #9516: On Mac OS X, change Distutils to no longer globally attempt to
+  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
+  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
+  greater or equal to the default value, the value with which the interpreter
+  was built.  Also, implement the same handling in packaging.
+
+- Issue #12422: In the copy module, don't store objects that are their own copy
+  in the memo dict.
+
+- Issue #12303: Add sigwaitinfo() and sigtimedwait() to the signal module.
+
+- Issue #12404: Remove C89 incompatible code from mmap module. Patch by Akira
+  Kitada.
+
+- Issue #1874: email now detects and reports as a defect the presence of
+  any CTE other than 7bit, 8bit, or binary on a multipart.
+
+- Issue #12383: Fix subprocess module with env={}: don't copy the environment
+  variables, start with an empty environment.
+
+- Issue #11637: Fix support for importing packaging setup hooks from the
+  project directory.
+
+- Issue #6771: Moved the curses.wrapper function from the single-function
+  wrapper module into __init__, eliminating the module.  Since __init__ was
+  already importing the function to curses.wrapper, there is no API change.
+
+- Issue #11584: email.header.decode_header no longer fails if the header
+  passed to it is a Header object, and Header/make_header no longer fail
+  if given binary unknown-8bit input.
+
+- Issue #11700: mailbox proxy object close methods can now be called multiple
+  times without error.
+
+- Issue #11767: Correct file descriptor leak in mailbox's __getitem__ method.
+
+- Issue #12133: AbstractHTTPHandler.do_open() of urllib.request closes the HTTP
+  connection if its getresponse() method fails with a socket error. Patch
+  written by Ezio Melotti.
+
+- Issue #12240: Allow multiple setup hooks in packaging's setup.cfg files.
+  Original patch by Erik Bray.
+
+- Issue #9284: Allow inspect.findsource() to find the source of doctest
+  functions.
+
+- Issue #11595: Fix assorted bugs in packaging.util.cfg_to_args, a
+  compatibility helper for the distutils-packaging transition.  Original patch
+  by Erik Bray.
+
+- Issue #12287: In ossaudiodev, check that the device isn't closed in several
+  methods.
+
+- Issue #12009: Fixed regression in netrc file comment handling.
+
+- Issue #12246: Warn and fail when trying to install a third-party project from
+  an uninstalled Python (built in a source checkout).  Original patch by
+  Tshepang Lekhonkhobe.
+
+- Issue #10694: zipfile now ignores garbage at the end of a zipfile.
+
+- Issue #12283: Fixed regression in smtplib quoting of leading dots in DATA.
+
+- Issue #10424: Argparse now includes the names of the missing required
+  arguments in the missing arguments error message.
+
+- Issue #12168: SysLogHandler now allows NUL termination to be controlled using
+  a new 'append_nul' attribute on the handler.
+
+- Issue #11583: Speed up os.path.isdir on Windows by using GetFileAttributes
+  instead of os.stat.
+
+- Issue #12021: Make mmap's read() method argument optional. Patch by Petri
+  Lehtinen.
+
+- Issue #9205: concurrent.futures.ProcessPoolExecutor now detects killed
+  children and raises BrokenProcessPool in such a situation.  Previously it
+  would reliably freeze/deadlock.
+
+- Issue #12040: Expose a new attribute ``sentinel`` on instances of
+  ``multiprocessing.Process``.  Also, fix Process.join() to not use polling
+  anymore, when given a timeout.
+
+- Issue #11893: Remove obsolete internal wrapper class ``SSLFakeFile`` in the
+  smtplib module.  Patch by Catalin Iacob.
+
+- Issue #12080: Fix a Decimal.power() case that took an unreasonably long time
+  to compute.
+
+- Issue #12221: Remove __version__ attributes from pyexpat, pickle, tarfile,
+  pydoc, tkinter, and xml.parsers.expat. This were useless version constants
+  left over from the Mercurial transition
+
+- Named tuples now work correctly with vars().
+
+- Issue #12085: Fix an attribute error in subprocess.Popen destructor if the
+  constructor has failed, e.g. because of an undeclared keyword argument. Patch
+  written by Oleg Oshmyan.
+
+- Issue #12028: Make threading._get_ident() public, rename it to
+  threading.get_ident() and document it. This function was already used using
+  _thread.get_ident().
+
+- Issue #12171: IncrementalEncoder.reset() of CJK codecs (multibytecodec) calls
+  encreset() instead of decreset().
+
+- Issue #12218: Removed wsgiref.egg-info.
+
+- Issue #12196: Add pipe2() to the os module.
+
+- Issue #985064: Make plistlib more resilient to faulty input plists.
+  Patch by Mher Movsisyan.
+
+- Issue #1625: BZ2File and bz2.decompress() now support multi-stream files.
+  Initial patch by Nir Aides.
+
+- Issue #12175: BufferedReader.read(-1) now calls raw.readall() if available.
+
+- Issue #12175: FileIO.readall() now only reads the file position and size
+  once.
+
+- Issue #12175: RawIOBase.readall() now returns None if read() returns None.
+
+- Issue #12175: FileIO.readall() now raises a ValueError instead of an IOError
+  if the file is closed.
+
+- Issue #11109: New service_action method for BaseServer, used by ForkingMixIn
+  class for cleanup. Initial Patch by Justin Warkentin.
+
+- Issue #12045: Avoid duplicate execution of command in
+  ctypes.util._get_soname().  Patch by Sijin Joseph.
+
+- Issue #10818: Remove the Tk GUI and the serve() function of the pydoc module,
+  pydoc -g has been deprecated in Python 3.2 and it has a new enhanced web
+  server.
+
+- Issue #1441530: In imaplib, read the data in one chunk to speed up large
+  reads and simplify code.
+
+- Issue #12070: Fix the Makefile parser of the sysconfig module to handle
+  correctly references to "bogus variable" (e.g. "prefix=$/opt/python").
+
+- Issue #12100: Don't reset incremental encoders of CJK codecs at each call to
+  their encode() method anymore, but continue to call the reset() method if the
+  final argument is True.
+
+- Issue #12049: Add RAND_bytes() and RAND_pseudo_bytes() functions to the ssl
+  module.
+
+- Issue #6501: os.device_encoding() returns None on Windows if the application
+  has no console.
+
+- Issue #12105: Add O_CLOEXEC to the os module.
+
+- Issue #12079: Decimal('Infinity').fma(Decimal('0'), (3.91224318126786e+19+0j))
+  now raises TypeError (reflecting the invalid type of the 3rd argument) rather
+  than Decimal.InvalidOperation.
+
+- Issue #12124: zipimport doesn't keep a reference to zlib.decompress() anymore
+  to be able to unload the module.
+
+- Add the packaging module, an improved fork of distutils (also known as
+  distutils2).
+
+- Issue #12065: connect_ex() on an SSL socket now returns the original errno
+  when the socket's timeout expires (it used to return None).
+
+- Issue #8809: The SMTP_SSL constructor and SMTP.starttls() now support
+  passing a ``context`` argument pointing to an ssl.SSLContext instance.
+  Patch by Kasun Herath.
+
+- Issue #11088: don't crash when using F5 to run a script in IDLE on MacOSX
+  with Tk 8.5.
+
+- Issue #9516: Issue #9516: avoid errors in sysconfig when MACOSX_DEPLOYMENT_TARGET
+  is set in shell.
+
+- Issue #8650: Make zlib module 64-bit clean. compress(), decompress() and
+  their incremental counterparts now raise OverflowError if given an input
+  larger than 4GB, instead of silently truncating the input and returning
+  an incorrect result.
+
+- Issue #12050: zlib.decompressobj().decompress() now clears the unconsumed_tail
+  attribute when called without a max_length argument.
+
+- Issue #12062: Fix a flushing bug when doing a certain type of I/O sequence
+  on a file opened in read+write mode (namely: reading, seeking a bit forward,
+  writing, then seeking before the previous write but still within buffered
+  data, and writing again).
+
+- Issue #9971: Write an optimized implementation of BufferedReader.readinto().
+  Patch by John O'Connor.
+
+- Issue #1028: Tk returns invalid Unicode null in %A: UnicodeDecodeError.
+  With Tk < 8.5 _tkinter.c:PythonCmd() raised UnicodeDecodeError, caused
+  IDLE to exit.  Converted to valid Unicode null in PythonCmd().
+
+- Issue #11799: urllib.request Authentication Handlers will raise a ValueError
+  when presented with an unsupported Authentication Scheme. Patch contributed
+  by Yuval Greenfield.
+
+- Issue #10419, #6011: build_scripts command of distutils handles correctly
+  non-ASCII path (path to the Python executable). Open and write the script in
+  binary mode, but ensure that the shebang is decodable from UTF-8 and from the
+  encoding of the script.
+
+- Issue #8498: In socket.accept(), allow to specify 0 as a backlog value in
+  order to accept exactly one connection.  Patch by Daniel Evers.
+
+- Issue #12011: signal.signal() and signal.siginterrupt() raise an OSError,
+  instead of a RuntimeError: OSError has an errno attribute.
+
+- 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.
+
+- Issue #11164: Stop trying to use _xmlplus in the xml module.
+
+- Issue #11888: Add log2 function to math module. Patch written by Mark
+  Dickinson.
+
+- Issue #12012: ssl.PROTOCOL_SSLv2 becomes optional.
+
+- Issue #8407: The signal handler writes the signal number as a single byte
+  instead of a nul byte into the wakeup file descriptor. So it is possible to
+  wait more than one signal and know which signals were raised.
+
+- Issue #8407: Add pthread_kill(), sigpending() and sigwait() functions to the
+  signal module.
+
+- Issue #11927: SMTP_SSL now uses port 465 by default as documented.  Patch
+  by Kasun Herath.
+
+- Issue #12002: ftplib's abort() method raises TypeError.
+
+- Issue #11916: Add a number of MacOSX specific definitions to the errno module.
+  Patch by Pierre Carrier.
+
+- Issue #11999: fixed sporadic sync failure mailbox.Maildir due to its trying to
+  detect mtime changes by comparing to the system clock instead of to the
+  previous value of the mtime.
+
+- Issue #11072: added MLSD command (RFC-3659) support to ftplib.
+
+- Issue #8808: The IMAP4_SSL constructor now allows passing an SSLContext
+  parameter to control parameters of the secure channel.  Patch by Sijin
+  Joseph.
+
+- ntpath.samefile failed to notice that "a.txt" and "A.TXT" refer to the same
+  file on Windows XP. As noticed in issue #10684.
+
+- Issue #12000: When a SSL certificate has a subjectAltName without any
+  dNSName entry, ssl.match_hostname() should use the subject's commonName.
+  Patch by Nicolas Bareil.
+
+- Issue #10775: assertRaises, assertRaisesRegex, assertWarns, and
+  assertWarnsRegex now accept a keyword argument 'msg' when used as context
+  managers.  Initial patch by Winston Ewert.
+
+- Issue #10684: shutil.move used to delete a folder on case insensitive
+  filesystems when the source and destination name where the same except
+  for the case.
+
+- Issue #11647: objects created using contextlib.contextmanager now support
+  more than one call to the function when used as a decorator. Initial patch
+  by Ysj Ray.
+
+- Issue #11930: Removed deprecated time.accept2dyear variable.
+  Removed year >= 1000 restriction from datetime.strftime.
+
+- logging: don't define QueueListener if Python has no thread support.
+
+- functools.cmp_to_key() now works with collections.Hashable().
+
+- Issue #11277: mmap.mmap() calls fcntl(fd, F_FULLFSYNC) on Mac OS X to get
+  around a mmap bug with sparse files. Patch written by Steffen Daode Nurpmeso.
+
+- Issue #8407: Add signal.pthread_sigmask() function to fetch and/or change the
+  signal mask of the calling thread.
+
+- Issue #11858: configparser.ExtendedInterpolation expected lower-case section
+  names.
+
+- Issue #11324: ConfigParser(interpolation=None) now works correctly.
+
+- Issue #11811: ssl.get_server_certificate() is now IPv6-compatible.  Patch
+  by Charles-François Natali.
+
+- Issue #11763: don't use difflib in TestCase.assertMultiLineEqual if the
+  strings are too long.
+
+- Issue #11236: getpass.getpass responds to ctrl-c or ctrl-z on terminal.
+
+- Issue #11856: Speed up parsing of JSON numbers.
+
+- Issue #11005: threading.RLock()._release_save() raises a RuntimeError if the
+  lock was not acquired.
+
+- Issue #11258: Speed up ctypes.util.find_library() under Linux by a factor
+  of 5 to 10.  Initial patch by Jonas H.
+
+- Issue #11382: Trivial system calls, such as dup() or pipe(), needn't
+  release the GIL.  Patch by Charles-François Natali.
+
+- Issue #11223: Add threading._info() function providing informations about
+  the thread implementation.
+
+- Issue #11731: simplify/enhance email parser/generator API by introducing
+  policy objects.
+
+- Issue #11768: The signal handler of the signal module only calls
+  Py_AddPendingCall() for the first signal to fix a deadlock on reentrant or
+  parallel calls. PyErr_SetInterrupt() writes also into the wake up file.
+
+- Issue #11492: fix several issues with header folding in the email package.
+
+- Issue #11852: Add missing imports and update tests.
+
+- Issue #11875: collections.OrderedDict's __reduce__ was temporarily
+  mutating the object instead of just working on a copy.
+
+- Issue #11467: Fix urlparse behavior when handling urls which contains scheme
+  specific part only digits. Patch by Santoso Wijaya.
+
+- collections.Counter().copy() now works correctly for subclasses.
+
+- Issue #11474: Fix the bug with url2pathname() handling of '/C|/' on Windows.
+  Patch by Santoso Wijaya.
+
+- Issue #11684: complete email.parser bytes API by adding BytesHeaderParser.
+
+- The bz2 module now handles 4GiB+ input buffers correctly.
+
+- Issue #9233: Fix json.loads('{}') to return a dict (instead of a list), when
+  _json is not available.
+
+- Issue #11830: Remove unnecessary introspection code in the decimal module.
+
+- Issue #11703: urllib2.geturl() does not return correct url when the original
+  url contains #fragment.
+
+- Issue #10019: Fixed regression in json module where an indent of 0 stopped
+  adding newlines and acted instead like 'None'.
+
+- Issue #11186: pydoc ignores a module if its name contains a surrogate
+  character in the index of modules.
+
+- Issue #11815: Use a light-weight SimpleQueue for the result queue in
+  concurrent.futures.ProcessPoolExecutor.
+
+- Issue #5162: Treat services like frozen executables to allow child spawning
+  from multiprocessing.forking on Windows.
+
+- logging.basicConfig now supports an optional 'handlers' argument taking an
+  iterable of handlers to be added to the root logger. Additional parameter
+  checks were also added to basicConfig.
+
+- Issue #11814: Fix likely typo in multiprocessing.Pool._terminate().
+
+- Issue #11747: Fix range formatting in difflib.context_diff() and
+  difflib.unified_diff().
+
+- Issue #8428: Fix a race condition in multiprocessing.Pool when terminating
+  worker processes: new processes would be spawned while the pool is being
+  shut down.  Patch by Charles-François Natali.
+
+- Issue #2650: re.escape() no longer escapes the '_'.
+
+- Issue #11757: select.select() now raises ValueError when a negative timeout
+  is passed (previously, a select.error with EINVAL would be raised).  Patch
+  by Charles-François Natali.
+
+- Issue #7311: fix html.parser to accept non-ASCII attribute values.
+
+- Issue #11605: email.parser.BytesFeedParser was incorrectly converting
+  multipart subparts with an 8-bit CTE into unicode instead of preserving the
+  bytes.
+
+- Issue #1690608: email.util.formataddr is now RFC 2047 aware:  it now has a
+  charset parameter that defaults to utf-8 and is used as the charset for RFC
+  2047 encoding when the realname contains non-ASCII characters.
+
+- Issue #10963: Ensure that subprocess.communicate() never raises EPIPE.
+
+- Issue #10791: Implement missing method GzipFile.read1(), allowing GzipFile
+  to be wrapped in a TextIOWrapper.  Patch by Nadeem Vawda.
+
+- Issue #11707: Added a fast C version of functools.cmp_to_key().
+  Patch by Filip Gruszczyński.
+
+- Issue #11688: Add sqlite3.Connection.set_trace_callback().  Patch by
+  Torsten Landschoff.
+
+- Issue #11746: Fix SSLContext.load_cert_chain() to accept elliptic curve
+  private keys.
+
+- Issue #5863: Rewrite BZ2File in pure Python, and allow it to accept
+  file-like objects using a new ``fileobj`` constructor argument.  Patch by
+  Nadeem Vawda.
+
+- unittest.TestCase.assertSameElements has been removed.
+
+- sys.getfilesystemencoding() raises a RuntimeError if initfsencoding() was not
+  called yet: detect bootstrap (startup) issues earlier.
+
+- Issue #11393: Add the new faulthandler module.
+
+- Issue #11618: Fix the timeout logic in threading.Lock.acquire() under Windows.
+
+- Removed the 'strict' argument to email.parser.Parser, which has been
+  deprecated since Python 2.4.
+
+- Issue #11256: Fix inspect.getcallargs on functions that take only keyword
+  arguments.
+
+- Issue #11696: Fix ID generation in msilib.
+
+- itertools.accumulate now supports an optional *func* argument for
+  a user-supplied binary function.
+
+- Issue #11692: Remove unnecessary demo functions in subprocess module.
+
+- Issue #9696: Fix exception incorrectly raised by xdrlib.Packer.pack_int when
+  trying to pack a negative (in-range) integer.
+
+- Issue #11675: multiprocessing.[Raw]Array objects created from an integer size
+  are now zeroed on creation.  This matches the behaviour specified by the
+  documentation.
+
+- Issue #7639: Fix short file name generation in bdist_msi
+
+- Issue #11659: Fix ResourceWarning in test_subprocess introduced by #11459.
+  Patch by Ben Hayden.
+
+- Issue #11635: Don't use polling in worker threads and processes launched by
+  concurrent.futures.
+
+- Issue #6811: Allow importlib to change a code object's co_filename attribute
+  to match the path to where the source code currently is, not where the code
+  object originally came from.
+
+- Issue #8754: Have importlib use the repr of a module name in error messages.
+
+- Issue #11591: Prevent "import site" from modifying sys.path when python
+  was started with -S.
+
+- collections.namedtuple() now adds a _source attribute to the generated
+  class.  This make the source more accessible than the outdated
+  "verbose" option which prints to stdout but doesn't make the source
+  string available.
+
+- Issue #11371: Mark getopt error messages as localizable.  Patch by Filip
+  Gruszczyński.
+
+- Issue #11333: Add __slots__ to collections ABCs.
+
+- Issue #11628: cmp_to_key generated class should use __slots__.
+
+- Issue #11666: let help() display named tuple attributes and methods
+  that start with a leading underscore.
+
+- Issue #11662: Make urllib and urllib2 ignore redirections if the
+  scheme is not HTTP, HTTPS or FTP (CVE-2011-1521).
+
+- Issue #5537: Fix time2isoz() and time2netscape() functions of
+  httplib.cookiejar for expiration year greater than 2038 on 32-bit systems.
+
+- Issue #4391: Use proper gettext plural forms in optparse.
+
+- Issue #11127: Raise a TypeError when trying to pickle a socket object.
+
+- Issue #11563: Connection:close header is sent by requests using URLOpener
+  class which helps in closing of sockets after connection is over. Patch
+  contributions by Jeff McNeil and Nadeem Vawda.
+
+- Issue #11459: A ``bufsize`` value of 0 in subprocess.Popen() really creates
+  unbuffered pipes, such that select() works properly on them.
+
+- Issue #5421: Fix misleading error message when one of socket.sendto()'s
+  arguments has the wrong type.  Patch by Nikita Vetoshkin.
+
+- Issue #10812: Add some extra posix functions to the os module.
+
+- Issue #10979: unittest stdout buffering now works with class and module
+  setup and teardown.
+
+- Issue #11577: fix ResourceWarning triggered by improved binhex test coverage
+
+- Issue #11243: fix the parameter querying methods of Message to work if
+  the headers contain un-encoded non-ASCII data.
+
+- Issue #11401: fix handling of headers with no value; this fixes a regression
+  relative to Python2 and the result is now the same as it was in Python2.
+
+- Issue #9298: base64 bodies weren't being folded to line lengths less than 78,
+  which was a regression relative to Python2.  Unlike Python2, the last line
+  of the folded body now ends with a carriage return.
+
+- Issue #11560: shutil.unpack_archive now correctly handles the format
+  parameter. Patch by Evan Dandrea.
+
+- Issue #5870: Add `subprocess.DEVNULL` constant.
+
+- Issue #11133: fix two cases where inspect.getattr_static can trigger code
+  execution. Patch by Andreas Stührk.
+
+- Issue #11569: use absolute path to the sysctl command in multiprocessing to
+  ensure that it will be found regardless of the shell PATH. This ensures
+  that multiprocessing.cpu_count works on default installs of MacOSX.
+
+- Issue #11501: disutils.archive_utils.make_zipfile no longer fails if zlib is
+  not installed. Instead, the zipfile.ZIP_STORED compression is used to create
+  the ZipFile. Patch by Natalia B. Bidart.
+
+- 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
+  encoding was not done if euc-jp or shift-jis was specified as the charset.
+
+- Issue #11509: Significantly increase test coverage of fileinput.
+  Patch by Denver Coneybeare at PyCon 2011 Sprints.
+
+- 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
+  IP addresses in the proxy exception list.
+
+- Issue #11491: dbm.error is no longer raised when dbm.open is called with
+  the "n" as the flag argument and the file exists. The behavior matches
+  the documentation and general logic.
+
+- Issue #1162477: Postel Principle adjustment to email date parsing: handle the
+  fact that some non-compliant MUAs use '.' instead of ':' in time specs.
+
+- Issue #11131: Fix sign of zero in decimal.Decimal plus and minus
+  operations when the rounding mode is ROUND_FLOOR.
+
+- Issue #9935: Speed up pickling of instances of user-defined classes.
+
+- Issue #5622: Fix curses.wrapper to raise correct exception if curses
+  initialization fails.
+
+- Issue #11408: In threading.Lock.acquire(), only call gettimeofday() when
+  really necessary.  Patch by Charles-François Natali.
+
+- Issue #11391: Writing to a mmap object created with
+  ``mmap.PROT_READ|mmap.PROT_EXEC`` would segfault instead of raising a
+  TypeError.  Patch by Charles-François Natali.
+
+- Issue #9795: add context management protocol support for nntplib.NNTP class.
+
+- Issue #11306: mailbox in certain cases adapts to an inability to open
+  certain files in read-write mode.  Previously it detected this by
+  checking for EACCES, now it also checks for EROFS.
+
+- Issue #11265: asyncore now correctly handles EPIPE, EBADF and EAGAIN errors
+  on accept(), send() and recv().
+
+- Issue #11377: Deprecate platform.popen() and reimplement it with os.popen().
+
+- Issue #8513: On UNIX, subprocess supports bytes command string.
+
+- Issue #10866: Add socket.sethostname().  Initial patch by Ross Lagerwall.
+
+- Issue #11140: Lock.release() now raises a RuntimeError when attempting
+  to release an unacquired lock, as claimed in the threading documentation.
+  The _thread.error exception is now an alias of RuntimeError.  Patch by
+  Filip Gruszczyński.  Patch for _dummy_thread by Aymeric Augustin.
+
+- Issue #8594: ftplib now provides a source_address parameter to specify which
+  (address, port) to bind to before connecting.
+
+- Issue #11326: Add the missing connect_ex() implementation for SSL sockets,
+  and make it work for non-blocking connects.
+
+- Issue #11297: Add collections.ChainMap().
+
+- Issue #10755: Add the posix.flistdir() function.  Patch by Ross Lagerwall.
+
+- Issue #4761: Add the ``*at()`` family of functions (openat(), etc.) to the
+  posix module.  Patch by Ross Lagerwall.
+
+- Issue #7322: Trying to read from a socket's file-like object after a timeout
+  occurred now raises an error instead of silently losing data.
+
+- Issue #11291: poplib.POP no longer suppresses errors on quit().
+
+- Issue #11177: asyncore's create_socket() arguments can now be omitted.
+
+- Issue #6064: Add a ``daemon`` keyword argument to the threading.Thread
+  and multiprocessing.Process constructors in order to override the
+  default behaviour of inheriting the daemonic property from the current
+  thread/process.
+
+- Issue #10956: Buffered I/O classes retry reading or writing after a signal
+  has arrived and the handler returned successfully.
+
+- Issue #10784: New os.getpriority() and os.setpriority() functions.
+
+- Issue #11114: Fix catastrophic performance of tell() on text files (up
+  to 1000x faster in some cases).  It is still one to two order of magnitudes
+  slower than binary tell().
+
+- Issue #10882: Add os.sendfile function.
+
+- Issue #10868: Allow usage of the register method of an ABC as a class
+  decorator.
+
+- Issue #11224: Fixed a regression in tarfile that affected the file-like
+  objects returned by TarFile.extractfile() regarding performance, memory
+  consumption and failures with the stream interface.
+
+- Issue #10924: Adding salt and Modular Crypt Format to crypt library.
+  Moved old C wrapper to _crypt, and added a Python wrapper with
+  enhanced salt generation and simpler API for password generation.
+
+- Issue #11074: Make 'tokenize' so it can be reloaded.
+
+- Issue #11085: Moved collections abstract base classes into a separate
+  module called collections.abc, following the pattern used by importlib.abc.
+  For backwards compatibility, the names are imported into the collections
+  module.
+
+- Issue #4681: Allow mmap() to work on file sizes and offsets larger than
+  4GB, even on 32-bit builds.  Initial patch by Ross Lagerwall, adapted for
+  32-bit Windows.
+
+- Issue #11169: compileall module uses repr() to format filenames and paths to
+  escape surrogate characters and show spaces.
+
+- Issue #11089: Fix performance issue limiting the use of ConfigParser()
+  with large config files.
+
+- Issue #10276: Fix the results of zlib.crc32() and zlib.adler32() on buffers
+  larger than 4GB.  Patch by Nadeem Vawda.
+
+- Issue #11388: Added a clear() method to MutableSequence
+
+- Issue #11174: Add argparse.MetavarTypeHelpFormatter, which uses type names
+  for the names of optional and positional arguments in help messages.
+
+- Issue #9348: Raise an early error if argparse nargs and metavar don't match.
+
+- Issue #8982: Improve the documentation for the argparse Namespace object.
+
+- Issue #9343: Document that argparse parent parsers must be configured before
+  their children.
+
+- Issue #9026: Fix order of argparse sub-commands in help messages.
+
+- Issue #9347: Fix formatting for tuples in argparse type= error messages.
+
+- Issue #12191: Added shutil.chown() to change user and/or group owner of a
+  given path also specifying their names.
+
+- Issue #13988: The _elementtree accelerator is used whenever available.
+  Now xml.etree.cElementTree becomes a deprecated alias to ElementTree.
+
+Build
+-----
+
+- Issue #6807: Run msisupport.mak earlier.
+
+- Issue #10580: Minor grammar change in Windows installer.
+
+- Issue #13326: Clean __pycache__ directories correctly on OpenBSD.
+
+- PEP 393: the configure option --with-wide-unicode is removed.
+
+- Issue #12852: Set _XOPEN_SOURCE to 700, instead of 600, to get POSIX 2008
+  functions on OpenBSD (e.g. fdopendir).
+
+- Issue #11863: Remove support for legacy systems deprecated in Python 3.2
+  (following PEP 11).  These systems are systems using Mach C Threads,
+  SunOS lightweight processes, GNU pth threads and IRIX threads.
+
+- Issue #8746: Correct faulty configure checks so that os.chflags() and
+  os.lchflags() are once again built on systems that support these
+  functions (BSD and OS X).  Also add new stat file flags for OS X
+  (UF_HIDDEN and UF_COMPRESSED).
+
+- 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
+  building sqlite3.
+
+- Issue #11217: For 64-bit/32-bit Mac OS X universal framework builds,
+  ensure "make install" creates symlinks in --prefix bin for the "-32"
+  files in the framework bin directory like the installer does.
+
+- Issue #11347: Use --no-as-needed when linking libpython3.so.
+
+- Issue #11411: Fix 'make DESTDIR=' with a relative destination.
+
+- Issue #11268: Prevent Mac OS X Installer failure if Documentation
+  package had previously been installed.
+
+- Issue #11495: OSF support is eliminated. It was deprecated in Python 3.2.
+
+
+IDLE
+----
+
+- Issue #11718: IDLE's open module dialog couldn't find the __init__.py
+  file in a package.
+
+Tools/Demos
+-----------
+
+- Issue #14053: patchcheck.py ("make patchcheck") now works with MQ patches.
+  Patch by Francisco Martín Brugué.
+
+- Issue #13930: 2to3 is now able to write its converted output files to another
+  directory tree as well as copying unchanged files and altering the file
+  suffix.  See its new -o, -W and --add-suffix options.  This makes it more
+  useful in many automated code translation workflows.
+
+- Issue #13628: python-gdb.py is now able to retrieve more frames in the Python
+  traceback if Python is optimized.
+
+- Issue #11996: libpython (gdb), replace "py-bt" command by "py-bt-full" and
+  add a smarter "py-bt" command printing a classic Python traceback.
+
+- Issue #11179: Make ccbench work under Python 3.1 and 2.7 again.
+
+- Issue #10639: reindent.py no longer converts newlines and will raise
+  an error if attempting to convert a file with mixed newlines.
+  "--newline" option added to specify new line character.
+
+Extension Modules
+-----------------
+
+- Issue #13840: The error message produced by ctypes.create_string_buffer
+  when given a Unicode string has been fixed.
+
+- Issue #9975: socket: Fix incorrect use of flowinfo and scope_id. Patch by
+  Vilmos Nebehaj.
+
+- Issue #7777: socket: Add Reliable Datagram Sockets (PF_RDS) support.
+
+- Issue #13159: FileIO and BZ2Compressor/BZ2Decompressor now use a linear-time
+  buffer growth strategy instead of a quadratic-time one.
+
+- Issue #10141: socket: Add SocketCAN (PF_CAN) support. Initial patch by
+  Matthias Fuchs, updated by Tiago Gonçalves.
+
+- Issue #13070: Fix a crash when a TextIOWrapper caught in a reference cycle
+  would be finalized after the reference to its underlying BufferedRWPair's
+  writer got cleared by the GC.
+
+- Issue #12881: ctypes: Fix segfault with large structure field names.
+
+- Issue #13058: ossaudiodev: fix a file descriptor leak on error. Patch by
+  Thomas Jarosch.
+
+- Issue #13013: ctypes: Fix a reference leak in PyCArrayType_from_ctype.
+  Thanks to Suman Saha for finding the bug and providing a patch.
+
+- Issue #13022: Fix: _multiprocessing.recvfd() doesn't check that
+  file descriptor was actually received.
+
+- Issue #1172711: Add 'long long' support to the array module.
+  Initial patch by Oren Tirosh and Hirokazu Yamamoto.
+
+- Issue #12483: ctypes: Fix a crash when the destruction of a callback
+  object triggers the garbage collector.
+
+- Issue #12950: Fix passing file descriptors in multiprocessing, under
+  OpenIndiana/Illumos.
+
+- Issue #12764: Fix a crash in ctypes when the name of a Structure field is not
+  a string.
+
+- Issue #11241: subclasses of ctypes.Array can now be subclassed.
+
+- Issue #9651: Fix a crash when ctypes.create_string_buffer(0) was passed to
+  some functions like file.write().
+
+- Issue #10309: Define _GNU_SOURCE so that mremap() gets the proper
+  signature.  Without this, architectures where sizeof void* != sizeof int are
+  broken.  Patch given by Hallvard B Furuseth.
+
+- Issue #12051: Fix segfault in json.dumps() while encoding highly-nested
+  objects using the C accelerations.
+
+- Issue #12017: Fix segfault in json.loads() while decoding highly-nested
+  objects using the C accelerations.
+
+- Issue #1838: Prevent segfault in ctypes, when _as_parameter_ on a class is set
+  to an instance of the class.
+
+Tests
+-----
+
+- Issue #11689: Fix a variable scoping error in an sqlite3 test
+
+- Issue #13786: Remove unimplemented 'trace' long option from regrtest.py.
+
+- Issue #13725: Fix regrtest to recognize the documented -d flag.
+  Patch by Erno Tukia.
+
+- Issue #13304: Skip test case if user site-packages disabled (-s or
+  PYTHONNOUSERSITE).  (Patch by Carl Meyer)
+
+- Issue #5661: Add a test for ECONNRESET/EPIPE handling to test_asyncore. Patch
+  by Xavier de Gaye.
+
+- Issue #13218: Fix test_ssl failures on Debian/Ubuntu.
+
+- Re-enable lib2to3's test_parser.py tests, though with an expected failure
+  (see issue 13125).
+
+- Issue #12656: Add tests for IPv6 and Unix sockets to test_asyncore.
+
+- Issue #6484: Add unit tests for mailcap module (patch by Gregory Nofi)
+
+- Issue #11651: Improve the Makefile test targets to run more of the test suite
+  more quickly. The --multiprocess option is now enabled by default, reducing
+  the amount of time needed to run the tests. "make test" and "make quicktest"
+  now include some resource-intensive tests, but no longer run the test suite
+  twice to check for bugs in .pyc generation. Tools/scripts/run_test.py provides
+  an easy platform-independent way to run test suite with sensible defaults.
+
+- Issue #12331: The test suite for the packaging module can now run from an
+  installed Python.
+
+- Issue #12331: The test suite for lib2to3 can now run from an installed
+  Python.
+
+- Issue #12626: In regrtest, allow to filter tests using a glob filter
+  with the ``-m`` (or ``--match``) option.  This works with all test cases
+  using the unittest module.  This is useful with long test suites
+  such as test_io or test_subprocess.
+
+- Issue #12624: It is now possible to fail after the first failure when
+  running in verbose mode (``-v`` or ``-W``), by using the ``--failfast``
+  (or ``-G``) option to regrtest.  This is useful with long test suites
+  such as test_io or test_subprocess.
+
+- Issue #12587: Correct faulty test file and reference in test_tokenize.
+  (Patch by Robert Xiao)
+
+- Issue #12573: Add resource checks for dangling Thread and Process objects.
+
+- Issue #12549: Correct test_platform to not fail when OS X returns 'x86_64'
+  as the processor type on some Mac systems.
+
+- Skip network tests when getaddrinfo() returns EAI_AGAIN, meaning a temporary
+  failure in name resolution.
+
+- Issue #11812: Solve transient socket failure to connect to 'localhost'
+  in test_telnetlib.py.
+
+- Solved a potential deadlock in test_telnetlib.py. Related to issue #11812.
+
+- Avoid failing in test_robotparser when mueblesmoraleda.com is flaky and
+  an overzealous DNS service (e.g. OpenDNS) redirects to a placeholder
+  Web site.
+
+- Avoid failing in test_urllibnet.test_bad_address when some overzealous
+  DNS service (e.g. OpenDNS) resolves a non-existent domain name.  The test
+  is now skipped instead.
+
+- Issue #12440: When testing whether some bits in SSLContext.options can be
+  reset, check the version of the OpenSSL headers Python was compiled against,
+  rather than the runtime version of the OpenSSL library.
+
+- Issue #11512: Add a test suite for the cgitb module. Patch by Robbie Clemons.
+
+- Issue #12497: Install test/data to prevent failures of the various codecmaps
+  tests.
+
+- Issue #12496: Install test/capath directory to prevent test_connect_capath
+  testcase failure in test_ssl.
+
+- Issue #12469: Run wakeup and pending signal tests in a subprocess to run the
+  test in a fresh process with only one thread and to not change signal
+  handling of the parent process.
+
+- Issue #8716: Avoid crashes caused by Aqua Tk on OSX when attempting to run
+  test_tk or test_ttk_guionly under a username that is not currently logged
+  in to the console windowserver (as may be the case under buildbot or ssh).
+
+- Issue #12407: Explicitly skip test_capi.EmbeddingTest under Windows.
+
+- Issue #12400: regrtest -W doesn't rerun the tests twice anymore, but captures
+  the output and displays it on failure instead. regrtest -v doesn't print the
+  error twice anymore if there is only one error.
+
+- Issue #12141: Install copies of template C module file so that
+  test_build_ext of test_distutils and test_command_build_ext of
+  test_packaging are no longer silently skipped when
+  run outside of a build directory.
+
+- Issue #8746: Add additional tests for os.chflags() and os.lchflags().
+  Patch by Garrett Cooper.
+
+- Issue #10736: Fix test_ttk test_widgets failures with Cocoa Tk 8.5.9
+  2.8 +  on Mac OS X.  (Patch by Ronald Oussoren)
+
+- Issue #12057: Add tests for ISO 2022 codecs (iso2022_jp, iso2022_jp_2,
+  iso2022_kr).
+
+- Issue #12096: Fix a race condition in test_threading.test_waitfor(). Patch
+  written by Charles-François Natali.
+
+- Issue #11614: import __hello__ prints "Hello World!". Patch written by
+  Andreas Stührk.
+
+- Issue #5723: Improve json tests to be executed with and without accelerations.
+
+- Issue #12041: Make test_wait3 more robust.
+
+- Issue #11873: Change regex in test_compileall to fix occasional failures when
+  the randomly generated temporary path happened to match the regex.
+
+- Issue #11958: Fix FTP tests for IPv6, bind to "::1" instead of "localhost".
+  Patch written by Charles-Francois Natali.
+
+- Issue #8407, #11859: Fix tests of test_io using threads and an alarm: use
+  pthread_sigmask() to ensure that the SIGALRM signal is received by the main
+  thread.
+
+- Issue #11811: Factor out detection of IPv6 support on the current host
+  and make it available as ``test.support.IPV6_ENABLED``.  Patch by
+  Charles-François Natali.
+
+- Issue #10914: Add a minimal embedding test to test_capi.
+
+- Issue #11223: Skip test_lock_acquire_interruption() and
+  test_rlock_acquire_interruption() of test_threadsignals if a thread lock is
+  implemented using a POSIX mutex and a POSIX condition variable. A POSIX
+  condition variable cannot be interrupted by a signal (e.g. on Linux, the
+  futex system call is restarted).
+
+- Issue #11790: Fix sporadic failures in test_multiprocessing.WithProcessesTestCondition.
+
+- Fix possible "file already exists" error when running the tests in parallel.
+
+- Issue #11719: Fix message about unexpected test_msilib skip on non-Windows
+  platforms. Patch by Nadeem Vawda.
+
+- Issue #11727: Add a --timeout option to regrtest: if a test takes more than
+  TIMEOUT seconds, dumps the traceback of all threads and exits.
+
+- Issue #11653: fix -W with -j in regrtest.
+
+- The email test suite now lives in the Lib/test/test_email package.  The test
+  harness code has also been modernized to allow use of new unittest features.
+
+- regrtest now discovers test packages as well as test modules.
+
+- Issue #11577: improve test coverage of binhex.py. Patch by Arkady Koplyarov.
+
+- New test_crashers added to exercise the scripts in the Lib/test/crashers
+  directory and confirm they fail as expected
+
+- Issue #11578: added test for the timeit module.  Patch by Michael Henry.
+
+- Issue #11503: improve test coverage of posixpath.py. Patch by Evan Dandrea.
+
+- Issue #11505: improves test coverage of string.py, increases granularity of
+  string.Formatter tests. Initial patch by Alicia Arlen.
+
+- Issue #11548: Improve test coverage of the shutil module. Patch by
+  Evan Dandrea.
+
+- Issue #11554: Reactivated test_email_codecs.
+
+- Issue #11505: improves test coverage of string.py. Patch by Alicia
+  Arlen
+
+- Issue #11490: test_subprocess:test_leaking_fds_on_error no longer gives a
+  false positive if the last directory in the path is inaccessible.
+
+- Issue #11223: Fix test_threadsignals to fail, not hang, when the
+  non-semaphore implementation of locks is used under POSIX.
+
+- Issue #10911: Add tests on CGI with non-ASCII characters. Patch written by
+  Pierre Quentel.
+
+- Issue #9931: Fix hangs in GUI tests under Windows in certain conditions.
+  Patch by Hirokazu Yamamoto.
+
+- Issue #10512: Properly close sockets under test.test_cgi.
+
+- Issue #10992: Make tests pass under coverage.
+
+- Issue #10826: Prevent sporadic failure in test_subprocess on Solaris due
+  to open door files.
+
+- Issue #10990: Prevent tests from clobbering a set trace function.
+
+C-API
+-----
+
+- Add PyObject_GenericGetDict and PyObject_GeneriSetDict. They are generic
+  implementations for the getter and setter of a ``__dict__`` descriptor of C
+  types.
+
+- Issue #13727: Add 3 macros to access PyDateTime_Delta members:
+  PyDateTime_DELTA_GET_DAYS, PyDateTime_DELTA_GET_SECONDS,
+  PyDateTime_DELTA_GET_MICROSECONDS.
+
+- Issue #10542: Add 4 macros to work with surrogates: Py_UNICODE_IS_SURROGATE,
+  Py_UNICODE_IS_HIGH_SURROGATE, Py_UNICODE_IS_LOW_SURROGATE,
+  Py_UNICODE_JOIN_SURROGATES.
+
+- Issue #12724: Add Py_RETURN_NOTIMPLEMENTED macro for returning NotImplemented.
+
+- PY_PATCHLEVEL_REVISION has been removed, since it's meaningless with
+  Mercurial.
+
+- Issue #12173: The first argument of PyImport_ImportModuleLevel is now `const
+  char *` instead of `char *`.
+
+- Issue #12380: PyArg_ParseTuple now accepts a bytearray for the 'c' format.
+
+Documentation
+-------------
+
+- Issues #13491 and #13995: Fix many errors in sqlite3 documentation.
+  Initial patch for #13491 by Johannes Vogel.
+
+- Issue #13402: Document absoluteness of sys.executable.
+
+- 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.
+
+- Issue #13513: Fix io.IOBase documentation to correctly link to the
+  io.IOBase.readline method instead of the readline module.
+
+- Issue #13237: Reorganise subprocess documentation to emphasise convenience
+  functions and the most commonly needed arguments to Popen.
+
+- Issue #13141: Demonstrate recommended style for socketserver examples.
+
+- Issue #11818: Fix tempfile examples for Python 3.
+
+
 What's New in Python 3.2?
 =========================
 
@@ -707,7 +4804,7 @@
 - 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 #10554: Add context management protocol 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.
@@ -1069,7 +5166,7 @@
 - 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
+- Support context management protocol for file-like objects returned by mailbox
   ``get_file()`` methods.
 
 - Issue #10246: uu.encode didn't close file objects explicitly when filenames
@@ -1203,7 +5300,7 @@
 
 - Issue #10143: Update "os.pathconf" values.
 
-- Issue #6518: Support context manager protcol for ossaudiodev types.
+- Issue #6518: Support context management protocol for ossaudiodev types.
 
 - Issue #678250: Make mmap flush a noop on ACCESS_READ and ACCESS_COPY.
 
@@ -1812,7 +5909,7 @@
 
 - Issue #8105: Validate file descriptor passed to mmap.mmap on Windows.
 
-- Issue #8046: Add context manager protocol support and .closed property to mmap
+- Issue #8046: Add context management protocol support and .closed property to mmap
   objects.
 
 Library
@@ -2819,7 +6916,7 @@
 - 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
+- Issue #4972: Add support for the context management protocol to the ftplib.FTP
   class.
 
 - Issue #8664: In py_compile, create __pycache__ when the compiled path is
@@ -3107,7 +7204,7 @@
 - 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
+- Issue #7232: Add support for the context management protocol to the TarFile
   class.
 
 - Issue #7250: Fix info leak of os.environ across multi-run uses of
@@ -5145,7 +9242,7 @@
 - Issue #1696199:  Add collections.Counter() for rapid and convenient
   counting.
 
-- Issue #3860: GzipFile and BZ2File now support the context manager protocol.
+- Issue #3860: GzipFile and BZ2File now support the context management protocol.
 
 - Issue #4867: Fixed a crash in ctypes when passing a string to a
   function without defining argtypes.
@@ -9921,7 +14018,7 @@
 - When method objects have an attribute that can be satisfied either
   by the function object or by the method object, the function
   object's attribute usually wins.  Christian Tismer pointed out that
-  that this is really a mistake, because this only happens for special
+  this is really a mistake, because this only happens for special
   methods (like __reduce__) where the method object's version is
   really more appropriate than the function's attribute.  So from now
   on, all method attributes will have precedence over function
diff --git a/Misc/NEWS b/Misc/NEWS
index 5e1dbf0..976368e 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -1,46 +1,46 @@
-+++++++++++
++++++++++++
 Python News
 +++++++++++
 
-What's New in Python 3.3.7?
-============================
 
-*Release date: XXXX-XX-XX*
+What's New in Python 3.4.3rc1?
+==============================
+
+Release date: TBA
 
 Core and Builtins
 -----------------
 
-- Issue #23055: Fixed a buffer overflow in PyUnicode_FromFormatV.  Analysis
-  and fix by Guido Vranken.
+- Issue #22896: Avoid using PyObject_AsCharBuffer(), PyObject_AsReadBuffer()
+  and PyObject_AsWriteBuffer().
 
-Library
--------
+- Issue #21295: Revert some changes (issue #16795) to AST line numbers and
+  column offsets that constituted a regression.
 
-- Issue #23363: Fix possible overflow in itertools.permutations.
+- Issue #21408: The default __ne__() now returns NotImplemented if __eq__()
+  returned NotImplemented.  Original patch by Martin Panter.
 
-- Issue #23364: Fix possible overflow in itertools.product.
+- Issue #23321: Fixed a crash in str.decode() when error handler returned
+  replacment string longer than mailformed input data.
 
-- Issue #23369: Fixed possible integer overflow in
-  _json.encode_basestring_ascii.
+- Issue #23048: Fix jumping out of an infinite while loop in the pdb.
 
-- Issue #23366: Fixed possible integer overflow in itertools.combinations.
+- Issue #20335: bytes constructor now raises TypeError when encoding or errors
+  is specified with non-string argument.  Based on patch by Renaud Blanch.
 
-- Issue #23365: Fixed possible integer overflow in
-  itertools.combinations_with_replacement.
+- Issue #22335: Fix crash when trying to enlarge a bytearray to 0x7fffffff
+  bytes on a 32-bit platform.
 
-
-What's New in Python 3.3.6?
-===========================
-
-*Release date: 11-Oct-2014*
-
-Core and Builtins
------------------
+- Issue #22653: Fix an assertion failure in debug mode when doing a reentrant
+  dict insertion in debug mode.
 
 - Issue #22643: Fix integer overflow in Unicode case operations (upper, lower,
   title, swapcase, casefold).
 
-- Issue #22518: Fixed integer overflow issues in "backslashreplace",
+- Issue #22604: Fix assertion error in debug mode when dividing a complex
+  number by (nan+0j).
+
+- Issue #22470: Fixed integer overflow issues in "backslashreplace",
   "xmlcharrefreplace", and "surrogatepass" error handlers.
 
 - Issue #22520: Fix overflow checking when generating the repr of a unicode
@@ -56,12 +56,419 @@
 Library
 -------
 
+- Issue #23363: Fix possible overflow in itertools.permutations.
+
+- Issue #23364: Fix possible overflow in itertools.product.
+
+- Issue #23366: Fixed possible integer overflow in itertools.combinations.
+
+- Issue #23366: Fixed possible integer overflow in itertools.combinations.
+
+- Issue #23369: Fixed possible integer overflow in
+  _json.encode_basestring_ascii.
+
+- Issue #23353: Fix the exception handling of generators in
+  PyEval_EvalFrameEx(). At entry, save or swap the exception state even if
+  PyEval_EvalFrameEx() is called with throwflag=0. At exit, the exception state
+  is now always restored or swapped, not only if why is WHY_YIELD or
+  WHY_RETURN. Patch co-written with Antoine Pitrou.
+
+- Issue #18518: timeit now rejects statements which can't be compiled outside
+  a function or a loop (e.g. "return" or "break").
+
+- Issue #23094: Fixed readline with frames in Python implementation of pickle.
+
+- Issue #23268: Fixed bugs in the comparison of ipaddress classes.
+
+- Issue #21408: Removed incorrect implementations of __ne__() which didn't
+  returned NotImplemented if __eq__() returned NotImplemented.  The default
+  __ne__() now works correctly.
+
+- Issue #19996: :class:`email.feedparser.FeedParser` now handles (malformed)
+  headers with no key rather than amusing the body has started.
+
+- Issue #23248: Update ssl error codes from latest OpenSSL git master.
+
+- Issue #23098: 64-bit dev_t is now supported in the os module.
+
+- Issue #23250: In the http.cookies module, capitalize "HttpOnly" and "Secure"
+  as they are written in the standard.
+
+- Issue #23063: In the disutils' check command, fix parsing of reST with code or
+  code-block directives.
+
+- Issue #23209, #23225: selectors.BaseSelector.close() now clears its internal
+  reference to the selector mapping to break a reference cycle. Initial patch
+  written by Martin Richard.
+
+- Issue #21356: Make ssl.RAND_egd() optional to support LibreSSL. The
+  availability of the function is checked during the compilation. Patch written
+  by Bernard Spil.
+
+- Issue #20896, #22935: The :func:`ssl.get_server_certificate` function now
+  uses the :data:`~ssl.PROTOCOL_SSLv23` protocol by default, not
+  :data:`~ssl.PROTOCOL_SSLv3`, for maximum compatibility and support platforms
+  where :data:`~ssl.PROTOCOL_SSLv3` support is disabled.
+
+- Issue #23111: In the ftplib, make ssl.PROTOCOL_SSLv23 the default protocol
+  version.
+
+- Issue #23132: Mitigate regression in speed and clarity in functools.total_ordering.
+
+- Issue #22585: On OpenBSD 5.6 and newer, os.urandom() now calls getentropy(),
+  instead of reading /dev/urandom, to get pseudo-random bytes.
+
+- Issue #23112: Fix SimpleHTTPServer to correctly carry the query string and
+  fragment when it redirects to add a trailing slash.
+
+- Issue #23093: In the io, module allow more operations to work on detached
+  streams.
+
+- Issue #19104: pprint now produces evaluable output for wrapped strings.
+
+- Issue #23071: Added missing names to codecs.__all__.  Patch by Martin Panter.
+
+- Issue #15513: Added a __sizeof__ implementation for pickle classes.
+
+- Issue #19858: pickletools.optimize() now aware of the MEMOIZE opcode, can
+  produce more compact result and no longer produces invalid output if input
+  data contains MEMOIZE opcodes together with PUT or BINPUT opcodes.
+
+- Issue #22095: Fixed HTTPConnection.set_tunnel with default port.  The port
+  value in the host header was set to "None".  Patch by Demian Brecht.
+
+- Issue #23016: A warning no longer produces an AttributeError when the program
+  is run with pythonw.exe.
+
+- Issue #21775: shutil.copytree(): fix crash when copying to VFAT. An exception
+  handler assumed that that OSError objects always have a 'winerror' attribute.
+  That is not the case, so the exception handler itself raised AttributeError
+  when run on Linux (and, presumably, any other non-Windows OS).
+  Patch by Greg Ward.
+
+- Issue #1218234: Fix inspect.getsource() to load updated source of
+  reloaded module. Initial patch by Berker Peksag.
+
+- Issue #22959: In the constructor of http.client.HTTPSConnection, prefer the
+  context's check_hostname attribute over the *check_hostname* parameter.
+
 - Issue #16043: Add a default limit for the amount of data xmlrpclib.gzip_decode
   will return. This resolves CVE-2013-1753.
 
+- Issue #22966: Fix __pycache__ pyc file name clobber when pyc_compile is
+  asked to compile a source file containing multiple dots in the source file
+  name.
+
+- Issue #21971: Update turtledemo doc and add module to the index.
+
+- Issue #21032. Fixed socket leak if HTTPConnection.getresponse() fails.
+  Original patch by Martin Panter.
+
+- Issue #22960: Add a context argument to xmlrpclib.ServerProxy constructor.
+
+- Issue #22915: SAX parser now supports files opened with file descriptor or
+  bytes path.
+
+- Issue #22609: Constructors and update methods of mapping classes in the
+  collections module now accept the self keyword argument.
+
+- Issue #22788: Add *context* parameter to logging.handlers.HTTPHandler.
+
+- Issue #22921: Allow SSLContext to take the *hostname* parameter even if
+  OpenSSL doesn't support SNI.
+
+- Issue #22894: TestCase.subTest() would cause the test suite to be stopped
+  when in failfast mode, even in the absence of failures.
+
+- Issue #22638: SSLv3 is now disabled throughout the standard library.
+  It can still be enabled by instantiating a SSLContext manually.
+
+- Issue #22370: Windows detection in pathlib is now more robust.
+
+- Issue #22841: Reject coroutines in asyncio add_signal_handler().
+  Patch by Ludovic.Gasc.
+
+- Issue #22849: Fix possible double free in the io.TextIOWrapper constructor.
+
+- Issue #12728: Different Unicode characters having the same uppercase but
+  different lowercase are now matched in case-insensitive regular expressions.
+
+- Issue #22821: Fixed fcntl() with integer argument on 64-bit big-endian
+  platforms.
+
+- Issue #22406: Fixed the uu_codec codec incorrectly ported to 3.x.
+  Based on patch by Martin Panter.
+
+- Issue #17293: uuid.getnode() now determines MAC address on AIX using netstat.
+  Based on patch by Aivars Kalvāns.
+
+- Issue #22769: Fixed ttk.Treeview.tag_has() when called without arguments.
+
+- Issue #22417: Verify certificates by default in httplib (PEP 476).
+
+- Issue #22775: Fixed unpickling of http.cookies.SimpleCookie with protocol 2
+  and above.  Patch by Tim Graham.
+
+- Issue #22366: urllib.request.urlopen will accept a context object
+  (SSLContext) as an argument which will then used be for HTTPS connection.
+  Patch by Alex Gaynor.
+
+- Issue #22776: Brought excluded code into the scope of a try block in
+  SysLogHandler.emit().
+
+- Issue #22665: Add missing get_terminal_size and SameFileError to
+  shutil.__all__.
+
+- Issue #17381: Fixed handling of case-insensitive ranges in regular
+  expressions.
+
+- Issue #22410: Module level functions in the re module now cache compiled
+  locale-dependent regular expressions taking into account the locale.
+
+- Issue #22759: Query methods on pathlib.Path() (exists(), is_dir(), etc.)
+  now return False when the underlying stat call raises NotADirectoryError.
+
+- Issue #8876: distutils now falls back to copying files when hard linking
+  doesn't work.  This allows use with special filesystems such as VirtualBox
+  shared folders.
+
+- Issue #18853: Fixed ResourceWarning in shlex.__nain__.
+
+- Issue #9351: Defaults set with set_defaults on an argparse subparser
+  are no longer ignored when also set on the parent parser.
+
+- Issue #21991: Make email.headerregistry's header 'params' attributes
+  be read-only (MappingProxyType).  Previously the dictionary was modifiable
+  but a new one was created on each access of the attribute.
+
+- Issue #22641: In asyncio, the default SSL context for client connections
+  is now created using ssl.create_default_context(), for stronger security.
+
+- Issue #22435: Fix a file descriptor leak when SocketServer bind fails.
+
+- Issue #13096: Fixed segfault in CTypes POINTER handling of large
+  values.
+
+- Issue #11694: Raise ConversionError in xdrlib as documented.  Patch
+  by Filip Gruszczyński and Claudiu Popa.
+
+- Issue #22462: Fix pyexpat's creation of a dummy frame to make it
+  appear in exception tracebacks.
+
+- Issue #21173: Fix len() on a WeakKeyDictionary when .clear() was called
+  with an iterator alive.
+
+- Issue #11866: Eliminated race condition in the computation of names
+  for new threads.
+
+- Issue #21905: Avoid RuntimeError in pickle.whichmodule() when sys.modules
+  is mutated while iterating.  Patch by Olivier Grisel.
+
+- Issue #22219: The zipfile module CLI now adds entries for directories
+  (including empty directories) in ZIP file.
+
+- Issue #22449: In the ssl.SSLContext.load_default_certs, consult the
+  enviromental variables SSL_CERT_DIR and SSL_CERT_FILE on Windows.
+
+- Issue #20076: Added non derived UTF-8 aliases to locale aliases table.
+
+- Issue #20079: Added locales supported in glibc 2.18 to locale alias table.
+
+- Issue #22396: On 32-bit AIX platform, don't expose os.posix_fadvise() nor
+  os.posix_fallocate() because their prototypes in system headers are wrong.
+
 - Issue #22517: When a io.BufferedRWPair object is deallocated, clear its
   weakrefs.
 
+- Issue #22448: Improve canceled timer handles cleanup to prevent
+  unbound memory usage. Patch by Joshua Moore-Oliva.
+
+- Issue #23009: Make sure selectors.EpollSelecrtor.select() works when no
+  FD is registered.
+
+IDLE
+----
+
+- Issue #20577: Configuration of the max line length for the FormatParagraph
+  extension has been moved from the General tab of the Idle preferences dialog
+  to the FormatParagraph tab of the Config Extensions dialog.
+  Patch by Tal Einat.
+
+- Issue #16893: Update Idle doc chapter to match current Idle and add new
+  information.
+
+- Issue #3068: Add Idle extension configuration dialog to Options menu.
+  Changes are written to HOME/.idlerc/config-extensions.cfg.
+  Original patch by Tal Einat.
+
+- Issue #16233: A module browser (File : Class Browser, Alt+C) requires a
+  editor window with a filename.  When Class Browser is requested otherwise,
+  from a shell, output window, or 'Untitled' editor, Idle no longer displays
+  an error box.  It now pops up an  Open Module box (Alt+M). If a valid name
+  is entered and a module is opened, a corresponding browser is also opened.
+
+- Issue #4832: Save As to type Python files automatically adds .py to the
+  name you enter (even if your system does not display it).  Some systems
+  automatically add .txt when type is Text files.
+
+- Issue #21986: Code objects are not normally pickled by the pickle module.
+  To match this, they are no longer pickled when running under Idle.
+
+- Issue #23180: Rename IDLE "Windows" menu item to "Window".
+  Patch by Al Sweigart.
+
+Tests
+-----
+
+- Issue #19548: Added some additional checks to test_codecs to ensure that
+  statements in the updated documentation remain accurate. Patch by Martin
+  Panter.
+
+- Issue #22838: All test_re tests now work with unittest test discovery.
+
+- Issue #22173: Update lib2to3 tests to use unittest test discovery.
+
+- Issue #16000: Convert test_curses to use unittest.
+
+- Issue #21456: Skip two tests in test_urllib2net.py if _ssl module not
+  present. Patch by Remi Pointel.
+
+- Issue #22770: Prevent some Tk segfaults on OS X when running gui tests.
+
+- Issue #23211: Workaround test_logging failure on some OS X 10.6 systems.
+
+Build
+-----
+
+- Issue #15506: Use standard PKG_PROG_PKG_CONFIG autoconf macro in the configure
+  script.
+
+- Issue #22935: Allow the ssl module to be compiled if openssl doesn't support
+  SSL 3.
+
+- Issue #16537: Check whether self.extensions is empty in setup.py. Patch by
+  Jonathan Hosmer.
+
+- Issue #18096: Fix library order returned by python-config.
+
+- Issue #17219: Add library build dir for Python extension cross-builds.
+
+- Issue #17128: Use private version of OpenSSL for 2.7.9 OS X 10.5+ installer.
+
+C API
+-----
+
+- Issue #22079: PyType_Ready() now checks that statically allocated type has
+  no dynamically allocated bases.
+
+Documentation
+-------------
+
+- Issue #19548: Update the codecs module documentation to better cover the
+  distinction between text encodings and other codecs, together with other
+  clarifications. Patch by Martin Panter.
+
+- Issue #22914: Update the Python 2/3 porting HOWTO to describe a more automated
+  approach.
+
+- Issue #21514: The documentation of the json module now refers to new JSON RFC
+  7159 instead of obsoleted RFC 4627.
+
+Tools/Demos
+-----------
+
+- Issue #22314: pydoc now works when the LINES environment variable is set.
+
+Windows
+-------
+
+- Issue #17896: The Windows build scripts now expect external library sources
+  to be in ``PCbuild\..\externals`` rather than ``PCbuild\..\..``.
+
+- Issue #17717: The Windows build scripts now use a copy of NASM pulled from
+  svn.python.org to build OpenSSL.
+
+- Issue #22644: The bundled version of OpenSSL has been updated to 1.0.1j.
+
+What's New in Python 3.4.2?
+===========================
+
+Release date: 2014-10-06
+
+Core and Builtins
+-----------------
+
+Library
+-------
+
+- Issue #10510: distutils register and upload methods now use HTML standards
+  compliant CRLF line endings.
+
+- Issue #9850: Fixed macpath.join() for empty first component.  Patch by
+  Oleg Oshmyan.
+
+- Issue #22427: TemporaryDirectory no longer attempts to clean up twice when
+  used in the with statement in generator.
+
+- Issue #20912: Now directories added to ZIP file have correct Unix and MS-DOS
+  directory attributes.
+
+- Issue #21866: ZipFile.close() no longer writes ZIP64 central directory
+  records if allowZip64 is false.
+
+- Issue #22415: Fixed debugging output of the GROUPREF_EXISTS opcode in the re
+  module.  Removed trailing spaces in debugging output.
+
+- Issue #22423: Unhandled exception in thread no longer causes unhandled
+  AttributeError when sys.stderr is None.
+
+- Issue #21332: Ensure that ``bufsize=1`` in subprocess.Popen() selects
+  line buffering, rather than block buffering.  Patch by Akira Li.
+
+
+What's New in Python 3.4.2rc1?
+==============================
+
+Release date: 2014-09-22
+
+Core and Builtins
+-----------------
+
+- Issue #22258: Fix the the internal function set_inheritable() on Illumos.
+  This platform exposes the function ``ioctl(FIOCLEX)``, but calling it fails
+  with errno is ENOTTY: "Inappropriate ioctl for device". set_inheritable()
+  now falls back to the slower ``fcntl()`` (``F_GETFD`` and then ``F_SETFD``).
+
+- Issue #21669: With the aid of heuristics in SyntaxError.__init__, the
+  parser now attempts to generate more meaningful (or at least more search
+  engine friendly) error messages when "exec" and "print" are used as
+  statements.
+
+- Issue #21642: If the conditional if-else expression, allow an integer written
+  with no space between itself and the ``else`` keyword (e.g. ``True if 42else
+  False``) to be valid syntax.
+
+- Issue #21523: Fix over-pessimistic computation of the stack effect of
+  some opcodes in the compiler.  This also fixes a quadratic compilation
+  time issue noticeable when compiling code with a large number of "and"
+  and "or" operators.
+
+Library
+-------
+
+- Issue #21091: Fix API bug: email.message.EmailMessage.is_attachment is now
+  a method.  Since EmailMessage is provisional, we can change the API in a
+  maintenance release, but we use a trick to remain backward compatible with
+  3.4.0/1.
+
+- Issue #21079: Fix email.message.EmailMessage.is_attachment to return the
+  correct result when the header has parameters as well as a value.
+
+- Issue #22247: Add NNTPError to nntplib.__all__.
+
+- Issue #4180: The warnings registries are now reset when the filters
+  are modified.
+
 - Issue #22419: Limit the length of incoming HTTP request in wsgiref server to
   65536 bytes and send a 414 error code for higher lengths. Patch contributed
   by Devin Cook.
@@ -70,19 +477,605 @@
   with non-standard cookie handling in some Web browsers.  Reported by
   Sergey Bobrov.
 
+- Issue #22384: An exception in Tkinter callback no longer crashes the program
+  when it is run with pythonw.exe.
+
+- Issue #22168: Prevent turtle AttributeError with non-default Canvas on OS X.
+
+- Issue #21147: sqlite3 now raises an exception if the request contains a null
+  character instead of truncate it.  Based on patch by Victor Stinner.
+
+- Issue #21951: Fixed a crash in Tkinter on AIX when called Tcl command with
+  empty string or tuple argument.
+
+- Issue #21951: Tkinter now most likely raises MemoryError instead of crash
+  if the memory allocation fails.
+
+- Issue #22338: Fix a crash in the json module on memory allocation failure.
+
+- Issue #22226: First letter no longer is stripped from the "status" key in
+  the result of Treeview.heading().
+
+- Issue #19524: Fixed resource leak in the HTTP connection when an invalid
+  response is received.  Patch by Martin Panter.
+
+- Issue #22051: turtledemo no longer reloads examples to re-run them.
+  Initialization of variables and gui setup should be done in main(),
+  which is called each time a demo is run, but not on import.
+
+- Issue #21933: Turtledemo users can change the code font size with a menu
+  selection or control(command) '-' or '+' or control-mousewheel.
+  Original patch by Lita Cho.
+
+- Issue #21597: The separator between the turtledemo text pane and the drawing
+  canvas can now be grabbed and dragged with a mouse.  The code text pane can
+  be widened to easily view or copy the full width of the text.  The canvas
+  can be widened on small screens.  Original patches by Jan Kanis and Lita Cho.
+
+- Issue #18132: Turtledemo buttons no longer disappear when the window is
+  shrunk.  Original patches by Jan Kanis and Lita Cho.
+
+- Issue #22216: smtplib now resets its state more completely after a quit.  The
+  most obvious consequence of the previous behavior was a STARTTLS failure
+  during a connect/starttls/quit/connect/starttls sequence.
+
+- Issue #22185: Fix an occasional RuntimeError in threading.Condition.wait()
+  caused by mutation of the waiters queue without holding the lock.  Patch
+  by Doug Zongker.
+
+- Issue #22182: Use e.args to unpack exceptions correctly in
+  distutils.file_util.move_file. Patch by Claudiu Popa.
+
+- The webbrowser module now uses subprocess's start_new_session=True rather
+  than a potentially risky preexec_fn=os.setsid call.
+
+- Issue #22236: Fixed Tkinter images copying operations in NoDefaultRoot mode.
+
+- Issue #22191: Fix warnings.__all__.
+
+- Issue #15696: Add a __sizeof__ implementation for mmap objects on Windows.
+
+- Issue #22068: Avoided reference loops with Variables and Fonts in Tkinter.
+
+- Issue #22165: SimpleHTTPRequestHandler now supports undecodable file names.
+
+- Issue #8797: Raise HTTPError on failed Basic Authentication immediately.
+  Initial patch by Sam Bull.
+
+- Issue #20729: Restored the use of lazy iterkeys()/itervalues()/iteritems()
+  in the mailbox module.
+
+- Issue #21448: Changed FeedParser feed() to avoid O(N**2) behavior when
+  parsing long line.  Original patch by Raymond Hettinger.
+
+- Issue #22184:  The functools LRU Cache decorator factory now gives an earlier
+  and clearer error message when the user forgets the required parameters.
+
+- Issue #17923: glob() patterns ending with a slash no longer match non-dirs on
+  AIX.  Based on patch by Delhallt.
+
+- Issue #21121: Don't force 3rd party C extensions to be built with
+  -Werror=declaration-after-statement.
+
+- Issue #21975: Fixed crash when using uninitialized sqlite3.Row (in particular
+  when unpickling pickled sqlite3.Row).  sqlite3.Row is now initialized in the
+  __new__() method.
+
+- Issue #21580: Now Tkinter correctly handles bytes arguments passed to Tk.
+  In particular this allows to initialize images from binary data.
+
+- Issue #17172: Make turtledemo start as active on OS X even when run with
+  subprocess.  Patch by Lita Cho.
+
+- Issue #21704: Fix build error for _multiprocessing when semaphores
+  are not available.  Patch by Arfrever Frehtes Taifersar Arahesis.
+
+- Fix repr(_socket.socket) on Windows 64-bit: don't fail with OverflowError
+  on closed socket. repr(socket.socket) already works fine.
+
+- Issue #16133: The asynchat.async_chat.handle_read() method now ignores
+  BlockingIOError exceptions.
+
+- Issue #22044: Fixed premature DECREF in call_tzinfo_method.
+  Patch by Tom Flanagan.
+
+- Issue #19884: readline: Disable the meta modifier key if stdout is not
+  a terminal to not write the ANSI sequence "\033[1034h" into stdout. This
+  sequence is used on some terminal (ex: TERM=xterm-256color") to enable
+  support of 8 bit characters.
+
+- Issue #21888: plistlib's load() and loads() now work if the fmt parameter is
+  specified.
+
+- Issue #21044: tarfile.open() now handles fileobj with an integer 'name'
+  attribute.  Based on patch by Antoine Pietri.
+
+- Issue #21867:  Prevent turtle crash due to invalid undo buffer size.
+
+- Issue #19076: Don't pass the redundant 'file' argument to self.error().
+
+- Issue #21942: Fixed source file viewing in pydoc's server mode on Windows.
+
+- Issue #11259: asynchat.async_chat().set_terminator() now raises a ValueError
+  if the number of received bytes is negative.
+
+- Issue #12523: asynchat.async_chat.push() now raises a TypeError if it doesn't
+  get a bytes string
+
+- Issue #21707: Add missing kwonlyargcount argument to
+  ModuleFinder.replace_paths_in_code().
+
+- Issue #20639: calling Path.with_suffix('') allows removing the suffix
+  again.  Patch by July Tikhonov.
+
+- Issue #21714: Disallow the construction of invalid paths using
+  Path.with_name().  Original patch by Antony Lee.
+
+- Issue #21897: Fix a crash with the f_locals attribute with closure
+  variables when frame.clear() has been called.
+
+- Issue #21151: Fixed a segfault in the winreg module when ``None`` is passed
+  as a ``REG_BINARY`` value to SetValueEx.  Patch by John Ehresman.
+
+- Issue #21090: io.FileIO.readall() does not ignore I/O errors anymore. Before,
+  it ignored I/O errors if at least the first C call read() succeed.
+
+- Issue #21781: ssl.RAND_add() now supports strings longer than 2 GB.
+
+- Issue #11453: asyncore: emit a ResourceWarning when an unclosed file_wrapper
+  object is destroyed. The destructor now closes the file if needed. The
+  close() method can now be called twice: the second call does nothing.
+
+- Issue #21858: Better handling of Python exceptions in the sqlite3 module.
+
+- Issue #21476: Make sure the email.parser.BytesParser TextIOWrapper is
+  discarded after parsing, so the input file isn't unexpectedly closed.
+
+- Issue #21729: Used the "with" statement in the dbm.dumb module to ensure
+  files closing.  Patch by Claudiu Popa.
+
+- Issue #21491: socketserver: Fix a race condition in child processes reaping.
+
+- Issue #21832:  Require named tuple inputs to be exact strings.
+
+- Issue #19145:  The times argument for itertools.repeat now handles
+  negative values the same way for keyword arguments as it does for
+  positional arguments.
+
+- Issue #21812: turtle.shapetransform did not tranform the turtle on the
+  first call.  (Issue identified and fixed by Lita Cho.)
+
+- Issue #21635:  The difflib SequenceMatcher.get_matching_blocks() method
+  cache didn't match the actual result.  The former was a list of tuples
+  and the latter was a list of named tuples.
+
+- Issue #21722: The distutils "upload" command now exits with a non-zero
+  return code when uploading fails.  Patch by Martin Dengler.
+
+- Issue #21723: asyncio.Queue: support any type of number (ex: float) for the
+  maximum size. Patch written by Vajrasky Kok.
+
+- Issue #21326: Add a new is_closed() method to asyncio.BaseEventLoop.
+  run_forever() and run_until_complete() methods of asyncio.BaseEventLoop now
+  raise an exception if the event loop was closed.
+
+- Issue #21774: Fixed NameError for an incorrect variable reference in the
+  XML Minidom code for creating processing instructions.
+  (Found and fixed by Claudiu Popa.)
+
 - Issue #21766: Prevent a security hole in CGIHTTPServer by URL unquoting paths
   before checking for a CGI script at that path.
 
+- Issue #21310: Fixed possible resource leak in failed open().
+
+- Issue #21677: Fixed chaining nonnormalized exceptions in io close() methods.
+
+- Issue #11709: Fix the pydoc.help function to not fail when sys.stdin is not a
+  valid file.
+
+- Issue #13223: Fix pydoc.writedoc so that the HTML documentation for methods
+  that use 'self' in the example code is generated correctly.
+
+- Issue #21463: In urllib.request, fix pruning of the FTP cache.
+
+- Issue #21618: The subprocess module could fail to close open fds that were
+  inherited by the calling process and already higher than POSIX resource
+  limits would otherwise allow.  On systems with a functioning /proc/self/fd
+  or /dev/fd interface the max is now ignored and all fds are closed.
+
+- Issue #21552: Fixed possible integer overflow of too long string lengths in
+  the tkinter module on 64-bit platforms.
+
+- Issue #14315: The zipfile module now ignores extra fields in the central
+  directory that are too short to be parsed instead of letting a struct.unpack
+  error bubble up as this "bad data" appears in many real world zip files in
+  the wild and is ignored by other zip tools.
+
+- Issue #21402: tkinter.ttk now works when default root window is not set.
+
+- Issue #10203: sqlite3.Row now truly supports sequence protocol.  In particulr
+  it supports reverse() and negative indices.  Original patch by Claudiu Popa.
+
+- Issue #18807: If copying (no symlinks) specified for a venv, then the python
+  interpreter aliases (python, python3) are now created by copying rather than
+  symlinking.
+
+- Issue #14710: pkgutil.get_loader() no longer raises an exception when None is
+  found in sys.modules.
+
+- Issue #14710: pkgutil.find_loader() no longer raises an exception when a
+  module doesn't exist.
+
+- Issue #21481:  Argparse equality and inequality tests now return
+  NotImplemented when comparing to an unknown type.
+
+- Issue #8743: Fix interoperability between set objects and the
+  collections.Set() abstract base class.
+
+- Issue #13355: random.triangular() no longer fails with a ZeroDivisionError
+  when low equals high.
+
+- Issue #21538: The plistlib module now supports loading of binary plist files
+  when reference or offset size is not a power of two.
+
+- Issue #21801: Validate that __signature__ is None or an instance of Signature.
+
+- Issue #21923: Prevent AttributeError in distutils.sysconfig.customize_compiler
+  due to possible uninitialized _config_vars.
+
+- Issue #21323: Fix http.server to again handle scripts in CGI subdirectories,
+  broken by the fix for security issue #19435.  Patch by Zach Byrne.
+
+Extension Modules
+-----------------
+
+- Issue #22176: Update the ctypes module's libffi to v3.1.  This release
+  adds support for the Linux AArch64 and POWERPC ELF ABIv2 little endian
+  architectures.
+
+Build
+-----
+
+- Issue #15661: python.org OS X installers are now distributed as signed
+  installer packages compatible with the Gatekeeper security feature.
+
+- Issue #21958: Define HAVE_ROUND when building with Visual Studio 2013 and
+  above.  Patch by Zachary Turner.
+
+- Issue #15759: "make suspicious", "make linkcheck" and "make doctest" in Doc/
+  now display special message when and only when there are failures.
+
+- Issue #17095: Fix Modules/Setup *shared* support.
+
+- Issue #21811: Anticipated fixes to support OS X versions > 10.9.
+
+- Issue #21166: Prevent possible segfaults and other random failures of
+  python --generate-posix-vars in pybuilddir.txt build target.
+
+IDLE
+----
+
+- Issue #17390: Adjust Editor window title; remove 'Python',
+  move version to end.
+
+- Issue #14105: Idle debugger breakpoints no longer disappear
+  when inseting or deleting lines.
+
+- Issue #17172: Turtledemo can now be run from Idle.
+  Currently, the entry is on the Help menu, but it may move to Run.
+  Patch by Ramchandra Apt and Lita Cho.
+
+- Issue #21765: Add support for non-ascii identifiers to HyperParser.
+
+- Issue #21940: Add unittest for WidgetRedirector. Initial patch by Saimadhav
+  Heblikar.
+
+- Issue #18592: Add unittest for SearchDialogBase. Patch by Phil Webster.
+
+- Issue #21694: Add unittest for ParenMatch. Patch by Saimadhav Heblikar.
+
+- Issue #21686: add unittest for HyperParser. Original patch by Saimadhav
+  Heblikar.
+
+- Issue #12387: Add missing upper(lower)case versions of default Windows key
+  bindings for Idle so Caps Lock does not disable them. Patch by Roger Serwy.
+
+- Issue #21695: Closing a Find-in-files output window while the search is
+  still in progress no longer closes Idle.
+
+- Issue #18910: Add unittest for textView. Patch by Phil Webster.
+
+- Issue #18292: Add unittest for AutoExpand. Patch by Saihadhav Heblikar.
+
+- Issue #18409: Add unittest for AutoComplete. Patch by Phil Webster.
+
+Tests
+-----
+
+- Issue #22166:  with the assistance of a new internal _codecs._forget_codec
+  helping function, test_codecs now clears the encoding caches to avoid the
+  appearance of a reference leak
+
+- Issue #22236: Tkinter tests now don't reuse default root window.  New root
+  window is created for every test class.
+
+- Issue #20746: Fix test_pdb to run in refleak mode (-R).  Patch by Xavier
+  de Gaye.
+
+- Issue #22060: test_ctypes has been somewhat cleaned up and simplified; it
+  now uses unittest test discovery to find its tests.
+
+- Issue #22104: regrtest.py no longer holds a reference to the suite of tests
+  loaded from test modules that don't define test_main().
+
+- Issue #22002: Added ``load_package_tests`` function to test.support and used
+  it to implement/augment test discovery in test_asyncio, test_email,
+  test_importlib, test_json, and test_tools.
+
+- Issue #21976: Fix test_ssl to accept LibreSSL version strings.  Thanks
+  to William Orr.
+
+- Issue #21918: Converted test_tools from a module to a package containing
+  separate test files for each tested script.
+
+- Issue #20155: Changed HTTP method names in failing tests in test_httpservers
+  so that packet filtering software (specifically Windows Base Filtering Engine)
+  does not interfere with the transaction semantics expected by the tests.
+
+- Issue #19493: Refactored the ctypes test package to skip tests explicitly
+  rather than silently.
+
+- Issue #18492: All resources are now allowed when tests are not run by
+  regrtest.py.
+
+- Issue #21634: Fix pystone micro-benchmark: use floor division instead of true
+  division to benchmark integers instead of floating point numbers. Set pystone
+  version to 1.2. Patch written by Lennart Regebro.
+
+- Issue #21605: Added tests for Tkinter images.
+
+- Issue #21493: Added test for ntpath.expanduser().  Original patch by
+  Claudiu Popa.
+
+- Issue #19925: Added tests for the spwd module. Original patch by Vajrasky Kok.
+
+- Issue #21522: Added Tkinter tests for Listbox.itemconfigure(),
+  PanedWindow.paneconfigure(), and Menu.entryconfigure().
+
+Documentation
+-------------
+
+- Issue #21777: The binary sequence methods on bytes and bytearray are now
+  documented explicitly, rather than assuming users will be able to derive
+  the expected behaviour from the behaviour of the corresponding str methods.
+
+Windows
+-------
+
+- Issue #21671, #22160, CVE-2014-0224: The bundled version of OpenSSL has been
+  updated to 1.0.1i.
+
+- Issue #10747: Use versioned labels in the Windows start menu.
+  Patch by Olive Kilburn.
+
+Tools/Demos
+-----------
+
+- Issue #22201: Command-line interface of the zipfile module now correctly
+  extracts ZIP files with directory entries.  Patch by Ryan Wilson.
+
+- Issue #21906: Make Tools/scripts/md5sum.py work in Python 3.
+  Patch by Zachary Ware.
+
+- Issue #21629: Fix Argument Clinic's "--converters" feature.
+
+
+What's New in Python 3.4.1?
+===========================
+
+Release date: 2014-05-18
+
+Core and Builtins
+-----------------
+
+- Issue #21418: Fix a crash in the builtin function super() when called without
+  argument and without current frame (ex: embedded Python).
+
+- Issue #21425: Fix flushing of standard streams in the interactive
+  interpreter.
+
+- Issue #21435: In rare cases, when running finalizers on objects in cyclic
+  trash a bad pointer dereference could occur due to a subtle flaw in
+  internal iteration logic.
+
+Library
+-------
+
+- Issue #10744: Fix PEP 3118 format strings on ctypes objects with a nontrivial
+  shape.
+
+- Issue #20998: Fixed re.fullmatch() of repeated single character pattern
+  with ignore case.  Original patch by Matthew Barnett.
+
+- Issue #21075: fileinput.FileInput now reads bytes from standard stream if
+  binary mode is specified.  Patch by Sam Kimbrel.
+
+- Issue #21396: Fix TextIOWrapper(..., write_through=True) to not force a
+  flush() on the underlying binary stream.  Patch by akira.
+
+- Issue #21470: Do a better job seeding the random number generator by
+  using enough bytes to span the full state space of the Mersenne Twister.
+
+- Issue #21398: Fix an unicode error in the pydoc pager when the documentation
+  contains characters not encodable to the stdout encoding.
+
+Tests
+-----
+
+- Issue #17756: Fix test_code test when run from the installed location.
+
+- Issue #17752: Fix distutils tests when run from the installed location.
+
+IDLE
+----
+
+- Issue #18104: Add idlelib/idle_test/htest.py with a few sample tests to begin
+  consolidating and improving human-validated tests of Idle. Change other files
+  as needed to work with htest.  Running the module as __main__ runs all tests.
+
+
+What's New in Python 3.4.1rc1?
+==============================
+
+Release date: 2014-05-05
+
+Core and Builtins
+-----------------
+
+- Issue #21274: Define PATH_MAX for GNU/Hurd in Python/pythonrun.c.
+
+- Issue #21209: Fix sending tuples to custom generator objects with the yield
+  from syntax.
+
+- Issue #21134: Fix segfault when str is called on an uninitialized
+  UnicodeEncodeError, UnicodeDecodeError, or UnicodeTranslateError object.
+
+- Issue #19537: Fix PyUnicode_DATA() alignment under m68k.  Patch by
+  Andreas Schwab.
+
+- Issue #20929: Add a type cast to avoid shifting a negative number.
+
+- Issue #20731: Properly position in source code files even if they
+  are opened in text mode. Patch by Serhiy Storchaka.
+
+- Issue #20637: Key-sharing now also works for instance dictionaries of
+  subclasses.  Patch by Peter Ingebretson.
+
+- Issue #12546: Allow \x00 to be used as a fill character when using str, int,
+  float, and complex __format__ methods.
+
+- Issue #13598: Modify string.Formatter to support auto-numbering of
+  replacement fields. It now matches the behavior of str.format() in
+  this regard. Patches by Phil Elson and Ramchandra Apte.
+
+Library
+-------
+
+- Issue #21088: Bugfix for curses.window.addch() regression in 3.4.0.
+  In porting to Argument Clinic, the first two arguments were reversed.
+
+- Issue #21469:  Reduced the risk of false positives in robotparser by
+  checking to make sure that robots.txt has been read or does not exist
+  prior to returning True in can_fetch().
+
+- Issue #21321: itertools.islice() now releases the reference to the source
+  iterator when the slice is exhausted.  Patch by Anton Afanasyev.
+
+- Issue #9815: assertRaises now tries to clear references to local variables
+  in the exception's traceback.
+
+- Issue #13204: Calling sys.flags.__new__ would crash the interpreter,
+  now it raises a TypeError.
+
+- Issue #19385: Make operations on a closed dbm.dumb database always raise the
+  same exception.
+
+- Issue #21207: Detect when the os.urandom cached fd has been closed or
+  replaced, and open it anew.
+
+- Issue #21291: subprocess's Popen.wait() is now thread safe so that
+  multiple threads may be calling wait() or poll() on a Popen instance
+  at the same time without losing the Popen.returncode value.
+
+- Issue #21127: Path objects can now be instantiated from str subclass
+  instances (such as ``numpy.str_``).
+
+- Issue #15002: urllib.response object to use _TemporaryFileWrapper (and
+  _TemporaryFileCloser) facility. Provides a better way to handle file
+  descriptor close. Patch contributed by Christian Theune.
+
+- Issue #12220: mindom now raises a custom ValueError indicating it doesn't
+  support spaces in URIs instead of letting a 'split' ValueError bubble up.
+
+- Issue #21239: patch.stopall() didn't work deterministically when the same
+  name was patched more than once.
+
+- Issue #21222: Passing name keyword argument to mock.create_autospec now
+  works.
+
+- Issue #21197: Add lib64 -> lib symlink in venvs on 64-bit non-OS X POSIX.
+
+- Issue #17498: Some SMTP servers disconnect after certain errors, violating
+  strict RFC conformance.  Instead of losing the error code when we issue the
+  subsequent RSET, smtplib now returns the error code and defers raising the
+  SMTPServerDisconnected error until the next command is issued.
+
+- Issue #17826: setting an iterable side_effect on a mock function created by
+  create_autospec now works. Patch by Kushal Das.
+
+- Issue #7776: Fix ``Host:`` header and reconnection when using
+  http.client.HTTPConnection.set_tunnel(). Patch by Nikolaus Rath.
+
+- Issue #20968: unittest.mock.MagicMock now supports division.
+  Patch by Johannes Baiter.
+
 - Fix arbitrary memory access in JSONDecoder.raw_decode with a negative second
   parameter. Bug reported by Guido Vranken.
 
+- Issue #21169: getpass now handles non-ascii characters that the
+  input stream encoding cannot encode by re-encoding using the
+  replace error handler.
+
+- Issue #21171: Fixed undocumented filter API of the rot13 codec.
+  Patch by Berker Peksag.
+
+- Issue #21172: isinstance check relaxed from dict to collections.Mapping.
+
+- Issue #21155: asyncio.EventLoop.create_unix_server() now raises a ValueError
+  if path and sock are specified at the same time.
+
+- Issue #21149: Improved thread-safety in logging cleanup during interpreter
+  shutdown. Thanks to Devin Jeanpierre for the patch.
+
+- Issue #20145: `assertRaisesRegex` and `assertWarnsRegex` now raise a
+  TypeError if the second argument is not a string or compiled regex.
+
+- Issue #21058: Fix a leak of file descriptor in
+  :func:`tempfile.NamedTemporaryFile`, close the file descriptor if
+  :func:`io.open` fails
+
+- Issue #21200: Return None from pkgutil.get_loader() when __spec__ is missing.
+
+- Issue #21013: Enhance ssl.create_default_context() when used for server side
+  sockets to provide better security by default.
+
 - Issue #20633: Replace relative import by absolute import.
 
+- Issue #20980: Stop wrapping exception when using ThreadPool.
+
 - Issue #21082: In os.makedirs, do not set the process-wide umask. Note this
   changes behavior of makedirs when exist_ok=True.
 
-- Issue #20875: Prevent possible gzip "'read' is not defined" NameError.
-  Patch by Claudiu Popa.
+- Issue #20990: Fix issues found by pyflakes for multiprocessing.
+
+- Issue #21015: SSL contexts will now automatically select an elliptic
+  curve for ECDH key exchange on OpenSSL 1.0.2 and later, and otherwise
+  default to "prime256v1".
+
+- Issue #20995: Enhance default ciphers used by the ssl module to enable
+  better security an prioritize perfect forward secrecy.
+
+- Issue #20884: Don't assume that __file__ is defined on importlib.__init__.
+
+- Issue #21499: Ignore __builtins__ in several test_importlib.test_api tests.
+
+- Issue #20879: Delay the initialization of encoding and decoding tables for
+  base32, ascii85 and base85 codecs in the base64 module, and delay the
+  initialization of the unquote_to_bytes() table of the urllib.parse module, to
+  not waste memory if these modules are not used.
+
+- Issue #19157: Include the broadcast address in the usuable hosts for IPv6
+  in ipaddress.
 
 - Issue #11599: When an external command (e.g. compiler) fails, distutils now
   prints out the whole command line (instead of just the command name) if the
@@ -91,60 +1084,311 @@
 - Issue #4931: distutils should not produce unhelpful "error: None" messages
   anymore.  distutils.util.grok_environment_error is kept but doc-deprecated.
 
+- Issue #20875: Prevent possible gzip "'read' is not defined" NameError.
+  Patch by Claudiu Popa.
+
+- Issue #11558: ``email.message.Message.attach`` now returns a more
+  useful error message if ``attach`` is called on a message for which
+  ``is_multipart`` is False.
+
 - Issue #20283: RE pattern methods now accept the string keyword parameters
   as documented.  The pattern and source keyword parameters are left as
   deprecated aliases.
 
-- Issue #21323: Fix http.server to again handle scripts in CGI subdirectories,
-  broken by the fix for security issue #19435.  Patch by Zach Byrne.
-
-Tests
------
-
-- Issue #17752: Fix distutils tests when run from the installed location.
-
-- Issue #20946: Correct alignment assumptions of some ctypes tests.
-
-- Issue #20939: Fix test_geturl failure in test_urllibnet due to
-  new redirect of http://www.python.org/ to https://www.python.org.
-
-
-What's New in Python 3.3.5?
-===========================
-
-*Release date: 09-Mar-2014*
-
-No changes from release candidate 2.
-
-
-What's New in Python 3.3.5 release candidate 2?
-===============================================
-
-*Release date: 02-Mar-2014*
-
-Core and Builtins
------------------
-
-- Issue #20731: Properly position in source code files even if they
-  are opened in text mode. Patch by Serhiy Storchaka.
-
-- Issue #19619: str.encode, bytes.decode and bytearray.decode now use an
-  internal API to throw LookupError for known non-text encodings, rather
-  than attempting the encoding or decoding operation and then throwing a
-  TypeError for an unexpected output type. (The latter mechanism remains
-  in place for third party non-text encodings)
-
-Library
--------
-
 - Issue #20778: Fix modulefinder to work with bytecode-only modules.
 
 - Issue #20791: copy.copy() now doesn't make a copy when the input is
   a bytes object.  Initial patch by Peter Otten.
 
-- Issue #20621: Fixes a zipimport bug introduced in 3.3.4 that could cause
-  spurious crashes or SystemErrors when importing modules or packages from a
-  zip file.  The change causing the problem was reverted.
+- Issue #19748: On AIX, time.mktime() now raises an OverflowError for year
+  outsize range [1902; 2037].
+
+- Issue #20816: Fix inspect.getcallargs() to raise correct TypeError for
+  missing keyword-only arguments. Patch by Jeremiah Lowin.
+
+- Issue #20817: Fix inspect.getcallargs() to fail correctly if more
+  than 3 arguments are missing. Patch by Jeremiah Lowin.
+
+- Issue #6676: Ensure a meaningful exception is raised when attempting
+  to parse more than one XML document per pyexpat xmlparser instance.
+  (Original patches by Hirokazu Yamamoto and Amaury Forgeot d'Arc, with
+  suggested wording by David Gutteridge)
+
+- Issue #21117: Fix inspect.signature to better support functools.partial.
+  Due to the specifics of functools.partial implementation,
+  positional-or-keyword arguments passed as keyword arguments become
+  keyword-only.
+
+- Issue #21209: Fix asyncio.tasks.CoroWrapper to workaround a bug
+  in yield-from implementation in CPythons prior to 3.4.1.
+
+- asyncio: Add gi_{frame,running,code} properties to CoroWrapper
+  (upstream issue #163).
+
+- Issue #21311: Avoid exception in _osx_support with non-standard compiler
+  configurations.  Patch by John Szakmeister.
+
+- Issue #11571: Ensure that the turtle window becomes the topmost window
+  when launched on OS X.
+
+Extension Modules
+-----------------
+
+- Issue #21276: posixmodule: Don't define USE_XATTRS on KFreeBSD and the Hurd.
+- Issue #21226: Set up modules properly in PyImport_ExecCodeModuleObject
+  (and friends).
+
+IDLE
+----
+
+- Issue #21139: Change default paragraph width to 72, the PEP 8 recommendation.
+
+- Issue #21284: Paragraph reformat test passes after user changes reformat width.
+
+- Issue #17654: Ensure IDLE menus are customized properly on OS X for
+  non-framework builds and for all variants of Tk.
+
+Build
+-----
+
+- The Windows build now includes OpenSSL 1.0.1g
+
+- Issue #21285: Refactor and fix curses configure check to always search
+  in a ncursesw directory.
+
+- Issue #15234: For BerkelyDB and Sqlite, only add the found library and
+  include directories if they aren't already being searched. This avoids
+  an explicit runtime library dependency.
+
+- Issue #20644: OS X installer build support for documentation build changes
+  in 3.4.1: assume externally supplied sphinx-build is available in /usr/bin.
+
+C API
+-----
+
+- Issue #20942: PyImport_ImportFrozenModuleObject() no longer sets __file__ to
+  match what importlib does; this affects _frozen_importlib as well as any
+  module loaded using imp.init_frozen().
+
+Documentation
+-------------
+
+- Issue #17386: Expanded functionality of the ``Doc/make.bat`` script to make
+  it much more comparable to ``Doc/Makefile``.
+
+- Issue #21043: Remove the recommendation for specific CA organizations and to
+  mention the ability to load the OS certificates.
+
+- Issue #20765: Add missing documentation for PurePath.with_name() and
+  PurePath.with_suffix().
+
+- Issue #19407: New package installation and distribution guides based on
+  the Python Packaging Authority tools. Existing guides have been retained
+  as legacy links from the distutils docs, as they still contain some
+  required reference material for tool developers that isn't recorded
+  anywhere else.
+
+- Issue #19697: Document cases where __main__.__spec__ is None.
+
+Tests
+-----
+
+- Issue #18604: Consolidated checks for GUI availability.  All platforms now
+  at least check whether Tk can be instantiated when the GUI resource is
+  requested.
+
+- Issue #21275: Fix a socket test on KFreeBSD.
+
+- Issue #21223: Pass test_site/test_startup_imports when some of the extensions
+  are built as builtins.
+
+- Issue #20635: Added tests for Tk geometry managers.
+
+- Add test case for freeze.
+
+- Issue #20743: Fix a reference leak in test_tcl.
+
+- Issue #21097: Move test_namespace_pkgs into test_importlib.
+
+- Issue #20939: Avoid various network test failures due to new
+  redirect of http://www.python.org/ to https://www.python.org:
+  use http://www.example.com instead.
+
+- Issue #20668: asyncio tests no longer rely on tests.txt file.
+  (Patch by Vajrasky Kok)
+
+- Issue #21093: Prevent failures of ctypes test_macholib on OS X if a
+  copy of libz exists in $HOME/lib or /usr/local/lib.
+
+Tools/Demos
+-----------
+
+- Add support for ``yield from`` to 2to3.
+
+- Add support for the PEP 465 matrix multiplication operator to 2to3.
+
+- Issue #16047: Fix module exception list and __file__ handling in freeze.
+  Patch by Meador Inge.
+
+- Issue #11824: Consider ABI tags in freeze. Patch by Meador Inge.
+
+- Issue #20535: PYTHONWARNING no longer affects the run_tests.py script.
+  Patch by Arfrever Frehtes Taifersar Arahesis.
+
+
+What's New in Python 3.4.0?
+===========================
+
+Release date: 2014-03-16
+
+Library
+-------
+
+- Issue #20939: Fix test_geturl failure in test_urllibnet due to
+  new redirect of http://www.python.org/ to https://www.python.org.
+
+Documentation
+-------------
+
+- Merge in all documentation changes since branching 3.4.0rc1.
+
+
+What's New in Python 3.4.0 release candidate 3?
+===============================================
+
+Release date: 2014-03-09
+
+Core and Builtins
+-----------------
+
+- Issue #20786: Fix signatures for dict.__delitem__ and
+  property.__delete__ builtins.
+
+Library
+-------
+
+- Issue #20839: Don't trigger a DeprecationWarning in the still supported
+  pkgutil.get_loader() API when __loader__ isn't set on a module (nor
+  when pkgutil.find_loader() is called directly).
+
+Build
+-----
+
+- Issue #14512: Launch pydoc -b instead of pydocgui.pyw on Windows.
+
+- Issue #20748: Uninstalling pip does not leave behind the pyc of
+  the uninstaller anymore.
+
+- Issue #20568: The Windows installer now installs the unversioned ``pip``
+  command in addition to the versioned ``pip3`` and ``pip3.4`` commands.
+
+- Issue #20757: The ensurepip helper for the Windows uninstaller now skips
+  uninstalling pip (rather than failing) if the user has updated pip to a
+  different version from the one bundled with ensurepip.
+
+- Issue #20465: Update OS X and Windows installer builds to use
+  SQLite 3.8.3.1.
+
+
+What's New in Python 3.4.0 release candidate 2?
+===============================================
+
+Release date: 2014-02-23
+
+Core and Builtins
+-----------------
+
+- Issue #20625: Parameter names in __annotations__ were not mangled properly.
+  Discovered by Jonas Wielicki, patch by Yury Selivanov.
+
+- Issue #20261: In pickle, lookup __getnewargs__ and __getnewargs_ex__ on the
+  type of the object.
+
+- Issue #20619: Give the AST nodes of keyword-only arguments a column and line
+  number.
+
+- Issue #20526: Revert changes of issue #19466 which introduces a regression:
+  don't clear anymore the state of Python threads early during the Python
+  shutdown.
+
+Library
+-------
+
+- Issue #20710: The pydoc summary line no longer displays the "self" parameter
+  for bound methods.
+
+- Issue #20566: Change asyncio.as_completed() to use a Queue, to
+  avoid O(N**2) behavior.
+
+- Issue #20704: Implement new debug API in asyncio. Add new methods
+  BaseEventLoop.set_debug() and BaseEventLoop.get_debug().
+  Add support for setting 'asyncio.tasks._DEBUG' variable with
+  'PYTHONASYNCIODEBUG' environment variable.
+
+- asyncio: Refactoring and fixes: BaseEventLoop.sock_connect() raises an
+  error if the address is not resolved; use __slots__ in Handle and
+  TimerHandle; as_completed() and wait() raise TypeError if the passed
+  list of Futures is a single Future; call_soon() and other 'call_*()'
+  functions raise TypeError if the passed callback is a coroutine
+  function; _ProactorBasePipeTransport uses _FlowControlMixin;
+  WriteTransport.set_write_buffer_size() calls _maybe_pause_protocol()
+  to consider pausing receiving if the watermark limits have changed;
+  fix _check_resolved_address() for IPv6 address; and other minor
+  improvements, along with multiple documentation updates.
+
+- Issue #20684: Fix inspect.getfullargspec() to not to follow __wrapped__
+  chains. Make its behaviour consistent with bound methods first argument.
+  Patch by Nick Coghlan and Yury Selivanov.
+
+- Issue #20681: Add new error handling API in asyncio. New APIs:
+  loop.set_exception_handler(), loop.default_exception_handler(), and
+  loop.call_exception_handler().
+
+- Issue #20673: Implement support for UNIX Domain Sockets in asyncio.
+  New APIs: loop.create_unix_connection(), loop.create_unix_server(),
+  streams.open_unix_connection(), and streams.start_unix_server().
+
+- Issue #20616: Add a format() method to tracemalloc.Traceback.
+
+- Issue #19744: the ensurepip installation step now just prints a warning to
+  stderr rather than failing outright if SSL/TLS is unavailable. This allows
+  local installation of POSIX builds without SSL/TLS support.
+
+- Issue #20594: Avoid name clash with the libc function posix_close.
+
+Build
+-----
+
+- Issue #20641: Run MSI custom actions (pip installation, pyc compilation)
+  with the NoImpersonate flag, to support elevated execution (UAC).
+
+- Issue #20221: Removed conflicting (or circular) hypot definition when
+  compiled with VS 2010 or above.  Initial patch by Tabrez Mohammed.
+
+- Issue #20609: Restored the ability to build 64-bit Windows binaries on
+  32-bit Windows, which was broken by the change in issue #19788.
+
+
+What's New in Python 3.4.0 release candidate 1?
+===============================================
+
+Release date: 2014-02-10
+
+Core and Builtins
+-----------------
+
+- Issue #19255: The builtins module is restored to initial value before
+  cleaning other modules.  The sys and builtins modules are cleaned last.
+
+- Issue #20588: Make Python-ast.c C89 compliant.
+
+- Issue #20437: Fixed 22 potential bugs when deleting objects references.
+
+- Issue #20500: Displaying an exception at interpreter shutdown no longer
+  risks triggering an assertion failure in PyObject_Str.
+
+- Issue #20538: UTF-7 incremental decoder produced inconsistent string when
+  input was truncated in BASE64 section.
 
 - Issue #20404: io.TextIOWrapper (and hence the open() builtin) now uses the
   internal codec marking system added for issue #19619 to throw LookupError
@@ -152,56 +1396,21 @@
   output type checks remain in place to deal with unmarked third party
   codecs.
 
-Tests
------
+- Issue #17162: Add PyType_GetSlot.
 
-- Issue #20743: Fix a reference leak in test_tcl.
-
-Tools/Demos
------------
-
-- Issue #20535: PYTHONWARNING no longer affects the run_tests.py script.
-  Patch by Arfrever Frehtes Taifersar Arahesis.
-
-
-What's New in Python 3.3.5 release candidate 1?
-===============================================
-
-*Release date: 23-Feb-2014*
-
-Core and Builtins
------------------
-
-- Issue #20588: Make Python-ast.c C89 compliant.
-
-- Issue #20437: Fixed 21 potential bugs when deleting objects references.
-
-- Issue #20538: UTF-7 incremental decoder produced inconsistant string when
-  input was truncated in BASE64 section.
+- Issue #20162: Fix an alignment issue in the siphash24() hash function which
+  caused a crash on PowerPC 64-bit (ppc64).
 
 Library
 -------
 
-- Issue #20635: Fixed grid_columnconfigure() and grid_rowconfigure() methods of
-  Tkinter widgets to work in wantobjects=True mode.
+- Issue #20530: The signatures for slot builtins have been updated
+  to reflect the fact that they only accept positional-only arguments.
 
-- Issue #19612: On Windows, subprocess.Popen.communicate() now ignores
-  OSError(22, 'Invalid argument') when writing input data into stdin, whereas
-  the process already exited.
+- Issue #20517: Functions in the os module that accept two filenames
+  now register both filenames in the exception on failure.
 
-- Issue #6815: os.path.expandvars() now supports non-ASCII environment
-  variables names and values.
-
-- Issue #17671: Fixed a crash when use non-initialized io.BufferedRWPair.
-  Based on patch by Stephen Tu.
-
-- Issue #8478: Untokenizer.compat processes first token from iterator input.
-  Patch based on lines from Georg Brandl, Eric Snow, and Gareth Rees.
-
-- Issue #20594: Avoid name clash with the libc function posix_close.
-
-- Issue #19856: shutil.move() failed to move a directory to other directory
-  on Windows if source name ends with os.altsep.
+- Issue #20563: The ipaddress module API is now considered stable.
 
 - Issue #14983: email.generator now always adds a line end after each MIME
   boundary marker, instead of doing so only when there is an epilogue.  This
@@ -218,9 +1427,21 @@
 - Issue #19772: email.generator no longer mutates the message object when
   doing a down-transform from 8bit to 7bit CTEs.
 
+- Issue #20536: the statistics module now correctly handle Decimal instances
+  with positive exponents
+
 - Issue #18805: the netmask/hostmask parsing in ipaddress now more reliably
   filters out illegal values and correctly allows any valid prefix length.
 
+- Issue #20481: For at least Python 3.4, the statistics module will require
+  that all inputs for a single operation be of a single consistent type, or
+  else a mixed of ints and a single other consistent type. This avoids
+  some interoperability issues that arose with the previous approach of
+  coercing to a suitable common type.
+
+- Issue #20478: the statistics module now treats collections.Counter inputs
+  like any other iterable.
+
 - Issue #17369: get_filename was raising an exception if the filename
   parameter's RFC2231 encoding was broken in certain ways.  This was
   a regression relative to python2.
@@ -229,6 +1450,14 @@
   deleted, and imaplib did not handle that case gracefully.  Now it
   handles the 'bye' correctly.
 
+- Issue #20531: Revert 3.4 version of fix for #19063, and apply the 3.3
+  version.  That is, do *not* raise an error if unicode is passed to
+  email.message.Message.set_payload.
+
+- Issue #20476: If a non-compat32 policy is used with any of the email parsers,
+  EmailMessage is now used as the factory class.  The factory class should
+  really come from the policy; that will get fixed in 3.5.
+
 - Issue #19920: TarFile.list() no longer fails when outputs a listing
   containing non-encodable characters.  Based on patch by Vajrasky Kok.
 
@@ -236,6 +1465,9 @@
 
 - Issue #19186: Restore namespacing of expat symbols inside the pyexpat module.
 
+- Issue #20053: ensurepip (and hence venv) are no longer affected by the
+  settings in the default pip configuration file.
+
 - Issue #20426: When passing the re.DEBUG flag, re.compile() displays the
   debug output every time it is called, regardless of the compilation cache.
 
@@ -245,17 +1477,62 @@
 - Issue #20435: Fix _pyio.StringIO.getvalue() to take into account newline
   translation settings.
 
+- tracemalloc: Fix slicing traces and fix slicing a traceback.
+
+- Issue #20354: Fix an alignment issue in the tracemalloc module on 64-bit
+  platforms. Bug seen on 64-bit Linux when using "make profile-opt".
+
+- Issue #17159: inspect.signature now accepts duck types of functions,
+  which adds support for Cython functions. Initial patch by Stefan Behnel.
+
+- Issue #18801: Fix inspect.classify_class_attrs to correctly classify
+  object.__new__ and object.__init__.
+
+- Fixed cmath.isinf's name in its argument parsing code.
+
+- Issue #20311, #20452: poll and epoll now round the timeout away from zero,
+  instead of rounding towards zero, in select and selectors modules:
+  select.epoll.poll(), selectors.PollSelector.poll() and
+  selectors.EpollSelector.poll(). For example, a timeout of one microsecond
+  (1e-6) is now rounded to one millisecondi (1e-3), instead of being rounded to
+  zero.  However, the granularity property and asyncio's resolution feature
+  were removed again.
+
+- asyncio: Some refactoring; various fixes; add write flow control to
+  unix pipes; Future.set_exception() instantiates the exception
+  argument if it is a class; improved proactor pipe transport; support
+  wait_for(f, None); don't log broken/disconnected pipes; use
+  ValueError instead of assert for forbidden subprocess_{shell,exec}
+  arguments; added a convenience API for subprocess management; added
+  StreamReader.at_eof(); properly handle duplicate coroutines/futures
+  in gather(), wait(), as_completed(); use a bytearray for buffering
+  in StreamReader; and more.
+
 - Issue #20288: fix handling of invalid numeric charrefs in HTMLParser.
 
 - Issue #20424: Python implementation of io.StringIO now supports lone surrogates.
 
+- Issue #20308: inspect.signature now works on classes without user-defined
+  __init__ or __new__ methods.
+
+- Issue #20372: inspect.getfile (and a bunch of other inspect functions that
+  use it) doesn't crash with unexpected AttributeError on classes defined in C
+  without __module__.
+
+- Issue #20356: inspect.signature formatting uses '/' to separate
+  positional-only parameters from others.
+
+- Issue #20223: inspect.signature now supports methods defined with
+  functools.partialmethods.
+
 - Issue #19456: ntpath.join() now joins relative paths correctly when a drive
   is present.
 
-- Issue #19077: tempfile.TemporaryDirectory cleanup is now most likely
-  successful when called during nulling out of modules during shutdown.
-  Misleading exception no longer raised when resource warning is emitted
-  during shutdown.
+- Issue #19077: tempfile.TemporaryDirectory cleanup no longer fails when
+  called during shutdown.  Emitting resource warning in __del__ no longer fails.
+  Original patch by Antoine Pitrou.
+
+- Issue #20394: Silence Coverity warning in audioop module.
 
 - Issue #20367: Fix behavior of concurrent.futures.as_completed() for
   duplicate arguments.  Patch by Glenn Langford.
@@ -264,6 +1541,18 @@
   codecs.StreamReader returned incomplete data when were called after
   readline() or read(size).  Based on patch by Amaury Forgeot d'Arc.
 
+- Issue #20105: the codec exception chaining now correctly sets the
+  traceback of the original exception as its __traceback__ attribute.
+
+- Issue #17481: inspect.getfullargspec() now uses inspect.signature() API.
+
+- Issue #15304: concurrent.futures.wait() can block forever even if
+  Futures have completed. Patch by Glenn Langford.
+
+- Issue #14455: plistlib: fix serializing integers in the range
+  of an unsigned long long but outside of the range of signed long long for
+  binary plist files.
+
 IDLE
 ----
 
@@ -271,7 +1560,7 @@
   Patch mostly by Serhiy Storchaka.
 
 - Update the python.gif icon for the Idle classbrowser and pathbowser
-  from the old green snake to the new new blue and yellow snakes.
+  from the old green snake to the new blue and yellow snakes.
 
 - Issue #17721: Remove non-functional configuration dialog help button until we
   make it actually gives some help when clicked. Patch by Guilherme Simões.
@@ -279,11 +1568,7 @@
 Tests
 -----
 
-- Issue #20510: Rewrote test_exit in test_sys to match existing comments,
-  use modern unittest features, and use helpers from test.script_helper
-  instead of using subprocess directly.  Patch by Gareth Rees.
-
-- Issue #20532: Tests which use _testcapi are now marked as CPython only.
+- Issue #20532: Tests which use _testcapi now are marked as CPython only.
 
 - Issue #19920: Added tests for TarFile.list().  Based on patch by Vajrasky Kok.
 
@@ -292,43 +1577,73 @@
 
 - Issue #20474: Fix test_socket "unexpected success" failures on OS X 10.7+.
 
-- Issue #20605: Make test_socket getaddrinfo OS X segfault test more robust.
+Tools/Demos
+-----------
 
-Documentation
--------------
+- Issue #20530: Argument Clinic's signature format has been revised again.
+  The new syntax is highly human readable while still preventing false
+  positives.  The syntax also extends Python syntax to denote "self" and
+  positional-only parameters, allowing inspect.Signature objects to be
+  totally accurate for all supported builtins in Python 3.4.
 
-- Issue #20488: Importlib is no longer *an* implementation of import, it's *the*
-  implementation.
+- Issue #20456: Argument Clinic now observes the C preprocessor conditional
+  compilation statements of the C files it parses.  When a Clinic block is
+  inside a conditional code, it adjusts its output to match, including
+  automatically generating an empty methoddef macro.
+
+- Issue #20456: Cloned functions in Argument Clinic now use the correct
+  name, not the name of the function they were cloned from, for text
+  strings inside generated code.
+
+- Issue #20456: Fixed Argument Clinic's test suite and "--converters" feature.
+
+- Issue #20456: Argument Clinic now allows specifying different names
+  for a parameter in Python and C, using "as" on the parameter line.
+
+- Issue #20326: Argument Clinic now uses a simple, unique signature to
+  annotate text signatures in docstrings, resulting in fewer false
+  positives.  "self" parameters are also explicitly marked, allowing
+  inspect.Signature() to authoritatively detect (and skip) said parameters.
+
+- Issue #20326: Argument Clinic now generates separate checksums for the
+  input and output sections of the block, allowing external tools to verify
+  that the input has not changed (and thus the output is not out-of-date).
 
 Build
 -----
 
-- Issue #20221: Removed conflicting (or circular) hypot definition when
-  compiled with VS 2010 or above.  Initial patch by Tabrez Mohammed.
+- Issue #20465: Update SQLite shipped with OS X installer to 3.8.3.
 
-- Issue #20609: Restored the ability to build 64-bit Windows binaries on
-  32-bit Windows, which was broken by the change in issue #19788.
+C-API
+-----
+
+- Issue #20517: Added new functions allowing OSError exceptions to reference
+  two filenames instead of one: PyErr_SetFromErrnoWithFilenameObjects() and
+  PyErr_SetExcFromWindowsErrWithFilenameObjects().
+
+Documentation
+-------------
+
+- Issue #20488: Change wording to say importlib is *the* implementation of
+  import instead of just *an* implementation.
+
+- Issue #6386: Clarify in the tutorial that specifying a symlink to execute
+  means the directory containing the executed script and not the symlink is
+  added to sys.path.
 
 
-What's New in Python 3.3.4?
-===========================
+What's New in Python 3.4.0 Beta 3?
+==================================
 
-*Release date: 09-Feb-2014*
-
-Library
--------
-
-- Issue #20374: Fix build warnings of the readline module with libedit on Mac.
-
-
-What's New in Python 3.3.4 release candidate 1?
-===============================================
-
-*Release date: 26-Jan-2014*
+Release date: 2014-01-26
 
 Core and Builtins
 -----------------
 
+- Issue #20189: Four additional builtin types (PyTypeObject,
+  PyMethodDescr_Type, _PyMethodWrapper_Type, and PyWrapperDescr_Type)
+  have been modified to provide introspection information for builtins.
+
 - Issue #17825: Cursor "^" is correctly positioned for SyntaxError and
   IndentationError.
 
@@ -343,29 +1658,26 @@
   source encoding declarations, and can be used to make Python batch files
   on Windows.
 
-- Issue #17432: Drop UCS2 from names of Unicode functions in python3.def.
-
-- Issue #19969: PyBytes_FromFormatV() now raises an OverflowError if "%c"
-  argument is not in range [0; 255].
-
-- Issue #14432: Generator now clears the borrowed reference to the thread
-  state. Fix a crash when a generator is created in a C thread that is
-  destroyed while the generator is still used. The issue was that a generator
-  contains a frame, and the frame kept a reference to the Python state of the
-  destroyed C thread. The crash occurs when a trace function is setup.
-
-- Issue #19932: Fix typo in import.h, missing whitespaces in function prototypes.
-
-- Issue #19729: In str.format(), fix recursive expansion in format spec.
-
-- Issue #19638: Fix possible crash / undefined behaviour from huge (more than 2
-  billion characters) input strings in _Py_dg_strtod.
-
 Library
 -------
 
-- Issue #16042: CVE-2013-1752: smtplib: Limit amount of data read by
-  limiting the call to readline().  Original patch by Christian Heimes.
+- asyncio: Various improvements and small changes not all covered by
+  issues listed below.  E.g. wait_for() now cancels the inner task if
+  the timeout occcurs; tweaked the set of exported symbols; renamed
+  Empty/Full to QueueEmpty/QueueFull; "with (yield from lock)" now
+  uses a separate context manager; readexactly() raises if not enough
+  data was read; PTY support tweaks.
+
+- Issue #20311: asyncio: Add a granularity attribute to BaseEventLoop: maximum
+  between the resolution of the BaseEventLoop.time() method and the resolution
+  of the selector. The granuarility is used in the scheduler to round time and
+  deadline.
+
+- Issue #20311: selectors: Add a resolution attribute to BaseSelector.
+
+- Issue #20189: unittest.mock now no longer assumes that any object for
+  which it could get an inspect.Signature is a callable written in Python.
+  Fix courtesy of Michael Foord.
 
 - Issue #20317: ExitStack.__exit__ could create a self-referential loop if an
   exception raised by a cleanup operation already had its context set
@@ -378,6 +1690,9 @@
 - Issue #20262: Warnings are raised now when duplicate names are added in the
   ZIP file or too long ZIP file comment is truncated.
 
+- Issue #20165: The unittest module no longer considers tests marked with
+  @expectedFailure successful if they pass.
+
 - Issue #18574: Added missing newline in 100-Continue reply from
   http.server.BaseHTTPRequestHandler. Patch by Nikolaus Rath.
 
@@ -409,7 +1724,7 @@
 - Issue #19097: Raise the correct Exception when cgi.FieldStorage is given an
   invalid fileobj.
 
-- Issue #20217: Fix build in SCHED_SPORADIC is defined.
+- Issue #20152: Ported Python/import.c over to Argument Clinic.
 
 - Issue #13107: argparse and optparse no longer raises an exception when output
   a help on environment with too small COLUMNS.  Based on patch by
@@ -427,20 +1742,205 @@
 - Issue #20113: os.readv() and os.writev() now raise an OSError exception on
   error instead of returning -1.
 
+- Issue #19719: Make importlib.abc.MetaPathFinder.find_module(),
+  PathEntryFinder.find_loader(), and Loader.load_module() use PEP 451 APIs to
+  help with backwards-compatibility.
+
+- Issue #20144: inspect.Signature now supports parsing simple symbolic
+  constants as parameter default values in __text_signature__.
+
 - Issue #20072: Fixed multiple errors in tkinter with wantobjects is False.
 
+- Issue #20229: Avoid plistlib deprecation warning in platform.mac_ver().
+
+- Issue #14455: Fix some problems with the new binary plist support in plistlib.
+
+IDLE
+----
+
+- Issue #17390: Add Python version to Idle editor window title bar.
+  Original patches by Edmond Burnett and Kent Johnson.
+
+- Issue #18960: IDLE now ignores the source encoding declaration on the second
+  line if the first line contains anything except a comment.
+
+Tests
+-----
+
+- Issue #20358: Tests for curses.window.overlay and curses.window.overwrite
+  no longer specify min{row,col} > max{row,col}.
+
+- Issue #19804: The test_find_mac test in test_uuid is now skipped if the
+  ifconfig executable is not available.
+
+- Issue #19886: Use better estimated memory requirements for bigmem tests.
+
+Tools/Demos
+-----------
+
+- Issue #20390: Argument Clinic's "file" output preset now defaults to
+  "{dirname}/clinic/{basename}.h".
+
+- Issue #20390: Argument Clinic's "class" directive syntax has been extended
+  with two new required  arguments: "typedef" and "type_object".
+
+- Issue #20390: Argument Clinic: If __new__ or __init__ functions didn't use
+  kwargs (or args), the PyArg_NoKeywords (or PyArg_NoPositional) calls
+  generated are only run when the type object is an exact match.
+
+- Issue #20390: Argument Clinic now fails if you have required parameters after
+  optional parameters.
+
+- Issue #20390: Argument Clinic converters now have a new template they can
+  inject code into: "modifiers".  Code put there is run in the parsing
+  function after argument parsing but before the call to the impl.
+
+- Issue #20376: Argument Clinic now escapes backslashes in docstrings.
+
+- Issue #20381: Argument Clinic now sanity checks the default argument when
+  c_default is also specified, providing a nice failure message for
+  disallowed values.
+
+- Issue #20189: Argument Clinic now ensures that parser functions for
+  __new__ are always of type newfunc, the type of the tp_new slot.
+  Similarly, parser functions for __init__ are now always of type initproc,
+  the type of tp_init.
+
+- Issue #20189: Argument Clinic now suppresses the docstring for __new__
+  and __init__ functions if no docstring is provided in the input.
+
+- Issue #20189: Argument Clinic now suppresses the "self" parameter in the
+  impl for @staticmethod functions.
+
+- Issue #20294: Argument Clinic now supports argument parsing for __new__ and
+  __init__ functions.
+
+- Issue #20299: Argument Clinic custom converters may now change the default
+  value of c_default and py_default with a class member.
+
+- Issue #20287: Argument Clinic's output is now configurable, allowing
+  delaying its output or even redirecting it to a separate file.
+
+- Issue #20226: Argument Clinic now permits simple expressions
+  (e.g. "sys.maxsize - 1") as default values for parameters.
+
+- Issue #19936: Added executable bits or shebang lines to Python scripts which
+  requires them.  Disable executable bits and shebang lines in test and
+  benchmark files in order to prevent using a random system python, and in
+  source files of modules which don't provide command line interface.  Fixed
+  shebang lines in the unittestgui and checkpip scripts.
+
+- Issue #20268: Argument Clinic now supports cloning the parameters and
+  return converter of existing functions.
+
+- Issue #20228: Argument Clinic now has special support for class special
+  methods.
+
+- Issue #20214: Fixed a number of small issues and documentation errors in
+  Argument Clinic (see issue for details).
+
+- Issue #20196: Fixed a bug where Argument Clinic did not generate correct
+  parsing code for functions with positional-only parameters where all arguments
+  are optional.
+
+- Issue #18960: 2to3 and the findnocoding.py script now ignore the source
+  encoding declaration on the second line if the first line contains anything
+  except a comment.
+
+- Issue #19723: The marker comments Argument Clinic uses have been changed
+  to improve readability.
+
+- Issue #20157: When Argument Clinic renames a parameter because its name
+  collides with a C keyword, it no longer exposes that rename to PyArg_Parse.
+
+- Issue #20141: Improved Argument Clinic's support for the PyArg_Parse "O!"
+  format unit.
+
+- Issue #20144: Argument Clinic now supports simple symbolic constants
+  as parameter default values.
+
+- Issue #20143: The line numbers reported in Argument Clinic errors are
+  now more accurate.
+
+- Issue #20142: Py_buffer variables generated by Argument Clinic are now
+  initialized with a default value.
+
+Build
+-----
+
+- Issue #12837: Silence a tautological comparison warning on OS X under Clang in
+  socketmodule.c.
+
+What's New in Python 3.4.0 Beta 2?
+==================================
+
+Release date: 2014-01-05
+
+Core and Builtins
+-----------------
+
+- Issue #17432: Drop UCS2 from names of Unicode functions in python3.def.
+
+- Issue #19526: Exclude all new API from the stable ABI. Exceptions can be
+  made if a need is demonstrated.
+
+- Issue #19969: PyBytes_FromFormatV() now raises an OverflowError if "%c"
+  argument is not in range [0; 255].
+
+- Issue #19995: %c, %o, %x, and %X now issue a DeprecationWarning on non-integer
+  input; reworded docs to clarify that an integer type should define both __int__
+  and __index__.
+
+- Issue #19787: PyThread_set_key_value() now always set the value. In Python
+  3.3, the function did nothing if the key already exists (if the current value
+  is a non-NULL pointer).
+
+- Issue #14432: Remove the thread state field from the frame structure. Fix a
+  crash when a generator is created in a C thread that is destroyed while the
+  generator is still used. The issue was that a generator contains a frame, and
+  the frame kept a reference to the Python state of the destroyed C thread. The
+  crash occurs when a trace function is setup.
+
+- Issue #19576: PyGILState_Ensure() now initializes threads. At startup, Python
+  has no concrete GIL. If PyGILState_Ensure() is called from a new thread for
+  the first time and PyEval_InitThreads() was not called yet, a GIL needs to be
+  created.
+
+- Issue #17576: Deprecation warning emitted now when __int__() or __index__()
+  return not int instance.
+
+- Issue #19932: Fix typo in import.h, missing whitespaces in function prototypes.
+
+- Issue #19736: Add module-level statvfs constants defined for GNU/glibc
+  based systems.
+
+- Issue #20097: Fix bad use of "self" in importlib's WindowsRegistryFinder.
+
+- Issue #19729: In str.format(), fix recursive expansion in format spec.
+
+- Issue #19638: Fix possible crash / undefined behaviour from huge (more than 2
+  billion characters) input strings in _Py_dg_strtod.
+
+Library
+-------
+
+- Issue #20154: Deadlock in asyncio.StreamReader.readexactly().
+
+- Issue #16113: Remove sha3 module again.
+
+- Issue #20111: pathlib.Path.with_suffix() now sanity checks the given suffix.
+
+- Fix breakage in TestSuite.countTestCases() introduced by issue #11798.
+
 - Issue #20108: Avoid parameter name clash in inspect.getcallargs().
 
-- Issue #12692: Backport the fix for ResourceWarning in test_urllib2net. This
-  also helps in closing the socket when Connection Close header is not sent.
+- Issue #19918: Fix PurePath.relative_to() under Windows.
 
 - Issue #19422: Explicitly disallow non-SOCK_STREAM sockets in the ssl
   module, rather than silently let them emit clear text data.
 
-- Issue #18116: getpass was always getting an error when testing /dev/tty,
-  and thus was always falling back to stdin, and would then raise an exception
-  if stdin could not be used (such as /dev/null).  It also leaked an open file.
-  All of these issues are now fixed.
+- Issue #20046: Locale alias table no longer contains entities which can be
+  calculated.  Generalized support of the euro modifier.
 
 - Issue #20027: Fixed locale aliases for devanagari locales.
 
@@ -449,15 +1949,37 @@
 - Issue #19020: Tkinter now uses splitlist() instead of split() in configure
   methods.
 
-- Fix TypeError on "setup.py upload --show-response".
+- Issue #19744: ensurepip now provides a better error message when Python is
+  built without SSL/TLS support (pip currently requires that support to run,
+  even if only operating with local wheel files)
 
-- Issue #12226: HTTPS is now used by default when connecting to PyPI.
+- Issue #19734: ensurepip now ignores all pip environment variables to avoid
+  odd behaviour based on user configuration settings
+
+- Fix TypeError on "setup.py upload --show-response".
 
 - Issue #20045: Fix "setup.py register --list-classifiers".
 
 - Issue #18879: When a method is looked up on a temporary file, avoid closing
   the file before the method is possibly called.
 
+- Issue #20037: Avoid crashes when opening a text file late at interpreter
+  shutdown.
+
+- Issue #19967: Thanks to the PEP 442, asyncio.Future now uses a
+  destructor to log uncaught exceptions, instead of the dedicated
+  _TracebackLogger class.
+
+- Added a Task.current_task() class method to asyncio.
+
+- Issue #19850: Set SA_RESTART in asyncio when registering a signal
+  handler to limit EINTR occurrences.
+
+- Implemented write flow control in asyncio for proactor event loop (Windows).
+
+- Change write buffer in asyncio use to avoid O(N**2) behavior.  Make
+  write()/sendto() accept bytearray/memoryview.
+
 - Issue #20034: Updated alias mapping to most recent locale.alias file
   from X.org distribution using makelocalealias.py.
 
@@ -477,6 +1999,19 @@
 - Issue #20007: HTTPResponse.read(0) no more prematurely closes connection.
   Original patch by Simon Sapin.
 
+- Issue #19946: multiprocessing now uses runpy to initialize __main__ in
+  child processes when necessary, allowing it to correctly handle scripts
+  without suffixes and submodules that use explicit relative imports or
+  otherwise rely on parent modules being correctly imported prior to
+  execution.
+
+- Issue #19921: When Path.mkdir() is called with parents=True, any missing
+  parent is created with the default permissions, ignoring the mode argument
+  (mimicking the POSIX "mkdir -p" command).
+
+- Issue #19887: Improve the Path.resolve() algorithm to support certain
+  symlink chains.
+
 - Issue #19912: Fixed numerous bugs in ntpath.splitunc().
 
 - Issue #19911: ntpath.splitdrive() now correctly processes the 'İ' character
@@ -487,6 +2022,9 @@
 
 - Issue #19623: Fixed writing to unseekable files in the aifc module.
 
+- Issue #19946: multiprocessing.spawn now raises ImportError when the module to
+  be used as the main module cannot be imported.
+
 - Issue #17919: select.poll.register() again works with poll.POLLNVAL on AIX.
   Fixed integer overflow in the eventmask parameter.
 
@@ -494,11 +2032,16 @@
   package would generate a message claiming the Content-Transfer-Encoding
   was 7bit, and produce garbage output for the content.  This now works.
   A couple of other set_payload mishandlings of non-ASCII are also fixed.
+  In addition, calling set_payload with a string argument without
+  specifying a charset now raises an error (this is a new error in 3.4).
 
-- Issue #17200: telnetlib's read_until and expect timeout was broken by the
-  fix to Issue #14635 in Python 3.3.0 to be interpreted as milliseconds
-  instead of seconds when the platform supports select.poll (ie: everywhere).
-  It is now treated as seconds once again.
+- Issue #15475: Add __sizeof__ implementations for itertools objects.
+
+- Issue #19944: Fix importlib.find_spec() so it imports parents as needed
+  and move the function to importlib.util.
+
+- Issue #19880: Fix a reference leak in unittest.TestCase. Explicitly break
+  reference cycles between frames and the _Outcome instance.
 
 - Issue #17429: platform.linux_distribution() now decodes files from the UTF-8
   encoding with the surrogateescape error handler, instead of decoding from the
@@ -506,6 +2049,9 @@
   probably the first major distribution release with a non-ASCII name. Patch
   written by Toshio Kuratomi.
 
+- Issue #19343: Expose FreeBSD-specific APIs in resource module.  Original
+  patch by Koobs.
+
 - Issue #19929: Call os.read with 32768 within subprocess.Popen.communicate
   rather than 4096 for efficiency.  A microbenchmark shows Linux and OS X
   both using ~50% less cpu time this way.
@@ -513,21 +2059,73 @@
 - Issue #19506: Use a memoryview to avoid a data copy when piping data
   to stdin within subprocess.Popen.communicate.  5-10% less cpu usage.
 
+- Issue #19876: selectors unregister() no longer raises ValueError or OSError
+  if the FD is closed (as long as it was registered).
+
+- Issue #19908: pathlib now joins relative Windows paths correctly when a drive
+  is present.  Original patch by Antoine Pitrou.
+
+- Issue #19296: Silence compiler warning in dbm_open
+
+- Issue #6784: Strings from Python 2 can now be unpickled as bytes
+  objects by setting the encoding argument of Unpickler to be 'bytes'.
+  Initial patch by Merlijn van Deen.
+
 - Issue #19839: Fix regression in bz2 module's handling of non-bzip2 data at
   EOF, and analogous bug in lzma module.
 
+- Issue #19881: Fix pickling bug where cpickle would emit bad pickle data for
+  large bytes string (i.e., with size greater than 2**32-1).
+
 - Issue #19138: doctest's IGNORE_EXCEPTION_DETAIL now allows a match when
   no exception detail exists (no colon following the exception's name, or
   a colon does follow but no text follows the colon).
 
+- Issue #19927: Add __eq__ to path-based loaders in importlib.
+
+- Issue #19827: On UNIX, setblocking() and settimeout() methods of
+  socket.socket can now avoid a second syscall if the ioctl() function can be
+  used, or if the non-blocking flag of the socket is unchanged.
+
+- Issue #19785: smtplib now supports SSLContext.check_hostname and server name
+  indication for TLS/SSL connections.
+
+- Issue #19784: poplib now supports SSLContext.check_hostname and server name
+  indication for TLS/SSL connections.
+
+- Issue #19783: nntplib now supports SSLContext.check_hostname and server name
+  indication for TLS/SSL connections.
+
+- Issue #19782: imaplib now supports SSLContext.check_hostname and server name
+  indication for TLS/SSL connections.
+
+- Issue 20123: Fix pydoc.synopsis() for "binary" modules.
+
 - Issue #19834: Support unpickling of exceptions pickled by Python 2.
 
+- Issue #19781: ftplib now supports SSLContext.check_hostname and server name
+  indication for TLS/SSL connections.
+
+- Issue #19509: Add SSLContext.check_hostname to match the peer's certificate
+  with server_hostname on handshake.
+
 - Issue #15798: Fixed subprocess.Popen() to no longer fail if file
   descriptor 0, 1 or 2 is closed.
 
+- Issue #17897: Optimized unpickle prefetching.
+
+- Issue #3693: Make the error message more helpful when the array.array()
+  constructor is given a str. Move the array module typecode documentation to
+  the docstring of the constructor.
+
 - Issue #19088: Fixed incorrect caching of the copyreg module in
   object.__reduce__() and object.__reduce_ex__().
 
+- Issue #19698: Removed exec_module() methods from
+  importlib.machinery.BuiltinImporter and ExtensionFileLoader.
+
+- Issue #18864: Added a setter for ModuleSpec.has_location.
+
 - Fixed _pickle.Unpickler to not fail when loading empty strings as
   persistent IDs.
 
@@ -537,6 +2135,19 @@
 - Issue #6477: Added support for pickling the types of built-in singletons
   (i.e., Ellipsis, NotImplemented, None).
 
+- Issue #19713: Add remaining PEP 451-related deprecations and move away
+  from using find_module/find_loaer/load_module.
+
+- Issue #19708: Update pkgutil to use the new importer APIs.
+
+- Issue #19703: Update pydoc to use the new importer APIs.
+
+- Issue #19851: Fixed a regression in reloading sub-modules.
+
+- ssl.create_default_context() sets OP_NO_COMPRESSION to prevent CRIME.
+
+- Issue #19802: Add socket.SO_PRIORITY.
+
 - Issue #11508: Fixed uuid.getnode() and uuid.uuid1() on environment with
   virtual interface.  Original patch by Kent Frazier.
 
@@ -545,56 +2156,9 @@
 - Issue #19545: Avoid chained exceptions while passing stray % to
   time.strptime().  Initial patch by Claudiu Popa.
 
-- Issue #19633: Fixed writing not compressed 16- and 32-bit wave files on
-  big-endian platforms.
-
-- Issue #19449: in csv's writerow, handle non-string keys when generating the
-  error message that certain keys are not in the 'fieldnames' list.
-
-- Fix test.support.bind_port() to not cause an error when Python was compiled
-  on a system with SO_REUSEPORT defined in the headers but run on a system
-  with an OS kernel that does not support that reasonably new socket option.
-
-- Fix compilation error under gcc of the ctypes module bundled libffi for arm.
-
-- Issue #19523: Closed FileHandler leak which occurred when delay was set.
-
-- Issue #13674: Prevented time.strftime from crashing on Windows when given
-  a year before 1900 and a format of %y.
-
-- Issue #19544 and Issue #6286: Restore use of urllib over http allowing use
-  of http_proxy for Distutils upload command, a feature accidentally lost
-  in the rollback of distutils2.
-
-- Issue #19544 and Issue #7457: Restore the read_pkg_file method to
-  distutils.dist.DistributionMetadata accidentally removed in the undo of
-  distutils2.
-
-- Issue #1575020: Fixed support of 24-bit wave files on big-endian platforms.
-
-- Issue #19480: HTMLParser now accepts all valid start-tag names as defined
-  by the HTML5 standard.
-
-- Issue #6157: Fixed tkinter.Text.debug().  Original patch by Guilherme Polo.
-
-- Issue #6160: The bbox() method of tkinter.Spinbox now returns a tuple of
-  integers instead of a string.  Based on patch by Guilherme Polo.
-
-- Issue #10197: Rework subprocess.get[status]output to use subprocess
-  functionality and thus to work on Windows. Patch by Nick Coghlan.
-
-- Issue #19286: Directories in ``package_data`` are no longer added to
-  the filelist, preventing failure outlined in the ticket.
-
 IDLE
 ----
 
-- Issue #17390: Add Python version to Idle editor window title bar.
-  Original patches by Edmond Burnett and Kent Johnson.
-
-- Issue #18960: IDLE now ignores the source encoding declaration on the second
-  line if the first line contains anything except a comment.
-
 - Issue #20058: sys.stdin.readline() in IDLE now always returns only one line.
 
 - Issue #19481: print() of string subclass instance in IDLE no longer hangs.
@@ -605,21 +2169,17 @@
 Tests
 -----
 
-- Issue #19804: The test_find_mac test in test_uuid is now skipped if the
-  ifconfig executable is not available.
-
-- Issue #19886: Use better estimated memory requirements for bigmem tests.
-
 - Issue #20055: Fix test_shutil under Windows with symlink privileges held.
   Patch by Vajrasky Kok.
 
+- Issue #20070: Don't run test_urllib2net when network resources are not
+  enabled.
+
 - Issue #19938: Re-enabled test_bug_1333982 in test_dis, which had been
   disabled since 3.0 due to the changes in listcomp handling.
 
 - Issue #19320: test_tcl no longer fails when wantobjects is false.
 
-- Issue #19683: Removed empty tests from test_minidom.  Patch by Ajitesh Gupta.
-
 - Issue #19919: Fix flaky SSL test. connect_ex() sometimes returns
   EWOULDBLOCK on Windows or VMs hosted on Windows.
 
@@ -629,26 +2189,35 @@
 
 - Issue #19928: Implemented a test for repr() of cell objects.
 
-- Issue #19535: Fixed test_docxmlrpc when python is run with -OO.
+- Issue #19535: Fixed test_docxmlrpc, test_functools, test_inspect, and
+  test_statistics when python is run with -OO.
 
 - Issue #19926: Removed unneeded test_main from test_abstract_numbers.
   Patch by Vajrasky Kok.
 
+- Issue #19572: More skipped tests explicitly marked as skipped.
+
 - Issue #19595, #19987: Re-enabled a long-disabled test in test_winsound.
 
 - Issue #19588: Fixed tests in test_random that were silently skipped most
   of the time.  Patch by Julian Gindi.
 
-- Issue #19596: Set untestable tests in test_importlib to None to avoid
-  reporting success on empty tests.
+Build
+-----
 
-- Issue #19440: Clean up test_capi by removing an unnecessary __future__
-  import, converting from test_main to unittest.main, and running the
-  _testcapi module tests within a unittest TestCase.
+- Issue #19728: Enable pip installation by default on Windows.
 
-- Issue #18702, 19572: All skipped tests now reported as skipped.
+- Issue #16136: Remove VMS support
 
-- Issue #19085: Added basic tests for all tkinter widget options.
+- Issue #18215: Add script Tools/ssl/test_multiple_versions.py to compile and
+  run Python's unit tests with multiple versions of OpenSSL.
+
+- Issue #19922: define _INCLUDE__STDC_A1_SOURCE in HP-UX to include mbstate_t
+  for mbrtowc().
+
+- Issue #19788: kill_python(_d).exe is now run as a PreBuildEvent on the
+  pythoncore sub-project.  This should prevent build errors due a previous
+  build's python(_d).exe still running.
 
 Documentation
 -------------
@@ -662,9 +2231,6 @@
 - Issue #20253: Fixed a typo in the ipaddress docs that advertised an
   illegal attribute name.  Found by INADA Naoki.
 
-- Issue #19963: Document that importlib.import_module() no longer requires
-  importing parent packages separately.
-
 - Issue #18840: Introduce the json module in the tutorial, and de-emphasize
   the pickle module.
 
@@ -672,149 +2238,294 @@
 
 - Issue #19795: Improved markup of True/False constants.
 
-- Issue #18326: Clarify that list.sort's arguments are keyword-only.  Also,
-  attempt to reduce confusion in the glossary by not saying there are
-  different "types" of arguments and parameters.
-
-Build
------
-
-- Issue #19788: kill_python(_d).exe is now run as a PreBuildEvent on the
-  pythoncore sub-project.  This should prevent build errors due a previous
-  build's python(_d).exe still running.
-
-- Add workaround for VS 2010 nmake clean issue. VS 2010 doesn't set up PATH
-  for nmake.exe correctly.
-
 Tools/Demos
 -----------
 
-- Issue #19936: Added executable bits or shebang lines to Python scripts which
-  requires them.  Disable executable bits and shebang lines in test and
-  benchmark files in order to prevent using a random system python, and in
-  source files of modules which don't provide command line interface.  Fixed
-  shebang line to use python3 executable in the unittestgui script.
+- Issue #19659: Added documentation for Argument Clinic.
 
-- Issue #18960: 2to3 and the findnocoding.py script now ignore the source
-  encoding declaration on the second line if the first line contains anything
-  except a comment.
+- Issue #19976: Argument Clinic METH_NOARGS functions now always
+  take two parameters.
 
+What's New in Python 3.4.0 Beta 1?
+==================================
 
-What's New in Python 3.3.3?
-===========================
-
-*Release date: 17-Nov-2013*
-
-No changes from release candidate 2.
-
-
-What's New in Python 3.3.3 release candidate 2?
-===============================================
-
-*Release date: 11-Nov-2013*
-
-Library
--------
-
-- Issue #19227: Any re-seeding of the OpenSSL RNG on fork has been removed;
-  this should be handled by OpenSSL itself or by the application.
-
-- Issue #19435: Fix directory traversal attack on CGIHttpRequestHandler.
-
-Tests
------
-
-- Issue #18964: Fix test_tcl when run with Tcl/Tk versions  < 8.5.
-
-Build
------
-
-- Issue #15663: Revert OS X installer built-in Tcl/Tk support for 3.3.3.
-  Some third-party projects, such as Matplotlib and PIL/Pillow,
-  depended on being able to build with Tcl and Tk frameworks in
-  /Library/Frameworks.
-
-
-What's New in Python 3.3.3 release candidate 1?
-===============================================
-
-*Release date: 27-Oct-2013*
+Release date: 2013-11-24
 
 Core and Builtins
 -----------------
 
+- Use the repr of a module name in more places in import, especially
+  exceptions.
+
+- Issue #19619: str.encode, bytes.decode and bytearray.decode now use an
+  internal API to throw LookupError for known non-text encodings, rather
+  than attempting the encoding or decoding operation and then throwing a
+  TypeError for an unexpected output type. (The latter mechanism remains
+  in place for third party non-text encodings)
+
+- Issue #19183: Implement PEP 456 'secure and interchangeable hash algorithm'.
+  Python now uses SipHash24 on all major platforms.
+
+- Issue #12892: The utf-16* and utf-32* encoders no longer allow surrogate code
+  points (U+D800-U+DFFF) to be encoded.  The utf-32* decoders no longer decode
+  byte sequences that correspond to surrogate code points.  The surrogatepass
+  error handler now works with the utf-16* and utf-32* codecs.  Based on
+  patches by Victor Stinner and Kang-Hao (Kenny) Lu.
+
+- Issue #17806: Added keyword-argument support for "tabsize" to
+  str/bytes.expandtabs().
+
+- Issue #17828: Output type errors in str.encode(), bytes.decode() and
+  bytearray.decode() now direct users to codecs.encode() or codecs.decode()
+  as appropriate.
+
+- Issue #17828: The interpreter now attempts to chain errors that occur in
+  codec processing with a replacement exception of the same type that
+  includes the codec name in the error message. It ensures it only does this
+  when the creation of the replacement exception won't lose any information.
+
+- Issue #19466: Clear the frames of daemon threads earlier during the
+  Python shutdown to call objects destructors. So "unclosed file" resource
+  warnings are now corretly emitted for daemon threads.
+
+- Issue #19514: Deduplicate some _Py_IDENTIFIER declarations.
+  Patch by Andrei Dorian Duma.
+
+- Issue #17936: Fix O(n**2) behaviour when adding or removing many subclasses
+  of a given type.
+
+- Issue #19428: zipimport now handles errors when reading truncated or invalid
+  ZIP archive.
+
+- Issue #18408: Add a new PyFrame_FastToLocalsWithError() function to handle
+  exceptions when merging fast locals into f_locals of a frame.
+  PyEval_GetLocals() now raises an exception and return NULL on failure.
+
+- Issue #19369: Optimized the usage of __length_hint__().
+
 - Issue #18603: Ensure that PyOS_mystricmp and PyOS_mystrnicmp are in the
   Python executable and not removed by the linker's optimizer.
 
-- Issue #19279: UTF-7 decoder no more produces illegal strings.
-
-- Fix macro expansion of _PyErr_OCCURRED(), and make sure to use it in at
-  least one place so as to avoid regressions.
-
-- Issue #19014: memoryview.cast() is now allowed on zero-length views.
-
-- Issue #19098: Prevent overflow in the compiler when the recursion limit is set
-  absurdly high.
-
-- Issue #18942: sys._debugmallocstats() output was damaged on Windows.
-
-- Issue #18667: Add missing "HAVE_FCHOWNAT" symbol to posix._have_functions.
-
-- Issue #18368: PyOS_StdioReadline() no longer leaks memory when realloc()
-  fails.
-
-- Issue #16741: Fix an error reporting in int().
-
-- Issue #17899: Fix rare file descriptor leak in os.listdir().
-
-- Issue #18552: Check return value of PyArena_AddPyObject() in
-  obj2ast_object().
-
-- Issue #18560: Fix potential NULL pointer dereference in sum().
-
-- Issue #15905: Fix theoretical buffer overflow in handling of sys.argv[0],
-  prefix and exec_prefix if the operation system does not obey MAXPATHLEN.
-
-- Issue #18344: Fix potential ref-leaks in _bufferedreader_read_all().
-
-- Issue #17872: Fix a segfault in marshal.load() when input stream returns
-  more bytes than requested.
-
-- Issue #18426: Fix NULL pointer dereference in C extension import when
-  PyModule_GetDef() returns an error.
-
-- Issue #18328: Reorder ops in PyThreadState_Delete*() functions. Now the
-  tstate is first removed from TLS and then deallocated.
-
-- Issue #18184: PyUnicode_FromFormat() and PyUnicode_FromFormatV() now raise
-  OverflowError when an argument of %c format is out of range.
-
-- Issue #18137: Detect integer overflow on precision in float.__format__()
-  and complex.__format__().
-
-- Issue #18183: Fix various unicode operations on strings with large unicode
-  codepoints.
-
-- Issue #18180: Fix ref leak in _PyImport_GetDynLoadWindows().
-
-- Issue #18038: SyntaxError raised during compilation sources with illegal
-  encoding now always contains an encoding name.
-
-- Issue #17644: Fix a crash in str.format when curly braces are used in square
-  brackets.
-
-- Issue #17983: Raise a SyntaxError for a ``global __class__`` statement in a
-  class body.
-
-- Issue #17927: Frame objects kept arguments alive if they had been copied into
-  a cell, even if the cell was cleared.
+- Issue #19306: Add extra hints to the faulthandler module's stack
+  dumps that these are "upside down".
 
 Library
 -------
 
-- Issue #19395: Raise an exception when attempting to pickle a bz2 or lzma
-  compressor/decompressor object, rather than creating a pickle that would
-  cause a segfault when loaded and used.
+- Issue #3158: doctest can now find doctests in functions and methods
+  written in C.
+
+- Issue #13477: Added command line interface to the tarfile module.
+  Original patch by Berker Peksag.
+
+- Issue #19674: inspect.signature() now produces a correct signature
+  for some builtins.
+
+- Issue #19722: Added opcode.stack_effect(), which
+  computes the stack effect of bytecode instructions.
+
+- Issue #19735: Implement private function ssl._create_stdlib_context() to
+  create SSLContext objects in Python's stdlib module. It provides a single
+  configuration point and makes use of SSLContext.load_default_certs().
+
+- Issue #16203: Add re.fullmatch() function and regex.fullmatch() method,
+  which anchor the pattern at both ends of the string to match.
+  Original patch by Matthew Barnett.
+
+- Issue #13592: Improved the repr for regular expression pattern objects.
+  Based on patch by Hugo Lopes Tavares.
+
+- Issue #19641: Added the audioop.byteswap() function to convert big-endian
+  samples to little-endian and vice versa.
+
+- Issue #15204: Deprecated the 'U' mode in file-like objects.
+
+- Issue #17810: Implement PEP 3154, pickle protocol 4.
+
+- Issue #19668: Added support for the cp1125 encoding.
+
+- Issue #19689: Add ssl.create_default_context() factory function. It creates
+  a new SSLContext object with secure default settings.
+
+- Issue #19727: os.utime(..., None) is now potentially more precise
+  under Windows.
+
+- Issue #17201: ZIP64 extensions now are enabled by default.  Patch by
+  William Mallard.
+
+- Issue #19292: Add SSLContext.load_default_certs() to load default root CA
+  certificates from default stores or system stores. By default the method
+  loads CA certs for authentication of server certs.
+
+- Issue #19673: Add pathlib to the stdlib as a provisional module (PEP 428).
+
+- Issue #16596: pdb in a generator now properly skips over yield and
+  yield from rather than stepping out of the generator into its
+  caller.  (This is essential for stepping through asyncio coroutines.)
+
+- Issue #17916: Added dis.Bytecode.from_traceback() and
+  dis.Bytecode.current_offset to easily display "current instruction"
+  markers in the new disassembly API (Patch by Claudiu Popa).
+
+- Issue #19552: venv now supports bootstrapping pip into virtual environments
+
+- Issue #17134: Finalize interface to Windows' certificate store. Cert and
+  CRL enumeration are now two functions. enum_certificates() also returns
+  purpose flags as set of OIDs.
+
+- Issue #19555: Restore sysconfig.get_config_var('SO'), (and the distutils
+  equivalent) with a DeprecationWarning pointing people at $EXT_SUFFIX.
+
+- Issue #8813: Add SSLContext.verify_flags to change the verification flags
+  of the context in order to enable certification revocation list (CRL)
+  checks or strict X509 rules.
+
+- Issue #18294: Fix the zlib module to make it 64-bit safe.
+
+- Issue #19682: Fix compatibility issue with old version of OpenSSL that
+  was introduced by Issue #18379.
+
+- Issue #14455: plistlib now supports binary plists and has an updated API.
+
+- Issue #19633: Fixed writing not compressed 16- and 32-bit wave files on
+  big-endian platforms.
+
+- Issue #18379: SSLSocket.getpeercert() returns CA issuer AIA fields, OCSP
+  and CRL distribution points.
+
+- Issue #18138: Implement cadata argument of SSLContext.load_verify_location()
+  to load CA certificates and CRL from memory. It supports PEM and DER
+  encoded strings.
+
+- Issue #18775: Add name and block_size attribute to HMAC object. They now
+  provide the same API elements as non-keyed cryptographic hash functions.
+
+- Issue #17276: MD5 as default digestmod for HMAC is deprecated. The HMAC
+  module supports digestmod names, e.g. hmac.HMAC('sha1').
+
+- Issue #19449: in csv's writerow, handle non-string keys when generating the
+  error message that certain keys are not in the 'fieldnames' list.
+
+- Issue #13633: Added a new convert_charrefs keyword arg to HTMLParser that,
+  when True, automatically converts all character references.
+
+- Issue #2927: Added the unescape() function to the html module.
+
+- Issue #8402: Added the escape() function to the glob module.
+
+- Issue #17618: Add Base85 and Ascii85 encoding/decoding to the base64 module.
+
+- Issue #19634: time.strftime("%y") now raises a ValueError on AIX when given a
+  year before 1900.
+
+- Fix test.support.bind_port() to not cause an error when Python was compiled
+  on a system with SO_REUSEPORT defined in the headers but run on a system
+  with an OS kernel that does not support that reasonably new socket option.
+
+- Fix compilation error under gcc of the ctypes module bundled libffi for arm.
+
+- Issue #19448: Add private API to SSL module to lookup ASN.1 objects by OID,
+  NID, short name and long name.
+
+- Issue #19282: dbm.open now supports the context management protocol. (Inital
+  patch by Claudiu Popa)
+
+- Issue #8311: Added support for writing any bytes-like objects in the aifc,
+  sunau, and wave modules.
+
+- Issue #5202: Added support for unseekable files in the wave module.
+
+- Issue #19544 and Issue #1180: Restore global option to ignore
+  ~/.pydistutils.cfg in Distutils, accidentally removed in backout of
+  distutils2 changes.
+
+- Issue #19523: Closed FileHandler leak which occurred when delay was set.
+
+- Issue #19544 and Issue #6516: Restore support for --user and --group
+  parameters to sdist command accidentally rolled back as part of the
+  distutils2 rollback.
+
+- Issue #13674: Prevented time.strftime from crashing on Windows when given
+  a year before 1900 and a format of %y.
+
+- Issue #19406: implementation of the ensurepip module (part of PEP 453).
+  Patch by Donald Stufft and Nick Coghlan.
+
+- Issue #19544 and Issue #6286: Restore use of urllib over http allowing use
+  of http_proxy for Distutils upload command, a feature accidentally lost
+  in the rollback of distutils2.
+
+- Issue #19544 and Issue #7457: Restore the read_pkg_file method to
+  distutils.dist.DistributionMetadata accidentally removed in the undo of
+  distutils2.
+
+- Issue #16685: Added support for any bytes-like objects in the audioop module.
+  Removed support for strings.
+
+- Issue #7171: Add Windows implementation of ``inet_ntop`` and ``inet_pton``
+  to socket module. Patch by Atsuo Ishimoto.
+
+- Issue #19261: Added support for writing 24-bit samples in the sunau module.
+
+- Issue #1097797: Added CP273 encoding, used on IBM mainframes in
+  Germany and Austria.  Mapping provided by Michael Bierenfeld.
+
+- Issue #1575020: Fixed support of 24-bit wave files on big-endian platforms.
+
+- Issue #19378: Fixed a number of cases in the dis module where the new
+  "file" parameter was not being honoured correctly
+
+- Issue #19378: Removed the "dis.Bytecode.show_info" method
+
+- Issue #19378: Renamed the "dis.Bytecode.display_code" method to
+  "dis.Bytecode.dis" and converted it to returning a string rather than
+  printing output.
+
+- Issue #19378: the "line_offset" parameter in the new "dis.get_instructions"
+  API has been renamed to "first_line" (and the default value and usage
+  changed accordingly). This should reduce confusion with the more common use
+  of "offset" in the dis docs to refer to bytecode offsets.
+
+- Issue #18678: Corrected spwd struct member names in spwd module:
+  sp_nam->sp_namp, and sp_pwd->sp_pwdp.  The old names are kept as extra
+  structseq members, for backward compatibility.
+
+- Issue #6157: Fixed tkinter.Text.debug().  tkinter.Text.bbox() now raises
+  TypeError instead of TclError on wrong number of arguments.  Original patch
+  by Guilherme Polo.
+
+- Issue #10197: Rework subprocess.get[status]output to use subprocess
+  functionality and thus to work on Windows. Patch by Nick Coghlan
+
+- Issue #6160: The bbox() method of tkinter.Spinbox now returns a tuple of
+  integers instead of a string.  Based on patch by Guilherme Polo.
+
+- Issue #19403: contextlib.redirect_stdout is now reentrant
+
+- Issue #19286: Directories in ``package_data`` are no longer added to
+  the filelist, preventing failure outlined in the ticket.
+
+- Issue #19480: HTMLParser now accepts all valid start-tag names as defined
+  by the HTML5 standard.
+
+- Issue #15114: The html.parser module now raises a DeprecationWarning when the
+  strict argument of HTMLParser or the HTMLParser.error method are used.
+
+- Issue #19410: Undo the special-casing removal of '' for
+  importlib.machinery.FileFinder.
+
+- Issue #19424: Fix the warnings module to accept filename containing surrogate
+  characters.
+
+- Issue #19435: Fix directory traversal attack on CGIHttpRequestHandler.
+
+- Issue #19227: Remove pthread_atfork() handler. The handler was added to
+  solve #18747 but has caused issues.
+
+- Issue #19420: Fix reference leak in module initalization code of
+  _hashopenssl.c
+
+- Issue #19329: Optimized compiling charsets in regular expressions.
 
 - Issue #19227: Try to fix deadlocks caused by re-seeding then OpenSSL
   pseudo-random number generator on fork().
@@ -837,12 +2548,30 @@
 - Issue #16039: CVE-2013-1752: Change use of readline in imaplib module to limit
   line length.  Patch by Emil Lind.
 
+- Issue #19330: the unnecessary wrapper functions have been removed from the
+  implementations of the new contextlib.redirect_stdout and
+  contextlib.suppress context managers, which also ensures they provide
+  reasonable help() output on instances
+
 - Issue #19393: Fix symtable.symtable function to not be confused when there are
   functions or classes named "top".
 
+- Issue #18685: Restore re performance to pre-PEP 393 levels.
+
 - Issue #19339: telnetlib module is now using time.monotonic() when available
   to compute timeout.
 
+- Issue #19399: fix sporadic test_subprocess failure.
+
+- Issue #13234: Fix os.listdir to work with extended paths on Windows.
+  Patch by Santoso Wijaya.
+
+- Issue #19375: The site module adding a "site-python" directory to sys.path,
+  if it exists, is now deprecated.
+
+- Issue #19379: Lazily import linecache in the warnings module, to make
+  startup with warnings faster until a warning gets printed.
+
 - Issue #19288: Fixed the "in" operator of dbm.gnu databases for string
   argument.  Original patch by Arfrever Frehtes Taifersar Arahesis.
 
@@ -851,52 +2580,300 @@
 
 - Issue #19327: Fixed the working of regular expressions with too big charset.
 
+- Issue #17400: New 'is_global' attribute for ipaddress to tell if an address
+  is allocated by IANA for global or private networks.
+
 - Issue #19350: Increasing the test coverage of macurl2path. Patch by Colin
   Williams.
 
+- Issue #19365: Optimized the parsing of long replacement string in re.sub*()
+  functions.
+
 - Issue #19352: Fix unittest discovery when a module can be reached
   through several paths (e.g. under Debian/Ubuntu with virtualenv).
 
 - Issue #15207: Fix mimetypes to read from correct part of Windows registry
   Original patch by Dave Chambers
 
+- Issue #16595: Add prlimit() to resource module.
+
+- Issue #19324: Expose Linux-specific constants in resource module.
+
+- Load SSL's error strings in hashlib.
+
+- Issue #18527: Upgrade internal copy of zlib to 1.2.8.
+
+- Issue #19274: Add a filterfunc parameter to PyZipFile.writepy.
+
 - Issue #8964: fix platform._sys_version to handle IronPython 2.6+.
   Patch by Martin Matusiak.
 
+- Issue #19413: Restore pre-3.3 reload() semantics of re-finding modules.
+
+- Issue #18958: Improve error message for json.load(s) while passing a string
+  that starts with a UTF-8 BOM.
+
+- Issue #19307: Improve error message for json.load(s) while passing objects
+  of the wrong type.
+
 - Issue #16038: CVE-2013-1752: ftplib: Limit amount of data read by
   limiting the call to readline().  Original patch by Michał
   Jastrzębski and Giampaolo Rodola.
 
+- Issue #17087: Improved the repr for regular expression match objects.
+
+Tests
+-----
+
+- Issue #19664: test_userdict's repr test no longer depends on the order
+  of dict elements.
+
+- Issue #19440: Clean up test_capi by removing an unnecessary __future__
+  import, converting from test_main to unittest.main, and running the
+  _testcapi module tests as subTests of a unittest TestCase method.
+
+- Issue #19378: the main dis module tests are now run with both stdout
+  redirection *and* passing an explicit file parameter
+
+- Issue #19378: removed the not-actually-helpful assertInstructionMatches
+  and assertBytecodeExactlyMatches helpers from bytecode_helper
+
+- Issue #18702: All skipped tests now reported as skipped.
+
+- Issue #19439: interpreter embedding tests are now executed on Windows
+  (Patch by Zachary Ware)
+
+- Issue #19085: Added basic tests for all tkinter widget options.
+
+- Issue #19384: Fix test_py_compile for root user, patch by Claudiu Popa.
+
+Documentation
+-------------
+
+- Issue #18326: Clarify that list.sort's arguments are keyword-only.  Also,
+  attempt to reduce confusion in the glossary by not saying there are
+  different "types" of arguments and parameters.
+
+Build
+-----
+
+- Issue #19358: "make clinic" now runs the Argument Clinic preprocessor
+  over all CPython source files.
+
+- Update SQLite to 3.8.1, xz to 5.0.5, and Tcl/Tk to 8.6.1 on Windows.
+
+- Issue #16632: Enable DEP and ASLR on Windows.
+
+- Issue #17791: Drop PREFIX and EXEC_PREFIX definitions from PC/pyconfig.h
+
+- Add workaround for VS 2010 nmake clean issue. VS 2010 doesn't set up PATH
+  for nmake.exe correctly.
+
+- Issue #19550: Implement Windows installer changes of PEP 453 (ensurepip).
+
+- Issue #19520: Fix compiler warning in the _sha3 module on 32bit Windows.
+
+- Issue #19356: Avoid using a C variabled named "_self", it's a reserved
+  word in some C compilers.
+
+- Issue #15792: Correct build options on Win64. Patch by Jeremy Kloth.
+
+- Issue #19373: Apply upstream change to Tk 8.5.15 fixing OS X 10.9
+  screen refresh problem for OS X installer build.
+
+- Issue #19649: On OS X, the same set of file names are now installed
+  in bin directories for all configurations: non-framework vs framework,
+  and single arch vs universal builds.  pythonx.y-32 is now always
+  installed for 64-bit/32-bit universal builds.  The obsolete and
+  undocumented pythonw* symlinks are no longer installed anywhere.
+
+- Issue #19553: PEP 453 - "make install" and "make altinstall" now install or
+  upgrade pip by default, using the bundled pip provided by the new ensurepip
+  module.  A new configure option, --with-ensurepip[=upgrade|install|no], is
+  available to override the default ensurepip "--upgrade" option.  The option
+  can also be set with "make [alt]install ENSUREPIP=[upgrade|install\no]".
+
+- Issue #19551: PEP 453 - the OS X installer now installs pip by default.
+
+- Update third-party libraries for OS X installers: xz 5.0.3 -> 5.0.5,
+  SQLite 3.7.13 -> 3.8.1
+
+- Issue #15663: Revert OS X installer built-in Tcl/Tk support for 3.4.0b1.
+  Some third-party projects, such as Matplotlib and PIL/Pillow,
+  depended on being able to build with Tcl and Tk frameworks in
+  /Library/Frameworks.
+
+Tools/Demos
+-----------
+
+- Issue #19730: Argument Clinic now supports all the existing PyArg
+  "format units" as legacy converters, as well as two new features:
+  "self converters" and the "version" directive.
+
+- Issue #19552: pyvenv now bootstraps pip into virtual environments by
+  default (pass --without-pip to request the old behaviour)
+
+- Issue #19390: Argument Clinic no longer accepts malformed Python
+  and C ids.
+
+What's New in Python 3.4.0 Alpha 4?
+===================================
+
+Release date: 2013-10-20
+
+Core and Builtins
+-----------------
+
+- Issue #19301: Give classes and functions that are explicitly marked global a
+  global qualname.
+
+- Issue #19279: UTF-7 decoder no longer produces illegal strings.
+
+- Issue #16612: Add "Argument Clinic", a compile-time preprocessor for
+  C files to generate argument parsing code.  (See PEP 436.)
+
+- Issue #18810: Shift stat calls in importlib.machinery.FileFinder such that
+  the code is optimistic that if something exists in a directory named exactly
+  like the possible package being searched for that it's in actuality a
+  directory.
+
+- Issue #18416: importlib.machinery.PathFinder now treats '' as the cwd and
+  importlib.machinery.FileFinder no longer special-cases '' to '.'. This leads
+  to modules imported from cwd to now possess an absolute file path for
+  __file__ (this does not affect modules specified by path on the CLI but it
+  does affect -m/runpy). It also allows FileFinder to be more consistent by not
+  having an edge case.
+
+- Issue #4555: All exported C symbols are now prefixed with either
+  "Py" or "_Py".
+
+- Issue #19219: Speed up marshal.loads(), and make pyc files slightly
+  (5% to 10%) smaller.
+
+- Issue #19221: Upgrade Unicode database to version 6.3.0.
+
+- Issue #16742: The result of the C callback PyOS_ReadlineFunctionPointer must
+  now be a string allocated by PyMem_RawMalloc() or PyMem_RawRealloc() (or NULL
+  if an error occurred), instead of a string allocated by PyMem_Malloc() or
+  PyMem_Realloc().
+
+- Issue #19199: Remove ``PyThreadState.tick_counter`` field
+
+- Fix macro expansion of _PyErr_OCCURRED(), and make sure to use it in at
+  least one place so as to avoid regressions.
+
+- Issue #19087: Improve bytearray allocation in order to allow cheap popping
+  of data at the front (slice deletion).
+
+- Issue #19014: memoryview.cast() is now allowed on zero-length views.
+
+- Issue #18690: memoryview is now automatically registered with
+  collections.abc.Sequence
+
+- Issue #19078: memoryview now correctly supports the reversed builtin
+  (Patch by Claudiu Popa)
+
+Library
+-------
+
+- Issue #17457: unittest test discovery now works with namespace packages.
+  Patch by Claudiu Popa.
+
 - Issue #18235: Fix the sysconfig variables LDSHARED and BLDSHARED under AIX.
   Patch by David Edelsohn.
 
+- Issue #18606: Add the new "statistics" module (PEP 450).  Contributed
+  by Steven D'Aprano.
+
+- Issue #12866: The audioop module now supports 24-bit samples.
+
+- Issue #19254: Provide an optimized Python implementation of pbkdf2_hmac.
+
+- Issues #19201, Issue #19222, Issue #19223: Add "x" mode (exclusive creation)
+  in opening file to bz2, gzip and lzma modules. Patches by Tim Heaney and
+  Vajrasky Kok.
+
+- Fix a reference count leak in _sre.
+
+- Issue #19262: Initial check in of the 'asyncio' package (a.k.a. Tulip,
+  a.k.a. PEP 3156).  There are no docs yet, and the PEP is slightly
+  out of date with the code.  This module will have *provisional* status
+  in Python 3.4.
+
 - Issue #19276: Fixed the wave module on 64-bit big-endian platforms.
 
+- Issue #19266: Rename the new-in-3.4 ``contextlib.ignore`` context manager
+  to ``contextlib.suppress`` in order to be more consistent with existing
+  descriptions of that operation elsewhere in the language and standard
+  library documentation (Patch by Zero Piraeus).
+
+- Issue #18891: Completed the new email package (provisional) API additions
+  by adding new classes EmailMessage, MIMEPart, and ContentManager.
+
+- Issue #18281: Unused stat constants removed from `tarfile`.
+
+- Issue #18999: Multiprocessing now supports 'contexts' with the same API
+  as the module, but bound to specified start methods.
+
+- Issue #18468: The re.split, re.findall, and re.sub functions and the group()
+  and groups() methods of match object now always return a string or a bytes
+  object.
+
+- Issue #18725: The textwrap module now supports truncating multiline text.
+
 - Issue #18776: atexit callbacks now display their full traceback when they
   raise an exception.
 
 - Issue #17827: Add the missing documentation for ``codecs.encode`` and
   ``codecs.decode``.
 
-- Issue #18458: Prevent crashes with newer versions of libedit.  Its readline
-  emulation has changed from 0-based indexing to 1-based like gnu readline.
-  Original patch by Ronald Oussoren.
+- Issue #19218: Rename collections.abc to _collections_abc in order to
+  speed up interpreter start.
 
-- Issue #18919: If the close() method of a writer in the sunau or wave module
-  failed, second invocation of close() and destructor no more raise an
-  exception.
+- Issue #18582: Add 'pbkdf2_hmac' to the hashlib module. It implements PKCS#5
+  password-based key derivation functions with HMAC as pseudorandom function.
 
 - Issue #19131: The aifc module now correctly reads and writes sampwidth of
   compressed streams.
 
+- Issue #19209: Remove import of copyreg from the os module to speed up
+  interpreter startup. stat_result and statvfs_result are now hard-coded to
+  reside in the os module.
+
+- Issue #19205: Don't import the 're' module in site and sysconfig module to
+  speed up interpreter start.
+
+- Issue #9548: Add a minimal "_bootlocale" module that is imported by the
+  _io module instead of the full locale module.
+
+- Issue #18764: remove the 'print' alias for the PDB 'p' command so that it no
+  longer shadows the print function.
+
 - Issue #19158:  a rare race in BoundedSemaphore could allow .release() too
   often.
 
+- Issue #15805: Add contextlib.redirect_stdout().
+
+- Issue #18716: Deprecate the formatter module.
+
+- Issue #10712: 2to3 has a new "asserts" fixer that replaces deprecated names
+  of unittest methods (e.g. failUnlessEqual -> assertEqual).
+
 - Issue #18037: 2to3 now escapes '\u' and '\U' in native strings.
 
+- Issue #17839: base64.decodebytes and base64.encodebytes now accept any
+  object that exports a 1 dimensional array of bytes (this means the same
+  is now also true for base64_codec)
+
+- Issue #19132: The pprint module now supports compact mode.
+
 - Issue #19137: The pprint module now correctly formats instances of set and
   frozenset subclasses.
 
+- Issue #10042: functools.total_ordering now correctly handles
+  NotImplemented being returned by the underlying comparison function (Patch
+  by Katie Miller)
+
 - Issue #19092: contextlib.ExitStack now correctly reraises exceptions
   from the __exit__ callbacks of inner context managers (Patch by Hrvoje
   Nikšić)
@@ -904,15 +2881,89 @@
 - Issue #12641: Avoid passing "-mno-cygwin" to the mingw32 compiler, except
   when necessary.  Patch by Oscar Benjamin.
 
-- Issue #18594: The fast path for collections.Counter() was never taken
-  due to an over-restrictive type check.  And the fallback path did
-  not implement the same algorithm as the pure python code.
+- Issue #5845: In site.py, only load readline history from ~/.python_history
+  if no history has been read already.  This avoids double writes to the
+  history file at shutdown.
 
 - Properly initialize all fields of a SSL object after allocation.
 
+- Issue #19095: SSLSocket.getpeercert() now raises ValueError when the
+  SSL handshake hasn't been done.
+
 - Issue #4366: Fix building extensions on all platforms when --enable-shared
   is used.
 
+- Issue #19030: Fixed `inspect.getmembers` and `inspect.classify_class_attrs`
+  to attempt activating descriptors before falling back to a __dict__ search
+  for faulty descriptors.  `inspect.classify_class_attrs` no longer returns
+  Attributes whose home class is None.
+
+C API
+-----
+
+- Issue #1772673: The type of `char*` arguments now changed to `const char*`.
+
+- Issue #16129: Added a `Py_SetStandardStreamEncoding` pre-initialization API
+  to allow embedding applications like Blender to force a particular
+  encoding and error handler for the standard IO streams (initial patch by
+  Bastien Montagne)
+
+Tests
+-----
+
+- Issue #19275: Fix test_site on AMD64 Snow Leopard
+
+- Issue #14407: Fix unittest test discovery in test_concurrent_futures.
+
+- Issue #18919: Unified and extended tests for audio modules: aifc, sunau and
+  wave.
+
+- Issue #18714: Added tests for ``pdb.find_function()``.
+
+Documentation
+-------------
+
+- Issue #18758: Fixed and improved cross-references.
+
+- Issue #18972: Modernize email examples and use the argparse module in them.
+
+Build
+-----
+
+- Issue #19130: Correct PCbuild/readme.txt, Python 3.3 and 3.4 require VS 2010.
+
+- Issue #15663: Update OS X 10.6+ installer to use Tcl/Tk 8.5.15.
+
+- Issue #14499: Fix several problems with OS X universal build support:
+    1. ppc arch detection for extension module builds broke with Xcode 5
+    2. ppc arch detection in configure did not work on OS X 10.4
+    3. -sysroot and -arch flags were unnecessarily duplicated
+    4. there was no obvious way to configure an intel-32 only build.
+
+- Issue #19019: Change the OS X installer build script to use CFLAGS instead
+  of OPT for special build options.  By setting OPT, some compiler-specific
+  options like -fwrapv were overridden and thus not used, which could result
+  in broken interpreters when building with clang.
+
+What's New in Python 3.4.0 Alpha 3?
+===================================
+
+Release date: 2013-09-29
+
+Core and Builtins
+-----------------
+
+- Issue #18818: The "encodingname" part of PYTHONIOENCODING is now optional.
+
+- Issue #19098: Prevent overflow in the compiler when the recursion limit is set
+  absurdly high.
+
+Library
+-------
+
+- Issue #18929: `inspect.classify_class_attrs()` now correctly finds class
+  attributes returned by `dir()` that are located in the metaclass.
+
 - Issue #18950: Fix miscellaneous bugs in the sunau module.
   Au_read.readframes() now updates current file position and reads correct
   number of frames from multichannel stream.  Au_write.writeframesraw() now
@@ -920,17 +2971,29 @@
   integer (as in Python 2).  Au_read and Au_write now correctly works with file
   object if start file position is not a zero.
 
+- Issue #18594: The fast path for collections.Counter() was never taken
+  due to an over-restrictive type check.
+
 - Issue #19053: ZipExtFile.read1() with non-zero argument no more returns empty
   bytes until end of data.
 
-- Issue #19028: Fixed tkinter.Tkapp.merge() for non-string arguments.
+- logging: added support for Unix domain sockets to SocketHandler and
+  DatagramHandler.
+
+- Issue #18996: TestCase.assertEqual() now more cleverly shorten differing
+  strings in error report.
+
+- Issue #19034: repr() for tkinter.Tcl_Obj now exposes string reperesentation.
+
+- Issue #18978: ``urllib.request.Request`` now allows the method to be
+  indicated on the class and no longer sets it to None in ``__init__``.
+
+- Issue #18626: the inspect module now offers a basic command line
+  introspection interface (Initial patch by Claudiu Popa)
 
 - Issue #3015: Fixed tkinter with wantobject=False.  Any Tcl command call
   returned empty string.
 
-- Issue #18050: Fixed an incompatibility of the re module with Python 3.3.0
-  binaries.
-
 - Issue #19037: The mailbox module now makes all changes to maildir files
   before moving them into place, to avoid race conditions with other programs
   that may be accessing the maildir directory.
@@ -944,42 +3007,181 @@
 - Issue #18873: The tokenize module now detects Python source code encoding
   only in comment lines.
 
+- Issue #17764: Enable http.server to bind to a user specified network
+  interface.  Patch contributed by Malte Swart.
+
+- Issue #18937: Add an assertLogs() context manager to unittest.TestCase
+  to ensure that a block of code emits a message using the logging module.
+
 - Issue #17324: Fix http.server's request handling case on trailing '/'. Patch
   contributed by Vajrasky Kok.
 
 - Issue #19018: The heapq.merge() function no longer suppresses IndexError
   in the underlying iterables.
 
-- Issue #18784: The uuid module no more attempts to load libc via ctypes.CDLL,
-  if all necessary functions are already found in libuuid.
-  Patch by Evgeny Sologubov.
+- Issue #18784: The uuid module no longer attempts to load libc via ctypes.CDLL
+  if all the necessary functions have already been found in libuuid.  Patch by
+  Evgeny Sologubov.
+
+- The :envvar:`PYTHONFAULTHANDLER` environment variable now only enables the
+  faulthandler module if the variable is non-empty. Same behaviour than other
+  variables like :envvar:`PYTHONDONTWRITEBYTECODE`.
+
+- Issue #1565525: New function ``traceback.clear_frames`` will clear
+  the local variables of all the stack frames referenced by a traceback
+  object.
+
+Tests
+-----
+
+- Issue #18952: Fix regression in support data downloads introduced when
+  test.support was converted to a package. Regression noticed by Zachary
+  Ware.
+
+IDLE
+----
+
+- Issue #18873: IDLE now detects Python source code encoding only in comment
+  lines.
+
+- Issue #18988: The "Tab" key now works when a word is already autocompleted.
+
+Documentation
+-------------
+
+- Issue #17003: Unified the size argument names in the io module with common
+  practice.
+
+Build
+-----
+
+- Issue #18596: Support the use of address sanity checking in recent versions
+  of clang and GCC by appropriately marking known false alarms in the small
+  object allocator. Patch contributed by Dhiru Kholia.
+
+Tools/Demos
+-----------
+
+- Issue #18873: 2to3 and the findnocoding.py script now detect Python source
+  code encoding only in comment lines.
+
+
+What's New in Python 3.4.0 Alpha 2?
+===================================
+
+Release date: 2013-09-09
+
+Core and Builtins
+-----------------
+
+- Issue #18942: sys._debugmallocstats() output was damaged on Windows.
+
+- Issue #18571: Implementation of the PEP 446: file descriptors and file
+  handles are now created non-inheritable; add functions
+  os.get/set_inheritable(), os.get/set_handle_inheritable() and
+  socket.socket.get/set_inheritable().
+
+- Issue #11619: The parser and the import machinery do not encode Unicode
+  filenames anymore on Windows.
+
+- Issue #18808: Non-daemon threads are now automatically joined when
+  a sub-interpreter is shutdown (it would previously dump a fatal error).
+
+- Remove support for compiling on systems without getcwd().
+
+- Issue #18774: Remove last bits of GNU PTH thread code and thread_pth.h.
+
+- Issue #18771: Add optimization to set object lookups to reduce the cost
+  of hash collisions.  The core idea is to inspect a second key/hash pair
+  for each cache line retrieved.
+
+- Issue #16105: When a signal handler fails to write to the file descriptor
+  registered with ``signal.set_wakeup_fd()``, report an exception instead
+  of ignoring the error.
+
+- Issue #18722: Remove uses of the "register" keyword in C code.
+
+- Issue #18667: Add missing "HAVE_FCHOWNAT" symbol to posix._have_functions.
+
+- Issue #16499: Add command line option for isolated mode.
+
+- Issue #15301: Parsing fd, uid, and gid parameters for builtins
+  in Modules/posixmodule.c is now far more robust.
+
+- Issue #18368: PyOS_StdioReadline() no longer leaks memory when realloc()
+  fail.
+
+- Issue #17934: Add a clear() method to frame objects, to help clean up
+  expensive details (local variables) and break reference cycles.
+
+- Issue #18780: %-formatting codes %d, %i, and %u now treat int-subclasses
+  as int (displays value of int-subclass instead of str(int-subclass) ).
+
+Library
+-------
+
+- Issue #18808: Thread.join() now waits for the underlying thread state to
+  be destroyed before returning.  This prevents unpredictable aborts in
+  Py_EndInterpreter() when some non-daemon threads are still running.
+
+- Issue #18458: Prevent crashes with newer versions of libedit.  Its readline
+  emulation has changed from 0-based indexing to 1-based like gnu readline.
+
+- Issue #18852: Handle case of ``readline.__doc__`` being ``None`` in the new
+  readline activation code in ``site.py``.
 
 - Issue #18672: Fixed format specifiers for Py_ssize_t in debugging output in
   the _sre module.
 
-- Issue #18830: inspect.getclasstree() no more produces duplicated entries even
+- Issue #18830: inspect.getclasstree() no longer produces duplicate entries even
   when input list contains duplicates.
 
+- Issue #18878: sunau.open now supports the context management protocol.  Based on
+  patches by Claudiu Popa and R. David Murray.
+
 - Issue #18909: Fix _tkinter.tkapp.interpaddr() on Windows 64-bit, don't cast
   64-bit pointer to long (32 bits).
 
 - Issue #18876: The FileIO.mode attribute now better reflects the actual mode
   under which the file was opened.  Patch by Erik Bray.
 
+- Issue #16853: Add new selectors module.
+
+- Issue #18882: Add threading.main_thread() function.
+
+- Issue #18901: The sunau getparams method now returns a namedtuple rather than
+  a plain tuple.  Patch by Claudiu Popa.
+
+- Issue #17487: The result of the wave getparams method now is pickleable again.
+  Patch by Claudiu Popa.
+
+- Issue #18756: os.urandom() now uses a lazily-opened persistent file
+  descriptor, so as to avoid using many file descriptors when run in
+  parallel from multiple threads.
+
 - Issue #18418: After fork(), reinit all threads states, not only active ones.
   Patch by A. Jesse Jiryu Davis.
 
+- Issue #17974: Switch unittest from using getopt to using argparse.
+
+- Issue #11798: TestSuite now drops references to own tests after execution.
+
 - Issue #16611: http.cookie now correctly parses the 'secure' and 'httponly'
   cookie flags.
 
 - Issue #11973: Fix a problem in kevent. The flags and fflags fields are now
   properly handled as unsigned.
 
-- Issue #17702: On error, os.environb now removes suppress the except context
-  when raising a new KeyError with the original key.
+- Issue #18807: ``pyvenv`` now takes a --copies argument allowing copies
+  instead of symlinks even where symlinks are available and the default.
 
-- Issue #18755: Fixed the loader used in imp to allow get_data() to be called
-  multiple times.
+- Issue #18538: ``python -m dis`` now uses argparse for argument processing.
+  Patch by Michele Orrù.
+
+- Issue #18394: Close cgi.FieldStorage's optional file.
+
+- Issue #17702: On error, os.environb now suppresses the exception context
+  when raising a new KeyError with the original key.
 
 - Issue #16809: Fixed some tkinter incompabilities with Tcl/Tk 8.6.
 
@@ -989,6 +3191,9 @@
 - Issue #18324: set_payload now correctly handles binary input.  This also
   supersedes the previous fixes for #14360, #1717, and #16564.
 
+- Issue #18794: Add a fileno() method and a closed attribute to select.devpoll
+  objects.
+
 - Issue #17119: Fixed integer overflows when processing large strings and tuples
   in the tkinter module.
 
@@ -999,9 +3204,6 @@
 - Issue #8865: Concurrent invocation of select.poll.poll() now raises a
   RuntimeError exception.  Patch by Christian Schubert.
 
-- Issue #13461: Fix a crash in the TextIOWrapper.tell method on 64-bit
-  platforms.  Patch by Yogesh Chaudhari.
-
 - Issue #18777: The ssl module now uses the new CRYPTO_THREADID API of
   OpenSSL 1.0.0+ instead of the deprecated CRYPTO id callback function.
 
@@ -1016,50 +3218,611 @@
   strings for ``rfc822Name`` (email), ``dNSName`` (DNS) and
   ``uniformResourceIdentifier`` (URI).
 
+- Issue #18701: Remove support of old CPython versions (<3.0) from C code.
+
 - Issue #18756: Improve error reporting in os.urandom() when the failure
   is due to something else than /dev/urandom not existing (for example,
   exhausting the file descriptor limit).
 
+- Issue #18673: Add O_TMPFILE to os module. O_TMPFILE requires Linux kernel
+  3.11 or newer. It's only defined on system with 3.11 uapi headers, too.
+
+- Issue #18532: Change the builtin hash algorithms' names to lower case names
+  as promised by hashlib's documentation.
+
+- Issue #8713: add new spwan and forkserver start methods, and new functions
+  get_all_start_methods, get_start_method, and set_start_method, to
+  multiprocessing.
+
 - Issue #18405: Improve the entropy of crypt.mksalt().
 
+- Issue #12015: The tempfile module now uses a suffix of 8 random characters
+  instead of 6, to reduce the risk of filename collision. The entropy was
+  reduced when uppercase letters were removed from the charset used to generate
+  random characters.
+
+- Issue #18585: Add :func:`textwrap.shorten` to collapse and truncate a
+  piece of text to a given length.
+
+- Issue #18598: Tweak exception message for importlib.import_module() to
+  include the module name when a key argument is missing.
+
 - Issue #19151: Fix docstring and use of _get_supported_file_loaders() to
   reflect 2-tuples.
 
+- Issue #19152: Add ExtensionFileLoader.get_filename().
+
 - Issue #18676: Change 'positive' to 'non-negative' in queue.py put and get
   docstrings and ValueError messages. Patch by Zhongyue Luo
 
-- Issue #18681: Fix a NameError in imp.reload() (noticed by Weizhao Li).
+- Fix refcounting issue with extension types in tkinter.
 
 - Issue #8112: xlmrpc.server's DocXMLRPCServer server no longer raises an error
   if methods have annotations; it now correctly displays the annotations.
 
+- Issue #18600: Added policy argument to email.message.Message.as_string,
+  and as_bytes and __bytes__ methods to Message.
+
+- Issue #18671: Output more information when logging exceptions occur.
+
+- Issue #18621: Prevent the site module's patched builtins from keeping
+  too many references alive for too long.
+
+- Issue #4885: Add weakref support to mmap objects.  Patch by Valerie Lambert.
+
+- Issue #8860: Fixed rounding in timedelta constructor.
+
+- Issue #18849: Fixed a Windows-specific tempfile bug where collision with an
+  existing directory caused mkstemp and related APIs to fail instead of
+  retrying. Report and fix by Vlad Shcherbina.
+
+- Issue #18920: argparse's default destination for the version action (-v,
+  --version) has also been changed to stdout, to match the Python executable.
+
+Tests
+-----
+
+- Issue #18623: Factor out the _SuppressCoreFiles context manager into
+  test.support.  Patch by Valerie Lambert.
+
+- Issue #12037: Fix test_email for desktop Windows.
+
+- Issue #15507: test_subprocess's test_send_signal could fail if the test
+  runner were run in an environment where the process inherited an ignore
+  setting for SIGINT.  Restore the SIGINT handler to the desired
+  KeyboardInterrupt raising one during that test.
+
+- Issue #16799: Switched from getopt to argparse style in regrtest's argument
+  parsing.  Added more tests for regrtest's argument parsing.
+
+- Issue #18792: Use "127.0.0.1" or "::1" instead of "localhost" as much as
+  possible, since "localhost" goes through a DNS lookup under recent Windows
+  versions.
+
+IDLE
+----
+
+- Issue #18489: Add tests for SearchEngine. Original patch by Phil Webster.
+
+Documentation
+-------------
+
+- Issue #18743: Fix references to non-existant "StringIO" module.
+
+- Issue #18783: Removed existing mentions of Python long type in docstrings,
+  error messages and comments.
+
+Build
+-----
+
+- Issue #1584: Provide configure options to override default search paths for
+  Tcl and Tk when building _tkinter.
+
+- Issue #15663: Tcl/Tk 8.5.14 is now included with the OS X 10.6+ 64-/32-bit
+  installer.  It is no longer necessary to install a third-party version of
+  Tcl/Tk 8.5 to work around the problems in the Apple-supplied Tcl/Tk 8.5
+  shipped in OS X 10.6 and later releases.
+
+Tools/Demos
+-----------
+
+- Issue #18922: Now The Lib/smtpd.py and Tools/i18n/msgfmt.py scripts write
+  their version strings to stdout, and not to sderr.
+
+What's New in Python 3.4.0 Alpha 1?
+===================================
+
+Release date: 2013-08-03
+
+Core and Builtins
+-----------------
+
+- Issue #16741: Fix an error reporting in int().
+
+- Issue #17899: Fix rare file descriptor leak in os.listdir().
+
+- Issue #10241: Clear extension module dict copies at interpreter shutdown.
+  Patch by Neil Schemenauer, minimally modified.
+
+- Issue #9035: ismount now recognises volumes mounted below a drive root
+  on Windows. Original patch by Atsuo Ishimoto.
+
+- Issue #18214: Improve finalization of Python modules to avoid setting
+  their globals to None, in most cases.
+
+- Issue #18112: PEP 442 implementation (safe object finalization).
+
+- Issue #18552: Check return value of PyArena_AddPyObject() in
+  obj2ast_object().
+
+- Issue #18560: Fix potential NULL pointer dereference in sum().
+
+- Issue #18520: Add a new PyStructSequence_InitType2() function, same than
+  PyStructSequence_InitType() except that it has a return value (0 on success,
+  -1 on error).
+
+- Issue #15905: Fix theoretical buffer overflow in handling of sys.argv[0],
+  prefix and exec_prefix if the operation system does not obey MAXPATHLEN.
+
+- Issue #18408: Fix many various bugs in code handling errors, especially
+  on memory allocation failure (MemoryError).
+
+- Issue #18344: Fix potential ref-leaks in _bufferedreader_read_all().
+
+- Issue #18342: Use the repr of a module name when an import fails when using
+  ``from ... import ...``.
+
+- Issue #17872: Fix a segfault in marshal.load() when input stream returns
+  more bytes than requested.
+
+- Issue #18338: `python --version` now prints version string to stdout, and
+  not to stderr.  Patch by Berker Peksag and Michael Dickens.
+
+- Issue #18426: Fix NULL pointer dereference in C extension import when
+  PyModule_GetDef() returns an error.
+
+- Issue #17206: On Windows, increase the stack size from 2 MB to 4.2 MB to fix
+  a stack overflow in the marshal module (fix a crash in test_marshal).
+  Patch written by Jeremy Kloth.
+
+- Issue #3329: Implement the PEP 445: Add new APIs to customize Python memory
+  allocators.
+
+- Issue #18328: Reorder ops in PyThreadState_Delete*() functions. Now the
+  tstate is first removed from TLS and then deallocated.
+
+- Issue #13483: Use VirtualAlloc in obmalloc on Windows.
+
+- Issue #18184: PyUnicode_FromFormat() and PyUnicode_FromFormatV() now raise
+  OverflowError when an argument of %c format is out of range.
+
+- Issue #18111: The min() and max() functions now support a default argument
+  to be returned instead of raising a ValueError on an empty sequence.
+  (Contributed by Julian Berman.)
+
+- Issue #18137: Detect integer overflow on precision in float.__format__()
+  and complex.__format__().
+
+- Issue #18183: Fix various unicode operations on strings with large unicode
+  codepoints.
+
+- Issue #18180: Fix ref leak in _PyImport_GetDynLoadWindows().
+
+- Issue #18038: SyntaxError raised during compilation sources with illegal
+  encoding now always contains an encoding name.
+
+- Issue #17931: Resolve confusion on Windows between pids and process
+  handles.
+
+- Tweak the exception message when the magic number or size value in a bytecode
+  file is truncated.
+
+- Issue #17932: Fix an integer overflow issue on Windows 64-bit in iterators:
+  change the C type of seqiterobject.it_index from long to Py_ssize_t.
+
+- Issue #18065: Don't set __path__ to the package name for frozen packages.
+
+- Issue #18088: When reloading a module, unconditionally reset all relevant
+  attributes on the module (e.g. __name__, __loader__, __package__, __file__,
+  __cached__).
+
+- Issue #17937: Try harder to collect cyclic garbage at shutdown.
+
+- Issue #12370: Prevent class bodies from interfering with the __class__
+  closure.
+
+- Issue #17644: Fix a crash in str.format when curly braces are used in square
+  brackets.
+
+- Issue #17237: Fix crash in the ASCII decoder on m68k.
+
+- Issue #17927: Frame objects kept arguments alive if they had been
+  copied into a cell, even if the cell was cleared.
+
+- Issue #1545463: At shutdown, defer finalization of codec modules so
+  that stderr remains usable.
+
+- Issue #7330: Implement width and precision (ex: "%5.3s") for the format
+  string of PyUnicode_FromFormat() function, original patch written by Ysj Ray.
+
+- Issue #1545463: Global variables caught in reference cycles are now
+  garbage-collected at shutdown.
+
+- Issue #17094: Clear stale thread states after fork().  Note that this
+  is a potentially disruptive change since it may release some system
+  resources which would otherwise remain perpetually alive (e.g. database
+  connections kept in thread-local storage).
+
+- Issue #17408: Avoid using an obsolete instance of the copyreg module when
+  the interpreter is shutdown and then started again.
+
+- Issue #5845: Enable tab-completion in the interactive interpreter by
+  default, thanks to a new sys.__interactivehook__.
+
+- Issue #17115,17116: Module initialization now includes setting __package__ and
+  __loader__ attributes to None.
+
+- Issue #17853: Ensure locals of a class that shadow free variables always win
+  over the closures.
+
+- Issue #17863: In the interactive console, don't loop forever if the encoding
+  can't be fetched from stdin.
+
+- Issue #17867: Raise an ImportError if __import__ is not found in __builtins__.
+
+- Issue #18698: Ensure importlib.reload() returns the module out of sys.modules.
+
+- Issue #17857: Prevent build failures with pre-3.5.0 versions of sqlite3,
+  such as was shipped with Centos 5 and Mac OS X 10.4.
+
+- Issue #17413: sys.settrace callbacks were being passed a string instead of an
+  exception instance for the 'value' element of the arg tuple if the exception
+  originated from C code; now an exception instance is always provided.
+
+- Issue #17782: Fix undefined behaviour on platforms where
+  ``struct timespec``'s "tv_nsec" member is not a C long.
+
+- Issue #17722: When looking up __round__, resolve descriptors.
+
+- Issue #16061: Speed up str.replace() for replacing 1-character strings.
+
+- Issue #17715: Fix segmentation fault from raising an exception in a __trunc__
+  method.
+
+- Issue #17643: Add __callback__ attribute to weakref.ref.
+
+- Issue #16447: Fixed potential segmentation fault when setting __name__ on a
+  class.
+
+- Issue #17669: Fix crash involving finalization of generators using yield from.
+
+- Issue #14439: Python now prints the traceback on runpy failure at startup.
+
+- Issue #17469: Fix _Py_GetAllocatedBlocks() and sys.getallocatedblocks()
+  when running on valgrind.
+
+- Issue #17619: Make input() check for Ctrl-C correctly on Windows.
+
+- Issue #17357: Add missing verbosity messages for -v/-vv that were lost during
+  the importlib transition.
+
+- Issue #17610: Don't rely on non-standard behavior of the C qsort() function.
+
+- Issue #17323: The "[X refs, Y blocks]" printed by debug builds has been
+  disabled by default.  It can be re-enabled with the `-X showrefcount` option.
+
+- Issue #17328: Fix possible refleak in dict.setdefault.
+
+- Issue #17275: Corrected class name in init error messages of the C version of
+  BufferedWriter and BufferedRandom.
+
+- Issue #7963: Fixed misleading error message that issued when object is
+  called without arguments.
+
+- Issue #8745: Small speed up zipimport on Windows. Patch by Catalin Iacob.
+
+- 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 #16967: In function definition, evaluate positional defaults before
+  keyword-only defaults.
+
+- 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 #16772: The base argument to the int constructor no longer accepts
+  floats, or other non-integer objects with an __int__ method.  Objects
+  with an __index__ method are now accepted.
+
+- 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 #16613: Add *m* argument to ``collections.Chainmap.new_child`` to
+  allow the new child map to be specified explicitly.
+
+- 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 #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 #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 #11939: Set the st_dev attribute of stat_result to allow Windows to
+  take advantage of the os.path.samefile/sameopenfile/samestat implementations
+  used by other platforms.
+
+- Issue #16772: The int() constructor's second argument (base) no longer
+  accepts non integer values.  Consistent with the behavior in Python 2.
+
+- Issue #14470: Remove w9xpopen support per PEP 11.
+
+- Issue #9856: Replace deprecation warning with raising TypeError
+  in object.__format__. Patch by Florent Xicluna.
+
+- 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 #16421: loading multiple modules from one shared object is now
+  handled correctly (previously, the first module loaded from that file
+  was silently returned). Patch by Václav Šmilauer.
+
+- 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 #16495: Remove extraneous NULL encoding check from bytes_decode().
+
+- Issue #16619: Create NameConstant AST class to represent None, True, and False
+  literals. As a result, these constants are never loaded at runtime from
+  builtins.
+
+- 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 announce an
+  ASCII locale encoding, but actually use the ISO-8859-1 encoding in practice.
+
+- Issue #16562: Optimize dict equality testing.  Patch by Serhiy Storchaka.
+
+- Issue #16588: Silence unused-but-set warnings in Python/thread_pthread
+
+- Issue #16592: stringlib_bytes_join doesn't raise MemoryError on allocation
+  failure.
+
+- 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 #16290: A float return value from the __complex__ special method is no
+  longer accepted in the complex() constructor.
+
+- 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 #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 #14794: Fix slice.indices to return correct results for huge values,
+  rather than raising OverflowError.
+
+- 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.
+
+- Issue #7317: Display full tracebacks when an error occurs asynchronously.
+  Patch by Alon Horev with update by Alexey Kachayev.
+
+- Issue #16309: Make PYTHONPATH="" behavior the same as if PYTHONPATH
+  not set at all.
+
+- Issue #10189: Improve the error reporting of SyntaxErrors related to global
+  and nonlocal statements.
+
+- Fix segfaults on setting __qualname__ on builtin types and attempting to
+  delete it on any type.
+
+- Issue #14625: Rewrite the UTF-32 decoder. It is now 3x to 4x faster. Patch
+  written by Serhiy Storchaka.
+
+- 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 #12805: Make bytes.join and bytearray.join faster when the separator
+  is empty.  Patch by Serhiy Storchaka.
+
+- 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 #15958: bytes.join and bytearray.join now accept arbitrary buffer
+  objects.
+
+- 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 #16148: Implement PEP 424, adding operator.length_hint and
+  PyObject_LengthHint.
+
+- Upgrade Unicode data (UCD) to version 6.2.
+
+- 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 #15448: Buffered IO now frees the buffer when closed, instead
+  of when deallocating.
+
+- Issue #15846: Fix SystemError which happened when using `ast.parse()` in an
+  exception handler on code with syntax errors.
+
+- Issue #15897: zipimport.c doesn't check return value of fseek().
+  Patch by Felipe Cruz.
+
+- Issue #15801: Make sure mappings passed to '%' formatting are actually
+  subscriptable.
+
+- Issue #15111: __import__ should propagate ImportError when raised as a
+  side-effect of a module triggered from using fromlist.
+
+- Issue #15022: Add pickle and comparison support to types.SimpleNamespace.
+
+Library
+-------
+
+- Issue #4331: Added functools.partialmethod (Initial patch by Alon Horev)
+
+- Issue #13461: Fix a crash in the TextIOWrapper.tell method on 64-bit
+  platforms.  Patch by Yogesh Chaudhari.
+
+- Issue #18681: Fix a NameError in importlib.reload() (noticed by Weizhao Li).
+
+- Issue #14323: Expanded the number of digits in the coefficients for the
+  RGB -- YIQ conversions so that they match the FCC NTSC versions.
+
 - Issue #17998: Fix an internal error in regular expression engine.
 
 - Issue #17557: Fix os.getgroups() to work with the modified behavior of
   getgroups(2) on OS X 10.8.  Original patch by Mateusz Lenik.
 
+- Issue #18608: Avoid keeping a strong reference to the locale module
+  inside the _io module.
+
+- Issue #18619: Fix atexit leaking callbacks registered from sub-interpreters,
+  and make it GC-aware.
+
+- Issue #15699: The readline module now uses PEP 3121-style module
+  initialization, so as to reclaim allocated resources (Python callbacks)
+  at shutdown.  Original patch by Robin Schreiber.
+
+- Issue #17616: wave.open now supports the context management protocol.
+
 - Issue #18599: Fix name attribute of _sha1.sha1() object. It now returns
   'SHA1' instead of 'SHA'.
 
+- Issue #13266: Added inspect.unwrap to easily unravel __wrapped__ chains
+  (initial patch by Daniel Urban and Aaron Iles)
+
 - Issue #18561: Skip name in ctypes' _build_callargs() if name is NULL.
 
 - Issue #18559: Fix NULL pointer dereference error in _pickle module
 
-- Issue #18556: Check the return value of a PyUnicode_AsWideChar() call in
-  ctypes' U_set().
+- Issue #18556: Check the return type of PyUnicode_AsWideChar() in ctype's
+  U_set().
+
+- Issue #17818: aifc.getparams now returns a namedtuple.
 
 - Issue #18549: Eliminate dead code in socket_ntohl()
 
+- Issue #18530: Remove additional stat call from posixpath.ismount.
+  Patch by Alex Gaynor.
+
 - Issue #18514: Fix unreachable Py_DECREF() call in PyCData_FromBaseObj()
 
+- Issue #9177: Calling read() or write() now raises ValueError, not
+  AttributeError, on a closed SSL socket.  Patch by Senko Rasic.
+
 - Issue #18513: Fix behaviour of cmath.rect w.r.t. signed zeros on OS X 10.8 +
   gcc.
 
+- Issue #18479: Changed venv Activate.ps1 to make deactivate a function, and
+  removed Deactivate.ps1.
+
 - Issue #18480: Add missing call to PyType_Ready to the _elementtree extension.
 
 - Issue #17778: Fix test discovery for test_multiprocessing. (Patch by
   Zachary Ware.)
 
+- Issue #18393: The private module _gestalt and private functions
+  platform._mac_ver_gestalt, platform._mac_ver_lookup and
+  platform._bcd2str have been removed. This does not affect the public
+  interface of the platform module.
+
+- Issue #17482: functools.update_wrapper (and functools.wraps) now set the
+  __wrapped__ attribute correctly even if the underlying function has a
+  __wrapped__ attribute set.
+
 - Issue #18431: The new email header parser now decodes RFC2047 encoded words
   in structured headers.
 
@@ -1073,11 +3836,19 @@
 - Issue #18101: Tcl.split() now process strings nested in a tuple as it
   do with byte strings.
 
+- Issue #18116: getpass was always getting an error when testing /dev/tty,
+  and thus was always falling back to stdin, and would then raise an exception
+  if stdin could not be used (such as /dev/null).  It also leaked an open file.
+  All of these issues are now fixed.
+
 - Issue #17198: Fix a NameError in the dbm module.  Patch by Valentina
   Mukhamedzhanova.
 
 - Issue #18013: Fix cgi.FieldStorage to parse the W3C sample form.
 
+- Issue #18020: improve html.escape speed by an order of magnitude.
+  Patch by Matt Bryant.
+
 - Issue #18347: ElementTree's html serializer now preserves the case of
   closing tags.
 
@@ -1092,6 +3863,9 @@
 - Issue #18339: Negative ints keys in unpickler.memo dict no longer cause a
   segfault inside the _pickle C extension.
 
+- Issue #18240: The HMAC module is no longer restricted to bytes and accepts
+  any bytes-like object, e.g. memoryview. Original patch by Jonas Borgström.
+
 - Issue #18224: Removed pydoc script from created venv, as it causes problems
   on Windows and adds no value over and above python -m pydoc ...
 
@@ -1102,31 +3876,92 @@
 - Issue #14360: encode_quopri can now be successfully used as an encoder
   when constructing a MIMEApplication object.
 
+- Issue #11390: Add -o and -f command line options to the doctest CLI to
+  specify doctest options (and convert it to using argparse).
+
 - Issue #18135: ssl.SSLSocket.write() now raises an OverflowError if the input
   string in longer than 2 gigabytes, and ssl.SSLContext.load_cert_chain()
   raises a ValueError if the password is longer than 2 gigabytes. The ssl
   module does not support partial write.
 
+- Issue #11016: Add C implementation of the stat module as _stat.
+
 - Issue #18248: Fix libffi build on AIX.
 
 - Issue #18259: Declare sethostname in socketmodule.c for AIX
 
+- Issue #18147: Add diagnostic functions to ssl.SSLContext(). get_ca_list()
+  lists all loaded CA certificates and cert_store_stats() returns amount of
+  loaded X.509 certs, X.509 CA certs and CRLs.
+
 - Issue #18167: cgi.FieldStorage no longer fails to handle multipart/form-data
   when \r\n appears at end of 65535 bytes without other newlines.
 
+- Issue #18076: Introduce importlib.util.decode_source().
+- Issue #18357: add tests for dictview set difference.
+  Patch by Fraser Tweedale.
+
+- importlib.abc.SourceLoader.get_source() no longer changes SyntaxError or
+  UnicodeDecodeError into ImportError.
+
+- Issue #18058, 18057: Make the namespace package loader meet the
+  importlib.abc.InspectLoader ABC, allowing for namespace packages to work with
+  runpy.
+
+- Issue #17177: The imp module is pending deprecation.
+
 - subprocess: Prevent a possible double close of parent pipe fds when the
   subprocess exec runs into an error.  Prevent a regular multi-close of the
   /dev/null fd when any of stdin, stdout and stderr was set to DEVNULL.
 
+- Issue #18194: Introduce importlib.util.cache_from_source() and
+  source_from_cache() while documenting the equivalent functions in imp as
+  deprecated.
+
+- Issue #17907: Document imp.new_module() as deprecated in favour of
+  types.ModuleType.
+
+- Issue #18192: Introduce importlib.util.MAGIC_NUMBER and document as deprecated
+  imp.get_magic().
+
+- Issue #18149: Add filecmp.clear_cache() to manually clear the filecmp cache.
+  Patch by Mark Levitt
+
+- Issue #18193: Add importlib.reload().
+
+- Issue #18157: Stop using imp.load_module() in pydoc.
+
 - Issue #16102: Make uuid._netbios_getnode() work again on Python 3.
 
+- Issue #17134: Add ssl.enum_cert_store() as interface to Windows' cert store.
+
+- Issue #18143: Implement ssl.get_default_verify_paths() in order to debug
+  the default locations for cafile and capath.
+
+- Issue #17314: Move multiprocessing.forking over to importlib.
+
+- Issue #11959: SMTPServer and SMTPChannel now take an optional map, use of
+  which avoids affecting global state.
+
 - Issue #18109: os.uname() now decodes fields from the locale encoding, and
   socket.gethostname() now decodes the hostname from the locale encoding,
   instead of using the UTF-8 encoding in strict mode.
 
+- Issue #18089: Implement importlib.abc.InspectLoader.load_module.
+
+- Issue #18088: Introduce importlib.abc.Loader.init_module_attrs for setting
+  module attributes. Leads to the pending deprecation of
+  importlib.util.module_for_loader.
+
 - Issue #17403: urllib.parse.robotparser normalizes the urls before adding to
   ruleline. This helps in handling certain types invalid urls in a conservative
-  manner.
+  manner. Patch contributed by Mher Movsisyan.
+
+- Issue #18070: Have importlib.util.module_for_loader() set attributes
+  unconditionally in order to properly support reloading.
+
+- Added importlib.util.module_to_load to return a context manager to provide the
+  proper module object to load.
 
 - Issue #18025: Fixed a segfault in io.BufferedIOBase.readinto() when raw
   stream's read() returns more bytes than requested.
@@ -1135,20 +3970,42 @@
   binascii.Error if there are non-b32-alphabet characters present in the input
   string, instead of a TypeError.
 
-- Issue #13772: Restored directory detection of targets in ``os.symlink`` on
-  Windows, which was temporarily removed in Python 3.2.3 due to an incomplete
-  implementation. The implementation now works even if the symlink is created
-  in a location other than the current directory.
+- Issue #18072: Implement importlib.abc.InspectLoader.get_code() and
+  importlib.abc.ExecutionLoader.get_code().
 
-- Issue #16986: ElementTree now correctly parses a string input not only when
-  an internal XML encoding is UTF-8 or US-ASCII.
+- Issue #8240: Set the SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER flag on SSL
+  sockets.
+
+- Issue #17269: Workaround for socket.getaddrinfo crash on MacOS X
+  with port None or "0" and flags AI_NUMERICSERV.
+
+- Issue #16986: ElementTree now correctly works with string input when the
+  internal XML encoding is not UTF-8 or US-ASCII.
+
+- Issue #17996: socket module now exposes AF_LINK constant on BSD and OSX.
+
+- Issue #17900: Allowed pickling of recursive OrderedDicts.  Decreased pickled
+  size and pickling time.
+
+- Issue #17914: Add os.cpu_count(). Patch by Yogesh Chaudhari, based on an
+  initial patch by Trent Nelson.
 
 - Issue #17812: Fixed quadratic complexity of base64.b32encode().
+  Optimize base64.b32encode() and base64.b32decode() (speed up to 3x).
 
 - Issue #17980: Fix possible abuse of ssl.match_hostname() for denial of
   service using certificates with many wildcards (CVE-2013-2099).
 
-- Issue #17981: Closed socket on error in SysLogHandler.
+- Issue #15758: Fix FileIO.readall() so it no longer has O(n**2) complexity.
+
+- Issue #14596: The struct.Struct() objects now use a more compact
+  implementation.
+
+- Issue #17981: logging's SysLogHandler now closes the socket when it catches
+  socket OSErrors.
+
+- Issue #17964: Fix os.sysconf(): the return type of the C sysconf() function
+  is long, not int.
 
 - Fix typos in the multiprocessing module.
 
@@ -1156,10 +4013,163 @@
 
 - Issue #17968: Fix memory leak in os.listxattr().
 
-- Issue #17269: Workaround for socket.getaddrinfo crash on MacOS X
-  with port None or "0" and flags AI_NUMERICSERV.
+- Issue #17606: Fixed support of encoded byte strings in the XMLGenerator
+  characters() and ignorableWhitespace() methods.  Original patch by Sebastian
+  Ortiz Vasquez.
 
-- Issue #18698: Ensure imp.reload() returns the module out of sys.modules.
+- Issue #17732: Ignore distutils.cfg options pertaining to install paths if a
+  virtual environment is active.
+
+- Issue #17915: Fix interoperability of xml.sax with file objects returned by
+  codecs.open().
+
+- Issue #16601: Restarting iteration over tarfile really restarts rather
+  than continuing from where it left off.  Patch by Michael Birtwell.
+
+- Issue #17289: The readline module now plays nicer with external modules
+  or applications changing the rl_completer_word_break_characters global
+  variable.  Initial patch by Bradley Froehle.
+
+- Issue #12181: select module: Fix struct kevent definition on OpenBSD 64-bit
+  platforms. Patch by Federico Schwindt.
+
+- Issue #11816: multiple improvements to the dis module: get_instructions
+  generator, ability to redirect output to a file, Bytecode and Instruction
+  abstractions. Patch by Nick Coghlan, Ryan Kelly and Thomas Kluyver.
+
+- Issue #13831: Embed stringification of remote traceback in local
+  traceback raised when pool task raises an exception.
+
+- Issue #15528: Add weakref.finalize to support finalization using
+  weakref callbacks.
+
+- Issue #14173: Avoid crashing when reading a signal handler during
+  interpreter shutdown.
+
+- Issue #15902: Fix imp.load_module() accepting None as a file when loading an
+  extension module.
+
+- Issue #13721: SSLSocket.getpeercert() and SSLSocket.do_handshake() now
+  raise an OSError with ENOTCONN, instead of an AttributeError, when the
+  SSLSocket is not connected.
+
+- Issue #14679: add an __all__ (that contains only HTMLParser) to html.parser.
+
+- Issue #17802: Fix an UnboundLocalError in html.parser.  Initial tests by
+  Thomas Barlow.
+
+- Issue #17358: Modules loaded by imp.load_source() and load_compiled() (and by
+  extention load_module()) now have a better chance of working when reloaded.
+
+- Issue #17804: New function ``struct.iter_unpack`` allows for streaming
+  struct unpacking.
+
+- Issue #17830: When keyword.py is used to update a keyword file, it now
+  preserves the line endings of the original file.
+
+- Issue #17272: Making the urllib.request's Request.full_url a descriptor.
+  Fixes bugs with assignment to full_url. Patch by Demian Brecht.
+
+- Issue #17353: Plistlib emitted empty data tags with deeply nested datastructures
+
+- Issue #11714: Use 'with' statements to assure a Semaphore releases a
+  condition variable.  Original patch by Thomas Rachel.
+
+- Issue #16624: `subprocess.check_output` now accepts an `input` argument,
+  allowing the subprocess's stdin to be provided as a (byte) string.
+  Patch by Zack Weinberg.
+
+- Issue #17795: Reverted backwards-incompatible change in SysLogHandler with
+  Unix domain sockets.
+
+- Issue #16694: Add a pure Python implementation of the operator module.
+  Patch by Zachary Ware.
+
+- Issue #11182: remove the unused and undocumented pydoc.Scanner class.
+  Patch by Martin Morrison.
+
+- Issue #17741: Add ElementTree.XMLPullParser, an event-driven parser for
+  non-blocking applications.
+
+- Issue #17555: Fix ForkAwareThreadLock so that size of after fork
+  registry does not grow exponentially with generation of process.
+
+- Issue #17707: fix regression in multiprocessing.Queue's get() method where
+  it did not block for short timeouts.
+
+- Issue #17720: Fix the Python implementation of pickle.Unpickler to correctly
+  process the APPENDS opcode when it is used on non-list objects.
+
+- Issue #17012: shutil.which() no longer falls back to the PATH environment
+  variable if an empty path argument is specified.  Patch by Serhiy Storchaka.
+
+- Issue #17710: Fix pickle raising a SystemError on bogus input.
+
+- Issue #17341: Include the invalid name in the error messages from re about
+  invalid group names.
+
+- Issue #17702: os.environ now raises KeyError with the original environment
+  variable name (str on UNIX), instead of using the encoded name (bytes on
+  UNIX).
+
+- Issue #16163: Make the importlib based version of pkgutil.iter_importers
+  work for submodules. Initial patch by Berker Peksag.
+
+- Issue #16804: Fix a bug in the 'site' module that caused running
+  'python -S -m site' to incorrectly throw an exception.
+
+- Issue #15480: Remove the deprecated and unused TYPE_INT64 code from marshal.
+  Initial patch by Daniel Riti.
+
+- Issue #2118: SMTPException is now a subclass of OSError.
+
+- Issue #17016: Get rid of possible pointer wraparounds and integer overflows
+  in the re module.  Patch by Nickolai Zeldovich.
+
+- Issue #16658: add missing return to HTTPConnection.send()
+  Patch by Jeff Knupp.
+
+- Issue #9556: the logging package now allows specifying a time-of-day for a
+  TimedRotatingFileHandler to rotate.
+
+- Issue #14971: unittest test discovery no longer gets confused when a function
+  has a different __name__ than its name in the TestCase class dictionary.
+
+- Issue #17487: The wave getparams method now returns a namedtuple rather than
+  a plain tuple.
+
+- Issue #17675: socket repr() provides local and remote addresses (if any).
+  Patch by Giampaolo Rodola'
+
+- Issue #17093: Make the ABCs in importlib.abc provide default values or raise
+  reasonable exceptions for their methods to make them more amenable to super()
+  calls.
+
+- Issue #17566: Make importlib.abc.Loader.module_repr() optional instead of an
+  abstractmethod; now it raises NotImplementedError so as to be ignored by default.
+
+- Issue #17678: Remove the use of deprecated method in http/cookiejar.py by
+  changing the call to get_origin_req_host() to origin_req_host.
+
+- Issue #17666: Fix reading gzip files with an extra field.
+
+- Issue #16475: Support object instancing, recursion and interned strings
+  in marshal
+
+- Issue #17502: Process DEFAULT values in mock side_effect that returns iterator.
+
+- Issue #16795: On the ast.arguments object, unify vararg with varargannotation
+  and kwarg and kwargannotation. Change the column offset of ast.Attribute to be
+  at the attribute name.
+
+- Issue #17434: Properly raise a SyntaxError when a string occurs between future
+  imports.
+
+- Issue #17117: Import and @importlib.util.set_loader now set __loader__ when
+  it has a value of None or the attribute doesn't exist.
+
+- Issue #17032: The "global" in the "NameError: global name 'x' is not defined"
+  error message has been removed.  Patch by Ram Rachum.
 
 - Issue #18080: When building a C extension module on OS X, if the compiler
   is overriden with the CC environment variable, use the new compiler as
@@ -1169,31 +4179,733 @@
 - Issue #18113: Fixed a refcount leak in the curses.panel module's
   set_userptr() method.  Reported by Atsuo Ishimoto.
 
-- Issue #18849: Fixed a Windows-specific tempfile bug where collision with an
-  existing directory caused mkstemp and related APIs to fail instead of
-  retrying. Report and fix by Vlad Shcherbina.
+- Implement PEP 443 "Single-dispatch generic functions".
 
-- Issue #19400: Prevent extension module build failures with Xcode 5 on OS X
-  10.8+ when using a universal Python that included a PPC architecture,
-  such as with a python.org 32-bit-only binary installer.
+- Implement PEP 435 "Adding an Enum type to the Python standard library".
 
-C API
------
+- Issue #15596: Faster pickling of unicode strings.
 
-- Issue #18351: Fix various issues with a helper function in importlib used
-  by PyImport_ExecCodeModuleWithPathnames() (and thus by extension
-  PyImport_ExecCodeModule() and PyImport_ExecCodeModuleEx()).
+- Issue #17572: Avoid chained exceptions when passing bad directives to
+  time.strptime().  Initial patch by Claudiu Popa.
+
+- Issue #17435: threading.Timer's __init__ method no longer uses mutable
+  default values for the args and kwargs parameters.
+
+- Issue #17526: fix an IndexError raised while passing code without filename to
+  inspect.findsource().  Initial patch by Tyler Doyle.
+
+- Issue #17540: Added style parameter to logging formatter configuration by dict.
+
+- Issue #16692: The ssl module now supports TLS 1.1 and TLS 1.2.  Initial
+  patch by Michele Orrù.
+
+- Issue #17025: multiprocessing: Reduce Queue and SimpleQueue contention.
+
+- Issue #17536: Add to webbrowser's browser list: www-browser, x-www-browser,
+  iceweasel, iceape.
+
+- Issue #17150: pprint now uses line continuations to wrap long string
+  literals.
+
+- Issue #17488: Change the subprocess.Popen bufsize parameter default value
+  from unbuffered (0) to buffering (-1) to match the behavior existing code
+  expects and match the behavior of the subprocess module in Python 2 to avoid
+  introducing hard to track down bugs.
+
+- Issue #17521: Corrected non-enabling of logger following two calls to
+  fileConfig().
+
+- Issue #17508: Corrected logging MemoryHandler configuration in dictConfig()
+  where the target handler wasn't configured first.
+
+- Issue #17209: curses.window.get_wch() now correctly handles KeyboardInterrupt
+  (CTRL+c).
+
+- Issue #5713: smtplib now handles 421 (closing connection) error codes when
+  sending mail by closing the socket and reporting the 421 error code via the
+  exception appropriate to the command that received the error response.
+
+- Issue #16997: unittest.TestCase now provides a subTest() context manager
+  to procedurally generate, in an easy way, small test instances.
+
+- Issue #17485: Also delete the Request Content-Length header if the data
+  attribute is deleted.  (Follow on to issue Issue #16464).
+
+- Issue #15927: CVS now correctly parses escaped newlines and carriage
+  when parsing with quoting turned off.
+
+- Issue #17467: add readline and readlines support to mock_open in
+  unittest.mock.
+
+- Issue #13248: removed deprecated and undocumented difflib.isbjunk,
+  isbpopular.
+
+- Issue #17192: Update the ctypes module's libffi to v3.0.13.  This
+  specifically addresses a stack misalignment issue on x86 and issues on
+  some more recent platforms.
+
+- Issue #8862: Fixed curses cleanup when getkey is interrputed by a signal.
+
+- Issue #17443: imaplib.IMAP4_stream was using the default unbuffered IO
+  in subprocess, but the imap code assumes buffered IO.  In Python2 this
+  worked by accident.  IMAP4_stream now explicitly uses buffered IO.
+
+- Issue #17476: Fixed regression relative to Python2 in undocumented pydoc
+  'allmethods'; it was missing unbound methods on the class.
+
+- Issue #17474: Remove the deprecated methods of Request class.
+
+- Issue #16709: unittest discover order is no-longer filesystem specific. Patch
+  by Jeff Ramnani.
+
+- Use the HTTPS PyPI url for upload, overriding any plain HTTP URL in pypirc.
+
+- Issue #5024: sndhdr.whichhdr now returns the frame count for WAV files
+  rather than -1.
+
+- Issue #17460: Remove the strict argument of HTTPConnection and removing the
+  DeprecationWarning being issued from 3.2 onwards.
+
+- Issue #16880: Do not assume _imp.load_dynamic() is defined in the imp module.
+
+- Issue #16389: Fixed a performance regression relative to Python 3.1 in the
+  caching of compiled regular expressions.
+
+- Added missing FeedParser and BytesFeedParser to email.parser.__all__.
+
+- Issue #17431: Fix missing import of BytesFeedParser in email.parser.
+
+- Issue #12921: http.server's send_error takes an explain argument to send more
+  information in response. Patch contributed by Karl.
+
+- Issue #17414: Add timeit, repeat, and default_timer to timeit.__all__.
+
+- Issue #1285086: Get rid of the refcounting hack and speed up
+  urllib.parse.unquote() and urllib.parse.unquote_to_bytes().
+
+- Issue #17099: Have importlib.find_loader() raise ValueError when __loader__
+  is not set, harmonizing with what happens when the attribute is set to None.
+
+- Expose the O_PATH constant in the os module if it is available.
+
+- Issue #17368: Fix an off-by-one error in the Python JSON decoder that caused
+  a failure while decoding empty object literals when object_pairs_hook was
+  specified.
+
+- Issue #17385: Fix quadratic behavior in threading.Condition.  The FIFO
+  queue now uses a deque instead of a list.
+
+- Issue #15806: Add contextlib.ignore().  This creates a context manager to
+  ignore specified exceptions, replacing the "except SomeException: pass" idiom.
+
+- Issue #14645: The email generator classes now produce output using the
+  specified linesep throughout.  Previously if the prolog, epilog, or
+  body were stored with a different linesep, that linesep was used.  This
+  fix corrects an RFC non-compliance issue with smtplib.send_message.
+
+- Issue #17278: Fix a crash in heapq.heappush() and heapq.heappop() when
+  the list is being resized concurrently.
+
+- Issue #16962: Use getdents64 instead of the obsolete getdents syscall
+  in the subprocess module on Linux.
+
+- Issue #16935: unittest now counts the module as skipped if it raises SkipTest,
+  instead of counting it as an error.  Patch by Zachary Ware.
+
+- Issue #17018: Make Process.join() retry if os.waitpid() fails with EINTR.
+
+- Issue #17223: array module: Fix a crasher when converting an array containing
+  invalid characters (outside range [U+0000; U+10ffff]) to Unicode:
+  repr(array), str(array) and array.tounicode(). Patch written by Manuel Jacob.
+
+- Issue #17197: profile/cProfile modules refactored so that code of run() and
+  runctx() utility functions is not duplicated in both modules.
+
+- Issue #14720: sqlite3: Convert datetime microseconds correctly.
+  Patch by Lowe Thiderman.
+
+- Issue #15132: Allow a list for the defaultTest argument of
+  unittest.TestProgram. Patch by Jyrki Pulliainen.
+
+- Issue #17225: JSON decoder now counts columns in the first line starting
+  with 1, as in other lines.
+
+- Issue #6623: Added explicit DeprecationWarning for ftplib.netrc, which has
+  been deprecated and undocumented for a long time.
+
+- 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 #15220: email.feedparser's line splitting algorithm is now simpler and
+  faster.
+
+- Issue #16743: Fix mmap overflow check on 32 bit Windows.
+
+- Issue #16996: webbrowser module now uses shutil.which() to find a
+  web-browser on the executable search path.
+
+- Issue #16800: tempfile.gettempdir() no longer left temporary files when
+  the disk is full.  Original patch by Amir Szekely.
+
+- Issue #17192: Import libffi-3.0.12.
+
+- 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 longer 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 #13773: sqlite3.connect() gets a new `uri` parameter to pass the
+  filename as a URI, allowing to pass custom options.
+
+- Issue #16564: Fixed regression relative to Python2 in the operation of
+  email.encoders.encode_noop when used with binary data.
+
+- Issue #10355: The mode, name, encoding and newlines properties now work on
+  SpooledTemporaryFile objects even when they have not yet rolled over.
+  Obsolete method xreadline (which has never worked in Python 3) has been
+  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 #16723: httplib.HTTPResponse no longer marked closed when the connection
+  is automatically closed.
+
+- Issue #15359: Add CAN_BCM protocol support to the socket module. Patch by
+  Brian Thorne.
+
+- 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 tolerant of missing FS support.
+  Patch by Thomas Wouters.
+
+- Issue #17089: Expat parser now correctly works with string input when the
+  internal XML encoding is not UTF-8 or US-ASCII.  It also 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 #17015: When it has a spec, a Mock object now inspects its signature
+  when matching calls, so that arguments can be matched positionally or
+  by name.
+
+- Issue #15633: httplib.HTTPResponse is now mark closed when the server
+  sends less than the advertised Content-Length.
+
+- Issue #12268: The io module file object write methods no longer abort early
+  when one of its write system calls is interrupted (EINTR).
+
+- 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.
+
+- Have py_compile use importlib as much as possible to avoid code duplication.
+  Code now raises FileExistsError if the file path to be used for the
+  byte-compiled file is a symlink or non-regular file as a warning that import
+  will not keep the file path type if it writes to that path.
+
+- Issue #16972: Have site.addpackage() consider already known paths even when
+  none are explicitly passed in. Bug report and fix by Kirill.
+
+- 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 #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 #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 #15031: Refactor some .pyc management code to cut down on code
+  duplication. Thanks to Ronan Lamy for the report and taking an initial stab
+  at the problem.
+
+- Issue #16398: Optimize deque.rotate() so that it only moves pointers
+  and doesn't touch the underlying data with increfs and decrefs.
+
+- 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).
+
+- fcntl: add F_DUPFD_CLOEXEC constant, available on Linux 2.6.24+.
+
+- Issue #15972: Fix error messages when os functions expecting a file name or
+  file descriptor receive the incorrect type.
+
+- Issue #8109: The ssl module now has support for server-side SNI, thanks
+  to a :meth:`SSLContext.set_servername_callback` method.  Patch by Daniel
+  Black.
+
+- Issue #16860: In tempfile, use O_CLOEXEC when available to set the
+  close-on-exec flag atomically.
+
+- Issue #16674: random.getrandbits() is now 20-40% faster for small integers.
+
+- Issue #16009: JSON error messages now provide more information.
+
+- Issue #16828: Fix error incorrectly raised by bz2.compress(b'') and
+  bz2.BZ2Compressor.compress(b''). Initial patch by Martin Packman.
+
+- Issue #16833: In http.client.HTTPConnection, do not concatenate the request
+  headers and body when the payload exceeds 16 KB, since it can consume more
+  memory for no benefit.  Patch by Benno Leslie.
+
+- 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 #9586: Redefine SEM_FAILED on MacOSX to keep compiler happy.
+
+- Issue #16787: Increase asyncore and asynchat default output buffers size, to
+  decrease CPU usage and increase throughput.
+
+- 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 #16486: Make aifc files act as context managers.
+
+- Issue #16485: Now file descriptors are closed if file header patching failed
+  on closing an aifc file.
+
+- Issue #16640: Run less code under a lock in sched module.
+
+- 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 #16618: Make glob.glob match consistently across strings and bytes
+  regarding leading dots.  Patch by Serhiy Storchaka.
+
+- Issue #16788: Add samestat to Lib/ntpath.py
+
+- 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 #11175: argparse.FileType now accepts encoding and errors
+  arguments. Patch by Lucas Maystre.
+
+- Issue #16488: epoll() objects now support the `with` statement.  Patch
+  by Serhiy Storchaka.
+
+- 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 #16049: Add abc.ABC class to enable the use of inheritance to create
+  ABCs, rather than the more cumbersome metaclass=ABCMeta. Patch by Bruno
+  Dupuis.
+
+- Expose the TCP_FASTOPEN and MSG_FASTOPEN flags in socket when they're
+  available.
+
+- Issue #15701: Add a .headers attribute to urllib.error.HTTPError. Patch
+  contributed by Berker Peksag.
+
+- 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 #13390: New function :func:`sys.getallocatedblocks()` returns the
+  number of memory blocks currently allocated.
+
+- 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 #16333: use (",", ": ") as default separator in json when indent is
+  specified, to avoid trailing whitespace.  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 #16464: Reset the Content-Length header when a urllib Request is reused
+  with new data.
+
+- 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 #16423: urllib.request now has support for ``data:`` URLs.  Patch by
+  Mathias Panzenböck.
+
+- Issue #4473: Add a POP3.stls() to switch a clear-text POP3 session into
+  an encrypted POP3 session, on supported servers.  Patch by Lorenzo Catucci.
+
+- Issue #4473: Add a POP3.capa() method to query the capabilities advertised
+  by the POP3 server.  Patch by Lorenzo Catucci.
+
+- Issue #4473: Ensure the socket is shutdown cleanly in POP3.close().
+  Patch by Lorenzo Catucci.
+
+- Issue #16522: added FAIL_FAST flag to doctest.
+
+- Issue #15627: Add the importlib.abc.InspectLoader.source_to_code() method.
+
+- Issue #16408: Fix file descriptors not being closed in error conditions
+  in the zipfile module.  Patch by Serhiy Storchaka.
+
+- Issue #14631: Add a new :class:`weakref.WeakMethod` to simulate weak
+  references to bound methods.
+
+- Issue #16469: Fix exceptions from float -> Fraction and Decimal -> Fraction
+  conversions for special values to be consistent with those for float -> int
+  and Decimal -> int.  Patch by Alexey Kachayev.
+
+- Issue #16481: multiprocessing no longer leaks process handles on Windows.
+
+- Issue #12428: Add a pure Python implementation of functools.partial().
+  Patch by Brian Thorne.
+
+- 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.
+
+- The subprocess module now raises its own SubprocessError instead of a
+  RuntimeError in various error situations which should not normally happen.
+
+- 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 #15641: Clean up deprecated classes from importlib
+  Patch by Taras Lyapun.
+
+- 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 #16284: Prevent keeping unnecessary references to worker functions
+  in concurrent.futures ThreadPoolExecutor.
+
+- 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 #16351: New function gc.get_stats() returns per-generation collection
+  statistics.
+
+- Issue #14897: Enhance error messages of struct.pack and
+  struct.pack_into. Patch by Matti Mäki.
+
+- Issue #16316: mimetypes now recognizes the .xz and .txz (.tar.xz) extensions.
+  Patch by Serhiy Storchaka.
+
+- 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 #16305: Fix a segmentation fault occurring when interrupting
+  math.factorial.
+
+- 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 #16301: Fix the localhost verification in urllib/request.py for file://
+  urls.
+
+- Issue #16250: Fix the invocations of URLError which had misplaced filename
+  attribute for exception.
+
+- Issue #10836: Fix exception raised when file not found in urlretrieve
+  Initial patch by Ezio Melotti.
+
+- Issue #14398: Fix size truncation and overflow bugs in the bz2 module.
+
+- Issue #12692: Fix resource leak in urllib.request when talking to an HTTP
+  server that does not include a ``Connection: close`` header in its responses.
+
+- Issue #12034: Fix bogus caching of result in check_GetFinalPathNameByHandle.
+  Patch by Atsuo Ishimoto.
+
+- Improve performance of `lzma.LZMAFile` (see also issue #16034).
+
+- 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 #16088: BaseHTTPRequestHandler's send_error method includes a
+  Content-Length header in it's response now. Patch by Antoine Pitrou.
+
+- 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 #16110: logging.fileConfig now accepts a pre-initialised ConfigParser
+  instance.
+
+- Issue #1492704: shutil.copyfile() raises a distinct SameFileError now if
+  source and destination are the same file. Patch by Atsuo Ishimoto.
+
+- Issue #13896: Make shelf instances work with 'with' as context managers.
+  Original patch by Filip Gruszczyński.
+
+- Issue #15417: Add support for csh and fish in venv activation scripts.
+
+- Issue #14377: ElementTree.write and some of the module-level functions have
+  a new parameter - *short_empty_elements*. It controls how elements with no
+  contents are emitted.
+
+- Issue #16089: Allow ElementTree.TreeBuilder to work again with a non-Element
+  element_factory (fixes a regression in SimpleTAL).
+
+- Issue #9650: List commonly used format codes in time.strftime and
+  time.strptime docsttings.  Original patch by Mike Hoy.
+
+- Issue #15452: logging configuration socket listener now has a verify option
+  that allows an application to apply a verification function to the
+  received configuration data before it is acted upon.
+
+- Issue #16034: Fix performance regressions in the new `bz2.BZ2File`
+  implementation.  Initial patch by Serhiy Storchaka.
+
+- `pty.spawn()` now returns the child process status returned by `os.waitpid()`.
+
+- 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 #16112: platform.architecture does not correctly escape argument to
+  /usr/bin/file.  Patch by David Benjamin.
+
+- 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 #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=[]``.
+
+- Issue #16113: Added sha3 module based on the Keccak reference implementation
+  3.2. The `hashlib` module has four additional hash algorithms: `sha3_224`,
+  `sha3_256`, `sha3_384` and `sha3_512`. As part of the patch some common
+  code was moved from _hashopenssl.c to hashlib.h.
+
+- ctypes.call_commethod was removed, since its only usage was in the defunct
+  samples directory.
+
+- Issue #16692: Added TLSv1.1 and TLSv1.2 support for the ssl modules.
+
+- Issue #16832: add abc.get_cache_token() to expose cache validity checking
+  support in ABCMeta.
 
 IDLE
 ----
 
-- Issue #18873: IDLE now detects Python source code encoding only in comment
-  lines.
-
-- Issue #18988: The "Tab" key now works when a word is already autocompleted.
-
-- Issue #18489: Add tests for SearchEngine. Original patch by Phil Webster.
-
 - Issue #18429: Format / Format Paragraph, now works when comment blocks
   are selected. As with text blocks, this works best when the selection
   only includes complete lines.
@@ -1225,38 +4937,73 @@
 
 - Issue #14146: Highlight source line while debugging on Windows.
 
+- Issue #17838: Allow sys.stdin to be reassigned.
+
+- Issue #13495: Avoid loading the color delegator twice in IDLE.
+
+- Issue #17798: Allow IDLE to edit new files when specified on command line.
+
+- Issue #14735: Update IDLE docs to omit "Control-z on Windows".
+
 - Issue #17532: Always include Options menu for IDLE on OS X.
   Patch by Guilherme Simões.
 
+- Issue #17585: Fixed IDLE regression. Now closes when using exit() or quit().
+
+- Issue #17657: Show full Tk version in IDLE's about dialog.
+  Patch by Todd Rovito.
+
+- Issue #17613: Prevent traceback when removing syntax colorizer in IDLE.
+
+- Issue #1207589: Backwards-compatibility patch for right-click menu in IDLE.
+
+- Issue #16887: IDLE now accepts Cancel in tabify/untabify dialog box.
+
+- Issue #17625: In IDLE, close the replace dialog after it is used.
+
+- Issue #14254: IDLE now handles readline correctly across shell restarts.
+
+- Issue #17614: IDLE no longer raises exception when quickly closing a file.
+
+- Issue #6698: IDLE now opens just an editor window when configured to do so.
+
+- Issue #8900: Using keyboard shortcuts in IDLE to open a file no longer
+  raises an exception.
+
+- Issue #6649: Fixed missing exit status in IDLE. Patch by Guilherme Polo.
+
+- Issue #17114: IDLE now uses non-strict config parser.
+
+- Issue #9290: In IDLE the sys.std* streams now implement io.TextIOBase
+  interface and support all mandatory methods and properties.
+
+- Issue #5066: Update IDLE docs. Patch by Todd Rovito.
+
+- Issue #16829: IDLE printing no longer fails if there are spaces or other
+  special characters in the file path.
+
+- Issue #16491: IDLE now prints chained exception tracebacks.
+
+- Issue #16819: IDLE method completion now correctly works for bytes literals.
+
+- Issue #16504: IDLE now catches SyntaxErrors raised by tokenizer. Patch by
+  Roger Serwy.
+
+- Issue #16511: Use default IDLE width and height if config param is not valid.
+  Patch Serhiy Storchaka.
+
+- Issue #1207589: Add Cut/Copy/Paste items to IDLE right click Context Menu
+  Patch by Todd Rovito.
+
+- Issue #16123: IDLE - deprecate running without a subprocess.
+  Patch by Roger Serwy.
+
 Tests
 -----
 
-- Issue #14407: Fix unittest test discovery in test_concurrent_futures.
-
-- Issue #18919: Unified and extended tests for audio modules: aifc, sunau and
-  wave.
-
-- Issue #18952: Fix regression in support data downloads introduced when
-  test.support was converted to a package. Regression noticed by Zachary
-  Ware.
-
-- Issue #12037: Fix test_email for desktop Windows.
-
-- Issue #15507: test_subprocess's test_send_signal could fail if the test
-  runner were run in an environment where the process inherited an ignore
-  setting for SIGINT.  Restore the SIGINT handler to the desired
-  KeyboardInterrupt raising one during that test.
-
-- Issue #18792: Use "127.0.0.1" or "::1" instead of "localhost" as much as
-  possible, since "localhost" goes through a DNS lookup under recent Windows
-  versions.
-
 - Issue #1666318: Add a test that shutil.copytree() retains directory
   permissions.  Patch by Catherine Devlin.
 
-- Issue #18357: add tests for dictview set difference.
-  Patch by Fraser Tweedale.
-
 - Issue #18273: move the tests in Lib/test/json_tests to Lib/test/test_json
   and make them discoverable by unittest.  Patch by Zachary Ware.
 
@@ -1288,285 +5035,13 @@
 
 - Issue #11185: Fix test_wait4 under AIX.  Patch by Sébastien Sablé.
 
-- Issue #17691: test_univnewlines now works with unittest test discovery.
-  Patch by Zachary Ware.
+- Issue #18207: Fix test_ssl for some versions of OpenSSL that ignore seconds
+  in ASN1_TIME fields.
 
-- Issue #18094: test_uuid no more reports skipped tests as passed.
+- Issue #18094: test_uuid no longer reports skipped tests as passed.
 
-- Issue #11995: test_pydoc doesn't import all sys.path modules anymore.
-
-Documentation
--------------
-
-- Issue #19392: Document that `imp.reload()` now also requires `__loader__` to
-  be set on the module being reloaded.
-
-- Issue #18758: Fixed and improved cross-references.
-
-- Issue #18743: Fix references to non-existant "StringIO" module.
-
-- Issue #18783: Removed existing mentions of Python long type in docstrings,
-  error messages and comments.
-
-- Issue #17701: Improving strftime documentation.
-
-- Issue #18440: Clarify that `hash()` can truncate the value returned from an
-  object's custom `__hash__()` method.
-
-- Issue #17953: Mention that you shouldn't replace sys.modules and deleting key
-  items will cause Python to not be happy.
-
-- Issue #17844: Add links to encoders and decoders for bytes-to-bytes codecs.
-
-- Issue #14097: improve the "introduction" page of the tutorial.
-
-- Issue #17977: The documentation for the cadefault argument's default value
-  in urllib.request.urlopen() is fixed to match the code.
-
-Tools/Demos
------------
-
-- Issue #18873: 2to3 and the findnocoding.py script now detect Python source
-  code encoding only in comment lines.
-
-- Issue #18817: Fix a resource warning in Lib/aifc.py demo.
-
-- Issue #18439: Make patchcheck work on Windows for ACKS, NEWS.
-
-- Issue #18448: Fix a typo in Tools/demo/eiffel.py.
-
-- Issue #18457: Fixed saving of formulas and complex numbers in
-  Tools/demo/ss1.py.
-
-- Issue #18449: Make Tools/demo/ss1.py work again on Python 3.  Patch by
-  Févry Thibault.
-
-- Issue #15239: Make mkstringprep.py work again on Python 3.
-
-- Issue #12990: The "Python Launcher" on OSX could not launch python scripts
-  that have paths that include wide characters.
-
-Build
------
-
-- Issue #19356: Avoid using a C variabled named "_self", it's a reserved
-  word in some C compilers.
-
-- Issue #19130: Correct PCbuild/readme.txt, Python 3.3 and 3.4 require VS 2010.
-
-- Issue #16067: Add description into MSI file to replace installer's temporary name.
-
-- Issue #18256: Compilation fix for recent AIX releases.  Patch by
-  David Edelsohn.
-
-- Issue #15172: Document NASM 2.10+ as requirement for building OpenSSL 1.0.1
-  on Windows.
-
-- Issue #1584: Provide options to override default search paths for
-  Tcl and Tk when building _tkinter.
-
-- Issue #15663: Tcl/Tk 8.5.15 is now included with the OS X 10.6+
-  64-bit/32-bit installer for 10.6+.  It is no longer necessary
-  to install a third-party version of Tcl/Tk 8.5 to work around the
-  problems in the Apple-supplied Tcl/Tk 8.5 shipped in OS X 10.6
-  and later releases.
-
-- Issue #19019: Change the OS X installer build script to use CFLAGS instead
-  of OPT for special build options.  By setting OPT, some compiler-specific
-  options like -fwrapv were overridden and thus not used, which could result
-  in broken interpreters when building with clang.
-
-
-What's New in Python 3.3.2?
-===========================
-
-*Release date: 13-May-2013*
-
-Core and Builtins
------------------
-
-- Issue #17237: Fix crash in the ASCII decoder on m68k.
-
-- Issue #17408: Avoid using an obsolete instance of the copyreg module when
-  the interpreter is shutdown and then started again.
-
-- Issue #17863: In the interactive console, don't loop forever if the encoding
-  can't be fetched from stdin.
-
-- Issue #17867: Raise an ImportError if __import__ is not found in __builtins__.
-
-- Issue #17857: Prevent build failures with pre-3.5.0 versions of sqlite3,
-  such as was shipped with Centos 5 and Mac OS X 10.4.
-
-- Issue #17413: sys.settrace callbacks were being passed a string instead of an
-  exception instance for the 'value' element of the arg tuple if the exception
-  originated from C code; now an exception instance is always provided.
-
-- Issue #17782: Fix undefined behaviour on platforms where
-  ``struct timespec``'s "tv_nsec" member is not a C long.
-
-- Issue #17715: Fix segmentation fault from raising an exception in a __trunc__
-  method.
-
-- Issue #16447: Fixed potential segmentation fault when setting __name__ on a
-  class.
-
-- Issue #17669: Fix crash involving finalization of generators using yield from.
-
-- Issue #17619: Make input() check for Ctrl-C correctly on Windows.
-
-- Issue #17610: Don't rely on non-standard behavior of the C qsort() function.
-
-- Issue #17357: Add missing verbosity output when using -v/-vv.
-
-Library
--------
-
-- Issue #17606: Fixed support of encoded byte strings in the XMLGenerator
-  characters() and ignorableWhitespace() methods.  Original patch by Sebastian
-  Ortiz Vasquez.
-
-- Issue #17732: Ignore distutils.cfg options pertaining to install paths if a
-  virtual environment is active.
-
-- Issue #1159051: Back out a fix for handling corrupted gzip files that
-  broke backwards compatibility.
-
-- Issue #17915: Fix interoperability of xml.sax with file objects returned by
-  codecs.open().
-
-- Issue #16601: Restarting iteration over tarfile no more continues from where
-  it left off.  Patch by Michael Birtwell.
-
-- Issue #17289: The readline module now plays nicer with external modules
-  or applications changing the rl_completer_word_break_characters global
-  variable.  Initial patch by Bradley Froehle.
-
-- Issue #12181: select module: Fix struct kevent definition on OpenBSD 64-bit
-  platforms. Patch by Federico Schwindt.
-
-- Issue #14173: Avoid crashing when reading a signal handler during
-  interpreter shutdown.
-
-- Issue #16316: mimetypes now recognizes the .xz and .txz (.tar.xz) extensions.
-
-- Issue #15902: Fix imp.load_module() accepting None as a file when loading an
-  extension module.
-
-- Issue #17802: Fix an UnboundLocalError in html.parser.  Initial tests by
-  Thomas Barlow.
-
-- Issue #15535: Fix namedtuple pickles which were picking up the OrderedDict
-  instead of just the underlying tuple.
-
-- Issue #17192: Restore the patch for Issue #11729 which was ommitted in
-  3.3.1 when updating the bundled version of libffi used by ctypes.  Update
-  many libffi files that were missed in 3.3.1's update to libffi-3.0.13.
-
-- Issue #17358: Modules loaded by imp.load_source() and load_compiled() (and by
-  extention load_module()) now have a better chance of working when reloaded.
-
-- Issue #17353: Plistlib emitted empty data tags with deeply nested datastructures
-
-- Issue #11714: Use 'with' statements to assure a Semaphore releases a
-  condition variable.  Original patch by Thomas Rachel.
-
-- Issue #17795: Reverted backwards-incompatible change in SysLogHandler with
-  Unix domain sockets.
-
-- Issue #17555: Fix ForkAwareThreadLock so that size of after fork
-  registry does not grow exponentially with generation of process.
-
-- Issue #17707: multiprocessing.Queue's get() method does not block for short
-  timeouts.
-
-- Isuse #17720: Fix the Python implementation of pickle.Unpickler to correctly
-  process the APPENDS opcode when it is used on non-list objects.
-
-- Issue #17012: shutil.which() no longer fallbacks to the PATH environment
-  variable if empty path argument is specified.  Patch by Serhiy Storchaka.
-
-- Issue #17710: Fix pickle raising a SystemError on bogus input.
-
-- Issue #17341: Include the invalid name in the error messages from re about
-  invalid group names.
-
-- Issue #17702: os.environ now raises KeyError with the original environment
-  variable name (str on UNIX), instead of using the encoded name (bytes on
-  UNIX).
-
-- Issue #16163: Make the importlib based version of pkgutil.iter_importers
-  work for submodules. Initial patch by Berker Peksag.
-
-- Issue #16804: Fix a bug in the 'site' module that caused running
-  'python -S -m site' to incorrectly throw an exception.
-
-- Issue #17016: Get rid of possible pointer wraparounds and integer overflows
-  in the re module.  Patch by Nickolai Zeldovich.
-
-- Issue #16658: add missing return to HTTPConnection.send()
-  Patch by Jeff Knupp.
-
-- Issue #14971: unittest test discovery no longer gets confused when a function
-  has a different __name__ than its name in the TestCase class dictionary.
-
-- Issue #17678: Fix DeprecationWarning in the http/cookiejar.py by changing the
-  usage of get_origin_req_host() to origin_req_host.
-
-- Issue #17666: Fix reading gzip files with an extra field.
-
-- Issue #17502: Process DEFAULT values in mock side_effect that returns iterator.
-  Patch by Michael Foord.
-
-- Issue #17572: Avoid chained exceptions while passing bad directives to
-  time.strptime().  Initial patch by Claudiu Popa.
-
-- Issue #17435: threading.Timer's __init__ method no longer uses mutable
-  default values for the args and kwargs parameters.
-
-- Issue #17526: fix an IndexError raised while passing code without filename to
-  inspect.findsource().  Initial patch by Tyler Doyle.
-
-- Issue #16550: Update the opcode descriptions of pickletools to use unsigned
-  integers where appropriate.  Initial patch by Serhiy Storchaka.
-
-IDLE
-----
-
-- Issue #17838: Allow sys.stdin to be reassigned.
-
-- Issue #13495: Avoid loading the color delegator twice in IDLE.
-
-- Issue #17798: Allow IDLE to edit new files when specified on command line.
-
-- Issue #14735: Update IDLE docs to omit "Control-z on Windows".
-
-- Issue #17585: Fixed IDLE regression. Now closes when using exit() or quit().
-
-- Issue #17657: Show full Tk version in IDLE's about dialog.
-  Patch by Todd Rovito.
-
-- Issue #17613: Prevent traceback when removing syntax colorizer in IDLE.
-
-- Issue #1207589: Backwards-compatibility patch for right-click menu in IDLE.
-
-- Issue #16887: IDLE now accepts Cancel in tabify/untabify dialog box.
-
-- Issue #17625: In IDLE, close the replace dialog after it is used.
-
-- Issue #14254: IDLE now handles readline correctly across shell restarts.
-
-- Issue #17614: IDLE no longer raises exception when quickly closing a file.
-
-- Issue #6698: IDLE now opens just an editor window when configured to do so.
-
-- Issue #8900: Using keyboard shortcuts in IDLE to open a file no longer
-  raises an exception.
-
-- Issue #6649: Fixed missing exit status in IDLE. Patch by Guilherme Polo.
-
-Tests
------
+- Issue #17992: Add timeouts to asyncore and asynchat tests so that they won't
+  accidentally hang.
 
 - Issue #17833: Fix test_gdb failures seen on machines where debug symbols
   for glibc are available (seen on PPC64 Linux).
@@ -1574,6 +5049,9 @@
 - Issue #7855: Add tests for ctypes/winreg for issues found in IronPython.
   Initial patch by Dino Viehland.
 
+- Issue #11078: test___all__ now checks for duplicates in __all__.
+  Initial patch by R. David Murray.
+
 - Issue #17712: Fix test_gdb failures on Ubuntu 13.04.
 
 - Issue #17835: Fix test_io when the default OS pipe buffer size is larger
@@ -1585,6 +5063,9 @@
 - Issue #12820: add tests for the xml.dom.minicompat module.
   Patch by John Chandler and Phil Connell.
 
+- Issue #17691: test_univnewlines now works with unittest test discovery.
+  Patch by Zachary Ware.
+
 - Issue #17790: test_set now works with unittest test discovery.
   Patch by Zachary Ware.
 
@@ -1603,716 +5084,7 @@
 - Issue #17692: test_sqlite now works with unittest test discovery.
   Patch by Zachary Ware.
 
-- Issue #17843: Removed bz2 test data file that was triggering false-positive
-  virus warnings with certain antivirus software.
-
-Documentation
--------------
-
-- Issue #15940: Specify effect of locale on time functions.
-
-- Issue #6696: add documentation for the Profile objects, and improve
-  profile/cProfile docs.  Patch by Tom Pinckney.
-
-- Issue #17915: Fix interoperability of xml.sax with file objects returned by
-  codecs.open().
-
-Build
------
-
-- Issue #17547: In configure, explicitly pass -Wformat for the benefit for GCC
-  4.8.
-
-- Issue #17962: Build with OpenSSL 1.0.1e on Windows.
-
-
-What's New in Python 3.3.1?
-===========================
-
-*Release date: 07-Apr-2013*
-
-Build
------
-
-- Issue #17550: Fix the --enable-profiling configure switch.
-
-IDLE
--------
-
-- Issue #17625: In IDLE, close the replace dialog after it is used.
-
-
-What's New in Python 3.3.1 release candidate 1?
-===============================================
-
-*Release date: 24-Mar-2013*
-
-Core and Builtins
------------------
-
-- Issue #17328: Fix possible refleak in dict.setdefault.
-
-- Issue #17223: Fix PyUnicode_FromUnicode() for string of 1 character outside
-  the range U+0000-U+10ffff.
-
-- Issue #1692335: Move initial args assignment to
-  BaseException.__new__ to help pickling of naive subclasses.
-
-- Issue #17275: Corrected class name in init error messages of the C version of
-  BufferedWriter and BufferedRandom.
-
-- 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 #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 #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 #17540: Added style to formatter configuration by dict.
-
-- Issue #17536: Add to webbrowser's browser list: www-browser, x-www-browser,
-  iceweasel, iceape.
-
-- Issue #17488: Change the subprocess.Popen bufsize parameter default value
-  from unbuffered (0) to buffering (-1) to match the behavior existing code
-  expects and match the behavior of the subprocess module in Python 2 to avoid
-  introducing hard to track down bugs.
-
-- Issue #17521: Corrected non-enabling of logger following two calls to
-  fileConfig().
-
-- Issue #17508: Corrected MemoryHandler configuration in dictConfig() where
-  the target handler wasn't configured first.
-
-- Issue #17209: curses.window.get_wch() now handles correctly KeyboardInterrupt
-  (CTRL+c).
-
-- Issue #5713: smtplib now handles 421 (closing connection) error codes when
-  sending mail by closing the socket and reporting the 421 error code via the
-  exception appropriate to the command that received the error response.
-
-- Issue #17192: Update the ctypes module's libffi to v3.0.13.  This
-  specifically addresses a stack misalignment issue on x86 and issues on
-  some more recent platforms.
-
-- Issue #8862: Fixed curses cleanup when getkey is interrputed by a signal.
-
-- Issue #17443: imaplib.IMAP4_stream was using the default unbuffered IO
-  in subprocess, but the imap code assumes buffered IO.  In Python2 this
-  worked by accident.  IMAP4_stream now explicitly uses buffered IO.
-
-- Issue #17476: Fixed regression relative to Python2 in undocumented pydoc
-  'allmethods'; it was missing unbound methods on the class.
-
-- Issue #16880: Do not assume _imp.load_dynamic() is defined in the imp module.
-
-- Issue #16389: Fixed a performance regression relative to Python 3.1 in the
-  caching of compiled regular expressions.
-
-- Issue #17431: Fix missing import of BytesFeedParser in email.parser.
-
-- Issue #1285086: Get rid of the refcounting hack and speed up
-  urllib.parse.unquote() and urllib.parse.unquote_to_bytes().
-
-- Issue #17368: Fix an off-by-one error in the Python JSON decoder that caused
-  a failure while decoding empty object literals when object_pairs_hook was
-  specified.
-
-- Issue #14645: The email generator classes now produce output using the
-  specified linesep throughout.  Previously if the prolog, epilog, or
-  body were stored with a different linesep, that linesep was used.  This
-  fix corrects an RFC non-compliance issue with smtplib.send_message.
-
-- Issue #17278: Fix a crash in heapq.heappush() and heapq.heappop() when
-  the list is being resized concurrently.
-
-- Issue #16962: Use getdents64 instead of the obsolete getdents syscall
-  in the subprocess module on Linux.
-
-- Issue #17018: Make Process.join() retry if os.waitpid() fails with EINTR.
-
-- Issue #17223: array module: Fix a crasher when converting an array containing
-  invalid characters (outside range [U+0000; U+10ffff]) to Unicode:
-  repr(array), str(array) and array.tounicode(). Patch written by Manuel Jacob.
-
-- Issue #14720: sqlite3: Convert datetime microseconds correctly.
-  Patch by Lowe Thiderman.
-
-- Issue #17225: JSON decoder now counts columns in the first line starting
-  with 1, as in other lines.
-
-- 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 #16564: Fixed regression relative to Python2 in the operation of
-  email.encoders.encode_noop when used with binary data.
-
-- Issue #10355: The mode, name, encoding and newlines properties now work on
-  SpooledTemporaryFile objects even when they have not yet rolled over.
-  Obsolete method xreadline (which has never worked in Python 3) has been
-  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 #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 #12268: The io module file object write methods no longer abort early
-  when one of its write system calls is interrupted (EINTR).
-
-- 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 #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 #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 #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 #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 #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 #16618: Make glob.glob match consistently across strings and bytes
-  regarding leading dots.  Patch by 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 #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 #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 #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=[]``.
-
-IDLE
-----
-
-- Issue #17114: IDLE now uses non-strict config parser.
-
-- Issue #9290: In IDLE the sys.std* streams now implement io.TextIOBase
-  interface and support all mandatory methods and properties.
-
-- Issue #16829: IDLE printing no longer fails if there are spaces or other
-  special characters in the file path.
-
-- Issue #16491: IDLE now prints chained exception tracebacks.
-
-- Issue #16819: IDLE method completion now correctly works for bytes literals.
-
-- Issue #16504: IDLE now catches SyntaxErrors raised by tokenizer. Patch by
-  Roger Serwy.
-
-- Issue #16511: Use default IDLE width and height if config param is not valid.
-  Patch Serhiy Storchaka.
-
-- Issue #1207589: Add Cut/Copy/Paste items to IDLE right click Context Menu
-  Patch by Todd Rovito.
-
-Tests
------
+- Issue #11995: test_pydoc doesn't import all sys.path modules anymore.
 
 - Issue #17448: test_sax now skips if there are no xml parsers available
   instead of raising an ImportError.
@@ -2331,8 +5103,15 @@
 
 - Issue #13898: test_ssl no longer prints a spurious stack trace on Ubuntu.
 
+- Issue #17283: Share code between `__main__.py` and `regrtest.py` in
+  `Lib/test`.
+
 - Issue #17249: convert a test in test_capi to use unittest and reap threads.
 
+- Issue #17107: Test client-side SNI support in urllib.request thanks to
+  the new server-side SNI support in the ssl module.  Initial patch by
+  Daniel Black.
+
 - Issue #17041: Fix testing when Python is configured with the
   --without-doc-strings.
 
@@ -2399,6 +5178,11 @@
 
 - Issue #16748: test_heapq now works with unittest test discovery.
 
+- Issue #10646: Tests rearranged for os.samefile/samestat to check for not
+  just symlinks but also hard links.
+
+- Issue #15302: Switch regrtest from using getopt to using argparse.
+
 - Issue #15324: Fix regrtest parsing of --fromfile, --match, and --randomize
   options.
 
@@ -2408,6 +5192,9 @@
 - Issue #16664: Add regression tests for glob's behaviour concerning entries
   starting with a ".".  Patch by Sebastian Kreft.
 
+- Issue #13390: The ``-R`` option to regrtest now also checks for memory
+  allocation leaks, using :func:`sys.getallocatedblocks()`.
+
 - Issue #16559: Add more tests for the json module, including some from the
   official test suite at json.org.  Patch by Serhiy Storchaka.
 
@@ -2426,7 +5213,7 @@
 - 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
+- Issue #15557: Added a test suite for the webbrowser module, thanks to Anton
   Barkovsky.
 
 - Issue #16698: Skip posix test_getgroups when built with OS X
@@ -2435,6 +5222,30 @@
 Build
 -----
 
+- Issue #16067: Add description into MSI file to replace installer's
+  temporary name.
+
+- Issue #18257: Fix readlink usage in python-config.  Install the python
+  version again on Darwin.
+
+- Issue #18481: Add C coverage reporting with gcov and lcov. A new make target
+  "coverage-report" creates an instrumented Python build, runs unit tests
+  and creates a HTML. The report can be updated with "make coverage-lcov".
+
+- Issue #17845: Clarified the message printed when some module are not built.
+
+- Issue #18256: Compilation fix for recent AIX releases.  Patch by
+  David Edelsohn.
+
+- Issue #17547: In configure, explicitly pass -Wformat for the benefit for GCC
+  4.8.
+
+- Issue #15172: Document NASM 2.10+ as requirement for building OpenSSL 1.0.1
+  on Windows.
+
+- Issue #17591: Use lowercase filenames when including Windows header files.
+  Patch by Roumen Petrov.
+
 - Issue #17550: Fix the --enable-profiling configure switch.
 
 - Issue #17425: Build with openssl 1.0.1d on Windows.
@@ -2450,6 +5261,10 @@
 
 - Issue #3718: Use AC_ARG_VAR to set MACHDEP in configure.ac.
 
+- Issue #16235: Implement python-config as a shell script.
+
+- Issue #16769: Remove outdated Visual Studio projects.
+
 - Issue #17031: Fix running regen in cross builds.
 
 - Issue #3754: fix typo in pthread AC_CACHE_VAL.
@@ -2457,12 +5272,14 @@
 - Issue #15484: Fix _PYTHON_PROJECT_BASE for srcdir != builddir builds;
   use _PYTHON_PROJECT_BASE in distutils/sysconfig.py.
 
+- Drop support for Windows 2000 (changeset e52df05b496a).
+
 - 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.
+- Issue #16320: Remove redundant Makefile dependencies for strings and bytes.
 
 - Cross compiling needs host and build settings. configure no longer
   creates a broken PYTHON_FOR_BUILD variable when --build is missing.
@@ -2470,6 +5287,8 @@
 - Fix cross compiling issue in setup.py, ensure that lib_dirs and inc_dirs are
   defined in cross compiling mode, too.
 
+- Issue #16836: Enable IPv6 support even if IPv6 is disabled on the build host.
+
 - 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.
@@ -2484,6 +5303,8 @@
 - Issue #15923: Fix a mistake in ``asdl_c.py`` that resulted in a TypeError
   after 2801bf875a24 (see #15801).
 
+- Issue #16135: Remove OS/2 support.
+
 - Issue #15819: Make sure we can build Python out-of-tree from a read-only
   source directory.  (Somewhat related to issue #9860.)
 
@@ -2496,11 +5317,54 @@
 C-API
 -----
 
+- Issue #18351: Fix various issues in a function in importlib provided to help
+  PyImport_ExecCodeModuleWithPathnames() (and thus by extension
+  PyImport_ExecCodeModule() and PyImport_ExecCodeModuleEx()).
+
+- Issue #9369: The types of `char*` arguments of PyObject_CallFunction() and
+  PyObject_CallMethod() now changed to `const char*`.  Based on patches by
+  Jörg Müller and Lars Buitinck.
+
+- Issue #17206: Py_CLEAR(), Py_DECREF(), Py_XINCREF() and Py_XDECREF() now
+  expand their arguments once instead of multiple times.  Patch written by Illia
+  Polosukhin.
+
+- Issue #17522: Add the PyGILState_Check() API.
+
+- Issue #17327: Add PyDict_SetDefault.
+
 - Issue #16881: Fix Py_ARRAY_LENGTH macro for GCC < 3.1.
 
+- Issue #16505: Remove unused Py_TPFLAGS_INT_SUBCLASS.
+
+- Issue #16086: PyTypeObject.tp_flags and PyType_Spec.flags are now unsigned
+  (unsigned long and unsigned int) to avoid an undefined behaviour with
+  Py_TPFLAGS_TYPE_SUBCLASS ((1 << 31). PyType_GetFlags() result type is
+  now unsigned too (unsigned long, instead of long).
+
+- Issue #16166: Add PY_LITTLE_ENDIAN and PY_BIG_ENDIAN macros and unified
+  endianness detection and handling.
+
 Documentation
 -------------
 
+- Issue #17701: Improving strftime documentation.
+
+- Issue #18440: Clarify that `hash()` can truncate the value returned from an
+  object's custom `__hash__()` method.
+
+- Issue #17844: Add links to encoders and decoders for bytes-to-bytes codecs.
+
+- Issue #14097: improve the "introduction" page of the tutorial.
+
+- Issue #17977: The documentation for the cadefault argument's default value
+  in urllib.request.urlopen() is fixed to match the code.
+
+- Issue #6696: add documentation for the Profile objects, and improve
+  profile/cProfile docs.  Patch by Tom Pinckney.
+
+- Issue #15940: Specify effect of locale on time functions.
+
 - Issue 17538: Document XML vulnerabilties
 
 - Issue #16642: sched.scheduler timefunc initial default is time.monotonic.
@@ -2545,8 +5409,8 @@
 
 - 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 #16489: Make it clearer that importlib.find_loader() needs parent
+  packages to be explicitly imported.
 
 - Issue #16400: Update the description of which versions of a given package
   PyPI displays.
@@ -2569,6 +5433,9 @@
 - Issue #16115: Improve subprocess.Popen() documentation around args, shell,
   and executable arguments.
 
+- Issue #13498: Clarify docs of os.makedirs()'s exist_ok argument.  Done with
+  great native-speaker help from R. David Murray.
+
 - Issue #15533: Clarify docs and add tests for `subprocess.Popen()`'s cwd
   argument.
 
@@ -2589,17 +5456,47 @@
 Tools/Demos
 -----------
 
-- Issue #17156: pygettext.py now uses an encoding of source file and correctly
-  writes and escapes non-ascii characters.
+- Issue #18817: Fix a resource warning in Lib/aifc.py demo.  Patch by
+  Vajrasky Kok.
+
+- Issue #18439: Make patchcheck work on Windows for ACKS, NEWS.
+
+- Issue #18448: Fix a typo in Tools/demo/eiffel.py.
+
+- Issue #18457: Fixed saving of formulas and complex numbers in
+  Tools/demo/ss1.py.
+
+- Issue #18449: Make Tools/demo/ss1.py work again on Python 3.  Patch by
+  Févry Thibault.
+
+- Issue #12990: The "Python Launcher" on OSX could not launch python scripts
+  that have paths that include wide characters.
+
+- Issue #15239: Make mkstringprep.py work again on Python 3.
+
+- Issue #17028: Allowed Python arguments to be supplied to the Windows
+  launcher.
+
+- Issue #17156: pygettext.py now detects the encoding of source files and
+  correctly writes and escapes non-ascii characters.
 
 - 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.
+- Issue #11797: Add a 2to3 fixer that maps reload() to imp.reload().
 
-- Issue #16476: Fix json.tool to avoid including trailing whitespace.
+- Issue #10966: Remove the concept of unexpected skipped tests.
+
+- Issue #9893: Removed the Misc/Vim directory.
+
+- Removed the Misc/TextMate directory.
+
+- Issue #16245: Add the Tools/scripts/parse_html5_entities.py script to parse
+  the list of HTML5 entities and update the html.entities.html5 dictionary.
+
+- Issue #15378: Fix Tools/unicode/comparecodecs.py.  Patch by Serhiy Storchaka.
 
 - Issue #16549: Make json.tool work again on Python 3 and add tests.
   Initial patch by Berker Peksag and Serhiy Storchaka.
@@ -2607,6 +5504,12 @@
 - Issue #13301: use ast.literal_eval() instead of eval() in Tools/i18n/msgfmt.py
   Patch by Serhiy Storchaka.
 
+Windows
+-------
+
+- Issue #18569: The installer now adds .py to the PATHEXT variable when extensions
+  are registered. Patch by Paul Moore.
+
 
 What's New in Python 3.3.0?
 ===========================
@@ -2694,6 +5597,9 @@
 Library
 -------
 
+- Issue #17158: Add 'symbols' to help() welcome message; clarify
+  'modules spam' messages.
+
 - Issue #15847: Fix a regression in argparse, which did not accept tuples as
   argument lists anymore.
 
@@ -3184,6 +6090,10 @@
 - Issue #15250: Document that `filecmp.dircmp()` compares files shallowly. Patch
   contributed by Chris Jerdonek.
 
+- Issue #15442: Expose the default list of directories ignored by
+  `filecmp.dircmp()` as a module attribute, and expand the list to more modern
+  values.
+
 Tests
 -----
 
@@ -3296,9 +6206,6 @@
 Library
 -------
 
-- Issue #16305: Fix a segmentation fault occurring when interrupting
-  math.factorial.
-
 - Issue #12288: Consider '0' and '0.0' as valid initialvalue
   for tkinter SimpleDialog.
 
@@ -4626,7 +7533,7 @@
   deallocator calls one of the methods on the type (e.g. when subclassing
   IOBase).  Diagnosis and patch by Davide Rizzo.
 
-- Issue #9611, #9015: FileIO.read() clamps the length to INT_MAX on Windows.
+- Issue #9611, Issue #9015: FileIO.read() clamps the length to INT_MAX on Windows.
 
 - Issue #9642: Uniformize the tests on the availability of the mbcs codec, add
   a new HAVE_MBCS define.
@@ -4993,7 +7900,7 @@
 - Issue #13589: Fix some serialization primitives in the aifc module.
   Patch by Oleg Plakhotnyuk.
 
-- Issue #13642: Unquote before b64encoding ``user:password`` during Basic
+- Issue #13642: Unquote before b64encoding user:password during Basic
   Authentication. Patch contributed by Joonas Kuorilehto.
 
 - Issue #12364: Fix a hang in concurrent.futures.ProcessPoolExecutor.
@@ -5094,7 +8001,7 @@
   'importlib.abc.PyPycLoader', 'nntplib.NNTP.xgtitle', 'nntplib.NNTP.xpath',
   and private attributes of 'smtpd.SMTPChannel'.
 
-- Issue #5905, #13560: time.strftime() is now using the current locale
+- Issue #5905, Issue #13560: time.strftime() is now using the current locale
   encoding, instead of UTF-8, if the wcsftime() function is not available.
 
 - Issue #13464: Add a readinto() method to http.client.HTTPResponse.  Patch
@@ -5452,8 +8359,8 @@
 - Issue #12607: In subprocess, fix issue where if stdin, stdout or stderr is
   given as a low fd, it gets overwritten.
 
-- Issue #12576: Fix urlopen behavior on sites which do not send (or obfuscate)
-  a ``Connection: close`` header.
+- Issue #12576: Fix urlopen behavior on sites which do not send (or obfuscates)
+  ``Connection: close`` header.
 
 - Issue #12560: Build libpython.so on OpenBSD. Patch by Stefan Sperling.
 
@@ -6011,6 +8918,9 @@
 - Issue #11635: Don't use polling in worker threads and processes launched by
   concurrent.futures.
 
+- Issue #5845: Automatically read readline configuration to enable completion
+  in interactive mode.
+
 - Issue #6811: Allow importlib to change a code object's co_filename attribute
   to match the path to where the source code currently is, not where the code
   object originally came from.
@@ -6687,6 +9597,10 @@
 Documentation
 -------------
 
+- Issue #23006: Improve the documentation and indexing of dict.__missing__.
+  Add an entry in the language datamodel special methods section.
+  Revise and index its discussion in the stdtypes mapping/dict section.
+
 - Issue #13989: Document that GzipFile does not support text mode, and give a
   more helpful error message when opened with an invalid mode string.
 
diff --git a/Misc/README b/Misc/README
index 118f6c7..e7780a2 100644
--- a/Misc/README
+++ b/Misc/README
@@ -22,9 +22,7 @@
 README.coverity         Information about running Coverity's Prevent on Python
 README.valgrind         Information for Valgrind users, see valgrind-python.supp
 RPM                     (Old) tools to build RPMs
-svnmap.txt              Map of old SVN revs and branches to hg changeset ids
 SpecialBuilds.txt       Describes extra symbols you can set for debug builds
-TextMate                A TextMate bundle for Python development
+svnmap.txt              Map of old SVN revs and branches to hg changeset ids
 valgrind-python.supp    Valgrind suppression file, see README.valgrind
 vgrindefs               Python configuration for vgrind (a generic pretty printer)
-Vim                     Python development utilities for the Vim editor
diff --git a/Misc/RPM/python-3.3.spec b/Misc/RPM/python-3.4.spec
similarity index 98%
rename from Misc/RPM/python-3.3.spec
rename to Misc/RPM/python-3.4.spec
index 350c647..dc83c18 100644
--- a/Misc/RPM/python-3.3.spec
+++ b/Misc/RPM/python-3.4.spec
@@ -39,8 +39,8 @@
 
 %define name python
 #--start constants--
-%define version 3.3.6
-%define libvers 3.3
+%define version 3.4.2
+%define libvers 3.4
 #--end constants--
 %define release 1pydotorg
 %define __prefix /usr
@@ -83,8 +83,7 @@
 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 PCs under Windows, MS-DOS, and OS/2, and on the
-Mac.
+brands of UNIX, on PCs under Windows, MS-DOS, and on the Mac.
 
 %package devel
 Summary: The libraries and header files needed for Python extension development.
diff --git a/Misc/SpecialBuilds.txt b/Misc/SpecialBuilds.txt
index f869e7c..732cb00 100644
--- a/Misc/SpecialBuilds.txt
+++ b/Misc/SpecialBuilds.txt
@@ -13,12 +13,14 @@
 ------------
 
 Turn on aggregate reference counting.  This arranges that extern _Py_RefTotal
-hold a count of all references, the sum of ob_refcnt across all objects.  In a
-debug-mode build, this is where the "8288" comes from in
+hold a count of all references, the sum of ob_refcnt across all objects.
+Passing ``-X showrefcount`` on the command line causes the interactive
+interpreter to print the reference count total as well the number of memory
+blocks allocated after each statement:
 
     >>> 23
     23
-    [8288 refs]
+    [8288 refs, 14332 blocks]
     >>>
 
 Note that if this count increases when you're not storing away new objects,
@@ -105,7 +107,9 @@
 p[-2*S:-S]
     Number of bytes originally asked for.  This is a size_t, big-endian (easier
     to read in a memory dump).
-p[-S:0]
+p[-S]
+    API ID.  See PEP 445.  This is a character, but seems undocumented.
+p[-S+1:0]
     Copies of FORBIDDENBYTE.  Used to catch under- writes and reads.
 p[0:N]
     The requested memory, filled with copies of CLEANBYTE, used to catch
diff --git a/Misc/TextMate/Python-Dev.tmbundle/Commands/2 to 3 - Module Deletion.tmCommand b/Misc/TextMate/Python-Dev.tmbundle/Commands/2 to 3 - Module Deletion.tmCommand
deleted file mode 100644
index 3cfada8..0000000
--- a/Misc/TextMate/Python-Dev.tmbundle/Commands/2 to 3 - Module Deletion.tmCommand
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>beforeRunningCommand</key>
-	<string>nop</string>
-	<key>command</key>
-	<string>#!/usr/bin/python
-"""Generate code to warn about a module's removal in Python 3.0.
-
-XXX Not supported:
-- Module's in a package do not have their full name generated.
-- Package's __init__ module; should detect and use the package's name instead.
-
-"""
-py_template = """from warnings import warnpy3k
-warnpy3k("the ${1:%s} module has been removed in Python 3.0", stacklevel=2)
-del warnpy3k$0"""
-
-c_template = """
-if (PyErr_WarnPy3k("the ${1:%s} module has been removed in "
-                   "Python 3.0", 2) &lt; 0)
-    return;$0"""
-
-
-import imp
-import os
-
-file_name = os.path.split(os.environ['TM_FILEPATH'])[1]
-
-py_suffixes = reversed(sorted((suffix[0] for suffix in imp.get_suffixes() if suffix[2] == imp.PY_SOURCE), key=len))
-c_suffixes = reversed(sorted((os.path.splitext(suffix[0])[0] + '.c'
-                                for suffix in imp.get_suffixes() if suffix[2] == imp.C_EXTENSION), key=len))
-
-pairings = ((py_suffixes, py_template), (c_suffixes, c_template))
-
-def create_template(suffixes, template):
-    for suffix in suffixes:
-        if not file_name.endswith(suffix):
-            continue
-        module_name = file_name[:-len(suffix)]
-        return template % module_name
-    else:
-        return None
-
-for template in (create_template(*pair) for pair in pairings):
-    if not template:
-        continue
-    print template,
-    break
-else:
-    print 'XXX Could not generate code.'</string>
-	<key>input</key>
-	<string>none</string>
-	<key>name</key>
-	<string>2 to 3 - Module Deletion</string>
-	<key>output</key>
-	<string>insertAsSnippet</string>
-	<key>tabTrigger</key>
-	<string>2to3moddel</string>
-	<key>uuid</key>
-	<string>9519C22B-6AB8-41A1-94F6-079E0B45C147</string>
-</dict>
-</plist>
diff --git a/Misc/TextMate/Python-Dev.tmbundle/Commands/Build Docs.tmCommand b/Misc/TextMate/Python-Dev.tmbundle/Commands/Build Docs.tmCommand
deleted file mode 100644
index 7e4d53b..0000000
--- a/Misc/TextMate/Python-Dev.tmbundle/Commands/Build Docs.tmCommand
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>beforeRunningCommand</key>
-	<string>nop</string>
-	<key>command</key>
-	<string># XXX Leopard-specific unless have easy way to specific alternative Python executable.
-
-cd $TM_PROJECT_DIRECTORY/Doc
-make html 2&gt;&amp;1 | pre
-
-rescan_project</string>
-	<key>input</key>
-	<string>none</string>
-	<key>name</key>
-	<string>Build Docs</string>
-	<key>output</key>
-	<string>showAsHTML</string>
-	<key>uuid</key>
-	<string>6EF151E5-7149-4F82-8796-0CC40FE589FA</string>
-</dict>
-</plist>
diff --git a/Misc/TextMate/Python-Dev.tmbundle/Commands/Build.tmCommand b/Misc/TextMate/Python-Dev.tmbundle/Commands/Build.tmCommand
deleted file mode 100644
index 6ffda5c..0000000
--- a/Misc/TextMate/Python-Dev.tmbundle/Commands/Build.tmCommand
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>beforeRunningCommand</key>
-	<string>nop</string>
-	<key>command</key>
-	<string># XXX TODO
-# - Highlight any compiler warnings for Python code.
-# - Point out if compile failed.
-
-cd $TM_PROJECT_DIRECTORY
-make -s -j2 2&gt;&amp;1 | pre
-
-rescan_project</string>
-	<key>input</key>
-	<string>none</string>
-	<key>name</key>
-	<string>Build Python</string>
-	<key>output</key>
-	<string>showAsHTML</string>
-	<key>uuid</key>
-	<string>B545BB1B-A8E1-426C-B50A-426E78B96D38</string>
-</dict>
-</plist>
diff --git a/Misc/TextMate/Python-Dev.tmbundle/Commands/Go to Issue.tmCommand b/Misc/TextMate/Python-Dev.tmbundle/Commands/Go to Issue.tmCommand
deleted file mode 100644
index 65d30bc..0000000
--- a/Misc/TextMate/Python-Dev.tmbundle/Commands/Go to Issue.tmCommand
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>beforeRunningCommand</key>
-	<string>nop</string>
-	<key>command</key>
-	<string>open "http://bugs.python.org/issue$(cat)"</string>
-	<key>fallbackInput</key>
-	<string>word</string>
-	<key>input</key>
-	<string>selection</string>
-	<key>name</key>
-	<string>Go to Issue</string>
-	<key>output</key>
-	<string>discard</string>
-	<key>uuid</key>
-	<string>FD25A8DC-22DC-4ED4-B222-B943C8A9117D</string>
-</dict>
-</plist>
diff --git a/Misc/TextMate/Python-Dev.tmbundle/Commands/Open Docs.tmCommand b/Misc/TextMate/Python-Dev.tmbundle/Commands/Open Docs.tmCommand
deleted file mode 100644
index 501be43..0000000
--- a/Misc/TextMate/Python-Dev.tmbundle/Commands/Open Docs.tmCommand
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>beforeRunningCommand</key>
-	<string>nop</string>
-	<key>command</key>
-	<string># Search order:
-#  - Current project.
-#  - TM_PYTHONDEV_DOCS.
-#  - Online docs in development.
-
-html_index=$TM_PROJECT_DIRECTORY/Doc/build/html/index.html
-if [[ -f $html_index ]]; then
-	open $html_index
-elif [[ $TM_PYTHONDEV_DOCS ]]; then
-	open $TM_PYTHONDEV_DOCS
-else
-	open http://docs.python.org/dev/
-fi</string>
-	<key>input</key>
-	<string>none</string>
-	<key>keyEquivalent</key>
-	<string>@H</string>
-	<key>name</key>
-	<string>Open Docs</string>
-	<key>output</key>
-	<string>discard</string>
-	<key>uuid</key>
-	<string>BF336FFF-E14D-4BF1-A156-71CF768AC034</string>
-</dict>
-</plist>
diff --git a/Misc/TextMate/Python-Dev.tmbundle/Commands/Open PEP.tmCommand b/Misc/TextMate/Python-Dev.tmbundle/Commands/Open PEP.tmCommand
deleted file mode 100644
index af5533a..0000000
--- a/Misc/TextMate/Python-Dev.tmbundle/Commands/Open PEP.tmCommand
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>beforeRunningCommand</key>
-	<string>nop</string>
-	<key>command</key>
-	<string># XXX Worth supporting using a local copy?
-
-# Dumb luck that an unrecognized number leads to a 0 being used.
-open `printf "http://www.python.org/dev/peps/pep-%04d" $(cat)`</string>
-	<key>fallbackInput</key>
-	<string>word</string>
-	<key>input</key>
-	<string>selection</string>
-	<key>name</key>
-	<string>Open PEP</string>
-	<key>output</key>
-	<string>discard</string>
-	<key>uuid</key>
-	<string>EDBB037F-AAE3-4512-863F-D9AA82C9E51E</string>
-</dict>
-</plist>
diff --git "a/Misc/TextMate/Python-Dev.tmbundle/Snippets/2 to 3 - Module Deletion \050docs\051.tmSnippet" "b/Misc/TextMate/Python-Dev.tmbundle/Snippets/2 to 3 - Module Deletion \050docs\051.tmSnippet"
deleted file mode 100644
index 5de8bae..0000000
--- "a/Misc/TextMate/Python-Dev.tmbundle/Snippets/2 to 3 - Module Deletion \050docs\051.tmSnippet"
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>content</key>
-	<string>.. deprecated:: 2.6
-   The :mod:\`${1}\` module has been deprecated for removal in Python 3.0.
-${0}</string>
-	<key>name</key>
-	<string>2 to 3 - Module Deletion (docs)</string>
-	<key>tabTrigger</key>
-	<string>2to3docdel</string>
-	<key>uuid</key>
-	<string>0568410D-EAF1-4AF3-B6DE-8AF133A91821</string>
-</dict>
-</plist>
diff --git a/Misc/TextMate/Python-Dev.tmbundle/info.plist b/Misc/TextMate/Python-Dev.tmbundle/info.plist
deleted file mode 100644
index 0510d5d..0000000
--- a/Misc/TextMate/Python-Dev.tmbundle/info.plist
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>mainMenu</key>
-	<dict>
-		<key>items</key>
-		<array>
-			<string>9519C22B-6AB8-41A1-94F6-079E0B45C147</string>
-			<string>0568410D-EAF1-4AF3-B6DE-8AF133A91821</string>
-			<string>------------------------------------</string>
-			<string>B545BB1B-A8E1-426C-B50A-426E78B96D38</string>
-			<string>6EF151E5-7149-4F82-8796-0CC40FE589FA</string>
-			<string>------------------------------------</string>
-			<string>BF336FFF-E14D-4BF1-A156-71CF768AC034</string>
-			<string>FD25A8DC-22DC-4ED4-B222-B943C8A9117D</string>
-			<string>EDBB037F-AAE3-4512-863F-D9AA82C9E51E</string>
-		</array>
-		<key>submenus</key>
-		<dict/>
-	</dict>
-	<key>name</key>
-	<string>Python-Dev</string>
-	<key>ordering</key>
-	<array>
-		<string>9519C22B-6AB8-41A1-94F6-079E0B45C147</string>
-		<string>0568410D-EAF1-4AF3-B6DE-8AF133A91821</string>
-		<string>B545BB1B-A8E1-426C-B50A-426E78B96D38</string>
-		<string>6EF151E5-7149-4F82-8796-0CC40FE589FA</string>
-		<string>FD25A8DC-22DC-4ED4-B222-B943C8A9117D</string>
-		<string>BF336FFF-E14D-4BF1-A156-71CF768AC034</string>
-		<string>EDBB037F-AAE3-4512-863F-D9AA82C9E51E</string>
-	</array>
-	<key>uuid</key>
-	<string>A932ECD1-D43A-4F57-B7FB-A1CEC3B65D20</string>
-</dict>
-</plist>
diff --git a/Misc/Vim/python.vim b/Misc/Vim/python.vim
deleted file mode 100644
index 11ee7eb..0000000
--- a/Misc/Vim/python.vim
+++ /dev/null
@@ -1,148 +0,0 @@
-" Auto-generated Vim syntax file for Python (trunk: r60376M).
-"
-" To use: copy or symlink to ~/.vim/syntax/python.vim
-
-
-if exists("b:current_syntax")
-  finish
-endif
-
-if exists("python_highlight_all")
-  let python_highlight_numbers = 1
-  let python_highlight_builtins = 1
-  let python_highlight_exceptions = 1
-  let python_highlight_space_errors = 1
-endif
-
-syn keyword pythonStatement    as assert break continue del except exec finally
-syn keyword pythonStatement    global lambda pass print raise return try with
-syn keyword pythonStatement    yield
-
-syn keyword pythonStatement    def class nextgroup=pythonFunction skipwhite
-
-syn match pythonFunction    "[a-zA-Z_][a-zA-Z0-9_]*" contained
-
-syn keyword pythonRepeat    for while
-
-syn keyword pythonConditional    if elif else
-
-syn keyword pythonOperator    and in is not or
-
-syn keyword pythonPreCondit    import from
-
-syn match pythonComment    "#.*$" contains=pythonTodo
-
-syn keyword pythonTodo    TODO FIXME XXX contained
-
-syn region pythonString    matchgroup=Normal start=+[uU]\='+ end=+'+ skip=+\\\\\|\\'+ contains=pythonEscape
-syn region pythonString    matchgroup=Normal start=+[uU]\="+ end=+"+ skip=+\\\\\|\\"+ contains=pythonEscape
-syn region pythonString    matchgroup=Normal start=+[uU]\="""+ end=+"""+  contains=pythonEscape
-syn region pythonString    matchgroup=Normal start=+[uU]\='''+ end=+'''+  contains=pythonEscape
-syn region pythonString    matchgroup=Normal start=+[uU]\=[rR]'+ end=+'+ skip=+\\\\\|\\'+ 
-syn region pythonString    matchgroup=Normal start=+[uU]\=[rR]"+ end=+"+ skip=+\\\\\|\\"+ 
-syn region pythonString    matchgroup=Normal start=+[uU]\=[rR]"""+ end=+"""+  
-syn region pythonString    matchgroup=Normal start=+[uU]\=[rR]'''+ end=+'''+  
-
-syn match pythonEscape    +\\[abfnrtv\'"\\]+ contained
-syn match pythonEscape    "\\\o\{1,3}" contained
-syn match pythonEscape    "\\x\x\{2}" contained
-syn match pythonEscape    "\(\\u\x\{4}\|\\U\x\{8}\)" contained
-
-syn match pythonEscape    "\\$"
-
-
-if exists("python_highlight_numbers")
-  syn match pythonNumber    "\<0x\x\+[Ll]\=\>"
-  syn match pythonNumber    "\<\d\+[LljJ]\=\>"
-  syn match pythonNumber    "\.\d\+\([eE][+-]\=\d\+\)\=[jJ]\=\>"
-  syn match pythonNumber    "\<\d\+\.\([eE][+-]\=\d\+\)\=[jJ]\=\>"
-  syn match pythonNumber    "\<\d\+\.\d\+\([eE][+-]\=\d\+\)\=[jJ]\=\>"
-
-endif
-
-
-if exists("python_highlight_builtins")
-  syn keyword pythonBuiltin    Ellipsis False None NotImplemented True __debug__
-  syn keyword pythonBuiltin    __import__ abs all any bool
-  syn keyword pythonBuiltin    buffer callable chr classmethod cmp
-  syn keyword pythonBuiltin    complex copyright credits delattr dict
-  syn keyword pythonBuiltin    dir divmod enumerate eval exec exit
-  syn keyword pythonBuiltin    filter float frozenset getattr globals hasattr
-  syn keyword pythonBuiltin    hash help hex id int isinstance
-  syn keyword pythonBuiltin    issubclass iter len license list locals map
-  syn keyword pythonBuiltin    max min object oct open ord pow property quit
-  syn keyword pythonBuiltin    range reload repr reversed round
-  syn keyword pythonBuiltin    set setattr slice sorted staticmethod str sum
-  syn keyword pythonBuiltin    super trunc tuple type unicode vars 
-  syn keyword pythonBuiltin    zip
-
-endif
-
-
-if exists("python_highlight_exceptions")
-  syn keyword pythonException    ArithmeticError AssertionError AttributeError
-  syn keyword pythonException    BaseException DeprecationWarning EOFError
-  syn keyword pythonException    EnvironmentError Exception FloatingPointError
-  syn keyword pythonException    FutureWarning GeneratorExit IOError ImportError
-  syn keyword pythonException    ImportWarning IndentationError IndexError
-  syn keyword pythonException    KeyError KeyboardInterrupt LookupError
-  syn keyword pythonException    MemoryError NameError NotImplementedError
-  syn keyword pythonException    OSError OverflowError PendingDeprecationWarning
-  syn keyword pythonException    ReferenceError RuntimeError RuntimeWarning
-  syn keyword pythonException    StopIteration SyntaxError
-  syn keyword pythonException    SyntaxWarning SystemError SystemExit TabError
-  syn keyword pythonException    TypeError UnboundLocalError UnicodeDecodeError
-  syn keyword pythonException    UnicodeEncodeError UnicodeError
-  syn keyword pythonException    UnicodeTranslateError UnicodeWarning
-  syn keyword pythonException    UserWarning ValueError Warning
-  syn keyword pythonException    ZeroDivisionError
-
-endif
-
-
-if exists("python_highlight_space_errors")
-  syn match pythonSpaceError    display excludenl "\S\s\+$"ms=s+1
-  syn match pythonSpaceError    display " \+\t"
-  syn match pythonSpaceError    display "\t\+ "
-
-endif
-
-
-  hi def link pythonStatement Statement
-  hi def link pythonStatement Statement
-  hi def link pythonFunction Function
-  hi def link pythonRepeat Repeat
-  hi def link pythonConditional Conditional
-  hi def link pythonOperator Operator
-  hi def link pythonPreCondit PreCondit
-  hi def link pythonComment Comment
-  hi def link pythonTodo Todo
-  hi def link pythonString String
-  hi def link pythonEscape Special
-  hi def link pythonEscape Special
-
-  if exists("python_highlight_numbers")
-    hi def link pythonNumber Number
-  endif
-
-  if exists("python_highlight_builtins")
-    hi def link pythonBuiltin Function
-  endif
-
-  if exists("python_highlight_exceptions")
-    hi def link pythonException Exception
-  endif
-
-  if exists("python_highlight_space_errors")
-    hi def link pythonSpaceError Error
-  endif
-
-
-" Uncomment the 'minlines' statement line and comment out the 'maxlines'
-" statement line; changes behaviour to look at least 2000 lines previously for
-" syntax matches instead of at most 200 lines
-syn sync match pythonSync grouphere NONE "):$"
-syn sync maxlines=200
-"syn sync minlines=2000
-
-let b:current_syntax = "python"
diff --git a/Misc/Vim/syntax_test.py b/Misc/Vim/syntax_test.py
deleted file mode 100644
index 1d20866..0000000
--- a/Misc/Vim/syntax_test.py
+++ /dev/null
@@ -1,62 +0,0 @@
-"""Test file for syntax highlighting of editors.
-
-Meant to cover a wide range of different types of statements and expressions.
-Not necessarily sensical or comprehensive (assume that if one exception is
-highlighted that all are, for instance).
-
-Extraneous trailing whitespace can't be tested because of svn pre-commit hook
-checks for such things.
-
-"""
-# Comment
-# OPTIONAL: XXX catch your attention
-
-# Statements
-from __future__ import with_statement  # Import
-from sys import path as thing
-assert True # keyword
-def foo():  # function definition
-    return []
-class Bar(object):  # Class definition
-    def __enter__(self):
-        pass
-    def __exit__(self, *args):
-        pass
-foo()  # UNCOLOURED: function call
-while False:  # 'while'
-    continue
-for x in foo():  # 'for'
-    break
-with Bar() as stuff:
-    pass
-if False: pass  # 'if'
-elif False: pass
-else: pass
-
-# Constants
-'single-quote', u'unicode' # Strings of all kinds; prefixes not highlighted
-"double-quote"
-"""triple double-quote"""
-'''triple single-quote'''
-r'raw'
-ur'unicode raw'
-'escape\n'
-'\04'  # octal
-'\xFF' # hex
-'\u1111' # unicode character
-1  # Integral
-1L
-1.0  # Float
-.1
-1+2j  # Complex
-
-# Expressions
-1 and 2 or 3  # Boolean operators
-2 < 3  # UNCOLOURED: comparison operators
-spam = 42  # UNCOLOURED: assignment
-2 + 3  # UNCOLOURED: number operators
-[]  # UNCOLOURED: list
-{}  # UNCOLOURED: dict
-(1,)  # UNCOLOURED: tuple
-all  # Built-in functions
-GeneratorExit  # Exceptions
diff --git a/Misc/Vim/vim_syntax.py b/Misc/Vim/vim_syntax.py
deleted file mode 100644
index 172b350..0000000
--- a/Misc/Vim/vim_syntax.py
+++ /dev/null
@@ -1,229 +0,0 @@
-from __future__ import with_statement
-# XXX(nnorwitz): what versions of python is this file supposed to work with?
-# It uses the old print statement not in py3k.
-
-import keyword
-import exceptions
-import builtins
-from string import Template
-from sys import subversion
-
-comment_header = '''" Auto-generated Vim syntax file for Python (%s: r%s).
-"
-" To use: copy or symlink to ~/.vim/syntax/python.vim'''
-
-statement_header = """
-if exists("b:current_syntax")
-  finish
-endif"""
-
-statement_footer = '''
-" Uncomment the 'minlines' statement line and comment out the 'maxlines'
-" statement line; changes behaviour to look at least 2000 lines previously for
-" syntax matches instead of at most 200 lines
-syn sync match pythonSync grouphere NONE "):$"
-syn sync maxlines=200
-"syn sync minlines=2000
-
-let b:current_syntax = "python"'''
-
-looping = ('for', 'while')
-conditionals = ('if', 'elif', 'else')
-boolean_ops = ('and', 'in', 'is', 'not', 'or')
-import_stmts = ('import', 'from')
-object_defs = ('def', 'class')
-
-exception_names = sorted(exc for exc in dir(exceptions)
-                                if not exc.startswith('__'))
-
-# Need to include functions that start with '__' (e.g., __import__), but
-# nothing that comes with modules (e.g., __name__), so just exclude anything in
-# the 'exceptions' module since we want to ignore exceptions *and* what any
-# module would have
-builtin_names = sorted(builtin for builtin in dir(builtins)
-                            if builtin not in dir(exceptions))
-
-escapes = (r'+\\[abfnrtv\'"\\]+', r'"\\\o\{1,3}"', r'"\\x\x\{2}"',
-            r'"\(\\u\x\{4}\|\\U\x\{8}\)"', r'"\\$"')
-
-todos = ("TODO", "FIXME", "XXX")
-
-# XXX codify?
-numbers = (r'"\<0x\x\+[Ll]\=\>"', r'"\<\d\+[LljJ]\=\>"',
-            '"\.\d\+\([eE][+-]\=\d\+\)\=[jJ]\=\>"',
-            '"\<\d\+\.\([eE][+-]\=\d\+\)\=[jJ]\=\>"',
-            '"\<\d\+\.\d\+\([eE][+-]\=\d\+\)\=[jJ]\=\>"')
-
-contained = lambda x: "%s contained" % x
-
-def str_regexes():
-    """Generator to yield various combinations of strings regexes"""
-    regex_template = Template('matchgroup=Normal ' +
-                                'start=+[uU]\=${raw}${sep}+ ' +
-                                'end=+${sep}+ ' +
-                                '${skip} ' +
-                                '${contains}')
-    skip_regex = Template(r'skip=+\\\\\|\\${sep}+')
-    for raw in ('', '[rR]'):
-        for separator in ("'", '"', '"""', "'''"):
-            if len(separator) == 1:
-                skip = skip_regex.substitute(sep=separator)
-            else:
-                skip = ''
-            contains = 'contains=pythonEscape' if not raw else ''
-            yield regex_template.substitute(raw=raw, sep=separator, skip=skip,
-                                            contains = contains)
-
-space_errors = (r'excludenl "\S\s\+$"ms=s+1', r'" \+\t"', r'"\t\+ "')
-
-statements = (
-                ('',
-                    # XXX Might need to change pythonStatement since have
-                    # specific Repeat, Conditional, Operator, etc. for 'while',
-                    # etc.
-                    [("Statement", "pythonStatement", "keyword",
-                        (kw for kw in keyword.kwlist
-                            if kw not in (looping + conditionals + boolean_ops +
-                                        import_stmts + object_defs))
-                      ),
-                     ("Statement", "pythonStatement", "keyword",
-                         (' '.join(object_defs) +
-                             ' nextgroup=pythonFunction skipwhite')),
-                     ("Function","pythonFunction", "match",
-                         contained('"[a-zA-Z_][a-zA-Z0-9_]*"')),
-                     ("Repeat", "pythonRepeat", "keyword", looping),
-                     ("Conditional", "pythonConditional", "keyword",
-                         conditionals),
-                     ("Operator", "pythonOperator", "keyword", boolean_ops),
-                     ("PreCondit", "pythonPreCondit", "keyword", import_stmts),
-                     ("Comment", "pythonComment", "match",
-                         '"#.*$" contains=pythonTodo'),
-                     ("Todo", "pythonTodo", "keyword",
-                         contained(' '.join(todos))),
-                     ("String", "pythonString", "region", str_regexes()),
-                     ("Special", "pythonEscape", "match",
-                         (contained(esc) for esc in escapes
-                             if not '$' in esc)),
-                     ("Special", "pythonEscape", "match", r'"\\$"'),
-                    ]
-                ),
-                ("python_highlight_numbers",
-                    [("Number", "pythonNumber", "match", numbers)]
-                ),
-                ("python_highlight_builtins",
-                    [("Function", "pythonBuiltin", "keyword", builtin_names)]
-                ),
-                ("python_highlight_exceptions",
-                    [("Exception", "pythonException", "keyword",
-                        exception_names)]
-                ),
-                ("python_highlight_space_errors",
-                    [("Error", "pythonSpaceError", "match",
-                        ("display " + err for err in space_errors))]
-                )
-             )
-
-def syn_prefix(type_, kind):
-    return 'syn %s %s    ' % (type_, kind)
-
-def fill_stmt(iterable, fill_len):
-    """Yield a string that fills at most fill_len characters with strings
-    returned by 'iterable' and separated by a space"""
-    # Deal with trailing char to handle ' '.join() calculation
-    fill_len += 1
-    overflow = None
-    it = iter(iterable)
-    while True:
-        buffer_ = []
-        total_len = 0
-        if overflow:
-            buffer_.append(overflow)
-            total_len += len(overflow) + 1
-            overflow = None
-        while total_len < fill_len:
-            try:
-                new_item = next(it)
-                buffer_.append(new_item)
-                total_len += len(new_item) + 1
-            except StopIteration:
-                if buffer_:
-                    break
-                if overflow:
-                    yield overflow
-                return
-        if total_len > fill_len:
-            overflow = buffer_.pop()
-            total_len -= len(overflow) - 1
-        ret = ' '.join(buffer_)
-        assert len(ret) <= fill_len
-        yield ret
-
-FILL = 80
-
-def main(file_path):
-    with open(file_path, 'w') as FILE:
-        # Comment for file
-        print>>FILE, comment_header % subversion[1:]
-        print>>FILE, ''
-        # Statements at start of file
-        print>>FILE, statement_header
-        print>>FILE, ''
-        # Generate case for python_highlight_all
-        print>>FILE, 'if exists("python_highlight_all")'
-        for statement_var, statement_parts in statements:
-            if statement_var:
-                print>>FILE, '  let %s = 1' % statement_var
-        else:
-            print>>FILE, 'endif'
-            print>>FILE, ''
-        # Generate Python groups
-        for statement_var, statement_parts in statements:
-            if statement_var:
-                print>>FILE, 'if exists("%s")' % statement_var
-                indent = '  '
-            else:
-                indent = ''
-            for colour_group, group, type_, arguments in statement_parts:
-                if not isinstance(arguments, basestring):
-                    prefix = syn_prefix(type_, group)
-                    if type_ == 'keyword':
-                        stmt_iter = fill_stmt(arguments,
-                                            FILL - len(prefix) - len(indent))
-                        try:
-                            while True:
-                                print>>FILE, indent + prefix + next(stmt_iter)
-                        except StopIteration:
-                            print>>FILE, ''
-                    else:
-                        for argument in arguments:
-                            print>>FILE, indent + prefix + argument
-                        else:
-                            print>>FILE, ''
-
-                else:
-                    print>>FILE, indent + syn_prefix(type_, group) + arguments
-                    print>>FILE, ''
-            else:
-                if statement_var:
-                    print>>FILE, 'endif'
-                    print>>FILE, ''
-            print>>FILE, ''
-        # Associating Python group with Vim colour group
-        for statement_var, statement_parts in statements:
-            if statement_var:
-                print>>FILE, '  if exists("%s")' % statement_var
-                indent = '    '
-            else:
-                indent = '  '
-            for colour_group, group, type_, arguments in statement_parts:
-                print>>FILE, (indent + "hi def link %s %s" %
-                                (group, colour_group))
-            else:
-                if statement_var:
-                    print>>FILE, '  endif'
-                print>>FILE, ''
-        # Statements at the end of the file
-        print>>FILE, statement_footer
-
-if __name__ == '__main__':
-    main("python.vim")
diff --git a/Misc/Vim/vimrc b/Misc/Vim/vimrc
deleted file mode 100644
index c398cca..0000000
--- a/Misc/Vim/vimrc
+++ /dev/null
@@ -1,87 +0,0 @@
-" vimrc file for following the coding standards specified in PEP 7 & 8.
-"
-" To use this file, source it in your own personal .vimrc file (``source
-" <filename>``) or, if you don't have a .vimrc file, you can just symlink to it
-" (``ln -s <this file> ~/.vimrc``).  All options are protected by autocmds
-" (read below for an explanation of the command) so blind sourcing of this file
-" is safe and will not affect your settings for non-Python or non-C files.
-"
-"
-" All setting are protected by 'au' ('autocmd') statements.  Only files ending
-" in .py or .pyw will trigger the Python settings while files ending in *.c or
-" *.h will trigger the C settings.  This makes the file "safe" in terms of only
-" adjusting settings for Python and C files.
-"
-" Only basic settings needed to enforce the style guidelines are set.
-" Some suggested options are listed but commented out at the end of this file.
-
-" Number of spaces that a pre-existing tab is equal to.
-" For the amount of space used for a new tab use shiftwidth.
-au BufRead,BufNewFile *py,*pyw,*.c,*.h set tabstop=8
-
-" What to use for an indent.
-" This will affect Ctrl-T and 'autoindent'.
-" Python: 4 spaces
-" C: tabs (pre-existing files) or 4 spaces (new files)
-au BufRead,BufNewFile *.py,*pyw set shiftwidth=4
-au BufRead,BufNewFile *.py,*.pyw set expandtab
-fu Select_c_style()
-    if search('^\t', 'n', 150)
-        set shiftwidth=8
-        set noexpandtab
-    el 
-        set shiftwidth=4
-        set expandtab
-    en
-endf
-au BufRead,BufNewFile *.c,*.h call Select_c_style()
-au BufRead,BufNewFile Makefile* set noexpandtab
-
-" Use the below highlight group when displaying bad whitespace is desired.
-highlight BadWhitespace ctermbg=red guibg=red
-
-" Display tabs at the beginning of a line in Python mode as bad.
-au BufRead,BufNewFile *.py,*.pyw match BadWhitespace /^\t\+/
-" Make trailing whitespace be flagged as bad.
-au BufRead,BufNewFile *.py,*.pyw,*.c,*.h,*.rst match BadWhitespace /\s\+$/
-
-" Wrap text after a certain number of characters
-" Python: 79 
-" C: 79
-au BufRead,BufNewFile *.py,*.pyw,*.c,*.h set textwidth=79
-
-" Turn off settings in 'formatoptions' relating to comment formatting.
-" - c : do not automatically insert the comment leader when wrapping based on
-"    'textwidth'
-" - o : do not insert the comment leader when using 'o' or 'O' from command mode
-" - r : do not insert the comment leader when hitting <Enter> in insert mode
-" Python: not needed
-" C: prevents insertion of '*' at the beginning of every line in a comment
-au BufRead,BufNewFile *.c,*.h set formatoptions-=c formatoptions-=o formatoptions-=r
-
-" Use UNIX (\n) line endings.
-" Only used for new files so as to not force existing files to change their
-" line endings.
-" Python: yes
-" C: yes
-au BufNewFile *.py,*.pyw,*.c,*.h set fileformat=unix
-
-
-" ----------------------------------------------------------------------------
-" The following section contains suggested settings.  While in no way required
-" to meet coding standards, they are helpful.
-
-" Set the default file encoding to UTF-8: ``set encoding=utf-8``
-
-" Puts a marker at the beginning of the file to differentiate between UTF and
-" UCS encoding (WARNING: can trick shells into thinking a text file is actually
-" a binary file when executing the text file): ``set bomb``
-
-" For full syntax highlighting:
-"``let python_highlight_all=1``
-"``syntax on``
-
-" Automatically indent based on file type: ``filetype indent on``
-" Keep indentation level from previous line: ``set autoindent``
-
-" Folding based on indentation: ``set foldmethod=indent``
diff --git a/Misc/coverity_model.c b/Misc/coverity_model.c
new file mode 100644
index 0000000..57f3aeb
--- /dev/null
+++ b/Misc/coverity_model.c
@@ -0,0 +1,132 @@
+/* Coverity Scan model
+ *
+ * This is a modeling file for Coverity Scan. Modeling helps to avoid false
+ * positives.
+ *
+ * - A model file can't import any header files.
+ * - Therefore only some built-in primitives like int, char and void are
+ *   available but not wchar_t, NULL etc.
+ * - Modeling doesn't need full structs and typedefs. Rudimentary structs
+ *   and similar types are sufficient.
+ * - An uninitialized local pointer is not an error. It signifies that the
+ *   variable could be either NULL or have some data.
+ *
+ * Coverity Scan doesn't pick up modifications automatically. The model file
+ * must be uploaded by an admin in the analysis settings of
+ * http://scan.coverity.com/projects/200
+ */
+
+/* dummy definitions, in most cases struct fields aren't required. */
+
+#define NULL (void *)0
+#define assert(op) /* empty */
+typedef int sdigit;
+typedef long Py_ssize_t;
+typedef long long PY_LONG_LONG;
+typedef unsigned short wchar_t;
+typedef struct {} PyObject;
+typedef struct {} grammar;
+typedef struct {} DIR;
+typedef struct {} RFILE;
+
+/* Python/pythonrun.c
+ * resourece leak false positive */
+
+void Py_FatalError(const char *msg) {
+    __coverity_panic__();
+}
+
+/* Objects/longobject.c
+ * NEGATIVE_RETURNS false positive */
+
+static PyObject *get_small_int(sdigit ival)
+{
+    /* Never returns NULL */
+    PyObject *p;
+    assert(p != NULL);
+    return p;
+}
+
+PyObject *PyLong_FromLong(long ival)
+{
+    PyObject *p;
+    int maybe;
+
+    if ((ival >= -5) && (ival < 257 + 5)) {
+        p = get_small_int(ival);
+        assert(p != NULL);
+        return p;
+    }
+    if (maybe)
+        return p;
+    else
+        return NULL;
+}
+
+PyObject *PyLong_FromLongLong(PY_LONG_LONG ival)
+{
+    return PyLong_FromLong((long)ival);
+}
+
+PyObject *PyLong_FromSsize_t(Py_ssize_t ival)
+{
+    return PyLong_FromLong((long)ival);
+}
+
+/* tainted sinks
+ *
+ * Coverity considers argv, environ, read() data etc as tained.
+ */
+
+PyObject *PyErr_SetFromErrnoWithFilename(PyObject *exc, const char *filename)
+{
+    __coverity_tainted_data_sink__(filename);
+    return NULL;
+}
+
+/* Python/fileutils.c */
+wchar_t *_Py_char2wchar(const char* arg, size_t *size)
+{
+   wchar_t *w;
+    __coverity_tainted_data_sink__(arg);
+    __coverity_tainted_data_sink__(size);
+   return w;
+}
+
+/* Parser/pgenmain.c */
+grammar *getgrammar(char *filename)
+{
+    grammar *g;
+    __coverity_tainted_data_sink__(filename);
+    return g;
+}
+
+/* Python/marshal.c */
+
+static Py_ssize_t r_string(char *s, Py_ssize_t n, RFILE *p)
+{
+    __coverity_tainted_string_argument__(s);
+    return 0;
+}
+
+static long r_long(RFILE *p)
+{
+    long l;
+    unsigned char buffer[4];
+
+    r_string((char *)buffer, 4, p);
+    __coverity_tainted_string_sanitize_content__(buffer);
+    l = (long)buffer;
+    return l;
+}
+
+/* Coverity doesn't understand that fdopendir() may take ownership of fd. */
+
+DIR *fdopendir(int fd) {
+    DIR *d;
+    if (d) {
+        __coverity_close__(fd);
+    }
+    return d;
+}
+
diff --git a/Misc/python-config.in b/Misc/python-config.in
index ac3a2c7..e13da75 100644
--- a/Misc/python-config.in
+++ b/Misc/python-config.in
@@ -1,6 +1,8 @@
 #!@EXENAME@
 # -*- python -*-
 
+# Keep this script in sync with python-config.sh.in
+
 import getopt
 import os
 import sys
@@ -45,8 +47,9 @@
         print(' '.join(flags))
 
     elif opt in ('--libs', '--ldflags'):
-        libs = getvar('LIBS').split() + getvar('SYSLIBS').split()
-        libs.append('-lpython' + pyver + sys.abiflags)
+        libs = ['-lpython' + pyver + sys.abiflags]
+        libs += getvar('LIBS').split()
+        libs += getvar('SYSLIBS').split()
         # add the prefix/lib/pythonX.Y/config dir, but only if there is no
         # shared library in prefix/lib/.
         if opt == '--ldflags':
diff --git a/Misc/python-config.sh.in b/Misc/python-config.sh.in
new file mode 100644
index 0000000..64c81e5
--- /dev/null
+++ b/Misc/python-config.sh.in
@@ -0,0 +1,111 @@
+#!/bin/sh
+
+# Keep this script in sync with python-config.in
+
+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 ()
+{
+    RESULT=$(dirname $(cd $(dirname "$1") && pwd -P))
+    if which readlink >/dev/null 2>&1 ; then
+        if readlink -f "$RESULT" >/dev/null 2>&1; then
+          RESULT=$(readlink -f "$RESULT")
+        fi
+    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@"
+LIBS="-lpython${VERSION}${ABIFLAGS} @LIBS@ $SYSLIBS"
+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/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
diff --git a/Misc/python-wing5.wpr b/Misc/python-wing5.wpr
new file mode 100644
index 0000000..0e1ae63
--- /dev/null
+++ b/Misc/python-wing5.wpr
@@ -0,0 +1,18 @@
+#!wing
+#!version=5.0
+##################################################################
+# Wing IDE project file                                          #
+##################################################################
+[project attributes]
+proj.directory-list = [{'dirloc': loc('..'),
+                        'excludes': [u'.hg',
+                                     u'Lib/unittest/__pycache__',
+                                     u'Lib/unittest/test/__pycache__',
+                                     u'Lib/__pycache__',
+                                     u'build',
+                                     u'Doc/build'],
+                        'filter': '*',
+                        'include_hidden': False,
+                        'recursive': True,
+                        'watch_for_changes': True}]
+proj.file-type = 'shared'
diff --git a/Misc/python.man b/Misc/python.man
index bcb3ec8..048a68a 100644
--- a/Misc/python.man
+++ b/Misc/python.man
@@ -26,11 +26,14 @@
 .B \-i
 ]
 [
-.B \-m
-.I module-name
+.B \-I
 ]
 .br
        [
+.B \-m
+.I module-name
+]
+[
 .B \-q
 ]
 [
@@ -139,6 +142,13 @@
 useful to inspect global variables or a stack trace when a script
 raises an exception.
 .TP
+.B \-I
+Run Python in isolated mode. This also implies \fB\-E\fP and \fB\-S\fP. In
+isolated mode sys.path contains neither the script’s directory nor the user’s
+site-packages directory. All PYTHON* environment variables are ignored, too.
+Further restrictions may be imposed to prevent the user from injecting
+malicious code.
+.TP
 .BI "\-m " module-name
 Searches 
 .I sys.path 
@@ -374,11 +384,6 @@
 and
 .I sys.ps2
 in this file.
-.IP PYTHONY2K
-Set this to a non-empty string to cause the \fItime\fP module to
-require dates specified as strings to include 4-digit years, otherwise
-2-digit years are converted based on rules described in the \fItime\fP
-module documentation.
 .IP PYTHONOPTIMIZE
 If this is set to a non-empty string it is equivalent to specifying
 the \fB\-O\fP option. If set to an integer, it is equivalent to
diff --git a/Modules/Setup.dist b/Modules/Setup.dist
index f45de5c..01fb85f 100644
--- a/Modules/Setup.dist
+++ b/Modules/Setup.dist
@@ -102,7 +102,7 @@
 # various reasons; therefore they are listed here instead of in the
 # normal order.
 
-# This only contains the minimal set of modules required to run the 
+# This only contains the minimal set of modules required to run the
 # setup.py script in the root of the Python source tree.
 
 posix posixmodule.c		# posix (UNIX) system calls
@@ -113,9 +113,11 @@
 _codecs _codecsmodule.c		# access to the builtin codecs and codec registry
 _weakref _weakref.c		# weak references
 _functools _functoolsmodule.c   # Tools for working with functions and callable objects
-operator operator.c	        # operator.add() and similar goodies
+_operator _operator.c	        # operator.add() and similar goodies
 _collections _collectionsmodule.c # Container types
-itertools itertoolsmodule.c    # Functions creating iterators for efficient looping 
+itertools itertoolsmodule.c    # Functions creating iterators for efficient looping
+atexit atexitmodule.c      # Register functions to be run at interpreter-shutdown
+_stat _stat.c			# stat.h interface
 
 # access to ISO C locale support
 _locale _localemodule.c  # -lintl
@@ -130,12 +132,15 @@
 # faulthandler module
 faulthandler faulthandler.c
 
+# debug tool to trace memory blocks allocated by Python
+_tracemalloc _tracemalloc.c hashtable.c
+
 # The rest of the modules listed in this file are all commented out by
 # default.  Usually they can be detected and built as dynamically
 # loaded modules by the new setup.py script added in Python 2.1.  If
-# you're on a platform that doesn't support dynamic loading, want to 
-# compile modules statically into the Python binary, or need to 
-# specify some odd set of compiler switches, you can uncomment the 
+# you're on a platform that doesn't support dynamic loading, want to
+# compile modules statically into the Python binary, or need to
+# specify some odd set of compiler switches, you can uncomment the
 # appropriate lines below.
 
 # ======================================================================
@@ -170,7 +175,6 @@
 #_weakref _weakref.c	# basic weak reference support
 #_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
 #_pickle _pickle.c	# pickle accelerator
 #_datetime _datetimemodule.c	# datetime accelerator
@@ -185,7 +189,7 @@
 # supported...)
 
 #fcntl fcntlmodule.c	# fcntl(2) and ioctl(2)
-#spwd spwdmodule.c		# spwd(3) 
+#spwd spwdmodule.c		# spwd(3)
 #grp grpmodule.c		# grp(3)
 #select selectmodule.c	# select(2); not on ancient System V
 
@@ -301,7 +305,7 @@
 
 #_curses _cursesmodule.c -lcurses -ltermcap
 # Wrapper for the panel library that's part of ncurses and SYSV curses.
-#_curses_panel _curses_panel.c -lpanel -lncurses 
+#_curses_panel _curses_panel.c -lpanel -lncurses
 
 
 # Modules that provide persistent dictionary-like semantics.  You will
diff --git a/Modules/_bisectmodule.c b/Modules/_bisectmodule.c
index faca8cf..02b55d1 100644
--- a/Modules/_bisectmodule.c
+++ b/Modules/_bisectmodule.c
@@ -6,6 +6,8 @@
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
 
+_Py_IDENTIFIER(insert);
+
 static Py_ssize_t
 internal_bisect_right(PyObject *list, PyObject *item, Py_ssize_t lo, Py_ssize_t hi)
 {
@@ -90,8 +92,6 @@
         if (PyList_Insert(list, index, item) < 0)
             return NULL;
     } else {
-        _Py_IDENTIFIER(insert);
-
         result = _PyObject_CallMethodId(list, &PyId_insert, "nO", index, item);
         if (result == NULL)
             return NULL;
@@ -195,7 +195,6 @@
         if (PyList_Insert(list, index, item) < 0)
             return NULL;
     } else {
-        _Py_IDENTIFIER(insert);
         result = _PyObject_CallMethodId(list, &PyId_insert, "nO", index, item);
         if (result == NULL)
             return NULL;
diff --git a/Modules/_bz2module.c b/Modules/_bz2module.c
index 3f7a6cf..e652f4d 100644
--- a/Modules/_bz2module.c
+++ b/Modules/_bz2module.c
@@ -36,8 +36,6 @@
 #define RELEASE_LOCK(obj)
 #endif
 
-#define MIN(X, Y) (((X) < (Y)) ? (X) : (Y))
-
 
 typedef struct {
     PyObject_HEAD
@@ -58,6 +56,8 @@
 #endif
 } BZ2Decompressor;
 
+static PyTypeObject BZ2Compressor_Type;
+static PyTypeObject BZ2Decompressor_Type;
 
 /* Helper functions. */
 
@@ -149,7 +149,7 @@
     c->bzs.next_in = data;
     c->bzs.avail_in = 0;
     c->bzs.next_out = PyBytes_AS_STRING(result);
-    c->bzs.avail_out = PyBytes_GET_SIZE(result);
+    c->bzs.avail_out = SMALLCHUNK;
     for (;;) {
         char *this_out;
         int bzerror;
@@ -157,7 +157,7 @@
         /* 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);
+            c->bzs.avail_in = (unsigned int)Py_MIN(len, UINT_MAX);
             len -= c->bzs.avail_in;
         }
 
@@ -173,7 +173,7 @@
                 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);
+            c->bzs.avail_out = (unsigned int)Py_MIN(buffer_left, UINT_MAX);
         }
 
         Py_BEGIN_ALLOW_THREADS
@@ -198,44 +198,58 @@
     return NULL;
 }
 
-PyDoc_STRVAR(BZ2Compressor_compress__doc__,
-"compress(data) -> bytes\n"
-"\n"
-"Provide data to the compressor object. Returns a chunk of\n"
-"compressed data if possible, or b'' otherwise.\n"
-"\n"
-"When you have finished providing data to the compressor, call the\n"
-"flush() method to finish the compression process.\n");
+/*[clinic input]
+output preset file
+module _bz2
+class _bz2.BZ2Compressor "BZ2Compressor *" "&BZ2Compressor_Type"
+class _bz2.BZ2Decompressor "BZ2Decompressor *" "&BZ2Decompressor_Type"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=e3b139924f5e18cc]*/
+
+#include "clinic/_bz2module.c.h"
+
+/*[clinic input]
+_bz2.BZ2Compressor.compress
+
+    data: Py_buffer
+    /
+
+Provide data to the compressor object.
+
+Returns a chunk of compressed data if possible, or b'' otherwise.
+
+When you have finished providing data to the compressor, call the
+flush() method to finish the compression process.
+[clinic start generated code]*/
 
 static PyObject *
-BZ2Compressor_compress(BZ2Compressor *self, PyObject *args)
+_bz2_BZ2Compressor_compress_impl(BZ2Compressor *self, Py_buffer *data)
+/*[clinic end generated code: output=59365426e941fbcc input=85c963218070fc4c]*/
 {
-    Py_buffer buffer;
     PyObject *result = NULL;
 
-    if (!PyArg_ParseTuple(args, "y*:compress", &buffer))
-        return NULL;
-
     ACQUIRE_LOCK(self);
     if (self->flushed)
         PyErr_SetString(PyExc_ValueError, "Compressor has been flushed");
     else
-        result = compress(self, buffer.buf, buffer.len, BZ_RUN);
+        result = compress(self, data->buf, data->len, BZ_RUN);
     RELEASE_LOCK(self);
-    PyBuffer_Release(&buffer);
     return result;
 }
 
-PyDoc_STRVAR(BZ2Compressor_flush__doc__,
-"flush() -> bytes\n"
-"\n"
-"Finish the compression process. Returns the compressed data left\n"
-"in internal buffers.\n"
-"\n"
-"The compressor object may not be used after this method is called.\n");
+/*[clinic input]
+_bz2.BZ2Compressor.flush
+
+Finish the compression process.
+
+Returns the compressed data left in internal buffers.
+
+The compressor object may not be used after this method is called.
+[clinic start generated code]*/
 
 static PyObject *
-BZ2Compressor_flush(BZ2Compressor *self, PyObject *noargs)
+_bz2_BZ2Compressor_flush_impl(BZ2Compressor *self)
+/*[clinic end generated code: output=3ef03fc1b092a701 input=d64405d3c6f76691]*/
 {
     PyObject *result = NULL;
 
@@ -258,14 +272,42 @@
     return NULL;
 }
 
-static int
-BZ2Compressor_init(BZ2Compressor *self, PyObject *args, PyObject *kwargs)
+static void*
+BZ2_Malloc(void* ctx, int items, int size)
 {
-    int compresslevel = 9;
+    if (items < 0 || size < 0)
+        return NULL;
+    if ((size_t)items > (size_t)PY_SSIZE_T_MAX / (size_t)size)
+        return NULL;
+    /* PyMem_Malloc() cannot be used: compress() and decompress()
+       release the GIL */
+    return PyMem_RawMalloc(items * size);
+}
+
+static void
+BZ2_Free(void* ctx, void *ptr)
+{
+    PyMem_RawFree(ptr);
+}
+
+/*[clinic input]
+_bz2.BZ2Compressor.__init__
+
+    compresslevel: int = 9
+        Compression level, as a number between 1 and 9.
+    /
+
+Create a compressor object for compressing data incrementally.
+
+For one-shot compression, use the compress() function instead.
+[clinic start generated code]*/
+
+static int
+_bz2_BZ2Compressor___init___impl(BZ2Compressor *self, int compresslevel)
+/*[clinic end generated code: output=c4e6adfd02963827 input=4e1ff7b8394b6e9a]*/
+{
     int bzerror;
 
-    if (!PyArg_ParseTuple(args, "|i:BZ2Compressor", &compresslevel))
-        return -1;
     if (!(1 <= compresslevel && compresslevel <= 9)) {
         PyErr_SetString(PyExc_ValueError,
                         "compresslevel must be between 1 and 9");
@@ -280,6 +322,9 @@
     }
 #endif
 
+    self->bzs.opaque = NULL;
+    self->bzs.bzalloc = BZ2_Malloc;
+    self->bzs.bzfree = BZ2_Free;
     bzerror = BZ2_bzCompressInit(&self->bzs, compresslevel, 0, 0);
     if (catch_bz2_error(bzerror))
         goto error;
@@ -306,22 +351,12 @@
 }
 
 static PyMethodDef BZ2Compressor_methods[] = {
-    {"compress",     (PyCFunction)BZ2Compressor_compress, METH_VARARGS,
-     BZ2Compressor_compress__doc__},
-    {"flush",        (PyCFunction)BZ2Compressor_flush,    METH_NOARGS,
-     BZ2Compressor_flush__doc__},
+    _BZ2_BZ2COMPRESSOR_COMPRESS_METHODDEF
+    _BZ2_BZ2COMPRESSOR_FLUSH_METHODDEF
     {"__getstate__", (PyCFunction)BZ2Compressor_getstate, METH_NOARGS},
     {NULL}
 };
 
-PyDoc_STRVAR(BZ2Compressor__doc__,
-"BZ2Compressor(compresslevel=9)\n"
-"\n"
-"Create a compressor object for compressing data incrementally.\n"
-"\n"
-"compresslevel, if given, must be a number between 1 and 9.\n"
-"\n"
-"For one-shot compression, use the compress() function instead.\n");
 
 static PyTypeObject BZ2Compressor_Type = {
     PyVarObject_HEAD_INIT(NULL, 0)
@@ -344,7 +379,7 @@
     0,                                  /* tp_setattro */
     0,                                  /* tp_as_buffer */
     Py_TPFLAGS_DEFAULT,                 /* tp_flags */
-    BZ2Compressor__doc__,               /* tp_doc */
+    _bz2_BZ2Compressor___init____doc__,  /* tp_doc */
     0,                                  /* tp_traverse */
     0,                                  /* tp_clear */
     0,                                  /* tp_richcompare */
@@ -359,7 +394,7 @@
     0,                                  /* tp_descr_get */
     0,                                  /* tp_descr_set */
     0,                                  /* tp_dictoffset */
-    (initproc)BZ2Compressor_init,       /* tp_init */
+    _bz2_BZ2Compressor___init__,        /* tp_init */
     0,                                  /* tp_alloc */
     PyType_GenericNew,                  /* tp_new */
 };
@@ -379,10 +414,10 @@
     d->bzs.next_in = data;
     /* On a 64-bit system, len might not fit in avail_in (an unsigned int).
        Do decompression in chunks of no more than UINT_MAX bytes each. */
-    d->bzs.avail_in = MIN(len, UINT_MAX);
+    d->bzs.avail_in = (unsigned int)Py_MIN(len, UINT_MAX);
     len -= d->bzs.avail_in;
     d->bzs.next_out = PyBytes_AS_STRING(result);
-    d->bzs.avail_out = PyBytes_GET_SIZE(result);
+    d->bzs.avail_out = SMALLCHUNK;
     for (;;) {
         char *this_out;
         int bzerror;
@@ -408,7 +443,7 @@
         if (d->bzs.avail_in == 0) {
             if (len == 0)
                 break;
-            d->bzs.avail_in = MIN(len, UINT_MAX);
+            d->bzs.avail_in = (unsigned int)Py_MIN(len, UINT_MAX);
             len -= d->bzs.avail_in;
         }
         if (d->bzs.avail_out == 0) {
@@ -419,7 +454,7 @@
                 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);
+            d->bzs.avail_out = (unsigned int)Py_MIN(buffer_left, UINT_MAX);
         }
     }
     if (data_size != PyBytes_GET_SIZE(result))
@@ -432,32 +467,33 @@
     return NULL;
 }
 
-PyDoc_STRVAR(BZ2Decompressor_decompress__doc__,
-"decompress(data) -> bytes\n"
-"\n"
-"Provide data to the decompressor object. Returns a chunk of\n"
-"decompressed data if possible, or b'' otherwise.\n"
-"\n"
-"Attempting to decompress data after the end of stream is reached\n"
-"raises an EOFError. Any data found after the end of the stream\n"
-"is ignored and saved in the unused_data attribute.\n");
+/*[clinic input]
+_bz2.BZ2Decompressor.decompress
+
+    data: Py_buffer
+    /
+
+Provide data to the decompressor object.
+
+Returns a chunk of decompressed data if possible, or b'' otherwise.
+
+Attempting to decompress data after the end of stream is reached
+raises an EOFError.  Any data found after the end of the stream
+is ignored and saved in the unused_data attribute.
+[clinic start generated code]*/
 
 static PyObject *
-BZ2Decompressor_decompress(BZ2Decompressor *self, PyObject *args)
+_bz2_BZ2Decompressor_decompress_impl(BZ2Decompressor *self, Py_buffer *data)
+/*[clinic end generated code: output=086e4b99e60cb3f6 input=616c2a6db5269961]*/
 {
-    Py_buffer buffer;
     PyObject *result = NULL;
 
-    if (!PyArg_ParseTuple(args, "y*:decompress", &buffer))
-        return NULL;
-
     ACQUIRE_LOCK(self);
     if (self->eof)
         PyErr_SetString(PyExc_EOFError, "End of stream already reached");
     else
-        result = decompress(self, buffer.buf, buffer.len);
+        result = decompress(self, data->buf, data->len);
     RELEASE_LOCK(self);
-    PyBuffer_Release(&buffer);
     return result;
 }
 
@@ -469,14 +505,20 @@
     return NULL;
 }
 
+/*[clinic input]
+_bz2.BZ2Decompressor.__init__
+
+Create a decompressor object for decompressing data incrementally.
+
+For one-shot decompression, use the decompress() function instead.
+[clinic start generated code]*/
+
 static int
-BZ2Decompressor_init(BZ2Decompressor *self, PyObject *args, PyObject *kwargs)
+_bz2_BZ2Decompressor___init___impl(BZ2Decompressor *self)
+/*[clinic end generated code: output=e4d2b9bb866ab8f1 input=95f6500dcda60088]*/
 {
     int bzerror;
 
-    if (!PyArg_ParseTuple(args, ":BZ2Decompressor"))
-        return -1;
-
 #ifdef WITH_THREAD
     self->lock = PyThread_allocate_lock();
     if (self->lock == NULL) {
@@ -517,8 +559,7 @@
 }
 
 static PyMethodDef BZ2Decompressor_methods[] = {
-    {"decompress", (PyCFunction)BZ2Decompressor_decompress, METH_VARARGS,
-     BZ2Decompressor_decompress__doc__},
+    _BZ2_BZ2DECOMPRESSOR_DECOMPRESS_METHODDEF
     {"__getstate__", (PyCFunction)BZ2Decompressor_getstate, METH_NOARGS},
     {NULL}
 };
@@ -537,13 +578,6 @@
     {NULL}
 };
 
-PyDoc_STRVAR(BZ2Decompressor__doc__,
-"BZ2Decompressor()\n"
-"\n"
-"Create a decompressor object for decompressing data incrementally.\n"
-"\n"
-"For one-shot decompression, use the decompress() function instead.\n");
-
 static PyTypeObject BZ2Decompressor_Type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "_bz2.BZ2Decompressor",             /* tp_name */
@@ -565,7 +599,7 @@
     0,                                  /* tp_setattro */
     0,                                  /* tp_as_buffer */
     Py_TPFLAGS_DEFAULT,                 /* tp_flags */
-    BZ2Decompressor__doc__,             /* tp_doc */
+    _bz2_BZ2Decompressor___init____doc__,  /* tp_doc */
     0,                                  /* tp_traverse */
     0,                                  /* tp_clear */
     0,                                  /* tp_richcompare */
@@ -580,7 +614,7 @@
     0,                                  /* tp_descr_get */
     0,                                  /* tp_descr_set */
     0,                                  /* tp_dictoffset */
-    (initproc)BZ2Decompressor_init,     /* tp_init */
+    _bz2_BZ2Decompressor___init__,      /* tp_init */
     0,                                  /* tp_alloc */
     PyType_GenericNew,                  /* tp_new */
 };
diff --git a/Modules/_codecsmodule.c b/Modules/_codecsmodule.c
index 40037b1..52f3479 100644
--- a/Modules/_codecsmodule.c
+++ b/Modules/_codecsmodule.c
@@ -42,15 +42,21 @@
 #include <windows.h>
 #endif
 
+/*[clinic input]
+module _codecs
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=e1390e3da3cb9deb]*/
+
+
 /* --- Registry ----------------------------------------------------------- */
 
 PyDoc_STRVAR(register__doc__,
 "register(search_function)\n\
 \n\
 Register a codec search function. Search functions are expected to take\n\
-one argument, the encoding name in all lower case letters, and return\n\
-a tuple of functions (encoder, decoder, stream_reader, stream_writer)\n\
-(or a CodecInfo object).");
+one argument, the encoding name in all lower case letters, and either\n\
+return None, or a tuple of functions (encoder, decoder, stream_reader,\n\
+stream_writer) (or a CodecInfo object).");
 
 static
 PyObject *codec_register(PyObject *self, PyObject *search_function)
@@ -134,6 +140,53 @@
 
 /* --- Helpers ------------------------------------------------------------ */
 
+/*[clinic input]
+_codecs._forget_codec
+
+    encoding: str
+    /
+
+Purge the named codec from the internal codec lookup cache
+[clinic start generated code]*/
+
+PyDoc_STRVAR(_codecs__forget_codec__doc__,
+"_forget_codec($module, encoding, /)\n"
+"--\n"
+"\n"
+"Purge the named codec from the internal codec lookup cache");
+
+#define _CODECS__FORGET_CODEC_METHODDEF    \
+    {"_forget_codec", (PyCFunction)_codecs__forget_codec, METH_VARARGS, _codecs__forget_codec__doc__},
+
+static PyObject *
+_codecs__forget_codec_impl(PyModuleDef *module, const char *encoding);
+
+static PyObject *
+_codecs__forget_codec(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    const char *encoding;
+
+    if (!PyArg_ParseTuple(args,
+        "s:_forget_codec",
+        &encoding))
+        goto exit;
+    return_value = _codecs__forget_codec_impl(module, encoding);
+
+exit:
+    return return_value;
+}
+
+static PyObject *
+_codecs__forget_codec_impl(PyModuleDef *module, const char *encoding)
+/*[clinic end generated code: output=a75e631591702a5c input=18d5d92d0e386c38]*/
+{
+    if (_PyCodec_Forget(encoding) < 0) {
+        return NULL;
+    };
+    Py_RETURN_NONE;
+}
+
 static
 PyObject *codec_tuple(PyObject *unicode,
                       Py_ssize_t len)
@@ -189,9 +242,9 @@
         return NULL;
     }
     else {
-        register Py_ssize_t i;
-        register char c;
-        register char *p = PyBytes_AS_STRING(v);
+        Py_ssize_t i;
+        char c;
+        char *p = PyBytes_AS_STRING(v);
 
         for (i = 0; i < size; i++) {
             /* There's at least enough room for a hex escape */
@@ -231,8 +284,6 @@
 {
     PyObject *obj;
     const char *errors = NULL;
-    const char *data;
-    Py_ssize_t size;
 
     if (!PyArg_ParseTuple(args, "O|z:unicode_internal_decode",
                           &obj, &errors))
@@ -245,11 +296,16 @@
         return codec_tuple(obj, PyUnicode_GET_LENGTH(obj));
     }
     else {
-        if (PyObject_AsReadBuffer(obj, (const void **)&data, &size))
+        Py_buffer view;
+        PyObject *result;
+        if (PyObject_GetBuffer(obj, &view, PyBUF_SIMPLE) != 0)
             return NULL;
 
-        return codec_tuple(_PyUnicode_DecodeUnicodeInternal(data, size, errors),
-                           size);
+        result = codec_tuple(
+                _PyUnicode_DecodeUnicodeInternal(view.buf, view.len, errors),
+                view.len);
+        PyBuffer_Release(&view);
+        return result;
     }
 }
 
@@ -674,8 +730,6 @@
 {
     PyObject *obj;
     const char *errors = NULL;
-    const char *data;
-    Py_ssize_t len, size;
 
     if (PyErr_WarnEx(PyExc_DeprecationWarning,
                      "unicode_internal codec has been deprecated",
@@ -688,6 +742,7 @@
 
     if (PyUnicode_Check(obj)) {
         Py_UNICODE *u;
+        Py_ssize_t len, size;
 
         if (PyUnicode_READY(obj) < 0)
             return NULL;
@@ -702,9 +757,13 @@
                            PyUnicode_GET_LENGTH(obj));
     }
     else {
-        if (PyObject_AsReadBuffer(obj, (const void **)&data, &size))
+        Py_buffer view;
+        PyObject *result;
+        if (PyObject_GetBuffer(obj, &view, PyBUF_SIMPLE) != 0)
             return NULL;
-        return codec_tuple(PyBytes_FromStringAndSize(data, size), size);
+        result = codec_tuple(PyBytes_FromStringAndSize(view.buf, view.len), view.len);
+        PyBuffer_Release(&view);
+        return result;
     }
 }
 
@@ -1168,6 +1227,7 @@
         register_error__doc__},
     {"lookup_error",            lookup_error,                   METH_VARARGS,
         lookup_error__doc__},
+    _CODECS__FORGET_CODEC_METHODDEF
     {NULL, NULL}                /* sentinel */
 };
 
diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c
index 3cf4764..c1aa9a3 100644
--- a/Modules/_collectionsmodule.c
+++ b/Modules/_collectionsmodule.c
@@ -3,30 +3,32 @@
 
 /* collections module implementation of a deque() datatype
    Written and maintained by Raymond D. Hettinger <python@rcn.com>
-   Copyright (c) 2004 Python Software Foundation.
+   Copyright (c) 2004-2013 Python Software Foundation.
    All rights reserved.
 */
 
 /* The block length may be set to any number over 1.  Larger numbers
- * reduce the number of calls to the memory allocator but take more
- * memory.  Ideally, BLOCKLEN should be set with an eye to the
- * length of a cache line.
+ * reduce the number of calls to the memory allocator, give faster
+ * indexing and rotation, and reduce the link::data overhead ratio.
+ *
+ * Ideally, the block length will be set to two less than some
+ * multiple of the cache-line length (so that the full block
+ * including the leftlink and rightlink will fit neatly into
+ * cache lines).
  */
 
 #define BLOCKLEN 62
 #define CENTER ((BLOCKLEN - 1) / 2)
 
 /* A `dequeobject` is composed of a doubly-linked list of `block` nodes.
- * This list is not circular (the leftmost block has leftlink==NULL,
- * and the rightmost block has rightlink==NULL).  A deque d's first
- * element is at d.leftblock[leftindex] and its last element is at
- * d.rightblock[rightindex]; note that, unlike as for Python slice
- * indices, these indices are inclusive on both ends.  By being inclusive
- * on both ends, algorithms for left and right operations become
- * symmetrical which simplifies the design.
- *
  * The list of blocks is never empty, so d.leftblock and d.rightblock
- * are never equal to NULL.
+ * are never equal to NULL.  The list is not circular.
+ *
+ * A deque d's first element is at d.leftblock[leftindex]
+ * and its last element is at d.rightblock[rightindex].
+ * Unlike Python slice indices, these indices are inclusive
+ * on both ends.  This makes the algorithms for left and
+ * right operations more symmetrical and simplifies the design.
  *
  * The indices, d.leftindex and d.rightindex are always in the range
  *     0 <= index < BLOCKLEN.
@@ -47,42 +49,60 @@
 
 typedef struct BLOCK {
     struct BLOCK *leftlink;
-    struct BLOCK *rightlink;
     PyObject *data[BLOCKLEN];
+    struct BLOCK *rightlink;
 } block;
 
+/* For debug builds, add error checking to track the endpoints
+ * in the chain of links.  The goal is to make sure that link
+ * assignments only take place at endpoints so that links already
+ * in use do not get overwritten.
+ *
+ * CHECK_END should happen before each assignment to a block's link field.
+ * MARK_END should happen whenever a link field becomes a new endpoint.
+ * This happens when new blocks are added or whenever an existing
+ * block is freed leaving another existing block as the new endpoint.
+ */
+
+#ifndef NDEBUG
+#define MARK_END(link)  link = NULL;
+#define CHECK_END(link) assert(link == NULL);
+#define CHECK_NOT_END(link) assert(link != NULL);
+#else
+#define MARK_END(link)
+#define CHECK_END(link)
+#define CHECK_NOT_END(link)
+#endif
+
+/* A simple freelisting scheme is used to minimize calls to the memory
+   allocator.  It accomodates common use cases where new blocks are being
+   added at about the same rate as old blocks are being freed.
+ */
+
 #define MAXFREEBLOCKS 10
 static Py_ssize_t numfreeblocks = 0;
 static block *freeblocks[MAXFREEBLOCKS];
 
 static block *
-newblock(block *leftlink, block *rightlink, Py_ssize_t len) {
+newblock(Py_ssize_t len) {
     block *b;
-    /* To prevent len from overflowing PY_SSIZE_T_MAX on 64-bit machines, we
-     * refuse to allocate new blocks if the current len is dangerously
-     * close.  There is some extra margin to prevent spurious arithmetic
-     * overflows at various places.  The following check ensures that
-     * the blocks allocated to the deque, in the worst case, can only
-     * have PY_SSIZE_T_MAX-2 entries in total.
-     */
+    /* To prevent len from overflowing PY_SSIZE_T_MAX, we refuse to
+     * allocate new blocks if the current len is nearing overflow. */
     if (len >= PY_SSIZE_T_MAX - 2*BLOCKLEN) {
         PyErr_SetString(PyExc_OverflowError,
                         "cannot add more blocks to the deque");
         return NULL;
     }
     if (numfreeblocks) {
-        numfreeblocks -= 1;
-        b = freeblocks[numfreeblocks];
-    } else {
-        b = PyMem_Malloc(sizeof(block));
-        if (b == NULL) {
-            PyErr_NoMemory();
-            return NULL;
-        }
+        numfreeblocks--;
+        return freeblocks[numfreeblocks];
     }
-    b->leftlink = leftlink;
-    b->rightlink = rightlink;
-    return b;
+    b = PyMem_Malloc(sizeof(block));
+    if (b != NULL) {
+        return b;
+    }
+    PyErr_NoMemory();
+    return NULL;
 }
 
 static void
@@ -97,14 +117,13 @@
 }
 
 typedef struct {
-    PyObject_HEAD
+    PyObject_VAR_HEAD
     block *leftblock;
     block *rightblock;
     Py_ssize_t leftindex;       /* in range(BLOCKLEN) */
     Py_ssize_t rightindex;      /* in range(BLOCKLEN) */
-    Py_ssize_t len;
+    long state;                 /* incremented whenever the indices move */
     Py_ssize_t maxlen;
-    long state;         /* incremented whenever the indices move */
     PyObject *weakreflist; /* List of weak references */
 } dequeobject;
 
@@ -118,9 +137,9 @@
  */
 
 #define TRIM(d, popfunction)                                    \
-    if (d->maxlen != -1 && d->len > d->maxlen) {                \
+    if (d->maxlen != -1 && Py_SIZE(d) > d->maxlen) {       \
         PyObject *rv = popfunction(d, NULL);                \
-        assert(rv != NULL  &&  d->len <= d->maxlen);        \
+        assert(rv != NULL  &&  Py_SIZE(d) <= d->maxlen);    \
         Py_DECREF(rv);                                      \
     }
 
@@ -137,18 +156,20 @@
     if (deque == NULL)
         return NULL;
 
-    b = newblock(NULL, NULL, 0);
+    b = newblock(0);
     if (b == NULL) {
         Py_DECREF(deque);
         return NULL;
     }
+    MARK_END(b->leftlink);
+    MARK_END(b->rightlink);
 
     assert(BLOCKLEN >= 2);
     deque->leftblock = b;
     deque->rightblock = b;
     deque->leftindex = CENTER + 1;
     deque->rightindex = CENTER;
-    deque->len = 0;
+    Py_SIZE(deque) = 0;
     deque->state = 0;
     deque->weakreflist = NULL;
     deque->maxlen = -1;
@@ -162,17 +183,17 @@
     PyObject *item;
     block *prevblock;
 
-    if (deque->len == 0) {
+    if (Py_SIZE(deque) == 0) {
         PyErr_SetString(PyExc_IndexError, "pop from an empty deque");
         return NULL;
     }
     item = deque->rightblock->data[deque->rightindex];
     deque->rightindex--;
-    deque->len--;
+    Py_SIZE(deque)--;
     deque->state++;
 
     if (deque->rightindex == -1) {
-        if (deque->len == 0) {
+        if (Py_SIZE(deque) == 0) {
             assert(deque->leftblock == deque->rightblock);
             assert(deque->leftindex == deque->rightindex+1);
             /* re-center instead of freeing a block */
@@ -182,7 +203,8 @@
             prevblock = deque->rightblock->leftlink;
             assert(deque->leftblock != deque->rightblock);
             freeblock(deque->rightblock);
-            prevblock->rightlink = NULL;
+            CHECK_NOT_END(prevblock);
+            MARK_END(prevblock->rightlink);
             deque->rightblock = prevblock;
             deque->rightindex = BLOCKLEN - 1;
         }
@@ -198,18 +220,18 @@
     PyObject *item;
     block *prevblock;
 
-    if (deque->len == 0) {
+    if (Py_SIZE(deque) == 0) {
         PyErr_SetString(PyExc_IndexError, "pop from an empty deque");
         return NULL;
     }
     assert(deque->leftblock != NULL);
     item = deque->leftblock->data[deque->leftindex];
     deque->leftindex++;
-    deque->len--;
+    Py_SIZE(deque)--;
     deque->state++;
 
     if (deque->leftindex == BLOCKLEN) {
-        if (deque->len == 0) {
+        if (Py_SIZE(deque) == 0) {
             assert(deque->leftblock == deque->rightblock);
             assert(deque->leftindex == deque->rightindex+1);
             /* re-center instead of freeing a block */
@@ -219,8 +241,8 @@
             assert(deque->leftblock != deque->rightblock);
             prevblock = deque->leftblock->rightlink;
             freeblock(deque->leftblock);
-            assert(prevblock != NULL);
-            prevblock->leftlink = NULL;
+            CHECK_NOT_END(prevblock);
+            MARK_END(prevblock->leftlink);
             deque->leftblock = prevblock;
             deque->leftindex = 0;
         }
@@ -235,16 +257,18 @@
 {
     deque->state++;
     if (deque->rightindex == BLOCKLEN-1) {
-        block *b = newblock(deque->rightblock, NULL, deque->len);
+        block *b = newblock(Py_SIZE(deque));
         if (b == NULL)
             return NULL;
-        assert(deque->rightblock->rightlink == NULL);
+        b->leftlink = deque->rightblock;
+        CHECK_END(deque->rightblock->rightlink);
         deque->rightblock->rightlink = b;
         deque->rightblock = b;
+        MARK_END(b->rightlink);
         deque->rightindex = -1;
     }
     Py_INCREF(item);
-    deque->len++;
+    Py_SIZE(deque)++;
     deque->rightindex++;
     deque->rightblock->data[deque->rightindex] = item;
     TRIM(deque, deque_popleft);
@@ -258,16 +282,18 @@
 {
     deque->state++;
     if (deque->leftindex == 0) {
-        block *b = newblock(NULL, deque->leftblock, deque->len);
+        block *b = newblock(Py_SIZE(deque));
         if (b == NULL)
             return NULL;
-        assert(deque->leftblock->leftlink == NULL);
+        b->rightlink = deque->leftblock;
+        CHECK_END(deque->leftblock->leftlink);
         deque->leftblock->leftlink = b;
         deque->leftblock = b;
+        MARK_END(b->leftlink);
         deque->leftindex = BLOCKLEN;
     }
     Py_INCREF(item);
-    deque->len++;
+    Py_SIZE(deque)++;
     deque->leftindex--;
     deque->leftblock->data[deque->leftindex] = item;
     TRIM(deque, deque_pop);
@@ -309,6 +335,14 @@
         return result;
     }
 
+    /* Space saving heuristic.  Start filling from the left */
+    if (Py_SIZE(deque) == 0) {
+        assert(deque->leftblock == deque->rightblock);
+        assert(deque->leftindex == deque->rightindex+1);
+        deque->leftindex = 1;
+        deque->rightindex = 0;
+    }
+
     it = PyObject_GetIter(iterable);
     if (it == NULL)
         return NULL;
@@ -319,19 +353,20 @@
     while ((item = PyIter_Next(it)) != NULL) {
         deque->state++;
         if (deque->rightindex == BLOCKLEN-1) {
-            block *b = newblock(deque->rightblock, NULL,
-                                deque->len);
+            block *b = newblock(Py_SIZE(deque));
             if (b == NULL) {
                 Py_DECREF(item);
                 Py_DECREF(it);
                 return NULL;
             }
-            assert(deque->rightblock->rightlink == NULL);
+            b->leftlink = deque->rightblock;
+            CHECK_END(deque->rightblock->rightlink);
             deque->rightblock->rightlink = b;
             deque->rightblock = b;
+            MARK_END(b->rightlink);
             deque->rightindex = -1;
         }
-        deque->len++;
+        Py_SIZE(deque)++;
         deque->rightindex++;
         deque->rightblock->data[deque->rightindex] = item;
         TRIM(deque, deque_popleft);
@@ -361,6 +396,14 @@
         return result;
     }
 
+    /* Space saving heuristic.  Start filling from the right */
+    if (Py_SIZE(deque) == 0) {
+        assert(deque->leftblock == deque->rightblock);
+        assert(deque->leftindex == deque->rightindex+1);
+        deque->leftindex = BLOCKLEN - 1;
+        deque->rightindex = BLOCKLEN - 2;
+    }
+
     it = PyObject_GetIter(iterable);
     if (it == NULL)
         return NULL;
@@ -371,19 +414,20 @@
     while ((item = PyIter_Next(it)) != NULL) {
         deque->state++;
         if (deque->leftindex == 0) {
-            block *b = newblock(NULL, deque->leftblock,
-                                deque->len);
+            block *b = newblock(Py_SIZE(deque));
             if (b == NULL) {
                 Py_DECREF(item);
                 Py_DECREF(it);
                 return NULL;
             }
-            assert(deque->leftblock->leftlink == NULL);
+            b->rightlink = deque->leftblock;
+            CHECK_END(deque->leftblock->leftlink);
             deque->leftblock->leftlink = b;
             deque->leftblock = b;
+            MARK_END(b->leftlink);
             deque->leftindex = BLOCKLEN;
         }
-        deque->len++;
+        Py_SIZE(deque)++;
         deque->leftindex--;
         deque->leftblock->data[deque->leftindex] = item;
         TRIM(deque, deque_pop);
@@ -413,7 +457,13 @@
 static int
 _deque_rotate(dequeobject *deque, Py_ssize_t n)
 {
-    Py_ssize_t m, len=deque->len, halflen=len>>1;
+    block *b = NULL;
+    block *leftblock = deque->leftblock;
+    block *rightblock = deque->rightblock;
+    Py_ssize_t leftindex = deque->leftindex;
+    Py_ssize_t rightindex = deque->rightindex;
+    Py_ssize_t len=Py_SIZE(deque), halflen=len>>1;
+    int rv = -1;
 
     if (len <= 1)
         return 0;
@@ -429,76 +479,103 @@
 
     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;
+        if (leftindex == 0) {
+            if (b == NULL) {
+                b = newblock(len);
+                if (b == NULL)
+                    goto done;
+            }
+            b->rightlink = leftblock;
+            CHECK_END(leftblock->leftlink);
+            leftblock->leftlink = b;
+            leftblock = b;
+            MARK_END(b->leftlink);
+            leftindex = BLOCKLEN;
+            b = NULL;
         }
-        assert(deque->leftindex > 0);
+        assert(leftindex > 0);
+        {
+            PyObject **src, **dest;
+            Py_ssize_t m = n;
 
-        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;
+            if (m > rightindex + 1)
+                m = rightindex + 1;
+            if (m > leftindex)
+                m = leftindex;
+            assert (m > 0 && m <= len);
+            src = &rightblock->data[rightindex];
+            dest = &leftblock->data[leftindex - 1];
+            rightindex -= m;
+            leftindex -= m;
+            n -= m;
+            do {
+                *(dest--) = *(src--);
+            } while (--m);
+        }
+        if (rightindex == -1) {
+            assert(leftblock != rightblock);
+            assert(b == NULL);
+            b = rightblock;
+            CHECK_NOT_END(rightblock->leftlink);
+            rightblock = rightblock->leftlink;
+            MARK_END(rightblock->rightlink);
+            rightindex = BLOCKLEN - 1;
         }
     }
     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;
+        if (rightindex == BLOCKLEN - 1) {
+            if (b == NULL) {
+                b = newblock(len);
+                if (b == NULL)
+                    goto done;
+            }
+            b->leftlink = rightblock;
+            CHECK_END(rightblock->rightlink);
+            rightblock->rightlink = b;
+            rightblock = b;
+            MARK_END(b->rightlink);
+            rightindex = -1;
+            b = NULL;
         }
-        assert (deque->rightindex < BLOCKLEN - 1);
+        assert (rightindex < BLOCKLEN - 1);
+        {
+            PyObject **src, **dest;
+            Py_ssize_t m = -n;
 
-        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;
+            if (m > BLOCKLEN - leftindex)
+                m = BLOCKLEN - leftindex;
+            if (m > BLOCKLEN - 1 - rightindex)
+                m = BLOCKLEN - 1 - rightindex;
+            assert (m > 0 && m <= len);
+            src = &leftblock->data[leftindex];
+            dest = &rightblock->data[rightindex + 1];
+            leftindex += m;
+            rightindex += m;
+            n += m;
+            do {
+                *(dest++) = *(src++);
+            } while (--m);
+        }
+        if (leftindex == BLOCKLEN) {
+            assert(leftblock != rightblock);
+            assert(b == NULL);
+            b = leftblock;
+            CHECK_NOT_END(leftblock->rightlink);
+            leftblock = leftblock->rightlink;
+            MARK_END(leftblock->leftlink);
+            leftindex = 0;
         }
     }
-    return 0;
+    rv = 0;
+done:
+    if (b != NULL)
+        freeblock(b);
+    deque->leftblock = leftblock;
+    deque->rightblock = rightblock;
+    deque->leftindex = leftindex;
+    deque->rightindex = rightindex;
+
+    return rv;
 }
 
 static PyObject *
@@ -523,13 +600,15 @@
     block *rightblock = deque->rightblock;
     Py_ssize_t leftindex = deque->leftindex;
     Py_ssize_t rightindex = deque->rightindex;
-    Py_ssize_t n = (deque->len)/2;
+    Py_ssize_t n = (Py_SIZE(deque))/2;
     Py_ssize_t i;
     PyObject *tmp;
 
     for (i=0 ; i<n ; i++) {
         /* Validate that pointers haven't met in the middle */
         assert(leftblock != rightblock || leftindex < rightindex);
+        CHECK_NOT_END(leftblock);
+        CHECK_NOT_END(rightblock);
 
         /* Swap */
         tmp = leftblock->data[leftindex];
@@ -539,8 +618,6 @@
         /* Advance left block/index pair */
         leftindex++;
         if (leftindex == BLOCKLEN) {
-            if (leftblock->rightlink == NULL)
-                break;
             leftblock = leftblock->rightlink;
             leftindex = 0;
         }
@@ -548,8 +625,6 @@
         /* Step backwards with the right block/index pair */
         rightindex--;
         if (rightindex == -1) {
-            if (rightblock->leftlink == NULL)
-                break;
             rightblock = rightblock->leftlink;
             rightindex = BLOCKLEN - 1;
         }
@@ -563,9 +638,9 @@
 static PyObject *
 deque_count(dequeobject *deque, PyObject *v)
 {
-    block *leftblock = deque->leftblock;
-    Py_ssize_t leftindex = deque->leftindex;
-    Py_ssize_t n = deque->len;
+    block *b = deque->leftblock;
+    Py_ssize_t index = deque->leftindex;
+    Py_ssize_t n = Py_SIZE(deque);
     Py_ssize_t i;
     Py_ssize_t count = 0;
     PyObject *item;
@@ -573,7 +648,8 @@
     int cmp;
 
     for (i=0 ; i<n ; i++) {
-        item = leftblock->data[leftindex];
+        CHECK_NOT_END(b);
+        item = b->data[index];
         cmp = PyObject_RichCompareBool(item, v, Py_EQ);
         if (cmp > 0)
             count++;
@@ -587,12 +663,10 @@
         }
 
         /* Advance left block/index pair */
-        leftindex++;
-        if (leftindex == BLOCKLEN) {
-            if (leftblock->rightlink == NULL)  /* can occur when i==n-1 */
-                break;
-            leftblock = leftblock->rightlink;
-            leftindex = 0;
+        index++;
+        if (index == BLOCKLEN) {
+            b = b->rightlink;
+            index = 0;
         }
     }
     return PyLong_FromSsize_t(count);
@@ -604,19 +678,19 @@
 static Py_ssize_t
 deque_len(dequeobject *deque)
 {
-    return deque->len;
+    return Py_SIZE(deque);
 }
 
 static PyObject *
 deque_remove(dequeobject *deque, PyObject *value)
 {
-    Py_ssize_t i, n=deque->len;
+    Py_ssize_t i, n=Py_SIZE(deque);
 
     for (i=0 ; i<n ; i++) {
         PyObject *item = deque->leftblock->data[deque->leftindex];
         int cmp = PyObject_RichCompareBool(item, value, Py_EQ);
 
-        if (deque->len != n) {
+        if (Py_SIZE(deque) != n) {
             PyErr_SetString(PyExc_IndexError,
                 "deque mutated during remove().");
             return NULL;
@@ -647,14 +721,14 @@
 {
     PyObject *item;
 
-    while (deque->len) {
+    while (Py_SIZE(deque)) {
         item = deque_pop(deque, NULL);
         assert (item != NULL);
         Py_DECREF(item);
     }
     assert(deque->leftblock == deque->rightblock &&
            deque->leftindex - 1 == deque->rightindex &&
-           deque->len == 0);
+           Py_SIZE(deque) == 0);
 }
 
 static PyObject *
@@ -664,7 +738,7 @@
     PyObject *item;
     Py_ssize_t n, index=i;
 
-    if (i < 0 || i >= deque->len) {
+    if (i < 0 || i >= Py_SIZE(deque)) {
         PyErr_SetString(PyExc_IndexError,
                         "deque index out of range");
         return NULL;
@@ -673,19 +747,19 @@
     if (i == 0) {
         i = deque->leftindex;
         b = deque->leftblock;
-    } else if (i == deque->len - 1) {
+    } else if (i == Py_SIZE(deque) - 1) {
         i = deque->rightindex;
         b = deque->rightblock;
     } else {
         i += deque->leftindex;
         n = i / BLOCKLEN;
         i %= BLOCKLEN;
-        if (index < (deque->len >> 1)) {
+        if (index < (Py_SIZE(deque) >> 1)) {
             b = deque->leftblock;
             while (n--)
                 b = b->rightlink;
         } else {
-            n = (deque->leftindex + deque->len - 1) / BLOCKLEN - n;
+            n = (deque->leftindex + Py_SIZE(deque) - 1) / BLOCKLEN - n;
             b = deque->rightblock;
             while (n--)
                 b = b->leftlink;
@@ -708,7 +782,7 @@
 {
     PyObject *item;
 
-    assert (i >= 0 && i < deque->len);
+    assert (i >= 0 && i < Py_SIZE(deque));
     if (_deque_rotate(deque, -i) == -1)
         return -1;
 
@@ -724,7 +798,7 @@
 {
     PyObject *old_value;
     block *b;
-    Py_ssize_t n, len=deque->len, halflen=(len+1)>>1, index=i;
+    Py_ssize_t n, len=Py_SIZE(deque), halflen=(len+1)>>1, index=i;
 
     if (i < 0 || i >= len) {
         PyErr_SetString(PyExc_IndexError,
@@ -787,17 +861,17 @@
     Py_ssize_t index;
     Py_ssize_t indexlo = deque->leftindex;
 
-    for (b = deque->leftblock; b != NULL; b = b->rightlink) {
-        const Py_ssize_t indexhi = b == deque->rightblock ?
-                                 deque->rightindex :
-                     BLOCKLEN - 1;
-
-        for (index = indexlo; index <= indexhi; ++index) {
+    for (b = deque->leftblock; b != deque->rightblock; b = b->rightlink) {
+        for (index = indexlo; index < BLOCKLEN ; index++) {
             item = b->data[index];
             Py_VISIT(item);
         }
         indexlo = 0;
     }
+    for (index = indexlo; index <= deque->rightindex; index++) {
+        item = b->data[index];
+        Py_VISIT(item);
+    }
     return 0;
 }
 
@@ -887,8 +961,8 @@
     }
 
     /* Shortcuts */
-    vs = ((dequeobject *)v)->len;
-    ws = ((dequeobject *)w)->len;
+    vs = Py_SIZE((dequeobject *)v);
+    ws = Py_SIZE((dequeobject *)w);
     if (op == Py_EQ) {
         if (v == w)
             Py_RETURN_TRUE;
@@ -989,8 +1063,8 @@
     Py_ssize_t blocks;
 
     res = sizeof(dequeobject);
-    blocks = (deque->leftindex + deque->len + BLOCKLEN - 1) / BLOCKLEN;
-    assert(deque->leftindex + deque->len - 1 ==
+    blocks = (deque->leftindex + Py_SIZE(deque) + BLOCKLEN - 1) / BLOCKLEN;
+    assert(deque->leftindex + Py_SIZE(deque) - 1 ==
            (blocks - 1) * BLOCKLEN + deque->rightindex);
     res += blocks * sizeof(block);
     return PyLong_FromSsize_t(res);
@@ -1143,7 +1217,7 @@
     Py_INCREF(deque);
     it->deque = deque;
     it->state = deque->state;
-    it->counter = deque->len;
+    it->counter = Py_SIZE(deque);
     PyObject_GC_Track(it);
     return (PyObject *)it;
 }
@@ -1182,7 +1256,7 @@
     it->index++;
     it->counter--;
     if (it->index == BLOCKLEN && it->counter > 0) {
-        assert (it->b->rightlink != NULL);
+        CHECK_NOT_END(it->b->rightlink);
         it->b = it->b->rightlink;
         it->index = 0;
     }
@@ -1230,7 +1304,7 @@
 static PyObject *
 dequeiter_reduce(dequeiterobject *it)
 {
-    return Py_BuildValue("O(On)", Py_TYPE(it), it->deque, it->deque->len - it->counter);
+    return Py_BuildValue("O(On)", Py_TYPE(it), it->deque, Py_SIZE(it->deque) - it->counter);
 }
 
 static PyMethodDef dequeiter_methods[] = {
@@ -1299,7 +1373,7 @@
     Py_INCREF(deque);
     it->deque = deque;
     it->state = deque->state;
-    it->counter = deque->len;
+    it->counter = Py_SIZE(deque);
     PyObject_GC_Track(it);
     return (PyObject *)it;
 }
@@ -1324,7 +1398,7 @@
     it->index--;
     it->counter--;
     if (it->index == -1 && it->counter > 0) {
-        assert (it->b->leftlink != NULL);
+        CHECK_NOT_END(it->b->leftlink);
         it->b = it->b->leftlink;
         it->index = BLOCKLEN - 1;
     }
@@ -1744,7 +1818,7 @@
             Py_DECREF(key);
         }
     } else {
-        bound_get = PyObject_GetAttrString(mapping, "get");
+        bound_get = _PyObject_GetAttrId(mapping, &PyId_get);
         if (bound_get == NULL)
             goto done;
 
diff --git a/Modules/_cryptmodule.c b/Modules/_cryptmodule.c
index 5100788..da44ef3 100644
--- a/Modules/_cryptmodule.c
+++ b/Modules/_cryptmodule.c
@@ -5,40 +5,76 @@
 
 #include <sys/types.h>
 
-#ifdef __VMS
-#include <openssl/des.h>
-#endif
-
 /* Module crypt */
 
+/*[clinic input]
+module crypt
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=c6252cf4f2f2ae81]*/
 
-static PyObject *crypt_crypt(PyObject *self, PyObject *args)
+
+/*[clinic input]
+crypt.crypt
+
+    word: 's'
+    salt: 's'
+    /
+
+Hash a *word* with the given *salt* and return the hashed password.
+
+*word* will usually be a user's password.  *salt* (either a random 2 or 16
+character string, possibly prefixed with $digit$ to indicate the method)
+will be used to perturb the encryption algorithm and produce distinct
+results for a given *word*.
+
+[clinic start generated code]*/
+
+PyDoc_STRVAR(crypt_crypt__doc__,
+"crypt($module, word, salt, /)\n"
+"--\n"
+"\n"
+"Hash a *word* with the given *salt* and return the hashed password.\n"
+"\n"
+"*word* will usually be a user\'s password.  *salt* (either a random 2 or 16\n"
+"character string, possibly prefixed with $digit$ to indicate the method)\n"
+"will be used to perturb the encryption algorithm and produce distinct\n"
+"results for a given *word*.");
+
+#define CRYPT_CRYPT_METHODDEF    \
+    {"crypt", (PyCFunction)crypt_crypt, METH_VARARGS, crypt_crypt__doc__},
+
+static PyObject *
+crypt_crypt_impl(PyModuleDef *module, const char *word, const char *salt);
+
+static PyObject *
+crypt_crypt(PyModuleDef *module, PyObject *args)
 {
-    char *word, *salt;
-#ifndef __VMS
-    extern char * crypt(const char *, const char *);
-#endif
+    PyObject *return_value = NULL;
+    const char *word;
+    const char *salt;
 
-    if (!PyArg_ParseTuple(args, "ss:crypt", &word, &salt)) {
-        return NULL;
-    }
+    if (!PyArg_ParseTuple(args,
+        "ss:crypt",
+        &word, &salt))
+        goto exit;
+    return_value = crypt_crypt_impl(module, word, salt);
+
+exit:
+    return return_value;
+}
+
+static PyObject *
+crypt_crypt_impl(PyModuleDef *module, const char *word, const char *salt)
+/*[clinic end generated code: output=3eaacdf994a6ff23 input=4d93b6d0f41fbf58]*/
+{
     /* On some platforms (AtheOS) crypt returns NULL for an invalid
        salt. Return None in that case. XXX Maybe raise an exception?  */
     return Py_BuildValue("s", crypt(word, salt));
-
 }
 
-PyDoc_STRVAR(crypt_crypt__doc__,
-"crypt(word, salt) -> string\n\
-word will usually be a user's password. salt is a 2-character string\n\
-which will be used to select one of 4096 variations of DES. The characters\n\
-in salt must be either \".\", \"/\", or an alphanumeric character. Returns\n\
-the hashed password as a string, which will be composed of characters from\n\
-the same alphabet as the salt.");
-
 
 static PyMethodDef crypt_methods[] = {
-    {"crypt",           crypt_crypt, METH_VARARGS, crypt_crypt__doc__},
+    CRYPT_CRYPT_METHODDEF
     {NULL,              NULL}           /* sentinel */
 };
 
diff --git a/Modules/_csv.c b/Modules/_csv.c
index f5f6e71..c8767d1 100644
--- a/Modules/_csv.c
+++ b/Modules/_csv.c
@@ -51,7 +51,7 @@
 typedef enum {
     START_RECORD, START_FIELD, ESCAPED_CHAR, IN_FIELD,
     IN_QUOTED_FIELD, ESCAPE_IN_QUOTED_FIELD, QUOTE_IN_QUOTED_FIELD,
-    EAT_CRNL
+    EAT_CRNL,AFTER_ESCAPED_CRNL
 } ParserState;
 
 typedef enum {
@@ -553,7 +553,10 @@
             return -1;
         field = tmp;
     }
-    PyList_Append(self->fields, field);
+    if (PyList_Append(self->fields, field) < 0) {
+        Py_DECREF(field);
+        return -1;
+    }
     Py_DECREF(field);
     return 0;
 }
@@ -651,6 +654,12 @@
         break;
 
     case ESCAPED_CHAR:
+        if (c == '\n' || c=='\r') {
+            if (parse_add_char(self, c) < 0)
+                return -1;
+            self->state = AFTER_ESCAPED_CRNL;
+            break;
+        }
         if (c == '\0')
             c = '\n';
         if (parse_add_char(self, c) < 0)
@@ -658,6 +667,11 @@
         self->state = IN_FIELD;
         break;
 
+    case AFTER_ESCAPED_CRNL:
+        if (c == '\0')
+            break;
+        /*fallthru*/
+
     case IN_FIELD:
         /* in unquoted field */
         if (c == '\n' || c == '\r' || c == '\0') {
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
index 48351be..c2889d2 100644
--- a/Modules/_ctypes/_ctypes.c
+++ b/Modules/_ctypes/_ctypes.c
@@ -276,8 +276,10 @@
     if (prefix)
         len += strlen(prefix);
     result = PyMem_Malloc(len + 1);
-    if (result == NULL)
+    if (result == NULL) {
+        PyErr_NoMemory();
         return NULL;
+    }
     if (prefix)
         strcpy(result, prefix);
     else
@@ -287,6 +289,48 @@
 }
 
 /*
+  Allocate a memory block for a pep3118 format string, adding
+  the given prefix (if non-null), an additional shape prefix, and a suffix.
+  Returns NULL on failure, with the error indicator set.  If called with
+  a suffix of NULL the error indicator must already be set.
+ */
+char *
+_ctypes_alloc_format_string_with_shape(int ndim, const Py_ssize_t *shape,
+                                       const char *prefix, const char *suffix)
+{
+    char *new_prefix;
+    char *result;
+    char buf[32];
+    int prefix_len;
+    int k;
+
+    prefix_len = 32 * ndim + 3;
+    if (prefix)
+        prefix_len += strlen(prefix);
+    new_prefix = PyMem_Malloc(prefix_len);
+    if (new_prefix == NULL)
+        return NULL;
+    new_prefix[0] = '\0';
+    if (prefix)
+        strcpy(new_prefix, prefix);
+    if (ndim > 0) {
+        /* Add the prefix "(shape[0],shape[1],...,shape[ndim-1])" */
+        strcat(new_prefix, "(");
+        for (k = 0; k < ndim; ++k) {
+            if (k < ndim-1) {
+                sprintf(buf, "%"PY_FORMAT_SIZE_T"d,", shape[k]);
+            } else {
+                sprintf(buf, "%"PY_FORMAT_SIZE_T"d)", shape[k]);
+            }
+            strcat(new_prefix, buf);
+        }
+    }
+    result = _ctypes_alloc_format_string(new_prefix, suffix);
+    PyMem_Free(new_prefix);
+    return result;
+}
+
+/*
   PyCStructType_Type - a meta type/class.  Creating a new class using this one as
   __metaclass__ will call the contructor StructUnionType_new.  It replaces the
   tp_dict member with a new instance of StgDict, and initializes the C
@@ -419,50 +463,45 @@
 static PyObject *
 CDataType_from_buffer(PyObject *type, PyObject *args)
 {
-    void *buffer;
-    Py_ssize_t buffer_len;
+    Py_buffer buffer;
     Py_ssize_t offset = 0;
-    PyObject *obj, *result;
+    PyObject *result, *mv;
     StgDictObject *dict = PyType_stgdict(type);
     assert (dict);
 
-    if (!PyArg_ParseTuple(args,
-#if (PY_VERSION_HEX < 0x02050000)
-                          "O|i:from_buffer",
-#else
-                          "O|n:from_buffer",
-#endif
-                          &obj, &offset))
-        return NULL;
-
-    if (-1 == PyObject_AsWriteBuffer(obj, &buffer, &buffer_len))
+    if (!PyArg_ParseTuple(args, "w*|n:from_buffer", &buffer, &offset))
         return NULL;
 
     if (offset < 0) {
         PyErr_SetString(PyExc_ValueError,
                         "offset cannot be negative");
+        PyBuffer_Release(&buffer);
         return NULL;
     }
-    if (dict->size > buffer_len - offset) {
+    if (dict->size > buffer.len - offset) {
         PyErr_Format(PyExc_ValueError,
-#if (PY_VERSION_HEX < 0x02050000)
-                     "Buffer size too small (%d instead of at least %d bytes)",
-#else
                      "Buffer size too small (%zd instead of at least %zd bytes)",
-#endif
-                     buffer_len, dict->size + offset);
+                     buffer.len, dict->size + offset);
+        PyBuffer_Release(&buffer);
         return NULL;
     }
 
-    result = PyCData_AtAddress(type, (char *)buffer + offset);
-    if (result == NULL)
-        return NULL;
-
-    Py_INCREF(obj);
-    if (-1 == KeepRef((CDataObject *)result, -1, obj)) {
-        Py_DECREF(result);
+    result = PyCData_AtAddress(type, (char *)buffer.buf + offset);
+    if (result == NULL) {
+        PyBuffer_Release(&buffer);
         return NULL;
     }
+
+    mv = PyMemoryView_FromBuffer(&buffer);
+    if (mv == NULL) {
+        PyBuffer_Release(&buffer);
+        return NULL;
+    }
+    /* Hack the memoryview so that it will release the buffer. */
+    ((PyMemoryViewObject *)mv)->mbuf->master.obj = buffer.obj;
+    ((PyMemoryViewObject *)mv)->view.obj = buffer.obj;
+    if (-1 == KeepRef((CDataObject *)result, -1, mv))
+        result = NULL;
     return result;
 }
 
@@ -475,47 +514,36 @@
 static PyObject *
 CDataType_from_buffer_copy(PyObject *type, PyObject *args)
 {
-    const void *buffer;
-    Py_ssize_t buffer_len;
+    Py_buffer buffer;
     Py_ssize_t offset = 0;
-    PyObject *obj, *result;
+    PyObject *result;
     StgDictObject *dict = PyType_stgdict(type);
     assert (dict);
 
-    if (!PyArg_ParseTuple(args,
-#if (PY_VERSION_HEX < 0x02050000)
-                          "O|i:from_buffer",
-#else
-                          "O|n:from_buffer",
-#endif
-                          &obj, &offset))
-        return NULL;
-
-    if (-1 == PyObject_AsReadBuffer(obj, (const void**)&buffer, &buffer_len))
+    if (!PyArg_ParseTuple(args, "y*|n:from_buffer", &buffer, &offset))
         return NULL;
 
     if (offset < 0) {
         PyErr_SetString(PyExc_ValueError,
                         "offset cannot be negative");
+        PyBuffer_Release(&buffer);
         return NULL;
     }
 
-    if (dict->size > buffer_len - offset) {
+    if (dict->size > buffer.len - offset) {
         PyErr_Format(PyExc_ValueError,
-#if (PY_VERSION_HEX < 0x02050000)
-                     "Buffer size too small (%d instead of at least %d bytes)",
-#else
                      "Buffer size too small (%zd instead of at least %zd bytes)",
-#endif
-                     buffer_len, dict->size + offset);
+                     buffer.len, dict->size + offset);
+        PyBuffer_Release(&buffer);
         return NULL;
     }
 
     result = GenericPyCData_new((PyTypeObject *)type, NULL, NULL);
-    if (result == NULL)
-        return NULL;
-    memcpy(((CDataObject *)result)->b_ptr,
-           (char *)buffer+offset, dict->size);
+    if (result != NULL) {
+        memcpy(((CDataObject *)result)->b_ptr,
+               (char *)buffer.buf + offset, dict->size);
+    }
+    PyBuffer_Release(&buffer);
     return result;
 }
 
@@ -879,14 +907,21 @@
 
     if (proto) {
         StgDictObject *itemdict = PyType_stgdict(proto);
+        const char *current_format;
         assert(itemdict);
         /* If itemdict->format is NULL, then this is a pointer to an
            incomplete type.  We create a generic format string
            'pointer to bytes' in this case.  XXX Better would be to
            fix the format string later...
         */
-        stgdict->format = _ctypes_alloc_format_string("&",
-                      itemdict->format ? itemdict->format : "B");
+        current_format = itemdict->format ? itemdict->format : "B";
+        if (itemdict->shape != NULL) {
+            /* pointer to an array: the shape needs to be prefixed */
+            stgdict->format = _ctypes_alloc_format_string_with_shape(
+                itemdict->ndim, itemdict->shape, "&", current_format);
+        } else {
+            stgdict->format = _ctypes_alloc_format_string("&", current_format);
+        }
         if (stgdict->format == NULL) {
             Py_DECREF((PyObject *)stgdict);
             return NULL;
@@ -1050,7 +1085,7 @@
     ptr = view.buf;
     if (size > self->b_size) {
         PyErr_SetString(PyExc_ValueError,
-                        "string too long");
+                        "byte string too long");
         goto fail;
     }
 
@@ -1102,7 +1137,7 @@
     size = PyBytes_GET_SIZE(value);
     if (size > self->b_size) {
         PyErr_SetString(PyExc_ValueError,
-                        "string too long");
+                        "byte string too long");
         Py_DECREF(value);
         return -1;
     }
@@ -1264,7 +1299,6 @@
     long length;
     int overflow;
     Py_ssize_t itemsize, itemalign;
-    char buf[32];
 
     /* create the new instance (which is a class,
        since we are a metatype!) */
@@ -1314,19 +1348,15 @@
     }
 
     assert(itemdict->format);
-    if (itemdict->format[0] == '(') {
-        sprintf(buf, "(%ld,", length);
-        stgdict->format = _ctypes_alloc_format_string(buf, itemdict->format+1);
-    } else {
-        sprintf(buf, "(%ld)", length);
-        stgdict->format = _ctypes_alloc_format_string(buf, itemdict->format);
-    }
+    stgdict->format = _ctypes_alloc_format_string(NULL, itemdict->format);
     if (stgdict->format == NULL)
         goto error;
     stgdict->ndim = itemdict->ndim + 1;
-    stgdict->shape = PyMem_Malloc(sizeof(Py_ssize_t *) * stgdict->ndim);
-    if (stgdict->shape == NULL)
+    stgdict->shape = PyMem_Malloc(sizeof(Py_ssize_t) * stgdict->ndim);
+    if (stgdict->shape == NULL) {
+        PyErr_NoMemory();
         goto error;
+    }
     stgdict->shape[0] = length;
     memmove(&stgdict->shape[1], itemdict->shape,
         sizeof(Py_ssize_t) * (stgdict->ndim - 1));
@@ -1357,7 +1387,8 @@
     if (-1 == PyDict_Update((PyObject *)stgdict, result->tp_dict))
         goto error;
     Py_DECREF(result->tp_dict);
-    result->tp_dict = (PyObject *)stgdict;
+    result->tp_dict = (PyObject *)stgdict;  /* steal the reference */
+    stgdict = NULL;
 
     /* Special case for character arrays.
        A permanent annoyance: char arrays are also strings!
@@ -1445,7 +1476,7 @@
         Py_INCREF(Py_None);
         return Py_None;
     }
-    if (PyUnicode_Check(value) || PyBytes_Check(value)) {
+    if (PyUnicode_Check(value)) {
         PyCArgObject *parg;
         struct fielddesc *fd = _ctypes_get_fielddesc("Z");
 
@@ -1597,25 +1628,8 @@
         return (PyObject *)parg;
     }
     /* XXX struni: remove later */
-/* string */
-    if (PyBytes_Check(value)) {
-        PyCArgObject *parg;
-        struct fielddesc *fd = _ctypes_get_fielddesc("z");
-
-        parg = PyCArgObject_new();
-        if (parg == NULL)
-            return NULL;
-        parg->pffi_type = &ffi_type_pointer;
-        parg->tag = 'z';
-        parg->obj = fd->setfunc(&parg->value, value, 0);
-        if (parg->obj == NULL) {
-            Py_DECREF(parg);
-            return NULL;
-        }
-        return (PyObject *)parg;
-    }
 /* bytes */
-    if (PyByteArray_Check(value)) {
+    if (PyBytes_Check(value)) {
         PyCArgObject *parg;
         struct fielddesc *fd = _ctypes_get_fielddesc("z");
 
@@ -2259,6 +2273,10 @@
        argtypes would be a ctypes type).
     */
     stgdict->format = _ctypes_alloc_format_string(NULL, "X{}");
+    if (stgdict->format == NULL) {
+        Py_DECREF((PyObject *)stgdict);
+        return NULL;
+    }
     stgdict->flags |= TYPEFLAG_ISPOINTER;
 
     /* create the new instance (which is a class,
@@ -2341,6 +2359,8 @@
     if (self->b_objects == NULL) {
         if (self->b_length) {
             self->b_objects = PyDict_New();
+            if (self->b_objects == NULL)
+                return NULL;
         } else {
             Py_INCREF(Py_None);
             self->b_objects = Py_None;
@@ -2352,7 +2372,11 @@
 static PyObject *
 GetKeepedObjects(CDataObject *target)
 {
-    return PyCData_GetContainer(target)->b_objects;
+    CDataObject *container;
+    container = PyCData_GetContainer(target);
+    if (container == NULL)
+        return NULL;
+    return container->b_objects;
 }
 
 static PyObject *
@@ -2409,6 +2433,10 @@
         return 0;
     }
     ob = PyCData_GetContainer(target);
+    if (ob == NULL) {
+        Py_DECREF(keep);
+        return -1;
+    }
     if (ob->b_objects == NULL || !PyDict_CheckExact(ob->b_objects)) {
         Py_XDECREF(ob->b_objects);
         ob->b_objects = keep; /* refcount consumed */
@@ -2795,6 +2823,9 @@
             /* XXX */;
 
         value = GetKeepedObjects(src);
+        if (value == NULL)
+            return NULL;
+
         Py_INCREF(value);
         return value;
     }
@@ -2818,6 +2849,9 @@
         *(void **)ptr = src->b_ptr;
 
         keep = GetKeepedObjects(src);
+        if (keep == NULL)
+            return NULL;
+
         /*
           We are assigning an array object to a field which represents
           a pointer. This has the same effect as converting an array
@@ -3172,7 +3206,7 @@
         return *pname ? 1 : 0;
     }
     PyErr_SetString(PyExc_TypeError,
-                    "function name must be string or integer");
+                    "function name must be string, bytes object or integer");
     return 0;
 }
 
@@ -4044,8 +4078,8 @@
         return -1;
     }
     if (PyTuple_GET_SIZE(args)) {
-        int res = _init_pos_args(self, Py_TYPE(self),
-                                 args, kwds, 0);
+        Py_ssize_t res = _init_pos_args(self, Py_TYPE(self),
+                                        args, kwds, 0);
         if (res == -1)
             return -1;
         if (res < PyTuple_GET_SIZE(args)) {
@@ -4216,7 +4250,7 @@
             i += self->b_length;
         return Array_item(myself, i);
     }
-    else if PySlice_Check(item) {
+    else if (PySlice_Check(item)) {
         StgDictObject *stgdict, *itemdict;
         PyObject *proto;
         PyObject *np;
@@ -4292,6 +4326,10 @@
         for (cur = start, i = 0; i < slicelen;
              cur += step, i++) {
             PyObject *v = Array_item(myself, cur);
+            if (v == NULL) {
+                Py_DECREF(np);
+                return NULL;
+            }
             PyList_SET_ITEM(np, i, v);
         }
         return np;
@@ -4797,7 +4835,7 @@
     *(void **)self->b_ptr = dst->b_ptr;
 
     /*
-       A Pointer instance must keep a the value it points to alive.  So, a
+       A Pointer instance must keep the value it points to alive.  So, a
        pointer instance has b_length set to 2 instead of 1, and we set
        'value' itself as the second item of the b_objects list, additionally.
     */
@@ -4806,6 +4844,9 @@
         return -1;
 
     keep = GetKeepedObjects(dst);
+    if (keep == NULL)
+        return -1;
+
     Py_INCREF(keep);
     return KeepRef(self, 0, keep);
 }
@@ -5212,9 +5253,14 @@
      */
     if (CDataObject_Check(src)) {
         CDataObject *obj = (CDataObject *)src;
+        CDataObject *container;
+
         /* PyCData_GetContainer will initialize src.b_objects, we need
            this so it can be shared */
-        PyCData_GetContainer(obj);
+        container = PyCData_GetContainer(obj);
+        if (container == NULL)
+            goto failed;
+
         /* But we need a dictionary! */
         if (obj->b_objects == Py_None) {
             Py_DECREF(Py_None);
diff --git a/Modules/_ctypes/_ctypes_test.c b/Modules/_ctypes/_ctypes_test.c
index 3a6845f..f957e02 100644
--- a/Modules/_ctypes/_ctypes_test.c
+++ b/Modules/_ctypes/_ctypes_test.c
@@ -527,6 +527,49 @@
     return 1;
 }
 
+EXPORT(long left = 10);
+EXPORT(long top = 20);
+EXPORT(long right = 30);
+EXPORT(long bottom = 40);
+
+EXPORT(RECT) ReturnRect(int i, RECT ar, RECT* br, POINT cp, RECT dr,
+                        RECT *er, POINT fp, RECT gr)
+{
+    /*Check input */
+    if (ar.left + br->left + dr.left + er->left + gr.left != left * 5)
+    {
+        ar.left = 100;
+        return ar;
+    }
+    if (ar.right + br->right + dr.right + er->right + gr.right != right * 5)
+    {
+        ar.right = 100;
+        return ar;
+    }
+    if (cp.x != fp.x)
+    {
+        ar.left = -100;
+    }
+    if (cp.y != fp.y)
+    {
+        ar.left = -200;
+    }
+    switch(i)
+    {
+    case 0:
+        return ar;
+        break;
+    case 1:
+        return dr;
+        break;
+    case 2:
+        return gr;
+        break;
+
+    }
+    return ar;
+}
+
 typedef struct {
     short x;
     short y;
diff --git a/Modules/_ctypes/callbacks.c b/Modules/_ctypes/callbacks.c
index a3d2321..7cd6164 100644
--- a/Modules/_ctypes/callbacks.c
+++ b/Modules/_ctypes/callbacks.c
@@ -92,32 +92,6 @@
 }
 
 
-/* after code that pyrex generates */
-void _ctypes_add_traceback(char *funcname, char *filename, int lineno)
-{
-    PyObject *py_globals = 0;
-    PyCodeObject *py_code = 0;
-    PyFrameObject *py_frame = 0;
-
-    py_globals = PyDict_New();
-    if (!py_globals) goto bad;
-    py_code = PyCode_NewEmpty(filename, funcname, lineno);
-    if (!py_code) goto bad;
-    py_frame = PyFrame_New(
-        PyThreadState_Get(), /*PyThreadState *tstate,*/
-        py_code,             /*PyCodeObject *code,*/
-        py_globals,          /*PyObject *globals,*/
-        0                    /*PyObject *locals*/
-        );
-    if (!py_frame) goto bad;
-    py_frame->f_lineno = lineno;
-    PyTraceBack_Here(py_frame);
-  bad:
-    Py_XDECREF(py_globals);
-    Py_XDECREF(py_code);
-    Py_XDECREF(py_frame);
-}
-
 #ifdef MS_WIN32
 /*
  * We must call AddRef() on non-NULL COM pointers we receive as arguments
@@ -237,7 +211,7 @@
     }
 
 #define CHECK(what, x) \
-if (x == NULL) _ctypes_add_traceback(what, "_ctypes/callbacks.c", __LINE__ - 1), PyErr_Print()
+if (x == NULL) _PyTraceback_Add(what, "_ctypes/callbacks.c", __LINE__ - 1), PyErr_Print()
 
     if (flags & (FUNCFLAG_USE_ERRNO | FUNCFLAG_USE_LASTERROR)) {
         error_object = _ctypes_get_errobj(&space);
diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c
index 09eb653..8daeffc 100644
--- a/Modules/_ctypes/callproc.c
+++ b/Modules/_ctypes/callproc.c
@@ -261,18 +261,18 @@
            to a virtual address for which it does not
            have the appropriate access. */
         if (pr->ExceptionInformation[0] == 0)
-            PyErr_Format(PyExc_WindowsError,
+            PyErr_Format(PyExc_OSError,
                          "exception: access violation reading %p",
                          pr->ExceptionInformation[1]);
         else
-            PyErr_Format(PyExc_WindowsError,
+            PyErr_Format(PyExc_OSError,
                          "exception: access violation writing %p",
                          pr->ExceptionInformation[1]);
         break;
 
     case EXCEPTION_BREAKPOINT:
         /* A breakpoint was encountered. */
-        PyErr_SetString(PyExc_WindowsError,
+        PyErr_SetString(PyExc_OSError,
                         "exception: breakpoint encountered");
         break;
 
@@ -282,14 +282,14 @@
            alignment. For example, 16-bit values must be
            aligned on 2-byte boundaries, 32-bit values on
            4-byte boundaries, and so on. */
-        PyErr_SetString(PyExc_WindowsError,
+        PyErr_SetString(PyExc_OSError,
                         "exception: datatype misalignment");
         break;
 
     case EXCEPTION_SINGLE_STEP:
         /* A trace trap or other single-instruction mechanism
            signaled that one instruction has been executed. */
-        PyErr_SetString(PyExc_WindowsError,
+        PyErr_SetString(PyExc_OSError,
                         "exception: single step");
         break;
 
@@ -297,7 +297,7 @@
         /* The thread attempted to access an array element
            that is out of bounds, and the underlying hardware
            supports bounds checking. */
-        PyErr_SetString(PyExc_WindowsError,
+        PyErr_SetString(PyExc_OSError,
                         "exception: array bounds exceeded");
         break;
 
@@ -306,28 +306,28 @@
            is denormal. A denormal value is one that is too
            small to represent as a standard floating-point
            value. */
-        PyErr_SetString(PyExc_WindowsError,
+        PyErr_SetString(PyExc_OSError,
                         "exception: floating-point operand denormal");
         break;
 
     case EXCEPTION_FLT_DIVIDE_BY_ZERO:
         /* The thread attempted to divide a floating-point
            value by a floating-point divisor of zero. */
-        PyErr_SetString(PyExc_WindowsError,
+        PyErr_SetString(PyExc_OSError,
                         "exception: float divide by zero");
         break;
 
     case EXCEPTION_FLT_INEXACT_RESULT:
         /* The result of a floating-point operation cannot be
            represented exactly as a decimal fraction. */
-        PyErr_SetString(PyExc_WindowsError,
+        PyErr_SetString(PyExc_OSError,
                         "exception: float inexact");
         break;
 
     case EXCEPTION_FLT_INVALID_OPERATION:
         /* This exception represents any floating-point
            exception not included in this list. */
-        PyErr_SetString(PyExc_WindowsError,
+        PyErr_SetString(PyExc_OSError,
                         "exception: float invalid operation");
         break;
 
@@ -335,21 +335,21 @@
         /* The exponent of a floating-point operation is
            greater than the magnitude allowed by the
            corresponding type. */
-        PyErr_SetString(PyExc_WindowsError,
+        PyErr_SetString(PyExc_OSError,
                         "exception: float overflow");
         break;
 
     case EXCEPTION_FLT_STACK_CHECK:
         /* The stack overflowed or underflowed as the result
            of a floating-point operation. */
-        PyErr_SetString(PyExc_WindowsError,
+        PyErr_SetString(PyExc_OSError,
                         "exception: stack over/underflow");
         break;
 
     case EXCEPTION_STACK_OVERFLOW:
         /* The stack overflowed or underflowed as the result
            of a floating-point operation. */
-        PyErr_SetString(PyExc_WindowsError,
+        PyErr_SetString(PyExc_OSError,
                         "exception: stack overflow");
         break;
 
@@ -357,21 +357,21 @@
         /* The exponent of a floating-point operation is less
            than the magnitude allowed by the corresponding
            type. */
-        PyErr_SetString(PyExc_WindowsError,
+        PyErr_SetString(PyExc_OSError,
                         "exception: float underflow");
         break;
 
     case EXCEPTION_INT_DIVIDE_BY_ZERO:
         /* The thread attempted to divide an integer value by
            an integer divisor of zero. */
-        PyErr_SetString(PyExc_WindowsError,
+        PyErr_SetString(PyExc_OSError,
                         "exception: integer divide by zero");
         break;
 
     case EXCEPTION_INT_OVERFLOW:
         /* The result of an integer operation caused a carry
            out of the most significant bit of the result. */
-        PyErr_SetString(PyExc_WindowsError,
+        PyErr_SetString(PyExc_OSError,
                         "exception: integer overflow");
         break;
 
@@ -379,14 +379,14 @@
         /* The thread attempted to execute an instruction
            whose operation is not allowed in the current
            machine mode. */
-        PyErr_SetString(PyExc_WindowsError,
+        PyErr_SetString(PyExc_OSError,
                         "exception: priviledged instruction");
         break;
 
     case EXCEPTION_NONCONTINUABLE_EXCEPTION:
         /* The thread attempted to continue execution after a
            noncontinuable exception occurred. */
-        PyErr_SetString(PyExc_WindowsError,
+        PyErr_SetString(PyExc_OSError,
                         "exception: nocontinuable");
         break;
 
@@ -620,6 +620,8 @@
         assert(dict->paramfunc);
         /* If it has an stgdict, it is a CDataObject */
         carg = dict->paramfunc((CDataObject *)obj);
+        if (carg == NULL)
+            return -1;
         pa->ffi_type = carg->pffi_type;
         memcpy(&pa->value, &carg->value, sizeof(pa->value));
         pa->keep = (PyObject *)carg;
@@ -917,7 +919,7 @@
 
     v = PyObject_CallFunctionObjArgs(checker, retval, NULL);
     if (v == NULL)
-        _ctypes_add_traceback("GetResult", "_ctypes/callproc.c", __LINE__-2);
+        _PyTraceback_Add("GetResult", "_ctypes/callproc.c", __LINE__-2);
     Py_DECREF(retval);
     return v;
 }
@@ -1105,9 +1107,7 @@
         if (argtypes && argtype_count > i) {
             PyObject *v;
             converter = PyTuple_GET_ITEM(argtypes, i);
-            v = PyObject_CallFunctionObjArgs(converter,
-                                               arg,
-                                               NULL);
+            v = PyObject_CallFunctionObjArgs(converter, arg, NULL);
             if (v == NULL) {
                 _ctypes_extend_error(PyExc_ArgError, "argument %d: ", i+1);
                 goto cleanup;
@@ -1140,9 +1140,6 @@
     for (i = 0; i < argcount; ++i) {
         atypes[i] = args[i].ffi_type;
         if (atypes[i]->type == FFI_TYPE_STRUCT
-#ifdef _WIN64
-            && atypes[i]->size <= sizeof(void *)
-#endif
             )
             avalues[i] = (void *)args[i].value.p;
         else
@@ -1272,62 +1269,6 @@
     return Py_None;
 }
 
-/* obsolete, should be removed */
-/* Only used by sample code (in samples\Windows\COM.py) */
-static PyObject *
-call_commethod(PyObject *self, PyObject *args)
-{
-    IUnknown *pIunk;
-    int index;
-    PyObject *arguments;
-    PPROC *lpVtbl;
-    PyObject *result;
-    CDataObject *pcom;
-    PyObject *argtypes = NULL;
-
-    if (!PyArg_ParseTuple(args,
-                          "OiO!|O!",
-                          &pcom, &index,
-                          &PyTuple_Type, &arguments,
-                          &PyTuple_Type, &argtypes))
-        return NULL;
-
-    if (argtypes && (PyTuple_GET_SIZE(arguments) != PyTuple_GET_SIZE(argtypes))) {
-        PyErr_Format(PyExc_TypeError,
-                     "Method takes %d arguments (%d given)",
-                     PyTuple_GET_SIZE(argtypes), PyTuple_GET_SIZE(arguments));
-        return NULL;
-    }
-
-    if (!CDataObject_Check(pcom) || (pcom->b_size != sizeof(void *))) {
-        PyErr_Format(PyExc_TypeError,
-                     "COM Pointer expected instead of %s instance",
-                     Py_TYPE(pcom)->tp_name);
-        return NULL;
-    }
-
-    if ((*(void **)(pcom->b_ptr)) == NULL) {
-        PyErr_SetString(PyExc_ValueError,
-                        "The COM 'this' pointer is NULL");
-        return NULL;
-    }
-
-    pIunk = (IUnknown *)(*(void **)(pcom->b_ptr));
-    lpVtbl = (PPROC *)(pIunk->lpVtbl);
-
-    result =  _ctypes_callproc(lpVtbl[index],
-                        arguments,
-#ifdef MS_WIN32
-                        pIunk,
-                        NULL,
-#endif
-                        FUNCFLAG_HRESULT, /* flags */
-                argtypes, /* self->argtypes */
-                NULL, /* self->restype */
-                NULL); /* checker */
-    return result;
-}
-
 static char copy_com_pointer_doc[] =
 "CopyComPointer(src, dst) -> HRESULT value\n";
 
@@ -1489,9 +1430,9 @@
                         NULL,
 #endif
                         FUNCFLAG_CDECL, /* flags */
-                NULL, /* self->argtypes */
-                NULL, /* self->restype */
-                NULL); /* checker */
+                        NULL, /* self->argtypes */
+                        NULL, /* self->restype */
+                        NULL); /* checker */
     return result;
 }
 
@@ -1728,24 +1669,30 @@
     }
     if (PyUnicode_CheckExact(cls)) {
         char *name = _PyUnicode_AsString(cls);
-        buf = alloca(strlen(name) + 3 + 1);
+        buf = PyMem_Malloc(strlen(name) + 3 + 1);
+        if (buf == NULL)
+            return PyErr_NoMemory();
         sprintf(buf, "LP_%s", name);
         result = PyObject_CallFunction((PyObject *)Py_TYPE(&PyCPointer_Type),
                                        "s(O){}",
                                        buf,
                                        &PyCPointer_Type);
+        PyMem_Free(buf);
         if (result == NULL)
             return result;
         key = PyLong_FromVoidPtr(result);
     } else if (PyType_Check(cls)) {
         typ = (PyTypeObject *)cls;
-        buf = alloca(strlen(typ->tp_name) + 3 + 1);
+        buf = PyMem_Malloc(strlen(typ->tp_name) + 3 + 1);
+        if (buf == NULL)
+            return PyErr_NoMemory();
         sprintf(buf, "LP_%s", typ->tp_name);
         result = PyObject_CallFunction((PyObject *)Py_TYPE(&PyCPointer_Type),
                                        "s(O){sO}",
                                        buf,
                                        &PyCPointer_Type,
                                        "_type_", cls);
+        PyMem_Free(buf);
         if (result == NULL)
             return result;
         Py_INCREF(cls);
@@ -1822,7 +1769,6 @@
     {"FormatError", format_error, METH_VARARGS, format_error_doc},
     {"LoadLibrary", load_library, METH_VARARGS, load_library_doc},
     {"FreeLibrary", free_library, METH_VARARGS, free_library_doc},
-    {"call_commethod", call_commethod, METH_VARARGS },
     {"_check_HRESULT", check_hresult, METH_VARARGS},
 #else
     {"dlopen", py_dl_open, METH_VARARGS,
diff --git a/Modules/_ctypes/cfield.c b/Modules/_ctypes/cfield.c
index 79d60f3..2078291 100644
--- a/Modules/_ctypes/cfield.c
+++ b/Modules/_ctypes/cfield.c
@@ -1160,7 +1160,7 @@
     }
   error:
     PyErr_Format(PyExc_TypeError,
-                 "one character string expected");
+                 "one character bytes, bytearray or integer expected");
     return NULL;
 }
 
@@ -1295,7 +1295,7 @@
         Py_INCREF(value);
     } else {
         PyErr_Format(PyExc_TypeError,
-                     "expected string, %s found",
+                     "expected bytes, %s found",
                      value->ob_type->tp_name);
         return NULL;
     }
@@ -1311,7 +1311,7 @@
         ++size;
     } else if (size > length) {
         PyErr_Format(PyExc_ValueError,
-                     "string too long (%zd, maximum length %zd)",
+                     "bytes too long (%zd, maximum length %zd)",
                      size, length);
         Py_DECREF(value);
         return NULL;
diff --git a/Modules/_ctypes/ctypes.h b/Modules/_ctypes/ctypes.h
index 5237ac2..de6c764 100644
--- a/Modules/_ctypes/ctypes.h
+++ b/Modules/_ctypes/ctypes.h
@@ -353,10 +353,11 @@
 extern void _ctypes_free_closure(void *);
 extern void *_ctypes_alloc_closure(void);
 
-extern void _ctypes_add_traceback(char *, char *, int);
-
 extern PyObject *PyCData_FromBaseObj(PyObject *type, PyObject *base, Py_ssize_t index, char *adr);
 extern char *_ctypes_alloc_format_string(const char *prefix, const char *suffix);
+extern char *_ctypes_alloc_format_string_with_shape(int ndim,
+                                                const Py_ssize_t *shape,
+                                                const char *prefix, const char *suffix);
 
 extern int _ctypes_simple_instance(PyObject *obj);
 
diff --git a/Modules/_ctypes/libffi.diff b/Modules/_ctypes/libffi.diff
index ade28e5..ffa7baf 100644
--- a/Modules/_ctypes/libffi.diff
+++ b/Modules/_ctypes/libffi.diff
@@ -1,8 +1,7 @@
-diff -r -N -u libffi.orig/autom4te.cache/output.0 libffi/autom4te.cache/output.0
-diff -r -N -u libffi.orig/configure libffi/configure
---- libffi.orig/configure	2013-03-17 15:37:50.000000000 -0700
-+++ libffi/configure	2013-03-18 15:11:39.611575163 -0700
-@@ -13368,6 +13368,10 @@
+diff -urN libffi-3.1/configure libffi/configure
+--- libffi-3.1/configure	2014-05-19 15:44:03.000000000 +0200
++++ libffi/configure	2014-08-09 21:51:07.877871443 +0200
+@@ -17236,6 +17236,10 @@
  	fi
  	;;
  
@@ -13,22 +12,22 @@
    x86_64-*-darwin*)
  	TARGET=X86_DARWIN; TARGETDIR=x86
  	;;
-@@ -13426,12 +13430,12 @@
+@@ -17298,12 +17302,12 @@
  	;;
  
    mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
 -	TARGET=MIPS; TARGETDIR=mips
 +	TARGET=MIPS_IRIX; TARGETDIR=mips
  	;;
-   mips*-*-linux* | mips*-*-openbsd*)
+   mips*-*linux* | mips*-*-openbsd*)
  	# Support 128-bit long double for NewABI.
  	HAVE_LONG_DOUBLE='defined(__mips64)'
 -	TARGET=MIPS; TARGETDIR=mips
-+	TARGET=MIPS_IRIX; TARGETDIR=mips
++	TARGET=MIPS_LINUX; TARGETDIR=mips
  	;;
  
-   powerpc*-*-linux* | powerpc-*-sysv*)
-@@ -13491,7 +13495,7 @@
+   nios2*-linux*)
+@@ -17373,7 +17377,7 @@
    as_fn_error $? "\"libffi has not been ported to $host.\"" "$LINENO" 5
  fi
  
@@ -37,7 +36,7 @@
    MIPS_TRUE=
    MIPS_FALSE='#'
  else
-@@ -14862,6 +14866,12 @@
+@@ -18814,6 +18818,12 @@
  ac_config_files="$ac_config_files include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc"
  
  
@@ -50,7 +49,7 @@
  cat >confcache <<\_ACEOF
  # This file is a shell script that caches the results of configure
  # tests run on this system so they can be shared between configure
-@@ -16047,6 +16057,8 @@
+@@ -20126,6 +20136,8 @@
      "testsuite/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/Makefile" ;;
      "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
      "libffi.pc") CONFIG_FILES="$CONFIG_FILES libffi.pc" ;;
@@ -59,9 +58,9 @@
  
    *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
    esac
-diff -r -N -u libffi.orig/configure.ac libffi/configure.ac
---- libffi.orig/configure.ac	2013-03-17 15:37:50.000000000 -0700
-+++ libffi/configure.ac	2013-03-18 15:11:11.392989136 -0700
+diff -urN libffi-3.1/configure.ac libffi/configure.ac
+--- libffi-3.1/configure.ac	2014-05-11 15:57:49.000000000 +0200
++++ libffi/configure.ac	2014-08-09 21:51:07.877871443 +0200
 @@ -1,4 +1,7 @@
  dnl Process this with autoconf to create configure
 +#
@@ -70,33 +69,32 @@
  
  AC_PREREQ(2.68)
  
-@@ -146,6 +149,10 @@
- 	fi	  
+@@ -144,6 +147,9 @@
+ 	  AM_LTLDFLAGS='-no-undefined -bindir "$(bindir)"';
+ 	fi
  	;;
- 
 +  i*86-*-nto-qnx*) 
 +        TARGET=X86; TARGETDIR=x86
 +        ;;
-+
-   x86_64-*-darwin*)
+   i?86-*-darwin*)
  	TARGET=X86_DARWIN; TARGETDIR=x86
  	;;
-@@ -204,12 +211,12 @@
+@@ -218,12 +224,12 @@
  	;;
  
    mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
 -	TARGET=MIPS; TARGETDIR=mips
 +	TARGET=MIPS_IRIX; TARGETDIR=mips
  	;;
-   mips*-*-linux* | mips*-*-openbsd*)
+   mips*-*linux* | mips*-*-openbsd*)
  	# Support 128-bit long double for NewABI.
  	HAVE_LONG_DOUBLE='defined(__mips64)'
 -	TARGET=MIPS; TARGETDIR=mips
-+	TARGET=MIPS_IRIX; TARGETDIR=mips
++	TARGET=MIPS_LINUX; TARGETDIR=mips
  	;;
  
-   powerpc*-*-linux* | powerpc-*-sysv*)
-@@ -269,7 +276,7 @@
+   nios2*-linux*)
+@@ -293,7 +299,7 @@
    AC_MSG_ERROR(["libffi has not been ported to $host."])
  fi
  
@@ -105,7 +103,7 @@
  AM_CONDITIONAL(BFIN, test x$TARGET = xBFIN)
  AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC)
  AM_CONDITIONAL(X86, test x$TARGET = xX86)
-@@ -567,4 +574,8 @@
+@@ -617,4 +623,8 @@
  
  AC_CONFIG_FILES(include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc)
  
@@ -114,19 +112,19 @@
 +AC_CONFIG_FILES(fficonfig.py)
 +
  AC_OUTPUT
---- libffi-3.0.11/fficonfig.py.in	1970-01-01 01:00:00.000000000 +0100
-+++ libffi/fficonfig.py.in	2012-03-15 01:04:27.000000000 +0100
+diff -urN libffi-3.1/fficonfig.py.in libffi/fficonfig.py.in
+--- libffi-3.1/fficonfig.py.in	1970-01-01 01:00:00.000000000 +0100
++++ libffi/fficonfig.py.in	2014-08-09 21:43:25.229871827 +0200
 @@ -0,0 +1,35 @@
 +ffi_sources = """
 +src/prep_cif.c
 +src/closures.c
-+src/dlmalloc.c
 +""".split()
 +
 +ffi_platforms = {
 +    'MIPS_IRIX': ['src/mips/ffi.c', 'src/mips/o32.S', 'src/mips/n32.S'],
 +    'MIPS_LINUX': ['src/mips/ffi.c', 'src/mips/o32.S'],
-+    'X86': ['src/x86/ffi.c', 'src/x86/sysv.S'],
++    'X86': ['src/x86/ffi.c', 'src/x86/sysv.S', 'src/x86/win32.S'],
 +    'X86_FREEBSD': ['src/x86/ffi.c', 'src/x86/freebsd.S'],
 +    'X86_WIN32': ['src/x86/ffi.c', 'src/x86/win32.S'],
 +    'SPARC': ['src/sparc/ffi.c', 'src/sparc/v8.S', 'src/sparc/v9.S'],
@@ -134,9 +132,10 @@
 +    'IA64': ['src/ia64/ffi.c', 'src/ia64/unix.S'],
 +    'M32R': ['src/m32r/sysv.S', 'src/m32r/ffi.c'],
 +    'M68K': ['src/m68k/ffi.c', 'src/m68k/sysv.S'],
-+    'POWERPC': ['src/powerpc/ffi.c', 'src/powerpc/sysv.S', 'src/powerpc/ppc_closure.S', 'src/powerpc/linux64.S', 'src/powerpc/linux64_closure.S'],
++    'POWERPC': ['src/powerpc/ffi.c', 'src/powerpc/ffi_sysv.c', 'src/powerpc/ffi_linux64.c', 'src/powerpc/sysv.S', 'src/powerpc/ppc_closure.S', 'src/powerpc/linux64.S', 'src/powerpc/linux64_closure.S'],
 +    'POWERPC_AIX': ['src/powerpc/ffi_darwin.c', 'src/powerpc/aix.S', 'src/powerpc/aix_closure.S'],
 +    'POWERPC_FREEBSD': ['src/powerpc/ffi.c', 'src/powerpc/sysv.S', 'src/powerpc/ppc_closure.S'],
++    'AARCH64': ['src/aarch64/sysv.S', 'src/aarch64/ffi.c'],
 +    'ARM': ['src/arm/sysv.S', 'src/arm/ffi.c'],
 +    'LIBFFI_CRIS': ['src/cris/sysv.S', 'src/cris/ffi.c'],
 +    'FRV': ['src/frv/eabi.S', 'src/frv/ffi.c'],
@@ -152,9 +151,9 @@
 +ffi_sources += ffi_platforms['@TARGET@']
 +
 +ffi_cflags = '@CFLAGS@'
-diff -urN libffi-3.0.11/src/dlmalloc.c libffi/src/dlmalloc.c
---- libffi-3.0.11/src/dlmalloc.c	2012-04-12 04:46:06.000000000 +0200
-+++ libffi/src/dlmalloc.c	2012-06-26 15:15:58.949547461 +0200
+diff -urN libffi-3.1/src/dlmalloc.c libffi/src/dlmalloc.c
+--- libffi-3.1/src/dlmalloc.c	2014-04-25 19:45:13.000000000 +0200
++++ libffi/src/dlmalloc.c	2014-08-09 21:51:07.881871443 +0200
 @@ -457,6 +457,11 @@
  #define LACKS_ERRNO_H
  #define MALLOC_FAILURE_ACTION
@@ -167,3 +166,44 @@
  #endif  /* WIN32 */
  
  #ifdef __OS2__
+@@ -4497,7 +4502,7 @@
+     char* tbase = (char*)(CALL_MMAP(tsize));
+     if (tbase != CMFAIL) {
+       m = init_user_mstate(tbase, tsize);
+-      set_segment_flags(&m->seg, IS_MMAPPED_BIT);
++      (void)set_segment_flags(&m->seg, IS_MMAPPED_BIT);
+       set_lock(m, locked);
+     }
+   }
+@@ -4512,7 +4517,7 @@
+   if (capacity > msize + TOP_FOOT_SIZE &&
+       capacity < (size_t) -(msize + TOP_FOOT_SIZE + mparams.page_size)) {
+     m = init_user_mstate((char*)base, capacity);
+-    set_segment_flags(&m->seg, EXTERN_BIT);
++    (void)set_segment_flags(&m->seg, EXTERN_BIT);
+     set_lock(m, locked);
+   }
+   return (mspace)m;
+diff -urN libffi-3.1/src/arm/ffi.c libffi/src/arm/ffi.c
+--- libffi-3.1/src/arm/ffi.c	Sat Aug 09 23:52:34 2014 +0200
++++ libffi/src/arm/ffi.c	Sat Aug 09 23:58:38 2014 +0200
+@@ -154,9 +154,6 @@
+ 
+ int ffi_prep_args_VFP(char *stack, extended_cif *ecif, float *vfp_space)
+ {
+-  // make sure we are using FFI_VFP
+-  FFI_ASSERT(ecif->cif->abi == FFI_VFP);
+-
+   register unsigned int i, vi = 0;
+   register void **p_argv;
+   register char *argp, *regp, *eo_regp;
+@@ -165,6 +162,9 @@
+   char done_with_regs = 0;
+   char is_vfp_type;
+ 
++  // make sure we are using FFI_VFP
++  FFI_ASSERT(ecif->cif->abi == FFI_VFP);
++
+   /* the first 4 words on the stack are used for values passed in core
+    * registers. */
+   regp = stack;
diff --git a/Modules/_ctypes/libffi/.gitignore b/Modules/_ctypes/libffi/.gitignore
deleted file mode 100644
index 6af76ac..0000000
--- a/Modules/_ctypes/libffi/.gitignore
+++ /dev/null
@@ -1,21 +0,0 @@
-.libs
-.deps
-*.o
-*.lo
-.dirstamp
-*.la
-Makefile
-config.log
-config.status
-*~
-fficonfig.h
-include/ffi.h
-include/ffitarget.h
-libffi.pc
-libtool
-stamp-h1
-libffi*gz
-autom4te.cache
-libffi.xcodeproj/xcuserdata
-libffi.xcodeproj/project.xcworkspace
-ios/
diff --git a/Modules/_ctypes/libffi/.travis.yml b/Modules/_ctypes/libffi/.travis.yml
deleted file mode 100644
index 1a6a425..0000000
--- a/Modules/_ctypes/libffi/.travis.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-language: c
-compiler:
-  - gcc
-  - clang
-
-before_script: sudo apt-get install dejagnu
-
-script: ./configure && make && make check
diff --git a/Modules/_ctypes/libffi/ChangeLog b/Modules/_ctypes/libffi/ChangeLog
index e0b057c..c85cbe6 100644
--- a/Modules/_ctypes/libffi/ChangeLog
+++ b/Modules/_ctypes/libffi/ChangeLog
@@ -1,5509 +1,5105 @@
-2013-03-17  Anthony Green  <green@moxielogic.com>
+commit 0403f332b1f478696c30d3d8a0e2f6eef24aaf88
+Author: Anthony Green <green@moxielogic.com>
+Date:   Mon May 19 09:41:32 2014 -0400
 
-	* README: Update for 3.0.13.
-	* configure.ac: Ditto.
-	* configure: Rebuilt.
-	* doc/*: Update version.
+    Update date. Annoucing 3.1 today.
 
-2013-03-17  Dave Korn  <dave.korn.cygwin@gmail.com>
+commit 94ac0c168ee7b115409121d88b25a4979446c8da
+Author: Anthony Green <green@moxielogic.com>
+Date:   Mon May 19 09:37:21 2014 -0400
 
-	* src/closures.c (is_emutramp_enabled
-	[!FFI_MMAP_EXEC_EMUTRAMP_PAX]): Move default definition outside
-	enclosing #if scope.
+    Increment libtool library revision number
 
-2013-03-17  Anthony Green  <green@moxielogic.com>
+commit 57465744b6e1295d7202de5a7734df589518f1c8
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sun May 11 10:30:22 2014 -0400
 
-	* configure.ac: Only modify toolexecdir in certain cases.
-	* configure: Rebuilt.
+    Update to version 3.1
 
-2013-03-16  Gilles Talis  <gilles.talis@gmail.com>
+commit 0c2251a42df5108b6d9ebe5fe1cf83d0bcdf660e
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sun May 11 10:22:30 2014 -0400
 
-	* src/powerpc/ffi.c (ffi_prep_args_SYSV): Don't use
-	fparg_count,etc on __NO_FPRS__ targets.
+    Support versions of git older than 1.8.5
 
-2013-03-16  Alan Hourihane  <alanh@fairlite.co.uk>
+commit 70c303cb88e23aaee91c87c56b108c50ab4f3c2f
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sun May 11 09:56:40 2014 -0400
 
-	* src/m68k/sysv.S (epilogue): Don't use extb instruction on
-	m680000 machines.
+    Fix testsuite for GCC 4.9.0
 
-2013-03-16  Alex Gaynor <alex.gaynor@gmail.com>
+commit 52b3457093ed19b2a7c5fcf243c4014c90ce6225
+Author: Magnus Granberg <zorry@gentoo.org>
+Date:   Sun May 11 09:55:28 2014 -0400
 
-	* src/x86/ffi.c (ffi_prep_cif_machdep): Always align stack.
+    Check /proc/self/status for PaX status.
 
-2013-03-13  Markos Chandras <markos.chandras@imgtec.com>
+commit 7ba4c5d72aa440a4b21fb57e999e67c5957761da
+Author: Dominik Vogt <dominik.vogt@gmx.de>
+Date:   Sun May 11 09:52:47 2014 -0400
 
-	* configure.ac: Add support for Imagination Technologies Meta.
-	* Makefile.am: Likewise.
-	* README: Add Imagination Technologies Meta details.
-	* src/metag/ffi.c: New.
-	* src/metag/ffitarget.h: Likewise.
-	* src/metag/sysv.S: Likewise.
+    Use to get correct dir
 
-2013-02-24  Andreas Schwab  <schwab@linux-m68k.org>
+commit 31e0d4ecff6dc2a6c75a066ee099b52a43f6ba27
+Merge: 1c0e9a7 99909eb
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Apr 23 19:24:47 2014 -0400
 
-	* doc/libffi.texi (Structures): Fix missing category argument of
-	@deftp.
+    Merge pull request #119 from joshtriplett/fastcall-fastball
+    
+    src/x86/win32.S: Define ffi_closure_FASTCALL in the MASM section, too
 
-2013-02-11  Anthony Green <green@moxielogic.com>
+commit 99909eb6184b62408d88b6b4e7ab38e84e6d0bf3
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Tue Apr 22 21:17:52 2014 -0700
 
-	* configure.ac: Update release number to 3.0.12.
-	* configure: Rebuilt.
-	* README: Update release info.
+    src/x86/win32.S: Define ffi_closure_FASTCALL in the MASM section, too
 
-2013-02-10  Anthony Green <green@moxielogic.com>
+commit 1c0e9a7297ced15413c2d2d5d35f6c650c4b46c9
+Merge: 93a24f2 d369522
+Author: Anthony Green <green@moxielogic.com>
+Date:   Mon Apr 21 12:41:56 2014 -0400
 
-	* README: Add Moxie.
-	* src/moxie/ffi.c: Created.
-	* src/moxie/eabi.S: Created.
-	* src/moxie/ffitarget.h: Created.
-	* Makefile.am (nodist_libffi_la_SOURCES): Add Moxie.
-	* Makefile.in: Rebuilt.
-	* configure.ac: Add Moxie.
-	* configure: Rebuilt.
-	* testsuite/libffi.call/huge_struct.c: Disable format string
-	warnings for moxie*-*-elf tests.
+    Merge pull request #101 from joshtriplett/fastcall-closures
+    
+    Support closures for fastcall
 
-2013-02-10  Anthony Green <green@moxielogic.com>
+commit d36952273d4fafbda91ecc205fc0824f7cc65e70
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Sun Apr 20 12:03:25 2014 -0700
 
-	* Makefile.am (LTLDFLAGS): Fix reference.
-	* Makefile.in: Rebuilt.
+    Support fastcall closures
+    
+    libffi on 32-bit x86 now supports closures for all supported ABIs.
+    Thus, rewrite the last remaining duplicated-by-ABI test (closure_stdcall
+    and closure_thiscall) to use the generic ABI_NUM/ABI_ATTR mechanism.
 
-2013-02-10  Anthony Green <green@moxielogic.com>
+commit 93a24f216bcdd1018b976d697179c6d49004015a
+Merge: dd11a04 2349fec
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Apr 12 19:38:07 2014 -0400
 
-	* README: Update supported platforms.  Update test results link.
+    Merge pull request #80 from ueno/devel
+    
+    Fix typo in doc
 
-2013-02-09  Anthony Green <green@moxielogic.com>
+commit dd11a04061cb49ce1d702545693c24eb1267d648
+Merge: 8fa2812 03ca880
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Apr 12 19:37:21 2014 -0400
 
-	* testsuite/libffi.call/negint.c: Remove forced -O2.
-	* testsuite/libffi.call/many2.c (foo): Remove GCCism.
-	* testsuite/libffi.call/ffitest.h: Add default PRIuPTR definition.
+    Merge pull request #86 from joshtriplett/testsuite-CC-CXX
+    
+    testsuite ignores CC parameter supplied to configure or make
 
-	* src/sparc/v8.S (ffi_closure_v8): Import ancient ulonglong
-	closure return type fix developed by Martin v. Löwis for cpython
-	fork.
+commit 8fa2812355e685a42abf9a62fbc674d616b2edee
+Merge: 8a58e6b 419503f
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Apr 12 19:32:08 2014 -0400
 
-2013-02-08  Andreas Tobler  <andreast@fgznet.ch>
+    Merge pull request #116 from frida/fix/darwin-aarch64-variadic
+    
+    Fix handling of variadic calls on Darwin/AArch64
 
-	* src/powerpc/ffi.c (ffi_prep_cif_machdep): Fix small struct
-	support.
-	* src/powerpc/sysv.S: Ditto.
+commit 8a58e6b7805b736def197b8baf8e465a2a3f6913
+Merge: 30b77c5 a539f7f
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Apr 12 19:30:18 2014 -0400
 
-2013-02-08  Anthony Green <green@moxielogic.com>
+    Merge pull request #115 from frida/fix/darwin-aarch64-alignment
+    
+    Fix alignment of AArch64 assembler functions
 
-	* testsuite/libffi.call/cls_longdouble.c: Remove xfail for
-	arm*-*-*.
+commit 30b77c56f95c63ecd83399aafdbad7b07330f2fd
+Merge: dc33cb3 3e2b84d
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Apr 12 19:29:13 2014 -0400
 
-2013-02-08  Anthony Green <green@moxielogic.com>
+    Merge pull request #117 from frida/fix/windows-regression
+    
+    Fix Windows regression
 
-	* src/sparc/ffi.c (ffi_prep_closure_loc): Fix cache flushing for GCC.
+commit 3e2b84d295531720917bf46afc532fc6d877e3ec
+Author: Ole André Vadla Ravnås <ole.andre.ravnas@tillitech.com>
+Date:   Sat Apr 12 01:04:04 2014 +0200
 
-2013-02-08  Matthias Klose  <doko@ubuntu.com>
+    Fix Windows regression
+    
+    Introduced by b5fed601948237037513a9b7f967c8fc6c9ff1f6.
 
-	* man/ffi_prep_cif.3: Clean up for debian linter.
+commit 419503f409c321fe31ff59d963ef34bb913420d0
+Author: Ole André Vadla Ravnås <ole.andre.ravnas@tillitech.com>
+Date:   Sun Apr 6 20:54:13 2014 +0200
 
-2013-02-08  Peter Bergner  <bergner@vnet.ibm.com>
+    Fix handling of variadic calls on Darwin/AArch64
 
-	* src/powerpc/ffi.c (ffi_prep_args_SYSV): Account for FP args pushed
-	on the stack.
+commit a539f7ffd6783aa11353d13265520e453c565fb4
+Author: Ole André Vadla Ravnås <ole.andre.ravnas@tillitech.com>
+Date:   Sun Apr 6 20:53:02 2014 +0200
 
-2013-02-08  Anthony Green <green@moxielogic.com>
+    Fix alignment of AArch64 assembler functions
 
-	* Makefile.am (EXTRA_DIST): Add missing files.
-	* testsuite/Makefile.am (EXTRA_DIST): Ditto.
-	* Makefile.in: Rebuilt.
+commit dc33cb3c998da521a960385c1269c3aef552f69f
+Merge: c860a99 b5fed60
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Apr 5 23:41:22 2014 -0400
 
-2013-02-08  Anthony Green <green@moxielogic.com>
+    Merge pull request #114 from joshtriplett/bounce-on-a-tiny-trampoline
+    
+    Fix ABI on 32-bit non-Windows x86: go back to trampoline size 10
 
-	* configure.ac: Move sparc asm config checks to within functions
-	for compatibility with sun tools.
-	* configure: Rebuilt.
-	* src/sparc/ffi.c (ffi_prep_closure_loc): Flush cache on v9
-	systems.
-	* src/sparc/v8.S (ffi_flush_icache): Implement a sparc v9 cache
-	flusher.
+commit b5fed601948237037513a9b7f967c8fc6c9ff1f6
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Sat Apr 5 17:33:42 2014 -0700
 
-2013-02-08  Nathan Rossi <nathan.rossi@xilinx.com>
+    Fix ABI on 32-bit non-Windows x86: go back to trampoline size 10
+    
+    The trampoline size is part of the ABI, so it cannot change.  Move the
+    logic from the stdcall and thiscall trampolines to the functions they
+    call, to reduce them both to 10 bytes.
+    
+    This drops the previously added support for raw THISCALL closures on
+    non-Windows.  (Non-raw THISCALL closures still work.)
 
-	* src/microblaze/ffi.c (ffi_closure_call_SYSV): Fix handling of
-	small big-endian structures.
-	(ffi_prep_args): Ditto.
+commit 03ca880081b22efab09ba72268270f83017d3d7b
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Thu Mar 27 08:44:34 2014 -0700
 
-2013-02-07  Anthony Green <green@moxielogic.com>
+    README: Note the testsuite changes to respect $CC and $CXX
 
-	* src/sparc/v8.S (ffi_call_v8): Fix typo from last patch
-	(effectively hiding ffi_call_v8).
+commit d74df8c5d8c6722ecb908da98c86cc8e2c755b84
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Thu Mar 27 00:44:12 2014 -0700
 
-2013-02-07  Anthony Green <green@moxielogic.com>
+    README: Update Windows example to set both CC and CXX
 
-	* configure.ac: Update bug reporting address.
-	* configure.in: Rebuild.
+commit 7d698125b1f05173f3656a89755a2eb58813b002
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Wed Mar 26 23:17:56 2014 -0700
 
-	* src/sparc/v8.S (ffi_flush_icache): Out-of-line cache flusher for
-	Sun compiler.
-	* src/sparc/ffi.c (ffi_call): Remove warning.
-	Call ffi_flush_icache for non-GCC builds.
-	(ffi_prep_closure_loc): Use ffi_flush_icache.
+    Use the proper C++ compiler to run C++ tests
+    
+    Running the C compiler with -shared-libgcc -lstdc++ does not work on
+    non-GCC compilers.
 
-	* Makefile.am (EXTRA_DIST): Add libtool-ldflags.
-	* Makefile.in: Rebuilt.
-	* libtool-ldflags: New file.
+commit fa5e88f170cb37c7b2b9bb015c8c5b854ffd8a3e
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Wed Mar 26 23:53:57 2014 -0700
 
-2013-02-07  Daniel Schepler <dschepler@gmail.com>
+    .travis.yml: Make the build command more readable by splitting at &&
+    
+    "script" can contain multiple commands to run in sequence.
 
-	* configure.ac: Correctly identify x32 systems as 64-bit.
-	* m4/libtool.m4: Remove libtool expr error.
-	* aclocal.m4, configure: Rebuilt.
+commit 0c3824702d3d59d37f8c177d646303f546187683
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Wed Mar 26 14:51:32 2014 -0700
 
-2013-02-07  Anthony Green <green@moxielogic.com>
+    Always set CC_FOR_TARGET for dejagnu, to make the testsuite respect $CC
+    
+    This fixes cross-compilation and compilation with CC="gcc -m32".
 
-	* configure.ac: Fix GCC usage test.
-	* configure: Rebuilt.
-	* README: Mention LLVM/GCC x86_64 issue.
-	* testsuite/Makefile.in: Rebuilt.
+commit 9946a92af31b30cb7760150d1f8ca6c11b01aeea
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Wed Mar 26 20:18:58 2014 -0700
 
-2013-02-07  Anthony Green <green@moxielogic.com>
+    Stop looking for expect and runtest above top_builddir
+    
+    Users wishing to test hand-compiled versions of expect and runtest can
+    easily enough put them in their path or set EXPECT and RUNTEST
+    themselves.
 
-	* testsuite/libffi.call/cls_double_va.c (main): Replace // style
-	comments with /* */ for xlc compiler.
-	* testsuite/libffi.call/stret_large.c (main): Ditto.
-	* testsuite/libffi.call/stret_large2.c (main): Ditto.
-	* testsuite/libffi.call/nested_struct1.c (main): Ditto.
-	* testsuite/libffi.call/huge_struct.c (main): Ditto.
-	* testsuite/libffi.call/float_va.c (main): Ditto.
-	* testsuite/libffi.call/cls_struct_va1.c (main): Ditto.
-	* testsuite/libffi.call/cls_pointer_stack.c (main): Ditto.
-	* testsuite/libffi.call/cls_pointer.c (main): Ditto.
-	* testsuite/libffi.call/cls_longdouble_va.c (main): Ditto.
+commit acb202325215058639234efb7af1f04c1c8a1f44
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Wed Mar 26 20:18:41 2014 -0700
 
-2013-02-06  Anthony Green <green@moxielogic.com>
+    Stop setting an empty AM_RUNTESTFLAGS
 
-	* man/ffi_prep_cif.3: Clean up for debian lintian checker.
+commit c860a992fef5d7cd7bb0975b1632d17a9fafe007
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Mar 25 17:02:51 2014 -0400
 
-2013-02-06  Anthony Green <green@moxielogic.com>
+    Upgrade version to 3.1-rc1
 
-	* Makefile.am (pkgconfigdir): Add missing pkgconfig install bits.
-	* Makefile.in: Rebuild.
+commit 9837073e6203048a162a226798c5d252600219ed
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Mar 25 16:24:14 2014 -0400
 
-2013-02-02  Mark H Weaver <mhw@netris.org>
+    Update copyright date and clean up README notes.
 
-	* src/x86/ffi64.c (ffi_call): Sign-extend integer arguments passed
-	via general purpose registers.
+commit 18d3baa9f597b026675baa1b4e5a5eeef7577a08
+Merge: afee537 f0c8a31
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Mar 25 16:12:53 2014 -0400
 
-2013-01-21  Nathan Rossi <nathan.rossi@xilinx.com>
+    Merge pull request #108 from joshtriplett/freebsd
+    
+    [3.1 blocker] Fix FreeBSD support
 
-	* README: Add MicroBlaze details.
-	* Makefile.am: Add MicroBlaze support.
-	* configure.ac: Likewise.
-	* src/microblaze/ffi.c: New.
-	* src/microblaze/ffitarget.h: Likewise.
-	* src/microblaze/sysv.S: Likewise.
+commit afee53738a995e23bd2f89fd0f7b30b380566106
+Merge: 7d24785 b2d610e
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Mar 25 16:12:35 2014 -0400
 
-2013-01-21  Nathan Rossi <nathan.rossi@xilinx.com>
-	* testsuite/libffi.call/return_uc.c: Fixed issue.
+    Merge pull request #106 from joshtriplett/darwin-award
+    
+    [3.1 blocker] Update OS X build system to include win32.S on 32-bit
 
-2013-01-21  Chris Zankel   <chris@zankel.net>
+commit 7d2478568ed9f03cbf57627f449a2d2cf4d1571c
+Merge: beab5f3 56be47f
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Mar 25 16:12:17 2014 -0400
 
-	* README: Add Xtensa support.
-	* Makefile.am: Likewise.
-	* configure.ac: Likewise.
-	* Makefile.in Regenerate.
-	* configure: Likewise.
-	* src/prep_cif.c: Handle Xtensa.
-	* src/xtensa: New directory.
-	* src/xtensa/ffi.c: New file.
-	* src/xtensa/ffitarget.h: Ditto.
-	* src/xtensa/sysv.S: Ditto.
+    Merge pull request #110 from joshtriplett/w64
+    
+    Fix 64-bit Windows support
 
-2013-01-11  Anthony Green  <green@moxielogic.com>
+commit beab5f334d9ec5b8b91d1cc727d1029b40358e7e
+Merge: 28fb197 ef5890e
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Mar 25 16:07:47 2014 -0400
 
-	* src/powerpc/ffi_darwin.c (ffi_prep_args): Replace // style
-	comments with /* */ for xlc compiler.
-	* src/powerpc/aix.S (ffi_call_AIX): Ditto.
-	* testsuite/libffi.call/ffitest.h (allocate_mmap): Delete
-	deprecated inline function.
-	* testsuite/libffi.special/ffitestcxx.h: Ditto.
-	* README: Add update for AIX support.
+    Merge pull request #105 from joshtriplett/win32-relocations
+    
+    [3.1 blocker] win32.S needs to handle relocations/GOT
 
-2013-01-11  Anthony Green  <green@moxielogic.com>
+commit f0c8a31577172104049283f0a80c723084a5bd77
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Mon Mar 24 22:14:26 2014 -0700
 
-	* configure.ac: Robustify pc relative reloc check.
-	* m4/ax_cc_maxopt.m4: Don't -malign-double.  This is an ABI
-	changing option for 32-bit x86.
-	* aclocal.m4, configure: Rebuilt.
-	* README: Update supported target list.
+    Compile win32.S on FreeBSD
 
-2013-01-10  Anthony Green  <green@moxielogic.com>
+commit b2d610e028b5ce48d1ad7e5d0debc9c321d891b2
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Fri Mar 21 11:10:13 2014 -0700
 
-	* README (tested): Add Compiler column to table.
+    Compile win32.S on 32-bit Darwin as well
 
-2013-01-10  Anthony Green  <green@moxielogic.com>
+commit be50b87a490e794362cb4a27ada2fbaab202adb8
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Mon Mar 24 21:44:13 2014 -0700
 
-	* src/x86/ffi64.c (struct register_args): Make sse array and array
-	of unions for sunpro compiler compatibility.
+    Always use configure to detect whether global symbols need underscores
+    
+    64-bit Windows already used this check; make it universal, and use it in
+    place of an ifdef on X86_WIN32, to handle non-Windows platforms that use
+    the underscore, such as Darwin.
 
-2013-01-10  Anthony Green  <green@moxielogic.com>
+commit 56be47f87629e31afbcb0774aa65735f539ee972
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Mon Mar 24 21:24:53 2014 -0700
 
-	* configure.ac: Test target platform size_t size.  Handle both 32
-	and 64-bit builds for x86_64-* and i?86-* targets (allowing for
-	CFLAG option to change default settings).
-	* configure, aclocal.m4: Rebuilt.
+    Fix a warning on 64-bit Windows
+    
+    When sizeof(size_t) != sizeof(unsigned), adding a size_t to cif->bytes
+    produces a "possible loss of data" warning.  However, the size_t in
+    question refers to the size of a single parameter.  Use a cast to avoid
+    the warning.
 
-2013-01-10  Anthony Green  <green@moxielogic.com>
+commit 48a8eda74aad8a21b6f26df5df08fe64c043d208
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Mon Mar 24 21:21:12 2014 -0700
 
-	* testsuite/libffi.special/special.exp: Only run exception
-	handling tests when using GNU compiler.
+    Avoid referencing undefined ABIs on 64-bit Windows builds
+    
+    64-bit Windows does not have FFI_STDCALL, FFI_THISCALL, or FFI_FASTCALL.
 
-	* m4/ax_compiler_vendor.m4: New file.
-	* configure.ac: Test for compiler vendor and don't use
-	AX_CFLAGS_WARN_ALL with the sun compiler.
-	* aclocal.m4, configure: Rebuilt.
+commit f0f4138f90345d7d67dfa6783a7e1c7cc30d3c6f
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Sat Mar 22 10:00:53 2014 -0700
 
-2013-01-10  Anthony Green  <green@moxielogic.com>
+    win32.S: Add handling for position-independent code on Darwin
+    
+    Newer versions of Darwin generate the necessary stub functions
+    automatically and just need a call instruction, but accomodating older
+    versions as well requires adding the stub.
 
-	* include/ffi_common.h: Don't use GCCisms to define types when
-	building with the SUNPRO compiler.
+commit ef5890ebafb7cd2fbf9acf161edb55fe1382871c
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Fri Mar 21 11:01:39 2014 -0700
 
-2013-01-10  Anthony Green  <green@moxielogic.com>
+    win32.S: Use shifting for multiplication rather than repeated addition
+    
+    The jump table code added a register to itself twice to multiply by 4;
+    shift the register left by 2 instead.
 
-	* configure.ac: Put local.exp in the right place.
-	* configure: Rebuilt.
+commit 4fca48901e7e4f53bf490ed22607b2d2d8f4bfcc
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Fri Mar 21 11:00:41 2014 -0700
 
-	* src/x86/ffi.c: Update comment about regparm function attributes.
-	* src/x86/sysv.S (ffi_closure_SYSV): The SUNPRO compiler requires
-	that all function arguments be passed on the stack (no regparm
-	support).
+    win32.S: Make the jump tables position-independent
+    
+    Now that non-Windows platforms include win32.S, it needs to support
+    building as position-independent code.  This fixes build failures on
+    target platforms that do not allow text relocations.
 
-2013-01-08  Anthony Green  <green@moxielogic.com>
+commit 2087dcf736274286f76c69d3988fb6d7cc4fd0f5
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Fri Mar 21 10:57:06 2014 -0700
 
-	* configure.ac: Generate local.exp.  This sets CC_FOR_TARGET
-	when we are using the vendor compiler.
-	* testsuite/Makefile.am (EXTRA_DEJAGNU_SITE_CONFIG): Point to
-	../local.exp.
-	* configure, testsuite/Makefile.in: Rebuilt.
+    win32.S: Make calls to ffi_closure_SYSV_inner position-independent
+    
+    Now that non-Windows platforms include win32.S, it needs to support
+    building as position-independent code.  This fixes one source of build
+    failures on target platforms that do not allow text relocations.
 
-	* testsuite/libffi.call/call.exp: Run tests with different
-	options, depending on whether or not we are using gcc or the
-	vendor compiler.
-	* testsuite/lib/libffi.exp (libffi-init): Set using_gcc based on
-	whether or not we are building/testing with gcc.
+commit 28fb197079cf1d11da4eef7c8c243ab05590c528
+Merge: c697472 c3dd0a1
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Mar 18 12:19:36 2014 -0400
 
-2013-01-08  Anthony Green  <green@moxielogic.com>
+    Merge pull request #107 from rvandermeulen/msvcc
+    
+    Various compatibility fixes and improvements to msvcc.sh.
 
-	* configure.ac: Switch x86 solaris target to X86 by default.
-	* configure: Rebuilt.
+commit c3dd0a1a0245fc174361a70876e88ae24285f861
+Author: Ryan VanderMeulen <ryanvm@gmail.com>
+Date:   Tue Mar 18 12:09:45 2014 -0400
 
-2013-01-08  Anthony Green  <green@moxielogic.com>
+    Various compatibility fixes and improvements to msvcc.sh.
+    
+    * Don't try to mix incompatible optimization flags in debug builds.
+    * Workaround ax_cc_maxopt.m4 not supporting MSVC and change -O3 to -O2.
+    * Fix MSVC warning by properly passing linker flags to compiler.
+    * Make msvcc.sh return 1 if invalid command line options are used rather than silently eating them.
+    * Add more comments.
 
-	* configure.ac: Fix test for read-only eh_frame.
-	* configure: Rebuilt.
+commit c697472fccfbb5b87b007c053cda9ef014b346b9
+Merge: 83fd2bc e48918e
+Author: Anthony Green <green@moxielogic.com>
+Date:   Mon Mar 17 00:32:42 2014 -0400
 
-2013-01-08  Anthony Green  <green@moxielogic.com>
+    Merge pull request #102 from joshtriplett/test-generic
+    
+    Add ABIs to the test matrix; unify many bits of the testsuite
 
-	* src/x86/sysv.S, src/x86/unix64.S: Only emit DWARF unwind info
-	when building with the GNU toolchain.
-	* testsuite/libffi.call/ffitest.h (CHECK): Fix for Solaris vendor
-	compiler.
+commit e48918ecf876bc85d040fc50a232059c566553a8
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Sun Mar 16 20:29:27 2014 -0700
 
-2013-01-07  Thorsten Glaser <tg@mirbsd.org>
+    testsuite: Add ABIs to the test matrix; unify tests across ABIs
+    
+    This eliminates all the *_win32.c tests in favor of the tests they were
+    branched from, and expands test coverage to run many more tests on
+    stdcall, thiscall, and fastcall.
+    
+    This same mechanism also supports testing any other target that has
+    multiple ABIs.
 
-	* testsuite/libffi.call/cls_uchar_va.c,
-	testsuite/libffi.call/cls_ushort_va.c,
-	testsuite/libffi.call/va_1.c: Testsuite fixes.
+commit 4d4d368e5a55d9443c4c53b1b70d58ab6d8c941c
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Sun Mar 16 17:02:05 2014 -0700
 
-2013-01-07  Thorsten Glaser <tg@mirbsd.org>
+    testsuite: Replace ffitestcxx.h with ffitest.h
+    
+    ffitest.h contains a superset of the functionality of ffitestcxx.h;
+    make the C++ tests include ffitest.h instead, and remove ffitestcxx.h.
 
-	* src/m68k/ffi.c (CIF_FLAGS_SINT8, CIF_FLAGS_SINT16): Define.
-	(ffi_prep_cif_machdep): Fix 8-bit and 16-bit signed calls.
-	* src/m68k/sysv.S (ffi_call_SYSV, ffi_closure_SYSV): Ditto.
+commit 3f97cf3413c46caf2a79f32ac9cda4620972c2d7
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Sun Mar 16 16:53:42 2014 -0700
 
-2013-01-04  Anthony Green  <green@moxielogic.com>
+    testsuite: Unify the C and C++ testsuites
+    
+    These two testsuites differ only in the source file glob and a couple of
+    additional compiler options; unify the remaining bits.
 
-	* Makefile.am (AM_CFLAGS): Don't automatically add -fexceptions
-	and -Wall.  This is set in the configure script after testing for
-	GCC.
-	* Makefile.in: Rebuilt.
+commit 0d9cce8edb937bbe771a6cdd25f671edf06d2128
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Sun Mar 16 16:22:58 2014 -0700
 
-2013-01-02  rofl0r <https://github.com/rofl0r>
+    testsuite: ffitest.h: Parenthesize the CHECK macro
 
-	* src/powerpc/ffi.c (ffi_prep_cif_machdep): Fix build error on ppc
-	when long double == double.
+commit 5695ec1444c5323e48fe4314f8c8f027625e67df
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Sun Mar 16 16:04:58 2014 -0700
 
-2013-01-02  Reini Urban  <rurban@x-ray.at>
+    testsuite: Factor out a function to run a matrix of tests
+    
+    This commons up code from libffi.call/call.exp and
+    libffi.special/special.exp, unifies the optimization option matrix
+    between the two, and makes it easier to add more axes to the matrix
+    in the future.
 
-	* Makefile.am (libffi_la_LDFLAGS): Add -no-undefined to LDFLAGS
-	(required for shared libs on cygwin/mingw).
-	* Makefile.in: Rebuilt.
+commit dfdb02cc869855d3b68571e5f7aa77ae8c9d254a
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Sun Mar 16 15:26:26 2014 -0700
 
-2012-10-31  Alan Modra  <amodra@gmail.com>
+    testsuite: Introduce a __THISCALL__ compiler-specific macro
 
-	* src/powerpc/linux64_closure.S: Add new ABI support.
-	* src/powerpc/linux64.S: Likewise.
+commit 83fd2bce0456224483435d4b764063f4513fd464
+Merge: 3658a07 06ff924
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sun Mar 16 22:03:29 2014 -0400
 
-2012-10-30  Magnus Granberg  <zorry@gentoo.org>
-	    Pavel Labushev  <pavel.labushev@runbox.ru>
+    Merge pull request #99 from joshtriplett/gitignore
+    
+    .gitignore: Ignore more generated files
 
-	* configure.ac: New options pax_emutramp
-	* configure, fficonfig.h.in: Regenerated
-	* src/closures.c: New function emutramp_enabled_check() and
-	checks.
+commit 3658a0700a50d37a2fdba04fd9d79ad2f706d9f5
+Merge: d948d0a 46c5d3c
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sun Mar 16 21:37:42 2014 -0400
 
-2012-10-30  Frederick Cheung  <frederick.cheung@gmail.com>
+    Merge pull request #100 from rvandermeulen/bug-756740
+    
+    Change double quotes in Makefile.am to single quotes.
 
-	* configure.ac: Enable FFI_MAP_EXEC_WRIT for Darwin 12 (mountain
-	lion) and future version.
-	* configure: Rebuild.
+commit 46c5d3c30fdc2b43c076ad955078d7c5f1e75b37
+Author: Ryan VanderMeulen <ryanvm@gmail.com>
+Date:   Sun Mar 16 21:16:08 2014 -0400
 
-2012-10-30  James Greenhalgh  <james.greenhalgh at arm.com>
-            Marcus Shawcroft  <marcus.shawcroft at arm.com>
+    Change double quotes in Makefile.am to single quotes.
+    
+    This was originally done in PR #84, except the change was made to Makefile.in instead of Makefile.am and was therefore reverted the next time the files were regenerated.
 
-        * README: Add details of aarch64 port.
-        * src/aarch64/ffi.c: New.
-        * src/aarch64/ffitarget.h: Likewise.
-        * src/aarch64/sysv.S: Likewise.
-	* Makefile.am: Support aarch64.
-	* configure.ac: Support aarch64.
-	* Makefile.in, configure: Rebuilt.
+commit 06ff924215a2f9739efa2c059dc595bc4ec1c851
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Sun Mar 16 16:19:46 2014 -0700
 
-2012-10-30  James Greenhalgh  <james.greenhalgh at arm.com>
-            Marcus Shawcroft  <marcus.shawcroft at arm.com>
+    .gitignore: Ignore more generated files
+    
+    The build process generates doc/libffi.info and fficonfig.h.in, so add
+    them to .gitignore.
 
-        * testsuite/lib/libffi.exp: Add support for aarch64.
-        * testsuite/libffi.call/cls_struct_va1.c: New.
-        * testsuite/libffi.call/cls_uchar_va.c: Likewise.
-        * testsuite/libffi.call/cls_uint_va.c: Likewise.
-        * testsuite/libffi.call/cls_ulong_va.c: Likewise.
-        * testsuite/libffi.call/cls_ushort_va.c: Likewise.
-        * testsuite/libffi.call/nested_struct11.c: Likewise.
-        * testsuite/libffi.call/uninitialized.c: Likewise.
-        * testsuite/libffi.call/va_1.c: Likewise.
-        * testsuite/libffi.call/va_struct1.c: Likewise.
-        * testsuite/libffi.call/va_struct2.c: Likewise.
-        * testsuite/libffi.call/va_struct3.c: Likewise.
+commit bad8948346e9b8813023a0cc78a3b6eb8d9c14c6
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Sun Mar 16 15:16:18 2014 -0700
 
-2012-10-12  Walter Lee  <walt@tilera.com>
+    testsuite: Introduce a __STDCALL__ compiler-specific macro
+    
+    Several tests want to use stdcall, which differs in syntax by compiler,
+    so introduce a macro for it in ffitest.h.
 
-        * Makefile.am: Add TILE-Gx/TILEPro support.
-        * configure.ac: Likewise.
-        * Makefile.in: Regenerate.
-        * configure: Likewise.
-        * src/prep_cif.c (ffi_prep_cif_core): Handle TILE-Gx/TILEPro.
-        * src/tile: New directory.
-        * src/tile/ffi.c: New file.
-        * src/tile/ffitarget.h: Ditto.
-        * src/tile/tile.S: Ditto.
+commit 98a793fa36a4ab3ba24d059cb80a2891cdb940e1
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Sun Mar 16 15:20:36 2014 -0700
 
-2012-10-12  Matthias Klose  <doko@ubuntu.com>
+    testsuite: Common up the ifdef blocks for compiler-specific macros
 
-	* generate-osx-source-and-headers.py: Normalize whitespace.
+commit d948d0a729c934b0224749338a3ba0a2c8f51c45
+Merge: b61b472 a86bd31
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sun Mar 16 10:53:48 2014 -0400
 
-2012-09-14  David Edelsohn  <dje.gcc@gmail.com>
+    Merge pull request #98 from joshtriplett/unconfigure.host
+    
+    Merge configure.host into configure.ac
 
-	* configure: Regenerated.
+commit a86bd318e2424d879d784ee7b29d6536d7a17c18
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Sun Mar 16 06:58:59 2014 -0700
 
-2012-08-26  Andrew Pinski  <apinski@cavium.com>
+    Merge configure.host into configure.ac
+    
+    configure.host only has a single entry, and shows no signs of needing
+    more added.
 
-	PR libffi/53014
-	* src/mips/ffi.c (ffi_prep_closure_loc): Allow n32 with soft-float and n64 with
-	soft-float.
+commit b61b472bd0647006d6685238721002017f1d119c
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sun Mar 16 09:45:55 2014 -0400
 
-2012-08-08  Uros Bizjak  <ubizjak@gmail.com>
+    Update version to 3.1-rc0.  Clean up README.
 
-	* src/s390/ffi.c (ffi_prep_closure_loc): Don't ASSERT ABI test,
-	just return FFI_BAD_ABI when things are wrong.
+commit 7a64e7dbba54e6e9f69954adfb943be1856ff928
+Merge: 11a5c5c eef2e02
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sun Mar 16 09:39:08 2014 -0400
 
-2012-07-18  H.J. Lu  <hongjiu.lu@intel.com>
+    Merge pull request #97 from joshtriplett/remove-more-generated-files
+    
+    Remove more generated files
 
-	PR libffi/53982
-	PR libffi/53973
-	* src/x86/ffitarget.h: Check __ILP32__ instead of __LP64__ for x32.
-	(FFI_SIZEOF_JAVA_RAW): Defined to 4 for x32.
+commit 11a5c5c39f5861011f6c5ddf795da3a32b5f0082
+Merge: 9a62a21 1c68c07
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sun Mar 16 09:38:47 2014 -0400
 
-2012-05-16  H.J. Lu  <hongjiu.lu@intel.com>
+    Merge pull request #96 from joshtriplett/sawing-changelogs
+    
+    Generate ChangeLog from git in make dist; remove it from version control
 
-	* configure: Regenerated.
+commit eef2e02a13d7d1c8145d47a64467f654406a3548
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Sun Mar 16 06:26:03 2014 -0700
 
-2012-05-05  Nicolas Lelong
+    doc: Remove autogenerated info file and stamp
 
-	* libffi.xcodeproj/project.pbxproj: Fixes.
-	* README: Update for iOS builds.
+commit 9fb403d3c5d9643e0f561cab6d4a07b1e54907ff
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Sun Mar 16 06:25:52 2014 -0700
 
-2012-04-23  Alexandre Keunecke I. de Mendonca <alexandre.keunecke@gmail.com>
+    fficonfig.h.in: Remove, configure generates it
 
-	* configure.ac: Add Blackfin/sysv support
-	* Makefile.am: Add Blackfin/sysv support
-	* src/bfin/ffi.c:  Add Blackfin/sysv support
-	* src/bfin/ffitarget.h: Add Blackfin/sysv support
+commit 1c68c07217fda78a779778c1480fedef7a58d5b4
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Sun Mar 16 06:11:58 2014 -0700
 
-2012-04-11  Anthony Green  <green@moxielogic.com>
+    Generate ChangeLog from git in make dist
+    
+    Archive the existing ChangeLog to ChangeLog.libffi-3.1
 
-	* Makefile.am (EXTRA_DIST): Add new script.
-	* Makefile.in: Rebuilt.
+commit c65ed55e655711e008282edbdd82ce95d008b4f6
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Sun Mar 16 05:52:00 2014 -0700
 
-2012-04-11  Zachary Waldowski  <zwaldowski@gmail.com>
+    ChangeLog.v1: Fix typo in explanatory header.
 
-	* generate-ios-source-and-headers.py,
-	libffi.xcodeproj/project.pbxproj: Support a Mac static library via
-	Xcode. Set iOS compatibility to 4.0.  Move iOS trampoline
-	generation into an Xcode "run script" phase.  Include both as
-	Xcode build scripts. Don't always regenerate config files.
+commit 9a62a21f5c3a8e1da463229f3170c8ab3031d920
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sun Mar 16 09:03:57 2014 -0400
 
-2012-04-10  Anthony Green  <green@moxielogic.com>
+    Add missing ChangeLog entry.  Clean up some entries.
 
-	* src/powerpc/ffi_darwin.c (ffi_prep_args): Add missing semicolon.
+commit 9bc704c58cb7a049d867837e3a11e2e31886ec66
+Merge: 694447a e892e58
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sun Mar 16 08:41:00 2014 -0400
 
-2012-04-06  Anthony Green  <green@moxielogic.com>
+    Merge pull request #95 from joshtriplett/news
+    
+    README: Update news for 3.0.14
 
-	* Makefile.am (EXTRA_DIST): Add new iOS/xcode files.
-	* Makefile.in: Rebuilt.
+commit e892e581d1838a06c18c7ecd50ebd79915cff92b
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Sun Mar 16 05:38:24 2014 -0700
 
-2012-04-06  Mike Lewis  <mikelikespie@gmail.com>
+    README: Update news for 3.0.14
 
-	* generate-ios-source-and-headers.py: New file.
-	* libffi.xcodeproj/project.pbxproj: New file.
-	* README: Update instructions on building iOS binary.
-	* build-ios.sh: Delete.
+commit 694447aa29deadd571efb4e9a26ee3f68ede1493
+Merge: fdc87f3 45a6c21
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sun Mar 16 08:32:05 2014 -0400
 
-2012-04-06  Anthony Green  <green@moxielogic.com>
+    Merge pull request #93 from joshtriplett/travis-dist
+    
+    Make Travis check "make dist"
 
-	* src/x86/ffi64.c (UINT128): Define differently for Intel and GNU
-	compilers, then use it.
+commit 45a6c21efa944b520842e631dc54919b04884744
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Sun Mar 16 05:29:08 2014 -0700
 
-2012-04-06  H.J. Lu  <hongjiu.lu@intel.com>
+    .travis.yml: Test "make dist" too.
 
-	* m4/libtool.m4 (_LT_ENABLE_LOCK): Support x32.
+commit fdc87f3b2ea37b58a4a9ae6c35083f544909fe3c
+Merge: 7412b83 e1911f7
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sun Mar 16 08:05:51 2014 -0400
 
-2012-04-06  Anthony Green  <green@moxielogic.com>
+    Merge pull request #85 from joshtriplett/stdcall
+    
+    stdcall support on Linux
 
-	* testsuite/Makefile.am (EXTRA_DIST): Add missing test cases.
-	* testsuite/Makefile.in: Rebuilt.
+commit e1911f78df113ca58738b66089a070d4cf747de7
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Sun Mar 16 03:25:53 2014 -0700
 
-2012-04-05  Zachary Waldowski  <zwaldowski@gmail.com>
+    Add support for stdcall, thiscall, and fastcall on non-Windows x86-32
+    
+    Linux supports the stdcall calling convention, either via functions
+    explicitly declared with the stdcall attribute, or via code compiled
+    with -mrtd which effectively makes stdcall the default.
+    
+    This introduces FFI_STDCALL, FFI_THISCALL, and FFI_FASTCALL on
+    non-Windows x86-32 platforms, as non-default calling conventions.
 
-	* include/ffi.h.in: Add missing trampoline table fields.
-	* src/arm/sysv.S: Fix ENTRY definition, and wrap symbol references
-	in CNAME.
-	* src/x86/ffi.c: Wrap Windows specific code in ifdefs.
+commit 7412b838d543aae4fa925862bd5702d3dacbc29a
+Merge: c0cc5fd 9531d05
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sun Mar 16 07:58:16 2014 -0400
 
-2012-04-02  Peter Bergner  <bergner@vnet.ibm.com>
+    Merge pull request #90 from joshtriplett/win32-unifdef
+    
+    prep_cif.c: Remove unnecessary ifdef for X86_WIN32
 
-	* src/powerpc/ffi.c (ffi_prep_args_SYSV): Declare double_tmp.
-	Silence casting pointer to integer of different size warning.
-	Delete goto to previously deleted label.
-	(ffi_call): Silence possibly undefined warning.
-	(ffi_closure_helper_SYSV): Declare variable type.
+commit c0cc5fdaa237b67e86f22d2f6e13f3b42d9aae33
+Merge: 98b5296 b3a5da0
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sun Mar 16 07:57:59 2014 -0400
 
-2012-04-02  Peter Rosin  <peda@lysator.liu.se>
+    Merge pull request #89 from joshtriplett/travis32
+    
+    .travis.yml: Test on both 32-bit and 64-bit
 
-	* src/x86/win32.S (ffi_call_win32): Sign/zero extend the return
-	value in the Intel version as is already done for the AT&T version.
-	(ffi_closure_SYSV): Likewise.
-	(ffi_closure_raw_SYSV): Likewise.
-	(ffi_closure_STDCALL): Likewise.
+commit 9531d05f64c2a674e0197158ffad68d69f177bd0
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Sun Mar 16 01:50:02 2014 -0700
 
-2012-03-29  Peter Rosin  <peda@lysator.liu.se>
+    prep_cif.c: Remove unnecessary ifdef for X86_WIN32
+    
+    ffi_prep_cif_core had a special case for X86_WIN32, checking for
+    FFI_THISCALL in addition to the FFI_FIRST_ABI-to-FFI_LAST_ABI range
+    before returning FFI_BAD_ABI.  However, on X86_WIN32, FFI_THISCALL
+    already falls in that range, making the special case unnecessary.
+    Remove it.
 
-	* src/x86/win32.S (ffi_closure_raw_THISCALL): Unify the frame
-	generation, fix the ENDP label and remove the surplus third arg
-	from the 'lea' insn.
+commit b3a5da068abd2f2983d9e67adbf41b0e0f34e37f
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Sat Mar 15 23:27:56 2014 -0700
 
-2012-03-29  Peter Rosin  <peda@lysator.liu.se>
+    .travis.yml: Test on both 32-bit and 64-bit
 
-	* src/x86/win32.S (ffi_closure_raw_SYSV): Make the 'stubraw' label
-	visible outside the PROC, so that ffi_closure_raw_THISCALL can see
-	it.  Also instruct the assembler to add a frame to the function.
+commit 98b52960485a261399f081915f36063de3854a5f
+Merge: 134ce4c f6dd184
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sun Mar 16 07:51:33 2014 -0400
 
-2012-03-23  Peter Rosin  <peda@lysator.liu.se>
+    Merge pull request #94 from joshtriplett/esp-extra-stackery-perception
+    
+    ChangeLog: Document testsuite changes to remove fragile stack pointer checks
 
-	* Makefile.am (AM_CPPFLAGS): Add -DFFI_BUILDING.
-	* Makefile.in: Rebuilt.
-	* include/ffi.h.in [MSVC]: Add __declspec(dllimport) decorations
-	to all data exports, when compiling libffi clients using MSVC.
+commit f6dd1845434dd53e22129becdfa092c082df307c
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Sun Mar 16 04:49:36 2014 -0700
 
-2012-03-29  Peter Rosin  <peda@lysator.liu.se>
+    ChangeLog: Document testsuite changes to remove fragile stack pointer checks
 
-	* src/x86/ffitarget.h (ffi_abi): Add new ABI FFI_MS_CDECL and
-	make it the default for MSVC.
-	(FFI_TYPE_MS_STRUCT): New structure return convention.
-	* src/x86/ffi.c (ffi_prep_cif_machdep): Tweak the structure
-	return convention for FFI_MS_CDECL to be FFI_TYPE_MS_STRUCT
-	instead of an ordinary FFI_TYPE_STRUCT.
-	(ffi_prep_args): Treat FFI_TYPE_MS_STRUCT as FFI_TYPE_STRUCT.
-	(ffi_call): Likewise.
-	(ffi_prep_incoming_args_SYSV): Likewise.
-	(ffi_raw_call): Likewise.
-	(ffi_prep_closure_loc): Treat FFI_MS_CDECL as FFI_SYSV.
-	* src/x86/win32.S (ffi_closure_SYSV): For FFI_TYPE_MS_STRUCT,
-	return a pointer to the result structure in eax and don't pop
-	that pointer from the stack, the caller takes care of it.
-	(ffi_call_win32): Treat FFI_TYPE_MS_STRUCT as FFI_TYPE_STRUCT.
-	(ffi_closure_raw_SYSV): Likewise.
+commit 134ce4c0266bf994f07518fc534de53f1d3c8de8
+Merge: 2680e9e 9c27932
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sun Mar 16 07:47:17 2014 -0400
 
-2012-03-22  Peter Rosin  <peda@lysator.liu.se>
+    Merge pull request #91 from joshtriplett/esp-extra-stackery-perception
+    
+    testsuite: Remove fragile stack pointer checks
 
-	* testsuite/libffi.call/closure_stdcall.c [MSVC]: Add inline
-	assembly version with Intel syntax.
-	* testsuite/libffi.call/closure_thiscall.c [MSVC]: Likewise.
+commit 9c279328ee12fc869adff63ca81f1230977bd42b
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Sun Mar 16 02:31:19 2014 -0700
 
-2012-03-23  Peter Rosin  <peda@lysator.liu.se>
+    testsuite: Remove fragile stack pointer checks
+    
+    testsuite/libffi.call/closure_stdcall.c and
+    testsuite/libffi.call/closure_thiscall.c include inline assembly to save
+    the stack pointer before and after the call, and compare the values.
+    However, compilers can and do leave the stack in different states for
+    these two pieces of inline assembly, such as by saving a temporary value
+    on the stack across the call; observed with gcc -Os, and verified as
+    spurious through careful inspection of disassembly.
 
-	* testsuite/libffi.call/ffitest.h: Provide abstration of
-	__attribute__((fastcall)) in the form of a __FASTCALL__
-	define.  Define it to __fastcall for MSVC.
-	* testsuite/libffi.call/fastthis1_win32.c: Use the above.
-	* testsuite/libffi.call/fastthis2_win32.c: Likewise.
-	* testsuite/libffi.call/fastthis3_win32.c: Likewise.
-	* testsuite/libffi.call/strlen2_win32.c: Likewise.
-	* testsuite/libffi.call/struct1_win32.c: Likewise.
-	* testsuite/libffi.call/struct2_win32.c: Likewise.
+commit 2680e9ea9b4c87ea8042a61e551bd667493d4bd3
+Merge: 071eab3 82f8cb2
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sun Mar 16 07:44:08 2014 -0400
 
-2012-03-22  Peter Rosin  <peda@lysator.liu.se>
+    Merge pull request #88 from joshtriplett/such-precision-many-fail-wow
+    
+    testsuite/libffi.call/many.c: Avoid spurious failure due to excess precision
 
-	* src/x86/win32.S [MSVC] (ffi_closure_THISCALL): Remove the manual
-	frame on function entry, MASM adds one automatically.
+commit 82f8cb24a1d976db35ae31a4b86cec8926da327d
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Sun Mar 16 04:27:32 2014 -0700
 
-2012-03-22  Peter Rosin  <peda@lysator.liu.se>
+    ChangeLog: Document many.c and many_win32.c changes to avoid spurious failures
 
-	* testsuite/libffi.call/ffitest.h [MSVC]: Add kludge for missing
-	bits in the MSVC headers.
+commit 88d562a8b5912e99306063fe3bc289bab6ca6ebe
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Sat Mar 15 22:08:19 2014 -0700
 
-2012-03-22  Peter Rosin  <peda@lysator.liu.se>
+    testsuite/libffi.call/many_win32.c: Avoid spurious failure due to excess precision
+    
+    The test case testsuite/libffi.call/many_win32.c can spuriously fail due
+    to excess floating-point precision.  Instrumenting it with some printf
+    calls shows differences well above FLT_EPSILON.  (Note when
+    instrumenting it that multiple computations of the difference, such as
+    one in a print and another in the conditional, may produce different
+    results.)
+    
+    Rather than complicating the test suite with architecture-specific flags
+    to avoid excess precision, just simplify the floating-point computation
+    to avoid a dependency on potential excess precision.
 
-	* testsuite/libffi.call/cls_12byte.c: Adjust to the C89 style
-	with no declarations after statements.
-	* testsuite/libffi.call/cls_16byte.c: Likewise.
-	* testsuite/libffi.call/cls_18byte.c: Likewise.
-	* testsuite/libffi.call/cls_19byte.c: Likewise.
-	* testsuite/libffi.call/cls_1_1byte.c: Likewise.
-	* testsuite/libffi.call/cls_20byte.c: Likewise.
-	* testsuite/libffi.call/cls_20byte1.c: Likewise.
-	* testsuite/libffi.call/cls_24byte.c: Likewise.
-	* testsuite/libffi.call/cls_2byte.c: Likewise.
-	* testsuite/libffi.call/cls_3_1byte.c: Likewise.
-	* testsuite/libffi.call/cls_3byte1.c: Likewise.
-	* testsuite/libffi.call/cls_3byte2.c: Likewise.
-	* testsuite/libffi.call/cls_4_1byte.c: Likewise.
-	* testsuite/libffi.call/cls_4byte.c: Likewise.
-	* testsuite/libffi.call/cls_5_1_byte.c: Likewise.
-	* testsuite/libffi.call/cls_5byte.c: Likewise.
-	* testsuite/libffi.call/cls_64byte.c: Likewise.
-	* testsuite/libffi.call/cls_6_1_byte.c: Likewise.
-	* testsuite/libffi.call/cls_6byte.c: Likewise.
-	* testsuite/libffi.call/cls_7_1_byte.c: Likewise.
-	* testsuite/libffi.call/cls_7byte.c: Likewise.
-	* testsuite/libffi.call/cls_8byte.c: Likewise.
-	* testsuite/libffi.call/cls_9byte1.c: Likewise.
-	* testsuite/libffi.call/cls_9byte2.c: Likewise.
-	* testsuite/libffi.call/cls_align_double.c: Likewise.
-	* testsuite/libffi.call/cls_align_float.c: Likewise.
-	* testsuite/libffi.call/cls_align_longdouble.c: Likewise.
-	* testsuite/libffi.call/cls_align_longdouble_split.c: Likewise.
-	* testsuite/libffi.call/cls_align_longdouble_split2.c: Likewise.
-	* testsuite/libffi.call/cls_align_pointer.c: Likewise.
-	* testsuite/libffi.call/cls_align_sint16.c: Likewise.
-	* testsuite/libffi.call/cls_align_sint32.c: Likewise.
-	* testsuite/libffi.call/cls_align_sint64.c: Likewise.
-	* testsuite/libffi.call/cls_align_uint16.c: Likewise.
-	* testsuite/libffi.call/cls_align_uint32.c: Likewise.
-	* testsuite/libffi.call/cls_align_uint64.c: Likewise.
-	* testsuite/libffi.call/cls_dbls_struct.c: Likewise.
-	* testsuite/libffi.call/cls_pointer_stack.c: Likewise.
-	* testsuite/libffi.call/err_bad_typedef.c: Likewise.
-	* testsuite/libffi.call/huge_struct.c: Likewise.
-	* testsuite/libffi.call/nested_struct.c: Likewise.
-	* testsuite/libffi.call/nested_struct1.c: Likewise.
-	* testsuite/libffi.call/nested_struct10.c: Likewise.
-	* testsuite/libffi.call/nested_struct2.c: Likewise.
-	* testsuite/libffi.call/nested_struct3.c: Likewise.
-	* testsuite/libffi.call/nested_struct4.c: Likewise.
-	* testsuite/libffi.call/nested_struct5.c: Likewise.
-	* testsuite/libffi.call/nested_struct6.c: Likewise.
-	* testsuite/libffi.call/nested_struct7.c: Likewise.
-	* testsuite/libffi.call/nested_struct8.c: Likewise.
-	* testsuite/libffi.call/nested_struct9.c: Likewise.
-	* testsuite/libffi.call/stret_large.c: Likewise.
-	* testsuite/libffi.call/stret_large2.c: Likewise.
-	* testsuite/libffi.call/stret_medium.c: Likewise.
-	* testsuite/libffi.call/stret_medium2.c: Likewise.
-	* testsuite/libffi.call/struct1.c: Likewise.
-	* testsuite/libffi.call/struct1_win32.c: Likewise.
-	* testsuite/libffi.call/struct2.c: Likewise.
-	* testsuite/libffi.call/struct2_win32.c: Likewise.
-	* testsuite/libffi.call/struct3.c: Likewise.
-	* testsuite/libffi.call/struct4.c: Likewise.
-	* testsuite/libffi.call/struct5.c: Likewise.
-	* testsuite/libffi.call/struct6.c: Likewise.
-	* testsuite/libffi.call/struct7.c: Likewise.
-	* testsuite/libffi.call/struct8.c: Likewise.
-	* testsuite/libffi.call/struct9.c: Likewise.
-	* testsuite/libffi.call/testclosure.c: Likewise.
+commit c00a49ecd165b2d06c1c9b249d212dc843fa116f
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Sat Mar 15 22:08:19 2014 -0700
 
-2012-03-21  Peter Rosin	 <peda@lysator.liu.se>
+    testsuite/libffi.call/many.c: Avoid spurious failure due to excess precision
+    
+    The test case testsuite/libffi.call/many.c can spuriously fail due to
+    excess floating-point precision.  Instrumenting it with some printf
+    calls shows differences well above FLT_EPSILON.  (Note when
+    instrumenting it that multiple computations of the difference, such as
+    one in a print and another in the conditional, may produce different
+    results.)
+    
+    Rather than complicating the test suite with architecture-specific flags
+    to avoid excess precision, just simplify the floating-point computation
+    to avoid a dependency on potential excess precision.
 
-	* testsuite/libffi.call/float_va.c (float_va_fn): Use %f when
-	printing doubles (%lf is for long doubles).
-	(main): Likewise.
+commit 071eab32a7f9fbbef46c0d8f37d9985bc9cceb37
+Merge: 2228c7a 2f44952
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sun Mar 16 07:36:52 2014 -0400
 
-2012-03-21  Peter Rosin  <peda@lysator.liu.se>
+    Merge pull request #92 from joshtriplett/autogen
+    
+    Re-add libtool-ldflags
 
-	* testsuite/lib/target-libpath.exp [*-*-cygwin*, *-*-mingw*]
-	(set_ld_library_path_env_vars): Add the library search dir to PATH
-	(and save PATH for later).
-	(restore_ld_library_path_env_vars): Restore PATH.
+commit 2f44952c95765c1486fad66f57235f8d459a9748
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Sun Mar 16 04:35:12 2014 -0700
 
-2012-03-21  Peter Rosin  <peda@lysator.liu.se>
+    Re-add libtool-ldflags
 
-	* testsuite/lib/target-libpath.exp [*-*-cygwin*, *-*-mingw*]
-	(set_ld_library_path_env_vars): Add the library search dir to PATH
-	(and save PATH for later).
-	(restore_ld_library_path_env_vars): Restore PATH.
+commit 2228c7ab190f3c529b9018495467b841fa21cba2
+Merge: 76d19d0 35634db
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sun Mar 16 07:25:18 2014 -0400
 
-2012-03-20  Peter Rosin  <peda@lysator.liu.se>
+    Merge pull request #87 from joshtriplett/autogen
+    
+    Remove autogenerated files from the repository
 
-	* testsuite/libffi.call/strlen2_win32.c (main): Remove bug.
-	* src/x86/win32.S [MSVC] (ffi_closure_SYSV): Make the 'stub' label
-	visible outside the PROC, so that ffi_closure_THISCALL can see it.
+commit 35634dbceaac0a1544f7385addc01d21ef1ef6a8
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Sat Mar 15 18:11:16 2014 -0700
 
-2012-03-20  Peter Rosin  <peda@lysator.liu.se>
+    Remove autogenerated files from the repository
+    
+    Add an autogen.sh to regenerate them.
 
-	* testsuite/libffi.call/strlen2_win32.c (main): Remove bug.
-	* src/x86/win32.S [MSVC] (ffi_closure_SYSV): Make the 'stub' label
-	visible outside the PROC, so that ffi_closure_THISCALL can see it.
+commit 76d19d004e36e99d261ee78261e2f52cea5e4ab1
+Merge: c86d9b6 a1a6f71
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Mar 14 16:54:31 2014 -0400
 
-2012-03-19  Alan Hourihane  <alanh@fairlite.co.uk>
+    Ensure the linker supports @unwind sections in libffi.
 
-	* src/m68k/ffi.c: Add MINT support.
-	* src/m68k/sysv.S: Ditto.
+commit c86d9b6cc6e16ee262844a33b40441374400758c
+Merge: 4efb7db f8cdf11
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Mar 14 16:51:20 2014 -0400
 
-2012-03-06  Chung-Lin Tang  <cltang@codesourcery.com>
+    Fix merge
 
-	* src/arm/ffi.c (ffi_call): Add __ARM_EABI__ guard around call to
-	ffi_call_VFP().
-	(ffi_prep_closure_loc): Add __ARM_EABI__ guard around use of
-	ffi_closure_VFP.
-	* src/arm/sysv.S: Add __ARM_EABI__ guard around VFP code.
+commit 4efb7dbfd9427c478a948cd0d464210123db8de8
+Merge: 634a475 18eb81d
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Mar 14 16:47:57 2014 -0400
 
-2012-03-19  chennam  <csit@axway.com>
+    Merge pull request #81 from rvandermeulen/bug-756740
+    
+    Allow building for mipsel with Android NDK r8.
 
-	* src/powerpc/ffi_darwin.c (ffi_prep_closure_loc): Fix AIX closure
-	support.
+commit a1a6f71bfe4199293043b2e4cfb4c8d3cb1112f9
+Author: Ryan VanderMeulen <ryanvm@gmail.com>
+Date:   Mon Mar 10 15:12:47 2014 -0400
 
-2012-03-13  Kaz Kojima  <kkojima@gcc.gnu.org>
+    Remove stray hunk that shouldn't have been included in this patch.
 
-	* src/sh/ffi.c (ffi_prep_closure_loc): Don't ASSERT ABI test,
-	just return FFI_BAD_ABI when things are wrong.
-	* src/sh64/ffi.c (ffi_prep_closure_loc): Ditto.
+commit f8cdf11467181f2a9a6b7e748167569aa58e3a81
+Author: Ryan VanderMeulen <ryanvm@gmail.com>
+Date:   Mon Mar 10 15:04:58 2014 -0400
 
-2012-03-09  David Edelsohn  <dje.gcc@gmail.com>
+    Replace double quotes with single quotes in Makefile.in to improve compatibility between some versions of MSYS and gmake. From Mozilla bug 943728.
+    https://bugzilla.mozilla.org/show_bug.cgi?id=943728
 
-	* src/powerpc/aix_closure.S (ffi_closure_ASM): Adjust for Darwin64
-	change to return value of ffi_closure_helper_DARWIN and load type
-	from return type.
+commit dfa3738732e1bc3a7f4130395ae4bab55fcebb99
+Author: Ryan VanderMeulen <ryanvm@gmail.com>
+Date:   Mon Mar 10 14:53:48 2014 -0400
 
-2012-03-03  H.J. Lu  <hongjiu.lu@intel.com>
+    Ensure the linker supports @unwind sections in libffi. From Mozilla bug 756740.
+    https://bugzilla.mozilla.org/show_bug.cgi?id=778414
+    
+    Also tracked as issue #42.
+    https://github.com/atgreen/libffi/issues/42
 
-	* src/x86/ffi64.c (ffi_call): Cast the return value to unsigned
-	long.
-	(ffi_prep_closure_loc): Cast to 64bit address in trampoline.
-	(ffi_closure_unix64_inner): Cast return pointer to unsigned long
-	first.
+commit 18eb81d032f29d645d0498ba92bddfd651f009ae
+Author: Ryan VanderMeulen <ryanvm@gmail.com>
+Date:   Mon Mar 10 14:43:37 2014 -0400
 
-	* src/x86/ffitarget.h (FFI_SIZEOF_ARG): Defined to 8 for x32.
-	(ffi_arg): Set to unsigned long long for x32.
-	(ffi_sarg): Set to long long for x32.
+    Allow building for mipsel with Android NDK r8. From Mozilla bug 756740.
+    https://bugzilla.mozilla.org/show_bug.cgi?id=756740
 
-2012-03-03  H.J. Lu  <hongjiu.lu@intel.com>
+commit 2349fec9a818fb52fd2f294bcbc7b3156cd113de
+Author: Daiki Ueno <ueno@gnu.org>
+Date:   Wed Mar 5 17:53:02 2014 +0900
 
-	* src/prep_cif.c (ffi_prep_cif_core): Properly check bad ABI.
+    Fix typo in doc
 
-2012-03-03  Andoni Morales Alastruey  <ylatuya@gmail.com>
+commit 634a475eaf1bee31c09f7d519e31c13b64cd24df
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Mar 1 18:37:29 2014 -0500
 
-	* configure.ac: Add -no-undefined for both 32- and 64-bit x86
-	windows-like hosts.
-	* configure: Rebuilt.
+    Update Makefile for new darwin scripts
 
-2012-02-27  Mikael Pettersson  <mikpe@it.uu.se>
+commit c7b67e874bb89859f9a07d1cf9606052b6c0dcc1
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Mar 1 18:34:18 2014 -0500
 
-	PR libffi/52223
-	* Makefile.am (FLAGS_TO_PASS): Define.
-	* Makefile.in: Regenerate.
+    Add README note
 
-2012-02-23  Anthony Green  <green@moxielogic.com>
+commit a04e30ba3dc303133d459c1ac273ceefe4d49b32
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Feb 28 17:20:59 2014 -0500
 
-	* src/*/ffitarget.h: Ensure that users never include ffitarget.h
-	directly.
+    Add missing -DFFI_DEBUG flag
 
-2012-02-23  Kai Tietz  <ktietz@redhat.com>
+commit 934dc1b5c8d6a9e727bedc72342831eb7d62c35f
+Merge: 11d7aa9 67fbef3
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Feb 28 01:10:17 2014 -0500
 
-	PR libffi/52221
-	* src/x86/ffi.c (ffi_closure_raw_THISCALL): New
-	prototype.
-	(ffi_prep_raw_closure_loc): Use ffi_closure_raw_THISCALL for
-	thiscall-convention.
-	(ffi_raw_call): Use ffi_prep_args_raw.
-	* src/x86/win32.S (ffi_closure_raw_THISCALL): Add
-	implementation for stub.
+    Merge branch 'master' of github.com:/atgreen/libffi
 
-2012-02-10  Kai Tietz  <ktietz@redhat.com>
+commit 11d7aa9d7a4bbe642944edc0f07cf96db9b270b6
+Merge: b40aeda 3b44d41
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Feb 28 01:06:48 2014 -0500
 
-	* configure.ac (AM_LTLDFLAGS): Add -no-undefine for x64
-	windows target.
-	* configure: Regenerated.
+    Merge pull request #46 from makotokato/android-clang
+    
+    Fix build failure when using clang for Android
 
-2012-02-08  Kai Tietz  <ktietz@redhat.com>
+commit 67fbef3b56ff0ef88f9b1a7fe48cb77222fa6cec
+Merge: b40aeda 3b44d41
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Feb 28 01:06:48 2014 -0500
 
-	* src/prep_cif.c (ffi_prep_cif): Allow for X86_WIN32
-	also FFI_THISCALL.
-	* src/x86/ffi.c (ffi_closure_THISCALL): Add prototype.
-	(FFI_INIT_TRAMPOLINE_THISCALL): New trampoline code.
-	(ffi_prep_closure_loc): Add FFI_THISCALL support.
-	* src/x86/ffitarget.h (FFI_TRAMPOLINE_SIZE): Adjust size.
-	* src/x86/win32.S (ffi_closure_THISCALL): New closure code
-	for thiscall-calling convention.
-	* testsuite/libffi.call/closure_thiscall.c: New test.
+    Merge pull request #46 from makotokato/android-clang
+    
+    Fix build failure when using clang for Android
 
-2012-01-28  Kai Tietz  <ktietz@redhat.com>
+commit b40aeda31a74d95a37c723b6243aabac466e67c4
+Merge: 20698ab 53ceaf1
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Feb 28 01:01:29 2014 -0500
 
-	* src/libffi/src/x86/ffi.c (ffi_call_win32): Add new
-	argument to prototype for specify calling-convention.
-	(ffi_call): Add support for stdcall/thiscall convention.
-	(ffi_prep_args): Likewise.
-	(ffi_raw_call): Likewise.
-	* src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and
-	FFI_FASTCALL.
-	* src/x86/win32.S (_ffi_call_win32): Add support for
-	fastcall/thiscall calling-convention calls.
-	* testsuite/libffi.call/fastthis1_win32.c: New test.
-	* testsuite/libffi.call/fastthis2_win32.c: New test.
-	* testsuite/libffi.call/fastthis3_win32.c: New test.
-	* testsuite/libffi.call/strlen2_win32.c: New test.
-	* testsuite/libffi.call/many2_win32.c: New test.
-	* testsuite/libffi.call/struct1_win32.c: New test.
-	* testsuite/libffi.call/struct2_win32.c: New test.
+    Merge branch 'master' of github.com:/atgreen/libffi
 
-2012-01-23  Uros Bizjak  <ubizjak@gmail.com>
+commit 53ceaf14c5eeb16ba09745f0ca87cca367d41a90
+Merge: 860fe66 cc9b518
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Feb 28 01:01:02 2014 -0500
 
-	* src/alpha/ffi.c (ffi_prep_closure_loc): Check for bad ABI.
+    Merge pull request #40 from wojdyr/master
+    
+    Correct the -L flag in libffi.pc.in
 
-2012-01-23  Anthony Green  <green@moxielogic.com>
-	    Chris Young  <cdyoung@ntlworld.com>
+commit 20698abc6a00092fd7fd3e434a3a29dc0f048f1e
+Merge: 64bd069 1a0b01e
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Feb 28 00:56:27 2014 -0500
 
-	* configure.ac: Add Amiga support.
-	* configure: Rebuilt.
+    Merge pull request #66 from ppizarro/master
+    
+    BlackFin fixes - Fatal error when calling a function defined in a shared library from within the function called by FFI
 
-2012-01-23  Dmitry Nadezhin  <dmitry.nadezhin@gmail.com>
+commit 860fe6646f5ae603e99a8d1d722ddddba8b75769
+Merge: 64bd069 1a0b01e
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Feb 28 00:56:27 2014 -0500
 
-	* include/ffi_common.h (LIKELY, UNLIKELY): Fix definitions.
+    Merge pull request #66 from ppizarro/master
+    
+    BlackFin fixes - Fatal error when calling a function defined in a shared library from within the function called by FFI
 
-2012-01-23  Andreas Schwab  <schwab@linux-m68k.org>
+commit 64bd06990a7accf72271516a2110b86cdccd8df4
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Feb 28 00:52:56 2014 -0500
 
-	* src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain
-	mc68000.  Test for __HAVE_68881__ in addition to __MC68881__.
+    Add ChangeLog entry for Josh's change
 
-2012-01-19  Jakub Jelinek  <jakub@redhat.com>
+commit edf29c5169b06fcfc241445e152e325bc3c50e0e
+Merge: 33c9954 3998d26
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Feb 28 00:50:25 2014 -0500
 
-	PR rtl-optimization/48496
-	* src/ia64/ffi.c (ffi_call): Fix up aliasing violations.
+    Merge pull request #75 from joshtriplett/longdouble
+    
+    Fix build error on x86 without distinct long double
 
-2012-01-09  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+commit 33c9954f2eec539011a0f93270aaf013318837ae
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Feb 28 00:38:41 2014 -0500
 
-	* configure.ac (i?86-*-*): Set TARGET to X86_64.
-	* configure: Regenerate.
+    Rebuilt with new libtool
 
-2011-12-07  Andrew Pinski  <apinski@cavium.com>
+commit 926b6989fbd08488b9105943293353d45ac527e0
+Merge: 5a88c85 cc82051
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Feb 28 00:26:57 2014 -0500
 
-	PR libffi/50051
-	* src/mips/n32.S: Add ".set mips4".
+    Merge branch 'master' of github.com:/atgreen/libffi
+    
+    Conflicts:
+    	ChangeLog
 
-2011-11-21  Andreas Tobler  <andreast@fgznet.ch>
+commit 5a88c85fde304052bed1581ed0b6452ac2c68838
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Feb 28 00:23:04 2014 -0500
 
-	* configure: Regenerate.
+    Fix spelling errors
 
-2011-11-12  David Gilbert <david.gilbert@linaro.org>
+commit cc82051c7e80cea772c4b72da026eb7e68d598fc
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Feb 28 00:23:04 2014 -0500
 
-	* doc/libffi.texi, include/ffi.h.in, include/ffi_common.h,
-	man/Makefile.am, man/ffi.3, man/ffi_prep_cif.3,
-	man/ffi_prep_cif_var.3, src/arm/ffi.c, src/arm/ffitarget.h,
-	src/cris/ffi.c, src/prep_cif.c,
-	testsuite/libffi.call/cls_double_va.c,
-	testsuite/libffi.call/cls_longdouble_va.c,
-	testsuite/libffi.call/float_va.c: Many changes to support variadic
-	function calls.
+    Fix spelling errors
 
-2011-11-12  Kyle Moffett <Kyle.D.Moffett@boeing.com>
+commit 001aaf4b1b56349596bb6f6b5c1613dcbbd84ea8
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Feb 28 00:20:17 2014 -0500
 
-	* src/powerpc/ffi.c, src/powerpc/ffitarget.h,
-	src/powerpc/ppc_closure.S, src/powerpc/sysv.S: Many changes for
-	softfloat powerpc variants.
+    When no VFP arguments are present the IP register is used
+    uninitialized. Initialize it to the value of FP.
+    
+    This fixes a number of testsuite failures when configured for
+    armv7l-unknown-linux-gnueabihf
 
-2011-11-12  Petr Salinger <Petr.Salinger@seznam.cz>
+commit 49f7729c3ce697c12408c42ccb29cdf4eb66bb85
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Feb 28 00:17:16 2014 -0500
 
-	* configure.ac (FFI_EXEC_TRAMPOLINE_TABLE): Fix kfreebsd support.
-	* configure: Rebuilt.
+    aarch64 fix
 
-2011-11-12  Timothy Wall  <twall@users.sf.net>
+commit 447483d51c6aa9df7116f346a73fc1cf795f4c2b
+Merge: 51377bd b4df9cf
+Author: Anthony Green <green@moxielogic.com>
+Date:   Thu Feb 27 15:42:41 2014 -0500
 
-	* src/arm/ffi.c (ffi_prep_args, ffi_prep_incoming_args_SYSV): Max
-	alignment of 4 for wince on ARM.
+    Fix ChangeLog merge
 
-2011-11-12  Kyle Moffett <Kyle.D.Moffett@boeing.com>
-	    Anthony Green <green@moxielogic.com>
+commit 3998d2604b5c0d45a098ff3119a9fd9710ef429d
+Author: Josh Triplett <josh@joshtriplett.org>
+Date:   Mon Feb 17 11:20:33 2014 -0800
 
-	* src/ppc/sysv.S, src/ppc/ffi.c: Remove use of ppc string
-	instructions (not available on some cores, like the PPC440).
+    Fix build error on x86 without distinct long double
+    
+    src/x86/ffi64.c: In function 'classify_argument':
+    src/x86/ffi64.c:205:5: error: duplicate case value
+         case FFI_TYPE_LONGDOUBLE:
+         ^
+    src/x86/ffi64.c:202:5: error: previously used here
+         case FFI_TYPE_DOUBLE:
+         ^
 
-2011-11-12  Kimura Wataru  <kimuraw@i.nifty.jp>
+commit 51377bda9aed0b2c1309c818460cab9d9ab3d46e
+Merge: f08da54 40927bd
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Feb 15 08:06:29 2014 -0500
 
-	* m4/ax_enable_builddir: Change from string comparison to numeric
-	comparison for wc output.
-	* configure.ac: Enable FFI_MMAP_EXEC_WRIT for darwin11 aka Mac OS
-	X 10.7.
-	* configure: Rebuilt.
+    Merge pull request #72 from heiher/devel
+    
+    MIPS N32: Fix call floating point va function
 
-2011-11-12  Anthony Green  <green@moxielogic.com>
+commit f08da5465463e60a28f5e921f23ebf2ba984c148
+Merge: 3dc3f32 fa5f25c
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Feb 15 08:06:11 2014 -0500
 
-	* Makefile.am (AM_CCASFLAGS): Add -g option to build assembly
-	files with debug info.
-	* Makefile.in: Rebuilt.
+    Merge pull request #68 from zeldin/master
+    
+    Linux/ppc64: Remove assumption on contents of r11 in closure
 
-2011-11-12  Jasper Lievisse Adriaanse <jasper@openbsd.org>
+commit 40927bd3e1e7c6007025ba10854fd8a0664e47df
+Author: Heiher <r@hev.cc>
+Date:   Tue Jan 21 23:18:27 2014 +0800
 
-	* README: Update list of supported OpenBSD systems.
+    Fix call floating point va function
+    
+    I'm not sure floating-point arguments in GPR or FPR before calling
+    variable number arguments function. so, load all arguments to GPR and
+    FPR.
 
-2011-11-12  Anthony Green  <green@moxielogic.com>
+commit b4df9cf9cc4a9a9401a53fd6bea1f3c2c283b97b
+Author: Zachary Waldowski <zach@waldowski.me>
+Date:   Wed Feb 5 14:22:52 2014 -0500
 
-	* libtool-version: Update.
-	* Makefile.am (nodist_libffi_la_SOURCES): Add src/debug.c if
-	FFI_DEBUG.
-	(libffi_la_SOURCES): Remove src/debug.c
-	(EXTRA_DIST): Add src/debug.c
-	* Makefile.in: Rebuilt.
-	* README: Update for 3.0.11.
+    AArch64: Fix void fall-through case when assertions are enabled
 
-2011-11-10  Richard Henderson  <rth@redhat.com>
+commit f466aad0d91a117e42571d1d6fb434fa0433c930
+Author: Zachary Waldowski <zach@waldowski.me>
+Date:   Tue Jan 21 16:38:31 2014 -0500
 
-	* configure.ac (GCC_AS_CFI_PSEUDO_OP): Use it instead of inline check.
-	* configure, aclocal.m4: Rebuild.
+    AArch64: Fix missing semicolons when assertions are enabled
 
-2011-09-04  Iain Sandoe  <iains@gcc.gnu.org>
+commit 7ea677733bd98917241852b8901a6b7580728895
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Nov 30 20:58:31 2013 -0500
 
-	PR libffi/49594
-	* src/powerpc/darwin_closure.S (stubs): Make the stub binding
-	helper reference track the architecture pointer size.
+    Remove build-ios from Makefile
+    
+    Conflicts:
+    	ChangeLog
 
-2011-08-25  Andrew Haley  <aph@redhat.com>
+commit 6ae046cc59c12b2cd40158d6bcb96f4a59886159
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Nov 30 21:06:51 2013 -0500
 
-	* src/arm/ffi.c (FFI_INIT_TRAMPOLINE): Remove hard-coded assembly
-	instructions.
-	* src/arm/sysv.S (ffi_arm_trampoline): Put them here instead.
+    Mention Aarch64 on iOS
 
-2011-07-11  Andrew Haley  <aph@redhat.com>
+commit bfc06b3fdb32abe90ce0749aedfec649df85a7ef
+Author: Zachary Waldowski <zach@waldowski.me>
+Date:   Mon Dec 30 17:36:39 2013 -0500
 
-        * src/arm/ffi.c (FFI_INIT_TRAMPOLINE): Clear icache.
+    Update ChangeLog
 
-2011-06-29  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+commit 0a0f12ce1f7be81006b08a3c81a636926d283a9b
+Author: Zachary Waldowski <zach@waldowski.me>
+Date:   Thu Jan 9 13:50:17 2014 -0500
 
-	* testsuite/libffi.call/cls_double_va.c: Move PR number to comment.
-	* testsuite/libffi.call/cls_longdouble_va.c: Likewise.
+    AArch64: Remove duplicitous element_count call.
+    
+    This inhibits an analyzer warning by Clang.
 
-2011-06-29  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+commit 4330fdcd92e67c816288d64ab230237065768206
+Author: Zachary Waldowski <zach@waldowski.me>
+Date:   Thu Jan 9 13:53:30 2014 -0500
 
-	PR libffi/46660
-	* testsuite/libffi.call/cls_double_va.c: xfail dg-output on
-	mips-sgi-irix6*.
-	* testsuite/libffi.call/cls_longdouble_va.c: Likewise.
+    Darwin/aarch64: Respect iOS ABI re: stack argument alignment
 
-2011-06-14  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+commit 0a333d6c3973935d4fe02aae76b10e39d3c88e07
+Author: Zachary Waldowski <zach@waldowski.me>
+Date:   Thu Jan 9 14:03:29 2014 -0500
 
-	* testsuite/libffi.call/huge_struct.c (test_large_fn): Use PRIu8,
-	PRId8 instead of %hhu, %hhd.
-	* testsuite/libffi.call/ffitest.h [__alpha__ && __osf__] (PRId8,
-	PRIu8): Define.
-	[__sgi__] (PRId8, PRIu8): Define.
+    Darwin/aarch64: Fix size_t assumptions
 
-2011-04-29  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+commit 2c18e3c76aad1b426617db05a4384e7c3a920176
+Author: Zachary Waldowski <zach@waldowski.me>
+Date:   Mon Dec 30 16:14:02 2013 -0500
 
-	* src/alpha/osf.S (UA_SI, FDE_ENCODING, FDE_ENCODE, FDE_ARANGE):
-	Define.
-	Use them to handle ELF vs. ECOFF differences.
-	[__osf__] (_GLOBAL__F_ffi_call_osf): Define.
+    Darwin/aarch64: Fix "shadows declaration" warnings
 
-2011-03-30  Timothy Wall  <twall@users.sf.net>
+commit 1b8a8e20e344f3c55495ab6eb46bd14e843d4b3e
+Author: Zachary Waldowski <zach@waldowski.me>
+Date:   Thu Jan 9 13:55:21 2014 -0500
 
-	* src/powerpc/darwin.S: Fix unknown FDE encoding.
-	* src/powerpc/darwin_closure.S: ditto.
+    Darwin/aarch64: Use Clang cache invalidation builtin
 
-2011-02-25  Anthony Green  <green@moxielogic.com>
+commit 6030cdcae776f8fb5876a53168f7d1e75d28a242
+Author: Zachary Waldowski <zach@waldowski.me>
+Date:   Mon Dec 30 15:45:51 2013 -0500
 
-	* src/powerpc/ffi.c (ffi_prep_closure_loc): Allow for more
-	32-bit ABIs.
+    Darwin/aarch64: Account for long double being equal to double
 
-2011-02-15  Anthony Green  <green@moxielogic.com>
+commit 5658b0892683d2e24e4d5842978c184a7ad33858
+Author: Zachary Waldowski <zach@waldowski.me>
+Date:   Mon Dec 30 16:33:47 2013 -0500
 
-	* m4/ax_cc_maxopt.m4: Don't -malign-double or use -ffast-math.
-	* configure: Rebuilt.
+    Darwin/aarch64: Use CNAME, restrict .size like ARM
 
-2011-02-13  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+commit 07175780802acec5dc49fdedd6d20a62409a6707
+Author: Zachary Waldowski <zach@waldowski.me>
+Date:   Mon Dec 30 17:48:22 2013 -0500
 
-	* configure: Regenerate.
+    Darwin/aarch64: Fix invalid reference in assembly
 
-2011-02-13  Anthony Green  <green@moxielogic.com>
+commit 9da28b44277fea3aeb827c35dd63d609d2524a8b
+Author: Zachary Waldowski <zach@waldowski.me>
+Date:   Mon Dec 30 16:23:21 2013 -0500
 
-	* include/ffi_common.h (UNLIKELY, LIKELY): Define.
-	* src/x86/ffi64.c (UNLIKELY, LIKELY): Remove definition.
-	* src/prep_cif.c (UNLIKELY, LIKELY): Remove definition.
+    Darwin/x86_64: Fix 64-bit type shortening warnings
 
-	* src/prep_cif.c (initialize_aggregate): Convert assertion into
-	FFI_BAD_TYPEDEF return.  Initialize arg size and alignment to 0.
+commit 821d398f08bd1d540a5b235507812ffeee49b580
+Author: Zachary Waldowski <zach@waldowski.me>
+Date:   Thu Jan 9 13:15:06 2014 -0500
 
-	* src/pa/ffi.c (ffi_prep_closure_loc): Don't ASSERT ABI test,
-	just return FFI_BAD_ABI when things are wrong.
-	* src/arm/ffi.c (ffi_prep_closure_loc): Ditto.
-	* src/powerpc/ffi.c (ffi_prep_closure_loc): Ditto.
-	* src/mips/ffi.c (ffi_prep_closure_loc): Ditto.
-	* src/ia64/ffi.c (ffi_prep_closure_loc): Ditto.
-	* src/avr32/ffi.c (ffi_prep_closure_loc): Ditto.
+    Darwin: Merge build scripts, redo project, incl. arm64
 
-2011-02-11  Anthony Green  <green@moxielogic.com>
+commit 6eff9ff9e72463b9783be2514f944b6f05692054
+Author: Zachary Waldowski <zach@waldowski.me>
+Date:   Mon Dec 30 17:48:10 2013 -0500
 
-	* src/sparc/ffi.c (ffi_prep_closure_loc): Don't ASSERT ABI test,
-	just return FFI_BAD_ABI when things are wrong.
+    Darwin/iOS: Improve unified syntax use for LLVM
 
-2012-02-11  Eric Botcazou  <ebotcazou@adacore.com>
+commit ba0ea99c82aadd5957386a031e3122011bd36d52
+Author: Zachary Waldowski <zach@waldowski.me>
+Date:   Mon Dec 30 15:27:44 2013 -0500
 
-	* src/sparc/v9.S (STACKFRAME): Bump to 176.
+    Fix dlmalloc warnings due to set_segment_flags, sizeof(size_t)
 
-2011-02-09  Stuart Shelton  <srcshelton@gmail.com>
+commit 994be3a5c1d0d17b19103396103e128517fd62f9
+Author: Zachary Waldowski <zach@waldowski.me>
+Date:   Mon Dec 30 15:27:14 2013 -0500
 
-	http://bugs.gentoo.org/show_bug.cgi?id=286911
-	* src/mips/ffitarget.h: Clean up error messages.
-	* src/java_raw_api.c (ffi_java_translate_args): Cast raw arg to
-	ffi_raw*.
-	* include/ffi.h.in: Add pragma for SGI compiler.
+    Darwin/iOS: Fix mis-typing of vfp_reg_free
 
-2011-02-09  Anthony Green  <green@moxielogic.com>
+commit a8e0a835ab1f62d03ad6391760e3e8b7732d24f8
+Author: Zachary Waldowski <zach@waldowski.me>
+Date:   Mon Dec 30 15:26:20 2013 -0500
 
-	* configure.ac: Add powerpc64-*-darwin* support.
+    Darwin/ARM: Assert on NULL dereference
+    
+    This inhibits an analyzer warning by Clang on all platforms.
 
-2011-02-09  Anthony Green <green@moxielogic.com>
+commit 13675341581c489ed9df8ba390c8e08a732decb2
+Author: Zachary Waldowski <zach@waldowski.me>
+Date:   Thu Jan 9 13:42:08 2014 -0500
 
-	* README: Mention Interix.
+    Darwin/i386: Inhibit Clang previous prototype warnings
 
-2011-02-09  Jonathan Callen  <abcd@gentoo.org>
+commit 66469c381e2e2cc96e7d409266dea0ffe177eeca
+Author: Zachary Waldowski <zach@waldowski.me>
+Date:   Thu Jan 9 13:41:45 2014 -0500
 
-	* configure.ac: Add Interix to win32/cygwin/mingw case.
-	* configure: Ditto.
-	* src/closures.c: Treat Interix like Cygwin, instead of as a
-	generic win32.
+    Darwin/ARM: Inhibit Clang previous prototype warnings
 
-2011-02-09  Anthony Green <green@moxielogic.com>
+commit 5bfe62a00d2d659eec9f19b39802b6e69844fc27
+Author: Zachary Waldowski <zach@waldowski.me>
+Date:   Thu Jan 9 13:41:27 2014 -0500
 
-	* testsuite/libffi.call/err_bad_typedef.c: Remove xfail.
-	* testsuite/libffi.call/err_bad_abi.c: Remove xfail.
-	* src/x86/ffi64.c (UNLIKELY, LIKELY): Define.
-	(ffi_prep_closure_loc): Check for bad ABI.
-	* src/prep_cif.c (UNLIKELY, LIKELY): Define.
-	(initialize_aggregate): Check for bad types.
+    Darwin/AArch64: Inhibit Clang previous prototype warnings
 
-2011-02-09  Landon Fuller <landonf@plausible.coop>
+commit fa5f25c20f76a6ef5e950a7ccbce826672c8a620
+Author: Marcus Comstedt <marcus@mc.pp.se>
+Date:   Sat Jan 4 19:00:08 2014 +0100
 
-	* Makefile.am (EXTRA_DIST): Add build-ios.sh, src/arm/gentramp.sh,
-	src/arm/trampoline.S.
-	(nodist_libffi_la_SOURCES): Add src/arc/trampoline.S.
-	* configure.ac (FFI_EXEC_TRAMPOLINE_TABLE): Define.
-	* src/arm/ffi.c (ffi_trampoline_table)
-	(ffi_closure_trampoline_table_page, ffi_trampoline_table_entry)
-	(FFI_TRAMPOLINE_CODELOC_CONFIG, FFI_TRAMPOLINE_CONFIG_PAGE_OFFSET)
-	(FFI_TRAMPOLINE_COUNT, ffi_trampoline_lock, ffi_trampoline_tables)
-	(ffi_trampoline_table_alloc, ffi_closure_alloc, ffi_closure_free):
-	Define for FFI_EXEC_TRAMPOLINE_TABLE case (iOS).
-	(ffi_prep_closure_loc): Handl FFI_EXEC_TRAMPOLINE_TABLE case
-	separately.
-	* src/arm/sysv.S: Handle Apple iOS host.
-	* src/closures.c: Handle FFI_EXEC_TRAMPOLINE_TABLE case.
-	* build-ios.sh: New file.
-	* fficonfig.h.in, configure, Makefile.in: Rebuilt.
-	* README: Mention ARM iOS.
+    Linux/ppc64: Remove assumption on contents of r11 in closure
 
-2011-02-08  Oren Held  <orenhe@il.ibm.com>
+commit 1a0b01e171e9c750437cef2f18917f5a6e32c498
+Author: Paulo Pizarro <paulo.pizarro@gmail.com>
+Date:   Thu Jan 2 16:17:59 2014 -0200
 
-	* src/dlmalloc.c (_STRUCT_MALLINFO): Define in order to avoid
-	redefinition of mallinfo on HP-UX.
+    When the function called by the ffi called a function defined in a shared library generate a fatal error
+    The correction was to take into consideration the GOT.
 
-2011-02-08  Ginn Chen  <ginn.chen@oracle.com>
+commit 3dc3f32c35db5ab995a835225f6815369735ceb7
+Author: Anthony Green <green@moxielogic.com>
+Date:   Thu Dec 5 16:23:25 2013 -0500
 
-	* src/sparc/ffi.c (ffi_call): Make compatible with Solaris Studio
-	aggregate return ABI.  Flush cache.
-	(ffi_prep_closure_loc): Flush cache.
+    Undo iOS ARM64 changes.
 
-2011-02-11  Anthony Green  <green@moxielogic.com>
+commit 356b2cbc304bfe5bdc28b8d1c68d1ff084e9ec37
+Merge: 484a758 07345a3
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Nov 30 22:38:13 2013 -0500
 
-	From Tom Honermann <tom.honermann@oracle.com>:
-	* src/powerpc/aix.S (ffi_call_AIX): Support for xlc toolchain on
-	AIX.  Declare .ffi_prep_args.  Insert nops after branch
-	instructions so that the AIX linker can insert TOC reload
-	instructions.
-	* src/powerpc/aix_closure.S: Declare .ffi_closure_helper_DARWIN.
+    Merge branch 'master' of github.com:/atgreen/libffi
 
-2011-02-08  Ed  <ed@kdtc.net>
+commit 484a7584260e2fbb399ce90083046834271bf9ff
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Nov 30 21:06:51 2013 -0500
 
-	* src/powerpc/asm.h: Fix grammar nit in comment.
+    Mention Aarch64 on iOS
 
-2011-02-08  Uli Link  <ul.mcamafia@linkitup.de>
+commit 07345a30ec0a2fa45a7c363d301f57723690cfa0
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Nov 30 21:06:51 2013 -0500
 
-	* include/ffi.h.in (FFI_64_BIT_MAX): Define and use.
+    Mention Aarch64 on iOS
 
-2011-02-09  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+commit d4b931c1b872378c35f12ddbb9a6d55e7f17c65e
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Nov 30 20:58:31 2013 -0500
 
-	PR libffi/46661
-	* testsuite/libffi.call/cls_pointer.c (main): Cast void * to
-	uintptr_t first.
-	* testsuite/libffi.call/cls_pointer_stack.c (main): Likewise.
+    Remove build-ios from Makefile
 
-2011-02-08  Rafael Avila de Espindola  <respindola@mozilla.com>
+commit dfbf236d70fc1ec68e6ff193584a154353508e2f
+Merge: 852ac3b bb9740e
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Nov 30 20:54:54 2013 -0500
 
-	* configure.ac: Fix x86 test for pc related relocs.
-	* configure: Rebuilt.
+    Merge branch 'master' of github.com:/atgreen/libffi
+    Add ChangeLog entry.
 
-2011-02-07  Joel Sherrill <joel.sherrill@oarcorp.com>
+commit bb9740e545205f93a525c77aa6d1cbf4ca9371f3
+Merge: ac75368 4d701e0
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Nov 30 17:54:39 2013 -0800
 
-	* libffi/src/m68k/ffi.c: Add RTEMS support for cache flushing.
-	Handle case when CPU variant does not have long double support.
-	* libffi/src/m68k/sysv.S: Add support for mc68000, Coldfire,
-	and cores with soft floating point.
+    Merge pull request #60 from zwaldowski/ios-redo
+    
+    Mac/iOS support, including aarch64 port
 
-2011-02-07  Joel Sherrill <joel.sherrill@oarcorp.com>
+commit 4d701e03faa475a5eb3b54b90046114a1e27b813
+Author: Zachary Waldowski <zwaldowski@gmail.com>
+Date:   Sat Nov 30 13:25:27 2013 -0500
 
-	* configure.ac: Add mips*-*-rtems* support.
-	* configure: Regenerate.
-	* src/mips/ffitarget.h: Ensure needed constants are available
-	for targets which do not have sgidefs.h.
+    Darwin: Properly export headers from Xcode project
 
-2011-01-26  Dave Korn  <dave.korn.cygwin@gmail.com>
+commit 022f12eb9ad2264e838fa5fb453733f5177888f4
+Author: Zachary Waldowski <zwaldowski@gmail.com>
+Date:   Sat Nov 30 12:21:38 2013 -0500
 
-	PR target/40125
-	* configure.ac (AM_LTLDFLAGS): Add -bindir option for windows DLLs.
-	* configure: Regenerate.
+    Darwin: Freshen gen scripts, remove old build-ios.sh
 
-2010-12-18  Iain Sandoe  <iains@gcc.gnu.org>
+commit e820fe2025d7ad3df7584407946dfaad2af69599
+Author: Zachary Waldowski <zwaldowski@gmail.com>
+Date:   Sat Nov 30 12:03:51 2013 -0500
 
-	PR libffi/29152
-	PR libffi/42378
-	* src/powerpc/darwin_closure.S: Provide Darwin64 implementation,
-	update comments.
-	* src/powerpc/ffitarget.h (POWERPC_DARWIN64): New,
-	(FFI_TRAMPOLINE_SIZE): Update for Darwin64.
-	* src/powerpc/darwin.S: Provide Darwin64 implementation,
-	update comments.
-	* src/powerpc/ffi_darwin.c: Likewise.
+    Darwin/iOS: Include x86_64+aarch64 pieces in library
 
-2010-12-06  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+commit 0278284e470ec91db7cdc15ac3dcd64683305848
+Author: Zachary Waldowski <zwaldowski@gmail.com>
+Date:   Sat Nov 30 03:03:37 2013 -0500
 
-	* configure.ac (libffi_cv_as_ascii_pseudo_op): Use double
-	backslashes.
-	(libffi_cv_as_string_pseudo_op): Likewise.
-	* configure: Regenerate.
+    Darwin/aarch64: size_t assumptions
 
-2010-12-03  Chung-Lin Tang  <cltang@codesourcery.com>
+commit 9775446b6441c91cd9059215c106aa3bcf949767
+Author: Zachary Waldowski <zwaldowski@gmail.com>
+Date:   Sat Nov 30 02:39:34 2013 -0500
 
-	* src/arm/sysv.S (ffi_closure_SYSV): Add UNWIND to .pad directive.
-	(ffi_closure_VFP): Same.
-	(ffi_call_VFP): Move down to before ffi_closure_VFP. Add '.fpu vfp'
-	directive.
+    Darwin/aarch64: Fix “shadows declaration” warnings
 
-2010-12-01  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+commit 4260badc37705d3618e774dfe61184ac709881c1
+Author: Zachary Waldowski <zwaldowski@gmail.com>
+Date:   Sat Nov 30 02:08:14 2013 -0500
 
-	* testsuite/libffi.call/ffitest.h [__sgi] (PRId64, PRIu64): Define.
-	(PRIuPTR): Define.
+    Darwin/aarch64: Use Clang cache invalidation builtin
 
-2010-11-29  Richard Henderson  <rth@redhat.com>
-	    Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+commit 9fa7998d5f9250908cbf12a671479852ebadf9d1
+Author: Zachary Waldowski <zwaldowski@gmail.com>
+Date:   Sat Nov 30 02:07:48 2013 -0500
 
-	* src/x86/sysv.S (FDE_ENCODING, FDE_ENCODE): Define.
-	(.eh_frame): Use FDE_ENCODING.
-	(.LASFDE1, .LASFDE2, LASFDE3): Simplify with FDE_ENCODE.
+    Darwin/aarch64: Inhibit Xcode warning
 
-2010-11-22  Jacek Caban <jacek@codeweavers.com>
+commit 0e832048a93830575b0976406444e134e649a4f7
+Author: Zachary Waldowski <zwaldowski@gmail.com>
+Date:   Sat Nov 30 02:07:34 2013 -0500
 
-	* configure.ac: Check for symbol underscores on mingw-w64.
-	* configure: Rebuilt.
-	* src/x86/win64.S: Correctly access extern symbols in respect to
-	underscores.
+    Darwin/aarch64: double == long double
 
-2010-11-15  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+commit 602dc22d76931092610234cf063f9f1b8dbc1a51
+Author: Zachary Waldowski <zwaldowski@gmail.com>
+Date:   Sat Nov 30 02:06:00 2013 -0500
 
-	* testsuite/lib/libffi-dg.exp: Rename ...
-	* testsuite/lib/libffi.exp: ... to this.
-	* libffi/testsuite/libffi.call/call.exp: Don't load libffi-dg.exp.
-	* libffi/testsuite/libffi.special/special.exp: Likewise.
+    Darwin/iOS prep script: try and compile for arm64
 
-2010-10-28  Chung-Lin Tang  <cltang@codesourcery.com>
+commit b513dfe79de4725e8a717325a9e3b5b9f69f63dc
+Author: Zachary Waldowski <zwaldowski@gmail.com>
+Date:   Sat Nov 30 02:05:22 2013 -0500
 
-	* src/arm/ffi.c (ffi_prep_args): Add VFP register argument handling
-	code, new parameter, and return value. Update comments.
-	(ffi_prep_cif_machdep): Add case for VFP struct return values. Add
-	call to layout_vfp_args().
-	(ffi_call_SYSV): Update declaration.
-	(ffi_call_VFP): New declaration.
-	(ffi_call): Add VFP struct return conditions. Call ffi_call_VFP()
-	when ABI is FFI_VFP.
-	(ffi_closure_VFP): New declaration.
-	(ffi_closure_SYSV_inner): Add new vfp_args parameter, update call to
-	ffi_prep_incoming_args_SYSV().
-	(ffi_prep_incoming_args_SYSV): Update parameters. Add VFP argument
-	case handling.
-	(ffi_prep_closure_loc): Pass ffi_closure_VFP to trampoline
-	construction under VFP hard-float.
-	(rec_vfp_type_p): New function.
-	(vfp_type_p): Same.
-	(place_vfp_arg): Same.
-	(layout_vfp_args): Same.
-	* src/arm/ffitarget.h (ffi_abi): Add FFI_VFP. Define FFI_DEFAULT_ABI
-	based on __ARM_PCS_VFP.
-	(FFI_EXTRA_CIF_FIELDS): Define for adding VFP hard-float specific
-	fields.
-	(FFI_TYPE_STRUCT_VFP_FLOAT): Define internally used type code.
-	(FFI_TYPE_STRUCT_VFP_DOUBLE): Same.
-	* src/arm/sysv.S (ffi_call_SYSV): Change call of ffi_prep_args() to
-	direct call. Move function pointer load upwards.
-	(ffi_call_VFP): New function.
-	(ffi_closure_VFP): Same.
+    Darwin/aarch64: Restrict .size to ELF like arm32.
 
-	* testsuite/lib/libffi-dg.exp (check-flags): New function.
-	(dg-skip-if): New function.
-	* testsuite/libffi.call/cls_double_va.c: Skip if target is arm*-*-*
-	and compiler options include -mfloat-abi=hard.
-	* testsuite/libffi.call/cls_longdouble_va.c: Same.
+commit bc978099bf2812de755c076b67ef9c2547607572
+Author: Zachary Waldowski <zwaldowski@gmail.com>
+Date:   Sat Nov 30 02:04:57 2013 -0500
 
-2010-10-01  Jakub Jelinek  <jakub@redhat.com>
+    Darwin/aarch64: Potentially(?) fix compile error
 
-	PR libffi/45677
-	* src/x86/ffi64.c (ffi_prep_cif_machdep): Ensure cif->bytes is
-	a multiple of 8.
-	* testsuite/libffi.call/many2.c: New test.
+commit d6bb9314467c6e0683156559d23ca341c43fa3c8
+Author: Zachary Waldowski <zwaldowski@gmail.com>
+Date:   Sat Nov 30 02:04:22 2013 -0500
 
-2010-08-20  Mark Wielaard  <mjw@redhat.com>
+    Darwin/aarch64: Use CNAME refs
 
-	* src/closures.c (open_temp_exec_file_mnt): Check if getmntent_r
-	returns NULL.
+commit 33c46ce5680eea28d3437c8771ec1d137e226b45
+Author: Zachary Waldowski <zwaldowski@gmail.com>
+Date:   Sat Nov 30 04:13:42 2013 -0500
 
-2010-08-09  Andreas Tobler  <andreast@fgznet.ch>
+    Darwin/Mac: Fix 64/32 shortening warnings
 
-	* configure.ac: Add target powerpc64-*-freebsd*.
-	* configure: Regenerate.
-	* testsuite/libffi.call/cls_align_longdouble_split.c: Pass
-	-mlong-double-128 only to linux targets.
-	* testsuite/libffi.call/cls_align_longdouble_split2.c: Likewise.
-	* testsuite/libffi.call/cls_longdouble.c: Likewise.
-	* testsuite/libffi.call/huge_struct.c: Likewise.
+commit 0612081e6c161d9d820742f995975d35da2adbc2
+Author: Zachary Waldowski <zwaldowski@gmail.com>
+Date:   Sat Nov 30 03:03:00 2013 -0500
 
-2010-08-05  Dan Witte  <dwitte@mozilla.com>
+    Darwin: Misc size_t warnings
 
-        * Makefile.am: Pass FFI_DEBUG define to msvcc.sh for linking to the
-        debug CRT when --enable-debug is given.
-        * configure.ac: Define it.
-        * msvcc.sh: Translate -g and -DFFI_DEBUG appropriately.
+commit 6a6247d179ec3859311c2d8775841b884f309f66
+Author: Zachary Waldowski <zwaldowski@gmail.com>
+Date:   Sat Nov 30 02:55:48 2013 -0500
 
-2010-08-04  Dan Witte  <dwitte@mozilla.com>
+    Darwin: Fix dlmalloc warnings due to sizeof(size_t)
 
-	* src/x86/ffitarget.h: Add X86_ANY define for all x86/x86_64
-	platforms.
-	* src/x86/ffi.c: Remove redundant ifdef checks.
-	* src/prep_cif.c: Push stack space computation into src/x86/ffi.c
-	for X86_ANY so return value space doesn't get added twice.
+commit 4d60d9e1e32de6166ffd63bbe9ce54cf961c78fc
+Author: Zachary Waldowski <zwaldowski@gmail.com>
+Date:   Sat Nov 30 04:09:30 2013 -0500
 
-2010-08-03  Neil Rashbrooke <neil@parkwaycc.co.uk>
+    Darwin: Rebuild Xcode project
 
-	* msvcc.sh: Don't pass -safeseh to ml64 because behavior is buggy.
+commit cb719a5c1c2eb391d6a5f5e02484ba4aa990a51b
+Author: Zachary Waldowski <zwaldowski@gmail.com>
+Date:   Sat Nov 30 04:09:18 2013 -0500
 
-2010-07-22  Dan Witte  <dwitte@mozilla.com>
+    Darwin/iOS: Fix LLVM 3.3 warning re: memcpy.
 
-	* src/*/ffitarget.h: Make FFI_LAST_ABI one past the last valid ABI.
-	* src/prep_cif.c: Fix ABI assertion.
-        * src/cris/ffi.c: Ditto.
+commit 21bde92c9abb378f9c456a9d95e6f9b99ef8c920
+Author: Zachary Waldowski <zwaldowski@gmail.com>
+Date:   Sat Nov 30 03:43:42 2013 -0500
 
-2010-07-10  Evan Phoenix  <evan@fallingsnow.net>
+    Darwin: Clean up, modernize generator scripts
 
-	* src/closures.c (selinux_enabled_check): Fix strncmp usage bug.
+commit fd54eab74cef7891e4acaaafb71e783142ecb69e
+Author: Zachary Waldowski <zwaldowski@gmail.com>
+Date:   Sat Nov 30 03:38:02 2013 -0500
 
-2010-07-07  Dan Horák <dan@danny.cz>
+    Darwin/Mac: Also exclude OS X generated source
 
-	* include/ffi.h.in: Protect #define with #ifndef.
-	* src/powerpc/ffitarget.h: Ditto.
-	* src/s390/ffitarget.h: Ditto.
-	* src/sparc/ffitarget.h: Ditto.
+commit 953b6f14c655141f9e7d82550a312c3eeb961091
+Author: Zachary Waldowski <zwaldowski@gmail.com>
+Date:   Tue Apr 24 11:16:20 2012 -0400
 
-2010-07-07   Neil Roberts <neil@linux.intel.com>
+    Darwin/iOS: More unified syntax support w/ Clang.
+    
+    Signed-off-by: Zachary Waldowski <zwaldowski@gmail.com>
 
-	* src/x86/sysv.S (ffi_call_SYSV): Align the stack pointer to
-	16-bytes.
+commit c713a55379481c339877f2e0003d97cb8d9ed80e
+Author: Zachary Waldowski <zwaldowski@gmail.com>
+Date:   Tue Apr 24 10:25:29 2012 -0400
 
-2010-07-02  Jakub Jelinek  <jakub@redhat.com>
+    Darwin/iOS: Simplify RETLDM arguments for LLVM 3.1
+    
+    Signed-off-by: Zachary Waldowski <zwaldowski@gmail.com>
 
-	* Makefile.am (AM_MAKEFLAGS): Pass also mandir to submakes.
-	* Makefile.in: Regenerated.
+commit 16ba1b80028db5cb71cf86e5f79f5e48317f83c8
+Author: Zachary Waldowski <zwaldowski@gmail.com>
+Date:   Wed Apr 11 23:26:04 2012 -0400
 
-2010-05-19  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+    Darwin: Silence Clang warnings.
 
-	* configure.ac (libffi_cv_as_x86_pcrel): Check for illegal in as
-	output, too.
-	(libffi_cv_as_ascii_pseudo_op): Check for .ascii.
-	(libffi_cv_as_string_pseudo_op): Check for .string.
-	* configure: Regenerate.
-	* fficonfig.h.in: Regenerate.
-	* src/x86/sysv.S (.eh_frame): Use .ascii, .string or error.
+commit 852ac3bd302d6ed97b1ef65f4cbed69c258a48df
+Merge: ab79d6e ac75368
+Author: Anthony Green <green@moxielogic.com>
+Date:   Thu Nov 21 21:25:44 2013 -0500
 
-2010-05-11  Dan Witte  <dwitte@mozilla.com>
+    Merge branch 'master' of github.com:/atgreen/libffi
+    
+    Conflicts:
+    	ChangeLog
 
-	* doc/libffi.tex: Document previous change.
+commit ab79d6e21992dd86139ba07530ff888833b78a04
+Author: Alan Modra <amodra@gmail.com>
+Date:   Thu Nov 21 06:12:35 2013 -0500
 
-2010-05-11  Makoto Kato <m_kato@ga2.so-net.ne.jp>
+    This separates the 32-bit sysv/linux/bsd code from the 64-bit linux
+    code, and makes it possible to link code compiled with different
+    options to those used to compile libffi.  For example, a
+    -mlong-double-128 libffi can be used with -mlong-double-64 code.
+    
+    Using the return value area as a place to pass parameters wasn't such
+    a good idea, causing a failure of cls_ulonglong.c.  I didn't see this
+    when running the mainline gcc libffi testsuite because that version of
+    the test is inferior to the upstreamm libffi test.
+    
+    Using NUM_FPR_ARG_REGISTERS rather than NUM_FPR_ARG_REGISTERS64 meant
+    that a parameter save area could be allocated before it was strictly
+    necessary.  Wrong but harmless.  Found when splitting apart ffi.c
+    into 32-bit and 64-bit support.
 
-	* src/x86/ffi.c (ffi_call): Don't copy structs passed by value.
+commit ac7536889334d4be50709006d7e23536364d7891
+Author: Alan Modra <amodra@gmail.com>
+Date:   Thu Nov 21 06:12:35 2013 -0500
 
-2010-05-05  Michael Kohler <michaelkohler@live.com>
+    This separates the 32-bit sysv/linux/bsd code from the 64-bit linux
+    code, and makes it possible to link code compiled with different
+    options to those used to compile libffi.  For example, a
+    -mlong-double-128 libffi can be used with -mlong-double-64 code.
+    
+    Using the return value area as a place to pass parameters wasn't such
+    a good idea, causing a failure of cls_ulonglong.c.  I didn't see this
+    when running the mainline gcc libffi testsuite because that version of
+    the test is inferior to the upstreamm libffi test.
+    
+    Using NUM_FPR_ARG_REGISTERS rather than NUM_FPR_ARG_REGISTERS64 meant
+    that a parameter save area could be allocated before it was strictly
+    necessary.  Wrong but harmless.  Found when splitting apart ffi.c
+    into 32-bit and 64-bit support.
 
-	* src/dlmalloc.c (dlfree): Fix spelling.
-	* src/ia64/ffi.c (ffi_prep_cif_machdep): Ditto.
-	* configure.ac: Ditto.
-	* configure: Rebuilt.
+commit 69df91cfb4fa6bcb644350a80bff970f27478a6a
+Merge: 2f45082 aa1f62c
+Author: Anthony Green <green@moxielogic.com>
+Date:   Mon Nov 18 06:34:04 2013 -0800
 
-2010-04-13  Dan Witte  <dwitte@mozilla.com>
+    Merge pull request #59 from iains/powerpc-darwin-unwind-fix
+    
+    Fix PowerPC Darwin FDE encodings to use pcrel correctly.  Modernise the picbase labels.
 
-	* msvcc.sh: Build with -W3 instead of -Wall.
-	* src/powerpc/ffi_darwin.c: Remove build warnings.
-	* src/x86/ffi.c: Ditto.
-	* src/x86/ffitarget.h: Ditto.
+commit aa1f62c0a093c30325dff1d4d2b6b4b22eb96929
+Author: Iain Sandoe <iain@codesourcery.com>
+Date:   Mon Nov 18 13:11:56 2013 +0000
 
-2010-04-12  Dan Witte  <dwitte@mozilla.com>
-	    Walter Meinl <wuno@lsvw.de>
+    Fix PowerPC Darwin FDE encodings to use pcrel correctly.  Modernise the picbase labels.
 
-	* configure.ac: Add OS/2 support.
-	* configure: Rebuilt.
-	* src/closures.c: Ditto.
-	* src/dlmalloc.c: Ditto.
-	* src/x86/win32.S: Ditto.
+commit 2f450822a8698ba88441c56d152c7dc8924b127f
+Author: Anthony Green <green@moxielogic.com>
+Date:   Mon Nov 18 06:52:29 2013 -0500
 
-2010-04-07  Jakub Jelinek  <jakub@redhat.com>
+    Clean up code to appease modern GCC compiler.
 
-	* testsuite/libffi.call/err_bad_abi.c: Remove unused args variable.
+commit 16d56c51aded374730920a4acde76ff3d2860ae1
+Author: Alan Modra <amodra@gmail.com>
+Date:   Mon Nov 18 06:36:03 2013 -0500
 
-2010-04-02  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+    An #endif in the wrong place would cause compile failure on powerpcle.
+    Using bl instead of b doesn't cause runtime failures as you might think,
+    but does mess the processor branch prediction.
 
-	* Makefile.in: Regenerate.
-	* aclocal.m4: Regenerate.
-	* include/Makefile.in: Regenerate.
-	* man/Makefile.in: Regenerate.
-	* testsuite/Makefile.in: Regenerate.
+commit 34f878a5ef28663f6b1d7fd26fb099429ea1579e
+Merge: 83f65b6 1fd0457
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Nov 16 06:57:54 2013 -0500
 
-2010-03-30  Dan Witte  <dwitte@mozilla.com>
+    Merge branch 'master' of github.com:/atgreen/libffi
+    
+    Conflicts:
+    	ChangeLog
+    	src/powerpc/ffi.c
 
-	* msvcc.sh: Disable build warnings.
-	* README (tested): Clarify windows build procedure.
+commit 83f65b63d9764a9cc7688fc5cda5ee2bd23faf54
+Author: Alan Modra <amodra@gmail.com>
+Date:   Sat Nov 16 06:53:50 2013 -0500
 
-2010-03-15  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+    Finally, this adds _CALL_ELF == 2 support.  ELFv1 objects can't be
+    linked with ELFv2 objects, so this is one case where preprocessor
+    tests in ffi.c are fine.  Also, there is no need to define a new
+    FFI_ELFv2 or somesuch value in enum ffi_abi.  FFI_LINUX64 will happily
+    serve both ABIs.
 
-	* configure.ac (libffi_cv_as_x86_64_unwind_section_type): New test.
-	* configure: Regenerate.
-	* fficonfig.h.in: Regenerate.
-	* libffi/src/x86/unix64.S (.eh_frame)
-	[HAVE_AS_X86_64_UNWIND_SECTION_TYPE]: Use @unwind section type.
+commit 1fd045784cac874b5d76b7fa931f67209a8280d3
+Author: Alan Modra <amodra@gmail.com>
+Date:   Sat Nov 16 06:53:50 2013 -0500
 
-2010-03-14  Matthias Klose  <doko@ubuntu.com>
+    Finally, this adds _CALL_ELF == 2 support.  ELFv1 objects can't be
+    linked with ELFv2 objects, so this is one case where preprocessor
+    tests in ffi.c are fine.  Also, there is no need to define a new
+    FFI_ELFv2 or somesuch value in enum ffi_abi.  FFI_LINUX64 will happily
+    serve both ABIs.
 
-	* src/x86/ffi64.c: Fix typo in comment.
-	* src/x86/ffi.c: Use /* ... */ comment style.
+commit 362851379a49ce07d3e36e82c4e5c7b6cc16a352
+Author: Alan Modra <amodra@gmail.com>
+Date:   Sat Nov 16 06:52:43 2013 -0500
 
-2010-02-24  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+    Andreas' 2013-02-08 change reverted some breakage for struct return
+    values from 2011-11-12, but in so doing reintroduced string
+    instructions to sysv.S that are not supported on all powerpc variants.
+    This patch properly copies the bounce buffer to destination in C code
+    rather than in asm.
+    
+    I have tested this on powerpc64-linux, powerpc-linux and
+    powerpc-freebsd.  Well, the last on powerpc-linux by lying to
+    configure with
+    
+    CC="gcc -m32 -msvr4-struct-return -mlong-double-64" \
+    CXX="g++ -m32 -msvr4-struct-return -mlong-double-64" \
+    /src/libffi-current/configure --build=powerpc-freebsd
+    
+    and then
+    
+    make && make CC="gcc -m32" CXX="g++ -m32" \
+    RUNTESTFLAGS=--target_board=unix/-m32/-msvr4-struct-return/-mlong-double-64\
+     check
 
-	* doc/libffi.texi (The Closure API): Fix typo.
-	* doc/libffi.info: Remove.
+commit 1c06515d927d9de1582438d4eb5953890e79c5c7
+Author: Alan Modra <amodra@gmail.com>
+Date:   Sat Nov 16 06:41:36 2013 -0500
 
-2010-02-15  Matthias Klose  <doko@ubuntu.com>
+    The powerpc64 ABIs align structs passed by value, a fact ignored by
+    gcc for quite some time.  Since gcc now does the correct alignment,
+    libffi needs to follow suit.  This ought to be made selectable via
+    a new abi value, and the #ifdefs removed from ffi.c along with many
+    other #ifdefs present there and in assembly.  I'll do that with a
+    followup patch sometime.
+    
+    This is a revised version of
+    https://sourceware.org/ml/libffi-discuss/2013/msg00162.html
 
-	* src/arm/sysv.S (__ARM_ARCH__): Define for processor
-	__ARM_ARCH_7EM__.
+commit a97cf1fae575d8bfd5259c5c422025ad43911326
+Author: Alan Modra <amodra@gmail.com>
+Date:   Sat Nov 16 06:40:13 2013 -0500
 
-2010-01-15  Anthony Green  <green@redhat.com>
+    This patch prepares for ELFv2, where sizes of these areas change.  It
+    also makes some minor changes to improve code efficiency.
 
-	* README: Add notes on building with Microsoft Visual C++.
+commit 164283f4ac5972ce2ab5e015cc2ab1014c23276c
+Author: Alan Modra <amodra@gmail.com>
+Date:   Sat Nov 16 06:38:55 2013 -0500
 
-2010-01-15  Daniel Witte  <dwitte@mozilla.com>
+    The powerpc64 support opted to pass floating point values both in the
+    fpr area and the parameter save area, necessary when the backend
+    doesn't know if a function argument corresponds to the ellipsis
+    arguments of a variadic function.  This patch adds powerpc support for
+    variadic functions, and changes the code to only pass fp in the ABI
+    mandated area.  ELFv2 needs this change since the parameter save area
+    may not exist there.
+    
+    This also fixes two faulty tests that used a non-variadic function
+    cast to call a variadic function, and spuriously reasoned that this is
+    somehow necessary for static functions..
 
-	* msvcc.sh: New file.
+commit 31257b3189f81a199bc2902c22bc5f2d7c54ccde
+Author: Andrew Haley <aph@redhat.com>
+Date:   Sat Nov 16 06:35:51 2013 -0500
 
-	* src/x86/win32.S: Port assembly routines to MSVC and #ifdef.
-	* src/x86/ffi.c: Tweak function declaration and remove excess
-	parens.
-	* include/ffi.h.in: Add __declspec(align(8)) to typedef struct
-	ffi_closure.
+    Fix sample closure code
 
-	* src/x86/ffi.c: Merge ffi_call_SYSV and ffi_call_STDCALL into new
-	function ffi_call_win32 on X86_WIN32.
-	* src/x86/win32.S (ffi_call_SYSV): Rename to ffi_call_win32.
-	(ffi_call_STDCALL): Remove.
+commit db0ace3a38496af73eae3df02ef353736d16909f
+Author: Andrew Haley <aph@redhat.com>
+Date:   Sat Nov 16 06:29:25 2013 -0500
 
-	* src/prep_cif.c (ffi_prep_cif): Move stack space allocation code
-	to ffi_prep_cif_machdep for x86.
-	* src/x86/ffi.c (ffi_prep_cif_machdep): To here.
+    Fix broken test cases
 
-2010-01-15  Oliver Kiddle  <okiddle@yahoo.co.uk>
+commit de10f5039ed7a53382ddcc95c368d03e535edb98
+Merge: 58c2577 f3657da
+Author: Anthony Green <green@moxielogic.com>
+Date:   Thu Nov 14 10:56:29 2013 -0500
 
-	* src/x86/ffitarget.h (ffi_abi): Check for __i386 and __amd64 for
-	Sun Studio compiler compatibility.
+    Merge branch 'master' of https://github.com/bivab/libffi
+    
+    Conflicts:
+    	ChangeLog
 
-2010-01-12  Conrad Irwin <conrad.irwin@gmail.com>
+commit f3657da278dd63afcdd8762894a9bdaea8ef028a
+Author: David Schneider <david.schneider@bivab.de>
+Date:   Thu Nov 14 13:02:16 2013 +0100
 
-	* doc/libffi.texi: Add closure example.
+    update Changelog
 
-2010-01-07  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+commit 58c2577a3ff80e7416ef0434769e2af23365719c
+Author: Alan Modra <amodra@gmail.com>
+Date:   Wed Nov 13 16:55:36 2013 -0500
 
-	PR libffi/40701
-	* testsuite/libffi.call/ffitest.h [__alpha__ && __osf__] (PRIdLL,
-	PRIuLL, PRId64, PRIu64, PRIuPTR): Define.
-	* testsuite/libffi.call/cls_align_sint64.c: Add -Wno-format on
-	alpha*-dec-osf*.
-	* testsuite/libffi.call/cls_align_uint64.c: Likewise.
-	* testsuite/libffi.call/cls_ulonglong.c: Likewise.
-	* testsuite/libffi.call/return_ll1.c: Likewise.
-	* testsuite/libffi.call/stret_medium2.c: Likewise.
-	* testsuite/libffi.special/ffitestcxx.h (allocate_mmap): Cast
-	MAP_FAILED to char *.
+    This enshrines the current testsuite practice of using ffi_arg for
+    returned values.  It would be reasonable and logical to use the actual
+    return argument type as passed to ffi_prep_cif, but this would mean
+    changing a large number of tests that use ffi_arg and all backends
+    that write results to an ffi_arg.
 
-2010-01-06  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+commit 8af42f9944f7ed72c81ae360aac6a84dc11f89dc
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Nov 13 16:40:28 2013 -0500
 
-	* src/mips/n32.S: Use .abicalls and .eh_frame with __GNUC__.
+    Respect HAVE_ALLOCA_H
 
-2009-12-31  Anthony Green  <green@redhat.com>
+commit cdf405d574f479b782454516366bd4f4b9b3415e
+Author: David Schneider <david.schneider@bivab.de>
+Date:   Wed Nov 13 15:50:21 2013 +0100
 
-	* README: Update for libffi 3.0.9.
+    add a testcase for the double/float issue on ARMHF
 
-2009-12-27  Matthias Klose  <doko@ubuntu.com>
+commit 77f823e31ffb557a466b24f7fba845fbf7831798
+Author: David Schneider <david.schneider@bivab.de>
+Date:   Wed Nov 13 14:26:57 2013 +0100
 
-	* configure.ac (HAVE_LONG_DOUBLE): Define for mips when
-	appropriate.
-	* configure: Rebuilt.
+    stop trying to assing vfp regs once we are done with the registers
 
-2009-12-26  Anthony Green  <green@redhat.com>
+commit 37067ec5036f2a6ed7a4799f83f8f53160460344
+Author: David Schneider <david.schneider@bivab.de>
+Date:   Tue Nov 12 19:49:01 2013 +0100
 
-	* testsuite/libffi.call/cls_longdouble_va.c: Mark as xfail for
-	avr32*-*-*.
-	* testsuite/libffi.call/cls_double_va.c: Ditto.
+    mark all vfp registers as used when done.
+    
+    To avoid assigning registers the would fit, once arguments have been on
+    the stack, we mark all registers as used once we do not find a free
+    register for the first time.
 
-2009-12-26  Andreas Tobler  <a.tobler@schweiz.org>
+commit 2f5b7ce545473a7f6e41193edc29407cbebe82d5
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Nov 9 06:16:32 2013 -0500
 
-	* testsuite/libffi.call/ffitest.h: Conditionally include stdint.h
-	and inttypes.h.
-	* testsuite/libffi.special/unwindtest.cc: Ditto.
+    UltraSPARC IIi fix.  Update README and build configury.
 
-2009-12-26  Andreas Tobler  <a.tobler@schweiz.org>
+commit becd754434173032f426d22ffcbfe24f55b3c137
+Author: Mark Kettenis <kettenis@gnu.org>
+Date:   Wed Nov 6 06:43:49 2013 -0500
 
-	* configure.ac: Add amd64-*-openbsd*.
-	* configure: Rebuilt.
-	* testsuite/lib/libffi-dg.exp (libffi_target_compile): Link
-	openbsd programs with -lpthread.
+    Align the stack pointer to 16-bytes.
 
-2009-12-26  Anthony Green  <green@redhat.com>
+commit 05c31093409f7b3e6d795fac21d2c954313d8162
+Author: Konstantin Belousov <kib@freebsd.org>
+Date:   Wed Nov 6 06:40:58 2013 -0500
 
-	* testsuite/libffi.call/cls_double_va.c,
-	testsuite/libffi.call/cls_longdouble.c,
-	testsuite/libffi.call/cls_longdouble_va.c,
-	testsuite/libffi.call/cls_pointer.c,
-	testsuite/libffi.call/cls_pointer_stack.c: Remove xfail for
-	mips*-*-* and arm*-*-*.
-	* testsuite/libffi.call/cls_align_longdouble_split.c,
-	testsuite/libffi.call/cls_align_longdouble_split2.c,
-	testsuite/libffi.call/stret_medium2.c,
-	testsuite/libffi.call/stret_medium.c,
-	testsuite/libffi.call/stret_large.c,
-	testsuite/libffi.call/stret_large2.c: Remove xfail for arm*-*-*.
+    Mark executable as not requiring executable stack.
 
-2009-12-31  Kay Tietz  <ktietz70@googlemail.com>
+commit cf6bf9818e8394cfcdb07a40c6a5e2ee6b01d333
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Nov 2 17:23:59 2013 -0400
 
-	* testsuite/libffi.call/ffitest.h,
-	testsuite/libffi.special/ffitestcxx.h (PRIdLL, PRuLL): Fix
-	definitions.
+    Fix up docs
 
-2009-12-31  Carlo Bramini  <carlo.bramix@libero.it>
+commit 02177176854d16fc0f1a5958aa34da2f306630ee
+Merge: c242217 c265b4c
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Nov 2 17:11:22 2013 -0400
 
-	* configure.ac (AM_LTLDFLAGS): Define for windows hosts.
-	* Makefile.am (libffi_la_LDFLAGS): Add AM_LTLDFLAGS.
-	* configure: Rebuilt.
-	* Makefile.in: Rebuilt.
+    Merge branch 'master' of github.com:/atgreen/libffi
 
-2009-12-31  Anthony Green  <green@redhat.com>
-	    Blake Chaffin.
+commit c2422174b3edc0de0b148dfd6b67087bb881c4a6
+Merge: f4b843f d918d47
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Nov 2 14:08:23 2013 -0700
 
-	* testsuite/libffi.call/huge_struct.c: New test case from Blake
-	Chaffin @ Apple.
+    Merge pull request #45 from foss-for-synopsys-dwc-arc-processors/arc_support
+    
+    arc: Fix build error
 
-2009-12-28  David Edelsohn  <edelsohn@gnu.org>
+commit c265b4cacb9130f042699a85de9c7242b3f49cc3
+Merge: f4b843f d918d47
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Nov 2 14:08:23 2013 -0700
 
-	* src/powerpc/ffi_darwin.c (ffi_prep_args): Copy abi and nargs to
-	local variables.
-	(aix_adjust_aggregate_sizes): New function.
-	(ffi_prep_cif_machdep): Call it.
+    Merge pull request #45 from foss-for-synopsys-dwc-arc-processors/arc_support
+    
+    arc: Fix build error
 
-2009-12-26  Andreas Tobler  <a.tobler@schweiz.org>
+commit f4b843f83710ac378c48abd87fe66bb519d30d2e
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Nov 2 17:01:15 2013 -0400
 
-	* configure.ac: Define FFI_MMAP_EXEC_WRIT for the given targets.
-	* configure: Regenerate.
-	* fficonfig.h.in: Likewise.
-	* src/closures.c: Remove the FFI_MMAP_EXEC_WRIT definition for
-	Solaris/x86.
+    Don't align stack for win32
 
-2009-12-26  Andreas Schwab  <schwab@linux-m68k.org>
+commit f3cd39345713db8e414cf642b6cb65a4cfe6018c
+Merge: 666f3e7 6aa1590
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Nov 2 13:17:57 2013 -0700
 
-	* src/powerpc/ffi.c (ffi_prep_args_SYSV): Advance intarg_count
-	when a float arguments is passed in memory.
-	(ffi_closure_helper_SYSV): Mark general registers as used up when
-	a 64bit or soft-float long double argument is passed in memory.
+    Merge pull request #51 from vbudovski/for_upstream
+    
+    Don't use 16 byte aligned stack for WIN32
 
-2009-12-25  Matthias Klose  <doko@ubuntu.com>
+commit 666f3e71b56d92c49fcd2d7f349b8f8ebca0f8a3
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Oct 26 09:12:42 2013 -0400
 
-	* man/ffi_call.3: Fix #include in examples.
-	* doc/libffi.texi: Add dircategory.
+    Add more credits to README.  Tidy up.
 
-2009-12-25  Frank Everdij <f.p.x.everdij@tudelft.nl>
+commit 73ada14e756bad97fad0e6915a821a3c7e079f81
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Oct 26 09:09:45 2013 -0400
 
-	* include/ffi.h.in: Placed '__GNUC__' ifdef around
-	'__attribute__((aligned(8)))' in ffi_closure, fixes compile for
-	IRIX MIPSPro c99.
-	* include/ffi_common.h: Added '__sgi' define to non
-	'__attribute__((__mode__()))' integer typedefs.
-	* src/mips/ffi.c (ffi_call, ffi_closure_mips_inner_O32,
-	ffi_closure_mips_inner_N32): Added 'defined(_MIPSEB)' to BE check.
-	(ffi_closure_mips_inner_O32, ffi_closure_mips_inner_N32): Added
-	FFI_LONGDOUBLE support and alignment(N32 only).
-	* src/mips/ffitarget.h: Corrected '#include <sgidefs.h>' for IRIX and
-	fixed non '__attribute__((__mode__()))' integer typedefs.
-	* src/mips/n32.S: Put '#ifdef linux' around '.abicalls' and '.eh_frame'
-	since they are Linux/GNU Assembler specific.
+    Update README
 
-2009-12-25  Bradley Smith  <brad@brad-smith.co.uk>
+commit d3372c54ce7117e80d389ba875dc5b6b2213c71e
+Author: Mark H Weaver <mhw@netris.org>
+Date:   Sat Oct 26 08:30:06 2013 -0400
 
-	* configure.ac, Makefile.am, src/avr32/ffi.c,
-	src/avr32/ffitarget.h,
-	src/avr32/sysv.S: Add AVR32 port.
-	* configure, Makefile.in: Rebuilt.
+    Fix N32 ABI issue for MIPS.
 
-2009-12-21  Andreas Tobler  <a.tobler@schweiz.org>
+commit d6716aba8118eb0513885cfe557bedebb7016e8b
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Oct 15 15:42:49 2013 -0400
 
-	* configure.ac: Make i?86 build on FreeBSD and OpenBSD.
-	* configure: Regenerate.
+    Update travis-ci build dependencies to include texinfo
 
-2009-12-15  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+commit 16b93a211bcfbe4bd0efdcf94de225a71aa0ee02
+Author: Sandra Loosemore <sandra@codesourcery.com>
+Date:   Tue Oct 15 15:33:59 2013 -0400
 
-	* testsuite/libffi.call/ffitest.h: Define PRIuPTR on PA HP-UX.
+    Add nios2 port.
 
-2009-12-13  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+commit 2f5626ce02fce8267ab48ceb6d7d0ed7d672a75e
+Author: Sandra Loosemore <sandra@codesourcery.com>
+Date:   Tue Oct 15 15:32:16 2013 -0400
 
-	* src/pa/ffi.c (ffi_closure_inner_pa32): Handle FFI_TYPE_LONGDOUBLE
-	type on HP-UX.
+    Fix testsuite bug
 
-2012-02-13  Kai Tietz  <ktietz@redhat.com>
+commit f64e4a865557e440774436b4c2b2fd7374290e97
+Author: Marcus Shawcroft <marcus.shawcroft@arm.com>
+Date:   Tue Oct 15 15:20:14 2013 -0400
 
-	PR libffi/52221
-	* src/x86/ffi.c (ffi_prep_raw_closure_loc): Add thiscall
-	support for X86_WIN32.
-	(FFI_INIT_TRAMPOLINE_THISCALL): Fix displacement.
+    Fix many.c testcase for Aarch64
 
-2009-12-11  Eric Botcazou  <ebotcazou@adacore.com>
+commit 128cd1d2f358f26d9fa75a27cf2b30356f5dd903
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Oct 8 06:45:51 2013 -0400
 
-	* src/sparc/ffi.c (ffi_closure_sparc_inner_v9): Properly align 'long
-	double' arguments.
+    Fix spelling errors
 
-2009-12-11  Eric Botcazou  <ebotcazou@adacore.com>
+commit ff06269d707cafbfef2a88afb07a79c9d1480c5f
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Oct 8 06:32:18 2013 -0400
 
-	* testsuite/libffi.call/ffitest.h: Define PRIuPTR on Solaris < 10.
+    Update README for M88K and VAX
 
-2009-12-10  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+commit d2fcbcdfbea750d1f6a9f493e2e6c4d5ffa71b34
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Oct 8 06:27:46 2013 -0400
 
-	PR libffi/40700
-	* src/closures.c [X86_64 && __sun__ && __svr4__]
-	(FFI_MMAP_EXEC_WRIT): Define.
+    Add m88k and VAX support. Update some configury bits.
 
-2009-12-08  David Daney  <ddaney@caviumnetworks.com>
+commit 6aa15900accc0a648cdebf11ec11d11697ebfffd
+Author: Vitaly Budovski <vbudovski@gmail.com>
+Date:   Thu Sep 5 12:05:06 2013 +1000
 
-	* testsuite/libffi.call/stret_medium.c: Remove xfail for mips*-*-*
-	* testsuite/libffi.call/cls_align_longdouble_split2.c: Same.
-	* testsuite/libffi.call/stret_large.c: Same.
-	* testsuite/libffi.call/cls_align_longdouble_split.c: Same.
-	* testsuite/libffi.call/stret_large2.c: Same.
-	* testsuite/libffi.call/stret_medium2.c: Same.
+    Don't use 16 byte aligned stack for WIN32
+    
+    This fixes a crash when accessing __stdcall functions in Python ctypes.
 
-2009-12-07  David Edelsohn  <edelsohn@gnu.org>
+commit 3b44d41156149af8da2a58825fefdfa23274ae7a
+Author: Makoto Kato <m_kato@ga2.so-net.ne.jp>
+Date:   Wed Jul 10 15:34:53 2013 +0900
 
-	* src/powerpc/aix_closure.S (libffi_closure_ASM): Fix tablejump
-	typo.
+    Fix build failure when using clang for Android
+    
+    clang for Android generates __gnu_linux__ define, but gcc for Android doesn't.  So we should add check it for Android
 
-2009-12-05  David Edelsohn  <edelsohn@gnu.org>
+commit d918d47809c174d62283306b282749f8db93661f
+Author: Mischa Jonker <mjonker@synopsys.com>
+Date:   Mon Jul 8 15:51:36 2013 +0200
 
-	* src/powerpc/aix.S: Update AIX32 code to be consistent with AIX64
-	code.
-	* src/powerpc/aix_closure.S: Same.
+    arc: Fix build error
+    
+    One part of the patch for ARC support was missing in the upstreamed
+    version.
+    
+    Signed-off-by: Mischa Jonker <mjonker@synopsys.com>
 
-2009-12-05  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+commit d3d099b40c122550279789200263346f120f6909
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Jul 2 16:11:38 2013 -0400
 
-	* Makefile.in: Regenerate.
-	* configure: Regenerate.
-	* include/Makefile.in: Regenerate.
-	* man/Makefile.in: Regenerate.
-	* testsuite/Makefile.in: Regenerate.
+    little-endian ppc64 support
 
-2009-12-04  David Edelsohn  <edelsohn@gnu.org>
+commit 0f8690a84c874ec09a090c8c6adfb93c594acac6
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Jul 2 15:54:40 2013 -0400
 
-	* src/powerpc/aix_closure.S: Reorganize 64-bit code to match
-	linux64_closure.S.
+    Rebuild for ARC additions
 
-2009-12-04  Uros Bizjak  <ubizjak@gmail.com>
+commit f88118b345f27c46f5445d6e4832c498ff9a6d85
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Jul 2 15:51:27 2013 -0400
 
-	PR libffi/41908
-	* src/x86/ffi64.c (classify_argument): Update from
-	gcc/config/i386/i386.c.
-	(ffi_closure_unix64_inner): Do not use the address of two consecutive
-	SSE registers directly.
-	* testsuite/libffi.call/cls_dbls_struct.c (main): Remove xfail
-	for x86_64 linux targets.
+    Revert "Merge pull request #36 from abergmeier/emscripten_fix"
+    
+    This reverts commit 6a4d901dde7b3f87984c563505717cde3113d16e, reversing
+    changes made to b50a13b9c07ec09af4b9697e482acdad571e6961.
 
-2009-12-04  David Edelsohn  <edelsohn@gnu.org>
+commit 6a4d901dde7b3f87984c563505717cde3113d16e
+Merge: b50a13b 587002c
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Jul 2 12:12:34 2013 -0700
 
-	* src/powerpc/ffi_darwin.c (ffi_closure_helper_DARWIN): Increment
-	pfr for long double split between fpr13 and stack.
+    Merge pull request #36 from abergmeier/emscripten_fix
+    
+    Fixes for building with Emscripten
 
-2009-12-03  David Edelsohn  <edelsohn@gnu.org>
+commit b50a13b9c07ec09af4b9697e482acdad571e6961
+Merge: 767f1f9 b082e15
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Jul 2 12:10:26 2013 -0700
 
-	* src/powerpc/ffi_darwin.c (ffi_prep_args): Increment next_arg and
-	fparg_count twice for long double.
+    Merge pull request #44 from foss-for-synopsys-dwc-arc-processors/arc_support
+    
+    Add ARC support
 
-2009-12-03  David Edelsohn  <edelsohn@gnu.org>
+commit 767f1f96e5282da44d7340e6815e9820a3f78e39
+Merge: c3c40e0 b8a91d8
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Jul 2 12:08:04 2013 -0700
 
-	PR libffi/42243
-	* src/powerpc/ffi_darwin.c (ffi_prep_args): Remove extra parentheses.
+    Merge pull request #43 from JensTimmerman/__m128
+    
+    added include for xmmintrin.h
 
-2009-12-03  Uros Bizjak  <ubizjak@gmail.com>
+commit b8a91d81be77d479327fdb6bdd9fdae6d18e6e63
+Author: Jens Timmerman <jens.timmerman@ugent.be>
+Date:   Tue Jul 2 10:57:37 2013 +0200
 
-	* testsuite/libffi.call/cls_longdouble_va.c (main): Fix format string.
-	Remove xfails for x86 linux targets.
+    added include for xmmintrin.h
 
-2009-12-02  David Edelsohn  <edelsohn@gnu.org>
+commit b082e15091961373c03d10ed0251f619ebb6ed76
+Author: Mischa Jonker <mjonker@synopsys.com>
+Date:   Mon Jun 10 16:19:33 2013 +0200
 
-	* src/powerpc/ffi_darwin.c (ffi_prep_args): Fix typo in INT64
-	case.
+    Add ARC support
+    
+    This adds support for the ARC architecture to libffi. DesignWare ARC
+    is a family of processors from Synopsys, Inc.
+    
+    This patch has been tested on a little-endian system and passes
+    the testsuite.
+    
+    Signed-off-by: Mischa Jonker <mjonker@synopsys.com>
 
-2009-12-01  David Edelsohn  <edelsohn@gnu.org>
+commit cc9b518687e46b0d1acafdd4bc3f3b281c25a3d9
+Author: Marcin Wojdyr <wojdyr@gmail.com>
+Date:   Tue May 14 15:01:23 2013 +0200
 
-	* src/powerpc/aix.S (ffi_call_AIX): Convert to more standard
-	register usage.  Call ffi_prep_args directly.  Add long double
-	return value support.
-	* src/powerpc/ffi_darwin.c (ffi_prep_args): Double arg increment
-	applies to FFI_TYPE_DOUBLE.  Correct fpr_base increment typo.
-	Separate FFI_TYPE_SINT32 and FFI_TYPE_UINT32 cases.
-	(ffi_prep_cif_machdep): Only 16 byte stack alignment in 64 bit
-	mode.
-	(ffi_closure_helper_DARWIN): Remove nf and ng counters.  Move temp
-	into case.
-	* src/powerpc/aix_closure.S: Maintain 16 byte stack alignment.
-	Allocate result area between params and FPRs.
+    Update libffi.pc.in
+    
+    use -L${toolexeclibdir} instead of -L${libdir}
+    to be consistent with Makefile.am
 
-2009-11-30  David Edelsohn  <edelsohn@gnu.org>
+commit 587002c092cffe6e7a8d7028f246c241d03b738c
+Author: Andreas Bergmeier <andreas.bergmeier@gmx.net>
+Date:   Fri Apr 19 17:12:24 2013 +0200
 
-	PR target/35484
-	* src/powerpc/ffitarget.h (POWERPC64): Define for PPC64 Linux and
-	AIX64.
-	* src/powerpc/aix.S: Implement AIX64 version.
-	* src/powerpc/aix_closure.S: Implement AIX64 version.
-	(ffi_closure_ASM): Use extsb, lha and displament addresses.
-	* src/powerpc/ffi_darwin.c (ffi_prep_args): Implement AIX64
-	support.
-	(ffi_prep_cif_machdep): Same.
-	(ffi_call): Same.
-	(ffi_closure_helper_DARWIN): Same.
+    Enable disabling of libtool on platforms where it does not work (e.g. LLVM).
+    Build libraries normally then.
 
-2009-11-02  Andreas Tobler  <a.tobler@schweiz.org>
+commit c3c40e0290377d7cf948b072eedd8317c4bf215e
+Merge: ede96e4 4750e3c
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Mar 30 05:24:14 2013 -0700
 
-	PR libffi/41908
-	* testsuite/libffi.call/testclosure.c: New test.
+    Merge pull request #34 from davidsch/armhf
+    
+    Fix ARM hard-float support for large numbers of VFP arguments
 
-2009-09-28  Kai Tietz  <kai.tietz@onevision.com>
+commit 4750e3c662fd9569cb3e2d28f539685fd1ca8caf
+Author: David Schneider <david.schneider@bivab.de>
+Date:   Thu Mar 28 16:56:36 2013 +0100
 
-	* src/x86/win64.S (_ffi_call_win64 stack): Remove for gnu
-	assembly version use of ___chkstk.
+    update changelog
 
-2009-09-23  Matthias Klose  <doko@ubuntu.com>
+commit 9708e7cf09f1bf815f4d6485eb1f180fabb35804
+Author: David Schneider <david.schneider@bivab.de>
+Date:   Wed Mar 27 19:31:04 2013 +0100
 
-	PR libffi/40242, PR libffi/41443
-	* src/arm/sysv.S (__ARM_ARCH__): Define for processors
-	__ARM_ARCH_6T2__, __ARM_ARCH_6M__, __ARM_ARCH_7__,
-	__ARM_ARCH_7A__, __ARM_ARCH_7R__, __ARM_ARCH_7M__.
-	Change the conditionals to __SOFTFP__ || __ARM_EABI__
-	for -mfloat-abi=softfp to work.
+    folow the ARM hard-float ABI in ffi_prep_incoming_args_VFP
 
-2009-09-17  Loren J. Rittle  <ljrittle@acm.org>
+commit b41120981e5e49ca2da10b94b154775f50da5f36
+Author: David Schneider <david.schneider@bivab.de>
+Date:   Wed Mar 27 16:38:35 2013 +0100
 
-	PR testsuite/32843 (strikes again)
-	* src/x86/ffi.c (ffi_prep_cif_machdep): Add X86_FREEBSD to
-	enable proper extension on char and short.
+    create separated versions of ffi_prep_incoming_args_* for SYSV and VFP ABIs.
+    
+    The different versions will be called depending on the value of cif->abi
 
-2009-09-15  David Daney  <ddaney@caviumnetworks.com>
+commit dd26f1f39c54861c5b91931f0f37a72942c2a072
+Author: David Schneider <david.schneider@bivab.de>
+Date:   Thu Mar 28 15:39:01 2013 +0100
 
-	* src/java_raw_api.c (ffi_java_raw_to_rvalue): Remove special
-	handling for FFI_TYPE_POINTER.
-	* src/mips/ffitarget.h (FFI_TYPE_STRUCT_D_SOFT,
-	FFI_TYPE_STRUCT_F_SOFT, FFI_TYPE_STRUCT_DD_SOFT,
-	FFI_TYPE_STRUCT_FF_SOFT, FFI_TYPE_STRUCT_FD_SOFT,
-	FFI_TYPE_STRUCT_DF_SOFT, FFI_TYPE_STRUCT_SOFT): New defines.
-	(FFI_N32_SOFT_FLOAT, FFI_N64_SOFT_FLOAT): New ffi_abi enumerations.
-	(enum ffi_abi): Set FFI_DEFAULT_ABI for soft-float.
-	* src/mips/n32.S (ffi_call_N32): Add handling for soft-float
-	structure and pointer returns.
-	(ffi_closure_N32): Add handling for pointer returns.
-	* src/mips/ffi.c (ffi_prep_args, calc_n32_struct_flags,
-	calc_n32_return_struct_flags): Handle soft-float.
-	(ffi_prep_cif_machdep):  Handle soft-float, fix pointer handling.
-	(ffi_call_N32): Declare proper argument types.
-	(ffi_call, copy_struct_N32, ffi_closure_mips_inner_N32): Handle
-	soft-float.
+    add a failing test for closures on ARM hardfloat
 
-2009-08-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+commit 3c1608613ab3c2184222b98c5482cddedd6b559b
+Author: David Schneider <david.schneider@bivab.de>
+Date:   Tue Mar 26 19:24:47 2013 +0100
 
-	* configure.ac (AC_PREREQ): Bump to 2.64.
+    extend ffi_prepare_args for FFI_VFP (hard-float ABI), fixing an issue with passing VFP arguments in VFP registers and the stack, while at the same time not using all core registers.
 
-2009-08-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+commit 0f2ff2d4c92719be8936179f9ab674f4d1a3fd14
+Author: David Schneider <david.schneider@bivab.de>
+Date:   Tue Mar 26 19:22:02 2013 +0100
 
-	* Makefile.am (install-html, install-pdf): Remove.
-	* Makefile.in: Regenerate.
+    separate ARM ffi_prepare_args in a version implementing the simple SYSV calling convention and one for the hard-float calling convention
 
-	* Makefile.in: Regenerate.
-	* aclocal.m4: Regenerate.
-	* configure: Regenerate.
-	* fficonfig.h.in: Regenerate.
-	* include/Makefile.in: Regenerate.
-	* man/Makefile.in: Regenerate.
-	* testsuite/Makefile.in: Regenerate.
+commit 3a352b8a8252400a83de22c7c424bf1887b4a2ef
+Author: David Schneider <david.schneider@bivab.de>
+Date:   Tue Mar 26 14:24:04 2013 +0100
 
-2011-08-22  Jasper Lievisse Adriaanse <jasper@openbsd.org>
+    move the hardfloat specific argument copying code to the helper function
 
-	* configure.ac: Add OpenBSD/hppa and OpenBSD/powerpc support.
-	* configure: Rebuilt.
+commit 5df6b7944a4225b6eb329f3886be64e04e966f29
+Author: David Schneider <david.schneider@bivab.de>
+Date:   Tue Mar 26 14:02:21 2013 +0100
 
-2009-07-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+    extract setting of arguments to be passed to a helper function
 
-	* configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.
+commit 7d1048c471bb4b1f9d67a9e9f8e95f9a1d2e6d45
+Author: David Schneider <david.schneider@bivab.de>
+Date:   Tue Mar 26 11:33:33 2013 +0100
 
-2009-07-24  Dave Korn  <dave.korn.cygwin@gmail.com>
+    extract code to align the argument storage pointer to a helper function
 
-	PR libffi/40807
-	* src/x86/ffi.c (ffi_prep_cif_machdep): Also use sign/zero-extending
-	return types for X86_WIN32.
-	* src/x86/win32.S (_ffi_call_SYSV): Handle omitted return types.
-	(_ffi_call_STDCALL, _ffi_closure_SYSV, _ffi_closure_raw_SYSV,
-	_ffi_closure_STDCALL): Likewise.
+commit b9f013788f0f384c423ad963475aaacb55598135
+Author: David Schneider <david.schneider@bivab.de>
+Date:   Mon Mar 25 13:27:36 2013 +0100
 
-	* src/closures.c (is_selinux_enabled): Define to const 0 for Cygwin.
-	(dlmmap, dlmunmap): Also use these functions on Cygwin.
+    add a testcase, that on ARM hardfloat needs more than the 8  VFP argument registers to pass arguments to a call
 
-2009-07-11  Richard Sandiford  <rdsandiford@googlemail.com>
+commit 2fbdb0f231cafdb77b025d3cd8afe90cda99b3ba
+Author: David Schneider <david.schneider@bivab.de>
+Date:   Mon Mar 25 13:26:02 2013 +0100
 
-	PR testsuite/40699
-	PR testsuite/40707
-	PR testsuite/40709
-	* testsuite/lib/libffi-dg.exp: Revert 2009-07-02, 2009-07-01 and
-	2009-06-30 commits.
+    use the absolute value to check the test result against an epsilon
 
-2009-07-01  Richard Sandiford  <r.sandiford@uk.ibm.com>
+commit ede96e4eb660bbf3e0fe048135efa8106f48af5d
+Merge: f22ab3c 9e34992
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sun Mar 17 18:38:21 2013 -0400
 
-	* testsuite/lib/libffi-dg.exp (libffi-init): Set ld_library_path
-	to "" before adding paths.  (This reinstates an assignment that
-	was removed by my 2009-06-30 commit, but changes the initial
-	value from "." to "".)
+    Merge branch 'master' of github.com:/atgreen/libffi
 
-2009-07-01  H.J. Lu  <hongjiu.lu@intel.com>
+commit f22ab3c6877cbdd07f058b68816b0086b1cb0e1e
+Merge: 12b1886 d08124b
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sun Mar 17 18:34:54 2013 -0400
 
-	PR testsuite/40601
-	* testsuite/lib/libffi-dg.exp (libffi-init): Properly set
-	gccdir.  Adjust ld_library_path for gcc only if gccdir isn't
-	empty.
+    Merge branch 'master' of github.com:/atgreen/libffi
 
-2009-06-30  Richard Sandiford  <r.sandiford@uk.ibm.com>
+commit 9e34992a5ea2fda1dba5875bf96dc91a7230f51f
+Merge: 12b1886 d08124b
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sun Mar 17 18:34:54 2013 -0400
 
-	* testsuite/lib/libffi-dg.exp (libffi-init): Don't add "."
-	to ld_library_path.  Use add_path.  Add just find_libgcc_s
-	to ld_library_path, not every libgcc multilib directory.
+    Merge branch 'master' of github.com:/atgreen/libffi
 
-2009-06-16  Wim Lewis  <wiml@hhhh.org>
+commit 12b1886d7b1f8aa264b1d348bfa47a0e14712df4
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sun Mar 17 18:32:12 2013 -0400
 
-	* src/powerpc/ffi.c: Avoid clobbering cr3 and cr4, which are
-	supposed to be callee-saved.
-	* src/powerpc/sysv.S (small_struct_return_value): Fix overrun of
-	return buffer for odd-size structs.
+    cygwin fix & updates for 3.0.13
 
-2009-06-16  Andreas Tobler  <a.tobler@schweiz.org>
+commit d08124bedf2c6d61874fe215404783aeb9f6f1ac
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sun Mar 17 18:32:12 2013 -0400
 
-	PR libffi/40444
-	* testsuite/lib/libffi-dg.exp (libffi_target_compile): Add
-	allow_stack_execute for Darwin.
+    cygwin fix & updates for 3.0.13
 
-2009-06-16  Andrew Haley  <aph@redhat.com>
+commit cb32c812d04d1dfa72002cc04924e7e4fef89e02
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sun Mar 17 09:27:55 2013 -0400
 
-	* configure.ac (TARGETDIR): Add missing blank lines.
-	* configure: Regenerate.
+    Fix lib install dir
 
-2009-06-16  Andrew Haley  <aph@redhat.com>
+commit efd7866a361a6f636bae8400d26c6811e56ca207
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Mar 16 08:35:57 2013 -0400
 
-	* testsuite/libffi.call/cls_align_sint64.c,
-	testsuite/libffi.call/cls_align_uint64.c,
-	testsuite/libffi.call/cls_longdouble_va.c,
-	testsuite/libffi.call/cls_ulonglong.c,
-	testsuite/libffi.call/return_ll1.c,
-	testsuite/libffi.call/stret_medium2.c: Fix printf format
-	specifiers.
-	* testsuite/libffi.call/ffitest.h,
-	testsuite/libffi.special/ffitestcxx.h (PRIdLL, PRIuLL): Define.
+    2.0.13rc1
 
-2009-06-15  Andrew Haley  <aph@redhat.com>
+commit ff647ad4dff2f07dd153f295a1f70b1d906cd6ca
+Merge: 4acf005 d9dd417
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Mar 16 08:20:40 2013 -0400
 
-	* testsuite/libffi.call/err_bad_typedef.c: xfail everywhere.
-	* testsuite/libffi.call/err_bad_abi.c: Likewise.
+    Merge branch 'master' of github.com:/atgreen/libffi
+    
+    Conflicts:
+    	ChangeLog
 
-2009-06-12  Andrew Haley  <aph@redhat.com>
+commit 4acf0056f55c757490dae6c29a65b0321327ea8a
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Mar 16 08:18:45 2013 -0400
 
-	* Makefile.am: Remove info_TEXINFOS.
+    Build fix for soft-float power targets
 
-2009-06-12  Andrew Haley  <aph@redhat.com>
+commit 675c9839224e4268187f1ec6f512127f9db555d0
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Mar 16 08:12:38 2013 -0400
 
-	* ChangeLog.libffi: testsuite/libffi.call/cls_align_sint64.c,
-	testsuite/libffi.call/cls_align_uint64.c,
-	testsuite/libffi.call/cls_ulonglong.c,
-	testsuite/libffi.call/return_ll1.c,
-	testsuite/libffi.call/stret_medium2.c: Fix printf format
-	specifiers.
-	testsuite/libffi.special/unwindtest.cc: include stdint.h.
+    Documentation fix
 
-2009-06-11  Timothy Wall  <twall@users.sf.net>
+commit 8a286f570ccd41db81f74ea7f248da62241d898a
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Mar 16 08:01:19 2013 -0400
 
-	* Makefile.am,
-	configure.ac,
-	include/ffi.h.in,
-	include/ffi_common.h,
-	src/closures.c,
-	src/dlmalloc.c,
-	src/x86/ffi.c,
-	src/x86/ffitarget.h,
-	src/x86/win64.S (new),
-	README: Added win64 support (mingw or MSVC)
-	* Makefile.in,
-	include/Makefile.in,
-	man/Makefile.in,
-	testsuite/Makefile.in,
-	configure,
-	aclocal.m4: Regenerated
-	* ltcf-c.sh: properly escape cygwin/w32 path
-	* man/ffi_call.3: Clarify size requirements for return value.
-	* src/x86/ffi64.c: Fix filename in comment.
-	* src/x86/win32.S: Remove unused extern.
+    Fix for m68000 systems
 
-	* testsuite/libffi.call/closure_fn0.c,
-	testsuite/libffi.call/closure_fn1.c,
-	testsuite/libffi.call/closure_fn2.c,
-	testsuite/libffi.call/closure_fn3.c,
-	testsuite/libffi.call/closure_fn4.c,
-	testsuite/libffi.call/closure_fn5.c,
-	testsuite/libffi.call/closure_fn6.c,
-	testsuite/libffi.call/closure_stdcall.c,
-	testsuite/libffi.call/cls_12byte.c,
-	testsuite/libffi.call/cls_16byte.c,
-	testsuite/libffi.call/cls_18byte.c,
-	testsuite/libffi.call/cls_19byte.c,
-	testsuite/libffi.call/cls_1_1byte.c,
-	testsuite/libffi.call/cls_20byte.c,
-	testsuite/libffi.call/cls_20byte1.c,
-	testsuite/libffi.call/cls_24byte.c,
-	testsuite/libffi.call/cls_2byte.c,
-	testsuite/libffi.call/cls_3_1byte.c,
-	testsuite/libffi.call/cls_3byte1.c,
- 	testsuite/libffi.call/cls_3byte2.c,
- 	testsuite/libffi.call/cls_4_1byte.c,
- 	testsuite/libffi.call/cls_4byte.c,
- 	testsuite/libffi.call/cls_5_1_byte.c,
- 	testsuite/libffi.call/cls_5byte.c,
- 	testsuite/libffi.call/cls_64byte.c,
- 	testsuite/libffi.call/cls_6_1_byte.c,
- 	testsuite/libffi.call/cls_6byte.c,
- 	testsuite/libffi.call/cls_7_1_byte.c,
- 	testsuite/libffi.call/cls_7byte.c,
- 	testsuite/libffi.call/cls_8byte.c,
- 	testsuite/libffi.call/cls_9byte1.c,
- 	testsuite/libffi.call/cls_9byte2.c,
- 	testsuite/libffi.call/cls_align_double.c,
- 	testsuite/libffi.call/cls_align_float.c,
- 	testsuite/libffi.call/cls_align_longdouble.c,
- 	testsuite/libffi.call/cls_align_longdouble_split.c,
- 	testsuite/libffi.call/cls_align_longdouble_split2.c,
- 	testsuite/libffi.call/cls_align_pointer.c,
- 	testsuite/libffi.call/cls_align_sint16.c,
- 	testsuite/libffi.call/cls_align_sint32.c,
- 	testsuite/libffi.call/cls_align_sint64.c,
- 	testsuite/libffi.call/cls_align_uint16.c,
- 	testsuite/libffi.call/cls_align_uint32.c,
- 	testsuite/libffi.call/cls_align_uint64.c,
- 	testsuite/libffi.call/cls_dbls_struct.c,
- 	testsuite/libffi.call/cls_double.c,
- 	testsuite/libffi.call/cls_double_va.c,
- 	testsuite/libffi.call/cls_float.c,
- 	testsuite/libffi.call/cls_longdouble.c,
- 	testsuite/libffi.call/cls_longdouble_va.c,
- 	testsuite/libffi.call/cls_multi_schar.c,
- 	testsuite/libffi.call/cls_multi_sshort.c,
- 	testsuite/libffi.call/cls_multi_sshortchar.c,
- 	testsuite/libffi.call/cls_multi_uchar.c,
- 	testsuite/libffi.call/cls_multi_ushort.c,
- 	testsuite/libffi.call/cls_multi_ushortchar.c,
- 	testsuite/libffi.call/cls_pointer.c,
- 	testsuite/libffi.call/cls_pointer_stack.c,
- 	testsuite/libffi.call/cls_schar.c,
- 	testsuite/libffi.call/cls_sint.c,
- 	testsuite/libffi.call/cls_sshort.c,
- 	testsuite/libffi.call/cls_uchar.c,
- 	testsuite/libffi.call/cls_uint.c,
- 	testsuite/libffi.call/cls_ulonglong.c,
- 	testsuite/libffi.call/cls_ushort.c,
- 	testsuite/libffi.call/err_bad_abi.c,
- 	testsuite/libffi.call/err_bad_typedef.c,
- 	testsuite/libffi.call/float2.c,
- 	testsuite/libffi.call/huge_struct.c,
- 	testsuite/libffi.call/nested_struct.c,
- 	testsuite/libffi.call/nested_struct1.c,
- 	testsuite/libffi.call/nested_struct10.c,
- 	testsuite/libffi.call/nested_struct2.c,
- 	testsuite/libffi.call/nested_struct3.c,
- 	testsuite/libffi.call/nested_struct4.c,
- 	testsuite/libffi.call/nested_struct5.c,
- 	testsuite/libffi.call/nested_struct6.c,
- 	testsuite/libffi.call/nested_struct7.c,
- 	testsuite/libffi.call/nested_struct8.c,
- 	testsuite/libffi.call/nested_struct9.c,
- 	testsuite/libffi.call/problem1.c,
- 	testsuite/libffi.call/return_ldl.c,
- 	testsuite/libffi.call/return_ll1.c,
- 	testsuite/libffi.call/stret_large.c,
- 	testsuite/libffi.call/stret_large2.c,
- 	testsuite/libffi.call/stret_medium.c,
- 	testsuite/libffi.call/stret_medium2.c,
-	testsuite/libffi.special/unwindtest.cc: use ffi_closure_alloc instead
-	of checking for MMAP.  Use intptr_t instead of long casts.
+commit d9dd417b09566af55b7b3000bb53ccaf2e1d6c92
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Mar 16 08:01:19 2013 -0400
 
-2009-06-11  Kaz Kojima  <kkojima@gcc.gnu.org>
+    Fix for m68000 systems
 
-	* testsuite/libffi.call/cls_longdouble_va.c: Add xfail sh*-*-linux-*.
-	* testsuite/libffi.call/err_bad_abi.c: Add xfail sh*-*-*.
-	* testsuite/libffi.call/err_bad_typedef.c: Likewise.
+commit 215763d012a944d95406b394d6013b80d220e870
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Mar 16 07:57:35 2013 -0400
 
-2009-06-09  Andrew Haley  <aph@redhat.com>
+    Update configury.
 
-	* src/x86/freebsd.S: Add missing file.
+commit 9180d8f39c9b6afe17b78277c2711a5d9948e824
+Merge: 2fb527a 7e1b326
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Mar 16 07:46:55 2013 -0400
 
-2009-06-08  Andrew Haley  <aph@redhat.com>
+    Merge branch 'master' of github.com:/atgreen/libffi
 
-	Import from libffi 3.0.8:
+commit 2fb527a017a4943e176a489ff103231b86464b59
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Mar 16 07:46:38 2013 -0400
 
-	* doc/libffi.texi: New file.
-	* doc/libffi.info: Likewise.
-	* doc/stamp-vti: Likewise.
-	* man/Makefile.am: New file.
-	* man/ffi_call.3: New file.
+    Add Meta processor support
 
-	* Makefile.am (EXTRA_DIST): Add src/x86/darwin64.S,
-	src/dlmalloc.c.
-	(nodist_libffi_la_SOURCES): Add X86_FREEBSD.
+commit 211a9ebf4d1a9801e15e103566aed2b8c42790be
+Merge: f308faf ee18766
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Mar 16 04:24:40 2013 -0700
 
-	* configure.ac: Bump version to 3.0.8.
-	parisc*-*-linux*: Add.
-	i386-*-freebsd* | i386-*-openbsd*: Add.
-	powerpc-*-beos*: Add.
-	AM_CONDITIONAL X86_FREEBSD: Add.
-	AC_CONFIG_FILES: Add man/Makefile.
+    Merge pull request #32 from alex/patch-1
+    
+    Fix for a crasher due to misaligned stack on x86-32.
 
-	* include/ffi.h.in (FFI_FN): Change void (*)() to void (*)(void).
+commit 7e1b32649efd24814e86172e196f390566f9e970
+Merge: f308faf ee18766
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Mar 16 04:24:40 2013 -0700
 
-2009-06-08  Andrew Haley  <aph@redhat.com>
+    Merge pull request #32 from alex/patch-1
+    
+    Fix for a crasher due to misaligned stack on x86-32.
 
-	* README: Import from libffi 3.0.8.
+commit ee18766b169811426c14b011fbb46d81e344f926
+Author: Alex Gaynor <alex.gaynor@gmail.com>
+Date:   Thu Mar 14 15:00:33 2013 -0700
 
-2009-06-08  Andrew Haley  <aph@redhat.com>
+    Fix for a crasher due to misaligned stack on x86-32.
+    
+    Full information on reproduction (using Python's ctypes available here: http://bugs.python.org/issue17423)
 
-	* testsuite/libffi.call/err_bad_abi.c: Add xfails.
-	* testsuite/libffi.call/cls_longdouble_va.c: Add xfails.
-	* testsuite/libffi.call/cls_dbls_struct.c: Add xfail x86_64-*-linux-*.
-	* testsuite/libffi.call/err_bad_typedef.c: Add xfails.
+commit f308faf1eabaf8dc24966ab17fbf94368f46b9c7
+Author: Anthony Green <green@moxielogic.com>
+Date:   Mon Feb 11 14:25:13 2013 -0500
 
-	* testsuite/libffi.call/stret_medium2.c: Add __UNUSED__ to args.
-	* testsuite/libffi.call/stret_medium.c: Likewise.
-	* testsuite/libffi.call/stret_large2.c: Likewise.
-	* testsuite/libffi.call/stret_large.c:  Likewise.
+    Add moxie support.  Release 3.0.12.
 
-2008-12-26  Timothy Wall  <twall@users.sf.net>
+commit 4ea22e54e3b143fe05c413f6dddd236af6bcbfb2
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sun Feb 10 08:48:38 2013 -0500
 
-	* testsuite/libffi.call/cls_longdouble.c,
-	testsuite/libffi.call/cls_longdouble_va.c,
-	testsuite/libffi.call/cls_align_longdouble.c,
-	testsuite/libffi.call/cls_align_longdouble_split.c,
-	testsuite/libffi.call/cls_align_longdouble_split2.c: mark expected
-	failures on x86_64 cygwin/mingw.
+    Update README
 
-2008-12-22  Timothy Wall  <twall@users.sf.net>
+commit 10e77227b6ae85f46f28590bfb09ca3608554358
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sun Feb 10 08:47:26 2013 -0500
 
-	* testsuite/libffi.call/closure_fn0.c,
-	testsuite/libffi.call/closure_fn1.c,
-	testsuite/libffi.call/closure_fn2.c,
-	testsuite/libffi.call/closure_fn3.c,
-	testsuite/libffi.call/closure_fn4.c,
-	testsuite/libffi.call/closure_fn5.c,
-	testsuite/libffi.call/closure_fn6.c,
-	testsuite/libffi.call/closure_loc_fn0.c,
-	testsuite/libffi.call/closure_stdcall.c,
-	testsuite/libffi.call/cls_align_pointer.c,
-	testsuite/libffi.call/cls_pointer.c,
-	testsuite/libffi.call/cls_pointer_stack.c: use portable cast from
-	pointer to integer (intptr_t).
-	* testsuite/libffi.call/cls_longdouble.c: disable for win64.
+    mend
 
-2008-07-24  Anthony Green  <green@redhat.com>
+commit a9521411a53d58f2bf88199242200ceb0d4dae3a
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Feb 9 06:54:40 2013 -0500
 
-	* testsuite/libffi.call/cls_dbls_struct.c,
-	testsuite/libffi.call/cls_double_va.c,
-	testsuite/libffi.call/cls_longdouble.c,
-	testsuite/libffi.call/cls_longdouble_va.c,
-	testsuite/libffi.call/cls_pointer.c,
-	testsuite/libffi.call/cls_pointer_stack.c,
-	testsuite/libffi.call/err_bad_abi.c: Clean up failures from
-	compiler warnings.
+    sparc v8 and testsuite fixes
 
-2008-03-04  Anthony Green  <green@redhat.com>
-	    Blake Chaffin
-	    hos@tamanegi.org
+commit 70b11b47eea93bf43627588d494d0b3b0d062481
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Feb 8 16:12:19 2013 -0500
 
-	* testsuite/libffi.call/cls_align_longdouble_split2.c
-	  testsuite/libffi.call/cls_align_longdouble_split.c
-	  testsuite/libffi.call/cls_dbls_struct.c
-	  testsuite/libffi.call/cls_double_va.c
-	  testsuite/libffi.call/cls_longdouble.c
-	  testsuite/libffi.call/cls_longdouble_va.c
-	  testsuite/libffi.call/cls_pointer.c
-	  testsuite/libffi.call/cls_pointer_stack.c
-	  testsuite/libffi.call/err_bad_abi.c
-	  testsuite/libffi.call/err_bad_typedef.c
-	  testsuite/libffi.call/stret_large2.c
-	  testsuite/libffi.call/stret_large.c
-	  testsuite/libffi.call/stret_medium2.c
-	  testsuite/libffi.call/stret_medium.c: New tests from Apple.
+    Fix small struct passing on ppc
 
-2009-06-05  Andrew Haley  <aph@redhat.com>
+commit 63ba1fa79f7c4ce42de848debe233aab31aecb51
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Feb 8 15:18:19 2013 -0500
 
-	* src/x86/ffitarget.h, src/x86/ffi.c: Merge stdcall changes from
-	libffi.
+    Remove xfail for arm*-*-*.
 
-2009-06-04  Andrew Haley  <aph@redhat.com>
+commit 24fbca4c1d57d4ea628c0a8ba643684daf54a37e
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Feb 8 14:19:56 2013 -0500
 
-	* src/x86/ffitarget.h, src/x86/win32.S, src/x86/ffi.c: Back out
-	stdcall changes.
+    Fix typo
 
-2008-02-26  Anthony Green  <green@redhat.com>
-	    Thomas Heller  <theller@ctypes.org>
+commit b0fa11cb0a94ce6baca058eab9b10e40475e71d6
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Feb 8 14:17:13 2013 -0500
 
-	* src/x86/ffi.c (ffi_closure_SYSV_inner): Change C++ comment to C
-	comment.
+    More man page cleanup
 
-2008-02-03  Timothy Wall  <twall@users.sf.net>
+commit 8bd15d139a58a6e46dc90a1cb2d89f59f32f06c7
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Feb 8 13:56:37 2013 -0500
 
-	* src/x86/ffi.c (FFI_INIT_TRAMPOLINE_STDCALL): Calculate jump return
-	  offset based on code pointer, not data pointer.
+    Fix many.c testcase for ppc
 
-2008-01-31  Timothy Wall <twall@users.sf.net>
+commit 7aab825cf198be85490d3cd80e778d415d85ad9b
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Feb 8 13:26:21 2013 -0500
 
-	* testsuite/libffi.call/closure_stdcall.c: Add test for stdcall
-	closures.
-	* src/x86/ffitarget.h: Increase size of trampoline for stdcall
-	closures.
-	* src/x86/win32.S: Add assembly for stdcall closure.
-	* src/x86/ffi.c: Initialize stdcall closure trampoline.
+    Add missing files to dist
 
-2009-06-04  Andrew Haley  <aph@redhat.com>
+commit cb03ea8f4eb08024e44abe4392edc77b89fbfbad
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Feb 8 12:25:18 2013 -0500
 
-	* include/ffi.h.in: Change void (*)() to void (*)(void).
-	* src/x86/ffi.c: Likewise.
+    sparc v9 fixes for sun tools
 
-2009-06-04  Andrew Haley  <aph@redhat.com>
+commit 35ee8d44f31dd3d3b88083c837dc351593e13cc2
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Feb 8 07:12:41 2013 -0500
 
-	* src/powerpc/ppc_closure.S: Insert licence header.
-	* src/powerpc/linux64_closure.S: Likewise.
-	* src/m68k/sysv.S: Likewise.
+    Fix microblaze big-endian struct issue
 
-	* src/sh64/ffi.c: Change void (*)() to void (*)(void).
-	* src/powerpc/ffi.c: Likewise.
-	* src/powerpc/ffi_darwin.c: Likewise.
-	* src/m32r/ffi.c: Likewise.
-	* src/sh64/ffi.c: Likewise.
-	* src/x86/ffi64.c: Likewise.
-	* src/alpha/ffi.c: Likewise.
-	* src/alpha/osf.S: Likewise.
-	* src/frv/ffi.c: Likewise.
-	* src/s390/ffi.c: Likewise.
-	* src/pa/ffi.c: Likewise.
-	* src/pa/hpux32.S: Likewise.
-	* src/ia64/unix.S: Likewise.
-	* src/ia64/ffi.c: Likewise.
-	* src/sparc/ffi.c: Likewise.
-	* src/mips/ffi.c: Likewise.
-	* src/sh/ffi.c: Likewise.
+commit 9db7e1a958fc484ba149efe027008b9a170395fb
+Author: Anthony Green <green@moxielogic.com>
+Date:   Thu Feb 7 21:06:08 2013 -0500
 
-2008-02-15  David Daney  <ddaney@avtrex.com>
+    Fix botched sparc patch. Update version.
 
-	* src/mips/ffi.c (USE__BUILTIN___CLEAR_CACHE):
-	Define (conditionally), and use it to include cachectl.h.
-	(ffi_prep_closure_loc): Fix cache flushing.
-	* src/mips/ffitarget.h (_ABIN32, _ABI64, _ABIO32): Define.
+commit ce0138e61455f268af326e26908b9680ec2c4bea
+Author: Anthony Green <green@moxielogic.com>
+Date:   Thu Feb 7 18:04:01 2013 -0500
 
-2009-06-04  Andrew Haley  <aph@redhat.com>
+    Update bug report address. rc2.
 
-	include/ffi.h.in,
-	src/arm/ffitarget.h,
-	src/arm/ffi.c,
-	src/arm/sysv.S,
-	src/powerpc/ffitarget.h,
-	src/closures.c,
-	src/sh64/ffitarget.h,
-	src/sh64/ffi.c,
-	src/sh64/sysv.S,
-	src/types.c,
-	src/x86/ffi64.c,
-	src/x86/ffitarget.h,
-	src/x86/win32.S,
-	src/x86/darwin.S,
-	src/x86/ffi.c,
-	src/x86/sysv.S,
-	src/x86/unix64.S,
-	src/alpha/ffitarget.h,
-	src/alpha/ffi.c,
-	src/alpha/osf.S,
-	src/m68k/ffitarget.h,
-	src/frv/ffitarget.h,
-	src/frv/ffi.c,
-	src/s390/ffitarget.h,
-	src/s390/sysv.S,
-	src/cris/ffitarget.h,
-	src/pa/linux.S,
-	src/pa/ffitarget.h,
-	src/pa/ffi.c,
-	src/raw_api.c,
-	src/ia64/ffitarget.h,
-	src/ia64/unix.S,
-	src/ia64/ffi.c,
-	src/ia64/ia64_flags.h,
-	src/java_raw_api.c,
-	src/debug.c,
-	src/sparc/v9.S,
-	src/sparc/ffitarget.h,
-	src/sparc/ffi.c,
-	src/sparc/v8.S,
-	src/mips/ffitarget.h,
-	src/mips/n32.S,
-	src/mips/o32.S,
-	src/mips/ffi.c,
-	src/prep_cif.c,
-	src/sh/ffitarget.h,
-	src/sh/ffi.c,
-	src/sh/sysv.S: Update license text.
+commit fd07c9e40451e0ec1d0475cd54a83d45ccaea2c0
+Author: Anthony Green <green@moxielogic.com>
+Date:   Thu Feb 7 18:00:36 2013 -0500
 
-2009-05-22  Dave Korn  <dave.korn.cygwin@gmail.com>
+    Add cache flushing routine for sun compiler on sparc solaris 2.8
 
-	* src/x86/win32.S (_ffi_closure_STDCALL):  New function.
-	(.eh_frame):  Add FDE for it.
+commit ed6ae9501b2bab45daf93b4935eb0c977635b763
+Author: Anthony Green <green@moxielogic.com>
+Date:   Thu Feb 7 16:43:36 2013 -0500
 
-2009-05-22  Dave Korn  <dave.korn.cygwin@gmail.com>
+    Add libtool-ldflags. Define toolexeclibdir for non-GCC builds.
 
-	* configure.ac:  Also check if assembler supports pc-relative
-	relocs on X86_WIN32 targets.
-	* configure:  Regenerate.
-	* src/x86/win32.S (ffi_prep_args):  Declare extern, not global.
-	(_ffi_call_SYSV):  Add missing function type symbol .def and
-	add EH markup labels.
-	(_ffi_call_STDCALL):  Likewise.
-	(_ffi_closure_SYSV):  Likewise.
-	(_ffi_closure_raw_SYSV):  Likewise.
-	(.eh_frame):  Add hand-crafted EH data.
+commit ffef2e046aaec853be356f0b8770a335185ea9cf
+Author: Anthony Green <green@moxielogic.com>
+Date:   Thu Feb 7 15:47:01 2013 -0500
 
-2009-04-09  Jakub Jelinek  <jakub@redhat.com>
+    x32 and libtool fixes
 
-	* testsuite/lib/libffi-dg.exp: Change copyright header to refer to
-	version 3 of the GNU General Public License and to point readers
-	at the COPYING3 file and the FSF's license web page.
-	* testsuite/libffi.call/call.exp: Likewise.
-	* testsuite/libffi.special/special.exp: Likewise.
+commit 95eecebb2858dc6f1495a61072ff36d0a8127144
+Author: Anthony Green <green@moxielogic.com>
+Date:   Thu Feb 7 15:32:46 2013 -0500
 
-2009-03-01  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+    Remove a.out cruft from dist
 
-	* configure: Regenerate.
+commit 176aa9d2e23d9cd57d6f250692d910b408f9a651
+Author: Anthony Green <green@moxielogic.com>
+Date:   Thu Feb 7 15:29:22 2013 -0500
 
-2008-12-18  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
+    Fix GCC usage test and update README
 
-	PR libffi/26048
-	* configure.ac (HAVE_AS_X86_PCREL): New test.
-	* configure: Regenerate.
-	* fficonfig.h.in: Regenerate.
-	* src/x86/sysv.S [!FFI_NO_RAW_API]: Precalculate
-	RAW_CLOSURE_CIF_OFFSET, RAW_CLOSURE_FUN_OFFSET,
-	RAW_CLOSURE_USER_DATA_OFFSET for the Solaris 10/x86 assembler.
-	(.eh_frame): Only use SYMBOL-. iff HAVE_AS_X86_PCREL.
-	* src/x86/unix64.S (.Lstore_table): Move to .text section.
-	(.Lload_table): Likewise.
-	(.eh_frame): Only use SYMBOL-. iff HAVE_AS_X86_PCREL.
+commit f3a4f3fdde89b04d66983a42a25d09161c5d4d54
+Author: Anthony Green <green@moxielogic.com>
+Date:   Thu Feb 7 09:57:20 2013 -0500
 
-2008-12-18  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+    Fixes for AIX xlc compiler.
 
-	* configure: Regenerate.
+commit 522f8fef49848927482bc63c94afaea5b84e5ec1
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Feb 6 20:31:31 2013 -0500
 
-2008-11-21  Eric Botcazou  <ebotcazou@adacore.com>
+    Fix man page. Clean out junk.
 
-	* src/sparc/ffi.c (ffi_prep_cif_machdep): Add support for
-	signed/unsigned int8/16 return values.
-	* src/sparc/v8.S (ffi_call_v8): Likewise.
-	(ffi_closure_v8): Likewise.
+commit c4dfa259eb4e8e6f4c397868d7fee80aa0bb6a12
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Feb 6 17:43:24 2013 -0500
 
-2008-09-26  Peter O'Gorman  <pogma@thewrittenword.com>
-	    Steve Ellcey  <sje@cup.hp.com>
+    Bump soversion
 
-	* configure: Regenerate for new libtool.
-	* Makefile.in: Ditto.
-	* include/Makefile.in: Ditto.
-	* aclocal.m4: Ditto.
+commit f62bd63fe6123cadedb8b2b2c72eb549c40fbce9
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Feb 6 17:38:32 2013 -0500
 
-2008-08-25  Andreas Tobler  <a.tobler@schweiz.org>
+    Release candidate 1
 
-	* src/powerpc/ffitarget.h (ffi_abi): Add FFI_LINUX and
-	FFI_LINUX_SOFT_FLOAT to the POWERPC_FREEBSD enum.
-	Add note about flag bits used for FFI_SYSV_TYPE_SMALL_STRUCT.
-	Adjust copyright notice.
-	* src/powerpc/ffi.c: Add two new flags to indicate if we have one
-	register or two register to use for FFI_SYSV structs.
-	(ffi_prep_cif_machdep): Pass the right register flag introduced above.
-	(ffi_closure_helper_SYSV): Fix the return type for
-	FFI_SYSV_TYPE_SMALL_STRUCT. Comment.
-	Adjust copyright notice.
+commit f7cd61e9e68a4a51147df04d75bfe5b91b9d9286
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Feb 6 17:38:04 2013 -0500
 
-2008-07-16  Kaz Kojima  <kkojima@gcc.gnu.org>
+    Fix pkgconfig install bits
 
-	* src/sh/ffi.c (ffi_prep_closure_loc): Turn INSN into an unsigned
-	int.
+commit 6a790129427121f7db2d876e7218a3104e6d2741
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Feb 6 17:37:15 2013 -0500
 
-2008-06-17  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+    Work around LLVM ABI problem on x86-64
 
-	* configure: Regenerate.
-	* include/Makefile.in: Regenerate.
-	* testsuite/Makefile.in: Regenerate.
+commit 370112938e705128fd5dd4017fc1a1210bd0271a
+Merge: bada2e3 bcc0c28
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sun Jan 27 05:09:04 2013 -0800
 
-2008-06-07  Joseph Myers  <joseph@codesourcery.com>
+    Merge pull request #28 from jralls/master
+    
+    Reorder x86_64 checks
 
-	* configure.ac (parisc*-*-linux*, powerpc-*-sysv*,
-	powerpc-*-beos*): Remove.
-	* configure: Regenerate.
+commit bcc0c28001b6d427d5cd8037d2e3c892babc6b4c
+Author: John Ralls <jralls@ceridwen.us>
+Date:   Sat Jan 26 15:21:14 2013 -0800
 
-2008-05-09  Julian Brown  <julian@codesourcery.com>
+    Reorder x86_64 tests
+    
+    So that darwin and cygwin/mingw are tested before the generic check --
+    which allows them to actually be set.
 
-	* Makefile.am (LTLDFLAGS): New.
-	(libffi_la_LDFLAGS): Use above.
-	* Makefile.in: Regenerate.
+commit bada2e326d9a9acf3ae40cfa4f5d7a9ba97b2ea8
+Author: Anthony Green <green@moxielogic.com>
+Date:   Mon Jan 21 08:02:07 2013 -0500
 
-2008-04-18  Paolo Bonzini  <bonzini@gnu.org>
+    Update README
 
-	PR bootstrap/35457
-	* aclocal.m4: Regenerate.
-	* configure: Regenerate.
+commit 655bb8f3690feba8e840a5f1854b1d78ed08f692
+Merge: 1035ffb 840f975
+Author: Anthony Green <green@moxielogic.com>
+Date:   Mon Jan 21 08:01:24 2013 -0500
 
-2008-03-26  Kaz Kojima  <kkojima@gcc.gnu.org>
+    Merge branch 'master' of github.com:/atgreen/libffi
 
-	* src/sh/sysv.S: Add .note.GNU-stack on Linux.
-	* src/sh64/sysv.S: Likewise.
+commit 1035ffb2f468e1a1c401d58cff7e7abb69838e68
+Merge: aeb8719 4086024
+Author: Anthony Green <green@moxielogic.com>
+Date:   Mon Jan 21 07:55:53 2013 -0500
 
-2008-03-26  Daniel Jacobowitz  <dan@debian.org>
+    Update README
 
-	* src/arm/sysv.S: Fix ARM comment marker.
+commit 840f975866052fdd91b2c224d56e01ae5900b60d
+Merge: aeb8719 4086024
+Author: Anthony Green <green@moxielogic.com>
+Date:   Mon Jan 21 07:55:53 2013 -0500
 
-2008-03-26  Jakub Jelinek  <jakub@redhat.com>
+    Merge branch 'master' of github.com:/atgreen/libffi
 
-	* src/alpha/osf.S: Add .note.GNU-stack on Linux.
-	* src/s390/sysv.S: Likewise.
-	* src/powerpc/ppc_closure.S: Likewise.
-	* src/powerpc/sysv.S: Likewise.
-	* src/x86/unix64.S: Likewise.
-	* src/x86/sysv.S: Likewise.
-	* src/sparc/v8.S: Likewise.
-	* src/sparc/v9.S: Likewise.
-	* src/m68k/sysv.S: Likewise.
-	* src/arm/sysv.S: Likewise.
+commit aeb8719a34756969970603fca4568530d56708af
+Author: Anthony Green <green@moxielogic.com>
+Date:   Mon Jan 21 07:37:30 2013 -0500
 
-2008-03-16  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+    New microblaze support
 
-	* aclocal.m4: Regenerate.
-	* configure: Likewise.
-	* Makefile.in: Likewise.
-	* include/Makefile.in: Likewise.
-	* testsuite/Makefile.in: Likewise.
+commit 40860245a4fd91a1b88adc9171ec993c549e45d5
+Author: Anthony Green <green@moxielogic.com>
+Date:   Mon Jan 21 07:37:30 2013 -0500
 
-2008-02-12  Bjoern Koenig  <bkoenig@alpha-tierchen.de>
-	    Andreas Tobler  <a.tobler@schweiz.org>
+    New microblaze support
 
-	* configure.ac: Add amd64-*-freebsd* target.
-	* configure: Regenerate.
+commit 20cae32b152b43679ae65a85db9a1c6bb8a143dd
+Author: Anthony Green <green@moxielogic.com>
+Date:   Mon Jan 21 07:07:38 2013 -0500
 
-2008-01-30  H.J. Lu  <hongjiu.lu@intel.com>
+    Xtensa support
 
-	PR libffi/34612
-	* src/x86/sysv.S (ffi_closure_SYSV): Pop 4 byte from stack when
-	returning struct.
+commit 9742f91782faef4a15941508a22c408fb7d1d227
+Author: Anthony Green <green@moxielogic.com>
+Date:   Mon Jan 21 07:03:41 2013 -0500
 
-	* testsuite/libffi.call/call.exp: Add "-O2 -fomit-frame-pointer"
-	tests.
+    Mention IBM XL compiler support on AIX.
 
-2008-01-24  David Edelsohn  <edelsohn@gnu.org>
+commit f03eab08248f122ce3b623a18df9e19fae1b6e98
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Jan 11 17:14:11 2013 -0500
 
-	* configure: Regenerate.
+    Remove obsolete inline test functions
 
-2008-01-06  Andreas Tobler  <a.tobler@schweiz.org>
+commit 05fbe1faedc7b2580d5f14010d00e9e3cee73951
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Jan 11 16:54:40 2013 -0500
 
-	* src/x86/ffi.c (ffi_prep_cif_machdep): Fix thinko.
+    xlc compiler support
 
-2008-01-05  Andreas Tobler  <a.tobler@schweiz.org>
+commit 0b4986a7889ed1864674192228f1162c1b5770a8
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Jan 11 11:19:52 2013 -0500
 
-	PR testsuite/32843
-	* src/x86/ffi.c (ffi_prep_cif_machdep): Add code for
-	signed/unsigned int8/16 for X86_DARWIN.
-	Updated copyright info.
-	Handle one and two byte structs with special cif->flags.
-	* src/x86/ffitarget.h: Add special types for one and two byte structs.
-	Updated copyright info.
-	* src/x86/darwin.S (ffi_call_SYSV): Rewrite to use a jump table like
-	sysv.S
-	Remove code to pop args from the stack after call.
-	Special-case signed/unsigned for int8/16, one and two byte structs.
-	(ffi_closure_raw_SYSV): Handle FFI_TYPE_UINT8,
-	FFI_TYPE_SINT8, FFI_TYPE_UINT16, FFI_TYPE_SINT16, FFI_TYPE_UINT32,
-	FFI_TYPE_SINT32.
-	Updated copyright info.
+    [travis] install dejagnu with sudo
 
-2007-12-08  David Daney  <ddaney@avtrex.com>
+commit 3c337eef51ab9a4993fc875bfa26289dd6a08881
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Jan 11 11:18:14 2013 -0500
 
-	* src/mips/n32.S (ffi_call_N32):  Replace dadd with ADDU, dsub with
-	SUBU, add with ADDU and use smaller code sequences.
+    [travis] install dejagnu
 
-2007-12-07  David Daney  <ddaney@avtrex.com>
+commit 90720962ce1baf9fc35d1bde1738102bcd5bd5ed
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Jan 11 10:57:30 2013 -0500
 
-	* src/mips/ffi.c (ffi_prep_cif_machdep): Handle long double return
-	type.
+    Add first travis config file
 
-2007-12-06  David Daney  <ddaney@avtrex.com>
+commit bff052d9cd5be41ba9e47c76114054af487d3c30
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Jan 11 10:24:32 2013 -0500
 
-	* include/ffi.h.in (FFI_SIZEOF_JAVA_RAW): Define if not	already
-	defined.
-	(ffi_java_raw): New typedef.
-	(ffi_java_raw_call, ffi_java_ptrarray_to_raw,
-	ffi_java_raw_to_ptrarray): Change parameter types from ffi_raw to
-	ffi_java_raw.
-	(ffi_java_raw_closure) : Same.
-	(ffi_prep_java_raw_closure, ffi_prep_java_raw_closure_loc): Change
-	parameter types.
-	* src/java_raw_api.c (ffi_java_raw_size):  Replace FFI_SIZEOF_ARG with
-	FFI_SIZEOF_JAVA_RAW.
-	(ffi_java_raw_to_ptrarray): Change type of raw to ffi_java_raw.
-	Replace FFI_SIZEOF_ARG with FFI_SIZEOF_JAVA_RAW. Use
-	sizeof(ffi_java_raw) for alignment calculations.
-	(ffi_java_ptrarray_to_raw): Same.
-	(ffi_java_rvalue_to_raw): Add special handling for FFI_TYPE_POINTER
-	if FFI_SIZEOF_JAVA_RAW == 4.
-	(ffi_java_raw_to_rvalue): Same.
-	(ffi_java_raw_call): Change type of raw to ffi_java_raw.
-	(ffi_java_translate_args): Same.
-	(ffi_prep_java_raw_closure_loc, ffi_prep_java_raw_closure): Change
-	parameter types.
-	* src/mips/ffitarget.h (FFI_SIZEOF_JAVA_RAW): Define for N32 ABI.
+    32-bit x86 fix and more
 
-2007-12-06  David Daney  <ddaney@avtrex.com>
+commit cd41aeab6176f839167955c016ecc19f65f75df3
+Author: Anthony Green <green@moxielogic.com>
+Date:   Thu Jan 10 17:25:45 2013 -0500
 
-	* src/mips/n32.S (ffi_closure_N32): Use 64-bit add instruction on
-	pointer values.
+    Add compiler column to table
 
-2007-12-01  Andreas Tobler  <a.tobler@schweiz.org>
+commit 8bf987d4df7c4d21435b9211f6cc86abf5904b42
+Author: Anthony Green <green@moxielogic.com>
+Date:   Thu Jan 10 17:24:51 2013 -0500
 
-	PR libffi/31937
-	* src/powerpc/ffitarget.h: Introduce new ABI FFI_LINUX_SOFT_FLOAT.
-	Add local FFI_TYPE_UINT128 to handle soft-float long-double-128.
-	* src/powerpc/ffi.c: Distinguish between __NO_FPRS__ and not and
-	set the NUM_FPR_ARG_REGISTERS according to.
-	Add support for potential soft-float support under hard-float
-	architecture.
-	(ffi_prep_args_SYSV): Set NUM_FPR_ARG_REGISTERS to 0 in case of
-	FFI_LINUX_SOFT_FLOAT, handle float, doubles and long-doubles according
-	to the FFI_LINUX_SOFT_FLOAT ABI.
-	(ffi_prep_cif_machdep): Likewise.
-	(ffi_closure_helper_SYSV): Likewise.
-	* src/powerpc/ppc_closure.S: Make sure not to store float/double
-	on archs where __NO_FPRS__ is true.
-	Add FFI_TYPE_UINT128 support.
-	* src/powerpc/sysv.S: Add support for soft-float long-double-128.
-	Adjust copyright notice.
+    Fix for sunpro compiler on Solaris
 
-2007-11-25  Andreas Tobler  <a.tobler@schweiz.org>
+commit 3ee74fd6dc8ccd32b608bbff73526838fc34f70b
+Author: Anthony Green <green@moxielogic.com>
+Date:   Thu Jan 10 17:15:03 2013 -0500
 
-	* src/closures.c: Move defintion of MAYBE_UNUSED from here to ...
-	* include/ffi_common.h: ... here.
-	Update copyright.
+    Update documentation version.
 
-2007-11-17  Andreas Tobler  <a.tobler@schweiz.org>
+commit 13e2d7b92557a9511a0414df82bf2df3edc55cba
+Author: Anthony Green <green@moxielogic.com>
+Date:   Thu Jan 10 10:52:02 2013 -0500
 
-	* src/powerpc/sysv.S: Load correct cr to compare if we have long double.
-	* src/powerpc/linux64.S: Likewise.
-	* src/powerpc/ffi.c: Add a comment to show which part goes into cr6.
-	* testsuite/libffi.call/return_ldl.c: New test.
+    Handle both 32 and 64-bit x86 builds regardless of target triple
 
-2007-09-04    <aph@redhat.com>
+commit 5141543000fc86a3d49a907a2313713ee79e504d
+Author: Anthony Green <green@moxielogic.com>
+Date:   Thu Jan 10 07:35:53 2013 -0500
 
-	* src/arm/sysv.S (UNWIND): New.
-	(Whole file): Conditionally compile unwinder directives.
-	* src/arm/sysv.S: Add unwinder directives.
+    Don't run EH tests with non-GNU compiler
 
-	* src/arm/ffi.c (ffi_prep_args): Align structs by at least 4 bytes.
-	Only treat r0 as a struct address if we're actually returning a
-	struct by address.
-	Only copy the bytes that are actually within a struct.
-	(ffi_prep_cif_machdep): A Composite Type not larger than 4 bytes
-	is returned in r0, not passed by address.
-	(ffi_call): Allocate a word-sized temporary for the case where
-	a composite is returned in r0.
-	(ffi_prep_incoming_args_SYSV): Align as necessary.
+commit 56ba8d86f47937a0afb81a2b9e77c9d235d9db45
+Author: Anthony Green <green@moxielogic.com>
+Date:   Thu Jan 10 07:25:10 2013 -0500
 
-2007-08-05  Steven Newbury  <s_j_newbury@yahoo.co.uk>
+    Don't use warning checking macro with sun compiler
 
-	* src/arm/ffi.c (FFI_INIT_TRAMPOLINE): Use __clear_cache instead of
-	directly using the sys_cacheflush syscall.
+commit 6a028caec1b2c7904feb4c4f9cb7e1125e1d1b60
+Author: Anthony Green <green@moxielogic.com>
+Date:   Thu Jan 10 01:19:43 2013 -0500
 
-2007-07-27  Andrew Haley  <aph@redhat.com>
+    Don't use GCCisms to define types when
+    +       building with the SUNPRO compiler.
 
-	* src/arm/sysv.S (ffi_closure_SYSV): Add soft-float.
+commit 2d9b3939751b3ef9739049509d353ade10b32a8f
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Jan 9 21:14:54 2013 -0500
 
-2007-09-03  Maciej W. Rozycki  <macro@linux-mips.org>
+    Fix for closures with sunpro compiler
 
-	* Makefile.am: Unify MIPS_IRIX and MIPS_LINUX into MIPS.
-	* configure.ac: Likewise.
-	* Makefile.in: Regenerate.
-	* include/Makefile.in: Likewise.
-	* testsuite/Makefile.in: Likewise.
-	* configure: Likewise.
+commit 8308984e479e3274a36e98e8272b5adbb6b774c2
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Jan 8 15:14:21 2013 -0500
 
-2007-08-24  David Daney  <ddaney@avtrex.com>
+    Make sure we're running dejagnu tests with the right compiler.
 
-	* testsuite/libffi.call/return_sl.c: New test.
+commit f26c7ca67147450db2fe25ea932944e6cf145d5c
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Jan 8 14:47:05 2013 -0500
 
-2007-08-10  David Daney  <ddaney@avtrex.com>
+    Make compiler options in dejagnu runs compiler specific
 
-	* testsuite/libffi.call/cls_multi_ushort.c,
-	testsuite/libffi.call/cls_align_uint16.c,
-	testsuite/libffi.call/nested_struct1.c,
-	testsuite/libffi.call/nested_struct3.c,
-	testsuite/libffi.call/cls_7_1_byte.c,
-	testsuite/libffi.call/nested_struct5.c,
-	testsuite/libffi.call/cls_double.c,
-	testsuite/libffi.call/nested_struct7.c,
-	testsuite/libffi.call/cls_sint.c,
-	testsuite/libffi.call/nested_struct9.c,
-	testsuite/libffi.call/cls_20byte1.c,
-	testsuite/libffi.call/cls_multi_sshortchar.c,
-	testsuite/libffi.call/cls_align_sint64.c,
-	testsuite/libffi.call/cls_3byte2.c,
-	testsuite/libffi.call/cls_multi_schar.c,
-	testsuite/libffi.call/cls_multi_uchar.c,
-	testsuite/libffi.call/cls_19byte.c,
-	testsuite/libffi.call/cls_9byte1.c,
-	testsuite/libffi.call/cls_align_float.c,
-	testsuite/libffi.call/closure_fn1.c,
-	testsuite/libffi.call/problem1.c,
-	testsuite/libffi.call/closure_fn3.c,
-	testsuite/libffi.call/cls_sshort.c,
-	testsuite/libffi.call/closure_fn5.c,
-	testsuite/libffi.call/cls_align_double.c,
-	testsuite/libffi.call/nested_struct.c,
-	testsuite/libffi.call/cls_2byte.c,
-	testsuite/libffi.call/nested_struct10.c,
-	testsuite/libffi.call/cls_4byte.c,
-	testsuite/libffi.call/cls_6byte.c,
-	testsuite/libffi.call/cls_8byte.c,
-	testsuite/libffi.call/cls_multi_sshort.c,
-	testsuite/libffi.call/cls_align_sint16.c,
-	testsuite/libffi.call/cls_align_uint32.c,
-	testsuite/libffi.call/cls_20byte.c,
-	testsuite/libffi.call/cls_float.c,
-	testsuite/libffi.call/nested_struct2.c,
-	testsuite/libffi.call/cls_5_1_byte.c,
-	testsuite/libffi.call/nested_struct4.c,
-	testsuite/libffi.call/cls_24byte.c,
-	testsuite/libffi.call/nested_struct6.c,
-	testsuite/libffi.call/cls_64byte.c,
-	testsuite/libffi.call/nested_struct8.c,
-	testsuite/libffi.call/cls_uint.c,
-	testsuite/libffi.call/cls_multi_ushortchar.c,
-	testsuite/libffi.call/cls_schar.c,
-	testsuite/libffi.call/cls_uchar.c,
-	testsuite/libffi.call/cls_align_uint64.c,
-	testsuite/libffi.call/cls_ulonglong.c,
-	testsuite/libffi.call/cls_align_longdouble.c,
-	testsuite/libffi.call/cls_1_1byte.c,
-	testsuite/libffi.call/cls_12byte.c,
-	testsuite/libffi.call/cls_3_1byte.c,
-	testsuite/libffi.call/cls_3byte1.c,
-	testsuite/libffi.call/cls_4_1byte.c,
-	testsuite/libffi.call/cls_6_1_byte.c,
-	testsuite/libffi.call/cls_16byte.c,
-	testsuite/libffi.call/cls_18byte.c,
-	testsuite/libffi.call/closure_fn0.c,
-	testsuite/libffi.call/cls_9byte2.c,
-	testsuite/libffi.call/closure_fn2.c,
-	testsuite/libffi.call/closure_fn4.c,
-	testsuite/libffi.call/cls_ushort.c,
-	testsuite/libffi.call/closure_fn6.c,
-	testsuite/libffi.call/cls_5byte.c,
-	testsuite/libffi.call/cls_align_pointer.c,
-	testsuite/libffi.call/cls_7byte.c,
-	testsuite/libffi.call/cls_align_sint32.c,
-	testsuite/libffi.special/unwindtest_ffi_call.cc,
-	testsuite/libffi.special/unwindtest.cc: Remove xfail for mips64*-*-*.
+commit 74c776e21907fc2e59257c021f23077f8b7966cb
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Jan 8 12:25:54 2013 -0500
 
-2007-08-10  David Daney  <ddaney@avtrex.com>
+    Switch x86 Solaris to X86 from X86_64
 
-	PR libffi/28313
-	* configure.ac: Don't treat mips64 as a special case.
-	* Makefile.am (nodist_libffi_la_SOURCES): Add n32.S.
-	* configure: Regenerate
-	* Makefile.in: Ditto.
-	* fficonfig.h.in: Ditto.
-	* src/mips/ffitarget.h (REG_L, REG_S, SUBU, ADDU, SRL, LI): Indent.
-	(LA, EH_FRAME_ALIGN, FDE_ADDR_BYTES): New preprocessor macros.
-	(FFI_DEFAULT_ABI): Set for n64 case.
-	(FFI_CLOSURES, FFI_TRAMPOLINE_SIZE): Define for n32 and n64 cases.
-	* src/mips/n32.S (ffi_call_N32): Add debug macros and labels for FDE.
-	(ffi_closure_N32): New function.
-	(.eh_frame): New section
-	* src/mips/o32.S: Clean up comments.
-	(ffi_closure_O32): Pass ffi_closure parameter in $12.
-	* src/mips/ffi.c: Use FFI_MIPS_N32 instead of
-	_MIPS_SIM == _ABIN32 throughout.
-	(FFI_MIPS_STOP_HERE): New, use in place of
-	ffi_stop_here.
-	(ffi_prep_args): Use unsigned long to hold pointer values.  Rewrite
-	to support n32/n64 ABIs.
-	(calc_n32_struct_flags): Rewrite.
-	(calc_n32_return_struct_flags): Remove unused variable.  Reverse
-	position of flag bits.
-	(ffi_prep_cif_machdep): Rewrite n32 portion.
-	(ffi_call): Enable for n64.  Add special handling for small structure
-	return values.
-	(ffi_prep_closure_loc): Add n32 and n64 support.
-	(ffi_closure_mips_inner_O32): Add cast to silence warning.
-	(copy_struct_N32, ffi_closure_mips_inner_N32): New functions.
+commit 8962c8c8d06803e310bac0ffc8e84ea15daeff3f
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Jan 8 12:22:24 2013 -0500
+
+    Fix read-only eh_frame test
+
+commit 35ddb69c2b49746d940e919ca226ecc1be94f14a
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Jan 8 07:53:37 2013 -0500
+
+    Only emit DWARF unwind info when building with GCC
+
+commit f7879bc3f3a8d0bbfcc38771732c160a58ba9cd8
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Jan 8 07:30:28 2013 -0500
+
+    Testsuite fix for Solaris vendor compiler
+
+commit 67cea90fc0897021466fd102671019d30db474cd
+Author: Anthony Green <green@moxielogic.com>
+Date:   Mon Jan 7 06:30:24 2013 -0500
+
+    mend
+
+commit 0de3277b18cf54be3b81d509b9be9b47d9bc1e82
+Author: Thorsten Glaser <tg@mirbsd.de>
+Date:   Mon Dec 3 00:02:31 2012 +0000
+
+    Testsuite fixes (was Re: [PATCH] Fix libffi on m68k-linux-gnu, completely)
+    
+    Dixi quod…
+    
+    >although I believe some 3.0.11 checks to be broken:
+    
+    And indeed, with a few minor changes on top of git master,
+    I still get a full run of PASS plus one XPASS on amd64-linux!
+    
+    With the other patches (from this message’s parent) and
+    these applied, I get a full PASS on m68k-linux as well.
+    
+    So, please git am these three diffs ☺
+    
+    bye,
+    //mirabilos
+    --
+    FWIW, I'm quite impressed with mksh interactively. I thought it was much
+    *much* more bare bones. But it turns out it beats the living hell out of
+    ksh93 in that respect. I'd even consider it for my daily use if I hadn't
+    wasted half my life on my zsh setup. :-) -- Frank Terbeck in #!/bin/mksh
+    From 5cb15a3bad1f0fb360520dd48bfc938c821cdcca Mon Sep 17 00:00:00 2001
+    From: Thorsten Glaser <tg@mirbsd.org>
+    Date: Sun, 2 Dec 2012 23:20:56 +0000
+    Subject: [PATCH 1/2] Fix tests writing to a closure retval via pointer casts
+    
+    As explained in <Pine.BSM.4.64L.1212022014490.23442@herc.mirbsd.org>
+    all other tests that do the same cast to an ffi_arg pointer instead.
+    
+    PASS on amd64-linux (Xen domU) and m68k-linux (ARAnyM)
+    
+    Signed-off-by: Thorsten Glaser <tg@mirbsd.org>
+
+commit 8f4772f383abd71cfa141c8a70ba11c1aa4ebe2c
+Author: Anthony Green <green@moxielogic.com>
+Date:   Mon Jan 7 06:14:53 2013 -0500
+
+    m68k fixes for signed 8 and 16-bit calls.
+
+commit ea7f8440d58afbebb181e295ff564fdf3d6590a0
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Jan 4 09:09:32 2013 -0500
+
+    remove gcc-ism
+
+commit f06c0f10377ac04eeba5e632dbe5c62c629df4e6
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Jan 2 09:39:17 2013 -0500
+
+    Add missing ChangeLog entry and generated files.
+
+commit 1f8675d4c101d19d67ca0a55ff2ba973349558ad
+Merge: 335f419 f6b58d2
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Jan 2 06:34:38 2013 -0800
+
+    Merge pull request #26 from rofl0r/master
+    
+    fix build error on ppc when long double == double
+
+commit 335f419a86090cda9f215d149572f9481c3ad034
+Merge: 53236d5 6d6f711
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Jan 2 06:30:03 2013 -0800
+
+    Merge pull request #23 from rurban/master
+    
+    cygwin/mingw shared libs need libtool LDFLAGS = -no-undefined
+
+commit 53236d5061034cc0a7f4647fc1bd05ba1aeb3d2a
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Jan 2 09:24:55 2013 -0500
+
+    Regenerate files
+
+commit 72222ca3fbe560e13c8dc89ca441b28b7cc74daf
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Jan 2 09:06:38 2013 -0500
+
+    Update texinfo.tex
+
+commit 1e326c95431fc9896422fa36659f3e833852579c
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Jan 2 09:05:02 2013 -0500
+
+    Update config.guess and config.sub
+
+commit cb6671f5b8a9596ff968c6b6c304f70adf71b368
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Jan 2 08:56:07 2013 -0500
+
+    Missing .gitignore changes for xcode support
+
+commit ebbe77966855395a2a47ed2c09a38f93eb0481cf
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Jan 2 08:54:05 2013 -0500
+
+    missed x32 libtool patch.
+
+commit 4394096da0aca0dd422b479a043c18b4f05c5770
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Jan 2 08:51:35 2013 -0500
+
+    missed trampoline_table patch. Move to GCC.
+
+commit ed7a59c3ff7c84bd95c374a5aff21599f705e6dc
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Jan 2 08:48:01 2013 -0500
+
+    Windows symbol export fix.  Move to GCC.
+
+commit ccee09a4ff843b11c7d8b6819776f57d187305c7
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Jan 2 08:41:55 2013 -0500
+
+    +2012-03-21  Peter Rosin  <peda@lysator.liu.se>
+    +
+    +       * testsuite/lib/target-libpath.exp [*-*-cygwin*, *-*-mingw*]
+    +       (set_ld_library_path_env_vars): Add the library search dir to PATH
+    +       (and save PATH for later).
+    +       (restore_ld_library_path_env_vars): Restore PATH.
+
+commit 089dbce7cc0889eb26444d89ae062c73c69f26f0
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Jan 2 08:37:35 2013 -0500
+
+    med
+
+commit 980a334c42b4b0eff32e55929ec6727d1326b05d
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Jan 2 07:36:42 2013 -0500
+
+    Test GCC update
+
+commit 8bad679ade5000e57cdc9cacde22e8b99840930f
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Jan 2 08:28:35 2013 -0500
+
+    New stand-alone patch
+
+commit 981c32ee115e9f0d6546a74592875e138222a9d1
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Jan 2 07:34:03 2013 -0500
+
+    Merge with GCC.  Eliminate quilt bits.
+
+commit 61a054929517fb80c437ba71c91f3e20cfff581a
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Nov 28 06:07:41 2012 -0500
+
+    Refresh config.guess and config.sub
+
+commit f6b58d2bdc0a24ce94dedce59802f091979df265
+Author: rofl0r <retnyg@gmx.net>
+Date:   Thu Nov 22 16:26:21 2012 +0100
+
+    fix build on ppc when long double == double
+
+commit 69da33a0761aeac73f9e9646269da61c906d6020
+Author: Anthony Green <green@moxielogic.com>
+Date:   Mon Nov 12 15:25:47 2012 -0500
+
+    Pull in config.sub for aarch64 support and more
+
+commit f680b598b7bdde325ac9349e8c35151c228bf2df
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Nov 6 16:00:40 2012 -0500
+
+    Add missing aarch64 configury bits
+
+commit dfadfb19853c57c8623c436d0ef2bdafab24b433
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Oct 31 06:46:41 2012 -0400
+
+    Rebase for ppc64 fix
+
+commit e944b8c7eb1e2eeb9c0f3b9742b4d7f476860ce1
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Oct 30 14:06:09 2012 -0400
+
+    Add PaX work-around
+
+commit 9ccd51be1fdeb99f8b4f42f905166c2abbba8ac0
+Merge: f342996 fa5d747
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Oct 30 13:37:37 2012 -0400
+
+    Fix commit conflicts
+
+commit f342996cb50eb23b868afcff5ac0cdbb6b505d63
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Oct 30 07:42:27 2012 -0400
+
+    Darwin12 fix
+
+commit 58e8b66f70cef2e3c9b0e5a707b45d634cbbf5d9
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Oct 30 07:07:19 2012 -0400
+
+    AArch64 port
+
+commit fa5d747905472571fd472c07d4726017624f66b3
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Oct 30 07:07:19 2012 -0400
+
+    AArch64 port
+
+commit 6993a6686f43f2313b18142c1e96189a27db2aa3
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Oct 30 06:59:32 2012 -0400
+
+    Fix autoconf macros
+
+commit 70084e70ddb13b29dd05c751b1904de206bbe790
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Oct 12 23:55:06 2012 -0400
+
+    Update Tile* port info
+
+commit 9c00a3f6742d61404b31268cc773e7130ff43331
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Oct 12 16:46:06 2012 -0400
+
+    TILE-Gx/TILEPro support
+
+commit 048d2f41c3a6664b4b64bf21e804686662da4160
+Author: Anthony Green <green@moxielogic.com>
+Date:   Thu Oct 11 10:55:25 2012 -0400
+
+    Rebase
+
+commit 6d6f71108064f5069edd7bf771059d3b82640135
+Author: Reini Urban <rurban@cpanel.net>
+Date:   Sat Jul 7 12:42:00 2012 -0500
+
+    cygwin/mingw shared libs need libtool LDFLAGS = -no-undefined
+    
+    otherwise only static libs are created.
+
+commit d330f19292da8f39a78a9e2b0ba08df8094e3bc5
+Author: Nicolas Lelong <rotoglup>
+Date:   Sat May 5 09:37:02 2012 -0400
+
+    iOS build fixes.
+
+commit 09b23cfc1d6d15361eee18818851fd3cacb26559
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Apr 27 08:29:48 2012 -0400
+
+    Update README with Blackfin/uClinux support
+
+commit 213ed15c70e72d666154c08e2b41dae3f61f20d3
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Apr 27 01:34:15 2012 -0400
+
+    Add blackfin supprt from Alexandre Keunecke.
+
+commit ff3d76fd427382ce7d2b2ed54acdd0bce470ca4f
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Apr 11 23:16:48 2012 -0400
+
+    3.0.11
+
+commit 7e0a412c4fd9cbe77b467a9bf86f56aea62632c3
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Apr 11 22:47:44 2012 -0400
+
+    Update files to ship
+
+commit 39e6a5860416f7bad992149817e1da1ba7c460d4
+Author: Zachary Waldowski <zwaldowski@gmail.com>
+Date:   Wed Apr 11 22:39:46 2012 -0400
+
+    More mac/ios build improvements
+
+commit 853cc722a16f8d1254573ef3bb73c7b8f3d8a110
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Apr 10 06:33:33 2012 -0400
+
+    Fix typo for darwin targets
+
+commit 3f5023068cda07a3dd6dacbaa875a5b5fc96d4bb
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Apr 6 20:34:51 2012 -0400
+
+    mend
+
+commit ebb8e8945681ce0af7a5c47a980287e8ece84b84
+Author: Mike Lewis <mikelikespie@gmail.com>
+Date:   Fri Apr 6 20:02:08 2012 -0400
+
+    Build iOS library with xcode
+
+commit a098b44f4c592c2192fcdef4fad6108eb3f4301c
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Apr 6 17:04:35 2012 -0400
+
+    Reapply missing testsuite changes for arm
+
+commit 10d1e51393f08c14045db85843208f44f9f1e9ba
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Apr 6 11:57:14 2012 -0400
+
+    Update to rc4.  Upgrade autoconf version.
+
+commit 9bcc884276dc0a807b2605e510b11b1740dd9aa2
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Apr 6 11:53:07 2012 -0400
+
+    Fix Linux/x32 reference in README
+
+commit a044a56b1cd2a0924f5ec0d6b5a5089d14fcd1a1
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Apr 6 10:39:10 2012 -0400
+
+    Linux/x32 libtool fix
+
+commit 59bb61a36661b972e8443531d3b7bc736e131a4b
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Apr 6 08:26:14 2012 -0400
+
+    Update libtool version, README, tests dists
+
+commit f2981454cbe25cf9411b710f46c5f5552003a123
+Author: Anthony Green <green@moxielogic.com>
+Date:   Thu Apr 5 15:45:19 2012 -0400
+
+    Revert debug code changes
+
+commit 39dccddb606f6fdb8dcb177d416e884041da6e30
+Author: Zachary Waldowski <zwaldowski@gmail.com>
+Date:   Thu Apr 5 12:32:41 2012 -0400
+
+    Fix building with Clang for Darwin (OS X 10.6+ and iOS
+     4.0+)
+
+commit 3afaa9a34a81a305227ae8cf4f12b9d0484d055e
+Author: Peter Rosin <peda@lysator.liu.se>
+Date:   Tue Apr 3 07:40:31 2012 -0400
+
+    Fix return_uc.c test case on windows.
+
+commit 65f40c35a2873d8328359ec4512bd0736dbe32c7
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Apr 3 07:35:59 2012 -0400
+
+    Repair ppc build regression.
+
+commit 0a1ab12a8d15caa894116a82249551f23ef65612
+Author: Peter Rosin <peda@lysator.liu.se>
+Date:   Fri Mar 30 08:14:08 2012 -0400
+
+    Various MSVC-related changes.
+
+commit e1539266e6c6dde3c99832323586f33f977d1dc0
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Mar 30 00:40:18 2012 -0400
+
+    ARM VFP fix for old toolchains
+
+commit 7c5e60b5f47d725036a72162f136272bc407e3a1
+Author: Anthony Green <green@moxielogic.com>
+Date:   Thu Mar 29 08:48:22 2012 -0400
+
+    Rebase on fixed GCC sources
+
+commit e72ed5eeaa9cfb0fdc86f6b3422734177b659f96
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Mar 21 09:52:28 2012 -0400
+
+    Fix vararg float test
+
+commit bd78c9c3311244dd5f877c915b0dff91621dd253
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Mar 21 08:09:30 2012 -0400
+
+    More cygwin fixes
+
+commit 84d3253f86dad6b4f261231935675d35fd964b05
+Author: Anthony Green <green@moxielogic.com>
+Date:   Mon Mar 19 23:07:35 2012 -0400
+
+    Rebase post GCC merge
+
+commit 964c5b93f80dcaacf73056b7d15a4d2b4b7a217c
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Mar 3 14:46:20 2012 -0500
+
+    abi check fixes and Linux/x32 support
+
+commit 6c194233a5f6f1d274669afc5924a9e1f69d4876
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Mar 3 14:17:54 2012 -0500
+
+    Add -no-undefined for both 32- and 64-bit x86
+    windows-like hosts.
+
+commit 8360bf1cd0aba8db5582266da70467de7e89a57a
+Author: Anthony Green <green@moxielogic.com>
+Date:   Thu Feb 23 07:01:13 2012 -0500
+
+    Ensure that users don't include ffitarget.h directly
+
+commit d578b89619cf3d2baff027b203619dc307fc12e3
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Feb 15 00:18:18 2012 -0500
+
+    Fix ABI check regression
+
+commit dee20f8e45c486f5018f31e09bb362992aa498c3
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Feb 10 13:06:46 2012 -0500
+
+    Rebased from gcc
 
-2007-08-08  David Daney  <ddaney@avtrex.com>
+commit 4130e1972d001143e5e9f3c6b65f2a6f9524169e
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Feb 3 13:18:27 2012 -0600
 
-	* testsuite/libffi.call/ffitest.h (ffi_type_mylong): Remove definition.
-	* testsuite/libffi.call/cls_align_uint16.c (main): Use correct type
-	specifiers.
-	* testsuite/libffi.call/nested_struct1.c (main): Ditto.
-	* testsuite/libffi.call/cls_sint.c (main): Ditto.
-	* testsuite/libffi.call/nested_struct9.c (main): Ditto.
-	* testsuite/libffi.call/cls_20byte1.c (main): Ditto.
-	* testsuite/libffi.call/cls_9byte1.c (main): Ditto.
-	* testsuite/libffi.call/closure_fn1.c (main): Ditto.
-	* testsuite/libffi.call/closure_fn3.c (main): Ditto.
-	* testsuite/libffi.call/return_dbl2.c (main): Ditto.
-	* testsuite/libffi.call/cls_sshort.c (main): Ditto.
-	* testsuite/libffi.call/return_fl3.c (main): Ditto.
-	* testsuite/libffi.call/closure_fn5.c (main): Ditto.
-	* testsuite/libffi.call/nested_struct.c (main): Ditto.
-	* testsuite/libffi.call/nested_struct10.c (main): Ditto.
-	* testsuite/libffi.call/return_ll1.c (main): Ditto.
-	* testsuite/libffi.call/cls_8byte.c (main): Ditto.
-	* testsuite/libffi.call/cls_align_uint32.c (main): Ditto.
-	* testsuite/libffi.call/cls_align_sint16.c (main): Ditto.
-	* testsuite/libffi.call/cls_20byte.c (main): Ditto.
-	* testsuite/libffi.call/nested_struct2.c (main): Ditto.
-	* testsuite/libffi.call/cls_24byte.c (main): Ditto.
-	* testsuite/libffi.call/nested_struct6.c (main): Ditto.
-	* testsuite/libffi.call/cls_uint.c (main): Ditto.
-	* testsuite/libffi.call/cls_12byte.c (main): Ditto.
-	* testsuite/libffi.call/cls_16byte.c (main): Ditto.
-	* testsuite/libffi.call/closure_fn0.c (main): Ditto.
-	* testsuite/libffi.call/cls_9byte2.c (main): Ditto.
-	* testsuite/libffi.call/closure_fn2.c (main): Ditto.
-	* testsuite/libffi.call/return_dbl1.c (main): Ditto.
-	* testsuite/libffi.call/closure_fn4.c (main): Ditto.
-	* testsuite/libffi.call/closure_fn6.c (main): Ditto.
-	* testsuite/libffi.call/cls_align_sint32.c (main): Ditto.
+    Refresh autoconf-archive m4 scripts
 
-2007-08-07  Andrew Haley  <aph@redhat.com>
+commit 1ff9c604bb214b5a305064af1049577ef783730a
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Feb 1 16:34:30 2012 -0600
 
-	* src/x86/sysv.S (ffi_closure_raw_SYSV): Fix typo in previous
-	checkin.
+    Rebase from GCC
 
-2007-08-06  Andrew Haley  <aph@redhat.com>
+commit 211060eb8f714af0e935430efa6bb45e8e3ffc5d
+Author: Anthony Green <green@moxielogic.com>
+Date:   Mon Jan 23 14:24:01 2012 -0500
 
-	PR testsuite/32843
-	* src/x86/sysv.S (ffi_closure_raw_SYSV): Handle FFI_TYPE_UINT8,
-	FFI_TYPE_SINT8, FFI_TYPE_UINT16, FFI_TYPE_SINT16, FFI_TYPE_UINT32,
-	FFI_TYPE_SINT32.
+    Alpha fix
 
-2007-08-02  David Daney  <ddaney@avtrex.com>
+commit 78d9c638ba0de6edfbc603fd65d19c6562663248
+Author: Anthony Green <green@moxielogic.com>
+Date:   Mon Jan 23 14:17:24 2012 -0500
 
-	* testsuite/libffi.call/return_ul.c (main): Define return type as
-	ffi_arg.  Use proper printf conversion specifier.
+    mend
 
-2007-07-30  Andrew Haley  <aph@redhat.com>
+commit afaf3381604bd81803d8a5f3bf4d462299f1aac3
+Author: Anthony Green <green@moxielogic.com>
+Date:   Mon Jan 23 14:17:13 2012 -0500
 
-	PR testsuite/32843
-	* src/x86/ffi.c (ffi_prep_cif_machdep): in x86 case, add code for
-	signed/unsigned int8/16.
-	* src/x86/sysv.S (ffi_call_SYSV): Rewrite to:
-	Use a jump table.
-	Remove code to pop args from the stack after call.
-	Special-case signed/unsigned int8/16.
-	* testsuite/libffi.call/return_sc.c (main): Revert.
+    mend
 
-2007-07-26  Richard Guenther  <rguenther@suse.de>
+commit 9e9c4aeb77de5608d602109f22100c1c0c79faad
+Author: Anthony Green <green@moxielogic.com>
+Date:   Mon Jan 23 14:11:23 2012 -0500
 
-	PR testsuite/32843
-	* testsuite/libffi.call/return_sc.c (main): Verify call
-	result as signed char, not ffi_arg.
+    Add Amiga support
 
-2007-07-16  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
+commit 8efc0b1f4027d5a3cbf205e55d422d94e60f3226
+Author: Anthony Green <green@moxielogic.com>
+Date:   Mon Jan 23 13:47:38 2012 -0500
 
-	* configure.ac (i?86-*-solaris2.1[0-9]): Set TARGET to X86_64.
-	* configure: Regenerate.
+    Unlikely fixes
 
-2007-07-11  David Daney  <ddaney@avtrex.com>
+commit 1df51398ae183dc208ba4599ee867278b04d13d3
+Author: Anthony Green <green@moxielogic.com>
+Date:   Mon Jan 23 13:43:59 2012 -0500
 
-	* src/mips/ffi.c: Don't include sys/cachectl.h.
-	(ffi_prep_closure_loc): Use __builtin___clear_cache() instead of
-	cacheflush().
+    mend
 
-2007-05-18  Aurelien Jarno  <aurelien@aurel32.net>
+commit cd2277cc796b96b149cd284ae85326529fe7fb9c
+Author: Anthony Green <green@moxielogic.com>
+Date:   Mon Jan 23 13:43:38 2012 -0500
 
-	* src/arm/ffi.c (ffi_prep_closure_loc): Renamed and ajusted
-	from (ffi_prep_closure): ... this.
-	(FFI_INIT_TRAMPOLINE): Adjust.
+    mend
 
-2005-12-31  Phil Blundell  <pb@reciva.com>
+commit 164e6fe04b189746c8bd5810c6e3e919770bb9d4
+Author: Anthony Green <green@moxielogic.com>
+Date:   Mon Jan 23 12:41:06 2012 -0500
 
-	* src/arm/ffi.c (ffi_prep_incoming_args_SYSV,
-	ffi_closure_SYSV_inner, ffi_prep_closure): New, add closure support.
-	* src/arm/sysv.S(ffi_closure_SYSV): Likewise.
-	* src/arm/ffitarget.h (FFI_TRAMPOLINE_SIZE): Likewise.
-	(FFI_CLOSURES): Enable closure support.
+    m68k fixes
 
-2007-07-03  Andrew Haley  <aph@hedges.billgatliff.com>
+commit c365ee7577bef00cb3c2c0b5224147aea04138d8
+Author: Anthony Green <green@moxielogic.com>
+Date:   Mon Jan 23 11:13:18 2012 -0500
 
-	* testsuite/libffi.call/cls_multi_ushort.c,
-	testsuite/libffi.call/cls_align_uint16.c,
-	testsuite/libffi.call/nested_struct1.c,
-	testsuite/libffi.call/nested_struct3.c,
-	testsuite/libffi.call/cls_7_1_byte.c,
-	testsuite/libffi.call/cls_double.c,
-	testsuite/libffi.call/nested_struct5.c,
-	testsuite/libffi.call/nested_struct7.c,
-	testsuite/libffi.call/cls_sint.c,
-	testsuite/libffi.call/nested_struct9.c,
-	testsuite/libffi.call/cls_20byte1.c,
-	testsuite/libffi.call/cls_multi_sshortchar.c,
-	testsuite/libffi.call/cls_align_sint64.c,
-	testsuite/libffi.call/cls_3byte2.c,
-	testsuite/libffi.call/cls_multi_schar.c,
-	testsuite/libffi.call/cls_multi_uchar.c,
-	testsuite/libffi.call/cls_19byte.c,
-	testsuite/libffi.call/cls_9byte1.c,
-	testsuite/libffi.call/cls_align_float.c,
-	testsuite/libffi.call/closure_fn1.c,
-	testsuite/libffi.call/problem1.c,
-	testsuite/libffi.call/closure_fn3.c,
-	testsuite/libffi.call/cls_sshort.c,
-	testsuite/libffi.call/closure_fn5.c,
-	testsuite/libffi.call/cls_align_double.c,
-	testsuite/libffi.call/cls_2byte.c,
-	testsuite/libffi.call/nested_struct.c,
-	testsuite/libffi.call/nested_struct10.c,
-	testsuite/libffi.call/cls_4byte.c,
-	testsuite/libffi.call/cls_6byte.c,
-	testsuite/libffi.call/cls_8byte.c,
-	testsuite/libffi.call/cls_multi_sshort.c,
-	testsuite/libffi.call/cls_align_uint32.c,
-	testsuite/libffi.call/cls_align_sint16.c,
-	testsuite/libffi.call/cls_float.c,
-	testsuite/libffi.call/cls_20byte.c,
-	testsuite/libffi.call/cls_5_1_byte.c,
-	testsuite/libffi.call/nested_struct2.c,
-	testsuite/libffi.call/cls_24byte.c,
-	testsuite/libffi.call/nested_struct4.c,
-	testsuite/libffi.call/nested_struct6.c,
-	testsuite/libffi.call/cls_64byte.c,
-	testsuite/libffi.call/nested_struct8.c,
-	testsuite/libffi.call/cls_uint.c,
-	testsuite/libffi.call/cls_multi_ushortchar.c,
-	testsuite/libffi.call/cls_schar.c,
-	testsuite/libffi.call/cls_uchar.c,
-	testsuite/libffi.call/cls_align_uint64.c,
-	testsuite/libffi.call/cls_ulonglong.c,
-	testsuite/libffi.call/cls_align_longdouble.c,
-	testsuite/libffi.call/cls_1_1byte.c,
-	testsuite/libffi.call/cls_12byte.c,
-	testsuite/libffi.call/cls_3_1byte.c,
-	testsuite/libffi.call/cls_3byte1.c,
-	testsuite/libffi.call/cls_4_1byte.c,
-	testsuite/libffi.call/cls_6_1_byte.c,
-	testsuite/libffi.call/cls_16byte.c,
-	testsuite/libffi.call/cls_18byte.c,
-	testsuite/libffi.call/closure_fn0.c,
-	testsuite/libffi.call/cls_9byte2.c,
-	testsuite/libffi.call/closure_fn2.c,
-	testsuite/libffi.call/closure_fn4.c,
-	testsuite/libffi.call/cls_ushort.c,
-	testsuite/libffi.call/closure_fn6.c,
-	testsuite/libffi.call/cls_5byte.c,
-	testsuite/libffi.call/cls_align_pointer.c,
-	testsuite/libffi.call/cls_7byte.c,
-	testsuite/libffi.call/cls_align_sint32.c,
-	testsuite/libffi.special/unwindtest_ffi_call.cc,
-	testsuite/libffi.special/unwindtest.cc: Enable for ARM.
+    Refresh
 
-2007-07-05  H.J. Lu  <hongjiu.lu@intel.com>
+commit f22c38bbd93bcc0c04bf26c3e414556b3177c385
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Nov 18 15:13:41 2011 -0500
 
-	* aclocal.m4: Regenerated.
+    Update variadic patch
 
-2007-06-02  Paolo Bonzini  <bonzini@gnu.org>
+commit 03e9ee321a3c208f88d2432587ce40b2bb2430ba
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Nov 18 15:13:00 2011 -0500
 
-	* configure: Regenerate.
+    Fix cls_double_va.c and update docs
 
-2007-05-23  Steve Ellcey  <sje@cup.hp.com>
+commit 95f31151ec792809cfb80d385350f9f56d95aa25
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Nov 12 23:46:05 2011 -0500
 
-	* Makefile.in: Regenerate.
-	* configure: Regenerate.
-	* aclocal.m4: Regenerate.
-	* include/Makefile.in: Regenerate.
-	* testsuite/Makefile.in: Regenerate.
+    Rerun automake
 
-2007-05-10  Roman Zippel <zippel@linux-m68k.org>
+commit 198ed1ef85cf18342627f8d44bc3f12c9975a49d
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Nov 12 23:45:20 2011 -0500
 
-	* src/m68k/ffi.c (ffi_prep_incoming_args_SYSV,
-	ffi_closure_SYSV_inner,ffi_prep_closure): New, add closure support.
-	* src/m68k/sysv.S(ffi_closure_SYSV,ffi_closure_struct_SYSV): Likewise.
-	* src/m68k/ffitarget.h (FFI_TRAMPOLINE_SIZE): Likewise.
-	(FFI_CLOSURES): Enable closure support.
+    Update version number
 
-2007-05-10  Roman Zippel <zippel@linux-m68k.org>
+commit 4f17e1f142e805b13959ba2594ee735eae439f4e
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Nov 12 17:22:24 2011 -0500
 
-	* configure.ac (HAVE_AS_CFI_PSEUDO_OP): New test.
-	* configure: Regenerate.
-	* fficonfig.h.in: Regenerate.
-	* src/m68k/sysv.S (CFI_STARTPROC,CFI_ENDPROC,
-	CFI_OFFSET,CFI_DEF_CFA): New macros.
-	(ffi_call_SYSV): Add callframe annotation.
+    Fix last patch
 
-2007-05-10  Roman Zippel <zippel@linux-m68k.org>
+commit ff9454da44859716a5bd4eaa344499288c79694f
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Nov 12 17:18:51 2011 -0500
 
-	* src/m68k/ffi.c (ffi_prep_args,ffi_prep_cif_machdep): Fix
-	numerous test suite failures.
-	* src/m68k/sysv.S (ffi_call_SYSV): Likewise.
+    Add David Gilbert's variadic function call support
 
-2007-04-11  Paolo Bonzini  <bonzini@gnu.org>
+commit ea14ae85e8f54ff046b7fb8a9cfe349475272044
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Nov 12 16:36:59 2011 -0500
 
-	* Makefile.am (EXTRA_DIST): Bring up to date.
-	* Makefile.in: Regenerate.
-	* src/frv/eabi.S: Remove RCS keyword.
+    clean up
 
-2007-04-06  Richard Henderson  <rth@redhat.com>
+commit 52891f8a93f9b8de801cca4cf05639422dc9773e
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Nov 12 16:35:55 2011 -0500
 
-	* configure.ac: Tidy target case.
-	(HAVE_LONG_DOUBLE): Allow the target to override.
-	* configure: Regenerate.
-	* include/ffi.h.in: Don't define ffi_type_foo if
-	LIBFFI_HIDE_BASIC_TYPES is defined.
-	(ffi_type_longdouble): If not HAVE_LONG_DOUBLE, define
-	to ffi_type_double.
-	* types.c (LIBFFI_HIDE_BASIC_TYPES): Define.
-	(FFI_TYPEDEF, ffi_type_void): Mark the data const.
-	(ffi_type_longdouble): Special case for Alpha.  Don't define
-	if long double == double.
+    Add powerpc soft float support
 
-	* src/alpha/ffi.c (FFI_TYPE_LONGDOUBLE): Assert unique value.
-	(ffi_prep_cif_machdep): Handle it as the 128-bit type.
-	(ffi_call, ffi_closure_osf_inner): Likewise.
-	(ffi_closure_osf_inner): Likewise.  Mark hidden.
-	(ffi_call_osf, ffi_closure_osf): Mark hidden.
-	* src/alpha/ffitarget.h (FFI_LAST_ABI): Tidy definition.
-	* src/alpha/osf.S (ffi_call_osf, ffi_closure_osf): Mark hidden.
-	(load_table): Handle 128-bit long double.
+commit c8f1bde8e2566c5a87474b4d08aa934d6d28ee75
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Nov 12 16:21:02 2011 -0500
 
-	* testsuite/libffi.call/float4.c: Add -mieee for alpha.
+    Remove junk file
 
-2007-04-06  Tom Tromey  <tromey@redhat.com>
+commit 6a6e7f862f3cc677e19131587caa619e7f9c7ffd
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Nov 12 16:20:42 2011 -0500
 
-	PR libffi/31491:
-	* README: Fixed bug in example.
+    Fix kfreebsd
 
-2007-04-03  Jakub Jelinek  <jakub@redhat.com>
+commit d52fbed05ccbdee9ed8b9c911cbb4f85b0ff0f2a
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Nov 12 16:13:41 2011 -0500
 
-	* src/closures.c: Include sys/statfs.h.
-	(_GNU_SOURCE): Define on Linux.
-	(FFI_MMAP_EXEC_SELINUX): Define.
-	(selinux_enabled): New variable.
-	(selinux_enabled_check): New function.
-	(is_selinux_enabled): Define.
-	(dlmmap): Use it.
+    Add missing ChangeLog entry
 
-2007-03-24  Uros Bizjak  <ubizjak@gmail.com>
+commit 322052ce65c4fdac85bedc24726fd0e0094ba521
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Nov 12 16:11:49 2011 -0500
 
-	* testsuite/libffi.call/return_fl2.c (return_fl): Mark as static.
-	Use 'volatile float sum' to create sum of floats to avoid false
-	negative due to excess precision on ix86 targets.
-	(main): Ditto.
+    Fix arm wince alignment issue
 
-2007-03-08  Alexandre Oliva  <aoliva@redhat.com>
+commit af18df2bc2f52df81e7b5c619bd86db8489dc873
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Nov 12 15:52:08 2011 -0500
 
-	* src/powerpc/ffi.c (flush_icache): Fix left-over from previous
-	patch.
-	(ffi_prep_closure_loc): Remove unneeded casts.  Add needed ones.
+    Remove use of ppc string instructions
 
-2007-03-07  Alexandre Oliva  <aoliva@redhat.com>
+commit 236c9391321f83ad40daf03f40c35c9ebc1da6b3
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Nov 12 07:37:40 2011 -0500
 
-	* include/ffi.h.in (ffi_closure_alloc, ffi_closure_free): New.
-	(ffi_prep_closure_loc): New.
-	(ffi_prep_raw_closure_loc): New.
-	(ffi_prep_java_raw_closure_loc): New.
-	* src/closures.c: New file.
-	* src/dlmalloc.c [FFI_MMAP_EXEC_WRIT] (struct malloc_segment):
-	Replace sflags with exec_offset.
-	[FFI_MMAP_EXEC_WRIT] (mmap_exec_offset, add_segment_exec_offset,
-	sub_segment_exec_offset): New macros.
-	(get_segment_flags, set_segment_flags, check_segment_merge): New
-	macros.
-	(is_mmapped_segment, is_extern_segment): Use get_segment_flags.
-	(add_segment, sys_alloc, create_mspace, create_mspace_with_base,
-	destroy_mspace): Use new macros.
-	(sys_alloc): Silence warning.
-	* Makefile.am (libffi_la_SOURCES): Add src/closures.c.
-	* Makefile.in: Rebuilt.
-	* src/prep_cif [FFI_CLOSURES] (ffi_prep_closure): Implement in
-	terms of ffi_prep_closure_loc.
-	* src/raw_api.c (ffi_prep_raw_closure_loc): Renamed and adjusted
-	from...
-	(ffi_prep_raw_closure): ... this.  Re-implement in terms of the
-	renamed version.
-	* src/java_raw_api (ffi_prep_java_raw_closure_loc): Renamed and
-	adjusted from...
-	(ffi_prep_java_raw_closure): ... this.  Re-implement in terms of
-	the renamed version.
-	* src/alpha/ffi.c (ffi_prep_closure_loc): Renamed from
-	(ffi_prep_closure): ... this.
-	* src/pa/ffi.c: Likewise.
-	* src/cris/ffi.c: Likewise.  Adjust.
-	* src/frv/ffi.c: Likewise.
-	* src/ia64/ffi.c: Likewise.
-	* src/mips/ffi.c: Likewise.
-	* src/powerpc/ffi_darwin.c: Likewise.
-	* src/s390/ffi.c: Likewise.
-	* src/sh/ffi.c: Likewise.
-	* src/sh64/ffi.c: Likewise.
-	* src/sparc/ffi.c: Likewise.
-	* src/x86/ffi64.c: Likewise.
-	* src/x86/ffi.c: Likewise.
-	(FFI_INIT_TRAMPOLINE): Adjust.
-	(ffi_prep_raw_closure_loc): Renamed and adjusted from...
-	(ffi_prep_raw_closure): ... this.
-	* src/powerpc/ffi.c (ffi_prep_closure_loc): Renamed from
-	(ffi_prep_closure): ... this.
-	(flush_icache): Adjust.
+    Fix darwin11 build problem
 
-2007-03-07  Alexandre Oliva  <aoliva@redhat.com>
+commit c411f140f305ebb00d33c92b7cb2742bcd241b6a
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Nov 12 07:32:36 2011 -0500
 
-	* src/dlmalloc.c: New file, imported version 2.8.3 of Doug
-	Lea's malloc.
+    Fix ax_enable_builddir macro on BSD systems
 
-2007-03-01  Brooks Moses  <brooks.moses@codesourcery.com>
+commit 3d56106b07735abef6ae9f032e94f560a0ed2f30
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Nov 12 07:20:24 2011 -0500
 
-	* Makefile.am: Add dummy install-pdf target.
-	* Makefile.in: Regenerate
+    Rebase
 
-2007-02-13  Andreas Krebbel  <krebbel1@de.ibm.com>
+commit 8c01954c50bf8ef2e00a3db166060a1b8f83a20d
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Sep 6 14:26:32 2011 -0400
 
-	* src/s390/ffi.c (ffi_prep_args, ffi_prep_cif_machdep,
-	ffi_closure_helper_SYSV): Add long double handling.
+    Build assembly files with debug info
 
-2007-02-02  Jakub Jelinek  <jakub@redhat.com>
+commit fed646a2078969f4ce89c29107f1e72e03f4a977
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Sep 6 09:50:20 2011 -0400
 
-	* src/powerpc/linux64.S (ffi_call_LINUX64): Move restore of r2
-	immediately after bctrl instruction.
+    Regenerate configury with missing m4 macros
 
-2007-01-18  Alexandre Oliva  <aoliva@redhat.com>
+commit d76441cf71216f8f1e62e7ec852a7f4e21371ec8
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Aug 24 10:14:23 2011 -0400
 
-	* Makefile.am (all-recursive, install-recursive,
-	mostlyclean-recursive, clean-recursive, distclean-recursive,
-	maintainer-clean-recursive): Add missing targets.
-	* Makefile.in: Rebuilt.
+    Update list of supported OpenBSD systems
 
-2006-12-14  Andreas Tobler  <a.tobler@schweiz.org>
+commit ee6696fdf4768ba6dd037fb6dd99435afa13816e
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Aug 23 12:30:29 2011 -0400
 
-	* configure.ac: Add TARGET for x86_64-*-darwin*.
-	* Makefile.am (nodist_libffi_la_SOURCES): Add rules for 64-bit sources
-	for X86_DARWIN.
-	* src/x86/ffitarget.h: Set trampoline size for x86_64-*-darwin*.
-	* src/x86/darwin64.S: New file for x86_64-*-darwin* support.
-	* configure: Regenerate.
-	* Makefile.in: Regenerate.
-	* include/Makefile.in: Regenerate.
-	* testsuite/Makefile.in: Regenerate.
-	* testsuite/libffi.special/unwindtest_ffi_call.cc: New test case for
-	ffi_call only.
+    3.0.11-rc1. soname bump.
 
-2006-12-13  Andreas Tobler <a.tobler@schweiz.org>
+commit c6265c36a91eab8175d0e72db84d8225418f2379
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Aug 23 10:31:33 2011 -0400
 
-	* aclocal.m4: Regenerate with aclocal -I .. as written in the
-	Makefile.am.
+    Version 3.0.10
 
-2006-10-31  Geoffrey Keating  <geoffk@apple.com>
+commit cc5e41bf32d18a14dbdd653d52eacdbdc934c392
+Author: Anthony Green <green@moxielogic.com>
+Date:   Mon Aug 22 16:34:24 2011 -0400
 
-	* src/powerpc/ffi_darwin.c (darwin_adjust_aggregate_sizes): New.
-	(ffi_prep_cif_machdep): Call darwin_adjust_aggregate_sizes for
-	Darwin.
-	* testsuite/libffi.call/nested_struct4.c: Remove Darwin XFAIL.
-	* testsuite/libffi.call/nested_struct6.c: Remove Darwin XFAIL.
+    Fix use of autoconf macros
 
-2006-10-10  Paolo Bonzini  <bonzini@gnu.org>
-	    Sandro Tolaini  <tolaini@libero.it>
+commit 049d8386ff52399e69a530b55b9feedc8a2589d2
+Author: Anthony Green <green@moxielogic.com>
+Date:   Mon Aug 22 14:50:10 2011 -0400
 
-	* configure.ac [i*86-*-darwin*]: Set X86_DARWIN symbol and
-	conditional.
-	* configure: Regenerated.
-	* Makefile.am (nodist_libffi_la_SOURCES) [X86_DARWIN]: New case.
-	(EXTRA_DIST): Add src/x86/darwin.S.
-	* Makefile.in: Regenerated.
-	* include/Makefile.in: Regenerated.
-	* testsuite/Makefile.in: Regenerated.
+    Many new patches
 
-	* src/x86/ffi.c (ffi_prep_cif_machdep) [X86_DARWIN]: Treat like
-	X86_WIN32, and additionally align stack to 16 bytes.
-	* src/x86/darwin.S: New, based on sysv.S.
-	* src/prep_cif.c (ffi_prep_cif) [X86_DARWIN]: Align > 8-byte structs.
+commit 3b7efa4e74f0dcebf70b447391987aedd3473306
+Author: Anthony Green <green@moxielogic.com>
+Date:   Mon Aug 15 13:25:13 2011 -0400
 
-2006-09-12  David Daney  <ddaney@avtrex.com>
+    Revert remove-debug-code patch temporarily (for ARM Fedora release)
 
-	PR libffi/23935
-	* include/Makefile.am: Install both ffi.h and ffitarget.h in
-	$(libdir)/gcc/$(target_alias)/$(gcc_version)/include.
-	* aclocal.m4: Regenerated for automake 1.9.6.
-	* Makefile.in: Regenerated.
-	* include/Makefile.in: Regenerated.
-	* testsuite/Makefile.in: Regenerated.
+commit d992ac54a2a9e7e064ffebcb91e05e7cb86185c7
+Author: Anthony Green <green@gmachine.(none)>
+Date:   Fri Jul 29 17:32:53 2011 -0400
 
-2006-08-17  Andreas Tobler  <a.tobler@schweiz.ch>
+    Refresh from GCC
 
-	* include/ffi_common.h (struct): Revert accidental commit.
+commit 2d3fb36420e09304220ee6c0652bae5eccdb965d
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Mar 30 16:54:42 2011 -0400
 
-2006-08-15  Andreas Tobler  <a.tobler@schweiz.ch>
+    Fix darwin EH
 
-	* include/ffi_common.h: Remove lint directives.
-	* include/ffi.h.in: Likewise.
+commit 30ff28e1d8cd9ed5319f1fbe9c7cccacc8161fb3
+Author: Anthony Green <green@moxielogic.com>
+Date:   Mon Feb 28 15:36:23 2011 -0500
 
-2006-07-25  Torsten Schoenfeld  <kaffeetisch@gmx.de>
+    Fix permissions
 
-	* include/ffi.h.in (ffi_type_ulong, ffi_type_slong): Define correctly
-	for 32-bit architectures.
-	* testsuite/libffi.call/return_ul.c: New test case.
+commit 09f8f310f4f53a24289682d3d28f4399d7bafc3b
+Author: Anthony Green <green@moxielogic.com>
+Date:   Mon Feb 28 15:36:07 2011 -0500
 
-2006-07-19  David Daney  <ddaney@avtrex.com>
+    More AIX fixes. rc9.
 
-	* testsuite/libffi.call/closure_fn6.c: Remove xfail for mips,
-	xfail remains for mips64.
+commit 53d7b165642c220aa5166ba350b490802f359b54
+Merge: 18dd85d 3000dc2
+Author: Anthony Green <green@moxielogic.com>
+Date:   Mon Feb 28 15:23:31 2011 -0500
 
-2006-05-23  Carlos O'Donell  <carlos@codesourcery.com>
+    Merge branch 'master' of https://github.com/landonf/libffi-ios
 
-	* Makefile.am: Add install-html target. Add install-html to .PHONY
-	* Makefile.in: Regenerate.
-	* aclocal.m4: Regenerate.
-	* include/Makefile.in: Regenerate.
-	* testsuite/Makefile.in: Regenerate.
+commit 18dd85d6cb9f3f3eea2a3b70eb4e150045905c55
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Feb 25 16:23:04 2011 -0500
 
-2006-05-18  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+    rc8. fix last patch.
 
-	* pa/ffi.c (ffi_prep_args_pa32): Load floating point arguments from
-	stack slot.
+commit 74ee6ea8b42e60d44a3ae8938b1e42a38c1e66b4
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Feb 25 15:52:14 2011 -0500
 
-2006-04-22  Andreas Tobler  <a.tobler@schweiz.ch>
+    rc7.  More AIX fixes.
 
-	* README: Remove notice about 'Crazy Comments'.
-	* src/debug.c: Remove lint directives. Cleanup white spaces.
-	* src/java_raw_api.c: Likewise.
-	* src/prep_cif.c: Likewise.
-	* src/raw_api.c: Likewise.
-	* src/ffitest.c: Delete. No longer needed, all test cases migrated
-	to the testsuite.
-	* src/arm/ffi.c: Remove lint directives.
-	* src/m32r/ffi.c: Likewise.
-	* src/pa/ffi.c: Likewise.
-	* src/powerpc/ffi.c: Likewise.
-	* src/powerpc/ffi_darwin.c: Likewise.
-	* src/sh/ffi.c: Likewise.
-	* src/sh64/ffi.c: Likewise.
-	* src/x86/ffi.c: Likewise.
-	* testsuite/libffi.call/float2.c: Likewise.
-	* testsuite/libffi.call/promotion.c: Likewise.
-	* testsuite/libffi.call/struct1.c: Likewise.
+commit 2541679dbd3db0014890f42192dbf8008ab923fa
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Feb 25 15:09:13 2011 -0500
 
-2006-04-13  Andreas Tobler  <a.tobler@schweiz.ch>
+    Fix ppc32 bug
 
-	* src/pa/hpux32.S: Correct unwind offset calculation for
-	ffi_closure_pa32.
-	* src/pa/linux.S: Likewise.
+commit cbb062cc35c518004f1ab45c847f8ec4f66069ad
+Author: Anthony Green <green@moxielogic.com>
+Date:   Thu Feb 17 20:39:21 2011 -0500
 
-2006-04-12  James E Wilson  <wilson@specifix.com>
+    Another non-GCC configury fix
 
-	PR libgcj/26483
-	* src/ia64/ffi.c (stf_spill, ldf_fill): Rewrite as macros.
-	(hfa_type_load): Call stf_spill.
-	(hfa_type_store): Call ldf_fill.
-	(ffi_call): Adjust calls to above routines.  Add local temps for
-	macro result.
+commit 8cf8878425e9971866fa6b27a3e4914729ad3960
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Feb 15 15:19:49 2011 -0500
 
-2006-04-10  Matthias Klose  <doko@debian.org>
+    Fix ax_cc_maxopt.m4
 
-	* testsuite/lib/libffi-dg.exp (libffi-init): Recognize multilib
-	directory names containing underscores.
+commit 24b72070c0937f9000744c77a636f07e04786b6a
+Author: Anthony Green <green@moxielogic.com>
+Date:   Mon Feb 14 15:30:57 2011 -0500
 
-2006-04-07  James E Wilson  <wilson@specifix.com>
+    Fix warning and msvcc patches
 
-	* testsuite/libffi.call/float4.c: New testcase.
+commit d72c49e556a8c516e97f6722d1be2f1209c21207
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sun Feb 13 11:41:05 2011 -0500
 
-2006-04-05  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
-	    Andreas Tobler  <a.tobler@schweiz.ch>
+    Add missing msvcc.sh
 
-	* Makefile.am: Add PA_HPUX port.
-	* Makefile.in: Regenerate.
-	* include/Makefile.in: Likewise.
-	* testsuite/Makefile.in: Likewise.
-	* configure.ac: Add PA_HPUX rules.
-	* configure: Regenerate.
-	* src/pa/ffitarget.h: Rename linux target to PA_LINUX.
-	Add PA_HPUX and PA64_HPUX.
-	Rename FFI_LINUX ABI to FFI_PA32 ABI.
-	(FFI_TRAMPOLINE_SIZE): Define for 32-bit HP-UX targets.
-	(FFI_TYPE_SMALL_STRUCT2): Define.
-	(FFI_TYPE_SMALL_STRUCT4): Likewise.
-	(FFI_TYPE_SMALL_STRUCT8): Likewise.
-	(FFI_TYPE_SMALL_STRUCT3): Redefine.
-	(FFI_TYPE_SMALL_STRUCT5): Likewise.
-	(FFI_TYPE_SMALL_STRUCT6): Likewise.
-	(FFI_TYPE_SMALL_STRUCT7): Likewise.
-	* src/pa/ffi.c (ROUND_DOWN): Delete.
-	(fldw, fstw, fldd, fstd): Use '__asm__'.
-	(ffi_struct_type): Add support for FFI_TYPE_SMALL_STRUCT2,
-	FFI_TYPE_SMALL_STRUCT4 and FFI_TYPE_SMALL_STRUCT8.
-	(ffi_prep_args_LINUX): Rename to ffi_prep_args_pa32. Update comment.
-	Simplify incrementing of stack slot variable. Change type of local
-	'n' to unsigned int.
-	(ffi_size_stack_LINUX): Rename to ffi_size_stack_pa32. Handle long
-	double on PA_HPUX.
-	(ffi_prep_cif_machdep): Likewise.
-	(ffi_call): Likewise.
-	(ffi_closure_inner_LINUX): Rename to ffi_closure_inner_pa32. Change
-	return type to ffi_status. Simplify incrementing of stack slot
-	variable. Only copy floating point argument registers when PA_LINUX
-	is true. Reformat debug statement.
-	Add support for FFI_TYPE_SMALL_STRUCT2, FFI_TYPE_SMALL_STRUCT4 and
-	FFI_TYPE_SMALL_STRUCT8.
-	(ffi_closure_LINUX): Rename to ffi_closure_pa32. Add 'extern' to
-	declaration.
-	(ffi_prep_closure): Make linux trampoline conditional on PA_LINUX.
-	Add nops to cache flush.  Add trampoline for PA_HPUX.
-	* src/pa/hpux32.S: New file.
-	* src/pa/linux.S (ffi_call_LINUX): Rename to ffi_call_pa32. Rename
-	ffi_prep_args_LINUX to ffi_prep_args_pa32.
-	Localize labels. Add support for 2, 4 and 8-byte small structs. Handle
-	unaligned destinations in 3, 5, 6 and 7-byte small structs. Order
-	argument type checks so that common argument types appear first.
-	(ffi_closure_LINUX): Rename to ffi_closure_pa32. Rename
-	ffi_closure_inner_LINUX to ffi_closure_inner_pa32.
+commit 3000dc237f6017a7445d8404097a4f46b73fdd29
+Merge: 55e4a5a 1fbf9dc
+Author: Landon Fuller <landonf@bikemonkey.org>
+Date:   Sun Feb 13 08:55:53 2011 -0500
 
-2006-03-24  Alan Modra  <amodra@bigpond.net.au>
+    Merge remote branch 'upstream/master'
 
-	* src/powerpc/ffitarget.h (enum ffi_abi): Add FFI_LINUX.  Default
-	for 32-bit using IBM extended double format.  Fix FFI_LAST_ABI.
-	* src/powerpc/ffi.c (ffi_prep_args_SYSV): Handle linux variant of
-	FFI_TYPE_LONGDOUBLE.
-	(ffi_prep_args64): Assert using IBM extended double.
-	(ffi_prep_cif_machdep): Don't munge FFI_TYPE_LONGDOUBLE type.
-	Handle FFI_LINUX FFI_TYPE_LONGDOUBLE return and args.
-	(ffi_call): Handle FFI_LINUX.
-	(ffi_closure_helper_SYSV): Non FFI_LINUX long double return needs
-	gpr3 return pointer as for struct return.  Handle FFI_LINUX
-	FFI_TYPE_LONGDOUBLE return and args.  Don't increment "nf"
-	unnecessarily.
-	* src/powerpc/ppc_closure.S (ffi_closure_SYSV): Load both f1 and f2
-	for FFI_TYPE_LONGDOUBLE.  Move epilogue insns into case table.
-	Don't use r6 as pointer to results, instead use sp offset.  Don't
-	make a special call to load lr with case table address, instead
-	use offset from previous call.
-	* src/powerpc/sysv.S (ffi_call_SYSV): Save long double return.
-	* src/powerpc/linux64.S (ffi_call_LINUX64): Simplify long double
-	return.
+commit 1fbf9dc44feea564e84ad7406d17c5d5906ce0e0
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sun Feb 13 08:06:39 2011 -0500
 
-2006-03-15  Kaz Kojima  <kkojima@gcc.gnu.org>
+    Fix bad_abi test. rc5.
 
-	* src/sh64/ffi.c (ffi_prep_cif_machdep): Handle float arguments
-	passed with FP registers correctly.
-	(ffi_closure_helper_SYSV): Likewise.
-	* src/sh64/sysv.S: Likewise.
+commit 90af15ef5c1614b76370c4d13954586fabf9e8e3
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Feb 12 12:29:36 2011 -0500
 
-2006-03-01  Andreas Tobler  <a.tobler@schweiz.ch>
+    iOS fixes
 
-	* testsuite/libffi.special/unwindtest.cc (closure_test_fn): Mark cif,
-	args and userdata unused.
-	(closure_test_fn1): Mark cif and userdata unused.
-	(main): Remove unused res.
+commit 55e4a5aa1568558a04aa40f16fc022e459af53e3
+Author: Landon Fuller <landonf@bikemonkey.org>
+Date:   Sat Feb 12 12:13:46 2011 -0500
 
-2006-02-28  Andreas Tobler  <a.tobler@schweiz.ch>
+    Add support for building a full armv6/armv7/i386 universal iOS library
 
-	* testsuite/libffi.call/call.exp: Adjust FSF address. Add test runs for
-	-O2, -O3, -Os and the warning flags -W -Wall.
-	* testsuite/libffi.special/special.exp: Likewise.
-	* testsuite/libffi.call/ffitest.h: Add an __UNUSED__ macro to mark
-	unused parameter unused for gcc or else do nothing.
-	* testsuite/libffi.special/ffitestcxx.h: Likewise.
-	* testsuite/libffi.call/cls_12byte.c (cls_struct_12byte_gn): Mark cif
-	and userdata unused.
-	* testsuite/libffi.call/cls_16byte.c (cls_struct_16byte_gn): Likewise.
-	* testsuite/libffi.call/cls_18byte.c (cls_struct_18byte_gn): Likewise.
-	* testsuite/libffi.call/cls_19byte.c (cls_struct_19byte_gn): Likewise.
-	* testsuite/libffi.call/cls_1_1byte.c (cls_struct_1_1byte_gn): Likewise.
-	* testsuite/libffi.call/cls_20byte.c (cls_struct_20byte_gn): Likewise.
-	* testsuite/libffi.call/cls_20byte1.c (cls_struct_20byte_gn): Likewise.
-	* testsuite/libffi.call/cls_24byte.c (cls_struct_24byte_gn): Likewise.
-	* testsuite/libffi.call/cls_2byte.c (cls_struct_2byte_gn): Likewise.
-	* testsuite/libffi.call/cls_3_1byte.c (cls_struct_3_1byte_gn): Likewise.
-	* testsuite/libffi.call/cls_3byte1.c (cls_struct_3byte_gn): Likewise.
-	* testsuite/libffi.call/cls_3byte2.c (cls_struct_3byte_gn1): Likewise.
-	* testsuite/libffi.call/cls_4_1byte.c (cls_struct_4_1byte_gn): Likewise.
-	* testsuite/libffi.call/cls_4byte.c (cls_struct_4byte_gn): Likewise.
-	* testsuite/libffi.call/cls_5_1_byte.c (cls_struct_5byte_gn): Likewise.
-	* testsuite/libffi.call/cls_5byte.c (cls_struct_5byte_gn): Likewise.
-	* testsuite/libffi.call/cls_64byte.c (cls_struct_64byte_gn): Likewise.
-	* testsuite/libffi.call/cls_6_1_byte.c (cls_struct_6byte_gn): Likewise.
-	* testsuite/libffi.call/cls_6byte.c (cls_struct_6byte_gn): Likewise.
-	* testsuite/libffi.call/cls_7_1_byte.c (cls_struct_7byte_gn): Likewise.
-	* testsuite/libffi.call/cls_7byte.c (cls_struct_7byte_gn): Likewise.
-	* testsuite/libffi.call/cls_8byte.c (cls_struct_8byte_gn): Likewise.
-	* testsuite/libffi.call/cls_9byte1.c (cls_struct_9byte_gn): Likewise.
-	* testsuite/libffi.call/cls_9byte2.c (cls_struct_9byte_gn): Likewise.
-	* testsuite/libffi.call/cls_align_double.c (cls_struct_align_gn):
-	Likewise.
-	* testsuite/libffi.call/cls_align_float.c (cls_struct_align_gn):
-	Likewise.
-	* testsuite/libffi.call/cls_align_longdouble.c (cls_struct_align_gn):
-	Likewise.
-	* testsuite/libffi.call/cls_align_pointer.c (cls_struct_align_fn): Cast
-	void* to avoid compiler warning.
-	(main): Likewise.
-	(cls_struct_align_gn): Mark cif and userdata unused.
-	* testsuite/libffi.call/cls_align_sint16.c (cls_struct_align_gn):
-	Likewise.
-	* testsuite/libffi.call/cls_align_sint32.c (cls_struct_align_gn):
-	Likewise.
-	* testsuite/libffi.call/cls_align_sint64.c (cls_struct_align_gn):
-	Likewise.
-	* testsuite/libffi.call/cls_align_uint16.c (cls_struct_align_gn):
-	Likewise.
-	* testsuite/libffi.call/cls_align_uint32.c (cls_struct_align_gn):
-	Likewise.
-	* testsuite/libffi.call/cls_double.c (cls_ret_double_fn): Likewise.
-	* testsuite/libffi.call/cls_float.c (cls_ret_float_fn): Likewise.
-	* testsuite/libffi.call/cls_multi_schar.c (test_func_gn): Mark cif and
-	data unused.
-	(main): Cast res_call to silence gcc.
-	* testsuite/libffi.call/cls_multi_sshort.c (test_func_gn): Mark cif and
-	data unused.
-	(main): Cast res_call to silence gcc.
-	* testsuite/libffi.call/cls_multi_sshortchar.c (test_func_gn): Mark cif
-	and data unused.
-	(main): Cast res_call to silence gcc.
-	* testsuite/libffi.call/cls_multi_uchar.c (test_func_gn): Mark cif and
-	data unused.
-	(main): Cast res_call to silence gcc.
-	* testsuite/libffi.call/cls_multi_ushort.c (test_func_gn): Mark cif and
-	data unused.
-	(main): Cast res_call to silence gcc.
-	* testsuite/libffi.call/cls_multi_ushortchar.c (test_func_gn): Mark cif
-	and data unused.
-	(main): Cast res_call to silence gcc.
-	* testsuite/libffi.call/cls_schar.c (cls_ret_schar_fn): Mark cif and
-	userdata unused.
-	(cls_ret_schar_fn): Cast printf parameter to silence gcc.
-	* testsuite/libffi.call/cls_sint.c (cls_ret_sint_fn): Mark cif and
-	userdata unused.
-	(cls_ret_sint_fn): Cast printf parameter to silence gcc.
-	* testsuite/libffi.call/cls_sshort.c (cls_ret_sshort_fn): Mark cif and
-	userdata unused.
-	(cls_ret_sshort_fn): Cast printf parameter to silence gcc.
-	* testsuite/libffi.call/cls_uchar.c (cls_ret_uchar_fn):  Mark cif and
-	userdata unused.
-	(cls_ret_uchar_fn): Cast printf parameter to silence gcc.
-	* testsuite/libffi.call/cls_uint.c (cls_ret_uint_fn): Mark cif and
-	userdata unused.
-	(cls_ret_uint_fn): Cast printf parameter to silence gcc.
-	* testsuite/libffi.call/cls_ulonglong.c (cls_ret_ulonglong_fn): Mark cif
-	and userdata unused.
-	* testsuite/libffi.call/cls_ushort.c (cls_ret_ushort_fn): Mark cif and
-	userdata unused.
-	(cls_ret_ushort_fn): Cast printf parameter to silence gcc.
-	* testsuite/libffi.call/float.c (floating): Remove unused parameter e.
-	* testsuite/libffi.call/float1.c (main): Remove unused variable i.
-	Cleanup white spaces.
-	* testsuite/libffi.call/negint.c (checking): Remove unused variable i.
-	* testsuite/libffi.call/nested_struct.c (cls_struct_combined_gn): Mark
-	cif and userdata unused.
-	* testsuite/libffi.call/nested_struct1.c (cls_struct_combined_gn):
-	Likewise.
-	* testsuite/libffi.call/nested_struct10.c (B_gn): Likewise.
-	* testsuite/libffi.call/nested_struct2.c (B_fn): Adjust printf
-	formatters to silence gcc.
-	(B_gn): Mark cif and userdata unused.
-	* testsuite/libffi.call/nested_struct3.c (B_gn): Mark cif and userdata
-	unused.
-	* testsuite/libffi.call/nested_struct4.c: Mention related PR.
-	(B_gn): Mark cif and userdata unused.
-	* testsuite/libffi.call/nested_struct5.c (B_gn): Mark cif and userdata
-	unused.
-	* testsuite/libffi.call/nested_struct6.c: Mention related PR.
-	(B_gn): Mark cif and userdata unused.
-	* testsuite/libffi.call/nested_struct7.c (B_gn): Mark cif and userdata
-	unused.
-	* testsuite/libffi.call/nested_struct8.c (B_gn): Likewise.
-	* testsuite/libffi.call/nested_struct9.c (B_gn): Likewise.
-	* testsuite/libffi.call/problem1.c (stub): Likewise.
-	* testsuite/libffi.call/pyobjc-tc.c (main): Cast the result to silence
-	gcc.
-	* testsuite/libffi.call/return_fl2.c (return_fl): Add the note mentioned
-	in the last commit for this test case in the test case itself.
-	* testsuite/libffi.call/closure_fn0.c (closure_test_fn0): Mark cif as
-	unused.
-	* testsuite/libffi.call/closure_fn1.c (closure_test_fn1): Likewise.
-	* testsuite/libffi.call/closure_fn2.c (closure_test_fn2): Likewise.
-	* testsuite/libffi.call/closure_fn3.c (closure_test_fn3): Likewise.
-	* testsuite/libffi.call/closure_fn4.c (closure_test_fn0): Likewise.
-	* testsuite/libffi.call/closure_fn5.c (closure_test_fn5): Likewise.
-	* testsuite/libffi.call/closure_fn6.c (closure_test_fn0): Likewise.
+commit a0c80f279b8733d001cb5e5c5a3289ecb7a6e56a
+Author: Landon Fuller <landonf@bikemonkey.org>
+Date:   Sat Feb 12 11:43:49 2011 -0500
 
-2006-02-22  Kaz Kojima  <kkojima@gcc.gnu.org>
+    Update my e-mail address.
 
-	* src/sh/sysv.S: Fix register numbers in the FDE for
-	ffi_closure_SYSV.
+commit 8195e0e11df7a53fa474caa9375f73ca1136ed66
+Author: Landon Fuller <landonf@bikemonkey.org>
+Date:   Sat Feb 12 11:27:00 2011 -0500
 
-2006-02-20  Andreas Tobler  <a.tobler@schweiz.ch>
+    Fix symbol prefixes on Darwin.
 
-	* testsuite/libffi.call/return_fl2.c (return_fl): Remove static
-	declaration to avoid a false negative on ix86. See PR323.
+commit 56b3f8cef0f28cefaa0f40fe0cf7c524adef131d
+Author: Landon Fuller <landonf@bikemonkey.org>
+Date:   Sat Feb 12 11:14:54 2011 -0500
 
-2006-02-18  Kaz Kojima  <kkojima@gcc.gnu.org>
+    Modify the ffi_closure structures to hold table/table entry pointers instead of a code buffer.
+    
+    This re-integrates commit da2773e02ab26cc11a7f.
 
-	* src/sh/ffi.c (ffi_closure_helper_SYSV): Remove unused variable
-	and cast integer to void * if needed.  Update the pointer to
-	the FP register saved area correctly.
+commit 28a00f61ff3f64c4eb2269ce2aea3d493274469e
+Author: Landon Fuller <landonf@bikemonkey.org>
+Date:   Sat Feb 12 11:01:48 2011 -0500
 
-2006-02-17  Andreas Tobler  <a.tobler@schweiz.ch>
+    Apple assembler support; fixed most gas/ELF-isms.
 
-	* testsuite/libffi.call/nested_struct6.c: XFAIL this test until PR25630
-	is fixed.
-	* testsuite/libffi.call/nested_struct4.c: Likewise.
+commit 7f2ea33a80bfced5e48ed7292f3b8f057d54ff8f
+Author: Landon Fuller <landonf@bikemonkey.org>
+Date:   Sat Feb 12 10:39:18 2011 -0500
 
-2006-02-16  Andreas Tobler  <a.tobler@schweiz.ch>
+    Replace RETLDM macro.
+    
+    The macro is incompatible with Apple's assembler; switch to
+    a simple inline version.
 
-	* testsuite/libffi.call/return_dbl.c: New test case.
-	* testsuite/libffi.call/return_dbl1.c: Likewise.
-	* testsuite/libffi.call/return_dbl2.c: Likewise.
-	* testsuite/libffi.call/return_fl.c: Likewise.
-	* testsuite/libffi.call/return_fl1.c: Likewise.
-	* testsuite/libffi.call/return_fl2.c: Likewise.
-	* testsuite/libffi.call/return_fl3.c: Likewise.
-	* testsuite/libffi.call/closure_fn6.c: Likewise.
+commit 92ff23e77fa586455b427b71f49e1d9502470e6e
+Author: Landon Fuller <landonf@bikemonkey.org>
+Date:   Sat Feb 12 10:24:49 2011 -0500
 
-	* testsuite/libffi.call/nested_struct2.c: Remove ffi_type_mylong
-	definition.
-	* testsuite/libffi.call/ffitest.h: Add ffi_type_mylong definition
-	here to be used by other test cases too.
+    Switch to the current iOS 4.2 SDK.
 
-	* testsuite/libffi.call/nested_struct10.c: New test case.
-	* testsuite/libffi.call/nested_struct9.c: Likewise.
-	* testsuite/libffi.call/nested_struct8.c: Likewise.
-	* testsuite/libffi.call/nested_struct7.c: Likewise.
-	* testsuite/libffi.call/nested_struct6.c: Likewise.
-	* testsuite/libffi.call/nested_struct5.c: Likewise.
-	* testsuite/libffi.call/nested_struct4.c: Likewise.
+commit 58fb8ca2dfb89ad70284bb9678d3d4dbb658c8a7
+Merge: cc3fbd9 71c792f
+Author: Landon Fuller <landonf@bikemonkey.org>
+Date:   Sat Feb 12 10:23:19 2011 -0500
 
-2006-01-21  Andreas Tobler  <a.tobler@schweiz.ch>
+    Merge remote branch 'upstream/master'
 
-	* configure.ac: Enable libffi for sparc64-*-freebsd*.
-	* configure: Rebuilt.
+commit cc3fbd975ce9366d4c40a6ff6c108f664867bd7c
+Merge: e449a43 f6ab3ed
+Author: Landon Fuller <landonf@bikemonkey.org>
+Date:   Sat Feb 12 10:21:02 2011 -0500
 
-2006-01-18  Jakub Jelinek  <jakub@redhat.com>
+    Merge branch 'master' of github.com:landonf/libffi-ios
 
-	* src/powerpc/sysv.S (smst_two_register): Don't call __ashldi3,
-	instead do the shifting inline.
-	* src/powerpc/ppc_closure.S (ffi_closure_SYSV): Don't compute %r5
-	shift count unconditionally.  Simplify load sequences for 1, 2, 3, 4
-	and 8 byte structs, for the remaining struct sizes don't call
-	__lshrdi3, instead do the shifting inline.
+commit e449a43bbe12f8119399928db1ae26adc71dde14
+Author: Landon Fuller <landonf@bikemonkey.org>
+Date:   Sat Feb 12 10:20:42 2011 -0500
 
-2005-12-07  Thiemo Seufer  <ths@networkno.de>
+    Allow specification of the minimum supported iOS version.
 
-	* src/mips/ffitarget.h: Remove obsolete sgidefs.h include. Add
-	missing parentheses.
-	* src/mips/o32.S (ffi_call_O32): Code formatting. Define
-	and use A3_OFF, FP_OFF, RA_OFF. Micro-optimizations.
-	(ffi_closure_O32): Likewise, but with newly defined A3_OFF2,
-	A2_OFF2, A1_OFF2, A0_OFF2, RA_OFF2, FP_OFF2, S0_OFF2, GP_OFF2,
-	V1_OFF2, V0_OFF2, FA_1_1_OFF2, FA_1_0_OFF2, FA_0_1_OFF2,
-	FA_0_0_OFF2.
-	* src/mips/ffi.c (ffi_prep_args): Code formatting. Fix
-	endianness bugs.
-	(ffi_prep_closure): Improve trampoline instruction scheduling.
-	(ffi_closure_mips_inner_O32): Fix endianness bugs.
+commit 71c792f51bcf3e2f334e5ea1fb1a8b667cb3aedb
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Feb 12 09:33:11 2011 -0500
 
-2005-12-03  Alan Modra  <amodra@bigpond.net.au>
+    rc4
 
-	* src/powerpc/ffi.c: Formatting.
-	(ffi_prep_args_SYSV): Avoid possible aliasing problems by using unions.
-	(ffi_prep_args64): Likewise.
+commit 7c7c9f327299331022f6000603a35f2310dfe308
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Feb 12 09:29:29 2011 -0500
 
-2005-09-30  Geoffrey Keating  <geoffk@apple.com>
+    ungccify parts of the build
 
-	* testsuite/lib/libffi-dg.exp (libffi_target_compile): For
-	darwin, use -shared-libgcc not -lgcc_s, and explain why.
+commit ed62e48b95a0fa60b685f647cb73c9e190eec35c
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Feb 11 12:23:58 2011 -0500
 
-2005-09-26  Tom Tromey  <tromey@redhat.com>
+    Fix permissions
 
-	* testsuite/libffi.call/float1.c (value_type): New typedef.
-	(CANARY): New define.
-	(main): Check for result buffer overflow.
-	* src/powerpc/linux64.S: Handle linux64 long double returns.
-	* src/powerpc/ffi.c (FLAG_RETURNS_128BITS): New constant.
-	(ffi_prep_cif_machdep): Handle linux64 long double returns.
+commit 17d9e9e68ddb1b915a0b9751713033861b598575
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Feb 11 12:23:20 2011 -0500
 
-2005-08-25  Alan Modra  <amodra@bigpond.net.au>
+    Use newer autotools.  Only build debug.c when --enable-debug.
 
-	PR target/23404
-	* src/powerpc/ffi.c (ffi_prep_args_SYSV): Correct placement of stack
-	homed fp args.
-	(ffi_status ffi_prep_cif_machdep): Correct stack sizing for same.
+commit 6972a4ffda75761eaab7dfbe0fb1516b255e8e0c
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Feb 11 07:32:51 2011 -0500
 
-2005-08-11  Jakub Jelinek  <jakub@redhat.com>
+    Fix xlc build on AIX
 
-	* configure.ac (HAVE_HIDDEN_VISIBILITY_ATTRIBUTE): New test.
-	(AH_BOTTOM): Add FFI_HIDDEN definition.
-	* configure: Rebuilt.
-	* fficonfig.h.in: Rebuilt.
-	* src/powerpc/ffi.c (hidden): Remove.
-	(ffi_closure_LINUX64, ffi_prep_args64, ffi_call_LINUX64,
-	ffi_closure_helper_LINUX64): Use FFI_HIDDEN instead of hidden.
-	* src/powerpc/linux64_closure.S (ffi_closure_LINUX64,
-	.ffi_closure_LINUX64): Use FFI_HIDDEN instead of .hidden.
-	* src/x86/ffi.c (ffi_closure_SYSV, ffi_closure_raw_SYSV): Remove,
-	add FFI_HIDDEN to its prototype.
-	(ffi_closure_SYSV_inner): New.
-	* src/x86/sysv.S (ffi_closure_SYSV, ffi_closure_raw_SYSV): New.
-	* src/x86/win32.S (ffi_closure_SYSV, ffi_closure_raw_SYSV): New.
+commit 1833aa0fb9831eb0725b63e35886c0f6d35df480
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Feb 11 07:11:04 2011 -0500
 
-2005-08-10  Alfred M. Szmidt  <ams@gnu.org>
+    sparc ABI test fix.
 
-	PR libffi/21819:
-	* configure: Rebuilt.
-	* configure.ac: Handle i*86-*-gnu*.
+commit f1fb139b4e283fffdcf205a903943d5e9d2bb2a2
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Feb 9 18:30:02 2011 -0500
 
-2005-08-09  Jakub Jelinek  <jakub@redhat.com>
+    Fix tests
 
-	* src/powerpc/ppc_closure.S (ffi_closure_SYSV): Use
-	DW_CFA_offset_extended_sf rather than
-	DW_CFA_GNU_negative_offset_extended.
-	* src/powerpc/sysv.S (ffi_call_SYSV): Likewise.
+commit 5cb470331d181c84d5d621e88868327a324a5898
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Feb 9 15:23:06 2011 -0500
 
-2005-07-22  SUGIOKA Toshinobu  <sugioka@itonet.co.jp>
+    Fix permissions
 
-	* src/sh/sysv.S (ffi_call_SYSV): Stop argument popping correctly
-	on sh3.
-	(ffi_closure_SYSV): Change the stack layout for sh3 struct argument.
-	* src/sh/ffi.c (ffi_prep_args): Fix sh3 argument copy, when it is
-	partially on register.
-	(ffi_closure_helper_SYSV): Likewise.
-	(ffi_prep_cif_machdep): Don't set too many cif->flags.
+commit 269deef6dbbb426695919d3398357fada3bb288c
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Feb 9 15:22:23 2011 -0500
 
-2005-07-20  Kaz Kojima  <kkojima@gcc.gnu.org>
+    rc3
 
-	* src/sh/ffi.c (ffi_call): Handle small structures correctly.
-	Remove empty line.
-	* src/sh64/ffi.c (simple_type): Remove.
-	(return_type): Handle small structures correctly.
-	(ffi_prep_args): Likewise.
-	(ffi_call): Likewise.
-	(ffi_closure_helper_SYSV): Likewise.
-	* src/sh64/sysv.S (ffi_call_SYSV): Handle 1, 2 and 4-byte return.
-	Emit position independent code if PIC and remove wrong datalabel
-	prefixes from EH data.
+commit 42695e72504f647444b8e8e9b90bd24f1e3220e1
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Feb 9 15:12:35 2011 -0500
 
-2005-07-19  Andreas Tobler  <a.tobler@schweiz.ch>
+    Fix IRIX support
 
-	* Makefile.am (nodist_libffi_la_SOURCES): Add POWERPC_FREEBSD.
-	* Makefile.in: Regenerate.
-	* include/Makefile.in: Likewise.
-	* testsuite/Makefile.in: Likewise.
-	* configure.ac: Add POWERPC_FREEBSD rules.
-	* configure: Regenerate.
-	* src/powerpc/ffitarget.h: Add POWERPC_FREEBSD rules.
-	(FFI_SYSV_TYPE_SMALL_STRUCT): Define.
-	* src/powerpc/ffi.c: Add flags to handle small structure returns
-	in ffi_call_SYSV.
-	(ffi_prep_cif_machdep): Handle small structures for SYSV 4 ABI.
-	Aka FFI_SYSV.
-	(ffi_closure_helper_SYSV): Likewise.
-	* src/powerpc/ppc_closure.S: Add return types for small structures.
-	* src/powerpc/sysv.S: Add bits to handle small structures for
-	final SYSV 4 ABI.
+commit a6e56b97f62a3feeb3301c24a2e4cae55e546021
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Feb 9 15:00:42 2011 -0500
 
-2005-07-10  Andreas Tobler  <a.tobler@schweiz.ch>
+    Add powerpc64-*-darwin* support
 
-	* testsuite/libffi.call/cls_5_1_byte.c: New test file.
-	* testsuite/libffi.call/cls_6_1_byte.c: Likewise.
-	* testsuite/libffi.call/cls_7_1_byte.c: Likewise.
+commit 747d6c32d4abb07c10c3a1f93579c3929aaa2487
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Feb 9 14:56:23 2011 -0500
 
-2005-07-05  Randolph Chung  <tausq@debian.org>
+    Add Interix support
 
-	* src/pa/ffi.c (ffi_struct_type): Rename FFI_TYPE_SMALL_STRUCT1
-	as FFI_TYPE_SMALL_STRUCT3.  Break out handling for 5-7 byte
-	structures.  Kill compilation warnings.
-	(ffi_closure_inner_LINUX): Print return values as hex in debug
-	message.  Rename FFI_TYPE_SMALL_STRUCT1 as FFI_TYPE_SMALL_STRUCT3.
-	Properly handle 5-7 byte structure returns.
-	* src/pa/ffitarget.h (FFI_TYPE_SMALL_STRUCT1)
-	(FFI_TYPE_SMALL_STRUCT2): Remove.
-	(FFI_TYPE_SMALL_STRUCT3, FFI_TYPE_SMALL_STRUCT5)
-	(FFI_TYPE_SMALL_STRUCT6, FFI_TYPE_SMALL_STRUCT7): Define.
-	* src/pa/linux.S: Mark source file as using PA1.1 assembly.
-	(checksmst1, checksmst2): Remove.
-	(checksmst3): Optimize handling of 3-byte struct returns.
-	(checksmst567): Properly handle 5-7 byte struct returns.
+commit eab6e41cde382aa07de6c011d514a14c0d62eb47
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Feb 9 10:15:02 2011 -0500
 
-2005-06-15  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
+    Remove README.markdown form libffi-ios
 
-	PR libgcj/21943
-	* src/mips/n32.S: Enforce PIC code.
-	* src/mips/o32.S: Likewise.
+commit 69dbe845f4ee3e6ce8999f17a1e4f2179ef7da89
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Feb 9 07:38:43 2011 -0500
 
-2005-06-15  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
+    Fix xfails
 
-	* configure.ac: Treat i*86-*-solaris2.10 and up as X86_64.
-	* configure: Regenerate.
+commit f498318c07b95137fe259d86bdbe15347588b84a
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Feb 9 06:26:46 2011 -0500
 
-2005-06-01  Alan Modra  <amodra@bigpond.net.au>
+    Update README for iOS again
 
-	* src/powerpc/ppc_closure.S (ffi_closure_SYSV): Don't use JUMPTARGET
-	to call ffi_closure_helper_SYSV.  Append @local instead.
-	* src/powerpc/sysv.S (ffi_call_SYSV): Likewise for ffi_prep_args_SYSV.
+commit 630b9c0ac43c7edcbfd892e23c09fb26724f4ac0
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Feb 9 06:24:23 2011 -0500
 
-2005-05-17  Kelley Cook  <kcook@gcc.gnu.org>
+    Update to rc2
 
-	* configure.ac: Use AC_C_BIGENDIAN instead of AC_C_BIGENDIAN_CROSS.
-	Use AC_CHECK_SIZEOF instead of AC_COMPILE_CHECK_SIZEOF.
-	* Makefile.am (ACLOCAL_AMFLAGS): Remove -I ../config.
-	* aclocal.m4, configure, fficonfig.h.in, Makefile.in,
-	include/Makefile.in, testsuite/Makefile.in: Regenerate.
+commit 0cad4386fa4c9ea5f8ca88b16247db4e5c8fea90
+Author: Anthony Green <green@moxielogic.com>
+Date:   Wed Feb 9 06:11:46 2011 -0500
 
-2005-05-09  Mike Stump  <mrs@apple.com>
+    Add ChangeLog entry.  Fix copyright headers.
 
-	* configure: Regenerate.
+commit 09cb76f2645bd2c151846e9249d8ea707ba01e8c
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Feb 8 20:39:51 2011 -0500
 
-2005-05-08  Richard Henderson  <rth@redhat.com>
+    Add missing change
 
-	PR libffi/21285
-	* src/alpha/osf.S: Update unwind into to match code.
+commit 2e3a48ccdd54340983c46a29a0b41985e3e789ac
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Feb 8 20:37:26 2011 -0500
 
-2005-05-04  Andreas Degert <ad@papyrus-gmbh.de>
-	    Richard Henderson  <rth@redhat.com>
+    Fix make dist
 
-	* src/x86/ffi64.c (ffi_prep_cif_machdep): Save sse-used flag in
-	bit 11 of flags.
-	(ffi_call): Mask return type field.  Pass ssecount to ffi_call_unix64.
-	(ffi_prep_closure): Set carry bit if sse-used flag set.
-	* src/x86/unix64.S (ffi_call_unix64): Add ssecount argument.
-	Only load sse registers if ssecount non-zero.
-	(ffi_closure_unix64): Only save sse registers if carry set on entry.
+commit 5e4814d9928e236a2a4afe84d6e1d4fdaa473206
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Feb 8 19:46:28 2011 -0500
 
-2005-04-29  Ralf Corsepius  <ralf.corsepius@rtems.org>
+    fix permissions
 
-	* configure.ac: Add i*86-*-rtems*, sparc*-*-rtems*,
-	powerpc-*rtems*, arm*-*-rtems*, sh-*-rtems*.
-	* configure: Regenerate.
+commit 5c0cc6f1536aa1738795a97303810a823c7fa2cb
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Feb 8 19:45:59 2011 -0500
 
-2005-04-20  Hans-Peter Nilsson  <hp@axis.com>
+    3.0.10rc1
 
-	* testsuite/lib/libffi-dg.exp (libffi-dg-test-1): In regsub use,
-	have Tcl8.3-compatible intermediate variable.
+commit 857fe3de46d2286afa2fe772920ecf4aefa1688f
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Feb 8 19:39:20 2011 -0500
 
-2005-04-18  Simon Posnjak <simon.posnjak@siol.net>
-	    Hans-Peter Nilsson  <hp@axis.com>
+    Clean ups
 
-	* Makefile.am: Add CRIS support.
-	* configure.ac: Likewise.
-	* Makefile.in, configure, testsuite/Makefile.in,
-	include/Makefile.in: Regenerate.
-	* src/cris: New directory.
-	* src/cris/ffi.c, src/cris/sysv.S, src/cris/ffitarget.h: New files.
-	* src/prep_cif.c (ffi_prep_cif): Wrap in #ifndef __CRIS__.
+commit e2214f8adb5577c247452e2cc9f4cbe304d7ca9f
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Feb 8 19:22:56 2011 -0500
 
-	* testsuite/lib/libffi-dg.exp (libffi-dg-test-1): Replace \n with
-	\r?\n in output tests.
+    Update README
 
-2005-04-12  Mike Stump  <mrs@apple.com>
+commit 1106229a5721a659da5c231ec0e8211119615394
+Merge: bc9d0be f6ab3ed
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Feb 8 19:20:09 2011 -0500
 
-	* configure: Regenerate.
+    Add iOS support
 
-2005-03-30  Hans Boehm  <Hans.Boehm@hp.com>
+commit bc9d0be2958ce475757f34dd2c878948aa77a39f
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Feb 8 17:04:26 2011 -0500
 
-	* src/ia64/ffitarget.h (ffi_arg): Use long long instead of DI.
+    3.0.10rc0 changes
 
-2005-03-30  Steve Ellcey  <sje@cup.hp.com>
+commit 3b836249feae6d08d3e6887486e4b9961ddafa09
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Feb 8 14:28:59 2011 -0500
 
-	* src/ia64/ffitarget.h (ffi_arg) ADD DI attribute.
-	(ffi_sarg) Ditto.
-	* src/ia64/unix.S (ffi_closure_unix): Extend gp
-	to 64 bits in ILP32 mode.
-	Load 64 bits even for short data.
+    Rebase from GCC
 
-2005-03-23  Mike Stump  <mrs@apple.com>
+commit a26e3940619faeba6de54824c9540c90b1aab513
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Feb 8 13:56:12 2011 -0500
 
-	* src/powerpc/darwin.S: Update for -m64 multilib.
-	* src/powerpc/darwin_closure.S: Likewise.
+    copyright updates patch
 
-2005-03-21  Zack Weinberg  <zack@codesourcery.com>
+commit b8099539f00e224107594101e9760b6dc081a056
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Feb 8 13:50:43 2011 -0500
 
-	* configure.ac: Do not invoke TL_AC_GCC_VERSION.
-	Do not set tool_include_dir.
-	* aclocal.m4, configure, Makefile.in, testsuite/Makefile.in:
-	Regenerate.
-	* include/Makefile.am: Set gcc_version and toollibffidir.
-	* include/Makefile.in: Regenerate.
+    Fix msvcc.sh botch
 
-2005-02-22  Andrew Haley  <aph@redhat.com>
+commit dc411e8f99113a34656bfd2d3ae51259972488cc
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Feb 8 10:49:29 2011 -0500
 
-	* src/powerpc/ffi.c (ffi_prep_cif_machdep): Bump alignment to
-	odd-numbered register pairs for 64-bit integer types.
+    Fix HP-UX build
 
-2005-02-23  Andreas Tobler  <a.tobler@schweiz.ch>
+commit 404585d1348e30ac58203bbd876d9131e5aed874
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Feb 8 10:44:36 2011 -0500
 
-	PR libffi/20104
-	* testsuite/libffi.call/return_ll1.c: New test case.
+    Fix sparc v8 aggregate type returns for sun's compiler
 
-2005-02-11  Janis Johnson  <janis187@us.ibm.com>
+commit 19ce713188e193e4522740d24c20170411883d2d
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Feb 8 10:34:23 2011 -0500
 
-	* testsuite/libffi.call/cls_align_longdouble.c: Remove dg-options.
-	* testsuite/libffi.call/float.c: Ditto.
-	* testsuite/libffi.call/float2.c: Ditto.
-	* testsuite/libffi.call/float3.c: Ditto.
+    grammar fix
 
-2005-02-08  Andreas Tobler  <a.tobler@schweiz.ch>
+commit 89284fe55f1a8ad3bddbea796ee00d0e3ba411ce
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Feb 8 10:19:19 2011 -0500
 
-	* src/frv/ffitarget.h: Remove PPC stuff which does not belong to frv.
+    Fix AIX build with IBM XLC
 
-2005-01-12  Eric Botcazou  <ebotcazou@libertysurf.fr>
+commit ba022c338af97cb18d9f8ed5a607fd483a61c09c
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Feb 8 10:12:48 2011 -0500
 
-	* testsuite/libffi.special/special.exp (cxx_options): Add
-	-shared-libgcc.
+    fix win64-underscore patch
 
-2004-12-31  Richard Henderson  <rth@redhat.com>
+commit 097e5f3924ee92a3ba6cd72f787da8a3eb14fea3
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Feb 8 10:11:00 2011 -0500
 
-	* src/types.c (FFI_AGGREGATE_TYPEDEF): Remove.
-	(FFI_TYPEDEF): Rename from FFI_INTEGRAL_TYPEDEF.  Replace size and
-	offset parameters with a type parameter; deduce size and structure
-	alignment.  Update all users.
+    x86 pcrel test part 2
 
-2004-12-31  Richard Henderson  <rth@redhat.com>
+commit ed2c518d960b91d444be74e5a55779a9c4602f3b
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Feb 8 10:10:07 2011 -0500
 
-	* src/types.c (FFI_TYPE_POINTER): Define with sizeof.
-	(FFI_TYPE_LONGDOUBLE): Fix for ia64.
-	* src/ia64/ffitarget.h (struct ffi_ia64_trampoline_struct): Move
-	into ffi_prep_closure.
-	* src/ia64/ia64_flags.h, src/ia64/ffi.c, src/ia64/unix.S: Rewrite
-	from scratch.
+    x86 pcrel test
 
-2004-12-27  Richard Henderson  <rth@redhat.com>
+commit 0e5843995f46900ef212531281e08b224464f413
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Feb 8 07:52:40 2011 -0500
 
-	* src/x86/unix64.S: Fix typo in unwind info.
+    Refresh from GCC
 
-2004-12-25  Richard Henderson  <rth@redhat.com>
+commit 5b9cd52784339a42e417174a55e310e214d435f9
+Author: Anthony Green <green@moxielogic.com>
+Date:   Mon Nov 22 15:19:57 2010 -0500
 
-	* src/x86/ffi64.c (struct register_args): Rename from stackLayout.
-	(enum x86_64_reg_class): Add X86_64_COMPLEX_X87_CLASS.
-	(merge_classes): Check for it.
-	(SSE_CLASS_P): New.
-	(classify_argument): Pass byte_offset by value; perform all updates
-	inside struct case.
-	(examine_argument): Add classes argument; handle
-	X86_64_COMPLEX_X87_CLASS.
-	(ffi_prep_args): Merge into ...
-	(ffi_call): ... here.  Share stack frame with ffi_call_unix64.
-	(ffi_prep_cif_machdep): Setup cif->flags for proper structure return.
-	(ffi_fill_return_value): Remove.
-	(ffi_prep_closure): Remove dead assert.
-	(ffi_closure_unix64_inner): Rename from ffi_closure_UNIX64_inner.
-	Rewrite to use struct register_args instead of va_list.  Create
-	flags for handling structure returns.
-	* src/x86/unix64.S: Remove dead strings.
-	(ffi_call_unix64): Rename from ffi_call_UNIX64.  Rewrite to share
-	stack frame with ffi_call.  Handle structure returns properly.
-	(float2sse, floatfloat2sse, double2sse): Remove.
-	(sse2float, sse2double, sse2floatfloat): Remove.
-	(ffi_closure_unix64): Rename from ffi_closure_UNIX64.  Rewrite
-	to handle structure returns properly.
+    win64-underscore patch
 
-2004-12-08  David Edelsohn  <edelsohn@gnu.org>
+commit 2db72615b50eb5c0f29725c02c740a2f0d7fc7d9
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sun Nov 21 10:50:56 2010 -0500
 
-	* Makefile.am (AM_MAKEFLAGS): Remove duplicate LIBCFLAGS and
-	PICFLAG.
-	* Makefile.in: Regenerated.
+    Rebase
 
-2004-12-02  Richard Sandiford  <rsandifo@redhat.com>
+commit f6ab3edc23dc8fc7c47a31c896044150c23f04b5
+Author: Landon Fuller <landonf@plausible.coop>
+Date:   Wed Oct 27 19:34:51 2010 -0400
 
-	* configure.ac: Use TL_AC_GCC_VERSION to set gcc_version.
-	* configure, aclocal.m4, Makefile.in: Regenerate.
-	* include/Makefile.in, testsuite/Makefile.in: Regenerate.
+    Include the license header in the generated output.
 
-2004-11-29  Kelley Cook  <kcook@gcc.gnu.org>
+commit cef619462887fa0f360e3ee702d1e04f112b5b38
+Author: Landon Fuller <landonf@bikemonkey.org>
+Date:   Wed Oct 27 13:59:30 2010 -0400
 
-	* configure: Regenerate for libtool change.
+    Add missing copyright/license header.
 
-2004-11-25  Kelley Cook  <kcook@gcc.gnu.org>
+commit 53f387b203413c9aa6e31f49dbb70d37d816330b
+Author: Landon Fuller <landonf@bikemonkey.org>
+Date:   Sun Sep 19 19:57:17 2010 -0700
 
-	* configure: Regenerate for libtool reversion.
+    Minor README fix.
 
-2004-11-24  Kelley Cook  <kcook@gcc.gnu.org>
+commit 4fbcb5b5fbce11f4b168060e00639db33c85b75b
+Author: Landon Fuller <landonf@bikemonkey.org>
+Date:   Sun Sep 19 19:50:37 2010 -0700
 
-	* configure: Regenerate for libtool change.
+    Minor README fix.
 
-2004-11-23  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+commit 8e7652ef6acab5db7a29f786686a54f05cdbdc7d
+Author: Landon Fuller <landonf@bikemonkey.org>
+Date:   Sun Sep 19 19:49:39 2010 -0700
 
-	* testsuite/lib/libffi-dg.exp: Use new procs in target-libpath.exp.
+    Add a libffi-ios-specific github README.
 
-2004-11-23  Richard Sandiford  <rsandifo@redhat.com>
+commit 83038cf24aa1a92b62b91ffee1dcc25d79243484
+Author: Landon Fuller <landonf@bikemonkey.org>
+Date:   Sun Sep 19 14:36:45 2010 -0700
 
-	* src/mips/o32.S (ffi_call_O32, ffi_closure_O32): Use jalr instead
-	of jal.  Use an absolute encoding for the frame information.
+    Implement FFI_EXEC_TRAMPOLINE_TABLE allocator for iOS/ARM.
+    
+    This provides working closure support on iOS/ARM devices where
+    PROT_WRITE|PROT_EXEC is not permitted. The code passes basic
+    smoke tests, but requires further review.
 
-2004-11-23  Kelley Cook  <kcook@gcc.gnu.org>
+commit b00ff3e98fdde622cef617030e14d5356dff988f
+Author: Landon Fuller <landonf@bikemonkey.org>
+Date:   Sun Sep 19 14:22:26 2010 -0700
 
-	* Makefile.am: Remove no-dependencies.  Add ACLOCAL_AMFLAGS.
-	* acinclude.m4: Delete logic for sincludes.
-	* aclocal.m4, Makefile.in, configure: Regenerate.
-	* include/Makefile: Likewise.
-	* testsuite/Makefile: Likewise.
+    Rename the generated symbol
 
-2004-11-22  Eric Botcazou  <ebotcazou@libertysurf.fr>
+commit da2773e02ab26cc11a7fe87e985599f35cdf0649
+Author: Landon Fuller <landonf@bikemonkey.org>
+Date:   Sun Sep 19 14:21:37 2010 -0700
 
-	* src/sparc/ffi.c (ffi_prep_closure): Align doubles and 64-bit integers
-	on a 8-byte boundary.
-	* src/sparc/v8.S (ffi_closure_v8): Reserve frame space for arguments.
+    Modify the ffi_closure structures to hold table/table entry pointers instead of a code buffer.
 
-2004-10-27  Richard Earnshaw  <rearnsha@arm.com>
+commit 01d71b7bed41844f80cb9feef20dcc5ece5ba2d0
+Author: Landon Fuller <landonf@bikemonkey.org>
+Date:   Sun Sep 19 14:21:14 2010 -0700
 
-	* src/arm/ffi.c (ffi_prep_cif_machdep): Handle functions that return
-	long long values.  Round stack allocation to a multiple of 8 bytes
-	for ATPCS compatibility.
-	* src/arm/sysv.S (ffi_call_SYSV): Rework to avoid use of APCS register
-	names.  Handle returning long long types.  Add Thumb and interworking
-	support.  Improve soft-float code.
+    Regenerated the autoconf script
 
-2004-10-27  Richard Earnshaw  <rearnsha@arm.com>
+commit 19afda0069c42e51c81dca7b10a5cf884b4cdce0
+Author: Landon Fuller <landonf@bikemonkey.org>
+Date:   Sun Sep 19 14:20:52 2010 -0700
 
-	* testsuite/lib/libffi-db.exp (load_gcc_lib): New function.
-	(libffi_exit): New function.
-	(libffi_init): Build the testglue wrapper if needed.
+    Enable AC_SUBST for FFI_EXEC_TRAMPOLINE_TABLE
 
-2004-10-25  Eric Botcazou  <ebotcazou@libertysurf.fr>
+commit 9e1196444e78aef20028c18891f44ebe39a815fd
+Author: Landon Fuller <landonf@bikemonkey.org>
+Date:   Sun Sep 19 10:43:06 2010 -0700
 
-	PR other/18138
-	* testsuite/lib/libffi-dg.exp: Accept more than one multilib libgcc.
+    Add a hard-coded FFI_EXEC_TRAMPOLINE_TABLE arm implementation.
+    
+    This implements support for re-mapping a shared table of executable
+    trampolines directly in front of a writable configuration page, working
+    around PROT_WRITE restrictions for sandboxed applications on Apple's
+    iOS.
+    
+    This implementation is for testing purposes; a proper allocator is still
+    necessary, and ARM-specific code needs to be moved out of
+    src/closures.c.
 
-2004-10-25  Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
+commit f38364b399184e682fc3e785084bd497827bc5af
+Author: Landon Fuller <landonf@bikemonkey.org>
+Date:   Sun Sep 19 10:42:36 2010 -0700
 
-	* src/m32r/libffitarget.h (FFI_CLOSURES): Set to 0.
+    Fix symbol prefix for ffi_closure_SYSV_inner on Darwin.
 
-2004-10-20  Kaz Kojima  <kkojima@gcc.gnu.org>
+commit 36849e7716b77aa25e4175d1f4be1b93dbf47aac
+Author: Landon Fuller <landonf@bikemonkey.org>
+Date:   Sun Sep 19 09:35:04 2010 -0700
 
-	* src/sh/sysv.S (ffi_call_SYSV): Don't align for double data.
-	* testsuite/libffi.call/float3.c: New test case.
+    Whitespace/comment fixes.
 
-2004-10-18  Kaz Kojima  <kkojima@gcc.gnu.org>
+commit b764162526854686e579a48b6ac5981f4eb886a3
+Author: Landon Fuller <landonf@bikemonkey.org>
+Date:   Sun Sep 19 09:04:34 2010 -0700
 
-	* src/sh/ffi.c (ffi_prep_closure): Set T bit in trampoline for
-	the function returning a structure pointed with R2.
-	* src/sh/sysv.S (ffi_closure_SYSV): Use R2 as the pointer to
-	the structure return value if T bit set.  Emit position
-	independent code and EH data if PIC.
+    Fix the script name (build-iphone.sh -> build-ios.sh)
 
-2004-10-13  Kazuhiro Inaoka  <inaoka.kazuhiro@renesas.com>
+commit a3d9aa85013341451ea97766485b7a11852d32b2
+Author: Landon Fuller <landonf@bikemonkey.org>
+Date:   Sun Sep 19 09:03:52 2010 -0700
 
-	* Makefile.am: Add m32r support.
-	* configure.ac: Likewise.
-	* Makefile.in: Regenerate.
-	* confiugre: Regenerate.
-	* src/types.c: Add m32r port to FFI_INTERNAL_TYPEDEF
-	(uint64, sint64, double, longdouble)
-	* src/m32r: New directory.
-	* src/m32r/ffi.c: New file.
-	* src/m32r/sysv.S: Likewise.
-	* src/m32r/ffitarget.h: Likewise.
+    Update the autogenerated autoconf/automake files.
 
-2004-10-02  Kaz Kojima  <kkojima@gcc.gnu.org>
+commit c71480eaf839f26bbdfcd8965f65ac4d8defddc0
+Author: Landon Fuller <landonf@bikemonkey.org>
+Date:   Sun Sep 19 09:02:05 2010 -0700
 
-	* testsuite/libffi.call/negint.c: New test case.
+    Update automake/autoconf to conditionally build src/arm/trampoline.S if FFI_EXEC_TRAMPOLINE_TABLE is enabled.
 
-2004-09-14  H.J. Lu  <hongjiu.lu@intel.com>
+commit 9af9291b73bc5e27ecd949bec8157f20426d65b8
+Author: Landon Fuller <landonf@bikemonkey.org>
+Date:   Sun Sep 19 08:52:33 2010 -0700
 
-	PR libgcj/17465
-	* testsuite/lib/libffi-dg.exp: Don't use global ld_library_path.
-	Set up LD_LIBRARY_PATH, SHLIB_PATH, LD_LIBRARYN32_PATH,
-	LD_LIBRARY64_PATH, LD_LIBRARY_PATH_32, LD_LIBRARY_PATH_64 and
-	DYLD_LIBRARY_PATH.
+    Add the trampoline table generated by gentramp.sh
 
-2004-09-05  Andreas Tobler  <a.tobler@schweiz.ch>
+commit 68ce0c383ece84f69945d1c8c3fed03f7f9cb5d6
+Author: Landon Fuller <landonf@bikemonkey.org>
+Date:   Sun Sep 19 08:38:19 2010 -0700
 
-	* testsuite/libffi.call/many_win32.c: Remove whitespaces.
-	* testsuite/libffi.call/promotion.c: Likewise.
-	* testsuite/libffi.call/return_ll.c: Remove unused var. Cleanup
-	whitespaces.
-	* testsuite/libffi.call/return_sc.c: Likewise.
-	* testsuite/libffi.call/return_uc.c: Likewise.
+    Add a shell script that generates the ARM trampoline page.
+    
+    This generates a page of 340 trampolines, aligned within one page. The
+    trampolines use pc-relative addressing to reference config data
+    (context, jump address) from a page placed directly prior to the
+    trampoline page. This can be used on systems -- such as iOS -- that do not
+    support writable, executable memory by remapping the executable page
+    containing the trampolines directly above a newly allocated writable
+    config page.
 
-2004-09-05  Andreas Tobler  <a.tobler@schweiz.ch>
+commit 75af086be8830a8eafe9b1ebda199d788bcb0c62
+Author: Landon Fuller <landonf@bikemonkey.org>
+Date:   Sat Sep 18 18:12:19 2010 -0700
 
-	* src/powerpc/darwin.S: Fix comments and identation.
-	* src/powerpc/darwin_closure.S: Likewise.
+    Update autoconf files
 
-2004-09-02  Andreas Tobler  <a.tobler@schweiz.ch>
+commit 1ac92cca9b02ef8d6a769f0de1adccd5c9630355
+Author: Landon Fuller <landonf@bikemonkey.org>
+Date:   Sat Sep 18 18:08:14 2010 -0700
 
-	* src/powerpc/ffi_darwin.c: Add flag for longdouble return values.
-	(ffi_prep_args): Handle longdouble arguments.
-	(ffi_prep_cif_machdep): Set flags for longdouble. Calculate space for
-	longdouble.
-	(ffi_closure_helper_DARWIN): Add closure handling for longdouble.
-	* src/powerpc/darwin.S (_ffi_call_DARWIN): Add handling of longdouble
-	values.
-	* src/powerpc/darwin_closure.S (_ffi_closure_ASM): Likewise.
-	* src/types.c: Defined longdouble size and alignment for darwin.
+    Add autoconf check for W^X platforms that require a trampoline table.
+    
+    This adds the FFI_EXEC_TRAMPOLINE_TABLE. The flag is enabled for
+    arm-apple-darwin, where PROT_EXEC on writable (or formerly writable) pages is
+    not permitted for sandboxed binaries.
 
-2004-09-02  Andreas Tobler  <a.tobler@schweiz.ch>
+commit be72fbab29b7190c702d8e1ac3d149855e95879d
+Author: Landon Fuller <landonf@bikemonkey.org>
+Date:   Sat Sep 18 18:02:25 2010 -0700
 
-	* src/powerpc/aix.S: Remove whitespaces.
-	* src/powerpc/aix_closure.S: Likewise.
-	* src/powerpc/asm.h: Likewise.
-	* src/powerpc/ffi.c: Likewise.
-	* src/powerpc/ffitarget.h: Likewise.
-	* src/powerpc/linux64.S: Likewise.
-	* src/powerpc/linux64_closure.S: Likewise.
-	* src/powerpc/ppc_closure.S: Likewise.
-	* src/powerpc/sysv.S: Likewise.
+    Use the correct host triple for arm/darwin
 
-2004-08-30  Anthony Green  <green@redhat.com>
+commit 70150bdf4509269965c72f2032bf74f285767afe
+Author: Landon Fuller <landonf@bikemonkey.org>
+Date:   Sat Sep 18 16:38:03 2010 -0700
 
-	* Makefile.am: Add frv support.
-	* Makefile.in, testsuite/Makefile.in: Rebuilt.
-	* configure.ac: Read configure.host.
-	* configure.in: Read configure.host.
-	* configure.host: New file.  frv-elf needs libgloss.
-	* include/ffi.h.in: Force ffi_closure to have a nice big (8)
-	alignment.  This is needed to frv and shouldn't harm the others.
-	* include/ffi_common.h (ALIGN_DOWN): New macro.
-	* src/frv/ffi.c, src/frv/ffitarget.h, src/frv/eabi.S: New files.
+    Add missing UNWIND entry; disables .pad on non-EABI targets.
 
-2004-08-24  David Daney  <daney@avtrex.com>
+commit 6b452bafaec498df975ba8ac4c99de174e5f74f7
+Author: Landon Fuller <landonf@bikemonkey.org>
+Date:   Sat Sep 18 16:21:32 2010 -0700
 
-	* testsuite/libffi.call/closure_fn0.c: Xfail mips64* instead of mips*.
-	* testsuite/libffi.call/closure_fn1.c: Likewise.
-	* testsuite/libffi.call/closure_fn2.c  Likewise.
-	* testsuite/libffi.call/closure_fn3.c: Likewise.
-	* testsuite/libffi.call/closure_fn4.c: Likewise.
-	* testsuite/libffi.call/closure_fn5.c: Likewise.
-	* testsuite/libffi.call/cls_18byte.c: Likewise.
-	* testsuite/libffi.call/cls_19byte.c: Likewise.
-	* testsuite/libffi.call/cls_1_1byte.c: Likewise.
-	* testsuite/libffi.call/cls_20byte.c: Likewise.
-	* testsuite/libffi.call/cls_20byte1.c: Likewise.
-	* testsuite/libffi.call/cls_24byte.c: Likewise.
-	* testsuite/libffi.call/cls_2byte.c: Likewise.
-	* testsuite/libffi.call/cls_3_1byte.c: Likewise.
-	* testsuite/libffi.call/cls_3byte1.c: Likewise.
-	* testsuite/libffi.call/cls_3byte2.c: Likewise.
-	* testsuite/libffi.call/cls_4_1byte.c: Likewise.
-	* testsuite/libffi.call/cls_4byte.c: Likewise.
-	* testsuite/libffi.call/cls_64byte.c: Likewise.
-	* testsuite/libffi.call/cls_6byte.c: Likewise.
-	* testsuite/libffi.call/cls_7byte.c: Likewise.
-	* testsuite/libffi.call/cls_8byte.c: Likewise.
-	* testsuite/libffi.call/cls_9byte1.c: Likewise.
-	* testsuite/libffi.call/cls_9byte2.c: Likewise.
-	* testsuite/libffi.call/cls_align_double.c: Likewise.
-	* testsuite/libffi.call/cls_align_float.c: Likewise.
-	* testsuite/libffi.call/cls_align_longdouble.c: Likewise.
-	* testsuite/libffi.call/cls_align_pointer.c: Likewise.
-	* testsuite/libffi.call/cls_align_sint16.c: Likewise.
-	* testsuite/libffi.call/cls_align_sint32.c: Likewise.
-	* testsuite/libffi.call/cls_align_sint64.c: Likewise.
-	* testsuite/libffi.call/cls_align_uint16.c: Likewise.
-	* testsuite/libffi.call/cls_align_uint32.c: Likewise.
-	* testsuite/libffi.call/cls_align_uint64.c: Likewise.
-	* testsuite/libffi.call/cls_double.c: Likewise.
-	* testsuite/libffi.call/cls_float.c: Likewise.
-	* testsuite/libffi.call/cls_multi_schar.c: Likewise.
-	* testsuite/libffi.call/cls_multi_sshort.c: Likewise.
-	* testsuite/libffi.call/cls_multi_sshortchar.c: Likewise.
-	* testsuite/libffi.call/cls_multi_uchar.c: Likewise.
-	* testsuite/libffi.call/cls_multi_ushort.c: Likewise.
-	* testsuite/libffi.call/cls_multi_ushortchar.c: Likewise.
-	* testsuite/libffi.call/cls_schar.c: Likewise.
-	* testsuite/libffi.call/cls_sint.c: Likewise.
-	* testsuite/libffi.call/cls_sshort.c: Likewise.
-	* testsuite/libffi.call/cls_uchar.c: Likewise.
-	* testsuite/libffi.call/cls_uint.c: Likewise.
-	* testsuite/libffi.call/cls_ulonglong.c: Likewise.
-	* testsuite/libffi.call/cls_ushort.c: Likewise.
-	* testsuite/libffi.call/nested_struct.c: Likewise.
-	* testsuite/libffi.call/nested_struct1.c: Likewise.
-	* testsuite/libffi.call/nested_struct2.c: Likewise.
-	* testsuite/libffi.call/nested_struct3.c: Likewise.
-	* testsuite/libffi.call/problem1.c: Likewise.
-	* testsuite/libffi.special/unwindtest.cc: Likewise.
-	* testsuite/libffi.call/cls_12byte.c: Likewise and set return value
-	to zero.
-	* testsuite/libffi.call/cls_16byte.c: Likewise.
-	* testsuite/libffi.call/cls_5byte.c: Likewise.
+    Apple assembler support; fixed most gas/ELF-isms.
 
-2004-08-23  David Daney <daney@avtrex.com>
+commit 8ddac835b6f8b54ede764d0ea977dee4c82e2d67
+Author: Landon Fuller <landonf@bikemonkey.org>
+Date:   Sat Sep 18 15:38:06 2010 -0700
 
-	PR libgcj/13141
-	* src/mips/ffitarget.h (FFI_O32_SOFT_FLOAT): New ABI.
-	* src/mips/ffi.c (ffi_prep_args): Fix alignment calculation.
-	(ffi_prep_cif_machdep): Handle FFI_O32_SOFT_FLOAT floating point
-	parameters and return types.
-	(ffi_call): Handle FFI_O32_SOFT_FLOAT ABI.
-	(ffi_prep_closure): Ditto.
-	(ffi_closure_mips_inner_O32): Handle FFI_O32_SOFT_FLOAT ABI, fix
-	alignment calculations.
-	* src/mips/o32.S (ffi_closure_O32): Don't use floating point
-	instructions if FFI_O32_SOFT_FLOAT, make stack frame ABI compliant.
+    Fix placement of the __APPLE__ macro.
 
-2004-08-14  Casey Marshall <csm@gnu.org>
+commit 69043d02936bb0579ac59b4ee1ed8dec38c38db7
+Author: Landon Fuller <landonf@bikemonkey.org>
+Date:   Sat Sep 18 15:32:08 2010 -0700
 
-	* src/mips/ffi.c (ffi_pref_cif_machdep): set `cif->flags' to
-	contain `FFI_TYPE_UINT64' as return type for any 64-bit
-	integer (O32 ABI only).
-	(ffi_prep_closure): new function.
-	(ffi_closure_mips_inner_O32): new function.
-	* src/mips/ffitarget.h: Define `FFI_CLOSURES' and
-	`FFI_TRAMPOLINE_SIZE' appropriately if the ABI is o32.
-	* src/mips/o32.S (ffi_call_O32): add labels for .eh_frame. Return
-	64 bit integers correctly.
-	(ffi_closure_O32): new function.
-	Added DWARF-2 unwind info for both functions.
+    Work-around libffi's FP ABI detection.
+    
+    On iOS, we must use the AAPCS floating point return value calling
+    conventions. libffi's ARM implementation will only use these conventions
+    if __SOFTFP__ is defined, which is not the case when GCC's
+    -mfloat-abi defaults to 'softfp' instead of 'soft'. To work around this
+    we manually define __SOFTFP__ for Apple platforms in the ARM-specific
+    sysv.S.
+    
+    See also:
+      http://developer.apple.com/library/ios/#documentation/Xcode/Conceptual/iPhoneOSABIReference/Introduction/Introduction.html
+      http://infocenter.arm.com/help/topic/com.arm.doc.ihi0042d/IHI0042D_aapcs.pdf
 
-2004-08-10  Andrew Haley  <aph@redhat.com>
+commit a82e6c354ea805114642a6e440abd0832cb1d23f
+Author: Landon Fuller <landonf@bikemonkey.org>
+Date:   Sat Sep 18 14:44:24 2010 -0700
 
-	* src/x86/ffi64.c (ffi_prep_args ): 8-align all stack arguments.
+    Add a stub iOS build script to drive autoconf
 
-2004-08-01  Robert Millan  <robertmh@gnu.org>
+commit 84e8de6e9fc19388f6f1102c013b7d0d52940ecc
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Aug 6 01:35:12 2010 -0400
 
-	* configure.ac: Detect knetbsd-gnu and kfreebsd-gnu.
-	* configure: Regenerate.
+    Restore execute permissions
 
-2004-07-30  Maciej W. Rozycki  <macro@linux-mips.org>
+commit 3aeecc9eb1a6feba6549849cdd335c926415a4fc
+Author: Anthony Green <green@moxielogic.com>
+Date:   Thu Aug 5 15:19:00 2010 -0400
 
-	* acinclude.m4 (AC_FUNC_MMAP_BLACKLIST): Check for <sys/mman.h>
-	and mmap() explicitly instead of relying on preset autoconf cache
-	variables.
-	* aclocal.m4: Regenerate.
-	* configure: Regenerate.
+    Fix win64-struct-args patch
 
-2004-07-11  Ulrich Weigand  <uweigand@de.ibm.com>
+commit 00d0b59cd13f89ab8b44bd894eb7f0a131fcb472
+Author: Anthony Green <green@moxielogic.com>
+Date:   Thu Aug 5 14:56:53 2010 -0400
 
-	* src/s390/ffi.c (ffi_prep_args): Fix C aliasing violation.
-	(ffi_check_float_struct): Remove unused prototype.
+    Fix debug build for windows
 
-2004-06-30  Geoffrey Keating  <geoffk@apple.com>
+commit bda487e87064f27965155459a62dc52a744778d0
+Author: Anthony Green <green@moxielogic.com>
+Date:   Thu Aug 5 09:02:41 2010 -0400
 
-	* src/powerpc/ffi_darwin.c (flush_icache): ';' is a comment
-	character on Darwin, use '\n\t' instead.
+    Don't use -safeseh with ml64
 
-2004-06-26  Matthias Klose  <doko@debian.org>
+commit c1d28ba8d5029795af313ffeb81c97efc6d4c847
+Author: Anthony Green <green@moxielogic.com>
+Date:   Thu Aug 5 08:48:16 2010 -0400
 
-	* libtool-version: Fix typo in revision/age.
+    stdcall-x86-closure-fix
 
-2004-06-17  Matthias Klose  <doko@debian.org>
+commit 5feacad4a56c85b3f23a267a30b2cf424cd59548
+Author: Anthony Green <green@moxielogic.com>
+Date:   Thu Aug 5 08:30:04 2010 -0400
 
-	* libtool-version: New.
-	* Makefile.am (libffi_la_LDFLAGS): Use -version-info for soname.
-	* Makefile.in: Regenerate.
+    define generic symbols carefully
 
-2004-06-15  Paolo Bonzini  <bonzini@gnu.org>
+commit 10ea848900bc3018ac213cef52b44cacbe5cbebc
+Author: Anthony Green <green@moxielogic.com>
+Date:   Thu Aug 5 08:24:27 2010 -0400
 
-	* Makefile.am: Remove useless multilib rules.
-	* Makefile.in: Regenerate.
-	* aclocal.m4: Regenerate with automake 1.8.5.
-	* configure.ac: Remove useless multilib configury.
-	* configure: Regenerate.
+    don't copy win64 struct args
 
-2004-06-15  Paolo Bonzini  <bonzini@gnu.org>
+commit d14178be4c49c3ada44a9fe9efe11d444372ddab
+Author: Anthony Green <green@moxielogic.com>
+Date:   Fri Jul 23 09:14:00 2010 -0400
 
-	* .cvsignore: New file.
+    FFI_LAST_ABI fix
 
-2004-06-10  Jakub Jelinek  <jakub@redhat.com>
+commit 3f5b1375ab1e2b8e3d593e21b27097a4a50f9b83
+Author: Anthony Green <green@moxielogic.com>
+Date:   Mon Jul 12 14:39:18 2010 -0400
 
-	* src/ia64/unix.S (ffi_call_unix): Insert group barrier break
-	fp_done.
-	(ffi_closure_UNIX): Fix f14/f15 adjustment if FLOAT_SZ is ever
-	changed from 8.
+    rebase
 
-2004-06-06  Sean McNeil  <sean@mcneil.com>
+commit eaf444eabc4c78703c0f98ac0197b1619c1b1bef
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sat Jul 10 08:59:09 2010 -0400
 
-	* configure.ac: Add x86_64-*-freebsd* support.
-	* configure: Regenerate.
+    Fix selinux test
 
-2004-04-26  Joe Buck <jbuck@welsh-buck.org>
+commit 630974152247f100ece4d44f10c3721bb4599fbf
+Author: Anthony Green <green@gmachine.(none)>
+Date:   Wed May 5 20:14:56 2010 -0400
 
-	Bug 15093
-	* configure.ac: Test for existence of mmap and sys/mman.h before
-	checking blacklist.  Fix suggested by Jim Wilson.
-	* configure: Regenerate.
+    Micharl Kohler's spelling fixes
 
-2004-04-26  Matt Austern  <austern@apple.com>
+commit 9dc9a293f3d4589fcaf02dd4288c8cebaefa508e
+Author: Anthony Green <green@gmachine.(none)>
+Date:   Tue Apr 13 10:33:52 2010 -0400
 
-	* src/powerpc/darwin.S: Go through a non-lazy pointer for initial
-	FDE location.
-	* src/powerpc/darwin_closure.S: Likewise.
+    Rebase to latest GCC sources
 
-2004-04-24  Andreas Tobler  <a.tobler@schweiz.ch>
+commit f2c2a4fce9b3eca9f39b4f3545118bc256da4a73
+Author: Anthony Green <green@gmachine.(none)>
+Date:   Tue Apr 13 10:19:28 2010 -0400
 
-	* testsuite/libffi.call/cls_multi_schar.c (main): Fix initialization
-	error. Reported by Thomas Heller <theller@python.net>.
-	* testsuite/libffi.call/cls_multi_sshort.c (main): Likewise.
-	* testsuite/libffi.call/cls_multi_ushort.c (main): Likewise.
+    Remove warnings and add OS/2 support
 
-2004-03-20  Matthias Klose  <doko@debian.org>
+commit c0b69e57d529e33d18b658cc5572a21e3663247c
+Author: Anthony Green <green@gmachine.(none)>
+Date:   Tue Mar 30 08:30:22 2010 -0400
 
-	* src/pa/linux.S: Fix typo.
+    Dan Witte's windows build fixes.
 
-2004-03-19  Matthias Klose  <doko@debian.org>
+commit 59a259f4d348f593b45f452309f4d020a28051c4
+Author: Anthony Green <green@gmachine.(none)>
+Date:   Mon Mar 15 05:57:51 2010 -0400
 
-	* Makefile.am: Update.
-	* Makefile.in: Regenerate.
-	* src/pa/ffi.h.in: Remove.
-	* src/pa/ffitarget.h: New file.
+    Remove junk file
 
-2004-02-10  Randolph Chung  <tausq@debian.org>
+commit 3de1eb36d37a66829e606421939874d0d60d816d
+Author: Anthony Green <green@gmachine.(none)>
+Date:   Mon Mar 15 05:57:24 2010 -0400
 
-	* Makefile.am: Add PA support.
-	* Makefile.in: Regenerate.
-	* include/Makefile.in: Regenerate.
-	* configure.ac: Add PA target.
-	* configure: Regenerate.
-	* src/pa/ffi.c: New file.
-	* src/pa/ffi.h.in: Add PA support.
-	* src/pa/linux.S: New file.
-	* prep_cif.c: Add PA support.
+    fix-comments patch
 
-2004-03-16  Hosaka Yuji  <hos@tamanegi.org>
+commit c3813b6d7f8a777700f4c5862190c0db148d4de8
+Author: Anthony Green <green@gmachine.(none)>
+Date:   Tue Jan 26 16:48:56 2010 -0500
 
-	* src/types.c: Fix alignment size of X86_WIN32 case int64 and
-	double.
-	* src/x86/ffi.c (ffi_prep_args): Replace ecif->cif->rtype->type
-	with ecif->cif->flags.
-	(ffi_call, ffi_prep_incoming_args_SYSV): Replace cif->rtype->type
-	with cif->flags.
-	(ffi_prep_cif_machdep): Add X86_WIN32 struct case.
-	(ffi_closure_SYSV): Add 1 or 2-bytes struct case for X86_WIN32.
-	* src/x86/win32.S (retstruct1b, retstruct2b, sc_retstruct1b,
-	sc_retstruct2b): Add for 1 or 2-bytes struct case.
+    Rebuild Makefiles with automake 1.11.1 for CVE-2009-4029.
 
-2004-03-15 Kelley Cook <kcook@gcc.gnu.org>
+commit 8d27f68baa365bf883b6053c5f6bc819646d5434
+Author: Anthony Green <green@gmachine.(none)>
+Date:   Fri Jan 15 11:35:37 2010 -0500
 
-	* configure.in: Rename file to ...
-	* configure.ac: ... this.
-	* fficonfig.h.in: Regenerate.
-	* Makefile.in: Regenerate.
-	* include/Makefile.in: Regenerate.
-	* testsuite/Makefile.in: Regenerate.
+    Mention recent changes in README
 
-2004-03-12  Matt Austern  <austern@apple.com>
+commit ff3cd68b8cf2d9a28cad7aa9beff46236eacec8c
+Author: Anthony Green <green@gmachine.(none)>
+Date:   Fri Jan 15 11:27:24 2010 -0500
 
-	* src/powerpc/darwin.S: Fix EH information so it corresponds to
-	changes in EH format resulting from addition of linkonce support.
-	* src/powerpc/darwin_closure.S: Likewise.
+    Add msvc.sh wrapper
 
-2004-03-11  Andreas Tobler  <a.tobler@schweiz.ch>
-	    Paolo Bonzini  <bonzini@gnu.org>
+commit cadeba6cb53414a1253582f1719c286665de7b6c
+Author: Anthony Green <green@gmachine.(none)>
+Date:   Fri Jan 15 10:46:51 2010 -0500
 
-	* Makefile.am (AUTOMAKE_OPTIONS): Set them.
-	Remove VPATH. Remove rules for object files. Remove multilib support.
-	(AM_CCASFLAGS): Add.
-	* configure.in (AC_CONFIG_HEADERS): Relace AM_CONFIG_HEADER.
-	(AC_PREREQ): Bump version to 2.59.
-	(AC_INIT): Fill with version info and bug address.
-	(ORIGINAL_LD_FOR_MULTILIBS): Remove.
-	(AM_ENABLE_MULTILIB): Use this instead of AC_ARG_ENABLE.
-	De-precious CC so that the right flags are passed down to multilibs.
-	(AC_MSG_ERROR): Replace obsolete macro AC_ERROR.
-	(AC_CONFIG_FILES): Replace obsolete macro AC_LINK_FILES.
-	(AC_OUTPUT): Reorganize the output with AC_CONFIG_COMMANDS.
-	* configure: Rebuilt.
-	* aclocal.m4: Likewise.
-	* Makefile.in, include/Makefile.in, testsuite/Makefile.in: Likewise.
-	* fficonfig.h.in: Likewise.
+    Microsoft Visual C port
 
-2004-03-11  Andreas Schwab  <schwab@suse.de>
+commit 0739e7dc00db766eb64f502ec4137b817638c9a1
+Author: Anthony Green <green@gmachine.(none)>
+Date:   Fri Jan 15 09:48:33 2010 -0500
 
-	* src/ia64/ffi.c (ffi_prep_incoming_args_UNIX): Get floating point
-	arguments from fp registers only for the first 8 parameter slots.
-	Don't convert a float parameter when passed in memory.
+    Add x86 Sun Studio compiler support
 
-2004-03-09  Hans-Peter Nilsson  <hp@axis.com>
+commit edfdfd2e85b8d01d2455934f1d7f4d7eb2f3cf1c
+Author: Anthony Green <green@gmachine.(none)>
+Date:   Wed Jan 13 02:56:19 2010 -0500
 
-	* configure: Regenerate for config/accross.m4 correction.
+    Add closure example doc
 
-2004-02-25  Matt Kraai  <kraai@alumni.cmu.edu>
+commit 7b7a42f221cf171e8d09df34cac6dc1fd8458cc3
+Author: Anthony Green <green@gmachine.(none)>
+Date:   Tue Jan 12 09:14:14 2010 -0500
 
-	* src/powerpc/ffi.c (ffi_prep_args_SYSV): Change
-	ecif->cif->bytes to bytes.
-	(ffi_prep_cif_machdep): Add braces around nested if statement.
+    Rebase from GCC
 
-2004-02-09  Alan Modra  <amodra@bigpond.net.au>
+commit 4b18d1f73dc7733137869e4ab5725cb90c1c8fde
+Author: Anthony Green <green@gmachine.(none)>
+Date:   Fri Jan 1 10:24:27 2010 -0500
 
-	* src/types.c (pointer): POWERPC64 has 8 byte pointers.
+    Add x86-64 MingW to README
 
-	* src/powerpc/ffi.c (ffi_prep_args64): Correct long double handling.
-	(ffi_closure_helper_LINUX64): Fix typo.
-	* testsuite/libffi.call/cls_align_longdouble.c: Pass -mlong-double-128
-	for powerpc64-*-*.
-	* testsuite/libffi.call/float.c: Likewise.
-	* testsuite/libffi.call/float2.c: Likewise.
+commit c3042afaf3f84abbbe9c91bf9bc9896b0d9eb003
+Author: Anthony Green <green@gmachine.(none)>
+Date:   Fri Jan 1 08:08:02 2010 -0500
 
-2004-02-08  Alan Modra  <amodra@bigpond.net.au>
+    Reset quilt patches post 3.0.9 merge with GCC
 
-	* src/powerpc/ffi.c (ffi_prep_cif_machdep <FFI_LINUX64>): Correct
-	long double function return and long double arg handling.
-	(ffi_closure_helper_LINUX64): Formatting.  Delete unused "ng" var.
-	Use "end_pfr" instead of "nf".  Correct long double handling.
-	Localise "temp".
-	* src/powerpc/linux64.S (ffi_call_LINUX64): Save f2 long double
-	return value.
-	* src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Allocate
-	space for long double return value.  Adjust stack frame and offsets.
-	Load f2 long double return.
+commit b0304e9679bdfec6ac45a57b5c96542697249418
+Author: Anthony Green <green@gmachine.(none)>
+Date:   Thu Dec 31 11:32:40 2009 -0500
 
-2004-02-07  Alan Modra  <amodra@bigpond.net.au>
+    Update version
 
-	* src/types.c: Use 16 byte long double for POWERPC64.
+commit 2e7e03d014d9c9bf40e97ce75cba089ad052fa6b
+Author: Anthony Green <green@gmachine.(none)>
+Date:   Thu Dec 31 07:43:22 2009 -0500
 
-2004-01-25  Eric Botcazou  <ebotcazou@libertysurf.fr>
+    Final updates before 3.0.9
 
-	* src/sparc/ffi.c (ffi_prep_args_v9): Shift the parameter array
-	when the structure return address is passed in %o0.
-	(ffi_V9_return_struct): Rename into ffi_v9_layout_struct.
-	(ffi_v9_layout_struct): Align the field following a nested structure
-	on a word boundary.  Use memmove instead of memcpy.
-	(ffi_call): Update call to ffi_V9_return_struct.
-	(ffi_prep_closure): Define 'ctx' only for V8.
-	(ffi_closure_sparc_inner): Clone into ffi_closure_sparc_inner_v8
-	and ffi_closure_sparc_inner_v9.
-	(ffi_closure_sparc_inner_v8): Return long doubles by reference.
-	Always skip the structure return address.  For structures and long
-	doubles, copy the argument directly.
-	(ffi_closure_sparc_inner_v9): Skip the structure return address only
-	if required.  Shift the maximum floating-point slot accordingly.  For
-	big structures, copy the argument directly; otherwise, left-justify the
-	argument and call ffi_v9_layout_struct to lay out the structure on
-	the stack.
-	* src/sparc/v8.S: Undef STACKFRAME before defining it.
-	(ffi_closure_v8): Pass the structure return address.  Update call to
-	ffi_closure_sparc_inner_v8.  Short-circuit FFI_TYPE_INT handling.
-	Skip the 'unimp' insn when returning long doubles and structures.
-	* src/sparc/v9.S: Undef STACKFRAME before defining it.
-	(ffi_closure_v9): Increase the frame size by 2 words.  Short-circuit
-	FFI_TYPE_INT handling.  Load structures both in integers and
-	floating-point registers on return.
-	* README: Update status of the SPARC port.
+commit aea706c52825c8eee677ffa7fdbdd3aed1725492
+Author: Anthony Green <green@gmachine.(none)>
+Date:   Tue Dec 29 10:09:31 2009 -0500
 
-2004-01-24  Andreas Tobler  <a.tobler@schweiz.ch>
+    really 3.0.9rc12
 
-	* testsuite/libffi.call/pyobjc-tc.c (main): Treat result value
-	as of type ffi_arg.
-	* testsuite/libffi.call/struct3.c (main): Fix CHECK.
+commit 0cfe60e9d13f132b88995cfee41f2156344f6fa2
+Author: Anthony Green <green@gmachine.(none)>
+Date:   Tue Dec 29 10:06:04 2009 -0500
 
-2004-01-22  Ulrich Weigand  <uweigand@de.ibm.com>
+    3.0.9rc12
 
-	* testsuite/libffi.call/cls_uint.c (cls_ret_uint_fn): Treat result
-	value as of type ffi_arg, not unsigned int.
+commit 14e2e92e8645804b6940b3e96c98e9f7f384a6b2
+Author: Anthony Green <green@gmachine.(none)>
+Date:   Sun Dec 27 21:03:33 2009 -0500
 
-2004-01-21  Michael Ritzert  <ritzert@t-online.de>
+    3.0.9rc11
 
-	* ffi64.c (ffi_prep_args): Cast the RHS of an assignment instead
-	of the LHS.
+commit 884402787bf8eaf7ec207085037cf8ace2f660ec
+Author: Anthony Green <green@gmachine.(none)>
+Date:   Sat Dec 26 12:57:23 2009 -0500
 
-2004-01-12  Andreas Tobler  <a.tobler@schweiz.ch>
+    HPUX support and avr32 test fixes.
 
-	* testsuite/lib/libffi-dg.exp: Set LD_LIBRARY_PATH_32 for
-	Solaris.
+commit 01c78756aff22efb1f122f8e93e068d7bf2185c7
+Author: Anthony Green <green@gmachine.(none)>
+Date:   Sat Dec 26 10:05:18 2009 -0500
 
-2004-01-08  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
+    3.0.9rc9
 
-	* testsuite/libffi.call/ffitest.h (allocate_mmap): Cast MAP_FAILED
-	to void *.
+commit 70868464651320268d79c6894db5a50fdc11032a
+Author: Anthony Green <green@gmachine.(none)>
+Date:   Sat Dec 26 09:58:03 2009 -0500
 
-2003-12-10  Richard Henderson  <rth@redhat.com>
+    Remove xfails for mips and arm
 
-	* testsuite/libffi.call/cls_align_pointer.c: Cast pointers to
-	size_t instead of int.
+commit 838d4ad920ec85cf5ca3b511221d67f6d9a99024
+Author: Anthony Green <green@gmachine.(none)>
+Date:   Sat Dec 26 09:57:27 2009 -0500
 
-2003-12-04  Hosaka Yuji  <hos@tamanegi.org>
+    Remove a bunch of xfails.
 
-	* testsuite/libffi.call/many_win32.c: Include <float.h>.
-	* testsuite/libffi.call/many_win32.c (main): Replace variable
-	int i with unsigned long ul.
+commit 7e37eaaf772f48906e69618c773b0a36c3927de9
+Author: Anthony Green <green@gmachine.(none)>
+Date:   Sat Dec 26 07:46:50 2009 -0500
 
-	* testsuite/libffi.call/cls_align_uint64.c: New test case.
-	* testsuite/libffi.call/cls_align_sint64.c: Likewise.
-	* testsuite/libffi.call/cls_align_uint32.c: Likewise.
-	* testsuite/libffi.call/cls_align_sint32.c: Likewise.
-	* testsuite/libffi.call/cls_align_uint16.c: Likewise.
-	* testsuite/libffi.call/cls_align_sint16.c: Likewise.
-	* testsuite/libffi.call/cls_align_float.c: Likewise.
-	* testsuite/libffi.call/cls_align_double.c: Likewise.
-	* testsuite/libffi.call/cls_align_longdouble.c: Likewise.
-	* testsuite/libffi.call/cls_align_pointer.c: Likewise.
+    Fix huge_struct for solaris
 
-2003-12-02  Hosaka Yuji  <hos@tamanegi.org>
+commit 07cc7a37194bc34064ebed7f2724333a798411c8
+Author: Anthony Green <green@gmachine.(none)>
+Date:   Sat Dec 26 07:23:04 2009 -0500
 
-	PR other/13221
-	* src/x86/ffi.c (ffi_prep_args, ffi_prep_incoming_args_SYSV):
-	Align arguments to 32 bits.
+    3.0.9rc8
 
-2003-12-01  Andreas Tobler  <a.tobler@schweiz.ch>
+commit 2b9be16ffabc81326128bc1bbdddff8ddc5d13d3
+Author: Anthony Green <green@gmachine.(none)>
+Date:   Sat Dec 26 07:04:45 2009 -0500
 
-	PR other/13221
-	* testsuite/libffi.call/cls_multi_sshort.c: New test case.
-	* testsuite/libffi.call/cls_multi_sshortchar.c: Likewise.
-	* testsuite/libffi.call/cls_multi_uchar.c: Likewise.
-	* testsuite/libffi.call/cls_multi_schar.c: Likewise.
-	* testsuite/libffi.call/cls_multi_ushortchar.c: Likewise.
-	* testsuite/libffi.call/cls_multi_ushort.c: Likewise.
+    3.0.9rc8
 
-	* testsuite/libffi.special/unwindtest.cc: Cosmetics.
+commit 9458d88f676e9a21ab8993a54e16754b11687419
+Author: Anthony Green <green@gmachine.(none)>
+Date:   Sat Dec 26 07:02:27 2009 -0500
 
-2003-11-26  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+    Rebase from GCC
 
-	* testsuite/libffi.call/ffitest.h: Include <fcntl.h>.
-	* testsuite/libffi.special/ffitestcxx.h: Likewise.
+commit 6a3412417593f068a04dc6163f4269cb295ad5ca
+Author: Anthony Green <green@gmachine.(none)>
+Date:   Sat Dec 26 06:51:33 2009 -0500
 
-2003-11-22  Andreas Tobler  <a.tobler@schweiz.ch>
+    Add Andreas Schwab's powerpc fix
 
-	* Makefile.in: Rebuilt.
-	* configure: Likewise.
-	* testsuite/libffi.special/unwindtest.cc: Convert the mmap to
-	the right type.
+commit 39c8792ece1043f41f4c395a2ce71f4cf0ff4674
+Author: Anthony Green <green@gmachine.(none)>
+Date:   Fri Dec 25 21:52:28 2009 -0500
 
-2003-11-21  Andreas Jaeger  <aj@suse.de>
-	    Andreas Tobler  <a.tobler@schweiz.ch>
+    3.0.9rc7
 
-	* acinclude.m4: Add AC_FUNC_MMAP_BLACKLIST.
-	* configure.in: Call AC_FUNC_MMAP_BLACKLIST.
-	* Makefile.in: Rebuilt.
-	* aclocal.m4: Likewise.
-	* configure: Likewise.
-	* fficonfig.h.in: Likewise.
-	* testsuite/lib/libffi-dg.exp: Add include dir.
-	* testsuite/libffi.call/ffitest.h: Add MMAP definitions.
-	* testsuite/libffi.special/ffitestcxx.h: Likewise.
-	* testsuite/libffi.call/closure_fn0.c: Use MMAP functionality
-	for ffi_closure if available.
-	* testsuite/libffi.call/closure_fn1.c: Likewise.
-	* testsuite/libffi.call/closure_fn2.c: Likewise.
-	* testsuite/libffi.call/closure_fn3.c: Likewise.
-	* testsuite/libffi.call/closure_fn4.c: Likewise.
-	* testsuite/libffi.call/closure_fn5.c: Likewise.
-	* testsuite/libffi.call/cls_12byte.c: Likewise.
-	* testsuite/libffi.call/cls_16byte.c: Likewise.
-	* testsuite/libffi.call/cls_18byte.c: Likewise.
-	* testsuite/libffi.call/cls_19byte.c: Likewise.
-	* testsuite/libffi.call/cls_1_1byte.c: Likewise.
-	* testsuite/libffi.call/cls_20byte.c: Likewise.
-	* testsuite/libffi.call/cls_20byte1.c: Likewise.
-	* testsuite/libffi.call/cls_24byte.c: Likewise.
-	* testsuite/libffi.call/cls_2byte.c: Likewise.
-	* testsuite/libffi.call/cls_3_1byte.c: Likewise.
-	* testsuite/libffi.call/cls_3byte1.c: Likewise.
-	* testsuite/libffi.call/cls_3byte2.c: Likewise.
-	* testsuite/libffi.call/cls_4_1byte.c: Likewise.
-	* testsuite/libffi.call/cls_4byte.c: Likewise.
-	* testsuite/libffi.call/cls_5byte.c: Likewise.
-	* testsuite/libffi.call/cls_64byte.c: Likewise.
-	* testsuite/libffi.call/cls_6byte.c: Likewise.
-	* testsuite/libffi.call/cls_7byte.c: Likewise.
-	* testsuite/libffi.call/cls_8byte.c: Likewise.
-	* testsuite/libffi.call/cls_9byte1.c: Likewise.
-	* testsuite/libffi.call/cls_9byte2.c: Likewise.
-	* testsuite/libffi.call/cls_double.c: Likewise.
-	* testsuite/libffi.call/cls_float.c: Likewise.
-	* testsuite/libffi.call/cls_schar.c: Likewise.
-	* testsuite/libffi.call/cls_sint.c: Likewise.
-	* testsuite/libffi.call/cls_sshort.c: Likewise.
-	* testsuite/libffi.call/cls_uchar.c: Likewise.
-	* testsuite/libffi.call/cls_uint.c: Likewise.
-	* testsuite/libffi.call/cls_ulonglong.c: Likewise.
-	* testsuite/libffi.call/cls_ushort.c: Likewise.
-	* testsuite/libffi.call/nested_struct.c: Likewise.
-	* testsuite/libffi.call/nested_struct1.c: Likewise.
-	* testsuite/libffi.call/nested_struct2.c: Likewise.
-	* testsuite/libffi.call/nested_struct3.c: Likewise.
-	* testsuite/libffi.call/problem1.c: Likewise.
-	* testsuite/libffi.special/unwindtest.cc: Likewise.
+commit 1d04af52e3e24db69f742064694c22f8df5cc70e
+Author: Anthony Green <green@gmachine.(none)>
+Date:   Fri Dec 25 09:50:36 2009 -0500
 
-2003-11-20  Andreas Tobler  <a.tobler@schweiz.ch>
+    Updated some mips XFAILs
 
-	* testsuite/lib/libffi-dg.exp: Make the -lgcc_s conditional.
+commit 26e9509c9b7929bc4fcf697071699051a652b1fd
+Author: Anthony Green <green@gmachine.(none)>
+Date:   Fri Dec 25 02:19:23 2009 -0500
 
-2003-11-19  Andreas Tobler  <a.tobler@schweiz.ch>
+    Clean up ChangeLog.libffi for older patches.
 
-	* testsuite/lib/libffi-dg.exp: Add DYLD_LIBRARY_PATH for darwin.
-	Add -lgcc_s to additional flags.
+commit 9c157d3215e4393777f83eb6fa801df6528f40d7
+Author: Anthony Green <green@gmachine.(none)>
+Date:   Fri Dec 25 02:15:40 2009 -0500
 
-2003-11-12  Andreas Tobler  <a.tobler@schweiz.ch>
+    Clean up undefine_AC_ARG_VAR_PRECIOUS patch.
 
-	* configure.in, include/Makefile.am: PR libgcj/11147, install
-	the ffitarget.h header file in a gcc versioned and target
-	dependent place.
-	* configure: Regenerated.
-	* Makefile.in, include/Makefile.in: Likewise.
-	* testsuite/Makefile.in: Likewise.
+commit d22de05b0bfc480766bc1240615ce2830eee71b8
+Author: Anthony Green <green@gmachine.(none)>
+Date:   Fri Dec 25 02:04:23 2009 -0500
 
-2003-11-09  Andreas Tobler  <a.tobler@schweiz.ch>
+    Fix patches
 
-	* testsuite/libffi.call/closure_fn0.c: Print result and check
-	with dg-output to make debugging easier.
-	* testsuite/libffi.call/closure_fn1.c: Likewise.
-	* testsuite/libffi.call/closure_fn2.c: Likewise.
-	* testsuite/libffi.call/closure_fn3.c: Likewise.
-	* testsuite/libffi.call/closure_fn4.c: Likewise.
-	* testsuite/libffi.call/closure_fn5.c: Likewise.
-	* testsuite/libffi.call/cls_12byte.c: Likewise.
-	* testsuite/libffi.call/cls_16byte.c: Likewise.
-	* testsuite/libffi.call/cls_18byte.c: Likewise.
-	* testsuite/libffi.call/cls_19byte.c: Likewise.
-	* testsuite/libffi.call/cls_1_1byte.c: Likewise.
-	* testsuite/libffi.call/cls_20byte.c: Likewise.
-	* testsuite/libffi.call/cls_20byte1.c: Likewise.
-	* testsuite/libffi.call/cls_24byte.c: Likewise.
-	* testsuite/libffi.call/cls_2byte.c: Likewise.
-	* testsuite/libffi.call/cls_3_1byte.c: Likewise.
-	* testsuite/libffi.call/cls_3byte1.c: Likewise.
-	* testsuite/libffi.call/cls_3byte2.c: Likewise.
-	* testsuite/libffi.call/cls_4_1byte.c: Likewise.
-	* testsuite/libffi.call/cls_4byte.c: Likewise.
-	* testsuite/libffi.call/cls_5byte.c: Likewise.
-	* testsuite/libffi.call/cls_64byte.c: Likewise.
-	* testsuite/libffi.call/cls_6byte.c: Likewise.
-	* testsuite/libffi.call/cls_7byte.c: Likewise.
-	* testsuite/libffi.call/cls_8byte.c: Likewise.
-	* testsuite/libffi.call/cls_9byte1.c: Likewise.
-	* testsuite/libffi.call/cls_9byte2.c: Likewise.
-	* testsuite/libffi.call/cls_double.c: Likewise.
-	* testsuite/libffi.call/cls_float.c: Likewise.
-	* testsuite/libffi.call/cls_schar.c: Likewise.
-	* testsuite/libffi.call/cls_sint.c: Likewise.
-	* testsuite/libffi.call/cls_sshort.c: Likewise.
-	* testsuite/libffi.call/cls_uchar.c: Likewise.
-	* testsuite/libffi.call/cls_uint.c: Likewise.
-	* testsuite/libffi.call/cls_ulonglong.c: Likewise.
-	* testsuite/libffi.call/cls_ushort.c: Likewise.
-	* testsuite/libffi.call/problem1.c: Likewise.
+commit 1fe3dc7c20dc4dbd8fed0d19c8618027d44ed971
+Author: Anthony Green <green@gmachine.(none)>
+Date:   Fri Dec 25 01:39:00 2009 -0500
 
-	* testsuite/libffi.special/unwindtest.cc: Make ffi_closure
-	static.
+    Add windows support patch.
 
-2003-11-08  Andreas Tobler  <a.tobler@schweiz.ch>
+commit f7c0bc613a88f7dbc2d18b345c10fa438833c170
+Author: Anthony Green <green@gmachine.(none)>
+Date:   Fri Dec 25 01:22:11 2009 -0500
 
-	* testsuite/libffi.call/cls_9byte2.c: New test case.
-	* testsuite/libffi.call/cls_9byte1.c: Likewise.
-	* testsuite/libffi.call/cls_64byte.c: Likewise.
-	* testsuite/libffi.call/cls_20byte1.c: Likewise.
-	* testsuite/libffi.call/cls_19byte.c: Likewise.
-	* testsuite/libffi.call/cls_18byte.c: Likewise.
-	* testsuite/libffi.call/closure_fn4.c: Likewise.
-	* testsuite/libffi.call/closure_fn5.c: Likewise.
-	* testsuite/libffi.call/cls_schar.c: Likewise.
-	* testsuite/libffi.call/cls_sint.c: Likewise.
-	* testsuite/libffi.call/cls_sshort.c: Likewise.
-	* testsuite/libffi.call/nested_struct2.c: Likewise.
-	* testsuite/libffi.call/nested_struct3.c: Likewise.
+    3.0.9rc6
 
-2003-11-08  Andreas Tobler  <a.tobler@schweiz.ch>
+commit c7fa2da8260258c11ab1dc7ac06fb611a2c1b50f
+Author: Anthony Green <green@gmachine.(none)>
+Date:   Thu Dec 24 07:22:44 2009 -0500
 
-	* testsuite/libffi.call/cls_double.c: Do a check on the result.
-	* testsuite/libffi.call/cls_uchar.c: Likewise.
-	* testsuite/libffi.call/cls_uint.c: Likewise.
-	* testsuite/libffi.call/cls_ulonglong.c: Likewise.
-	* testsuite/libffi.call/cls_ushort.c: Likewise.
-	* testsuite/libffi.call/return_sc.c: Cleanup whitespaces.
+    3.0.9rc6
 
-2003-11-06  Andreas Tobler  <a.tobler@schweiz.ch>
+commit da11bece0fde66fc0268db3a01207dda857e25d2
+Author: Anthony Green <green@gmachine.(none)>
+Date:   Thu Dec 24 05:34:46 2009 -0500
 
-	* src/prep_cif.c (ffi_prep_cif): Move the validity check after
-	the initialization.
+    Release 3.0.9rc5
 
-2003-10-23  Andreas Tobler  <a.tobler@schweiz.ch>
+commit e3399b11edeab546b066bfc18574f3edb905d0dc
+Author: Anthony Green <green@gmachine.(none)>
+Date:   Thu Dec 24 01:09:32 2009 -0500
 
-	* src/java_raw_api.c (ffi_java_ptrarray_to_raw): Replace
-	FFI_ASSERT(FALSE) with FFI_ASSERT(0).
+    Update README
 
-2003-10-22  David Daney  <ddaney@avtrex.com>
+commit 115ab36fceee69740a01ce49bc27e1908cc237b1
+Author: Anthony Green <green@gmachine.(none)>
+Date:   Thu Dec 24 00:22:00 2009 -0500
 
-	* src/mips/ffitarget.h: Replace undefined UINT32 and friends with
-	__attribute__((__mode__(__SI__))) and friends.
+    Update missing changes for 3.0.9r4.
 
-2003-10-22  Andreas Schwab  <schwab@suse.de>
+commit f8c7a245bf5a80bd7e730ec03fcad17c8dcfcb07
+Author: Anthony Green <green@gmachine.(none)>
+Date:   Wed Dec 23 23:46:22 2009 -0500
 
-	* src/ia64/ffi.c: Replace FALSE/TRUE with false/true.
+    Switch to quilt. Rebase to latest GCC.
 
-2003-10-21  Andreas Tobler  <a.tobler@schweiz.ch>
+commit ce806772f02387b9a74f6496a263a368bccd5d59
+Merge: cd98813 dcc1f6b
+Author: Anthony Green <green@moxielogic.com>
+Date:   Mon Oct 5 00:41:35 2009 -0400
 
-	* configure.in: AC_LINK_FILES(ffitarget.h).
-	* configure: Regenerate.
-	* Makefile.in: Likewise.
-	* include/Makefile.in: Likewise.
-	* testsuite/Makefile.in: Likewise.
-	* fficonfig.h.in: Likewise.
+    Merge branch 'master' of git@github.com:atgreen/libffi
 
-2003-10-21  Paolo Bonzini  <bonzini@gnu.org>
-	    Richard Henderson  <rth@redhat.com>
+commit dcc1f6b4f1ffd2713bf68b791a13f85d455c8b1b
+Author: Anthony Green <green@moxielogic.com>
+Date:   Mon Oct 5 00:29:33 2009 -0400
 
-	Avoid that ffi.h includes fficonfig.h.
+    More clean up.
 
-	* Makefile.am (EXTRA_DIST): Include ffitarget.h files
-	(TARGET_SRC_MIPS_GCC): Renamed to TARGET_SRC_MIPS_IRIX.
-	(TARGET_SRC_MIPS_SGI): Removed.
-	(MIPS_GCC): Renamed to TARGET_SRC_MIPS_IRIX.
-	(MIPS_SGI): Removed.
-	(CLEANFILES): Removed.
-	(mostlyclean-am, clean-am, mostlyclean-sub, clean-sub): New
-	targets.
-	* acconfig.h: Removed.
-	* configure.in: Compute sizeofs only for double and long double.
-	Use them to define and subst HAVE_LONG_DOUBLE.  Include comments
-	into AC_DEFINE instead of using acconfig.h.  Create
-	include/ffitarget.h instead of include/fficonfig.h.  Rename
-	MIPS_GCC to MIPS_IRIX, drop MIPS_SGI since we are in gcc's tree.
-	AC_DEFINE EH_FRAME_FLAGS.
-	* include/Makefile.am (DISTCLEANFILES): New automake macro.
-	(hack_DATA): Add ffitarget.h.
-	* include/ffi.h.in: Remove all system specific definitions.
-	Declare raw API even if it is not installed, why bother?
-	Use limits.h instead of SIZEOF_* to define ffi_type_*.  Do
-	not define EH_FRAME_FLAGS, it is in fficonfig.h now.  Include
-	ffitarget.h instead of fficonfig.h.  Remove ALIGN macro.
-	(UINT_ARG, INT_ARG): Removed, use ffi_arg and ffi_sarg instead.
-	* include/ffi_common.h (bool): Do not define.
-	(ffi_assert): Accept failed assertion.
-	(ffi_type_test): Return void and accept file/line.
-	(FFI_ASSERT): Pass stringized failed assertion.
-	(FFI_ASSERT_AT): New macro.
-	(FFI_ASSERT_VALID_TYPE): New macro.
-	(UINT8, SINT8, UINT16, SINT16, UINT32, SINT32,
-	UINT64, SINT64): Define here with gcc's __attribute__ macro
-	instead of in ffi.h
-	(FLOAT32, ALIGN): Define here instead of in ffi.h
-	* include/ffi-mips.h: Removed.  Its content moved to
-	src/mips/ffitarget.h after separating assembly and C sections.
-	* src/alpha/ffi.c, src/alpha/ffi.c, src/java_raw_api.c
-	src/prep_cif.c, src/raw_api.c, src/ia64/ffi.c,
-	src/mips/ffi.c, src/mips/n32.S, src/mips/o32.S,
-	src/mips/ffitarget.h, src/sparc/ffi.c, src/x86/ffi64.c:
-	SIZEOF_ARG -> FFI_SIZEOF_ARG.
-	* src/ia64/ffi.c: Include stdbool.h (provided by GCC 2.95+).
-	* src/debug.c (ffi_assert): Accept stringized failed assertion.
-	(ffi_type_test): Rewritten.
-	* src/prep-cif.c (initialize_aggregate, ffi_prep_cif): Call
-	FFI_ASSERT_VALID_TYPE.
-	* src/alpha/ffitarget.h, src/arm/ffitarget.h,
-	src/ia64/ffitarget.h, src/m68k/ffitarget.h,
-	src/mips/ffitarget.h, src/powerpc/ffitarget.h,
-	src/s390/ffitarget.h, src/sh/ffitarget.h,
-	src/sh64/ffitarget.h, src/sparc/ffitarget.h,
-	src/x86/ffitarget.h: New files.
-	* src/alpha/osf.S, src/arm/sysv.S, src/ia64/unix.S,
-	src/m68k/sysv.S, src/mips/n32.S, src/mips/o32.S,
-	src/powerpc/aix.S, src/powerpc/darwin.S,
-	src/powerpc/ffi_darwin.c, src/powerpc/linux64.S,
-	src/powerpc/linux64_closure.S, src/powerpc/ppc_closure.S,
-	src/powerpc/sysv.S, src/s390/sysv.S, src/sh/sysv.S,
-	src/sh64/sysv.S, src/sparc/v8.S, src/sparc/v9.S,
-	src/x86/sysv.S, src/x86/unix64.S, src/x86/win32.S:
-	include fficonfig.h
+commit 2829f5941a223b9d851d8ab6318318e6197d7e01
+Author: Anthony Green <green@moxielogic.com>
+Date:   Mon Oct 5 00:28:03 2009 -0400
 
-2003-10-20  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
+    Clean up
 
-	* src/mips/ffi.c: Use _ABIN32, _ABIO32 instead of external
-	_MIPS_SIM_NABI32, _MIPS_SIM_ABI32.
+commit cd98813de517ea64041637e3e78d27a001d6d3b4
+Author: Anthony Green <green@moxielogic.com>
+Date:   Mon Oct 5 00:25:29 2009 -0400
 
-2003-10-19  Andreas Tobler  <a.tobler@schweiz.ch>
+    From Jens Rehsack.  Fix for 64-bit AIX.
 
-	* src/powerpc/ffi_darwin.c (ffi_prep_args): Declare bytes again.
-	Used when FFI_DEBUG = 1.
+commit e4a91de766acc47f6c50f13cc11719a65e23ecba
+Author: Anthony Green <green@moxielogic.com>
+Date:   Mon Oct 5 00:16:17 2009 -0400
 
-2003-10-14  Alan Modra  <amodra@bigpond.net.au>
+    From Abdulaziz Ghuloum.  Adds special case for Snow Leopard.
 
-	* src/types.c (double, longdouble): Default POWERPC64 to 8 byte size
-	and align.
+commit 3425a763bcdaadb8b430226f427ec833afdcc96a
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sun Oct 4 23:57:29 2009 -0400
 
-2003-10-06  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
+    Fix detection of free/openbsd.  From Alexis Ballier.
 
-	* include/ffi_mips.h: Define FFI_MIPS_N32 for N32/N64 ABIs,
-	FFI_MIPS_O32 for O32 ABI.
+commit 2340e7a777902de61499d47823ad8d5e0eeb6203
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sun Oct 4 23:53:17 2009 -0400
 
-2003-10-01  Andreas Tobler  <a.tobler@schweiz.ch>
+    AVR support
 
-	* testsuite/lib/libffi-dg.exp: Set LD_LIBRARY_PATH_64 for
-	SPARC64. Cleanup whitespaces.
+commit 5cbe2058c128e848446ae79fe15ee54260a90559
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sun Oct 4 23:53:11 2009 -0400
 
-2003-09-19  Andreas Tobler  <a.tobler@schweiz.ch>
+    Initial stand-alone patch.
 
-	* testsuite/libffi.call/closure_fn0.c: Xfail mips, arm,
-	strongarm, xscale. Cleanup whitespaces.
-	* testsuite/libffi.call/closure_fn1.c: Likewise.
-	* testsuite/libffi.call/closure_fn2.c: Likewise.
-	* testsuite/libffi.call/closure_fn3.c: Likewise.
-	* testsuite/libffi.call/cls_12byte.c: Likewise.
-	* testsuite/libffi.call/cls_16byte.c: Likewise.
-	* testsuite/libffi.call/cls_1_1byte.c: Likewise.
-	* testsuite/libffi.call/cls_20byte.c: Likewise.
-	* testsuite/libffi.call/cls_24byte.c: Likewise.
-	* testsuite/libffi.call/cls_2byte.c: Likewise.
-	* testsuite/libffi.call/cls_3_1byte.c: Likewise.
-	* testsuite/libffi.call/cls_3byte1.c: Likewise.
-	* testsuite/libffi.call/cls_3byte2.c: Likewise.
-	* testsuite/libffi.call/cls_4_1byte.c: Likewise.
-	* testsuite/libffi.call/cls_4byte.c: Likewise.
-	* testsuite/libffi.call/cls_5byte.c: Likewise.
-	* testsuite/libffi.call/cls_6byte.c: Likewise.
-	* testsuite/libffi.call/cls_7byte.c: Likewise.
-	* testsuite/libffi.call/cls_8byte.c: Likewise.
-	* testsuite/libffi.call/cls_double.c: Likewise.
-	* testsuite/libffi.call/cls_float.c: Likewise.
-	* testsuite/libffi.call/cls_uchar.c: Likewise.
-	* testsuite/libffi.call/cls_uint.c: Likewise.
-	* testsuite/libffi.call/cls_ulonglong.c: Likewise.
-	* testsuite/libffi.call/cls_ushort.c: Likewise.
-	* testsuite/libffi.call/nested_struct.c: Likewise.
-	* testsuite/libffi.call/nested_struct1.c: Likewise.
-	* testsuite/libffi.call/problem1.c: Likewise.
-	* testsuite/libffi.special/unwindtest.cc: Likewise.
-	* testsuite/libffi.call/pyobjc-tc.c: Cleanup whitespaces.
+commit c6dddbd02bad9654ed58cdb0feb360934d105dec
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sun Oct 4 08:11:33 2009 -0400
 
-2003-09-18  David Edelsohn  <edelsohn@gnu.org>
+    Initial commit
 
-	* src/powerpc/aix.S: Cleanup whitespaces.
-	* src/powerpc/aix_closure.S: Likewise.
+commit 5ffc0c37486fb1538bccc0ca7acc807d4f1af932
+Author: Anthony Green <green@moxielogic.com>
+Date:   Sun Oct 4 07:58:22 2009 -0400
 
-2003-09-18  Andreas Tobler  <a.tobler@schweiz.ch>
+    Update version to 3.0.9rc1.  Add more useful things to .gitignore.
 
-	* src/powerpc/darwin.S: Cleanup whitespaces, comment formatting.
-	* src/powerpc/darwin_closure.S: Likewise.
-	* src/powerpc/ffi_darwin.c: Likewise.
+commit bd29f83ee9f6fa6b65adee9d3f57834f364d9887
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Sep 29 12:07:26 2009 -0400
 
-2003-09-18  Andreas Tobler  <a.tobler@schweiz.ch>
-	    David Edelsohn  <edelsohn@gnu.org>
+    Add .gitignore
 
-	* src/types.c (double): Add AIX and Darwin to the right TYPEDEF.
-	* src/powerpc/aix_closure.S: Remove the pointer to the outgoing
-	parameter stack.
-	* src/powerpc/darwin_closure.S: Likewise.
-	* src/powerpc/ffi_darwin.c (ffi_prep_args): Handle structures
-	according to the Darwin/AIX ABI.
-	(ffi_prep_cif_machdep): Likewise.
-	(ffi_closure_helper_DARWIN): Likewise.
-	Remove the outgoing parameter stack logic. Simplify the evaluation
-	of the different CASE types.
-	(ffi_prep_clousure): Avoid the casts on lvalues. Change the branch
-	statement in the trampoline code.
+commit 9474f853f83e3f0167c1b306177321bfcc93e56d
+Author: Anthony Green <green@moxielogic.com>
+Date:   Tue Sep 29 11:13:02 2009 -0400
 
-2003-09-18  Kaz Kojima  <kkojima@gcc.gnu.org>
+    Remove old CVSROOT files.
 
-	* src/sh/ffi.c (ffi_prep_args): Take account into the alignement
-	for the register size.
-	(ffi_closure_helper_SYSV): Handle the structure return value
-	address correctly.
-	(ffi_closure_helper_SYSV): Return the appropriate type when
-	the registers are used for the structure return value.
-	* src/sh/sysv.S (ffi_closure_SYSV): Fix the stack layout for
-	the 64-bit return value.  Update copyright years.
+commit 0c25275ec24bfe2c2c25a000465f0950ef9dd51b
+Author: twall <twall>
+Date:   Wed Aug 19 12:57:34 2009 +0000
 
-2003-09-17  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
+    Apply Dave Korn's cygwin/GCC changes
 
-	* testsuite/lib/libffi-dg.exp (libffi_target_compile): Search in
-	srcdir for ffi_mips.h.
+commit 39228c27ed3f677a95b46380a8d31602b5777e1a
+Author: aph <aph>
+Date:   Tue Jun 16 18:00:47 2009 +0000
 
-2003-09-12  Alan Modra  <amodra@bigpond.net.au>
+    2009-06-16  Wim Lewis  <wiml@hhhh.org>
+    
+    	* src/powerpc/ffi.c: Avoid clobbering cr3 and cr4, which are
+    	supposed to be callee-saved.
+    	* src/powerpc/sysv.S (small_struct_return_value): Fix overrun of
+    	return buffer for odd-size structs.
 
-	* src/prep_cif.c (initialize_aggregate): Include tail padding in
-	structure size.
-	* src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Correct
-	placement of float result.
-	* testsuite/libffi.special/unwindtest.cc (closure_test_fn1): Correct
-	cast of "resp" for big-endian 64 bit machines.
+commit 5e93cc704d127c2c8ae7f5d2cef621145d43e777
+Author: aph <aph>
+Date:   Tue Jun 16 17:41:47 2009 +0000
 
-2003-09-11  Alan Modra  <amodra@bigpond.net.au>
+    2009-06-16  Andreas Tobler  <a.tobler@schweiz.org>
+    
+    	PR libffi/40444
+    	* testsuite/lib/libffi-dg.exp (libffi_target_compile): Add
+    	allow_stack_execute for Darwin.
 
-	* src/types.c (double, longdouble): Merge identical SH and ARM
-	typedefs, and add POWERPC64.
-	* src/powerpc/ffi.c (ffi_prep_args64): Correct next_arg calc for
-	struct split over gpr and rest.
-	(ffi_prep_cif_machdep): Correct intarg_count for structures.
-	* src/powerpc/linux64.S (ffi_call_LINUX64): Fix gpr offsets.
+commit b509af8959dc371b92392c623522ea6f4946a71d
+Author: aph <aph>
+Date:   Tue Jun 16 16:17:52 2009 +0000
 
-2003-09-09  Andreas Tobler  <a.tobler@schweiz.ch>
+    2009-06-16  Andrew Haley  <aph@redhat.com>
+    
+    	* configure.ac (TARGETDIR): Add missing blank lines.
+    	* configure: Regenerate.
 
-	* src/powerpc/ffi.c (ffi_closure_helper_SYSV) Handle struct
-	passing correctly.
+commit d57e96dc56ee76fbbb9b59d73aeaa92354db5ecb
+Author: aph <aph>
+Date:   Tue Jun 16 09:59:02 2009 +0000
 
-2003-09-09  Alan Modra  <amodra@bigpond.net.au>
+    2009-06-16  Andrew Haley  <aph@redhat.com>
+    
+            * testsuite/libffi.call/cls_align_sint64.c,
+            testsuite/libffi.call/cls_align_uint64.c,
+            testsuite/libffi.call/cls_longdouble_va.c,
+            testsuite/libffi.call/cls_ulonglong.c,
+            testsuite/libffi.call/return_ll1.c,
+            testsuite/libffi.call/stret_medium2.c: Fix printf format
+            specifiers.
+            * testsuite/libffi.call/huge_struct.c: Ad x86 XFAILs.
+            * testsuite/libffi.call/float2.c: Fix dg-excess-errors.
+            * testsuite/libffi.call/ffitest.h,
+            testsuite/libffi.special/ffitestcxx.h (PRIdLL, PRIuLL): Define.
 
-	* configure: Regenerate.
+commit b01d6d1982c9e020507029bfd5a58a8c60d111fa
+Author: aph <aph>
+Date:   Tue Jun 16 09:44:54 2009 +0000
 
-2003-09-04  Andreas Tobler  <a.tobler@schweiz.ch>
+    2009-06-16  Andrew Haley  <aph@redhat.com>
+    
+    	* testsuite/libffi.call/err_bad_typedef.c: xfail everywhere.
+    	* testsuite/libffi.call/err_bad_abi.c: Likewise.
 
-	* Makefile.am: Remove build rules for ffitest.
-	* Makefile.in: Rebuilt.
+commit 35b6ded138591900a88055a8a8ac1fadc29a76d6
+Author: aph <aph>
+Date:   Fri Jun 12 15:29:20 2009 +0000
 
-2003-09-04  Andreas Tobler  <a.tobler@schweiz.ch>
+    2009-06-11  Kaz Kojima  <kkojima@gcc.gnu.org>
+    
+            * testsuite/libffi.call/cls_longdouble_va.c: Add xfail sh*-*-linux-*.
+            * testsuite/libffi.call/err_bad_abi.c: Add xfail sh*-*-*.
+            * testsuite/libffi.call/err_bad_typedef.c: Likewise.
 
-	* src/java_raw_api.c: Include <stdlib.h> to fix compiler warning
-	about implicit declaration of abort().
+commit acc46605f2d95d67d69398e7644610f10a157ce3
+Author: aph <aph>
+Date:   Fri Jun 12 14:21:28 2009 +0000
 
-2003-09-04  Andreas Tobler  <a.tobler@schweiz.ch>
+    2009-06-12  Andrew Haley  <aph@redhat.com>
+    
+            * ChangeLog.libffi: testsuite/libffi.call/cls_align_sint64.c,
+            testsuite/libffi.call/cls_align_uint64.c,
+            testsuite/libffi.call/cls_ulonglong.c,
+            testsuite/libffi.call/return_ll1.c,
+            testsuite/libffi.call/stret_medium2.c: Fix printf format
+            specifiers.
+            testsuite/libffi.special/unwindtest.cc: include stdint.h.
 
-	* Makefile.am: Add dejagnu test framework. Fixes PR other/11411.
-	* Makefile.in: Rebuilt.
-	* configure.in: Add dejagnu test framework.
-	* configure: Rebuilt.
+commit 16d1996ed0797bd7c11aca2b0fe7e7748751aaf6
+Author: twall <twall>
+Date:   Thu Jun 11 14:27:42 2009 +0000
 
-	* testsuite/Makefile.am: New file.
-	* testsuite/Makefile.in: Built
-	* testsuite/lib/libffi-dg.exp: New file.
-	* testsuite/config/default.exp: Likewise.
-	* testsuite/libffi.call/call.exp: Likewise.
-	* testsuite/libffi.call/ffitest.h: Likewise.
-	* testsuite/libffi.call/closure_fn0.c: Likewise.
-	* testsuite/libffi.call/closure_fn1.c: Likewise.
-	* testsuite/libffi.call/closure_fn2.c: Likewise.
-	* testsuite/libffi.call/closure_fn3.c: Likewise.
-	* testsuite/libffi.call/cls_1_1byte.c: Likewise.
-	* testsuite/libffi.call/cls_3_1byte.c: Likewise.
-	* testsuite/libffi.call/cls_4_1byte.c: Likewise.
-	* testsuite/libffi.call/cls_2byte.c: Likewise.
-	* testsuite/libffi.call/cls_3byte1.c: Likewise.
-	* testsuite/libffi.call/cls_3byte2.c: Likewise.
-	* testsuite/libffi.call/cls_4byte.c: Likewise.
-	* testsuite/libffi.call/cls_5byte.c: Likewise.
-	* testsuite/libffi.call/cls_6byte.c: Likewise.
-	* testsuite/libffi.call/cls_7byte.c: Likewise.
-	* testsuite/libffi.call/cls_8byte.c: Likewise.
-	* testsuite/libffi.call/cls_12byte.c: Likewise.
-	* testsuite/libffi.call/cls_16byte.c: Likewise.
-	* testsuite/libffi.call/cls_20byte.c: Likewise.
-	* testsuite/libffi.call/cls_24byte.c: Likewise.
-	* testsuite/libffi.call/cls_double.c: Likewise.
-	* testsuite/libffi.call/cls_float.c: Likewise.
-	* testsuite/libffi.call/cls_uchar.c: Likewise.
-	* testsuite/libffi.call/cls_uint.c: Likewise.
-	* testsuite/libffi.call/cls_ulonglong.c: Likewise.
-	* testsuite/libffi.call/cls_ushort.c: Likewise.
-	* testsuite/libffi.call/float.c: Likewise.
-	* testsuite/libffi.call/float1.c: Likewise.
-	* testsuite/libffi.call/float2.c: Likewise.
-	* testsuite/libffi.call/many.c: Likewise.
-	* testsuite/libffi.call/many_win32.c: Likewise.
-	* testsuite/libffi.call/nested_struct.c: Likewise.
-	* testsuite/libffi.call/nested_struct1.c: Likewise.
-	* testsuite/libffi.call/pyobjc-tc.c: Likewise.
-	* testsuite/libffi.call/problem1.c: Likewise.
-	* testsuite/libffi.call/promotion.c: Likewise.
-	* testsuite/libffi.call/return_ll.c: Likewise.
-	* testsuite/libffi.call/return_sc.c: Likewise.
-	* testsuite/libffi.call/return_uc.c: Likewise.
-	* testsuite/libffi.call/strlen.c: Likewise.
-	* testsuite/libffi.call/strlen_win32.c: Likewise.
-	* testsuite/libffi.call/struct1.c: Likewise.
-	* testsuite/libffi.call/struct2.c: Likewise.
-	* testsuite/libffi.call/struct3.c: Likewise.
-	* testsuite/libffi.call/struct4.c: Likewise.
-	* testsuite/libffi.call/struct5.c: Likewise.
-	* testsuite/libffi.call/struct6.c: Likewise.
-	* testsuite/libffi.call/struct7.c: Likewise.
-	* testsuite/libffi.call/struct8.c: Likewise.
-	* testsuite/libffi.call/struct9.c: Likewise.
-	* testsuite/libffi.special/special.exp: New file.
-	* testsuite/libffi.special/ffitestcxx.h: Likewise.
-	* testsuite/libffi.special/unwindtest.cc: Likewise.
+    update changelog
 
+commit 92a515c33efe91be3cb0258f01c63aff208489c7
+Author: twall <twall>
+Date:   Thu Jun 11 14:27:28 2009 +0000
 
-2003-08-13  Kaz Kojima  <kkojima@gcc.gnu.org>
+    use ffi_closure_alloc instead of stack-based closure
 
-	* src/sh/ffi.c (OFS_INT16): Set 0 for little endian case.  Update
-	copyright years.
+commit e4363160ba9e50167f9ca0a7399d537a1d2cd0ce
+Author: twall <twall>
+Date:   Thu Jun 11 14:26:23 2009 +0000
 
-2003-08-02  Alan Modra  <amodra@bigpond.net.au>
+    remove unused extern
 
-	* src/powerpc/ffi.c (ffi_prep_args64): Modify for changed gcc
-	structure passing.
-	(ffi_closure_helper_LINUX64): Likewise.
-	* src/powerpc/linux64.S: Remove code writing to parm save area.
-	* src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Use return
-	address in lr from ffi_closure_helper_LINUX64 call to calculate
-	table address.  Optimize function tail.
+commit 1dc2781d2ba38f5f000ff70069d617fb21e1d2af
+Author: twall <twall>
+Date:   Thu Jun 11 11:36:16 2009 +0000
 
-2003-07-28  Andreas Tobler  <a.tobler@schweiz.ch>
+    remove not-yet-applied changelog entries
 
-	* src/sparc/ffi.c: Handle all floating point registers.
-	* src/sparc/v9.S: Likewise. Fixes second part of PR target/11410.
+commit bb27735fe689dac97ec0dc847ed8d3d519620109
+Author: twall <twall>
+Date:   Wed Jun 10 10:42:36 2009 +0000
 
-2003-07-11  Gerald Pfeifer  <pfeifer@dbai.tuwien.ac.at>
+    add win64 support
 
-	* README: Note that libffi is not part of GCC.  Update the project
-	URL and status.
+commit b2a54c100c74854a409820817d54617fdda39eb8
+Author: aph <aph>
+Date:   Mon Jun 8 16:50:49 2009 +0000
 
-2003-06-19  Franz Sirl  <Franz.Sirl-kernel@lauterbach.com>
+    2009-06-08  Andrew Haley  <aph@redhat.com>
+    
+    	* testsuite/libffi.call/err_bad_abi.c: Add xfails.
+    	* testsuite/libffi.call/cls_longdouble_va.c: Add xfails.
+    	* testsuite/libffi.call/cls_dbls_struct.c: Add xfail x86_64-*-linux-*.
+    	* testsuite/libffi.call/err_bad_typedef.c: Add xfails.
+    
+    	* testsuite/libffi.call/stret_medium2.c: Add __UNUSED__ to args.
+    	* testsuite/libffi.call/stret_medium.c: Likewise.
+    	* testsuite/libffi.call/stret_large2.c: Likewise.
+    	* testsuite/libffi.call/stret_large.c:  Likewise.
 
-	* src/powerpc/ppc_closure.S: Include ffi.h.
+commit 25723e7141f73d3736d7244b980c89d97db852b6
+Author: aph <aph>
+Date:   Fri Jun 5 13:03:40 2009 +0000
 
-2003-06-13  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
+    2009-06-05  Andrew Haley  <aph@redhat.com>
+    
+            * src/x86/win32.S (_ffi_closure_STDCALL): Import from gcc.
 
-	* src/x86/sysv.S: Avoid gas-only .uleb128/.sleb128 directives.
-	Use C style comments.
+commit 70758199c7cd41f411987360ccb302b497a56dc9
+Author: aph <aph>
+Date:   Thu Jun 4 16:29:58 2009 +0000
 
-2003-06-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
+     2009-06-04  Andrew Haley  <aph@redhat.com>
+    
+            * src/powerpc/ffitarget.h: Fix misapplied merge from gcc.
 
-	* Makefile.am: Add SHmedia support.  Fix a typo of SH support.
-	* Makefile.in: Regenerate.
-	* configure.in (sh64-*-linux*, sh5*-*-linux*): Add target.
-	* configure: Regenerate.
-	* include/ffi.h.in: Add SHmedia support.
-	* src/sh64/ffi.c: New file.
-	* src/sh64/sysv.S: New file.
+commit e8bb12563f9aa23ddf36fa6a5b92b16b5c3e1a7f
+Author: aph <aph>
+Date:   Thu Jun 4 14:59:18 2009 +0000
 
-2003-05-16  Jakub Jelinek  <jakub@redhat.com>
+    2009-06-04  Andrew Haley  <aph@redhat.com>
+    
+    	* src/mips/o32.S,
+    	src/mips/n32.S: Fix licence formatting.
 
-	* configure.in (HAVE_RO_EH_FRAME): Check whether .eh_frame section
-	should be read-only.
-	* configure: Rebuilt.
-	* fficonfig.h.in: Rebuilt.
-	* include/ffi.h.in (EH_FRAME_FLAGS): Define.
-	* src/alpha/osf.S: Use EH_FRAME_FLAGS.
-	* src/powerpc/linux64.S: Likewise.
-	* src/powerpc/linux64_closure.S: Likewise.  Include ffi.h.
-	* src/powerpc/sysv.S: Use EH_FRAME_FLAGS.  Use pcrel encoding
-	if -fpic/-fPIC/-mrelocatable.
-	* src/powerpc/powerpc_closure.S: Likewise.
-	* src/sparc/v8.S: If HAVE_RO_EH_FRAME is defined, don't include
-	#write in .eh_frame flags.
-	* src/sparc/v9.S: Likewise.
-	* src/x86/unix64.S: Use EH_FRAME_FLAGS.
-	* src/x86/sysv.S: Likewise.  Use pcrel encoding if -fpic/-fPIC.
-	* src/s390/sysv.S: Use EH_FRAME_FLAGS.  Include ffi.h.
+commit d66a8e32c3671479e3ce0f6819673e5932ba6b7f
+Author: aph <aph>
+Date:   Thu Jun 4 14:43:40 2009 +0000
 
-2003-05-07  Jeff Sturm  <jsturm@one-point.com>
+    2009-06-04  Andrew Haley  <aph@redhat.com>
+    
+    	* src/x86/darwin.S: Fix licence formatting.
+    	src/x86/win32.S: Likewise.
+    	src/sh64/sysv.S: Likewise.
+    	src/sh/sysv.S: Likewise.
 
-	Fixes PR bootstrap/10656
-	* configure.in (HAVE_AS_REGISTER_PSEUDO_OP): Test assembler
-	support for .register pseudo-op.
-	* src/sparc/v8.S: Use it.
-	* fficonfig.h.in: Rebuilt.
-	* configure: Rebuilt.
+commit 7c3b7fd6b5db746b5b09a718f3044f811372f941
+Author: aph <aph>
+Date:   Thu Jun 4 14:39:20 2009 +0000
 
-2003-04-18  Jakub Jelinek  <jakub@redhat.com>
+    2009-06-04  Andrew Haley  <aph@redhat.com>
+    
+    	* src/sh64/ffi.c: Remove lint directives.  Was missing from merge
+    	of Andreas Tobler's patch from 2006-04-22.
 
-	* include/ffi.h.in (POWERPC64): Define if 64-bit.
-	(enum ffi_abi): Add FFI_LINUX64 on POWERPC.
-	Make it the default on POWERPC64.
-	(FFI_TRAMPOLINE_SIZE): Define to 24 on POWERPC64.
-	* configure.in: Change powerpc-*-linux* into powerpc*-*-linux*.
-	* configure: Rebuilt.
-	* src/powerpc/ffi.c (hidden): Define.
-	(ffi_prep_args_SYSV): Renamed from
-	ffi_prep_args.  Cast pointers to unsigned long to shut up warnings.
-	(NUM_GPR_ARG_REGISTERS64, NUM_FPR_ARG_REGISTERS64,
-	ASM_NEEDS_REGISTERS64): New.
-	(ffi_prep_args64): New function.
-	(ffi_prep_cif_machdep): Handle FFI_LINUX64 ABI.
-	(ffi_call): Likewise.
-	(ffi_prep_closure): Likewise.
-	(flush_icache): Surround by #ifndef POWERPC64.
-	(ffi_dblfl): New union type.
-	(ffi_closure_helper_SYSV): Use it to avoid aliasing problems.
-	(ffi_closure_helper_LINUX64): New function.
-	* src/powerpc/ppc_closure.S: Surround whole file by #ifndef
-	__powerpc64__.
-	* src/powerpc/sysv.S: Likewise.
-	(ffi_call_SYSV): Rename ffi_prep_args to ffi_prep_args_SYSV.
-	* src/powerpc/linux64.S: New file.
-	* src/powerpc/linux64_closure.S: New file.
-	* Makefile.am (EXTRA_DIST): Add src/powerpc/linux64.S and
-	src/powerpc/linux64_closure.S.
-	(TARGET_SRC_POWERPC): Likewise.
+commit 1a2f93a8b362db13638afd9fcb3f2650180bfa17
+Author: aph <aph>
+Date:   Thu Jun 4 10:45:51 2009 +0000
 
-	* src/ffitest.c (closure_test_fn, closure_test_fn1, closure_test_fn2,
-	closure_test_fn3): Fix result printing on big-endian 64-bit
-	machines.
-	(main): Print tst2_arg instead of uninitialized tst2_result.
+    2009-06-04  Andrew Haley  <aph@redhat.com>
+    
+            * src/sh/ffi.c: Apply missing hunk from Alexandre Oliva's patch of
+            2007-03-07.
 
-	* src/ffitest.c (main): Hide what closure pointer really points to
-	from the compiler.
+commit 944c95cf7aaaaf7c5fa368cda4673dd38f45020e
+Author: aph <aph>
+Date:   Wed Jun 3 17:42:56 2009 +0000
 
-2003-04-16  Richard Earnshaw  <rearnsha@arm.com>
+    2009-05-22  Dave Korn  <dave.korn.cygwin@gmail.com>
+    
+           * src/x86/win32.S (_ffi_closure_STDCALL):  New function.
+           (.eh_frame):  Add FDE for it.
+    
+    2009-05-22  Dave Korn  <dave.korn.cygwin@gmail.com>
+    
+           * configure.ac:  Also check if assembler supports pc-relative
+           relocs on X86_WIN32 targets.
+           * configure:  Regenerate.
+           * src/x86/win32.S (ffi_prep_args):  Declare extern, not global.
+           (_ffi_call_SYSV):  Add missing function type symbol .def and
+           add EH markup labels.
+           (_ffi_call_STDCALL):  Likewise.
+           (_ffi_closure_SYSV):  Likewise.
+           (_ffi_closure_raw_SYSV):  Likewise.
+           (.eh_frame):  Add hand-crafted EH data.
+    
+    2008-11-21  Eric Botcazou  <ebotcazou@adacore.com>
+    
+           * src/sparc/ffi.c (ffi_prep_cif_machdep): Add support for
+           signed/unsigned int8/16 return values.
+           * src/sparc/v8.S (ffi_call_v8): Likewise.
+           (ffi_closure_v8): Likewise.
+    
+    2008-03-26  Kaz Kojima  <kkojima@gcc.gnu.org>
+    
+           * src/sh/sysv.S: Add .note.GNU-stack on Linux.
+           * src/sh64/sysv.S: Likewise.
+    
+    2008-03-26  Daniel Jacobowitz  <dan@debian.org>
+    
+           * src/arm/sysv.S: Fix ARM comment marker.
 
-	* configure.in (arm-*-netbsdelf*): Add configuration.
-	(configure): Regenerated.
+commit 00fa972430bb1535a4b34bf029ebcad500027b0c
+Author: twall <twall>
+Date:   Sat Dec 27 16:59:05 2008 +0000
 
-2003-04-04  Loren J. Rittle  <ljrittle@acm.org>
+    properly glob-match
 
-	* include/Makefile.in: Regenerate.
+commit f5179e6794ac35af26fe86e468b8508a7a570c55
+Author: twall <twall>
+Date:   Fri Dec 26 19:06:28 2008 +0000
 
-2003-03-21  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>
+    Mark XFAIL on longdouble tests for x86_64/mingw
 
-	* libffi/include/ffi.h.in: Define X86 instead of X86_64 in 32
-	bit mode.
-	* libffi/src/x86/ffi.c (ffi_closure_SYSV, ffi_closure_raw_SYSV):
-	Receive closure pointer through parameter, read args using
-	__builtin_dwarf_cfa.
-	(FFI_INIT_TRAMPOLINE): Send closure reference through eax.
+commit 80e2b5a749208c8a18f994ec5bee84594d051cc8
+Author: twall <twall>
+Date:   Mon Dec 22 15:21:15 2008 +0000
 
-2003-03-12  Andreas Schwab  <schwab@suse.de>
+    clean up tests for win64 use
 
-	* configure.in: Avoid trailing /. in toolexeclibdir.
-	* configure: Rebuilt.
+commit 7063d9996f742576095c7b0eb5016c0f9a670aec
+Author: green <green>
+Date:   Fri Dec 19 16:13:46 2008 +0000
 
-2003-03-03  Andreas Tobler <a.tobler@schweiz.ch>
+    Version 3.0.8 with x86-solaris support
 
-	* src/powerpc/darwin_closure.S: Recode to fit dynamic libraries.
+commit bdfeb13f0df0a63b19d62597517237b54d92228b
+Author: green <green>
+Date:   Fri Dec 19 15:47:44 2008 +0000
 
-2003-02-06  Andreas Tobler <a.tobler@schweiz.ch>
+    Bump to 3.0.7
 
-	* libffi/src/powerpc/darwin_closure.S:
-	Fix alignement bug, allocate 8 bytes for the result.
-	* libffi/src/powerpc/aix_closure.S:
-	Likewise.
-	* libffi/src/powerpc/ffi_darwin.c:
-	Update stackframe description for aix/darwin_closure.S.
+commit 69205de17d6ac4c11d4ba92d6a5b40a0c5f246b2
+Author: green <green>
+Date:   Thu Jul 24 18:03:48 2008 +0000
 
-2003-02-06  Jakub Jelinek  <jakub@redhat.com>
+    Many test fixes (failures due to excessive compiler warnings).
 
-	* src/s390/ffi.c (ffi_closure_helper_SYSV): Add hidden visibility
-	attribute.
+commit 260d513fea00b3613fe957a44a157fe72c4ca29e
+Author: green <green>
+Date:   Thu Jul 17 13:13:52 2008 +0000
 
-2003-01-31  Christian Cornelssen  <ccorn@cs.tu-berlin.de>,
-	    Andreas Schwab  <schwab@suse.de>
+    Version 3.0.6.  sh/sh64 fixes.
 
-	* configure.in: Adjust command to source config-ml.in to account
-	for changes to the libffi_basedir definition.
-	(libffi_basedir): Remove ${srcdir} from value and include trailing
-	slash if nonempty.
+commit 3704031875feabb74e3655ed03cff4c2b3c76ac6
+Author: green <green>
+Date:   Thu Apr 3 18:57:57 2008 +0000
 
-	* configure: Regenerate.
+    Rev 3.0.5.
 
-2003-01-29  Franz Sirl  <Franz.Sirl-kernel@lauterbach.com>
+commit 8406f5f48f7f58a1c982a93a95d521cf82b3241f
+Author: green <green>
+Date:   Thu Apr 3 18:57:34 2008 +0000
 
-	* src/powerpc/ppc_closure.S: Recode to fit shared libs.
+    3.0.5
 
-2003-01-28  Andrew Haley  <aph@redhat.com>
+commit 23a9e73212b62f9684cedb0ce70e92c59cfdaffa
+Author: green <green>
+Date:   Wed Mar 5 00:07:02 2008 +0000
 
-	* include/ffi.h.in: Enable FFI_CLOSURES for x86_64.
-	* src/x86/ffi64.c (ffi_prep_closure): New.
-	(ffi_closure_UNIX64_inner): New.
-	* src/x86/unix64.S (ffi_closure_UNIX64): New.
+    2008-03-04  Anthony Green  <green@redhat.com>
+                Blake Chaffin
+                hos@tamanegi.org
+    
+            * testsuite/libffi.call/cls_align_longdouble_split2.c
+              testsuite/libffi.call/cls_align_longdouble_split.c
+              testsuite/libffi.call/cls_dbls_struct.c
+              testsuite/libffi.call/cls_double_va.c
+              testsuite/libffi.call/cls_longdouble.c
+              testsuite/libffi.call/cls_longdouble_va.c
+              testsuite/libffi.call/cls_pointer.c
+              testsuite/libffi.call/cls_pointer_stack.c
+              testsuite/libffi.call/err_bad_abi.c
+              testsuite/libffi.call/err_bad_typedef.c
+              testsuite/libffi.call/huge_struct.c
+              testsuite/libffi.call/stret_large2.c
+              testsuite/libffi.call/stret_large.c
+              testsuite/libffi.call/stret_medium2.c
+              testsuite/libffi.call/stret_medium.c: New tests from Apple.
 
-2003-01-27  Alexandre Oliva  <aoliva@redhat.com>
+commit 429e37d3ad653e52e75bf725c883ab79e859f89a
+Author: green <green>
+Date:   Thu Feb 28 04:50:19 2008 +0000
 
-	* configure.in (toolexecdir, toolexeclibdir): Set and AC_SUBST.
-	Remove USE_LIBDIR conditional.
-	* Makefile.am (toolexecdir, toolexeclibdir): Don't override.
-	* Makefile.in, configure: Rebuilt.
+    clicky
 
-2003-01027  David Edelsohn  <edelsohn@gnu.org>
+commit 51e79c428348c033314f54bcb30f7e388c59e347
+Author: green <green>
+Date:   Thu Feb 28 04:47:35 2008 +0000
 
-	* Makefile.am (TARGET_SRC_POWERPC_AIX): Fix typo.
-	* Makefile.in: Regenerate.
+    getclicky
 
-2003-01-22  Andrew Haley  <aph@redhat.com>
+commit affcab04e280efeace45a72c4dc6152c0e4f1b7f
+Author: green <green>
+Date:   Tue Feb 26 19:01:53 2008 +0000
 
-	* src/powerpc/darwin.S (_ffi_call_AIX): Add Augmentation size to
-	unwind info.
+    2008-02-26  Jakub Jelinek  <jakub@redhat.com>
+                Anthony Green  <green@redhat.com>
+    
+            * src/alpha/osf.S: Add .note.GNU-stack on Linux.
+            * src/s390/sysv.S: Likewise.
+            * src/powerpc/linux64.S: Likewise.
+            * src/powerpc/linux64_closure.S: Likewise.
+            * src/powerpc/ppc_closure.S: Likewise.
+            * src/powerpc/sysv.S: Likewise.
+            * src/x86/unix64.S: Likewise.
+            * src/x86/sysv.S: Likewise.
+            * src/sparc/v8.S: Likewise.
+            * src/sparc/v9.S: Likewise.
+            * src/m68k/sysv.S: Likewise.
+            * src/ia64/unix.S: Likewise.
+            * src/arm/sysv.S: Likewise.
 
-2003-01-21  Andreas Tobler  <a.tobler@schweiz.ch>
+commit 59689d5522c159a3ac967adb6b891cf5f22c890f
+Author: green <green>
+Date:   Tue Feb 26 17:40:51 2008 +0000
 
-	* src/powerpc/darwin.S: Add unwind info.
-	* src/powerpc/darwin_closure.S: Likewise.
+    2008-02-26  Anthony Green  <green@redhat.com>
+                Thomas Heller  <theller@ctypes.org>
+    
+            * src/x86/ffi.c (ffi_closure_SYSV_inner): Change C++ comment to C
+            comment.
 
-2003-01-14  Andrew Haley  <aph@redhat.com>
+commit b13c84cf4668828ff8429ba4a2f94cd1eb574ae0
+Author: green <green>
+Date:   Tue Feb 26 17:38:15 2008 +0000
 
-	* src/x86/ffi64.c (ffi_prep_args): Check for void retval.
-	(ffi_prep_cif_machdep): Likewise.
-	* src/x86/unix64.S: Add unwind info.
+    2008-02-26  Anthony Green  <green@redhat.org>
+                Thomas Heller <theller@ctypes.org>
+    
+            * include/ffi.h.in: Change void (*)() to void (*)(void).
 
-2003-01-14  Andreas Jaeger  <aj@suse.de>
+commit 265289f679ffd24a88ae1aa2cef0e4aa14703cd8
+Author: green <green>
+Date:   Tue Feb 26 17:34:36 2008 +0000
 
-	* src/ffitest.c (main): Only use ffi_closures if those are
-	supported.
+    2008-02-26  Anthony Green  <green@spindazzle.org>
+    
+            * src/alpha/ffi.c: Change void (*)() to void (*)(void).
+            src/alpha/osf.S, src/arm/ffi.c, src/frv/ffi.c, src/ia64/ffi.c,
+            src/ia64/unix.S, src/java_raw_api.c, src/m32r/ffi.c,
+            src/mips/ffi.c, src/pa/ffi.c, src/pa/hpux32.S, src/pa/linux.S,
+            src/powerpc/ffi.c, src/powerpc/ffi_darwin.c, src/raw_api.c,
+            src/s390/ffi.c, src/sh/ffi.c, src/sh64/ffi.c, src/sparc/ffi.c,
+            src/x86/ffi.c, src/x86/unix64.S, src/x86/darwin64.S,>         src/x86/ffi64.c: Ditto.
 
-2003-01-13 Andreas Tobler <a.tobler@schweiz.ch>
+commit fb5036cd6d0f909918e90f7d2d9fd80d46682d5d
+Author: green <green>
+Date:   Sun Feb 24 17:25:25 2008 +0000
 
-	* libffi/src/ffitest.c
-	 add closure testcases
+    fix date
 
-2003-01-13 Kevin B. Hendricks <khendricks@ivey.uwo.ca>
+commit 40bec108e7d0181e6c9928aa7a33187bcc0f3d6f
+Author: green <green>
+Date:   Sun Feb 24 17:25:02 2008 +0000
 
-	* libffi/src/powerpc/ffi.c
-	 fix alignment bug for float (4 byte aligned iso 8 byte)
+    New release
 
-2003-01-09  Geoffrey Keating  <geoffk@apple.com>
+commit b922048fa82ea109a4af269ee47bbc2a586bbac2
+Author: green <green>
+Date:   Sun Feb 24 17:24:00 2008 +0000
 
-	* src/powerpc/ffi_darwin.c: Remove RCS version string.
-	* src/powerpc/darwin.S: Remove RCS version string.
+    2008-02-24  Anthony Green  <green@spindazzle.org>
+    
+            * configure.ac: Accept openbsd*, not just openbsd.
+            Bump version to 3.0.4.
+            * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
+            * libtool-version: Increment revision.
+            * README: Update for new release.
 
-2003-01-03  Jeff Sturm  <jsturm@one-point.com>
+commit affca4b92d06e5554784c7e9b233029ef83f7d8a
+Author: green <green>
+Date:   Fri Feb 22 21:53:29 2008 +0000
 
-	* include/ffi.h.in: Add closure defines for SPARC, SPARC64.
-	* src/ffitest.c (main): Use static storage for closure.
-	* src/sparc/ffi.c (ffi_prep_closure, ffi_closure_sparc_inner): New.
-	* src/sparc/v8.S (ffi_closure_v8): New.
-	* src/sparc/v9.S (ffi_closure_v9): New.
+    sync readme with web page.
 
-2002-11-10  Ranjit Mathew <rmathew@hotmail.com>
+commit 3e53d8752ea74859b4c64fbbf935e62a937c4d78
+Author: green <green>
+Date:   Fri Feb 22 21:52:38 2008 +0000
 
-	* include/ffi.h.in: Added FFI_STDCALL ffi_type
-	  enumeration for X86_WIN32.
-	* src/x86/win32.S: Added ffi_call_STDCALL function
-	  definition.
-	* src/x86/ffi.c (ffi_call/ffi_raw_call): Added
-	  switch cases for recognising FFI_STDCALL and
-	  calling ffi_call_STDCALL if target is X86_WIN32.
-	* src/ffitest.c (my_stdcall_strlen/stdcall_many):
-	  stdcall versions of the "my_strlen" and "many"
-	  test functions (for X86_WIN32).
-	  Added test cases to test stdcall invocation using
-	  these functions.
+    New release
 
-2002-12-02  Kaz Kojima  <kkojima@gcc.gnu.org>
+commit 4d92f6c8e78fe084be65f3e8b58b859901ba796d
+Author: green <green>
+Date:   Fri Feb 22 21:49:46 2008 +0000
 
-	* src/sh/sysv.S: Add DWARF2 unwind info.
+    2008-02-22  Anthony Green  <green@redhat.com>
+    
+            * configure.ac: Bump version to 3.0.3.
+            * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
+            * libtool-version: Increment revision.
+            * README: Update for new release.  Clean up test docs.
 
-2002-11-27  Ulrich Weigand  <uweigand@de.ibm.com>
+commit 0e185fa11a01f816824ba2687ed3715ab6219bef
+Author: green <green>
+Date:   Fri Feb 22 21:43:18 2008 +0000
 
-	* src/s390/sysv.S (.eh_frame section): Make section read-only.
+    Update configure script.
 
-2002-11-26  Jim Wilson  <wilson@redhat.com>
+commit f73986bd211cfbbaa593d1309504d0dc68626191
+Author: green <green>
+Date:   Fri Feb 22 21:40:53 2008 +0000
 
-	* src/types.c (FFI_TYPE_POINTER): Has size 8 on IA64.
+    2008-02-22  Bjoern Koenig  <bkoenig@alpha-tierchen.de>
+                Andreas Tobler  <a.tobler@schweiz.org>
+    
+            * configure.ac: Add amd64-*-freebsd* target.
+            * configure: Regenerate.
 
-2002-11-23  H.J. Lu <hjl@gnu.org>
+commit 0208f68fe5de30c33e7f70ebc281635917013f5a
+Author: green <green>
+Date:   Fri Feb 22 21:15:44 2008 +0000
 
-	* acinclude.m4: Add dummy AM_PROG_LIBTOOL.
-	Include ../config/accross.m4.
-	* aclocal.m4; Rebuild.
-	* configure: Likewise.
+    2008-02-22  Thomas Heller <theller@ctypes.org>
+    
+            * configure.ac: Add x86 OpenBSD support.
+            * configure: Rebuilt.
 
-2002-11-15  Ulrich Weigand  <uweigand@de.ibm.com>
+commit 01adb0e638a86cf0d5e668ed8e08be9b0cd2505f
+Author: green <green>
+Date:   Thu Feb 21 16:17:26 2008 +0000
 
-	* src/s390/sysv.S (.eh_frame section): Adapt to pcrel FDE encoding.
+    Fix README.
 
-2002-11-11  DJ Delorie  <dj@redhat.com>
+commit 1edd4563225981a14f7d4fb9919b1ed88e38082f
+Author: green <green>
+Date:   Thu Feb 21 13:39:01 2008 +0000
 
-	* configure.in: Look for common files in the right place.
+    3.0.2
 
-2002-10-08  Ulrich Weigand  <uweigand@de.ibm.com>
+commit c9b542800864e2204db6e83f3843a17813ba6165
+Author: green <green>
+Date:   Thu Feb 21 13:36:43 2008 +0000
 
-	* src/java_raw_api.c (ffi_java_raw_to_ptrarray): Interpret
-	raw data as _Jv_word values, not ffi_raw.
-	(ffi_java_ptrarray_to_raw): Likewise.
-	(ffi_java_rvalue_to_raw): New function.
-	(ffi_java_raw_call): Call it.
-	(ffi_java_raw_to_rvalue): New function.
-	(ffi_java_translate_args): Call it.
-	* src/ffitest.c (closure_test_fn): Interpret return value
-	as ffi_arg, not int.
-	* src/s390/ffi.c (ffi_prep_cif_machdep): Add missing
-	FFI_TYPE_POINTER case.
-	(ffi_closure_helper_SYSV): Likewise.  Also, assume return
-	values extended to word size.
+    add missing file
 
-2002-10-02  Andreas Jaeger  <aj@suse.de>
+commit d5fa5633d5c8d3c212a2267cfa38fba4091baa2c
+Author: green <green>
+Date:   Thu Feb 21 13:36:19 2008 +0000
 
-	* src/x86/ffi64.c (ffi_prep_cif_machdep): Remove debug output.
+    2008-02-21  Anthony Green  <green@redhat.com>
+    
+            * configure.ac: Bump version to 3.0.2.
+            * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
+            * libtool-version: Increment revision.
+            * README: Update for new release.
+    
+    2008-02-21  Björn König <bkoenig@alpha-tierchen.de>
+    
+            * src/x86/freebsd.S: New file.
+            * configure.ac: Add x86 FreeBSD support.
+            * Makefile.am: Ditto.
 
-2002-10-01  Bo Thorsen  <bo@smetana.suse.de>
+commit ac35bfc6fcadd8880c1efce36724820f9074b318
+Author: green <green>
+Date:   Sat Feb 16 01:03:56 2008 +0000
 
-	* include/ffi.h.in: Fix i386 win32 compilation.
+    Updated
 
-2002-09-30  Ulrich Weigand  <uweigand@de.ibm.com>
+commit f7942975fee7b0162647dd79e2652615b737e98e
+Author: green <green>
+Date:   Sat Feb 16 01:02:00 2008 +0000
 
-	* configure.in: Add s390x-*-linux-* target.
-	* configure: Regenerate.
-	* include/ffi.h.in: Define S390X for s390x targets.
-	(FFI_CLOSURES): Define for s390/s390x.
-	(FFI_TRAMPOLINE_SIZE): Likewise.
-	(FFI_NATIVE_RAW_API): Likewise.
-	* src/prep_cif.c (ffi_prep_cif): Do not compute stack space for s390.
-	* src/types.c (FFI_TYPE_POINTER): Use 8-byte pointers on s390x.
-	* src/s390/ffi.c: Major rework of existing code.  Add support for
-	s390x targets.  Add closure support.
-	* src/s390/sysv.S: Likewise.
+    2008-02-15  Anthony Green  <green@redhat.com>
+    
+            * configure.ac: Bump version to 3.0.1.
+            * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
+            * libtool-version: Increment revision.
+            * README: Update for new release.
+    
+    2008-02-15  David Daney  <ddaney@avtrex.com>
+    
+            * src/mips/ffi.c: Remove extra '>' from include directive.
+            (ffi_prep_closure_loc): Use clear_location instead of tramp.
 
-2002-09-29  Richard Earnshaw  <rearnsha@arm.com>
+commit 59aa6bb1bfc86a610ac1a8b123443efd75854dd1
+Author: green <green>
+Date:   Fri Feb 15 20:52:26 2008 +0000
 
-	* src/arm/sysv.S: Fix typo.
+    Add more platforms.
 
-2002-09-28  Richard Earnshaw  <rearnsha@arm.com>
+commit 45a45ab99074448be0ae1a8d2ade50d28b60f8de
+Author: green <green>
+Date:   Fri Feb 15 19:16:36 2008 +0000
 
-	* src/arm/sysv.S: If we don't have machine/asm.h and the pre-processor
-	has defined __USER_LABEL_PREFIX__, then use it in CNAME.
-	(ffi_call_SYSV): Handle soft-float.
+    3.0 notes
 
-2002-09-27  Bo Thorsen  <bo@suse.de>
+commit 4db74cbea888c9f1251b85baf00d99b83d3b994d
+Author: green <green>
+Date:   Fri Feb 15 19:10:26 2008 +0000
 
-	* include/ffi.h.in: Fix multilib x86-64 support.
+    Update
 
-2002-09-22  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+commit c3e1101ffabf44d8a2ee46e03ba9ab582050a825
+Author: green <green>
+Date:   Fri Feb 15 18:43:40 2008 +0000
 
-	* Makefile.am (all-multi): Fix multilib parallel build.
+    2008-02-15  Anthony Green  <green@redhat.com>
+    
+            * configure.ac: Bump version to 3.0.0,
+            * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
+    
+    2008-02-15  David Daney  <ddaney@avtrex.com>
+    
+            * src/mips/ffi.c (USE__BUILTIN___CLEAR_CACHE):
+            Define (conditionally), and use it to include cachectl.h.
+            (ffi_prep_closure_loc): Fix cache flushing.
+            * src/mips/ffitarget.h (_ABIN32, _ABI64, _ABIO32): Define.
 
-2002-07-19  Kaz Kojima  <kkojima@gcc.gnu.org>
+commit 7e0cc12e9233ad285db41ce8dbdda61ed2a7fb06
+Author: green <green>
+Date:   Fri Feb 15 15:51:03 2008 +0000
 
-	* configure.in (sh[34]*-*-linux*): Add brackets.
-	* configure: Regenerate.
+    New release
 
-2002-07-18  Kaz Kojima  <kkojima@gcc.gnu.org>
+commit 2d7dc885ec40d53866f29984d595511942c8b686
+Author: green <green>
+Date:   Fri Feb 15 15:30:26 2008 +0000
 
-	* Makefile.am: Add SH support.
-	* Makefile.in: Regenerate.
-	* configure.in (sh-*-linux*, sh[34]*-*-linux*): Add target.
-	* configure: Regenerate.
-	* include/ffi.h.in: Add SH support.
-	* src/sh/ffi.c: New file.
-	* src/sh/sysv.S: New file.
-	* src/types.c: Add SH support.
+            * man/ffi_call.3, man/ffi_prep_cif.3, man/ffi.3:
+            Update dates and remove all references to ffi_prep_closure.
+            * configure.ac: Bump version to 2.99.9.
+            * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
 
-2002-07-16  Bo Thorsen  <bo@suse.de>
+commit a0525f03eeaaed33b1eac80e0c016455cee3615d
+Author: green <green>
+Date:   Fri Feb 15 15:14:30 2008 +0000
 
-	* src/x86/ffi64.c: New file that adds x86-64 support.
-	* src/x86/unix64.S: New file that handles argument setup for
-	x86-64.
-	* src/x86/sysv.S: Don't use this on x86-64.
-	* src/x86/ffi.c: Don't use this on x86-64.
-	Remove unused vars.
-	* src/prep_cif.c (ffi_prep_cif): Don't do stack size calculation
-	for x86-64.
-	* src/ffitest.c (struct6): New test that tests a special case in
-	the x86-64 ABI.
-	(struct7): Likewise.
-	(struct8): Likewise.
-	(struct9): Likewise.
-	(closure_test_fn): Silence warning about this when it's not used.
-	(main): Add the new tests.
-	(main): Fix a couple of wrong casts and silence some compiler warnings.
-	* include/ffi.h.in: Add x86-64 ABI definition.
-	* fficonfig.h.in: Regenerate.
-	* Makefile.am: Add x86-64 support.
-	* configure.in: Likewise.
-	* Makefile.in: Regenerate.
-	* configure: Likewise.
+    New release.
 
-2002-06-24  Bo Thorsen  <bo@suse.de>
+commit 2b30dfb3146ee26ad956d00ee05eb835ca1a95b4
+Author: green <green>
+Date:   Fri Feb 15 15:12:43 2008 +0000
 
-	* src/types.c: Merge settings for similar architectures.
-	Add x86-64 sizes and alignments.
+            * man/ffi_prep_closure.3: Delete.
+            * man/Makefile.am (EXTRA_DIST): Remove ffi_prep_closure.3.
+            (man_MANS): Ditto.
+            * man/Makefile.in: Rebuilt.
+            * configure.ac: Bump version to 2.99.8.
+            * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
 
-2002-06-23  Bo Thorsen  <bo@suse.de>
+commit bf41e64840ebcb6cc31a6f028253c1fde82705d8
+Author: green <green>
+Date:   Fri Feb 15 01:56:50 2008 +0000
 
-	* src/arm/ffi.c (ffi_prep_args): Remove unused vars.
-	* src/sparc/ffi.c (ffi_prep_args_v8): Likewise.
-	* src/mips/ffi.c (ffi_prep_args): Likewise.
-	* src/m68k/ffi.c (ffi_prep_args): Likewise.
+    Update.
 
-2002-07-18  H.J. Lu  (hjl@gnu.org)
+commit 4d39ddee677bbb61d621893b91e11eac5e7c4af7
+Author: green <green>
+Date:   Fri Feb 15 01:24:06 2008 +0000
 
-	* Makefile.am (TARGET_SRC_MIPS_LINUX): New.
-	(libffi_la_SOURCES): Support MIPS_LINUX.
-	(libffi_convenience_la_SOURCES): Likewise.
-	* Makefile.in: Regenerated.
+    * configure.ac: Bump version to 2.99.7.
+            * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
+            * include/ffi.h.in LICENSE src/debug.c src/closures.c
+              src/ffitest.c src/s390/sysv.S src/s390/ffitarget.h
+              src/types.c src/m68k/ffitarget.h src/raw_api.c src/frv/ffi.c
+              src/frv/ffitarget.h src/sh/ffi.c src/sh/sysv.S
+              src/sh/ffitarget.h src/powerpc/ffitarget.h src/pa/ffi.c
+              src/pa/ffitarget.h src/pa/linux.S src/java_raw_api.c
+              src/cris/ffitarget.h src/x86/ffi.c src/x86/sysv.S
+              src/x86/unix64.S src/x86/win32.S src/x86/ffitarget.h
+              src/x86/ffi64.c src/x86/darwin.S src/ia64/ffi.c
+              src/ia64/ffitarget.h src/ia64/ia64_flags.h src/ia64/unix.S
+              src/sparc/ffi.c src/sparc/v9.S src/sparc/ffitarget.h
+              src/sparc/v8.S src/alpha/ffi.c src/alpha/ffitarget.h
+              src/alpha/osf.S src/sh64/ffi.c src/sh64/sysv.S
+              src/sh64/ffitarget.h src/mips/ffi.c src/mips/ffitarget.h
+              src/mips/n32.S src/mips/o32.S src/arm/ffi.c src/arm/sysv.S
+              src/arm/ffitarget.h src/prep_cif.c: Update license text.
 
-	* configure.in (mips64*-*): Skip.
-	(mips*-*-linux*): New.
-	* configure: Regenerated.
+commit d58b032b41a12bd3d72148da6822ab59dd698ff9
+Author: green <green>
+Date:   Fri Feb 15 00:59:25 2008 +0000
 
-	* src/mips/ffi.c: Include <sgidefs.h>.
+    New release
 
-2002-06-06  Ulrich Weigand  <uweigand@de.ibm.com>
+commit 91e5478df6d5ac63efbb10f025807b4606afab56
+Author: green <green>
+Date:   Fri Feb 15 00:50:30 2008 +0000
 
-	* src/s390/sysv.S: Save/restore %r6.  Add DWARF-2 unwind info.
+    Update supported platforms.  Bump version.
 
-2002-05-27  Roger Sayle  <roger@eyesopen.com>
+commit bd0768f877c8f7fd0d36af2191b203d4d057b1ce
+Author: green <green>
+Date:   Fri Feb 15 00:45:33 2008 +0000
 
-	* src/x86/ffi.c (ffi_prep_args): Remove reference to avn.
+    * configure.ac: Bump version to 2.99.5.
+            * configure: Rebuilt.
+            * Makefile.am (EXTRA_DIST): Add darwin64.S
+            * Makefile.in: Rebuilt.
+            * testsuite/lib/libffi-dg.exp: Remove libstdc++ bits from GCC tree.
+            * LICENSE: Update WARRANTY.
 
-2002-05-27  Bo Thorsen  <bo@suse.de>
+commit 49d345f767bd2cfee951bceaab6a1a07986cf293
+Author: green <green>
+Date:   Thu Feb 14 23:43:27 2008 +0000
 
-	* src/x86/ffi.c (ffi_prep_args): Remove unused variable and
-	fix formatting.
+    update license reference
 
-2002-05-13  Andreas Tobler  <a.tobler@schweiz.ch>
+commit 12ac48fc79b515db7c9accd9fcaa87b0dcefccdb
+Author: green <green>
+Date:   Thu Feb 14 23:42:08 2008 +0000
 
-	* src/powerpc/ffi_darwin.c (ffi_prep_closure): Declare fd at
-	beginning of function (for older apple cc).
+    Update WARRANTY
 
-2002-05-08  Alexandre Oliva  <aoliva@redhat.com>
+commit 6b91c41da87e78552f2990dfc504a0a3349f340b
+Author: green <green>
+Date:   Thu Feb 14 23:38:27 2008 +0000
 
-	* configure.in (ORIGINAL_LD_FOR_MULTILIBS): Preserve LD at
-	script entry, and set LD to it when configuring multilibs.
-	* configure: Rebuilt.
+    fix tarball reference
 
-2002-05-05  Jason Thorpe  <thorpej@wasabisystems.com>
+commit 2b59579e3533334bee4788e076b4e520c2ab518c
+Author: green <green>
+Date:   Thu Feb 14 23:35:58 2008 +0000
 
-	* configure.in (sparc64-*-netbsd*): Add target.
-	(sparc-*-netbsdelf*): Likewise.
-	* configure: Regenerate.
+    First update in 5 years!
 
-2002-04-28  David S. Miller  <davem@redhat.com>
+commit 6cbdf3f3a3777a93382a2d508ddef1c353ff0955
+Author: green <green>
+Date:   Thu Feb 14 22:44:06 2008 +0000
 
-	* configure.in, configure: Fix SPARC test in previous change.
+    Fix .pc file bug and bump version
 
-2002-04-29  Gerhard Tonn  <GerhardTonn@swol.de>
+commit 1d1dc81104b209df3cfef0840735c59efae2f655
+Author: green <green>
+Date:   Thu Feb 14 22:03:37 2008 +0000
 
-	* Makefile.am: Add Linux for S/390 support.
-	* Makefile.in: Regenerate.
-	* configure.in: Add Linux for S/390 support.
-	* configure: Regenerate.
-	* include/ffi.h.in: Add Linux for S/390 support.
-	* src/s390/ffi.c: New file from libffi CVS tree.
-	* src/s390/sysv.S: New file from libffi CVS tree.
+    Add man files and info file. Update README.  Tag as 2.99.3.
 
-2002-04-28  Jakub Jelinek  <jakub@redhat.com>
+commit f045a2367f793fa8b01534cf2e25bcc46afc8fa1
+Author: tromey <tromey>
+Date:   Thu Feb 14 20:46:57 2008 +0000
 
-	* configure.in (HAVE_AS_SPARC_UA_PCREL): Check for working
-	%r_disp32().
-	* src/sparc/v8.S: Use it.
-	* src/sparc/v9.S: Likewise.
-	* fficonfig.h.in: Rebuilt.
-	* configure: Rebuilt.
+    Move entry from ChangeLog to ChangeLog.libffi
 
-2002-04-08  Hans Boehm  <Hans_Boehm@hp.com>
+commit 6257f07d1a9efd27fa83639cfba281f5d3188731
+Author: tromey <tromey>
+Date:   Thu Feb 14 20:33:17 2008 +0000
 
-	* src/java_raw_api.c (ffi_java_raw_size): Handle FFI_TYPE_DOUBLE
-	correctly.
-	* src/ia64/unix.S: Add unwind information. Fix comments.
-	Save sp in a way that's compatible with unwind info.
-	(ffi_call_unix): Correctly restore sp in all cases.
-	* src/ia64/ffi.c: Add, fix comments.
+    	* aclocal.m4, Makefile.in, configure, fficonfig.h.in: Rebuilt.
+    	* mdate-sh, texinfo.tex: New files.
+    	* Makefile.am (info_TEXINFOS): New variable.
+    	* doc/libffi.texi: New file.
+    	* doc/version.texi: Likewise.
 
-2002-04-08  Jakub Jelinek  <jakub@redhat.com>
+commit 4232af563c5509c3760a33e3684a2b958be755e1
+Author: green <green>
+Date:   Thu Feb 14 16:19:21 2008 +0000
 
-	* src/sparc/v8.S: Make .eh_frame dependent on target word size.
+            * Makefile.am (AM_CFLAGS): Don't compile with -D.
+            (lib_LTLIBRARIES): Define.
+            (toolexeclib_LIBRARIES): Undefine.
+            * Makefile.in: Rebuilt.
+            * configure.ac: Reset version to 2.99.1.
+            * configure.in: Rebuilt.
 
-2002-04-06  Jason Thorpe  <thorpej@wasabisystems.com>
+commit 961543615c31f092b578a4b4cda914db64f9d0fa
+Author: green <green>
+Date:   Thu Feb 14 15:57:40 2008 +0000
 
-	* configure.in (alpha*-*-netbsd*): Add target.
-	* configure: Regenerate.
+    Fix typo.
 
-2002-04-04  Jeff Sturm  <jsturm@one-point.com>
+commit aeb0abab87222f637fbf352d4effd3b76b52ed26
+Author: green <green>
+Date:   Thu Feb 14 15:54:27 2008 +0000
 
-	* src/sparc/v8.S: Add unwind info.
-	* src/sparc/v9.S: Likewise.
+          * libffi.pc.in: Usse @PACKAGE_NAME@ and @PACKAGE_VERSION@.
+            * configure.ac: Reset version to 2.99.1.
+            * configure.in: Rebuilt.
+            * Makefile.am (EXTRA_DIST): Add ChangeLog.libffi.
+            * Makefile.in: Rebuilt.
+            * LICENSE: Update copyright notice.
 
-2002-03-30  Krister Walfridsson  <cato@df.lth.se>
+commit 77fe243556433eae119d8bd7469bfccdd5bd8a1a
+Author: green <green>
+Date:   Thu Feb 14 15:37:00 2008 +0000
 
-	* configure.in: Enable i*86-*-netbsdelf*.
-	* configure: Rebuilt.
+    Fix make dist again
 
-2002-03-29  David Billinghurst <David.Billinghurst@riotinto.com>
+commit d4970cf4529459bf0f0e43c602cac396786c6802
+Author: green <green>
+Date:   Thu Feb 14 15:18:56 2008 +0000
 
-	PR other/2620
-	* src/mips/n32.s: Delete
-	* src/mips/o32.s: Delete
+    Fix make dist
 
-2002-03-21  Loren J. Rittle  <ljrittle@acm.org>
+commit f0b1462f2d3024922ad71421bd5c4311fcb16da5
+Author: green <green>
+Date:   Thu Feb 14 15:01:41 2008 +0000
 
-	* configure.in: Enable alpha*-*-freebsd*.
-	* configure: Rebuilt.
+    Use pkgconfig.  Increment libtool CURRENT version.
 
-2002-03-17  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
+commit 27e52f33baa069012a5adb2a3807f9ca1f2165ab
+Author: green <green>
+Date:   Sun Feb 3 13:59:48 2008 +0000
 
-	* Makefile.am: libfficonvenience -> libffi_convenience.
-	* Makefile.in: Rebuilt.
+    Fix header installs when using DESTDIR.
 
-	* Makefile.am: Define ffitest_OBJECTS.
-	* Makefile.in: Rebuilt.
+commit fadab28eb6e33fb6dcdd7b9323e147142216d548
+Author: twall <twall>
+Date:   Sun Feb 3 12:32:22 2008 +0000
 
-2002-03-07  Andreas Tobler  <toa@pop.agri.ch>
-	    David Edelsohn  <edelsohn@gnu.org>
+    update changelog
 
-	* Makefile.am (EXTRA_DIST): Add Darwin and AIX closure files.
-	(TARGET_SRC_POWERPC_AIX): Add aix_closure.S.
-	(TARGET_SRC_POWERPC_DARWIN): Add darwin_closure.S.
-	* Makefile.in: Regenerate.
-	* include/ffi.h.in: Add AIX and Darwin closure definitions.
-	* src/powerpc/ffi_darwin.c (ffi_prep_closure): New function.
-	(flush_icache, flush_range): New functions.
-	(ffi_closure_helper_DARWIN): New function.
-	* src/powerpc/aix_closure.S: New file.
-	* src/powerpc/darwin_closure.S: New file.
+commit b5e44c8dfa92c87b99762c303cf5574a16db8f27
+Author: twall <twall>
+Date:   Sun Feb 3 01:12:32 2008 +0000
 
-2002-02-24  Jeff Sturm  <jsturm@one-point.com>
+    offset from code base address, not data base address
 
-	* include/ffi.h.in: Add typedef for ffi_arg.
-	* src/ffitest.c (main): Declare rint with ffi_arg.
+commit f359848d1a995c0e44566d815f218729dc996e22
+Author: green <green>
+Date:   Fri Feb 1 21:29:43 2008 +0000
 
-2002-02-21  Andreas Tobler  <toa@pop.agri.ch>
+    Fix header installs.
 
-	* src/powerpc/ffi_darwin.c (ffi_prep_args): Skip appropriate
-	number of GPRs for floating-point arguments.
+commit c30df49e157c7bfc8e19e3f8a72b9464fe225e54
+Author: green <green>
+Date:   Fri Feb 1 21:13:55 2008 +0000
 
-2002-01-31  Anthony Green  <green@redhat.com>
+    Revert my broken changes to twall's patch.
 
-	* configure: Rebuilt.
-	* configure.in: Replace CHECK_SIZEOF and endian tests with
-	cross-compiler friendly macros.
-	* aclocal.m4 (AC_COMPILE_CHECK_SIZEOF, AC_C_BIGENDIAN_CROSS): New
-	macros.
+commit 675561bb9aa0732c76698df10dd3007b5d0ec759
+Author: green <green>
+Date:   Thu Jan 31 13:44:25 2008 +0000
 
-2002-01-18  David Edelsohn  <edelsohn@gnu.org>
+    Fix make dist .
 
-	* src/powerpc/darwin.S (_ffi_call_AIX): New.
-	* src/powerpc/aix.S (ffi_call_DARWIN): New.
+commit abc0bbf3813dc43e23d4c23e6fe794dbf287639b
+Author: green <green>
+Date:   Thu Jan 31 11:58:57 2008 +0000
 
-2002-01-17  David Edelsohn  <edelsohn@gnu.org>
+    Add Tim Wall's x86 windows patch.
 
-	* Makefile.am (EXTRA_DIST): Add Darwin and AIX files.
-	(TARGET_SRC_POWERPC_AIX): New.
-	(POWERPC_AIX): New stanza.
-	* Makefile.in: Regenerate.
-	* configure.in: Add AIX case.
-	* configure: Regenerate.
-	* include/ffi.h.in (ffi_abi): Add FFI_AIX.
-	* src/powerpc/ffi_darwin.c (ffi_status): Use "long" to scale frame
-	size.  Fix "long double" support.
-	(ffi_call): Add FFI_AIX case.
-	* src/powerpc/aix.S: New.
+commit e332366d15a31198735b593ec8f7fc0558d783b8
+Author: green <green>
+Date:   Wed Jan 30 13:21:02 2008 +0000
 
-2001-10-09  John Hornkvist  <john@toastedmarshmallow.com>
+    Add HJ's -fomit-frame-pointer struct return fix
 
-	Implement Darwin PowerPC ABI.
-	* configure.in: Handle powerpc-*-darwin*.
-	* Makefile.am: Set source files for POWERPC_DARWIN.
-	* configure: Rebuilt.
-	* Makefile.in: Rebuilt.
-	* include/ffi.h.in: Define FFI_DARWIN and FFI_DEFAULT_ABI for
-	POWERPC_DARWIN.
-	* src/powerpc/darwin.S: New file.
-	* src/powerpc/ffi_darwin.c: New file.
+commit d4204240392af5b7750a08671b08e9c22dff5e93
+Author: green <green>
+Date:   Wed Jan 30 12:42:34 2008 +0000
 
-2001-10-07  Joseph S. Myers  <jsm28@cam.ac.uk>
+    Clean up for new automake.
 
-	* src/x86/ffi.c: Fix spelling error of "separate" as "seperate".
+commit f4932dd020df574637c9fb3fc1bb18e5a8f304cc
+Author: green <green>
+Date:   Wed Jan 30 12:40:25 2008 +0000
 
-2001-07-16  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
+    Fixes to run testsuite
 
-	* src/x86/sysv.S: Avoid gas-only .balign directive.
-	Use C style comments.
+commit 085520ddc8db6a916bfc416b871fcb2d00074d40
+Author: green <green>
+Date:   Tue Jan 29 15:16:43 2008 +0000
 
-2001-07-16  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
+    New files from gcc tree.
 
-	* src/alpha/ffi.c (ffi_prep_closure): Avoid gas-only mnemonic.
-	Fixes PR bootstrap/3563.
+commit 77175b3f7234e4875a4ef554ed1fe9fdc4133794
+Author: green <green>
+Date:   Tue Jan 29 15:15:20 2008 +0000
 
-2001-06-26  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
+    Latest gcc svn sources
 
-	* src/alpha/osf.S (ffi_closure_osf): Use .rdata for ECOFF.
+commit 2544e45a0b2b634053df02da3a2ed9680eeed2a1
+Author: green <green>
+Date:   Tue Jan 29 14:28:13 2008 +0000
 
-2001-06-25  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
+    Install ffitarget.h in $prefix/include.
 
-	* configure.in: Recognize sparc*-sun-* host.
-	* configure: Regenerate.
+commit 6002211b1cc4daeb587d054b4f83968bda2c981e
+Author: green <green>
+Date:   Tue Jan 29 12:30:10 2008 +0000
 
-2001-06-06  Andrew Haley  <aph@redhat.com>
+    Add new files.
 
-	* src/alpha/osf.S (__FRAME_BEGIN__): Conditionalize for ELF.
+commit ccabd2b16be883cd03e5f0cd88ccfdd6ca39239d
+Author: green <green>
+Date:   Tue Jan 29 12:28:15 2008 +0000
 
-2001-06-03  Andrew Haley  <aph@redhat.com>
+    Merge from gcc
 
-	* src/alpha/osf.S: Add unwind info.
-	* src/powerpc/sysv.S: Add unwind info.
-	* src/powerpc/ppc_closure.S: Likewise.
+commit e680ecfbfca1da8d1823e48bc89b8375e66e128b
+Author: tromey <tromey>
+Date:   Sun Dec 24 23:12:15 2006 +0000
 
-2000-05-31  Jeff Sturm  <jsturm@one-point.com>
+    Pulled in libffi from gcc trunk.
+    Fixed build and install for standalone use.
 
-	* configure.in: Fix AC_ARG_ENABLE usage.
-	* configure: Rebuilt.
+commit e7ba08965942ce872fdbc69f70f9848cc3d0bad6
+Author: root <root>
+Date:   Sun Jun 4 23:22:24 2006 +0000
 
-2001-05-06  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
+    sourcware.org
 
-	* configure.in: Remove warning about beta code.
-	* configure: Rebuilt.
+commit 0cd4aa24e21aaa964dfbdebc25ec5c8188049375
+Author: root <root>
+Date:   Sun May 30 01:51:57 2004 +0000
 
-2001-04-25  Hans Boehm <Hans_Boehm@hp.com>
+    Add LockDir
 
-	* src/ia64/unix.S: Restore stack pointer when returning from
-	ffi_closure_UNIX.
-	* src/ia64/ffi.c: Fix typo in comment.
+commit 5826120fbd940d26cca76ed2522187505581e1ed
+Author: green <green>
+Date:   Tue Nov 4 06:09:08 2003 +0000
 
-2001-04-18  Jim Wilson  <wilson@redhat.com>
+    Add link to Gianni's web site.
 
-	* src/ia64/unix.S: Delete unnecessary increment and decrement of loc2
-	to eliminate RAW DV.
+commit 220aa4b27db42d7ffaac5056000d5179f00d5ea3
+Author: jsm <jsm>
+Date:   Tue Jan 21 08:07:42 2003 +0000
 
-2001-04-12  Bryce McKinlay  <bryce@albatross.co.nz>
+    Newer, better, increased from before!  (list of acceptable anon usernames)
 
-	* Makefile.am: Make a libtool convenience library.
-	* Makefile.in: Rebuilt.
+commit 1c3adc892cc1403dc4d3d7003a2385899836612e
+Author: green <green>
+Date:   Fri Dec 6 01:28:03 2002 +0000
 
-2001-03-29  Bryce McKinlay  <bryce@albatross.co.nz>
+    Fixed Cygnus references.
 
-	* configure.in: Use different syntax for subdirectory creation.
-	* configure: Rebuilt.
+commit 4af66bb62fab9a8e318af3bf01e5486596a0c8d4
+Author: green <green>
+Date:   Sun Oct 21 19:18:42 2001 +0000
 
-2001-03-27  Jon Beniston  <jon@beniston.com>
+    Testsuite fixes.
 
-	* configure.in: Added X86_WIN32 target (Win32, CygWin, MingW).
-	* configure: Rebuilt.
-	* Makefile.am: Added X86_WIN32 target support.
-	* Makefile.in: Rebuilt.
+commit 5435965f9015ce40584c98d3816c3d05e7de1d21
+Author: green <green>
+Date:   Mon Apr 23 00:32:03 2001 +0000
 
-	* include/ffi.h.in: Added X86_WIN32 target support.
+            * include/ffi_common.h: Delete, after moving contents to...
+            * include/ffi_private.h: Subsume contents of ffi_common.h.
+            * include/Makefile.am (noinst_HEADERS): Remove ffi_common.h.
+            * include/Makefile.in: Rebuilt.
+            * arm/ffi.c, m68k/ffi.c, mips/ffi.c, powerpc/ffi.c, s390/ffi.c,
+            ia64/ffi.c: Include ffi_private.h, not ffi_common.h.
+            * alpha/ffi.c, sparc/ffi.c, x86/ffi.c: Don't include ffi_common.h.
+            * types.c, raw_api.c, java_raw_api.c, prep_cif.c: Don't include
+            ffi_common.h.
+            * debug.c: Include ffi_private.h instead of ffi_common.h.
+    
+            * mips/ffi.c (calc_n32_struct_flags): Make static.
+            (FIX_ARGP): Remove call to debugging routine ffi_stop_here.
+    
+            * mips/n32.S: Include ffi_private.h.
+            * mips/o32.S: Include ffi_private.h.
 
-	* src/ffitest.c: Doesn't run structure tests for X86_WIN32 targets.
-	* src/types.c: Added X86_WIN32 target support.
+commit 6fdb7de0fe3b7385e1fd78812ae69d9b3069d994
+Author: green <green>
+Date:   Sun Apr 22 19:38:34 2001 +0000
 
-	* src/x86/win32.S: New file. Based on sysv.S, but with EH
-	stuff removed and made to work with CygWin's gas.
+            * README: Update some comments.
+    
+            * Makefile.am (SUBDIRS): Add include so ffi.h gets installed.
+            * Makefile.in: Rebuilt.
+    
+            * include/ffi.h: Change ALPHA to __alpha__ and SPARC to __sparc__.
+            * types.c: Ditto.
+            * prep_cif.c (ffi_prep_cif): Ditto.
+    
+            * alpha/ffi.c, alpha/osf.S, sparc/ffi.c, sparc/v8.S, sparc/v9.S:
+            Include ffi_private.h.
+    
+            * include/ffi_private.h (FFI_TYPE_LAST): Define.
 
-2001-03-26  Bryce McKinlay  <bryce@albatross.co.nz>
+commit bc7144b01b9707ef35f1a2e3e6996e005e82953a
+Author: green <green>
+Date:   Sun Apr 22 18:28:36 2001 +0000
 
-	* configure.in: Make target subdirectory in build dir.
-	* Makefile.am: Override suffix based rules to specify correct output
-	subdirectory.
-	* Makefile.in: Rebuilt.
-	* configure: Rebuilt.
+    Moved files from old home
 
-2001-03-23  Kevin B Hendricks  <khendricks@ivey.uwo.ca>
+commit e57279831e20368c1aa1d2b35462b8629be73959
+Author: green <green>
+Date:   Sun Apr 22 18:23:47 2001 +0000
 
-	* src/powerpc/ppc_closure.S: New file.
-	* src/powerpc/ffi.c (ffi_prep_args): Fixed ABI compatibility bug
-	involving long long and register pairs.
-	(ffi_prep_closure): New function.
-	(flush_icache): Likewise.
-	(ffi_closure_helper_SYSV): Likewise.
-	* include/ffi.h.in (FFI_CLOSURES): Define on PPC.
-	(FFI_TRAMPOLINE_SIZE): Likewise.
-	(FFI_NATIVE_RAW_API): Likewise.
-	* Makefile.in: Rebuilt.
-	* Makefile.am (EXTRA_DIST): Added src/powerpc/ppc_closure.S.
-	(TARGET_SRC_POWERPC): Likewise.
+    These are dead.
 
-2001-03-19  Tom Tromey  <tromey@redhat.com>
+commit 7247436b5fe71767b29dc02b4da0fe18b08082e6
+Author: green <green>
+Date:   Sun Apr 22 18:22:43 2001 +0000
 
-	* Makefile.in: Rebuilt.
-	* Makefile.am (ffitest_LDFLAGS): New macro.
+    All these files live somewhere else now.
 
-2001-03-02  Nick Clifton  <nickc@redhat.com>
+commit a8b0d40ff908e275028f676870c31d0d70274a98
+Author: green <green>
+Date:   Sun Apr 22 18:17:14 2001 +0000
 
-	* include/ffi.h.in: Remove RCS ident string.
-	* include/ffi_mips.h: Remove RCS ident string.
-	* src/debug.c: Remove RCS ident string.
-	* src/ffitest.c: Remove RCS ident string.
-	* src/prep_cif.c: Remove RCS ident string.
-	* src/types.c: Remove RCS ident string.
-	* src/alpha/ffi.c: Remove RCS ident string.
-	* src/alpha/osf.S: Remove RCS ident string.
-	* src/arm/ffi.c: Remove RCS ident string.
-	* src/arm/sysv.S: Remove RCS ident string.
-	* src/mips/ffi.c: Remove RCS ident string.
-	* src/mips/n32.S: Remove RCS ident string.
-	* src/mips/o32.S: Remove RCS ident string.
-	* src/sparc/ffi.c: Remove RCS ident string.
-	* src/sparc/v8.S: Remove RCS ident string.
-	* src/sparc/v9.S: Remove RCS ident string.
-	* src/x86/ffi.c: Remove RCS ident string.
-	* src/x86/sysv.S: Remove RCS ident string.
+    Many changes.  Not quite there yet.
 
-2001-02-08  Joseph S. Myers  <jsm28@cam.ac.uk>
+commit f893d2273355710a290a26faebf5f12c3a34d0e3
+Author: green <green>
+Date:   Sun Apr 22 18:13:22 2001 +0000
 
-	* include/ffi.h.in: Change sourceware.cygnus.com references to
-	gcc.gnu.org.
+    Moved m68k files
 
-2000-12-09  Richard Henderson  <rth@redhat.com>
+commit 688ddfeced89cbb9d37b53005e1f7f2b9c78a8d7
+Author: green <green>
+Date:   Sun Apr 22 18:12:33 2001 +0000
 
-	* src/alpha/ffi.c (ffi_call): Simplify struct return test.
-	(ffi_closure_osf_inner): Index rather than increment avalue
-	and arg_types.  Give ffi_closure_osf the raw return value type.
-	* src/alpha/osf.S (ffi_closure_osf): Handle return value type
-	promotion.
+    New, target indepentent, header
 
-2000-12-07  Richard Henderson  <rth@redhat.com>
+commit f9e40776d488d5ecf43b3ae21444a1a2f6eca528
+Author: green <green>
+Date:   Sun Apr 22 18:11:57 2001 +0000
 
-	* src/raw_api.c (ffi_translate_args): Fix typo.
-	(ffi_prep_closure): Likewise.
+    Many changes.
 
-	* include/ffi.h.in [ALPHA]: Define FFI_CLOSURES and
-	FFI_TRAMPOLINE_SIZE.
-	* src/alpha/ffi.c (ffi_prep_cif_machdep): Adjust minimal
-	cif->bytes for new ffi_call_osf implementation.
-	(ffi_prep_args): Absorb into ...
-	(ffi_call): ... here.  Do all stack allocation here and
-	avoid a callback function.
-	(ffi_prep_closure, ffi_closure_osf_inner): New.
-	* src/alpha/osf.S (ffi_call_osf): Reimplement with no callback.
-	(ffi_closure_osf): New.
+commit 8c1d2eb47f6bc314c431b75c85c107e8e43c4a76
+Author: green <green>
+Date:   Sun Apr 22 18:10:47 2001 +0000
 
-2000-09-10  Alexandre Oliva  <aoliva@redhat.com>
+    Many changes
 
-	* config.guess, config.sub, install-sh: Removed.
-	* ltconfig, ltmain.sh, missing, mkinstalldirs: Likewise.
-	* Makefile.in: Rebuilt.
+commit 1359dfc6582680a158b3caa3efb7a368da4aa12d
+Author: green <green>
+Date:   Sun Apr 22 18:10:20 2001 +0000
 
-	* acinclude.m4: Include libtool macros from the top level.
-	* aclocal.m4, configure: Rebuilt.
+    Moved ia64 files
 
-2000-08-22  Alexandre Oliva  <aoliva@redhat.com>
+commit 6e2de5eee316a4579869aff50c7c5f6f478582d8
+Author: green <green>
+Date:   Sun Apr 22 18:08:11 2001 +0000
 
-	* configure.in [i*86-*-freebsd*] (TARGET, TARGETDIR): Set.
-	* configure: Rebuilt.
+    Moved arm files
 
-2000-05-11  Scott Bambrough  <scottb@netwinder.org>
+commit 8807355af34cba8ffe87aee51152dfccec2771fa
+Author: green <green>
+Date:   Mon Apr 9 00:58:38 2001 +0000
 
-	* libffi/src/arm/sysv.S (ffi_call_SYSV): Doubles are not saved to
-	memory correctly.  Use conditional instructions, not branches where
-	possible.
+    Many many updates.  Merge from gcc and then some.
 
-2000-05-04  Tom Tromey  <tromey@cygnus.com>
+commit f7e9f91adec4ff1c2e7a13b3de81d2c5a3f55e7e
+Author: green <green>
+Date:   Mon Apr 17 03:32:37 2000 +0000
 
-	* configure: Rebuilt.
-	* configure.in: Match `arm*-*-linux-*'.
-	From Chris Dornan <cdornan@arm.com>.
+    Mnay fixes.
 
-2000-04-28  Jakub Jelinek  <jakub@redhat.com>
+commit c4860de618f4956283f5c8230a2544e403dfe390
+Author: green <green>
+Date:   Mon Apr 17 03:18:46 2000 +0000
 
-	* Makefile.am (SUBDIRS): Define.
-	(AM_MAKEFLAGS): Likewise.
-	(Multilib support.): Add section.
-	* Makefile.in: Rebuilt.
-	* ltconfig (extra_compiler_flags, extra_compiler_flags_value):
-	New variables. Set for gcc using -print-multi-lib. Export them
-	to libtool.
-	(sparc64-*-linux-gnu*): Use libsuff 64 for search paths.
-	* ltmain.sh (B|b|V): Don't throw away gcc's -B, -b and -V options
-	for -shared links.
-	(extra_compiler_flags_value, extra_compiler_flags): Check these
-	for extra compiler options which need to be passed down in
-	compiler_flags.
+    Merge from libgcj.  Merged patches from net.  See ChangeLog for details.
 
-2000-04-16  Anthony Green  <green@redhat.com>
+commit c578b58314990c3853429297c38ba14015fec5fa
+Author: jsm <jsm>
+Date:   Sat Oct 9 20:18:16 1999 +0000
 
-	* configure: Rebuilt.
-	* configure.in: Change i*86-pc-linux* to i*86-*-linux*.
+    1999-10-09  Jason Molenda  (jsm@bugshack.cygnus.com)
+    
+    	* CVSROOT/auto_checkout, CVSROOT/commit_prep, CVSROOT/log_accum:
+    	Deleted; generic versions now used for all repositories.
+    
+    	* CVSROOT/commitinfo, CVSROOT/loginfo:  Change pathnames to
+    	generic versions.
+    
+            * CVSROOT/checkoutlist:  Don't try to check out the removed
+            files any longer.
 
-2000-04-14  Jakub Jelinek  <jakub@redhat.com>
+commit acdb20051207fed7652dd9f122f65de5458c474c
+Author: jsm <jsm>
+Date:   Sat Oct 9 20:18:15 1999 +0000
 
-	* include/ffi.h.in (SPARC64): Define for 64bit SPARC builds.
-	Set SPARC FFI_DEFAULT_ABI based on SPARC64 define.
-	* src/sparc/ffi.c (ffi_prep_args_v8): Renamed from ffi_prep_args.
-	Replace all void * sizeofs with sizeof(int).
-	Only compare type with FFI_TYPE_LONGDOUBLE if LONGDOUBLE is
-	different than DOUBLE.
-	Remove FFI_TYPE_SINT32 and FFI_TYPE_UINT32 cases (handled elsewhere).
-	(ffi_prep_args_v9): New function.
-	(ffi_prep_cif_machdep): Handle V9 ABI and long long on V8.
-	(ffi_V9_return_struct): New function.
-	(ffi_call): Handle FFI_V9 ABI from 64bit code and FFI_V8 ABI from
-	32bit code (not yet cross-arch calls).
-	* src/sparc/v8.S: Add struct return delay nop.
-	Handle long long.
-	* src/sparc/v9.S: New file.
-	* src/prep_cif.c (ffi_prep_cif): Return structure pointer
-	is used on sparc64 only for structures larger than 32 bytes.
-	Pass by reference for structures is done for structure arguments
-	larger than 16 bytes.
-	* src/ffitest.c (main): Use 64bit rint on sparc64.
-	Run long long tests on sparc.
-	* src/types.c (FFI_TYPE_POINTER): Pointer is 64bit on alpha and
-	sparc64.
-	(FFI_TYPE_LONGDOUBLE): long double is 128 bit aligned to 128 bits
-	on sparc64.
-	* configure.in (sparc-*-linux*): New supported target.
-	(sparc64-*-linux*): Likewise.
-	* configure: Rebuilt.
-	* Makefile.am: Add v9.S to SPARC files.
-	* Makefile.in: Likewise.
-	(LINK): Surround $(CCLD) into double quotes, so that multilib
-	compiles work correctly.
+    1999-10-09  Jason Molenda  (jsm@bugshack.cygnus.com)
+    
+    	* CVSROOT/auto_checkout, CVSROOT/commit_prep, CVSROOT/log_accum:
+    	Deleted; generic versions now used for all repositories.
+    
+    	* CVSROOT/commitinfo, CVSROOT/loginfo:  Change pathnames to
+    	generic versions.
+    
+            * CVSROOT/checkoutlist:  Don't try to check out the removed
+            files any longer.
 
-2000-04-04  Alexandre Petit-Bianco  <apbianco@cygnus.com>
+commit e75be655ceedf7ab24c4e99d75eec9efeb979bc7
+Author: green <green>
+Date:   Sun Aug 8 13:16:41 1999 +0000
 
-	* configure: Rebuilt.
-	* configure.in: (i*86-*-solaris*): New libffi target. Patch
-	proposed by Bryce McKinlay.
+    New configury
 
-2000-03-20  Tom Tromey  <tromey@cygnus.com>
+commit d6669a0dd5b266005325bbf6d5a8ff34574d809e
+Author: green <green>
+Date:   Sun Aug 8 13:05:12 1999 +0000
 
-	* Makefile.in: Hand edit for java_raw_api.lo.
+    	* include/ffi.h.in: Try to work around messy header problem
+    	with PACKAGE and VERSION.
+    
+    	* configure: Rebuilt.
+    	* configure.in: Change version to 2.00-beta.
+    
+            * fficonfig.h.in: Rebuilt.
+    	* acconfig.h (FFI_NO_STRUCTS, FFI_NO_RAW_API): Define.
+    
+    	* src/x86/ffi.c (ffi_raw_call): Rename.
 
-2000-03-08  Bryce McKinlay  <bryce@albatross.co.nz>
+commit 4819d52b007934a40d6d29a75ee30e857c4a93ae
+Author: green <green>
+Date:   Wed Aug 4 18:02:34 1999 +0000
 
-	* config.guess, config.sub: Update from the gcc tree.
-	Fix for PR libgcj/168.
+    New file for Kresten's closure work
 
-2000-03-03  Tom Tromey  <tromey@cygnus.com>
+commit 2dbf801eb427cbf5021a9e1e512b5fc523524700
+Author: green <green>
+Date:   Wed Aug 4 18:00:05 1999 +0000
 
-	* Makefile.in: Fixed ia64 by hand.
+    Kresten's closure work. Initial checkin.
 
-	* configure: Rebuilt.
-	* configure.in (--enable-multilib): New option.
-	(libffi_basedir): New subst.
-	(AC_OUTPUT): Added multilib code.
+commit d170961701b0f2bf7e824d7caba2ebe10002ed84
+Author: green <green>
+Date:   Thu Jul 8 14:36:52 1999 +0000
 
-2000-03-02  Tom Tromey  <tromey@cygnus.com>
+    	* configure.in: Add x86 and powerpc BeOS configurations.
+    	From Makoto Kato <m_kato@ga2.so-net.ne.jp>.
 
-	* Makefile.in: Rebuilt.
-	* Makefile.am (TARGET_SRC_IA64): Use `ia64', not `alpha', as
-	directory name.
+commit c7747d976924ec6f2229cbcfbbdb98d364e10de9
+Author: jsm <jsm>
+Date:   Wed May 12 23:32:16 1999 +0000
 
-2000-02-25  Hans Boehm <boehm@acm.org>
+    1999-05-12  Jason Molenda  (jsm@bugshack.cygnus.com)
+            * index.html: Add links to libffi* mail list archives.
 
-	* src/ia64/ffi.c, src/ia64/ia64_flags.h, src/ia64/unix.S: New
-	files.
-	* src/raw_api.c (ffi_translate_args): Fixed typo in argument
-	list.
-	(ffi_prep_raw_closure): Use ffi_translate_args, not
-	ffi_closure_translate.
-	* src/java_raw_api.c: New file.
-	* src/ffitest.c (closure_test_fn): New function.
-	(main): Define `rint' as long long on IA64.  Added new test when
-	FFI_CLOSURES is defined.
-	* include/ffi.h.in (ALIGN): Use size_t, not unsigned.
-	(ffi_abi): Recognize IA64.
-	(ffi_raw): Added `flt' field.
-	Added "Java raw API" code.
-	* configure.in: Recognize ia64.
-	* Makefile.am (TARGET_SRC_IA64): New macro.
-	(libffi_la_common_SOURCES): Added java_raw_api.c.
-	(libffi_la_SOURCES): Define in IA64 case.
+commit dd2aa9a8de22e26df3bbc85d068358641f6202f7
+Author: green <green>
+Date:   Thu May 6 05:34:36 1999 +0000
 
-2000-01-04  Tom Tromey  <tromey@cygnus.com>
+    	* configure.in: Add warning about this being beta code.
+    	Remove src/Makefile.am from the picture.
+    	* configure: Rebuilt.
+    	* Makefile.am: Move logic from src/Makefile.am.  Add changes
+    	to support libffi as a target library.
+    	* Makefile.in: Rebuilt.
+    	* aclocal.m4, config.guess, config.sub, ltconfig, ltmain.sh:
+    	Upgraded to new autoconf, automake, libtool.
+    	* README: Tweaks.
+    	* LICENSE: Update copyright date.
+    	* src/Makefile.am, src/Makefile.in: Removed.
 
-	* Makefile.in: Rebuilt with newer automake.
+commit 4e9452abed58a3058ccdb446f96a29d50dda1f34
+Author: green <green>
+Date:   Wed May 5 22:06:13 1999 +0000
 
-1999-12-31  Tom Tromey  <tromey@cygnus.com>
+    Updated to new automake, libtool, autoconf - nothing works :-)
 
-	* Makefile.am (INCLUDES): Added -I$(top_srcdir)/src.
+commit 6d3b2bddaf4967fba8b8656c01bfc77ec0f2800c
+Author: jsm <jsm>
+Date:   Mon Apr 26 15:55:28 1999 +0000
 
-1999-09-01  Tom Tromey  <tromey@cygnus.com>
+    1999-04-26  Jason Molenda  (jsm@bugshack.cygnus.com)
+            * index.html: Missed a reference to libffi-discuss@cygnus.com.  Fixed.
 
-	* include/ffi.h.in: Removed PACKAGE and VERSION defines and
-	undefs.
-	* fficonfig.h.in: Rebuilt.
-	* configure: Rebuilt.
-	* configure.in: Pass 3rd argument to AM_INIT_AUTOMAKE.
-	Use AM_PROG_LIBTOOL (automake 1.4 compatibility).
-	* acconfig.h: Don't #undef PACKAGE or VERSION.
+commit ebc6a9c28af831d3d187af8ff17319f0f309bd98
+Author: jsm <jsm>
+Date:   Mon Apr 26 15:53:29 1999 +0000
 
-1999-08-09  Anthony Green  <green@cygnus.com>
+    1999-04-26  Jason Molenda  (jsm@bugshack.cygnus.com)
+            * index.html: Change links to ftp directory to point to sourceware
+            directory.
+            Change mailing list subscription forms to point to sourceware lists.
 
-	* include/ffi.h.in: Try to work around messy header problem
-	with PACKAGE and VERSION.
+commit 78ffc52a8b257061348c576ccb6fbbf8b48b0fff
+Author: jsm <jsm>
+Date:   Sun Apr 18 01:33:21 1999 +0000
 
-	* configure: Rebuilt.
-	* configure.in: Change version to 2.00-beta.
+    Standard sourceware setup.
 
-	* fficonfig.h.in: Rebuilt.
-	* acconfig.h (FFI_NO_STRUCTS, FFI_NO_RAW_API): Define.
+commit b4d77e827d7ebef7e57ebcd71e71c15c62f1e0a8
+Author: jsm <jsm>
+Date:   Mon Nov 30 11:11:25 1998 +0000
 
-	* src/x86/ffi.c (ffi_raw_call): Rename.
+    Small typeo.  (I wouldn't bother except that it made the sentence hard
+    for me to parse on a casual read.)
 
-1999-08-02  Kresten Krab Thorup  <krab@dominiq.is.s.u-tokyo.ac.jp>
+commit bfb73f08fdc987e37070c5fb0b196fbd28872888
+Author: jsm <jsm>
+Date:   Mon Nov 30 10:44:55 1998 +0000
 
-	* src/x86/ffi.c (ffi_closure_SYSV): New function.
-	(ffi_prep_incoming_args_SYSV): Ditto.
-	(ffi_prep_closure): Ditto.
-	(ffi_closure_raw_SYSV): Ditto.
-	(ffi_prep_raw_closure): More ditto.
-	(ffi_call_raw): Final ditto.
+    A few cleanups.  Most notably, point to the correct subscribe cgi-bin
+    script.
 
-	* include/ffi.h.in: Add definitions for closure and raw API.
+commit af8b7f037ccee3b7939ee226a1a2bbc2f057b35c
+Author: green <green>
+Date:   Mon Nov 30 06:20:05 1998 +0000
 
-	* src/x86/ffi.c (ffi_prep_cif_machdep): Added case for
-	FFI_TYPE_UINT64.
+    	* index.html: Reformatted and updated to reflect hosting on
+    	sourceware.cygnus.com (new mailing lists, etc).
 
-	* Makefile.am (libffi_la_common_SOURCES): Added raw_api.c
+commit 334f0b060942aff8d26badaf7dde7830450dc5da
+Author: green <green>
+Date:   Sun Nov 29 16:56:12 1998 +0000
 
-	* src/raw_api.c: New file.
+    initial snapshot of documentation
 
-	* include/ffi.h.in (ffi_raw): New type.
-	(UINT_ARG, SINT_ARG): New defines.
-	(ffi_closure, ffi_raw_closure): New types.
-	(ffi_prep_closure, ffi_prep_raw_closure): New declarations.
+commit 3ab5cb4a1dcc7ecd7e773c97582b0099976c4753
+Author: green <green>
+Date:   Sun Nov 29 16:56:10 1998 +0000
 
-	* configure.in: Add check for endianness and sizeof void*.
+    Initial revision
 
-	* src/x86/sysv.S (ffi_call_SYSV): Call fixup routine via argument,
-	instead of directly.
+commit d2a9eb5a8b7cbc8b769809cad59c82b975c178e2
+Merge: d3782ec bc75c54
+Author: green <green>
+Date:   Sun Nov 29 16:48:16 1998 +0000
 
-	* configure: Rebuilt.
+    This commit was generated by cvs2svn to compensate for changes in r7, which
+    included commits to RCS files with non-trunk default branches.
 
-Thu Jul  8 14:28:42 1999  Anthony Green  <green@cygnus.com>
+commit bc75c54bd311658005b065f1bf201b204c81cbca
+Author: green <green>
+Date:   Sun Nov 29 16:48:16 1998 +0000
 
-	* configure.in: Add x86 and powerpc BeOS configurations.
-	From Makoto Kato <m_kato@ga2.so-net.ne.jp>.
+    Import of v1 code.
 
-1999-05-09  Anthony Green  <green@cygnus.com>
+commit d3782ec8160c644421dcea17b605fec6e328f14e
+Author: jsm <jsm>
+Date:   Fri Nov 20 20:18:00 1998 +0000
 
-	* configure.in: Add warning about this being beta code.
-	Remove src/Makefile.am from the picture.
-	* configure: Rebuilt.
+    Send commit messages to mailing lists.
 
-	* Makefile.am: Move logic from src/Makefile.am.  Add changes
-	to support libffi as a target library.
-	* Makefile.in: Rebuilt.
+commit 8d8d3843c484c2bb70d8375b2b799f75eb03f709
+Author: jsm <jsm>
+Date:   Thu Oct 1 22:08:36 1998 +0000
 
-	* aclocal.m4, config.guess, config.sub, ltconfig, ltmain.sh:
-	Upgraded to new autoconf, automake, libtool.
+    initial checkin
 
-	* README: Tweaks.
+commit 49634f3bf221cc1939abafc788f7e4e31293fe73
+Author: jsm <jsm>
+Date:   Thu Oct 1 22:08:35 1998 +0000
 
-	* LICENSE: Update copyright date.
+    Add standard setup.
 
-	* src/Makefile.am, src/Makefile.in: Removed.
+commit c64a84c7693f8cd400fb94bba3c9bcfd9ad1fc36
+Author: jsm <jsm>
+Date:   Thu Oct 1 22:08:34 1998 +0000
 
-1998-11-29  Anthony Green  <green@cygnus.com>
+    Add readers and standard modules file.
 
-	* include/ChangeLog: Removed.
-	* src/ChangeLog: Removed.
-	* src/mips/ChangeLog: Removed.
-	* src/sparc/ChangeLog: Remboved.
-	* src/x86/ChangeLog: Removed.
+commit 9813273b07fd082da573b3b6bfb8d23809b59eea
+Author: jsm <jsm>
+Date:   Thu Oct 1 22:08:33 1998 +0000
 
-	* ChangeLog.v1: Created.
+    initial checkin
diff --git a/Modules/_ctypes/libffi/ChangeLog.libffi-3.1 b/Modules/_ctypes/libffi/ChangeLog.libffi-3.1
new file mode 100644
index 0000000..8f7f50d
--- /dev/null
+++ b/Modules/_ctypes/libffi/ChangeLog.libffi-3.1
@@ -0,0 +1,6000 @@
+2014-03-16  Josh Triplett  <josh@joshtriplett.org>
+
+	* ChangeLog: Archive to ChangeLog.libffi-3.1 and delete.  Future
+	changelogs will come from git, with autogenerated snapshots shipped in
+	distributed tarballs.
+
+2014-03-16  Josh Triplett  <josh@joshtriplett.org>
+
+	Add support for stdcall, thiscall, and fastcall on non-Windows
+	x86-32.
+
+	Linux supports the stdcall calling convention, either via
+	functions explicitly declared with the stdcall attribute, or via
+	code compiled with -mrtd which effectively makes stdcall the
+	default.
+
+	This introduces FFI_STDCALL, FFI_THISCALL, and FFI_FASTCALL on
+	non-Windows x86-32 platforms, as non-default calling conventions.
+
+	* Makefile.am: Compile in src/x86/win32.S on non-Windows x86-32.
+	* src/x86/ffitarget.h: Add FFI_STDCALL, FFI_THISCALL, and
+	FFI_FASTCALL on non-Windows x86-32.  Increase trampoline size to
+	accomodate these calling conventions, and unify some ifdeffery.
+	* src/x86/ffi.c: Add support for FFI_STDCALL, FFI_THISCALL, and
+	FFI_FASTCALL on non-Windows x86-32 platforms; update ifdeffery.
+	* src/x86/win32.S: Support compiling on non-Windows x86-32
+	platforms.  On those platforms, avoid redefining the SYSV symbols
+	already provided by src/x86/sysv.S.
+	* testsuite/libffi.call/closure_stdcall.c: Run on non-Windows.
+	#define __stdcall if needed.
+	* testsuite/libffi.call/closure_thiscall.c: Run on non-Windows.
+	#define __fastcall if needed.
+	* testsuite/libffi.call/fastthis1_win32.c: Run on non-Windows.
+	* testsuite/libffi.call/fastthis2_win32.c: Ditto.
+	* testsuite/libffi.call/fastthis3_win32.c: Ditto.
+	* testsuite/libffi.call/many2_win32.c: Ditto.
+	* testsuite/libffi.call/many_win32.c: Ditto.
+	* testsuite/libffi.call/strlen2_win32.c: Ditto.
+	* testsuite/libffi.call/strlen_win32.c: Ditto.
+	* testsuite/libffi.call/struct1_win32.c: Ditto.
+	* testsuite/libffi.call/struct2_win32.c: Ditto.
+
+2014-03-16  Josh Triplett  <josh@joshtriplett.org>
+
+	* prep_cif.c: Remove unnecessary ifdef for X86_WIN32.
+	ffi_prep_cif_core had a special case for X86_WIN32, checking for
+	FFI_THISCALL in addition to the FFI_FIRST_ABI-to-FFI_LAST_ABI
+	range before returning FFI_BAD_ABI.  However, on X86_WIN32,
+	FFI_THISCALL already falls in that range, making the special case
+	unnecessary.  Remove it.
+
+2014-03-16  Josh Triplett  <josh@joshtriplett.org>
+
+	* testsuite/libffi.call/closure_stdcall.c,
+	testsuite/libffi.call/closure_thiscall.c: Remove fragile stack
+	pointer checks.  These files included inline assembly to save the
+	stack pointer before and after the call, and compare the values.
+	However, compilers can and do leave the stack in different states
+	for these two pieces of inline assembly, such as by saving a
+	temporary value on the stack across the call; observed with gcc
+	-Os, and verified as spurious through careful inspection of
+	disassembly.
+
+2014-03-16  Josh Triplett  <josh@joshtriplett.org>
+
+	* testsuite/libffi.call/many.c: Avoid spurious failure due to
+	excess floating-point precision.
+	* testsuite/libffi.call/many_win32.c: Ditto.
+
+2014-03-16  Josh Triplett <josh@joshtriplett.org>
+
+	* libtool-ldflags: Re-add.
+
+2014-03-16  Josh Triplett <josh@joshtriplett.org>
+
+	* Makefile.in, aclocal.m4, compile, config.guess, config.sub,
+	configure, depcomp, include/Makefile.in, install-sh,
+	libtool-ldflags, ltmain.sh, m4/libtool.m4, m4/ltoptions.m4,
+	m4/ltsugar.m4, m4/ltversion.m4, m4/lt~obsolete.m4,
+	man/Makefile.in, mdate-sh, missing, testsuite/Makefile.in: Delete
+	autogenerated files from version control.
+	* .gitignore: Add autogenerated files.
+	* autogen.sh: New script to generate the autogenerated files.
+	* README: Document requirement to run autogen.sh when building
+	directly from version control.
+	* .travis.yml: Run autogen.sh
+
+2014-03-14  Anthony Green <green@moxielogic.com>
+
+	* configure, Makefile.in: Rebuilt.
+
+2014-03-10  Mike Hommey <mh+mozilla@glandium.org>
+
+	* configure.ac: Allow building for mipsel with Android NDK r8.
+	* Makefile.am (AM_MAKEFLAGS): Replace double quotes with single
+	quotes.
+
+2014-03-10  Landry Breuil <landry@openbsd.org>
+
+	* configure.ac: Ensure the linker supports @unwind sections in libffi.
+
+2014-03-01  Anthony Green  <green@moxielogic.com>
+
+	* Makefile.am (EXTRA_DIST): Replace old scripts with
+	generate-darwin-source-and-headers.py.
+	* Makefile.in: Rebuilt.
+
+2014-02-28  Anthony Green  <green@moxielogic.com>
+
+	* Makefile.am (AM_CFLAGS): Reintroduce missing -DFFI_DEBUG for
+	--enable-debug builds.
+	* Makefile.in: Rebuilt.
+
+2014-02-28  Makoto Kato  <m_kato@ga2.so-net.ne.jp>
+
+	* src/closures.c: Fix build failure when using clang for Android.
+
+2014-02-28  Marcin Wojdyr  <wojdyr@gmail.com>
+
+	* libffi.pc.in (toolexeclibdir): use -L${toolexeclibdir} instead
+	of -L${libdir}.
+
+2014-02-28  Paulo Pizarro  <paulo.pizarro@gmail.com>
+
+	* src/bfin/sysv.S: Calling functions in shared libraries requires
+	considering the GOT.
+
+2014-02-28  Josh Triplett  <josh@joshtriplett.org>
+
+	* src/x86/ffi64.c (classify_argument): Handle case where
+	FFI_TYPE_LONGDOUBLE == FFI_TYPE_DOUBLE.
+
+2014-02-28  Anthony Green  <green@moxielogic.com>
+
+	* ltmain.sh: Generate with libtool-2.4.2.418.
+	* m4/libtool.m4, m4/ltoptions.m4, m4/ltversion.m4: Ditto.
+	* configure: Rebuilt.
+
+2014-02-28  Dominik Vogt  <vogt@linux.vnet.ibm.com>
+
+	* configure.ac (AC_ARG_ENABLE struct): Fix typo in help
+	message.
+	(AC_ARG_ENABLE raw_api): Ditto.
+	* configure, fficonfig.h.in: Rebuilt.
+
+2014-02-28  Will Newton  <will.newton@linaro.org>
+
+	* src/arm/sysv.S: Initialize IP register with FP.
+
+2014-02-28  Yufeng Zhang  <yufeng.zhang@arm.com>
+
+	* src/aarch64/sysv.S (ffi_closure_SYSV): Use x29 as the
+	main CFA reg; update cfi_rel_offset.
+
+2014-02-15  Marcus Comstedt  <marcus@mc.pp.se>
+
+	* src/powerpc/ffi_linux64.c, src/powerpc/linux64_closure.S: Remove
+	assumption on contents of r11 in closure.
+
+2014-02-09  Heiher  <r@hev.cc>
+
+	* src/mips/n32.S: Fix call floating point va function.
+
+2014-01-21  Zachary Waldowski  <zach@waldowski.me>
+
+	* src/aarch64/ffi.c: Fix missing semicolons on assertions under
+	debug mode.
+
+2013-12-30  Zachary Waldowski  <zach@waldowski.me>
+
+	* .gitignore: Exclude darwin_* generated source and build_* trees.
+	* src/aarch64/ffi.c, src/arm/ffi.c, src/x86/ffi.c: Inhibit Clang
+	previous prototype warnings.
+	* src/arm/ffi.c: Prevent NULL dereference, fix short type warning
+	* src/dlmalloc.c: Fix warnings from set_segment_flags return type,
+	and the native use of size_t for malloc on platforms
+	* src/arm/sysv.S: Use unified syntax. Clang clean-ups for
+	ARM_FUNC_START.
+	* generate-osx-source-and-headers.py: Remove.
+	* build-ios.sh: Remove.
+	* libffi.xcodeproj/project.pbxproj: Rebuild targets. Include
+	x86_64+aarch64 pieces in library.  Export headers properly.
+	* src/x86/ffi64.c: More Clang warning clean-ups.
+	* src/closures.c (open_temp_exec_file_dir): Use size_t.
+	* src/prep_cif.c (ffi_prep_cif_core): Cast ALIGN result.
+	* src/aarch64/sysv.S: Use CNAME for global symbols.  Only use
+	.size for ELF targets.
+	* src/aarch64/ffi.c: Clean up for double == long double.  Clean up
+	from Clang warnings.  Use Clang cache invalidation builtin.  Use
+	size_t in place of unsigned in many places.  Accommodate for
+	differences in Apple AArch64 ABI.
+
+2013-12-02  Daniel Rodríguez Troitiño  <drodrigueztroitino@yahoo.es>
+
+	* generate-darwin-source-and-headers.py: Clean up, modernize,
+	merged version of previous scripts.
+
+2013-11-21  Anthony Green  <green@moxielogic.com>
+
+	* configure, Makefile.in, include/Makefile.in, include/ffi.h.in,
+	man/Makefile.in, testsuite/Makefile.in, fficonfig.h.in: Rebuilt.
+
+2013-11-21  Alan Modra  <amodra@gmail.com>
+
+	* Makefile.am (EXTRA_DIST): Add new src/powerpc files.
+	(nodist_libffi_la_SOURCES <POWERPC, POWERPC_FREEBSD>): Likewise.
+	* configure.ac (HAVE_LONG_DOUBLE_VARIANT): Define for powerpc.
+	* include/ffi.h.in (ffi_prep_types): Declare.
+	* src/prep_cif.c (ffi_prep_cif_core): Call ffi_prep_types.
+	* src/types.c (FFI_NONCONST_TYPEDEF): Define and use for
+	HAVE_LONG_DOUBLE_VARIANT.
+	* src/powerpc/ffi_powerpc.h: New file.
+	* src/powerpc/ffi.c: Split into..
+	* src/powerpc/ffi_sysv.c: ..new file, and..
+	* src/powerpc/ffi_linux64.c: ..new file, rewriting parts.
+	* src/powerpc/ffitarget.h (enum ffi_abi): Rewrite powerpc ABI
+	selection as bits controlling features.
+	* src/powerpc/linux64.S: For consistency, use POWERPC64 rather
+	than __powerpc64__.
+	* src/powerpc/linux64_closure.S: Likewise.
+	* src/powerpc/ppc_closure.S: Likewise.  Move .note.FNU-stack
+	inside guard.
+	* src/powerpc/sysv.S: Likewise.
+	* configure: Regenerate.
+	* fficonfig.h.in: Regenerate.
+	* Makefile.in: Regenerate.
+
+2013-11-20  Alan Modra  <amodra@gmail.com>
+
+	* src/powerpc/ffi.c (ffi_prep_cif_machdep_core): Use
+	NUM_FPR_ARG_REGISTERS64 and NUM_GPR_ARG_REGISTERS64 not their
+	32-bit versions for 64-bit code.
+	* src/powerpc/linux64_closure.S: Don't use the return value area
+	as a parameter save area on ELFv2.
+
+2013-11-18  Iain Sandoe  <iain@codesourcery.com>
+
+	* src/powerpc/darwin.S (EH): Correct use of pcrel FDE encoding.
+	* src/powerpc/darwin_closure.S (EH): Likewise. Modernise picbase
+	labels.
+
+2013-11-18  Anthony Green  <green@moxielogic.com>
+
+	* src/arm/ffi.c (ffi_call): Hoist declaration of temp to top of
+	function.
+	* src/arm/ffi.c (ffi_closure_inner): Moderize function declaration
+	to appease compiler.
+	Thanks for Gregory P. Smith <greg@krypto.org>.
+
+2013-11-18  Anthony Green  <green@moxielogic.com>
+
+	* README (tested): Mention PowerPC ELFv2.
+
+2013-11-16  Alan Modra  <amodra@gmail.com>
+
+	* src/powerpc/ppc_closure.S: Move errant #endif to where it belongs.
+	Don't bl .Luint128.
+
+2013-11-16  Alan Modra  <amodra@gmail.com>
+
+	* src/powerpc/ffi.c (ffi_prep_cif_machdep_core): Use #if _CALL_ELF
+	test to select parameter save sizing for ELFv2 vs. ELFv1.
+	* src/powerpc/ffitarget.h (FFI_V2_TYPE_FLOAT_HOMOG,
+	FFI_V2_TYPE_DOUBLE_HOMOG, FFI_V2_TYPE_SMALL_STRUCT): Define.
+	(FFI_TRAMPOLINE_SIZE): Define variant for ELFv2.
+	* src/powerpc/ffi.c (FLAG_ARG_NEEDS_PSAVE): Define.
+	(discover_homogeneous_aggregate): New function.
+	(ffi_prep_args64): Adjust start of param save area for ELFv2.
+	Handle homogenous floating point struct parms.
+	(ffi_prep_cif_machdep_core): Adjust space calculation for ELFv2.
+	Handle ELFv2 return values.  Set FLAG_ARG_NEEDS_PSAVE.  Handle
+	homogenous floating point structs.
+	(ffi_call): Increase size of smst_buffer for ELFv2.  Handle ELFv2.
+	(flush_icache): Compile for ELFv2.
+	(ffi_prep_closure_loc): Set up ELFv2 trampoline.
+	(ffi_closure_helper_LINUX64): Don't return all structs directly
+	to caller.  Handle homogenous floating point structs.  Handle
+	ELFv2 struct return values.
+	* src/powerpc/linux64.S (ffi_call_LINUX64): Set up r2 for
+	ELFv2.  Adjust toc save location.  Call function pointer using
+	r12.  Handle FLAG_RETURNS_SMST.  Don't predict branches.
+	* src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Set up r2
+	for ELFv2.  Define ELFv2 versions of STACKFRAME, PARMSAVE, and
+	RETVAL.  Handle possibly missing parameter save area.  Handle
+	ELFv2 return values.
+	(.note.GNU-stack): Move inside outer #ifdef.
+
+2013-11-16  Alan Modra  <amodra@gmail.com>
+
+	* src/powerpc/ffi.c (ffi_prep_cif_machdep): Revert 2013-02-08
+	change.  Do not consume an int arg when returning a small struct
+	for FFI_SYSV ABI.
+	(ffi_call): Only use bounce buffer when FLAG_RETURNS_SMST.
+	Properly copy bounce buffer to destination.
+	* src/powerpc/sysv.S: Revert 2013-02-08 change.
+	* src/powerpc/ppc_closure.S: Remove stray '+'.
+
+2013-11-16  Alan Modra  <amodra@gmail.com>
+
+	* src/powerpc/ffi.c (ffi_prep_args64): Align struct parameters
+	according to __STRUCT_PARM_ALIGN__.
+	(ffi_prep_cif_machdep_core): Likewise.
+	(ffi_closure_helper_LINUX64): Likewise.
+
+2013-11-16  Alan Modra  <amodra@gmail.com>
+
+	* src/powerpc/linux64.S (ffi_call_LINUX64): Tweak restore of r28.
+	(.note.GNU-stack): Move inside outer #ifdef.
+	* src/powerpc/linux64_closure.S (STACKFRAME, PARMSAVE,
+	RETVAL): Define and use throughout.
+	(ffi_closure_LINUX64): Save fprs before buying stack.
+	(.note.GNU-stack): Move inside outer #ifdef.
+
+2013-11-16  Alan Modra  <amodra@gmail.com>
+
+	* src/powerpc/ffitarget.h (FFI_TARGET_SPECIFIC_VARIADIC): Define.
+	(FFI_EXTRA_CIF_FIELDS): Define.
+	* src/powerpc/ffi.c (ffi_prep_args64): Save fprs as per the
+	ABI, not to both fpr and param save area.
+	(ffi_prep_cif_machdep_core): Renamed from ffi_prep_cif_machdep.
+	Keep initial flags.  Formatting.  Remove dead FFI_LINUX_SOFT_FLOAT
+	code.
+	(ffi_prep_cif_machdep, ffi_prep_cif_machdep_var): New functions.
+	(ffi_closure_helper_LINUX64): Pass floating point as per ABI,
+	not to both fpr and parameter save areas.
+
+	* libffi/testsuite/libffi.call/cls_double_va.c (main): Correct
+	function cast and don't call ffi_prep_cif.
+	* libffi/testsuite/libffi.call/cls_longdouble_va.c (main): Likewise.
+
+2013-11-15  Andrew Haley  <aph@redhat.com>
+
+	* doc/libffi.texi (Closure Example): Fix the sample code.
+	* doc/libffi.info, doc/stamp-vti, doc/version.texi: Rebuilt.
+
+2013-11-15  Andrew Haley  <aph@redhat.com>
+
+	* testsuite/libffi.call/va_struct1.c (main): Fix broken test.
+	* testsuite/libffi.call/cls_uint_va.c (cls_ret_T_fn): Likewise
+	* testsuite/libffi.call/cls_struct_va1.c (test_fn): Likewise.
+	* testsuite/libffi.call/va_1.c (main): Likewise.
+
+2013-11-14  David Schneider  <david.schneider@bivab.de>
+
+	* src/arm/ffi.c: Fix register allocation for mixed float and
+	doubles.
+	* testsuite/libffi.call/cls_many_mixed_float_double.c: Testcase
+	for many mixed float and double arguments.
+
+2013-11-13  Alan Modra  <amodra@gmail.com>
+
+	* doc/libffi.texi (Simple Example): Correct example code.
+	* doc/libffi.info, doc/stamp-vti, doc/version.texi: Rebuilt.
+
+2013-11-13  Anthony Green  <green@moxielogic.com>
+
+	* include/ffi_common.h: Respect HAVE_ALLOCA_H for GNU compiler
+	based build. (Thanks to tmr111116 on github)
+
+2013-11-09  Anthony Green  <green@moxielogic.com>
+
+	* m4/libtool.m4: Refresh.
+	* configure, Makefile.in: Rebuilt.
+	* README: Add more notes about next release.
+
+2013-11-09  Shigeharu TAKENO  <shige@iee.niit.ac.jp>
+
+	* m4/ax_gcc_archflag.m4 (ax_gcc_arch): Don't recognize
+	UltraSPARC-IIi as ultrasparc3.
+
+2013-11-06  Mark Kettenis  <kettenis@gnu.org>
+
+	* src/x86/freebsd.S (ffi_call_SYSV): Align the stack pointer to
+        16-bytes.
+
+2013-11-06  Konstantin Belousov <kib@freebsd.org>
+
+	* src/x86/freebsd.S (ffi_closure_raw_SYSV): Mark the assembler
+	source as not requiring executable stack.
+
+2013-11-02  Anthony Green  <green@moxielogic.com>
+
+	* doc/libffi.texi (The Basics): Clarify return value buffer size
+	requirements.  Also, NULL result buffer pointers are no longer
+	supported.
+	* doc/libffi.info: Rebuilt.
+
+2013-11-02  Mischa Jonker  <mjonker@synopsys.com>
+
+	* Makefile.am (nodist_libffi_la_SOURCES): Fix build error.
+	* Makefile.in: Rebuilt.
+
+2013-11-02  David Schneider  <david.schneider@bivab.de>
+
+	* src/arm/ffi.c: more robust argument handling for closures on arm hardfloat
+	* testsuite/libffi.call/many_mixed.c: New file.
+	* testsuite/libffi.call/cls_many_mixed_args.c: More tests.
+
+2013-11-02  Vitaly Budovski
+
+	* src/x86/ffi.c (ffi_prep_cif_machdep): Don't align stack for win32.
+
+2013-10-23  Mark H Weaver  <mhw@netris.org>
+
+	* src/mips/ffi.c: Fix handling of uint32_t arguments on the
+	MIPS N32 ABI.
+
+2013-10-13  Sandra Loosemore  <sandra@codesourcery.com>
+
+	* README: Add Nios II to table of supported platforms.
+	* Makefile.am (EXTRA_DIST): Add nios2 files.
+	(nodist_libffi_la_SOURCES): Likewise.
+	* Makefile.in: Regenerated.
+	* configure.ac (nios2*-linux*): New host.
+	(NIOS2): Add AM_CONDITIONAL.
+	* configure: Regenerated.
+	* src/nios2/ffi.c: New.
+	* src/nios2/ffitarget.h: New.
+	* src/nios2/sysv.S: New.
+	* src/prep_cif.c (initialize_aggregate): Handle extra structure
+	alignment via FFI_AGGREGATE_ALIGNMENT.
+	(ffi_prep_cif_core): Conditionalize structure return for NIOS2.
+
+2013-10-10  Sandra Loosemore  <sandra@codesourcery.com>
+
+	* testsuite/libffi.call/cls_many_mixed_args.c (cls_ret_double_fn):
+	Fix uninitialized variable.
+
+2013-10-11  Marcus Shawcroft  <marcus.shawcroft@arm.com>
+
+	* testsuite/libffi.call/many.c (many): Replace * with +.
+
+2013-10-08  Ondřej Bílka  <neleai@seznam.cz>
+
+	* src/aarch64/ffi.c, src/aarch64/sysv.S, src/arm/ffi.c,
+	src/arm/gentramp.sh, src/bfin/sysv.S, src/closures.c,
+	src/dlmalloc.c, src/ia64/ffi.c, src/microblaze/ffi.c,
+	src/microblaze/sysv.S, src/powerpc/darwin_closure.S,
+	src/powerpc/ffi.c, src/powerpc/ffi_darwin.c, src/sh/ffi.c,
+	src/tile/tile.S, testsuite/libffi.call/nested_struct11.c: Fix
+	spelling errors.
+
+2013-10-08  Anthony Green  <green@moxielogic.com>
+
+	* aclocal.m4, compile, config.guess, config.sub, depcomp,
+	install-sh, mdate-sh, missing, texinfo.tex: Update from upstream.
+	* configure.ac: Update version to 3.0.14-rc0.
+	* Makefile.in, configure, Makefile.in, include/Makefile.in,
+	man/Makefile.in, testsuite/Makefile.in: Rebuilt.
+	* README: Mention M88K and VAX.
+
+2013-07-15  Miod Vallat  <miod@openbsd.org>
+
+	* Makefile.am,
+	configure.ac,
+	src/m88k/ffi.c,
+	src/m88k/ffitarget.h,
+	src/m88k/obsd.S,
+	src/vax/elfbsd.S,
+	src/vax/ffi.c,
+	src/vax/ffitarget.h: Add m88k and vax support.
+
+2013-06-24 Alan Modra  <amodra@gmail.com>
+
+	* src/powerpc/ffi.c (ffi_prep_args_SYSV): Move var declaration
+	before statements.
+	(ffi_prep_args64): Support little-endian.
+	(ffi_closure_helper_SYSV, ffi_closure_helper_LINUX64): Likewise.
+	* src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Likewise.
+	* src/powerpc/ppc_closure.S (ffi_closure_SYSV): Likewise.
+
+2013-06-12  Mischa Jonker  <mjonker@synopsys.com>
+
+	 * configure.ac: Add support for ARC.
+	 * Makefile.am: Likewise.
+	 * README: Add ARC details.
+	 * src/arc/arcompact.S: New.
+	 * src/arc/ffi.c: Likewise.
+	 * src/arc/ffitarget.h: Likewise.
+
+2013-03-28  David Schneider  <david.schneider@bivab.de>
+
+	 * src/arm/ffi.c: Fix support for ARM hard-float calling convention.
+	 * src/arm/sysv.S: call different methods for SYSV and VFP ABIs.
+	 * testsuite/libffi.call/cls_many_mixed_args.c: testcase for a closure with
+	 mixed arguments, many doubles.
+	 * testsuite/libffi.call/many_double.c: testcase for calling a function using
+	 more than 8 doubles.
+	 * testcase/libffi.call/many.c: use absolute value to check result against an
+	 epsilon
+
+2013-03-17  Anthony Green  <green@moxielogic.com>
+
+	* README: Update for 3.0.13.
+	* configure.ac: Ditto.
+	* configure: Rebuilt.
+	* doc/*: Update version.
+
+2013-03-17  Dave Korn  <dave.korn.cygwin@gmail.com>
+
+	* src/closures.c (is_emutramp_enabled
+	[!FFI_MMAP_EXEC_EMUTRAMP_PAX]): Move default definition outside
+	enclosing #if scope.
+
+2013-03-17  Anthony Green  <green@moxielogic.com>
+
+	* configure.ac: Only modify toolexecdir in certain cases.
+	* configure: Rebuilt.
+
+2013-03-16  Gilles Talis  <gilles.talis@gmail.com>
+
+	* src/powerpc/ffi.c (ffi_prep_args_SYSV): Don't use
+	fparg_count,etc on __NO_FPRS__ targets.
+
+2013-03-16  Alan Hourihane  <alanh@fairlite.co.uk>
+
+	* src/m68k/sysv.S (epilogue): Don't use extb instruction on
+	m680000 machines.
+
+2013-03-16  Alex Gaynor <alex.gaynor@gmail.com>
+
+	* src/x86/ffi.c (ffi_prep_cif_machdep): Always align stack.
+
+2013-03-13  Markos Chandras <markos.chandras@imgtec.com>
+
+	* configure.ac: Add support for Imagination Technologies Meta.
+	* Makefile.am: Likewise.
+	* README: Add Imagination Technologies Meta details.
+	* src/metag/ffi.c: New.
+	* src/metag/ffitarget.h: Likewise.
+	* src/metag/sysv.S: Likewise.
+
+2013-02-24  Andreas Schwab  <schwab@linux-m68k.org>
+
+	* doc/libffi.texi (Structures): Fix missing category argument of
+	@deftp.
+
+2013-02-11  Anthony Green <green@moxielogic.com>
+
+	* configure.ac: Update release number to 3.0.12.
+	* configure: Rebuilt.
+	* README: Update release info.
+
+2013-02-10  Anthony Green <green@moxielogic.com>
+
+	* README: Add Moxie.
+	* src/moxie/ffi.c: Created.
+	* src/moxie/eabi.S: Created.
+	* src/moxie/ffitarget.h: Created.
+	* Makefile.am (nodist_libffi_la_SOURCES): Add Moxie.
+	* Makefile.in: Rebuilt.
+	* configure.ac: Add Moxie.
+	* configure: Rebuilt.
+	* testsuite/libffi.call/huge_struct.c: Disable format string
+	warnings for moxie*-*-elf tests.
+
+2013-02-10  Anthony Green <green@moxielogic.com>
+
+	* Makefile.am (LTLDFLAGS): Fix reference.
+	* Makefile.in: Rebuilt.
+
+2013-02-10  Anthony Green <green@moxielogic.com>
+
+	* README: Update supported platforms.  Update test results link.
+
+2013-02-09  Anthony Green <green@moxielogic.com>
+
+	* testsuite/libffi.call/negint.c: Remove forced -O2.
+	* testsuite/libffi.call/many2.c (foo): Remove GCCism.
+	* testsuite/libffi.call/ffitest.h: Add default PRIuPTR definition.
+
+	* src/sparc/v8.S (ffi_closure_v8): Import ancient ulonglong
+	closure return type fix developed by Martin v. Löwis for cpython
+	fork.
+
+2013-02-08  Andreas Tobler  <andreast@fgznet.ch>
+
+	* src/powerpc/ffi.c (ffi_prep_cif_machdep): Fix small struct
+	support.
+	* src/powerpc/sysv.S: Ditto.
+
+2013-02-08  Anthony Green <green@moxielogic.com>
+
+	* testsuite/libffi.call/cls_longdouble.c: Remove xfail for
+	arm*-*-*.
+
+2013-02-08  Anthony Green <green@moxielogic.com>
+
+	* src/sparc/ffi.c (ffi_prep_closure_loc): Fix cache flushing for GCC.
+
+2013-02-08  Matthias Klose  <doko@ubuntu.com>
+
+	* man/ffi_prep_cif.3: Clean up for debian linter.
+
+2013-02-08  Peter Bergner  <bergner@vnet.ibm.com>
+
+	* src/powerpc/ffi.c (ffi_prep_args_SYSV): Account for FP args pushed
+	on the stack.
+
+2013-02-08  Anthony Green <green@moxielogic.com>
+
+	* Makefile.am (EXTRA_DIST): Add missing files.
+	* testsuite/Makefile.am (EXTRA_DIST): Ditto.
+	* Makefile.in: Rebuilt.
+
+2013-02-08  Anthony Green <green@moxielogic.com>
+
+	* configure.ac: Move sparc asm config checks to within functions
+	for compatibility with sun tools.
+	* configure: Rebuilt.
+	* src/sparc/ffi.c (ffi_prep_closure_loc): Flush cache on v9
+	systems.
+	* src/sparc/v8.S (ffi_flush_icache): Implement a sparc v9 cache
+	flusher.
+
+2013-02-08  Nathan Rossi <nathan.rossi@xilinx.com>
+
+	* src/microblaze/ffi.c (ffi_closure_call_SYSV): Fix handling of
+	small big-endian structures.
+	(ffi_prep_args): Ditto.
+
+2013-02-07  Anthony Green <green@moxielogic.com>
+
+	* src/sparc/v8.S (ffi_call_v8): Fix typo from last patch
+	(effectively hiding ffi_call_v8).
+
+2013-02-07  Anthony Green <green@moxielogic.com>
+
+	* configure.ac: Update bug reporting address.
+	* configure.in: Rebuild.
+
+	* src/sparc/v8.S (ffi_flush_icache): Out-of-line cache flusher for
+	Sun compiler.
+	* src/sparc/ffi.c (ffi_call): Remove warning.
+	Call ffi_flush_icache for non-GCC builds.
+	(ffi_prep_closure_loc): Use ffi_flush_icache.
+
+	* Makefile.am (EXTRA_DIST): Add libtool-ldflags.
+	* Makefile.in: Rebuilt.
+	* libtool-ldflags: New file.
+
+2013-02-07  Daniel Schepler <dschepler@gmail.com>
+
+	* configure.ac: Correctly identify x32 systems as 64-bit.
+	* m4/libtool.m4: Remove libtool expr error.
+	* aclocal.m4, configure: Rebuilt.
+
+2013-02-07  Anthony Green <green@moxielogic.com>
+
+	* configure.ac: Fix GCC usage test.
+	* configure: Rebuilt.
+	* README: Mention LLVM/GCC x86_64 issue.
+	* testsuite/Makefile.in: Rebuilt.
+
+2013-02-07  Anthony Green <green@moxielogic.com>
+
+	* testsuite/libffi.call/cls_double_va.c (main): Replace // style
+	comments with /* */ for xlc compiler.
+	* testsuite/libffi.call/stret_large.c (main): Ditto.
+	* testsuite/libffi.call/stret_large2.c (main): Ditto.
+	* testsuite/libffi.call/nested_struct1.c (main): Ditto.
+	* testsuite/libffi.call/huge_struct.c (main): Ditto.
+	* testsuite/libffi.call/float_va.c (main): Ditto.
+	* testsuite/libffi.call/cls_struct_va1.c (main): Ditto.
+	* testsuite/libffi.call/cls_pointer_stack.c (main): Ditto.
+	* testsuite/libffi.call/cls_pointer.c (main): Ditto.
+	* testsuite/libffi.call/cls_longdouble_va.c (main): Ditto.
+
+2013-02-06  Anthony Green <green@moxielogic.com>
+
+	* man/ffi_prep_cif.3: Clean up for debian lintian checker.
+
+2013-02-06  Anthony Green <green@moxielogic.com>
+
+	* Makefile.am (pkgconfigdir): Add missing pkgconfig install bits.
+	* Makefile.in: Rebuild.
+
+2013-02-02  Mark H Weaver <mhw@netris.org>
+
+	* src/x86/ffi64.c (ffi_call): Sign-extend integer arguments passed
+	via general purpose registers.
+
+2013-01-21  Nathan Rossi <nathan.rossi@xilinx.com>
+
+	* README: Add MicroBlaze details.
+	* Makefile.am: Add MicroBlaze support.
+	* configure.ac: Likewise.
+	* src/microblaze/ffi.c: New.
+	* src/microblaze/ffitarget.h: Likewise.
+	* src/microblaze/sysv.S: Likewise.
+
+2013-01-21  Nathan Rossi <nathan.rossi@xilinx.com>
+	* testsuite/libffi.call/return_uc.c: Fixed issue.
+
+2013-01-21  Chris Zankel   <chris@zankel.net>
+
+	* README: Add Xtensa support.
+	* Makefile.am: Likewise.
+	* configure.ac: Likewise.
+	* Makefile.in Regenerate.
+	* configure: Likewise.
+	* src/prep_cif.c: Handle Xtensa.
+	* src/xtensa: New directory.
+	* src/xtensa/ffi.c: New file.
+	* src/xtensa/ffitarget.h: Ditto.
+	* src/xtensa/sysv.S: Ditto.
+
+2013-01-11  Anthony Green  <green@moxielogic.com>
+
+	* src/powerpc/ffi_darwin.c (ffi_prep_args): Replace // style
+	comments with /* */ for xlc compiler.
+	* src/powerpc/aix.S (ffi_call_AIX): Ditto.
+	* testsuite/libffi.call/ffitest.h (allocate_mmap): Delete
+	deprecated inline function.
+	* testsuite/libffi.special/ffitestcxx.h: Ditto.
+	* README: Add update for AIX support.
+
+2013-01-11  Anthony Green  <green@moxielogic.com>
+
+	* configure.ac: Robustify pc relative reloc check.
+	* m4/ax_cc_maxopt.m4: Don't -malign-double.  This is an ABI
+	changing option for 32-bit x86.
+	* aclocal.m4, configure: Rebuilt.
+	* README: Update supported target list.
+
+2013-01-10  Anthony Green  <green@moxielogic.com>
+
+	* README (tested): Add Compiler column to table.
+
+2013-01-10  Anthony Green  <green@moxielogic.com>
+
+	* src/x86/ffi64.c (struct register_args): Make sse array and array
+	of unions for sunpro compiler compatibility.
+
+2013-01-10  Anthony Green  <green@moxielogic.com>
+
+	* configure.ac: Test target platform size_t size.  Handle both 32
+	and 64-bit builds for x86_64-* and i?86-* targets (allowing for
+	CFLAG option to change default settings).
+	* configure, aclocal.m4: Rebuilt.
+
+2013-01-10  Anthony Green  <green@moxielogic.com>
+
+	* testsuite/libffi.special/special.exp: Only run exception
+	handling tests when using GNU compiler.
+
+	* m4/ax_compiler_vendor.m4: New file.
+	* configure.ac: Test for compiler vendor and don't use
+	AX_CFLAGS_WARN_ALL with the sun compiler.
+	* aclocal.m4, configure: Rebuilt.
+
+2013-01-10  Anthony Green  <green@moxielogic.com>
+
+	* include/ffi_common.h: Don't use GCCisms to define types when
+	building with the SUNPRO compiler.
+
+2013-01-10  Anthony Green  <green@moxielogic.com>
+
+	* configure.ac: Put local.exp in the right place.
+	* configure: Rebuilt.
+
+	* src/x86/ffi.c: Update comment about regparm function attributes.
+	* src/x86/sysv.S (ffi_closure_SYSV): The SUNPRO compiler requires
+	that all function arguments be passed on the stack (no regparm
+	support).
+
+2013-01-08  Anthony Green  <green@moxielogic.com>
+
+	* configure.ac: Generate local.exp.  This sets CC_FOR_TARGET
+	when we are using the vendor compiler.
+	* testsuite/Makefile.am (EXTRA_DEJAGNU_SITE_CONFIG): Point to
+	../local.exp.
+	* configure, testsuite/Makefile.in: Rebuilt.
+
+	* testsuite/libffi.call/call.exp: Run tests with different
+	options, depending on whether or not we are using gcc or the
+	vendor compiler.
+	* testsuite/lib/libffi.exp (libffi-init): Set using_gcc based on
+	whether or not we are building/testing with gcc.
+
+2013-01-08  Anthony Green  <green@moxielogic.com>
+
+	* configure.ac: Switch x86 solaris target to X86 by default.
+	* configure: Rebuilt.
+
+2013-01-08  Anthony Green  <green@moxielogic.com>
+
+	* configure.ac: Fix test for read-only eh_frame.
+	* configure: Rebuilt.
+
+2013-01-08  Anthony Green  <green@moxielogic.com>
+
+	* src/x86/sysv.S, src/x86/unix64.S: Only emit DWARF unwind info
+	when building with the GNU toolchain.
+	* testsuite/libffi.call/ffitest.h (CHECK): Fix for Solaris vendor
+	compiler.
+
+2013-01-07  Thorsten Glaser <tg@mirbsd.org>
+
+	* testsuite/libffi.call/cls_uchar_va.c,
+	testsuite/libffi.call/cls_ushort_va.c,
+	testsuite/libffi.call/va_1.c: Testsuite fixes.
+
+2013-01-07  Thorsten Glaser <tg@mirbsd.org>
+
+	* src/m68k/ffi.c (CIF_FLAGS_SINT8, CIF_FLAGS_SINT16): Define.
+	(ffi_prep_cif_machdep): Fix 8-bit and 16-bit signed calls.
+	* src/m68k/sysv.S (ffi_call_SYSV, ffi_closure_SYSV): Ditto.
+
+2013-01-04  Anthony Green  <green@moxielogic.com>
+
+	* Makefile.am (AM_CFLAGS): Don't automatically add -fexceptions
+	and -Wall.  This is set in the configure script after testing for
+	GCC.
+	* Makefile.in: Rebuilt.
+
+2013-01-02  rofl0r <https://github.com/rofl0r>
+
+	* src/powerpc/ffi.c (ffi_prep_cif_machdep): Fix build error on ppc
+	when long double == double.
+
+2013-01-02  Reini Urban  <rurban@x-ray.at>
+
+	* Makefile.am (libffi_la_LDFLAGS): Add -no-undefined to LDFLAGS
+	(required for shared libs on cygwin/mingw).
+	* Makefile.in: Rebuilt.
+
+2012-10-31  Alan Modra  <amodra@gmail.co>
+
+	* src/powerpc/linux64_closure.S: Add new ABI support.
+	* src/powerpc/linux64.S: Likewise.
+
+2012-10-30  Magnus Granberg  <zorry@gentoo.org>
+	    Pavel Labushev  <pavel.labushev@runbox.ru>
+
+	* configure.ac: New options pax_emutramp
+	* configure, fficonfig.h.in: Regenerated
+	* src/closures.c: New function emutramp_enabled_check() and
+	checks.
+
+2012-10-30  Frederick Cheung  <frederick.cheung@gmail.com>
+
+	* configure.ac: Enable FFI_MAP_EXEC_WRIT for Darwin 12 (mountain
+	lion) and future version.
+	* configure: Rebuild.
+
+2012-10-30  James Greenhalgh  <james.greenhalgh at arm.com>
+            Marcus Shawcroft  <marcus.shawcroft at arm.com>
+
+        * README: Add details of aarch64 port.
+        * src/aarch64/ffi.c: New.
+        * src/aarch64/ffitarget.h: Likewise.
+        * src/aarch64/sysv.S: Likewise.
+	* Makefile.am: Support aarch64.
+	* configure.ac: Support aarch64.
+	* Makefile.in, configure: Rebuilt.
+
+2012-10-30  James Greenhalgh  <james.greenhalgh at arm.com>
+            Marcus Shawcroft  <marcus.shawcroft at arm.com>
+
+        * testsuite/lib/libffi.exp: Add support for aarch64.
+        * testsuite/libffi.call/cls_struct_va1.c: New.
+        * testsuite/libffi.call/cls_uchar_va.c: Likewise.
+        * testsuite/libffi.call/cls_uint_va.c: Likewise.
+        * testsuite/libffi.call/cls_ulong_va.c: Likewise.
+        * testsuite/libffi.call/cls_ushort_va.c: Likewise.
+        * testsuite/libffi.call/nested_struct11.c: Likewise.
+        * testsuite/libffi.call/uninitialized.c: Likewise.
+        * testsuite/libffi.call/va_1.c: Likewise.
+        * testsuite/libffi.call/va_struct1.c: Likewise.
+        * testsuite/libffi.call/va_struct2.c: Likewise.
+        * testsuite/libffi.call/va_struct3.c: Likewise.
+
+2012-10-12  Walter Lee  <walt@tilera.com>
+
+        * Makefile.am: Add TILE-Gx/TILEPro support.
+        * configure.ac: Likewise.
+        * Makefile.in: Regenerate.
+        * configure: Likewise.
+        * src/prep_cif.c (ffi_prep_cif_core): Handle TILE-Gx/TILEPro.
+        * src/tile: New directory.
+        * src/tile/ffi.c: New file.
+        * src/tile/ffitarget.h: Ditto.
+        * src/tile/tile.S: Ditto.
+
+2012-10-12  Matthias Klose  <doko@ubuntu.com>
+
+	* generate-osx-source-and-headers.py: Normalize whitespace.
+
+2012-09-14  David Edelsohn  <dje.gcc@gmail.com>
+
+	* configure: Regenerated.
+
+2012-08-26  Andrew Pinski  <apinski@cavium.com>
+
+	PR libffi/53014
+	* src/mips/ffi.c (ffi_prep_closure_loc): Allow n32 with soft-float and n64 with
+	soft-float.
+
+2012-08-08  Uros Bizjak  <ubizjak@gmail.com>
+
+	* src/s390/ffi.c (ffi_prep_closure_loc): Don't ASSERT ABI test,
+	just return FFI_BAD_ABI when things are wrong.
+
+2012-07-18  H.J. Lu  <hongjiu.lu@intel.com>
+
+	PR libffi/53982
+	PR libffi/53973
+	* src/x86/ffitarget.h: Check __ILP32__ instead of __LP64__ for x32.
+	(FFI_SIZEOF_JAVA_RAW): Defined to 4 for x32.
+
+2012-05-16  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* configure: Regenerated.
+
+2012-05-05  Nicolas Lelong
+
+	* libffi.xcodeproj/project.pbxproj: Fixes.
+	* README: Update for iOS builds.
+
+2012-04-23  Alexandre Keunecke I. de Mendonca <alexandre.keunecke@gmail.com>
+
+	* configure.ac: Add Blackfin/sysv support
+	* Makefile.am: Add Blackfin/sysv support
+	* src/bfin/ffi.c:  Add Blackfin/sysv support
+	* src/bfin/ffitarget.h: Add Blackfin/sysv support
+
+2012-04-11  Anthony Green  <green@moxielogic.com>
+
+	* Makefile.am (EXTRA_DIST): Add new script.
+	* Makefile.in: Rebuilt.
+
+2012-04-11  Zachary Waldowski  <zwaldowski@gmail.com>
+
+	* generate-ios-source-and-headers.py,
+	libffi.xcodeproj/project.pbxproj: Support a Mac static library via
+	Xcode. Set iOS compatibility to 4.0.  Move iOS trampoline
+	generation into an Xcode "run script" phase.  Include both as
+	Xcode build scripts. Don't always regenerate config files.
+
+2012-04-10  Anthony Green  <green@moxielogic.com>
+
+	* src/powerpc/ffi_darwin.c (ffi_prep_args): Add missing semicolon.
+
+2012-04-06  Anthony Green  <green@moxielogic.com>
+
+	* Makefile.am (EXTRA_DIST): Add new iOS/xcode files.
+	* Makefile.in: Rebuilt.
+
+2012-04-06  Mike Lewis  <mikelikespie@gmail.com>
+
+	* generate-ios-source-and-headers.py: New file.
+	* libffi.xcodeproj/project.pbxproj: New file.
+	* README: Update instructions on building iOS binary.
+	* build-ios.sh: Delete.
+
+2012-04-06  Anthony Green  <green@moxielogic.com>
+
+	* src/x86/ffi64.c (UINT128): Define differently for Intel and GNU
+	compilers, then use it.
+
+2012-04-06  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* m4/libtool.m4 (_LT_ENABLE_LOCK): Support x32.
+
+2012-04-06  Anthony Green  <green@moxielogic.com>
+
+	* testsuite/Makefile.am (EXTRA_DIST): Add missing test cases.
+	* testsuite/Makefile.in: Rebuilt.
+
+2012-04-05  Zachary Waldowski  <zwaldowski@gmail.com>
+
+	* include/ffi.h.in: Add missing trampoline table fields.
+	* src/arm/sysv.S: Fix ENTRY definition, and wrap symbol references
+	in CNAME.
+	* src/x86/ffi.c: Wrap Windows specific code in ifdefs.
+
+2012-04-02  Peter Bergner  <bergner@vnet.ibm.com>
+
+	* src/powerpc/ffi.c (ffi_prep_args_SYSV): Declare double_tmp.
+	Silence casting pointer to integer of different size warning.
+	Delete goto to previously deleted label.
+	(ffi_call): Silence possibly undefined warning.
+	(ffi_closure_helper_SYSV): Declare variable type.
+
+2012-04-02  Peter Rosin  <peda@lysator.liu.se>
+
+	* src/x86/win32.S (ffi_call_win32): Sign/zero extend the return
+	value in the Intel version as is already done for the AT&T version.
+	(ffi_closure_SYSV): Likewise.
+	(ffi_closure_raw_SYSV): Likewise.
+	(ffi_closure_STDCALL): Likewise.
+
+2012-03-29  Peter Rosin  <peda@lysator.liu.se>
+
+	* src/x86/win32.S (ffi_closure_raw_THISCALL): Unify the frame
+	generation, fix the ENDP label and remove the surplus third arg
+	from the 'lea' insn.
+
+2012-03-29  Peter Rosin  <peda@lysator.liu.se>
+
+	* src/x86/win32.S (ffi_closure_raw_SYSV): Make the 'stubraw' label
+	visible outside the PROC, so that ffi_closure_raw_THISCALL can see
+	it.  Also instruct the assembler to add a frame to the function.
+
+2012-03-23  Peter Rosin  <peda@lysator.liu.se>
+
+	* Makefile.am (AM_CPPFLAGS): Add -DFFI_BUILDING.
+	* Makefile.in: Rebuilt.
+	* include/ffi.h.in [MSVC]: Add __declspec(dllimport) decorations
+	to all data exports, when compiling libffi clients using MSVC.
+
+2012-03-29  Peter Rosin  <peda@lysator.liu.se>
+
+	* src/x86/ffitarget.h (ffi_abi): Add new ABI FFI_MS_CDECL and
+	make it the default for MSVC.
+	(FFI_TYPE_MS_STRUCT): New structure return convention.
+	* src/x86/ffi.c (ffi_prep_cif_machdep): Tweak the structure
+	return convention for FFI_MS_CDECL to be FFI_TYPE_MS_STRUCT
+	instead of an ordinary FFI_TYPE_STRUCT.
+	(ffi_prep_args): Treat FFI_TYPE_MS_STRUCT as FFI_TYPE_STRUCT.
+	(ffi_call): Likewise.
+	(ffi_prep_incoming_args_SYSV): Likewise.
+	(ffi_raw_call): Likewise.
+	(ffi_prep_closure_loc): Treat FFI_MS_CDECL as FFI_SYSV.
+	* src/x86/win32.S (ffi_closure_SYSV): For FFI_TYPE_MS_STRUCT,
+	return a pointer to the result structure in eax and don't pop
+	that pointer from the stack, the caller takes care of it.
+	(ffi_call_win32): Treat FFI_TYPE_MS_STRUCT as FFI_TYPE_STRUCT.
+	(ffi_closure_raw_SYSV): Likewise.
+
+2012-03-22  Peter Rosin  <peda@lysator.liu.se>
+
+	* testsuite/libffi.call/closure_stdcall.c [MSVC]: Add inline
+	assembly version with Intel syntax.
+	* testsuite/libffi.call/closure_thiscall.c [MSVC]: Likewise.
+
+2012-03-23  Peter Rosin  <peda@lysator.liu.se>
+
+	* testsuite/libffi.call/ffitest.h: Provide abstration of
+	__attribute__((fastcall)) in the form of a __FASTCALL__
+	define.  Define it to __fastcall for MSVC.
+	* testsuite/libffi.call/fastthis1_win32.c: Use the above.
+	* testsuite/libffi.call/fastthis2_win32.c: Likewise.
+	* testsuite/libffi.call/fastthis3_win32.c: Likewise.
+	* testsuite/libffi.call/strlen2_win32.c: Likewise.
+	* testsuite/libffi.call/struct1_win32.c: Likewise.
+	* testsuite/libffi.call/struct2_win32.c: Likewise.
+
+2012-03-22  Peter Rosin  <peda@lysator.liu.se>
+
+	* src/x86/win32.S [MSVC] (ffi_closure_THISCALL): Remove the manual
+	frame on function entry, MASM adds one automatically.
+
+2012-03-22  Peter Rosin  <peda@lysator.liu.se>
+
+	* testsuite/libffi.call/ffitest.h [MSVC]: Add kludge for missing
+	bits in the MSVC headers.
+
+2012-03-22  Peter Rosin  <peda@lysator.liu.se>
+
+	* testsuite/libffi.call/cls_12byte.c: Adjust to the C89 style
+	with no declarations after statements.
+	* testsuite/libffi.call/cls_16byte.c: Likewise.
+	* testsuite/libffi.call/cls_18byte.c: Likewise.
+	* testsuite/libffi.call/cls_19byte.c: Likewise.
+	* testsuite/libffi.call/cls_1_1byte.c: Likewise.
+	* testsuite/libffi.call/cls_20byte.c: Likewise.
+	* testsuite/libffi.call/cls_20byte1.c: Likewise.
+	* testsuite/libffi.call/cls_24byte.c: Likewise.
+	* testsuite/libffi.call/cls_2byte.c: Likewise.
+	* testsuite/libffi.call/cls_3_1byte.c: Likewise.
+	* testsuite/libffi.call/cls_3byte1.c: Likewise.
+	* testsuite/libffi.call/cls_3byte2.c: Likewise.
+	* testsuite/libffi.call/cls_4_1byte.c: Likewise.
+	* testsuite/libffi.call/cls_4byte.c: Likewise.
+	* testsuite/libffi.call/cls_5_1_byte.c: Likewise.
+	* testsuite/libffi.call/cls_5byte.c: Likewise.
+	* testsuite/libffi.call/cls_64byte.c: Likewise.
+	* testsuite/libffi.call/cls_6_1_byte.c: Likewise.
+	* testsuite/libffi.call/cls_6byte.c: Likewise.
+	* testsuite/libffi.call/cls_7_1_byte.c: Likewise.
+	* testsuite/libffi.call/cls_7byte.c: Likewise.
+	* testsuite/libffi.call/cls_8byte.c: Likewise.
+	* testsuite/libffi.call/cls_9byte1.c: Likewise.
+	* testsuite/libffi.call/cls_9byte2.c: Likewise.
+	* testsuite/libffi.call/cls_align_double.c: Likewise.
+	* testsuite/libffi.call/cls_align_float.c: Likewise.
+	* testsuite/libffi.call/cls_align_longdouble.c: Likewise.
+	* testsuite/libffi.call/cls_align_longdouble_split.c: Likewise.
+	* testsuite/libffi.call/cls_align_longdouble_split2.c: Likewise.
+	* testsuite/libffi.call/cls_align_pointer.c: Likewise.
+	* testsuite/libffi.call/cls_align_sint16.c: Likewise.
+	* testsuite/libffi.call/cls_align_sint32.c: Likewise.
+	* testsuite/libffi.call/cls_align_sint64.c: Likewise.
+	* testsuite/libffi.call/cls_align_uint16.c: Likewise.
+	* testsuite/libffi.call/cls_align_uint32.c: Likewise.
+	* testsuite/libffi.call/cls_align_uint64.c: Likewise.
+	* testsuite/libffi.call/cls_dbls_struct.c: Likewise.
+	* testsuite/libffi.call/cls_pointer_stack.c: Likewise.
+	* testsuite/libffi.call/err_bad_typedef.c: Likewise.
+	* testsuite/libffi.call/huge_struct.c: Likewise.
+	* testsuite/libffi.call/nested_struct.c: Likewise.
+	* testsuite/libffi.call/nested_struct1.c: Likewise.
+	* testsuite/libffi.call/nested_struct10.c: Likewise.
+	* testsuite/libffi.call/nested_struct2.c: Likewise.
+	* testsuite/libffi.call/nested_struct3.c: Likewise.
+	* testsuite/libffi.call/nested_struct4.c: Likewise.
+	* testsuite/libffi.call/nested_struct5.c: Likewise.
+	* testsuite/libffi.call/nested_struct6.c: Likewise.
+	* testsuite/libffi.call/nested_struct7.c: Likewise.
+	* testsuite/libffi.call/nested_struct8.c: Likewise.
+	* testsuite/libffi.call/nested_struct9.c: Likewise.
+	* testsuite/libffi.call/stret_large.c: Likewise.
+	* testsuite/libffi.call/stret_large2.c: Likewise.
+	* testsuite/libffi.call/stret_medium.c: Likewise.
+	* testsuite/libffi.call/stret_medium2.c: Likewise.
+	* testsuite/libffi.call/struct1.c: Likewise.
+	* testsuite/libffi.call/struct1_win32.c: Likewise.
+	* testsuite/libffi.call/struct2.c: Likewise.
+	* testsuite/libffi.call/struct2_win32.c: Likewise.
+	* testsuite/libffi.call/struct3.c: Likewise.
+	* testsuite/libffi.call/struct4.c: Likewise.
+	* testsuite/libffi.call/struct5.c: Likewise.
+	* testsuite/libffi.call/struct6.c: Likewise.
+	* testsuite/libffi.call/struct7.c: Likewise.
+	* testsuite/libffi.call/struct8.c: Likewise.
+	* testsuite/libffi.call/struct9.c: Likewise.
+	* testsuite/libffi.call/testclosure.c: Likewise.
+
+2012-03-21  Peter Rosin	 <peda@lysator.liu.se>
+
+	* testsuite/libffi.call/float_va.c (float_va_fn): Use %f when
+	printing doubles (%lf is for long doubles).
+	(main): Likewise.
+
+2012-03-21  Peter Rosin  <peda@lysator.liu.se>
+
+	* testsuite/lib/target-libpath.exp [*-*-cygwin*, *-*-mingw*]
+	(set_ld_library_path_env_vars): Add the library search dir to PATH
+	(and save PATH for later).
+	(restore_ld_library_path_env_vars): Restore PATH.
+
+2012-03-21  Peter Rosin  <peda@lysator.liu.se>
+
+	* testsuite/lib/target-libpath.exp [*-*-cygwin*, *-*-mingw*]
+	(set_ld_library_path_env_vars): Add the library search dir to PATH
+	(and save PATH for later).
+	(restore_ld_library_path_env_vars): Restore PATH.
+
+2012-03-20  Peter Rosin  <peda@lysator.liu.se>
+
+	* testsuite/libffi.call/strlen2_win32.c (main): Remove bug.
+	* src/x86/win32.S [MSVC] (ffi_closure_SYSV): Make the 'stub' label
+	visible outside the PROC, so that ffi_closure_THISCALL can see it.
+
+2012-03-20  Peter Rosin  <peda@lysator.liu.se>
+
+	* testsuite/libffi.call/strlen2_win32.c (main): Remove bug.
+	* src/x86/win32.S [MSVC] (ffi_closure_SYSV): Make the 'stub' label
+	visible outside the PROC, so that ffi_closure_THISCALL can see it.
+
+2012-03-19  Alan Hourihane  <alanh@fairlite.co.uk>
+
+	* src/m68k/ffi.c: Add MINT support.
+	* src/m68k/sysv.S: Ditto.
+
+2012-03-06  Chung-Lin Tang  <cltang@codesourcery.com>
+
+	* src/arm/ffi.c (ffi_call): Add __ARM_EABI__ guard around call to
+	ffi_call_VFP().
+	(ffi_prep_closure_loc): Add __ARM_EABI__ guard around use of
+	ffi_closure_VFP.
+	* src/arm/sysv.S: Add __ARM_EABI__ guard around VFP code.
+
+2012-03-19  chennam  <csit@axway.com>
+
+	* src/powerpc/ffi_darwin.c (ffi_prep_closure_loc): Fix AIX closure
+	support.
+
+2012-03-13  Kaz Kojima  <kkojima@gcc.gnu.org>
+
+	* src/sh/ffi.c (ffi_prep_closure_loc): Don't ASSERT ABI test,
+	just return FFI_BAD_ABI when things are wrong.
+	* src/sh64/ffi.c (ffi_prep_closure_loc): Ditto.
+
+2012-03-09  David Edelsohn  <dje.gcc@gmail.com>
+
+	* src/powerpc/aix_closure.S (ffi_closure_ASM): Adjust for Darwin64
+	change to return value of ffi_closure_helper_DARWIN and load type
+	from return type.
+
+2012-03-03  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* src/x86/ffi64.c (ffi_call): Cast the return value to unsigned
+	long.
+	(ffi_prep_closure_loc): Cast to 64bit address in trampoline.
+	(ffi_closure_unix64_inner): Cast return pointer to unsigned long
+	first.
+
+	* src/x86/ffitarget.h (FFI_SIZEOF_ARG): Defined to 8 for x32.
+	(ffi_arg): Set to unsigned long long for x32.
+	(ffi_sarg): Set to long long for x32.
+
+2012-03-03  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* src/prep_cif.c (ffi_prep_cif_core): Properly check bad ABI.
+
+2012-03-03  Andoni Morales Alastruey  <ylatuya@gmail.com>
+
+	* configure.ac: Add -no-undefined for both 32- and 64-bit x86
+	windows-like hosts.
+	* configure: Rebuilt.
+
+2012-02-27  Mikael Pettersson  <mikpe@it.uu.se>
+
+	PR libffi/52223
+	* Makefile.am (FLAGS_TO_PASS): Define.
+	* Makefile.in: Regenerate.
+
+2012-02-23  Anthony Green  <green@moxielogic.com>
+
+	* src/*/ffitarget.h: Ensure that users never include ffitarget.h
+	directly.
+
+2012-02-23  Kai Tietz  <ktietz@redhat.com>
+
+	PR libffi/52221
+	* src/x86/ffi.c (ffi_closure_raw_THISCALL): New
+	prototype.
+	(ffi_prep_raw_closure_loc): Use ffi_closure_raw_THISCALL for
+	thiscall-convention.
+	(ffi_raw_call): Use ffi_prep_args_raw.
+	* src/x86/win32.S (ffi_closure_raw_THISCALL): Add
+	implementation for stub.
+
+2012-02-10  Kai Tietz  <ktietz@redhat.com>
+
+	* configure.ac (AM_LTLDFLAGS): Add -no-undefine for x64
+	windows target.
+	* configure: Regenerated.
+
+2012-02-08  Kai Tietz  <ktietz@redhat.com>
+
+	* src/prep_cif.c (ffi_prep_cif): Allow for X86_WIN32
+	also FFI_THISCALL.
+	* src/x86/ffi.c (ffi_closure_THISCALL): Add prototype.
+	(FFI_INIT_TRAMPOLINE_THISCALL): New trampoline code.
+	(ffi_prep_closure_loc): Add FFI_THISCALL support.
+	* src/x86/ffitarget.h (FFI_TRAMPOLINE_SIZE): Adjust size.
+	* src/x86/win32.S (ffi_closure_THISCALL): New closure code
+	for thiscall-calling convention.
+	* testsuite/libffi.call/closure_thiscall.c: New test.
+
+2012-01-28  Kai Tietz  <ktietz@redhat.com>
+
+	* src/libffi/src/x86/ffi.c (ffi_call_win32): Add new
+	argument to prototype for specify calling-convention.
+	(ffi_call): Add support for stdcall/thiscall convention.
+	(ffi_prep_args): Likewise.
+	(ffi_raw_call): Likewise.
+	* src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and
+	FFI_FASTCALL.
+	* src/x86/win32.S (_ffi_call_win32): Add support for
+	fastcall/thiscall calling-convention calls.
+	* testsuite/libffi.call/fastthis1_win32.c: New test.
+	* testsuite/libffi.call/fastthis2_win32.c: New test.
+	* testsuite/libffi.call/fastthis3_win32.c: New test.
+	* testsuite/libffi.call/strlen2_win32.c: New test.
+	* testsuite/libffi.call/many2_win32.c: New test.
+	* testsuite/libffi.call/struct1_win32.c: New test.
+	* testsuite/libffi.call/struct2_win32.c: New test.
+
+2012-01-23  Uros Bizjak  <ubizjak@gmail.com>
+
+	* src/alpha/ffi.c (ffi_prep_closure_loc): Check for bad ABI.
+
+2012-01-23  Anthony Green  <green@moxielogic.com>
+	    Chris Young  <cdyoung@ntlworld.com>
+
+	* configure.ac: Add Amiga support.
+	* configure: Rebuilt.
+
+2012-01-23  Dmitry Nadezhin  <dmitry.nadezhin@gmail.com>
+
+	* include/ffi_common.h (LIKELY, UNLIKELY): Fix definitions.
+
+2012-01-23  Andreas Schwab  <schwab@linux-m68k.org>
+
+	* src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain
+	mc68000.  Test for __HAVE_68881__ in addition to __MC68881__.
+
+2012-01-19  Jakub Jelinek  <jakub@redhat.com>
+
+	PR rtl-optimization/48496
+	* src/ia64/ffi.c (ffi_call): Fix up aliasing violations.
+
+2012-01-09  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+	* configure.ac (i?86-*-*): Set TARGET to X86_64.
+	* configure: Regenerate.
+
+2011-12-07  Andrew Pinski  <apinski@cavium.com>
+
+	PR libffi/50051
+	* src/mips/n32.S: Add ".set mips4".
+
+2011-11-21  Andreas Tobler  <andreast@fgznet.ch>
+
+	* configure: Regenerate.
+
+2011-11-12  David Gilbert <david.gilbert@linaro.org>
+
+	* doc/libffi.texi, include/ffi.h.in, include/ffi_common.h,
+	man/Makefile.am, man/ffi.3, man/ffi_prep_cif.3,
+	man/ffi_prep_cif_var.3, src/arm/ffi.c, src/arm/ffitarget.h,
+	src/cris/ffi.c, src/prep_cif.c,
+	testsuite/libffi.call/cls_double_va.c,
+	testsuite/libffi.call/cls_longdouble_va.c,
+	testsuite/libffi.call/float_va.c: Many changes to support variadic
+	function calls.
+
+2011-11-12  Kyle Moffett <Kyle.D.Moffett@boeing.com>
+
+	* src/powerpc/ffi.c, src/powerpc/ffitarget.h,
+	src/powerpc/ppc_closure.S, src/powerpc/sysv.S: Many changes for
+	softfloat powerpc variants.
+
+2011-11-12  Petr Salinger <Petr.Salinger@seznam.cz>
+
+	* configure.ac (FFI_EXEC_TRAMPOLINE_TABLE): Fix kfreebsd support.
+	* configure: Rebuilt.
+
+2011-11-12  Timothy Wall  <twall@users.sf.net>
+
+	* src/arm/ffi.c (ffi_prep_args, ffi_prep_incoming_args_SYSV): Max
+	alignment of 4 for wince on ARM.
+
+2011-11-12  Kyle Moffett <Kyle.D.Moffett@boeing.com>
+	    Anthony Green <green@moxielogic.com>
+
+	* src/ppc/sysv.S, src/ppc/ffi.c: Remove use of ppc string
+	instructions (not available on some cores, like the PPC440).
+
+2011-11-12  Kimura Wataru  <kimuraw@i.nifty.jp>
+
+	* m4/ax_enable_builddir: Change from string comparison to numeric
+	comparison for wc output.
+	* configure.ac: Enable FFI_MMAP_EXEC_WRIT for darwin11 aka Mac OS
+	X 10.7.
+	* configure: Rebuilt.
+
+2011-11-12  Anthony Green  <green@moxielogic.com>
+
+	* Makefile.am (AM_CCASFLAGS): Add -g option to build assembly
+	files with debug info.
+	* Makefile.in: Rebuilt.
+
+2011-11-12  Jasper Lievisse Adriaanse <jasper@openbsd.org>
+
+	* README: Update list of supported OpenBSD systems.
+
+2011-11-12  Anthony Green  <green@moxielogic.com>
+
+	* libtool-version: Update.
+	* Makefile.am (nodist_libffi_la_SOURCES): Add src/debug.c if
+	FFI_DEBUG.
+	(libffi_la_SOURCES): Remove src/debug.c
+	(EXTRA_DIST): Add src/debug.c
+	* Makefile.in: Rebuilt.
+	* README: Update for 3.0.11.
+
+2011-11-10  Richard Henderson  <rth@redhat.com>
+
+	* configure.ac (GCC_AS_CFI_PSEUDO_OP): Use it instead of inline check.
+	* configure, aclocal.m4: Rebuild.
+
+2011-09-04  Iain Sandoe  <iains@gcc.gnu.org>
+
+	PR libffi/49594
+	* src/powerpc/darwin_closure.S (stubs): Make the stub binding
+	helper reference track the architecture pointer size.
+
+2011-08-25  Andrew Haley  <aph@redhat.com>
+
+	* src/arm/ffi.c (FFI_INIT_TRAMPOLINE): Remove hard-coded assembly
+	instructions.
+	* src/arm/sysv.S (ffi_arm_trampoline): Put them here instead.
+
+2011-07-11  Andrew Haley  <aph@redhat.com>
+
+        * src/arm/ffi.c (FFI_INIT_TRAMPOLINE): Clear icache.
+
+2011-06-29  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+	* testsuite/libffi.call/cls_double_va.c: Move PR number to comment.
+	* testsuite/libffi.call/cls_longdouble_va.c: Likewise.
+
+2011-06-29  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+	PR libffi/46660
+	* testsuite/libffi.call/cls_double_va.c: xfail dg-output on
+	mips-sgi-irix6*.
+	* testsuite/libffi.call/cls_longdouble_va.c: Likewise.
+
+2011-06-14  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+	* testsuite/libffi.call/huge_struct.c (test_large_fn): Use PRIu8,
+	PRId8 instead of %hhu, %hhd.
+	* testsuite/libffi.call/ffitest.h [__alpha__ && __osf__] (PRId8,
+	PRIu8): Define.
+	[__sgi__] (PRId8, PRIu8): Define.
+
+2011-04-29  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+	* src/alpha/osf.S (UA_SI, FDE_ENCODING, FDE_ENCODE, FDE_ARANGE):
+	Define.
+	Use them to handle ELF vs. ECOFF differences.
+	[__osf__] (_GLOBAL__F_ffi_call_osf): Define.
+
+2011-03-30  Timothy Wall  <twall@users.sf.net>
+
+	* src/powerpc/darwin.S: Fix unknown FDE encoding.
+	* src/powerpc/darwin_closure.S: ditto.
+
+2011-02-25  Anthony Green  <green@moxielogic.com>
+
+	* src/powerpc/ffi.c (ffi_prep_closure_loc): Allow for more
+	32-bit ABIs.
+
+2011-02-15  Anthony Green  <green@moxielogic.com>
+
+	* m4/ax_cc_maxopt.m4: Don't -malign-double or use -ffast-math.
+	* configure: Rebuilt.
+
+2011-02-13  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+	* configure: Regenerate.
+
+2011-02-13  Anthony Green  <green@moxielogic.com>
+
+	* include/ffi_common.h (UNLIKELY, LIKELY): Define.
+	* src/x86/ffi64.c (UNLIKELY, LIKELY): Remove definition.
+	* src/prep_cif.c (UNLIKELY, LIKELY): Remove definition.
+
+	* src/prep_cif.c (initialize_aggregate): Convert assertion into
+	FFI_BAD_TYPEDEF return.  Initialize arg size and alignment to 0.
+
+	* src/pa/ffi.c (ffi_prep_closure_loc): Don't ASSERT ABI test,
+	just return FFI_BAD_ABI when things are wrong.
+	* src/arm/ffi.c (ffi_prep_closure_loc): Ditto.
+	* src/powerpc/ffi.c (ffi_prep_closure_loc): Ditto.
+	* src/mips/ffi.c (ffi_prep_closure_loc): Ditto.
+	* src/ia64/ffi.c (ffi_prep_closure_loc): Ditto.
+	* src/avr32/ffi.c (ffi_prep_closure_loc): Ditto.
+
+2011-02-11  Anthony Green  <green@moxielogic.com>
+
+	* src/sparc/ffi.c (ffi_prep_closure_loc): Don't ASSERT ABI test,
+	just return FFI_BAD_ABI when things are wrong.
+
+2012-02-11  Eric Botcazou  <ebotcazou@adacore.com>
+
+	* src/sparc/v9.S (STACKFRAME): Bump to 176.
+
+2011-02-09  Stuart Shelton  <srcshelton@gmail.com>
+
+	http://bugs.gentoo.org/show_bug.cgi?id=286911
+	* src/mips/ffitarget.h: Clean up error messages.
+	* src/java_raw_api.c (ffi_java_translate_args): Cast raw arg to
+	ffi_raw*.
+	* include/ffi.h.in: Add pragma for SGI compiler.
+
+2011-02-09  Anthony Green  <green@moxielogic.com>
+
+	* configure.ac: Add powerpc64-*-darwin* support.
+
+2011-02-09  Anthony Green <green@moxielogic.com>
+
+	* README: Mention Interix.
+
+2011-02-09  Jonathan Callen  <abcd@gentoo.org>
+
+	* configure.ac: Add Interix to win32/cygwin/mingw case.
+	* configure: Ditto.
+	* src/closures.c: Treat Interix like Cygwin, instead of as a
+	generic win32.
+
+2011-02-09  Anthony Green <green@moxielogic.com>
+
+	* testsuite/libffi.call/err_bad_typedef.c: Remove xfail.
+	* testsuite/libffi.call/err_bad_abi.c: Remove xfail.
+	* src/x86/ffi64.c (UNLIKELY, LIKELY): Define.
+	(ffi_prep_closure_loc): Check for bad ABI.
+	* src/prep_cif.c (UNLIKELY, LIKELY): Define.
+	(initialize_aggregate): Check for bad types.
+
+2011-02-09  Landon Fuller <landonf@plausible.coop>
+
+	* Makefile.am (EXTRA_DIST): Add build-ios.sh, src/arm/gentramp.sh,
+	src/arm/trampoline.S.
+	(nodist_libffi_la_SOURCES): Add src/arc/trampoline.S.
+	* configure.ac (FFI_EXEC_TRAMPOLINE_TABLE): Define.
+	* src/arm/ffi.c (ffi_trampoline_table)
+	(ffi_closure_trampoline_table_page, ffi_trampoline_table_entry)
+	(FFI_TRAMPOLINE_CODELOC_CONFIG, FFI_TRAMPOLINE_CONFIG_PAGE_OFFSET)
+	(FFI_TRAMPOLINE_COUNT, ffi_trampoline_lock, ffi_trampoline_tables)
+	(ffi_trampoline_table_alloc, ffi_closure_alloc, ffi_closure_free):
+	Define for FFI_EXEC_TRAMPOLINE_TABLE case (iOS).
+	(ffi_prep_closure_loc): Handl FFI_EXEC_TRAMPOLINE_TABLE case
+	separately.
+	* src/arm/sysv.S: Handle Apple iOS host.
+	* src/closures.c: Handle FFI_EXEC_TRAMPOLINE_TABLE case.
+	* build-ios.sh: New file.
+	* fficonfig.h.in, configure, Makefile.in: Rebuilt.
+	* README: Mention ARM iOS.
+
+2011-02-08  Oren Held  <orenhe@il.ibm.com>
+
+	* src/dlmalloc.c (_STRUCT_MALLINFO): Define in order to avoid
+	redefinition of mallinfo on HP-UX.
+
+2011-02-08  Ginn Chen  <ginn.chen@oracle.com>
+
+	* src/sparc/ffi.c (ffi_call): Make compatible with Solaris Studio
+	aggregate return ABI.  Flush cache.
+	(ffi_prep_closure_loc): Flush cache.
+
+2011-02-11  Anthony Green  <green@moxielogic.com>
+
+	From Tom Honermann <tom.honermann@oracle.com>:
+	* src/powerpc/aix.S (ffi_call_AIX): Support for xlc toolchain on
+	AIX.  Declare .ffi_prep_args.  Insert nops after branch
+	instructions so that the AIX linker can insert TOC reload
+	instructions.
+	* src/powerpc/aix_closure.S: Declare .ffi_closure_helper_DARWIN.
+
+2011-02-08  Ed  <ed@kdtc.net>
+
+	* src/powerpc/asm.h: Fix grammar nit in comment.
+
+2011-02-08  Uli Link  <ul.mcamafia@linkitup.de>
+
+	* include/ffi.h.in (FFI_64_BIT_MAX): Define and use.
+
+2011-02-09  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+	PR libffi/46661
+	* testsuite/libffi.call/cls_pointer.c (main): Cast void * to
+	uintptr_t first.
+	* testsuite/libffi.call/cls_pointer_stack.c (main): Likewise.
+
+2011-02-08  Rafael Avila de Espindola  <respindola@mozilla.com>
+
+	* configure.ac: Fix x86 test for pc related relocs.
+	* configure: Rebuilt.
+
+2011-02-07  Joel Sherrill <joel.sherrill@oarcorp.com>
+
+	* libffi/src/m68k/ffi.c: Add RTEMS support for cache flushing.
+	Handle case when CPU variant does not have long double support.
+	* libffi/src/m68k/sysv.S: Add support for mc68000, Coldfire,
+	and cores with soft floating point.
+
+2011-02-07  Joel Sherrill <joel.sherrill@oarcorp.com>
+
+	* configure.ac: Add mips*-*-rtems* support.
+	* configure: Regenerate.
+	* src/mips/ffitarget.h: Ensure needed constants are available
+	for targets which do not have sgidefs.h.
+
+2011-01-26  Dave Korn  <dave.korn.cygwin@gmail.com>
+
+	PR target/40125
+	* configure.ac (AM_LTLDFLAGS): Add -bindir option for windows DLLs.
+	* configure: Regenerate.
+
+2010-12-18  Iain Sandoe  <iains@gcc.gnu.org>
+
+	PR libffi/29152
+	PR libffi/42378
+	* src/powerpc/darwin_closure.S: Provide Darwin64 implementation,
+	update comments.
+	* src/powerpc/ffitarget.h (POWERPC_DARWIN64): New,
+	(FFI_TRAMPOLINE_SIZE): Update for Darwin64.
+	* src/powerpc/darwin.S: Provide Darwin64 implementation,
+	update comments.
+	* src/powerpc/ffi_darwin.c: Likewise.
+
+2010-12-06  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+	* configure.ac (libffi_cv_as_ascii_pseudo_op): Use double
+	backslashes.
+	(libffi_cv_as_string_pseudo_op): Likewise.
+	* configure: Regenerate.
+
+2010-12-03  Chung-Lin Tang  <cltang@codesourcery.com>
+
+	* src/arm/sysv.S (ffi_closure_SYSV): Add UNWIND to .pad directive.
+	(ffi_closure_VFP): Same.
+	(ffi_call_VFP): Move down to before ffi_closure_VFP. Add '.fpu vfp'
+	directive.
+
+2010-12-01  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+	* testsuite/libffi.call/ffitest.h [__sgi] (PRId64, PRIu64): Define.
+	(PRIuPTR): Define.
+
+2010-11-29  Richard Henderson  <rth@redhat.com>
+	    Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+	* src/x86/sysv.S (FDE_ENCODING, FDE_ENCODE): Define.
+	(.eh_frame): Use FDE_ENCODING.
+	(.LASFDE1, .LASFDE2, LASFDE3): Simplify with FDE_ENCODE.
+
+2010-11-22  Jacek Caban <jacek@codeweavers.com>
+
+	* configure.ac: Check for symbol underscores on mingw-w64.
+	* configure: Rebuilt.
+	* src/x86/win64.S: Correctly access extern symbols in respect to
+	underscores.
+
+2010-11-15  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+	* testsuite/lib/libffi-dg.exp: Rename ...
+	* testsuite/lib/libffi.exp: ... to this.
+	* libffi/testsuite/libffi.call/call.exp: Don't load libffi-dg.exp.
+	* libffi/testsuite/libffi.special/special.exp: Likewise.
+
+2010-10-28  Chung-Lin Tang  <cltang@codesourcery.com>
+
+	* src/arm/ffi.c (ffi_prep_args): Add VFP register argument handling
+	code, new parameter, and return value. Update comments.
+	(ffi_prep_cif_machdep): Add case for VFP struct return values. Add
+	call to layout_vfp_args().
+	(ffi_call_SYSV): Update declaration.
+	(ffi_call_VFP): New declaration.
+	(ffi_call): Add VFP struct return conditions. Call ffi_call_VFP()
+	when ABI is FFI_VFP.
+	(ffi_closure_VFP): New declaration.
+	(ffi_closure_SYSV_inner): Add new vfp_args parameter, update call to
+	ffi_prep_incoming_args_SYSV().
+	(ffi_prep_incoming_args_SYSV): Update parameters. Add VFP argument
+	case handling.
+	(ffi_prep_closure_loc): Pass ffi_closure_VFP to trampoline
+	construction under VFP hard-float.
+	(rec_vfp_type_p): New function.
+	(vfp_type_p): Same.
+	(place_vfp_arg): Same.
+	(layout_vfp_args): Same.
+	* src/arm/ffitarget.h (ffi_abi): Add FFI_VFP. Define FFI_DEFAULT_ABI
+	based on __ARM_PCS_VFP.
+	(FFI_EXTRA_CIF_FIELDS): Define for adding VFP hard-float specific
+	fields.
+	(FFI_TYPE_STRUCT_VFP_FLOAT): Define internally used type code.
+	(FFI_TYPE_STRUCT_VFP_DOUBLE): Same.
+	* src/arm/sysv.S (ffi_call_SYSV): Change call of ffi_prep_args() to
+	direct call. Move function pointer load upwards.
+	(ffi_call_VFP): New function.
+	(ffi_closure_VFP): Same.
+
+	* testsuite/lib/libffi-dg.exp (check-flags): New function.
+	(dg-skip-if): New function.
+	* testsuite/libffi.call/cls_double_va.c: Skip if target is arm*-*-*
+	and compiler options include -mfloat-abi=hard.
+	* testsuite/libffi.call/cls_longdouble_va.c: Same.
+
+2010-10-01  Jakub Jelinek  <jakub@redhat.com>
+
+	PR libffi/45677
+	* src/x86/ffi64.c (ffi_prep_cif_machdep): Ensure cif->bytes is
+	a multiple of 8.
+	* testsuite/libffi.call/many2.c: New test.
+
+2010-08-20  Mark Wielaard  <mjw@redhat.com>
+
+	* src/closures.c (open_temp_exec_file_mnt): Check if getmntent_r
+	returns NULL.
+
+2010-08-09  Andreas Tobler  <andreast@fgznet.ch>
+
+	* configure.ac: Add target powerpc64-*-freebsd*.
+	* configure: Regenerate.
+	* testsuite/libffi.call/cls_align_longdouble_split.c: Pass
+	-mlong-double-128 only to linux targets.
+	* testsuite/libffi.call/cls_align_longdouble_split2.c: Likewise.
+	* testsuite/libffi.call/cls_longdouble.c: Likewise.
+	* testsuite/libffi.call/huge_struct.c: Likewise.
+
+2010-08-05  Dan Witte  <dwitte@mozilla.com>
+
+        * Makefile.am: Pass FFI_DEBUG define to msvcc.sh for linking to the
+        debug CRT when --enable-debug is given.
+        * configure.ac: Define it.
+        * msvcc.sh: Translate -g and -DFFI_DEBUG appropriately.
+
+2010-08-04  Dan Witte  <dwitte@mozilla.com>
+
+	* src/x86/ffitarget.h: Add X86_ANY define for all x86/x86_64
+	platforms.
+	* src/x86/ffi.c: Remove redundant ifdef checks.
+	* src/prep_cif.c: Push stack space computation into src/x86/ffi.c
+	for X86_ANY so return value space doesn't get added twice.
+
+2010-08-03  Neil Rashbrooke <neil@parkwaycc.co.uk>
+
+	* msvcc.sh: Don't pass -safeseh to ml64 because behavior is buggy.
+
+2010-07-22  Dan Witte  <dwitte@mozilla.com>
+
+	* src/*/ffitarget.h: Make FFI_LAST_ABI one past the last valid ABI.
+	* src/prep_cif.c: Fix ABI assertion.
+        * src/cris/ffi.c: Ditto.
+
+2010-07-10  Evan Phoenix  <evan@fallingsnow.net>
+
+	* src/closures.c (selinux_enabled_check): Fix strncmp usage bug.
+
+2010-07-07  Dan Horák <dan@danny.cz>
+
+	* include/ffi.h.in: Protect #define with #ifndef.
+	* src/powerpc/ffitarget.h: Ditto.
+	* src/s390/ffitarget.h: Ditto.
+	* src/sparc/ffitarget.h: Ditto.
+
+2010-07-07   Neil Roberts <neil@linux.intel.com>
+
+	* src/x86/sysv.S (ffi_call_SYSV): Align the stack pointer to
+	16-bytes.
+
+2010-07-02  Jakub Jelinek  <jakub@redhat.com>
+
+	* Makefile.am (AM_MAKEFLAGS): Pass also mandir to submakes.
+	* Makefile.in: Regenerated.
+
+2010-05-19  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+	* configure.ac (libffi_cv_as_x86_pcrel): Check for illegal in as
+	output, too.
+	(libffi_cv_as_ascii_pseudo_op): Check for .ascii.
+	(libffi_cv_as_string_pseudo_op): Check for .string.
+	* configure: Regenerate.
+	* fficonfig.h.in: Regenerate.
+	* src/x86/sysv.S (.eh_frame): Use .ascii, .string or error.
+
+2010-05-11  Dan Witte  <dwitte@mozilla.com>
+
+	* doc/libffi.tex: Document previous change.
+
+2010-05-11  Makoto Kato <m_kato@ga2.so-net.ne.jp>
+
+	* src/x86/ffi.c (ffi_call): Don't copy structs passed by value.
+
+2010-05-05  Michael Kohler <michaelkohler@live.com>
+
+	* src/dlmalloc.c (dlfree): Fix spelling.
+	* src/ia64/ffi.c (ffi_prep_cif_machdep): Ditto.
+	* configure.ac: Ditto.
+	* configure: Rebuilt.
+
+2010-04-13  Dan Witte  <dwitte@mozilla.com>
+
+	* msvcc.sh: Build with -W3 instead of -Wall.
+	* src/powerpc/ffi_darwin.c: Remove build warnings.
+	* src/x86/ffi.c: Ditto.
+	* src/x86/ffitarget.h: Ditto.
+
+2010-04-12  Dan Witte  <dwitte@mozilla.com>
+	    Walter Meinl <wuno@lsvw.de>
+
+	* configure.ac: Add OS/2 support.
+	* configure: Rebuilt.
+	* src/closures.c: Ditto.
+	* src/dlmalloc.c: Ditto.
+	* src/x86/win32.S: Ditto.
+
+2010-04-07  Jakub Jelinek  <jakub@redhat.com>
+
+	* testsuite/libffi.call/err_bad_abi.c: Remove unused args variable.
+
+2010-04-02  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+	* Makefile.in: Regenerate.
+	* aclocal.m4: Regenerate.
+	* include/Makefile.in: Regenerate.
+	* man/Makefile.in: Regenerate.
+	* testsuite/Makefile.in: Regenerate.
+
+2010-03-30  Dan Witte  <dwitte@mozilla.com>
+
+	* msvcc.sh: Disable build warnings.
+	* README (tested): Clarify windows build procedure.
+
+2010-03-15  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+	* configure.ac (libffi_cv_as_x86_64_unwind_section_type): New test.
+	* configure: Regenerate.
+	* fficonfig.h.in: Regenerate.
+	* libffi/src/x86/unix64.S (.eh_frame)
+	[HAVE_AS_X86_64_UNWIND_SECTION_TYPE]: Use @unwind section type.
+
+2010-03-14  Matthias Klose  <doko@ubuntu.com>
+
+	* src/x86/ffi64.c: Fix typo in comment.
+	* src/x86/ffi.c: Use /* ... */ comment style.
+
+2010-02-24  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+	* doc/libffi.texi (The Closure API): Fix typo.
+	* doc/libffi.info: Remove.
+
+2010-02-15  Matthias Klose  <doko@ubuntu.com>
+
+	* src/arm/sysv.S (__ARM_ARCH__): Define for processor
+	__ARM_ARCH_7EM__.
+
+2010-01-15  Anthony Green  <green@redhat.com>
+
+	* README: Add notes on building with Microsoft Visual C++.
+
+2010-01-15  Daniel Witte  <dwitte@mozilla.com>
+
+	* msvcc.sh: New file.
+
+	* src/x86/win32.S: Port assembly routines to MSVC and #ifdef.
+	* src/x86/ffi.c: Tweak function declaration and remove excess
+	parens.
+	* include/ffi.h.in: Add __declspec(align(8)) to typedef struct
+	ffi_closure.
+
+	* src/x86/ffi.c: Merge ffi_call_SYSV and ffi_call_STDCALL into new
+	function ffi_call_win32 on X86_WIN32.
+	* src/x86/win32.S (ffi_call_SYSV): Rename to ffi_call_win32.
+	(ffi_call_STDCALL): Remove.
+
+	* src/prep_cif.c (ffi_prep_cif): Move stack space allocation code
+	to ffi_prep_cif_machdep for x86.
+	* src/x86/ffi.c (ffi_prep_cif_machdep): To here.
+
+2010-01-15  Oliver Kiddle  <okiddle@yahoo.co.uk>
+
+	* src/x86/ffitarget.h (ffi_abi): Check for __i386 and __amd64 for
+	Sun Studio compiler compatibility.
+
+2010-01-12  Conrad Irwin <conrad.irwin@gmail.com>
+
+	* doc/libffi.texi: Add closure example.
+
+2010-01-07  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+	PR libffi/40701
+	* testsuite/libffi.call/ffitest.h [__alpha__ && __osf__] (PRIdLL,
+	PRIuLL, PRId64, PRIu64, PRIuPTR): Define.
+	* testsuite/libffi.call/cls_align_sint64.c: Add -Wno-format on
+	alpha*-dec-osf*.
+	* testsuite/libffi.call/cls_align_uint64.c: Likewise.
+	* testsuite/libffi.call/cls_ulonglong.c: Likewise.
+	* testsuite/libffi.call/return_ll1.c: Likewise.
+	* testsuite/libffi.call/stret_medium2.c: Likewise.
+	* testsuite/libffi.special/ffitestcxx.h (allocate_mmap): Cast
+	MAP_FAILED to char *.
+
+2010-01-06  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+	* src/mips/n32.S: Use .abicalls and .eh_frame with __GNUC__.
+
+2009-12-31  Anthony Green  <green@redhat.com>
+
+	* README: Update for libffi 3.0.9.
+
+2009-12-27  Matthias Klose  <doko@ubuntu.com>
+
+	* configure.ac (HAVE_LONG_DOUBLE): Define for mips when
+	appropriate.
+	* configure: Rebuilt.
+
+2009-12-26  Anthony Green  <green@redhat.com>
+
+	* testsuite/libffi.call/cls_longdouble_va.c: Mark as xfail for
+	avr32*-*-*.
+	* testsuite/libffi.call/cls_double_va.c: Ditto.
+
+2009-12-26  Andreas Tobler  <a.tobler@schweiz.org>
+
+	* testsuite/libffi.call/ffitest.h: Conditionally include stdint.h
+	and inttypes.h.
+	* testsuite/libffi.special/unwindtest.cc: Ditto.
+
+2009-12-26  Andreas Tobler  <a.tobler@schweiz.org>
+
+	* configure.ac: Add amd64-*-openbsd*.
+	* configure: Rebuilt.
+	* testsuite/lib/libffi-dg.exp (libffi_target_compile): Link
+	openbsd programs with -lpthread.
+
+2009-12-26  Anthony Green  <green@redhat.com>
+
+	* testsuite/libffi.call/cls_double_va.c,
+	testsuite/libffi.call/cls_longdouble.c,
+	testsuite/libffi.call/cls_longdouble_va.c,
+	testsuite/libffi.call/cls_pointer.c,
+	testsuite/libffi.call/cls_pointer_stack.c: Remove xfail for
+	mips*-*-* and arm*-*-*.
+	* testsuite/libffi.call/cls_align_longdouble_split.c,
+	testsuite/libffi.call/cls_align_longdouble_split2.c,
+	testsuite/libffi.call/stret_medium2.c,
+	testsuite/libffi.call/stret_medium.c,
+	testsuite/libffi.call/stret_large.c,
+	testsuite/libffi.call/stret_large2.c: Remove xfail for arm*-*-*.
+
+2009-12-31  Kay Tietz  <ktietz70@googlemail.com>
+
+	* testsuite/libffi.call/ffitest.h,
+	testsuite/libffi.special/ffitestcxx.h (PRIdLL, PRuLL): Fix
+	definitions.
+
+2009-12-31  Carlo Bramini  <carlo.bramix@libero.it>
+
+	* configure.ac (AM_LTLDFLAGS): Define for windows hosts.
+	* Makefile.am (libffi_la_LDFLAGS): Add AM_LTLDFLAGS.
+	* configure: Rebuilt.
+	* Makefile.in: Rebuilt.
+
+2009-12-31  Anthony Green  <green@redhat.com>
+	    Blake Chaffin.
+
+	* testsuite/libffi.call/huge_struct.c: New test case from Blake
+	Chaffin @ Apple.
+
+2009-12-28  David Edelsohn  <edelsohn@gnu.org>
+
+	* src/powerpc/ffi_darwin.c (ffi_prep_args): Copy abi and nargs to
+	local variables.
+	(aix_adjust_aggregate_sizes): New function.
+	(ffi_prep_cif_machdep): Call it.
+
+2009-12-26  Andreas Tobler  <a.tobler@schweiz.org>
+
+	* configure.ac: Define FFI_MMAP_EXEC_WRIT for the given targets.
+	* configure: Regenerate.
+	* fficonfig.h.in: Likewise.
+	* src/closures.c: Remove the FFI_MMAP_EXEC_WRIT definition for
+	Solaris/x86.
+
+2009-12-26  Andreas Schwab  <schwab@linux-m68k.org>
+
+	* src/powerpc/ffi.c (ffi_prep_args_SYSV): Advance intarg_count
+	when a float arguments is passed in memory.
+	(ffi_closure_helper_SYSV): Mark general registers as used up when
+	a 64bit or soft-float long double argument is passed in memory.
+
+2009-12-25  Matthias Klose  <doko@ubuntu.com>
+
+	* man/ffi_call.3: Fix #include in examples.
+	* doc/libffi.texi: Add dircategory.
+
+2009-12-25  Frank Everdij <f.p.x.everdij@tudelft.nl>
+
+	* include/ffi.h.in: Placed '__GNUC__' ifdef around
+	'__attribute__((aligned(8)))' in ffi_closure, fixes compile for
+	IRIX MIPSPro c99.
+	* include/ffi_common.h: Added '__sgi' define to non
+	'__attribute__((__mode__()))' integer typedefs.
+	* src/mips/ffi.c (ffi_call, ffi_closure_mips_inner_O32,
+	ffi_closure_mips_inner_N32): Added 'defined(_MIPSEB)' to BE check.
+	(ffi_closure_mips_inner_O32, ffi_closure_mips_inner_N32): Added
+	FFI_LONGDOUBLE support and alignment(N32 only).
+	* src/mips/ffitarget.h: Corrected '#include <sgidefs.h>' for IRIX and
+	fixed non '__attribute__((__mode__()))' integer typedefs.
+	* src/mips/n32.S: Put '#ifdef linux' around '.abicalls' and '.eh_frame'
+	since they are Linux/GNU Assembler specific.
+
+2009-12-25  Bradley Smith  <brad@brad-smith.co.uk>
+
+	* configure.ac, Makefile.am, src/avr32/ffi.c,
+	src/avr32/ffitarget.h,
+	src/avr32/sysv.S: Add AVR32 port.
+	* configure, Makefile.in: Rebuilt.
+
+2009-12-21  Andreas Tobler  <a.tobler@schweiz.org>
+
+	* configure.ac: Make i?86 build on FreeBSD and OpenBSD.
+	* configure: Regenerate.
+
+2009-12-15  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+	* testsuite/libffi.call/ffitest.h: Define PRIuPTR on PA HP-UX.
+
+2009-12-13  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+	* src/pa/ffi.c (ffi_closure_inner_pa32): Handle FFI_TYPE_LONGDOUBLE
+	type on HP-UX.
+
+2012-02-13  Kai Tietz  <ktietz@redhat.com>
+
+	PR libffi/52221
+	* src/x86/ffi.c (ffi_prep_raw_closure_loc): Add thiscall
+	support for X86_WIN32.
+	(FFI_INIT_TRAMPOLINE_THISCALL): Fix displacement.
+
+2009-12-11  Eric Botcazou  <ebotcazou@adacore.com>
+
+	* src/sparc/ffi.c (ffi_closure_sparc_inner_v9): Properly align 'long
+	double' arguments.
+
+2009-12-11  Eric Botcazou  <ebotcazou@adacore.com>
+
+	* testsuite/libffi.call/ffitest.h: Define PRIuPTR on Solaris < 10.
+
+2009-12-10  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+	PR libffi/40700
+	* src/closures.c [X86_64 && __sun__ && __svr4__]
+	(FFI_MMAP_EXEC_WRIT): Define.
+
+2009-12-08  David Daney  <ddaney@caviumnetworks.com>
+
+	* testsuite/libffi.call/stret_medium.c: Remove xfail for mips*-*-*
+	* testsuite/libffi.call/cls_align_longdouble_split2.c: Same.
+	* testsuite/libffi.call/stret_large.c: Same.
+	* testsuite/libffi.call/cls_align_longdouble_split.c: Same.
+	* testsuite/libffi.call/stret_large2.c: Same.
+	* testsuite/libffi.call/stret_medium2.c: Same.
+
+2009-12-07  David Edelsohn  <edelsohn@gnu.org>
+
+	* src/powerpc/aix_closure.S (libffi_closure_ASM): Fix tablejump
+	typo.
+
+2009-12-05  David Edelsohn  <edelsohn@gnu.org>
+
+	* src/powerpc/aix.S: Update AIX32 code to be consistent with AIX64
+	code.
+	* src/powerpc/aix_closure.S: Same.
+
+2009-12-05  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+	* Makefile.in: Regenerate.
+	* configure: Regenerate.
+	* include/Makefile.in: Regenerate.
+	* man/Makefile.in: Regenerate.
+	* testsuite/Makefile.in: Regenerate.
+
+2009-12-04  David Edelsohn  <edelsohn@gnu.org>
+
+	* src/powerpc/aix_closure.S: Reorganize 64-bit code to match
+	linux64_closure.S.
+
+2009-12-04  Uros Bizjak  <ubizjak@gmail.com>
+
+	PR libffi/41908
+	* src/x86/ffi64.c (classify_argument): Update from
+	gcc/config/i386/i386.c.
+	(ffi_closure_unix64_inner): Do not use the address of two consecutive
+	SSE registers directly.
+	* testsuite/libffi.call/cls_dbls_struct.c (main): Remove xfail
+	for x86_64 linux targets.
+
+2009-12-04  David Edelsohn  <edelsohn@gnu.org>
+
+	* src/powerpc/ffi_darwin.c (ffi_closure_helper_DARWIN): Increment
+	pfr for long double split between fpr13 and stack.
+
+2009-12-03  David Edelsohn  <edelsohn@gnu.org>
+
+	* src/powerpc/ffi_darwin.c (ffi_prep_args): Increment next_arg and
+	fparg_count twice for long double.
+
+2009-12-03  David Edelsohn  <edelsohn@gnu.org>
+
+	PR libffi/42243
+	* src/powerpc/ffi_darwin.c (ffi_prep_args): Remove extra parentheses.
+
+2009-12-03  Uros Bizjak  <ubizjak@gmail.com>
+
+	* testsuite/libffi.call/cls_longdouble_va.c (main): Fix format string.
+	Remove xfails for x86 linux targets.
+
+2009-12-02  David Edelsohn  <edelsohn@gnu.org>
+
+	* src/powerpc/ffi_darwin.c (ffi_prep_args): Fix typo in INT64
+	case.
+
+2009-12-01  David Edelsohn  <edelsohn@gnu.org>
+
+	* src/powerpc/aix.S (ffi_call_AIX): Convert to more standard
+	register usage.  Call ffi_prep_args directly.  Add long double
+	return value support.
+	* src/powerpc/ffi_darwin.c (ffi_prep_args): Double arg increment
+	applies to FFI_TYPE_DOUBLE.  Correct fpr_base increment typo.
+	Separate FFI_TYPE_SINT32 and FFI_TYPE_UINT32 cases.
+	(ffi_prep_cif_machdep): Only 16 byte stack alignment in 64 bit
+	mode.
+	(ffi_closure_helper_DARWIN): Remove nf and ng counters.  Move temp
+	into case.
+	* src/powerpc/aix_closure.S: Maintain 16 byte stack alignment.
+	Allocate result area between params and FPRs.
+
+2009-11-30  David Edelsohn  <edelsohn@gnu.org>
+
+	PR target/35484
+	* src/powerpc/ffitarget.h (POWERPC64): Define for PPC64 Linux and
+	AIX64.
+	* src/powerpc/aix.S: Implement AIX64 version.
+	* src/powerpc/aix_closure.S: Implement AIX64 version.
+	(ffi_closure_ASM): Use extsb, lha and displament addresses.
+	* src/powerpc/ffi_darwin.c (ffi_prep_args): Implement AIX64
+	support.
+	(ffi_prep_cif_machdep): Same.
+	(ffi_call): Same.
+	(ffi_closure_helper_DARWIN): Same.
+
+2009-11-02  Andreas Tobler  <a.tobler@schweiz.org>
+
+	PR libffi/41908
+	* testsuite/libffi.call/testclosure.c: New test.
+
+2009-09-28  Kai Tietz  <kai.tietz@onevision.com>
+
+	* src/x86/win64.S (_ffi_call_win64 stack): Remove for gnu
+	assembly version use of ___chkstk.
+
+2009-09-23  Matthias Klose  <doko@ubuntu.com>
+
+	PR libffi/40242, PR libffi/41443
+	* src/arm/sysv.S (__ARM_ARCH__): Define for processors
+	__ARM_ARCH_6T2__, __ARM_ARCH_6M__, __ARM_ARCH_7__,
+	__ARM_ARCH_7A__, __ARM_ARCH_7R__, __ARM_ARCH_7M__.
+	Change the conditionals to __SOFTFP__ || __ARM_EABI__
+	for -mfloat-abi=softfp to work.
+
+2009-09-17  Loren J. Rittle  <ljrittle@acm.org>
+
+	PR testsuite/32843 (strikes again)
+	* src/x86/ffi.c (ffi_prep_cif_machdep): Add X86_FREEBSD to
+	enable proper extension on char and short.
+
+2009-09-15  David Daney  <ddaney@caviumnetworks.com>
+
+	* src/java_raw_api.c (ffi_java_raw_to_rvalue): Remove special
+	handling for FFI_TYPE_POINTER.
+	* src/mips/ffitarget.h (FFI_TYPE_STRUCT_D_SOFT,
+	FFI_TYPE_STRUCT_F_SOFT, FFI_TYPE_STRUCT_DD_SOFT,
+	FFI_TYPE_STRUCT_FF_SOFT, FFI_TYPE_STRUCT_FD_SOFT,
+	FFI_TYPE_STRUCT_DF_SOFT, FFI_TYPE_STRUCT_SOFT): New defines.
+	(FFI_N32_SOFT_FLOAT, FFI_N64_SOFT_FLOAT): New ffi_abi enumerations.
+	(enum ffi_abi): Set FFI_DEFAULT_ABI for soft-float.
+	* src/mips/n32.S (ffi_call_N32): Add handling for soft-float
+	structure and pointer returns.
+	(ffi_closure_N32): Add handling for pointer returns.
+	* src/mips/ffi.c (ffi_prep_args, calc_n32_struct_flags,
+	calc_n32_return_struct_flags): Handle soft-float.
+	(ffi_prep_cif_machdep):  Handle soft-float, fix pointer handling.
+	(ffi_call_N32): Declare proper argument types.
+	(ffi_call, copy_struct_N32, ffi_closure_mips_inner_N32): Handle
+	soft-float.
+
+2009-08-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+	* configure.ac (AC_PREREQ): Bump to 2.64.
+
+2009-08-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+	* Makefile.am (install-html, install-pdf): Remove.
+	* Makefile.in: Regenerate.
+
+	* Makefile.in: Regenerate.
+	* aclocal.m4: Regenerate.
+	* configure: Regenerate.
+	* fficonfig.h.in: Regenerate.
+	* include/Makefile.in: Regenerate.
+	* man/Makefile.in: Regenerate.
+	* testsuite/Makefile.in: Regenerate.
+
+2011-08-22  Jasper Lievisse Adriaanse <jasper@openbsd.org>
+
+	* configure.ac: Add OpenBSD/hppa and OpenBSD/powerpc support.
+	* configure: Rebuilt.
+
+2009-07-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+	* configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.
+
+2009-07-24  Dave Korn  <dave.korn.cygwin@gmail.com>
+
+	PR libffi/40807
+	* src/x86/ffi.c (ffi_prep_cif_machdep): Also use sign/zero-extending
+	return types for X86_WIN32.
+	* src/x86/win32.S (_ffi_call_SYSV): Handle omitted return types.
+	(_ffi_call_STDCALL, _ffi_closure_SYSV, _ffi_closure_raw_SYSV,
+	_ffi_closure_STDCALL): Likewise.
+
+	* src/closures.c (is_selinux_enabled): Define to const 0 for Cygwin.
+	(dlmmap, dlmunmap): Also use these functions on Cygwin.
+
+2009-07-11  Richard Sandiford  <rdsandiford@googlemail.com>
+
+	PR testsuite/40699
+	PR testsuite/40707
+	PR testsuite/40709
+	* testsuite/lib/libffi-dg.exp: Revert 2009-07-02, 2009-07-01 and
+	2009-06-30 commits.
+
+2009-07-01  Richard Sandiford  <r.sandiford@uk.ibm.com>
+
+	* testsuite/lib/libffi-dg.exp (libffi-init): Set ld_library_path
+	to "" before adding paths.  (This reinstates an assignment that
+	was removed by my 2009-06-30 commit, but changes the initial
+	value from "." to "".)
+
+2009-07-01  H.J. Lu  <hongjiu.lu@intel.com>
+
+	PR testsuite/40601
+	* testsuite/lib/libffi-dg.exp (libffi-init): Properly set
+	gccdir.  Adjust ld_library_path for gcc only if gccdir isn't
+	empty.
+
+2009-06-30  Richard Sandiford  <r.sandiford@uk.ibm.com>
+
+	* testsuite/lib/libffi-dg.exp (libffi-init): Don't add "."
+	to ld_library_path.  Use add_path.  Add just find_libgcc_s
+	to ld_library_path, not every libgcc multilib directory.
+
+2009-06-16  Wim Lewis  <wiml@hhhh.org>
+
+	* src/powerpc/ffi.c: Avoid clobbering cr3 and cr4, which are
+	supposed to be callee-saved.
+	* src/powerpc/sysv.S (small_struct_return_value): Fix overrun of
+	return buffer for odd-size structs.
+
+2009-06-16  Andreas Tobler  <a.tobler@schweiz.org>
+
+	PR libffi/40444
+	* testsuite/lib/libffi-dg.exp (libffi_target_compile): Add
+	allow_stack_execute for Darwin.
+
+2009-06-16  Andrew Haley  <aph@redhat.com>
+
+	* configure.ac (TARGETDIR): Add missing blank lines.
+	* configure: Regenerate.
+
+2009-06-16  Andrew Haley  <aph@redhat.com>
+
+	* testsuite/libffi.call/cls_align_sint64.c,
+	testsuite/libffi.call/cls_align_uint64.c,
+	testsuite/libffi.call/cls_longdouble_va.c,
+	testsuite/libffi.call/cls_ulonglong.c,
+	testsuite/libffi.call/return_ll1.c,
+	testsuite/libffi.call/stret_medium2.c: Fix printf format
+	specifiers.
+	* testsuite/libffi.call/ffitest.h,
+	testsuite/libffi.special/ffitestcxx.h (PRIdLL, PRIuLL): Define.
+
+2009-06-15  Andrew Haley  <aph@redhat.com>
+
+	* testsuite/libffi.call/err_bad_typedef.c: xfail everywhere.
+	* testsuite/libffi.call/err_bad_abi.c: Likewise.
+
+2009-06-12  Andrew Haley  <aph@redhat.com>
+
+	* Makefile.am: Remove info_TEXINFOS.
+
+2009-06-12  Andrew Haley  <aph@redhat.com>
+
+	* ChangeLog.libffi: testsuite/libffi.call/cls_align_sint64.c,
+	testsuite/libffi.call/cls_align_uint64.c,
+	testsuite/libffi.call/cls_ulonglong.c,
+	testsuite/libffi.call/return_ll1.c,
+	testsuite/libffi.call/stret_medium2.c: Fix printf format
+	specifiers.
+	testsuite/libffi.special/unwindtest.cc: include stdint.h.
+
+2009-06-11  Timothy Wall  <twall@users.sf.net>
+
+	* Makefile.am,
+	configure.ac,
+	include/ffi.h.in,
+	include/ffi_common.h,
+	src/closures.c,
+	src/dlmalloc.c,
+	src/x86/ffi.c,
+	src/x86/ffitarget.h,
+	src/x86/win64.S (new),
+	README: Added win64 support (mingw or MSVC)
+	* Makefile.in,
+	include/Makefile.in,
+	man/Makefile.in,
+	testsuite/Makefile.in,
+	configure,
+	aclocal.m4: Regenerated
+	* ltcf-c.sh: properly escape cygwin/w32 path
+	* man/ffi_call.3: Clarify size requirements for return value.
+	* src/x86/ffi64.c: Fix filename in comment.
+	* src/x86/win32.S: Remove unused extern.
+
+	* testsuite/libffi.call/closure_fn0.c,
+	testsuite/libffi.call/closure_fn1.c,
+	testsuite/libffi.call/closure_fn2.c,
+	testsuite/libffi.call/closure_fn3.c,
+	testsuite/libffi.call/closure_fn4.c,
+	testsuite/libffi.call/closure_fn5.c,
+	testsuite/libffi.call/closure_fn6.c,
+	testsuite/libffi.call/closure_stdcall.c,
+	testsuite/libffi.call/cls_12byte.c,
+	testsuite/libffi.call/cls_16byte.c,
+	testsuite/libffi.call/cls_18byte.c,
+	testsuite/libffi.call/cls_19byte.c,
+	testsuite/libffi.call/cls_1_1byte.c,
+	testsuite/libffi.call/cls_20byte.c,
+	testsuite/libffi.call/cls_20byte1.c,
+	testsuite/libffi.call/cls_24byte.c,
+	testsuite/libffi.call/cls_2byte.c,
+	testsuite/libffi.call/cls_3_1byte.c,
+	testsuite/libffi.call/cls_3byte1.c,
+ 	testsuite/libffi.call/cls_3byte2.c,
+ 	testsuite/libffi.call/cls_4_1byte.c,
+ 	testsuite/libffi.call/cls_4byte.c,
+ 	testsuite/libffi.call/cls_5_1_byte.c,
+ 	testsuite/libffi.call/cls_5byte.c,
+ 	testsuite/libffi.call/cls_64byte.c,
+ 	testsuite/libffi.call/cls_6_1_byte.c,
+ 	testsuite/libffi.call/cls_6byte.c,
+ 	testsuite/libffi.call/cls_7_1_byte.c,
+ 	testsuite/libffi.call/cls_7byte.c,
+ 	testsuite/libffi.call/cls_8byte.c,
+ 	testsuite/libffi.call/cls_9byte1.c,
+ 	testsuite/libffi.call/cls_9byte2.c,
+ 	testsuite/libffi.call/cls_align_double.c,
+ 	testsuite/libffi.call/cls_align_float.c,
+ 	testsuite/libffi.call/cls_align_longdouble.c,
+ 	testsuite/libffi.call/cls_align_longdouble_split.c,
+ 	testsuite/libffi.call/cls_align_longdouble_split2.c,
+ 	testsuite/libffi.call/cls_align_pointer.c,
+ 	testsuite/libffi.call/cls_align_sint16.c,
+ 	testsuite/libffi.call/cls_align_sint32.c,
+ 	testsuite/libffi.call/cls_align_sint64.c,
+ 	testsuite/libffi.call/cls_align_uint16.c,
+ 	testsuite/libffi.call/cls_align_uint32.c,
+ 	testsuite/libffi.call/cls_align_uint64.c,
+ 	testsuite/libffi.call/cls_dbls_struct.c,
+ 	testsuite/libffi.call/cls_double.c,
+ 	testsuite/libffi.call/cls_double_va.c,
+ 	testsuite/libffi.call/cls_float.c,
+ 	testsuite/libffi.call/cls_longdouble.c,
+ 	testsuite/libffi.call/cls_longdouble_va.c,
+ 	testsuite/libffi.call/cls_multi_schar.c,
+ 	testsuite/libffi.call/cls_multi_sshort.c,
+ 	testsuite/libffi.call/cls_multi_sshortchar.c,
+ 	testsuite/libffi.call/cls_multi_uchar.c,
+ 	testsuite/libffi.call/cls_multi_ushort.c,
+ 	testsuite/libffi.call/cls_multi_ushortchar.c,
+ 	testsuite/libffi.call/cls_pointer.c,
+ 	testsuite/libffi.call/cls_pointer_stack.c,
+ 	testsuite/libffi.call/cls_schar.c,
+ 	testsuite/libffi.call/cls_sint.c,
+ 	testsuite/libffi.call/cls_sshort.c,
+ 	testsuite/libffi.call/cls_uchar.c,
+ 	testsuite/libffi.call/cls_uint.c,
+ 	testsuite/libffi.call/cls_ulonglong.c,
+ 	testsuite/libffi.call/cls_ushort.c,
+ 	testsuite/libffi.call/err_bad_abi.c,
+ 	testsuite/libffi.call/err_bad_typedef.c,
+ 	testsuite/libffi.call/float2.c,
+ 	testsuite/libffi.call/huge_struct.c,
+ 	testsuite/libffi.call/nested_struct.c,
+ 	testsuite/libffi.call/nested_struct1.c,
+ 	testsuite/libffi.call/nested_struct10.c,
+ 	testsuite/libffi.call/nested_struct2.c,
+ 	testsuite/libffi.call/nested_struct3.c,
+ 	testsuite/libffi.call/nested_struct4.c,
+ 	testsuite/libffi.call/nested_struct5.c,
+ 	testsuite/libffi.call/nested_struct6.c,
+ 	testsuite/libffi.call/nested_struct7.c,
+ 	testsuite/libffi.call/nested_struct8.c,
+ 	testsuite/libffi.call/nested_struct9.c,
+ 	testsuite/libffi.call/problem1.c,
+ 	testsuite/libffi.call/return_ldl.c,
+ 	testsuite/libffi.call/return_ll1.c,
+ 	testsuite/libffi.call/stret_large.c,
+ 	testsuite/libffi.call/stret_large2.c,
+ 	testsuite/libffi.call/stret_medium.c,
+ 	testsuite/libffi.call/stret_medium2.c,
+	testsuite/libffi.special/unwindtest.cc: use ffi_closure_alloc instead
+	of checking for MMAP.  Use intptr_t instead of long casts.
+
+2009-06-11  Kaz Kojima  <kkojima@gcc.gnu.org>
+
+	* testsuite/libffi.call/cls_longdouble_va.c: Add xfail sh*-*-linux-*.
+	* testsuite/libffi.call/err_bad_abi.c: Add xfail sh*-*-*.
+	* testsuite/libffi.call/err_bad_typedef.c: Likewise.
+
+2009-06-09  Andrew Haley  <aph@redhat.com>
+
+	* src/x86/freebsd.S: Add missing file.
+
+2009-06-08  Andrew Haley  <aph@redhat.com>
+
+	Import from libffi 3.0.8:
+
+	* doc/libffi.texi: New file.
+	* doc/libffi.info: Likewise.
+	* doc/stamp-vti: Likewise.
+	* man/Makefile.am: New file.
+	* man/ffi_call.3: New file.
+
+	* Makefile.am (EXTRA_DIST): Add src/x86/darwin64.S,
+	src/dlmalloc.c.
+	(nodist_libffi_la_SOURCES): Add X86_FREEBSD.
+
+	* configure.ac: Bump version to 3.0.8.
+	parisc*-*-linux*: Add.
+	i386-*-freebsd* | i386-*-openbsd*: Add.
+	powerpc-*-beos*: Add.
+	AM_CONDITIONAL X86_FREEBSD: Add.
+	AC_CONFIG_FILES: Add man/Makefile.
+
+	* include/ffi.h.in (FFI_FN): Change void (*)() to void (*)(void).
+
+2009-06-08  Andrew Haley  <aph@redhat.com>
+
+	* README: Import from libffi 3.0.8.
+
+2009-06-08  Andrew Haley  <aph@redhat.com>
+
+	* testsuite/libffi.call/err_bad_abi.c: Add xfails.
+	* testsuite/libffi.call/cls_longdouble_va.c: Add xfails.
+	* testsuite/libffi.call/cls_dbls_struct.c: Add xfail x86_64-*-linux-*.
+	* testsuite/libffi.call/err_bad_typedef.c: Add xfails.
+
+	* testsuite/libffi.call/stret_medium2.c: Add __UNUSED__ to args.
+	* testsuite/libffi.call/stret_medium.c: Likewise.
+	* testsuite/libffi.call/stret_large2.c: Likewise.
+	* testsuite/libffi.call/stret_large.c:  Likewise.
+
+2008-12-26  Timothy Wall  <twall@users.sf.net>
+
+	* testsuite/libffi.call/cls_longdouble.c,
+	testsuite/libffi.call/cls_longdouble_va.c,
+	testsuite/libffi.call/cls_align_longdouble.c,
+	testsuite/libffi.call/cls_align_longdouble_split.c,
+	testsuite/libffi.call/cls_align_longdouble_split2.c: mark expected
+	failures on x86_64 cygwin/mingw.
+
+2008-12-22  Timothy Wall  <twall@users.sf.net>
+
+	* testsuite/libffi.call/closure_fn0.c,
+	testsuite/libffi.call/closure_fn1.c,
+	testsuite/libffi.call/closure_fn2.c,
+	testsuite/libffi.call/closure_fn3.c,
+	testsuite/libffi.call/closure_fn4.c,
+	testsuite/libffi.call/closure_fn5.c,
+	testsuite/libffi.call/closure_fn6.c,
+	testsuite/libffi.call/closure_loc_fn0.c,
+	testsuite/libffi.call/closure_stdcall.c,
+	testsuite/libffi.call/cls_align_pointer.c,
+	testsuite/libffi.call/cls_pointer.c,
+	testsuite/libffi.call/cls_pointer_stack.c: use portable cast from
+	pointer to integer (intptr_t).
+	* testsuite/libffi.call/cls_longdouble.c: disable for win64.
+
+2008-07-24  Anthony Green  <green@redhat.com>
+
+	* testsuite/libffi.call/cls_dbls_struct.c,
+	testsuite/libffi.call/cls_double_va.c,
+	testsuite/libffi.call/cls_longdouble.c,
+	testsuite/libffi.call/cls_longdouble_va.c,
+	testsuite/libffi.call/cls_pointer.c,
+	testsuite/libffi.call/cls_pointer_stack.c,
+	testsuite/libffi.call/err_bad_abi.c: Clean up failures from
+	compiler warnings.
+
+2008-03-04  Anthony Green  <green@redhat.com>
+	    Blake Chaffin
+	    hos@tamanegi.org
+
+	* testsuite/libffi.call/cls_align_longdouble_split2.c
+	  testsuite/libffi.call/cls_align_longdouble_split.c
+	  testsuite/libffi.call/cls_dbls_struct.c
+	  testsuite/libffi.call/cls_double_va.c
+	  testsuite/libffi.call/cls_longdouble.c
+	  testsuite/libffi.call/cls_longdouble_va.c
+	  testsuite/libffi.call/cls_pointer.c
+	  testsuite/libffi.call/cls_pointer_stack.c
+	  testsuite/libffi.call/err_bad_abi.c
+	  testsuite/libffi.call/err_bad_typedef.c
+	  testsuite/libffi.call/stret_large2.c
+	  testsuite/libffi.call/stret_large.c
+	  testsuite/libffi.call/stret_medium2.c
+	  testsuite/libffi.call/stret_medium.c: New tests from Apple.
+
+2009-06-05  Andrew Haley  <aph@redhat.com>
+
+	* src/x86/ffitarget.h, src/x86/ffi.c: Merge stdcall changes from
+	libffi.
+
+2009-06-04  Andrew Haley  <aph@redhat.com>
+
+	* src/x86/ffitarget.h, src/x86/win32.S, src/x86/ffi.c: Back out
+	stdcall changes.
+
+2008-02-26  Anthony Green  <green@redhat.com>
+	    Thomas Heller  <theller@ctypes.org>
+
+	* src/x86/ffi.c (ffi_closure_SYSV_inner): Change C++ comment to C
+	comment.
+
+2008-02-03  Timothy Wall  <twall@users.sf.net>
+
+	* src/x86/ffi.c (FFI_INIT_TRAMPOLINE_STDCALL): Calculate jump return
+	  offset based on code pointer, not data pointer.
+
+2008-01-31  Timothy Wall <twall@users.sf.net>
+
+	* testsuite/libffi.call/closure_stdcall.c: Add test for stdcall
+	closures.
+	* src/x86/ffitarget.h: Increase size of trampoline for stdcall
+	closures.
+	* src/x86/win32.S: Add assembly for stdcall closure.
+	* src/x86/ffi.c: Initialize stdcall closure trampoline.
+
+2009-06-04  Andrew Haley  <aph@redhat.com>
+
+	* include/ffi.h.in: Change void (*)() to void (*)(void).
+	* src/x86/ffi.c: Likewise.
+
+2009-06-04  Andrew Haley  <aph@redhat.com>
+
+	* src/powerpc/ppc_closure.S: Insert licence header.
+	* src/powerpc/linux64_closure.S: Likewise.
+	* src/m68k/sysv.S: Likewise.
+
+	* src/sh64/ffi.c: Change void (*)() to void (*)(void).
+	* src/powerpc/ffi.c: Likewise.
+	* src/powerpc/ffi_darwin.c: Likewise.
+	* src/m32r/ffi.c: Likewise.
+	* src/sh64/ffi.c: Likewise.
+	* src/x86/ffi64.c: Likewise.
+	* src/alpha/ffi.c: Likewise.
+	* src/alpha/osf.S: Likewise.
+	* src/frv/ffi.c: Likewise.
+	* src/s390/ffi.c: Likewise.
+	* src/pa/ffi.c: Likewise.
+	* src/pa/hpux32.S: Likewise.
+	* src/ia64/unix.S: Likewise.
+	* src/ia64/ffi.c: Likewise.
+	* src/sparc/ffi.c: Likewise.
+	* src/mips/ffi.c: Likewise.
+	* src/sh/ffi.c: Likewise.
+
+2008-02-15  David Daney  <ddaney@avtrex.com>
+
+	* src/mips/ffi.c (USE__BUILTIN___CLEAR_CACHE):
+	Define (conditionally), and use it to include cachectl.h.
+	(ffi_prep_closure_loc): Fix cache flushing.
+	* src/mips/ffitarget.h (_ABIN32, _ABI64, _ABIO32): Define.
+
+2009-06-04  Andrew Haley  <aph@redhat.com>
+
+	include/ffi.h.in,
+	src/arm/ffitarget.h,
+	src/arm/ffi.c,
+	src/arm/sysv.S,
+	src/powerpc/ffitarget.h,
+	src/closures.c,
+	src/sh64/ffitarget.h,
+	src/sh64/ffi.c,
+	src/sh64/sysv.S,
+	src/types.c,
+	src/x86/ffi64.c,
+	src/x86/ffitarget.h,
+	src/x86/win32.S,
+	src/x86/darwin.S,
+	src/x86/ffi.c,
+	src/x86/sysv.S,
+	src/x86/unix64.S,
+	src/alpha/ffitarget.h,
+	src/alpha/ffi.c,
+	src/alpha/osf.S,
+	src/m68k/ffitarget.h,
+	src/frv/ffitarget.h,
+	src/frv/ffi.c,
+	src/s390/ffitarget.h,
+	src/s390/sysv.S,
+	src/cris/ffitarget.h,
+	src/pa/linux.S,
+	src/pa/ffitarget.h,
+	src/pa/ffi.c,
+	src/raw_api.c,
+	src/ia64/ffitarget.h,
+	src/ia64/unix.S,
+	src/ia64/ffi.c,
+	src/ia64/ia64_flags.h,
+	src/java_raw_api.c,
+	src/debug.c,
+	src/sparc/v9.S,
+	src/sparc/ffitarget.h,
+	src/sparc/ffi.c,
+	src/sparc/v8.S,
+	src/mips/ffitarget.h,
+	src/mips/n32.S,
+	src/mips/o32.S,
+	src/mips/ffi.c,
+	src/prep_cif.c,
+	src/sh/ffitarget.h,
+	src/sh/ffi.c,
+	src/sh/sysv.S: Update license text.
+
+2009-05-22  Dave Korn  <dave.korn.cygwin@gmail.com>
+
+	* src/x86/win32.S (_ffi_closure_STDCALL):  New function.
+	(.eh_frame):  Add FDE for it.
+
+2009-05-22  Dave Korn  <dave.korn.cygwin@gmail.com>
+
+	* configure.ac:  Also check if assembler supports pc-relative
+	relocs on X86_WIN32 targets.
+	* configure:  Regenerate.
+	* src/x86/win32.S (ffi_prep_args):  Declare extern, not global.
+	(_ffi_call_SYSV):  Add missing function type symbol .def and
+	add EH markup labels.
+	(_ffi_call_STDCALL):  Likewise.
+	(_ffi_closure_SYSV):  Likewise.
+	(_ffi_closure_raw_SYSV):  Likewise.
+	(.eh_frame):  Add hand-crafted EH data.
+
+2009-04-09  Jakub Jelinek  <jakub@redhat.com>
+
+	* testsuite/lib/libffi-dg.exp: Change copyright header to refer to
+	version 3 of the GNU General Public License and to point readers
+	at the COPYING3 file and the FSF's license web page.
+	* testsuite/libffi.call/call.exp: Likewise.
+	* testsuite/libffi.special/special.exp: Likewise.
+
+2009-03-01  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+	* configure: Regenerate.
+
+2008-12-18  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
+
+	PR libffi/26048
+	* configure.ac (HAVE_AS_X86_PCREL): New test.
+	* configure: Regenerate.
+	* fficonfig.h.in: Regenerate.
+	* src/x86/sysv.S [!FFI_NO_RAW_API]: Precalculate
+	RAW_CLOSURE_CIF_OFFSET, RAW_CLOSURE_FUN_OFFSET,
+	RAW_CLOSURE_USER_DATA_OFFSET for the Solaris 10/x86 assembler.
+	(.eh_frame): Only use SYMBOL-. iff HAVE_AS_X86_PCREL.
+	* src/x86/unix64.S (.Lstore_table): Move to .text section.
+	(.Lload_table): Likewise.
+	(.eh_frame): Only use SYMBOL-. iff HAVE_AS_X86_PCREL.
+
+2008-12-18  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+	* configure: Regenerate.
+
+2008-11-21  Eric Botcazou  <ebotcazou@adacore.com>
+
+	* src/sparc/ffi.c (ffi_prep_cif_machdep): Add support for
+	signed/unsigned int8/16 return values.
+	* src/sparc/v8.S (ffi_call_v8): Likewise.
+	(ffi_closure_v8): Likewise.
+
+2008-09-26  Peter O'Gorman  <pogma@thewrittenword.com>
+	    Steve Ellcey  <sje@cup.hp.com>
+
+	* configure: Regenerate for new libtool.
+	* Makefile.in: Ditto.
+	* include/Makefile.in: Ditto.
+	* aclocal.m4: Ditto.
+
+2008-08-25  Andreas Tobler  <a.tobler@schweiz.org>
+
+	* src/powerpc/ffitarget.h (ffi_abi): Add FFI_LINUX and
+	FFI_LINUX_SOFT_FLOAT to the POWERPC_FREEBSD enum.
+	Add note about flag bits used for FFI_SYSV_TYPE_SMALL_STRUCT.
+	Adjust copyright notice.
+	* src/powerpc/ffi.c: Add two new flags to indicate if we have one
+	register or two register to use for FFI_SYSV structs.
+	(ffi_prep_cif_machdep): Pass the right register flag introduced above.
+	(ffi_closure_helper_SYSV): Fix the return type for
+	FFI_SYSV_TYPE_SMALL_STRUCT. Comment.
+	Adjust copyright notice.
+
+2008-07-16  Kaz Kojima  <kkojima@gcc.gnu.org>
+
+	* src/sh/ffi.c (ffi_prep_closure_loc): Turn INSN into an unsigned
+	int.
+
+2008-06-17  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+	* configure: Regenerate.
+	* include/Makefile.in: Regenerate.
+	* testsuite/Makefile.in: Regenerate.
+
+2008-06-07  Joseph Myers  <joseph@codesourcery.com>
+
+	* configure.ac (parisc*-*-linux*, powerpc-*-sysv*,
+	powerpc-*-beos*): Remove.
+	* configure: Regenerate.
+
+2008-05-09  Julian Brown  <julian@codesourcery.com>
+
+	* Makefile.am (LTLDFLAGS): New.
+	(libffi_la_LDFLAGS): Use above.
+	* Makefile.in: Regenerate.
+
+2008-04-18  Paolo Bonzini  <bonzini@gnu.org>
+
+	PR bootstrap/35457
+	* aclocal.m4: Regenerate.
+	* configure: Regenerate.
+
+2008-03-26  Kaz Kojima  <kkojima@gcc.gnu.org>
+
+	* src/sh/sysv.S: Add .note.GNU-stack on Linux.
+	* src/sh64/sysv.S: Likewise.
+
+2008-03-26  Daniel Jacobowitz  <dan@debian.org>
+
+	* src/arm/sysv.S: Fix ARM comment marker.
+
+2008-03-26  Jakub Jelinek  <jakub@redhat.com>
+
+	* src/alpha/osf.S: Add .note.GNU-stack on Linux.
+	* src/s390/sysv.S: Likewise.
+	* src/powerpc/ppc_closure.S: Likewise.
+	* src/powerpc/sysv.S: Likewise.
+	* src/x86/unix64.S: Likewise.
+	* src/x86/sysv.S: Likewise.
+	* src/sparc/v8.S: Likewise.
+	* src/sparc/v9.S: Likewise.
+	* src/m68k/sysv.S: Likewise.
+	* src/arm/sysv.S: Likewise.
+
+2008-03-16  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+	* aclocal.m4: Regenerate.
+	* configure: Likewise.
+	* Makefile.in: Likewise.
+	* include/Makefile.in: Likewise.
+	* testsuite/Makefile.in: Likewise.
+
+2008-02-12  Bjoern Koenig  <bkoenig@alpha-tierchen.de>
+	    Andreas Tobler  <a.tobler@schweiz.org>
+
+	* configure.ac: Add amd64-*-freebsd* target.
+	* configure: Regenerate.
+
+2008-01-30  H.J. Lu  <hongjiu.lu@intel.com>
+
+	PR libffi/34612
+	* src/x86/sysv.S (ffi_closure_SYSV): Pop 4 byte from stack when
+	returning struct.
+
+	* testsuite/libffi.call/call.exp: Add "-O2 -fomit-frame-pointer"
+	tests.
+
+2008-01-24  David Edelsohn  <edelsohn@gnu.org>
+
+	* configure: Regenerate.
+
+2008-01-06  Andreas Tobler  <a.tobler@schweiz.org>
+
+	* src/x86/ffi.c (ffi_prep_cif_machdep): Fix thinko.
+
+2008-01-05  Andreas Tobler  <a.tobler@schweiz.org>
+
+	PR testsuite/32843
+	* src/x86/ffi.c (ffi_prep_cif_machdep): Add code for
+	signed/unsigned int8/16 for X86_DARWIN.
+	Updated copyright info.
+	Handle one and two byte structs with special cif->flags.
+	* src/x86/ffitarget.h: Add special types for one and two byte structs.
+	Updated copyright info.
+	* src/x86/darwin.S (ffi_call_SYSV): Rewrite to use a jump table like
+	sysv.S
+	Remove code to pop args from the stack after call.
+	Special-case signed/unsigned for int8/16, one and two byte structs.
+	(ffi_closure_raw_SYSV): Handle FFI_TYPE_UINT8,
+	FFI_TYPE_SINT8, FFI_TYPE_UINT16, FFI_TYPE_SINT16, FFI_TYPE_UINT32,
+	FFI_TYPE_SINT32.
+	Updated copyright info.
+
+2007-12-08  David Daney  <ddaney@avtrex.com>
+
+	* src/mips/n32.S (ffi_call_N32):  Replace dadd with ADDU, dsub with
+	SUBU, add with ADDU and use smaller code sequences.
+
+2007-12-07  David Daney  <ddaney@avtrex.com>
+
+	* src/mips/ffi.c (ffi_prep_cif_machdep): Handle long double return
+	type.
+
+2007-12-06  David Daney  <ddaney@avtrex.com>
+
+	* include/ffi.h.in (FFI_SIZEOF_JAVA_RAW): Define if not	already
+	defined.
+	(ffi_java_raw): New typedef.
+	(ffi_java_raw_call, ffi_java_ptrarray_to_raw,
+	ffi_java_raw_to_ptrarray): Change parameter types from ffi_raw to
+	ffi_java_raw.
+	(ffi_java_raw_closure) : Same.
+	(ffi_prep_java_raw_closure, ffi_prep_java_raw_closure_loc): Change
+	parameter types.
+	* src/java_raw_api.c (ffi_java_raw_size):  Replace FFI_SIZEOF_ARG with
+	FFI_SIZEOF_JAVA_RAW.
+	(ffi_java_raw_to_ptrarray): Change type of raw to ffi_java_raw.
+	Replace FFI_SIZEOF_ARG with FFI_SIZEOF_JAVA_RAW. Use
+	sizeof(ffi_java_raw) for alignment calculations.
+	(ffi_java_ptrarray_to_raw): Same.
+	(ffi_java_rvalue_to_raw): Add special handling for FFI_TYPE_POINTER
+	if FFI_SIZEOF_JAVA_RAW == 4.
+	(ffi_java_raw_to_rvalue): Same.
+	(ffi_java_raw_call): Change type of raw to ffi_java_raw.
+	(ffi_java_translate_args): Same.
+	(ffi_prep_java_raw_closure_loc, ffi_prep_java_raw_closure): Change
+	parameter types.
+	* src/mips/ffitarget.h (FFI_SIZEOF_JAVA_RAW): Define for N32 ABI.
+
+2007-12-06  David Daney  <ddaney@avtrex.com>
+
+	* src/mips/n32.S (ffi_closure_N32): Use 64-bit add instruction on
+	pointer values.
+
+2007-12-01  Andreas Tobler  <a.tobler@schweiz.org>
+
+	PR libffi/31937
+	* src/powerpc/ffitarget.h: Introduce new ABI FFI_LINUX_SOFT_FLOAT.
+	Add local FFI_TYPE_UINT128 to handle soft-float long-double-128.
+	* src/powerpc/ffi.c: Distinguish between __NO_FPRS__ and not and
+	set the NUM_FPR_ARG_REGISTERS according to.
+	Add support for potential soft-float support under hard-float
+	architecture.
+	(ffi_prep_args_SYSV): Set NUM_FPR_ARG_REGISTERS to 0 in case of
+	FFI_LINUX_SOFT_FLOAT, handle float, doubles and long-doubles according
+	to the FFI_LINUX_SOFT_FLOAT ABI.
+	(ffi_prep_cif_machdep): Likewise.
+	(ffi_closure_helper_SYSV): Likewise.
+	* src/powerpc/ppc_closure.S: Make sure not to store float/double
+	on archs where __NO_FPRS__ is true.
+	Add FFI_TYPE_UINT128 support.
+	* src/powerpc/sysv.S: Add support for soft-float long-double-128.
+	Adjust copyright notice.
+
+2007-11-25  Andreas Tobler  <a.tobler@schweiz.org>
+
+	* src/closures.c: Move defintion of MAYBE_UNUSED from here to ...
+	* include/ffi_common.h: ... here.
+	Update copyright.
+
+2007-11-17  Andreas Tobler  <a.tobler@schweiz.org>
+
+	* src/powerpc/sysv.S: Load correct cr to compare if we have long double.
+	* src/powerpc/linux64.S: Likewise.
+	* src/powerpc/ffi.c: Add a comment to show which part goes into cr6.
+	* testsuite/libffi.call/return_ldl.c: New test.
+
+2007-09-04    <aph@redhat.com>
+
+	* src/arm/sysv.S (UNWIND): New.
+	(Whole file): Conditionally compile unwinder directives.
+	* src/arm/sysv.S: Add unwinder directives.
+
+	* src/arm/ffi.c (ffi_prep_args): Align structs by at least 4 bytes.
+	Only treat r0 as a struct address if we're actually returning a
+	struct by address.
+	Only copy the bytes that are actually within a struct.
+	(ffi_prep_cif_machdep): A Composite Type not larger than 4 bytes
+	is returned in r0, not passed by address.
+	(ffi_call): Allocate a word-sized temporary for the case where
+	a composite is returned in r0.
+	(ffi_prep_incoming_args_SYSV): Align as necessary.
+
+2007-08-05  Steven Newbury  <s_j_newbury@yahoo.co.uk>
+
+	* src/arm/ffi.c (FFI_INIT_TRAMPOLINE): Use __clear_cache instead of
+	directly using the sys_cacheflush syscall.
+
+2007-07-27  Andrew Haley  <aph@redhat.com>
+
+	* src/arm/sysv.S (ffi_closure_SYSV): Add soft-float.
+
+2007-09-03  Maciej W. Rozycki  <macro@linux-mips.org>
+
+	* Makefile.am: Unify MIPS_IRIX and MIPS_LINUX into MIPS.
+	* configure.ac: Likewise.
+	* Makefile.in: Regenerate.
+	* include/Makefile.in: Likewise.
+	* testsuite/Makefile.in: Likewise.
+	* configure: Likewise.
+
+2007-08-24  David Daney  <ddaney@avtrex.com>
+
+	* testsuite/libffi.call/return_sl.c: New test.
+
+2007-08-10  David Daney  <ddaney@avtrex.com>
+
+	* testsuite/libffi.call/cls_multi_ushort.c,
+	testsuite/libffi.call/cls_align_uint16.c,
+	testsuite/libffi.call/nested_struct1.c,
+	testsuite/libffi.call/nested_struct3.c,
+	testsuite/libffi.call/cls_7_1_byte.c,
+	testsuite/libffi.call/nested_struct5.c,
+	testsuite/libffi.call/cls_double.c,
+	testsuite/libffi.call/nested_struct7.c,
+	testsuite/libffi.call/cls_sint.c,
+	testsuite/libffi.call/nested_struct9.c,
+	testsuite/libffi.call/cls_20byte1.c,
+	testsuite/libffi.call/cls_multi_sshortchar.c,
+	testsuite/libffi.call/cls_align_sint64.c,
+	testsuite/libffi.call/cls_3byte2.c,
+	testsuite/libffi.call/cls_multi_schar.c,
+	testsuite/libffi.call/cls_multi_uchar.c,
+	testsuite/libffi.call/cls_19byte.c,
+	testsuite/libffi.call/cls_9byte1.c,
+	testsuite/libffi.call/cls_align_float.c,
+	testsuite/libffi.call/closure_fn1.c,
+	testsuite/libffi.call/problem1.c,
+	testsuite/libffi.call/closure_fn3.c,
+	testsuite/libffi.call/cls_sshort.c,
+	testsuite/libffi.call/closure_fn5.c,
+	testsuite/libffi.call/cls_align_double.c,
+	testsuite/libffi.call/nested_struct.c,
+	testsuite/libffi.call/cls_2byte.c,
+	testsuite/libffi.call/nested_struct10.c,
+	testsuite/libffi.call/cls_4byte.c,
+	testsuite/libffi.call/cls_6byte.c,
+	testsuite/libffi.call/cls_8byte.c,
+	testsuite/libffi.call/cls_multi_sshort.c,
+	testsuite/libffi.call/cls_align_sint16.c,
+	testsuite/libffi.call/cls_align_uint32.c,
+	testsuite/libffi.call/cls_20byte.c,
+	testsuite/libffi.call/cls_float.c,
+	testsuite/libffi.call/nested_struct2.c,
+	testsuite/libffi.call/cls_5_1_byte.c,
+	testsuite/libffi.call/nested_struct4.c,
+	testsuite/libffi.call/cls_24byte.c,
+	testsuite/libffi.call/nested_struct6.c,
+	testsuite/libffi.call/cls_64byte.c,
+	testsuite/libffi.call/nested_struct8.c,
+	testsuite/libffi.call/cls_uint.c,
+	testsuite/libffi.call/cls_multi_ushortchar.c,
+	testsuite/libffi.call/cls_schar.c,
+	testsuite/libffi.call/cls_uchar.c,
+	testsuite/libffi.call/cls_align_uint64.c,
+	testsuite/libffi.call/cls_ulonglong.c,
+	testsuite/libffi.call/cls_align_longdouble.c,
+	testsuite/libffi.call/cls_1_1byte.c,
+	testsuite/libffi.call/cls_12byte.c,
+	testsuite/libffi.call/cls_3_1byte.c,
+	testsuite/libffi.call/cls_3byte1.c,
+	testsuite/libffi.call/cls_4_1byte.c,
+	testsuite/libffi.call/cls_6_1_byte.c,
+	testsuite/libffi.call/cls_16byte.c,
+	testsuite/libffi.call/cls_18byte.c,
+	testsuite/libffi.call/closure_fn0.c,
+	testsuite/libffi.call/cls_9byte2.c,
+	testsuite/libffi.call/closure_fn2.c,
+	testsuite/libffi.call/closure_fn4.c,
+	testsuite/libffi.call/cls_ushort.c,
+	testsuite/libffi.call/closure_fn6.c,
+	testsuite/libffi.call/cls_5byte.c,
+	testsuite/libffi.call/cls_align_pointer.c,
+	testsuite/libffi.call/cls_7byte.c,
+	testsuite/libffi.call/cls_align_sint32.c,
+	testsuite/libffi.special/unwindtest_ffi_call.cc,
+	testsuite/libffi.special/unwindtest.cc: Remove xfail for mips64*-*-*.
+
+2007-08-10  David Daney  <ddaney@avtrex.com>
+
+	PR libffi/28313
+	* configure.ac: Don't treat mips64 as a special case.
+	* Makefile.am (nodist_libffi_la_SOURCES): Add n32.S.
+	* configure: Regenerate
+	* Makefile.in: Ditto.
+	* fficonfig.h.in: Ditto.
+	* src/mips/ffitarget.h (REG_L, REG_S, SUBU, ADDU, SRL, LI): Indent.
+	(LA, EH_FRAME_ALIGN, FDE_ADDR_BYTES): New preprocessor macros.
+	(FFI_DEFAULT_ABI): Set for n64 case.
+	(FFI_CLOSURES, FFI_TRAMPOLINE_SIZE): Define for n32 and n64 cases.
+	* src/mips/n32.S (ffi_call_N32): Add debug macros and labels for FDE.
+	(ffi_closure_N32): New function.
+	(.eh_frame): New section
+	* src/mips/o32.S: Clean up comments.
+	(ffi_closure_O32): Pass ffi_closure parameter in $12.
+	* src/mips/ffi.c: Use FFI_MIPS_N32 instead of
+	_MIPS_SIM == _ABIN32 throughout.
+	(FFI_MIPS_STOP_HERE): New, use in place of
+	ffi_stop_here.
+	(ffi_prep_args): Use unsigned long to hold pointer values.  Rewrite
+	to support n32/n64 ABIs.
+	(calc_n32_struct_flags): Rewrite.
+	(calc_n32_return_struct_flags): Remove unused variable.  Reverse
+	position of flag bits.
+	(ffi_prep_cif_machdep): Rewrite n32 portion.
+	(ffi_call): Enable for n64.  Add special handling for small structure
+	return values.
+	(ffi_prep_closure_loc): Add n32 and n64 support.
+	(ffi_closure_mips_inner_O32): Add cast to silence warning.
+	(copy_struct_N32, ffi_closure_mips_inner_N32): New functions.
+
+2007-08-08  David Daney  <ddaney@avtrex.com>
+
+	* testsuite/libffi.call/ffitest.h (ffi_type_mylong): Remove definition.
+	* testsuite/libffi.call/cls_align_uint16.c (main): Use correct type
+	specifiers.
+	* testsuite/libffi.call/nested_struct1.c (main): Ditto.
+	* testsuite/libffi.call/cls_sint.c (main): Ditto.
+	* testsuite/libffi.call/nested_struct9.c (main): Ditto.
+	* testsuite/libffi.call/cls_20byte1.c (main): Ditto.
+	* testsuite/libffi.call/cls_9byte1.c (main): Ditto.
+	* testsuite/libffi.call/closure_fn1.c (main): Ditto.
+	* testsuite/libffi.call/closure_fn3.c (main): Ditto.
+	* testsuite/libffi.call/return_dbl2.c (main): Ditto.
+	* testsuite/libffi.call/cls_sshort.c (main): Ditto.
+	* testsuite/libffi.call/return_fl3.c (main): Ditto.
+	* testsuite/libffi.call/closure_fn5.c (main): Ditto.
+	* testsuite/libffi.call/nested_struct.c (main): Ditto.
+	* testsuite/libffi.call/nested_struct10.c (main): Ditto.
+	* testsuite/libffi.call/return_ll1.c (main): Ditto.
+	* testsuite/libffi.call/cls_8byte.c (main): Ditto.
+	* testsuite/libffi.call/cls_align_uint32.c (main): Ditto.
+	* testsuite/libffi.call/cls_align_sint16.c (main): Ditto.
+	* testsuite/libffi.call/cls_20byte.c (main): Ditto.
+	* testsuite/libffi.call/nested_struct2.c (main): Ditto.
+	* testsuite/libffi.call/cls_24byte.c (main): Ditto.
+	* testsuite/libffi.call/nested_struct6.c (main): Ditto.
+	* testsuite/libffi.call/cls_uint.c (main): Ditto.
+	* testsuite/libffi.call/cls_12byte.c (main): Ditto.
+	* testsuite/libffi.call/cls_16byte.c (main): Ditto.
+	* testsuite/libffi.call/closure_fn0.c (main): Ditto.
+	* testsuite/libffi.call/cls_9byte2.c (main): Ditto.
+	* testsuite/libffi.call/closure_fn2.c (main): Ditto.
+	* testsuite/libffi.call/return_dbl1.c (main): Ditto.
+	* testsuite/libffi.call/closure_fn4.c (main): Ditto.
+	* testsuite/libffi.call/closure_fn6.c (main): Ditto.
+	* testsuite/libffi.call/cls_align_sint32.c (main): Ditto.
+
+2007-08-07  Andrew Haley  <aph@redhat.com>
+
+	* src/x86/sysv.S (ffi_closure_raw_SYSV): Fix typo in previous
+	checkin.
+
+2007-08-06  Andrew Haley  <aph@redhat.com>
+
+	PR testsuite/32843
+	* src/x86/sysv.S (ffi_closure_raw_SYSV): Handle FFI_TYPE_UINT8,
+	FFI_TYPE_SINT8, FFI_TYPE_UINT16, FFI_TYPE_SINT16, FFI_TYPE_UINT32,
+	FFI_TYPE_SINT32.
+
+2007-08-02  David Daney  <ddaney@avtrex.com>
+
+	* testsuite/libffi.call/return_ul.c (main): Define return type as
+	ffi_arg.  Use proper printf conversion specifier.
+
+2007-07-30  Andrew Haley  <aph@redhat.com>
+
+	PR testsuite/32843
+	* src/x86/ffi.c (ffi_prep_cif_machdep): in x86 case, add code for
+	signed/unsigned int8/16.
+	* src/x86/sysv.S (ffi_call_SYSV): Rewrite to:
+	Use a jump table.
+	Remove code to pop args from the stack after call.
+	Special-case signed/unsigned int8/16.
+	* testsuite/libffi.call/return_sc.c (main): Revert.
+
+2007-07-26  Richard Guenther  <rguenther@suse.de>
+
+	PR testsuite/32843
+	* testsuite/libffi.call/return_sc.c (main): Verify call
+	result as signed char, not ffi_arg.
+
+2007-07-16  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
+
+	* configure.ac (i?86-*-solaris2.1[0-9]): Set TARGET to X86_64.
+	* configure: Regenerate.
+
+2007-07-11  David Daney  <ddaney@avtrex.com>
+
+	* src/mips/ffi.c: Don't include sys/cachectl.h.
+	(ffi_prep_closure_loc): Use __builtin___clear_cache() instead of
+	cacheflush().
+
+2007-05-18  Aurelien Jarno  <aurelien@aurel32.net>
+
+	* src/arm/ffi.c (ffi_prep_closure_loc): Renamed and ajusted
+	from (ffi_prep_closure): ... this.
+	(FFI_INIT_TRAMPOLINE): Adjust.
+
+2005-12-31  Phil Blundell  <pb@reciva.com>
+
+	* src/arm/ffi.c (ffi_prep_incoming_args_SYSV,
+	ffi_closure_SYSV_inner, ffi_prep_closure): New, add closure support.
+	* src/arm/sysv.S(ffi_closure_SYSV): Likewise.
+	* src/arm/ffitarget.h (FFI_TRAMPOLINE_SIZE): Likewise.
+	(FFI_CLOSURES): Enable closure support.
+
+2007-07-03  Andrew Haley  <aph@hedges.billgatliff.com>
+
+	* testsuite/libffi.call/cls_multi_ushort.c,
+	testsuite/libffi.call/cls_align_uint16.c,
+	testsuite/libffi.call/nested_struct1.c,
+	testsuite/libffi.call/nested_struct3.c,
+	testsuite/libffi.call/cls_7_1_byte.c,
+	testsuite/libffi.call/cls_double.c,
+	testsuite/libffi.call/nested_struct5.c,
+	testsuite/libffi.call/nested_struct7.c,
+	testsuite/libffi.call/cls_sint.c,
+	testsuite/libffi.call/nested_struct9.c,
+	testsuite/libffi.call/cls_20byte1.c,
+	testsuite/libffi.call/cls_multi_sshortchar.c,
+	testsuite/libffi.call/cls_align_sint64.c,
+	testsuite/libffi.call/cls_3byte2.c,
+	testsuite/libffi.call/cls_multi_schar.c,
+	testsuite/libffi.call/cls_multi_uchar.c,
+	testsuite/libffi.call/cls_19byte.c,
+	testsuite/libffi.call/cls_9byte1.c,
+	testsuite/libffi.call/cls_align_float.c,
+	testsuite/libffi.call/closure_fn1.c,
+	testsuite/libffi.call/problem1.c,
+	testsuite/libffi.call/closure_fn3.c,
+	testsuite/libffi.call/cls_sshort.c,
+	testsuite/libffi.call/closure_fn5.c,
+	testsuite/libffi.call/cls_align_double.c,
+	testsuite/libffi.call/cls_2byte.c,
+	testsuite/libffi.call/nested_struct.c,
+	testsuite/libffi.call/nested_struct10.c,
+	testsuite/libffi.call/cls_4byte.c,
+	testsuite/libffi.call/cls_6byte.c,
+	testsuite/libffi.call/cls_8byte.c,
+	testsuite/libffi.call/cls_multi_sshort.c,
+	testsuite/libffi.call/cls_align_uint32.c,
+	testsuite/libffi.call/cls_align_sint16.c,
+	testsuite/libffi.call/cls_float.c,
+	testsuite/libffi.call/cls_20byte.c,
+	testsuite/libffi.call/cls_5_1_byte.c,
+	testsuite/libffi.call/nested_struct2.c,
+	testsuite/libffi.call/cls_24byte.c,
+	testsuite/libffi.call/nested_struct4.c,
+	testsuite/libffi.call/nested_struct6.c,
+	testsuite/libffi.call/cls_64byte.c,
+	testsuite/libffi.call/nested_struct8.c,
+	testsuite/libffi.call/cls_uint.c,
+	testsuite/libffi.call/cls_multi_ushortchar.c,
+	testsuite/libffi.call/cls_schar.c,
+	testsuite/libffi.call/cls_uchar.c,
+	testsuite/libffi.call/cls_align_uint64.c,
+	testsuite/libffi.call/cls_ulonglong.c,
+	testsuite/libffi.call/cls_align_longdouble.c,
+	testsuite/libffi.call/cls_1_1byte.c,
+	testsuite/libffi.call/cls_12byte.c,
+	testsuite/libffi.call/cls_3_1byte.c,
+	testsuite/libffi.call/cls_3byte1.c,
+	testsuite/libffi.call/cls_4_1byte.c,
+	testsuite/libffi.call/cls_6_1_byte.c,
+	testsuite/libffi.call/cls_16byte.c,
+	testsuite/libffi.call/cls_18byte.c,
+	testsuite/libffi.call/closure_fn0.c,
+	testsuite/libffi.call/cls_9byte2.c,
+	testsuite/libffi.call/closure_fn2.c,
+	testsuite/libffi.call/closure_fn4.c,
+	testsuite/libffi.call/cls_ushort.c,
+	testsuite/libffi.call/closure_fn6.c,
+	testsuite/libffi.call/cls_5byte.c,
+	testsuite/libffi.call/cls_align_pointer.c,
+	testsuite/libffi.call/cls_7byte.c,
+	testsuite/libffi.call/cls_align_sint32.c,
+	testsuite/libffi.special/unwindtest_ffi_call.cc,
+	testsuite/libffi.special/unwindtest.cc: Enable for ARM.
+
+2007-07-05  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* aclocal.m4: Regenerated.
+
+2007-06-02  Paolo Bonzini  <bonzini@gnu.org>
+
+	* configure: Regenerate.
+
+2007-05-23  Steve Ellcey  <sje@cup.hp.com>
+
+	* Makefile.in: Regenerate.
+	* configure: Regenerate.
+	* aclocal.m4: Regenerate.
+	* include/Makefile.in: Regenerate.
+	* testsuite/Makefile.in: Regenerate.
+
+2007-05-10  Roman Zippel <zippel@linux-m68k.org>
+
+	* src/m68k/ffi.c (ffi_prep_incoming_args_SYSV,
+	ffi_closure_SYSV_inner,ffi_prep_closure): New, add closure support.
+	* src/m68k/sysv.S(ffi_closure_SYSV,ffi_closure_struct_SYSV): Likewise.
+	* src/m68k/ffitarget.h (FFI_TRAMPOLINE_SIZE): Likewise.
+	(FFI_CLOSURES): Enable closure support.
+
+2007-05-10  Roman Zippel <zippel@linux-m68k.org>
+
+	* configure.ac (HAVE_AS_CFI_PSEUDO_OP): New test.
+	* configure: Regenerate.
+	* fficonfig.h.in: Regenerate.
+	* src/m68k/sysv.S (CFI_STARTPROC,CFI_ENDPROC,
+	CFI_OFFSET,CFI_DEF_CFA): New macros.
+	(ffi_call_SYSV): Add callframe annotation.
+
+2007-05-10  Roman Zippel <zippel@linux-m68k.org>
+
+	* src/m68k/ffi.c (ffi_prep_args,ffi_prep_cif_machdep): Fix
+	numerous test suite failures.
+	* src/m68k/sysv.S (ffi_call_SYSV): Likewise.
+
+2007-04-11  Paolo Bonzini  <bonzini@gnu.org>
+
+	* Makefile.am (EXTRA_DIST): Bring up to date.
+	* Makefile.in: Regenerate.
+	* src/frv/eabi.S: Remove RCS keyword.
+
+2007-04-06  Richard Henderson  <rth@redhat.com>
+
+	* configure.ac: Tidy target case.
+	(HAVE_LONG_DOUBLE): Allow the target to override.
+	* configure: Regenerate.
+	* include/ffi.h.in: Don't define ffi_type_foo if
+	LIBFFI_HIDE_BASIC_TYPES is defined.
+	(ffi_type_longdouble): If not HAVE_LONG_DOUBLE, define
+	to ffi_type_double.
+	* types.c (LIBFFI_HIDE_BASIC_TYPES): Define.
+	(FFI_TYPEDEF, ffi_type_void): Mark the data const.
+	(ffi_type_longdouble): Special case for Alpha.  Don't define
+	if long double == double.
+
+	* src/alpha/ffi.c (FFI_TYPE_LONGDOUBLE): Assert unique value.
+	(ffi_prep_cif_machdep): Handle it as the 128-bit type.
+	(ffi_call, ffi_closure_osf_inner): Likewise.
+	(ffi_closure_osf_inner): Likewise.  Mark hidden.
+	(ffi_call_osf, ffi_closure_osf): Mark hidden.
+	* src/alpha/ffitarget.h (FFI_LAST_ABI): Tidy definition.
+	* src/alpha/osf.S (ffi_call_osf, ffi_closure_osf): Mark hidden.
+	(load_table): Handle 128-bit long double.
+
+	* testsuite/libffi.call/float4.c: Add -mieee for alpha.
+
+2007-04-06  Tom Tromey  <tromey@redhat.com>
+
+	PR libffi/31491:
+	* README: Fixed bug in example.
+
+2007-04-03  Jakub Jelinek  <jakub@redhat.com>
+
+	* src/closures.c: Include sys/statfs.h.
+	(_GNU_SOURCE): Define on Linux.
+	(FFI_MMAP_EXEC_SELINUX): Define.
+	(selinux_enabled): New variable.
+	(selinux_enabled_check): New function.
+	(is_selinux_enabled): Define.
+	(dlmmap): Use it.
+
+2007-03-24  Uros Bizjak  <ubizjak@gmail.com>
+
+	* testsuite/libffi.call/return_fl2.c (return_fl): Mark as static.
+	Use 'volatile float sum' to create sum of floats to avoid false
+	negative due to excess precision on ix86 targets.
+	(main): Ditto.
+
+2007-03-08  Alexandre Oliva  <aoliva@redhat.com>
+
+	* src/powerpc/ffi.c (flush_icache): Fix left-over from previous
+	patch.
+	(ffi_prep_closure_loc): Remove unneeded casts.  Add needed ones.
+
+2007-03-07  Alexandre Oliva  <aoliva@redhat.com>
+
+	* include/ffi.h.in (ffi_closure_alloc, ffi_closure_free): New.
+	(ffi_prep_closure_loc): New.
+	(ffi_prep_raw_closure_loc): New.
+	(ffi_prep_java_raw_closure_loc): New.
+	* src/closures.c: New file.
+	* src/dlmalloc.c [FFI_MMAP_EXEC_WRIT] (struct malloc_segment):
+	Replace sflags with exec_offset.
+	[FFI_MMAP_EXEC_WRIT] (mmap_exec_offset, add_segment_exec_offset,
+	sub_segment_exec_offset): New macros.
+	(get_segment_flags, set_segment_flags, check_segment_merge): New
+	macros.
+	(is_mmapped_segment, is_extern_segment): Use get_segment_flags.
+	(add_segment, sys_alloc, create_mspace, create_mspace_with_base,
+	destroy_mspace): Use new macros.
+	(sys_alloc): Silence warning.
+	* Makefile.am (libffi_la_SOURCES): Add src/closures.c.
+	* Makefile.in: Rebuilt.
+	* src/prep_cif [FFI_CLOSURES] (ffi_prep_closure): Implement in
+	terms of ffi_prep_closure_loc.
+	* src/raw_api.c (ffi_prep_raw_closure_loc): Renamed and adjusted
+	from...
+	(ffi_prep_raw_closure): ... this.  Re-implement in terms of the
+	renamed version.
+	* src/java_raw_api (ffi_prep_java_raw_closure_loc): Renamed and
+	adjusted from...
+	(ffi_prep_java_raw_closure): ... this.  Re-implement in terms of
+	the renamed version.
+	* src/alpha/ffi.c (ffi_prep_closure_loc): Renamed from
+	(ffi_prep_closure): ... this.
+	* src/pa/ffi.c: Likewise.
+	* src/cris/ffi.c: Likewise.  Adjust.
+	* src/frv/ffi.c: Likewise.
+	* src/ia64/ffi.c: Likewise.
+	* src/mips/ffi.c: Likewise.
+	* src/powerpc/ffi_darwin.c: Likewise.
+	* src/s390/ffi.c: Likewise.
+	* src/sh/ffi.c: Likewise.
+	* src/sh64/ffi.c: Likewise.
+	* src/sparc/ffi.c: Likewise.
+	* src/x86/ffi64.c: Likewise.
+	* src/x86/ffi.c: Likewise.
+	(FFI_INIT_TRAMPOLINE): Adjust.
+	(ffi_prep_raw_closure_loc): Renamed and adjusted from...
+	(ffi_prep_raw_closure): ... this.
+	* src/powerpc/ffi.c (ffi_prep_closure_loc): Renamed from
+	(ffi_prep_closure): ... this.
+	(flush_icache): Adjust.
+
+2007-03-07  Alexandre Oliva  <aoliva@redhat.com>
+
+	* src/dlmalloc.c: New file, imported version 2.8.3 of Doug
+	Lea's malloc.
+
+2007-03-01  Brooks Moses  <brooks.moses@codesourcery.com>
+
+	* Makefile.am: Add dummy install-pdf target.
+	* Makefile.in: Regenerate
+
+2007-02-13  Andreas Krebbel  <krebbel1@de.ibm.com>
+
+	* src/s390/ffi.c (ffi_prep_args, ffi_prep_cif_machdep,
+	ffi_closure_helper_SYSV): Add long double handling.
+
+2007-02-02  Jakub Jelinek  <jakub@redhat.com>
+
+	* src/powerpc/linux64.S (ffi_call_LINUX64): Move restore of r2
+	immediately after bctrl instruction.
+
+2007-01-18  Alexandre Oliva  <aoliva@redhat.com>
+
+	* Makefile.am (all-recursive, install-recursive,
+	mostlyclean-recursive, clean-recursive, distclean-recursive,
+	maintainer-clean-recursive): Add missing targets.
+	* Makefile.in: Rebuilt.
+
+2006-12-14  Andreas Tobler  <a.tobler@schweiz.org>
+
+	* configure.ac: Add TARGET for x86_64-*-darwin*.
+	* Makefile.am (nodist_libffi_la_SOURCES): Add rules for 64-bit sources
+	for X86_DARWIN.
+	* src/x86/ffitarget.h: Set trampoline size for x86_64-*-darwin*.
+	* src/x86/darwin64.S: New file for x86_64-*-darwin* support.
+	* configure: Regenerate.
+	* Makefile.in: Regenerate.
+	* include/Makefile.in: Regenerate.
+	* testsuite/Makefile.in: Regenerate.
+	* testsuite/libffi.special/unwindtest_ffi_call.cc: New test case for
+	ffi_call only.
+
+2006-12-13  Andreas Tobler <a.tobler@schweiz.org>
+
+	* aclocal.m4: Regenerate with aclocal -I .. as written in the
+	Makefile.am.
+
+2006-10-31  Geoffrey Keating  <geoffk@apple.com>
+
+	* src/powerpc/ffi_darwin.c (darwin_adjust_aggregate_sizes): New.
+	(ffi_prep_cif_machdep): Call darwin_adjust_aggregate_sizes for
+	Darwin.
+	* testsuite/libffi.call/nested_struct4.c: Remove Darwin XFAIL.
+	* testsuite/libffi.call/nested_struct6.c: Remove Darwin XFAIL.
+
+2006-10-10  Paolo Bonzini  <bonzini@gnu.org>
+	    Sandro Tolaini  <tolaini@libero.it>
+
+	* configure.ac [i*86-*-darwin*]: Set X86_DARWIN symbol and
+	conditional.
+	* configure: Regenerated.
+	* Makefile.am (nodist_libffi_la_SOURCES) [X86_DARWIN]: New case.
+	(EXTRA_DIST): Add src/x86/darwin.S.
+	* Makefile.in: Regenerated.
+	* include/Makefile.in: Regenerated.
+	* testsuite/Makefile.in: Regenerated.
+
+	* src/x86/ffi.c (ffi_prep_cif_machdep) [X86_DARWIN]: Treat like
+	X86_WIN32, and additionally align stack to 16 bytes.
+	* src/x86/darwin.S: New, based on sysv.S.
+	* src/prep_cif.c (ffi_prep_cif) [X86_DARWIN]: Align > 8-byte structs.
+
+2006-09-12  David Daney  <ddaney@avtrex.com>
+
+	PR libffi/23935
+	* include/Makefile.am: Install both ffi.h and ffitarget.h in
+	$(libdir)/gcc/$(target_alias)/$(gcc_version)/include.
+	* aclocal.m4: Regenerated for automake 1.9.6.
+	* Makefile.in: Regenerated.
+	* include/Makefile.in: Regenerated.
+	* testsuite/Makefile.in: Regenerated.
+
+2006-08-17  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* include/ffi_common.h (struct): Revert accidental commit.
+
+2006-08-15  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* include/ffi_common.h: Remove lint directives.
+	* include/ffi.h.in: Likewise.
+
+2006-07-25  Torsten Schoenfeld  <kaffeetisch@gmx.de>
+
+	* include/ffi.h.in (ffi_type_ulong, ffi_type_slong): Define correctly
+	for 32-bit architectures.
+	* testsuite/libffi.call/return_ul.c: New test case.
+
+2006-07-19  David Daney  <ddaney@avtrex.com>
+
+	* testsuite/libffi.call/closure_fn6.c: Remove xfail for mips,
+	xfail remains for mips64.
+
+2006-05-23  Carlos O'Donell  <carlos@codesourcery.com>
+
+	* Makefile.am: Add install-html target. Add install-html to .PHONY
+	* Makefile.in: Regenerate.
+	* aclocal.m4: Regenerate.
+	* include/Makefile.in: Regenerate.
+	* testsuite/Makefile.in: Regenerate.
+
+2006-05-18  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+	* pa/ffi.c (ffi_prep_args_pa32): Load floating point arguments from
+	stack slot.
+
+2006-04-22  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* README: Remove notice about 'Crazy Comments'.
+	* src/debug.c: Remove lint directives. Cleanup white spaces.
+	* src/java_raw_api.c: Likewise.
+	* src/prep_cif.c: Likewise.
+	* src/raw_api.c: Likewise.
+	* src/ffitest.c: Delete. No longer needed, all test cases migrated
+	to the testsuite.
+	* src/arm/ffi.c: Remove lint directives.
+	* src/m32r/ffi.c: Likewise.
+	* src/pa/ffi.c: Likewise.
+	* src/powerpc/ffi.c: Likewise.
+	* src/powerpc/ffi_darwin.c: Likewise.
+	* src/sh/ffi.c: Likewise.
+	* src/sh64/ffi.c: Likewise.
+	* src/x86/ffi.c: Likewise.
+	* testsuite/libffi.call/float2.c: Likewise.
+	* testsuite/libffi.call/promotion.c: Likewise.
+	* testsuite/libffi.call/struct1.c: Likewise.
+
+2006-04-13  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* src/pa/hpux32.S: Correct unwind offset calculation for
+	ffi_closure_pa32.
+	* src/pa/linux.S: Likewise.
+
+2006-04-12  James E Wilson  <wilson@specifix.com>
+
+	PR libgcj/26483
+	* src/ia64/ffi.c (stf_spill, ldf_fill): Rewrite as macros.
+	(hfa_type_load): Call stf_spill.
+	(hfa_type_store): Call ldf_fill.
+	(ffi_call): Adjust calls to above routines.  Add local temps for
+	macro result.
+
+2006-04-10  Matthias Klose  <doko@debian.org>
+
+	* testsuite/lib/libffi-dg.exp (libffi-init): Recognize multilib
+	directory names containing underscores.
+
+2006-04-07  James E Wilson  <wilson@specifix.com>
+
+	* testsuite/libffi.call/float4.c: New testcase.
+
+2006-04-05  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+	    Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* Makefile.am: Add PA_HPUX port.
+	* Makefile.in: Regenerate.
+	* include/Makefile.in: Likewise.
+	* testsuite/Makefile.in: Likewise.
+	* configure.ac: Add PA_HPUX rules.
+	* configure: Regenerate.
+	* src/pa/ffitarget.h: Rename linux target to PA_LINUX.
+	Add PA_HPUX and PA64_HPUX.
+	Rename FFI_LINUX ABI to FFI_PA32 ABI.
+	(FFI_TRAMPOLINE_SIZE): Define for 32-bit HP-UX targets.
+	(FFI_TYPE_SMALL_STRUCT2): Define.
+	(FFI_TYPE_SMALL_STRUCT4): Likewise.
+	(FFI_TYPE_SMALL_STRUCT8): Likewise.
+	(FFI_TYPE_SMALL_STRUCT3): Redefine.
+	(FFI_TYPE_SMALL_STRUCT5): Likewise.
+	(FFI_TYPE_SMALL_STRUCT6): Likewise.
+	(FFI_TYPE_SMALL_STRUCT7): Likewise.
+	* src/pa/ffi.c (ROUND_DOWN): Delete.
+	(fldw, fstw, fldd, fstd): Use '__asm__'.
+	(ffi_struct_type): Add support for FFI_TYPE_SMALL_STRUCT2,
+	FFI_TYPE_SMALL_STRUCT4 and FFI_TYPE_SMALL_STRUCT8.
+	(ffi_prep_args_LINUX): Rename to ffi_prep_args_pa32. Update comment.
+	Simplify incrementing of stack slot variable. Change type of local
+	'n' to unsigned int.
+	(ffi_size_stack_LINUX): Rename to ffi_size_stack_pa32. Handle long
+	double on PA_HPUX.
+	(ffi_prep_cif_machdep): Likewise.
+	(ffi_call): Likewise.
+	(ffi_closure_inner_LINUX): Rename to ffi_closure_inner_pa32. Change
+	return type to ffi_status. Simplify incrementing of stack slot
+	variable. Only copy floating point argument registers when PA_LINUX
+	is true. Reformat debug statement.
+	Add support for FFI_TYPE_SMALL_STRUCT2, FFI_TYPE_SMALL_STRUCT4 and
+	FFI_TYPE_SMALL_STRUCT8.
+	(ffi_closure_LINUX): Rename to ffi_closure_pa32. Add 'extern' to
+	declaration.
+	(ffi_prep_closure): Make linux trampoline conditional on PA_LINUX.
+	Add nops to cache flush.  Add trampoline for PA_HPUX.
+	* src/pa/hpux32.S: New file.
+	* src/pa/linux.S (ffi_call_LINUX): Rename to ffi_call_pa32. Rename
+	ffi_prep_args_LINUX to ffi_prep_args_pa32.
+	Localize labels. Add support for 2, 4 and 8-byte small structs. Handle
+	unaligned destinations in 3, 5, 6 and 7-byte small structs. Order
+	argument type checks so that common argument types appear first.
+	(ffi_closure_LINUX): Rename to ffi_closure_pa32. Rename
+	ffi_closure_inner_LINUX to ffi_closure_inner_pa32.
+
+2006-03-24  Alan Modra  <amodra@bigpond.net.au>
+
+	* src/powerpc/ffitarget.h (enum ffi_abi): Add FFI_LINUX.  Default
+	for 32-bit using IBM extended double format.  Fix FFI_LAST_ABI.
+	* src/powerpc/ffi.c (ffi_prep_args_SYSV): Handle linux variant of
+	FFI_TYPE_LONGDOUBLE.
+	(ffi_prep_args64): Assert using IBM extended double.
+	(ffi_prep_cif_machdep): Don't munge FFI_TYPE_LONGDOUBLE type.
+	Handle FFI_LINUX FFI_TYPE_LONGDOUBLE return and args.
+	(ffi_call): Handle FFI_LINUX.
+	(ffi_closure_helper_SYSV): Non FFI_LINUX long double return needs
+	gpr3 return pointer as for struct return.  Handle FFI_LINUX
+	FFI_TYPE_LONGDOUBLE return and args.  Don't increment "nf"
+	unnecessarily.
+	* src/powerpc/ppc_closure.S (ffi_closure_SYSV): Load both f1 and f2
+	for FFI_TYPE_LONGDOUBLE.  Move epilogue insns into case table.
+	Don't use r6 as pointer to results, instead use sp offset.  Don't
+	make a special call to load lr with case table address, instead
+	use offset from previous call.
+	* src/powerpc/sysv.S (ffi_call_SYSV): Save long double return.
+	* src/powerpc/linux64.S (ffi_call_LINUX64): Simplify long double
+	return.
+
+2006-03-15  Kaz Kojima  <kkojima@gcc.gnu.org>
+
+	* src/sh64/ffi.c (ffi_prep_cif_machdep): Handle float arguments
+	passed with FP registers correctly.
+	(ffi_closure_helper_SYSV): Likewise.
+	* src/sh64/sysv.S: Likewise.
+
+2006-03-01  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* testsuite/libffi.special/unwindtest.cc (closure_test_fn): Mark cif,
+	args and userdata unused.
+	(closure_test_fn1): Mark cif and userdata unused.
+	(main): Remove unused res.
+
+2006-02-28  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* testsuite/libffi.call/call.exp: Adjust FSF address. Add test runs for
+	-O2, -O3, -Os and the warning flags -W -Wall.
+	* testsuite/libffi.special/special.exp: Likewise.
+	* testsuite/libffi.call/ffitest.h: Add an __UNUSED__ macro to mark
+	unused parameter unused for gcc or else do nothing.
+	* testsuite/libffi.special/ffitestcxx.h: Likewise.
+	* testsuite/libffi.call/cls_12byte.c (cls_struct_12byte_gn): Mark cif
+	and userdata unused.
+	* testsuite/libffi.call/cls_16byte.c (cls_struct_16byte_gn): Likewise.
+	* testsuite/libffi.call/cls_18byte.c (cls_struct_18byte_gn): Likewise.
+	* testsuite/libffi.call/cls_19byte.c (cls_struct_19byte_gn): Likewise.
+	* testsuite/libffi.call/cls_1_1byte.c (cls_struct_1_1byte_gn): Likewise.
+	* testsuite/libffi.call/cls_20byte.c (cls_struct_20byte_gn): Likewise.
+	* testsuite/libffi.call/cls_20byte1.c (cls_struct_20byte_gn): Likewise.
+	* testsuite/libffi.call/cls_24byte.c (cls_struct_24byte_gn): Likewise.
+	* testsuite/libffi.call/cls_2byte.c (cls_struct_2byte_gn): Likewise.
+	* testsuite/libffi.call/cls_3_1byte.c (cls_struct_3_1byte_gn): Likewise.
+	* testsuite/libffi.call/cls_3byte1.c (cls_struct_3byte_gn): Likewise.
+	* testsuite/libffi.call/cls_3byte2.c (cls_struct_3byte_gn1): Likewise.
+	* testsuite/libffi.call/cls_4_1byte.c (cls_struct_4_1byte_gn): Likewise.
+	* testsuite/libffi.call/cls_4byte.c (cls_struct_4byte_gn): Likewise.
+	* testsuite/libffi.call/cls_5_1_byte.c (cls_struct_5byte_gn): Likewise.
+	* testsuite/libffi.call/cls_5byte.c (cls_struct_5byte_gn): Likewise.
+	* testsuite/libffi.call/cls_64byte.c (cls_struct_64byte_gn): Likewise.
+	* testsuite/libffi.call/cls_6_1_byte.c (cls_struct_6byte_gn): Likewise.
+	* testsuite/libffi.call/cls_6byte.c (cls_struct_6byte_gn): Likewise.
+	* testsuite/libffi.call/cls_7_1_byte.c (cls_struct_7byte_gn): Likewise.
+	* testsuite/libffi.call/cls_7byte.c (cls_struct_7byte_gn): Likewise.
+	* testsuite/libffi.call/cls_8byte.c (cls_struct_8byte_gn): Likewise.
+	* testsuite/libffi.call/cls_9byte1.c (cls_struct_9byte_gn): Likewise.
+	* testsuite/libffi.call/cls_9byte2.c (cls_struct_9byte_gn): Likewise.
+	* testsuite/libffi.call/cls_align_double.c (cls_struct_align_gn):
+	Likewise.
+	* testsuite/libffi.call/cls_align_float.c (cls_struct_align_gn):
+	Likewise.
+	* testsuite/libffi.call/cls_align_longdouble.c (cls_struct_align_gn):
+	Likewise.
+	* testsuite/libffi.call/cls_align_pointer.c (cls_struct_align_fn): Cast
+	void* to avoid compiler warning.
+	(main): Likewise.
+	(cls_struct_align_gn): Mark cif and userdata unused.
+	* testsuite/libffi.call/cls_align_sint16.c (cls_struct_align_gn):
+	Likewise.
+	* testsuite/libffi.call/cls_align_sint32.c (cls_struct_align_gn):
+	Likewise.
+	* testsuite/libffi.call/cls_align_sint64.c (cls_struct_align_gn):
+	Likewise.
+	* testsuite/libffi.call/cls_align_uint16.c (cls_struct_align_gn):
+	Likewise.
+	* testsuite/libffi.call/cls_align_uint32.c (cls_struct_align_gn):
+	Likewise.
+	* testsuite/libffi.call/cls_double.c (cls_ret_double_fn): Likewise.
+	* testsuite/libffi.call/cls_float.c (cls_ret_float_fn): Likewise.
+	* testsuite/libffi.call/cls_multi_schar.c (test_func_gn): Mark cif and
+	data unused.
+	(main): Cast res_call to silence gcc.
+	* testsuite/libffi.call/cls_multi_sshort.c (test_func_gn): Mark cif and
+	data unused.
+	(main): Cast res_call to silence gcc.
+	* testsuite/libffi.call/cls_multi_sshortchar.c (test_func_gn): Mark cif
+	and data unused.
+	(main): Cast res_call to silence gcc.
+	* testsuite/libffi.call/cls_multi_uchar.c (test_func_gn): Mark cif and
+	data unused.
+	(main): Cast res_call to silence gcc.
+	* testsuite/libffi.call/cls_multi_ushort.c (test_func_gn): Mark cif and
+	data unused.
+	(main): Cast res_call to silence gcc.
+	* testsuite/libffi.call/cls_multi_ushortchar.c (test_func_gn): Mark cif
+	and data unused.
+	(main): Cast res_call to silence gcc.
+	* testsuite/libffi.call/cls_schar.c (cls_ret_schar_fn): Mark cif and
+	userdata unused.
+	(cls_ret_schar_fn): Cast printf parameter to silence gcc.
+	* testsuite/libffi.call/cls_sint.c (cls_ret_sint_fn): Mark cif and
+	userdata unused.
+	(cls_ret_sint_fn): Cast printf parameter to silence gcc.
+	* testsuite/libffi.call/cls_sshort.c (cls_ret_sshort_fn): Mark cif and
+	userdata unused.
+	(cls_ret_sshort_fn): Cast printf parameter to silence gcc.
+	* testsuite/libffi.call/cls_uchar.c (cls_ret_uchar_fn):  Mark cif and
+	userdata unused.
+	(cls_ret_uchar_fn): Cast printf parameter to silence gcc.
+	* testsuite/libffi.call/cls_uint.c (cls_ret_uint_fn): Mark cif and
+	userdata unused.
+	(cls_ret_uint_fn): Cast printf parameter to silence gcc.
+	* testsuite/libffi.call/cls_ulonglong.c (cls_ret_ulonglong_fn): Mark cif
+	and userdata unused.
+	* testsuite/libffi.call/cls_ushort.c (cls_ret_ushort_fn): Mark cif and
+	userdata unused.
+	(cls_ret_ushort_fn): Cast printf parameter to silence gcc.
+	* testsuite/libffi.call/float.c (floating): Remove unused parameter e.
+	* testsuite/libffi.call/float1.c (main): Remove unused variable i.
+	Cleanup white spaces.
+	* testsuite/libffi.call/negint.c (checking): Remove unused variable i.
+	* testsuite/libffi.call/nested_struct.c (cls_struct_combined_gn): Mark
+	cif and userdata unused.
+	* testsuite/libffi.call/nested_struct1.c (cls_struct_combined_gn):
+	Likewise.
+	* testsuite/libffi.call/nested_struct10.c (B_gn): Likewise.
+	* testsuite/libffi.call/nested_struct2.c (B_fn): Adjust printf
+	formatters to silence gcc.
+	(B_gn): Mark cif and userdata unused.
+	* testsuite/libffi.call/nested_struct3.c (B_gn): Mark cif and userdata
+	unused.
+	* testsuite/libffi.call/nested_struct4.c: Mention related PR.
+	(B_gn): Mark cif and userdata unused.
+	* testsuite/libffi.call/nested_struct5.c (B_gn): Mark cif and userdata
+	unused.
+	* testsuite/libffi.call/nested_struct6.c: Mention related PR.
+	(B_gn): Mark cif and userdata unused.
+	* testsuite/libffi.call/nested_struct7.c (B_gn): Mark cif and userdata
+	unused.
+	* testsuite/libffi.call/nested_struct8.c (B_gn): Likewise.
+	* testsuite/libffi.call/nested_struct9.c (B_gn): Likewise.
+	* testsuite/libffi.call/problem1.c (stub): Likewise.
+	* testsuite/libffi.call/pyobjc-tc.c (main): Cast the result to silence
+	gcc.
+	* testsuite/libffi.call/return_fl2.c (return_fl): Add the note mentioned
+	in the last commit for this test case in the test case itself.
+	* testsuite/libffi.call/closure_fn0.c (closure_test_fn0): Mark cif as
+	unused.
+	* testsuite/libffi.call/closure_fn1.c (closure_test_fn1): Likewise.
+	* testsuite/libffi.call/closure_fn2.c (closure_test_fn2): Likewise.
+	* testsuite/libffi.call/closure_fn3.c (closure_test_fn3): Likewise.
+	* testsuite/libffi.call/closure_fn4.c (closure_test_fn0): Likewise.
+	* testsuite/libffi.call/closure_fn5.c (closure_test_fn5): Likewise.
+	* testsuite/libffi.call/closure_fn6.c (closure_test_fn0): Likewise.
+
+2006-02-22  Kaz Kojima  <kkojima@gcc.gnu.org>
+
+	* src/sh/sysv.S: Fix register numbers in the FDE for
+	ffi_closure_SYSV.
+
+2006-02-20  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* testsuite/libffi.call/return_fl2.c (return_fl): Remove static
+	declaration to avoid a false negative on ix86. See PR323.
+
+2006-02-18  Kaz Kojima  <kkojima@gcc.gnu.org>
+
+	* src/sh/ffi.c (ffi_closure_helper_SYSV): Remove unused variable
+	and cast integer to void * if needed.  Update the pointer to
+	the FP register saved area correctly.
+
+2006-02-17  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* testsuite/libffi.call/nested_struct6.c: XFAIL this test until PR25630
+	is fixed.
+	* testsuite/libffi.call/nested_struct4.c: Likewise.
+
+2006-02-16  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* testsuite/libffi.call/return_dbl.c: New test case.
+	* testsuite/libffi.call/return_dbl1.c: Likewise.
+	* testsuite/libffi.call/return_dbl2.c: Likewise.
+	* testsuite/libffi.call/return_fl.c: Likewise.
+	* testsuite/libffi.call/return_fl1.c: Likewise.
+	* testsuite/libffi.call/return_fl2.c: Likewise.
+	* testsuite/libffi.call/return_fl3.c: Likewise.
+	* testsuite/libffi.call/closure_fn6.c: Likewise.
+
+	* testsuite/libffi.call/nested_struct2.c: Remove ffi_type_mylong
+	definition.
+	* testsuite/libffi.call/ffitest.h: Add ffi_type_mylong definition
+	here to be used by other test cases too.
+
+	* testsuite/libffi.call/nested_struct10.c: New test case.
+	* testsuite/libffi.call/nested_struct9.c: Likewise.
+	* testsuite/libffi.call/nested_struct8.c: Likewise.
+	* testsuite/libffi.call/nested_struct7.c: Likewise.
+	* testsuite/libffi.call/nested_struct6.c: Likewise.
+	* testsuite/libffi.call/nested_struct5.c: Likewise.
+	* testsuite/libffi.call/nested_struct4.c: Likewise.
+
+2006-01-21  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* configure.ac: Enable libffi for sparc64-*-freebsd*.
+	* configure: Rebuilt.
+
+2006-01-18  Jakub Jelinek  <jakub@redhat.com>
+
+	* src/powerpc/sysv.S (smst_two_register): Don't call __ashldi3,
+	instead do the shifting inline.
+	* src/powerpc/ppc_closure.S (ffi_closure_SYSV): Don't compute %r5
+	shift count unconditionally.  Simplify load sequences for 1, 2, 3, 4
+	and 8 byte structs, for the remaining struct sizes don't call
+	__lshrdi3, instead do the shifting inline.
+
+2005-12-07  Thiemo Seufer  <ths@networkno.de>
+
+	* src/mips/ffitarget.h: Remove obsolete sgidefs.h include. Add
+	missing parentheses.
+	* src/mips/o32.S (ffi_call_O32): Code formatting. Define
+	and use A3_OFF, FP_OFF, RA_OFF. Micro-optimizations.
+	(ffi_closure_O32): Likewise, but with newly defined A3_OFF2,
+	A2_OFF2, A1_OFF2, A0_OFF2, RA_OFF2, FP_OFF2, S0_OFF2, GP_OFF2,
+	V1_OFF2, V0_OFF2, FA_1_1_OFF2, FA_1_0_OFF2, FA_0_1_OFF2,
+	FA_0_0_OFF2.
+	* src/mips/ffi.c (ffi_prep_args): Code formatting. Fix
+	endianness bugs.
+	(ffi_prep_closure): Improve trampoline instruction scheduling.
+	(ffi_closure_mips_inner_O32): Fix endianness bugs.
+
+2005-12-03  Alan Modra  <amodra@bigpond.net.au>
+
+	* src/powerpc/ffi.c: Formatting.
+	(ffi_prep_args_SYSV): Avoid possible aliasing problems by using unions.
+	(ffi_prep_args64): Likewise.
+
+2005-09-30  Geoffrey Keating  <geoffk@apple.com>
+
+	* testsuite/lib/libffi-dg.exp (libffi_target_compile): For
+	darwin, use -shared-libgcc not -lgcc_s, and explain why.
+
+2005-09-26  Tom Tromey  <tromey@redhat.com>
+
+	* testsuite/libffi.call/float1.c (value_type): New typedef.
+	(CANARY): New define.
+	(main): Check for result buffer overflow.
+	* src/powerpc/linux64.S: Handle linux64 long double returns.
+	* src/powerpc/ffi.c (FLAG_RETURNS_128BITS): New constant.
+	(ffi_prep_cif_machdep): Handle linux64 long double returns.
+
+2005-08-25  Alan Modra  <amodra@bigpond.net.au>
+
+	PR target/23404
+	* src/powerpc/ffi.c (ffi_prep_args_SYSV): Correct placement of stack
+	homed fp args.
+	(ffi_status ffi_prep_cif_machdep): Correct stack sizing for same.
+
+2005-08-11  Jakub Jelinek  <jakub@redhat.com>
+
+	* configure.ac (HAVE_HIDDEN_VISIBILITY_ATTRIBUTE): New test.
+	(AH_BOTTOM): Add FFI_HIDDEN definition.
+	* configure: Rebuilt.
+	* fficonfig.h.in: Rebuilt.
+	* src/powerpc/ffi.c (hidden): Remove.
+	(ffi_closure_LINUX64, ffi_prep_args64, ffi_call_LINUX64,
+	ffi_closure_helper_LINUX64): Use FFI_HIDDEN instead of hidden.
+	* src/powerpc/linux64_closure.S (ffi_closure_LINUX64,
+	.ffi_closure_LINUX64): Use FFI_HIDDEN instead of .hidden.
+	* src/x86/ffi.c (ffi_closure_SYSV, ffi_closure_raw_SYSV): Remove,
+	add FFI_HIDDEN to its prototype.
+	(ffi_closure_SYSV_inner): New.
+	* src/x86/sysv.S (ffi_closure_SYSV, ffi_closure_raw_SYSV): New.
+	* src/x86/win32.S (ffi_closure_SYSV, ffi_closure_raw_SYSV): New.
+
+2005-08-10  Alfred M. Szmidt  <ams@gnu.org>
+
+	PR libffi/21819:
+	* configure: Rebuilt.
+	* configure.ac: Handle i*86-*-gnu*.
+
+2005-08-09  Jakub Jelinek  <jakub@redhat.com>
+
+	* src/powerpc/ppc_closure.S (ffi_closure_SYSV): Use
+	DW_CFA_offset_extended_sf rather than
+	DW_CFA_GNU_negative_offset_extended.
+	* src/powerpc/sysv.S (ffi_call_SYSV): Likewise.
+
+2005-07-22  SUGIOKA Toshinobu  <sugioka@itonet.co.jp>
+
+	* src/sh/sysv.S (ffi_call_SYSV): Stop argument popping correctly
+	on sh3.
+	(ffi_closure_SYSV): Change the stack layout for sh3 struct argument.
+	* src/sh/ffi.c (ffi_prep_args): Fix sh3 argument copy, when it is
+	partially on register.
+	(ffi_closure_helper_SYSV): Likewise.
+	(ffi_prep_cif_machdep): Don't set too many cif->flags.
+
+2005-07-20  Kaz Kojima  <kkojima@gcc.gnu.org>
+
+	* src/sh/ffi.c (ffi_call): Handle small structures correctly.
+	Remove empty line.
+	* src/sh64/ffi.c (simple_type): Remove.
+	(return_type): Handle small structures correctly.
+	(ffi_prep_args): Likewise.
+	(ffi_call): Likewise.
+	(ffi_closure_helper_SYSV): Likewise.
+	* src/sh64/sysv.S (ffi_call_SYSV): Handle 1, 2 and 4-byte return.
+	Emit position independent code if PIC and remove wrong datalabel
+	prefixes from EH data.
+
+2005-07-19  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* Makefile.am (nodist_libffi_la_SOURCES): Add POWERPC_FREEBSD.
+	* Makefile.in: Regenerate.
+	* include/Makefile.in: Likewise.
+	* testsuite/Makefile.in: Likewise.
+	* configure.ac: Add POWERPC_FREEBSD rules.
+	* configure: Regenerate.
+	* src/powerpc/ffitarget.h: Add POWERPC_FREEBSD rules.
+	(FFI_SYSV_TYPE_SMALL_STRUCT): Define.
+	* src/powerpc/ffi.c: Add flags to handle small structure returns
+	in ffi_call_SYSV.
+	(ffi_prep_cif_machdep): Handle small structures for SYSV 4 ABI.
+	Aka FFI_SYSV.
+	(ffi_closure_helper_SYSV): Likewise.
+	* src/powerpc/ppc_closure.S: Add return types for small structures.
+	* src/powerpc/sysv.S: Add bits to handle small structures for
+	final SYSV 4 ABI.
+
+2005-07-10  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* testsuite/libffi.call/cls_5_1_byte.c: New test file.
+	* testsuite/libffi.call/cls_6_1_byte.c: Likewise.
+	* testsuite/libffi.call/cls_7_1_byte.c: Likewise.
+
+2005-07-05  Randolph Chung  <tausq@debian.org>
+
+	* src/pa/ffi.c (ffi_struct_type): Rename FFI_TYPE_SMALL_STRUCT1
+	as FFI_TYPE_SMALL_STRUCT3.  Break out handling for 5-7 byte
+	structures.  Kill compilation warnings.
+	(ffi_closure_inner_LINUX): Print return values as hex in debug
+	message.  Rename FFI_TYPE_SMALL_STRUCT1 as FFI_TYPE_SMALL_STRUCT3.
+	Properly handle 5-7 byte structure returns.
+	* src/pa/ffitarget.h (FFI_TYPE_SMALL_STRUCT1)
+	(FFI_TYPE_SMALL_STRUCT2): Remove.
+	(FFI_TYPE_SMALL_STRUCT3, FFI_TYPE_SMALL_STRUCT5)
+	(FFI_TYPE_SMALL_STRUCT6, FFI_TYPE_SMALL_STRUCT7): Define.
+	* src/pa/linux.S: Mark source file as using PA1.1 assembly.
+	(checksmst1, checksmst2): Remove.
+	(checksmst3): Optimize handling of 3-byte struct returns.
+	(checksmst567): Properly handle 5-7 byte struct returns.
+
+2005-06-15  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
+
+	PR libgcj/21943
+	* src/mips/n32.S: Enforce PIC code.
+	* src/mips/o32.S: Likewise.
+
+2005-06-15  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
+
+	* configure.ac: Treat i*86-*-solaris2.10 and up as X86_64.
+	* configure: Regenerate.
+
+2005-06-01  Alan Modra  <amodra@bigpond.net.au>
+
+	* src/powerpc/ppc_closure.S (ffi_closure_SYSV): Don't use JUMPTARGET
+	to call ffi_closure_helper_SYSV.  Append @local instead.
+	* src/powerpc/sysv.S (ffi_call_SYSV): Likewise for ffi_prep_args_SYSV.
+
+2005-05-17  Kelley Cook  <kcook@gcc.gnu.org>
+
+	* configure.ac: Use AC_C_BIGENDIAN instead of AC_C_BIGENDIAN_CROSS.
+	Use AC_CHECK_SIZEOF instead of AC_COMPILE_CHECK_SIZEOF.
+	* Makefile.am (ACLOCAL_AMFLAGS): Remove -I ../config.
+	* aclocal.m4, configure, fficonfig.h.in, Makefile.in,
+	include/Makefile.in, testsuite/Makefile.in: Regenerate.
+
+2005-05-09  Mike Stump  <mrs@apple.com>
+
+	* configure: Regenerate.
+
+2005-05-08  Richard Henderson  <rth@redhat.com>
+
+	PR libffi/21285
+	* src/alpha/osf.S: Update unwind into to match code.
+
+2005-05-04  Andreas Degert <ad@papyrus-gmbh.de>
+	    Richard Henderson  <rth@redhat.com>
+
+	* src/x86/ffi64.c (ffi_prep_cif_machdep): Save sse-used flag in
+	bit 11 of flags.
+	(ffi_call): Mask return type field.  Pass ssecount to ffi_call_unix64.
+	(ffi_prep_closure): Set carry bit if sse-used flag set.
+	* src/x86/unix64.S (ffi_call_unix64): Add ssecount argument.
+	Only load sse registers if ssecount non-zero.
+	(ffi_closure_unix64): Only save sse registers if carry set on entry.
+
+2005-04-29  Ralf Corsepius  <ralf.corsepius@rtems.org>
+
+	* configure.ac: Add i*86-*-rtems*, sparc*-*-rtems*,
+	powerpc-*rtems*, arm*-*-rtems*, sh-*-rtems*.
+	* configure: Regenerate.
+
+2005-04-20  Hans-Peter Nilsson  <hp@axis.com>
+
+	* testsuite/lib/libffi-dg.exp (libffi-dg-test-1): In regsub use,
+	have Tcl8.3-compatible intermediate variable.
+
+2005-04-18  Simon Posnjak <simon.posnjak@siol.net>
+	    Hans-Peter Nilsson  <hp@axis.com>
+
+	* Makefile.am: Add CRIS support.
+	* configure.ac: Likewise.
+	* Makefile.in, configure, testsuite/Makefile.in,
+	include/Makefile.in: Regenerate.
+	* src/cris: New directory.
+	* src/cris/ffi.c, src/cris/sysv.S, src/cris/ffitarget.h: New files.
+	* src/prep_cif.c (ffi_prep_cif): Wrap in #ifndef __CRIS__.
+
+	* testsuite/lib/libffi-dg.exp (libffi-dg-test-1): Replace \n with
+	\r?\n in output tests.
+
+2005-04-12  Mike Stump  <mrs@apple.com>
+
+	* configure: Regenerate.
+
+2005-03-30  Hans Boehm  <Hans.Boehm@hp.com>
+
+	* src/ia64/ffitarget.h (ffi_arg): Use long long instead of DI.
+
+2005-03-30  Steve Ellcey  <sje@cup.hp.com>
+
+	* src/ia64/ffitarget.h (ffi_arg) ADD DI attribute.
+	(ffi_sarg) Ditto.
+	* src/ia64/unix.S (ffi_closure_unix): Extend gp
+	to 64 bits in ILP32 mode.
+	Load 64 bits even for short data.
+
+2005-03-23  Mike Stump  <mrs@apple.com>
+
+	* src/powerpc/darwin.S: Update for -m64 multilib.
+	* src/powerpc/darwin_closure.S: Likewise.
+
+2005-03-21  Zack Weinberg  <zack@codesourcery.com>
+
+	* configure.ac: Do not invoke TL_AC_GCC_VERSION.
+	Do not set tool_include_dir.
+	* aclocal.m4, configure, Makefile.in, testsuite/Makefile.in:
+	Regenerate.
+	* include/Makefile.am: Set gcc_version and toollibffidir.
+	* include/Makefile.in: Regenerate.
+
+2005-02-22  Andrew Haley  <aph@redhat.com>
+
+	* src/powerpc/ffi.c (ffi_prep_cif_machdep): Bump alignment to
+	odd-numbered register pairs for 64-bit integer types.
+
+2005-02-23  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	PR libffi/20104
+	* testsuite/libffi.call/return_ll1.c: New test case.
+
+2005-02-11  Janis Johnson  <janis187@us.ibm.com>
+
+	* testsuite/libffi.call/cls_align_longdouble.c: Remove dg-options.
+	* testsuite/libffi.call/float.c: Ditto.
+	* testsuite/libffi.call/float2.c: Ditto.
+	* testsuite/libffi.call/float3.c: Ditto.
+
+2005-02-08  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* src/frv/ffitarget.h: Remove PPC stuff which does not belong to frv.
+
+2005-01-12  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+	* testsuite/libffi.special/special.exp (cxx_options): Add
+	-shared-libgcc.
+
+2004-12-31  Richard Henderson  <rth@redhat.com>
+
+	* src/types.c (FFI_AGGREGATE_TYPEDEF): Remove.
+	(FFI_TYPEDEF): Rename from FFI_INTEGRAL_TYPEDEF.  Replace size and
+	offset parameters with a type parameter; deduce size and structure
+	alignment.  Update all users.
+
+2004-12-31  Richard Henderson  <rth@redhat.com>
+
+	* src/types.c (FFI_TYPE_POINTER): Define with sizeof.
+	(FFI_TYPE_LONGDOUBLE): Fix for ia64.
+	* src/ia64/ffitarget.h (struct ffi_ia64_trampoline_struct): Move
+	into ffi_prep_closure.
+	* src/ia64/ia64_flags.h, src/ia64/ffi.c, src/ia64/unix.S: Rewrite
+	from scratch.
+
+2004-12-27  Richard Henderson  <rth@redhat.com>
+
+	* src/x86/unix64.S: Fix typo in unwind info.
+
+2004-12-25  Richard Henderson  <rth@redhat.com>
+
+	* src/x86/ffi64.c (struct register_args): Rename from stackLayout.
+	(enum x86_64_reg_class): Add X86_64_COMPLEX_X87_CLASS.
+	(merge_classes): Check for it.
+	(SSE_CLASS_P): New.
+	(classify_argument): Pass byte_offset by value; perform all updates
+	inside struct case.
+	(examine_argument): Add classes argument; handle
+	X86_64_COMPLEX_X87_CLASS.
+	(ffi_prep_args): Merge into ...
+	(ffi_call): ... here.  Share stack frame with ffi_call_unix64.
+	(ffi_prep_cif_machdep): Setup cif->flags for proper structure return.
+	(ffi_fill_return_value): Remove.
+	(ffi_prep_closure): Remove dead assert.
+	(ffi_closure_unix64_inner): Rename from ffi_closure_UNIX64_inner.
+	Rewrite to use struct register_args instead of va_list.  Create
+	flags for handling structure returns.
+	* src/x86/unix64.S: Remove dead strings.
+	(ffi_call_unix64): Rename from ffi_call_UNIX64.  Rewrite to share
+	stack frame with ffi_call.  Handle structure returns properly.
+	(float2sse, floatfloat2sse, double2sse): Remove.
+	(sse2float, sse2double, sse2floatfloat): Remove.
+	(ffi_closure_unix64): Rename from ffi_closure_UNIX64.  Rewrite
+	to handle structure returns properly.
+
+2004-12-08  David Edelsohn  <edelsohn@gnu.org>
+
+	* Makefile.am (AM_MAKEFLAGS): Remove duplicate LIBCFLAGS and
+	PICFLAG.
+	* Makefile.in: Regenerated.
+
+2004-12-02  Richard Sandiford  <rsandifo@redhat.com>
+
+	* configure.ac: Use TL_AC_GCC_VERSION to set gcc_version.
+	* configure, aclocal.m4, Makefile.in: Regenerate.
+	* include/Makefile.in, testsuite/Makefile.in: Regenerate.
+
+2004-11-29  Kelley Cook  <kcook@gcc.gnu.org>
+
+	* configure: Regenerate for libtool change.
+
+2004-11-25  Kelley Cook  <kcook@gcc.gnu.org>
+
+	* configure: Regenerate for libtool reversion.
+
+2004-11-24  Kelley Cook  <kcook@gcc.gnu.org>
+
+	* configure: Regenerate for libtool change.
+
+2004-11-23  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+	* testsuite/lib/libffi-dg.exp: Use new procs in target-libpath.exp.
+
+2004-11-23  Richard Sandiford  <rsandifo@redhat.com>
+
+	* src/mips/o32.S (ffi_call_O32, ffi_closure_O32): Use jalr instead
+	of jal.  Use an absolute encoding for the frame information.
+
+2004-11-23  Kelley Cook  <kcook@gcc.gnu.org>
+
+	* Makefile.am: Remove no-dependencies.  Add ACLOCAL_AMFLAGS.
+	* acinclude.m4: Delete logic for sincludes.
+	* aclocal.m4, Makefile.in, configure: Regenerate.
+	* include/Makefile: Likewise.
+	* testsuite/Makefile: Likewise.
+
+2004-11-22  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+	* src/sparc/ffi.c (ffi_prep_closure): Align doubles and 64-bit integers
+	on a 8-byte boundary.
+	* src/sparc/v8.S (ffi_closure_v8): Reserve frame space for arguments.
+
+2004-10-27  Richard Earnshaw  <rearnsha@arm.com>
+
+	* src/arm/ffi.c (ffi_prep_cif_machdep): Handle functions that return
+	long long values.  Round stack allocation to a multiple of 8 bytes
+	for ATPCS compatibility.
+	* src/arm/sysv.S (ffi_call_SYSV): Rework to avoid use of APCS register
+	names.  Handle returning long long types.  Add Thumb and interworking
+	support.  Improve soft-float code.
+
+2004-10-27  Richard Earnshaw  <rearnsha@arm.com>
+
+	* testsuite/lib/libffi-db.exp (load_gcc_lib): New function.
+	(libffi_exit): New function.
+	(libffi_init): Build the testglue wrapper if needed.
+
+2004-10-25  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+	PR other/18138
+	* testsuite/lib/libffi-dg.exp: Accept more than one multilib libgcc.
+
+2004-10-25  Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
+
+	* src/m32r/libffitarget.h (FFI_CLOSURES): Set to 0.
+
+2004-10-20  Kaz Kojima  <kkojima@gcc.gnu.org>
+
+	* src/sh/sysv.S (ffi_call_SYSV): Don't align for double data.
+	* testsuite/libffi.call/float3.c: New test case.
+
+2004-10-18  Kaz Kojima  <kkojima@gcc.gnu.org>
+
+	* src/sh/ffi.c (ffi_prep_closure): Set T bit in trampoline for
+	the function returning a structure pointed with R2.
+	* src/sh/sysv.S (ffi_closure_SYSV): Use R2 as the pointer to
+	the structure return value if T bit set.  Emit position
+	independent code and EH data if PIC.
+
+2004-10-13  Kazuhiro Inaoka  <inaoka.kazuhiro@renesas.com>
+
+	* Makefile.am: Add m32r support.
+	* configure.ac: Likewise.
+	* Makefile.in: Regenerate.
+	* confiugre: Regenerate.
+	* src/types.c: Add m32r port to FFI_INTERNAL_TYPEDEF
+	(uint64, sint64, double, longdouble)
+	* src/m32r: New directory.
+	* src/m32r/ffi.c: New file.
+	* src/m32r/sysv.S: Likewise.
+	* src/m32r/ffitarget.h: Likewise.
+
+2004-10-02  Kaz Kojima  <kkojima@gcc.gnu.org>
+
+	* testsuite/libffi.call/negint.c: New test case.
+
+2004-09-14  H.J. Lu  <hongjiu.lu@intel.com>
+
+	PR libgcj/17465
+	* testsuite/lib/libffi-dg.exp: Don't use global ld_library_path.
+	Set up LD_LIBRARY_PATH, SHLIB_PATH, LD_LIBRARYN32_PATH,
+	LD_LIBRARY64_PATH, LD_LIBRARY_PATH_32, LD_LIBRARY_PATH_64 and
+	DYLD_LIBRARY_PATH.
+
+2004-09-05  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* testsuite/libffi.call/many_win32.c: Remove whitespaces.
+	* testsuite/libffi.call/promotion.c: Likewise.
+	* testsuite/libffi.call/return_ll.c: Remove unused var. Cleanup
+	whitespaces.
+	* testsuite/libffi.call/return_sc.c: Likewise.
+	* testsuite/libffi.call/return_uc.c: Likewise.
+
+2004-09-05  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* src/powerpc/darwin.S: Fix comments and identation.
+	* src/powerpc/darwin_closure.S: Likewise.
+
+2004-09-02  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* src/powerpc/ffi_darwin.c: Add flag for longdouble return values.
+	(ffi_prep_args): Handle longdouble arguments.
+	(ffi_prep_cif_machdep): Set flags for longdouble. Calculate space for
+	longdouble.
+	(ffi_closure_helper_DARWIN): Add closure handling for longdouble.
+	* src/powerpc/darwin.S (_ffi_call_DARWIN): Add handling of longdouble
+	values.
+	* src/powerpc/darwin_closure.S (_ffi_closure_ASM): Likewise.
+	* src/types.c: Defined longdouble size and alignment for darwin.
+
+2004-09-02  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* src/powerpc/aix.S: Remove whitespaces.
+	* src/powerpc/aix_closure.S: Likewise.
+	* src/powerpc/asm.h: Likewise.
+	* src/powerpc/ffi.c: Likewise.
+	* src/powerpc/ffitarget.h: Likewise.
+	* src/powerpc/linux64.S: Likewise.
+	* src/powerpc/linux64_closure.S: Likewise.
+	* src/powerpc/ppc_closure.S: Likewise.
+	* src/powerpc/sysv.S: Likewise.
+
+2004-08-30  Anthony Green  <green@redhat.com>
+
+	* Makefile.am: Add frv support.
+	* Makefile.in, testsuite/Makefile.in: Rebuilt.
+	* configure.ac: Read configure.host.
+	* configure.in: Read configure.host.
+	* configure.host: New file.  frv-elf needs libgloss.
+	* include/ffi.h.in: Force ffi_closure to have a nice big (8)
+	alignment.  This is needed to frv and shouldn't harm the others.
+	* include/ffi_common.h (ALIGN_DOWN): New macro.
+	* src/frv/ffi.c, src/frv/ffitarget.h, src/frv/eabi.S: New files.
+
+2004-08-24  David Daney  <daney@avtrex.com>
+
+	* testsuite/libffi.call/closure_fn0.c: Xfail mips64* instead of mips*.
+	* testsuite/libffi.call/closure_fn1.c: Likewise.
+	* testsuite/libffi.call/closure_fn2.c  Likewise.
+	* testsuite/libffi.call/closure_fn3.c: Likewise.
+	* testsuite/libffi.call/closure_fn4.c: Likewise.
+	* testsuite/libffi.call/closure_fn5.c: Likewise.
+	* testsuite/libffi.call/cls_18byte.c: Likewise.
+	* testsuite/libffi.call/cls_19byte.c: Likewise.
+	* testsuite/libffi.call/cls_1_1byte.c: Likewise.
+	* testsuite/libffi.call/cls_20byte.c: Likewise.
+	* testsuite/libffi.call/cls_20byte1.c: Likewise.
+	* testsuite/libffi.call/cls_24byte.c: Likewise.
+	* testsuite/libffi.call/cls_2byte.c: Likewise.
+	* testsuite/libffi.call/cls_3_1byte.c: Likewise.
+	* testsuite/libffi.call/cls_3byte1.c: Likewise.
+	* testsuite/libffi.call/cls_3byte2.c: Likewise.
+	* testsuite/libffi.call/cls_4_1byte.c: Likewise.
+	* testsuite/libffi.call/cls_4byte.c: Likewise.
+	* testsuite/libffi.call/cls_64byte.c: Likewise.
+	* testsuite/libffi.call/cls_6byte.c: Likewise.
+	* testsuite/libffi.call/cls_7byte.c: Likewise.
+	* testsuite/libffi.call/cls_8byte.c: Likewise.
+	* testsuite/libffi.call/cls_9byte1.c: Likewise.
+	* testsuite/libffi.call/cls_9byte2.c: Likewise.
+	* testsuite/libffi.call/cls_align_double.c: Likewise.
+	* testsuite/libffi.call/cls_align_float.c: Likewise.
+	* testsuite/libffi.call/cls_align_longdouble.c: Likewise.
+	* testsuite/libffi.call/cls_align_pointer.c: Likewise.
+	* testsuite/libffi.call/cls_align_sint16.c: Likewise.
+	* testsuite/libffi.call/cls_align_sint32.c: Likewise.
+	* testsuite/libffi.call/cls_align_sint64.c: Likewise.
+	* testsuite/libffi.call/cls_align_uint16.c: Likewise.
+	* testsuite/libffi.call/cls_align_uint32.c: Likewise.
+	* testsuite/libffi.call/cls_align_uint64.c: Likewise.
+	* testsuite/libffi.call/cls_double.c: Likewise.
+	* testsuite/libffi.call/cls_float.c: Likewise.
+	* testsuite/libffi.call/cls_multi_schar.c: Likewise.
+	* testsuite/libffi.call/cls_multi_sshort.c: Likewise.
+	* testsuite/libffi.call/cls_multi_sshortchar.c: Likewise.
+	* testsuite/libffi.call/cls_multi_uchar.c: Likewise.
+	* testsuite/libffi.call/cls_multi_ushort.c: Likewise.
+	* testsuite/libffi.call/cls_multi_ushortchar.c: Likewise.
+	* testsuite/libffi.call/cls_schar.c: Likewise.
+	* testsuite/libffi.call/cls_sint.c: Likewise.
+	* testsuite/libffi.call/cls_sshort.c: Likewise.
+	* testsuite/libffi.call/cls_uchar.c: Likewise.
+	* testsuite/libffi.call/cls_uint.c: Likewise.
+	* testsuite/libffi.call/cls_ulonglong.c: Likewise.
+	* testsuite/libffi.call/cls_ushort.c: Likewise.
+	* testsuite/libffi.call/nested_struct.c: Likewise.
+	* testsuite/libffi.call/nested_struct1.c: Likewise.
+	* testsuite/libffi.call/nested_struct2.c: Likewise.
+	* testsuite/libffi.call/nested_struct3.c: Likewise.
+	* testsuite/libffi.call/problem1.c: Likewise.
+	* testsuite/libffi.special/unwindtest.cc: Likewise.
+	* testsuite/libffi.call/cls_12byte.c: Likewise and set return value
+	to zero.
+	* testsuite/libffi.call/cls_16byte.c: Likewise.
+	* testsuite/libffi.call/cls_5byte.c: Likewise.
+
+2004-08-23  David Daney <daney@avtrex.com>
+
+	PR libgcj/13141
+	* src/mips/ffitarget.h (FFI_O32_SOFT_FLOAT): New ABI.
+	* src/mips/ffi.c (ffi_prep_args): Fix alignment calculation.
+	(ffi_prep_cif_machdep): Handle FFI_O32_SOFT_FLOAT floating point
+	parameters and return types.
+	(ffi_call): Handle FFI_O32_SOFT_FLOAT ABI.
+	(ffi_prep_closure): Ditto.
+	(ffi_closure_mips_inner_O32): Handle FFI_O32_SOFT_FLOAT ABI, fix
+	alignment calculations.
+	* src/mips/o32.S (ffi_closure_O32): Don't use floating point
+	instructions if FFI_O32_SOFT_FLOAT, make stack frame ABI compliant.
+
+2004-08-14  Casey Marshall <csm@gnu.org>
+
+	* src/mips/ffi.c (ffi_pref_cif_machdep): set `cif->flags' to
+	contain `FFI_TYPE_UINT64' as return type for any 64-bit
+	integer (O32 ABI only).
+	(ffi_prep_closure): new function.
+	(ffi_closure_mips_inner_O32): new function.
+	* src/mips/ffitarget.h: Define `FFI_CLOSURES' and
+	`FFI_TRAMPOLINE_SIZE' appropriately if the ABI is o32.
+	* src/mips/o32.S (ffi_call_O32): add labels for .eh_frame. Return
+	64 bit integers correctly.
+	(ffi_closure_O32): new function.
+	Added DWARF-2 unwind info for both functions.
+
+2004-08-10  Andrew Haley  <aph@redhat.com>
+
+	* src/x86/ffi64.c (ffi_prep_args ): 8-align all stack arguments.
+
+2004-08-01  Robert Millan  <robertmh@gnu.org>
+
+	* configure.ac: Detect knetbsd-gnu and kfreebsd-gnu.
+	* configure: Regenerate.
+
+2004-07-30  Maciej W. Rozycki  <macro@linux-mips.org>
+
+	* acinclude.m4 (AC_FUNC_MMAP_BLACKLIST): Check for <sys/mman.h>
+	and mmap() explicitly instead of relying on preset autoconf cache
+	variables.
+	* aclocal.m4: Regenerate.
+	* configure: Regenerate.
+
+2004-07-11  Ulrich Weigand  <uweigand@de.ibm.com>
+
+	* src/s390/ffi.c (ffi_prep_args): Fix C aliasing violation.
+	(ffi_check_float_struct): Remove unused prototype.
+
+2004-06-30  Geoffrey Keating  <geoffk@apple.com>
+
+	* src/powerpc/ffi_darwin.c (flush_icache): ';' is a comment
+	character on Darwin, use '\n\t' instead.
+
+2004-06-26  Matthias Klose  <doko@debian.org>
+
+	* libtool-version: Fix typo in revision/age.
+
+2004-06-17  Matthias Klose  <doko@debian.org>
+
+	* libtool-version: New.
+	* Makefile.am (libffi_la_LDFLAGS): Use -version-info for soname.
+	* Makefile.in: Regenerate.
+
+2004-06-15  Paolo Bonzini  <bonzini@gnu.org>
+
+	* Makefile.am: Remove useless multilib rules.
+	* Makefile.in: Regenerate.
+	* aclocal.m4: Regenerate with automake 1.8.5.
+	* configure.ac: Remove useless multilib configury.
+	* configure: Regenerate.
+
+2004-06-15  Paolo Bonzini  <bonzini@gnu.org>
+
+	* .cvsignore: New file.
+
+2004-06-10  Jakub Jelinek  <jakub@redhat.com>
+
+	* src/ia64/unix.S (ffi_call_unix): Insert group barrier break
+	fp_done.
+	(ffi_closure_UNIX): Fix f14/f15 adjustment if FLOAT_SZ is ever
+	changed from 8.
+
+2004-06-06  Sean McNeil  <sean@mcneil.com>
+
+	* configure.ac: Add x86_64-*-freebsd* support.
+	* configure: Regenerate.
+
+2004-04-26  Joe Buck <jbuck@welsh-buck.org>
+
+	Bug 15093
+	* configure.ac: Test for existence of mmap and sys/mman.h before
+	checking blacklist.  Fix suggested by Jim Wilson.
+	* configure: Regenerate.
+
+2004-04-26  Matt Austern  <austern@apple.com>
+
+	* src/powerpc/darwin.S: Go through a non-lazy pointer for initial
+	FDE location.
+	* src/powerpc/darwin_closure.S: Likewise.
+
+2004-04-24  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* testsuite/libffi.call/cls_multi_schar.c (main): Fix initialization
+	error. Reported by Thomas Heller <theller@python.net>.
+	* testsuite/libffi.call/cls_multi_sshort.c (main): Likewise.
+	* testsuite/libffi.call/cls_multi_ushort.c (main): Likewise.
+
+2004-03-20  Matthias Klose  <doko@debian.org>
+
+	* src/pa/linux.S: Fix typo.
+
+2004-03-19  Matthias Klose  <doko@debian.org>
+
+	* Makefile.am: Update.
+	* Makefile.in: Regenerate.
+	* src/pa/ffi.h.in: Remove.
+	* src/pa/ffitarget.h: New file.
+
+2004-02-10  Randolph Chung  <tausq@debian.org>
+
+	* Makefile.am: Add PA support.
+	* Makefile.in: Regenerate.
+	* include/Makefile.in: Regenerate.
+	* configure.ac: Add PA target.
+	* configure: Regenerate.
+	* src/pa/ffi.c: New file.
+	* src/pa/ffi.h.in: Add PA support.
+	* src/pa/linux.S: New file.
+	* prep_cif.c: Add PA support.
+
+2004-03-16  Hosaka Yuji  <hos@tamanegi.org>
+
+	* src/types.c: Fix alignment size of X86_WIN32 case int64 and
+	double.
+	* src/x86/ffi.c (ffi_prep_args): Replace ecif->cif->rtype->type
+	with ecif->cif->flags.
+	(ffi_call, ffi_prep_incoming_args_SYSV): Replace cif->rtype->type
+	with cif->flags.
+	(ffi_prep_cif_machdep): Add X86_WIN32 struct case.
+	(ffi_closure_SYSV): Add 1 or 2-bytes struct case for X86_WIN32.
+	* src/x86/win32.S (retstruct1b, retstruct2b, sc_retstruct1b,
+	sc_retstruct2b): Add for 1 or 2-bytes struct case.
+
+2004-03-15 Kelley Cook <kcook@gcc.gnu.org>
+
+	* configure.in: Rename file to ...
+	* configure.ac: ... this.
+	* fficonfig.h.in: Regenerate.
+	* Makefile.in: Regenerate.
+	* include/Makefile.in: Regenerate.
+	* testsuite/Makefile.in: Regenerate.
+
+2004-03-12  Matt Austern  <austern@apple.com>
+
+	* src/powerpc/darwin.S: Fix EH information so it corresponds to
+	changes in EH format resulting from addition of linkonce support.
+	* src/powerpc/darwin_closure.S: Likewise.
+
+2004-03-11  Andreas Tobler  <a.tobler@schweiz.ch>
+	    Paolo Bonzini  <bonzini@gnu.org>
+
+	* Makefile.am (AUTOMAKE_OPTIONS): Set them.
+	Remove VPATH. Remove rules for object files. Remove multilib support.
+	(AM_CCASFLAGS): Add.
+	* configure.in (AC_CONFIG_HEADERS): Relace AM_CONFIG_HEADER.
+	(AC_PREREQ): Bump version to 2.59.
+	(AC_INIT): Fill with version info and bug address.
+	(ORIGINAL_LD_FOR_MULTILIBS): Remove.
+	(AM_ENABLE_MULTILIB): Use this instead of AC_ARG_ENABLE.
+	De-precious CC so that the right flags are passed down to multilibs.
+	(AC_MSG_ERROR): Replace obsolete macro AC_ERROR.
+	(AC_CONFIG_FILES): Replace obsolete macro AC_LINK_FILES.
+	(AC_OUTPUT): Reorganize the output with AC_CONFIG_COMMANDS.
+	* configure: Rebuilt.
+	* aclocal.m4: Likewise.
+	* Makefile.in, include/Makefile.in, testsuite/Makefile.in: Likewise.
+	* fficonfig.h.in: Likewise.
+
+2004-03-11  Andreas Schwab  <schwab@suse.de>
+
+	* src/ia64/ffi.c (ffi_prep_incoming_args_UNIX): Get floating point
+	arguments from fp registers only for the first 8 parameter slots.
+	Don't convert a float parameter when passed in memory.
+
+2004-03-09  Hans-Peter Nilsson  <hp@axis.com>
+
+	* configure: Regenerate for config/accross.m4 correction.
+
+2004-02-25  Matt Kraai  <kraai@alumni.cmu.edu>
+
+	* src/powerpc/ffi.c (ffi_prep_args_SYSV): Change
+	ecif->cif->bytes to bytes.
+	(ffi_prep_cif_machdep): Add braces around nested if statement.
+
+2004-02-09  Alan Modra  <amodra@bigpond.net.au>
+
+	* src/types.c (pointer): POWERPC64 has 8 byte pointers.
+
+	* src/powerpc/ffi.c (ffi_prep_args64): Correct long double handling.
+	(ffi_closure_helper_LINUX64): Fix typo.
+	* testsuite/libffi.call/cls_align_longdouble.c: Pass -mlong-double-128
+	for powerpc64-*-*.
+	* testsuite/libffi.call/float.c: Likewise.
+	* testsuite/libffi.call/float2.c: Likewise.
+
+2004-02-08  Alan Modra  <amodra@bigpond.net.au>
+
+	* src/powerpc/ffi.c (ffi_prep_cif_machdep <FFI_LINUX64>): Correct
+	long double function return and long double arg handling.
+	(ffi_closure_helper_LINUX64): Formatting.  Delete unused "ng" var.
+	Use "end_pfr" instead of "nf".  Correct long double handling.
+	Localise "temp".
+	* src/powerpc/linux64.S (ffi_call_LINUX64): Save f2 long double
+	return value.
+	* src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Allocate
+	space for long double return value.  Adjust stack frame and offsets.
+	Load f2 long double return.
+
+2004-02-07  Alan Modra  <amodra@bigpond.net.au>
+
+	* src/types.c: Use 16 byte long double for POWERPC64.
+
+2004-01-25  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+	* src/sparc/ffi.c (ffi_prep_args_v9): Shift the parameter array
+	when the structure return address is passed in %o0.
+	(ffi_V9_return_struct): Rename into ffi_v9_layout_struct.
+	(ffi_v9_layout_struct): Align the field following a nested structure
+	on a word boundary.  Use memmove instead of memcpy.
+	(ffi_call): Update call to ffi_V9_return_struct.
+	(ffi_prep_closure): Define 'ctx' only for V8.
+	(ffi_closure_sparc_inner): Clone into ffi_closure_sparc_inner_v8
+	and ffi_closure_sparc_inner_v9.
+	(ffi_closure_sparc_inner_v8): Return long doubles by reference.
+	Always skip the structure return address.  For structures and long
+	doubles, copy the argument directly.
+	(ffi_closure_sparc_inner_v9): Skip the structure return address only
+	if required.  Shift the maximum floating-point slot accordingly.  For
+	big structures, copy the argument directly; otherwise, left-justify the
+	argument and call ffi_v9_layout_struct to lay out the structure on
+	the stack.
+	* src/sparc/v8.S: Undef STACKFRAME before defining it.
+	(ffi_closure_v8): Pass the structure return address.  Update call to
+	ffi_closure_sparc_inner_v8.  Short-circuit FFI_TYPE_INT handling.
+	Skip the 'unimp' insn when returning long doubles and structures.
+	* src/sparc/v9.S: Undef STACKFRAME before defining it.
+	(ffi_closure_v9): Increase the frame size by 2 words.  Short-circuit
+	FFI_TYPE_INT handling.  Load structures both in integers and
+	floating-point registers on return.
+	* README: Update status of the SPARC port.
+
+2004-01-24  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* testsuite/libffi.call/pyobjc-tc.c (main): Treat result value
+	as of type ffi_arg.
+	* testsuite/libffi.call/struct3.c (main): Fix CHECK.
+
+2004-01-22  Ulrich Weigand  <uweigand@de.ibm.com>
+
+	* testsuite/libffi.call/cls_uint.c (cls_ret_uint_fn): Treat result
+	value as of type ffi_arg, not unsigned int.
+
+2004-01-21  Michael Ritzert  <ritzert@t-online.de>
+
+	* ffi64.c (ffi_prep_args): Cast the RHS of an assignment instead
+	of the LHS.
+
+2004-01-12  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* testsuite/lib/libffi-dg.exp: Set LD_LIBRARY_PATH_32 for
+	Solaris.
+
+2004-01-08  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
+
+	* testsuite/libffi.call/ffitest.h (allocate_mmap): Cast MAP_FAILED
+	to void *.
+
+2003-12-10  Richard Henderson  <rth@redhat.com>
+
+	* testsuite/libffi.call/cls_align_pointer.c: Cast pointers to
+	size_t instead of int.
+
+2003-12-04  Hosaka Yuji  <hos@tamanegi.org>
+
+	* testsuite/libffi.call/many_win32.c: Include <float.h>.
+	* testsuite/libffi.call/many_win32.c (main): Replace variable
+	int i with unsigned long ul.
+
+	* testsuite/libffi.call/cls_align_uint64.c: New test case.
+	* testsuite/libffi.call/cls_align_sint64.c: Likewise.
+	* testsuite/libffi.call/cls_align_uint32.c: Likewise.
+	* testsuite/libffi.call/cls_align_sint32.c: Likewise.
+	* testsuite/libffi.call/cls_align_uint16.c: Likewise.
+	* testsuite/libffi.call/cls_align_sint16.c: Likewise.
+	* testsuite/libffi.call/cls_align_float.c: Likewise.
+	* testsuite/libffi.call/cls_align_double.c: Likewise.
+	* testsuite/libffi.call/cls_align_longdouble.c: Likewise.
+	* testsuite/libffi.call/cls_align_pointer.c: Likewise.
+
+2003-12-02  Hosaka Yuji  <hos@tamanegi.org>
+
+	PR other/13221
+	* src/x86/ffi.c (ffi_prep_args, ffi_prep_incoming_args_SYSV):
+	Align arguments to 32 bits.
+
+2003-12-01  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	PR other/13221
+	* testsuite/libffi.call/cls_multi_sshort.c: New test case.
+	* testsuite/libffi.call/cls_multi_sshortchar.c: Likewise.
+	* testsuite/libffi.call/cls_multi_uchar.c: Likewise.
+	* testsuite/libffi.call/cls_multi_schar.c: Likewise.
+	* testsuite/libffi.call/cls_multi_ushortchar.c: Likewise.
+	* testsuite/libffi.call/cls_multi_ushort.c: Likewise.
+
+	* testsuite/libffi.special/unwindtest.cc: Cosmetics.
+
+2003-11-26  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+	* testsuite/libffi.call/ffitest.h: Include <fcntl.h>.
+	* testsuite/libffi.special/ffitestcxx.h: Likewise.
+
+2003-11-22  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* Makefile.in: Rebuilt.
+	* configure: Likewise.
+	* testsuite/libffi.special/unwindtest.cc: Convert the mmap to
+	the right type.
+
+2003-11-21  Andreas Jaeger  <aj@suse.de>
+	    Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* acinclude.m4: Add AC_FUNC_MMAP_BLACKLIST.
+	* configure.in: Call AC_FUNC_MMAP_BLACKLIST.
+	* Makefile.in: Rebuilt.
+	* aclocal.m4: Likewise.
+	* configure: Likewise.
+	* fficonfig.h.in: Likewise.
+	* testsuite/lib/libffi-dg.exp: Add include dir.
+	* testsuite/libffi.call/ffitest.h: Add MMAP definitions.
+	* testsuite/libffi.special/ffitestcxx.h: Likewise.
+	* testsuite/libffi.call/closure_fn0.c: Use MMAP functionality
+	for ffi_closure if available.
+	* testsuite/libffi.call/closure_fn1.c: Likewise.
+	* testsuite/libffi.call/closure_fn2.c: Likewise.
+	* testsuite/libffi.call/closure_fn3.c: Likewise.
+	* testsuite/libffi.call/closure_fn4.c: Likewise.
+	* testsuite/libffi.call/closure_fn5.c: Likewise.
+	* testsuite/libffi.call/cls_12byte.c: Likewise.
+	* testsuite/libffi.call/cls_16byte.c: Likewise.
+	* testsuite/libffi.call/cls_18byte.c: Likewise.
+	* testsuite/libffi.call/cls_19byte.c: Likewise.
+	* testsuite/libffi.call/cls_1_1byte.c: Likewise.
+	* testsuite/libffi.call/cls_20byte.c: Likewise.
+	* testsuite/libffi.call/cls_20byte1.c: Likewise.
+	* testsuite/libffi.call/cls_24byte.c: Likewise.
+	* testsuite/libffi.call/cls_2byte.c: Likewise.
+	* testsuite/libffi.call/cls_3_1byte.c: Likewise.
+	* testsuite/libffi.call/cls_3byte1.c: Likewise.
+	* testsuite/libffi.call/cls_3byte2.c: Likewise.
+	* testsuite/libffi.call/cls_4_1byte.c: Likewise.
+	* testsuite/libffi.call/cls_4byte.c: Likewise.
+	* testsuite/libffi.call/cls_5byte.c: Likewise.
+	* testsuite/libffi.call/cls_64byte.c: Likewise.
+	* testsuite/libffi.call/cls_6byte.c: Likewise.
+	* testsuite/libffi.call/cls_7byte.c: Likewise.
+	* testsuite/libffi.call/cls_8byte.c: Likewise.
+	* testsuite/libffi.call/cls_9byte1.c: Likewise.
+	* testsuite/libffi.call/cls_9byte2.c: Likewise.
+	* testsuite/libffi.call/cls_double.c: Likewise.
+	* testsuite/libffi.call/cls_float.c: Likewise.
+	* testsuite/libffi.call/cls_schar.c: Likewise.
+	* testsuite/libffi.call/cls_sint.c: Likewise.
+	* testsuite/libffi.call/cls_sshort.c: Likewise.
+	* testsuite/libffi.call/cls_uchar.c: Likewise.
+	* testsuite/libffi.call/cls_uint.c: Likewise.
+	* testsuite/libffi.call/cls_ulonglong.c: Likewise.
+	* testsuite/libffi.call/cls_ushort.c: Likewise.
+	* testsuite/libffi.call/nested_struct.c: Likewise.
+	* testsuite/libffi.call/nested_struct1.c: Likewise.
+	* testsuite/libffi.call/nested_struct2.c: Likewise.
+	* testsuite/libffi.call/nested_struct3.c: Likewise.
+	* testsuite/libffi.call/problem1.c: Likewise.
+	* testsuite/libffi.special/unwindtest.cc: Likewise.
+
+2003-11-20  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* testsuite/lib/libffi-dg.exp: Make the -lgcc_s conditional.
+
+2003-11-19  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* testsuite/lib/libffi-dg.exp: Add DYLD_LIBRARY_PATH for darwin.
+	Add -lgcc_s to additional flags.
+
+2003-11-12  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* configure.in, include/Makefile.am: PR libgcj/11147, install
+	the ffitarget.h header file in a gcc versioned and target
+	dependent place.
+	* configure: Regenerated.
+	* Makefile.in, include/Makefile.in: Likewise.
+	* testsuite/Makefile.in: Likewise.
+
+2003-11-09  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* testsuite/libffi.call/closure_fn0.c: Print result and check
+	with dg-output to make debugging easier.
+	* testsuite/libffi.call/closure_fn1.c: Likewise.
+	* testsuite/libffi.call/closure_fn2.c: Likewise.
+	* testsuite/libffi.call/closure_fn3.c: Likewise.
+	* testsuite/libffi.call/closure_fn4.c: Likewise.
+	* testsuite/libffi.call/closure_fn5.c: Likewise.
+	* testsuite/libffi.call/cls_12byte.c: Likewise.
+	* testsuite/libffi.call/cls_16byte.c: Likewise.
+	* testsuite/libffi.call/cls_18byte.c: Likewise.
+	* testsuite/libffi.call/cls_19byte.c: Likewise.
+	* testsuite/libffi.call/cls_1_1byte.c: Likewise.
+	* testsuite/libffi.call/cls_20byte.c: Likewise.
+	* testsuite/libffi.call/cls_20byte1.c: Likewise.
+	* testsuite/libffi.call/cls_24byte.c: Likewise.
+	* testsuite/libffi.call/cls_2byte.c: Likewise.
+	* testsuite/libffi.call/cls_3_1byte.c: Likewise.
+	* testsuite/libffi.call/cls_3byte1.c: Likewise.
+	* testsuite/libffi.call/cls_3byte2.c: Likewise.
+	* testsuite/libffi.call/cls_4_1byte.c: Likewise.
+	* testsuite/libffi.call/cls_4byte.c: Likewise.
+	* testsuite/libffi.call/cls_5byte.c: Likewise.
+	* testsuite/libffi.call/cls_64byte.c: Likewise.
+	* testsuite/libffi.call/cls_6byte.c: Likewise.
+	* testsuite/libffi.call/cls_7byte.c: Likewise.
+	* testsuite/libffi.call/cls_8byte.c: Likewise.
+	* testsuite/libffi.call/cls_9byte1.c: Likewise.
+	* testsuite/libffi.call/cls_9byte2.c: Likewise.
+	* testsuite/libffi.call/cls_double.c: Likewise.
+	* testsuite/libffi.call/cls_float.c: Likewise.
+	* testsuite/libffi.call/cls_schar.c: Likewise.
+	* testsuite/libffi.call/cls_sint.c: Likewise.
+	* testsuite/libffi.call/cls_sshort.c: Likewise.
+	* testsuite/libffi.call/cls_uchar.c: Likewise.
+	* testsuite/libffi.call/cls_uint.c: Likewise.
+	* testsuite/libffi.call/cls_ulonglong.c: Likewise.
+	* testsuite/libffi.call/cls_ushort.c: Likewise.
+	* testsuite/libffi.call/problem1.c: Likewise.
+
+	* testsuite/libffi.special/unwindtest.cc: Make ffi_closure
+	static.
+
+2003-11-08  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* testsuite/libffi.call/cls_9byte2.c: New test case.
+	* testsuite/libffi.call/cls_9byte1.c: Likewise.
+	* testsuite/libffi.call/cls_64byte.c: Likewise.
+	* testsuite/libffi.call/cls_20byte1.c: Likewise.
+	* testsuite/libffi.call/cls_19byte.c: Likewise.
+	* testsuite/libffi.call/cls_18byte.c: Likewise.
+	* testsuite/libffi.call/closure_fn4.c: Likewise.
+	* testsuite/libffi.call/closure_fn5.c: Likewise.
+	* testsuite/libffi.call/cls_schar.c: Likewise.
+	* testsuite/libffi.call/cls_sint.c: Likewise.
+	* testsuite/libffi.call/cls_sshort.c: Likewise.
+	* testsuite/libffi.call/nested_struct2.c: Likewise.
+	* testsuite/libffi.call/nested_struct3.c: Likewise.
+
+2003-11-08  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* testsuite/libffi.call/cls_double.c: Do a check on the result.
+	* testsuite/libffi.call/cls_uchar.c: Likewise.
+	* testsuite/libffi.call/cls_uint.c: Likewise.
+	* testsuite/libffi.call/cls_ulonglong.c: Likewise.
+	* testsuite/libffi.call/cls_ushort.c: Likewise.
+	* testsuite/libffi.call/return_sc.c: Cleanup whitespaces.
+
+2003-11-06  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* src/prep_cif.c (ffi_prep_cif): Move the validity check after
+	the initialization.
+
+2003-10-23  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* src/java_raw_api.c (ffi_java_ptrarray_to_raw): Replace
+	FFI_ASSERT(FALSE) with FFI_ASSERT(0).
+
+2003-10-22  David Daney  <ddaney@avtrex.com>
+
+	* src/mips/ffitarget.h: Replace undefined UINT32 and friends with
+	__attribute__((__mode__(__SI__))) and friends.
+
+2003-10-22  Andreas Schwab  <schwab@suse.de>
+
+	* src/ia64/ffi.c: Replace FALSE/TRUE with false/true.
+
+2003-10-21  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* configure.in: AC_LINK_FILES(ffitarget.h).
+	* configure: Regenerate.
+	* Makefile.in: Likewise.
+	* include/Makefile.in: Likewise.
+	* testsuite/Makefile.in: Likewise.
+	* fficonfig.h.in: Likewise.
+
+2003-10-21  Paolo Bonzini  <bonzini@gnu.org>
+	    Richard Henderson  <rth@redhat.com>
+
+	Avoid that ffi.h includes fficonfig.h.
+
+	* Makefile.am (EXTRA_DIST): Include ffitarget.h files
+	(TARGET_SRC_MIPS_GCC): Renamed to TARGET_SRC_MIPS_IRIX.
+	(TARGET_SRC_MIPS_SGI): Removed.
+	(MIPS_GCC): Renamed to TARGET_SRC_MIPS_IRIX.
+	(MIPS_SGI): Removed.
+	(CLEANFILES): Removed.
+	(mostlyclean-am, clean-am, mostlyclean-sub, clean-sub): New
+	targets.
+	* acconfig.h: Removed.
+	* configure.in: Compute sizeofs only for double and long double.
+	Use them to define and subst HAVE_LONG_DOUBLE.  Include comments
+	into AC_DEFINE instead of using acconfig.h.  Create
+	include/ffitarget.h instead of include/fficonfig.h.  Rename
+	MIPS_GCC to MIPS_IRIX, drop MIPS_SGI since we are in gcc's tree.
+	AC_DEFINE EH_FRAME_FLAGS.
+	* include/Makefile.am (DISTCLEANFILES): New automake macro.
+	(hack_DATA): Add ffitarget.h.
+	* include/ffi.h.in: Remove all system specific definitions.
+	Declare raw API even if it is not installed, why bother?
+	Use limits.h instead of SIZEOF_* to define ffi_type_*.  Do
+	not define EH_FRAME_FLAGS, it is in fficonfig.h now.  Include
+	ffitarget.h instead of fficonfig.h.  Remove ALIGN macro.
+	(UINT_ARG, INT_ARG): Removed, use ffi_arg and ffi_sarg instead.
+	* include/ffi_common.h (bool): Do not define.
+	(ffi_assert): Accept failed assertion.
+	(ffi_type_test): Return void and accept file/line.
+	(FFI_ASSERT): Pass stringized failed assertion.
+	(FFI_ASSERT_AT): New macro.
+	(FFI_ASSERT_VALID_TYPE): New macro.
+	(UINT8, SINT8, UINT16, SINT16, UINT32, SINT32,
+	UINT64, SINT64): Define here with gcc's __attribute__ macro
+	instead of in ffi.h
+	(FLOAT32, ALIGN): Define here instead of in ffi.h
+	* include/ffi-mips.h: Removed.  Its content moved to
+	src/mips/ffitarget.h after separating assembly and C sections.
+	* src/alpha/ffi.c, src/alpha/ffi.c, src/java_raw_api.c
+	src/prep_cif.c, src/raw_api.c, src/ia64/ffi.c,
+	src/mips/ffi.c, src/mips/n32.S, src/mips/o32.S,
+	src/mips/ffitarget.h, src/sparc/ffi.c, src/x86/ffi64.c:
+	SIZEOF_ARG -> FFI_SIZEOF_ARG.
+	* src/ia64/ffi.c: Include stdbool.h (provided by GCC 2.95+).
+	* src/debug.c (ffi_assert): Accept stringized failed assertion.
+	(ffi_type_test): Rewritten.
+	* src/prep-cif.c (initialize_aggregate, ffi_prep_cif): Call
+	FFI_ASSERT_VALID_TYPE.
+	* src/alpha/ffitarget.h, src/arm/ffitarget.h,
+	src/ia64/ffitarget.h, src/m68k/ffitarget.h,
+	src/mips/ffitarget.h, src/powerpc/ffitarget.h,
+	src/s390/ffitarget.h, src/sh/ffitarget.h,
+	src/sh64/ffitarget.h, src/sparc/ffitarget.h,
+	src/x86/ffitarget.h: New files.
+	* src/alpha/osf.S, src/arm/sysv.S, src/ia64/unix.S,
+	src/m68k/sysv.S, src/mips/n32.S, src/mips/o32.S,
+	src/powerpc/aix.S, src/powerpc/darwin.S,
+	src/powerpc/ffi_darwin.c, src/powerpc/linux64.S,
+	src/powerpc/linux64_closure.S, src/powerpc/ppc_closure.S,
+	src/powerpc/sysv.S, src/s390/sysv.S, src/sh/sysv.S,
+	src/sh64/sysv.S, src/sparc/v8.S, src/sparc/v9.S,
+	src/x86/sysv.S, src/x86/unix64.S, src/x86/win32.S:
+	include fficonfig.h
+
+2003-10-20  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
+
+	* src/mips/ffi.c: Use _ABIN32, _ABIO32 instead of external
+	_MIPS_SIM_NABI32, _MIPS_SIM_ABI32.
+
+2003-10-19  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* src/powerpc/ffi_darwin.c (ffi_prep_args): Declare bytes again.
+	Used when FFI_DEBUG = 1.
+
+2003-10-14  Alan Modra  <amodra@bigpond.net.au>
+
+	* src/types.c (double, longdouble): Default POWERPC64 to 8 byte size
+	and align.
+
+2003-10-06  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
+
+	* include/ffi_mips.h: Define FFI_MIPS_N32 for N32/N64 ABIs,
+	FFI_MIPS_O32 for O32 ABI.
+
+2003-10-01  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* testsuite/lib/libffi-dg.exp: Set LD_LIBRARY_PATH_64 for
+	SPARC64. Cleanup whitespaces.
+
+2003-09-19  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* testsuite/libffi.call/closure_fn0.c: Xfail mips, arm,
+	strongarm, xscale. Cleanup whitespaces.
+	* testsuite/libffi.call/closure_fn1.c: Likewise.
+	* testsuite/libffi.call/closure_fn2.c: Likewise.
+	* testsuite/libffi.call/closure_fn3.c: Likewise.
+	* testsuite/libffi.call/cls_12byte.c: Likewise.
+	* testsuite/libffi.call/cls_16byte.c: Likewise.
+	* testsuite/libffi.call/cls_1_1byte.c: Likewise.
+	* testsuite/libffi.call/cls_20byte.c: Likewise.
+	* testsuite/libffi.call/cls_24byte.c: Likewise.
+	* testsuite/libffi.call/cls_2byte.c: Likewise.
+	* testsuite/libffi.call/cls_3_1byte.c: Likewise.
+	* testsuite/libffi.call/cls_3byte1.c: Likewise.
+	* testsuite/libffi.call/cls_3byte2.c: Likewise.
+	* testsuite/libffi.call/cls_4_1byte.c: Likewise.
+	* testsuite/libffi.call/cls_4byte.c: Likewise.
+	* testsuite/libffi.call/cls_5byte.c: Likewise.
+	* testsuite/libffi.call/cls_6byte.c: Likewise.
+	* testsuite/libffi.call/cls_7byte.c: Likewise.
+	* testsuite/libffi.call/cls_8byte.c: Likewise.
+	* testsuite/libffi.call/cls_double.c: Likewise.
+	* testsuite/libffi.call/cls_float.c: Likewise.
+	* testsuite/libffi.call/cls_uchar.c: Likewise.
+	* testsuite/libffi.call/cls_uint.c: Likewise.
+	* testsuite/libffi.call/cls_ulonglong.c: Likewise.
+	* testsuite/libffi.call/cls_ushort.c: Likewise.
+	* testsuite/libffi.call/nested_struct.c: Likewise.
+	* testsuite/libffi.call/nested_struct1.c: Likewise.
+	* testsuite/libffi.call/problem1.c: Likewise.
+	* testsuite/libffi.special/unwindtest.cc: Likewise.
+	* testsuite/libffi.call/pyobjc-tc.c: Cleanup whitespaces.
+
+2003-09-18  David Edelsohn  <edelsohn@gnu.org>
+
+	* src/powerpc/aix.S: Cleanup whitespaces.
+	* src/powerpc/aix_closure.S: Likewise.
+
+2003-09-18  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* src/powerpc/darwin.S: Cleanup whitespaces, comment formatting.
+	* src/powerpc/darwin_closure.S: Likewise.
+	* src/powerpc/ffi_darwin.c: Likewise.
+
+2003-09-18  Andreas Tobler  <a.tobler@schweiz.ch>
+	    David Edelsohn  <edelsohn@gnu.org>
+
+	* src/types.c (double): Add AIX and Darwin to the right TYPEDEF.
+	* src/powerpc/aix_closure.S: Remove the pointer to the outgoing
+	parameter stack.
+	* src/powerpc/darwin_closure.S: Likewise.
+	* src/powerpc/ffi_darwin.c (ffi_prep_args): Handle structures
+	according to the Darwin/AIX ABI.
+	(ffi_prep_cif_machdep): Likewise.
+	(ffi_closure_helper_DARWIN): Likewise.
+	Remove the outgoing parameter stack logic. Simplify the evaluation
+	of the different CASE types.
+	(ffi_prep_clousure): Avoid the casts on lvalues. Change the branch
+	statement in the trampoline code.
+
+2003-09-18  Kaz Kojima  <kkojima@gcc.gnu.org>
+
+	* src/sh/ffi.c (ffi_prep_args): Take account into the alignement
+	for the register size.
+	(ffi_closure_helper_SYSV): Handle the structure return value
+	address correctly.
+	(ffi_closure_helper_SYSV): Return the appropriate type when
+	the registers are used for the structure return value.
+	* src/sh/sysv.S (ffi_closure_SYSV): Fix the stack layout for
+	the 64-bit return value.  Update copyright years.
+
+2003-09-17  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
+
+	* testsuite/lib/libffi-dg.exp (libffi_target_compile): Search in
+	srcdir for ffi_mips.h.
+
+2003-09-12  Alan Modra  <amodra@bigpond.net.au>
+
+	* src/prep_cif.c (initialize_aggregate): Include tail padding in
+	structure size.
+	* src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Correct
+	placement of float result.
+	* testsuite/libffi.special/unwindtest.cc (closure_test_fn1): Correct
+	cast of "resp" for big-endian 64 bit machines.
+
+2003-09-11  Alan Modra  <amodra@bigpond.net.au>
+
+	* src/types.c (double, longdouble): Merge identical SH and ARM
+	typedefs, and add POWERPC64.
+	* src/powerpc/ffi.c (ffi_prep_args64): Correct next_arg calc for
+	struct split over gpr and rest.
+	(ffi_prep_cif_machdep): Correct intarg_count for structures.
+	* src/powerpc/linux64.S (ffi_call_LINUX64): Fix gpr offsets.
+
+2003-09-09  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* src/powerpc/ffi.c (ffi_closure_helper_SYSV) Handle struct
+	passing correctly.
+
+2003-09-09  Alan Modra  <amodra@bigpond.net.au>
+
+	* configure: Regenerate.
+
+2003-09-04  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* Makefile.am: Remove build rules for ffitest.
+	* Makefile.in: Rebuilt.
+
+2003-09-04  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* src/java_raw_api.c: Include <stdlib.h> to fix compiler warning
+	about implicit declaration of abort().
+
+2003-09-04  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* Makefile.am: Add dejagnu test framework. Fixes PR other/11411.
+	* Makefile.in: Rebuilt.
+	* configure.in: Add dejagnu test framework.
+	* configure: Rebuilt.
+
+	* testsuite/Makefile.am: New file.
+	* testsuite/Makefile.in: Built
+	* testsuite/lib/libffi-dg.exp: New file.
+	* testsuite/config/default.exp: Likewise.
+	* testsuite/libffi.call/call.exp: Likewise.
+	* testsuite/libffi.call/ffitest.h: Likewise.
+	* testsuite/libffi.call/closure_fn0.c: Likewise.
+	* testsuite/libffi.call/closure_fn1.c: Likewise.
+	* testsuite/libffi.call/closure_fn2.c: Likewise.
+	* testsuite/libffi.call/closure_fn3.c: Likewise.
+	* testsuite/libffi.call/cls_1_1byte.c: Likewise.
+	* testsuite/libffi.call/cls_3_1byte.c: Likewise.
+	* testsuite/libffi.call/cls_4_1byte.c: Likewise.
+	* testsuite/libffi.call/cls_2byte.c: Likewise.
+	* testsuite/libffi.call/cls_3byte1.c: Likewise.
+	* testsuite/libffi.call/cls_3byte2.c: Likewise.
+	* testsuite/libffi.call/cls_4byte.c: Likewise.
+	* testsuite/libffi.call/cls_5byte.c: Likewise.
+	* testsuite/libffi.call/cls_6byte.c: Likewise.
+	* testsuite/libffi.call/cls_7byte.c: Likewise.
+	* testsuite/libffi.call/cls_8byte.c: Likewise.
+	* testsuite/libffi.call/cls_12byte.c: Likewise.
+	* testsuite/libffi.call/cls_16byte.c: Likewise.
+	* testsuite/libffi.call/cls_20byte.c: Likewise.
+	* testsuite/libffi.call/cls_24byte.c: Likewise.
+	* testsuite/libffi.call/cls_double.c: Likewise.
+	* testsuite/libffi.call/cls_float.c: Likewise.
+	* testsuite/libffi.call/cls_uchar.c: Likewise.
+	* testsuite/libffi.call/cls_uint.c: Likewise.
+	* testsuite/libffi.call/cls_ulonglong.c: Likewise.
+	* testsuite/libffi.call/cls_ushort.c: Likewise.
+	* testsuite/libffi.call/float.c: Likewise.
+	* testsuite/libffi.call/float1.c: Likewise.
+	* testsuite/libffi.call/float2.c: Likewise.
+	* testsuite/libffi.call/many.c: Likewise.
+	* testsuite/libffi.call/many_win32.c: Likewise.
+	* testsuite/libffi.call/nested_struct.c: Likewise.
+	* testsuite/libffi.call/nested_struct1.c: Likewise.
+	* testsuite/libffi.call/pyobjc-tc.c: Likewise.
+	* testsuite/libffi.call/problem1.c: Likewise.
+	* testsuite/libffi.call/promotion.c: Likewise.
+	* testsuite/libffi.call/return_ll.c: Likewise.
+	* testsuite/libffi.call/return_sc.c: Likewise.
+	* testsuite/libffi.call/return_uc.c: Likewise.
+	* testsuite/libffi.call/strlen.c: Likewise.
+	* testsuite/libffi.call/strlen_win32.c: Likewise.
+	* testsuite/libffi.call/struct1.c: Likewise.
+	* testsuite/libffi.call/struct2.c: Likewise.
+	* testsuite/libffi.call/struct3.c: Likewise.
+	* testsuite/libffi.call/struct4.c: Likewise.
+	* testsuite/libffi.call/struct5.c: Likewise.
+	* testsuite/libffi.call/struct6.c: Likewise.
+	* testsuite/libffi.call/struct7.c: Likewise.
+	* testsuite/libffi.call/struct8.c: Likewise.
+	* testsuite/libffi.call/struct9.c: Likewise.
+	* testsuite/libffi.special/special.exp: New file.
+	* testsuite/libffi.special/ffitestcxx.h: Likewise.
+	* testsuite/libffi.special/unwindtest.cc: Likewise.
+
+
+2003-08-13  Kaz Kojima  <kkojima@gcc.gnu.org>
+
+	* src/sh/ffi.c (OFS_INT16): Set 0 for little endian case.  Update
+	copyright years.
+
+2003-08-02  Alan Modra  <amodra@bigpond.net.au>
+
+	* src/powerpc/ffi.c (ffi_prep_args64): Modify for changed gcc
+	structure passing.
+	(ffi_closure_helper_LINUX64): Likewise.
+	* src/powerpc/linux64.S: Remove code writing to parm save area.
+	* src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Use return
+	address in lr from ffi_closure_helper_LINUX64 call to calculate
+	table address.  Optimize function tail.
+
+2003-07-28  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* src/sparc/ffi.c: Handle all floating point registers.
+	* src/sparc/v9.S: Likewise. Fixes second part of PR target/11410.
+
+2003-07-11  Gerald Pfeifer  <pfeifer@dbai.tuwien.ac.at>
+
+	* README: Note that libffi is not part of GCC.  Update the project
+	URL and status.
+
+2003-06-19  Franz Sirl  <Franz.Sirl-kernel@lauterbach.com>
+
+	* src/powerpc/ppc_closure.S: Include ffi.h.
+
+2003-06-13  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
+
+	* src/x86/sysv.S: Avoid gas-only .uleb128/.sleb128 directives.
+	Use C style comments.
+
+2003-06-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
+
+	* Makefile.am: Add SHmedia support.  Fix a typo of SH support.
+	* Makefile.in: Regenerate.
+	* configure.in (sh64-*-linux*, sh5*-*-linux*): Add target.
+	* configure: Regenerate.
+	* include/ffi.h.in: Add SHmedia support.
+	* src/sh64/ffi.c: New file.
+	* src/sh64/sysv.S: New file.
+
+2003-05-16  Jakub Jelinek  <jakub@redhat.com>
+
+	* configure.in (HAVE_RO_EH_FRAME): Check whether .eh_frame section
+	should be read-only.
+	* configure: Rebuilt.
+	* fficonfig.h.in: Rebuilt.
+	* include/ffi.h.in (EH_FRAME_FLAGS): Define.
+	* src/alpha/osf.S: Use EH_FRAME_FLAGS.
+	* src/powerpc/linux64.S: Likewise.
+	* src/powerpc/linux64_closure.S: Likewise.  Include ffi.h.
+	* src/powerpc/sysv.S: Use EH_FRAME_FLAGS.  Use pcrel encoding
+	if -fpic/-fPIC/-mrelocatable.
+	* src/powerpc/powerpc_closure.S: Likewise.
+	* src/sparc/v8.S: If HAVE_RO_EH_FRAME is defined, don't include
+	#write in .eh_frame flags.
+	* src/sparc/v9.S: Likewise.
+	* src/x86/unix64.S: Use EH_FRAME_FLAGS.
+	* src/x86/sysv.S: Likewise.  Use pcrel encoding if -fpic/-fPIC.
+	* src/s390/sysv.S: Use EH_FRAME_FLAGS.  Include ffi.h.
+
+2003-05-07  Jeff Sturm  <jsturm@one-point.com>
+
+	Fixes PR bootstrap/10656
+	* configure.in (HAVE_AS_REGISTER_PSEUDO_OP): Test assembler
+	support for .register pseudo-op.
+	* src/sparc/v8.S: Use it.
+	* fficonfig.h.in: Rebuilt.
+	* configure: Rebuilt.
+
+2003-04-18  Jakub Jelinek  <jakub@redhat.com>
+
+	* include/ffi.h.in (POWERPC64): Define if 64-bit.
+	(enum ffi_abi): Add FFI_LINUX64 on POWERPC.
+	Make it the default on POWERPC64.
+	(FFI_TRAMPOLINE_SIZE): Define to 24 on POWERPC64.
+	* configure.in: Change powerpc-*-linux* into powerpc*-*-linux*.
+	* configure: Rebuilt.
+	* src/powerpc/ffi.c (hidden): Define.
+	(ffi_prep_args_SYSV): Renamed from
+	ffi_prep_args.  Cast pointers to unsigned long to shut up warnings.
+	(NUM_GPR_ARG_REGISTERS64, NUM_FPR_ARG_REGISTERS64,
+	ASM_NEEDS_REGISTERS64): New.
+	(ffi_prep_args64): New function.
+	(ffi_prep_cif_machdep): Handle FFI_LINUX64 ABI.
+	(ffi_call): Likewise.
+	(ffi_prep_closure): Likewise.
+	(flush_icache): Surround by #ifndef POWERPC64.
+	(ffi_dblfl): New union type.
+	(ffi_closure_helper_SYSV): Use it to avoid aliasing problems.
+	(ffi_closure_helper_LINUX64): New function.
+	* src/powerpc/ppc_closure.S: Surround whole file by #ifndef
+	__powerpc64__.
+	* src/powerpc/sysv.S: Likewise.
+	(ffi_call_SYSV): Rename ffi_prep_args to ffi_prep_args_SYSV.
+	* src/powerpc/linux64.S: New file.
+	* src/powerpc/linux64_closure.S: New file.
+	* Makefile.am (EXTRA_DIST): Add src/powerpc/linux64.S and
+	src/powerpc/linux64_closure.S.
+	(TARGET_SRC_POWERPC): Likewise.
+
+	* src/ffitest.c (closure_test_fn, closure_test_fn1, closure_test_fn2,
+	closure_test_fn3): Fix result printing on big-endian 64-bit
+	machines.
+	(main): Print tst2_arg instead of uninitialized tst2_result.
+
+	* src/ffitest.c (main): Hide what closure pointer really points to
+	from the compiler.
+
+2003-04-16  Richard Earnshaw  <rearnsha@arm.com>
+
+	* configure.in (arm-*-netbsdelf*): Add configuration.
+	(configure): Regenerated.
+
+2003-04-04  Loren J. Rittle  <ljrittle@acm.org>
+
+	* include/Makefile.in: Regenerate.
+
+2003-03-21  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>
+
+	* libffi/include/ffi.h.in: Define X86 instead of X86_64 in 32
+	bit mode.
+	* libffi/src/x86/ffi.c (ffi_closure_SYSV, ffi_closure_raw_SYSV):
+	Receive closure pointer through parameter, read args using
+	__builtin_dwarf_cfa.
+	(FFI_INIT_TRAMPOLINE): Send closure reference through eax.
+
+2003-03-12  Andreas Schwab  <schwab@suse.de>
+
+	* configure.in: Avoid trailing /. in toolexeclibdir.
+	* configure: Rebuilt.
+
+2003-03-03  Andreas Tobler <a.tobler@schweiz.ch>
+
+	* src/powerpc/darwin_closure.S: Recode to fit dynamic libraries.
+
+2003-02-06  Andreas Tobler <a.tobler@schweiz.ch>
+
+	* libffi/src/powerpc/darwin_closure.S:
+	Fix alignement bug, allocate 8 bytes for the result.
+	* libffi/src/powerpc/aix_closure.S:
+	Likewise.
+	* libffi/src/powerpc/ffi_darwin.c:
+	Update stackframe description for aix/darwin_closure.S.
+
+2003-02-06  Jakub Jelinek  <jakub@redhat.com>
+
+	* src/s390/ffi.c (ffi_closure_helper_SYSV): Add hidden visibility
+	attribute.
+
+2003-01-31  Christian Cornelssen  <ccorn@cs.tu-berlin.de>,
+	    Andreas Schwab  <schwab@suse.de>
+
+	* configure.in: Adjust command to source config-ml.in to account
+	for changes to the libffi_basedir definition.
+	(libffi_basedir): Remove ${srcdir} from value and include trailing
+	slash if nonempty.
+
+	* configure: Regenerate.
+
+2003-01-29  Franz Sirl  <Franz.Sirl-kernel@lauterbach.com>
+
+	* src/powerpc/ppc_closure.S: Recode to fit shared libs.
+
+2003-01-28  Andrew Haley  <aph@redhat.com>
+
+	* include/ffi.h.in: Enable FFI_CLOSURES for x86_64.
+	* src/x86/ffi64.c (ffi_prep_closure): New.
+	(ffi_closure_UNIX64_inner): New.
+	* src/x86/unix64.S (ffi_closure_UNIX64): New.
+
+2003-01-27  Alexandre Oliva  <aoliva@redhat.com>
+
+	* configure.in (toolexecdir, toolexeclibdir): Set and AC_SUBST.
+	Remove USE_LIBDIR conditional.
+	* Makefile.am (toolexecdir, toolexeclibdir): Don't override.
+	* Makefile.in, configure: Rebuilt.
+
+2003-01027  David Edelsohn  <edelsohn@gnu.org>
+
+	* Makefile.am (TARGET_SRC_POWERPC_AIX): Fix typo.
+	* Makefile.in: Regenerate.
+
+2003-01-22  Andrew Haley  <aph@redhat.com>
+
+	* src/powerpc/darwin.S (_ffi_call_AIX): Add Augmentation size to
+	unwind info.
+
+2003-01-21  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* src/powerpc/darwin.S: Add unwind info.
+	* src/powerpc/darwin_closure.S: Likewise.
+
+2003-01-14  Andrew Haley  <aph@redhat.com>
+
+	* src/x86/ffi64.c (ffi_prep_args): Check for void retval.
+	(ffi_prep_cif_machdep): Likewise.
+	* src/x86/unix64.S: Add unwind info.
+
+2003-01-14  Andreas Jaeger  <aj@suse.de>
+
+	* src/ffitest.c (main): Only use ffi_closures if those are
+	supported.
+
+2003-01-13 Andreas Tobler <a.tobler@schweiz.ch>
+
+	* libffi/src/ffitest.c
+	 add closure testcases
+
+2003-01-13 Kevin B. Hendricks <khendricks@ivey.uwo.ca>
+
+	* libffi/src/powerpc/ffi.c
+	 fix alignment bug for float (4 byte aligned iso 8 byte)
+
+2003-01-09  Geoffrey Keating  <geoffk@apple.com>
+
+	* src/powerpc/ffi_darwin.c: Remove RCS version string.
+	* src/powerpc/darwin.S: Remove RCS version string.
+
+2003-01-03  Jeff Sturm  <jsturm@one-point.com>
+
+	* include/ffi.h.in: Add closure defines for SPARC, SPARC64.
+	* src/ffitest.c (main): Use static storage for closure.
+	* src/sparc/ffi.c (ffi_prep_closure, ffi_closure_sparc_inner): New.
+	* src/sparc/v8.S (ffi_closure_v8): New.
+	* src/sparc/v9.S (ffi_closure_v9): New.
+
+2002-11-10  Ranjit Mathew <rmathew@hotmail.com>
+
+	* include/ffi.h.in: Added FFI_STDCALL ffi_type
+	  enumeration for X86_WIN32.
+	* src/x86/win32.S: Added ffi_call_STDCALL function
+	  definition.
+	* src/x86/ffi.c (ffi_call/ffi_raw_call): Added
+	  switch cases for recognising FFI_STDCALL and
+	  calling ffi_call_STDCALL if target is X86_WIN32.
+	* src/ffitest.c (my_stdcall_strlen/stdcall_many):
+	  stdcall versions of the "my_strlen" and "many"
+	  test functions (for X86_WIN32).
+	  Added test cases to test stdcall invocation using
+	  these functions.
+
+2002-12-02  Kaz Kojima  <kkojima@gcc.gnu.org>
+
+	* src/sh/sysv.S: Add DWARF2 unwind info.
+
+2002-11-27  Ulrich Weigand  <uweigand@de.ibm.com>
+
+	* src/s390/sysv.S (.eh_frame section): Make section read-only.
+
+2002-11-26  Jim Wilson  <wilson@redhat.com>
+
+	* src/types.c (FFI_TYPE_POINTER): Has size 8 on IA64.
+
+2002-11-23  H.J. Lu <hjl@gnu.org>
+
+	* acinclude.m4: Add dummy AM_PROG_LIBTOOL.
+	Include ../config/accross.m4.
+	* aclocal.m4; Rebuild.
+	* configure: Likewise.
+
+2002-11-15  Ulrich Weigand  <uweigand@de.ibm.com>
+
+	* src/s390/sysv.S (.eh_frame section): Adapt to pcrel FDE encoding.
+
+2002-11-11  DJ Delorie  <dj@redhat.com>
+
+	* configure.in: Look for common files in the right place.
+
+2002-10-08  Ulrich Weigand  <uweigand@de.ibm.com>
+
+	* src/java_raw_api.c (ffi_java_raw_to_ptrarray): Interpret
+	raw data as _Jv_word values, not ffi_raw.
+	(ffi_java_ptrarray_to_raw): Likewise.
+	(ffi_java_rvalue_to_raw): New function.
+	(ffi_java_raw_call): Call it.
+	(ffi_java_raw_to_rvalue): New function.
+	(ffi_java_translate_args): Call it.
+	* src/ffitest.c (closure_test_fn): Interpret return value
+	as ffi_arg, not int.
+	* src/s390/ffi.c (ffi_prep_cif_machdep): Add missing
+	FFI_TYPE_POINTER case.
+	(ffi_closure_helper_SYSV): Likewise.  Also, assume return
+	values extended to word size.
+
+2002-10-02  Andreas Jaeger  <aj@suse.de>
+
+	* src/x86/ffi64.c (ffi_prep_cif_machdep): Remove debug output.
+
+2002-10-01  Bo Thorsen  <bo@smetana.suse.de>
+
+	* include/ffi.h.in: Fix i386 win32 compilation.
+
+2002-09-30  Ulrich Weigand  <uweigand@de.ibm.com>
+
+	* configure.in: Add s390x-*-linux-* target.
+	* configure: Regenerate.
+	* include/ffi.h.in: Define S390X for s390x targets.
+	(FFI_CLOSURES): Define for s390/s390x.
+	(FFI_TRAMPOLINE_SIZE): Likewise.
+	(FFI_NATIVE_RAW_API): Likewise.
+	* src/prep_cif.c (ffi_prep_cif): Do not compute stack space for s390.
+	* src/types.c (FFI_TYPE_POINTER): Use 8-byte pointers on s390x.
+	* src/s390/ffi.c: Major rework of existing code.  Add support for
+	s390x targets.  Add closure support.
+	* src/s390/sysv.S: Likewise.
+
+2002-09-29  Richard Earnshaw  <rearnsha@arm.com>
+
+	* src/arm/sysv.S: Fix typo.
+
+2002-09-28  Richard Earnshaw  <rearnsha@arm.com>
+
+	* src/arm/sysv.S: If we don't have machine/asm.h and the pre-processor
+	has defined __USER_LABEL_PREFIX__, then use it in CNAME.
+	(ffi_call_SYSV): Handle soft-float.
+
+2002-09-27  Bo Thorsen  <bo@suse.de>
+
+	* include/ffi.h.in: Fix multilib x86-64 support.
+
+2002-09-22  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+	* Makefile.am (all-multi): Fix multilib parallel build.
+
+2002-07-19  Kaz Kojima  <kkojima@gcc.gnu.org>
+
+	* configure.in (sh[34]*-*-linux*): Add brackets.
+	* configure: Regenerate.
+
+2002-07-18  Kaz Kojima  <kkojima@gcc.gnu.org>
+
+	* Makefile.am: Add SH support.
+	* Makefile.in: Regenerate.
+	* configure.in (sh-*-linux*, sh[34]*-*-linux*): Add target.
+	* configure: Regenerate.
+	* include/ffi.h.in: Add SH support.
+	* src/sh/ffi.c: New file.
+	* src/sh/sysv.S: New file.
+	* src/types.c: Add SH support.
+
+2002-07-16  Bo Thorsen  <bo@suse.de>
+
+	* src/x86/ffi64.c: New file that adds x86-64 support.
+	* src/x86/unix64.S: New file that handles argument setup for
+	x86-64.
+	* src/x86/sysv.S: Don't use this on x86-64.
+	* src/x86/ffi.c: Don't use this on x86-64.
+	Remove unused vars.
+	* src/prep_cif.c (ffi_prep_cif): Don't do stack size calculation
+	for x86-64.
+	* src/ffitest.c (struct6): New test that tests a special case in
+	the x86-64 ABI.
+	(struct7): Likewise.
+	(struct8): Likewise.
+	(struct9): Likewise.
+	(closure_test_fn): Silence warning about this when it's not used.
+	(main): Add the new tests.
+	(main): Fix a couple of wrong casts and silence some compiler warnings.
+	* include/ffi.h.in: Add x86-64 ABI definition.
+	* fficonfig.h.in: Regenerate.
+	* Makefile.am: Add x86-64 support.
+	* configure.in: Likewise.
+	* Makefile.in: Regenerate.
+	* configure: Likewise.
+
+2002-06-24  Bo Thorsen  <bo@suse.de>
+
+	* src/types.c: Merge settings for similar architectures.
+	Add x86-64 sizes and alignments.
+
+2002-06-23  Bo Thorsen  <bo@suse.de>
+
+	* src/arm/ffi.c (ffi_prep_args): Remove unused vars.
+	* src/sparc/ffi.c (ffi_prep_args_v8): Likewise.
+	* src/mips/ffi.c (ffi_prep_args): Likewise.
+	* src/m68k/ffi.c (ffi_prep_args): Likewise.
+
+2002-07-18  H.J. Lu  (hjl@gnu.org)
+
+	* Makefile.am (TARGET_SRC_MIPS_LINUX): New.
+	(libffi_la_SOURCES): Support MIPS_LINUX.
+	(libffi_convenience_la_SOURCES): Likewise.
+	* Makefile.in: Regenerated.
+
+	* configure.in (mips64*-*): Skip.
+	(mips*-*-linux*): New.
+	* configure: Regenerated.
+
+	* src/mips/ffi.c: Include <sgidefs.h>.
+
+2002-06-06  Ulrich Weigand  <uweigand@de.ibm.com>
+
+	* src/s390/sysv.S: Save/restore %r6.  Add DWARF-2 unwind info.
+
+2002-05-27  Roger Sayle  <roger@eyesopen.com>
+
+	* src/x86/ffi.c (ffi_prep_args): Remove reference to avn.
+
+2002-05-27  Bo Thorsen  <bo@suse.de>
+
+	* src/x86/ffi.c (ffi_prep_args): Remove unused variable and
+	fix formatting.
+
+2002-05-13  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* src/powerpc/ffi_darwin.c (ffi_prep_closure): Declare fd at
+	beginning of function (for older apple cc).
+
+2002-05-08  Alexandre Oliva  <aoliva@redhat.com>
+
+	* configure.in (ORIGINAL_LD_FOR_MULTILIBS): Preserve LD at
+	script entry, and set LD to it when configuring multilibs.
+	* configure: Rebuilt.
+
+2002-05-05  Jason Thorpe  <thorpej@wasabisystems.com>
+
+	* configure.in (sparc64-*-netbsd*): Add target.
+	(sparc-*-netbsdelf*): Likewise.
+	* configure: Regenerate.
+
+2002-04-28  David S. Miller  <davem@redhat.com>
+
+	* configure.in, configure: Fix SPARC test in previous change.
+
+2002-04-29  Gerhard Tonn  <GerhardTonn@swol.de>
+
+	* Makefile.am: Add Linux for S/390 support.
+	* Makefile.in: Regenerate.
+	* configure.in: Add Linux for S/390 support.
+	* configure: Regenerate.
+	* include/ffi.h.in: Add Linux for S/390 support.
+	* src/s390/ffi.c: New file from libffi CVS tree.
+	* src/s390/sysv.S: New file from libffi CVS tree.
+
+2002-04-28  Jakub Jelinek  <jakub@redhat.com>
+
+	* configure.in (HAVE_AS_SPARC_UA_PCREL): Check for working
+	%r_disp32().
+	* src/sparc/v8.S: Use it.
+	* src/sparc/v9.S: Likewise.
+	* fficonfig.h.in: Rebuilt.
+	* configure: Rebuilt.
+
+2002-04-08  Hans Boehm  <Hans_Boehm@hp.com>
+
+	* src/java_raw_api.c (ffi_java_raw_size): Handle FFI_TYPE_DOUBLE
+	correctly.
+	* src/ia64/unix.S: Add unwind information. Fix comments.
+	Save sp in a way that's compatible with unwind info.
+	(ffi_call_unix): Correctly restore sp in all cases.
+	* src/ia64/ffi.c: Add, fix comments.
+
+2002-04-08  Jakub Jelinek  <jakub@redhat.com>
+
+	* src/sparc/v8.S: Make .eh_frame dependent on target word size.
+
+2002-04-06  Jason Thorpe  <thorpej@wasabisystems.com>
+
+	* configure.in (alpha*-*-netbsd*): Add target.
+	* configure: Regenerate.
+
+2002-04-04  Jeff Sturm  <jsturm@one-point.com>
+
+	* src/sparc/v8.S: Add unwind info.
+	* src/sparc/v9.S: Likewise.
+
+2002-03-30  Krister Walfridsson  <cato@df.lth.se>
+
+	* configure.in: Enable i*86-*-netbsdelf*.
+	* configure: Rebuilt.
+
+2002-03-29  David Billinghurst <David.Billinghurst@riotinto.com>
+
+	PR other/2620
+	* src/mips/n32.s: Delete
+	* src/mips/o32.s: Delete
+
+2002-03-21  Loren J. Rittle  <ljrittle@acm.org>
+
+	* configure.in: Enable alpha*-*-freebsd*.
+	* configure: Rebuilt.
+
+2002-03-17  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
+
+	* Makefile.am: libfficonvenience -> libffi_convenience.
+	* Makefile.in: Rebuilt.
+
+	* Makefile.am: Define ffitest_OBJECTS.
+	* Makefile.in: Rebuilt.
+
+2002-03-07  Andreas Tobler  <toa@pop.agri.ch>
+	    David Edelsohn  <edelsohn@gnu.org>
+
+	* Makefile.am (EXTRA_DIST): Add Darwin and AIX closure files.
+	(TARGET_SRC_POWERPC_AIX): Add aix_closure.S.
+	(TARGET_SRC_POWERPC_DARWIN): Add darwin_closure.S.
+	* Makefile.in: Regenerate.
+	* include/ffi.h.in: Add AIX and Darwin closure definitions.
+	* src/powerpc/ffi_darwin.c (ffi_prep_closure): New function.
+	(flush_icache, flush_range): New functions.
+	(ffi_closure_helper_DARWIN): New function.
+	* src/powerpc/aix_closure.S: New file.
+	* src/powerpc/darwin_closure.S: New file.
+
+2002-02-24  Jeff Sturm  <jsturm@one-point.com>
+
+	* include/ffi.h.in: Add typedef for ffi_arg.
+	* src/ffitest.c (main): Declare rint with ffi_arg.
+
+2002-02-21  Andreas Tobler  <toa@pop.agri.ch>
+
+	* src/powerpc/ffi_darwin.c (ffi_prep_args): Skip appropriate
+	number of GPRs for floating-point arguments.
+
+2002-01-31  Anthony Green  <green@redhat.com>
+
+	* configure: Rebuilt.
+	* configure.in: Replace CHECK_SIZEOF and endian tests with
+	cross-compiler friendly macros.
+	* aclocal.m4 (AC_COMPILE_CHECK_SIZEOF, AC_C_BIGENDIAN_CROSS): New
+	macros.
+
+2002-01-18  David Edelsohn  <edelsohn@gnu.org>
+
+	* src/powerpc/darwin.S (_ffi_call_AIX): New.
+	* src/powerpc/aix.S (ffi_call_DARWIN): New.
+
+2002-01-17  David Edelsohn  <edelsohn@gnu.org>
+
+	* Makefile.am (EXTRA_DIST): Add Darwin and AIX files.
+	(TARGET_SRC_POWERPC_AIX): New.
+	(POWERPC_AIX): New stanza.
+	* Makefile.in: Regenerate.
+	* configure.in: Add AIX case.
+	* configure: Regenerate.
+	* include/ffi.h.in (ffi_abi): Add FFI_AIX.
+	* src/powerpc/ffi_darwin.c (ffi_status): Use "long" to scale frame
+	size.  Fix "long double" support.
+	(ffi_call): Add FFI_AIX case.
+	* src/powerpc/aix.S: New.
+
+2001-10-09  John Hornkvist  <john@toastedmarshmallow.com>
+
+	Implement Darwin PowerPC ABI.
+	* configure.in: Handle powerpc-*-darwin*.
+	* Makefile.am: Set source files for POWERPC_DARWIN.
+	* configure: Rebuilt.
+	* Makefile.in: Rebuilt.
+	* include/ffi.h.in: Define FFI_DARWIN and FFI_DEFAULT_ABI for
+	POWERPC_DARWIN.
+	* src/powerpc/darwin.S: New file.
+	* src/powerpc/ffi_darwin.c: New file.
+
+2001-10-07  Joseph S. Myers  <jsm28@cam.ac.uk>
+
+	* src/x86/ffi.c: Fix spelling error of "separate" as "seperate".
+
+2001-07-16  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
+
+	* src/x86/sysv.S: Avoid gas-only .balign directive.
+	Use C style comments.
+
+2001-07-16  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
+
+	* src/alpha/ffi.c (ffi_prep_closure): Avoid gas-only mnemonic.
+	Fixes PR bootstrap/3563.
+
+2001-06-26  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
+
+	* src/alpha/osf.S (ffi_closure_osf): Use .rdata for ECOFF.
+
+2001-06-25  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
+
+	* configure.in: Recognize sparc*-sun-* host.
+	* configure: Regenerate.
+
+2001-06-06  Andrew Haley  <aph@redhat.com>
+
+	* src/alpha/osf.S (__FRAME_BEGIN__): Conditionalize for ELF.
+
+2001-06-03  Andrew Haley  <aph@redhat.com>
+
+	* src/alpha/osf.S: Add unwind info.
+	* src/powerpc/sysv.S: Add unwind info.
+	* src/powerpc/ppc_closure.S: Likewise.
+
+2000-05-31  Jeff Sturm  <jsturm@one-point.com>
+
+	* configure.in: Fix AC_ARG_ENABLE usage.
+	* configure: Rebuilt.
+
+2001-05-06  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
+
+	* configure.in: Remove warning about beta code.
+	* configure: Rebuilt.
+
+2001-04-25  Hans Boehm <Hans_Boehm@hp.com>
+
+	* src/ia64/unix.S: Restore stack pointer when returning from
+	ffi_closure_UNIX.
+	* src/ia64/ffi.c: Fix typo in comment.
+
+2001-04-18  Jim Wilson  <wilson@redhat.com>
+
+	* src/ia64/unix.S: Delete unnecessary increment and decrement of loc2
+	to eliminate RAW DV.
+
+2001-04-12  Bryce McKinlay  <bryce@albatross.co.nz>
+
+	* Makefile.am: Make a libtool convenience library.
+	* Makefile.in: Rebuilt.
+
+2001-03-29  Bryce McKinlay  <bryce@albatross.co.nz>
+
+	* configure.in: Use different syntax for subdirectory creation.
+	* configure: Rebuilt.
+
+2001-03-27  Jon Beniston  <jon@beniston.com>
+
+	* configure.in: Added X86_WIN32 target (Win32, CygWin, MingW).
+	* configure: Rebuilt.
+	* Makefile.am: Added X86_WIN32 target support.
+	* Makefile.in: Rebuilt.
+
+	* include/ffi.h.in: Added X86_WIN32 target support.
+
+	* src/ffitest.c: Doesn't run structure tests for X86_WIN32 targets.
+	* src/types.c: Added X86_WIN32 target support.
+
+	* src/x86/win32.S: New file. Based on sysv.S, but with EH
+	stuff removed and made to work with CygWin's gas.
+
+2001-03-26  Bryce McKinlay  <bryce@albatross.co.nz>
+
+	* configure.in: Make target subdirectory in build dir.
+	* Makefile.am: Override suffix based rules to specify correct output
+	subdirectory.
+	* Makefile.in: Rebuilt.
+	* configure: Rebuilt.
+
+2001-03-23  Kevin B Hendricks  <khendricks@ivey.uwo.ca>
+
+	* src/powerpc/ppc_closure.S: New file.
+	* src/powerpc/ffi.c (ffi_prep_args): Fixed ABI compatibility bug
+	involving long long and register pairs.
+	(ffi_prep_closure): New function.
+	(flush_icache): Likewise.
+	(ffi_closure_helper_SYSV): Likewise.
+	* include/ffi.h.in (FFI_CLOSURES): Define on PPC.
+	(FFI_TRAMPOLINE_SIZE): Likewise.
+	(FFI_NATIVE_RAW_API): Likewise.
+	* Makefile.in: Rebuilt.
+	* Makefile.am (EXTRA_DIST): Added src/powerpc/ppc_closure.S.
+	(TARGET_SRC_POWERPC): Likewise.
+
+2001-03-19  Tom Tromey  <tromey@redhat.com>
+
+	* Makefile.in: Rebuilt.
+	* Makefile.am (ffitest_LDFLAGS): New macro.
+
+2001-03-02  Nick Clifton  <nickc@redhat.com>
+
+	* include/ffi.h.in: Remove RCS ident string.
+	* include/ffi_mips.h: Remove RCS ident string.
+	* src/debug.c: Remove RCS ident string.
+	* src/ffitest.c: Remove RCS ident string.
+	* src/prep_cif.c: Remove RCS ident string.
+	* src/types.c: Remove RCS ident string.
+	* src/alpha/ffi.c: Remove RCS ident string.
+	* src/alpha/osf.S: Remove RCS ident string.
+	* src/arm/ffi.c: Remove RCS ident string.
+	* src/arm/sysv.S: Remove RCS ident string.
+	* src/mips/ffi.c: Remove RCS ident string.
+	* src/mips/n32.S: Remove RCS ident string.
+	* src/mips/o32.S: Remove RCS ident string.
+	* src/sparc/ffi.c: Remove RCS ident string.
+	* src/sparc/v8.S: Remove RCS ident string.
+	* src/sparc/v9.S: Remove RCS ident string.
+	* src/x86/ffi.c: Remove RCS ident string.
+	* src/x86/sysv.S: Remove RCS ident string.
+
+2001-02-08  Joseph S. Myers  <jsm28@cam.ac.uk>
+
+	* include/ffi.h.in: Change sourceware.cygnus.com references to
+	gcc.gnu.org.
+
+2000-12-09  Richard Henderson  <rth@redhat.com>
+
+	* src/alpha/ffi.c (ffi_call): Simplify struct return test.
+	(ffi_closure_osf_inner): Index rather than increment avalue
+	and arg_types.  Give ffi_closure_osf the raw return value type.
+	* src/alpha/osf.S (ffi_closure_osf): Handle return value type
+	promotion.
+
+2000-12-07  Richard Henderson  <rth@redhat.com>
+
+	* src/raw_api.c (ffi_translate_args): Fix typo.
+	(ffi_prep_closure): Likewise.
+
+	* include/ffi.h.in [ALPHA]: Define FFI_CLOSURES and
+	FFI_TRAMPOLINE_SIZE.
+	* src/alpha/ffi.c (ffi_prep_cif_machdep): Adjust minimal
+	cif->bytes for new ffi_call_osf implementation.
+	(ffi_prep_args): Absorb into ...
+	(ffi_call): ... here.  Do all stack allocation here and
+	avoid a callback function.
+	(ffi_prep_closure, ffi_closure_osf_inner): New.
+	* src/alpha/osf.S (ffi_call_osf): Reimplement with no callback.
+	(ffi_closure_osf): New.
+
+2000-09-10  Alexandre Oliva  <aoliva@redhat.com>
+
+	* config.guess, config.sub, install-sh: Removed.
+	* ltconfig, ltmain.sh, missing, mkinstalldirs: Likewise.
+	* Makefile.in: Rebuilt.
+
+	* acinclude.m4: Include libtool macros from the top level.
+	* aclocal.m4, configure: Rebuilt.
+
+2000-08-22  Alexandre Oliva  <aoliva@redhat.com>
+
+	* configure.in [i*86-*-freebsd*] (TARGET, TARGETDIR): Set.
+	* configure: Rebuilt.
+
+2000-05-11  Scott Bambrough  <scottb@netwinder.org>
+
+	* libffi/src/arm/sysv.S (ffi_call_SYSV): Doubles are not saved to
+	memory correctly.  Use conditional instructions, not branches where
+	possible.
+
+2000-05-04  Tom Tromey  <tromey@cygnus.com>
+
+	* configure: Rebuilt.
+	* configure.in: Match `arm*-*-linux-*'.
+	From Chris Dornan <cdornan@arm.com>.
+
+2000-04-28  Jakub Jelinek  <jakub@redhat.com>
+
+	* Makefile.am (SUBDIRS): Define.
+	(AM_MAKEFLAGS): Likewise.
+	(Multilib support.): Add section.
+	* Makefile.in: Rebuilt.
+	* ltconfig (extra_compiler_flags, extra_compiler_flags_value):
+	New variables. Set for gcc using -print-multi-lib. Export them
+	to libtool.
+	(sparc64-*-linux-gnu*): Use libsuff 64 for search paths.
+	* ltmain.sh (B|b|V): Don't throw away gcc's -B, -b and -V options
+	for -shared links.
+	(extra_compiler_flags_value, extra_compiler_flags): Check these
+	for extra compiler options which need to be passed down in
+	compiler_flags.
+
+2000-04-16  Anthony Green  <green@redhat.com>
+
+	* configure: Rebuilt.
+	* configure.in: Change i*86-pc-linux* to i*86-*-linux*.
+
+2000-04-14  Jakub Jelinek  <jakub@redhat.com>
+
+	* include/ffi.h.in (SPARC64): Define for 64bit SPARC builds.
+	Set SPARC FFI_DEFAULT_ABI based on SPARC64 define.
+	* src/sparc/ffi.c (ffi_prep_args_v8): Renamed from ffi_prep_args.
+	Replace all void * sizeofs with sizeof(int).
+	Only compare type with FFI_TYPE_LONGDOUBLE if LONGDOUBLE is
+	different than DOUBLE.
+	Remove FFI_TYPE_SINT32 and FFI_TYPE_UINT32 cases (handled elsewhere).
+	(ffi_prep_args_v9): New function.
+	(ffi_prep_cif_machdep): Handle V9 ABI and long long on V8.
+	(ffi_V9_return_struct): New function.
+	(ffi_call): Handle FFI_V9 ABI from 64bit code and FFI_V8 ABI from
+	32bit code (not yet cross-arch calls).
+	* src/sparc/v8.S: Add struct return delay nop.
+	Handle long long.
+	* src/sparc/v9.S: New file.
+	* src/prep_cif.c (ffi_prep_cif): Return structure pointer
+	is used on sparc64 only for structures larger than 32 bytes.
+	Pass by reference for structures is done for structure arguments
+	larger than 16 bytes.
+	* src/ffitest.c (main): Use 64bit rint on sparc64.
+	Run long long tests on sparc.
+	* src/types.c (FFI_TYPE_POINTER): Pointer is 64bit on alpha and
+	sparc64.
+	(FFI_TYPE_LONGDOUBLE): long double is 128 bit aligned to 128 bits
+	on sparc64.
+	* configure.in (sparc-*-linux*): New supported target.
+	(sparc64-*-linux*): Likewise.
+	* configure: Rebuilt.
+	* Makefile.am: Add v9.S to SPARC files.
+	* Makefile.in: Likewise.
+	(LINK): Surround $(CCLD) into double quotes, so that multilib
+	compiles work correctly.
+
+2000-04-04  Alexandre Petit-Bianco  <apbianco@cygnus.com>
+
+	* configure: Rebuilt.
+	* configure.in: (i*86-*-solaris*): New libffi target. Patch
+	proposed by Bryce McKinlay.
+
+2000-03-20  Tom Tromey  <tromey@cygnus.com>
+
+	* Makefile.in: Hand edit for java_raw_api.lo.
+
+2000-03-08  Bryce McKinlay  <bryce@albatross.co.nz>
+
+	* config.guess, config.sub: Update from the gcc tree.
+	Fix for PR libgcj/168.
+
+2000-03-03  Tom Tromey  <tromey@cygnus.com>
+
+	* Makefile.in: Fixed ia64 by hand.
+
+	* configure: Rebuilt.
+	* configure.in (--enable-multilib): New option.
+	(libffi_basedir): New subst.
+	(AC_OUTPUT): Added multilib code.
+
+2000-03-02  Tom Tromey  <tromey@cygnus.com>
+
+	* Makefile.in: Rebuilt.
+	* Makefile.am (TARGET_SRC_IA64): Use `ia64', not `alpha', as
+	directory name.
+
+2000-02-25  Hans Boehm <boehm@acm.org>
+
+	* src/ia64/ffi.c, src/ia64/ia64_flags.h, src/ia64/unix.S: New
+	files.
+	* src/raw_api.c (ffi_translate_args): Fixed typo in argument
+	list.
+	(ffi_prep_raw_closure): Use ffi_translate_args, not
+	ffi_closure_translate.
+	* src/java_raw_api.c: New file.
+	* src/ffitest.c (closure_test_fn): New function.
+	(main): Define `rint' as long long on IA64.  Added new test when
+	FFI_CLOSURES is defined.
+	* include/ffi.h.in (ALIGN): Use size_t, not unsigned.
+	(ffi_abi): Recognize IA64.
+	(ffi_raw): Added `flt' field.
+	Added "Java raw API" code.
+	* configure.in: Recognize ia64.
+	* Makefile.am (TARGET_SRC_IA64): New macro.
+	(libffi_la_common_SOURCES): Added java_raw_api.c.
+	(libffi_la_SOURCES): Define in IA64 case.
+
+2000-01-04  Tom Tromey  <tromey@cygnus.com>
+
+	* Makefile.in: Rebuilt with newer automake.
+
+1999-12-31  Tom Tromey  <tromey@cygnus.com>
+
+	* Makefile.am (INCLUDES): Added -I$(top_srcdir)/src.
+
+1999-09-01  Tom Tromey  <tromey@cygnus.com>
+
+	* include/ffi.h.in: Removed PACKAGE and VERSION defines and
+	undefs.
+	* fficonfig.h.in: Rebuilt.
+	* configure: Rebuilt.
+	* configure.in: Pass 3rd argument to AM_INIT_AUTOMAKE.
+	Use AM_PROG_LIBTOOL (automake 1.4 compatibility).
+	* acconfig.h: Don't #undef PACKAGE or VERSION.
+
+1999-08-09  Anthony Green  <green@cygnus.com>
+
+	* include/ffi.h.in: Try to work around messy header problem
+	with PACKAGE and VERSION.
+
+	* configure: Rebuilt.
+	* configure.in: Change version to 2.00-beta.
+
+	* fficonfig.h.in: Rebuilt.
+	* acconfig.h (FFI_NO_STRUCTS, FFI_NO_RAW_API): Define.
+
+	* src/x86/ffi.c (ffi_raw_call): Rename.
+
+1999-08-02  Kresten Krab Thorup  <krab@dominiq.is.s.u-tokyo.ac.jp>
+
+	* src/x86/ffi.c (ffi_closure_SYSV): New function.
+	(ffi_prep_incoming_args_SYSV): Ditto.
+	(ffi_prep_closure): Ditto.
+	(ffi_closure_raw_SYSV): Ditto.
+	(ffi_prep_raw_closure): More ditto.
+	(ffi_call_raw): Final ditto.
+
+	* include/ffi.h.in: Add definitions for closure and raw API.
+
+	* src/x86/ffi.c (ffi_prep_cif_machdep): Added case for
+	FFI_TYPE_UINT64.
+
+	* Makefile.am (libffi_la_common_SOURCES): Added raw_api.c
+
+	* src/raw_api.c: New file.
+
+	* include/ffi.h.in (ffi_raw): New type.
+	(UINT_ARG, SINT_ARG): New defines.
+	(ffi_closure, ffi_raw_closure): New types.
+	(ffi_prep_closure, ffi_prep_raw_closure): New declarations.
+
+	* configure.in: Add check for endianness and sizeof void*.
+
+	* src/x86/sysv.S (ffi_call_SYSV): Call fixup routine via argument,
+	instead of directly.
+
+	* configure: Rebuilt.
+
+Thu Jul  8 14:28:42 1999  Anthony Green  <green@cygnus.com>
+
+	* configure.in: Add x86 and powerpc BeOS configurations.
+	From Makoto Kato <m_kato@ga2.so-net.ne.jp>.
+
+1999-05-09  Anthony Green  <green@cygnus.com>
+
+	* configure.in: Add warning about this being beta code.
+	Remove src/Makefile.am from the picture.
+	* configure: Rebuilt.
+
+	* Makefile.am: Move logic from src/Makefile.am.  Add changes
+	to support libffi as a target library.
+	* Makefile.in: Rebuilt.
+
+	* aclocal.m4, config.guess, config.sub, ltconfig, ltmain.sh:
+	Upgraded to new autoconf, automake, libtool.
+
+	* README: Tweaks.
+
+	* LICENSE: Update copyright date.
+
+	* src/Makefile.am, src/Makefile.in: Removed.
+
+1998-11-29  Anthony Green  <green@cygnus.com>
+
+	* include/ChangeLog: Removed.
+	* src/ChangeLog: Removed.
+	* src/mips/ChangeLog: Removed.
+	* src/sparc/ChangeLog: Remboved.
+	* src/x86/ChangeLog: Removed.
+
+	* ChangeLog.v1: Created.
diff --git a/Modules/_ctypes/libffi/ChangeLog.v1 b/Modules/_ctypes/libffi/ChangeLog.v1
index 369820c..af3a377 100644
--- a/Modules/_ctypes/libffi/ChangeLog.v1
+++ b/Modules/_ctypes/libffi/ChangeLog.v1
@@ -2,7 +2,7 @@
 
 Version 1 of libffi had per-directory ChangeLogs.  Current and future
 versions have a single ChangeLog file in the root directory.  The
-version 1 ChangeLogs have all been concatonated into this file for
+version 1 ChangeLogs have all been concatenated into this file for
 future reference only.
 
 --- libffi ----------------------------------------------------------------
diff --git a/Modules/_ctypes/libffi/LICENSE b/Modules/_ctypes/libffi/LICENSE
index aa60342..a66fab4 100644
--- a/Modules/_ctypes/libffi/LICENSE
+++ b/Modules/_ctypes/libffi/LICENSE
@@ -1,4 +1,4 @@
-libffi - Copyright (c) 1996-2012  Anthony Green, Red Hat, Inc and others.
+libffi - Copyright (c) 1996-2014  Anthony Green, Red Hat, Inc and others.
 See source files for details.
 
 Permission is hereby granted, free of charge, to any person obtaining
diff --git a/Modules/_ctypes/libffi/Makefile.am b/Modules/_ctypes/libffi/Makefile.am
index bf0156f..1dcdc81 100644
--- a/Modules/_ctypes/libffi/Makefile.am
+++ b/Modules/_ctypes/libffi/Makefile.am
@@ -6,10 +6,11 @@
 
 SUBDIRS = include testsuite man
 
-EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj configure.host	\
+EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj			\
 	 src/aarch64/ffi.c src/aarch64/ffitarget.h src/aarch64/sysv.S	\
-	 build-ios.sh src/alpha/ffi.c src/alpha/osf.S			\
-	 src/alpha/ffitarget.h src/arm/ffi.c src/arm/sysv.S		\
+	 src/alpha/ffi.c src/alpha/osf.S			\
+	 src/alpha/ffitarget.h src/arc/ffi.c src/arc/arcompact.S	\
+	 src/arc/ffitarget.h src/arm/ffi.c src/arm/sysv.S		\
 	 src/arm/ffitarget.h src/avr32/ffi.c src/avr32/sysv.S		\
 	 src/avr32/ffitarget.h src/cris/ffi.c src/cris/sysv.S		\
 	 src/cris/ffitarget.h src/ia64/ffi.c src/ia64/ffitarget.h	\
@@ -19,8 +20,12 @@
 	 src/moxie/ffitarget.h src/moxie/eabi.S src/mips/ffitarget.h	\
 	 src/m32r/ffi.c src/m32r/sysv.S src/m32r/ffitarget.h		\
 	 src/m68k/ffi.c src/m68k/sysv.S src/m68k/ffitarget.h		\
+	 src/m88k/ffi.c src/m88k/obsd.S src/m88k/ffitarget.h		\
 	 src/microblaze/ffi.c src/microblaze/sysv.S			\
-	 src/microblaze/ffitarget.h src/powerpc/ffi.c			\
+	 src/microblaze/ffitarget.h					\
+	 src/nios2/ffi.c src/nios2/ffitarget.h src/nios2/sysv.S		\
+	 src/powerpc/ffi.c src/powerpc/ffi_powerpc.h			\
+	 src/powerpc/ffi_sysv.c src/powerpc/ffi_linux64.c		\
 	 src/powerpc/sysv.S src/powerpc/linux64.S			\
 	 src/powerpc/linux64_closure.S src/powerpc/ppc_closure.S	\
 	 src/powerpc/asm.h src/powerpc/aix.S src/powerpc/darwin.S	\
@@ -38,14 +43,14 @@
 	 src/bfin/ffitarget.h src/bfin/sysv.S src/frv/eabi.S		\
 	 src/frv/ffitarget.h src/dlmalloc.c src/tile/ffi.c		\
 	 src/tile/ffitarget.h src/tile/tile.S libtool-version		\
+	 src/vax/ffi.c src/vax/ffitarget.h src/vax/elfbsd.S		\
 	 src/xtensa/ffitarget.h src/xtensa/ffi.c src/xtensa/sysv.S	\
 	 ChangeLog.libffi m4/libtool.m4 m4/lt~obsolete.m4		\
 	 m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4			\
 	 m4/ltversion.m4 src/arm/gentramp.sh src/debug.c msvcc.sh	\
-	 generate-ios-source-and-headers.py				\
-	 generate-osx-source-and-headers.py				\
+	 generate-darwin-source-and-headers.py				\
 	 libffi.xcodeproj/project.pbxproj src/arm/trampoline.S		\
-	 libtool-ldflags
+	 libtool-ldflags ChangeLog.libffi-3.1
 
 info_TEXINFOS = doc/libffi.texi
 
@@ -59,39 +64,39 @@
 # values defined in terms of make variables, as is the case for CC and
 # friends when we are called from the top level Makefile.
 AM_MAKEFLAGS = \
-	"AR_FLAGS=$(AR_FLAGS)" \
-	"CC_FOR_BUILD=$(CC_FOR_BUILD)" \
-	"CFLAGS=$(CFLAGS)" \
-	"CXXFLAGS=$(CXXFLAGS)" \
-	"CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
-	"CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
-	"INSTALL=$(INSTALL)" \
-	"INSTALL_DATA=$(INSTALL_DATA)" \
-	"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
-	"INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
-	"JC1FLAGS=$(JC1FLAGS)" \
-	"LDFLAGS=$(LDFLAGS)" \
-	"LIBCFLAGS=$(LIBCFLAGS)" \
-	"LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
-	"MAKE=$(MAKE)" \
-	"MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
-	"PICFLAG=$(PICFLAG)" \
-	"PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
-	"RUNTESTFLAGS=$(RUNTESTFLAGS)" \
-	"SHELL=$(SHELL)" \
-	"exec_prefix=$(exec_prefix)" \
-	"infodir=$(infodir)" \
-	"libdir=$(libdir)" \
-	"mandir=$(mandir)" \
-	"prefix=$(prefix)" \
-	"AR=$(AR)" \
-	"AS=$(AS)" \
-	"CC=$(CC)" \
-	"CXX=$(CXX)" \
-	"LD=$(LD)" \
-	"NM=$(NM)" \
-	"RANLIB=$(RANLIB)" \
-	"DESTDIR=$(DESTDIR)"
+	'AR_FLAGS=$(AR_FLAGS)' \
+	'CC_FOR_BUILD=$(CC_FOR_BUILD)' \
+	'CFLAGS=$(CFLAGS)' \
+	'CXXFLAGS=$(CXXFLAGS)' \
+	'CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)' \
+	'CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)' \
+	'INSTALL=$(INSTALL)' \
+	'INSTALL_DATA=$(INSTALL_DATA)' \
+	'INSTALL_PROGRAM=$(INSTALL_PROGRAM)' \
+	'INSTALL_SCRIPT=$(INSTALL_SCRIPT)' \
+	'JC1FLAGS=$(JC1FLAGS)' \
+	'LDFLAGS=$(LDFLAGS)' \
+	'LIBCFLAGS=$(LIBCFLAGS)' \
+	'LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)' \
+	'MAKE=$(MAKE)' \
+	'MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)' \
+	'PICFLAG=$(PICFLAG)' \
+	'PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)' \
+	'RUNTESTFLAGS=$(RUNTESTFLAGS)' \
+	'SHELL=$(SHELL)' \
+	'exec_prefix=$(exec_prefix)' \
+	'infodir=$(infodir)' \
+	'libdir=$(libdir)' \
+	'mandir=$(mandir)' \
+	'prefix=$(prefix)' \
+	'AR=$(AR)' \
+	'AS=$(AS)' \
+	'CC=$(CC)' \
+	'CXX=$(CXX)' \
+	'LD=$(LD)' \
+	'NM=$(NM)' \
+	'RANLIB=$(RANLIB)' \
+	'DESTDIR=$(DESTDIR)'
 
 # Subdir rules rely on $(FLAGS_TO_PASS)
 FLAGS_TO_PASS = $(AM_MAKEFLAGS)
@@ -120,10 +125,10 @@
 nodist_libffi_la_SOURCES += src/bfin/ffi.c src/bfin/sysv.S
 endif
 if X86
-nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/sysv.S
+nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/sysv.S src/x86/win32.S
 endif
 if X86_FREEBSD
-nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/freebsd.S
+nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/freebsd.S src/x86/win32.S
 endif
 if X86_WIN32
 nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/win32.S
@@ -133,6 +138,9 @@
 endif
 if X86_DARWIN
 nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/darwin.S src/x86/ffi64.c src/x86/darwin64.S
+if X86_DARWIN32
+nodist_libffi_la_SOURCES += src/x86/win32.S
+endif
 endif
 if SPARC
 nodist_libffi_la_SOURCES += src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S
@@ -149,14 +157,20 @@
 if M68K
 nodist_libffi_la_SOURCES += src/m68k/ffi.c src/m68k/sysv.S
 endif
+if M88K
+nodist_libffi_la_SOURCES += src/m88k/ffi.c src/m88k/obsd.S
+endif
 if MOXIE
 nodist_libffi_la_SOURCES += src/moxie/ffi.c src/moxie/eabi.S
 endif
 if MICROBLAZE
 nodist_libffi_la_SOURCES += src/microblaze/ffi.c src/microblaze/sysv.S
 endif
+if NIOS2
+nodist_libffi_la_SOURCES += src/nios2/sysv.S src/nios2/ffi.c
+endif
 if POWERPC
-nodist_libffi_la_SOURCES += src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S src/powerpc/linux64.S src/powerpc/linux64_closure.S
+nodist_libffi_la_SOURCES += src/powerpc/ffi.c src/powerpc/ffi_sysv.c src/powerpc/ffi_linux64.c src/powerpc/sysv.S src/powerpc/ppc_closure.S src/powerpc/linux64.S src/powerpc/linux64_closure.S
 endif
 if POWERPC_AIX
 nodist_libffi_la_SOURCES += src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closure.S
@@ -165,11 +179,14 @@
 nodist_libffi_la_SOURCES += src/powerpc/ffi_darwin.c src/powerpc/darwin.S src/powerpc/darwin_closure.S
 endif
 if POWERPC_FREEBSD
-nodist_libffi_la_SOURCES += src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S
+nodist_libffi_la_SOURCES += src/powerpc/ffi.c src/powerpc/ffi_sysv.c src/powerpc/sysv.S src/powerpc/ppc_closure.S
 endif
 if AARCH64
 nodist_libffi_la_SOURCES += src/aarch64/sysv.S src/aarch64/ffi.c
 endif
+if ARC
+nodist_libffi_la_SOURCES += src/arc/arcompact.S src/arc/ffi.c
+endif
 if ARM
 nodist_libffi_la_SOURCES += src/arm/sysv.S src/arm/ffi.c
 if FFI_EXEC_TRAMPOLINE_TABLE
@@ -212,14 +229,26 @@
 if METAG
 nodist_libffi_la_SOURCES += src/metag/sysv.S src/metag/ffi.c
 endif
+if VAX
+nodist_libffi_la_SOURCES += src/vax/elfbsd.S src/vax/ffi.c
+endif
 
 libffi_convenience_la_SOURCES = $(libffi_la_SOURCES)
 nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES)
 
 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/libtool-ldflags $(LDFLAGS))
 
+AM_CFLAGS =
+if FFI_DEBUG
+# Build debug. Define FFI_DEBUG on the commandline so that, when building with
+# MSVC, it can link against the debug CRT.
+AM_CFLAGS += -DFFI_DEBUG
+endif
+
 libffi_la_LDFLAGS = -no-undefined -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LTLDFLAGS) $(AM_LTLDFLAGS)
 
 AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
 AM_CCASFLAGS = $(AM_CPPFLAGS)
 
+dist-hook:
+	if [ -d $(top_srcdir)/.git ] ; then (cd $(top_srcdir); git log --no-decorate) ; else echo 'See git log for history.' ; fi > $(distdir)/ChangeLog
diff --git a/Modules/_ctypes/libffi/Makefile.in b/Modules/_ctypes/libffi/Makefile.in
index 4b6abe5..4a57abd 100644
--- a/Modules/_ctypes/libffi/Makefile.in
+++ b/Modules/_ctypes/libffi/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.12.2 from Makefile.am.
+# Makefile.in generated by automake 1.13.4 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -16,23 +16,51 @@
 
 
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \	]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -55,44 +83,52 @@
 @FFI_DEBUG_TRUE@am__append_1 = src/debug.c
 @MIPS_TRUE@am__append_2 = src/mips/ffi.c src/mips/o32.S src/mips/n32.S
 @BFIN_TRUE@am__append_3 = src/bfin/ffi.c src/bfin/sysv.S
-@X86_TRUE@am__append_4 = src/x86/ffi.c src/x86/sysv.S
-@X86_FREEBSD_TRUE@am__append_5 = src/x86/ffi.c src/x86/freebsd.S
+@X86_TRUE@am__append_4 = src/x86/ffi.c src/x86/sysv.S src/x86/win32.S
+@X86_FREEBSD_TRUE@am__append_5 = src/x86/ffi.c src/x86/freebsd.S src/x86/win32.S
 @X86_WIN32_TRUE@am__append_6 = src/x86/ffi.c src/x86/win32.S
 @X86_WIN64_TRUE@am__append_7 = src/x86/ffi.c src/x86/win64.S
 @X86_DARWIN_TRUE@am__append_8 = src/x86/ffi.c src/x86/darwin.S src/x86/ffi64.c src/x86/darwin64.S
-@SPARC_TRUE@am__append_9 = src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S
-@ALPHA_TRUE@am__append_10 = src/alpha/ffi.c src/alpha/osf.S
-@IA64_TRUE@am__append_11 = src/ia64/ffi.c src/ia64/unix.S
-@M32R_TRUE@am__append_12 = src/m32r/sysv.S src/m32r/ffi.c
-@M68K_TRUE@am__append_13 = src/m68k/ffi.c src/m68k/sysv.S
-@MOXIE_TRUE@am__append_14 = src/moxie/ffi.c src/moxie/eabi.S
-@MICROBLAZE_TRUE@am__append_15 = src/microblaze/ffi.c src/microblaze/sysv.S
-@POWERPC_TRUE@am__append_16 = src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S src/powerpc/linux64.S src/powerpc/linux64_closure.S
-@POWERPC_AIX_TRUE@am__append_17 = src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closure.S
-@POWERPC_DARWIN_TRUE@am__append_18 = src/powerpc/ffi_darwin.c src/powerpc/darwin.S src/powerpc/darwin_closure.S
-@POWERPC_FREEBSD_TRUE@am__append_19 = src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S
-@AARCH64_TRUE@am__append_20 = src/aarch64/sysv.S src/aarch64/ffi.c
-@ARM_TRUE@am__append_21 = src/arm/sysv.S src/arm/ffi.c
-@ARM_TRUE@@FFI_EXEC_TRAMPOLINE_TABLE_TRUE@am__append_22 = src/arm/trampoline.S
-@AVR32_TRUE@am__append_23 = src/avr32/sysv.S src/avr32/ffi.c
-@LIBFFI_CRIS_TRUE@am__append_24 = src/cris/sysv.S src/cris/ffi.c
-@FRV_TRUE@am__append_25 = src/frv/eabi.S src/frv/ffi.c
-@S390_TRUE@am__append_26 = src/s390/sysv.S src/s390/ffi.c
-@X86_64_TRUE@am__append_27 = src/x86/ffi64.c src/x86/unix64.S src/x86/ffi.c src/x86/sysv.S
-@SH_TRUE@am__append_28 = src/sh/sysv.S src/sh/ffi.c
-@SH64_TRUE@am__append_29 = src/sh64/sysv.S src/sh64/ffi.c
-@PA_LINUX_TRUE@am__append_30 = src/pa/linux.S src/pa/ffi.c
-@PA_HPUX_TRUE@am__append_31 = src/pa/hpux32.S src/pa/ffi.c
-@TILE_TRUE@am__append_32 = src/tile/tile.S src/tile/ffi.c
-@XTENSA_TRUE@am__append_33 = src/xtensa/sysv.S src/xtensa/ffi.c
-@METAG_TRUE@am__append_34 = src/metag/sysv.S src/metag/ffi.c
+@X86_DARWIN32_TRUE@@X86_DARWIN_TRUE@am__append_9 = src/x86/win32.S
+@SPARC_TRUE@am__append_10 = src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S
+@ALPHA_TRUE@am__append_11 = src/alpha/ffi.c src/alpha/osf.S
+@IA64_TRUE@am__append_12 = src/ia64/ffi.c src/ia64/unix.S
+@M32R_TRUE@am__append_13 = src/m32r/sysv.S src/m32r/ffi.c
+@M68K_TRUE@am__append_14 = src/m68k/ffi.c src/m68k/sysv.S
+@M88K_TRUE@am__append_15 = src/m88k/ffi.c src/m88k/obsd.S
+@MOXIE_TRUE@am__append_16 = src/moxie/ffi.c src/moxie/eabi.S
+@MICROBLAZE_TRUE@am__append_17 = src/microblaze/ffi.c src/microblaze/sysv.S
+@NIOS2_TRUE@am__append_18 = src/nios2/sysv.S src/nios2/ffi.c
+@POWERPC_TRUE@am__append_19 = src/powerpc/ffi.c src/powerpc/ffi_sysv.c src/powerpc/ffi_linux64.c src/powerpc/sysv.S src/powerpc/ppc_closure.S src/powerpc/linux64.S src/powerpc/linux64_closure.S
+@POWERPC_AIX_TRUE@am__append_20 = src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closure.S
+@POWERPC_DARWIN_TRUE@am__append_21 = src/powerpc/ffi_darwin.c src/powerpc/darwin.S src/powerpc/darwin_closure.S
+@POWERPC_FREEBSD_TRUE@am__append_22 = src/powerpc/ffi.c src/powerpc/ffi_sysv.c src/powerpc/sysv.S src/powerpc/ppc_closure.S
+@AARCH64_TRUE@am__append_23 = src/aarch64/sysv.S src/aarch64/ffi.c
+@ARC_TRUE@am__append_24 = src/arc/arcompact.S src/arc/ffi.c
+@ARM_TRUE@am__append_25 = src/arm/sysv.S src/arm/ffi.c
+@ARM_TRUE@@FFI_EXEC_TRAMPOLINE_TABLE_TRUE@am__append_26 = src/arm/trampoline.S
+@AVR32_TRUE@am__append_27 = src/avr32/sysv.S src/avr32/ffi.c
+@LIBFFI_CRIS_TRUE@am__append_28 = src/cris/sysv.S src/cris/ffi.c
+@FRV_TRUE@am__append_29 = src/frv/eabi.S src/frv/ffi.c
+@S390_TRUE@am__append_30 = src/s390/sysv.S src/s390/ffi.c
+@X86_64_TRUE@am__append_31 = src/x86/ffi64.c src/x86/unix64.S src/x86/ffi.c src/x86/sysv.S
+@SH_TRUE@am__append_32 = src/sh/sysv.S src/sh/ffi.c
+@SH64_TRUE@am__append_33 = src/sh64/sysv.S src/sh64/ffi.c
+@PA_LINUX_TRUE@am__append_34 = src/pa/linux.S src/pa/ffi.c
+@PA_HPUX_TRUE@am__append_35 = src/pa/hpux32.S src/pa/ffi.c
+@TILE_TRUE@am__append_36 = src/tile/tile.S src/tile/ffi.c
+@XTENSA_TRUE@am__append_37 = src/xtensa/sysv.S src/xtensa/ffi.c
+@METAG_TRUE@am__append_38 = src/metag/sysv.S src/metag/ffi.c
+@VAX_TRUE@am__append_39 = src/vax/elfbsd.S src/vax/ffi.c
+# Build debug. Define FFI_DEBUG on the commandline so that, when building with
+# MSVC, it can link against the debug CRT.
+@FFI_DEBUG_TRUE@am__append_40 = -DFFI_DEBUG
 subdir = .
-DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
-	$(srcdir)/Makefile.in $(srcdir)/doc/stamp-vti \
-	$(srcdir)/doc/version.texi $(srcdir)/fficonfig.h.in \
-	$(srcdir)/libffi.pc.in $(top_srcdir)/configure ChangeLog \
-	compile config.guess config.sub depcomp install-sh ltmain.sh \
-	mdate-sh missing texinfo.tex
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(top_srcdir)/configure $(am__configure_deps) \
+	$(srcdir)/fficonfig.h.in $(srcdir)/libffi.pc.in depcomp \
+	mdate-sh $(srcdir)/doc/version.texi $(srcdir)/doc/stamp-vti \
+	texinfo.tex README compile config.guess config.sub install-sh \
+	missing ltmain.sh
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/asmcfi.m4 \
 	$(top_srcdir)/m4/ax_append_flag.m4 \
@@ -154,50 +190,60 @@
 @MIPS_TRUE@am__objects_2 = src/mips/ffi.lo src/mips/o32.lo \
 @MIPS_TRUE@	src/mips/n32.lo
 @BFIN_TRUE@am__objects_3 = src/bfin/ffi.lo src/bfin/sysv.lo
-@X86_TRUE@am__objects_4 = src/x86/ffi.lo src/x86/sysv.lo
-@X86_FREEBSD_TRUE@am__objects_5 = src/x86/ffi.lo src/x86/freebsd.lo
+@X86_TRUE@am__objects_4 = src/x86/ffi.lo src/x86/sysv.lo \
+@X86_TRUE@	src/x86/win32.lo
+@X86_FREEBSD_TRUE@am__objects_5 = src/x86/ffi.lo src/x86/freebsd.lo \
+@X86_FREEBSD_TRUE@	src/x86/win32.lo
 @X86_WIN32_TRUE@am__objects_6 = src/x86/ffi.lo src/x86/win32.lo
 @X86_WIN64_TRUE@am__objects_7 = src/x86/ffi.lo src/x86/win64.lo
 @X86_DARWIN_TRUE@am__objects_8 = src/x86/ffi.lo src/x86/darwin.lo \
 @X86_DARWIN_TRUE@	src/x86/ffi64.lo src/x86/darwin64.lo
-@SPARC_TRUE@am__objects_9 = src/sparc/ffi.lo src/sparc/v8.lo \
+@X86_DARWIN32_TRUE@@X86_DARWIN_TRUE@am__objects_9 = src/x86/win32.lo
+@SPARC_TRUE@am__objects_10 = src/sparc/ffi.lo src/sparc/v8.lo \
 @SPARC_TRUE@	src/sparc/v9.lo
-@ALPHA_TRUE@am__objects_10 = src/alpha/ffi.lo src/alpha/osf.lo
-@IA64_TRUE@am__objects_11 = src/ia64/ffi.lo src/ia64/unix.lo
-@M32R_TRUE@am__objects_12 = src/m32r/sysv.lo src/m32r/ffi.lo
-@M68K_TRUE@am__objects_13 = src/m68k/ffi.lo src/m68k/sysv.lo
-@MOXIE_TRUE@am__objects_14 = src/moxie/ffi.lo src/moxie/eabi.lo
-@MICROBLAZE_TRUE@am__objects_15 = src/microblaze/ffi.lo \
+@ALPHA_TRUE@am__objects_11 = src/alpha/ffi.lo src/alpha/osf.lo
+@IA64_TRUE@am__objects_12 = src/ia64/ffi.lo src/ia64/unix.lo
+@M32R_TRUE@am__objects_13 = src/m32r/sysv.lo src/m32r/ffi.lo
+@M68K_TRUE@am__objects_14 = src/m68k/ffi.lo src/m68k/sysv.lo
+@M88K_TRUE@am__objects_15 = src/m88k/ffi.lo src/m88k/obsd.lo
+@MOXIE_TRUE@am__objects_16 = src/moxie/ffi.lo src/moxie/eabi.lo
+@MICROBLAZE_TRUE@am__objects_17 = src/microblaze/ffi.lo \
 @MICROBLAZE_TRUE@	src/microblaze/sysv.lo
-@POWERPC_TRUE@am__objects_16 = src/powerpc/ffi.lo src/powerpc/sysv.lo \
+@NIOS2_TRUE@am__objects_18 = src/nios2/sysv.lo src/nios2/ffi.lo
+@POWERPC_TRUE@am__objects_19 = src/powerpc/ffi.lo \
+@POWERPC_TRUE@	src/powerpc/ffi_sysv.lo \
+@POWERPC_TRUE@	src/powerpc/ffi_linux64.lo src/powerpc/sysv.lo \
 @POWERPC_TRUE@	src/powerpc/ppc_closure.lo \
 @POWERPC_TRUE@	src/powerpc/linux64.lo \
 @POWERPC_TRUE@	src/powerpc/linux64_closure.lo
-@POWERPC_AIX_TRUE@am__objects_17 = src/powerpc/ffi_darwin.lo \
+@POWERPC_AIX_TRUE@am__objects_20 = src/powerpc/ffi_darwin.lo \
 @POWERPC_AIX_TRUE@	src/powerpc/aix.lo \
 @POWERPC_AIX_TRUE@	src/powerpc/aix_closure.lo
-@POWERPC_DARWIN_TRUE@am__objects_18 = src/powerpc/ffi_darwin.lo \
+@POWERPC_DARWIN_TRUE@am__objects_21 = src/powerpc/ffi_darwin.lo \
 @POWERPC_DARWIN_TRUE@	src/powerpc/darwin.lo \
 @POWERPC_DARWIN_TRUE@	src/powerpc/darwin_closure.lo
-@POWERPC_FREEBSD_TRUE@am__objects_19 = src/powerpc/ffi.lo \
+@POWERPC_FREEBSD_TRUE@am__objects_22 = src/powerpc/ffi.lo \
+@POWERPC_FREEBSD_TRUE@	src/powerpc/ffi_sysv.lo \
 @POWERPC_FREEBSD_TRUE@	src/powerpc/sysv.lo \
 @POWERPC_FREEBSD_TRUE@	src/powerpc/ppc_closure.lo
-@AARCH64_TRUE@am__objects_20 = src/aarch64/sysv.lo src/aarch64/ffi.lo
-@ARM_TRUE@am__objects_21 = src/arm/sysv.lo src/arm/ffi.lo
-@ARM_TRUE@@FFI_EXEC_TRAMPOLINE_TABLE_TRUE@am__objects_22 = src/arm/trampoline.lo
-@AVR32_TRUE@am__objects_23 = src/avr32/sysv.lo src/avr32/ffi.lo
-@LIBFFI_CRIS_TRUE@am__objects_24 = src/cris/sysv.lo src/cris/ffi.lo
-@FRV_TRUE@am__objects_25 = src/frv/eabi.lo src/frv/ffi.lo
-@S390_TRUE@am__objects_26 = src/s390/sysv.lo src/s390/ffi.lo
-@X86_64_TRUE@am__objects_27 = src/x86/ffi64.lo src/x86/unix64.lo \
+@AARCH64_TRUE@am__objects_23 = src/aarch64/sysv.lo src/aarch64/ffi.lo
+@ARC_TRUE@am__objects_24 = src/arc/arcompact.lo src/arc/ffi.lo
+@ARM_TRUE@am__objects_25 = src/arm/sysv.lo src/arm/ffi.lo
+@ARM_TRUE@@FFI_EXEC_TRAMPOLINE_TABLE_TRUE@am__objects_26 = src/arm/trampoline.lo
+@AVR32_TRUE@am__objects_27 = src/avr32/sysv.lo src/avr32/ffi.lo
+@LIBFFI_CRIS_TRUE@am__objects_28 = src/cris/sysv.lo src/cris/ffi.lo
+@FRV_TRUE@am__objects_29 = src/frv/eabi.lo src/frv/ffi.lo
+@S390_TRUE@am__objects_30 = src/s390/sysv.lo src/s390/ffi.lo
+@X86_64_TRUE@am__objects_31 = src/x86/ffi64.lo src/x86/unix64.lo \
 @X86_64_TRUE@	src/x86/ffi.lo src/x86/sysv.lo
-@SH_TRUE@am__objects_28 = src/sh/sysv.lo src/sh/ffi.lo
-@SH64_TRUE@am__objects_29 = src/sh64/sysv.lo src/sh64/ffi.lo
-@PA_LINUX_TRUE@am__objects_30 = src/pa/linux.lo src/pa/ffi.lo
-@PA_HPUX_TRUE@am__objects_31 = src/pa/hpux32.lo src/pa/ffi.lo
-@TILE_TRUE@am__objects_32 = src/tile/tile.lo src/tile/ffi.lo
-@XTENSA_TRUE@am__objects_33 = src/xtensa/sysv.lo src/xtensa/ffi.lo
-@METAG_TRUE@am__objects_34 = src/metag/sysv.lo src/metag/ffi.lo
+@SH_TRUE@am__objects_32 = src/sh/sysv.lo src/sh/ffi.lo
+@SH64_TRUE@am__objects_33 = src/sh64/sysv.lo src/sh64/ffi.lo
+@PA_LINUX_TRUE@am__objects_34 = src/pa/linux.lo src/pa/ffi.lo
+@PA_HPUX_TRUE@am__objects_35 = src/pa/hpux32.lo src/pa/ffi.lo
+@TILE_TRUE@am__objects_36 = src/tile/tile.lo src/tile/ffi.lo
+@XTENSA_TRUE@am__objects_37 = src/xtensa/sysv.lo src/xtensa/ffi.lo
+@METAG_TRUE@am__objects_38 = src/metag/sysv.lo src/metag/ffi.lo
+@VAX_TRUE@am__objects_39 = src/vax/elfbsd.lo src/vax/ffi.lo
 nodist_libffi_la_OBJECTS = $(am__objects_1) $(am__objects_2) \
 	$(am__objects_3) $(am__objects_4) $(am__objects_5) \
 	$(am__objects_6) $(am__objects_7) $(am__objects_8) \
@@ -209,17 +255,23 @@
 	$(am__objects_24) $(am__objects_25) $(am__objects_26) \
 	$(am__objects_27) $(am__objects_28) $(am__objects_29) \
 	$(am__objects_30) $(am__objects_31) $(am__objects_32) \
-	$(am__objects_33) $(am__objects_34)
+	$(am__objects_33) $(am__objects_34) $(am__objects_35) \
+	$(am__objects_36) $(am__objects_37) $(am__objects_38) \
+	$(am__objects_39)
 libffi_la_OBJECTS = $(am_libffi_la_OBJECTS) \
 	$(nodist_libffi_la_OBJECTS)
-libffi_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+libffi_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
 	$(libffi_la_LDFLAGS) $(LDFLAGS) -o $@
 libffi_convenience_la_LIBADD =
-am__objects_35 = src/prep_cif.lo src/types.lo src/raw_api.lo \
+am__objects_40 = src/prep_cif.lo src/types.lo src/raw_api.lo \
 	src/java_raw_api.lo src/closures.lo
-am_libffi_convenience_la_OBJECTS = $(am__objects_35)
-am__objects_36 = $(am__objects_1) $(am__objects_2) $(am__objects_3) \
+am_libffi_convenience_la_OBJECTS = $(am__objects_40)
+am__objects_41 = $(am__objects_1) $(am__objects_2) $(am__objects_3) \
 	$(am__objects_4) $(am__objects_5) $(am__objects_6) \
 	$(am__objects_7) $(am__objects_8) $(am__objects_9) \
 	$(am__objects_10) $(am__objects_11) $(am__objects_12) \
@@ -230,32 +282,87 @@
 	$(am__objects_25) $(am__objects_26) $(am__objects_27) \
 	$(am__objects_28) $(am__objects_29) $(am__objects_30) \
 	$(am__objects_31) $(am__objects_32) $(am__objects_33) \
-	$(am__objects_34)
-nodist_libffi_convenience_la_OBJECTS = $(am__objects_36)
+	$(am__objects_34) $(am__objects_35) $(am__objects_36) \
+	$(am__objects_37) $(am__objects_38) $(am__objects_39)
+nodist_libffi_convenience_la_OBJECTS = $(am__objects_41)
 libffi_convenience_la_OBJECTS = $(am_libffi_convenience_la_OBJECTS) \
 	$(nodist_libffi_convenience_la_OBJECTS)
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 DEFAULT_INCLUDES = -I.@am__isrc@
 depcomp = $(SHELL) $(top_srcdir)/depcomp
 am__depfiles_maybe = depfiles
 am__mv = mv -f
 CPPASCOMPILE = $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)
-LTCPPASCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)
+LTCPPASCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CCASFLAGS) $(CCASFLAGS)
+AM_V_CPPAS = $(am__v_CPPAS_@AM_V@)
+am__v_CPPAS_ = $(am__v_CPPAS_@AM_DEFAULT_V@)
+am__v_CPPAS_0 = @echo "  CPPAS   " $@;
+am__v_CPPAS_1 = 
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
 	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
 CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
 SOURCES = $(libffi_la_SOURCES) $(nodist_libffi_la_SOURCES) \
 	$(libffi_convenience_la_SOURCES) \
 	$(nodist_libffi_convenience_la_SOURCES)
 DIST_SOURCES = $(libffi_la_SOURCES) $(libffi_convenience_la_SOURCES)
+AM_V_DVIPS = $(am__v_DVIPS_@AM_V@)
+am__v_DVIPS_ = $(am__v_DVIPS_@AM_DEFAULT_V@)
+am__v_DVIPS_0 = @echo "  DVIPS   " $@;
+am__v_DVIPS_1 = 
+AM_V_MAKEINFO = $(am__v_MAKEINFO_@AM_V@)
+am__v_MAKEINFO_ = $(am__v_MAKEINFO_@AM_DEFAULT_V@)
+am__v_MAKEINFO_0 = @echo "  MAKEINFO" $@;
+am__v_MAKEINFO_1 = 
+AM_V_INFOHTML = $(am__v_INFOHTML_@AM_V@)
+am__v_INFOHTML_ = $(am__v_INFOHTML_@AM_DEFAULT_V@)
+am__v_INFOHTML_0 = @echo "  INFOHTML" $@;
+am__v_INFOHTML_1 = 
+AM_V_TEXI2DVI = $(am__v_TEXI2DVI_@AM_V@)
+am__v_TEXI2DVI_ = $(am__v_TEXI2DVI_@AM_DEFAULT_V@)
+am__v_TEXI2DVI_0 = @echo "  TEXI2DVI" $@;
+am__v_TEXI2DVI_1 = 
+AM_V_TEXI2PDF = $(am__v_TEXI2PDF_@AM_V@)
+am__v_TEXI2PDF_ = $(am__v_TEXI2PDF_@AM_DEFAULT_V@)
+am__v_TEXI2PDF_0 = @echo "  TEXI2PDF" $@;
+am__v_TEXI2PDF_1 = 
+AM_V_texinfo = $(am__v_texinfo_@AM_V@)
+am__v_texinfo_ = $(am__v_texinfo_@AM_DEFAULT_V@)
+am__v_texinfo_0 = -q
+am__v_texinfo_1 = 
+AM_V_texidevnull = $(am__v_texidevnull_@AM_V@)
+am__v_texidevnull_ = $(am__v_texidevnull_@AM_DEFAULT_V@)
+am__v_texidevnull_0 = > /dev/null
+am__v_texidevnull_1 = 
 INFO_DEPS = $(srcdir)/doc/libffi.info
 am__TEXINFO_TEX_DIR = $(srcdir)
 DVIS = doc/libffi.dvi
@@ -268,13 +375,14 @@
 MAKEINFOHTML = $(MAKEINFO) --html
 AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS)
 DVIPS = dvips
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-	html-recursive info-recursive install-data-recursive \
-	install-dvi-recursive install-exec-recursive \
-	install-html-recursive install-info-recursive \
-	install-pdf-recursive install-ps-recursive install-recursive \
-	installcheck-recursive installdirs-recursive pdf-recursive \
-	ps-recursive uninstall-recursive
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+	ctags-recursive dvi-recursive html-recursive info-recursive \
+	install-data-recursive install-dvi-recursive \
+	install-exec-recursive install-html-recursive \
+	install-info-recursive install-pdf-recursive \
+	install-ps-recursive install-recursive installcheck-recursive \
+	installdirs-recursive pdf-recursive ps-recursive \
+	tags-recursive uninstall-recursive
 am__can_run_installinfo = \
   case $$AM_UPDATE_INFO_DIR in \
     n|no|NO) false;; \
@@ -283,9 +391,30 @@
 DATA = $(pkgconfig_DATA)
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
   distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+am__recursive_targets = \
+  $(RECURSIVE_TARGETS) \
+  $(RECURSIVE_CLEAN_TARGETS) \
+  $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
 	cscope distdir dist dist-all distcheck
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
+	$(LISP)fficonfig.h.in
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
 CSCOPE = cscope
@@ -335,6 +464,7 @@
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AM_LTLDFLAGS = @AM_LTLDFLAGS@
 AM_RUNTESTFLAGS = @AM_RUNTESTFLAGS@
 AR = @AR@
@@ -350,6 +480,10 @@
 CFLAGS = @CFLAGS@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -365,6 +499,7 @@
 FGREP = @FGREP@
 GREP = @GREP@
 HAVE_LONG_DOUBLE = @HAVE_LONG_DOUBLE@
+HAVE_LONG_DOUBLE_VARIANT = @HAVE_LONG_DOUBLE_VARIANT@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -411,6 +546,7 @@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
@@ -468,10 +604,11 @@
 AUTOMAKE_OPTIONS = foreign subdir-objects
 ACLOCAL_AMFLAGS = -I m4
 SUBDIRS = include testsuite man
-EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj configure.host	\
+EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj			\
 	 src/aarch64/ffi.c src/aarch64/ffitarget.h src/aarch64/sysv.S	\
-	 build-ios.sh src/alpha/ffi.c src/alpha/osf.S			\
-	 src/alpha/ffitarget.h src/arm/ffi.c src/arm/sysv.S		\
+	 src/alpha/ffi.c src/alpha/osf.S			\
+	 src/alpha/ffitarget.h src/arc/ffi.c src/arc/arcompact.S	\
+	 src/arc/ffitarget.h src/arm/ffi.c src/arm/sysv.S		\
 	 src/arm/ffitarget.h src/avr32/ffi.c src/avr32/sysv.S		\
 	 src/avr32/ffitarget.h src/cris/ffi.c src/cris/sysv.S		\
 	 src/cris/ffitarget.h src/ia64/ffi.c src/ia64/ffitarget.h	\
@@ -481,8 +618,12 @@
 	 src/moxie/ffitarget.h src/moxie/eabi.S src/mips/ffitarget.h	\
 	 src/m32r/ffi.c src/m32r/sysv.S src/m32r/ffitarget.h		\
 	 src/m68k/ffi.c src/m68k/sysv.S src/m68k/ffitarget.h		\
+	 src/m88k/ffi.c src/m88k/obsd.S src/m88k/ffitarget.h		\
 	 src/microblaze/ffi.c src/microblaze/sysv.S			\
-	 src/microblaze/ffitarget.h src/powerpc/ffi.c			\
+	 src/microblaze/ffitarget.h					\
+	 src/nios2/ffi.c src/nios2/ffitarget.h src/nios2/sysv.S		\
+	 src/powerpc/ffi.c src/powerpc/ffi_powerpc.h			\
+	 src/powerpc/ffi_sysv.c src/powerpc/ffi_linux64.c		\
 	 src/powerpc/sysv.S src/powerpc/linux64.S			\
 	 src/powerpc/linux64_closure.S src/powerpc/ppc_closure.S	\
 	 src/powerpc/asm.h src/powerpc/aix.S src/powerpc/darwin.S	\
@@ -500,14 +641,14 @@
 	 src/bfin/ffitarget.h src/bfin/sysv.S src/frv/eabi.S		\
 	 src/frv/ffitarget.h src/dlmalloc.c src/tile/ffi.c		\
 	 src/tile/ffitarget.h src/tile/tile.S libtool-version		\
+	 src/vax/ffi.c src/vax/ffitarget.h src/vax/elfbsd.S		\
 	 src/xtensa/ffitarget.h src/xtensa/ffi.c src/xtensa/sysv.S	\
 	 ChangeLog.libffi m4/libtool.m4 m4/lt~obsolete.m4		\
 	 m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4			\
 	 m4/ltversion.m4 src/arm/gentramp.sh src/debug.c msvcc.sh	\
-	 generate-ios-source-and-headers.py				\
-	 generate-osx-source-and-headers.py				\
+	 generate-darwin-source-and-headers.py				\
 	 libffi.xcodeproj/project.pbxproj src/arm/trampoline.S		\
-	 libtool-ldflags
+	 libtool-ldflags ChangeLog.libffi-3.1
 
 info_TEXINFOS = doc/libffi.texi
 
@@ -515,39 +656,39 @@
 # values defined in terms of make variables, as is the case for CC and
 # friends when we are called from the top level Makefile.
 AM_MAKEFLAGS = \
-	"AR_FLAGS=$(AR_FLAGS)" \
-	"CC_FOR_BUILD=$(CC_FOR_BUILD)" \
-	"CFLAGS=$(CFLAGS)" \
-	"CXXFLAGS=$(CXXFLAGS)" \
-	"CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
-	"CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
-	"INSTALL=$(INSTALL)" \
-	"INSTALL_DATA=$(INSTALL_DATA)" \
-	"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
-	"INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
-	"JC1FLAGS=$(JC1FLAGS)" \
-	"LDFLAGS=$(LDFLAGS)" \
-	"LIBCFLAGS=$(LIBCFLAGS)" \
-	"LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
-	"MAKE=$(MAKE)" \
-	"MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
-	"PICFLAG=$(PICFLAG)" \
-	"PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
-	"RUNTESTFLAGS=$(RUNTESTFLAGS)" \
-	"SHELL=$(SHELL)" \
-	"exec_prefix=$(exec_prefix)" \
-	"infodir=$(infodir)" \
-	"libdir=$(libdir)" \
-	"mandir=$(mandir)" \
-	"prefix=$(prefix)" \
-	"AR=$(AR)" \
-	"AS=$(AS)" \
-	"CC=$(CC)" \
-	"CXX=$(CXX)" \
-	"LD=$(LD)" \
-	"NM=$(NM)" \
-	"RANLIB=$(RANLIB)" \
-	"DESTDIR=$(DESTDIR)"
+	'AR_FLAGS=$(AR_FLAGS)' \
+	'CC_FOR_BUILD=$(CC_FOR_BUILD)' \
+	'CFLAGS=$(CFLAGS)' \
+	'CXXFLAGS=$(CXXFLAGS)' \
+	'CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)' \
+	'CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)' \
+	'INSTALL=$(INSTALL)' \
+	'INSTALL_DATA=$(INSTALL_DATA)' \
+	'INSTALL_PROGRAM=$(INSTALL_PROGRAM)' \
+	'INSTALL_SCRIPT=$(INSTALL_SCRIPT)' \
+	'JC1FLAGS=$(JC1FLAGS)' \
+	'LDFLAGS=$(LDFLAGS)' \
+	'LIBCFLAGS=$(LIBCFLAGS)' \
+	'LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)' \
+	'MAKE=$(MAKE)' \
+	'MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)' \
+	'PICFLAG=$(PICFLAG)' \
+	'PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)' \
+	'RUNTESTFLAGS=$(RUNTESTFLAGS)' \
+	'SHELL=$(SHELL)' \
+	'exec_prefix=$(exec_prefix)' \
+	'infodir=$(infodir)' \
+	'libdir=$(libdir)' \
+	'mandir=$(mandir)' \
+	'prefix=$(prefix)' \
+	'AR=$(AR)' \
+	'AS=$(AS)' \
+	'CC=$(CC)' \
+	'CXX=$(CXX)' \
+	'LD=$(LD)' \
+	'NM=$(NM)' \
+	'RANLIB=$(RANLIB)' \
+	'DESTDIR=$(DESTDIR)'
 
 
 # Subdir rules rely on $(FLAGS_TO_PASS)
@@ -571,10 +712,13 @@
 	$(am__append_24) $(am__append_25) $(am__append_26) \
 	$(am__append_27) $(am__append_28) $(am__append_29) \
 	$(am__append_30) $(am__append_31) $(am__append_32) \
-	$(am__append_33) $(am__append_34)
+	$(am__append_33) $(am__append_34) $(am__append_35) \
+	$(am__append_36) $(am__append_37) $(am__append_38) \
+	$(am__append_39)
 libffi_convenience_la_SOURCES = $(libffi_la_SOURCES)
 nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES)
 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/libtool-ldflags $(LDFLAGS))
+AM_CFLAGS = $(am__append_40)
 libffi_la_LDFLAGS = -no-undefined -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LTLDFLAGS) $(AM_LTLDFLAGS)
 AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
 AM_CCASFLAGS = $(AM_CPPFLAGS)
@@ -645,6 +789,7 @@
 	  echo rm -f $${locs}; \
 	  rm -f $${locs}; \
 	}
+
 install-toolexeclibLTLIBRARIES: $(toolexeclib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
 	@list='$(toolexeclib_LTLIBRARIES)'; test -n "$(toolexeclibdir)" || list=; \
@@ -723,10 +868,10 @@
 	src/x86/$(DEPDIR)/$(am__dirstamp)
 src/x86/sysv.lo: src/x86/$(am__dirstamp) \
 	src/x86/$(DEPDIR)/$(am__dirstamp)
-src/x86/freebsd.lo: src/x86/$(am__dirstamp) \
-	src/x86/$(DEPDIR)/$(am__dirstamp)
 src/x86/win32.lo: src/x86/$(am__dirstamp) \
 	src/x86/$(DEPDIR)/$(am__dirstamp)
+src/x86/freebsd.lo: src/x86/$(am__dirstamp) \
+	src/x86/$(DEPDIR)/$(am__dirstamp)
 src/x86/win64.lo: src/x86/$(am__dirstamp) \
 	src/x86/$(DEPDIR)/$(am__dirstamp)
 src/x86/darwin.lo: src/x86/$(am__dirstamp) \
@@ -787,6 +932,16 @@
 	src/m68k/$(DEPDIR)/$(am__dirstamp)
 src/m68k/sysv.lo: src/m68k/$(am__dirstamp) \
 	src/m68k/$(DEPDIR)/$(am__dirstamp)
+src/m88k/$(am__dirstamp):
+	@$(MKDIR_P) src/m88k
+	@: > src/m88k/$(am__dirstamp)
+src/m88k/$(DEPDIR)/$(am__dirstamp):
+	@$(MKDIR_P) src/m88k/$(DEPDIR)
+	@: > src/m88k/$(DEPDIR)/$(am__dirstamp)
+src/m88k/ffi.lo: src/m88k/$(am__dirstamp) \
+	src/m88k/$(DEPDIR)/$(am__dirstamp)
+src/m88k/obsd.lo: src/m88k/$(am__dirstamp) \
+	src/m88k/$(DEPDIR)/$(am__dirstamp)
 src/moxie/$(am__dirstamp):
 	@$(MKDIR_P) src/moxie
 	@: > src/moxie/$(am__dirstamp)
@@ -807,6 +962,16 @@
 	src/microblaze/$(DEPDIR)/$(am__dirstamp)
 src/microblaze/sysv.lo: src/microblaze/$(am__dirstamp) \
 	src/microblaze/$(DEPDIR)/$(am__dirstamp)
+src/nios2/$(am__dirstamp):
+	@$(MKDIR_P) src/nios2
+	@: > src/nios2/$(am__dirstamp)
+src/nios2/$(DEPDIR)/$(am__dirstamp):
+	@$(MKDIR_P) src/nios2/$(DEPDIR)
+	@: > src/nios2/$(DEPDIR)/$(am__dirstamp)
+src/nios2/sysv.lo: src/nios2/$(am__dirstamp) \
+	src/nios2/$(DEPDIR)/$(am__dirstamp)
+src/nios2/ffi.lo: src/nios2/$(am__dirstamp) \
+	src/nios2/$(DEPDIR)/$(am__dirstamp)
 src/powerpc/$(am__dirstamp):
 	@$(MKDIR_P) src/powerpc
 	@: > src/powerpc/$(am__dirstamp)
@@ -815,6 +980,10 @@
 	@: > src/powerpc/$(DEPDIR)/$(am__dirstamp)
 src/powerpc/ffi.lo: src/powerpc/$(am__dirstamp) \
 	src/powerpc/$(DEPDIR)/$(am__dirstamp)
+src/powerpc/ffi_sysv.lo: src/powerpc/$(am__dirstamp) \
+	src/powerpc/$(DEPDIR)/$(am__dirstamp)
+src/powerpc/ffi_linux64.lo: src/powerpc/$(am__dirstamp) \
+	src/powerpc/$(DEPDIR)/$(am__dirstamp)
 src/powerpc/sysv.lo: src/powerpc/$(am__dirstamp) \
 	src/powerpc/$(DEPDIR)/$(am__dirstamp)
 src/powerpc/ppc_closure.lo: src/powerpc/$(am__dirstamp) \
@@ -843,6 +1012,16 @@
 	src/aarch64/$(DEPDIR)/$(am__dirstamp)
 src/aarch64/ffi.lo: src/aarch64/$(am__dirstamp) \
 	src/aarch64/$(DEPDIR)/$(am__dirstamp)
+src/arc/$(am__dirstamp):
+	@$(MKDIR_P) src/arc
+	@: > src/arc/$(am__dirstamp)
+src/arc/$(DEPDIR)/$(am__dirstamp):
+	@$(MKDIR_P) src/arc/$(DEPDIR)
+	@: > src/arc/$(DEPDIR)/$(am__dirstamp)
+src/arc/arcompact.lo: src/arc/$(am__dirstamp) \
+	src/arc/$(DEPDIR)/$(am__dirstamp)
+src/arc/ffi.lo: src/arc/$(am__dirstamp) \
+	src/arc/$(DEPDIR)/$(am__dirstamp)
 src/arm/$(am__dirstamp):
 	@$(MKDIR_P) src/arm
 	@: > src/arm/$(am__dirstamp)
@@ -957,10 +1136,22 @@
 	src/metag/$(DEPDIR)/$(am__dirstamp)
 src/metag/ffi.lo: src/metag/$(am__dirstamp) \
 	src/metag/$(DEPDIR)/$(am__dirstamp)
+src/vax/$(am__dirstamp):
+	@$(MKDIR_P) src/vax
+	@: > src/vax/$(am__dirstamp)
+src/vax/$(DEPDIR)/$(am__dirstamp):
+	@$(MKDIR_P) src/vax/$(DEPDIR)
+	@: > src/vax/$(DEPDIR)/$(am__dirstamp)
+src/vax/elfbsd.lo: src/vax/$(am__dirstamp) \
+	src/vax/$(DEPDIR)/$(am__dirstamp)
+src/vax/ffi.lo: src/vax/$(am__dirstamp) \
+	src/vax/$(DEPDIR)/$(am__dirstamp)
+
 libffi.la: $(libffi_la_OBJECTS) $(libffi_la_DEPENDENCIES) $(EXTRA_libffi_la_DEPENDENCIES) 
-	$(libffi_la_LINK) -rpath $(toolexeclibdir) $(libffi_la_OBJECTS) $(libffi_la_LIBADD) $(LIBS)
+	$(AM_V_CCLD)$(libffi_la_LINK) -rpath $(toolexeclibdir) $(libffi_la_OBJECTS) $(libffi_la_LIBADD) $(LIBS)
+
 libffi_convenience.la: $(libffi_convenience_la_OBJECTS) $(libffi_convenience_la_DEPENDENCIES) $(EXTRA_libffi_convenience_la_DEPENDENCIES) 
-	$(LINK)  $(libffi_convenience_la_OBJECTS) $(libffi_convenience_la_LIBADD) $(LIBS)
+	$(AM_V_CCLD)$(LINK)  $(libffi_convenience_la_OBJECTS) $(libffi_convenience_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
@@ -970,6 +1161,8 @@
 	-rm -f src/aarch64/*.lo
 	-rm -f src/alpha/*.$(OBJEXT)
 	-rm -f src/alpha/*.lo
+	-rm -f src/arc/*.$(OBJEXT)
+	-rm -f src/arc/*.lo
 	-rm -f src/arm/*.$(OBJEXT)
 	-rm -f src/arm/*.lo
 	-rm -f src/avr32/*.$(OBJEXT)
@@ -986,6 +1179,8 @@
 	-rm -f src/m32r/*.lo
 	-rm -f src/m68k/*.$(OBJEXT)
 	-rm -f src/m68k/*.lo
+	-rm -f src/m88k/*.$(OBJEXT)
+	-rm -f src/m88k/*.lo
 	-rm -f src/metag/*.$(OBJEXT)
 	-rm -f src/metag/*.lo
 	-rm -f src/microblaze/*.$(OBJEXT)
@@ -994,6 +1189,8 @@
 	-rm -f src/mips/*.lo
 	-rm -f src/moxie/*.$(OBJEXT)
 	-rm -f src/moxie/*.lo
+	-rm -f src/nios2/*.$(OBJEXT)
+	-rm -f src/nios2/*.lo
 	-rm -f src/pa/*.$(OBJEXT)
 	-rm -f src/pa/*.lo
 	-rm -f src/powerpc/*.$(OBJEXT)
@@ -1008,6 +1205,8 @@
 	-rm -f src/sparc/*.lo
 	-rm -f src/tile/*.$(OBJEXT)
 	-rm -f src/tile/*.lo
+	-rm -f src/vax/*.$(OBJEXT)
+	-rm -f src/vax/*.lo
 	-rm -f src/x86/*.$(OBJEXT)
 	-rm -f src/x86/*.lo
 	-rm -f src/xtensa/*.$(OBJEXT)
@@ -1026,6 +1225,8 @@
 @AMDEP_TRUE@@am__include@ @am__quote@src/aarch64/$(DEPDIR)/sysv.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/alpha/$(DEPDIR)/ffi.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/alpha/$(DEPDIR)/osf.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/arc/$(DEPDIR)/arcompact.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/arc/$(DEPDIR)/ffi.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/arm/$(DEPDIR)/ffi.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/arm/$(DEPDIR)/sysv.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/arm/$(DEPDIR)/trampoline.Plo@am__quote@
@@ -1043,6 +1244,8 @@
 @AMDEP_TRUE@@am__include@ @am__quote@src/m32r/$(DEPDIR)/sysv.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/m68k/$(DEPDIR)/ffi.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/m68k/$(DEPDIR)/sysv.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/m88k/$(DEPDIR)/ffi.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/m88k/$(DEPDIR)/obsd.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/metag/$(DEPDIR)/ffi.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/metag/$(DEPDIR)/sysv.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/microblaze/$(DEPDIR)/ffi.Plo@am__quote@
@@ -1052,6 +1255,8 @@
 @AMDEP_TRUE@@am__include@ @am__quote@src/mips/$(DEPDIR)/o32.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/moxie/$(DEPDIR)/eabi.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/moxie/$(DEPDIR)/ffi.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/nios2/$(DEPDIR)/ffi.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/nios2/$(DEPDIR)/sysv.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/pa/$(DEPDIR)/ffi.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/pa/$(DEPDIR)/hpux32.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/pa/$(DEPDIR)/linux.Plo@am__quote@
@@ -1061,6 +1266,8 @@
 @AMDEP_TRUE@@am__include@ @am__quote@src/powerpc/$(DEPDIR)/darwin_closure.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/powerpc/$(DEPDIR)/ffi.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/powerpc/$(DEPDIR)/ffi_darwin.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/powerpc/$(DEPDIR)/ffi_linux64.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/powerpc/$(DEPDIR)/ffi_sysv.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/powerpc/$(DEPDIR)/linux64.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/powerpc/$(DEPDIR)/linux64_closure.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/powerpc/$(DEPDIR)/ppc_closure.Plo@am__quote@
@@ -1076,6 +1283,8 @@
 @AMDEP_TRUE@@am__include@ @am__quote@src/sparc/$(DEPDIR)/v9.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/tile/$(DEPDIR)/ffi.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/tile/$(DEPDIR)/tile.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/vax/$(DEPDIR)/elfbsd.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/vax/$(DEPDIR)/ffi.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/x86/$(DEPDIR)/darwin.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/x86/$(DEPDIR)/darwin64.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/x86/$(DEPDIR)/ffi.Plo@am__quote@
@@ -1089,52 +1298,52 @@
 @AMDEP_TRUE@@am__include@ @am__quote@src/xtensa/$(DEPDIR)/sysv.Plo@am__quote@
 
 .S.o:
-@am__fastdepCCAS_TRUE@	depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCCAS_TRUE@	$(AM_V_CPPAS)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
 @am__fastdepCCAS_TRUE@	$(CPPASCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
 @am__fastdepCCAS_TRUE@	$(am__mv) $$depbase.Tpo $$depbase.Po
-@AMDEP_TRUE@@am__fastdepCCAS_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCCAS_FALSE@	$(AM_V_CPPAS)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCCAS_FALSE@	DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCCAS_FALSE@	$(CPPASCOMPILE) -c -o $@ $<
+@am__fastdepCCAS_FALSE@	$(AM_V_CPPAS@am__nodep@)$(CPPASCOMPILE) -c -o $@ $<
 
 .S.obj:
-@am__fastdepCCAS_TRUE@	depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCCAS_TRUE@	$(AM_V_CPPAS)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
 @am__fastdepCCAS_TRUE@	$(CPPASCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
 @am__fastdepCCAS_TRUE@	$(am__mv) $$depbase.Tpo $$depbase.Po
-@AMDEP_TRUE@@am__fastdepCCAS_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCCAS_FALSE@	$(AM_V_CPPAS)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCCAS_FALSE@	DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCCAS_FALSE@	$(CPPASCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCCAS_FALSE@	$(AM_V_CPPAS@am__nodep@)$(CPPASCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
 
 .S.lo:
-@am__fastdepCCAS_TRUE@	depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCCAS_TRUE@	$(AM_V_CPPAS)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
 @am__fastdepCCAS_TRUE@	$(LTCPPASCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
 @am__fastdepCCAS_TRUE@	$(am__mv) $$depbase.Tpo $$depbase.Plo
-@AMDEP_TRUE@@am__fastdepCCAS_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCCAS_FALSE@	$(AM_V_CPPAS)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCCAS_FALSE@	DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCCAS_FALSE@	$(LTCPPASCOMPILE) -c -o $@ $<
+@am__fastdepCCAS_FALSE@	$(AM_V_CPPAS@am__nodep@)$(LTCPPASCOMPILE) -c -o $@ $<
 
 .c.o:
-@am__fastdepCC_TRUE@	depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@	$(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
 @am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
 @am__fastdepCC_TRUE@	$(am__mv) $$depbase.Tpo $$depbase.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(COMPILE) -c -o $@ $<
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
 
 .c.obj:
-@am__fastdepCC_TRUE@	depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@	$(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
 @am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
 @am__fastdepCC_TRUE@	$(am__mv) $$depbase.Tpo $$depbase.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
 
 .c.lo:
-@am__fastdepCC_TRUE@	depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCC_TRUE@	$(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
 @am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
 @am__fastdepCC_TRUE@	$(am__mv) $$depbase.Tpo $$depbase.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
 
 mostlyclean-libtool:
 	-rm -f *.lo
@@ -1144,6 +1353,7 @@
 	-rm -rf src/.libs src/_libs
 	-rm -rf src/aarch64/.libs src/aarch64/_libs
 	-rm -rf src/alpha/.libs src/alpha/_libs
+	-rm -rf src/arc/.libs src/arc/_libs
 	-rm -rf src/arm/.libs src/arm/_libs
 	-rm -rf src/avr32/.libs src/avr32/_libs
 	-rm -rf src/bfin/.libs src/bfin/_libs
@@ -1152,10 +1362,12 @@
 	-rm -rf src/ia64/.libs src/ia64/_libs
 	-rm -rf src/m32r/.libs src/m32r/_libs
 	-rm -rf src/m68k/.libs src/m68k/_libs
+	-rm -rf src/m88k/.libs src/m88k/_libs
 	-rm -rf src/metag/.libs src/metag/_libs
 	-rm -rf src/microblaze/.libs src/microblaze/_libs
 	-rm -rf src/mips/.libs src/mips/_libs
 	-rm -rf src/moxie/.libs src/moxie/_libs
+	-rm -rf src/nios2/.libs src/nios2/_libs
 	-rm -rf src/pa/.libs src/pa/_libs
 	-rm -rf src/powerpc/.libs src/powerpc/_libs
 	-rm -rf src/s390/.libs src/s390/_libs
@@ -1163,6 +1375,7 @@
 	-rm -rf src/sh64/.libs src/sh64/_libs
 	-rm -rf src/sparc/.libs src/sparc/_libs
 	-rm -rf src/tile/.libs src/tile/_libs
+	-rm -rf src/vax/.libs src/vax/_libs
 	-rm -rf src/x86/.libs src/x86/_libs
 	-rm -rf src/xtensa/.libs src/xtensa/_libs
 
@@ -1173,7 +1386,7 @@
 	@: > doc/$(am__dirstamp)
 
 $(srcdir)/doc/libffi.info: doc/libffi.texi $(srcdir)/doc/version.texi
-	restore=: && backupdir="$(am__leading_dot)am$$$$" && \
+	$(AM_V_MAKEINFO)restore=: && backupdir="$(am__leading_dot)am$$$$" && \
 	am__cwd=`pwd` && $(am__cd) $(srcdir) && \
 	rm -rf $$backupdir && mkdir $$backupdir && \
 	if ($(MAKEINFO) --version) >/dev/null 2>&1; then \
@@ -1195,18 +1408,20 @@
 	rm -rf $$backupdir; exit $$rc
 
 doc/libffi.dvi: doc/libffi.texi $(srcdir)/doc/version.texi doc/$(am__dirstamp)
-	TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+	$(AM_V_TEXI2DVI)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
 	MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I doc -I $(srcdir)/doc' \
-	$(TEXI2DVI)  --clean -o $@ `test -f 'doc/libffi.texi' || echo '$(srcdir)/'`doc/libffi.texi 
+	$(TEXI2DVI) $(AM_V_texinfo) --build-dir=$(@:.dvi=.t2d) -o $@ $(AM_V_texidevnull) \
+	`test -f 'doc/libffi.texi' || echo '$(srcdir)/'`doc/libffi.texi
 
 doc/libffi.pdf: doc/libffi.texi $(srcdir)/doc/version.texi doc/$(am__dirstamp)
-	TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+	$(AM_V_TEXI2PDF)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
 	MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I doc -I $(srcdir)/doc' \
-	$(TEXI2PDF)  --clean -o $@ `test -f 'doc/libffi.texi' || echo '$(srcdir)/'`doc/libffi.texi 
+	$(TEXI2PDF) $(AM_V_texinfo) --build-dir=$(@:.pdf=.t2p) -o $@ $(AM_V_texidevnull) \
+	`test -f 'doc/libffi.texi' || echo '$(srcdir)/'`doc/libffi.texi
 
 doc/libffi.html: doc/libffi.texi $(srcdir)/doc/version.texi doc/$(am__dirstamp)
-	rm -rf $(@:.html=.htp)
-	if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I doc -I $(srcdir)/doc \
+	$(AM_V_MAKEINFO)rm -rf $(@:.html=.htp)
+	$(AM_V_at)if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I doc -I $(srcdir)/doc \
 	 -o $(@:.html=.htp) `test -f 'doc/libffi.texi' || echo '$(srcdir)/'`doc/libffi.texi; \
 	then \
 	  rm -rf $@; \
@@ -1238,8 +1453,8 @@
 maintainer-clean-vti:
 @MAINTAINER_MODE_TRUE@	-rm -f $(srcdir)/doc/stamp-vti $(srcdir)/doc/version.texi
 .dvi.ps:
-	TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
-	$(DVIPS)  -o $@ $<
+	$(AM_V_DVIPS)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+	$(DVIPS) $(AM_V_texinfo) -o $@ $<
 
 uninstall-dvi-am:
 	@$(NORMAL_UNINSTALL)
@@ -1318,8 +1533,7 @@
 	done
 
 mostlyclean-aminfo:
-	-rm -rf libffi.aux libffi.cp libffi.cps libffi.fn libffi.ky libffi.log \
-	  libffi.pg libffi.tmp libffi.toc libffi.tp libffi.vr
+	-rm -rf doc/libffi.t2d doc/libffi.t2p
 
 clean-aminfo:
 	-test -z "doc/libffi.dvi doc/libffi.pdf doc/libffi.ps doc/libffi.html" \
@@ -1359,14 +1573,13 @@
 # (1) if the variable is set in 'config.status', edit 'config.status'
 #     (which will cause the Makefiles to be regenerated when you run 'make');
 # (2) otherwise, pass the desired values on the 'make' command line.
-$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
+$(am__recursive_targets):
+	@fail=; \
+	if $(am__make_keepgoing); then \
+	  failcom='fail=yes'; \
+	else \
+	  failcom='exit 1'; \
+	fi; \
 	dot_seen=no; \
 	target=`echo $@ | sed s/-recursive//`; \
 	case "$@" in \
@@ -1387,31 +1600,13 @@
 	if test "$$dot_seen" = "no"; then \
 	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
 	fi; test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-ctags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-	done
-cscopelist-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
-	done
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
 
-TAGS: tags-recursive $(HEADERS) $(SOURCES) fficonfig.h.in $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
 	set x; \
 	here=`pwd`; \
 	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
@@ -1427,12 +1622,7 @@
 	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
 	  fi; \
 	done; \
-	list='$(SOURCES) $(HEADERS) fficonfig.h.in $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	$(am__define_uniq_tagged_files); \
 	shift; \
 	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
@@ -1444,15 +1634,11 @@
 	      $$unique; \
 	  fi; \
 	fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES) fficonfig.h.in $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS) fficonfig.h.in $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
 	test -z "$(CTAGS_ARGS)$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
 	     $$unique
@@ -1461,18 +1647,16 @@
 	here=`$(am__cd) $(top_builddir) && pwd` \
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
-
 cscope: cscope.files
 	test ! -s cscope.files \
 	  || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
-
 clean-cscope:
 	-rm -f cscope.files
+cscope.files: clean-cscope cscopelist
+cscopelist: cscopelist-recursive
 
-cscope.files: clean-cscope cscopelist-recursive cscopelist
-
-cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
-	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
 	case "$(srcdir)" in \
 	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
 	  *) sdir=$(subdir)/$(srcdir) ;; \
@@ -1548,7 +1732,7 @@
 	done
 	$(MAKE) $(AM_MAKEFLAGS) \
 	  top_distdir="$(top_distdir)" distdir="$(distdir)" \
-	  dist-info
+	  dist-info dist-hook
 	-test -n "$(am__skip_mode_fix)" \
 	|| find "$(distdir)" -type d ! -perm -755 \
 		-exec chmod u+rwx,go+rx {} \; -o \
@@ -1609,9 +1793,9 @@
 	*.zip*) \
 	  unzip $(distdir).zip ;;\
 	esac
-	chmod -R a-w $(distdir); chmod u+w $(distdir)
-	mkdir $(distdir)/_build
-	mkdir $(distdir)/_inst
+	chmod -R a-w $(distdir)
+	chmod u+w $(distdir)
+	mkdir $(distdir)/_build $(distdir)/_inst
 	chmod a-w $(distdir)
 	test -d $(distdir)/_build || exit 0; \
 	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
@@ -1714,6 +1898,8 @@
 	-rm -f src/aarch64/$(am__dirstamp)
 	-rm -f src/alpha/$(DEPDIR)/$(am__dirstamp)
 	-rm -f src/alpha/$(am__dirstamp)
+	-rm -f src/arc/$(DEPDIR)/$(am__dirstamp)
+	-rm -f src/arc/$(am__dirstamp)
 	-rm -f src/arm/$(DEPDIR)/$(am__dirstamp)
 	-rm -f src/arm/$(am__dirstamp)
 	-rm -f src/avr32/$(DEPDIR)/$(am__dirstamp)
@@ -1730,6 +1916,8 @@
 	-rm -f src/m32r/$(am__dirstamp)
 	-rm -f src/m68k/$(DEPDIR)/$(am__dirstamp)
 	-rm -f src/m68k/$(am__dirstamp)
+	-rm -f src/m88k/$(DEPDIR)/$(am__dirstamp)
+	-rm -f src/m88k/$(am__dirstamp)
 	-rm -f src/metag/$(DEPDIR)/$(am__dirstamp)
 	-rm -f src/metag/$(am__dirstamp)
 	-rm -f src/microblaze/$(DEPDIR)/$(am__dirstamp)
@@ -1738,6 +1926,8 @@
 	-rm -f src/mips/$(am__dirstamp)
 	-rm -f src/moxie/$(DEPDIR)/$(am__dirstamp)
 	-rm -f src/moxie/$(am__dirstamp)
+	-rm -f src/nios2/$(DEPDIR)/$(am__dirstamp)
+	-rm -f src/nios2/$(am__dirstamp)
 	-rm -f src/pa/$(DEPDIR)/$(am__dirstamp)
 	-rm -f src/pa/$(am__dirstamp)
 	-rm -f src/powerpc/$(DEPDIR)/$(am__dirstamp)
@@ -1752,6 +1942,8 @@
 	-rm -f src/sparc/$(am__dirstamp)
 	-rm -f src/tile/$(DEPDIR)/$(am__dirstamp)
 	-rm -f src/tile/$(am__dirstamp)
+	-rm -f src/vax/$(DEPDIR)/$(am__dirstamp)
+	-rm -f src/vax/$(am__dirstamp)
 	-rm -f src/x86/$(DEPDIR)/$(am__dirstamp)
 	-rm -f src/x86/$(am__dirstamp)
 	-rm -f src/xtensa/$(DEPDIR)/$(am__dirstamp)
@@ -1768,7 +1960,7 @@
 
 distclean: distclean-recursive
 	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-	-rm -rf src/$(DEPDIR) src/aarch64/$(DEPDIR) src/alpha/$(DEPDIR) src/arm/$(DEPDIR) src/avr32/$(DEPDIR) src/bfin/$(DEPDIR) src/cris/$(DEPDIR) src/frv/$(DEPDIR) src/ia64/$(DEPDIR) src/m32r/$(DEPDIR) src/m68k/$(DEPDIR) src/metag/$(DEPDIR) src/microblaze/$(DEPDIR) src/mips/$(DEPDIR) src/moxie/$(DEPDIR) src/pa/$(DEPDIR) src/powerpc/$(DEPDIR) src/s390/$(DEPDIR) src/sh/$(DEPDIR) src/sh64/$(DEPDIR) src/sparc/$(DEPDIR) src/tile/$(DEPDIR) src/x86/$(DEPDIR) src/xtensa/$(DEPDIR)
+	-rm -rf src/$(DEPDIR) src/aarch64/$(DEPDIR) src/alpha/$(DEPDIR) src/arc/$(DEPDIR) src/arm/$(DEPDIR) src/avr32/$(DEPDIR) src/bfin/$(DEPDIR) src/cris/$(DEPDIR) src/frv/$(DEPDIR) src/ia64/$(DEPDIR) src/m32r/$(DEPDIR) src/m68k/$(DEPDIR) src/m88k/$(DEPDIR) src/metag/$(DEPDIR) src/microblaze/$(DEPDIR) src/mips/$(DEPDIR) src/moxie/$(DEPDIR) src/nios2/$(DEPDIR) src/pa/$(DEPDIR) src/powerpc/$(DEPDIR) src/s390/$(DEPDIR) src/sh/$(DEPDIR) src/sh64/$(DEPDIR) src/sparc/$(DEPDIR) src/tile/$(DEPDIR) src/vax/$(DEPDIR) src/x86/$(DEPDIR) src/xtensa/$(DEPDIR)
 	-rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
 	distclean-hdr distclean-libtool distclean-tags
@@ -1907,7 +2099,7 @@
 maintainer-clean: maintainer-clean-recursive
 	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
 	-rm -rf $(top_srcdir)/autom4te.cache
-	-rm -rf src/$(DEPDIR) src/aarch64/$(DEPDIR) src/alpha/$(DEPDIR) src/arm/$(DEPDIR) src/avr32/$(DEPDIR) src/bfin/$(DEPDIR) src/cris/$(DEPDIR) src/frv/$(DEPDIR) src/ia64/$(DEPDIR) src/m32r/$(DEPDIR) src/m68k/$(DEPDIR) src/metag/$(DEPDIR) src/microblaze/$(DEPDIR) src/mips/$(DEPDIR) src/moxie/$(DEPDIR) src/pa/$(DEPDIR) src/powerpc/$(DEPDIR) src/s390/$(DEPDIR) src/sh/$(DEPDIR) src/sh64/$(DEPDIR) src/sparc/$(DEPDIR) src/tile/$(DEPDIR) src/x86/$(DEPDIR) src/xtensa/$(DEPDIR)
+	-rm -rf src/$(DEPDIR) src/aarch64/$(DEPDIR) src/alpha/$(DEPDIR) src/arc/$(DEPDIR) src/arm/$(DEPDIR) src/avr32/$(DEPDIR) src/bfin/$(DEPDIR) src/cris/$(DEPDIR) src/frv/$(DEPDIR) src/ia64/$(DEPDIR) src/m32r/$(DEPDIR) src/m68k/$(DEPDIR) src/m88k/$(DEPDIR) src/metag/$(DEPDIR) src/microblaze/$(DEPDIR) src/mips/$(DEPDIR) src/moxie/$(DEPDIR) src/nios2/$(DEPDIR) src/pa/$(DEPDIR) src/powerpc/$(DEPDIR) src/s390/$(DEPDIR) src/sh/$(DEPDIR) src/sh64/$(DEPDIR) src/sparc/$(DEPDIR) src/tile/$(DEPDIR) src/vax/$(DEPDIR) src/x86/$(DEPDIR) src/xtensa/$(DEPDIR)
 	-rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-aminfo \
 	maintainer-clean-generic maintainer-clean-vti
@@ -1929,36 +2121,36 @@
 	uninstall-pdf-am uninstall-pkgconfigDATA uninstall-ps-am \
 	uninstall-toolexeclibLTLIBRARIES
 
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \
-	cscopelist-recursive ctags-recursive install-am install-strip \
-	tags-recursive
+.MAKE: $(am__recursive_targets) all install-am install-strip
 
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am am--refresh check check-am clean clean-aminfo \
-	clean-cscope clean-generic clean-libtool \
-	clean-noinstLTLIBRARIES clean-toolexeclibLTLIBRARIES cscope \
-	cscopelist cscopelist-recursive ctags ctags-recursive dist \
-	dist-all dist-bzip2 dist-gzip dist-info dist-lzip dist-shar \
-	dist-tarZ dist-xz dist-zip distcheck distclean \
-	distclean-compile distclean-generic distclean-hdr \
-	distclean-libtool distclean-tags distcleancheck distdir \
-	distuninstallcheck dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkgconfigDATA install-ps \
-	install-ps-am install-strip install-toolexeclibLTLIBRARIES \
-	installcheck installcheck-am installdirs installdirs-am \
-	maintainer-clean maintainer-clean-aminfo \
-	maintainer-clean-generic maintainer-clean-vti mostlyclean \
-	mostlyclean-aminfo mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool mostlyclean-vti pdf pdf-am ps ps-am tags \
-	tags-recursive uninstall uninstall-am uninstall-dvi-am \
-	uninstall-html-am uninstall-info-am uninstall-pdf-am \
-	uninstall-pkgconfigDATA uninstall-ps-am \
-	uninstall-toolexeclibLTLIBRARIES
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
+	am--refresh check check-am clean clean-aminfo clean-cscope \
+	clean-generic clean-libtool clean-noinstLTLIBRARIES \
+	clean-toolexeclibLTLIBRARIES cscope cscopelist-am ctags \
+	ctags-am dist dist-all dist-bzip2 dist-gzip dist-hook \
+	dist-info dist-lzip dist-shar dist-tarZ dist-xz dist-zip \
+	distcheck distclean distclean-compile distclean-generic \
+	distclean-hdr distclean-libtool distclean-tags distcleancheck \
+	distdir distuninstallcheck dvi dvi-am html html-am info \
+	info-am install install-am install-data install-data-am \
+	install-dvi install-dvi-am install-exec install-exec-am \
+	install-html install-html-am install-info install-info-am \
+	install-man install-pdf install-pdf-am install-pkgconfigDATA \
+	install-ps install-ps-am install-strip \
+	install-toolexeclibLTLIBRARIES installcheck installcheck-am \
+	installdirs installdirs-am maintainer-clean \
+	maintainer-clean-aminfo maintainer-clean-generic \
+	maintainer-clean-vti mostlyclean mostlyclean-aminfo \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-vti pdf pdf-am ps ps-am tags tags-am uninstall \
+	uninstall-am uninstall-dvi-am uninstall-html-am \
+	uninstall-info-am uninstall-pdf-am uninstall-pkgconfigDATA \
+	uninstall-ps-am uninstall-toolexeclibLTLIBRARIES
 
 
+dist-hook:
+	if [ -d $(top_srcdir)/.git ] ; then (cd $(top_srcdir); git log --no-decorate) ; else echo 'See git log for history.' ; fi > $(distdir)/ChangeLog
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
diff --git a/Modules/_ctypes/libffi/README b/Modules/_ctypes/libffi/README
index 19156fe..84b9426 100644
--- a/Modules/_ctypes/libffi/README
+++ b/Modules/_ctypes/libffi/README
@@ -1,8 +1,8 @@
 Status
 ======
 
-libffi-3.0.13 was released on March 17, 2013.  Check the libffi web
-page for updates: <URL:http://sourceware.org/libffi/>.
+libffi-3.1 was released on May 19, 2014.  Check the libffi web page
+for updates: <URL:http://sourceware.org/libffi/>.
 
 
 What is libffi?
@@ -43,7 +43,7 @@
 For specific configuration details and testing status, please
 refer to the wiki page here:
 
- http://www.moxielogic.org/wiki/index.php?title=Libffi_3.0.13
+ http://www.moxielogic.org/wiki/index.php?title=Libffi_3.1
 
 At the time of release, the following basic configurations have been
 tested:
@@ -51,9 +51,11 @@
 |-----------------+------------------+-------------------------|
 | Architecture    | Operating System | Compiler                |
 |-----------------+------------------+-------------------------|
+| AArch64 (ARM64) | iOS              | Clang                   |
 | AArch64         | Linux            | GCC                     |
 | Alpha           | Linux            | GCC                     |
 | Alpha           | Tru64            | GCC                     |
+| ARC             | Linux            | GCC                     |
 | ARM             | Linux            | GCC                     |
 | ARM             | iOS              | GCC                     |
 | AVR32           | Linux            | GCC                     |
@@ -61,15 +63,17 @@
 | HPPA            | HPUX             | GCC                     |
 | IA-64           | Linux            | GCC                     |
 | M68K            | FreeMiNT         | GCC                     |
-| M68K            | Linux	     | GCC                     |
+| M68K            | Linux            | GCC                     |
 | M68K            | RTEMS            | GCC                     |
+| M88K            | OpenBSD/mvme88k  | GCC                     |
 | Meta            | Linux            | GCC                     |
 | MicroBlaze      | Linux            | GCC                     |
 | MIPS            | IRIX             | GCC                     |
 | MIPS            | Linux            | GCC                     |
 | MIPS            | RTEMS            | GCC                     |
 | MIPS64          | Linux            | GCC                     |
-| Moxie		  | Bare metal	     | GCC
+| Moxie           | Bare metal       | GCC                     |
+| Nios II         | Linux            | GCC                     |
 | PowerPC 32-bit  | AIX              | IBM XL C                |
 | PowerPC 64-bit  | AIX              | IBM XL C                |
 | PowerPC         | AMIGA            | GCC                     |
@@ -77,7 +81,8 @@
 | PowerPC         | Mac OSX          | GCC                     |
 | PowerPC         | FreeBSD          | GCC                     |
 | PowerPC 64-bit  | FreeBSD          | GCC                     |
-| PowerPC 64-bit  | Linux            | GCC                     |
+| PowerPC 64-bit  | Linux ELFv1      | GCC                     |
+| PowerPC 64-bit  | Linux ELFv2      | GCC                     |
 | S390            | Linux            | GCC                     |
 | S390X           | Linux            | GCC                     |
 | SPARC           | Linux            | GCC                     |
@@ -87,6 +92,7 @@
 | SPARC64         | FreeBSD          | GCC                     |
 | SPARC64         | Solaris          | Oracle Solaris Studio C |
 | TILE-Gx/TILEPro | Linux            | GCC                     |
+| VAX             | OpenBSD/vax      | GCC                     |
 | X86             | FreeBSD          | GCC                     |
 | X86             | GNU HURD         | GCC                     |
 | X86             | Interix          | GCC                     |
@@ -120,6 +126,9 @@
 "configure" program found in the root directory of the libffi source
 distribution.
 
+If you're building libffi directly from version control, configure won't
+exist yet; run ./autogen.sh first.
+
 You may want to tell configure where to install the libffi library and
 header files. To do that, use the --prefix configure switch.  Libffi
 will install under /usr/local by default. 
@@ -137,13 +146,16 @@
 Microsoft's Visual C++ compiler.  In this case, use the msvcc.sh
 wrapper script during configuration like so:
 
-path/to/configure CC=path/to/msvcc.sh LD=link CPP=\"cl -nologo -EP\"
+path/to/configure CC=path/to/msvcc.sh CXX=path/to/msvcc.sh LD=link CPP=\"cl -nologo -EP\"
 
-For 64-bit Windows builds, use CC="path/to/msvcc.sh -m64".
-You may also need to specify --build appropriately. When building with MSVC
-under a MingW environment, you may need to remove the line in configure
-that sets 'fix_srcfile_path' to a 'cygpath' command. ('cygpath' is not
-present in MingW, and is not required when using MingW-style paths.)
+For 64-bit Windows builds, use CC="path/to/msvcc.sh -m64" and
+CXX="path/to/msvcc.sh -m64".  You may also need to specify --build
+appropriately.
+
+When building with MSVC under a MingW environment, you may need to
+remove the line in configure that sets 'fix_srcfile_path' to a 'cygpath'
+command.  ('cygpath' is not present in MingW, and is not required when
+using MingW-style paths.)
 
 For iOS builds, the 'libffi.xcodeproj' Xcode project is available.
 
@@ -161,7 +173,20 @@
 History
 =======
 
-See the ChangeLog files for details.
+See the git log for details at http://github.com/atgreen/libffi.
+
+3.1 May-19-14
+        Add AArch64 (ARM64) iOS support.
+        Add Nios II support.
+        Add m88k and DEC VAX support.
+	Add support for stdcall, thiscall, and fastcall on non-Windows
+	  32-bit x86 targets such as Linux.
+	Various Android, MIPS N32, x86, FreeBSD and UltraSPARC IIi
+	  fixes.
+	Make the testsuite more robust: eliminate several spurious
+	  failures, and respect the $CC and $CXX environment variables.
+	Archive off the manually maintained ChangeLog in favor of git
+	  log.
 
 3.0.13 Mar-17-13
 	Add Meta support.
@@ -187,7 +212,6 @@
 
 3.0.11 Apr-11-12
         Lots of build fixes.
-	Add Amiga newer MacOS support.
 	Add support for variadic functions (ffi_prep_cif_var).
 	Add Linux/x32 support.
 	Add thiscall, fastcall and MSVC cdecl support on Windows.
@@ -339,7 +363,7 @@
 Authors & Credits
 =================
 
-libffi was originally written by Anthony Green <green@redhat.com>.
+libffi was originally written by Anthony Green <green@moxielogic.com>.
 
 The developers of the GNU Compiler Collection project have made
 innumerable valuable contributions.  See the ChangeLog file for
@@ -363,10 +387,12 @@
 ia64		Hans Boehm
 m32r		Kazuhiro Inaoka
 m68k		Andreas Schwab
+m88k		Miod Vallat
 microblaze	Nathan Rossi
 mips		Anthony Green, Casey Marshall
 mips64		David Daney
 moxie		Anthony Green
+nios ii		Sandra Loosemore
 pa		Randolph Chung, Dave Anglin, Andreas Tobler
 powerpc		Geoffrey Keating, Andreas Tobler, 
 			 David Edelsohn, John Hornkvist
@@ -376,6 +402,7 @@
 sh64		Kaz Kojima
 sparc		Anthony Green, Gordon Irlam
 tile-gx/tilepro Walter Lee
+vax		Miod Vallat
 x86		Anthony Green, Jon Beniston
 x86-64		Bo Thorsen
 xtensa		Chris Zankel
diff --git a/Modules/_ctypes/libffi/aclocal.m4 b/Modules/_ctypes/libffi/aclocal.m4
index c3ab272..6292fba 100644
--- a/Modules/_ctypes/libffi/aclocal.m4
+++ b/Modules/_ctypes/libffi/aclocal.m4
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.12.2 -*- Autoconf -*-
+# generated automatically by aclocal 1.13.4 -*- Autoconf -*-
 
-# Copyright (C) 1996-2012 Free Software Foundation, Inc.
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -11,6 +11,7 @@
 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 # PARTICULAR PURPOSE.
 
+m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
@@ -837,24 +838,22 @@
 dnl aclocal-1.4 backwards compatibility:
 dnl AC_DEFUN([AC_LTDL_DLSYM_USCORE], [])
 
-# Copyright (C) 2002-2012 Free Software Foundation, Inc.
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 8
-
 # AM_AUTOMAKE_VERSION(VERSION)
 # ----------------------------
 # Automake X.Y traces this macro to ensure aclocal.m4 has been
 # generated from the m4 files accompanying Automake X.Y.
 # (This private macro should not be called outside this file.)
 AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.12'
+[am__api_version='1.13'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.12.2], [],
+m4_if([$1], [1.13.4], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -870,21 +869,19 @@
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.12.2])dnl
+[AM_AUTOMAKE_VERSION([1.13.4])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 
 # Figure out how to run the assembler.                      -*- Autoconf -*-
 
-# Copyright (C) 2001-2012 Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 5
-
 # AM_PROG_AS
 # ----------
 AC_DEFUN([AM_PROG_AS],
@@ -899,14 +896,12 @@
 
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
-# Copyright (C) 2001-2012 Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 2
-
 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
 # $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
 # '$srcdir', '$srcdir/..', or '$srcdir/../..'.
@@ -954,14 +949,12 @@
 
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 
-# Copyright (C) 1997-2012 Free Software Foundation, Inc.
+# Copyright (C) 1997-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 10
-
 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
 # -------------------------------------
 # Define a conditional.
@@ -987,13 +980,12 @@
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 
-# Copyright (C) 1999-2012 Free Software Foundation, Inc.
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 17
 
 # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
 # written in clear, in which case automake, when reading aclocal.m4,
@@ -1179,19 +1171,18 @@
 
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
 
-# Copyright (C) 1999-2012 Free Software Foundation, Inc.
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 6
 
 # _AM_OUTPUT_DEPENDENCY_COMMANDS
 # ------------------------------
 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
 [{
-  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # Older Autoconf quotes --file arguments for eval, but not when files
   # are listed without --file.  Let's play safe and only enable the eval
   # if we detect the quoting.
   case $CONFIG_FILES in
@@ -1220,7 +1211,7 @@
     DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
     test -z "$DEPDIR" && continue
     am__include=`sed -n 's/^am__include = //p' < "$mf"`
-    test -z "am__include" && continue
+    test -z "$am__include" && continue
     am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
     # Find all dependency output files, they are included files with
     # $(DEPDIR) in their names.  We invoke sed twice because it is the
@@ -1256,14 +1247,12 @@
 
 # Do all the work for Automake.                             -*- Autoconf -*-
 
-# Copyright (C) 1996-2012 Free Software Foundation, Inc.
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 19
-
 # This macro actually does too much.  Some checks are only needed if
 # your package does certain things.  But this isn't really a big deal.
 
@@ -1279,7 +1268,7 @@
 # arguments mandatory, and then we can depend on a new Autoconf
 # release and drop the old call support.
 AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.62])dnl
+[AC_PREREQ([2.65])dnl
 dnl Autoconf wants to disallow AM_ names.  We explicitly allow
 dnl the ones we care about.
 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
@@ -1309,8 +1298,7 @@
 dnl Distinguish between old-style and new-style calls.
 m4_ifval([$2],
 [AC_DIAGNOSE([obsolete],
-[$0: two- and three-arguments forms are deprecated.  For more info, see:
-http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_INIT_AUTOMAKE-invocation])
+             [$0: two- and three-arguments forms are deprecated.])
 m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
  AC_SUBST([PACKAGE], [$1])dnl
  AC_SUBST([VERSION], [$2])],
@@ -1364,18 +1352,15 @@
 		  [_AM_DEPENDENCIES([OBJC])],
 		  [m4_define([AC_PROG_OBJC],
 			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
-dnl Support for Objective C++ was only introduced in Autoconf 2.65,
-dnl but we still cater to Autoconf 2.62.
-m4_ifdef([AC_PROG_OBJCXX],
-[AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
+AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
 		  [_AM_DEPENDENCIES([OBJCXX])],
 		  [m4_define([AC_PROG_OBJCXX],
-			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])])dnl
+			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
 ])
-_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
-dnl The 'parallel-tests' driver may need to know about EXEEXT, so add the
-dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
-dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_REQUIRE([AM_SILENT_RULES])dnl
+dnl The testsuite driver may need to know about EXEEXT, so add the
+dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
+dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
 AC_CONFIG_COMMANDS_PRE(dnl
 [m4_provide_if([_AM_COMPILER_EXEEXT],
   [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
@@ -1409,14 +1394,12 @@
 done
 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
 
-# Copyright (C) 2001-2012 Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 8
-
 # AM_PROG_INSTALL_SH
 # ------------------
 # Define $install_sh.
@@ -1432,14 +1415,12 @@
 fi
 AC_SUBST([install_sh])])
 
-# Copyright (C) 2003-2012 Free Software Foundation, Inc.
+# Copyright (C) 2003-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 2
-
 # Check whether the underlying file-system supports filenames
 # with a leading dot.  For instance MS-DOS doesn't.
 AC_DEFUN([AM_SET_LEADING_DOT],
@@ -1456,14 +1437,12 @@
 # Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
 # From Jim Meyering
 
-# Copyright (C) 1996-2012 Free Software Foundation, Inc.
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 7
-
 # AM_MAINTAINER_MODE([DEFAULT-MODE])
 # ----------------------------------
 # Control maintainer-specific portions of Makefiles.
@@ -1491,18 +1470,14 @@
 ]
 )
 
-AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
-
 # Check to see how 'make' treats includes.	            -*- Autoconf -*-
 
-# Copyright (C) 2001-2012 Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 5
-
 # AM_MAKE_INCLUDE()
 # -----------------
 # Check to see how make treats includes.
@@ -1545,14 +1520,12 @@
 rm -f confinc confmf
 ])
 
-# Copyright (C) 1999-2012 Free Software Foundation, Inc.
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 6
-
 # AM_PROG_CC_C_O
 # --------------
 # Like AC_PROG_CC_C_O, but changed for automake.
@@ -1581,14 +1554,12 @@
 
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 
-# Copyright (C) 1997-2012 Free Software Foundation, Inc.
+# Copyright (C) 1997-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 7
-
 # AM_MISSING_PROG(NAME, PROGRAM)
 # ------------------------------
 AC_DEFUN([AM_MISSING_PROG],
@@ -1596,11 +1567,10 @@
 $1=${$1-"${am_missing_run}$2"}
 AC_SUBST($1)])
 
-
 # AM_MISSING_HAS_RUN
 # ------------------
-# Define MISSING if not defined so far and test if it supports --run.
-# If it does, set am_missing_run to use it, otherwise, to nothing.
+# Define MISSING if not defined so far and test if it is modern enough.
+# If it is, set am_missing_run to use it, otherwise, to nothing.
 AC_DEFUN([AM_MISSING_HAS_RUN],
 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
 AC_REQUIRE_AUX_FILE([missing])dnl
@@ -1613,8 +1583,8 @@
   esac
 fi
 # Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
-  am_missing_run="$MISSING --run "
+if eval "$MISSING --is-lightweight"; then
+  am_missing_run="$MISSING "
 else
   am_missing_run=
   AC_MSG_WARN(['missing' script is too old or missing])
@@ -1623,14 +1593,12 @@
 
 # Helper functions for option handling.                     -*- Autoconf -*-
 
-# Copyright (C) 2001-2012 Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 6
-
 # _AM_MANGLE_OPTION(NAME)
 # -----------------------
 AC_DEFUN([_AM_MANGLE_OPTION],
@@ -1656,14 +1624,12 @@
 
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
-# Copyright (C) 1996-2012 Free Software Foundation, Inc.
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 9
-
 # AM_SANITY_CHECK
 # ---------------
 AC_DEFUN([AM_SANITY_CHECK],
@@ -1739,13 +1705,71 @@
 rm -f conftest.file
 ])
 
-# Copyright (C) 2001-2012 Free Software Foundation, Inc.
+# Copyright (C) 2009-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 2
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# ("yes" being less verbose, "no" or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_ARG_ENABLE([silent-rules], [dnl
+AS_HELP_STRING(
+  [--enable-silent-rules],
+  [less verbose build output (undo: "make V=1")])
+AS_HELP_STRING(
+  [--disable-silent-rules],
+  [verbose build output (undo: "make V=0")])dnl
+])
+case $enable_silent_rules in @%:@ (((
+  yes) AM_DEFAULT_VERBOSITY=0;;
+   no) AM_DEFAULT_VERBOSITY=1;;
+    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+esac
+dnl
+dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
+dnl do not support nested variable expansions.
+dnl See automake bug#9928 and bug#10237.
+am_make=${MAKE-make}
+AC_CACHE_CHECK([whether $am_make supports nested variables],
+   [am_cv_make_support_nested_variables],
+   [if AS_ECHO([['TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+	@$(TRUE)
+.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
+  am_cv_make_support_nested_variables=yes
+else
+  am_cv_make_support_nested_variables=no
+fi])
+if test $am_cv_make_support_nested_variables = yes; then
+  dnl Using '$V' instead of '$(V)' breaks IRIX make.
+  AM_V='$(V)'
+  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+  AM_V=$AM_DEFAULT_VERBOSITY
+  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AC_SUBST([AM_V])dnl
+AM_SUBST_NOTMAKE([AM_V])dnl
+AC_SUBST([AM_DEFAULT_V])dnl
+AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
+AM_BACKSLASH='\'
+AC_SUBST([AM_BACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+])
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
 
 # AM_PROG_INSTALL_STRIP
 # ---------------------
@@ -1769,14 +1793,12 @@
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
-# Copyright (C) 2006-2012 Free Software Foundation, Inc.
+# Copyright (C) 2006-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 3
-
 # _AM_SUBST_NOTMAKE(VARIABLE)
 # ---------------------------
 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
@@ -1790,14 +1812,12 @@
 
 # Check how to create a tarball.                            -*- Autoconf -*-
 
-# Copyright (C) 2004-2012 Free Software Foundation, Inc.
+# Copyright (C) 2004-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 3
-
 # _AM_PROG_TAR(FORMAT)
 # --------------------
 # Check how to create a tarball in format FORMAT.
@@ -1811,76 +1831,114 @@
 # Substitute a variable $(am__untar) that extract such
 # a tarball read from stdin.
 #     $(am__untar) < result.tar
+#
 AC_DEFUN([_AM_PROG_TAR],
 [# Always define AMTAR for backward compatibility.  Yes, it's still used
 # in the wild :-(  We should find a proper way to deprecate it ...
 AC_SUBST([AMTAR], ['$${TAR-tar}'])
-m4_if([$1], [v7],
-     [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
-     [m4_case([$1], [ustar],, [pax],,
-              [m4_fatal([Unknown tar format])])
-AC_MSG_CHECKING([how to create a $1 tar archive])
-# Loop over all known methods to create a tar archive until one works.
+
+# We'll loop over all known methods to create a tar archive until one works.
 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
-_am_tools=${am_cv_prog_tar_$1-$_am_tools}
-# Do not fold the above two line into one, because Tru64 sh and
-# Solaris sh will not grok spaces in the rhs of '-'.
-for _am_tool in $_am_tools
-do
-  case $_am_tool in
-  gnutar)
-    for _am_tar in tar gnutar gtar;
-    do
-      AM_RUN_LOG([$_am_tar --version]) && break
-    done
-    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
-    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
-    am__untar="$_am_tar -xf -"
-    ;;
-  plaintar)
-    # Must skip GNU tar: if it does not support --format= it doesn't create
-    # ustar tarball either.
-    (tar --version) >/dev/null 2>&1 && continue
-    am__tar='tar chf - "$$tardir"'
-    am__tar_='tar chf - "$tardir"'
-    am__untar='tar xf -'
-    ;;
-  pax)
-    am__tar='pax -L -x $1 -w "$$tardir"'
-    am__tar_='pax -L -x $1 -w "$tardir"'
-    am__untar='pax -r'
-    ;;
-  cpio)
-    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
-    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
-    am__untar='cpio -i -H $1 -d'
-    ;;
-  none)
-    am__tar=false
-    am__tar_=false
-    am__untar=false
-    ;;
-  esac
 
-  # If the value was cached, stop now.  We just wanted to have am__tar
-  # and am__untar set.
-  test -n "${am_cv_prog_tar_$1}" && break
+m4_if([$1], [v7],
+  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
 
-  # tar/untar a dummy directory, and stop if the command works
+  [m4_case([$1],
+    [ustar],
+     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
+      # There is notably a 21 bits limit for the UID and the GID.  In fact,
+      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
+      # and bug#13588).
+      am_max_uid=2097151 # 2^21 - 1
+      am_max_gid=$am_max_uid
+      # The $UID and $GID variables are not portable, so we need to resort
+      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
+      # below are definitely unexpected, so allow the users to see them
+      # (that is, avoid stderr redirection).
+      am_uid=`id -u || echo unknown`
+      am_gid=`id -g || echo unknown`
+      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
+      if test $am_uid -le $am_max_uid; then
+         AC_MSG_RESULT([yes])
+      else
+         AC_MSG_RESULT([no])
+         _am_tools=none
+      fi
+      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
+      if test $am_gid -le $am_max_gid; then
+         AC_MSG_RESULT([yes])
+      else
+        AC_MSG_RESULT([no])
+        _am_tools=none
+      fi],
+
+  [pax],
+    [],
+
+  [m4_fatal([Unknown tar format])])
+
+  AC_MSG_CHECKING([how to create a $1 tar archive])
+
+  # Go ahead even if we have the value already cached.  We do so because we
+  # need to set the values for the 'am__tar' and 'am__untar' variables.
+  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
+
+  for _am_tool in $_am_tools; do
+    case $_am_tool in
+    gnutar)
+      for _am_tar in tar gnutar gtar; do
+        AM_RUN_LOG([$_am_tar --version]) && break
+      done
+      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+      am__untar="$_am_tar -xf -"
+      ;;
+    plaintar)
+      # Must skip GNU tar: if it does not support --format= it doesn't create
+      # ustar tarball either.
+      (tar --version) >/dev/null 2>&1 && continue
+      am__tar='tar chf - "$$tardir"'
+      am__tar_='tar chf - "$tardir"'
+      am__untar='tar xf -'
+      ;;
+    pax)
+      am__tar='pax -L -x $1 -w "$$tardir"'
+      am__tar_='pax -L -x $1 -w "$tardir"'
+      am__untar='pax -r'
+      ;;
+    cpio)
+      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+      am__untar='cpio -i -H $1 -d'
+      ;;
+    none)
+      am__tar=false
+      am__tar_=false
+      am__untar=false
+      ;;
+    esac
+
+    # If the value was cached, stop now.  We just wanted to have am__tar
+    # and am__untar set.
+    test -n "${am_cv_prog_tar_$1}" && break
+
+    # tar/untar a dummy directory, and stop if the command works.
+    rm -rf conftest.dir
+    mkdir conftest.dir
+    echo GrepMe > conftest.dir/file
+    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+    rm -rf conftest.dir
+    if test -s conftest.tar; then
+      AM_RUN_LOG([$am__untar <conftest.tar])
+      AM_RUN_LOG([cat conftest.dir/file])
+      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+    fi
+  done
   rm -rf conftest.dir
-  mkdir conftest.dir
-  echo GrepMe > conftest.dir/file
-  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
-  rm -rf conftest.dir
-  if test -s conftest.tar; then
-    AM_RUN_LOG([$am__untar <conftest.tar])
-    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
-  fi
-done
-rm -rf conftest.dir
 
-AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
-AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+
 AC_SUBST([am__tar])
 AC_SUBST([am__untar])
 ]) # _AM_PROG_TAR
diff --git a/Modules/_ctypes/libffi/build-ios.sh b/Modules/_ctypes/libffi/build-ios.sh
deleted file mode 100755
index 3dea242..0000000
--- a/Modules/_ctypes/libffi/build-ios.sh
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/bin/sh
-
-PLATFORM_IOS=/Developer/Platforms/iPhoneOS.platform/
-PLATFORM_IOS_SIM=/Developer/Platforms/iPhoneSimulator.platform/
-SDK_IOS_VERSION="4.2"
-MIN_IOS_VERSION="3.0"
-OUTPUT_DIR="universal-ios"
-
-build_target () {
-    local platform=$1
-    local sdk=$2
-    local arch=$3
-    local triple=$4
-    local builddir=$5
-
-    mkdir -p "${builddir}"
-    pushd "${builddir}"
-    export CC="${platform}"/Developer/usr/bin/gcc-4.2
-    export CFLAGS="-arch ${arch} -isysroot ${sdk} -miphoneos-version-min=${MIN_IOS_VERSION}"
-    ../configure --host=${triple} && make
-    popd
-}
-
-# Build all targets
-build_target "${PLATFORM_IOS}" "${PLATFORM_IOS}/Developer/SDKs/iPhoneOS${SDK_IOS_VERSION}.sdk/" armv6 arm-apple-darwin10 armv6-ios
-build_target "${PLATFORM_IOS}" "${PLATFORM_IOS}/Developer/SDKs/iPhoneOS${SDK_IOS_VERSION}.sdk/" armv7 arm-apple-darwin10 armv7-ios
-build_target "${PLATFORM_IOS_SIM}" "${PLATFORM_IOS_SIM}/Developer/SDKs/iPhoneSimulator${SDK_IOS_VERSION}.sdk/" i386 i386-apple-darwin10 i386-ios-sim
-
-# Create universal output directories
-mkdir -p "${OUTPUT_DIR}"
-mkdir -p "${OUTPUT_DIR}/include"
-mkdir -p "${OUTPUT_DIR}/include/armv6"
-mkdir -p "${OUTPUT_DIR}/include/armv7"
-mkdir -p "${OUTPUT_DIR}/include/i386"
-
-# Create the universal binary
-lipo -create armv6-ios/.libs/libffi.a armv7-ios/.libs/libffi.a i386-ios-sim/.libs/libffi.a -output "${OUTPUT_DIR}/libffi.a"
-
-# Copy in the headers
-copy_headers () {
-    local src=$1
-    local dest=$2
-
-    # Fix non-relative header reference
-    sed 's/<ffitarget.h>/"ffitarget.h"/' < "${src}/include/ffi.h" > "${dest}/ffi.h"
-    cp "${src}/include/ffitarget.h" "${dest}"
-}
-
-copy_headers armv6-ios "${OUTPUT_DIR}/include/armv6"
-copy_headers armv7-ios "${OUTPUT_DIR}/include/armv7"
-copy_headers i386-ios-sim "${OUTPUT_DIR}/include/i386"
-
-# Create top-level header
-(
-cat << EOF
-#ifdef __arm__
-  #include <arm/arch.h>
-  #ifdef _ARM_ARCH_6
-    #include "include/armv6/ffi.h"
-  #elif _ARM_ARCH_7
-    #include "include/armv7/ffi.h"
-  #endif
-#elif defined(__i386__)
-  #include "include/i386/ffi.h"
-#endif
-EOF
-) > "${OUTPUT_DIR}/ffi.h"
diff --git a/Modules/_ctypes/libffi/compile b/Modules/_ctypes/libffi/compile
index c0096a7..531136b 100755
--- a/Modules/_ctypes/libffi/compile
+++ b/Modules/_ctypes/libffi/compile
@@ -1,10 +1,9 @@
 #! /bin/sh
-# Wrapper for compilers which do not understand `-c -o'.
+# Wrapper for compilers which do not understand '-c -o'.
 
-scriptversion=2009-10-06.20; # UTC
+scriptversion=2012-10-14.11; # UTC
 
-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009  Free Software
-# Foundation, Inc.
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
 # Written by Tom Tromey <tromey@cygnus.com>.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -29,21 +28,224 @@
 # bugs to <bug-automake@gnu.org> or send patches to
 # <automake-patches@gnu.org>.
 
+nl='
+'
+
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent tools from complaining about whitespace usage.
+IFS=" ""	$nl"
+
+file_conv=
+
+# func_file_conv build_file lazy
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Windows hosts. If the determined conversion
+# type is listed in (the comma separated) LAZY, no conversion will
+# take place.
+func_file_conv ()
+{
+  file=$1
+  case $file in
+    / | /[!/]*) # absolute file, and not a UNC file
+      if test -z "$file_conv"; then
+	# lazily determine how to convert abs files
+	case `uname -s` in
+	  MINGW*)
+	    file_conv=mingw
+	    ;;
+	  CYGWIN*)
+	    file_conv=cygwin
+	    ;;
+	  *)
+	    file_conv=wine
+	    ;;
+	esac
+      fi
+      case $file_conv/,$2, in
+	*,$file_conv,*)
+	  ;;
+	mingw/*)
+	  file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+	  ;;
+	cygwin/*)
+	  file=`cygpath -m "$file" || echo "$file"`
+	  ;;
+	wine/*)
+	  file=`winepath -w "$file" || echo "$file"`
+	  ;;
+      esac
+      ;;
+  esac
+}
+
+# func_cl_dashL linkdir
+# Make cl look for libraries in LINKDIR
+func_cl_dashL ()
+{
+  func_file_conv "$1"
+  if test -z "$lib_path"; then
+    lib_path=$file
+  else
+    lib_path="$lib_path;$file"
+  fi
+  linker_opts="$linker_opts -LIBPATH:$file"
+}
+
+# func_cl_dashl library
+# Do a library search-path lookup for cl
+func_cl_dashl ()
+{
+  lib=$1
+  found=no
+  save_IFS=$IFS
+  IFS=';'
+  for dir in $lib_path $LIB
+  do
+    IFS=$save_IFS
+    if $shared && test -f "$dir/$lib.dll.lib"; then
+      found=yes
+      lib=$dir/$lib.dll.lib
+      break
+    fi
+    if test -f "$dir/$lib.lib"; then
+      found=yes
+      lib=$dir/$lib.lib
+      break
+    fi
+    if test -f "$dir/lib$lib.a"; then
+      found=yes
+      lib=$dir/lib$lib.a
+      break
+    fi
+  done
+  IFS=$save_IFS
+
+  if test "$found" != yes; then
+    lib=$lib.lib
+  fi
+}
+
+# func_cl_wrapper cl arg...
+# Adjust compile command to suit cl
+func_cl_wrapper ()
+{
+  # Assume a capable shell
+  lib_path=
+  shared=:
+  linker_opts=
+  for arg
+  do
+    if test -n "$eat"; then
+      eat=
+    else
+      case $1 in
+	-o)
+	  # configure might choose to run compile as 'compile cc -o foo foo.c'.
+	  eat=1
+	  case $2 in
+	    *.o | *.[oO][bB][jJ])
+	      func_file_conv "$2"
+	      set x "$@" -Fo"$file"
+	      shift
+	      ;;
+	    *)
+	      func_file_conv "$2"
+	      set x "$@" -Fe"$file"
+	      shift
+	      ;;
+	  esac
+	  ;;
+	-I)
+	  eat=1
+	  func_file_conv "$2" mingw
+	  set x "$@" -I"$file"
+	  shift
+	  ;;
+	-I*)
+	  func_file_conv "${1#-I}" mingw
+	  set x "$@" -I"$file"
+	  shift
+	  ;;
+	-l)
+	  eat=1
+	  func_cl_dashl "$2"
+	  set x "$@" "$lib"
+	  shift
+	  ;;
+	-l*)
+	  func_cl_dashl "${1#-l}"
+	  set x "$@" "$lib"
+	  shift
+	  ;;
+	-L)
+	  eat=1
+	  func_cl_dashL "$2"
+	  ;;
+	-L*)
+	  func_cl_dashL "${1#-L}"
+	  ;;
+	-static)
+	  shared=false
+	  ;;
+	-Wl,*)
+	  arg=${1#-Wl,}
+	  save_ifs="$IFS"; IFS=','
+	  for flag in $arg; do
+	    IFS="$save_ifs"
+	    linker_opts="$linker_opts $flag"
+	  done
+	  IFS="$save_ifs"
+	  ;;
+	-Xlinker)
+	  eat=1
+	  linker_opts="$linker_opts $2"
+	  ;;
+	-*)
+	  set x "$@" "$1"
+	  shift
+	  ;;
+	*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
+	  func_file_conv "$1"
+	  set x "$@" -Tp"$file"
+	  shift
+	  ;;
+	*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
+	  func_file_conv "$1" mingw
+	  set x "$@" "$file"
+	  shift
+	  ;;
+	*)
+	  set x "$@" "$1"
+	  shift
+	  ;;
+      esac
+    fi
+    shift
+  done
+  if test -n "$linker_opts"; then
+    linker_opts="-link$linker_opts"
+  fi
+  exec "$@" $linker_opts
+  exit 1
+}
+
+eat=
+
 case $1 in
   '')
-     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     echo "$0: No command.  Try '$0 --help' for more information." 1>&2
      exit 1;
      ;;
   -h | --h*)
     cat <<\EOF
 Usage: compile [--help] [--version] PROGRAM [ARGS]
 
-Wrapper for compilers which do not understand `-c -o'.
-Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
+Wrapper for compilers which do not understand '-c -o'.
+Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
 arguments, and rename the output as expected.
 
 If you are trying to build a whole package this is not the
-right script to run: please start by reading the file `INSTALL'.
+right script to run: please start by reading the file 'INSTALL'.
 
 Report bugs to <bug-automake@gnu.org>.
 EOF
@@ -53,11 +255,13 @@
     echo "compile $scriptversion"
     exit $?
     ;;
+  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
+    func_cl_wrapper "$@"      # Doesn't return...
+    ;;
 esac
 
 ofile=
 cfile=
-eat=
 
 for arg
 do
@@ -66,8 +270,8 @@
   else
     case $1 in
       -o)
-	# configure might choose to run compile as `compile cc -o foo foo.c'.
-	# So we strip `-o arg' only if arg is an object.
+	# configure might choose to run compile as 'compile cc -o foo foo.c'.
+	# So we strip '-o arg' only if arg is an object.
 	eat=1
 	case $2 in
 	  *.o | *.obj)
@@ -94,10 +298,10 @@
 done
 
 if test -z "$ofile" || test -z "$cfile"; then
-  # If no `-o' option was seen then we might have been invoked from a
+  # If no '-o' option was seen then we might have been invoked from a
   # pattern rule where we don't need one.  That is ok -- this is a
   # normal compilation that the losing compiler can handle.  If no
-  # `.c' file was seen then we are probably linking.  That is also
+  # '.c' file was seen then we are probably linking.  That is also
   # ok.
   exec "$@"
 fi
@@ -106,7 +310,7 @@
 cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
 
 # Create the lock directory.
-# Note: use `[/\\:.-]' here to ensure that we don't use the same name
+# Note: use '[/\\:.-]' here to ensure that we don't use the same name
 # that we are using for the .o file.  Also, base the name on the expected
 # object file name, since that is what matters with a parallel build.
 lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
diff --git a/Modules/_ctypes/libffi/config.guess b/Modules/_ctypes/libffi/config.guess
index 1804e9f..b79252d 100755
--- a/Modules/_ctypes/libffi/config.guess
+++ b/Modules/_ctypes/libffi/config.guess
@@ -1,10 +1,8 @@
 #! /bin/sh
 # 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, 2012, 2013 Free Software Foundation, Inc.
+#   Copyright 1992-2013 Free Software Foundation, Inc.
 
-timestamp='2012-12-29'
+timestamp='2013-06-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
@@ -26,7 +24,7 @@
 # program.  This Exception is an additional permission under section 7
 # of the GNU General Public License, version 3 ("GPLv3").
 #
-# Originally written by Per Bothner. 
+# Originally written by Per Bothner.
 #
 # You can get the latest version of this script from:
 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
@@ -52,9 +50,7 @@
 GNU config.guess ($timestamp)
 
 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,
-2012, 2013 Free Software Foundation, Inc.
+Copyright 1992-2013 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."
@@ -136,6 +132,27 @@
 UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
+case "${UNAME_SYSTEM}" in
+Linux|GNU|GNU/*)
+	# If the system lacks a compiler, then just pick glibc.
+	# We could probably try harder.
+	LIBC=gnu
+
+	eval $set_cc_for_build
+	cat <<-EOF > $dummy.c
+	#include <features.h>
+	#if defined(__UCLIBC__)
+	LIBC=uclibc
+	#elif defined(__dietlibc__)
+	LIBC=dietlibc
+	#else
+	LIBC=gnu
+	#endif
+	EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+	;;
+esac
+
 # Note: order is significant - the case branches are not exclusive.
 
 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
@@ -857,21 +874,21 @@
 	exit ;;
     *:GNU:*:*)
 	# the GNU system
-	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
 	exit ;;
     *:GNU/*:*:*)
 	# other systems with GNU libc and userland
-	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
 	exit ;;
     i*86:Minix:*:*)
 	echo ${UNAME_MACHINE}-pc-minix
 	exit ;;
     aarch64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     aarch64_be:Linux:*:*)
 	UNAME_MACHINE=aarch64_be
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     alpha:Linux:*:*)
 	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
@@ -884,59 +901,54 @@
 	  EV68*) UNAME_MACHINE=alphaev68 ;;
 	esac
 	objdump --private-headers /bin/sh | grep -q ld.so.1
-	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
-	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+	if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
+    arc:Linux:*:* | arceb:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     arm*:Linux:*:*)
 	eval $set_cc_for_build
 	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
 	    | grep -q __ARM_EABI__
 	then
-	    echo ${UNAME_MACHINE}-unknown-linux-gnu
+	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	else
 	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
 		| grep -q __ARM_PCS_VFP
 	    then
-		echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
 	    else
-		echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
+		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
 	    fi
 	fi
 	exit ;;
     avr32*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     cris:Linux:*:*)
-	echo ${UNAME_MACHINE}-axis-linux-gnu
+	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
 	exit ;;
     crisv32:Linux:*:*)
-	echo ${UNAME_MACHINE}-axis-linux-gnu
+	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
 	exit ;;
     frv:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     hexagon:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     i*86:Linux:*:*)
-	LIBC=gnu
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
-	#ifdef __dietlibc__
-	LIBC=dietlibc
-	#endif
-EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
-	echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+	echo ${UNAME_MACHINE}-pc-linux-${LIBC}
 	exit ;;
     ia64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     m32r*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     m68*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     mips:Linux:*:* | mips64:Linux:*:*)
 	eval $set_cc_for_build
@@ -955,54 +967,63 @@
 	#endif
 EOF
 	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
-	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
 	;;
+    or1k:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
     or32:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     padre:Linux:*:*)
-	echo sparc-unknown-linux-gnu
+	echo sparc-unknown-linux-${LIBC}
 	exit ;;
     parisc64:Linux:*:* | hppa64:Linux:*:*)
-	echo hppa64-unknown-linux-gnu
+	echo hppa64-unknown-linux-${LIBC}
 	exit ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
 	# Look for CPU level
 	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
-	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
-	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
-	  *)    echo hppa-unknown-linux-gnu ;;
+	  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
+	  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
+	  *)    echo hppa-unknown-linux-${LIBC} ;;
 	esac
 	exit ;;
     ppc64:Linux:*:*)
-	echo powerpc64-unknown-linux-gnu
+	echo powerpc64-unknown-linux-${LIBC}
 	exit ;;
     ppc:Linux:*:*)
-	echo powerpc-unknown-linux-gnu
+	echo powerpc-unknown-linux-${LIBC}
+	exit ;;
+    ppc64le:Linux:*:*)
+	echo powerpc64le-unknown-linux-${LIBC}
+	exit ;;
+    ppcle:Linux:*:*)
+	echo powerpcle-unknown-linux-${LIBC}
 	exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
-	echo ${UNAME_MACHINE}-ibm-linux
+	echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
 	exit ;;
     sh64*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     sh*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     sparc:Linux:*:* | sparc64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     tile*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     vax:Linux:*:*)
-	echo ${UNAME_MACHINE}-dec-linux-gnu
+	echo ${UNAME_MACHINE}-dec-linux-${LIBC}
 	exit ;;
     x86_64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     xtensa*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     i*86:DYNIX/ptx:4*:*)
 	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@@ -1235,19 +1256,21 @@
 	exit ;;
     *:Darwin:*:*)
 	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
-	case $UNAME_PROCESSOR in
-	    i386)
-		eval $set_cc_for_build
-		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
-		  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
-		      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
-		      grep IS_64BIT_ARCH >/dev/null
-		  then
-		      UNAME_PROCESSOR="x86_64"
-		  fi
-		fi ;;
-	    unknown) UNAME_PROCESSOR=powerpc ;;
-	esac
+	eval $set_cc_for_build
+	if test "$UNAME_PROCESSOR" = unknown ; then
+	    UNAME_PROCESSOR=powerpc
+	fi
+	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+	    if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+		grep IS_64BIT_ARCH >/dev/null
+	    then
+		case $UNAME_PROCESSOR in
+		    i386) UNAME_PROCESSOR=x86_64 ;;
+		    powerpc) UNAME_PROCESSOR=powerpc64 ;;
+		esac
+	    fi
+	fi
 	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
 	exit ;;
     *:procnto*:*:* | *:QNX:[0123456789]*:*)
diff --git a/Modules/_ctypes/libffi/config.sub b/Modules/_ctypes/libffi/config.sub
index 802a224..c765b34 100755
--- a/Modules/_ctypes/libffi/config.sub
+++ b/Modules/_ctypes/libffi/config.sub
@@ -1,10 +1,8 @@
 #! /bin/sh
 # 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, 2012, 2013 Free Software Foundation, Inc.
+#   Copyright 1992-2013 Free Software Foundation, Inc.
 
-timestamp='2012-12-29'
+timestamp='2013-04-24'
 
 # 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
@@ -70,9 +68,7 @@
 version="\
 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,
-2012, 2013 Free Software Foundation, Inc.
+Copyright 1992-2013 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."
@@ -256,7 +252,7 @@
 	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
 	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
 	| am33_2.0 \
-	| arc \
+	| arc | arceb \
 	| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
 	| avr | avr32 \
 	| be32 | be64 \
@@ -290,16 +286,17 @@
 	| mipsisa64r2 | mipsisa64r2el \
 	| mipsisa64sb1 | mipsisa64sb1el \
 	| mipsisa64sr71k | mipsisa64sr71kel \
+	| mipsr5900 | mipsr5900el \
 	| mipstx39 | mipstx39el \
 	| mn10200 | mn10300 \
 	| moxie \
 	| mt \
 	| msp430 \
 	| nds32 | nds32le | nds32be \
-	| nios | nios2 \
+	| nios | nios2 | nios2eb | nios2el \
 	| ns16k | ns32k \
 	| open8 \
-	| or32 \
+	| or1k | or32 \
 	| pdp10 | pdp11 | pj | pjl \
 	| powerpc | powerpc64 | powerpc64le | powerpcle \
 	| pyramid \
@@ -369,7 +366,7 @@
 	| aarch64-* | aarch64_be-* \
 	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
 	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
-	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
 	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
 	| avr-* | avr32-* \
 	| be32-* | be64-* \
@@ -407,12 +404,13 @@
 	| mipsisa64r2-* | mipsisa64r2el-* \
 	| mipsisa64sb1-* | mipsisa64sb1el-* \
 	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
+	| mipsr5900-* | mipsr5900el-* \
 	| mipstx39-* | mipstx39el-* \
 	| mmix-* \
 	| mt-* \
 	| msp430-* \
 	| nds32-* | nds32le-* | nds32be-* \
-	| nios-* | nios2-* \
+	| nios-* | nios2-* | nios2eb-* | nios2el-* \
 	| none-* | np1-* | ns16k-* | ns32k-* \
 	| open8-* \
 	| orion-* \
@@ -1008,7 +1006,7 @@
 		;;
 	ppc64)	basic_machine=powerpc64-unknown
 		;;
-	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+	ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
 		;;
 	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
 		basic_machine=powerpc64le-unknown
@@ -1354,7 +1352,7 @@
 	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
 	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
 	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
-	      | -sym* | -kopensolaris* \
+	      | -sym* | -kopensolaris* | -plan9* \
 	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
 	      | -aos* | -aros* \
 	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
@@ -1500,9 +1498,6 @@
 	-aros*)
 		os=-aros
 		;;
-	-kaos*)
-		os=-kaos
-		;;
 	-zvmoe)
 		os=-zvmoe
 		;;
@@ -1594,6 +1589,9 @@
 	mips*-*)
 		os=-elf
 		;;
+	or1k-*)
+		os=-elf
+		;;
 	or32-*)
 		os=-coff
 		;;
diff --git a/Modules/_ctypes/libffi/configure b/Modules/_ctypes/libffi/configure
index 8230830..75f62a7 100755
--- a/Modules/_ctypes/libffi/configure
+++ b/Modules/_ctypes/libffi/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for libffi 3.0.13.
+# Generated by GNU Autoconf 2.69 for libffi 3.1.
 #
 # Report bugs to <http://github.com/atgreen/libffi/issues>.
 #
@@ -590,8 +590,8 @@
 # Identity of this package.
 PACKAGE_NAME='libffi'
 PACKAGE_TARNAME='libffi'
-PACKAGE_VERSION='3.0.13'
-PACKAGE_STRING='libffi 3.0.13'
+PACKAGE_VERSION='3.1'
+PACKAGE_STRING='libffi 3.1'
 PACKAGE_BUGREPORT='http://github.com/atgreen/libffi/issues'
 PACKAGE_URL=''
 
@@ -645,10 +645,13 @@
 FFI_EXEC_TRAMPOLINE_TABLE_FALSE
 FFI_EXEC_TRAMPOLINE_TABLE_TRUE
 sys_symbol_underscore
+HAVE_LONG_DOUBLE_VARIANT
 HAVE_LONG_DOUBLE
 ALLOCA
 XTENSA_FALSE
 XTENSA_TRUE
+VAX_FALSE
+VAX_TRUE
 TILE_FALSE
 TILE_TRUE
 PA64_HPUX_FALSE
@@ -673,6 +676,8 @@
 AVR32_TRUE
 ARM_FALSE
 ARM_TRUE
+ARC_FALSE
+ARC_TRUE
 AARCH64_FALSE
 AARCH64_TRUE
 POWERPC_FREEBSD_FALSE
@@ -683,12 +688,16 @@
 POWERPC_AIX_TRUE
 POWERPC_FALSE
 POWERPC_TRUE
+NIOS2_FALSE
+NIOS2_TRUE
 MOXIE_FALSE
 MOXIE_TRUE
 METAG_FALSE
 METAG_TRUE
 MICROBLAZE_FALSE
 MICROBLAZE_TRUE
+M88K_FALSE
+M88K_TRUE
 M68K_FALSE
 M68K_TRUE
 M32R_FALSE
@@ -697,6 +706,10 @@
 IA64_TRUE
 ALPHA_FALSE
 ALPHA_TRUE
+X86_DARWIN64_FALSE
+X86_DARWIN64_TRUE
+X86_DARWIN32_FALSE
+X86_DARWIN32_TRUE
 X86_DARWIN_FALSE
 X86_DARWIN_TRUE
 X86_WIN64_FALSE
@@ -721,6 +734,7 @@
 MAINTAINER_MODE_FALSE
 MAINTAINER_MODE_TRUE
 PRTDIAG
+CXXCPP
 CPP
 OTOOL64
 OTOOL
@@ -748,6 +762,12 @@
 CCASDEPMODE
 CCASFLAGS
 CCAS
+am__fastdepCXX_FALSE
+am__fastdepCXX_TRUE
+CXXDEPMODE
+ac_ct_CXX
+CXXFLAGS
+CXX
 am__fastdepCC_FALSE
 am__fastdepCC_TRUE
 CCDEPMODE
@@ -765,6 +785,10 @@
 LDFLAGS
 CFLAGS
 CC
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+AM_DEFAULT_V
+AM_V
 am__untar
 am__tar
 AMTAR
@@ -843,6 +867,7 @@
 ac_user_opts='
 enable_option_checking
 enable_builddir
+enable_silent_rules
 enable_dependency_tracking
 enable_shared
 enable_static
@@ -866,7 +891,8 @@
 CCAS
 CCASFLAGS
 CPP
-CPPFLAGS'
+CPPFLAGS
+CXXCPP'
 
 
 # Initialize some variables set by options.
@@ -1407,7 +1433,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures libffi 3.0.13 to adapt to many kinds of systems.
+\`configure' configures libffi 3.1 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1478,7 +1504,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of libffi 3.0.13:";;
+     short | recursive ) echo "Configuration of libffi 3.1:";;
    esac
   cat <<\_ACEOF
 
@@ -1488,6 +1514,8 @@
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
   --disable-builddir      disable automatic build in subdir of sources
 
+  --enable-silent-rules   less verbose build output (undo: "make V=1")
+  --disable-silent-rules  verbose build output (undo: "make V=0")
   --enable-dependency-tracking
                           do not reject slow dependency extractors
   --disable-dependency-tracking
@@ -1515,8 +1543,8 @@
   --with-pic[=PKGS]       try to use only PIC/non-PIC objects [default=use
                           both]
   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
-  --with-sysroot=DIR Search for dependent libraries within DIR
-                        (or the compiler's sysroot if not specified).
+  --with-sysroot[=DIR]    Search for dependent libraries within DIR (or the
+                          compiler's sysroot if not specified).
   --with-gcc-arch=<arch>  use architecture <arch> for gcc -march/-mtune,
                           instead of guessing
 
@@ -1528,9 +1556,12 @@
   LIBS        libraries to pass to the linker, e.g. -l<library>
   CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
               you have headers in a nonstandard directory <include dir>
+  CXX         C++ compiler command
+  CXXFLAGS    C++ compiler flags
   CCAS        assembler compiler command (defaults to CC)
   CCASFLAGS   assembler compiler flags (defaults to CFLAGS)
   CPP         C preprocessor
+  CXXCPP      C++ preprocessor
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
@@ -1598,7 +1629,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-libffi configure 3.0.13
+libffi configure 3.1
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1650,6 +1681,44 @@
 
 } # ac_fn_c_try_compile
 
+# ac_fn_cxx_try_compile LINENO
+# ----------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_cxx_try_compile
+
 # ac_fn_c_try_link LINENO
 # -----------------------
 # Try to link conftest.$ac_ext, and return whether this succeeded.
@@ -1873,6 +1942,89 @@
 
 } # ac_fn_c_check_func
 
+# ac_fn_cxx_try_cpp LINENO
+# ------------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } > conftest.i && {
+	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_cxx_try_cpp
+
+# ac_fn_cxx_try_link LINENO
+# -------------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_link ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext conftest$ac_exeext
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 test -x conftest$ac_exeext
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+  # interfere with the next link command; also delete a directory that is
+  # left behind by Apple's compiler.  We do this before executing the actions.
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_cxx_try_link
+
 # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
 # --------------------------------------------
 # Tries to find the compile-time value of EXPR in a program that includes
@@ -2204,7 +2356,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by libffi $as_me 3.0.13, which was
+It was created by libffi $as_me 3.1, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2697,7 +2849,11 @@
 
 target_alias=${target_alias-$host_alias}
 
-. ${srcdir}/configure.host
+case "${host}" in
+  frv*-elf)
+    LDFLAGS=`echo $LDFLAGS | sed "s/\-B^ *libgloss\/frv\///"`\ -B`pwd`/../libgloss/frv/
+    ;;
+esac
 
 
    # [$]@ is unsable in 2.60+ but earlier autoconf had no ac_configure_args
@@ -2803,7 +2959,7 @@
 ac_config_commands="$ac_config_commands buildir"
 
 
-am__api_version='1.12'
+am__api_version='1.13'
 
 # Find a good install program.  We prefer a C program (faster),
 # so one script is as good as another.  But avoid the broken or
@@ -2984,8 +3140,8 @@
   esac
 fi
 # Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
-  am_missing_run="$MISSING --run "
+if eval "$MISSING --is-lightweight"; then
+  am_missing_run="$MISSING "
 else
   am_missing_run=
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
@@ -3225,6 +3381,45 @@
 fi
 rmdir .tst 2>/dev/null
 
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+  enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in # (((
+  yes) AM_DEFAULT_VERBOSITY=0;;
+   no) AM_DEFAULT_VERBOSITY=1;;
+    *) AM_DEFAULT_VERBOSITY=1;;
+esac
+am_make=${MAKE-make}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
+$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
+if ${am_cv_make_support_nested_variables+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if $as_echo 'TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+	@$(TRUE)
+.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
+  am_cv_make_support_nested_variables=yes
+else
+  am_cv_make_support_nested_variables=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
+$as_echo "$am_cv_make_support_nested_variables" >&6; }
+if test $am_cv_make_support_nested_variables = yes; then
+    AM_V='$(V)'
+  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+  AM_V=$AM_DEFAULT_VERBOSITY
+  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AM_BACKSLASH='\'
+
 if test "`cd $srcdir && pwd`" != "`pwd`"; then
   # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
   # is not polluted with repeated "-I."
@@ -3247,7 +3442,7 @@
 
 # Define the identity of the package.
  PACKAGE='libffi'
- VERSION='3.0.13'
+ VERSION='3.1'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -3287,6 +3482,10 @@
 # in the wild :-(  We should find a proper way to deprecate it ...
 AMTAR='$${TAR-tar}'
 
+
+# We'll loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar  pax cpio none'
+
 am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
 
 
@@ -3294,6 +3493,7 @@
 
 
 
+
 # The same as in boehm-gc and libstdc++. Have to borrow it from there.
 # We must force CC to /not/ be precious variables; otherwise
 # the wrong, non-multilib-adjusted value will be used in multilibs.
@@ -4284,6 +4484,391 @@
 fi
 
 
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+if test -z "$CXX"; then
+  if test -n "$CCC"; then
+    CXX=$CCC
+  else
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CXX"; then
+  ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
+$as_echo "$CXX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CXX" && break
+  done
+fi
+if test -z "$CXX"; then
+  ac_ct_CXX=$CXX
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CXX"; then
+  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CXX="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
+$as_echo "$ac_ct_CXX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CXX" && break
+done
+
+  if test "x$ac_ct_CXX" = x; then
+    CXX="g++"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CXX=$ac_ct_CXX
+  fi
+fi
+
+  fi
+fi
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
+$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
+if ${ac_cv_cxx_compiler_gnu+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
+$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GXX=yes
+else
+  GXX=
+fi
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
+$as_echo_n "checking whether $CXX accepts -g... " >&6; }
+if ${ac_cv_prog_cxx_g+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
+   ac_cxx_werror_flag=yes
+   ac_cv_prog_cxx_g=no
+   CXXFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  ac_cv_prog_cxx_g=yes
+else
+  CXXFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+
+else
+  ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+	 CXXFLAGS="-g"
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  ac_cv_prog_cxx_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
+$as_echo "$ac_cv_prog_cxx_g" >&6; }
+if test "$ac_test_CXXFLAGS" = set; then
+  CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+  if test "$GXX" = yes; then
+    CXXFLAGS="-g -O2"
+  else
+    CXXFLAGS="-g"
+  fi
+else
+  if test "$GXX" = yes; then
+    CXXFLAGS="-O2"
+  else
+    CXXFLAGS=
+  fi
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CXX"  am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CXX_dependencies_compiler_type+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CXX_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    nosideeffect)
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok '-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CXX_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CXX_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
+CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+
+ if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
+  am__fastdepCXX_TRUE=
+  am__fastdepCXX_FALSE='#'
+else
+  am__fastdepCXX_TRUE='#'
+  am__fastdepCXX_FALSE=
+fi
+
+
 CFLAGS=$save_CFLAGS
 
 
@@ -4557,8 +5142,8 @@
 
 
 
-macro_version='2.4.2'
-macro_revision='1.3337'
+macro_version='2.4.2.418'
+macro_revision='2.4.2.418'
 
 
 
@@ -4572,7 +5157,7 @@
 
 
 
-ltmain="$ac_aux_dir/ltmain.sh"
+ltmain=$ac_aux_dir/ltmain.sh
 
 # Backslashify metacharacters that are still active within
 # double-quoted strings.
@@ -4621,7 +5206,7 @@
     $ECHO ""
 }
 
-case "$ECHO" in
+case $ECHO in
   printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
 $as_echo "printf" >&6; } ;;
   print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
@@ -4944,19 +5529,19 @@
 
 # Check whether --with-gnu-ld was given.
 if test "${with_gnu_ld+set}" = set; then :
-  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+  withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes
 else
   with_gnu_ld=no
 fi
 
 ac_prog=ld
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
   # Check if gcc -print-prog-name=ld gives a path.
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
 $as_echo_n "checking for ld used by $CC... " >&6; }
   case $host in
   *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
+    # gcc leaves a trailing carriage return, which upsets mingw
     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
   *)
     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
@@ -4970,7 +5555,7 @@
       while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
 	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
       done
-      test -z "$LD" && LD="$ac_prog"
+      test -z "$LD" && LD=$ac_prog
       ;;
   "")
     # If it fails, then pretend we aren't using GCC.
@@ -4981,7 +5566,7 @@
     with_gnu_ld=unknown
     ;;
   esac
-elif test "$with_gnu_ld" = yes; then
+elif test yes = "$with_gnu_ld"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
 $as_echo_n "checking for GNU ld... " >&6; }
 else
@@ -4992,32 +5577,32 @@
   $as_echo_n "(cached) " >&6
 else
   if test -z "$LD"; then
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
   for ac_dir in $PATH; do
-    IFS="$lt_save_ifs"
+    IFS=$lt_save_ifs
     test -z "$ac_dir" && ac_dir=.
     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      lt_cv_path_LD="$ac_dir/$ac_prog"
+      lt_cv_path_LD=$ac_dir/$ac_prog
       # Check to see if the program is GNU ld.  I'd rather use --version,
       # but apparently some variants of GNU ld only accept -v.
       # Break only if it was the GNU/non-GNU ld that we prefer.
       case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
       *GNU* | *'with BFD'*)
-	test "$with_gnu_ld" != no && break
+	test no != "$with_gnu_ld" && break
 	;;
       *)
-	test "$with_gnu_ld" != yes && break
+	test yes != "$with_gnu_ld" && break
 	;;
       esac
     fi
   done
-  IFS="$lt_save_ifs"
+  IFS=$lt_save_ifs
 else
-  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+  lt_cv_path_LD=$LD # Let the user override the test with a path.
 fi
 fi
 
-LD="$lt_cv_path_LD"
+LD=$lt_cv_path_LD
 if test -n "$LD"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
 $as_echo "$LD" >&6; }
@@ -5060,33 +5645,33 @@
 else
   if test -n "$NM"; then
   # Let the user override the test.
-  lt_cv_path_NM="$NM"
+  lt_cv_path_NM=$NM
 else
-  lt_nm_to_check="${ac_tool_prefix}nm"
+  lt_nm_to_check=${ac_tool_prefix}nm
   if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
     lt_nm_to_check="$lt_nm_to_check nm"
   fi
   for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
     for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       test -z "$ac_dir" && ac_dir=.
-      tmp_nm="$ac_dir/$lt_tmp_nm"
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+      tmp_nm=$ac_dir/$lt_tmp_nm
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
 	# Check to see if the nm accepts a BSD-compat flag.
-	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
+	# Adding the 'sed 1q' prevents false positives on HP-UX, which says:
 	#   nm: unknown option "B" ignored
 	# Tru64's nm complains that /dev/null is an invalid object file
 	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
 	*/dev/null* | *'Invalid file or object type'*)
 	  lt_cv_path_NM="$tmp_nm -B"
-	  break
+	  break 2
 	  ;;
 	*)
 	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
 	  */dev/null*)
 	    lt_cv_path_NM="$tmp_nm -p"
-	    break
+	    break 2
 	    ;;
 	  *)
 	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
@@ -5097,15 +5682,15 @@
 	esac
       fi
     done
-    IFS="$lt_save_ifs"
+    IFS=$lt_save_ifs
   done
   : ${lt_cv_path_NM=no}
 fi
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
 $as_echo "$lt_cv_path_NM" >&6; }
-if test "$lt_cv_path_NM" != "no"; then
-  NM="$lt_cv_path_NM"
+if test no != "$lt_cv_path_NM"; then
+  NM=$lt_cv_path_NM
 else
   # Didn't find any BSD compatible name lister, look for dumpbin.
   if test -n "$DUMPBIN"; then :
@@ -5211,9 +5796,9 @@
   fi
 fi
 
-    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
     *COFF*)
-      DUMPBIN="$DUMPBIN -symbols"
+      DUMPBIN="$DUMPBIN -symbols -headers"
       ;;
     *)
       DUMPBIN=:
@@ -5221,8 +5806,8 @@
     esac
   fi
 
-  if test "$DUMPBIN" != ":"; then
-    NM="$DUMPBIN"
+  if test : != "$DUMPBIN"; then
+    NM=$DUMPBIN
   fi
 fi
 test -z "$NM" && NM=nm
@@ -5273,7 +5858,7 @@
   $as_echo_n "(cached) " >&6
 else
     i=0
-  teststring="ABCD"
+  teststring=ABCD
 
   case $build_os in
   msdosdjgpp*)
@@ -5313,7 +5898,7 @@
     lt_cv_sys_max_cmd_len=8192;
     ;;
 
-  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+  bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
     # This has been around since 386BSD, at least.  Likely further.
     if test -x /sbin/sysctl; then
       lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
@@ -5364,22 +5949,22 @@
   *)
     lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
     if test -n "$lt_cv_sys_max_cmd_len" && \
-      test undefined != "$lt_cv_sys_max_cmd_len"; then
+       test undefined != "$lt_cv_sys_max_cmd_len"; then
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
     else
       # Make teststring a little bigger before we do anything with it.
       # a 1K string should be a reasonable start.
-      for i in 1 2 3 4 5 6 7 8 ; do
+      for i in 1 2 3 4 5 6 7 8; do
         teststring=$teststring$teststring
       done
       SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
       # If test is not a shell built-in, we'll probably end up computing a
       # maximum length that is only half of the actual maximum length, but
       # we can't tell.
-      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
+      while { test X`env echo "$teststring$teststring" 2>/dev/null` \
 	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
-	      test $i != 17 # 1/2 MB should be enough
+	      test 17 != "$i" # 1/2 MB should be enough
       do
         i=`expr $i + 1`
         teststring=$teststring$teststring
@@ -5397,7 +5982,7 @@
 
 fi
 
-if test -n $lt_cv_sys_max_cmd_len ; then
+if test -n "$lt_cv_sys_max_cmd_len"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
 $as_echo "$lt_cv_sys_max_cmd_len" >&6; }
 else
@@ -5415,30 +6000,6 @@
 : ${MV="mv -f"}
 : ${RM="rm -f"}
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
-$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
-# Try some XSI features
-xsi_shell=no
-( _lt_dummy="a/b/c"
-  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
-      = c,a/b,b/c, \
-    && eval 'test $(( 1 + 1 )) -eq 2 \
-    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
-  && xsi_shell=yes
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
-$as_echo "$xsi_shell" >&6; }
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
-$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
-lt_shell_append=no
-( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
-    >/dev/null 2>&1 \
-  && lt_shell_append=yes
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
-$as_echo "$lt_shell_append" >&6; }
-
-
 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
   lt_unset=unset
 else
@@ -5561,13 +6122,13 @@
 reload_cmds='$LD$reload_flag -o $output$reload_objs'
 case $host_os in
   cygwin* | mingw* | pw32* | cegcc*)
-    if test "$GCC" != yes; then
+    if test yes != "$GCC"; then
       reload_cmds=false
     fi
     ;;
   darwin*)
-    if test "$GCC" = yes; then
-      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+    if test yes = "$GCC"; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
     else
       reload_cmds='$LD$reload_flag -o $output$reload_objs'
     fi
@@ -5695,13 +6256,13 @@
 # Need to set the preceding variable on all platforms that support
 # interlibrary dependencies.
 # 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
+# 'unknown' -- same as none, but documents that we really don't know.
 # 'pass_all' -- all dependencies passed with no checks.
 # 'test_compile' -- check by making test program.
 # 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given extended regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
+# that responds to the $file_magic_cmd with a given extended regex.
+# If you have 'file' or equivalent on your system and you're not sure
+# whether 'pass_all' will *always* work, you probably want this one.
 
 case $host_os in
 aix[4-9]*)
@@ -5728,8 +6289,7 @@
   # Base MSYS/MinGW do not provide the 'file' command needed by
   # func_win32_libid shell function, so use a weaker test based on 'objdump',
   # unless we find 'file', for example because we are cross-compiling.
-  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
-  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+  if ( file / ) >/dev/null 2>&1; then
     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
     lt_cv_file_magic_cmd='func_win32_libid'
   else
@@ -5765,10 +6325,6 @@
   fi
   ;;
 
-gnu*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
 haiku*)
   lt_cv_deplibs_check_method=pass_all
   ;;
@@ -5807,7 +6363,7 @@
   ;;
 
 # This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
@@ -5829,8 +6385,8 @@
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-openbsd*)
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+openbsd* | bitrig*)
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
     lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
   else
     lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
@@ -6040,8 +6596,8 @@
 
 case $host_os in
 cygwin* | mingw* | pw32* | cegcc*)
-  # two different shell functions defined in ltmain.sh
-  # decide which to use based on capabilities of $DLLTOOL
+  # two different shell functions defined in ltmain.sh;
+  # decide which one to use based on capabilities of $DLLTOOL
   case `$DLLTOOL --help 2>&1` in
   *--identify-strict*)
     lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
@@ -6053,7 +6609,7 @@
   ;;
 *)
   # fallback: assume linklib IS sharedlib
-  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+  lt_cv_sharedlib_from_linklib_cmd=$ECHO
   ;;
 esac
 
@@ -6208,7 +6764,7 @@
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }
-      if test "$ac_status" -eq 0; then
+      if test 0 -eq "$ac_status"; then
 	# Ensure the archiver fails upon bogus file names.
 	rm -f conftest.$ac_objext libconftest.a
 	{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
@@ -6216,7 +6772,7 @@
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }
-	if test "$ac_status" -ne 0; then
+	if test 0 -ne "$ac_status"; then
           lt_cv_ar_at_file=@
         fi
       fi
@@ -6229,7 +6785,7 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
 $as_echo "$lt_cv_ar_at_file" >&6; }
 
-if test "x$lt_cv_ar_at_file" = xno; then
+if test no = "$lt_cv_ar_at_file"; then
   archiver_list_spec=
 else
   archiver_list_spec=$lt_cv_ar_at_file
@@ -6446,7 +7002,7 @@
 
 if test -n "$RANLIB"; then
   case $host_os in
-  openbsd*)
+  bitrig* | openbsd*)
     old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
     ;;
   *)
@@ -6536,7 +7092,7 @@
   symcode='[ABCDGISTW]'
   ;;
 hpux*)
-  if test "$host_cpu" = ia64; then
+  if test ia64 = "$host_cpu"; then
     symcode='[ABCDEGRST]'
   fi
   ;;
@@ -6569,14 +7125,44 @@
   symcode='[ABCDGIRSTW]' ;;
 esac
 
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+  # Gets list of data symbols to import.
+  lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
+  # Adjust the below global symbol transforms to fixup imported variables.
+  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
+  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
+  lt_c_name_lib_hook="\
+  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
+  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
+else
+  # Disable hooks by default.
+  lt_cv_sys_global_symbol_to_import=
+  lt_cdecl_hook=
+  lt_c_name_hook=
+  lt_c_name_lib_hook=
+fi
+
 # Transform an extracted symbol line into a proper C declaration.
 # Some systems (esp. on ia64) link data and code symbols differently,
 # so use this general approach.
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+lt_cv_sys_global_symbol_to_cdecl="sed -n"\
+$lt_cdecl_hook\
+" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
 
 # Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
+$lt_c_name_hook\
+" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
+
+# Transform an extracted symbol line into symbol name with lib prefix and
+# symbol address.
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
+$lt_c_name_lib_hook\
+" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
 
 # Handle CRLF in mingw tool chain
 opt_cr=
@@ -6594,21 +7180,24 @@
 
   # Write the raw and C identifiers.
   if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-    # Fake it for dumpbin and say T for any non-static function
-    # and D for any global variable.
+    # Fake it for dumpbin and say T for any non-static function,
+    # D for any global variable and I for any imported variable.
     # Also find C++ and __fastcall symbols from MSVC++,
     # which start with @ or ?.
     lt_cv_sys_global_symbol_pipe="$AWK '"\
 "     {last_section=section; section=\$ 3};"\
 "     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
 "     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+"     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
+"     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
+"     /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
 "     \$ 0!~/External *\|/{next};"\
 "     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
 "     {if(hide[section]) next};"\
-"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
-"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
-"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
-"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+"     {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
+"     {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
+"     s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
+"     s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
 "     ' prfx=^$ac_symprfx"
   else
     lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[	 ]\($symcode$symcode*\)[	 ][	 ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
@@ -6656,11 +7245,11 @@
 	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
 	  cat <<_LT_EOF > conftest.$ac_ext
 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-/* DATA imports from DLLs on WIN32 con't be const, because runtime
+#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
+/* DATA imports from DLLs on WIN32 can't be const, because runtime
    relocations are performed -- see ld's documentation on pseudo-relocs.  */
 # define LT_DLSYM_CONST
-#elif defined(__osf__)
+#elif defined __osf__
 /* This system does not cope well with relocations in const data.  */
 # define LT_DLSYM_CONST
 #else
@@ -6686,7 +7275,7 @@
 {
   { "@PROGRAM@", (void *) 0 },
 _LT_EOF
-	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+	  $SED "s/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
 	  cat <<\_LT_EOF >> conftest.$ac_ext
   {0, (void *) 0}
 };
@@ -6706,13 +7295,13 @@
 	  mv conftest.$ac_objext conftstm.$ac_objext
 	  lt_globsym_save_LIBS=$LIBS
 	  lt_globsym_save_CFLAGS=$CFLAGS
-	  LIBS="conftstm.$ac_objext"
+	  LIBS=conftstm.$ac_objext
 	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
 	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
   (eval $ac_link) 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
 	    pipe_works=yes
 	  fi
 	  LIBS=$lt_globsym_save_LIBS
@@ -6733,7 +7322,7 @@
   rm -rf conftest* conftst*
 
   # Do not use the global_symbol_pipe unless it works.
-  if test "$pipe_works" = yes; then
+  if test yes = "$pipe_works"; then
     break
   else
     lt_cv_sys_global_symbol_pipe=
@@ -6786,6 +7375,16 @@
 
 
 
+
+
+
+
+
+
+
+
+
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
 $as_echo_n "checking for sysroot... " >&6; }
 
@@ -6798,9 +7397,9 @@
 
 
 lt_sysroot=
-case ${with_sysroot} in #(
+case $with_sysroot in #(
  yes)
-   if test "$GCC" = yes; then
+   if test yes = "$GCC"; then
      lt_sysroot=`$CC --print-sysroot 2>/dev/null`
    fi
    ;; #(
@@ -6810,8 +7409,8 @@
  no|'')
    ;; #(
  *)
-   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5
-$as_echo "${with_sysroot}" >&6; }
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5
+$as_echo "$with_sysroot" >&6; }
    as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
    ;;
 esac
@@ -6828,13 +7427,14 @@
   enableval=$enable_libtool_lock;
 fi
 
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+test no = "$enable_libtool_lock" || enable_libtool_lock=yes
 
 # Some flags need to be propagated to the compiler or linker for good
 # libtool support.
 case $host in
 ia64-*-hpux*)
-  # Find out which ABI we are using.
+  # Find out what ABI is being produced by ac_compile, and set mode
+  # options accordingly.
   echo 'int i;' > conftest.$ac_ext
   if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
@@ -6843,24 +7443,25 @@
   test $ac_status = 0; }; then
     case `/usr/bin/file conftest.$ac_objext` in
       *ELF-32*)
-	HPUX_IA64_MODE="32"
+	HPUX_IA64_MODE=32
 	;;
       *ELF-64*)
-	HPUX_IA64_MODE="64"
+	HPUX_IA64_MODE=64
 	;;
     esac
   fi
   rm -rf conftest*
   ;;
 *-*-irix6*)
-  # Find out which ABI we are using.
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.
   echo '#line '$LINENO' "configure"' > conftest.$ac_ext
   if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-    if test "$lt_cv_prog_gnu_ld" = yes; then
+    if test yes = "$lt_cv_prog_gnu_ld"; then
       case `/usr/bin/file conftest.$ac_objext` in
 	*32-bit*)
 	  LD="${LD-ld} -melf32bsmip"
@@ -6889,9 +7490,50 @@
   rm -rf conftest*
   ;;
 
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+mips64*-*linux*)
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.
+  echo '#line '$LINENO' "configure"' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    emul=elf
+    case `/usr/bin/file conftest.$ac_objext` in
+      *32-bit*)
+	emul="${emul}32"
+	;;
+      *64-bit*)
+	emul="${emul}64"
+	;;
+    esac
+    case `/usr/bin/file conftest.$ac_objext` in
+      *MSB*)
+	emul="${emul}btsmip"
+	;;
+      *LSB*)
+	emul="${emul}ltsmip"
+	;;
+    esac
+    case `/usr/bin/file conftest.$ac_objext` in
+      *N32*)
+	emul="${emul}n32"
+	;;
+    esac
+    LD="${LD-ld} -m $emul"
+  fi
+  rm -rf conftest*
+  ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
-  # Find out which ABI we are using.
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.  Note that the listed cases only cover the
+  # situations where additional linker options are needed (such as when
+  # doing 32-bit compilation for a host where ld defaults to 64-bit, or
+  # vice versa); the common cases where no linker options are needed do
+  # not appear in the list.
   echo 'int i;' > conftest.$ac_ext
   if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
@@ -6907,14 +7549,17 @@
 	  x86_64-*linux*)
 	    case `/usr/bin/file conftest.o` in
 	      *x86-64*)
-	         LD="${LD-ld} -m elf32_x86_64"
-	         ;;
+		LD="${LD-ld} -m elf32_x86_64"
+		;;
 	      *)
-	         LD="${LD-ld} -m elf_i386"
-	         ;;
+		LD="${LD-ld} -m elf_i386"
+		;;
 	    esac
 	    ;;
-	  ppc64-*linux*|powerpc64-*linux*)
+	  powerpc64le-*linux*)
+	    LD="${LD-ld} -m elf32lppclinux"
+	    ;;
+	  powerpc64-*linux*)
 	    LD="${LD-ld} -m elf32ppclinux"
 	    ;;
 	  s390x-*linux*)
@@ -6933,7 +7578,10 @@
 	  x86_64-*linux*)
 	    LD="${LD-ld} -m elf_x86_64"
 	    ;;
-	  ppc*-*linux*|powerpc*-*linux*)
+	  powerpcle-*linux*)
+	    LD="${LD-ld} -m elf64lppc"
+	    ;;
+	  powerpc-*linux*)
 	    LD="${LD-ld} -m elf64ppc"
 	    ;;
 	  s390*-*linux*|s390*-*tpf*)
@@ -6951,7 +7599,7 @@
 
 *-*-sco3.2v5*)
   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
-  SAVE_CFLAGS="$CFLAGS"
+  SAVE_CFLAGS=$CFLAGS
   CFLAGS="$CFLAGS -belf"
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
 $as_echo_n "checking whether the C compiler needs -belf... " >&6; }
@@ -6991,13 +7639,14 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
 $as_echo "$lt_cv_cc_needs_belf" >&6; }
-  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+  if test yes != "$lt_cv_cc_needs_belf"; then
     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
-    CFLAGS="$SAVE_CFLAGS"
+    CFLAGS=$SAVE_CFLAGS
   fi
   ;;
 *-*solaris*)
-  # Find out which ABI we are using.
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.
   echo 'int i;' > conftest.$ac_ext
   if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
@@ -7009,7 +7658,7 @@
       case $lt_cv_prog_gnu_ld in
       yes*)
         case $host in
-        i?86-*-solaris*)
+        i?86-*-solaris*|x86_64-*-solaris*)
           LD="${LD-ld} -m elf_x86_64"
           ;;
         sparc*-*-solaris*)
@@ -7018,7 +7667,7 @@
         esac
         # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
         if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
-          LD="${LD-ld}_sol2"
+          LD=${LD-ld}_sol2
         fi
         ;;
       *)
@@ -7034,7 +7683,7 @@
   ;;
 esac
 
-need_locks="$enable_libtool_lock"
+need_locks=$enable_libtool_lock
 
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
@@ -7145,7 +7794,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
 $as_echo "$lt_cv_path_mainfest_tool" >&6; }
-if test "x$lt_cv_path_mainfest_tool" != xyes; then
+if test yes != "$lt_cv_path_mainfest_tool"; then
   MANIFEST_TOOL=:
 fi
 
@@ -7648,7 +8297,7 @@
   $as_echo_n "(cached) " >&6
 else
   lt_cv_apple_cc_single_mod=no
-      if test -z "${LT_MULTI_MODULE}"; then
+      if test -z "$LT_MULTI_MODULE"; then
 	# By default we will add the -single_module flag. You can override
 	# by either setting the environment variable LT_MULTI_MODULE
 	# non-empty at configure time, or by adding -multi_module to the
@@ -7666,7 +8315,7 @@
 	  cat conftest.err >&5
 	# Otherwise, if the output was created with a 0 exit code from
 	# the compiler, it worked.
-	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
+	elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
 	  lt_cv_apple_cc_single_mod=yes
 	else
 	  cat conftest.err >&5
@@ -7705,7 +8354,7 @@
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-	LDFLAGS="$save_LDFLAGS"
+	LDFLAGS=$save_LDFLAGS
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
@@ -7734,7 +8383,7 @@
       _lt_result=$?
       if test -s conftest.err && $GREP force_load conftest.err; then
 	cat conftest.err >&5
-      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
+      elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
 	lt_cv_ld_force_load=yes
       else
 	cat conftest.err >&5
@@ -7747,32 +8396,32 @@
 $as_echo "$lt_cv_ld_force_load" >&6; }
     case $host_os in
     rhapsody* | darwin1.[012])
-      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
     darwin1.*)
-      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
     darwin*) # darwin 5.x on
       # if running on 10.5 or later, the deployment target defaults
       # to the OS version, if on x86, and 10.4, the deployment
       # target defaults to 10.4. Don't you love it?
       case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
 	10.0,*86*-darwin8*|10.0,*-darwin[91]*)
-	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
 	10.[012]*)
-	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+	  _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
 	10.*)
-	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
       esac
     ;;
   esac
-    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+    if test yes = "$lt_cv_apple_cc_single_mod"; then
       _lt_dar_single_mod='$single_module'
     fi
-    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
-      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+    if test yes = "$lt_cv_ld_exported_symbols_list"; then
+      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
     else
-      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
     fi
-    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+    if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
       _lt_dsymutil='~$DSYMUTIL $lib || :'
     else
       _lt_dsymutil=
@@ -8063,6 +8712,17 @@
 
 
 
+func_stripname_cnf ()
+{
+  case $2 in
+  .*) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%\\\\$2\$%%"`;;
+  *)  func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%$2\$%%"`;;
+  esac
+} # func_stripname_cnf
+
+
+
+
 
 # Set options
 
@@ -8083,14 +8743,14 @@
     *)
       enable_shared=no
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
       for pkg in $enableval; do
-	IFS="$lt_save_ifs"
+	IFS=$lt_save_ifs
 	if test "X$pkg" = "X$p"; then
 	  enable_shared=yes
 	fi
       done
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       ;;
     esac
 else
@@ -8114,14 +8774,14 @@
     *)
      enable_static=no
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
       for pkg in $enableval; do
-	IFS="$lt_save_ifs"
+	IFS=$lt_save_ifs
 	if test "X$pkg" = "X$p"; then
 	  enable_static=yes
 	fi
       done
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       ;;
     esac
 else
@@ -8145,14 +8805,14 @@
     *)
       pic_mode=default
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
       for lt_pkg in $withval; do
-	IFS="$lt_save_ifs"
+	IFS=$lt_save_ifs
 	if test "X$lt_pkg" = "X$lt_p"; then
 	  pic_mode=yes
 	fi
       done
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       ;;
     esac
 else
@@ -8160,8 +8820,6 @@
 fi
 
 
-test -z "$pic_mode" && pic_mode=default
-
 
 
 
@@ -8177,14 +8835,14 @@
     *)
       enable_fast_install=no
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
       for pkg in $enableval; do
-	IFS="$lt_save_ifs"
+	IFS=$lt_save_ifs
 	if test "X$pkg" = "X$p"; then
 	  enable_fast_install=yes
 	fi
       done
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       ;;
     esac
 else
@@ -8202,7 +8860,7 @@
 
 
 # This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ltmain"
+LIBTOOL_DEPS=$ltmain
 
 # Always use our own libtool.
 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
@@ -8251,7 +8909,7 @@
 
 
 
-if test -n "${ZSH_VERSION+set}" ; then
+if test -n "${ZSH_VERSION+set}"; then
    setopt NO_GLOB_SUBST
 fi
 
@@ -8290,7 +8948,7 @@
   # AIX sometimes has problems with the GCC collect2 program.  For some
   # reason, if we set the COLLECT_NAMES environment variable, the problems
   # vanish in a puff of smoke.
-  if test "X${COLLECT_NAMES+set}" != Xset; then
+  if test set != "${COLLECT_NAMES+set}"; then
     COLLECT_NAMES=
     export COLLECT_NAMES
   fi
@@ -8301,14 +8959,14 @@
 ofile=libtool
 can_build_shared=yes
 
-# All known linkers require a `.a' archive for static linking (except MSVC,
+# All known linkers require a '.a' archive for static linking (except MSVC,
 # which needs '.lib').
 libext=a
 
-with_gnu_ld="$lt_cv_prog_gnu_ld"
+with_gnu_ld=$lt_cv_prog_gnu_ld
 
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
+old_CC=$CC
+old_CFLAGS=$CFLAGS
 
 # Set sane defaults for various variables
 test -z "$CC" && CC=cc
@@ -8340,22 +8998,22 @@
 else
   case $MAGIC_CMD in
 [\\/*] |  ?:[\\/]*)
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
   ;;
 *)
-  lt_save_MAGIC_CMD="$MAGIC_CMD"
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  lt_save_MAGIC_CMD=$MAGIC_CMD
+  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
   ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
   for ac_dir in $ac_dummy; do
-    IFS="$lt_save_ifs"
+    IFS=$lt_save_ifs
     test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/${ac_tool_prefix}file; then
-      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+    if test -f "$ac_dir/${ac_tool_prefix}file"; then
+      lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file"
       if test -n "$file_magic_test_file"; then
 	case $deplibs_check_method in
 	"file_magic "*)
 	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
-	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
 	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
 	    $EGREP "$file_magic_regex" > /dev/null; then
 	    :
@@ -8378,13 +9036,13 @@
       break
     fi
   done
-  IFS="$lt_save_ifs"
-  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  IFS=$lt_save_ifs
+  MAGIC_CMD=$lt_save_MAGIC_CMD
   ;;
 esac
 fi
 
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+MAGIC_CMD=$lt_cv_path_MAGIC_CMD
 if test -n "$MAGIC_CMD"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
 $as_echo "$MAGIC_CMD" >&6; }
@@ -8406,22 +9064,22 @@
 else
   case $MAGIC_CMD in
 [\\/*] |  ?:[\\/]*)
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
   ;;
 *)
-  lt_save_MAGIC_CMD="$MAGIC_CMD"
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  lt_save_MAGIC_CMD=$MAGIC_CMD
+  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
   ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
   for ac_dir in $ac_dummy; do
-    IFS="$lt_save_ifs"
+    IFS=$lt_save_ifs
     test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/file; then
-      lt_cv_path_MAGIC_CMD="$ac_dir/file"
+    if test -f "$ac_dir/file"; then
+      lt_cv_path_MAGIC_CMD=$ac_dir/"file"
       if test -n "$file_magic_test_file"; then
 	case $deplibs_check_method in
 	"file_magic "*)
 	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
-	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
 	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
 	    $EGREP "$file_magic_regex" > /dev/null; then
 	    :
@@ -8444,13 +9102,13 @@
       break
     fi
   done
-  IFS="$lt_save_ifs"
-  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  IFS=$lt_save_ifs
+  MAGIC_CMD=$lt_save_MAGIC_CMD
   ;;
 esac
 fi
 
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+MAGIC_CMD=$lt_cv_path_MAGIC_CMD
 if test -n "$MAGIC_CMD"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
 $as_echo "$MAGIC_CMD" >&6; }
@@ -8471,7 +9129,7 @@
 
 # Use C for the default configuration in the libtool script
 
-lt_save_CC="$CC"
+lt_save_CC=$CC
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -8533,7 +9191,7 @@
 
 lt_prog_compiler_no_builtin_flag=
 
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
   case $cc_basename in
   nvcc*)
     lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
@@ -8549,7 +9207,7 @@
   lt_cv_prog_compiler_rtti_exceptions=no
    ac_outfile=conftest.$ac_objext
    echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="-fno-rtti -fno-exceptions"
+   lt_compiler_flag="-fno-rtti -fno-exceptions"  ## exclude from sc_useless_quotes_in_assignment
    # Insert the option either (1) after the last *FLAGS variable, or
    # (2) before a word containing "conftest.", or (3) at the end.
    # Note that $ac_compile itself does not contain backslashes and begins
@@ -8579,7 +9237,7 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
 
-if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then
     lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
 else
     :
@@ -8597,17 +9255,18 @@
 lt_prog_compiler_static=
 
 
-  if test "$GCC" = yes; then
+  if test yes = "$GCC"; then
     lt_prog_compiler_wl='-Wl,'
     lt_prog_compiler_static='-static'
 
     case $host_os in
       aix*)
       # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
+      if test ia64 = "$host_cpu"; then
 	# AIX 5 now supports IA64 processor
 	lt_prog_compiler_static='-Bstatic'
       fi
+      lt_prog_compiler_pic='-fPIC'
       ;;
 
     amigaos*)
@@ -8618,8 +9277,8 @@
         ;;
       m68k)
             # FIXME: we need at least 68020 code to build shared libraries, but
-            # adding the `-m68020' flag to GCC prevents building anything better,
-            # like `-m68040'.
+            # adding the '-m68020' flag to GCC prevents building anything better,
+            # like '-m68040'.
             lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
         ;;
       esac
@@ -8705,7 +9364,7 @@
     case $host_os in
     aix*)
       lt_prog_compiler_wl='-Wl,'
-      if test "$host_cpu" = ia64; then
+      if test ia64 = "$host_cpu"; then
 	# AIX 5 now supports IA64 processor
 	lt_prog_compiler_static='-Bstatic'
       else
@@ -8713,6 +9372,20 @@
       fi
       ;;
 
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic='-fno-common'
+      case $cc_basename in
+      nagfor*)
+        # NAG Fortran compiler
+        lt_prog_compiler_wl='-Wl,-Wl,,'
+        lt_prog_compiler_pic='-PIC'
+        lt_prog_compiler_static='-Bstatic'
+        ;;
+      esac
+      ;;
+
     mingw* | cygwin* | pw32* | os2* | cegcc*)
       # This hack is so that the source file can tell whether it is being
       # built for inclusion in a dll (and should export symbols for example).
@@ -8732,7 +9405,7 @@
 	;;
       esac
       # Is there a better lt_prog_compiler_static that works with the bundled CC?
-      lt_prog_compiler_static='${wl}-a ${wl}archive'
+      lt_prog_compiler_static='$wl-a ${wl}archive'
       ;;
 
     irix5* | irix6* | nonstopux*)
@@ -8741,9 +9414,9 @@
       lt_prog_compiler_static='-non_shared'
       ;;
 
-    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
       case $cc_basename in
-      # old Intel for x86_64 which still supported -KPIC.
+      # old Intel for x86_64, which still supported -KPIC.
       ecc*)
 	lt_prog_compiler_wl='-Wl,'
 	lt_prog_compiler_pic='-KPIC'
@@ -8768,6 +9441,12 @@
 	lt_prog_compiler_pic='-PIC'
 	lt_prog_compiler_static='-Bstatic'
 	;;
+      tcc*)
+	# Fabrice Bellard et al's Tiny C Compiler
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-fPIC'
+	lt_prog_compiler_static='-static'
+	;;
       pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
         # Portland Group compilers (*not* the Pentium gcc compiler,
 	# which looks to be a dead project)
@@ -8865,7 +9544,7 @@
       ;;
 
     sysv4*MP*)
-      if test -d /usr/nec ;then
+      if test -d /usr/nec; then
 	lt_prog_compiler_pic='-Kconform_pic'
 	lt_prog_compiler_static='-Bstatic'
       fi
@@ -8894,7 +9573,7 @@
   fi
 
 case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
+  # For platforms that do not support PIC, -DPIC is meaningless:
   *djgpp*)
     lt_prog_compiler_pic=
     ;;
@@ -8926,7 +9605,7 @@
   lt_cv_prog_compiler_pic_works=no
    ac_outfile=conftest.$ac_objext
    echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"  ## exclude from sc_useless_quotes_in_assignment
    # Insert the option either (1) after the last *FLAGS variable, or
    # (2) before a word containing "conftest.", or (3) at the end.
    # Note that $ac_compile itself does not contain backslashes and begins
@@ -8956,7 +9635,7 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
 
-if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
+if test yes = "$lt_cv_prog_compiler_pic_works"; then
     case $lt_prog_compiler_pic in
      "" | " "*) ;;
      *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
@@ -8988,7 +9667,7 @@
   $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler_static_works=no
-   save_LDFLAGS="$LDFLAGS"
+   save_LDFLAGS=$LDFLAGS
    LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
    echo "$lt_simple_link_test_code" > conftest.$ac_ext
    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
@@ -9007,13 +9686,13 @@
      fi
    fi
    $RM -r conftest*
-   LDFLAGS="$save_LDFLAGS"
+   LDFLAGS=$save_LDFLAGS
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
 $as_echo "$lt_cv_prog_compiler_static_works" >&6; }
 
-if test x"$lt_cv_prog_compiler_static_works" = xyes; then
+if test yes = "$lt_cv_prog_compiler_static_works"; then
     :
 else
     lt_prog_compiler_static=
@@ -9133,8 +9812,8 @@
 
 
 
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
+hard_links=nottested
+if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then
   # do not overwrite the value of need_locks provided by the user
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
 $as_echo_n "checking if we can lock with hard links... " >&6; }
@@ -9146,9 +9825,9 @@
   ln conftest.a conftest.b 2>/dev/null && hard_links=no
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
 $as_echo "$hard_links" >&6; }
-  if test "$hard_links" = no; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+  if test no = "$hard_links"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;}
     need_locks=warn
   fi
 else
@@ -9191,9 +9870,9 @@
   # included in the symbol list
   include_expsyms=
   # exclude_expsyms can be an extended regexp of symbols to exclude
-  # it will be wrapped by ` (' and `)$', so one must not match beginning or
-  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
-  # as well as any symbol that contains `d'.
+  # it will be wrapped by ' (' and ')$', so one must not match beginning or
+  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
+  # as well as any symbol that contains 'd'.
   exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
   # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
   # platforms (ab)use it in PIC code, but their linkers get confused if
@@ -9208,7 +9887,7 @@
     # FIXME: the MSVC++ port hasn't been tested in a loooong time
     # When not using gcc, we currently assume that we are using
     # Microsoft Visual C++.
-    if test "$GCC" != yes; then
+    if test yes != "$GCC"; then
       with_gnu_ld=no
     fi
     ;;
@@ -9216,7 +9895,7 @@
     # we just hope/assume this is gcc and not c89 (= MSVC++)
     with_gnu_ld=yes
     ;;
-  openbsd*)
+  openbsd* | bitrig*)
     with_gnu_ld=no
     ;;
   esac
@@ -9226,7 +9905,7 @@
   # On some targets, GNU ld is compatible enough with the native linker
   # that we're better off using the native interface for both.
   lt_use_gnu_ld_interface=no
-  if test "$with_gnu_ld" = yes; then
+  if test yes = "$with_gnu_ld"; then
     case $host_os in
       aix*)
 	# The AIX port of GNU ld has always aspired to compatibility
@@ -9248,24 +9927,24 @@
     esac
   fi
 
-  if test "$lt_use_gnu_ld_interface" = yes; then
+  if test yes = "$lt_use_gnu_ld_interface"; then
     # If archive_cmds runs LD, not CC, wlarc should be empty
-    wlarc='${wl}'
+    wlarc='$wl'
 
     # Set some defaults for GNU ld with shared library support. These
     # are reset later if shared libraries are not supported. Putting them
     # here allows them to be overridden if necessary.
     runpath_var=LD_RUN_PATH
-    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-    export_dynamic_flag_spec='${wl}--export-dynamic'
+    hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+    export_dynamic_flag_spec='$wl--export-dynamic'
     # ancient GNU ld didn't support --whole-archive et. al.
     if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
-      whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
     else
       whole_archive_flag_spec=
     fi
     supports_anon_versioning=no
-    case `$LD -v 2>&1` in
+    case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in
       *GNU\ gold*) supports_anon_versioning=yes ;;
       *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
       *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
@@ -9278,7 +9957,7 @@
     case $host_os in
     aix[3-9]*)
       # On AIX/PPC, the GNU linker is very broken
-      if test "$host_cpu" != ia64; then
+      if test ia64 != "$host_cpu"; then
 	ld_shlibs=no
 	cat <<_LT_EOF 1>&2
 
@@ -9297,7 +9976,7 @@
       case $host_cpu in
       powerpc)
             # see comment about AmigaOS4 .so support
-            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
             archive_expsym_cmds=''
         ;;
       m68k)
@@ -9313,7 +9992,7 @@
 	allow_undefined_flag=unsupported
 	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
 	# support --undefined.  This deserves some investigation.  FIXME
-	archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
       else
 	ld_shlibs=no
       fi
@@ -9323,7 +10002,7 @@
       # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
       # as there is no search path for DLLs.
       hardcode_libdir_flag_spec='-L$libdir'
-      export_dynamic_flag_spec='${wl}--export-all-symbols'
+      export_dynamic_flag_spec='$wl--export-all-symbols'
       allow_undefined_flag=unsupported
       always_export_symbols=no
       enable_shared_with_static_runtimes=yes
@@ -9331,61 +10010,61 @@
       exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
 
       if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-	# If the export-symbols file already is a .def file (1st line
-	# is EXPORTS), use it as is; otherwise, prepend...
-	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	  cp $export_symbols $output_objdir/$soname.def;
-	else
-	  echo EXPORTS > $output_objdir/$soname.def;
-	  cat $export_symbols >> $output_objdir/$soname.def;
-	fi~
-	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	# If the export-symbols file already is a .def file, use it as
+	# is; otherwise, prepend EXPORTS...
+	archive_expsym_cmds='if   test DEF = "`$SED -n     -e '\''s/^[	 ]*//'\''     -e '\''/^\(;.*\)*$/d'\''     -e '\''s/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p'\''     -e q     $export_symbols`" ; then
+          cp $export_symbols $output_objdir/$soname.def;
+        else
+          echo EXPORTS > $output_objdir/$soname.def;
+          cat $export_symbols >> $output_objdir/$soname.def;
+        fi~
+        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
       else
 	ld_shlibs=no
       fi
       ;;
 
     haiku*)
-      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
       link_all_deplibs=yes
       ;;
 
     interix[3-9]*)
       hardcode_direct=no
       hardcode_shlibpath_var=no
-      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-      export_dynamic_flag_spec='${wl}-E'
+      hardcode_libdir_flag_spec='$wl-rpath,$libdir'
+      export_dynamic_flag_spec='$wl-E'
       # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
       # Instead, shared libraries are loaded at an image base (0x10000000 by
       # default) and relocated if they conflict, which is a slow very memory
       # consuming and fragmenting process.  To avoid this, we pick a random,
       # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
       # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-      archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
       ;;
 
     gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
       tmp_diet=no
-      if test "$host_os" = linux-dietlibc; then
+      if test linux-dietlibc = "$host_os"; then
 	case $cc_basename in
 	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
 	esac
       fi
       if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
-	 && test "$tmp_diet" = no
+	 && test no = "$tmp_diet"
       then
 	tmp_addflag=' $pic_flag'
 	tmp_sharedflag='-shared'
 	case $cc_basename,$host_cpu in
         pgcc*)				# Portland Group C compiler
-	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	  tmp_addflag=' $pic_flag'
 	  ;;
 	pgf77* | pgf90* | pgf95* | pgfortran*)
 					# Portland Group f77 and f90 compilers
-	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	  tmp_addflag=' $pic_flag -Mnomain' ;;
 	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
 	  tmp_addflag=' -i_dynamic' ;;
@@ -9396,42 +10075,44 @@
 	lf95*)				# Lahey Fortran 8.1
 	  whole_archive_flag_spec=
 	  tmp_sharedflag='--shared' ;;
+        nagfor*)                        # NAGFOR 5.3
+          tmp_sharedflag='-Wl,-shared' ;;
 	xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
 	  tmp_sharedflag='-qmkshrobj'
 	  tmp_addflag= ;;
 	nvcc*)	# Cuda Compiler Driver 2.2
-	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	  compiler_needs_object=yes
 	  ;;
 	esac
 	case `$CC -V 2>&1 | sed 5q` in
 	*Sun\ C*)			# Sun C 5.9
-	  whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	  compiler_needs_object=yes
 	  tmp_sharedflag='-G' ;;
 	*Sun\ F*)			# Sun Fortran 8.3
 	  tmp_sharedflag='-G' ;;
 	esac
-	archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
 
-        if test "x$supports_anon_versioning" = xyes; then
+        if test yes = "$supports_anon_versioning"; then
           archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
-	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-	    echo "local: *; };" >> $output_objdir/$libname.ver~
-	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+            cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+            echo "local: *; };" >> $output_objdir/$libname.ver~
+            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
         fi
 
 	case $cc_basename in
 	xlf* | bgf* | bgxlf* | mpixlf*)
 	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
 	  whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
-	  hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+	  hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
 	  archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
-	  if test "x$supports_anon_versioning" = xyes; then
+	  if test yes = "$supports_anon_versioning"; then
 	    archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
-	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-	      echo "local: *; };" >> $output_objdir/$libname.ver~
-	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+              cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+              echo "local: *; };" >> $output_objdir/$libname.ver~
+              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
 	  fi
 	  ;;
 	esac
@@ -9445,8 +10126,8 @@
 	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
 	wlarc=
       else
-	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
       fi
       ;;
 
@@ -9464,8 +10145,8 @@
 
 _LT_EOF
       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
       else
 	ld_shlibs=no
       fi
@@ -9477,7 +10158,7 @@
 	ld_shlibs=no
 	cat <<_LT_EOF 1>&2
 
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
 *** reliably create shared libraries on SCO systems.  Therefore, libtool
 *** is disabling shared libraries support.  We urge you to upgrade GNU
 *** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
@@ -9492,9 +10173,9 @@
 	  # DT_RUNPATH tag from executables and libraries.  But doing so
 	  # requires that you compile everything twice, which is a pain.
 	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-	    archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	    archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	    hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+	    archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	    archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
 	  else
 	    ld_shlibs=no
 	  fi
@@ -9511,15 +10192,15 @@
 
     *)
       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
       else
 	ld_shlibs=no
       fi
       ;;
     esac
 
-    if test "$ld_shlibs" = no; then
+    if test no = "$ld_shlibs"; then
       runpath_var=
       hardcode_libdir_flag_spec=
       export_dynamic_flag_spec=
@@ -9535,7 +10216,7 @@
       # Note: this linker hardcodes the directories in LIBPATH if there
       # are no directories specified by -L.
       hardcode_minus_L=yes
-      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
 	# Neither direct hardcoding nor static linking is supported with a
 	# broken collect2.
 	hardcode_direct=unsupported
@@ -9543,12 +10224,12 @@
       ;;
 
     aix[4-9]*)
-      if test "$host_cpu" = ia64; then
+      if test ia64 = "$host_cpu"; then
 	# On IA64, the linker does run time linking by default, so we don't
 	# have to do anything special.
 	aix_use_runtimelinking=no
 	exp_sym_flag='-Bexport'
-	no_entry_flag=""
+	no_entry_flag=
       else
 	# If we're using GNU nm, then we don't want the "-C" option.
 	# -C means demangle to AIX nm, but means don't demangle with GNU nm
@@ -9566,7 +10247,7 @@
 	# need to do runtime linking.
 	case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
 	  for ld_flag in $LDFLAGS; do
-	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+	  if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
 	    aix_use_runtimelinking=yes
 	    break
 	  fi
@@ -9589,13 +10270,13 @@
       hardcode_direct_absolute=yes
       hardcode_libdir_separator=':'
       link_all_deplibs=yes
-      file_list_spec='${wl}-f,'
+      file_list_spec='$wl-f,'
 
-      if test "$GCC" = yes; then
+      if test yes = "$GCC"; then
 	case $host_os in aix4.[012]|aix4.[012].*)
 	# We only want to do this on AIX 4.2 and lower, the check
 	# below for broken collect2 doesn't work under 4.3+
-	  collect2name=`${CC} -print-prog-name=collect2`
+	  collect2name=`$CC -print-prog-name=collect2`
 	  if test -f "$collect2name" &&
 	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
 	  then
@@ -9614,35 +10295,35 @@
 	  ;;
 	esac
 	shared_flag='-shared'
-	if test "$aix_use_runtimelinking" = yes; then
-	  shared_flag="$shared_flag "'${wl}-G'
+	if test yes = "$aix_use_runtimelinking"; then
+	  shared_flag="$shared_flag "'$wl-G'
 	fi
       else
 	# not using gcc
-	if test "$host_cpu" = ia64; then
+	if test ia64 = "$host_cpu"; then
 	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
 	# chokes on -Wl,-G. The following line is correct:
 	  shared_flag='-G'
 	else
-	  if test "$aix_use_runtimelinking" = yes; then
-	    shared_flag='${wl}-G'
+	  if test yes = "$aix_use_runtimelinking"; then
+	    shared_flag='$wl-G'
 	  else
-	    shared_flag='${wl}-bM:SRE'
+	    shared_flag='$wl-bM:SRE'
 	  fi
 	fi
       fi
 
-      export_dynamic_flag_spec='${wl}-bexpall'
+      export_dynamic_flag_spec='$wl-bexpall'
       # It seems that -bexpall does not export symbols beginning with
       # underscore (_), so it is better to generate a list of symbols to export.
       always_export_symbols=yes
-      if test "$aix_use_runtimelinking" = yes; then
+      if test yes = "$aix_use_runtimelinking"; then
 	# Warning - without using the other runtime loading flags (-brtl),
 	# -berok will link without error, but may produce a broken library.
 	allow_undefined_flag='-berok'
         # Determine the default libpath from the value encoded in an
         # empty executable.
-        if test "${lt_cv_aix_libpath+set}" = set; then
+        if test set = "${lt_cv_aix_libpath+set}"; then
   aix_libpath=$lt_cv_aix_libpath
 else
   if ${lt_cv_aix_libpath_+:} false; then :
@@ -9677,7 +10358,7 @@
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
   if test -z "$lt_cv_aix_libpath_"; then
-    lt_cv_aix_libpath_="/usr/lib:/lib"
+    lt_cv_aix_libpath_=/usr/lib:/lib
   fi
 
 fi
@@ -9685,17 +10366,17 @@
   aix_libpath=$lt_cv_aix_libpath_
 fi
 
-        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
-        archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+        hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath"
+        archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
       else
-	if test "$host_cpu" = ia64; then
-	  hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+	if test ia64 = "$host_cpu"; then
+	  hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib'
 	  allow_undefined_flag="-z nodefs"
-	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
 	else
 	 # Determine the default libpath from the value encoded in an
 	 # empty executable.
-	 if test "${lt_cv_aix_libpath+set}" = set; then
+	 if test set = "${lt_cv_aix_libpath+set}"; then
   aix_libpath=$lt_cv_aix_libpath
 else
   if ${lt_cv_aix_libpath_+:} false; then :
@@ -9730,7 +10411,7 @@
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
   if test -z "$lt_cv_aix_libpath_"; then
-    lt_cv_aix_libpath_="/usr/lib:/lib"
+    lt_cv_aix_libpath_=/usr/lib:/lib
   fi
 
 fi
@@ -9738,21 +10419,21 @@
   aix_libpath=$lt_cv_aix_libpath_
 fi
 
-	 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+	 hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath"
 	  # Warning - without using the other run time loading flags,
 	  # -berok will link without error, but may produce a broken library.
-	  no_undefined_flag=' ${wl}-bernotok'
-	  allow_undefined_flag=' ${wl}-berok'
-	  if test "$with_gnu_ld" = yes; then
+	  no_undefined_flag=' $wl-bernotok'
+	  allow_undefined_flag=' $wl-berok'
+	  if test yes = "$with_gnu_ld"; then
 	    # We only use this code for GNU lds that support --whole-archive.
-	    whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	    whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive'
 	  else
 	    # Exported symbols can be pulled into shared objects from archives
 	    whole_archive_flag_spec='$convenience'
 	  fi
 	  archive_cmds_need_lc=yes
 	  # This is similar to how AIX traditionally builds its shared libraries.
-	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $wl-bnoentry $compiler_flags $wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
 	fi
       fi
       ;;
@@ -9761,7 +10442,7 @@
       case $host_cpu in
       powerpc)
             # see comment about AmigaOS4 .so support
-            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
             archive_expsym_cmds=''
         ;;
       m68k)
@@ -9791,16 +10472,17 @@
 	# Tell ltmain to make .lib files, not .a files.
 	libext=lib
 	# Tell ltmain to make .dll files, not .so files.
-	shrext_cmds=".dll"
+	shrext_cmds=.dll
 	# FIXME: Setting linknames here is a bad hack.
-	archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
-	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
-	  else
-	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
-	  fi~
-	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
-	  linknames='
+	archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+	archive_expsym_cmds='if   test DEF = "`$SED -n     -e '\''s/^[	 ]*//'\''     -e '\''/^\(;.*\)*$/d'\''     -e '\''s/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p'\''     -e q     $export_symbols`" ; then
+            cp "$export_symbols" "$output_objdir/$soname.def";
+            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
+          else
+            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+          fi~
+          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+          linknames='
 	# The linker will not automatically build a static lib if we build a DLL.
 	# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
 	enable_shared_with_static_runtimes=yes
@@ -9809,18 +10491,18 @@
 	# Don't use ranlib
 	old_postinstall_cmds='chmod 644 $oldlib'
 	postlink_cmds='lt_outputfile="@OUTPUT@"~
-	  lt_tool_outputfile="@TOOL_OUTPUT@"~
-	  case $lt_outputfile in
-	    *.exe|*.EXE) ;;
-	    *)
-	      lt_outputfile="$lt_outputfile.exe"
-	      lt_tool_outputfile="$lt_tool_outputfile.exe"
-	      ;;
-	  esac~
-	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
-	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
-	    $RM "$lt_outputfile.manifest";
-	  fi'
+          lt_tool_outputfile="@TOOL_OUTPUT@"~
+          case $lt_outputfile in
+            *.exe|*.EXE) ;;
+            *)
+              lt_outputfile=$lt_outputfile.exe
+              lt_tool_outputfile=$lt_tool_outputfile.exe
+              ;;
+          esac~
+          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
+            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+            $RM "$lt_outputfile.manifest";
+          fi'
 	;;
       *)
 	# Assume MSVC wrapper
@@ -9829,7 +10511,7 @@
 	# Tell ltmain to make .lib files, not .a files.
 	libext=lib
 	# Tell ltmain to make .dll files, not .so files.
-	shrext_cmds=".dll"
+	shrext_cmds=.dll
 	# FIXME: Setting linknames here is a bad hack.
 	archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
 	# The linker will automatically build a .lib file if we build a DLL.
@@ -9848,24 +10530,24 @@
   hardcode_direct=no
   hardcode_automatic=yes
   hardcode_shlibpath_var=unsupported
-  if test "$lt_cv_ld_force_load" = "yes"; then
-    whole_archive_flag_spec='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+  if test yes = "$lt_cv_ld_force_load"; then
+    whole_archive_flag_spec='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
 
   else
     whole_archive_flag_spec=''
   fi
   link_all_deplibs=yes
-  allow_undefined_flag="$_lt_dar_allow_undefined"
+  allow_undefined_flag=$_lt_dar_allow_undefined
   case $cc_basename in
-     ifort*) _lt_dar_can_shared=yes ;;
+     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
      *) _lt_dar_can_shared=$GCC ;;
   esac
-  if test "$_lt_dar_can_shared" = "yes"; then
+  if test yes = "$_lt_dar_can_shared"; then
     output_verbose_link_cmd=func_echo_all
-    archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
-    module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
-    archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
-    module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+    archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
+    module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
+    archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
+    module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
 
   else
   ld_shlibs=no
@@ -9907,33 +10589,33 @@
       ;;
 
     hpux9*)
-      if test "$GCC" = yes; then
-	archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      if test yes = "$GCC"; then
+	archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
       else
-	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
       fi
-      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+      hardcode_libdir_flag_spec='$wl+b $wl$libdir'
       hardcode_libdir_separator=:
       hardcode_direct=yes
 
       # hardcode_minus_L: Not really in the search PATH,
       # but as the default location of the library.
       hardcode_minus_L=yes
-      export_dynamic_flag_spec='${wl}-E'
+      export_dynamic_flag_spec='$wl-E'
       ;;
 
     hpux10*)
-      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
-	archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      if test yes,no = "$GCC,$with_gnu_ld"; then
+	archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
       else
 	archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
       fi
-      if test "$with_gnu_ld" = no; then
-	hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+      if test no = "$with_gnu_ld"; then
+	hardcode_libdir_flag_spec='$wl+b $wl$libdir'
 	hardcode_libdir_separator=:
 	hardcode_direct=yes
 	hardcode_direct_absolute=yes
-	export_dynamic_flag_spec='${wl}-E'
+	export_dynamic_flag_spec='$wl-E'
 	# hardcode_minus_L: Not really in the search PATH,
 	# but as the default location of the library.
 	hardcode_minus_L=yes
@@ -9941,25 +10623,25 @@
       ;;
 
     hpux11*)
-      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+      if test yes,no = "$GCC,$with_gnu_ld"; then
 	case $host_cpu in
 	hppa*64*)
-	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	ia64*)
-	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
-	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	esac
       else
 	case $host_cpu in
 	hppa*64*)
-	  archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	ia64*)
-	  archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
 
@@ -9971,7 +10653,7 @@
   $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler__b=no
-   save_LDFLAGS="$LDFLAGS"
+   save_LDFLAGS=$LDFLAGS
    LDFLAGS="$LDFLAGS -b"
    echo "$lt_simple_link_test_code" > conftest.$ac_ext
    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
@@ -9990,14 +10672,14 @@
      fi
    fi
    $RM -r conftest*
-   LDFLAGS="$save_LDFLAGS"
+   LDFLAGS=$save_LDFLAGS
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
 $as_echo "$lt_cv_prog_compiler__b" >&6; }
 
-if test x"$lt_cv_prog_compiler__b" = xyes; then
-    archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+if test yes = "$lt_cv_prog_compiler__b"; then
+    archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
 else
     archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
 fi
@@ -10005,8 +10687,8 @@
 	  ;;
 	esac
       fi
-      if test "$with_gnu_ld" = no; then
-	hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+      if test no = "$with_gnu_ld"; then
+	hardcode_libdir_flag_spec='$wl+b $wl$libdir'
 	hardcode_libdir_separator=:
 
 	case $host_cpu in
@@ -10017,7 +10699,7 @@
 	*)
 	  hardcode_direct=yes
 	  hardcode_direct_absolute=yes
-	  export_dynamic_flag_spec='${wl}-E'
+	  export_dynamic_flag_spec='$wl-E'
 
 	  # hardcode_minus_L: Not really in the search PATH,
 	  # but as the default location of the library.
@@ -10028,8 +10710,8 @@
       ;;
 
     irix5* | irix6* | nonstopux*)
-      if test "$GCC" = yes; then
-	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      if test yes = "$GCC"; then
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
 	# Try to use the -exported_symbol ld option, if it does not
 	# work, assume that -exports_file does not work either and
 	# implicitly export all symbols.
@@ -10039,8 +10721,8 @@
 if ${lt_cv_irix_exported_symbol+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  save_LDFLAGS="$LDFLAGS"
-	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+  save_LDFLAGS=$LDFLAGS
+	   LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
 	   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 int foo (void) { return 0; }
@@ -10052,19 +10734,19 @@
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-           LDFLAGS="$save_LDFLAGS"
+           LDFLAGS=$save_LDFLAGS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
 $as_echo "$lt_cv_irix_exported_symbol" >&6; }
-	if test "$lt_cv_irix_exported_symbol" = yes; then
-          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+	if test yes = "$lt_cv_irix_exported_symbol"; then
+          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
 	fi
       else
-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
       fi
       archive_cmds_need_lc='no'
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
       hardcode_libdir_separator=:
       inherit_rpath=yes
       link_all_deplibs=yes
@@ -10084,7 +10766,7 @@
     newsos6)
       archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
       hardcode_direct=yes
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
       hardcode_libdir_separator=:
       hardcode_shlibpath_var=no
       ;;
@@ -10092,27 +10774,19 @@
     *nto* | *qnx*)
       ;;
 
-    openbsd*)
+    openbsd* | bitrig*)
       if test -f /usr/libexec/ld.so; then
 	hardcode_direct=yes
 	hardcode_shlibpath_var=no
 	hardcode_direct_absolute=yes
-	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
 	  archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	  archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
-	  hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-	  export_dynamic_flag_spec='${wl}-E'
+	  archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
+	  hardcode_libdir_flag_spec='$wl-rpath,$libdir'
+	  export_dynamic_flag_spec='$wl-E'
 	else
-	  case $host_os in
-	   openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
-	     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-	     hardcode_libdir_flag_spec='-R$libdir'
-	     ;;
-	   *)
-	     archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	     hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-	     ;;
-	  esac
+	  archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	  hardcode_libdir_flag_spec='$wl-rpath,$libdir'
 	fi
       else
 	ld_shlibs=no
@@ -10128,28 +10802,28 @@
       ;;
 
     osf3*)
-      if test "$GCC" = yes; then
-	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      if test yes = "$GCC"; then
+	allow_undefined_flag=' $wl-expect_unresolved $wl\*'
+	archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
       else
 	allow_undefined_flag=' -expect_unresolved \*'
-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
       fi
       archive_cmds_need_lc='no'
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
       hardcode_libdir_separator=:
       ;;
 
     osf4* | osf5*)	# as osf3* with the addition of -msym flag
-      if test "$GCC" = yes; then
-	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      if test yes = "$GCC"; then
+	allow_undefined_flag=' $wl-expect_unresolved $wl\*'
+	archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+	hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
       else
 	allow_undefined_flag=' -expect_unresolved \*'
-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
 	archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
-	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+          $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
 
 	# Both c and cxx compiler support -rpath directly
 	hardcode_libdir_flag_spec='-rpath $libdir'
@@ -10160,24 +10834,24 @@
 
     solaris*)
       no_undefined_flag=' -z defs'
-      if test "$GCC" = yes; then
-	wlarc='${wl}'
-	archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      if test yes = "$GCC"; then
+	wlarc='$wl'
+	archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
 	archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+          $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
       else
 	case `$CC -V 2>&1` in
 	*"Compilers 5.0"*)
 	  wlarc=''
-	  archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
 	  archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
 	  ;;
 	*)
-	  wlarc='${wl}'
-	  archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+	  wlarc='$wl'
+	  archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
 	  archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
 	  ;;
 	esac
       fi
@@ -10187,11 +10861,11 @@
       solaris2.[0-5] | solaris2.[0-5].*) ;;
       *)
 	# The compiler driver will combine and reorder linker options,
-	# but understands `-z linker_flag'.  GCC discards it without `$wl',
+	# but understands '-z linker_flag'.  GCC discards it without '$wl',
 	# but is careful enough not to reorder.
 	# Supported since Solaris 2.6 (maybe 2.5.1?)
-	if test "$GCC" = yes; then
-	  whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+	if test yes = "$GCC"; then
+	  whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
 	else
 	  whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
 	fi
@@ -10201,10 +10875,10 @@
       ;;
 
     sunos4*)
-      if test "x$host_vendor" = xsequent; then
+      if test sequent = "$host_vendor"; then
 	# Use $CC to link under sequent, because it throws in some extra .o
 	# files that make .init and .fini sections work.
-	archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
       else
 	archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
       fi
@@ -10253,43 +10927,43 @@
       ;;
 
     sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
-      no_undefined_flag='${wl}-z,text'
+      no_undefined_flag='$wl-z,text'
       archive_cmds_need_lc=no
       hardcode_shlibpath_var=no
       runpath_var='LD_RUN_PATH'
 
-      if test "$GCC" = yes; then
-	archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      if test yes = "$GCC"; then
+	archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       else
-	archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       fi
       ;;
 
     sysv5* | sco3.2v5* | sco5v6*)
-      # Note: We can NOT use -z defs as we might desire, because we do not
+      # Note: We CANNOT use -z defs as we might desire, because we do not
       # link with -lc, and that would cause any symbols used from libc to
       # always be unresolved, which means just about no library would
       # ever link correctly.  If we're not using GNU ld we use -z text
       # though, which does catch some bad symbols but isn't as heavy-handed
       # as -z defs.
-      no_undefined_flag='${wl}-z,text'
-      allow_undefined_flag='${wl}-z,nodefs'
+      no_undefined_flag='$wl-z,text'
+      allow_undefined_flag='$wl-z,nodefs'
       archive_cmds_need_lc=no
       hardcode_shlibpath_var=no
-      hardcode_libdir_flag_spec='${wl}-R,$libdir'
+      hardcode_libdir_flag_spec='$wl-R,$libdir'
       hardcode_libdir_separator=':'
       link_all_deplibs=yes
-      export_dynamic_flag_spec='${wl}-Bexport'
+      export_dynamic_flag_spec='$wl-Bexport'
       runpath_var='LD_RUN_PATH'
 
-      if test "$GCC" = yes; then
-	archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      if test yes = "$GCC"; then
+	archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       else
-	archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       fi
       ;;
 
@@ -10304,10 +10978,10 @@
       ;;
     esac
 
-    if test x$host_vendor = xsni; then
+    if test sni = "$host_vendor"; then
       case $host in
       sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-	export_dynamic_flag_spec='${wl}-Blargedynsym'
+	export_dynamic_flag_spec='$wl-Blargedynsym'
 	;;
       esac
     fi
@@ -10315,7 +10989,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
 $as_echo "$ld_shlibs" >&6; }
-test "$ld_shlibs" = no && can_build_shared=no
+test no = "$ld_shlibs" && can_build_shared=no
 
 with_gnu_ld=$with_gnu_ld
 
@@ -10341,7 +11015,7 @@
   # Assume -lc should be added
   archive_cmds_need_lc=yes
 
-  if test "$enable_shared" = yes && test "$GCC" = yes; then
+  if test yes,yes = "$GCC,$enable_shared"; then
     case $archive_cmds in
     *'~'*)
       # FIXME: we may have to deal with multi-command sequences.
@@ -10556,14 +11230,14 @@
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
 $as_echo_n "checking dynamic linker characteristics... " >&6; }
 
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
   case $host_os in
-    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
-    *) lt_awk_arg="/^libraries:/" ;;
+    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
+    *) lt_awk_arg='/^libraries:/' ;;
   esac
   case $host_os in
-    mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;;
-    *) lt_sed_strip_eq="s,=/,/,g" ;;
+    mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;;
+    *) lt_sed_strip_eq='s|=/|/|g' ;;
   esac
   lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
   case $lt_search_path_spec in
@@ -10579,28 +11253,35 @@
     ;;
   esac
   # Ok, now we have the path, separated by spaces, we can step through it
-  # and add multilib dir if necessary.
+  # and add multilib dir if necessary...
   lt_tmp_lt_search_path_spec=
-  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  # ...but if some path component already ends with the multilib dir we assume
+  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
+  case "$lt_multi_os_dir; $lt_search_path_spec " in
+  "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
+    lt_multi_os_dir=
+    ;;
+  esac
   for lt_sys_path in $lt_search_path_spec; do
-    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
-      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
-    else
+    if test -d "$lt_sys_path$lt_multi_os_dir"; then
+      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
+    elif test -n "$lt_multi_os_dir"; then
       test -d "$lt_sys_path" && \
 	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
     fi
   done
   lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
-BEGIN {RS=" "; FS="/|\n";} {
-  lt_foo="";
-  lt_count=0;
+BEGIN {RS = " "; FS = "/|\n";} {
+  lt_foo = "";
+  lt_count = 0;
   for (lt_i = NF; lt_i > 0; lt_i--) {
     if ($lt_i != "" && $lt_i != ".") {
       if ($lt_i == "..") {
         lt_count++;
       } else {
         if (lt_count == 0) {
-          lt_foo="/" $lt_i lt_foo;
+          lt_foo = "/" $lt_i lt_foo;
         } else {
           lt_count--;
         }
@@ -10614,7 +11295,7 @@
   # for these hosts.
   case $host_os in
     mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
-      $SED 's,/\([A-Za-z]:\),\1,g'` ;;
+      $SED 's|/\([A-Za-z]:\)|\1|g'` ;;
   esac
   sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
 else
@@ -10623,7 +11304,7 @@
 library_names_spec=
 libname_spec='lib$name'
 soname_spec=
-shrext_cmds=".so"
+shrext_cmds=.so
 postinstall_cmds=
 postuninstall_cmds=
 finish_cmds=
@@ -10643,11 +11324,11 @@
 case $host_os in
 aix3*)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
   shlibpath_var=LIBPATH
 
   # AIX 3 has no versioning support, so we append a major version to the name.
-  soname_spec='${libname}${release}${shared_ext}$major'
+  soname_spec='$libname$release$shared_ext$major'
   ;;
 
 aix[4-9]*)
@@ -10655,40 +11336,40 @@
   need_lib_prefix=no
   need_version=no
   hardcode_into_libs=yes
-  if test "$host_cpu" = ia64; then
+  if test ia64 = "$host_cpu"; then
     # AIX 5 supports IA64
-    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
     shlibpath_var=LD_LIBRARY_PATH
   else
     # With GCC up to 2.95.x, collect2 would create an import file
     # for dependence libraries.  The import file would start with
-    # the line `#! .'.  This would cause the generated library to
-    # depend on `.', always an invalid library.  This was fixed in
+    # the line '#! .'.  This would cause the generated library to
+    # depend on '.', always an invalid library.  This was fixed in
     # development snapshots of GCC prior to 3.0.
     case $host_os in
       aix4 | aix4.[01] | aix4.[01].*)
       if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
 	   echo ' yes '
-	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
 	:
       else
 	can_build_shared=no
       fi
       ;;
     esac
-    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
     # soname into executable. Probably we can add versioning support to
     # collect2, so additional links can be useful in future.
-    if test "$aix_use_runtimelinking" = yes; then
+    if test yes = "$aix_use_runtimelinking"; then
       # If using run time linking (on AIX 4.2 or later) use lib<name>.so
       # instead of lib<name>.a to let people know that these are not
       # typical AIX shared libraries.
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
     else
       # We preserve .a as extension for shared libraries through AIX4.2
       # and later when we are not doing run time linking.
-      library_names_spec='${libname}${release}.a $libname.a'
-      soname_spec='${libname}${release}${shared_ext}$major'
+      library_names_spec='$libname$release.a $libname.a'
+      soname_spec='$libname$release$shared_ext$major'
     fi
     shlibpath_var=LIBPATH
   fi
@@ -10699,18 +11380,18 @@
   powerpc)
     # Since July 2007 AmigaOS4 officially supports .so libraries.
     # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
     ;;
   m68k)
     library_names_spec='$libname.ixlibrary $libname.a'
     # Create ${libname}_ixlibrary.a entries in /sys/libs.
-    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
     ;;
   esac
   ;;
 
 beos*)
-  library_names_spec='${libname}${shared_ext}'
+  library_names_spec='$libname$shared_ext'
   dynamic_linker="$host_os ld.so"
   shlibpath_var=LIBRARY_PATH
   ;;
@@ -10718,8 +11399,8 @@
 bsdi[45]*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
@@ -10731,7 +11412,7 @@
 
 cygwin* | mingw* | pw32* | cegcc*)
   version_type=windows
-  shrext_cmds=".dll"
+  shrext_cmds=.dll
   need_version=no
   need_lib_prefix=no
 
@@ -10740,8 +11421,8 @@
     # gcc
     library_names_spec='$libname.dll.a'
     # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+    postinstall_cmds='base_file=`basename \$file`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
       $install_prog $dir/$dlname \$dldir/$dlname~
@@ -10757,17 +11438,17 @@
     case $host_os in
     cygwin*)
       # Cygwin DLLs use 'cyg' prefix rather than 'lib'
-      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
 
       sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
       ;;
     mingw* | cegcc*)
       # MinGW DLLs use traditional 'lib' prefix
-      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
       ;;
     pw32*)
       # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
       ;;
     esac
     dynamic_linker='Win32 ld.exe'
@@ -10776,8 +11457,8 @@
   *,cl*)
     # Native MSVC
     libname_spec='$name'
-    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-    library_names_spec='${libname}.dll.lib'
+    soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+    library_names_spec='$libname.dll.lib'
 
     case $build_os in
     mingw*)
@@ -10804,7 +11485,7 @@
       sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
       ;;
     *)
-      sys_lib_search_path_spec="$LIB"
+      sys_lib_search_path_spec=$LIB
       if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
         # It is most probably a Windows format PATH.
         sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
@@ -10817,8 +11498,8 @@
     esac
 
     # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+    postinstall_cmds='base_file=`basename \$file`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
       $install_prog $dir/$dlname \$dldir/$dlname'
@@ -10831,7 +11512,7 @@
 
   *)
     # Assume MSVC wrapper
-    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib'
     dynamic_linker='Win32 ld.exe'
     ;;
   esac
@@ -10844,8 +11525,8 @@
   version_type=darwin
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
-  soname_spec='${libname}${release}${major}$shared_ext'
+  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
+  soname_spec='$libname$release$major$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
   shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
@@ -10858,8 +11539,8 @@
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
@@ -10877,12 +11558,12 @@
   version_type=freebsd-$objformat
   case $version_type in
     freebsd-elf*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
       need_version=no
       need_lib_prefix=no
       ;;
     freebsd-*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
       need_version=yes
       ;;
   esac
@@ -10907,26 +11588,15 @@
   esac
   ;;
 
-gnu*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
 haiku*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   dynamic_linker="$host_os runtime_loader"
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
+  shlibpath_overrides_runpath=no
   sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
@@ -10944,9 +11614,9 @@
     dynamic_linker="$host_os dld.so"
     shlibpath_var=LD_LIBRARY_PATH
     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    if test "X$HPUX_IA64_MODE" = X32; then
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    if test 32 = "$HPUX_IA64_MODE"; then
       sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
     else
       sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
@@ -10959,8 +11629,8 @@
     dynamic_linker="$host_os dld.sl"
     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
@@ -10969,8 +11639,8 @@
     dynamic_linker="$host_os dld.sl"
     shlibpath_var=SHLIB_PATH
     shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
     ;;
   esac
   # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
@@ -10983,8 +11653,8 @@
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
@@ -10995,7 +11665,7 @@
   case $host_os in
     nonstopux*) version_type=nonstopux ;;
     *)
-	if test "$lt_cv_prog_gnu_ld" = yes; then
+	if test yes = "$lt_cv_prog_gnu_ld"; then
 		version_type=linux # correct to gnu/linux during the next big refactor
 	else
 		version_type=irix
@@ -11003,8 +11673,8 @@
   esac
   need_lib_prefix=no
   need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
   case $host_os in
   irix5* | nonstopux*)
     libsuff= shlibsuff=
@@ -11023,8 +11693,8 @@
   esac
   shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
   shlibpath_overrides_runpath=no
-  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
-  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
+  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
   hardcode_into_libs=yes
   ;;
 
@@ -11033,13 +11703,33 @@
   dynamic_linker=no
   ;;
 
+linux*android*)
+  version_type=none # Android doesn't support versioned libraries.
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext'
+  soname_spec='$libname$release$shared_ext'
+  finish_cmds=
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  dynamic_linker='Android linker'
+  # Don't embed -rpath directories since the linker doesn't support them.
+  hardcode_libdir_flag_spec='-L$libdir'
+  ;;
+
 # This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
@@ -11083,14 +11773,10 @@
   # before this can be enabled.
   hardcode_into_libs=yes
 
-  # Add ABI-specific directories to the system library path.
-  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
-
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
     lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
-
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
   # We used to test for /lib/ld.so.1 and disable shared libraries on
@@ -11107,12 +11793,12 @@
   need_lib_prefix=no
   need_version=no
   if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
     finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
     dynamic_linker='NetBSD (a.out) ld.so'
   else
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
     dynamic_linker='NetBSD ld.elf_so'
   fi
   shlibpath_var=LD_LIBRARY_PATH
@@ -11122,7 +11808,7 @@
 
 newsos6)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
   ;;
@@ -11131,45 +11817,34 @@
   version_type=qnx
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
   hardcode_into_libs=yes
   dynamic_linker='ldqnx.so'
   ;;
 
-openbsd*)
+openbsd* | bitrig*)
   version_type=sunos
-  sys_lib_dlsearch_path_spec="/usr/lib"
+  sys_lib_dlsearch_path_spec=/usr/lib
   need_lib_prefix=no
-  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
-  case $host_os in
-    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
-    *)				need_version=no  ;;
-  esac
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+    need_version=no
+  else
+    need_version=yes
+  fi
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
   shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    case $host_os in
-      openbsd2.[89] | openbsd2.[89].*)
-	shlibpath_overrides_runpath=no
-	;;
-      *)
-	shlibpath_overrides_runpath=yes
-	;;
-      esac
-  else
-    shlibpath_overrides_runpath=yes
-  fi
+  shlibpath_overrides_runpath=yes
   ;;
 
 os2*)
   libname_spec='$name'
-  shrext_cmds=".dll"
+  shrext_cmds=.dll
   need_lib_prefix=no
-  library_names_spec='$libname${shared_ext} $libname.a'
+  library_names_spec='$libname$shared_ext $libname.a'
   dynamic_linker='OS/2 ld.exe'
   shlibpath_var=LIBPATH
   ;;
@@ -11178,11 +11853,11 @@
   version_type=osf
   need_lib_prefix=no
   need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
   shlibpath_var=LD_LIBRARY_PATH
   sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
   ;;
 
 rdos*)
@@ -11193,8 +11868,8 @@
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
   hardcode_into_libs=yes
@@ -11204,11 +11879,11 @@
 
 sunos4*)
   version_type=sunos
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
   finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
-  if test "$with_gnu_ld" = yes; then
+  if test yes = "$with_gnu_ld"; then
     need_lib_prefix=no
   fi
   need_version=yes
@@ -11216,8 +11891,8 @@
 
 sysv4 | sysv4.3*)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   case $host_vendor in
     sni)
@@ -11238,10 +11913,10 @@
   ;;
 
 sysv4*MP*)
-  if test -d /usr/nec ;then
+  if test -d /usr/nec; then
     version_type=linux # correct to gnu/linux during the next big refactor
-    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
-    soname_spec='$libname${shared_ext}.$major'
+    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
+    soname_spec='$libname$shared_ext.$major'
     shlibpath_var=LD_LIBRARY_PATH
   fi
   ;;
@@ -11250,12 +11925,12 @@
   version_type=freebsd-elf
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
   hardcode_into_libs=yes
-  if test "$with_gnu_ld" = yes; then
+  if test yes = "$with_gnu_ld"; then
     sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
   else
     sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
@@ -11273,7 +11948,7 @@
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
   hardcode_into_libs=yes
@@ -11281,8 +11956,8 @@
 
 uts4*)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
@@ -11292,18 +11967,18 @@
 esac
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
 $as_echo "$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
+test no = "$dynamic_linker" && can_build_shared=no
 
 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
   variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
 fi
 
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
-  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
+  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
 fi
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
-  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
+  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
 fi
 
 
@@ -11402,15 +12077,15 @@
 hardcode_action=
 if test -n "$hardcode_libdir_flag_spec" ||
    test -n "$runpath_var" ||
-   test "X$hardcode_automatic" = "Xyes" ; then
+   test yes = "$hardcode_automatic"; then
 
   # We can hardcode non-existent directories.
-  if test "$hardcode_direct" != no &&
+  if test no != "$hardcode_direct" &&
      # If the only mechanism to avoid hardcoding is shlibpath_var, we
      # have to relink, otherwise we might link with an installed library
      # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
-     test "$hardcode_minus_L" != no; then
+     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" &&
+     test no != "$hardcode_minus_L"; then
     # Linking always hardcodes the temporary library directory.
     hardcode_action=relink
   else
@@ -11425,12 +12100,12 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
 $as_echo "$hardcode_action" >&6; }
 
-if test "$hardcode_action" = relink ||
-   test "$inherit_rpath" = yes; then
+if test relink = "$hardcode_action" ||
+   test yes = "$inherit_rpath"; then
   # Fast installation is not supported
   enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
+elif test yes = "$shlibpath_overrides_runpath" ||
+     test no = "$enable_shared"; then
   # Fast installation is not necessary
   enable_fast_install=needless
 fi
@@ -11440,7 +12115,7 @@
 
 
 
-  if test "x$enable_dlopen" != xyes; then
+  if test yes != "$enable_dlopen"; then
   enable_dlopen=unknown
   enable_dlopen_self=unknown
   enable_dlopen_self_static=unknown
@@ -11450,23 +12125,23 @@
 
   case $host_os in
   beos*)
-    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen=load_add_on
     lt_cv_dlopen_libs=
     lt_cv_dlopen_self=yes
     ;;
 
   mingw* | pw32* | cegcc*)
-    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen=LoadLibrary
     lt_cv_dlopen_libs=
     ;;
 
   cygwin*)
-    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen=dlopen
     lt_cv_dlopen_libs=
     ;;
 
   darwin*)
-  # if libdl is installed we need to link against it
+    # if libdl is installed we need to link against it
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
 $as_echo_n "checking for dlopen in -ldl... " >&6; }
 if ${ac_cv_lib_dl_dlopen+:} false; then :
@@ -11504,10 +12179,10 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
 $as_echo "$ac_cv_lib_dl_dlopen" >&6; }
 if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+  lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
 else
 
-    lt_cv_dlopen="dyld"
+    lt_cv_dlopen=dyld
     lt_cv_dlopen_libs=
     lt_cv_dlopen_self=yes
 
@@ -11515,10 +12190,18 @@
 
     ;;
 
+  tpf*)
+    # Don't try to run any link tests for TPF.  We know it's impossible
+    # because TPF is a cross-compiler, and we know how we open DSOs.
+    lt_cv_dlopen=dlopen
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=no
+    ;;
+
   *)
     ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
 if test "x$ac_cv_func_shl_load" = xyes; then :
-  lt_cv_dlopen="shl_load"
+  lt_cv_dlopen=shl_load
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
 $as_echo_n "checking for shl_load in -ldld... " >&6; }
@@ -11557,11 +12240,11 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
 $as_echo "$ac_cv_lib_dld_shl_load" >&6; }
 if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
-  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
+  lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld
 else
   ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
 if test "x$ac_cv_func_dlopen" = xyes; then :
-  lt_cv_dlopen="dlopen"
+  lt_cv_dlopen=dlopen
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
 $as_echo_n "checking for dlopen in -ldl... " >&6; }
@@ -11600,7 +12283,7 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
 $as_echo "$ac_cv_lib_dl_dlopen" >&6; }
 if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+  lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
 $as_echo_n "checking for dlopen in -lsvld... " >&6; }
@@ -11639,7 +12322,7 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
 $as_echo "$ac_cv_lib_svld_dlopen" >&6; }
 if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+  lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
 $as_echo_n "checking for dld_link in -ldld... " >&6; }
@@ -11678,7 +12361,7 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
 $as_echo "$ac_cv_lib_dld_dld_link" >&6; }
 if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
-  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
+  lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld
 fi
 
 
@@ -11699,21 +12382,21 @@
     ;;
   esac
 
-  if test "x$lt_cv_dlopen" != xno; then
-    enable_dlopen=yes
-  else
+  if test no = "$lt_cv_dlopen"; then
     enable_dlopen=no
+  else
+    enable_dlopen=yes
   fi
 
   case $lt_cv_dlopen in
   dlopen)
-    save_CPPFLAGS="$CPPFLAGS"
-    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+    save_CPPFLAGS=$CPPFLAGS
+    test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
 
-    save_LDFLAGS="$LDFLAGS"
+    save_LDFLAGS=$LDFLAGS
     wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
 
-    save_LIBS="$LIBS"
+    save_LIBS=$LIBS
     LIBS="$lt_cv_dlopen_libs $LIBS"
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
@@ -11721,7 +12404,7 @@
 if ${lt_cv_dlopen_self+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  	  if test "$cross_compiling" = yes; then :
+  	  if test yes = "$cross_compiling"; then :
   lt_cv_dlopen_self=cross
 else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
@@ -11770,7 +12453,7 @@
 
 /* When -fvisbility=hidden is used, assume the code has been annotated
    correspondingly for the symbols needed.  */
-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
 int fnord () __attribute__((visibility("default")));
 #endif
 
@@ -11800,7 +12483,7 @@
   (eval $ac_link) 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+  test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
     (./conftest; exit; ) >&5 2>/dev/null
     lt_status=$?
     case x$lt_status in
@@ -11820,14 +12503,14 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
 $as_echo "$lt_cv_dlopen_self" >&6; }
 
-    if test "x$lt_cv_dlopen_self" = xyes; then
+    if test yes = "$lt_cv_dlopen_self"; then
       wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
 if ${lt_cv_dlopen_self_static+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  	  if test "$cross_compiling" = yes; then :
+  	  if test yes = "$cross_compiling"; then :
   lt_cv_dlopen_self_static=cross
 else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
@@ -11876,7 +12559,7 @@
 
 /* When -fvisbility=hidden is used, assume the code has been annotated
    correspondingly for the symbols needed.  */
-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
 int fnord () __attribute__((visibility("default")));
 #endif
 
@@ -11906,7 +12589,7 @@
   (eval $ac_link) 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+  test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
     (./conftest; exit; ) >&5 2>/dev/null
     lt_status=$?
     case x$lt_status in
@@ -11927,9 +12610,9 @@
 $as_echo "$lt_cv_dlopen_self_static" >&6; }
     fi
 
-    CPPFLAGS="$save_CPPFLAGS"
-    LDFLAGS="$save_LDFLAGS"
-    LIBS="$save_LIBS"
+    CPPFLAGS=$save_CPPFLAGS
+    LDFLAGS=$save_LDFLAGS
+    LIBS=$save_LIBS
     ;;
   esac
 
@@ -11973,7 +12656,7 @@
 # FIXME - insert some real tests, host_os isn't really good enough
   case $host_os in
   darwin*)
-    if test -n "$STRIP" ; then
+    if test -n "$STRIP"; then
       striplib="$STRIP -x"
       old_striplib="$STRIP -S"
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
@@ -12001,7 +12684,7 @@
 
 
 
-  # Report which library types will actually be built
+  # Report what library types will actually be built
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
 $as_echo_n "checking if libtool supports shared libraries... " >&6; }
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
@@ -12009,13 +12692,13 @@
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
 $as_echo_n "checking whether to build shared libraries... " >&6; }
-  test "$can_build_shared" = "no" && enable_shared=no
+  test no = "$can_build_shared" && enable_shared=no
 
   # On AIX, shared libraries and static libraries use the same namespace, and
   # are all built from PIC.
   case $host_os in
   aix3*)
-    test "$enable_shared" = yes && enable_static=no
+    test yes = "$enable_shared" && enable_static=no
     if test -n "$RANLIB"; then
       archive_cmds="$archive_cmds~\$RANLIB \$lib"
       postinstall_cmds='$RANLIB $lib'
@@ -12023,8 +12706,8 @@
     ;;
 
   aix[4-9]*)
-    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-      test "$enable_shared" = yes && enable_static=no
+    if test ia64 != "$host_cpu" && test no = "$aix_use_runtimelinking"; then
+      test yes = "$enable_shared" && enable_static=no
     fi
     ;;
   esac
@@ -12034,7 +12717,7 @@
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
 $as_echo_n "checking whether to build static libraries... " >&6; }
   # Make sure either enable_shared or enable_static is yes.
-  test "$enable_shared" = yes || enable_static=yes
+  test yes = "$enable_shared" || enable_static=yes
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
 $as_echo "$enable_static" >&6; }
 
@@ -12048,7 +12731,3187 @@
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-CC="$lt_save_CC"
+CC=$lt_save_CC
+
+      if test -n "$CXX" && ( test no != "$CXX" &&
+    ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
+    (test g++ != "$CXX"))); then
+  ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5
+$as_echo_n "checking how to run the C++ preprocessor... " >&6; }
+if test -z "$CXXCPP"; then
+  if ${ac_cv_prog_CXXCPP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CXXCPP needs to be expanded
+    for CXXCPP in "$CXX -E" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+  break
+fi
+
+    done
+    ac_cv_prog_CXXCPP=$CXXCPP
+
+fi
+  CXXCPP=$ac_cv_prog_CXXCPP
+else
+  ac_cv_prog_CXXCPP=$CXXCPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5
+$as_echo "$CXXCPP" >&6; }
+ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+else
+  _lt_caught_CXX_error=yes
+fi
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+archive_cmds_need_lc_CXX=no
+allow_undefined_flag_CXX=
+always_export_symbols_CXX=no
+archive_expsym_cmds_CXX=
+compiler_needs_object_CXX=no
+export_dynamic_flag_spec_CXX=
+hardcode_direct_CXX=no
+hardcode_direct_absolute_CXX=no
+hardcode_libdir_flag_spec_CXX=
+hardcode_libdir_separator_CXX=
+hardcode_minus_L_CXX=no
+hardcode_shlibpath_var_CXX=unsupported
+hardcode_automatic_CXX=no
+inherit_rpath_CXX=no
+module_cmds_CXX=
+module_expsym_cmds_CXX=
+link_all_deplibs_CXX=unknown
+old_archive_cmds_CXX=$old_archive_cmds
+reload_flag_CXX=$reload_flag
+reload_cmds_CXX=$reload_cmds
+no_undefined_flag_CXX=
+whole_archive_flag_spec_CXX=
+enable_shared_with_static_runtimes_CXX=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+objext_CXX=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test yes != "$_lt_caught_CXX_error"; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="int some_variable = 0;"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code='int main(int, char *[]) { return(0); }'
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+  # save warnings/boilerplate of simple test code
+  ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+
+  ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC=$CC
+  lt_save_CFLAGS=$CFLAGS
+  lt_save_LD=$LD
+  lt_save_GCC=$GCC
+  GCC=$GXX
+  lt_save_with_gnu_ld=$with_gnu_ld
+  lt_save_path_LD=$lt_cv_path_LD
+  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+  else
+    $as_unset lt_cv_prog_gnu_ld
+  fi
+  if test -n "${lt_cv_path_LDCXX+set}"; then
+    lt_cv_path_LD=$lt_cv_path_LDCXX
+  else
+    $as_unset lt_cv_path_LD
+  fi
+  test -z "${LDCXX+set}" || LD=$LDCXX
+  CC=${CXX-"c++"}
+  CFLAGS=$CXXFLAGS
+  compiler=$CC
+  compiler_CXX=$CC
+  for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+
+
+  if test -n "$compiler"; then
+    # We don't want -fno-exception when compiling C++ code, so set the
+    # no_builtin_flag separately
+    if test yes = "$GXX"; then
+      lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
+    else
+      lt_prog_compiler_no_builtin_flag_CXX=
+    fi
+
+    if test yes = "$GXX"; then
+      # Set up default GNU C++ configuration
+
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then :
+  withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test yes = "$GCC"; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return, which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [\\/]* | ?:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD=$ac_prog
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test yes = "$with_gnu_ld"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if ${lt_cv_path_LD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$LD"; then
+  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS=$lt_save_ifs
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD=$ac_dir/$ac_prog
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some variants of GNU ld only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+	test no != "$with_gnu_ld" && break
+	;;
+      *)
+	test yes != "$with_gnu_ld" && break
+	;;
+      esac
+    fi
+  done
+  IFS=$lt_save_ifs
+else
+  lt_cv_path_LD=$LD # Let the user override the test with a path.
+fi
+fi
+
+LD=$lt_cv_path_LD
+if test -n "$LD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if ${lt_cv_prog_gnu_ld+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+
+
+
+
+      # Check if GNU C++ uses GNU ld as the underlying linker, since the
+      # archiving commands below assume that GNU ld is being used.
+      if test yes = "$with_gnu_ld"; then
+        archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+        archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+
+        hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir'
+        export_dynamic_flag_spec_CXX='$wl--export-dynamic'
+
+        # If archive_cmds runs LD, not CC, wlarc should be empty
+        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+        #     investigate it a little bit more. (MM)
+        wlarc='$wl'
+
+        # ancient GNU ld didn't support --whole-archive et. al.
+        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+	  $GREP 'no-whole-archive' > /dev/null; then
+          whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
+        else
+          whole_archive_flag_spec_CXX=
+        fi
+      else
+        with_gnu_ld=no
+        wlarc=
+
+        # A generic and very simple default shared library creation
+        # command for GNU C++ for the case where it uses the native
+        # linker, instead of GNU ld.  If possible, this setting should
+        # overridden to take advantage of the native linker features on
+        # the platform it is being used on.
+        archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+      fi
+
+      # Commands to make compiler produce verbose output that lists
+      # what "hidden" libraries, object files and flags are used when
+      # linking a shared library.
+      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+    else
+      GXX=no
+      with_gnu_ld=no
+      wlarc=
+    fi
+
+    # PORTME: fill in a description of your system's C++ link characteristics
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+    ld_shlibs_CXX=yes
+    case $host_os in
+      aix3*)
+        # FIXME: insert proper C++ library support
+        ld_shlibs_CXX=no
+        ;;
+      aix[4-9]*)
+        if test ia64 = "$host_cpu"; then
+          # On IA64, the linker does run time linking by default, so we don't
+          # have to do anything special.
+          aix_use_runtimelinking=no
+          exp_sym_flag='-Bexport'
+          no_entry_flag=
+        else
+          aix_use_runtimelinking=no
+
+          # Test if we are trying to use run time linking or normal
+          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+          # need to do runtime linking.
+          case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+	    for ld_flag in $LDFLAGS; do
+	      case $ld_flag in
+	      *-brtl*)
+	        aix_use_runtimelinking=yes
+	        break
+	        ;;
+	      esac
+	    done
+	    ;;
+          esac
+
+          exp_sym_flag='-bexport'
+          no_entry_flag='-bnoentry'
+        fi
+
+        # When large executables or shared objects are built, AIX ld can
+        # have problems creating the table of contents.  If linking a library
+        # or program results in "error TOC overflow" add -mminimal-toc to
+        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+        archive_cmds_CXX=''
+        hardcode_direct_CXX=yes
+        hardcode_direct_absolute_CXX=yes
+        hardcode_libdir_separator_CXX=':'
+        link_all_deplibs_CXX=yes
+        file_list_spec_CXX='$wl-f,'
+
+        if test yes = "$GXX"; then
+          case $host_os in aix4.[012]|aix4.[012].*)
+          # We only want to do this on AIX 4.2 and lower, the check
+          # below for broken collect2 doesn't work under 4.3+
+	  collect2name=`$CC -print-prog-name=collect2`
+	  if test -f "$collect2name" &&
+	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+	  then
+	    # We have reworked collect2
+	    :
+	  else
+	    # We have old collect2
+	    hardcode_direct_CXX=unsupported
+	    # It fails to find uninstalled libraries when the uninstalled
+	    # path is not listed in the libpath.  Setting hardcode_minus_L
+	    # to unsupported forces relinking
+	    hardcode_minus_L_CXX=yes
+	    hardcode_libdir_flag_spec_CXX='-L$libdir'
+	    hardcode_libdir_separator_CXX=
+	  fi
+          esac
+          shared_flag='-shared'
+	  if test yes = "$aix_use_runtimelinking"; then
+	    shared_flag=$shared_flag' $wl-G'
+	  fi
+        else
+          # not using gcc
+          if test ia64 = "$host_cpu"; then
+	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+	  # chokes on -Wl,-G. The following line is correct:
+	  shared_flag='-G'
+          else
+	    if test yes = "$aix_use_runtimelinking"; then
+	      shared_flag='$wl-G'
+	    else
+	      shared_flag='$wl-bM:SRE'
+	    fi
+          fi
+        fi
+
+        export_dynamic_flag_spec_CXX='$wl-bexpall'
+        # It seems that -bexpall does not export symbols beginning with
+        # underscore (_), so it is better to generate a list of symbols to
+	# export.
+        always_export_symbols_CXX=yes
+        if test yes = "$aix_use_runtimelinking"; then
+          # Warning - without using the other runtime loading flags (-brtl),
+          # -berok will link without error, but may produce a broken library.
+          allow_undefined_flag_CXX='-berok'
+          # Determine the default libpath from the value encoded in an empty
+          # executable.
+          if test set = "${lt_cv_aix_libpath+set}"; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  if ${lt_cv_aix_libpath__CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+
+  lt_aix_libpath_sed='
+      /Import File Strings/,/^$/ {
+	  /^0/ {
+	      s/^0  *\([^ ]*\) *$/\1/
+	      p
+	  }
+      }'
+  lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$lt_cv_aix_libpath__CXX"; then
+    lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  if test -z "$lt_cv_aix_libpath__CXX"; then
+    lt_cv_aix_libpath__CXX=/usr/lib:/lib
+  fi
+
+fi
+
+  aix_libpath=$lt_cv_aix_libpath__CXX
+fi
+
+          hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath"
+
+          archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
+        else
+          if test ia64 = "$host_cpu"; then
+	    hardcode_libdir_flag_spec_CXX='$wl-R $libdir:/usr/lib:/lib'
+	    allow_undefined_flag_CXX="-z nodefs"
+	    archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
+          else
+	    # Determine the default libpath from the value encoded in an
+	    # empty executable.
+	    if test set = "${lt_cv_aix_libpath+set}"; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  if ${lt_cv_aix_libpath__CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+
+  lt_aix_libpath_sed='
+      /Import File Strings/,/^$/ {
+	  /^0/ {
+	      s/^0  *\([^ ]*\) *$/\1/
+	      p
+	  }
+      }'
+  lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$lt_cv_aix_libpath__CXX"; then
+    lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  if test -z "$lt_cv_aix_libpath__CXX"; then
+    lt_cv_aix_libpath__CXX=/usr/lib:/lib
+  fi
+
+fi
+
+  aix_libpath=$lt_cv_aix_libpath__CXX
+fi
+
+	    hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath"
+	    # Warning - without using the other run time loading flags,
+	    # -berok will link without error, but may produce a broken library.
+	    no_undefined_flag_CXX=' $wl-bernotok'
+	    allow_undefined_flag_CXX=' $wl-berok'
+	    if test yes = "$with_gnu_ld"; then
+	      # We only use this code for GNU lds that support --whole-archive.
+	      whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive'
+	    else
+	      # Exported symbols can be pulled into shared objects from archives
+	      whole_archive_flag_spec_CXX='$convenience'
+	    fi
+	    archive_cmds_need_lc_CXX=yes
+	    # This is similar to how AIX traditionally builds its shared
+	    # libraries.
+	    archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $wl-bnoentry $compiler_flags $wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+          fi
+        fi
+        ;;
+
+      beos*)
+	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	  allow_undefined_flag_CXX=unsupported
+	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+	  # support --undefined.  This deserves some investigation.  FIXME
+	  archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	else
+	  ld_shlibs_CXX=no
+	fi
+	;;
+
+      chorus*)
+        case $cc_basename in
+          *)
+	  # FIXME: insert proper C++ library support
+	  ld_shlibs_CXX=no
+	  ;;
+        esac
+        ;;
+
+      cygwin* | mingw* | pw32* | cegcc*)
+	case $GXX,$cc_basename in
+	,cl* | no,cl*)
+	  # Native MSVC
+	  # hardcode_libdir_flag_spec is actually meaningless, as there is
+	  # no search path for DLLs.
+	  hardcode_libdir_flag_spec_CXX=' '
+	  allow_undefined_flag_CXX=unsupported
+	  always_export_symbols_CXX=yes
+	  file_list_spec_CXX='@'
+	  # Tell ltmain to make .lib files, not .a files.
+	  libext=lib
+	  # Tell ltmain to make .dll files, not .so files.
+	  shrext_cmds=.dll
+	  # FIXME: Setting linknames here is a bad hack.
+	  archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+	  archive_expsym_cmds_CXX='if   test DEF = "`$SED -n     -e '\''s/^[	 ]*//'\''     -e '\''/^\(;.*\)*$/d'\''     -e '\''s/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p'\''     -e q     $export_symbols`" ; then
+              cp "$export_symbols" "$output_objdir/$soname.def";
+              echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
+            else
+              $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+            fi~
+            $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+            linknames='
+	  # The linker will not automatically build a static lib if we build a DLL.
+	  # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true'
+	  enable_shared_with_static_runtimes_CXX=yes
+	  # Don't use ranlib
+	  old_postinstall_cmds_CXX='chmod 644 $oldlib'
+	  postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~
+            lt_tool_outputfile="@TOOL_OUTPUT@"~
+            case $lt_outputfile in
+              *.exe|*.EXE) ;;
+              *)
+                lt_outputfile=$lt_outputfile.exe
+                lt_tool_outputfile=$lt_tool_outputfile.exe
+                ;;
+            esac~
+            func_to_tool_file "$lt_outputfile"~
+            if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
+              $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+              $RM "$lt_outputfile.manifest";
+            fi'
+	  ;;
+	*)
+	  # g++
+	  # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
+	  # as there is no search path for DLLs.
+	  hardcode_libdir_flag_spec_CXX='-L$libdir'
+	  export_dynamic_flag_spec_CXX='$wl--export-all-symbols'
+	  allow_undefined_flag_CXX=unsupported
+	  always_export_symbols_CXX=no
+	  enable_shared_with_static_runtimes_CXX=yes
+
+	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	    # If the export-symbols file already is a .def file, use it as
+	    # is; otherwise, prepend EXPORTS...
+	    archive_expsym_cmds_CXX='if   test DEF = "`$SED -n     -e '\''s/^[	 ]*//'\''     -e '\''/^\(;.*\)*$/d'\''     -e '\''s/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p'\''     -e q     $export_symbols`" ; then
+              cp $export_symbols $output_objdir/$soname.def;
+            else
+              echo EXPORTS > $output_objdir/$soname.def;
+              cat $export_symbols >> $output_objdir/$soname.def;
+            fi~
+            $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	  else
+	    ld_shlibs_CXX=no
+	  fi
+	  ;;
+	esac
+	;;
+      darwin* | rhapsody*)
+
+
+  archive_cmds_need_lc_CXX=no
+  hardcode_direct_CXX=no
+  hardcode_automatic_CXX=yes
+  hardcode_shlibpath_var_CXX=unsupported
+  if test yes = "$lt_cv_ld_force_load"; then
+    whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+
+  else
+    whole_archive_flag_spec_CXX=''
+  fi
+  link_all_deplibs_CXX=yes
+  allow_undefined_flag_CXX=$_lt_dar_allow_undefined
+  case $cc_basename in
+     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
+     *) _lt_dar_can_shared=$GCC ;;
+  esac
+  if test yes = "$_lt_dar_can_shared"; then
+    output_verbose_link_cmd=func_echo_all
+    archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
+    module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
+    archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
+    module_expsym_cmds_CXX="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
+       if test yes != "$lt_cv_apple_cc_single_mod"; then
+      archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil"
+      archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
+    fi
+
+  else
+  ld_shlibs_CXX=no
+  fi
+
+	;;
+
+      dgux*)
+        case $cc_basename in
+          ec++*)
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+          ghcx*)
+	    # Green Hills C++ Compiler
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+          *)
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+        esac
+        ;;
+
+      freebsd2.*)
+        # C++ shared libraries reported to be fairly broken before
+	# switch to ELF
+        ld_shlibs_CXX=no
+        ;;
+
+      freebsd-elf*)
+        archive_cmds_need_lc_CXX=no
+        ;;
+
+      freebsd* | dragonfly*)
+        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+        # conventions
+        ld_shlibs_CXX=yes
+        ;;
+
+      haiku*)
+        archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+        link_all_deplibs_CXX=yes
+        ;;
+
+      hpux9*)
+        hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir'
+        hardcode_libdir_separator_CXX=:
+        export_dynamic_flag_spec_CXX='$wl-E'
+        hardcode_direct_CXX=yes
+        hardcode_minus_L_CXX=yes # Not in the search PATH,
+				             # but as the default
+				             # location of the library.
+
+        case $cc_basename in
+          CC*)
+            # FIXME: insert proper C++ library support
+            ld_shlibs_CXX=no
+            ;;
+          aCC*)
+            archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+            # Commands to make compiler produce verbose output that lists
+            # what "hidden" libraries, object files and flags are used when
+            # linking a shared library.
+            #
+            # There doesn't appear to be a way to prevent this compiler from
+            # explicitly linking system object files so we need to strip them
+            # from the output so that they don't get included in the library
+            # dependencies.
+            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+            ;;
+          *)
+            if test yes = "$GXX"; then
+              archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+            else
+              # FIXME: insert proper C++ library support
+              ld_shlibs_CXX=no
+            fi
+            ;;
+        esac
+        ;;
+
+      hpux10*|hpux11*)
+        if test no = "$with_gnu_ld"; then
+	  hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir'
+	  hardcode_libdir_separator_CXX=:
+
+          case $host_cpu in
+            hppa*64*|ia64*)
+              ;;
+            *)
+	      export_dynamic_flag_spec_CXX='$wl-E'
+              ;;
+          esac
+        fi
+        case $host_cpu in
+          hppa*64*|ia64*)
+            hardcode_direct_CXX=no
+            hardcode_shlibpath_var_CXX=no
+            ;;
+          *)
+            hardcode_direct_CXX=yes
+            hardcode_direct_absolute_CXX=yes
+            hardcode_minus_L_CXX=yes # Not in the search PATH,
+					         # but as the default
+					         # location of the library.
+            ;;
+        esac
+
+        case $cc_basename in
+          CC*)
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+          aCC*)
+	    case $host_cpu in
+	      hppa*64*)
+	        archive_cmds_CXX='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        ;;
+	      ia64*)
+	        archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        ;;
+	      *)
+	        archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        ;;
+	    esac
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+	    ;;
+          *)
+	    if test yes = "$GXX"; then
+	      if test no = "$with_gnu_ld"; then
+	        case $host_cpu in
+	          hppa*64*)
+	            archive_cmds_CXX='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            ;;
+	          ia64*)
+	            archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            ;;
+	          *)
+	            archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            ;;
+	        esac
+	      fi
+	    else
+	      # FIXME: insert proper C++ library support
+	      ld_shlibs_CXX=no
+	    fi
+	    ;;
+        esac
+        ;;
+
+      interix[3-9]*)
+	hardcode_direct_CXX=no
+	hardcode_shlibpath_var_CXX=no
+	hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir'
+	export_dynamic_flag_spec_CXX='$wl-E'
+	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+	# Instead, shared libraries are loaded at an image base (0x10000000 by
+	# default) and relocated if they conflict, which is a slow very memory
+	# consuming and fragmenting process.  To avoid this, we pick a random,
+	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+	archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	archive_expsym_cmds_CXX='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	;;
+      irix5* | irix6*)
+        case $cc_basename in
+          CC*)
+	    # SGI C++
+	    archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+
+	    # Archives containing C++ object files must be created using
+	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
+	    # necessary to make sure instantiated templates are included
+	    # in the archive.
+	    old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
+	    ;;
+          *)
+	    if test yes = "$GXX"; then
+	      if test no = "$with_gnu_ld"; then
+	        archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+	      else
+	        archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib'
+	      fi
+	    fi
+	    link_all_deplibs_CXX=yes
+	    ;;
+        esac
+        hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir'
+        hardcode_libdir_separator_CXX=:
+        inherit_rpath_CXX=yes
+        ;;
+
+      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+        case $cc_basename in
+          KCC*)
+	    # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+	    # KCC will only create a shared library if the output file
+	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
+	    # to its proper name (with version) after linking.
+	    archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+	    archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib'
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+
+	    hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir'
+	    export_dynamic_flag_spec_CXX='$wl--export-dynamic'
+
+	    # Archives containing C++ object files must be created using
+	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	    old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+	    ;;
+	  icpc* | ecpc* )
+	    # Intel C++
+	    with_gnu_ld=yes
+	    # version 8.0 and above of icpc choke on multiply defined symbols
+	    # if we add $predep_objects and $postdep_objects, however 7.1 and
+	    # earlier do not add the objects themselves.
+	    case `$CC -V 2>&1` in
+	      *"Version 7."*)
+	        archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+		archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+		;;
+	      *)  # Version 8.0 or newer
+	        tmp_idyn=
+	        case $host_cpu in
+		  ia64*) tmp_idyn=' -i_dynamic';;
+		esac
+	        archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+		archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+		;;
+	    esac
+	    archive_cmds_need_lc_CXX=no
+	    hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir'
+	    export_dynamic_flag_spec_CXX='$wl--export-dynamic'
+	    whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive'
+	    ;;
+          pgCC* | pgcpp*)
+            # Portland Group C++ compiler
+	    case `$CC -V` in
+	    *pgCC\ [1-5].* | *pgcpp\ [1-5].*)
+	      prelink_cmds_CXX='tpldir=Template.dir~
+               rm -rf $tpldir~
+               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+	      old_archive_cmds_CXX='tpldir=Template.dir~
+                rm -rf $tpldir~
+                $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+                $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+                $RANLIB $oldlib'
+	      archive_cmds_CXX='tpldir=Template.dir~
+                rm -rf $tpldir~
+                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+	      archive_expsym_cmds_CXX='tpldir=Template.dir~
+                rm -rf $tpldir~
+                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+	      ;;
+	    *) # Version 6 and above use weak symbols
+	      archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+	      archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+	      ;;
+	    esac
+
+	    hardcode_libdir_flag_spec_CXX='$wl--rpath $wl$libdir'
+	    export_dynamic_flag_spec_CXX='$wl--export-dynamic'
+	    whole_archive_flag_spec_CXX='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+            ;;
+	  cxx*)
+	    # Compaq C++
+	    archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+	    archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname  -o $lib $wl-retain-symbols-file $wl$export_symbols'
+
+	    runpath_var=LD_RUN_PATH
+	    hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+	    hardcode_libdir_separator_CXX=:
+
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+	    ;;
+	  xl* | mpixl* | bgxl*)
+	    # IBM XL 8.0 on PPC, with GNU ld
+	    hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir'
+	    export_dynamic_flag_spec_CXX='$wl--export-dynamic'
+	    archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	    if test yes = "$supports_anon_versioning"; then
+	      archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~
+                cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+                echo "local: *; };" >> $output_objdir/$libname.ver~
+                $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
+	    fi
+	    ;;
+	  *)
+	    case `$CC -V 2>&1 | sed 5q` in
+	    *Sun\ C*)
+	      # Sun C++ 5.9
+	      no_undefined_flag_CXX=' -zdefs'
+	      archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	      archive_expsym_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols'
+	      hardcode_libdir_flag_spec_CXX='-R$libdir'
+	      whole_archive_flag_spec_CXX='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+	      compiler_needs_object_CXX=yes
+
+	      # Not sure whether something based on
+	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+	      # would be better.
+	      output_verbose_link_cmd='func_echo_all'
+
+	      # Archives containing C++ object files must be created using
+	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+	      # necessary to make sure instantiated templates are included
+	      # in the archive.
+	      old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+	      ;;
+	    esac
+	    ;;
+	esac
+	;;
+
+      lynxos*)
+        # FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+
+      m88k*)
+        # FIXME: insert proper C++ library support
+        ld_shlibs_CXX=no
+	;;
+
+      mvs*)
+        case $cc_basename in
+          cxx*)
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+	  *)
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+	esac
+	;;
+
+      netbsd*)
+        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	  archive_cmds_CXX='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+	  wlarc=
+	  hardcode_libdir_flag_spec_CXX='-R$libdir'
+	  hardcode_direct_CXX=yes
+	  hardcode_shlibpath_var_CXX=no
+	fi
+	# Workaround some broken pre-1.5 toolchains
+	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+	;;
+
+      *nto* | *qnx*)
+        ld_shlibs_CXX=yes
+	;;
+
+      openbsd* | bitrig*)
+	if test -f /usr/libexec/ld.so; then
+	  hardcode_direct_CXX=yes
+	  hardcode_shlibpath_var_CXX=no
+	  hardcode_direct_absolute_CXX=yes
+	  archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+	  hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir'
+	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
+	    archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib'
+	    export_dynamic_flag_spec_CXX='$wl-E'
+	    whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
+	  fi
+	  output_verbose_link_cmd=func_echo_all
+	else
+	  ld_shlibs_CXX=no
+	fi
+	;;
+
+      osf3* | osf4* | osf5*)
+        case $cc_basename in
+          KCC*)
+	    # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+	    # KCC will only create a shared library if the output file
+	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
+	    # to its proper name (with version) after linking.
+	    archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+	    hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir'
+	    hardcode_libdir_separator_CXX=:
+
+	    # Archives containing C++ object files must be created using
+	    # the KAI C++ compiler.
+	    case $host in
+	      osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;;
+	      *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;;
+	    esac
+	    ;;
+          RCC*)
+	    # Rational C++ 2.4.1
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+          cxx*)
+	    case $host in
+	      osf3*)
+	        allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*'
+	        archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+	        hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir'
+		;;
+	      *)
+	        allow_undefined_flag_CXX=' -expect_unresolved \*'
+	        archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+	        archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+                  echo "-hidden">> $lib.exp~
+                  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~
+                  $RM $lib.exp'
+	        hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+		;;
+	    esac
+
+	    hardcode_libdir_separator_CXX=:
+
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+	    ;;
+	  *)
+	    if test yes,no = "$GXX,$with_gnu_ld"; then
+	      allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*'
+	      case $host in
+	        osf3*)
+	          archive_cmds_CXX='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+		  ;;
+	        *)
+	          archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+		  ;;
+	      esac
+
+	      hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir'
+	      hardcode_libdir_separator_CXX=:
+
+	      # Commands to make compiler produce verbose output that lists
+	      # what "hidden" libraries, object files and flags are used when
+	      # linking a shared library.
+	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+	    else
+	      # FIXME: insert proper C++ library support
+	      ld_shlibs_CXX=no
+	    fi
+	    ;;
+        esac
+        ;;
+
+      psos*)
+        # FIXME: insert proper C++ library support
+        ld_shlibs_CXX=no
+        ;;
+
+      sunos4*)
+        case $cc_basename in
+          CC*)
+	    # Sun C++ 4.x
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+          lcc*)
+	    # Lucid
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+          *)
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+        esac
+        ;;
+
+      solaris*)
+        case $cc_basename in
+          CC* | sunCC*)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+            archive_cmds_need_lc_CXX=yes
+	    no_undefined_flag_CXX=' -zdefs'
+	    archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	    archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+              $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+	    hardcode_libdir_flag_spec_CXX='-R$libdir'
+	    hardcode_shlibpath_var_CXX=no
+	    case $host_os in
+	      solaris2.[0-5] | solaris2.[0-5].*) ;;
+	      *)
+		# The compiler driver will combine and reorder linker options,
+		# but understands '-z linker_flag'.
+	        # Supported since Solaris 2.6 (maybe 2.5.1?)
+		whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract'
+	        ;;
+	    esac
+	    link_all_deplibs_CXX=yes
+
+	    output_verbose_link_cmd='func_echo_all'
+
+	    # Archives containing C++ object files must be created using
+	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+	    # necessary to make sure instantiated templates are included
+	    # in the archive.
+	    old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+	    ;;
+          gcx*)
+	    # Green Hills C++ Compiler
+	    archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
+
+	    # The C++ compiler must be used to create the archive.
+	    old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+	    ;;
+          *)
+	    # GNU C++ compiler with Solaris linker
+	    if test yes,no = "$GXX,$with_gnu_ld"; then
+	      no_undefined_flag_CXX=' $wl-z ${wl}defs'
+	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+	        archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
+	        archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+                  $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+	        # Commands to make compiler produce verbose output that lists
+	        # what "hidden" libraries, object files and flags are used when
+	        # linking a shared library.
+	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+	      else
+	        # g++ 2.7 appears to require '-G' NOT '-shared' on this
+	        # platform.
+	        archive_cmds_CXX='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
+	        archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+                  $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+	        # Commands to make compiler produce verbose output that lists
+	        # what "hidden" libraries, object files and flags are used when
+	        # linking a shared library.
+	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+	      fi
+
+	      hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir'
+	      case $host_os in
+		solaris2.[0-5] | solaris2.[0-5].*) ;;
+		*)
+		  whole_archive_flag_spec_CXX='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
+		  ;;
+	      esac
+	    fi
+	    ;;
+        esac
+        ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+      no_undefined_flag_CXX='$wl-z,text'
+      archive_cmds_need_lc_CXX=no
+      hardcode_shlibpath_var_CXX=no
+      runpath_var='LD_RUN_PATH'
+
+      case $cc_basename in
+        CC*)
+	  archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+      esac
+      ;;
+
+      sysv5* | sco3.2v5* | sco5v6*)
+	# Note: We CANNOT use -z defs as we might desire, because we do not
+	# link with -lc, and that would cause any symbols used from libc to
+	# always be unresolved, which means just about no library would
+	# ever link correctly.  If we're not using GNU ld we use -z text
+	# though, which does catch some bad symbols but isn't as heavy-handed
+	# as -z defs.
+	no_undefined_flag_CXX='$wl-z,text'
+	allow_undefined_flag_CXX='$wl-z,nodefs'
+	archive_cmds_need_lc_CXX=no
+	hardcode_shlibpath_var_CXX=no
+	hardcode_libdir_flag_spec_CXX='$wl-R,$libdir'
+	hardcode_libdir_separator_CXX=':'
+	link_all_deplibs_CXX=yes
+	export_dynamic_flag_spec_CXX='$wl-Bexport'
+	runpath_var='LD_RUN_PATH'
+
+	case $cc_basename in
+          CC*)
+	    archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~
+              '"$old_archive_cmds_CXX"
+	    reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~
+              '"$reload_cmds_CXX"
+	    ;;
+	  *)
+	    archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    ;;
+	esac
+      ;;
+
+      tandem*)
+        case $cc_basename in
+          NCC*)
+	    # NonStop-UX NCC 3.20
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+          *)
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+        esac
+        ;;
+
+      vxworks*)
+        # FIXME: insert proper C++ library support
+        ld_shlibs_CXX=no
+        ;;
+
+      *)
+        # FIXME: insert proper C++ library support
+        ld_shlibs_CXX=no
+        ;;
+    esac
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
+$as_echo "$ld_shlibs_CXX" >&6; }
+    test no = "$ld_shlibs_CXX" && can_build_shared=no
+
+    GCC_CXX=$GXX
+    LD_CXX=$LD
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    # Dependencies to place before and after the object being linked:
+predep_objects_CXX=
+postdep_objects_CXX=
+predeps_CXX=
+postdeps_CXX=
+compiler_lib_search_path_CXX=
+
+cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+_LT_EOF
+
+
+_lt_libdeps_save_CFLAGS=$CFLAGS
+case "$CC $CFLAGS " in #(
+*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
+*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
+*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
+esac
+
+if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  # Parse the compiler output and extract the necessary
+  # objects, libraries and library flags.
+
+  # Sentinel used to keep track of whether or not we are before
+  # the conftest object file.
+  pre_test_object_deps_done=no
+
+  for p in `eval "$output_verbose_link_cmd"`; do
+    case $prev$p in
+
+    -L* | -R* | -l*)
+       # Some compilers place space between "-{L,R}" and the path.
+       # Remove the space.
+       if test x-L = "$p" ||
+          test x-R = "$p"; then
+	 prev=$p
+	 continue
+       fi
+
+       # Expand the sysroot to ease extracting the directories later.
+       if test -z "$prev"; then
+         case $p in
+         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
+         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
+         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
+         esac
+       fi
+       case $p in
+       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
+       esac
+       if test no = "$pre_test_object_deps_done"; then
+	 case $prev in
+	 -L | -R)
+	   # Internal compiler library paths should come after those
+	   # provided the user.  The postdeps already come after the
+	   # user supplied libs so there is no need to process them.
+	   if test -z "$compiler_lib_search_path_CXX"; then
+	     compiler_lib_search_path_CXX=$prev$p
+	   else
+	     compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} $prev$p"
+	   fi
+	   ;;
+	 # The "-l" case would never come before the object being
+	 # linked, so don't bother handling this case.
+	 esac
+       else
+	 if test -z "$postdeps_CXX"; then
+	   postdeps_CXX=$prev$p
+	 else
+	   postdeps_CXX="${postdeps_CXX} $prev$p"
+	 fi
+       fi
+       prev=
+       ;;
+
+    *.lto.$objext) ;; # Ignore GCC LTO objects
+    *.$objext)
+       # This assumes that the test object file only shows up
+       # once in the compiler output.
+       if test "$p" = "conftest.$objext"; then
+	 pre_test_object_deps_done=yes
+	 continue
+       fi
+
+       if test no = "$pre_test_object_deps_done"; then
+	 if test -z "$predep_objects_CXX"; then
+	   predep_objects_CXX=$p
+	 else
+	   predep_objects_CXX="$predep_objects_CXX $p"
+	 fi
+       else
+	 if test -z "$postdep_objects_CXX"; then
+	   postdep_objects_CXX=$p
+	 else
+	   postdep_objects_CXX="$postdep_objects_CXX $p"
+	 fi
+       fi
+       ;;
+
+    *) ;; # Ignore the rest.
+
+    esac
+  done
+
+  # Clean up.
+  rm -f a.out a.exe
+else
+  echo "libtool.m4: error: problem compiling CXX test program"
+fi
+
+$RM -f confest.$objext
+CFLAGS=$_lt_libdeps_save_CFLAGS
+
+# PORTME: override above test on systems where it is broken
+case $host_os in
+interix[3-9]*)
+  # Interix 3.5 installs completely hosed .la files for C++, so rather than
+  # hack all around it, let's just trust "g++" to DTRT.
+  predep_objects_CXX=
+  postdep_objects_CXX=
+  postdeps_CXX=
+  ;;
+
+linux*)
+  case `$CC -V 2>&1 | sed 5q` in
+  *Sun\ C*)
+    # Sun C++ 5.9
+
+    # The more standards-conforming stlport4 library is
+    # incompatible with the Cstd library. Avoid specifying
+    # it if it's in CXXFLAGS. Ignore libCrun as
+    # -library=stlport4 depends on it.
+    case " $CXX $CXXFLAGS " in
+    *" -library=stlport4 "*)
+      solaris_use_stlport4=yes
+      ;;
+    esac
+
+    if test yes != "$solaris_use_stlport4"; then
+      postdeps_CXX='-library=Cstd -library=Crun'
+    fi
+    ;;
+  esac
+  ;;
+
+solaris*)
+  case $cc_basename in
+  CC* | sunCC*)
+    # The more standards-conforming stlport4 library is
+    # incompatible with the Cstd library. Avoid specifying
+    # it if it's in CXXFLAGS. Ignore libCrun as
+    # -library=stlport4 depends on it.
+    case " $CXX $CXXFLAGS " in
+    *" -library=stlport4 "*)
+      solaris_use_stlport4=yes
+      ;;
+    esac
+
+    # Adding this requires a known-good setup of shared libraries for
+    # Sun compiler versions before 5.6, else PIC objects from an old
+    # archive will be linked into the output, leading to subtle bugs.
+    if test yes != "$solaris_use_stlport4"; then
+      postdeps_CXX='-library=Cstd -library=Crun'
+    fi
+    ;;
+  esac
+  ;;
+esac
+
+
+case " $postdeps_CXX " in
+*" -lc "*) archive_cmds_need_lc_CXX=no ;;
+esac
+ compiler_lib_search_dirs_CXX=
+if test -n "${compiler_lib_search_path_CXX}"; then
+ compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | $SED -e 's! -L! !g' -e 's!^ !!'`
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    lt_prog_compiler_wl_CXX=
+lt_prog_compiler_pic_CXX=
+lt_prog_compiler_static_CXX=
+
+
+  # C++ specific cases for pic, static, wl, etc.
+  if test yes = "$GXX"; then
+    lt_prog_compiler_wl_CXX='-Wl,'
+    lt_prog_compiler_static_CXX='-static'
+
+    case $host_os in
+    aix*)
+      # All AIX code is PIC.
+      if test ia64 = "$host_cpu"; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_CXX='-Bstatic'
+      fi
+      lt_prog_compiler_pic_CXX='-fPIC'
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            lt_prog_compiler_pic_CXX='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the '-m68020' flag to GCC prevents building anything better,
+            # like '-m68040'.
+            lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    mingw* | cygwin* | os2* | pw32* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+      ;;
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_CXX='-fno-common'
+      ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      lt_prog_compiler_pic_CXX=
+      ;;
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      lt_prog_compiler_static_CXX=
+      ;;
+    interix[3-9]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic_CXX=-Kconform_pic
+      fi
+      ;;
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+	;;
+      *)
+	lt_prog_compiler_pic_CXX='-fPIC'
+	;;
+      esac
+      ;;
+    *qnx* | *nto*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic_CXX='-fPIC -shared'
+      ;;
+    *)
+      lt_prog_compiler_pic_CXX='-fPIC'
+      ;;
+    esac
+  else
+    case $host_os in
+      aix[4-9]*)
+	# All AIX code is PIC.
+	if test ia64 = "$host_cpu"; then
+	  # AIX 5 now supports IA64 processor
+	  lt_prog_compiler_static_CXX='-Bstatic'
+	else
+	  lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
+	fi
+	;;
+      chorus*)
+	case $cc_basename in
+	cxch68*)
+	  # Green Hills C++ Compiler
+	  # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+	  ;;
+	esac
+	;;
+      mingw* | cygwin* | os2* | pw32* | cegcc*)
+	# This hack is so that the source file can tell whether it is being
+	# built for inclusion in a dll (and should export symbols for example).
+	lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+	;;
+      dgux*)
+	case $cc_basename in
+	  ec++*)
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    ;;
+	  ghcx*)
+	    # Green Hills C++ Compiler
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      freebsd* | dragonfly*)
+	# FreeBSD uses GNU C++
+	;;
+      hpux9* | hpux10* | hpux11*)
+	case $cc_basename in
+	  CC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX='$wl-a ${wl}archive'
+	    if test ia64 != "$host_cpu"; then
+	      lt_prog_compiler_pic_CXX='+Z'
+	    fi
+	    ;;
+	  aCC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX='$wl-a ${wl}archive'
+	    case $host_cpu in
+	    hppa*64*|ia64*)
+	      # +Z the default
+	      ;;
+	    *)
+	      lt_prog_compiler_pic_CXX='+Z'
+	      ;;
+	    esac
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      interix*)
+	# This is c89, which is MS Visual C++ (no shared libs)
+	# Anyone wants to do a port?
+	;;
+      irix5* | irix6* | nonstopux*)
+	case $cc_basename in
+	  CC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    # CC pic flag -KPIC is the default.
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+	case $cc_basename in
+	  KCC*)
+	    # KAI C++ Compiler
+	    lt_prog_compiler_wl_CXX='--backend -Wl,'
+	    lt_prog_compiler_pic_CXX='-fPIC'
+	    ;;
+	  ecpc* )
+	    # old Intel C++ for x86_64, which still supported -KPIC.
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    lt_prog_compiler_static_CXX='-static'
+	    ;;
+	  icpc* )
+	    # Intel C++, used to be incompatible with GCC.
+	    # ICC 10 doesn't accept -KPIC any more.
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-fPIC'
+	    lt_prog_compiler_static_CXX='-static'
+	    ;;
+	  pgCC* | pgcpp*)
+	    # Portland Group C++ compiler
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-fpic'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    ;;
+	  cxx*)
+	    # Compaq C++
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    lt_prog_compiler_pic_CXX=
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    ;;
+	  xlc* | xlC* | bgxl[cC]* | mpixl[cC]*)
+	    # IBM XL 8.0, 9.0 on PPC and BlueGene
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-qpic'
+	    lt_prog_compiler_static_CXX='-qstaticlink'
+	    ;;
+	  *)
+	    case `$CC -V 2>&1 | sed 5q` in
+	    *Sun\ C*)
+	      # Sun C++ 5.9
+	      lt_prog_compiler_pic_CXX='-KPIC'
+	      lt_prog_compiler_static_CXX='-Bstatic'
+	      lt_prog_compiler_wl_CXX='-Qoption ld '
+	      ;;
+	    esac
+	    ;;
+	esac
+	;;
+      lynxos*)
+	;;
+      m88k*)
+	;;
+      mvs*)
+	case $cc_basename in
+	  cxx*)
+	    lt_prog_compiler_pic_CXX='-W c,exportall'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      netbsd*)
+	;;
+      *qnx* | *nto*)
+        # QNX uses GNU C++, but need to define -shared option too, otherwise
+        # it will coredump.
+        lt_prog_compiler_pic_CXX='-fPIC -shared'
+        ;;
+      osf3* | osf4* | osf5*)
+	case $cc_basename in
+	  KCC*)
+	    lt_prog_compiler_wl_CXX='--backend -Wl,'
+	    ;;
+	  RCC*)
+	    # Rational C++ 2.4.1
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  cxx*)
+	    # Digital/Compaq C++
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    lt_prog_compiler_pic_CXX=
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      psos*)
+	;;
+      solaris*)
+	case $cc_basename in
+	  CC* | sunCC*)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    lt_prog_compiler_wl_CXX='-Qoption ld '
+	    ;;
+	  gcx*)
+	    # Green Hills C++ Compiler
+	    lt_prog_compiler_pic_CXX='-PIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sunos4*)
+	case $cc_basename in
+	  CC*)
+	    # Sun C++ 4.x
+	    lt_prog_compiler_pic_CXX='-pic'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    ;;
+	  lcc*)
+	    # Lucid
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+	case $cc_basename in
+	  CC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    ;;
+	esac
+	;;
+      tandem*)
+	case $cc_basename in
+	  NCC*)
+	    # NonStop-UX NCC 3.20
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      vxworks*)
+	;;
+      *)
+	lt_prog_compiler_can_build_shared_CXX=no
+	;;
+    esac
+  fi
+
+case $host_os in
+  # For platforms that do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_CXX=
+    ;;
+  *)
+    lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
+    ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+if ${lt_cv_prog_compiler_pic_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; }
+lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_CXX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; }
+if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_pic_works_CXX=no
+   ac_outfile=conftest.$ac_objext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"  ## exclude from sc_useless_quotes_in_assignment
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_pic_works_CXX=yes
+     fi
+   fi
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; }
+
+if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then
+    case $lt_prog_compiler_pic_CXX in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
+     esac
+else
+    lt_prog_compiler_pic_CXX=
+     lt_prog_compiler_can_build_shared_CXX=no
+fi
+
+fi
+
+
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if ${lt_cv_prog_compiler_static_works_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_static_works_CXX=no
+   save_LDFLAGS=$LDFLAGS
+   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_cv_prog_compiler_static_works_CXX=yes
+       fi
+     else
+       lt_cv_prog_compiler_static_works_CXX=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS=$save_LDFLAGS
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; }
+
+if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then
+    :
+else
+    lt_prog_compiler_static_CXX=
+fi
+
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o_CXX=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_CXX=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o_CXX=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_CXX=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
+
+
+
+
+hard_links=nottested
+if test no = "$lt_cv_prog_compiler_c_o_CXX" && test no != "$need_locks"; then
+  # do not overwrite the value of need_locks provided by the user
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+  hard_links=yes
+  $RM conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+  if test no = "$hard_links"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+  export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+  case $host_os in
+  aix[4-9]*)
+    # If we're using GNU nm, then we don't want the "-C" option.
+    # -C means demangle to AIX nm, but means don't demangle with GNU nm
+    # Also, AIX nm treats weak defined symbols like other global defined
+    # symbols, whereas GNU nm marks them as "W".
+    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+    else
+      export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+    fi
+    ;;
+  pw32*)
+    export_symbols_cmds_CXX=$ltdll_cmds
+    ;;
+  cygwin* | mingw* | cegcc*)
+    case $cc_basename in
+    cl*)
+      exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+      ;;
+    *)
+      export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+      exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+      ;;
+    esac
+    ;;
+  *)
+    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+    ;;
+  esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
+$as_echo "$ld_shlibs_CXX" >&6; }
+test no = "$ld_shlibs_CXX" && can_build_shared=no
+
+with_gnu_ld_CXX=$with_gnu_ld
+
+
+
+
+
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_CXX" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_CXX=yes
+
+  if test yes,yes = "$GCC,$enable_shared"; then
+    case $archive_cmds_CXX in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  $RM conftest*
+	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+	if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } 2>conftest.err; then
+	  soname=conftest
+	  lib=conftest
+	  libobjs=conftest.$ac_objext
+	  deplibs=
+	  wl=$lt_prog_compiler_wl_CXX
+	  pic_flag=$lt_prog_compiler_pic_CXX
+	  compiler_flags=-v
+	  linker_flags=-v
+	  verstring=
+	  output_objdir=.
+	  libname=conftest
+	  lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
+	  allow_undefined_flag_CXX=
+	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+  (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+	  then
+	    lt_cv_archive_cmds_need_lc_CXX=no
+	  else
+	    lt_cv_archive_cmds_need_lc_CXX=yes
+	  fi
+	  allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
+	else
+	  cat conftest.err 1>&5
+	fi
+	$RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; }
+      archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=.so
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='$libname$release$shared_ext$major'
+  ;;
+
+aix[4-9]*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test ia64 = "$host_cpu"; then
+    # AIX 5 supports IA64
+    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line '#! .'.  This would cause the generated library to
+    # depend on '.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[01] | aix4.[01].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+	   echo ' yes '
+	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
+	:
+      else
+	can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test yes = "$aix_use_runtimelinking"; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='$libname$release.a $libname.a'
+      soname_spec='$libname$release$shared_ext$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  case $host_cpu in
+  powerpc)
+    # Since July 2007 AmigaOS4 officially supports .so libraries.
+    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    ;;
+  m68k)
+    library_names_spec='$libname.ixlibrary $libname.a'
+    # Create ${libname}_ixlibrary.a entries in /sys/libs.
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    ;;
+  esac
+  ;;
+
+beos*)
+  library_names_spec='$libname$shared_ext'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[45]*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+  version_type=windows
+  shrext_cmds=.dll
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$cc_basename in
+  yes,*)
+    # gcc
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \$file`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname~
+      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+      fi'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+
+      ;;
+    mingw* | cegcc*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+      ;;
+    esac
+    dynamic_linker='Win32 ld.exe'
+    ;;
+
+  *,cl*)
+    # Native MSVC
+    libname_spec='$name'
+    soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+    library_names_spec='$libname.dll.lib'
+
+    case $build_os in
+    mingw*)
+      sys_lib_search_path_spec=
+      lt_save_ifs=$IFS
+      IFS=';'
+      for lt_path in $LIB
+      do
+        IFS=$lt_save_ifs
+        # Let DOS variable expansion print the short 8.3 style file name.
+        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+      done
+      IFS=$lt_save_ifs
+      # Convert to MSYS style.
+      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
+      ;;
+    cygwin*)
+      # Convert to unix form, then to dos form, then back to unix form
+      # but this time dos style (no spaces!) so that the unix form looks
+      # like /cygdrive/c/PROGRA~1:/cygdr...
+      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      ;;
+    *)
+      sys_lib_search_path_spec=$LIB
+      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+        # It is most probably a Windows format PATH.
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      # FIXME: find the short name or the path components, as spaces are
+      # common. (e.g. "Program Files" -> "PROGRA~1")
+      ;;
+    esac
+
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \$file`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+    dynamic_linker='Win32 link.exe'
+    ;;
+
+  *)
+    # Assume MSVC wrapper
+    library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib'
+    dynamic_linker='Win32 ld.exe'
+    ;;
+  esac
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
+  soname_spec='$libname$release$major$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[23].*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2.*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[01]* | freebsdelf3.[01]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  *) # from 4.6 on, and DragonFly
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+haiku*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  dynamic_linker="$host_os runtime_loader"
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    if test 32 = "$HPUX_IA64_MODE"; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  hppa*64*)
+    shrext_cmds='.sl'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+  postinstall_cmds='chmod 555 $lib'
+  # or fails outright, so override atomically:
+  install_override_mode=555
+  ;;
+
+interix[3-9]*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+	if test yes = "$lt_cv_prog_gnu_ld"; then
+		version_type=linux # correct to gnu/linux during the next big refactor
+	else
+		version_type=irix
+	fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
+  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+linux*android*)
+  version_type=none # Android doesn't support versioned libraries.
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext'
+  soname_spec='$libname$release$shared_ext'
+  finish_cmds=
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  dynamic_linker='Android linker'
+  # Don't embed -rpath directories since the linker doesn't support them.
+  hardcode_libdir_flag_spec_CXX='-L$libdir'
+  ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+
+  # Some binutils ld are patched to set DT_RUNPATH
+  if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_shlibpath_overrides_runpath=no
+    save_LDFLAGS=$LDFLAGS
+    save_libdir=$libdir
+    eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \
+	 LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\""
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+  lt_cv_shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+    LDFLAGS=$save_LDFLAGS
+    libdir=$save_libdir
+
+fi
+
+  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+*nto* | *qnx*)
+  version_type=qnx
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='ldqnx.so'
+  ;;
+
+openbsd* | bitrig*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec=/usr/lib
+  need_lib_prefix=no
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+    need_version=no
+  else
+    need_version=yes
+  fi
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=.dll
+  need_lib_prefix=no
+  library_names_spec='$libname$shared_ext $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+  ;;
+
+rdos*)
+  dynamic_linker=no
+  ;;
+
+solaris*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test yes = "$with_gnu_ld"; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec; then
+    version_type=linux # correct to gnu/linux during the next big refactor
+    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
+    soname_spec='$libname$shared_ext.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  if test yes = "$with_gnu_ld"; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+	;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+uts4*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test no = "$dynamic_linker" && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test yes = "$GCC"; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
+  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
+fi
+if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
+  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action_CXX=
+if test -n "$hardcode_libdir_flag_spec_CXX" ||
+   test -n "$runpath_var_CXX" ||
+   test yes = "$hardcode_automatic_CXX"; then
+
+  # We can hardcode non-existent directories.
+  if test no != "$hardcode_direct_CXX" &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" &&
+     test no != "$hardcode_minus_L_CXX"; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_CXX=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_CXX=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_CXX=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5
+$as_echo "$hardcode_action_CXX" >&6; }
+
+if test relink = "$hardcode_action_CXX" ||
+   test yes = "$inherit_rpath_CXX"; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test yes = "$shlibpath_overrides_runpath" ||
+     test no = "$enable_shared"; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+
+
+
+
+
+
+
+  fi # test -n "$compiler"
+
+  CC=$lt_save_CC
+  CFLAGS=$lt_save_CFLAGS
+  LDCXX=$LD
+  LD=$lt_save_LD
+  GCC=$lt_save_GCC
+  with_gnu_ld=$lt_save_with_gnu_ld
+  lt_cv_path_LDCXX=$lt_cv_path_LD
+  lt_cv_path_LD=$lt_save_path_LD
+  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test yes != "$_lt_caught_CXX_error"
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
@@ -12811,7 +16674,7 @@
 
 
      cputype=`(((grep cpu /proc/cpuinfo | cut -d: -f2) ; ($PRTDIAG -v |grep -i sparc) ; grep -i cpu /var/run/dmesg.boot ) | head -n 1) 2> /dev/null`
-     cputype=`echo "$cputype" | tr -d ' -' |tr $as_cr_LETTERS $as_cr_letters`
+     cputype=`echo "$cputype" | tr -d ' -' | sed 's/SPARCIIi/SPARCII/' | tr $as_cr_LETTERS $as_cr_letters`
      case $cputype in
          *ultrasparciv*) ax_gcc_arch="ultrasparc4 ultrasparc3 ultrasparc v9" ;;
          *ultrasparciii*) ax_gcc_arch="ultrasparc3 ultrasparc v9" ;;
@@ -13082,13 +16945,13 @@
 
 if test "x$GCC" = "xyes"; then
   CFLAGS="$CFLAGS -fexceptions"
-  touch local.exp
-else
-  cat > local.exp <<EOF
-set CC_FOR_TARGET "$CC"
-EOF
 fi
 
+cat > local.exp <<EOF
+set CC_FOR_TARGET "$CC"
+set CXX_FOR_TARGET "$CXX"
+EOF
+
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
@@ -13288,6 +17151,7 @@
 
 
 TARGETDIR="unknown"
+HAVE_LONG_DOUBLE_VARIANT=0
 case "$host" in
   aarch64*-*-*)
 	TARGET=AARCH64; TARGETDIR=aarch64
@@ -13299,6 +17163,10 @@
 	HAVE_LONG_DOUBLE='defined(__LONG_DOUBLE_128__)'
 	;;
 
+  arc*-*-*)
+	TARGET=ARC; TARGETDIR=arc
+	;;
+
   arm*-*-*)
 	TARGET=ARM; TARGETDIR=arm
 	;;
@@ -13417,6 +17285,10 @@
 	TARGET=M68K; TARGETDIR=m68k
 	;;
 
+  m88k-*-*)
+	TARGET=M88K; TARGETDIR=m88k
+	;;
+
   microblaze*-*-*)
 	TARGET=MICROBLAZE; TARGETDIR=microblaze
 	;;
@@ -13432,14 +17304,19 @@
   mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
 	TARGET=MIPS_IRIX; TARGETDIR=mips
 	;;
-  mips*-*-linux* | mips*-*-openbsd*)
+  mips*-*linux* | mips*-*-openbsd*)
 	# Support 128-bit long double for NewABI.
 	HAVE_LONG_DOUBLE='defined(__mips64)'
-	TARGET=MIPS_IRIX; TARGETDIR=mips
+	TARGET=MIPS_LINUX; TARGETDIR=mips
+	;;
+
+  nios2*-linux*)
+	TARGET=NIOS2; TARGETDIR=nios2
 	;;
 
   powerpc*-*-linux* | powerpc-*-sysv*)
 	TARGET=POWERPC; TARGETDIR=powerpc
+	HAVE_LONG_DOUBLE_VARIANT=1
 	;;
   powerpc-*-amigaos*)
 	TARGET=POWERPC; TARGETDIR=powerpc
@@ -13455,6 +17332,7 @@
 	;;
   powerpc-*-freebsd* | powerpc-*-openbsd*)
 	TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc
+	HAVE_LONG_DOUBLE_VARIANT=1
 	;;
   powerpc64-*-freebsd*)
 	TARGET=POWERPC; TARGETDIR=powerpc
@@ -13482,6 +17360,10 @@
         TARGET=TILE; TARGETDIR=tile
         ;;
 
+  vax-*-*)
+	TARGET=VAX; TARGETDIR=vax
+	;;
+
   xtensa*-*)
 	TARGET=XTENSA; TARGETDIR=xtensa
 	;;
@@ -13559,6 +17441,22 @@
   X86_DARWIN_FALSE=
 fi
 
+ if test x$TARGET = xX86_DARWIN && test $ac_cv_sizeof_size_t = 4; then
+  X86_DARWIN32_TRUE=
+  X86_DARWIN32_FALSE='#'
+else
+  X86_DARWIN32_TRUE='#'
+  X86_DARWIN32_FALSE=
+fi
+
+ if test x$TARGET = xX86_DARWIN && test $ac_cv_sizeof_size_t = 8; then
+  X86_DARWIN64_TRUE=
+  X86_DARWIN64_FALSE='#'
+else
+  X86_DARWIN64_TRUE='#'
+  X86_DARWIN64_FALSE=
+fi
+
  if test x$TARGET = xALPHA; then
   ALPHA_TRUE=
   ALPHA_FALSE='#'
@@ -13591,6 +17489,14 @@
   M68K_FALSE=
 fi
 
+ if test x$TARGET = xM88K; then
+  M88K_TRUE=
+  M88K_FALSE='#'
+else
+  M88K_TRUE='#'
+  M88K_FALSE=
+fi
+
  if test x$TARGET = xMICROBLAZE; then
   MICROBLAZE_TRUE=
   MICROBLAZE_FALSE='#'
@@ -13615,6 +17521,14 @@
   MOXIE_FALSE=
 fi
 
+ if test x$TARGET = xNIOS2; then
+  NIOS2_TRUE=
+  NIOS2_FALSE='#'
+else
+  NIOS2_TRUE='#'
+  NIOS2_FALSE=
+fi
+
  if test x$TARGET = xPOWERPC; then
   POWERPC_TRUE=
   POWERPC_FALSE='#'
@@ -13655,6 +17569,14 @@
   AARCH64_FALSE=
 fi
 
+ if test x$TARGET = xARC; then
+  ARC_TRUE=
+  ARC_FALSE='#'
+else
+  ARC_TRUE='#'
+  ARC_FALSE=
+fi
+
  if test x$TARGET = xARM; then
   ARM_TRUE=
   ARM_FALSE='#'
@@ -13751,6 +17673,14 @@
   TILE_FALSE=
 fi
 
+ if test x$TARGET = xVAX; then
+  VAX_TRUE=
+  VAX_FALSE='#'
+else
+  VAX_TRUE='#'
+  VAX_FALSE=
+fi
+
  if test x$TARGET = xXTENSA; then
   XTENSA_TRUE=
   XTENSA_FALSE='#'
@@ -14151,17 +18081,25 @@
 # Also AC_SUBST this variable for ffi.h.
 if test -z "$HAVE_LONG_DOUBLE"; then
   HAVE_LONG_DOUBLE=0
-  if test $ac_cv_sizeof_double != $ac_cv_sizeof_long_double; then
-    if test $ac_cv_sizeof_long_double != 0; then
+  if test $ac_cv_sizeof_long_double != 0; then
+    if test $HAVE_LONG_DOUBLE_VARIANT != 0; then
+
+$as_echo "#define HAVE_LONG_DOUBLE_VARIANT 1" >>confdefs.h
+
       HAVE_LONG_DOUBLE=1
+    else
+      if test $ac_cv_sizeof_double != $ac_cv_sizeof_long_double; then
+        HAVE_LONG_DOUBLE=1
 
 $as_echo "#define HAVE_LONG_DOUBLE 1" >>confdefs.h
 
+      fi
     fi
   fi
 fi
 
 
+
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
 $as_echo_n "checking whether byte ordering is bigendian... " >&6; }
 if ${ac_cv_c_bigendian+:} false; then :
@@ -14602,8 +18540,7 @@
 fi
 
 
-if test x$TARGET = xX86_WIN64; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _ prefix in compiled symbols" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _ prefix in compiled symbols" >&5
 $as_echo_n "checking for _ prefix in compiled symbols... " >&6; }
 if ${lt_cv_sys_symbol_underscore+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -14650,11 +18587,10 @@
   sys_symbol_underscore=$lt_cv_sys_symbol_underscore
 
 
-    if test "x$sys_symbol_underscore" = xyes; then
+if test "x$sys_symbol_underscore" = xyes; then
 
 $as_echo "#define SYMBOL_UNDERSCORE 1" >>confdefs.h
 
-    fi
 fi
 
 FFI_EXEC_TRAMPOLINE_TABLE=0
@@ -14682,16 +18618,32 @@
 
 
 if test x$TARGET = xX86_64; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler supports unwind section type" >&5
-$as_echo_n "checking assembler supports unwind section type... " >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking toolchain supports unwind section type" >&5
+$as_echo_n "checking toolchain supports unwind section type... " >&6; }
 if ${libffi_cv_as_x86_64_unwind_section_type+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-	libffi_cv_as_x86_64_unwind_section_type=yes
-	echo '.section .eh_frame,"a",@unwind' > conftest.s
-	if $CC $CFLAGS -c conftest.s 2>&1 | grep -i warning > /dev/null; then
-	    libffi_cv_as_x86_64_unwind_section_type=no
+        cat  > conftest1.s << EOF
+.text
+.globl foo
+foo:
+jmp bar
+.section .eh_frame,"a",@unwind
+bar:
+EOF
+
+        cat > conftest2.c  << EOF
+extern void foo();
+int main(){foo();}
+EOF
+
+	libffi_cv_as_x86_64_unwind_section_type=no
+	# we ensure that we can compile _and_ link an assembly file containing an @unwind section
+	# since the compiler can support it and not the linker (ie old binutils)
+	if $CC -Wa,--fatal-warnings $CFLAGS -c conftest1.s > /dev/null 2>&1 && \
+           $CC conftest2.c conftest1.o > /dev/null 2>&1 ; then
+	    libffi_cv_as_x86_64_unwind_section_type=yes
 	fi
 
 fi
@@ -14844,7 +18796,7 @@
     toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
     toolexeclibdir='$(libdir)'
   fi
-  multi_os_directory=`$CC -print-multi-os-directory`
+  multi_os_directory=`$CC $CFLAGS -print-multi-os-directory`
   case $multi_os_directory in
     .) ;; # Avoid trailing /.
     ../*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
@@ -15005,6 +18957,10 @@
   as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
+  as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${am__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then
   as_fn_error $? "conditional \"am__fastdepCCAS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -15049,6 +19005,14 @@
   as_fn_error $? "conditional \"X86_DARWIN\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${X86_DARWIN32_TRUE}" && test -z "${X86_DARWIN32_FALSE}"; then
+  as_fn_error $? "conditional \"X86_DARWIN32\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${X86_DARWIN64_TRUE}" && test -z "${X86_DARWIN64_FALSE}"; then
+  as_fn_error $? "conditional \"X86_DARWIN64\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${ALPHA_TRUE}" && test -z "${ALPHA_FALSE}"; then
   as_fn_error $? "conditional \"ALPHA\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -15065,6 +19029,10 @@
   as_fn_error $? "conditional \"M68K\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${M88K_TRUE}" && test -z "${M88K_FALSE}"; then
+  as_fn_error $? "conditional \"M88K\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${MICROBLAZE_TRUE}" && test -z "${MICROBLAZE_FALSE}"; then
   as_fn_error $? "conditional \"MICROBLAZE\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -15077,6 +19045,10 @@
   as_fn_error $? "conditional \"MOXIE\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${NIOS2_TRUE}" && test -z "${NIOS2_FALSE}"; then
+  as_fn_error $? "conditional \"NIOS2\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${POWERPC_TRUE}" && test -z "${POWERPC_FALSE}"; then
   as_fn_error $? "conditional \"POWERPC\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -15097,6 +19069,10 @@
   as_fn_error $? "conditional \"AARCH64\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${ARC_TRUE}" && test -z "${ARC_FALSE}"; then
+  as_fn_error $? "conditional \"ARC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${ARM_TRUE}" && test -z "${ARM_FALSE}"; then
   as_fn_error $? "conditional \"ARM\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -15145,6 +19121,10 @@
   as_fn_error $? "conditional \"TILE\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${VAX_TRUE}" && test -z "${VAX_FALSE}"; then
+  as_fn_error $? "conditional \"VAX\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${XTENSA_TRUE}" && test -z "${XTENSA_FALSE}"; then
   as_fn_error $? "conditional \"XTENSA\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -15559,7 +19539,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by libffi $as_me 3.0.13, which was
+This file was extended by libffi $as_me 3.1, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -15629,7 +19609,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-libffi config.status 3.0.13
+libffi config.status 3.1
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
@@ -15821,8 +19801,10 @@
 GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
 lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
 lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`'
 lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
+lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`'
 nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
 lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
 objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
@@ -15896,6 +19878,60 @@
 enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
 old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
 striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`'
+predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`'
+postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`'
+predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`'
+postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`'
+LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`'
+reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`'
+reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`'
+GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`'
+inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`'
+always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
+include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
+prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`'
+predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`'
+postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`'
+predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`'
+postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`'
 
 LTCC='$LTCC'
 LTCFLAGS='$LTCFLAGS'
@@ -15940,8 +19976,10 @@
 compiler \
 lt_cv_sys_global_symbol_pipe \
 lt_cv_sys_global_symbol_to_cdecl \
+lt_cv_sys_global_symbol_to_import \
 lt_cv_sys_global_symbol_to_c_name_address \
 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
+lt_cv_nm_interface \
 nm_file_list_spec \
 lt_prog_compiler_no_builtin_flag \
 lt_prog_compiler_pic \
@@ -15974,10 +20012,41 @@
 install_override_mode \
 finish_eval \
 old_striplib \
-striplib; do
+striplib \
+compiler_lib_search_dirs \
+predep_objects \
+postdep_objects \
+predeps \
+postdeps \
+compiler_lib_search_path \
+LD_CXX \
+reload_flag_CXX \
+compiler_CXX \
+lt_prog_compiler_no_builtin_flag_CXX \
+lt_prog_compiler_pic_CXX \
+lt_prog_compiler_wl_CXX \
+lt_prog_compiler_static_CXX \
+lt_cv_prog_compiler_c_o_CXX \
+export_dynamic_flag_spec_CXX \
+whole_archive_flag_spec_CXX \
+compiler_needs_object_CXX \
+with_gnu_ld_CXX \
+allow_undefined_flag_CXX \
+no_undefined_flag_CXX \
+hardcode_libdir_flag_spec_CXX \
+hardcode_libdir_separator_CXX \
+exclude_expsyms_CXX \
+include_expsyms_CXX \
+file_list_spec_CXX \
+compiler_lib_search_dirs_CXX \
+predep_objects_CXX \
+postdep_objects_CXX \
+predeps_CXX \
+postdeps_CXX \
+compiler_lib_search_path_CXX; do
     case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
     *[\\\\\\\`\\"\\\$]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
       ;;
     *)
       eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
@@ -16004,10 +20073,21 @@
 postuninstall_cmds \
 finish_cmds \
 sys_lib_search_path_spec \
-sys_lib_dlsearch_path_spec; do
+sys_lib_dlsearch_path_spec \
+reload_cmds_CXX \
+old_archive_cmds_CXX \
+old_archive_from_new_cmds_CXX \
+old_archive_from_expsyms_cmds_CXX \
+archive_cmds_CXX \
+archive_expsym_cmds_CXX \
+module_cmds_CXX \
+module_expsym_cmds_CXX \
+export_symbols_cmds_CXX \
+prelink_cmds_CXX \
+postlink_cmds_CXX; do
     case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
     *[\\\\\\\`\\"\\\$]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
       ;;
     *)
       eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
@@ -16016,24 +20096,23 @@
 done
 
 ac_aux_dir='$ac_aux_dir'
-xsi_shell='$xsi_shell'
-lt_shell_append='$lt_shell_append'
 
-# See if we are running on zsh, and set the options which allow our
+# See if we are running on zsh, and set the options that allow our
 # commands through without removal of \ escapes INIT.
-if test -n "\${ZSH_VERSION+set}" ; then
+if test -n "\${ZSH_VERSION+set}"; then
    setopt NO_GLOB_SUBST
 fi
 
 
     PACKAGE='$PACKAGE'
     VERSION='$VERSION'
-    TIMESTAMP='$TIMESTAMP'
     RM='$RM'
     ofile='$ofile'
 
 
 
+
+
 TARGETDIR="$TARGETDIR"
 
 _ACEOF
@@ -16831,7 +20910,7 @@
   fi
  ;;
     "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
-  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # Older Autoconf quotes --file arguments for eval, but not when files
   # are listed without --file.  Let's play safe and only enable the eval
   # if we detect the quoting.
   case $CONFIG_FILES in
@@ -16882,7 +20961,7 @@
     DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
     test -z "$DEPDIR" && continue
     am__include=`sed -n 's/^am__include = //p' < "$mf"`
-    test -z "am__include" && continue
+    test -z "$am__include" && continue
     am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
     # Find all dependency output files, they are included files with
     # $(DEPDIR) in their names.  We invoke sed twice because it is the
@@ -16925,13 +21004,13 @@
  ;;
     "libtool":C)
 
-    # See if we are running on zsh, and set the options which allow our
+    # See if we are running on zsh, and set the options that allow our
     # commands through without removal of \ escapes.
-    if test -n "${ZSH_VERSION+set}" ; then
+    if test -n "${ZSH_VERSION+set}"; then
       setopt NO_GLOB_SUBST
     fi
 
-    cfgfile="${ofile}T"
+    cfgfile=${ofile}T
     trap "$RM \"$cfgfile\"; exit 1" 1 2 15
     $RM "$cfgfile"
 
@@ -16939,7 +21018,7 @@
 #! $SHELL
 
 # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Generated automatically by $as_me ($PACKAGE) $VERSION
 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
 #
@@ -16973,7 +21052,7 @@
 
 
 # The names of the tagged configurations supported by this script.
-available_tags=""
+available_tags='CXX '
 
 # ### BEGIN LIBTOOL CONFIG
 
@@ -17110,16 +21189,22 @@
 # Transform the output of nm in a proper C declaration.
 global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
 
+# Transform the output of nm into a list of symbols to manually relocate.
+global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import
+
 # Transform the output of nm in a C name address pair.
 global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
 
 # Transform the output of nm in a C name address pair when lib prefix is needed.
 global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
 
+# The name lister interface.
+nm_interface=$lt_lt_cv_nm_interface
+
 # Specify filename containing input files for \$NM.
 nm_file_list_spec=$lt_nm_file_list_spec
 
-# The root where to search for dependent libraries,and in which our libraries should be installed.
+# The root where to search for dependent libraries,and where our libraries should be installed.
 lt_sysroot=$lt_sysroot
 
 # The name of the directory that contains temporary libtool files.
@@ -17306,13 +21391,13 @@
 # Whether we need a single "-rpath" flag with a separated argument.
 hardcode_libdir_separator=$lt_hardcode_libdir_separator
 
-# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
 # DIR into the resulting binary.
 hardcode_direct=$hardcode_direct
 
-# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
 # DIR into the resulting binary and the resulting library dependency is
-# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# "absolute",i.e impossible to change by setting \$shlibpath_var if the
 # library is relocated.
 hardcode_direct_absolute=$hardcode_direct_absolute
 
@@ -17360,6 +21445,20 @@
 # How to hardcode a shared library path into an executable.
 hardcode_action=$hardcode_action
 
+# The directories searched by this compiler when creating a shared library.
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs
+
+# Dependencies to place before and after the objects being linked to
+# create a shared library.
+predep_objects=$lt_predep_objects
+postdep_objects=$lt_postdep_objects
+predeps=$lt_predeps
+postdeps=$lt_postdeps
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path
+
 # ### END LIBTOOL CONFIG
 
 _LT_EOF
@@ -17370,7 +21469,7 @@
 # AIX sometimes has problems with the GCC collect2 program.  For some
 # reason, if we set the COLLECT_NAMES environment variable, the problems
 # vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
+if test set != "${COLLECT_NAMES+set}"; then
   COLLECT_NAMES=
   export COLLECT_NAMES
 fi
@@ -17379,7 +21478,7 @@
   esac
 
 
-ltmain="$ac_aux_dir/ltmain.sh"
+ltmain=$ac_aux_dir/ltmain.sh
 
 
   # We use sed instead of cat because bash on DJGPP gets confused if
@@ -17389,169 +21488,163 @@
   sed '$q' "$ltmain" >> "$cfgfile" \
      || (rm -f "$cfgfile"; exit 1)
 
-  if test x"$xsi_shell" = xyes; then
-  sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
-func_dirname ()\
-{\
-\    case ${1} in\
-\      */*) func_dirname_result="${1%/*}${2}" ;;\
-\      *  ) func_dirname_result="${3}" ;;\
-\    esac\
-} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_basename ()$/,/^} # func_basename /c\
-func_basename ()\
-{\
-\    func_basename_result="${1##*/}"\
-} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
-func_dirname_and_basename ()\
-{\
-\    case ${1} in\
-\      */*) func_dirname_result="${1%/*}${2}" ;;\
-\      *  ) func_dirname_result="${3}" ;;\
-\    esac\
-\    func_basename_result="${1##*/}"\
-} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
-func_stripname ()\
-{\
-\    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
-\    # positional parameters, so assign one to ordinary parameter first.\
-\    func_stripname_result=${3}\
-\    func_stripname_result=${func_stripname_result#"${1}"}\
-\    func_stripname_result=${func_stripname_result%"${2}"}\
-} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
-func_split_long_opt ()\
-{\
-\    func_split_long_opt_name=${1%%=*}\
-\    func_split_long_opt_arg=${1#*=}\
-} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
-func_split_short_opt ()\
-{\
-\    func_split_short_opt_arg=${1#??}\
-\    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
-} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
-func_lo2o ()\
-{\
-\    case ${1} in\
-\      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
-\      *)    func_lo2o_result=${1} ;;\
-\    esac\
-} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_xform ()$/,/^} # func_xform /c\
-func_xform ()\
-{\
-    func_xform_result=${1%.*}.lo\
-} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_arith ()$/,/^} # func_arith /c\
-func_arith ()\
-{\
-    func_arith_result=$(( $* ))\
-} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_len ()$/,/^} # func_len /c\
-func_len ()\
-{\
-    func_len_result=${#1}\
-} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-fi
-
-if test x"$lt_shell_append" = xyes; then
-  sed -e '/^func_append ()$/,/^} # func_append /c\
-func_append ()\
-{\
-    eval "${1}+=\\${2}"\
-} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
-func_append_quoted ()\
-{\
-\    func_quote_for_eval "${2}"\
-\    eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
-} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  # Save a `func_append' function call where possible by direct use of '+='
-  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
-    && mv -f "$cfgfile.tmp" "$cfgfile" \
-      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-  test 0 -eq $? || _lt_function_replace_fail=:
-else
-  # Save a `func_append' function call even when '+=' is not available
-  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
-    && mv -f "$cfgfile.tmp" "$cfgfile" \
-      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-  test 0 -eq $? || _lt_function_replace_fail=:
-fi
-
-if test x"$_lt_function_replace_fail" = x":"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
-$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
-fi
-
-
    mv -f "$cfgfile" "$ofile" ||
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
 
+
+    cat <<_LT_EOF >> "$ofile"
+
+# ### BEGIN LIBTOOL TAG CONFIG: CXX
+
+# The linker used to build libraries.
+LD=$lt_LD_CXX
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag_CXX
+reload_cmds=$lt_reload_cmds_CXX
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds_CXX
+
+# A language specific compiler.
+CC=$lt_compiler_CXX
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC_CXX
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_CXX
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_CXX
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_CXX
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_CXX
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object_CXX
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds_CXX
+archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds_CXX
+module_expsym_cmds=$lt_module_expsym_cmds_CXX
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld_CXX
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_CXX
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_CXX
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
+
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct_CXX
+
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \$shlibpath_var if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute_CXX
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L_CXX
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic_CXX
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath_CXX
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_CXX
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols_CXX
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_CXX
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_CXX
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_CXX
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds_CXX
+
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds_CXX
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec_CXX
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_CXX
+
+# The directories searched by this compiler when creating a shared library.
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX
+
+# Dependencies to place before and after the objects being linked to
+# create a shared library.
+predep_objects=$lt_predep_objects_CXX
+postdep_objects=$lt_postdep_objects_CXX
+predeps=$lt_predeps_CXX
+postdeps=$lt_postdeps_CXX
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
+
+# ### END LIBTOOL TAG CONFIG: CXX
+_LT_EOF
+
  ;;
     "include":C) test -d include || mkdir include ;;
     "src":C)
diff --git a/Modules/_ctypes/libffi/configure.ac b/Modules/_ctypes/libffi/configure.ac
index 7fe5ff5..5c8885f 100644
--- a/Modules/_ctypes/libffi/configure.ac
+++ b/Modules/_ctypes/libffi/configure.ac
@@ -5,13 +5,17 @@
 
 AC_PREREQ(2.68)
 
-AC_INIT([libffi], [3.0.13], [http://github.com/atgreen/libffi/issues])
+AC_INIT([libffi], [3.1], [http://github.com/atgreen/libffi/issues])
 AC_CONFIG_HEADERS([fficonfig.h])
 
 AC_CANONICAL_SYSTEM
 target_alias=${target_alias-$host_alias}
 
-. ${srcdir}/configure.host
+case "${host}" in
+  frv*-elf)
+    LDFLAGS=`echo $LDFLAGS | sed "s/\-B[^ ]*libgloss\/frv\///"`\ -B`pwd`/../libgloss/frv/
+    ;;
+esac
 
 AX_ENABLE_BUILDDIR
 
@@ -28,6 +32,7 @@
 m4_define([_AC_ARG_VAR_PRECIOUS],[])
 save_CFLAGS=$CFLAGS
 AC_PROG_CC
+AC_PROG_CXX
 CFLAGS=$save_CFLAGS
 m4_undefine([_AC_ARG_VAR_PRECIOUS])
 m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
@@ -52,13 +57,13 @@
 
 if test "x$GCC" = "xyes"; then
   CFLAGS="$CFLAGS -fexceptions"
-  touch local.exp
-else
-  cat > local.exp <<EOF
-set CC_FOR_TARGET "$CC"
-EOF
 fi
 
+cat > local.exp <<EOF
+set CC_FOR_TARGET "$CC"
+set CXX_FOR_TARGET "$CXX"
+EOF
+
 AM_MAINTAINER_MODE
 
 AC_CHECK_HEADERS(sys/mman.h)
@@ -69,6 +74,7 @@
 AM_CONDITIONAL(TESTSUBDIR, test -d $srcdir/testsuite)
 
 TARGETDIR="unknown"
+HAVE_LONG_DOUBLE_VARIANT=0
 case "$host" in
   aarch64*-*-*)
 	TARGET=AARCH64; TARGETDIR=aarch64
@@ -80,6 +86,10 @@
 	HAVE_LONG_DOUBLE='defined(__LONG_DOUBLE_128__)'
 	;;
 
+  arc*-*-*)
+	TARGET=ARC; TARGETDIR=arc
+	;;
+
   arm*-*-*)
 	TARGET=ARM; TARGETDIR=arm
 	;;
@@ -137,6 +147,9 @@
 	  AM_LTLDFLAGS='-no-undefined -bindir "$(bindir)"';
 	fi
 	;;
+  i*86-*-nto-qnx*) 
+        TARGET=X86; TARGETDIR=x86
+        ;;
   i?86-*-darwin*)
 	TARGET=X86_DARWIN; TARGETDIR=x86
 	;;
@@ -149,10 +162,6 @@
 	fi	  
 	;;
 
-  i*86-*-nto-qnx*) 
-        TARGET=X86; TARGETDIR=x86
-        ;;
-
   x86_64-*-darwin*)
 	TARGET=X86_DARWIN; TARGETDIR=x86
 	;;
@@ -198,6 +207,10 @@
 	TARGET=M68K; TARGETDIR=m68k
 	;;
 
+  m88k-*-*)
+	TARGET=M88K; TARGETDIR=m88k
+	;;
+
   microblaze*-*-*)
 	TARGET=MICROBLAZE; TARGETDIR=microblaze
 	;;
@@ -213,14 +226,19 @@
   mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
 	TARGET=MIPS_IRIX; TARGETDIR=mips
 	;;
-  mips*-*-linux* | mips*-*-openbsd*)
+  mips*-*linux* | mips*-*-openbsd*)
 	# Support 128-bit long double for NewABI.
 	HAVE_LONG_DOUBLE='defined(__mips64)'
-	TARGET=MIPS_IRIX; TARGETDIR=mips
+	TARGET=MIPS_LINUX; TARGETDIR=mips
+	;;
+
+  nios2*-linux*)
+	TARGET=NIOS2; TARGETDIR=nios2
 	;;
 
   powerpc*-*-linux* | powerpc-*-sysv*)
 	TARGET=POWERPC; TARGETDIR=powerpc
+	HAVE_LONG_DOUBLE_VARIANT=1
 	;;
   powerpc-*-amigaos*)
 	TARGET=POWERPC; TARGETDIR=powerpc
@@ -236,6 +254,7 @@
 	;;
   powerpc-*-freebsd* | powerpc-*-openbsd*)
 	TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc
+	HAVE_LONG_DOUBLE_VARIANT=1
 	;;
   powerpc64-*-freebsd*)
 	TARGET=POWERPC; TARGETDIR=powerpc
@@ -263,6 +282,10 @@
         TARGET=TILE; TARGETDIR=tile
         ;;
 
+  vax-*-*)
+	TARGET=VAX; TARGETDIR=vax
+	;;
+
   xtensa*-*)
 	TARGET=XTENSA; TARGETDIR=xtensa
 	;;
@@ -284,18 +307,23 @@
 AM_CONDITIONAL(X86_WIN32, test x$TARGET = xX86_WIN32)
 AM_CONDITIONAL(X86_WIN64, test x$TARGET = xX86_WIN64)
 AM_CONDITIONAL(X86_DARWIN, test x$TARGET = xX86_DARWIN)
+AM_CONDITIONAL(X86_DARWIN32, test x$TARGET = xX86_DARWIN && test $ac_cv_sizeof_size_t = 4)
+AM_CONDITIONAL(X86_DARWIN64, test x$TARGET = xX86_DARWIN && test $ac_cv_sizeof_size_t = 8)
 AM_CONDITIONAL(ALPHA, test x$TARGET = xALPHA)
 AM_CONDITIONAL(IA64, test x$TARGET = xIA64)
 AM_CONDITIONAL(M32R, test x$TARGET = xM32R)
 AM_CONDITIONAL(M68K, test x$TARGET = xM68K)
+AM_CONDITIONAL(M88K, test x$TARGET = xM88K)
 AM_CONDITIONAL(MICROBLAZE, test x$TARGET = xMICROBLAZE)
 AM_CONDITIONAL(METAG, test x$TARGET = xMETAG)
 AM_CONDITIONAL(MOXIE, test x$TARGET = xMOXIE)
+AM_CONDITIONAL(NIOS2, test x$TARGET = xNIOS2)
 AM_CONDITIONAL(POWERPC, test x$TARGET = xPOWERPC)
 AM_CONDITIONAL(POWERPC_AIX, test x$TARGET = xPOWERPC_AIX)
 AM_CONDITIONAL(POWERPC_DARWIN, test x$TARGET = xPOWERPC_DARWIN)
 AM_CONDITIONAL(POWERPC_FREEBSD, test x$TARGET = xPOWERPC_FREEBSD)
 AM_CONDITIONAL(AARCH64, test x$TARGET = xAARCH64)
+AM_CONDITIONAL(ARC, test x$TARGET = xARC)
 AM_CONDITIONAL(ARM, test x$TARGET = xARM)
 AM_CONDITIONAL(AVR32, test x$TARGET = xAVR32)
 AM_CONDITIONAL(LIBFFI_CRIS, test x$TARGET = xLIBFFI_CRIS)
@@ -308,6 +336,7 @@
 AM_CONDITIONAL(PA_HPUX, test x$TARGET = xPA_HPUX)
 AM_CONDITIONAL(PA64_HPUX, test x$TARGET = xPA64_HPUX)
 AM_CONDITIONAL(TILE, test x$TARGET = xTILE)
+AM_CONDITIONAL(VAX, test x$TARGET = xVAX)
 AM_CONDITIONAL(XTENSA, test x$TARGET = xXTENSA)
 
 AC_HEADER_STDC
@@ -320,14 +349,20 @@
 # Also AC_SUBST this variable for ffi.h.
 if test -z "$HAVE_LONG_DOUBLE"; then
   HAVE_LONG_DOUBLE=0
-  if test $ac_cv_sizeof_double != $ac_cv_sizeof_long_double; then
-    if test $ac_cv_sizeof_long_double != 0; then
+  if test $ac_cv_sizeof_long_double != 0; then
+    if test $HAVE_LONG_DOUBLE_VARIANT != 0; then
+      AC_DEFINE(HAVE_LONG_DOUBLE_VARIANT, 1, [Define if you support more than one size of the long double type])
       HAVE_LONG_DOUBLE=1
-      AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the long double type and it is bigger than a double])
+    else
+      if test $ac_cv_sizeof_double != $ac_cv_sizeof_long_double; then
+        HAVE_LONG_DOUBLE=1
+        AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the long double type and it is bigger than a double])
+      fi
     fi
   fi
 fi
 AC_SUBST(HAVE_LONG_DOUBLE)
+AC_SUBST(HAVE_LONG_DOUBLE_VARIANT)
 
 AC_C_BIGENDIAN
 
@@ -413,11 +448,9 @@
       [Define this if you want to enable pax emulated trampolines])
   fi)
 
-if test x$TARGET = xX86_WIN64; then
-    LT_SYS_SYMBOL_USCORE
-    if test "x$sys_symbol_underscore" = xyes; then
-        AC_DEFINE(SYMBOL_UNDERSCORE, 1, [Define if symbols are underscored.])
-    fi
+LT_SYS_SYMBOL_USCORE
+if test "x$sys_symbol_underscore" = xyes; then
+    AC_DEFINE(SYMBOL_UNDERSCORE, 1, [Define if symbols are underscored.])
 fi
 
 FFI_EXEC_TRAMPOLINE_TABLE=0
@@ -438,12 +471,28 @@
 AC_SUBST(FFI_EXEC_TRAMPOLINE_TABLE)
 
 if test x$TARGET = xX86_64; then
-    AC_CACHE_CHECK([assembler supports unwind section type],
+    AC_CACHE_CHECK([toolchain supports unwind section type],
 	libffi_cv_as_x86_64_unwind_section_type, [
-	libffi_cv_as_x86_64_unwind_section_type=yes
-	echo '.section .eh_frame,"a",@unwind' > conftest.s
-	if $CC $CFLAGS -c conftest.s 2>&1 | grep -i warning > /dev/null; then
-	    libffi_cv_as_x86_64_unwind_section_type=no
+        cat  > conftest1.s << EOF
+.text
+.globl foo
+foo:
+jmp bar
+.section .eh_frame,"a",@unwind
+bar:
+EOF
+
+        cat > conftest2.c  << EOF
+extern void foo();
+int main(){foo();}
+EOF
+
+	libffi_cv_as_x86_64_unwind_section_type=no
+	# we ensure that we can compile _and_ link an assembly file containing an @unwind section
+	# since the compiler can support it and not the linker (ie old binutils)
+	if $CC -Wa,--fatal-warnings $CFLAGS -c conftest1.s > /dev/null 2>&1 && \
+           $CC conftest2.c conftest1.o > /dev/null 2>&1 ; then
+	    libffi_cv_as_x86_64_unwind_section_type=yes
 	fi
 	])
     if test "x$libffi_cv_as_x86_64_unwind_section_type" = xyes; then
@@ -526,14 +575,14 @@
 AC_ARG_ENABLE(structs,
 [  --disable-structs       omit code for struct support],
   if test "$enable_structs" = "no"; then
-    AC_DEFINE(FFI_NO_STRUCTS, 1, [Define this is you do not want support for aggregate types.])
+    AC_DEFINE(FFI_NO_STRUCTS, 1, [Define this if you do not want support for aggregate types.])
   fi)
 AM_CONDITIONAL(FFI_DEBUG, test "$enable_debug" = "yes")
 
 AC_ARG_ENABLE(raw-api,
 [  --disable-raw-api       make the raw api unavailable],
   if test "$enable_raw_api" = "no"; then
-    AC_DEFINE(FFI_NO_RAW_API, 1, [Define this is you do not want support for the raw API.])
+    AC_DEFINE(FFI_NO_RAW_API, 1, [Define this if you do not want support for the raw API.])
   fi)
 
 AC_ARG_ENABLE(purify-safety,
@@ -553,7 +602,7 @@
     toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
     toolexeclibdir='$(libdir)'
   fi
-  multi_os_directory=`$CC -print-multi-os-directory`
+  multi_os_directory=`$CC $CFLAGS -print-multi-os-directory`
   case $multi_os_directory in
     .) ;; # Avoid trailing /.
     ../*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
diff --git a/Modules/_ctypes/libffi/configure.host b/Modules/_ctypes/libffi/configure.host
deleted file mode 100644
index f52457b..0000000
--- a/Modules/_ctypes/libffi/configure.host
+++ /dev/null
@@ -1,11 +0,0 @@
-# configure.host
-#
-# This shell script handles all host based configuration for libffi.
-# 
-
-# THIS TABLE IS SORTED.  KEEP IT THAT WAY.
-case "${host}" in
-  frv*-elf)
-    LDFLAGS=`echo $LDFLAGS | sed "s/\-B[^ ]*libgloss\/frv\///"`\ -B`pwd`/../libgloss/frv/
-    ;;
-esac
diff --git a/Modules/_ctypes/libffi/depcomp b/Modules/_ctypes/libffi/depcomp
index df8eea7..4ebd5b3 100755
--- a/Modules/_ctypes/libffi/depcomp
+++ b/Modules/_ctypes/libffi/depcomp
@@ -1,10 +1,9 @@
 #! /bin/sh
 # depcomp - compile a program generating dependencies as side-effects
 
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2013-05-30.07; # UTC
 
-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free
-# Software Foundation, Inc.
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -28,9 +27,9 @@
 
 case $1 in
   '')
-     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
-     exit 1;
-     ;;
+    echo "$0: No command.  Try '$0 --help' for more information." 1>&2
+    exit 1;
+    ;;
   -h | --h*)
     cat <<\EOF
 Usage: depcomp [--help] [--version] PROGRAM [ARGS]
@@ -40,11 +39,11 @@
 
 Environment variables:
   depmode     Dependency tracking mode.
-  source      Source file read by `PROGRAMS ARGS'.
-  object      Object file output by `PROGRAMS ARGS'.
+  source      Source file read by 'PROGRAMS ARGS'.
+  object      Object file output by 'PROGRAMS ARGS'.
   DEPDIR      directory where to store dependencies.
   depfile     Dependency file to output.
-  tmpdepfile  Temporary file to use when outputing dependencies.
+  tmpdepfile  Temporary file to use when outputting dependencies.
   libtool     Whether libtool is used (yes/no).
 
 Report bugs to <bug-automake@gnu.org>.
@@ -57,6 +56,66 @@
     ;;
 esac
 
+# Get the directory component of the given path, and save it in the
+# global variables '$dir'.  Note that this directory component will
+# be either empty or ending with a '/' character.  This is deliberate.
+set_dir_from ()
+{
+  case $1 in
+    */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
+      *) dir=;;
+  esac
+}
+
+# Get the suffix-stripped basename of the given path, and save it the
+# global variable '$base'.
+set_base_from ()
+{
+  base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
+}
+
+# If no dependency file was actually created by the compiler invocation,
+# we still have to create a dummy depfile, to avoid errors with the
+# Makefile "include basename.Plo" scheme.
+make_dummy_depfile ()
+{
+  echo "#dummy" > "$depfile"
+}
+
+# Factor out some common post-processing of the generated depfile.
+# Requires the auxiliary global variable '$tmpdepfile' to be set.
+aix_post_process_depfile ()
+{
+  # If the compiler actually managed to produce a dependency file,
+  # post-process it.
+  if test -f "$tmpdepfile"; then
+    # Each line is of the form 'foo.o: dependency.h'.
+    # Do two passes, one to just change these to
+    #   $object: dependency.h
+    # and one to simply output
+    #   dependency.h:
+    # which is needed to avoid the deleted-header problem.
+    { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
+      sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
+    } > "$depfile"
+    rm -f "$tmpdepfile"
+  else
+    make_dummy_depfile
+  fi
+}
+
+# A tabulation character.
+tab='	'
+# A newline character.
+nl='
+'
+# Character ranges might be problematic outside the C locale.
+# These definitions help.
+upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
+lower=abcdefghijklmnopqrstuvwxyz
+digits=0123456789
+alpha=${upper}${lower}
+
 if test -z "$depmode" || test -z "$source" || test -z "$object"; then
   echo "depcomp: Variables source, object and depmode must be set" 1>&2
   exit 1
@@ -69,6 +128,9 @@
 
 rm -f "$tmpdepfile"
 
+# Avoid interferences from the environment.
+gccflag= dashmflag=
+
 # Some modes work just like other modes, but use different flags.  We
 # parameterize here, but still list the modes in the big case below,
 # to make depend.m4 easier to write.  Note that we *cannot* use a case
@@ -80,18 +142,32 @@
 fi
 
 if test "$depmode" = dashXmstdout; then
-   # This is just like dashmstdout with a different argument.
-   dashmflag=-xM
-   depmode=dashmstdout
+  # This is just like dashmstdout with a different argument.
+  dashmflag=-xM
+  depmode=dashmstdout
 fi
 
 cygpath_u="cygpath -u -f -"
 if test "$depmode" = msvcmsys; then
-   # This is just like msvisualcpp but w/o cygpath translation.
-   # Just convert the backslash-escaped backslashes to single forward
-   # slashes to satisfy depend.m4
-   cygpath_u="sed s,\\\\\\\\,/,g"
-   depmode=msvisualcpp
+  # This is just like msvisualcpp but w/o cygpath translation.
+  # Just convert the backslash-escaped backslashes to single forward
+  # slashes to satisfy depend.m4
+  cygpath_u='sed s,\\\\,/,g'
+  depmode=msvisualcpp
+fi
+
+if test "$depmode" = msvc7msys; then
+  # This is just like msvc7 but w/o cygpath translation.
+  # Just convert the backslash-escaped backslashes to single forward
+  # slashes to satisfy depend.m4
+  cygpath_u='sed s,\\\\,/,g'
+  depmode=msvc7
+fi
+
+if test "$depmode" = xlc; then
+  # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
+  gccflag=-qmakedep=gcc,-MF
+  depmode=gcc
 fi
 
 case "$depmode" in
@@ -114,8 +190,7 @@
   done
   "$@"
   stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile"
     exit $stat
   fi
@@ -123,13 +198,17 @@
   ;;
 
 gcc)
+## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
+## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
+## (see the conditional assignment to $gccflag above).
 ## There are various ways to get dependency output from gcc.  Here's
 ## why we pick this rather obscure method:
 ## - Don't want to use -MD because we'd like the dependencies to end
 ##   up in a subdir.  Having to rename by hand is ugly.
 ##   (We might end up doing this anyway to support other compilers.)
 ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
-##   -MM, not -M (despite what the docs say).
+##   -MM, not -M (despite what the docs say).  Also, it might not be
+##   supported by the other compilers which use the 'gcc' depmode.
 ## - Using -M directly means running the compiler twice (even worse
 ##   than renaming).
   if test -z "$gccflag"; then
@@ -137,31 +216,31 @@
   fi
   "$@" -Wp,"$gccflag$tmpdepfile"
   stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile"
     exit $stat
   fi
   rm -f "$depfile"
   echo "$object : \\" > "$depfile"
-  alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
-## The second -e expression handles DOS-style file names with drive letters.
+  # The second -e expression handles DOS-style file names with drive
+  # letters.
   sed -e 's/^[^:]*: / /' \
       -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
-## This next piece of magic avoids the `deleted header file' problem.
+## This next piece of magic avoids the "deleted header file" problem.
 ## The problem is that when a header file which appears in a .P file
 ## is deleted, the dependency causes make to die (because there is
 ## typically no way to rebuild the header).  We avoid this by adding
 ## dummy dependencies for each header file.  Too bad gcc doesn't do
 ## this for us directly.
-  tr ' ' '
-' < "$tmpdepfile" |
-## Some versions of gcc put a space before the `:'.  On the theory
+## Some versions of gcc put a space before the ':'.  On the theory
 ## that the space means something, we add a space to the output as
-## well.
+## well.  hp depmode also adds that space, but also prefixes the VPATH
+## to the object.  Take care to not repeat it in the output.
 ## Some versions of the HPUX 10.20 sed can't process this invocation
 ## correctly.  Breaking it into two sed invocations is a workaround.
-    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  tr ' ' "$nl" < "$tmpdepfile" \
+    | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
+    | sed -e 's/$/ :/' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
@@ -179,8 +258,7 @@
     "$@" -MDupdate "$tmpdepfile"
   fi
   stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile"
     exit $stat
   fi
@@ -188,43 +266,41 @@
 
   if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
     echo "$object : \\" > "$depfile"
-
     # Clip off the initial element (the dependent).  Don't try to be
     # clever and replace this with sed code, as IRIX sed won't handle
     # lines with more than a fixed number of characters (4096 in
     # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
-    # the IRIX cc adds comments like `#:fec' to the end of the
+    # the IRIX cc adds comments like '#:fec' to the end of the
     # dependency line.
-    tr ' ' '
-' < "$tmpdepfile" \
-    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
-    tr '
-' ' ' >> "$depfile"
+    tr ' ' "$nl" < "$tmpdepfile" \
+      | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
+      | tr "$nl" ' ' >> "$depfile"
     echo >> "$depfile"
-
     # The second pass generates a dummy entry for each header file.
-    tr ' ' '
-' < "$tmpdepfile" \
-   | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
-   >> "$depfile"
+    tr ' ' "$nl" < "$tmpdepfile" \
+      | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+      >> "$depfile"
   else
-    # The sourcefile does not contain any dependencies, so just
-    # store a dummy comment line, to avoid errors with the Makefile
-    # "include basename.Plo" scheme.
-    echo "#dummy" > "$depfile"
+    make_dummy_depfile
   fi
   rm -f "$tmpdepfile"
   ;;
 
+xlc)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
 aix)
   # The C for AIX Compiler uses -M and outputs the dependencies
   # in a .u file.  In older versions, this file always lives in the
-  # current directory.  Also, the AIX compiler puts `$object:' at the
+  # current directory.  Also, the AIX compiler puts '$object:' at the
   # start of each line; $object doesn't have directory information.
   # Version 6 uses the directory in both cases.
-  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
-  test "x$dir" = "x$object" && dir=
-  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  set_dir_from "$object"
+  set_base_from "$object"
   if test "$libtool" = yes; then
     tmpdepfile1=$dir$base.u
     tmpdepfile2=$base.u
@@ -237,9 +313,7 @@
     "$@" -M
   fi
   stat=$?
-
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
     exit $stat
   fi
@@ -248,44 +322,100 @@
   do
     test -f "$tmpdepfile" && break
   done
-  if test -f "$tmpdepfile"; then
-    # Each line is of the form `foo.o: dependent.h'.
-    # Do two passes, one to just change these to
-    # `$object: dependent.h' and one to simply `dependent.h:'.
-    sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
-    # That's a tab and a space in the [].
-    sed -e 's,^.*\.[a-z]*:[	 ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
-  else
-    # The sourcefile does not contain any dependencies, so just
-    # store a dummy comment line, to avoid errors with the Makefile
-    # "include basename.Plo" scheme.
-    echo "#dummy" > "$depfile"
+  aix_post_process_depfile
+  ;;
+
+tcc)
+  # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
+  # FIXME: That version still under development at the moment of writing.
+  #        Make that this statement remains true also for stable, released
+  #        versions.
+  # It will wrap lines (doesn't matter whether long or short) with a
+  # trailing '\', as in:
+  #
+  #   foo.o : \
+  #    foo.c \
+  #    foo.h \
+  #
+  # It will put a trailing '\' even on the last line, and will use leading
+  # spaces rather than leading tabs (at least since its commit 0394caf7
+  # "Emit spaces for -MD").
+  "$@" -MD -MF "$tmpdepfile"
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
   fi
+  rm -f "$depfile"
+  # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
+  # We have to change lines of the first kind to '$object: \'.
+  sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
+  # And for each line of the second kind, we have to emit a 'dep.h:'
+  # dummy dependency, to avoid the deleted-header problem.
+  sed -n -e 's|^  *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
-icc)
-  # Intel's C compiler understands `-MD -MF file'.  However on
-  #    icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
-  # ICC 7.0 will fill foo.d with something like
-  #    foo.o: sub/foo.c
-  #    foo.o: sub/foo.h
-  # which is wrong.  We want:
-  #    sub/foo.o: sub/foo.c
-  #    sub/foo.o: sub/foo.h
-  #    sub/foo.c:
-  #    sub/foo.h:
-  # ICC 7.1 will output
+## The order of this option in the case statement is important, since the
+## shell code in configure will try each of these formats in the order
+## listed in this file.  A plain '-MD' option would be understood by many
+## compilers, so we must ensure this comes after the gcc and icc options.
+pgcc)
+  # Portland's C compiler understands '-MD'.
+  # Will always output deps to 'file.d' where file is the root name of the
+  # source file under compilation, even if file resides in a subdirectory.
+  # The object file name does not affect the name of the '.d' file.
+  # pgcc 10.2 will output
   #    foo.o: sub/foo.c sub/foo.h
-  # and will wrap long lines using \ :
+  # and will wrap long lines using '\' :
   #    foo.o: sub/foo.c ... \
   #     sub/foo.h ... \
   #     ...
+  set_dir_from "$object"
+  # Use the source, not the object, to determine the base name, since
+  # that's sadly what pgcc will do too.
+  set_base_from "$source"
+  tmpdepfile=$base.d
 
-  "$@" -MD -MF "$tmpdepfile"
-  stat=$?
-  if test $stat -eq 0; then :
-  else
+  # For projects that build the same source file twice into different object
+  # files, the pgcc approach of using the *source* file root name can cause
+  # problems in parallel builds.  Use a locking strategy to avoid stomping on
+  # the same $tmpdepfile.
+  lockdir=$base.d-lock
+  trap "
+    echo '$0: caught signal, cleaning up...' >&2
+    rmdir '$lockdir'
+    exit 1
+  " 1 2 13 15
+  numtries=100
+  i=$numtries
+  while test $i -gt 0; do
+    # mkdir is a portable test-and-set.
+    if mkdir "$lockdir" 2>/dev/null; then
+      # This process acquired the lock.
+      "$@" -MD
+      stat=$?
+      # Release the lock.
+      rmdir "$lockdir"
+      break
+    else
+      # If the lock is being held by a different process, wait
+      # until the winning process is done or we timeout.
+      while test -d "$lockdir" && test $i -gt 0; do
+        sleep 1
+        i=`expr $i - 1`
+      done
+    fi
+    i=`expr $i - 1`
+  done
+  trap - 1 2 13 15
+  if test $i -le 0; then
+    echo "$0: failed to acquire lock after $numtries attempts" >&2
+    echo "$0: check lockdir '$lockdir'" >&2
+    exit 1
+  fi
+
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile"
     exit $stat
   fi
@@ -297,8 +427,8 @@
   sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
   # Some versions of the HPUX 10.20 sed can't process this invocation
   # correctly.  Breaking it into two sed invocations is a workaround.
-  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
-    sed -e 's/$/ :/' >> "$depfile"
+  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
+    | sed -e 's/$/ :/' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
@@ -309,9 +439,8 @@
   # 'foo.d', which lands next to the object file, wherever that
   # happens to be.
   # Much of this is similar to the tru64 case; see comments there.
-  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
-  test "x$dir" = "x$object" && dir=
-  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  set_dir_from  "$object"
+  set_base_from "$object"
   if test "$libtool" = yes; then
     tmpdepfile1=$dir$base.d
     tmpdepfile2=$dir.libs/$base.d
@@ -322,8 +451,7 @@
     "$@" +Maked
   fi
   stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
      rm -f "$tmpdepfile1" "$tmpdepfile2"
      exit $stat
   fi
@@ -333,77 +461,107 @@
     test -f "$tmpdepfile" && break
   done
   if test -f "$tmpdepfile"; then
-    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
-    # Add `dependent.h:' lines.
+    sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
+    # Add 'dependent.h:' lines.
     sed -ne '2,${
-	       s/^ *//
-	       s/ \\*$//
-	       s/$/:/
-	       p
-	     }' "$tmpdepfile" >> "$depfile"
+               s/^ *//
+               s/ \\*$//
+               s/$/:/
+               p
+             }' "$tmpdepfile" >> "$depfile"
   else
-    echo "#dummy" > "$depfile"
+    make_dummy_depfile
   fi
   rm -f "$tmpdepfile" "$tmpdepfile2"
   ;;
 
 tru64)
-   # The Tru64 compiler uses -MD to generate dependencies as a side
-   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
-   # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
-   # dependencies in `foo.d' instead, so we check for that too.
-   # Subdirectories are respected.
-   dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
-   test "x$dir" = "x$object" && dir=
-   base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  # The Tru64 compiler uses -MD to generate dependencies as a side
+  # effect.  'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
+  # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+  # dependencies in 'foo.d' instead, so we check for that too.
+  # Subdirectories are respected.
+  set_dir_from  "$object"
+  set_base_from "$object"
 
-   if test "$libtool" = yes; then
-      # With Tru64 cc, shared objects can also be used to make a
-      # static library.  This mechanism is used in libtool 1.4 series to
-      # handle both shared and static libraries in a single compilation.
-      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
-      #
-      # With libtool 1.5 this exception was removed, and libtool now
-      # generates 2 separate objects for the 2 libraries.  These two
-      # compilations output dependencies in $dir.libs/$base.o.d and
-      # in $dir$base.o.d.  We have to check for both files, because
-      # one of the two compilations can be disabled.  We should prefer
-      # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
-      # automatically cleaned when .libs/ is deleted, while ignoring
-      # the former would cause a distcleancheck panic.
-      tmpdepfile1=$dir.libs/$base.lo.d   # libtool 1.4
-      tmpdepfile2=$dir$base.o.d          # libtool 1.5
-      tmpdepfile3=$dir.libs/$base.o.d    # libtool 1.5
-      tmpdepfile4=$dir.libs/$base.d      # Compaq CCC V6.2-504
-      "$@" -Wc,-MD
-   else
-      tmpdepfile1=$dir$base.o.d
-      tmpdepfile2=$dir$base.d
-      tmpdepfile3=$dir$base.d
-      tmpdepfile4=$dir$base.d
-      "$@" -MD
-   fi
+  if test "$libtool" = yes; then
+    # Libtool generates 2 separate objects for the 2 libraries.  These
+    # two compilations output dependencies in $dir.libs/$base.o.d and
+    # in $dir$base.o.d.  We have to check for both files, because
+    # one of the two compilations can be disabled.  We should prefer
+    # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+    # automatically cleaned when .libs/ is deleted, while ignoring
+    # the former would cause a distcleancheck panic.
+    tmpdepfile1=$dir$base.o.d          # libtool 1.5
+    tmpdepfile2=$dir.libs/$base.o.d    # Likewise.
+    tmpdepfile3=$dir.libs/$base.d      # Compaq CCC V6.2-504
+    "$@" -Wc,-MD
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    tmpdepfile3=$dir$base.d
+    "$@" -MD
+  fi
 
-   stat=$?
-   if test $stat -eq 0; then :
-   else
-      rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
-      exit $stat
-   fi
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+    exit $stat
+  fi
 
-   for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
-   do
-     test -f "$tmpdepfile" && break
-   done
-   if test -f "$tmpdepfile"; then
-      sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
-      # That's a tab and a space in the [].
-      sed -e 's,^.*\.[a-z]*:[	 ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
-   else
-      echo "#dummy" > "$depfile"
-   fi
-   rm -f "$tmpdepfile"
-   ;;
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  # Same post-processing that is required for AIX mode.
+  aix_post_process_depfile
+  ;;
+
+msvc7)
+  if test "$libtool" = yes; then
+    showIncludes=-Wc,-showIncludes
+  else
+    showIncludes=-showIncludes
+  fi
+  "$@" $showIncludes > "$tmpdepfile"
+  stat=$?
+  grep -v '^Note: including file: ' "$tmpdepfile"
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  # The first sed program below extracts the file names and escapes
+  # backslashes for cygpath.  The second sed program outputs the file
+  # name when reading, but also accumulates all include files in the
+  # hold buffer in order to output them again at the end.  This only
+  # works with sed implementations that can handle large buffers.
+  sed < "$tmpdepfile" -n '
+/^Note: including file:  *\(.*\)/ {
+  s//\1/
+  s/\\/\\\\/g
+  p
+}' | $cygpath_u | sort -u | sed -n '
+s/ /\\ /g
+s/\(.*\)/'"$tab"'\1 \\/p
+s/.\(.*\) \\/\1:/
+H
+$ {
+  s/.*/'"$tab"'/
+  G
+  p
+}' >> "$depfile"
+  echo >> "$depfile" # make sure the fragment doesn't end with a backslash
+  rm -f "$tmpdepfile"
+  ;;
+
+msvc7msys)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
 
 #nosideeffect)
   # This comment above is used by automake to tell side-effect
@@ -422,7 +580,7 @@
     shift
   fi
 
-  # Remove `-o $object'.
+  # Remove '-o $object'.
   IFS=" "
   for arg
   do
@@ -442,18 +600,18 @@
   done
 
   test -z "$dashmflag" && dashmflag=-M
-  # Require at least two characters before searching for `:'
+  # Require at least two characters before searching for ':'
   # in the target name.  This is to cope with DOS-style filenames:
-  # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
+  # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
   "$@" $dashmflag |
-    sed 's:^[  ]*[^: ][^:][^:]*\:[    ]*:'"$object"'\: :' > "$tmpdepfile"
+    sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
   rm -f "$depfile"
   cat < "$tmpdepfile" > "$depfile"
-  tr ' ' '
-' < "$tmpdepfile" | \
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly.  Breaking it into two sed invocations is a workaround.
-    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  # Some versions of the HPUX 10.20 sed can't process this sed invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  tr ' ' "$nl" < "$tmpdepfile" \
+    | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
+    | sed -e 's/$/ :/' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
@@ -503,12 +661,15 @@
   touch "$tmpdepfile"
   ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
   rm -f "$depfile"
-  cat < "$tmpdepfile" > "$depfile"
-  sed '1,2d' "$tmpdepfile" | tr ' ' '
-' | \
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly.  Breaking it into two sed invocations is a workaround.
-    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  # makedepend may prepend the VPATH from the source file name to the object.
+  # No need to regex-escape $object, excess matching of '.' is harmless.
+  sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
+  # Some versions of the HPUX 10.20 sed can't process the last invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  sed '1,2d' "$tmpdepfile" \
+    | tr ' ' "$nl" \
+    | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
+    | sed -e 's/$/ :/' >> "$depfile"
   rm -f "$tmpdepfile" "$tmpdepfile".bak
   ;;
 
@@ -525,7 +686,7 @@
     shift
   fi
 
-  # Remove `-o $object'.
+  # Remove '-o $object'.
   IFS=" "
   for arg
   do
@@ -544,10 +705,10 @@
     esac
   done
 
-  "$@" -E |
-    sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-       -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
-    sed '$ s: \\$::' > "$tmpdepfile"
+  "$@" -E \
+    | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+             -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+    | sed '$ s: \\$::' > "$tmpdepfile"
   rm -f "$depfile"
   echo "$object : \\" > "$depfile"
   cat < "$tmpdepfile" >> "$depfile"
@@ -579,23 +740,23 @@
       shift
       ;;
     "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
-	set fnord "$@"
-	shift
-	shift
-	;;
+        set fnord "$@"
+        shift
+        shift
+        ;;
     *)
-	set fnord "$@" "$arg"
-	shift
-	shift
-	;;
+        set fnord "$@" "$arg"
+        shift
+        shift
+        ;;
     esac
   done
   "$@" -E 2>/dev/null |
   sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
   rm -f "$depfile"
   echo "$object : \\" > "$depfile"
-  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::	\1 \\:p' >> "$depfile"
-  echo "	" >> "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
+  echo "$tab" >> "$depfile"
   sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
diff --git a/Modules/_ctypes/libffi/doc/libffi.info b/Modules/_ctypes/libffi/doc/libffi.info
index 6d5acf8..3990939 100644
--- a/Modules/_ctypes/libffi/doc/libffi.info
+++ b/Modules/_ctypes/libffi/doc/libffi.info
Binary files differ
diff --git a/Modules/_ctypes/libffi/doc/libffi.texi b/Modules/_ctypes/libffi/doc/libffi.texi
index 5c0552b..a2b1242 100644
--- a/Modules/_ctypes/libffi/doc/libffi.texi
+++ b/Modules/_ctypes/libffi/doc/libffi.texi
@@ -184,11 +184,11 @@
 
 @var{rvalue} is a pointer to a chunk of memory that will hold the
 result of the function call.  This must be large enough to hold the
-result and must be suitably aligned; it is the caller's responsibility
+result, no smaller than the system register size (generally 32 or 64
+bits), and must be suitably aligned; it is the caller's responsibility
 to ensure this.  If @var{cif} declares that the function returns
 @code{void} (using @code{ffi_type_void}), then @var{rvalue} is
-ignored.  If @var{rvalue} is @samp{NULL}, then the return value is
-discarded.
+ignored.
 
 @var{avalues} is a vector of @code{void *} pointers that point to the
 memory locations holding the argument values for a call.  If @var{cif}
@@ -214,7 +214,7 @@
   ffi_type *args[1];
   void *values[1];
   char *s;
-  int rc;
+  ffi_arg rc;
   
   /* Initialize the argument info vectors */    
   args[0] = &ffi_type_pointer;
@@ -222,7 +222,7 @@
   
   /* Initialize the cif */
   if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, 
-		       &ffi_type_uint, args) == FFI_OK)
+		       &ffi_type_sint, args) == FFI_OK)
     @{
       s = "Hello World!";
       ffi_call(&cif, puts, &rc, values);
@@ -414,6 +414,7 @@
       int i;
 
       tm_type.size = tm_type.alignment = 0;
+      tm_type.type = FFI_TYPE_STRUCT;
       tm_type.elements = &tm_type_elements;
     
       for (i = 0; i < 9; i++)
@@ -533,28 +534,30 @@
 @section Closure Example
 
 A trivial example that creates a new @code{puts} by binding 
-@code{fputs} with @code{stdin}.
+@code{fputs} with @code{stdout}.
 
 @example
 #include <stdio.h>
 #include <ffi.h>
 
 /* Acts like puts with the file given at time of enclosure. */
-void puts_binding(ffi_cif *cif, unsigned int *ret, void* args[], 
-                  FILE *stream)
+void puts_binding(ffi_cif *cif, void *ret, void* args[],
+                  void *stream)
 @{
-  *ret = fputs(*(char **)args[0], stream);
+  *(ffi_arg *)ret = fputs(*(char **)args[0], (FILE *)stream);
 @}
 
+typedef int (*puts_t)(char *);
+
 int main()
 @{
   ffi_cif cif;
   ffi_type *args[1];
   ffi_closure *closure;
 
-  int (*bound_puts)(char *);
+  void *bound_puts;
   int rc;
-  
+
   /* Allocate closure and bound_puts */
   closure = ffi_closure_alloc(sizeof(ffi_closure), &bound_puts);
 
@@ -565,13 +568,13 @@
 
       /* Initialize the cif */
       if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
-                       &ffi_type_uint, args) == FFI_OK)
+                       &ffi_type_sint, args) == FFI_OK)
         @{
           /* Initialize the closure, setting stream to stdout */
-          if (ffi_prep_closure_loc(closure, &cif, puts_binding, 
+          if (ffi_prep_closure_loc(closure, &cif, puts_binding,
                                    stdout, bound_puts) == FFI_OK)
             @{
-              rc = bound_puts("Hello World!");
+              rc = ((puts_t)bound_puts)("Hello World!");
               /* rc now holds the result of the call to fputs */
             @}
         @}
diff --git a/Modules/_ctypes/libffi/doc/stamp-vti b/Modules/_ctypes/libffi/doc/stamp-vti
index 54255ba..3785953 100644
--- a/Modules/_ctypes/libffi/doc/stamp-vti
+++ b/Modules/_ctypes/libffi/doc/stamp-vti
@@ -1,4 +1,4 @@
-@set UPDATED 16 March 2013
-@set UPDATED-MONTH March 2013
-@set EDITION 3.0.13
-@set VERSION 3.0.13
+@set UPDATED 25 April 2014
+@set UPDATED-MONTH April 2014
+@set EDITION 3.1
+@set VERSION 3.1
diff --git a/Modules/_ctypes/libffi/doc/version.texi b/Modules/_ctypes/libffi/doc/version.texi
index 54255ba..3785953 100644
--- a/Modules/_ctypes/libffi/doc/version.texi
+++ b/Modules/_ctypes/libffi/doc/version.texi
@@ -1,4 +1,4 @@
-@set UPDATED 16 March 2013
-@set UPDATED-MONTH March 2013
-@set EDITION 3.0.13
-@set VERSION 3.0.13
+@set UPDATED 25 April 2014
+@set UPDATED-MONTH April 2014
+@set EDITION 3.1
+@set VERSION 3.1
diff --git a/Modules/_ctypes/libffi/fficonfig.h.in b/Modules/_ctypes/libffi/fficonfig.h.in
index c77585d..cdef91b 100644
--- a/Modules/_ctypes/libffi/fficonfig.h.in
+++ b/Modules/_ctypes/libffi/fficonfig.h.in
@@ -26,10 +26,10 @@
 /* Cannot use malloc on this target, so, we revert to alternative means */
 #undef FFI_MMAP_EXEC_WRIT
 
-/* Define this is you do not want support for the raw API. */
+/* Define this if you do not want support for the raw API. */
 #undef FFI_NO_RAW_API
 
-/* Define this is you do not want support for aggregate types. */
+/* Define this if you do not want support for aggregate types. */
 #undef FFI_NO_STRUCTS
 
 /* Define to 1 if you have `alloca', as a function or macro. */
@@ -73,6 +73,9 @@
 /* Define if you have the long double type and it is bigger than a double */
 #undef HAVE_LONG_DOUBLE
 
+/* Define if you support more than one size of the long double type */
+#undef HAVE_LONG_DOUBLE_VARIANT
+
 /* Define to 1 if you have the `memcpy' function. */
 #undef HAVE_MEMCPY
 
@@ -118,8 +121,7 @@
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
-/* Define to the sub-directory in which libtool stores uninstalled libraries.
-   */
+/* Define to the sub-directory where libtool stores uninstalled libraries. */
 #undef LT_OBJDIR
 
 /* Define to 1 if your C compiler doesn't accept -c and -o together. */
@@ -152,6 +154,9 @@
 /* The size of `long double', as computed by sizeof. */
 #undef SIZEOF_LONG_DOUBLE
 
+/* The size of `size_t', as computed by sizeof. */
+#undef SIZEOF_SIZE_T
+
 /* If using the C implementation of alloca, define if you know the
    direction of stack growth for your system; otherwise it will be
    automatically deduced at runtime.
diff --git a/Modules/_ctypes/libffi/fficonfig.py.in b/Modules/_ctypes/libffi/fficonfig.py.in
index 35be29c..d102498 100644
--- a/Modules/_ctypes/libffi/fficonfig.py.in
+++ b/Modules/_ctypes/libffi/fficonfig.py.in
@@ -6,7 +6,7 @@
 ffi_platforms = {
     'MIPS_IRIX': ['src/mips/ffi.c', 'src/mips/o32.S', 'src/mips/n32.S'],
     'MIPS_LINUX': ['src/mips/ffi.c', 'src/mips/o32.S'],
-    'X86': ['src/x86/ffi.c', 'src/x86/sysv.S'],
+    'X86': ['src/x86/ffi.c', 'src/x86/sysv.S', 'src/x86/win32.S'],
     'X86_FREEBSD': ['src/x86/ffi.c', 'src/x86/freebsd.S'],
     'X86_WIN32': ['src/x86/ffi.c', 'src/x86/win32.S'],
     'SPARC': ['src/sparc/ffi.c', 'src/sparc/v8.S', 'src/sparc/v9.S'],
@@ -14,9 +14,10 @@
     'IA64': ['src/ia64/ffi.c', 'src/ia64/unix.S'],
     'M32R': ['src/m32r/sysv.S', 'src/m32r/ffi.c'],
     'M68K': ['src/m68k/ffi.c', 'src/m68k/sysv.S'],
-    'POWERPC': ['src/powerpc/ffi.c', 'src/powerpc/sysv.S', 'src/powerpc/ppc_closure.S', 'src/powerpc/linux64.S', 'src/powerpc/linux64_closure.S'],
+    'POWERPC': ['src/powerpc/ffi.c', 'src/powerpc/ffi_sysv.c', 'src/powerpc/ffi_linux64.c', 'src/powerpc/sysv.S', 'src/powerpc/ppc_closure.S', 'src/powerpc/linux64.S', 'src/powerpc/linux64_closure.S'],
     'POWERPC_AIX': ['src/powerpc/ffi_darwin.c', 'src/powerpc/aix.S', 'src/powerpc/aix_closure.S'],
     'POWERPC_FREEBSD': ['src/powerpc/ffi.c', 'src/powerpc/sysv.S', 'src/powerpc/ppc_closure.S'],
+    'AARCH64': ['src/aarch64/sysv.S', 'src/aarch64/ffi.c'],
     'ARM': ['src/arm/sysv.S', 'src/arm/ffi.c'],
     'LIBFFI_CRIS': ['src/cris/sysv.S', 'src/cris/ffi.c'],
     'FRV': ['src/frv/eabi.S', 'src/frv/ffi.c'],
diff --git a/Modules/_ctypes/libffi/generate-darwin-source-and-headers.py b/Modules/_ctypes/libffi/generate-darwin-source-and-headers.py
new file mode 100644
index 0000000..964e861
--- /dev/null
+++ b/Modules/_ctypes/libffi/generate-darwin-source-and-headers.py
@@ -0,0 +1,209 @@
+#!/usr/bin/env python
+import subprocess
+import os
+import errno
+import collections
+import glob
+import argparse
+
+class Platform(object):
+    pass
+
+class simulator_platform(Platform):
+    directory = 'darwin_ios'
+    sdk = 'iphonesimulator'
+    arch = 'i386'
+    triple = 'i386-apple-darwin11'
+    version_min = '-miphoneos-version-min=5.1.1'
+
+    prefix = "#ifdef __i386__\n\n"
+    suffix = "\n\n#endif"
+    src_dir = 'x86'
+    src_files = ['darwin.S', 'win32.S', 'ffi.c']
+
+
+class simulator64_platform(Platform):
+    directory = 'darwin_ios'
+    sdk = 'iphonesimulator'
+    arch = 'x86_64'
+    triple = 'x86_64-apple-darwin13'
+    version_min = '-miphoneos-version-min=7.0'
+
+    prefix = "#ifdef __x86_64__\n\n"
+    suffix = "\n\n#endif"
+    src_dir = 'x86'
+    src_files = ['darwin64.S', 'ffi64.c']
+
+
+class device_platform(Platform):
+    directory = 'darwin_ios'
+    sdk = 'iphoneos'
+    arch = 'armv7'
+    triple = 'arm-apple-darwin11'
+    version_min = '-miphoneos-version-min=5.1.1'
+
+    prefix = "#ifdef __arm__\n\n"
+    suffix = "\n\n#endif"
+    src_dir = 'arm'
+    src_files = ['sysv.S', 'trampoline.S', 'ffi.c']
+
+
+class device64_platform(Platform):
+    directory = 'darwin_ios'
+    sdk = 'iphoneos'
+    arch = 'arm64'
+    triple = 'aarch64-apple-darwin13'
+    version_min = '-miphoneos-version-min=7.0'
+
+    prefix = "#ifdef __arm64__\n\n"
+    suffix = "\n\n#endif"
+    src_dir = 'aarch64'
+    src_files = ['sysv.S', 'ffi.c']
+
+
+class desktop32_platform(Platform):
+    directory = 'darwin_osx'
+    sdk = 'macosx'
+    arch = 'i386'
+    triple = 'i386-apple-darwin10'
+    version_min = '-mmacosx-version-min=10.6'
+    src_dir = 'x86'
+    src_files = ['darwin.S', 'win32.S', 'ffi.c']
+
+    prefix = "#ifdef __i386__\n\n"
+    suffix = "\n\n#endif"
+
+
+class desktop64_platform(Platform):
+    directory = 'darwin_osx'
+    sdk = 'macosx'
+    arch = 'x86_64'
+    triple = 'x86_64-apple-darwin10'
+    version_min = '-mmacosx-version-min=10.6'
+
+    prefix = "#ifdef __x86_64__\n\n"
+    suffix = "\n\n#endif"
+    src_dir = 'x86'
+    src_files = ['darwin64.S', 'ffi64.c']
+
+
+def mkdir_p(path):
+    try:
+        os.makedirs(path)
+    except OSError as exc:  # Python >2.5
+        if exc.errno == errno.EEXIST:
+            pass
+        else:
+            raise
+
+
+def move_file(src_dir, dst_dir, filename, file_suffix=None, prefix='', suffix=''):
+    mkdir_p(dst_dir)
+    out_filename = filename
+
+    if file_suffix:
+        split_name = os.path.splitext(filename)
+        out_filename = "%s_%s%s" % (split_name[0], file_suffix, split_name[1])
+
+    with open(os.path.join(src_dir, filename)) as in_file:
+        with open(os.path.join(dst_dir, out_filename), 'w') as out_file:
+            if prefix:
+                out_file.write(prefix)
+
+            out_file.write(in_file.read())
+
+            if suffix:
+                out_file.write(suffix)
+
+
+def list_files(src_dir, pattern=None, filelist=None):
+    if pattern: filelist = glob.iglob(os.path.join(src_dir, pattern))
+    for file in filelist:
+        yield os.path.basename(file)
+
+
+def copy_files(src_dir, dst_dir, pattern=None, filelist=None, file_suffix=None, prefix=None, suffix=None):
+    for filename in list_files(src_dir, pattern=pattern, filelist=filelist):
+        move_file(src_dir, dst_dir, filename, file_suffix=file_suffix, prefix=prefix, suffix=suffix)
+
+
+def copy_src_platform_files(platform):
+    src_dir = os.path.join('src', platform.src_dir)
+    dst_dir = os.path.join(platform.directory, 'src', platform.src_dir)
+    copy_files(src_dir, dst_dir, filelist=platform.src_files, file_suffix=platform.arch, prefix=platform.prefix, suffix=platform.suffix)
+
+
+def build_target(platform, platform_headers):
+    def xcrun_cmd(cmd):
+        return 'xcrun -sdk %s %s -arch %s' % (platform.sdk, cmd, platform.arch)
+
+    tag='%s-%s' % (platform.sdk, platform.arch)
+    build_dir = 'build_%s' % tag
+    mkdir_p(build_dir)
+    env = dict(CC=xcrun_cmd('clang'),
+               LD=xcrun_cmd('ld'),
+               CFLAGS='%s' % (platform.version_min))
+    working_dir = os.getcwd()
+    try:
+        os.chdir(build_dir)
+        subprocess.check_call(['../configure', '-host', platform.triple], env=env)
+    finally:
+        os.chdir(working_dir)
+
+    for src_dir in [build_dir, os.path.join(build_dir, 'include')]:
+        copy_files(src_dir,
+                   os.path.join(platform.directory, 'include'),
+                   pattern='*.h',
+                   file_suffix=platform.arch,
+                   prefix=platform.prefix,
+                   suffix=platform.suffix)
+
+        for filename in list_files(src_dir, pattern='*.h'):
+            platform_headers[filename].add((platform.prefix, platform.arch, platform.suffix))
+
+
+def make_tramp():
+    with open('src/arm/trampoline.S', 'w') as tramp_out:
+        p = subprocess.Popen(['bash', 'src/arm/gentramp.sh'], stdout=tramp_out)
+        p.wait()
+
+
+def generate_source_and_headers(generate_osx=True, generate_ios=True):
+    copy_files('src', 'darwin_common/src', pattern='*.c')
+    copy_files('include', 'darwin_common/include', pattern='*.h')
+
+    if generate_ios:
+        make_tramp()
+        copy_src_platform_files(simulator_platform)
+        copy_src_platform_files(simulator64_platform)
+        copy_src_platform_files(device_platform)
+        copy_src_platform_files(device64_platform)
+    if generate_osx:
+        copy_src_platform_files(desktop32_platform)
+        copy_src_platform_files(desktop64_platform)
+
+    platform_headers = collections.defaultdict(set)
+
+    if generate_ios:
+        build_target(simulator_platform, platform_headers)
+        build_target(simulator64_platform, platform_headers)
+        build_target(device_platform, platform_headers)
+        build_target(device64_platform, platform_headers)
+    if generate_osx:
+        build_target(desktop32_platform, platform_headers)
+        build_target(desktop64_platform, platform_headers)
+
+    mkdir_p('darwin_common/include')
+    for header_name, tag_tuples in platform_headers.iteritems():
+        basename, suffix = os.path.splitext(header_name)
+        with open(os.path.join('darwin_common/include', header_name), 'w') as header:
+            for tag_tuple in tag_tuples:
+                header.write('%s#include <%s_%s%s>\n%s\n' % (tag_tuple[0], basename, tag_tuple[1], suffix, tag_tuple[2]))
+
+if __name__ == '__main__':
+    parser = argparse.ArgumentParser()
+    parser.add_argument('--only-ios', action='store_true', default=False)
+    parser.add_argument('--only-osx', action='store_true', default=False)
+    args = parser.parse_args()
+
+    generate_source_and_headers(generate_osx=not args.only_ios, generate_ios=not args.only_osx)
diff --git a/Modules/_ctypes/libffi/generate-ios-source-and-headers.py b/Modules/_ctypes/libffi/generate-ios-source-and-headers.py
deleted file mode 100755
index c2bca73..0000000
--- a/Modules/_ctypes/libffi/generate-ios-source-and-headers.py
+++ /dev/null
@@ -1,160 +0,0 @@
-#!/usr/bin/env python
-
-import subprocess
-import re
-import os
-import errno
-import collections
-import sys
-
-class Platform(object):
-    pass
-
-sdk_re = re.compile(r'.*-sdk ([a-zA-Z0-9.]*)')
-
-def sdkinfo(sdkname):
-    ret = {}
-    for line in subprocess.Popen(['xcodebuild', '-sdk', sdkname, '-version'], stdout=subprocess.PIPE).stdout:
-        kv = line.strip().split(': ', 1)
-        if len(kv) == 2:
-            k,v = kv
-            ret[k] = v
-    return ret
-
-sim_sdk_info = sdkinfo('iphonesimulator')
-device_sdk_info = sdkinfo('iphoneos')
-
-def latest_sdks():
-    latest_sim = None
-    latest_device = None
-    for line in subprocess.Popen(['xcodebuild', '-showsdks'], stdout=subprocess.PIPE).stdout:
-        match = sdk_re.match(line)
-        if match:
-            if 'Simulator' in line:
-                latest_sim = match.group(1)
-            elif 'iOS' in line:
-                latest_device = match.group(1)
-
-    return latest_sim, latest_device
-
-sim_sdk, device_sdk = latest_sdks()
-
-class simulator_platform(Platform):
-    sdk='iphonesimulator'
-    arch = 'i386'
-    name = 'simulator'
-    triple = 'i386-apple-darwin10'
-    sdkroot = sim_sdk_info['Path']
-
-    prefix = "#if !defined(__arm__) && defined(__i386__)\n\n"
-    suffix = "\n\n#endif"
-
-class device_platform(Platform):
-    sdk='iphoneos'
-    name = 'ios'
-    arch = 'armv7'
-    triple = 'arm-apple-darwin10'
-    sdkroot = device_sdk_info['Path']
-
-    prefix = "#ifdef __arm__\n\n"
-    suffix = "\n\n#endif"
-
-
-def move_file(src_dir, dst_dir, filename, file_suffix=None, prefix='', suffix=''):
-    if not os.path.exists(dst_dir):
-        os.makedirs(dst_dir)
-
-    out_filename = filename
-
-    if file_suffix:
-        split_name = os.path.splitext(filename)
-        out_filename =  "%s_%s%s" % (split_name[0], file_suffix, split_name[1])
-
-    with open(os.path.join(src_dir, filename)) as in_file:
-        with open(os.path.join(dst_dir, out_filename), 'w') as out_file:
-            if prefix:
-                out_file.write(prefix)
-
-            out_file.write(in_file.read())
-
-            if suffix:
-                out_file.write(suffix)
-
-headers_seen = collections.defaultdict(set)
-
-def move_source_tree(src_dir, dest_dir, dest_include_dir, arch=None, prefix=None, suffix=None):
-    for root, dirs, files in os.walk(src_dir, followlinks=True):
-        relroot = os.path.relpath(root,src_dir)
-
-        def move_dir(arch, prefix='', suffix='', files=[]):
-            for file in files:
-                file_suffix = None
-                if file.endswith('.h'):
-                    if dest_include_dir:
-                        file_suffix = arch
-                        if arch:
-                            headers_seen[file].add(arch)
-                        move_file(root, dest_include_dir, file, arch, prefix=prefix, suffix=suffix)
-
-                elif dest_dir:
-                    outroot = os.path.join(dest_dir, relroot)
-                    move_file(root, outroot, file, prefix=prefix, suffix=suffix)
-
-        if relroot == '.':
-            move_dir(arch=arch,
-                     files=files,
-                     prefix=prefix,
-                     suffix=suffix)
-        elif relroot == 'arm':
-            move_dir(arch='arm',
-                     prefix="#ifdef __arm__\n\n",
-                     suffix="\n\n#endif",
-                     files=files)
-        elif relroot == 'x86':
-            move_dir(arch='i386',
-                     prefix="#if !defined(__arm__) && defined(__i386__)\n\n",
-                     suffix="\n\n#endif",
-                     files=files)
-
-def build_target(platform):
-    def xcrun_cmd(cmd):
-        return subprocess.check_output(['xcrun', '-sdk', platform.sdkroot, '-find', cmd]).strip()
-
-    build_dir = 'build_' + platform.name
-    if not os.path.exists(build_dir):
-        os.makedirs(build_dir)
-        env = dict(CC=xcrun_cmd('clang'),
-                   LD=xcrun_cmd('ld'),
-                   CFLAGS='-arch %s -isysroot %s -miphoneos-version-min=4.0' % (platform.arch, platform.sdkroot))
-        working_dir=os.getcwd()
-        try:
-            os.chdir(build_dir)
-            subprocess.check_call(['../configure', '-host', platform.triple], env=env)
-            move_source_tree('.', None, '../ios/include',
-                             arch=platform.arch,
-                             prefix=platform.prefix,
-                             suffix=platform.suffix)
-            move_source_tree('./include', None, '../ios/include',
-                            arch=platform.arch,
-                            prefix=platform.prefix,
-                            suffix=platform.suffix)
-        finally:
-            os.chdir(working_dir)
-
-        for header_name, archs in headers_seen.iteritems():
-            basename, suffix = os.path.splitext(header_name)
-
-def main():
-    move_source_tree('src', 'ios/src', 'ios/include')
-    move_source_tree('include', None, 'ios/include')
-    build_target(simulator_platform)
-    build_target(device_platform)
-
-    for header_name, archs in headers_seen.iteritems():
-        basename, suffix = os.path.splitext(header_name)
-        with open(os.path.join('ios/include', header_name), 'w') as header:
-            for arch in archs:
-                header.write('#include <%s_%s%s>\n' % (basename, arch, suffix))
-
-if __name__ == '__main__':
-    main()
diff --git a/Modules/_ctypes/libffi/generate-osx-source-and-headers.py b/Modules/_ctypes/libffi/generate-osx-source-and-headers.py
deleted file mode 100755
index 64313c1..0000000
--- a/Modules/_ctypes/libffi/generate-osx-source-and-headers.py
+++ /dev/null
@@ -1,153 +0,0 @@
-#!/usr/bin/env python
-import subprocess
-import re
-import os
-import errno
-import collections
-import sys
-
-class Platform(object):
-    pass
-
-sdk_re = re.compile(r'.*-sdk ([a-zA-Z0-9.]*)')
-
-def sdkinfo(sdkname):
-    ret = {}
-    for line in subprocess.Popen(['xcodebuild', '-sdk', sdkname, '-version'], stdout=subprocess.PIPE).stdout:
-        kv = line.strip().split(': ', 1)
-        if len(kv) == 2:
-            k,v = kv
-            ret[k] = v
-    return ret
-
-desktop_sdk_info = sdkinfo('macosx')
-
-def latest_sdks():
-    latest_desktop = None
-    for line in subprocess.Popen(['xcodebuild', '-showsdks'], stdout=subprocess.PIPE).stdout:
-        match = sdk_re.match(line)
-        if match:
-            if 'OS X' in line:
-                latest_desktop = match.group(1)
-
-    return latest_desktop
-
-desktop_sdk = latest_sdks()
-
-class desktop_platform_32(Platform):
-    sdk='macosx'
-    arch = 'i386'
-    name = 'mac32'
-    triple = 'i386-apple-darwin10'
-    sdkroot = desktop_sdk_info['Path']
-
-    prefix = "#if defined(__i386__) && !defined(__x86_64__)\n\n"
-    suffix = "\n\n#endif"
-
-class desktop_platform_64(Platform):
-    sdk='macosx'
-    arch = 'x86_64'
-    name = 'mac'
-    triple = 'x86_64-apple-darwin10'
-    sdkroot = desktop_sdk_info['Path']
-
-    prefix = "#if !defined(__i386__) && defined(__x86_64__)\n\n"
-    suffix = "\n\n#endif"
-
-def move_file(src_dir, dst_dir, filename, file_suffix=None, prefix='', suffix=''):
-    if not os.path.exists(dst_dir):
-        os.makedirs(dst_dir)
-
-    out_filename = filename
-
-    if file_suffix:
-        split_name = os.path.splitext(filename)
-        out_filename =  "%s_%s%s" % (split_name[0], file_suffix, split_name[1])
-
-    with open(os.path.join(src_dir, filename)) as in_file:
-        with open(os.path.join(dst_dir, out_filename), 'w') as out_file:
-            if prefix:
-                out_file.write(prefix)
-
-            out_file.write(in_file.read())
-
-            if suffix:
-                out_file.write(suffix)
-
-headers_seen = collections.defaultdict(set)
-
-def move_source_tree(src_dir, dest_dir, dest_include_dir, arch=None, prefix=None, suffix=None):
-    for root, dirs, files in os.walk(src_dir, followlinks=True):
-        relroot = os.path.relpath(root,src_dir)
-
-        def move_dir(arch, prefix='', suffix='', files=[]):
-            for file in files:
-                file_suffix = None
-                if file.endswith('.h'):
-                    if dest_include_dir:
-                        file_suffix = arch
-                        if arch:
-                            headers_seen[file].add(arch)
-                        move_file(root, dest_include_dir, file, arch, prefix=prefix, suffix=suffix)
-
-                elif dest_dir:
-                    outroot = os.path.join(dest_dir, relroot)
-                    move_file(root, outroot, file, prefix=prefix, suffix=suffix)
-
-        if relroot == '.':
-            move_dir(arch=arch,
-                     files=files,
-                     prefix=prefix,
-                     suffix=suffix)
-        elif relroot == 'x86':
-            move_dir(arch='i386',
-                     prefix="#if defined(__i386__) && !defined(__x86_64__)\n\n",
-                     suffix="\n\n#endif",
-                     files=files)
-            move_dir(arch='x86_64',
-                     prefix="#if !defined(__i386__) && defined(__x86_64__)\n\n",
-                     suffix="\n\n#endif",
-                     files=files)
-
-def build_target(platform):
-    def xcrun_cmd(cmd):
-        return subprocess.check_output(['xcrun', '-sdk', platform.sdkroot, '-find', cmd]).strip()
-
-    build_dir = 'build_' + platform.name
-    if not os.path.exists(build_dir):
-        os.makedirs(build_dir)
-        env = dict(CC=xcrun_cmd('clang'),
-                   LD=xcrun_cmd('ld'),
-                   CFLAGS='-arch %s -isysroot %s -mmacosx-version-min=10.6' % (platform.arch, platform.sdkroot))
-        working_dir=os.getcwd()
-        try:
-            os.chdir(build_dir)
-            subprocess.check_call(['../configure', '-host', platform.triple], env=env)
-            move_source_tree('.', None, '../osx/include',
-                             arch=platform.arch,
-                             prefix=platform.prefix,
-                             suffix=platform.suffix)
-            move_source_tree('./include', None, '../osx/include',
-                             arch=platform.arch,
-                             prefix=platform.prefix,
-                             suffix=platform.suffix)
-        finally:
-            os.chdir(working_dir)
-
-        for header_name, archs in headers_seen.iteritems():
-            basename, suffix = os.path.splitext(header_name)
-
-def main():
-    move_source_tree('src', 'osx/src', 'osx/include')
-    move_source_tree('include', None, 'osx/include')
-    build_target(desktop_platform_32)
-    build_target(desktop_platform_64)
-
-    for header_name, archs in headers_seen.iteritems():
-        basename, suffix = os.path.splitext(header_name)
-        with open(os.path.join('osx/include', header_name), 'w') as header:
-            for arch in archs:
-                header.write('#include <%s_%s%s>\n' % (basename, arch, suffix))
-
-if __name__ == '__main__':
-    main()
diff --git a/Modules/_ctypes/libffi/include/Makefile.in b/Modules/_ctypes/libffi/include/Makefile.in
index 2c36e36..9d747e8 100644
--- a/Modules/_ctypes/libffi/include/Makefile.in
+++ b/Modules/_ctypes/libffi/include/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.12.2 from Makefile.am.
+# Makefile.in generated by automake 1.13.4 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,23 +15,51 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \	]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -52,7 +80,7 @@
 host_triplet = @host@
 target_triplet = @target@
 subdir = include
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
 	$(srcdir)/ffi.h.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/asmcfi.m4 \
@@ -75,6 +103,18 @@
 CONFIG_HEADER = $(top_builddir)/fficonfig.h
 CONFIG_CLEAN_FILES = ffi.h ffitarget.h
 CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 SOURCES =
 DIST_SOURCES =
 am__can_run_installinfo = \
@@ -111,12 +151,30 @@
   }
 am__installdirs = "$(DESTDIR)$(includesdir)"
 HEADERS = $(nodist_includes_HEADERS)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AM_LTLDFLAGS = @AM_LTLDFLAGS@
 AM_RUNTESTFLAGS = @AM_RUNTESTFLAGS@
 AR = @AR@
@@ -132,6 +190,10 @@
 CFLAGS = @CFLAGS@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -147,6 +209,7 @@
 FGREP = @FGREP@
 GREP = @GREP@
 HAVE_LONG_DOUBLE = @HAVE_LONG_DOUBLE@
+HAVE_LONG_DOUBLE_VARIANT = @HAVE_LONG_DOUBLE_VARIANT@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -193,6 +256,7 @@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
@@ -315,26 +379,15 @@
 	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
 	dir='$(DESTDIR)$(includesdir)'; $(am__uninstall_files_from_dir)
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
 
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
 	set x; \
 	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	$(am__define_uniq_tagged_files); \
 	shift; \
 	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
@@ -346,15 +399,11 @@
 	      $$unique; \
 	  fi; \
 	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
 	test -z "$(CTAGS_ARGS)$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
 	     $$unique
@@ -363,9 +412,10 @@
 	here=`$(am__cd) $(top_builddir) && pwd` \
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
 
-cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
-	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
 	case "$(srcdir)" in \
 	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
 	  *) sdir=$(subdir)/$(srcdir) ;; \
@@ -517,18 +567,19 @@
 
 .MAKE: install-am install-strip
 
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool cscopelist ctags distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-nodist_includesHEADERS \
-	install-pdf install-pdf-am install-ps install-ps-am \
-	install-strip installcheck installcheck-am installdirs \
-	maintainer-clean maintainer-clean-generic mostlyclean \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-nodist_includesHEADERS
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
+	clean-libtool cscopelist-am ctags ctags-am distclean \
+	distclean-generic distclean-libtool distclean-tags distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-data install-data-am install-dvi install-dvi-am \
+	install-exec install-exec-am install-html install-html-am \
+	install-info install-info-am install-man \
+	install-nodist_includesHEADERS install-pdf install-pdf-am \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
+	uninstall-am uninstall-nodist_includesHEADERS
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/Modules/_ctypes/libffi/include/ffi.h.in b/Modules/_ctypes/libffi/include/ffi.h.in
index a51583b..93c776f 100644
--- a/Modules/_ctypes/libffi/include/ffi.h.in
+++ b/Modules/_ctypes/libffi/include/ffi.h.in
@@ -221,6 +221,11 @@
 #endif
 } ffi_cif;
 
+#if HAVE_LONG_DOUBLE_VARIANT
+/* Used to adjust size/alignment of ffi types.  */
+void ffi_prep_types (ffi_abi abi);
+# endif
+
 /* Used internally, but overridden by some architectures */
 ffi_status ffi_prep_cif_core(ffi_cif *cif,
 			     ffi_abi abi,
diff --git a/Modules/_ctypes/libffi/include/ffi_common.h b/Modules/_ctypes/libffi/include/ffi_common.h
index 650ca69..37f5a9e 100644
--- a/Modules/_ctypes/libffi/include/ffi_common.h
+++ b/Modules/_ctypes/libffi/include/ffi_common.h
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------
-   ffi_common.h - Copyright (C) 2011, 2012  Anthony Green
+   ffi_common.h - Copyright (C) 2011, 2012, 2013  Anthony Green
                   Copyright (C) 2007  Free Software Foundation, Inc
                   Copyright (c) 1996  Red Hat, Inc.
                   
@@ -19,10 +19,14 @@
 /* Do not move this. Some versions of AIX are very picky about where
    this is positioned. */
 #ifdef __GNUC__
-/* mingw64 defines this already in malloc.h. */
-#ifndef alloca
-# define alloca __builtin_alloca
-#endif
+# if HAVE_ALLOCA_H
+#  include <alloca.h>
+# else
+  /* mingw64 defines this already in malloc.h. */
+#  ifndef alloca
+#    define alloca __builtin_alloca
+#  endif
+# endif
 # define MAYBE_UNUSED __attribute__((__unused__))
 #else
 # define MAYBE_UNUSED
@@ -30,17 +34,17 @@
 #  include <alloca.h>
 # else
 #  ifdef _AIX
- #pragma alloca
+#   pragma alloca
 #  else
 #   ifndef alloca /* predefined by HP cc +Olibcalls */
 #    ifdef _MSC_VER
 #     define alloca _alloca
 #    else
 char *alloca ();
-#    endif
 #   endif
 #  endif
 # endif
+# endif
 #endif
 
 /* Check for the existence of memcpy. */
diff --git a/Modules/_ctypes/libffi/install-sh b/Modules/_ctypes/libffi/install-sh
index 6781b98..377bb86 100755
--- a/Modules/_ctypes/libffi/install-sh
+++ b/Modules/_ctypes/libffi/install-sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2011-11-20.07; # UTC
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -35,7 +35,7 @@
 # FSF changes to this file are in the public domain.
 #
 # Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
+# 'make' implicit rules from creating a file called install from it
 # when there is no Makefile.
 #
 # This script is compatible with the BSD install script, but was written
@@ -156,6 +156,10 @@
     -s) stripcmd=$stripprog;;
 
     -t) dst_arg=$2
+	# Protect names problematic for 'test' and other utilities.
+	case $dst_arg in
+	  -* | [=\(\)!]) dst_arg=./$dst_arg;;
+	esac
 	shift;;
 
     -T) no_target_directory=true;;
@@ -186,6 +190,10 @@
     fi
     shift # arg
     dst_arg=$arg
+    # Protect names problematic for 'test' and other utilities.
+    case $dst_arg in
+      -* | [=\(\)!]) dst_arg=./$dst_arg;;
+    esac
   done
 fi
 
@@ -194,13 +202,17 @@
     echo "$0: no input file specified." >&2
     exit 1
   fi
-  # It's OK to call `install-sh -d' without argument.
+  # It's OK to call 'install-sh -d' without argument.
   # This can happen when creating conditional directories.
   exit 0
 fi
 
 if test -z "$dir_arg"; then
-  trap '(exit $?); exit' 1 2 13 15
+  do_exit='(exit $ret); exit $ret'
+  trap "ret=129; $do_exit" 1
+  trap "ret=130; $do_exit" 2
+  trap "ret=141; $do_exit" 13
+  trap "ret=143; $do_exit" 15
 
   # Set umask so as not to create temps with too-generous modes.
   # However, 'strip' requires both read and write access to temps.
@@ -228,9 +240,9 @@
 
 for src
 do
-  # Protect names starting with `-'.
+  # Protect names problematic for 'test' and other utilities.
   case $src in
-    -*) src=./$src;;
+    -* | [=\(\)!]) src=./$src;;
   esac
 
   if test -n "$dir_arg"; then
@@ -252,12 +264,7 @@
       echo "$0: no destination specified." >&2
       exit 1
     fi
-
     dst=$dst_arg
-    # Protect names starting with `-'.
-    case $dst in
-      -*) dst=./$dst;;
-    esac
 
     # If destination is a directory, append the input filename; won't work
     # if double slashes aren't ignored.
@@ -347,7 +354,7 @@
 	      if test -z "$dir_arg" || {
 		   # Check for POSIX incompatibilities with -m.
 		   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
-		   # other-writeable bit of parent directory when it shouldn't.
+		   # other-writable bit of parent directory when it shouldn't.
 		   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
 		   ls_ld_tmpdir=`ls -ld "$tmpdir"`
 		   case $ls_ld_tmpdir in
@@ -385,7 +392,7 @@
 
       case $dstdir in
 	/*) prefix='/';;
-	-*) prefix='./';;
+	[-=\(\)!]*) prefix='./';;
 	*)  prefix='';;
       esac
 
@@ -403,7 +410,7 @@
 
       for d
       do
-	test -z "$d" && continue
+	test X"$d" = X && continue
 
 	prefix=$prefix$d
 	if test -d "$prefix"; then
diff --git a/Modules/_ctypes/libffi/libffi.pc.in b/Modules/_ctypes/libffi/libffi.pc.in
index c2e1c7b..edf6fde 100644
--- a/Modules/_ctypes/libffi/libffi.pc.in
+++ b/Modules/_ctypes/libffi/libffi.pc.in
@@ -1,10 +1,11 @@
 prefix=@prefix@
 exec_prefix=@exec_prefix@
 libdir=@libdir@
+toolexeclibdir=@toolexeclibdir@
 includedir=${libdir}/@PACKAGE_NAME@-@PACKAGE_VERSION@/include
 
 Name: @PACKAGE_NAME@
 Description: Library supporting Foreign Function Interfaces
 Version: @PACKAGE_VERSION@
-Libs: -L${libdir} -lffi
+Libs: -L${toolexeclibdir} -lffi
 Cflags: -I${includedir}
diff --git a/Modules/_ctypes/libffi/libffi.xcodeproj/project.pbxproj b/Modules/_ctypes/libffi/libffi.xcodeproj/project.pbxproj
index 14c39a2..1cf396f 100644
--- a/Modules/_ctypes/libffi/libffi.xcodeproj/project.pbxproj
+++ b/Modules/_ctypes/libffi/libffi.xcodeproj/project.pbxproj
@@ -7,473 +7,448 @@
 	objects = {
 
 /* Begin PBXBuildFile section */
-		6C43CBDC1534F76F00162364 /* ffi.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CBBD1534F76F00162364 /* ffi.c */; };
-		6C43CBDD1534F76F00162364 /* sysv.S in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CBBF1534F76F00162364 /* sysv.S */; };
-		6C43CBDE1534F76F00162364 /* trampoline.S in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CBC01534F76F00162364 /* trampoline.S */; };
-		6C43CBE61534F76F00162364 /* darwin.S in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CBC91534F76F00162364 /* darwin.S */; };
-		6C43CBE81534F76F00162364 /* ffi.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CBCB1534F76F00162364 /* ffi.c */; };
-		6C43CC1F1534F77800162364 /* darwin.S in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC051534F77800162364 /* darwin.S */; };
-		6C43CC201534F77800162364 /* darwin64.S in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC061534F77800162364 /* darwin64.S */; };
-		6C43CC211534F77800162364 /* ffi.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC071534F77800162364 /* ffi.c */; };
-		6C43CC221534F77800162364 /* ffi64.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC081534F77800162364 /* ffi64.c */; };
-		6C43CC2F1534F7BE00162364 /* closures.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC281534F7BE00162364 /* closures.c */; };
-		6C43CC301534F7BE00162364 /* closures.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC281534F7BE00162364 /* closures.c */; };
-		6C43CC351534F7BE00162364 /* java_raw_api.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC2B1534F7BE00162364 /* java_raw_api.c */; };
-		6C43CC361534F7BE00162364 /* java_raw_api.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC2B1534F7BE00162364 /* java_raw_api.c */; };
-		6C43CC371534F7BE00162364 /* prep_cif.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC2C1534F7BE00162364 /* prep_cif.c */; };
-		6C43CC381534F7BE00162364 /* prep_cif.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC2C1534F7BE00162364 /* prep_cif.c */; };
-		6C43CC391534F7BE00162364 /* raw_api.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC2D1534F7BE00162364 /* raw_api.c */; };
-		6C43CC3A1534F7BE00162364 /* raw_api.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC2D1534F7BE00162364 /* raw_api.c */; };
-		6C43CC3B1534F7BE00162364 /* types.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC2E1534F7BE00162364 /* types.c */; };
-		6C43CC3C1534F7BE00162364 /* types.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC2E1534F7BE00162364 /* types.c */; };
-		6C43CC971535032600162364 /* ffi.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CC8D1535032600162364 /* ffi.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		6C43CC981535032600162364 /* ffi_common.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CC8E1535032600162364 /* ffi_common.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		6C43CC991535032600162364 /* ffi_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CC8F1535032600162364 /* ffi_i386.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		6C43CC9A1535032600162364 /* ffi_x86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CC901535032600162364 /* ffi_x86_64.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		6C43CC9B1535032600162364 /* fficonfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CC911535032600162364 /* fficonfig.h */; };
-		6C43CC9C1535032600162364 /* fficonfig_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CC921535032600162364 /* fficonfig_i386.h */; };
-		6C43CC9D1535032600162364 /* fficonfig_x86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CC931535032600162364 /* fficonfig_x86_64.h */; };
-		6C43CC9E1535032600162364 /* ffitarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CC941535032600162364 /* ffitarget.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		6C43CC9F1535032600162364 /* ffitarget_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CC951535032600162364 /* ffitarget_i386.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		6C43CCA01535032600162364 /* ffitarget_x86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CC961535032600162364 /* ffitarget_x86_64.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		6C43CCAD1535039600162364 /* ffi.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCA21535039600162364 /* ffi.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		6C43CCAE1535039600162364 /* ffi_armv7.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCA31535039600162364 /* ffi_armv7.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		6C43CCAF1535039600162364 /* ffi_common.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCA41535039600162364 /* ffi_common.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		6C43CCB01535039600162364 /* ffi_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCA51535039600162364 /* ffi_i386.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		6C43CCB11535039600162364 /* fficonfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCA61535039600162364 /* fficonfig.h */; };
-		6C43CCB21535039600162364 /* fficonfig_armv7.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCA71535039600162364 /* fficonfig_armv7.h */; };
-		6C43CCB31535039600162364 /* fficonfig_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCA81535039600162364 /* fficonfig_i386.h */; };
-		6C43CCB41535039600162364 /* ffitarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCA91535039600162364 /* ffitarget.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		6C43CCB51535039600162364 /* ffitarget_arm.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCAA1535039600162364 /* ffitarget_arm.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		6C43CCB61535039600162364 /* ffitarget_armv7.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCAB1535039600162364 /* ffitarget_armv7.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		6C43CCB71535039600162364 /* ffitarget_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCAC1535039600162364 /* ffitarget_i386.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		DBFA714A187F1D8600A76262 /* ffi.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA713E187F1D8600A76262 /* ffi.h */; };
+		DBFA714B187F1D8600A76262 /* ffi_common.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA713F187F1D8600A76262 /* ffi_common.h */; };
+		DBFA714C187F1D8600A76262 /* fficonfig.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7140187F1D8600A76262 /* fficonfig.h */; };
+		DBFA714D187F1D8600A76262 /* ffitarget.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7141187F1D8600A76262 /* ffitarget.h */; };
+		DBFA714E187F1D8600A76262 /* closures.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7143187F1D8600A76262 /* closures.c */; };
+		DBFA714F187F1D8600A76262 /* closures.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7143187F1D8600A76262 /* closures.c */; };
+		DBFA7156187F1D8600A76262 /* prep_cif.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7147187F1D8600A76262 /* prep_cif.c */; };
+		DBFA7157187F1D8600A76262 /* prep_cif.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7147187F1D8600A76262 /* prep_cif.c */; };
+		DBFA7158187F1D8600A76262 /* raw_api.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7148187F1D8600A76262 /* raw_api.c */; };
+		DBFA7159187F1D8600A76262 /* raw_api.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7148187F1D8600A76262 /* raw_api.c */; };
+		DBFA715A187F1D8600A76262 /* types.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7149187F1D8600A76262 /* types.c */; };
+		DBFA715B187F1D8600A76262 /* types.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7149187F1D8600A76262 /* types.c */; };
+		DBFA7177187F1D9B00A76262 /* ffi_arm64.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA716C187F1D9B00A76262 /* ffi_arm64.c */; };
+		DBFA7178187F1D9B00A76262 /* sysv_arm64.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA716D187F1D9B00A76262 /* sysv_arm64.S */; };
+		DBFA7179187F1D9B00A76262 /* ffi_armv7.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA716F187F1D9B00A76262 /* ffi_armv7.c */; };
+		DBFA717A187F1D9B00A76262 /* sysv_armv7.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7170187F1D9B00A76262 /* sysv_armv7.S */; };
+		DBFA717B187F1D9B00A76262 /* trampoline_armv7.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7171187F1D9B00A76262 /* trampoline_armv7.S */; };
+		DBFA717C187F1D9B00A76262 /* darwin64_x86_64.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7173187F1D9B00A76262 /* darwin64_x86_64.S */; };
+		DBFA717D187F1D9B00A76262 /* darwin_i386.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7174187F1D9B00A76262 /* darwin_i386.S */; };
+		DBFA717E187F1D9B00A76262 /* ffi64_x86_64.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7175187F1D9B00A76262 /* ffi64_x86_64.c */; };
+		DBFA717F187F1D9B00A76262 /* ffi_i386.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7176187F1D9B00A76262 /* ffi_i386.c */; };
+		DBFA718E187F1DA100A76262 /* ffi_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7182187F1DA100A76262 /* ffi_i386.h */; };
+		DBFA718F187F1DA100A76262 /* ffi_x86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7183187F1DA100A76262 /* ffi_x86_64.h */; };
+		DBFA7190187F1DA100A76262 /* fficonfig_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7184187F1DA100A76262 /* fficonfig_i386.h */; };
+		DBFA7191187F1DA100A76262 /* fficonfig_x86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7185187F1DA100A76262 /* fficonfig_x86_64.h */; };
+		DBFA7192187F1DA100A76262 /* ffitarget_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7186187F1DA100A76262 /* ffitarget_i386.h */; };
+		DBFA7193187F1DA100A76262 /* ffitarget_x86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7187187F1DA100A76262 /* ffitarget_x86_64.h */; };
+		DBFA7194187F1DA100A76262 /* darwin64_x86_64.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA718A187F1DA100A76262 /* darwin64_x86_64.S */; };
+		DBFA7195187F1DA100A76262 /* darwin_i386.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA718B187F1DA100A76262 /* darwin_i386.S */; };
+		DBFA7196187F1DA100A76262 /* ffi64_x86_64.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA718C187F1DA100A76262 /* ffi64_x86_64.c */; };
+		DBFA7197187F1DA100A76262 /* ffi_i386.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA718D187F1DA100A76262 /* ffi_i386.c */; };
 /* End PBXBuildFile section */
 
+/* Begin PBXCopyFilesBuildPhase section */
+		DB13B1641849DF1E0010F42D /* CopyFiles */ = {
+			isa = PBXCopyFilesBuildPhase;
+			buildActionMask = 8;
+			dstPath = "include/$(PRODUCT_NAME)";
+			dstSubfolderSpec = 16;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 1;
+		};
+/* End PBXCopyFilesBuildPhase section */
+
 /* Begin PBXFileReference section */
-		6C43CB3D1534E9D100162364 /* libffi.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libffi.a; sourceTree = BUILT_PRODUCTS_DIR; };
-		6C43CBBD1534F76F00162364 /* ffi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi.c; sourceTree = "<group>"; };
-		6C43CBBF1534F76F00162364 /* sysv.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = sysv.S; sourceTree = "<group>"; };
-		6C43CBC01534F76F00162364 /* trampoline.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = trampoline.S; sourceTree = "<group>"; };
-		6C43CBC91534F76F00162364 /* darwin.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = darwin.S; sourceTree = "<group>"; };
-		6C43CBCB1534F76F00162364 /* ffi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi.c; sourceTree = "<group>"; };
-		6C43CC051534F77800162364 /* darwin.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = darwin.S; sourceTree = "<group>"; };
-		6C43CC061534F77800162364 /* darwin64.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = darwin64.S; sourceTree = "<group>"; };
-		6C43CC071534F77800162364 /* ffi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi.c; sourceTree = "<group>"; };
-		6C43CC081534F77800162364 /* ffi64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi64.c; sourceTree = "<group>"; };
-		6C43CC281534F7BE00162364 /* closures.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = closures.c; path = src/closures.c; sourceTree = SOURCE_ROOT; };
-		6C43CC2B1534F7BE00162364 /* java_raw_api.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = java_raw_api.c; path = src/java_raw_api.c; sourceTree = SOURCE_ROOT; };
-		6C43CC2C1534F7BE00162364 /* prep_cif.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = prep_cif.c; path = src/prep_cif.c; sourceTree = SOURCE_ROOT; };
-		6C43CC2D1534F7BE00162364 /* raw_api.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = raw_api.c; path = src/raw_api.c; sourceTree = SOURCE_ROOT; };
-		6C43CC2E1534F7BE00162364 /* types.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = types.c; path = src/types.c; sourceTree = SOURCE_ROOT; };
-		6C43CC8D1535032600162364 /* ffi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi.h; sourceTree = "<group>"; };
-		6C43CC8E1535032600162364 /* ffi_common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_common.h; sourceTree = "<group>"; };
-		6C43CC8F1535032600162364 /* ffi_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_i386.h; sourceTree = "<group>"; };
-		6C43CC901535032600162364 /* ffi_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_x86_64.h; sourceTree = "<group>"; };
-		6C43CC911535032600162364 /* fficonfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig.h; sourceTree = "<group>"; };
-		6C43CC921535032600162364 /* fficonfig_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_i386.h; sourceTree = "<group>"; };
-		6C43CC931535032600162364 /* fficonfig_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_x86_64.h; sourceTree = "<group>"; };
-		6C43CC941535032600162364 /* ffitarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget.h; sourceTree = "<group>"; };
-		6C43CC951535032600162364 /* ffitarget_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_i386.h; sourceTree = "<group>"; };
-		6C43CC961535032600162364 /* ffitarget_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_x86_64.h; sourceTree = "<group>"; };
-		6C43CCA21535039600162364 /* ffi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi.h; sourceTree = "<group>"; };
-		6C43CCA31535039600162364 /* ffi_armv7.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_armv7.h; sourceTree = "<group>"; };
-		6C43CCA41535039600162364 /* ffi_common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_common.h; sourceTree = "<group>"; };
-		6C43CCA51535039600162364 /* ffi_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_i386.h; sourceTree = "<group>"; };
-		6C43CCA61535039600162364 /* fficonfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig.h; sourceTree = "<group>"; };
-		6C43CCA71535039600162364 /* fficonfig_armv7.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_armv7.h; sourceTree = "<group>"; };
-		6C43CCA81535039600162364 /* fficonfig_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_i386.h; sourceTree = "<group>"; };
-		6C43CCA91535039600162364 /* ffitarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget.h; sourceTree = "<group>"; };
-		6C43CCAA1535039600162364 /* ffitarget_arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_arm.h; sourceTree = "<group>"; };
-		6C43CCAB1535039600162364 /* ffitarget_armv7.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_armv7.h; sourceTree = "<group>"; };
-		6C43CCAC1535039600162364 /* ffitarget_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_i386.h; sourceTree = "<group>"; };
-		F6F980BA147386130008F121 /* libffi.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libffi.a; sourceTree = BUILT_PRODUCTS_DIR; };
+		DB13B1661849DF1E0010F42D /* libffi.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libffi.a; sourceTree = BUILT_PRODUCTS_DIR; };
+		DB13B1911849DF510010F42D /* ffi.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = ffi.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
+		DBFA713E187F1D8600A76262 /* ffi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi.h; sourceTree = "<group>"; };
+		DBFA713F187F1D8600A76262 /* ffi_common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_common.h; sourceTree = "<group>"; };
+		DBFA7140187F1D8600A76262 /* fficonfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig.h; sourceTree = "<group>"; };
+		DBFA7141187F1D8600A76262 /* ffitarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget.h; sourceTree = "<group>"; };
+		DBFA7143187F1D8600A76262 /* closures.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = closures.c; sourceTree = "<group>"; };
+		DBFA7145187F1D8600A76262 /* dlmalloc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = dlmalloc.c; sourceTree = "<group>"; };
+		DBFA7147187F1D8600A76262 /* prep_cif.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = prep_cif.c; sourceTree = "<group>"; };
+		DBFA7148187F1D8600A76262 /* raw_api.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = raw_api.c; sourceTree = "<group>"; };
+		DBFA7149187F1D8600A76262 /* types.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = types.c; sourceTree = "<group>"; };
+		DBFA715E187F1D9B00A76262 /* ffi_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_arm64.h; sourceTree = "<group>"; };
+		DBFA715F187F1D9B00A76262 /* ffi_armv7.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_armv7.h; sourceTree = "<group>"; };
+		DBFA7160187F1D9B00A76262 /* ffi_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_i386.h; sourceTree = "<group>"; };
+		DBFA7161187F1D9B00A76262 /* ffi_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_x86_64.h; sourceTree = "<group>"; };
+		DBFA7162187F1D9B00A76262 /* fficonfig_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_arm64.h; sourceTree = "<group>"; };
+		DBFA7163187F1D9B00A76262 /* fficonfig_armv7.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_armv7.h; sourceTree = "<group>"; };
+		DBFA7164187F1D9B00A76262 /* fficonfig_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_i386.h; sourceTree = "<group>"; };
+		DBFA7165187F1D9B00A76262 /* fficonfig_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_x86_64.h; sourceTree = "<group>"; };
+		DBFA7166187F1D9B00A76262 /* ffitarget_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_arm64.h; sourceTree = "<group>"; };
+		DBFA7167187F1D9B00A76262 /* ffitarget_armv7.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_armv7.h; sourceTree = "<group>"; };
+		DBFA7168187F1D9B00A76262 /* ffitarget_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_i386.h; sourceTree = "<group>"; };
+		DBFA7169187F1D9B00A76262 /* ffitarget_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_x86_64.h; sourceTree = "<group>"; };
+		DBFA716C187F1D9B00A76262 /* ffi_arm64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi_arm64.c; sourceTree = "<group>"; };
+		DBFA716D187F1D9B00A76262 /* sysv_arm64.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = sysv_arm64.S; sourceTree = "<group>"; };
+		DBFA716F187F1D9B00A76262 /* ffi_armv7.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi_armv7.c; sourceTree = "<group>"; };
+		DBFA7170187F1D9B00A76262 /* sysv_armv7.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = sysv_armv7.S; sourceTree = "<group>"; };
+		DBFA7171187F1D9B00A76262 /* trampoline_armv7.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = trampoline_armv7.S; sourceTree = "<group>"; };
+		DBFA7173187F1D9B00A76262 /* darwin64_x86_64.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = darwin64_x86_64.S; sourceTree = "<group>"; };
+		DBFA7174187F1D9B00A76262 /* darwin_i386.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = darwin_i386.S; sourceTree = "<group>"; };
+		DBFA7175187F1D9B00A76262 /* ffi64_x86_64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi64_x86_64.c; sourceTree = "<group>"; };
+		DBFA7176187F1D9B00A76262 /* ffi_i386.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi_i386.c; sourceTree = "<group>"; };
+		DBFA7182187F1DA100A76262 /* ffi_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_i386.h; sourceTree = "<group>"; };
+		DBFA7183187F1DA100A76262 /* ffi_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_x86_64.h; sourceTree = "<group>"; };
+		DBFA7184187F1DA100A76262 /* fficonfig_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_i386.h; sourceTree = "<group>"; };
+		DBFA7185187F1DA100A76262 /* fficonfig_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_x86_64.h; sourceTree = "<group>"; };
+		DBFA7186187F1DA100A76262 /* ffitarget_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_i386.h; sourceTree = "<group>"; };
+		DBFA7187187F1DA100A76262 /* ffitarget_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_x86_64.h; sourceTree = "<group>"; };
+		DBFA718A187F1DA100A76262 /* darwin64_x86_64.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = darwin64_x86_64.S; sourceTree = "<group>"; };
+		DBFA718B187F1DA100A76262 /* darwin_i386.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = darwin_i386.S; sourceTree = "<group>"; };
+		DBFA718C187F1DA100A76262 /* ffi64_x86_64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi64_x86_64.c; sourceTree = "<group>"; };
+		DBFA718D187F1DA100A76262 /* ffi_i386.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi_i386.c; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
-/* Begin PBXFrameworksBuildPhase section */
-		6C43CB3A1534E9D100162364 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		F6F980B7147386130008F121 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXFrameworksBuildPhase section */
-
 /* Begin PBXGroup section */
-		6C43CBAF1534F76F00162364 /* iOS */ = {
+		DB13B15B1849DEB70010F42D = {
 			isa = PBXGroup;
 			children = (
-				6C43CCA11535039600162364 /* include */,
-				6C43CBBB1534F76F00162364 /* src */,
+				DBFA713C187F1D8600A76262 /* darwin_common */,
+				DBFA715C187F1D9B00A76262 /* darwin_ios */,
+				DBFA7180187F1DA100A76262 /* darwin_osx */,
+				DB13B1671849DF1E0010F42D /* Products */,
 			);
-			name = iOS;
-			path = ios;
 			sourceTree = "<group>";
 		};
-		6C43CBBB1534F76F00162364 /* src */ = {
+		DB13B1671849DF1E0010F42D /* Products */ = {
 			isa = PBXGroup;
 			children = (
-				6C43CBC81534F76F00162364 /* x86 */,
-				6C43CBBC1534F76F00162364 /* arm */,
+				DB13B1661849DF1E0010F42D /* libffi.a */,
+				DB13B1911849DF510010F42D /* ffi.dylib */,
+			);
+			name = Products;
+			sourceTree = "<group>";
+		};
+		DBFA713C187F1D8600A76262 /* darwin_common */ = {
+			isa = PBXGroup;
+			children = (
+				DBFA713D187F1D8600A76262 /* include */,
+				DBFA7142187F1D8600A76262 /* src */,
+			);
+			path = "darwin_common";
+			sourceTree = "<group>";
+		};
+		DBFA713D187F1D8600A76262 /* include */ = {
+			isa = PBXGroup;
+			children = (
+				DBFA713E187F1D8600A76262 /* ffi.h */,
+				DBFA713F187F1D8600A76262 /* ffi_common.h */,
+				DBFA7140187F1D8600A76262 /* fficonfig.h */,
+				DBFA7141187F1D8600A76262 /* ffitarget.h */,
+			);
+			path = include;
+			sourceTree = "<group>";
+		};
+		DBFA7142187F1D8600A76262 /* src */ = {
+			isa = PBXGroup;
+			children = (
+				DBFA7143187F1D8600A76262 /* closures.c */,
+				DBFA7145187F1D8600A76262 /* dlmalloc.c */,
+				DBFA7147187F1D8600A76262 /* prep_cif.c */,
+				DBFA7148187F1D8600A76262 /* raw_api.c */,
+				DBFA7149187F1D8600A76262 /* types.c */,
 			);
 			path = src;
 			sourceTree = "<group>";
 		};
-		6C43CBBC1534F76F00162364 /* arm */ = {
+		DBFA715C187F1D9B00A76262 /* darwin_ios */ = {
 			isa = PBXGroup;
 			children = (
-				6C43CBBD1534F76F00162364 /* ffi.c */,
-				6C43CBBF1534F76F00162364 /* sysv.S */,
-				6C43CBC01534F76F00162364 /* trampoline.S */,
+				DBFA715D187F1D9B00A76262 /* include */,
+				DBFA716A187F1D9B00A76262 /* src */,
+			);
+			path = "darwin_ios";
+			sourceTree = "<group>";
+		};
+		DBFA715D187F1D9B00A76262 /* include */ = {
+			isa = PBXGroup;
+			children = (
+				DBFA715E187F1D9B00A76262 /* ffi_arm64.h */,
+				DBFA715F187F1D9B00A76262 /* ffi_armv7.h */,
+				DBFA7160187F1D9B00A76262 /* ffi_i386.h */,
+				DBFA7161187F1D9B00A76262 /* ffi_x86_64.h */,
+				DBFA7162187F1D9B00A76262 /* fficonfig_arm64.h */,
+				DBFA7163187F1D9B00A76262 /* fficonfig_armv7.h */,
+				DBFA7164187F1D9B00A76262 /* fficonfig_i386.h */,
+				DBFA7165187F1D9B00A76262 /* fficonfig_x86_64.h */,
+				DBFA7166187F1D9B00A76262 /* ffitarget_arm64.h */,
+				DBFA7167187F1D9B00A76262 /* ffitarget_armv7.h */,
+				DBFA7168187F1D9B00A76262 /* ffitarget_i386.h */,
+				DBFA7169187F1D9B00A76262 /* ffitarget_x86_64.h */,
+			);
+			path = include;
+			sourceTree = "<group>";
+		};
+		DBFA716A187F1D9B00A76262 /* src */ = {
+			isa = PBXGroup;
+			children = (
+				DBFA716B187F1D9B00A76262 /* aarch64 */,
+				DBFA716E187F1D9B00A76262 /* arm */,
+				DBFA7172187F1D9B00A76262 /* x86 */,
+			);
+			path = src;
+			sourceTree = "<group>";
+		};
+		DBFA716B187F1D9B00A76262 /* aarch64 */ = {
+			isa = PBXGroup;
+			children = (
+				DBFA716C187F1D9B00A76262 /* ffi_arm64.c */,
+				DBFA716D187F1D9B00A76262 /* sysv_arm64.S */,
+			);
+			path = aarch64;
+			sourceTree = "<group>";
+		};
+		DBFA716E187F1D9B00A76262 /* arm */ = {
+			isa = PBXGroup;
+			children = (
+				DBFA716F187F1D9B00A76262 /* ffi_armv7.c */,
+				DBFA7170187F1D9B00A76262 /* sysv_armv7.S */,
+				DBFA7171187F1D9B00A76262 /* trampoline_armv7.S */,
 			);
 			path = arm;
 			sourceTree = "<group>";
 		};
-		6C43CBC81534F76F00162364 /* x86 */ = {
+		DBFA7172187F1D9B00A76262 /* x86 */ = {
 			isa = PBXGroup;
 			children = (
-				6C43CBC91534F76F00162364 /* darwin.S */,
-				6C43CBCB1534F76F00162364 /* ffi.c */,
+				DBFA7173187F1D9B00A76262 /* darwin64_x86_64.S */,
+				DBFA7174187F1D9B00A76262 /* darwin_i386.S */,
+				DBFA7175187F1D9B00A76262 /* ffi64_x86_64.c */,
+				DBFA7176187F1D9B00A76262 /* ffi_i386.c */,
 			);
 			path = x86;
 			sourceTree = "<group>";
 		};
-		6C43CBF01534F77800162364 /* OS X */ = {
+		DBFA7180187F1DA100A76262 /* darwin_osx */ = {
 			isa = PBXGroup;
 			children = (
-				6C43CC8C1535032600162364 /* include */,
-				6C43CBFC1534F77800162364 /* src */,
+				DBFA7181187F1DA100A76262 /* include */,
+				DBFA7188187F1DA100A76262 /* src */,
 			);
-			name = "OS X";
-			path = osx;
+			path = "darwin_osx";
 			sourceTree = "<group>";
 		};
-		6C43CBFC1534F77800162364 /* src */ = {
+		DBFA7181187F1DA100A76262 /* include */ = {
 			isa = PBXGroup;
 			children = (
-				6C43CC041534F77800162364 /* x86 */,
+				DBFA7182187F1DA100A76262 /* ffi_i386.h */,
+				DBFA7183187F1DA100A76262 /* ffi_x86_64.h */,
+				DBFA7184187F1DA100A76262 /* fficonfig_i386.h */,
+				DBFA7185187F1DA100A76262 /* fficonfig_x86_64.h */,
+				DBFA7186187F1DA100A76262 /* ffitarget_i386.h */,
+				DBFA7187187F1DA100A76262 /* ffitarget_x86_64.h */,
+			);
+			path = include;
+			sourceTree = "<group>";
+		};
+		DBFA7188187F1DA100A76262 /* src */ = {
+			isa = PBXGroup;
+			children = (
+				DBFA7189187F1DA100A76262 /* x86 */,
 			);
 			path = src;
 			sourceTree = "<group>";
 		};
-		6C43CC041534F77800162364 /* x86 */ = {
+		DBFA7189187F1DA100A76262 /* x86 */ = {
 			isa = PBXGroup;
 			children = (
-				6C43CC051534F77800162364 /* darwin.S */,
-				6C43CC061534F77800162364 /* darwin64.S */,
-				6C43CC071534F77800162364 /* ffi.c */,
-				6C43CC081534F77800162364 /* ffi64.c */,
+				DBFA718A187F1DA100A76262 /* darwin64_x86_64.S */,
+				DBFA718B187F1DA100A76262 /* darwin_i386.S */,
+				DBFA718C187F1DA100A76262 /* ffi64_x86_64.c */,
+				DBFA718D187F1DA100A76262 /* ffi_i386.c */,
 			);
 			path = x86;
 			sourceTree = "<group>";
 		};
-		6C43CC3D1534F7C400162364 /* src */ = {
-			isa = PBXGroup;
-			children = (
-				6C43CC281534F7BE00162364 /* closures.c */,
-				6C43CC2B1534F7BE00162364 /* java_raw_api.c */,
-				6C43CC2C1534F7BE00162364 /* prep_cif.c */,
-				6C43CC2D1534F7BE00162364 /* raw_api.c */,
-				6C43CC2E1534F7BE00162364 /* types.c */,
-			);
-			name = src;
-			path = ios;
-			sourceTree = "<group>";
-		};
-		6C43CC8C1535032600162364 /* include */ = {
-			isa = PBXGroup;
-			children = (
-				6C43CC8D1535032600162364 /* ffi.h */,
-				6C43CC8E1535032600162364 /* ffi_common.h */,
-				6C43CC8F1535032600162364 /* ffi_i386.h */,
-				6C43CC901535032600162364 /* ffi_x86_64.h */,
-				6C43CC911535032600162364 /* fficonfig.h */,
-				6C43CC921535032600162364 /* fficonfig_i386.h */,
-				6C43CC931535032600162364 /* fficonfig_x86_64.h */,
-				6C43CC941535032600162364 /* ffitarget.h */,
-				6C43CC951535032600162364 /* ffitarget_i386.h */,
-				6C43CC961535032600162364 /* ffitarget_x86_64.h */,
-			);
-			path = include;
-			sourceTree = "<group>";
-		};
-		6C43CCA11535039600162364 /* include */ = {
-			isa = PBXGroup;
-			children = (
-				6C43CCA21535039600162364 /* ffi.h */,
-				6C43CCA31535039600162364 /* ffi_armv7.h */,
-				6C43CCA41535039600162364 /* ffi_common.h */,
-				6C43CCA51535039600162364 /* ffi_i386.h */,
-				6C43CCA61535039600162364 /* fficonfig.h */,
-				6C43CCA71535039600162364 /* fficonfig_armv7.h */,
-				6C43CCA81535039600162364 /* fficonfig_i386.h */,
-				6C43CCA91535039600162364 /* ffitarget.h */,
-				6C43CCAA1535039600162364 /* ffitarget_arm.h */,
-				6C43CCAB1535039600162364 /* ffitarget_armv7.h */,
-				6C43CCAC1535039600162364 /* ffitarget_i386.h */,
-			);
-			path = include;
-			sourceTree = "<group>";
-		};
-		F6B0839514721EE50031D8A1 = {
-			isa = PBXGroup;
-			children = (
-				6C43CC3D1534F7C400162364 /* src */,
-				6C43CBAF1534F76F00162364 /* iOS */,
-				6C43CBF01534F77800162364 /* OS X */,
-				F6F980C6147386260008F121 /* Products */,
-			);
-			sourceTree = "<group>";
-		};
-		F6F980C6147386260008F121 /* Products */ = {
-			isa = PBXGroup;
-			children = (
-				F6F980BA147386130008F121 /* libffi.a */,
-				6C43CB3D1534E9D100162364 /* libffi.a */,
-			);
-			name = Products;
-			path = ../..;
-			sourceTree = BUILT_PRODUCTS_DIR;
-		};
 /* End PBXGroup section */
 
 /* Begin PBXHeadersBuildPhase section */
-		6C43CB3B1534E9D100162364 /* Headers */ = {
+		DB13B18F1849DF510010F42D /* Headers */ = {
 			isa = PBXHeadersBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				6C43CC971535032600162364 /* ffi.h in Headers */,
-				6C43CC981535032600162364 /* ffi_common.h in Headers */,
-				6C43CC991535032600162364 /* ffi_i386.h in Headers */,
-				6C43CC9A1535032600162364 /* ffi_x86_64.h in Headers */,
-				6C43CC9E1535032600162364 /* ffitarget.h in Headers */,
-				6C43CC9F1535032600162364 /* ffitarget_i386.h in Headers */,
-				6C43CCA01535032600162364 /* ffitarget_x86_64.h in Headers */,
-				6C43CC9B1535032600162364 /* fficonfig.h in Headers */,
-				6C43CC9C1535032600162364 /* fficonfig_i386.h in Headers */,
-				6C43CC9D1535032600162364 /* fficonfig_x86_64.h in Headers */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		F6F980B8147386130008F121 /* Headers */ = {
-			isa = PBXHeadersBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				6C43CCAD1535039600162364 /* ffi.h in Headers */,
-				6C43CCAE1535039600162364 /* ffi_armv7.h in Headers */,
-				6C43CCAF1535039600162364 /* ffi_common.h in Headers */,
-				6C43CCB01535039600162364 /* ffi_i386.h in Headers */,
-				6C43CCB41535039600162364 /* ffitarget.h in Headers */,
-				6C43CCB51535039600162364 /* ffitarget_arm.h in Headers */,
-				6C43CCB61535039600162364 /* ffitarget_armv7.h in Headers */,
-				6C43CCB71535039600162364 /* ffitarget_i386.h in Headers */,
-				6C43CCB11535039600162364 /* fficonfig.h in Headers */,
-				6C43CCB21535039600162364 /* fficonfig_armv7.h in Headers */,
-				6C43CCB31535039600162364 /* fficonfig_i386.h in Headers */,
+				DBFA714C187F1D8600A76262 /* fficonfig.h in Headers */,
+				DBFA714D187F1D8600A76262 /* ffitarget.h in Headers */,
+				DBFA714A187F1D8600A76262 /* ffi.h in Headers */,
+				DBFA718F187F1DA100A76262 /* ffi_x86_64.h in Headers */,
+				DBFA7191187F1DA100A76262 /* fficonfig_x86_64.h in Headers */,
+				DBFA718E187F1DA100A76262 /* ffi_i386.h in Headers */,
+				DBFA7190187F1DA100A76262 /* fficonfig_i386.h in Headers */,
+				DBFA714B187F1D8600A76262 /* ffi_common.h in Headers */,
+				DBFA7193187F1DA100A76262 /* ffitarget_x86_64.h in Headers */,
+				DBFA7192187F1DA100A76262 /* ffitarget_i386.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 /* End PBXHeadersBuildPhase section */
 
 /* Begin PBXNativeTarget section */
-		6C43CB3C1534E9D100162364 /* libffi OS X */ = {
+		DB13B1651849DF1E0010F42D /* libffi-iOS */ = {
 			isa = PBXNativeTarget;
-			buildConfigurationList = 6C43CB4A1534E9D100162364 /* Build configuration list for PBXNativeTarget "libffi OS X" */;
+			buildConfigurationList = DB13B18B1849DF1E0010F42D /* Build configuration list for PBXNativeTarget "libffi-iOS" */;
 			buildPhases = (
-				6C43CC401534FF3B00162364 /* Generate Source and Headers */,
-				6C43CB391534E9D100162364 /* Sources */,
-				6C43CB3A1534E9D100162364 /* Frameworks */,
-				6C43CB3B1534E9D100162364 /* Headers */,
+				DB13B3051849E01C0010F42D /* ShellScript */,
+				DB13B1621849DF1E0010F42D /* Sources */,
+				DB13B1641849DF1E0010F42D /* CopyFiles */,
 			);
 			buildRules = (
 			);
 			dependencies = (
 			);
-			name = "libffi OS X";
-			productName = "ffi OS X";
-			productReference = 6C43CB3D1534E9D100162364 /* libffi.a */;
+			name = "libffi-iOS";
+			productName = ffi;
+			productReference = DB13B1661849DF1E0010F42D /* libffi.a */;
 			productType = "com.apple.product-type.library.static";
 		};
-		F6F980B9147386130008F121 /* libffi iOS */ = {
+		DB13B1901849DF510010F42D /* libffi-Mac */ = {
 			isa = PBXNativeTarget;
-			buildConfigurationList = F6F980C4147386130008F121 /* Build configuration list for PBXNativeTarget "libffi iOS" */;
+			buildConfigurationList = DB13B1B01849DF520010F42D /* Build configuration list for PBXNativeTarget "libffi-Mac" */;
 			buildPhases = (
-				6C43CC3E1534F8E200162364 /* Generate Trampoline */,
-				6C43CC3F1534FF1B00162364 /* Generate Source and Headers */,
-				F6F980B6147386130008F121 /* Sources */,
-				F6F980B7147386130008F121 /* Frameworks */,
-				F6F980B8147386130008F121 /* Headers */,
+				DB13B3061849E0490010F42D /* ShellScript */,
+				DB13B18D1849DF510010F42D /* Sources */,
+				DB13B18F1849DF510010F42D /* Headers */,
 			);
 			buildRules = (
 			);
 			dependencies = (
 			);
-			name = "libffi iOS";
+			name = "libffi-Mac";
 			productName = ffi;
-			productReference = F6F980BA147386130008F121 /* libffi.a */;
-			productType = "com.apple.product-type.library.static";
+			productReference = DB13B1911849DF510010F42D /* ffi.dylib */;
+			productType = "com.apple.product-type.library.dynamic";
 		};
 /* End PBXNativeTarget section */
 
 /* Begin PBXProject section */
-		F6B0839714721EE50031D8A1 /* Project object */ = {
+		DB13B15C1849DEB70010F42D /* Project object */ = {
 			isa = PBXProject;
 			attributes = {
-				LastUpgradeCheck = 0430;
+				LastUpgradeCheck = 0510;
 			};
-			buildConfigurationList = F6B0839A14721EE50031D8A1 /* Build configuration list for PBXProject "libffi" */;
+			buildConfigurationList = DB13B15F1849DEB70010F42D /* Build configuration list for PBXProject "libffi" */;
 			compatibilityVersion = "Xcode 3.2";
 			developmentRegion = English;
 			hasScannedForEncodings = 0;
 			knownRegions = (
 				en,
 			);
-			mainGroup = F6B0839514721EE50031D8A1;
-			productRefGroup = F6B0839514721EE50031D8A1;
+			mainGroup = DB13B15B1849DEB70010F42D;
+			productRefGroup = DB13B1671849DF1E0010F42D /* Products */;
 			projectDirPath = "";
 			projectRoot = "";
 			targets = (
-				F6F980B9147386130008F121 /* libffi iOS */,
-				6C43CB3C1534E9D100162364 /* libffi OS X */,
+				DB13B1651849DF1E0010F42D /* libffi-iOS */,
+				DB13B1901849DF510010F42D /* libffi-Mac */,
 			);
 		};
 /* End PBXProject section */
 
 /* Begin PBXShellScriptBuildPhase section */
-		6C43CC3E1534F8E200162364 /* Generate Trampoline */ = {
+		DB13B3051849E01C0010F42D /* ShellScript */ = {
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
 			);
 			inputPaths = (
 			);
-			name = "Generate Trampoline";
-			outputPaths = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-			shellPath = /usr/bin/python;
-			shellScript = "import subprocess\nimport re\nimport os\nimport errno\nimport sys\n\ndef main():\n    with open('src/arm/trampoline.S', 'w') as tramp_out:\n        p = subprocess.Popen(['bash', 'src/arm/gentramp.sh'], stdout=tramp_out)\n        p.wait()\n\nif __name__ == '__main__':\n    main()";
-		};
-		6C43CC3F1534FF1B00162364 /* Generate Source and Headers */ = {
-			isa = PBXShellScriptBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			inputPaths = (
-			);
-			name = "Generate Source and Headers";
 			outputPaths = (
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "/usr/bin/python generate-ios-source-and-headers.py";
+			shellScript = "/usr/bin/python generate-darwin-source-and-headers.py --only-ios";
 		};
-		6C43CC401534FF3B00162364 /* Generate Source and Headers */ = {
+		DB13B3061849E0490010F42D /* ShellScript */ = {
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
 			);
 			inputPaths = (
 			);
-			name = "Generate Source and Headers";
 			outputPaths = (
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "/usr/bin/python generate-osx-source-and-headers.py";
+			shellScript = "/usr/bin/python generate-darwin-source-and-headers.py --only-osx";
 		};
 /* End PBXShellScriptBuildPhase section */
 
 /* Begin PBXSourcesBuildPhase section */
-		6C43CB391534E9D100162364 /* Sources */ = {
+		DB13B1621849DF1E0010F42D /* Sources */ = {
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				6C43CC1F1534F77800162364 /* darwin.S in Sources */,
-				6C43CC201534F77800162364 /* darwin64.S in Sources */,
-				6C43CC211534F77800162364 /* ffi.c in Sources */,
-				6C43CC221534F77800162364 /* ffi64.c in Sources */,
-				6C43CC301534F7BE00162364 /* closures.c in Sources */,
-				6C43CC361534F7BE00162364 /* java_raw_api.c in Sources */,
-				6C43CC381534F7BE00162364 /* prep_cif.c in Sources */,
-				6C43CC3A1534F7BE00162364 /* raw_api.c in Sources */,
-				6C43CC3C1534F7BE00162364 /* types.c in Sources */,
+				DBFA717E187F1D9B00A76262 /* ffi64_x86_64.c in Sources */,
+				DBFA7179187F1D9B00A76262 /* ffi_armv7.c in Sources */,
+				DBFA717B187F1D9B00A76262 /* trampoline_armv7.S in Sources */,
+				DBFA714E187F1D8600A76262 /* closures.c in Sources */,
+				DBFA717A187F1D9B00A76262 /* sysv_armv7.S in Sources */,
+				DBFA717D187F1D9B00A76262 /* darwin_i386.S in Sources */,
+				DBFA7156187F1D8600A76262 /* prep_cif.c in Sources */,
+				DBFA717F187F1D9B00A76262 /* ffi_i386.c in Sources */,
+				DBFA7158187F1D8600A76262 /* raw_api.c in Sources */,
+				DBFA7178187F1D9B00A76262 /* sysv_arm64.S in Sources */,
+				DBFA717C187F1D9B00A76262 /* darwin64_x86_64.S in Sources */,
+				DBFA715A187F1D8600A76262 /* types.c in Sources */,
+				DBFA7177187F1D9B00A76262 /* ffi_arm64.c in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
-		F6F980B6147386130008F121 /* Sources */ = {
+		DB13B18D1849DF510010F42D /* Sources */ = {
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				6C43CBDC1534F76F00162364 /* ffi.c in Sources */,
-				6C43CBDD1534F76F00162364 /* sysv.S in Sources */,
-				6C43CBDE1534F76F00162364 /* trampoline.S in Sources */,
-				6C43CBE61534F76F00162364 /* darwin.S in Sources */,
-				6C43CBE81534F76F00162364 /* ffi.c in Sources */,
-				6C43CC2F1534F7BE00162364 /* closures.c in Sources */,
-				6C43CC351534F7BE00162364 /* java_raw_api.c in Sources */,
-				6C43CC371534F7BE00162364 /* prep_cif.c in Sources */,
-				6C43CC391534F7BE00162364 /* raw_api.c in Sources */,
-				6C43CC3B1534F7BE00162364 /* types.c in Sources */,
+				DBFA7196187F1DA100A76262 /* ffi64_x86_64.c in Sources */,
+				DBFA7195187F1DA100A76262 /* darwin_i386.S in Sources */,
+				DBFA7157187F1D8600A76262 /* prep_cif.c in Sources */,
+				DBFA7197187F1DA100A76262 /* ffi_i386.c in Sources */,
+				DBFA715B187F1D8600A76262 /* types.c in Sources */,
+				DBFA7159187F1D8600A76262 /* raw_api.c in Sources */,
+				DBFA714F187F1D8600A76262 /* closures.c in Sources */,
+				DBFA7194187F1DA100A76262 /* darwin64_x86_64.S in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 /* End PBXSourcesBuildPhase section */
 
 /* Begin XCBuildConfiguration section */
-		6C43CB4B1534E9D100162364 /* Debug */ = {
+		DB13B1601849DEB70010F42D /* Debug */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
-				ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
-				DSTROOT = /tmp/ffi.dst;
-				FRAMEWORK_SEARCH_PATHS = (
+				HEADER_SEARCH_PATHS = (
 					"$(inherited)",
-					"\"$(SYSTEM_APPS_DIR)/Xcode.app/Contents/Developer/Library/Frameworks\"",
+					"darwin_common/include",
 				);
-				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
-				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
-				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-				GCC_WARN_UNINITIALIZED_AUTOS = YES;
-				MACOSX_DEPLOYMENT_TARGET = 10.6;
 				ONLY_ACTIVE_ARCH = YES;
-				PRODUCT_NAME = ffi;
-				SDKROOT = macosx;
 			};
 			name = Debug;
 		};
-		6C43CB4C1534E9D100162364 /* Release */ = {
+		DB13B1611849DEB70010F42D /* Release */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
-				ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
-				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-				DSTROOT = /tmp/ffi.dst;
-				FRAMEWORK_SEARCH_PATHS = (
+				HEADER_SEARCH_PATHS = (
 					"$(inherited)",
-					"\"$(SYSTEM_APPS_DIR)/Xcode.app/Contents/Developer/Library/Frameworks\"",
+					"darwin_common/include",
 				);
-				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
-				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
-				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-				GCC_WARN_UNINITIALIZED_AUTOS = YES;
-				MACOSX_DEPLOYMENT_TARGET = 10.6;
-				PRODUCT_NAME = ffi;
-				SDKROOT = macosx;
 			};
 			name = Release;
 		};
-		F6B083AB14721EE50031D8A1 /* Debug */ = {
+		DB13B1871849DF1E0010F42D /* Debug */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				ALWAYS_SEARCH_USER_PATHS = NO;
-				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+				ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+				CLANG_CXX_LIBRARY = "libc++";
+				CLANG_ENABLE_MODULES = YES;
+				CLANG_ENABLE_OBJC_ARC = YES;
+				CLANG_WARN_BOOL_CONVERSION = YES;
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
+				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+				CLANG_WARN_EMPTY_BODY = YES;
+				CLANG_WARN_ENUM_CONVERSION = YES;
+				CLANG_WARN_INT_CONVERSION = YES;
+				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COPY_PHASE_STRIP = NO;
+				DSTROOT = /tmp/ffi.dst;
 				GCC_C_LANGUAGE_STANDARD = gnu99;
 				GCC_DYNAMIC_NO_PIC = NO;
 				GCC_OPTIMIZATION_LEVEL = 0;
@@ -482,98 +457,181 @@
 					"$(inherited)",
 				);
 				GCC_SYMBOLS_PRIVATE_EXTERN = NO;
-				GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
-				GCC_WARN_ABOUT_RETURN_TYPE = YES;
-				GCC_WARN_UNUSED_VALUE = NO;
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
+				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+				GCC_WARN_UNUSED_FUNCTION = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
-				HEADER_SEARCH_PATHS = ios/include;
+				HEADER_SEARCH_PATHS = (
+					"$(inherited)",
+					"darwin_ios/include",
+				);
+				IPHONEOS_DEPLOYMENT_TARGET = 5.0;
+				"IPHONEOS_DEPLOYMENT_TARGET[arch=arm64]" = 7.0;
+				OTHER_LDFLAGS = "-ObjC";
+				PRODUCT_NAME = ffi;
 				SDKROOT = iphoneos;
+				SKIP_INSTALL = YES;
 			};
 			name = Debug;
 		};
-		F6B083AC14721EE50031D8A1 /* Release */ = {
+		DB13B1881849DF1E0010F42D /* Release */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				ALWAYS_SEARCH_USER_PATHS = NO;
-				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+				ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+				CLANG_CXX_LIBRARY = "libc++";
+				CLANG_ENABLE_MODULES = YES;
+				CLANG_ENABLE_OBJC_ARC = YES;
+				CLANG_WARN_BOOL_CONVERSION = YES;
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
+				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+				CLANG_WARN_EMPTY_BODY = YES;
+				CLANG_WARN_ENUM_CONVERSION = YES;
+				CLANG_WARN_INT_CONVERSION = YES;
+				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COPY_PHASE_STRIP = YES;
+				DSTROOT = /tmp/ffi.dst;
+				ENABLE_NS_ASSERTIONS = NO;
 				GCC_C_LANGUAGE_STANDARD = gnu99;
-				GCC_PREPROCESSOR_DEFINITIONS = "";
-				GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
-				GCC_WARN_ABOUT_RETURN_TYPE = YES;
-				GCC_WARN_UNUSED_VALUE = NO;
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
+				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+				GCC_WARN_UNUSED_FUNCTION = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
-				HEADER_SEARCH_PATHS = ios/include;
+				HEADER_SEARCH_PATHS = (
+					"$(inherited)",
+					"darwin_ios/include",
+				);
+				IPHONEOS_DEPLOYMENT_TARGET = 5.0;
+				"IPHONEOS_DEPLOYMENT_TARGET[arch=arm64]" = 7.0;
+				OTHER_LDFLAGS = "-ObjC";
+				PRODUCT_NAME = ffi;
 				SDKROOT = iphoneos;
+				SKIP_INSTALL = YES;
 				VALIDATE_PRODUCT = YES;
 			};
 			name = Release;
 		};
-		F6F980C2147386130008F121 /* Debug */ = {
+		DB13B1B11849DF520010F42D /* Debug */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
-				ARCHS = (
-					armv6,
-					armv7,
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+				CLANG_CXX_LIBRARY = "libc++";
+				CLANG_ENABLE_OBJC_ARC = YES;
+				CLANG_WARN_BOOL_CONVERSION = YES;
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
+				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+				CLANG_WARN_EMPTY_BODY = YES;
+				CLANG_WARN_ENUM_CONVERSION = YES;
+				CLANG_WARN_INT_CONVERSION = YES;
+				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+				COPY_PHASE_STRIP = NO;
+				DYLIB_COMPATIBILITY_VERSION = 1;
+				DYLIB_CURRENT_VERSION = 1;
+				GCC_C_LANGUAGE_STANDARD = gnu99;
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				GCC_PREPROCESSOR_DEFINITIONS = (
+					"DEBUG=1",
+					"$(inherited)",
 				);
-				DSTROOT = /tmp/ffi.dst;
-				GCC_PRECOMPILE_PREFIX_HEADER = YES;
-				GCC_THUMB_SUPPORT = NO;
-				IPHONEOS_DEPLOYMENT_TARGET = 4.0;
-				OTHER_LDFLAGS = "-ObjC";
+				GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
+				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+				GCC_WARN_UNUSED_FUNCTION = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
+				HEADER_SEARCH_PATHS = (
+					"$(inherited)",
+					"darwin_osx/include",
+				);
+				MACOSX_DEPLOYMENT_TARGET = 10.6;
+				ONLY_ACTIVE_ARCH = YES;
+				OTHER_LDFLAGS = "-Wl,-no_compact_unwind";
 				PRODUCT_NAME = ffi;
-				SKIP_INSTALL = YES;
+				SDKROOT = macosx;
 			};
 			name = Debug;
 		};
-		F6F980C3147386130008F121 /* Release */ = {
+		DB13B1B21849DF520010F42D /* Release */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
-				ARCHS = (
-					armv6,
-					armv7,
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+				CLANG_CXX_LIBRARY = "libc++";
+				CLANG_ENABLE_OBJC_ARC = YES;
+				CLANG_WARN_BOOL_CONVERSION = YES;
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
+				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+				CLANG_WARN_EMPTY_BODY = YES;
+				CLANG_WARN_ENUM_CONVERSION = YES;
+				CLANG_WARN_INT_CONVERSION = YES;
+				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+				COPY_PHASE_STRIP = YES;
+				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+				DYLIB_COMPATIBILITY_VERSION = 1;
+				DYLIB_CURRENT_VERSION = 1;
+				ENABLE_NS_ASSERTIONS = NO;
+				GCC_C_LANGUAGE_STANDARD = gnu99;
+				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
+				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+				GCC_WARN_UNUSED_FUNCTION = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
+				HEADER_SEARCH_PATHS = (
+					"$(inherited)",
+					"darwin_osx/include",
 				);
-				DSTROOT = /tmp/ffi.dst;
-				GCC_PRECOMPILE_PREFIX_HEADER = YES;
-				GCC_THUMB_SUPPORT = NO;
-				IPHONEOS_DEPLOYMENT_TARGET = 4.0;
-				OTHER_LDFLAGS = "-ObjC";
+				MACOSX_DEPLOYMENT_TARGET = 10.6;
+				OTHER_LDFLAGS = "-Wl,-no_compact_unwind";
 				PRODUCT_NAME = ffi;
-				SKIP_INSTALL = YES;
+				SDKROOT = macosx;
 			};
 			name = Release;
 		};
 /* End XCBuildConfiguration section */
 
 /* Begin XCConfigurationList section */
-		6C43CB4A1534E9D100162364 /* Build configuration list for PBXNativeTarget "libffi OS X" */ = {
+		DB13B15F1849DEB70010F42D /* Build configuration list for PBXProject "libffi" */ = {
 			isa = XCConfigurationList;
 			buildConfigurations = (
-				6C43CB4B1534E9D100162364 /* Debug */,
-				6C43CB4C1534E9D100162364 /* Release */,
+				DB13B1601849DEB70010F42D /* Debug */,
+				DB13B1611849DEB70010F42D /* Release */,
 			);
 			defaultConfigurationIsVisible = 0;
 			defaultConfigurationName = Release;
 		};
-		F6B0839A14721EE50031D8A1 /* Build configuration list for PBXProject "libffi" */ = {
+		DB13B18B1849DF1E0010F42D /* Build configuration list for PBXNativeTarget "libffi-iOS" */ = {
 			isa = XCConfigurationList;
 			buildConfigurations = (
-				F6B083AB14721EE50031D8A1 /* Debug */,
-				F6B083AC14721EE50031D8A1 /* Release */,
+				DB13B1871849DF1E0010F42D /* Debug */,
+				DB13B1881849DF1E0010F42D /* Release */,
 			);
 			defaultConfigurationIsVisible = 0;
 			defaultConfigurationName = Release;
 		};
-		F6F980C4147386130008F121 /* Build configuration list for PBXNativeTarget "libffi iOS" */ = {
+		DB13B1B01849DF520010F42D /* Build configuration list for PBXNativeTarget "libffi-Mac" */ = {
 			isa = XCConfigurationList;
 			buildConfigurations = (
-				F6F980C2147386130008F121 /* Debug */,
-				F6F980C3147386130008F121 /* Release */,
+				DB13B1B11849DF520010F42D /* Debug */,
+				DB13B1B21849DF520010F42D /* Release */,
 			);
 			defaultConfigurationIsVisible = 0;
 			defaultConfigurationName = Release;
 		};
 /* End XCConfigurationList section */
 	};
-	rootObject = F6B0839714721EE50031D8A1 /* Project object */;
+	rootObject = DB13B15C1849DEB70010F42D /* Project object */;
 }
diff --git a/Modules/_ctypes/libffi/libtool-version b/Modules/_ctypes/libffi/libtool-version
index e784fc4..d4f501c 100644
--- a/Modules/_ctypes/libffi/libtool-version
+++ b/Modules/_ctypes/libffi/libtool-version
@@ -26,4 +26,4 @@
 #    release, then set age to 0.
 #
 # CURRENT:REVISION:AGE
-6:1:0
+6:2:0
diff --git a/Modules/_ctypes/libffi/ltmain.sh b/Modules/_ctypes/libffi/ltmain.sh
old mode 100755
new mode 100644
index 63ae69d..a50a21a
--- a/Modules/_ctypes/libffi/ltmain.sh
+++ b/Modules/_ctypes/libffi/ltmain.sh
@@ -1,9 +1,10 @@
+#! /bin/sh
 
-# libtool (GNU libtool) 2.4.2
+# libtool (GNU libtool) 2.4.2.418
+# Provide generalized library-building support services.
 # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
 
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
-# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+# Copyright (C) 1996-2013 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.
 
@@ -23,166 +24,562 @@
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with GNU Libtool; see the file COPYING.  If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html,
-# or obtained by writing 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/>.
 
-# Usage: $progname [OPTION]... [MODE-ARG]...
-#
-# Provide generalized library-building support services.
-#
-#       --config             show all configuration variables
-#       --debug              enable verbose shell tracing
-#   -n, --dry-run            display commands without modifying any files
-#       --features           display basic configuration information and exit
-#       --mode=MODE          use operation mode MODE
-#       --preserve-dup-deps  don't remove duplicate dependency libraries
-#       --quiet, --silent    don't print informational messages
-#       --no-quiet, --no-silent
-#                            print informational messages (default)
-#       --no-warn            don't display warning messages
-#       --tag=TAG            use configuration variables from tag TAG
-#   -v, --verbose            print more informational messages than default
-#       --no-verbose         don't print the extra informational messages
-#       --version            print version information
-#   -h, --help, --help-all   print short, long, or detailed help message
-#
-# MODE must be one of the following:
-#
-#         clean              remove files from the build directory
-#         compile            compile a source file into a libtool object
-#         execute            automatically set library path, then run a program
-#         finish             complete the installation of libtool libraries
-#         install            install libraries or executables
-#         link               create a library or an executable
-#         uninstall          remove libraries from an installed directory
-#
-# MODE-ARGS vary depending on the MODE.  When passed as first option,
-# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
-# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
-#
-# When reporting a bug, please describe a test case to reproduce it and
-# include the following information:
-#
-#         host-triplet:	$host
-#         shell:		$SHELL
-#         compiler:		$LTCC
-#         compiler flags:		$LTCFLAGS
-#         linker:		$LD (gnu? $with_gnu_ld)
-#         $progname:	(GNU libtool) 2.4.2
-#         automake:	$automake_version
-#         autoconf:	$autoconf_version
-#
-# Report bugs to <bug-libtool@gnu.org>.
-# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
-# General help using GNU software: <http://www.gnu.org/gethelp/>.
 
 PROGRAM=libtool
 PACKAGE=libtool
-VERSION=2.4.2
-TIMESTAMP=""
-package_revision=1.3337
+VERSION=2.4.2.418
+package_revision=2.4.2.418
 
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+
+## ------ ##
+## Usage. ##
+## ------ ##
+
+# Run './libtool --help' for help with using this script from the
+# command line.
+
+
+## ------------------------------- ##
+## User overridable command paths. ##
+## ------------------------------- ##
+
+# After configure completes, it has a better idea of some of the
+# shell tools we need than the defaults used by the functions shared
+# with bootstrap, so set those here where they can still be over-
+# ridden by the user, but otherwise take precedence.
+
+: ${AUTOCONF="autoconf"}
+: ${AUTOMAKE="automake"}
+
+
+## -------------------------- ##
+## Source external libraries. ##
+## -------------------------- ##
+
+# Much of our low-level functionality needs to be sourced from external
+# libraries, which are installed to $pkgauxdir.
+
+# Set a version string for this script.
+scriptversion=2013-08-23.20; # UTC
+
+# General shell script boiler plate, and helper functions.
+# Written by Gary V. Vaughan, 2004
+
+# Copyright (C) 2004-2013 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.
+
+# This program 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 3 of the License, or
+# (at your option) any later version.
+
+# As a special exception to the GNU General Public License, if you distribute
+# this file as part of a program or library that is built using GNU Libtool,
+# you may include this file under the same distribution terms that you use
+# for the rest of that program.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the 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, see <http://www.gnu.org/licenses/>.
+
+# Please report bugs or propose patches to gary@gnu.org.
+
+
+## ------ ##
+## Usage. ##
+## ------ ##
+
+# Evaluate this file near the top of your script to gain access to
+# the functions and variables defined here:
+#
+#   . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh
+#
+# If you need to override any of the default environment variable
+# settings, do that before evaluating this file.
+
+
+## -------------------- ##
+## Shell normalisation. ##
+## -------------------- ##
+
+# Some shells need a little help to be as Bourne compatible as possible.
+# Before doing anything else, make sure all that help has been provided!
+
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
   emulate sh
   NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
 else
-  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+  case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac
 fi
-BIN_SH=xpg4; export BIN_SH # for Tru64
-DUALCASE=1; export DUALCASE # for MKS sh
 
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
-  eval 'cat <<_LTECHO_EOF
-$1
-_LTECHO_EOF'
-}
-
-# NLS nuisances: We save the old values to restore during execute mode.
-lt_user_locale=
-lt_safe_locale=
-for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+# NLS nuisances: We save the old values in case they are required later.
+_G_user_locale=
+_G_safe_locale=
+for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
 do
-  eval "if test \"\${$lt_var+set}\" = set; then
-          save_$lt_var=\$$lt_var
-          $lt_var=C
-	  export $lt_var
-	  lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
-	  lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
+  eval "if test set = \"\${$_G_var+set}\"; then
+          save_$_G_var=\$$_G_var
+          $_G_var=C
+	  export $_G_var
+	  _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\"
+	  _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"
 	fi"
 done
-LC_ALL=C
-LANGUAGE=C
-export LANGUAGE LC_ALL
 
-$lt_unset CDPATH
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
+# Make sure IFS has a sensible default
+sp=' '
+nl='
+'
+IFS="$sp	$nl"
+
+# There are still modern systems that have problems with 'echo' mis-
+# handling backslashes, among others, so make sure $bs_echo is set to a
+# command that correctly interprets backslashes.
+# (this code from Autoconf 2.68)
+
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+bs_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+bs_echo=$bs_echo$bs_echo$bs_echo$bs_echo$bs_echo
+bs_echo=$bs_echo$bs_echo$bs_echo$bs_echo$bs_echo$bs_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $bs_echo`" = "X$bs_echo") 2>/dev/null; then
+  bs_echo='print -r --'
+  bs_echo_n='print -rn --'
+elif (test "X`printf %s $bs_echo`" = "X$bs_echo") 2>/dev/null; then
+  bs_echo='printf %s\n'
+  bs_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $bs_echo) 2>/dev/null`" = "X-n $bs_echo"; then
+    bs_echo_body='eval /usr/ucb/echo -n "$1$nl"'
+    bs_echo_n='/usr/ucb/echo -n'
+  else
+    bs_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    bs_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$nl"*)
+	expr "X$arg" : "X\\(.*\\)$nl";
+	arg=`expr "X$arg" : ".*$nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$nl"
+    '
+    export bs_echo_n_body
+    bs_echo_n='sh -c $bs_echo_n_body bs_echo'
+  fi
+  export bs_echo_body
+  bs_echo='sh -c $bs_echo_body bs_echo'
+fi
+
+
+## ------------------------------- ##
+## User overridable command paths. ##
+## ------------------------------- ##
+
+# All uppercase variable names are used for environment variables.  These
+# variables can be overridden by the user before calling a script that
+# uses them if a suitable command of that name is not already available
+# in the command search PATH.
+
+: ${CP="cp -f"}
+: ${ECHO="$bs_echo"}
+: ${EGREP="grep -E"}
+: ${FGREP="grep -F"}
+: ${GREP="grep"}
+: ${LN_S="ln -s"}
+: ${MAKE="make"}
+: ${MKDIR="mkdir"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+: ${SED="sed"}
+: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
+
+
+## -------------------- ##
+## Useful sed snippets. ##
+## -------------------- ##
+
+sed_dirname='s|/[^/]*$||'
+sed_basename='s|^.*/||'
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
+
+# Same as above, but do not quote variable references.
+sed_double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution that turns a string into a regex matching for the
+# string literally.
+sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g'
+
+# Sed substitution that converts a w32 file name or path
+# that contains forward slashes, into one that contains
+# (escaped) backslashes.  A very naive implementation.
+sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+
+# Re-'\' parameter expansions in output of sed_double_quote_subst that
+# were '\'-ed in input to the same.  If an odd number of '\' preceded a
+# '$' in input to sed_double_quote_subst, that '$' was protected from
+# expansion.  Since each input '\' is now two '\'s, look for any number
+# of runs of four '\'s followed by two '\'s and then a '$'.  '\' that '$'.
+_G_bs='\\'
+_G_bs2='\\\\'
+_G_bs4='\\\\\\\\'
+_G_dollar='\$'
+sed_double_backslash="\
+  s/$_G_bs4/&\\
+/g
+  s/^$_G_bs2$_G_dollar/$_G_bs&/
+  s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g
+  s/\n//g"
+
+
+## ----------------- ##
+## Global variables. ##
+## ----------------- ##
+
+# Except for the global variables explicitly listed below, the following
+# functions in the '^func_' namespace, and the '^require_' namespace
+# variables initialised in the 'Resource management' section, sourcing
+# this file will not pollute your global namespace with anything
+# else. There's no portable way to scope variables in Bourne shell
+# though, so actually running these functions will sometimes place
+# results into a variable named after the function, and often use
+# temporary variables in the '^_G_' namespace. If you are careful to
+# avoid using those namespaces casually in your sourcing script, things
+# should continue to work as you expect. And, of course, you can freely
+# overwrite any of the functions or variables defined here before
+# calling anything to customize them.
+
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
+EXIT_SKIP=77	  # $? = 77 is used to indicate a skipped test to automake.
+
+# Allow overriding, eg assuming that you follow the convention of
+# putting '$debug_cmd' at the start of all your functions, you can get
+# bash to show function call trace with:
+#
+#    debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
+debug_cmd=${debug_cmd-":"}
+exit_cmd=:
+
+# By convention, finish your script with:
+#
+#    exit $exit_status
+#
+# so that you can set exit_status to non-zero if you want to indicate
+# something went wrong during execution without actually bailing out at
+# the point of failure.
+exit_status=$EXIT_SUCCESS
 
 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
 # is ksh but when the shell is invoked as "sh" and the current value of
 # the _XPG environment variable is not equal to 1 (one), the special
 # positional parameter $0, within a function call, is the name of the
 # function.
-progpath="$0"
+progpath=$0
+
+# The name of this program.
+progname=`$bs_echo "$progpath" |$SED "$sed_basename"`
+
+# Make sure we have an absolute progpath for reexecution:
+case $progpath in
+  [\\/]*|[A-Za-z]:\\*) ;;
+  *[\\/]*)
+     progdir=`$bs_echo "$progpath" |$SED "$sed_dirname"`
+     progdir=`cd "$progdir" && pwd`
+     progpath=$progdir/$progname
+     ;;
+  *)
+     _G_IFS=$IFS
+     IFS=${PATH_SEPARATOR-:}
+     for progdir in $PATH; do
+       IFS=$_G_IFS
+       test -x "$progdir/$progname" && break
+     done
+     IFS=$_G_IFS
+     test -n "$progdir" || progdir=`pwd`
+     progpath=$progdir/$progname
+     ;;
+esac
 
 
+## ----------------- ##
+## Standard options. ##
+## ----------------- ##
 
-: ${CP="cp -f"}
-test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
-: ${MAKE="make"}
-: ${MKDIR="mkdir"}
-: ${MV="mv -f"}
-: ${RM="rm -f"}
-: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
-: ${Xsed="$SED -e 1s/^X//"}
+# The following options affect the operation of the functions defined
+# below, and should be set appropriately depending on run-time para-
+# meters passed on the command line.
 
-# Global variables:
-EXIT_SUCCESS=0
-EXIT_FAILURE=1
-EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
-EXIT_SKIP=77	  # $? = 77 is used to indicate a skipped test to automake.
+opt_dry_run=false
+opt_quiet=false
+opt_verbose=false
 
-exit_status=$EXIT_SUCCESS
+# Categories 'all' and 'none' are always available.  Append any others
+# you will pass as the first argument to func_warning from your own
+# code.
+warning_categories=
 
-# Make sure IFS has a sensible default
-lt_nl='
-'
-IFS=" 	$lt_nl"
+# By default, display warnings according to 'opt_warning_types'.  Set
+# 'warning_func'  to ':' to elide all warnings, or func_fatal_error to
+# treat the next displayed warning as a fatal error.
+warning_func=func_warn_and_continue
 
-dirname="s,/[^/]*$,,"
-basename="s,^.*/,,"
+# Set to 'all' to display all warnings, 'none' to suppress all
+# warnings, or a space delimited list of some subset of
+# 'warning_categories' to display only the listed warnings.
+opt_warning_types=all
 
-# func_dirname file append nondir_replacement
+
+## -------------------- ##
+## Resource management. ##
+## -------------------- ##
+
+# This section contains definitions for functions that each ensure a
+# particular resource (a file, or a non-empty configuration variable for
+# example) is available, and if appropriate to extract default values
+# from pertinent package files. Call them using their associated
+# 'require_*' variable to ensure that they are executed, at most, once.
+#
+# It's entirely deliberate that calling these functions can set
+# variables that don't obey the namespace limitations obeyed by the rest
+# of this file, in order that that they be as useful as possible to
+# callers.
+
+
+# require_term_colors
+# -------------------
+# Allow display of bold text on terminals that support it.
+require_term_colors=func_require_term_colors
+func_require_term_colors ()
+{
+    $debug_cmd
+
+    test -t 1 && {
+      # COLORTERM and USE_ANSI_COLORS environment variables take
+      # precedence, because most terminfo databases neglect to describe
+      # whether color sequences are supported.
+      test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"}
+
+      if test 1 = "$USE_ANSI_COLORS"; then
+        # Standard ANSI escape sequences
+        tc_reset=''
+        tc_bold='';   tc_standout=''
+        tc_red='';   tc_green=''
+        tc_blue='';  tc_cyan=''
+      else
+        # Otherwise trust the terminfo database after all.
+        test -n "`tput sgr0 2>/dev/null`" && {
+          tc_reset=`tput sgr0`
+          test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold`
+          tc_standout=$tc_bold
+          test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso`
+          test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1`
+          test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2`
+          test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4`
+          test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5`
+        }
+      fi
+    }
+
+    require_term_colors=:
+}
+
+
+## ----------------- ##
+## Function library. ##
+## ----------------- ##
+
+# This section contains a variety of useful functions to call in your
+# scripts. Take note of the portable wrappers for features provided by
+# some modern shells, which will fall back to slower equivalents on
+# less featureful shells.
+
+
+# func_append VAR VALUE
+# ---------------------
+# Append VALUE onto the existing contents of VAR.
+
+  # We should try to minimise forks, especially on Windows where they are
+  # unreasonably slow, so skip the feature probes when bash or zsh are
+  # being used:
+  if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then
+    : ${_G_HAVE_ARITH_OP="yes"}
+    : ${_G_HAVE_XSI_OPS="yes"}
+    # The += operator was introduced in bash 3.1
+    case $BASH_VERSION in
+      [12].* | 3.0 | 3.0*) ;;
+      *)
+        : ${_G_HAVE_PLUSEQ_OP="yes"}
+        ;;
+    esac
+  fi
+
+  # _G_HAVE_PLUSEQ_OP
+  # Can be empty, in which case the shell is probed, "yes" if += is
+  # useable or anything else if it does not work.
+  test -z "$_G_HAVE_PLUSEQ_OP" \
+    && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
+    && _G_HAVE_PLUSEQ_OP=yes
+
+if test yes = "$_G_HAVE_PLUSEQ_OP"
+then
+  # This is an XSI compatible shell, allowing a faster implementation...
+  eval 'func_append ()
+  {
+    $debug_cmd
+
+    eval "$1+=\$2"
+  }'
+else
+  # ...otherwise fall back to using expr, which is often a shell builtin.
+  func_append ()
+  {
+    $debug_cmd
+
+    eval "$1=\$$1\$2"
+  }
+fi
+
+
+# func_append_quoted VAR VALUE
+# ----------------------------
+# Quote VALUE and append to the end of shell variable VAR, separated
+# by a space.
+if test yes = "$_G_HAVE_PLUSEQ_OP"; then
+  eval 'func_append_quoted ()
+  {
+    $debug_cmd
+
+    func_quote_for_eval "$2"
+    eval "$1+=\\ \$func_quote_for_eval_result"
+  }'
+else
+  func_append_quoted ()
+  {
+    $debug_cmd
+
+    func_quote_for_eval "$2"
+    eval "$1=\$$1\\ \$func_quote_for_eval_result"
+  }
+fi
+
+
+# func_append_uniq VAR VALUE
+# --------------------------
+# Append unique VALUE onto the existing contents of VAR, assuming
+# entries are delimited by the first character of VALUE.  For example:
+#
+#   func_append_uniq options " --another-option option-argument"
+#
+# will only append to $options if " --another-option option-argument "
+# is not already present somewhere in $options already (note spaces at
+# each end implied by leading space in second argument).
+func_append_uniq ()
+{
+    $debug_cmd
+
+    eval _G_current_value='`$bs_echo $'$1'`'
+    _G_delim=`expr "$2" : '\(.\)'`
+
+    case $_G_delim$_G_current_value$_G_delim in
+      *"$2$_G_delim"*) ;;
+      *) func_append "$@" ;;
+    esac
+}
+
+
+# func_arith TERM...
+# ------------------
+# Set func_arith_result to the result of evaluating TERMs.
+  test -z "$_G_HAVE_ARITH_OP" \
+    && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \
+    && _G_HAVE_ARITH_OP=yes
+
+if test yes = "$_G_HAVE_ARITH_OP"; then
+  eval 'func_arith ()
+  {
+    $debug_cmd
+
+    func_arith_result=$(( $* ))
+  }'
+else
+  func_arith ()
+  {
+    $debug_cmd
+
+    func_arith_result=`expr "$@"`
+  }
+fi
+
+
+# func_basename FILE
+# ------------------
+# Set func_basename_result to FILE with everything up to and including
+# the last / stripped.
+if test yes = "$_G_HAVE_XSI_OPS"; then
+  # If this shell supports suffix pattern removal, then use it to avoid
+  # forking. Hide the definitions single quotes in case the shell chokes
+  # on unsupported syntax...
+  _b='func_basename_result=${1##*/}'
+  _d='case $1 in
+        */*) func_dirname_result=${1%/*}$2 ;;
+        *  ) func_dirname_result=$3        ;;
+      esac'
+
+else
+  # ...otherwise fall back to using sed.
+  _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`'
+  _d='func_dirname_result=`$ECHO "$1"  |$SED "$sed_dirname"`
+      if test "X$func_dirname_result" = "X$1"; then
+        func_dirname_result=$3
+      else
+        func_append func_dirname_result "$2"
+      fi'
+fi
+
+eval 'func_basename ()
+{
+    $debug_cmd
+
+    '"$_b"'
+}'
+
+
+# func_dirname FILE APPEND NONDIR_REPLACEMENT
+# -------------------------------------------
 # Compute the dirname of FILE.  If nonempty, add APPEND to the result,
 # otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
+eval 'func_dirname ()
 {
-    func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
-    if test "X$func_dirname_result" = "X${1}"; then
-      func_dirname_result="${3}"
-    else
-      func_dirname_result="$func_dirname_result${2}"
-    fi
-} # func_dirname may be replaced by extended shell implementation
+    $debug_cmd
+
+    '"$_d"'
+}'
 
 
-# func_basename file
-func_basename ()
-{
-    func_basename_result=`$ECHO "${1}" | $SED "$basename"`
-} # func_basename may be replaced by extended shell implementation
-
-
-# func_dirname_and_basename file append nondir_replacement
-# perform func_basename and func_dirname in a single function
+# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT
+# --------------------------------------------------------
+# Perform func_basename and func_dirname in a single function
 # call:
 #   dirname:  Compute the dirname of FILE.  If nonempty,
 #             add APPEND to the result, otherwise set result
@@ -190,263 +587,327 @@
 #             value returned in "$func_dirname_result"
 #   basename: Compute filename of FILE.
 #             value retuned in "$func_basename_result"
-# Implementation must be kept synchronized with func_dirname
-# and func_basename. For efficiency, we do not delegate to
-# those functions but instead duplicate the functionality here.
-func_dirname_and_basename ()
+# For efficiency, we do not delegate to the functions above but instead
+# duplicate the functionality here.
+eval 'func_dirname_and_basename ()
 {
-    # Extract subdirectory from the argument.
-    func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
-    if test "X$func_dirname_result" = "X${1}"; then
-      func_dirname_result="${3}"
-    else
-      func_dirname_result="$func_dirname_result${2}"
+    $debug_cmd
+
+    '"$_b"'
+    '"$_d"'
+}'
+
+
+# func_echo ARG...
+# ----------------
+# Echo program name prefixed message.
+func_echo ()
+{
+    $debug_cmd
+
+    _G_message=$*
+
+    func_echo_IFS=$IFS
+    IFS=$nl
+    for _G_line in $_G_message; do
+      IFS=$func_echo_IFS
+      $bs_echo "$progname: $_G_line"
+    done
+    IFS=$func_echo_IFS
+}
+
+
+# func_echo_all ARG...
+# --------------------
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+    $ECHO "$*"
+}
+
+
+# func_echo_infix_1 INFIX ARG...
+# ------------------------------
+# Echo program name, followed by INFIX on the first line, with any
+# additional lines not showing INFIX.
+func_echo_infix_1 ()
+{
+    $debug_cmd
+
+    $require_term_colors
+
+    _G_infix=$1; shift
+    _G_indent=$_G_infix
+    _G_prefix="$progname: $_G_infix: "
+    _G_message=$*
+
+    # Strip color escape sequences before counting printable length
+    for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan"
+    do
+      test -n "$_G_tc" && {
+        _G_esc_tc=`$bs_echo "$_G_tc" | sed "$sed_make_literal_regex"`
+        _G_indent=`$bs_echo "$_G_indent" | sed "s|$_G_esc_tc||g"`
+      }
+    done
+    _G_indent="$progname: "`echo "$_G_indent" | sed 's|.| |g'`"  " ## exclude from sc_prohibit_nested_quotes
+
+    func_echo_infix_1_IFS=$IFS
+    IFS=$nl
+    for _G_line in $_G_message; do
+      IFS=$func_echo_infix_1_IFS
+      $bs_echo "$_G_prefix$tc_bold$_G_line$tc_reset" >&2
+      _G_prefix=$_G_indent
+    done
+    IFS=$func_echo_infix_1_IFS
+}
+
+
+# func_error ARG...
+# -----------------
+# Echo program name prefixed message to standard error.
+func_error ()
+{
+    $debug_cmd
+
+    $require_term_colors
+
+    func_echo_infix_1 "  $tc_standout${tc_red}error$tc_reset" "$*" >&2
+}
+
+
+# func_fatal_error ARG...
+# -----------------------
+# Echo program name prefixed message to standard error, and exit.
+func_fatal_error ()
+{
+    $debug_cmd
+
+    func_error "$*"
+    exit $EXIT_FAILURE
+}
+
+
+# func_grep EXPRESSION FILENAME
+# -----------------------------
+# Check whether EXPRESSION matches any line of FILENAME, without output.
+func_grep ()
+{
+    $debug_cmd
+
+    $GREP "$1" "$2" >/dev/null 2>&1
+}
+
+
+# func_len STRING
+# ---------------
+# Set func_len_result to the length of STRING. STRING may not
+# start with a hyphen.
+  test -z "$_G_HAVE_XSI_OPS" \
+    && (eval 'x=a/b/c;
+      test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
+    && _G_HAVE_XSI_OPS=yes
+
+if test yes = "$_G_HAVE_XSI_OPS"; then
+  eval 'func_len ()
+  {
+    $debug_cmd
+
+    func_len_result=${#1}
+  }'
+else
+  func_len ()
+  {
+    $debug_cmd
+
+    func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+  }
+fi
+
+
+# func_mkdir_p DIRECTORY-PATH
+# ---------------------------
+# Make sure the entire path to DIRECTORY-PATH is available.
+func_mkdir_p ()
+{
+    $debug_cmd
+
+    _G_directory_path=$1
+    _G_dir_list=
+
+    if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then
+
+      # Protect directory names starting with '-'
+      case $_G_directory_path in
+        -*) _G_directory_path=./$_G_directory_path ;;
+      esac
+
+      # While some portion of DIR does not yet exist...
+      while test ! -d "$_G_directory_path"; do
+        # ...make a list in topmost first order.  Use a colon delimited
+	# list incase some portion of path contains whitespace.
+        _G_dir_list=$_G_directory_path:$_G_dir_list
+
+        # If the last portion added has no slash in it, the list is done
+        case $_G_directory_path in */*) ;; *) break ;; esac
+
+        # ...otherwise throw away the child directory and loop
+        _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"`
+      done
+      _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'`
+
+      func_mkdir_p_IFS=$IFS; IFS=:
+      for _G_dir in $_G_dir_list; do
+	IFS=$func_mkdir_p_IFS
+        # mkdir can fail with a 'File exist' error if two processes
+        # try to create one of the directories concurrently.  Don't
+        # stop in that case!
+        $MKDIR "$_G_dir" 2>/dev/null || :
+      done
+      IFS=$func_mkdir_p_IFS
+
+      # Bail out if we (or some other process) failed to create a directory.
+      test -d "$_G_directory_path" || \
+        func_fatal_error "Failed to create '$1'"
     fi
-    func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
-} # func_dirname_and_basename may be replaced by extended shell implementation
+}
 
 
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-# func_strip_suffix prefix name
-func_stripname ()
+# func_mktempdir [BASENAME]
+# -------------------------
+# Make a temporary directory that won't clash with other running
+# libtool processes, and avoids race conditions if possible.  If
+# given, BASENAME is the basename for that directory.
+func_mktempdir ()
 {
-    case ${2} in
-      .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
-      *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
-    esac
-} # func_stripname may be replaced by extended shell implementation
+    $debug_cmd
 
+    _G_template=${TMPDIR-/tmp}/${1-$progname}
 
-# These SED scripts presuppose an absolute path with a trailing slash.
-pathcar='s,^/\([^/]*\).*$,\1,'
-pathcdr='s,^/[^/]*,,'
-removedotparts=':dotsl
-		s@/\./@/@g
-		t dotsl
-		s,/\.$,/,'
-collapseslashes='s@/\{1,\}@/@g'
-finalslash='s,/*$,/,'
+    if test : = "$opt_dry_run"; then
+      # Return a directory name, but don't create it in dry-run mode
+      _G_tmpdir=$_G_template-$$
+    else
+
+      # If mktemp works, use that first and foremost
+      _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null`
+
+      if test ! -d "$_G_tmpdir"; then
+        # Failing that, at least try and use $RANDOM to avoid a race
+        _G_tmpdir=$_G_template-${RANDOM-0}$$
+
+        func_mktempdir_umask=`umask`
+        umask 0077
+        $MKDIR "$_G_tmpdir"
+        umask $func_mktempdir_umask
+      fi
+
+      # If we're not in dry-run mode, bomb out on failure
+      test -d "$_G_tmpdir" || \
+        func_fatal_error "cannot create temporary directory '$_G_tmpdir'"
+    fi
+
+    $ECHO "$_G_tmpdir"
+}
+
 
 # func_normal_abspath PATH
+# ------------------------
 # Remove doubled-up and trailing slashes, "." path components,
 # and cancel out any ".." path components in PATH after making
 # it an absolute path.
-#             value returned in "$func_normal_abspath_result"
 func_normal_abspath ()
 {
-  # Start from root dir and reassemble the path.
-  func_normal_abspath_result=
-  func_normal_abspath_tpath=$1
-  func_normal_abspath_altnamespace=
-  case $func_normal_abspath_tpath in
-    "")
-      # Empty path, that just means $cwd.
-      func_stripname '' '/' "`pwd`"
-      func_normal_abspath_result=$func_stripname_result
-      return
-    ;;
-    # The next three entries are used to spot a run of precisely
-    # two leading slashes without using negated character classes;
-    # we take advantage of case's first-match behaviour.
-    ///*)
-      # Unusual form of absolute path, do nothing.
-    ;;
-    //*)
-      # Not necessarily an ordinary path; POSIX reserves leading '//'
-      # and for example Cygwin uses it to access remote file shares
-      # over CIFS/SMB, so we conserve a leading double slash if found.
-      func_normal_abspath_altnamespace=/
-    ;;
-    /*)
-      # Absolute path, do nothing.
-    ;;
-    *)
-      # Relative path, prepend $cwd.
-      func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
-    ;;
-  esac
-  # Cancel out all the simple stuff to save iterations.  We also want
-  # the path to end with a slash for ease of parsing, so make sure
-  # there is one (and only one) here.
-  func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
-        -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
-  while :; do
-    # Processed it all yet?
-    if test "$func_normal_abspath_tpath" = / ; then
-      # If we ascended to the root using ".." the result may be empty now.
-      if test -z "$func_normal_abspath_result" ; then
-        func_normal_abspath_result=/
-      fi
-      break
-    fi
-    func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
-        -e "$pathcar"`
-    func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
-        -e "$pathcdr"`
-    # Figure out what to do with it
-    case $func_normal_abspath_tcomponent in
+    $debug_cmd
+
+    # These SED scripts presuppose an absolute path with a trailing slash.
+    _G_pathcar='s|^/\([^/]*\).*$|\1|'
+    _G_pathcdr='s|^/[^/]*||'
+    _G_removedotparts=':dotsl
+		s|/\./|/|g
+		t dotsl
+		s|/\.$|/|'
+    _G_collapseslashes='s|/\{1,\}|/|g'
+    _G_finalslash='s|/*$|/|'
+
+    # Start from root dir and reassemble the path.
+    func_normal_abspath_result=
+    func_normal_abspath_tpath=$1
+    func_normal_abspath_altnamespace=
+    case $func_normal_abspath_tpath in
       "")
-        # Trailing empty path component, ignore it.
-      ;;
-      ..)
-        # Parent dir; strip last assembled component from result.
-        func_dirname "$func_normal_abspath_result"
-        func_normal_abspath_result=$func_dirname_result
-      ;;
-      *)
-        # Actual path component, append it.
-        func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
-      ;;
-    esac
-  done
-  # Restore leading double-slash if one was found on entry.
-  func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
-}
-
-# func_relative_path SRCDIR DSTDIR
-# generates a relative path from SRCDIR to DSTDIR, with a trailing
-# slash if non-empty, suitable for immediately appending a filename
-# without needing to append a separator.
-#             value returned in "$func_relative_path_result"
-func_relative_path ()
-{
-  func_relative_path_result=
-  func_normal_abspath "$1"
-  func_relative_path_tlibdir=$func_normal_abspath_result
-  func_normal_abspath "$2"
-  func_relative_path_tbindir=$func_normal_abspath_result
-
-  # Ascend the tree starting from libdir
-  while :; do
-    # check if we have found a prefix of bindir
-    case $func_relative_path_tbindir in
-      $func_relative_path_tlibdir)
-        # found an exact match
-        func_relative_path_tcancelled=
-        break
+        # Empty path, that just means $cwd.
+        func_stripname '' '/' "`pwd`"
+        func_normal_abspath_result=$func_stripname_result
+        return
         ;;
-      $func_relative_path_tlibdir*)
-        # found a matching prefix
-        func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
-        func_relative_path_tcancelled=$func_stripname_result
-        if test -z "$func_relative_path_result"; then
-          func_relative_path_result=.
-        fi
-        break
+      # The next three entries are used to spot a run of precisely
+      # two leading slashes without using negated character classes;
+      # we take advantage of case's first-match behaviour.
+      ///*)
+        # Unusual form of absolute path, do nothing.
+        ;;
+      //*)
+        # Not necessarily an ordinary path; POSIX reserves leading '//'
+        # and for example Cygwin uses it to access remote file shares
+        # over CIFS/SMB, so we conserve a leading double slash if found.
+        func_normal_abspath_altnamespace=/
+        ;;
+      /*)
+        # Absolute path, do nothing.
         ;;
       *)
-        func_dirname $func_relative_path_tlibdir
-        func_relative_path_tlibdir=${func_dirname_result}
-        if test "x$func_relative_path_tlibdir" = x ; then
-          # Have to descend all the way to the root!
-          func_relative_path_result=../$func_relative_path_result
-          func_relative_path_tcancelled=$func_relative_path_tbindir
-          break
-        fi
-        func_relative_path_result=../$func_relative_path_result
+        # Relative path, prepend $cwd.
+        func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
         ;;
     esac
-  done
 
-  # Now calculate path; take care to avoid doubling-up slashes.
-  func_stripname '' '/' "$func_relative_path_result"
-  func_relative_path_result=$func_stripname_result
-  func_stripname '/' '/' "$func_relative_path_tcancelled"
-  if test "x$func_stripname_result" != x ; then
-    func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
-  fi
-
-  # Normalisation. If bindir is libdir, return empty string,
-  # else relative path ending with a slash; either way, target
-  # file name can be directly appended.
-  if test ! -z "$func_relative_path_result"; then
-    func_stripname './' '' "$func_relative_path_result/"
-    func_relative_path_result=$func_stripname_result
-  fi
+    # Cancel out all the simple stuff to save iterations.  We also want
+    # the path to end with a slash for ease of parsing, so make sure
+    # there is one (and only one) here.
+    func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+          -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"`
+    while :; do
+      # Processed it all yet?
+      if test / = "$func_normal_abspath_tpath"; then
+        # If we ascended to the root using ".." the result may be empty now.
+        if test -z "$func_normal_abspath_result"; then
+          func_normal_abspath_result=/
+        fi
+        break
+      fi
+      func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
+          -e "$_G_pathcar"`
+      func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+          -e "$_G_pathcdr"`
+      # Figure out what to do with it
+      case $func_normal_abspath_tcomponent in
+        "")
+          # Trailing empty path component, ignore it.
+          ;;
+        ..)
+          # Parent dir; strip last assembled component from result.
+          func_dirname "$func_normal_abspath_result"
+          func_normal_abspath_result=$func_dirname_result
+          ;;
+        *)
+          # Actual path component, append it.
+          func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent"
+          ;;
+      esac
+    done
+    # Restore leading double-slash if one was found on entry.
+    func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
 }
 
-# The name of this program:
-func_dirname_and_basename "$progpath"
-progname=$func_basename_result
 
-# Make sure we have an absolute path for reexecution:
-case $progpath in
-  [\\/]*|[A-Za-z]:\\*) ;;
-  *[\\/]*)
-     progdir=$func_dirname_result
-     progdir=`cd "$progdir" && pwd`
-     progpath="$progdir/$progname"
-     ;;
-  *)
-     save_IFS="$IFS"
-     IFS=${PATH_SEPARATOR-:}
-     for progdir in $PATH; do
-       IFS="$save_IFS"
-       test -x "$progdir/$progname" && break
-     done
-     IFS="$save_IFS"
-     test -n "$progdir" || progdir=`pwd`
-     progpath="$progdir/$progname"
-     ;;
-esac
-
-# Sed substitution that helps us do robust quoting.  It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed="${SED}"' -e 1s/^X//'
-sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\(["`\\]\)/\\\1/g'
-
-# Sed substitution that turns a string into a regex matching for the
-# string literally.
-sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
-
-# Sed substitution that converts a w32 file name or path
-# which contains forward slashes, into one that contains
-# (escaped) backslashes.  A very naive implementation.
-lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
-
-# Re-`\' parameter expansions in output of double_quote_subst that were
-# `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
-# in input to double_quote_subst, that '$' was protected from expansion.
-# Since each input `\' is now two `\'s, look for any number of runs of
-# four `\'s followed by two `\'s and then a '$'.  `\' that '$'.
-bs='\\'
-bs2='\\\\'
-bs4='\\\\\\\\'
-dollar='\$'
-sed_double_backslash="\
-  s/$bs4/&\\
-/g
-  s/^$bs2$dollar/$bs&/
-  s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
-  s/\n//g"
-
-# Standard options:
-opt_dry_run=false
-opt_help=false
-opt_quiet=false
-opt_verbose=false
-opt_warning=:
-
-# func_echo arg...
-# Echo program name prefixed message, along with the current mode
-# name if it has been set yet.
-func_echo ()
+# func_notquiet ARG...
+# --------------------
+# Echo program name prefixed message only when not in quiet mode.
+func_notquiet ()
 {
-    $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
-}
+    $debug_cmd
 
-# func_verbose arg...
-# Echo program name prefixed message in verbose mode only.
-func_verbose ()
-{
-    $opt_verbose && func_echo ${1+"$@"}
+    $opt_quiet || func_echo ${1+"$@"}
 
     # A bug in bash halts the script if the last line of a function
     # fails when set -e is in force, so we need another command to
@@ -454,450 +915,1122 @@
     :
 }
 
-# func_echo_all arg...
-# Invoke $ECHO with all args, space-separated.
-func_echo_all ()
-{
-    $ECHO "$*"
-}
 
-# func_error arg...
-# Echo program name prefixed message to standard error.
-func_error ()
+# func_relative_path SRCDIR DSTDIR
+# --------------------------------
+# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.
+func_relative_path ()
 {
-    $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
-}
+    $debug_cmd
 
-# func_warning arg...
-# Echo program name prefixed warning message to standard error.
-func_warning ()
-{
-    $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
+    func_relative_path_result=
+    func_normal_abspath "$1"
+    func_relative_path_tlibdir=$func_normal_abspath_result
+    func_normal_abspath "$2"
+    func_relative_path_tbindir=$func_normal_abspath_result
 
-    # bash bug again:
+    # Ascend the tree starting from libdir
+    while :; do
+      # check if we have found a prefix of bindir
+      case $func_relative_path_tbindir in
+        $func_relative_path_tlibdir)
+          # found an exact match
+          func_relative_path_tcancelled=
+          break
+          ;;
+        $func_relative_path_tlibdir*)
+          # found a matching prefix
+          func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
+          func_relative_path_tcancelled=$func_stripname_result
+          if test -z "$func_relative_path_result"; then
+            func_relative_path_result=.
+          fi
+          break
+          ;;
+        *)
+          func_dirname $func_relative_path_tlibdir
+          func_relative_path_tlibdir=$func_dirname_result
+          if test -z "$func_relative_path_tlibdir"; then
+            # Have to descend all the way to the root!
+            func_relative_path_result=../$func_relative_path_result
+            func_relative_path_tcancelled=$func_relative_path_tbindir
+            break
+          fi
+          func_relative_path_result=../$func_relative_path_result
+          ;;
+      esac
+    done
+
+    # Now calculate path; take care to avoid doubling-up slashes.
+    func_stripname '' '/' "$func_relative_path_result"
+    func_relative_path_result=$func_stripname_result
+    func_stripname '/' '/' "$func_relative_path_tcancelled"
+    if test -n "$func_stripname_result"; then
+      func_append func_relative_path_result "/$func_stripname_result"
+    fi
+
+    # Normalisation. If bindir is libdir, return '.' else relative path.
+    if test -n "$func_relative_path_result"; then
+      func_stripname './' '' "$func_relative_path_result"
+      func_relative_path_result=$func_stripname_result
+    fi
+
+    test -n "$func_relative_path_result" || func_relative_path_result=.
+
     :
 }
 
-# func_fatal_error arg...
-# Echo program name prefixed message to standard error, and exit.
-func_fatal_error ()
-{
-    func_error ${1+"$@"}
-    exit $EXIT_FAILURE
-}
 
-# func_fatal_help arg...
-# Echo program name prefixed message to standard error, followed by
-# a help hint, and exit.
-func_fatal_help ()
-{
-    func_error ${1+"$@"}
-    func_fatal_error "$help"
-}
-help="Try \`$progname --help' for more information."  ## default
-
-
-# func_grep expression filename
-# Check whether EXPRESSION matches any line of FILENAME, without output.
-func_grep ()
-{
-    $GREP "$1" "$2" >/dev/null 2>&1
-}
-
-
-# func_mkdir_p directory-path
-# Make sure the entire path to DIRECTORY-PATH is available.
-func_mkdir_p ()
-{
-    my_directory_path="$1"
-    my_dir_list=
-
-    if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
-
-      # Protect directory names starting with `-'
-      case $my_directory_path in
-        -*) my_directory_path="./$my_directory_path" ;;
-      esac
-
-      # While some portion of DIR does not yet exist...
-      while test ! -d "$my_directory_path"; do
-        # ...make a list in topmost first order.  Use a colon delimited
-	# list incase some portion of path contains whitespace.
-        my_dir_list="$my_directory_path:$my_dir_list"
-
-        # If the last portion added has no slash in it, the list is done
-        case $my_directory_path in */*) ;; *) break ;; esac
-
-        # ...otherwise throw away the child directory and loop
-        my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
-      done
-      my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
-
-      save_mkdir_p_IFS="$IFS"; IFS=':'
-      for my_dir in $my_dir_list; do
-	IFS="$save_mkdir_p_IFS"
-        # mkdir can fail with a `File exist' error if two processes
-        # try to create one of the directories concurrently.  Don't
-        # stop in that case!
-        $MKDIR "$my_dir" 2>/dev/null || :
-      done
-      IFS="$save_mkdir_p_IFS"
-
-      # Bail out if we (or some other process) failed to create a directory.
-      test -d "$my_directory_path" || \
-        func_fatal_error "Failed to create \`$1'"
-    fi
-}
-
-
-# func_mktempdir [string]
-# Make a temporary directory that won't clash with other running
-# libtool processes, and avoids race conditions if possible.  If
-# given, STRING is the basename for that directory.
-func_mktempdir ()
-{
-    my_template="${TMPDIR-/tmp}/${1-$progname}"
-
-    if test "$opt_dry_run" = ":"; then
-      # Return a directory name, but don't create it in dry-run mode
-      my_tmpdir="${my_template}-$$"
-    else
-
-      # If mktemp works, use that first and foremost
-      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
-
-      if test ! -d "$my_tmpdir"; then
-        # Failing that, at least try and use $RANDOM to avoid a race
-        my_tmpdir="${my_template}-${RANDOM-0}$$"
-
-        save_mktempdir_umask=`umask`
-        umask 0077
-        $MKDIR "$my_tmpdir"
-        umask $save_mktempdir_umask
-      fi
-
-      # If we're not in dry-run mode, bomb out on failure
-      test -d "$my_tmpdir" || \
-        func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
-    fi
-
-    $ECHO "$my_tmpdir"
-}
-
-
-# func_quote_for_eval arg
-# Aesthetically quote ARG to be evaled later.
-# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
-# is double-quoted, suitable for a subsequent eval, whereas
-# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
-# which are still active within double quotes backslashified.
+# func_quote_for_eval ARG...
+# --------------------------
+# Aesthetically quote ARGs to be evaled later.
+# This function returns two values:
+#   i) func_quote_for_eval_result
+#      double-quoted, suitable for a subsequent eval
+#  ii) func_quote_for_eval_unquoted_result
+#      has all characters that are still active within double
+#      quotes backslashified.
 func_quote_for_eval ()
 {
-    case $1 in
-      *[\\\`\"\$]*)
-	func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
-      *)
-        func_quote_for_eval_unquoted_result="$1" ;;
-    esac
+    $debug_cmd
 
-    case $func_quote_for_eval_unquoted_result in
-      # Double-quote args containing shell metacharacters to delay
-      # word splitting, command substitution and and variable
-      # expansion for a subsequent eval.
-      # Many Bourne shells cannot handle close brackets correctly
-      # in scan sets, so we specify it separately.
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-        func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
-        ;;
-      *)
-        func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
-    esac
+    func_quote_for_eval_unquoted_result=
+    func_quote_for_eval_result=
+    while test 0 -lt $#; do
+      case $1 in
+        *[\\\`\"\$]*)
+	  _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
+        *)
+          _G_unquoted_arg=$1 ;;
+      esac
+      if test -n "$func_quote_for_eval_unquoted_result"; then
+	func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
+      else
+        func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
+      fi
+
+      case $_G_unquoted_arg in
+        # Double-quote args containing shell metacharacters to delay
+        # word splitting, command substitution and variable expansion
+        # for a subsequent eval.
+        # Many Bourne shells cannot handle close brackets correctly
+        # in scan sets, so we specify it separately.
+        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+          _G_quoted_arg=\"$_G_unquoted_arg\"
+          ;;
+        *)
+          _G_quoted_arg=$_G_unquoted_arg
+	  ;;
+      esac
+
+      if test -n "$func_quote_for_eval_result"; then
+	func_append func_quote_for_eval_result " $_G_quoted_arg"
+      else
+        func_append func_quote_for_eval_result "$_G_quoted_arg"
+      fi
+      shift
+    done
 }
 
 
-# func_quote_for_expand arg
+# func_quote_for_expand ARG
+# -------------------------
 # Aesthetically quote ARG to be evaled later; same as above,
 # but do not quote variable references.
 func_quote_for_expand ()
 {
+    $debug_cmd
+
     case $1 in
       *[\\\`\"]*)
-	my_arg=`$ECHO "$1" | $SED \
-	    -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
+	_G_arg=`$ECHO "$1" | $SED \
+	    -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
       *)
-        my_arg="$1" ;;
+        _G_arg=$1 ;;
     esac
 
-    case $my_arg in
+    case $_G_arg in
       # Double-quote args containing shell metacharacters to delay
       # word splitting and command substitution for a subsequent eval.
       # Many Bourne shells cannot handle close brackets correctly
       # in scan sets, so we specify it separately.
       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-        my_arg="\"$my_arg\""
+        _G_arg=\"$_G_arg\"
         ;;
     esac
 
-    func_quote_for_expand_result="$my_arg"
+    func_quote_for_expand_result=$_G_arg
 }
 
 
-# func_show_eval cmd [fail_exp]
-# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
+# func_stripname PREFIX SUFFIX NAME
+# ---------------------------------
+# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+if test yes = "$_G_HAVE_XSI_OPS"; then
+  eval 'func_stripname ()
+  {
+    $debug_cmd
+
+    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+    # positional parameters, so assign one to ordinary variable first.
+    func_stripname_result=$3
+    func_stripname_result=${func_stripname_result#"$1"}
+    func_stripname_result=${func_stripname_result%"$2"}
+  }'
+else
+  func_stripname ()
+  {
+    $debug_cmd
+
+    case $2 in
+      .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;;
+      *)  func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;;
+    esac
+  }
+fi
+
+
+# func_show_eval CMD [FAIL_EXP]
+# -----------------------------
+# Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is
 # not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
 # is given, then evaluate it.
 func_show_eval ()
 {
-    my_cmd="$1"
-    my_fail_exp="${2-:}"
+    $debug_cmd
 
-    ${opt_silent-false} || {
-      func_quote_for_expand "$my_cmd"
-      eval "func_echo $func_quote_for_expand_result"
-    }
+    _G_cmd=$1
+    _G_fail_exp=${2-':'}
 
-    if ${opt_dry_run-false}; then :; else
-      eval "$my_cmd"
-      my_status=$?
-      if test "$my_status" -eq 0; then :; else
-	eval "(exit $my_status); $my_fail_exp"
+    func_quote_for_expand "$_G_cmd"
+    eval "func_notquiet $func_quote_for_expand_result"
+
+    $opt_dry_run || {
+      eval "$_G_cmd"
+      _G_status=$?
+      if test 0 -ne "$_G_status"; then
+	eval "(exit $_G_status); $_G_fail_exp"
       fi
-    fi
+    }
 }
 
 
-# func_show_eval_locale cmd [fail_exp]
-# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
+# func_show_eval_locale CMD [FAIL_EXP]
+# ------------------------------------
+# Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is
 # not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
 # is given, then evaluate it.  Use the saved locale for evaluation.
 func_show_eval_locale ()
 {
-    my_cmd="$1"
-    my_fail_exp="${2-:}"
+    $debug_cmd
 
-    ${opt_silent-false} || {
-      func_quote_for_expand "$my_cmd"
+    _G_cmd=$1
+    _G_fail_exp=${2-':'}
+
+    $opt_quiet || {
+      func_quote_for_expand "$_G_cmd"
       eval "func_echo $func_quote_for_expand_result"
     }
 
-    if ${opt_dry_run-false}; then :; else
-      eval "$lt_user_locale
-	    $my_cmd"
-      my_status=$?
-      eval "$lt_safe_locale"
-      if test "$my_status" -eq 0; then :; else
-	eval "(exit $my_status); $my_fail_exp"
+    $opt_dry_run || {
+      eval "$_G_user_locale
+	    $_G_cmd"
+      _G_status=$?
+      eval "$_G_safe_locale"
+      if test 0 -ne "$_G_status"; then
+	eval "(exit $_G_status); $_G_fail_exp"
       fi
-    fi
+    }
 }
 
+
 # func_tr_sh
+# ----------
 # Turn $1 into a string suitable for a shell variable name.
 # Result is stored in $func_tr_sh_result.  All characters
 # not in the set a-zA-Z0-9_ are replaced with '_'. Further,
 # if $1 begins with a digit, a '_' is prepended as well.
 func_tr_sh ()
 {
-  case $1 in
-  [0-9]* | *[!a-zA-Z0-9_]*)
-    func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
-    ;;
-  * )
-    func_tr_sh_result=$1
-    ;;
-  esac
+    $debug_cmd
+
+    case $1 in
+    [0-9]* | *[!a-zA-Z0-9_]*)
+      func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'`
+      ;;
+    * )
+      func_tr_sh_result=$1
+      ;;
+    esac
 }
 
 
-# func_version
-# Echo version message to standard output and exit.
-func_version ()
+# func_verbose ARG...
+# -------------------
+# Echo program name prefixed message in verbose mode only.
+func_verbose ()
 {
-    $opt_debug
+    $debug_cmd
 
-    $SED -n '/(C)/!b go
-	:more
-	/\./!{
-	  N
-	  s/\n# / /
-	  b more
-	}
-	:go
-	/^# '$PROGRAM' (GNU /,/# warranty; / {
-        s/^# //
-	s/^# *$//
-        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
-        p
-     }' < "$progpath"
-     exit $?
+    $opt_verbose && func_echo "$*"
+
+    :
 }
 
-# func_usage
-# Echo short help message to standard output and exit.
-func_usage ()
+
+# func_warn_and_continue ARG...
+# -----------------------------
+# Echo program name prefixed warning message to standard error.
+func_warn_and_continue ()
 {
-    $opt_debug
+    $debug_cmd
 
-    $SED -n '/^# Usage:/,/^#  *.*--help/ {
-        s/^# //
-	s/^# *$//
-	s/\$progname/'$progname'/
-	p
-    }' < "$progpath"
-    echo
-    $ECHO "run \`$progname --help | more' for full usage"
-    exit $?
+    $require_term_colors
+
+    func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2
 }
 
-# func_help [NOEXIT]
-# Echo long help message to standard output and exit,
-# unless 'noexit' is passed as argument.
+
+# func_warning CATEGORY ARG...
+# ----------------------------
+# Echo program name prefixed warning message to standard error. Warning
+# messages can be filtered according to CATEGORY, where this function
+# elides messages where CATEGORY is not listed in the global variable
+# 'opt_warning_types'.
+func_warning ()
+{
+    $debug_cmd
+
+    # CATEGORY must be in the warning_categories list!
+    case " $warning_categories " in
+      *" $1 "*) ;;
+      *) func_internal_error "invalid warning category '$1'" ;;
+    esac
+
+    _G_category=$1
+    shift
+
+    case " $opt_warning_types " in
+      *" $_G_category "*) $warning_func ${1+"$@"} ;;
+    esac
+}
+
+
+# func_sort_ver VER1 VER2
+# -----------------------
+# 'sort -V' is not generally available.
+# Note this deviates from the version comparison in automake
+# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
+# but this should suffice as we won't be specifying old
+# version formats or redundant trailing .0 in bootstrap.conf.
+# If we did want full compatibility then we should probably
+# use m4_version_compare from autoconf.
+func_sort_ver ()
+{
+    $debug_cmd
+
+    ver1=$1
+    ver2=$2
+
+    # Split on '.' and compare each component.
+    i=1
+    while :; do
+      p1=`echo "$ver1" |cut -d. -f$i`
+      p2=`echo "$ver2" |cut -d. -f$i`
+      if test ! "$p1"; then
+        echo "$1 $2"
+        break
+      elif test ! "$p2"; then
+        echo "$2 $1"
+        break
+      elif test ! "$p1" = "$p2"; then
+        if test "$p1" -gt "$p2" 2>/dev/null; then # numeric comparison
+          echo "$2 $1"
+        elif test "$p2" -gt "$p1" 2>/dev/null; then # numeric comparison
+          echo "$1 $2"
+        else # numeric, then lexicographic comparison
+          lp=`printf "$p1\n$p2\n" |sort -n |tail -n1`
+          if test "$lp" = "$p2"; then
+            echo "$1 $2"
+          else
+            echo "$2 $1"
+          fi
+        fi
+        break
+      fi
+      i=`expr $i + 1`
+    done
+}
+
+
+# Local variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
+# time-stamp-time-zone: "UTC"
+# End:
+#! /bin/sh
+
+# Set a version string for this script.
+scriptversion=2012-10-21.11; # UTC
+
+# A portable, pluggable option parser for Bourne shell.
+# Written by Gary V. Vaughan, 2010
+
+# Copyright (C) 2010-2013 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.
+
+# This program 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 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# 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, see <http://www.gnu.org/licenses/>.
+
+# Please report bugs or propose patches to gary@gnu.org.
+
+
+## ------ ##
+## Usage. ##
+## ------ ##
+
+# This file is a library for parsing options in your shell scripts along
+# with assorted other useful supporting features that you can make use
+# of too.
+#
+# For the simplest scripts you might need only:
+#
+#   #!/bin/sh
+#   . relative/path/to/funclib.sh
+#   . relative/path/to/options-parser
+#   scriptversion=1.0
+#   func_options ${1+"$@"}
+#   eval set dummy "$func_options_result"; shift
+#   ...rest of your script...
+#
+# In order for the '--version' option to work, you will need to have a
+# suitably formatted comment like the one at the top of this file
+# starting with '# Written by ' and ending with '# warranty; '.
+#
+# For '-h' and '--help' to work, you will also need a one line
+# description of your script's purpose in a comment directly above the
+# '# Written by ' line, like the one at the top of this file.
+#
+# The default options also support '--debug', which will turn on shell
+# execution tracing (see the comment above debug_cmd below for another
+# use), and '--verbose' and the func_verbose function to allow your script
+# to display verbose messages only when your user has specified
+# '--verbose'.
+#
+# After sourcing this file, you can plug processing for additional
+# options by amending the variables from the 'Configuration' section
+# below, and following the instructions in the 'Option parsing'
+# section further down.
+
+## -------------- ##
+## Configuration. ##
+## -------------- ##
+
+# You should override these variables in your script after sourcing this
+# file so that they reflect the customisations you have added to the
+# option parser.
+
+# The usage line for option parsing errors and the start of '-h' and
+# '--help' output messages. You can embed shell variables for delayed
+# expansion at the time the message is displayed, but you will need to
+# quote other shell meta-characters carefully to prevent them being
+# expanded when the contents are evaled.
+usage='$progpath [OPTION]...'
+
+# Short help message in response to '-h' and '--help'.  Add to this or
+# override it after sourcing this library to reflect the full set of
+# options your script accepts.
+usage_message="\
+       --debug        enable verbose shell tracing
+   -W, --warnings=CATEGORY
+                      report the warnings falling in CATEGORY [all]
+   -v, --verbose      verbosely report processing
+       --version      print version information and exit
+   -h, --help         print short or long help message and exit
+"
+
+# Additional text appended to 'usage_message' in response to '--help'.
+long_help_message="
+Warning categories include:
+       'all'          show all warnings
+       'none'         turn off all the warnings
+       'error'        warnings are treated as fatal errors"
+
+# Help message printed before fatal option parsing errors.
+fatal_help="Try '\$progname --help' for more information."
+
+
+
+## ------------------------- ##
+## Hook function management. ##
+## ------------------------- ##
+
+# This section contains functions for adding, removing, and running hooks
+# to the main code.  A hook is just a named list of of function, that can
+# be run in order later on.
+
+# func_hookable FUNC_NAME
+# -----------------------
+# Declare that FUNC_NAME will run hooks added with
+# 'func_add_hook FUNC_NAME ...'.
+func_hookable ()
+{
+    $debug_cmd
+
+    func_append hookable_fns " $1"
+}
+
+
+# func_add_hook FUNC_NAME HOOK_FUNC
+# ---------------------------------
+# Request that FUNC_NAME call HOOK_FUNC before it returns.  FUNC_NAME must
+# first have been declared "hookable" by a call to 'func_hookable'.
+func_add_hook ()
+{
+    $debug_cmd
+
+    case " $hookable_fns " in
+      *" $1 "*) ;;
+      *) func_fatal_error "'$1' does not accept hook functions." ;;
+    esac
+
+    eval func_append ${1}_hooks '" $2"'
+}
+
+
+# func_remove_hook FUNC_NAME HOOK_FUNC
+# ------------------------------------
+# Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
+func_remove_hook ()
+{
+    $debug_cmd
+
+    eval ${1}_hooks='`$bs_echo "\$'$1'_hooks" |$SED "s| '$2'||"`'
+}
+
+
+# func_run_hooks FUNC_NAME [ARG]...
+# ---------------------------------
+# Run all hook functions registered to FUNC_NAME.
+# It is assumed that the list of hook functions contains nothing more
+# than a whitespace-delimited list of legal shell function names, and
+# no effort is wasted trying to catch shell meta-characters or preserve
+# whitespace.
+func_run_hooks ()
+{
+    $debug_cmd
+
+    case " $hookable_fns " in
+      *" $1 "*) ;;
+      *) func_fatal_error "'$1' does not support hook funcions.n" ;;
+    esac
+
+    eval _G_hook_fns=\$$1_hooks; shift
+
+    for _G_hook in $_G_hook_fns; do
+      eval $_G_hook '"$@"'
+
+      # store returned options list back into positional
+      # parameters for next 'cmd' execution.
+      eval _G_hook_result=\$${_G_hook}_result
+      eval set dummy "$_G_hook_result"; shift
+    done
+
+    func_quote_for_eval ${1+"$@"}
+    func_run_hooks_result=$func_quote_for_eval_result
+}
+
+
+
+## --------------- ##
+## Option parsing. ##
+## --------------- ##
+
+# In order to add your own option parsing hooks, you must accept the
+# full positional parameter list in your hook function, remove any
+# options that you action, and then pass back the remaining unprocessed
+# options in '<hooked_function_name>_result', escaped suitably for
+# 'eval'.  Like this:
+#
+#    my_options_prep ()
+#    {
+#        $debug_cmd
+#
+#        # Extend the existing usage message.
+#        usage_message=$usage_message'
+#      -s, --silent       don'\''t print informational messages
+#    '
+#
+#        func_quote_for_eval ${1+"$@"}
+#        my_options_prep_result=$func_quote_for_eval_result
+#    }
+#    func_add_hook func_options_prep my_options_prep
+#
+#
+#    my_silent_option ()
+#    {
+#        $debug_cmd
+#
+#        # Note that for efficiency, we parse as many options as we can
+#        # recognise in a loop before passing the remainder back to the
+#        # caller on the first unrecognised argument we encounter.
+#        while test $# -gt 0; do
+#          opt=$1; shift
+#          case $opt in
+#            --silent|-s) opt_silent=: ;;
+#            # Separate non-argument short options:
+#            -s*)         func_split_short_opt "$_G_opt"
+#                         set dummy "$func_split_short_opt_name" \
+#                             "-$func_split_short_opt_arg" ${1+"$@"}
+#                         shift
+#                         ;;
+#            *)            set dummy "$_G_opt" "$*"; shift; break ;;
+#          esac
+#        done
+#
+#        func_quote_for_eval ${1+"$@"}
+#        my_silent_option_result=$func_quote_for_eval_result
+#    }
+#    func_add_hook func_parse_options my_silent_option
+#
+#
+#    my_option_validation ()
+#    {
+#        $debug_cmd
+#
+#        $opt_silent && $opt_verbose && func_fatal_help "\
+#    '--silent' and '--verbose' options are mutually exclusive."
+#
+#        func_quote_for_eval ${1+"$@"}
+#        my_option_validation_result=$func_quote_for_eval_result
+#    }
+#    func_add_hook func_validate_options my_option_validation
+#
+# You'll alse need to manually amend $usage_message to reflect the extra
+# options you parse.  It's preferable to append if you can, so that
+# multiple option parsing hooks can be added safely.
+
+
+# func_options [ARG]...
+# ---------------------
+# All the functions called inside func_options are hookable. See the
+# individual implementations for details.
+func_hookable func_options
+func_options ()
+{
+    $debug_cmd
+
+    func_options_prep ${1+"$@"}
+    eval func_parse_options \
+        ${func_options_prep_result+"$func_options_prep_result"}
+    eval func_validate_options \
+        ${func_parse_options_result+"$func_parse_options_result"}
+
+    eval func_run_hooks func_options \
+        ${func_validate_options_result+"$func_validate_options_result"}
+
+    # save modified positional parameters for caller
+    func_options_result=$func_run_hooks_result
+}
+
+
+# func_options_prep [ARG]...
+# --------------------------
+# All initialisations required before starting the option parse loop.
+# Note that when calling hook functions, we pass through the list of
+# positional parameters.  If a hook function modifies that list, and
+# needs to propogate that back to rest of this script, then the complete
+# modified list must be put in 'func_run_hooks_result' before
+# returning.
+func_hookable func_options_prep
+func_options_prep ()
+{
+    $debug_cmd
+
+    # Option defaults:
+    opt_verbose=false
+    opt_warning_types=
+
+    func_run_hooks func_options_prep ${1+"$@"}
+
+    # save modified positional parameters for caller
+    func_options_prep_result=$func_run_hooks_result
+}
+
+
+# func_parse_options [ARG]...
+# ---------------------------
+# The main option parsing loop.
+func_hookable func_parse_options
+func_parse_options ()
+{
+    $debug_cmd
+
+    func_parse_options_result=
+
+    # this just eases exit handling
+    while test $# -gt 0; do
+      # Defer to hook functions for initial option parsing, so they
+      # get priority in the event of reusing an option name.
+      func_run_hooks func_parse_options ${1+"$@"}
+
+      # Adjust func_parse_options positional parameters to match
+      eval set dummy "$func_run_hooks_result"; shift
+
+      # Break out of the loop if we already parsed every option.
+      test $# -gt 0 || break
+
+      _G_opt=$1
+      shift
+      case $_G_opt in
+        --debug|-x)   debug_cmd='set -x'
+                      func_echo "enabling shell trace mode"
+                      $debug_cmd
+                      ;;
+
+        --no-warnings|--no-warning|--no-warn)
+                      set dummy --warnings none ${1+"$@"}
+                      shift
+		      ;;
+
+        --warnings|--warning|-W)
+                      test $# = 0 && func_missing_arg $_G_opt && break
+                      case " $warning_categories $1" in
+                        *" $1 "*)
+                          # trailing space prevents matching last $1 above
+                          func_append_uniq opt_warning_types " $1"
+                          ;;
+                        *all)
+                          opt_warning_types=$warning_categories
+                          ;;
+                        *none)
+                          opt_warning_types=none
+                          warning_func=:
+                          ;;
+                        *error)
+                          opt_warning_types=$warning_categories
+                          warning_func=func_fatal_error
+                          ;;
+                        *)
+                          func_fatal_error \
+                             "unsupported warning category: '$1'"
+                          ;;
+                      esac
+                      shift
+                      ;;
+
+        --verbose|-v) opt_verbose=: ;;
+        --version)    func_version ;;
+        -\?|-h)       func_usage ;;
+        --help)       func_help ;;
+
+	# Separate optargs to long options (plugins may need this):
+	--*=*)        func_split_equals "$_G_opt"
+	              set dummy "$func_split_equals_lhs" \
+                          "$func_split_equals_rhs" ${1+"$@"}
+                      shift
+                      ;;
+
+       # Separate optargs to short options:
+        -W*)
+                      func_split_short_opt "$_G_opt"
+                      set dummy "$func_split_short_opt_name" \
+                          "$func_split_short_opt_arg" ${1+"$@"}
+                      shift
+                      ;;
+
+        # Separate non-argument short options:
+        -\?*|-h*|-v*|-x*)
+                      func_split_short_opt "$_G_opt"
+                      set dummy "$func_split_short_opt_name" \
+                          "-$func_split_short_opt_arg" ${1+"$@"}
+                      shift
+                      ;;
+
+        --)           break ;;
+        -*)           func_fatal_help "unrecognised option: '$_G_opt'" ;;
+        *)            set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
+      esac
+    done
+
+    # save modified positional parameters for caller
+    func_quote_for_eval ${1+"$@"}
+    func_parse_options_result=$func_quote_for_eval_result
+}
+
+
+# func_validate_options [ARG]...
+# ------------------------------
+# Perform any sanity checks on option settings and/or unconsumed
+# arguments.
+func_hookable func_validate_options
+func_validate_options ()
+{
+    $debug_cmd
+
+    # Display all warnings if -W was not given.
+    test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
+
+    func_run_hooks func_validate_options ${1+"$@"}
+
+    # Bail if the options were screwed!
+    $exit_cmd $EXIT_FAILURE
+
+    # save modified positional parameters for caller
+    func_validate_options_result=$func_run_hooks_result
+}
+
+
+
+## ------------------##
+## Helper functions. ##
+## ------------------##
+
+# This section contains the helper functions used by the rest of the
+# hookable option parser framework in ascii-betical order.
+
+
+# func_fatal_help ARG...
+# ----------------------
+# Echo program name prefixed message to standard error, followed by
+# a help hint, and exit.
+func_fatal_help ()
+{
+    $debug_cmd
+
+    eval \$bs_echo \""Usage: $usage"\"
+    eval \$bs_echo \""$fatal_help"\"
+    func_error ${1+"$@"}
+    exit $EXIT_FAILURE
+}
+
+
+# func_help
+# ---------
+# Echo long help message to standard output and exit.
 func_help ()
 {
-    $opt_debug
+    $debug_cmd
 
-    $SED -n '/^# Usage:/,/# Report bugs to/ {
-	:print
-        s/^# //
-	s/^# *$//
-	s*\$progname*'$progname'*
-	s*\$host*'"$host"'*
-	s*\$SHELL*'"$SHELL"'*
-	s*\$LTCC*'"$LTCC"'*
-	s*\$LTCFLAGS*'"$LTCFLAGS"'*
-	s*\$LD*'"$LD"'*
-	s/\$with_gnu_ld/'"$with_gnu_ld"'/
-	s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
-	s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
-	p
-	d
-     }
-     /^# .* home page:/b print
-     /^# General help using/b print
-     ' < "$progpath"
-    ret=$?
-    if test -z "$1"; then
-      exit $ret
-    fi
+    func_usage_message
+    $bs_echo "$long_help_message"
+    exit 0
 }
 
-# func_missing_arg argname
+
+# func_missing_arg ARGNAME
+# ------------------------
 # Echo program name prefixed message to standard error and set global
 # exit_cmd.
 func_missing_arg ()
 {
-    $opt_debug
+    $debug_cmd
 
-    func_error "missing argument for $1."
+    func_error "Missing argument for '$1'."
     exit_cmd=exit
 }
 
 
-# func_split_short_opt shortopt
+# func_split_equals STRING
+# ------------------------
+# Set func_split_equals_lhs and func_split_equals_rhs shell variables after
+# splitting STRING at the '=' sign.
+test -z "$_G_HAVE_XSI_OPS" \
+    && (eval 'x=a/b/c;
+      test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
+    && _G_HAVE_XSI_OPS=yes
+
+if test yes = "$_G_HAVE_XSI_OPS"
+then
+  # This is an XSI compatible shell, allowing a faster implementation...
+  eval 'func_split_equals ()
+  {
+      $debug_cmd
+
+      func_split_equals_lhs=${1%%=*}
+      func_split_equals_rhs=${1#*=}
+      test "x$func_split_equals_lhs" = "x$1" \
+        && func_split_equals_rhs=
+  }'
+else
+  # ...otherwise fall back to using expr, which is often a shell builtin.
+  func_split_equals ()
+  {
+      $debug_cmd
+
+      func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
+      func_split_equals_rhs=
+      test "x$func_split_equals_lhs" = "x$1" \
+        || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
+  }
+fi #func_split_equals
+
+
+# func_split_short_opt SHORTOPT
+# -----------------------------
 # Set func_split_short_opt_name and func_split_short_opt_arg shell
 # variables after splitting SHORTOPT after the 2nd character.
-func_split_short_opt ()
+if test yes = "$_G_HAVE_XSI_OPS"
+then
+  # This is an XSI compatible shell, allowing a faster implementation...
+  eval 'func_split_short_opt ()
+  {
+      $debug_cmd
+
+      func_split_short_opt_arg=${1#??}
+      func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
+  }'
+else
+  # ...otherwise fall back to using expr, which is often a shell builtin.
+  func_split_short_opt ()
+  {
+      $debug_cmd
+
+      func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
+      func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
+  }
+fi #func_split_short_opt
+
+
+# func_usage
+# ----------
+# Echo short help message to standard output and exit.
+func_usage ()
 {
-    my_sed_short_opt='1s/^\(..\).*$/\1/;q'
-    my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
+    $debug_cmd
 
-    func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
-    func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
-} # func_split_short_opt may be replaced by extended shell implementation
+    func_usage_message
+    $bs_echo "Run '$progname --help |${PAGER-more}' for full usage"
+    exit 0
+}
 
 
-# func_split_long_opt longopt
-# Set func_split_long_opt_name and func_split_long_opt_arg shell
-# variables after splitting LONGOPT at the `=' sign.
-func_split_long_opt ()
+# func_usage_message
+# ------------------
+# Echo short help message to standard output.
+func_usage_message ()
 {
-    my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
-    my_sed_long_arg='1s/^--[^=]*=//'
+    $debug_cmd
 
-    func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
-    func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
-} # func_split_long_opt may be replaced by extended shell implementation
-
-exit_cmd=:
+    eval \$bs_echo \""Usage: $usage"\"
+    echo
+    $SED -n 's|^# ||
+        /^Written by/{
+          x;p;x
+        }
+	h
+	/^Written by/q' < "$progpath"
+    echo
+    eval \$bs_echo \""$usage_message"\"
+}
 
 
-
-
-
-magic="%%%MAGIC variable%%%"
-magic_exe="%%%MAGIC EXE variable%%%"
-
-# Global variables.
-nonopt=
-preserve_args=
-lo2o="s/\\.lo\$/.${objext}/"
-o2lo="s/\\.${objext}\$/.lo/"
-extracted_archives=
-extracted_serial=0
-
-# If this variable is set in any of the actions, the command in it
-# will be execed at the end.  This prevents here-documents from being
-# left over by shells.
-exec_cmd=
-
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
+# func_version
+# ------------
+# Echo version message to standard output and exit.
+func_version ()
 {
-    eval "${1}=\$${1}\${2}"
-} # func_append may be replaced by extended shell implementation
+    $debug_cmd
 
-# func_append_quoted var value
-# Quote VALUE and append to the end of shell variable VAR, separated
-# by a space.
-func_append_quoted ()
+    printf '%s\n' "$progname $scriptversion"
+    $SED -n '/^##/q
+        /(C)/!b go
+        :more
+        /\./!{
+          N
+          s|\n# | |
+          b more
+        }
+        :go
+        /^# Written by /,/# warranty; / {
+          s|^# ||
+          s|^# *$||
+          s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
+          p
+        }
+        /^# Written by / {
+          s|^# ||
+          p
+        }
+        /^warranty; /q' < "$progpath"
+
+    exit $?
+}
+
+
+# Local variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
+# time-stamp-time-zone: "UTC"
+# End:
+
+# Set a version string.
+scriptversion='(GNU libtool) 2.4.2.418'
+
+
+# func_echo ARG...
+# ----------------
+# Libtool also displays the current mode in messages, so override
+# funclib.sh func_echo with this custom definition.
+func_echo ()
 {
-    func_quote_for_eval "${2}"
-    eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
-} # func_append_quoted may be replaced by extended shell implementation
+    $debug_cmd
+
+    _G_message=$*
+
+    func_echo_IFS=$IFS
+    IFS=$nl
+    for _G_line in $_G_message; do
+      IFS=$func_echo_IFS
+      $bs_echo "$progname${opt_mode+: $opt_mode}: $_G_line"
+    done
+    IFS=$func_echo_IFS
+}
 
 
-# func_arith arithmetic-term...
-func_arith ()
+# func_warning ARG...
+# -------------------
+# Libtool warnings are not categorized, so override funclib.sh
+# func_warning with this simpler definition.
+func_warning ()
 {
-    func_arith_result=`expr "${@}"`
-} # func_arith may be replaced by extended shell implementation
+    $debug_cmd
+
+    $warning_func ${1+"$@"}
+}
 
 
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
-{
-    func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
-} # func_len may be replaced by extended shell implementation
+## ---------------- ##
+## Options parsing. ##
+## ---------------- ##
+
+# Hook in the functions to make sure our own options are parsed during
+# the option parsing loop.
+
+usage='$progpath [OPTION]... [MODE-ARG]...'
+
+# Short help message in response to '-h'.
+usage_message="Options:
+       --config             show all configuration variables
+       --debug              enable verbose shell tracing
+   -n, --dry-run            display commands without modifying any files
+       --features           display basic configuration information and exit
+       --mode=MODE          use operation mode MODE
+       --no-warnings        equivalent to '-Wnone'
+       --preserve-dup-deps  don't remove duplicate dependency libraries
+       --quiet, --silent    don't print informational messages
+       --tag=TAG            use configuration variables from tag TAG
+   -v, --verbose            print more informational messages than default
+       --version            print version information
+   -W, --warnings=CATEGORY  report the warnings falling in CATEGORY [all]
+   -h, --help, --help-all   print short, long, or detailed help message
+"
+
+# Additional text appended to 'usage_message' in response to '--help'.
+long_help_message=$long_help_message"
+
+MODE must be one of the following:
+
+       clean           remove files from the build directory
+       compile         compile a source file into a libtool object
+       execute         automatically set library path, then run a program
+       finish          complete the installation of libtool libraries
+       install         install libraries or executables
+       link            create a library or an executable
+       uninstall       remove libraries from an installed directory
+
+MODE-ARGS vary depending on the MODE.  When passed as first option,
+'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that.
+Try '$progname --help --mode=MODE' for a more detailed description of MODE.
+
+When reporting a bug, please describe a test case to reproduce it and
+include the following information:
+
+       host-triplet:   $host
+       shell:          $SHELL
+       compiler:       $LTCC
+       compiler flags: $LTCFLAGS
+       linker:         $LD (gnu? $with_gnu_ld)
+       version:        $progname (GNU libtool) 2.4.2.418
+       automake:       `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
+       autoconf:       `($AUTOCONF --version) 2>/dev/null |$SED 1q`
+
+Report bugs to <bug-libtool@gnu.org>.
+GNU libtool home page: <http://www.gnu.org/software/libtool/>.
+General help using GNU software: <http://www.gnu.org/gethelp/>."
 
 
-# func_lo2o object
-func_lo2o ()
-{
-    func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
-} # func_lo2o may be replaced by extended shell implementation
+# func_lo2o OBJECT-NAME
+# ---------------------
+# Transform OBJECT-NAME from a '.lo' suffix to the platform specific
+# object suffix.
+
+lo2o=s/\\.lo\$/.$objext/
+o2lo=s/\\.$objext\$/.lo/
+
+if test yes = "$_G_HAVE_XSI_OPS"; then
+  eval 'func_lo2o ()
+  {
+    case $1 in
+      *.lo) func_lo2o_result=${1%.lo}.$objext ;;
+      *   ) func_lo2o_result=$1               ;;
+    esac
+  }'
+
+  # func_xform LIBOBJ-OR-SOURCE
+  # ---------------------------
+  # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise)
+  # suffix to a '.lo' libtool-object suffix.
+  eval 'func_xform ()
+  {
+    func_xform_result=${1%.*}.lo
+  }'
+else
+  # ...otherwise fall back to using sed.
+  func_lo2o ()
+  {
+    func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"`
+  }
+
+  func_xform ()
+  {
+    func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'`
+  }
+fi
 
 
-# func_xform libobj-or-source
-func_xform ()
-{
-    func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
-} # func_xform may be replaced by extended shell implementation
-
-
-# func_fatal_configuration arg...
+# func_fatal_configuration ARG...
+# -------------------------------
 # Echo program name prefixed message to standard error, followed by
 # a configuration failure hint, and exit.
 func_fatal_configuration ()
 {
-    func_error ${1+"$@"}
-    func_error "See the $PACKAGE documentation for more information."
-    func_fatal_error "Fatal configuration error."
+    func__fatal_error ${1+"$@"} \
+      "See the $PACKAGE documentation for more information." \
+      "Fatal configuration error."
 }
 
 
 # func_config
+# -----------
 # Display the configuration for all the tags in this script.
 func_config ()
 {
@@ -915,17 +2048,19 @@
     exit $?
 }
 
+
 # func_features
+# -------------
 # Display the features supported by this script.
 func_features ()
 {
     echo "host: $host"
-    if test "$build_libtool_libs" = yes; then
+    if test yes = "$build_libtool_libs"; then
       echo "enable shared libraries"
     else
       echo "disable shared libraries"
     fi
-    if test "$build_old_libs" = yes; then
+    if test yes = "$build_old_libs"; then
       echo "enable static libraries"
     else
       echo "disable static libraries"
@@ -934,298 +2069,325 @@
     exit $?
 }
 
-# func_enable_tag tagname
+
+# func_enable_tag TAGNAME
+# -----------------------
 # Verify that TAGNAME is valid, and either flag an error and exit, or
 # enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
 # variable here.
 func_enable_tag ()
 {
-  # Global variable:
-  tagname="$1"
+    # Global variable:
+    tagname=$1
 
-  re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
-  re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
-  sed_extractcf="/$re_begincf/,/$re_endcf/p"
+    re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
+    re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
+    sed_extractcf=/$re_begincf/,/$re_endcf/p
 
-  # Validate tagname.
-  case $tagname in
-    *[!-_A-Za-z0-9,/]*)
-      func_fatal_error "invalid tag name: $tagname"
-      ;;
-  esac
+    # Validate tagname.
+    case $tagname in
+      *[!-_A-Za-z0-9,/]*)
+        func_fatal_error "invalid tag name: $tagname"
+        ;;
+    esac
 
-  # Don't test for the "default" C tag, as we know it's
-  # there but not specially marked.
-  case $tagname in
-    CC) ;;
+    # Don't test for the "default" C tag, as we know it's
+    # there but not specially marked.
+    case $tagname in
+        CC) ;;
     *)
-      if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
-	taglist="$taglist $tagname"
+        if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
+	  taglist="$taglist $tagname"
 
-	# Evaluate the configuration.  Be careful to quote the path
-	# and the sed script, to avoid splitting on whitespace, but
-	# also don't use non-portable quotes within backquotes within
-	# quotes we have to do it in 2 steps:
-	extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
-	eval "$extractedcf"
-      else
-	func_error "ignoring unknown tag $tagname"
-      fi
-      ;;
-  esac
+	  # Evaluate the configuration.  Be careful to quote the path
+	  # and the sed script, to avoid splitting on whitespace, but
+	  # also don't use non-portable quotes within backquotes within
+	  # quotes we have to do it in 2 steps:
+	  extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
+	  eval "$extractedcf"
+        else
+	  func_error "ignoring unknown tag $tagname"
+        fi
+        ;;
+    esac
 }
 
+
 # func_check_version_match
+# ------------------------
 # Ensure that we are using m4 macros, and libtool script from the same
 # release of libtool.
 func_check_version_match ()
 {
-  if test "$package_revision" != "$macro_revision"; then
-    if test "$VERSION" != "$macro_version"; then
-      if test -z "$macro_version"; then
-        cat >&2 <<_LT_EOF
+    if test "$package_revision" != "$macro_revision"; then
+      if test "$VERSION" != "$macro_version"; then
+        if test -z "$macro_version"; then
+          cat >&2 <<_LT_EOF
 $progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
 $progname: definition of this LT_INIT comes from an older release.
 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
 $progname: and run autoconf again.
 _LT_EOF
-      else
-        cat >&2 <<_LT_EOF
+        else
+          cat >&2 <<_LT_EOF
 $progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
 $progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
 $progname: and run autoconf again.
 _LT_EOF
-      fi
-    else
-      cat >&2 <<_LT_EOF
+        fi
+      else
+        cat >&2 <<_LT_EOF
 $progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
 $progname: but the definition of this LT_INIT comes from revision $macro_revision.
 $progname: You should recreate aclocal.m4 with macros from revision $package_revision
 $progname: of $PACKAGE $VERSION and run autoconf again.
 _LT_EOF
-    fi
+      fi
 
-    exit $EXIT_MISMATCH
-  fi
+      exit $EXIT_MISMATCH
+    fi
 }
 
 
-# Shorthand for --mode=foo, only valid as the first argument
-case $1 in
-clean|clea|cle|cl)
-  shift; set dummy --mode clean ${1+"$@"}; shift
-  ;;
-compile|compil|compi|comp|com|co|c)
-  shift; set dummy --mode compile ${1+"$@"}; shift
-  ;;
-execute|execut|execu|exec|exe|ex|e)
-  shift; set dummy --mode execute ${1+"$@"}; shift
-  ;;
-finish|finis|fini|fin|fi|f)
-  shift; set dummy --mode finish ${1+"$@"}; shift
-  ;;
-install|instal|insta|inst|ins|in|i)
-  shift; set dummy --mode install ${1+"$@"}; shift
-  ;;
-link|lin|li|l)
-  shift; set dummy --mode link ${1+"$@"}; shift
-  ;;
-uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
-  shift; set dummy --mode uninstall ${1+"$@"}; shift
-  ;;
-esac
-
-
-
-# Option defaults:
-opt_debug=:
-opt_dry_run=false
-opt_config=false
-opt_preserve_dup_deps=false
-opt_features=false
-opt_finish=false
-opt_help=false
-opt_help_all=false
-opt_silent=:
-opt_warning=:
-opt_verbose=:
-opt_silent=false
-opt_verbose=false
-
-
-# Parse options once, thoroughly.  This comes as soon as possible in the
-# script to make things like `--version' happen as quickly as we can.
+# libtool_options_prep [ARG]...
+# -----------------------------
+# Preparation for options parsed by libtool.
+libtool_options_prep ()
 {
-  # this just eases exit handling
-  while test $# -gt 0; do
-    opt="$1"
-    shift
-    case $opt in
-      --debug|-x)	opt_debug='set -x'
-			func_echo "enabling shell trace mode"
-			$opt_debug
-			;;
-      --dry-run|--dryrun|-n)
-			opt_dry_run=:
-			;;
-      --config)
-			opt_config=:
-func_config
-			;;
-      --dlopen|-dlopen)
-			optarg="$1"
-			opt_dlopen="${opt_dlopen+$opt_dlopen
-}$optarg"
-			shift
-			;;
-      --preserve-dup-deps)
-			opt_preserve_dup_deps=:
-			;;
-      --features)
-			opt_features=:
-func_features
-			;;
-      --finish)
-			opt_finish=:
-set dummy --mode finish ${1+"$@"}; shift
-			;;
-      --help)
-			opt_help=:
-			;;
-      --help-all)
-			opt_help_all=:
-opt_help=': help-all'
-			;;
-      --mode)
-			test $# = 0 && func_missing_arg $opt && break
-			optarg="$1"
-			opt_mode="$optarg"
-case $optarg in
-  # Valid mode arguments:
-  clean|compile|execute|finish|install|link|relink|uninstall) ;;
+    $debug_mode
 
-  # Catch anything else as an error
-  *) func_error "invalid argument for $opt"
-     exit_cmd=exit
-     break
-     ;;
-esac
-			shift
-			;;
-      --no-silent|--no-quiet)
-			opt_silent=false
-func_append preserve_args " $opt"
-			;;
-      --no-warning|--no-warn)
-			opt_warning=false
-func_append preserve_args " $opt"
-			;;
-      --no-verbose)
-			opt_verbose=false
-func_append preserve_args " $opt"
-			;;
-      --silent|--quiet)
-			opt_silent=:
-func_append preserve_args " $opt"
-        opt_verbose=false
-			;;
-      --verbose|-v)
-			opt_verbose=:
-func_append preserve_args " $opt"
-opt_silent=false
-			;;
-      --tag)
-			test $# = 0 && func_missing_arg $opt && break
-			optarg="$1"
-			opt_tag="$optarg"
-func_append preserve_args " $opt $optarg"
-func_enable_tag "$optarg"
-			shift
-			;;
+    # Option defaults:
+    opt_config=false
+    opt_dlopen=
+    opt_dry_run=false
+    opt_help=false
+    opt_mode=
+    opt_preserve_dup_deps=false
+    opt_quiet=false
 
-      -\?|-h)		func_usage				;;
-      --help)		func_help				;;
-      --version)	func_version				;;
+    nonopt=
+    preserve_args=
 
-      # Separate optargs to long options:
-      --*=*)
-			func_split_long_opt "$opt"
-			set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
-			shift
-			;;
-
-      # Separate non-argument short options:
-      -\?*|-h*|-n*|-v*)
-			func_split_short_opt "$opt"
-			set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
-			shift
-			;;
-
-      --)		break					;;
-      -*)		func_fatal_help "unrecognized option \`$opt'" ;;
-      *)		set dummy "$opt" ${1+"$@"};	shift; break  ;;
+    # Shorthand for --mode=foo, only valid as the first argument
+    case $1 in
+    clean|clea|cle|cl)
+      shift; set dummy --mode clean ${1+"$@"}; shift
+      ;;
+    compile|compil|compi|comp|com|co|c)
+      shift; set dummy --mode compile ${1+"$@"}; shift
+      ;;
+    execute|execut|execu|exec|exe|ex|e)
+      shift; set dummy --mode execute ${1+"$@"}; shift
+      ;;
+    finish|finis|fini|fin|fi|f)
+      shift; set dummy --mode finish ${1+"$@"}; shift
+      ;;
+    install|instal|insta|inst|ins|in|i)
+      shift; set dummy --mode install ${1+"$@"}; shift
+      ;;
+    link|lin|li|l)
+      shift; set dummy --mode link ${1+"$@"}; shift
+      ;;
+    uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+      shift; set dummy --mode uninstall ${1+"$@"}; shift
+      ;;
     esac
-  done
 
-  # Validate options:
-
-  # save first non-option argument
-  if test "$#" -gt 0; then
-    nonopt="$opt"
-    shift
-  fi
-
-  # preserve --debug
-  test "$opt_debug" = : || func_append preserve_args " --debug"
-
-  case $host in
-    *cygwin* | *mingw* | *pw32* | *cegcc*)
-      # don't eliminate duplications in $postdeps and $predeps
-      opt_duplicate_compiler_generated_deps=:
-      ;;
-    *)
-      opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
-      ;;
-  esac
-
-  $opt_help || {
-    # Sanity checks first:
-    func_check_version_match
-
-    if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
-      func_fatal_configuration "not configured to build any kind of library"
-    fi
-
-    # Darwin sucks
-    eval std_shrext=\"$shrext_cmds\"
-
-    # Only execute mode is allowed to have -dlopen flags.
-    if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
-      func_error "unrecognized option \`-dlopen'"
-      $ECHO "$help" 1>&2
-      exit $EXIT_FAILURE
-    fi
-
-    # Change the help message to a mode-specific one.
-    generic_help="$help"
-    help="Try \`$progname --help --mode=$opt_mode' for more information."
-  }
-
-
-  # Bail if the options were screwed
-  $exit_cmd $EXIT_FAILURE
+    # Pass back the list of options.
+    func_quote_for_eval ${1+"$@"}
+    libtool_options_prep_result=$func_quote_for_eval_result
 }
+func_add_hook func_options_prep libtool_options_prep
 
 
+# libtool_parse_options [ARG]...
+# ---------------------------------
+# Provide handling for libtool specific options.
+libtool_parse_options ()
+{
+    $debug_cmd
+
+    # Perform our own loop to consume as many options as possible in
+    # each iteration.
+    while test $# -gt 0; do
+      _G_opt=$1
+      shift
+      case $_G_opt in
+        --dry-run|--dryrun|-n)
+                        opt_dry_run=:
+                        ;;
+
+        --config)       func_config ;;
+
+        --dlopen|-dlopen)
+                        opt_dlopen="${opt_dlopen+$opt_dlopen
+}$1"
+                        shift
+                        ;;
+
+        --preserve-dup-deps)
+                        opt_preserve_dup_deps=: ;;
+
+        --features)     func_features ;;
+
+        --finish)       set dummy --mode finish ${1+"$@"}; shift ;;
+
+        --help)         opt_help=: ;;
+
+        --help-all)     opt_help=': help-all' ;;
+
+        --mode)         test $# = 0 && func_missing_arg $_G_opt && break
+                        opt_mode=$1
+                        case $1 in
+                          # Valid mode arguments:
+                          clean|compile|execute|finish|install|link|relink|uninstall) ;;
+
+                          # Catch anything else as an error
+                          *) func_error "invalid argument for $_G_opt"
+                             exit_cmd=exit
+                             break
+                             ;;
+                        esac
+                        shift
+                        ;;
+
+        --no-silent|--no-quiet)
+                        opt_quiet=false
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+        --no-warnings|--no-warning|--no-warn)
+                        opt_warning=false
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+        --no-verbose)
+                        opt_verbose=false
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+        --silent|--quiet)
+                        opt_quiet=:
+                        opt_verbose=false
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+        --tag)          test $# = 0 && func_missing_arg $_G_opt && break
+                        opt_tag=$1
+                        func_append preserve_args " $_G_opt $1"
+                        func_enable_tag "$1"
+                        shift
+                        ;;
+
+        --verbose|-v)   opt_quiet=false
+                        opt_verbose=:
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+	# An option not handled by this hook function:
+        *)		set dummy "$_G_opt" ${1+"$@"};	shift; break  ;;
+      esac
+    done
+
+
+    # save modified positional parameters for caller
+    func_quote_for_eval ${1+"$@"}
+    libtool_parse_options_result=$func_quote_for_eval_result
+}
+func_add_hook func_parse_options libtool_parse_options
+
+
+
+# libtool_validate_options [ARG]...
+# ---------------------------------
+# Perform any sanity checks on option settings and/or unconsumed
+# arguments.
+libtool_validate_options ()
+{
+    # save first non-option argument
+    if test 0 -lt $#; then
+      nonopt=$1
+      shift
+    fi
+
+    # preserve --debug
+    test : = "$debug_cmd" || func_append preserve_args " --debug"
+
+    case $host in
+      *cygwin* | *mingw* | *pw32* | *cegcc*)
+        # don't eliminate duplications in $postdeps and $predeps
+        opt_duplicate_compiler_generated_deps=:
+        ;;
+      *)
+        opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
+        ;;
+    esac
+
+    $opt_help || {
+      # Sanity checks first:
+      func_check_version_match
+
+      test yes != "$build_libtool_libs" \
+        && test yes != "$build_old_libs" \
+        && func_fatal_configuration "not configured to build any kind of library"
+
+      # Darwin sucks
+      eval std_shrext=\"$shrext_cmds\"
+
+      # Only execute mode is allowed to have -dlopen flags.
+      if test -n "$opt_dlopen" && test execute != "$opt_mode"; then
+        func_error "unrecognized option '-dlopen'"
+        $ECHO "$help" 1>&2
+        exit $EXIT_FAILURE
+      fi
+
+      # Change the help message to a mode-specific one.
+      generic_help=$help
+      help="Try '$progname --help --mode=$opt_mode' for more information."
+    }
+
+    # Pass back the unparsed argument list
+    func_quote_for_eval ${1+"$@"}
+    libtool_validate_options_result=$func_quote_for_eval_result
+}
+func_add_hook func_validate_options libtool_validate_options
+
+
+# Process options as early as possible so that --help and --version
+# can return quickly.
+func_options ${1+"$@"}
+eval set dummy "$func_options_result"; shift
+
 
 
 ## ----------- ##
 ##    Main.    ##
 ## ----------- ##
 
+magic='%%%MAGIC variable%%%'
+magic_exe='%%%MAGIC EXE variable%%%'
+
+# Global variables.
+extracted_archives=
+extracted_serial=0
+
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end.  This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+}
+
 # func_lalib_p file
-# True iff FILE is a libtool `.la' library or `.lo' object file.
+# True iff FILE is a libtool '.la' library or '.lo' object file.
 # This function is only a basic sanity check; it will hardly flush out
 # determined imposters.
 func_lalib_p ()
@@ -1236,12 +2398,12 @@
 }
 
 # func_lalib_unsafe_p file
-# True iff FILE is a libtool `.la' library or `.lo' object file.
+# True iff FILE is a libtool '.la' library or '.lo' object file.
 # This function implements the same check as func_lalib_p without
 # resorting to external programs.  To this end, it redirects stdin and
 # closes it afterwards, without saving the original file descriptor.
 # As a safety measure, use it only where a negative result would be
-# fatal anyway.  Works if `file' does not exist.
+# fatal anyway.  Works if 'file' does not exist.
 func_lalib_unsafe_p ()
 {
     lalib_p=no
@@ -1249,13 +2411,13 @@
 	for lalib_p_l in 1 2 3 4
 	do
 	    read lalib_p_line
-	    case "$lalib_p_line" in
+	    case $lalib_p_line in
 		\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
 	    esac
 	done
 	exec 0<&5 5<&-
     fi
-    test "$lalib_p" = yes
+    test yes = "$lalib_p"
 }
 
 # func_ltwrapper_script_p file
@@ -1289,7 +2451,7 @@
 {
     func_dirname_and_basename "$1" "" "."
     func_stripname '' '.exe' "$func_basename_result"
-    func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
+    func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper
 }
 
 # func_ltwrapper_p file
@@ -1308,11 +2470,13 @@
 # FAIL_CMD may read-access the current command in variable CMD!
 func_execute_cmds ()
 {
-    $opt_debug
+    $debug_cmd
+
     save_ifs=$IFS; IFS='~'
     for cmd in $1; do
-      IFS=$save_ifs
+      IFS=$sp$nl
       eval cmd=\"$cmd\"
+      IFS=$save_ifs
       func_show_eval "$cmd" "${2-:}"
     done
     IFS=$save_ifs
@@ -1324,10 +2488,11 @@
 # Note that it is not necessary on cygwin/mingw to append a dot to
 # FILE even if both FILE and FILE.exe exist: automatic-append-.exe
 # behavior happens only for exec(3), not for open(2)!  Also, sourcing
-# `FILE.' does not work on cygwin managed mounts.
+# 'FILE.' does not work on cygwin managed mounts.
 func_source ()
 {
-    $opt_debug
+    $debug_cmd
+
     case $1 in
     */* | *\\*)	. "$1" ;;
     *)		. "./$1" ;;
@@ -1354,10 +2519,10 @@
 # store the result into func_replace_sysroot_result.
 func_replace_sysroot ()
 {
-  case "$lt_sysroot:$1" in
+  case $lt_sysroot:$1 in
   ?*:"$lt_sysroot"*)
     func_stripname "$lt_sysroot" '' "$1"
-    func_replace_sysroot_result="=$func_stripname_result"
+    func_replace_sysroot_result='='$func_stripname_result
     ;;
   *)
     # Including no sysroot.
@@ -1374,7 +2539,8 @@
 # arg is usually of the form 'gcc ...'
 func_infer_tag ()
 {
-    $opt_debug
+    $debug_cmd
+
     if test -n "$available_tags" && test -z "$tagname"; then
       CC_quoted=
       for arg in $CC; do
@@ -1393,7 +2559,7 @@
 	for z in $available_tags; do
 	  if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
 	    # Evaluate the configuration.
-	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+	    eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
 	    CC_quoted=
 	    for arg in $CC; do
 	      # Double-quote args containing other shell metacharacters.
@@ -1418,7 +2584,7 @@
 	# line option must be used.
 	if test -z "$tagname"; then
 	  func_echo "unable to infer tagged configuration"
-	  func_fatal_error "specify a tag with \`--tag'"
+	  func_fatal_error "specify a tag with '--tag'"
 #	else
 #	  func_verbose "using $tagname tagged configuration"
 	fi
@@ -1434,15 +2600,15 @@
 # but don't create it if we're doing a dry run.
 func_write_libtool_object ()
 {
-    write_libobj=${1}
-    if test "$build_libtool_libs" = yes; then
-      write_lobj=\'${2}\'
+    write_libobj=$1
+    if test yes = "$build_libtool_libs"; then
+      write_lobj=\'$2\'
     else
       write_lobj=none
     fi
 
-    if test "$build_old_libs" = yes; then
-      write_oldobj=\'${3}\'
+    if test yes = "$build_old_libs"; then
+      write_oldobj=\'$3\'
     else
       write_oldobj=none
     fi
@@ -1450,7 +2616,7 @@
     $opt_dry_run || {
       cat >${write_libobj}T <<EOF
 # $write_libobj - a libtool object file
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
 #
 # Please DO NOT delete this file!
 # It is necessary for linking the library.
@@ -1462,7 +2628,7 @@
 non_pic_object=$write_oldobj
 
 EOF
-      $MV "${write_libobj}T" "${write_libobj}"
+      $MV "${write_libobj}T" "$write_libobj"
     }
 }
 
@@ -1482,8 +2648,9 @@
 # be empty on error (or when ARG is empty)
 func_convert_core_file_wine_to_w32 ()
 {
-  $opt_debug
-  func_convert_core_file_wine_to_w32_result="$1"
+  $debug_cmd
+
+  func_convert_core_file_wine_to_w32_result=$1
   if test -n "$1"; then
     # Unfortunately, winepath does not exit with a non-zero error code, so we
     # are forced to check the contents of stdout. On the other hand, if the
@@ -1491,9 +2658,9 @@
     # *an error message* to stdout. So we must check for both error code of
     # zero AND non-empty stdout, which explains the odd construction:
     func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
-    if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
+    if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then
       func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
-        $SED -e "$lt_sed_naive_backslashify"`
+        $SED -e "$sed_naive_backslashify"`
     else
       func_convert_core_file_wine_to_w32_result=
     fi
@@ -1514,18 +2681,19 @@
 # are convertible, then the result may be empty.
 func_convert_core_path_wine_to_w32 ()
 {
-  $opt_debug
+  $debug_cmd
+
   # unfortunately, winepath doesn't convert paths, only file names
-  func_convert_core_path_wine_to_w32_result=""
+  func_convert_core_path_wine_to_w32_result=
   if test -n "$1"; then
     oldIFS=$IFS
     IFS=:
     for func_convert_core_path_wine_to_w32_f in $1; do
       IFS=$oldIFS
       func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
-      if test -n "$func_convert_core_file_wine_to_w32_result" ; then
+      if test -n "$func_convert_core_file_wine_to_w32_result"; then
         if test -z "$func_convert_core_path_wine_to_w32_result"; then
-          func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
+          func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result
         else
           func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
         fi
@@ -1554,7 +2722,8 @@
 # environment variable; do not put it in $PATH.
 func_cygpath ()
 {
-  $opt_debug
+  $debug_cmd
+
   if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
     func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
     if test "$?" -ne 0; then
@@ -1563,7 +2732,7 @@
     fi
   else
     func_cygpath_result=
-    func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
+    func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'"
   fi
 }
 #end: func_cygpath
@@ -1574,10 +2743,11 @@
 # result in func_convert_core_msys_to_w32_result.
 func_convert_core_msys_to_w32 ()
 {
-  $opt_debug
+  $debug_cmd
+
   # awkward: cmd appends spaces to result
   func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
-    $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
+    $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`
 }
 #end: func_convert_core_msys_to_w32
 
@@ -1588,13 +2758,14 @@
 # func_to_host_file_result to ARG1).
 func_convert_file_check ()
 {
-  $opt_debug
-  if test -z "$2" && test -n "$1" ; then
+  $debug_cmd
+
+  if test -z "$2" && test -n "$1"; then
     func_error "Could not determine host file name corresponding to"
-    func_error "  \`$1'"
+    func_error "  '$1'"
     func_error "Continuing, but uninstalled executables may not work."
     # Fallback:
-    func_to_host_file_result="$1"
+    func_to_host_file_result=$1
   fi
 }
 # end func_convert_file_check
@@ -1606,10 +2777,11 @@
 # func_to_host_file_result to a simplistic fallback value (see below).
 func_convert_path_check ()
 {
-  $opt_debug
+  $debug_cmd
+
   if test -z "$4" && test -n "$3"; then
     func_error "Could not determine the host path corresponding to"
-    func_error "  \`$3'"
+    func_error "  '$3'"
     func_error "Continuing, but uninstalled executables may not work."
     # Fallback.  This is a deliberately simplistic "conversion" and
     # should not be "improved".  See libtool.info.
@@ -1618,7 +2790,7 @@
       func_to_host_path_result=`echo "$3" |
         $SED -e "$lt_replace_pathsep_chars"`
     else
-      func_to_host_path_result="$3"
+      func_to_host_path_result=$3
     fi
   fi
 }
@@ -1630,9 +2802,10 @@
 # and appending REPL if ORIG matches BACKPAT.
 func_convert_path_front_back_pathsep ()
 {
-  $opt_debug
+  $debug_cmd
+
   case $4 in
-  $1 ) func_to_host_path_result="$3$func_to_host_path_result"
+  $1 ) func_to_host_path_result=$3$func_to_host_path_result
     ;;
   esac
   case $4 in
@@ -1646,7 +2819,7 @@
 ##################################################
 # $build to $host FILE NAME CONVERSION FUNCTIONS #
 ##################################################
-# invoked via `$to_host_file_cmd ARG'
+# invoked via '$to_host_file_cmd ARG'
 #
 # In each case, ARG is the path to be converted from $build to $host format.
 # Result will be available in $func_to_host_file_result.
@@ -1657,7 +2830,8 @@
 # in func_to_host_file_result.
 func_to_host_file ()
 {
-  $opt_debug
+  $debug_cmd
+
   $to_host_file_cmd "$1"
 }
 # end func_to_host_file
@@ -1669,7 +2843,8 @@
 # in (the comma separated) LAZY, no conversion takes place.
 func_to_tool_file ()
 {
-  $opt_debug
+  $debug_cmd
+
   case ,$2, in
     *,"$to_tool_file_cmd",*)
       func_to_tool_file_result=$1
@@ -1687,7 +2862,7 @@
 # Copy ARG to func_to_host_file_result.
 func_convert_file_noop ()
 {
-  func_to_host_file_result="$1"
+  func_to_host_file_result=$1
 }
 # end func_convert_file_noop
 
@@ -1698,11 +2873,12 @@
 # func_to_host_file_result.
 func_convert_file_msys_to_w32 ()
 {
-  $opt_debug
-  func_to_host_file_result="$1"
+  $debug_cmd
+
+  func_to_host_file_result=$1
   if test -n "$1"; then
     func_convert_core_msys_to_w32 "$1"
-    func_to_host_file_result="$func_convert_core_msys_to_w32_result"
+    func_to_host_file_result=$func_convert_core_msys_to_w32_result
   fi
   func_convert_file_check "$1" "$func_to_host_file_result"
 }
@@ -1714,8 +2890,9 @@
 # func_to_host_file_result.
 func_convert_file_cygwin_to_w32 ()
 {
-  $opt_debug
-  func_to_host_file_result="$1"
+  $debug_cmd
+
+  func_to_host_file_result=$1
   if test -n "$1"; then
     # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
     # LT_CYGPATH in this case.
@@ -1731,11 +2908,12 @@
 # and a working winepath. Returns result in func_to_host_file_result.
 func_convert_file_nix_to_w32 ()
 {
-  $opt_debug
-  func_to_host_file_result="$1"
+  $debug_cmd
+
+  func_to_host_file_result=$1
   if test -n "$1"; then
     func_convert_core_file_wine_to_w32 "$1"
-    func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
+    func_to_host_file_result=$func_convert_core_file_wine_to_w32_result
   fi
   func_convert_file_check "$1" "$func_to_host_file_result"
 }
@@ -1747,12 +2925,13 @@
 # Returns result in func_to_host_file_result.
 func_convert_file_msys_to_cygwin ()
 {
-  $opt_debug
-  func_to_host_file_result="$1"
+  $debug_cmd
+
+  func_to_host_file_result=$1
   if test -n "$1"; then
     func_convert_core_msys_to_w32 "$1"
     func_cygpath -u "$func_convert_core_msys_to_w32_result"
-    func_to_host_file_result="$func_cygpath_result"
+    func_to_host_file_result=$func_cygpath_result
   fi
   func_convert_file_check "$1" "$func_to_host_file_result"
 }
@@ -1765,13 +2944,14 @@
 # in func_to_host_file_result.
 func_convert_file_nix_to_cygwin ()
 {
-  $opt_debug
-  func_to_host_file_result="$1"
+  $debug_cmd
+
+  func_to_host_file_result=$1
   if test -n "$1"; then
     # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
     func_convert_core_file_wine_to_w32 "$1"
     func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
-    func_to_host_file_result="$func_cygpath_result"
+    func_to_host_file_result=$func_cygpath_result
   fi
   func_convert_file_check "$1" "$func_to_host_file_result"
 }
@@ -1781,7 +2961,7 @@
 #############################################
 # $build to $host PATH CONVERSION FUNCTIONS #
 #############################################
-# invoked via `$to_host_path_cmd ARG'
+# invoked via '$to_host_path_cmd ARG'
 #
 # In each case, ARG is the path to be converted from $build to $host format.
 # The result will be available in $func_to_host_path_result.
@@ -1805,10 +2985,11 @@
 to_host_path_cmd=
 func_init_to_host_path_cmd ()
 {
-  $opt_debug
+  $debug_cmd
+
   if test -z "$to_host_path_cmd"; then
     func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
-    to_host_path_cmd="func_convert_path_${func_stripname_result}"
+    to_host_path_cmd=func_convert_path_$func_stripname_result
   fi
 }
 
@@ -1818,7 +2999,8 @@
 # in func_to_host_path_result.
 func_to_host_path ()
 {
-  $opt_debug
+  $debug_cmd
+
   func_init_to_host_path_cmd
   $to_host_path_cmd "$1"
 }
@@ -1829,7 +3011,7 @@
 # Copy ARG to func_to_host_path_result.
 func_convert_path_noop ()
 {
-  func_to_host_path_result="$1"
+  func_to_host_path_result=$1
 }
 # end func_convert_path_noop
 
@@ -1840,8 +3022,9 @@
 # func_to_host_path_result.
 func_convert_path_msys_to_w32 ()
 {
-  $opt_debug
-  func_to_host_path_result="$1"
+  $debug_cmd
+
+  func_to_host_path_result=$1
   if test -n "$1"; then
     # Remove leading and trailing path separator characters from ARG.  MSYS
     # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
@@ -1849,7 +3032,7 @@
     func_stripname : : "$1"
     func_to_host_path_tmp1=$func_stripname_result
     func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
-    func_to_host_path_result="$func_convert_core_msys_to_w32_result"
+    func_to_host_path_result=$func_convert_core_msys_to_w32_result
     func_convert_path_check : ";" \
       "$func_to_host_path_tmp1" "$func_to_host_path_result"
     func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
@@ -1863,8 +3046,9 @@
 # func_to_host_file_result.
 func_convert_path_cygwin_to_w32 ()
 {
-  $opt_debug
-  func_to_host_path_result="$1"
+  $debug_cmd
+
+  func_to_host_path_result=$1
   if test -n "$1"; then
     # See func_convert_path_msys_to_w32:
     func_stripname : : "$1"
@@ -1883,14 +3067,15 @@
 # a working winepath.  Returns result in func_to_host_file_result.
 func_convert_path_nix_to_w32 ()
 {
-  $opt_debug
-  func_to_host_path_result="$1"
+  $debug_cmd
+
+  func_to_host_path_result=$1
   if test -n "$1"; then
     # See func_convert_path_msys_to_w32:
     func_stripname : : "$1"
     func_to_host_path_tmp1=$func_stripname_result
     func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
-    func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
+    func_to_host_path_result=$func_convert_core_path_wine_to_w32_result
     func_convert_path_check : ";" \
       "$func_to_host_path_tmp1" "$func_to_host_path_result"
     func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
@@ -1904,15 +3089,16 @@
 # Returns result in func_to_host_file_result.
 func_convert_path_msys_to_cygwin ()
 {
-  $opt_debug
-  func_to_host_path_result="$1"
+  $debug_cmd
+
+  func_to_host_path_result=$1
   if test -n "$1"; then
     # See func_convert_path_msys_to_w32:
     func_stripname : : "$1"
     func_to_host_path_tmp1=$func_stripname_result
     func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
     func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
-    func_to_host_path_result="$func_cygpath_result"
+    func_to_host_path_result=$func_cygpath_result
     func_convert_path_check : : \
       "$func_to_host_path_tmp1" "$func_to_host_path_result"
     func_convert_path_front_back_pathsep ":*" "*:" : "$1"
@@ -1927,8 +3113,9 @@
 # func_to_host_file_result.
 func_convert_path_nix_to_cygwin ()
 {
-  $opt_debug
-  func_to_host_path_result="$1"
+  $debug_cmd
+
+  func_to_host_path_result=$1
   if test -n "$1"; then
     # Remove leading and trailing path separator characters from
     # ARG. msys behavior is inconsistent here, cygpath turns them
@@ -1937,7 +3124,7 @@
     func_to_host_path_tmp1=$func_stripname_result
     func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
     func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
-    func_to_host_path_result="$func_cygpath_result"
+    func_to_host_path_result=$func_cygpath_result
     func_convert_path_check : : \
       "$func_to_host_path_tmp1" "$func_to_host_path_result"
     func_convert_path_front_back_pathsep ":*" "*:" : "$1"
@@ -1946,13 +3133,31 @@
 # end func_convert_path_nix_to_cygwin
 
 
+# func_dll_def_p FILE
+# True iff FILE is a Windows DLL '.def' file.
+# Keep in sync with _LT_DLL_DEF_P in libtool.m4
+func_dll_def_p ()
+{
+  $debug_cmd
+
+  func_dll_def_p_tmp=`$SED -n \
+    -e 's/^[	 ]*//' \
+    -e '/^\(;.*\)*$/d' \
+    -e 's/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p' \
+    -e q \
+    "$1"`
+  test DEF = "$func_dll_def_p_tmp"
+}
+
+
 # func_mode_compile arg...
 func_mode_compile ()
 {
-    $opt_debug
+    $debug_cmd
+
     # Get the compilation command and the source file.
     base_compile=
-    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
+    srcfile=$nonopt  #  always keep a non-empty value in "srcfile"
     suppress_opt=yes
     suppress_output=
     arg_mode=normal
@@ -1965,12 +3170,12 @@
       case $arg_mode in
       arg  )
 	# do not "continue".  Instead, add this to base_compile
-	lastarg="$arg"
+	lastarg=$arg
 	arg_mode=normal
 	;;
 
       target )
-	libobj="$arg"
+	libobj=$arg
 	arg_mode=normal
 	continue
 	;;
@@ -1980,7 +3185,7 @@
 	case $arg in
 	-o)
 	  test -n "$libobj" && \
-	    func_fatal_error "you cannot specify \`-o' more than once"
+	    func_fatal_error "you cannot specify '-o' more than once"
 	  arg_mode=target
 	  continue
 	  ;;
@@ -2009,12 +3214,12 @@
 	  func_stripname '-Wc,' '' "$arg"
 	  args=$func_stripname_result
 	  lastarg=
-	  save_ifs="$IFS"; IFS=','
+	  save_ifs=$IFS; IFS=,
 	  for arg in $args; do
-	    IFS="$save_ifs"
+	    IFS=$save_ifs
 	    func_append_quoted lastarg "$arg"
 	  done
-	  IFS="$save_ifs"
+	  IFS=$save_ifs
 	  func_stripname ' ' '' "$lastarg"
 	  lastarg=$func_stripname_result
 
@@ -2027,8 +3232,8 @@
 	  # Accept the current argument as the source file.
 	  # The previous "srcfile" becomes the current argument.
 	  #
-	  lastarg="$srcfile"
-	  srcfile="$arg"
+	  lastarg=$srcfile
+	  srcfile=$arg
 	  ;;
 	esac  #  case $arg
 	;;
@@ -2043,13 +3248,13 @@
       func_fatal_error "you must specify an argument for -Xcompile"
       ;;
     target)
-      func_fatal_error "you must specify a target with \`-o'"
+      func_fatal_error "you must specify a target with '-o'"
       ;;
     *)
       # Get the name of the library object.
       test -z "$libobj" && {
 	func_basename "$srcfile"
-	libobj="$func_basename_result"
+	libobj=$func_basename_result
       }
       ;;
     esac
@@ -2069,7 +3274,7 @@
     case $libobj in
     *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
     *)
-      func_fatal_error "cannot determine name of library object from \`$libobj'"
+      func_fatal_error "cannot determine name of library object from '$libobj'"
       ;;
     esac
 
@@ -2078,8 +3283,8 @@
     for arg in $later; do
       case $arg in
       -shared)
-	test "$build_libtool_libs" != yes && \
-	  func_fatal_configuration "can not build a shared library"
+	test yes = "$build_libtool_libs" \
+	  || func_fatal_configuration "cannot build a shared library"
 	build_old_libs=no
 	continue
 	;;
@@ -2105,17 +3310,17 @@
     func_quote_for_eval "$libobj"
     test "X$libobj" != "X$func_quote_for_eval_result" \
       && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'	 &()|`$[]' \
-      && func_warning "libobj name \`$libobj' may not contain shell special characters."
+      && func_warning "libobj name '$libobj' may not contain shell special characters."
     func_dirname_and_basename "$obj" "/" ""
-    objname="$func_basename_result"
-    xdir="$func_dirname_result"
-    lobj=${xdir}$objdir/$objname
+    objname=$func_basename_result
+    xdir=$func_dirname_result
+    lobj=$xdir$objdir/$objname
 
     test -z "$base_compile" && \
       func_fatal_help "you must specify a compilation command"
 
     # Delete any leftover library objects.
-    if test "$build_old_libs" = yes; then
+    if test yes = "$build_old_libs"; then
       removelist="$obj $lobj $libobj ${libobj}T"
     else
       removelist="$lobj $libobj ${libobj}T"
@@ -2127,16 +3332,16 @@
       pic_mode=default
       ;;
     esac
-    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
+    if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then
       # non-PIC code in shared libraries is not supported
       pic_mode=default
     fi
 
     # Calculate the filename of the output object if compiler does
     # not support -o with -c
-    if test "$compiler_c_o" = no; then
-      output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
-      lockfile="$output_obj.lock"
+    if test no = "$compiler_c_o"; then
+      output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext
+      lockfile=$output_obj.lock
     else
       output_obj=
       need_locks=no
@@ -2145,12 +3350,12 @@
 
     # Lock this critical section if it is needed
     # We use this script file to make the link, it avoids creating a new file
-    if test "$need_locks" = yes; then
+    if test yes = "$need_locks"; then
       until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
 	func_echo "Waiting for $lockfile to be removed"
 	sleep 2
       done
-    elif test "$need_locks" = warn; then
+    elif test warn = "$need_locks"; then
       if test -f "$lockfile"; then
 	$ECHO "\
 *** ERROR, $lockfile exists and contains:
@@ -2158,7 +3363,7 @@
 
 This indicates that another process is trying to use the same
 temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together.  If you
+your compiler does not support '-c' and '-o' together.  If you
 repeat this compilation, it may succeed, by chance, but you had better
 avoid parallel builds (make -j) in this platform, or get a better
 compiler."
@@ -2180,11 +3385,11 @@
     qsrcfile=$func_quote_for_eval_result
 
     # Only build a PIC object if we are building libtool libraries.
-    if test "$build_libtool_libs" = yes; then
+    if test yes = "$build_libtool_libs"; then
       # Without this assignment, base_compile gets emptied.
       fbsd_hideous_sh_bug=$base_compile
 
-      if test "$pic_mode" != no; then
+      if test no != "$pic_mode"; then
 	command="$base_compile $qsrcfile $pic_flag"
       else
 	# Don't build PIC code
@@ -2201,7 +3406,7 @@
       func_show_eval_locale "$command"	\
           'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
 
-      if test "$need_locks" = warn &&
+      if test warn = "$need_locks" &&
 	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
 	$ECHO "\
 *** ERROR, $lockfile contains:
@@ -2212,7 +3417,7 @@
 
 This indicates that another process is trying to use the same
 temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together.  If you
+your compiler does not support '-c' and '-o' together.  If you
 repeat this compilation, it may succeed, by chance, but you had better
 avoid parallel builds (make -j) in this platform, or get a better
 compiler."
@@ -2228,20 +3433,20 @@
       fi
 
       # Allow error messages only from the first compilation.
-      if test "$suppress_opt" = yes; then
+      if test yes = "$suppress_opt"; then
 	suppress_output=' >/dev/null 2>&1'
       fi
     fi
 
     # Only build a position-dependent object if we build old libraries.
-    if test "$build_old_libs" = yes; then
-      if test "$pic_mode" != yes; then
+    if test yes = "$build_old_libs"; then
+      if test yes != "$pic_mode"; then
 	# Don't build PIC code
 	command="$base_compile $qsrcfile$pie_flag"
       else
 	command="$base_compile $qsrcfile $pic_flag"
       fi
-      if test "$compiler_c_o" = yes; then
+      if test yes = "$compiler_c_o"; then
 	func_append command " -o $obj"
       fi
 
@@ -2250,7 +3455,7 @@
       func_show_eval_locale "$command" \
         '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
 
-      if test "$need_locks" = warn &&
+      if test warn = "$need_locks" &&
 	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
 	$ECHO "\
 *** ERROR, $lockfile contains:
@@ -2261,7 +3466,7 @@
 
 This indicates that another process is trying to use the same
 temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together.  If you
+your compiler does not support '-c' and '-o' together.  If you
 repeat this compilation, it may succeed, by chance, but you had better
 avoid parallel builds (make -j) in this platform, or get a better
 compiler."
@@ -2281,7 +3486,7 @@
       func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
 
       # Unlock the critical section if it was locked
-      if test "$need_locks" != no; then
+      if test no != "$need_locks"; then
 	removelist=$lockfile
         $RM "$lockfile"
       fi
@@ -2291,7 +3496,7 @@
 }
 
 $opt_help || {
-  test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
+  test compile = "$opt_mode" && func_mode_compile ${1+"$@"}
 }
 
 func_mode_help ()
@@ -2311,7 +3516,7 @@
 Remove files from the build directory.
 
 RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+(typically '/bin/rm').  RM-OPTIONS are options (such as '-f') to be passed
 to RM.
 
 If FILE is a libtool library, object or program, all the files associated
@@ -2330,16 +3535,16 @@
   -no-suppress      do not suppress compiler output for multiple passes
   -prefer-pic       try to build PIC objects only
   -prefer-non-pic   try to build non-PIC objects only
-  -shared           do not build a \`.o' file suitable for static linking
-  -static           only build a \`.o' file suitable for static linking
+  -shared           do not build a '.o' file suitable for static linking
+  -static           only build a '.o' file suitable for static linking
   -Wc,FLAG          pass FLAG directly to the compiler
 
-COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+COMPILE-COMMAND is a command to be used in creating a 'standard' object file
 from the given SOURCEFILE.
 
 The output file name is determined by removing the directory component from
-SOURCEFILE, then substituting the C source code suffix \`.c' with the
-library object suffix, \`.lo'."
+SOURCEFILE, then substituting the C source code suffix '.c' with the
+library object suffix, '.lo'."
         ;;
 
       execute)
@@ -2352,7 +3557,7 @@
 
   -dlopen FILE      add the directory containing FILE to the library path
 
-This mode sets the library path environment variable according to \`-dlopen'
+This mode sets the library path environment variable according to '-dlopen'
 flags.
 
 If any of the ARGS are libtool executable wrappers, then they are translated
@@ -2371,7 +3576,7 @@
 Each LIBDIR is a directory that contains libtool libraries.
 
 The commands that this mode executes may require superuser privileges.  Use
-the \`--dry-run' option if you just want to see what would be executed."
+the '--dry-run' option if you just want to see what would be executed."
         ;;
 
       install)
@@ -2381,7 +3586,7 @@
 Install executables or libraries.
 
 INSTALL-COMMAND is the installation command.  The first component should be
-either the \`install' or \`cp' program.
+either the 'install' or 'cp' program.
 
 The following components of INSTALL-COMMAND are treated specially:
 
@@ -2407,7 +3612,7 @@
   -avoid-version    do not add a version suffix if possible
   -bindir BINDIR    specify path to binaries directory (for systems where
                     libraries must be found in the PATH setting at runtime)
-  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
+  -dlopen FILE      '-dlpreopen' FILE if it cannot be dlopened at runtime
   -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
   -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
   -export-symbols SYMFILE
@@ -2441,20 +3646,20 @@
   -Xlinker FLAG     pass linker-specific FLAG directly to the linker
   -XCClinker FLAG   pass link-specific FLAG to the compiler driver (CC)
 
-All other options (arguments beginning with \`-') are ignored.
+All other options (arguments beginning with '-') are ignored.
 
-Every other argument is treated as a filename.  Files ending in \`.la' are
+Every other argument is treated as a filename.  Files ending in '.la' are
 treated as uninstalled libtool libraries, other files are standard or library
 object files.
 
-If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
-only library objects (\`.lo' files) may be specified, and \`-rpath' is
+If the OUTPUT-FILE ends in '.la', then a libtool library is created,
+only library objects ('.lo' files) may be specified, and '-rpath' is
 required, except when creating a convenience library.
 
-If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
-using \`ar' and \`ranlib', or on Windows using \`lib'.
+If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created
+using 'ar' and 'ranlib', or on Windows using 'lib'.
 
-If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file
 is created, otherwise an executable program is created."
         ;;
 
@@ -2465,7 +3670,7 @@
 Remove libraries from an installation directory.
 
 RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+(typically '/bin/rm').  RM-OPTIONS are options (such as '-f') to be passed
 to RM.
 
 If FILE is a libtool library, all the files associated with it are deleted.
@@ -2473,17 +3678,17 @@
         ;;
 
       *)
-        func_fatal_help "invalid operation mode \`$opt_mode'"
+        func_fatal_help "invalid operation mode '$opt_mode'"
         ;;
     esac
 
     echo
-    $ECHO "Try \`$progname --help' for more information about other modes."
+    $ECHO "Try '$progname --help' for more information about other modes."
 }
 
 # Now that we've collected a possible --mode arg, show help if necessary
 if $opt_help; then
-  if test "$opt_help" = :; then
+  if test : = "$opt_help"; then
     func_mode_help
   else
     {
@@ -2516,16 +3721,17 @@
 # func_mode_execute arg...
 func_mode_execute ()
 {
-    $opt_debug
+    $debug_cmd
+
     # The first argument is the command name.
-    cmd="$nonopt"
+    cmd=$nonopt
     test -z "$cmd" && \
       func_fatal_help "you must specify a COMMAND"
 
     # Handle -dlopen flags immediately.
     for file in $opt_dlopen; do
       test -f "$file" \
-	|| func_fatal_help "\`$file' is not a file"
+	|| func_fatal_help "'$file' is not a file"
 
       dir=
       case $file in
@@ -2535,7 +3741,7 @@
 
 	# Check to see that this really is a libtool archive.
 	func_lalib_unsafe_p "$file" \
-	  || func_fatal_help "\`$lib' is not a valid libtool archive"
+	  || func_fatal_help "'$lib' is not a valid libtool archive"
 
 	# Read the libtool library.
 	dlname=
@@ -2546,18 +3752,18 @@
 	if test -z "$dlname"; then
 	  # Warn if it was a shared library.
 	  test -n "$library_names" && \
-	    func_warning "\`$file' was not linked with \`-export-dynamic'"
+	    func_warning "'$file' was not linked with '-export-dynamic'"
 	  continue
 	fi
 
 	func_dirname "$file" "" "."
-	dir="$func_dirname_result"
+	dir=$func_dirname_result
 
 	if test -f "$dir/$objdir/$dlname"; then
 	  func_append dir "/$objdir"
 	else
 	  if test ! -f "$dir/$dlname"; then
-	    func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
+	    func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'"
 	  fi
 	fi
 	;;
@@ -2565,18 +3771,18 @@
       *.lo)
 	# Just add the directory containing the .lo file.
 	func_dirname "$file" "" "."
-	dir="$func_dirname_result"
+	dir=$func_dirname_result
 	;;
 
       *)
-	func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
+	func_warning "'-dlopen' is ignored for non-libtool libraries and objects"
 	continue
 	;;
       esac
 
       # Get the absolute pathname.
       absdir=`cd "$dir" && pwd`
-      test -n "$absdir" && dir="$absdir"
+      test -n "$absdir" && dir=$absdir
 
       # Now add the directory to shlibpath_var.
       if eval "test -z \"\$$shlibpath_var\""; then
@@ -2588,7 +3794,7 @@
 
     # This variable tells wrapper scripts just to set shlibpath_var
     # rather than running their programs.
-    libtool_execute_magic="$magic"
+    libtool_execute_magic=$magic
 
     # Check if any of the arguments is a wrapper script.
     args=
@@ -2601,12 +3807,12 @@
 	if func_ltwrapper_script_p "$file"; then
 	  func_source "$file"
 	  # Transform arg to wrapped name.
-	  file="$progdir/$program"
+	  file=$progdir/$program
 	elif func_ltwrapper_executable_p "$file"; then
 	  func_ltwrapper_scriptname "$file"
 	  func_source "$func_ltwrapper_scriptname_result"
 	  # Transform arg to wrapped name.
-	  file="$progdir/$program"
+	  file=$progdir/$program
 	fi
 	;;
       esac
@@ -2614,7 +3820,15 @@
       func_append_quoted args "$file"
     done
 
-    if test "X$opt_dry_run" = Xfalse; then
+    if $opt_dry_run; then
+      # Display what would be done.
+      if test -n "$shlibpath_var"; then
+	eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
+	echo "export $shlibpath_var"
+      fi
+      $ECHO "$cmd$args"
+      exit $EXIT_SUCCESS
+    else
       if test -n "$shlibpath_var"; then
 	# Export the shlibpath_var.
 	eval "export $shlibpath_var"
@@ -2631,25 +3845,18 @@
       done
 
       # Now prepare to actually exec the command.
-      exec_cmd="\$cmd$args"
-    else
-      # Display what would be done.
-      if test -n "$shlibpath_var"; then
-	eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
-	echo "export $shlibpath_var"
-      fi
-      $ECHO "$cmd$args"
-      exit $EXIT_SUCCESS
+      exec_cmd=\$cmd$args
     fi
 }
 
-test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
+test execute = "$opt_mode" && func_mode_execute ${1+"$@"}
 
 
 # func_mode_finish arg...
 func_mode_finish ()
 {
-    $opt_debug
+    $debug_cmd
+
     libs=
     libdirs=
     admincmds=
@@ -2663,11 +3870,11 @@
 	if func_lalib_unsafe_p "$opt"; then
 	  func_append libs " $opt"
 	else
-	  func_warning "\`$opt' is not a valid libtool archive"
+	  func_warning "'$opt' is not a valid libtool archive"
 	fi
 
       else
-	func_fatal_error "invalid argument \`$opt'"
+	func_fatal_error "invalid argument '$opt'"
       fi
     done
 
@@ -2682,12 +3889,12 @@
       # Remove sysroot references
       if $opt_dry_run; then
         for lib in $libs; do
-          echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
+          echo "removing references to $lt_sysroot and '=' prefixes from $lib"
         done
       else
         tmpdir=`func_mktempdir`
         for lib in $libs; do
-	  sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
+	  sed -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
 	    > $tmpdir/tmp-la
 	  mv -f $tmpdir/tmp-la $lib
 	done
@@ -2712,7 +3919,7 @@
     fi
 
     # Exit here if they wanted silent mode.
-    $opt_silent && exit $EXIT_SUCCESS
+    $opt_quiet && exit $EXIT_SUCCESS
 
     if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
       echo "----------------------------------------------------------------------"
@@ -2723,27 +3930,27 @@
       echo
       echo "If you ever happen to want to link against installed libraries"
       echo "in a given directory, LIBDIR, you must either use libtool, and"
-      echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+      echo "specify the full pathname of the library, or use the '-LLIBDIR'"
       echo "flag during linking and do at least one of the following:"
       if test -n "$shlibpath_var"; then
-	echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
+	echo "   - add LIBDIR to the '$shlibpath_var' environment variable"
 	echo "     during execution"
       fi
       if test -n "$runpath_var"; then
-	echo "   - add LIBDIR to the \`$runpath_var' environment variable"
+	echo "   - add LIBDIR to the '$runpath_var' environment variable"
 	echo "     during linking"
       fi
       if test -n "$hardcode_libdir_flag_spec"; then
 	libdir=LIBDIR
 	eval flag=\"$hardcode_libdir_flag_spec\"
 
-	$ECHO "   - use the \`$flag' linker flag"
+	$ECHO "   - use the '$flag' linker flag"
       fi
       if test -n "$admincmds"; then
 	$ECHO "   - have your system administrator run these commands:$admincmds"
       fi
       if test -f /etc/ld.so.conf; then
-	echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+	echo "   - have your system administrator add LIBDIR to '/etc/ld.so.conf'"
       fi
       echo
 
@@ -2762,18 +3969,20 @@
     exit $EXIT_SUCCESS
 }
 
-test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
+test finish = "$opt_mode" && func_mode_finish ${1+"$@"}
 
 
 # func_mode_install arg...
 func_mode_install ()
 {
-    $opt_debug
+    $debug_cmd
+
     # There may be an optional sh(1) argument at the beginning of
     # install_prog (especially on Windows NT).
-    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+    if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" ||
        # Allow the use of GNU shtool's install command.
-       case $nonopt in *shtool*) :;; *) false;; esac; then
+       case $nonopt in *shtool*) :;; *) false;; esac
+    then
       # Aesthetically quote it.
       func_quote_for_eval "$nonopt"
       install_prog="$func_quote_for_eval_result "
@@ -2800,7 +4009,7 @@
     opts=
     prev=
     install_type=
-    isdir=no
+    isdir=false
     stripme=
     no_mode=:
     for arg
@@ -2813,7 +4022,7 @@
       fi
 
       case $arg in
-      -d) isdir=yes ;;
+      -d) isdir=: ;;
       -f)
 	if $install_cp; then :; else
 	  prev=$arg
@@ -2831,7 +4040,7 @@
       *)
 	# If the previous option needed an argument, then skip it.
 	if test -n "$prev"; then
-	  if test "x$prev" = x-m && test -n "$install_override_mode"; then
+	  if test X-m = "X$prev" && test -n "$install_override_mode"; then
 	    arg2=$install_override_mode
 	    no_mode=false
 	  fi
@@ -2856,7 +4065,7 @@
       func_fatal_help "you must specify an install program"
 
     test -n "$prev" && \
-      func_fatal_help "the \`$prev' option requires an argument"
+      func_fatal_help "the '$prev' option requires an argument"
 
     if test -n "$install_override_mode" && $no_mode; then
       if $install_cp; then :; else
@@ -2878,19 +4087,19 @@
     dest=$func_stripname_result
 
     # Check to see that the destination is a directory.
-    test -d "$dest" && isdir=yes
-    if test "$isdir" = yes; then
-      destdir="$dest"
+    test -d "$dest" && isdir=:
+    if $isdir; then
+      destdir=$dest
       destname=
     else
       func_dirname_and_basename "$dest" "" "."
-      destdir="$func_dirname_result"
-      destname="$func_basename_result"
+      destdir=$func_dirname_result
+      destname=$func_basename_result
 
       # Not a directory, so check to see that there is only one file specified.
       set dummy $files; shift
       test "$#" -gt 1 && \
-	func_fatal_help "\`$dest' is not a directory"
+	func_fatal_help "'$dest' is not a directory"
     fi
     case $destdir in
     [\\/]* | [A-Za-z]:[\\/]*) ;;
@@ -2899,7 +4108,7 @@
 	case $file in
 	*.lo) ;;
 	*)
-	  func_fatal_help "\`$destdir' must be an absolute directory name"
+	  func_fatal_help "'$destdir' must be an absolute directory name"
 	  ;;
 	esac
       done
@@ -2908,7 +4117,7 @@
 
     # This variable tells wrapper scripts just to set variables rather
     # than running their programs.
-    libtool_install_magic="$magic"
+    libtool_install_magic=$magic
 
     staticlibs=
     future_libdirs=
@@ -2928,7 +4137,7 @@
 
 	# Check to see that this really is a libtool archive.
 	func_lalib_unsafe_p "$file" \
-	  || func_fatal_help "\`$file' is not a valid libtool archive"
+	  || func_fatal_help "'$file' is not a valid libtool archive"
 
 	library_names=
 	old_library=
@@ -2950,7 +4159,7 @@
 	fi
 
 	func_dirname "$file" "/" ""
-	dir="$func_dirname_result"
+	dir=$func_dirname_result
 	func_append dir "$objdir"
 
 	if test -n "$relink_command"; then
@@ -2964,7 +4173,7 @@
 	  # are installed into $libdir/../bin (currently, that works fine)
 	  # but it's something to keep an eye on.
 	  test "$inst_prefix_dir" = "$destdir" && \
-	    func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
+	    func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir"
 
 	  if test -n "$inst_prefix_dir"; then
 	    # Stick the inst_prefix_dir data into the link command.
@@ -2973,29 +4182,29 @@
 	    relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
 	  fi
 
-	  func_warning "relinking \`$file'"
+	  func_warning "relinking '$file'"
 	  func_show_eval "$relink_command" \
-	    'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
+	    'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"'
 	fi
 
 	# See the names of the shared library.
 	set dummy $library_names; shift
 	if test -n "$1"; then
-	  realname="$1"
+	  realname=$1
 	  shift
 
-	  srcname="$realname"
-	  test -n "$relink_command" && srcname="$realname"T
+	  srcname=$realname
+	  test -n "$relink_command" && srcname=${realname}T
 
 	  # Install the shared library and build the symlinks.
 	  func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
 	      'exit $?'
-	  tstripme="$stripme"
+	  tstripme=$stripme
 	  case $host_os in
 	  cygwin* | mingw* | pw32* | cegcc*)
 	    case $realname in
 	    *.dll.a)
-	      tstripme=""
+	      tstripme=
 	      ;;
 	    esac
 	    ;;
@@ -3006,7 +4215,7 @@
 
 	  if test "$#" -gt 0; then
 	    # Delete the old symlinks, and create new ones.
-	    # Try `ln -sf' first, because the `ln' binary might depend on
+	    # Try 'ln -sf' first, because the 'ln' binary might depend on
 	    # the symlink we replace!  Solaris /bin/ln does not understand -f,
 	    # so we also need to try rm && ln -s.
 	    for linkname
@@ -3017,14 +4226,14 @@
 	  fi
 
 	  # Do each command in the postinstall commands.
-	  lib="$destdir/$realname"
+	  lib=$destdir/$realname
 	  func_execute_cmds "$postinstall_cmds" 'exit $?'
 	fi
 
 	# Install the pseudo-library for information purposes.
 	func_basename "$file"
-	name="$func_basename_result"
-	instname="$dir/$name"i
+	name=$func_basename_result
+	instname=$dir/${name}i
 	func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
 
 	# Maybe install the static library, too.
@@ -3036,11 +4245,11 @@
 
 	# Figure out destination file name, if it wasn't already specified.
 	if test -n "$destname"; then
-	  destfile="$destdir/$destname"
+	  destfile=$destdir/$destname
 	else
 	  func_basename "$file"
-	  destfile="$func_basename_result"
-	  destfile="$destdir/$destfile"
+	  destfile=$func_basename_result
+	  destfile=$destdir/$destfile
 	fi
 
 	# Deduce the name of the destination old-style object file.
@@ -3050,11 +4259,11 @@
 	  staticdest=$func_lo2o_result
 	  ;;
 	*.$objext)
-	  staticdest="$destfile"
+	  staticdest=$destfile
 	  destfile=
 	  ;;
 	*)
-	  func_fatal_help "cannot copy a libtool object to \`$destfile'"
+	  func_fatal_help "cannot copy a libtool object to '$destfile'"
 	  ;;
 	esac
 
@@ -3063,7 +4272,7 @@
 	  func_show_eval "$install_prog $file $destfile" 'exit $?'
 
 	# Install the old object if enabled.
-	if test "$build_old_libs" = yes; then
+	if test yes = "$build_old_libs"; then
 	  # Deduce the name of the old-style object file.
 	  func_lo2o "$file"
 	  staticobj=$func_lo2o_result
@@ -3075,23 +4284,23 @@
       *)
 	# Figure out destination file name, if it wasn't already specified.
 	if test -n "$destname"; then
-	  destfile="$destdir/$destname"
+	  destfile=$destdir/$destname
 	else
 	  func_basename "$file"
-	  destfile="$func_basename_result"
-	  destfile="$destdir/$destfile"
+	  destfile=$func_basename_result
+	  destfile=$destdir/$destfile
 	fi
 
 	# If the file is missing, and there is a .exe on the end, strip it
 	# because it is most likely a libtool script we actually want to
 	# install
-	stripped_ext=""
+	stripped_ext=
 	case $file in
 	  *.exe)
 	    if test ! -f "$file"; then
 	      func_stripname '' '.exe' "$file"
 	      file=$func_stripname_result
-	      stripped_ext=".exe"
+	      stripped_ext=.exe
 	    fi
 	    ;;
 	esac
@@ -3119,19 +4328,19 @@
 
 	  # Check the variables that should have been set.
 	  test -z "$generated_by_libtool_version" && \
-	    func_fatal_error "invalid libtool wrapper script \`$wrapper'"
+	    func_fatal_error "invalid libtool wrapper script '$wrapper'"
 
-	  finalize=yes
+	  finalize=:
 	  for lib in $notinst_deplibs; do
 	    # Check to see that each library is installed.
 	    libdir=
 	    if test -f "$lib"; then
 	      func_source "$lib"
 	    fi
-	    libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
+	    libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'`
 	    if test -n "$libdir" && test ! -f "$libfile"; then
-	      func_warning "\`$lib' has not been installed in \`$libdir'"
-	      finalize=no
+	      func_warning "'$lib' has not been installed in '$libdir'"
+	      finalize=false
 	    fi
 	  done
 
@@ -3139,29 +4348,29 @@
 	  func_source "$wrapper"
 
 	  outputname=
-	  if test "$fast_install" = no && test -n "$relink_command"; then
+	  if test no = "$fast_install" && test -n "$relink_command"; then
 	    $opt_dry_run || {
-	      if test "$finalize" = yes; then
+	      if $finalize; then
 	        tmpdir=`func_mktempdir`
 		func_basename "$file$stripped_ext"
-		file="$func_basename_result"
-	        outputname="$tmpdir/$file"
+		file=$func_basename_result
+	        outputname=$tmpdir/$file
 	        # Replace the output file specification.
 	        relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
 
-	        $opt_silent || {
+	        $opt_quiet || {
 	          func_quote_for_expand "$relink_command"
 		  eval "func_echo $func_quote_for_expand_result"
 	        }
 	        if eval "$relink_command"; then :
 	          else
-		  func_error "error: relink \`$file' with the above command before installing it"
+		  func_error "error: relink '$file' with the above command before installing it"
 		  $opt_dry_run || ${RM}r "$tmpdir"
 		  continue
 	        fi
-	        file="$outputname"
+	        file=$outputname
 	      else
-	        func_warning "cannot relink \`$file'"
+	        func_warning "cannot relink '$file'"
 	      fi
 	    }
 	  else
@@ -3198,10 +4407,10 @@
 
     for file in $staticlibs; do
       func_basename "$file"
-      name="$func_basename_result"
+      name=$func_basename_result
 
       # Set up the ranlib parameters.
-      oldlib="$destdir/$name"
+      oldlib=$destdir/$name
       func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
       tool_oldlib=$func_to_tool_file_result
 
@@ -3216,18 +4425,18 @@
     done
 
     test -n "$future_libdirs" && \
-      func_warning "remember to run \`$progname --finish$future_libdirs'"
+      func_warning "remember to run '$progname --finish$future_libdirs'"
 
     if test -n "$current_libdirs"; then
       # Maybe just do a dry run.
       $opt_dry_run && current_libdirs=" -n$current_libdirs"
-      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+      exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs'
     else
       exit $EXIT_SUCCESS
     fi
 }
 
-test "$opt_mode" = install && func_mode_install ${1+"$@"}
+test install = "$opt_mode" && func_mode_install ${1+"$@"}
 
 
 # func_generate_dlsyms outputname originator pic_p
@@ -3235,16 +4444,17 @@
 # a dlpreopen symbol table.
 func_generate_dlsyms ()
 {
-    $opt_debug
-    my_outputname="$1"
-    my_originator="$2"
-    my_pic_p="${3-no}"
+    $debug_cmd
+
+    my_outputname=$1
+    my_originator=$2
+    my_pic_p=${3-false}
     my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
     my_dlsyms=
 
-    if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+    if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
       if test -n "$NM" && test -n "$global_symbol_pipe"; then
-	my_dlsyms="${my_outputname}S.c"
+	my_dlsyms=${my_outputname}S.c
       else
 	func_error "not configured to extract global symbols from dlpreopened files"
       fi
@@ -3255,7 +4465,7 @@
       "") ;;
       *.c)
 	# Discover the nlist of each of the dlfiles.
-	nlist="$output_objdir/${my_outputname}.nm"
+	nlist=$output_objdir/$my_outputname.nm
 
 	func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
 
@@ -3263,34 +4473,36 @@
 	func_verbose "creating $output_objdir/$my_dlsyms"
 
 	$opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
-/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
-/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
+/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */
+/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */
 
 #ifdef __cplusplus
 extern \"C\" {
 #endif
 
-#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
+#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
 #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
 #endif
 
 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-/* DATA imports from DLLs on WIN32 con't be const, because runtime
+#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
+/* DATA imports from DLLs on WIN32 can't be const, because runtime
    relocations are performed -- see ld's documentation on pseudo-relocs.  */
 # define LT_DLSYM_CONST
-#elif defined(__osf__)
+#elif defined __osf__
 /* This system does not cope well with relocations in const data.  */
 # define LT_DLSYM_CONST
 #else
 # define LT_DLSYM_CONST const
 #endif
 
+#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
+
 /* External symbol declarations for the compiler. */\
 "
 
-	if test "$dlself" = yes; then
-	  func_verbose "generating symbol list for \`$output'"
+	if test yes = "$dlself"; then
+	  func_verbose "generating symbol list for '$output'"
 
 	  $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
 
@@ -3298,7 +4510,7 @@
 	  progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
 	  for progfile in $progfiles; do
 	    func_to_tool_file "$progfile" func_convert_file_msys_to_w32
-	    func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
+	    func_verbose "extracting global C symbols from '$func_to_tool_file_result'"
 	    $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
 	  done
 
@@ -3318,10 +4530,10 @@
 
 	  # Prepare the list of exported symbols
 	  if test -z "$export_symbols"; then
-	    export_symbols="$output_objdir/$outputname.exp"
+	    export_symbols=$output_objdir/$outputname.exp
 	    $opt_dry_run || {
 	      $RM $export_symbols
-	      eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+	      eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
 	      case $host in
 	      *cygwin* | *mingw* | *cegcc* )
                 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
@@ -3331,7 +4543,7 @@
 	    }
 	  else
 	    $opt_dry_run || {
-	      eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+	      eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
 	      eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
 	      eval '$MV "$nlist"T "$nlist"'
 	      case $host in
@@ -3345,22 +4557,22 @@
 	fi
 
 	for dlprefile in $dlprefiles; do
-	  func_verbose "extracting global C symbols from \`$dlprefile'"
+	  func_verbose "extracting global C symbols from '$dlprefile'"
 	  func_basename "$dlprefile"
-	  name="$func_basename_result"
+	  name=$func_basename_result
           case $host in
 	    *cygwin* | *mingw* | *cegcc* )
 	      # if an import library, we need to obtain dlname
 	      if func_win32_import_lib_p "$dlprefile"; then
 	        func_tr_sh "$dlprefile"
 	        eval "curr_lafile=\$libfile_$func_tr_sh_result"
-	        dlprefile_dlbasename=""
+	        dlprefile_dlbasename=
 	        if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
 	          # Use subshell, to avoid clobbering current variable values
 	          dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
-	          if test -n "$dlprefile_dlname" ; then
+	          if test -n "$dlprefile_dlname"; then
 	            func_basename "$dlprefile_dlname"
-	            dlprefile_dlbasename="$func_basename_result"
+	            dlprefile_dlbasename=$func_basename_result
 	          else
 	            # no lafile. user explicitly requested -dlpreopen <import library>.
 	            $sharedlib_from_linklib_cmd "$dlprefile"
@@ -3368,7 +4580,7 @@
 	          fi
 	        fi
 	        $opt_dry_run || {
-	          if test -n "$dlprefile_dlbasename" ; then
+	          if test -n "$dlprefile_dlbasename"; then
 	            eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
 	          else
 	            func_warning "Could not compute DLL name from $name"
@@ -3424,6 +4636,11 @@
 	    echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
 	  fi
 
+	  func_show_eval '$RM "${nlist}I"'
+	  if test -n "$global_symbol_to_import"; then
+	    eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I'
+	  fi
+
 	  echo >> "$output_objdir/$my_dlsyms" "\
 
 /* The mapping between symbol names and symbols.  */
@@ -3432,11 +4649,30 @@
   void *address;
 } lt_dlsymlist;
 extern LT_DLSYM_CONST lt_dlsymlist
-lt_${my_prefix}_LTX_preloaded_symbols[];
+lt_${my_prefix}_LTX_preloaded_symbols[];\
+"
+
+	  if test -s "$nlist"I; then
+	    echo >> "$output_objdir/$my_dlsyms" "\
+static void lt_syminit(void)
+{
+  LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols;
+  for (; symbol->name; ++symbol)
+    {"
+	    $SED 's/.*/      if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms"
+	    echo >> "$output_objdir/$my_dlsyms" "\
+    }
+}"
+	  fi
+	  echo >> "$output_objdir/$my_dlsyms" "\
 LT_DLSYM_CONST lt_dlsymlist
 lt_${my_prefix}_LTX_preloaded_symbols[] =
-{\
-  { \"$my_originator\", (void *) 0 },"
+{ {\"$my_originator\", (void *) 0},"
+
+	  if test -s "$nlist"I; then
+	    echo >> "$output_objdir/$my_dlsyms" "\
+  {\"@INIT@\", (void *) &lt_syminit},"
+	  fi
 
 	  case $need_lib_prefix in
 	  no)
@@ -3478,9 +4714,7 @@
 	  *-*-hpux*)
 	    pic_flag_for_symtable=" $pic_flag"  ;;
 	  *)
-	    if test "X$my_pic_p" != Xno; then
-	      pic_flag_for_symtable=" $pic_flag"
-	    fi
+	    $my_pic_p && pic_flag_for_symtable=" $pic_flag"
 	    ;;
 	  esac
 	  ;;
@@ -3497,10 +4731,10 @@
 	func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
 
 	# Clean up the generated files.
-	func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
+	func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"'
 
 	# Transform the symbol file into the correct name.
-	symfileobj="$output_objdir/${my_outputname}S.$objext"
+	symfileobj=$output_objdir/${my_outputname}S.$objext
 	case $host in
 	*cygwin* | *mingw* | *cegcc* )
 	  if test -f "$output_objdir/$my_outputname.def"; then
@@ -3518,7 +4752,7 @@
 	esac
 	;;
       *)
-	func_fatal_error "unknown suffix for \`$my_dlsyms'"
+	func_fatal_error "unknown suffix for '$my_dlsyms'"
 	;;
       esac
     else
@@ -3532,6 +4766,32 @@
     fi
 }
 
+# func_cygming_gnu_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is a GNU/binutils-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_gnu_implib_p ()
+{
+  $debug_cmd
+
+  func_to_tool_file "$1" func_convert_file_msys_to_w32
+  func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
+  test -n "$func_cygming_gnu_implib_tmp"
+}
+
+# func_cygming_ms_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is an MS-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_ms_implib_p ()
+{
+  $debug_cmd
+
+  func_to_tool_file "$1" func_convert_file_msys_to_w32
+  func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
+  test -n "$func_cygming_ms_implib_tmp"
+}
+
 # func_win32_libid arg
 # return the library type of file 'arg'
 #
@@ -3541,8 +4801,9 @@
 # Despite the name, also deal with 64 bit binaries.
 func_win32_libid ()
 {
-  $opt_debug
-  win32_libid_type="unknown"
+  $debug_cmd
+
+  win32_libid_type=unknown
   win32_fileres=`file -L $1 2>/dev/null`
   case $win32_fileres in
   *ar\ archive\ import\ library*) # definitely import
@@ -3552,16 +4813,29 @@
     # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
     if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
        $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
-      func_to_tool_file "$1" func_convert_file_msys_to_w32
-      win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
-	$SED -n -e '
+      case $nm_interface in
+      "MS dumpbin")
+	if func_cygming_ms_implib_p "$1" ||
+	   func_cygming_gnu_implib_p "$1"
+	then
+	  win32_nmres=import
+	else
+	  win32_nmres=
+	fi
+	;;
+      *)
+	func_to_tool_file "$1" func_convert_file_msys_to_w32
+	win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
+	  $SED -n -e '
 	    1,100{
 		/ I /{
-		    s,.*,import,
+		    s|.*|import|
 		    p
 		    q
 		}
 	    }'`
+	;;
+      esac
       case $win32_nmres in
       import*)  win32_libid_type="x86 archive import";;
       *)        win32_libid_type="x86 archive static";;
@@ -3593,7 +4867,8 @@
 #    $sharedlib_from_linklib_result
 func_cygming_dll_for_implib ()
 {
-  $opt_debug
+  $debug_cmd
+
   sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
 }
 
@@ -3610,7 +4885,8 @@
 # specified import library.
 func_cygming_dll_for_implib_fallback_core ()
 {
-  $opt_debug
+  $debug_cmd
+
   match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
   $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
     $SED '/^Contents of section '"$match_literal"':/{
@@ -3646,8 +4922,8 @@
       /./p' |
     # we now have a list, one entry per line, of the stringified
     # contents of the appropriate section of all members of the
-    # archive which possess that section. Heuristic: eliminate
-    # all those which have a first or second character that is
+    # archive that possess that section. Heuristic: eliminate
+    # all those that have a first or second character that is
     # a '.' (that is, objdump's representation of an unprintable
     # character.) This should work for all archives with less than
     # 0x302f exports -- but will fail for DLLs whose name actually
@@ -3658,30 +4934,6 @@
     $SED -e '/^\./d;/^.\./d;q'
 }
 
-# func_cygming_gnu_implib_p ARG
-# This predicate returns with zero status (TRUE) if
-# ARG is a GNU/binutils-style import library. Returns
-# with nonzero status (FALSE) otherwise.
-func_cygming_gnu_implib_p ()
-{
-  $opt_debug
-  func_to_tool_file "$1" func_convert_file_msys_to_w32
-  func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
-  test -n "$func_cygming_gnu_implib_tmp"
-}
-
-# func_cygming_ms_implib_p ARG
-# This predicate returns with zero status (TRUE) if
-# ARG is an MS-style import library. Returns
-# with nonzero status (FALSE) otherwise.
-func_cygming_ms_implib_p ()
-{
-  $opt_debug
-  func_to_tool_file "$1" func_convert_file_msys_to_w32
-  func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
-  test -n "$func_cygming_ms_implib_tmp"
-}
-
 # func_cygming_dll_for_implib_fallback ARG
 # Platform-specific function to extract the
 # name of the DLL associated with the specified
@@ -3695,16 +4947,17 @@
 #    $sharedlib_from_linklib_result
 func_cygming_dll_for_implib_fallback ()
 {
-  $opt_debug
-  if func_cygming_gnu_implib_p "$1" ; then
+  $debug_cmd
+
+  if func_cygming_gnu_implib_p "$1"; then
     # binutils import library
     sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
-  elif func_cygming_ms_implib_p "$1" ; then
+  elif func_cygming_ms_implib_p "$1"; then
     # ms-generated import library
     sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
   else
     # unknown
-    sharedlib_from_linklib_result=""
+    sharedlib_from_linklib_result=
   fi
 }
 
@@ -3712,10 +4965,11 @@
 # func_extract_an_archive dir oldlib
 func_extract_an_archive ()
 {
-    $opt_debug
-    f_ex_an_ar_dir="$1"; shift
-    f_ex_an_ar_oldlib="$1"
-    if test "$lock_old_archive_extraction" = yes; then
+    $debug_cmd
+
+    f_ex_an_ar_dir=$1; shift
+    f_ex_an_ar_oldlib=$1
+    if test yes = "$lock_old_archive_extraction"; then
       lockfile=$f_ex_an_ar_oldlib.lock
       until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
 	func_echo "Waiting for $lockfile to be removed"
@@ -3724,7 +4978,7 @@
     fi
     func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
 		   'stat=$?; rm -f "$lockfile"; exit $stat'
-    if test "$lock_old_archive_extraction" = yes; then
+    if test yes = "$lock_old_archive_extraction"; then
       $opt_dry_run || rm -f "$lockfile"
     fi
     if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
@@ -3738,22 +4992,23 @@
 # func_extract_archives gentop oldlib ...
 func_extract_archives ()
 {
-    $opt_debug
-    my_gentop="$1"; shift
+    $debug_cmd
+
+    my_gentop=$1; shift
     my_oldlibs=${1+"$@"}
-    my_oldobjs=""
-    my_xlib=""
-    my_xabs=""
-    my_xdir=""
+    my_oldobjs=
+    my_xlib=
+    my_xabs=
+    my_xdir=
 
     for my_xlib in $my_oldlibs; do
       # Extract the objects.
       case $my_xlib in
-	[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
+	[\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;;
 	*) my_xabs=`pwd`"/$my_xlib" ;;
       esac
       func_basename "$my_xlib"
-      my_xlib="$func_basename_result"
+      my_xlib=$func_basename_result
       my_xlib_u=$my_xlib
       while :; do
         case " $extracted_archives " in
@@ -3765,7 +5020,7 @@
 	esac
       done
       extracted_archives="$extracted_archives $my_xlib_u"
-      my_xdir="$my_gentop/$my_xlib_u"
+      my_xdir=$my_gentop/$my_xlib_u
 
       func_mkdir_p "$my_xdir"
 
@@ -3778,19 +5033,20 @@
 	  cd $my_xdir || exit $?
 	  darwin_archive=$my_xabs
 	  darwin_curdir=`pwd`
-	  darwin_base_archive=`basename "$darwin_archive"`
+	  func_basename "$darwin_archive"
+	  darwin_base_archive=$func_basename_result
 	  darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
 	  if test -n "$darwin_arches"; then
 	    darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
 	    darwin_arch=
 	    func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
-	    for darwin_arch in  $darwin_arches ; do
-	      func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
-	      $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
-	      cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
-	      func_extract_an_archive "`pwd`" "${darwin_base_archive}"
+	    for darwin_arch in  $darwin_arches; do
+	      func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch"
+	      $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive"
+	      cd "unfat-$$/$darwin_base_archive-$darwin_arch"
+	      func_extract_an_archive "`pwd`" "$darwin_base_archive"
 	      cd "$darwin_curdir"
-	      $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
+	      $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive"
 	    done # $darwin_arches
             ## Okay now we've a bunch of thin objects, gotta fatten them up :)
 	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
@@ -3815,7 +5071,7 @@
       my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
     done
 
-    func_extract_archives_result="$my_oldobjs"
+    func_extract_archives_result=$my_oldobjs
 }
 
 
@@ -3830,7 +5086,7 @@
 #
 # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
 # variable will take.  If 'yes', then the emitted script
-# will assume that the directory in which it is stored is
+# will assume that the directory where it is stored is
 # the $objdir directory.  This is a cygwin/mingw-specific
 # behavior.
 func_emit_wrapper ()
@@ -3841,7 +5097,7 @@
 #! $SHELL
 
 # $output - temporary wrapper script for $objdir/$outputname
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
 #
 # The $output program cannot be directly executed until all the libtool
 # libraries that it depends on are installed.
@@ -3898,9 +5154,9 @@
 
 # Very basic option parsing. These options are (a) specific to
 # the libtool wrapper, (b) are identical between the wrapper
-# /script/ and the wrapper /executable/ which is used only on
+# /script/ and the wrapper /executable/ that is used only on
 # windows platforms, and (c) all begin with the string "--lt-"
-# (application programs are unlikely to have options which match
+# (application programs are unlikely to have options that match
 # this pattern).
 #
 # There are only two supported options: --lt-debug and
@@ -3933,7 +5189,7 @@
 
   # Print the debug banner immediately:
   if test -n \"\$lt_option_debug\"; then
-    echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
+    echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2
   fi
 }
 
@@ -3944,7 +5200,7 @@
   lt_dump_args_N=1;
   for lt_arg
   do
-    \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
+    \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\"
     lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
   done
 }
@@ -3958,7 +5214,7 @@
   *-*-mingw | *-*-os2* | *-cegcc*)
     $ECHO "\
       if test -n \"\$lt_option_debug\"; then
-        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
+        \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2
         func_lt_dump_args \${1+\"\$@\"} 1>&2
       fi
       exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
@@ -3968,7 +5224,7 @@
   *)
     $ECHO "\
       if test -n \"\$lt_option_debug\"; then
-        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
+        \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2
         func_lt_dump_args \${1+\"\$@\"} 1>&2
       fi
       exec \"\$progdir/\$program\" \${1+\"\$@\"}
@@ -4043,13 +5299,13 @@
   test -n \"\$absdir\" && thisdir=\"\$absdir\"
 "
 
-	if test "$fast_install" = yes; then
+	if test yes = "$fast_install"; then
 	  $ECHO "\
   program=lt-'$outputname'$exeext
   progdir=\"\$thisdir/$objdir\"
 
   if test ! -f \"\$progdir/\$program\" ||
-     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\
        test \"X\$file\" != \"X\$progdir/\$program\"; }; then
 
     file=\"\$\$-\$program\"
@@ -4101,7 +5357,7 @@
 	fi
 
 	# Export our shlibpath_var if we have one.
-	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+	if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
 	  $ECHO "\
     # Add our own library path to $shlibpath_var
     $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
@@ -4121,7 +5377,7 @@
     fi
   else
     # The program doesn't exist.
-    \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
+    \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2
     \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
     \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
     exit 1
@@ -4140,7 +5396,7 @@
 	cat <<EOF
 
 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
-   Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+   Generated by $PROGRAM (GNU $PACKAGE) $VERSION
 
    The $output program cannot be directly executed until all the libtool
    libraries that it depends on are installed.
@@ -4175,47 +5431,45 @@
 #include <fcntl.h>
 #include <sys/stat.h>
 
+#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
+
 /* declarations of non-ANSI functions */
-#if defined(__MINGW32__)
+#if defined __MINGW32__
 # ifdef __STRICT_ANSI__
 int _putenv (const char *);
 # endif
-#elif defined(__CYGWIN__)
+#elif defined __CYGWIN__
 # ifdef __STRICT_ANSI__
 char *realpath (const char *, char *);
 int putenv (char *);
 int setenv (const char *, const char *, int);
 # endif
-/* #elif defined (other platforms) ... */
+/* #elif defined other_platform || defined ... */
 #endif
 
 /* portability defines, excluding path handling macros */
-#if defined(_MSC_VER)
+#if defined _MSC_VER
 # define setmode _setmode
 # define stat    _stat
 # define chmod   _chmod
 # define getcwd  _getcwd
 # define putenv  _putenv
 # define S_IXUSR _S_IEXEC
-# ifndef _INTPTR_T_DEFINED
-#  define _INTPTR_T_DEFINED
-#  define intptr_t int
-# endif
-#elif defined(__MINGW32__)
+#elif defined __MINGW32__
 # define setmode _setmode
 # define stat    _stat
 # define chmod   _chmod
 # define getcwd  _getcwd
 # define putenv  _putenv
-#elif defined(__CYGWIN__)
+#elif defined __CYGWIN__
 # define HAVE_SETENV
 # define FOPEN_WB "wb"
-/* #elif defined (other platforms) ... */
+/* #elif defined other platforms ... */
 #endif
 
-#if defined(PATH_MAX)
+#if defined PATH_MAX
 # define LT_PATHMAX PATH_MAX
-#elif defined(MAXPATHLEN)
+#elif defined MAXPATHLEN
 # define LT_PATHMAX MAXPATHLEN
 #else
 # define LT_PATHMAX 1024
@@ -4234,8 +5488,8 @@
 # define PATH_SEPARATOR ':'
 #endif
 
-#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
-  defined (__OS2__)
+#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \
+  defined __OS2__
 # define HAVE_DOS_BASED_FILE_SYSTEM
 # define FOPEN_WB "wb"
 # ifndef DIR_SEPARATOR_2
@@ -4268,10 +5522,10 @@
 
 #define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
 #define XFREE(stale) do { \
-  if (stale) { free ((void *) stale); stale = 0; } \
+  if (stale) { free (stale); stale = 0; } \
 } while (0)
 
-#if defined(LT_DEBUGWRAPPER)
+#if defined LT_DEBUGWRAPPER
 static int lt_debug = 1;
 #else
 static int lt_debug = 0;
@@ -4304,7 +5558,7 @@
 const char * LIB_PATH_VARNAME = "$shlibpath_var";
 EOF
 
-	    if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+	    if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
               func_to_host_path "$temp_rpath"
 	      cat <<EOF
 const char * LIB_PATH_VALUE   = "$func_to_host_path_result";
@@ -4328,7 +5582,7 @@
 EOF
 	    fi
 
-	    if test "$fast_install" = yes; then
+	    if test yes = "$fast_install"; then
 	      cat <<EOF
 const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
 EOF
@@ -4357,12 +5611,12 @@
   char *actual_cwrapper_name;
   char *target_name;
   char *lt_argv_zero;
-  intptr_t rval = 127;
+  int rval = 127;
 
   int i;
 
   program_name = (char *) xstrdup (base_name (argv[0]));
-  newargz = XMALLOC (char *, argc + 1);
+  newargz = XMALLOC (char *, (size_t) argc + 1);
 
   /* very simple arg parsing; don't want to rely on getopt
    * also, copy all non cwrapper options to newargz, except
@@ -4371,10 +5625,10 @@
   newargc=0;
   for (i = 1; i < argc; i++)
     {
-      if (strcmp (argv[i], dumpscript_opt) == 0)
+      if (STREQ (argv[i], dumpscript_opt))
 	{
 EOF
-	    case "$host" in
+	    case $host in
 	      *mingw* | *cygwin* )
 		# make stdout use "unix" line endings
 		echo "          setmode(1,_O_BINARY);"
@@ -4385,12 +5639,12 @@
 	  lt_dump_script (stdout);
 	  return 0;
 	}
-      if (strcmp (argv[i], debug_opt) == 0)
+      if (STREQ (argv[i], debug_opt))
 	{
           lt_debug = 1;
           continue;
 	}
-      if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
+      if (STREQ (argv[i], ltwrapper_option_prefix))
         {
           /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
              namespace, but it is not one of the ones we know about and
@@ -4413,7 +5667,7 @@
 EOF
 	    cat <<EOF
   /* The GNU banner must be the first non-error debug message */
-  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
+  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE) $VERSION\n");
 EOF
 	    cat <<"EOF"
   lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
@@ -4524,7 +5778,7 @@
 		cat <<"EOF"
   /* execv doesn't actually work on mingw as expected on unix */
   newargz = prepare_spawn (newargz);
-  rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
+  rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
   if (rval == -1)
     {
       /* failed to start process */
@@ -4569,7 +5823,7 @@
 {
   const char *base;
 
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+#if defined HAVE_DOS_BASED_FILE_SYSTEM
   /* Skip over the disk name in MSDOS pathnames. */
   if (isalpha ((unsigned char) name[0]) && name[1] == ':')
     name += 2;
@@ -4628,7 +5882,7 @@
   const char *p_next;
   /* static buffer for getcwd */
   char tmp[LT_PATHMAX + 1];
-  int tmp_len;
+  size_t tmp_len;
   char *concat_name;
 
   lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
@@ -4638,7 +5892,7 @@
     return NULL;
 
   /* Absolute path? */
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+#if defined HAVE_DOS_BASED_FILE_SYSTEM
   if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
     {
       concat_name = xstrdup (wrapper);
@@ -4656,7 +5910,7 @@
 	    return concat_name;
 	  XFREE (concat_name);
 	}
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+#if defined HAVE_DOS_BASED_FILE_SYSTEM
     }
 #endif
 
@@ -4679,7 +5933,7 @@
 	      for (q = p; *q; q++)
 		if (IS_PATH_SEPARATOR (*q))
 		  break;
-	      p_len = q - p;
+	      p_len = (size_t) (q - p);
 	      p_next = (*q == '\0' ? q : q + 1);
 	      if (p_len == 0)
 		{
@@ -4798,7 +6052,7 @@
   if (patlen <= len)
     {
       str += len - patlen;
-      if (strcmp (str, pat) == 0)
+      if (STREQ (str, pat))
 	*str = '\0';
     }
   return str;
@@ -4863,7 +6117,7 @@
     char *str = xstrdup (value);
     setenv (name, str, 1);
 #else
-    int len = strlen (name) + 1 + strlen (value) + 1;
+    size_t len = strlen (name) + 1 + strlen (value) + 1;
     char *str = XMALLOC (char, len);
     sprintf (str, "%s=%s", name, value);
     if (putenv (str) != EXIT_SUCCESS)
@@ -4880,8 +6134,8 @@
   char *new_value;
   if (orig_value && *orig_value)
     {
-      int orig_value_len = strlen (orig_value);
-      int add_len = strlen (add);
+      size_t orig_value_len = strlen (orig_value);
+      size_t add_len = strlen (add);
       new_value = XMALLOC (char, add_len + orig_value_len + 1);
       if (to_end)
         {
@@ -4912,10 +6166,10 @@
     {
       char *new_value = lt_extend_str (getenv (name), value, 0);
       /* some systems can't cope with a ':'-terminated path #' */
-      int len = strlen (new_value);
-      while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
+      size_t len = strlen (new_value);
+      while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
         {
-          new_value[len-1] = '\0';
+          new_value[--len] = '\0';
         }
       lt_setenv (name, new_value);
       XFREE (new_value);
@@ -5082,7 +6336,8 @@
 # True if ARG is an import lib, as indicated by $file_magic_cmd
 func_win32_import_lib_p ()
 {
-    $opt_debug
+    $debug_cmd
+
     case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
     *import*) : ;;
     *) false ;;
@@ -5092,17 +6347,18 @@
 # func_mode_link arg...
 func_mode_link ()
 {
-    $opt_debug
+    $debug_cmd
+
     case $host in
     *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
       # It is impossible to link a dll without this setting, and
       # we shouldn't force the makefile maintainer to figure out
-      # which system we are compiling for in order to pass an extra
+      # what system we are compiling for in order to pass an extra
       # flag for every libtool invocation.
       # allow_undefined=no
 
       # FIXME: Unfortunately, there are problems with the above when trying
-      # to make a dll which has undefined symbols, in which case not
+      # to make a dll that has undefined symbols, in which case not
       # even a static library is built.  For now, we need to specify
       # -no-undefined on the libtool link line when we can be certain
       # that all symbols are satisfied, otherwise we get a static library.
@@ -5149,7 +6405,7 @@
     non_pic_objects=
     precious_files_regex=
     prefer_static_libs=no
-    preload=no
+    preload=false
     prev=
     prevarg=
     release=
@@ -5161,7 +6417,7 @@
     vinfo=
     vinfo_number=no
     weak_libs=
-    single_module="${wl}-single_module"
+    single_module=$wl-single_module
     func_infer_tag $base_compile
 
     # We need to know -static, to get the right output filenames.
@@ -5169,15 +6425,15 @@
     do
       case $arg in
       -shared)
-	test "$build_libtool_libs" != yes && \
-	  func_fatal_configuration "can not build a shared library"
+	test yes != "$build_libtool_libs" \
+	  && func_fatal_configuration "cannot build a shared library"
 	build_old_libs=no
 	break
 	;;
       -all-static | -static | -static-libtool-libs)
 	case $arg in
 	-all-static)
-	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+	  if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then
 	    func_warning "complete static linking is impossible in this configuration"
 	  fi
 	  if test -n "$link_static_flag"; then
@@ -5210,7 +6466,7 @@
 
     # Go through the arguments, transforming them on the way.
     while test "$#" -gt 0; do
-      arg="$1"
+      arg=$1
       shift
       func_quote_for_eval "$arg"
       qarg=$func_quote_for_eval_unquoted_result
@@ -5227,21 +6483,21 @@
 
 	case $prev in
 	bindir)
-	  bindir="$arg"
+	  bindir=$arg
 	  prev=
 	  continue
 	  ;;
 	dlfiles|dlprefiles)
-	  if test "$preload" = no; then
+	  $preload || {
 	    # Add the symbol object into the linking commands.
 	    func_append compile_command " @SYMFILE@"
 	    func_append finalize_command " @SYMFILE@"
-	    preload=yes
-	  fi
+	    preload=:
+	  }
 	  case $arg in
 	  *.la | *.lo) ;;  # We handle these cases below.
 	  force)
-	    if test "$dlself" = no; then
+	    if test no = "$dlself"; then
 	      dlself=needless
 	      export_dynamic=yes
 	    fi
@@ -5249,9 +6505,9 @@
 	    continue
 	    ;;
 	  self)
-	    if test "$prev" = dlprefiles; then
+	    if test dlprefiles = "$prev"; then
 	      dlself=yes
-	    elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+	    elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then
 	      dlself=yes
 	    else
 	      dlself=needless
@@ -5261,7 +6517,7 @@
 	    continue
 	    ;;
 	  *)
-	    if test "$prev" = dlfiles; then
+	    if test dlfiles = "$prev"; then
 	      func_append dlfiles " $arg"
 	    else
 	      func_append dlprefiles " $arg"
@@ -5272,14 +6528,14 @@
 	  esac
 	  ;;
 	expsyms)
-	  export_symbols="$arg"
+	  export_symbols=$arg
 	  test -f "$arg" \
-	    || func_fatal_error "symbol file \`$arg' does not exist"
+	    || func_fatal_error "symbol file '$arg' does not exist"
 	  prev=
 	  continue
 	  ;;
 	expsyms_regex)
-	  export_symbols_regex="$arg"
+	  export_symbols_regex=$arg
 	  prev=
 	  continue
 	  ;;
@@ -5297,7 +6553,13 @@
 	  continue
 	  ;;
 	inst_prefix)
-	  inst_prefix_dir="$arg"
+	  inst_prefix_dir=$arg
+	  prev=
+	  continue
+	  ;;
+	mllvm)
+	  # Clang does not use LLVM to link, so we can simply discard any
+	  # '-mllvm $arg' options when doing the link step.
 	  prev=
 	  continue
 	  ;;
@@ -5321,21 +6583,21 @@
 
 		if test -z "$pic_object" ||
 		   test -z "$non_pic_object" ||
-		   test "$pic_object" = none &&
-		   test "$non_pic_object" = none; then
-		  func_fatal_error "cannot find name of object for \`$arg'"
+		   test none = "$pic_object" &&
+		   test none = "$non_pic_object"; then
+		  func_fatal_error "cannot find name of object for '$arg'"
 		fi
 
 		# Extract subdirectory from the argument.
 		func_dirname "$arg" "/" ""
-		xdir="$func_dirname_result"
+		xdir=$func_dirname_result
 
-		if test "$pic_object" != none; then
+		if test none != "$pic_object"; then
 		  # Prepend the subdirectory the object is found in.
-		  pic_object="$xdir$pic_object"
+		  pic_object=$xdir$pic_object
 
-		  if test "$prev" = dlfiles; then
-		    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+		  if test dlfiles = "$prev"; then
+		    if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
 		      func_append dlfiles " $pic_object"
 		      prev=
 		      continue
@@ -5346,7 +6608,7 @@
 		  fi
 
 		  # CHECK ME:  I think I busted this.  -Ossama
-		  if test "$prev" = dlprefiles; then
+		  if test dlprefiles = "$prev"; then
 		    # Preload the old-style object.
 		    func_append dlprefiles " $pic_object"
 		    prev=
@@ -5354,23 +6616,23 @@
 
 		  # A PIC object.
 		  func_append libobjs " $pic_object"
-		  arg="$pic_object"
+		  arg=$pic_object
 		fi
 
 		# Non-PIC object.
-		if test "$non_pic_object" != none; then
+		if test none != "$non_pic_object"; then
 		  # Prepend the subdirectory the object is found in.
-		  non_pic_object="$xdir$non_pic_object"
+		  non_pic_object=$xdir$non_pic_object
 
 		  # A standard non-PIC object
 		  func_append non_pic_objects " $non_pic_object"
-		  if test -z "$pic_object" || test "$pic_object" = none ; then
-		    arg="$non_pic_object"
+		  if test -z "$pic_object" || test none = "$pic_object"; then
+		    arg=$non_pic_object
 		  fi
 		else
 		  # If the PIC object exists, use it instead.
 		  # $xdir was prepended to $pic_object above.
-		  non_pic_object="$pic_object"
+		  non_pic_object=$pic_object
 		  func_append non_pic_objects " $non_pic_object"
 		fi
 	      else
@@ -5378,7 +6640,7 @@
 		if $opt_dry_run; then
 		  # Extract subdirectory from the argument.
 		  func_dirname "$arg" "/" ""
-		  xdir="$func_dirname_result"
+		  xdir=$func_dirname_result
 
 		  func_lo2o "$arg"
 		  pic_object=$xdir$objdir/$func_lo2o_result
@@ -5386,24 +6648,24 @@
 		  func_append libobjs " $pic_object"
 		  func_append non_pic_objects " $non_pic_object"
 	        else
-		  func_fatal_error "\`$arg' is not a valid libtool object"
+		  func_fatal_error "'$arg' is not a valid libtool object"
 		fi
 	      fi
 	    done
 	  else
-	    func_fatal_error "link input file \`$arg' does not exist"
+	    func_fatal_error "link input file '$arg' does not exist"
 	  fi
 	  arg=$save_arg
 	  prev=
 	  continue
 	  ;;
 	precious_regex)
-	  precious_files_regex="$arg"
+	  precious_files_regex=$arg
 	  prev=
 	  continue
 	  ;;
 	release)
-	  release="-$arg"
+	  release=-$arg
 	  prev=
 	  continue
 	  ;;
@@ -5415,7 +6677,7 @@
 	    func_fatal_error "only absolute run-paths are allowed"
 	    ;;
 	  esac
-	  if test "$prev" = rpath; then
+	  if test rpath = "$prev"; then
 	    case "$rpath " in
 	    *" $arg "*) ;;
 	    *) func_append rpath " $arg" ;;
@@ -5430,7 +6692,7 @@
 	  continue
 	  ;;
 	shrext)
-	  shrext_cmds="$arg"
+	  shrext_cmds=$arg
 	  prev=
 	  continue
 	  ;;
@@ -5470,7 +6732,7 @@
 	esac
       fi # test -n "$prev"
 
-      prevarg="$arg"
+      prevarg=$arg
 
       case $arg in
       -all-static)
@@ -5484,7 +6746,7 @@
 
       -allow-undefined)
 	# FIXME: remove this flag sometime in the future.
-	func_fatal_error "\`-allow-undefined' must not be used because it is the default"
+	func_fatal_error "'-allow-undefined' must not be used because it is the default"
 	;;
 
       -avoid-version)
@@ -5516,7 +6778,7 @@
 	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
 	  func_fatal_error "more than one -exported-symbols argument is not allowed"
 	fi
-	if test "X$arg" = "X-export-symbols"; then
+	if test X-export-symbols = "X$arg"; then
 	  prev=expsyms
 	else
 	  prev=expsyms_regex
@@ -5550,9 +6812,9 @@
 	func_stripname "-L" '' "$arg"
 	if test -z "$func_stripname_result"; then
 	  if test "$#" -gt 0; then
-	    func_fatal_error "require no space between \`-L' and \`$1'"
+	    func_fatal_error "require no space between '-L' and '$1'"
 	  else
-	    func_fatal_error "need path for \`-L' option"
+	    func_fatal_error "need path for '-L' option"
 	  fi
 	fi
 	func_resolve_sysroot "$func_stripname_result"
@@ -5563,8 +6825,8 @@
 	*)
 	  absdir=`cd "$dir" && pwd`
 	  test -z "$absdir" && \
-	    func_fatal_error "cannot determine absolute directory name of \`$dir'"
-	  dir="$absdir"
+	    func_fatal_error "cannot determine absolute directory name of '$dir'"
+	  dir=$absdir
 	  ;;
 	esac
 	case "$deplibs " in
@@ -5599,7 +6861,7 @@
 	;;
 
       -l*)
-	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+	if test X-lc = "X$arg" || test X-lm = "X$arg"; then
 	  case $host in
 	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
 	    # These systems don't actually have a C or math library (as such)
@@ -5607,11 +6869,11 @@
 	    ;;
 	  *-*-os2*)
 	    # These systems don't actually have a C library (as such)
-	    test "X$arg" = "X-lc" && continue
+	    test X-lc = "X$arg" && continue
 	    ;;
-	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
 	    # Do not include libc due to us having libc/libc_r.
-	    test "X$arg" = "X-lc" && continue
+	    test X-lc = "X$arg" && continue
 	    ;;
 	  *-*-rhapsody* | *-*-darwin1.[012])
 	    # Rhapsody C and math libraries are in the System framework
@@ -5620,16 +6882,16 @@
 	    ;;
 	  *-*-sco3.2v5* | *-*-sco5v6*)
 	    # Causes problems with __ctype
-	    test "X$arg" = "X-lc" && continue
+	    test X-lc = "X$arg" && continue
 	    ;;
 	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
 	    # Compiler inserts libc in the correct place for threads to work
-	    test "X$arg" = "X-lc" && continue
+	    test X-lc = "X$arg" && continue
 	    ;;
 	  esac
-	elif test "X$arg" = "X-lc_r"; then
+	elif test X-lc_r = "X$arg"; then
 	 case $host in
-	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
 	   # Do not include libc_r directly, use -pthread flag.
 	   continue
 	   ;;
@@ -5639,6 +6901,11 @@
 	continue
 	;;
 
+      -mllvm)
+	prev=mllvm
+	continue
+	;;
+
       -module)
 	module=yes
 	continue
@@ -5668,7 +6935,7 @@
 	;;
 
       -multi_module)
-	single_module="${wl}-multi_module"
+	single_module=$wl-multi_module
 	continue
 	;;
 
@@ -5682,8 +6949,8 @@
 	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
 	  # The PATH hackery in wrapper scripts is required on Windows
 	  # and Darwin in order for the loader to find any dlls it needs.
-	  func_warning "\`-no-install' is ignored for $host"
-	  func_warning "assuming \`-no-fast-install' instead"
+	  func_warning "'-no-install' is ignored for $host"
+	  func_warning "assuming '-no-fast-install' instead"
 	  fast_install=no
 	  ;;
 	*) no_install=yes ;;
@@ -5788,14 +7055,14 @@
 	func_stripname '-Wc,' '' "$arg"
 	args=$func_stripname_result
 	arg=
-	save_ifs="$IFS"; IFS=','
+	save_ifs=$IFS; IFS=,
 	for flag in $args; do
-	  IFS="$save_ifs"
+	  IFS=$save_ifs
           func_quote_for_eval "$flag"
 	  func_append arg " $func_quote_for_eval_result"
 	  func_append compiler_flags " $func_quote_for_eval_result"
 	done
-	IFS="$save_ifs"
+	IFS=$save_ifs
 	func_stripname ' ' '' "$arg"
 	arg=$func_stripname_result
 	;;
@@ -5804,15 +7071,15 @@
 	func_stripname '-Wl,' '' "$arg"
 	args=$func_stripname_result
 	arg=
-	save_ifs="$IFS"; IFS=','
+	save_ifs=$IFS; IFS=,
 	for flag in $args; do
-	  IFS="$save_ifs"
+	  IFS=$save_ifs
           func_quote_for_eval "$flag"
 	  func_append arg " $wl$func_quote_for_eval_result"
 	  func_append compiler_flags " $wl$func_quote_for_eval_result"
 	  func_append linker_flags " $func_quote_for_eval_result"
 	done
-	IFS="$save_ifs"
+	IFS=$save_ifs
 	func_stripname ' ' '' "$arg"
 	arg=$func_stripname_result
 	;;
@@ -5835,7 +7102,7 @@
       # -msg_* for osf cc
       -msg_*)
 	func_quote_for_eval "$arg"
-	arg="$func_quote_for_eval_result"
+	arg=$func_quote_for_eval_result
 	;;
 
       # Flags to be passed through unchanged, with rationale:
@@ -5850,12 +7117,13 @@
       # @file                GCC response files
       # -tp=*                Portland pgcc target processor selection
       # --sysroot=*          for sysroot support
-      # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+      # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+      # -stdlib=*            select c++ std lib with clang
       -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
       -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
-      -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
+      -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-stdlib=*)
         func_quote_for_eval "$arg"
-	arg="$func_quote_for_eval_result"
+	arg=$func_quote_for_eval_result
         func_append compile_command " $arg"
         func_append finalize_command " $arg"
         func_append compiler_flags " $arg"
@@ -5865,7 +7133,7 @@
       # Some other compiler flag.
       -* | +*)
         func_quote_for_eval "$arg"
-	arg="$func_quote_for_eval_result"
+	arg=$func_quote_for_eval_result
 	;;
 
       *.$objext)
@@ -5886,21 +7154,21 @@
 
 	  if test -z "$pic_object" ||
 	     test -z "$non_pic_object" ||
-	     test "$pic_object" = none &&
-	     test "$non_pic_object" = none; then
-	    func_fatal_error "cannot find name of object for \`$arg'"
+	     test none = "$pic_object" &&
+	     test none = "$non_pic_object"; then
+	    func_fatal_error "cannot find name of object for '$arg'"
 	  fi
 
 	  # Extract subdirectory from the argument.
 	  func_dirname "$arg" "/" ""
-	  xdir="$func_dirname_result"
+	  xdir=$func_dirname_result
 
-	  if test "$pic_object" != none; then
+	  test none = "$pic_object" || {
 	    # Prepend the subdirectory the object is found in.
-	    pic_object="$xdir$pic_object"
+	    pic_object=$xdir$pic_object
 
-	    if test "$prev" = dlfiles; then
-	      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+	    if test dlfiles = "$prev"; then
+	      if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
 		func_append dlfiles " $pic_object"
 		prev=
 		continue
@@ -5911,7 +7179,7 @@
 	    fi
 
 	    # CHECK ME:  I think I busted this.  -Ossama
-	    if test "$prev" = dlprefiles; then
+	    if test dlprefiles = "$prev"; then
 	      # Preload the old-style object.
 	      func_append dlprefiles " $pic_object"
 	      prev=
@@ -5919,23 +7187,23 @@
 
 	    # A PIC object.
 	    func_append libobjs " $pic_object"
-	    arg="$pic_object"
-	  fi
+	    arg=$pic_object
+	  }
 
 	  # Non-PIC object.
-	  if test "$non_pic_object" != none; then
+	  if test none != "$non_pic_object"; then
 	    # Prepend the subdirectory the object is found in.
-	    non_pic_object="$xdir$non_pic_object"
+	    non_pic_object=$xdir$non_pic_object
 
 	    # A standard non-PIC object
 	    func_append non_pic_objects " $non_pic_object"
-	    if test -z "$pic_object" || test "$pic_object" = none ; then
-	      arg="$non_pic_object"
+	    if test -z "$pic_object" || test none = "$pic_object"; then
+	      arg=$non_pic_object
 	    fi
 	  else
 	    # If the PIC object exists, use it instead.
 	    # $xdir was prepended to $pic_object above.
-	    non_pic_object="$pic_object"
+	    non_pic_object=$pic_object
 	    func_append non_pic_objects " $non_pic_object"
 	  fi
 	else
@@ -5943,7 +7211,7 @@
 	  if $opt_dry_run; then
 	    # Extract subdirectory from the argument.
 	    func_dirname "$arg" "/" ""
-	    xdir="$func_dirname_result"
+	    xdir=$func_dirname_result
 
 	    func_lo2o "$arg"
 	    pic_object=$xdir$objdir/$func_lo2o_result
@@ -5951,7 +7219,7 @@
 	    func_append libobjs " $pic_object"
 	    func_append non_pic_objects " $non_pic_object"
 	  else
-	    func_fatal_error "\`$arg' is not a valid libtool object"
+	    func_fatal_error "'$arg' is not a valid libtool object"
 	  fi
 	fi
 	;;
@@ -5967,11 +7235,11 @@
 	# A libtool-controlled library.
 
 	func_resolve_sysroot "$arg"
-	if test "$prev" = dlfiles; then
+	if test dlfiles = "$prev"; then
 	  # This library was specified with -dlopen.
 	  func_append dlfiles " $func_resolve_sysroot_result"
 	  prev=
-	elif test "$prev" = dlprefiles; then
+	elif test dlprefiles = "$prev"; then
 	  # The library was specified with -dlpreopen.
 	  func_append dlprefiles " $func_resolve_sysroot_result"
 	  prev=
@@ -5986,7 +7254,7 @@
 	# Unknown arguments in both finalize_command and compile_command need
 	# to be aesthetically quoted because they are evaled later.
 	func_quote_for_eval "$arg"
-	arg="$func_quote_for_eval_result"
+	arg=$func_quote_for_eval_result
 	;;
       esac # arg
 
@@ -5998,9 +7266,9 @@
     done # argument parsing loop
 
     test -n "$prev" && \
-      func_fatal_help "the \`$prevarg' option requires an argument"
+      func_fatal_help "the '$prevarg' option requires an argument"
 
-    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+    if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then
       eval arg=\"$export_dynamic_flag_spec\"
       func_append compile_command " $arg"
       func_append finalize_command " $arg"
@@ -6009,12 +7277,12 @@
     oldlibs=
     # calculate the name of the file, without its directory
     func_basename "$output"
-    outputname="$func_basename_result"
-    libobjs_save="$libobjs"
+    outputname=$func_basename_result
+    libobjs_save=$libobjs
 
     if test -n "$shlibpath_var"; then
       # get the directories listed in $shlibpath_var
-      eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
+      eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\`
     else
       shlib_search_path=
     fi
@@ -6022,7 +7290,7 @@
     eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
 
     func_dirname "$output" "/" ""
-    output_objdir="$func_dirname_result$objdir"
+    output_objdir=$func_dirname_result$objdir
     func_to_tool_file "$output_objdir/"
     tool_output_objdir=$func_to_tool_file_result
     # Create the object directory.
@@ -6045,7 +7313,7 @@
     # Find all interdependent deplibs by searching for libraries
     # that are linked more than once (e.g. -la -lb -la)
     for deplib in $deplibs; do
-      if $opt_preserve_dup_deps ; then
+      if $opt_preserve_dup_deps; then
 	case "$libs " in
 	*" $deplib "*) func_append specialdeplibs " $deplib" ;;
 	esac
@@ -6053,7 +7321,7 @@
       func_append libs " $deplib"
     done
 
-    if test "$linkmode" = lib; then
+    if test lib = "$linkmode"; then
       libs="$predeps $libs $compiler_lib_search_path $postdeps"
 
       # Compute libraries that are listed more than once in $predeps
@@ -6085,7 +7353,7 @@
 	  case $file in
 	  *.la) ;;
 	  *)
-	    func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
+	    func_fatal_help "libraries can '-dlopen' only libtool libraries: $file"
 	    ;;
 	  esac
 	done
@@ -6093,7 +7361,7 @@
     prog)
 	compile_deplibs=
 	finalize_deplibs=
-	alldeplibs=no
+	alldeplibs=false
 	newdlfiles=
 	newdlprefiles=
 	passes="conv scan dlopen dlpreopen link"
@@ -6105,29 +7373,29 @@
     for pass in $passes; do
       # The preopen pass in lib mode reverses $deplibs; put it back here
       # so that -L comes before libs that need it for instance...
-      if test "$linkmode,$pass" = "lib,link"; then
+      if test lib,link = "$linkmode,$pass"; then
 	## FIXME: Find the place where the list is rebuilt in the wrong
 	##        order, and fix it there properly
         tmp_deplibs=
 	for deplib in $deplibs; do
 	  tmp_deplibs="$deplib $tmp_deplibs"
 	done
-	deplibs="$tmp_deplibs"
+	deplibs=$tmp_deplibs
       fi
 
-      if test "$linkmode,$pass" = "lib,link" ||
-	 test "$linkmode,$pass" = "prog,scan"; then
-	libs="$deplibs"
+      if test lib,link = "$linkmode,$pass" ||
+	 test prog,scan = "$linkmode,$pass"; then
+	libs=$deplibs
 	deplibs=
       fi
-      if test "$linkmode" = prog; then
+      if test prog = "$linkmode"; then
 	case $pass in
-	dlopen) libs="$dlfiles" ;;
-	dlpreopen) libs="$dlprefiles" ;;
+	dlopen) libs=$dlfiles ;;
+	dlpreopen) libs=$dlprefiles ;;
 	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
 	esac
       fi
-      if test "$linkmode,$pass" = "lib,dlpreopen"; then
+      if test lib,dlpreopen = "$linkmode,$pass"; then
 	# Collect and forward deplibs of preopened libtool libs
 	for lib in $dlprefiles; do
 	  # Ignore non-libtool-libs
@@ -6148,26 +7416,26 @@
 	    esac
 	  done
 	done
-	libs="$dlprefiles"
+	libs=$dlprefiles
       fi
-      if test "$pass" = dlopen; then
+      if test dlopen = "$pass"; then
 	# Collect dlpreopened libraries
-	save_deplibs="$deplibs"
+	save_deplibs=$deplibs
 	deplibs=
       fi
 
       for deplib in $libs; do
 	lib=
-	found=no
+	found=false
 	case $deplib in
 	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
         |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
-	  if test "$linkmode,$pass" = "prog,link"; then
+	  if test prog,link = "$linkmode,$pass"; then
 	    compile_deplibs="$deplib $compile_deplibs"
 	    finalize_deplibs="$deplib $finalize_deplibs"
 	  else
 	    func_append compiler_flags " $deplib"
-	    if test "$linkmode" = lib ; then
+	    if test lib = "$linkmode"; then
 		case "$new_inherited_linker_flags " in
 		    *" $deplib "*) ;;
 		    * ) func_append new_inherited_linker_flags " $deplib" ;;
@@ -6177,13 +7445,13 @@
 	  continue
 	  ;;
 	-l*)
-	  if test "$linkmode" != lib && test "$linkmode" != prog; then
-	    func_warning "\`-l' is ignored for archives/objects"
+	  if test lib != "$linkmode" && test prog != "$linkmode"; then
+	    func_warning "'-l' is ignored for archives/objects"
 	    continue
 	  fi
 	  func_stripname '-l' '' "$deplib"
 	  name=$func_stripname_result
-	  if test "$linkmode" = lib; then
+	  if test lib = "$linkmode"; then
 	    searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
 	  else
 	    searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
@@ -6191,31 +7459,22 @@
 	  for searchdir in $searchdirs; do
 	    for search_ext in .la $std_shrext .so .a; do
 	      # Search the libtool library
-	      lib="$searchdir/lib${name}${search_ext}"
+	      lib=$searchdir/lib$name$search_ext
 	      if test -f "$lib"; then
-		if test "$search_ext" = ".la"; then
-		  found=yes
+		if test .la = "$search_ext"; then
+		  found=:
 		else
-		  found=no
+		  found=false
 		fi
 		break 2
 	      fi
 	    done
 	  done
-	  if test "$found" != yes; then
-	    # deplib doesn't seem to be a libtool library
-	    if test "$linkmode,$pass" = "prog,link"; then
-	      compile_deplibs="$deplib $compile_deplibs"
-	      finalize_deplibs="$deplib $finalize_deplibs"
-	    else
-	      deplibs="$deplib $deplibs"
-	      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
-	    fi
-	    continue
-	  else # deplib is a libtool library
+	  if $found; then
+	    # deplib is a libtool library
 	    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
 	    # We need to do some special things here, and not later.
-	    if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+	    if test yes = "$allow_libtool_libs_with_static_runtimes"; then
 	      case " $predeps $postdeps " in
 	      *" $deplib "*)
 		if func_lalib_p "$lib"; then
@@ -6223,19 +7482,19 @@
 		  old_library=
 		  func_source "$lib"
 		  for l in $old_library $library_names; do
-		    ll="$l"
+		    ll=$l
 		  done
-		  if test "X$ll" = "X$old_library" ; then # only static version available
-		    found=no
+		  if test "X$ll" = "X$old_library"; then # only static version available
+		    found=false
 		    func_dirname "$lib" "" "."
-		    ladir="$func_dirname_result"
+		    ladir=$func_dirname_result
 		    lib=$ladir/$old_library
-		    if test "$linkmode,$pass" = "prog,link"; then
+		    if test prog,link = "$linkmode,$pass"; then
 		      compile_deplibs="$deplib $compile_deplibs"
 		      finalize_deplibs="$deplib $finalize_deplibs"
 		    else
 		      deplibs="$deplib $deplibs"
-		      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+		      test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
 		    fi
 		    continue
 		  fi
@@ -6244,15 +7503,25 @@
 	      *) ;;
 	      esac
 	    fi
+	  else
+	    # deplib doesn't seem to be a libtool library
+	    if test prog,link = "$linkmode,$pass"; then
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    else
+	      deplibs="$deplib $deplibs"
+	      test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
+	    fi
+	    continue
 	  fi
 	  ;; # -l
 	*.ltframework)
-	  if test "$linkmode,$pass" = "prog,link"; then
+	  if test prog,link = "$linkmode,$pass"; then
 	    compile_deplibs="$deplib $compile_deplibs"
 	    finalize_deplibs="$deplib $finalize_deplibs"
 	  else
 	    deplibs="$deplib $deplibs"
-	    if test "$linkmode" = lib ; then
+	    if test lib = "$linkmode"; then
 		case "$new_inherited_linker_flags " in
 		    *" $deplib "*) ;;
 		    * ) func_append new_inherited_linker_flags " $deplib" ;;
@@ -6265,18 +7534,18 @@
 	  case $linkmode in
 	  lib)
 	    deplibs="$deplib $deplibs"
-	    test "$pass" = conv && continue
+	    test conv = "$pass" && continue
 	    newdependency_libs="$deplib $newdependency_libs"
 	    func_stripname '-L' '' "$deplib"
 	    func_resolve_sysroot "$func_stripname_result"
 	    func_append newlib_search_path " $func_resolve_sysroot_result"
 	    ;;
 	  prog)
-	    if test "$pass" = conv; then
+	    if test conv = "$pass"; then
 	      deplibs="$deplib $deplibs"
 	      continue
 	    fi
-	    if test "$pass" = scan; then
+	    if test scan = "$pass"; then
 	      deplibs="$deplib $deplibs"
 	    else
 	      compile_deplibs="$deplib $compile_deplibs"
@@ -6287,13 +7556,13 @@
 	    func_append newlib_search_path " $func_resolve_sysroot_result"
 	    ;;
 	  *)
-	    func_warning "\`-L' is ignored for archives/objects"
+	    func_warning "'-L' is ignored for archives/objects"
 	    ;;
 	  esac # linkmode
 	  continue
 	  ;; # -L
 	-R*)
-	  if test "$pass" = link; then
+	  if test link = "$pass"; then
 	    func_stripname '-R' '' "$deplib"
 	    func_resolve_sysroot "$func_stripname_result"
 	    dir=$func_resolve_sysroot_result
@@ -6311,7 +7580,7 @@
 	  lib=$func_resolve_sysroot_result
 	  ;;
 	*.$libext)
-	  if test "$pass" = conv; then
+	  if test conv = "$pass"; then
 	    deplibs="$deplib $deplibs"
 	    continue
 	  fi
@@ -6322,21 +7591,26 @@
 	    case " $dlpreconveniencelibs " in
 	    *" $deplib "*) ;;
 	    *)
-	      valid_a_lib=no
+	      valid_a_lib=false
 	      case $deplibs_check_method in
 		match_pattern*)
 		  set dummy $deplibs_check_method; shift
 		  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
 		  if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
 		    | $EGREP "$match_pattern_regex" > /dev/null; then
-		    valid_a_lib=yes
+		    valid_a_lib=:
 		  fi
 		;;
 		pass_all)
-		  valid_a_lib=yes
+		  valid_a_lib=:
 		;;
 	      esac
-	      if test "$valid_a_lib" != yes; then
+	      if $valid_a_lib; then
+		echo
+		$ECHO "*** Warning: Linking the shared library $output against the"
+		$ECHO "*** static library $deplib is not portable!"
+		deplibs="$deplib $deplibs"
+	      else
 		echo
 		$ECHO "*** Warning: Trying to link with static lib archive $deplib."
 		echo "*** I have the capability to make that library automatically link in when"
@@ -6344,18 +7618,13 @@
 		echo "*** shared version of the library, which you do not appear to have"
 		echo "*** because the file extensions .$libext of this argument makes me believe"
 		echo "*** that it is just a static archive that I should not use here."
-	      else
-		echo
-		$ECHO "*** Warning: Linking the shared library $output against the"
-		$ECHO "*** static library $deplib is not portable!"
-		deplibs="$deplib $deplibs"
 	      fi
 	      ;;
 	    esac
 	    continue
 	    ;;
 	  prog)
-	    if test "$pass" != link; then
+	    if test link != "$pass"; then
 	      deplibs="$deplib $deplibs"
 	    else
 	      compile_deplibs="$deplib $compile_deplibs"
@@ -6366,10 +7635,10 @@
 	  esac # linkmode
 	  ;; # *.$libext
 	*.lo | *.$objext)
-	  if test "$pass" = conv; then
+	  if test conv = "$pass"; then
 	    deplibs="$deplib $deplibs"
-	  elif test "$linkmode" = prog; then
-	    if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+	  elif test prog = "$linkmode"; then
+	    if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then
 	      # If there is no dlopen support or we're linking statically,
 	      # we need to preload.
 	      func_append newdlprefiles " $deplib"
@@ -6382,22 +7651,20 @@
 	  continue
 	  ;;
 	%DEPLIBS%)
-	  alldeplibs=yes
+	  alldeplibs=:
 	  continue
 	  ;;
 	esac # case $deplib
 
-	if test "$found" = yes || test -f "$lib"; then :
-	else
-	  func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
-	fi
+	$found || test -f "$lib" \
+	  || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'"
 
 	# Check to see that this really is a libtool archive.
 	func_lalib_unsafe_p "$lib" \
-	  || func_fatal_error "\`$lib' is not a valid libtool archive"
+	  || func_fatal_error "'$lib' is not a valid libtool archive"
 
 	func_dirname "$lib" "" "."
-	ladir="$func_dirname_result"
+	ladir=$func_dirname_result
 
 	dlname=
 	dlopen=
@@ -6427,30 +7694,30 @@
 	  done
 	fi
 	dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
-	if test "$linkmode,$pass" = "lib,link" ||
-	   test "$linkmode,$pass" = "prog,scan" ||
-	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+	if test lib,link = "$linkmode,$pass" ||
+	   test prog,scan = "$linkmode,$pass" ||
+	   { test prog != "$linkmode" && test lib != "$linkmode"; }; then
 	  test -n "$dlopen" && func_append dlfiles " $dlopen"
 	  test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
 	fi
 
-	if test "$pass" = conv; then
+	if test conv = "$pass"; then
 	  # Only check for convenience libraries
 	  deplibs="$lib $deplibs"
 	  if test -z "$libdir"; then
 	    if test -z "$old_library"; then
-	      func_fatal_error "cannot find name of link library for \`$lib'"
+	      func_fatal_error "cannot find name of link library for '$lib'"
 	    fi
 	    # It is a libtool convenience library, so add in its objects.
 	    func_append convenience " $ladir/$objdir/$old_library"
 	    func_append old_convenience " $ladir/$objdir/$old_library"
-	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
-	    func_fatal_error "\`$lib' is not a convenience library"
+	  elif test prog != "$linkmode" && test lib != "$linkmode"; then
+	    func_fatal_error "'$lib' is not a convenience library"
 	  fi
 	  tmp_libs=
 	  for deplib in $dependency_libs; do
 	    deplibs="$deplib $deplibs"
-	    if $opt_preserve_dup_deps ; then
+	    if $opt_preserve_dup_deps; then
 	      case "$tmp_libs " in
 	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
 	      esac
@@ -6464,26 +7731,26 @@
 	# Get the name of the library we link against.
 	linklib=
 	if test -n "$old_library" &&
-	   { test "$prefer_static_libs" = yes ||
-	     test "$prefer_static_libs,$installed" = "built,no"; }; then
+	   { test yes = "$prefer_static_libs" ||
+	     test built,no = "$prefer_static_libs,$installed"; }; then
 	  linklib=$old_library
 	else
 	  for l in $old_library $library_names; do
-	    linklib="$l"
+	    linklib=$l
 	  done
 	fi
 	if test -z "$linklib"; then
-	  func_fatal_error "cannot find name of link library for \`$lib'"
+	  func_fatal_error "cannot find name of link library for '$lib'"
 	fi
 
 	# This library was specified with -dlopen.
-	if test "$pass" = dlopen; then
-	  if test -z "$libdir"; then
-	    func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
-	  fi
+	if test dlopen = "$pass"; then
+	  test -z "$libdir" \
+	    && func_fatal_error "cannot -dlopen a convenience library: '$lib'"
 	  if test -z "$dlname" ||
-	     test "$dlopen_support" != yes ||
-	     test "$build_libtool_libs" = no; then
+	     test yes != "$dlopen_support" ||
+	     test no = "$build_libtool_libs"
+	  then
 	    # If there is no dlname, no dlopen support or we're linking
 	    # statically, we need to preload.  We also need to preload any
 	    # dependent libraries so libltdl's deplib preloader doesn't
@@ -6497,40 +7764,40 @@
 
 	# We need an absolute path.
 	case $ladir in
-	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
+	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;;
 	*)
 	  abs_ladir=`cd "$ladir" && pwd`
 	  if test -z "$abs_ladir"; then
-	    func_warning "cannot determine absolute directory name of \`$ladir'"
+	    func_warning "cannot determine absolute directory name of '$ladir'"
 	    func_warning "passing it literally to the linker, although it might fail"
-	    abs_ladir="$ladir"
+	    abs_ladir=$ladir
 	  fi
 	  ;;
 	esac
 	func_basename "$lib"
-	laname="$func_basename_result"
+	laname=$func_basename_result
 
 	# Find the relevant object directory and library name.
-	if test "X$installed" = Xyes; then
+	if test yes = "$installed"; then
 	  if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
-	    func_warning "library \`$lib' was moved."
-	    dir="$ladir"
-	    absdir="$abs_ladir"
-	    libdir="$abs_ladir"
+	    func_warning "library '$lib' was moved."
+	    dir=$ladir
+	    absdir=$abs_ladir
+	    libdir=$abs_ladir
 	  else
-	    dir="$lt_sysroot$libdir"
-	    absdir="$lt_sysroot$libdir"
+	    dir=$lt_sysroot$libdir
+	    absdir=$lt_sysroot$libdir
 	  fi
-	  test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
+	  test yes = "$hardcode_automatic" && avoidtemprpath=yes
 	else
 	  if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
-	    dir="$ladir"
-	    absdir="$abs_ladir"
+	    dir=$ladir
+	    absdir=$abs_ladir
 	    # Remove this search path later
 	    func_append notinst_path " $abs_ladir"
 	  else
-	    dir="$ladir/$objdir"
-	    absdir="$abs_ladir/$objdir"
+	    dir=$ladir/$objdir
+	    absdir=$abs_ladir/$objdir
 	    # Remove this search path later
 	    func_append notinst_path " $abs_ladir"
 	  fi
@@ -6539,11 +7806,11 @@
 	name=$func_stripname_result
 
 	# This library was specified with -dlpreopen.
-	if test "$pass" = dlpreopen; then
-	  if test -z "$libdir" && test "$linkmode" = prog; then
-	    func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
+	if test dlpreopen = "$pass"; then
+	  if test -z "$libdir" && test prog = "$linkmode"; then
+	    func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'"
 	  fi
-	  case "$host" in
+	  case $host in
 	    # special handling for platforms with PE-DLLs.
 	    *cygwin* | *mingw* | *cegcc* )
 	      # Linker will automatically link against shared library if both
@@ -6587,9 +7854,9 @@
 
 	if test -z "$libdir"; then
 	  # Link the convenience library
-	  if test "$linkmode" = lib; then
+	  if test lib = "$linkmode"; then
 	    deplibs="$dir/$old_library $deplibs"
-	  elif test "$linkmode,$pass" = "prog,link"; then
+	  elif test prog,link = "$linkmode,$pass"; then
 	    compile_deplibs="$dir/$old_library $compile_deplibs"
 	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
 	  else
@@ -6599,14 +7866,14 @@
 	fi
 
 
-	if test "$linkmode" = prog && test "$pass" != link; then
+	if test prog = "$linkmode" && test link != "$pass"; then
 	  func_append newlib_search_path " $ladir"
 	  deplibs="$lib $deplibs"
 
-	  linkalldeplibs=no
-	  if test "$link_all_deplibs" != no || test -z "$library_names" ||
-	     test "$build_libtool_libs" = no; then
-	    linkalldeplibs=yes
+	  linkalldeplibs=false
+	  if test no != "$link_all_deplibs" || test -z "$library_names" ||
+	     test no = "$build_libtool_libs"; then
+	    linkalldeplibs=:
 	  fi
 
 	  tmp_libs=
@@ -6618,14 +7885,14 @@
 		 ;;
 	    esac
 	    # Need to link against all dependency_libs?
-	    if test "$linkalldeplibs" = yes; then
+	    if $linkalldeplibs; then
 	      deplibs="$deplib $deplibs"
 	    else
 	      # Need to hardcode shared library paths
 	      # or/and link against static libraries
 	      newdependency_libs="$deplib $newdependency_libs"
 	    fi
-	    if $opt_preserve_dup_deps ; then
+	    if $opt_preserve_dup_deps; then
 	      case "$tmp_libs " in
 	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
 	      esac
@@ -6635,15 +7902,15 @@
 	  continue
 	fi # $linkmode = prog...
 
-	if test "$linkmode,$pass" = "prog,link"; then
+	if test prog,link = "$linkmode,$pass"; then
 	  if test -n "$library_names" &&
-	     { { test "$prefer_static_libs" = no ||
-	         test "$prefer_static_libs,$installed" = "built,yes"; } ||
+	     { { test no = "$prefer_static_libs" ||
+	         test built,yes = "$prefer_static_libs,$installed"; } ||
 	       test -z "$old_library"; }; then
 	    # We need to hardcode the library path
-	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
+	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then
 	      # Make sure the rpath contains only unique directories.
-	      case "$temp_rpath:" in
+	      case $temp_rpath: in
 	      *"$absdir:"*) ;;
 	      *) func_append temp_rpath "$absdir:" ;;
 	      esac
@@ -6672,9 +7939,9 @@
 	    esac
 	  fi # $linkmode,$pass = prog,link...
 
-	  if test "$alldeplibs" = yes &&
-	     { test "$deplibs_check_method" = pass_all ||
-	       { test "$build_libtool_libs" = yes &&
+	  if $alldeplibs &&
+	     { test pass_all = "$deplibs_check_method" ||
+	       { test yes = "$build_libtool_libs" &&
 		 test -n "$library_names"; }; }; then
 	    # We only need to search for static libraries
 	    continue
@@ -6683,11 +7950,11 @@
 
 	link_static=no # Whether the deplib will be linked statically
 	use_static_libs=$prefer_static_libs
-	if test "$use_static_libs" = built && test "$installed" = yes; then
+	if test built = "$use_static_libs" && test yes = "$installed"; then
 	  use_static_libs=no
 	fi
 	if test -n "$library_names" &&
-	   { test "$use_static_libs" = no || test -z "$old_library"; }; then
+	   { test no = "$use_static_libs" || test -z "$old_library"; }; then
 	  case $host in
 	  *cygwin* | *mingw* | *cegcc*)
 	      # No point in relinking DLLs because paths are not encoded
@@ -6695,7 +7962,7 @@
 	      need_relink=no
 	    ;;
 	  *)
-	    if test "$installed" = no; then
+	    if test no = "$installed"; then
 	      func_append notinst_deplibs " $lib"
 	      need_relink=yes
 	    fi
@@ -6705,24 +7972,24 @@
 
 	  # Warn about portability, can't link against -module's on some
 	  # systems (darwin).  Don't bleat about dlopened modules though!
-	  dlopenmodule=""
+	  dlopenmodule=
 	  for dlpremoduletest in $dlprefiles; do
 	    if test "X$dlpremoduletest" = "X$lib"; then
-	      dlopenmodule="$dlpremoduletest"
+	      dlopenmodule=$dlpremoduletest
 	      break
 	    fi
 	  done
-	  if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
+	  if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then
 	    echo
-	    if test "$linkmode" = prog; then
+	    if test prog = "$linkmode"; then
 	      $ECHO "*** Warning: Linking the executable $output against the loadable module"
 	    else
 	      $ECHO "*** Warning: Linking the shared library $output against the loadable module"
 	    fi
 	    $ECHO "*** $linklib is not portable!"
 	  fi
-	  if test "$linkmode" = lib &&
-	     test "$hardcode_into_libs" = yes; then
+	  if test lib = "$linkmode" &&
+	     test yes = "$hardcode_into_libs"; then
 	    # Hardcode the library path.
 	    # Skip directories that are in the system default run-time
 	    # search path.
@@ -6750,43 +8017,43 @@
 	    # figure out the soname
 	    set dummy $library_names
 	    shift
-	    realname="$1"
+	    realname=$1
 	    shift
 	    libname=`eval "\\$ECHO \"$libname_spec\""`
 	    # use dlname if we got it. it's perfectly good, no?
 	    if test -n "$dlname"; then
-	      soname="$dlname"
+	      soname=$dlname
 	    elif test -n "$soname_spec"; then
 	      # bleh windows
 	      case $host in
 	      *cygwin* | mingw* | *cegcc*)
 	        func_arith $current - $age
 		major=$func_arith_result
-		versuffix="-$major"
+		versuffix=-$major
 		;;
 	      esac
 	      eval soname=\"$soname_spec\"
 	    else
-	      soname="$realname"
+	      soname=$realname
 	    fi
 
 	    # Make a new name for the extract_expsyms_cmds to use
-	    soroot="$soname"
+	    soroot=$soname
 	    func_basename "$soroot"
-	    soname="$func_basename_result"
+	    soname=$func_basename_result
 	    func_stripname 'lib' '.dll' "$soname"
 	    newlib=libimp-$func_stripname_result.a
 
 	    # If the library has no export list, then create one now
 	    if test -f "$output_objdir/$soname-def"; then :
 	    else
-	      func_verbose "extracting exported symbol list from \`$soname'"
+	      func_verbose "extracting exported symbol list from '$soname'"
 	      func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
 	    fi
 
 	    # Create $newlib
 	    if test -f "$output_objdir/$newlib"; then :; else
-	      func_verbose "generating import library for \`$soname'"
+	      func_verbose "generating import library for '$soname'"
 	      func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
 	    fi
 	    # make sure the library variables are pointing to the new library
@@ -6794,58 +8061,58 @@
 	    linklib=$newlib
 	  fi # test -n "$old_archive_from_expsyms_cmds"
 
-	  if test "$linkmode" = prog || test "$opt_mode" != relink; then
+	  if test prog = "$linkmode" || test relink != "$opt_mode"; then
 	    add_shlibpath=
 	    add_dir=
 	    add=
 	    lib_linked=yes
 	    case $hardcode_action in
 	    immediate | unsupported)
-	      if test "$hardcode_direct" = no; then
-		add="$dir/$linklib"
+	      if test no = "$hardcode_direct"; then
+		add=$dir/$linklib
 		case $host in
-		  *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
-		  *-*-sysv4*uw2*) add_dir="-L$dir" ;;
+		  *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;
+		  *-*-sysv4*uw2*) add_dir=-L$dir ;;
 		  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
-		    *-*-unixware7*) add_dir="-L$dir" ;;
+		    *-*-unixware7*) add_dir=-L$dir ;;
 		  *-*-darwin* )
-		    # if the lib is a (non-dlopened) module then we can not
+		    # if the lib is a (non-dlopened) module then we cannot
 		    # link against it, someone is ignoring the earlier warnings
 		    if /usr/bin/file -L $add 2> /dev/null |
-			 $GREP ": [^:]* bundle" >/dev/null ; then
+			 $GREP ": [^:]* bundle" >/dev/null; then
 		      if test "X$dlopenmodule" != "X$lib"; then
 			$ECHO "*** Warning: lib $linklib is a module, not a shared library"
-			if test -z "$old_library" ; then
+			if test -z "$old_library"; then
 			  echo
 			  echo "*** And there doesn't seem to be a static archive available"
 			  echo "*** The link will probably fail, sorry"
 			else
-			  add="$dir/$old_library"
+			  add=$dir/$old_library
 			fi
 		      elif test -n "$old_library"; then
-			add="$dir/$old_library"
+			add=$dir/$old_library
 		      fi
 		    fi
 		esac
-	      elif test "$hardcode_minus_L" = no; then
+	      elif test no = "$hardcode_minus_L"; then
 		case $host in
-		*-*-sunos*) add_shlibpath="$dir" ;;
+		*-*-sunos*) add_shlibpath=$dir ;;
 		esac
-		add_dir="-L$dir"
-		add="-l$name"
-	      elif test "$hardcode_shlibpath_var" = no; then
-		add_shlibpath="$dir"
-		add="-l$name"
+		add_dir=-L$dir
+		add=-l$name
+	      elif test no = "$hardcode_shlibpath_var"; then
+		add_shlibpath=$dir
+		add=-l$name
 	      else
 		lib_linked=no
 	      fi
 	      ;;
 	    relink)
-	      if test "$hardcode_direct" = yes &&
-	         test "$hardcode_direct_absolute" = no; then
-		add="$dir/$linklib"
-	      elif test "$hardcode_minus_L" = yes; then
-		add_dir="-L$absdir"
+	      if test yes = "$hardcode_direct" &&
+	         test no = "$hardcode_direct_absolute"; then
+		add=$dir/$linklib
+	      elif test yes = "$hardcode_minus_L"; then
+		add_dir=-L$absdir
 		# Try looking first in the location we're being installed to.
 		if test -n "$inst_prefix_dir"; then
 		  case $libdir in
@@ -6854,10 +8121,10 @@
 		      ;;
 		  esac
 		fi
-		add="-l$name"
-	      elif test "$hardcode_shlibpath_var" = yes; then
-		add_shlibpath="$dir"
-		add="-l$name"
+		add=-l$name
+	      elif test yes = "$hardcode_shlibpath_var"; then
+		add_shlibpath=$dir
+		add=-l$name
 	      else
 		lib_linked=no
 	      fi
@@ -6865,7 +8132,7 @@
 	    *) lib_linked=no ;;
 	    esac
 
-	    if test "$lib_linked" != yes; then
+	    if test yes != "$lib_linked"; then
 	      func_fatal_configuration "unsupported hardcode properties"
 	    fi
 
@@ -6875,15 +8142,15 @@
 	      *) func_append compile_shlibpath "$add_shlibpath:" ;;
 	      esac
 	    fi
-	    if test "$linkmode" = prog; then
+	    if test prog = "$linkmode"; then
 	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
 	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
 	    else
 	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
 	      test -n "$add" && deplibs="$add $deplibs"
-	      if test "$hardcode_direct" != yes &&
-		 test "$hardcode_minus_L" != yes &&
-		 test "$hardcode_shlibpath_var" = yes; then
+	      if test yes != "$hardcode_direct" &&
+		 test yes != "$hardcode_minus_L" &&
+		 test yes = "$hardcode_shlibpath_var"; then
 		case :$finalize_shlibpath: in
 		*":$libdir:"*) ;;
 		*) func_append finalize_shlibpath "$libdir:" ;;
@@ -6892,33 +8159,33 @@
 	    fi
 	  fi
 
-	  if test "$linkmode" = prog || test "$opt_mode" = relink; then
+	  if test prog = "$linkmode" || test relink = "$opt_mode"; then
 	    add_shlibpath=
 	    add_dir=
 	    add=
 	    # Finalize command for both is simple: just hardcode it.
-	    if test "$hardcode_direct" = yes &&
-	       test "$hardcode_direct_absolute" = no; then
-	      add="$libdir/$linklib"
-	    elif test "$hardcode_minus_L" = yes; then
-	      add_dir="-L$libdir"
-	      add="-l$name"
-	    elif test "$hardcode_shlibpath_var" = yes; then
+	    if test yes = "$hardcode_direct" &&
+	       test no = "$hardcode_direct_absolute"; then
+	      add=$libdir/$linklib
+	    elif test yes = "$hardcode_minus_L"; then
+	      add_dir=-L$libdir
+	      add=-l$name
+	    elif test yes = "$hardcode_shlibpath_var"; then
 	      case :$finalize_shlibpath: in
 	      *":$libdir:"*) ;;
 	      *) func_append finalize_shlibpath "$libdir:" ;;
 	      esac
-	      add="-l$name"
-	    elif test "$hardcode_automatic" = yes; then
+	      add=-l$name
+	    elif test yes = "$hardcode_automatic"; then
 	      if test -n "$inst_prefix_dir" &&
-		 test -f "$inst_prefix_dir$libdir/$linklib" ; then
-		add="$inst_prefix_dir$libdir/$linklib"
+		 test -f "$inst_prefix_dir$libdir/$linklib"; then
+		add=$inst_prefix_dir$libdir/$linklib
 	      else
-		add="$libdir/$linklib"
+		add=$libdir/$linklib
 	      fi
 	    else
 	      # We cannot seem to hardcode it, guess we'll fake it.
-	      add_dir="-L$libdir"
+	      add_dir=-L$libdir
 	      # Try looking first in the location we're being installed to.
 	      if test -n "$inst_prefix_dir"; then
 		case $libdir in
@@ -6927,10 +8194,10 @@
 		    ;;
 		esac
 	      fi
-	      add="-l$name"
+	      add=-l$name
 	    fi
 
-	    if test "$linkmode" = prog; then
+	    if test prog = "$linkmode"; then
 	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
 	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
 	    else
@@ -6938,43 +8205,43 @@
 	      test -n "$add" && deplibs="$add $deplibs"
 	    fi
 	  fi
-	elif test "$linkmode" = prog; then
+	elif test prog = "$linkmode"; then
 	  # Here we assume that one of hardcode_direct or hardcode_minus_L
 	  # is not unsupported.  This is valid on all known static and
 	  # shared platforms.
-	  if test "$hardcode_direct" != unsupported; then
-	    test -n "$old_library" && linklib="$old_library"
+	  if test unsupported != "$hardcode_direct"; then
+	    test -n "$old_library" && linklib=$old_library
 	    compile_deplibs="$dir/$linklib $compile_deplibs"
 	    finalize_deplibs="$dir/$linklib $finalize_deplibs"
 	  else
 	    compile_deplibs="-l$name -L$dir $compile_deplibs"
 	    finalize_deplibs="-l$name -L$dir $finalize_deplibs"
 	  fi
-	elif test "$build_libtool_libs" = yes; then
+	elif test yes = "$build_libtool_libs"; then
 	  # Not a shared library
-	  if test "$deplibs_check_method" != pass_all; then
+	  if test pass_all != "$deplibs_check_method"; then
 	    # We're trying link a shared library against a static one
 	    # but the system doesn't support it.
 
 	    # Just print a warning and add the library to dependency_libs so
 	    # that the program can be linked against the static library.
 	    echo
-	    $ECHO "*** Warning: This system can not link to static lib archive $lib."
+	    $ECHO "*** Warning: This system cannot link to static lib archive $lib."
 	    echo "*** I have the capability to make that library automatically link in when"
 	    echo "*** you link to this library.  But I can only do this if you have a"
 	    echo "*** shared version of the library, which you do not appear to have."
-	    if test "$module" = yes; then
+	    if test yes = "$module"; then
 	      echo "*** But as you try to build a module library, libtool will still create "
 	      echo "*** a static module, that should work as long as the dlopening application"
 	      echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
 	      if test -z "$global_symbol_pipe"; then
 		echo
 		echo "*** However, this would only work if libtool was able to extract symbol"
-		echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+		echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
 		echo "*** not find such a program.  So, this module is probably useless."
-		echo "*** \`nm' from GNU binutils and a full rebuild may help."
+		echo "*** 'nm' from GNU binutils and a full rebuild may help."
 	      fi
-	      if test "$build_old_libs" = no; then
+	      if test no = "$build_old_libs"; then
 		build_libtool_libs=module
 		build_old_libs=yes
 	      else
@@ -6987,11 +8254,11 @@
 	  fi
 	fi # link shared/static library?
 
-	if test "$linkmode" = lib; then
+	if test lib = "$linkmode"; then
 	  if test -n "$dependency_libs" &&
-	     { test "$hardcode_into_libs" != yes ||
-	       test "$build_old_libs" = yes ||
-	       test "$link_static" = yes; }; then
+	     { test yes != "$hardcode_into_libs" ||
+	       test yes = "$build_old_libs" ||
+	       test yes = "$link_static"; }; then
 	    # Extract -R from dependency_libs
 	    temp_deplibs=
 	    for libdir in $dependency_libs; do
@@ -7005,12 +8272,12 @@
 	      *) func_append temp_deplibs " $libdir";;
 	      esac
 	    done
-	    dependency_libs="$temp_deplibs"
+	    dependency_libs=$temp_deplibs
 	  fi
 
 	  func_append newlib_search_path " $absdir"
 	  # Link against this library
-	  test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+	  test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
 	  # ... and its dependency_libs
 	  tmp_libs=
 	  for deplib in $dependency_libs; do
@@ -7020,7 +8287,7 @@
                    func_resolve_sysroot "$func_stripname_result";;
               *) func_resolve_sysroot "$deplib" ;;
             esac
-	    if $opt_preserve_dup_deps ; then
+	    if $opt_preserve_dup_deps; then
 	      case "$tmp_libs " in
 	      *" $func_resolve_sysroot_result "*)
                 func_append specialdeplibs " $func_resolve_sysroot_result" ;;
@@ -7029,12 +8296,12 @@
 	    func_append tmp_libs " $func_resolve_sysroot_result"
 	  done
 
-	  if test "$link_all_deplibs" != no; then
+	  if test no != "$link_all_deplibs"; then
 	    # Add the search paths of all dependency libraries
 	    for deplib in $dependency_libs; do
 	      path=
 	      case $deplib in
-	      -L*) path="$deplib" ;;
+	      -L*) path=$deplib ;;
 	      *.la)
 	        func_resolve_sysroot "$deplib"
 	        deplib=$func_resolve_sysroot_result
@@ -7042,12 +8309,12 @@
 		dir=$func_dirname_result
 		# We need an absolute path.
 		case $dir in
-		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+		[\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;;
 		*)
 		  absdir=`cd "$dir" && pwd`
 		  if test -z "$absdir"; then
-		    func_warning "cannot determine absolute directory name of \`$dir'"
-		    absdir="$dir"
+		    func_warning "cannot determine absolute directory name of '$dir'"
+		    absdir=$dir
 		  fi
 		  ;;
 		esac
@@ -7055,35 +8322,35 @@
 		case $host in
 		*-*-darwin*)
 		  depdepl=
-		  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
-		  if test -n "$deplibrary_names" ; then
-		    for tmp in $deplibrary_names ; do
+		  eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+		  if test -n "$deplibrary_names"; then
+		    for tmp in $deplibrary_names; do
 		      depdepl=$tmp
 		    done
-		    if test -f "$absdir/$objdir/$depdepl" ; then
-		      depdepl="$absdir/$objdir/$depdepl"
-		      darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+		    if test -f "$absdir/$objdir/$depdepl"; then
+		      depdepl=$absdir/$objdir/$depdepl
+		      darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
                       if test -z "$darwin_install_name"; then
-                          darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
+                          darwin_install_name=`$OTOOL64 -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
                       fi
-		      func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
-		      func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
+		      func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl"
+		      func_append linker_flags " -dylib_file $darwin_install_name:$depdepl"
 		      path=
 		    fi
 		  fi
 		  ;;
 		*)
-		  path="-L$absdir/$objdir"
+		  path=-L$absdir/$objdir
 		  ;;
 		esac
 		else
-		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+		  eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
 		  test -z "$libdir" && \
-		    func_fatal_error "\`$deplib' is not a valid libtool archive"
+		    func_fatal_error "'$deplib' is not a valid libtool archive"
 		  test "$absdir" != "$libdir" && \
-		    func_warning "\`$deplib' seems to be moved"
+		    func_warning "'$deplib' seems to be moved"
 
-		  path="-L$absdir"
+		  path=-L$absdir
 		fi
 		;;
 	      esac
@@ -7095,23 +8362,23 @@
 	  fi # link_all_deplibs != no
 	fi # linkmode = lib
       done # for deplib in $libs
-      if test "$pass" = link; then
-	if test "$linkmode" = "prog"; then
+      if test link = "$pass"; then
+	if test prog = "$linkmode"; then
 	  compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
 	  finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
 	else
 	  compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
 	fi
       fi
-      dependency_libs="$newdependency_libs"
-      if test "$pass" = dlpreopen; then
+      dependency_libs=$newdependency_libs
+      if test dlpreopen = "$pass"; then
 	# Link the dlpreopened libraries before other libraries
 	for deplib in $save_deplibs; do
 	  deplibs="$deplib $deplibs"
 	done
       fi
-      if test "$pass" != dlopen; then
-	if test "$pass" != conv; then
+      if test dlopen != "$pass"; then
+	test conv = "$pass" || {
 	  # Make sure lib_search_path contains only unique directories.
 	  lib_search_path=
 	  for dir in $newlib_search_path; do
@@ -7121,12 +8388,12 @@
 	    esac
 	  done
 	  newlib_search_path=
-	fi
+	}
 
-	if test "$linkmode,$pass" != "prog,link"; then
-	  vars="deplibs"
-	else
+	if test prog,link = "$linkmode,$pass"; then
 	  vars="compile_deplibs finalize_deplibs"
+	else
+	  vars=deplibs
 	fi
 	for var in $vars dependency_libs; do
 	  # Add libraries to $var in reverse order
@@ -7187,59 +8454,59 @@
       # Last step: remove runtime libs from dependency_libs
       # (they stay in deplibs)
       tmp_libs=
-      for i in $dependency_libs ; do
+      for i in $dependency_libs; do
 	case " $predeps $postdeps $compiler_lib_search_path " in
 	*" $i "*)
-	  i=""
+	  i=
 	  ;;
 	esac
-	if test -n "$i" ; then
+	if test -n "$i"; then
 	  func_append tmp_libs " $i"
 	fi
       done
       dependency_libs=$tmp_libs
     done # for pass
-    if test "$linkmode" = prog; then
-      dlfiles="$newdlfiles"
+    if test prog = "$linkmode"; then
+      dlfiles=$newdlfiles
     fi
-    if test "$linkmode" = prog || test "$linkmode" = lib; then
-      dlprefiles="$newdlprefiles"
+    if test prog = "$linkmode" || test lib = "$linkmode"; then
+      dlprefiles=$newdlprefiles
     fi
 
     case $linkmode in
     oldlib)
-      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
-	func_warning "\`-dlopen' is ignored for archives"
+      if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
+	func_warning "'-dlopen' is ignored for archives"
       fi
 
       case " $deplibs" in
       *\ -l* | *\ -L*)
-	func_warning "\`-l' and \`-L' are ignored for archives" ;;
+	func_warning "'-l' and '-L' are ignored for archives" ;;
       esac
 
       test -n "$rpath" && \
-	func_warning "\`-rpath' is ignored for archives"
+	func_warning "'-rpath' is ignored for archives"
 
       test -n "$xrpath" && \
-	func_warning "\`-R' is ignored for archives"
+	func_warning "'-R' is ignored for archives"
 
       test -n "$vinfo" && \
-	func_warning "\`-version-info/-version-number' is ignored for archives"
+	func_warning "'-version-info/-version-number' is ignored for archives"
 
       test -n "$release" && \
-	func_warning "\`-release' is ignored for archives"
+	func_warning "'-release' is ignored for archives"
 
       test -n "$export_symbols$export_symbols_regex" && \
-	func_warning "\`-export-symbols' is ignored for archives"
+	func_warning "'-export-symbols' is ignored for archives"
 
       # Now set the variables for building old libraries.
       build_libtool_libs=no
-      oldlibs="$output"
+      oldlibs=$output
       func_append objs "$old_deplibs"
       ;;
 
     lib)
-      # Make sure we only generate libraries of the form `libNAME.la'.
+      # Make sure we only generate libraries of the form 'libNAME.la'.
       case $outputname in
       lib*)
 	func_stripname 'lib' '.la' "$outputname"
@@ -7248,10 +8515,10 @@
 	eval libname=\"$libname_spec\"
 	;;
       *)
-	test "$module" = no && \
-	  func_fatal_help "libtool library \`$output' must begin with \`lib'"
+	test no = "$module" \
+	  && func_fatal_help "libtool library '$output' must begin with 'lib'"
 
-	if test "$need_lib_prefix" != no; then
+	if test no != "$need_lib_prefix"; then
 	  # Add the "lib" prefix for modules if required
 	  func_stripname '' '.la' "$outputname"
 	  name=$func_stripname_result
@@ -7265,8 +8532,8 @@
       esac
 
       if test -n "$objs"; then
-	if test "$deplibs_check_method" != pass_all; then
-	  func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
+	if test pass_all != "$deplibs_check_method"; then
+	  func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs"
 	else
 	  echo
 	  $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
@@ -7275,21 +8542,21 @@
 	fi
       fi
 
-      test "$dlself" != no && \
-	func_warning "\`-dlopen self' is ignored for libtool libraries"
+      test no = "$dlself" \
+	|| func_warning "'-dlopen self' is ignored for libtool libraries"
 
       set dummy $rpath
       shift
-      test "$#" -gt 1 && \
-	func_warning "ignoring multiple \`-rpath's for a libtool library"
+      test 1 -lt "$#" \
+	&& func_warning "ignoring multiple '-rpath's for a libtool library"
 
-      install_libdir="$1"
+      install_libdir=$1
 
       oldlibs=
       if test -z "$rpath"; then
-	if test "$build_libtool_libs" = yes; then
+	if test yes = "$build_libtool_libs"; then
 	  # Building a libtool convenience library.
-	  # Some compilers have problems with a `.al' extension so
+	  # Some compilers have problems with a '.al' extension so
 	  # convenience libraries should have the same extension an
 	  # archive normally would.
 	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
@@ -7298,20 +8565,20 @@
 	fi
 
 	test -n "$vinfo" && \
-	  func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
+	  func_warning "'-version-info/-version-number' is ignored for convenience libraries"
 
 	test -n "$release" && \
-	  func_warning "\`-release' is ignored for convenience libraries"
+	  func_warning "'-release' is ignored for convenience libraries"
       else
 
 	# Parse the version information argument.
-	save_ifs="$IFS"; IFS=':'
+	save_ifs=$IFS; IFS=:
 	set dummy $vinfo 0 0 0
 	shift
-	IFS="$save_ifs"
+	IFS=$save_ifs
 
 	test -n "$7" && \
-	  func_fatal_help "too many parameters to \`-version-info'"
+	  func_fatal_help "too many parameters to '-version-info'"
 
 	# convert absolute version numbers to libtool ages
 	# this retains compatibility with .la files and attempts
@@ -7319,42 +8586,42 @@
 
 	case $vinfo_number in
 	yes)
-	  number_major="$1"
-	  number_minor="$2"
-	  number_revision="$3"
+	  number_major=$1
+	  number_minor=$2
+	  number_revision=$3
 	  #
 	  # There are really only two kinds -- those that
 	  # use the current revision as the major version
 	  # and those that subtract age and use age as
 	  # a minor version.  But, then there is irix
-	  # which has an extra 1 added just for fun
+	  # that has an extra 1 added just for fun
 	  #
 	  case $version_type in
 	  # correct linux to gnu/linux during the next big refactor
 	  darwin|linux|osf|windows|none)
 	    func_arith $number_major + $number_minor
 	    current=$func_arith_result
-	    age="$number_minor"
-	    revision="$number_revision"
+	    age=$number_minor
+	    revision=$number_revision
 	    ;;
 	  freebsd-aout|freebsd-elf|qnx|sunos)
-	    current="$number_major"
-	    revision="$number_minor"
-	    age="0"
+	    current=$number_major
+	    revision=$number_minor
+	    age=0
 	    ;;
 	  irix|nonstopux)
 	    func_arith $number_major + $number_minor
 	    current=$func_arith_result
-	    age="$number_minor"
-	    revision="$number_minor"
+	    age=$number_minor
+	    revision=$number_minor
 	    lt_irix_increment=no
 	    ;;
 	  esac
 	  ;;
 	no)
-	  current="$1"
-	  revision="$2"
-	  age="$3"
+	  current=$1
+	  revision=$2
+	  age=$3
 	  ;;
 	esac
 
@@ -7362,30 +8629,30 @@
 	case $current in
 	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
 	*)
-	  func_error "CURRENT \`$current' must be a nonnegative integer"
-	  func_fatal_error "\`$vinfo' is not valid version information"
+	  func_error "CURRENT '$current' must be a nonnegative integer"
+	  func_fatal_error "'$vinfo' is not valid version information"
 	  ;;
 	esac
 
 	case $revision in
 	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
 	*)
-	  func_error "REVISION \`$revision' must be a nonnegative integer"
-	  func_fatal_error "\`$vinfo' is not valid version information"
+	  func_error "REVISION '$revision' must be a nonnegative integer"
+	  func_fatal_error "'$vinfo' is not valid version information"
 	  ;;
 	esac
 
 	case $age in
 	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
 	*)
-	  func_error "AGE \`$age' must be a nonnegative integer"
-	  func_fatal_error "\`$vinfo' is not valid version information"
+	  func_error "AGE '$age' must be a nonnegative integer"
+	  func_fatal_error "'$vinfo' is not valid version information"
 	  ;;
 	esac
 
 	if test "$age" -gt "$current"; then
-	  func_error "AGE \`$age' is greater than the current interface number \`$current'"
-	  func_fatal_error "\`$vinfo' is not valid version information"
+	  func_error "AGE '$age' is greater than the current interface number '$current'"
+	  func_fatal_error "'$vinfo' is not valid version information"
 	fi
 
 	# Calculate the version variables.
@@ -7400,26 +8667,35 @@
 	  # verstring for coding it into the library header
 	  func_arith $current - $age
 	  major=.$func_arith_result
-	  versuffix="$major.$age.$revision"
+	  versuffix=$major.$age.$revision
 	  # Darwin ld doesn't like 0 for these options...
 	  func_arith $current + 1
 	  minor_current=$func_arith_result
-	  xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
+	  xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
 	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+          # On Darwin other compilers
+          case $CC in
+              nagfor*)
+                  verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
+                  ;;
+              *)
+                  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+                  ;;
+          esac
 	  ;;
 
 	freebsd-aout)
-	  major=".$current"
-	  versuffix=".$current.$revision";
+	  major=.$current
+	  versuffix=.$current.$revision
 	  ;;
 
 	freebsd-elf)
-	  major=".$current"
-	  versuffix=".$current"
+	  major=.$current
+	  versuffix=.$current
 	  ;;
 
 	irix | nonstopux)
-	  if test "X$lt_irix_increment" = "Xno"; then
+	  if test no = "$lt_irix_increment"; then
 	    func_arith $current - $age
 	  else
 	    func_arith $current - $age + 1
@@ -7430,69 +8706,69 @@
 	    nonstopux) verstring_prefix=nonstopux ;;
 	    *)         verstring_prefix=sgi ;;
 	  esac
-	  verstring="$verstring_prefix$major.$revision"
+	  verstring=$verstring_prefix$major.$revision
 
 	  # Add in all the interfaces that we are compatible with.
 	  loop=$revision
-	  while test "$loop" -ne 0; do
+	  while test 0 -ne "$loop"; do
 	    func_arith $revision - $loop
 	    iface=$func_arith_result
 	    func_arith $loop - 1
 	    loop=$func_arith_result
-	    verstring="$verstring_prefix$major.$iface:$verstring"
+	    verstring=$verstring_prefix$major.$iface:$verstring
 	  done
 
-	  # Before this point, $major must not contain `.'.
+	  # Before this point, $major must not contain '.'.
 	  major=.$major
-	  versuffix="$major.$revision"
+	  versuffix=$major.$revision
 	  ;;
 
 	linux) # correct to gnu/linux during the next big refactor
 	  func_arith $current - $age
 	  major=.$func_arith_result
-	  versuffix="$major.$age.$revision"
+	  versuffix=$major.$age.$revision
 	  ;;
 
 	osf)
 	  func_arith $current - $age
 	  major=.$func_arith_result
-	  versuffix=".$current.$age.$revision"
-	  verstring="$current.$age.$revision"
+	  versuffix=.$current.$age.$revision
+	  verstring=$current.$age.$revision
 
 	  # Add in all the interfaces that we are compatible with.
 	  loop=$age
-	  while test "$loop" -ne 0; do
+	  while test 0 -ne "$loop"; do
 	    func_arith $current - $loop
 	    iface=$func_arith_result
 	    func_arith $loop - 1
 	    loop=$func_arith_result
-	    verstring="$verstring:${iface}.0"
+	    verstring=$verstring:$iface.0
 	  done
 
 	  # Make executables depend on our current version.
-	  func_append verstring ":${current}.0"
+	  func_append verstring ":$current.0"
 	  ;;
 
 	qnx)
-	  major=".$current"
-	  versuffix=".$current"
+	  major=.$current
+	  versuffix=.$current
 	  ;;
 
 	sunos)
-	  major=".$current"
-	  versuffix=".$current.$revision"
+	  major=.$current
+	  versuffix=.$current.$revision
 	  ;;
 
 	windows)
 	  # Use '-' rather than '.', since we only want one
-	  # extension on DOS 8.3 filesystems.
+	  # extension on DOS 8.3 file systems.
 	  func_arith $current - $age
 	  major=$func_arith_result
-	  versuffix="-$major"
+	  versuffix=-$major
 	  ;;
 
 	*)
-	  func_fatal_configuration "unknown library version type \`$version_type'"
+	  func_fatal_configuration "unknown library version type '$version_type'"
 	  ;;
 	esac
 
@@ -7506,42 +8782,45 @@
 	    verstring=
 	    ;;
 	  *)
-	    verstring="0.0"
+	    verstring=0.0
 	    ;;
 	  esac
-	  if test "$need_version" = no; then
+	  if test no = "$need_version"; then
 	    versuffix=
 	  else
-	    versuffix=".0.0"
+	    versuffix=.0.0
 	  fi
 	fi
 
 	# Remove version info from name if versioning should be avoided
-	if test "$avoid_version" = yes && test "$need_version" = no; then
+	if test yes,no = "$avoid_version,$need_version"; then
 	  major=
 	  versuffix=
-	  verstring=""
+	  verstring=
 	fi
 
 	# Check to see if the archive will have undefined symbols.
-	if test "$allow_undefined" = yes; then
-	  if test "$allow_undefined_flag" = unsupported; then
-	    func_warning "undefined symbols not allowed in $host shared libraries"
-	    build_libtool_libs=no
-	    build_old_libs=yes
+	if test yes = "$allow_undefined"; then
+	  if test unsupported = "$allow_undefined_flag"; then
+	    if test yes = "$build_old_libs"; then
+	      func_warning "undefined symbols not allowed in $host shared libraries; building static only"
+	      build_libtool_libs=no
+	    else
+	      func_fatal_error "can't build $host shared library unless -no-undefined is specified"
+	    fi
 	  fi
 	else
 	  # Don't allow undefined symbols.
-	  allow_undefined_flag="$no_undefined_flag"
+	  allow_undefined_flag=$no_undefined_flag
 	fi
 
       fi
 
-      func_generate_dlsyms "$libname" "$libname" "yes"
+      func_generate_dlsyms "$libname" "$libname" :
       func_append libobjs " $symfileobj"
-      test "X$libobjs" = "X " && libobjs=
+      test " " = "$libobjs" && libobjs=
 
-      if test "$opt_mode" != relink; then
+      if test relink != "$opt_mode"; then
 	# Remove our outputs, but don't remove object files since they
 	# may have been created when compiling PIC objects.
 	removelist=
@@ -7550,8 +8829,8 @@
 	  case $p in
 	    *.$objext | *.gcno)
 	       ;;
-	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
-	       if test "X$precious_files_regex" != "X"; then
+	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*)
+	       if test -n "$precious_files_regex"; then
 		 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
 		 then
 		   continue
@@ -7567,11 +8846,11 @@
       fi
 
       # Now set the variables for building old libraries.
-      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+      if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then
 	func_append oldlibs " $output_objdir/$libname.$libext"
 
 	# Transform .lo files to .o files.
-	oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
+	oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP`
       fi
 
       # Eliminate all temporary directories.
@@ -7592,13 +8871,13 @@
 	  *) func_append finalize_rpath " $libdir" ;;
 	  esac
 	done
-	if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+	if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then
 	  dependency_libs="$temp_xrpath $dependency_libs"
 	fi
       fi
 
       # Make sure dlfiles contains only unique files that won't be dlpreopened
-      old_dlfiles="$dlfiles"
+      old_dlfiles=$dlfiles
       dlfiles=
       for lib in $old_dlfiles; do
 	case " $dlprefiles $dlfiles " in
@@ -7608,7 +8887,7 @@
       done
 
       # Make sure dlprefiles contains only unique files
-      old_dlprefiles="$dlprefiles"
+      old_dlprefiles=$dlprefiles
       dlprefiles=
       for lib in $old_dlprefiles; do
 	case "$dlprefiles " in
@@ -7617,7 +8896,7 @@
 	esac
       done
 
-      if test "$build_libtool_libs" = yes; then
+      if test yes = "$build_libtool_libs"; then
 	if test -n "$rpath"; then
 	  case $host in
 	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
@@ -7641,7 +8920,7 @@
 	    ;;
 	  *)
 	    # Add libc to deplibs on all other systems if necessary.
-	    if test "$build_libtool_need_lc" = "yes"; then
+	    if test yes = "$build_libtool_need_lc"; then
 	      func_append deplibs " -lc"
 	    fi
 	    ;;
@@ -7657,9 +8936,9 @@
 	# I'm not sure if I'm treating the release correctly.  I think
 	# release should show up in the -l (ie -lgmp5) so we don't want to
 	# add it in twice.  Is that correct?
-	release=""
-	versuffix=""
-	major=""
+	release=
+	versuffix=
+	major=
 	newdeplibs=
 	droppeddeps=no
 	case $deplibs_check_method in
@@ -7688,20 +8967,20 @@
 	      -l*)
 		func_stripname -l '' "$i"
 		name=$func_stripname_result
-		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		if test yes = "$allow_libtool_libs_with_static_runtimes"; then
 		  case " $predeps $postdeps " in
 		  *" $i "*)
 		    func_append newdeplibs " $i"
-		    i=""
+		    i=
 		    ;;
 		  esac
 		fi
-		if test -n "$i" ; then
+		if test -n "$i"; then
 		  libname=`eval "\\$ECHO \"$libname_spec\""`
 		  deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
 		  set dummy $deplib_matches; shift
 		  deplib_match=$1
-		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
 		    func_append newdeplibs " $i"
 		  else
 		    droppeddeps=yes
@@ -7731,20 +9010,20 @@
 		$opt_dry_run || $RM conftest
 		if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
 		  ldd_output=`ldd conftest`
-		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		  if test yes = "$allow_libtool_libs_with_static_runtimes"; then
 		    case " $predeps $postdeps " in
 		    *" $i "*)
 		      func_append newdeplibs " $i"
-		      i=""
+		      i=
 		      ;;
 		    esac
 		  fi
-		  if test -n "$i" ; then
+		  if test -n "$i"; then
 		    libname=`eval "\\$ECHO \"$libname_spec\""`
 		    deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
 		    set dummy $deplib_matches; shift
 		    deplib_match=$1
-		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
 		      func_append newdeplibs " $i"
 		    else
 		      droppeddeps=yes
@@ -7781,24 +9060,24 @@
 	    -l*)
 	      func_stripname -l '' "$a_deplib"
 	      name=$func_stripname_result
-	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+	      if test yes = "$allow_libtool_libs_with_static_runtimes"; then
 		case " $predeps $postdeps " in
 		*" $a_deplib "*)
 		  func_append newdeplibs " $a_deplib"
-		  a_deplib=""
+		  a_deplib=
 		  ;;
 		esac
 	      fi
-	      if test -n "$a_deplib" ; then
+	      if test -n "$a_deplib"; then
 		libname=`eval "\\$ECHO \"$libname_spec\""`
 		if test -n "$file_magic_glob"; then
 		  libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
 		else
 		  libnameglob=$libname
 		fi
-		test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
+		test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob`
 		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
-		  if test "$want_nocaseglob" = yes; then
+		  if test yes = "$want_nocaseglob"; then
 		    shopt -s nocaseglob
 		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
 		    $nocaseglob
@@ -7816,25 +9095,25 @@
 		      # We might still enter an endless loop, since a link
 		      # loop can be closed while we follow links,
 		      # but so what?
-		      potlib="$potent_lib"
+		      potlib=$potent_lib
 		      while test -h "$potlib" 2>/dev/null; do
-			potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+			potliblink=`ls -ld $potlib | $SED 's/.* -> //'`
 			case $potliblink in
-			[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
-			*) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
+			[\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;;
+			*) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";;
 			esac
 		      done
 		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
 			 $SED -e 10q |
 			 $EGREP "$file_magic_regex" > /dev/null; then
 			func_append newdeplibs " $a_deplib"
-			a_deplib=""
+			a_deplib=
 			break 2
 		      fi
 		  done
 		done
 	      fi
-	      if test -n "$a_deplib" ; then
+	      if test -n "$a_deplib"; then
 		droppeddeps=yes
 		echo
 		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
@@ -7842,7 +9121,7 @@
 		echo "*** you link to this library.  But I can only do this if you have a"
 		echo "*** shared version of the library, which you do not appear to have"
 		echo "*** because I did check the linker path looking for a file starting"
-		if test -z "$potlib" ; then
+		if test -z "$potlib"; then
 		  $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
 		else
 		  $ECHO "*** with $libname and none of the candidates passed a file format test"
@@ -7865,30 +9144,30 @@
 	    -l*)
 	      func_stripname -l '' "$a_deplib"
 	      name=$func_stripname_result
-	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+	      if test yes = "$allow_libtool_libs_with_static_runtimes"; then
 		case " $predeps $postdeps " in
 		*" $a_deplib "*)
 		  func_append newdeplibs " $a_deplib"
-		  a_deplib=""
+		  a_deplib=
 		  ;;
 		esac
 	      fi
-	      if test -n "$a_deplib" ; then
+	      if test -n "$a_deplib"; then
 		libname=`eval "\\$ECHO \"$libname_spec\""`
 		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
 		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
 		  for potent_lib in $potential_libs; do
-		    potlib="$potent_lib" # see symlink-check above in file_magic test
+		    potlib=$potent_lib # see symlink-check above in file_magic test
 		    if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
 		       $EGREP "$match_pattern_regex" > /dev/null; then
 		      func_append newdeplibs " $a_deplib"
-		      a_deplib=""
+		      a_deplib=
 		      break 2
 		    fi
 		  done
 		done
 	      fi
-	      if test -n "$a_deplib" ; then
+	      if test -n "$a_deplib"; then
 		droppeddeps=yes
 		echo
 		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
@@ -7896,7 +9175,7 @@
 		echo "*** you link to this library.  But I can only do this if you have a"
 		echo "*** shared version of the library, which you do not appear to have"
 		echo "*** because I did check the linker path looking for a file starting"
-		if test -z "$potlib" ; then
+		if test -z "$potlib"; then
 		  $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
 		else
 		  $ECHO "*** with $libname and none of the candidates passed a file format test"
@@ -7912,18 +9191,18 @@
 	  done # Gone through all deplibs.
 	  ;;
 	none | unknown | *)
-	  newdeplibs=""
+	  newdeplibs=
 	  tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
-	  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-	    for i in $predeps $postdeps ; do
+	  if test yes = "$allow_libtool_libs_with_static_runtimes"; then
+	    for i in $predeps $postdeps; do
 	      # can't use Xsed below, because $i might contain '/'
-	      tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
+	      tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"`
 	    done
 	  fi
 	  case $tmp_deplibs in
 	  *[!\	\ ]*)
 	    echo
-	    if test "X$deplibs_check_method" = "Xnone"; then
+	    if test none = "$deplibs_check_method"; then
 	      echo "*** Warning: inter-library dependencies are not supported in this platform."
 	    else
 	      echo "*** Warning: inter-library dependencies are not known to be supported."
@@ -7947,8 +9226,8 @@
 	  ;;
 	esac
 
-	if test "$droppeddeps" = yes; then
-	  if test "$module" = yes; then
+	if test yes = "$droppeddeps"; then
+	  if test yes = "$module"; then
 	    echo
 	    echo "*** Warning: libtool could not satisfy all declared inter-library"
 	    $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
@@ -7957,12 +9236,12 @@
 	    if test -z "$global_symbol_pipe"; then
 	      echo
 	      echo "*** However, this would only work if libtool was able to extract symbol"
-	      echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+	      echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
 	      echo "*** not find such a program.  So, this module is probably useless."
-	      echo "*** \`nm' from GNU binutils and a full rebuild may help."
+	      echo "*** 'nm' from GNU binutils and a full rebuild may help."
 	    fi
-	    if test "$build_old_libs" = no; then
-	      oldlibs="$output_objdir/$libname.$libext"
+	    if test no = "$build_old_libs"; then
+	      oldlibs=$output_objdir/$libname.$libext
 	      build_libtool_libs=module
 	      build_old_libs=yes
 	    else
@@ -7973,14 +9252,14 @@
 	    echo "*** automatically added whenever a program is linked with this library"
 	    echo "*** or is declared to -dlopen it."
 
-	    if test "$allow_undefined" = no; then
+	    if test no = "$allow_undefined"; then
 	      echo
 	      echo "*** Since this library must not contain undefined symbols,"
 	      echo "*** because either the platform does not support them or"
 	      echo "*** it was explicitly requested with -no-undefined,"
 	      echo "*** libtool will only create a static version of it."
-	      if test "$build_old_libs" = no; then
-		oldlibs="$output_objdir/$libname.$libext"
+	      if test no = "$build_old_libs"; then
+		oldlibs=$output_objdir/$libname.$libext
 		build_libtool_libs=module
 		build_old_libs=yes
 	      else
@@ -8026,7 +9305,7 @@
 	*) func_append new_libs " $deplib" ;;
 	esac
       done
-      deplibs="$new_libs"
+      deplibs=$new_libs
 
       # All the library-specific variables (install_libdir is set above).
       library_names=
@@ -8034,25 +9313,25 @@
       dlname=
 
       # Test again, we may have decided not to build it any more
-      if test "$build_libtool_libs" = yes; then
-	# Remove ${wl} instances when linking with ld.
+      if test yes = "$build_libtool_libs"; then
+	# Remove $wl instances when linking with ld.
 	# FIXME: should test the right _cmds variable.
 	case $archive_cmds in
 	  *\$LD\ *) wl= ;;
         esac
-	if test "$hardcode_into_libs" = yes; then
+	if test yes = "$hardcode_into_libs"; then
 	  # Hardcode the library paths
 	  hardcode_libdirs=
 	  dep_rpath=
-	  rpath="$finalize_rpath"
-	  test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
+	  rpath=$finalize_rpath
+	  test relink = "$opt_mode" || rpath=$compile_rpath$rpath
 	  for libdir in $rpath; do
 	    if test -n "$hardcode_libdir_flag_spec"; then
 	      if test -n "$hardcode_libdir_separator"; then
 		func_replace_sysroot "$libdir"
 		libdir=$func_replace_sysroot_result
 		if test -z "$hardcode_libdirs"; then
-		  hardcode_libdirs="$libdir"
+		  hardcode_libdirs=$libdir
 		else
 		  # Just accumulate the unique libdirs.
 		  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
@@ -8077,7 +9356,7 @@
 	  # Substitute the hardcoded libdirs into the rpath.
 	  if test -n "$hardcode_libdir_separator" &&
 	     test -n "$hardcode_libdirs"; then
-	    libdir="$hardcode_libdirs"
+	    libdir=$hardcode_libdirs
 	    eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
 	  fi
 	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
@@ -8091,8 +9370,8 @@
 	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
 	fi
 
-	shlibpath="$finalize_shlibpath"
-	test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+	shlibpath=$finalize_shlibpath
+	test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath
 	if test -n "$shlibpath"; then
 	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
 	fi
@@ -8102,19 +9381,19 @@
 	eval library_names=\"$library_names_spec\"
 	set dummy $library_names
 	shift
-	realname="$1"
+	realname=$1
 	shift
 
 	if test -n "$soname_spec"; then
 	  eval soname=\"$soname_spec\"
 	else
-	  soname="$realname"
+	  soname=$realname
 	fi
 	if test -z "$dlname"; then
 	  dlname=$soname
 	fi
 
-	lib="$output_objdir/$realname"
+	lib=$output_objdir/$realname
 	linknames=
 	for link
 	do
@@ -8128,7 +9407,7 @@
 	delfiles=
 	if test -n "$export_symbols" && test -n "$include_expsyms"; then
 	  $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
-	  export_symbols="$output_objdir/$libname.uexp"
+	  export_symbols=$output_objdir/$libname.uexp
 	  func_append delfiles " $export_symbols"
 	fi
 
@@ -8137,31 +9416,31 @@
 	cygwin* | mingw* | cegcc*)
 	  if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
 	    # exporting using user supplied symfile
-	    if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
+	    func_dll_def_p "$export_symbols" || {
 	      # and it's NOT already a .def file. Must figure out
 	      # which of the given symbols are data symbols and tag
 	      # them as such. So, trigger use of export_symbols_cmds.
 	      # export_symbols gets reassigned inside the "prepare
 	      # the list of exported symbols" if statement, so the
 	      # include_expsyms logic still works.
-	      orig_export_symbols="$export_symbols"
+	      orig_export_symbols=$export_symbols
 	      export_symbols=
 	      always_export_symbols=yes
-	    fi
+	    }
 	  fi
 	  ;;
 	esac
 
 	# Prepare the list of exported symbols
 	if test -z "$export_symbols"; then
-	  if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
-	    func_verbose "generating symbol list for \`$libname.la'"
-	    export_symbols="$output_objdir/$libname.exp"
+	  if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then
+	    func_verbose "generating symbol list for '$libname.la'"
+	    export_symbols=$output_objdir/$libname.exp
 	    $opt_dry_run || $RM $export_symbols
 	    cmds=$export_symbols_cmds
-	    save_ifs="$IFS"; IFS='~'
+	    save_ifs=$IFS; IFS='~'
 	    for cmd1 in $cmds; do
-	      IFS="$save_ifs"
+	      IFS=$save_ifs
 	      # Take the normal branch if the nm_file_list_spec branch
 	      # doesn't work or if tool conversion is not needed.
 	      case $nm_file_list_spec~$to_tool_file_cmd in
@@ -8175,7 +9454,7 @@
 		  try_normal_branch=no
 		  ;;
 	      esac
-	      if test "$try_normal_branch" = yes \
+	      if test yes = "$try_normal_branch" \
 		 && { test "$len" -lt "$max_cmd_len" \
 		      || test "$max_cmd_len" -le -1; }
 	      then
@@ -8186,7 +9465,7 @@
 		output_la=$func_basename_result
 		save_libobjs=$libobjs
 		save_output=$output
-		output=${output_objdir}/${output_la}.nm
+		output=$output_objdir/$output_la.nm
 		func_to_tool_file "$output"
 		libobjs=$nm_file_list_spec$func_to_tool_file_result
 		func_append delfiles " $output"
@@ -8209,8 +9488,8 @@
 		break
 	      fi
 	    done
-	    IFS="$save_ifs"
-	    if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
+	    IFS=$save_ifs
+	    if test -n "$export_symbols_regex" && test : != "$skipped_export"; then
 	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
 	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
 	    fi
@@ -8218,16 +9497,16 @@
 	fi
 
 	if test -n "$export_symbols" && test -n "$include_expsyms"; then
-	  tmp_export_symbols="$export_symbols"
-	  test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+	  tmp_export_symbols=$export_symbols
+	  test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
 	  $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
 	fi
 
-	if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
+	if test : != "$skipped_export" && test -n "$orig_export_symbols"; then
 	  # The given exports_symbols file has to be filtered, so filter it.
-	  func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+	  func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
 	  # FIXME: $output_objdir/$libname.filter potentially contains lots of
-	  # 's' commands which not all seds can handle. GNU sed should be fine
+	  # 's' commands, which not all seds can handle. GNU sed should be fine
 	  # though. Also, the filter scales superlinearly with the number of
 	  # global variables. join(1) would be nice here, but unfortunately
 	  # isn't a blessed tool.
@@ -8246,11 +9525,11 @@
 	    ;;
 	  esac
 	done
-	deplibs="$tmp_deplibs"
+	deplibs=$tmp_deplibs
 
 	if test -n "$convenience"; then
 	  if test -n "$whole_archive_flag_spec" &&
-	    test "$compiler_needs_object" = yes &&
+	    test yes = "$compiler_needs_object" &&
 	    test -z "$libobjs"; then
 	    # extract the archives, so we have objects to list.
 	    # TODO: could optimize this to just extract one archive.
@@ -8261,7 +9540,7 @@
 	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
 	    test "X$libobjs" = "X " && libobjs=
 	  else
-	    gentop="$output_objdir/${outputname}x"
+	    gentop=$output_objdir/${outputname}x
 	    func_append generated " $gentop"
 
 	    func_extract_archives $gentop $convenience
@@ -8270,18 +9549,18 @@
 	  fi
 	fi
 
-	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+	if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then
 	  eval flag=\"$thread_safe_flag_spec\"
 	  func_append linker_flags " $flag"
 	fi
 
 	# Make a backup of the uninstalled library when relinking
-	if test "$opt_mode" = relink; then
+	if test relink = "$opt_mode"; then
 	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
 	fi
 
 	# Do each of the archive commands.
-	if test "$module" = yes && test -n "$module_cmds" ; then
+	if test yes = "$module" && test -n "$module_cmds"; then
 	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
 	    eval test_cmds=\"$module_expsym_cmds\"
 	    cmds=$module_expsym_cmds
@@ -8299,7 +9578,7 @@
 	  fi
 	fi
 
-	if test "X$skipped_export" != "X:" &&
+	if test : != "$skipped_export" &&
 	   func_len " $test_cmds" &&
 	   len=$func_len_result &&
 	   test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
@@ -8332,8 +9611,8 @@
 	  last_robj=
 	  k=1
 
-	  if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
-	    output=${output_objdir}/${output_la}.lnkscript
+	  if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then
+	    output=$output_objdir/$output_la.lnkscript
 	    func_verbose "creating GNU ld script: $output"
 	    echo 'INPUT (' > $output
 	    for obj in $save_libobjs
@@ -8345,14 +9624,14 @@
 	    func_append delfiles " $output"
 	    func_to_tool_file "$output"
 	    output=$func_to_tool_file_result
-	  elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
-	    output=${output_objdir}/${output_la}.lnk
+	  elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
+	    output=$output_objdir/$output_la.lnk
 	    func_verbose "creating linker input file list: $output"
 	    : > $output
 	    set x $save_libobjs
 	    shift
 	    firstobj=
-	    if test "$compiler_needs_object" = yes; then
+	    if test yes = "$compiler_needs_object"; then
 	      firstobj="$1 "
 	      shift
 	    fi
@@ -8367,7 +9646,7 @@
 	  else
 	    if test -n "$save_libobjs"; then
 	      func_verbose "creating reloadable object files..."
-	      output=$output_objdir/$output_la-${k}.$objext
+	      output=$output_objdir/$output_la-$k.$objext
 	      eval test_cmds=\"$reload_cmds\"
 	      func_len " $test_cmds"
 	      len0=$func_len_result
@@ -8379,13 +9658,13 @@
 		func_len " $obj"
 		func_arith $len + $func_len_result
 		len=$func_arith_result
-		if test "X$objlist" = X ||
+		if test -z "$objlist" ||
 		   test "$len" -lt "$max_cmd_len"; then
 		  func_append objlist " $obj"
 		else
 		  # The command $test_cmds is almost too long, add a
 		  # command to the queue.
-		  if test "$k" -eq 1 ; then
+		  if test 1 -eq "$k"; then
 		    # The first file doesn't have a previous command to add.
 		    reload_objs=$objlist
 		    eval concat_cmds=\"$reload_cmds\"
@@ -8395,10 +9674,10 @@
 		    reload_objs="$objlist $last_robj"
 		    eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
 		  fi
-		  last_robj=$output_objdir/$output_la-${k}.$objext
+		  last_robj=$output_objdir/$output_la-$k.$objext
 		  func_arith $k + 1
 		  k=$func_arith_result
-		  output=$output_objdir/$output_la-${k}.$objext
+		  output=$output_objdir/$output_la-$k.$objext
 		  objlist=" $obj"
 		  func_len " $last_robj"
 		  func_arith $len0 + $func_len_result
@@ -8410,9 +9689,9 @@
 	      # files will link in the last one created.
 	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
 	      reload_objs="$objlist $last_robj"
-	      eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
+	      eval concat_cmds=\"\$concat_cmds$reload_cmds\"
 	      if test -n "$last_robj"; then
-	        eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
+	        eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
 	      fi
 	      func_append delfiles " $output"
 
@@ -8420,9 +9699,9 @@
 	      output=
 	    fi
 
-	    if ${skipped_export-false}; then
-	      func_verbose "generating symbol list for \`$libname.la'"
-	      export_symbols="$output_objdir/$libname.exp"
+	    ${skipped_export-false} && {
+	      func_verbose "generating symbol list for '$libname.la'"
+	      export_symbols=$output_objdir/$libname.exp
 	      $opt_dry_run || $RM $export_symbols
 	      libobjs=$output
 	      # Append the command to create the export file.
@@ -8431,16 +9710,16 @@
 	      if test -n "$last_robj"; then
 		eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
 	      fi
-	    fi
+	    }
 
 	    test -n "$save_libobjs" &&
 	      func_verbose "creating a temporary reloadable object file: $output"
 
 	    # Loop through the commands generated above and execute them.
-	    save_ifs="$IFS"; IFS='~'
+	    save_ifs=$IFS; IFS='~'
 	    for cmd in $concat_cmds; do
-	      IFS="$save_ifs"
-	      $opt_silent || {
+	      IFS=$save_ifs
+	      $opt_quiet || {
 		  func_quote_for_expand "$cmd"
 		  eval "func_echo $func_quote_for_expand_result"
 	      }
@@ -8448,7 +9727,7 @@
 		lt_exit=$?
 
 		# Restore the uninstalled library and exit
-		if test "$opt_mode" = relink; then
+		if test relink = "$opt_mode"; then
 		  ( cd "$output_objdir" && \
 		    $RM "${realname}T" && \
 		    $MV "${realname}U" "$realname" )
@@ -8457,7 +9736,7 @@
 		exit $lt_exit
 	      }
 	    done
-	    IFS="$save_ifs"
+	    IFS=$save_ifs
 
 	    if test -n "$export_symbols_regex" && ${skipped_export-false}; then
 	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
@@ -8465,18 +9744,18 @@
 	    fi
 	  fi
 
-          if ${skipped_export-false}; then
+          ${skipped_export-false} && {
 	    if test -n "$export_symbols" && test -n "$include_expsyms"; then
-	      tmp_export_symbols="$export_symbols"
-	      test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+	      tmp_export_symbols=$export_symbols
+	      test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
 	      $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
 	    fi
 
 	    if test -n "$orig_export_symbols"; then
 	      # The given exports_symbols file has to be filtered, so filter it.
-	      func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+	      func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
 	      # FIXME: $output_objdir/$libname.filter potentially contains lots of
-	      # 's' commands which not all seds can handle. GNU sed should be fine
+	      # 's' commands, which not all seds can handle. GNU sed should be fine
 	      # though. Also, the filter scales superlinearly with the number of
 	      # global variables. join(1) would be nice here, but unfortunately
 	      # isn't a blessed tool.
@@ -8485,7 +9764,7 @@
 	      export_symbols=$output_objdir/$libname.def
 	      $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
 	    fi
-	  fi
+	  }
 
 	  libobjs=$output
 	  # Restore the value of output.
@@ -8499,7 +9778,7 @@
 	  # value of $libobjs for piecewise linking.
 
 	  # Do each of the archive commands.
-	  if test "$module" = yes && test -n "$module_cmds" ; then
+	  if test yes = "$module" && test -n "$module_cmds"; then
 	    if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
 	      cmds=$module_expsym_cmds
 	    else
@@ -8521,7 +9800,7 @@
 
 	# Add any objects from preloaded convenience libraries
 	if test -n "$dlprefiles"; then
-	  gentop="$output_objdir/${outputname}x"
+	  gentop=$output_objdir/${outputname}x
 	  func_append generated " $gentop"
 
 	  func_extract_archives $gentop $dlprefiles
@@ -8529,11 +9808,12 @@
 	  test "X$libobjs" = "X " && libobjs=
 	fi
 
-	save_ifs="$IFS"; IFS='~'
+	save_ifs=$IFS; IFS='~'
 	for cmd in $cmds; do
-	  IFS="$save_ifs"
+	  IFS=$sp$nl
 	  eval cmd=\"$cmd\"
-	  $opt_silent || {
+	  IFS=$save_ifs
+	  $opt_quiet || {
 	    func_quote_for_expand "$cmd"
 	    eval "func_echo $func_quote_for_expand_result"
 	  }
@@ -8541,7 +9821,7 @@
 	    lt_exit=$?
 
 	    # Restore the uninstalled library and exit
-	    if test "$opt_mode" = relink; then
+	    if test relink = "$opt_mode"; then
 	      ( cd "$output_objdir" && \
 	        $RM "${realname}T" && \
 		$MV "${realname}U" "$realname" )
@@ -8550,10 +9830,10 @@
 	    exit $lt_exit
 	  }
 	done
-	IFS="$save_ifs"
+	IFS=$save_ifs
 
 	# Restore the uninstalled library and exit
-	if test "$opt_mode" = relink; then
+	if test relink = "$opt_mode"; then
 	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
 
 	  if test -n "$convenience"; then
@@ -8573,39 +9853,39 @@
 	done
 
 	# If -module or -export-dynamic was specified, set the dlname.
-	if test "$module" = yes || test "$export_dynamic" = yes; then
+	if test yes = "$module" || test yes = "$export_dynamic"; then
 	  # On all known operating systems, these are identical.
-	  dlname="$soname"
+	  dlname=$soname
 	fi
       fi
       ;;
 
     obj)
-      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
-	func_warning "\`-dlopen' is ignored for objects"
+      if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
+	func_warning "'-dlopen' is ignored for objects"
       fi
 
       case " $deplibs" in
       *\ -l* | *\ -L*)
-	func_warning "\`-l' and \`-L' are ignored for objects" ;;
+	func_warning "'-l' and '-L' are ignored for objects" ;;
       esac
 
       test -n "$rpath" && \
-	func_warning "\`-rpath' is ignored for objects"
+	func_warning "'-rpath' is ignored for objects"
 
       test -n "$xrpath" && \
-	func_warning "\`-R' is ignored for objects"
+	func_warning "'-R' is ignored for objects"
 
       test -n "$vinfo" && \
-	func_warning "\`-version-info' is ignored for objects"
+	func_warning "'-version-info' is ignored for objects"
 
       test -n "$release" && \
-	func_warning "\`-release' is ignored for objects"
+	func_warning "'-release' is ignored for objects"
 
       case $output in
       *.lo)
 	test -n "$objs$old_deplibs" && \
-	  func_fatal_error "cannot build library object \`$output' from non-libtool objects"
+	  func_fatal_error "cannot build library object '$output' from non-libtool objects"
 
 	libobj=$output
 	func_lo2o "$libobj"
@@ -8613,7 +9893,7 @@
 	;;
       *)
 	libobj=
-	obj="$output"
+	obj=$output
 	;;
       esac
 
@@ -8636,7 +9916,7 @@
 	  eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
 	  reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
 	else
-	  gentop="$output_objdir/${obj}x"
+	  gentop=$output_objdir/${obj}x
 	  func_append generated " $gentop"
 
 	  func_extract_archives $gentop $convenience
@@ -8645,12 +9925,12 @@
       fi
 
       # If we're not building shared, we need to use non_pic_objs
-      test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
+      test yes = "$build_libtool_libs" || libobjs=$non_pic_objects
 
       # Create the old-style object.
-      reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+      reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs
 
-      output="$obj"
+      output=$obj
       func_execute_cmds "$reload_cmds" 'exit $?'
 
       # Exit if we aren't doing a library object file.
@@ -8662,7 +9942,7 @@
 	exit $EXIT_SUCCESS
       fi
 
-      if test "$build_libtool_libs" != yes; then
+      test yes = "$build_libtool_libs" || {
 	if test -n "$gentop"; then
 	  func_show_eval '${RM}r "$gentop"'
 	fi
@@ -8672,12 +9952,12 @@
 	# $show "echo timestamp > $libobj"
 	# $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
 	exit $EXIT_SUCCESS
-      fi
+      }
 
-      if test -n "$pic_flag" || test "$pic_mode" != default; then
+      if test -n "$pic_flag" || test default != "$pic_mode"; then
 	# Only do commands if we really have different PIC objects.
 	reload_objs="$libobjs $reload_conv_objs"
-	output="$libobj"
+	output=$libobj
 	func_execute_cmds "$reload_cmds" 'exit $?'
       fi
 
@@ -8694,16 +9974,14 @@
 	          output=$func_stripname_result.exe;;
       esac
       test -n "$vinfo" && \
-	func_warning "\`-version-info' is ignored for programs"
+	func_warning "'-version-info' is ignored for programs"
 
       test -n "$release" && \
-	func_warning "\`-release' is ignored for programs"
+	func_warning "'-release' is ignored for programs"
 
-      test "$preload" = yes \
-        && test "$dlopen_support" = unknown \
-	&& test "$dlopen_self" = unknown \
-	&& test "$dlopen_self_static" = unknown && \
-	  func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
+      $preload \
+	&& test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \
+	&& func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support."
 
       case $host in
       *-*-rhapsody* | *-*-darwin1.[012])
@@ -8717,11 +9995,11 @@
       *-*-darwin*)
 	# Don't allow lazy linking, it breaks C++ global constructors
 	# But is supposedly fixed on 10.4 or later (yay!).
-	if test "$tagname" = CXX ; then
+	if test CXX = "$tagname"; then
 	  case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
 	    10.[0123])
-	      func_append compile_command " ${wl}-bind_at_load"
-	      func_append finalize_command " ${wl}-bind_at_load"
+	      func_append compile_command " $wl-bind_at_load"
+	      func_append finalize_command " $wl-bind_at_load"
 	    ;;
 	  esac
 	fi
@@ -8757,7 +10035,7 @@
 	*) func_append new_libs " $deplib" ;;
 	esac
       done
-      compile_deplibs="$new_libs"
+      compile_deplibs=$new_libs
 
 
       func_append compile_command " $compile_deplibs"
@@ -8781,7 +10059,7 @@
 	if test -n "$hardcode_libdir_flag_spec"; then
 	  if test -n "$hardcode_libdir_separator"; then
 	    if test -z "$hardcode_libdirs"; then
-	      hardcode_libdirs="$libdir"
+	      hardcode_libdirs=$libdir
 	    else
 	      # Just accumulate the unique libdirs.
 	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
@@ -8804,7 +10082,7 @@
 	fi
 	case $host in
 	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
-	  testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
+	  testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'`
 	  case :$dllsearchpath: in
 	  *":$libdir:"*) ;;
 	  ::) dllsearchpath=$libdir;;
@@ -8821,10 +10099,10 @@
       # Substitute the hardcoded libdirs into the rpath.
       if test -n "$hardcode_libdir_separator" &&
 	 test -n "$hardcode_libdirs"; then
-	libdir="$hardcode_libdirs"
+	libdir=$hardcode_libdirs
 	eval rpath=\" $hardcode_libdir_flag_spec\"
       fi
-      compile_rpath="$rpath"
+      compile_rpath=$rpath
 
       rpath=
       hardcode_libdirs=
@@ -8832,7 +10110,7 @@
 	if test -n "$hardcode_libdir_flag_spec"; then
 	  if test -n "$hardcode_libdir_separator"; then
 	    if test -z "$hardcode_libdirs"; then
-	      hardcode_libdirs="$libdir"
+	      hardcode_libdirs=$libdir
 	    else
 	      # Just accumulate the unique libdirs.
 	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
@@ -8857,45 +10135,43 @@
       # Substitute the hardcoded libdirs into the rpath.
       if test -n "$hardcode_libdir_separator" &&
 	 test -n "$hardcode_libdirs"; then
-	libdir="$hardcode_libdirs"
+	libdir=$hardcode_libdirs
 	eval rpath=\" $hardcode_libdir_flag_spec\"
       fi
-      finalize_rpath="$rpath"
+      finalize_rpath=$rpath
 
-      if test -n "$libobjs" && test "$build_old_libs" = yes; then
+      if test -n "$libobjs" && test yes = "$build_old_libs"; then
 	# Transform all the library objects into standard objects.
 	compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
 	finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
       fi
 
-      func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
+      func_generate_dlsyms "$outputname" "@PROGRAM@" false
 
       # template prelinking step
       if test -n "$prelink_cmds"; then
 	func_execute_cmds "$prelink_cmds" 'exit $?'
       fi
 
-      wrappers_required=yes
+      wrappers_required=:
       case $host in
       *cegcc* | *mingw32ce*)
         # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
-        wrappers_required=no
+        wrappers_required=false
         ;;
       *cygwin* | *mingw* )
-        if test "$build_libtool_libs" != yes; then
-          wrappers_required=no
-        fi
+        test yes = "$build_libtool_libs" || wrappers_required=false
         ;;
       *)
-        if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
-          wrappers_required=no
+        if test no = "$need_relink" || test yes != "$build_libtool_libs"; then
+          wrappers_required=false
         fi
         ;;
       esac
-      if test "$wrappers_required" = no; then
+      $wrappers_required || {
 	# Replace the output file specification.
 	compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
-	link_command="$compile_command$compile_rpath"
+	link_command=$compile_command$compile_rpath
 
 	# We have no uninstalled library dependencies, so finalize right now.
 	exit_status=0
@@ -8908,12 +10184,12 @@
 	fi
 
 	# Delete the generated files.
-	if test -f "$output_objdir/${outputname}S.${objext}"; then
-	  func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
+	if test -f "$output_objdir/${outputname}S.$objext"; then
+	  func_show_eval '$RM "$output_objdir/${outputname}S.$objext"'
 	fi
 
 	exit $exit_status
-      fi
+      }
 
       if test -n "$compile_shlibpath$finalize_shlibpath"; then
 	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
@@ -8943,9 +10219,9 @@
 	fi
       fi
 
-      if test "$no_install" = yes; then
+      if test yes = "$no_install"; then
 	# We don't need to create a wrapper script.
-	link_command="$compile_var$compile_command$compile_rpath"
+	link_command=$compile_var$compile_command$compile_rpath
 	# Replace the output file specification.
 	link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
 	# Delete the old output file.
@@ -8962,27 +10238,28 @@
 	exit $EXIT_SUCCESS
       fi
 
-      if test "$hardcode_action" = relink; then
-	# Fast installation is not supported
-	link_command="$compile_var$compile_command$compile_rpath"
-	relink_command="$finalize_var$finalize_command$finalize_rpath"
+      case $hardcode_action,$fast_install in
+        relink,*)
+	  # Fast installation is not supported
+	  link_command=$compile_var$compile_command$compile_rpath
+	  relink_command=$finalize_var$finalize_command$finalize_rpath
 
-	func_warning "this platform does not like uninstalled shared libraries"
-	func_warning "\`$output' will be relinked during installation"
-      else
-	if test "$fast_install" != no; then
-	  link_command="$finalize_var$compile_command$finalize_rpath"
-	  if test "$fast_install" = yes; then
-	    relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
-	  else
-	    # fast_install is set to needless
-	    relink_command=
-	  fi
-	else
-	  link_command="$compile_var$compile_command$compile_rpath"
-	  relink_command="$finalize_var$finalize_command$finalize_rpath"
-	fi
-      fi
+	  func_warning "this platform does not like uninstalled shared libraries"
+	  func_warning "'$output' will be relinked during installation"
+	  ;;
+        *,yes)
+	  link_command=$finalize_var$compile_command$finalize_rpath
+	  relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
+          ;;
+	*,no)
+	  link_command=$compile_var$compile_command$compile_rpath
+	  relink_command=$finalize_var$finalize_command$finalize_rpath
+          ;;
+	*,needless)
+	  link_command=$finalize_var$compile_command$finalize_rpath
+	  relink_command=
+          ;;
+      esac
 
       # Replace the output file specification.
       link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
@@ -9039,8 +10316,8 @@
 	    func_dirname_and_basename "$output" "" "."
 	    output_name=$func_basename_result
 	    output_path=$func_dirname_result
-	    cwrappersource="$output_path/$objdir/lt-$output_name.c"
-	    cwrapper="$output_path/$output_name.exe"
+	    cwrappersource=$output_path/$objdir/lt-$output_name.c
+	    cwrapper=$output_path/$output_name.exe
 	    $RM $cwrappersource $cwrapper
 	    trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
 
@@ -9061,7 +10338,7 @@
 	    trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
 	    $opt_dry_run || {
 	      # note: this script will not be executed, so do not chmod.
-	      if test "x$build" = "x$host" ; then
+	      if test "x$build" = "x$host"; then
 		$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
 	      else
 		func_emit_wrapper no > $func_ltwrapper_scriptname_result
@@ -9084,25 +10361,27 @@
     # See if we need to build an old-fashioned archive.
     for oldlib in $oldlibs; do
 
-      if test "$build_libtool_libs" = convenience; then
-	oldobjs="$libobjs_save $symfileobj"
-	addlibs="$convenience"
-	build_libtool_libs=no
-      else
-	if test "$build_libtool_libs" = module; then
-	  oldobjs="$libobjs_save"
+      case $build_libtool_libs in
+        convenience)
+	  oldobjs="$libobjs_save $symfileobj"
+	  addlibs=$convenience
 	  build_libtool_libs=no
-	else
+	  ;;
+	module)
+	  oldobjs=$libobjs_save
+	  addlibs=$old_convenience
+	  build_libtool_libs=no
+          ;;
+	*)
 	  oldobjs="$old_deplibs $non_pic_objects"
-	  if test "$preload" = yes && test -f "$symfileobj"; then
-	    func_append oldobjs " $symfileobj"
-	  fi
-	fi
-	addlibs="$old_convenience"
-      fi
+	  $preload && test -f "$symfileobj" \
+	    && func_append oldobjs " $symfileobj"
+	  addlibs=$old_convenience
+	  ;;
+      esac
 
       if test -n "$addlibs"; then
-	gentop="$output_objdir/${outputname}x"
+	gentop=$output_objdir/${outputname}x
 	func_append generated " $gentop"
 
 	func_extract_archives $gentop $addlibs
@@ -9110,13 +10389,13 @@
       fi
 
       # Do each command in the archive commands.
-      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+      if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then
 	cmds=$old_archive_from_new_cmds
       else
 
 	# Add any objects from preloaded convenience libraries
 	if test -n "$dlprefiles"; then
-	  gentop="$output_objdir/${outputname}x"
+	  gentop=$output_objdir/${outputname}x
 	  func_append generated " $gentop"
 
 	  func_extract_archives $gentop $dlprefiles
@@ -9137,7 +10416,7 @@
 	  :
 	else
 	  echo "copying selected object files to avoid basename conflicts..."
-	  gentop="$output_objdir/${outputname}x"
+	  gentop=$output_objdir/${outputname}x
 	  func_append generated " $gentop"
 	  func_mkdir_p "$gentop"
 	  save_oldobjs=$oldobjs
@@ -9146,7 +10425,7 @@
 	  for obj in $save_oldobjs
 	  do
 	    func_basename "$obj"
-	    objbase="$func_basename_result"
+	    objbase=$func_basename_result
 	    case " $oldobjs " in
 	    " ") oldobjs=$obj ;;
 	    *[\ /]"$objbase "*)
@@ -9215,18 +10494,18 @@
 	    else
 	      # the above command should be used before it gets too long
 	      oldobjs=$objlist
-	      if test "$obj" = "$last_oldobj" ; then
+	      if test "$obj" = "$last_oldobj"; then
 		RANLIB=$save_RANLIB
 	      fi
 	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
-	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+	      eval concat_cmds=\"\$concat_cmds$old_archive_cmds\"
 	      objlist=
 	      len=$len0
 	    fi
 	  done
 	  RANLIB=$save_RANLIB
 	  oldobjs=$objlist
-	  if test "X$oldobjs" = "X" ; then
+	  if test -z "$oldobjs"; then
 	    eval cmds=\"\$concat_cmds\"
 	  else
 	    eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
@@ -9243,7 +10522,7 @@
     case $output in
     *.la)
       old_library=
-      test "$build_old_libs" = yes && old_library="$libname.$libext"
+      test yes = "$build_old_libs" && old_library=$libname.$libext
       func_verbose "creating $output"
 
       # Preserve any variables that may affect compiler behavior
@@ -9258,31 +10537,31 @@
 	fi
       done
       # Quote the link command for shipping.
-      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+      relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
       relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
-      if test "$hardcode_automatic" = yes ; then
+      if test yes = "$hardcode_automatic"; then
 	relink_command=
       fi
 
       # Only create the output if not a dry run.
       $opt_dry_run || {
 	for installed in no yes; do
-	  if test "$installed" = yes; then
+	  if test yes = "$installed"; then
 	    if test -z "$install_libdir"; then
 	      break
 	    fi
-	    output="$output_objdir/$outputname"i
+	    output=$output_objdir/${outputname}i
 	    # Replace all uninstalled libtool libraries with the installed ones
 	    newdependency_libs=
 	    for deplib in $dependency_libs; do
 	      case $deplib in
 	      *.la)
 		func_basename "$deplib"
-		name="$func_basename_result"
+		name=$func_basename_result
 		func_resolve_sysroot "$deplib"
-		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
+		eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
 		test -z "$libdir" && \
-		  func_fatal_error "\`$deplib' is not a valid libtool archive"
+		  func_fatal_error "'$deplib' is not a valid libtool archive"
 		func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
 		;;
 	      -L*)
@@ -9298,23 +10577,23 @@
 	      *) func_append newdependency_libs " $deplib" ;;
 	      esac
 	    done
-	    dependency_libs="$newdependency_libs"
+	    dependency_libs=$newdependency_libs
 	    newdlfiles=
 
 	    for lib in $dlfiles; do
 	      case $lib in
 	      *.la)
 	        func_basename "$lib"
-		name="$func_basename_result"
-		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+		name=$func_basename_result
+		eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
 		test -z "$libdir" && \
-		  func_fatal_error "\`$lib' is not a valid libtool archive"
+		  func_fatal_error "'$lib' is not a valid libtool archive"
 		func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
 		;;
 	      *) func_append newdlfiles " $lib" ;;
 	      esac
 	    done
-	    dlfiles="$newdlfiles"
+	    dlfiles=$newdlfiles
 	    newdlprefiles=
 	    for lib in $dlprefiles; do
 	      case $lib in
@@ -9324,34 +10603,34 @@
 		# didn't already link the preopened objects directly into
 		# the library:
 		func_basename "$lib"
-		name="$func_basename_result"
-		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+		name=$func_basename_result
+		eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
 		test -z "$libdir" && \
-		  func_fatal_error "\`$lib' is not a valid libtool archive"
+		  func_fatal_error "'$lib' is not a valid libtool archive"
 		func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
 		;;
 	      esac
 	    done
-	    dlprefiles="$newdlprefiles"
+	    dlprefiles=$newdlprefiles
 	  else
 	    newdlfiles=
 	    for lib in $dlfiles; do
 	      case $lib in
-		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+		[\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
 		*) abs=`pwd`"/$lib" ;;
 	      esac
 	      func_append newdlfiles " $abs"
 	    done
-	    dlfiles="$newdlfiles"
+	    dlfiles=$newdlfiles
 	    newdlprefiles=
 	    for lib in $dlprefiles; do
 	      case $lib in
-		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+		[\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
 		*) abs=`pwd`"/$lib" ;;
 	      esac
 	      func_append newdlprefiles " $abs"
 	    done
-	    dlprefiles="$newdlprefiles"
+	    dlprefiles=$newdlprefiles
 	  fi
 	  $RM $output
 	  # place dlname in correct position for cygwin
@@ -9367,10 +10646,9 @@
 	  case $host,$output,$installed,$module,$dlname in
 	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
 	      # If a -bindir argument was supplied, place the dll there.
-	      if test "x$bindir" != x ;
-	      then
+	      if test -n "$bindir"; then
 		func_relative_path "$install_libdir" "$bindir"
-		tdlname=$func_relative_path_result$dlname
+		tdlname=$func_relative_path_result/$dlname
 	      else
 		# Otherwise fall back on heuristic.
 		tdlname=../bin/$dlname
@@ -9379,7 +10657,7 @@
 	  esac
 	  $ECHO > $output "\
 # $outputname - a libtool library file
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
 #
 # Please DO NOT delete this file!
 # It is necessary for linking the library.
@@ -9393,7 +10671,7 @@
 # The name of the static archive.
 old_library='$old_library'
 
-# Linker flags that can not go in dependency_libs.
+# Linker flags that cannot go in dependency_libs.
 inherited_linker_flags='$new_inherited_linker_flags'
 
 # Libraries that this one depends upon.
@@ -9419,7 +10697,7 @@
 
 # Directory that this library needs to be installed in:
 libdir='$install_libdir'"
-	  if test "$installed" = no && test "$need_relink" = yes; then
+	  if test no,yes = "$installed,$need_relink"; then
 	    $ECHO >> $output "\
 relink_command=\"$relink_command\""
 	  fi
@@ -9434,27 +10712,29 @@
     exit $EXIT_SUCCESS
 }
 
-{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
-    func_mode_link ${1+"$@"}
+if test link = "$opt_mode" || test relink = "$opt_mode"; then
+  func_mode_link ${1+"$@"}
+fi
 
 
 # func_mode_uninstall arg...
 func_mode_uninstall ()
 {
-    $opt_debug
-    RM="$nonopt"
+    $debug_cmd
+
+    RM=$nonopt
     files=
-    rmforce=
+    rmforce=false
     exit_status=0
 
     # This variable tells wrapper scripts just to set variables rather
     # than running their programs.
-    libtool_install_magic="$magic"
+    libtool_install_magic=$magic
 
     for arg
     do
       case $arg in
-      -f) func_append RM " $arg"; rmforce=yes ;;
+      -f) func_append RM " $arg"; rmforce=: ;;
       -*) func_append RM " $arg" ;;
       *) func_append files " $arg" ;;
       esac
@@ -9467,18 +10747,18 @@
 
     for file in $files; do
       func_dirname "$file" "" "."
-      dir="$func_dirname_result"
-      if test "X$dir" = X.; then
-	odir="$objdir"
+      dir=$func_dirname_result
+      if test . = "$dir"; then
+	odir=$objdir
       else
-	odir="$dir/$objdir"
+	odir=$dir/$objdir
       fi
       func_basename "$file"
-      name="$func_basename_result"
-      test "$opt_mode" = uninstall && odir="$dir"
+      name=$func_basename_result
+      test uninstall = "$opt_mode" && odir=$dir
 
       # Remember odir for removal later, being careful to avoid duplicates
-      if test "$opt_mode" = clean; then
+      if test clean = "$opt_mode"; then
 	case " $rmdirs " in
 	  *" $odir "*) ;;
 	  *) func_append rmdirs " $odir" ;;
@@ -9493,11 +10773,11 @@
       elif test -d "$file"; then
 	exit_status=1
 	continue
-      elif test "$rmforce" = yes; then
+      elif $rmforce; then
 	continue
       fi
 
-      rmfiles="$file"
+      rmfiles=$file
 
       case $name in
       *.la)
@@ -9511,7 +10791,7 @@
 	  done
 	  test -n "$old_library" && func_append rmfiles " $odir/$old_library"
 
-	  case "$opt_mode" in
+	  case $opt_mode in
 	  clean)
 	    case " $library_names " in
 	    *" $dlname "*) ;;
@@ -9522,12 +10802,12 @@
 	  uninstall)
 	    if test -n "$library_names"; then
 	      # Do each command in the postuninstall commands.
-	      func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+	      func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1'
 	    fi
 
 	    if test -n "$old_library"; then
 	      # Do each command in the old_postuninstall commands.
-	      func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+	      func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1'
 	    fi
 	    # FIXME: should reinstall the best remaining shared library.
 	    ;;
@@ -9543,21 +10823,19 @@
 	  func_source $dir/$name
 
 	  # Add PIC object to the list of files to remove.
-	  if test -n "$pic_object" &&
-	     test "$pic_object" != none; then
+	  if test -n "$pic_object" && test none != "$pic_object"; then
 	    func_append rmfiles " $dir/$pic_object"
 	  fi
 
 	  # Add non-PIC object to the list of files to remove.
-	  if test -n "$non_pic_object" &&
-	     test "$non_pic_object" != none; then
+	  if test -n "$non_pic_object" && test none != "$non_pic_object"; then
 	    func_append rmfiles " $dir/$non_pic_object"
 	  fi
 	fi
 	;;
 
       *)
-	if test "$opt_mode" = clean ; then
+	if test clean = "$opt_mode"; then
 	  noexename=$name
 	  case $file in
 	  *.exe)
@@ -9584,12 +10862,12 @@
 
 	    # note $name still contains .exe if it was in $file originally
 	    # as does the version of $file that was added into $rmfiles
-	    func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
-	    if test "$fast_install" = yes && test -n "$relink_command"; then
+	    func_append rmfiles " $odir/$name $odir/${name}S.$objext"
+	    if test yes = "$fast_install" && test -n "$relink_command"; then
 	      func_append rmfiles " $odir/lt-$name"
 	    fi
-	    if test "X$noexename" != "X$name" ; then
-	      func_append rmfiles " $odir/lt-${noexename}.c"
+	    if test "X$noexename" != "X$name"; then
+	      func_append rmfiles " $odir/lt-$noexename.c"
 	    fi
 	  fi
 	fi
@@ -9598,7 +10876,7 @@
       func_show_eval "$RM $rmfiles" 'exit_status=1'
     done
 
-    # Try to remove the ${objdir}s in the directories where we deleted files
+    # Try to remove the $objdir's in the directories where we deleted files
     for dir in $rmdirs; do
       if test -d "$dir"; then
 	func_show_eval "rmdir $dir >/dev/null 2>&1"
@@ -9608,16 +10886,17 @@
     exit $exit_status
 }
 
-{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
-    func_mode_uninstall ${1+"$@"}
+if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then
+  func_mode_uninstall ${1+"$@"}
+fi
 
 test -z "$opt_mode" && {
-  help="$generic_help"
+  help=$generic_help
   func_fatal_help "you must specify a MODE"
 }
 
 test -z "$exec_cmd" && \
-  func_fatal_help "invalid operation mode \`$opt_mode'"
+  func_fatal_help "invalid operation mode '$opt_mode'"
 
 if test -n "$exec_cmd"; then
   eval exec "$exec_cmd"
@@ -9628,7 +10907,7 @@
 
 
 # The TAGs below are defined such that we never get into a situation
-# in which we disable both kinds of libraries.  Given conflicting
+# where we disable both kinds of libraries.  Given conflicting
 # choices, we go for a static library, that is the most portable,
 # since we can't tell whether shared libraries were disabled because
 # the user asked for that or because the platform doesn't support
@@ -9651,5 +10930,3 @@
 # mode:shell-script
 # sh-indentation:2
 # End:
-# vi:sw=2
-
diff --git a/Modules/_ctypes/libffi/m4/ax_gcc_archflag.m4 b/Modules/_ctypes/libffi/m4/ax_gcc_archflag.m4
index 3fd050e..aab2661 100644
--- a/Modules/_ctypes/libffi/m4/ax_gcc_archflag.m4
+++ b/Modules/_ctypes/libffi/m4/ax_gcc_archflag.m4
@@ -155,7 +155,7 @@
   sparc*)
      AC_PATH_PROG([PRTDIAG], [prtdiag], [prtdiag], [$PATH:/usr/platform/`uname -i`/sbin/:/usr/platform/`uname -m`/sbin/])
      cputype=`(((grep cpu /proc/cpuinfo | cut -d: -f2) ; ($PRTDIAG -v |grep -i sparc) ; grep -i cpu /var/run/dmesg.boot ) | head -n 1) 2> /dev/null`
-     cputype=`echo "$cputype" | tr -d ' -' |tr $as_cr_LETTERS $as_cr_letters`
+     cputype=`echo "$cputype" | tr -d ' -' | sed 's/SPARCIIi/SPARCII/' | tr $as_cr_LETTERS $as_cr_letters`
      case $cputype in
          *ultrasparciv*) ax_gcc_arch="ultrasparc4 ultrasparc3 ultrasparc v9" ;;
          *ultrasparciii*) ax_gcc_arch="ultrasparc3 ultrasparc v9" ;;
diff --git a/Modules/_ctypes/libffi/m4/libtool.m4 b/Modules/_ctypes/libffi/m4/libtool.m4
index 3318f27..4bc6b22 100644
--- a/Modules/_ctypes/libffi/m4/libtool.m4
+++ b/Modules/_ctypes/libffi/m4/libtool.m4
@@ -1,8 +1,6 @@
 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
 #
-#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-#                 Foundation, Inc.
+#   Copyright (C) 1996-2001, 2003-2013 Free Software Foundation, Inc.
 #   Written by Gordon Matzigkeit, 1996
 #
 # This file is free software; the Free Software Foundation gives
@@ -39,7 +37,7 @@
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 ])
 
-# serial 57 LT_INIT
+# serial 58 LT_INIT
 
 
 # LT_PREREQ(VERSION)
@@ -91,7 +89,7 @@
 _LT_SET_OPTIONS([$0], [$1])
 
 # This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ltmain"
+LIBTOOL_DEPS=$ltmain
 
 # Always use our own libtool.
 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
@@ -130,7 +128,7 @@
 # _LT_FILEUTILS_DEFAULTS
 # ----------------------
 # It is okay to use these file commands and assume they have been set
-# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
+# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.
 m4_defun([_LT_FILEUTILS_DEFAULTS],
 [: ${CP="cp -f"}
 : ${MV="mv -f"}
@@ -179,13 +177,13 @@
 m4_require([_LT_WITH_SYSROOT])dnl
 
 _LT_CONFIG_LIBTOOL_INIT([
-# See if we are running on zsh, and set the options which allow our
+# See if we are running on zsh, and set the options that allow our
 # commands through without removal of \ escapes INIT.
-if test -n "\${ZSH_VERSION+set}" ; then
+if test -n "\${ZSH_VERSION+set}"; then
    setopt NO_GLOB_SUBST
 fi
 ])
-if test -n "${ZSH_VERSION+set}" ; then
+if test -n "${ZSH_VERSION+set}"; then
    setopt NO_GLOB_SUBST
 fi
 
@@ -198,7 +196,7 @@
   # AIX sometimes has problems with the GCC collect2 program.  For some
   # reason, if we set the COLLECT_NAMES environment variable, the problems
   # vanish in a puff of smoke.
-  if test "X${COLLECT_NAMES+set}" != Xset; then
+  if test set != "${COLLECT_NAMES+set}"; then
     COLLECT_NAMES=
     export COLLECT_NAMES
   fi
@@ -209,14 +207,14 @@
 ofile=libtool
 can_build_shared=yes
 
-# All known linkers require a `.a' archive for static linking (except MSVC,
+# All known linkers require a '.a' archive for static linking (except MSVC,
 # which needs '.lib').
 libext=a
 
-with_gnu_ld="$lt_cv_prog_gnu_ld"
+with_gnu_ld=$lt_cv_prog_gnu_ld
 
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
+old_CC=$CC
+old_CFLAGS=$CFLAGS
 
 # Set sane defaults for various variables
 test -z "$CC" && CC=cc
@@ -269,14 +267,14 @@
 
 # _LT_PROG_LTMAIN
 # ---------------
-# Note that this code is called both from `configure', and `config.status'
+# Note that this code is called both from 'configure', and 'config.status'
 # now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
-# `config.status' has no value for ac_aux_dir unless we are using Automake,
+# 'config.status' has no value for ac_aux_dir unless we are using Automake,
 # so we pass a copy along to make sure it has a sensible value anyway.
 m4_defun([_LT_PROG_LTMAIN],
 [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
 _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
-ltmain="$ac_aux_dir/ltmain.sh"
+ltmain=$ac_aux_dir/ltmain.sh
 ])# _LT_PROG_LTMAIN
 
 
@@ -286,7 +284,7 @@
 
 # So that we can recreate a full libtool script including additional
 # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
-# in macros and then make a single call at the end using the `libtool'
+# in macros and then make a single call at the end using the 'libtool'
 # label.
 
 
@@ -421,8 +419,8 @@
 
 # _LT_CONFIG_STATUS_DECLARE([VARNAME])
 # ------------------------------------
-# Quote a variable value, and forward it to `config.status' so that its
-# declaration there will have the same value as in `configure'.  VARNAME
+# Quote a variable value, and forward it to 'config.status' so that its
+# declaration there will have the same value as in 'configure'.  VARNAME
 # must have a single quote delimited value for this to work.
 m4_define([_LT_CONFIG_STATUS_DECLARE],
 [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
@@ -446,7 +444,7 @@
 # Output comment and list of tags supported by the script
 m4_defun([_LT_LIBTOOL_TAGS],
 [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
-available_tags="_LT_TAGS"dnl
+available_tags='_LT_TAGS'dnl
 ])
 
 
@@ -474,7 +472,7 @@
 # _LT_LIBTOOL_CONFIG_VARS
 # -----------------------
 # Produce commented declarations of non-tagged libtool config variables
-# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
+# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool'
 # script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
 # section) are produced by _LT_LIBTOOL_TAG_VARS.
 m4_defun([_LT_LIBTOOL_CONFIG_VARS],
@@ -500,8 +498,8 @@
 # Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
 # variables for single and double quote escaping we saved from calls
 # to _LT_DECL, we can put quote escaped variables declarations
-# into `config.status', and then the shell code to quote escape them in
-# for loops in `config.status'.  Finally, any additional code accumulated
+# into 'config.status', and then the shell code to quote escape them in
+# for loops in 'config.status'.  Finally, any additional code accumulated
 # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
 m4_defun([_LT_CONFIG_COMMANDS],
 [AC_PROVIDE_IFELSE([LT_OUTPUT],
@@ -547,7 +545,7 @@
 ]], lt_decl_quote_varnames); do
     case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
     *[[\\\\\\\`\\"\\\$]]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
       ;;
     *)
       eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
@@ -560,7 +558,7 @@
 ]], lt_decl_dquote_varnames); do
     case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
     *[[\\\\\\\`\\"\\\$]]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
       ;;
     *)
       eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
@@ -576,7 +574,7 @@
 # Generate a child script FILE with all initialization necessary to
 # reuse the environment learned by the parent script, and make the
 # file executable.  If COMMENT is supplied, it is inserted after the
-# `#!' sequence but before initialization text begins.  After this
+# '#!' sequence but before initialization text begins.  After this
 # macro, additional text can be appended to FILE to form the body of
 # the child script.  The macro ends with non-zero status if the
 # file could not be fully written (such as if the disk is full).
@@ -598,7 +596,7 @@
 _AS_PREPARE
 exec AS_MESSAGE_FD>&1
 _ASEOF
-test $lt_write_fail = 0 && chmod +x $1[]dnl
+test 0 = "$lt_write_fail" && chmod +x $1[]dnl
 m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
 
 # LT_OUTPUT
@@ -621,7 +619,7 @@
 } >&AS_MESSAGE_LOG_FD
 
 lt_cl_help="\
-\`$as_me' creates a local libtool stub from the current configuration,
+'$as_me' creates a local libtool stub from the current configuration,
 for use in further configure time tests before the real libtool is
 generated.
 
@@ -643,7 +641,7 @@
 This config.lt script is free software; the Free Software Foundation
 gives unlimited permision to copy, distribute and modify it."
 
-while test $[#] != 0
+while test 0 != $[#]
 do
   case $[1] in
     --version | --v* | -V )
@@ -656,10 +654,10 @@
       lt_cl_silent=: ;;
 
     -*) AC_MSG_ERROR([unrecognized option: $[1]
-Try \`$[0] --help' for more information.]) ;;
+Try '$[0] --help' for more information.]) ;;
 
     *) AC_MSG_ERROR([unrecognized argument: $[1]
-Try \`$[0] --help' for more information.]) ;;
+Try '$[0] --help' for more information.]) ;;
   esac
   shift
 done
@@ -685,7 +683,7 @@
 # open by configure.  Here we exec the FD to /dev/null, effectively closing
 # config.log, so it can be properly (re)opened and appended to by config.lt.
 lt_cl_success=:
-test "$silent" = yes &&
+test yes = "$silent" &&
   lt_config_lt_args="$lt_config_lt_args --quiet"
 exec AS_MESSAGE_LOG_FD>/dev/null
 $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
@@ -705,13 +703,13 @@
 _LT_CONFIG_SAVE_COMMANDS([
   m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
   m4_if(_LT_TAG, [C], [
-    # See if we are running on zsh, and set the options which allow our
+    # See if we are running on zsh, and set the options that allow our
     # commands through without removal of \ escapes.
-    if test -n "${ZSH_VERSION+set}" ; then
+    if test -n "${ZSH_VERSION+set}"; then
       setopt NO_GLOB_SUBST
     fi
 
-    cfgfile="${ofile}T"
+    cfgfile=${ofile}T
     trap "$RM \"$cfgfile\"; exit 1" 1 2 15
     $RM "$cfgfile"
 
@@ -719,7 +717,7 @@
 #! $SHELL
 
 # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Generated automatically by $as_me ($PACKAGE) $VERSION
 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
 #
@@ -739,7 +737,7 @@
 # AIX sometimes has problems with the GCC collect2 program.  For some
 # reason, if we set the COLLECT_NAMES environment variable, the problems
 # vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
+if test set != "${COLLECT_NAMES+set}"; then
   COLLECT_NAMES=
   export COLLECT_NAMES
 fi
@@ -756,8 +754,6 @@
   sed '$q' "$ltmain" >> "$cfgfile" \
      || (rm -f "$cfgfile"; exit 1)
 
-  _LT_PROG_REPLACE_SHELLFNS
-
    mv -f "$cfgfile" "$ofile" ||
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
@@ -775,7 +771,6 @@
 [m4_if([$1], [], [
     PACKAGE='$PACKAGE'
     VERSION='$VERSION'
-    TIMESTAMP='$TIMESTAMP'
     RM='$RM'
     ofile='$ofile'], [])
 ])dnl /_LT_CONFIG_SAVE_COMMANDS
@@ -974,7 +969,7 @@
 
     AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
       [lt_cv_apple_cc_single_mod=no
-      if test -z "${LT_MULTI_MODULE}"; then
+      if test -z "$LT_MULTI_MODULE"; then
 	# By default we will add the -single_module flag. You can override
 	# by either setting the environment variable LT_MULTI_MODULE
 	# non-empty at configure time, or by adding -multi_module to the
@@ -992,7 +987,7 @@
 	  cat conftest.err >&AS_MESSAGE_LOG_FD
 	# Otherwise, if the output was created with a 0 exit code from
 	# the compiler, it worked.
-	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
+	elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
 	  lt_cv_apple_cc_single_mod=yes
 	else
 	  cat conftest.err >&AS_MESSAGE_LOG_FD
@@ -1010,7 +1005,7 @@
       AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
 	[lt_cv_ld_exported_symbols_list=yes],
 	[lt_cv_ld_exported_symbols_list=no])
-	LDFLAGS="$save_LDFLAGS"
+	LDFLAGS=$save_LDFLAGS
     ])
 
     AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
@@ -1032,7 +1027,7 @@
       _lt_result=$?
       if test -s conftest.err && $GREP force_load conftest.err; then
 	cat conftest.err >&AS_MESSAGE_LOG_FD
-      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
+      elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
 	lt_cv_ld_force_load=yes
       else
 	cat conftest.err >&AS_MESSAGE_LOG_FD
@@ -1042,32 +1037,32 @@
     ])
     case $host_os in
     rhapsody* | darwin1.[[012]])
-      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
     darwin1.*)
-      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
     darwin*) # darwin 5.x on
       # if running on 10.5 or later, the deployment target defaults
       # to the OS version, if on x86, and 10.4, the deployment
       # target defaults to 10.4. Don't you love it?
       case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
 	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
-	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
 	10.[[012]]*)
-	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+	  _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
 	10.*)
-	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
       esac
     ;;
   esac
-    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+    if test yes = "$lt_cv_apple_cc_single_mod"; then
       _lt_dar_single_mod='$single_module'
     fi
-    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
-      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+    if test yes = "$lt_cv_ld_exported_symbols_list"; then
+      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
     else
-      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
     fi
-    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+    if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
       _lt_dsymutil='~$DSYMUTIL $lib || :'
     else
       _lt_dsymutil=
@@ -1087,29 +1082,29 @@
   _LT_TAGVAR(hardcode_direct, $1)=no
   _LT_TAGVAR(hardcode_automatic, $1)=yes
   _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-  if test "$lt_cv_ld_force_load" = "yes"; then
-    _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+  if test yes = "$lt_cv_ld_force_load"; then
+    _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
     m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
                   [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
   else
     _LT_TAGVAR(whole_archive_flag_spec, $1)=''
   fi
   _LT_TAGVAR(link_all_deplibs, $1)=yes
-  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
+  _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
   case $cc_basename in
-     ifort*) _lt_dar_can_shared=yes ;;
+     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
      *) _lt_dar_can_shared=$GCC ;;
   esac
-  if test "$_lt_dar_can_shared" = "yes"; then
+  if test yes = "$_lt_dar_can_shared"; then
     output_verbose_link_cmd=func_echo_all
-    _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
-    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
-    _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
-    _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+    _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
+    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
+    _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
+    _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
     m4_if([$1], [CXX],
-[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
-      _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
-      _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+[   if test yes != "$lt_cv_apple_cc_single_mod"; then
+      _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil"
+      _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
     fi
 ],[])
   else
@@ -1129,7 +1124,7 @@
 # Allow to override them for all tags through lt_cv_aix_libpath.
 m4_defun([_LT_SYS_MODULE_PATH_AIX],
 [m4_require([_LT_DECL_SED])dnl
-if test "${lt_cv_aix_libpath+set}" = set; then
+if test set = "${lt_cv_aix_libpath+set}"; then
   aix_libpath=$lt_cv_aix_libpath
 else
   AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
@@ -1147,7 +1142,7 @@
     _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
   fi],[])
   if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
-    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
+    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib
   fi
   ])
   aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
@@ -1167,8 +1162,8 @@
 # -----------------------
 # Find how we can fake an echo command that does not interpret backslash.
 # In particular, with Autoconf 2.60 or later we add some code to the start
-# of the generated configure script which will find a shell with a builtin
-# printf (which we can use as an echo command).
+# of the generated configure script that will find a shell with a builtin
+# printf (that we can use as an echo command).
 m4_defun([_LT_PROG_ECHO_BACKSLASH],
 [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
 ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
@@ -1196,10 +1191,10 @@
 # Invoke $ECHO with all args, space-separated.
 func_echo_all ()
 {
-    $ECHO "$*" 
+    $ECHO "$*"
 }
 
-case "$ECHO" in
+case $ECHO in
   printf*) AC_MSG_RESULT([printf]) ;;
   print*) AC_MSG_RESULT([print -r]) ;;
   *) AC_MSG_RESULT([cat]) ;;
@@ -1225,16 +1220,17 @@
 AC_DEFUN([_LT_WITH_SYSROOT],
 [AC_MSG_CHECKING([for sysroot])
 AC_ARG_WITH([sysroot],
-[  --with-sysroot[=DIR] Search for dependent libraries within DIR
-                        (or the compiler's sysroot if not specified).],
+[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
+  [Search for dependent libraries within DIR (or the compiler's sysroot
+   if not specified).])],
 [], [with_sysroot=no])
 
 dnl lt_sysroot will always be passed unquoted.  We quote it here
 dnl in case the user passed a directory name.
 lt_sysroot=
-case ${with_sysroot} in #(
+case $with_sysroot in #(
  yes)
-   if test "$GCC" = yes; then
+   if test yes = "$GCC"; then
      lt_sysroot=`$CC --print-sysroot 2>/dev/null`
    fi
    ;; #(
@@ -1244,14 +1240,14 @@
  no|'')
    ;; #(
  *)
-   AC_MSG_RESULT([${with_sysroot}])
+   AC_MSG_RESULT([$with_sysroot])
    AC_MSG_ERROR([The sysroot must be an absolute path.])
    ;;
 esac
 
  AC_MSG_RESULT([${lt_sysroot:-no}])
 _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
-[dependent libraries, and in which our libraries should be installed.])])
+[dependent libraries, and where our libraries should be installed.])])
 
 # _LT_ENABLE_LOCK
 # ---------------
@@ -1259,31 +1255,33 @@
 [AC_ARG_ENABLE([libtool-lock],
   [AS_HELP_STRING([--disable-libtool-lock],
     [avoid locking (might break parallel builds)])])
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+test no = "$enable_libtool_lock" || enable_libtool_lock=yes
 
 # Some flags need to be propagated to the compiler or linker for good
 # libtool support.
 case $host in
 ia64-*-hpux*)
-  # Find out which ABI we are using.
+  # Find out what ABI is being produced by ac_compile, and set mode
+  # options accordingly.
   echo 'int i;' > conftest.$ac_ext
   if AC_TRY_EVAL(ac_compile); then
     case `/usr/bin/file conftest.$ac_objext` in
       *ELF-32*)
-	HPUX_IA64_MODE="32"
+	HPUX_IA64_MODE=32
 	;;
       *ELF-64*)
-	HPUX_IA64_MODE="64"
+	HPUX_IA64_MODE=64
 	;;
     esac
   fi
   rm -rf conftest*
   ;;
 *-*-irix6*)
-  # Find out which ABI we are using.
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.
   echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
   if AC_TRY_EVAL(ac_compile); then
-    if test "$lt_cv_prog_gnu_ld" = yes; then
+    if test yes = "$lt_cv_prog_gnu_ld"; then
       case `/usr/bin/file conftest.$ac_objext` in
 	*32-bit*)
 	  LD="${LD-ld} -melf32bsmip"
@@ -1312,9 +1310,46 @@
   rm -rf conftest*
   ;;
 
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+mips64*-*linux*)
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.
+  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    emul=elf
+    case `/usr/bin/file conftest.$ac_objext` in
+      *32-bit*)
+	emul="${emul}32"
+	;;
+      *64-bit*)
+	emul="${emul}64"
+	;;
+    esac
+    case `/usr/bin/file conftest.$ac_objext` in
+      *MSB*)
+	emul="${emul}btsmip"
+	;;
+      *LSB*)
+	emul="${emul}ltsmip"
+	;;
+    esac
+    case `/usr/bin/file conftest.$ac_objext` in
+      *N32*)
+	emul="${emul}n32"
+	;;
+    esac
+    LD="${LD-ld} -m $emul"
+  fi
+  rm -rf conftest*
+  ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
-  # Find out which ABI we are using.
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.  Note that the listed cases only cover the
+  # situations where additional linker options are needed (such as when
+  # doing 32-bit compilation for a host where ld defaults to 64-bit, or
+  # vice versa); the common cases where no linker options are needed do
+  # not appear in the list.
   echo 'int i;' > conftest.$ac_ext
   if AC_TRY_EVAL(ac_compile); then
     case `/usr/bin/file conftest.o` in
@@ -1326,14 +1361,17 @@
 	  x86_64-*linux*)
 	    case `/usr/bin/file conftest.o` in
 	      *x86-64*)
-	         LD="${LD-ld} -m elf32_x86_64"
-	         ;;
+		LD="${LD-ld} -m elf32_x86_64"
+		;;
 	      *)
-	         LD="${LD-ld} -m elf_i386"
-	         ;;
+		LD="${LD-ld} -m elf_i386"
+		;;
 	    esac
 	    ;;
-	  ppc64-*linux*|powerpc64-*linux*)
+	  powerpc64le-*linux*)
+	    LD="${LD-ld} -m elf32lppclinux"
+	    ;;
+	  powerpc64-*linux*)
 	    LD="${LD-ld} -m elf32ppclinux"
 	    ;;
 	  s390x-*linux*)
@@ -1352,7 +1390,10 @@
 	  x86_64-*linux*)
 	    LD="${LD-ld} -m elf_x86_64"
 	    ;;
-	  ppc*-*linux*|powerpc*-*linux*)
+	  powerpcle-*linux*)
+	    LD="${LD-ld} -m elf64lppc"
+	    ;;
+	  powerpc-*linux*)
 	    LD="${LD-ld} -m elf64ppc"
 	    ;;
 	  s390*-*linux*|s390*-*tpf*)
@@ -1370,19 +1411,20 @@
 
 *-*-sco3.2v5*)
   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
-  SAVE_CFLAGS="$CFLAGS"
+  SAVE_CFLAGS=$CFLAGS
   CFLAGS="$CFLAGS -belf"
   AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
     [AC_LANG_PUSH(C)
      AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
      AC_LANG_POP])
-  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+  if test yes != "$lt_cv_cc_needs_belf"; then
     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
-    CFLAGS="$SAVE_CFLAGS"
+    CFLAGS=$SAVE_CFLAGS
   fi
   ;;
 *-*solaris*)
-  # Find out which ABI we are using.
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.
   echo 'int i;' > conftest.$ac_ext
   if AC_TRY_EVAL(ac_compile); then
     case `/usr/bin/file conftest.o` in
@@ -1390,7 +1432,7 @@
       case $lt_cv_prog_gnu_ld in
       yes*)
         case $host in
-        i?86-*-solaris*)
+        i?86-*-solaris*|x86_64-*-solaris*)
           LD="${LD-ld} -m elf_x86_64"
           ;;
         sparc*-*-solaris*)
@@ -1399,7 +1441,7 @@
         esac
         # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
         if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
-          LD="${LD-ld}_sol2"
+          LD=${LD-ld}_sol2
         fi
         ;;
       *)
@@ -1415,7 +1457,7 @@
   ;;
 esac
 
-need_locks="$enable_libtool_lock"
+need_locks=$enable_libtool_lock
 ])# _LT_ENABLE_LOCK
 
 
@@ -1434,11 +1476,11 @@
      [echo conftest.$ac_objext > conftest.lst
       lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
       AC_TRY_EVAL([lt_ar_try])
-      if test "$ac_status" -eq 0; then
+      if test 0 -eq "$ac_status"; then
 	# Ensure the archiver fails upon bogus file names.
 	rm -f conftest.$ac_objext libconftest.a
 	AC_TRY_EVAL([lt_ar_try])
-	if test "$ac_status" -ne 0; then
+	if test 0 -ne "$ac_status"; then
           lt_cv_ar_at_file=@
         fi
       fi
@@ -1446,7 +1488,7 @@
      ])
   ])
 
-if test "x$lt_cv_ar_at_file" = xno; then
+if test no = "$lt_cv_ar_at_file"; then
   archiver_list_spec=
 else
   archiver_list_spec=$lt_cv_ar_at_file
@@ -1477,7 +1519,7 @@
 
 if test -n "$RANLIB"; then
   case $host_os in
-  openbsd*)
+  bitrig* | openbsd*)
     old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
     ;;
   *)
@@ -1513,7 +1555,7 @@
   [$2=no
    m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
    echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$3"
+   lt_compiler_flag="$3"  ## exclude from sc_useless_quotes_in_assignment
    # Insert the option either (1) after the last *FLAGS variable, or
    # (2) before a word containing "conftest.", or (3) at the end.
    # Note that $ac_compile itself does not contain backslashes and begins
@@ -1540,7 +1582,7 @@
    $RM conftest*
 ])
 
-if test x"[$]$2" = xyes; then
+if test yes = "[$]$2"; then
     m4_if([$5], , :, [$5])
 else
     m4_if([$6], , :, [$6])
@@ -1562,7 +1604,7 @@
 m4_require([_LT_DECL_SED])dnl
 AC_CACHE_CHECK([$1], [$2],
   [$2=no
-   save_LDFLAGS="$LDFLAGS"
+   save_LDFLAGS=$LDFLAGS
    LDFLAGS="$LDFLAGS $3"
    echo "$lt_simple_link_test_code" > conftest.$ac_ext
    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
@@ -1581,10 +1623,10 @@
      fi
    fi
    $RM -r conftest*
-   LDFLAGS="$save_LDFLAGS"
+   LDFLAGS=$save_LDFLAGS
 ])
 
-if test x"[$]$2" = xyes; then
+if test yes = "[$]$2"; then
     m4_if([$4], , :, [$4])
 else
     m4_if([$5], , :, [$5])
@@ -1605,7 +1647,7 @@
 AC_MSG_CHECKING([the maximum length of command line arguments])
 AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
   i=0
-  teststring="ABCD"
+  teststring=ABCD
 
   case $build_os in
   msdosdjgpp*)
@@ -1645,7 +1687,7 @@
     lt_cv_sys_max_cmd_len=8192;
     ;;
 
-  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+  bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
     # This has been around since 386BSD, at least.  Likely further.
     if test -x /sbin/sysctl; then
       lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
@@ -1696,22 +1738,22 @@
   *)
     lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
     if test -n "$lt_cv_sys_max_cmd_len" && \
-      test undefined != "$lt_cv_sys_max_cmd_len"; then
+       test undefined != "$lt_cv_sys_max_cmd_len"; then
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
     else
       # Make teststring a little bigger before we do anything with it.
       # a 1K string should be a reasonable start.
-      for i in 1 2 3 4 5 6 7 8 ; do
+      for i in 1 2 3 4 5 6 7 8; do
         teststring=$teststring$teststring
       done
       SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
       # If test is not a shell built-in, we'll probably end up computing a
       # maximum length that is only half of the actual maximum length, but
       # we can't tell.
-      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
+      while { test X`env echo "$teststring$teststring" 2>/dev/null` \
 	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
-	      test $i != 17 # 1/2 MB should be enough
+	      test 17 != "$i" # 1/2 MB should be enough
       do
         i=`expr $i + 1`
         teststring=$teststring$teststring
@@ -1727,7 +1769,7 @@
     ;;
   esac
 ])
-if test -n $lt_cv_sys_max_cmd_len ; then
+if test -n "$lt_cv_sys_max_cmd_len"; then
   AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
 else
   AC_MSG_RESULT(none)
@@ -1755,7 +1797,7 @@
 # ----------------------------------------------------------------
 m4_defun([_LT_TRY_DLOPEN_SELF],
 [m4_require([_LT_HEADER_DLFCN])dnl
-if test "$cross_compiling" = yes; then :
+if test yes = "$cross_compiling"; then :
   [$4]
 else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
@@ -1804,7 +1846,7 @@
 
 /* When -fvisbility=hidden is used, assume the code has been annotated
    correspondingly for the symbols needed.  */
-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
 int fnord () __attribute__((visibility("default")));
 #endif
 
@@ -1830,7 +1872,7 @@
   return status;
 }]
 _LT_EOF
-  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+  if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
     (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
     lt_status=$?
     case x$lt_status in
@@ -1851,7 +1893,7 @@
 # ------------------
 AC_DEFUN([LT_SYS_DLOPEN_SELF],
 [m4_require([_LT_HEADER_DLFCN])dnl
-if test "x$enable_dlopen" != xyes; then
+if test yes != "$enable_dlopen"; then
   enable_dlopen=unknown
   enable_dlopen_self=unknown
   enable_dlopen_self_static=unknown
@@ -1861,44 +1903,52 @@
 
   case $host_os in
   beos*)
-    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen=load_add_on
     lt_cv_dlopen_libs=
     lt_cv_dlopen_self=yes
     ;;
 
   mingw* | pw32* | cegcc*)
-    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen=LoadLibrary
     lt_cv_dlopen_libs=
     ;;
 
   cygwin*)
-    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen=dlopen
     lt_cv_dlopen_libs=
     ;;
 
   darwin*)
-  # if libdl is installed we need to link against it
+    # if libdl is installed we need to link against it
     AC_CHECK_LIB([dl], [dlopen],
-		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
-    lt_cv_dlopen="dyld"
+		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[
+    lt_cv_dlopen=dyld
     lt_cv_dlopen_libs=
     lt_cv_dlopen_self=yes
     ])
     ;;
 
+  tpf*)
+    # Don't try to run any link tests for TPF.  We know it's impossible
+    # because TPF is a cross-compiler, and we know how we open DSOs.
+    lt_cv_dlopen=dlopen
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=no
+    ;;
+
   *)
     AC_CHECK_FUNC([shl_load],
-	  [lt_cv_dlopen="shl_load"],
+	  [lt_cv_dlopen=shl_load],
       [AC_CHECK_LIB([dld], [shl_load],
-	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
+	    [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],
 	[AC_CHECK_FUNC([dlopen],
-	      [lt_cv_dlopen="dlopen"],
+	      [lt_cv_dlopen=dlopen],
 	  [AC_CHECK_LIB([dl], [dlopen],
-		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],
 	    [AC_CHECK_LIB([svld], [dlopen],
-		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+		  [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],
 	      [AC_CHECK_LIB([dld], [dld_link],
-		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
+		    [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])
 	      ])
 	    ])
 	  ])
@@ -1907,21 +1957,21 @@
     ;;
   esac
 
-  if test "x$lt_cv_dlopen" != xno; then
-    enable_dlopen=yes
-  else
+  if test no = "$lt_cv_dlopen"; then
     enable_dlopen=no
+  else
+    enable_dlopen=yes
   fi
 
   case $lt_cv_dlopen in
   dlopen)
-    save_CPPFLAGS="$CPPFLAGS"
-    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+    save_CPPFLAGS=$CPPFLAGS
+    test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
 
-    save_LDFLAGS="$LDFLAGS"
+    save_LDFLAGS=$LDFLAGS
     wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
 
-    save_LIBS="$LIBS"
+    save_LIBS=$LIBS
     LIBS="$lt_cv_dlopen_libs $LIBS"
 
     AC_CACHE_CHECK([whether a program can dlopen itself],
@@ -1931,7 +1981,7 @@
 	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
     ])
 
-    if test "x$lt_cv_dlopen_self" = xyes; then
+    if test yes = "$lt_cv_dlopen_self"; then
       wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
       AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
 	  lt_cv_dlopen_self_static, [dnl
@@ -1941,9 +1991,9 @@
       ])
     fi
 
-    CPPFLAGS="$save_CPPFLAGS"
-    LDFLAGS="$save_LDFLAGS"
-    LIBS="$save_LIBS"
+    CPPFLAGS=$save_CPPFLAGS
+    LDFLAGS=$save_LDFLAGS
+    LIBS=$save_LIBS
     ;;
   esac
 
@@ -2035,8 +2085,8 @@
 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
 _LT_COMPILER_C_O([$1])
 
-hard_links="nottested"
-if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+hard_links=nottested
+if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then
   # do not overwrite the value of need_locks provided by the user
   AC_MSG_CHECKING([if we can lock with hard links])
   hard_links=yes
@@ -2046,8 +2096,8 @@
   ln conftest.a conftest.b 2>&5 || hard_links=no
   ln conftest.a conftest.b 2>/dev/null && hard_links=no
   AC_MSG_RESULT([$hard_links])
-  if test "$hard_links" = no; then
-    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+  if test no = "$hard_links"; then
+    AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])
     need_locks=warn
   fi
 else
@@ -2074,8 +2124,8 @@
 _LT_DECL([], [objdir], [0],
          [The name of the directory that contains temporary libtool files])dnl
 m4_pattern_allow([LT_OBJDIR])dnl
-AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
-  [Define to the sub-directory in which libtool stores uninstalled libraries.])
+AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/",
+  [Define to the sub-directory where libtool stores uninstalled libraries.])
 ])# _LT_CHECK_OBJDIR
 
 
@@ -2087,15 +2137,15 @@
 _LT_TAGVAR(hardcode_action, $1)=
 if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
    test -n "$_LT_TAGVAR(runpath_var, $1)" ||
-   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+   test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
 
   # We can hardcode non-existent directories.
-  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
+  if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
      # If the only mechanism to avoid hardcoding is shlibpath_var, we
      # have to relink, otherwise we might link with an installed library
      # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
-     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
+     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
+     test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
     # Linking always hardcodes the temporary library directory.
     _LT_TAGVAR(hardcode_action, $1)=relink
   else
@@ -2109,12 +2159,12 @@
 fi
 AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
 
-if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
-   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
+if test relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
+   test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
   # Fast installation is not supported
   enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
+elif test yes = "$shlibpath_overrides_runpath" ||
+     test no = "$enable_shared"; then
   # Fast installation is not necessary
   enable_fast_install=needless
 fi
@@ -2138,7 +2188,7 @@
 # FIXME - insert some real tests, host_os isn't really good enough
   case $host_os in
   darwin*)
-    if test -n "$STRIP" ; then
+    if test -n "$STRIP"; then
       striplib="$STRIP -x"
       old_striplib="$STRIP -S"
       AC_MSG_RESULT([yes])
@@ -2169,14 +2219,14 @@
 AC_MSG_CHECKING([dynamic linker characteristics])
 m4_if([$1],
 	[], [
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
   case $host_os in
-    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
-    *) lt_awk_arg="/^libraries:/" ;;
+    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
+    *) lt_awk_arg='/^libraries:/' ;;
   esac
   case $host_os in
-    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
-    *) lt_sed_strip_eq="s,=/,/,g" ;;
+    mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
+    *) lt_sed_strip_eq='s|=/|/|g' ;;
   esac
   lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
   case $lt_search_path_spec in
@@ -2192,28 +2242,35 @@
     ;;
   esac
   # Ok, now we have the path, separated by spaces, we can step through it
-  # and add multilib dir if necessary.
+  # and add multilib dir if necessary...
   lt_tmp_lt_search_path_spec=
-  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  # ...but if some path component already ends with the multilib dir we assume
+  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
+  case "$lt_multi_os_dir; $lt_search_path_spec " in
+  "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
+    lt_multi_os_dir=
+    ;;
+  esac
   for lt_sys_path in $lt_search_path_spec; do
-    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
-      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
-    else
+    if test -d "$lt_sys_path$lt_multi_os_dir"; then
+      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
+    elif test -n "$lt_multi_os_dir"; then
       test -d "$lt_sys_path" && \
 	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
     fi
   done
   lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
-BEGIN {RS=" "; FS="/|\n";} {
-  lt_foo="";
-  lt_count=0;
+BEGIN {RS = " "; FS = "/|\n";} {
+  lt_foo = "";
+  lt_count = 0;
   for (lt_i = NF; lt_i > 0; lt_i--) {
     if ($lt_i != "" && $lt_i != ".") {
       if ($lt_i == "..") {
         lt_count++;
       } else {
         if (lt_count == 0) {
-          lt_foo="/" $lt_i lt_foo;
+          lt_foo = "/" $lt_i lt_foo;
         } else {
           lt_count--;
         }
@@ -2227,7 +2284,7 @@
   # for these hosts.
   case $host_os in
     mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
-      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
+      $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
   esac
   sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
 else
@@ -2236,7 +2293,7 @@
 library_names_spec=
 libname_spec='lib$name'
 soname_spec=
-shrext_cmds=".so"
+shrext_cmds=.so
 postinstall_cmds=
 postuninstall_cmds=
 finish_cmds=
@@ -2256,11 +2313,11 @@
 case $host_os in
 aix3*)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
   shlibpath_var=LIBPATH
 
   # AIX 3 has no versioning support, so we append a major version to the name.
-  soname_spec='${libname}${release}${shared_ext}$major'
+  soname_spec='$libname$release$shared_ext$major'
   ;;
 
 aix[[4-9]]*)
@@ -2268,40 +2325,40 @@
   need_lib_prefix=no
   need_version=no
   hardcode_into_libs=yes
-  if test "$host_cpu" = ia64; then
+  if test ia64 = "$host_cpu"; then
     # AIX 5 supports IA64
-    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
     shlibpath_var=LD_LIBRARY_PATH
   else
     # With GCC up to 2.95.x, collect2 would create an import file
     # for dependence libraries.  The import file would start with
-    # the line `#! .'.  This would cause the generated library to
-    # depend on `.', always an invalid library.  This was fixed in
+    # the line '#! .'.  This would cause the generated library to
+    # depend on '.', always an invalid library.  This was fixed in
     # development snapshots of GCC prior to 3.0.
     case $host_os in
       aix4 | aix4.[[01]] | aix4.[[01]].*)
       if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
 	   echo ' yes '
-	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
 	:
       else
 	can_build_shared=no
       fi
       ;;
     esac
-    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
     # soname into executable. Probably we can add versioning support to
     # collect2, so additional links can be useful in future.
-    if test "$aix_use_runtimelinking" = yes; then
+    if test yes = "$aix_use_runtimelinking"; then
       # If using run time linking (on AIX 4.2 or later) use lib<name>.so
       # instead of lib<name>.a to let people know that these are not
       # typical AIX shared libraries.
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
     else
       # We preserve .a as extension for shared libraries through AIX4.2
       # and later when we are not doing run time linking.
-      library_names_spec='${libname}${release}.a $libname.a'
-      soname_spec='${libname}${release}${shared_ext}$major'
+      library_names_spec='$libname$release.a $libname.a'
+      soname_spec='$libname$release$shared_ext$major'
     fi
     shlibpath_var=LIBPATH
   fi
@@ -2312,18 +2369,18 @@
   powerpc)
     # Since July 2007 AmigaOS4 officially supports .so libraries.
     # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
     ;;
   m68k)
     library_names_spec='$libname.ixlibrary $libname.a'
     # Create ${libname}_ixlibrary.a entries in /sys/libs.
-    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
     ;;
   esac
   ;;
 
 beos*)
-  library_names_spec='${libname}${shared_ext}'
+  library_names_spec='$libname$shared_ext'
   dynamic_linker="$host_os ld.so"
   shlibpath_var=LIBRARY_PATH
   ;;
@@ -2331,8 +2388,8 @@
 bsdi[[45]]*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
@@ -2344,7 +2401,7 @@
 
 cygwin* | mingw* | pw32* | cegcc*)
   version_type=windows
-  shrext_cmds=".dll"
+  shrext_cmds=.dll
   need_version=no
   need_lib_prefix=no
 
@@ -2353,8 +2410,8 @@
     # gcc
     library_names_spec='$libname.dll.a'
     # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+    postinstall_cmds='base_file=`basename \$file`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
       $install_prog $dir/$dlname \$dldir/$dlname~
@@ -2370,17 +2427,17 @@
     case $host_os in
     cygwin*)
       # Cygwin DLLs use 'cyg' prefix rather than 'lib'
-      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
 m4_if([$1], [],[
       sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
       ;;
     mingw* | cegcc*)
       # MinGW DLLs use traditional 'lib' prefix
-      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
       ;;
     pw32*)
       # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
       ;;
     esac
     dynamic_linker='Win32 ld.exe'
@@ -2389,8 +2446,8 @@
   *,cl*)
     # Native MSVC
     libname_spec='$name'
-    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-    library_names_spec='${libname}.dll.lib'
+    soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
+    library_names_spec='$libname.dll.lib'
 
     case $build_os in
     mingw*)
@@ -2417,7 +2474,7 @@
       sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
       ;;
     *)
-      sys_lib_search_path_spec="$LIB"
+      sys_lib_search_path_spec=$LIB
       if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
         # It is most probably a Windows format PATH.
         sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
@@ -2430,8 +2487,8 @@
     esac
 
     # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+    postinstall_cmds='base_file=`basename \$file`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
       $install_prog $dir/$dlname \$dldir/$dlname'
@@ -2444,7 +2501,7 @@
 
   *)
     # Assume MSVC wrapper
-    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
     dynamic_linker='Win32 ld.exe'
     ;;
   esac
@@ -2457,8 +2514,8 @@
   version_type=darwin
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
-  soname_spec='${libname}${release}${major}$shared_ext'
+  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
+  soname_spec='$libname$release$major$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
   shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
@@ -2471,8 +2528,8 @@
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
@@ -2490,12 +2547,12 @@
   version_type=freebsd-$objformat
   case $version_type in
     freebsd-elf*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
       need_version=no
       need_lib_prefix=no
       ;;
     freebsd-*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
       need_version=yes
       ;;
   esac
@@ -2520,26 +2577,15 @@
   esac
   ;;
 
-gnu*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
 haiku*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   dynamic_linker="$host_os runtime_loader"
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
+  shlibpath_overrides_runpath=no
   sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
@@ -2557,9 +2603,9 @@
     dynamic_linker="$host_os dld.so"
     shlibpath_var=LD_LIBRARY_PATH
     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    if test "X$HPUX_IA64_MODE" = X32; then
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    if test 32 = "$HPUX_IA64_MODE"; then
       sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
     else
       sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
@@ -2572,8 +2618,8 @@
     dynamic_linker="$host_os dld.sl"
     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
@@ -2582,8 +2628,8 @@
     dynamic_linker="$host_os dld.sl"
     shlibpath_var=SHLIB_PATH
     shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
     ;;
   esac
   # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
@@ -2596,8 +2642,8 @@
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
@@ -2608,7 +2654,7 @@
   case $host_os in
     nonstopux*) version_type=nonstopux ;;
     *)
-	if test "$lt_cv_prog_gnu_ld" = yes; then
+	if test yes = "$lt_cv_prog_gnu_ld"; then
 		version_type=linux # correct to gnu/linux during the next big refactor
 	else
 		version_type=irix
@@ -2616,8 +2662,8 @@
   esac
   need_lib_prefix=no
   need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
   case $host_os in
   irix5* | nonstopux*)
     libsuff= shlibsuff=
@@ -2636,8 +2682,8 @@
   esac
   shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
   shlibpath_overrides_runpath=no
-  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
-  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
+  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
   hardcode_into_libs=yes
   ;;
 
@@ -2646,13 +2692,33 @@
   dynamic_linker=no
   ;;
 
+linux*android*)
+  version_type=none # Android doesn't support versioned libraries.
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext'
+  soname_spec='$libname$release$shared_ext'
+  finish_cmds=
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  dynamic_linker='Android linker'
+  # Don't embed -rpath directories since the linker doesn't support them.
+  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+  ;;
+
 # This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
@@ -2677,14 +2743,10 @@
   # before this can be enabled.
   hardcode_into_libs=yes
 
-  # Add ABI-specific directories to the system library path.
-  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
-
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
     lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
-
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
   # We used to test for /lib/ld.so.1 and disable shared libraries on
@@ -2701,12 +2763,12 @@
   need_lib_prefix=no
   need_version=no
   if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
     finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
     dynamic_linker='NetBSD (a.out) ld.so'
   else
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
     dynamic_linker='NetBSD ld.elf_so'
   fi
   shlibpath_var=LD_LIBRARY_PATH
@@ -2716,7 +2778,7 @@
 
 newsos6)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
   ;;
@@ -2725,45 +2787,34 @@
   version_type=qnx
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
   hardcode_into_libs=yes
   dynamic_linker='ldqnx.so'
   ;;
 
-openbsd*)
+openbsd* | bitrig*)
   version_type=sunos
-  sys_lib_dlsearch_path_spec="/usr/lib"
+  sys_lib_dlsearch_path_spec=/usr/lib
   need_lib_prefix=no
-  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
-  case $host_os in
-    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
-    *)				need_version=no  ;;
-  esac
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+    need_version=no
+  else
+    need_version=yes
+  fi
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
   shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    case $host_os in
-      openbsd2.[[89]] | openbsd2.[[89]].*)
-	shlibpath_overrides_runpath=no
-	;;
-      *)
-	shlibpath_overrides_runpath=yes
-	;;
-      esac
-  else
-    shlibpath_overrides_runpath=yes
-  fi
+  shlibpath_overrides_runpath=yes
   ;;
 
 os2*)
   libname_spec='$name'
-  shrext_cmds=".dll"
+  shrext_cmds=.dll
   need_lib_prefix=no
-  library_names_spec='$libname${shared_ext} $libname.a'
+  library_names_spec='$libname$shared_ext $libname.a'
   dynamic_linker='OS/2 ld.exe'
   shlibpath_var=LIBPATH
   ;;
@@ -2772,11 +2823,11 @@
   version_type=osf
   need_lib_prefix=no
   need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
   shlibpath_var=LD_LIBRARY_PATH
   sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
   ;;
 
 rdos*)
@@ -2787,8 +2838,8 @@
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
   hardcode_into_libs=yes
@@ -2798,11 +2849,11 @@
 
 sunos4*)
   version_type=sunos
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
   finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
-  if test "$with_gnu_ld" = yes; then
+  if test yes = "$with_gnu_ld"; then
     need_lib_prefix=no
   fi
   need_version=yes
@@ -2810,8 +2861,8 @@
 
 sysv4 | sysv4.3*)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   case $host_vendor in
     sni)
@@ -2832,10 +2883,10 @@
   ;;
 
 sysv4*MP*)
-  if test -d /usr/nec ;then
+  if test -d /usr/nec; then
     version_type=linux # correct to gnu/linux during the next big refactor
-    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
-    soname_spec='$libname${shared_ext}.$major'
+    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
+    soname_spec='$libname$shared_ext.$major'
     shlibpath_var=LD_LIBRARY_PATH
   fi
   ;;
@@ -2844,12 +2895,12 @@
   version_type=freebsd-elf
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
   hardcode_into_libs=yes
-  if test "$with_gnu_ld" = yes; then
+  if test yes = "$with_gnu_ld"; then
     sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
   else
     sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
@@ -2867,7 +2918,7 @@
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
   hardcode_into_libs=yes
@@ -2875,8 +2926,8 @@
 
 uts4*)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
@@ -2885,18 +2936,18 @@
   ;;
 esac
 AC_MSG_RESULT([$dynamic_linker])
-test "$dynamic_linker" = no && can_build_shared=no
+test no = "$dynamic_linker" && can_build_shared=no
 
 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
   variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
 fi
 
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
-  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
+  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
 fi
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
-  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
+  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
 fi
 
 _LT_DECL([], [variables_saved_for_relink], [1],
@@ -2938,32 +2989,32 @@
 
 # _LT_PATH_TOOL_PREFIX(TOOL)
 # --------------------------
-# find a file program which can recognize shared library
+# find a file program that can recognize shared library
 AC_DEFUN([_LT_PATH_TOOL_PREFIX],
 [m4_require([_LT_DECL_EGREP])dnl
 AC_MSG_CHECKING([for $1])
 AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
 [case $MAGIC_CMD in
 [[\\/*] |  ?:[\\/]*])
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
   ;;
 *)
-  lt_save_MAGIC_CMD="$MAGIC_CMD"
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  lt_save_MAGIC_CMD=$MAGIC_CMD
+  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
 dnl $ac_dummy forces splitting on constant user-supplied paths.
 dnl POSIX.2 word splitting is done only on the output of word expansions,
 dnl not every word.  This closes a longstanding sh security hole.
   ac_dummy="m4_if([$2], , $PATH, [$2])"
   for ac_dir in $ac_dummy; do
-    IFS="$lt_save_ifs"
+    IFS=$lt_save_ifs
     test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$1; then
-      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+    if test -f "$ac_dir/$1"; then
+      lt_cv_path_MAGIC_CMD=$ac_dir/"$1"
       if test -n "$file_magic_test_file"; then
 	case $deplibs_check_method in
 	"file_magic "*)
 	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
-	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
 	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
 	    $EGREP "$file_magic_regex" > /dev/null; then
 	    :
@@ -2986,11 +3037,11 @@
       break
     fi
   done
-  IFS="$lt_save_ifs"
-  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  IFS=$lt_save_ifs
+  MAGIC_CMD=$lt_save_MAGIC_CMD
   ;;
 esac])
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+MAGIC_CMD=$lt_cv_path_MAGIC_CMD
 if test -n "$MAGIC_CMD"; then
   AC_MSG_RESULT($MAGIC_CMD)
 else
@@ -3008,7 +3059,7 @@
 
 # _LT_PATH_MAGIC
 # --------------
-# find a file program which can recognize a shared library
+# find a file program that can recognize a shared library
 m4_defun([_LT_PATH_MAGIC],
 [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
 if test -z "$lt_cv_path_MAGIC_CMD"; then
@@ -3035,16 +3086,16 @@
 AC_ARG_WITH([gnu-ld],
     [AS_HELP_STRING([--with-gnu-ld],
 	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
-    [test "$withval" = no || with_gnu_ld=yes],
+    [test no = "$withval" || with_gnu_ld=yes],
     [with_gnu_ld=no])dnl
 
 ac_prog=ld
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
   # Check if gcc -print-prog-name=ld gives a path.
   AC_MSG_CHECKING([for ld used by $CC])
   case $host in
   *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
+    # gcc leaves a trailing carriage return, which upsets mingw
     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
   *)
     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
@@ -3058,7 +3109,7 @@
       while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
 	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
       done
-      test -z "$LD" && LD="$ac_prog"
+      test -z "$LD" && LD=$ac_prog
       ;;
   "")
     # If it fails, then pretend we aren't using GCC.
@@ -3069,37 +3120,37 @@
     with_gnu_ld=unknown
     ;;
   esac
-elif test "$with_gnu_ld" = yes; then
+elif test yes = "$with_gnu_ld"; then
   AC_MSG_CHECKING([for GNU ld])
 else
   AC_MSG_CHECKING([for non-GNU ld])
 fi
 AC_CACHE_VAL(lt_cv_path_LD,
 [if test -z "$LD"; then
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
   for ac_dir in $PATH; do
-    IFS="$lt_save_ifs"
+    IFS=$lt_save_ifs
     test -z "$ac_dir" && ac_dir=.
     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      lt_cv_path_LD="$ac_dir/$ac_prog"
+      lt_cv_path_LD=$ac_dir/$ac_prog
       # Check to see if the program is GNU ld.  I'd rather use --version,
       # but apparently some variants of GNU ld only accept -v.
       # Break only if it was the GNU/non-GNU ld that we prefer.
       case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
       *GNU* | *'with BFD'*)
-	test "$with_gnu_ld" != no && break
+	test no != "$with_gnu_ld" && break
 	;;
       *)
-	test "$with_gnu_ld" != yes && break
+	test yes != "$with_gnu_ld" && break
 	;;
       esac
     fi
   done
-  IFS="$lt_save_ifs"
+  IFS=$lt_save_ifs
 else
-  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+  lt_cv_path_LD=$LD # Let the user override the test with a path.
 fi])
-LD="$lt_cv_path_LD"
+LD=$lt_cv_path_LD
 if test -n "$LD"; then
   AC_MSG_RESULT($LD)
 else
@@ -3153,13 +3204,13 @@
 reload_cmds='$LD$reload_flag -o $output$reload_objs'
 case $host_os in
   cygwin* | mingw* | pw32* | cegcc*)
-    if test "$GCC" != yes; then
+    if test yes != "$GCC"; then
       reload_cmds=false
     fi
     ;;
   darwin*)
-    if test "$GCC" = yes; then
-      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+    if test yes = "$GCC"; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
     else
       reload_cmds='$LD$reload_flag -o $output$reload_objs'
     fi
@@ -3185,13 +3236,13 @@
 # Need to set the preceding variable on all platforms that support
 # interlibrary dependencies.
 # 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
+# 'unknown' -- same as none, but documents that we really don't know.
 # 'pass_all' -- all dependencies passed with no checks.
 # 'test_compile' -- check by making test program.
 # 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given extended regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
+# that responds to the $file_magic_cmd with a given extended regex.
+# If you have 'file' or equivalent on your system and you're not sure
+# whether 'pass_all' will *always* work, you probably want this one.
 
 case $host_os in
 aix[[4-9]]*)
@@ -3218,8 +3269,7 @@
   # Base MSYS/MinGW do not provide the 'file' command needed by
   # func_win32_libid shell function, so use a weaker test based on 'objdump',
   # unless we find 'file', for example because we are cross-compiling.
-  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
-  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+  if ( file / ) >/dev/null 2>&1; then
     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
     lt_cv_file_magic_cmd='func_win32_libid'
   else
@@ -3255,10 +3305,6 @@
   fi
   ;;
 
-gnu*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
 haiku*)
   lt_cv_deplibs_check_method=pass_all
   ;;
@@ -3297,7 +3343,7 @@
   ;;
 
 # This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
@@ -3319,8 +3365,8 @@
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-openbsd*)
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+openbsd* | bitrig*)
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
     lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
   else
     lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
@@ -3413,33 +3459,33 @@
 AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
 [if test -n "$NM"; then
   # Let the user override the test.
-  lt_cv_path_NM="$NM"
+  lt_cv_path_NM=$NM
 else
-  lt_nm_to_check="${ac_tool_prefix}nm"
+  lt_nm_to_check=${ac_tool_prefix}nm
   if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
     lt_nm_to_check="$lt_nm_to_check nm"
   fi
   for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
     for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       test -z "$ac_dir" && ac_dir=.
-      tmp_nm="$ac_dir/$lt_tmp_nm"
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+      tmp_nm=$ac_dir/$lt_tmp_nm
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
 	# Check to see if the nm accepts a BSD-compat flag.
-	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
+	# Adding the 'sed 1q' prevents false positives on HP-UX, which says:
 	#   nm: unknown option "B" ignored
 	# Tru64's nm complains that /dev/null is an invalid object file
 	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
 	*/dev/null* | *'Invalid file or object type'*)
 	  lt_cv_path_NM="$tmp_nm -B"
-	  break
+	  break 2
 	  ;;
 	*)
 	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
 	  */dev/null*)
 	    lt_cv_path_NM="$tmp_nm -p"
-	    break
+	    break 2
 	    ;;
 	  *)
 	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
@@ -3450,21 +3496,21 @@
 	esac
       fi
     done
-    IFS="$lt_save_ifs"
+    IFS=$lt_save_ifs
   done
   : ${lt_cv_path_NM=no}
 fi])
-if test "$lt_cv_path_NM" != "no"; then
-  NM="$lt_cv_path_NM"
+if test no != "$lt_cv_path_NM"; then
+  NM=$lt_cv_path_NM
 else
   # Didn't find any BSD compatible name lister, look for dumpbin.
   if test -n "$DUMPBIN"; then :
     # Let the user override the test.
   else
     AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
-    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
     *COFF*)
-      DUMPBIN="$DUMPBIN -symbols"
+      DUMPBIN="$DUMPBIN -symbols -headers"
       ;;
     *)
       DUMPBIN=:
@@ -3472,8 +3518,8 @@
     esac
   fi
   AC_SUBST([DUMPBIN])
-  if test "$DUMPBIN" != ":"; then
-    NM="$DUMPBIN"
+  if test : != "$DUMPBIN"; then
+    NM=$DUMPBIN
   fi
 fi
 test -z "$NM" && NM=nm
@@ -3519,8 +3565,8 @@
 
 case $host_os in
 cygwin* | mingw* | pw32* | cegcc*)
-  # two different shell functions defined in ltmain.sh
-  # decide which to use based on capabilities of $DLLTOOL
+  # two different shell functions defined in ltmain.sh;
+  # decide which one to use based on capabilities of $DLLTOOL
   case `$DLLTOOL --help 2>&1` in
   *--identify-strict*)
     lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
@@ -3532,7 +3578,7 @@
   ;;
 *)
   # fallback: assume linklib IS sharedlib
-  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+  lt_cv_sharedlib_from_linklib_cmd=$ECHO
   ;;
 esac
 ])
@@ -3559,13 +3605,28 @@
     lt_cv_path_mainfest_tool=yes
   fi
   rm -f conftest*])
-if test "x$lt_cv_path_mainfest_tool" != xyes; then
+if test yes != "$lt_cv_path_mainfest_tool"; then
   MANIFEST_TOOL=:
 fi
 _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
 ])# _LT_PATH_MANIFEST_TOOL
 
 
+# _LT_DLL_DEF_P([FILE])
+# ---------------------
+# True iff FILE is a Windows DLL '.def' file.
+# Keep in sync with func_dll_def_p in the libtool script
+AC_DEFUN([_LT_DLL_DEF_P],
+[dnl
+  test DEF = "`$SED -n dnl
+    -e '\''s/^[[	 ]]*//'\'' dnl Strip leading whitespace
+    -e '\''/^\(;.*\)*$/d'\'' dnl      Delete empty lines and comments
+    -e '\''s/^\(EXPORTS\|LIBRARY\)\([[	 ]].*\)*$/DEF/p'\'' dnl
+    -e q dnl                          Only consider the first "real" line
+    $1`" dnl
+])# _LT_DLL_DEF_P
+
+
 # LT_LIB_M
 # --------
 # check for math library
@@ -3577,11 +3638,11 @@
   # These system don't have libm, or don't need it
   ;;
 *-ncr-sysv4.3*)
-  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
   AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
   ;;
 *)
-  AC_CHECK_LIB(m, cos, LIBM="-lm")
+  AC_CHECK_LIB(m, cos, LIBM=-lm)
   ;;
 esac
 AC_SUBST([LIBM])
@@ -3600,7 +3661,7 @@
 
 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
 
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
   case $cc_basename in
   nvcc*)
     _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
@@ -3652,7 +3713,7 @@
   symcode='[[ABCDGISTW]]'
   ;;
 hpux*)
-  if test "$host_cpu" = ia64; then
+  if test ia64 = "$host_cpu"; then
     symcode='[[ABCDEGRST]]'
   fi
   ;;
@@ -3685,14 +3746,44 @@
   symcode='[[ABCDGIRSTW]]' ;;
 esac
 
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+  # Gets list of data symbols to import.
+  lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
+  # Adjust the below global symbol transforms to fixup imported variables.
+  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
+  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
+  lt_c_name_lib_hook="\
+  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
+  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
+else
+  # Disable hooks by default.
+  lt_cv_sys_global_symbol_to_import=
+  lt_cdecl_hook=
+  lt_c_name_hook=
+  lt_c_name_lib_hook=
+fi
+
 # Transform an extracted symbol line into a proper C declaration.
 # Some systems (esp. on ia64) link data and code symbols differently,
 # so use this general approach.
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+lt_cv_sys_global_symbol_to_cdecl="sed -n"\
+$lt_cdecl_hook\
+" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
 
 # Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
+$lt_c_name_hook\
+" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
+
+# Transform an extracted symbol line into symbol name with lib prefix and
+# symbol address.
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
+$lt_c_name_lib_hook\
+" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
 
 # Handle CRLF in mingw tool chain
 opt_cr=
@@ -3710,21 +3801,24 @@
 
   # Write the raw and C identifiers.
   if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-    # Fake it for dumpbin and say T for any non-static function
-    # and D for any global variable.
+    # Fake it for dumpbin and say T for any non-static function,
+    # D for any global variable and I for any imported variable.
     # Also find C++ and __fastcall symbols from MSVC++,
     # which start with @ or ?.
     lt_cv_sys_global_symbol_pipe="$AWK ['"\
 "     {last_section=section; section=\$ 3};"\
 "     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
 "     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+"     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
+"     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
+"     /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
 "     \$ 0!~/External *\|/{next};"\
 "     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
 "     {if(hide[section]) next};"\
-"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
-"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
-"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
-"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+"     {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
+"     {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
+"     s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
+"     s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
 "     ' prfx=^$ac_symprfx]"
   else
     lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
@@ -3764,11 +3858,11 @@
 	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
 	  cat <<_LT_EOF > conftest.$ac_ext
 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-/* DATA imports from DLLs on WIN32 con't be const, because runtime
+#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
+/* DATA imports from DLLs on WIN32 can't be const, because runtime
    relocations are performed -- see ld's documentation on pseudo-relocs.  */
 # define LT@&t@_DLSYM_CONST
-#elif defined(__osf__)
+#elif defined __osf__
 /* This system does not cope well with relocations in const data.  */
 # define LT@&t@_DLSYM_CONST
 #else
@@ -3794,7 +3888,7 @@
 {
   { "@PROGRAM@", (void *) 0 },
 _LT_EOF
-	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+	  $SED "s/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
 	  cat <<\_LT_EOF >> conftest.$ac_ext
   {0, (void *) 0}
 };
@@ -3814,9 +3908,9 @@
 	  mv conftest.$ac_objext conftstm.$ac_objext
 	  lt_globsym_save_LIBS=$LIBS
 	  lt_globsym_save_CFLAGS=$CFLAGS
-	  LIBS="conftstm.$ac_objext"
+	  LIBS=conftstm.$ac_objext
 	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
-	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+	  if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
 	    pipe_works=yes
 	  fi
 	  LIBS=$lt_globsym_save_LIBS
@@ -3837,7 +3931,7 @@
   rm -rf conftest* conftst*
 
   # Do not use the global_symbol_pipe unless it works.
-  if test "$pipe_works" = yes; then
+  if test yes = "$pipe_works"; then
     break
   else
     lt_cv_sys_global_symbol_pipe=
@@ -3864,12 +3958,16 @@
     [Take the output of nm and produce a listing of raw symbols and C names])
 _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
     [Transform the output of nm in a proper C declaration])
+_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
+    [Transform the output of nm into a list of symbols to manually relocate])
 _LT_DECL([global_symbol_to_c_name_address],
     [lt_cv_sys_global_symbol_to_c_name_address], [1],
     [Transform the output of nm in a C name address pair])
 _LT_DECL([global_symbol_to_c_name_address_lib_prefix],
     [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
     [Transform the output of nm in a C name address pair when lib prefix is needed])
+_LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
+    [The name lister interface])
 _LT_DECL([], [nm_file_list_spec], [1],
     [Specify filename containing input files for $NM])
 ]) # _LT_CMD_GLOBAL_SYMBOLS
@@ -3885,17 +3983,18 @@
 
 m4_if([$1], [CXX], [
   # C++ specific cases for pic, static, wl, etc.
-  if test "$GXX" = yes; then
+  if test yes = "$GXX"; then
     _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
     _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
 
     case $host_os in
     aix*)
       # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
+      if test ia64 = "$host_cpu"; then
 	# AIX 5 now supports IA64 processor
 	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
       fi
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
       ;;
 
     amigaos*)
@@ -3906,8 +4005,8 @@
         ;;
       m68k)
             # FIXME: we need at least 68020 code to build shared libraries, but
-            # adding the `-m68020' flag to GCC prevents building anything better,
-            # like `-m68040'.
+            # adding the '-m68020' flag to GCC prevents building anything better,
+            # like '-m68040'.
             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
         ;;
       esac
@@ -3972,7 +4071,7 @@
     case $host_os in
       aix[[4-9]]*)
 	# All AIX code is PIC.
-	if test "$host_cpu" = ia64; then
+	if test ia64 = "$host_cpu"; then
 	  # AIX 5 now supports IA64 processor
 	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 	else
@@ -4013,14 +4112,14 @@
 	case $cc_basename in
 	  CC*)
 	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
-	    if test "$host_cpu" != ia64; then
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
+	    if test ia64 != "$host_cpu"; then
 	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
 	    fi
 	    ;;
 	  aCC*)
 	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
 	    case $host_cpu in
 	    hppa*64*|ia64*)
 	      # +Z the default
@@ -4049,7 +4148,7 @@
 	    ;;
 	esac
 	;;
-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
 	case $cc_basename in
 	  KCC*)
 	    # KAI C++ Compiler
@@ -4057,7 +4156,7 @@
 	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
 	    ;;
 	  ecpc* )
-	    # old Intel C++ for x86_64 which still supported -KPIC.
+	    # old Intel C++ for x86_64, which still supported -KPIC.
 	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
 	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
@@ -4202,17 +4301,18 @@
   fi
 ],
 [
-  if test "$GCC" = yes; then
+  if test yes = "$GCC"; then
     _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
     _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
 
     case $host_os in
       aix*)
       # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
+      if test ia64 = "$host_cpu"; then
 	# AIX 5 now supports IA64 processor
 	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
       fi
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
       ;;
 
     amigaos*)
@@ -4223,8 +4323,8 @@
         ;;
       m68k)
             # FIXME: we need at least 68020 code to build shared libraries, but
-            # adding the `-m68020' flag to GCC prevents building anything better,
-            # like `-m68040'.
+            # adding the '-m68020' flag to GCC prevents building anything better,
+            # like '-m68040'.
             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
         ;;
       esac
@@ -4311,7 +4411,7 @@
     case $host_os in
     aix*)
       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      if test "$host_cpu" = ia64; then
+      if test ia64 = "$host_cpu"; then
 	# AIX 5 now supports IA64 processor
 	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
       else
@@ -4319,6 +4419,20 @@
       fi
       ;;
 
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      case $cc_basename in
+      nagfor*)
+        # NAG Fortran compiler
+        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
+        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+        _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+        ;;
+      esac
+      ;;
+
     mingw* | cygwin* | pw32* | os2* | cegcc*)
       # This hack is so that the source file can tell whether it is being
       # built for inclusion in a dll (and should export symbols for example).
@@ -4339,7 +4453,7 @@
 	;;
       esac
       # Is there a better lt_prog_compiler_static that works with the bundled CC?
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
       ;;
 
     irix5* | irix6* | nonstopux*)
@@ -4348,9 +4462,9 @@
       _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
       ;;
 
-    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
       case $cc_basename in
-      # old Intel for x86_64 which still supported -KPIC.
+      # old Intel for x86_64, which still supported -KPIC.
       ecc*)
 	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
@@ -4375,6 +4489,12 @@
 	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
 	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 	;;
+      tcc*)
+	# Fabrice Bellard et al's Tiny C Compiler
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+	;;
       pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
         # Portland Group compilers (*not* the Pentium gcc compiler,
 	# which looks to be a dead project)
@@ -4472,7 +4592,7 @@
       ;;
 
     sysv4*MP*)
-      if test -d /usr/nec ;then
+      if test -d /usr/nec; then
 	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
 	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
       fi
@@ -4501,7 +4621,7 @@
   fi
 ])
 case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
+  # For platforms that do not support PIC, -DPIC is meaningless:
   *djgpp*)
     _LT_TAGVAR(lt_prog_compiler_pic, $1)=
     ;;
@@ -4577,7 +4697,7 @@
     fi
     ;;
   pw32*)
-    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+    _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
     ;;
   cygwin* | mingw* | cegcc*)
     case $cc_basename in
@@ -4623,9 +4743,9 @@
   # included in the symbol list
   _LT_TAGVAR(include_expsyms, $1)=
   # exclude_expsyms can be an extended regexp of symbols to exclude
-  # it will be wrapped by ` (' and `)$', so one must not match beginning or
-  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
-  # as well as any symbol that contains `d'.
+  # it will be wrapped by ' (' and ')$', so one must not match beginning or
+  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
+  # as well as any symbol that contains 'd'.
   _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
   # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
   # platforms (ab)use it in PIC code, but their linkers get confused if
@@ -4641,7 +4761,7 @@
     # FIXME: the MSVC++ port hasn't been tested in a loooong time
     # When not using gcc, we currently assume that we are using
     # Microsoft Visual C++.
-    if test "$GCC" != yes; then
+    if test yes != "$GCC"; then
       with_gnu_ld=no
     fi
     ;;
@@ -4649,7 +4769,7 @@
     # we just hope/assume this is gcc and not c89 (= MSVC++)
     with_gnu_ld=yes
     ;;
-  openbsd*)
+  openbsd* | bitrig*)
     with_gnu_ld=no
     ;;
   esac
@@ -4659,7 +4779,7 @@
   # On some targets, GNU ld is compatible enough with the native linker
   # that we're better off using the native interface for both.
   lt_use_gnu_ld_interface=no
-  if test "$with_gnu_ld" = yes; then
+  if test yes = "$with_gnu_ld"; then
     case $host_os in
       aix*)
 	# The AIX port of GNU ld has always aspired to compatibility
@@ -4681,24 +4801,24 @@
     esac
   fi
 
-  if test "$lt_use_gnu_ld_interface" = yes; then
+  if test yes = "$lt_use_gnu_ld_interface"; then
     # If archive_cmds runs LD, not CC, wlarc should be empty
-    wlarc='${wl}'
+    wlarc='$wl'
 
     # Set some defaults for GNU ld with shared library support. These
     # are reset later if shared libraries are not supported. Putting them
     # here allows them to be overridden if necessary.
     runpath_var=LD_RUN_PATH
-    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
     # ancient GNU ld didn't support --whole-archive et. al.
     if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
-      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
     else
       _LT_TAGVAR(whole_archive_flag_spec, $1)=
     fi
     supports_anon_versioning=no
-    case `$LD -v 2>&1` in
+    case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
       *GNU\ gold*) supports_anon_versioning=yes ;;
       *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
       *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
@@ -4711,7 +4831,7 @@
     case $host_os in
     aix[[3-9]]*)
       # On AIX/PPC, the GNU linker is very broken
-      if test "$host_cpu" != ia64; then
+      if test ia64 != "$host_cpu"; then
 	_LT_TAGVAR(ld_shlibs, $1)=no
 	cat <<_LT_EOF 1>&2
 
@@ -4730,7 +4850,7 @@
       case $host_cpu in
       powerpc)
             # see comment about AmigaOS4 .so support
-            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
             _LT_TAGVAR(archive_expsym_cmds, $1)=''
         ;;
       m68k)
@@ -4746,7 +4866,7 @@
 	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
 	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
 	# support --undefined.  This deserves some investigation.  FIXME
-	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
       else
 	_LT_TAGVAR(ld_shlibs, $1)=no
       fi
@@ -4756,7 +4876,7 @@
       # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
       # as there is no search path for DLLs.
       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
       _LT_TAGVAR(always_export_symbols, $1)=no
       _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
@@ -4764,61 +4884,61 @@
       _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
 
       if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-	# If the export-symbols file already is a .def file (1st line
-	# is EXPORTS), use it as is; otherwise, prepend...
-	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	  cp $export_symbols $output_objdir/$soname.def;
-	else
-	  echo EXPORTS > $output_objdir/$soname.def;
-	  cat $export_symbols >> $output_objdir/$soname.def;
-	fi~
-	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	# If the export-symbols file already is a .def file, use it as
+	# is; otherwise, prepend EXPORTS...
+	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+          cp $export_symbols $output_objdir/$soname.def;
+        else
+          echo EXPORTS > $output_objdir/$soname.def;
+          cat $export_symbols >> $output_objdir/$soname.def;
+        fi~
+        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
       else
 	_LT_TAGVAR(ld_shlibs, $1)=no
       fi
       ;;
 
     haiku*)
-      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
       _LT_TAGVAR(link_all_deplibs, $1)=yes
       ;;
 
     interix[[3-9]]*)
       _LT_TAGVAR(hardcode_direct, $1)=no
       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
       # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
       # Instead, shared libraries are loaded at an image base (0x10000000 by
       # default) and relocated if they conflict, which is a slow very memory
       # consuming and fragmenting process.  To avoid this, we pick a random,
       # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
       # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
       ;;
 
     gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
       tmp_diet=no
-      if test "$host_os" = linux-dietlibc; then
+      if test linux-dietlibc = "$host_os"; then
 	case $cc_basename in
 	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
 	esac
       fi
       if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
-	 && test "$tmp_diet" = no
+	 && test no = "$tmp_diet"
       then
 	tmp_addflag=' $pic_flag'
 	tmp_sharedflag='-shared'
 	case $cc_basename,$host_cpu in
         pgcc*)				# Portland Group C compiler
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	  tmp_addflag=' $pic_flag'
 	  ;;
 	pgf77* | pgf90* | pgf95* | pgfortran*)
 					# Portland Group f77 and f90 compilers
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	  tmp_addflag=' $pic_flag -Mnomain' ;;
 	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
 	  tmp_addflag=' -i_dynamic' ;;
@@ -4829,42 +4949,44 @@
 	lf95*)				# Lahey Fortran 8.1
 	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
 	  tmp_sharedflag='--shared' ;;
+        nagfor*)                        # NAGFOR 5.3
+          tmp_sharedflag='-Wl,-shared' ;;
 	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
 	  tmp_sharedflag='-qmkshrobj'
 	  tmp_addflag= ;;
 	nvcc*)	# Cuda Compiler Driver 2.2
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	  _LT_TAGVAR(compiler_needs_object, $1)=yes
 	  ;;
 	esac
 	case `$CC -V 2>&1 | sed 5q` in
 	*Sun\ C*)			# Sun C 5.9
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	  _LT_TAGVAR(compiler_needs_object, $1)=yes
 	  tmp_sharedflag='-G' ;;
 	*Sun\ F*)			# Sun Fortran 8.3
 	  tmp_sharedflag='-G' ;;
 	esac
-	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
 
-        if test "x$supports_anon_versioning" = xyes; then
+        if test yes = "$supports_anon_versioning"; then
           _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
-	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-	    echo "local: *; };" >> $output_objdir/$libname.ver~
-	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+            cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+            echo "local: *; };" >> $output_objdir/$libname.ver~
+            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
         fi
 
 	case $cc_basename in
 	xlf* | bgf* | bgxlf* | mpixlf*)
 	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
 	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
 	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
-	  if test "x$supports_anon_versioning" = xyes; then
+	  if test yes = "$supports_anon_versioning"; then
 	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
-	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-	      echo "local: *; };" >> $output_objdir/$libname.ver~
-	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+              cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+              echo "local: *; };" >> $output_objdir/$libname.ver~
+              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
 	  fi
 	  ;;
 	esac
@@ -4878,8 +5000,8 @@
 	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
 	wlarc=
       else
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
       fi
       ;;
 
@@ -4897,8 +5019,8 @@
 
 _LT_EOF
       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
       else
 	_LT_TAGVAR(ld_shlibs, $1)=no
       fi
@@ -4910,7 +5032,7 @@
 	_LT_TAGVAR(ld_shlibs, $1)=no
 	cat <<_LT_EOF 1>&2
 
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
 *** reliably create shared libraries on SCO systems.  Therefore, libtool
 *** is disabling shared libraries support.  We urge you to upgrade GNU
 *** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
@@ -4925,9 +5047,9 @@
 	  # DT_RUNPATH tag from executables and libraries.  But doing so
 	  # requires that you compile everything twice, which is a pain.
 	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
 	  else
 	    _LT_TAGVAR(ld_shlibs, $1)=no
 	  fi
@@ -4944,15 +5066,15 @@
 
     *)
       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
       else
 	_LT_TAGVAR(ld_shlibs, $1)=no
       fi
       ;;
     esac
 
-    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
+    if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then
       runpath_var=
       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
       _LT_TAGVAR(export_dynamic_flag_spec, $1)=
@@ -4968,7 +5090,7 @@
       # Note: this linker hardcodes the directories in LIBPATH if there
       # are no directories specified by -L.
       _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
 	# Neither direct hardcoding nor static linking is supported with a
 	# broken collect2.
 	_LT_TAGVAR(hardcode_direct, $1)=unsupported
@@ -4976,12 +5098,12 @@
       ;;
 
     aix[[4-9]]*)
-      if test "$host_cpu" = ia64; then
+      if test ia64 = "$host_cpu"; then
 	# On IA64, the linker does run time linking by default, so we don't
 	# have to do anything special.
 	aix_use_runtimelinking=no
 	exp_sym_flag='-Bexport'
-	no_entry_flag=""
+	no_entry_flag=
       else
 	# If we're using GNU nm, then we don't want the "-C" option.
 	# -C means demangle to AIX nm, but means don't demangle with GNU nm
@@ -4999,7 +5121,7 @@
 	# need to do runtime linking.
 	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
 	  for ld_flag in $LDFLAGS; do
-	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+	  if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
 	    aix_use_runtimelinking=yes
 	    break
 	  fi
@@ -5022,13 +5144,13 @@
       _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
       _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
       _LT_TAGVAR(link_all_deplibs, $1)=yes
-      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+      _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
 
-      if test "$GCC" = yes; then
+      if test yes = "$GCC"; then
 	case $host_os in aix4.[[012]]|aix4.[[012]].*)
 	# We only want to do this on AIX 4.2 and lower, the check
 	# below for broken collect2 doesn't work under 4.3+
-	  collect2name=`${CC} -print-prog-name=collect2`
+	  collect2name=`$CC -print-prog-name=collect2`
 	  if test -f "$collect2name" &&
 	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
 	  then
@@ -5047,61 +5169,61 @@
 	  ;;
 	esac
 	shared_flag='-shared'
-	if test "$aix_use_runtimelinking" = yes; then
-	  shared_flag="$shared_flag "'${wl}-G'
+	if test yes = "$aix_use_runtimelinking"; then
+	  shared_flag="$shared_flag "'$wl-G'
 	fi
       else
 	# not using gcc
-	if test "$host_cpu" = ia64; then
+	if test ia64 = "$host_cpu"; then
 	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
 	# chokes on -Wl,-G. The following line is correct:
 	  shared_flag='-G'
 	else
-	  if test "$aix_use_runtimelinking" = yes; then
-	    shared_flag='${wl}-G'
+	  if test yes = "$aix_use_runtimelinking"; then
+	    shared_flag='$wl-G'
 	  else
-	    shared_flag='${wl}-bM:SRE'
+	    shared_flag='$wl-bM:SRE'
 	  fi
 	fi
       fi
 
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
       # It seems that -bexpall does not export symbols beginning with
       # underscore (_), so it is better to generate a list of symbols to export.
       _LT_TAGVAR(always_export_symbols, $1)=yes
-      if test "$aix_use_runtimelinking" = yes; then
+      if test yes = "$aix_use_runtimelinking"; then
 	# Warning - without using the other runtime loading flags (-brtl),
 	# -berok will link without error, but may produce a broken library.
 	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
         # Determine the default libpath from the value encoded in an
         # empty executable.
         _LT_SYS_MODULE_PATH_AIX([$1])
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
+        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
       else
-	if test "$host_cpu" = ia64; then
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+	if test ia64 = "$host_cpu"; then
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
 	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
-	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
 	else
 	 # Determine the default libpath from the value encoded in an
 	 # empty executable.
 	 _LT_SYS_MODULE_PATH_AIX([$1])
-	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
 	  # Warning - without using the other run time loading flags,
 	  # -berok will link without error, but may produce a broken library.
-	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
-	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
-	  if test "$with_gnu_ld" = yes; then
+	  _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
+	  _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
+	  if test yes = "$with_gnu_ld"; then
 	    # We only use this code for GNU lds that support --whole-archive.
-	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
 	  else
 	    # Exported symbols can be pulled into shared objects from archives
 	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
 	  fi
 	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
 	  # This is similar to how AIX traditionally builds its shared libraries.
-	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $wl-bnoentry $compiler_flags $wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
 	fi
       fi
       ;;
@@ -5110,7 +5232,7 @@
       case $host_cpu in
       powerpc)
             # see comment about AmigaOS4 .so support
-            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
             _LT_TAGVAR(archive_expsym_cmds, $1)=''
         ;;
       m68k)
@@ -5140,16 +5262,17 @@
 	# Tell ltmain to make .lib files, not .a files.
 	libext=lib
 	# Tell ltmain to make .dll files, not .so files.
-	shrext_cmds=".dll"
+	shrext_cmds=.dll
 	# FIXME: Setting linknames here is a bad hack.
-	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
-	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
-	  else
-	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
-	  fi~
-	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
-	  linknames='
+	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+            cp "$export_symbols" "$output_objdir/$soname.def";
+            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
+          else
+            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+          fi~
+          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+          linknames='
 	# The linker will not automatically build a static lib if we build a DLL.
 	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
 	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
@@ -5158,18 +5281,18 @@
 	# Don't use ranlib
 	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
 	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
-	  lt_tool_outputfile="@TOOL_OUTPUT@"~
-	  case $lt_outputfile in
-	    *.exe|*.EXE) ;;
-	    *)
-	      lt_outputfile="$lt_outputfile.exe"
-	      lt_tool_outputfile="$lt_tool_outputfile.exe"
-	      ;;
-	  esac~
-	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
-	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
-	    $RM "$lt_outputfile.manifest";
-	  fi'
+          lt_tool_outputfile="@TOOL_OUTPUT@"~
+          case $lt_outputfile in
+            *.exe|*.EXE) ;;
+            *)
+              lt_outputfile=$lt_outputfile.exe
+              lt_tool_outputfile=$lt_tool_outputfile.exe
+              ;;
+          esac~
+          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
+            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+            $RM "$lt_outputfile.manifest";
+          fi'
 	;;
       *)
 	# Assume MSVC wrapper
@@ -5178,7 +5301,7 @@
 	# Tell ltmain to make .lib files, not .a files.
 	libext=lib
 	# Tell ltmain to make .dll files, not .so files.
-	shrext_cmds=".dll"
+	shrext_cmds=.dll
 	# FIXME: Setting linknames here is a bad hack.
 	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
 	# The linker will automatically build a .lib file if we build a DLL.
@@ -5228,33 +5351,33 @@
       ;;
 
     hpux9*)
-      if test "$GCC" = yes; then
-	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      if test yes = "$GCC"; then
+	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
       else
-	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
       fi
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
       _LT_TAGVAR(hardcode_direct, $1)=yes
 
       # hardcode_minus_L: Not really in the search PATH,
       # but as the default location of the library.
       _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
       ;;
 
     hpux10*)
-      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      if test yes,no = "$GCC,$with_gnu_ld"; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
       else
 	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
       fi
-      if test "$with_gnu_ld" = no; then
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+      if test no = "$with_gnu_ld"; then
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
 	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
 	_LT_TAGVAR(hardcode_direct, $1)=yes
 	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
 	# hardcode_minus_L: Not really in the search PATH,
 	# but as the default location of the library.
 	_LT_TAGVAR(hardcode_minus_L, $1)=yes
@@ -5262,25 +5385,25 @@
       ;;
 
     hpux11*)
-      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+      if test yes,no = "$GCC,$with_gnu_ld"; then
 	case $host_cpu in
 	hppa*64*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	ia64*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	esac
       else
 	case $host_cpu in
 	hppa*64*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	ia64*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
 	m4_if($1, [], [
@@ -5288,14 +5411,14 @@
 	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
 	  _LT_LINKER_OPTION([if $CC understands -b],
 	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
-	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
+	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
 	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
-	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
+	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
 	  ;;
 	esac
       fi
-      if test "$with_gnu_ld" = no; then
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+      if test no = "$with_gnu_ld"; then
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
 	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
 
 	case $host_cpu in
@@ -5306,7 +5429,7 @@
 	*)
 	  _LT_TAGVAR(hardcode_direct, $1)=yes
 	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
 
 	  # hardcode_minus_L: Not really in the search PATH,
 	  # but as the default location of the library.
@@ -5317,16 +5440,16 @@
       ;;
 
     irix5* | irix6* | nonstopux*)
-      if test "$GCC" = yes; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      if test yes = "$GCC"; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
 	# Try to use the -exported_symbol ld option, if it does not
 	# work, assume that -exports_file does not work either and
 	# implicitly export all symbols.
 	# This should be the same for all languages, so no per-tag cache variable.
 	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
 	  [lt_cv_irix_exported_symbol],
-	  [save_LDFLAGS="$LDFLAGS"
-	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+	  [save_LDFLAGS=$LDFLAGS
+	   LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
 	   AC_LINK_IFELSE(
 	     [AC_LANG_SOURCE(
 	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
@@ -5339,16 +5462,16 @@
       end]])])],
 	      [lt_cv_irix_exported_symbol=yes],
 	      [lt_cv_irix_exported_symbol=no])
-           LDFLAGS="$save_LDFLAGS"])
-	if test "$lt_cv_irix_exported_symbol" = yes; then
-          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+           LDFLAGS=$save_LDFLAGS])
+	if test yes = "$lt_cv_irix_exported_symbol"; then
+          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
 	fi
       else
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
       fi
       _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
       _LT_TAGVAR(inherit_rpath, $1)=yes
       _LT_TAGVAR(link_all_deplibs, $1)=yes
@@ -5368,7 +5491,7 @@
     newsos6)
       _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
       _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
       ;;
@@ -5376,27 +5499,19 @@
     *nto* | *qnx*)
       ;;
 
-    openbsd*)
+    openbsd* | bitrig*)
       if test -f /usr/libexec/ld.so; then
 	_LT_TAGVAR(hardcode_direct, $1)=yes
 	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
 	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
 	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
 	else
-	  case $host_os in
-	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
-	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-	     ;;
-	   *)
-	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	     ;;
-	  esac
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
 	fi
       else
 	_LT_TAGVAR(ld_shlibs, $1)=no
@@ -5412,28 +5527,28 @@
       ;;
 
     osf3*)
-      if test "$GCC" = yes; then
-	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      if test yes = "$GCC"; then
+	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
       else
 	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
       fi
       _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
       ;;
 
     osf4* | osf5*)	# as osf3* with the addition of -msym flag
-      if test "$GCC" = yes; then
-	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      if test yes = "$GCC"; then
+	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
       else
 	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
 	_LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
-	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+          $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
 
 	# Both c and cxx compiler support -rpath directly
 	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
@@ -5444,24 +5559,24 @@
 
     solaris*)
       _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
-      if test "$GCC" = yes; then
-	wlarc='${wl}'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      if test yes = "$GCC"; then
+	wlarc='$wl'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
 	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+          $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
       else
 	case `$CC -V 2>&1` in
 	*"Compilers 5.0"*)
 	  wlarc=''
-	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
 	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
 	  ;;
 	*)
-	  wlarc='${wl}'
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+	  wlarc='$wl'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
 	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
 	  ;;
 	esac
       fi
@@ -5471,11 +5586,11 @@
       solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
       *)
 	# The compiler driver will combine and reorder linker options,
-	# but understands `-z linker_flag'.  GCC discards it without `$wl',
+	# but understands '-z linker_flag'.  GCC discards it without '$wl',
 	# but is careful enough not to reorder.
 	# Supported since Solaris 2.6 (maybe 2.5.1?)
-	if test "$GCC" = yes; then
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+	if test yes = "$GCC"; then
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
 	else
 	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
 	fi
@@ -5485,10 +5600,10 @@
       ;;
 
     sunos4*)
-      if test "x$host_vendor" = xsequent; then
+      if test sequent = "$host_vendor"; then
 	# Use $CC to link under sequent, because it throws in some extra .o
 	# files that make .init and .fini sections work.
-	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
       else
 	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
       fi
@@ -5537,43 +5652,43 @@
       ;;
 
     sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
-      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
       _LT_TAGVAR(archive_cmds_need_lc, $1)=no
       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
       runpath_var='LD_RUN_PATH'
 
-      if test "$GCC" = yes; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      if test yes = "$GCC"; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       else
-	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       fi
       ;;
 
     sysv5* | sco3.2v5* | sco5v6*)
-      # Note: We can NOT use -z defs as we might desire, because we do not
+      # Note: We CANNOT use -z defs as we might desire, because we do not
       # link with -lc, and that would cause any symbols used from libc to
       # always be unresolved, which means just about no library would
       # ever link correctly.  If we're not using GNU ld we use -z text
       # though, which does catch some bad symbols but isn't as heavy-handed
       # as -z defs.
-      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
-      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
+      _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
       _LT_TAGVAR(archive_cmds_need_lc, $1)=no
       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
       _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
       _LT_TAGVAR(link_all_deplibs, $1)=yes
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
       runpath_var='LD_RUN_PATH'
 
-      if test "$GCC" = yes; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      if test yes = "$GCC"; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       else
-	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       fi
       ;;
 
@@ -5588,17 +5703,17 @@
       ;;
     esac
 
-    if test x$host_vendor = xsni; then
+    if test sni = "$host_vendor"; then
       case $host in
       sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'
 	;;
       esac
     fi
   fi
 ])
 AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
-test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
 
 _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
 
@@ -5615,7 +5730,7 @@
   # Assume -lc should be added
   _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
 
-  if test "$enable_shared" = yes && test "$GCC" = yes; then
+  if test yes,yes = "$GCC,$enable_shared"; then
     case $_LT_TAGVAR(archive_cmds, $1) in
     *'~'*)
       # FIXME: we may have to deal with multi-command sequences.
@@ -5695,12 +5810,12 @@
 _LT_TAGDECL([], [hardcode_libdir_separator], [1],
     [Whether we need a single "-rpath" flag with a separated argument])
 _LT_TAGDECL([], [hardcode_direct], [0],
-    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
     DIR into the resulting binary])
 _LT_TAGDECL([], [hardcode_direct_absolute], [0],
-    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
     DIR into the resulting binary and the resulting library dependency is
-    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
+    "absolute", i.e impossible to change by setting $shlibpath_var if the
     library is relocated])
 _LT_TAGDECL([], [hardcode_minus_L], [0],
     [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
@@ -5741,10 +5856,10 @@
 # ------------------------
 # Ensure that the configuration variables for a C compiler are suitably
 # defined.  These variables are subsequently used by _LT_CONFIG to write
-# the compiler configuration to `libtool'.
+# the compiler configuration to 'libtool'.
 m4_defun([_LT_LANG_C_CONFIG],
 [m4_require([_LT_DECL_EGREP])dnl
-lt_save_CC="$CC"
+lt_save_CC=$CC
 AC_LANG_PUSH(C)
 
 # Source file extension for C test sources.
@@ -5784,18 +5899,18 @@
   LT_SYS_DLOPEN_SELF
   _LT_CMD_STRIPLIB
 
-  # Report which library types will actually be built
+  # Report what library types will actually be built
   AC_MSG_CHECKING([if libtool supports shared libraries])
   AC_MSG_RESULT([$can_build_shared])
 
   AC_MSG_CHECKING([whether to build shared libraries])
-  test "$can_build_shared" = "no" && enable_shared=no
+  test no = "$can_build_shared" && enable_shared=no
 
   # On AIX, shared libraries and static libraries use the same namespace, and
   # are all built from PIC.
   case $host_os in
   aix3*)
-    test "$enable_shared" = yes && enable_static=no
+    test yes = "$enable_shared" && enable_static=no
     if test -n "$RANLIB"; then
       archive_cmds="$archive_cmds~\$RANLIB \$lib"
       postinstall_cmds='$RANLIB $lib'
@@ -5803,8 +5918,8 @@
     ;;
 
   aix[[4-9]]*)
-    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-      test "$enable_shared" = yes && enable_static=no
+    if test ia64 != "$host_cpu" && test no = "$aix_use_runtimelinking"; then
+      test yes = "$enable_shared" && enable_static=no
     fi
     ;;
   esac
@@ -5812,13 +5927,13 @@
 
   AC_MSG_CHECKING([whether to build static libraries])
   # Make sure either enable_shared or enable_static is yes.
-  test "$enable_shared" = yes || enable_static=yes
+  test yes = "$enable_shared" || enable_static=yes
   AC_MSG_RESULT([$enable_static])
 
   _LT_CONFIG($1)
 fi
 AC_LANG_POP
-CC="$lt_save_CC"
+CC=$lt_save_CC
 ])# _LT_LANG_C_CONFIG
 
 
@@ -5826,14 +5941,14 @@
 # --------------------------
 # Ensure that the configuration variables for a C++ compiler are suitably
 # defined.  These variables are subsequently used by _LT_CONFIG to write
-# the compiler configuration to `libtool'.
+# the compiler configuration to 'libtool'.
 m4_defun([_LT_LANG_CXX_CONFIG],
 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
 m4_require([_LT_DECL_EGREP])dnl
 m4_require([_LT_PATH_MANIFEST_TOOL])dnl
-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
-    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
-    (test "X$CXX" != "Xg++"))) ; then
+if test -n "$CXX" && ( test no != "$CXX" &&
+    ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
+    (test g++ != "$CXX"))); then
   AC_PROG_CXXCPP
 else
   _lt_caught_CXX_error=yes
@@ -5875,7 +5990,7 @@
 # the CXX compiler isn't working.  Some variables (like enable_shared)
 # are currently assumed to apply to all compilers on this platform,
 # and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_caught_CXX_error" != yes; then
+if test yes != "$_lt_caught_CXX_error"; then
   # Code to be used in simple compile tests
   lt_simple_compile_test_code="int some_variable = 0;"
 
@@ -5917,35 +6032,35 @@
   if test -n "$compiler"; then
     # We don't want -fno-exception when compiling C++ code, so set the
     # no_builtin_flag separately
-    if test "$GXX" = yes; then
+    if test yes = "$GXX"; then
       _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
     else
       _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
     fi
 
-    if test "$GXX" = yes; then
+    if test yes = "$GXX"; then
       # Set up default GNU C++ configuration
 
       LT_PATH_LD
 
       # Check if GNU C++ uses GNU ld as the underlying linker, since the
       # archiving commands below assume that GNU ld is being used.
-      if test "$with_gnu_ld" = yes; then
-        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      if test yes = "$with_gnu_ld"; then
+        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
 
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
 
         # If archive_cmds runs LD, not CC, wlarc should be empty
         # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
         #     investigate it a little bit more. (MM)
-        wlarc='${wl}'
+        wlarc='$wl'
 
         # ancient GNU ld didn't support --whole-archive et. al.
         if eval "`$CC -print-prog-name=ld` --help 2>&1" |
 	  $GREP 'no-whole-archive' > /dev/null; then
-          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+          _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
         else
           _LT_TAGVAR(whole_archive_flag_spec, $1)=
         fi
@@ -5981,12 +6096,12 @@
         _LT_TAGVAR(ld_shlibs, $1)=no
         ;;
       aix[[4-9]]*)
-        if test "$host_cpu" = ia64; then
+        if test ia64 = "$host_cpu"; then
           # On IA64, the linker does run time linking by default, so we don't
           # have to do anything special.
           aix_use_runtimelinking=no
           exp_sym_flag='-Bexport'
-          no_entry_flag=""
+          no_entry_flag=
         else
           aix_use_runtimelinking=no
 
@@ -6020,13 +6135,13 @@
         _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
         _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
         _LT_TAGVAR(link_all_deplibs, $1)=yes
-        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+        _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
 
-        if test "$GXX" = yes; then
+        if test yes = "$GXX"; then
           case $host_os in aix4.[[012]]|aix4.[[012]].*)
           # We only want to do this on AIX 4.2 and lower, the check
           # below for broken collect2 doesn't work under 4.3+
-	  collect2name=`${CC} -print-prog-name=collect2`
+	  collect2name=`$CC -print-prog-name=collect2`
 	  if test -f "$collect2name" &&
 	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
 	  then
@@ -6044,56 +6159,56 @@
 	  fi
           esac
           shared_flag='-shared'
-	  if test "$aix_use_runtimelinking" = yes; then
-	    shared_flag="$shared_flag "'${wl}-G'
+	  if test yes = "$aix_use_runtimelinking"; then
+	    shared_flag=$shared_flag' $wl-G'
 	  fi
         else
           # not using gcc
-          if test "$host_cpu" = ia64; then
+          if test ia64 = "$host_cpu"; then
 	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
 	  # chokes on -Wl,-G. The following line is correct:
 	  shared_flag='-G'
           else
-	    if test "$aix_use_runtimelinking" = yes; then
-	      shared_flag='${wl}-G'
+	    if test yes = "$aix_use_runtimelinking"; then
+	      shared_flag='$wl-G'
 	    else
-	      shared_flag='${wl}-bM:SRE'
+	      shared_flag='$wl-bM:SRE'
 	    fi
           fi
         fi
 
-        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
         # It seems that -bexpall does not export symbols beginning with
         # underscore (_), so it is better to generate a list of symbols to
 	# export.
         _LT_TAGVAR(always_export_symbols, $1)=yes
-        if test "$aix_use_runtimelinking" = yes; then
+        if test yes = "$aix_use_runtimelinking"; then
           # Warning - without using the other runtime loading flags (-brtl),
           # -berok will link without error, but may produce a broken library.
           _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
           # Determine the default libpath from the value encoded in an empty
           # executable.
           _LT_SYS_MODULE_PATH_AIX([$1])
-          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
 
-          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
         else
-          if test "$host_cpu" = ia64; then
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+          if test ia64 = "$host_cpu"; then
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
 	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
-	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
           else
 	    # Determine the default libpath from the value encoded in an
 	    # empty executable.
 	    _LT_SYS_MODULE_PATH_AIX([$1])
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
 	    # Warning - without using the other run time loading flags,
 	    # -berok will link without error, but may produce a broken library.
-	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
-	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
-	    if test "$with_gnu_ld" = yes; then
+	    _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
+	    _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
+	    if test yes = "$with_gnu_ld"; then
 	      # We only use this code for GNU lds that support --whole-archive.
-	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
 	    else
 	      # Exported symbols can be pulled into shared objects from archives
 	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
@@ -6101,7 +6216,7 @@
 	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
 	    # This is similar to how AIX traditionally builds its shared
 	    # libraries.
-	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $wl-bnoentry $compiler_flags $wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
           fi
         fi
         ;;
@@ -6111,7 +6226,7 @@
 	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
 	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
 	  # support --undefined.  This deserves some investigation.  FIXME
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
 	else
 	  _LT_TAGVAR(ld_shlibs, $1)=no
 	fi
@@ -6139,57 +6254,58 @@
 	  # Tell ltmain to make .lib files, not .a files.
 	  libext=lib
 	  # Tell ltmain to make .dll files, not .so files.
-	  shrext_cmds=".dll"
+	  shrext_cmds=.dll
 	  # FIXME: Setting linknames here is a bad hack.
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
-	    else
-	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
-	    fi~
-	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
-	    linknames='
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+              cp "$export_symbols" "$output_objdir/$soname.def";
+              echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
+            else
+              $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+            fi~
+            $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+            linknames='
 	  # The linker will not automatically build a static lib if we build a DLL.
 	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
 	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
 	  # Don't use ranlib
 	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
 	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
-	    lt_tool_outputfile="@TOOL_OUTPUT@"~
-	    case $lt_outputfile in
-	      *.exe|*.EXE) ;;
-	      *)
-		lt_outputfile="$lt_outputfile.exe"
-		lt_tool_outputfile="$lt_tool_outputfile.exe"
-		;;
-	    esac~
-	    func_to_tool_file "$lt_outputfile"~
-	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
-	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
-	      $RM "$lt_outputfile.manifest";
-	    fi'
+            lt_tool_outputfile="@TOOL_OUTPUT@"~
+            case $lt_outputfile in
+              *.exe|*.EXE) ;;
+              *)
+                lt_outputfile=$lt_outputfile.exe
+                lt_tool_outputfile=$lt_tool_outputfile.exe
+                ;;
+            esac~
+            func_to_tool_file "$lt_outputfile"~
+            if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
+              $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+              $RM "$lt_outputfile.manifest";
+            fi'
 	  ;;
 	*)
 	  # g++
 	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
 	  # as there is no search path for DLLs.
 	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
 	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
 	  _LT_TAGVAR(always_export_symbols, $1)=no
 	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
 
 	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-	    # If the export-symbols file already is a .def file (1st line
-	    # is EXPORTS), use it as is; otherwise, prepend...
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	      cp $export_symbols $output_objdir/$soname.def;
-	    else
-	      echo EXPORTS > $output_objdir/$soname.def;
-	      cat $export_symbols >> $output_objdir/$soname.def;
-	    fi~
-	    $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	    # If the export-symbols file already is a .def file, use it as
+	    # is; otherwise, prepend EXPORTS...
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+              cp $export_symbols $output_objdir/$soname.def;
+            else
+              echo EXPORTS > $output_objdir/$soname.def;
+              cat $export_symbols >> $output_objdir/$soname.def;
+            fi~
+            $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
 	  else
 	    _LT_TAGVAR(ld_shlibs, $1)=no
 	  fi
@@ -6234,18 +6350,15 @@
         _LT_TAGVAR(ld_shlibs, $1)=yes
         ;;
 
-      gnu*)
-        ;;
-
       haiku*)
-        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
         _LT_TAGVAR(link_all_deplibs, $1)=yes
         ;;
 
       hpux9*)
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
         _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
         _LT_TAGVAR(hardcode_direct, $1)=yes
         _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
 				             # but as the default
@@ -6257,7 +6370,7 @@
             _LT_TAGVAR(ld_shlibs, $1)=no
             ;;
           aCC*)
-            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
             # Commands to make compiler produce verbose output that lists
             # what "hidden" libraries, object files and flags are used when
             # linking a shared library.
@@ -6266,11 +6379,11 @@
             # explicitly linking system object files so we need to strip them
             # from the output so that they don't get included in the library
             # dependencies.
-            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
             ;;
           *)
-            if test "$GXX" = yes; then
-              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            if test yes = "$GXX"; then
+              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
             else
               # FIXME: insert proper C++ library support
               _LT_TAGVAR(ld_shlibs, $1)=no
@@ -6280,15 +6393,15 @@
         ;;
 
       hpux10*|hpux11*)
-        if test $with_gnu_ld = no; then
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+        if test no = "$with_gnu_ld"; then
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
 	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
 
           case $host_cpu in
             hppa*64*|ia64*)
               ;;
             *)
-	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
               ;;
           esac
         fi
@@ -6314,13 +6427,13 @@
           aCC*)
 	    case $host_cpu in
 	      hppa*64*)
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	        ;;
 	      ia64*)
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	        ;;
 	      *)
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	        ;;
 	    esac
 	    # Commands to make compiler produce verbose output that lists
@@ -6331,20 +6444,20 @@
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
 	    ;;
           *)
-	    if test "$GXX" = yes; then
-	      if test $with_gnu_ld = no; then
+	    if test yes = "$GXX"; then
+	      if test no = "$with_gnu_ld"; then
 	        case $host_cpu in
 	          hppa*64*)
-	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	            ;;
 	          ia64*)
-	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	            ;;
 	          *)
-	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	            ;;
 	        esac
 	      fi
@@ -6359,22 +6472,22 @@
       interix[[3-9]]*)
 	_LT_TAGVAR(hardcode_direct, $1)=no
 	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
 	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
 	# Instead, shared libraries are loaded at an image base (0x10000000 by
 	# default) and relocated if they conflict, which is a slow very memory
 	# consuming and fragmenting process.  To avoid this, we pick a random,
 	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
 	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
 	;;
       irix5* | irix6*)
         case $cc_basename in
           CC*)
 	    # SGI C++
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
 
 	    # Archives containing C++ object files must be created using
 	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
@@ -6383,22 +6496,22 @@
 	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
 	    ;;
           *)
-	    if test "$GXX" = yes; then
-	      if test "$with_gnu_ld" = no; then
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	    if test yes = "$GXX"; then
+	      if test no = "$with_gnu_ld"; then
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
 	      else
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib'
 	      fi
 	    fi
 	    _LT_TAGVAR(link_all_deplibs, $1)=yes
 	    ;;
         esac
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
         _LT_TAGVAR(hardcode_libdir_separator, $1)=:
         _LT_TAGVAR(inherit_rpath, $1)=yes
         ;;
 
-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
         case $cc_basename in
           KCC*)
 	    # Kuck and Associates, Inc. (KAI) C++ Compiler
@@ -6406,8 +6519,8 @@
 	    # KCC will only create a shared library if the output file
 	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
 	    # to its proper name (with version) after linking.
-	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib'
 	    # Commands to make compiler produce verbose output that lists
 	    # what "hidden" libraries, object files and flags are used when
 	    # linking a shared library.
@@ -6416,10 +6529,10 @@
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
 
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
 
 	    # Archives containing C++ object files must be created using
 	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
@@ -6433,59 +6546,59 @@
 	    # earlier do not add the objects themselves.
 	    case `$CC -V 2>&1` in
 	      *"Version 7."*)
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
 		;;
 	      *)  # Version 8.0 or newer
 	        tmp_idyn=
 	        case $host_cpu in
 		  ia64*) tmp_idyn=' -i_dynamic';;
 		esac
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
 		;;
 	    esac
 	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
 	    ;;
           pgCC* | pgcpp*)
             # Portland Group C++ compiler
 	    case `$CC -V` in
 	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
 	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
-		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+               rm -rf $tpldir~
+               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
 	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
-		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
-		$RANLIB $oldlib'
+                rm -rf $tpldir~
+                $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+                $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+                $RANLIB $oldlib'
 	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+                rm -rf $tpldir~
+                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
 	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+                rm -rf $tpldir~
+                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
 	      ;;
 	    *) # Version 6 and above use weak symbols
-	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
-	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
 	      ;;
 	    esac
 
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
             ;;
 	  cxx*)
 	    # Compaq C++
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname  -o $lib $wl-retain-symbols-file $wl$export_symbols'
 
 	    runpath_var=LD_RUN_PATH
 	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
@@ -6499,18 +6612,18 @@
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
 	    ;;
 	  xl* | mpixl* | bgxl*)
 	    # IBM XL 8.0 on PPC, with GNU ld
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	    if test "x$supports_anon_versioning" = xyes; then
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	    if test yes = "$supports_anon_versioning"; then
 	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
-		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-		echo "local: *; };" >> $output_objdir/$libname.ver~
-		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+                cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+                echo "local: *; };" >> $output_objdir/$libname.ver~
+                $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
 	    fi
 	    ;;
 	  *)
@@ -6518,10 +6631,10 @@
 	    *Sun\ C*)
 	      # Sun C++ 5.9
 	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
-	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+	      _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols'
 	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	      _LT_TAGVAR(compiler_needs_object, $1)=yes
 
 	      # Not sure whether something based on
@@ -6579,22 +6692,17 @@
         _LT_TAGVAR(ld_shlibs, $1)=yes
 	;;
 
-      openbsd2*)
-        # C++ shared libraries are fairly broken
-	_LT_TAGVAR(ld_shlibs, $1)=no
-	;;
-
-      openbsd*)
+      openbsd* | bitrig*)
 	if test -f /usr/libexec/ld.so; then
 	  _LT_TAGVAR(hardcode_direct, $1)=yes
 	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
 	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
 	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
 	  fi
 	  output_verbose_link_cmd=func_echo_all
 	else
@@ -6610,9 +6718,9 @@
 	    # KCC will only create a shared library if the output file
 	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
 	    # to its proper name (with version) after linking.
-	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
 
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
 	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
 
 	    # Archives containing C++ object files must be created using
@@ -6630,17 +6738,17 @@
           cxx*)
 	    case $host in
 	      osf3*)
-	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	        _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
 		;;
 	      *)
 	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
 	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
-	          echo "-hidden">> $lib.exp~
-	          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
-	          $RM $lib.exp'
+                  echo "-hidden">> $lib.exp~
+                  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~
+                  $RM $lib.exp'
 	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
 		;;
 	    esac
@@ -6655,21 +6763,21 @@
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
 	    ;;
 	  *)
-	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	    if test yes,no = "$GXX,$with_gnu_ld"; then
+	      _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
 	      case $host in
 	        osf3*)
-	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
 		  ;;
 	        *)
-	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
 		  ;;
 	      esac
 
-	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
 	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
 
 	      # Commands to make compiler produce verbose output that lists
@@ -6715,9 +6823,9 @@
 	    # Sun C++ 4.2, 5.x and Centerline C++
             _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
 	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	      $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+              $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
 
 	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
 	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
@@ -6725,7 +6833,7 @@
 	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
 	      *)
 		# The compiler driver will combine and reorder linker options,
-		# but understands `-z linker_flag'.
+		# but understands '-z linker_flag'.
 	        # Supported since Solaris 2.6 (maybe 2.5.1?)
 		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
 	        ;;
@@ -6742,30 +6850,30 @@
 	    ;;
           gcx*)
 	    # Green Hills C++ Compiler
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
 
 	    # The C++ compiler must be used to create the archive.
 	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
 	    ;;
           *)
 	    # GNU C++ compiler with Solaris linker
-	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+	    if test yes,no = "$GXX,$with_gnu_ld"; then
+	      _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'
 	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
 	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+                  $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
 
 	        # Commands to make compiler produce verbose output that lists
 	        # what "hidden" libraries, object files and flags are used when
 	        # linking a shared library.
 	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
 	      else
-	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
+	        # g++ 2.7 appears to require '-G' NOT '-shared' on this
 	        # platform.
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
 	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+                  $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
 
 	        # Commands to make compiler produce verbose output that lists
 	        # what "hidden" libraries, object files and flags are used when
@@ -6773,11 +6881,11 @@
 	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
 	      fi
 
-	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
 	      case $host_os in
 		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
 		*)
-		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+		  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
 		  ;;
 	      esac
 	    fi
@@ -6786,52 +6894,52 @@
         ;;
 
     sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
-      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
       _LT_TAGVAR(archive_cmds_need_lc, $1)=no
       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
       runpath_var='LD_RUN_PATH'
 
       case $cc_basename in
         CC*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
       esac
       ;;
 
       sysv5* | sco3.2v5* | sco5v6*)
-	# Note: We can NOT use -z defs as we might desire, because we do not
+	# Note: We CANNOT use -z defs as we might desire, because we do not
 	# link with -lc, and that would cause any symbols used from libc to
 	# always be unresolved, which means just about no library would
 	# ever link correctly.  If we're not using GNU ld we use -z text
 	# though, which does catch some bad symbols but isn't as heavy-handed
 	# as -z defs.
-	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
-	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+	_LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
+	_LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
 	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
 	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
 	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
 	_LT_TAGVAR(link_all_deplibs, $1)=yes
-	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
 	runpath_var='LD_RUN_PATH'
 
 	case $cc_basename in
           CC*)
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
 	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
-	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
+              '"$_LT_TAGVAR(old_archive_cmds, $1)"
 	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
-	      '"$_LT_TAGVAR(reload_cmds, $1)"
+              '"$_LT_TAGVAR(reload_cmds, $1)"
 	    ;;
 	  *)
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
 	    ;;
 	esac
       ;;
@@ -6862,10 +6970,10 @@
     esac
 
     AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
-    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+    test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
 
-    _LT_TAGVAR(GCC, $1)="$GXX"
-    _LT_TAGVAR(LD, $1)="$LD"
+    _LT_TAGVAR(GCC, $1)=$GXX
+    _LT_TAGVAR(LD, $1)=$LD
 
     ## CAVEAT EMPTOR:
     ## There is no encapsulation within the following macros, do not change
@@ -6892,7 +7000,7 @@
   lt_cv_path_LD=$lt_save_path_LD
   lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
   lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-fi # test "$_lt_caught_CXX_error" != yes
+fi # test yes != "$_lt_caught_CXX_error"
 
 AC_LANG_POP
 ])# _LT_LANG_CXX_CONFIG
@@ -6914,9 +7022,9 @@
 AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
 func_stripname_cnf ()
 {
-  case ${2} in
-  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
-  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+  case @S|@2 in
+  .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
+  *)  func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
   esac
 } # func_stripname_cnf
 ])# _LT_FUNC_STRIPNAME_CNF
@@ -7004,13 +7112,13 @@
   pre_test_object_deps_done=no
 
   for p in `eval "$output_verbose_link_cmd"`; do
-    case ${prev}${p} in
+    case $prev$p in
 
     -L* | -R* | -l*)
        # Some compilers place space between "-{L,R}" and the path.
        # Remove the space.
-       if test $p = "-L" ||
-          test $p = "-R"; then
+       if test x-L = "$p" ||
+          test x-R = "$p"; then
 	 prev=$p
 	 continue
        fi
@@ -7026,16 +7134,16 @@
        case $p in
        =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
        esac
-       if test "$pre_test_object_deps_done" = no; then
-	 case ${prev} in
+       if test no = "$pre_test_object_deps_done"; then
+	 case $prev in
 	 -L | -R)
 	   # Internal compiler library paths should come after those
 	   # provided the user.  The postdeps already come after the
 	   # user supplied libs so there is no need to process them.
 	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
-	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+	     _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p
 	   else
-	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p"
 	   fi
 	   ;;
 	 # The "-l" case would never come before the object being
@@ -7043,9 +7151,9 @@
 	 esac
        else
 	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
-	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
+	   _LT_TAGVAR(postdeps, $1)=$prev$p
 	 else
-	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
+	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
 	 fi
        fi
        prev=
@@ -7060,15 +7168,15 @@
 	 continue
        fi
 
-       if test "$pre_test_object_deps_done" = no; then
+       if test no = "$pre_test_object_deps_done"; then
 	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
-	   _LT_TAGVAR(predep_objects, $1)="$p"
+	   _LT_TAGVAR(predep_objects, $1)=$p
 	 else
 	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
 	 fi
        else
 	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
-	   _LT_TAGVAR(postdep_objects, $1)="$p"
+	   _LT_TAGVAR(postdep_objects, $1)=$p
 	 else
 	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
 	 fi
@@ -7115,7 +7223,7 @@
       ;;
     esac
 
-    if test "$solaris_use_stlport4" != yes; then
+    if test yes != "$solaris_use_stlport4"; then
       _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
     fi
     ;;
@@ -7138,7 +7246,7 @@
     # Adding this requires a known-good setup of shared libraries for
     # Sun compiler versions before 5.6, else PIC objects from an old
     # archive will be linked into the output, leading to subtle bugs.
-    if test "$solaris_use_stlport4" != yes; then
+    if test yes != "$solaris_use_stlport4"; then
       _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
     fi
     ;;
@@ -7152,7 +7260,7 @@
 esac
  _LT_TAGVAR(compiler_lib_search_dirs, $1)=
 if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
- _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'`
 fi
 _LT_TAGDECL([], [compiler_lib_search_dirs], [1],
     [The directories searched by this compiler when creating a shared library])
@@ -7172,10 +7280,10 @@
 # --------------------------
 # Ensure that the configuration variables for a Fortran 77 compiler are
 # suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
+# to write the compiler configuration to 'libtool'.
 m4_defun([_LT_LANG_F77_CONFIG],
 [AC_LANG_PUSH(Fortran 77)
-if test -z "$F77" || test "X$F77" = "Xno"; then
+if test -z "$F77" || test no = "$F77"; then
   _lt_disable_F77=yes
 fi
 
@@ -7212,7 +7320,7 @@
 # the F77 compiler isn't working.  Some variables (like enable_shared)
 # are currently assumed to apply to all compilers on this platform,
 # and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_disable_F77" != yes; then
+if test yes != "$_lt_disable_F77"; then
   # Code to be used in simple compile tests
   lt_simple_compile_test_code="\
       subroutine t
@@ -7234,7 +7342,7 @@
   _LT_LINKER_BOILERPLATE
 
   # Allow CC to be a program name with arguments.
-  lt_save_CC="$CC"
+  lt_save_CC=$CC
   lt_save_GCC=$GCC
   lt_save_CFLAGS=$CFLAGS
   CC=${F77-"f77"}
@@ -7248,21 +7356,21 @@
     AC_MSG_RESULT([$can_build_shared])
 
     AC_MSG_CHECKING([whether to build shared libraries])
-    test "$can_build_shared" = "no" && enable_shared=no
+    test no = "$can_build_shared" && enable_shared=no
 
     # On AIX, shared libraries and static libraries use the same namespace, and
     # are all built from PIC.
     case $host_os in
       aix3*)
-        test "$enable_shared" = yes && enable_static=no
+        test yes = "$enable_shared" && enable_static=no
         if test -n "$RANLIB"; then
           archive_cmds="$archive_cmds~\$RANLIB \$lib"
           postinstall_cmds='$RANLIB $lib'
         fi
         ;;
       aix[[4-9]]*)
-	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-	  test "$enable_shared" = yes && enable_static=no
+	if test ia64 != "$host_cpu" && test no = "$aix_use_runtimelinking"; then
+	  test yes = "$enable_shared" && enable_static=no
 	fi
         ;;
     esac
@@ -7270,11 +7378,11 @@
 
     AC_MSG_CHECKING([whether to build static libraries])
     # Make sure either enable_shared or enable_static is yes.
-    test "$enable_shared" = yes || enable_static=yes
+    test yes = "$enable_shared" || enable_static=yes
     AC_MSG_RESULT([$enable_static])
 
-    _LT_TAGVAR(GCC, $1)="$G77"
-    _LT_TAGVAR(LD, $1)="$LD"
+    _LT_TAGVAR(GCC, $1)=$G77
+    _LT_TAGVAR(LD, $1)=$LD
 
     ## CAVEAT EMPTOR:
     ## There is no encapsulation within the following macros, do not change
@@ -7291,9 +7399,9 @@
   fi # test -n "$compiler"
 
   GCC=$lt_save_GCC
-  CC="$lt_save_CC"
-  CFLAGS="$lt_save_CFLAGS"
-fi # test "$_lt_disable_F77" != yes
+  CC=$lt_save_CC
+  CFLAGS=$lt_save_CFLAGS
+fi # test yes != "$_lt_disable_F77"
 
 AC_LANG_POP
 ])# _LT_LANG_F77_CONFIG
@@ -7303,11 +7411,11 @@
 # -------------------------
 # Ensure that the configuration variables for a Fortran compiler are
 # suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
+# to write the compiler configuration to 'libtool'.
 m4_defun([_LT_LANG_FC_CONFIG],
 [AC_LANG_PUSH(Fortran)
 
-if test -z "$FC" || test "X$FC" = "Xno"; then
+if test -z "$FC" || test no = "$FC"; then
   _lt_disable_FC=yes
 fi
 
@@ -7344,7 +7452,7 @@
 # the FC compiler isn't working.  Some variables (like enable_shared)
 # are currently assumed to apply to all compilers on this platform,
 # and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_disable_FC" != yes; then
+if test yes != "$_lt_disable_FC"; then
   # Code to be used in simple compile tests
   lt_simple_compile_test_code="\
       subroutine t
@@ -7366,7 +7474,7 @@
   _LT_LINKER_BOILERPLATE
 
   # Allow CC to be a program name with arguments.
-  lt_save_CC="$CC"
+  lt_save_CC=$CC
   lt_save_GCC=$GCC
   lt_save_CFLAGS=$CFLAGS
   CC=${FC-"f95"}
@@ -7382,21 +7490,21 @@
     AC_MSG_RESULT([$can_build_shared])
 
     AC_MSG_CHECKING([whether to build shared libraries])
-    test "$can_build_shared" = "no" && enable_shared=no
+    test no = "$can_build_shared" && enable_shared=no
 
     # On AIX, shared libraries and static libraries use the same namespace, and
     # are all built from PIC.
     case $host_os in
       aix3*)
-        test "$enable_shared" = yes && enable_static=no
+        test yes = "$enable_shared" && enable_static=no
         if test -n "$RANLIB"; then
           archive_cmds="$archive_cmds~\$RANLIB \$lib"
           postinstall_cmds='$RANLIB $lib'
         fi
         ;;
       aix[[4-9]]*)
-	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-	  test "$enable_shared" = yes && enable_static=no
+	if test ia64 != "$host_cpu" && test no = "$aix_use_runtimelinking"; then
+	  test yes = "$enable_shared" && enable_static=no
 	fi
         ;;
     esac
@@ -7404,11 +7512,11 @@
 
     AC_MSG_CHECKING([whether to build static libraries])
     # Make sure either enable_shared or enable_static is yes.
-    test "$enable_shared" = yes || enable_static=yes
+    test yes = "$enable_shared" || enable_static=yes
     AC_MSG_RESULT([$enable_static])
 
-    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
-    _LT_TAGVAR(LD, $1)="$LD"
+    _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu
+    _LT_TAGVAR(LD, $1)=$LD
 
     ## CAVEAT EMPTOR:
     ## There is no encapsulation within the following macros, do not change
@@ -7428,7 +7536,7 @@
   GCC=$lt_save_GCC
   CC=$lt_save_CC
   CFLAGS=$lt_save_CFLAGS
-fi # test "$_lt_disable_FC" != yes
+fi # test yes != "$_lt_disable_FC"
 
 AC_LANG_POP
 ])# _LT_LANG_FC_CONFIG
@@ -7438,7 +7546,7 @@
 # --------------------------
 # Ensure that the configuration variables for the GNU Java Compiler compiler
 # are suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
+# to write the compiler configuration to 'libtool'.
 m4_defun([_LT_LANG_GCJ_CONFIG],
 [AC_REQUIRE([LT_PROG_GCJ])dnl
 AC_LANG_SAVE
@@ -7472,7 +7580,7 @@
 CFLAGS=$GCJFLAGS
 compiler=$CC
 _LT_TAGVAR(compiler, $1)=$CC
-_LT_TAGVAR(LD, $1)="$LD"
+_LT_TAGVAR(LD, $1)=$LD
 _LT_CC_BASENAME([$compiler])
 
 # GCJ did not exist at the time GCC didn't implicitly link libc in.
@@ -7509,7 +7617,7 @@
 # --------------------------
 # Ensure that the configuration variables for the GNU Go compiler
 # are suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
+# to write the compiler configuration to 'libtool'.
 m4_defun([_LT_LANG_GO_CONFIG],
 [AC_REQUIRE([LT_PROG_GO])dnl
 AC_LANG_SAVE
@@ -7543,7 +7651,7 @@
 CFLAGS=$GOFLAGS
 compiler=$CC
 _LT_TAGVAR(compiler, $1)=$CC
-_LT_TAGVAR(LD, $1)="$LD"
+_LT_TAGVAR(LD, $1)=$LD
 _LT_CC_BASENAME([$compiler])
 
 # Go did not exist at the time GCC didn't implicitly link libc in.
@@ -7580,7 +7688,7 @@
 # -------------------------
 # Ensure that the configuration variables for the Windows resource compiler
 # are suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
+# to write the compiler configuration to 'libtool'.
 m4_defun([_LT_LANG_RC_CONFIG],
 [AC_REQUIRE([LT_PROG_RC])dnl
 AC_LANG_SAVE
@@ -7596,7 +7704,7 @@
 lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
 
 # Code to be used in simple link tests
-lt_simple_link_test_code="$lt_simple_compile_test_code"
+lt_simple_link_test_code=$lt_simple_compile_test_code
 
 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
 _LT_TAG_COMPILER
@@ -7606,7 +7714,7 @@
 _LT_LINKER_BOILERPLATE
 
 # Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
+lt_save_CC=$CC
 lt_save_CFLAGS=$CFLAGS
 lt_save_GCC=$GCC
 GCC=
@@ -7635,7 +7743,7 @@
 [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
   [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
     [AC_CHECK_TOOL(GCJ, gcj,)
-      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+      test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
       AC_SUBST(GCJFLAGS)])])[]dnl
 ])
 
@@ -7746,7 +7854,7 @@
 # Add /usr/xpg4/bin/sed as it is typically found on Solaris
 # along with /bin/sed that truncates output.
 for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
-  test ! -f $lt_ac_sed && continue
+  test ! -f "$lt_ac_sed" && continue
   cat /dev/null > conftest.in
   lt_ac_count=0
   echo $ECHO_N "0123456789$ECHO_C" >conftest.in
@@ -7763,9 +7871,9 @@
     $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
     cmp -s conftest.out conftest.nl || break
     # 10000 chars as input seems more than enough
-    test $lt_ac_count -gt 10 && break
+    test 10 -lt "$lt_ac_count" && break
     lt_ac_count=`expr $lt_ac_count + 1`
-    if test $lt_ac_count -gt $lt_ac_max; then
+    if test "$lt_ac_count" -gt "$lt_ac_max"; then
       lt_ac_max=$lt_ac_count
       lt_cv_path_SED=$lt_ac_sed
     fi
@@ -7789,27 +7897,7 @@
 # Find out whether the shell is Bourne or XSI compatible,
 # or has some other useful features.
 m4_defun([_LT_CHECK_SHELL_FEATURES],
-[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
-# Try some XSI features
-xsi_shell=no
-( _lt_dummy="a/b/c"
-  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
-      = c,a/b,b/c, \
-    && eval 'test $(( 1 + 1 )) -eq 2 \
-    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
-  && xsi_shell=yes
-AC_MSG_RESULT([$xsi_shell])
-_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
-
-AC_MSG_CHECKING([whether the shell understands "+="])
-lt_shell_append=no
-( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
-    >/dev/null 2>&1 \
-  && lt_shell_append=yes
-AC_MSG_RESULT([$lt_shell_append])
-_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
-
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
   lt_unset=unset
 else
   lt_unset=false
@@ -7833,102 +7921,9 @@
 ])# _LT_CHECK_SHELL_FEATURES
 
 
-# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
-# ------------------------------------------------------
-# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
-# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
-m4_defun([_LT_PROG_FUNCTION_REPLACE],
-[dnl {
-sed -e '/^$1 ()$/,/^} # $1 /c\
-$1 ()\
-{\
-m4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
-} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-])
-
-
-# _LT_PROG_REPLACE_SHELLFNS
-# -------------------------
-# Replace existing portable implementations of several shell functions with
-# equivalent extended shell implementations where those features are available..
-m4_defun([_LT_PROG_REPLACE_SHELLFNS],
-[if test x"$xsi_shell" = xyes; then
-  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
-    case ${1} in
-      */*) func_dirname_result="${1%/*}${2}" ;;
-      *  ) func_dirname_result="${3}" ;;
-    esac])
-
-  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
-    func_basename_result="${1##*/}"])
-
-  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
-    case ${1} in
-      */*) func_dirname_result="${1%/*}${2}" ;;
-      *  ) func_dirname_result="${3}" ;;
-    esac
-    func_basename_result="${1##*/}"])
-
-  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
-    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
-    # positional parameters, so assign one to ordinary parameter first.
-    func_stripname_result=${3}
-    func_stripname_result=${func_stripname_result#"${1}"}
-    func_stripname_result=${func_stripname_result%"${2}"}])
-
-  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
-    func_split_long_opt_name=${1%%=*}
-    func_split_long_opt_arg=${1#*=}])
-
-  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
-    func_split_short_opt_arg=${1#??}
-    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
-
-  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
-    case ${1} in
-      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
-      *)    func_lo2o_result=${1} ;;
-    esac])
-
-  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
-
-  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
-
-  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
-fi
-
-if test x"$lt_shell_append" = xyes; then
-  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
-
-  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
-    func_quote_for_eval "${2}"
-dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
-    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
-
-  # Save a `func_append' function call where possible by direct use of '+='
-  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
-    && mv -f "$cfgfile.tmp" "$cfgfile" \
-      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-  test 0 -eq $? || _lt_function_replace_fail=:
-else
-  # Save a `func_append' function call even when '+=' is not available
-  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
-    && mv -f "$cfgfile.tmp" "$cfgfile" \
-      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-  test 0 -eq $? || _lt_function_replace_fail=:
-fi
-
-if test x"$_lt_function_replace_fail" = x":"; then
-  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
-fi
-])
-
 # _LT_PATH_CONVERSION_FUNCTIONS
 # -----------------------------
-# Determine which file name conversion functions should be used by
+# Determine what file name conversion functions should be used by
 # func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
 # for certain cross-compile configurations and native mingw.
 m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
diff --git a/Modules/_ctypes/libffi/m4/ltoptions.m4 b/Modules/_ctypes/libffi/m4/ltoptions.m4
index 5d9acd8..50c7723 100644
--- a/Modules/_ctypes/libffi/m4/ltoptions.m4
+++ b/Modules/_ctypes/libffi/m4/ltoptions.m4
@@ -1,14 +1,14 @@
 # Helper functions for option handling.                    -*- Autoconf -*-
 #
-#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
-#   Inc.
+#   Copyright (C) 2004-2005, 2007-2009, 2011-2013 Free Software
+#   Foundation, Inc.
 #   Written by Gary V. Vaughan, 2004
 #
 # This file is free software; the Free Software Foundation gives
 # unlimited permission to copy and/or distribute it, with or without
 # modifications, as long as this notice is preserved.
 
-# serial 7 ltoptions.m4
+# serial 8 ltoptions.m4
 
 # This is to help aclocal find these macros, as it can't see m4_define.
 AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
@@ -29,7 +29,7 @@
 [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
 m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
         _LT_MANGLE_DEFUN([$1], [$2]),
-    [m4_warning([Unknown $1 option `$2'])])[]dnl
+    [m4_warning([Unknown $1 option '$2'])])[]dnl
 ])
 
 
@@ -75,13 +75,13 @@
   dnl
   dnl If no reference was made to various pairs of opposing options, then
   dnl we run the default mode handler for the pair.  For example, if neither
-  dnl `shared' nor `disable-shared' was passed, we enable building of shared
+  dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
   dnl archives by default:
   _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
   _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
   _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
   _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
-  		   [_LT_ENABLE_FAST_INSTALL])
+		   [_LT_ENABLE_FAST_INSTALL])
   ])
 ])# _LT_SET_OPTIONS
 
@@ -112,7 +112,7 @@
 [_LT_SET_OPTION([LT_INIT], [dlopen])
 AC_DIAGNOSE([obsolete],
 [$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `dlopen' option into LT_INIT's first parameter.])
+put the 'dlopen' option into LT_INIT's first parameter.])
 ])
 
 dnl aclocal-1.4 backwards compatibility:
@@ -148,7 +148,7 @@
 _LT_SET_OPTION([LT_INIT], [win32-dll])
 AC_DIAGNOSE([obsolete],
 [$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `win32-dll' option into LT_INIT's first parameter.])
+put the 'win32-dll' option into LT_INIT's first parameter.])
 ])
 
 dnl aclocal-1.4 backwards compatibility:
@@ -157,9 +157,9 @@
 
 # _LT_ENABLE_SHARED([DEFAULT])
 # ----------------------------
-# implement the --enable-shared flag, and supports the `shared' and
-# `disable-shared' LT_INIT options.
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+# implement the --enable-shared flag, and supports the 'shared' and
+# 'disable-shared' LT_INIT options.
+# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
 m4_define([_LT_ENABLE_SHARED],
 [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
 AC_ARG_ENABLE([shared],
@@ -172,14 +172,14 @@
     *)
       enable_shared=no
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
       for pkg in $enableval; do
-	IFS="$lt_save_ifs"
+	IFS=$lt_save_ifs
 	if test "X$pkg" = "X$p"; then
 	  enable_shared=yes
 	fi
       done
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       ;;
     esac],
     [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
@@ -211,9 +211,9 @@
 
 # _LT_ENABLE_STATIC([DEFAULT])
 # ----------------------------
-# implement the --enable-static flag, and support the `static' and
-# `disable-static' LT_INIT options.
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+# implement the --enable-static flag, and support the 'static' and
+# 'disable-static' LT_INIT options.
+# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
 m4_define([_LT_ENABLE_STATIC],
 [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
 AC_ARG_ENABLE([static],
@@ -226,14 +226,14 @@
     *)
      enable_static=no
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
       for pkg in $enableval; do
-	IFS="$lt_save_ifs"
+	IFS=$lt_save_ifs
 	if test "X$pkg" = "X$p"; then
 	  enable_static=yes
 	fi
       done
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       ;;
     esac],
     [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
@@ -265,9 +265,9 @@
 
 # _LT_ENABLE_FAST_INSTALL([DEFAULT])
 # ----------------------------------
-# implement the --enable-fast-install flag, and support the `fast-install'
-# and `disable-fast-install' LT_INIT options.
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+# implement the --enable-fast-install flag, and support the 'fast-install'
+# and 'disable-fast-install' LT_INIT options.
+# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
 m4_define([_LT_ENABLE_FAST_INSTALL],
 [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
 AC_ARG_ENABLE([fast-install],
@@ -280,14 +280,14 @@
     *)
       enable_fast_install=no
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
       for pkg in $enableval; do
-	IFS="$lt_save_ifs"
+	IFS=$lt_save_ifs
 	if test "X$pkg" = "X$p"; then
 	  enable_fast_install=yes
 	fi
       done
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       ;;
     esac],
     [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
@@ -304,14 +304,14 @@
 [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
 AC_DIAGNOSE([obsolete],
 [$0: Remove this warning and the call to _LT_SET_OPTION when you put
-the `fast-install' option into LT_INIT's first parameter.])
+the 'fast-install' option into LT_INIT's first parameter.])
 ])
 
 AU_DEFUN([AC_DISABLE_FAST_INSTALL],
 [_LT_SET_OPTION([LT_INIT], [disable-fast-install])
 AC_DIAGNOSE([obsolete],
 [$0: Remove this warning and the call to _LT_SET_OPTION when you put
-the `disable-fast-install' option into LT_INIT's first parameter.])
+the 'disable-fast-install' option into LT_INIT's first parameter.])
 ])
 
 dnl aclocal-1.4 backwards compatibility:
@@ -321,9 +321,9 @@
 
 # _LT_WITH_PIC([MODE])
 # --------------------
-# implement the --with-pic flag, and support the `pic-only' and `no-pic'
+# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
 # LT_INIT options.
-# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
+# MODE is either 'yes' or 'no'.  If omitted, it defaults to 'both'.
 m4_define([_LT_WITH_PIC],
 [AC_ARG_WITH([pic],
     [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
@@ -334,19 +334,17 @@
     *)
       pic_mode=default
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
       for lt_pkg in $withval; do
-	IFS="$lt_save_ifs"
+	IFS=$lt_save_ifs
 	if test "X$lt_pkg" = "X$lt_p"; then
 	  pic_mode=yes
 	fi
       done
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       ;;
     esac],
-    [pic_mode=default])
-
-test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
+    [pic_mode=m4_default([$1], [default])])
 
 _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
 ])# _LT_WITH_PIC
@@ -359,7 +357,7 @@
 [_LT_SET_OPTION([LT_INIT], [pic-only])
 AC_DIAGNOSE([obsolete],
 [$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `pic-only' option into LT_INIT's first parameter.])
+put the 'pic-only' option into LT_INIT's first parameter.])
 ])
 
 dnl aclocal-1.4 backwards compatibility:
diff --git a/Modules/_ctypes/libffi/m4/ltsugar.m4 b/Modules/_ctypes/libffi/m4/ltsugar.m4
index 9000a05..7cbc638 100644
--- a/Modules/_ctypes/libffi/m4/ltsugar.m4
+++ b/Modules/_ctypes/libffi/m4/ltsugar.m4
@@ -1,6 +1,7 @@
 # ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
 #
-# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2004-2005, 2007-2008, 2011-2013 Free Software
+# Foundation, Inc.
 # Written by Gary V. Vaughan, 2004
 #
 # This file is free software; the Free Software Foundation gives
@@ -33,7 +34,7 @@
 # ------------
 # Manipulate m4 lists.
 # These macros are necessary as long as will still need to support
-# Autoconf-2.59 which quotes differently.
+# Autoconf-2.59, which quotes differently.
 m4_define([lt_car], [[$1]])
 m4_define([lt_cdr],
 [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
@@ -44,7 +45,7 @@
 
 # lt_append(MACRO-NAME, STRING, [SEPARATOR])
 # ------------------------------------------
-# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
+# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
 # Note that neither SEPARATOR nor STRING are expanded; they are appended
 # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
 # No SEPARATOR is output if MACRO-NAME was previously undefined (different
diff --git a/Modules/_ctypes/libffi/m4/ltversion.m4 b/Modules/_ctypes/libffi/m4/ltversion.m4
index 07a8602..daeb0af 100644
--- a/Modules/_ctypes/libffi/m4/ltversion.m4
+++ b/Modules/_ctypes/libffi/m4/ltversion.m4
@@ -1,6 +1,6 @@
 # ltversion.m4 -- version numbers			-*- Autoconf -*-
 #
-#   Copyright (C) 2004 Free Software Foundation, Inc.
+#   Copyright (C) 2004, 2011-2013 Free Software Foundation, Inc.
 #   Written by Scott James Remnant, 2004
 #
 # This file is free software; the Free Software Foundation gives
@@ -9,15 +9,15 @@
 
 # @configure_input@
 
-# serial 3337 ltversion.m4
+# serial 4038 ltversion.m4
 # This file is part of GNU Libtool
 
-m4_define([LT_PACKAGE_VERSION], [2.4.2])
-m4_define([LT_PACKAGE_REVISION], [1.3337])
+m4_define([LT_PACKAGE_VERSION], [2.4.2.418])
+m4_define([LT_PACKAGE_REVISION], [2.4.2.418])
 
 AC_DEFUN([LTVERSION_VERSION],
-[macro_version='2.4.2'
-macro_revision='1.3337'
+[macro_version='2.4.2.418'
+macro_revision='2.4.2.418'
 _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
 _LT_DECL(, macro_revision, 0)
 ])
diff --git a/Modules/_ctypes/libffi/m4/lt~obsolete.m4 b/Modules/_ctypes/libffi/m4/lt~obsolete.m4
index c573da9..59461e4 100644
--- a/Modules/_ctypes/libffi/m4/lt~obsolete.m4
+++ b/Modules/_ctypes/libffi/m4/lt~obsolete.m4
@@ -1,6 +1,7 @@
 # lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
 #
-#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+#   Copyright (C) 2004-2005, 2007, 2009, 2011-2013 Free Software
+#   Foundation, Inc.
 #   Written by Scott James Remnant, 2004.
 #
 # This file is free software; the Free Software Foundation gives
@@ -11,7 +12,7 @@
 
 # These exist entirely to fool aclocal when bootstrapping libtool.
 #
-# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
+# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
 # which have later been changed to m4_define as they aren't part of the
 # exported API, or moved to Autoconf or Automake where they belong.
 #
@@ -25,7 +26,7 @@
 # included after everything else.  This provides aclocal with the
 # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
 # because those macros already exist, or will be overwritten later.
-# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
+# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
 #
 # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
 # Yes, that means every name once taken will need to remain here until
diff --git a/Modules/_ctypes/libffi/man/Makefile.in b/Modules/_ctypes/libffi/man/Makefile.in
index c02e1f2..d92af74 100644
--- a/Modules/_ctypes/libffi/man/Makefile.in
+++ b/Modules/_ctypes/libffi/man/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.12.2 from Makefile.am.
+# Makefile.in generated by automake 1.13.4 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,23 +14,51 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \	]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -51,7 +79,7 @@
 host_triplet = @host@
 target_triplet = @target@
 subdir = man
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/asmcfi.m4 \
 	$(top_srcdir)/m4/ax_append_flag.m4 \
@@ -73,6 +101,18 @@
 CONFIG_HEADER = $(top_builddir)/fficonfig.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 SOURCES =
 DIST_SOURCES =
 am__can_run_installinfo = \
@@ -111,10 +151,12 @@
 am__installdirs = "$(DESTDIR)$(man3dir)"
 NROFF = nroff
 MANS = $(man_MANS)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AM_LTLDFLAGS = @AM_LTLDFLAGS@
 AM_RUNTESTFLAGS = @AM_RUNTESTFLAGS@
 AR = @AR@
@@ -130,6 +172,10 @@
 CFLAGS = @CFLAGS@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -145,6 +191,7 @@
 FGREP = @FGREP@
 GREP = @GREP@
 HAVE_LONG_DOUBLE = @HAVE_LONG_DOUBLE@
+HAVE_LONG_DOUBLE_VARIANT = @HAVE_LONG_DOUBLE_VARIANT@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -191,6 +238,7 @@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
@@ -330,29 +378,14 @@
 	} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \
 	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
 	dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir)
-tags: TAGS
-TAGS:
+tags TAGS:
 
-ctags: CTAGS
-CTAGS:
+ctags CTAGS:
 
 cscope cscopelist:
 
 
 distdir: $(DISTFILES)
-	@list='$(MANS)'; if test -n "$$list"; then \
-	  list=`for p in $$list; do \
-	    if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
-	    if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
-	  if test -n "$$list" && \
-	    grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
-	    echo "error: found man pages containing the 'missing help2man' replacement text:" >&2; \
-	    grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/         /' >&2; \
-	    echo "       to fix them, install help2man, remove and regenerate the man pages;" >&2; \
-	    echo "       typically 'make maintainer-clean' will remove them" >&2; \
-	    exit 1; \
-	  else :; fi; \
-	else :; fi
 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	list='$(DISTFILES)'; \
@@ -490,16 +523,17 @@
 .MAKE: install-am install-strip
 
 .PHONY: all all-am check check-am clean clean-generic clean-libtool \
-	distclean distclean-generic distclean-libtool distdir dvi \
-	dvi-am html html-am info info-am install install-am \
-	install-data install-data-am install-dvi install-dvi-am \
-	install-exec install-exec-am install-html install-html-am \
-	install-info install-info-am install-man install-man3 \
-	install-pdf install-pdf-am install-ps install-ps-am \
-	install-strip installcheck installcheck-am installdirs \
-	maintainer-clean maintainer-clean-generic mostlyclean \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	uninstall uninstall-am uninstall-man uninstall-man3
+	cscopelist-am ctags-am distclean distclean-generic \
+	distclean-libtool distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-man3 install-pdf install-pdf-am install-ps \
+	install-ps-am install-strip installcheck installcheck-am \
+	installdirs maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+	ps ps-am tags-am uninstall uninstall-am uninstall-man \
+	uninstall-man3
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/Modules/_ctypes/libffi/mdate-sh b/Modules/_ctypes/libffi/mdate-sh
index cd916c0..b3719cf 100755
--- a/Modules/_ctypes/libffi/mdate-sh
+++ b/Modules/_ctypes/libffi/mdate-sh
@@ -1,10 +1,9 @@
 #!/bin/sh
 # Get modification time of a file or directory and pretty-print it.
 
-scriptversion=2005-06-29.22
+scriptversion=2010-08-21.06; # UTC
 
-# Copyright (C) 1995, 1996, 1997, 2003, 2004, 2005 Free Software
-# Foundation, Inc.
+# Copyright (C) 1995-2013 Free Software Foundation, Inc.
 # written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995
 #
 # This program is free software; you can redistribute it and/or modify
@@ -18,8 +17,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
@@ -30,16 +28,26 @@
 # bugs to <bug-automake@gnu.org> or send patches to
 # <automake-patches@gnu.org>.
 
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+fi
+
 case $1 in
   '')
-     echo "$0: No file.  Try \`$0 --help' for more information." 1>&2
+     echo "$0: No file.  Try '$0 --help' for more information." 1>&2
      exit 1;
      ;;
   -h | --h*)
     cat <<\EOF
 Usage: mdate-sh [--help] [--version] FILE
 
-Pretty-print the modification time of FILE.
+Pretty-print the modification day of FILE, in the format:
+1 January 1970
 
 Report bugs to <bug-automake@gnu.org>.
 EOF
@@ -51,6 +59,13 @@
     ;;
 esac
 
+error ()
+{
+  echo "$0: $1" >&2
+  exit 1
+}
+
+
 # Prevent date giving response in another language.
 LANG=C
 export LANG
@@ -60,7 +75,7 @@
 export LC_TIME
 
 # GNU ls changes its time format in response to the TIME_STYLE
-# variable.  Since we cannot assume `unset' works, revert this
+# variable.  Since we cannot assume 'unset' works, revert this
 # variable to its documented default.
 if test "${TIME_STYLE+set}" = set; then
   TIME_STYLE=posix-long-iso
@@ -75,27 +90,32 @@
 else
   ls_command='ls -l -d'
 fi
+# Avoid user/group names that might have spaces, when possible.
+if ls -n /dev/null 1>/dev/null 2>&1; then
+  ls_command="$ls_command -n"
+fi
 
-# A `ls -l' line looks as follows on OS/2.
+# A 'ls -l' line looks as follows on OS/2.
 #  drwxrwx---        0 Aug 11  2001 foo
 # This differs from Unix, which adds ownership information.
 #  drwxrwx---   2 root  root      4096 Aug 11  2001 foo
 #
 # To find the date, we split the line on spaces and iterate on words
 # until we find a month.  This cannot work with files whose owner is a
-# user named `Jan', or `Feb', etc.  However, it's unlikely that `/'
+# user named "Jan", or "Feb", etc.  However, it's unlikely that '/'
 # will be owned by a user whose name is a month.  So we first look at
 # the extended ls output of the root directory to decide how many
 # words should be skipped to get the date.
 
 # On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below.
-set x`ls -l -d /`
+set x`$ls_command /`
 
 # Find which argument is the month.
 month=
 command=
 until test $month
 do
+  test $# -gt 0 || error "failed parsing '$ls_command /' output"
   shift
   # Add another shift to the command.
   command="$command shift;"
@@ -115,8 +135,10 @@
   esac
 done
 
+test -n "$month" || error "failed parsing '$ls_command /' output"
+
 # Get the extended ls output of the file or directory.
-set dummy x`eval "$ls_command \"\$save_arg1\""`
+set dummy x`eval "$ls_command \"\\\$save_arg1\""`
 
 # Remove all preceding arguments
 eval $command
@@ -197,5 +219,6 @@
 # eval: (add-hook 'write-file-hooks 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
 # End:
diff --git a/Modules/_ctypes/libffi/missing b/Modules/_ctypes/libffi/missing
index 28055d2..cdea514 100755
--- a/Modules/_ctypes/libffi/missing
+++ b/Modules/_ctypes/libffi/missing
@@ -1,11 +1,10 @@
 #! /bin/sh
-# Common stub for a few missing GNU programs while installing.
+# Common wrapper for a few potentially missing GNU programs.
 
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2012-06-26.16; # UTC
 
-# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
-# 2008, 2009 Free Software Foundation, Inc.
-# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -26,69 +25,40 @@
 # the same distribution terms that you use for the rest of that program.
 
 if test $# -eq 0; then
-  echo 1>&2 "Try \`$0 --help' for more information"
+  echo 1>&2 "Try '$0 --help' for more information"
   exit 1
 fi
 
-run=:
-sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
-sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
-
-# In the cases where this matters, `missing' is being run in the
-# srcdir already.
-if test -f configure.ac; then
-  configure_ac=configure.ac
-else
-  configure_ac=configure.in
-fi
-
-msg="missing on your system"
-
 case $1 in
---run)
-  # Try to run requested program, and just exit if it succeeds.
-  run=
-  shift
-  "$@" && exit 0
-  # Exit code 63 means version mismatch.  This often happens
-  # when the user try to use an ancient version of a tool on
-  # a file that requires a minimum version.  In this case we
-  # we should proceed has if the program had been absent, or
-  # if --run hadn't been passed.
-  if test $? = 63; then
-    run=:
-    msg="probably too old"
-  fi
-  ;;
+
+  --is-lightweight)
+    # Used by our autoconf macros to check whether the available missing
+    # script is modern enough.
+    exit 0
+    ;;
+
+  --run)
+    # Back-compat with the calling convention used by older automake.
+    shift
+    ;;
 
   -h|--h|--he|--hel|--help)
     echo "\
 $0 [OPTION]... PROGRAM [ARGUMENT]...
 
-Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
-error status if there is no known handling for PROGRAM.
+Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
+to PROGRAM being missing or too old.
 
 Options:
   -h, --help      display this help and exit
   -v, --version   output version information and exit
-  --run           try to run the given command, and emulate it if it fails
 
 Supported PROGRAM values:
-  aclocal      touch file \`aclocal.m4'
-  autoconf     touch file \`configure'
-  autoheader   touch file \`config.h.in'
-  autom4te     touch the output file, or create a stub one
-  automake     touch all \`Makefile.in' files
-  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
-  flex         create \`lex.yy.c', if possible, from existing .c
-  help2man     touch the output file
-  lex          create \`lex.yy.c', if possible, from existing .c
-  makeinfo     touch the output file
-  tar          try tar, gnutar, gtar, then tar without non-portable flags
-  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]
+  aclocal   autoconf  autoheader   autom4te  automake  makeinfo
+  bison     yacc      flex         lex       help2man
 
-Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
-\`g' are ignored when checking the name.
+Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
+'g' are ignored when checking the name.
 
 Send bug reports to <bug-automake@gnu.org>."
     exit $?
@@ -100,272 +70,141 @@
     ;;
 
   -*)
-    echo 1>&2 "$0: Unknown \`$1' option"
-    echo 1>&2 "Try \`$0 --help' for more information"
+    echo 1>&2 "$0: unknown '$1' option"
+    echo 1>&2 "Try '$0 --help' for more information"
     exit 1
     ;;
 
 esac
 
-# normalize program name to check for.
-program=`echo "$1" | sed '
-  s/^gnu-//; t
-  s/^gnu//; t
-  s/^g//; t'`
+# Run the given program, remember its exit status.
+"$@"; st=$?
 
-# Now exit if we have it, but it failed.  Also exit now if we
-# don't have it and --version was passed (most likely to detect
-# the program).  This is about non-GNU programs, so use $1 not
-# $program.
-case $1 in
-  lex*|yacc*)
-    # Not GNU programs, they don't have --version.
+# If it succeeded, we are done.
+test $st -eq 0 && exit 0
+
+# Also exit now if we it failed (or wasn't found), and '--version' was
+# passed; such an option is passed most likely to detect whether the
+# program is present and works.
+case $2 in --version|--help) exit $st;; esac
+
+# Exit code 63 means version mismatch.  This often happens when the user
+# tries to use an ancient version of a tool on a file that requires a
+# minimum version.
+if test $st -eq 63; then
+  msg="probably too old"
+elif test $st -eq 127; then
+  # Program was missing.
+  msg="missing on your system"
+else
+  # Program was found and executed, but failed.  Give up.
+  exit $st
+fi
+
+perl_URL=http://www.perl.org/
+flex_URL=http://flex.sourceforge.net/
+gnu_software_URL=http://www.gnu.org/software
+
+program_details ()
+{
+  case $1 in
+    aclocal|automake)
+      echo "The '$1' program is part of the GNU Automake package:"
+      echo "<$gnu_software_URL/automake>"
+      echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
+      echo "<$gnu_software_URL/autoconf>"
+      echo "<$gnu_software_URL/m4/>"
+      echo "<$perl_URL>"
+      ;;
+    autoconf|autom4te|autoheader)
+      echo "The '$1' program is part of the GNU Autoconf package:"
+      echo "<$gnu_software_URL/autoconf/>"
+      echo "It also requires GNU m4 and Perl in order to run:"
+      echo "<$gnu_software_URL/m4/>"
+      echo "<$perl_URL>"
+      ;;
+  esac
+}
+
+give_advice ()
+{
+  # Normalize program name to check for.
+  normalized_program=`echo "$1" | sed '
+    s/^gnu-//; t
+    s/^gnu//; t
+    s/^g//; t'`
+
+  printf '%s\n' "'$1' is $msg."
+
+  configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
+  case $normalized_program in
+    autoconf*)
+      echo "You should only need it if you modified 'configure.ac',"
+      echo "or m4 files included by it."
+      program_details 'autoconf'
+      ;;
+    autoheader*)
+      echo "You should only need it if you modified 'acconfig.h' or"
+      echo "$configure_deps."
+      program_details 'autoheader'
+      ;;
+    automake*)
+      echo "You should only need it if you modified 'Makefile.am' or"
+      echo "$configure_deps."
+      program_details 'automake'
+      ;;
+    aclocal*)
+      echo "You should only need it if you modified 'acinclude.m4' or"
+      echo "$configure_deps."
+      program_details 'aclocal'
+      ;;
+   autom4te*)
+      echo "You might have modified some maintainer files that require"
+      echo "the 'automa4te' program to be rebuilt."
+      program_details 'autom4te'
+      ;;
+    bison*|yacc*)
+      echo "You should only need it if you modified a '.y' file."
+      echo "You may want to install the GNU Bison package:"
+      echo "<$gnu_software_URL/bison/>"
+      ;;
+    lex*|flex*)
+      echo "You should only need it if you modified a '.l' file."
+      echo "You may want to install the Fast Lexical Analyzer package:"
+      echo "<$flex_URL>"
+      ;;
+    help2man*)
+      echo "You should only need it if you modified a dependency" \
+           "of a man page."
+      echo "You may want to install the GNU Help2man package:"
+      echo "<$gnu_software_URL/help2man/>"
     ;;
+    makeinfo*)
+      echo "You should only need it if you modified a '.texi' file, or"
+      echo "any other file indirectly affecting the aspect of the manual."
+      echo "You might want to install the Texinfo package:"
+      echo "<$gnu_software_URL/texinfo/>"
+      echo "The spurious makeinfo call might also be the consequence of"
+      echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
+      echo "want to install GNU make:"
+      echo "<$gnu_software_URL/make/>"
+      ;;
+    *)
+      echo "You might have modified some files without having the proper"
+      echo "tools for further handling them.  Check the 'README' file, it"
+      echo "often tells you about the needed prerequisites for installing"
+      echo "this package.  You may also peek at any GNU archive site, in"
+      echo "case some other package contains this missing '$1' program."
+      ;;
+  esac
+}
 
-  tar*)
-    if test -n "$run"; then
-       echo 1>&2 "ERROR: \`tar' requires --run"
-       exit 1
-    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
-       exit 1
-    fi
-    ;;
+give_advice "$1" | sed -e '1s/^/WARNING: /' \
+                       -e '2,$s/^/         /' >&2
 
-  *)
-    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
-       # We have it, but it failed.
-       exit 1
-    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
-       # Could not run --version or --help.  This is probably someone
-       # running `$TOOL --version' or `$TOOL --help' to check whether
-       # $TOOL exists and not knowing $TOOL uses missing.
-       exit 1
-    fi
-    ;;
-esac
-
-# If it does not exist, or fails to run (possibly an outdated version),
-# try to emulate it.
-case $program in
-  aclocal*)
-    echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified \`acinclude.m4' or \`${configure_ac}'.  You might want
-         to install the \`Automake' and \`Perl' packages.  Grab them from
-         any GNU archive site."
-    touch aclocal.m4
-    ;;
-
-  autoconf*)
-    echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified \`${configure_ac}'.  You might want to install the
-         \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
-         archive site."
-    touch configure
-    ;;
-
-  autoheader*)
-    echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified \`acconfig.h' or \`${configure_ac}'.  You might want
-         to install the \`Autoconf' and \`GNU m4' packages.  Grab them
-         from any GNU archive site."
-    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
-    test -z "$files" && files="config.h"
-    touch_files=
-    for f in $files; do
-      case $f in
-      *:*) touch_files="$touch_files "`echo "$f" |
-				       sed -e 's/^[^:]*://' -e 's/:.*//'`;;
-      *) touch_files="$touch_files $f.in";;
-      esac
-    done
-    touch $touch_files
-    ;;
-
-  automake*)
-    echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
-         You might want to install the \`Automake' and \`Perl' packages.
-         Grab them from any GNU archive site."
-    find . -type f -name Makefile.am -print |
-	   sed 's/\.am$/.in/' |
-	   while read f; do touch "$f"; done
-    ;;
-
-  autom4te*)
-    echo 1>&2 "\
-WARNING: \`$1' is needed, but is $msg.
-         You might have modified some files without having the
-         proper tools for further handling them.
-         You can get \`$1' as part of \`Autoconf' from any GNU
-         archive site."
-
-    file=`echo "$*" | sed -n "$sed_output"`
-    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
-    if test -f "$file"; then
-	touch $file
-    else
-	test -z "$file" || exec >$file
-	echo "#! /bin/sh"
-	echo "# Created by GNU Automake missing as a replacement of"
-	echo "#  $ $@"
-	echo "exit 0"
-	chmod +x $file
-	exit 1
-    fi
-    ;;
-
-  bison*|yacc*)
-    echo 1>&2 "\
-WARNING: \`$1' $msg.  You should only need it if
-         you modified a \`.y' file.  You may need the \`Bison' package
-         in order for those modifications to take effect.  You can get
-         \`Bison' from any GNU archive site."
-    rm -f y.tab.c y.tab.h
-    if test $# -ne 1; then
-        eval LASTARG="\${$#}"
-	case $LASTARG in
-	*.y)
-	    SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
-	    if test -f "$SRCFILE"; then
-	         cp "$SRCFILE" y.tab.c
-	    fi
-	    SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
-	    if test -f "$SRCFILE"; then
-	         cp "$SRCFILE" y.tab.h
-	    fi
-	  ;;
-	esac
-    fi
-    if test ! -f y.tab.h; then
-	echo >y.tab.h
-    fi
-    if test ! -f y.tab.c; then
-	echo 'main() { return 0; }' >y.tab.c
-    fi
-    ;;
-
-  lex*|flex*)
-    echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified a \`.l' file.  You may need the \`Flex' package
-         in order for those modifications to take effect.  You can get
-         \`Flex' from any GNU archive site."
-    rm -f lex.yy.c
-    if test $# -ne 1; then
-        eval LASTARG="\${$#}"
-	case $LASTARG in
-	*.l)
-	    SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
-	    if test -f "$SRCFILE"; then
-	         cp "$SRCFILE" lex.yy.c
-	    fi
-	  ;;
-	esac
-    fi
-    if test ! -f lex.yy.c; then
-	echo 'main() { return 0; }' >lex.yy.c
-    fi
-    ;;
-
-  help2man*)
-    echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-	 you modified a dependency of a manual page.  You may need the
-	 \`Help2man' package in order for those modifications to take
-	 effect.  You can get \`Help2man' from any GNU archive site."
-
-    file=`echo "$*" | sed -n "$sed_output"`
-    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
-    if test -f "$file"; then
-	touch $file
-    else
-	test -z "$file" || exec >$file
-	echo ".ab help2man is required to generate this page"
-	exit $?
-    fi
-    ;;
-
-  makeinfo*)
-    echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified a \`.texi' or \`.texinfo' file, or any other file
-         indirectly affecting the aspect of the manual.  The spurious
-         call might also be the consequence of using a buggy \`make' (AIX,
-         DU, IRIX).  You might want to install the \`Texinfo' package or
-         the \`GNU make' package.  Grab either from any GNU archive site."
-    # The file to touch is that specified with -o ...
-    file=`echo "$*" | sed -n "$sed_output"`
-    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
-    if test -z "$file"; then
-      # ... or it is the one specified with @setfilename ...
-      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
-      file=`sed -n '
-	/^@setfilename/{
-	  s/.* \([^ ]*\) *$/\1/
-	  p
-	  q
-	}' $infile`
-      # ... or it is derived from the source name (dir/f.texi becomes f.info)
-      test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
-    fi
-    # If the file does not exist, the user really needs makeinfo;
-    # let's fail without touching anything.
-    test -f $file || exit 1
-    touch $file
-    ;;
-
-  tar*)
-    shift
-
-    # We have already tried tar in the generic part.
-    # Look for gnutar/gtar before invocation to avoid ugly error
-    # messages.
-    if (gnutar --version > /dev/null 2>&1); then
-       gnutar "$@" && exit 0
-    fi
-    if (gtar --version > /dev/null 2>&1); then
-       gtar "$@" && exit 0
-    fi
-    firstarg="$1"
-    if shift; then
-	case $firstarg in
-	*o*)
-	    firstarg=`echo "$firstarg" | sed s/o//`
-	    tar "$firstarg" "$@" && exit 0
-	    ;;
-	esac
-	case $firstarg in
-	*h*)
-	    firstarg=`echo "$firstarg" | sed s/h//`
-	    tar "$firstarg" "$@" && exit 0
-	    ;;
-	esac
-    fi
-
-    echo 1>&2 "\
-WARNING: I can't seem to be able to run \`tar' with the given arguments.
-         You may want to install GNU tar or Free paxutils, or check the
-         command line arguments."
-    exit 1
-    ;;
-
-  *)
-    echo 1>&2 "\
-WARNING: \`$1' is needed, and is $msg.
-         You might have modified some files without having the
-         proper tools for further handling them.  Check the \`README' file,
-         it often tells you about the needed prerequisites for installing
-         this package.  You may also peek at any GNU archive site, in case
-         some other package would contain this missing \`$1' program."
-    exit 1
-    ;;
-esac
-
-exit 0
+# Propagate the correct exit status (expected to be 127 for a program
+# not found, 63 for a program that failed due to version mismatch).
+exit $st
 
 # Local variables:
 # eval: (add-hook 'write-file-hooks 'time-stamp)
diff --git a/Modules/_ctypes/libffi/msvcc.sh b/Modules/_ctypes/libffi/msvcc.sh
index dcdbeab..7440deb 100755
--- a/Modules/_ctypes/libffi/msvcc.sh
+++ b/Modules/_ctypes/libffi/msvcc.sh
@@ -42,6 +42,7 @@
 # format and translated into something sensible for cl or ml.
 #
 
+args_orig=$@
 args="-nologo -W3"
 md=-MD
 cl="cl"
@@ -72,14 +73,35 @@
       shift 1
     ;;
     -O*)
-      # If we're optimizing, make sure we explicitly turn on some optimizations
-      # that are implicitly disabled by debug symbols (-Zi).
-      args="$args $1 -OPT:REF -OPT:ICF -INCREMENTAL:NO"
+      # Runtime error checks (enabled by setting -RTC1 in the -DFFI_DEBUG
+      # case below) are not compatible with optimization flags and will
+      # cause the build to fail. Therefore, drop the optimization flag if
+      # -DFFI_DEBUG is also set.
+      case $args_orig in
+        *-DFFI_DEBUG*)
+          args="$args"
+        ;;
+        *)
+          # The ax_cc_maxopt.m4 macro from the upstream autoconf-archive
+          # project doesn't support MSVC and therefore ends up trying to
+          # use -O3. Use the equivalent "max optimization" flag for MSVC
+          # instead of erroring out.
+          case $1 in
+            -O3)
+              args="$args -O2"
+            ;;
+            *)
+              args="$args $1"
+            ;;
+          esac
+          opt="true"
+        ;;
+      esac
       shift 1
     ;;
     -g)
       # Enable debug symbol generation.
-      args="$args -Zi -DEBUG"
+      args="$args -Zi"
       shift 1
     ;;
     -DFFI_DEBUG)
@@ -126,6 +148,10 @@
       # to do here.
       shift 1
     ;;
+    -pedantic)
+      # libffi tests -pedantic with -Wall, so drop it also.
+      shift 1
+    ;;
     -Werror)
       args="$args -WX"
       shift 1
@@ -170,6 +196,13 @@
   esac
 done
 
+# If -Zi is specified, certain optimizations are implicitly disabled
+# by MSVC. Add back those optimizations if this is an optimized build.
+# NOTE: These arguments must come after all others.
+if [ -n "$opt" ]; then
+    args="$args -link -OPT:REF -OPT:ICF -INCREMENTAL:NO"
+fi
+
 if [ -n "$assembly" ]; then
     if [ -z "$outdir" ]; then
       outdir="."
@@ -189,7 +222,10 @@
 else
     args="$md $args"
     echo "$cl $args"
-    eval "\"$cl\" $args"
+    # Return an error code of 1 if an invalid command line parameter is passed
+    # instead of just ignoring it.
+    eval "(\"$cl\" $args 2>&1 1>&3 | \
+          awk '{print \$0} /D9002/ {error=1} END{exit error}' >&2) 3>&1"
     result=$?
 fi
 
diff --git a/Modules/_ctypes/libffi/src/aarch64/ffi.c b/Modules/_ctypes/libffi/src/aarch64/ffi.c
index 1405665..b807a2d 100644
--- a/Modules/_ctypes/libffi/src/aarch64/ffi.c
+++ b/Modules/_ctypes/libffi/src/aarch64/ffi.c
@@ -27,7 +27,11 @@
 #include <stdlib.h>
 
 /* Stack alignment requirement in bytes */
+#if defined (__APPLE__)
+#define AARCH64_STACK_ALIGN 1
+#else
 #define AARCH64_STACK_ALIGN 16
+#endif
 
 #define N_X_ARG_REG 8
 #define N_V_ARG_REG 8
@@ -49,6 +53,23 @@
   } v [AARCH64_N_VREG];
 };
 
+#if defined (__clang__) && defined (__APPLE__)
+extern void
+sys_icache_invalidate (void *start, size_t len);
+#endif
+
+static inline void
+ffi_clear_cache (void *start, void *end)
+{
+#if defined (__clang__) && defined (__APPLE__)
+	sys_icache_invalidate (start, (char *)end - (char *)start);
+#elif defined (__GNUC__)
+	__builtin___clear_cache (start, end);
+#else
+#error "Missing builtin to flush instruction cache"
+#endif
+}
+
 static void *
 get_x_addr (struct call_context *context, unsigned n)
 {
@@ -94,8 +115,10 @@
       return get_s_addr (context, n);
     case FFI_TYPE_DOUBLE:
       return get_d_addr (context, n);
+#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
     case FFI_TYPE_LONGDOUBLE:
       return get_v_addr (context, n);
+#endif
     case FFI_TYPE_UINT8:
     case FFI_TYPE_SINT8:
     case FFI_TYPE_UINT16:
@@ -107,6 +130,8 @@
     case FFI_TYPE_UINT64:
     case FFI_TYPE_SINT64:
       return get_x_addr (context, n);
+    case FFI_TYPE_VOID:
+      return NULL;
     default:
       FFI_ASSERT (0);
       return NULL;
@@ -123,15 +148,26 @@
     case FFI_TYPE_FLOAT:
     case FFI_TYPE_DOUBLE:
       return sizeof (UINT64);
+#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
     case FFI_TYPE_LONGDOUBLE:
       return sizeof (long double);
+#endif
     case FFI_TYPE_UINT8:
     case FFI_TYPE_SINT8:
+#if defined (__APPLE__)
+	  return sizeof (UINT8);
+#endif
     case FFI_TYPE_UINT16:
     case FFI_TYPE_SINT16:
+#if defined (__APPLE__)
+	  return sizeof (UINT16);
+#endif
     case FFI_TYPE_UINT32:
     case FFI_TYPE_INT:
     case FFI_TYPE_SINT32:
+#if defined (__APPLE__)
+	  return sizeof (UINT32);
+#endif
     case FFI_TYPE_POINTER:
     case FFI_TYPE_UINT64:
     case FFI_TYPE_SINT64:
@@ -154,8 +190,10 @@
       return sizeof (UINT32);
     case FFI_TYPE_DOUBLE:
       return sizeof (UINT64);
+#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
     case FFI_TYPE_LONGDOUBLE:
       return sizeof (long double);
+#endif
     case FFI_TYPE_UINT8:
       return sizeof (UINT8);
     case FFI_TYPE_SINT8:
@@ -186,7 +224,7 @@
 			    extended_cif *),
                struct call_context *context,
                extended_cif *,
-               unsigned,
+               size_t,
                void (*fn)(void));
 
 extern void
@@ -305,7 +343,9 @@
     case FFI_TYPE_VOID:
     case FFI_TYPE_FLOAT:
     case FFI_TYPE_DOUBLE:
+#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
     case FFI_TYPE_LONGDOUBLE:
+#endif
     case FFI_TYPE_UINT8:
     case FFI_TYPE_UINT16:
     case FFI_TYPE_UINT32:
@@ -367,16 +407,24 @@
 {
   unsigned ngrn;                /* Next general-purpose register number. */
   unsigned nsrn;                /* Next vector register number. */
-  unsigned nsaa;                /* Next stack offset. */
+  size_t nsaa;                  /* Next stack offset. */
+
+#if defined (__APPLE__)
+  unsigned allocating_variadic;
+#endif
 };
 
 /* Initialize a procedure call argument marshalling state.  */
 static void
-arg_init (struct arg_state *state, unsigned call_frame_size)
+arg_init (struct arg_state *state, size_t call_frame_size)
 {
   state->ngrn = 0;
   state->nsrn = 0;
   state->nsaa = 0;
+
+#if defined (__APPLE__)
+  state->allocating_variadic = 0;
+#endif
 }
 
 /* Return the number of available consecutive core argument
@@ -400,35 +448,35 @@
 static void *
 allocate_to_x (struct call_context *context, struct arg_state *state)
 {
-  FFI_ASSERT (state->ngrn < N_X_ARG_REG)
+  FFI_ASSERT (state->ngrn < N_X_ARG_REG);
   return get_x_addr (context, (state->ngrn)++);
 }
 
 static void *
 allocate_to_s (struct call_context *context, struct arg_state *state)
 {
-  FFI_ASSERT (state->nsrn < N_V_ARG_REG)
+  FFI_ASSERT (state->nsrn < N_V_ARG_REG);
   return get_s_addr (context, (state->nsrn)++);
 }
 
 static void *
 allocate_to_d (struct call_context *context, struct arg_state *state)
 {
-  FFI_ASSERT (state->nsrn < N_V_ARG_REG)
+  FFI_ASSERT (state->nsrn < N_V_ARG_REG);
   return get_d_addr (context, (state->nsrn)++);
 }
 
 static void *
 allocate_to_v (struct call_context *context, struct arg_state *state)
 {
-  FFI_ASSERT (state->nsrn < N_V_ARG_REG)
+  FFI_ASSERT (state->nsrn < N_V_ARG_REG);
   return get_v_addr (context, (state->nsrn)++);
 }
 
 /* Allocate an aligned slot on the stack and return a pointer to it.  */
 static void *
-allocate_to_stack (struct arg_state *state, void *stack, unsigned alignment,
-		   unsigned size)
+allocate_to_stack (struct arg_state *state, void *stack, size_t alignment,
+		   size_t size)
 {
   void *allocation;
 
@@ -436,7 +484,12 @@
      alignment of the argument's type.  */
   state->nsaa = ALIGN (state->nsaa, alignment);
   state->nsaa = ALIGN (state->nsaa, alignment);
+#if defined (__APPLE__)
+  if (state->allocating_variadic)
+    state->nsaa = ALIGN (state->nsaa, 8);
+#else
   state->nsaa = ALIGN (state->nsaa, 8);
+#endif
 
   allocation = stack + state->nsaa;
 
@@ -447,7 +500,7 @@
 static void
 copy_basic_type (void *dest, void *source, unsigned short type)
 {
-  /* This is neccessary to ensure that basic types are copied
+  /* This is necessary to ensure that basic types are copied
      sign extended to 64-bits as libffi expects.  */
   switch (type)
     {
@@ -457,9 +510,11 @@
     case FFI_TYPE_DOUBLE:
       *(double *) dest = *(double *) source;
       break;
+#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
     case FFI_TYPE_LONGDOUBLE:
       *(long double *) dest = *(long double *) source;
       break;
+#endif
     case FFI_TYPE_UINT8:
       *(ffi_arg *) dest = *(UINT8 *) source;
       break;
@@ -486,6 +541,8 @@
     case FFI_TYPE_SINT64:
       *(ffi_sarg *) dest = *(SINT64 *) source;
       break;
+    case FFI_TYPE_VOID:
+      break;
 
     default:
       FFI_ASSERT (0);
@@ -514,7 +571,6 @@
     {
       int i;
       unsigned short type = get_homogeneous_type (ty);
-      unsigned elems = element_count (ty);
       for (i = 0; i < elems; i++)
 	{
 	  void *reg = allocate_to_v (context, state);
@@ -548,11 +604,13 @@
 	return allocate_to_d (context, state);
       state->nsrn = N_V_ARG_REG;
       break;
+#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
     case FFI_TYPE_LONGDOUBLE:
       if (state->nsrn < N_V_ARG_REG)
 	return allocate_to_v (context, state);
       state->nsrn = N_V_ARG_REG;
       break;
+#endif
     case FFI_TYPE_UINT8:
     case FFI_TYPE_SINT8:
     case FFI_TYPE_UINT16:
@@ -615,7 +673,9 @@
 	   appropriate register, or if none are available, to the stack.  */
 	case FFI_TYPE_FLOAT:
 	case FFI_TYPE_DOUBLE:
+#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
 	case FFI_TYPE_LONGDOUBLE:
+#endif
 	case FFI_TYPE_UINT8:
 	case FFI_TYPE_SINT8:
 	case FFI_TYPE_UINT16:
@@ -676,6 +736,16 @@
 	  FFI_ASSERT (0);
 	  break;
 	}
+
+#if defined (__APPLE__)
+      if (i + 1 == ecif->cif->aarch64_nfixedargs)
+	{
+	  state.ngrn = N_X_ARG_REG;
+	  state.nsrn = N_V_ARG_REG;
+
+	  state.allocating_variadic = 1;
+	}
+#endif
     }
 
   return ecif->cif->aarch64_flags;
@@ -712,6 +782,20 @@
   return FFI_OK;
 }
 
+#if defined (__APPLE__)
+
+/* Perform Apple-specific cif processing for variadic calls */
+ffi_status ffi_prep_cif_machdep_var(ffi_cif *cif,
+				    unsigned int nfixedargs,
+				    unsigned int ntotalargs)
+{
+  cif->aarch64_nfixedargs = nfixedargs;
+
+  return ffi_prep_cif_machdep(cif);
+}
+
+#endif
+
 /* Call a function with the provided arguments and capture the return
    value.  */
 void
@@ -728,7 +812,7 @@
     case FFI_SYSV:
       {
         struct call_context context;
-	unsigned stack_bytes;
+	size_t stack_bytes;
 
 	/* Figure out the total amount of stack space we need, the
 	   above call frame space needs to be 16 bytes aligned to
@@ -745,7 +829,9 @@
               case FFI_TYPE_VOID:
               case FFI_TYPE_FLOAT:
               case FFI_TYPE_DOUBLE:
+#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
               case FFI_TYPE_LONGDOUBLE:
+#endif
               case FFI_TYPE_UINT8:
               case FFI_TYPE_SINT8:
               case FFI_TYPE_UINT16:
@@ -778,7 +864,7 @@
 		  }
                 else if ((cif->rtype->size + 7) / 8 < N_X_ARG_REG)
                   {
-                    unsigned size = ALIGN (cif->rtype->size, sizeof (UINT64));
+                    size_t size = ALIGN (cif->rtype->size, sizeof (UINT64));
                     memcpy (rvalue, get_x_addr (&context, 0), size);
                   }
                 else
@@ -824,7 +910,7 @@
     memcpy (__tramp + 12, &__fun, sizeof (__fun));			\
     memcpy (__tramp + 20, &__ctx, sizeof (__ctx));			\
     memcpy (__tramp + 28, &__flags, sizeof (__flags));			\
-    __clear_cache(__tramp, __tramp + FFI_TRAMPOLINE_SIZE);		\
+    ffi_clear_cache(__tramp, __tramp + FFI_TRAMPOLINE_SIZE);		\
   })
 
 ffi_status
@@ -857,13 +943,13 @@
    the stack at the point ffi_closure_SYSV() was invoked.
 
    On the return path the assembler wrapper will reload call context
-   regsiters.
+   registers.
 
    ffi_closure_SYSV_inner() marshalls the call context into ffi value
-   desriptors, invokes the wrapped function, then marshalls the return
+   descriptors, invokes the wrapped function, then marshalls the return
    value back into the call context.  */
 
-void
+void FFI_HIDDEN
 ffi_closure_SYSV_inner (ffi_closure *closure, struct call_context *context,
 			void *stack)
 {
@@ -897,10 +983,12 @@
 	case FFI_TYPE_SINT64:
 	case  FFI_TYPE_FLOAT:
 	case  FFI_TYPE_DOUBLE:
+#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
 	case  FFI_TYPE_LONGDOUBLE:
 	  avalue[i] = allocate_to_register_or_stack (context, stack,
 						     &state, ty->type);
 	  break;
+#endif
 
 	case FFI_TYPE_STRUCT:
 	  if (is_hfa (ty))
@@ -924,7 +1012,7 @@
 			   therefore the structure is not represented as
 			   a contiguous sequence of bytes in our saved
 			   register context. We need to fake up a copy
-			   of the structure layed out in memory
+			   of the structure laid out in memory
 			   correctly. The fake can be tossed once the
 			   closure function has returned hence alloca()
 			   is sufficient. */
@@ -945,7 +1033,7 @@
 			   therefore the structure is not represented as
 			   a contiguous sequence of bytes in our saved
 			   register context. We need to fake up a copy
-			   of the structure layed out in memory
+			   of the structure laid out in memory
 			   correctly. The fake can be tossed once the
 			   closure function has returned hence alloca()
 			   is sufficient. */
@@ -958,11 +1046,13 @@
 			break;
 		      }
 
+#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
 		    case FFI_TYPE_LONGDOUBLE:
 			  memcpy (&avalue[i],
 				  allocate_to_v (context, &state),
 				  sizeof (*avalue));
 		      break;
+#endif
 
 		    default:
 		      FFI_ASSERT (0);
@@ -1033,7 +1123,9 @@
         case FFI_TYPE_SINT64:
         case FFI_TYPE_FLOAT:
         case FFI_TYPE_DOUBLE:
+#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
         case FFI_TYPE_LONGDOUBLE:
+#endif
 	  {
 	    void *addr = get_basic_type_addr (cif->rtype->type, context, 0);
 	    copy_basic_type (addr, rvalue, cif->rtype->type);
@@ -1042,19 +1134,19 @@
         case FFI_TYPE_STRUCT:
           if (is_hfa (cif->rtype))
 	    {
-	      int i;
+	      int j;
 	      unsigned short type = get_homogeneous_type (cif->rtype);
 	      unsigned elems = element_count (cif->rtype);
-	      for (i = 0; i < elems; i++)
+	      for (j = 0; j < elems; j++)
 		{
-		  void *reg = get_basic_type_addr (type, context, i);
+		  void *reg = get_basic_type_addr (type, context, j);
 		  copy_basic_type (reg, rvalue, type);
 		  rvalue += get_basic_type_size (type);
 		}
 	    }
           else if ((cif->rtype->size + 7) / 8 < N_X_ARG_REG)
             {
-              unsigned size = ALIGN (cif->rtype->size, sizeof (UINT64)) ;
+              size_t size = ALIGN (cif->rtype->size, sizeof (UINT64)) ;
               memcpy (get_x_addr (context, 0), rvalue, size);
             }
           else
diff --git a/Modules/_ctypes/libffi/src/aarch64/ffitarget.h b/Modules/_ctypes/libffi/src/aarch64/ffitarget.h
index 6f1a348..4bbced2 100644
--- a/Modules/_ctypes/libffi/src/aarch64/ffitarget.h
+++ b/Modules/_ctypes/libffi/src/aarch64/ffitarget.h
@@ -47,8 +47,12 @@
 
 /* ---- Internal ---- */
 
-
+#if defined (__APPLE__)
+#define FFI_TARGET_SPECIFIC_VARIADIC
+#define FFI_EXTRA_CIF_FIELDS unsigned aarch64_flags; unsigned aarch64_nfixedargs
+#else
 #define FFI_EXTRA_CIF_FIELDS unsigned aarch64_flags
+#endif
 
 #define AARCH64_FFI_WITH_V_BIT 0
 
diff --git a/Modules/_ctypes/libffi/src/aarch64/sysv.S b/Modules/_ctypes/libffi/src/aarch64/sysv.S
index b8cd421..169eab8 100644
--- a/Modules/_ctypes/libffi/src/aarch64/sysv.S
+++ b/Modules/_ctypes/libffi/src/aarch64/sysv.S
@@ -23,14 +23,33 @@
 #include <fficonfig.h>
 #include <ffi.h>
 
+#ifdef HAVE_MACHINE_ASM_H
+#include <machine/asm.h>
+#else
+#ifdef __USER_LABEL_PREFIX__
+#define CONCAT1(a, b) CONCAT2(a, b)
+#define CONCAT2(a, b) a ## b
+
+/* Use the right prefix for global labels.  */
+#define CNAME(x) CONCAT1 (__USER_LABEL_PREFIX__, x)
+#else
+#define CNAME(x) x
+#endif
+#endif
+
 #define cfi_adjust_cfa_offset(off)	.cfi_adjust_cfa_offset off
 #define cfi_rel_offset(reg, off)	.cfi_rel_offset reg, off
 #define cfi_restore(reg)		.cfi_restore reg
 #define cfi_def_cfa_register(reg)	.cfi_def_cfa_register reg
 
         .text
-        .globl ffi_call_SYSV
-        .type ffi_call_SYSV, #function
+        .globl CNAME(ffi_call_SYSV)
+#ifdef __ELF__
+        .type CNAME(ffi_call_SYSV), #function
+#endif
+#ifdef __APPLE__
+        .align 2
+#endif
 
 /* ffi_call_SYSV()
 
@@ -53,7 +72,7 @@
 			   extended_cif *),
                   struct call_context *context,
                   extended_cif *,
-                  unsigned required_stack_size,
+                  size_t required_stack_size,
                   void (*fn)(void));
 
    Therefore on entry we have:
@@ -82,7 +101,7 @@
 #define ffi_call_SYSV_FS (8 * 4)
 
         .cfi_startproc
-ffi_call_SYSV:
+CNAME(ffi_call_SYSV):
         stp     x29, x30, [sp, #-16]!
 	cfi_adjust_cfa_offset (16)
         cfi_rel_offset (x29, 0)
@@ -92,11 +111,11 @@
 	cfi_def_cfa_register (x29)
         sub     sp, sp, #ffi_call_SYSV_FS
 
-        stp     x21, x22, [sp, 0]
+        stp     x21, x22, [sp, #0]
         cfi_rel_offset (x21, 0 - ffi_call_SYSV_FS)
         cfi_rel_offset (x22, 8 - ffi_call_SYSV_FS)
 
-        stp     x23, x24, [sp, 16]
+        stp     x23, x24, [sp, #16]
         cfi_rel_offset (x23, 16 - ffi_call_SYSV_FS)
         cfi_rel_offset (x24, 24 - ffi_call_SYSV_FS)
 
@@ -180,7 +199,9 @@
         ret
 
         .cfi_endproc
-        .size ffi_call_SYSV, .-ffi_call_SYSV
+#ifdef __ELF__
+        .size CNAME(ffi_call_SYSV), .-CNAME(ffi_call_SYSV)
+#endif
 
 #define ffi_closure_SYSV_FS (8 * 2 + AARCH64_CALL_CONTEXT_SIZE)
 
@@ -222,22 +243,25 @@
    Voila!  */
 
         .text
-        .globl ffi_closure_SYSV
+        .globl CNAME(ffi_closure_SYSV)
+#ifdef __APPLE__
+        .align 2
+#endif
         .cfi_startproc
-ffi_closure_SYSV:
+CNAME(ffi_closure_SYSV):
         stp     x29, x30, [sp, #-16]!
 	cfi_adjust_cfa_offset (16)
         cfi_rel_offset (x29, 0)
         cfi_rel_offset (x30, 8)
 
         mov     x29, sp
+        cfi_def_cfa_register (x29)
 
         sub     sp, sp, #ffi_closure_SYSV_FS
-	cfi_adjust_cfa_offset (ffi_closure_SYSV_FS)
 
         stp     x21, x22, [x29, #-16]
-        cfi_rel_offset (x21, 0)
-        cfi_rel_offset (x22, 8)
+        cfi_rel_offset (x21, -16)
+        cfi_rel_offset (x22, -8)
 
         /* Load x21 with &call_context.  */
         mov     x21, sp
@@ -270,7 +294,7 @@
            trampoline was called.  */
         add     x2, x29, #16
 
-        bl      ffi_closure_SYSV_inner
+        bl      CNAME(ffi_closure_SYSV_inner)
 
         /* Figure out if we should touch the vector registers.  */
         ldr     x0, [x22, #8]
@@ -287,7 +311,7 @@
         ldp     x2, x3, [x21, #16]
         ldp     x4, x5, [x21, #32]
         ldp     x6, x7, [x21, #48]
-        /* Note nothing usefull is returned in x8.  */
+        /* Note nothing useful is returned in x8.  */
 
         /* We are done, unwind our frame.  */
         ldp     x21, x22, [x29,  #-16]
@@ -295,7 +319,7 @@
         cfi_restore (x22)
 
         mov     sp, x29
-	cfi_adjust_cfa_offset (-ffi_closure_SYSV_FS)
+        cfi_def_cfa_register (sp)
 
         ldp     x29, x30, [sp], #16
 	cfi_adjust_cfa_offset (-16)
@@ -304,4 +328,6 @@
 
         ret
         .cfi_endproc
-        .size ffi_closure_SYSV, .-ffi_closure_SYSV
+#ifdef __ELF__
+        .size CNAME(ffi_closure_SYSV), .-CNAME(ffi_closure_SYSV)
+#endif
diff --git a/Modules/_ctypes/libffi/src/arc/arcompact.S b/Modules/_ctypes/libffi/src/arc/arcompact.S
new file mode 100644
index 0000000..03715fd
--- /dev/null
+++ b/Modules/_ctypes/libffi/src/arc/arcompact.S
@@ -0,0 +1,135 @@
+/* -----------------------------------------------------------------------
+   arcompact.S - Copyright (c) 2013 Synposys, Inc. (www.synopsys.com)
+   
+   ARCompact Foreign Function Interface 
+
+   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 RENESAS TECHNOLOGY 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.
+   ----------------------------------------------------------------------- */
+
+#define LIBFFI_ASM
+#include <fficonfig.h>
+#include <ffi.h>
+#ifdef HAVE_MACHINE_ASM_H
+#include <machine/asm.h>
+#else
+#define CNAME(x) x
+#define ENTRY(x) .globl CNAME(x)` .type CNAME(x),%function` CNAME(x):
+#endif
+
+.text
+
+        /* R0:   ffi_prep_args */
+        /* R1:   &ecif */
+        /* R2:   cif->bytes */
+        /* R3:   fig->flags */
+        /* R4:   ecif.rvalue */
+        /* R5:   fn */
+ENTRY(ffi_call_ARCompact)
+        /* Save registers.  */
+        st.a       fp, [sp, -4]        /* fp + 20, fp */
+        push_s     blink               /* fp + 16, blink */
+        st.a       r4, [sp, -4]        /* fp + 12, ecif.rvalue */
+        push_s     r3                  /* fp +  8, fig->flags */
+        st.a       r5, [sp, -4]        /* fp +  4, fn */
+        push_s     r2                  /* fp +  0, cif->bytes */
+        mov        fp, sp
+
+        /* Make room for all of the new args.  */
+        sub        sp, sp, r2
+
+        /* Place all of the ffi_prep_args in position.  */
+        /* ffi_prep_args(char *stack, extended_cif *ecif) */
+        /* R1 already set.  */
+
+        /* And call.  */
+        jl_s.d     [r0]
+        mov_s      r0, sp
+
+        ld.ab      r12, [fp, 4]        /* cif->bytes */
+        ld.ab      r11, [fp, 4]        /* fn */
+
+        /* Move first 8 parameters in registers...  */
+        ld_s       r0, [sp]
+        ld_s       r1, [sp, 4]
+        ld_s       r2, [sp, 8]
+        ld_s       r3, [sp, 12]
+        ld         r4, [sp, 16]
+        ld         r5, [sp, 20]
+        ld         r6, [sp, 24]
+        ld         r7, [sp, 28]
+
+        /* ...and adjust the stack.  */
+        min        r12, r12, 32
+
+        /* Call the function.  */
+        jl.d       [r11]
+        add        sp, sp, r12 
+
+        mov        sp, fp        
+        pop_s      r3        /* fig->flags, return type */
+        pop_s      r2        /* ecif.rvalue, pointer for return value */
+
+        /* If the return value pointer is NULL, assume no return value.  */
+        breq.d     r2, 0, epilogue
+        pop_s      blink
+
+        /* Return INT.  */
+        brne       r3, FFI_TYPE_INT, return_double
+        b.d        epilogue
+        st_s       r0, [r2]        
+
+return_double:
+        brne       r3, FFI_TYPE_DOUBLE, epilogue
+        st_s       r0, [r2]        
+        st_s       r1, [r2,4]
+
+epilogue:
+        j_s.d      [blink]
+        ld.ab      fp, [sp, 4]
+
+ENTRY(ffi_closure_ARCompact)
+        st.a       r0, [sp, -32]
+        st_s       r1, [sp, 4]
+        st_s       r2, [sp, 8]
+        st_s       r3, [sp, 12]
+        st         r4, [sp, 16]
+        st         r5, [sp, 20]
+        st         r6, [sp, 24]
+        st         r7, [sp, 28]
+
+        /* pointer to arguments */
+        mov_s      r2, sp
+
+        /* return value goes here */
+        sub        sp, sp, 8
+        mov_s      r1, sp
+
+        push_s     blink
+        
+        bl.d       ffi_closure_inner_ARCompact
+        mov_s      r0, r8                /* codeloc, set by trampoline */
+
+        pop_s      blink
+
+        /* set return value to r1:r0 */
+        pop_s      r0
+        pop_s      r1
+        j_s.d      [blink]
+        add_s      sp, sp, 32
diff --git a/Modules/_ctypes/libffi/src/arc/ffi.c b/Modules/_ctypes/libffi/src/arc/ffi.c
new file mode 100644
index 0000000..32f82a7
--- /dev/null
+++ b/Modules/_ctypes/libffi/src/arc/ffi.c
@@ -0,0 +1,268 @@
+/* -----------------------------------------------------------------------
+   ffi.c - Copyright (c) 2013  Synopsys, Inc. (www.synopsys.com)
+   
+   ARC Foreign Function Interface 
+
+   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 RENESAS TECHNOLOGY 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.
+   ----------------------------------------------------------------------- */
+
+#include <ffi.h>
+#include <ffi_common.h>
+
+#include <stdlib.h>
+#include <stdint.h>
+
+#include <sys/cachectl.h>
+
+/* for little endian ARC, the code is in fact stored as mixed endian for
+   performance reasons */
+#if __BIG_ENDIAN__
+#define CODE_ENDIAN(x) (x)
+#else
+#define CODE_ENDIAN(x) ( (((uint32_t) (x)) << 16) | (((uint32_t) (x)) >> 16))
+#endif
+
+/* ffi_prep_args is called by the assembly routine once stack
+   space has been allocated for the function's arguments.  */
+
+void
+ffi_prep_args (char *stack, extended_cif * ecif)
+{
+  unsigned int i;
+  int tmp;
+  void **p_argv;
+  char *argp;
+  ffi_type **p_arg;
+
+  tmp = 0;
+  argp = stack;
+
+  if (ecif->cif->rtype->type == FFI_TYPE_STRUCT)
+    {
+      *(void **) argp = ecif->rvalue;
+      argp += 4;
+    }
+
+  p_argv = ecif->avalue;
+
+  for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types;
+       (i != 0); i--, p_arg++)
+    {
+      size_t z;
+      int alignment;
+
+      /* align alignment to 4 */
+      alignment = (((*p_arg)->alignment - 1) | 3) + 1;
+
+      /* Align if necessary.  */
+      if ((alignment - 1) & (unsigned) argp)
+	argp = (char *) ALIGN (argp, alignment);
+
+      z = (*p_arg)->size;
+      if (z < sizeof (int))
+	{
+	  z = sizeof (int);
+
+	  switch ((*p_arg)->type)
+	    {
+	    case FFI_TYPE_SINT8:
+	      *(signed int *) argp = (signed int) *(SINT8 *) (*p_argv);
+	      break;
+
+	    case FFI_TYPE_UINT8:
+	      *(unsigned int *) argp = (unsigned int) *(UINT8 *) (*p_argv);
+	      break;
+
+	    case FFI_TYPE_SINT16:
+	      *(signed int *) argp = (signed int) *(SINT16 *) (*p_argv);
+	      break;
+
+	    case FFI_TYPE_UINT16:
+	      *(unsigned int *) argp = (unsigned int) *(UINT16 *) (*p_argv);
+	      break;
+
+	    case FFI_TYPE_STRUCT:
+	      memcpy (argp, *p_argv, (*p_arg)->size);
+	      break;
+
+	    default:
+	      FFI_ASSERT (0);
+	    }
+	}
+      else if (z == sizeof (int))
+	{
+	  *(unsigned int *) argp = (unsigned int) *(UINT32 *) (*p_argv);
+	}
+      else
+	{
+	  if ((*p_arg)->type == FFI_TYPE_STRUCT)
+	    {
+	      memcpy (argp, *p_argv, z);
+	    }
+	  else
+	    {
+	      /* Double or long long 64bit.  */
+	      memcpy (argp, *p_argv, z);
+	    }
+	}
+      p_argv++;
+      argp += z;
+    }
+
+  return;
+}
+
+/* Perform machine dependent cif processing.  */
+ffi_status
+ffi_prep_cif_machdep (ffi_cif * cif)
+{
+  /* Set the return type flag.  */
+  switch (cif->rtype->type)
+    {
+    case FFI_TYPE_VOID:
+      cif->flags = (unsigned) cif->rtype->type;
+      break;
+
+    case FFI_TYPE_STRUCT:
+      cif->flags = (unsigned) cif->rtype->type;
+      break;
+
+    case FFI_TYPE_SINT64:
+    case FFI_TYPE_UINT64:
+    case FFI_TYPE_DOUBLE:
+      cif->flags = FFI_TYPE_DOUBLE;
+      break;
+
+    case FFI_TYPE_FLOAT:
+    default:
+      cif->flags = FFI_TYPE_INT;
+      break;
+    }
+
+  return FFI_OK;
+}
+
+extern void ffi_call_ARCompact (void (*)(char *, extended_cif *),
+				extended_cif *, unsigned, unsigned,
+				unsigned *, void (*fn) (void));
+
+void
+ffi_call (ffi_cif * cif, void (*fn) (void), void *rvalue, void **avalue)
+{
+  extended_cif ecif;
+
+  ecif.cif = cif;
+  ecif.avalue = avalue;
+
+  /* If the return value is a struct and we don't have
+     a return value address then we need to make one.  */
+  if ((rvalue == NULL) && (cif->rtype->type == FFI_TYPE_STRUCT))
+    {
+      ecif.rvalue = alloca (cif->rtype->size);
+    }
+  else
+    ecif.rvalue = rvalue;
+
+  switch (cif->abi)
+    {
+    case FFI_ARCOMPACT:
+      ffi_call_ARCompact (ffi_prep_args, &ecif, cif->bytes,
+			  cif->flags, ecif.rvalue, fn);
+      break;
+
+    default:
+      FFI_ASSERT (0);
+      break;
+    }
+}
+
+int
+ffi_closure_inner_ARCompact (ffi_closure * closure, void *rvalue,
+			     ffi_arg * args)
+{
+  void **arg_area, **p_argv;
+  ffi_cif *cif = closure->cif;
+  char *argp = (char *) args;
+  ffi_type **p_argt;
+  int i;
+
+  arg_area = (void **) alloca (cif->nargs * sizeof (void *));
+
+  /* handle hidden argument */
+  if (cif->flags == FFI_TYPE_STRUCT)
+    {
+      rvalue = *(void **) argp;
+      argp += 4;
+    }
+
+  p_argv = arg_area;
+
+  for (i = 0, p_argt = cif->arg_types; i < cif->nargs;
+       i++, p_argt++, p_argv++)
+    {
+      size_t z;
+      int alignment;
+
+      /* align alignment to 4 */
+      alignment = (((*p_argt)->alignment - 1) | 3) + 1;
+
+      /* Align if necessary.  */
+      if ((alignment - 1) & (unsigned) argp)
+	argp = (char *) ALIGN (argp, alignment);
+
+      z = (*p_argt)->size;
+      *p_argv = (void *) argp;
+      argp += z;
+    }
+
+  (closure->fun) (cif, rvalue, arg_area, closure->user_data);
+
+  return cif->flags;
+}
+
+extern void ffi_closure_ARCompact (void);
+
+ffi_status
+ffi_prep_closure_loc (ffi_closure * closure, ffi_cif * cif,
+		      void (*fun) (ffi_cif *, void *, void **, void *),
+		      void *user_data, void *codeloc)
+{
+  uint32_t *tramp = (uint32_t *) & (closure->tramp[0]);
+
+  switch (cif->abi)
+    {
+    case FFI_ARCOMPACT:
+      FFI_ASSERT (tramp == codeloc);
+      tramp[0] = CODE_ENDIAN (0x200a1fc0);	/* mov r8, pcl  */
+      tramp[1] = CODE_ENDIAN (0x20200f80);	/* j [long imm] */
+      tramp[2] = CODE_ENDIAN (ffi_closure_ARCompact);
+      break;
+
+    default:
+      return FFI_BAD_ABI;
+    }
+
+  closure->cif = cif;
+  closure->fun = fun;
+  closure->user_data = user_data;
+  cacheflush (codeloc, FFI_TRAMPOLINE_SIZE, BCACHE);
+
+  return FFI_OK;
+}
diff --git a/Modules/_ctypes/libffi/src/arc/ffitarget.h b/Modules/_ctypes/libffi/src/arc/ffitarget.h
new file mode 100644
index 0000000..bf8311b
--- /dev/null
+++ b/Modules/_ctypes/libffi/src/arc/ffitarget.h
@@ -0,0 +1,53 @@
+/* -----------------------------------------------------------------------
+   ffitarget.h - Copyright (c) 2012  Anthony Green
+                 Copyright (c) 2013  Synopsys, Inc. (www.synopsys.com)
+   Target configuration macros for ARC.
+
+   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 RENESAS TECHNOLOGY 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.
+
+   ----------------------------------------------------------------------- */
+
+#ifndef LIBFFI_TARGET_H
+#define LIBFFI_TARGET_H
+
+#ifndef LIBFFI_H
+#error "Please do not include ffitarget.h directly into your source.  Use ffi.h instead."
+#endif
+
+/* ---- Generic type definitions ----------------------------------------- */
+
+#ifndef LIBFFI_ASM
+typedef unsigned long ffi_arg;
+typedef signed long ffi_sarg;
+
+typedef enum ffi_abi
+{
+  FFI_FIRST_ABI = 0,
+  FFI_ARCOMPACT,
+  FFI_LAST_ABI,
+  FFI_DEFAULT_ABI = FFI_ARCOMPACT
+} ffi_abi;
+#endif
+
+#define FFI_CLOSURES 		1
+#define FFI_TRAMPOLINE_SIZE	12
+#define FFI_NATIVE_RAW_API 	0
+
+#endif
diff --git a/Modules/_ctypes/libffi/src/arm/ffi.c b/Modules/_ctypes/libffi/src/arm/ffi.c
index 7fd7f44..6691ab5 100644
--- a/Modules/_ctypes/libffi/src/arm/ffi.c
+++ b/Modules/_ctypes/libffi/src/arm/ffi.c
@@ -4,8 +4,8 @@
            Copyright (c) 2011 Anthony Green
 	   Copyright (c) 2011 Free Software Foundation
            Copyright (c) 1998, 2008, 2011  Red Hat, Inc.
-	   
-   ARM Foreign Function Interface 
+
+   ARM Foreign Function Interface
 
    Permission is hereby granted, free of charge, to any person obtaining
    a copy of this software and associated documentation files (the
@@ -37,6 +37,87 @@
 static int vfp_type_p (ffi_type *);
 static void layout_vfp_args (ffi_cif *);
 
+int ffi_prep_args_SYSV(char *stack, extended_cif *ecif, float *vfp_space);
+int ffi_prep_args_VFP(char *stack, extended_cif *ecif, float *vfp_space);
+
+static char* ffi_align(ffi_type **p_arg, char *argp)
+{
+  /* Align if necessary */
+  register size_t alignment = (*p_arg)->alignment;
+  if (alignment < 4)
+  {
+    alignment = 4;
+  }
+#ifdef _WIN32_WCE
+  if (alignment > 4)
+  {
+    alignment = 4;
+  }
+#endif
+  if ((alignment - 1) & (unsigned) argp)
+  {
+    argp = (char *) ALIGN(argp, alignment);
+  }
+
+  if ((*p_arg)->type == FFI_TYPE_STRUCT)
+  {
+    argp = (char *) ALIGN(argp, 4);
+  }
+  return argp;
+}
+
+static size_t ffi_put_arg(ffi_type **arg_type, void **arg, char *stack)
+{
+	register char* argp = stack;
+	register ffi_type **p_arg = arg_type;
+	register void **p_argv = arg;
+	register size_t z = (*p_arg)->size;
+  if (z < sizeof(int))
+    {
+		z = sizeof(int);
+		switch ((*p_arg)->type)
+      {
+      case FFI_TYPE_SINT8:
+        *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv);
+        break;
+        
+      case FFI_TYPE_UINT8:
+        *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv);
+        break;
+        
+      case FFI_TYPE_SINT16:
+        *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv);
+        break;
+        
+      case FFI_TYPE_UINT16:
+        *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv);
+        break;
+        
+      case FFI_TYPE_STRUCT:
+        memcpy(argp, *p_argv, (*p_arg)->size);
+        break;
+
+      default:
+        FFI_ASSERT(0);
+      }
+    }
+  else if (z == sizeof(int))
+    {
+		if ((*p_arg)->type == FFI_TYPE_FLOAT)
+			*(float *) argp = *(float *)(* p_argv);
+		else
+			*(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv);
+    }
+	else if (z == sizeof(double) && (*p_arg)->type == FFI_TYPE_DOUBLE)
+		{
+			*(double *) argp = *(double *)(* p_argv);
+		}
+  else
+    {
+      memcpy(argp, *p_argv, z);
+    }
+  return z;
+}
 /* ffi_prep_args is called by the assembly routine once stack space
    has been allocated for the function's arguments
    
@@ -44,14 +125,14 @@
    value is cif->vfp_used (word bitset of VFP regs used for passing
    arguments). These are only used for the VFP hard-float ABI.
 */
-int ffi_prep_args(char *stack, extended_cif *ecif, float *vfp_space)
+int ffi_prep_args_SYSV(char *stack, extended_cif *ecif, float *vfp_space)
 {
-  register unsigned int i, vi = 0;
+  register unsigned int i;
   register void **p_argv;
   register char *argp;
   register ffi_type **p_arg;
-
   argp = stack;
+  
 
   if ( ecif->cif->flags == FFI_TYPE_STRUCT ) {
     *(void **) argp = ecif->rvalue;
@@ -62,81 +143,89 @@
 
   for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types;
        (i != 0);
-       i--, p_arg++)
+       i--, p_arg++, p_argv++)
     {
-      size_t z;
-      size_t alignment;
-
-      /* Allocated in VFP registers. */
-      if (ecif->cif->abi == FFI_VFP
-	  && vi < ecif->cif->vfp_nargs && vfp_type_p (*p_arg))
-	{
-	  float* vfp_slot = vfp_space + ecif->cif->vfp_args[vi++];
-	  if ((*p_arg)->type == FFI_TYPE_FLOAT)
-	    *((float*)vfp_slot) = *((float*)*p_argv);
-	  else if ((*p_arg)->type == FFI_TYPE_DOUBLE)
-	    *((double*)vfp_slot) = *((double*)*p_argv);
-	  else
-	    memcpy(vfp_slot, *p_argv, (*p_arg)->size);
-	  p_argv++;
-	  continue;
-	}
-
-      /* Align if necessary */
-      alignment = (*p_arg)->alignment;
-#ifdef _WIN32_WCE
-      if (alignment > 4)
-	alignment = 4;
-#endif
-      if ((alignment - 1) & (unsigned) argp) {
-	argp = (char *) ALIGN(argp, alignment);
-      }
-
-      if ((*p_arg)->type == FFI_TYPE_STRUCT)
-	argp = (char *) ALIGN(argp, 4);
-
-	  z = (*p_arg)->size;
-	  if (z < sizeof(int))
-	    {
-	      z = sizeof(int);
-	      switch ((*p_arg)->type)
-		{
-		case FFI_TYPE_SINT8:
-		  *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv);
-		  break;
-		  
-		case FFI_TYPE_UINT8:
-		  *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv);
-		  break;
-		  
-		case FFI_TYPE_SINT16:
-		  *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv);
-		  break;
-		  
-		case FFI_TYPE_UINT16:
-		  *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv);
-		  break;
-		  
-		case FFI_TYPE_STRUCT:
-		  memcpy(argp, *p_argv, (*p_arg)->size);
-		  break;
-
-		default:
-		  FFI_ASSERT(0);
-		}
-	    }
-	  else if (z == sizeof(int))
-	    {
-	      *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv);
-	    }
-	  else
-	    {
-	      memcpy(argp, *p_argv, z);
-	    }
-	  p_argv++;
-	  argp += z;
+    argp = ffi_align(p_arg, argp);
+    argp += ffi_put_arg(p_arg, p_argv, argp);
     }
 
+  return 0;
+}
+
+int ffi_prep_args_VFP(char *stack, extended_cif *ecif, float *vfp_space)
+{
+  register unsigned int i, vi = 0;
+  register void **p_argv;
+  register char *argp, *regp, *eo_regp;
+  register ffi_type **p_arg;
+  char stack_used = 0;
+  char done_with_regs = 0;
+  char is_vfp_type;
+
+  // make sure we are using FFI_VFP
+  FFI_ASSERT(ecif->cif->abi == FFI_VFP);
+
+  /* the first 4 words on the stack are used for values passed in core
+   * registers. */
+  regp = stack;
+  eo_regp = argp = regp + 16;
+  
+
+  /* if the function returns an FFI_TYPE_STRUCT in memory, that address is
+   * passed in r0 to the function */
+  if ( ecif->cif->flags == FFI_TYPE_STRUCT ) {
+    *(void **) regp = ecif->rvalue;
+    regp += 4;
+  }
+
+  p_argv = ecif->avalue;
+
+  for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types;
+       (i != 0);
+       i--, p_arg++, p_argv++)
+    {
+      is_vfp_type = vfp_type_p (*p_arg);
+
+      /* Allocated in VFP registers. */
+      if(vi < ecif->cif->vfp_nargs && is_vfp_type)
+        {
+          char *vfp_slot = (char *)(vfp_space + ecif->cif->vfp_args[vi++]);
+          ffi_put_arg(p_arg, p_argv, vfp_slot);
+          continue;
+        }
+      /* Try allocating in core registers. */
+      else if (!done_with_regs && !is_vfp_type)
+        {
+          char *tregp = ffi_align(p_arg, regp);
+          size_t size = (*p_arg)->size; 
+          size = (size < 4)? 4 : size; // pad
+          /* Check if there is space left in the aligned register area to place
+           * the argument */
+          if(tregp + size <= eo_regp)
+            {
+              regp = tregp + ffi_put_arg(p_arg, p_argv, tregp);
+              done_with_regs = (regp == argp);
+              // ensure we did not write into the stack area
+              FFI_ASSERT(regp <= argp);
+              continue;
+            }
+          /* In case there are no arguments in the stack area yet, 
+          the argument is passed in the remaining core registers and on the
+          stack. */
+          else if (!stack_used) 
+            {
+              stack_used = 1;
+              done_with_regs = 1;
+              argp = tregp + ffi_put_arg(p_arg, p_argv, tregp);
+              FFI_ASSERT(eo_regp < argp);
+              continue;
+            }
+        }
+      /* Base case, arguments are passed on the stack */
+      stack_used = 1;
+      argp = ffi_align(p_arg, argp);
+      argp += ffi_put_arg(p_arg, p_argv, argp);
+    }
   /* Indicate the VFP registers used. */
   return ecif->cif->vfp_used;
 }
@@ -227,7 +316,7 @@
   ecif.avalue = avalue;
 
   /* If the return value is a struct and we don't have a return	*/
-  /* value address then we need to make one		        */
+  /* value address then we need to make one			*/
 
   if ((rvalue == NULL) && 
       (cif->flags == FFI_TYPE_STRUCT))
@@ -261,9 +350,17 @@
       break;
     }
   if (small_struct)
-    memcpy (rvalue, &temp, cif->rtype->size);
+    {
+      FFI_ASSERT(rvalue != NULL);
+      memcpy (rvalue, &temp, cif->rtype->size);
+    }
+    
   else if (vfp_struct)
-    memcpy (rvalue, ecif.rvalue, cif->rtype->size);
+    {
+      FFI_ASSERT(rvalue != NULL);
+      memcpy (rvalue, ecif.rvalue, cif->rtype->size);
+    }
+    
 }
 
 /** private members **/
@@ -271,18 +368,18 @@
 static void ffi_prep_incoming_args_SYSV (char *stack, void **ret,
 					 void** args, ffi_cif* cif, float *vfp_stack);
 
+static void ffi_prep_incoming_args_VFP (char *stack, void **ret,
+					 void** args, ffi_cif* cif, float *vfp_stack);
+
 void ffi_closure_SYSV (ffi_closure *);
 
 void ffi_closure_VFP (ffi_closure *);
 
 /* This function is jumped to by the trampoline */
 
-unsigned int
-ffi_closure_SYSV_inner(
-     ffi_closure *closure,
-     void **respp,
-     void *args,
-     void *vfp_args)
+unsigned int FFI_HIDDEN
+ffi_closure_inner (ffi_closure *closure, 
+		   void **respp, void *args, void *vfp_args)
 {
   // our various things...
   ffi_cif       *cif;
@@ -296,8 +393,10 @@
    * value on the stack; and if the function returns
    * a structure, it will re-set RESP to point to the
    * structure return address.  */
-
-  ffi_prep_incoming_args_SYSV(args, respp, arg_area, cif, vfp_args);
+  if (cif->abi == FFI_VFP)
+    ffi_prep_incoming_args_VFP(args, respp, arg_area, cif, vfp_args);
+  else
+    ffi_prep_incoming_args_SYSV(args, respp, arg_area, cif, vfp_args);
 
   (closure->fun) (cif, *respp, arg_area, closure->user_data);
 
@@ -312,7 +411,7 @@
 			    float *vfp_stack)
 /*@=exportheader@*/
 {
-  register unsigned int i, vi = 0;
+  register unsigned int i;
   register void **p_argv;
   register char *argp;
   register ffi_type **p_arg;
@@ -329,27 +428,8 @@
   for (i = cif->nargs, p_arg = cif->arg_types; (i != 0); i--, p_arg++)
     {
       size_t z;
-      size_t alignment;
-  
-      if (cif->abi == FFI_VFP
-	  && vi < cif->vfp_nargs && vfp_type_p (*p_arg))
-	{
-	  *p_argv++ = (void*)(vfp_stack + cif->vfp_args[vi++]);
-	  continue;
-	}
 
-      alignment = (*p_arg)->alignment;
-      if (alignment < 4)
-	alignment = 4;
-#ifdef _WIN32_WCE
-      else
-	if (alignment > 4)
-	  alignment = 4;
-#endif
-      /* Align if necessary */
-      if ((alignment - 1) & (unsigned) argp) {
-	argp = (char *) ALIGN(argp, alignment);
-      }
+      argp = ffi_align(p_arg, argp);
 
       z = (*p_arg)->size;
 
@@ -364,6 +444,95 @@
   return;
 }
 
+/*@-exportheader@*/
+static void 
+ffi_prep_incoming_args_VFP(char *stack, void **rvalue,
+			    void **avalue, ffi_cif *cif,
+			    /* Used only under VFP hard-float ABI. */
+			    float *vfp_stack)
+/*@=exportheader@*/
+{
+  register unsigned int i, vi = 0;
+  register void **p_argv;
+  register char *argp, *regp, *eo_regp;
+  register ffi_type **p_arg;
+  char done_with_regs = 0;
+  char stack_used = 0;
+  char is_vfp_type;
+
+  FFI_ASSERT(cif->abi == FFI_VFP);
+  regp = stack;
+  eo_regp = argp = regp + 16;
+
+  if ( cif->flags == FFI_TYPE_STRUCT ) {
+    *rvalue = *(void **) regp;
+    regp += 4;
+  }
+
+  p_argv = avalue;
+
+  for (i = cif->nargs, p_arg = cif->arg_types; (i != 0); i--, p_arg++)
+    {
+    size_t z;
+    is_vfp_type = vfp_type_p (*p_arg); 
+
+    if(vi < cif->vfp_nargs && is_vfp_type)
+      {
+        *p_argv++ = (void*)(vfp_stack + cif->vfp_args[vi++]);
+        continue;
+      }
+    else if (!done_with_regs && !is_vfp_type)
+      {
+        char* tregp = ffi_align(p_arg, regp);
+
+        z = (*p_arg)->size; 
+        z = (z < 4)? 4 : z; // pad
+        
+        /* if the arguments either fits into the registers or uses registers
+         * and stack, while we haven't read other things from the stack */
+        if(tregp + z <= eo_regp || !stack_used) 
+          {
+          /* because we're little endian, this is what it turns into. */
+          *p_argv = (void*) tregp;
+
+          p_argv++;
+          regp = tregp + z;
+          // if we read past the last core register, make sure we have not read
+          // from the stack before and continue reading after regp
+          if(regp > eo_regp)
+            {
+            if(stack_used)
+              {
+                abort(); // we should never read past the end of the register
+                         // are if the stack is already in use
+              }
+            argp = regp;
+            }
+          if(regp >= eo_regp)
+            {
+            done_with_regs = 1;
+            stack_used = 1;
+            }
+          continue;
+          }
+      }
+    stack_used = 1;
+
+    argp = ffi_align(p_arg, argp);
+
+    z = (*p_arg)->size;
+
+    /* because we're little endian, this is what it turns into.   */
+
+    *p_argv = (void*) argp;
+
+    p_argv++;
+    argp += z;
+    }
+  
+  return;
+}
+
 /* How to make a trampoline.  */
 
 extern unsigned int ffi_arm_trampoline[3];
@@ -381,7 +550,7 @@
 typedef struct ffi_trampoline_table_entry ffi_trampoline_table_entry;
 
 struct ffi_trampoline_table {
-  /* contigious writable and executable pages */
+  /* contiguous writable and executable pages */
   vm_address_t config_page;
   vm_address_t trampoline_page;
 
@@ -421,7 +590,7 @@
 {
   ffi_trampoline_table *table = NULL;
 
-  /* Loop until we can allocate two contigious pages */
+  /* Loop until we can allocate two contiguous pages */
   while (table == NULL) {
     vm_address_t config_page = 0x0;
     kern_return_t kt;
@@ -617,7 +786,7 @@
 #endif
   else
     return FFI_BAD_ABI;
-    
+
 #if FFI_EXEC_TRAMPOLINE_TABLE
   void **config = FFI_TRAMPOLINE_CODELOC_CONFIG(codeloc);
   config[0] = closure;
@@ -700,9 +869,9 @@
   return 0;
 }
 
-static void place_vfp_arg (ffi_cif *cif, ffi_type *t)
+static int place_vfp_arg (ffi_cif *cif, ffi_type *t)
 {
-  int reg = cif->vfp_reg_free;
+  short reg = cif->vfp_reg_free;
   int nregs = t->size / sizeof (float);
   int align = ((t->type == FFI_TYPE_STRUCT_VFP_FLOAT
 		|| t->type == FFI_TYPE_FLOAT) ? 1 : 2);
@@ -733,9 +902,13 @@
 	    reg += 1;
 	  cif->vfp_reg_free = reg;
 	}
-      return;
+      return 0;
     next_reg: ;
     }
+  // done, mark all regs as used
+  cif->vfp_reg_free = 16;
+  cif->vfp_used = 0xFFFF;
+  return 1;
 }
 
 static void layout_vfp_args (ffi_cif *cif)
@@ -750,7 +923,9 @@
   for (i = 0; i < cif->nargs; i++)
     {
       ffi_type *t = cif->arg_types[i];
-      if (vfp_type_p (t))
-	place_vfp_arg (cif, t);
+      if (vfp_type_p (t) && place_vfp_arg (cif, t) == 1)
+        {
+          break;
+        }
     }
 }
diff --git a/Modules/_ctypes/libffi/src/arm/gentramp.sh b/Modules/_ctypes/libffi/src/arm/gentramp.sh
index 74f0b86..05c43a3 100755
--- a/Modules/_ctypes/libffi/src/arm/gentramp.sh
+++ b/Modules/_ctypes/libffi/src/arm/gentramp.sh
@@ -84,7 +84,7 @@
 }
 
 
-# WARNING - Don't modify the trampoline code size without also updating the relevent libffi code
+# WARNING - Don't modify the trampoline code size without also updating the relevant libffi code
 trampoline () {
     cat << END
 
diff --git a/Modules/_ctypes/libffi/src/arm/sysv.S b/Modules/_ctypes/libffi/src/arm/sysv.S
index fb38cd6..541bbe9 100644
--- a/Modules/_ctypes/libffi/src/arm/sysv.S
+++ b/Modules/_ctypes/libffi/src/arm/sysv.S
@@ -109,42 +109,27 @@
 #define UNWIND @
 #endif	
 
-	
+.syntax unified
+
 #if defined(__thumb__) && !defined(__THUMB_INTERWORK__)
-.macro	ARM_FUNC_START name
-	.text
-	.align 0
-	.thumb
-	.thumb_func
-#ifdef __APPLE__
-	ENTRY($0)
+#define ARM_FUNC_START(name) \
+	.text; \
+	.align 2; \
+	.thumb; \
+	.thumb_func; \
+	ENTRY(name); \
+	bx pc; \
+	nop; \
+	.arm; \
+	UNWIND .fnstart; \
+_L__##name:
 #else
-	ENTRY(\name)
-#endif
-	bx	pc
-	nop
-	.arm
+#define ARM_FUNC_START(name) \
+	.text; \
+	.align 2; \
+	.arm; \
+	ENTRY(name); \
 	UNWIND .fnstart
-/* A hook to tell gdb that we've switched to ARM mode.  Also used to call
-   directly from other local arm routines.  */
-#ifdef __APPLE__
-_L__$0:
-#else
-_L__\name:
-#endif
-.endm
-#else
-.macro	ARM_FUNC_START name
-	.text
-	.align 0
-	.arm
-#ifdef __APPLE__
-	ENTRY($0)
-#else
-	ENTRY(\name)
-#endif
-	UNWIND .fnstart
-.endm
 #endif
 
 .macro	RETLDM	regs=, cond=, dirn=ia
@@ -171,7 +156,7 @@
 	@ sp+0: ecif.rvalue
 
 	@ This assumes we are using gas.
-ARM_FUNC_START ffi_call_SYSV
+ARM_FUNC_START(ffi_call_SYSV)
 	@ Save registers
         stmfd	sp!, {r0-r3, fp, lr}
 	UNWIND .save	{r0-r3, fp, lr}
@@ -187,7 +172,7 @@
 	@     r1 already set
 
 	@ Call ffi_prep_args(stack, &ecif)
-	bl	CNAME(ffi_prep_args)
+	bl	CNAME(ffi_prep_args_SYSV)
 
 	@ move first 4 parameters in registers
 	ldmia	sp, {r0-r3}
@@ -228,7 +213,7 @@
 #if defined(__SOFTFP__) || defined(__ARM_EABI__)
 	cmpne	r3, #FFI_TYPE_DOUBLE
 #endif
-	stmeqia	r2, {r0, r1}
+	stmiaeq	r2, {r0, r1}
 
 #if !defined(__SOFTFP__) && !defined(__ARM_EABI__)
 	beq	LSYM(Lepilogue)
@@ -260,13 +245,13 @@
 
 /*
 	unsigned int FFI_HIDDEN
-	ffi_closure_SYSV_inner (closure, respp, args)
+	ffi_closure_inner (closure, respp, args)
 	     ffi_closure *closure;
 	     void **respp;
   	     void *args;
 */
 
-ARM_FUNC_START ffi_closure_SYSV
+ARM_FUNC_START(ffi_closure_SYSV)
 	UNWIND .pad #16
 	add	ip, sp, #16
 	stmfd	sp!, {ip, lr}
@@ -276,7 +261,7 @@
 	sub	sp, sp, #16
 	str	sp, [sp, #8]
 	add	r1, sp, #8
-	bl	CNAME(ffi_closure_SYSV_inner)
+	bl	CNAME(ffi_closure_inner)
 	cmp	r0, #FFI_TYPE_INT
 	beq	.Lretint
 
@@ -345,7 +330,7 @@
 	@ r3:   fig->flags
 	@ sp+0: ecif.rvalue
 
-ARM_FUNC_START ffi_call_VFP
+ARM_FUNC_START(ffi_call_VFP)
 	@ Save registers
         stmfd	sp!, {r0-r3, fp, lr}
 	UNWIND .save	{r0-r3, fp, lr}
@@ -364,10 +349,11 @@
 	sub	r2, fp, #64   @ VFP scratch space
 
 	@ Call ffi_prep_args(stack, &ecif, vfp_space)
-	bl	CNAME(ffi_prep_args)
+	bl	CNAME(ffi_prep_args_VFP)
 
 	@ Load VFP register args if needed
 	cmp	r0, #0
+	mov	ip, fp
 	beq	LSYM(Lbase_args)
 
 	@ Load only d0 if possible
@@ -433,7 +419,7 @@
         .size    CNAME(ffi_call_VFP),.ffi_call_VFP_end-CNAME(ffi_call_VFP)
 
 
-ARM_FUNC_START ffi_closure_VFP
+ARM_FUNC_START(ffi_closure_VFP)
 	fstmfdd	sp!, {d0-d7}
 	@ r0-r3, then d0-d7
 	UNWIND .pad #80
@@ -446,7 +432,7 @@
 	sub	sp, sp, #72
 	str	sp, [sp, #64]
 	add	r1, sp, #64
-	bl	CNAME(ffi_closure_SYSV_inner)
+	bl	CNAME(ffi_closure_inner)
 
 	cmp	r0, #FFI_TYPE_INT
 	beq	.Lretint_vfp
diff --git a/Modules/_ctypes/libffi/src/bfin/ffi.c b/Modules/_ctypes/libffi/src/bfin/ffi.c
index 0beccc1..22a2acd 100644
--- a/Modules/_ctypes/libffi/src/bfin/ffi.c
+++ b/Modules/_ctypes/libffi/src/bfin/ffi.c
@@ -1,5 +1,6 @@
 /* -----------------------------------------------------------------------
-   ffi.c - Copyright (c) 2012  Alexandre K. I. de Mendonca <alexandre.keunecke@gmail.com>
+   ffi.c - Copyright (c) 2012  Alexandre K. I. de Mendonca <alexandre.keunecke@gmail.com>,
+							   Paulo Pizarro <paulo.pizarro@gmail.com>
 
    Blackfin Foreign Function Interface
 
diff --git a/Modules/_ctypes/libffi/src/bfin/sysv.S b/Modules/_ctypes/libffi/src/bfin/sysv.S
index ae7a152..f4278be 100644
--- a/Modules/_ctypes/libffi/src/bfin/sysv.S
+++ b/Modules/_ctypes/libffi/src/bfin/sysv.S
@@ -1,5 +1,6 @@
 /* -----------------------------------------------------------------------
-   sysv.S - Copyright (c) 2012  Alexandre K. I. de Mendonca <alexandre.keunecke@gmail.com>
+   sysv.S - Copyright (c) 2012  Alexandre K. I. de Mendonca <alexandre.keunecke@gmail.com>,
+                                Paulo Pizarro <paulo.pizarro@gmail.com>
 
    Blackfin Foreign Function Interface
 
@@ -32,7 +33,7 @@
 .align 4
 
 	/*
-	 There is a "feature" in the bfin toolchain that it puts a _ before funcion names
+	 There is a "feature" in the bfin toolchain that it puts a _ before function names
 	 that's why the function here it's called _ffi_call_SYSV and not ffi_call_SYSV
 	 */
 	.global _ffi_call_SYSV;
@@ -40,25 +41,26 @@
 	.func ffi_call_SYSV
 
 	/*
-	cif->bytes  	= R0	(fp+8)
-	&ecif			= R1	(fp+12)
-	ffi_prep_args	= R2	(fp+16)
-	ret_type		= stack (fp+20)
-	ecif.rvalue		= stack (fp+24)
-	fn				= stack	(fp+28)
-					  got	(fp+32)
-    There is room for improvement here (we can use temporary registers
-        instead of saving the values in the memory)
-	REGS:
-		P5 => Stack pointer (function arguments)
-		R5 => cif->bytes
-		R4 => ret->type
+         cif->bytes    = R0    (fp+8)
+         &ecif         = R1    (fp+12)
+         ffi_prep_args = R2    (fp+16)
+         ret_type      = stack (fp+20)
+         ecif.rvalue   = stack (fp+24)
+         fn            = stack (fp+28)
+                           got (fp+32)
 
-		FP-20 = P3
-		FP-16 = SP (parameters area)
-		FP-12 = SP (temp)
-		FP-08 = function return part 1 [R0]
-		FP-04 = function return part 2 [R1]
+        There is room for improvement here (we can use temporary registers
+        instead of saving the values in the memory)
+        REGS:
+        P5 => Stack pointer (function arguments)
+        R5 => cif->bytes
+        R4 => ret->type
+
+        FP-20 = P3
+        FP-16 = SP (parameters area)
+        FP-12 = SP (temp)
+        FP-08 = function return part 1 [R0]
+        FP-04 = function return part 2 [R1]
 	*/
 
 _ffi_call_SYSV:
diff --git a/Modules/_ctypes/libffi/src/closures.c b/Modules/_ctypes/libffi/src/closures.c
index 6298d6f..c7863f3 100644
--- a/Modules/_ctypes/libffi/src/closures.c
+++ b/Modules/_ctypes/libffi/src/closures.c
@@ -34,7 +34,7 @@
 #include <ffi_common.h>
 
 #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
-# if __gnu_linux__
+# if __gnu_linux__ && !defined(__ANDROID__)
 /* This macro indicates it may be forbidden to map anonymous memory
    with both write and execute permission.  Code compiled when this
    option is defined will attempt to map such pages once, but if it
@@ -181,10 +181,26 @@
 static int
 emutramp_enabled_check (void)
 {
-  if (getenv ("FFI_DISABLE_EMUTRAMP") == NULL)
-    return 1;
-  else
+  char *buf = NULL;
+  size_t len = 0;
+  FILE *f;
+  int ret;
+  f = fopen ("/proc/self/status", "r");
+  if (f == NULL)
     return 0;
+  ret = 0;
+
+  while (getline (&buf, &len, f) != -1)
+    if (!strncmp (buf, "PaX:", 4))
+      {
+        char emutramp;
+        if (sscanf (buf, "%*s %*c%c", &emutramp) == 1)
+          ret = (emutramp == 'E');
+        break;
+      }
+  free (buf);
+  fclose (f);
+  return ret;
 }
 
 #define is_emutramp_enabled() (emutramp_enabled >= 0 ? emutramp_enabled \
@@ -264,7 +280,7 @@
 open_temp_exec_file_dir (const char *dir)
 {
   static const char suffix[] = "/ffiXXXXXX";
-  int lendir = strlen (dir);
+  size_t lendir = strlen (dir);
   char *tempname = __builtin_alloca (lendir + sizeof (suffix));
 
   if (!tempname)
@@ -382,7 +398,7 @@
 }
 
 /* Return a file descriptor of a temporary zero-sized file in a
-   writable and exexutable filesystem.  */
+   writable and executable filesystem.  */
 static int
 open_temp_exec_file (void)
 {
diff --git a/Modules/_ctypes/libffi/src/dlmalloc.c b/Modules/_ctypes/libffi/src/dlmalloc.c
index 2773953..6e474b7 100644
--- a/Modules/_ctypes/libffi/src/dlmalloc.c
+++ b/Modules/_ctypes/libffi/src/dlmalloc.c
@@ -1260,7 +1260,7 @@
 #define SIZE_T_BITSIZE      (sizeof(size_t) << 3)
 
 /* Some constants coerced to size_t */
-/* Annoying but necessary to avoid errors on some plaftorms */
+/* Annoying but necessary to avoid errors on some platforms */
 #define SIZE_T_ZERO         ((size_t)0)
 #define SIZE_T_ONE          ((size_t)1)
 #define SIZE_T_TWO          ((size_t)2)
@@ -1414,7 +1414,7 @@
 #define CALL_MORECORE(S)     MFAIL
 #endif /* HAVE_MORECORE */
 
-/* mstate bit set if continguous morecore disabled or failed */
+/* mstate bit set if contiguous morecore disabled or failed */
 #define USE_NONCONTIGUOUS_BIT (4U)
 
 /* segment bit set in create_mspace_with_base */
@@ -1666,7 +1666,7 @@
 typedef struct malloc_chunk  mchunk;
 typedef struct malloc_chunk* mchunkptr;
 typedef struct malloc_chunk* sbinptr;  /* The type of bins of chunks */
-typedef unsigned int bindex_t;         /* Described below */
+typedef size_t bindex_t;               /* Described below */
 typedef unsigned int binmap_t;         /* Described below */
 typedef unsigned int flag_t;           /* The type of various bit flag sets */
 
@@ -3095,8 +3095,8 @@
      and choose its bk node as its replacement.
   2. If x was the last node of its size, but not a leaf node, it must
      be replaced with a leaf node (not merely one with an open left or
-     right), to make sure that lefts and rights of descendents
-     correspond properly to bit masks.  We use the rightmost descendent
+     right), to make sure that lefts and rights of descendants
+     correspond properly to bit masks.  We use the rightmost descendant
      of x.  We could use any other leaf, but this is easy to locate and
      tends to counteract removal of leftmosts elsewhere, and so keeps
      paths shorter than minimally guaranteed.  This doesn't loop much
@@ -3393,7 +3393,7 @@
   *ss = m->seg; /* Push current record */
   m->seg.base = tbase;
   m->seg.size = tsize;
-  set_segment_flags(&m->seg, mmapped);
+  (void)set_segment_flags(&m->seg, mmapped);
   m->seg.next = ss;
 
   /* Insert trailing fenceposts */
@@ -3553,7 +3553,7 @@
     if (!is_initialized(m)) { /* first-time initialization */
       m->seg.base = m->least_addr = tbase;
       m->seg.size = tsize;
-      set_segment_flags(&m->seg, mmap_flag);
+      (void)set_segment_flags(&m->seg, mmap_flag);
       m->magic = mparams.magic;
       init_bins(m);
       if (is_global(m)) 
@@ -4502,7 +4502,7 @@
     char* tbase = (char*)(CALL_MMAP(tsize));
     if (tbase != CMFAIL) {
       m = init_user_mstate(tbase, tsize);
-      set_segment_flags(&m->seg, IS_MMAPPED_BIT);
+      (void)set_segment_flags(&m->seg, IS_MMAPPED_BIT);
       set_lock(m, locked);
     }
   }
@@ -4517,7 +4517,7 @@
   if (capacity > msize + TOP_FOOT_SIZE &&
       capacity < (size_t) -(msize + TOP_FOOT_SIZE + mparams.page_size)) {
     m = init_user_mstate((char*)base, capacity);
-    set_segment_flags(&m->seg, EXTERN_BIT);
+    (void)set_segment_flags(&m->seg, EXTERN_BIT);
     set_lock(m, locked);
   }
   return (mspace)m;
@@ -5096,10 +5096,10 @@
         Wolfram Gloger (Gloger@lrz.uni-muenchen.de).
       * Use last_remainder in more cases.
       * Pack bins using idea from  colin@nyx10.cs.du.edu
-      * Use ordered bins instead of best-fit threshhold
+      * Use ordered bins instead of best-fit threshold
       * Eliminate block-local decls to simplify tracing and debugging.
       * Support another case of realloc via move into top
-      * Fix error occuring when initial sbrk_base not word-aligned.
+      * Fix error occurring when initial sbrk_base not word-aligned.
       * Rely on page size for units instead of SBRK_UNIT to
         avoid surprises about sbrk alignment conventions.
       * Add mallinfo, mallopt. Thanks to Raymond Nijssen
diff --git a/Modules/_ctypes/libffi/src/ia64/ffi.c b/Modules/_ctypes/libffi/src/ia64/ffi.c
index 9533ef6..b77a836 100644
--- a/Modules/_ctypes/libffi/src/ia64/ffi.c
+++ b/Modules/_ctypes/libffi/src/ia64/ffi.c
@@ -401,7 +401,7 @@
    the closure (in the "trampoline" area), but we replace the gp
    pointer with a pointer to the closure itself.  We also add the real
    gp pointer to the closure.  This allows the function entry code to
-   both retrieve the user data, and to restire the correct gp pointer.  */
+   both retrieve the user data, and to restore the correct gp pointer.  */
 
 extern void ffi_closure_unix ();
 
diff --git a/Modules/_ctypes/libffi/src/m88k/ffi.c b/Modules/_ctypes/libffi/src/m88k/ffi.c
new file mode 100644
index 0000000..68df494
--- /dev/null
+++ b/Modules/_ctypes/libffi/src/m88k/ffi.c
@@ -0,0 +1,400 @@
+/*
+ * Copyright (c) 2013 Miodrag Vallat.  <miod@openbsd.org>
+ *
+ * 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.
+ */
+
+/*
+ * m88k Foreign Function Interface
+ *
+ * This file attempts to provide all the FFI entry points which can reliably
+ * be implemented in C.
+ *
+ * Only OpenBSD/m88k is currently supported; other platforms (such as
+ * Motorola's SysV/m88k) could be supported with the following tweaks:
+ *
+ * - non-OpenBSD systems use an `outgoing parameter area' as part of the
+ *   88BCS calling convention, which is not supported under OpenBSD from
+ *   release 3.6 onwards.  Supporting it should be as easy as taking it
+ *   into account when adjusting the stack, in the assembly code.
+ *
+ * - the logic deciding whether a function argument gets passed through
+ *   registers, or on the stack, has changed several times in OpenBSD in
+ *   edge cases (especially for structs larger than 32 bytes being passed
+ *   by value). The code below attemps to match the logic used by the
+ *   system compiler of OpenBSD 5.3, i.e. gcc 3.3.6 with many m88k backend
+ *   fixes.
+ */
+
+#include <ffi.h>
+#include <ffi_common.h>
+
+#include <stdlib.h>
+#include <unistd.h>
+
+void ffi_call_OBSD (unsigned int, extended_cif *, unsigned int, void *,
+		    void (*fn) ());
+void *ffi_prep_args (void *, extended_cif *);
+void ffi_closure_OBSD (ffi_closure *);
+void ffi_closure_struct_OBSD (ffi_closure *);
+unsigned int ffi_closure_OBSD_inner (ffi_closure *, void *, unsigned int *,
+				     char *);
+void ffi_cacheflush_OBSD (unsigned int, unsigned int);
+
+#define CIF_FLAGS_INT		(1 << 0)
+#define CIF_FLAGS_DINT		(1 << 1)
+
+/*
+ * Foreign Function Interface API
+ */
+
+/* ffi_prep_args is called by the assembly routine once stack space has
+   been allocated for the function's arguments.  */
+
+void *
+ffi_prep_args (void *stack, extended_cif *ecif)
+{
+  unsigned int i;
+  void **p_argv;
+  char *argp, *stackp;
+  unsigned int *regp;
+  unsigned int regused;
+  ffi_type **p_arg;
+  void *struct_value_ptr;
+
+  regp = (unsigned int *)stack;
+  stackp = (char *)(regp + 8);
+  regused = 0;
+
+  if (ecif->cif->rtype->type == FFI_TYPE_STRUCT
+      && !ecif->cif->flags)
+    struct_value_ptr = ecif->rvalue;
+  else
+    struct_value_ptr = NULL;
+
+  p_argv = ecif->avalue;
+
+  for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; i != 0; i--, p_arg++)
+    {
+      size_t z;
+      unsigned short t, a;
+
+      z = (*p_arg)->size;
+      t = (*p_arg)->type;
+      a = (*p_arg)->alignment;
+
+      /*
+       * Figure out whether the argument can be passed through registers
+       * or on the stack.
+       * The rule is that registers can only receive simple types not larger
+       * than 64 bits, or structs the exact size of a register and aligned to
+       * the size of a register.
+       */
+      if (t == FFI_TYPE_STRUCT)
+	{
+	  if (z == sizeof (int) && a == sizeof (int) && regused < 8)
+	    argp = (char *)regp;
+	  else
+	    argp = stackp;
+	}
+      else
+	{
+	  if (z > sizeof (int) && regused < 8 - 1)
+	    {
+	      /* align to an even register pair */
+	      if (regused & 1)
+		{
+		  regp++;
+		  regused++;
+		}
+	    }
+	  if (regused < 8)
+	    argp = (char *)regp;
+	  else
+	    argp = stackp;
+	}
+
+      /* Enforce proper stack alignment of 64-bit types */
+      if (argp == stackp && a > sizeof (int))
+	{
+	  stackp = (char *) ALIGN(stackp, a);
+	  argp = stackp;
+	}
+
+      switch (t)
+	{
+	case FFI_TYPE_SINT8:
+	  *(signed int *) argp = (signed int) *(SINT8 *) *p_argv;
+	  break;
+
+	case FFI_TYPE_UINT8:
+	  *(unsigned int *) argp = (unsigned int) *(UINT8 *) *p_argv;
+	  break;
+
+	case FFI_TYPE_SINT16:
+	  *(signed int *) argp = (signed int) *(SINT16 *) *p_argv;
+	  break;
+
+	case FFI_TYPE_UINT16:
+	  *(unsigned int *) argp = (unsigned int) *(UINT16 *) *p_argv;
+	  break;
+
+	case FFI_TYPE_INT:
+	case FFI_TYPE_FLOAT:
+	case FFI_TYPE_UINT32:
+	case FFI_TYPE_SINT32:
+	case FFI_TYPE_POINTER:
+	  *(unsigned int *) argp = *(unsigned int *) *p_argv;
+	  break;
+
+	case FFI_TYPE_DOUBLE:
+	case FFI_TYPE_UINT64:
+	case FFI_TYPE_SINT64:
+	case FFI_TYPE_STRUCT:
+	  memcpy (argp, *p_argv, z);
+	  break;
+
+	default:
+	  FFI_ASSERT (0);
+	}
+
+      /* Align if necessary.  */
+      if ((sizeof (int) - 1) & z)
+	z = ALIGN(z, sizeof (int));
+
+      p_argv++;
+
+      /* Be careful, once all registers are filled, and about to continue
+         on stack, regp == stackp.  Therefore the check for regused as well. */
+      if (argp == (char *)regp && regused < 8)
+	{
+	  regp += z / sizeof (int);
+	  regused += z / sizeof (int);
+	}
+      else
+	stackp += z;
+    }
+
+  return struct_value_ptr;
+}
+
+/* Perform machine dependent cif processing */
+ffi_status
+ffi_prep_cif_machdep (ffi_cif *cif)
+{
+  /* Set the return type flag */
+  switch (cif->rtype->type)
+    {
+    case FFI_TYPE_VOID:
+      cif->flags = 0;
+      break;
+
+    case FFI_TYPE_STRUCT:
+      if (cif->rtype->size == sizeof (int) &&
+	  cif->rtype->alignment == sizeof (int))
+	cif->flags = CIF_FLAGS_INT;
+      else
+	cif->flags = 0;
+      break;
+
+    case FFI_TYPE_DOUBLE:
+    case FFI_TYPE_SINT64:
+    case FFI_TYPE_UINT64:
+      cif->flags = CIF_FLAGS_DINT;
+      break;
+
+    default:
+      cif->flags = CIF_FLAGS_INT;
+      break;
+    }
+
+  return FFI_OK;
+}
+
+void
+ffi_call (ffi_cif *cif, void (*fn) (), void *rvalue, void **avalue)
+{
+  extended_cif ecif;
+
+  ecif.cif = cif;
+  ecif.avalue = avalue;
+
+  /* If the return value is a struct and we don't have a return value
+     address then we need to make one.  */
+
+  if (rvalue == NULL
+      && cif->rtype->type == FFI_TYPE_STRUCT
+      && (cif->rtype->size != sizeof (int)
+	  || cif->rtype->alignment != sizeof (int)))
+    ecif.rvalue = alloca (cif->rtype->size);
+  else
+    ecif.rvalue = rvalue;
+
+  switch (cif->abi)
+    {
+    case FFI_OBSD:
+      ffi_call_OBSD (cif->bytes, &ecif, cif->flags, ecif.rvalue, fn);
+      break;
+
+    default:
+      FFI_ASSERT (0);
+      break;
+    }
+}
+
+/*
+ * Closure API
+ */
+
+static void
+ffi_prep_closure_args_OBSD (ffi_cif *cif, void **avalue, unsigned int *regp,
+			    char *stackp)
+{
+  unsigned int i;
+  void **p_argv;
+  char *argp;
+  unsigned int regused;
+  ffi_type **p_arg;
+
+  regused = 0;
+
+  p_argv = avalue;
+
+  for (i = cif->nargs, p_arg = cif->arg_types; i != 0; i--, p_arg++)
+    {
+      size_t z;
+      unsigned short t, a;
+
+      z = (*p_arg)->size;
+      t = (*p_arg)->type;
+      a = (*p_arg)->alignment;
+
+      /*
+       * Figure out whether the argument has been passed through registers
+       * or on the stack.
+       * The rule is that registers can only receive simple types not larger
+       * than 64 bits, or structs the exact size of a register and aligned to
+       * the size of a register.
+       */
+      if (t == FFI_TYPE_STRUCT)
+	{
+	  if (z == sizeof (int) && a == sizeof (int) && regused < 8)
+	    argp = (char *)regp;
+	  else
+	    argp = stackp;
+	}
+      else
+	{
+	  if (z > sizeof (int) && regused < 8 - 1)
+	    {
+	      /* align to an even register pair */
+	      if (regused & 1)
+		{
+		  regp++;
+		  regused++;
+		}
+	    }
+	  if (regused < 8)
+	    argp = (char *)regp;
+	  else
+	    argp = stackp;
+	}
+
+      /* Enforce proper stack alignment of 64-bit types */
+      if (argp == stackp && a > sizeof (int))
+	{
+	  stackp = (char *) ALIGN(stackp, a);
+	  argp = stackp;
+	}
+
+      if (z < sizeof (int) && t != FFI_TYPE_STRUCT)
+	*p_argv = (void *) (argp + sizeof (int) - z);
+      else
+	*p_argv = (void *) argp;
+
+      /* Align if necessary */
+      if ((sizeof (int) - 1) & z)
+	z = ALIGN(z, sizeof (int));
+
+      p_argv++;
+
+      /* Be careful, once all registers are exhausted, and about to fetch from
+	 stack, regp == stackp.  Therefore the check for regused as well. */
+      if (argp == (char *)regp && regused < 8)
+	{
+	  regp += z / sizeof (int);
+	  regused += z / sizeof (int);
+	}
+      else
+	stackp += z;
+    }
+}
+
+unsigned int
+ffi_closure_OBSD_inner (ffi_closure *closure, void *resp, unsigned int *regp,
+			char *stackp)
+{
+  ffi_cif *cif;
+  void **arg_area;
+
+  cif = closure->cif;
+  arg_area = (void**) alloca (cif->nargs * sizeof (void *));
+
+  ffi_prep_closure_args_OBSD(cif, arg_area, regp, stackp);
+
+  (closure->fun) (cif, resp, arg_area, closure->user_data);
+
+  return cif->flags;
+}
+
+ffi_status
+ffi_prep_closure_loc (ffi_closure* closure, ffi_cif* cif,
+		      void (*fun)(ffi_cif*,void*,void**,void*),
+		      void *user_data, void *codeloc)
+{
+  unsigned int *tramp = (unsigned int *) codeloc;
+  void *fn;
+
+  FFI_ASSERT (cif->abi == FFI_OBSD);
+
+  if (cif->rtype->type == FFI_TYPE_STRUCT && !cif->flags)
+    fn = &ffi_closure_struct_OBSD;
+  else
+    fn = &ffi_closure_OBSD;
+
+  /* or.u %r10, %r0, %hi16(fn) */
+  tramp[0] = 0x5d400000 | (((unsigned int)fn) >> 16);
+  /* or.u %r13, %r0, %hi16(closure) */
+  tramp[1] = 0x5da00000 | ((unsigned int)closure >> 16);
+  /* or %r10, %r10, %lo16(fn) */
+  tramp[2] = 0x594a0000 | (((unsigned int)fn) & 0xffff);
+  /* jmp.n %r10 */
+  tramp[3] = 0xf400c40a;
+  /* or %r13, %r13, %lo16(closure) */
+  tramp[4] = 0x59ad0000 | ((unsigned int)closure & 0xffff);
+
+  ffi_cacheflush_OBSD((unsigned int)codeloc, FFI_TRAMPOLINE_SIZE);
+
+  closure->cif  = cif;
+  closure->user_data = user_data;
+  closure->fun  = fun;
+
+  return FFI_OK;
+}
diff --git a/Modules/_ctypes/libffi/src/m88k/ffitarget.h b/Modules/_ctypes/libffi/src/m88k/ffitarget.h
new file mode 100644
index 0000000..e52bf9f
--- /dev/null
+++ b/Modules/_ctypes/libffi/src/m88k/ffitarget.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2013 Miodrag Vallat.  <miod@openbsd.org>
+ *
+ * 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.
+ */
+
+/*
+ * m88k Foreign Function Interface
+ */
+
+#ifndef LIBFFI_TARGET_H
+#define LIBFFI_TARGET_H
+
+#ifndef LIBFFI_ASM
+typedef unsigned long ffi_arg;
+typedef signed long ffi_sarg;
+
+typedef enum ffi_abi {
+  FFI_FIRST_ABI = 0,
+  FFI_OBSD,
+  FFI_DEFAULT_ABI = FFI_OBSD,
+  FFI_LAST_ABI = FFI_DEFAULT_ABI + 1
+} ffi_abi;
+#endif
+
+/* ---- Definitions for closures ----------------------------------------- */
+
+#define FFI_CLOSURES 1
+#define FFI_TRAMPOLINE_SIZE 0x14
+#define FFI_NATIVE_RAW_API 0
+
+#endif
diff --git a/Modules/_ctypes/libffi/src/m88k/obsd.S b/Modules/_ctypes/libffi/src/m88k/obsd.S
new file mode 100644
index 0000000..1944a23
--- /dev/null
+++ b/Modules/_ctypes/libffi/src/m88k/obsd.S
@@ -0,0 +1,209 @@
+/*
+ * Copyright (c) 2013 Miodrag Vallat.  <miod@openbsd.org>
+ *
+ * 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.
+ */
+
+/*
+ * m88k Foreign Function Interface
+ */
+
+#define LIBFFI_ASM	
+#include <fficonfig.h>
+#include <ffi.h>
+
+	.text
+
+/*
+ * ffi_cacheflush_OBSD(unsigned int addr,	%r2
+ *		       unsigned int size);	%r3
+ */
+	.align	4
+	.globl	ffi_cacheflush_OBSD
+	.type	ffi_cacheflush_OBSD,@function
+ffi_cacheflush_OBSD:
+	tb0	0,   %r0, 451
+	or	%r0, %r0, %r0
+	jmp	%r1
+	.size	ffi_cacheflush_OBSD, . - ffi_cacheflush_OBSD
+
+/*
+ * ffi_call_OBSD(unsigned bytes,		%r2
+ *		 extended_cif *ecif,		%r3
+ *		 unsigned flags,		%r4
+ *		 void *rvalue,			%r5
+ *		 void (*fn)());			%r6
+ */
+	.align	4
+	.globl	ffi_call_OBSD
+	.type	ffi_call_OBSD,@function
+ffi_call_OBSD:
+	subu	%r31, %r31, 32
+	st	%r30, %r31, 4
+	st	%r1,  %r31, 0
+	addu	%r30, %r31, 32
+
+	| Save the few arguments we'll need after ffi_prep_args()
+	st.d	%r4, %r31, 8
+	st	%r6, %r31, 16
+
+	| Allocate room for the image of r2-r9, and the stack space for
+	| the args (rounded to a 16-byte boundary)
+	addu	%r2,  %r2,  (8 * 4) + 15
+	clr	%r2,  %r2,  4<0>
+	subu	%r31, %r31, %r2
+
+	| Fill register and stack image
+	or	%r2, %r31, %r0
+#ifdef PIC
+	bsr	ffi_prep_args#plt
+#else
+	bsr	ffi_prep_args
+#endif
+
+	| Save pointer to return struct address, if any
+	or	%r12, %r2, %r0
+
+	| Get function pointer
+	subu	%r4,  %r30, 32
+	ld	%r1,  %r4,  16
+
+	| Fetch the register arguments
+	ld.d	%r2, %r31, (0 * 4)
+	ld.d	%r4, %r31, (2 * 4)
+	ld.d	%r6, %r31, (4 * 4)
+	ld.d	%r8, %r31, (6 * 4)
+	addu	%r31, %r31, (8 * 4)
+
+	| Invoke the function
+	jsr	%r1
+
+	| Restore stack now that we don't need the args anymore
+	subu	%r31, %r30, 32
+
+	| Figure out what to return as the function's return value
+	ld	%r5, %r31, 12		| rvalue
+	ld	%r4, %r31, 8		| flags
+
+	bcnd	eq0, %r5, 9f
+
+	bb0	0, %r4, 1f		| CIF_FLAGS_INT
+	st	%r2, %r5, 0
+	br	9f
+
+1:
+	bb0	1, %r4, 1f		| CIF_FLAGS_DINT
+	st.d	%r2, %r5, 0
+	br	9f
+
+1:
+9:
+	ld	%r1,  %r31, 0
+	ld	%r30, %r31, 4
+	jmp.n	%r1
+	 addu	%r31, %r31, 32
+	.size	ffi_call_OBSD, . - ffi_call_OBSD
+
+/*
+ * ffi_closure_OBSD(ffi_closure *closure);	%r13
+ */
+	.align	4
+	.globl	ffi_closure_OBSD
+	.type	ffi_closure_OBSD, @function
+ffi_closure_OBSD:
+	subu	%r31, %r31, 16
+	st	%r30, %r31, 4
+	st	%r1,  %r31, 0
+	addu	%r30, %r31, 16
+
+	| Make room on the stack for saved register arguments and return
+	| value
+	subu	%r31, %r31, (8 * 4) + (2 * 4)
+	st.d	%r2,  %r31, (0 * 4)
+	st.d	%r4,  %r31, (2 * 4)
+	st.d	%r6,  %r31, (4 * 4)
+	st.d	%r8,  %r31, (6 * 4)
+
+	| Invoke the closure function
+	or	%r5,  %r30, 0			| calling stack
+	addu	%r4,  %r31, 0			| saved registers
+	addu	%r3,  %r31, (8 * 4)		| return value
+	or	%r2,  %r13, %r0			| closure
+#ifdef PIC
+	bsr	ffi_closure_OBSD_inner#plt
+#else
+	bsr	ffi_closure_OBSD_inner
+#endif
+
+	| Figure out what to return as the function's return value
+	bb0	0, %r2, 1f		| CIF_FLAGS_INT
+	ld	%r2, %r31, (8 * 4)
+	br	9f
+
+1:
+	bb0	1, %r2, 1f		| CIF_FLAGS_DINT
+	ld.d	%r2, %r31, (8 * 4)
+	br	9f
+
+1:
+9:
+	subu	%r31, %r30, 16
+	ld	%r1,  %r31, 0
+	ld	%r30, %r31, 4
+	jmp.n	%r1
+	 addu	%r31, %r31, 16
+	.size	ffi_closure_OBSD,.-ffi_closure_OBSD
+
+/*
+ * ffi_closure_struct_OBSD(ffi_closure *closure);	%r13
+ */
+	.align	4
+	.globl	ffi_closure_struct_OBSD
+	.type	ffi_closure_struct_OBSD, @function
+ffi_closure_struct_OBSD:
+	subu	%r31, %r31, 16
+	st	%r30, %r31, 4
+	st	%r1,  %r31, 0
+	addu	%r30, %r31, 16
+
+	| Make room on the stack for saved register arguments
+	subu	%r31, %r31, (8 * 4)
+	st.d	%r2,  %r31, (0 * 4)
+	st.d	%r4,  %r31, (2 * 4)
+	st.d	%r6,  %r31, (4 * 4)
+	st.d	%r8,  %r31, (6 * 4)
+
+	| Invoke the closure function
+	or	%r5,  %r30, 0			| calling stack
+	addu	%r4,  %r31, 0			| saved registers
+	or	%r3,  %r12, 0			| return value
+	or	%r2,  %r13, %r0			| closure
+#ifdef PIC
+	bsr	ffi_closure_OBSD_inner#plt
+#else
+	bsr	ffi_closure_OBSD_inner
+#endif
+
+	subu	%r31, %r30, 16
+	ld	%r1,  %r31, 0
+	ld	%r30, %r31, 4
+	jmp.n	%r1
+	 addu	%r31, %r31, 16
+	.size	ffi_closure_struct_OBSD,.-ffi_closure_struct_OBSD
diff --git a/Modules/_ctypes/libffi/src/microblaze/ffi.c b/Modules/_ctypes/libffi/src/microblaze/ffi.c
index 5c155c5..ea962ea 100644
--- a/Modules/_ctypes/libffi/src/microblaze/ffi.c
+++ b/Modules/_ctypes/libffi/src/microblaze/ffi.c
@@ -183,7 +183,7 @@
 	ffi_type** arg_types = cif->arg_types;
 
 	/* re-allocate data for the args. This needs to be done in order to keep
-	 * multi-word objects (e.g. structs) in contigious memory. Callers are not
+	 * multi-word objects (e.g. structs) in contiguous memory. Callers are not
 	 * required to store the value of args in the lower 6 words in the stack
 	 * (although they are allocated in the stack).
 	 */
diff --git a/Modules/_ctypes/libffi/src/microblaze/sysv.S b/Modules/_ctypes/libffi/src/microblaze/sysv.S
index 7a195a6..ea43e9d 100644
--- a/Modules/_ctypes/libffi/src/microblaze/sysv.S
+++ b/Modules/_ctypes/libffi/src/microblaze/sysv.S
@@ -134,7 +134,7 @@
 	rsubi r11, r23, 8
 	beqi r11, ffi_call_SYSV_store64
 
-	/* Didnt match anything */
+	/* Didn't match anything */
 	bri ffi_call_SYSV_end
 
 ffi_call_SYSV_store64:
@@ -210,7 +210,7 @@
 	addik r7, r12, 0 /* closure object */
 	addik r1, r1, -8 /* allocate return value */
 	addik r8, r1, 0 /* void* rvalue */
-	addik r1, r1, -8 /* allocate for reutrn type/size values */
+	addik r1, r1, -8 /* allocate for return type/size values */
 	addik r9, r1, 0 /* void* rtype */
 	addik r10, r1, 4 /* void* rsize */
 
@@ -247,7 +247,7 @@
 	rsubi r11, r10, 8
 	beqi r11, ffi_closure_SYSV_store64
 
-	/* Didnt match anything */
+	/* Didn't match anything */
 	bri ffi_closure_SYSV_end
 
 ffi_closure_SYSV_store64:
diff --git a/Modules/_ctypes/libffi/src/mips/ffi.c b/Modules/_ctypes/libffi/src/mips/ffi.c
index 03121e3..5d0dd70 100644
--- a/Modules/_ctypes/libffi/src/mips/ffi.c
+++ b/Modules/_ctypes/libffi/src/mips/ffi.c
@@ -170,7 +170,14 @@
 		break;
 		  
 	      case FFI_TYPE_UINT32:
+#ifdef FFI_MIPS_N32
+		/* The N32 ABI requires that 32-bit integers
+		   be sign-extended to 64-bits, regardless of
+		   whether they are signed or unsigned. */
+		*(ffi_arg *)argp = *(SINT32 *)(* p_argv);
+#else
 		*(ffi_arg *)argp = *(UINT32 *)(* p_argv);
+#endif
 		break;
 
 	      /* This can only happen with 64bit slots.  */
diff --git a/Modules/_ctypes/libffi/src/mips/n32.S b/Modules/_ctypes/libffi/src/mips/n32.S
index ff4bbce..c6985d3 100644
--- a/Modules/_ctypes/libffi/src/mips/n32.S
+++ b/Modules/_ctypes/libffi/src/mips/n32.S
@@ -108,10 +108,8 @@
 	REG_L	t6, 3*FFI_SIZEOF_ARG($fp)  # load the flags word into t6.
 
 	and	t4, t6, ((1<<FFI_FLAG_BITS)-1)
-	bnez	t4, arg1_floatp
 	REG_L	a0, 0*FFI_SIZEOF_ARG(t9)
-	b	arg1_next
-arg1_floatp:	
+	beqz	t4, arg1_next
 	bne	t4, FFI_TYPE_FLOAT, arg1_doublep
 	l.s	$f12, 0*FFI_SIZEOF_ARG(t9)
 	b	arg1_next
@@ -121,10 +119,8 @@
 	
 	SRL	t4, t6, 1*FFI_FLAG_BITS
 	and	t4, ((1<<FFI_FLAG_BITS)-1)
-	bnez	t4, arg2_floatp
 	REG_L	a1, 1*FFI_SIZEOF_ARG(t9)
-	b	arg2_next
-arg2_floatp:
+	beqz	t4, arg2_next
 	bne	t4, FFI_TYPE_FLOAT, arg2_doublep
 	l.s	$f13, 1*FFI_SIZEOF_ARG(t9)	
 	b	arg2_next
@@ -134,10 +130,8 @@
 	
 	SRL	t4, t6, 2*FFI_FLAG_BITS
 	and	t4, ((1<<FFI_FLAG_BITS)-1)
-	bnez	t4, arg3_floatp
 	REG_L	a2, 2*FFI_SIZEOF_ARG(t9)
-	b	arg3_next
-arg3_floatp:
+	beqz	t4, arg3_next
 	bne	t4, FFI_TYPE_FLOAT, arg3_doublep
 	l.s	$f14, 2*FFI_SIZEOF_ARG(t9)	
 	b	arg3_next
@@ -147,10 +141,8 @@
 	
 	SRL	t4, t6, 3*FFI_FLAG_BITS
 	and	t4, ((1<<FFI_FLAG_BITS)-1)
-	bnez	t4, arg4_floatp
 	REG_L	a3, 3*FFI_SIZEOF_ARG(t9)
-	b	arg4_next
-arg4_floatp:
+	beqz	t4, arg4_next
 	bne	t4, FFI_TYPE_FLOAT, arg4_doublep
 	l.s	$f15, 3*FFI_SIZEOF_ARG(t9)	
 	b	arg4_next
@@ -160,10 +152,8 @@
 	
 	SRL	t4, t6, 4*FFI_FLAG_BITS
 	and	t4, ((1<<FFI_FLAG_BITS)-1)
-	bnez	t4, arg5_floatp
 	REG_L	a4, 4*FFI_SIZEOF_ARG(t9)
-	b	arg5_next
-arg5_floatp:
+	beqz	t4, arg5_next
 	bne	t4, FFI_TYPE_FLOAT, arg5_doublep
 	l.s	$f16, 4*FFI_SIZEOF_ARG(t9)	
 	b	arg5_next
@@ -173,10 +163,8 @@
 	
 	SRL	t4, t6, 5*FFI_FLAG_BITS
 	and	t4, ((1<<FFI_FLAG_BITS)-1)
-	bnez	t4, arg6_floatp
 	REG_L	a5, 5*FFI_SIZEOF_ARG(t9)
-	b	arg6_next
-arg6_floatp:
+	beqz	t4, arg6_next
 	bne	t4, FFI_TYPE_FLOAT, arg6_doublep
 	l.s	$f17, 5*FFI_SIZEOF_ARG(t9)	
 	b	arg6_next
@@ -186,10 +174,8 @@
 	
 	SRL	t4, t6, 6*FFI_FLAG_BITS
 	and	t4, ((1<<FFI_FLAG_BITS)-1)
-	bnez	t4, arg7_floatp
 	REG_L	a6, 6*FFI_SIZEOF_ARG(t9)
-	b	arg7_next
-arg7_floatp:
+	beqz	t4, arg7_next
 	bne	t4, FFI_TYPE_FLOAT, arg7_doublep
 	l.s	$f18, 6*FFI_SIZEOF_ARG(t9)	
 	b	arg7_next
@@ -199,10 +185,8 @@
 	
 	SRL	t4, t6, 7*FFI_FLAG_BITS
 	and	t4, ((1<<FFI_FLAG_BITS)-1)
-	bnez	t4, arg8_floatp
 	REG_L	a7, 7*FFI_SIZEOF_ARG(t9)
-	b	arg8_next
-arg8_floatp:
+	beqz	t4, arg8_next
 	bne	t4, FFI_TYPE_FLOAT, arg8_doublep
  	l.s	$f19, 7*FFI_SIZEOF_ARG(t9)	
 	b	arg8_next
diff --git a/Modules/_ctypes/libffi/src/nios2/ffi.c b/Modules/_ctypes/libffi/src/nios2/ffi.c
new file mode 100644
index 0000000..2efa033
--- /dev/null
+++ b/Modules/_ctypes/libffi/src/nios2/ffi.c
@@ -0,0 +1,304 @@
+/* libffi support for Altera Nios II.
+
+   Copyright (c) 2013 Mentor Graphics.
+
+   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.  */
+
+
+#include <ffi.h>
+#include <ffi_common.h>
+
+#include <stdlib.h>
+
+/* The Nios II Processor Reference Handbook defines the procedure call
+   ABI as follows.
+
+   Arguments are passed as if a structure containing the types of
+   the arguments were constructed.  The first 16 bytes are passed in r4
+   through r7, the remainder on the stack.  The first 16 bytes of a function
+   taking variable arguments are passed in r4-r7 in the same way.
+
+   Return values of types up to 8 bytes are returned in r2 and r3.  For
+   return values greater than 8 bytes, the caller must allocate memory for
+   the result and pass the address as if it were argument 0.  
+
+   While this isn't specified explicitly in the ABI documentation, GCC
+   promotes integral arguments smaller than int size to 32 bits.
+
+   Also of note, the ABI specifies that all structure objects are
+   aligned to 32 bits even if all their fields have a smaller natural
+   alignment.  See FFI_AGGREGATE_ALIGNMENT.  */
+
+
+/* Declare the assembly language hooks.  */
+
+extern UINT64 ffi_call_sysv (void (*) (char *, extended_cif *),
+			     extended_cif *,
+			     unsigned, 
+			     void (*fn) (void));
+extern void ffi_closure_sysv (void);
+
+/* Perform machine-dependent cif processing.  */
+
+ffi_status ffi_prep_cif_machdep (ffi_cif *cif)
+{
+  /* We always want at least 16 bytes in the parameter block since it
+     simplifies the low-level call function.  Also round the parameter
+     block size up to a multiple of 4 bytes to preserve
+     32-bit alignment of the stack pointer.  */
+  if (cif->bytes < 16)
+    cif->bytes = 16;
+  else
+    cif->bytes = (cif->bytes + 3) & ~3;
+
+  return FFI_OK;
+}
+
+
+/* ffi_prep_args is called by the assembly routine to transfer arguments
+   to the stack using the pointers in the ecif array.
+   Note that the stack buffer is big enough to fit all the arguments,
+   but the first 16 bytes will be copied to registers for the actual
+   call.  */
+
+void ffi_prep_args (char *stack, extended_cif *ecif)
+{
+  char *argp = stack;
+  unsigned int i;
+
+  /* The implicit return value pointer is passed as if it were a hidden
+     first argument.  */
+  if (ecif->cif->rtype->type == FFI_TYPE_STRUCT
+      && ecif->cif->rtype->size > 8)
+    {
+      (*(void **) argp) = ecif->rvalue;
+      argp += 4;
+    }
+
+  for (i = 0; i < ecif->cif->nargs; i++)
+    {
+      void *avalue = ecif->avalue[i];
+      ffi_type *atype = ecif->cif->arg_types[i];
+      size_t size = atype->size;
+      size_t alignment = atype->alignment;
+
+      /* Align argp as appropriate for the argument type.  */
+      if ((alignment - 1) & (unsigned) argp)
+	argp = (char *) ALIGN (argp, alignment);
+
+      /* Copy the argument, promoting integral types smaller than a
+	 word to word size.  */
+      if (size < sizeof (int))
+	{
+	  size = sizeof (int);
+	  switch (atype->type)
+	    {
+	    case FFI_TYPE_SINT8:
+	      *(signed int *) argp = (signed int) *(SINT8 *) avalue;
+	      break;
+		  
+	    case FFI_TYPE_UINT8:
+	      *(unsigned int *) argp = (unsigned int) *(UINT8 *) avalue;
+	      break;
+		  
+	    case FFI_TYPE_SINT16:
+	      *(signed int *) argp = (signed int) *(SINT16 *) avalue;
+	      break;
+		  
+	    case FFI_TYPE_UINT16:
+	      *(unsigned int *) argp = (unsigned int) *(UINT16 *) avalue;
+	      break;
+
+	    case FFI_TYPE_STRUCT:
+	      memcpy (argp, avalue, atype->size);
+	      break;
+
+	    default:
+	      FFI_ASSERT(0);
+	    }
+	}
+      else if (size == sizeof (int))
+	*(unsigned int *) argp = (unsigned int) *(UINT32 *) avalue;
+      else
+	memcpy (argp, avalue, size);
+      argp += size;
+    }
+}
+
+
+/* Call FN using the prepared CIF.  RVALUE points to space allocated by
+   the caller for the return value, and AVALUE is an array of argument
+   pointers.  */
+
+void ffi_call (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue)
+{
+
+  extended_cif ecif;
+  UINT64 result;
+
+  /* If bigret is true, this is the case where a return value of larger
+     than 8 bytes is handled by being passed by reference as an implicit
+     argument.  */
+  int bigret = (cif->rtype->type == FFI_TYPE_STRUCT
+		&& cif->rtype->size > 8);
+
+  ecif.cif = cif;
+  ecif.avalue = avalue;
+
+  /* Allocate space for return value if this is the pass-by-reference case
+     and the caller did not provide a buffer.  */
+  if (rvalue == NULL && bigret)
+    ecif.rvalue = alloca (cif->rtype->size);
+  else
+    ecif.rvalue = rvalue;
+
+  result = ffi_call_sysv (ffi_prep_args, &ecif, cif->bytes, fn);
+
+  /* Now result contains the 64 bit contents returned from fn in
+     r2 and r3.  Copy the value of the appropriate size to the user-provided
+     rvalue buffer.  */
+  if (rvalue && !bigret)
+    switch (cif->rtype->size)
+      {
+      case 1:
+	*(UINT8 *)rvalue = (UINT8) result;
+	break;
+      case 2:
+	*(UINT16 *)rvalue = (UINT16) result;
+	break;
+      case 4:
+	*(UINT32 *)rvalue = (UINT32) result;
+	break;
+      case 8:
+	*(UINT64 *)rvalue = (UINT64) result;
+	break;
+      default:
+	memcpy (rvalue, (void *)&result, cif->rtype->size);
+	break;
+      }
+}
+
+/* This function is invoked from the closure trampoline to invoke
+   CLOSURE with argument block ARGS.  Parse ARGS according to
+   CLOSURE->cfi and invoke CLOSURE->fun.  */
+
+static UINT64
+ffi_closure_helper (unsigned char *args,
+		    ffi_closure *closure)
+{
+  ffi_cif *cif = closure->cif;
+  unsigned char *argp = args;
+  void **parsed_args = alloca (cif->nargs * sizeof (void *));
+  UINT64 result;
+  void *retptr;
+  unsigned int i;
+
+  /* First figure out what to do about the return type.  If this is the
+     big-structure-return case, the first arg is the hidden return buffer
+     allocated by the caller.  */
+  if (cif->rtype->type == FFI_TYPE_STRUCT
+      && cif->rtype->size > 8)
+    {
+      retptr = *((void **) argp);
+      argp += 4;
+    }
+  else
+    retptr = (void *) &result;
+
+  /* Fill in the array of argument pointers.  */
+  for (i = 0; i < cif->nargs; i++)
+    {
+      size_t size = cif->arg_types[i]->size;
+      size_t alignment = cif->arg_types[i]->alignment;
+
+      /* Align argp as appropriate for the argument type.  */
+      if ((alignment - 1) & (unsigned) argp)
+	argp = (char *) ALIGN (argp, alignment);
+
+      /* Arguments smaller than an int are promoted to int.  */
+      if (size < sizeof (int))
+	size = sizeof (int);
+
+      /* Store the pointer.  */
+      parsed_args[i] = argp;
+      argp += size;
+    }
+
+  /* Call the user-supplied function.  */
+  (closure->fun) (cif, retptr, parsed_args, closure->user_data);
+  return result;
+}
+
+
+/* Initialize CLOSURE with a trampoline to call FUN with
+   CIF and USER_DATA.  */
+ffi_status
+ffi_prep_closure_loc (ffi_closure* closure,
+		      ffi_cif* cif,
+		      void (*fun) (ffi_cif*, void*, void**, void*),
+		      void *user_data,
+		      void *codeloc)
+{
+  unsigned int *tramp = (unsigned int *) &closure->tramp[0];
+  int i;
+
+  if (cif->abi != FFI_SYSV)
+    return FFI_BAD_ABI;
+
+  /* The trampoline looks like:
+       movhi r8, %hi(ffi_closure_sysv)
+       ori r8, r8, %lo(ffi_closure_sysv)
+       movhi r9, %hi(ffi_closure_helper)
+       ori r0, r9, %lo(ffi_closure_helper)
+       movhi r10, %hi(closure)
+       ori r10, r10, %lo(closure)
+       jmp r8
+     and then ffi_closure_sysv retrieves the closure pointer out of r10
+     in addition to the arguments passed in the normal way for the call,
+     and invokes ffi_closure_helper.  We encode the pointer to
+     ffi_closure_helper in the trampoline because making a PIC call
+     to it in ffi_closure_sysv would be messy (it would have to indirect
+     through the GOT).  */
+
+#define HI(x) ((((unsigned int) (x)) >> 16) & 0xffff)
+#define LO(x) (((unsigned int) (x)) & 0xffff)
+  tramp[0] = (0 << 27) | (8 << 22) | (HI (ffi_closure_sysv) << 6) | 0x34;
+  tramp[1] = (8 << 27) | (8 << 22) | (LO (ffi_closure_sysv) << 6) | 0x14;
+  tramp[2] = (0 << 27) | (9 << 22) | (HI (ffi_closure_helper) << 6) | 0x34;
+  tramp[3] = (9 << 27) | (9 << 22) | (LO (ffi_closure_helper) << 6) | 0x14;
+  tramp[4] = (0 << 27) | (10 << 22) | (HI (closure) << 6) | 0x34;
+  tramp[5] = (10 << 27) | (10 << 22) | (LO (closure) << 6) | 0x14;
+  tramp[6] = (8 << 27) | (0x0d << 11) | 0x3a;
+#undef HI
+#undef LO
+
+  /* Flush the caches.
+     See Example 9-4 in the Nios II Software Developer's Handbook.  */
+  for (i = 0; i < 7; i++)
+    asm volatile ("flushd 0(%0); flushi %0" :: "r"(tramp + i) : "memory");
+  asm volatile ("flushp" ::: "memory");
+
+  closure->cif = cif;
+  closure->fun = fun;
+  closure->user_data = user_data;
+
+  return FFI_OK;
+}
+
diff --git a/Modules/_ctypes/libffi/src/nios2/ffitarget.h b/Modules/_ctypes/libffi/src/nios2/ffitarget.h
new file mode 100644
index 0000000..134d118
--- /dev/null
+++ b/Modules/_ctypes/libffi/src/nios2/ffitarget.h
@@ -0,0 +1,52 @@
+/* libffi target includes for Altera Nios II.
+
+   Copyright (c) 2013 Mentor Graphics.
+
+   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.  */
+
+
+#ifndef LIBFFI_TARGET_H
+#define LIBFFI_TARGET_H
+
+#ifndef LIBFFI_H
+#error "Please do not include ffitarget.h directly into your source.  Use ffi.h instead."
+#endif
+
+#ifndef LIBFFI_ASM
+typedef unsigned long          ffi_arg;
+typedef signed long            ffi_sarg;
+
+typedef enum ffi_abi {
+  FFI_FIRST_ABI = 0,
+  FFI_SYSV,
+  FFI_LAST_ABI,
+  FFI_DEFAULT_ABI = FFI_SYSV
+} ffi_abi;
+#endif
+
+/* Structures have a 4-byte alignment even if all the fields have lesser
+   alignment requirements.  */
+#define FFI_AGGREGATE_ALIGNMENT 4
+
+#define FFI_CLOSURES 1
+#define FFI_TRAMPOLINE_SIZE 28   /* 7 instructions */
+#define FFI_NATIVE_RAW_API 0
+
+#endif
diff --git a/Modules/_ctypes/libffi/src/nios2/sysv.S b/Modules/_ctypes/libffi/src/nios2/sysv.S
new file mode 100644
index 0000000..75f442b
--- /dev/null
+++ b/Modules/_ctypes/libffi/src/nios2/sysv.S
@@ -0,0 +1,136 @@
+/* Low-level libffi support for Altera Nios II.
+
+   Copyright (c) 2013 Mentor Graphics.
+
+   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.  */
+
+/* This function is declared on the C side as 
+
+   extern UINT64 ffi_call_sysv (void (*arghook) (char *, extended_cif *),
+	  		        extended_cif *ecif,
+				unsigned nbytes, 
+				void (*fn) (void));
+	
+   On input, the arguments appear as
+	r4 = arghook
+	r5 = ecif
+	r6 = nbytes
+	r7 = fn
+*/
+
+	.section	.text
+	.align	2
+	.global	ffi_call_sysv
+	.type	ffi_call_sysv, @function
+
+ffi_call_sysv:
+	.cfi_startproc
+
+	/* Create the stack frame, saving r16 so we can use it locally.  */
+	addi	sp, sp, -12
+	.cfi_def_cfa_offset 12
+	stw	ra, 8(sp)
+	stw	fp, 4(sp)
+	stw	r16, 0(sp)
+	.cfi_offset 31, -4
+	.cfi_offset 28, -8
+	.cfi_offset 16, -12
+	mov	fp, sp
+	.cfi_def_cfa_register 28
+	mov	r16, r7
+
+	/* Adjust the stack pointer to create the argument buffer
+	   nbytes long.  */
+	sub	sp, sp, r6
+
+	/* Call the arghook function.  */
+	mov	r2, r4		/* fn */
+	mov	r4, sp		/* argbuffer */
+	callr	r2		/* r5 already contains ecif */
+
+	/* Pop off the first 16 bytes of the argument buffer on the stack,
+	   transferring the contents to the argument registers.  */
+	ldw	r4, 0(sp)
+	ldw	r5, 4(sp)
+	ldw	r6, 8(sp)
+	ldw	r7, 12(sp)
+	addi	sp, sp, 16
+
+	/* Call the user function, which leaves its result in r2 and r3.  */
+	callr	r16
+
+	/* Pop off the stack frame.  */
+	mov	sp, fp
+	ldw	ra, 8(sp)
+	ldw	fp, 4(sp)
+	ldw	r16, 0(sp)
+	addi	sp, sp, 12
+	ret
+	.cfi_endproc
+	.size	ffi_call_sysv, .-ffi_call_sysv
+
+
+/* Closure trampolines jump here after putting the C helper address
+   in r9 and the closure pointer in r10.  The user-supplied arguments
+   to the closure are in the normal places, in r4-r7 and on the
+   stack.  Push the register arguments on the stack too and then call the
+   C helper function to deal with them.  */
+   
+	.section	.text
+	.align	2
+	.global	ffi_closure_sysv
+	.type	ffi_closure_sysv, @function
+
+ffi_closure_sysv:
+	.cfi_startproc
+
+	/* Create the stack frame, pushing the register args on the stack
+	   just below the stack args.  This is the same trick illustrated
+	   in Figure 7-3 in the Nios II Processor Reference Handbook, used
+	   for variable arguments and structures passed by value.  */
+	addi	sp, sp, -20
+	.cfi_def_cfa_offset 20
+	stw	ra, 0(sp)
+	.cfi_offset 31, -20
+	stw	r4, 4(sp)
+	.cfi_offset 4, -16
+	stw	r5, 8(sp)
+	.cfi_offset 5, -12
+	stw	r6, 12(sp)
+	.cfi_offset 6, -8
+	stw	r7, 16(sp)
+	.cfi_offset 7, -4
+
+	/* Call the helper.
+	   r4 = pointer to arguments on stack
+	   r5 = closure pointer (loaded in r10 by the trampoline)
+	   r9 = address of helper function (loaded by trampoline) */
+	addi	r4, sp, 4
+	mov	r5, r10
+	callr	r9
+	
+	/* Pop the stack and return.  */
+	ldw	ra, 0(sp)
+	addi	sp, sp, 20
+	.cfi_def_cfa_offset -20
+	ret
+	.cfi_endproc
+	.size	ffi_closure_sysv, .-ffi_closure_sysv
+
diff --git a/Modules/_ctypes/libffi/src/powerpc/darwin.S b/Modules/_ctypes/libffi/src/powerpc/darwin.S
index 4f987dc..066eb82 100644
--- a/Modules/_ctypes/libffi/src/powerpc/darwin.S
+++ b/Modules/_ctypes/libffi/src/powerpc/darwin.S
@@ -318,11 +318,6 @@
 
 #define EH_DATA_ALIGN_FACT MODE_CHOICE(0x7c,0x78)
 
-	.static_data
-	.align LOG2_GPR_BYTES
-LLFB0$non_lazy_ptr:
-	.g_long Lstartcode
-
 	.section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support
 EH_frame1:
 	.set	L$set$0,LECIE1-LSCIE1
@@ -335,7 +330,7 @@
 	.byte	EH_DATA_ALIGN_FACT ; sleb128 -4; CIE Data Alignment Factor
 	.byte	0x41	; CIE RA Column
 	.byte	0x1	; uleb128 0x1; Augmentation size
-	.byte	0x10	; FDE Encoding (indirect pcrel)
+	.byte	0x10	; FDE Encoding (pcrel)
 	.byte	0xc	; DW_CFA_def_cfa
 	.byte	0x1	; uleb128 0x1
 	.byte	0x0	; uleb128 0x0
@@ -349,7 +344,7 @@
 	.long	L$set$1	; FDE Length
 LASFDE1:
 	.long	LASFDE1-EH_frame1 ; FDE CIE offset
-	.g_long	LLFB0$non_lazy_ptr-.	; FDE initial location
+	.g_long	Lstartcode-.	; FDE initial location
 	.set	L$set$3,LFE1-Lstartcode
 	.g_long	L$set$3	; FDE address range
 	.byte   0x0     ; uleb128 0x0; Augmentation size
diff --git a/Modules/_ctypes/libffi/src/powerpc/darwin_closure.S b/Modules/_ctypes/libffi/src/powerpc/darwin_closure.S
index 3f6790f..c7734d4 100644
--- a/Modules/_ctypes/libffi/src/powerpc/darwin_closure.S
+++ b/Modules/_ctypes/libffi/src/powerpc/darwin_closure.S
@@ -192,7 +192,7 @@
 	lg	r0,0(r3)		; size => r0
 	lhz	r3,FFI_TYPE_TYPE(r3)	; type => r3
 
-	/* The helper will have intercepted struture returns and inserted
+	/* The helper will have intercepted structure returns and inserted
 	   the caller`s destination address for structs returned by ref.  */
 
 	/* r3 contains the return type  so use it to look up in a table
@@ -467,11 +467,6 @@
 #define EH_FRAME_OFFSETA MODE_CHOICE(176,0x90)
 #define EH_FRAME_OFFSETB MODE_CHOICE(1,3)
 
-	.static_data
-	.align LOG2_GPR_BYTES
-LLFB1$non_lazy_ptr:
-	.g_long Lstartcode
-
 	.section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support
 EH_frame1:
 	.set	L$set$0,LECIE1-LSCIE1
@@ -484,7 +479,7 @@
 	.byte	EH_DATA_ALIGN_FACT ; sleb128 -4; CIE Data Alignment Factor
 	.byte	0x41	; CIE RA Column
 	.byte	0x1	; uleb128 0x1; Augmentation size
-	.byte	0x10	; FDE Encoding (indirect pcrel)
+	.byte	0x10	; FDE Encoding (pcrel)
 	.byte	0xc	; DW_CFA_def_cfa
 	.byte	0x1	; uleb128 0x1
 	.byte	0x0	; uleb128 0x0
@@ -498,7 +493,7 @@
 
 LASFDE1:
 	.long	LASFDE1-EH_frame1	; FDE CIE offset
-	.g_long	LLFB1$non_lazy_ptr-.	; FDE initial location
+	.g_long	Lstartcode-.	; FDE initial location
 	.set	L$set$3,LFE1-Lstartcode
 	.g_long	L$set$3	; FDE address range
 	.byte   0x0     ; uleb128 0x0; Augmentation size
@@ -523,12 +518,12 @@
 L_ffi_closure_helper_DARWIN$stub:
 	.indirect_symbol _ffi_closure_helper_DARWIN
 	mflr r0
-	bcl 20,31,"L00000000001$spb"
-"L00000000001$spb":
+	bcl 20,31,"L1$spb"
+"L1$spb":
 	mflr r11
-	addis r11,r11,ha16(L_ffi_closure_helper_DARWIN$lazy_ptr-"L00000000001$spb")
+	addis r11,r11,ha16(L_ffi_closure_helper_DARWIN$lazy_ptr-"L1$spb")
 	mtlr r0
-	lwzu r12,lo16(L_ffi_closure_helper_DARWIN$lazy_ptr-"L00000000001$spb")(r11)
+	lwzu r12,lo16(L_ffi_closure_helper_DARWIN$lazy_ptr-"L1$spb")(r11)
 	mtctr r12
 	bctr
 	.lazy_symbol_pointer
@@ -542,12 +537,12 @@
 L_darwin64_struct_ret_by_value_p$stub:
 	.indirect_symbol _darwin64_struct_ret_by_value_p
 	mflr r0
-	bcl 20,31,"L00000000002$spb"
-"L00000000002$spb":
+	bcl 20,31,"L2$spb"
+"L2$spb":
 	mflr r11
-	addis r11,r11,ha16(L_darwin64_struct_ret_by_value_p$lazy_ptr-"L00000000002$spb")
+	addis r11,r11,ha16(L_darwin64_struct_ret_by_value_p$lazy_ptr-"L2$spb")
 	mtlr r0
-	lwzu r12,lo16(L_darwin64_struct_ret_by_value_p$lazy_ptr-"L00000000002$spb")(r11)
+	lwzu r12,lo16(L_darwin64_struct_ret_by_value_p$lazy_ptr-"L2$spb")(r11)
 	mtctr r12
 	bctr
 	.lazy_symbol_pointer
@@ -560,12 +555,12 @@
 L_darwin64_pass_struct_floats$stub:
 	.indirect_symbol _darwin64_pass_struct_floats
 	mflr r0
-	bcl 20,31,"L00000000003$spb"
-"L00000000003$spb":
+	bcl 20,31,"L3$spb"
+"L3$spb":
 	mflr r11
-	addis r11,r11,ha16(L_darwin64_pass_struct_floats$lazy_ptr-"L00000000003$spb")
+	addis r11,r11,ha16(L_darwin64_pass_struct_floats$lazy_ptr-"L3$spb")
 	mtlr r0
-	lwzu r12,lo16(L_darwin64_pass_struct_floats$lazy_ptr-"L00000000003$spb")(r11)
+	lwzu r12,lo16(L_darwin64_pass_struct_floats$lazy_ptr-"L3$spb")(r11)
 	mtctr r12
 	bctr
 	.lazy_symbol_pointer
diff --git a/Modules/_ctypes/libffi/src/powerpc/ffi.c b/Modules/_ctypes/libffi/src/powerpc/ffi.c
index 5381d3d..efb441b 100644
--- a/Modules/_ctypes/libffi/src/powerpc/ffi.c
+++ b/Modules/_ctypes/libffi/src/powerpc/ffi.c
@@ -1,5 +1,6 @@
 /* -----------------------------------------------------------------------
-   ffi.c - Copyright (C) 2011 Anthony Green
+   ffi.c - Copyright (C) 2013 IBM
+           Copyright (C) 2011 Anthony Green
            Copyright (C) 2011 Kyle Moffett
            Copyright (C) 2008 Red Hat, Inc
            Copyright (C) 2007, 2008 Free Software Foundation, Inc
@@ -27,992 +28,103 @@
    OTHER DEALINGS IN THE SOFTWARE.
    ----------------------------------------------------------------------- */
 
-#include <ffi.h>
-#include <ffi_common.h>
+#include "ffi.h"
+#include "ffi_common.h"
+#include "ffi_powerpc.h"
 
-#include <stdlib.h>
-#include <stdio.h>
-
-
-extern void ffi_closure_SYSV (void);
-extern void FFI_HIDDEN ffi_closure_LINUX64 (void);
-
-enum {
-  /* The assembly depends on these exact flags.  */
-  FLAG_RETURNS_SMST	= 1 << (31-31), /* Used for FFI_SYSV small structs.  */
-  FLAG_RETURNS_NOTHING  = 1 << (31-30), /* These go in cr7 */
-#ifndef __NO_FPRS__
-  FLAG_RETURNS_FP       = 1 << (31-29),
-#endif
-  FLAG_RETURNS_64BITS   = 1 << (31-28),
-
-  FLAG_RETURNS_128BITS  = 1 << (31-27), /* cr6  */
-
-  FLAG_SYSV_SMST_R4     = 1 << (31-26), /* use r4 for FFI_SYSV 8 byte
-					   structs.  */
-  FLAG_SYSV_SMST_R3     = 1 << (31-25), /* use r3 for FFI_SYSV 4 byte
-					   structs.  */
-
-  FLAG_ARG_NEEDS_COPY   = 1 << (31- 7),
-#ifndef __NO_FPRS__
-  FLAG_FP_ARGUMENTS     = 1 << (31- 6), /* cr1.eq; specified by ABI */
-#endif
-  FLAG_4_GPR_ARGUMENTS  = 1 << (31- 5),
-  FLAG_RETVAL_REFERENCE = 1 << (31- 4)
-};
-
-/* About the SYSV ABI.  */
-#define ASM_NEEDS_REGISTERS 4
-#define NUM_GPR_ARG_REGISTERS 8
-#ifndef __NO_FPRS__
-# define NUM_FPR_ARG_REGISTERS 8
-#endif
-
-/* ffi_prep_args_SYSV is called by the assembly routine once stack space
-   has been allocated for the function's arguments.
-
-   The stack layout we want looks like this:
-
-   |   Return address from ffi_call_SYSV 4bytes	|	higher addresses
-   |--------------------------------------------|
-   |   Previous backchain pointer	4	|       stack pointer here
-   |--------------------------------------------|<+ <<<	on entry to
-   |   Saved r28-r31			4*4	| |	ffi_call_SYSV
-   |--------------------------------------------| |
-   |   GPR registers r3-r10		8*4	| |	ffi_call_SYSV
-   |--------------------------------------------| |
-   |   FPR registers f1-f8 (optional)	8*8	| |
-   |--------------------------------------------| |	stack	|
-   |   Space for copied structures		| |	grows	|
-   |--------------------------------------------| |	down    V
-   |   Parameters that didn't fit in registers  | |
-   |--------------------------------------------| |	lower addresses
-   |   Space for callee's LR		4	| |
-   |--------------------------------------------| |	stack pointer here
-   |   Current backchain pointer	4	|-/	during
-   |--------------------------------------------|   <<<	ffi_call_SYSV
-
-*/
-
-void
-ffi_prep_args_SYSV (extended_cif *ecif, unsigned *const stack)
-{
-  const unsigned bytes = ecif->cif->bytes;
-  const unsigned flags = ecif->cif->flags;
-
-  typedef union {
-    char *c;
-    unsigned *u;
-    long long *ll;
-    float *f;
-    double *d;
-  } valp;
-
-  /* 'stacktop' points at the previous backchain pointer.  */
-  valp stacktop;
-
-  /* 'gpr_base' points at the space for gpr3, and grows upwards as
-     we use GPR registers.  */
-  valp gpr_base;
-  int intarg_count;
-
-#ifndef __NO_FPRS__
-  /* 'fpr_base' points at the space for fpr1, and grows upwards as
-     we use FPR registers.  */
-  valp fpr_base;
-  int fparg_count;
-#endif
-
-  /* 'copy_space' grows down as we put structures in it.  It should
-     stay 16-byte aligned.  */
-  valp copy_space;
-
-  /* 'next_arg' grows up as we put parameters in it.  */
-  valp next_arg;
-
-  int i;
-  ffi_type **ptr;
-  union {
-    void **v;
-    char **c;
-    signed char **sc;
-    unsigned char **uc;
-    signed short **ss;
-    unsigned short **us;
-    unsigned int **ui;
-    long long **ll;
-    float **f;
-    double **d;
-  } p_argv;
-  size_t struct_copy_size;
-  unsigned gprvalue;
-#ifndef __NO_FPRS__
-  double double_tmp;
-#endif
-
-  stacktop.c = (char *) stack + bytes;
-  gpr_base.u = stacktop.u - ASM_NEEDS_REGISTERS - NUM_GPR_ARG_REGISTERS;
-  intarg_count = 0;
-#ifndef __NO_FPRS__
-  fpr_base.d = gpr_base.d - NUM_FPR_ARG_REGISTERS;
-  fparg_count = 0;
-  copy_space.c = ((flags & FLAG_FP_ARGUMENTS) ? fpr_base.c : gpr_base.c);
-#else
-  copy_space.c = gpr_base.c;
-#endif
-  next_arg.u = stack + 2;
-
-  /* Check that everything starts aligned properly.  */
-  FFI_ASSERT (((unsigned long) (char *) stack & 0xF) == 0);
-  FFI_ASSERT (((unsigned long) copy_space.c & 0xF) == 0);
-  FFI_ASSERT (((unsigned long) stacktop.c & 0xF) == 0);
-  FFI_ASSERT ((bytes & 0xF) == 0);
-  FFI_ASSERT (copy_space.c >= next_arg.c);
-
-  /* Deal with return values that are actually pass-by-reference.  */
-  if (flags & FLAG_RETVAL_REFERENCE)
-    {
-      *gpr_base.u++ = (unsigned long) (char *) ecif->rvalue;
-      intarg_count++;
-    }
-
-  /* Now for the arguments.  */
-  p_argv.v = ecif->avalue;
-  for (ptr = ecif->cif->arg_types, i = ecif->cif->nargs;
-       i > 0;
-       i--, ptr++, p_argv.v++)
-    {
-      unsigned short typenum = (*ptr)->type;
-
-      /* We may need to handle some values depending on ABI */
-      if (ecif->cif->abi == FFI_LINUX_SOFT_FLOAT) {
-		if (typenum == FFI_TYPE_FLOAT)
-			typenum = FFI_TYPE_UINT32;
-		if (typenum == FFI_TYPE_DOUBLE)
-			typenum = FFI_TYPE_UINT64;
-		if (typenum == FFI_TYPE_LONGDOUBLE)
-			typenum = FFI_TYPE_UINT128;
-      } else if (ecif->cif->abi != FFI_LINUX) {
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
-		if (typenum == FFI_TYPE_LONGDOUBLE)
-			typenum = FFI_TYPE_STRUCT;
-#endif
-      }
-
-      /* Now test the translated value */
-      switch (typenum) {
-#ifndef __NO_FPRS__
-	case FFI_TYPE_FLOAT:
-	  /* With FFI_LINUX_SOFT_FLOAT floats are handled like UINT32.  */
-	  double_tmp = **p_argv.f;
-	  if (fparg_count >= NUM_FPR_ARG_REGISTERS)
-	    {
-	      *next_arg.f = (float) double_tmp;
-	      next_arg.u += 1;
-	      intarg_count++;
-	    }
-	  else
-	    *fpr_base.d++ = double_tmp;
-	  fparg_count++;
-	  FFI_ASSERT (flags & FLAG_FP_ARGUMENTS);
-	  break;
-
-	case FFI_TYPE_DOUBLE:
-	  /* With FFI_LINUX_SOFT_FLOAT doubles are handled like UINT64.  */
-	  double_tmp = **p_argv.d;
-
-	  if (fparg_count >= NUM_FPR_ARG_REGISTERS)
-	    {
-	      if (intarg_count >= NUM_GPR_ARG_REGISTERS
-		  && intarg_count % 2 != 0)
-		{
-		  intarg_count++;
-		  next_arg.u++;
-		}
-	      *next_arg.d = double_tmp;
-	      next_arg.u += 2;
-	    }
-	  else
-	    *fpr_base.d++ = double_tmp;
-	  fparg_count++;
-	  FFI_ASSERT (flags & FLAG_FP_ARGUMENTS);
-	  break;
-
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
-	case FFI_TYPE_LONGDOUBLE:
-	      double_tmp = (*p_argv.d)[0];
-
-	      if (fparg_count >= NUM_FPR_ARG_REGISTERS - 1)
-		{
-		  if (intarg_count >= NUM_GPR_ARG_REGISTERS
-		      && intarg_count % 2 != 0)
-		    {
-		      intarg_count++;
-		      next_arg.u++;
-		    }
-		  *next_arg.d = double_tmp;
-		  next_arg.u += 2;
-		  double_tmp = (*p_argv.d)[1];
-		  *next_arg.d = double_tmp;
-		  next_arg.u += 2;
-		}
-	      else
-		{
-		  *fpr_base.d++ = double_tmp;
-		  double_tmp = (*p_argv.d)[1];
-		  *fpr_base.d++ = double_tmp;
-		}
-
-	      fparg_count += 2;
-	      FFI_ASSERT (flags & FLAG_FP_ARGUMENTS);
-	  break;
-#endif
-#endif /* have FPRs */
-
-	/*
-	 * The soft float ABI for long doubles works like this, a long double
-	 * is passed in four consecutive GPRs if available.  A maximum of 2
-	 * long doubles can be passed in gprs.  If we do not have 4 GPRs
-	 * left, the long double is passed on the stack, 4-byte aligned.
-	 */
-	case FFI_TYPE_UINT128: {
-		unsigned int int_tmp = (*p_argv.ui)[0];
-		unsigned int ii;
-		if (intarg_count >= NUM_GPR_ARG_REGISTERS - 3) {
-			if (intarg_count < NUM_GPR_ARG_REGISTERS)
-				intarg_count += NUM_GPR_ARG_REGISTERS - intarg_count;
-			*(next_arg.u++) = int_tmp;
-			for (ii = 1; ii < 4; ii++) {
-				int_tmp = (*p_argv.ui)[ii];
-				*(next_arg.u++) = int_tmp;
-			}
-		} else {
-			*(gpr_base.u++) = int_tmp;
-			for (ii = 1; ii < 4; ii++) {
-				int_tmp = (*p_argv.ui)[ii];
-				*(gpr_base.u++) = int_tmp;
-			}
-		}
-		intarg_count += 4;
-		break;
-	}
-
-	case FFI_TYPE_UINT64:
-	case FFI_TYPE_SINT64:
-	  if (intarg_count == NUM_GPR_ARG_REGISTERS-1)
-	    intarg_count++;
-	  if (intarg_count >= NUM_GPR_ARG_REGISTERS)
-	    {
-	      if (intarg_count % 2 != 0)
-		{
-		  intarg_count++;
-		  next_arg.u++;
-		}
-	      *next_arg.ll = **p_argv.ll;
-	      next_arg.u += 2;
-	    }
-	  else
-	    {
-	      /* whoops: abi states only certain register pairs
-	       * can be used for passing long long int
-	       * specifically (r3,r4), (r5,r6), (r7,r8),
-	       * (r9,r10) and if next arg is long long but
-	       * not correct starting register of pair then skip
-	       * until the proper starting register
-	       */
-	      if (intarg_count % 2 != 0)
-		{
-		  intarg_count ++;
-		  gpr_base.u++;
-		}
-	      *gpr_base.ll++ = **p_argv.ll;
-	    }
-	  intarg_count += 2;
-	  break;
-
-	case FFI_TYPE_STRUCT:
-	  struct_copy_size = ((*ptr)->size + 15) & ~0xF;
-	  copy_space.c -= struct_copy_size;
-	  memcpy (copy_space.c, *p_argv.c, (*ptr)->size);
-
-	  gprvalue = (unsigned long) copy_space.c;
-
-	  FFI_ASSERT (copy_space.c > next_arg.c);
-	  FFI_ASSERT (flags & FLAG_ARG_NEEDS_COPY);
-	  goto putgpr;
-
-	case FFI_TYPE_UINT8:
-	  gprvalue = **p_argv.uc;
-	  goto putgpr;
-	case FFI_TYPE_SINT8:
-	  gprvalue = **p_argv.sc;
-	  goto putgpr;
-	case FFI_TYPE_UINT16:
-	  gprvalue = **p_argv.us;
-	  goto putgpr;
-	case FFI_TYPE_SINT16:
-	  gprvalue = **p_argv.ss;
-	  goto putgpr;
-
-	case FFI_TYPE_INT:
-	case FFI_TYPE_UINT32:
-	case FFI_TYPE_SINT32:
-	case FFI_TYPE_POINTER:
-
-	  gprvalue = **p_argv.ui;
-
-	putgpr:
-	  if (intarg_count >= NUM_GPR_ARG_REGISTERS)
-	    *next_arg.u++ = gprvalue;
-	  else
-	    *gpr_base.u++ = gprvalue;
-	  intarg_count++;
-	  break;
-	}
-    }
-
-  /* Check that we didn't overrun the stack...  */
-  FFI_ASSERT (copy_space.c >= next_arg.c);
-  FFI_ASSERT (gpr_base.u <= stacktop.u - ASM_NEEDS_REGISTERS);
-  /* The assert below is testing that the number of integer arguments agrees
-     with the number found in ffi_prep_cif_machdep().  However, intarg_count
-     is incremeneted whenever we place an FP arg on the stack, so account for
-     that before our assert test.  */
-#ifndef __NO_FPRS__
-  if (fparg_count > NUM_FPR_ARG_REGISTERS)
-    intarg_count -= fparg_count - NUM_FPR_ARG_REGISTERS;
-  FFI_ASSERT (fpr_base.u
-	      <= stacktop.u - ASM_NEEDS_REGISTERS - NUM_GPR_ARG_REGISTERS);
-#endif
-  FFI_ASSERT (flags & FLAG_4_GPR_ARGUMENTS || intarg_count <= 4);
-}
-
-/* About the LINUX64 ABI.  */
-enum {
-  NUM_GPR_ARG_REGISTERS64 = 8,
-  NUM_FPR_ARG_REGISTERS64 = 13
-};
-enum { ASM_NEEDS_REGISTERS64 = 4 };
-
-/* ffi_prep_args64 is called by the assembly routine once stack space
-   has been allocated for the function's arguments.
-
-   The stack layout we want looks like this:
-
-   |   Ret addr from ffi_call_LINUX64	8bytes	|	higher addresses
-   |--------------------------------------------|
-   |   CR save area			8bytes	|
-   |--------------------------------------------|
-   |   Previous backchain pointer	8	|	stack pointer here
-   |--------------------------------------------|<+ <<<	on entry to
-   |   Saved r28-r31			4*8	| |	ffi_call_LINUX64
-   |--------------------------------------------| |
-   |   GPR registers r3-r10		8*8	| |
-   |--------------------------------------------| |
-   |   FPR registers f1-f13 (optional)	13*8	| |
-   |--------------------------------------------| |
-   |   Parameter save area		        | |
-   |--------------------------------------------| |
-   |   TOC save area			8	| |
-   |--------------------------------------------| |	stack	|
-   |   Linker doubleword		8	| |	grows	|
-   |--------------------------------------------| |	down	V
-   |   Compiler doubleword		8	| |
-   |--------------------------------------------| |	lower addresses
-   |   Space for callee's LR		8	| |
-   |--------------------------------------------| |
-   |   CR save area			8	| |
-   |--------------------------------------------| |	stack pointer here
-   |   Current backchain pointer	8	|-/	during
-   |--------------------------------------------|   <<<	ffi_call_LINUX64
-
-*/
-
+#if HAVE_LONG_DOUBLE_VARIANT
+/* Adjust ffi_type_longdouble.  */
 void FFI_HIDDEN
-ffi_prep_args64 (extended_cif *ecif, unsigned long *const stack)
+ffi_prep_types (ffi_abi abi)
 {
-  const unsigned long bytes = ecif->cif->bytes;
-  const unsigned long flags = ecif->cif->flags;
-
-  typedef union {
-    char *c;
-    unsigned long *ul;
-    float *f;
-    double *d;
-  } valp;
-
-  /* 'stacktop' points at the previous backchain pointer.  */
-  valp stacktop;
-
-  /* 'next_arg' points at the space for gpr3, and grows upwards as
-     we use GPR registers, then continues at rest.  */
-  valp gpr_base;
-  valp gpr_end;
-  valp rest;
-  valp next_arg;
-
-  /* 'fpr_base' points at the space for fpr3, and grows upwards as
-     we use FPR registers.  */
-  valp fpr_base;
-  int fparg_count;
-
-  int i, words;
-  ffi_type **ptr;
-  double double_tmp;
-  union {
-    void **v;
-    char **c;
-    signed char **sc;
-    unsigned char **uc;
-    signed short **ss;
-    unsigned short **us;
-    signed int **si;
-    unsigned int **ui;
-    unsigned long **ul;
-    float **f;
-    double **d;
-  } p_argv;
-  unsigned long gprvalue;
-
-  stacktop.c = (char *) stack + bytes;
-  gpr_base.ul = stacktop.ul - ASM_NEEDS_REGISTERS64 - NUM_GPR_ARG_REGISTERS64;
-  gpr_end.ul = gpr_base.ul + NUM_GPR_ARG_REGISTERS64;
-  rest.ul = stack + 6 + NUM_GPR_ARG_REGISTERS64;
-  fpr_base.d = gpr_base.d - NUM_FPR_ARG_REGISTERS64;
-  fparg_count = 0;
-  next_arg.ul = gpr_base.ul;
-
-  /* Check that everything starts aligned properly.  */
-  FFI_ASSERT (((unsigned long) (char *) stack & 0xF) == 0);
-  FFI_ASSERT (((unsigned long) stacktop.c & 0xF) == 0);
-  FFI_ASSERT ((bytes & 0xF) == 0);
-
-  /* Deal with return values that are actually pass-by-reference.  */
-  if (flags & FLAG_RETVAL_REFERENCE)
-    *next_arg.ul++ = (unsigned long) (char *) ecif->rvalue;
-
-  /* Now for the arguments.  */
-  p_argv.v = ecif->avalue;
-  for (ptr = ecif->cif->arg_types, i = ecif->cif->nargs;
-       i > 0;
-       i--, ptr++, p_argv.v++)
-    {
-      switch ((*ptr)->type)
-	{
-	case FFI_TYPE_FLOAT:
-	  double_tmp = **p_argv.f;
-	  *next_arg.f = (float) double_tmp;
-	  if (++next_arg.ul == gpr_end.ul)
-	    next_arg.ul = rest.ul;
-	  if (fparg_count < NUM_FPR_ARG_REGISTERS64)
-	    *fpr_base.d++ = double_tmp;
-	  fparg_count++;
-	  FFI_ASSERT (flags & FLAG_FP_ARGUMENTS);
-	  break;
-
-	case FFI_TYPE_DOUBLE:
-	  double_tmp = **p_argv.d;
-	  *next_arg.d = double_tmp;
-	  if (++next_arg.ul == gpr_end.ul)
-	    next_arg.ul = rest.ul;
-	  if (fparg_count < NUM_FPR_ARG_REGISTERS64)
-	    *fpr_base.d++ = double_tmp;
-	  fparg_count++;
-	  FFI_ASSERT (flags & FLAG_FP_ARGUMENTS);
-	  break;
-
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
-	case FFI_TYPE_LONGDOUBLE:
-	  double_tmp = (*p_argv.d)[0];
-	  *next_arg.d = double_tmp;
-	  if (++next_arg.ul == gpr_end.ul)
-	    next_arg.ul = rest.ul;
-	  if (fparg_count < NUM_FPR_ARG_REGISTERS64)
-	    *fpr_base.d++ = double_tmp;
-	  fparg_count++;
-	  double_tmp = (*p_argv.d)[1];
-	  *next_arg.d = double_tmp;
-	  if (++next_arg.ul == gpr_end.ul)
-	    next_arg.ul = rest.ul;
-	  if (fparg_count < NUM_FPR_ARG_REGISTERS64)
-	    *fpr_base.d++ = double_tmp;
-	  fparg_count++;
-	  FFI_ASSERT (__LDBL_MANT_DIG__ == 106);
-	  FFI_ASSERT (flags & FLAG_FP_ARGUMENTS);
-	  break;
-#endif
-
-	case FFI_TYPE_STRUCT:
-	  words = ((*ptr)->size + 7) / 8;
-	  if (next_arg.ul >= gpr_base.ul && next_arg.ul + words > gpr_end.ul)
-	    {
-	      size_t first = gpr_end.c - next_arg.c;
-	      memcpy (next_arg.c, *p_argv.c, first);
-	      memcpy (rest.c, *p_argv.c + first, (*ptr)->size - first);
-	      next_arg.c = rest.c + words * 8 - first;
-	    }
-	  else
-	    {
-	      char *where = next_arg.c;
-
-	      /* Structures with size less than eight bytes are passed
-		 left-padded.  */
-	      if ((*ptr)->size < 8)
-		where += 8 - (*ptr)->size;
-
-	      memcpy (where, *p_argv.c, (*ptr)->size);
-	      next_arg.ul += words;
-	      if (next_arg.ul == gpr_end.ul)
-		next_arg.ul = rest.ul;
-	    }
-	  break;
-
-	case FFI_TYPE_UINT8:
-	  gprvalue = **p_argv.uc;
-	  goto putgpr;
-	case FFI_TYPE_SINT8:
-	  gprvalue = **p_argv.sc;
-	  goto putgpr;
-	case FFI_TYPE_UINT16:
-	  gprvalue = **p_argv.us;
-	  goto putgpr;
-	case FFI_TYPE_SINT16:
-	  gprvalue = **p_argv.ss;
-	  goto putgpr;
-	case FFI_TYPE_UINT32:
-	  gprvalue = **p_argv.ui;
-	  goto putgpr;
-	case FFI_TYPE_INT:
-	case FFI_TYPE_SINT32:
-	  gprvalue = **p_argv.si;
-	  goto putgpr;
-
-	case FFI_TYPE_UINT64:
-	case FFI_TYPE_SINT64:
-	case FFI_TYPE_POINTER:
-	  gprvalue = **p_argv.ul;
-	putgpr:
-	  *next_arg.ul++ = gprvalue;
-	  if (next_arg.ul == gpr_end.ul)
-	    next_arg.ul = rest.ul;
-	  break;
-	}
-    }
-
-  FFI_ASSERT (flags & FLAG_4_GPR_ARGUMENTS
-	      || (next_arg.ul >= gpr_base.ul
-		  && next_arg.ul <= gpr_base.ul + 4));
+# if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
+#  ifdef POWERPC64
+  ffi_prep_types_linux64 (abi);
+#  else
+  ffi_prep_types_sysv (abi);
+#  endif
+# endif
 }
-
-
+#endif
 
 /* Perform machine dependent cif processing */
-ffi_status
+ffi_status FFI_HIDDEN
 ffi_prep_cif_machdep (ffi_cif *cif)
 {
-  /* All this is for the SYSV and LINUX64 ABI.  */
-  int i;
-  ffi_type **ptr;
-  unsigned bytes;
-  int fparg_count = 0, intarg_count = 0;
-  unsigned flags = 0;
-  unsigned struct_copy_size = 0;
-  unsigned type = cif->rtype->type;
-  unsigned size = cif->rtype->size;
-
-  if (cif->abi != FFI_LINUX64)
-    {
-      /* All the machine-independent calculation of cif->bytes will be wrong.
-	 Redo the calculation for SYSV.  */
-
-      /* Space for the frame pointer, callee's LR, and the asm's temp regs.  */
-      bytes = (2 + ASM_NEEDS_REGISTERS) * sizeof (int);
-
-      /* Space for the GPR registers.  */
-      bytes += NUM_GPR_ARG_REGISTERS * sizeof (int);
-    }
-  else
-    {
-      /* 64-bit ABI.  */
-
-      /* Space for backchain, CR, LR, cc/ld doubleword, TOC and the asm's temp
-	 regs.  */
-      bytes = (6 + ASM_NEEDS_REGISTERS64) * sizeof (long);
-
-      /* Space for the mandatory parm save area and general registers.  */
-      bytes += 2 * NUM_GPR_ARG_REGISTERS64 * sizeof (long);
-    }
-
-  /* Return value handling.  The rules for SYSV are as follows:
-     - 32-bit (or less) integer values are returned in gpr3;
-     - Structures of size <= 4 bytes also returned in gpr3;
-     - 64-bit integer values and structures between 5 and 8 bytes are returned
-     in gpr3 and gpr4;
-     - Single/double FP values are returned in fpr1;
-     - Larger structures are allocated space and a pointer is passed as
-     the first argument.
-     - long doubles (if not equivalent to double) are returned in
-     fpr1,fpr2 for Linux and as for large structs for SysV.
-     For LINUX64:
-     - integer values in gpr3;
-     - Structures/Unions by reference;
-     - Single/double FP values in fpr1, long double in fpr1,fpr2.
-     - soft-float float/doubles are treated as UINT32/UINT64 respectivley.
-     - soft-float long doubles are returned in gpr3-gpr6.  */
-  /* First translate for softfloat/nonlinux */
-  if (cif->abi == FFI_LINUX_SOFT_FLOAT) {
-	if (type == FFI_TYPE_FLOAT)
-		type = FFI_TYPE_UINT32;
-	if (type == FFI_TYPE_DOUBLE)
-		type = FFI_TYPE_UINT64;
-	if (type == FFI_TYPE_LONGDOUBLE)
-		type = FFI_TYPE_UINT128;
-  } else if (cif->abi != FFI_LINUX && cif->abi != FFI_LINUX64) {
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
-	if (type == FFI_TYPE_LONGDOUBLE)
-		type = FFI_TYPE_STRUCT;
+#ifdef POWERPC64
+  return ffi_prep_cif_linux64 (cif);
+#else
+  return ffi_prep_cif_sysv (cif);
 #endif
-  }
-
-  switch (type)
-    {
-#ifndef __NO_FPRS__
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
-    case FFI_TYPE_LONGDOUBLE:
-      flags |= FLAG_RETURNS_128BITS;
-      /* Fall through.  */
-#endif
-    case FFI_TYPE_DOUBLE:
-      flags |= FLAG_RETURNS_64BITS;
-      /* Fall through.  */
-    case FFI_TYPE_FLOAT:
-      flags |= FLAG_RETURNS_FP;
-      break;
-#endif
-
-    case FFI_TYPE_UINT128:
-      flags |= FLAG_RETURNS_128BITS;
-      /* Fall through.  */
-    case FFI_TYPE_UINT64:
-    case FFI_TYPE_SINT64:
-      flags |= FLAG_RETURNS_64BITS;
-      break;
-
-    case FFI_TYPE_STRUCT:
-      if (cif->abi == FFI_SYSV)
-	{
-	  /* The final SYSV ABI says that structures smaller or equal 8 bytes
-	     are returned in r3/r4. The FFI_GCC_SYSV ABI instead returns them
-	     in memory.  */
-
-	  /* Treat structs with size <= 8 bytes.  */
-	  if (size <= 8)
-	    {
-	      flags |= FLAG_RETURNS_SMST;
-	      /* These structs are returned in r3. We pack the type and the
-		 precalculated shift value (needed in the sysv.S) into flags.
-		 The same applies for the structs returned in r3/r4.  */
-	      if (size <= 4)
-		{
-		  flags |= FLAG_SYSV_SMST_R3;
-		  flags |= 8 * (4 - size) << 8;
-		  break;
-		}
-	      /* These structs are returned in r3 and r4. See above.   */
-	      if  (size <= 8)
-		{
-		  flags |= FLAG_SYSV_SMST_R3 | FLAG_SYSV_SMST_R4;
-		  flags |= 8 * (8 - size) << 8;
-		  break;
-		}
-	    }
-	}
-
-      intarg_count++;
-      flags |= FLAG_RETVAL_REFERENCE;
-      /* Fall through.  */
-    case FFI_TYPE_VOID:
-      flags |= FLAG_RETURNS_NOTHING;
-      break;
-
-    default:
-      /* Returns 32-bit integer, or similar.  Nothing to do here.  */
-      break;
-    }
-
-  if (cif->abi != FFI_LINUX64)
-    /* The first NUM_GPR_ARG_REGISTERS words of integer arguments, and the
-       first NUM_FPR_ARG_REGISTERS fp arguments, go in registers; the rest
-       goes on the stack.  Structures and long doubles (if not equivalent
-       to double) are passed as a pointer to a copy of the structure.
-       Stuff on the stack needs to keep proper alignment.  */
-    for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++)
-      {
-	unsigned short typenum = (*ptr)->type;
-
-	/* We may need to handle some values depending on ABI */
-	if (cif->abi == FFI_LINUX_SOFT_FLOAT) {
-		if (typenum == FFI_TYPE_FLOAT)
-			typenum = FFI_TYPE_UINT32;
-		if (typenum == FFI_TYPE_DOUBLE)
-			typenum = FFI_TYPE_UINT64;
-		if (typenum == FFI_TYPE_LONGDOUBLE)
-			typenum = FFI_TYPE_UINT128;
-	} else if (cif->abi != FFI_LINUX && cif->abi != FFI_LINUX64) {
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
-		if (typenum == FFI_TYPE_LONGDOUBLE)
-			typenum = FFI_TYPE_STRUCT;
-#endif
-	}
-
-	switch (typenum) {
-#ifndef __NO_FPRS__
-	  case FFI_TYPE_FLOAT:
-	    fparg_count++;
-	    /* floating singles are not 8-aligned on stack */
-	    break;
-
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
-	  case FFI_TYPE_LONGDOUBLE:
-	    fparg_count++;
-	    /* Fall thru */
-#endif
-	  case FFI_TYPE_DOUBLE:
-	    fparg_count++;
-	    /* If this FP arg is going on the stack, it must be
-	       8-byte-aligned.  */
-	    if (fparg_count > NUM_FPR_ARG_REGISTERS
-		&& intarg_count >= NUM_GPR_ARG_REGISTERS
-		&& intarg_count % 2 != 0)
-	      intarg_count++;
-	    break;
-#endif
-	  case FFI_TYPE_UINT128:
-		/*
-		 * A long double in FFI_LINUX_SOFT_FLOAT can use only a set
-		 * of four consecutive gprs. If we do not have enough, we
-		 * have to adjust the intarg_count value.
-		 */
-		if (intarg_count >= NUM_GPR_ARG_REGISTERS - 3
-				&& intarg_count < NUM_GPR_ARG_REGISTERS)
-			intarg_count = NUM_GPR_ARG_REGISTERS;
-		intarg_count += 4;
-		break;
-
-	  case FFI_TYPE_UINT64:
-	  case FFI_TYPE_SINT64:
-	    /* 'long long' arguments are passed as two words, but
-	       either both words must fit in registers or both go
-	       on the stack.  If they go on the stack, they must
-	       be 8-byte-aligned.
-
-	       Also, only certain register pairs can be used for
-	       passing long long int -- specifically (r3,r4), (r5,r6),
-	       (r7,r8), (r9,r10).
-	    */
-	    if (intarg_count == NUM_GPR_ARG_REGISTERS-1
-		|| intarg_count % 2 != 0)
-	      intarg_count++;
-	    intarg_count += 2;
-	    break;
-
-	  case FFI_TYPE_STRUCT:
-	    /* We must allocate space for a copy of these to enforce
-	       pass-by-value.  Pad the space up to a multiple of 16
-	       bytes (the maximum alignment required for anything under
-	       the SYSV ABI).  */
-	    struct_copy_size += ((*ptr)->size + 15) & ~0xF;
-	    /* Fall through (allocate space for the pointer).  */
-
-	  case FFI_TYPE_POINTER:
-	  case FFI_TYPE_INT:
-	  case FFI_TYPE_UINT32:
-	  case FFI_TYPE_SINT32:
-	  case FFI_TYPE_UINT16:
-	  case FFI_TYPE_SINT16:
-	  case FFI_TYPE_UINT8:
-	  case FFI_TYPE_SINT8:
-	    /* Everything else is passed as a 4-byte word in a GPR, either
-	       the object itself or a pointer to it.  */
-	    intarg_count++;
-	    break;
-	  default:
-		FFI_ASSERT (0);
-	  }
-      }
-  else
-    for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++)
-      {
-	switch ((*ptr)->type)
-	  {
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
-	  case FFI_TYPE_LONGDOUBLE:
-	    if (cif->abi == FFI_LINUX_SOFT_FLOAT)
-	      intarg_count += 4;
-	    else
-	      {
-		fparg_count += 2;
-		intarg_count += 2;
-	      }
-	    break;
-#endif
-	  case FFI_TYPE_FLOAT:
-	  case FFI_TYPE_DOUBLE:
-	    fparg_count++;
-	    intarg_count++;
-	    break;
-
-	  case FFI_TYPE_STRUCT:
-	    intarg_count += ((*ptr)->size + 7) / 8;
-	    break;
-
-	  case FFI_TYPE_POINTER:
-	  case FFI_TYPE_UINT64:
-	  case FFI_TYPE_SINT64:
-	  case FFI_TYPE_INT:
-	  case FFI_TYPE_UINT32:
-	  case FFI_TYPE_SINT32:
-	  case FFI_TYPE_UINT16:
-	  case FFI_TYPE_SINT16:
-	  case FFI_TYPE_UINT8:
-	  case FFI_TYPE_SINT8:
-	    /* Everything else is passed as a 8-byte word in a GPR, either
-	       the object itself or a pointer to it.  */
-	    intarg_count++;
-	    break;
-	  default:
-		FFI_ASSERT (0);
-	  }
-      }
-
-#ifndef __NO_FPRS__
-  if (fparg_count != 0)
-    flags |= FLAG_FP_ARGUMENTS;
-#endif
-  if (intarg_count > 4)
-    flags |= FLAG_4_GPR_ARGUMENTS;
-  if (struct_copy_size != 0)
-    flags |= FLAG_ARG_NEEDS_COPY;
-
-  if (cif->abi != FFI_LINUX64)
-    {
-#ifndef __NO_FPRS__
-      /* Space for the FPR registers, if needed.  */
-      if (fparg_count != 0)
-	bytes += NUM_FPR_ARG_REGISTERS * sizeof (double);
-#endif
-
-      /* Stack space.  */
-      if (intarg_count > NUM_GPR_ARG_REGISTERS)
-	bytes += (intarg_count - NUM_GPR_ARG_REGISTERS) * sizeof (int);
-#ifndef __NO_FPRS__
-      if (fparg_count > NUM_FPR_ARG_REGISTERS)
-	bytes += (fparg_count - NUM_FPR_ARG_REGISTERS) * sizeof (double);
-#endif
-    }
-  else
-    {
-#ifndef __NO_FPRS__
-      /* Space for the FPR registers, if needed.  */
-      if (fparg_count != 0)
-	bytes += NUM_FPR_ARG_REGISTERS64 * sizeof (double);
-#endif
-
-      /* Stack space.  */
-      if (intarg_count > NUM_GPR_ARG_REGISTERS64)
-	bytes += (intarg_count - NUM_GPR_ARG_REGISTERS64) * sizeof (long);
-    }
-
-  /* The stack space allocated needs to be a multiple of 16 bytes.  */
-  bytes = (bytes + 15) & ~0xF;
-
-  /* Add in the space for the copied structures.  */
-  bytes += struct_copy_size;
-
-  cif->flags = flags;
-  cif->bytes = bytes;
-
-  return FFI_OK;
 }
 
-extern void ffi_call_SYSV(extended_cif *, unsigned, unsigned, unsigned *,
-			  void (*fn)(void));
-extern void FFI_HIDDEN ffi_call_LINUX64(extended_cif *, unsigned long,
-					unsigned long, unsigned long *,
-					void (*fn)(void));
+ffi_status FFI_HIDDEN
+ffi_prep_cif_machdep_var (ffi_cif *cif,
+			  unsigned int nfixedargs MAYBE_UNUSED,
+			  unsigned int ntotalargs MAYBE_UNUSED)
+{
+#ifdef POWERPC64
+  return ffi_prep_cif_linux64_var (cif, nfixedargs, ntotalargs);
+#else
+  return ffi_prep_cif_sysv (cif);
+#endif
+}
 
 void
 ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
 {
-  /*
-   * The final SYSV ABI says that structures smaller or equal 8 bytes
-   * are returned in r3/r4. The FFI_GCC_SYSV ABI instead returns them
-   * in memory.
-   *
-   * Just to keep things simple for the assembly code, we will always
-   * bounce-buffer struct return values less than or equal to 8 bytes.
-   * This allows the ASM to handle SYSV small structures by directly
-   * writing r3 and r4 to memory without worrying about struct size.
-   */
-  unsigned int smst_buffer[2];
+  /* The final SYSV ABI says that structures smaller or equal 8 bytes
+     are returned in r3/r4.  A draft ABI used by linux instead returns
+     them in memory.
+
+     We bounce-buffer SYSV small struct return values so that sysv.S
+     can write r3 and r4 to memory without worrying about struct size.
+   
+     For ELFv2 ABI, use a bounce buffer for homogeneous structs too,
+     for similar reasons.  */
+  unsigned long smst_buffer[8];
   extended_cif ecif;
-  unsigned int rsize = 0;
 
   ecif.cif = cif;
   ecif.avalue = avalue;
 
-  /* Ensure that we have a valid struct return value */
   ecif.rvalue = rvalue;
-  if (cif->rtype->type == FFI_TYPE_STRUCT) {
-    rsize = cif->rtype->size;
-    if (rsize <= 8)
-      ecif.rvalue = smst_buffer;
-    else if (!rvalue)
-      ecif.rvalue = alloca(rsize);
-  }
+  if ((cif->flags & FLAG_RETURNS_SMST) != 0)
+    ecif.rvalue = smst_buffer;
+  /* Ensure that we have a valid struct return value.
+     FIXME: Isn't this just papering over a user problem?  */
+  else if (!rvalue && cif->rtype->type == FFI_TYPE_STRUCT)
+    ecif.rvalue = alloca (cif->rtype->size);
 
-  switch (cif->abi)
-    {
-#ifndef POWERPC64
-# ifndef __NO_FPRS__
-    case FFI_SYSV:
-    case FFI_GCC_SYSV:
-    case FFI_LINUX:
-# endif
-    case FFI_LINUX_SOFT_FLOAT:
-      ffi_call_SYSV (&ecif, -cif->bytes, cif->flags, ecif.rvalue, fn);
-      break;
+#ifdef POWERPC64
+  ffi_call_LINUX64 (&ecif, -(long) cif->bytes, cif->flags, ecif.rvalue, fn);
 #else
-    case FFI_LINUX64:
-      ffi_call_LINUX64 (&ecif, -(long) cif->bytes, cif->flags, ecif.rvalue, fn);
-      break;
+  ffi_call_SYSV (&ecif, -cif->bytes, cif->flags, ecif.rvalue, fn);
 #endif
-    default:
-      FFI_ASSERT (0);
-      break;
-    }
 
   /* Check for a bounce-buffered return value */
   if (rvalue && ecif.rvalue == smst_buffer)
-    memcpy(rvalue, smst_buffer, rsize);
-}
-
-
-#ifndef POWERPC64
-#define MIN_CACHE_LINE_SIZE 8
-
-static void
-flush_icache (char *wraddr, char *xaddr, int size)
-{
-  int i;
-  for (i = 0; i < size; i += MIN_CACHE_LINE_SIZE)
-    __asm__ volatile ("icbi 0,%0;" "dcbf 0,%1;"
-		      : : "r" (xaddr + i), "r" (wraddr + i) : "memory");
-  __asm__ volatile ("icbi 0,%0;" "dcbf 0,%1;" "sync;" "isync;"
-		    : : "r"(xaddr + size - 1), "r"(wraddr + size - 1)
-		    : "memory");
-}
+    {
+      unsigned int rsize = cif->rtype->size;
+#ifndef __LITTLE_ENDIAN__
+      /* The SYSV ABI returns a structure of up to 4 bytes in size
+	 left-padded in r3.  */
+# ifndef POWERPC64
+      if (rsize <= 4)
+	memcpy (rvalue, (char *) smst_buffer + 4 - rsize, rsize);
+      else
+# endif
+	/* The SYSV ABI returns a structure of up to 8 bytes in size
+	   left-padded in r3/r4, and the ELFv2 ABI similarly returns a
+	   structure of up to 8 bytes in size left-padded in r3.  */
+	if (rsize <= 8)
+	  memcpy (rvalue, (char *) smst_buffer + 8 - rsize, rsize);
+	else
 #endif
+	  memcpy (rvalue, smst_buffer, rsize);
+    }
+}
+
 
 ffi_status
 ffi_prep_closure_loc (ffi_closure *closure,
@@ -1022,480 +134,8 @@
 		      void *codeloc)
 {
 #ifdef POWERPC64
-  void **tramp = (void **) &closure->tramp[0];
-
-  if (cif->abi != FFI_LINUX64)
-    return FFI_BAD_ABI;
-  /* Copy function address and TOC from ffi_closure_LINUX64.  */
-  memcpy (tramp, (char *) ffi_closure_LINUX64, 16);
-  tramp[2] = codeloc;
+  return ffi_prep_closure_loc_linux64 (closure, cif, fun, user_data, codeloc);
 #else
-  unsigned int *tramp;
-
-  if (! (cif->abi == FFI_GCC_SYSV 
-	 || cif->abi == FFI_SYSV
-	 || cif->abi == FFI_LINUX
-	 || cif->abi == FFI_LINUX_SOFT_FLOAT))
-    return FFI_BAD_ABI;
-
-  tramp = (unsigned int *) &closure->tramp[0];
-  tramp[0] = 0x7c0802a6;  /*   mflr    r0 */
-  tramp[1] = 0x4800000d;  /*   bl      10 <trampoline_initial+0x10> */
-  tramp[4] = 0x7d6802a6;  /*   mflr    r11 */
-  tramp[5] = 0x7c0803a6;  /*   mtlr    r0 */
-  tramp[6] = 0x800b0000;  /*   lwz     r0,0(r11) */
-  tramp[7] = 0x816b0004;  /*   lwz     r11,4(r11) */
-  tramp[8] = 0x7c0903a6;  /*   mtctr   r0 */
-  tramp[9] = 0x4e800420;  /*   bctr */
-  *(void **) &tramp[2] = (void *) ffi_closure_SYSV; /* function */
-  *(void **) &tramp[3] = codeloc;                   /* context */
-
-  /* Flush the icache.  */
-  flush_icache ((char *)tramp, (char *)codeloc, FFI_TRAMPOLINE_SIZE);
+  return ffi_prep_closure_loc_sysv (closure, cif, fun, user_data, codeloc);
 #endif
-
-  closure->cif = cif;
-  closure->fun = fun;
-  closure->user_data = user_data;
-
-  return FFI_OK;
-}
-
-typedef union
-{
-  float f;
-  double d;
-} ffi_dblfl;
-
-int ffi_closure_helper_SYSV (ffi_closure *, void *, unsigned long *,
-			     ffi_dblfl *, unsigned long *);
-
-/* Basically the trampoline invokes ffi_closure_SYSV, and on
- * entry, r11 holds the address of the closure.
- * After storing the registers that could possibly contain
- * parameters to be passed into the stack frame and setting
- * up space for a return value, ffi_closure_SYSV invokes the
- * following helper function to do most of the work
- */
-
-int
-ffi_closure_helper_SYSV (ffi_closure *closure, void *rvalue,
-			 unsigned long *pgr, ffi_dblfl *pfr,
-			 unsigned long *pst)
-{
-  /* rvalue is the pointer to space for return value in closure assembly */
-  /* pgr is the pointer to where r3-r10 are stored in ffi_closure_SYSV */
-  /* pfr is the pointer to where f1-f8 are stored in ffi_closure_SYSV  */
-  /* pst is the pointer to outgoing parameter stack in original caller */
-
-  void **          avalue;
-  ffi_type **      arg_types;
-  long             i, avn;
-#ifndef __NO_FPRS__
-  long             nf = 0;   /* number of floating registers already used */
-#endif
-  long             ng = 0;   /* number of general registers already used */
-
-  ffi_cif *cif = closure->cif;
-  unsigned       size     = cif->rtype->size;
-  unsigned short rtypenum = cif->rtype->type;
-
-  avalue = alloca (cif->nargs * sizeof (void *));
-
-  /* First translate for softfloat/nonlinux */
-  if (cif->abi == FFI_LINUX_SOFT_FLOAT) {
-	if (rtypenum == FFI_TYPE_FLOAT)
-		rtypenum = FFI_TYPE_UINT32;
-	if (rtypenum == FFI_TYPE_DOUBLE)
-		rtypenum = FFI_TYPE_UINT64;
-	if (rtypenum == FFI_TYPE_LONGDOUBLE)
-		rtypenum = FFI_TYPE_UINT128;
-  } else if (cif->abi != FFI_LINUX && cif->abi != FFI_LINUX64) {
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
-	if (rtypenum == FFI_TYPE_LONGDOUBLE)
-		rtypenum = FFI_TYPE_STRUCT;
-#endif
-  }
-
-
-  /* Copy the caller's structure return value address so that the closure
-     returns the data directly to the caller.
-     For FFI_SYSV the result is passed in r3/r4 if the struct size is less
-     or equal 8 bytes.  */
-  if (rtypenum == FFI_TYPE_STRUCT && ((cif->abi != FFI_SYSV) || (size > 8))) {
-      rvalue = (void *) *pgr;
-      ng++;
-      pgr++;
-    }
-
-  i = 0;
-  avn = cif->nargs;
-  arg_types = cif->arg_types;
-
-  /* Grab the addresses of the arguments from the stack frame.  */
-  while (i < avn) {
-      unsigned short typenum = arg_types[i]->type;
-
-      /* We may need to handle some values depending on ABI */
-      if (cif->abi == FFI_LINUX_SOFT_FLOAT) {
-		if (typenum == FFI_TYPE_FLOAT)
-			typenum = FFI_TYPE_UINT32;
-		if (typenum == FFI_TYPE_DOUBLE)
-			typenum = FFI_TYPE_UINT64;
-		if (typenum == FFI_TYPE_LONGDOUBLE)
-			typenum = FFI_TYPE_UINT128;
-      } else if (cif->abi != FFI_LINUX && cif->abi != FFI_LINUX64) {
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
-		if (typenum == FFI_TYPE_LONGDOUBLE)
-			typenum = FFI_TYPE_STRUCT;
-#endif
-      }
-
-      switch (typenum) {
-#ifndef __NO_FPRS__
-	case FFI_TYPE_FLOAT:
-	  /* unfortunately float values are stored as doubles
-	   * in the ffi_closure_SYSV code (since we don't check
-	   * the type in that routine).
-	   */
-
-	  /* there are 8 64bit floating point registers */
-
-	  if (nf < 8)
-	    {
-	      double temp = pfr->d;
-	      pfr->f = (float) temp;
-	      avalue[i] = pfr;
-	      nf++;
-	      pfr++;
-	    }
-	  else
-	    {
-	      /* FIXME? here we are really changing the values
-	       * stored in the original calling routines outgoing
-	       * parameter stack.  This is probably a really
-	       * naughty thing to do but...
-	       */
-	      avalue[i] = pst;
-	      pst += 1;
-	    }
-	  break;
-
-	case FFI_TYPE_DOUBLE:
-	  /* On the outgoing stack all values are aligned to 8 */
-	  /* there are 8 64bit floating point registers */
-
-	  if (nf < 8)
-	    {
-	      avalue[i] = pfr;
-	      nf++;
-	      pfr++;
-	    }
-	  else
-	    {
-	      if (((long) pst) & 4)
-		pst++;
-	      avalue[i] = pst;
-	      pst += 2;
-	    }
-	  break;
-
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
-	case FFI_TYPE_LONGDOUBLE:
-	  if (nf < 7)
-	    {
-	      avalue[i] = pfr;
-	      pfr += 2;
-	      nf += 2;
-	    }
-	  else
-	    {
-	      if (((long) pst) & 4)
-		pst++;
-	      avalue[i] = pst;
-	      pst += 4;
-	      nf = 8;
-	    }
-	  break;
-#endif
-#endif /* have FPRS */
-
-	case FFI_TYPE_UINT128:
-		/*
-		 * Test if for the whole long double, 4 gprs are available.
-		 * otherwise the stuff ends up on the stack.
-		 */
-		if (ng < 5) {
-			avalue[i] = pgr;
-			pgr += 4;
-			ng += 4;
-		} else {
-			avalue[i] = pst;
-			pst += 4;
-			ng = 8+4;
-		}
-		break;
-
-	case FFI_TYPE_SINT8:
-	case FFI_TYPE_UINT8:
-	  /* there are 8 gpr registers used to pass values */
-	  if (ng < 8)
-	    {
-	      avalue[i] = (char *) pgr + 3;
-	      ng++;
-	      pgr++;
-	    }
-	  else
-	    {
-	      avalue[i] = (char *) pst + 3;
-	      pst++;
-	    }
-	  break;
-
-	case FFI_TYPE_SINT16:
-	case FFI_TYPE_UINT16:
-	  /* there are 8 gpr registers used to pass values */
-	  if (ng < 8)
-	    {
-	      avalue[i] = (char *) pgr + 2;
-	      ng++;
-	      pgr++;
-	    }
-	  else
-	    {
-	      avalue[i] = (char *) pst + 2;
-	      pst++;
-	    }
-	  break;
-
-	case FFI_TYPE_SINT32:
-	case FFI_TYPE_UINT32:
-	case FFI_TYPE_POINTER:
-	  /* there are 8 gpr registers used to pass values */
-	  if (ng < 8)
-	    {
-	      avalue[i] = pgr;
-	      ng++;
-	      pgr++;
-	    }
-	  else
-	    {
-	      avalue[i] = pst;
-	      pst++;
-	    }
-	  break;
-
-	case FFI_TYPE_STRUCT:
-	  /* Structs are passed by reference. The address will appear in a
-	     gpr if it is one of the first 8 arguments.  */
-	  if (ng < 8)
-	    {
-	      avalue[i] = (void *) *pgr;
-	      ng++;
-	      pgr++;
-	    }
-	  else
-	    {
-	      avalue[i] = (void *) *pst;
-	      pst++;
-	    }
-	  break;
-
-	case FFI_TYPE_SINT64:
-	case FFI_TYPE_UINT64:
-	  /* passing long long ints are complex, they must
-	   * be passed in suitable register pairs such as
-	   * (r3,r4) or (r5,r6) or (r6,r7), or (r7,r8) or (r9,r10)
-	   * and if the entire pair aren't available then the outgoing
-	   * parameter stack is used for both but an alignment of 8
-	   * must will be kept.  So we must either look in pgr
-	   * or pst to find the correct address for this type
-	   * of parameter.
-	   */
-	  if (ng < 7)
-	    {
-	      if (ng & 0x01)
-		{
-		  /* skip r4, r6, r8 as starting points */
-		  ng++;
-		  pgr++;
-		}
-	      avalue[i] = pgr;
-	      ng += 2;
-	      pgr += 2;
-	    }
-	  else
-	    {
-	      if (((long) pst) & 4)
-		pst++;
-	      avalue[i] = pst;
-	      pst += 2;
-	      ng = 8;
-	    }
-	  break;
-
-	default:
-		FFI_ASSERT (0);
-	}
-
-      i++;
-    }
-
-
-  (closure->fun) (cif, rvalue, avalue, closure->user_data);
-
-  /* Tell ffi_closure_SYSV how to perform return type promotions.
-     Because the FFI_SYSV ABI returns the structures <= 8 bytes in r3/r4
-     we have to tell ffi_closure_SYSV how to treat them. We combine the base
-     type FFI_SYSV_TYPE_SMALL_STRUCT - 1  with the size of the struct.
-     So a one byte struct gets the return type 16. Return type 1 to 15 are
-     already used and we never have a struct with size zero. That is the reason
-     for the subtraction of 1. See the comment in ffitarget.h about ordering.
-  */
-  if (cif->abi == FFI_SYSV && rtypenum == FFI_TYPE_STRUCT && size <= 8)
-    return (FFI_SYSV_TYPE_SMALL_STRUCT - 1) + size;
-  return rtypenum;
-}
-
-int FFI_HIDDEN ffi_closure_helper_LINUX64 (ffi_closure *, void *,
-					   unsigned long *, ffi_dblfl *);
-
-int FFI_HIDDEN
-ffi_closure_helper_LINUX64 (ffi_closure *closure, void *rvalue,
-			    unsigned long *pst, ffi_dblfl *pfr)
-{
-  /* rvalue is the pointer to space for return value in closure assembly */
-  /* pst is the pointer to parameter save area
-     (r3-r10 are stored into its first 8 slots by ffi_closure_LINUX64) */
-  /* pfr is the pointer to where f1-f13 are stored in ffi_closure_LINUX64 */
-
-  void **avalue;
-  ffi_type **arg_types;
-  long i, avn;
-  ffi_cif *cif;
-  ffi_dblfl *end_pfr = pfr + NUM_FPR_ARG_REGISTERS64;
-
-  cif = closure->cif;
-  avalue = alloca (cif->nargs * sizeof (void *));
-
-  /* Copy the caller's structure return value address so that the closure
-     returns the data directly to the caller.  */
-  if (cif->rtype->type == FFI_TYPE_STRUCT)
-    {
-      rvalue = (void *) *pst;
-      pst++;
-    }
-
-  i = 0;
-  avn = cif->nargs;
-  arg_types = cif->arg_types;
-
-  /* Grab the addresses of the arguments from the stack frame.  */
-  while (i < avn)
-    {
-      switch (arg_types[i]->type)
-	{
-	case FFI_TYPE_SINT8:
-	case FFI_TYPE_UINT8:
-	  avalue[i] = (char *) pst + 7;
-	  pst++;
-	  break;
-
-	case FFI_TYPE_SINT16:
-	case FFI_TYPE_UINT16:
-	  avalue[i] = (char *) pst + 6;
-	  pst++;
-	  break;
-
-	case FFI_TYPE_SINT32:
-	case FFI_TYPE_UINT32:
-	  avalue[i] = (char *) pst + 4;
-	  pst++;
-	  break;
-
-	case FFI_TYPE_SINT64:
-	case FFI_TYPE_UINT64:
-	case FFI_TYPE_POINTER:
-	  avalue[i] = pst;
-	  pst++;
-	  break;
-
-	case FFI_TYPE_STRUCT:
-	  /* Structures with size less than eight bytes are passed
-	     left-padded.  */
-	  if (arg_types[i]->size < 8)
-	    avalue[i] = (char *) pst + 8 - arg_types[i]->size;
-	  else
-	    avalue[i] = pst;
-	  pst += (arg_types[i]->size + 7) / 8;
-	  break;
-
-	case FFI_TYPE_FLOAT:
-	  /* unfortunately float values are stored as doubles
-	   * in the ffi_closure_LINUX64 code (since we don't check
-	   * the type in that routine).
-	   */
-
-	  /* there are 13 64bit floating point registers */
-
-	  if (pfr < end_pfr)
-	    {
-	      double temp = pfr->d;
-	      pfr->f = (float) temp;
-	      avalue[i] = pfr;
-	      pfr++;
-	    }
-	  else
-	    avalue[i] = pst;
-	  pst++;
-	  break;
-
-	case FFI_TYPE_DOUBLE:
-	  /* On the outgoing stack all values are aligned to 8 */
-	  /* there are 13 64bit floating point registers */
-
-	  if (pfr < end_pfr)
-	    {
-	      avalue[i] = pfr;
-	      pfr++;
-	    }
-	  else
-	    avalue[i] = pst;
-	  pst++;
-	  break;
-
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
-	case FFI_TYPE_LONGDOUBLE:
-	  if (pfr + 1 < end_pfr)
-	    {
-	      avalue[i] = pfr;
-	      pfr += 2;
-	    }
-	  else
-	    {
-	      if (pfr < end_pfr)
-		{
-		  /* Passed partly in f13 and partly on the stack.
-		     Move it all to the stack.  */
-		  *pst = *(unsigned long *) pfr;
-		  pfr++;
-		}
-	      avalue[i] = pst;
-	    }
-	  pst += 2;
-	  break;
-#endif
-
-	default:
-	  FFI_ASSERT (0);
-	}
-
-      i++;
-    }
-
-
-  (closure->fun) (cif, rvalue, avalue, closure->user_data);
-
-  /* Tell ffi_closure_LINUX64 how to perform return type promotions.  */
-  return cif->rtype->type;
 }
diff --git a/Modules/_ctypes/libffi/src/powerpc/ffi_darwin.c b/Modules/_ctypes/libffi/src/powerpc/ffi_darwin.c
index 1d1d48c..cf6fb6d 100644
--- a/Modules/_ctypes/libffi/src/powerpc/ffi_darwin.c
+++ b/Modules/_ctypes/libffi/src/powerpc/ffi_darwin.c
@@ -593,7 +593,7 @@
       /* Natural alignment for all items.  */
       align = p->alignment;
 #else
-      /* Natrual alignment for the first item... */
+      /* Natural alignment for the first item... */
       if (i == 0)
 	align = p->alignment;
       else if (p->alignment == 16 || p->alignment < 4)
diff --git a/Modules/_ctypes/libffi/src/powerpc/ffi_linux64.c b/Modules/_ctypes/libffi/src/powerpc/ffi_linux64.c
new file mode 100644
index 0000000..b087af8
--- /dev/null
+++ b/Modules/_ctypes/libffi/src/powerpc/ffi_linux64.c
@@ -0,0 +1,943 @@
+/* -----------------------------------------------------------------------
+   ffi_linux64.c - Copyright (C) 2013 IBM
+                   Copyright (C) 2011 Anthony Green
+                   Copyright (C) 2011 Kyle Moffett
+                   Copyright (C) 2008 Red Hat, Inc
+                   Copyright (C) 2007, 2008 Free Software Foundation, Inc
+                   Copyright (c) 1998 Geoffrey Keating
+
+   PowerPC Foreign Function Interface
+
+   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 AUTHOR 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.
+   ----------------------------------------------------------------------- */
+
+#include "ffi.h"
+
+#ifdef POWERPC64
+#include "ffi_common.h"
+#include "ffi_powerpc.h"
+
+
+/* About the LINUX64 ABI.  */
+enum {
+  NUM_GPR_ARG_REGISTERS64 = 8,
+  NUM_FPR_ARG_REGISTERS64 = 13
+};
+enum { ASM_NEEDS_REGISTERS64 = 4 };
+
+
+#if HAVE_LONG_DOUBLE_VARIANT && FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
+/* Adjust size of ffi_type_longdouble.  */
+void FFI_HIDDEN
+ffi_prep_types_linux64 (ffi_abi abi)
+{
+  if ((abi & (FFI_LINUX | FFI_LINUX_LONG_DOUBLE_128)) == FFI_LINUX)
+    {
+      ffi_type_longdouble.size = 8;
+      ffi_type_longdouble.alignment = 8;
+    }
+  else
+    {
+      ffi_type_longdouble.size = 16;
+      ffi_type_longdouble.alignment = 16;
+    }
+}
+#endif
+
+
+#if _CALL_ELF == 2
+static unsigned int
+discover_homogeneous_aggregate (const ffi_type *t, unsigned int *elnum)
+{
+  switch (t->type)
+    {
+    case FFI_TYPE_FLOAT:
+    case FFI_TYPE_DOUBLE:
+      *elnum = 1;
+      return (int) t->type;
+
+    case FFI_TYPE_STRUCT:;
+      {
+	unsigned int base_elt = 0, total_elnum = 0;
+	ffi_type **el = t->elements;
+	while (*el)
+	  {
+	    unsigned int el_elt, el_elnum = 0;
+	    el_elt = discover_homogeneous_aggregate (*el, &el_elnum);
+	    if (el_elt == 0
+		|| (base_elt && base_elt != el_elt))
+	      return 0;
+	    base_elt = el_elt;
+	    total_elnum += el_elnum;
+	    if (total_elnum > 8)
+	      return 0;
+	    el++;
+	  }
+	*elnum = total_elnum;
+	return base_elt;
+      }
+
+    default:
+      return 0;
+    }
+}
+#endif
+
+
+/* Perform machine dependent cif processing */
+static ffi_status
+ffi_prep_cif_linux64_core (ffi_cif *cif)
+{
+  ffi_type **ptr;
+  unsigned bytes;
+  unsigned i, fparg_count = 0, intarg_count = 0;
+  unsigned flags = cif->flags;
+#if _CALL_ELF == 2
+  unsigned int elt, elnum;
+#endif
+
+#if FFI_TYPE_LONGDOUBLE == FFI_TYPE_DOUBLE
+  /* If compiled without long double support..  */
+  if ((cif->abi & FFI_LINUX_LONG_DOUBLE_128) != 0)
+    return FFI_BAD_ABI;
+#endif
+
+  /* The machine-independent calculation of cif->bytes doesn't work
+     for us.  Redo the calculation.  */
+#if _CALL_ELF == 2
+  /* Space for backchain, CR, LR, TOC and the asm's temp regs.  */
+  bytes = (4 + ASM_NEEDS_REGISTERS64) * sizeof (long);
+
+  /* Space for the general registers.  */
+  bytes += NUM_GPR_ARG_REGISTERS64 * sizeof (long);
+#else
+  /* Space for backchain, CR, LR, cc/ld doubleword, TOC and the asm's temp
+     regs.  */
+  bytes = (6 + ASM_NEEDS_REGISTERS64) * sizeof (long);
+
+  /* Space for the mandatory parm save area and general registers.  */
+  bytes += 2 * NUM_GPR_ARG_REGISTERS64 * sizeof (long);
+#endif
+
+  /* Return value handling.  */
+  switch (cif->rtype->type)
+    {
+#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
+    case FFI_TYPE_LONGDOUBLE:
+      if ((cif->abi & FFI_LINUX_LONG_DOUBLE_128) != 0)
+	flags |= FLAG_RETURNS_128BITS;
+      /* Fall through.  */
+#endif
+    case FFI_TYPE_DOUBLE:
+      flags |= FLAG_RETURNS_64BITS;
+      /* Fall through.  */
+    case FFI_TYPE_FLOAT:
+      flags |= FLAG_RETURNS_FP;
+      break;
+
+    case FFI_TYPE_UINT128:
+      flags |= FLAG_RETURNS_128BITS;
+      /* Fall through.  */
+    case FFI_TYPE_UINT64:
+    case FFI_TYPE_SINT64:
+      flags |= FLAG_RETURNS_64BITS;
+      break;
+
+    case FFI_TYPE_STRUCT:
+#if _CALL_ELF == 2
+      elt = discover_homogeneous_aggregate (cif->rtype, &elnum);
+      if (elt)
+	{
+	  if (elt == FFI_TYPE_DOUBLE)
+	    flags |= FLAG_RETURNS_64BITS;
+	  flags |= FLAG_RETURNS_FP | FLAG_RETURNS_SMST;
+	  break;
+	}
+      if (cif->rtype->size <= 16)
+	{
+	  flags |= FLAG_RETURNS_SMST;
+	  break;
+	}
+#endif
+      intarg_count++;
+      flags |= FLAG_RETVAL_REFERENCE;
+      /* Fall through.  */
+    case FFI_TYPE_VOID:
+      flags |= FLAG_RETURNS_NOTHING;
+      break;
+
+    default:
+      /* Returns 32-bit integer, or similar.  Nothing to do here.  */
+      break;
+    }
+
+  for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++)
+    {
+      unsigned int align;
+
+      switch ((*ptr)->type)
+	{
+#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
+	case FFI_TYPE_LONGDOUBLE:
+	  if ((cif->abi & FFI_LINUX_LONG_DOUBLE_128) != 0)
+	    {
+	      fparg_count++;
+	      intarg_count++;
+	    }
+	  /* Fall through.  */
+#endif
+	case FFI_TYPE_DOUBLE:
+	case FFI_TYPE_FLOAT:
+	  fparg_count++;
+	  intarg_count++;
+	  if (fparg_count > NUM_FPR_ARG_REGISTERS64)
+	    flags |= FLAG_ARG_NEEDS_PSAVE;
+	  break;
+
+	case FFI_TYPE_STRUCT:
+	  if ((cif->abi & FFI_LINUX_STRUCT_ALIGN) != 0)
+	    {
+	      align = (*ptr)->alignment;
+	      if (align > 16)
+		align = 16;
+	      align = align / 8;
+	      if (align > 1)
+		intarg_count = ALIGN (intarg_count, align);
+	    }
+	  intarg_count += ((*ptr)->size + 7) / 8;
+#if _CALL_ELF == 2
+	  elt = discover_homogeneous_aggregate (*ptr, &elnum);
+	  if (elt)
+	    {
+	      fparg_count += elnum;
+	      if (fparg_count > NUM_FPR_ARG_REGISTERS64)
+		flags |= FLAG_ARG_NEEDS_PSAVE;
+	    }
+	  else
+#endif
+	    {
+	      if (intarg_count > NUM_GPR_ARG_REGISTERS64)
+		flags |= FLAG_ARG_NEEDS_PSAVE;
+	    }
+	  break;
+
+	case FFI_TYPE_POINTER:
+	case FFI_TYPE_UINT64:
+	case FFI_TYPE_SINT64:
+	case FFI_TYPE_INT:
+	case FFI_TYPE_UINT32:
+	case FFI_TYPE_SINT32:
+	case FFI_TYPE_UINT16:
+	case FFI_TYPE_SINT16:
+	case FFI_TYPE_UINT8:
+	case FFI_TYPE_SINT8:
+	  /* Everything else is passed as a 8-byte word in a GPR, either
+	     the object itself or a pointer to it.  */
+	  intarg_count++;
+	  if (intarg_count > NUM_GPR_ARG_REGISTERS64)
+	    flags |= FLAG_ARG_NEEDS_PSAVE;
+	  break;
+	default:
+	  FFI_ASSERT (0);
+	}
+    }
+
+  if (fparg_count != 0)
+    flags |= FLAG_FP_ARGUMENTS;
+  if (intarg_count > 4)
+    flags |= FLAG_4_GPR_ARGUMENTS;
+
+  /* Space for the FPR registers, if needed.  */
+  if (fparg_count != 0)
+    bytes += NUM_FPR_ARG_REGISTERS64 * sizeof (double);
+
+  /* Stack space.  */
+#if _CALL_ELF == 2
+  if ((flags & FLAG_ARG_NEEDS_PSAVE) != 0)
+    bytes += intarg_count * sizeof (long);
+#else
+  if (intarg_count > NUM_GPR_ARG_REGISTERS64)
+    bytes += (intarg_count - NUM_GPR_ARG_REGISTERS64) * sizeof (long);
+#endif
+
+  /* The stack space allocated needs to be a multiple of 16 bytes.  */
+  bytes = (bytes + 15) & ~0xF;
+
+  cif->flags = flags;
+  cif->bytes = bytes;
+
+  return FFI_OK;
+}
+
+ffi_status FFI_HIDDEN
+ffi_prep_cif_linux64 (ffi_cif *cif)
+{
+  if ((cif->abi & FFI_LINUX) != 0)
+    cif->nfixedargs = cif->nargs;
+#if _CALL_ELF != 2
+  else if (cif->abi == FFI_COMPAT_LINUX64)
+    {
+      /* This call is from old code.  Don't touch cif->nfixedargs
+	 since old code will be using a smaller cif.  */
+      cif->flags |= FLAG_COMPAT;
+      /* Translate to new abi value.  */
+      cif->abi = FFI_LINUX | FFI_LINUX_LONG_DOUBLE_128;
+    }
+#endif
+  else
+    return FFI_BAD_ABI;
+  return ffi_prep_cif_linux64_core (cif);
+}
+
+ffi_status FFI_HIDDEN
+ffi_prep_cif_linux64_var (ffi_cif *cif,
+			  unsigned int nfixedargs,
+			  unsigned int ntotalargs MAYBE_UNUSED)
+{
+  if ((cif->abi & FFI_LINUX) != 0)
+    cif->nfixedargs = nfixedargs;
+#if _CALL_ELF != 2
+  else if (cif->abi == FFI_COMPAT_LINUX64)
+    {
+      /* This call is from old code.  Don't touch cif->nfixedargs
+	 since old code will be using a smaller cif.  */
+      cif->flags |= FLAG_COMPAT;
+      /* Translate to new abi value.  */
+      cif->abi = FFI_LINUX | FFI_LINUX_LONG_DOUBLE_128;
+    }
+#endif
+  else
+    return FFI_BAD_ABI;
+#if _CALL_ELF == 2
+  cif->flags |= FLAG_ARG_NEEDS_PSAVE;
+#endif
+  return ffi_prep_cif_linux64_core (cif);
+}
+
+
+/* ffi_prep_args64 is called by the assembly routine once stack space
+   has been allocated for the function's arguments.
+
+   The stack layout we want looks like this:
+
+   |   Ret addr from ffi_call_LINUX64	8bytes	|	higher addresses
+   |--------------------------------------------|
+   |   CR save area			8bytes	|
+   |--------------------------------------------|
+   |   Previous backchain pointer	8	|	stack pointer here
+   |--------------------------------------------|<+ <<<	on entry to
+   |   Saved r28-r31			4*8	| |	ffi_call_LINUX64
+   |--------------------------------------------| |
+   |   GPR registers r3-r10		8*8	| |
+   |--------------------------------------------| |
+   |   FPR registers f1-f13 (optional)	13*8	| |
+   |--------------------------------------------| |
+   |   Parameter save area		        | |
+   |--------------------------------------------| |
+   |   TOC save area			8	| |
+   |--------------------------------------------| |	stack	|
+   |   Linker doubleword		8	| |	grows	|
+   |--------------------------------------------| |	down	V
+   |   Compiler doubleword		8	| |
+   |--------------------------------------------| |	lower addresses
+   |   Space for callee's LR		8	| |
+   |--------------------------------------------| |
+   |   CR save area			8	| |
+   |--------------------------------------------| |	stack pointer here
+   |   Current backchain pointer	8	|-/	during
+   |--------------------------------------------|   <<<	ffi_call_LINUX64
+
+*/
+
+void FFI_HIDDEN
+ffi_prep_args64 (extended_cif *ecif, unsigned long *const stack)
+{
+  const unsigned long bytes = ecif->cif->bytes;
+  const unsigned long flags = ecif->cif->flags;
+
+  typedef union
+  {
+    char *c;
+    unsigned long *ul;
+    float *f;
+    double *d;
+    size_t p;
+  } valp;
+
+  /* 'stacktop' points at the previous backchain pointer.  */
+  valp stacktop;
+
+  /* 'next_arg' points at the space for gpr3, and grows upwards as
+     we use GPR registers, then continues at rest.  */
+  valp gpr_base;
+  valp gpr_end;
+  valp rest;
+  valp next_arg;
+
+  /* 'fpr_base' points at the space for fpr3, and grows upwards as
+     we use FPR registers.  */
+  valp fpr_base;
+  unsigned int fparg_count;
+
+  unsigned int i, words, nargs, nfixedargs;
+  ffi_type **ptr;
+  double double_tmp;
+  union
+  {
+    void **v;
+    char **c;
+    signed char **sc;
+    unsigned char **uc;
+    signed short **ss;
+    unsigned short **us;
+    signed int **si;
+    unsigned int **ui;
+    unsigned long **ul;
+    float **f;
+    double **d;
+  } p_argv;
+  unsigned long gprvalue;
+  unsigned long align;
+
+  stacktop.c = (char *) stack + bytes;
+  gpr_base.ul = stacktop.ul - ASM_NEEDS_REGISTERS64 - NUM_GPR_ARG_REGISTERS64;
+  gpr_end.ul = gpr_base.ul + NUM_GPR_ARG_REGISTERS64;
+#if _CALL_ELF == 2
+  rest.ul = stack + 4 + NUM_GPR_ARG_REGISTERS64;
+#else
+  rest.ul = stack + 6 + NUM_GPR_ARG_REGISTERS64;
+#endif
+  fpr_base.d = gpr_base.d - NUM_FPR_ARG_REGISTERS64;
+  fparg_count = 0;
+  next_arg.ul = gpr_base.ul;
+
+  /* Check that everything starts aligned properly.  */
+  FFI_ASSERT (((unsigned long) (char *) stack & 0xF) == 0);
+  FFI_ASSERT (((unsigned long) stacktop.c & 0xF) == 0);
+  FFI_ASSERT ((bytes & 0xF) == 0);
+
+  /* Deal with return values that are actually pass-by-reference.  */
+  if (flags & FLAG_RETVAL_REFERENCE)
+    *next_arg.ul++ = (unsigned long) (char *) ecif->rvalue;
+
+  /* Now for the arguments.  */
+  p_argv.v = ecif->avalue;
+  nargs = ecif->cif->nargs;
+#if _CALL_ELF != 2
+  nfixedargs = (unsigned) -1;
+  if ((flags & FLAG_COMPAT) == 0)
+#endif
+    nfixedargs = ecif->cif->nfixedargs;
+  for (ptr = ecif->cif->arg_types, i = 0;
+       i < nargs;
+       i++, ptr++, p_argv.v++)
+    {
+#if _CALL_ELF == 2
+      unsigned int elt, elnum;
+#endif
+
+      switch ((*ptr)->type)
+	{
+#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
+	case FFI_TYPE_LONGDOUBLE:
+	  if ((ecif->cif->abi & FFI_LINUX_LONG_DOUBLE_128) != 0)
+	    {
+	      double_tmp = (*p_argv.d)[0];
+	      if (fparg_count < NUM_FPR_ARG_REGISTERS64 && i < nfixedargs)
+		{
+		  *fpr_base.d++ = double_tmp;
+# if _CALL_ELF != 2
+		  if ((flags & FLAG_COMPAT) != 0)
+		    *next_arg.d = double_tmp;
+# endif
+		}
+	      else
+		*next_arg.d = double_tmp;
+	      if (++next_arg.ul == gpr_end.ul)
+		next_arg.ul = rest.ul;
+	      fparg_count++;
+	      double_tmp = (*p_argv.d)[1];
+	      if (fparg_count < NUM_FPR_ARG_REGISTERS64 && i < nfixedargs)
+		{
+		  *fpr_base.d++ = double_tmp;
+# if _CALL_ELF != 2
+		  if ((flags & FLAG_COMPAT) != 0)
+		    *next_arg.d = double_tmp;
+# endif
+		}
+	      else
+		*next_arg.d = double_tmp;
+	      if (++next_arg.ul == gpr_end.ul)
+		next_arg.ul = rest.ul;
+	      fparg_count++;
+	      FFI_ASSERT (__LDBL_MANT_DIG__ == 106);
+	      FFI_ASSERT (flags & FLAG_FP_ARGUMENTS);
+	      break;
+	    }
+	  /* Fall through.  */
+#endif
+	case FFI_TYPE_DOUBLE:
+	  double_tmp = **p_argv.d;
+	  if (fparg_count < NUM_FPR_ARG_REGISTERS64 && i < nfixedargs)
+	    {
+	      *fpr_base.d++ = double_tmp;
+#if _CALL_ELF != 2
+	      if ((flags & FLAG_COMPAT) != 0)
+		*next_arg.d = double_tmp;
+#endif
+	    }
+	  else
+	    *next_arg.d = double_tmp;
+	  if (++next_arg.ul == gpr_end.ul)
+	    next_arg.ul = rest.ul;
+	  fparg_count++;
+	  FFI_ASSERT (flags & FLAG_FP_ARGUMENTS);
+	  break;
+
+	case FFI_TYPE_FLOAT:
+	  double_tmp = **p_argv.f;
+	  if (fparg_count < NUM_FPR_ARG_REGISTERS64 && i < nfixedargs)
+	    {
+	      *fpr_base.d++ = double_tmp;
+#if _CALL_ELF != 2
+	      if ((flags & FLAG_COMPAT) != 0)
+		*next_arg.f = (float) double_tmp;
+#endif
+	    }
+	  else
+	    *next_arg.f = (float) double_tmp;
+	  if (++next_arg.ul == gpr_end.ul)
+	    next_arg.ul = rest.ul;
+	  fparg_count++;
+	  FFI_ASSERT (flags & FLAG_FP_ARGUMENTS);
+	  break;
+
+	case FFI_TYPE_STRUCT:
+	  if ((ecif->cif->abi & FFI_LINUX_STRUCT_ALIGN) != 0)
+	    {
+	      align = (*ptr)->alignment;
+	      if (align > 16)
+		align = 16;
+	      if (align > 1)
+		next_arg.p = ALIGN (next_arg.p, align);
+	    }
+#if _CALL_ELF == 2
+	  elt = discover_homogeneous_aggregate (*ptr, &elnum);
+	  if (elt)
+	    {
+	      union {
+		void *v;
+		float *f;
+		double *d;
+	      } arg;
+
+	      arg.v = *p_argv.v;
+	      if (elt == FFI_TYPE_FLOAT)
+		{
+		  do
+		    {
+		      double_tmp = *arg.f++;
+		      if (fparg_count < NUM_FPR_ARG_REGISTERS64
+			  && i < nfixedargs)
+			*fpr_base.d++ = double_tmp;
+		      else
+			*next_arg.f = (float) double_tmp;
+		      if (++next_arg.f == gpr_end.f)
+			next_arg.f = rest.f;
+		      fparg_count++;
+		    }
+		  while (--elnum != 0);
+		  if ((next_arg.p & 3) != 0)
+		    {
+		      if (++next_arg.f == gpr_end.f)
+			next_arg.f = rest.f;
+		    }
+		}
+	      else
+		do
+		  {
+		    double_tmp = *arg.d++;
+		    if (fparg_count < NUM_FPR_ARG_REGISTERS64 && i < nfixedargs)
+		      *fpr_base.d++ = double_tmp;
+		    else
+		      *next_arg.d = double_tmp;
+		    if (++next_arg.d == gpr_end.d)
+		      next_arg.d = rest.d;
+		    fparg_count++;
+		  }
+		while (--elnum != 0);
+	    }
+	  else
+#endif
+	    {
+	      words = ((*ptr)->size + 7) / 8;
+	      if (next_arg.ul >= gpr_base.ul && next_arg.ul + words > gpr_end.ul)
+		{
+		  size_t first = gpr_end.c - next_arg.c;
+		  memcpy (next_arg.c, *p_argv.c, first);
+		  memcpy (rest.c, *p_argv.c + first, (*ptr)->size - first);
+		  next_arg.c = rest.c + words * 8 - first;
+		}
+	      else
+		{
+		  char *where = next_arg.c;
+
+#ifndef __LITTLE_ENDIAN__
+		  /* Structures with size less than eight bytes are passed
+		     left-padded.  */
+		  if ((*ptr)->size < 8)
+		    where += 8 - (*ptr)->size;
+#endif
+		  memcpy (where, *p_argv.c, (*ptr)->size);
+		  next_arg.ul += words;
+		  if (next_arg.ul == gpr_end.ul)
+		    next_arg.ul = rest.ul;
+		}
+	    }
+	  break;
+
+	case FFI_TYPE_UINT8:
+	  gprvalue = **p_argv.uc;
+	  goto putgpr;
+	case FFI_TYPE_SINT8:
+	  gprvalue = **p_argv.sc;
+	  goto putgpr;
+	case FFI_TYPE_UINT16:
+	  gprvalue = **p_argv.us;
+	  goto putgpr;
+	case FFI_TYPE_SINT16:
+	  gprvalue = **p_argv.ss;
+	  goto putgpr;
+	case FFI_TYPE_UINT32:
+	  gprvalue = **p_argv.ui;
+	  goto putgpr;
+	case FFI_TYPE_INT:
+	case FFI_TYPE_SINT32:
+	  gprvalue = **p_argv.si;
+	  goto putgpr;
+
+	case FFI_TYPE_UINT64:
+	case FFI_TYPE_SINT64:
+	case FFI_TYPE_POINTER:
+	  gprvalue = **p_argv.ul;
+	putgpr:
+	  *next_arg.ul++ = gprvalue;
+	  if (next_arg.ul == gpr_end.ul)
+	    next_arg.ul = rest.ul;
+	  break;
+	}
+    }
+
+  FFI_ASSERT (flags & FLAG_4_GPR_ARGUMENTS
+	      || (next_arg.ul >= gpr_base.ul
+		  && next_arg.ul <= gpr_base.ul + 4));
+}
+
+
+#if _CALL_ELF == 2
+#define MIN_CACHE_LINE_SIZE 8
+
+static void
+flush_icache (char *wraddr, char *xaddr, int size)
+{
+  int i;
+  for (i = 0; i < size; i += MIN_CACHE_LINE_SIZE)
+    __asm__ volatile ("icbi 0,%0;" "dcbf 0,%1;"
+		      : : "r" (xaddr + i), "r" (wraddr + i) : "memory");
+  __asm__ volatile ("icbi 0,%0;" "dcbf 0,%1;" "sync;" "isync;"
+		    : : "r"(xaddr + size - 1), "r"(wraddr + size - 1)
+		    : "memory");
+}
+#endif
+
+ffi_status
+ffi_prep_closure_loc_linux64 (ffi_closure *closure,
+			      ffi_cif *cif,
+			      void (*fun) (ffi_cif *, void *, void **, void *),
+			      void *user_data,
+			      void *codeloc)
+{
+#if _CALL_ELF == 2
+  unsigned int *tramp = (unsigned int *) &closure->tramp[0];
+
+  if (cif->abi < FFI_LINUX || cif->abi >= FFI_LAST_ABI)
+    return FFI_BAD_ABI;
+
+  tramp[0] = 0xe96c0018;	/* 0:	ld	11,2f-0b(12)	*/
+  tramp[1] = 0xe98c0010;	/*	ld	12,1f-0b(12)	*/
+  tramp[2] = 0x7d8903a6;	/*	mtctr	12		*/
+  tramp[3] = 0x4e800420;	/*	bctr			*/
+				/* 1:	.quad	function_addr	*/
+				/* 2:	.quad	context		*/
+  *(void **) &tramp[4] = (void *) ffi_closure_LINUX64;
+  *(void **) &tramp[6] = codeloc;
+  flush_icache ((char *)tramp, (char *)codeloc, FFI_TRAMPOLINE_SIZE);
+#else
+  void **tramp = (void **) &closure->tramp[0];
+
+  if (cif->abi < FFI_LINUX || cif->abi >= FFI_LAST_ABI)
+    return FFI_BAD_ABI;
+
+  /* Copy function address and TOC from ffi_closure_LINUX64.  */
+  memcpy (tramp, (char *) ffi_closure_LINUX64, 16);
+  tramp[2] = tramp[1];
+  tramp[1] = codeloc;
+#endif
+
+  closure->cif = cif;
+  closure->fun = fun;
+  closure->user_data = user_data;
+
+  return FFI_OK;
+}
+
+
+int FFI_HIDDEN
+ffi_closure_helper_LINUX64 (ffi_closure *closure, void *rvalue,
+			    unsigned long *pst, ffi_dblfl *pfr)
+{
+  /* rvalue is the pointer to space for return value in closure assembly */
+  /* pst is the pointer to parameter save area
+     (r3-r10 are stored into its first 8 slots by ffi_closure_LINUX64) */
+  /* pfr is the pointer to where f1-f13 are stored in ffi_closure_LINUX64 */
+
+  void **avalue;
+  ffi_type **arg_types;
+  unsigned long i, avn, nfixedargs;
+  ffi_cif *cif;
+  ffi_dblfl *end_pfr = pfr + NUM_FPR_ARG_REGISTERS64;
+  unsigned long align;
+
+  cif = closure->cif;
+  avalue = alloca (cif->nargs * sizeof (void *));
+
+  /* Copy the caller's structure return value address so that the
+     closure returns the data directly to the caller.  */
+  if (cif->rtype->type == FFI_TYPE_STRUCT
+      && (cif->flags & FLAG_RETURNS_SMST) == 0)
+    {
+      rvalue = (void *) *pst;
+      pst++;
+    }
+
+  i = 0;
+  avn = cif->nargs;
+#if _CALL_ELF != 2
+  nfixedargs = (unsigned) -1;
+  if ((cif->flags & FLAG_COMPAT) == 0)
+#endif
+    nfixedargs = cif->nfixedargs;
+  arg_types = cif->arg_types;
+
+  /* Grab the addresses of the arguments from the stack frame.  */
+  while (i < avn)
+    {
+      unsigned int elt, elnum;
+
+      switch (arg_types[i]->type)
+	{
+	case FFI_TYPE_SINT8:
+	case FFI_TYPE_UINT8:
+#ifndef __LITTLE_ENDIAN__
+	  avalue[i] = (char *) pst + 7;
+	  pst++;
+	  break;
+#endif
+
+	case FFI_TYPE_SINT16:
+	case FFI_TYPE_UINT16:
+#ifndef __LITTLE_ENDIAN__
+	  avalue[i] = (char *) pst + 6;
+	  pst++;
+	  break;
+#endif
+
+	case FFI_TYPE_SINT32:
+	case FFI_TYPE_UINT32:
+#ifndef __LITTLE_ENDIAN__
+	  avalue[i] = (char *) pst + 4;
+	  pst++;
+	  break;
+#endif
+
+	case FFI_TYPE_SINT64:
+	case FFI_TYPE_UINT64:
+	case FFI_TYPE_POINTER:
+	  avalue[i] = pst;
+	  pst++;
+	  break;
+
+	case FFI_TYPE_STRUCT:
+	  if ((cif->abi & FFI_LINUX_STRUCT_ALIGN) != 0)
+	    {
+	      align = arg_types[i]->alignment;
+	      if (align > 16)
+		align = 16;
+	      if (align > 1)
+		pst = (unsigned long *) ALIGN ((size_t) pst, align);
+	    }
+	  elt = 0;
+#if _CALL_ELF == 2
+	  elt = discover_homogeneous_aggregate (arg_types[i], &elnum);
+#endif
+	  if (elt)
+	    {
+	      union {
+		void *v;
+		unsigned long *ul;
+		float *f;
+		double *d;
+		size_t p;
+	      } to, from;
+
+	      /* Repackage the aggregate from its parts.  The
+		 aggregate size is not greater than the space taken by
+		 the registers so store back to the register/parameter
+		 save arrays.  */
+	      if (pfr + elnum <= end_pfr)
+		to.v = pfr;
+	      else
+		to.v = pst;
+
+	      avalue[i] = to.v;
+	      from.ul = pst;
+	      if (elt == FFI_TYPE_FLOAT)
+		{
+		  do
+		    {
+		      if (pfr < end_pfr && i < nfixedargs)
+			{
+			  *to.f = (float) pfr->d;
+			  pfr++;
+			}
+		      else
+			*to.f = *from.f;
+		      to.f++;
+		      from.f++;
+		    }
+		  while (--elnum != 0);
+		}
+	      else
+		{
+		  do
+		    {
+		      if (pfr < end_pfr && i < nfixedargs)
+			{
+			  *to.d = pfr->d;
+			  pfr++;
+			}
+		      else
+			*to.d = *from.d;
+		      to.d++;
+		      from.d++;
+		    }
+		  while (--elnum != 0);
+		}
+	    }
+	  else
+	    {
+#ifndef __LITTLE_ENDIAN__
+	      /* Structures with size less than eight bytes are passed
+		 left-padded.  */
+	      if (arg_types[i]->size < 8)
+		avalue[i] = (char *) pst + 8 - arg_types[i]->size;
+	      else
+#endif
+		avalue[i] = pst;
+	    }
+	  pst += (arg_types[i]->size + 7) / 8;
+	  break;
+
+#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
+	case FFI_TYPE_LONGDOUBLE:
+	  if ((cif->abi & FFI_LINUX_LONG_DOUBLE_128) != 0)
+	    {
+	      if (pfr + 1 < end_pfr && i + 1 < nfixedargs)
+		{
+		  avalue[i] = pfr;
+		  pfr += 2;
+		}
+	      else
+		{
+		  if (pfr < end_pfr && i < nfixedargs)
+		    {
+		      /* Passed partly in f13 and partly on the stack.
+			 Move it all to the stack.  */
+		      *pst = *(unsigned long *) pfr;
+		      pfr++;
+		    }
+		  avalue[i] = pst;
+		}
+	      pst += 2;
+	      break;
+	    }
+	  /* Fall through.  */
+#endif
+	case FFI_TYPE_DOUBLE:
+	  /* On the outgoing stack all values are aligned to 8 */
+	  /* there are 13 64bit floating point registers */
+
+	  if (pfr < end_pfr && i < nfixedargs)
+	    {
+	      avalue[i] = pfr;
+	      pfr++;
+	    }
+	  else
+	    avalue[i] = pst;
+	  pst++;
+	  break;
+
+	case FFI_TYPE_FLOAT:
+	  if (pfr < end_pfr && i < nfixedargs)
+	    {
+	      /* Float values are stored as doubles in the
+		 ffi_closure_LINUX64 code.  Fix them here.  */
+	      pfr->f = (float) pfr->d;
+	      avalue[i] = pfr;
+	      pfr++;
+	    }
+	  else
+	    avalue[i] = pst;
+	  pst++;
+	  break;
+
+	default:
+	  FFI_ASSERT (0);
+	}
+
+      i++;
+    }
+
+
+  (closure->fun) (cif, rvalue, avalue, closure->user_data);
+
+  /* Tell ffi_closure_LINUX64 how to perform return type promotions.  */
+  if ((cif->flags & FLAG_RETURNS_SMST) != 0)
+    {
+      if ((cif->flags & FLAG_RETURNS_FP) == 0)
+	return FFI_V2_TYPE_SMALL_STRUCT + cif->rtype->size - 1;
+      else if ((cif->flags & FLAG_RETURNS_64BITS) != 0)
+	return FFI_V2_TYPE_DOUBLE_HOMOG;
+      else
+	return FFI_V2_TYPE_FLOAT_HOMOG;
+    }
+  return cif->rtype->type;
+}
+#endif
diff --git a/Modules/_ctypes/libffi/src/powerpc/ffi_powerpc.h b/Modules/_ctypes/libffi/src/powerpc/ffi_powerpc.h
new file mode 100644
index 0000000..2e61653
--- /dev/null
+++ b/Modules/_ctypes/libffi/src/powerpc/ffi_powerpc.h
@@ -0,0 +1,77 @@
+/* -----------------------------------------------------------------------
+   ffi_powerpc.h - Copyright (C) 2013 IBM
+                   Copyright (C) 2011 Anthony Green
+                   Copyright (C) 2011 Kyle Moffett
+                   Copyright (C) 2008 Red Hat, Inc
+                   Copyright (C) 2007, 2008 Free Software Foundation, Inc
+                   Copyright (c) 1998 Geoffrey Keating
+
+   PowerPC Foreign Function Interface
+
+   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 AUTHOR 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.
+   ----------------------------------------------------------------------- */
+
+enum {
+  /* The assembly depends on these exact flags.  */
+  /* These go in cr7 */
+  FLAG_RETURNS_SMST	= 1 << (31-31), /* Used for FFI_SYSV small structs.  */
+  FLAG_RETURNS_NOTHING  = 1 << (31-30),
+  FLAG_RETURNS_FP       = 1 << (31-29),
+  FLAG_RETURNS_64BITS   = 1 << (31-28),
+
+  /* This goes in cr6 */
+  FLAG_RETURNS_128BITS  = 1 << (31-27),
+
+  FLAG_COMPAT		= 1 << (31- 8), /* Not used by assembly */
+
+  /* These go in cr1 */
+  FLAG_ARG_NEEDS_COPY   = 1 << (31- 7), /* Used by sysv code */
+  FLAG_ARG_NEEDS_PSAVE  = FLAG_ARG_NEEDS_COPY, /* Used by linux64 code */
+  FLAG_FP_ARGUMENTS     = 1 << (31- 6), /* cr1.eq; specified by ABI */
+  FLAG_4_GPR_ARGUMENTS  = 1 << (31- 5),
+  FLAG_RETVAL_REFERENCE = 1 << (31- 4)
+};
+
+typedef union
+{
+  float f;
+  double d;
+} ffi_dblfl;
+
+void FFI_HIDDEN ffi_closure_SYSV (void);
+void FFI_HIDDEN ffi_call_SYSV(extended_cif *, unsigned, unsigned, unsigned *,
+			      void (*)(void));
+
+void FFI_HIDDEN ffi_prep_types_sysv (ffi_abi);
+ffi_status FFI_HIDDEN ffi_prep_cif_sysv (ffi_cif *);
+int FFI_HIDDEN ffi_closure_helper_SYSV (ffi_closure *, void *, unsigned long *,
+					ffi_dblfl *, unsigned long *);
+
+void FFI_HIDDEN ffi_call_LINUX64(extended_cif *, unsigned long, unsigned long,
+				 unsigned long *, void (*)(void));
+void FFI_HIDDEN ffi_closure_LINUX64 (void);
+
+void FFI_HIDDEN ffi_prep_types_linux64 (ffi_abi);
+ffi_status FFI_HIDDEN ffi_prep_cif_linux64 (ffi_cif *);
+ffi_status FFI_HIDDEN ffi_prep_cif_linux64_var (ffi_cif *, unsigned int,
+						unsigned int);
+void FFI_HIDDEN ffi_prep_args64 (extended_cif *, unsigned long *const);
+int FFI_HIDDEN ffi_closure_helper_LINUX64 (ffi_closure *, void *,
+					   unsigned long *, ffi_dblfl *);
diff --git a/Modules/_ctypes/libffi/src/powerpc/ffi_sysv.c b/Modules/_ctypes/libffi/src/powerpc/ffi_sysv.c
new file mode 100644
index 0000000..fbe85fe
--- /dev/null
+++ b/Modules/_ctypes/libffi/src/powerpc/ffi_sysv.c
@@ -0,0 +1,931 @@
+/* -----------------------------------------------------------------------
+   ffi_sysv.c - Copyright (C) 2013 IBM
+                Copyright (C) 2011 Anthony Green
+                Copyright (C) 2011 Kyle Moffett
+                Copyright (C) 2008 Red Hat, Inc
+                Copyright (C) 2007, 2008 Free Software Foundation, Inc
+                Copyright (c) 1998 Geoffrey Keating
+
+   PowerPC Foreign Function Interface
+
+   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 AUTHOR 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.
+   ----------------------------------------------------------------------- */
+
+#include "ffi.h"
+
+#ifndef POWERPC64
+#include "ffi_common.h"
+#include "ffi_powerpc.h"
+
+
+/* About the SYSV ABI.  */
+#define ASM_NEEDS_REGISTERS 4
+#define NUM_GPR_ARG_REGISTERS 8
+#define NUM_FPR_ARG_REGISTERS 8
+
+
+#if HAVE_LONG_DOUBLE_VARIANT && FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
+/* Adjust size of ffi_type_longdouble.  */
+void FFI_HIDDEN
+ffi_prep_types_sysv (ffi_abi abi)
+{
+  if ((abi & (FFI_SYSV | FFI_SYSV_LONG_DOUBLE_128)) == FFI_SYSV)
+    {
+      ffi_type_longdouble.size = 8;
+      ffi_type_longdouble.alignment = 8;
+    }
+  else
+    {
+      ffi_type_longdouble.size = 16;
+      ffi_type_longdouble.alignment = 16;
+    }
+}
+#endif
+
+/* Transform long double, double and float to other types as per abi.  */
+static int
+translate_float (int abi, int type)
+{
+#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
+  if (type == FFI_TYPE_LONGDOUBLE
+      && (abi & FFI_SYSV_LONG_DOUBLE_128) == 0)
+    type = FFI_TYPE_DOUBLE;
+#endif
+  if ((abi & FFI_SYSV_SOFT_FLOAT) != 0)
+    {
+      if (type == FFI_TYPE_FLOAT)
+	type = FFI_TYPE_UINT32;
+      else if (type == FFI_TYPE_DOUBLE)
+	type = FFI_TYPE_UINT64;
+#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
+      else if (type == FFI_TYPE_LONGDOUBLE)
+	type = FFI_TYPE_UINT128;
+    }
+  else if ((abi & FFI_SYSV_IBM_LONG_DOUBLE) == 0)
+    {
+      if (type == FFI_TYPE_LONGDOUBLE)
+	type = FFI_TYPE_STRUCT;
+#endif
+    }
+  return type;
+}
+
+/* Perform machine dependent cif processing */
+static ffi_status
+ffi_prep_cif_sysv_core (ffi_cif *cif)
+{
+  ffi_type **ptr;
+  unsigned bytes;
+  unsigned i, fparg_count = 0, intarg_count = 0;
+  unsigned flags = cif->flags;
+  unsigned struct_copy_size = 0;
+  unsigned type = cif->rtype->type;
+  unsigned size = cif->rtype->size;
+
+  /* The machine-independent calculation of cif->bytes doesn't work
+     for us.  Redo the calculation.  */
+
+  /* Space for the frame pointer, callee's LR, and the asm's temp regs.  */
+  bytes = (2 + ASM_NEEDS_REGISTERS) * sizeof (int);
+
+  /* Space for the GPR registers.  */
+  bytes += NUM_GPR_ARG_REGISTERS * sizeof (int);
+
+  /* Return value handling.  The rules for SYSV are as follows:
+     - 32-bit (or less) integer values are returned in gpr3;
+     - Structures of size <= 4 bytes also returned in gpr3;
+     - 64-bit integer values and structures between 5 and 8 bytes are returned
+     in gpr3 and gpr4;
+     - Larger structures are allocated space and a pointer is passed as
+     the first argument.
+     - Single/double FP values are returned in fpr1;
+     - long doubles (if not equivalent to double) are returned in
+     fpr1,fpr2 for Linux and as for large structs for SysV.  */
+
+  type = translate_float (cif->abi, type);
+
+  switch (type)
+    {
+#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
+    case FFI_TYPE_LONGDOUBLE:
+      flags |= FLAG_RETURNS_128BITS;
+      /* Fall through.  */
+#endif
+    case FFI_TYPE_DOUBLE:
+      flags |= FLAG_RETURNS_64BITS;
+      /* Fall through.  */
+    case FFI_TYPE_FLOAT:
+      flags |= FLAG_RETURNS_FP;
+#ifdef __NO_FPRS__
+      return FFI_BAD_ABI;
+#endif
+      break;
+
+    case FFI_TYPE_UINT128:
+      flags |= FLAG_RETURNS_128BITS;
+      /* Fall through.  */
+    case FFI_TYPE_UINT64:
+    case FFI_TYPE_SINT64:
+      flags |= FLAG_RETURNS_64BITS;
+      break;
+
+    case FFI_TYPE_STRUCT:
+      /* The final SYSV ABI says that structures smaller or equal 8 bytes
+	 are returned in r3/r4.  A draft ABI used by linux instead
+	 returns them in memory.  */
+      if ((cif->abi & FFI_SYSV_STRUCT_RET) != 0 && size <= 8)
+	{
+	  flags |= FLAG_RETURNS_SMST;
+	  break;
+	}
+      intarg_count++;
+      flags |= FLAG_RETVAL_REFERENCE;
+      /* Fall through.  */
+    case FFI_TYPE_VOID:
+      flags |= FLAG_RETURNS_NOTHING;
+      break;
+
+    default:
+      /* Returns 32-bit integer, or similar.  Nothing to do here.  */
+      break;
+    }
+
+  /* The first NUM_GPR_ARG_REGISTERS words of integer arguments, and the
+     first NUM_FPR_ARG_REGISTERS fp arguments, go in registers; the rest
+     goes on the stack.  Structures and long doubles (if not equivalent
+     to double) are passed as a pointer to a copy of the structure.
+     Stuff on the stack needs to keep proper alignment.  */
+  for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++)
+    {
+      unsigned short typenum = (*ptr)->type;
+
+      typenum = translate_float (cif->abi, typenum);
+
+      switch (typenum)
+	{
+#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
+	case FFI_TYPE_LONGDOUBLE:
+	  fparg_count++;
+	  /* Fall thru */
+#endif
+	case FFI_TYPE_DOUBLE:
+	  fparg_count++;
+	  /* If this FP arg is going on the stack, it must be
+	     8-byte-aligned.  */
+	  if (fparg_count > NUM_FPR_ARG_REGISTERS
+	      && intarg_count >= NUM_GPR_ARG_REGISTERS
+	      && intarg_count % 2 != 0)
+	    intarg_count++;
+#ifdef __NO_FPRS__
+	  return FFI_BAD_ABI;
+#endif
+	  break;
+
+	case FFI_TYPE_FLOAT:
+	  fparg_count++;
+#ifdef __NO_FPRS__
+	  return FFI_BAD_ABI;
+#endif
+	  break;
+
+	case FFI_TYPE_UINT128:
+	  /* A long double in FFI_LINUX_SOFT_FLOAT can use only a set
+	     of four consecutive gprs. If we do not have enough, we
+	     have to adjust the intarg_count value.  */
+	  if (intarg_count >= NUM_GPR_ARG_REGISTERS - 3
+	      && intarg_count < NUM_GPR_ARG_REGISTERS)
+	    intarg_count = NUM_GPR_ARG_REGISTERS;
+	  intarg_count += 4;
+	  break;
+
+	case FFI_TYPE_UINT64:
+	case FFI_TYPE_SINT64:
+	  /* 'long long' arguments are passed as two words, but
+	     either both words must fit in registers or both go
+	     on the stack.  If they go on the stack, they must
+	     be 8-byte-aligned.
+
+	     Also, only certain register pairs can be used for
+	     passing long long int -- specifically (r3,r4), (r5,r6),
+	     (r7,r8), (r9,r10).  */
+	  if (intarg_count == NUM_GPR_ARG_REGISTERS-1
+	      || intarg_count % 2 != 0)
+	    intarg_count++;
+	  intarg_count += 2;
+	  break;
+
+	case FFI_TYPE_STRUCT:
+	  /* We must allocate space for a copy of these to enforce
+	     pass-by-value.  Pad the space up to a multiple of 16
+	     bytes (the maximum alignment required for anything under
+	     the SYSV ABI).  */
+	  struct_copy_size += ((*ptr)->size + 15) & ~0xF;
+	  /* Fall through (allocate space for the pointer).  */
+
+	case FFI_TYPE_POINTER:
+	case FFI_TYPE_INT:
+	case FFI_TYPE_UINT32:
+	case FFI_TYPE_SINT32:
+	case FFI_TYPE_UINT16:
+	case FFI_TYPE_SINT16:
+	case FFI_TYPE_UINT8:
+	case FFI_TYPE_SINT8:
+	  /* Everything else is passed as a 4-byte word in a GPR, either
+	     the object itself or a pointer to it.  */
+	  intarg_count++;
+	  break;
+
+	default:
+	  FFI_ASSERT (0);
+	}
+    }
+
+  if (fparg_count != 0)
+    flags |= FLAG_FP_ARGUMENTS;
+  if (intarg_count > 4)
+    flags |= FLAG_4_GPR_ARGUMENTS;
+  if (struct_copy_size != 0)
+    flags |= FLAG_ARG_NEEDS_COPY;
+
+  /* Space for the FPR registers, if needed.  */
+  if (fparg_count != 0)
+    bytes += NUM_FPR_ARG_REGISTERS * sizeof (double);
+
+  /* Stack space.  */
+  if (intarg_count > NUM_GPR_ARG_REGISTERS)
+    bytes += (intarg_count - NUM_GPR_ARG_REGISTERS) * sizeof (int);
+  if (fparg_count > NUM_FPR_ARG_REGISTERS)
+    bytes += (fparg_count - NUM_FPR_ARG_REGISTERS) * sizeof (double);
+
+  /* The stack space allocated needs to be a multiple of 16 bytes.  */
+  bytes = (bytes + 15) & ~0xF;
+
+  /* Add in the space for the copied structures.  */
+  bytes += struct_copy_size;
+
+  cif->flags = flags;
+  cif->bytes = bytes;
+
+  return FFI_OK;
+}
+
+ffi_status FFI_HIDDEN
+ffi_prep_cif_sysv (ffi_cif *cif)
+{
+  if ((cif->abi & FFI_SYSV) == 0)
+    {
+      /* This call is from old code.  Translate to new ABI values.  */
+      cif->flags |= FLAG_COMPAT;
+      switch (cif->abi)
+	{
+	default:
+	  return FFI_BAD_ABI;
+
+	case FFI_COMPAT_SYSV:
+	  cif->abi = FFI_SYSV | FFI_SYSV_STRUCT_RET | FFI_SYSV_LONG_DOUBLE_128;
+	  break;
+
+	case FFI_COMPAT_GCC_SYSV:
+	  cif->abi = FFI_SYSV | FFI_SYSV_LONG_DOUBLE_128;
+	  break;
+
+	case FFI_COMPAT_LINUX:
+	  cif->abi = (FFI_SYSV | FFI_SYSV_IBM_LONG_DOUBLE
+		      | FFI_SYSV_LONG_DOUBLE_128);
+	  break;
+
+	case FFI_COMPAT_LINUX_SOFT_FLOAT:
+	  cif->abi = (FFI_SYSV | FFI_SYSV_SOFT_FLOAT | FFI_SYSV_IBM_LONG_DOUBLE
+		      | FFI_SYSV_LONG_DOUBLE_128);
+	  break;
+	}
+    }
+  return ffi_prep_cif_sysv_core (cif);
+}
+
+/* ffi_prep_args_SYSV is called by the assembly routine once stack space
+   has been allocated for the function's arguments.
+
+   The stack layout we want looks like this:
+
+   |   Return address from ffi_call_SYSV 4bytes	|	higher addresses
+   |--------------------------------------------|
+   |   Previous backchain pointer	4	|       stack pointer here
+   |--------------------------------------------|<+ <<<	on entry to
+   |   Saved r28-r31			4*4	| |	ffi_call_SYSV
+   |--------------------------------------------| |
+   |   GPR registers r3-r10		8*4	| |	ffi_call_SYSV
+   |--------------------------------------------| |
+   |   FPR registers f1-f8 (optional)	8*8	| |
+   |--------------------------------------------| |	stack	|
+   |   Space for copied structures		| |	grows	|
+   |--------------------------------------------| |	down    V
+   |   Parameters that didn't fit in registers  | |
+   |--------------------------------------------| |	lower addresses
+   |   Space for callee's LR		4	| |
+   |--------------------------------------------| |	stack pointer here
+   |   Current backchain pointer	4	|-/	during
+   |--------------------------------------------|   <<<	ffi_call_SYSV
+
+*/
+
+void FFI_HIDDEN
+ffi_prep_args_SYSV (extended_cif *ecif, unsigned *const stack)
+{
+  const unsigned bytes = ecif->cif->bytes;
+  const unsigned flags = ecif->cif->flags;
+
+  typedef union
+  {
+    char *c;
+    unsigned *u;
+    long long *ll;
+    float *f;
+    double *d;
+  } valp;
+
+  /* 'stacktop' points at the previous backchain pointer.  */
+  valp stacktop;
+
+  /* 'gpr_base' points at the space for gpr3, and grows upwards as
+     we use GPR registers.  */
+  valp gpr_base;
+  int intarg_count;
+
+#ifndef __NO_FPRS__
+  /* 'fpr_base' points at the space for fpr1, and grows upwards as
+     we use FPR registers.  */
+  valp fpr_base;
+  int fparg_count;
+#endif
+
+  /* 'copy_space' grows down as we put structures in it.  It should
+     stay 16-byte aligned.  */
+  valp copy_space;
+
+  /* 'next_arg' grows up as we put parameters in it.  */
+  valp next_arg;
+
+  int i;
+  ffi_type **ptr;
+#ifndef __NO_FPRS__
+  double double_tmp;
+#endif
+  union
+  {
+    void **v;
+    char **c;
+    signed char **sc;
+    unsigned char **uc;
+    signed short **ss;
+    unsigned short **us;
+    unsigned int **ui;
+    long long **ll;
+    float **f;
+    double **d;
+  } p_argv;
+  size_t struct_copy_size;
+  unsigned gprvalue;
+
+  stacktop.c = (char *) stack + bytes;
+  gpr_base.u = stacktop.u - ASM_NEEDS_REGISTERS - NUM_GPR_ARG_REGISTERS;
+  intarg_count = 0;
+#ifndef __NO_FPRS__
+  fpr_base.d = gpr_base.d - NUM_FPR_ARG_REGISTERS;
+  fparg_count = 0;
+  copy_space.c = ((flags & FLAG_FP_ARGUMENTS) ? fpr_base.c : gpr_base.c);
+#else
+  copy_space.c = gpr_base.c;
+#endif
+  next_arg.u = stack + 2;
+
+  /* Check that everything starts aligned properly.  */
+  FFI_ASSERT (((unsigned long) (char *) stack & 0xF) == 0);
+  FFI_ASSERT (((unsigned long) copy_space.c & 0xF) == 0);
+  FFI_ASSERT (((unsigned long) stacktop.c & 0xF) == 0);
+  FFI_ASSERT ((bytes & 0xF) == 0);
+  FFI_ASSERT (copy_space.c >= next_arg.c);
+
+  /* Deal with return values that are actually pass-by-reference.  */
+  if (flags & FLAG_RETVAL_REFERENCE)
+    {
+      *gpr_base.u++ = (unsigned long) (char *) ecif->rvalue;
+      intarg_count++;
+    }
+
+  /* Now for the arguments.  */
+  p_argv.v = ecif->avalue;
+  for (ptr = ecif->cif->arg_types, i = ecif->cif->nargs;
+       i > 0;
+       i--, ptr++, p_argv.v++)
+    {
+      unsigned int typenum = (*ptr)->type;
+
+      typenum = translate_float (ecif->cif->abi, typenum);
+
+      /* Now test the translated value */
+      switch (typenum)
+	{
+#ifndef __NO_FPRS__
+# if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
+	case FFI_TYPE_LONGDOUBLE:
+	  double_tmp = (*p_argv.d)[0];
+
+	  if (fparg_count >= NUM_FPR_ARG_REGISTERS - 1)
+	    {
+	      if (intarg_count >= NUM_GPR_ARG_REGISTERS
+		  && intarg_count % 2 != 0)
+		{
+		  intarg_count++;
+		  next_arg.u++;
+		}
+	      *next_arg.d = double_tmp;
+	      next_arg.u += 2;
+	      double_tmp = (*p_argv.d)[1];
+	      *next_arg.d = double_tmp;
+	      next_arg.u += 2;
+	    }
+	  else
+	    {
+	      *fpr_base.d++ = double_tmp;
+	      double_tmp = (*p_argv.d)[1];
+	      *fpr_base.d++ = double_tmp;
+	    }
+
+	  fparg_count += 2;
+	  FFI_ASSERT (flags & FLAG_FP_ARGUMENTS);
+	  break;
+# endif
+	case FFI_TYPE_DOUBLE:
+	  double_tmp = **p_argv.d;
+
+	  if (fparg_count >= NUM_FPR_ARG_REGISTERS)
+	    {
+	      if (intarg_count >= NUM_GPR_ARG_REGISTERS
+		  && intarg_count % 2 != 0)
+		{
+		  intarg_count++;
+		  next_arg.u++;
+		}
+	      *next_arg.d = double_tmp;
+	      next_arg.u += 2;
+	    }
+	  else
+	    *fpr_base.d++ = double_tmp;
+	  fparg_count++;
+	  FFI_ASSERT (flags & FLAG_FP_ARGUMENTS);
+	  break;
+
+	case FFI_TYPE_FLOAT:
+	  double_tmp = **p_argv.f;
+	  if (fparg_count >= NUM_FPR_ARG_REGISTERS)
+	    {
+	      *next_arg.f = (float) double_tmp;
+	      next_arg.u += 1;
+	      intarg_count++;
+	    }
+	  else
+	    *fpr_base.d++ = double_tmp;
+	  fparg_count++;
+	  FFI_ASSERT (flags & FLAG_FP_ARGUMENTS);
+	  break;
+#endif /* have FPRs */
+
+	case FFI_TYPE_UINT128:
+	  /* The soft float ABI for long doubles works like this, a long double
+	     is passed in four consecutive GPRs if available.  A maximum of 2
+	     long doubles can be passed in gprs.  If we do not have 4 GPRs
+	     left, the long double is passed on the stack, 4-byte aligned.  */
+	  {
+	    unsigned int int_tmp;
+	    unsigned int ii;
+	    if (intarg_count >= NUM_GPR_ARG_REGISTERS - 3)
+	      {
+		if (intarg_count < NUM_GPR_ARG_REGISTERS)
+		  intarg_count = NUM_GPR_ARG_REGISTERS;
+		for (ii = 0; ii < 4; ii++)
+		  {
+		    int_tmp = (*p_argv.ui)[ii];
+		    *next_arg.u++ = int_tmp;
+		  }
+	      }
+	    else
+	      {
+		for (ii = 0; ii < 4; ii++)
+		  {
+		    int_tmp = (*p_argv.ui)[ii];
+		    *gpr_base.u++ = int_tmp;
+		  }
+	      }
+	    intarg_count += 4;
+	    break;
+	  }
+
+	case FFI_TYPE_UINT64:
+	case FFI_TYPE_SINT64:
+	  if (intarg_count == NUM_GPR_ARG_REGISTERS-1)
+	    intarg_count++;
+	  if (intarg_count >= NUM_GPR_ARG_REGISTERS)
+	    {
+	      if (intarg_count % 2 != 0)
+		{
+		  intarg_count++;
+		  next_arg.u++;
+		}
+	      *next_arg.ll = **p_argv.ll;
+	      next_arg.u += 2;
+	    }
+	  else
+	    {
+	      /* The abi states only certain register pairs can be
+		 used for passing long long int specifically (r3,r4),
+		 (r5,r6), (r7,r8), (r9,r10).  If next arg is long long
+		 but not correct starting register of pair then skip
+		 until the proper starting register.  */
+	      if (intarg_count % 2 != 0)
+		{
+		  intarg_count ++;
+		  gpr_base.u++;
+		}
+	      *gpr_base.ll++ = **p_argv.ll;
+	    }
+	  intarg_count += 2;
+	  break;
+
+	case FFI_TYPE_STRUCT:
+	  struct_copy_size = ((*ptr)->size + 15) & ~0xF;
+	  copy_space.c -= struct_copy_size;
+	  memcpy (copy_space.c, *p_argv.c, (*ptr)->size);
+
+	  gprvalue = (unsigned long) copy_space.c;
+
+	  FFI_ASSERT (copy_space.c > next_arg.c);
+	  FFI_ASSERT (flags & FLAG_ARG_NEEDS_COPY);
+	  goto putgpr;
+
+	case FFI_TYPE_UINT8:
+	  gprvalue = **p_argv.uc;
+	  goto putgpr;
+	case FFI_TYPE_SINT8:
+	  gprvalue = **p_argv.sc;
+	  goto putgpr;
+	case FFI_TYPE_UINT16:
+	  gprvalue = **p_argv.us;
+	  goto putgpr;
+	case FFI_TYPE_SINT16:
+	  gprvalue = **p_argv.ss;
+	  goto putgpr;
+
+	case FFI_TYPE_INT:
+	case FFI_TYPE_UINT32:
+	case FFI_TYPE_SINT32:
+	case FFI_TYPE_POINTER:
+
+	  gprvalue = **p_argv.ui;
+
+	putgpr:
+	  if (intarg_count >= NUM_GPR_ARG_REGISTERS)
+	    *next_arg.u++ = gprvalue;
+	  else
+	    *gpr_base.u++ = gprvalue;
+	  intarg_count++;
+	  break;
+	}
+    }
+
+  /* Check that we didn't overrun the stack...  */
+  FFI_ASSERT (copy_space.c >= next_arg.c);
+  FFI_ASSERT (gpr_base.u <= stacktop.u - ASM_NEEDS_REGISTERS);
+  /* The assert below is testing that the number of integer arguments agrees
+     with the number found in ffi_prep_cif_machdep().  However, intarg_count
+     is incremented whenever we place an FP arg on the stack, so account for
+     that before our assert test.  */
+#ifndef __NO_FPRS__
+  if (fparg_count > NUM_FPR_ARG_REGISTERS)
+    intarg_count -= fparg_count - NUM_FPR_ARG_REGISTERS;
+  FFI_ASSERT (fpr_base.u
+	      <= stacktop.u - ASM_NEEDS_REGISTERS - NUM_GPR_ARG_REGISTERS);
+#endif
+  FFI_ASSERT (flags & FLAG_4_GPR_ARGUMENTS || intarg_count <= 4);
+}
+
+#define MIN_CACHE_LINE_SIZE 8
+
+static void
+flush_icache (char *wraddr, char *xaddr, int size)
+{
+  int i;
+  for (i = 0; i < size; i += MIN_CACHE_LINE_SIZE)
+    __asm__ volatile ("icbi 0,%0;" "dcbf 0,%1;"
+		      : : "r" (xaddr + i), "r" (wraddr + i) : "memory");
+  __asm__ volatile ("icbi 0,%0;" "dcbf 0,%1;" "sync;" "isync;"
+		    : : "r"(xaddr + size - 1), "r"(wraddr + size - 1)
+		    : "memory");
+}
+
+ffi_status FFI_HIDDEN
+ffi_prep_closure_loc_sysv (ffi_closure *closure,
+			   ffi_cif *cif,
+			   void (*fun) (ffi_cif *, void *, void **, void *),
+			   void *user_data,
+			   void *codeloc)
+{
+  unsigned int *tramp;
+
+  if (cif->abi < FFI_SYSV || cif->abi >= FFI_LAST_ABI)
+    return FFI_BAD_ABI;
+
+  tramp = (unsigned int *) &closure->tramp[0];
+  tramp[0] = 0x7c0802a6;  /*   mflr    r0 */
+  tramp[1] = 0x4800000d;  /*   bl      10 <trampoline_initial+0x10> */
+  tramp[4] = 0x7d6802a6;  /*   mflr    r11 */
+  tramp[5] = 0x7c0803a6;  /*   mtlr    r0 */
+  tramp[6] = 0x800b0000;  /*   lwz     r0,0(r11) */
+  tramp[7] = 0x816b0004;  /*   lwz     r11,4(r11) */
+  tramp[8] = 0x7c0903a6;  /*   mtctr   r0 */
+  tramp[9] = 0x4e800420;  /*   bctr */
+  *(void **) &tramp[2] = (void *) ffi_closure_SYSV; /* function */
+  *(void **) &tramp[3] = codeloc;                   /* context */
+
+  /* Flush the icache.  */
+  flush_icache ((char *)tramp, (char *)codeloc, FFI_TRAMPOLINE_SIZE);
+
+  closure->cif = cif;
+  closure->fun = fun;
+  closure->user_data = user_data;
+
+  return FFI_OK;
+}
+
+/* Basically the trampoline invokes ffi_closure_SYSV, and on
+   entry, r11 holds the address of the closure.
+   After storing the registers that could possibly contain
+   parameters to be passed into the stack frame and setting
+   up space for a return value, ffi_closure_SYSV invokes the
+   following helper function to do most of the work.  */
+
+int
+ffi_closure_helper_SYSV (ffi_closure *closure, void *rvalue,
+			 unsigned long *pgr, ffi_dblfl *pfr,
+			 unsigned long *pst)
+{
+  /* rvalue is the pointer to space for return value in closure assembly */
+  /* pgr is the pointer to where r3-r10 are stored in ffi_closure_SYSV */
+  /* pfr is the pointer to where f1-f8 are stored in ffi_closure_SYSV  */
+  /* pst is the pointer to outgoing parameter stack in original caller */
+
+  void **          avalue;
+  ffi_type **      arg_types;
+  long             i, avn;
+#ifndef __NO_FPRS__
+  long             nf = 0;   /* number of floating registers already used */
+#endif
+  long             ng = 0;   /* number of general registers already used */
+
+  ffi_cif *cif = closure->cif;
+  unsigned       size     = cif->rtype->size;
+  unsigned short rtypenum = cif->rtype->type;
+
+  avalue = alloca (cif->nargs * sizeof (void *));
+
+  /* First translate for softfloat/nonlinux */
+  rtypenum = translate_float (cif->abi, rtypenum);
+
+  /* Copy the caller's structure return value address so that the closure
+     returns the data directly to the caller.
+     For FFI_SYSV the result is passed in r3/r4 if the struct size is less
+     or equal 8 bytes.  */
+  if (rtypenum == FFI_TYPE_STRUCT
+      && !((cif->abi & FFI_SYSV_STRUCT_RET) != 0 && size <= 8))
+    {
+      rvalue = (void *) *pgr;
+      ng++;
+      pgr++;
+    }
+
+  i = 0;
+  avn = cif->nargs;
+  arg_types = cif->arg_types;
+
+  /* Grab the addresses of the arguments from the stack frame.  */
+  while (i < avn) {
+    unsigned short typenum = arg_types[i]->type;
+
+    /* We may need to handle some values depending on ABI.  */
+    typenum = translate_float (cif->abi, typenum);
+
+    switch (typenum)
+      {
+#ifndef __NO_FPRS__
+      case FFI_TYPE_FLOAT:
+	/* Unfortunately float values are stored as doubles
+	   in the ffi_closure_SYSV code (since we don't check
+	   the type in that routine).  */
+	if (nf < NUM_FPR_ARG_REGISTERS)
+	  {
+	    /* FIXME? here we are really changing the values
+	       stored in the original calling routines outgoing
+	       parameter stack.  This is probably a really
+	       naughty thing to do but...  */
+	    double temp = pfr->d;
+	    pfr->f = (float) temp;
+	    avalue[i] = pfr;
+	    nf++;
+	    pfr++;
+	  }
+	else
+	  {
+	    avalue[i] = pst;
+	    pst += 1;
+	  }
+	break;
+
+      case FFI_TYPE_DOUBLE:
+	if (nf < NUM_FPR_ARG_REGISTERS)
+	  {
+	    avalue[i] = pfr;
+	    nf++;
+	    pfr++;
+	  }
+	else
+	  {
+	    if (((long) pst) & 4)
+	      pst++;
+	    avalue[i] = pst;
+	    pst += 2;
+	  }
+	break;
+
+# if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
+      case FFI_TYPE_LONGDOUBLE:
+	if (nf < NUM_FPR_ARG_REGISTERS - 1)
+	  {
+	    avalue[i] = pfr;
+	    pfr += 2;
+	    nf += 2;
+	  }
+	else
+	  {
+	    if (((long) pst) & 4)
+	      pst++;
+	    avalue[i] = pst;
+	    pst += 4;
+	    nf = 8;
+	  }
+	break;
+# endif
+#endif
+
+      case FFI_TYPE_UINT128:
+	/* Test if for the whole long double, 4 gprs are available.
+	   otherwise the stuff ends up on the stack.  */
+	if (ng < NUM_GPR_ARG_REGISTERS - 3)
+	  {
+	    avalue[i] = pgr;
+	    pgr += 4;
+	    ng += 4;
+	  }
+	else
+	  {
+	    avalue[i] = pst;
+	    pst += 4;
+	    ng = 8+4;
+	  }
+	break;
+
+      case FFI_TYPE_SINT8:
+      case FFI_TYPE_UINT8:
+#ifndef __LITTLE_ENDIAN__
+	if (ng < NUM_GPR_ARG_REGISTERS)
+	  {
+	    avalue[i] = (char *) pgr + 3;
+	    ng++;
+	    pgr++;
+	  }
+	else
+	  {
+	    avalue[i] = (char *) pst + 3;
+	    pst++;
+	  }
+	break;
+#endif
+
+      case FFI_TYPE_SINT16:
+      case FFI_TYPE_UINT16:
+#ifndef __LITTLE_ENDIAN__
+	if (ng < NUM_GPR_ARG_REGISTERS)
+	  {
+	    avalue[i] = (char *) pgr + 2;
+	    ng++;
+	    pgr++;
+	  }
+	else
+	  {
+	    avalue[i] = (char *) pst + 2;
+	    pst++;
+	  }
+	break;
+#endif
+
+      case FFI_TYPE_SINT32:
+      case FFI_TYPE_UINT32:
+      case FFI_TYPE_POINTER:
+	if (ng < NUM_GPR_ARG_REGISTERS)
+	  {
+	    avalue[i] = pgr;
+	    ng++;
+	    pgr++;
+	  }
+	else
+	  {
+	    avalue[i] = pst;
+	    pst++;
+	  }
+	break;
+
+      case FFI_TYPE_STRUCT:
+	/* Structs are passed by reference. The address will appear in a
+	   gpr if it is one of the first 8 arguments.  */
+	if (ng < NUM_GPR_ARG_REGISTERS)
+	  {
+	    avalue[i] = (void *) *pgr;
+	    ng++;
+	    pgr++;
+	  }
+	else
+	  {
+	    avalue[i] = (void *) *pst;
+	    pst++;
+	  }
+	break;
+
+      case FFI_TYPE_SINT64:
+      case FFI_TYPE_UINT64:
+	/* Passing long long ints are complex, they must
+	   be passed in suitable register pairs such as
+	   (r3,r4) or (r5,r6) or (r6,r7), or (r7,r8) or (r9,r10)
+	   and if the entire pair aren't available then the outgoing
+	   parameter stack is used for both but an alignment of 8
+	   must will be kept.  So we must either look in pgr
+	   or pst to find the correct address for this type
+	   of parameter.  */
+	if (ng < NUM_GPR_ARG_REGISTERS - 1)
+	  {
+	    if (ng & 1)
+	      {
+		/* skip r4, r6, r8 as starting points */
+		ng++;
+		pgr++;
+	      }
+	    avalue[i] = pgr;
+	    ng += 2;
+	    pgr += 2;
+	  }
+	else
+	  {
+	    if (((long) pst) & 4)
+	      pst++;
+	    avalue[i] = pst;
+	    pst += 2;
+	    ng = NUM_GPR_ARG_REGISTERS;
+	  }
+	break;
+
+      default:
+	FFI_ASSERT (0);
+      }
+
+    i++;
+  }
+
+  (closure->fun) (cif, rvalue, avalue, closure->user_data);
+
+  /* Tell ffi_closure_SYSV how to perform return type promotions.
+     Because the FFI_SYSV ABI returns the structures <= 8 bytes in
+     r3/r4 we have to tell ffi_closure_SYSV how to treat them.  We
+     combine the base type FFI_SYSV_TYPE_SMALL_STRUCT with the size of
+     the struct less one.  We never have a struct with size zero.
+     See the comment in ffitarget.h about ordering.  */
+  if (rtypenum == FFI_TYPE_STRUCT
+      && (cif->abi & FFI_SYSV_STRUCT_RET) != 0 && size <= 8)
+    return FFI_SYSV_TYPE_SMALL_STRUCT - 1 + size;
+  return rtypenum;
+}
+#endif
diff --git a/Modules/_ctypes/libffi/src/powerpc/ffitarget.h b/Modules/_ctypes/libffi/src/powerpc/ffitarget.h
index 3c9db49..b47b0f5 100644
--- a/Modules/_ctypes/libffi/src/powerpc/ffitarget.h
+++ b/Modules/_ctypes/libffi/src/powerpc/ffitarget.h
@@ -60,45 +60,76 @@
 typedef enum ffi_abi {
   FFI_FIRST_ABI = 0,
 
-#ifdef POWERPC
-  FFI_SYSV,
-  FFI_GCC_SYSV,
-  FFI_LINUX64,
-  FFI_LINUX,
-  FFI_LINUX_SOFT_FLOAT,
-# if defined(POWERPC64)
-  FFI_DEFAULT_ABI = FFI_LINUX64,
-# elif defined(__NO_FPRS__)
-  FFI_DEFAULT_ABI = FFI_LINUX_SOFT_FLOAT,
-# elif (__LDBL_MANT_DIG__ == 106)
-  FFI_DEFAULT_ABI = FFI_LINUX,
-# else
-  FFI_DEFAULT_ABI = FFI_GCC_SYSV,
-# endif
-#endif
-
-#ifdef POWERPC_AIX
+#if defined (POWERPC_AIX)
   FFI_AIX,
   FFI_DARWIN,
   FFI_DEFAULT_ABI = FFI_AIX,
-#endif
+  FFI_LAST_ABI
 
-#ifdef POWERPC_DARWIN
+#elif defined (POWERPC_DARWIN)
   FFI_AIX,
   FFI_DARWIN,
   FFI_DEFAULT_ABI = FFI_DARWIN,
-#endif
-
-#ifdef POWERPC_FREEBSD
-  FFI_SYSV,
-  FFI_GCC_SYSV,
-  FFI_LINUX64,
-  FFI_LINUX,
-  FFI_LINUX_SOFT_FLOAT,
-  FFI_DEFAULT_ABI = FFI_SYSV,
-#endif
-
   FFI_LAST_ABI
+
+#else
+  /* The FFI_COMPAT values are used by old code.  Since libffi may be
+     a shared library we have to support old values for backwards
+     compatibility.  */
+  FFI_COMPAT_SYSV,
+  FFI_COMPAT_GCC_SYSV,
+  FFI_COMPAT_LINUX64,
+  FFI_COMPAT_LINUX,
+  FFI_COMPAT_LINUX_SOFT_FLOAT,
+
+# if defined (POWERPC64)
+  /* This bit, always set in new code, must not be set in any of the
+     old FFI_COMPAT values that might be used for 64-bit linux.  We
+     only need worry about FFI_COMPAT_LINUX64, but to be safe avoid
+     all old values.  */
+  FFI_LINUX = 8,
+  /* This and following bits can reuse FFI_COMPAT values.  */
+  FFI_LINUX_STRUCT_ALIGN = 1,
+  FFI_LINUX_LONG_DOUBLE_128 = 2,
+  FFI_DEFAULT_ABI = (FFI_LINUX
+#  ifdef __STRUCT_PARM_ALIGN__
+		     | FFI_LINUX_STRUCT_ALIGN
+#  endif
+#  ifdef __LONG_DOUBLE_128__
+		     | FFI_LINUX_LONG_DOUBLE_128
+#  endif
+		     ),
+  FFI_LAST_ABI = 12
+
+# else
+  /* This bit, always set in new code, must not be set in any of the
+     old FFI_COMPAT values that might be used for 32-bit linux/sysv/bsd.  */
+  FFI_SYSV = 8,
+  /* This and following bits can reuse FFI_COMPAT values.  */
+  FFI_SYSV_SOFT_FLOAT = 1,
+  FFI_SYSV_STRUCT_RET = 2,
+  FFI_SYSV_IBM_LONG_DOUBLE = 4,
+  FFI_SYSV_LONG_DOUBLE_128 = 16,
+
+  FFI_DEFAULT_ABI = (FFI_SYSV
+#  ifdef __NO_FPRS__
+		     | FFI_SYSV_SOFT_FLOAT
+#  endif
+#  if (defined (__SVR4_STRUCT_RETURN)					\
+       || defined (POWERPC_FREEBSD) && !defined (__AIX_STRUCT_RETURN))
+		     | FFI_SYSV_STRUCT_RET
+#  endif
+#  if __LDBL_MANT_DIG__ == 106
+		     | FFI_SYSV_IBM_LONG_DOUBLE
+#  endif
+#  ifdef __LONG_DOUBLE_128__
+		     | FFI_SYSV_LONG_DOUBLE_128
+#  endif
+		     ),
+  FFI_LAST_ABI = 32
+# endif
+#endif
+
 } ffi_abi;
 #endif
 
@@ -106,6 +137,10 @@
 
 #define FFI_CLOSURES 1
 #define FFI_NATIVE_RAW_API 0
+#if defined (POWERPC) || defined (POWERPC_FREEBSD)
+# define FFI_TARGET_SPECIFIC_VARIADIC 1
+# define FFI_EXTRA_CIF_FIELDS unsigned nfixedargs
+#endif
 
 /* For additional types like the below, take care about the order in
    ppc_closures.S. They must follow after the FFI_TYPE_LAST.  */
@@ -113,19 +148,26 @@
 /* Needed for soft-float long-double-128 support.  */
 #define FFI_TYPE_UINT128 (FFI_TYPE_LAST + 1)
 
-/* Needed for FFI_SYSV small structure returns.
-   We use two flag bits, (FLAG_SYSV_SMST_R3, FLAG_SYSV_SMST_R4) which are
-   defined in ffi.c, to determine the exact return type and its size.  */
+/* Needed for FFI_SYSV small structure returns.  */
 #define FFI_SYSV_TYPE_SMALL_STRUCT (FFI_TYPE_LAST + 2)
 
-#if defined(POWERPC64) || defined(POWERPC_AIX)
+/* Used by ELFv2 for homogenous structure returns.  */
+#define FFI_V2_TYPE_FLOAT_HOMOG		(FFI_TYPE_LAST + 1)
+#define FFI_V2_TYPE_DOUBLE_HOMOG	(FFI_TYPE_LAST + 2)
+#define FFI_V2_TYPE_SMALL_STRUCT	(FFI_TYPE_LAST + 3)
+
+#if _CALL_ELF == 2
+# define FFI_TRAMPOLINE_SIZE 32
+#else
+# if defined(POWERPC64) || defined(POWERPC_AIX)
 #  if defined(POWERPC_DARWIN64)
 #    define FFI_TRAMPOLINE_SIZE 48
 #  else
 #    define FFI_TRAMPOLINE_SIZE 24
 #  endif
-#else /* POWERPC || POWERPC_AIX */
+# else /* POWERPC || POWERPC_AIX */
 #  define FFI_TRAMPOLINE_SIZE 40
+# endif
 #endif
 
 #ifndef LIBFFI_ASM
diff --git a/Modules/_ctypes/libffi/src/powerpc/linux64.S b/Modules/_ctypes/libffi/src/powerpc/linux64.S
index f28da81..c4d01d8 100644
--- a/Modules/_ctypes/libffi/src/powerpc/linux64.S
+++ b/Modules/_ctypes/libffi/src/powerpc/linux64.S
@@ -29,18 +29,25 @@
 #include <fficonfig.h>
 #include <ffi.h>
 
-#ifdef __powerpc64__
+#ifdef POWERPC64
 	.hidden	ffi_call_LINUX64
 	.globl	ffi_call_LINUX64
+# if _CALL_ELF == 2
+	.text
+ffi_call_LINUX64:
+	addis	%r2, %r12, .TOC.-ffi_call_LINUX64@ha
+	addi	%r2, %r2, .TOC.-ffi_call_LINUX64@l
+	.localentry ffi_call_LINUX64, . - ffi_call_LINUX64
+# else
 	.section	".opd","aw"
 	.align	3
 ffi_call_LINUX64:
-#ifdef _CALL_LINUX
+#  ifdef _CALL_LINUX
 	.quad	.L.ffi_call_LINUX64,.TOC.@tocbase,0
 	.type	ffi_call_LINUX64,@function
 	.text
 .L.ffi_call_LINUX64:
-#else
+#  else
 	.hidden	.ffi_call_LINUX64
 	.globl	.ffi_call_LINUX64
 	.quad	.ffi_call_LINUX64,.TOC.@tocbase,0
@@ -48,7 +55,8 @@
 	.type	.ffi_call_LINUX64,@function
 	.text
 .ffi_call_LINUX64:
-#endif
+#  endif
+# endif
 .LFB1:
 	mflr	%r0
 	std	%r28, -32(%r1)
@@ -63,26 +71,35 @@
 	mr	%r31, %r5	/* flags, */
 	mr	%r30, %r6	/* rvalue, */
 	mr	%r29, %r7	/* function address.  */
+/* Save toc pointer, not for the ffi_prep_args64 call, but for the later
+   bctrl function call.  */
+# if _CALL_ELF == 2
+	std	%r2, 24(%r1)
+# else
 	std	%r2, 40(%r1)
+# endif
 
 	/* Call ffi_prep_args64.  */
 	mr	%r4, %r1
-#ifdef _CALL_LINUX
+# if defined _CALL_LINUX || _CALL_ELF == 2
 	bl	ffi_prep_args64
-#else
+# else
 	bl	.ffi_prep_args64
-#endif
+# endif
 
-	ld	%r0, 0(%r29)
+# if _CALL_ELF == 2
+	mr	%r12, %r29
+# else
+	ld	%r12, 0(%r29)
 	ld	%r2, 8(%r29)
 	ld	%r11, 16(%r29)
-
+# endif
 	/* Now do the call.  */
 	/* Set up cr1 with bits 4-7 of the flags.  */
 	mtcrf	0x40, %r31
 
 	/* Get the address to call into CTR.  */
-	mtctr	%r0
+	mtctr	%r12
 	/* Load all those argument registers.  */
 	ld	%r3, -32-(8*8)(%r28)
 	ld	%r4, -32-(7*8)(%r28)
@@ -117,12 +134,17 @@
 
 	/* This must follow the call immediately, the unwinder
 	   uses this to find out if r2 has been saved or not.  */
+# if _CALL_ELF == 2
+	ld	%r2, 24(%r1)
+# else
 	ld	%r2, 40(%r1)
+# endif
 
 	/* Now, deal with the return value.  */
 	mtcrf	0x01, %r31
-	bt-	30, .Ldone_return_value
-	bt-	29, .Lfp_return_value
+	bt	31, .Lstruct_return_value
+	bt	30, .Ldone_return_value
+	bt	29, .Lfp_return_value
 	std	%r3, 0(%r30)
 	/* Fall through...  */
 
@@ -130,7 +152,7 @@
 	/* Restore the registers we used and return.  */
 	mr	%r1, %r28
 	ld	%r0, 16(%r28)
-	ld	%r28, -32(%r1)
+	ld	%r28, -32(%r28)
 	mtlr	%r0
 	ld	%r29, -24(%r1)
 	ld	%r30, -16(%r1)
@@ -147,14 +169,48 @@
 .Lfloat_return_value:
 	stfs	%f1, 0(%r30)
 	b	.Ldone_return_value
+
+.Lstruct_return_value:
+	bf	29, .Lsmall_struct
+	bf	28, .Lfloat_homog_return_value
+	stfd	%f1, 0(%r30)
+	stfd	%f2, 8(%r30)
+	stfd	%f3, 16(%r30)
+	stfd	%f4, 24(%r30)
+	stfd	%f5, 32(%r30)
+	stfd	%f6, 40(%r30)
+	stfd	%f7, 48(%r30)
+	stfd	%f8, 56(%r30)
+	b	.Ldone_return_value
+
+.Lfloat_homog_return_value:
+	stfs	%f1, 0(%r30)
+	stfs	%f2, 4(%r30)
+	stfs	%f3, 8(%r30)
+	stfs	%f4, 12(%r30)
+	stfs	%f5, 16(%r30)
+	stfs	%f6, 20(%r30)
+	stfs	%f7, 24(%r30)
+	stfs	%f8, 28(%r30)
+	b	.Ldone_return_value
+
+.Lsmall_struct:
+	std	%r3, 0(%r30)
+	std	%r4, 8(%r30)
+	b	.Ldone_return_value
+
 .LFE1:
 	.long	0
 	.byte	0,12,0,1,128,4,0,0
-#ifdef _CALL_LINUX
+# if _CALL_ELF == 2
+	.size	ffi_call_LINUX64,.-ffi_call_LINUX64
+# else
+#  ifdef _CALL_LINUX
 	.size	ffi_call_LINUX64,.-.L.ffi_call_LINUX64
-#else
+#  else
 	.size	.ffi_call_LINUX64,.-.ffi_call_LINUX64
-#endif
+#  endif
+# endif
 
 	.section	.eh_frame,EH_FRAME_FLAGS,@progbits
 .Lframe1:
@@ -197,8 +253,8 @@
 	.uleb128 0x4
 	.align 3
 .LEFDE1:
-#endif
 
-#if defined __ELF__ && defined __linux__
+# if (defined __ELF__ && defined __linux__) || _CALL_ELF == 2
 	.section	.note.GNU-stack,"",@progbits
+# endif
 #endif
diff --git a/Modules/_ctypes/libffi/src/powerpc/linux64_closure.S b/Modules/_ctypes/libffi/src/powerpc/linux64_closure.S
index b1e1219..bc61b5e 100644
--- a/Modules/_ctypes/libffi/src/powerpc/linux64_closure.S
+++ b/Modules/_ctypes/libffi/src/powerpc/linux64_closure.S
@@ -30,18 +30,25 @@
 
 	.file	"linux64_closure.S"
 
-#ifdef __powerpc64__
+#ifdef POWERPC64
 	FFI_HIDDEN (ffi_closure_LINUX64)
 	.globl  ffi_closure_LINUX64
+# if _CALL_ELF == 2
+	.text
+ffi_closure_LINUX64:
+	addis	%r2, %r12, .TOC.-ffi_closure_LINUX64@ha
+	addi	%r2, %r2, .TOC.-ffi_closure_LINUX64@l
+	.localentry ffi_closure_LINUX64, . - ffi_closure_LINUX64
+# else
 	.section        ".opd","aw"
 	.align  3
 ffi_closure_LINUX64:
-#ifdef _CALL_LINUX
+#  ifdef _CALL_LINUX
 	.quad   .L.ffi_closure_LINUX64,.TOC.@tocbase,0
 	.type   ffi_closure_LINUX64,@function
 	.text
 .L.ffi_closure_LINUX64:
-#else
+#  else
 	FFI_HIDDEN (.ffi_closure_LINUX64)
 	.globl  .ffi_closure_LINUX64
 	.quad   .ffi_closure_LINUX64,.TOC.@tocbase,0
@@ -49,61 +56,105 @@
 	.type   .ffi_closure_LINUX64,@function
 	.text
 .ffi_closure_LINUX64:
-#endif
-.LFB1:
-	# save general regs into parm save area
-	std	%r3, 48(%r1)
-	std	%r4, 56(%r1)
-	std	%r5, 64(%r1)
-	std	%r6, 72(%r1)
-	mflr	%r0
+#  endif
+# endif
 
-	std	%r7, 80(%r1)
-	std	%r8, 88(%r1)
-	std	%r9, 96(%r1)
-	std	%r10, 104(%r1)
+# if _CALL_ELF == 2
+#  32 byte special reg save area + 64 byte parm save area
+#  + 64 byte retval area + 13*8 fpr save area + round to 16
+#  define STACKFRAME 272
+#  define PARMSAVE 32
+#  define RETVAL PARMSAVE+64
+# else
+#  48 bytes special reg save area + 64 bytes parm save area
+#  + 16 bytes retval area + 13*8 bytes fpr save area + round to 16
+#  define STACKFRAME 240
+#  define PARMSAVE 48
+#  define RETVAL PARMSAVE+64
+# endif
+
+.LFB1:
+# if _CALL_ELF == 2
+	ld	%r12, FFI_TRAMPOLINE_SIZE(%r11)		# closure->cif
+	mflr	%r0
+	lwz	%r12, 28(%r12)				# cif->flags
+	mtcrf	0x40, %r12
+	addi	%r12, %r1, PARMSAVE
+	bt	7, .Lparmsave
+	# Our caller has not allocated a parameter save area.
+	# We need to allocate one here and use it to pass gprs to
+	# ffi_closure_helper_LINUX64.
+	addi	%r12, %r1, -STACKFRAME+PARMSAVE
+.Lparmsave:
+	std	%r0, 16(%r1)
+	# Save general regs into parm save area
+	std	%r3, 0(%r12)
+	std	%r4, 8(%r12)
+	std	%r5, 16(%r12)
+	std	%r6, 24(%r12)
+	std	%r7, 32(%r12)
+	std	%r8, 40(%r12)
+	std	%r9, 48(%r12)
+	std	%r10, 56(%r12)
+
+	# load up the pointer to the parm save area
+	mr	%r5, %r12
+# else
+	# copy r2 to r11 and load TOC into r2
+	mr	%r11, %r2
+	ld	%r2, 16(%r11)
+
+	mflr	%r0
+	# Save general regs into parm save area
+	# This is the parameter save area set up by our caller.
+	std	%r3, PARMSAVE+0(%r1)
+	std	%r4, PARMSAVE+8(%r1)
+	std	%r5, PARMSAVE+16(%r1)
+	std	%r6, PARMSAVE+24(%r1)
+	std	%r7, PARMSAVE+32(%r1)
+	std	%r8, PARMSAVE+40(%r1)
+	std	%r9, PARMSAVE+48(%r1)
+	std	%r10, PARMSAVE+56(%r1)
+
 	std	%r0, 16(%r1)
 
-	# mandatory 48 bytes special reg save area + 64 bytes parm save area
-	# + 16 bytes retval area + 13*8 bytes fpr save area + round to 16
-	stdu	%r1, -240(%r1)
-.LCFI0:
+	# load up the pointer to the parm save area
+	addi	%r5, %r1, PARMSAVE
+# endif
 
 	# next save fpr 1 to fpr 13
-	stfd  %f1, 128+(0*8)(%r1)
-	stfd  %f2, 128+(1*8)(%r1)
-	stfd  %f3, 128+(2*8)(%r1)
-	stfd  %f4, 128+(3*8)(%r1)
-	stfd  %f5, 128+(4*8)(%r1)
-	stfd  %f6, 128+(5*8)(%r1)
-	stfd  %f7, 128+(6*8)(%r1)
-	stfd  %f8, 128+(7*8)(%r1)
-	stfd  %f9, 128+(8*8)(%r1)
-	stfd  %f10, 128+(9*8)(%r1)
-	stfd  %f11, 128+(10*8)(%r1)
-	stfd  %f12, 128+(11*8)(%r1)
-	stfd  %f13, 128+(12*8)(%r1)
+	stfd	%f1, -104+(0*8)(%r1)
+	stfd	%f2, -104+(1*8)(%r1)
+	stfd	%f3, -104+(2*8)(%r1)
+	stfd	%f4, -104+(3*8)(%r1)
+	stfd	%f5, -104+(4*8)(%r1)
+	stfd	%f6, -104+(5*8)(%r1)
+	stfd	%f7, -104+(6*8)(%r1)
+	stfd	%f8, -104+(7*8)(%r1)
+	stfd	%f9, -104+(8*8)(%r1)
+	stfd	%f10, -104+(9*8)(%r1)
+	stfd	%f11, -104+(10*8)(%r1)
+	stfd	%f12, -104+(11*8)(%r1)
+	stfd	%f13, -104+(12*8)(%r1)
 
-	# set up registers for the routine that actually does the work
+	# load up the pointer to the saved fpr registers */
+	addi	%r6, %r1, -104
+
+	# load up the pointer to the result storage
+	addi	%r4, %r1, -STACKFRAME+RETVAL
+
+	stdu	%r1, -STACKFRAME(%r1)
+.LCFI0:
+
 	# get the context pointer from the trampoline
-	mr %r3, %r11
-
-	# now load up the pointer to the result storage
-	addi %r4, %r1, 112
-
-	# now load up the pointer to the parameter save area
-	# in the previous frame
-	addi %r5, %r1, 240 + 48
-
-	# now load up the pointer to the saved fpr registers */
-	addi %r6, %r1, 128
+	mr	%r3, %r11
 
 	# make the call
-#ifdef _CALL_LINUX
+# if defined _CALL_LINUX || _CALL_ELF == 2
 	bl ffi_closure_helper_LINUX64
-#else
+# else
 	bl .ffi_closure_helper_LINUX64
-#endif
+# endif
 .Lret:
 
 	# now r3 contains the return type
@@ -112,10 +163,12 @@
 
 	# look up the proper starting point in table
 	# by using return type as offset
+	ld %r0, STACKFRAME+16(%r1)
+	cmpldi %r3, FFI_V2_TYPE_SMALL_STRUCT
+	bge .Lsmall
 	mflr %r4		# move address of .Lret to r4
 	sldi %r3, %r3, 4	# now multiply return type by 16
 	addi %r4, %r4, .Lret_type0 - .Lret
-	ld %r0, 240+16(%r1)
 	add %r3, %r3, %r4	# add contents of table to table address
 	mtctr %r3
 	bctr			# jump to it
@@ -128,89 +181,175 @@
 .Lret_type0:
 # case FFI_TYPE_VOID
 	mtlr %r0
-	addi %r1, %r1, 240
+	addi %r1, %r1, STACKFRAME
 	blr
 	nop
 # case FFI_TYPE_INT
-	lwa %r3, 112+4(%r1)
+# ifdef __LITTLE_ENDIAN__
+	lwa %r3, RETVAL+0(%r1)
+# else
+	lwa %r3, RETVAL+4(%r1)
+# endif
 	mtlr %r0
-	addi %r1, %r1, 240
+	addi %r1, %r1, STACKFRAME
 	blr
 # case FFI_TYPE_FLOAT
-	lfs %f1, 112+0(%r1)
+	lfs %f1, RETVAL+0(%r1)
 	mtlr %r0
-	addi %r1, %r1, 240
+	addi %r1, %r1, STACKFRAME
 	blr
 # case FFI_TYPE_DOUBLE
-	lfd %f1, 112+0(%r1)
+	lfd %f1, RETVAL+0(%r1)
 	mtlr %r0
-	addi %r1, %r1, 240
+	addi %r1, %r1, STACKFRAME
 	blr
 # case FFI_TYPE_LONGDOUBLE
-	lfd %f1, 112+0(%r1)
+	lfd %f1, RETVAL+0(%r1)
 	mtlr %r0
-	lfd %f2, 112+8(%r1)
+	lfd %f2, RETVAL+8(%r1)
 	b .Lfinish
 # case FFI_TYPE_UINT8
-	lbz %r3, 112+7(%r1)
+# ifdef __LITTLE_ENDIAN__
+	lbz %r3, RETVAL+0(%r1)
+# else
+	lbz %r3, RETVAL+7(%r1)
+# endif
 	mtlr %r0
-	addi %r1, %r1, 240
+	addi %r1, %r1, STACKFRAME
 	blr
 # case FFI_TYPE_SINT8
-	lbz %r3, 112+7(%r1)
+# ifdef __LITTLE_ENDIAN__
+	lbz %r3, RETVAL+0(%r1)
+# else
+	lbz %r3, RETVAL+7(%r1)
+# endif
 	extsb %r3,%r3
 	mtlr %r0
 	b .Lfinish
 # case FFI_TYPE_UINT16
-	lhz %r3, 112+6(%r1)
+# ifdef __LITTLE_ENDIAN__
+	lhz %r3, RETVAL+0(%r1)
+# else
+	lhz %r3, RETVAL+6(%r1)
+# endif
 	mtlr %r0
 .Lfinish:
-	addi %r1, %r1, 240
+	addi %r1, %r1, STACKFRAME
 	blr
 # case FFI_TYPE_SINT16
-	lha %r3, 112+6(%r1)
+# ifdef __LITTLE_ENDIAN__
+	lha %r3, RETVAL+0(%r1)
+# else
+	lha %r3, RETVAL+6(%r1)
+# endif
 	mtlr %r0
-	addi %r1, %r1, 240
+	addi %r1, %r1, STACKFRAME
 	blr
 # case FFI_TYPE_UINT32
-	lwz %r3, 112+4(%r1)
+# ifdef __LITTLE_ENDIAN__
+	lwz %r3, RETVAL+0(%r1)
+# else
+	lwz %r3, RETVAL+4(%r1)
+# endif
 	mtlr %r0
-	addi %r1, %r1, 240
+	addi %r1, %r1, STACKFRAME
 	blr
 # case FFI_TYPE_SINT32
-	lwa %r3, 112+4(%r1)
+# ifdef __LITTLE_ENDIAN__
+	lwa %r3, RETVAL+0(%r1)
+# else
+	lwa %r3, RETVAL+4(%r1)
+# endif
 	mtlr %r0
-	addi %r1, %r1, 240
+	addi %r1, %r1, STACKFRAME
 	blr
 # case FFI_TYPE_UINT64
-	ld %r3, 112+0(%r1)
+	ld %r3, RETVAL+0(%r1)
 	mtlr %r0
-	addi %r1, %r1, 240
+	addi %r1, %r1, STACKFRAME
 	blr
 # case FFI_TYPE_SINT64
-	ld %r3, 112+0(%r1)
+	ld %r3, RETVAL+0(%r1)
 	mtlr %r0
-	addi %r1, %r1, 240
+	addi %r1, %r1, STACKFRAME
 	blr
 # case FFI_TYPE_STRUCT
 	mtlr %r0
-	addi %r1, %r1, 240
+	addi %r1, %r1, STACKFRAME
 	blr
 	nop
 # case FFI_TYPE_POINTER
-	ld %r3, 112+0(%r1)
+	ld %r3, RETVAL+0(%r1)
 	mtlr %r0
-	addi %r1, %r1, 240
+	addi %r1, %r1, STACKFRAME
 	blr
-# esac
+# case FFI_V2_TYPE_FLOAT_HOMOG
+	lfs %f1, RETVAL+0(%r1)
+	lfs %f2, RETVAL+4(%r1)
+	lfs %f3, RETVAL+8(%r1)
+	b .Lmorefloat
+# case FFI_V2_TYPE_DOUBLE_HOMOG
+	lfd %f1, RETVAL+0(%r1)
+	lfd %f2, RETVAL+8(%r1)
+	lfd %f3, RETVAL+16(%r1)
+	lfd %f4, RETVAL+24(%r1)
+	mtlr %r0
+	lfd %f5, RETVAL+32(%r1)
+	lfd %f6, RETVAL+40(%r1)
+	lfd %f7, RETVAL+48(%r1)
+	lfd %f8, RETVAL+56(%r1)
+	addi %r1, %r1, STACKFRAME
+	blr
+.Lmorefloat:
+	lfs %f4, RETVAL+12(%r1)
+	mtlr %r0
+	lfs %f5, RETVAL+16(%r1)
+	lfs %f6, RETVAL+20(%r1)
+	lfs %f7, RETVAL+24(%r1)
+	lfs %f8, RETVAL+28(%r1)
+	addi %r1, %r1, STACKFRAME
+	blr
+.Lsmall:
+# ifdef __LITTLE_ENDIAN__
+	ld %r3,RETVAL+0(%r1)
+	mtlr %r0
+	ld %r4,RETVAL+8(%r1)
+	addi %r1, %r1, STACKFRAME
+	blr
+# else
+	# A struct smaller than a dword is returned in the low bits of r3
+	# ie. right justified.  Larger structs are passed left justified
+	# in r3 and r4.  The return value area on the stack will have
+	# the structs as they are usually stored in memory.
+	cmpldi %r3, FFI_V2_TYPE_SMALL_STRUCT + 7 # size 8 bytes?
+	neg %r5, %r3
+	ld %r3,RETVAL+0(%r1)
+	blt .Lsmalldown
+	mtlr %r0
+	ld %r4,RETVAL+8(%r1)
+	addi %r1, %r1, STACKFRAME
+	blr
+.Lsmalldown:
+	addi %r5, %r5, FFI_V2_TYPE_SMALL_STRUCT + 7
+	mtlr %r0
+	sldi %r5, %r5, 3
+	addi %r1, %r1, STACKFRAME
+	srd %r3, %r3, %r5
+	blr
+# endif
+
 .LFE1:
 	.long	0
 	.byte	0,12,0,1,128,0,0,0
-#ifdef _CALL_LINUX
+# if _CALL_ELF == 2
+	.size	ffi_closure_LINUX64,.-ffi_closure_LINUX64
+# else
+#  ifdef _CALL_LINUX
 	.size	ffi_closure_LINUX64,.-.L.ffi_closure_LINUX64
-#else
+#  else
 	.size	.ffi_closure_LINUX64,.-.ffi_closure_LINUX64
-#endif
+#  endif
+# endif
 
 	.section	.eh_frame,EH_FRAME_FLAGS,@progbits
 .Lframe1:
@@ -239,14 +378,14 @@
 	.byte	0x2	 # DW_CFA_advance_loc1
 	.byte	.LCFI0-.LFB1
 	.byte	0xe	 # DW_CFA_def_cfa_offset
-	.uleb128 240
+	.uleb128 STACKFRAME
 	.byte	0x11	 # DW_CFA_offset_extended_sf
 	.uleb128 0x41
 	.sleb128 -2
 	.align 3
 .LEFDE1:
-#endif
 
-#if defined __ELF__ && defined __linux__
+# if defined __ELF__ && defined __linux__
 	.section	.note.GNU-stack,"",@progbits
+# endif
 #endif
diff --git a/Modules/_ctypes/libffi/src/powerpc/ppc_closure.S b/Modules/_ctypes/libffi/src/powerpc/ppc_closure.S
index 41fb885..075922c 100644
--- a/Modules/_ctypes/libffi/src/powerpc/ppc_closure.S
+++ b/Modules/_ctypes/libffi/src/powerpc/ppc_closure.S
@@ -31,7 +31,7 @@
 
 	.file   "ppc_closure.S"
 
-#ifndef __powerpc64__
+#ifndef POWERPC64
 
 ENTRY(ffi_closure_SYSV)
 .LFB1:
@@ -159,25 +159,41 @@
 #endif
 
 # case FFI_TYPE_UINT8
+#ifdef __LITTLE_ENDIAN__
+	lbz %r3,112+0(%r1)
+#else
 	lbz %r3,112+3(%r1)
+#endif
 	mtlr %r0
 	addi %r1,%r1,144
 	blr
 
 # case FFI_TYPE_SINT8
+#ifdef __LITTLE_ENDIAN__
+	lbz %r3,112+0(%r1)
+#else
 	lbz %r3,112+3(%r1)
+#endif
 	extsb %r3,%r3
 	mtlr %r0
 	b .Lfinish
 
 # case FFI_TYPE_UINT16
+#ifdef __LITTLE_ENDIAN__
+	lhz %r3,112+0(%r1)
+#else
 	lhz %r3,112+2(%r1)
+#endif
 	mtlr %r0
 	addi %r1,%r1,144
 	blr
 
 # case FFI_TYPE_SINT16
+#ifdef __LITTLE_ENDIAN__
+	lha %r3,112+0(%r1)
+#else
 	lha %r3,112+2(%r1)
+#endif
 	mtlr %r0
 	addi %r1,%r1,144
 	blr
@@ -222,7 +238,7 @@
 	lwz %r3,112+0(%r1)
 	lwz %r4,112+4(%r1)
 	lwz %r5,112+8(%r1)
-	bl .Luint128
+	b .Luint128
 
 # The return types below are only used when the ABI type is FFI_SYSV.
 # case FFI_SYSV_TYPE_SMALL_STRUCT + 1. One byte struct.
@@ -239,9 +255,15 @@
 
 # case FFI_SYSV_TYPE_SMALL_STRUCT + 3. Three byte struct.
 	lwz %r3,112+0(%r1)
+#ifdef __LITTLE_ENDIAN__
+	mtlr %r0
+	addi %r1,%r1,144
+	blr
+#else
 	srwi %r3,%r3,8
 	mtlr %r0
 	b .Lfinish
+#endif
 
 # case FFI_SYSV_TYPE_SMALL_STRUCT + 4. Four byte struct.
 	lwz %r3,112+0(%r1)
@@ -252,20 +274,35 @@
 # case FFI_SYSV_TYPE_SMALL_STRUCT + 5. Five byte struct.
 	lwz %r3,112+0(%r1)
 	lwz %r4,112+4(%r1)
+#ifdef __LITTLE_ENDIAN__
+	mtlr %r0
+	b .Lfinish
+#else
 	li %r5,24
 	b .Lstruct567
+#endif
 
 # case FFI_SYSV_TYPE_SMALL_STRUCT + 6. Six byte struct.
 	lwz %r3,112+0(%r1)
 	lwz %r4,112+4(%r1)
+#ifdef __LITTLE_ENDIAN__
+	mtlr %r0
+	b .Lfinish
+#else
 	li %r5,16
 	b .Lstruct567
+#endif
 
 # case FFI_SYSV_TYPE_SMALL_STRUCT + 7. Seven byte struct.
 	lwz %r3,112+0(%r1)
 	lwz %r4,112+4(%r1)
+#ifdef __LITTLE_ENDIAN__
+	mtlr %r0
+	b .Lfinish
+#else
 	li %r5,8
 	b .Lstruct567
+#endif
 
 # case FFI_SYSV_TYPE_SMALL_STRUCT + 8. Eight byte struct.
 	lwz %r3,112+0(%r1)
@@ -273,6 +310,7 @@
 	mtlr %r0
 	b .Lfinish
 
+#ifndef __LITTLE_ENDIAN__
 .Lstruct567:
 	subfic %r6,%r5,32
 	srw %r4,%r4,%r5
@@ -282,13 +320,14 @@
 	mtlr %r0
 	addi %r1,%r1,144
 	blr
+#endif
 
 .Luint128:
 	lwz %r6,112+12(%r1)
 	mtlr %r0
 	addi %r1,%r1,144
 	blr
-
+	
 END(ffi_closure_SYSV)
 
 	.section	".eh_frame",EH_FRAME_FLAGS,@progbits
@@ -339,8 +378,7 @@
 	.align 2
 .LEFDE1:
 
-#endif
-
 #if defined __ELF__ && defined __linux__
 	.section	.note.GNU-stack,"",@progbits
 #endif
+#endif
diff --git a/Modules/_ctypes/libffi/src/powerpc/sysv.S b/Modules/_ctypes/libffi/src/powerpc/sysv.S
index 5ee3a19..fed2380 100644
--- a/Modules/_ctypes/libffi/src/powerpc/sysv.S
+++ b/Modules/_ctypes/libffi/src/powerpc/sysv.S
@@ -30,7 +30,7 @@
 #include <ffi.h>
 #include <powerpc/asm.h>
 
-#ifndef __powerpc64__
+#ifndef POWERPC64
 	.globl ffi_prep_args_SYSV
 ENTRY(ffi_call_SYSV)
 .LFB1:
@@ -142,19 +142,14 @@
 #endif
 
 L(small_struct_return_value):
-	extrwi	%r6,%r31,2,19         /* number of bytes padding = shift/8 */
-	mtcrf	0x02,%r31	      /* copy flags to cr[24:27] (cr6) */
-	extrwi	%r5,%r31,5,19         /* r5 <- number of bits of padding */
-	subfic  %r6,%r6,4             /* r6 <- number of useful bytes in r3 */
-	bf-	25,L(done_return_value) /* struct in r3 ? if not, done. */
-/* smst_one_register: */
-	slw	%r3,%r3,%r5           /* Left-justify value in r3 */
-	mtxer	%r6                   /* move byte count to XER ... */
-	stswx	%r3,0,%r30            /* ... and store that many bytes */
-	bf+	26,L(done_return_value)  /* struct in r3:r4 ? */
-	add	%r6,%r6,%r30          /* adjust pointer */
-	stswi	%r4,%r6,4             /* store last four bytes */
-	b	L(done_return_value)
+	/*
+	 * The C code always allocates a properly-aligned 8-byte bounce
+	 * buffer to make this assembly code very simple.  Just write out
+	 * r3 and r4 to the buffer to allow the C code to handle the rest.
+	 */
+	stw %r3, 0(%r30)
+	stw %r4, 4(%r30)
+	b L(done_return_value)
 
 .LFE1:
 END(ffi_call_SYSV)
@@ -218,8 +213,8 @@
       .uleb128  0x1c
       .align 2
 .LEFDE1:
-#endif
 
 #if defined __ELF__ && defined __linux__
 	.section	.note.GNU-stack,"",@progbits
 #endif
+#endif
diff --git a/Modules/_ctypes/libffi/src/prep_cif.c b/Modules/_ctypes/libffi/src/prep_cif.c
index e8ec5cf..55ceed8 100644
--- a/Modules/_ctypes/libffi/src/prep_cif.c
+++ b/Modules/_ctypes/libffi/src/prep_cif.c
@@ -76,6 +76,13 @@
      total size of 3*sizeof(long).  */
   arg->size = ALIGN (arg->size, arg->alignment);
 
+  /* On some targets, the ABI defines that structures have an additional
+     alignment beyond the "natural" one based on their elements.  */
+#ifdef FFI_AGGREGATE_ALIGNMENT
+  if (FFI_AGGREGATE_ALIGNMENT > arg->alignment)
+    arg->alignment = FFI_AGGREGATE_ALIGNMENT;
+#endif
+
   if (arg->size == 0)
     return FFI_BAD_TYPEDEF;
   else
@@ -111,13 +118,8 @@
   FFI_ASSERT((!isvariadic) || (nfixedargs >= 1));
   FFI_ASSERT(nfixedargs <= ntotalargs);
 
-#ifndef X86_WIN32
   if (! (abi > FFI_FIRST_ABI && abi < FFI_LAST_ABI))
     return FFI_BAD_ABI;
-#else
-  if (! (abi > FFI_FIRST_ABI && abi < FFI_LAST_ABI || abi == FFI_THISCALL))
-    return FFI_BAD_ABI;
-#endif
 
   cif->abi = abi;
   cif->arg_types = atypes;
@@ -126,6 +128,10 @@
 
   cif->flags = 0;
 
+#if HAVE_LONG_DOUBLE_VARIANT
+  ffi_prep_types (abi);
+#endif
+
   /* Initialize the return type if necessary */
   if ((cif->rtype->size == 0) && (initialize_aggregate(cif->rtype) != FFI_OK))
     return FFI_BAD_TYPEDEF;
@@ -146,7 +152,9 @@
 #ifdef XTENSA
       && (cif->rtype->size > 16)
 #endif
-
+#ifdef NIOS2
+      && (cif->rtype->size > 8)
+#endif
      )
     bytes = STACK_ARG_SIZE(sizeof(void*));
 #endif
@@ -174,7 +182,7 @@
 	{
 	  /* Add any padding if necessary */
 	  if (((*ptr)->alignment - 1) & bytes)
-	    bytes = ALIGN(bytes, (*ptr)->alignment);
+	    bytes = (unsigned)ALIGN(bytes, (*ptr)->alignment);
 
 #ifdef TILE
 	  if (bytes < 10 * FFI_SIZEOF_ARG &&
diff --git a/Modules/_ctypes/libffi/src/sh/ffi.c b/Modules/_ctypes/libffi/src/sh/ffi.c
index 3515b91..9ec86bf 100644
--- a/Modules/_ctypes/libffi/src/sh/ffi.c
+++ b/Modules/_ctypes/libffi/src/sh/ffi.c
@@ -41,7 +41,7 @@
 #define STRUCT_VALUE_ADDRESS_WITH_ARG 0
 #endif
 
-/* If the structure has essentialy an unique element, return its type.  */
+/* If the structure has essentially an unique element, return its type.  */
 static int
 simple_type (ffi_type *arg)
 {
diff --git a/Modules/_ctypes/libffi/src/tile/tile.S b/Modules/_ctypes/libffi/src/tile/tile.S
index a186e1f..d1f82cb 100644
--- a/Modules/_ctypes/libffi/src/tile/tile.S
+++ b/Modules/_ctypes/libffi/src/tile/tile.S
@@ -60,7 +60,7 @@
                        void (*fnaddr)(void));
 
         On entry, REG_ARGS contain the outgoing register values,
-        and STACK_ARGS containts STACK_ARG_BYTES of additional values
+        and STACK_ARGS contains STACK_ARG_BYTES of additional values
         to be passed on the stack. If STACK_ARG_BYTES is zero, then
         STACK_ARGS is ignored.
 
diff --git a/Modules/_ctypes/libffi/src/types.c b/Modules/_ctypes/libffi/src/types.c
index 0a11eb0..0de5994 100644
--- a/Modules/_ctypes/libffi/src/types.c
+++ b/Modules/_ctypes/libffi/src/types.c
@@ -44,6 +44,17 @@
   id, NULL					\
 }
 
+#define FFI_NONCONST_TYPEDEF(name, type, id)	\
+struct struct_align_##name {			\
+  char c;					\
+  type x;					\
+};						\
+ffi_type ffi_type_##name = {			\
+  sizeof(type),					\
+  offsetof(struct struct_align_##name, x),	\
+  id, NULL					\
+}
+
 /* Size and alignment are fake here. They must not be 0. */
 const ffi_type ffi_type_void = {
   1, 1, FFI_TYPE_VOID, NULL
@@ -73,5 +84,9 @@
 # endif
 const ffi_type ffi_type_longdouble = { 16, 16, 4, NULL };
 #elif FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
+# if HAVE_LONG_DOUBLE_VARIANT
+FFI_NONCONST_TYPEDEF(longdouble, long double, FFI_TYPE_LONGDOUBLE);
+# else
 FFI_TYPEDEF(longdouble, long double, FFI_TYPE_LONGDOUBLE);
+# endif
 #endif
diff --git a/Modules/_ctypes/libffi/src/vax/elfbsd.S b/Modules/_ctypes/libffi/src/vax/elfbsd.S
new file mode 100644
index 0000000..01ca313
--- /dev/null
+++ b/Modules/_ctypes/libffi/src/vax/elfbsd.S
@@ -0,0 +1,195 @@
+/*
+ * Copyright (c) 2013 Miodrag Vallat.  <miod@openbsd.org>
+ *
+ * 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.
+ */
+
+/*
+ * vax Foreign Function Interface
+ */
+
+#define LIBFFI_ASM	
+#include <fficonfig.h>
+#include <ffi.h>
+
+	.text
+
+/*
+ * void *					%r0
+ * ffi_call_elfbsd(extended_cif *ecif,		4(%ap)
+ *		   unsigned bytes,		8(%ap)
+ *		   unsigned flags,		12(%ap)
+ *		   void *rvalue,		16(%ap)
+ *		   void (*fn)());		20(%ap)
+ */
+	.globl	ffi_call_elfbsd
+	.type	ffi_call_elfbsd,@function
+	.align	2
+ffi_call_elfbsd:
+	.word	0x00c		# save R2 and R3
+
+	# Allocate stack space for the args
+	subl2	8(%ap), %sp
+
+	# Call ffi_prep_args
+	pushl	%sp
+	pushl	4(%ap)
+	calls	$2, ffi_prep_args
+
+	# Get function pointer
+	movl	20(%ap), %r1
+
+	# Build a CALLS frame
+	ashl	$-2, 8(%ap), %r0
+	pushl	%r0		# argument stack usage
+	movl	%sp, %r0	# future %ap
+	# saved registers
+	bbc	$11, 0(%r1), 1f
+	pushl	%r11
+1:	bbc	$10, 0(%r1), 1f
+	pushl	%r10
+1:	bbc	$9, 0(%r1), 1f
+	pushl	%r9
+1:	bbc	$8, 0(%r1), 1f
+	pushl	%r8
+1:	bbc	$7, 0(%r1), 1f
+	pushl	%r7
+1:	bbc	$6, 0(%r1), 1f
+	pushl	%r6
+1:	bbc	$5, 0(%r1), 1f
+	pushl	%r5
+1:	bbc	$4, 0(%r1), 1f
+	pushl	%r4
+1:	bbc	$3, 0(%r1), 1f
+	pushl	%r3
+1:	bbc	$2, 0(%r1), 1f
+	pushl	%r2
+1:	
+	pushal	9f
+	pushl	%fp
+	pushl	%ap
+	movl	16(%ap), %r3	# struct return address, if needed
+	movl	%r0, %ap
+	movzwl	4(%fp), %r0	# previous PSW, without the saved registers mask
+	bisl2	$0x20000000, %r0 # calls frame
+	movzwl	0(%r1), %r2
+	bicw2	$0xf003, %r2	# only keep R11-R2
+	ashl	$16, %r2, %r2
+	bisl2	%r2, %r0	# saved register mask of the called function
+	pushl	%r0	
+	pushl	$0
+	movl	%sp, %fp
+
+	# Invoke the function
+	pushal	2(%r1)		# skip procedure entry mask
+	movl	%r3, %r1
+	bicpsw	$0x000f
+	rsb
+
+9:
+	# Copy return value if necessary
+	tstl	16(%ap)
+	jeql	9f
+	movl	16(%ap), %r2
+
+	bbc	$0, 12(%ap), 1f	# CIF_FLAGS_CHAR
+	movb	%r0, 0(%r2)
+	brb	9f
+1:
+	bbc	$1, 12(%ap), 1f	# CIF_FLAGS_SHORT
+	movw	%r0, 0(%r2)
+	brb	9f
+1:
+	bbc	$2, 12(%ap), 1f	# CIF_FLAGS_INT
+	movl	%r0, 0(%r2)
+	brb	9f
+1:
+	bbc	$3, 12(%ap), 1f	# CIF_FLAGS_DINT
+	movq	%r0, 0(%r2)
+	brb	9f
+1:
+	movl	%r1, %r0	# might have been a struct
+	#brb	9f
+
+9:
+	ret
+
+/*
+ * ffi_closure_elfbsd(void);
+ * invoked with	%r0: ffi_closure *closure
+ */
+	.globl	ffi_closure_elfbsd
+	.type	ffi_closure_elfbsd, @function
+	.align	2
+ffi_closure_elfbsd:
+	.word	0
+
+	# Allocate room on stack for return value
+	subl2	$8, %sp
+
+	# Invoke the closure function
+	pushal	4(%ap)		# calling stack
+	pushal	4(%sp)		# return value
+	pushl	%r0		# closure
+	calls	$3, ffi_closure_elfbsd_inner
+
+	# Copy return value if necessary
+	bitb	$1, %r0		# CIF_FLAGS_CHAR
+	beql	1f
+	movb	0(%sp), %r0
+	brb	9f
+1:
+	bitb	$2, %r0		# CIF_FLAGS_SHORT
+	beql	1f
+	movw	0(%sp), %r0
+	brb	9f
+1:
+	bitb	$4, %r0		# CIF_FLAGS_INT
+	beql	1f
+	movl	0(%sp), %r0
+	brb	9f
+1:
+	bitb	$8, %r0		# CIF_FLAGS_DINT
+	beql	1f
+	movq	0(%sp), %r0
+	#brb	9f
+1:
+
+9:
+	ret
+
+/*
+ * ffi_closure_struct_elfbsd(void);
+ * invoked with	%r0: ffi_closure *closure
+ *		%r1: struct return address
+ */
+	.globl	ffi_closure_struct_elfbsd
+	.type	ffi_closure_struct_elfbsd, @function
+	.align	2
+ffi_closure_struct_elfbsd:
+	.word	0
+
+	# Invoke the closure function
+	pushal	4(%ap)		# calling stack
+	pushl	%r1		# return value
+	pushl	%r0		# closure
+	calls	$3, ffi_closure_elfbsd_inner
+
+	ret
diff --git a/Modules/_ctypes/libffi/src/vax/ffi.c b/Modules/_ctypes/libffi/src/vax/ffi.c
new file mode 100644
index 0000000..f4d6bbb
--- /dev/null
+++ b/Modules/_ctypes/libffi/src/vax/ffi.c
@@ -0,0 +1,276 @@
+/*
+ * Copyright (c) 2013 Miodrag Vallat.  <miod@openbsd.org>
+ *
+ * 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.
+ */
+
+/*
+ * vax Foreign Function Interface
+ *
+ * This file attempts to provide all the FFI entry points which can reliably
+ * be implemented in C.
+ */
+
+#include <ffi.h>
+#include <ffi_common.h>
+
+#include <stdlib.h>
+#include <unistd.h>
+
+#define CIF_FLAGS_CHAR		1	/* for struct only */
+#define CIF_FLAGS_SHORT		2	/* for struct only */
+#define CIF_FLAGS_INT		4
+#define CIF_FLAGS_DINT		8
+
+/*
+ * Foreign Function Interface API
+ */
+
+void ffi_call_elfbsd (extended_cif *, unsigned, unsigned, void *,
+		       void (*) ());
+void *ffi_prep_args (extended_cif *ecif, void *stack);
+
+void *
+ffi_prep_args (extended_cif *ecif, void *stack)
+{
+  unsigned int i;
+  void **p_argv;
+  char *argp;
+  ffi_type **p_arg;
+  void *struct_value_ptr;
+
+  argp = stack;
+
+  if (ecif->cif->rtype->type == FFI_TYPE_STRUCT
+      && !ecif->cif->flags)
+    struct_value_ptr = ecif->rvalue;
+  else
+    struct_value_ptr = NULL;
+
+  p_argv = ecif->avalue;
+
+  for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types;
+       i != 0;
+       i--, p_arg++)
+    {
+      size_t z;
+
+      z = (*p_arg)->size;
+      if (z < sizeof (int))
+	{
+	  switch ((*p_arg)->type)
+	    {
+	    case FFI_TYPE_SINT8:
+	      *(signed int *) argp = (signed int) *(SINT8 *) *p_argv;
+	      break;
+
+	    case FFI_TYPE_UINT8:
+	      *(unsigned int *) argp = (unsigned int) *(UINT8 *) *p_argv;
+	      break;
+
+	    case FFI_TYPE_SINT16:
+	      *(signed int *) argp = (signed int) *(SINT16 *) *p_argv;
+	      break;
+
+	    case FFI_TYPE_UINT16:
+	      *(unsigned int *) argp = (unsigned int) *(UINT16 *) *p_argv;
+	      break;
+
+	    case FFI_TYPE_STRUCT:
+	      memcpy (argp, *p_argv, z);
+	      break;
+
+	    default:
+	      FFI_ASSERT (0);
+	    }
+	  z = sizeof (int);
+	}
+      else
+	{
+	  memcpy (argp, *p_argv, z);
+
+	  /* Align if necessary.  */
+	  if ((sizeof(int) - 1) & z)
+	    z = ALIGN(z, sizeof(int));
+	}
+
+      p_argv++;
+      argp += z;
+    }
+
+  return struct_value_ptr;
+}
+
+ffi_status
+ffi_prep_cif_machdep (ffi_cif *cif)
+{
+  /* Set the return type flag */
+  switch (cif->rtype->type)
+    {
+    case FFI_TYPE_VOID:
+      cif->flags = 0;
+      break;
+
+    case FFI_TYPE_STRUCT:
+      if (cif->rtype->elements[0]->type == FFI_TYPE_STRUCT &&
+	  cif->rtype->elements[1])
+	{
+	  cif->flags = 0;
+	  break;
+	}
+
+      if (cif->rtype->size == sizeof (char))
+	cif->flags = CIF_FLAGS_CHAR;
+      else if (cif->rtype->size == sizeof (short))
+	cif->flags = CIF_FLAGS_SHORT;
+      else if (cif->rtype->size == sizeof (int))
+	cif->flags = CIF_FLAGS_INT;
+      else if (cif->rtype->size == 2 * sizeof (int))
+	cif->flags = CIF_FLAGS_DINT;
+      else
+	cif->flags = 0;
+      break;
+
+    default:
+      if (cif->rtype->size <= sizeof (int))
+	cif->flags = CIF_FLAGS_INT;
+      else
+	cif->flags = CIF_FLAGS_DINT;
+      break;
+    }
+
+  return FFI_OK;
+}
+
+void
+ffi_call (ffi_cif *cif, void (*fn) (), void *rvalue, void **avalue)
+{
+  extended_cif ecif;
+
+  ecif.cif = cif;
+  ecif.avalue = avalue;
+
+  /* If the return value is a struct and we don't have a return value
+     address then we need to make one.  */
+
+  if (rvalue == NULL
+      && cif->rtype->type == FFI_TYPE_STRUCT
+      && cif->flags == 0)
+    ecif.rvalue = alloca (cif->rtype->size);
+  else
+    ecif.rvalue = rvalue;
+
+  switch (cif->abi)
+    {
+    case FFI_ELFBSD:
+      ffi_call_elfbsd (&ecif, cif->bytes, cif->flags, ecif.rvalue, fn);
+      break;
+
+    default:
+      FFI_ASSERT (0);
+      break;
+    }
+}
+
+/*
+ * Closure API
+ */
+
+void ffi_closure_elfbsd (void);
+void ffi_closure_struct_elfbsd (void);
+unsigned int ffi_closure_elfbsd_inner (ffi_closure *, void *, char *);
+
+static void
+ffi_prep_closure_elfbsd (ffi_cif *cif, void **avalue, char *stackp)
+{
+  unsigned int i;
+  void **p_argv;
+  ffi_type **p_arg;
+
+  p_argv = avalue;
+
+  for (i = cif->nargs, p_arg = cif->arg_types; i != 0; i--, p_arg++)
+    {
+      size_t z;
+
+      z = (*p_arg)->size;
+      *p_argv = stackp;
+
+      /* Align if necessary */
+      if ((sizeof (int) - 1) & z)
+	z = ALIGN(z, sizeof (int));
+
+      p_argv++;
+      stackp += z;
+    }
+}
+
+unsigned int
+ffi_closure_elfbsd_inner (ffi_closure *closure, void *resp, char *stack)
+{
+  ffi_cif *cif;
+  void **arg_area;
+
+  cif = closure->cif;
+  arg_area = (void **) alloca (cif->nargs * sizeof (void *));
+
+  ffi_prep_closure_elfbsd (cif, arg_area, stack);
+
+  (closure->fun) (cif, resp, arg_area, closure->user_data);
+
+  return cif->flags;
+}
+
+ffi_status
+ffi_prep_closure_loc (ffi_closure *closure, ffi_cif *cif,
+		      void (*fun)(ffi_cif *, void *, void **, void *),
+		      void *user_data, void *codeloc)
+{
+  char *tramp = (char *) codeloc;
+  void *fn;
+
+  FFI_ASSERT (cif->abi == FFI_ELFBSD);
+
+  /* entry mask */
+  *(unsigned short *)(tramp + 0) = 0x0000;
+  /* movl #closure, r0 */
+  tramp[2] = 0xd0;
+  tramp[3] = 0x8f;
+  *(unsigned int *)(tramp + 4) = (unsigned int) closure;
+  tramp[8] = 0x50;
+
+  if (cif->rtype->type == FFI_TYPE_STRUCT
+      && !cif->flags)
+    fn = &ffi_closure_struct_elfbsd;
+  else
+    fn = &ffi_closure_elfbsd;
+
+  /* jmpl #fn */
+  tramp[9] = 0x17;
+  tramp[10] = 0xef;
+  *(unsigned int *)(tramp + 11) = (unsigned int)fn + 2 -
+				  (unsigned int)tramp - 9 - 6;
+
+  closure->cif = cif;
+  closure->user_data = user_data;
+  closure->fun = fun;
+
+  return FFI_OK;
+}
diff --git a/Modules/_ctypes/libffi/src/vax/ffitarget.h b/Modules/_ctypes/libffi/src/vax/ffitarget.h
new file mode 100644
index 0000000..2fc9488
--- /dev/null
+++ b/Modules/_ctypes/libffi/src/vax/ffitarget.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2013 Miodrag Vallat.  <miod@openbsd.org>
+ *
+ * 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.
+ */
+
+/*
+ * vax Foreign Function Interface
+ */
+
+#ifndef LIBFFI_TARGET_H
+#define LIBFFI_TARGET_H
+
+#ifndef LIBFFI_ASM
+typedef unsigned long ffi_arg;
+typedef signed long ffi_sarg;
+
+typedef enum ffi_abi {
+  FFI_FIRST_ABI = 0,
+  FFI_ELFBSD,
+  FFI_DEFAULT_ABI = FFI_ELFBSD,
+  FFI_LAST_ABI = FFI_DEFAULT_ABI + 1
+} ffi_abi;
+#endif
+
+/* ---- Definitions for closures ----------------------------------------- */
+
+#define FFI_CLOSURES 1
+#define FFI_TRAMPOLINE_SIZE 15
+#define FFI_NATIVE_RAW_API 0
+
+#endif
diff --git a/Modules/_ctypes/libffi/src/x86/ffi.c b/Modules/_ctypes/libffi/src/x86/ffi.c
index 0600414..64b19ec 100644
--- a/Modules/_ctypes/libffi/src/x86/ffi.c
+++ b/Modules/_ctypes/libffi/src/x86/ffi.c
@@ -39,16 +39,18 @@
 
 #include <stdlib.h>
 
+
 /* ffi_prep_args is called by the assembly routine once stack space
    has been allocated for the function's arguments */
 
+void ffi_prep_args(char *stack, extended_cif *ecif);
 void ffi_prep_args(char *stack, extended_cif *ecif)
 {
   register unsigned int i;
   register void **p_argv;
   register char *argp;
   register ffi_type **p_arg;
-#ifdef X86_WIN32
+#ifndef X86_WIN64
   size_t p_stack_args[2];
   void *p_stack_data[2];
   char *argp2 = stack;
@@ -67,7 +69,7 @@
       )
     {
       *(void **) argp = ecif->rvalue;
-#ifdef X86_WIN32
+#ifndef X86_WIN64
       /* For fastcall/thiscall this is first register-passed
          argument.  */
       if (cabi == FFI_THISCALL || cabi == FFI_FASTCALL)
@@ -153,7 +155,7 @@
           memcpy(argp, *p_argv, z);
         }
 
-#ifdef X86_WIN32
+#ifndef X86_WIN64
     /* For thiscall/fastcall convention register-passed arguments
        are the first two none-floating-point arguments with a size
        smaller or equal to sizeof (void*).  */
@@ -178,7 +180,7 @@
 #endif
     }
 
-#ifdef X86_WIN32
+#ifndef X86_WIN64
   /* We need to move the register-passed arguments for thiscall/fastcall
      on top of stack, so that those can be moved to registers ecx/edx by
      call-handler.  */
@@ -307,7 +309,7 @@
     {
       if (((*ptr)->alignment - 1) & cif->bytes)
         cif->bytes = ALIGN(cif->bytes, (*ptr)->alignment);
-      cif->bytes += ALIGN((*ptr)->size, FFI_SIZEOF_ARG);
+      cif->bytes += (unsigned)ALIGN((*ptr)->size, FFI_SIZEOF_ARG);
     }
 
 #ifdef X86_WIN64
@@ -315,7 +317,12 @@
   cif->bytes += 4 * sizeof(ffi_arg);
 #endif
 
-  cif->bytes = (cif->bytes + 15) & ~0xF;
+#ifndef X86_WIN32
+#ifndef X86_WIN64
+  if (cif->abi != FFI_STDCALL && cif->abi != FFI_THISCALL && cif->abi != FFI_FASTCALL)
+#endif
+    cif->bytes = (cif->bytes + 15) & ~0xF;
+#endif
 
   return FFI_OK;
 }
@@ -324,11 +331,10 @@
 extern int
 ffi_call_win64(void (*)(char *, extended_cif *), extended_cif *,
                unsigned, unsigned, unsigned *, void (*fn)(void));
-#elif defined(X86_WIN32)
+#else
 extern void
 ffi_call_win32(void (*)(char *, extended_cif *), extended_cif *,
                unsigned, unsigned, unsigned, unsigned *, void (*fn)(void));
-#else
 extern void ffi_call_SYSV(void (*)(char *, extended_cif *), extended_cif *,
                           unsigned, unsigned, unsigned *, void (*fn)(void));
 #endif
@@ -370,10 +376,17 @@
       ffi_call_win64(ffi_prep_args, &ecif, cif->bytes,
                      cif->flags, ecif.rvalue, fn);
       break;
-#elif defined(X86_WIN32)
+#else
+#ifndef X86_WIN32
     case FFI_SYSV:
-    case FFI_STDCALL:
+      ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, cif->flags, ecif.rvalue,
+                    fn);
+      break;
+#else
+    case FFI_SYSV:
     case FFI_MS_CDECL:
+#endif
+    case FFI_STDCALL:
       ffi_call_win32(ffi_prep_args, &ecif, cif->abi, cif->bytes, cif->flags,
 		     ecif.rvalue, fn);
       break;
@@ -406,11 +419,6 @@
                        ecif.rvalue, fn);
       }
       break;
-#else
-    case FFI_SYSV:
-      ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, cif->flags, ecif.rvalue,
-                    fn);
-      break;
 #endif
     default:
       FFI_ASSERT(0);
@@ -434,12 +442,15 @@
 #ifdef X86_WIN32
 void FFI_HIDDEN ffi_closure_raw_THISCALL (ffi_raw_closure *)
      __attribute__ ((regparm(1)));
+#endif
+#ifndef X86_WIN64
 void FFI_HIDDEN ffi_closure_STDCALL (ffi_closure *)
      __attribute__ ((regparm(1)));
 void FFI_HIDDEN ffi_closure_THISCALL (ffi_closure *)
      __attribute__ ((regparm(1)));
-#endif
-#ifdef X86_WIN64
+void FFI_HIDDEN ffi_closure_FASTCALL (ffi_closure *)
+     __attribute__ ((regparm(1)));
+#else
 void FFI_HIDDEN ffi_closure_win64 (ffi_closure *);
 #endif
 
@@ -598,7 +609,7 @@
    *(unsigned int*)  &__tramp[6] = __dis; /* jmp __fun  */ \
  }
 
-#define FFI_INIT_TRAMPOLINE_THISCALL(TRAMP,FUN,CTX,SIZE) \
+#define FFI_INIT_TRAMPOLINE_RAW_THISCALL(TRAMP,FUN,CTX,SIZE) \
 { unsigned char *__tramp = (unsigned char*)(TRAMP); \
    unsigned int  __fun = (unsigned int)(FUN); \
    unsigned int  __ctx = (unsigned int)(CTX); \
@@ -625,18 +636,15 @@
    *(unsigned short*)  &__tramp[50] = (__size + 8); /* ret (__size + 8)  */ \
  }
 
-#define FFI_INIT_TRAMPOLINE_STDCALL(TRAMP,FUN,CTX,SIZE)  \
+#define FFI_INIT_TRAMPOLINE_STDCALL(TRAMP,FUN,CTX)  \
 { unsigned char *__tramp = (unsigned char*)(TRAMP); \
    unsigned int  __fun = (unsigned int)(FUN); \
    unsigned int  __ctx = (unsigned int)(CTX); \
    unsigned int  __dis = __fun - (__ctx + 10); \
-   unsigned short __size = (unsigned short)(SIZE); \
    *(unsigned char*) &__tramp[0] = 0xb8; \
    *(unsigned int*)  &__tramp[1] = __ctx; /* movl __ctx, %eax */ \
    *(unsigned char *)  &__tramp[5] = 0xe8; \
    *(unsigned int*)  &__tramp[6] = __dis; /* call __fun  */ \
-   *(unsigned char *)  &__tramp[10] = 0xc2; \
-   *(unsigned short*)  &__tramp[11] = __size; /* ret __size  */ \
  }
 
 /* the cif must already be prep'ed */
@@ -666,20 +674,25 @@
                            &ffi_closure_SYSV,
                            (void*)codeloc);
     }
-#ifdef X86_WIN32
+  else if (cif->abi == FFI_FASTCALL)
+    {
+      FFI_INIT_TRAMPOLINE_STDCALL (&closure->tramp[0],
+				   &ffi_closure_FASTCALL,
+				   (void*)codeloc);
+    }
   else if (cif->abi == FFI_THISCALL)
     {
-      FFI_INIT_TRAMPOLINE_THISCALL (&closure->tramp[0],
-				    &ffi_closure_THISCALL,
-				    (void*)codeloc,
-				    cif->bytes);
+      FFI_INIT_TRAMPOLINE_STDCALL (&closure->tramp[0],
+				   &ffi_closure_THISCALL,
+				   (void*)codeloc);
     }
   else if (cif->abi == FFI_STDCALL)
     {
       FFI_INIT_TRAMPOLINE_STDCALL (&closure->tramp[0],
                                    &ffi_closure_STDCALL,
-                                   (void*)codeloc, cif->bytes);
+                                   (void*)codeloc);
     }
+#ifdef X86_WIN32
   else if (cif->abi == FFI_MS_CDECL)
     {
       FFI_INIT_TRAMPOLINE (&closure->tramp[0],
@@ -713,12 +726,12 @@
 {
   int i;
 
-  if (cif->abi != FFI_SYSV) {
+  if (cif->abi != FFI_SYSV
 #ifdef X86_WIN32
-    if (cif->abi != FFI_THISCALL)
+      && cif->abi != FFI_THISCALL
 #endif
+     )
     return FFI_BAD_ABI;
-  }
 
   /* we currently don't support certain kinds of arguments for raw
      closures.  This should be implemented by a separate assembly
@@ -741,8 +754,7 @@
     }
   else if (cif->abi == FFI_THISCALL)
     {
-      FFI_INIT_TRAMPOLINE_THISCALL (&closure->tramp[0], &ffi_closure_raw_THISCALL,
-				    codeloc, cif->bytes);
+      FFI_INIT_TRAMPOLINE_RAW_THISCALL (&closure->tramp[0], &ffi_closure_raw_THISCALL, codeloc, cif->bytes);
     }
 #endif
   closure->cif  = cif;
@@ -787,10 +799,17 @@
   
   switch (cif->abi) 
     {
-#ifdef X86_WIN32
+#ifndef X86_WIN32
     case FFI_SYSV:
-    case FFI_STDCALL:
+      ffi_call_SYSV(ffi_prep_args_raw, &ecif, cif->bytes, cif->flags,
+                    ecif.rvalue, fn);
+      break;
+#else
+    case FFI_SYSV:
     case FFI_MS_CDECL:
+#endif
+#ifndef X86_WIN64
+    case FFI_STDCALL:
       ffi_call_win32(ffi_prep_args_raw, &ecif, cif->abi, cif->bytes, cif->flags,
 		     ecif.rvalue, fn);
       break;
@@ -823,11 +842,6 @@
                        ecif.rvalue, fn);
       }
       break;
-#else
-    case FFI_SYSV:
-      ffi_call_SYSV(ffi_prep_args_raw, &ecif, cif->bytes, cif->flags,
-                    ecif.rvalue, fn);
-      break;
 #endif
     default:
       FFI_ASSERT(0);
diff --git a/Modules/_ctypes/libffi/src/x86/ffi64.c b/Modules/_ctypes/libffi/src/x86/ffi64.c
index 2014af2..5a5e043 100644
--- a/Modules/_ctypes/libffi/src/x86/ffi64.c
+++ b/Modules/_ctypes/libffi/src/x86/ffi64.c
@@ -3,8 +3,8 @@
              Copyright (c) 2011  Anthony Green
              Copyright (c) 2008, 2010  Red Hat, Inc.
              Copyright (c) 2002, 2007  Bo Thorsen <bo@suse.de>
-             
-   x86-64 Foreign Function Interface 
+
+   x86-64 Foreign Function Interface
 
    Permission is hereby granted, free of charge, to any person obtaining
    a copy of this software and associated documentation files (the
@@ -39,6 +39,7 @@
 #define MAX_SSE_REGS 8
 
 #if defined(__INTEL_COMPILER)
+#include "xmmintrin.h"
 #define UINT128 __m128
 #else
 #if defined(__SUNPRO_C)
@@ -60,7 +61,7 @@
 {
   /* Registers for argument passing.  */
   UINT64 gpr[MAX_GPR_REGS];
-  union big_int_union sse[MAX_SSE_REGS]; 
+  union big_int_union sse[MAX_SSE_REGS];
 };
 
 extern void ffi_call_unix64 (void *args, unsigned long bytes, unsigned flags,
@@ -151,7 +152,7 @@
 
    See the x86-64 PS ABI for details.
 */
-static int
+static size_t
 classify_argument (ffi_type *type, enum x86_64_reg_class classes[],
 		   size_t byte_offset)
 {
@@ -167,7 +168,7 @@
     case FFI_TYPE_SINT64:
     case FFI_TYPE_POINTER:
       {
-	int size = byte_offset + type->size;
+	size_t size = byte_offset + type->size;
 
 	if (size <= 4)
 	  {
@@ -202,15 +203,17 @@
     case FFI_TYPE_DOUBLE:
       classes[0] = X86_64_SSEDF_CLASS;
       return 1;
+#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
     case FFI_TYPE_LONGDOUBLE:
       classes[0] = X86_64_X87_CLASS;
       classes[1] = X86_64_X87UP_CLASS;
       return 2;
+#endif
     case FFI_TYPE_STRUCT:
       {
-	const int UNITS_PER_WORD = 8;
-	int words = (type->size + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
-	ffi_type **ptr; 
+	const size_t UNITS_PER_WORD = 8;
+	size_t words = (type->size + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
+	ffi_type **ptr;
 	int i;
 	enum x86_64_reg_class subclasses[MAX_CLASSES];
 
@@ -232,7 +235,7 @@
 	/* Merge the fields of structure.  */
 	for (ptr = type->elements; *ptr != NULL; ptr++)
 	  {
-	    int num;
+	    size_t num;
 
 	    byte_offset = ALIGN (byte_offset, (*ptr)->alignment);
 
@@ -241,7 +244,7 @@
 	      return 0;
 	    for (i = 0; i < num; i++)
 	      {
-		int pos = byte_offset / 8;
+		size_t pos = byte_offset / 8;
 		classes[i + pos] =
 		  merge_classes (subclasses[i], classes[i + pos]);
 	      }
@@ -305,11 +308,12 @@
    class.  Return zero iff parameter should be passed in memory, otherwise
    the number of registers.  */
 
-static int
+static size_t
 examine_argument (ffi_type *type, enum x86_64_reg_class classes[MAX_CLASSES],
 		  _Bool in_return, int *pngpr, int *pnsse)
 {
-  int i, n, ngpr, nsse;
+  size_t n;
+  int i, ngpr, nsse;
 
   n = classify_argument (type, classes, 0);
   if (n == 0)
@@ -350,9 +354,9 @@
 ffi_status
 ffi_prep_cif_machdep (ffi_cif *cif)
 {
-  int gprcount, ssecount, i, avn, n, ngpr, nsse, flags;
+  int gprcount, ssecount, i, avn, ngpr, nsse, flags;
   enum x86_64_reg_class classes[MAX_CLASSES];
-  size_t bytes;
+  size_t bytes, n;
 
   gprcount = ssecount = 0;
 
@@ -410,7 +414,7 @@
   if (ssecount)
     flags |= 1 << 11;
   cif->flags = flags;
-  cif->bytes = ALIGN (bytes, 8);
+  cif->bytes = (unsigned)ALIGN (bytes, 8);
 
   return FFI_OK;
 }
@@ -453,8 +457,7 @@
 
   for (i = 0; i < avn; ++i)
     {
-      size_t size = arg_types[i]->size;
-      int n;
+      size_t n, size = arg_types[i]->size;
 
       n = examine_argument (arg_types[i], classes, 0, &ngpr, &nsse);
       if (n == 0
@@ -583,7 +586,7 @@
   if (ret != FFI_TYPE_VOID)
     {
       enum x86_64_reg_class classes[MAX_CLASSES];
-      int n = examine_argument (cif->rtype, classes, 1, &ngpr, &nsse);
+      size_t n = examine_argument (cif->rtype, classes, 1, &ngpr, &nsse);
       if (n == 0)
 	{
 	  /* The return value goes in memory.  Arrange for the closure
@@ -606,11 +609,11 @@
 
   avn = cif->nargs;
   arg_types = cif->arg_types;
-  
+
   for (i = 0; i < avn; ++i)
     {
       enum x86_64_reg_class classes[MAX_CLASSES];
-      int n;
+      size_t n;
 
       n = examine_argument (arg_types[i], classes, 0, &ngpr, &nsse);
       if (n == 0
diff --git a/Modules/_ctypes/libffi/src/x86/ffitarget.h b/Modules/_ctypes/libffi/src/x86/ffitarget.h
index 46f294c..b2afe91 100644
--- a/Modules/_ctypes/libffi/src/x86/ffitarget.h
+++ b/Modules/_ctypes/libffi/src/x86/ffitarget.h
@@ -98,6 +98,9 @@
   /* ---- Intel x86 and AMD x86-64 - */
   FFI_SYSV,
   FFI_UNIX64,   /* Unix variants all use the same ABI for x86-64  */
+  FFI_THISCALL,
+  FFI_FASTCALL,
+  FFI_STDCALL,
   FFI_LAST_ABI,
 #if defined(__i386__) || defined(__i386)
   FFI_DEFAULT_ABI = FFI_SYSV
diff --git a/Modules/_ctypes/libffi/src/x86/freebsd.S b/Modules/_ctypes/libffi/src/x86/freebsd.S
index afde513..97e0b4e 100644
--- a/Modules/_ctypes/libffi/src/x86/freebsd.S
+++ b/Modules/_ctypes/libffi/src/x86/freebsd.S
@@ -49,6 +49,9 @@
 	movl  16(%ebp),%ecx
 	subl  %ecx,%esp
 
+	/* Align the stack pointer to 16-bytes */
+	andl  $0xfffffff0, %esp
+
 	movl  %esp,%eax
 
 	/* Place all of the ffi_prep_args in position  */
@@ -456,3 +459,5 @@
 #endif
 
 #endif /* ifndef __x86_64__ */
+
+	.section .note.GNU-stack,"",%progbits
diff --git a/Modules/_ctypes/libffi/src/x86/win32.S b/Modules/_ctypes/libffi/src/x86/win32.S
index 24b7bbd..daf0e79 100644
--- a/Modules/_ctypes/libffi/src/x86/win32.S
+++ b/Modules/_ctypes/libffi/src/x86/win32.S
@@ -33,8 +33,13 @@
 #include <fficonfig.h>
 #include <ffi.h>
 
+#define CIF_ABI_OFFSET 0
+#define CIF_BYTES_OFFSET 16
+
 #ifdef _MSC_VER
 
+#define CLOSURE_CIF_OFFSET ((FFI_TRAMPOLINE_SIZE + 3) AND NOT 3)
+
 .386
 .MODEL FLAT, C
 
@@ -188,14 +193,23 @@
         ret
 ffi_call_win32 ENDP
 
-ffi_closure_THISCALL PROC NEAR FORCEFRAME
-	sub	esp, 40
-	lea	edx, [ebp -24]
-	mov	[ebp - 12], edx	/* resp */
-	lea	edx, [ebp + 12]  /* account for stub return address on stack */
-	jmp	stub
+ffi_closure_THISCALL PROC NEAR
+	;; Insert the register argument on the stack as the first argument
+	xchg	DWORD PTR [esp+4], ecx
+	xchg	DWORD PTR [esp], ecx
+	push	ecx
+	jmp	ffi_closure_STDCALL
 ffi_closure_THISCALL ENDP
 
+ffi_closure_FASTCALL PROC NEAR
+	;; Insert the register argument on the stack as the first argument
+	xchg	DWORD PTR [esp+4], edx
+	xchg	DWORD PTR [esp], ecx
+	push	edx
+	push	ecx
+	jmp	ffi_closure_STDCALL
+ffi_closure_FASTCALL ENDP
+
 ffi_closure_SYSV PROC NEAR FORCEFRAME
     ;; the ffi_closure ctx is passed in eax by the trampoline.
 
@@ -464,8 +478,23 @@
         jmp   cd_epilogue
 
 cd_epilogue:
-        ;; Epilogue code is autogenerated.
-        ret
+        mov   esp, ebp
+        pop   ebp
+        pop   ecx
+        pop   edx
+        mov   ecx, DWORD PTR [ecx + (CLOSURE_CIF_OFFSET-10)]
+        add   esp, DWORD PTR [ecx + CIF_BYTES_OFFSET]
+        mov   ecx, DWORD PTR [ecx + CIF_ABI_OFFSET]
+        cmp   ecx, 3
+        je    cd_thiscall
+        cmp   ecx, 4
+        jne   cd_not_fastcall
+
+        add   esp, 4
+cd_thiscall:
+        add   esp, 4
+cd_not_fastcall:
+        jmp   edx
 ffi_closure_STDCALL ENDP
 
 _TEXT ENDS
@@ -473,15 +502,23 @@
 
 #else
 
+#define CLOSURE_CIF_OFFSET ((FFI_TRAMPOLINE_SIZE + 3) & ~3)
+
+#if defined(SYMBOL_UNDERSCORE)
+#define USCORE_SYMBOL(x) _##x
+#else
+#define USCORE_SYMBOL(x) x
+#endif
 	.text
  
         # This assumes we are using gas.
         .balign 16
-	.globl	_ffi_call_win32
-#ifndef __OS2__
+FFI_HIDDEN(ffi_call_win32)
+	.globl	USCORE_SYMBOL(ffi_call_win32)
+#if defined(X86_WIN32) && !defined(__OS2__)
 	.def	_ffi_call_win32;	.scl	2;	.type	32;	.endef
 #endif
-_ffi_call_win32:
+USCORE_SYMBOL(ffi_call_win32):
 .LFB1:
         pushl %ebp
 .LCFI0:
@@ -542,31 +579,32 @@
 	call	1f
 	# Do not insert anything here between the call and the jump table.
 .Lstore_table:
-	.long	.Lnoretval		/* FFI_TYPE_VOID */
-	.long	.Lretint		/* FFI_TYPE_INT */
-	.long	.Lretfloat		/* FFI_TYPE_FLOAT */
-	.long	.Lretdouble		/* FFI_TYPE_DOUBLE */
-	.long	.Lretlongdouble		/* FFI_TYPE_LONGDOUBLE */
-	.long	.Lretuint8		/* FFI_TYPE_UINT8 */
-	.long	.Lretsint8		/* FFI_TYPE_SINT8 */
-	.long	.Lretuint16		/* FFI_TYPE_UINT16 */
-	.long	.Lretsint16		/* FFI_TYPE_SINT16 */
-	.long	.Lretint		/* FFI_TYPE_UINT32 */
-	.long	.Lretint		/* FFI_TYPE_SINT32 */
-	.long	.Lretint64		/* FFI_TYPE_UINT64 */
-	.long	.Lretint64		/* FFI_TYPE_SINT64 */
-	.long	.Lretstruct		/* FFI_TYPE_STRUCT */
-	.long	.Lretint		/* FFI_TYPE_POINTER */
-	.long	.Lretstruct1b		/* FFI_TYPE_SMALL_STRUCT_1B */
-	.long	.Lretstruct2b		/* FFI_TYPE_SMALL_STRUCT_2B */
-	.long	.Lretstruct4b		/* FFI_TYPE_SMALL_STRUCT_4B */
-	.long	.Lretstruct		/* FFI_TYPE_MS_STRUCT */
+	.long	.Lnoretval-.Lstore_table	/* FFI_TYPE_VOID */
+	.long	.Lretint-.Lstore_table		/* FFI_TYPE_INT */
+	.long	.Lretfloat-.Lstore_table	/* FFI_TYPE_FLOAT */
+	.long	.Lretdouble-.Lstore_table	/* FFI_TYPE_DOUBLE */
+	.long	.Lretlongdouble-.Lstore_table	/* FFI_TYPE_LONGDOUBLE */
+	.long	.Lretuint8-.Lstore_table	/* FFI_TYPE_UINT8 */
+	.long	.Lretsint8-.Lstore_table	/* FFI_TYPE_SINT8 */
+	.long	.Lretuint16-.Lstore_table	/* FFI_TYPE_UINT16 */
+	.long	.Lretsint16-.Lstore_table	/* FFI_TYPE_SINT16 */
+	.long	.Lretint-.Lstore_table		/* FFI_TYPE_UINT32 */
+	.long	.Lretint-.Lstore_table		/* FFI_TYPE_SINT32 */
+	.long	.Lretint64-.Lstore_table	/* FFI_TYPE_UINT64 */
+	.long	.Lretint64-.Lstore_table	/* FFI_TYPE_SINT64 */
+	.long	.Lretstruct-.Lstore_table	/* FFI_TYPE_STRUCT */
+	.long	.Lretint-.Lstore_table		/* FFI_TYPE_POINTER */
+	.long	.Lretstruct1b-.Lstore_table	/* FFI_TYPE_SMALL_STRUCT_1B */
+	.long	.Lretstruct2b-.Lstore_table	/* FFI_TYPE_SMALL_STRUCT_2B */
+	.long	.Lretstruct4b-.Lstore_table	/* FFI_TYPE_SMALL_STRUCT_4B */
+	.long	.Lretstruct-.Lstore_table	/* FFI_TYPE_MS_STRUCT */
 1:
-	add	%ecx, %ecx
-	add	%ecx, %ecx
+	shl	$2, %ecx
+	add	(%esp),%ecx
+	mov	(%ecx),%ecx
 	add	(%esp),%ecx
 	add	$4, %esp
-	jmp	*(%ecx)
+	jmp	*%ecx
 
 	/* Sign/zero extend as appropriate.  */
 .Lretsint8:
@@ -644,27 +682,43 @@
         ret
 .ffi_call_win32_end:
         .balign 16
-	.globl	_ffi_closure_THISCALL
-#ifndef __OS2__
+FFI_HIDDEN(ffi_closure_THISCALL)
+	.globl	USCORE_SYMBOL(ffi_closure_THISCALL)
+#if defined(X86_WIN32) && !defined(__OS2__)
 	.def	_ffi_closure_THISCALL;	.scl	2;	.type	32;	.endef
 #endif
-_ffi_closure_THISCALL:
-	pushl	%ebp
-	movl	%esp, %ebp
-	subl	$40, %esp
-	leal	-24(%ebp), %edx
-	movl	%edx, -12(%ebp)	/* resp */
-	leal	12(%ebp), %edx  /* account for stub return address on stack */
-	jmp	.stub
+USCORE_SYMBOL(ffi_closure_THISCALL):
+	/* Insert the register argument on the stack as the first argument */
+	xchg	%ecx, 4(%esp)
+	xchg	%ecx, (%esp)
+	push	%ecx
+	jmp	.ffi_closure_STDCALL_internal
+
+        .balign 16
+FFI_HIDDEN(ffi_closure_FASTCALL)
+	.globl	USCORE_SYMBOL(ffi_closure_FASTCALL)
+#if defined(X86_WIN32) && !defined(__OS2__)
+	.def	_ffi_closure_FASTCALL;	.scl	2;	.type	32;	.endef
+#endif
+USCORE_SYMBOL(ffi_closure_FASTCALL):
+	/* Insert the register arguments on the stack as the first two arguments */
+	xchg	%edx, 4(%esp)
+	xchg	%ecx, (%esp)
+	push	%edx
+	push	%ecx
+	jmp	.ffi_closure_STDCALL_internal
 .LFE1:
 
         # This assumes we are using gas.
         .balign 16
-	.globl	_ffi_closure_SYSV
-#ifndef __OS2__
+FFI_HIDDEN(ffi_closure_SYSV)
+#if defined(X86_WIN32)
+	.globl	USCORE_SYMBOL(ffi_closure_SYSV)
+#if defined(X86_WIN32) && !defined(__OS2__)
 	.def	_ffi_closure_SYSV;	.scl	2;	.type	32;	.endef
 #endif
-_ffi_closure_SYSV:
+USCORE_SYMBOL(ffi_closure_SYSV):
+#endif
 .LFB3:
 	pushl	%ebp
 .LCFI4:
@@ -674,43 +728,54 @@
 	leal	-24(%ebp), %edx
 	movl	%edx, -12(%ebp)	/* resp */
 	leal	8(%ebp), %edx
-.stub:
 	movl	%edx, 4(%esp)	/* args = __builtin_dwarf_cfa () */
 	leal	-12(%ebp), %edx
 	movl	%edx, (%esp)	/* &resp */
-	call	_ffi_closure_SYSV_inner
+#if defined(HAVE_HIDDEN_VISIBILITY_ATTRIBUTE) || !defined(__PIC__)
+	call	USCORE_SYMBOL(ffi_closure_SYSV_inner)
+#elif defined(X86_DARWIN)
+	calll	L_ffi_closure_SYSV_inner$stub
+#else
+	movl	%ebx, 8(%esp)
+	call	1f
+1:	popl	%ebx
+	addl	$_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx
+	call	ffi_closure_SYSV_inner@PLT
+	movl	8(%esp), %ebx
+#endif
 	movl	-12(%ebp), %ecx
 
 0:
 	call	1f
 	# Do not insert anything here between the call and the jump table.
 .Lcls_store_table:
-	.long	.Lcls_noretval		/* FFI_TYPE_VOID */
-	.long	.Lcls_retint		/* FFI_TYPE_INT */
-	.long	.Lcls_retfloat		/* FFI_TYPE_FLOAT */
-	.long	.Lcls_retdouble		/* FFI_TYPE_DOUBLE */
-	.long	.Lcls_retldouble	/* FFI_TYPE_LONGDOUBLE */
-	.long	.Lcls_retuint8		/* FFI_TYPE_UINT8 */
-	.long	.Lcls_retsint8		/* FFI_TYPE_SINT8 */
-	.long	.Lcls_retuint16		/* FFI_TYPE_UINT16 */
-	.long	.Lcls_retsint16		/* FFI_TYPE_SINT16 */
-	.long	.Lcls_retint		/* FFI_TYPE_UINT32 */
-	.long	.Lcls_retint		/* FFI_TYPE_SINT32 */
-	.long	.Lcls_retllong		/* FFI_TYPE_UINT64 */
-	.long	.Lcls_retllong		/* FFI_TYPE_SINT64 */
-	.long	.Lcls_retstruct		/* FFI_TYPE_STRUCT */
-	.long	.Lcls_retint		/* FFI_TYPE_POINTER */
-	.long	.Lcls_retstruct1	/* FFI_TYPE_SMALL_STRUCT_1B */
-	.long	.Lcls_retstruct2	/* FFI_TYPE_SMALL_STRUCT_2B */
-	.long	.Lcls_retstruct4	/* FFI_TYPE_SMALL_STRUCT_4B */
-	.long	.Lcls_retmsstruct	/* FFI_TYPE_MS_STRUCT */
+	.long	.Lcls_noretval-.Lcls_store_table	/* FFI_TYPE_VOID */
+	.long	.Lcls_retint-.Lcls_store_table		/* FFI_TYPE_INT */
+	.long	.Lcls_retfloat-.Lcls_store_table	/* FFI_TYPE_FLOAT */
+	.long	.Lcls_retdouble-.Lcls_store_table	/* FFI_TYPE_DOUBLE */
+	.long	.Lcls_retldouble-.Lcls_store_table	/* FFI_TYPE_LONGDOUBLE */
+	.long	.Lcls_retuint8-.Lcls_store_table	/* FFI_TYPE_UINT8 */
+	.long	.Lcls_retsint8-.Lcls_store_table	/* FFI_TYPE_SINT8 */
+	.long	.Lcls_retuint16-.Lcls_store_table	/* FFI_TYPE_UINT16 */
+	.long	.Lcls_retsint16-.Lcls_store_table	/* FFI_TYPE_SINT16 */
+	.long	.Lcls_retint-.Lcls_store_table		/* FFI_TYPE_UINT32 */
+	.long	.Lcls_retint-.Lcls_store_table		/* FFI_TYPE_SINT32 */
+	.long	.Lcls_retllong-.Lcls_store_table	/* FFI_TYPE_UINT64 */
+	.long	.Lcls_retllong-.Lcls_store_table	/* FFI_TYPE_SINT64 */
+	.long	.Lcls_retstruct-.Lcls_store_table	/* FFI_TYPE_STRUCT */
+	.long	.Lcls_retint-.Lcls_store_table		/* FFI_TYPE_POINTER */
+	.long	.Lcls_retstruct1-.Lcls_store_table	/* FFI_TYPE_SMALL_STRUCT_1B */
+	.long	.Lcls_retstruct2-.Lcls_store_table	/* FFI_TYPE_SMALL_STRUCT_2B */
+	.long	.Lcls_retstruct4-.Lcls_store_table	/* FFI_TYPE_SMALL_STRUCT_4B */
+	.long	.Lcls_retmsstruct-.Lcls_store_table	/* FFI_TYPE_MS_STRUCT */
 
 1:
-	add	%eax, %eax
-	add	%eax, %eax
+	shl	$2, %eax
+	add	(%esp),%eax
+	mov	(%eax),%eax
 	add	(%esp),%eax
 	add	$4, %esp
-	jmp	*(%eax)
+	jmp	*%eax
 
 	/* Sign/zero extend as appropriate.  */
 .Lcls_retsint8:
@@ -788,12 +853,15 @@
 #define RAW_CLOSURE_FUN_OFFSET (RAW_CLOSURE_CIF_OFFSET + 4)
 #define RAW_CLOSURE_USER_DATA_OFFSET (RAW_CLOSURE_FUN_OFFSET + 4)
 #define CIF_FLAGS_OFFSET 20
+
+#ifdef X86_WIN32
         .balign 16
-	.globl	_ffi_closure_raw_THISCALL
-#ifndef __OS2__
+FFI_HIDDEN(ffi_closure_raw_THISCALL)
+	.globl	USCORE_SYMBOL(ffi_closure_raw_THISCALL)
+#if defined(X86_WIN32) && !defined(__OS2__)
 	.def	_ffi_closure_raw_THISCALL;	.scl	2;	.type	32;	.endef
 #endif
-_ffi_closure_raw_THISCALL:
+USCORE_SYMBOL(ffi_closure_raw_THISCALL):
 	pushl	%ebp
 	movl	%esp, %ebp
 	pushl	%esi
@@ -803,13 +871,17 @@
 	movl	%edx, 12(%esp)	/* user_data */
 	leal	12(%ebp), %edx	/* __builtin_dwarf_cfa () */
 	jmp	.stubraw
+#endif /* X86_WIN32 */
+
         # This assumes we are using gas.
         .balign 16
-	.globl	_ffi_closure_raw_SYSV
-#ifndef __OS2__
+#if defined(X86_WIN32)
+	.globl	USCORE_SYMBOL(ffi_closure_raw_SYSV)
+#if defined(X86_WIN32) && !defined(__OS2__)
 	.def	_ffi_closure_raw_SYSV;	.scl	2;	.type	32;	.endef
 #endif
-_ffi_closure_raw_SYSV:
+USCORE_SYMBOL(ffi_closure_raw_SYSV):
+#endif /* defined(X86_WIN32) */
 .LFB4:
 	pushl	%ebp
 .LCFI6:
@@ -833,31 +905,32 @@
 	call	1f
 	# Do not insert anything here between the call and the jump table.
 .Lrcls_store_table:
-	.long	.Lrcls_noretval		/* FFI_TYPE_VOID */
-	.long	.Lrcls_retint		/* FFI_TYPE_INT */
-	.long	.Lrcls_retfloat		/* FFI_TYPE_FLOAT */
-	.long	.Lrcls_retdouble	/* FFI_TYPE_DOUBLE */
-	.long	.Lrcls_retldouble	/* FFI_TYPE_LONGDOUBLE */
-	.long	.Lrcls_retuint8		/* FFI_TYPE_UINT8 */
-	.long	.Lrcls_retsint8		/* FFI_TYPE_SINT8 */
-	.long	.Lrcls_retuint16	/* FFI_TYPE_UINT16 */
-	.long	.Lrcls_retsint16	/* FFI_TYPE_SINT16 */
-	.long	.Lrcls_retint		/* FFI_TYPE_UINT32 */
-	.long	.Lrcls_retint		/* FFI_TYPE_SINT32 */
-	.long	.Lrcls_retllong		/* FFI_TYPE_UINT64 */
-	.long	.Lrcls_retllong		/* FFI_TYPE_SINT64 */
-	.long	.Lrcls_retstruct	/* FFI_TYPE_STRUCT */
-	.long	.Lrcls_retint		/* FFI_TYPE_POINTER */
-	.long	.Lrcls_retstruct1	/* FFI_TYPE_SMALL_STRUCT_1B */
-	.long	.Lrcls_retstruct2	/* FFI_TYPE_SMALL_STRUCT_2B */
-	.long	.Lrcls_retstruct4	/* FFI_TYPE_SMALL_STRUCT_4B */
-	.long	.Lrcls_retstruct	/* FFI_TYPE_MS_STRUCT */
+	.long	.Lrcls_noretval-.Lrcls_store_table	/* FFI_TYPE_VOID */
+	.long	.Lrcls_retint-.Lrcls_store_table	/* FFI_TYPE_INT */
+	.long	.Lrcls_retfloat-.Lrcls_store_table	/* FFI_TYPE_FLOAT */
+	.long	.Lrcls_retdouble-.Lrcls_store_table	/* FFI_TYPE_DOUBLE */
+	.long	.Lrcls_retldouble-.Lrcls_store_table	/* FFI_TYPE_LONGDOUBLE */
+	.long	.Lrcls_retuint8-.Lrcls_store_table	/* FFI_TYPE_UINT8 */
+	.long	.Lrcls_retsint8-.Lrcls_store_table	/* FFI_TYPE_SINT8 */
+	.long	.Lrcls_retuint16-.Lrcls_store_table	/* FFI_TYPE_UINT16 */
+	.long	.Lrcls_retsint16-.Lrcls_store_table	/* FFI_TYPE_SINT16 */
+	.long	.Lrcls_retint-.Lrcls_store_table	/* FFI_TYPE_UINT32 */
+	.long	.Lrcls_retint-.Lrcls_store_table	/* FFI_TYPE_SINT32 */
+	.long	.Lrcls_retllong-.Lrcls_store_table	/* FFI_TYPE_UINT64 */
+	.long	.Lrcls_retllong-.Lrcls_store_table	/* FFI_TYPE_SINT64 */
+	.long	.Lrcls_retstruct-.Lrcls_store_table	/* FFI_TYPE_STRUCT */
+	.long	.Lrcls_retint-.Lrcls_store_table	/* FFI_TYPE_POINTER */
+	.long	.Lrcls_retstruct1-.Lrcls_store_table	/* FFI_TYPE_SMALL_STRUCT_1B */
+	.long	.Lrcls_retstruct2-.Lrcls_store_table	/* FFI_TYPE_SMALL_STRUCT_2B */
+	.long	.Lrcls_retstruct4-.Lrcls_store_table	/* FFI_TYPE_SMALL_STRUCT_4B */
+	.long	.Lrcls_retstruct-.Lrcls_store_table	/* FFI_TYPE_MS_STRUCT */
 1:
-	add	%eax, %eax
-	add	%eax, %eax
+	shl	$2, %eax
+	add	(%esp),%eax
+	mov	(%eax),%eax
 	add	(%esp),%eax
 	add	$4, %esp
-	jmp	*(%eax)
+	jmp	*%eax
 
 	/* Sign/zero extend as appropriate.  */
 .Lrcls_retsint8:
@@ -925,11 +998,13 @@
 
         # This assumes we are using gas.
 	.balign	16
-	.globl	_ffi_closure_STDCALL
-#ifndef __OS2__
+FFI_HIDDEN(ffi_closure_STDCALL)
+	.globl	USCORE_SYMBOL(ffi_closure_STDCALL)
+#if defined(X86_WIN32) && !defined(__OS2__)
 	.def	_ffi_closure_STDCALL;	.scl	2;	.type	32;	.endef
 #endif
-_ffi_closure_STDCALL:
+USCORE_SYMBOL(ffi_closure_STDCALL):
+.ffi_closure_STDCALL_internal:
 .LFB5:
 	pushl	%ebp
 .LCFI9:
@@ -942,36 +1017,48 @@
 	movl	%edx, 4(%esp)	/* args */
 	leal	-12(%ebp), %edx
 	movl	%edx, (%esp)	/* &resp */
-	call	_ffi_closure_SYSV_inner
+#if defined(HAVE_HIDDEN_VISIBILITY_ATTRIBUTE) || !defined(__PIC__)
+	call	USCORE_SYMBOL(ffi_closure_SYSV_inner)
+#elif defined(X86_DARWIN)
+	calll	L_ffi_closure_SYSV_inner$stub
+#else
+	movl	%ebx, 8(%esp)
+	call	1f
+1:	popl	%ebx
+	addl	$_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx
+	call	ffi_closure_SYSV_inner@PLT
+	movl	8(%esp), %ebx
+#endif
 	movl	-12(%ebp), %ecx
 0:
 	call	1f
 	# Do not insert anything here between the call and the jump table.
 .Lscls_store_table:
-	.long	.Lscls_noretval		/* FFI_TYPE_VOID */
-	.long	.Lscls_retint		/* FFI_TYPE_INT */
-	.long	.Lscls_retfloat		/* FFI_TYPE_FLOAT */
-	.long	.Lscls_retdouble	/* FFI_TYPE_DOUBLE */
-	.long	.Lscls_retldouble	/* FFI_TYPE_LONGDOUBLE */
-	.long	.Lscls_retuint8		/* FFI_TYPE_UINT8 */
-	.long	.Lscls_retsint8		/* FFI_TYPE_SINT8 */
-	.long	.Lscls_retuint16	/* FFI_TYPE_UINT16 */
-	.long	.Lscls_retsint16	/* FFI_TYPE_SINT16 */
-	.long	.Lscls_retint		/* FFI_TYPE_UINT32 */
-	.long	.Lscls_retint		/* FFI_TYPE_SINT32 */
-	.long	.Lscls_retllong		/* FFI_TYPE_UINT64 */
-	.long	.Lscls_retllong		/* FFI_TYPE_SINT64 */
-	.long	.Lscls_retstruct	/* FFI_TYPE_STRUCT */
-	.long	.Lscls_retint		/* FFI_TYPE_POINTER */
-	.long	.Lscls_retstruct1	/* FFI_TYPE_SMALL_STRUCT_1B */
-	.long	.Lscls_retstruct2	/* FFI_TYPE_SMALL_STRUCT_2B */
-	.long	.Lscls_retstruct4	/* FFI_TYPE_SMALL_STRUCT_4B */
+	.long	.Lscls_noretval-.Lscls_store_table	/* FFI_TYPE_VOID */
+	.long	.Lscls_retint-.Lscls_store_table	/* FFI_TYPE_INT */
+	.long	.Lscls_retfloat-.Lscls_store_table	/* FFI_TYPE_FLOAT */
+	.long	.Lscls_retdouble-.Lscls_store_table	/* FFI_TYPE_DOUBLE */
+	.long	.Lscls_retldouble-.Lscls_store_table	/* FFI_TYPE_LONGDOUBLE */
+	.long	.Lscls_retuint8-.Lscls_store_table	/* FFI_TYPE_UINT8 */
+	.long	.Lscls_retsint8-.Lscls_store_table	/* FFI_TYPE_SINT8 */
+	.long	.Lscls_retuint16-.Lscls_store_table	/* FFI_TYPE_UINT16 */
+	.long	.Lscls_retsint16-.Lscls_store_table	/* FFI_TYPE_SINT16 */
+	.long	.Lscls_retint-.Lscls_store_table	/* FFI_TYPE_UINT32 */
+	.long	.Lscls_retint-.Lscls_store_table	/* FFI_TYPE_SINT32 */
+	.long	.Lscls_retllong-.Lscls_store_table	/* FFI_TYPE_UINT64 */
+	.long	.Lscls_retllong-.Lscls_store_table	/* FFI_TYPE_SINT64 */
+	.long	.Lscls_retstruct-.Lscls_store_table	/* FFI_TYPE_STRUCT */
+	.long	.Lscls_retint-.Lscls_store_table	/* FFI_TYPE_POINTER */
+	.long	.Lscls_retstruct1-.Lscls_store_table	/* FFI_TYPE_SMALL_STRUCT_1B */
+	.long	.Lscls_retstruct2-.Lscls_store_table	/* FFI_TYPE_SMALL_STRUCT_2B */
+	.long	.Lscls_retstruct4-.Lscls_store_table	/* FFI_TYPE_SMALL_STRUCT_4B */
 1:
-	add	%eax, %eax
-	add	%eax, %eax
+	shl	$2, %eax
+	add	(%esp),%eax
+	mov	(%eax),%eax
 	add	(%esp),%eax
 	add	$4, %esp
-	jmp	*(%eax)
+	jmp	*%eax
 
 	/* Sign/zero extend as appropriate.  */
 .Lscls_retsint8:
@@ -1030,11 +1117,30 @@
 .Lscls_epilogue:
 	movl	%ebp, %esp
 	popl	%ebp
-	ret
+	popl	%ecx
+	popl	%edx
+	movl	(CLOSURE_CIF_OFFSET-10)(%ecx), %ecx
+	addl	CIF_BYTES_OFFSET(%ecx), %esp
+	movl	CIF_ABI_OFFSET(%ecx), %ecx
+	cmpl	$3, %ecx /* FFI_THISCALL */
+	je	1f
+	cmpl	$4, %ecx /* FFI_FASTCALL */
+	jne	2f
+
+	addl	$4, %esp
+1:	addl	$4, %esp
+2:	jmp	*%edx
 .ffi_closure_STDCALL_end:
 .LFE5:
 
-#ifndef __OS2__
+#if defined(X86_DARWIN)
+.section __IMPORT,__jump_table,symbol_stubs,self_modifying_code+pure_instructions,5
+L_ffi_closure_SYSV_inner$stub:
+	.indirect_symbol _ffi_closure_SYSV_inner
+	hlt ; hlt ; hlt ; hlt ; hlt
+#endif
+
+#if defined(X86_WIN32) && !defined(__OS2__)
 	.section	.eh_frame,"w"
 #endif
 .Lframe1:
@@ -1094,7 +1200,6 @@
 	.align 4
 .LEFDE1:
 
-
 .LSFDE3:
 	.long	.LEFDE3-.LASFDE3	/* FDE Length */
 .LASFDE3:
diff --git a/Modules/_ctypes/libffi/stamp-h.in b/Modules/_ctypes/libffi/stamp-h.in
deleted file mode 100644
index 9788f70..0000000
--- a/Modules/_ctypes/libffi/stamp-h.in
+++ /dev/null
@@ -1 +0,0 @@
-timestamp
diff --git a/Modules/_ctypes/libffi/testsuite/Makefile.am b/Modules/_ctypes/libffi/testsuite/Makefile.am
index edc6e61..da10465 100644
--- a/Modules/_ctypes/libffi/testsuite/Makefile.am
+++ b/Modules/_ctypes/libffi/testsuite/Makefile.am
@@ -2,17 +2,6 @@
 
 AUTOMAKE_OPTIONS = foreign dejagnu
 
-# Setup the testing framework, if you have one
-EXPECT = `if [ -f $(top_builddir)/../expect/expect ] ; then \
-            echo $(top_builddir)/../expect/expect ; \
-          else echo expect ; fi`
-
-RUNTEST = `if [ -f $(top_srcdir)/../dejagnu/runtest ] ; then \
-	       echo $(top_srcdir)/../dejagnu/runtest ; \
-	    else echo runtest; fi`
-
-AM_RUNTESTFLAGS =
-
 EXTRA_DEJAGNU_SITE_CONFIG=../local.exp
 
 CLEANFILES = *.exe core* *.log *.sum
@@ -20,7 +9,7 @@
 EXTRA_DIST = config/default.exp libffi.call/cls_19byte.c		\
 libffi.call/cls_align_longdouble_split.c				\
 libffi.call/closure_loc_fn0.c libffi.call/cls_schar.c			\
-libffi.call/closure_fn1.c libffi.call/many2_win32.c			\
+libffi.call/closure_fn1.c \
 libffi.call/return_ul.c libffi.call/cls_align_double.c			\
 libffi.call/return_fl2.c libffi.call/cls_1_1byte.c			\
 libffi.call/cls_64byte.c libffi.call/nested_struct7.c			\
@@ -30,7 +19,7 @@
 libffi.call/cls_3byte1.c libffi.call/cls_16byte.c			\
 libffi.call/struct8.c libffi.call/nested_struct8.c			\
 libffi.call/cls_multi_sshort.c libffi.call/cls_3byte2.c			\
-libffi.call/fastthis2_win32.c libffi.call/cls_pointer.c			\
+libffi.call/cls_pointer.c			\
 libffi.call/err_bad_typedef.c libffi.call/cls_4_1byte.c			\
 libffi.call/cls_9byte2.c libffi.call/cls_multi_schar.c			\
 libffi.call/stret_medium2.c libffi.call/cls_5_1_byte.c			\
@@ -46,16 +35,16 @@
 libffi.call/return_fl3.c libffi.call/stret_medium.c			\
 libffi.call/nested_struct6.c libffi.call/closure_fn3.c			\
 libffi.call/float3.c libffi.call/many2.c				\
-libffi.call/closure_stdcall.c libffi.call/cls_align_uint16.c		\
+libffi.call/closure_simple.c libffi.call/cls_align_uint16.c		\
 libffi.call/cls_9byte1.c libffi.call/closure_fn6.c			\
 libffi.call/cls_double_va.c libffi.call/cls_align_pointer.c		\
 libffi.call/cls_align_longdouble.c libffi.call/closure_fn2.c		\
-libffi.call/cls_sshort.c libffi.call/many_win32.c			\
+libffi.call/cls_sshort.c \
 libffi.call/nested_struct.c libffi.call/cls_20byte.c			\
 libffi.call/cls_longdouble.c libffi.call/cls_multi_uchar.c		\
-libffi.call/return_uc.c libffi.call/closure_thiscall.c			\
+libffi.call/return_uc.c \
 libffi.call/cls_18byte.c libffi.call/cls_8byte.c			\
-libffi.call/promotion.c libffi.call/struct1_win32.c			\
+libffi.call/promotion.c \
 libffi.call/return_dbl.c libffi.call/cls_24byte.c			\
 libffi.call/struct4.c libffi.call/cls_6byte.c				\
 libffi.call/cls_align_uint32.c libffi.call/float.c			\
@@ -63,7 +52,7 @@
 libffi.call/return_dbl1.c libffi.call/cls_3_1byte.c			\
 libffi.call/cls_align_float.c libffi.call/return_fl1.c			\
 libffi.call/nested_struct10.c libffi.call/nested_struct5.c		\
-libffi.call/fastthis1_win32.c libffi.call/cls_align_sint64.c		\
+libffi.call/cls_align_sint64.c		\
 libffi.call/stret_large2.c libffi.call/return_sl.c			\
 libffi.call/closure_fn0.c libffi.call/cls_5byte.c			\
 libffi.call/cls_2byte.c libffi.call/float2.c				\
@@ -75,20 +64,22 @@
 libffi.call/pyobjc-tc.c libffi.call/cls_multi_ushortchar.c		\
 libffi.call/struct1.c libffi.call/nested_struct9.c			\
 libffi.call/huge_struct.c libffi.call/problem1.c			\
-libffi.call/float4.c libffi.call/fastthis3_win32.c			\
-libffi.call/return_ldl.c libffi.call/strlen2_win32.c			\
-libffi.call/closure_fn5.c libffi.call/struct2_win32.c			\
+libffi.call/float4.c \
+libffi.call/return_ldl.c \
+libffi.call/closure_fn5.c \
 libffi.call/struct6.c libffi.call/return_ll.c libffi.call/struct9.c	\
 libffi.call/return_sc.c libffi.call/struct7.c				\
 libffi.call/cls_align_uint64.c libffi.call/cls_4byte.c			\
-libffi.call/strlen_win32.c libffi.call/cls_6_1_byte.c			\
-libffi.call/cls_7_1_byte.c libffi.special/unwindtest.cc			\
-libffi.special/special.exp libffi.special/unwindtest_ffi_call.cc	\
-libffi.special/ffitestcxx.h lib/wrapper.exp lib/target-libpath.exp	\
+libffi.call/cls_6_1_byte.c			\
+libffi.call/cls_7_1_byte.c libffi.call/unwindtest.cc			\
+libffi.call/unwindtest_ffi_call.cc	\
+lib/wrapper.exp lib/target-libpath.exp	\
 lib/libffi.exp libffi.call/cls_struct_va1.c				\
 libffi.call/cls_uchar_va.c libffi.call/cls_uint_va.c			\
 libffi.call/cls_ulong_va.c libffi.call/cls_ushort_va.c			\
 libffi.call/nested_struct11.c libffi.call/uninitialized.c		\
 libffi.call/va_1.c libffi.call/va_struct1.c libffi.call/va_struct2.c	\
-libffi.call/va_struct3.c
-
+libffi.call/va_struct3.c \
+libffi.call/strlen2.c \
+libffi.call/strlen3.c \
+libffi.call/strlen4.c
diff --git a/Modules/_ctypes/libffi/testsuite/Makefile.in b/Modules/_ctypes/libffi/testsuite/Makefile.in
index a3ba066..99e226c 100644
--- a/Modules/_ctypes/libffi/testsuite/Makefile.in
+++ b/Modules/_ctypes/libffi/testsuite/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.12.2 from Makefile.am.
+# Makefile.in generated by automake 1.13.4 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,23 +14,51 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \	]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -51,7 +79,7 @@
 host_triplet = @host@
 target_triplet = @target@
 subdir = testsuite
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/asmcfi.m4 \
 	$(top_srcdir)/m4/ax_append_flag.m4 \
@@ -73,6 +101,18 @@
 CONFIG_HEADER = $(top_builddir)/fficonfig.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 SOURCES =
 DIST_SOURCES =
 am__can_run_installinfo = \
@@ -80,14 +120,18 @@
     n|no|NO) false;; \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
 DEJATOOL = $(PACKAGE)
 RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir
+EXPECT = expect
+RUNTEST = runtest
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AM_LTLDFLAGS = @AM_LTLDFLAGS@
-AM_RUNTESTFLAGS = 
+AM_RUNTESTFLAGS = @AM_RUNTESTFLAGS@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -101,6 +145,10 @@
 CFLAGS = @CFLAGS@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -116,6 +164,7 @@
 FGREP = @FGREP@
 GREP = @GREP@
 HAVE_LONG_DOUBLE = @HAVE_LONG_DOUBLE@
+HAVE_LONG_DOUBLE_VARIANT = @HAVE_LONG_DOUBLE_VARIANT@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -162,6 +211,7 @@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
@@ -217,22 +267,12 @@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 AUTOMAKE_OPTIONS = foreign dejagnu
-
-# Setup the testing framework, if you have one
-EXPECT = `if [ -f $(top_builddir)/../expect/expect ] ; then \
-            echo $(top_builddir)/../expect/expect ; \
-          else echo expect ; fi`
-
-RUNTEST = `if [ -f $(top_srcdir)/../dejagnu/runtest ] ; then \
-	       echo $(top_srcdir)/../dejagnu/runtest ; \
-	    else echo runtest; fi`
-
 EXTRA_DEJAGNU_SITE_CONFIG = ../local.exp
 CLEANFILES = *.exe core* *.log *.sum
 EXTRA_DIST = config/default.exp libffi.call/cls_19byte.c		\
 libffi.call/cls_align_longdouble_split.c				\
 libffi.call/closure_loc_fn0.c libffi.call/cls_schar.c			\
-libffi.call/closure_fn1.c libffi.call/many2_win32.c			\
+libffi.call/closure_fn1.c \
 libffi.call/return_ul.c libffi.call/cls_align_double.c			\
 libffi.call/return_fl2.c libffi.call/cls_1_1byte.c			\
 libffi.call/cls_64byte.c libffi.call/nested_struct7.c			\
@@ -242,7 +282,7 @@
 libffi.call/cls_3byte1.c libffi.call/cls_16byte.c			\
 libffi.call/struct8.c libffi.call/nested_struct8.c			\
 libffi.call/cls_multi_sshort.c libffi.call/cls_3byte2.c			\
-libffi.call/fastthis2_win32.c libffi.call/cls_pointer.c			\
+libffi.call/cls_pointer.c			\
 libffi.call/err_bad_typedef.c libffi.call/cls_4_1byte.c			\
 libffi.call/cls_9byte2.c libffi.call/cls_multi_schar.c			\
 libffi.call/stret_medium2.c libffi.call/cls_5_1_byte.c			\
@@ -258,16 +298,16 @@
 libffi.call/return_fl3.c libffi.call/stret_medium.c			\
 libffi.call/nested_struct6.c libffi.call/closure_fn3.c			\
 libffi.call/float3.c libffi.call/many2.c				\
-libffi.call/closure_stdcall.c libffi.call/cls_align_uint16.c		\
+libffi.call/closure_simple.c libffi.call/cls_align_uint16.c		\
 libffi.call/cls_9byte1.c libffi.call/closure_fn6.c			\
 libffi.call/cls_double_va.c libffi.call/cls_align_pointer.c		\
 libffi.call/cls_align_longdouble.c libffi.call/closure_fn2.c		\
-libffi.call/cls_sshort.c libffi.call/many_win32.c			\
+libffi.call/cls_sshort.c \
 libffi.call/nested_struct.c libffi.call/cls_20byte.c			\
 libffi.call/cls_longdouble.c libffi.call/cls_multi_uchar.c		\
-libffi.call/return_uc.c libffi.call/closure_thiscall.c			\
+libffi.call/return_uc.c \
 libffi.call/cls_18byte.c libffi.call/cls_8byte.c			\
-libffi.call/promotion.c libffi.call/struct1_win32.c			\
+libffi.call/promotion.c \
 libffi.call/return_dbl.c libffi.call/cls_24byte.c			\
 libffi.call/struct4.c libffi.call/cls_6byte.c				\
 libffi.call/cls_align_uint32.c libffi.call/float.c			\
@@ -275,7 +315,7 @@
 libffi.call/return_dbl1.c libffi.call/cls_3_1byte.c			\
 libffi.call/cls_align_float.c libffi.call/return_fl1.c			\
 libffi.call/nested_struct10.c libffi.call/nested_struct5.c		\
-libffi.call/fastthis1_win32.c libffi.call/cls_align_sint64.c		\
+libffi.call/cls_align_sint64.c		\
 libffi.call/stret_large2.c libffi.call/return_sl.c			\
 libffi.call/closure_fn0.c libffi.call/cls_5byte.c			\
 libffi.call/cls_2byte.c libffi.call/float2.c				\
@@ -287,22 +327,25 @@
 libffi.call/pyobjc-tc.c libffi.call/cls_multi_ushortchar.c		\
 libffi.call/struct1.c libffi.call/nested_struct9.c			\
 libffi.call/huge_struct.c libffi.call/problem1.c			\
-libffi.call/float4.c libffi.call/fastthis3_win32.c			\
-libffi.call/return_ldl.c libffi.call/strlen2_win32.c			\
-libffi.call/closure_fn5.c libffi.call/struct2_win32.c			\
+libffi.call/float4.c \
+libffi.call/return_ldl.c \
+libffi.call/closure_fn5.c \
 libffi.call/struct6.c libffi.call/return_ll.c libffi.call/struct9.c	\
 libffi.call/return_sc.c libffi.call/struct7.c				\
 libffi.call/cls_align_uint64.c libffi.call/cls_4byte.c			\
-libffi.call/strlen_win32.c libffi.call/cls_6_1_byte.c			\
-libffi.call/cls_7_1_byte.c libffi.special/unwindtest.cc			\
-libffi.special/special.exp libffi.special/unwindtest_ffi_call.cc	\
-libffi.special/ffitestcxx.h lib/wrapper.exp lib/target-libpath.exp	\
+libffi.call/cls_6_1_byte.c			\
+libffi.call/cls_7_1_byte.c libffi.call/unwindtest.cc			\
+libffi.call/unwindtest_ffi_call.cc	\
+lib/wrapper.exp lib/target-libpath.exp	\
 lib/libffi.exp libffi.call/cls_struct_va1.c				\
 libffi.call/cls_uchar_va.c libffi.call/cls_uint_va.c			\
 libffi.call/cls_ulong_va.c libffi.call/cls_ushort_va.c			\
 libffi.call/nested_struct11.c libffi.call/uninitialized.c		\
 libffi.call/va_1.c libffi.call/va_struct1.c libffi.call/va_struct2.c	\
-libffi.call/va_struct3.c
+libffi.call/va_struct3.c \
+libffi.call/strlen2.c \
+libffi.call/strlen3.c \
+libffi.call/strlen4.c
 
 all: all-am
 
@@ -343,11 +386,9 @@
 
 clean-libtool:
 	-rm -rf .libs _libs
-tags: TAGS
-TAGS:
+tags TAGS:
 
-ctags: CTAGS
-CTAGS:
+ctags CTAGS:
 
 cscope cscopelist:
 
@@ -355,13 +396,12 @@
 check-DEJAGNU: site.exp
 	srcdir='$(srcdir)'; export srcdir; \
 	EXPECT=$(EXPECT); export EXPECT; \
-	runtest=$(RUNTEST); \
-	if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
+	if $(SHELL) -c "$(RUNTEST) --version" > /dev/null 2>&1; then \
 	  exit_status=0; l='$(DEJATOOL)'; for tool in $$l; do \
-	    if $$runtest $(AM_RUNTESTFLAGS) $(RUNTESTDEFAULTFLAGS) $(RUNTESTFLAGS); \
+	    if $(RUNTEST) $(AM_RUNTESTFLAGS) $(RUNTESTDEFAULTFLAGS) $(RUNTESTFLAGS); \
 	    then :; else exit_status=1; fi; \
 	  done; \
-	else echo "WARNING: could not find 'runtest'" 1>&2; :;\
+	else echo "WARNING: could not find '$(RUNTEST)'" 1>&2; :;\
 	fi; \
 	exit $$exit_status
 site.exp: Makefile $(EXTRA_DEJAGNU_SITE_CONFIG)
@@ -532,16 +572,17 @@
 .MAKE: check-am install-am install-strip
 
 .PHONY: all all-am check check-DEJAGNU check-am clean clean-generic \
-	clean-libtool distclean distclean-DEJAGNU distclean-generic \
-	distclean-libtool distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-ps install-ps-am \
-	install-strip installcheck installcheck-am installdirs \
-	maintainer-clean maintainer-clean-generic mostlyclean \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	uninstall uninstall-am
+	clean-libtool cscopelist-am ctags-am distclean \
+	distclean-DEJAGNU distclean-generic distclean-libtool distdir \
+	dvi dvi-am html html-am info info-am install install-am \
+	install-data install-data-am install-dvi install-dvi-am \
+	install-exec install-exec-am install-html install-html-am \
+	install-info install-info-am install-man install-pdf \
+	install-pdf-am install-ps install-ps-am install-strip \
+	installcheck installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
+	uninstall-am
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/Modules/_ctypes/libffi/testsuite/lib/libffi.exp b/Modules/_ctypes/libffi/testsuite/lib/libffi.exp
index 1ac2c36..dbdd1a2 100644
--- a/Modules/_ctypes/libffi/testsuite/lib/libffi.exp
+++ b/Modules/_ctypes/libffi/testsuite/lib/libffi.exp
@@ -222,6 +222,10 @@
 	lappend options "libs= -lpthread"
     }
 
+    if { [string match "*.cc" $source] } {
+	lappend options "c++"
+    }
+
     verbose "options: $options"
     return [target_compile $source $dest $type $options]
 }
@@ -273,6 +277,46 @@
     }
 }
 
+proc run-many-tests { testcases extra_flags } {
+    global using_gcc
+    if { [string match $using_gcc "yes"] } {
+        set common "-W -Wall"
+        set optimizations { "-O0" "-O2" "-O3" "-Os" "-O2 -fomit-frame-pointer" }
+    } else {
+        # Assume we are using the vendor compiler.
+        set common ""
+        set optimizations { "" }
+    }
+
+    set targetabis { "" }
+    if [string match $using_gcc "yes"] {
+        if [istarget "i?86-*-*"] {
+            set targetabis {
+                ""
+                "-DABI_NUM=FFI_STDCALL -DABI_ATTR=__STDCALL__"
+                "-DABI_NUM=FFI_THISCALL -DABI_ATTR=__THISCALL__"
+                "-DABI_NUM=FFI_FASTCALL -DABI_ATTR=__FASTCALL__"
+            }
+        }
+    }
+
+    set common [ concat $common $extra_flags ]
+    foreach test $testcases {
+        set testname [file tail $test]
+        if [search_for $test "ABI_NUM"] {
+            set abis $targetabis
+        } else {
+            set abis { "" }
+        }
+        foreach opt $optimizations {
+            foreach abi $abis {
+                set options [concat $common $opt $abi]
+                verbose "Testing $testname, $options" 1
+                dg-test $test $options ""
+            }
+        }
+    }
+}
 
 # Like check_conditional_xfail, but callable from a dg test.
 
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/a.out b/Modules/_ctypes/libffi/testsuite/libffi.call/a.out
deleted file mode 100644
index e69de29..0000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/a.out
+++ /dev/null
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/call.exp b/Modules/_ctypes/libffi/testsuite/libffi.call/call.exp
index c334685..36d13d8 100644
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/call.exp
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/call.exp
@@ -19,20 +19,7 @@
 
 global srcdir subdir
 
-if { [string match $using_gcc "yes"] } {
-
-  dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-O0 -W -Wall" ""
-  dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-O2" ""
-  dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-O3" ""
-  dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-Os" ""
-  dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-O2 -fomit-frame-pointer" ""
- 
-} else { 
-
-  # Assume we are using the vendor compiler.
-  dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "" ""
-
-}
+run-many-tests [lsort [glob -nocomplain -- $srcdir/$subdir/*.{c,cc}]] ""
 
 dg-finish
 
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/closure_simple.c b/Modules/_ctypes/libffi/testsuite/libffi.call/closure_simple.c
new file mode 100644
index 0000000..5a4e728
--- /dev/null
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/closure_simple.c
@@ -0,0 +1,55 @@
+/* Area:	closure_call
+   Purpose:	Check simple closure handling with all ABIs
+   Limitations:	none.
+   PR:		none.
+   Originator:	<twalljava@dev.java.net> */
+
+/* { dg-do run } */
+#include "ffitest.h"
+
+static void
+closure_test(ffi_cif* cif __UNUSED__, void* resp, void** args, void* userdata)
+{
+  *(ffi_arg*)resp =
+    (int)*(int *)args[0] + (int)(*(int *)args[1])
+    + (int)(*(int *)args[2])  + (int)(*(int *)args[3])
+    + (int)(intptr_t)userdata;
+
+  printf("%d %d %d %d: %d\n",
+	 (int)*(int *)args[0], (int)(*(int *)args[1]),
+	 (int)(*(int *)args[2]), (int)(*(int *)args[3]),
+         (int)*(ffi_arg *)resp);
+
+}
+
+typedef int (ABI_ATTR *closure_test_type0)(int, int, int, int);
+
+int main (void)
+{
+  ffi_cif cif;
+  void *code;
+  ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
+  ffi_type * cl_arg_types[17];
+  int res;
+
+  cl_arg_types[0] = &ffi_type_uint;
+  cl_arg_types[1] = &ffi_type_uint;
+  cl_arg_types[2] = &ffi_type_uint;
+  cl_arg_types[3] = &ffi_type_uint;
+  cl_arg_types[4] = NULL;
+
+  /* Initialize the cif */
+  CHECK(ffi_prep_cif(&cif, ABI_NUM, 4,
+		     &ffi_type_sint, cl_arg_types) == FFI_OK);
+
+  CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test,
+                             (void *) 3 /* userdata */, code) == FFI_OK);
+
+  res = (*(closure_test_type0)code)(0, 1, 2, 3);
+  /* { dg-output "0 1 2 3: 9" } */
+
+  printf("res: %d\n",res);
+  /* { dg-output "\nres: 9" } */
+
+  exit(0);
+}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/closure_stdcall.c b/Modules/_ctypes/libffi/testsuite/libffi.call/closure_stdcall.c
deleted file mode 100644
index 1407f02..0000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/closure_stdcall.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Area:	closure_call (stdcall convention)
-   Purpose:	Check handling when caller expects stdcall callee
-   Limitations:	none.
-   PR:		none.
-   Originator:	<twalljava@dev.java.net> */
-
-/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */
-#include "ffitest.h"
-
-static void
-closure_test_stdcall(ffi_cif* cif __UNUSED__, void* resp, void** args,
-		 void* userdata)
-{
-  *(ffi_arg*)resp =
-    (int)*(int *)args[0] + (int)(*(int *)args[1])
-    + (int)(*(int *)args[2])  + (int)(*(int *)args[3])
-    + (int)(intptr_t)userdata;
-
-  printf("%d %d %d %d: %d\n",
-	 (int)*(int *)args[0], (int)(*(int *)args[1]),
-	 (int)(*(int *)args[2]), (int)(*(int *)args[3]),
-         (int)*(ffi_arg *)resp);
-
-}
-
-typedef int (__stdcall *closure_test_type0)(int, int, int, int);
-
-int main (void)
-{
-  ffi_cif cif;
-  void *code;
-  ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
-  ffi_type * cl_arg_types[17];
-  int res;
-  void* sp_pre;
-  void* sp_post;
-  char buf[1024];
-
-  cl_arg_types[0] = &ffi_type_uint;
-  cl_arg_types[1] = &ffi_type_uint;
-  cl_arg_types[2] = &ffi_type_uint;
-  cl_arg_types[3] = &ffi_type_uint;
-  cl_arg_types[4] = NULL;
-
-  /* Initialize the cif */
-  CHECK(ffi_prep_cif(&cif, FFI_STDCALL, 4,
-		     &ffi_type_sint, cl_arg_types) == FFI_OK);
-
-  CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_stdcall,
-                             (void *) 3 /* userdata */, code) == FFI_OK);
-
-#ifdef _MSC_VER
-  __asm { mov sp_pre, esp }
-#else
-  asm volatile (" movl %%esp,%0" : "=g" (sp_pre));
-#endif
-  res = (*(closure_test_type0)code)(0, 1, 2, 3);
-#ifdef _MSC_VER
-  __asm { mov sp_post, esp }
-#else
-  asm volatile (" movl %%esp,%0" : "=g" (sp_post));
-#endif
-  /* { dg-output "0 1 2 3: 9" } */
-
-  printf("res: %d\n",res);
-  /* { dg-output "\nres: 9" } */
-
-  sprintf(buf, "mismatch: pre=%p vs post=%p", sp_pre, sp_post);
-  printf("stack pointer %s\n", (sp_pre == sp_post ? "match" : buf));
-  /* { dg-output "\nstack pointer match" } */
-  exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/closure_thiscall.c b/Modules/_ctypes/libffi/testsuite/libffi.call/closure_thiscall.c
deleted file mode 100644
index 0f93649..0000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/closure_thiscall.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Area:	closure_call (thiscall convention)
-   Purpose:	Check handling when caller expects thiscall callee
-   Limitations:	none.
-   PR:		none.
-   Originator:	<ktietz@redhat.com> */
-
-/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */
-#include "ffitest.h"
-
-static void
-closure_test_thiscall(ffi_cif* cif __UNUSED__, void* resp, void** args,
-		      void* userdata)
-{
-  *(ffi_arg*)resp =
-    (int)*(int *)args[0] + (int)(*(int *)args[1])
-    + (int)(*(int *)args[2])  + (int)(*(int *)args[3])
-    + (int)(intptr_t)userdata;
-
-  printf("%d %d %d %d: %d\n",
-	 (int)*(int *)args[0], (int)(*(int *)args[1]),
-	 (int)(*(int *)args[2]), (int)(*(int *)args[3]),
-         (int)*(ffi_arg *)resp);
-
-}
-
-typedef int (__thiscall *closure_test_type0)(int, int, int, int);
-
-int main (void)
-{
-  ffi_cif cif;
-  void *code;
-  ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
-  ffi_type * cl_arg_types[17];
-  int res;
-  void* sp_pre;
-  void* sp_post;
-  char buf[1024];
-
-  cl_arg_types[0] = &ffi_type_uint;
-  cl_arg_types[1] = &ffi_type_uint;
-  cl_arg_types[2] = &ffi_type_uint;
-  cl_arg_types[3] = &ffi_type_uint;
-  cl_arg_types[4] = NULL;
-
-  /* Initialize the cif */
-  CHECK(ffi_prep_cif(&cif, FFI_THISCALL, 4,
-		     &ffi_type_sint, cl_arg_types) == FFI_OK);
-
-  CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_thiscall,
-                             (void *) 3 /* userdata */, code) == FFI_OK);
-
-#ifdef _MSC_VER
-  __asm { mov sp_pre, esp }
-#else
-  asm volatile (" movl %%esp,%0" : "=g" (sp_pre));
-#endif
-  res = (*(closure_test_type0)code)(0, 1, 2, 3);
-#ifdef _MSC_VER
-  __asm { mov sp_post, esp }
-#else
-  asm volatile (" movl %%esp,%0" : "=g" (sp_post));
-#endif
-  /* { dg-output "0 1 2 3: 9" } */
-
-  printf("res: %d\n",res);
-  /* { dg-output "\nres: 9" } */
-
-  sprintf(buf, "mismatch: pre=%p vs post=%p", sp_pre, sp_post);
-  printf("stack pointer %s\n", (sp_pre == sp_post ? "match" : buf));
-  /* { dg-output "\nstack pointer match" } */
-  exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_double_va.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_double_va.c
index 43167b6..e077f92 100644
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_double_va.c
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_double_va.c
@@ -38,7 +38,7 @@
 
 	/* This printf call is variadic */
 	CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 2, &ffi_type_sint,
-		arg_types) == FFI_OK);
+			       arg_types) == FFI_OK);
 
 	args[0] = &format;
 	args[1] = &doubleArg;
@@ -49,12 +49,10 @@
 	printf("res: %d\n", (int) res);
 	/* { dg-output "\nres: 4" } */
 
-	/* The call to cls_double_va_fn is static, so have to use a normal prep_cif */
-	CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &ffi_type_sint, arg_types) == FFI_OK);
+	CHECK(ffi_prep_closure_loc(pcl, &cif, cls_double_va_fn, NULL,
+				   code) == FFI_OK);
 
-	CHECK(ffi_prep_closure_loc(pcl, &cif, cls_double_va_fn, NULL, code) == FFI_OK);
-
-	res	= ((int(*)(char*, double))(code))(format, doubleArg);
+	res = ((int(*)(char*, ...))(code))(format, doubleArg);
 	/* { dg-output "\n7.0" } */
 	printf("res: %d\n", (int) res);
 	/* { dg-output "\nres: 4" } */
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_longdouble_va.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_longdouble_va.c
index 7126b13..39b438b 100644
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_longdouble_va.c
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_longdouble_va.c
@@ -38,7 +38,7 @@
 
 	/* This printf call is variadic */
 	CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 2, &ffi_type_sint,
-		arg_types) == FFI_OK);
+			       arg_types) == FFI_OK);
 
 	args[0] = &format;
 	args[1] = &ldArg;
@@ -49,13 +49,10 @@
 	printf("res: %d\n", (int) res);
 	/* { dg-output "\nres: 4" } */
 
-	/* The call to cls_longdouble_va_fn is static, so have to use a normal prep_cif */
-	CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &ffi_type_sint,
-		arg_types) == FFI_OK);
+	CHECK(ffi_prep_closure_loc(pcl, &cif, cls_longdouble_va_fn, NULL,
+				   code) == FFI_OK);
 
-	CHECK(ffi_prep_closure_loc(pcl, &cif, cls_longdouble_va_fn, NULL, code) == FFI_OK);
-
-	res	= ((int(*)(char*, long double))(code))(format, ldArg);
+	res = ((int(*)(char*, ...))(code))(format, ldArg);
 	/* { dg-output "\n7.0" } */
 	printf("res: %d\n", (int) res);
 	/* { dg-output "\nres: 4" } */
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_struct_va1.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_struct_va1.c
index 175ed96..6d1fdae 100644
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_struct_va1.c
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_struct_va1.c
@@ -35,7 +35,7 @@
   printf ("%d %d %d %d %d %d %d %d %d %d\n", n, s1.a, s1.b,
 	  l1.a, l1.b, l1.c, l1.d, l1.e,
 	  s2.a, s2.b);
-  * (int*) resp = 42;
+  * (ffi_arg*) resp = 42;
 }
 
 int
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_uint_va.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_uint_va.c
index 150fddd..b04cfd1 100644
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_uint_va.c
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_uint_va.c
@@ -13,9 +13,9 @@
 static void cls_ret_T_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
 			 void* userdata __UNUSED__)
  {
-   *(T *)resp = *(T *)args[0];
+   *(ffi_arg *)resp = *(T *)args[0];
 
-   printf("%d: %d %d\n", *(T *)resp, *(T *)args[0], *(T *)args[1]);
+   printf("%d: %d %d\n", (int)*(ffi_arg *)resp, *(T *)args[0], *(T *)args[1]);
  }
 
 typedef T (*cls_ret_T)(T, ...);
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/ffitest.h b/Modules/_ctypes/libffi/testsuite/libffi.call/ffitest.h
index 136a7a6..15d5e44 100644
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/ffitest.h
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/ffitest.h
@@ -15,22 +15,25 @@
 
 #define MAX_ARGS 256
 
-#define CHECK(x) !(x) ? (abort(), 1) : 0
+#define CHECK(x) (void)(!(x) ? (abort(), 1) : 0)
 
-/* Define __UNUSED__ that also other compilers than gcc can run the tests.  */
+/* Define macros so that compilers other than gcc can run the tests.  */
 #undef __UNUSED__
 #if defined(__GNUC__)
 #define __UNUSED__ __attribute__((__unused__))
+#define __STDCALL__ __attribute__((stdcall))
+#define __THISCALL__ __attribute__((thiscall))
+#define __FASTCALL__ __attribute__((fastcall))
 #else
 #define __UNUSED__
+#define __STDCALL__ __stdcall
+#define __THISCALL__ __thiscall
+#define __FASTCALL__ __fastcall
 #endif
 
-/* Define __FASTCALL__ so that other compilers than gcc can run the tests.  */
-#undef __FASTCALL__
-#if defined _MSC_VER
-#define __FASTCALL__ __fastcall
-#else
-#define __FASTCALL__ __attribute__((fastcall))
+#ifndef ABI_NUM
+#define ABI_NUM FFI_DEFAULT_ABI
+#define ABI_ATTR
 #endif
 
 /* Prefer MAP_ANON(YMOUS) to /dev/zero, since we don't need to keep a
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/many.c b/Modules/_ctypes/libffi/testsuite/libffi.call/many.c
index 4869ba9..336968c 100644
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/many.c
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/many.c
@@ -7,21 +7,11 @@
 /* { dg-do run } */
 #include "ffitest.h"
 
+#include <stdlib.h>
 #include <float.h>
+#include <math.h>
 
-static float many(float f1,
-		  float f2,
-		  float f3,
-		  float f4,
-		  float f5,
-		  float f6,
-		  float f7,
-		  float f8,
-		  float f9,
-		  float f10,
-		  float f11,
-		  float f12,
-		  float f13)
+static float ABI_ATTR many(float f1, float f2, float f3, float f4, float f5, float f6, float f7, float f8, float f9, float f10, float f11, float f12, float f13)
 {
 #if 0
   printf("%f %f %f %f %f %f %f %f %f %f %f %f %f\n",
@@ -30,7 +20,7 @@
 	 (double) f11, (double) f12, (double) f13);
 #endif
 
-  return ((f1/f2+f3/f4+f5/f6+f7/f8+f9/f10+f11/f12) * f13);
+  return f1+f2+f3+f4+f5+f6+f7+f8+f9+f10+f11+f12+f13;
 }
 
 int main (void)
@@ -50,7 +40,7 @@
     }
 
     /* Initialize the cif */
-    CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 13, 
+    CHECK(ffi_prep_cif(&cif, ABI_NUM, 13,
 		       &ffi_type_float, args) == FFI_OK);
 
     ffi_call(&cif, FFI_FN(many), &f, values);
@@ -62,7 +52,7 @@
 	       fa[8], fa[9],
 	       fa[10],fa[11],fa[12]);
 
-    if (f - ff < FLT_EPSILON)
+    if (fabs(f - ff) < FLT_EPSILON)
       exit(0);
     else
       abort();
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/many2.c b/Modules/_ctypes/libffi/testsuite/libffi.call/many2.c
index 98eac60..1c85746 100644
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/many2.c
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/many2.c
@@ -22,7 +22,7 @@
   return a + b + c + d + e + f + g;
 }
 
-uint8_t
+uint8_t ABI_ATTR
 bar (uint8_t a, uint8_t b, uint8_t c, uint8_t d,
      uint8_t e, uint8_t f, uint8_t g)
 {
@@ -42,7 +42,7 @@
   for (i = 0; i < NARGS; ++i)
     ffitypes[i] = &ffi_type_uint8;
 
-  CHECK (ffi_prep_cif (&cif, FFI_DEFAULT_ABI, NARGS,
+  CHECK (ffi_prep_cif (&cif, ABI_NUM, NARGS,
 		       &ffi_type_uint8, ffitypes) == FFI_OK);
 
   for (i = 0; i < NARGS; ++i)
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/many2_win32.c b/Modules/_ctypes/libffi/testsuite/libffi.call/many2_win32.c
deleted file mode 100644
index 4adbe4d..0000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/many2_win32.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/* Area:	ffi_call
-   Purpose:	Check stdcall many call on X86_WIN32 systems.
-   Limitations:	none.
-   PR:		none.
-   Originator:	From the original ffitest.c  */
-
-/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */
-
-#include "ffitest.h"
-#include <float.h>
-
-static float __attribute__((fastcall)) fastcall_many(float f1,
-						   float f2,
-						   float f3,
-						   float f4,
-						   float f5,
-						   float f6,
-						   float f7,
-						   float f8,
-						   float f9,
-						   float f10,
-						   float f11,
-						   float f12,
-						   float f13)
-{
-  return ((f1/f2+f3/f4+f5/f6+f7/f8+f9/f10+f11/f12) * f13);
-}
-
-int main (void)
-{
-  ffi_cif cif;
-  ffi_type *args[13];
-  void *values[13];
-  float fa[13];
-  float f, ff;
-  unsigned long ul;
-
-  for (ul = 0; ul < 13; ul++)
-    {
-      args[ul] = &ffi_type_float;
-      values[ul] = &fa[ul];
-	fa[ul] = (float) ul;
-    }
-
-  /* Initialize the cif */
-  CHECK(ffi_prep_cif(&cif, FFI_FASTCALL, 13,
-		     &ffi_type_float, args) == FFI_OK);
-
-  ff =  fastcall_many(fa[0], fa[1],
-		     fa[2], fa[3],
-		     fa[4], fa[5],
-		     fa[6], fa[7],
-		     fa[8], fa[9],
-		     fa[10], fa[11], fa[12]);
-
-  ffi_call(&cif, FFI_FN(fastcall_many), &f, values);
-
-  if (f - ff < FLT_EPSILON)
-    printf("fastcall many arg tests ok!\n");
-  else
-    CHECK(0);
-  exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/many_win32.c b/Modules/_ctypes/libffi/testsuite/libffi.call/many_win32.c
deleted file mode 100644
index 1b26332..0000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/many_win32.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/* Area:	ffi_call
-   Purpose:	Check stdcall many call on X86_WIN32 systems.
-   Limitations:	none.
-   PR:		none.
-   Originator:	From the original ffitest.c  */
-
-/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */
-
-#include "ffitest.h"
-#include <float.h>
-
-static float __attribute__((stdcall)) stdcall_many(float f1,
-						   float f2,
-						   float f3,
-						   float f4,
-						   float f5,
-						   float f6,
-						   float f7,
-						   float f8,
-						   float f9,
-						   float f10,
-						   float f11,
-						   float f12,
-						   float f13)
-{
-  return ((f1/f2+f3/f4+f5/f6+f7/f8+f9/f10+f11/f12) * f13);
-}
-
-int main (void)
-{
-  ffi_cif cif;
-  ffi_type *args[13];
-  void *values[13];
-  float fa[13];
-  float f, ff;
-  unsigned long ul;
-
-  for (ul = 0; ul < 13; ul++)
-    {
-      args[ul] = &ffi_type_float;
-      values[ul] = &fa[ul];
-	fa[ul] = (float) ul;
-    }
-
-  /* Initialize the cif */
-  CHECK(ffi_prep_cif(&cif, FFI_STDCALL, 13,
-		     &ffi_type_float, args) == FFI_OK);
-
-  ff =  stdcall_many(fa[0], fa[1],
-		     fa[2], fa[3],
-		     fa[4], fa[5],
-		     fa[6], fa[7],
-		     fa[8], fa[9],
-		     fa[10], fa[11], fa[12]);
-
-  ffi_call(&cif, FFI_FN(stdcall_many), &f, values);
-
-  if (f - ff < FLT_EPSILON)
-    printf("stdcall many arg tests ok!\n");
-  else
-    CHECK(0);
-  exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct11.c b/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct11.c
index fce6948..3510493 100644
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct11.c
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct11.c
@@ -1,7 +1,7 @@
 /* Area:	ffi_call, closure_call
    Purpose:	Check parameter passing with nested structs
 		of a single type.  This tests the special cases
-		for homogenous floating-point aggregates in the
+		for homogeneous floating-point aggregates in the
 		AArch64 PCS.
    Limitations:	none.
    PR:		none.
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/strlen.c b/Modules/_ctypes/libffi/testsuite/libffi.call/strlen.c
index 3de45de..35b70ea 100644
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/strlen.c
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/strlen.c
@@ -7,7 +7,7 @@
 /* { dg-do run } */
 #include "ffitest.h"
 
-static size_t my_strlen(char *s)
+static size_t ABI_ATTR my_strlen(char *s)
 {
   return (strlen(s));
 }
@@ -24,7 +24,7 @@
   values[0] = (void*) &s;
   
   /* Initialize the cif */
-  CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, 
+  CHECK(ffi_prep_cif(&cif, ABI_NUM, 1,
 		     &ffi_type_sint, args) == FFI_OK);
   
   s = "a";
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/fastthis1_win32.c b/Modules/_ctypes/libffi/testsuite/libffi.call/strlen2.c
similarity index 60%
rename from Modules/_ctypes/libffi/testsuite/libffi.call/fastthis1_win32.c
rename to Modules/_ctypes/libffi/testsuite/libffi.call/strlen2.c
index cbc4724..96282bc 100644
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/fastthis1_win32.c
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/strlen2.c
@@ -1,14 +1,14 @@
 /* Area:	ffi_call
-   Purpose:	Check fastcall fct call on X86_WIN32 systems.
+   Purpose:	Check strlen function call with additional arguments.
    Limitations:	none.
    PR:		none.
    Originator:	From the original ffitest.c  */
 
-/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */
+/* { dg-do run } */
 
 #include "ffitest.h"
 
-static size_t __FASTCALL__ my_fastcall_f(char *s, float a)
+static size_t ABI_ATTR my_f(char *s, float a)
 {
   return (size_t) ((int) strlen(s) + (int) a);
 }
@@ -27,24 +27,23 @@
   values[1] = (void*) &v2;
   
   /* Initialize the cif */
-  CHECK(ffi_prep_cif(&cif, FFI_FASTCALL, 2,
+  CHECK(ffi_prep_cif(&cif, ABI_NUM, 2,
 		       &ffi_type_sint, args) == FFI_OK);
   
   s = "a";
   v2 = 0.0;
-  ffi_call(&cif, FFI_FN(my_fastcall_f), &rint, values);
+  ffi_call(&cif, FFI_FN(my_f), &rint, values);
   CHECK(rint == 1);
   
   s = "1234567";
   v2 = -1.0;
-  ffi_call(&cif, FFI_FN(my_fastcall_f), &rint, values);
+  ffi_call(&cif, FFI_FN(my_f), &rint, values);
   CHECK(rint == 6);
   
   s = "1234567890123456789012345";
   v2 = 1.0;
-  ffi_call(&cif, FFI_FN(my_fastcall_f), &rint, values);
+  ffi_call(&cif, FFI_FN(my_f), &rint, values);
   CHECK(rint == 26);
   
-  printf("fastcall fct1 tests passed\n");
   exit(0);
 }
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/strlen2_win32.c b/Modules/_ctypes/libffi/testsuite/libffi.call/strlen2_win32.c
deleted file mode 100644
index 0d81061..0000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/strlen2_win32.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Area:	ffi_call
-   Purpose:	Check fastcall strlen call on X86_WIN32 systems.
-   Limitations:	none.
-   PR:		none.
-   Originator:	From the original ffitest.c  */
-
-/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */
-
-#include "ffitest.h"
-
-static size_t __FASTCALL__ my_fastcall_strlen(char *s)
-{
-  return (strlen(s));
-}
-
-int main (void)
-{
-  ffi_cif cif;
-  ffi_type *args[MAX_ARGS];
-  void *values[MAX_ARGS];
-  ffi_arg rint;
-  char *s;
-  args[0] = &ffi_type_pointer;
-  values[0] = (void*) &s;
-  
-  /* Initialize the cif */
-  CHECK(ffi_prep_cif(&cif, FFI_FASTCALL, 1,
-		       &ffi_type_sint, args) == FFI_OK);
-  
-  s = "a";
-  ffi_call(&cif, FFI_FN(my_fastcall_strlen), &rint, values);
-  CHECK(rint == 1);
-  
-  s = "1234567";
-  ffi_call(&cif, FFI_FN(my_fastcall_strlen), &rint, values);
-  CHECK(rint == 7);
-  
-  s = "1234567890123456789012345";
-  ffi_call(&cif, FFI_FN(my_fastcall_strlen), &rint, values);
-  CHECK(rint == 25);
-  
-  printf("fastcall strlen tests passed\n");
-  exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/fastthis2_win32.c b/Modules/_ctypes/libffi/testsuite/libffi.call/strlen3.c
similarity index 60%
rename from Modules/_ctypes/libffi/testsuite/libffi.call/fastthis2_win32.c
rename to Modules/_ctypes/libffi/testsuite/libffi.call/strlen3.c
index 7bdd0e1..beba86e 100644
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/fastthis2_win32.c
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/strlen3.c
@@ -1,14 +1,14 @@
 /* Area:	ffi_call
-   Purpose:	Check fastcall fct call on X86_WIN32 systems.
+   Purpose:	Check strlen function call with additional arguments.
    Limitations:	none.
    PR:		none.
    Originator:	From the original ffitest.c  */
 
-/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */
+/* { dg-do run } */
 
 #include "ffitest.h"
 
-static size_t __FASTCALL__ my_fastcall_f(float a, char *s)
+static size_t ABI_ATTR my_f(float a, char *s)
 {
   return (size_t) ((int) strlen(s) + (int) a);
 }
@@ -27,24 +27,23 @@
   values[0] = (void*) &v2;
   
   /* Initialize the cif */
-  CHECK(ffi_prep_cif(&cif, FFI_FASTCALL, 2,
+  CHECK(ffi_prep_cif(&cif, ABI_NUM, 2,
 		       &ffi_type_sint, args) == FFI_OK);
   
   s = "a";
   v2 = 0.0;
-  ffi_call(&cif, FFI_FN(my_fastcall_f), &rint, values);
+  ffi_call(&cif, FFI_FN(my_f), &rint, values);
   CHECK(rint == 1);
   
   s = "1234567";
   v2 = -1.0;
-  ffi_call(&cif, FFI_FN(my_fastcall_f), &rint, values);
+  ffi_call(&cif, FFI_FN(my_f), &rint, values);
   CHECK(rint == 6);
   
   s = "1234567890123456789012345";
   v2 = 1.0;
-  ffi_call(&cif, FFI_FN(my_fastcall_f), &rint, values);
+  ffi_call(&cif, FFI_FN(my_f), &rint, values);
   CHECK(rint == 26);
   
-  printf("fastcall fct2 tests passed\n");
   exit(0);
 }
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/fastthis3_win32.c b/Modules/_ctypes/libffi/testsuite/libffi.call/strlen4.c
similarity index 63%
rename from Modules/_ctypes/libffi/testsuite/libffi.call/fastthis3_win32.c
rename to Modules/_ctypes/libffi/testsuite/libffi.call/strlen4.c
index b5d606d..d5d42b4 100644
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/fastthis3_win32.c
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/strlen4.c
@@ -1,14 +1,14 @@
 /* Area:	ffi_call
-   Purpose:	Check fastcall f call on X86_WIN32 systems.
+   Purpose:	Check strlen function call with additional arguments.
    Limitations:	none.
    PR:		none.
    Originator:	From the original ffitest.c  */
 
-/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */
+/* { dg-do run } */
 
 #include "ffitest.h"
 
-static size_t __FASTCALL__ my_fastcall_f(float a, char *s, int i)
+static size_t ABI_ATTR my_f(float a, char *s, int i)
 {
   return (size_t) ((int) strlen(s) + (int) a + i);
 }
@@ -30,27 +30,26 @@
   values[0] = (void*) &v2;
   
   /* Initialize the cif */
-  CHECK(ffi_prep_cif(&cif, FFI_FASTCALL, 3,
+  CHECK(ffi_prep_cif(&cif, ABI_NUM, 3,
 		       &ffi_type_sint, args) == FFI_OK);
   
   s = "a";
   v1 = 1;
   v2 = 0.0;
-  ffi_call(&cif, FFI_FN(my_fastcall_f), &rint, values);
+  ffi_call(&cif, FFI_FN(my_f), &rint, values);
   CHECK(rint == 2);
   
   s = "1234567";
   v2 = -1.0;
   v1 = -2;
-  ffi_call(&cif, FFI_FN(my_fastcall_f), &rint, values);
+  ffi_call(&cif, FFI_FN(my_f), &rint, values);
   CHECK(rint == 4);
   
   s = "1234567890123456789012345";
   v2 = 1.0;
   v1 = 2;
-  ffi_call(&cif, FFI_FN(my_fastcall_f), &rint, values);
+  ffi_call(&cif, FFI_FN(my_f), &rint, values);
   CHECK(rint == 28);
   
-  printf("fastcall fct3 tests passed\n");
   exit(0);
 }
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/strlen_win32.c b/Modules/_ctypes/libffi/testsuite/libffi.call/strlen_win32.c
deleted file mode 100644
index 6fbcc87..0000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/strlen_win32.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Area:	ffi_call
-   Purpose:	Check stdcall strlen call on X86_WIN32 systems.
-   Limitations:	none.
-   PR:		none.
-   Originator:	From the original ffitest.c  */
-
-/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */
-
-#include "ffitest.h"
-
-static size_t __attribute__((stdcall)) my_stdcall_strlen(char *s)
-{
-  return (strlen(s));
-}
-
-int main (void)
-{
-  ffi_cif cif;
-  ffi_type *args[MAX_ARGS];
-  void *values[MAX_ARGS];
-  ffi_arg rint;
-  char *s;
-  args[0] = &ffi_type_pointer;
-  values[0] = (void*) &s;
-  
-  /* Initialize the cif */
-  CHECK(ffi_prep_cif(&cif, FFI_STDCALL, 1,
-		       &ffi_type_sint, args) == FFI_OK);
-  
-  s = "a";
-  ffi_call(&cif, FFI_FN(my_stdcall_strlen), &rint, values);
-  CHECK(rint == 1);
-  
-  s = "1234567";
-  ffi_call(&cif, FFI_FN(my_stdcall_strlen), &rint, values);
-  CHECK(rint == 7);
-  
-  s = "1234567890123456789012345";
-  ffi_call(&cif, FFI_FN(my_stdcall_strlen), &rint, values);
-  CHECK(rint == 25);
-  
-  printf("stdcall strlen tests passed\n");
-  exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/struct1.c b/Modules/_ctypes/libffi/testsuite/libffi.call/struct1.c
index bfc23f6..c13e23f 100644
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/struct1.c
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/struct1.c
@@ -14,7 +14,7 @@
   unsigned int ui;
 } test_structure_1;
 
-static test_structure_1 struct1(test_structure_1 ts)
+static test_structure_1 ABI_ATTR struct1(test_structure_1 ts)
 {
   ts.uc++;
   ts.d--;
@@ -50,7 +50,7 @@
   values[0] = &ts1_arg;
   
   /* Initialize the cif */
-  CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, 
+  CHECK(ffi_prep_cif(&cif, ABI_NUM, 1,
 		     &ts1_type, args) == FFI_OK);
   
   ts1_arg.uc = '\x01';
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/struct1_win32.c b/Modules/_ctypes/libffi/testsuite/libffi.call/struct1_win32.c
deleted file mode 100644
index b756f5a..0000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/struct1_win32.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Area:	ffi_call
-   Purpose:	Check structures with fastcall/thiscall convention.
-   Limitations:	none.
-   PR:		none.
-   Originator:	From the original ffitest.c  */
-
-/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */
-#include "ffitest.h"
-
-typedef struct
-{
-  unsigned char uc;
-  double d;
-  unsigned int ui;
-} test_structure_1;
-
-static test_structure_1 __FASTCALL__ struct1(test_structure_1 ts)
-{
-  ts.uc++;
-  ts.d--;
-  ts.ui++;
-
-  return ts;
-}
-
-int main (void)
-{
-  ffi_cif cif;
-  ffi_type *args[MAX_ARGS];
-  void *values[MAX_ARGS];
-  ffi_type ts1_type;
-  ffi_type *ts1_type_elements[4];
-
-  test_structure_1 ts1_arg;
-
-  /* This is a hack to get a properly aligned result buffer */
-  test_structure_1 *ts1_result =
-    (test_structure_1 *) malloc (sizeof(test_structure_1));
-
-  ts1_type.size = 0;
-  ts1_type.alignment = 0;
-  ts1_type.type = FFI_TYPE_STRUCT;
-  ts1_type.elements = ts1_type_elements;
-  ts1_type_elements[0] = &ffi_type_uchar;
-  ts1_type_elements[1] = &ffi_type_double;
-  ts1_type_elements[2] = &ffi_type_uint;
-  ts1_type_elements[3] = NULL;
-  
-  args[0] = &ts1_type;
-  values[0] = &ts1_arg;
-  
-  /* Initialize the cif */
-  CHECK(ffi_prep_cif(&cif, FFI_FASTCALL, 1, 
-		     &ts1_type, args) == FFI_OK);
-  
-  ts1_arg.uc = '\x01';
-  ts1_arg.d = 3.14159;
-  ts1_arg.ui = 555;
-
-  ffi_call(&cif, FFI_FN(struct1), ts1_result, values);
-  
-  CHECK(ts1_result->ui == 556);
-  CHECK(ts1_result->d == 3.14159 - 1);
- 
-  free (ts1_result);
-  exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/struct2.c b/Modules/_ctypes/libffi/testsuite/libffi.call/struct2.c
index d85385e..5077a5e 100644
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/struct2.c
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/struct2.c
@@ -13,7 +13,7 @@
   double d2;
 } test_structure_2;
 
-static test_structure_2 struct2(test_structure_2 ts)
+static test_structure_2 ABI_ATTR struct2(test_structure_2 ts)
 {
   ts.d1--;
   ts.d2--;
@@ -46,7 +46,7 @@
   values[0] = &ts2_arg;
   
   /* Initialize the cif */
-  CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts2_type, args) == FFI_OK);
+  CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, &ts2_type, args) == FFI_OK);
   
   ts2_arg.d1 = 5.55;
   ts2_arg.d2 = 6.66;
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/struct2_win32.c b/Modules/_ctypes/libffi/testsuite/libffi.call/struct2_win32.c
deleted file mode 100644
index 5d02285..0000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/struct2_win32.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Area:	ffi_call
-   Purpose:	Check structures in fastcall/stdcall function
-   Limitations:	none.
-   PR:		none.
-   Originator:	From the original ffitest.c  */
-
-/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */
-#include "ffitest.h"
-
-typedef struct
-{
-  double d1;
-  double d2;
-} test_structure_2;
-
-static test_structure_2 __FASTCALL__ struct2(test_structure_2 ts)
-{
-  ts.d1--;
-  ts.d2--;
-
-  return ts;
-}
-
-int main (void)
-{
-  ffi_cif cif;
-  ffi_type *args[MAX_ARGS];
-  void *values[MAX_ARGS];
-  test_structure_2 ts2_arg;
-  ffi_type ts2_type;
-  ffi_type *ts2_type_elements[3];
-
-  /* This is a hack to get a properly aligned result buffer */
-  test_structure_2 *ts2_result =
-    (test_structure_2 *) malloc (sizeof(test_structure_2));
-
-  ts2_type.size = 0;
-  ts2_type.alignment = 0;
-  ts2_type.type = FFI_TYPE_STRUCT;
-  ts2_type.elements = ts2_type_elements;
-  ts2_type_elements[0] = &ffi_type_double;
-  ts2_type_elements[1] = &ffi_type_double;
-  ts2_type_elements[2] = NULL;
-
-  args[0] = &ts2_type;
-  values[0] = &ts2_arg;
-  
-  /* Initialize the cif */
-  CHECK(ffi_prep_cif(&cif, FFI_FASTCALL, 1, &ts2_type, args) == FFI_OK);
-  
-  ts2_arg.d1 = 5.55;
-  ts2_arg.d2 = 6.66;
-  
-  printf ("%g\n", ts2_arg.d1);
-  printf ("%g\n", ts2_arg.d2);
-  
-  ffi_call(&cif, FFI_FN(struct2), ts2_result, values);
-  
-  printf ("%g\n", ts2_result->d1);
-  printf ("%g\n", ts2_result->d2);
-  
-  CHECK(ts2_result->d1 == 5.55 - 1);
-  CHECK(ts2_result->d2 == 6.66 - 1);
-  
-  free (ts2_result);
-  exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/struct3.c b/Modules/_ctypes/libffi/testsuite/libffi.call/struct3.c
index de883c2..7eba0ea 100644
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/struct3.c
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/struct3.c
@@ -12,7 +12,7 @@
   int si;
 } test_structure_3;
 
-static test_structure_3 struct3(test_structure_3 ts)
+static test_structure_3 ABI_ATTR struct3(test_structure_3 ts)
 {
   ts.si = -(ts.si*2);
 
@@ -43,7 +43,7 @@
   values[0] = &ts3_arg;
   
   /* Initialize the cif */
-  CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, 
+  CHECK(ffi_prep_cif(&cif, ABI_NUM, 1,
 		     &ts3_type, args) == FFI_OK);
   
   ts3_arg.si = -123;
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/struct4.c b/Modules/_ctypes/libffi/testsuite/libffi.call/struct4.c
index 48e0349..66a9551 100644
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/struct4.c
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/struct4.c
@@ -14,7 +14,7 @@
   unsigned ui3;
 } test_structure_4;
 
-static test_structure_4 struct4(test_structure_4 ts)
+static test_structure_4 ABI_ATTR struct4(test_structure_4 ts)
 {
   ts.ui3 = ts.ui1 * ts.ui2 * ts.ui3;
 
@@ -48,7 +48,7 @@
   values[0] = &ts4_arg;
   
   /* Initialize the cif */
-  CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts4_type, args) == FFI_OK);
+  CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, &ts4_type, args) == FFI_OK);
   
   ts4_arg.ui1 = 2;
   ts4_arg.ui2 = 3;
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/struct5.c b/Modules/_ctypes/libffi/testsuite/libffi.call/struct5.c
index 28b1f0c..23e2a3f 100644
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/struct5.c
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/struct5.c
@@ -12,7 +12,7 @@
   char c2;
 } test_structure_5;
 
-static test_structure_5 struct5(test_structure_5 ts1, test_structure_5 ts2)
+static test_structure_5 ABI_ATTR struct5(test_structure_5 ts1, test_structure_5 ts2)
 {
   ts1.c1 += ts2.c1;
   ts1.c2 -= ts2.c2;
@@ -48,7 +48,7 @@
   values[1] = &ts5_arg2;
   
   /* Initialize the cif */
-  CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &ts5_type, args) == FFI_OK);
+  CHECK(ffi_prep_cif(&cif, ABI_NUM, 2, &ts5_type, args) == FFI_OK);
   
   ts5_arg1.c1 = 2;
   ts5_arg1.c2 = 6;
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/struct6.c b/Modules/_ctypes/libffi/testsuite/libffi.call/struct6.c
index 0e26746..173c66e 100644
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/struct6.c
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/struct6.c
@@ -12,7 +12,7 @@
   double d;
 } test_structure_6;
 
-static test_structure_6 struct6 (test_structure_6 ts)
+static test_structure_6 ABI_ATTR struct6 (test_structure_6 ts)
 {
   ts.f += 1;
   ts.d += 1;
@@ -46,7 +46,7 @@
   values[0] = &ts6_arg;
 
   /* Initialize the cif */
-  CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts6_type, args) == FFI_OK);
+  CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, &ts6_type, args) == FFI_OK);
   
   ts6_arg.f = 5.55f;
   ts6_arg.d = 6.66;
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/struct7.c b/Modules/_ctypes/libffi/testsuite/libffi.call/struct7.c
index 8f2bbfd..badc7e0 100644
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/struct7.c
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/struct7.c
@@ -13,7 +13,7 @@
   double d;
 } test_structure_7;
 
-static test_structure_7 struct7 (test_structure_7 ts)
+static test_structure_7 ABI_ATTR struct7 (test_structure_7 ts)
 {
   ts.f1 += 1;
   ts.f2 += 1;
@@ -49,7 +49,7 @@
   values[0] = &ts7_arg;
   
   /* Initialize the cif */
-  CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts7_type, args) == FFI_OK);
+  CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, &ts7_type, args) == FFI_OK);
   
   ts7_arg.f1 = 5.55f;
   ts7_arg.f2 = 55.5f;
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/struct8.c b/Modules/_ctypes/libffi/testsuite/libffi.call/struct8.c
index 266e1f0..ef204ec 100644
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/struct8.c
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/struct8.c
@@ -14,7 +14,7 @@
   float f4;
 } test_structure_8;
 
-static test_structure_8 struct8 (test_structure_8 ts)
+static test_structure_8 ABI_ATTR struct8 (test_structure_8 ts)
 {
   ts.f1 += 1;
   ts.f2 += 1;
@@ -52,7 +52,7 @@
   values[0] = &ts8_arg;
   
   /* Initialize the cif */
-  CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts8_type, args) == FFI_OK);
+  CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, &ts8_type, args) == FFI_OK);
   
   ts8_arg.f1 = 5.55f;
   ts8_arg.f2 = 55.5f;
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/struct9.c b/Modules/_ctypes/libffi/testsuite/libffi.call/struct9.c
index efeb716..4a13b81 100644
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/struct9.c
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/struct9.c
@@ -13,7 +13,7 @@
   int i;
 } test_structure_9;
 
-static test_structure_9 struct9 (test_structure_9 ts)
+static test_structure_9 ABI_ATTR struct9 (test_structure_9 ts)
 {
   ts.f += 1;
   ts.i += 1;
@@ -47,7 +47,7 @@
   values[0] = &ts9_arg;
   
   /* Initialize the cif */
-  CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts9_type, args) == FFI_OK);
+  CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, &ts9_type, args) == FFI_OK);
   
   ts9_arg.f = 5.55f;
   ts9_arg.i = 5;
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.special/unwindtest.cc b/Modules/_ctypes/libffi/testsuite/libffi.call/unwindtest.cc
similarity index 96%
rename from Modules/_ctypes/libffi/testsuite/libffi.special/unwindtest.cc
rename to Modules/_ctypes/libffi/testsuite/libffi.call/unwindtest.cc
index a78f4e7..67cfefec 100644
--- a/Modules/_ctypes/libffi/testsuite/libffi.special/unwindtest.cc
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/unwindtest.cc
@@ -6,17 +6,9 @@
 
 /* { dg-do run } */
 
-#include "ffitestcxx.h"
+#include "ffitest.h"
 
-#if defined HAVE_STDINT_H
-#include <stdint.h>
-#endif
-
-#if defined HAVE_INTTYPES_H
-#include <inttypes.h>
-#endif
-
-void
+void ABI_ATTR
 closure_test_fn(ffi_cif* cif __UNUSED__, void* resp __UNUSED__,
 		void** args __UNUSED__, void* userdata __UNUSED__)
 {
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.special/unwindtest_ffi_call.cc b/Modules/_ctypes/libffi/testsuite/libffi.call/unwindtest_ffi_call.cc
similarity index 97%
rename from Modules/_ctypes/libffi/testsuite/libffi.special/unwindtest_ffi_call.cc
rename to Modules/_ctypes/libffi/testsuite/libffi.call/unwindtest_ffi_call.cc
index 57191f2..ec61164 100644
--- a/Modules/_ctypes/libffi/testsuite/libffi.special/unwindtest_ffi_call.cc
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/unwindtest_ffi_call.cc
@@ -6,7 +6,7 @@
 
 /* { dg-do run } */
 
-#include "ffitestcxx.h"
+#include "ffitest.h"
 
 static int checking(int a __UNUSED__, short b __UNUSED__,
 		    signed char c __UNUSED__)
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/va_1.c b/Modules/_ctypes/libffi/testsuite/libffi.call/va_1.c
index cf4dd85..7f96809 100644
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/va_1.c
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/va_1.c
@@ -94,7 +94,7 @@
   struct large_tag l1;
 
   int n;
-  int res;
+  ffi_arg res;
 
   unsigned char uc;
   signed char sc;
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/va_struct1.c b/Modules/_ctypes/libffi/testsuite/libffi.call/va_struct1.c
index 11d1f10..e645206 100644
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/va_struct1.c
+++ b/Modules/_ctypes/libffi/testsuite/libffi.call/va_struct1.c
@@ -61,7 +61,7 @@
   struct large_tag l1;
 
   int n;
-  int res;
+  ffi_arg res;
 
   s_type.size = 0;
   s_type.alignment = 0;
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.special/ffitestcxx.h b/Modules/_ctypes/libffi/testsuite/libffi.special/ffitestcxx.h
deleted file mode 100644
index c6da7ef..0000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.special/ffitestcxx.h
+++ /dev/null
@@ -1,55 +0,0 @@
-#include <stdlib.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <ffi.h>
-#include "fficonfig.h"
-
-#define MAX_ARGS 256
-
-
-/* Define __UNUSED__ that also other compilers than gcc can run the tests.  */
-#undef __UNUSED__
-#if defined(__GNUC__)
-#define __UNUSED__ __attribute__((__unused__))
-#else
-#define __UNUSED__
-#endif
-
-#define CHECK(x) (!(x) ? abort() : (void)0)
-
-/* Prefer MAP_ANON(YMOUS) to /dev/zero, since we don't need to keep a
-   file open.  */
-#ifdef HAVE_MMAP_ANON
-# undef HAVE_MMAP_DEV_ZERO
-
-# include <sys/mman.h>
-# ifndef MAP_FAILED
-#  define MAP_FAILED -1
-# endif
-# if !defined (MAP_ANONYMOUS) && defined (MAP_ANON)
-#  define MAP_ANONYMOUS MAP_ANON
-# endif
-# define USING_MMAP
-
-#endif
-
-#ifdef HAVE_MMAP_DEV_ZERO
-
-# include <sys/mman.h>
-# ifndef MAP_FAILED
-#  define MAP_FAILED -1
-# endif
-# define USING_MMAP
-
-#endif
-
-
-/* MinGW kludge.  */
-#ifdef _WIN64
-#define PRIdLL "I64d"
-#define PRIuLL "I64u"
-#else
-#define PRIdLL "lld"
-#define PRIuLL "llu"
-#endif
-
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.special/special.exp b/Modules/_ctypes/libffi/testsuite/libffi.special/special.exp
deleted file mode 100644
index f1a5fa6..0000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.special/special.exp
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2003, 2006, 2009, 2010 Free Software Foundation, Inc.
-
-# This program 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 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; see the file COPYING3.  If not see
-# <http://www.gnu.org/licenses/>.
-
-dg-init
-libffi-init
-
-global srcdir subdir
-
-global cxx_options
-
-set cxx_options " -shared-libgcc -lstdc++"
-
-if { [string match $using_gcc "yes"] } {
-
-  dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.cc]] $cxx_options "-O0 -W -Wall"
-  dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.cc]] $cxx_options "-O2"
-  dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.cc]] $cxx_options "-O3"
-  dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.cc]] $cxx_options "-Os"
-
-}
-
-dg-finish
-
-# Local Variables:
-# tcl-indent-level:4
-# End:
diff --git a/Modules/_ctypes/libffi/texinfo.tex b/Modules/_ctypes/libffi/texinfo.tex
index a5a7b2b..85f184c 100644
--- a/Modules/_ctypes/libffi/texinfo.tex
+++ b/Modules/_ctypes/libffi/texinfo.tex
@@ -3,11 +3,11 @@
 % Load plain if necessary, i.e., if running under initex.
 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
 %
-\def\texinfoversion{2012-06-05.14}
+\def\texinfoversion{2013-02-01.11}
 %
 % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
 % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-% 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+% 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
 %
 % This texinfo.tex file is free software: you can redistribute it and/or
 % modify it under the terms of the GNU General Public License as
@@ -24,7 +24,8 @@
 %
 % As a special exception, when this file is read by TeX when processing
 % a Texinfo source document, you may use the result without
-% restriction.  (This has been our intent since Texinfo was invented.)
+% restriction. This Exception is an additional permission under section 7
+% of the GNU General Public License, version 3 ("GPLv3").
 %
 % Please try the latest version of texinfo.tex before submitting bug
 % reports; you can get the latest version from:
@@ -594,7 +595,7 @@
 \def\:{\spacefactor=1000 }
 
 % @* forces a line break.
-\def\*{\hfil\break\hbox{}\ignorespaces}
+\def\*{\unskip\hfil\break\hbox{}\ignorespaces}
 
 % @/ allows a line break.
 \let\/=\allowbreak
@@ -2272,8 +2273,6 @@
 
 \gdef\markupsetcodequoteleft{\let`\codequoteleft}
 \gdef\markupsetcodequoteright{\let'\codequoteright}
-
-\gdef\markupsetnoligaturesquoteleft{\let`\noligaturesquoteleft}
 }
 
 \let\markupsetuplqcode \markupsetcodequoteleft
@@ -2282,6 +2281,9 @@
 \let\markupsetuplqexample \markupsetcodequoteleft
 \let\markupsetuprqexample \markupsetcodequoteright
 %
+\let\markupsetuplqkbd     \markupsetcodequoteleft
+\let\markupsetuprqkbd     \markupsetcodequoteright
+%
 \let\markupsetuplqsamp \markupsetcodequoteleft
 \let\markupsetuprqsamp \markupsetcodequoteright
 %
@@ -2291,8 +2293,6 @@
 \let\markupsetuplqverbatim \markupsetcodequoteleft
 \let\markupsetuprqverbatim \markupsetcodequoteright
 
-\let\markupsetuplqkbd \markupsetnoligaturesquoteleft
-
 % Allow an option to not use regular directed right quote/apostrophe
 % (char 0x27), but instead the undirected quote from cmtt (char 0x0d).
 % The undirected quote is ugly, so don't make it the default, but it
@@ -2382,8 +2382,7 @@
   \aftersmartic
 }
 
-% like \smartslanted except unconditionally uses \ttsl, and no ic.
-% @var is set to this for defun arguments.
+% Unconditional use \ttsl, and no ic.  @var is set to this for defuns.
 \def\ttslanted#1{{\ttsl #1}}
 
 % @cite is like \smartslanted except unconditionally use \sl.  We never want
@@ -2448,34 +2447,12 @@
 % @samp.
 \def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}}
 
-% definition of @key that produces a lozenge.  Doesn't adjust to text size.
-%\setfont\keyrm\rmshape{8}{1000}{OT1}
-%\font\keysy=cmsy9
-%\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
-%  \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
-%    \vbox{\hrule\kern-0.4pt
-%     \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
-%    \kern-0.4pt\hrule}%
-%  \kern-.06em\raise0.4pt\hbox{\angleright}}}}
+% @indicateurl is \samp, that is, with quotes.
+\let\indicateurl=\samp
 
-% definition of @key with no lozenge.  If the current font is already
-% monospace, don't change it; that way, we respect @kbdinputstyle.  But
-% if it isn't monospace, then use \tt.
-%
-\def\key#1{{\setupmarkupstyle{key}%
-  \nohyphenation
-  \ifmonospace\else\tt\fi
-  #1}\null}
-
-% ctrl is no longer a Texinfo command.
-\def\ctrl #1{{\tt \rawbackslash \hat}#1}
-
-% @file, @option are the same as @samp.
-\let\file=\samp
-\let\option=\samp
-
-% @code is a modification of @t,
-% which makes spaces the same size as normal in the surrounding text.
+% @code (and similar) prints in typewriter, but with spaces the same
+% size as normal in the surrounding text, without hyphenation, etc.
+% This is a subroutine for that.
 \def\tclose#1{%
   {%
     % Change normal interword space to be same as for the current font.
@@ -2500,7 +2477,7 @@
 % We *must* turn on hyphenation at `-' and `_' in @code.
 % Otherwise, it is too hard to avoid overfull hboxes
 % in the Emacs manual, the Library manual, etc.
-
+%
 % Unfortunately, TeX uses one parameter (\hyphenchar) to control
 % both hyphenation at - and hyphenation within words.
 % We must therefore turn them both off (\tclose does that)
@@ -2519,7 +2496,7 @@
      \let-\codedash
      \let_\codeunder
     \else
-     \let-\realdash
+     \let-\normaldash
      \let_\realunder
     \fi
     \codex
@@ -2528,7 +2505,7 @@
 
 \def\codex #1{\tclose{#1}\endgroup}
 
-\def\realdash{-}
+\def\normaldash{-}
 \def\codedash{-\discretionary{}{}{}}
 \def\codeunder{%
   % this is all so @math{@code{var_name}+1} can work.  In math mode, _
@@ -2543,9 +2520,9 @@
 }
 
 % An additional complication: the above will allow breaks after, e.g.,
-% each of the four underscores in __typeof__.  This is undesirable in
-% some manuals, especially if they don't have long identifiers in
-% general.  @allowcodebreaks provides a way to control this.
+% each of the four underscores in __typeof__.  This is bad.
+% @allowcodebreaks provides a document-level way to turn breaking at -
+% and _ on and off.
 %
 \newif\ifallowcodebreaks  \allowcodebreakstrue
 
@@ -2564,6 +2541,13 @@
   \fi\fi
 }
 
+% For @command, @env, @file, @option quotes seem unnecessary,
+% so use \code rather than \samp.
+\let\command=\code
+\let\env=\code
+\let\file=\code
+\let\option=\code
+
 % @uref (abbreviation for `urlref') takes an optional (comma-separated)
 % second argument specifying the text to display and an optional third
 % arg as text to display instead of (rather than in addition to) the url
@@ -2710,10 +2694,6 @@
   \let\email=\uref
 \fi
 
-% @kbd is like @code, except that if the argument is just one @key command,
-% then @kbd has no effect.
-\def\kbd#1{{\setupmarkupstyle{kbd}\def\look{#1}\expandafter\kbdfoo\look??\par}}
-
 % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
 %   `example' (@kbd uses ttsl only inside of @example and friends),
 %   or `code' (@kbd uses normal tty font always).
@@ -2737,16 +2717,36 @@
 % Default is `distinct'.
 \kbdinputstyle distinct
 
-\def\xkey{\key}
-\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
-\ifx\one\xkey\ifx\threex\three \key{#2}%
-\else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
-\else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi}
+% @kbd is like @code, except that if the argument is just one @key command,
+% then @kbd has no effect.
+\def\kbd#1{{\def\look{#1}\expandafter\kbdsub\look??\par}}
 
-% For @indicateurl, @env, @command quotes seem unnecessary, so use \code.
-\let\indicateurl=\code
-\let\env=\code
-\let\command=\code
+\def\xkey{\key}
+\def\kbdsub#1#2#3\par{%
+  \def\one{#1}\def\three{#3}\def\threex{??}%
+  \ifx\one\xkey\ifx\threex\three \key{#2}%
+  \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
+  \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
+}
+
+% definition of @key that produces a lozenge.  Doesn't adjust to text size.
+%\setfont\keyrm\rmshape{8}{1000}{OT1}
+%\font\keysy=cmsy9
+%\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
+%  \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
+%    \vbox{\hrule\kern-0.4pt
+%     \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
+%    \kern-0.4pt\hrule}%
+%  \kern-.06em\raise0.4pt\hbox{\angleright}}}}
+
+% definition of @key with no lozenge.  If the current font is already
+% monospace, don't change it; that way, we respect @kbdinputstyle.  But
+% if it isn't monospace, then use \tt.
+%
+\def\key#1{{\setupmarkupstyle{key}%
+  \nohyphenation
+  \ifmonospace\else\tt\fi
+  #1}\null}
 
 % @clicksequence{File @click{} Open ...}
 \def\clicksequence#1{\begingroup #1\endgroup}
@@ -2854,6 +2854,9 @@
   }
 }
 
+% ctrl is no longer a Texinfo command, but leave this definition for fun.
+\def\ctrl #1{{\tt \rawbackslash \hat}#1}
+
 % @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}.
 % Ignore unless FMTNAME == tex; then it is like @iftex and @tex,
 % except specified as a normal braced arg, so no newlines to worry about.
@@ -3144,12 +3147,17 @@
   % hopefully nobody will notice/care.
   \edef\ecsize{\csname\curfontsize ecsize\endcsname}%
   \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}%
-  \ifx\curfontstyle\bfstylename
-    % bold:
-    \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize
+  \ifmonospace
+    % typewriter:
+    \font\thisecfont = ectt\ecsize \space at \nominalsize
   \else
-    % regular:
-    \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize
+    \ifx\curfontstyle\bfstylename
+      % bold:
+      \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize
+    \else
+      % regular:
+      \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize
+    \fi
   \fi
   \thisecfont
 }
@@ -3262,6 +3270,20 @@
   \finishedtitlepagetrue
 }
 
+% Settings used for typesetting titles: no hyphenation, no indentation,
+% don't worry much about spacing, ragged right.  This should be used
+% inside a \vbox, and fonts need to be set appropriately first.  Because
+% it is always used for titles, nothing else, we call \rmisbold.  \par
+% should be specified before the end of the \vbox, since a vbox is a group.
+% 
+\def\raggedtitlesettings{%
+  \rmisbold
+  \hyphenpenalty=10000
+  \parindent=0pt
+  \tolerance=5000
+  \ptexraggedright
+}
+
 % Macros to be used within @titlepage:
 
 \let\subtitlerm=\tenrm
@@ -3269,7 +3291,7 @@
 
 \parseargdef\title{%
   \checkenv\titlepage
-  \leftline{\titlefonts\rmisbold #1}
+  \vbox{\titlefonts \raggedtitlesettings #1\par}%
   % print a rule at the page bottom also.
   \finishedtitlepagefalse
   \vskip4pt \hrule height 4pt width \hsize \vskip4pt
@@ -4166,7 +4188,7 @@
     % ..., but we might end up with active ones in the argument if
     % we're called from @code, as @code{@value{foo-bar_}}, though.
     % So \let them to their normal equivalents.
-    \let-\realdash \let_\normalunderscore
+    \let-\normaldash \let_\normalunderscore
   }
 }
 
@@ -4206,7 +4228,7 @@
 }
 \def\ifsetfail{\doignore{ifset}}
 
-% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
+% @ifclear VAR ... @end executes the `...' iff VAR has never been
 % defined with @set, or has been undefined with @clear.
 %
 % The `\else' inside the `\doifset' parameter is a trick to reuse the
@@ -4217,6 +4239,35 @@
 \def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}}
 \def\ifclearfail{\doignore{ifclear}}
 
+% @ifcommandisdefined CMD ... @end executes the `...' if CMD (written
+% without the @) is in fact defined.  We can only feasibly check at the
+% TeX level, so something like `mathcode' is going to considered
+% defined even though it is not a Texinfo command.
+% 
+\makecond{ifcommanddefined}
+\def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}}
+%
+\def\doifcmddefined#1#2{{%
+    \makevalueexpandable
+    \let\next=\empty
+    \expandafter\ifx\csname #2\endcsname\relax
+      #1% If not defined, \let\next as above.
+    \fi
+    \expandafter
+  }\next
+}
+\def\ifcmddefinedfail{\doignore{ifcommanddefined}}
+
+% @ifcommandnotdefined CMD ... handled similar to @ifclear above.
+\makecond{ifcommandnotdefined}
+\def\ifcommandnotdefined{%
+  \parsearg{\doifcmddefined{\else \let\next=\ifcmdnotdefinedfail}}}
+\def\ifcmdnotdefinedfail{\doignore{ifcommandnotdefined}}
+
+% Set the `txicommandconditionals' variable, so documents have a way to
+% test if the @ifcommand...defined conditionals are available.
+\set txicommandconditionals
+
 % @dircategory CATEGORY  -- specify a category of the dir file
 % which this file should belong to.  Ignore this in TeX.
 \let\dircategory=\comment
@@ -5543,14 +5594,6 @@
 
 % Define @majorheading, @heading and @subheading
 
-% NOTE on use of \vbox for chapter headings, section headings, and such:
-%       1) We use \vbox rather than the earlier \line to permit
-%          overlong headings to fold.
-%       2) \hyphenpenalty is set to 10000 because hyphenation in a
-%          heading is obnoxious; this forbids it.
-%       3) Likewise, headings look best if no \parindent is used, and
-%          if justification is not attempted.  Hence \raggedright.
-
 \def\majorheading{%
   {\advance\chapheadingskip by 10pt \chapbreak }%
   \parsearg\chapheadingzzz
@@ -5558,10 +5601,8 @@
 
 \def\chapheading{\chapbreak \parsearg\chapheadingzzz}
 \def\chapheadingzzz#1{%
-  {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
-                    \parindent=0pt\ptexraggedright
-                    \rmisbold #1\hfill}}%
-  \bigskip \par\penalty 200\relax
+  \vbox{\chapfonts \raggedtitlesettings #1\par}%
+  \nobreak\bigskip \nobreak
   \suppressfirstparagraphindent
 }
 
@@ -5720,8 +5761,7 @@
     %
     % Typeset the actual heading.
     \nobreak % Avoid page breaks at the interline glue.
-    \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright
-          \hangindent=\wd0 \centerparametersmaybe
+    \vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe
           \unhbox0 #1\par}%
   }%
   \nobreak\bigskip % no page break after a chapter title
@@ -5743,18 +5783,18 @@
 \def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
 %
 \def\unnchfopen #1{%
-\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
-                       \parindent=0pt\ptexraggedright
-                       \rmisbold #1\hfill}}\bigskip \par\nobreak
+  \chapoddpage
+  \vbox{\chapfonts \raggedtitlesettings #1\par}%
+  \nobreak\bigskip\nobreak
 }
 \def\chfopen #1#2{\chapoddpage {\chapfonts
 \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
 \par\penalty 5000 %
 }
 \def\centerchfopen #1{%
-\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
-                       \parindent=0pt
-                       \hfill {\rmisbold #1}\hfill}}\bigskip \par\nobreak
+  \chapoddpage
+  \vbox{\chapfonts \raggedtitlesettings \hfill #1\hfill}%
+  \nobreak\bigskip \nobreak
 }
 \def\CHAPFopen{%
   \global\let\chapmacro=\chfopen
@@ -6520,16 +6560,9 @@
 \makedispenvdef{quotation}{\quotationstart}
 %
 \def\quotationstart{%
-  {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
-  \parindent=0pt
-  %
-  % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
+  \indentedblockstart % same as \indentedblock, but increase right margin too.
   \ifx\nonarrowing\relax
-    \advance\leftskip by \lispnarrowing
     \advance\rightskip by \lispnarrowing
-    \exdentamount = \lispnarrowing
-  \else
-    \let\nonarrowing = \relax
   \fi
   \parsearg\quotationlabel
 }
@@ -6555,6 +6588,32 @@
   \fi
 }
 
+% @indentedblock is like @quotation, but indents only on the left and
+% has no optional argument.
+% 
+\makedispenvdef{indentedblock}{\indentedblockstart}
+%
+\def\indentedblockstart{%
+  {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
+  \parindent=0pt
+  %
+  % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
+  \ifx\nonarrowing\relax
+    \advance\leftskip by \lispnarrowing
+    \exdentamount = \lispnarrowing
+  \else
+    \let\nonarrowing = \relax
+  \fi
+}
+
+% Keep a nonzero parskip for the environment, since we're doing normal filling.
+%
+\def\Eindentedblock{%
+  \par
+  {\parskip=0pt \afterenvbreak}%
+}
+\def\Esmallindentedblock{\Eindentedblock}
+
 
 % LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
 % If we want to allow any <char> as delimiter,
@@ -7033,7 +7092,10 @@
   \df \sl \hyphenchar\font=0
   %
   % On the other hand, if an argument has two dashes (for instance), we
-  % want a way to get ttsl.  Let's try @var for that.
+  % want a way to get ttsl.  We used to recommend @var for that, so
+  % leave the code in, but it's strange for @var to lead to typewriter.
+  % Nowadays we recommend @code, since the difference between a ttsl hyphen
+  % and a tt hyphen is pretty tiny.  @code also disables ?` !`.
   \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}%
   #1%
   \sl\hyphenchar\font=45
@@ -9931,22 +9993,26 @@
 @gdef@otherbackslash{@let\=@realbackslash}
 
 % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
-% the literal character `\'.
+% the literal character `\'.  Also revert - to its normal character, in
+% case the active - from code has slipped in.
 %
-@def@normalturnoffactive{%
-  @let"=@normaldoublequote
-  @let$=@normaldollar %$ font-lock fix
-  @let+=@normalplus
-  @let<=@normalless
-  @let>=@normalgreater
-  @let\=@normalbackslash
-  @let^=@normalcaret
-  @let_=@normalunderscore
-  @let|=@normalverticalbar
-  @let~=@normaltilde
-  @markupsetuplqdefault
-  @markupsetuprqdefault
-  @unsepspaces
+{@catcode`- = @active
+ @gdef@normalturnoffactive{%
+   @let-=@normaldash
+   @let"=@normaldoublequote
+   @let$=@normaldollar %$ font-lock fix
+   @let+=@normalplus
+   @let<=@normalless
+   @let>=@normalgreater
+   @let\=@normalbackslash
+   @let^=@normalcaret
+   @let_=@normalunderscore
+   @let|=@normalverticalbar
+   @let~=@normaltilde
+   @markupsetuplqdefault
+   @markupsetuprqdefault
+   @unsepspaces
+ }
 }
 
 % Make _ and + \other characters, temporarily.
diff --git a/Modules/_ctypes/libffi_msvc/ffi.c b/Modules/_ctypes/libffi_msvc/ffi.c
index 6e595e9..76cb03e 100644
--- a/Modules/_ctypes/libffi_msvc/ffi.c
+++ b/Modules/_ctypes/libffi_msvc/ffi.c
@@ -102,6 +102,15 @@
 	      FFI_ASSERT(0);
 	    }
 	}
+#ifdef _WIN64
+      else if (z > 8)
+        {
+          /* On Win64, if a single argument takes more than 8 bytes,
+             then it is always passed by reference. */
+          *(void **)argp = *p_argv;
+          z = 8;
+        }
+#endif
       else
 	{
 	  memcpy(argp, *p_argv, z);
@@ -124,7 +133,6 @@
   switch (cif->rtype->type)
     {
     case FFI_TYPE_VOID:
-    case FFI_TYPE_STRUCT:
     case FFI_TYPE_SINT64:
     case FFI_TYPE_FLOAT:
     case FFI_TYPE_DOUBLE:
@@ -132,6 +140,18 @@
       cif->flags = (unsigned) cif->rtype->type;
       break;
 
+    case FFI_TYPE_STRUCT:
+      /* MSVC returns small structures in registers.  Put in cif->flags
+         the value FFI_TYPE_STRUCT only if the structure is big enough;
+         otherwise, put the 4- or 8-bytes integer type. */
+      if (cif->rtype->size <= 4)
+        cif->flags = FFI_TYPE_INT;
+      else if (cif->rtype->size <= 8)
+        cif->flags = FFI_TYPE_SINT64;
+      else
+        cif->flags = FFI_TYPE_STRUCT;
+      break;
+
     case FFI_TYPE_UINT64:
 #ifdef _WIN64
     case FFI_TYPE_POINTER:
@@ -201,8 +221,7 @@
 #else
     case FFI_SYSV:
       /*@-usedef@*/
-      /* Function call needs at least 40 bytes stack size, on win64 AMD64 */
-      return ffi_call_AMD64(ffi_prep_args, &ecif, cif->bytes ? cif->bytes : 40,
+      return ffi_call_AMD64(ffi_prep_args, &ecif, cif->bytes,
 			   cif->flags, ecif.rvalue, fn);
       /*@=usedef@*/
       break;
@@ -227,7 +246,7 @@
 #else
 static void __fastcall
 #endif
-ffi_closure_SYSV (ffi_closure *closure, int *argp)
+ffi_closure_SYSV (ffi_closure *closure, char *argp)
 {
   // this is our return value storage
   long double    res;
@@ -237,7 +256,7 @@
   void         **arg_area;
   unsigned short rtype;
   void          *resp = (void*)&res;
-  void *args = &argp[1];
+  void *args = argp + sizeof(void*);
 
   cif         = closure->cif;
   arg_area    = (void**) alloca (cif->nargs * sizeof (void*));  
diff --git a/Modules/_ctypes/libffi_msvc/prep_cif.c b/Modules/_ctypes/libffi_msvc/prep_cif.c
index 2650fa0..b07a2e6 100644
--- a/Modules/_ctypes/libffi_msvc/prep_cif.c
+++ b/Modules/_ctypes/libffi_msvc/prep_cif.c
@@ -116,9 +116,9 @@
 #if !defined M68K && !defined __x86_64__ && !defined S390
   /* Make space for the return structure pointer */
   if (cif->rtype->type == FFI_TYPE_STRUCT
-      /* MSVC returns small structures in registers.  But we have a different
-      workaround: pretend int32 or int64 return type, and converting to
-      structure afterwards. */
+#ifdef _WIN32
+      && (cif->rtype->size > 8)  /* MSVC returns small structs in registers */
+#endif
 #ifdef SPARC
       && (cif->abi != FFI_V9 || cif->rtype->size > 32)
 #endif
@@ -145,6 +145,10 @@
 	      && cif->abi != FFI_V9))
 	bytes += sizeof(void*);
       else
+#elif defined (_WIN64)
+      if ((*ptr)->type == FFI_TYPE_STRUCT && ((*ptr)->size > 8))
+	    bytes += sizeof(void*);
+      else
 #endif
 	{
 #if !defined(_MSC_VER) && !defined(__MINGW32__)
@@ -168,6 +172,12 @@
 #endif
     }
 
+#ifdef _WIN64
+  /* Function call needs at least 40 bytes stack size, on win64 AMD64 */
+  if (bytes < 40)
+      bytes = 40;
+#endif
+
   cif->bytes = bytes;
 
   /* Perform machine dependent cif processing */
diff --git a/Modules/_ctypes/libffi_msvc/types.c b/Modules/_ctypes/libffi_msvc/types.c
index df32190..4433ac2 100644
--- a/Modules/_ctypes/libffi_msvc/types.c
+++ b/Modules/_ctypes/libffi_msvc/types.c
@@ -43,7 +43,7 @@
 FFI_INTEGRAL_TYPEDEF(float, 4, 4, FFI_TYPE_FLOAT);
 
 #if defined ALPHA || defined SPARC64 || defined X86_64 || defined S390X \
-    || defined IA64
+    || defined IA64 || defined _WIN64
 
 FFI_INTEGRAL_TYPEDEF(pointer, 8, 8, FFI_TYPE_POINTER);
 
diff --git a/Modules/_ctypes/libffi_osx/ffi.c b/Modules/_ctypes/libffi_osx/ffi.c
index bf42093..96826b5 100644
--- a/Modules/_ctypes/libffi_osx/ffi.c
+++ b/Modules/_ctypes/libffi_osx/ffi.c
@@ -38,12 +38,13 @@
 /*@out@*/	ffi_type*	arg)
 {
 /*@-usedef@*/
+	ffi_type**	ptr;
 
 	if (arg == NULL || arg->elements == NULL ||
 		arg->size != 0 || arg->alignment != 0)
 		return FFI_BAD_TYPEDEF;
 
-	ffi_type**	ptr = &(arg->elements[0]);
+    ptr = &(arg->elements[0]);
 
 	while ((*ptr) != NULL)
 	{
@@ -135,16 +136,16 @@
 /*@dependent@*/ /*@out@*/ /*@partial@*/ ffi_type*	rtype, 
 /*@dependent@*/			ffi_type**		atypes)
 {
+	unsigned int	bytes	= 0;
+	unsigned int	i;
+	ffi_type**		ptr;
+
 	if (cif == NULL)
 		return FFI_BAD_TYPEDEF;
 
 	if (abi <= FFI_FIRST_ABI || abi > FFI_DEFAULT_ABI)
 		return FFI_BAD_ABI;
 
-	unsigned int	bytes	= 0;
-	unsigned int	i;
-	ffi_type**		ptr;
-
 	cif->abi = abi;
 	cif->arg_types = atypes;
 	cif->nargs = nargs;
diff --git a/Modules/_ctypes/libffi_osx/x86/x86-ffi64.c b/Modules/_ctypes/libffi_osx/x86/x86-ffi64.c
index 2affb14..f2610c1 100644
--- a/Modules/_ctypes/libffi_osx/x86/x86-ffi64.c
+++ b/Modules/_ctypes/libffi_osx/x86/x86-ffi64.c
@@ -225,14 +225,16 @@
 			/* Merge the fields of structure.  */
 			for (ptr = type->elements; *ptr != NULL; ptr++)
 			{
+				int num, pos;
+
 				byte_offset = ALIGN(byte_offset, (*ptr)->alignment);
 
-				int	num = classify_argument(*ptr, subclasses, byte_offset % 8);
+				num = classify_argument(*ptr, subclasses, byte_offset % 8);
 
 				if (num == 0)
 					return 0;
 
-				int pos = byte_offset / 8;
+				pos = byte_offset / 8;
 
 				for (i = 0; i < num; i++)
 				{
@@ -589,11 +591,12 @@
 	void			(*fun)(ffi_cif*, void*, void**, void*),
 	void*			user_data)
 {
+		volatile unsigned short*	tramp;
+
 	if (cif->abi != FFI_UNIX64)
 		return FFI_BAD_ABI;
 
-	volatile unsigned short*	tramp =
-		(volatile unsigned short*)&closure->tramp[0];
+	tramp = (volatile unsigned short*)&closure->tramp[0];
 
 	tramp[0] = 0xbb49;		/* mov <code>, %r11	*/
 	*(void* volatile*)&tramp[1] = ffi_closure_unix64;
diff --git a/Modules/_ctypes/stgdict.c b/Modules/_ctypes/stgdict.c
index 25d9996..728f751 100644
--- a/Modules/_ctypes/stgdict.c
+++ b/Modules/_ctypes/stgdict.c
@@ -417,6 +417,8 @@
            that). Use 'B' for bytes. */
         stgdict->format = _ctypes_alloc_format_string(NULL, "B");
     }
+    if (stgdict->format == NULL)
+        return -1;
 
 #define realdict ((PyObject *)&stgdict->dict)
     for (i = 0; i < len; ++i) {
@@ -483,7 +485,7 @@
             char *fieldfmt = dict->format ? dict->format : "B";
             char *fieldname = _PyUnicode_AsString(name);
             char *ptr;
-            Py_ssize_t len; 
+            Py_ssize_t len;
             char *buf;
 
             if (fieldname == NULL)
@@ -503,7 +505,12 @@
             sprintf(buf, "%s:%s:", fieldfmt, fieldname);
 
             ptr = stgdict->format;
-            stgdict->format = _ctypes_alloc_format_string(stgdict->format, buf);
+            if (dict->shape != NULL) {
+                stgdict->format = _ctypes_alloc_format_string_with_shape(
+                    dict->ndim, dict->shape, stgdict->format, buf);
+            } else {
+                stgdict->format = _ctypes_alloc_format_string(stgdict->format, buf);
+            }
             PyMem_Free(ptr);
             PyMem_Free(buf);
 
diff --git a/Modules/_curses_panel.c b/Modules/_curses_panel.c
index f560702..87b9c05 100644
--- a/Modules/_curses_panel.c
+++ b/Modules/_curses_panel.c
@@ -117,7 +117,7 @@
 {
     list_of_panels *new;
 
-    if ((new = (list_of_panels *)malloc(sizeof(list_of_panels))) == NULL) {
+    if ((new = (list_of_panels *)PyMem_Malloc(sizeof(list_of_panels))) == NULL) {
         PyErr_NoMemory();
         return -1;
     }
@@ -136,7 +136,7 @@
     temp = lop;
     if (temp->po == po) {
         lop = temp->next;
-        free(temp);
+        PyMem_Free(temp);
         return;
     }
     while (temp->next == NULL || temp->next->po != po) {
@@ -148,7 +148,7 @@
         temp = temp->next;
     }
     n = temp->next->next;
-    free(temp->next);
+    PyMem_Free(temp->next);
     temp->next = n;
     return;
 }
@@ -513,6 +513,8 @@
         goto fail;
 
     import_curses();
+    if (PyErr_Occurred())
+        goto fail;
 
     /* For exception _curses_panel.error */
     _curses_panelstate(m)->PyCursesError = PyErr_NewException("_curses_panel.error", NULL, NULL);
diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c
index 13cfcf5..5ffce2f 100644
--- a/Modules/_cursesmodule.c
+++ b/Modules/_cursesmodule.c
@@ -134,6 +134,12 @@
 #define STRICT_SYSV_CURSES
 #endif
 
+/*[clinic input]
+module curses
+class curses.window "PyCursesWindowObject *" "&PyCursesWindow_Type"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=88c860abdbb50e0c]*/
+
 /* Definition of exception curses.error */
 
 static PyObject *PyCursesError;
@@ -168,10 +174,6 @@
                         "must call start_color() first");       \
         return 0; }
 
-#ifndef MIN
-#define MIN(x,y) ((x) < (y) ? (x) : (y))
-#endif
-
 /* Utility Functions */
 
 /*
@@ -533,7 +535,7 @@
     wo = PyObject_NEW(PyCursesWindowObject, &PyCursesWindow_Type);
     if (wo == NULL) return NULL;
     wo->win = win;
-    wo->encoding = strdup(encoding);
+    wo->encoding = _PyMem_Strdup(encoding);
     if (wo->encoding == NULL) {
         Py_DECREF(wo);
         PyErr_NoMemory();
@@ -547,74 +549,145 @@
 {
     if (wo->win != stdscr) delwin(wo->win);
     if (wo->encoding != NULL)
-        free(wo->encoding);
+        PyMem_Free(wo->encoding);
     PyObject_DEL(wo);
 }
 
 /* Addch, Addstr, Addnstr */
 
+/*[clinic input]
+
+curses.window.addch
+
+    [
+    y: int
+      Y-coordinate.
+    x: int
+      X-coordinate.
+    ]
+
+    ch: object
+      Character to add.
+
+    [
+    attr: long
+      Attributes for the character.
+    ]
+    /
+
+Paint character ch at (y, x) with attributes attr.
+
+Paint character ch at (y, x) with attributes attr,
+overwriting any character previously painted at that location.
+By default, the character position and attributes are the
+current settings for the window object.
+[clinic start generated code]*/
+
+PyDoc_STRVAR(curses_window_addch__doc__,
+"addch([y, x,] ch, [attr])\n"
+"Paint character ch at (y, x) with attributes attr.\n"
+"\n"
+"  y\n"
+"    Y-coordinate.\n"
+"  x\n"
+"    X-coordinate.\n"
+"  ch\n"
+"    Character to add.\n"
+"  attr\n"
+"    Attributes for the character.\n"
+"\n"
+"Paint character ch at (y, x) with attributes attr,\n"
+"overwriting any character previously painted at that location.\n"
+"By default, the character position and attributes are the\n"
+"current settings for the window object.");
+
+#define CURSES_WINDOW_ADDCH_METHODDEF    \
+    {"addch", (PyCFunction)curses_window_addch, METH_VARARGS, curses_window_addch__doc__},
+
 static PyObject *
-PyCursesWindow_AddCh(PyCursesWindowObject *self, PyObject *args)
+curses_window_addch_impl(PyCursesWindowObject *self, int group_left_1, int y, int x, PyObject *ch, int group_right_1, long attr);
+
+static PyObject *
+curses_window_addch(PyCursesWindowObject *self, PyObject *args)
 {
-    int rtn, x, y, use_xy = FALSE;
-    PyObject *chobj;
+    PyObject *return_value = NULL;
+    int group_left_1 = 0;
+    int y = 0;
+    int x = 0;
+    PyObject *ch;
+    int group_right_1 = 0;
+    long attr = 0;
+
+    switch (PyTuple_GET_SIZE(args)) {
+        case 1:
+            if (!PyArg_ParseTuple(args, "O:addch", &ch))
+                goto exit;
+            break;
+        case 2:
+            if (!PyArg_ParseTuple(args, "Ol:addch", &ch, &attr))
+                goto exit;
+            group_right_1 = 1;
+            break;
+        case 3:
+            if (!PyArg_ParseTuple(args, "iiO:addch", &y, &x, &ch))
+                goto exit;
+            group_left_1 = 1;
+            break;
+        case 4:
+            if (!PyArg_ParseTuple(args, "iiOl:addch", &y, &x, &ch, &attr))
+                goto exit;
+            group_right_1 = 1;
+            group_left_1 = 1;
+            break;
+        default:
+            PyErr_SetString(PyExc_TypeError, "curses.window.addch requires 1 to 4 arguments");
+            goto exit;
+    }
+    return_value = curses_window_addch_impl(self, group_left_1, y, x, ch, group_right_1, attr);
+
+exit:
+    return return_value;
+}
+
+static PyObject *
+curses_window_addch_impl(PyCursesWindowObject *self, int group_left_1, int y, int x, PyObject *ch, int group_right_1, long attr)
+/*[clinic end generated code: output=d4b97cc287010c54 input=5a41efb34a2de338]*/
+{
+    PyCursesWindowObject *cwself = (PyCursesWindowObject *)self;
+    int coordinates_group = group_left_1;
+    int attr_group = group_right_1;
+    int rtn;
     int type;
-    chtype ch;
+    chtype cch;
 #ifdef HAVE_NCURSESW
     cchar_t wch;
 #endif
-    attr_t attr = A_NORMAL;
-    long lattr;
     const char *funcname;
 
-    switch (PyTuple_Size(args)) {
-    case 1:
-        if (!PyArg_ParseTuple(args, "O;ch or int", &chobj))
-            return NULL;
-        break;
-    case 2:
-        if (!PyArg_ParseTuple(args, "Ol;ch or int,attr", &chobj, &lattr))
-            return NULL;
-        attr = lattr;
-        break;
-    case 3:
-        if (!PyArg_ParseTuple(args,"iiO;y,x,ch or int", &y, &x, &chobj))
-            return NULL;
-        use_xy = TRUE;
-        break;
-    case 4:
-        if (!PyArg_ParseTuple(args,"iiOl;y,x,ch or int, attr",
-                              &y, &x, &chobj, &lattr))
-            return NULL;
-        attr = lattr;
-        use_xy = TRUE;
-        break;
-    default:
-        PyErr_SetString(PyExc_TypeError, "addch requires 1 to 4 arguments");
-        return NULL;
-    }
+    if (!attr_group)
+      attr = A_NORMAL;
 
 #ifdef HAVE_NCURSESW
-    type = PyCurses_ConvertToCchar_t(self, chobj, &ch, &wch);
+    type = PyCurses_ConvertToCchar_t(cwself, ch, &cch, &wch);
     if (type == 2) {
         funcname = "add_wch";
         wch.attr = attr;
-        if (use_xy == TRUE)
-            rtn = mvwadd_wch(self->win,y,x, &wch);
+        if (coordinates_group)
+            rtn = mvwadd_wch(cwself->win,y,x, &wch);
         else {
-            rtn = wadd_wch(self->win, &wch);
+            rtn = wadd_wch(cwself->win, &wch);
         }
     }
     else
 #else
-    type = PyCurses_ConvertToCchar_t(self, chobj, &ch);
+    type = PyCurses_ConvertToCchar_t(cwself, ch, &cch);
 #endif
     if (type == 1) {
         funcname = "addch";
-        if (use_xy == TRUE)
-            rtn = mvwaddch(self->win,y,x, ch | attr);
+        if (coordinates_group)
+            rtn = mvwaddch(cwself->win,y,x, cch | attr);
         else {
-            rtn = waddch(self->win, ch | attr);
+            rtn = waddch(cwself->win, cch | attr);
         }
     }
     else {
@@ -1212,7 +1285,7 @@
         if (!PyArg_ParseTuple(args,"i;n", &n))
             return NULL;
         Py_BEGIN_ALLOW_THREADS
-        rtn2 = wgetnstr(self->win,rtn,MIN(n, 1023));
+        rtn2 = wgetnstr(self->win, rtn, Py_MIN(n, 1023));
         Py_END_ALLOW_THREADS
         break;
     case 2:
@@ -1232,11 +1305,11 @@
 #ifdef STRICT_SYSV_CURSES
         Py_BEGIN_ALLOW_THREADS
         rtn2 = wmove(self->win,y,x)==ERR ? ERR :
-        wgetnstr(self->win, rtn, MIN(n, 1023));
+        wgetnstr(self->win, rtn, Py_MIN(n, 1023));
         Py_END_ALLOW_THREADS
 #else
         Py_BEGIN_ALLOW_THREADS
-        rtn2 = mvwgetnstr(self->win, y, x, rtn, MIN(n, 1023));
+        rtn2 = mvwgetnstr(self->win, y, x, rtn, Py_MIN(n, 1023));
         Py_END_ALLOW_THREADS
 #endif
         break;
@@ -1375,7 +1448,7 @@
     case 1:
         if (!PyArg_ParseTuple(args,"i;n", &n))
             return NULL;
-        rtn2 = winnstr(self->win,rtn,MIN(n,1023));
+        rtn2 = winnstr(self->win, rtn, Py_MIN(n, 1023));
         break;
     case 2:
         if (!PyArg_ParseTuple(args,"ii;y,x",&y,&x))
@@ -1385,7 +1458,7 @@
     case 3:
         if (!PyArg_ParseTuple(args, "iii;y,x,n", &y, &x, &n))
             return NULL;
-        rtn2 = mvwinnstr(self->win, y, x, rtn, MIN(n,1023));
+        rtn2 = mvwinnstr(self->win, y, x, rtn, Py_MIN(n,1023));
         break;
     default:
         PyErr_SetString(PyExc_TypeError, "instr requires 0 or 3 arguments");
@@ -1699,26 +1772,24 @@
     /* We have to simulate this by writing to a temporary FILE*,
        then reading back, then writing to the argument stream. */
     char fn[100];
-    int fd;
-    FILE *fp;
-    PyObject *res;
+    int fd = -1;
+    FILE *fp = NULL;
+    PyObject *res = NULL;
 
     strcpy(fn, "/tmp/py.curses.putwin.XXXXXX");
     fd = mkstemp(fn);
     if (fd < 0)
         return PyErr_SetFromErrnoWithFilename(PyExc_IOError, fn);
+    if (_Py_set_inheritable(fd, 0, NULL) < 0)
+        goto exit;
     fp = fdopen(fd, "wb+");
     if (fp == NULL) {
-        close(fd);
-        remove(fn);
-        return PyErr_SetFromErrnoWithFilename(PyExc_IOError, fn);
+        PyErr_SetFromErrnoWithFilename(PyExc_IOError, fn);
+        goto exit;
     }
     res = PyCursesCheckERR(putwin(self->win, fp), "putwin");
-    if (res == NULL) {
-        fclose(fp);
-        remove(fn);
-        return res;
-    }
+    if (res == NULL)
+        goto exit;
     fseek(fp, 0, 0);
     while (1) {
         char buf[BUFSIZ];
@@ -1732,7 +1803,12 @@
         if (res == NULL)
             break;
     }
-    fclose(fp);
+
+exit:
+    if (fp != NULL)
+        fclose(fp);
+    else if (fd != -1)
+        close(fd);
     remove(fn);
     return res;
 }
@@ -1943,20 +2019,20 @@
     ascii = PyUnicode_AsASCIIString(value);
     if (ascii == NULL)
         return -1;
-    encoding = strdup(PyBytes_AS_STRING(ascii));
+    encoding = _PyMem_Strdup(PyBytes_AS_STRING(ascii));
     Py_DECREF(ascii);
     if (encoding == NULL) {
         PyErr_NoMemory();
         return -1;
     }
-    free(self->encoding);
+    PyMem_Free(self->encoding);
     self->encoding = encoding;
     return 0;
 }
 
 
 static PyMethodDef PyCursesWindow_Methods[] = {
-    {"addch",           (PyCFunction)PyCursesWindow_AddCh, METH_VARARGS},
+    CURSES_WINDOW_ADDCH_METHODDEF
     {"addnstr",         (PyCFunction)PyCursesWindow_AddNStr, METH_VARARGS},
     {"addstr",          (PyCFunction)PyCursesWindow_AddStr, METH_VARARGS},
     {"attroff",         (PyCFunction)PyCursesWindow_AttrOff, METH_VARARGS},
@@ -2012,8 +2088,6 @@
     {"nodelay",         (PyCFunction)PyCursesWindow_nodelay, METH_VARARGS},
     {"notimeout",       (PyCFunction)PyCursesWindow_notimeout, METH_VARARGS},
     {"noutrefresh",     (PyCFunction)PyCursesWindow_NoOutRefresh, METH_VARARGS},
-    /* Backward compatibility alias -- remove in Python 2.3 */
-    {"nooutrefresh",    (PyCFunction)PyCursesWindow_NoOutRefresh, METH_VARARGS},
     {"overlay",         (PyCFunction)PyCursesWindow_Overlay, METH_VARARGS},
     {"overwrite",       (PyCFunction)PyCursesWindow_Overwrite,
      METH_VARARGS},
@@ -2257,12 +2331,13 @@
 PyCurses_GetWin(PyCursesWindowObject *self, PyObject *stream)
 {
     char fn[100];
-    int fd;
-    FILE *fp;
+    int fd = -1;
+    FILE *fp = NULL;
     PyObject *data;
     size_t datalen;
     WINDOW *win;
     _Py_IDENTIFIER(read);
+    PyObject *res = NULL;
 
     PyCursesInitialised;
 
@@ -2270,44 +2345,47 @@
     fd = mkstemp(fn);
     if (fd < 0)
         return PyErr_SetFromErrnoWithFilename(PyExc_IOError, fn);
+    if (_Py_set_inheritable(fd, 0, NULL) < 0)
+        goto error;
     fp = fdopen(fd, "wb+");
     if (fp == NULL) {
-        close(fd);
-        remove(fn);
-        return PyErr_SetFromErrnoWithFilename(PyExc_IOError, fn);
+        PyErr_SetFromErrnoWithFilename(PyExc_IOError, fn);
+        goto error;
     }
+
     data = _PyObject_CallMethodId(stream, &PyId_read, "");
-    if (data == NULL) {
-        fclose(fp);
-        remove(fn);
-        return NULL;
-    }
+    if (data == NULL)
+        goto error;
     if (!PyBytes_Check(data)) {
         PyErr_Format(PyExc_TypeError,
                      "f.read() returned %.100s instead of bytes",
                      data->ob_type->tp_name);
         Py_DECREF(data);
-        fclose(fp);
-        remove(fn);
-        return NULL;
+        goto error;
     }
     datalen = PyBytes_GET_SIZE(data);
     if (fwrite(PyBytes_AS_STRING(data), 1, datalen, fp) != datalen) {
         Py_DECREF(data);
-        fclose(fp);
-        remove(fn);
-        return PyErr_SetFromErrnoWithFilename(PyExc_IOError, fn);
+        PyErr_SetFromErrnoWithFilename(PyExc_IOError, fn);
+        goto error;
     }
     Py_DECREF(data);
+
     fseek(fp, 0, 0);
     win = getwin(fp);
-    fclose(fp);
-    remove(fn);
     if (win == NULL) {
         PyErr_SetString(PyCursesError, catchall_NULL);
-        return NULL;
+        goto error;
     }
-    return PyCursesWindow_New(win, NULL);
+    res = PyCursesWindow_New(win, NULL);
+
+error:
+    if (fp != NULL)
+        fclose(fp);
+    else if (fd != -1)
+        close(fd);
+    remove(fn);
+    return res;
 }
 
 static PyObject *
@@ -3415,7 +3493,7 @@
                 continue;
             if (strncmp(key_n,"KEY_F(",6)==0) {
                 char *p1, *p2;
-                key_n2 = malloc(strlen(key_n)+1);
+                key_n2 = PyMem_Malloc(strlen(key_n)+1);
                 if (!key_n2) {
                     PyErr_NoMemory();
                     break;
@@ -3434,7 +3512,7 @@
                 key_n2 = key_n;
             SetDictInt(key_n2,key);
             if (key_n2 != key_n)
-                free(key_n2);
+                PyMem_Free(key_n2);
         }
 #endif
         SetDictInt("KEY_MIN", KEY_MIN);
diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c
index fa231d9..d8225ba 100644
--- a/Modules/_datetimemodule.c
+++ b/Modules/_datetimemodule.c
@@ -16,6 +16,12 @@
 #include "datetime.h"
 #undef Py_BUILD_CORE
 
+/*[clinic input]
+module datetime
+class datetime.datetime "PyDateTime_DateTime *" "&PyDateTime_DateTimeType"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=78142cb64b9e98bc]*/
+
 /* We require that C int be at least 32 bits, and use int virtually
  * everywhere.  In just a few cases we use a temp long, where a Python
  * API returns a C long.  In such cases, we have to ensure that the
@@ -104,6 +110,11 @@
 static PyTypeObject PyDateTime_TZInfoType;
 static PyTypeObject PyDateTime_TimeZoneType;
 
+_Py_IDENTIFIER(as_integer_ratio);
+_Py_IDENTIFIER(fromutc);
+_Py_IDENTIFIER(isoformat);
+_Py_IDENTIFIER(strftime);
+
 /* ---------------------------------------------------------------------------
  * Math utilities.
  */
@@ -140,19 +151,6 @@
     return quo;
 }
 
-/* Round a double to the nearest long.  |x| must be small enough to fit
- * in a C long; this is not checked.
- */
-static long
-round_to_long(double x)
-{
-    if (x >= 0.0)
-        x = floor(x + 0.5);
-    else
-        x = ceil(x - 0.5);
-    return (long)x;
-}
-
 /* Nearest integer to m / n for integers m and n. Half-integer results
  * are rounded to even.
  */
@@ -615,7 +613,7 @@
                 sizeof(_PyDateTime_BaseTime));
     if (self == NULL)
         return (PyObject *)PyErr_NoMemory();
-    PyObject_INIT(self, type);
+    (void)PyObject_INIT(self, type);
     return self;
 }
 
@@ -630,7 +628,7 @@
                 sizeof(_PyDateTime_BaseDateTime));
     if (self == NULL)
         return (PyObject *)PyErr_NoMemory();
-    PyObject_INIT(self, type);
+    (void)PyObject_INIT(self, type);
     return self;
 }
 
@@ -899,11 +897,11 @@
         }
     }
     else {
-        Py_DECREF(offset);
         PyErr_Format(PyExc_TypeError,
                      "tzinfo.%s() must return None or "
                      "timedelta, not '%.200s'",
                      name, Py_TYPE(offset)->tp_name);
+        Py_DECREF(offset);
         return NULL;
     }
 
@@ -1290,8 +1288,6 @@
             goto Done;
         format = PyUnicode_FromString(PyBytes_AS_STRING(newfmt));
         if (format != NULL) {
-            _Py_IDENTIFIER(strftime);
-
             result = _PyObject_CallMethodId(time, &PyId_strftime, "OO",
                                             format, timetuple, NULL);
             Py_DECREF(format);
@@ -1397,7 +1393,7 @@
  */
 
 /* Conversion factors. */
-static PyObject *us_per_us = NULL;      /* 1 */
+static PyObject *one = NULL;      /* 1 */
 static PyObject *us_per_ms = NULL;      /* 1000 */
 static PyObject *us_per_second = NULL;  /* 1000000 */
 static PyObject *us_per_minute = NULL;  /* 1e6 * 60 as Python int */
@@ -1579,7 +1575,6 @@
     PyObject *result = NULL;
     PyObject *pyus_in = NULL, *temp, *pyus_out;
     PyObject *ratio = NULL;
-    _Py_IDENTIFIER(as_integer_ratio);
 
     pyus_in = delta_to_microseconds(delta);
     if (pyus_in == NULL)
@@ -1678,7 +1673,6 @@
     PyObject *result = NULL;
     PyObject *pyus_in = NULL, *temp, *pyus_out;
     PyObject *ratio = NULL;
-    _Py_IDENTIFIER(as_integer_ratio);
 
     pyus_in = delta_to_microseconds(delta);
     if (pyus_in == NULL)
@@ -2119,7 +2113,7 @@
         goto Done
 
     if (us) {
-        y = accum("microseconds", x, us, us_per_us, &leftover_us);
+        y = accum("microseconds", x, us, one, &leftover_us);
         CLEANUP;
     }
     if (ms) {
@@ -2148,7 +2142,33 @@
     }
     if (leftover_us) {
         /* Round to nearest whole # of us, and add into x. */
-        PyObject *temp = PyLong_FromLong(round_to_long(leftover_us));
+        double whole_us = round(leftover_us);
+        int x_is_odd;
+        PyObject *temp;
+
+        whole_us = round(leftover_us);
+        if (fabs(whole_us - leftover_us) == 0.5) {
+            /* We're exactly halfway between two integers.  In order
+             * to do round-half-to-even, we must determine whether x
+             * is odd. Note that x is odd when it's last bit is 1. The
+             * code below uses bitwise and operation to check the last
+             * bit. */
+            temp = PyNumber_And(x, one);  /* temp <- x & 1 */
+            if (temp == NULL) {
+                Py_DECREF(x);
+                goto Done;
+            }
+            x_is_odd = PyObject_IsTrue(temp);
+            Py_DECREF(temp);
+            if (x_is_odd == -1) {
+                Py_DECREF(x);
+                goto Done;
+            }
+            whole_us = 2.0 * round((leftover_us + x_is_odd) * 0.5) - x_is_odd;
+        }
+
+        temp = PyLong_FromLong((long)whole_us);
+
         if (temp == NULL) {
             Py_DECREF(x);
             goto Done;
@@ -2239,22 +2259,14 @@
 {
     PyObject *total_seconds;
     PyObject *total_microseconds;
-    PyObject *one_million;
 
     total_microseconds = delta_to_microseconds((PyDateTime_Delta *)self);
     if (total_microseconds == NULL)
         return NULL;
 
-    one_million = PyLong_FromLong(1000000L);
-    if (one_million == NULL) {
-        Py_DECREF(total_microseconds);
-        return NULL;
-    }
-
-    total_seconds = PyNumber_TrueDivide(total_microseconds, one_million);
+    total_seconds = PyNumber_TrueDivide(total_microseconds, us_per_second);
 
     Py_DECREF(total_microseconds);
-    Py_DECREF(one_million);
     return total_seconds;
 }
 
@@ -2447,7 +2459,7 @@
     struct tm *tm;
     time_t t;
 
-    if (_PyTime_ObjectToTime_t(obj, &t) == -1)
+    if (_PyTime_ObjectToTime_t(obj, &t, _PyTime_ROUND_DOWN) == -1)
         return NULL;
 
     tm = localtime(&t);
@@ -2630,8 +2642,6 @@
 static PyObject *
 date_str(PyDateTime_Date *self)
 {
-    _Py_IDENTIFIER(isoformat);
-
     return _PyObject_CallMethodId((PyObject *)self, &PyId_isoformat, "()");
 }
 
@@ -2671,7 +2681,6 @@
 date_format(PyDateTime_Date *self, PyObject *args)
 {
     PyObject *format;
-    _Py_IDENTIFIER(strftime);
 
     if (!PyArg_ParseTuple(args, "U:__format__", &format))
         return NULL;
@@ -3215,10 +3224,10 @@
     if (op != Py_EQ && op != Py_NE)
         Py_RETURN_NOTIMPLEMENTED;
     if (Py_TYPE(other) != &PyDateTime_TimeZoneType) {
-	if (op == Py_EQ)
-	    Py_RETURN_FALSE;
-	else
-	    Py_RETURN_TRUE;
+        if (op == Py_EQ)
+            Py_RETURN_FALSE;
+        else
+            Py_RETURN_TRUE;
     }
     return delta_richcompare(self->offset, other->offset, op);
 }
@@ -3588,8 +3597,6 @@
 static PyObject *
 time_str(PyDateTime_Time *self)
 {
-    _Py_IDENTIFIER(isoformat);
-
     return _PyObject_CallMethodId((PyObject *)self, &PyId_isoformat, "()");
 }
 
@@ -4120,7 +4127,7 @@
     time_t timet;
     long us;
 
-    if (_PyTime_ObjectToTimeval(timestamp, &timet, &us) == -1)
+    if (_PyTime_ObjectToTimeval(timestamp, &timet, &us, _PyTime_ROUND_DOWN) == -1)
         return NULL;
     return datetime_from_timet_and_us(cls, f, timet, (int)us, tzinfo);
 }
@@ -4138,31 +4145,73 @@
                                       tzinfo);
 }
 
-/* Return best possible local time -- this isn't constrained by the
- * precision of a timestamp.
- */
+/*[clinic input]
+
+@classmethod
+datetime.datetime.now
+
+    tz: object = None
+        Timezone object.
+
+Returns new datetime object representing current time local to tz.
+
+If no tz is specified, uses local timezone.
+[clinic start generated code]*/
+
+PyDoc_STRVAR(datetime_datetime_now__doc__,
+"now($type, /, tz=None)\n"
+"--\n"
+"\n"
+"Returns new datetime object representing current time local to tz.\n"
+"\n"
+"  tz\n"
+"    Timezone object.\n"
+"\n"
+"If no tz is specified, uses local timezone.");
+
+#define DATETIME_DATETIME_NOW_METHODDEF    \
+    {"now", (PyCFunction)datetime_datetime_now, METH_VARARGS|METH_KEYWORDS|METH_CLASS, datetime_datetime_now__doc__},
+
 static PyObject *
-datetime_now(PyObject *cls, PyObject *args, PyObject *kw)
+datetime_datetime_now_impl(PyTypeObject *type, PyObject *tz);
+
+static PyObject *
+datetime_datetime_now(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+    PyObject *return_value = NULL;
+    static char *_keywords[] = {"tz", NULL};
+    PyObject *tz = Py_None;
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+        "|O:now", _keywords,
+        &tz))
+        goto exit;
+    return_value = datetime_datetime_now_impl(type, tz);
+
+exit:
+    return return_value;
+}
+
+static PyObject *
+datetime_datetime_now_impl(PyTypeObject *type, PyObject *tz)
+/*[clinic end generated code: output=583c5637e3c843fa input=80d09869c5267d00]*/
 {
     PyObject *self;
-    PyObject *tzinfo = Py_None;
-    static char *keywords[] = {"tz", NULL};
 
-    if (! PyArg_ParseTupleAndKeywords(args, kw, "|O:now", keywords,
-                                      &tzinfo))
-        return NULL;
-    if (check_tzinfo_subclass(tzinfo) < 0)
+    /* Return best possible local time -- this isn't constrained by the
+     * precision of a timestamp.
+     */
+    if (check_tzinfo_subclass(tz) < 0)
         return NULL;
 
-    self = datetime_best_possible(cls,
-                                  tzinfo == Py_None ? localtime : gmtime,
-                                  tzinfo);
-    if (self != NULL && tzinfo != Py_None) {
+    self = datetime_best_possible((PyObject *)type,
+                                  tz == Py_None ? localtime : gmtime,
+                                  tz);
+    if (self != NULL && tz != Py_None) {
         /* Convert UTC to tzinfo's zone. */
         PyObject *temp = self;
-        _Py_IDENTIFIER(fromutc);
 
-        self = _PyObject_CallMethodId(tzinfo, &PyId_fromutc, "O", self);
+        self = _PyObject_CallMethodId(tz, &PyId_fromutc, "O", self);
         Py_DECREF(temp);
     }
     return self;
@@ -4199,7 +4248,6 @@
     if (self != NULL && tzinfo != Py_None) {
         /* Convert UTC to tzinfo's zone. */
         PyObject *temp = self;
-        _Py_IDENTIFIER(fromutc);
 
         self = _PyObject_CallMethodId(tzinfo, &PyId_fromutc, "O", self);
         Py_DECREF(temp);
@@ -4421,6 +4469,9 @@
             delta_us = DATE_GET_MICROSECOND(left) -
                        DATE_GET_MICROSECOND(right);
             result = new_delta(delta_d, delta_s, delta_us, 1);
+            if (result == NULL)
+                return NULL;
+
             if (offdiff != NULL) {
                 PyObject *temp = result;
                 result = delta_subtract(result, offdiff);
@@ -4482,8 +4533,6 @@
 static PyObject *
 datetime_str(PyDateTime_DateTime *self)
 {
-    _Py_IDENTIFIER(isoformat);
-
     return _PyObject_CallMethodId((PyObject *)self, &PyId_isoformat, "(s)", " ");
 }
 
@@ -4749,7 +4798,7 @@
             goto error;
     }
     result = new_timezone(delta, nameo);
-    Py_DECREF(nameo);
+    Py_XDECREF(nameo);
   error:
     Py_DECREF(delta);
     return result;
@@ -4762,11 +4811,10 @@
     PyObject *offset;
     PyObject *temp;
     PyObject *tzinfo = Py_None;
-    _Py_IDENTIFIER(fromutc);
     static char *keywords[] = {"tz", NULL};
 
     if (! PyArg_ParseTupleAndKeywords(args, kw, "|O:astimezone", keywords,
-				      &tzinfo))
+                                      &tzinfo))
         return NULL;
 
     if (check_tzinfo_subclass(tzinfo) == -1)
@@ -4873,9 +4921,16 @@
         time.tm_wday = -1;
         time.tm_isdst = -1;
         timestamp = mktime(&time);
-        /* Return value of -1 does not necessarily mean an error, but tm_wday
-         * cannot remain set to -1 if mktime succeeded. */
-        if (timestamp == (time_t)(-1) && time.tm_wday == -1) {
+        if (timestamp == (time_t)(-1)
+#ifndef _AIX
+            /* Return value of -1 does not necessarily mean an error,
+             * but tm_wday cannot remain set to -1 if mktime succeeded. */
+            && time.tm_wday == -1
+#else
+            /* on AIX, tm_wday is always sets, even on error */
+#endif
+          )
+        {
             PyErr_SetString(PyExc_OverflowError,
                             "timestamp out of range");
             return NULL;
@@ -4989,9 +5044,7 @@
 
     /* Class methods: */
 
-    {"now",         (PyCFunction)datetime_now,
-     METH_VARARGS | METH_KEYWORDS | METH_CLASS,
-     PyDoc_STR("[tz] -> new datetime with tz's local day and time.")},
+    DATETIME_DATETIME_NOW_METHODDEF
 
     {"utcnow",         (PyCFunction)datetime_utcnow,
      METH_NOARGS | METH_CLASS,
@@ -5299,8 +5352,8 @@
       return NULL;
 
     /* module initialization */
-    PyModule_AddIntConstant(m, "MINYEAR", MINYEAR);
-    PyModule_AddIntConstant(m, "MAXYEAR", MAXYEAR);
+    PyModule_AddIntMacro(m, MINYEAR);
+    PyModule_AddIntMacro(m, MAXYEAR);
 
     Py_INCREF(&PyDateTime_DateType);
     PyModule_AddObject(m, "date", (PyObject *) &PyDateTime_DateType);
@@ -5344,12 +5397,12 @@
     assert(DI100Y == 25 * DI4Y - 1);
     assert(DI100Y == days_before_year(100+1));
 
-    us_per_us = PyLong_FromLong(1);
+    one = PyLong_FromLong(1);
     us_per_ms = PyLong_FromLong(1000);
     us_per_second = PyLong_FromLong(1000000);
     us_per_minute = PyLong_FromLong(60000000);
     seconds_per_day = PyLong_FromLong(24 * 3600);
-    if (us_per_us == NULL || us_per_ms == NULL || us_per_second == NULL ||
+    if (one == NULL || us_per_ms == NULL || us_per_second == NULL ||
         us_per_minute == NULL || seconds_per_day == NULL)
         return NULL;
 
diff --git a/Modules/_dbmmodule.c b/Modules/_dbmmodule.c
index 83c051c..93ea416 100644
--- a/Modules/_dbmmodule.c
+++ b/Modules/_dbmmodule.c
@@ -14,11 +14,7 @@
  */
 #if defined(HAVE_NDBM_H)
 #include <ndbm.h>
-#if defined(PYOS_OS2) && !defined(PYCC_GCC)
-static char *which_dbm = "ndbm";
-#else
 static char *which_dbm = "GNU gdbm";  /* EMX port of GDBM */
-#endif
 #elif defined(HAVE_GDBM_NDBM_H)
 #include <gdbm/ndbm.h>
 static char *which_dbm = "GNU gdbm";
@@ -32,6 +28,12 @@
 #error "No ndbm.h available!"
 #endif
 
+/*[clinic input]
+module dbm
+class dbm.dbm "dbmobject *" "&Dbmtype"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=92450564684a69a3]*/
+
 typedef struct {
     PyObject_HEAD
     int di_size;        /* -1 means recompute */
@@ -47,8 +49,17 @@
 
 static PyObject *DbmError;
 
+/*[python input]
+class dbmobject_converter(self_converter):
+    type = "dbmobject *"
+    def pre_render(self):
+        super().pre_render()
+        self.name = 'dp'
+[python start generated code]*/
+/*[python end generated code: output=da39a3ee5e6b4b0d input=6ad536357913879a]*/
+
 static PyObject *
-newdbmobject(char *file, int flags, int mode)
+newdbmobject(const char *file, int flags, int mode)
 {
     dbmobject *dp;
 
@@ -56,7 +67,8 @@
     if (dp == NULL)
         return NULL;
     dp->di_size = -1;
-    if ( (dp->di_dbm = dbm_open(file, flags, mode)) == 0 ) {
+    /* See issue #19296 */
+    if ( (dp->di_dbm = dbm_open((char *)file, flags, mode)) == 0 ) {
         PyErr_SetFromErrno(DbmError);
         Py_DECREF(dp);
         return NULL;
@@ -67,7 +79,7 @@
 /* Methods */
 
 static void
-dbm_dealloc(register dbmobject *dp)
+dbm_dealloc(dbmobject *dp)
 {
     if ( dp->di_dbm )
         dbm_close(dp->di_dbm);
@@ -95,7 +107,7 @@
 }
 
 static PyObject *
-dbm_subscript(dbmobject *dp, register PyObject *key)
+dbm_subscript(dbmobject *dp, PyObject *key)
 {
     datum drec, krec;
     Py_ssize_t tmp_size;
@@ -170,7 +182,7 @@
 };
 
 static PyObject *
-dbm__close(register dbmobject *dp, PyObject *unused)
+dbm__close(dbmobject *dp, PyObject *unused)
 {
     if (dp->di_dbm)
         dbm_close(dp->di_dbm);
@@ -180,9 +192,9 @@
 }
 
 static PyObject *
-dbm_keys(register dbmobject *dp, PyObject *unused)
+dbm_keys(dbmobject *dp, PyObject *unused)
 {
-    register PyObject *v, *item;
+    PyObject *v, *item;
     datum key;
     int err;
 
@@ -252,31 +264,68 @@
     0,                          /* sq_inplace_repeat */
 };
 
-static PyObject *
-dbm_get(register dbmobject *dp, PyObject *args)
-{
-    datum key, val;
-    PyObject *defvalue = Py_None;
-    char *tmp_ptr;
-    Py_ssize_t tmp_size;
+/*[clinic input]
 
-    if (!PyArg_ParseTuple(args, "s#|O:get",
-                          &tmp_ptr, &tmp_size, &defvalue))
-        return NULL;
-    key.dptr = tmp_ptr;
-    key.dsize = tmp_size;
-    check_dbmobject_open(dp);
-    val = dbm_fetch(dp->di_dbm, key);
-    if (val.dptr != NULL)
-        return PyBytes_FromStringAndSize(val.dptr, val.dsize);
-    else {
-        Py_INCREF(defvalue);
-        return defvalue;
-    }
+dbm.dbm.get
+
+    self: dbmobject
+
+    key: str(length=True)
+    default: object = None
+    /
+
+Return the value for key if present, otherwise default.
+[clinic start generated code]*/
+
+PyDoc_STRVAR(dbm_dbm_get__doc__,
+"get($self, key, default=None, /)\n"
+"--\n"
+"\n"
+"Return the value for key if present, otherwise default.");
+
+#define DBM_DBM_GET_METHODDEF    \
+    {"get", (PyCFunction)dbm_dbm_get, METH_VARARGS, dbm_dbm_get__doc__},
+
+static PyObject *
+dbm_dbm_get_impl(dbmobject *dp, const char *key, Py_ssize_clean_t key_length, PyObject *default_value);
+
+static PyObject *
+dbm_dbm_get(dbmobject *dp, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    const char *key;
+    Py_ssize_clean_t key_length;
+    PyObject *default_value = Py_None;
+
+    if (!PyArg_ParseTuple(args,
+        "s#|O:get",
+        &key, &key_length, &default_value))
+        goto exit;
+    return_value = dbm_dbm_get_impl(dp, key, key_length, default_value);
+
+exit:
+    return return_value;
 }
 
 static PyObject *
-dbm_setdefault(register dbmobject *dp, PyObject *args)
+dbm_dbm_get_impl(dbmobject *dp, const char *key, Py_ssize_clean_t key_length, PyObject *default_value)
+/*[clinic end generated code: output=452ea11394e7e92d input=aecf5efd2f2b1a3b]*/
+{
+    datum dbm_key, val;
+
+    dbm_key.dptr = (char *)key;
+    dbm_key.dsize = key_length;
+    check_dbmobject_open(dp);
+    val = dbm_fetch(dp->di_dbm, dbm_key);
+    if (val.dptr != NULL)
+        return PyBytes_FromStringAndSize(val.dptr, val.dsize);
+
+    Py_INCREF(default_value);
+    return default_value;
+}
+
+static PyObject *
+dbm_setdefault(dbmobject *dp, PyObject *args)
 {
     datum key, val;
     PyObject *defvalue = NULL;
@@ -317,18 +366,33 @@
     return defvalue;
 }
 
+static PyObject *
+dbm__enter__(PyObject *self, PyObject *args)
+{
+    Py_INCREF(self);
+    return self;
+}
+
+static PyObject *
+dbm__exit__(PyObject *self, PyObject *args)
+{
+    _Py_IDENTIFIER(close);
+    return _PyObject_CallMethodId(self, &PyId_close, NULL);
+}
+
+
 static PyMethodDef dbm_methods[] = {
     {"close",           (PyCFunction)dbm__close,        METH_NOARGS,
      "close()\nClose the database."},
     {"keys",            (PyCFunction)dbm_keys,          METH_NOARGS,
      "keys() -> list\nReturn a list of all keys in the database."},
-    {"get",             (PyCFunction)dbm_get,           METH_VARARGS,
-     "get(key[, default]) -> value\n"
-     "Return the value for key if present, otherwise default."},
+    DBM_DBM_GET_METHODDEF
     {"setdefault",      (PyCFunction)dbm_setdefault,    METH_VARARGS,
      "setdefault(key[, default]) -> value\n"
      "Return the value for key if present, otherwise default.  If key\n"
      "is not in the database, it is inserted with default as the value."},
+    {"__enter__", dbm__enter__, METH_NOARGS, NULL},
+    {"__exit__",  dbm__exit__, METH_VARARGS, NULL},
     {NULL,              NULL}           /* sentinel */
 };
 
@@ -365,16 +429,70 @@
 
 /* ----------------------------------------------------------------- */
 
-static PyObject *
-dbmopen(PyObject *self, PyObject *args)
-{
-    char *name;
-    char *flags = "r";
-    int iflags;
-    int mode = 0666;
+/*[clinic input]
 
-    if ( !PyArg_ParseTuple(args, "s|si:open", &name, &flags, &mode) )
-        return NULL;
+dbm.open as dbmopen
+
+    filename: str
+        The filename to open.
+
+    flags: str="r"
+        How to open the file.  "r" for reading, "w" for writing, etc.
+
+    mode: int(py_default="0o666") = 0o666
+        If creating a new file, the mode bits for the new file
+        (e.g. os.O_RDWR).
+
+    /
+
+Return a database object.
+
+[clinic start generated code]*/
+
+PyDoc_STRVAR(dbmopen__doc__,
+"open($module, filename, flags=\'r\', mode=0o666, /)\n"
+"--\n"
+"\n"
+"Return a database object.\n"
+"\n"
+"  filename\n"
+"    The filename to open.\n"
+"  flags\n"
+"    How to open the file.  \"r\" for reading, \"w\" for writing, etc.\n"
+"  mode\n"
+"    If creating a new file, the mode bits for the new file\n"
+"    (e.g. os.O_RDWR).");
+
+#define DBMOPEN_METHODDEF    \
+    {"open", (PyCFunction)dbmopen, METH_VARARGS, dbmopen__doc__},
+
+static PyObject *
+dbmopen_impl(PyModuleDef *module, const char *filename, const char *flags, int mode);
+
+static PyObject *
+dbmopen(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    const char *filename;
+    const char *flags = "r";
+    int mode = 438;
+
+    if (!PyArg_ParseTuple(args,
+        "s|si:open",
+        &filename, &flags, &mode))
+        goto exit;
+    return_value = dbmopen_impl(module, filename, flags, mode);
+
+exit:
+    return return_value;
+}
+
+static PyObject *
+dbmopen_impl(PyModuleDef *module, const char *filename, const char *flags, int mode)
+/*[clinic end generated code: output=9a7b725f9c4dcec2 input=6499ab0fab1333ac]*/
+{
+    int iflags;
+
     if ( strcmp(flags, "r") == 0 )
         iflags = O_RDONLY;
     else if ( strcmp(flags, "w") == 0 )
@@ -390,13 +508,11 @@
                         "arg 2 to open should be 'r', 'w', 'c', or 'n'");
         return NULL;
     }
-    return newdbmobject(name, iflags, mode);
+    return newdbmobject(filename, iflags, mode);
 }
 
 static PyMethodDef dbmmodule_methods[] = {
-    { "open", (PyCFunction)dbmopen, METH_VARARGS,
-      "open(path[, flag[, mode]]) -> mapping\n"
-      "Return a database object."},
+    DBMOPEN_METHODDEF
     { 0, 0 },
 };
 
diff --git a/Modules/_decimal/_decimal.c b/Modules/_decimal/_decimal.c
index ea5253e..f000887 100644
--- a/Modules/_decimal/_decimal.c
+++ b/Modules/_decimal/_decimal.c
@@ -39,8 +39,8 @@
 #include "memory.h"
 
 
-#if MPD_MAJOR_VERSION != 2
-  #error "libmpdec major version 2 required"
+#if !defined(MPD_VERSION_HEX) || MPD_VERSION_HEX < 0x02040100
+  #error "libmpdec version >= 2.4.1 required"
 #endif
 
 
@@ -3542,7 +3542,7 @@
     }
 }
 
-static PyObject *DecimalTuple = NULL;
+static PyTypeObject *DecimalTuple = NULL;
 /* Return the DecimalTuple representation of a PyDecObject. */
 static PyObject *
 PyDec_AsTuple(PyObject *dec, PyObject *dummy UNUSED)
@@ -3625,7 +3625,7 @@
         }
     }
 
-    result = PyObject_CallFunctionObjArgs(DecimalTuple,
+    result = PyObject_CallFunctionObjArgs((PyObject *)DecimalTuple,
                                           sign, coeff, expt, NULL);
 
 out:
@@ -5562,9 +5562,14 @@
 
     /* DecimalTuple */
     ASSIGN_PTR(collections, PyImport_ImportModule("collections"));
-    ASSIGN_PTR(DecimalTuple, PyObject_CallMethod(collections,
+    ASSIGN_PTR(DecimalTuple, (PyTypeObject *)PyObject_CallMethod(collections,
                                  "namedtuple", "(ss)", "DecimalTuple",
                                  "sign digits exponent"));
+
+    ASSIGN_PTR(obj, PyUnicode_FromString("decimal"));
+    CHECK_INT(PyDict_SetItemString(DecimalTuple->tp_dict, "__module__", obj));
+    Py_CLEAR(obj);
+
     /* MutableMapping */
     ASSIGN_PTR(MutableMapping, PyObject_GetAttrString(collections,
                                                       "MutableMapping"));
@@ -5591,7 +5596,7 @@
     CHECK_INT(PyModule_AddObject(m, "Context",
                                  (PyObject *)&PyDecContext_Type));
     Py_INCREF(DecimalTuple);
-    CHECK_INT(PyModule_AddObject(m, "DecimalTuple", DecimalTuple));
+    CHECK_INT(PyModule_AddObject(m, "DecimalTuple", (PyObject *)DecimalTuple));
 
 
     /* Create top level exception */
diff --git a/Modules/_decimal/libmpdec/io.c b/Modules/_decimal/libmpdec/io.c
index b67324d..a45a429 100644
--- a/Modules/_decimal/libmpdec/io.c
+++ b/Modules/_decimal/libmpdec/io.c
@@ -446,7 +446,7 @@
 
     if (mpd_isspecial(dec)) {
 
-        mem = sizeof "-Infinity";
+        mem = sizeof "-Infinity%";
         if (mpd_isnan(dec) && dec->len > 0) {
             /* diagnostic code */
             mem += dec->digits;
@@ -609,10 +609,10 @@
             *cp++ = (flags&MPD_FMT_UPPER) ? 'E' : 'e';
             cp = exp_to_string(cp, ldigits-dplace);
         }
+    }
 
-        if (flags&MPD_FMT_PERCENT) {
-            *cp++ = '%';
-        }
+    if (flags&MPD_FMT_PERCENT) {
+        *cp++ = '%';
     }
 
     assert(cp < decstring+mem);
@@ -1260,6 +1260,9 @@
             stackspec.align = '>';
             spec = &stackspec;
         }
+        if (type == '%') {
+            flags |= MPD_FMT_PERCENT;
+        }
     }
     else {
         uint32_t workstatus = 0;
diff --git a/Modules/_decimal/libmpdec/mpdecimal.h b/Modules/_decimal/libmpdec/mpdecimal.h
index b43231c..5ca7413 100644
--- a/Modules/_decimal/libmpdec/mpdecimal.h
+++ b/Modules/_decimal/libmpdec/mpdecimal.h
@@ -108,9 +108,13 @@
 
 #define MPD_MAJOR_VERSION 2
 #define MPD_MINOR_VERSION 4
-#define MPD_MICRO_VERSION 0
+#define MPD_MICRO_VERSION 1
 
-#define MPD_VERSION "2.4.0"
+#define MPD_VERSION "2.4.1"
+
+#define MPD_VERSION_HEX ((MPD_MAJOR_VERSION << 24) | \
+                         (MPD_MINOR_VERSION << 16) | \
+                         (MPD_MICRO_VERSION <<  8))
 
 const char *mpd_version(void);
 
diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c
index f45893f..b3b6976 100644
--- a/Modules/_elementtree.c
+++ b/Modules/_elementtree.c
@@ -1,63 +1,22 @@
-/*
- * ElementTree
- * $Id: _elementtree.c 3473 2009-01-11 22:53:55Z fredrik $
+/*--------------------------------------------------------------------
+ * Licensed to PSF under a Contributor Agreement.
+ * See http://www.python.org/psf/license for licensing details.
  *
- * elementtree accelerator
- *
- * History:
- * 1999-06-20 fl  created (as part of sgmlop)
- * 2001-05-29 fl  effdom edition
- * 2003-02-27 fl  elementtree edition (alpha)
- * 2004-06-03 fl  updates for elementtree 1.2
- * 2005-01-05 fl  major optimization effort
- * 2005-01-11 fl  first public release (cElementTree 0.8)
- * 2005-01-12 fl  split element object into base and extras
- * 2005-01-13 fl  use tagged pointers for tail/text (cElementTree 0.9)
- * 2005-01-17 fl  added treebuilder close method
- * 2005-01-17 fl  fixed crash in getchildren
- * 2005-01-18 fl  removed observer api, added iterparse (cElementTree 0.9.3)
- * 2005-01-23 fl  revised iterparse api; added namespace event support (0.9.8)
- * 2005-01-26 fl  added VERSION module property (cElementTree 1.0)
- * 2005-01-28 fl  added remove method (1.0.1)
- * 2005-03-01 fl  added iselement function; fixed makeelement aliasing (1.0.2)
- * 2005-03-13 fl  export Comment and ProcessingInstruction/PI helpers
- * 2005-03-26 fl  added Comment and PI support to XMLParser
- * 2005-03-27 fl  event optimizations; complain about bogus events
- * 2005-08-08 fl  fixed read error handling in parse
- * 2005-08-11 fl  added runtime test for copy workaround (1.0.3)
- * 2005-12-13 fl  added expat_capi support (for xml.etree) (1.0.4)
- * 2005-12-16 fl  added support for non-standard encodings
- * 2006-03-08 fl  fixed a couple of potential null-refs and leaks
- * 2006-03-12 fl  merge in 2.5 ssize_t changes
- * 2007-08-25 fl  call custom builder's close method from XMLParser
- * 2007-08-31 fl  added iter, extend from ET 1.3
- * 2007-09-01 fl  fixed ParseError exception, setslice source type, etc
- * 2007-09-03 fl  fixed handling of negative insert indexes
- * 2007-09-04 fl  added itertext from ET 1.3
- * 2007-09-06 fl  added position attribute to ParseError exception
- * 2008-06-06 fl  delay error reporting in iterparse (from Hrvoje Niksic)
- *
+ * _elementtree - C accelerator for xml.etree.ElementTree
  * Copyright (c) 1999-2009 by Secret Labs AB.  All rights reserved.
  * Copyright (c) 1999-2009 by Fredrik Lundh.
  *
  * info@pythonware.com
  * http://www.pythonware.com
+ *--------------------------------------------------------------------
  */
 
-/* Licensed to PSF under a Contributor Agreement. */
-/* See http://www.python.org/psf/license for licensing details. */
-
 #include "Python.h"
 #include "structmember.h"
 
-#define VERSION "1.0.6"
-
 /* -------------------------------------------------------------------- */
 /* configuration */
 
-/* Leave defined to include the expat-based XMLParser type */
-#define USE_EXPAT
-
 /* An element can hold this many children without extra memory
    allocations. */
 #define STATIC_CHILDREN 4
@@ -119,10 +78,51 @@
 static PyTypeObject XMLParser_Type;
 
 
-/* glue functions (see the init function for details) */
-static PyObject* elementtree_parseerror_obj;
-static PyObject* elementtree_deepcopy_obj;
-static PyObject* elementpath_obj;
+/* Per-module state; PEP 3121 */
+typedef struct {
+    PyObject *parseerror_obj;
+    PyObject *deepcopy_obj;
+    PyObject *elementpath_obj;
+} elementtreestate;
+
+static struct PyModuleDef elementtreemodule;
+
+/* Given a module object (assumed to be _elementtree), get its per-module
+ * state.
+ */
+#define ET_STATE(mod) ((elementtreestate *) PyModule_GetState(mod))
+
+/* Find the module instance imported in the currently running sub-interpreter
+ * and get its state.
+ */
+#define ET_STATE_GLOBAL \
+    ((elementtreestate *) PyModule_GetState(PyState_FindModule(&elementtreemodule)))
+
+static int
+elementtree_clear(PyObject *m)
+{
+    elementtreestate *st = ET_STATE(m);
+    Py_CLEAR(st->parseerror_obj);
+    Py_CLEAR(st->deepcopy_obj);
+    Py_CLEAR(st->elementpath_obj);
+    return 0;
+}
+
+static int
+elementtree_traverse(PyObject *m, visitproc visit, void *arg)
+{
+    elementtreestate *st = ET_STATE(m);
+    Py_VISIT(st->parseerror_obj);
+    Py_VISIT(st->deepcopy_obj);
+    Py_VISIT(st->elementpath_obj);
+    return 0;
+}
+
+static void
+elementtree_free(void *m)
+{
+    elementtree_clear((PyObject *)m);
+}
 
 /* helpers */
 
@@ -130,11 +130,11 @@
 deepcopy(PyObject* object, PyObject* memo)
 {
     /* do a deep copy of the given object */
-
     PyObject* args;
     PyObject* result;
+    elementtreestate *st = ET_STATE_GLOBAL;
 
-    if (!elementtree_deepcopy_obj) {
+    if (!st->deepcopy_obj) {
         PyErr_SetString(
             PyExc_RuntimeError,
             "deepcopy helper not found"
@@ -145,7 +145,7 @@
     args = PyTuple_Pack(2, object, memo);
     if (!args)
         return NULL;
-    result = PyObject_CallObject(elementtree_deepcopy_obj, args);
+    result = PyObject_CallObject(st->deepcopy_obj, args);
     Py_DECREF(args);
     return result;
 }
@@ -229,8 +229,10 @@
 create_extra(ElementObject* self, PyObject* attrib)
 {
     self->extra = PyObject_Malloc(sizeof(ElementObjectExtra));
-    if (!self->extra)
+    if (!self->extra) {
+        PyErr_NoMemory();
         return -1;
+    }
 
     if (!attrib)
         attrib = Py_None;
@@ -283,13 +285,6 @@
         return NULL;
     self->extra = NULL;
 
-    if (attrib != Py_None && !is_empty_dict(attrib)) {
-        if (create_extra(self, attrib) < 0) {
-            PyObject_Del(self);
-            return NULL;
-        }
-    }
-
     Py_INCREF(tag);
     self->tag = tag;
 
@@ -303,6 +298,14 @@
 
     ALLOC(sizeof(ElementObject), "create element");
     PyObject_GC_Track(self);
+
+    if (attrib != Py_None && !is_empty_dict(attrib)) {
+        if (create_extra(self, attrib) < 0) {
+            Py_DECREF(self);
+            return NULL;
+        }
+    }
+
     return (PyObject*) self;
 }
 
@@ -358,6 +361,7 @@
 
     Py_DECREF(attrib_str);
 
+    /* attrib can be NULL if PyDict_New failed */
     if (attrib)
         if (PyDict_Update(attrib, kwds) < 0)
             return NULL;
@@ -433,8 +437,10 @@
     /* make sure self->children can hold the given number of extra
        elements.  set an exception and return -1 if allocation failed */
 
-    if (!self->extra)
-        create_extra(self, NULL);
+    if (!self->extra) {
+        if (create_extra(self, NULL) < 0)
+            return -1;
+    }
 
     size = self->extra->length + extra;
 
@@ -561,8 +567,9 @@
     PyObject* attrib = NULL;
     if (!PyArg_ParseTuple(args, "O!O|O!:SubElement",
                           &Element_Type, &parent, &tag,
-                          &PyDict_Type, &attrib))
+                          &PyDict_Type, &attrib)) {
         return NULL;
+    }
 
     if (attrib) {
         /* attrib passed as positional arg */
@@ -586,8 +593,9 @@
     }
 
     elem = create_new_element(tag, attrib);
-
     Py_DECREF(attrib);
+    if (elem == NULL)
+        return NULL;
 
     if (element_add_subelement(parent, elem) < 0) {
         Py_DECREF(elem);
@@ -645,7 +653,6 @@
 }
 
 /* -------------------------------------------------------------------- */
-/* methods (in alphabetical order) */
 
 static PyObject*
 element_append(ElementObject* self, PyObject* args)
@@ -689,8 +696,7 @@
         return NULL;
 
     element = (ElementObject*) create_new_element(
-        self->tag, (self->extra) ? self->extra->attrib : Py_None
-        );
+        self->tag, (self->extra) ? self->extra->attrib : Py_None);
     if (!element)
         return NULL;
 
@@ -703,7 +709,6 @@
     Py_INCREF(JOIN_OBJ(element->tail));
 
     if (self->extra) {
-
         if (element_resize(element, self->extra->length) < 0) {
             Py_DECREF(element);
             return NULL;
@@ -715,7 +720,6 @@
         }
 
         element->extra->length = self->extra->length;
-
     }
 
     return (PyObject*) element;
@@ -772,7 +776,6 @@
     element->tail = JOIN_SET(tail, JOIN_GET(self->tail));
 
     if (self->extra) {
-
         if (element_resize(element, self->extra->length) < 0)
             goto error;
 
@@ -786,7 +789,6 @@
         }
 
         element->extra->length = self->extra->length;
-
     }
 
     /* add object to memo dictionary (so deepcopy won't visit it again) */
@@ -1079,6 +1081,7 @@
     PyObject* tag;
     PyObject* namespaces = Py_None;
     static char *kwlist[] = {"path", "namespaces", 0};
+    elementtreestate *st = ET_STATE_GLOBAL;
 
     if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O:find", kwlist,
                                      &tag, &namespaces))
@@ -1087,7 +1090,7 @@
     if (checkpath(tag) || namespaces != Py_None) {
         _Py_IDENTIFIER(find);
         return _PyObject_CallMethodId(
-            elementpath_obj, &PyId_find, "OOO", self, tag, namespaces
+            st->elementpath_obj, &PyId_find, "OOO", self, tag, namespaces
             );
     }
 
@@ -1115,6 +1118,7 @@
     PyObject* namespaces = Py_None;
     _Py_IDENTIFIER(findtext);
     static char *kwlist[] = {"path", "default", "namespaces", 0};
+    elementtreestate *st = ET_STATE_GLOBAL;
 
     if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|OO:findtext", kwlist,
                                      &tag, &default_value, &namespaces))
@@ -1122,7 +1126,7 @@
 
     if (checkpath(tag) || namespaces != Py_None)
         return _PyObject_CallMethodId(
-            elementpath_obj, &PyId_findtext, "OOOO", self, tag, default_value, namespaces
+            st->elementpath_obj, &PyId_findtext, "OOOO", self, tag, default_value, namespaces
             );
 
     if (!self->extra) {
@@ -1132,8 +1136,8 @@
 
     for (i = 0; i < self->extra->length; i++) {
         ElementObject* item = (ElementObject*) self->extra->children[i];
-        if (Element_CheckExact(item) && (PyObject_RichCompareBool(item->tag, tag, Py_EQ) == 1)) {
-
+        if (Element_CheckExact(item) &&
+            (PyObject_RichCompareBool(item->tag, tag, Py_EQ) == 1)) {
             PyObject* text = element_get_text(item);
             if (text == Py_None)
                 return PyUnicode_New(0, 0);
@@ -1154,6 +1158,7 @@
     PyObject* tag;
     PyObject* namespaces = Py_None;
     static char *kwlist[] = {"path", "namespaces", 0};
+    elementtreestate *st = ET_STATE_GLOBAL;
 
     if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O:findall", kwlist,
                                      &tag, &namespaces))
@@ -1162,7 +1167,7 @@
     if (checkpath(tag) || namespaces != Py_None) {
         _Py_IDENTIFIER(findall);
         return _PyObject_CallMethodId(
-            elementpath_obj, &PyId_findall, "OOO", self, tag, namespaces
+            st->elementpath_obj, &PyId_findall, "OOO", self, tag, namespaces
             );
     }
 
@@ -1194,14 +1199,15 @@
     PyObject* namespaces = Py_None;
     _Py_IDENTIFIER(iterfind);
     static char *kwlist[] = {"path", "namespaces", 0};
+    elementtreestate *st = ET_STATE_GLOBAL;
 
     if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O:iterfind", kwlist,
-                                     &tag, &namespaces))
+                                     &tag, &namespaces)) {
         return NULL;
+    }
 
     return _PyObject_CallMethodId(
-        elementpath_obj, &PyId_iterfind, "OOO", self, tag, namespaces
-        );
+        st->elementpath_obj, &PyId_iterfind, "OOO", self, tag, namespaces);
 }
 
 static PyObject*
@@ -1312,8 +1318,10 @@
                           &Element_Type, &element))
         return NULL;
 
-    if (!self->extra)
-        create_extra(self, NULL);
+    if (!self->extra) {
+        if (create_extra(self, NULL) < 0)
+            return NULL;
+    }
 
     if (index < 0) {
         index += self->extra->length;
@@ -1454,8 +1462,10 @@
     if (!PyArg_ParseTuple(args, "OO:set", &key, &value))
         return NULL;
 
-    if (!self->extra)
-        create_extra(self, NULL);
+    if (!self->extra) {
+        if (create_extra(self, NULL) < 0)
+            return NULL;
+    }
 
     attrib = element_get_attrib(self);
     if (!attrib)
@@ -1570,8 +1580,10 @@
         PyObject* recycle = NULL;
         PyObject* seq = NULL;
 
-        if (!self->extra)
-            create_extra(self, NULL);
+        if (!self->extra) {
+            if (create_extra(self, NULL) < 0)
+                return -1;
+        }
 
         if (PySlice_GetIndicesEx(item,
                 self->extra->length,
@@ -1786,7 +1798,7 @@
         return res;
     } else if (strcmp(name, "text") == 0) {
         res = element_get_text(self);
-        Py_INCREF(res);
+        Py_XINCREF(res);
         return res;
     }
 
@@ -1801,8 +1813,10 @@
         res = element_get_tail(self);
     } else if (strcmp(name, "attrib") == 0) {
         PyErr_Clear();
-        if (!self->extra)
-            create_extra(self, NULL);
+        if (!self->extra) {
+            if (create_extra(self, NULL) < 0)
+                return NULL;
+        }
         res = element_get_attrib(self);
     }
 
@@ -1819,10 +1833,10 @@
     char *name = "";
     if (PyUnicode_Check(nameobj))
         name = _PyUnicode_AsString(nameobj);
-
-    if (name == NULL) {
+    if (name == NULL)
         return -1;
-    } else if (strcmp(name, "tag") == 0) {
+
+    if (strcmp(name, "tag") == 0) {
         Py_DECREF(self->tag);
         self->tag = value;
         Py_INCREF(self->tag);
@@ -1835,8 +1849,10 @@
         self->tail = value;
         Py_INCREF(self->tail);
     } else if (strcmp(name, "attrib") == 0) {
-        if (!self->extra)
-            create_extra(self, NULL);
+        if (!self->extra) {
+            if (create_extra(self, NULL) < 0)
+                return -1;
+        }
         Py_DECREF(self->extra->attrib);
         self->extra->attrib = value;
         Py_INCREF(self->extra->attrib);
@@ -2152,14 +2168,6 @@
     it = PyObject_GC_New(ElementIterObject, &ElementIter_Type);
     if (!it)
         return NULL;
-    if (!(it->parent_stack = PyObject_Malloc(sizeof(ParentLocator)))) {
-        PyObject_GC_Del(it);
-        return NULL;
-    }
-
-    it->parent_stack->parent = NULL;
-    it->parent_stack->child_index = 0;
-    it->parent_stack->next = NULL;
 
     if (PyUnicode_Check(tag))
         star = PyUnicode_FromString("*");
@@ -2168,17 +2176,27 @@
 
     if (star && PyObject_RichCompareBool(tag, star, Py_EQ) == 1)
         tag = Py_None;
-
     Py_XDECREF(star);
+
+    Py_INCREF(tag);
     it->sought_tag = tag;
     it->root_done = 0;
     it->gettext = gettext;
+    Py_INCREF(self);
     it->root_element = self;
 
-    Py_INCREF(self);
-    Py_INCREF(tag);
-
     PyObject_GC_Track(it);
+
+    it->parent_stack = PyObject_Malloc(sizeof(ParentLocator));
+    if (it->parent_stack == NULL) {
+        Py_DECREF(it);
+        PyErr_NoMemory();
+        return NULL;
+    }
+    it->parent_stack->parent = NULL;
+    it->parent_stack->child_index = 0;
+    it->parent_stack->next = NULL;
+
     return (PyObject *)it;
 }
 
@@ -2371,6 +2389,7 @@
 {
     PyObject* node;
     PyObject* this;
+    elementtreestate *st = ET_STATE_GLOBAL;
 
     if (self->data) {
         if (self->this == self->last) {
@@ -2401,7 +2420,7 @@
     } else {
         if (self->root) {
             PyErr_SetString(
-                elementtree_parseerror_obj,
+                st->parseerror_obj,
                 "multiple elements on top level"
                 );
             goto error;
@@ -2688,10 +2707,12 @@
 /* ==================================================================== */
 /* the expat interface */
 
-#if defined(USE_EXPAT)
-
 #include "expat.h"
 #include "pyexpat.h"
+
+/* The PyExpat_CAPI structure is an immutable dispatch table, so it can be
+ * cached globally without being in per-module state.
+ */
 static struct PyExpat_CAPI *expat_capi;
 #define EXPAT(func) (expat_capi->func)
 
@@ -2758,6 +2779,10 @@
         if (i != size) {
             /* convert to universal name */
             tag = PyBytes_FromStringAndSize(NULL, size+1);
+            if (tag == NULL) {
+                Py_DECREF(key);
+                return NULL;
+            }
             p = PyBytes_AS_STRING(tag);
             p[0] = '{';
             memcpy(p+1, string, size);
@@ -2797,6 +2822,7 @@
 expat_set_error(enum XML_Error error_code, int line, int column, char *message)
 {
     PyObject *errmsg, *error, *position, *code;
+    elementtreestate *st = ET_STATE_GLOBAL;
 
     errmsg = PyUnicode_FromFormat("%s: line %d, column %d",
                 message ? message : EXPAT(ErrorString)(error_code),
@@ -2804,7 +2830,7 @@
     if (errmsg == NULL)
         return;
 
-    error = PyObject_CallFunction(elementtree_parseerror_obj, "O", errmsg);
+    error = PyObject_CallFunction(st->parseerror_obj, "O", errmsg);
     Py_DECREF(errmsg);
     if (!error)
         return;
@@ -2834,7 +2860,7 @@
     }
     Py_DECREF(position);
 
-    PyErr_SetObject(elementtree_parseerror_obj, error);
+    PyErr_SetObject(st->parseerror_obj, error);
     Py_DECREF(error);
 }
 
@@ -2852,6 +2878,9 @@
     if (data_len < 2 || data_in[0] != '&')
         return;
 
+    if (PyErr_Occurred())
+        return;
+
     key = PyUnicode_DecodeUTF8(data_in + 1, data_len - 2, "strict");
     if (!key)
         return;
@@ -2892,6 +2921,9 @@
     PyObject* attrib;
     int ok;
 
+    if (PyErr_Occurred())
+        return;
+
     /* tag name */
     tag = makeuniversal(self, tag_in);
     if (!tag)
@@ -2950,6 +2982,9 @@
     PyObject* data;
     PyObject* res;
 
+    if (PyErr_Occurred())
+        return;
+
     data = PyUnicode_DecodeUTF8(data_in, data_len, "strict");
     if (!data)
         return; /* parser will look for errors */
@@ -2973,6 +3008,9 @@
     PyObject* tag;
     PyObject* res = NULL;
 
+    if (PyErr_Occurred())
+        return;
+
     if (TreeBuilder_CheckExact(self->target))
         /* shortcut */
         /* the standard tree builder doesn't look at the end tag */
@@ -2997,6 +3035,9 @@
     PyObject* sprefix = NULL;
     PyObject* suri = NULL;
 
+    if (PyErr_Occurred())
+        return;
+
     if (uri)
         suri = PyUnicode_DecodeUTF8(uri, strlen(uri), "strict");
     else
@@ -3024,6 +3065,9 @@
 static void
 expat_end_ns_handler(XMLParserObject* self, const XML_Char* prefix_in)
 {
+    if (PyErr_Occurred())
+        return;
+
     treebuilder_handle_namespace(
         (TreeBuilderObject*) self->target, 0, NULL, NULL
         );
@@ -3035,6 +3079,9 @@
     PyObject* comment;
     PyObject* res;
 
+    if (PyErr_Occurred())
+        return;
+
     if (self->handle_comment) {
         comment = PyUnicode_DecodeUTF8(comment_in, strlen(comment_in), "strict");
         if (comment) {
@@ -3057,6 +3104,9 @@
     PyObject *parser_doctype = NULL;
     PyObject *res = NULL;
 
+    if (PyErr_Occurred())
+        return;
+
     doctype_name_obj = makeuniversal(self, doctype_name);
     if (!doctype_name_obj)
         return;
@@ -3125,6 +3175,9 @@
     PyObject* data;
     PyObject* res;
 
+    if (PyErr_Occurred())
+        return;
+
     if (self->handle_pi) {
         target = PyUnicode_DecodeUTF8(target_in, strlen(target_in), "strict");
         data = PyUnicode_DecodeUTF8(data_in, strlen(data_in), "strict");
@@ -3297,6 +3350,7 @@
 {
     int ok;
 
+    assert(!PyErr_Occurred());
     ok = EXPAT(Parse)(self->parser, data, data_len, final);
 
     if (PyErr_Occurred())
@@ -3331,11 +3385,14 @@
     if (TreeBuilder_CheckExact(self->target)) {
         Py_DECREF(res);
         return treebuilder_done((TreeBuilderObject*) self->target);
-    } if (self->handle_close) {
+    }
+    else if (self->handle_close) {
         Py_DECREF(res);
         return PyObject_CallFunction(self->handle_close, "");
-    } else
+    }
+    else {
         return res;
+    }
 }
 
 static PyObject*
@@ -3373,10 +3430,9 @@
 }
 
 static PyObject*
-xmlparser_parse(XMLParserObject* self, PyObject* args)
+xmlparser_parse_whole(XMLParserObject* self, PyObject* args)
 {
-    /* (internal) parse until end of input stream */
-
+    /* (internal) parse the whole input, until end of stream */
     PyObject* reader;
     PyObject* buffer;
     PyObject* temp;
@@ -3403,7 +3459,7 @@
 
         if (PyUnicode_CheckExact(buffer)) {
             /* A unicode object is encoded into bytes using UTF-8 */
-            if (PyUnicode_GET_SIZE(buffer) == 0) {
+            if (PyUnicode_GET_LENGTH(buffer) == 0) {
                 Py_DECREF(buffer);
                 break;
             }
@@ -3457,14 +3513,14 @@
 xmlparser_setevents(XMLParserObject *self, PyObject* args)
 {
     /* activate element event reporting */
+    Py_ssize_t i, seqlen;
+    TreeBuilderObject *target;
 
-    Py_ssize_t i;
-    TreeBuilderObject* target;
-
-    PyObject* events; /* event collector */
-    PyObject* event_set = Py_None;
-    if (!PyArg_ParseTuple(args, "O!|O:_setevents",  &PyList_Type, &events,
-                          &event_set))
+    PyObject *events_queue;
+    PyObject *events_to_report = Py_None;
+    PyObject *events_seq;
+    if (!PyArg_ParseTuple(args, "O!|O:_setevents",  &PyList_Type, &events_queue,
+                          &events_to_report))
         return NULL;
 
     if (!TreeBuilder_CheckExact(self->target)) {
@@ -3478,9 +3534,9 @@
 
     target = (TreeBuilderObject*) self->target;
 
-    Py_INCREF(events);
+    Py_INCREF(events_queue);
     Py_XDECREF(target->events);
-    target->events = events;
+    target->events = events_queue;
 
     /* clear out existing events */
     Py_CLEAR(target->start_event_obj);
@@ -3488,75 +3544,71 @@
     Py_CLEAR(target->start_ns_event_obj);
     Py_CLEAR(target->end_ns_event_obj);
 
-    if (event_set == Py_None) {
+    if (events_to_report == Py_None) {
         /* default is "end" only */
         target->end_event_obj = PyUnicode_FromString("end");
         Py_RETURN_NONE;
     }
 
-    if (!PyTuple_Check(event_set)) /* FIXME: handle arbitrary sequences */
-        goto error;
+    if (!(events_seq = PySequence_Fast(events_to_report,
+                                       "events must be a sequence"))) {
+        return NULL;
+    }
 
-    for (i = 0; i < PyTuple_GET_SIZE(event_set); i++) {
-        PyObject* item = PyTuple_GET_ITEM(event_set, i);
-        char* event;
-        if (PyUnicode_Check(item)) {
-            event = _PyUnicode_AsString(item);
-            if (event == NULL)
-                goto error;
-        } else if (PyBytes_Check(item))
-            event = PyBytes_AS_STRING(item);
-        else {
-            goto error;
+    seqlen = PySequence_Size(events_seq);
+    for (i = 0; i < seqlen; ++i) {
+        PyObject *event_name_obj = PySequence_Fast_GET_ITEM(events_seq, i);
+        char *event_name = NULL;
+        if (PyUnicode_Check(event_name_obj)) {
+            event_name = _PyUnicode_AsString(event_name_obj);
+        } else if (PyBytes_Check(event_name_obj)) {
+            event_name = PyBytes_AS_STRING(event_name_obj);
         }
-        if (strcmp(event, "start") == 0) {
-            Py_INCREF(item);
-            target->start_event_obj = item;
-        } else if (strcmp(event, "end") == 0) {
-            Py_INCREF(item);
+
+        if (event_name == NULL) {
+            Py_DECREF(events_seq);
+            PyErr_Format(PyExc_ValueError, "invalid events sequence");
+            return NULL;
+        } else if (strcmp(event_name, "start") == 0) {
+            Py_INCREF(event_name_obj);
+            target->start_event_obj = event_name_obj;
+        } else if (strcmp(event_name, "end") == 0) {
+            Py_INCREF(event_name_obj);
             Py_XDECREF(target->end_event_obj);
-            target->end_event_obj = item;
-        } else if (strcmp(event, "start-ns") == 0) {
-            Py_INCREF(item);
+            target->end_event_obj = event_name_obj;
+        } else if (strcmp(event_name, "start-ns") == 0) {
+            Py_INCREF(event_name_obj);
             Py_XDECREF(target->start_ns_event_obj);
-            target->start_ns_event_obj = item;
+            target->start_ns_event_obj = event_name_obj;
             EXPAT(SetNamespaceDeclHandler)(
                 self->parser,
                 (XML_StartNamespaceDeclHandler) expat_start_ns_handler,
                 (XML_EndNamespaceDeclHandler) expat_end_ns_handler
                 );
-        } else if (strcmp(event, "end-ns") == 0) {
-            Py_INCREF(item);
+        } else if (strcmp(event_name, "end-ns") == 0) {
+            Py_INCREF(event_name_obj);
             Py_XDECREF(target->end_ns_event_obj);
-            target->end_ns_event_obj = item;
+            target->end_ns_event_obj = event_name_obj;
             EXPAT(SetNamespaceDeclHandler)(
                 self->parser,
                 (XML_StartNamespaceDeclHandler) expat_start_ns_handler,
                 (XML_EndNamespaceDeclHandler) expat_end_ns_handler
                 );
         } else {
-            PyErr_Format(
-                PyExc_ValueError,
-                "unknown event '%s'", event
-                );
+            Py_DECREF(events_seq);
+            PyErr_Format(PyExc_ValueError, "unknown event '%s'", event_name);
             return NULL;
         }
     }
 
+    Py_DECREF(events_seq);
     Py_RETURN_NONE;
-
-  error:
-    PyErr_SetString(
-        PyExc_TypeError,
-        "invalid event tuple"
-        );
-    return NULL;
 }
 
 static PyMethodDef xmlparser_methods[] = {
     {"feed", (PyCFunction) xmlparser_feed, METH_O},
     {"close", (PyCFunction) xmlparser_close, METH_VARARGS},
-    {"_parse", (PyCFunction) xmlparser_parse, METH_VARARGS},
+    {"_parse_whole", (PyCFunction) xmlparser_parse_whole, METH_VARARGS},
     {"_setevents", (PyCFunction) xmlparser_setevents, METH_VARARGS},
     {"doctype", (PyCFunction) xmlparser_doctype, METH_VARARGS},
     {NULL, NULL}
@@ -3628,8 +3680,6 @@
     0,                                              /* tp_free */
 };
 
-#endif
-
 /* ==================================================================== */
 /* python module interface */
 
@@ -3639,22 +3689,29 @@
 };
 
 
-static struct PyModuleDef _elementtreemodule = {
-        PyModuleDef_HEAD_INIT,
-        "_elementtree",
-        NULL,
-        -1,
-        _functions,
-        NULL,
-        NULL,
-        NULL,
-        NULL
+static struct PyModuleDef elementtreemodule = {
+    PyModuleDef_HEAD_INIT,
+    "_elementtree",
+    NULL,
+    sizeof(elementtreestate),
+    _functions,
+    NULL,
+    elementtree_traverse,
+    elementtree_clear,
+    elementtree_free
 };
 
 PyMODINIT_FUNC
 PyInit__elementtree(void)
 {
     PyObject *m, *temp;
+    elementtreestate *st;
+
+    m = PyState_FindModule(&elementtreemodule);
+    if (m) {
+        Py_INCREF(m);
+        return m;
+    }
 
     /* Initialize object types */
     if (PyType_Ready(&ElementIter_Type) < 0)
@@ -3663,21 +3720,20 @@
         return NULL;
     if (PyType_Ready(&Element_Type) < 0)
         return NULL;
-#if defined(USE_EXPAT)
     if (PyType_Ready(&XMLParser_Type) < 0)
         return NULL;
-#endif
 
-    m = PyModule_Create(&_elementtreemodule);
+    m = PyModule_Create(&elementtreemodule);
     if (!m)
         return NULL;
+    st = ET_STATE(m);
 
     if (!(temp = PyImport_ImportModule("copy")))
         return NULL;
-    elementtree_deepcopy_obj = PyObject_GetAttrString(temp, "deepcopy");
+    st->deepcopy_obj = PyObject_GetAttrString(temp, "deepcopy");
     Py_XDECREF(temp);
 
-    if (!(elementpath_obj = PyImport_ImportModule("xml.etree.ElementPath")))
+    if (!(st->elementpath_obj = PyImport_ImportModule("xml.etree.ElementPath")))
         return NULL;
 
     /* link against pyexpat */
@@ -3697,11 +3753,11 @@
         return NULL;
     }
 
-    elementtree_parseerror_obj = PyErr_NewException(
+    st->parseerror_obj = PyErr_NewException(
         "xml.etree.ElementTree.ParseError", PyExc_SyntaxError, NULL
         );
-    Py_INCREF(elementtree_parseerror_obj);
-    PyModule_AddObject(m, "ParseError", elementtree_parseerror_obj);
+    Py_INCREF(st->parseerror_obj);
+    PyModule_AddObject(m, "ParseError", st->parseerror_obj);
 
     Py_INCREF((PyObject *)&Element_Type);
     PyModule_AddObject(m, "Element", (PyObject *)&Element_Type);
@@ -3709,10 +3765,8 @@
     Py_INCREF((PyObject *)&TreeBuilder_Type);
     PyModule_AddObject(m, "TreeBuilder", (PyObject *)&TreeBuilder_Type);
 
-#if defined(USE_EXPAT)
     Py_INCREF((PyObject *)&XMLParser_Type);
     PyModule_AddObject(m, "XMLParser", (PyObject *)&XMLParser_Type);
-#endif
 
     return m;
 }
diff --git a/Modules/_freeze_importlib.c b/Modules/_freeze_importlib.c
index 8f07a89..57b1ac0 100644
--- a/Modules/_freeze_importlib.c
+++ b/Modules/_freeze_importlib.c
@@ -17,7 +17,7 @@
    of frozen modules instead, left deliberately blank so as to avoid
    unintentional import of a stale version of _frozen_importlib. */
 
-static struct _frozen _PyImport_FrozenModules[] = {
+const static struct _frozen _PyImport_FrozenModules[] = {
     {0, 0, 0} /* sentinel */
 };
 
@@ -25,7 +25,7 @@
 /* On Windows, this links with the regular pythonXY.dll, so this variable comes
    from frozen.obj. In the Makefile, frozen.o is not linked into this executable,
    so we define the variable here. */
-struct _frozen *PyImport_FrozenModules;
+const struct _frozen *PyImport_FrozenModules;
 #endif
 
 const char header[] = "/* Auto-generated by Modules/_freeze_importlib.c */";
@@ -106,7 +106,7 @@
         goto error;
     }
     fprintf(outfile, "%s\n", header);
-    fprintf(outfile, "unsigned char _Py_M__importlib[] = {\n");
+    fprintf(outfile, "const unsigned char _Py_M__importlib[] = {\n");
     for (n = 0; n < data_size; n += 16) {
         size_t i, end = Py_MIN(n + 16, data_size);
         fprintf(outfile, "    ");
diff --git a/Modules/_gdbmmodule.c b/Modules/_gdbmmodule.c
index 0bd59c8..229e16e 100644
--- a/Modules/_gdbmmodule.c
+++ b/Modules/_gdbmmodule.c
@@ -79,7 +79,7 @@
 /* Methods */
 
 static void
-dbm_dealloc(register dbmobject *dp)
+dbm_dealloc(dbmobject *dp)
 {
     if (dp->di_dbm)
         gdbm_close(dp->di_dbm);
@@ -112,7 +112,7 @@
 }
 
 static PyObject *
-dbm_subscript(dbmobject *dp, register PyObject *key)
+dbm_subscript(dbmobject *dp, PyObject *key)
 {
     PyObject *v;
     datum drec, krec;
@@ -232,7 +232,7 @@
 Closes the database.");
 
 static PyObject *
-dbm_close(register dbmobject *dp, PyObject *unused)
+dbm_close(dbmobject *dp, PyObject *unused)
 {
     if (dp->di_dbm)
         gdbm_close(dp->di_dbm);
@@ -247,9 +247,9 @@
 Get a list of all keys in the database.");
 
 static PyObject *
-dbm_keys(register dbmobject *dp, PyObject *unused)
+dbm_keys(dbmobject *dp, PyObject *unused)
 {
-    register PyObject *v, *item;
+    PyObject *v, *item;
     datum key, nextkey;
     int err;
 
@@ -337,9 +337,9 @@
 returns the starting key.");
 
 static PyObject *
-dbm_firstkey(register dbmobject *dp, PyObject *unused)
+dbm_firstkey(dbmobject *dp, PyObject *unused)
 {
-    register PyObject *v;
+    PyObject *v;
     datum key;
 
     check_dbmobject_open(dp);
@@ -367,9 +367,9 @@
           k = db.nextkey(k)");
 
 static PyObject *
-dbm_nextkey(register dbmobject *dp, PyObject *args)
+dbm_nextkey(dbmobject *dp, PyObject *args)
 {
-    register PyObject *v;
+    PyObject *v;
     datum key, nextkey;
 
     if (!PyArg_ParseTuple(args, "s#:nextkey", &key.dptr, &key.dsize))
@@ -396,7 +396,7 @@
 kept and reused as new (key,value) pairs are added.");
 
 static PyObject *
-dbm_reorganize(register dbmobject *dp, PyObject *unused)
+dbm_reorganize(dbmobject *dp, PyObject *unused)
 {
     check_dbmobject_open(dp);
     errno = 0;
@@ -417,7 +417,7 @@
 any unwritten data to be written to the disk.");
 
 static PyObject *
-dbm_sync(register dbmobject *dp, PyObject *unused)
+dbm_sync(dbmobject *dp, PyObject *unused)
 {
     check_dbmobject_open(dp);
     gdbm_sync(dp->di_dbm);
@@ -425,6 +425,20 @@
     return Py_None;
 }
 
+static PyObject *
+dbm__enter__(PyObject *self, PyObject *args)
+{
+    Py_INCREF(self);
+    return self;
+}
+
+static PyObject *
+dbm__exit__(PyObject *self, PyObject *args)
+{
+    _Py_IDENTIFIER(close);
+    return _PyObject_CallMethodId(self, &PyId_close, NULL);
+}
+
 static PyMethodDef dbm_methods[] = {
     {"close",     (PyCFunction)dbm_close,   METH_NOARGS, dbm_close__doc__},
     {"keys",      (PyCFunction)dbm_keys,    METH_NOARGS, dbm_keys__doc__},
@@ -434,6 +448,8 @@
     {"sync",      (PyCFunction)dbm_sync,    METH_NOARGS, dbm_sync__doc__},
     {"get",       (PyCFunction)dbm_get,     METH_VARARGS, dbm_get__doc__},
     {"setdefault",(PyCFunction)dbm_setdefault,METH_VARARGS, dbm_setdefault__doc__},
+    {"__enter__", dbm__enter__, METH_NOARGS, NULL},
+    {"__exit__",  dbm__exit__, METH_VARARGS, NULL},
     {NULL,              NULL}           /* sentinel */
 };
 
diff --git a/Modules/_gestalt.c b/Modules/_gestalt.c
deleted file mode 100644
index cd30683..0000000
--- a/Modules/_gestalt.c
+++ /dev/null
@@ -1,84 +0,0 @@
-/***********************************************************
-Copyright 1991-1997 by 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 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.
-
-******************************************************************/
-
-/* Macintosh Gestalt interface */
-
-#include "Python.h"
-
-#include <Carbon/Carbon.h>
-
-/* Convert a 4-char string object argument to an OSType value */
-static int
-convert_to_OSType(PyObject *v, OSType *pr)
-{
-    uint32_t tmp;
-    if (!PyUnicode_Check(v) || PyUnicode_GetLength(v) != 4) {
-    PyErr_SetString(PyExc_TypeError,
-                    "OSType arg must be string of 4 chars");
-    return 0;
-    }
-    memcpy((char *)&tmp, _PyUnicode_AsString(v), 4);
-    *pr = (OSType)ntohl(tmp);
-    return 1;
-}
-
-static PyObject *
-gestalt_gestalt(PyObject *self, PyObject *args)
-{
-    OSErr iErr;
-    OSType selector;
-    SInt32 response;
-    if (!PyArg_ParseTuple(args, "O&", convert_to_OSType, &selector))
-        return NULL;
-    iErr = Gestalt(selector, &response);
-    if (iErr != 0) {
-    PyErr_SetString(PyExc_OSError,
-                    "non-zero exit code!");
-    return NULL;
-    }
-    return PyLong_FromLong(response);
-}
-
-static struct PyMethodDef gestalt_methods[] = {
-    {"gestalt", gestalt_gestalt, METH_VARARGS},
-    {NULL, NULL} /* Sentinel */
-};
-
-static struct PyModuleDef gestaltmodule = {
-    PyModuleDef_HEAD_INIT,
-    "_gestalt",
-    NULL,
-    -1,
-    gestalt_methods,
-    NULL,
-    NULL,
-    NULL,
-    NULL
-};
-
-PyMODINIT_FUNC
-PyInit__gestalt(void)
-{
-    return PyModule_Create(&gestaltmodule);
-}
diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c
index 3ab1c0c..6a2a9af 100644
--- a/Modules/_hashopenssl.c
+++ b/Modules/_hashopenssl.c
@@ -17,36 +17,16 @@
 #include "structmember.h"
 #include "hashlib.h"
 
-#ifdef WITH_THREAD
-#include "pythread.h"
-    #define ENTER_HASHLIB(obj) \
-        if ((obj)->lock) { \
-            if (!PyThread_acquire_lock((obj)->lock, 0)) { \
-                Py_BEGIN_ALLOW_THREADS \
-                PyThread_acquire_lock((obj)->lock, 1); \
-                Py_END_ALLOW_THREADS \
-            } \
-        }
-    #define LEAVE_HASHLIB(obj) \
-        if ((obj)->lock) { \
-            PyThread_release_lock((obj)->lock); \
-        }
-#else
-    #define ENTER_HASHLIB(obj)
-    #define LEAVE_HASHLIB(obj)
-#endif
 
 /* EVP is the preferred interface to hashing in OpenSSL */
 #include <openssl/evp.h>
+#include <openssl/hmac.h>
 /* We use the object interface to discover what hashes OpenSSL supports. */
 #include <openssl/objects.h>
+#include "openssl/err.h"
 
 #define MUNCH_SIZE INT_MAX
 
-/* TODO(gps): We should probably make this a module or EVPobject attribute
- * to allow the user to optimize based on the platform they're using. */
-#define HASHLIB_GIL_MINSIZE 2048
-
 #ifndef HASH_OBJ_CONSTRUCTOR
 #define HASH_OBJ_CONSTRUCTOR 0
 #endif
@@ -489,6 +469,225 @@
 }
 
 
+
+#if (OPENSSL_VERSION_NUMBER >= 0x10000000 && !defined(OPENSSL_NO_HMAC) \
+     && !defined(OPENSSL_NO_SHA))
+
+#define PY_PBKDF2_HMAC 1
+
+/* Improved implementation of PKCS5_PBKDF2_HMAC()
+ *
+ * PKCS5_PBKDF2_HMAC_fast() hashes the password exactly one time instead of
+ * `iter` times. Today (2013) the iteration count is typically 100,000 or
+ * more. The improved algorithm is not subject to a Denial-of-Service
+ * vulnerability with overly large passwords.
+ *
+ * Also OpenSSL < 1.0 don't provide PKCS5_PBKDF2_HMAC(), only
+ * PKCS5_PBKDF2_SHA1.
+ */
+static int
+PKCS5_PBKDF2_HMAC_fast(const char *pass, int passlen,
+                       const unsigned char *salt, int saltlen,
+                       int iter, const EVP_MD *digest,
+                       int keylen, unsigned char *out)
+{
+    unsigned char digtmp[EVP_MAX_MD_SIZE], *p, itmp[4];
+    int cplen, j, k, tkeylen, mdlen;
+    unsigned long i = 1;
+    HMAC_CTX hctx_tpl, hctx;
+
+    mdlen = EVP_MD_size(digest);
+    if (mdlen < 0)
+        return 0;
+
+    HMAC_CTX_init(&hctx_tpl);
+    HMAC_CTX_init(&hctx);
+    p = out;
+    tkeylen = keylen;
+    if (!HMAC_Init_ex(&hctx_tpl, pass, passlen, digest, NULL)) {
+        HMAC_CTX_cleanup(&hctx_tpl);
+        return 0;
+    }
+    while(tkeylen) {
+        if(tkeylen > mdlen)
+            cplen = mdlen;
+        else
+            cplen = tkeylen;
+        /* We are unlikely to ever use more than 256 blocks (5120 bits!)
+         * but just in case...
+         */
+        itmp[0] = (unsigned char)((i >> 24) & 0xff);
+        itmp[1] = (unsigned char)((i >> 16) & 0xff);
+        itmp[2] = (unsigned char)((i >> 8) & 0xff);
+        itmp[3] = (unsigned char)(i & 0xff);
+        if (!HMAC_CTX_copy(&hctx, &hctx_tpl)) {
+            HMAC_CTX_cleanup(&hctx_tpl);
+            return 0;
+        }
+        if (!HMAC_Update(&hctx, salt, saltlen)
+                || !HMAC_Update(&hctx, itmp, 4)
+                || !HMAC_Final(&hctx, digtmp, NULL)) {
+            HMAC_CTX_cleanup(&hctx_tpl);
+            HMAC_CTX_cleanup(&hctx);
+            return 0;
+        }
+        HMAC_CTX_cleanup(&hctx);
+        memcpy(p, digtmp, cplen);
+        for (j = 1; j < iter; j++) {
+            if (!HMAC_CTX_copy(&hctx, &hctx_tpl)) {
+                HMAC_CTX_cleanup(&hctx_tpl);
+                return 0;
+            }
+            if (!HMAC_Update(&hctx, digtmp, mdlen)
+                    || !HMAC_Final(&hctx, digtmp, NULL)) {
+                HMAC_CTX_cleanup(&hctx_tpl);
+                HMAC_CTX_cleanup(&hctx);
+                return 0;
+            }
+            HMAC_CTX_cleanup(&hctx);
+            for (k = 0; k < cplen; k++) {
+                p[k] ^= digtmp[k];
+            }
+        }
+        tkeylen-= cplen;
+        i++;
+        p+= cplen;
+    }
+    HMAC_CTX_cleanup(&hctx_tpl);
+    return 1;
+}
+
+/* LCOV_EXCL_START */
+static PyObject *
+_setException(PyObject *exc)
+{
+    unsigned long errcode;
+    const char *lib, *func, *reason;
+
+    errcode = ERR_peek_last_error();
+    if (!errcode) {
+        PyErr_SetString(exc, "unknown reasons");
+        return NULL;
+    }
+    ERR_clear_error();
+
+    lib = ERR_lib_error_string(errcode);
+    func = ERR_func_error_string(errcode);
+    reason = ERR_reason_error_string(errcode);
+
+    if (lib && func) {
+        PyErr_Format(exc, "[%s: %s] %s", lib, func, reason);
+    }
+    else if (lib) {
+        PyErr_Format(exc, "[%s] %s", lib, reason);
+    }
+    else {
+        PyErr_SetString(exc, reason);
+    }
+    return NULL;
+}
+/* LCOV_EXCL_STOP */
+
+PyDoc_STRVAR(pbkdf2_hmac__doc__,
+"pbkdf2_hmac(hash_name, password, salt, iterations, dklen=None) -> key\n\
+\n\
+Password based key derivation function 2 (PKCS #5 v2.0) with HMAC as\n\
+pseudorandom function.");
+
+static PyObject *
+pbkdf2_hmac(PyObject *self, PyObject *args, PyObject *kwdict)
+{
+    static char *kwlist[] = {"hash_name", "password", "salt", "iterations",
+                             "dklen", NULL};
+    PyObject *key_obj = NULL, *dklen_obj = Py_None;
+    char *name, *key;
+    Py_buffer password, salt;
+    long iterations, dklen;
+    int retval;
+    const EVP_MD *digest;
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwdict, "sy*y*l|O:pbkdf2_hmac",
+                                     kwlist, &name, &password, &salt,
+                                     &iterations, &dklen_obj)) {
+        return NULL;
+    }
+
+    digest = EVP_get_digestbyname(name);
+    if (digest == NULL) {
+        PyErr_SetString(PyExc_ValueError, "unsupported hash type");
+        goto end;
+    }
+
+    if (password.len > INT_MAX) {
+        PyErr_SetString(PyExc_OverflowError,
+                        "password is too long.");
+        goto end;
+    }
+
+    if (salt.len > INT_MAX) {
+        PyErr_SetString(PyExc_OverflowError,
+                        "salt is too long.");
+        goto end;
+    }
+
+    if (iterations < 1) {
+        PyErr_SetString(PyExc_ValueError,
+                        "iteration value must be greater than 0.");
+        goto end;
+    }
+    if (iterations > INT_MAX) {
+        PyErr_SetString(PyExc_OverflowError,
+                        "iteration value is too great.");
+        goto end;
+    }
+
+    if (dklen_obj == Py_None) {
+        dklen = EVP_MD_size(digest);
+    } else {
+        dklen = PyLong_AsLong(dklen_obj);
+        if ((dklen == -1) && PyErr_Occurred()) {
+            goto end;
+        }
+    }
+    if (dklen < 1) {
+        PyErr_SetString(PyExc_ValueError,
+                        "key length must be greater than 0.");
+        goto end;
+    }
+    if (dklen > INT_MAX) {
+        /* INT_MAX is always smaller than dkLen max (2^32 - 1) * hLen */
+        PyErr_SetString(PyExc_OverflowError,
+                        "key length is too great.");
+        goto end;
+    }
+
+    key_obj = PyBytes_FromStringAndSize(NULL, dklen);
+    if (key_obj == NULL) {
+        goto end;
+    }
+    key = PyBytes_AS_STRING(key_obj);
+
+    Py_BEGIN_ALLOW_THREADS
+    retval = PKCS5_PBKDF2_HMAC_fast((char*)password.buf, (int)password.len,
+                                    (unsigned char *)salt.buf, (int)salt.len,
+                                    iterations, digest, dklen,
+                                    (unsigned char *)key);
+    Py_END_ALLOW_THREADS
+
+    if (!retval) {
+        Py_CLEAR(key_obj);
+        _setException(PyExc_ValueError);
+        goto end;
+    }
+
+  end:
+    PyBuffer_Release(&password);
+    PyBuffer_Release(&salt);
+    return key_obj;
+}
+
+#endif
+
 /* State for our callback function so that it can accumulate a result. */
 typedef struct _internal_name_mapper_state {
     PyObject *set;
@@ -517,9 +716,9 @@
         state->error = 1;
     } else {
         if (PySet_Add(state->set, py_name) != 0) {
-            Py_DECREF(py_name);
             state->error = 1;
         }
+        Py_DECREF(py_name);
     }
 }
 
@@ -610,6 +809,10 @@
 
 static struct PyMethodDef EVP_functions[] = {
     {"new", (PyCFunction)EVP_new, METH_VARARGS|METH_KEYWORDS, EVP_new__doc__},
+#ifdef PY_PBKDF2_HMAC
+    {"pbkdf2_hmac", (PyCFunction)pbkdf2_hmac, METH_VARARGS|METH_KEYWORDS,
+     pbkdf2_hmac__doc__},
+#endif
     CONSTRUCTOR_METH_DEF(md5),
     CONSTRUCTOR_METH_DEF(sha1),
 #ifdef _OPENSSL_SUPPORTS_SHA2
@@ -643,6 +846,7 @@
     PyObject *m, *openssl_md_meth_names;
 
     OpenSSL_add_all_digests();
+    ERR_load_crypto_strings();
 
     /* TODO build EVP_functions openssl_* entries dynamically based
      * on what hashes are supported rather than listing many
@@ -667,10 +871,8 @@
         return NULL;
     }
 
-#if HASH_OBJ_CONSTRUCTOR
-    Py_INCREF(&EVPtype);
+    Py_INCREF((PyObject *)&EVPtype);
     PyModule_AddObject(m, "HASH", (PyObject *)&EVPtype);
-#endif
 
     /* these constants are used by the convenience constructors */
     INIT_CONSTRUCTOR_CONSTANTS(md5);
diff --git a/Modules/_heapqmodule.c b/Modules/_heapqmodule.c
index f377e9c..eee56a0 100644
--- a/Modules/_heapqmodule.c
+++ b/Modules/_heapqmodule.c
@@ -62,7 +62,7 @@
 static int
 _siftup(PyListObject *heap, Py_ssize_t pos)
 {
-    Py_ssize_t startpos, endpos, childpos, rightpos;
+    Py_ssize_t startpos, endpos, childpos, rightpos, limit;
     int cmp;
     PyObject *newitem, *tmp, *olditem;
     Py_ssize_t size;
@@ -79,9 +79,10 @@
     Py_INCREF(newitem);
 
     /* Bubble up the smaller child until hitting a leaf. */
-    childpos = 2*pos + 1;    /* leftmost child position  */
-    while (childpos < endpos) {
+    limit = endpos / 2;          /* smallest pos that has no child */
+    while (pos < limit) {
         /* Set childpos to index of smaller child.   */
+        childpos = 2*pos + 1;    /* leftmost child position  */
         rightpos = childpos + 1;
         if (rightpos < endpos) {
             cmp = PyObject_RichCompareBool(
@@ -108,7 +109,6 @@
         PyList_SET_ITEM(heap, pos, tmp);
         Py_DECREF(olditem);
         pos = childpos;
-        childpos = 2*pos + 1;
         if (size != PyList_GET_SIZE(heap)) {
             PyErr_SetString(PyExc_RuntimeError,
                             "list changed size during iteration");
@@ -168,7 +168,10 @@
 
     lastelt = PyList_GET_ITEM(heap, n-1) ;
     Py_INCREF(lastelt);
-    PyList_SetSlice(heap, n-1, n, NULL);
+    if (PyList_SetSlice(heap, n-1, n, NULL) < 0) {
+        Py_DECREF(lastelt);
+        return NULL;
+    }
     n--;
 
     if (!n)
@@ -416,7 +419,7 @@
 static int
 _siftupmax(PyListObject *heap, Py_ssize_t pos)
 {
-    Py_ssize_t startpos, endpos, childpos, rightpos;
+    Py_ssize_t startpos, endpos, childpos, rightpos, limit;
     int cmp;
     PyObject *newitem, *tmp;
 
@@ -431,9 +434,10 @@
     Py_INCREF(newitem);
 
     /* Bubble up the smaller child until hitting a leaf. */
-    childpos = 2*pos + 1;    /* leftmost child position  */
-    while (childpos < endpos) {
+    limit = endpos / 2;          /* smallest pos that has no child */
+    while (pos < limit) {
         /* Set childpos to index of smaller child.   */
+        childpos = 2*pos + 1;    /* leftmost child position  */
         rightpos = childpos + 1;
         if (rightpos < endpos) {
             cmp = PyObject_RichCompareBool(
@@ -453,7 +457,6 @@
         Py_DECREF(PyList_GET_ITEM(heap, pos));
         PyList_SET_ITEM(heap, pos, tmp);
         pos = childpos;
-        childpos = 2*pos + 1;
     }
 
     /* The leaf at pos is empty now.  Put newitem there, and bubble
diff --git a/Modules/_io/_iomodule.c b/Modules/_io/_iomodule.c
index 4a7e758..45c31a5 100644
--- a/Modules/_io/_iomodule.c
+++ b/Modules/_io/_iomodule.c
@@ -126,8 +126,7 @@
 "'b'       binary mode\n"
 "'t'       text mode (default)\n"
 "'+'       open a disk file for updating (reading and writing)\n"
-"'U'       universal newline mode (for backwards compatibility; unneeded\n"
-"          for new code)\n"
+"'U'       universal newline mode (deprecated)\n"
 "========= ===============================================================\n"
 "\n"
 "The default mode is 'rt' (open for reading text). For binary random\n"
@@ -143,6 +142,10 @@
 "returned as strings, the bytes having been first decoded using a\n"
 "platform-dependent encoding or using the specified encoding if given.\n"
 "\n"
+"'U' mode is deprecated and will raise an exception in future versions\n"
+"of Python.  It has no effect in Python 3.  Use newline to control\n"
+"universal newlines mode.\n"
+"\n"
 "buffering is an optional integer used to set the buffering policy.\n"
 "Pass 0 to switch buffering off (only allowed in binary mode), 1 to select\n"
 "line buffering (only usable in text mode), and an integer > 1 to indicate\n"
@@ -232,11 +235,12 @@
     char rawmode[6], *m;
     int line_buffering, isatty;
 
-    PyObject *raw, *modeobj = NULL, *buffer = NULL, *wrapper = NULL;
+    PyObject *raw, *modeobj = NULL, *buffer, *wrapper, *result = NULL;
 
     _Py_IDENTIFIER(isatty);
     _Py_IDENTIFIER(fileno);
     _Py_IDENTIFIER(mode);
+    _Py_IDENTIFIER(close);
 
     if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|sizzziO:open", kwlist,
                                      &file, &mode, &buffering,
@@ -310,6 +314,9 @@
                             "can't use U and writing mode at once");
             return NULL;
         }
+        if (PyErr_WarnEx(PyExc_DeprecationWarning,
+                         "'U' mode is deprecated", 1) < 0)
+            return NULL;
         reading = 1;
     }
 
@@ -348,6 +355,7 @@
                                 "OsiO", file, rawmode, closefd, opener);
     if (raw == NULL)
         return NULL;
+    result = raw;
 
     modeobj = PyUnicode_FromString(mode);
     if (modeobj == NULL)
@@ -406,7 +414,7 @@
         }
 
         Py_DECREF(modeobj);
-        return raw;
+        return result;
     }
 
     /* wraps into a buffered file */
@@ -427,15 +435,16 @@
 
         buffer = PyObject_CallFunction(Buffered_class, "Oi", raw, buffering);
     }
-    Py_CLEAR(raw);
     if (buffer == NULL)
         goto error;
+    result = buffer;
+    Py_DECREF(raw);
 
 
     /* if binary, returns the buffered file */
     if (binary) {
         Py_DECREF(modeobj);
-        return buffer;
+        return result;
     }
 
     /* wraps into a TextIOWrapper */
@@ -444,20 +453,26 @@
 				    buffer,
 				    encoding, errors, newline,
 				    line_buffering);
-    Py_CLEAR(buffer);
     if (wrapper == NULL)
         goto error;
+    result = wrapper;
+    Py_DECREF(buffer);
 
     if (_PyObject_SetAttrId(wrapper, &PyId_mode, modeobj) < 0)
         goto error;
     Py_DECREF(modeobj);
-    return wrapper;
+    return result;
 
   error:
-    Py_XDECREF(raw);
+    if (result != NULL) {
+        PyObject *exc, *val, *tb, *close_result;
+        PyErr_Fetch(&exc, &val, &tb);
+        close_result = _PyObject_CallMethodId(result, &PyId_close, NULL);
+        _PyErr_ChainExceptions(exc, val, tb);
+        Py_XDECREF(close_result);
+        Py_DECREF(result);
+    }
     Py_XDECREF(modeobj);
-    Py_XDECREF(buffer);
-    Py_XDECREF(wrapper);
     return NULL;
 }
 
@@ -533,6 +548,45 @@
 }
 
 
+_PyIO_State *
+_PyIO_get_module_state(void)
+{
+    PyObject *mod = PyState_FindModule(&_PyIO_Module);
+    _PyIO_State *state;
+    if (mod == NULL || (state = IO_MOD_STATE(mod)) == NULL) {
+        PyErr_SetString(PyExc_RuntimeError,
+                        "could not find io module state "
+                        "(interpreter shutdown?)");
+        return NULL;
+    }
+    return state;
+}
+
+PyObject *
+_PyIO_get_locale_module(_PyIO_State *state)
+{
+    PyObject *mod;
+    if (state->locale_module != NULL) {
+        assert(PyWeakref_CheckRef(state->locale_module));
+        mod = PyWeakref_GET_OBJECT(state->locale_module);
+        if (mod != Py_None) {
+            Py_INCREF(mod);
+            return mod;
+        }
+        Py_CLEAR(state->locale_module);
+    }
+    mod = PyImport_ImportModule("_bootlocale");
+    if (mod == NULL)
+        return NULL;
+    state->locale_module = PyWeakref_NewRef(mod, NULL);
+    if (state->locale_module == NULL) {
+        Py_DECREF(mod);
+        return NULL;
+    }
+    return mod;
+}
+
+
 static int
 iomodule_traverse(PyObject *mod, visitproc visit, void *arg) {
     _PyIO_State *state = IO_MOD_STATE(mod);
diff --git a/Modules/_io/_iomodule.h b/Modules/_io/_iomodule.h
index 0fe90a3..8927864 100644
--- a/Modules/_io/_iomodule.h
+++ b/Modules/_io/_iomodule.h
@@ -77,7 +77,7 @@
    long with "%lld" even when both long and long long have the same
    precision. */
 
-#if defined(MS_WIN64) || defined(MS_WINDOWS)
+#ifdef MS_WINDOWS
 
 /* Windows uses long long for offsets */
 typedef PY_LONG_LONG Py_off_t;
@@ -135,7 +135,10 @@
 } _PyIO_State;
 
 #define IO_MOD_STATE(mod) ((_PyIO_State *)PyModule_GetState(mod))
-#define IO_STATE IO_MOD_STATE(PyState_FindModule(&_PyIO_Module))
+#define IO_STATE() _PyIO_get_module_state()
+
+extern _PyIO_State *_PyIO_get_module_state(void);
+extern PyObject *_PyIO_get_locale_module(_PyIO_State *);
 
 extern PyObject *_PyIO_str_close;
 extern PyObject *_PyIO_str_closed;
diff --git a/Modules/_io/bufferedio.c b/Modules/_io/bufferedio.c
index ea0302b..02cf038 100644
--- a/Modules/_io/bufferedio.c
+++ b/Modules/_io/bufferedio.c
@@ -52,7 +52,6 @@
     Py_buffer buf;
     Py_ssize_t len;
     PyObject *data;
-    _Py_IDENTIFIER(read);
 
     if (!PyArg_ParseTuple(args, "w*:readinto", &buf)) {
         return NULL;
@@ -92,7 +91,9 @@
 static PyObject *
 bufferediobase_unsupported(const char *message)
 {
-    PyErr_SetString(IO_STATE->unsupported_operation, message);
+    _PyIO_State *state = IO_STATE();
+    if (state != NULL)
+        PyErr_SetString(state->unsupported_operation, message);
     return NULL;
 }
 
@@ -190,7 +191,8 @@
     0,                          /*tp_getattro*/
     0,                          /*tp_setattro*/
     0,                          /*tp_as_buffer*/
-    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,  /*tp_flags*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE
+        | Py_TPFLAGS_HAVE_FINALIZE,  /*tp_flags*/
     bufferediobase_doc,         /* tp_doc */
     0,                          /* tp_traverse */
     0,                          /* tp_clear */
@@ -209,6 +211,16 @@
     0,                          /* tp_init */
     0,                          /* tp_alloc */
     0,                          /* tp_new */
+    0,                          /* tp_free */
+    0,                          /* tp_is_gc */
+    0,                          /* tp_bases */
+    0,                          /* tp_mro */
+    0,                          /* tp_cache */
+    0,                          /* tp_subclasses */
+    0,                          /* tp_weaklist */
+    0,                          /* tp_del */
+    0,                          /* tp_version_tag */
+    0,                          /* tp_finalize */
 };
 
 
@@ -220,7 +232,7 @@
     int detached;
     int readable;
     int writable;
-    int deallocating;
+    char finalizing;
 
     /* True if this is a vanilla Buffered object (rather than a user derived
        class) *and* the raw stream is a vanilla FileIO object. */
@@ -384,8 +396,8 @@
 static void
 buffered_dealloc(buffered *self)
 {
-    self->deallocating = 1;
-    if (self->ok && _PyIOBase_finalize((PyObject *) self) < 0)
+    self->finalizing = 1;
+    if (_PyIOBase_finalize((PyObject *) self) < 0)
         return;
     _PyObject_GC_UNTRACK(self);
     self->ok = 0;
@@ -428,8 +440,6 @@
 static int
 buffered_clear(buffered *self)
 {
-    if (self->ok && _PyIOBase_finalize((PyObject *) self) < 0)
-        return -1;
     self->ok = 0;
     Py_CLEAR(self->raw);
     Py_CLEAR(self->dict);
@@ -508,7 +518,7 @@
         goto end;
     }
 
-    if (self->deallocating) {
+    if (self->finalizing) {
         PyObject *r = buffered_dealloc_warn(self, (PyObject *) self);
         if (r)
             Py_DECREF(r);
@@ -527,20 +537,14 @@
 
     res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_close, NULL);
 
+    if (self->buffer) {
+        PyMem_Free(self->buffer);
+        self->buffer = 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);
-        }
+        _PyErr_ChainExceptions(exc, val, tb);
+        Py_CLEAR(res);
     }
 
 end:
@@ -658,6 +662,11 @@
 _set_BlockingIOError(char *msg, Py_ssize_t written)
 {
     PyObject *err;
+#ifdef Py_DEBUG
+    /* in debug mode, PyEval_EvalFrameEx() fails with an assertion error
+       if an exception is set when it is called */
+    PyErr_Clear();
+#endif
     err = PyObject_CallFunction(PyExc_BlockingIOError, "isn",
                                 errno, msg, written);
     if (err)
@@ -1350,7 +1359,7 @@
 
     nameobj = _PyObject_GetAttrId((PyObject *) self, &PyId_name);
     if (nameobj == NULL) {
-        if (PyErr_ExceptionMatches(PyExc_AttributeError))
+        if (PyErr_ExceptionMatches(PyExc_Exception))
             PyErr_Clear();
         else
             return NULL;
@@ -1739,6 +1748,7 @@
 
 static PyMemberDef bufferedreader_members[] = {
     {"raw", T_OBJECT, offsetof(buffered, raw), READONLY},
+    {"_finalizing", T_BOOL, offsetof(buffered, finalizing), 0},
     {NULL}
 };
 
@@ -1771,7 +1781,7 @@
     0,                          /*tp_setattro*/
     0,                          /*tp_as_buffer*/
     Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE
-            | Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+        | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
     bufferedreader_doc,         /* tp_doc */
     (traverseproc)buffered_traverse, /* tp_traverse */
     (inquiry)buffered_clear,    /* tp_clear */
@@ -1790,6 +1800,16 @@
     (initproc)bufferedreader_init, /* tp_init */
     0,                          /* tp_alloc */
     PyType_GenericNew,          /* tp_new */
+    0,                          /* tp_free */
+    0,                          /* tp_is_gc */
+    0,                          /* tp_bases */
+    0,                          /* tp_mro */
+    0,                          /* tp_cache */
+    0,                          /* tp_subclasses */
+    0,                          /* tp_weaklist */
+    0,                          /* tp_del */
+    0,                          /* tp_version_tag */
+    0,                          /* tp_finalize */
 };
 
 
@@ -2120,6 +2140,7 @@
 
 static PyMemberDef bufferedwriter_members[] = {
     {"raw", T_OBJECT, offsetof(buffered, raw), READONLY},
+    {"_finalizing", T_BOOL, offsetof(buffered, finalizing), 0},
     {NULL}
 };
 
@@ -2152,7 +2173,7 @@
     0,                          /*tp_setattro*/
     0,                          /*tp_as_buffer*/
     Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE
-        | Py_TPFLAGS_HAVE_GC,   /*tp_flags*/
+        | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,   /*tp_flags*/
     bufferedwriter_doc,         /* tp_doc */
     (traverseproc)buffered_traverse, /* tp_traverse */
     (inquiry)buffered_clear,    /* tp_clear */
@@ -2171,6 +2192,16 @@
     (initproc)bufferedwriter_init, /* tp_init */
     0,                          /* tp_alloc */
     PyType_GenericNew,          /* tp_new */
+    0,                          /* tp_free */
+    0,                          /* tp_is_gc */
+    0,                          /* tp_bases */
+    0,                          /* tp_mro */
+    0,                          /* tp_cache */
+    0,                          /* tp_subclasses */
+    0,                          /* tp_weaklist */
+    0,                          /* tp_del */
+    0,                          /* tp_version_tag */
+    0,                          /* tp_finalize */
 };
 
 
@@ -2413,7 +2444,7 @@
     0,                          /*tp_setattro*/
     0,                          /*tp_as_buffer*/
     Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE
-        | Py_TPFLAGS_HAVE_GC,   /* tp_flags */
+        | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,   /* tp_flags */
     bufferedrwpair_doc,         /* tp_doc */
     (traverseproc)bufferedrwpair_traverse, /* tp_traverse */
     (inquiry)bufferedrwpair_clear, /* tp_clear */
@@ -2432,6 +2463,16 @@
     (initproc)bufferedrwpair_init, /* tp_init */
     0,                          /* tp_alloc */
     PyType_GenericNew,          /* tp_new */
+    0,                          /* tp_free */
+    0,                          /* tp_is_gc */
+    0,                          /* tp_bases */
+    0,                          /* tp_mro */
+    0,                          /* tp_cache */
+    0,                          /* tp_subclasses */
+    0,                          /* tp_weaklist */
+    0,                          /* tp_del */
+    0,                          /* tp_version_tag */
+    0,                          /* tp_finalize */
 };
 
 
@@ -2519,6 +2560,7 @@
 
 static PyMemberDef bufferedrandom_members[] = {
     {"raw", T_OBJECT, offsetof(buffered, raw), READONLY},
+    {"_finalizing", T_BOOL, offsetof(buffered, finalizing), 0},
     {NULL}
 };
 
@@ -2551,7 +2593,7 @@
     0,                          /*tp_setattro*/
     0,                          /*tp_as_buffer*/
     Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE
-        | Py_TPFLAGS_HAVE_GC,   /*tp_flags*/
+        | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,   /*tp_flags*/
     bufferedrandom_doc,         /* tp_doc */
     (traverseproc)buffered_traverse, /* tp_traverse */
     (inquiry)buffered_clear,    /* tp_clear */
@@ -2570,4 +2612,14 @@
     (initproc)bufferedrandom_init, /* tp_init */
     0,                          /* tp_alloc */
     PyType_GenericNew,          /* tp_new */
+    0,                          /* tp_free */
+    0,                          /* tp_is_gc */
+    0,                          /* tp_bases */
+    0,                          /* tp_mro */
+    0,                          /* tp_cache */
+    0,                          /* tp_subclasses */
+    0,                          /* tp_weaklist */
+    0,                          /* tp_del */
+    0,                          /* tp_version_tag */
+    0,                          /* tp_finalize */
 };
diff --git a/Modules/_io/bytesio.c b/Modules/_io/bytesio.c
index 54840bb..57c2073 100644
--- a/Modules/_io/bytesio.c
+++ b/Modules/_io/bytesio.c
@@ -437,17 +437,18 @@
 "is set not to block as has no data to read.");
 
 static PyObject *
-bytesio_readinto(bytesio *self, PyObject *buffer)
+bytesio_readinto(bytesio *self, PyObject *arg)
 {
-    void *raw_buffer;
+    Py_buffer buffer;
     Py_ssize_t len, n;
 
     CHECK_CLOSED(self);
 
-    if (PyObject_AsWriteBuffer(buffer, &raw_buffer, &len) == -1)
+    if (!PyArg_Parse(arg, "w*", &buffer))
         return NULL;
 
     /* adjust invalid sizes */
+    len = buffer.len;
     n = self->string_size - self->pos;
     if (len > n) {
         len = n;
@@ -455,10 +456,11 @@
             len = 0;
     }
 
-    memcpy(raw_buffer, self->buf + self->pos, len);
+    memcpy(buffer.buf, self->buf + self->pos, len);
     assert(self->pos + len < PY_SSIZE_T_MAX);
     assert(len >= 0);
     self->pos += len;
+    PyBuffer_Release(&buffer);
 
     return PyLong_FromSsize_t(len);
 }
diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c
index f3ce776..a2b253b 100644
--- a/Modules/_io/fileio.c
+++ b/Modules/_io/fileio.c
@@ -52,13 +52,15 @@
     unsigned int appending : 1;
     signed int seekable : 2; /* -1 means unknown */
     unsigned int closefd : 1;
-    unsigned int deallocating: 1;
+    char finalizing;
     PyObject *weakreflist;
     PyObject *dict;
 } fileio;
 
 PyTypeObject PyFileIO_Type;
 
+_Py_IDENTIFIER(name);
+
 #define PyFileIO_Check(op) (PyObject_TypeCheck((op), &PyFileIO_Type))
 
 int
@@ -129,7 +131,7 @@
         self->fd = -1;
         Py_RETURN_NONE;
     }
-    if (self->deallocating) {
+    if (self->finalizing) {
         PyObject *r = fileio_dealloc_warn(self, (PyObject *) self);
         if (r)
             Py_DECREF(r);
@@ -204,6 +206,9 @@
     return 0;
 }
 
+#ifdef O_CLOEXEC
+extern int _Py_open_cloexec_works;
+#endif
 
 static int
 fileio_init(PyObject *oself, PyObject *args, PyObject *kwds)
@@ -223,6 +228,11 @@
     int fd = -1;
     int closefd = 1;
     int fd_is_own = 0;
+#ifdef O_CLOEXEC
+    int *atomic_flag_works = &_Py_open_cloexec_works;
+#elif !defined(MS_WINDOWS)
+    int *atomic_flag_works = NULL;
+#endif
 
     assert(PyFileIO_Check(oself));
     if (self->fd >= 0) {
@@ -343,6 +353,12 @@
     flags |= O_BINARY;
 #endif
 
+#ifdef MS_WINDOWS
+    flags |= O_NOINHERIT;
+#elif defined(O_CLOEXEC)
+    flags |= O_CLOEXEC;
+#endif
+
     if (fd >= 0) {
         if (check_fd(fd))
             goto error;
@@ -366,10 +382,18 @@
             else
 #endif
                 self->fd = open(name, flags, 0666);
+
             Py_END_ALLOW_THREADS
-        } else {
-            PyObject *fdobj = PyObject_CallFunction(
-                                  opener, "Oi", nameobj, flags);
+        }
+        else {
+            PyObject *fdobj;
+
+#ifndef MS_WINDOWS
+            /* the opener may clear the atomic flag */
+            atomic_flag_works = NULL;
+#endif
+
+            fdobj = PyObject_CallFunction(opener, "Oi", nameobj, flags);
             if (fdobj == NULL)
                 goto error;
             if (!PyLong_Check(fdobj)) {
@@ -388,14 +412,14 @@
 
         fd_is_own = 1;
         if (self->fd < 0) {
-#ifdef MS_WINDOWS
-            if (widename != NULL)
-                PyErr_SetFromErrnoWithFilenameObject(PyExc_IOError, nameobj);
-            else
-#endif
-                PyErr_SetFromErrnoWithFilename(PyExc_IOError, name);
+            PyErr_SetFromErrnoWithFilenameObject(PyExc_OSError, nameobj);
             goto error;
         }
+
+#ifndef MS_WINDOWS
+        if (_Py_set_inheritable(self->fd, 0, atomic_flag_works) < 0)
+            goto error;
+#endif
     }
     if (dircheck(self, nameobj) < 0)
         goto error;
@@ -405,7 +429,7 @@
     _setmode(self->fd, O_BINARY);
 #endif
 
-    if (PyObject_SetAttrString((PyObject *)self, "name", nameobj) < 0)
+    if (_PyObject_SetAttrId((PyObject *)self, &PyId_name, nameobj) < 0)
         goto error;
 
     if (self->appending) {
@@ -449,7 +473,7 @@
 static void
 fileio_dealloc(fileio *self)
 {
-    self->deallocating = 1;
+    self->finalizing = 1;
     if (_PyIOBase_finalize((PyObject *) self) < 0)
         return;
     _PyObject_GC_UNTRACK(self);
@@ -469,8 +493,10 @@
 static PyObject *
 err_mode(char *action)
 {
-    PyErr_Format(IO_STATE->unsupported_operation,
-                 "File not open for %s", action);
+    _PyIO_State *state = IO_STATE();
+    if (state != NULL)
+        PyErr_Format(state->unsupported_operation,
+                     "File not open for %s", action);
     return NULL;
 }
 
@@ -535,7 +561,7 @@
         len = pbuf.len;
         Py_BEGIN_ALLOW_THREADS
         errno = 0;
-#if defined(MS_WIN64) || defined(MS_WINDOWS)
+#ifdef MS_WINDOWS
         if (len > INT_MAX)
             len = INT_MAX;
         n = read(self->fd, pbuf.buf, (int)len);
@@ -558,33 +584,27 @@
     return PyLong_FromSsize_t(n);
 }
 
+#ifndef HAVE_FSTAT
+
+static PyObject *
+fileio_readall(fileio *self)
+{
+    _Py_IDENTIFIER(readall);
+    return _PyObject_CallMethodId((PyObject*)&PyRawIOBase_Type,
+                                  &PyId_readall, "O", self);
+}
+
+#else
+
 static size_t
-new_buffersize(fileio *self, size_t currentsize
-#ifdef HAVE_FSTAT
-               , Py_off_t pos, Py_off_t end
-#endif
-               )
+new_buffersize(fileio *self, size_t currentsize)
 {
     size_t addend;
-#ifdef HAVE_FSTAT
-    if (end != (Py_off_t)-1) {
-        /* Files claiming a size smaller than SMALLCHUNK may
-           actually be streaming pseudo-files. In this case, we
-           apply the more aggressive algorithm below.
-        */
-        if (end >= SMALLCHUNK && end >= pos && pos >= 0) {
-            /* Add 1 so if the file were to grow we'd notice. */
-            Py_off_t bufsize = currentsize + end - pos + 1;
-            if (bufsize < PY_SSIZE_T_MAX)
-                return (size_t)bufsize;
-            else
-                return PY_SSIZE_T_MAX;
-        }
-    }
-#endif
+
     /* Expand the buffer by an amount proportional to the current size,
        giving us amortized linear-time behavior.  For bigger sizes, use a
        less-than-double growth factor to avoid excessive allocation. */
+    assert(currentsize <= PY_SSIZE_T_MAX);
     if (currentsize > 65536)
         addend = currentsize >> 3;
     else
@@ -598,26 +618,19 @@
 static PyObject *
 fileio_readall(fileio *self)
 {
-#ifdef HAVE_FSTAT
     struct stat st;
     Py_off_t pos, end;
-#endif
     PyObject *result;
-    Py_ssize_t total = 0;
+    Py_ssize_t bytes_read = 0;
     Py_ssize_t n;
-    size_t newsize;
+    size_t bufsize;
 
     if (self->fd < 0)
         return err_closed();
     if (!_PyVerify_fd(self->fd))
         return PyErr_SetFromErrno(PyExc_IOError);
 
-    result = PyBytes_FromStringAndSize(NULL, SMALLCHUNK);
-    if (result == NULL)
-        return NULL;
-
-#ifdef HAVE_FSTAT
-#if defined(MS_WIN64) || defined(MS_WINDOWS)
+#ifdef MS_WINDOWS
     pos = _lseeki64(self->fd, 0L, SEEK_CUR);
 #else
     pos = lseek(self->fd, 0L, SEEK_CUR);
@@ -626,44 +639,46 @@
         end = st.st_size;
     else
         end = (Py_off_t)-1;
-#endif
-    while (1) {
-#ifdef HAVE_FSTAT
-        newsize = new_buffersize(self, total, pos, end);
-#else
-        newsize = new_buffersize(self, total);
-#endif
-        if (newsize > PY_SSIZE_T_MAX || newsize <= 0) {
-            PyErr_SetString(PyExc_OverflowError,
-                "unbounded read returned more bytes "
-                "than a Python string can hold ");
-            Py_DECREF(result);
-            return NULL;
-        }
 
-        if (PyBytes_GET_SIZE(result) < (Py_ssize_t)newsize) {
-            if (_PyBytes_Resize(&result, newsize) < 0) {
-                if (total == 0) {
-                    Py_DECREF(result);
+    if (end > 0 && end >= pos && pos >= 0 && end - pos < PY_SSIZE_T_MAX) {
+        /* This is probably a real file, so we try to allocate a
+           buffer one byte larger than the rest of the file.  If the
+           calculation is right then we should get EOF without having
+           to enlarge the buffer. */
+        bufsize = (size_t)(end - pos + 1);
+    } else {
+        bufsize = SMALLCHUNK;
+    }
+
+    result = PyBytes_FromStringAndSize(NULL, bufsize);
+    if (result == NULL)
+        return NULL;
+
+    while (1) {
+        if (bytes_read >= (Py_ssize_t)bufsize) {
+            bufsize = new_buffersize(self, bytes_read);
+            if (bufsize > PY_SSIZE_T_MAX || bufsize <= 0) {
+                PyErr_SetString(PyExc_OverflowError,
+                                "unbounded read returned more bytes "
+                                "than a Python string can hold");
+                Py_DECREF(result);
+                return NULL;
+            }
+
+            if (PyBytes_GET_SIZE(result) < (Py_ssize_t)bufsize) {
+                if (_PyBytes_Resize(&result, bufsize) < 0)
                     return NULL;
-                }
-                PyErr_Clear();
-                break;
             }
         }
         Py_BEGIN_ALLOW_THREADS
         errno = 0;
-        n = newsize - total;
-#if defined(MS_WIN64) || defined(MS_WINDOWS)
+        n = bufsize - bytes_read;
+#ifdef MS_WINDOWS
         if (n > INT_MAX)
             n = INT_MAX;
-        n = read(self->fd,
-                 PyBytes_AS_STRING(result) + total,
-                 (int)n);
+        n = read(self->fd, PyBytes_AS_STRING(result) + bytes_read, (int)n);
 #else
-        n = read(self->fd,
-                 PyBytes_AS_STRING(result) + total,
-                 n);
+        n = read(self->fd, PyBytes_AS_STRING(result) + bytes_read, n);
 #endif
         Py_END_ALLOW_THREADS
         if (n == 0)
@@ -676,9 +691,9 @@
                 }
                 continue;
             }
-            if (total > 0)
-                break;
             if (errno == EAGAIN) {
+                if (bytes_read > 0)
+                    break;
                 Py_DECREF(result);
                 Py_RETURN_NONE;
             }
@@ -686,22 +701,19 @@
             PyErr_SetFromErrno(PyExc_IOError);
             return NULL;
         }
-        total += n;
-#ifdef HAVE_FSTAT
+        bytes_read += n;
         pos += n;
-#endif
     }
 
-    if (PyBytes_GET_SIZE(result) > total) {
-        if (_PyBytes_Resize(&result, total) < 0) {
-            /* This should never happen, but just in case */
-            Py_DECREF(result);
+    if (PyBytes_GET_SIZE(result) > bytes_read) {
+        if (_PyBytes_Resize(&result, bytes_read) < 0)
             return NULL;
-        }
     }
     return result;
 }
 
+#endif /* HAVE_FSTAT */
+
 static PyObject *
 fileio_read(fileio *self, PyObject *args)
 {
@@ -722,7 +734,7 @@
         return fileio_readall(self);
     }
 
-#if defined(MS_WIN64) || defined(MS_WINDOWS)
+#ifdef MS_WINDOWS
     if (size > INT_MAX)
         size = INT_MAX;
 #endif
@@ -734,7 +746,7 @@
     if (_PyVerify_fd(self->fd)) {
         Py_BEGIN_ALLOW_THREADS
         errno = 0;
-#if defined(MS_WIN64) || defined(MS_WINDOWS)
+#ifdef MS_WINDOWS
         n = read(self->fd, ptr, (int)size);
 #else
         n = read(self->fd, ptr, size);
@@ -755,7 +767,7 @@
 
     if (n != size) {
         if (_PyBytes_Resize(&bytes, n) < 0) {
-            Py_DECREF(bytes);
+            Py_CLEAR(bytes);
             return NULL;
         }
     }
@@ -782,7 +794,7 @@
         Py_BEGIN_ALLOW_THREADS
         errno = 0;
         len = pbuf.len;
-#if defined(MS_WIN64) || defined(MS_WINDOWS)
+#ifdef MS_WINDOWS
         if (len > 32767 && isatty(self->fd)) {
             /* Issue #11395: the Windows console returns an error (12: not
                enough space error) on writing into stdout if stdout mode is
@@ -855,7 +867,7 @@
 
     if (_PyVerify_fd(fd)) {
         Py_BEGIN_ALLOW_THREADS
-#if defined(MS_WIN64) || defined(MS_WINDOWS)
+#ifdef MS_WINDOWS
         res = _lseeki64(fd, pos, whence);
 #else
         res = lseek(fd, pos, whence);
@@ -1028,7 +1040,6 @@
 static PyObject *
 fileio_repr(fileio *self)
 {
-    _Py_IDENTIFIER(name);
     PyObject *nameobj, *res;
 
     if (self->fd < 0)
@@ -1113,7 +1124,8 @@
 "This is needed for lower-level file interfaces, such the fcntl module.");
 
 PyDoc_STRVAR(seek_doc,
-"seek(offset: int[, whence: int]) -> None.  Move to new file position.\n"
+"seek(offset: int[, whence: int]) -> int.  Move to new file position and\n"
+"return the file position.\n"
 "\n"
 "Argument offset is a byte count.  Optional argument whence defaults to\n"
 "0 (offset from start of file, offset should be >= 0); other values are 1\n"
@@ -1125,9 +1137,10 @@
 
 #ifdef HAVE_FTRUNCATE
 PyDoc_STRVAR(truncate_doc,
-"truncate([size: int]) -> None.  Truncate the file to at most size bytes.\n"
+"truncate([size: int]) -> int.  Truncate the file to at most size bytes\n"
+"and return the truncated size.\n"
 "\n"
-"Size defaults to the current file position, as returned by tell()."
+"Size defaults to the current file position, as returned by tell().\n"
 "The current file position is changed to the value of size.");
 #endif
 
@@ -1204,6 +1217,11 @@
     {NULL},
 };
 
+static PyMemberDef fileio_members[] = {
+    {"_finalizing", T_BOOL, offsetof(fileio, finalizing), 0},
+    {NULL}
+};
+
 PyTypeObject PyFileIO_Type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "_io.FileIO",
@@ -1225,7 +1243,7 @@
     0,                                          /* tp_setattro */
     0,                                          /* tp_as_buffer */
     Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE
-                    | Py_TPFLAGS_HAVE_GC,       /* tp_flags */
+        | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,       /* tp_flags */
     fileio_doc,                                 /* tp_doc */
     (traverseproc)fileio_traverse,              /* tp_traverse */
     (inquiry)fileio_clear,                      /* tp_clear */
@@ -1234,7 +1252,7 @@
     0,                                          /* tp_iter */
     0,                                          /* tp_iternext */
     fileio_methods,                             /* tp_methods */
-    0,                                          /* tp_members */
+    fileio_members,                             /* tp_members */
     fileio_getsetlist,                          /* tp_getset */
     0,                                          /* tp_base */
     0,                                          /* tp_dict */
@@ -1245,4 +1263,13 @@
     PyType_GenericAlloc,                        /* tp_alloc */
     fileio_new,                                 /* tp_new */
     PyObject_GC_Del,                            /* tp_free */
+    0,                                          /* tp_is_gc */
+    0,                                          /* tp_bases */
+    0,                                          /* tp_mro */
+    0,                                          /* tp_cache */
+    0,                                          /* tp_subclasses */
+    0,                                          /* tp_weaklist */
+    0,                                          /* tp_del */
+    0,                                          /* tp_version_tag */
+    0,                                          /* tp_finalize */
 };
diff --git a/Modules/_io/iobase.c b/Modules/_io/iobase.c
index e38473a..ef06b43 100644
--- a/Modules/_io/iobase.c
+++ b/Modules/_io/iobase.c
@@ -1,9 +1,9 @@
 /*
     An implementation of the I/O abstract base classes hierarchy
     as defined by PEP 3116 - "New I/O"
-    
+
     Classes defined here: IOBase, RawIOBase.
-    
+
     Written by Amaury Forgeot d'Arc and Antoine Pitrou
 */
 
@@ -19,7 +19,7 @@
 
 typedef struct {
     PyObject_HEAD
-    
+
     PyObject *dict;
     PyObject *weakreflist;
 } iobase;
@@ -42,8 +42,8 @@
     "bytes. bytearrays are accepted too, and in some cases (such as\n"
     "readinto) needed. Text I/O classes work with str data.\n"
     "\n"
-    "Note that calling any method (even inquiries) on a closed stream is\n"
-    "undefined. Implementations may raise IOError in this case.\n"
+    "Note that calling any method (except additional calls to close(),\n"
+    "which are ignored) on a closed stream should raise a ValueError.\n"
     "\n"
     "IOBase (and its subclasses) support the iterator protocol, meaning\n"
     "that an IOBase object can be iterated over yielding the lines in a\n"
@@ -63,11 +63,15 @@
 #define IS_CLOSED(self) \
     _PyObject_HasAttrId(self, &PyId___IOBase_closed)
 
+_Py_IDENTIFIER(read);
+
 /* Internal methods */
 static PyObject *
 iobase_unsupported(const char *message)
 {
-    PyErr_SetString(IO_STATE->unsupported_operation, message);
+    _PyIO_State *state = IO_STATE();
+    if (state != NULL)
+        PyErr_SetString(state->unsupported_operation, message);
     return NULL;
 }
 
@@ -180,42 +184,44 @@
 iobase_close(PyObject *self, PyObject *args)
 {
     PyObject *res;
-    _Py_IDENTIFIER(__IOBase_closed);
 
     if (IS_CLOSED(self))
         Py_RETURN_NONE;
 
     res = PyObject_CallMethodObjArgs(self, _PyIO_str_flush, NULL);
-    _PyObject_SetAttrId(self, &PyId___IOBase_closed, Py_True);
-    if (res == NULL) {
+
+    if (_PyObject_SetAttrId(self, &PyId___IOBase_closed, Py_True) < 0) {
+        Py_XDECREF(res);
         return NULL;
     }
-    Py_XDECREF(res);
+
+    if (res == NULL)
+        return NULL;
+
+    Py_DECREF(res);
     Py_RETURN_NONE;
 }
 
 /* Finalization and garbage collection support */
 
-int
-_PyIOBase_finalize(PyObject *self)
+static void
+iobase_finalize(PyObject *self)
 {
     PyObject *res;
-    PyObject *tp, *v, *tb;
-    int closed = 1;
-    int is_zombie;
+    PyObject *error_type, *error_value, *error_traceback;
+    int closed;
+    _Py_IDENTIFIER(_finalizing);
 
-    /* If _PyIOBase_finalize() is called from a destructor, we need to
-       resurrect the object as calling close() can invoke arbitrary code. */
-    is_zombie = (Py_REFCNT(self) == 0);
-    if (is_zombie) {
-        ++Py_REFCNT(self);
-    }
-    PyErr_Fetch(&tp, &v, &tb);
+    /* Save the current exception, if any. */
+    PyErr_Fetch(&error_type, &error_value, &error_traceback);
+
     /* If `closed` doesn't exist or can't be evaluated as bool, then the
        object is probably in an unusable state, so ignore. */
     res = PyObject_GetAttr(self, _PyIO_str_closed);
-    if (res == NULL)
+    if (res == NULL) {
         PyErr_Clear();
+        closed = -1;
+    }
     else {
         closed = PyObject_IsTrue(res);
         Py_DECREF(res);
@@ -223,6 +229,10 @@
             PyErr_Clear();
     }
     if (closed == 0) {
+        /* Signal close() that it was called as part of the object
+           finalization process. */
+        if (_PyObject_SetAttrId(self, &PyId__finalizing, Py_True))
+            PyErr_Clear();
         res = PyObject_CallMethodObjArgs((PyObject *) self, _PyIO_str_close,
                                           NULL);
         /* Silencing I/O errors is bad, but printing spurious tracebacks is
@@ -233,31 +243,25 @@
         else
             Py_DECREF(res);
     }
-    PyErr_Restore(tp, v, tb);
-    if (is_zombie) {
-        if (--Py_REFCNT(self) != 0) {
-            /* The object lives again. The following code is taken from
-               slot_tp_del in typeobject.c. */
-            Py_ssize_t refcnt = Py_REFCNT(self);
-            _Py_NewReference(self);
-            Py_REFCNT(self) = refcnt;
-            /* If Py_REF_DEBUG, _Py_NewReference bumped _Py_RefTotal, so
-             * we need to undo that. */
-            _Py_DEC_REFTOTAL;
-            /* If Py_TRACE_REFS, _Py_NewReference re-added self to the object
-             * chain, so no more to do there.
-             * If COUNT_ALLOCS, the original decref bumped tp_frees, and
-             * _Py_NewReference bumped tp_allocs:  both of those need to be
-             * undone.
-             */
-#ifdef COUNT_ALLOCS
-            --Py_TYPE(self)->tp_frees;
-            --Py_TYPE(self)->tp_allocs;
-#endif
-            return -1;
-        }
+
+    /* Restore the saved exception. */
+    PyErr_Restore(error_type, error_value, error_traceback);
+}
+
+int
+_PyIOBase_finalize(PyObject *self)
+{
+    int is_zombie;
+
+    /* If _PyIOBase_finalize() is called from a destructor, we need to
+       resurrect the object as calling close() can invoke arbitrary code. */
+    is_zombie = (Py_REFCNT(self) == 0);
+    if (is_zombie)
+        return PyObject_CallFinalizerFromDealloc(self);
+    else {
+        PyObject_CallFinalizer(self);
+        return 0;
     }
-    return 0;
 }
 
 static int
@@ -270,8 +274,6 @@
 static int
 iobase_clear(iobase *self)
 {
-    if (_PyIOBase_finalize((PyObject *) self) < 0)
-        return -1;
     Py_CLEAR(self->dict);
     return 0;
 }
@@ -455,7 +457,6 @@
     int has_peek = 0;
     PyObject *buffer, *result;
     Py_ssize_t old_size = -1;
-    _Py_IDENTIFIER(read);
     _Py_IDENTIFIER(peek);
 
     if (!PyArg_ParseTuple(args, "|O&:readline", &_PyIO_ConvertSsize_t, &limit)) {
@@ -536,7 +537,10 @@
         }
 
         old_size = PyByteArray_GET_SIZE(buffer);
-        PyByteArray_Resize(buffer, old_size + PyBytes_GET_SIZE(b));
+        if (PyByteArray_Resize(buffer, old_size + PyBytes_GET_SIZE(b)) < 0) {
+            Py_DECREF(b);
+            goto fail;
+        }
         memcpy(PyByteArray_AS_STRING(buffer) + old_size,
                PyBytes_AS_STRING(b), PyBytes_GET_SIZE(b));
 
@@ -741,7 +745,7 @@
     0,                          /*tp_setattro*/
     0,                          /*tp_as_buffer*/
     Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE
-        | Py_TPFLAGS_HAVE_GC,   /*tp_flags*/
+        | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,   /*tp_flags*/
     iobase_doc,                 /* tp_doc */
     (traverseproc)iobase_traverse, /* tp_traverse */
     (inquiry)iobase_clear,      /* tp_clear */
@@ -760,6 +764,16 @@
     0,                          /* tp_init */
     0,                          /* tp_alloc */
     PyType_GenericNew,          /* tp_new */
+    0,                          /* tp_free */
+    0,                          /* tp_is_gc */
+    0,                          /* tp_bases */
+    0,                          /* tp_mro */
+    0,                          /* tp_cache */
+    0,                          /* tp_subclasses */
+    0,                          /* tp_weaklist */
+    0,                          /* tp_del */
+    0,                          /* tp_version_tag */
+    (destructor)iobase_finalize, /* tp_finalize */
 };
 
 
@@ -831,12 +845,11 @@
     int r;
     PyObject *chunks = PyList_New(0);
     PyObject *result;
-    
+
     if (chunks == NULL)
         return NULL;
 
     while (1) {
-        _Py_IDENTIFIER(read);
         PyObject *data = _PyObject_CallMethodId(self, &PyId_read,
                                                 "i", DEFAULT_BUFFER_SIZE);
         if (!data) {
@@ -905,7 +918,7 @@
     0,                          /*tp_getattro*/
     0,                          /*tp_setattro*/
     0,                          /*tp_as_buffer*/
-    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,  /*tp_flags*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_FINALIZE,  /*tp_flags*/
     rawiobase_doc,              /* tp_doc */
     0,                          /* tp_traverse */
     0,                          /* tp_clear */
@@ -924,4 +937,14 @@
     0,                          /* tp_init */
     0,                          /* tp_alloc */
     0,                          /* tp_new */
+    0,                          /* tp_free */
+    0,                          /* tp_is_gc */
+    0,                          /* tp_bases */
+    0,                          /* tp_mro */
+    0,                          /* tp_cache */
+    0,                          /* tp_subclasses */
+    0,                          /* tp_weaklist */
+    0,                          /* tp_del */
+    0,                          /* tp_version_tag */
+    0,                          /* tp_finalize */
 };
diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c
index e8f9984..3f01980 100644
--- a/Modules/_io/textio.c
+++ b/Modules/_io/textio.c
@@ -45,7 +45,9 @@
 static PyObject *
 _unsupported(const char *message)
 {
-    PyErr_SetString(IO_STATE->unsupported_operation, message);
+    _PyIO_State *state = IO_STATE();
+    if (state != NULL)
+        PyErr_SetString(state->unsupported_operation, message);
     return NULL;
 }
 
@@ -173,7 +175,8 @@
     0,                          /*tp_getattro*/
     0,                          /*tp_setattro*/
     0,                          /*tp_as_buffer*/
-    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,  /*tp_flags*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE
+        | Py_TPFLAGS_HAVE_FINALIZE,  /*tp_flags*/
     textiobase_doc,             /* tp_doc */
     0,                          /* tp_traverse */
     0,                          /* tp_clear */
@@ -192,6 +195,16 @@
     0,                          /* tp_init */
     0,                          /* tp_alloc */
     0,                          /* tp_new */
+    0,                          /* tp_free */
+    0,                          /* tp_is_gc */
+    0,                          /* tp_bases */
+    0,                          /* tp_mro */
+    0,                          /* tp_cache */
+    0,                          /* tp_subclasses */
+    0,                          /* tp_weaklist */
+    0,                          /* tp_del */
+    0,                          /* tp_version_tag */
+    0,                          /* tp_finalize */
 };
 
 
@@ -691,7 +704,7 @@
     char seekable;
     char has_read1;
     char telling;
-    char deallocating;
+    char finalizing;
     /* Specialized encoding func (see below) */
     encodefunc_t encodefunc;
     /* Whether or not it's the start of the stream */
@@ -758,7 +771,7 @@
 {
     if (!self->encoding_start_of_stream) {
         /* Skip the BOM and use native byte ordering */
-#if defined(WORDS_BIGENDIAN)
+#if PY_BIG_ENDIAN
         return utf16be_encode(self, text);
 #else
         return utf16le_encode(self, text);
@@ -787,7 +800,7 @@
 {
     if (!self->encoding_start_of_stream) {
         /* Skip the BOM and use native byte ordering */
-#if defined(WORDS_BIGENDIAN)
+#if PY_BIG_ENDIAN
         return utf32be_encode(self, text);
 #else
         return utf32le_encode(self, text);
@@ -841,7 +854,7 @@
     char *errors = NULL;
     char *newline = NULL;
     int line_buffering = 0, write_through = 0;
-    _PyIO_State *state = IO_STATE;
+    _PyIO_State *state = NULL;
 
     PyObject *res;
     int r;
@@ -880,6 +893,9 @@
     if (encoding == NULL) {
         /* Try os.device_encoding(fileno) */
         PyObject *fileno;
+        state = IO_STATE();
+        if (state == NULL)
+            goto error;
         fileno = _PyObject_CallMethodId(buffer, &PyId_fileno, NULL);
         /* Ignore only AttributeError and UnsupportedOperation */
         if (fileno == NULL) {
@@ -906,35 +922,29 @@
         }
     }
     if (encoding == NULL && self->encoding == NULL) {
-        if (state->locale_module == NULL) {
-            state->locale_module = PyImport_ImportModule("locale");
-            if (state->locale_module == NULL)
-                goto catch_ImportError;
-            else
-                goto use_locale;
-        }
-        else {
-          use_locale:
-            self->encoding = _PyObject_CallMethodId(
-                state->locale_module, &PyId_getpreferredencoding, "O", Py_False);
-            if (self->encoding == NULL) {
-              catch_ImportError:
-                /*
-                 Importing locale can raise a ImportError because of
-                 _functools, and locale.getpreferredencoding can raise a
-                 ImportError if _locale is not available.  These will happen
-                 during module building.
-                */
-                if (PyErr_ExceptionMatches(PyExc_ImportError)) {
-                    PyErr_Clear();
-                    self->encoding = PyUnicode_FromString("ascii");
-                }
-                else
-                    goto error;
+        PyObject *locale_module = _PyIO_get_locale_module(state);
+        if (locale_module == NULL)
+            goto catch_ImportError;
+        self->encoding = _PyObject_CallMethodId(
+            locale_module, &PyId_getpreferredencoding, "O", Py_False);
+        Py_DECREF(locale_module);
+        if (self->encoding == NULL) {
+          catch_ImportError:
+            /*
+             Importing locale can raise a ImportError because of
+             _functools, and locale.getpreferredencoding can raise a
+             ImportError if _locale is not available.  These will happen
+             during module building.
+            */
+            if (PyErr_ExceptionMatches(PyExc_ImportError)) {
+                PyErr_Clear();
+                self->encoding = PyUnicode_FromString("ascii");
             }
-            else if (!PyUnicode_Check(self->encoding))
-                Py_CLEAR(self->encoding);
+            else
+                goto error;
         }
+        else if (!PyUnicode_Check(self->encoding))
+            Py_CLEAR(self->encoding);
     }
     if (self->encoding != NULL) {
         encoding = _PyUnicode_AsString(self->encoding);
@@ -1051,7 +1061,7 @@
     }
 
     /* Finished sorting out the codec details */
-    Py_DECREF(codec_info);
+    Py_CLEAR(codec_info);
 
     self->buffer = buffer;
     Py_INCREF(buffer);
@@ -1122,8 +1132,6 @@
 static int
 _textiowrapper_clear(textio *self)
 {
-    if (self->ok && _PyIOBase_finalize((PyObject *) self) < 0)
-        return -1;
     self->ok = 0;
     Py_CLEAR(self->buffer);
     Py_CLEAR(self->encoding);
@@ -1141,9 +1149,10 @@
 static void
 textiowrapper_dealloc(textio *self)
 {
-    self->deallocating = 1;
-    if (_textiowrapper_clear(self) < 0)
+    self->finalizing = 1;
+    if (_PyIOBase_finalize((PyObject *) self) < 0)
         return;
+    _textiowrapper_clear(self);
     _PyObject_GC_UNTRACK(self);
     if (self->weakreflist != NULL)
         PyObject_ClearWeakRefs((PyObject *)self);
@@ -1210,25 +1219,27 @@
 
 #define CHECK_INITIALIZED(self) \
     if (self->ok <= 0) { \
-        if (self->detached) { \
-            PyErr_SetString(PyExc_ValueError, \
-                 "underlying buffer has been detached"); \
-        } else {                                   \
-            PyErr_SetString(PyExc_ValueError, \
-                "I/O operation on uninitialized object"); \
-        } \
+        PyErr_SetString(PyExc_ValueError, \
+            "I/O operation on uninitialized object"); \
         return NULL; \
     }
 
-#define CHECK_INITIALIZED_INT(self) \
+#define CHECK_ATTACHED(self) \
+    CHECK_INITIALIZED(self); \
+    if (self->detached) { \
+        PyErr_SetString(PyExc_ValueError, \
+             "underlying buffer has been detached"); \
+        return NULL; \
+    }
+
+#define CHECK_ATTACHED_INT(self) \
     if (self->ok <= 0) { \
-        if (self->detached) { \
-            PyErr_SetString(PyExc_ValueError, \
-                 "underlying buffer has been detached"); \
-        } else {                                   \
-            PyErr_SetString(PyExc_ValueError, \
-                "I/O operation on uninitialized object"); \
-        } \
+        PyErr_SetString(PyExc_ValueError, \
+            "I/O operation on uninitialized object"); \
+        return -1; \
+    } else if (self->detached) { \
+        PyErr_SetString(PyExc_ValueError, \
+             "underlying buffer has been detached"); \
         return -1; \
     }
 
@@ -1237,7 +1248,7 @@
 textiowrapper_detach(textio *self)
 {
     PyObject *buffer, *res;
-    CHECK_INITIALIZED(self);
+    CHECK_ATTACHED(self);
     res = PyObject_CallMethodObjArgs((PyObject *)self, _PyIO_str_flush, NULL);
     if (res == NULL)
         return NULL;
@@ -1245,7 +1256,6 @@
     buffer = self->buffer;
     self->buffer = NULL;
     self->detached = 1;
-    self->ok = 0;
     return buffer;
 }
 
@@ -1288,9 +1298,9 @@
     PyObject *b;
     Py_ssize_t textlen;
     int haslf = 0;
-    int needflush = 0;
+    int needflush = 0, text_needflush = 0;
 
-    CHECK_INITIALIZED(self);
+    CHECK_ATTACHED(self);
 
     if (!PyArg_ParseTuple(args, "U:write", &text)) {
         return NULL;
@@ -1322,8 +1332,8 @@
     }
 
     if (self->write_through)
-        needflush = 1;
-    else if (self->line_buffering &&
+        text_needflush = 1;
+    if (self->line_buffering &&
         (haslf ||
          PyUnicode_FindChar(text, '\r', 0, PyUnicode_GET_LENGTH(text), 1) != -1))
         needflush = 1;
@@ -1354,7 +1364,8 @@
     }
     self->pending_bytes_count += PyBytes_GET_SIZE(b);
     Py_DECREF(b);
-    if (self->pending_bytes_count > self->chunk_size || needflush) {
+    if (self->pending_bytes_count > self->chunk_size || needflush ||
+        text_needflush) {
         if (_textiowrapper_writeflush(self) < 0)
             return NULL;
     }
@@ -1546,7 +1557,7 @@
     Py_ssize_t n = -1;
     PyObject *result = NULL, *chunks = NULL;
 
-    CHECK_INITIALIZED(self);
+    CHECK_ATTACHED(self);
 
     if (!PyArg_ParseTuple(args, "|O&:read", &_PyIO_ConvertSsize_t, &n))
         return NULL;
@@ -1921,7 +1932,7 @@
 {
     Py_ssize_t limit = -1;
 
-    CHECK_INITIALIZED(self);
+    CHECK_ATTACHED(self);
     if (!PyArg_ParseTuple(args, "|n:readline", &limit)) {
         return NULL;
     }
@@ -1947,10 +1958,7 @@
 
 #define COOKIE_BUF_LEN      (sizeof(Py_off_t) + 3 * sizeof(int) + sizeof(char))
 
-#if defined(WORDS_BIGENDIAN)
-
-# define IS_LITTLE_ENDIAN   0
-
+#if PY_BIG_ENDIAN
 /* We want the least significant byte of start_pos to also be the least
    significant byte of the cookie, which means that in big-endian mode we
    must copy the fields in reverse order. */
@@ -1962,9 +1970,6 @@
 # define OFF_NEED_EOF       0
 
 #else
-
-# define IS_LITTLE_ENDIAN   1
-
 /* Little-endian mode: the least significant byte of start_pos will
    naturally end up the least significant byte of the cookie. */
 
@@ -1985,7 +1990,7 @@
         return -1;
 
     if (_PyLong_AsByteArray(cookieLong, buffer, sizeof(buffer),
-                            IS_LITTLE_ENDIAN, 0) < 0) {
+                            PY_LITTLE_ENDIAN, 0) < 0) {
         Py_DECREF(cookieLong);
         return -1;
     }
@@ -2011,9 +2016,9 @@
     memcpy(buffer + OFF_CHARS_TO_SKIP, &cookie->chars_to_skip, sizeof(cookie->chars_to_skip));
     memcpy(buffer + OFF_NEED_EOF, &cookie->need_eof, sizeof(cookie->need_eof));
 
-    return _PyLong_FromByteArray(buffer, sizeof(buffer), IS_LITTLE_ENDIAN, 0);
+    return _PyLong_FromByteArray(buffer, sizeof(buffer),
+                                 PY_LITTLE_ENDIAN, 0);
 }
-#undef IS_LITTLE_ENDIAN
 
 static int
 _textiowrapper_decoder_setstate(textio *self, cookie_type *cookie)
@@ -2065,7 +2070,7 @@
     PyObject *res;
     int cmp;
 
-    CHECK_INITIALIZED(self);
+    CHECK_ATTACHED(self);
 
     if (!PyArg_ParseTuple(args, "O|i:seek", &cookieObj, &whence))
         return NULL;
@@ -2245,7 +2250,7 @@
     Py_ssize_t dec_buffer_len;
     int dec_flags;
 
-    CHECK_INITIALIZED(self);
+    CHECK_ATTACHED(self);
     CHECK_CLOSED(self);
 
     if (!self->seekable) {
@@ -2363,7 +2368,7 @@
 
     /* Note our initial start point. */
     cookie.start_pos += skip_bytes;
-    cookie.chars_to_skip = chars_to_skip;
+    cookie.chars_to_skip = Py_SAFE_DOWNCAST(chars_to_skip, Py_ssize_t, int);
     if (chars_to_skip == 0)
         goto finally;
 
@@ -2448,7 +2453,7 @@
     PyObject *pos = Py_None;
     PyObject *res;
 
-    CHECK_INITIALIZED(self)
+    CHECK_ATTACHED(self)
     if (!PyArg_ParseTuple(args, "|O:truncate", &pos)) {
         return NULL;
     }
@@ -2471,9 +2476,10 @@
     res = PyUnicode_FromString("<_io.TextIOWrapper");
     if (res == NULL)
         return NULL;
+
     nameobj = _PyObject_GetAttrId((PyObject *) self, &PyId_name);
     if (nameobj == NULL) {
-        if (PyErr_ExceptionMatches(PyExc_AttributeError))
+        if (PyErr_ExceptionMatches(PyExc_Exception))
             PyErr_Clear();
         else
             goto error;
@@ -2489,7 +2495,7 @@
     }
     modeobj = _PyObject_GetAttrId((PyObject *) self, &PyId_mode);
     if (modeobj == NULL) {
-        if (PyErr_ExceptionMatches(PyExc_AttributeError))
+        if (PyErr_ExceptionMatches(PyExc_Exception))
             PyErr_Clear();
         else
             goto error;
@@ -2518,35 +2524,35 @@
 static PyObject *
 textiowrapper_fileno(textio *self, PyObject *args)
 {
-    CHECK_INITIALIZED(self);
+    CHECK_ATTACHED(self);
     return _PyObject_CallMethodId(self->buffer, &PyId_fileno, NULL);
 }
 
 static PyObject *
 textiowrapper_seekable(textio *self, PyObject *args)
 {
-    CHECK_INITIALIZED(self);
+    CHECK_ATTACHED(self);
     return _PyObject_CallMethodId(self->buffer, &PyId_seekable, NULL);
 }
 
 static PyObject *
 textiowrapper_readable(textio *self, PyObject *args)
 {
-    CHECK_INITIALIZED(self);
+    CHECK_ATTACHED(self);
     return _PyObject_CallMethodId(self->buffer, &PyId_readable, NULL);
 }
 
 static PyObject *
 textiowrapper_writable(textio *self, PyObject *args)
 {
-    CHECK_INITIALIZED(self);
+    CHECK_ATTACHED(self);
     return _PyObject_CallMethodId(self->buffer, &PyId_writable, NULL);
 }
 
 static PyObject *
 textiowrapper_isatty(textio *self, PyObject *args)
 {
-    CHECK_INITIALIZED(self);
+    CHECK_ATTACHED(self);
     return _PyObject_CallMethodId(self->buffer, &PyId_isatty, NULL);
 }
 
@@ -2561,7 +2567,7 @@
 static PyObject *
 textiowrapper_flush(textio *self, PyObject *args)
 {
-    CHECK_INITIALIZED(self);
+    CHECK_ATTACHED(self);
     CHECK_CLOSED(self);
     self->telling = self->seekable;
     if (_textiowrapper_writeflush(self) < 0)
@@ -2574,7 +2580,7 @@
 {
     PyObject *res;
     int r;
-    CHECK_INITIALIZED(self);
+    CHECK_ATTACHED(self);
 
     res = textiowrapper_closed_get(self, NULL);
     if (res == NULL)
@@ -2589,7 +2595,7 @@
     }
     else {
         PyObject *exc = NULL, *val, *tb;
-        if (self->deallocating) {
+        if (self->finalizing) {
             res = _PyObject_CallMethodId(self->buffer, &PyId__dealloc_warn, "O", self);
             if (res)
                 Py_DECREF(res);
@@ -2604,19 +2610,8 @@
 
         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);
-            }
+            _PyErr_ChainExceptions(exc, val, tb);
+            Py_CLEAR(res);
         }
         return res;
     }
@@ -2627,7 +2622,7 @@
 {
     PyObject *line;
 
-    CHECK_INITIALIZED(self);
+    CHECK_ATTACHED(self);
 
     self->telling = 0;
     if (Py_TYPE(self) == &PyTextIOWrapper_Type) {
@@ -2663,14 +2658,14 @@
 static PyObject *
 textiowrapper_name_get(textio *self, void *context)
 {
-    CHECK_INITIALIZED(self);
+    CHECK_ATTACHED(self);
     return _PyObject_GetAttrId(self->buffer, &PyId_name);
 }
 
 static PyObject *
 textiowrapper_closed_get(textio *self, void *context)
 {
-    CHECK_INITIALIZED(self);
+    CHECK_ATTACHED(self);
     return PyObject_GetAttr(self->buffer, _PyIO_str_closed);
 }
 
@@ -2678,7 +2673,7 @@
 textiowrapper_newlines_get(textio *self, void *context)
 {
     PyObject *res;
-    CHECK_INITIALIZED(self);
+    CHECK_ATTACHED(self);
     if (self->decoder == NULL)
         Py_RETURN_NONE;
     res = PyObject_GetAttr(self->decoder, _PyIO_str_newlines);
@@ -2704,7 +2699,7 @@
 static PyObject *
 textiowrapper_chunk_size_get(textio *self, void *context)
 {
-    CHECK_INITIALIZED(self);
+    CHECK_ATTACHED(self);
     return PyLong_FromSsize_t(self->chunk_size);
 }
 
@@ -2712,7 +2707,7 @@
 textiowrapper_chunk_size_set(textio *self, PyObject *arg, void *context)
 {
     Py_ssize_t n;
-    CHECK_INITIALIZED_INT(self);
+    CHECK_ATTACHED_INT(self);
     n = PyNumber_AsSsize_t(arg, PyExc_ValueError);
     if (n == -1 && PyErr_Occurred())
         return -1;
@@ -2750,6 +2745,7 @@
     {"encoding", T_OBJECT, offsetof(textio, encoding), READONLY},
     {"buffer", T_OBJECT, offsetof(textio, buffer), READONLY},
     {"line_buffering", T_BOOL, offsetof(textio, line_buffering), READONLY},
+    {"_finalizing", T_BOOL, offsetof(textio, finalizing), 0},
     {NULL}
 };
 
@@ -2786,7 +2782,7 @@
     0,                          /*tp_setattro*/
     0,                          /*tp_as_buffer*/
     Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE
-            | Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+        | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
     textiowrapper_doc,          /* tp_doc */
     (traverseproc)textiowrapper_traverse, /* tp_traverse */
     (inquiry)textiowrapper_clear, /* tp_clear */
@@ -2805,4 +2801,14 @@
     (initproc)textiowrapper_init, /* tp_init */
     0,                          /* tp_alloc */
     PyType_GenericNew,          /* tp_new */
+    0,                          /* tp_free */
+    0,                          /* tp_is_gc */
+    0,                          /* tp_bases */
+    0,                          /* tp_mro */
+    0,                          /* tp_cache */
+    0,                          /* tp_subclasses */
+    0,                          /* tp_weaklist */
+    0,                          /* tp_del */
+    0,                          /* tp_version_tag */
+    0,                          /* tp_finalize */
 };
diff --git a/Modules/_json.c b/Modules/_json.c
index 397037e..f523aab 100644
--- a/Modules/_json.c
+++ b/Modules/_json.c
@@ -2,20 +2,6 @@
 #include "structmember.h"
 #include "accu.h"
 
-#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TYPE)
-#define Py_TYPE(ob)     (((PyObject*)(ob))->ob_type)
-#endif
-#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
-typedef int Py_ssize_t;
-#define PY_SSIZE_T_MAX INT_MAX
-#define PY_SSIZE_T_MIN INT_MIN
-#define PyInt_FromSsize_t PyInt_FromLong
-#define PyInt_AsSsize_t PyInt_AsLong
-#endif
-#ifndef Py_IS_FINITE
-#define Py_IS_FINITE(X) (!Py_IS_INFINITY(X) && !Py_IS_NAN(X))
-#endif
-
 #ifdef __GNUC__
 #define UNUSED __attribute__((__unused__))
 #else
@@ -129,33 +115,14 @@
 raise_errmsg(char *msg, PyObject *s, Py_ssize_t end);
 static PyObject *
 encoder_encode_string(PyEncoderObject *s, PyObject *obj);
-static int
-_convertPyInt_AsSsize_t(PyObject *o, Py_ssize_t *size_ptr);
 static PyObject *
-_convertPyInt_FromSsize_t(Py_ssize_t *size_ptr);
+encoder_encode_long(PyEncoderObject* s UNUSED, PyObject *obj);
 static PyObject *
 encoder_encode_float(PyEncoderObject *s, PyObject *obj);
 
 #define S_CHAR(c) (c >= ' ' && c <= '~' && c != '\\' && c != '"')
 #define IS_WHITESPACE(c) (((c) == ' ') || ((c) == '\t') || ((c) == '\n') || ((c) == '\r'))
 
-static int
-_convertPyInt_AsSsize_t(PyObject *o, Py_ssize_t *size_ptr)
-{
-    /* PyObject to Py_ssize_t converter */
-    *size_ptr = PyLong_AsSsize_t(o);
-    if (*size_ptr == -1 && PyErr_Occurred())
-        return 0;
-    return 1;
-}
-
-static PyObject *
-_convertPyInt_FromSsize_t(Py_ssize_t *size_ptr)
-{
-    /* Py_ssize_t to PyObject converter */
-    return PyLong_FromSsize_t(*size_ptr);
-}
-
 static Py_ssize_t
 ascii_escape_unichar(Py_UCS4 c, unsigned char *output, Py_ssize_t chars)
 {
@@ -174,14 +141,13 @@
         default:
             if (c >= 0x10000) {
                 /* UTF-16 surrogate pair */
-                Py_UCS4 v = c - 0x10000;
-                c = 0xd800 | ((v >> 10) & 0x3ff);
+                Py_UCS4 v = Py_UNICODE_HIGH_SURROGATE(c);
                 output[chars++] = 'u';
-                output[chars++] = Py_hexdigits[(c >> 12) & 0xf];
-                output[chars++] = Py_hexdigits[(c >>  8) & 0xf];
-                output[chars++] = Py_hexdigits[(c >>  4) & 0xf];
-                output[chars++] = Py_hexdigits[(c      ) & 0xf];
-                c = 0xdc00 | (v & 0x3ff);
+                output[chars++] = Py_hexdigits[(v >> 12) & 0xf];
+                output[chars++] = Py_hexdigits[(v >>  8) & 0xf];
+                output[chars++] = Py_hexdigits[(v >>  4) & 0xf];
+                output[chars++] = Py_hexdigits[(v      ) & 0xf];
+                c = Py_UNICODE_LOW_SURROGATE(c);
                 output[chars++] = '\\';
             }
             output[chars++] = 'u';
@@ -275,13 +241,23 @@
         if (errmsg_fn == NULL)
             return;
     }
-    pymsg = PyObject_CallFunction(errmsg_fn, "(zOO&)", msg, s, _convertPyInt_FromSsize_t, &end);
+    pymsg = PyObject_CallFunction(errmsg_fn, "(zOn)", msg, s, end);
     if (pymsg) {
         PyErr_SetObject(PyExc_ValueError, pymsg);
         Py_DECREF(pymsg);
     }
 }
 
+static void
+raise_stop_iteration(Py_ssize_t idx)
+{
+    PyObject *value = PyLong_FromSsize_t(idx);
+    if (value != NULL) {
+        PyErr_SetObject(PyExc_StopIteration, value);
+        Py_DECREF(value);
+    }
+}
+
 static PyObject *
 _build_rval_index_tuple(PyObject *rval, Py_ssize_t idx) {
     /* return (rval, idx) tuple, stealing reference to rval */
@@ -318,7 +294,7 @@
             } \
         } \
         if (PyList_Append(chunks, chunk)) { \
-            Py_DECREF(chunk); \
+            Py_CLEAR(chunk); \
             goto bail; \
         } \
         Py_CLEAR(chunk); \
@@ -351,7 +327,7 @@
     buf = PyUnicode_DATA(pystr);
     kind = PyUnicode_KIND(pystr);
 
-    if (end < 0 || len <= end) {
+    if (end < 0 || len < end) {
         PyErr_SetString(PyExc_ValueError, "end is out of bounds");
         goto bail;
     }
@@ -522,7 +498,7 @@
     Py_ssize_t end;
     Py_ssize_t next_end = -1;
     int strict = 1;
-    if (!PyArg_ParseTuple(args, "OO&|i:scanstring", &pystr, _convertPyInt_AsSsize_t, &end, &strict)) {
+    if (!PyArg_ParseTuple(args, "On|i:scanstring", &pystr, &end, &strict)) {
         return NULL;
     }
     if (PyUnicode_Check(pystr)) {
@@ -637,12 +613,12 @@
     while (idx <= end_idx && IS_WHITESPACE(PyUnicode_READ(kind,str, idx))) idx++;
 
     /* only loop if the object is non-empty */
-    if (idx <= end_idx && PyUnicode_READ(kind, str, idx) != '}') {
-        while (idx <= end_idx) {
+    if (idx > end_idx || PyUnicode_READ(kind, str, idx) != '}') {
+        while (1) {
             PyObject *memokey;
 
             /* read key */
-            if (PyUnicode_READ(kind, str, idx) != '"') {
+            if (idx > end_idx || PyUnicode_READ(kind, str, idx) != '"') {
                 raise_errmsg("Expecting property name enclosed in double quotes", pystr, idx);
                 goto bail;
             }
@@ -699,11 +675,9 @@
             while (idx <= end_idx && IS_WHITESPACE(PyUnicode_READ(kind, str, idx))) idx++;
 
             /* bail if the object is closed or we didn't get the , delimiter */
-            if (idx > end_idx) break;
-            if (PyUnicode_READ(kind, str, idx) == '}') {
+            if (idx <= end_idx && PyUnicode_READ(kind, str, idx) == '}')
                 break;
-            }
-            else if (PyUnicode_READ(kind, str, idx) != ',') {
+            if (idx > end_idx || PyUnicode_READ(kind, str, idx) != ',') {
                 raise_errmsg("Expecting ',' delimiter", pystr, idx);
                 goto bail;
             }
@@ -714,12 +688,6 @@
         }
     }
 
-    /* verify that idx < end_idx, str[idx] should be '}' */
-    if (idx > end_idx || PyUnicode_READ(kind, str, idx) != '}') {
-        raise_errmsg("Expecting object", pystr, end_idx);
-        goto bail;
-    }
-
     *next_idx_ptr = idx + 1;
 
     if (has_pairs_hook) {
@@ -771,8 +739,8 @@
     while (idx <= end_idx && IS_WHITESPACE(PyUnicode_READ(kind, str, idx))) idx++;
 
     /* only loop if the array is non-empty */
-    if (idx <= end_idx && PyUnicode_READ(kind, str, idx) != ']') {
-        while (idx <= end_idx) {
+    if (idx > end_idx || PyUnicode_READ(kind, str, idx) != ']') {
+        while (1) {
 
             /* read any JSON term  */
             val = scan_once_unicode(s, pystr, idx, &next_idx);
@@ -789,11 +757,9 @@
             while (idx <= end_idx && IS_WHITESPACE(PyUnicode_READ(kind, str, idx))) idx++;
 
             /* bail if the array is closed or we didn't get the , delimiter */
-            if (idx > end_idx) break;
-            if (PyUnicode_READ(kind, str, idx) == ']') {
+            if (idx <= end_idx && PyUnicode_READ(kind, str, idx) == ']')
                 break;
-            }
-            else if (PyUnicode_READ(kind, str, idx) != ',') {
+            if (idx > end_idx || PyUnicode_READ(kind, str, idx) != ',') {
                 raise_errmsg("Expecting ',' delimiter", pystr, idx);
                 goto bail;
             }
@@ -806,7 +772,7 @@
 
     /* verify that idx < end_idx, PyUnicode_READ(kind, str, idx) should be ']' */
     if (idx > end_idx || PyUnicode_READ(kind, str, idx) != ']') {
-        raise_errmsg("Expecting object", pystr, end_idx);
+        raise_errmsg("Expecting value", pystr, end_idx);
         goto bail;
     }
     *next_idx_ptr = idx + 1;
@@ -874,7 +840,7 @@
     if (PyUnicode_READ(kind, str, idx) == '-') {
         idx++;
         if (idx > end_idx) {
-            PyErr_SetNone(PyExc_StopIteration);
+            raise_stop_iteration(start);
             return NULL;
         }
     }
@@ -890,7 +856,7 @@
     }
     /* no integer digits, error */
     else {
-        PyErr_SetNone(PyExc_StopIteration);
+        raise_stop_iteration(start);
         return NULL;
     }
 
@@ -987,7 +953,7 @@
         return NULL;
     }
     if (idx >= length) {
-        PyErr_SetNone(PyExc_StopIteration);
+        raise_stop_iteration(idx);
         return NULL;
     }
 
@@ -1089,7 +1055,7 @@
     PyScannerObject *s;
     assert(PyScanner_Check(self));
     s = (PyScannerObject *)self;
-    if (!PyArg_ParseTupleAndKeywords(args, kwds, "OO&:scan_once", kwlist, &pystr, _convertPyInt_AsSsize_t, &idx))
+    if (!PyArg_ParseTupleAndKeywords(args, kwds, "On:scan_once", kwlist, &pystr, &idx))
         return NULL;
 
     if (PyUnicode_Check(pystr)) {
@@ -1290,8 +1256,8 @@
 
     assert(PyEncoder_Check(self));
     s = (PyEncoderObject *)self;
-    if (!PyArg_ParseTupleAndKeywords(args, kwds, "OO&:_iterencode", kwlist,
-        &obj, _convertPyInt_AsSsize_t, &indent_level))
+    if (!PyArg_ParseTupleAndKeywords(args, kwds, "On:_iterencode", kwlist,
+        &obj, &indent_level))
         return NULL;
     if (_PyAccu_Init(&acc))
         return NULL;
@@ -1337,13 +1303,45 @@
 }
 
 static PyObject *
+encoder_encode_long(PyEncoderObject* s UNUSED, PyObject *obj)
+{
+    /* Return the JSON representation of a PyLong and PyLong subclasses.
+       Calls int() on PyLong subclasses in case the str() was changed.
+       Added specifically to deal with IntEnum.  See Issue18264. */
+    PyObject *encoded, *longobj;
+    if (PyLong_CheckExact(obj)) {
+        encoded = PyObject_Str(obj);
+    }
+    else {
+        longobj = PyNumber_Long(obj);
+        if (longobj == NULL) {
+            PyErr_SetString(
+                    PyExc_ValueError,
+                    "Unable to coerce int subclass to int"
+                    );
+            return NULL;
+        }
+        encoded = PyObject_Str(longobj);
+        Py_DECREF(longobj);
+    }
+    return encoded;
+}
+
+
+static PyObject *
 encoder_encode_float(PyEncoderObject *s, PyObject *obj)
 {
-    /* Return the JSON representation of a PyFloat */
+    /* Return the JSON representation of a PyFloat.
+       Modified to call float() on float subclasses in case the subclass
+       changes the repr.  See Issue18264.  */
+    PyObject *encoded, *floatobj;
     double i = PyFloat_AS_DOUBLE(obj);
     if (!Py_IS_FINITE(i)) {
         if (!s->allow_nan) {
-            PyErr_SetString(PyExc_ValueError, "Out of range float values are not JSON compliant");
+            PyErr_SetString(
+                    PyExc_ValueError,
+                    "Out of range float values are not JSON compliant"
+                    );
             return NULL;
         }
         if (i > 0) {
@@ -1356,8 +1354,24 @@
             return PyUnicode_FromString("NaN");
         }
     }
-    /* Use a better float format here? */
-    return PyObject_Repr(obj);
+    /* coerce float subclasses to float (primarily for Enum) */
+    if (PyFloat_CheckExact(obj)) {
+        /* Use a better float format here? */
+        encoded = PyObject_Repr(obj);
+    }
+    else {
+        floatobj = PyNumber_Float(obj);
+        if (floatobj == NULL) {
+            PyErr_SetString(
+                    PyExc_ValueError,
+                    "Unable to coerce float subclass to float"
+                    );
+            return NULL;
+        }
+        encoded = PyObject_Repr(floatobj);
+        Py_DECREF(floatobj);
+    }
+    return encoded;
 }
 
 static PyObject *
@@ -1401,7 +1415,7 @@
         return _steal_accumulate(acc, encoded);
     }
     else if (PyLong_Check(obj)) {
-        PyObject *encoded = PyObject_Str(obj);
+        PyObject *encoded = encoder_encode_long(s, obj);
         if (encoded == NULL)
             return -1;
         return _steal_accumulate(acc, encoded);
@@ -1548,6 +1562,7 @@
             if (item == NULL)
                 goto bail;
             PyList_SET_ITEM(items, i, item);
+            item = NULL;
             Py_DECREF(key);
         }
     }
@@ -1586,9 +1601,10 @@
                 goto bail;
         }
         else if (PyLong_Check(key)) {
-            kstr = PyObject_Str(key);
-            if (kstr == NULL)
+            kstr = encoder_encode_long(s, key);
+            if (kstr == NULL) {
                 goto bail;
+            }
         }
         else if (skipkeys) {
             Py_DECREF(item);
diff --git a/Modules/_localemodule.c b/Modules/_localemodule.c
index cc688ba..400c344 100644
--- a/Modules/_localemodule.c
+++ b/Modules/_localemodule.c
@@ -147,26 +147,34 @@
     /* hopefully, the localeconv result survives the C library calls
        involved herein */
 
+#define RESULT(key, obj)\
+    do { \
+        if (obj == NULL) \
+            goto failed; \
+        if (PyDict_SetItemString(result, key, obj) < 0) { \
+            Py_DECREF(obj); \
+            goto failed; \
+        } \
+        Py_DECREF(obj); \
+    } while (0)
+
 #define RESULT_STRING(s)\
-    x = PyUnicode_DecodeLocale(l->s, NULL);   \
-    if (!x) goto failed;\
-    PyDict_SetItemString(result, #s, x);\
-    Py_XDECREF(x)
+    do { \
+        x = PyUnicode_DecodeLocale(l->s, NULL); \
+        RESULT(#s, x); \
+    } while (0)
 
 #define RESULT_INT(i)\
-    x = PyLong_FromLong(l->i);\
-    if (!x) goto failed;\
-    PyDict_SetItemString(result, #i, x);\
-    Py_XDECREF(x)
+    do { \
+        x = PyLong_FromLong(l->i); \
+        RESULT(#i, x); \
+    } while (0)
 
     /* Numeric information */
     RESULT_STRING(decimal_point);
     RESULT_STRING(thousands_sep);
     x = copy_grouping(l->grouping);
-    if (!x)
-        goto failed;
-    PyDict_SetItemString(result, "grouping", x);
-    Py_XDECREF(x);
+    RESULT("grouping", x);
 
     /* Monetary information */
     RESULT_STRING(int_curr_symbol);
@@ -174,10 +182,8 @@
     RESULT_STRING(mon_decimal_point);
     RESULT_STRING(mon_thousands_sep);
     x = copy_grouping(l->mon_grouping);
-    if (!x)
-        goto failed;
-    PyDict_SetItemString(result, "mon_grouping", x);
-    Py_XDECREF(x);
+    RESULT("mon_grouping", x);
+
     RESULT_STRING(positive_sign);
     RESULT_STRING(negative_sign);
     RESULT_INT(int_frac_digits);
@@ -192,7 +198,6 @@
 
   failed:
     Py_XDECREF(result);
-    Py_XDECREF(x);
     return NULL;
 }
 
diff --git a/Modules/_lsprof.c b/Modules/_lsprof.c
index 4162be8..0137d95 100644
--- a/Modules/_lsprof.c
+++ b/Modules/_lsprof.c
@@ -36,12 +36,8 @@
 #error "This module requires gettimeofday() on non-Windows platforms!"
 #endif
 
-#if (defined(PYOS_OS2) && defined(PYCC_GCC))
-#include <sys/time.h>
-#else
 #include <sys/resource.h>
 #include <sys/times.h>
-#endif
 
 static PY_LONG_LONG
 hpTimer(void)
@@ -227,7 +223,7 @@
 newProfilerEntry(ProfilerObject *pObj, void *key, PyObject *userObj)
 {
     ProfilerEntry *self;
-    self = (ProfilerEntry*) malloc(sizeof(ProfilerEntry));
+    self = (ProfilerEntry*) PyMem_Malloc(sizeof(ProfilerEntry));
     if (self == NULL) {
         pObj->flags |= POF_NOMEMORY;
         return NULL;
@@ -235,7 +231,7 @@
     userObj = normalizeUserObj(userObj);
     if (userObj == NULL) {
         PyErr_Clear();
-        free(self);
+        PyMem_Free(self);
         pObj->flags |= POF_NOMEMORY;
         return NULL;
     }
@@ -268,7 +264,7 @@
 newSubEntry(ProfilerObject *pObj,  ProfilerEntry *caller, ProfilerEntry* entry)
 {
     ProfilerSubEntry *self;
-    self = (ProfilerSubEntry*) malloc(sizeof(ProfilerSubEntry));
+    self = (ProfilerSubEntry*) PyMem_Malloc(sizeof(ProfilerSubEntry));
     if (self == NULL) {
         pObj->flags |= POF_NOMEMORY;
         return NULL;
@@ -286,7 +282,7 @@
 static int freeSubEntry(rotating_node_t *header, void *arg)
 {
     ProfilerSubEntry *subentry = (ProfilerSubEntry*) header;
-    free(subentry);
+    PyMem_Free(subentry);
     return 0;
 }
 
@@ -295,7 +291,7 @@
     ProfilerEntry *entry = (ProfilerEntry*) header;
     RotatingTree_Enum(entry->calls, freeSubEntry, NULL);
     Py_DECREF(entry->userObj);
-    free(entry);
+    PyMem_Free(entry);
     return 0;
 }
 
@@ -305,13 +301,13 @@
     pObj->profilerEntries = EMPTY_ROTATING_TREE;
     /* release the memory hold by the ProfilerContexts */
     if (pObj->currentProfilerContext) {
-        free(pObj->currentProfilerContext);
+        PyMem_Free(pObj->currentProfilerContext);
         pObj->currentProfilerContext = NULL;
     }
     while (pObj->freelistProfilerContext) {
         ProfilerContext *c = pObj->freelistProfilerContext;
         pObj->freelistProfilerContext = c->previous;
-        free(c);
+        PyMem_Free(c);
     }
     pObj->freelistProfilerContext = NULL;
 }
@@ -397,7 +393,7 @@
     else {
         /* free list exhausted, allocate a new one */
         pContext = (ProfilerContext*)
-            malloc(sizeof(ProfilerContext));
+            PyMem_Malloc(sizeof(ProfilerContext));
         if (pContext == NULL) {
             pObj->flags |= POF_NOMEMORY;
             goto restorePyerr;
@@ -708,7 +704,7 @@
         else
             pObj->currentProfilerContext = pContext->previous;
         if (pContext)
-            free(pContext);
+            PyMem_Free(pContext);
     }
 
 }
@@ -876,10 +872,12 @@
     PyDict_SetItemString(d, "Profiler", (PyObject *)&PyProfiler_Type);
 
     if (!initialized) {
-        PyStructSequence_InitType(&StatsEntryType,
-                                  &profiler_entry_desc);
-        PyStructSequence_InitType(&StatsSubEntryType,
-                                  &profiler_subentry_desc);
+        if (PyStructSequence_InitType2(&StatsEntryType,
+                                       &profiler_entry_desc) < 0)
+            return NULL;
+        if (PyStructSequence_InitType2(&StatsSubEntryType,
+                                       &profiler_subentry_desc) < 0)
+            return NULL;
     }
     Py_INCREF((PyObject*) &StatsEntryType);
     Py_INCREF((PyObject*) &StatsSubEntryType);
diff --git a/Modules/_lzmamodule.c b/Modules/_lzmamodule.c
index 6436160..c43676a 100644
--- a/Modules/_lzmamodule.c
+++ b/Modules/_lzmamodule.c
@@ -51,6 +51,7 @@
 
 typedef struct {
     PyObject_HEAD
+    lzma_allocator alloc;
     lzma_stream lzs;
     int flushed;
 #ifdef WITH_THREAD
@@ -60,6 +61,7 @@
 
 typedef struct {
     PyObject_HEAD
+    lzma_allocator alloc;
     lzma_stream lzs;
     int check;
     char eof;
@@ -117,6 +119,22 @@
     }
 }
 
+static void*
+PyLzma_Malloc(void *opaque, size_t items, size_t size)
+{
+    if (items > (size_t)PY_SSIZE_T_MAX / size)
+        return NULL;
+    /* PyMem_Malloc() cannot be used:
+       the GIL is not held when lzma_code() is called */
+    return PyMem_RawMalloc(items * size);
+}
+
+static void
+PyLzma_Free(void *opaque, void *ptr)
+{
+    PyMem_RawFree(ptr);
+}
+
 #if BUFSIZ < 8192
 #define INITIAL_BUFFER_SIZE 8192
 #else
@@ -280,36 +298,37 @@
     return options;
 }
 
-static void *
-parse_filter_spec(lzma_filter *f, PyObject *spec)
+static int
+lzma_filter_converter(PyObject *spec, void *ptr)
 {
+    lzma_filter *f = (lzma_filter *)ptr;
     PyObject *id_obj;
 
     if (!PyMapping_Check(spec)) {
         PyErr_SetString(PyExc_TypeError,
                         "Filter specifier must be a dict or dict-like object");
-        return NULL;
+        return 0;
     }
     id_obj = PyMapping_GetItemString(spec, "id");
     if (id_obj == NULL) {
         if (PyErr_ExceptionMatches(PyExc_KeyError))
             PyErr_SetString(PyExc_ValueError,
                             "Filter specifier must have an \"id\" entry");
-        return NULL;
+        return 0;
     }
     f->id = PyLong_AsUnsignedLongLong(id_obj);
     Py_DECREF(id_obj);
     if (PyErr_Occurred())
-        return NULL;
+        return 0;
 
     switch (f->id) {
         case LZMA_FILTER_LZMA1:
         case LZMA_FILTER_LZMA2:
             f->options = parse_filter_spec_lzma(spec);
-            return f->options;
+            return f->options != NULL;
         case LZMA_FILTER_DELTA:
             f->options = parse_filter_spec_delta(spec);
-            return f->options;
+            return f->options != NULL;
         case LZMA_FILTER_X86:
         case LZMA_FILTER_POWERPC:
         case LZMA_FILTER_IA64:
@@ -317,10 +336,10 @@
         case LZMA_FILTER_ARMTHUMB:
         case LZMA_FILTER_SPARC:
             f->options = parse_filter_spec_bcj(spec);
-            return f->options;
+            return f->options != NULL;
         default:
             PyErr_Format(PyExc_ValueError, "Invalid filter ID: %llu", f->id);
-            return NULL;
+            return 0;
     }
 }
 
@@ -351,7 +370,7 @@
     for (i = 0; i < num_filters; i++) {
         int ok = 1;
         PyObject *spec = PySequence_GetItem(filterspecs, i);
-        if (spec == NULL || parse_filter_spec(&filters[i], spec) == NULL)
+        if (spec == NULL || !lzma_filter_converter(spec, &filters[i]))
             ok = 0;
         Py_XDECREF(spec);
         if (!ok) {
@@ -450,6 +469,36 @@
 }
 
 
+/*[clinic input]
+output preset file
+module _lzma
+class _lzma.LZMACompressor "Compressor *" "&Compressor_type"
+class _lzma.LZMADecompressor "Decompressor *" "&Decompressor_type"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=f17afc786525d6c2]*/
+
+#include "clinic/_lzmamodule.c.h"
+
+/*[python input]
+
+class lzma_vli_converter(CConverter):
+    type = 'lzma_vli'
+    converter = 'lzma_vli_converter'
+
+class lzma_filter_converter(CConverter):
+    type = 'lzma_filter'
+    converter = 'lzma_filter_converter'
+    c_default = c_ignored_default = "{LZMA_VLI_UNKNOWN, NULL}"
+
+    def cleanup(self):
+        name = ensure_legal_c_identifier(self.name)
+        return ('if (%(name)s.id != LZMA_VLI_UNKNOWN)\n'
+                '   PyMem_Free(%(name)s.options);\n') % {'name': name}
+
+[python start generated code]*/
+/*[python end generated code: output=da39a3ee5e6b4b0d input=74fe7631ce377a94]*/
+
+
 /* LZMACompressor class. */
 
 static PyObject *
@@ -494,44 +543,51 @@
     return NULL;
 }
 
-PyDoc_STRVAR(Compressor_compress_doc,
-"compress(data) -> bytes\n"
-"\n"
-"Provide data to the compressor object. Returns a chunk of\n"
-"compressed data if possible, or b\"\" otherwise.\n"
-"\n"
-"When you have finished providing data to the compressor, call the\n"
-"flush() method to finish the conversion process.\n");
+/*[clinic input]
+_lzma.LZMACompressor.compress
+
+    self: self(type="Compressor *")
+    data: Py_buffer
+    /
+
+Provide data to the compressor object.
+
+Returns a chunk of compressed data if possible, or b'' otherwise.
+
+When you have finished providing data to the compressor, call the
+flush() method to finish the compression process.
+[clinic start generated code]*/
 
 static PyObject *
-Compressor_compress(Compressor *self, PyObject *args)
+_lzma_LZMACompressor_compress_impl(Compressor *self, Py_buffer *data)
+/*[clinic end generated code: output=31f615136963e00f input=8b60cb13e0ce6420]*/
 {
-    Py_buffer buffer;
     PyObject *result = NULL;
 
-    if (!PyArg_ParseTuple(args, "y*:compress", &buffer))
-        return NULL;
-
     ACQUIRE_LOCK(self);
     if (self->flushed)
         PyErr_SetString(PyExc_ValueError, "Compressor has been flushed");
     else
-        result = compress(self, buffer.buf, buffer.len, LZMA_RUN);
+        result = compress(self, data->buf, data->len, LZMA_RUN);
     RELEASE_LOCK(self);
-    PyBuffer_Release(&buffer);
     return result;
 }
 
-PyDoc_STRVAR(Compressor_flush_doc,
-"flush() -> bytes\n"
-"\n"
-"Finish the compression process. Returns the compressed data left\n"
-"in internal buffers.\n"
-"\n"
-"The compressor object cannot be used after this method is called.\n");
+/*[clinic input]
+_lzma.LZMACompressor.flush
+
+    self: self(type="Compressor *")
+
+Finish the compression process.
+
+Returns the compressed data left in internal buffers.
+
+The compressor object may not be used after this method is called.
+[clinic start generated code]*/
 
 static PyObject *
-Compressor_flush(Compressor *self, PyObject *noargs)
+_lzma_LZMACompressor_flush_impl(Compressor *self)
+/*[clinic end generated code: output=fec21f3e22504f50 input=3060fb26f9b4042c]*/
 {
     PyObject *result = NULL;
 
@@ -632,6 +688,39 @@
         return 0;
 }
 
+/*[-clinic input]
+_lzma.LZMACompressor.__init__
+
+    self: self(type="Compressor *")
+    format: int(c_default="FORMAT_XZ") = FORMAT_XZ
+        The container format to use for the output.  This can
+        be FORMAT_XZ (default), FORMAT_ALONE, or FORMAT_RAW.
+
+    check: int(c_default="-1") = unspecified
+        The integrity check to use.  For FORMAT_XZ, the default
+        is CHECK_CRC64.  FORMAT_ALONE and FORMAT_RAW do not suport integrity
+        checks; for these formats, check must be omitted, or be CHECK_NONE.
+
+    preset: object = None
+        If provided should be an integer in the range 0-9, optionally
+        OR-ed with the constant PRESET_EXTREME.
+
+    filters: object = None
+        If provided should be a sequence of dicts.  Each dict should
+        have an entry for "id" indicating the ID of the filter, plus
+        additional entries for options to the filter.
+
+Create a compressor object for compressing data incrementally.
+
+The settings used by the compressor can be specified either as a
+preset compression level (with the 'preset' argument), or in detail
+as a custom filter chain (with the 'filters' argument).  For FORMAT_XZ
+and FORMAT_ALONE, the default is to use the PRESET_DEFAULT preset
+level.  For FORMAT_RAW, the caller must always specify a filter chain;
+the raw compressor does not support preset compression levels.
+
+For one-shot compression, use the compress() function instead.
+[-clinic start generated code]*/
 static int
 Compressor_init(Compressor *self, PyObject *args, PyObject *kwargs)
 {
@@ -664,6 +753,11 @@
         if (!uint32_converter(preset_obj, &preset))
             return -1;
 
+    self->alloc.opaque = NULL;
+    self->alloc.alloc = PyLzma_Malloc;
+    self->alloc.free = PyLzma_Free;
+    self->lzs.allocator = &self->alloc;
+
 #ifdef WITH_THREAD
     self->lock = PyThread_allocate_lock();
     if (self->lock == NULL) {
@@ -716,10 +810,8 @@
 }
 
 static PyMethodDef Compressor_methods[] = {
-    {"compress", (PyCFunction)Compressor_compress, METH_VARARGS,
-     Compressor_compress_doc},
-    {"flush", (PyCFunction)Compressor_flush, METH_NOARGS,
-     Compressor_flush_doc},
+    _LZMA_LZMACOMPRESSOR_COMPRESS_METHODDEF
+    _LZMA_LZMACOMPRESSOR_FLUSH_METHODDEF
     {"__getstate__", (PyCFunction)Compressor_getstate, METH_NOARGS},
     {NULL}
 };
@@ -849,32 +941,34 @@
     return NULL;
 }
 
-PyDoc_STRVAR(Decompressor_decompress_doc,
-"decompress(data) -> bytes\n"
-"\n"
-"Provide data to the decompressor object. Returns a chunk of\n"
-"decompressed data if possible, or b\"\" otherwise.\n"
-"\n"
-"Attempting to decompress data after the end of the stream is\n"
-"reached raises an EOFError. Any data found after the end of the\n"
-"stream is ignored, and saved in the unused_data attribute.\n");
+/*[clinic input]
+_lzma.LZMADecompressor.decompress
+
+    self: self(type="Decompressor *")
+    data: Py_buffer
+    /
+
+Provide data to the decompressor object.
+
+Returns a chunk of decompressed data if possible, or b'' otherwise.
+
+Attempting to decompress data after the end of stream is reached
+raises an EOFError.  Any data found after the end of the stream
+is ignored and saved in the unused_data attribute.
+[clinic start generated code]*/
 
 static PyObject *
-Decompressor_decompress(Decompressor *self, PyObject *args)
+_lzma_LZMADecompressor_decompress_impl(Decompressor *self, Py_buffer *data)
+/*[clinic end generated code: output=d86e78da7ff0ff21 input=50c4768b821bf0ef]*/
 {
-    Py_buffer buffer;
     PyObject *result = NULL;
 
-    if (!PyArg_ParseTuple(args, "y*:decompress", &buffer))
-        return NULL;
-
     ACQUIRE_LOCK(self);
     if (self->eof)
         PyErr_SetString(PyExc_EOFError, "Already at end of stream");
     else
-        result = decompress(self, buffer.buf, buffer.len);
+        result = decompress(self, data->buf, data->len);
     RELEASE_LOCK(self);
-    PyBuffer_Release(&buffer);
     return result;
 }
 
@@ -902,43 +996,66 @@
         return 0;
 }
 
+/*[clinic input]
+_lzma.LZMADecompressor.__init__
+
+    self: self(type="Decompressor *")
+    format: int(c_default="FORMAT_AUTO") = FORMAT_AUTO
+        Specifies the container format of the input stream.  If this is
+        FORMAT_AUTO (the default), the decompressor will automatically detect
+        whether the input is FORMAT_XZ or FORMAT_ALONE.  Streams created with
+        FORMAT_RAW cannot be autodetected.
+
+    memlimit: object = None
+        Limit the amount of memory used by the decompressor.  This will cause
+        decompression to fail if the input cannot be decompressed within the
+        given limit.
+
+    filters: object = None
+        A custom filter chain.  This argument is required for FORMAT_RAW, and
+        not accepted with any other format.  When provided, this should be a
+        sequence of dicts, each indicating the ID and options for a single
+        filter.
+
+Create a decompressor object for decompressing data incrementally.
+
+For one-shot decompression, use the decompress() function instead.
+[clinic start generated code]*/
+
 static int
-Decompressor_init(Decompressor *self, PyObject *args, PyObject *kwargs)
+_lzma_LZMADecompressor___init___impl(Decompressor *self, int format, PyObject *memlimit, PyObject *filters)
+/*[clinic end generated code: output=9b119f6f2cc2d7a8 input=458ca6132ef29801]*/
 {
-    static char *arg_names[] = {"format", "memlimit", "filters", NULL};
     const uint32_t decoder_flags = LZMA_TELL_ANY_CHECK | LZMA_TELL_NO_CHECK;
-    int format = FORMAT_AUTO;
-    uint64_t memlimit = UINT64_MAX;
-    PyObject *memlimit_obj = Py_None;
-    PyObject *filterspecs = Py_None;
+    uint64_t memlimit_ = UINT64_MAX;
     lzma_ret lzret;
 
-    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
-                                     "|iOO:LZMADecompressor", arg_names,
-                                     &format, &memlimit_obj, &filterspecs))
-        return -1;
-
-    if (memlimit_obj != Py_None) {
+    if (memlimit != Py_None) {
         if (format == FORMAT_RAW) {
             PyErr_SetString(PyExc_ValueError,
                             "Cannot specify memory limit with FORMAT_RAW");
             return -1;
         }
-        memlimit = PyLong_AsUnsignedLongLong(memlimit_obj);
+        memlimit_ = PyLong_AsUnsignedLongLong(memlimit);
         if (PyErr_Occurred())
             return -1;
     }
 
-    if (format == FORMAT_RAW && filterspecs == Py_None) {
+    if (format == FORMAT_RAW && filters == Py_None) {
         PyErr_SetString(PyExc_ValueError,
                         "Must specify filters for FORMAT_RAW");
         return -1;
-    } else if (format != FORMAT_RAW && filterspecs != Py_None) {
+    } else if (format != FORMAT_RAW && filters != Py_None) {
         PyErr_SetString(PyExc_ValueError,
                         "Cannot specify filters except with FORMAT_RAW");
         return -1;
     }
 
+    self->alloc.opaque = NULL;
+    self->alloc.alloc = PyLzma_Malloc;
+    self->alloc.free = PyLzma_Free;
+    self->lzs.allocator = &self->alloc;
+
 #ifdef WITH_THREAD
     self->lock = PyThread_allocate_lock();
     if (self->lock == NULL) {
@@ -954,27 +1071,27 @@
 
     switch (format) {
         case FORMAT_AUTO:
-            lzret = lzma_auto_decoder(&self->lzs, memlimit, decoder_flags);
+            lzret = lzma_auto_decoder(&self->lzs, memlimit_, decoder_flags);
             if (catch_lzma_error(lzret))
                 break;
             return 0;
 
         case FORMAT_XZ:
-            lzret = lzma_stream_decoder(&self->lzs, memlimit, decoder_flags);
+            lzret = lzma_stream_decoder(&self->lzs, memlimit_, decoder_flags);
             if (catch_lzma_error(lzret))
                 break;
             return 0;
 
         case FORMAT_ALONE:
             self->check = LZMA_CHECK_NONE;
-            lzret = lzma_alone_decoder(&self->lzs, memlimit);
+            lzret = lzma_alone_decoder(&self->lzs, memlimit_);
             if (catch_lzma_error(lzret))
                 break;
             return 0;
 
         case FORMAT_RAW:
             self->check = LZMA_CHECK_NONE;
-            if (Decompressor_init_raw(&self->lzs, filterspecs) == -1)
+            if (Decompressor_init_raw(&self->lzs, filters) == -1)
                 break;
             return 0;
 
@@ -1006,8 +1123,7 @@
 }
 
 static PyMethodDef Decompressor_methods[] = {
-    {"decompress", (PyCFunction)Decompressor_decompress, METH_VARARGS,
-     Decompressor_decompress_doc},
+    _LZMA_LZMADECOMPRESSOR_DECOMPRESS_METHODDEF
     {"__getstate__", (PyCFunction)Decompressor_getstate, METH_NOARGS},
     {NULL}
 };
@@ -1031,27 +1147,6 @@
     {NULL}
 };
 
-PyDoc_STRVAR(Decompressor_doc,
-"LZMADecompressor(format=FORMAT_AUTO, memlimit=None, filters=None)\n"
-"\n"
-"Create a decompressor object for decompressing data incrementally.\n"
-"\n"
-"format specifies the container format of the input stream. If this is\n"
-"FORMAT_AUTO (the default), the decompressor will automatically detect\n"
-"whether the input is FORMAT_XZ or FORMAT_ALONE. Streams created with\n"
-"FORMAT_RAW cannot be autodetected.\n"
-"\n"
-"memlimit can be specified to limit the amount of memory used by the\n"
-"decompressor. This will cause decompression to fail if the input\n"
-"cannot be decompressed within the given limit.\n"
-"\n"
-"filters specifies a custom filter chain. This argument is required for\n"
-"FORMAT_RAW, and not accepted with any other format. When provided,\n"
-"this should be a sequence of dicts, each indicating the ID and options\n"
-"for a single filter.\n"
-"\n"
-"For one-shot decompression, use the decompress() function instead.\n");
-
 static PyTypeObject Decompressor_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "_lzma.LZMADecompressor",           /* tp_name */
@@ -1073,7 +1168,7 @@
     0,                                  /* tp_setattro */
     0,                                  /* tp_as_buffer */
     Py_TPFLAGS_DEFAULT,                 /* tp_flags */
-    Decompressor_doc,                   /* tp_doc */
+    _lzma_LZMADecompressor___init____doc__,  /* tp_doc */
     0,                                  /* tp_traverse */
     0,                                  /* tp_clear */
     0,                                  /* tp_richcompare */
@@ -1088,7 +1183,7 @@
     0,                                  /* tp_descr_get */
     0,                                  /* tp_descr_set */
     0,                                  /* tp_dictoffset */
-    (initproc)Decompressor_init,        /* tp_init */
+    _lzma_LZMADecompressor___init__,    /* tp_init */
     0,                                  /* tp_alloc */
     PyType_GenericNew,                  /* tp_new */
 };
@@ -1096,48 +1191,42 @@
 
 /* Module-level functions. */
 
-PyDoc_STRVAR(is_check_supported_doc,
-"is_check_supported(check_id) -> bool\n"
-"\n"
-"Test whether the given integrity check is supported.\n"
-"\n"
-"Always returns True for CHECK_NONE and CHECK_CRC32.\n");
+/*[clinic input]
+_lzma.is_check_supported
+    check_id: int
+    /
+
+Test whether the given integrity check is supported.
+
+Always returns True for CHECK_NONE and CHECK_CRC32.
+[clinic start generated code]*/
 
 static PyObject *
-is_check_supported(PyObject *self, PyObject *args)
+_lzma_is_check_supported_impl(PyModuleDef *module, int check_id)
+/*[clinic end generated code: output=bb828e90e00ad96e input=5518297b97b2318f]*/
 {
-    int check_id;
-
-    if (!PyArg_ParseTuple(args, "i:is_check_supported", &check_id))
-        return NULL;
-
     return PyBool_FromLong(lzma_check_is_supported(check_id));
 }
 
 
-PyDoc_STRVAR(_encode_filter_properties_doc,
-"_encode_filter_properties(filter) -> bytes\n"
-"\n"
-"Return a bytes object encoding the options (properties) of the filter\n"
-"specified by *filter* (a dict).\n"
-"\n"
-"The result does not include the filter ID itself, only the options.\n");
+/*[clinic input]
+_lzma._encode_filter_properties
+    filter: lzma_filter(c_default="{LZMA_VLI_UNKNOWN, NULL}")
+    /
+
+Return a bytes object encoding the options (properties) of the filter specified by *filter* (a dict).
+
+The result does not include the filter ID itself, only the options.
+[clinic start generated code]*/
 
 static PyObject *
-_encode_filter_properties(PyObject *self, PyObject *args)
+_lzma__encode_filter_properties_impl(PyModuleDef *module, lzma_filter filter)
+/*[clinic end generated code: output=b5fe690acd6b61d1 input=d4c64f1b557c77d4]*/
 {
-    PyObject *filterspec;
-    lzma_filter filter;
     lzma_ret lzret;
     uint32_t encoded_size;
     PyObject *result = NULL;
 
-    if (!PyArg_ParseTuple(args, "O:_encode_filter_properties", &filterspec))
-        return NULL;
-
-    if (parse_filter_spec(&filter, filterspec) == NULL)
-        return NULL;
-
     lzret = lzma_properties_size(&encoded_size, &filter);
     if (catch_lzma_error(lzret))
         goto error;
@@ -1151,37 +1240,36 @@
     if (catch_lzma_error(lzret))
         goto error;
 
-    PyMem_Free(filter.options);
     return result;
 
 error:
     Py_XDECREF(result);
-    PyMem_Free(filter.options);
     return NULL;
 }
 
 
-PyDoc_STRVAR(_decode_filter_properties_doc,
-"_decode_filter_properties(filter_id, encoded_props) -> dict\n"
-"\n"
-"Return a dict describing a filter with ID *filter_id*, and options\n"
-"(properties) decoded from the bytes object *encoded_props*.\n");
+/*[clinic input]
+_lzma._decode_filter_properties
+    filter_id: lzma_vli
+    encoded_props: Py_buffer
+    /
+
+Return a bytes object encoding the options (properties) of the filter specified by *filter* (a dict).
+
+The result does not include the filter ID itself, only the options.
+[clinic start generated code]*/
 
 static PyObject *
-_decode_filter_properties(PyObject *self, PyObject *args)
+_lzma__decode_filter_properties_impl(PyModuleDef *module, lzma_vli filter_id, Py_buffer *encoded_props)
+/*[clinic end generated code: output=235f7f5345d48744 input=246410800782160c]*/
 {
-    Py_buffer encoded_props;
     lzma_filter filter;
     lzma_ret lzret;
     PyObject *result = NULL;
-
-    if (!PyArg_ParseTuple(args, "O&y*:_decode_filter_properties",
-                          lzma_vli_converter, &filter.id, &encoded_props))
-        return NULL;
+    filter.id = filter_id;
 
     lzret = lzma_properties_decode(
-            &filter, NULL, encoded_props.buf, encoded_props.len);
-    PyBuffer_Release(&encoded_props);
+            &filter, NULL, encoded_props->buf, encoded_props->len);
     if (catch_lzma_error(lzret))
         return NULL;
 
@@ -1197,12 +1285,9 @@
 /* Module initialization. */
 
 static PyMethodDef module_methods[] = {
-    {"is_check_supported", (PyCFunction)is_check_supported,
-     METH_VARARGS, is_check_supported_doc},
-    {"_encode_filter_properties", (PyCFunction)_encode_filter_properties,
-     METH_VARARGS, _encode_filter_properties_doc},
-    {"_decode_filter_properties", (PyCFunction)_decode_filter_properties,
-     METH_VARARGS, _decode_filter_properties_doc},
+    _LZMA_IS_CHECK_SUPPORTED_METHODDEF
+    _LZMA__ENCODE_FILTER_PROPERTIES_METHODDEF
+    _LZMA__DECODE_FILTER_PROPERTIES_METHODDEF
     {NULL}
 };
 
diff --git a/Modules/_math.c b/Modules/_math.c
index a14ff06..a002208 100644
--- a/Modules/_math.c
+++ b/Modules/_math.c
@@ -240,7 +240,7 @@
         return x;
     }
     else if (-0.5 <= x && x <= 1.) {
-        /* WARNING: it's possible than an overeager compiler
+        /* WARNING: it's possible that an overeager compiler
            will incorrectly optimize the following two lines
            to the equivalent of "return log(1.+x)". If this
            happens, then results from log1p will be inaccurate
diff --git a/Modules/_multiprocessing/multiprocessing.c b/Modules/_multiprocessing/multiprocessing.c
index 9460c89..4ae638e 100644
--- a/Modules/_multiprocessing/multiprocessing.c
+++ b/Modules/_multiprocessing/multiprocessing.c
@@ -10,25 +10,23 @@
 #include "multiprocessing.h"
 
 
-PyObject *ProcessError, *BufferTooShort;
-
 /*
  * Function which raises exceptions based on error codes
  */
 
 PyObject *
-mp_SetError(PyObject *Type, int num)
+_PyMp_SetError(PyObject *Type, int num)
 {
     switch (num) {
 #ifdef MS_WINDOWS
     case MP_STANDARD_ERROR:
         if (Type == NULL)
-            Type = PyExc_WindowsError;
+            Type = PyExc_OSError;
         PyErr_SetExcFromWindowsErr(Type, 0);
         break;
     case MP_SOCKET_ERROR:
         if (Type == NULL)
-            Type = PyExc_WindowsError;
+            Type = PyExc_OSError;
         PyErr_SetExcFromWindowsErr(Type, WSAGetLastError());
         break;
 #else /* !MS_WINDOWS */
@@ -101,13 +99,15 @@
 {
     HANDLE handle;
     Py_buffer buf;
-    int ret;
+    int ret, length;
 
     if (!PyArg_ParseTuple(args, F_HANDLE "y*:send" , &handle, &buf))
         return NULL;
 
+    length = (int)Py_MIN(buf.len, INT_MAX);
+
     Py_BEGIN_ALLOW_THREADS
-    ret = send((SOCKET) handle, buf.buf, buf.len, 0);
+    ret = send((SOCKET) handle, buf.buf, length, 0);
     Py_END_ALLOW_THREADS
 
     PyBuffer_Release(&buf);
@@ -128,6 +128,9 @@
     {"recv", multiprocessing_recv, METH_VARARGS, ""},
     {"send", multiprocessing_send, METH_VARARGS, ""},
 #endif
+#ifndef POSIX_SEMAPHORES_NOT_ENABLED
+    {"sem_unlink", _PyMp_sem_unlink, METH_VARARGS, ""},
+#endif
     {NULL}
 };
 
@@ -159,19 +162,12 @@
     if (!module)
         return NULL;
 
-    /* Get copy of BufferTooShort */
-    temp = PyImport_ImportModule("multiprocessing");
-    if (!temp)
-        return NULL;
-    BufferTooShort = PyObject_GetAttrString(temp, "BufferTooShort");
-    Py_XDECREF(temp);
-
 #if defined(MS_WINDOWS) ||                                              \
   (defined(HAVE_SEM_OPEN) && !defined(POSIX_SEMAPHORES_NOT_ENABLED))
-    /* Add SemLock type to module */
-    if (PyType_Ready(&SemLockType) < 0)
+    /* Add _PyMp_SemLock type to module */
+    if (PyType_Ready(&_PyMp_SemLockType) < 0)
         return NULL;
-    Py_INCREF(&SemLockType);
+    Py_INCREF(&_PyMp_SemLockType);
     {
         PyObject *py_sem_value_max;
         /* Some systems define SEM_VALUE_MAX as an unsigned value that
@@ -182,10 +178,10 @@
             py_sem_value_max = PyLong_FromLong(SEM_VALUE_MAX);
         if (py_sem_value_max == NULL)
             return NULL;
-        PyDict_SetItemString(SemLockType.tp_dict, "SEM_VALUE_MAX",
+        PyDict_SetItemString(_PyMp_SemLockType.tp_dict, "SEM_VALUE_MAX",
                              py_sem_value_max);
     }
-    PyModule_AddObject(module, "SemLock", (PyObject*)&SemLockType);
+    PyModule_AddObject(module, "SemLock", (PyObject*)&_PyMp_SemLockType);
 #endif
 
     /* Add configuration macros */
diff --git a/Modules/_multiprocessing/multiprocessing.h b/Modules/_multiprocessing/multiprocessing.h
index e3de9ba..9aeea8d 100644
--- a/Modules/_multiprocessing/multiprocessing.h
+++ b/Modules/_multiprocessing/multiprocessing.h
@@ -91,23 +91,13 @@
 #define MP_SOCKET_ERROR (-1002)
 #define MP_EXCEPTION_HAS_BEEN_SET (-1003)
 
-PyObject *mp_SetError(PyObject *Type, int num);
+PyObject *_PyMp_SetError(PyObject *Type, int num);
 
 /*
  * Externs - not all will really exist on all platforms
  */
 
-extern PyObject *BufferTooShort;
-extern PyTypeObject SemLockType;
-extern PyTypeObject PipeConnectionType;
-
-/*
- * Miscellaneous
- */
-
-#ifndef MIN
-#  define MIN(x, y) ((x) < (y) ? x : y)
-#  define MAX(x, y) ((x) > (y) ? x : y)
-#endif
+extern PyTypeObject _PyMp_SemLockType;
+extern PyObject *_PyMp_sem_unlink(PyObject *ignore, PyObject *args);
 
 #endif /* MULTIPROCESSING_H */
diff --git a/Modules/_multiprocessing/semaphore.c b/Modules/_multiprocessing/semaphore.c
index 2c2b020..de85a90 100644
--- a/Modules/_multiprocessing/semaphore.c
+++ b/Modules/_multiprocessing/semaphore.c
@@ -18,6 +18,7 @@
     int count;
     int maxvalue;
     int kind;
+    char *name;
 } SemLockObject;
 
 #define ISMINE(o) (o->count > 0 && PyThread_get_thread_ident() == o->last_tid)
@@ -43,7 +44,7 @@
 {
     long previous;
 
-    switch (WaitForSingleObject(handle, 0)) {
+    switch (WaitForSingleObjectEx(handle, 0, FALSE)) {
     case WAIT_OBJECT_0:
         if (!ReleaseSemaphore(handle, 1, &previous))
             return MP_STANDARD_ERROR;
@@ -99,7 +100,7 @@
     }
 
     /* check whether we can acquire without releasing the GIL and blocking */
-    if (WaitForSingleObject(self->handle, 0) == WAIT_OBJECT_0) {
+    if (WaitForSingleObjectEx(self->handle, 0, FALSE) == WAIT_OBJECT_0) {
         self->last_tid = GetCurrentThreadId();
         ++self->count;
         Py_RETURN_TRUE;
@@ -118,7 +119,7 @@
     Py_BEGIN_ALLOW_THREADS
     if (sigint_event != NULL)
         ResetEvent(sigint_event);
-    res = WaitForMultipleObjects(nhandles, handles, FALSE, full_msecs);
+    res = WaitForMultipleObjectsEx(nhandles, handles, FALSE, full_msecs, FALSE);
     Py_END_ALLOW_THREADS
 
     /* handle result */
@@ -200,7 +201,7 @@
 #ifndef HAVE_SEM_TIMEDWAIT
 #  define sem_timedwait(sem,deadline) sem_timedwait_save(sem,deadline,_save)
 
-int
+static int
 sem_timedwait_save(sem_t *sem, struct timespec *deadline, PyThreadState *_save)
 {
     int res;
@@ -397,7 +398,8 @@
  */
 
 static PyObject *
-newsemlockobject(PyTypeObject *type, SEM_HANDLE handle, int kind, int maxvalue)
+newsemlockobject(PyTypeObject *type, SEM_HANDLE handle, int kind, int maxvalue,
+                 char *name)
 {
     SemLockObject *self;
 
@@ -409,21 +411,22 @@
     self->count = 0;
     self->last_tid = 0;
     self->maxvalue = maxvalue;
+    self->name = name;
     return (PyObject*)self;
 }
 
 static PyObject *
 semlock_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
 {
-    char buffer[256];
     SEM_HANDLE handle = SEM_FAILED;
-    int kind, maxvalue, value;
+    int kind, maxvalue, value, unlink;
     PyObject *result;
-    static char *kwlist[] = {"kind", "value", "maxvalue", NULL};
-    static int counter = 0;
+    char *name, *name_copy = NULL;
+    static char *kwlist[] = {"kind", "value", "maxvalue", "name", "unlink",
+                             NULL};
 
-    if (!PyArg_ParseTupleAndKeywords(args, kwds, "iii", kwlist,
-                                     &kind, &value, &maxvalue))
+    if (!PyArg_ParseTupleAndKeywords(args, kwds, "iiisi", kwlist,
+                                     &kind, &value, &maxvalue, &name, &unlink))
         return NULL;
 
     if (kind != RECURSIVE_MUTEX && kind != SEMAPHORE) {
@@ -431,18 +434,23 @@
         return NULL;
     }
 
-    PyOS_snprintf(buffer, sizeof(buffer), "/mp%ld-%d", (long)getpid(), counter++);
+    if (!unlink) {
+        name_copy = PyMem_Malloc(strlen(name) + 1);
+        if (name_copy == NULL)
+            goto failure;
+        strcpy(name_copy, name);
+    }
 
     SEM_CLEAR_ERROR();
-    handle = SEM_CREATE(buffer, value, maxvalue);
+    handle = SEM_CREATE(name, value, maxvalue);
     /* On Windows we should fail if GetLastError()==ERROR_ALREADY_EXISTS */
     if (handle == SEM_FAILED || SEM_GET_LAST_ERROR() != 0)
         goto failure;
 
-    if (SEM_UNLINK(buffer) < 0)
+    if (unlink && SEM_UNLINK(name) < 0)
         goto failure;
 
-    result = newsemlockobject(type, handle, kind, maxvalue);
+    result = newsemlockobject(type, handle, kind, maxvalue, name_copy);
     if (!result)
         goto failure;
 
@@ -451,7 +459,8 @@
   failure:
     if (handle != SEM_FAILED)
         SEM_CLOSE(handle);
-    mp_SetError(NULL, MP_STANDARD_ERROR);
+    PyMem_Free(name_copy);
+    _PyMp_SetError(NULL, MP_STANDARD_ERROR);
     return NULL;
 }
 
@@ -460,12 +469,30 @@
 {
     SEM_HANDLE handle;
     int kind, maxvalue;
+    char *name, *name_copy = NULL;
 
-    if (!PyArg_ParseTuple(args, F_SEM_HANDLE "ii",
-                          &handle, &kind, &maxvalue))
+    if (!PyArg_ParseTuple(args, F_SEM_HANDLE "iiz",
+                          &handle, &kind, &maxvalue, &name))
         return NULL;
 
-    return newsemlockobject(type, handle, kind, maxvalue);
+    if (name != NULL) {
+        name_copy = PyMem_Malloc(strlen(name) + 1);
+        if (name_copy == NULL)
+            return PyErr_NoMemory();
+        strcpy(name_copy, name);
+    }
+
+#ifndef MS_WINDOWS
+    if (name != NULL) {
+        handle = sem_open(name, 0);
+        if (handle == SEM_FAILED) {
+            PyMem_Free(name_copy);
+            return PyErr_SetFromErrno(PyExc_OSError);
+        }
+    }
+#endif
+
+    return newsemlockobject(type, handle, kind, maxvalue, name_copy);
 }
 
 static void
@@ -473,6 +500,7 @@
 {
     if (self->handle != SEM_FAILED)
         SEM_CLOSE(self->handle);
+    PyMem_Free(self->name);
     PyObject_Del(self);
 }
 
@@ -498,7 +526,7 @@
 #else
     int sval;
     if (SEM_GETVALUE(self->handle, &sval) < 0)
-        return mp_SetError(NULL, MP_STANDARD_ERROR);
+        return _PyMp_SetError(NULL, MP_STANDARD_ERROR);
     /* some posix implementations use negative numbers to indicate
        the number of waiting threads */
     if (sval < 0)
@@ -514,16 +542,16 @@
     if (sem_trywait(self->handle) < 0) {
         if (errno == EAGAIN)
             Py_RETURN_TRUE;
-        return mp_SetError(NULL, MP_STANDARD_ERROR);
+        return _PyMp_SetError(NULL, MP_STANDARD_ERROR);
     } else {
         if (sem_post(self->handle) < 0)
-            return mp_SetError(NULL, MP_STANDARD_ERROR);
+            return _PyMp_SetError(NULL, MP_STANDARD_ERROR);
         Py_RETURN_FALSE;
     }
 #else
     int sval;
     if (SEM_GETVALUE(self->handle, &sval) < 0)
-        return mp_SetError(NULL, MP_STANDARD_ERROR);
+        return _PyMp_SetError(NULL, MP_STANDARD_ERROR);
     return PyBool_FromLong((long)sval == 0);
 #endif
 }
@@ -574,6 +602,8 @@
      ""},
     {"maxvalue", T_INT, offsetof(SemLockObject, maxvalue), READONLY,
      ""},
+    {"name", T_STRING, offsetof(SemLockObject, name), READONLY,
+     ""},
     {NULL}
 };
 
@@ -581,7 +611,7 @@
  * Semaphore type
  */
 
-PyTypeObject SemLockType = {
+PyTypeObject _PyMp_SemLockType = {
     PyVarObject_HEAD_INIT(NULL, 0)
     /* tp_name           */ "_multiprocessing.SemLock",
     /* tp_basicsize      */ sizeof(SemLockObject),
@@ -621,3 +651,23 @@
     /* tp_alloc          */ 0,
     /* tp_new            */ semlock_new,
 };
+
+/*
+ * Function to unlink semaphore names
+ */
+
+PyObject *
+_PyMp_sem_unlink(PyObject *ignore, PyObject *args)
+{
+    char *name;
+
+    if (!PyArg_ParseTuple(args, "s", &name))
+        return NULL;
+
+    if (SEM_UNLINK(name) < 0) {
+        _PyMp_SetError(NULL, MP_STANDARD_ERROR);
+        return NULL;
+    }
+
+    Py_RETURN_NONE;
+}
diff --git a/Modules/_opcode.c b/Modules/_opcode.c
new file mode 100644
index 0000000..fee388f
--- /dev/null
+++ b/Modules/_opcode.c
@@ -0,0 +1,109 @@
+#include "Python.h"
+#include "opcode.h"
+
+/*[clinic input]
+module _opcode
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=117442e66eb376e6]*/
+
+/*[clinic input]
+
+_opcode.stack_effect -> int
+
+  opcode: int
+  oparg: object = None
+  /
+
+Compute the stack effect of the opcode.
+[clinic start generated code]*/
+
+PyDoc_STRVAR(_opcode_stack_effect__doc__,
+"stack_effect($module, opcode, oparg=None, /)\n"
+"--\n"
+"\n"
+"Compute the stack effect of the opcode.");
+
+#define _OPCODE_STACK_EFFECT_METHODDEF    \
+    {"stack_effect", (PyCFunction)_opcode_stack_effect, METH_VARARGS, _opcode_stack_effect__doc__},
+
+static int
+_opcode_stack_effect_impl(PyModuleDef *module, int opcode, PyObject *oparg);
+
+static PyObject *
+_opcode_stack_effect(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    int opcode;
+    PyObject *oparg = Py_None;
+    int _return_value;
+
+    if (!PyArg_ParseTuple(args,
+        "i|O:stack_effect",
+        &opcode, &oparg))
+        goto exit;
+    _return_value = _opcode_stack_effect_impl(module, opcode, oparg);
+    if ((_return_value == -1) && PyErr_Occurred())
+        goto exit;
+    return_value = PyLong_FromLong((long)_return_value);
+
+exit:
+    return return_value;
+}
+
+static int
+_opcode_stack_effect_impl(PyModuleDef *module, int opcode, PyObject *oparg)
+/*[clinic end generated code: output=9e1133f8d587bc67 input=2d0a9ee53c0418f5]*/
+{
+    int effect;
+    int oparg_int = 0;
+    if (HAS_ARG(opcode)) {
+        if (oparg == Py_None) {
+            PyErr_SetString(PyExc_ValueError,
+                    "stack_effect: opcode requires oparg but oparg was not specified");
+            return -1;
+        }
+        oparg_int = (int)PyLong_AsLong(oparg);
+        if ((oparg_int == -1) && PyErr_Occurred())
+            return -1;
+    }
+    else if (oparg != Py_None) {
+        PyErr_SetString(PyExc_ValueError,
+                "stack_effect: opcode does not permit oparg but oparg was specified");
+        return -1;
+    }
+    effect = PyCompile_OpcodeStackEffect(opcode, oparg_int);
+    if (effect == PY_INVALID_STACK_EFFECT) {
+            PyErr_SetString(PyExc_ValueError,
+                    "invalid opcode or oparg");
+            return -1;
+    }
+    return effect;
+}
+
+
+
+
+static PyMethodDef
+opcode_functions[] =  {
+    _OPCODE_STACK_EFFECT_METHODDEF
+    {NULL, NULL, 0, NULL}
+};
+
+
+static struct PyModuleDef opcodemodule = {
+    PyModuleDef_HEAD_INIT,
+    "_opcode",
+    "Opcode support module.",
+    -1,
+    opcode_functions,
+    NULL,
+    NULL,
+    NULL,
+    NULL
+};
+
+PyMODINIT_FUNC
+PyInit__opcode(void)
+{
+    return PyModule_Create(&opcodemodule);
+}
diff --git a/Modules/operator.c b/Modules/_operator.c
similarity index 90%
rename from Modules/operator.c
rename to Modules/_operator.c
index 5156b6b..adeb99e 100644
--- a/Modules/operator.c
+++ b/Modules/_operator.c
@@ -208,6 +208,31 @@
     return (result == 0);
 }
 
+PyDoc_STRVAR(length_hint__doc__,
+"length_hint(obj, default=0) -> int\n"
+"Return an estimate of the number of items in obj.\n"
+"This is useful for presizing containers when building from an\n"
+"iterable.\n"
+"\n"
+"If the object supports len(), the result will be\n"
+"exact. Otherwise, it may over- or under-estimate by an\n"
+"arbitrary amount. The result will be an integer >= 0.");
+
+static PyObject *length_hint(PyObject *self, PyObject *args)
+{
+    PyObject *obj;
+    Py_ssize_t defaultvalue = 0, res;
+    if (!PyArg_ParseTuple(args, "O|n:length_hint", &obj, &defaultvalue)) {
+        return NULL;
+    }
+    res = PyObject_LengthHint(obj, defaultvalue);
+    if (res == -1 && PyErr_Occurred()) {
+        return NULL;
+    }
+    return PyLong_FromSsize_t(res);
+}
+
+
 PyDoc_STRVAR(compare_digest__doc__,
 "compare_digest(a, b) -> bool\n"
 "\n"
@@ -252,7 +277,7 @@
         Py_buffer view_a;
         Py_buffer view_b;
 
-        if ((PyObject_CheckBuffer(a) == 0) & (PyObject_CheckBuffer(b) == 0)) {
+        if (PyObject_CheckBuffer(a) == 0 && PyObject_CheckBuffer(b) == 0) {
             PyErr_Format(PyExc_TypeError,
                          "unsupported operand types(s) or combination of types: "
                          "'%.100s' and '%.100s'",
@@ -297,17 +322,15 @@
 /* operator methods **********************************************************/
 
 #define spam1(OP,DOC) {#OP, OP, METH_VARARGS, PyDoc_STR(DOC)},
-#define spam2(OP,ALTOP,DOC) {#OP, op_##OP, METH_VARARGS, PyDoc_STR(DOC)}, \
-                           {#ALTOP, op_##OP, METH_VARARGS, PyDoc_STR(DOC)},
+#define spam2(OP,DOC) {#OP, op_##OP, METH_VARARGS, PyDoc_STR(DOC)},
 #define spam1o(OP,DOC) {#OP, OP, METH_O, PyDoc_STR(DOC)},
-#define spam2o(OP,ALTOP,DOC) {#OP, op_##OP, METH_O, PyDoc_STR(DOC)}, \
-                           {#ALTOP, op_##OP, METH_O, PyDoc_STR(DOC)},
+#define spam2o(OP,DOC) {#OP, op_##OP, METH_O, PyDoc_STR(DOC)},
 
 static struct PyMethodDef operator_methods[] = {
 
 spam1o(truth,
  "truth(a) -- Return True if a is true, False otherwise.")
-spam2(contains,__contains__,
+spam2(contains,
  "contains(a, b) -- Same as b in a (note reversed operands).")
 spam1(indexOf,
  "indexOf(a, b) -- Return the first index of b in a.")
@@ -316,56 +339,58 @@
 
 spam1(is_, "is_(a, b) -- Same as a is b.")
 spam1(is_not, "is_not(a, b) -- Same as a is not b.")
-spam2o(index, __index__, "index(a) -- Same as a.__index__()")
-spam2(add,__add__, "add(a, b) -- Same as a + b.")
-spam2(sub,__sub__, "sub(a, b) -- Same as a - b.")
-spam2(mul,__mul__, "mul(a, b) -- Same as a * b.")
-spam2(floordiv,__floordiv__, "floordiv(a, b) -- Same as a // b.")
-spam2(truediv,__truediv__, "truediv(a, b) -- Same as a / b.")
-spam2(mod,__mod__, "mod(a, b) -- Same as a % b.")
-spam2o(neg,__neg__, "neg(a) -- Same as -a.")
-spam2o(pos,__pos__, "pos(a) -- Same as +a.")
-spam2o(abs,__abs__, "abs(a) -- Same as abs(a).")
-spam2o(inv,__inv__, "inv(a) -- Same as ~a.")
-spam2o(invert,__invert__, "invert(a) -- Same as ~a.")
-spam2(lshift,__lshift__, "lshift(a, b) -- Same as a << b.")
-spam2(rshift,__rshift__, "rshift(a, b) -- Same as a >> b.")
-spam2o(not_,__not__, "not_(a) -- Same as not a.")
-spam2(and_,__and__, "and_(a, b) -- Same as a & b.")
-spam2(xor,__xor__, "xor(a, b) -- Same as a ^ b.")
-spam2(or_,__or__, "or_(a, b) -- Same as a | b.")
-spam2(iadd,__iadd__, "a = iadd(a, b) -- Same as a += b.")
-spam2(isub,__isub__, "a = isub(a, b) -- Same as a -= b.")
-spam2(imul,__imul__, "a = imul(a, b) -- Same as a *= b.")
-spam2(ifloordiv,__ifloordiv__, "a = ifloordiv(a, b) -- Same as a //= b.")
-spam2(itruediv,__itruediv__, "a = itruediv(a, b) -- Same as a /= b")
-spam2(imod,__imod__, "a = imod(a, b) -- Same as a %= b.")
-spam2(ilshift,__ilshift__, "a = ilshift(a, b) -- Same as a <<= b.")
-spam2(irshift,__irshift__, "a = irshift(a, b) -- Same as a >>= b.")
-spam2(iand,__iand__, "a = iand(a, b) -- Same as a &= b.")
-spam2(ixor,__ixor__, "a = ixor(a, b) -- Same as a ^= b.")
-spam2(ior,__ior__, "a = ior(a, b) -- Same as a |= b.")
-spam2(concat,__concat__,
+spam2o(index, "index(a) -- Same as a.__index__()")
+spam2(add, "add(a, b) -- Same as a + b.")
+spam2(sub, "sub(a, b) -- Same as a - b.")
+spam2(mul, "mul(a, b) -- Same as a * b.")
+spam2(floordiv, "floordiv(a, b) -- Same as a // b.")
+spam2(truediv, "truediv(a, b) -- Same as a / b.")
+spam2(mod, "mod(a, b) -- Same as a % b.")
+spam2o(neg, "neg(a) -- Same as -a.")
+spam2o(pos, "pos(a) -- Same as +a.")
+spam2o(abs, "abs(a) -- Same as abs(a).")
+spam2o(inv, "inv(a) -- Same as ~a.")
+spam2o(invert, "invert(a) -- Same as ~a.")
+spam2(lshift, "lshift(a, b) -- Same as a << b.")
+spam2(rshift, "rshift(a, b) -- Same as a >> b.")
+spam2o(not_, "not_(a) -- Same as not a.")
+spam2(and_, "and_(a, b) -- Same as a & b.")
+spam2(xor, "xor(a, b) -- Same as a ^ b.")
+spam2(or_, "or_(a, b) -- Same as a | b.")
+spam2(iadd, "a = iadd(a, b) -- Same as a += b.")
+spam2(isub, "a = isub(a, b) -- Same as a -= b.")
+spam2(imul, "a = imul(a, b) -- Same as a *= b.")
+spam2(ifloordiv, "a = ifloordiv(a, b) -- Same as a //= b.")
+spam2(itruediv, "a = itruediv(a, b) -- Same as a /= b")
+spam2(imod, "a = imod(a, b) -- Same as a %= b.")
+spam2(ilshift, "a = ilshift(a, b) -- Same as a <<= b.")
+spam2(irshift, "a = irshift(a, b) -- Same as a >>= b.")
+spam2(iand, "a = iand(a, b) -- Same as a &= b.")
+spam2(ixor, "a = ixor(a, b) -- Same as a ^= b.")
+spam2(ior, "a = ior(a, b) -- Same as a |= b.")
+spam2(concat,
  "concat(a, b) -- Same as a + b, for a and b sequences.")
-spam2(iconcat,__iconcat__,
+spam2(iconcat,
  "a = iconcat(a, b) -- Same as a += b, for a and b sequences.")
-spam2(getitem,__getitem__,
+spam2(getitem,
  "getitem(a, b) -- Same as a[b].")
-spam2(setitem,__setitem__,
+spam2(setitem,
  "setitem(a, b, c) -- Same as a[b] = c.")
-spam2(delitem,__delitem__,
+spam2(delitem,
  "delitem(a, b) -- Same as del a[b].")
-spam2(pow,__pow__, "pow(a, b) -- Same as a ** b.")
-spam2(ipow,__ipow__, "a = ipow(a, b) -- Same as a **= b.")
-spam2(lt,__lt__, "lt(a, b) -- Same as a<b.")
-spam2(le,__le__, "le(a, b) -- Same as a<=b.")
-spam2(eq,__eq__, "eq(a, b) -- Same as a==b.")
-spam2(ne,__ne__, "ne(a, b) -- Same as a!=b.")
-spam2(gt,__gt__, "gt(a, b) -- Same as a>b.")
-spam2(ge,__ge__, "ge(a, b) -- Same as a>=b.")
+spam2(pow, "pow(a, b) -- Same as a ** b.")
+spam2(ipow, "a = ipow(a, b) -- Same as a **= b.")
+spam2(lt, "lt(a, b) -- Same as a<b.")
+spam2(le, "le(a, b) -- Same as a<=b.")
+spam2(eq, "eq(a, b) -- Same as a==b.")
+spam2(ne, "ne(a, b) -- Same as a!=b.")
+spam2(gt, "gt(a, b) -- Same as a>b.")
+spam2(ge, "ge(a, b) -- Same as a>=b.")
 
     {"_compare_digest", (PyCFunction)compare_digest, METH_VARARGS,
      compare_digest__doc__},
+     {"length_hint", (PyCFunction)length_hint, METH_VARARGS,
+     length_hint__doc__},
     {NULL,              NULL}           /* sentinel */
 
 };
@@ -892,12 +917,12 @@
 };
 
 
-/* Initialization function for the module (*must* be called PyInit_operator) */
+/* Initialization function for the module (*must* be called PyInit__operator) */
 
 
 static struct PyModuleDef operatormodule = {
     PyModuleDef_HEAD_INIT,
-    "operator",
+    "_operator",
     operator_doc,
     -1,
     operator_methods,
@@ -908,7 +933,7 @@
 };
 
 PyMODINIT_FUNC
-PyInit_operator(void)
+PyInit__operator(void)
 {
     PyObject *m;
 
diff --git a/Modules/_pickle.c b/Modules/_pickle.c
index ae801f7..10eb513 100644
--- a/Modules/_pickle.c
+++ b/Modules/_pickle.c
@@ -4,9 +4,19 @@
 PyDoc_STRVAR(pickle_module_doc,
 "Optimized C implementation for the Python pickle module.");
 
+/*[clinic input]
+output preset file
+module _pickle
+class _pickle.Pickler "PicklerObject *" "&Pickler_Type"
+class _pickle.PicklerMemoProxy "PicklerMemoProxyObject *" "&PicklerMemoProxyType"
+class _pickle.Unpickler "UnpicklerObject *" "&Unpickler_Type"
+class _pickle.UnpicklerMemoProxy "UnpicklerMemoProxyObject *" "&UnpicklerMemoProxyType"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=11c45248a41dd3fc]*/
+
 /* Bump this when new opcodes are added to the pickle protocol. */
 enum {
-    HIGHEST_PROTOCOL = 3,
+    HIGHEST_PROTOCOL = 4,
     DEFAULT_PROTOCOL = 3
 };
 
@@ -71,18 +81,20 @@
 
     /* Protocol 3 (Python 3.x) */
     BINBYTES       = 'B',
-    SHORT_BINBYTES = 'C'
-};
+    SHORT_BINBYTES = 'C',
 
-/* These aren't opcodes -- they're ways to pickle bools before protocol 2
- * so that unpicklers written before bools were introduced unpickle them
- * as ints, but unpicklers after can recognize that bools were intended.
- * Note that protocol 2 added direct ways to pickle bools.
- */
-#undef TRUE
-#define TRUE  "I01\n"
-#undef FALSE
-#define FALSE "I00\n"
+    /* Protocol 4 */
+    SHORT_BINUNICODE = '\x8c',
+    BINUNICODE8      = '\x8d',
+    BINBYTES8        = '\x8e',
+    EMPTY_SET        = '\x8f',
+    ADDITEMS         = '\x90',
+    FROZENSET        = '\x91',
+    NEWOBJ_EX        = '\x92',
+    STACK_GLOBAL     = '\x93',
+    MEMOIZE          = '\x94',
+    FRAME            = '\x95'
+};
 
 enum {
    /* Keep in synch with pickle.Pickler._BATCHSIZE.  This is how many elements
@@ -98,48 +110,246 @@
     /* Initial size of the write buffer of Pickler. */
     WRITE_BUF_SIZE = 4096,
 
-    /* Maximum size of the write buffer of Pickler when pickling to a
-       stream.  This is ignored for in-memory pickling. */
-    MAX_WRITE_BUF_SIZE = 64 * 1024,
-
     /* Prefetch size when unpickling (disabled on unpeekable streams) */
-    PREFETCH = 8192 * 16
+    PREFETCH = 8192 * 16,
+
+    FRAME_SIZE_TARGET = 64 * 1024,
+
+    FRAME_HEADER_SIZE = 9
 };
 
-/* Exception classes for pickle. These should override the ones defined in
-   pickle.py, when the C-optimized Pickler and Unpickler are used. */
-static PyObject *PickleError = NULL;
-static PyObject *PicklingError = NULL;
-static PyObject *UnpicklingError = NULL;
+/*************************************************************************/
 
-/* copyreg.dispatch_table, {type_object: pickling_function} */
-static PyObject *dispatch_table = NULL;
-/* For EXT[124] opcodes. */
-/* copyreg._extension_registry, {(module_name, function_name): code} */
-static PyObject *extension_registry = NULL;
-/* copyreg._inverted_registry, {code: (module_name, function_name)} */
-static PyObject *inverted_registry = NULL;
-/* copyreg._extension_cache, {code: object} */
-static PyObject *extension_cache = NULL;
+/* State of the pickle module, per PEP 3121. */
+typedef struct {
+    /* Exception classes for pickle. */
+    PyObject *PickleError;
+    PyObject *PicklingError;
+    PyObject *UnpicklingError;
 
-/* _compat_pickle.NAME_MAPPING, {(oldmodule, oldname): (newmodule, newname)} */
-static PyObject *name_mapping_2to3 = NULL;
-/* _compat_pickle.IMPORT_MAPPING, {oldmodule: newmodule} */
-static PyObject *import_mapping_2to3 = NULL;
-/* Same, but with REVERSE_NAME_MAPPING / REVERSE_IMPORT_MAPPING */
-static PyObject *name_mapping_3to2 = NULL;
-static PyObject *import_mapping_3to2 = NULL;
+    /* copyreg.dispatch_table, {type_object: pickling_function} */
+    PyObject *dispatch_table;
 
-/* XXX: Are these really nescessary? */
-/* As the name says, an empty tuple. */
-static PyObject *empty_tuple = NULL;
-/* For looking up name pairs in copyreg._extension_registry. */
-static PyObject *two_tuple = NULL;
+    /* For the extension opcodes EXT1, EXT2 and EXT4. */
+
+    /* copyreg._extension_registry, {(module_name, function_name): code} */
+    PyObject *extension_registry;
+    /* copyreg._extension_cache, {code: object} */
+    PyObject *extension_cache;
+    /* copyreg._inverted_registry, {code: (module_name, function_name)} */
+    PyObject *inverted_registry;
+
+    /* Import mappings for compatibility with Python 2.x */
+
+    /* _compat_pickle.NAME_MAPPING,
+       {(oldmodule, oldname): (newmodule, newname)} */
+    PyObject *name_mapping_2to3;
+    /* _compat_pickle.IMPORT_MAPPING, {oldmodule: newmodule} */
+    PyObject *import_mapping_2to3;
+    /* Same, but with REVERSE_NAME_MAPPING / REVERSE_IMPORT_MAPPING */
+    PyObject *name_mapping_3to2;
+    PyObject *import_mapping_3to2;
+
+    /* codecs.encode, used for saving bytes in older protocols */
+    PyObject *codecs_encode;
+} PickleState;
+
+/* Forward declaration of the _pickle module definition. */
+static struct PyModuleDef _picklemodule;
+
+/* Given a module object, get its per-module state. */
+static PickleState *
+_Pickle_GetState(PyObject *module)
+{
+    return (PickleState *)PyModule_GetState(module);
+}
+
+/* Find the module instance imported in the currently running sub-interpreter
+   and get its state. */
+static PickleState *
+_Pickle_GetGlobalState(void)
+{
+    return _Pickle_GetState(PyState_FindModule(&_picklemodule));
+}
+
+/* Clear the given pickle module state. */
+static void
+_Pickle_ClearState(PickleState *st)
+{
+    Py_CLEAR(st->PickleError);
+    Py_CLEAR(st->PicklingError);
+    Py_CLEAR(st->UnpicklingError);
+    Py_CLEAR(st->dispatch_table);
+    Py_CLEAR(st->extension_registry);
+    Py_CLEAR(st->extension_cache);
+    Py_CLEAR(st->inverted_registry);
+    Py_CLEAR(st->name_mapping_2to3);
+    Py_CLEAR(st->import_mapping_2to3);
+    Py_CLEAR(st->name_mapping_3to2);
+    Py_CLEAR(st->import_mapping_3to2);
+    Py_CLEAR(st->codecs_encode);
+}
+
+/* Initialize the given pickle module state. */
+static int
+_Pickle_InitState(PickleState *st)
+{
+    PyObject *copyreg = NULL;
+    PyObject *compat_pickle = NULL;
+    PyObject *codecs = NULL;
+
+    copyreg = PyImport_ImportModule("copyreg");
+    if (!copyreg)
+        goto error;
+    st->dispatch_table = PyObject_GetAttrString(copyreg, "dispatch_table");
+    if (!st->dispatch_table)
+        goto error;
+    if (!PyDict_CheckExact(st->dispatch_table)) {
+        PyErr_Format(PyExc_RuntimeError,
+                     "copyreg.dispatch_table should be a dict, not %.200s",
+                     Py_TYPE(st->dispatch_table)->tp_name);
+        goto error;
+    }
+    st->extension_registry = \
+        PyObject_GetAttrString(copyreg, "_extension_registry");
+    if (!st->extension_registry)
+        goto error;
+    if (!PyDict_CheckExact(st->extension_registry)) {
+        PyErr_Format(PyExc_RuntimeError,
+                     "copyreg._extension_registry should be a dict, "
+                     "not %.200s", Py_TYPE(st->extension_registry)->tp_name);
+        goto error;
+    }
+    st->inverted_registry = \
+        PyObject_GetAttrString(copyreg, "_inverted_registry");
+    if (!st->inverted_registry)
+        goto error;
+    if (!PyDict_CheckExact(st->inverted_registry)) {
+        PyErr_Format(PyExc_RuntimeError,
+                     "copyreg._inverted_registry should be a dict, "
+                     "not %.200s", Py_TYPE(st->inverted_registry)->tp_name);
+        goto error;
+    }
+    st->extension_cache = PyObject_GetAttrString(copyreg, "_extension_cache");
+    if (!st->extension_cache)
+        goto error;
+    if (!PyDict_CheckExact(st->extension_cache)) {
+        PyErr_Format(PyExc_RuntimeError,
+                     "copyreg._extension_cache should be a dict, "
+                     "not %.200s", Py_TYPE(st->extension_cache)->tp_name);
+        goto error;
+    }
+    Py_CLEAR(copyreg);
+
+    /* Load the 2.x -> 3.x stdlib module mapping tables */
+    compat_pickle = PyImport_ImportModule("_compat_pickle");
+    if (!compat_pickle)
+        goto error;
+    st->name_mapping_2to3 = \
+        PyObject_GetAttrString(compat_pickle, "NAME_MAPPING");
+    if (!st->name_mapping_2to3)
+        goto error;
+    if (!PyDict_CheckExact(st->name_mapping_2to3)) {
+        PyErr_Format(PyExc_RuntimeError,
+                     "_compat_pickle.NAME_MAPPING should be a dict, not %.200s",
+                     Py_TYPE(st->name_mapping_2to3)->tp_name);
+        goto error;
+    }
+    st->import_mapping_2to3 = \
+        PyObject_GetAttrString(compat_pickle, "IMPORT_MAPPING");
+    if (!st->import_mapping_2to3)
+        goto error;
+    if (!PyDict_CheckExact(st->import_mapping_2to3)) {
+        PyErr_Format(PyExc_RuntimeError,
+                     "_compat_pickle.IMPORT_MAPPING should be a dict, "
+                     "not %.200s", Py_TYPE(st->import_mapping_2to3)->tp_name);
+        goto error;
+    }
+    /* ... and the 3.x -> 2.x mapping tables */
+    st->name_mapping_3to2 = \
+        PyObject_GetAttrString(compat_pickle, "REVERSE_NAME_MAPPING");
+    if (!st->name_mapping_3to2)
+        goto error;
+    if (!PyDict_CheckExact(st->name_mapping_3to2)) {
+        PyErr_Format(PyExc_RuntimeError,
+                     "_compat_pickle.REVERSE_NAME_MAPPING should be a dict, "
+                     "not %.200s", Py_TYPE(st->name_mapping_3to2)->tp_name);
+        goto error;
+    }
+    st->import_mapping_3to2 = \
+        PyObject_GetAttrString(compat_pickle, "REVERSE_IMPORT_MAPPING");
+    if (!st->import_mapping_3to2)
+        goto error;
+    if (!PyDict_CheckExact(st->import_mapping_3to2)) {
+        PyErr_Format(PyExc_RuntimeError,
+                     "_compat_pickle.REVERSE_IMPORT_MAPPING should be a dict, "
+                     "not %.200s", Py_TYPE(st->import_mapping_3to2)->tp_name);
+        goto error;
+    }
+    Py_CLEAR(compat_pickle);
+
+    codecs = PyImport_ImportModule("codecs");
+    if (codecs == NULL)
+        goto error;
+    st->codecs_encode = PyObject_GetAttrString(codecs, "encode");
+    if (st->codecs_encode == NULL) {
+        goto error;
+    }
+    if (!PyCallable_Check(st->codecs_encode)) {
+        PyErr_Format(PyExc_RuntimeError,
+                     "codecs.encode should be a callable, not %.200s",
+                     Py_TYPE(st->codecs_encode)->tp_name);
+        goto error;
+    }
+    Py_CLEAR(codecs);
+
+    return 0;
+
+  error:
+    Py_CLEAR(copyreg);
+    Py_CLEAR(compat_pickle);
+    Py_CLEAR(codecs);
+    _Pickle_ClearState(st);
+    return -1;
+}
+
+/* Helper for calling a function with a single argument quickly.
+
+   This function steals the reference of the given argument. */
+static PyObject *
+_Pickle_FastCall(PyObject *func, PyObject *obj)
+{
+    PyObject *result;
+    PyObject *arg_tuple = PyTuple_New(1);
+
+    /* Note: this function used to reuse the argument tuple. This used to give
+       a slight performance boost with older pickle implementations where many
+       unbuffered reads occurred (thus needing many function calls).
+
+       However, this optimization was removed because it was too complicated
+       to get right. It abused the C API for tuples to mutate them which led
+       to subtle reference counting and concurrency bugs. Furthermore, the
+       introduction of protocol 4 and the prefetching optimization via peek()
+       significantly reduced the number of function calls we do. Thus, the
+       benefits became marginal at best. */
+
+    if (arg_tuple == NULL) {
+        Py_DECREF(obj);
+        return NULL;
+    }
+    PyTuple_SET_ITEM(arg_tuple, 0, obj);
+    result = PyObject_Call(func, arg_tuple, NULL);
+    Py_CLEAR(arg_tuple);
+    return result;
+}
+
+/*************************************************************************/
 
 static int
 stack_underflow(void)
 {
-    PyErr_SetString(UnpicklingError, "unpickling stack underflow");
+    PickleState *st = _Pickle_GetGlobalState();
+    PyErr_SetString(st->UnpicklingError, "unpickling stack underflow");
     return -1;
 }
 
@@ -165,7 +375,7 @@
     PyVarObject_HEAD_INIT(NULL, 0)
     "_pickle.Pdata",              /*tp_name*/
     sizeof(Pdata),                /*tp_basicsize*/
-    0,                            /*tp_itemsize*/
+    sizeof(PyObject *),           /*tp_itemsize*/
     (destructor)Pdata_dealloc,    /*tp_dealloc*/
 };
 
@@ -240,8 +450,9 @@
 static PyObject *
 Pdata_pop(Pdata *self)
 {
+    PickleState *st = _Pickle_GetGlobalState();
     if (Py_SIZE(self) == 0) {
-        PyErr_SetString(UnpicklingError, "bad pickle data");
+        PyErr_SetString(st->UnpicklingError, "bad pickle data");
         return NULL;
     }
     return self->data[--Py_SIZE(self)];
@@ -320,7 +531,6 @@
                                    pickling. */
     PyObject *pers_func;        /* persistent_id() method, can be NULL */
     PyObject *dispatch_table;   /* private dispatch_table, can be NULL */
-    PyObject *arg;
 
     PyObject *write;            /* write() method of the output stream. */
     PyObject *output_buffer;    /* Write into a local bytearray buffer before
@@ -329,7 +539,12 @@
     Py_ssize_t max_output_len;  /* Allocation size of output_buffer. */
     int proto;                  /* Pickle protocol number, >= 0 */
     int bin;                    /* Boolean, true if proto > 0 */
-    Py_ssize_t buf_size;               /* Size of the current buffered pickle data */
+    int framing;                /* True when framing is enabled, proto >= 4 */
+    Py_ssize_t frame_start;     /* Position in output_buffer where the
+                                   where the current frame begins. -1 if there
+                                   is no frame currently open. */
+
+    Py_ssize_t buf_size;        /* Size of the current buffered pickle data */
     int fast;                   /* Enable fast mode if set to a true value.
                                    The fast mode disable the usage of memo,
                                    therefore speeding the pickling process by
@@ -349,9 +564,9 @@
     /* The unpickler memo is just an array of PyObject *s. Using a dict
        is unnecessary, since the keys are contiguous ints. */
     PyObject **memo;
-    Py_ssize_t memo_size;
+    Py_ssize_t memo_size;       /* Capacity of the memo array */
+    Py_ssize_t memo_len;        /* Number of objects in the memo */
 
-    PyObject *arg;
     PyObject *pers_func;        /* persistent_load() method, can be NULL. */
 
     Py_buffer buffer;
@@ -360,6 +575,7 @@
     Py_ssize_t input_len;
     Py_ssize_t next_read_idx;
     Py_ssize_t prefetched_idx;  /* index of first prefetched byte */
+
     PyObject *read;             /* read() method of the input stream. */
     PyObject *readline;         /* readline() method of the input stream. */
     PyObject *peek;             /* peek() method of the input stream, or NULL */
@@ -379,12 +595,23 @@
                                    the name of globals pickled by Python 2.x. */
 } UnpicklerObject;
 
+typedef struct {
+    PyObject_HEAD
+    PicklerObject *pickler; /* Pickler whose memo table we're proxying. */
+}  PicklerMemoProxyObject;
+
+typedef struct {
+    PyObject_HEAD
+    UnpicklerObject *unpickler;
+} UnpicklerMemoProxyObject;
+
 /* Forward declarations */
 static int save(PicklerObject *, PyObject *, int);
 static int save_reduce(PicklerObject *, PyObject *, PyObject *);
 static PyTypeObject Pickler_Type;
 static PyTypeObject Unpickler_Type;
 
+#include "clinic/_pickle.c.h"
 
 /*************************************************************************
  A custom hashtable mapping void* to Python ints. This is used by the pickler
@@ -436,6 +663,7 @@
     new->mt_table = PyMem_MALLOC(self->mt_allocated * sizeof(PyMemoEntry));
     if (new->mt_table == NULL) {
         PyMem_FREE(new);
+        PyErr_NoMemory();
         return NULL;
     }
     for (i = 0; i < self->mt_allocated; i++) {
@@ -529,7 +757,7 @@
     oldtable = self->mt_table;
     self->mt_table = PyMem_MALLOC(new_size * sizeof(PyMemoEntry));
     if (self->mt_table == NULL) {
-        PyMem_FREE(oldtable);
+        self->mt_table = oldtable;
         PyErr_NoMemory();
         return -1;
     }
@@ -605,60 +833,6 @@
 
 /*************************************************************************/
 
-/* Helpers for creating the argument tuple passed to functions. This has the
-   performance advantage of calling PyTuple_New() only once.
-
-   XXX(avassalotti): Inline directly in _Pickler_FastCall() and
-   _Unpickler_FastCall(). */
-#define ARG_TUP(self, obj) do {                             \
-        if ((self)->arg || ((self)->arg=PyTuple_New(1))) {  \
-            Py_XDECREF(PyTuple_GET_ITEM((self)->arg, 0));   \
-            PyTuple_SET_ITEM((self)->arg, 0, (obj));        \
-        }                                                   \
-        else {                                              \
-            Py_DECREF((obj));                               \
-        }                                                   \
-    } while (0)
-
-#define FREE_ARG_TUP(self) do {                 \
-        if ((self)->arg->ob_refcnt > 1)         \
-            Py_CLEAR((self)->arg);              \
-    } while (0)
-
-/* A temporary cleaner API for fast single argument function call.
-
-   XXX: Does caching the argument tuple provides any real performance benefits?
-
-   A quick benchmark, on a 2.0GHz Athlon64 3200+ running Linux 2.6.24 with
-   glibc 2.7, tells me that it takes roughly 20,000,000 PyTuple_New(1) calls
-   when the tuple is retrieved from the freelist (i.e, call PyTuple_New() then
-   immediately DECREF it) and 1,200,000 calls when allocating brand new tuples
-   (i.e, call PyTuple_New() and store the returned value in an array), to save
-   one second (wall clock time). Either ways, the loading time a pickle stream
-   large enough to generate this number of calls would be massively
-   overwhelmed by other factors, like I/O throughput, the GC traversal and
-   object allocation overhead. So, I really doubt these functions provide any
-   real benefits.
-
-   On the other hand, oprofile reports that pickle spends a lot of time in
-   these functions. But, that is probably more related to the function call
-   overhead, than the argument tuple allocation.
-
-   XXX: And, what is the reference behavior of these? Steal, borrow? At first
-   glance, it seems to steal the reference of 'arg' and borrow the reference
-   of 'func'. */
-static PyObject *
-_Pickler_FastCall(PicklerObject *self, PyObject *func, PyObject *arg)
-{
-    PyObject *result = NULL;
-
-    ARG_TUP(self, arg);
-    if (self->arg) {
-        result = PyObject_Call(func, self->arg, NULL);
-        FREE_ARG_TUP(self);
-    }
-    return result;
-}
 
 static int
 _Pickler_ClearBuffer(PicklerObject *self)
@@ -669,15 +843,71 @@
     if (self->output_buffer == NULL)
         return -1;
     self->output_len = 0;
+    self->frame_start = -1;
     return 0;
 }
 
+static void
+_write_size64(char *out, size_t value)
+{
+    int i;
+
+    assert(sizeof(size_t) <= 8);
+
+    for (i = 0; i < sizeof(size_t); i++) {
+        out[i] = (unsigned char)((value >> (8 * i)) & 0xff);
+    }
+    for (i = sizeof(size_t); i < 8; i++) {
+        out[i] = 0;
+    }
+}
+
+static void
+_Pickler_WriteFrameHeader(PicklerObject *self, char *qdata, size_t frame_len)
+{
+    qdata[0] = FRAME;
+    _write_size64(qdata + 1, frame_len);
+}
+
+static int
+_Pickler_CommitFrame(PicklerObject *self)
+{
+    size_t frame_len;
+    char *qdata;
+
+    if (!self->framing || self->frame_start == -1)
+        return 0;
+    frame_len = self->output_len - self->frame_start - FRAME_HEADER_SIZE;
+    qdata = PyBytes_AS_STRING(self->output_buffer) + self->frame_start;
+    _Pickler_WriteFrameHeader(self, qdata, frame_len);
+    self->frame_start = -1;
+    return 0;
+}
+
+static int
+_Pickler_OpcodeBoundary(PicklerObject *self)
+{
+    Py_ssize_t frame_len;
+
+    if (!self->framing || self->frame_start == -1)
+        return 0;
+    frame_len = self->output_len - self->frame_start - FRAME_HEADER_SIZE;
+    if (frame_len >= FRAME_SIZE_TARGET)
+        return _Pickler_CommitFrame(self);
+    else
+        return 0;
+}
+
 static PyObject *
 _Pickler_GetString(PicklerObject *self)
 {
     PyObject *output_buffer = self->output_buffer;
 
     assert(self->output_buffer != NULL);
+
+    if (_Pickler_CommitFrame(self))
+        return NULL;
+
     self->output_buffer = NULL;
     /* Resize down to exact size */
     if (_PyBytes_Resize(&output_buffer, self->output_len) < 0)
@@ -692,67 +922,64 @@
 
     assert(self->write != NULL);
 
+    /* This will commit the frame first */
     output = _Pickler_GetString(self);
     if (output == NULL)
         return -1;
 
-    result = _Pickler_FastCall(self, self->write, output);
+    result = _Pickle_FastCall(self->write, output);
     Py_XDECREF(result);
     return (result == NULL) ? -1 : 0;
 }
 
 static Py_ssize_t
-_Pickler_Write(PicklerObject *self, const char *s, Py_ssize_t n)
+_Pickler_Write(PicklerObject *self, const char *s, Py_ssize_t data_len)
 {
-    Py_ssize_t i, required;
+    Py_ssize_t i, n, required;
     char *buffer;
+    int need_new_frame;
 
     assert(s != NULL);
+    need_new_frame = (self->framing && self->frame_start == -1);
+
+    if (need_new_frame)
+        n = data_len + FRAME_HEADER_SIZE;
+    else
+        n = data_len;
 
     required = self->output_len + n;
     if (required > self->max_output_len) {
-        if (self->write != NULL && required > MAX_WRITE_BUF_SIZE) {
-            /* XXX This reallocates a new buffer every time, which is a bit
-               wasteful. */
-            if (_Pickler_FlushToFile(self) < 0)
-                return -1;
-            if (_Pickler_ClearBuffer(self) < 0)
-                return -1;
+        /* Make place in buffer for the pickle chunk */
+        if (self->output_len >= PY_SSIZE_T_MAX / 2 - n) {
+            PyErr_NoMemory();
+            return -1;
         }
-        if (self->write != NULL && n > MAX_WRITE_BUF_SIZE) {
-            /* we already flushed above, so the buffer is empty */
-            PyObject *result;
-            /* XXX we could spare an intermediate copy and pass
-               a memoryview instead */
-            PyObject *output = PyBytes_FromStringAndSize(s, n);
-            if (s == NULL)
-                return -1;
-            result = _Pickler_FastCall(self, self->write, output);
-            Py_XDECREF(result);
-            return (result == NULL) ? -1 : 0;
-        }
-        else {
-            if (self->output_len >= PY_SSIZE_T_MAX / 2 - n) {
-                PyErr_NoMemory();
-                return -1;
-            }
-            self->max_output_len = (self->output_len + n) / 2 * 3;
-            if (_PyBytes_Resize(&self->output_buffer, self->max_output_len) < 0)
-                return -1;
-        }
+        self->max_output_len = (self->output_len + n) / 2 * 3;
+        if (_PyBytes_Resize(&self->output_buffer, self->max_output_len) < 0)
+            return -1;
     }
     buffer = PyBytes_AS_STRING(self->output_buffer);
-    if (n < 8) {
+    if (need_new_frame) {
+        /* Setup new frame */
+        Py_ssize_t frame_start = self->output_len;
+        self->frame_start = frame_start;
+        for (i = 0; i < FRAME_HEADER_SIZE; i++) {
+            /* Write an invalid value, for debugging */
+            buffer[frame_start + i] = 0xFE;
+        }
+        self->output_len += FRAME_HEADER_SIZE;
+    }
+    if (data_len < 8) {
         /* This is faster than memcpy when the string is short. */
-        for (i = 0; i < n; i++) {
+        for (i = 0; i < data_len; i++) {
             buffer[self->output_len + i] = s[i];
         }
     }
     else {
-        memcpy(buffer + self->output_len, s, n);
+        memcpy(buffer + self->output_len, s, data_len);
     }
-    self->output_len += n;
-    return n;
+    self->output_len += data_len;
+    return data_len;
 }
 
 static PicklerObject *
@@ -766,25 +993,23 @@
 
     self->pers_func = NULL;
     self->dispatch_table = NULL;
-    self->arg = NULL;
     self->write = NULL;
     self->proto = 0;
     self->bin = 0;
+    self->framing = 0;
+    self->frame_start = -1;
     self->fast = 0;
     self->fast_nesting = 0;
     self->fix_imports = 0;
     self->fast_memo = NULL;
-
-    self->memo = PyMemoTable_New();
-    if (self->memo == NULL) {
-        Py_DECREF(self);
-        return NULL;
-    }
     self->max_output_len = WRITE_BUF_SIZE;
     self->output_len = 0;
+
+    self->memo = PyMemoTable_New();
     self->output_buffer = PyBytes_FromStringAndSize(NULL,
                                                     self->max_output_len);
-    if (self->output_buffer == NULL) {
+
+    if (self->memo == NULL || self->output_buffer == NULL) {
         Py_DECREF(self);
         return NULL;
     }
@@ -792,34 +1017,29 @@
 }
 
 static int
-_Pickler_SetProtocol(PicklerObject *self, PyObject *proto_obj,
-                     PyObject *fix_imports_obj)
+_Pickler_SetProtocol(PicklerObject *self, PyObject *protocol, int fix_imports)
 {
-    long proto = 0;
-    int fix_imports;
+    long proto;
 
-    if (proto_obj == NULL || proto_obj == Py_None)
+    if (protocol == NULL || protocol == Py_None) {
         proto = DEFAULT_PROTOCOL;
+    }
     else {
-        proto = PyLong_AsLong(proto_obj);
-        if (proto == -1 && PyErr_Occurred())
+        proto = PyLong_AsLong(protocol);
+        if (proto < 0) {
+            if (proto == -1 && PyErr_Occurred())
+                return -1;
+            proto = HIGHEST_PROTOCOL;
+        }
+        else if (proto > HIGHEST_PROTOCOL) {
+            PyErr_Format(PyExc_ValueError, "pickle protocol must be <= %d",
+                         HIGHEST_PROTOCOL);
             return -1;
+        }
     }
-    if (proto < 0)
-        proto = HIGHEST_PROTOCOL;
-    if (proto > HIGHEST_PROTOCOL) {
-        PyErr_Format(PyExc_ValueError, "pickle protocol must be <= %d",
-                     HIGHEST_PROTOCOL);
-        return -1;
-    }
-    fix_imports = PyObject_IsTrue(fix_imports_obj);
-    if (fix_imports == -1)
-        return -1;
-
-    self->proto = proto;
+    self->proto = (int)proto;
     self->bin = proto > 0;
     self->fix_imports = fix_imports && proto < 3;
-
     return 0;
 }
 
@@ -841,20 +1061,6 @@
     return 0;
 }
 
-/* See documentation for _Pickler_FastCall(). */
-static PyObject *
-_Unpickler_FastCall(UnpicklerObject *self, PyObject *func, PyObject *arg)
-{
-    PyObject *result = NULL;
-
-    ARG_TUP(self, arg);
-    if (self->arg) {
-        result = PyObject_Call(func, self->arg, NULL);
-        FREE_ARG_TUP(self);
-    }
-    return result;
-}
-
 /* Returns the size of the input on success, -1 on failure. This takes its
    own reference to `input`. */
 static Py_ssize_t
@@ -874,18 +1080,21 @@
 static int
 _Unpickler_SkipConsumed(UnpicklerObject *self)
 {
-    Py_ssize_t consumed = self->next_read_idx - self->prefetched_idx;
+    Py_ssize_t consumed;
+    PyObject *r;
 
-    if (consumed > 0) {
-        PyObject *r;
-        assert(self->peek);  /* otherwise we did something wrong */
-        /* This makes an useless copy... */
-        r = PyObject_CallFunction(self->read, "n", consumed);
-        if (r == NULL)
-            return -1;
-        Py_DECREF(r);
-        self->prefetched_idx = self->next_read_idx;
-    }
+    consumed = self->next_read_idx - self->prefetched_idx;
+    if (consumed <= 0)
+        return 0;
+
+    assert(self->peek);  /* otherwise we did something wrong */
+    /* This makes an useless copy... */
+    r = PyObject_CallFunction(self->read, "n", consumed);
+    if (r == NULL)
+        return -1;
+    Py_DECREF(r);
+
+    self->prefetched_idx = self->next_read_idx;
     return 0;
 }
 
@@ -909,56 +1118,51 @@
 _Unpickler_ReadFromFile(UnpicklerObject *self, Py_ssize_t n)
 {
     PyObject *data;
-    Py_ssize_t read_size, prefetched_size = 0;
+    Py_ssize_t read_size;
 
     assert(self->read != NULL);
 
     if (_Unpickler_SkipConsumed(self) < 0)
         return -1;
 
-    if (n == READ_WHOLE_LINE)
+    if (n == READ_WHOLE_LINE) {
+        PyObject *empty_tuple = PyTuple_New(0);
         data = PyObject_Call(self->readline, empty_tuple, NULL);
-    else {
-        PyObject *len = PyLong_FromSsize_t(n);
-        if (len == NULL)
-            return -1;
-        data = _Unpickler_FastCall(self, self->read, len);
+        Py_DECREF(empty_tuple);
     }
-    if (data == NULL)
-        return -1;
-
-    /* Prefetch some data without advancing the file pointer, if possible */
-    if (self->peek) {
-        PyObject *len, *prefetched;
-        len = PyLong_FromSsize_t(PREFETCH);
-        if (len == NULL) {
-            Py_DECREF(data);
-            return -1;
-        }
-        prefetched = _Unpickler_FastCall(self, self->peek, len);
-        if (prefetched == NULL) {
-            if (PyErr_ExceptionMatches(PyExc_NotImplementedError)) {
+    else {
+        PyObject *len;
+        /* Prefetch some data without advancing the file pointer, if possible */
+        if (self->peek && n < PREFETCH) {
+            len = PyLong_FromSsize_t(PREFETCH);
+            if (len == NULL)
+                return -1;
+            data = _Pickle_FastCall(self->peek, len);
+            if (data == NULL) {
+                if (!PyErr_ExceptionMatches(PyExc_NotImplementedError))
+                    return -1;
                 /* peek() is probably not supported by the given file object */
                 PyErr_Clear();
                 Py_CLEAR(self->peek);
             }
             else {
+                read_size = _Unpickler_SetStringInput(self, data);
                 Py_DECREF(data);
-                return -1;
+                self->prefetched_idx = 0;
+                if (n <= read_size)
+                    return n;
             }
         }
-        else {
-            assert(PyBytes_Check(prefetched));
-            prefetched_size = PyBytes_GET_SIZE(prefetched);
-            PyBytes_ConcatAndDel(&data, prefetched);
-            if (data == NULL)
-                return -1;
-        }
+        len = PyLong_FromSsize_t(n);
+        if (len == NULL)
+            return -1;
+        data = _Pickle_FastCall(self->read, len);
     }
+    if (data == NULL)
+        return -1;
 
-    read_size = _Unpickler_SetStringInput(self, data) - prefetched_size;
+    read_size = _Unpickler_SetStringInput(self, data);
     Py_DECREF(data);
-    self->prefetched_idx = read_size;
     return read_size;
 }
 
@@ -1006,8 +1210,10 @@
                     char **result)
 {
     char *input_line = PyMem_Realloc(self->input_line, len + 1);
-    if (input_line == NULL)
+    if (input_line == NULL) {
+        PyErr_NoMemory();
         return -1;
+    }
 
     memcpy(input_line, line, len);
     input_line[len] = '\0';
@@ -1096,7 +1302,12 @@
     Py_INCREF(value);
     old_item = self->memo[idx];
     self->memo[idx] = value;
-    Py_XDECREF(old_item);
+    if (old_item != NULL) {
+        Py_DECREF(old_item);
+    }
+    else {
+        self->memo_len++;
+    }
     return 0;
 }
 
@@ -1104,8 +1315,10 @@
 _Unpickler_NewMemo(Py_ssize_t new_size)
 {
     PyObject **memo = PyMem_MALLOC(new_size * sizeof(PyObject *));
-    if (memo == NULL)
+    if (memo == NULL) {
+        PyErr_NoMemory();
         return NULL;
+    }
     memset(memo, 0, new_size * sizeof(PyObject *));
     return memo;
 }
@@ -1136,21 +1349,6 @@
     if (self == NULL)
         return NULL;
 
-    self->stack = (Pdata *)Pdata_New();
-    if (self->stack == NULL) {
-        Py_DECREF(self);
-        return NULL;
-    }
-    memset(&self->buffer, 0, sizeof(Py_buffer));
-
-    self->memo_size = 32;
-    self->memo = _Unpickler_NewMemo(self->memo_size);
-    if (self->memo == NULL) {
-        Py_DECREF(self);
-        return NULL;
-    }
-
-    self->arg = NULL;
     self->pers_func = NULL;
     self->input_buffer = NULL;
     self->input_line = NULL;
@@ -1167,6 +1365,16 @@
     self->marks_size = 0;
     self->proto = 0;
     self->fix_imports = 0;
+    memset(&self->buffer, 0, sizeof(Py_buffer));
+    self->memo_size = 32;
+    self->memo_len = 0;
+    self->memo = _Unpickler_NewMemo(self->memo_size);
+    self->stack = (Pdata *)Pdata_New();
+
+    if (self->memo == NULL || self->stack == NULL) {
+        Py_DECREF(self);
+        return NULL;
+    }
 
     return self;
 }
@@ -1213,8 +1421,8 @@
     if (errors == NULL)
         errors = "strict";
 
-    self->encoding = strdup(encoding);
-    self->errors = strdup(errors);
+    self->encoding = _PyMem_Strdup(encoding);
+    self->errors = _PyMem_Strdup(errors);
     if (self->encoding == NULL || self->errors == NULL) {
         PyErr_NoMemory();
         return -1;
@@ -1257,7 +1465,8 @@
             len = 5;
         }
         else { /* unlikely */
-            PyErr_SetString(PicklingError,
+            PickleState *st = _Pickle_GetGlobalState();
+            PyErr_SetString(st->PicklingError,
                             "memo id too large for LONG_BINGET");
             return -1;
         }
@@ -1274,128 +1483,175 @@
 static int
 memo_put(PicklerObject *self, PyObject *obj)
 {
-    Py_ssize_t x;
     char pdata[30];
     Py_ssize_t len;
-    int status = 0;
+    Py_ssize_t idx;
+
+    const char memoize_op = MEMOIZE;
 
     if (self->fast)
         return 0;
 
-    x = PyMemoTable_Size(self->memo);
-    if (PyMemoTable_Set(self->memo, obj, x) < 0)
-        goto error;
+    idx = PyMemoTable_Size(self->memo);
+    if (PyMemoTable_Set(self->memo, obj, idx) < 0)
+        return -1;
 
-    if (!self->bin) {
+    if (self->proto >= 4) {
+        if (_Pickler_Write(self, &memoize_op, 1) < 0)
+            return -1;
+        return 0;
+    }
+    else if (!self->bin) {
         pdata[0] = PUT;
         PyOS_snprintf(pdata + 1, sizeof(pdata) - 1,
-                      "%" PY_FORMAT_SIZE_T "d\n", x);
+                      "%" PY_FORMAT_SIZE_T "d\n", idx);
         len = strlen(pdata);
     }
     else {
-        if (x < 256) {
+        if (idx < 256) {
             pdata[0] = BINPUT;
-            pdata[1] = (unsigned char)x;
+            pdata[1] = (unsigned char)idx;
             len = 2;
         }
-        else if (x <= 0xffffffffL) {
+        else if (idx <= 0xffffffffL) {
             pdata[0] = LONG_BINPUT;
-            pdata[1] = (unsigned char)(x & 0xff);
-            pdata[2] = (unsigned char)((x >> 8) & 0xff);
-            pdata[3] = (unsigned char)((x >> 16) & 0xff);
-            pdata[4] = (unsigned char)((x >> 24) & 0xff);
+            pdata[1] = (unsigned char)(idx & 0xff);
+            pdata[2] = (unsigned char)((idx >> 8) & 0xff);
+            pdata[3] = (unsigned char)((idx >> 16) & 0xff);
+            pdata[4] = (unsigned char)((idx >> 24) & 0xff);
             len = 5;
         }
         else { /* unlikely */
-            PyErr_SetString(PicklingError,
+            PickleState *st = _Pickle_GetGlobalState();
+            PyErr_SetString(st->PicklingError,
                             "memo id too large for LONG_BINPUT");
             return -1;
         }
     }
-
     if (_Pickler_Write(self, pdata, len) < 0)
-        goto error;
+        return -1;
 
-    if (0) {
-  error:
-        status = -1;
-    }
-
-    return status;
+    return 0;
 }
 
 static PyObject *
-whichmodule(PyObject *global, PyObject *global_name)
+getattribute(PyObject *obj, PyObject *name, int allow_qualname) {
+    PyObject *dotted_path;
+    Py_ssize_t i;
+    _Py_static_string(PyId_dot, ".");
+    _Py_static_string(PyId_locals, "<locals>");
+
+    dotted_path = PyUnicode_Split(name, _PyUnicode_FromId(&PyId_dot), -1);
+    if (dotted_path == NULL) {
+        return NULL;
+    }
+    assert(Py_SIZE(dotted_path) >= 1);
+    if (!allow_qualname && Py_SIZE(dotted_path) > 1) {
+        PyErr_Format(PyExc_AttributeError,
+                     "Can't get qualified attribute %R on %R;"
+                     "use protocols >= 4 to enable support",
+                     name, obj);
+        Py_DECREF(dotted_path);
+        return NULL;
+    }
+    Py_INCREF(obj);
+    for (i = 0; i < Py_SIZE(dotted_path); i++) {
+        PyObject *subpath = PyList_GET_ITEM(dotted_path, i);
+        PyObject *tmp;
+        PyObject *result = PyUnicode_RichCompare(
+            subpath, _PyUnicode_FromId(&PyId_locals), Py_EQ);
+        int is_equal = (result == Py_True);
+        assert(PyBool_Check(result));
+        Py_DECREF(result);
+        if (is_equal) {
+            PyErr_Format(PyExc_AttributeError,
+                         "Can't get local attribute %R on %R", name, obj);
+            Py_DECREF(dotted_path);
+            Py_DECREF(obj);
+            return NULL;
+        }
+        tmp = PyObject_GetAttr(obj, subpath);
+        Py_DECREF(obj);
+        if (tmp == NULL) {
+            if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
+                PyErr_Clear();
+                PyErr_Format(PyExc_AttributeError,
+                             "Can't get attribute %R on %R", name, obj);
+            }
+            Py_DECREF(dotted_path);
+            return NULL;
+        }
+        obj = tmp;
+    }
+    Py_DECREF(dotted_path);
+    return obj;
+}
+
+static PyObject *
+whichmodule(PyObject *global, PyObject *global_name, int allow_qualname)
 {
-    Py_ssize_t i, j;
-    static PyObject *module_str = NULL;
-    static PyObject *main_str = NULL;
     PyObject *module_name;
     PyObject *modules_dict;
     PyObject *module;
     PyObject *obj;
+    Py_ssize_t i, j;
+    _Py_IDENTIFIER(__module__);
+    _Py_IDENTIFIER(modules);
+    _Py_IDENTIFIER(__main__);
 
-    if (module_str == NULL) {
-        module_str = PyUnicode_InternFromString("__module__");
-        if (module_str == NULL)
+    module_name = _PyObject_GetAttrId(global, &PyId___module__);
+
+    if (module_name == NULL) {
+        if (!PyErr_ExceptionMatches(PyExc_AttributeError))
             return NULL;
-        main_str = PyUnicode_InternFromString("__main__");
-        if (main_str == NULL)
-            return NULL;
-    }
-
-    module_name = PyObject_GetAttr(global, module_str);
-
-    /* In some rare cases (e.g., bound methods of extension types),
-       __module__ can be None. If it is so, then search sys.modules
-       for the module of global.  */
-    if (module_name == Py_None) {
-        Py_DECREF(module_name);
-        goto search;
-    }
-
-    if (module_name) {
-        return module_name;
-    }
-    if (PyErr_ExceptionMatches(PyExc_AttributeError))
         PyErr_Clear();
-    else
-        return NULL;
+    }
+    else {
+        /* In some rare cases (e.g., bound methods of extension types),
+           __module__ can be None. If it is so, then search sys.modules for
+           the module of global. */
+        if (module_name != Py_None)
+            return module_name;
+        Py_CLEAR(module_name);
+    }
+    assert(module_name == NULL);
 
-  search:
-    modules_dict = PySys_GetObject("modules");
-    if (modules_dict == NULL)
+    modules_dict = _PySys_GetObjectId(&PyId_modules);
+    if (modules_dict == NULL) {
+        PyErr_SetString(PyExc_RuntimeError, "unable to get sys.modules");
         return NULL;
+    }
 
     i = 0;
-    module_name = NULL;
     while ((j = PyDict_Next(modules_dict, &i, &module_name, &module))) {
-        if (PyObject_RichCompareBool(module_name, main_str, Py_EQ) == 1)
+        PyObject *result = PyUnicode_RichCompare(
+            module_name, _PyUnicode_FromId(&PyId___main__), Py_EQ);
+        int is_equal = (result == Py_True);
+        assert(PyBool_Check(result));
+        Py_DECREF(result);
+        if (is_equal)
+            continue;
+        if (module == Py_None)
             continue;
 
-        obj = PyObject_GetAttr(module, global_name);
+        obj = getattribute(module, global_name, allow_qualname);
         if (obj == NULL) {
-            if (PyErr_ExceptionMatches(PyExc_AttributeError))
-                PyErr_Clear();
-            else
+            if (!PyErr_ExceptionMatches(PyExc_AttributeError))
                 return NULL;
+            PyErr_Clear();
             continue;
         }
 
-        if (obj != global) {
+        if (obj == global) {
             Py_DECREF(obj);
-            continue;
+            Py_INCREF(module_name);
+            return module_name;
         }
-
         Py_DECREF(obj);
-        break;
     }
 
     /* If no module is found, use __main__. */
-    if (!j) {
-        module_name = main_str;
-    }
-
+    module_name = _PyUnicode_FromId(&PyId___main__);
     Py_INCREF(module_name);
     return module_name;
 }
@@ -1424,7 +1680,7 @@
         key = PyLong_FromVoidPtr(obj);
         if (key == NULL)
             return 0;
-        if (PyDict_GetItem(self->fast_memo, key)) {
+        if (PyDict_GetItemWithError(self->fast_memo, key)) {
             Py_DECREF(key);
             PyErr_Format(PyExc_ValueError,
                          "fast mode: can't pickle cyclic objects "
@@ -1433,6 +1689,9 @@
             self->fast_nesting = -1;
             return 0;
         }
+        if (PyErr_Occurred()) {
+            return 0;
+        }
         if (PyDict_SetItem(self->fast_memo, key, Py_None) < 0) {
             Py_DECREF(key);
             self->fast_nesting = -1;
@@ -1472,46 +1731,58 @@
 static int
 save_bool(PicklerObject *self, PyObject *obj)
 {
-    static const char *buf[2] = { FALSE, TRUE };
-    const char len[2] = {sizeof(FALSE) - 1, sizeof(TRUE) - 1};
-    int p = (obj == Py_True);
-
     if (self->proto >= 2) {
-        const char bool_op = p ? NEWTRUE : NEWFALSE;
+        const char bool_op = (obj == Py_True) ? NEWTRUE : NEWFALSE;
         if (_Pickler_Write(self, &bool_op, 1) < 0)
             return -1;
     }
-    else if (_Pickler_Write(self, buf[p], len[p]) < 0)
-        return -1;
-
+    else {
+        /* These aren't opcodes -- they're ways to pickle bools before protocol 2
+         * so that unpicklers written before bools were introduced unpickle them
+         * as ints, but unpicklers after can recognize that bools were intended.
+         * Note that protocol 2 added direct ways to pickle bools.
+         */
+        const char *bool_str = (obj == Py_True) ? "I01\n" : "I00\n";
+        if (_Pickler_Write(self, bool_str, strlen(bool_str)) < 0)
+            return -1;
+    }
     return 0;
 }
 
 static int
-save_int(PicklerObject *self, long x)
+save_long(PicklerObject *self, PyObject *obj)
 {
-    char pdata[32];
-    Py_ssize_t len = 0;
+    PyObject *repr = NULL;
+    Py_ssize_t size;
+    long val;
+    int status = 0;
 
-    if (!self->bin
-#if SIZEOF_LONG > 4
-        || x > 0x7fffffffL || x < -0x80000000L
-#endif
-        ) {
-        /* Text-mode pickle, or long too big to fit in the 4-byte
-         * signed BININT format:  store as a string.
-         */
-        pdata[0] = LONG;        /* use LONG for consistency with pickle.py */
-        PyOS_snprintf(pdata + 1, sizeof(pdata) - 1, "%ldL\n", x);
-        if (_Pickler_Write(self, pdata, strlen(pdata)) < 0)
-            return -1;
+    const char long_op = LONG;
+
+    val= PyLong_AsLong(obj);
+    if (val == -1 && PyErr_Occurred()) {
+        /* out of range for int pickling */
+        PyErr_Clear();
     }
-    else {
-        /* Binary pickle and x fits in a signed 4-byte int. */
-        pdata[1] = (unsigned char)(x & 0xff);
-        pdata[2] = (unsigned char)((x >> 8) & 0xff);
-        pdata[3] = (unsigned char)((x >> 16) & 0xff);
-        pdata[4] = (unsigned char)((x >> 24) & 0xff);
+    else if (self->bin &&
+             (sizeof(long) <= 4 ||
+              (val <= 0x7fffffffL && val >= (-0x7fffffffL - 1)))) {
+        /* result fits in a signed 4-byte integer.
+
+           Note: we can't use -0x80000000L in the above condition because some
+           compilers (e.g., MSVC) will promote 0x80000000L to an unsigned type
+           before applying the unary minus when sizeof(long) <= 4. The
+           resulting value stays unsigned which is commonly not what we want,
+           so MSVC happily warns us about it.  However, that result would have
+           been fine because we guard for sizeof(long) <= 4 which turns the
+           condition true in that particular case. */
+        char pdata[32];
+        Py_ssize_t len = 0;
+
+        pdata[1] = (unsigned char)(val & 0xff);
+        pdata[2] = (unsigned char)((val >> 8) & 0xff);
+        pdata[3] = (unsigned char)((val >> 16) & 0xff);
+        pdata[4] = (unsigned char)((val >> 24) & 0xff);
 
         if ((pdata[4] == 0) && (pdata[3] == 0)) {
             if (pdata[2] == 0) {
@@ -1530,31 +1801,10 @@
 
         if (_Pickler_Write(self, pdata, len) < 0)
             return -1;
+
+        return 0;
     }
 
-    return 0;
-}
-
-static int
-save_long(PicklerObject *self, PyObject *obj)
-{
-    PyObject *repr = NULL;
-    Py_ssize_t size;
-    long val = PyLong_AsLong(obj);
-    int status = 0;
-
-    const char long_op = LONG;
-
-    if (val == -1 && PyErr_Occurred()) {
-        /* out of range for int pickling */
-        PyErr_Clear();
-    }
-    else
-#if SIZEOF_LONG > 4
-        if (val <= 0x7fffffffL && val >= -0x80000000L)
-#endif
-            return save_int(self, val);
-
     if (self->proto >= 2) {
         /* Linear-time pickling. */
         size_t nbits;
@@ -1719,40 +1969,25 @@
            Python 2 *and* the appropriate 'bytes' object when unpickled
            using Python 3. Again this is a hack and we don't need to do this
            with newer protocols. */
-        static PyObject *codecs_encode = NULL;
         PyObject *reduce_value = NULL;
         int status;
 
-        if (codecs_encode == NULL) {
-            PyObject *codecs_module = PyImport_ImportModule("codecs");
-            if (codecs_module == NULL) {
-                return -1;
-            }
-            codecs_encode = PyObject_GetAttrString(codecs_module, "encode");
-            Py_DECREF(codecs_module);
-            if (codecs_encode == NULL) {
-                return -1;
-            }
-        }
-
         if (PyBytes_GET_SIZE(obj) == 0) {
             reduce_value = Py_BuildValue("(O())", (PyObject*)&PyBytes_Type);
         }
         else {
-            static PyObject *latin1 = NULL;
+            PickleState *st = _Pickle_GetGlobalState();
             PyObject *unicode_str =
                 PyUnicode_DecodeLatin1(PyBytes_AS_STRING(obj),
                                        PyBytes_GET_SIZE(obj),
                                        "strict");
+            _Py_IDENTIFIER(latin1);
+
             if (unicode_str == NULL)
                 return -1;
-            if (latin1 == NULL) {
-                latin1 = PyUnicode_InternFromString("latin1");
-                if (latin1 == NULL)
-                    return -1;
-            }
             reduce_value = Py_BuildValue("(O(OO))",
-                                         codecs_encode, unicode_str, latin1);
+                                         st->codecs_encode, unicode_str,
+                                         _PyUnicode_FromId(&PyId_latin1));
             Py_DECREF(unicode_str);
         }
 
@@ -1766,14 +2001,14 @@
     }
     else {
         Py_ssize_t size;
-        char header[5];
+        char header[9];
         Py_ssize_t len;
 
         size = PyBytes_GET_SIZE(obj);
         if (size < 0)
             return -1;
 
-        if (size < 256) {
+        if (size <= 0xff) {
             header[0] = SHORT_BINBYTES;
             header[1] = (unsigned char)size;
             len = 2;
@@ -1786,6 +2021,11 @@
             header[4] = (unsigned char)((size >> 24) & 0xff);
             len = 5;
         }
+        else if (self->proto >= 4) {
+            header[0] = BINBYTES8;
+            _write_size64(header + 1, size);
+            len = 9;
+        }
         else {
             PyErr_SetString(PyExc_OverflowError,
                             "cannot serialize a bytes object larger than 4 GiB");
@@ -1873,63 +2113,106 @@
 }
 
 static int
-save_unicode(PicklerObject *self, PyObject *obj)
+write_utf8(PicklerObject *self, char *data, Py_ssize_t size)
 {
-    Py_ssize_t size;
-    PyObject *encoded = NULL;
+    char header[9];
+    Py_ssize_t len;
 
-    if (self->bin) {
-        char pdata[5];
-
-        encoded = PyUnicode_AsEncodedString(obj, "utf-8", "surrogatepass");
-        if (encoded == NULL)
-            goto error;
-
-        size = PyBytes_GET_SIZE(encoded);
-        if (size > 0xffffffffL) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "cannot serialize a string larger than 4 GiB");
-            goto error;          /* string too large */
-        }
-
-        pdata[0] = BINUNICODE;
-        pdata[1] = (unsigned char)(size & 0xff);
-        pdata[2] = (unsigned char)((size >> 8) & 0xff);
-        pdata[3] = (unsigned char)((size >> 16) & 0xff);
-        pdata[4] = (unsigned char)((size >> 24) & 0xff);
-
-        if (_Pickler_Write(self, pdata, 5) < 0)
-            goto error;
-
-        if (_Pickler_Write(self, PyBytes_AS_STRING(encoded), size) < 0)
-            goto error;
+    if (size <= 0xff && self->proto >= 4) {
+        header[0] = SHORT_BINUNICODE;
+        header[1] = (unsigned char)(size & 0xff);
+        len = 2;
+    }
+    else if (size <= 0xffffffffUL) {
+        header[0] = BINUNICODE;
+        header[1] = (unsigned char)(size & 0xff);
+        header[2] = (unsigned char)((size >> 8) & 0xff);
+        header[3] = (unsigned char)((size >> 16) & 0xff);
+        header[4] = (unsigned char)((size >> 24) & 0xff);
+        len = 5;
+    }
+    else if (self->proto >= 4) {
+        header[0] = BINUNICODE8;
+        _write_size64(header + 1, size);
+        len = 9;
     }
     else {
+        PyErr_SetString(PyExc_OverflowError,
+                        "cannot serialize a string larger than 4GiB");
+        return -1;
+    }
+
+    if (_Pickler_Write(self, header, len) < 0)
+        return -1;
+    if (_Pickler_Write(self, data, size) < 0)
+        return -1;
+
+    return 0;
+}
+
+static int
+write_unicode_binary(PicklerObject *self, PyObject *obj)
+{
+    PyObject *encoded = NULL;
+    Py_ssize_t size;
+    char *data;
+    int r;
+
+    if (PyUnicode_READY(obj))
+        return -1;
+
+    data = PyUnicode_AsUTF8AndSize(obj, &size);
+    if (data != NULL)
+        return write_utf8(self, data, size);
+
+    /* Issue #8383: for strings with lone surrogates, fallback on the
+       "surrogatepass" error handler. */
+    PyErr_Clear();
+    encoded = PyUnicode_AsEncodedString(obj, "utf-8", "surrogatepass");
+    if (encoded == NULL)
+        return -1;
+
+    r = write_utf8(self, PyBytes_AS_STRING(encoded),
+                   PyBytes_GET_SIZE(encoded));
+    Py_DECREF(encoded);
+    return r;
+}
+
+static int
+save_unicode(PicklerObject *self, PyObject *obj)
+{
+    if (self->bin) {
+        if (write_unicode_binary(self, obj) < 0)
+            return -1;
+    }
+    else {
+        PyObject *encoded;
+        Py_ssize_t size;
         const char unicode_op = UNICODE;
 
         encoded = raw_unicode_escape(obj);
         if (encoded == NULL)
-            goto error;
+            return -1;
 
-        if (_Pickler_Write(self, &unicode_op, 1) < 0)
-            goto error;
+        if (_Pickler_Write(self, &unicode_op, 1) < 0) {
+            Py_DECREF(encoded);
+            return -1;
+        }
 
         size = PyBytes_GET_SIZE(encoded);
-        if (_Pickler_Write(self, PyBytes_AS_STRING(encoded), size) < 0)
-            goto error;
+        if (_Pickler_Write(self, PyBytes_AS_STRING(encoded), size) < 0) {
+            Py_DECREF(encoded);
+            return -1;
+        }
+        Py_DECREF(encoded);
 
         if (_Pickler_Write(self, "\n", 1) < 0)
-            goto error;
+            return -1;
     }
     if (memo_put(self, obj) < 0)
-        goto error;
+        return -1;
 
-    Py_DECREF(encoded);
     return 0;
-
-  error:
-    Py_XDECREF(encoded);
-    return -1;
 }
 
 /* A helper for save_tuple.  Push the len elements in tuple t on the stack. */
@@ -2557,34 +2840,252 @@
 }
 
 static int
+save_set(PicklerObject *self, PyObject *obj)
+{
+    PyObject *item;
+    int i;
+    Py_ssize_t set_size, ppos = 0;
+    Py_hash_t hash;
+
+    const char empty_set_op = EMPTY_SET;
+    const char mark_op = MARK;
+    const char additems_op = ADDITEMS;
+
+    if (self->proto < 4) {
+        PyObject *items;
+        PyObject *reduce_value;
+        int status;
+
+        items = PySequence_List(obj);
+        if (items == NULL) {
+            return -1;
+        }
+        reduce_value = Py_BuildValue("(O(O))", (PyObject*)&PySet_Type, items);
+        Py_DECREF(items);
+        if (reduce_value == NULL) {
+            return -1;
+        }
+        /* save_reduce() will memoize the object automatically. */
+        status = save_reduce(self, reduce_value, obj);
+        Py_DECREF(reduce_value);
+        return status;
+    }
+
+    if (_Pickler_Write(self, &empty_set_op, 1) < 0)
+        return -1;
+
+    if (memo_put(self, obj) < 0)
+        return -1;
+
+    set_size = PySet_GET_SIZE(obj);
+    if (set_size == 0)
+        return 0;  /* nothing to do */
+
+    /* Write in batches of BATCHSIZE. */
+    do {
+        i = 0;
+        if (_Pickler_Write(self, &mark_op, 1) < 0)
+            return -1;
+        while (_PySet_NextEntry(obj, &ppos, &item, &hash)) {
+            if (save(self, item, 0) < 0)
+                return -1;
+            if (++i == BATCHSIZE)
+                break;
+        }
+        if (_Pickler_Write(self, &additems_op, 1) < 0)
+            return -1;
+        if (PySet_GET_SIZE(obj) != set_size) {
+            PyErr_Format(
+                PyExc_RuntimeError,
+                "set changed size during iteration");
+            return -1;
+        }
+    } while (i == BATCHSIZE);
+
+    return 0;
+}
+
+static int
+save_frozenset(PicklerObject *self, PyObject *obj)
+{
+    PyObject *iter;
+
+    const char mark_op = MARK;
+    const char frozenset_op = FROZENSET;
+
+    if (self->fast && !fast_save_enter(self, obj))
+        return -1;
+
+    if (self->proto < 4) {
+        PyObject *items;
+        PyObject *reduce_value;
+        int status;
+
+        items = PySequence_List(obj);
+        if (items == NULL) {
+            return -1;
+        }
+        reduce_value = Py_BuildValue("(O(O))", (PyObject*)&PyFrozenSet_Type,
+                                     items);
+        Py_DECREF(items);
+        if (reduce_value == NULL) {
+            return -1;
+        }
+        /* save_reduce() will memoize the object automatically. */
+        status = save_reduce(self, reduce_value, obj);
+        Py_DECREF(reduce_value);
+        return status;
+    }
+
+    if (_Pickler_Write(self, &mark_op, 1) < 0)
+        return -1;
+
+    iter = PyObject_GetIter(obj);
+    if (iter == NULL) {
+        return -1;
+    }
+    for (;;) {
+        PyObject *item;
+
+        item = PyIter_Next(iter);
+        if (item == NULL) {
+            if (PyErr_Occurred()) {
+                Py_DECREF(iter);
+                return -1;
+            }
+            break;
+        }
+        if (save(self, item, 0) < 0) {
+            Py_DECREF(item);
+            Py_DECREF(iter);
+            return -1;
+        }
+        Py_DECREF(item);
+    }
+    Py_DECREF(iter);
+
+    /* If the object is already in the memo, this means it is
+       recursive. In this case, throw away everything we put on the
+       stack, and fetch the object back from the memo. */
+    if (PyMemoTable_Get(self->memo, obj)) {
+        const char pop_mark_op = POP_MARK;
+
+        if (_Pickler_Write(self, &pop_mark_op, 1) < 0)
+            return -1;
+        if (memo_get(self, obj) < 0)
+            return -1;
+        return 0;
+    }
+
+    if (_Pickler_Write(self, &frozenset_op, 1) < 0)
+        return -1;
+    if (memo_put(self, obj) < 0)
+        return -1;
+
+    return 0;
+}
+
+static int
+fix_imports(PyObject **module_name, PyObject **global_name)
+{
+    PyObject *key;
+    PyObject *item;
+    PickleState *st = _Pickle_GetGlobalState();
+
+    key = PyTuple_Pack(2, *module_name, *global_name);
+    if (key == NULL)
+        return -1;
+    item = PyDict_GetItemWithError(st->name_mapping_3to2, key);
+    Py_DECREF(key);
+    if (item) {
+        PyObject *fixed_module_name;
+        PyObject *fixed_global_name;
+
+        if (!PyTuple_Check(item) || PyTuple_GET_SIZE(item) != 2) {
+            PyErr_Format(PyExc_RuntimeError,
+                         "_compat_pickle.REVERSE_NAME_MAPPING values "
+                         "should be 2-tuples, not %.200s",
+                         Py_TYPE(item)->tp_name);
+            return -1;
+        }
+        fixed_module_name = PyTuple_GET_ITEM(item, 0);
+        fixed_global_name = PyTuple_GET_ITEM(item, 1);
+        if (!PyUnicode_Check(fixed_module_name) ||
+            !PyUnicode_Check(fixed_global_name)) {
+            PyErr_Format(PyExc_RuntimeError,
+                         "_compat_pickle.REVERSE_NAME_MAPPING values "
+                         "should be pairs of str, not (%.200s, %.200s)",
+                         Py_TYPE(fixed_module_name)->tp_name,
+                         Py_TYPE(fixed_global_name)->tp_name);
+            return -1;
+        }
+
+        Py_CLEAR(*module_name);
+        Py_CLEAR(*global_name);
+        Py_INCREF(fixed_module_name);
+        Py_INCREF(fixed_global_name);
+        *module_name = fixed_module_name;
+        *global_name = fixed_global_name;
+    }
+    else if (PyErr_Occurred()) {
+        return -1;
+    }
+
+    item = PyDict_GetItemWithError(st->import_mapping_3to2, *module_name);
+    if (item) {
+        if (!PyUnicode_Check(item)) {
+            PyErr_Format(PyExc_RuntimeError,
+                         "_compat_pickle.REVERSE_IMPORT_MAPPING values "
+                         "should be strings, not %.200s",
+                         Py_TYPE(item)->tp_name);
+            return -1;
+        }
+        Py_CLEAR(*module_name);
+        Py_INCREF(item);
+        *module_name = item;
+    }
+    else if (PyErr_Occurred()) {
+        return -1;
+    }
+
+    return 0;
+}
+
+static int
 save_global(PicklerObject *self, PyObject *obj, PyObject *name)
 {
-    static PyObject *name_str = NULL;
     PyObject *global_name = NULL;
     PyObject *module_name = NULL;
     PyObject *module = NULL;
     PyObject *cls;
+    PickleState *st = _Pickle_GetGlobalState();
     int status = 0;
+    _Py_IDENTIFIER(__name__);
+    _Py_IDENTIFIER(__qualname__);
 
     const char global_op = GLOBAL;
 
-    if (name_str == NULL) {
-        name_str = PyUnicode_InternFromString("__name__");
-        if (name_str == NULL)
-            goto error;
-    }
-
     if (name) {
+        Py_INCREF(name);
         global_name = name;
-        Py_INCREF(global_name);
     }
     else {
-        global_name = PyObject_GetAttr(obj, name_str);
-        if (global_name == NULL)
-            goto error;
+        if (self->proto >= 4) {
+            global_name = _PyObject_GetAttrId(obj, &PyId___qualname__);
+            if (global_name == NULL) {
+                if (!PyErr_ExceptionMatches(PyExc_AttributeError))
+                    goto error;
+                PyErr_Clear();
+            }
+        }
+        if (global_name == NULL) {
+            global_name = _PyObject_GetAttrId(obj, &PyId___name__);
+            if (global_name == NULL)
+                goto error;
+        }
     }
 
-    module_name = whichmodule(obj, global_name);
+    module_name = whichmodule(obj, global_name, self->proto >= 4);
     if (module_name == NULL)
         goto error;
 
@@ -2598,21 +3099,21 @@
        extra parameters of __import__ to fix that. */
     module = PyImport_Import(module_name);
     if (module == NULL) {
-        PyErr_Format(PicklingError,
+        PyErr_Format(st->PicklingError,
                      "Can't pickle %R: import of module %R failed",
                      obj, module_name);
         goto error;
     }
-    cls = PyObject_GetAttr(module, global_name);
+    cls = getattribute(module, global_name, self->proto >= 4);
     if (cls == NULL) {
-        PyErr_Format(PicklingError,
-                     "Can't pickle %R: attribute lookup %S.%S failed",
-                     obj, module_name, global_name);
+        PyErr_Format(st->PicklingError,
+                     "Can't pickle %R: attribute lookup %S on %S failed",
+                     obj, global_name, module_name);
         goto error;
     }
     if (cls != obj) {
         Py_DECREF(cls);
-        PyErr_Format(PicklingError,
+        PyErr_Format(st->PicklingError,
                      "Can't pickle %R: it's not the same object as %S.%S",
                      obj, module_name, global_name);
         goto error;
@@ -2623,18 +3124,27 @@
         /* See whether this is in the extension registry, and if
          * so generate an EXT opcode.
          */
+        PyObject *extension_key;
         PyObject *code_obj;      /* extension code as Python object */
         long code;               /* extension code as C value */
         char pdata[5];
         Py_ssize_t n;
 
-        PyTuple_SET_ITEM(two_tuple, 0, module_name);
-        PyTuple_SET_ITEM(two_tuple, 1, global_name);
-        code_obj = PyDict_GetItem(extension_registry, two_tuple);
+        extension_key = PyTuple_Pack(2, module_name, global_name);
+        if (extension_key == NULL) {
+            goto error;
+        }
+        code_obj = PyDict_GetItemWithError(st->extension_registry,
+                                           extension_key);
+        Py_DECREF(extension_key);
         /* The object is not registered in the extension registry.
            This is the most likely code path. */
-        if (code_obj == NULL)
+        if (code_obj == NULL) {
+            if (PyErr_Occurred()) {
+                goto error;
+            }
             goto gen_global;
+        }
 
         /* XXX: pickle.py doesn't check neither the type, nor the range
            of the value returned by the extension_registry. It should for
@@ -2642,7 +3152,7 @@
 
         /* Verify code_obj has the right type and value. */
         if (!PyLong_Check(code_obj)) {
-            PyErr_Format(PicklingError,
+            PyErr_Format(st->PicklingError,
                          "Can't pickle %R: extension code %R isn't an integer",
                          obj, code_obj);
             goto error;
@@ -2650,9 +3160,8 @@
         code = PyLong_AS_LONG(code_obj);
         if (code <= 0 || code > 0x7fffffffL) {
             if (!PyErr_Occurred())
-                PyErr_Format(PicklingError,
-                             "Can't pickle %R: extension code %ld is out of range",
-                             obj, code);
+                PyErr_Format(st->PicklingError, "Can't pickle %R: extension "
+                             "code %ld is out of range", obj, code);
             goto error;
         }
 
@@ -2681,120 +3190,84 @@
             goto error;
     }
     else {
-        /* Generate a normal global opcode if we are using a pickle
-           protocol <= 2, or if the object is not registered in the
-           extension registry. */
-        PyObject *encoded;
-        PyObject *(*unicode_encoder)(PyObject *);
-
   gen_global:
-        if (_Pickler_Write(self, &global_op, 1) < 0)
-            goto error;
+        if (self->proto >= 4) {
+            const char stack_global_op = STACK_GLOBAL;
 
-        /* Since Python 3.0 now supports non-ASCII identifiers, we encode both
-           the module name and the global name using UTF-8. We do so only when
-           we are using the pickle protocol newer than version 3. This is to
-           ensure compatibility with older Unpickler running on Python 2.x. */
-        if (self->proto >= 3) {
-            unicode_encoder = PyUnicode_AsUTF8String;
+            if (save(self, module_name, 0) < 0)
+                goto error;
+            if (save(self, global_name, 0) < 0)
+                goto error;
+
+            if (_Pickler_Write(self, &stack_global_op, 1) < 0)
+                goto error;
         }
         else {
-            unicode_encoder = PyUnicode_AsASCIIString;
-        }
+            /* Generate a normal global opcode if we are using a pickle
+               protocol < 4, or if the object is not registered in the
+               extension registry. */
+            PyObject *encoded;
+            PyObject *(*unicode_encoder)(PyObject *);
 
-        /* For protocol < 3 and if the user didn't request against doing so,
-           we convert module names to the old 2.x module names. */
-        if (self->fix_imports) {
-            PyObject *key;
-            PyObject *item;
-
-            key = PyTuple_Pack(2, module_name, global_name);
-            if (key == NULL)
+            if (_Pickler_Write(self, &global_op, 1) < 0)
                 goto error;
-            item = PyDict_GetItemWithError(name_mapping_3to2, key);
-            Py_DECREF(key);
-            if (item) {
-                if (!PyTuple_Check(item) || PyTuple_GET_SIZE(item) != 2) {
-                    PyErr_Format(PyExc_RuntimeError,
-                                 "_compat_pickle.REVERSE_NAME_MAPPING values "
-                                 "should be 2-tuples, not %.200s",
-                                 Py_TYPE(item)->tp_name);
+
+            /* For protocol < 3 and if the user didn't request against doing
+               so, we convert module names to the old 2.x module names. */
+            if (self->proto < 3 && self->fix_imports) {
+                if (fix_imports(&module_name, &global_name) < 0) {
                     goto error;
                 }
-                Py_CLEAR(module_name);
-                Py_CLEAR(global_name);
-                module_name = PyTuple_GET_ITEM(item, 0);
-                global_name = PyTuple_GET_ITEM(item, 1);
-                if (!PyUnicode_Check(module_name) ||
-                    !PyUnicode_Check(global_name)) {
-                    PyErr_Format(PyExc_RuntimeError,
-                                 "_compat_pickle.REVERSE_NAME_MAPPING values "
-                                 "should be pairs of str, not (%.200s, %.200s)",
-                                 Py_TYPE(module_name)->tp_name,
-                                 Py_TYPE(global_name)->tp_name);
-                    goto error;
-                }
-                Py_INCREF(module_name);
-                Py_INCREF(global_name);
-            }
-            else if (PyErr_Occurred()) {
-                goto error;
             }
 
-            item = PyDict_GetItemWithError(import_mapping_3to2, module_name);
-            if (item) {
-                if (!PyUnicode_Check(item)) {
-                    PyErr_Format(PyExc_RuntimeError,
-                                 "_compat_pickle.REVERSE_IMPORT_MAPPING values "
-                                 "should be strings, not %.200s",
-                                 Py_TYPE(item)->tp_name);
-                    goto error;
-                }
-                Py_CLEAR(module_name);
-                module_name = item;
-                Py_INCREF(module_name);
+            /* Since Python 3.0 now supports non-ASCII identifiers, we encode
+               both the module name and the global name using UTF-8. We do so
+               only when we are using the pickle protocol newer than version
+               3. This is to ensure compatibility with older Unpickler running
+               on Python 2.x. */
+            if (self->proto == 3) {
+                unicode_encoder = PyUnicode_AsUTF8String;
             }
-            else if (PyErr_Occurred()) {
+            else {
+                unicode_encoder = PyUnicode_AsASCIIString;
+            }
+            encoded = unicode_encoder(module_name);
+            if (encoded == NULL) {
+                if (PyErr_ExceptionMatches(PyExc_UnicodeEncodeError))
+                    PyErr_Format(st->PicklingError,
+                                 "can't pickle module identifier '%S' using "
+                                 "pickle protocol %i",
+                                 module_name, self->proto);
                 goto error;
             }
-        }
-
-        /* Save the name of the module. */
-        encoded = unicode_encoder(module_name);
-        if (encoded == NULL) {
-            if (PyErr_ExceptionMatches(PyExc_UnicodeEncodeError))
-                PyErr_Format(PicklingError,
-                             "can't pickle module identifier '%S' using "
-                             "pickle protocol %i", module_name, self->proto);
-            goto error;
-        }
-        if (_Pickler_Write(self, PyBytes_AS_STRING(encoded),
-                          PyBytes_GET_SIZE(encoded)) < 0) {
+            if (_Pickler_Write(self, PyBytes_AS_STRING(encoded),
+                               PyBytes_GET_SIZE(encoded)) < 0) {
+                Py_DECREF(encoded);
+                goto error;
+            }
             Py_DECREF(encoded);
-            goto error;
-        }
-        Py_DECREF(encoded);
-        if(_Pickler_Write(self, "\n", 1) < 0)
-            goto error;
+            if(_Pickler_Write(self, "\n", 1) < 0)
+                goto error;
 
-        /* Save the name of the module. */
-        encoded = unicode_encoder(global_name);
-        if (encoded == NULL) {
-            if (PyErr_ExceptionMatches(PyExc_UnicodeEncodeError))
-                PyErr_Format(PicklingError,
-                             "can't pickle global identifier '%S' using "
-                             "pickle protocol %i", global_name, self->proto);
-            goto error;
-        }
-        if (_Pickler_Write(self, PyBytes_AS_STRING(encoded),
-                          PyBytes_GET_SIZE(encoded)) < 0) {
+            /* Save the name of the module. */
+            encoded = unicode_encoder(global_name);
+            if (encoded == NULL) {
+                if (PyErr_ExceptionMatches(PyExc_UnicodeEncodeError))
+                    PyErr_Format(st->PicklingError,
+                                 "can't pickle global identifier '%S' using "
+                                 "pickle protocol %i",
+                                 global_name, self->proto);
+                goto error;
+            }
+            if (_Pickler_Write(self, PyBytes_AS_STRING(encoded),
+                               PyBytes_GET_SIZE(encoded)) < 0) {
+                Py_DECREF(encoded);
+                goto error;
+            }
             Py_DECREF(encoded);
-            goto error;
+            if (_Pickler_Write(self, "\n", 1) < 0)
+                goto error;
         }
-        Py_DECREF(encoded);
-        if(_Pickler_Write(self, "\n", 1) < 0)
-            goto error;
-
         /* Memoize the object. */
         if (memo_put(self, obj) < 0)
             goto error;
@@ -2812,30 +3285,6 @@
 }
 
 static int
-save_ellipsis(PicklerObject *self, PyObject *obj)
-{
-    PyObject *str = PyUnicode_FromString("Ellipsis");
-    int res;
-    if (str == NULL)
-        return -1;
-    res = save_global(self, Py_Ellipsis, str);
-    Py_DECREF(str);
-    return res;
-}
-
-static int
-save_notimplemented(PicklerObject *self, PyObject *obj)
-{
-    PyObject *str = PyUnicode_FromString("NotImplemented");
-    int res;
-    if (str == NULL)
-        return -1;
-    res = save_global(self, Py_NotImplemented, str);
-    Py_DECREF(str);
-    return res;
-}
-
-static int
 save_singleton_type(PicklerObject *self, PyObject *obj, PyObject *singleton)
 {
     PyObject *reduce_value;
@@ -2875,7 +3324,7 @@
     const char binpersid_op = BINPERSID;
 
     Py_INCREF(obj);
-    pid = _Pickler_FastCall(self, func, obj);
+    pid = _Pickle_FastCall(func, obj);
     if (pid == NULL)
         return -1;
 
@@ -2923,14 +3372,9 @@
 get_class(PyObject *obj)
 {
     PyObject *cls;
-    static PyObject *str_class;
+    _Py_IDENTIFIER(__class__);
 
-    if (str_class == NULL) {
-        str_class = PyUnicode_InternFromString("__class__");
-        if (str_class == NULL)
-            return NULL;
-    }
-    cls = PyObject_GetAttr(obj, str_class);
+    cls = _PyObject_GetAttrId(obj, &PyId___class__);
     if (cls == NULL) {
         if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
             PyErr_Clear();
@@ -2952,17 +3396,18 @@
     PyObject *state = NULL;
     PyObject *listitems = Py_None;
     PyObject *dictitems = Py_None;
+    PickleState *st = _Pickle_GetGlobalState();
     Py_ssize_t size;
-
-    int use_newobj = self->proto >= 2;
+    int use_newobj = 0, use_newobj_ex = 0;
 
     const char reduce_op = REDUCE;
     const char build_op = BUILD;
     const char newobj_op = NEWOBJ;
+    const char newobj_ex_op = NEWOBJ_EX;
 
     size = PyTuple_Size(args);
     if (size < 2 || size > 5) {
-        PyErr_SetString(PicklingError, "tuple returned by "
+        PyErr_SetString(st->PicklingError, "tuple returned by "
                         "__reduce__ must contain 2 through 5 elements");
         return -1;
     }
@@ -2972,12 +3417,12 @@
         return -1;
 
     if (!PyCallable_Check(callable)) {
-        PyErr_SetString(PicklingError, "first item of the tuple "
+        PyErr_SetString(st->PicklingError, "first item of the tuple "
                         "returned by __reduce__ must be callable");
         return -1;
     }
     if (!PyTuple_Check(argtup)) {
-        PyErr_SetString(PicklingError, "second item of the tuple "
+        PyErr_SetString(st->PicklingError, "second item of the tuple "
                         "returned by __reduce__ must be a tuple");
         return -1;
     }
@@ -2988,7 +3433,7 @@
     if (listitems == Py_None)
         listitems = NULL;
     else if (!PyIter_Check(listitems)) {
-        PyErr_Format(PicklingError, "fourth element of the tuple "
+        PyErr_Format(st->PicklingError, "fourth element of the tuple "
                      "returned by __reduce__ must be an iterator, not %s",
                      Py_TYPE(listitems)->tp_name);
         return -1;
@@ -2997,40 +3442,81 @@
     if (dictitems == Py_None)
         dictitems = NULL;
     else if (!PyIter_Check(dictitems)) {
-        PyErr_Format(PicklingError, "fifth element of the tuple "
+        PyErr_Format(st->PicklingError, "fifth element of the tuple "
                      "returned by __reduce__ must be an iterator, not %s",
                      Py_TYPE(dictitems)->tp_name);
         return -1;
     }
 
-    /* Protocol 2 special case: if callable's name is __newobj__, use
-       NEWOBJ. */
-    if (use_newobj) {
-        static PyObject *newobj_str = NULL, *name_str = NULL;
+    if (self->proto >= 2) {
         PyObject *name;
+        _Py_IDENTIFIER(__name__);
 
-        if (newobj_str == NULL) {
-            newobj_str = PyUnicode_InternFromString("__newobj__");
-            name_str = PyUnicode_InternFromString("__name__");
-            if (newobj_str == NULL || name_str == NULL)
-                return -1;
-        }
-
-        name = PyObject_GetAttr(callable, name_str);
+        name = _PyObject_GetAttrId(callable, &PyId___name__);
         if (name == NULL) {
-            if (PyErr_ExceptionMatches(PyExc_AttributeError))
-                PyErr_Clear();
-            else
+            if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                 return -1;
-            use_newobj = 0;
+            }
+            PyErr_Clear();
+        }
+        else if (self->proto >= 4) {
+            _Py_IDENTIFIER(__newobj_ex__);
+            use_newobj_ex = PyUnicode_Check(name) &&
+                PyUnicode_Compare(
+                    name, _PyUnicode_FromId(&PyId___newobj_ex__)) == 0;
+            Py_DECREF(name);
         }
         else {
+            _Py_IDENTIFIER(__newobj__);
             use_newobj = PyUnicode_Check(name) &&
-                         PyUnicode_Compare(name, newobj_str) == 0;
+                PyUnicode_Compare(
+                    name, _PyUnicode_FromId(&PyId___newobj__)) == 0;
             Py_DECREF(name);
         }
     }
-    if (use_newobj) {
+
+    if (use_newobj_ex) {
+        PyObject *cls;
+        PyObject *args;
+        PyObject *kwargs;
+
+        if (Py_SIZE(argtup) != 3) {
+            PyErr_Format(st->PicklingError,
+                         "length of the NEWOBJ_EX argument tuple must be "
+                         "exactly 3, not %zd", Py_SIZE(argtup));
+            return -1;
+        }
+
+        cls = PyTuple_GET_ITEM(argtup, 0);
+        if (!PyType_Check(cls)) {
+            PyErr_Format(st->PicklingError,
+                         "first item from NEWOBJ_EX argument tuple must "
+                         "be a class, not %.200s", Py_TYPE(cls)->tp_name);
+            return -1;
+        }
+        args = PyTuple_GET_ITEM(argtup, 1);
+        if (!PyTuple_Check(args)) {
+            PyErr_Format(st->PicklingError,
+                         "second item from NEWOBJ_EX argument tuple must "
+                         "be a tuple, not %.200s", Py_TYPE(args)->tp_name);
+            return -1;
+        }
+        kwargs = PyTuple_GET_ITEM(argtup, 2);
+        if (!PyDict_Check(kwargs)) {
+            PyErr_Format(st->PicklingError,
+                         "third item from NEWOBJ_EX argument tuple must "
+                         "be a dict, not %.200s", Py_TYPE(kwargs)->tp_name);
+            return -1;
+        }
+
+        if (save(self, cls, 0) < 0 ||
+            save(self, args, 0) < 0 ||
+            save(self, kwargs, 0) < 0 ||
+            _Pickler_Write(self, &newobj_ex_op, 1) < 0) {
+            return -1;
+        }
+    }
+    else if (use_newobj) {
         PyObject *cls;
         PyObject *newargtup;
         PyObject *obj_class;
@@ -3038,13 +3524,13 @@
 
         /* Sanity checks. */
         if (Py_SIZE(argtup) < 1) {
-            PyErr_SetString(PicklingError, "__newobj__ arglist is empty");
+            PyErr_SetString(st->PicklingError, "__newobj__ arglist is empty");
             return -1;
         }
 
         cls = PyTuple_GET_ITEM(argtup, 0);
         if (!PyType_Check(cls)) {
-            PyErr_SetString(PicklingError, "args[0] from "
+            PyErr_SetString(st->PicklingError, "args[0] from "
                             "__newobj__ args is not a type");
             return -1;
         }
@@ -3054,7 +3540,7 @@
             p = obj_class != cls;    /* true iff a problem */
             Py_DECREF(obj_class);
             if (p) {
-                PyErr_SetString(PicklingError, "args[0] from "
+                PyErr_SetString(st->PicklingError, "args[0] from "
                                 "__newobj__ args has the wrong class");
                 return -1;
             }
@@ -3114,8 +3600,23 @@
        the caller do not want to memoize the object. Not particularly useful,
        but that is to mimic the behavior save_reduce() in pickle.py when
        obj is None. */
-    if (obj && memo_put(self, obj) < 0)
-        return -1;
+    if (obj != NULL) {
+        /* If the object is already in the memo, this means it is
+           recursive. In this case, throw away everything we put on the
+           stack, and fetch the object back from the memo. */
+        if (PyMemoTable_Get(self->memo, obj)) {
+            const char pop_op = POP;
+
+            if (_Pickler_Write(self, &pop_op, 1) < 0)
+                return -1;
+            if (memo_get(self, obj) < 0)
+                return -1;
+
+            return 0;
+        }
+        else if (memo_put(self, obj) < 0)
+            return -1;
+    }
 
     if (listitems && batch_list(self, listitems) < 0)
         return -1;
@@ -3140,6 +3641,9 @@
     PyObject *reduce_value = NULL;
     int status = 0;
 
+    if (_Pickler_OpcodeBoundary(self) < 0)
+        return -1;
+
     if (Py_EnterRecursiveCall(" while pickling an object"))
         return -1;
 
@@ -3168,14 +3672,6 @@
         status = save_none(self, obj);
         goto done;
     }
-    else if (obj == Py_Ellipsis) {
-        status = save_ellipsis(self, obj);
-        goto done;
-    }
-    else if (obj == Py_NotImplemented) {
-        status = save_notimplemented(self, obj);
-        goto done;
-    }
     else if (obj == Py_False || obj == Py_True) {
         status = save_bool(self, obj);
         goto done;
@@ -3210,6 +3706,14 @@
         status = save_dict(self, obj);
         goto done;
     }
+    else if (type == &PySet_Type) {
+        status = save_set(self, obj);
+        goto done;
+    }
+    else if (type == &PyFrozenSet_Type) {
+        status = save_frozenset(self, obj);
+        goto done;
+    }
     else if (type == &PyList_Type) {
         status = save_list(self, obj);
         goto done;
@@ -3224,16 +3728,6 @@
     }
     else if (type == &PyFunction_Type) {
         status = save_global(self, obj, NULL);
-        if (status < 0 && PyErr_ExceptionMatches(PickleError)) {
-            /* fall back to reduce */
-            PyErr_Clear();
-        }
-        else {
-            goto done;
-        }
-    }
-    else if (type == &PyCFunction_Type) {
-        status = save_global(self, obj, NULL);
         goto done;
     }
 
@@ -3244,12 +3738,22 @@
      * __reduce_ex__ method, or the object's __reduce__ method.
      */
     if (self->dispatch_table == NULL) {
-        reduce_func = PyDict_GetItem(dispatch_table, (PyObject *)type);
-        /* PyDict_GetItem() unlike PyObject_GetItem() and
-           PyObject_GetAttr() returns a borrowed ref */
-        Py_XINCREF(reduce_func);
+        PickleState *st = _Pickle_GetGlobalState();
+        reduce_func = PyDict_GetItemWithError(st->dispatch_table,
+                                              (PyObject *)type);
+        if (reduce_func == NULL) {
+            if (PyErr_Occurred()) {
+                goto error;
+            }
+        } else {
+            /* PyDict_GetItemWithError() returns a borrowed reference.
+               Increase the reference count to be consistent with
+               PyObject_GetItem and _PyObject_GetAttrId used below. */
+            Py_INCREF(reduce_func);
+        }
     } else {
-        reduce_func = PyObject_GetItem(self->dispatch_table, (PyObject *)type);
+        reduce_func = PyObject_GetItem(self->dispatch_table,
+                                       (PyObject *)type);
         if (reduce_func == NULL) {
             if (PyErr_ExceptionMatches(PyExc_KeyError))
                 PyErr_Clear();
@@ -3259,25 +3763,16 @@
     }
     if (reduce_func != NULL) {
         Py_INCREF(obj);
-        reduce_value = _Pickler_FastCall(self, reduce_func, obj);
+        reduce_value = _Pickle_FastCall(reduce_func, obj);
     }
     else if (PyType_IsSubtype(type, &PyType_Type)) {
         status = save_global(self, obj, NULL);
         goto done;
     }
     else {
-        static PyObject *reduce_str = NULL;
-        static PyObject *reduce_ex_str = NULL;
+        _Py_IDENTIFIER(__reduce__);
+        _Py_IDENTIFIER(__reduce_ex__);
 
-        /* Cache the name of the reduce methods. */
-        if (reduce_str == NULL) {
-            reduce_str = PyUnicode_InternFromString("__reduce__");
-            if (reduce_str == NULL)
-                goto error;
-            reduce_ex_str = PyUnicode_InternFromString("__reduce_ex__");
-            if (reduce_ex_str == NULL)
-                goto error;
-        }
 
         /* XXX: If the __reduce__ method is defined, __reduce_ex__ is
            automatically defined as __reduce__. While this is convenient, this
@@ -3288,26 +3783,34 @@
            don't actually have to check for a __reduce__ method. */
 
         /* Check for a __reduce_ex__ method. */
-        reduce_func = PyObject_GetAttr(obj, reduce_ex_str);
+        reduce_func = _PyObject_GetAttrId(obj, &PyId___reduce_ex__);
         if (reduce_func != NULL) {
             PyObject *proto;
             proto = PyLong_FromLong(self->proto);
             if (proto != NULL) {
-                reduce_value = _Pickler_FastCall(self, reduce_func, proto);
+                reduce_value = _Pickle_FastCall(reduce_func, proto);
             }
         }
         else {
-            if (PyErr_ExceptionMatches(PyExc_AttributeError))
+            PickleState *st = _Pickle_GetGlobalState();
+
+            if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
                 PyErr_Clear();
-            else
-                goto error;
-            /* Check for a __reduce__ method. */
-            reduce_func = PyObject_GetAttr(obj, reduce_str);
-            if (reduce_func != NULL) {
-                reduce_value = PyObject_Call(reduce_func, empty_tuple, NULL);
             }
             else {
-                PyErr_Format(PicklingError, "can't pickle '%.200s' object: %R",
+                goto error;
+            }
+            /* Check for a __reduce__ method. */
+            reduce_func = _PyObject_GetAttrId(obj, &PyId___reduce__);
+            if (reduce_func != NULL) {
+                PyObject *empty_tuple = PyTuple_New(0);
+                reduce_value = PyObject_Call(reduce_func, empty_tuple,
+                                             NULL);
+                Py_DECREF(empty_tuple);
+            }
+            else {
+                PyErr_Format(st->PicklingError,
+                             "can't pickle '%.200s' object: %R",
                              type->tp_name, obj);
                 goto error;
             }
@@ -3323,7 +3826,8 @@
     }
 
     if (!PyTuple_Check(reduce_value)) {
-        PyErr_SetString(PicklingError,
+        PickleState *st = _Pickle_GetGlobalState();
+        PyErr_SetString(st->PicklingError,
                         "__reduce__ must return a string or tuple");
         goto error;
     }
@@ -3335,6 +3839,7 @@
         status = -1;
     }
   done:
+
     Py_LeaveRecursiveCall();
     Py_XDECREF(reduce_func);
     Py_XDECREF(reduce_value);
@@ -3355,6 +3860,8 @@
         header[1] = (unsigned char)self->proto;
         if (_Pickler_Write(self, header, 2) < 0)
             return -1;
+        if (self->proto >= 4)
+            self->framing = 1;
     }
 
     if (save(self, obj, 0) < 0 ||
@@ -3364,16 +3871,21 @@
     return 0;
 }
 
-PyDoc_STRVAR(Pickler_clear_memo_doc,
-"clear_memo() -> None. Clears the pickler's \"memo\"."
-"\n"
-"The memo is the data structure that remembers which objects the\n"
-"pickler has already seen, so that shared or recursive objects are\n"
-"pickled by reference and not by value.  This method is useful when\n"
-"re-using picklers.");
+/*[clinic input]
+
+_pickle.Pickler.clear_memo
+
+Clears the pickler's "memo".
+
+The memo is the data structure that remembers which objects the
+pickler has already seen, so that shared or recursive objects are
+pickled by reference and not by value.  This method is useful when
+re-using picklers.
+[clinic start generated code]*/
 
 static PyObject *
-Pickler_clear_memo(PicklerObject *self)
+_pickle_Pickler_clear_memo_impl(PicklerObject *self)
+/*[clinic end generated code: output=8665c8658aaa094b input=01bdad52f3d93e56]*/
 {
     if (self->memo)
         PyMemoTable_Clear(self->memo);
@@ -3381,27 +3893,31 @@
     Py_RETURN_NONE;
 }
 
-PyDoc_STRVAR(Pickler_dump_doc,
-"dump(obj) -> None. Write a pickled representation of obj to the open file.");
+/*[clinic input]
+
+_pickle.Pickler.dump
+
+  obj: object
+  /
+
+Write a pickled representation of the given object to the open file.
+[clinic start generated code]*/
 
 static PyObject *
-Pickler_dump(PicklerObject *self, PyObject *args)
+_pickle_Pickler_dump(PicklerObject *self, PyObject *obj)
+/*[clinic end generated code: output=87ecad1261e02ac7 input=552eb1c0f52260d9]*/
 {
-    PyObject *obj;
-
     /* Check whether the Pickler was initialized correctly (issue3664).
        Developers often forget to call __init__() in their subclasses, which
        would trigger a segfault without this check. */
     if (self->write == NULL) {
-        PyErr_Format(PicklingError,
+        PickleState *st = _Pickle_GetGlobalState();
+        PyErr_Format(st->PicklingError,
                      "Pickler.__init__() was not called by %s.__init__()",
                      Py_TYPE(self)->tp_name);
         return NULL;
     }
 
-    if (!PyArg_ParseTuple(args, "O:dump", &obj))
-        return NULL;
-
     if (_Pickler_ClearBuffer(self) < 0)
         return NULL;
 
@@ -3414,11 +3930,37 @@
     Py_RETURN_NONE;
 }
 
+/*[clinic input]
+
+_pickle.Pickler.__sizeof__ -> Py_ssize_t
+
+Returns size in memory, in bytes.
+[clinic start generated code]*/
+
+static Py_ssize_t
+_pickle_Pickler___sizeof___impl(PicklerObject *self)
+/*[clinic end generated code: output=106edb3123f332e1 input=8cbbec9bd5540d42]*/
+{
+    Py_ssize_t res, s;
+
+    res = sizeof(PicklerObject);
+    if (self->memo != NULL) {
+        res += sizeof(PyMemoTable);
+        res += self->memo->mt_allocated * sizeof(PyMemoEntry);
+    }
+    if (self->output_buffer != NULL) {
+        s = _PySys_GetSizeOf(self->output_buffer);
+        if (s == -1)
+            return -1;
+        res += s;
+    }
+    return res;
+}
+
 static struct PyMethodDef Pickler_methods[] = {
-    {"dump", (PyCFunction)Pickler_dump, METH_VARARGS,
-     Pickler_dump_doc},
-    {"clear_memo", (PyCFunction)Pickler_clear_memo, METH_NOARGS,
-     Pickler_clear_memo_doc},
+    _PICKLE_PICKLER_DUMP_METHODDEF
+    _PICKLE_PICKLER_CLEAR_MEMO_METHODDEF
+    _PICKLE_PICKLER___SIZEOF___METHODDEF
     {NULL, NULL}                /* sentinel */
 };
 
@@ -3431,7 +3973,6 @@
     Py_XDECREF(self->write);
     Py_XDECREF(self->pers_func);
     Py_XDECREF(self->dispatch_table);
-    Py_XDECREF(self->arg);
     Py_XDECREF(self->fast_memo);
 
     PyMemoTable_Del(self->memo);
@@ -3445,7 +3986,6 @@
     Py_VISIT(self->write);
     Py_VISIT(self->pers_func);
     Py_VISIT(self->dispatch_table);
-    Py_VISIT(self->arg);
     Py_VISIT(self->fast_memo);
     return 0;
 }
@@ -3457,7 +3997,6 @@
     Py_CLEAR(self->write);
     Py_CLEAR(self->pers_func);
     Py_CLEAR(self->dispatch_table);
-    Py_CLEAR(self->arg);
     Py_CLEAR(self->fast_memo);
 
     if (self->memo != NULL) {
@@ -3469,49 +4008,46 @@
 }
 
 
-PyDoc_STRVAR(Pickler_doc,
-"Pickler(file, protocol=None)"
-"\n"
-"This takes a binary file for writing a pickle data stream.\n"
-"\n"
-"The optional protocol argument tells the pickler to use the\n"
-"given protocol; supported protocols are 0, 1, 2, 3.  The default\n"
-"protocol is 3; a backward-incompatible protocol designed for\n"
-"Python 3.0.\n"
-"\n"
-"Specifying a negative protocol version selects the highest\n"
-"protocol version supported.  The higher the protocol used, the\n"
-"more recent the version of Python needed to read the pickle\n"
-"produced.\n"
-"\n"
-"The file argument must have a write() method that accepts a single\n"
-"bytes argument. It can thus be a file object opened for binary\n"
-"writing, a io.BytesIO instance, or any other custom object that\n"
-"meets this interface.\n"
-"\n"
-"If fix_imports is True and protocol is less than 3, pickle will try to\n"
-"map the new Python 3.x names to the old module names used in Python\n"
-"2.x, so that the pickle data stream is readable with Python 2.x.\n");
+/*[clinic input]
+
+_pickle.Pickler.__init__
+
+  file: object
+  protocol: object = NULL
+  fix_imports: bool = True
+
+This takes a binary file for writing a pickle data stream.
+
+The optional *protocol* argument tells the pickler to use the given
+protocol; supported protocols are 0, 1, 2, 3 and 4.  The default
+protocol is 3; a backward-incompatible protocol designed for Python 3.
+
+Specifying a negative protocol version selects the highest protocol
+version supported.  The higher the protocol used, the more recent the
+version of Python needed to read the pickle produced.
+
+The *file* argument must have a write() method that accepts a single
+bytes argument. It can thus be a file object opened for binary
+writing, a io.BytesIO instance, or any other custom object that meets
+this interface.
+
+If *fix_imports* is True and protocol is less than 3, pickle will try
+to map the new Python 3 names to the old module names used in Python
+2, so that the pickle data stream is readable with Python 2.
+[clinic start generated code]*/
 
 static int
-Pickler_init(PicklerObject *self, PyObject *args, PyObject *kwds)
+_pickle_Pickler___init___impl(PicklerObject *self, PyObject *file, PyObject *protocol, int fix_imports)
+/*[clinic end generated code: output=56e229f3b1f4332f input=b8cdeb7e3f5ee674]*/
 {
-    static char *kwlist[] = {"file", "protocol", "fix_imports", 0};
-    PyObject *file;
-    PyObject *proto_obj = NULL;
-    PyObject *fix_imports = Py_True;
     _Py_IDENTIFIER(persistent_id);
     _Py_IDENTIFIER(dispatch_table);
 
-    if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|OO:Pickler",
-                                     kwlist, &file, &proto_obj, &fix_imports))
-        return -1;
-
     /* In case of multiple __init__() calls, clear previous content. */
     if (self->write != NULL)
         (void)Pickler_clear(self);
 
-    if (_Pickler_SetProtocol(self, proto_obj, fix_imports) < 0)
+    if (_Pickler_SetProtocol(self, protocol, fix_imports) < 0)
         return -1;
 
     if (_Pickler_SetOutputStream(self, file) < 0)
@@ -3532,7 +4068,6 @@
             return -1;
     }
 
-    self->arg = NULL;
     self->fast = 0;
     self->fast_nesting = 0;
     self->fast_memo = NULL;
@@ -3550,9 +4085,11 @@
         if (self->dispatch_table == NULL)
             return -1;
     }
+
     return 0;
 }
 
+
 /* Define a proxy object for the Pickler's internal memo object. This is to
  * avoid breaking code like:
  *  pickler.memo.clear()
@@ -3563,27 +4100,30 @@
  * intentional, as these should be treated as black-box implementation details.
  */
 
-typedef struct {
-    PyObject_HEAD
-    PicklerObject *pickler; /* Pickler whose memo table we're proxying. */
-} PicklerMemoProxyObject;
+/*[clinic input]
+_pickle.PicklerMemoProxy.clear
 
-PyDoc_STRVAR(pmp_clear_doc,
-"memo.clear() -> None.  Remove all items from memo.");
+Remove all items from memo.
+[clinic start generated code]*/
 
 static PyObject *
-pmp_clear(PicklerMemoProxyObject *self)
+_pickle_PicklerMemoProxy_clear_impl(PicklerMemoProxyObject *self)
+/*[clinic end generated code: output=5fb9370d48ae8b05 input=ccc186dacd0f1405]*/
 {
     if (self->pickler->memo)
         PyMemoTable_Clear(self->pickler->memo);
     Py_RETURN_NONE;
 }
 
-PyDoc_STRVAR(pmp_copy_doc,
-"memo.copy() -> new_memo.  Copy the memo to a new object.");
+/*[clinic input]
+_pickle.PicklerMemoProxy.copy
+
+Copy the memo to a new object.
+[clinic start generated code]*/
 
 static PyObject *
-pmp_copy(PicklerMemoProxyObject *self)
+_pickle_PicklerMemoProxy_copy_impl(PicklerMemoProxyObject *self)
+/*[clinic end generated code: output=bb83a919d29225ef input=b73043485ac30b36]*/
 {
     Py_ssize_t i;
     PyMemoTable *memo;
@@ -3620,14 +4160,18 @@
     return NULL;
 }
 
-PyDoc_STRVAR(pmp_reduce_doc,
-"memo.__reduce__(). Pickling support.");
+/*[clinic input]
+_pickle.PicklerMemoProxy.__reduce__
+
+Implement pickle support.
+[clinic start generated code]*/
 
 static PyObject *
-pmp_reduce(PicklerMemoProxyObject *self, PyObject *args)
+_pickle_PicklerMemoProxy___reduce___impl(PicklerMemoProxyObject *self)
+/*[clinic end generated code: output=bebba1168863ab1d input=2f7c540e24b7aae4]*/
 {
     PyObject *reduce_value, *dict_args;
-    PyObject *contents = pmp_copy(self);
+    PyObject *contents = _pickle_PicklerMemoProxy_copy_impl(self);
     if (contents == NULL)
         return NULL;
 
@@ -3650,9 +4194,9 @@
 }
 
 static PyMethodDef picklerproxy_methods[] = {
-    {"clear",      (PyCFunction)pmp_clear,  METH_NOARGS,  pmp_clear_doc},
-    {"copy",       (PyCFunction)pmp_copy,   METH_NOARGS,  pmp_copy_doc},
-    {"__reduce__", (PyCFunction)pmp_reduce, METH_VARARGS, pmp_reduce_doc},
+    _PICKLE_PICKLERMEMOPROXY_CLEAR_METHODDEF
+    _PICKLE_PICKLERMEMOPROXY_COPY_METHODDEF
+    _PICKLE_PICKLERMEMOPROXY___REDUCE___METHODDEF
     {NULL, NULL} /* sentinel */
 };
 
@@ -3864,7 +4408,7 @@
     0,                                  /*tp_setattro*/
     0,                                  /*tp_as_buffer*/
     Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,
-    Pickler_doc,                        /*tp_doc*/
+    _pickle_Pickler___init____doc__,    /*tp_doc*/
     (traverseproc)Pickler_traverse,     /*tp_traverse*/
     (inquiry)Pickler_clear,             /*tp_clear*/
     0,                                  /*tp_richcompare*/
@@ -3879,7 +4423,7 @@
     0,                                  /*tp_descr_get*/
     0,                                  /*tp_descr_set*/
     0,                                  /*tp_dictoffset*/
-    (initproc)Pickler_init,             /*tp_init*/
+    _pickle_Pickler___init__,           /*tp_init*/
     PyType_GenericAlloc,                /*tp_alloc*/
     PyType_GenericNew,                  /*tp_new*/
     PyObject_GC_Del,                    /*tp_free*/
@@ -3905,8 +4449,9 @@
 static Py_ssize_t
 marker(UnpicklerObject *self)
 {
+    PickleState *st = _Pickle_GetGlobalState();
     if (self->num_marks < 1) {
-        PyErr_SetString(UnpicklingError, "could not find MARK");
+        PyErr_SetString(st->UnpicklingError, "could not find MARK");
         return -1;
     }
 
@@ -3923,7 +4468,8 @@
 static int
 bad_readline(void)
 {
-    PyErr_SetString(UnpicklingError, "pickle data was truncated");
+    PickleState *st = _Pickle_GetGlobalState();
+    PyErr_SetString(st->UnpicklingError, "pickle data was truncated");
     return -1;
 }
 
@@ -3984,17 +4530,15 @@
  * as a C Py_ssize_t, or -1 if it's higher than PY_SSIZE_T_MAX.
  */
 static Py_ssize_t
-calc_binsize(char *bytes, int size)
+calc_binsize(char *bytes, int nbytes)
 {
     unsigned char *s = (unsigned char *)bytes;
+    int i;
     size_t x = 0;
 
-    assert(size == 4);
-
-    x =  (size_t) s[0];
-    x |= (size_t) s[1] << 8;
-    x |= (size_t) s[2] << 16;
-    x |= (size_t) s[3] << 24;
+    for (i = 0; i < nbytes && i < sizeof(size_t); i++) {
+        x |= (size_t) s[i] << (8 * i);
+    }
 
     if (x > PY_SSIZE_T_MAX)
         return -1;
@@ -4008,21 +4552,21 @@
  * of x-platform bugs.
  */
 static long
-calc_binint(char *bytes, int size)
+calc_binint(char *bytes, int nbytes)
 {
     unsigned char *s = (unsigned char *)bytes;
-    int i = size;
+    int i;
     long x = 0;
 
-    for (i = 0; i < size; i++) {
-        x |= (long)s[i] << (i * 8);
+    for (i = 0; i < nbytes; i++) {
+        x |= (long)s[i] << (8 * i);
     }
 
     /* Unlike BININT1 and BININT2, BININT (more accurately BININT4)
      * is signed, so on a box with longs bigger than 4 bytes we need
      * to extend a BININT's sign bit to the full width.
      */
-    if (SIZEOF_LONG > 4 && size == 4) {
+    if (SIZEOF_LONG > 4 && nbytes == 4) {
         x |= -(x & (1L << 31));
     }
 
@@ -4120,8 +4664,9 @@
 
     size = calc_binint(nbytes, size);
     if (size < 0) {
+        PickleState *st = _Pickle_GetGlobalState();
         /* Corrupt or hostile pickle -- we never write one like this */
-        PyErr_SetString(UnpicklingError,
+        PyErr_SetString(st->UnpicklingError,
                         "LONG pickle has negative byte count");
         return -1;
     }
@@ -4195,75 +4740,110 @@
 load_string(UnpicklerObject *self)
 {
     PyObject *bytes;
-    PyObject *str = NULL;
+    PyObject *obj;
     Py_ssize_t len;
     char *s, *p;
 
     if ((len = _Unpickler_Readline(self, &s)) < 0)
         return -1;
-    if (len < 2)
-        return bad_readline();
-    if ((s = strdup(s)) == NULL) {
-        PyErr_NoMemory();
-        return -1;
-    }
-
+    /* Strip the newline */
+    len--;
     /* Strip outermost quotes */
-    while (len > 0 && s[len - 1] <= ' ')
-        len--;
-    if (len > 1 && s[0] == '"' && s[len - 1] == '"') {
-        s[len - 1] = '\0';
-        p = s + 1;
-        len -= 2;
-    }
-    else if (len > 1 && s[0] == '\'' && s[len - 1] == '\'') {
-        s[len - 1] = '\0';
+    if (len >= 2 && s[0] == s[len - 1] && (s[0] == '\'' || s[0] == '"')) {
         p = s + 1;
         len -= 2;
     }
     else {
-        free(s);
-        PyErr_SetString(PyExc_ValueError, "insecure string pickle");
+        PickleState *st = _Pickle_GetGlobalState();
+        PyErr_SetString(st->UnpicklingError,
+                        "the STRING opcode argument must be quoted");
         return -1;
     }
+    assert(len >= 0);
 
     /* Use the PyBytes API to decode the string, since that is what is used
        to encode, and then coerce the result to Unicode. */
     bytes = PyBytes_DecodeEscape(p, len, NULL, 0, NULL);
-    free(s);
     if (bytes == NULL)
         return -1;
-    str = PyUnicode_FromEncodedObject(bytes, self->encoding, self->errors);
-    Py_DECREF(bytes);
-    if (str == NULL)
-        return -1;
 
-    PDATA_PUSH(self->stack, str, -1);
+    /* Leave the Python 2.x strings as bytes if the *encoding* given to the
+       Unpickler was 'bytes'. Otherwise, convert them to unicode. */
+    if (strcmp(self->encoding, "bytes") == 0) {
+        obj = bytes;
+    }
+    else {
+        obj = PyUnicode_FromEncodedObject(bytes, self->encoding, self->errors);
+        Py_DECREF(bytes);
+        if (obj == NULL) {
+            return -1;
+        }
+    }
+
+    PDATA_PUSH(self->stack, obj, -1);
     return 0;
 }
 
 static int
-load_binbytes(UnpicklerObject *self)
+load_counted_binstring(UnpicklerObject *self, int nbytes)
 {
-    PyObject *bytes;
-    Py_ssize_t x;
+    PyObject *obj;
+    Py_ssize_t size;
     char *s;
 
-    if (_Unpickler_Read(self, &s, 4) < 0)
+    if (_Unpickler_Read(self, &s, nbytes) < 0)
         return -1;
 
-    x = calc_binsize(s, 4);
-    if (x < 0) {
+    size = calc_binsize(s, nbytes);
+    if (size < 0) {
+        PickleState *st = _Pickle_GetGlobalState();
+        PyErr_Format(st->UnpicklingError,
+                     "BINSTRING exceeds system's maximum size of %zd bytes",
+                     PY_SSIZE_T_MAX);
+        return -1;
+    }
+
+    if (_Unpickler_Read(self, &s, size) < 0)
+        return -1;
+
+    /* Convert Python 2.x strings to bytes if the *encoding* given to the
+       Unpickler was 'bytes'. Otherwise, convert them to unicode. */
+    if (strcmp(self->encoding, "bytes") == 0) {
+        obj = PyBytes_FromStringAndSize(s, size);
+    }
+    else {
+        obj = PyUnicode_Decode(s, size, self->encoding, self->errors);
+    }
+    if (obj == NULL) {
+        return -1;
+    }
+
+    PDATA_PUSH(self->stack, obj, -1);
+    return 0;
+}
+
+static int
+load_counted_binbytes(UnpicklerObject *self, int nbytes)
+{
+    PyObject *bytes;
+    Py_ssize_t size;
+    char *s;
+
+    if (_Unpickler_Read(self, &s, nbytes) < 0)
+        return -1;
+
+    size = calc_binsize(s, nbytes);
+    if (size < 0) {
         PyErr_Format(PyExc_OverflowError,
                      "BINBYTES exceeds system's maximum size of %zd bytes",
-                     PY_SSIZE_T_MAX
-                    );
+                     PY_SSIZE_T_MAX);
         return -1;
     }
 
-    if (_Unpickler_Read(self, &s, x) < 0)
+    if (_Unpickler_Read(self, &s, size) < 0)
         return -1;
-    bytes = PyBytes_FromStringAndSize(s, x);
+
+    bytes = PyBytes_FromStringAndSize(s, size);
     if (bytes == NULL)
         return -1;
 
@@ -4272,82 +4852,6 @@
 }
 
 static int
-load_short_binbytes(UnpicklerObject *self)
-{
-    PyObject *bytes;
-    Py_ssize_t x;
-    char *s;
-
-    if (_Unpickler_Read(self, &s, 1) < 0)
-        return -1;
-
-    x = (unsigned char)s[0];
-
-    if (_Unpickler_Read(self, &s, x) < 0)
-        return -1;
-
-    bytes = PyBytes_FromStringAndSize(s, x);
-    if (bytes == NULL)
-        return -1;
-
-    PDATA_PUSH(self->stack, bytes, -1);
-    return 0;
-}
-
-static int
-load_binstring(UnpicklerObject *self)
-{
-    PyObject *str;
-    Py_ssize_t x;
-    char *s;
-
-    if (_Unpickler_Read(self, &s, 4) < 0)
-        return -1;
-
-    x = calc_binint(s, 4);
-    if (x < 0) {
-        PyErr_SetString(UnpicklingError,
-                        "BINSTRING pickle has negative byte count");
-        return -1;
-    }
-
-    if (_Unpickler_Read(self, &s, x) < 0)
-        return -1;
-
-    /* Convert Python 2.x strings to unicode. */
-    str = PyUnicode_Decode(s, x, self->encoding, self->errors);
-    if (str == NULL)
-        return -1;
-
-    PDATA_PUSH(self->stack, str, -1);
-    return 0;
-}
-
-static int
-load_short_binstring(UnpicklerObject *self)
-{
-    PyObject *str;
-    Py_ssize_t x;
-    char *s;
-
-    if (_Unpickler_Read(self, &s, 1) < 0)
-        return -1;
-
-    x = (unsigned char)s[0];
-
-    if (_Unpickler_Read(self, &s, x) < 0)
-        return -1;
-
-    /* Convert Python 2.x strings to unicode. */
-    str = PyUnicode_Decode(s, x, self->encoding, self->errors);
-    if (str == NULL)
-        return -1;
-
-    PDATA_PUSH(self->stack, str, -1);
-    return 0;
-}
-
-static int
 load_unicode(UnpicklerObject *self)
 {
     PyObject *str;
@@ -4368,25 +4872,23 @@
 }
 
 static int
-load_binunicode(UnpicklerObject *self)
+load_counted_binunicode(UnpicklerObject *self, int nbytes)
 {
     PyObject *str;
     Py_ssize_t size;
     char *s;
 
-    if (_Unpickler_Read(self, &s, 4) < 0)
+    if (_Unpickler_Read(self, &s, nbytes) < 0)
         return -1;
 
-    size = calc_binsize(s, 4);
+    size = calc_binsize(s, nbytes);
     if (size < 0) {
         PyErr_Format(PyExc_OverflowError,
                      "BINUNICODE exceeds system's maximum size of %zd bytes",
-                     PY_SSIZE_T_MAX
-                    );
+                     PY_SSIZE_T_MAX);
         return -1;
     }
 
-
     if (_Unpickler_Read(self, &s, size) < 0)
         return -1;
 
@@ -4458,6 +4960,17 @@
 }
 
 static int
+load_empty_set(UnpicklerObject *self)
+{
+    PyObject *set;
+
+    if ((set = PySet_New(NULL)) == NULL)
+        return -1;
+    PDATA_PUSH(self->stack, set, -1);
+    return 0;
+}
+
+static int
 load_list(UnpicklerObject *self)
 {
     PyObject *list;
@@ -4499,6 +5012,29 @@
     return 0;
 }
 
+static int
+load_frozenset(UnpicklerObject *self)
+{
+    PyObject *items;
+    PyObject *frozenset;
+    Py_ssize_t i;
+
+    if ((i = marker(self)) < 0)
+        return -1;
+
+    items = Pdata_poptuple(self->stack, i);
+    if (items == NULL)
+        return -1;
+
+    frozenset = PyFrozenSet_New(items);
+    Py_DECREF(items);
+    if (frozenset == NULL)
+        return -1;
+
+    PDATA_PUSH(self->stack, frozenset, -1);
+    return 0;
+}
+
 static PyObject *
 instantiate(PyObject *cls, PyObject *args)
 {
@@ -4606,6 +5142,7 @@
     PyObject *clsraw = NULL;
     PyTypeObject *cls;          /* clsraw cast to its true type */
     PyObject *obj;
+    PickleState *st = _Pickle_GetGlobalState();
 
     /* Stack is ... cls argtuple, and we want to call
      * cls.__new__(cls, *argtuple).
@@ -4614,7 +5151,8 @@
     if (args == NULL)
         goto error;
     if (!PyTuple_Check(args)) {
-        PyErr_SetString(UnpicklingError, "NEWOBJ expected an arg " "tuple.");
+        PyErr_SetString(st->UnpicklingError,
+                        "NEWOBJ expected an arg " "tuple.");
         goto error;
     }
 
@@ -4623,12 +5161,12 @@
     if (cls == NULL)
         goto error;
     if (!PyType_Check(cls)) {
-        PyErr_SetString(UnpicklingError, "NEWOBJ class argument "
+        PyErr_SetString(st->UnpicklingError, "NEWOBJ class argument "
                         "isn't a type object");
         goto error;
     }
     if (cls->tp_new == NULL) {
-        PyErr_SetString(UnpicklingError, "NEWOBJ class argument "
+        PyErr_SetString(st->UnpicklingError, "NEWOBJ class argument "
                         "has NULL tp_new");
         goto error;
     }
@@ -4650,6 +5188,58 @@
 }
 
 static int
+load_newobj_ex(UnpicklerObject *self)
+{
+    PyObject *cls, *args, *kwargs;
+    PyObject *obj;
+    PickleState *st = _Pickle_GetGlobalState();
+
+    PDATA_POP(self->stack, kwargs);
+    if (kwargs == NULL) {
+        return -1;
+    }
+    PDATA_POP(self->stack, args);
+    if (args == NULL) {
+        Py_DECREF(kwargs);
+        return -1;
+    }
+    PDATA_POP(self->stack, cls);
+    if (cls == NULL) {
+        Py_DECREF(kwargs);
+        Py_DECREF(args);
+        return -1;
+    }
+
+    if (!PyType_Check(cls)) {
+        Py_DECREF(kwargs);
+        Py_DECREF(args);
+        Py_DECREF(cls);
+        PyErr_Format(st->UnpicklingError,
+                     "NEWOBJ_EX class argument must be a type, not %.200s",
+                     Py_TYPE(cls)->tp_name);
+        return -1;
+    }
+
+    if (((PyTypeObject *)cls)->tp_new == NULL) {
+        Py_DECREF(kwargs);
+        Py_DECREF(args);
+        Py_DECREF(cls);
+        PyErr_SetString(st->UnpicklingError,
+                        "NEWOBJ_EX class argument doesn't have __new__");
+        return -1;
+    }
+    obj = ((PyTypeObject *)cls)->tp_new((PyTypeObject *)cls, args, kwargs);
+    Py_DECREF(kwargs);
+    Py_DECREF(args);
+    Py_DECREF(cls);
+    if (obj == NULL) {
+        return -1;
+    }
+    PDATA_PUSH(self->stack, obj, -1);
+    return 0;
+}
+
+static int
 load_global(UnpicklerObject *self)
 {
     PyObject *global = NULL;
@@ -4686,6 +5276,32 @@
 }
 
 static int
+load_stack_global(UnpicklerObject *self)
+{
+    PyObject *global;
+    PyObject *module_name;
+    PyObject *global_name;
+
+    PDATA_POP(self->stack, global_name);
+    PDATA_POP(self->stack, module_name);
+    if (module_name == NULL || !PyUnicode_CheckExact(module_name) ||
+        global_name == NULL || !PyUnicode_CheckExact(global_name)) {
+        PickleState *st = _Pickle_GetGlobalState();
+        PyErr_SetString(st->UnpicklingError, "STACK_GLOBAL requires str");
+        Py_XDECREF(global_name);
+        Py_XDECREF(module_name);
+        return -1;
+    }
+    global = find_class(self, module_name, global_name);
+    Py_DECREF(global_name);
+    Py_DECREF(module_name);
+    if (global == NULL)
+        return -1;
+    PDATA_PUSH(self->stack, global, -1);
+    return 0;
+}
+
+static int
 load_persid(UnpicklerObject *self)
 {
     PyObject *pid;
@@ -4702,9 +5318,9 @@
         if (pid == NULL)
             return -1;
 
-        /* Ugh... this does not leak since _Unpickler_FastCall() steals the
-           reference to pid first. */
-        pid = _Unpickler_FastCall(self, self->pers_func, pid);
+        /* This does not leak since _Pickle_FastCall() steals the reference
+           to pid first. */
+        pid = _Pickle_FastCall(self->pers_func, pid);
         if (pid == NULL)
             return -1;
 
@@ -4712,7 +5328,8 @@
         return 0;
     }
     else {
-        PyErr_SetString(UnpicklingError,
+        PickleState *st = _Pickle_GetGlobalState();
+        PyErr_SetString(st->UnpicklingError,
                         "A load persistent id instruction was encountered,\n"
                         "but no persistent_load function was specified.");
         return -1;
@@ -4729,9 +5346,9 @@
         if (pid == NULL)
             return -1;
 
-        /* Ugh... this does not leak since _Unpickler_FastCall() steals the
+        /* This does not leak since _Pickle_FastCall() steals the
            reference to pid first. */
-        pid = _Unpickler_FastCall(self, self->pers_func, pid);
+        pid = _Pickle_FastCall(self->pers_func, pid);
         if (pid == NULL)
             return -1;
 
@@ -4739,7 +5356,8 @@
         return 0;
     }
     else {
-        PyErr_SetString(UnpicklingError,
+        PickleState *st = _Pickle_GetGlobalState();
+        PyErr_SetString(st->UnpicklingError,
                         "A load persistent id instruction was encountered,\n"
                         "but no persistent_load function was specified.");
         return -1;
@@ -4895,6 +5513,7 @@
     PyObject *obj;              /* the object to push */
     PyObject *pair;             /* (module_name, class_name) */
     PyObject *module_name, *class_name;
+    PickleState *st = _Pickle_GetGlobalState();
 
     assert(nbytes == 1 || nbytes == 2 || nbytes == 4);
     if (_Unpickler_Read(self, &codebytes, nbytes) < 0)
@@ -4902,7 +5521,7 @@
     code = calc_binint(codebytes, nbytes);
     if (code <= 0) {            /* note that 0 is forbidden */
         /* Corrupt or hostile pickle. */
-        PyErr_SetString(UnpicklingError, "EXT specifies code <= 0");
+        PyErr_SetString(st->UnpicklingError, "EXT specifies code <= 0");
         return -1;
     }
 
@@ -4910,20 +5529,26 @@
     py_code = PyLong_FromLong(code);
     if (py_code == NULL)
         return -1;
-    obj = PyDict_GetItem(extension_cache, py_code);
+    obj = PyDict_GetItemWithError(st->extension_cache, py_code);
     if (obj != NULL) {
         /* Bingo. */
         Py_DECREF(py_code);
         PDATA_APPEND(self->stack, obj, -1);
         return 0;
     }
+    if (PyErr_Occurred()) {
+        Py_DECREF(py_code);
+        return -1;
+    }
 
     /* Look up the (module_name, class_name) pair. */
-    pair = PyDict_GetItem(inverted_registry, py_code);
+    pair = PyDict_GetItemWithError(st->inverted_registry, py_code);
     if (pair == NULL) {
         Py_DECREF(py_code);
-        PyErr_Format(PyExc_ValueError, "unregistered extension "
-                     "code %ld", code);
+        if (!PyErr_Occurred()) {
+            PyErr_Format(PyExc_ValueError, "unregistered extension "
+                         "code %ld", code);
+        }
         return -1;
     }
     /* Since the extension registry is manipulable via Python code,
@@ -4944,7 +5569,7 @@
         return -1;
     }
     /* Cache code -> obj. */
-    code = PyDict_SetItem(extension_cache, py_code, obj);
+    code = PyDict_SetItem(st->extension_cache, py_code, obj);
     Py_DECREF(py_code);
     if (code < 0) {
         Py_DECREF(obj);
@@ -5029,6 +5654,18 @@
 }
 
 static int
+load_memoize(UnpicklerObject *self)
+{
+    PyObject *value;
+
+    if (Py_SIZE(self->stack) <= 0)
+        return stack_underflow();
+    value = self->stack->data[Py_SIZE(self->stack) - 1];
+
+    return _Unpickler_MemoPut(self, self->memo_len, value);
+}
+
+static int
 do_append(UnpicklerObject *self, Py_ssize_t x)
 {
     PyObject *value;
@@ -5067,7 +5704,7 @@
             PyObject *result;
 
             value = self->stack->data[i];
-            result = _Unpickler_FastCall(self, append_func, value);
+            result = _Pickle_FastCall(append_func, value);
             if (result == NULL) {
                 Pdata_clear(self->stack, i + 1);
                 Py_SIZE(self->stack) = x;
@@ -5109,8 +5746,10 @@
     if (len == x)  /* nothing to do */
         return 0;
     if ((len - x) % 2 != 0) {
+        PickleState *st = _Pickle_GetGlobalState();
         /* Currupt or hostile pickle -- we never write one like this. */
-        PyErr_SetString(UnpicklingError, "odd number of items for SETITEMS");
+        PyErr_SetString(st->UnpicklingError,
+                        "odd number of items for SETITEMS");
         return -1;
     }
 
@@ -5144,6 +5783,59 @@
 }
 
 static int
+load_additems(UnpicklerObject *self)
+{
+    PyObject *set;
+    Py_ssize_t mark, len, i;
+
+    mark =  marker(self);
+    len = Py_SIZE(self->stack);
+    if (mark > len || mark <= 0)
+        return stack_underflow();
+    if (len == mark)  /* nothing to do */
+        return 0;
+
+    set = self->stack->data[mark - 1];
+
+    if (PySet_Check(set)) {
+        PyObject *items;
+        int status;
+
+        items = Pdata_poptuple(self->stack, mark);
+        if (items == NULL)
+            return -1;
+
+        status = _PySet_Update(set, items);
+        Py_DECREF(items);
+        return status;
+    }
+    else {
+        PyObject *add_func;
+        _Py_IDENTIFIER(add);
+
+        add_func = _PyObject_GetAttrId(set, &PyId_add);
+        if (add_func == NULL)
+            return -1;
+        for (i = mark; i < len; i++) {
+            PyObject *result;
+            PyObject *item;
+
+            item = self->stack->data[i];
+            result = _Pickle_FastCall(add_func, item);
+            if (result == NULL) {
+                Pdata_clear(self->stack, i + 1);
+                Py_SIZE(self->stack) = mark;
+                return -1;
+            }
+            Py_DECREF(result);
+        }
+        Py_SIZE(self->stack) = mark;
+    }
+
+    return 0;
+}
+
+static int
 load_build(UnpicklerObject *self)
 {
     PyObject *state, *inst, *slotstate;
@@ -5176,9 +5868,7 @@
         PyObject *result;
 
         /* The explicit __setstate__ is responsible for everything. */
-        /* Ugh... this does not leak since _Unpickler_FastCall() steals the
-           reference to state first. */
-        result = _Unpickler_FastCall(self, setstate, state);
+        result = _Pickle_FastCall(setstate, state);
         Py_DECREF(setstate);
         if (result == NULL)
             return -1;
@@ -5209,7 +5899,8 @@
         _Py_IDENTIFIER(__dict__);
 
         if (!PyDict_Check(state)) {
-            PyErr_SetString(UnpicklingError, "state is not a dictionary");
+            PickleState *st = _Pickle_GetGlobalState();
+            PyErr_SetString(st->UnpicklingError, "state is not a dictionary");
             goto error;
         }
         dict = _PyObject_GetAttrId(inst, &PyId___dict__);
@@ -5238,7 +5929,8 @@
         Py_ssize_t i;
 
         if (!PyDict_Check(slotstate)) {
-            PyErr_SetString(UnpicklingError,
+            PickleState *st = _Pickle_GetGlobalState();
+            PyErr_SetString(st->UnpicklingError,
                             "slot state is not a dictionary");
             goto error;
         }
@@ -5344,14 +6036,39 @@
     return -1;
 }
 
+static int
+load_frame(UnpicklerObject *self)
+{
+    char *s;
+    Py_ssize_t frame_len;
+
+    if (_Unpickler_Read(self, &s, 8) < 0)
+        return -1;
+
+    frame_len = calc_binsize(s, 8);
+    if (frame_len < 0) {
+        PyErr_Format(PyExc_OverflowError,
+                     "FRAME length exceeds system's maximum of %zd bytes",
+                     PY_SSIZE_T_MAX);
+        return -1;
+    }
+
+    if (_Unpickler_Read(self, &s, frame_len) < 0)
+        return -1;
+
+    /* Rewind to start of frame */
+    self->next_read_idx -= frame_len;
+    return 0;
+}
+
 static PyObject *
 load(UnpicklerObject *self)
 {
-    PyObject *err;
     PyObject *value = NULL;
-    char *s;
+    char *s = NULL;
 
     self->num_marks = 0;
+    self->proto = 0;
     if (Py_SIZE(self->stack))
         Pdata_clear(self->stack, 0);
 
@@ -5377,13 +6094,16 @@
         OP_ARG(LONG4, load_counted_long, 4)
         OP(FLOAT, load_float)
         OP(BINFLOAT, load_binfloat)
-        OP(BINBYTES, load_binbytes)
-        OP(SHORT_BINBYTES, load_short_binbytes)
-        OP(BINSTRING, load_binstring)
-        OP(SHORT_BINSTRING, load_short_binstring)
+        OP_ARG(SHORT_BINBYTES, load_counted_binbytes, 1)
+        OP_ARG(BINBYTES, load_counted_binbytes, 4)
+        OP_ARG(BINBYTES8, load_counted_binbytes, 8)
+        OP_ARG(SHORT_BINSTRING, load_counted_binstring, 1)
+        OP_ARG(BINSTRING, load_counted_binstring, 4)
         OP(STRING, load_string)
         OP(UNICODE, load_unicode)
-        OP(BINUNICODE, load_binunicode)
+        OP_ARG(SHORT_BINUNICODE, load_counted_binunicode, 1)
+        OP_ARG(BINUNICODE, load_counted_binunicode, 4)
+        OP_ARG(BINUNICODE8, load_counted_binunicode, 8)
         OP_ARG(EMPTY_TUPLE, load_counted_tuple, 0)
         OP_ARG(TUPLE1, load_counted_tuple, 1)
         OP_ARG(TUPLE2, load_counted_tuple, 2)
@@ -5393,10 +6113,15 @@
         OP(LIST, load_list)
         OP(EMPTY_DICT, load_empty_dict)
         OP(DICT, load_dict)
+        OP(EMPTY_SET, load_empty_set)
+        OP(ADDITEMS, load_additems)
+        OP(FROZENSET, load_frozenset)
         OP(OBJ, load_obj)
         OP(INST, load_inst)
         OP(NEWOBJ, load_newobj)
+        OP(NEWOBJ_EX, load_newobj_ex)
         OP(GLOBAL, load_global)
+        OP(STACK_GLOBAL, load_stack_global)
         OP(APPEND, load_append)
         OP(APPENDS, load_appends)
         OP(BUILD, load_build)
@@ -5408,6 +6133,7 @@
         OP(BINPUT, load_binput)
         OP(LONG_BINPUT, load_long_binput)
         OP(PUT, load_put)
+        OP(MEMOIZE, load_memoize)
         OP(POP, load_pop)
         OP(POP_MARK, load_pop_mark)
         OP(SETITEM, load_setitem)
@@ -5416,6 +6142,7 @@
         OP(BINPERSID, load_binpersid)
         OP(REDUCE, load_reduce)
         OP(PROTO, load_proto)
+        OP(FRAME, load_frame)
         OP_ARG(EXT1, load_extension, 1)
         OP_ARG(EXT2, load_extension, 2)
         OP_ARG(EXT4, load_extension, 4)
@@ -5426,81 +6153,93 @@
             break;
 
         default:
-            if (s[0] == '\0')
+            if (s[0] == '\0') {
                 PyErr_SetNone(PyExc_EOFError);
-            else
-                PyErr_Format(UnpicklingError,
+            }
+            else {
+                PickleState *st = _Pickle_GetGlobalState();
+                PyErr_Format(st->UnpicklingError,
                              "invalid load key, '%c'.", s[0]);
+            }
             return NULL;
         }
 
         break;                  /* and we are done! */
     }
 
-    if (_Unpickler_SkipConsumed(self) < 0)
-        return NULL;
-
-    /* XXX: It is not clear what this is actually for. */
-    if ((err = PyErr_Occurred())) {
-        if (err == PyExc_EOFError) {
-            PyErr_SetNone(PyExc_EOFError);
-        }
+    if (PyErr_Occurred()) {
         return NULL;
     }
 
+    if (_Unpickler_SkipConsumed(self) < 0)
+        return NULL;
+
     PDATA_POP(self->stack, value);
     return value;
 }
 
-PyDoc_STRVAR(Unpickler_load_doc,
-"load() -> object. Load a pickle."
-"\n"
-"Read a pickled object representation from the open file object given in\n"
-"the constructor, and return the reconstituted object hierarchy specified\n"
-"therein.\n");
+/*[clinic input]
+
+_pickle.Unpickler.load
+
+Load a pickle.
+
+Read a pickled object representation from the open file object given
+in the constructor, and return the reconstituted object hierarchy
+specified therein.
+[clinic start generated code]*/
 
 static PyObject *
-Unpickler_load(UnpicklerObject *self)
+_pickle_Unpickler_load_impl(UnpicklerObject *self)
+/*[clinic end generated code: output=fdcc488aad675b14 input=acbb91a42fa9b7b9]*/
 {
+    UnpicklerObject *unpickler = (UnpicklerObject*)self;
+
     /* Check whether the Unpickler was initialized correctly. This prevents
        segfaulting if a subclass overridden __init__ with a function that does
        not call Unpickler.__init__(). Here, we simply ensure that self->read
        is not NULL. */
-    if (self->read == NULL) {
-        PyErr_Format(UnpicklingError,
+    if (unpickler->read == NULL) {
+        PickleState *st = _Pickle_GetGlobalState();
+        PyErr_Format(st->UnpicklingError,
                      "Unpickler.__init__() was not called by %s.__init__()",
-                     Py_TYPE(self)->tp_name);
+                     Py_TYPE(unpickler)->tp_name);
         return NULL;
     }
 
-    return load(self);
+    return load(unpickler);
 }
 
 /* The name of find_class() is misleading. In newer pickle protocols, this
    function is used for loading any global (i.e., functions), not just
    classes. The name is kept only for backward compatibility. */
 
-PyDoc_STRVAR(Unpickler_find_class_doc,
-"find_class(module_name, global_name) -> object.\n"
-"\n"
-"Return an object from a specified module, importing the module if\n"
-"necessary.  Subclasses may override this method (e.g. to restrict\n"
-"unpickling of arbitrary classes and functions).\n"
-"\n"
-"This method is called whenever a class or a function object is\n"
-"needed.  Both arguments passed are str objects.\n");
+/*[clinic input]
+
+_pickle.Unpickler.find_class
+
+  module_name: object
+  global_name: object
+  /
+
+Return an object from a specified module.
+
+If necessary, the module will be imported. Subclasses may override
+this method (e.g. to restrict unpickling of arbitrary classes and
+functions).
+
+This method is called whenever a class or a function object is
+needed.  Both arguments passed are str objects.
+[clinic start generated code]*/
 
 static PyObject *
-Unpickler_find_class(UnpicklerObject *self, PyObject *args)
+_pickle_Unpickler_find_class_impl(UnpicklerObject *self, PyObject *module_name, PyObject *global_name)
+/*[clinic end generated code: output=64c77437e088e188 input=e2e6a865de093ef4]*/
 {
     PyObject *global;
     PyObject *modules_dict;
     PyObject *module;
-    PyObject *module_name, *global_name;
-
-    if (!PyArg_UnpackTuple(args, "find_class", 2, 2,
-                           &module_name, &global_name))
-        return NULL;
+    _Py_IDENTIFIER(modules);
 
     /* Try to map the old names used in Python 2.x to the new ones used in
        Python 3.x.  We do this only with old pickle protocols and when the
@@ -5508,13 +6247,14 @@
     if (self->proto < 3 && self->fix_imports) {
         PyObject *key;
         PyObject *item;
+        PickleState *st = _Pickle_GetGlobalState();
 
         /* Check if the global (i.e., a function or a class) was renamed
            or moved to another module. */
         key = PyTuple_Pack(2, module_name, global_name);
         if (key == NULL)
             return NULL;
-        item = PyDict_GetItemWithError(name_mapping_2to3, key);
+        item = PyDict_GetItemWithError(st->name_mapping_2to3, key);
         Py_DECREF(key);
         if (item) {
             if (!PyTuple_Check(item) || PyTuple_GET_SIZE(item) != 2) {
@@ -5540,7 +6280,7 @@
         }
 
         /* Check if the module was renamed. */
-        item = PyDict_GetItemWithError(import_mapping_2to3, module_name);
+        item = PyDict_GetItemWithError(st->import_mapping_2to3, module_name);
         if (item) {
             if (!PyUnicode_Check(item)) {
                 PyErr_Format(PyExc_RuntimeError,
@@ -5555,9 +6295,11 @@
         }
     }
 
-    modules_dict = PySys_GetObject("modules");
-    if (modules_dict == NULL)
+    modules_dict = _PySys_GetObjectId(&PyId_modules);
+    if (modules_dict == NULL) {
+        PyErr_SetString(PyExc_RuntimeError, "unable to get sys.modules");
         return NULL;
+    }
 
     module = PyDict_GetItemWithError(modules_dict, module_name);
     if (module == NULL) {
@@ -5566,20 +6308,46 @@
         module = PyImport_Import(module_name);
         if (module == NULL)
             return NULL;
-        global = PyObject_GetAttr(module, global_name);
+        global = getattribute(module, global_name, self->proto >= 4);
         Py_DECREF(module);
     }
     else {
-        global = PyObject_GetAttr(module, global_name);
+        global = getattribute(module, global_name, self->proto >= 4);
     }
     return global;
 }
 
+/*[clinic input]
+
+_pickle.Unpickler.__sizeof__ -> Py_ssize_t
+
+Returns size in memory, in bytes.
+[clinic start generated code]*/
+
+static Py_ssize_t
+_pickle_Unpickler___sizeof___impl(UnpicklerObject *self)
+/*[clinic end generated code: output=119d9d03ad4c7651 input=13333471fdeedf5e]*/
+{
+    Py_ssize_t res;
+
+    res = sizeof(UnpicklerObject);
+    if (self->memo != NULL)
+        res += self->memo_size * sizeof(PyObject *);
+    if (self->marks != NULL)
+        res += self->marks_size * sizeof(Py_ssize_t);
+    if (self->input_line != NULL)
+        res += strlen(self->input_line) + 1;
+    if (self->encoding != NULL)
+        res += strlen(self->encoding) + 1;
+    if (self->errors != NULL)
+        res += strlen(self->errors) + 1;
+    return res;
+}
+
 static struct PyMethodDef Unpickler_methods[] = {
-    {"load", (PyCFunction)Unpickler_load, METH_NOARGS,
-     Unpickler_load_doc},
-    {"find_class", (PyCFunction)Unpickler_find_class, METH_VARARGS,
-     Unpickler_find_class_doc},
+    _PICKLE_UNPICKLER_LOAD_METHODDEF
+    _PICKLE_UNPICKLER_FIND_CLASS_METHODDEF
+    _PICKLE_UNPICKLER___SIZEOF___METHODDEF
     {NULL, NULL}                /* sentinel */
 };
 
@@ -5592,7 +6360,6 @@
     Py_XDECREF(self->peek);
     Py_XDECREF(self->stack);
     Py_XDECREF(self->pers_func);
-    Py_XDECREF(self->arg);
     if (self->buffer.buf != NULL) {
         PyBuffer_Release(&self->buffer);
         self->buffer.buf = NULL;
@@ -5601,8 +6368,8 @@
     _Unpickler_MemoCleanup(self);
     PyMem_Free(self->marks);
     PyMem_Free(self->input_line);
-    free(self->encoding);
-    free(self->errors);
+    PyMem_Free(self->encoding);
+    PyMem_Free(self->errors);
 
     Py_TYPE(self)->tp_free((PyObject *)self);
 }
@@ -5615,7 +6382,6 @@
     Py_VISIT(self->peek);
     Py_VISIT(self->stack);
     Py_VISIT(self->pers_func);
-    Py_VISIT(self->arg);
     return 0;
 }
 
@@ -5627,7 +6393,6 @@
     Py_CLEAR(self->peek);
     Py_CLEAR(self->stack);
     Py_CLEAR(self->pers_func);
-    Py_CLEAR(self->arg);
     if (self->buffer.buf != NULL) {
         PyBuffer_Release(&self->buffer);
         self->buffer.buf = NULL;
@@ -5638,66 +6403,52 @@
     self->marks = NULL;
     PyMem_Free(self->input_line);
     self->input_line = NULL;
-    free(self->encoding);
+    PyMem_Free(self->encoding);
     self->encoding = NULL;
-    free(self->errors);
+    PyMem_Free(self->errors);
     self->errors = NULL;
 
     return 0;
 }
 
-PyDoc_STRVAR(Unpickler_doc,
-"Unpickler(file, *, encoding='ASCII', errors='strict')"
-"\n"
-"This takes a binary file for reading a pickle data stream.\n"
-"\n"
-"The protocol version of the pickle is detected automatically, so no\n"
-"proto argument is needed.\n"
-"\n"
-"The file-like object must have two methods, a read() method\n"
-"that takes an integer argument, and a readline() method that\n"
-"requires no arguments.  Both methods should return bytes.\n"
-"Thus file-like object can be a binary file object opened for\n"
-"reading, a BytesIO object, or any other custom object that\n"
-"meets this interface.\n"
-"\n"
-"Optional keyword arguments are *fix_imports*, *encoding* and *errors*,\n"
-"which are used to control compatiblity support for pickle stream\n"
-"generated by Python 2.x.  If *fix_imports* is True, pickle will try to\n"
-"map the old Python 2.x names to the new names used in Python 3.x.  The\n"
-"*encoding* and *errors* tell pickle how to decode 8-bit string\n"
-"instances pickled by Python 2.x; these default to 'ASCII' and\n"
-"'strict', respectively.\n");
+/*[clinic input]
+
+_pickle.Unpickler.__init__
+
+  file: object
+  *
+  fix_imports: bool = True
+  encoding: str = 'ASCII'
+  errors: str = 'strict'
+
+This takes a binary file for reading a pickle data stream.
+
+The protocol version of the pickle is detected automatically, so no
+protocol argument is needed.  Bytes past the pickled object's
+representation are ignored.
+
+The argument *file* must have two methods, a read() method that takes
+an integer argument, and a readline() method that requires no
+arguments.  Both methods should return bytes.  Thus *file* can be a
+binary file object opened for reading, a io.BytesIO object, or any
+other custom object that meets this interface.
+
+Optional keyword arguments are *fix_imports*, *encoding* and *errors*,
+which are used to control compatiblity support for pickle stream
+generated by Python 2.  If *fix_imports* is True, pickle will try to
+map the old Python 2 names to the new names used in Python 3.  The
+*encoding* and *errors* tell pickle how to decode 8-bit string
+instances pickled by Python 2; these default to 'ASCII' and 'strict',
+respectively.  The *encoding* can be 'bytes' to read these 8-bit
+string instances as bytes objects.
+[clinic start generated code]*/
 
 static int
-Unpickler_init(UnpicklerObject *self, PyObject *args, PyObject *kwds)
+_pickle_Unpickler___init___impl(UnpicklerObject *self, PyObject *file, int fix_imports, const char *encoding, const char *errors)
+/*[clinic end generated code: output=b9ed1d84d315f3b5 input=30b4dc9e976b890c]*/
 {
-    static char *kwlist[] = {"file", "fix_imports", "encoding", "errors", 0};
-    PyObject *file;
-    PyObject *fix_imports = Py_True;
-    char *encoding = NULL;
-    char *errors = NULL;
     _Py_IDENTIFIER(persistent_load);
 
-    /* XXX: That is an horrible error message. But, I don't know how to do
-       better... */
-    if (Py_SIZE(args) != 1) {
-        PyErr_Format(PyExc_TypeError,
-                     "%s takes exactly one positional argument (%zd given)",
-                     Py_TYPE(self)->tp_name, Py_SIZE(args));
-        return -1;
-    }
-
-    /* Arguments parsing needs to be done in the __init__() method to allow
-       subclasses to define their own __init__() method, which may (or may
-       not) support Unpickler arguments. However, this means we need to be
-       extra careful in the other Unpickler methods, since a subclass could
-       forget to call Unpickler.__init__() thus breaking our internal
-       invariants. */
-    if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|Oss:Unpickler", kwlist,
-                                     &file, &fix_imports, &encoding, &errors))
-        return -1;
-
     /* In case of multiple __init__() calls, clear previous content. */
     if (self->read != NULL)
         (void)Unpickler_clear(self);
@@ -5708,7 +6459,7 @@
     if (_Unpickler_SetInputEncoding(self, encoding, errors) < 0)
         return -1;
 
-    self->fix_imports = PyObject_IsTrue(fix_imports);
+    self->fix_imports = fix_imports;
     if (self->fix_imports == -1)
         return -1;
 
@@ -5716,7 +6467,7 @@
         self->pers_func = _PyObject_GetAttrId((PyObject *)self,
                                               &PyId_persistent_load);
         if (self->pers_func == NULL)
-            return -1;
+            return 1;
     }
     else {
         self->pers_func = NULL;
@@ -5724,19 +6475,19 @@
 
     self->stack = (Pdata *)Pdata_New();
     if (self->stack == NULL)
-        return -1;
+        return 1;
 
     self->memo_size = 32;
     self->memo = _Unpickler_NewMemo(self->memo_size);
     if (self->memo == NULL)
         return -1;
 
-    self->arg = NULL;
     self->proto = 0;
 
     return 0;
 }
 
+
 /* Define a proxy object for the Unpickler's internal memo object. This is to
  * avoid breaking code like:
  *  unpickler.memo.clear()
@@ -5750,16 +6501,15 @@
  * real-world code like cvs2svn.
  */
 
-typedef struct {
-    PyObject_HEAD
-    UnpicklerObject *unpickler;
-} UnpicklerMemoProxyObject;
+/*[clinic input]
+_pickle.UnpicklerMemoProxy.clear
 
-PyDoc_STRVAR(ump_clear_doc,
-"memo.clear() -> None.  Remove all items from memo.");
+Remove all items from memo.
+[clinic start generated code]*/
 
 static PyObject *
-ump_clear(UnpicklerMemoProxyObject *self)
+_pickle_UnpicklerMemoProxy_clear_impl(UnpicklerMemoProxyObject *self)
+/*[clinic end generated code: output=d20cd43f4ba1fb1f input=b1df7c52e7afd9bd]*/
 {
     _Unpickler_MemoCleanup(self->unpickler);
     self->unpickler->memo = _Unpickler_NewMemo(self->unpickler->memo_size);
@@ -5768,11 +6518,15 @@
     Py_RETURN_NONE;
 }
 
-PyDoc_STRVAR(ump_copy_doc,
-"memo.copy() -> new_memo.  Copy the memo to a new object.");
+/*[clinic input]
+_pickle.UnpicklerMemoProxy.copy
+
+Copy the memo to a new object.
+[clinic start generated code]*/
 
 static PyObject *
-ump_copy(UnpicklerMemoProxyObject *self)
+_pickle_UnpicklerMemoProxy_copy_impl(UnpicklerMemoProxyObject *self)
+/*[clinic end generated code: output=e12af7e9bc1e4c77 input=97769247ce032c1d]*/
 {
     Py_ssize_t i;
     PyObject *new_memo = PyDict_New();
@@ -5802,15 +6556,19 @@
     return NULL;
 }
 
-PyDoc_STRVAR(ump_reduce_doc,
-"memo.__reduce__(). Pickling support.");
+/*[clinic input]
+_pickle.UnpicklerMemoProxy.__reduce__
+
+Implement pickling support.
+[clinic start generated code]*/
 
 static PyObject *
-ump_reduce(UnpicklerMemoProxyObject *self, PyObject *args)
+_pickle_UnpicklerMemoProxy___reduce___impl(UnpicklerMemoProxyObject *self)
+/*[clinic end generated code: output=6da34ac048d94cca input=6920862413407199]*/
 {
     PyObject *reduce_value;
     PyObject *constructor_args;
-    PyObject *contents = ump_copy(self);
+    PyObject *contents = _pickle_UnpicklerMemoProxy_copy_impl(self);
     if (contents == NULL)
         return NULL;
 
@@ -5833,9 +6591,9 @@
 }
 
 static PyMethodDef unpicklerproxy_methods[] = {
-    {"clear",       (PyCFunction)ump_clear,  METH_NOARGS,  ump_clear_doc},
-    {"copy",        (PyCFunction)ump_copy,   METH_NOARGS,  ump_copy_doc},
-    {"__reduce__",  (PyCFunction)ump_reduce, METH_VARARGS, ump_reduce_doc},
+    _PICKLE_UNPICKLERMEMOPROXY_CLEAR_METHODDEF
+    _PICKLE_UNPICKLERMEMOPROXY_COPY_METHODDEF
+    _PICKLE_UNPICKLERMEMOPROXY___REDUCE___METHODDEF
     {NULL, NULL}    /* sentinel */
 };
 
@@ -6059,7 +6817,7 @@
     0,                                  /*tp_setattro*/
     0,                                  /*tp_as_buffer*/
     Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,
-    Unpickler_doc,                      /*tp_doc*/
+    _pickle_Unpickler___init____doc__,  /*tp_doc*/
     (traverseproc)Unpickler_traverse,   /*tp_traverse*/
     (inquiry)Unpickler_clear,           /*tp_clear*/
     0,                                  /*tp_richcompare*/
@@ -6074,63 +6832,56 @@
     0,                                  /*tp_descr_get*/
     0,                                  /*tp_descr_set*/
     0,                                  /*tp_dictoffset*/
-    (initproc)Unpickler_init,           /*tp_init*/
+    _pickle_Unpickler___init__,         /*tp_init*/
     PyType_GenericAlloc,                /*tp_alloc*/
     PyType_GenericNew,                  /*tp_new*/
     PyObject_GC_Del,                    /*tp_free*/
     0,                                  /*tp_is_gc*/
 };
 
-PyDoc_STRVAR(pickle_dump_doc,
-"dump(obj, file, protocol=None, *, fix_imports=True) -> None\n"
-"\n"
-"Write a pickled representation of obj to the open file object file.  This\n"
-"is equivalent to ``Pickler(file, protocol).dump(obj)``, but may be more\n"
-"efficient.\n"
-"\n"
-"The optional protocol argument tells the pickler to use the given protocol;\n"
-"supported protocols are 0, 1, 2, 3.  The default protocol is 3; a\n"
-"backward-incompatible protocol designed for Python 3.0.\n"
-"\n"
-"Specifying a negative protocol version selects the highest protocol version\n"
-"supported.  The higher the protocol used, the more recent the version of\n"
-"Python needed to read the pickle produced.\n"
-"\n"
-"The file argument must have a write() method that accepts a single bytes\n"
-"argument.  It can thus be a file object opened for binary writing, a\n"
-"io.BytesIO instance, or any other custom object that meets this interface.\n"
-"\n"
-"If fix_imports is True and protocol is less than 3, pickle will try to\n"
-"map the new Python 3.x names to the old module names used in Python 2.x,\n"
-"so that the pickle data stream is readable with Python 2.x.\n");
+/*[clinic input]
+
+_pickle.dump
+
+  obj: object
+  file: object
+  protocol: object = NULL
+  *
+  fix_imports: bool = True
+
+Write a pickled representation of obj to the open file object file.
+
+This is equivalent to ``Pickler(file, protocol).dump(obj)``, but may
+be more efficient.
+
+The optional *protocol* argument tells the pickler to use the given
+protocol supported protocols are 0, 1, 2, 3 and 4.  The default
+protocol is 3; a backward-incompatible protocol designed for Python 3.
+
+Specifying a negative protocol version selects the highest protocol
+version supported.  The higher the protocol used, the more recent the
+version of Python needed to read the pickle produced.
+
+The *file* argument must have a write() method that accepts a single
+bytes argument.  It can thus be a file object opened for binary
+writing, a io.BytesIO instance, or any other custom object that meets
+this interface.
+
+If *fix_imports* is True and protocol is less than 3, pickle will try
+to map the new Python 3 names to the old module names used in Python
+2, so that the pickle data stream is readable with Python 2.
+[clinic start generated code]*/
 
 static PyObject *
-pickle_dump(PyObject *self, PyObject *args, PyObject *kwds)
+_pickle_dump_impl(PyModuleDef *module, PyObject *obj, PyObject *file, PyObject *protocol, int fix_imports)
+/*[clinic end generated code: output=a606e626d553850d input=e9e5fdd48de92eae]*/
 {
-    static char *kwlist[] = {"obj", "file", "protocol", "fix_imports", 0};
-    PyObject *obj;
-    PyObject *file;
-    PyObject *proto = NULL;
-    PyObject *fix_imports = Py_True;
-    PicklerObject *pickler;
+    PicklerObject *pickler = _Pickler_New();
 
-    /* fix_imports is a keyword-only argument.  */
-    if (Py_SIZE(args) > 3) {
-        PyErr_Format(PyExc_TypeError,
-                     "pickle.dump() takes at most 3 positional "
-                     "argument (%zd given)", Py_SIZE(args));
-        return NULL;
-    }
-
-    if (!PyArg_ParseTupleAndKeywords(args, kwds, "OO|OO:dump", kwlist,
-                                     &obj, &file, &proto, &fix_imports))
-        return NULL;
-
-    pickler = _Pickler_New();
     if (pickler == NULL)
         return NULL;
 
-    if (_Pickler_SetProtocol(pickler, proto, fix_imports) < 0)
+    if (_Pickler_SetProtocol(pickler, protocol, fix_imports) < 0)
         goto error;
 
     if (_Pickler_SetOutputStream(pickler, file) < 0)
@@ -6150,51 +6901,41 @@
     return NULL;
 }
 
-PyDoc_STRVAR(pickle_dumps_doc,
-"dumps(obj, protocol=None, *, fix_imports=True) -> bytes\n"
-"\n"
-"Return the pickled representation of the object as a bytes\n"
-"object, instead of writing it to a file.\n"
-"\n"
-"The optional protocol argument tells the pickler to use the given protocol;\n"
-"supported protocols are 0, 1, 2, 3.  The default protocol is 3; a\n"
-"backward-incompatible protocol designed for Python 3.0.\n"
-"\n"
-"Specifying a negative protocol version selects the highest protocol version\n"
-"supported.  The higher the protocol used, the more recent the version of\n"
-"Python needed to read the pickle produced.\n"
-"\n"
-"If fix_imports is True and *protocol* is less than 3, pickle will try to\n"
-"map the new Python 3.x names to the old module names used in Python 2.x,\n"
-"so that the pickle data stream is readable with Python 2.x.\n");
+/*[clinic input]
+
+_pickle.dumps
+
+  obj: object
+  protocol: object = NULL
+  *
+  fix_imports: bool = True
+
+Return the pickled representation of the object as a bytes object.
+
+The optional *protocol* argument tells the pickler to use the given
+protocol; supported protocols are 0, 1, 2, 3 and 4.  The default
+protocol is 3; a backward-incompatible protocol designed for Python 3.
+
+Specifying a negative protocol version selects the highest protocol
+version supported.  The higher the protocol used, the more recent the
+version of Python needed to read the pickle produced.
+
+If *fix_imports* is True and *protocol* is less than 3, pickle will
+try to map the new Python 3 names to the old module names used in
+Python 2, so that the pickle data stream is readable with Python 2.
+[clinic start generated code]*/
 
 static PyObject *
-pickle_dumps(PyObject *self, PyObject *args, PyObject *kwds)
+_pickle_dumps_impl(PyModuleDef *module, PyObject *obj, PyObject *protocol, int fix_imports)
+/*[clinic end generated code: output=777f0deefe5b88ee input=293dbeda181580b7]*/
 {
-    static char *kwlist[] = {"obj", "protocol", "fix_imports", 0};
-    PyObject *obj;
-    PyObject *proto = NULL;
     PyObject *result;
-    PyObject *fix_imports = Py_True;
-    PicklerObject *pickler;
+    PicklerObject *pickler = _Pickler_New();
 
-    /* fix_imports is a keyword-only argument.  */
-    if (Py_SIZE(args) > 2) {
-        PyErr_Format(PyExc_TypeError,
-                     "pickle.dumps() takes at most 2 positional "
-                     "argument (%zd given)", Py_SIZE(args));
-        return NULL;
-    }
-
-    if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|OO:dumps", kwlist,
-                                     &obj, &proto, &fix_imports))
-        return NULL;
-
-    pickler = _Pickler_New();
     if (pickler == NULL)
         return NULL;
 
-    if (_Pickler_SetProtocol(pickler, proto, fix_imports) < 0)
+    if (_Pickler_SetProtocol(pickler, protocol, fix_imports) < 0)
         goto error;
 
     if (dump(pickler, obj) < 0)
@@ -6209,54 +6950,48 @@
     return NULL;
 }
 
-PyDoc_STRVAR(pickle_load_doc,
-"load(file, *, fix_imports=True, encoding='ASCII', errors='strict') -> object\n"
-"\n"
-"Read a pickled object representation from the open file object file and\n"
-"return the reconstituted object hierarchy specified therein.  This is\n"
-"equivalent to ``Unpickler(file).load()``, but may be more efficient.\n"
-"\n"
-"The protocol version of the pickle is detected automatically, so no protocol\n"
-"argument is needed.  Bytes past the pickled object's representation are\n"
-"ignored.\n"
-"\n"
-"The argument file must have two methods, a read() method that takes an\n"
-"integer argument, and a readline() method that requires no arguments.  Both\n"
-"methods should return bytes.  Thus *file* can be a binary file object opened\n"
-"for reading, a BytesIO object, or any other custom object that meets this\n"
-"interface.\n"
-"\n"
-"Optional keyword arguments are fix_imports, encoding and errors,\n"
-"which are used to control compatiblity support for pickle stream generated\n"
-"by Python 2.x.  If fix_imports is True, pickle will try to map the old\n"
-"Python 2.x names to the new names used in Python 3.x.  The encoding and\n"
-"errors tell pickle how to decode 8-bit string instances pickled by Python\n"
-"2.x; these default to 'ASCII' and 'strict', respectively.\n");
+/*[clinic input]
+
+_pickle.load
+
+  file: object
+  *
+  fix_imports: bool = True
+  encoding: str = 'ASCII'
+  errors: str = 'strict'
+
+Read and return an object from the pickle data stored in a file.
+
+This is equivalent to ``Unpickler(file).load()``, but may be more
+efficient.
+
+The protocol version of the pickle is detected automatically, so no
+protocol argument is needed.  Bytes past the pickled object's
+representation are ignored.
+
+The argument *file* must have two methods, a read() method that takes
+an integer argument, and a readline() method that requires no
+arguments.  Both methods should return bytes.  Thus *file* can be a
+binary file object opened for reading, a io.BytesIO object, or any
+other custom object that meets this interface.
+
+Optional keyword arguments are *fix_imports*, *encoding* and *errors*,
+which are used to control compatiblity support for pickle stream
+generated by Python 2.  If *fix_imports* is True, pickle will try to
+map the old Python 2 names to the new names used in Python 3.  The
+*encoding* and *errors* tell pickle how to decode 8-bit string
+instances pickled by Python 2; these default to 'ASCII' and 'strict',
+respectively.  The *encoding* can be 'bytes' to read these 8-bit
+string instances as bytes objects.
+[clinic start generated code]*/
 
 static PyObject *
-pickle_load(PyObject *self, PyObject *args, PyObject *kwds)
+_pickle_load_impl(PyModuleDef *module, PyObject *file, int fix_imports, const char *encoding, const char *errors)
+/*[clinic end generated code: output=568c61356c172654 input=da97372e38e510a6]*/
 {
-    static char *kwlist[] = {"file", "fix_imports", "encoding", "errors", 0};
-    PyObject *file;
-    PyObject *fix_imports = Py_True;
     PyObject *result;
-    char *encoding = NULL;
-    char *errors = NULL;
-    UnpicklerObject *unpickler;
+    UnpicklerObject *unpickler = _Unpickler_New();
 
-    /* fix_imports, encoding and errors are a keyword-only argument.  */
-    if (Py_SIZE(args) != 1) {
-        PyErr_Format(PyExc_TypeError,
-                     "pickle.load() takes exactly one positional "
-                     "argument (%zd given)", Py_SIZE(args));
-        return NULL;
-    }
-
-    if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|Oss:load", kwlist,
-                                     &file, &fix_imports, &encoding, &errors))
-        return NULL;
-
-    unpickler = _Unpickler_New();
     if (unpickler == NULL)
         return NULL;
 
@@ -6266,9 +7001,7 @@
     if (_Unpickler_SetInputEncoding(unpickler, encoding, errors) < 0)
         goto error;
 
-    unpickler->fix_imports = PyObject_IsTrue(fix_imports);
-    if (unpickler->fix_imports == -1)
-        goto error;
+    unpickler->fix_imports = fix_imports;
 
     result = load(unpickler);
     Py_DECREF(unpickler);
@@ -6279,59 +7012,49 @@
     return NULL;
 }
 
-PyDoc_STRVAR(pickle_loads_doc,
-"loads(input, *, fix_imports=True, encoding='ASCII', errors='strict') -> object\n"
-"\n"
-"Read a pickled object hierarchy from a bytes object and return the\n"
-"reconstituted object hierarchy specified therein\n"
-"\n"
-"The protocol version of the pickle is detected automatically, so no protocol\n"
-"argument is needed.  Bytes past the pickled object's representation are\n"
-"ignored.\n"
-"\n"
-"Optional keyword arguments are fix_imports, encoding and errors, which\n"
-"are used to control compatiblity support for pickle stream generated\n"
-"by Python 2.x.  If fix_imports is True, pickle will try to map the old\n"
-"Python 2.x names to the new names used in Python 3.x.  The encoding and\n"
-"errors tell pickle how to decode 8-bit string instances pickled by Python\n"
-"2.x; these default to 'ASCII' and 'strict', respectively.\n");
+/*[clinic input]
+
+_pickle.loads
+
+  data: object
+  *
+  fix_imports: bool = True
+  encoding: str = 'ASCII'
+  errors: str = 'strict'
+
+Read and return an object from the given pickle data.
+
+The protocol version of the pickle is detected automatically, so no
+protocol argument is needed.  Bytes past the pickled object's
+representation are ignored.
+
+Optional keyword arguments are *fix_imports*, *encoding* and *errors*,
+which are used to control compatiblity support for pickle stream
+generated by Python 2.  If *fix_imports* is True, pickle will try to
+map the old Python 2 names to the new names used in Python 3.  The
+*encoding* and *errors* tell pickle how to decode 8-bit string
+instances pickled by Python 2; these default to 'ASCII' and 'strict',
+respectively.  The *encoding* can be 'bytes' to read these 8-bit
+string instances as bytes objects.
+[clinic start generated code]*/
 
 static PyObject *
-pickle_loads(PyObject *self, PyObject *args, PyObject *kwds)
+_pickle_loads_impl(PyModuleDef *module, PyObject *data, int fix_imports, const char *encoding, const char *errors)
+/*[clinic end generated code: output=0b3845ad110b2522 input=f57f0fdaa2b4cb8b]*/
 {
-    static char *kwlist[] = {"input", "fix_imports", "encoding", "errors", 0};
-    PyObject *input;
-    PyObject *fix_imports = Py_True;
     PyObject *result;
-    char *encoding = NULL;
-    char *errors = NULL;
-    UnpicklerObject *unpickler;
+    UnpicklerObject *unpickler = _Unpickler_New();
 
-    /* fix_imports, encoding and errors are a keyword-only argument.  */
-    if (Py_SIZE(args) != 1) {
-        PyErr_Format(PyExc_TypeError,
-                     "pickle.loads() takes exactly one positional "
-                     "argument (%zd given)", Py_SIZE(args));
-        return NULL;
-    }
-
-    if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|Oss:loads", kwlist,
-                                     &input, &fix_imports, &encoding, &errors))
-        return NULL;
-
-    unpickler = _Unpickler_New();
     if (unpickler == NULL)
         return NULL;
 
-    if (_Unpickler_SetStringInput(unpickler, input) < 0)
+    if (_Unpickler_SetStringInput(unpickler, data) < 0)
         goto error;
 
     if (_Unpickler_SetInputEncoding(unpickler, encoding, errors) < 0)
         goto error;
 
-    unpickler->fix_imports = PyObject_IsTrue(fix_imports);
-    if (unpickler->fix_imports == -1)
-        goto error;
+    unpickler->fix_imports = fix_imports;
 
     result = load(unpickler);
     Py_DECREF(unpickler);
@@ -6342,139 +7065,69 @@
     return NULL;
 }
 
-
 static struct PyMethodDef pickle_methods[] = {
-    {"dump",  (PyCFunction)pickle_dump,  METH_VARARGS|METH_KEYWORDS,
-     pickle_dump_doc},
-    {"dumps", (PyCFunction)pickle_dumps, METH_VARARGS|METH_KEYWORDS,
-     pickle_dumps_doc},
-    {"load",  (PyCFunction)pickle_load,  METH_VARARGS|METH_KEYWORDS,
-     pickle_load_doc},
-    {"loads", (PyCFunction)pickle_loads, METH_VARARGS|METH_KEYWORDS,
-     pickle_loads_doc},
+    _PICKLE_DUMP_METHODDEF
+    _PICKLE_DUMPS_METHODDEF
+    _PICKLE_LOAD_METHODDEF
+    _PICKLE_LOADS_METHODDEF
     {NULL, NULL} /* sentinel */
 };
 
 static int
-initmodule(void)
+pickle_clear(PyObject *m)
 {
-    PyObject *copyreg = NULL;
-    PyObject *compat_pickle = NULL;
-
-    /* XXX: We should ensure that the types of the dictionaries imported are
-       exactly PyDict objects. Otherwise, it is possible to crash the pickle
-       since we use the PyDict API directly to access these dictionaries. */
-
-    copyreg = PyImport_ImportModule("copyreg");
-    if (!copyreg)
-        goto error;
-    dispatch_table = PyObject_GetAttrString(copyreg, "dispatch_table");
-    if (!dispatch_table)
-        goto error;
-    extension_registry = \
-        PyObject_GetAttrString(copyreg, "_extension_registry");
-    if (!extension_registry)
-        goto error;
-    inverted_registry = PyObject_GetAttrString(copyreg, "_inverted_registry");
-    if (!inverted_registry)
-        goto error;
-    extension_cache = PyObject_GetAttrString(copyreg, "_extension_cache");
-    if (!extension_cache)
-        goto error;
-    Py_CLEAR(copyreg);
-
-    /* Load the 2.x -> 3.x stdlib module mapping tables */
-    compat_pickle = PyImport_ImportModule("_compat_pickle");
-    if (!compat_pickle)
-        goto error;
-    name_mapping_2to3 = PyObject_GetAttrString(compat_pickle, "NAME_MAPPING");
-    if (!name_mapping_2to3)
-        goto error;
-    if (!PyDict_CheckExact(name_mapping_2to3)) {
-        PyErr_Format(PyExc_RuntimeError,
-                     "_compat_pickle.NAME_MAPPING should be a dict, not %.200s",
-                     Py_TYPE(name_mapping_2to3)->tp_name);
-        goto error;
-    }
-    import_mapping_2to3 = PyObject_GetAttrString(compat_pickle,
-                                                 "IMPORT_MAPPING");
-    if (!import_mapping_2to3)
-        goto error;
-    if (!PyDict_CheckExact(import_mapping_2to3)) {
-        PyErr_Format(PyExc_RuntimeError,
-                     "_compat_pickle.IMPORT_MAPPING should be a dict, "
-                     "not %.200s", Py_TYPE(import_mapping_2to3)->tp_name);
-        goto error;
-    }
-    /* ... and the 3.x -> 2.x mapping tables */
-    name_mapping_3to2 = PyObject_GetAttrString(compat_pickle,
-                                               "REVERSE_NAME_MAPPING");
-    if (!name_mapping_3to2)
-        goto error;
-    if (!PyDict_CheckExact(name_mapping_3to2)) {
-        PyErr_Format(PyExc_RuntimeError,
-                     "_compat_pickle.REVERSE_NAME_MAPPING should be a dict, "
-                     "not %.200s", Py_TYPE(name_mapping_3to2)->tp_name);
-        goto error;
-    }
-    import_mapping_3to2 = PyObject_GetAttrString(compat_pickle,
-                                                 "REVERSE_IMPORT_MAPPING");
-    if (!import_mapping_3to2)
-        goto error;
-    if (!PyDict_CheckExact(import_mapping_3to2)) {
-        PyErr_Format(PyExc_RuntimeError,
-                     "_compat_pickle.REVERSE_IMPORT_MAPPING should be a dict, "
-                     "not %.200s", Py_TYPE(import_mapping_3to2)->tp_name);
-        goto error;
-    }
-    Py_CLEAR(compat_pickle);
-
-    empty_tuple = PyTuple_New(0);
-    if (empty_tuple == NULL)
-        goto error;
-    two_tuple = PyTuple_New(2);
-    if (two_tuple == NULL)
-        goto error;
-    /* We use this temp container with no regard to refcounts, or to
-     * keeping containees alive.  Exempt from GC, because we don't
-     * want anything looking at two_tuple() by magic.
-     */
-    PyObject_GC_UnTrack(two_tuple);
-
+    _Pickle_ClearState(_Pickle_GetState(m));
     return 0;
+}
 
-  error:
-    Py_CLEAR(copyreg);
-    Py_CLEAR(dispatch_table);
-    Py_CLEAR(extension_registry);
-    Py_CLEAR(inverted_registry);
-    Py_CLEAR(extension_cache);
-    Py_CLEAR(compat_pickle);
-    Py_CLEAR(name_mapping_2to3);
-    Py_CLEAR(import_mapping_2to3);
-    Py_CLEAR(name_mapping_3to2);
-    Py_CLEAR(import_mapping_3to2);
-    Py_CLEAR(empty_tuple);
-    Py_CLEAR(two_tuple);
-    return -1;
+static void
+pickle_free(PyObject *m)
+{
+    _Pickle_ClearState(_Pickle_GetState(m));
+}
+
+static int
+pickle_traverse(PyObject *m, visitproc visit, void *arg)
+{
+    PickleState *st = _Pickle_GetState(m);
+    Py_VISIT(st->PickleError);
+    Py_VISIT(st->PicklingError);
+    Py_VISIT(st->UnpicklingError);
+    Py_VISIT(st->dispatch_table);
+    Py_VISIT(st->extension_registry);
+    Py_VISIT(st->extension_cache);
+    Py_VISIT(st->inverted_registry);
+    Py_VISIT(st->name_mapping_2to3);
+    Py_VISIT(st->import_mapping_2to3);
+    Py_VISIT(st->name_mapping_3to2);
+    Py_VISIT(st->import_mapping_3to2);
+    Py_VISIT(st->codecs_encode);
+    return 0;
 }
 
 static struct PyModuleDef _picklemodule = {
     PyModuleDef_HEAD_INIT,
-    "_pickle",
-    pickle_module_doc,
-    -1,
-    pickle_methods,
-    NULL,
-    NULL,
-    NULL,
-    NULL
+    "_pickle",            /* m_name */
+    pickle_module_doc,    /* m_doc */
+    sizeof(PickleState),  /* m_size */
+    pickle_methods,       /* m_methods */
+    NULL,                 /* m_reload */
+    pickle_traverse,      /* m_traverse */
+    pickle_clear,         /* m_clear */
+    (freefunc)pickle_free /* m_free */
 };
 
 PyMODINIT_FUNC
 PyInit__pickle(void)
 {
     PyObject *m;
+    PickleState *st;
+
+    m = PyState_FindModule(&_picklemodule);
+    if (m) {
+        Py_INCREF(m);
+        return m;
+    }
 
     if (PyType_Ready(&Unpickler_Type) < 0)
         return NULL;
@@ -6499,27 +7152,32 @@
     if (PyModule_AddObject(m, "Unpickler", (PyObject *)&Unpickler_Type) < 0)
         return NULL;
 
+    st = _Pickle_GetState(m);
+
     /* Initialize the exceptions. */
-    PickleError = PyErr_NewException("_pickle.PickleError", NULL, NULL);
-    if (PickleError == NULL)
+    st->PickleError = PyErr_NewException("_pickle.PickleError", NULL, NULL);
+    if (st->PickleError == NULL)
         return NULL;
-    PicklingError = \
-        PyErr_NewException("_pickle.PicklingError", PickleError, NULL);
-    if (PicklingError == NULL)
+    st->PicklingError = \
+        PyErr_NewException("_pickle.PicklingError", st->PickleError, NULL);
+    if (st->PicklingError == NULL)
         return NULL;
-    UnpicklingError = \
-        PyErr_NewException("_pickle.UnpicklingError", PickleError, NULL);
-    if (UnpicklingError == NULL)
+    st->UnpicklingError = \
+        PyErr_NewException("_pickle.UnpicklingError", st->PickleError, NULL);
+    if (st->UnpicklingError == NULL)
         return NULL;
 
-    if (PyModule_AddObject(m, "PickleError", PickleError) < 0)
+    Py_INCREF(st->PickleError);
+    if (PyModule_AddObject(m, "PickleError", st->PickleError) < 0)
         return NULL;
-    if (PyModule_AddObject(m, "PicklingError", PicklingError) < 0)
+    Py_INCREF(st->PicklingError);
+    if (PyModule_AddObject(m, "PicklingError", st->PicklingError) < 0)
         return NULL;
-    if (PyModule_AddObject(m, "UnpicklingError", UnpicklingError) < 0)
+    Py_INCREF(st->UnpicklingError);
+    if (PyModule_AddObject(m, "UnpicklingError", st->UnpicklingError) < 0)
         return NULL;
 
-    if (initmodule() < 0)
+    if (_Pickle_InitState(st) < 0)
         return NULL;
 
     return m;
diff --git a/Modules/_posixsubprocess.c b/Modules/_posixsubprocess.c
index 0196ca2..a8c2be2 100644
--- a/Modules/_posixsubprocess.c
+++ b/Modules/_posixsubprocess.c
@@ -18,6 +18,12 @@
 #include <dirent.h>
 #endif
 
+#if defined(__ANDROID__) && !defined(SYS_getdents64)
+/* Android doesn't expose syscalls, add the definition manually. */
+# include <sys/linux-syscalls.h>
+# define SYS_getdents64  __NR_getdents64
+#endif
+
 #if defined(sun)
 /* readdir64 is used to work around Solaris 9 bug 6395699. */
 # define readdir readdir64
@@ -35,11 +41,7 @@
 # define FD_DIR "/proc/self/fd"
 #endif
 
-#define POSIX_CALL(call)   if ((call) == -1) goto error
-
-
-/* Maximum file descriptor, initialized on module load. */
-static long max_fd;
+#define POSIX_CALL(call)   do { if ((call) == -1) goto error; } while (0)
 
 
 /* Given the gc module call gc.enable() and return 0 on success. */
@@ -87,7 +89,7 @@
     if (stat("/dev", &dev_stat) != 0)
         return 0;
     if (stat(FD_DIR, &dev_fd_stat) != 0)
-        return 0; 
+        return 0;
     if (dev_stat.st_dev == dev_fd_stat.st_dev)
         return 0;  /* / == /dev == /dev/fd means it is static. #fail */
     return 1;
@@ -136,15 +138,63 @@
     return 0;
 }
 
+static int
+make_inheritable(PyObject *py_fds_to_keep, int errpipe_write)
+{
+    Py_ssize_t i, len;
 
-/* Close all file descriptors in the range start_fd inclusive to
- * end_fd exclusive except for those in py_fds_to_keep.  If the
- * range defined by [start_fd, end_fd) is large this will take a
- * long time as it calls close() on EVERY possible fd.
+    len = PySequence_Length(py_fds_to_keep);
+    for (i = 0; i < len; ++i) {
+        PyObject* fdobj = PySequence_Fast_GET_ITEM(py_fds_to_keep, i);
+        long fd = PyLong_AsLong(fdobj);
+        assert(!PyErr_Occurred());
+        assert(0 <= fd && fd <= INT_MAX);
+        if (fd == errpipe_write) {
+            /* errpipe_write is part of py_fds_to_keep. It must be closed at
+               exec(), but kept open in the child process until exec() is
+               called. */
+            continue;
+        }
+        if (_Py_set_inheritable((int)fd, 1, NULL) < 0)
+            return -1;
+    }
+    return 0;
+}
+
+
+/* Get the maximum file descriptor that could be opened by this process.
+ * This function is async signal safe for use between fork() and exec().
+ */
+static long
+safe_get_max_fd(void)
+{
+    long local_max_fd;
+#if defined(__NetBSD__)
+    local_max_fd = fcntl(0, F_MAXFD);
+    if (local_max_fd >= 0)
+        return local_max_fd;
+#endif
+#ifdef _SC_OPEN_MAX
+    local_max_fd = sysconf(_SC_OPEN_MAX);
+    if (local_max_fd == -1)
+#endif
+        local_max_fd = 256;  /* Matches legacy Lib/subprocess.py behavior. */
+    return local_max_fd;
+}
+
+
+/* Close all file descriptors in the range from start_fd and higher
+ * except for those in py_fds_to_keep.  If the range defined by
+ * [start_fd, safe_get_max_fd()) is large this will take a long
+ * time as it calls close() on EVERY possible fd.
+ *
+ * It isn't possible to know for sure what the max fd to go up to
+ * is for processes with the capability of raising their maximum.
  */
 static void
-_close_fds_by_brute_force(int start_fd, int end_fd, PyObject *py_fds_to_keep)
+_close_fds_by_brute_force(long start_fd, PyObject *py_fds_to_keep)
 {
+    long end_fd = safe_get_max_fd();
     Py_ssize_t num_fds_to_keep = PySequence_Length(py_fds_to_keep);
     Py_ssize_t keep_seq_idx;
     int fd_num;
@@ -184,8 +234,8 @@
    char           d_name[256];  /* Filename (null-terminated) */
 };
 
-/* Close all open file descriptors in the range start_fd inclusive to end_fd
- * exclusive. Do not close any in the sorted py_fds_to_keep list.
+/* Close all open file descriptors in the range from start_fd and higher
+ * Do not close any in the sorted py_fds_to_keep list.
  *
  * This version is async signal safe as it does not make any unsafe C library
  * calls, malloc calls or handle any locks.  It is _unfortunate_ to be forced
@@ -200,26 +250,14 @@
  * it with some cpp #define magic to work on other OSes as well if you want.
  */
 static void
-_close_open_fd_range_safe(int start_fd, int end_fd, PyObject* py_fds_to_keep)
+_close_open_fds_safe(int start_fd, PyObject* py_fds_to_keep)
 {
     int fd_dir_fd;
-    if (start_fd >= end_fd)
-        return;
-#ifdef O_CLOEXEC
-    fd_dir_fd = open(FD_DIR, O_RDONLY | O_CLOEXEC, 0);
-#else
-    fd_dir_fd = open(FD_DIR, O_RDONLY, 0);
-#ifdef FD_CLOEXEC
-    {
-        int old = fcntl(fd_dir_fd, F_GETFD);
-        if (old != -1)
-            fcntl(fd_dir_fd, F_SETFD, old | FD_CLOEXEC);
-    }
-#endif
-#endif
+
+    fd_dir_fd = _Py_open(FD_DIR, O_RDONLY);
     if (fd_dir_fd == -1) {
         /* No way to get a list of open fds. */
-        _close_fds_by_brute_force(start_fd, end_fd, py_fds_to_keep);
+        _close_fds_by_brute_force(start_fd, py_fds_to_keep);
         return;
     } else {
         char buffer[sizeof(struct linux_dirent64)];
@@ -234,23 +272,23 @@
                 entry = (struct linux_dirent64 *)(buffer + offset);
                 if ((fd = _pos_int_from_ascii(entry->d_name)) < 0)
                     continue;  /* Not a number. */
-                if (fd != fd_dir_fd && fd >= start_fd && fd < end_fd &&
+                if (fd != fd_dir_fd && fd >= start_fd &&
                     !_is_fd_in_sorted_fd_sequence(fd, py_fds_to_keep)) {
                     while (close(fd) < 0 && errno == EINTR);
                 }
             }
         }
-        close(fd_dir_fd);
+        while (close(fd_dir_fd) < 0 && errno == EINTR);
     }
 }
 
-#define _close_open_fd_range _close_open_fd_range_safe
+#define _close_open_fds _close_open_fds_safe
 
 #else  /* NOT (defined(__linux__) && defined(HAVE_SYS_SYSCALL_H)) */
 
 
-/* Close all open file descriptors in the range start_fd inclusive to end_fd
- * exclusive. Do not close any in the sorted py_fds_to_keep list.
+/* Close all open file descriptors from start_fd and higher.
+ * Do not close any in the sorted py_fds_to_keep list.
  *
  * This function violates the strict use of async signal safe functions. :(
  * It calls opendir(), readdir() and closedir().  Of these, the one most
@@ -263,17 +301,13 @@
  *   http://womble.decadent.org.uk/readdir_r-advisory.html
  */
 static void
-_close_open_fd_range_maybe_unsafe(int start_fd, int end_fd,
-                                  PyObject* py_fds_to_keep)
+_close_open_fds_maybe_unsafe(long start_fd, PyObject* py_fds_to_keep)
 {
     DIR *proc_fd_dir;
 #ifndef HAVE_DIRFD
-    while (_is_fd_in_sorted_fd_sequence(start_fd, py_fds_to_keep) &&
-           (start_fd < end_fd)) {
+    while (_is_fd_in_sorted_fd_sequence(start_fd, py_fds_to_keep)) {
         ++start_fd;
     }
-    if (start_fd >= end_fd)
-        return;
     /* Close our lowest fd before we call opendir so that it is likely to
      * reuse that fd otherwise we might close opendir's file descriptor in
      * our loop.  This trick assumes that fd's are allocated on a lowest
@@ -281,8 +315,6 @@
     while (close(start_fd) < 0 && errno == EINTR);
     ++start_fd;
 #endif
-    if (start_fd >= end_fd)
-        return;
 
 #if defined(__FreeBSD__)
     if (!_is_fdescfs_mounted_on_dev_fd())
@@ -292,7 +324,7 @@
         proc_fd_dir = opendir(FD_DIR);
     if (!proc_fd_dir) {
         /* No way to get a list of open fds. */
-        _close_fds_by_brute_force(start_fd, end_fd, py_fds_to_keep);
+        _close_fds_by_brute_force(start_fd, py_fds_to_keep);
     } else {
         struct dirent *dir_entry;
 #ifdef HAVE_DIRFD
@@ -305,7 +337,7 @@
             int fd;
             if ((fd = _pos_int_from_ascii(dir_entry->d_name)) < 0)
                 continue;  /* Not a number. */
-            if (fd != fd_used_by_opendir && fd >= start_fd && fd < end_fd &&
+            if (fd != fd_used_by_opendir && fd >= start_fd &&
                 !_is_fd_in_sorted_fd_sequence(fd, py_fds_to_keep)) {
                 while (close(fd) < 0 && errno == EINTR);
             }
@@ -313,13 +345,13 @@
         }
         if (errno) {
             /* readdir error, revert behavior. Highly Unlikely. */
-            _close_fds_by_brute_force(start_fd, end_fd, py_fds_to_keep);
+            _close_fds_by_brute_force(start_fd, py_fds_to_keep);
         }
         closedir(proc_fd_dir);
     }
 }
 
-#define _close_open_fd_range _close_open_fd_range_maybe_unsafe
+#define _close_open_fds _close_open_fds_maybe_unsafe
 
 #endif  /* else NOT (defined(__linux__) && defined(HAVE_SYS_SYSCALL_H)) */
 
@@ -356,16 +388,16 @@
     /* Buffer large enough to hold a hex integer.  We can't malloc. */
     char hex_errno[sizeof(saved_errno)*2+1];
 
+    if (make_inheritable(py_fds_to_keep, errpipe_write) < 0)
+        goto error;
+
     /* Close parent's pipe ends. */
-    if (p2cwrite != -1) {
+    if (p2cwrite != -1)
         POSIX_CALL(close(p2cwrite));
-    }
-    if (c2pread != -1) {
+    if (c2pread != -1)
         POSIX_CALL(close(c2pread));
-    }
-    if (errread != -1) {
+    if (errread != -1)
         POSIX_CALL(close(errread));
-    }
     POSIX_CALL(close(errpipe_read));
 
     /* When duping fds, if there arises a situation where one of the fds is
@@ -379,38 +411,34 @@
        dup2() removes the CLOEXEC flag but we must do it ourselves if dup2()
        would be a no-op (issue #10806). */
     if (p2cread == 0) {
-        int old = fcntl(p2cread, F_GETFD);
-        if (old != -1)
-            fcntl(p2cread, F_SETFD, old & ~FD_CLOEXEC);
-    } else if (p2cread != -1) {
+        if (_Py_set_inheritable(p2cread, 1, NULL) < 0)
+            goto error;
+    }
+    else if (p2cread != -1)
         POSIX_CALL(dup2(p2cread, 0));  /* stdin */
-    }
+
     if (c2pwrite == 1) {
-        int old = fcntl(c2pwrite, F_GETFD);
-        if (old != -1)
-            fcntl(c2pwrite, F_SETFD, old & ~FD_CLOEXEC);
-    } else if (c2pwrite != -1) {
+        if (_Py_set_inheritable(c2pwrite, 1, NULL) < 0)
+            goto error;
+    }
+    else if (c2pwrite != -1)
         POSIX_CALL(dup2(c2pwrite, 1));  /* stdout */
-    }
+
     if (errwrite == 2) {
-        int old = fcntl(errwrite, F_GETFD);
-        if (old != -1)
-            fcntl(errwrite, F_SETFD, old & ~FD_CLOEXEC);
-    } else if (errwrite != -1) {
-        POSIX_CALL(dup2(errwrite, 2));  /* stderr */
+        if (_Py_set_inheritable(errwrite, 1, NULL) < 0)
+            goto error;
     }
+    else if (errwrite != -1)
+        POSIX_CALL(dup2(errwrite, 2));  /* stderr */
 
     /* Close pipe fds.  Make sure we don't close the same fd more than */
     /* once, or standard fds. */
-    if (p2cread > 2) {
+    if (p2cread > 2)
         POSIX_CALL(close(p2cread));
-    }
-    if (c2pwrite > 2 && c2pwrite != p2cread) {
+    if (c2pwrite > 2 && c2pwrite != p2cread)
         POSIX_CALL(close(c2pwrite));
-    }
-    if (errwrite != c2pwrite && errwrite != p2cread && errwrite > 2) {
+    if (errwrite != c2pwrite && errwrite != p2cread && errwrite > 2)
         POSIX_CALL(close(errwrite));
-    }
 
     if (cwd)
         POSIX_CALL(chdir(cwd));
@@ -442,14 +470,8 @@
 
     /* close FDs after executing preexec_fn, which might open FDs */
     if (close_fds) {
-        int local_max_fd = max_fd;
-#if defined(__NetBSD__)
-        local_max_fd = fcntl(0, F_MAXFD);
-        if (local_max_fd < 0)
-            local_max_fd = max_fd;
-#endif
         /* TODO HP-UX could use pstat_getproc() if anyone cares about it. */
-        _close_open_fd_range(3, local_max_fd, py_fds_to_keep);
+        _close_open_fds(3, py_fds_to_keep);
     }
 
     /* This loop matches the Lib/os.py _execvpe()'s PATH search when */
@@ -492,7 +514,7 @@
         /* We can't call strerror(saved_errno).  It is not async signal safe.
          * The parent process will look the error message up. */
     } else {
-        unused = write(errpipe_write, "RuntimeError:0:", 15);
+        unused = write(errpipe_write, "SubprocessError:0:", 18);
         unused = write(errpipe_write, err_msg, strlen(err_msg));
     }
     if (unused) return;  /* silly? yes! avoids gcc compiler warning. */
@@ -516,6 +538,7 @@
     int need_to_reenable_gc = 0;
     char *const *exec_array, *const *argv = NULL, *const *envp = NULL;
     Py_ssize_t arg_num;
+    int import_lock_held = 0;
 
     if (!PyArg_ParseTuple(
             args, "OOpOOOiiiiiiiiiiO:fork_exec",
@@ -544,7 +567,7 @@
         PyObject *result;
         _Py_IDENTIFIER(isenabled);
         _Py_IDENTIFIER(disable);
-        
+
         gc_module = PyImport_ImportModule("gc");
         if (gc_module == NULL)
             return NULL;
@@ -568,10 +591,8 @@
     }
 
     exec_array = _PySequence_BytesToCharpArray(executable_list);
-    if (!exec_array) {
-        Py_XDECREF(gc_module);
-        return NULL;
-    }
+    if (!exec_array)
+        goto cleanup;
 
     /* Convert args and env into appropriate arguments for exec() */
     /* These conversions are done in the parent process to avoid allocating
@@ -613,6 +634,7 @@
         if (!preexec_fn_args_tuple)
             goto cleanup;
         _PyImport_AcquireLock();
+        import_lock_held = 1;
     }
 
     if (cwd_obj != Py_None) {
@@ -660,6 +682,7 @@
         PyErr_SetString(PyExc_RuntimeError,
                         "not holding the import lock");
     }
+    import_lock_held = 0;
 
     /* Parent process */
     if (envp)
@@ -682,18 +705,25 @@
     return PyLong_FromPid(pid);
 
 cleanup:
+    if (import_lock_held)
+        _PyImport_ReleaseLock();
     if (envp)
         _Py_FreeCharPArray(envp);
     if (argv)
         _Py_FreeCharPArray(argv);
-    _Py_FreeCharPArray(exec_array);
+    if (exec_array)
+        _Py_FreeCharPArray(exec_array);
     Py_XDECREF(converted_args);
     Py_XDECREF(fast_args);
     Py_XDECREF(preexec_fn_args_tuple);
 
     /* Reenable gc if it was disabled. */
-    if (need_to_reenable_gc)
+    if (need_to_reenable_gc) {
+        PyObject *exctype, *val, *tb;
+        PyErr_Fetch(&exctype, &val, &tb);
         _enable_gc(gc_module);
+        PyErr_Restore(exctype, val, tb);
+    }
     Py_XDECREF(gc_module);
     return NULL;
 }
@@ -721,88 +751,6 @@
 Raises: Only on an error in the parent process.\n\
 ");
 
-PyDoc_STRVAR(subprocess_cloexec_pipe_doc,
-"cloexec_pipe() -> (read_end, write_end)\n\n\
-Create a pipe whose ends have the cloexec flag set; write_end will be >= 3.");
-
-static PyObject *
-subprocess_cloexec_pipe(PyObject *self, PyObject *noargs)
-{
-    int fds[2];
-    int res, saved_errno;
-    long oldflags;
-#ifdef HAVE_PIPE2
-    Py_BEGIN_ALLOW_THREADS
-    res = pipe2(fds, O_CLOEXEC);
-    Py_END_ALLOW_THREADS
-    if (res != 0 && errno == ENOSYS)
-    {
-#endif
-        /* We hold the GIL which offers some protection from other code calling
-         * fork() before the CLOEXEC flags have been set but we can't guarantee
-         * anything without pipe2(). */
-        res = pipe(fds);
-
-        if (res == 0) {
-            oldflags = fcntl(fds[0], F_GETFD, 0);
-            if (oldflags < 0) res = oldflags;
-        }
-        if (res == 0)
-            res = fcntl(fds[0], F_SETFD, oldflags | FD_CLOEXEC);
-
-        if (res == 0) {
-            oldflags = fcntl(fds[1], F_GETFD, 0);
-            if (oldflags < 0) res = oldflags;
-        }
-        if (res == 0)
-            res = fcntl(fds[1], F_SETFD, oldflags | FD_CLOEXEC);
-#ifdef HAVE_PIPE2
-    }
-#endif
-    if (res == 0 && fds[1] < 3) {
-        /* We always want the write end of the pipe to avoid fds 0, 1 and 2
-         * as our child may claim those for stdio connections. */
-        int write_fd = fds[1];
-        int fds_to_close[3] = {-1, -1, -1};
-        int fds_to_close_idx = 0;
-#ifdef F_DUPFD_CLOEXEC
-        fds_to_close[fds_to_close_idx++] = write_fd;
-        write_fd = fcntl(write_fd, F_DUPFD_CLOEXEC, 3);
-        if (write_fd < 0)  /* We don't support F_DUPFD_CLOEXEC / other error */
-#endif
-        {
-            /* Use dup a few times until we get a desirable fd. */
-            for (; fds_to_close_idx < 3; ++fds_to_close_idx) {
-                fds_to_close[fds_to_close_idx] = write_fd;
-                write_fd = dup(write_fd);
-                if (write_fd >= 3)
-                    break;
-                /* We may dup a few extra times if it returns an error but
-                 * that is okay.  Repeat calls should return the same error. */
-            }
-            if (write_fd < 0) res = write_fd;
-            if (res == 0) {
-                oldflags = fcntl(write_fd, F_GETFD, 0);
-                if (oldflags < 0) res = oldflags;
-                if (res == 0)
-                    res = fcntl(write_fd, F_SETFD, oldflags | FD_CLOEXEC);
-            }
-        }
-        saved_errno = errno;
-        /* Close fds we tried for the write end that were too low. */
-        for (fds_to_close_idx=0; fds_to_close_idx < 3; ++fds_to_close_idx) {
-            int temp_fd = fds_to_close[fds_to_close_idx];
-            while (temp_fd >= 0 && close(temp_fd) < 0 && errno == EINTR);
-        }
-        errno = saved_errno;  /* report dup or fcntl errors, not close. */
-        fds[1] = write_fd;
-    }  /* end if write fd was too small */
-
-    if (res != 0)
-        return PyErr_SetFromErrno(PyExc_OSError);
-    return Py_BuildValue("(ii)", fds[0], fds[1]);
-}
-
 /* module level code ********************************************************/
 
 PyDoc_STRVAR(module_doc,
@@ -811,7 +759,6 @@
 
 static PyMethodDef module_methods[] = {
     {"fork_exec", subprocess_fork_exec, METH_VARARGS, subprocess_fork_exec_doc},
-    {"cloexec_pipe", subprocess_cloexec_pipe, METH_NOARGS, subprocess_cloexec_pipe_doc},
     {NULL, NULL}  /* sentinel */
 };
 
@@ -827,11 +774,5 @@
 PyMODINIT_FUNC
 PyInit__posixsubprocess(void)
 {
-#ifdef _SC_OPEN_MAX
-    max_fd = sysconf(_SC_OPEN_MAX);
-    if (max_fd == -1)
-#endif
-        max_fd = 256;  /* Matches Lib/subprocess.py */
-
     return PyModule_Create(&_posixsubprocessmodule);
 }
diff --git a/Modules/_randommodule.c b/Modules/_randommodule.c
index 21a2b09..4377ee0 100644
--- a/Modules/_randommodule.c
+++ b/Modules/_randommodule.c
@@ -168,9 +168,9 @@
 /* init_key is the array for initializing keys */
 /* key_length is its length */
 static PyObject *
-init_by_array(RandomObject *self, unsigned long init_key[], unsigned long key_length)
+init_by_array(RandomObject *self, unsigned long init_key[], size_t key_length)
 {
-    unsigned int i, j, k;       /* was signed in the original code. RDH 12/16/2002 */
+    size_t i, j, k;       /* was signed in the original code. RDH 12/16/2002 */
     unsigned long *mt;
 
     mt = self->state;
@@ -179,7 +179,7 @@
     k = (N>key_length ? N : key_length);
     for (; k; k--) {
         mt[i] = (mt[i] ^ ((mt[i-1] ^ (mt[i-1] >> 30)) * 1664525UL))
-                 + init_key[j] + j; /* non linear */
+                 + init_key[j] + (unsigned long)j; /* non linear */
         mt[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */
         i++; j++;
         if (i>=N) { mt[0] = mt[N-1]; i=1; }
@@ -187,7 +187,7 @@
     }
     for (k=N-1; k; k--) {
         mt[i] = (mt[i] ^ ((mt[i-1] ^ (mt[i-1] >> 30)) * 1566083941UL))
-                 - i; /* non linear */
+                 - (unsigned long)i; /* non linear */
         mt[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */
         i++;
         if (i>=N) { mt[0] = mt[N-1]; i=1; }
@@ -207,14 +207,11 @@
 random_seed(RandomObject *self, PyObject *args)
 {
     PyObject *result = NULL;            /* guilty until proved innocent */
-    PyObject *masklower = NULL;
-    PyObject *thirtytwo = NULL;
     PyObject *n = NULL;
-    unsigned long *new_key, *key = NULL;
-    unsigned long keymax;               /* # of allocated slots in key */
-    unsigned long keyused;              /* # of used slots in key */
-    int err;
-
+    unsigned long *key = NULL;
+    unsigned char *key_as_bytes = NULL;
+    size_t bits, keyused, i;
+    int res;
     PyObject *arg = NULL;
 
     if (!PyArg_UnpackTuple(args, "seed", 0, 1, &arg))
@@ -243,69 +240,46 @@
     if (n == NULL)
         goto Done;
 
-    /* Now split n into 32-bit chunks, from the right.  Each piece is
-     * stored into key, which has a capacity of keymax chunks, of which
-     * keyused are filled.  Alas, the repeated shifting makes this a
-     * quadratic-time algorithm; we'd really like to use
-     * _PyLong_AsByteArray here, but then we'd have to break into the
-     * long representation to figure out how big an array was needed
-     * in advance.
-     */
-    keymax = 8;         /* arbitrary; grows later if needed */
-    keyused = 0;
-    key = (unsigned long *)PyMem_Malloc(keymax * sizeof(*key));
-    if (key == NULL)
+    /* Now split n into 32-bit chunks, from the right. */
+    bits = _PyLong_NumBits(n);
+    if (bits == (size_t)-1 && PyErr_Occurred())
         goto Done;
 
-    masklower = PyLong_FromUnsignedLong(0xffffffffU);
-    if (masklower == NULL)
-        goto Done;
-    thirtytwo = PyLong_FromLong(32L);
-    if (thirtytwo == NULL)
-        goto Done;
-    while ((err=PyObject_IsTrue(n))) {
-        PyObject *newn;
-        PyObject *pychunk;
-        unsigned long chunk;
+    /* Figure out how many 32-bit chunks this gives us. */
+    keyused = bits == 0 ? 1 : (bits - 1) / 32 + 1;
 
-        if (err == -1)
-            goto Done;
-        pychunk = PyNumber_And(n, masklower);
-        if (pychunk == NULL)
-            goto Done;
-        chunk = PyLong_AsUnsignedLong(pychunk);
-        Py_DECREF(pychunk);
-        if (chunk == (unsigned long)-1 && PyErr_Occurred())
-            goto Done;
-        newn = PyNumber_Rshift(n, thirtytwo);
-        if (newn == NULL)
-            goto Done;
-        Py_DECREF(n);
-        n = newn;
-        if (keyused >= keymax) {
-            unsigned long bigger = keymax << 1;
-            if ((bigger >> 1) != keymax ||
-                bigger > PY_SSIZE_T_MAX / sizeof(*key)) {
-                PyErr_NoMemory();
-                goto Done;
-            }
-            new_key = (unsigned long *)PyMem_Realloc(key,
-                                    bigger * sizeof(*key));
-            if (new_key == NULL)
-                goto Done;
-            key = new_key;
-            keymax = bigger;
-        }
-        assert(keyused < keymax);
-        key[keyused++] = chunk;
+    /* Convert seed to byte sequence. */
+    key_as_bytes = (unsigned char *)PyMem_Malloc((size_t)4 * keyused);
+    if (key_as_bytes == NULL) {
+        PyErr_NoMemory();
+        goto Done;
+    }
+    res = _PyLong_AsByteArray((PyLongObject *)n,
+                              key_as_bytes, keyused * 4,
+                              1,  /* little-endian */
+                              0); /* unsigned */
+    if (res == -1) {
+        PyMem_Free(key_as_bytes);
+        goto Done;
     }
 
-    if (keyused == 0)
-        key[keyused++] = 0UL;
+    /* Fill array of unsigned longs from byte sequence. */
+    key = (unsigned long *)PyMem_Malloc(sizeof(unsigned long) * keyused);
+    if (key == NULL) {
+        PyErr_NoMemory();
+        PyMem_Free(key_as_bytes);
+        goto Done;
+    }
+    for (i = 0; i < keyused; i++) {
+        key[i] =
+            ((unsigned long)key_as_bytes[4*i + 0] << 0) +
+            ((unsigned long)key_as_bytes[4*i + 1] << 8) +
+            ((unsigned long)key_as_bytes[4*i + 2] << 16) +
+            ((unsigned long)key_as_bytes[4*i + 3] << 24);
+    }
+    PyMem_Free(key_as_bytes);
     result = init_by_array(self, key, keyused);
 Done:
-    Py_XDECREF(masklower);
-    Py_XDECREF(thirtytwo);
     Py_XDECREF(n);
     PyMem_Free(key);
     return result;
@@ -389,6 +363,9 @@
         return NULL;
     }
 
+    if (k <= 32)  /* Fast path */
+        return PyLong_FromUnsignedLong(genrand_int32(self) >> (32 - k));
+
     bytes = ((k - 1) / 32 + 1) * 4;
     bytearray = (unsigned char *)PyMem_Malloc(bytes);
     if (bytearray == NULL) {
diff --git a/Modules/_sqlite/cache.c b/Modules/_sqlite/cache.c
index 3693363..3689a4e 100644
--- a/Modules/_sqlite/cache.c
+++ b/Modules/_sqlite/cache.c
@@ -21,7 +21,6 @@
  * 3. This notice may not be removed or altered from any source distribution.
  */
 
-#include "sqlitecompat.h"
 #include "cache.h"
 #include <limits.h>
 
diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c
index 8cf2d6a..2e8cab5 100644
--- a/Modules/_sqlite/connection.c
+++ b/Modules/_sqlite/connection.c
@@ -29,7 +29,6 @@
 #include "cursor.h"
 #include "prepare_protocol.h"
 #include "util.h"
-#include "sqlitecompat.h"
 
 #include "pythread.h"
 
@@ -42,6 +41,8 @@
 #endif
 #endif
 
+_Py_IDENTIFIER(cursor);
+
 static int pysqlite_connection_set_isolation_level(pysqlite_Connection* self, PyObject* isolation_level);
 static void _pysqlite_drop_unused_cursor_references(pysqlite_Connection* self);
 
@@ -60,7 +61,11 @@
 
 int pysqlite_connection_init(pysqlite_Connection* self, PyObject* args, PyObject* kwargs)
 {
-    static char *kwlist[] = {"database", "timeout", "detect_types", "isolation_level", "check_same_thread", "factory", "cached_statements", NULL, NULL};
+    static char *kwlist[] = {
+        "database", "timeout", "detect_types", "isolation_level",
+        "check_same_thread", "factory", "cached_statements", "uri",
+        NULL
+    };
 
     char* database;
     int detect_types = 0;
@@ -68,11 +73,14 @@
     PyObject* factory = NULL;
     int check_same_thread = 1;
     int cached_statements = 100;
+    int uri = 0;
     double timeout = 5.0;
     int rc;
 
-    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s|diOiOi", kwlist,
-                                     &database, &timeout, &detect_types, &isolation_level, &check_same_thread, &factory, &cached_statements))
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s|diOiOip", kwlist,
+                                     &database, &timeout, &detect_types,
+                                     &isolation_level, &check_same_thread,
+                                     &factory, &cached_statements, &uri))
     {
         return -1;
     }
@@ -91,8 +99,19 @@
     Py_INCREF(&PyUnicode_Type);
     self->text_factory = (PyObject*)&PyUnicode_Type;
 
+#ifdef SQLITE_OPEN_URI
+    Py_BEGIN_ALLOW_THREADS
+    rc = sqlite3_open_v2(database, &self->db,
+                         SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE |
+                         (uri ? SQLITE_OPEN_URI : 0), NULL);
+#else
+    if (uri) {
+        PyErr_SetString(pysqlite_NotSupportedError, "URIs not supported");
+        return -1;
+    }
     Py_BEGIN_ALLOW_THREADS
     rc = sqlite3_open(database, &self->db);
+#endif
     Py_END_ALLOW_THREADS
 
     if (rc != SQLITE_OK) {
@@ -503,13 +522,20 @@
             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");
+        Py_buffer view;
+        if (PyObject_GetBuffer(py_val, &view, PyBUF_SIMPLE) != 0) {
+            PyErr_SetString(PyExc_ValueError,
+                            "could not convert BLOB to buffer");
             return -1;
         }
-        sqlite3_result_blob(context, buffer, buflen, SQLITE_TRANSIENT);
+        if (view.len > INT_MAX) {
+            PyErr_SetString(PyExc_OverflowError,
+                            "BLOB longer than INT_MAX bytes");
+            PyBuffer_Release(&view);
+            return -1;
+        }
+        sqlite3_result_blob(context, view.buf, (int)view.len, SQLITE_TRANSIENT);
+        PyBuffer_Release(&view);
     } else {
         return -1;
     }
@@ -682,6 +708,8 @@
     PyObject** aggregate_instance;
     _Py_IDENTIFIER(finalize);
     int ok;
+    PyObject *exception, *value, *tb;
+    int restore;
 
 #ifdef WITH_THREAD
     PyGILState_STATE threadstate;
@@ -697,7 +725,12 @@
         goto error;
     }
 
+    /* Keep the exception (if any) of the last call to step() */
+    PyErr_Fetch(&exception, &value, &tb);
+    restore = 1;
+
     function_result = _PyObject_CallMethodId(*aggregate_instance, &PyId_finalize, "");
+
     Py_DECREF(*aggregate_instance);
 
     ok = 0;
@@ -712,6 +745,17 @@
             PyErr_Clear();
         }
         _sqlite3_result_error(context, "user-defined aggregate's 'finalize' method raised error", -1);
+#if SQLITE_VERSION_NUMBER < 3003003
+        /* with old SQLite versions, _sqlite3_result_error() sets a new Python
+           exception, so don't restore the previous exception */
+        restore = 0;
+#endif
+    }
+
+    if (restore) {
+        /* Restore the exception (if any) of the last call to step(),
+           but clear also the current exception if finalize() failed */
+        PyErr_Restore(exception, value, tb);
     }
 
 error:
@@ -862,22 +906,29 @@
 
     gilstate = PyGILState_Ensure();
 #endif
+
     ret = PyObject_CallFunction((PyObject*)user_arg, "issss", action, arg1, arg2, dbname, access_attempt_source);
 
-    if (!ret) {
-        if (_enable_callback_tracebacks) {
+    if (ret == NULL) {
+        if (_enable_callback_tracebacks)
             PyErr_Print();
-        } else {
+        else
             PyErr_Clear();
-        }
 
         rc = SQLITE_DENY;
-    } else {
+    }
+    else {
         if (PyLong_Check(ret)) {
             rc = _PyLong_AsInt(ret);
-            if (rc == -1 && PyErr_Occurred())
+            if (rc == -1 && PyErr_Occurred()) {
+                if (_enable_callback_tracebacks)
+                    PyErr_Print();
+                else
+                    PyErr_Clear();
                 rc = SQLITE_DENY;
-        } else {
+            }
+        }
+        else {
             rc = SQLITE_DENY;
         }
         Py_DECREF(ret);
@@ -1190,9 +1241,8 @@
         return NULL;
     }
 
-    if (!PyArg_ParseTuple(args, "O", &sql)) {
+    if (!PyArg_ParseTuple(args, "O", &sql))
         return NULL;
-    }
 
     _pysqlite_drop_unused_statement_references(self);
 
@@ -1208,35 +1258,33 @@
     statement->in_weakreflist = NULL;
 
     rc = pysqlite_statement_create(statement, self, sql);
-
     if (rc != SQLITE_OK) {
         if (rc == PYSQLITE_TOO_MUCH_SQL) {
             PyErr_SetString(pysqlite_Warning, "You can only execute one statement at a time.");
         } else if (rc == PYSQLITE_SQL_WRONG_TYPE) {
-            PyErr_SetString(pysqlite_Warning, "SQL is of wrong type. Must be string or unicode.");
+            if (PyErr_ExceptionMatches(PyExc_TypeError))
+                PyErr_SetString(pysqlite_Warning, "SQL is of wrong type. Must be string.");
         } else {
             (void)pysqlite_statement_reset(statement);
             _pysqlite_seterror(self->db, NULL);
         }
-
-        Py_CLEAR(statement);
-    } else {
-        weakref = PyWeakref_NewRef((PyObject*)statement, NULL);
-        if (!weakref) {
-            Py_CLEAR(statement);
-            goto error;
-        }
-
-        if (PyList_Append(self->statements, weakref) != 0) {
-            Py_CLEAR(weakref);
-            goto error;
-        }
-
-        Py_DECREF(weakref);
+        goto error;
     }
 
-error:
+    weakref = PyWeakref_NewRef((PyObject*)statement, NULL);
+    if (weakref == NULL)
+        goto error;
+    if (PyList_Append(self->statements, weakref) != 0) {
+        Py_DECREF(weakref);
+        goto error;
+    }
+    Py_DECREF(weakref);
+
     return (PyObject*)statement;
+
+error:
+    Py_DECREF(statement);
+    return NULL;
 }
 
 PyObject* pysqlite_connection_execute(pysqlite_Connection* self, PyObject* args, PyObject* kwargs)
@@ -1244,7 +1292,6 @@
     PyObject* cursor = 0;
     PyObject* result = 0;
     PyObject* method = 0;
-    _Py_IDENTIFIER(cursor);
 
     cursor = _PyObject_CallMethodId((PyObject*)self, &PyId_cursor, "");
     if (!cursor) {
@@ -1274,7 +1321,6 @@
     PyObject* cursor = 0;
     PyObject* result = 0;
     PyObject* method = 0;
-    _Py_IDENTIFIER(cursor);
 
     cursor = _PyObject_CallMethodId((PyObject*)self, &PyId_cursor, "");
     if (!cursor) {
@@ -1304,7 +1350,6 @@
     PyObject* cursor = 0;
     PyObject* result = 0;
     PyObject* method = 0;
-    _Py_IDENTIFIER(cursor);
 
     cursor = _PyObject_CallMethodId((PyObject*)self, &PyId_cursor, "");
     if (!cursor) {
diff --git a/Modules/_sqlite/cursor.c b/Modules/_sqlite/cursor.c
index 09c13d4..db96b02 100644
--- a/Modules/_sqlite/cursor.c
+++ b/Modules/_sqlite/cursor.c
@@ -24,7 +24,6 @@
 #include "cursor.h"
 #include "module.h"
 #include "util.h"
-#include "sqlitecompat.h"
 
 PyObject* pysqlite_cursor_iternext(pysqlite_Cursor* self);
 
@@ -290,9 +289,8 @@
     Py_END_ALLOW_THREADS
 
     row = PyTuple_New(numcols);
-    if (!row) {
+    if (!row)
         return NULL;
-    }
 
     for (i = 0; i < numcols; i++) {
         if (self->connection->detect_types) {
@@ -312,14 +310,12 @@
                 converted = Py_None;
             } else {
                 item = PyBytes_FromStringAndSize(val_str, nbytes);
-                if (!item) {
-                    return NULL;
-                }
+                if (!item)
+                    goto error;
                 converted = PyObject_CallFunction(converter, "O", item);
                 Py_DECREF(item);
-                if (!converted) {
+                if (!converted)
                     break;
-                }
             }
         } else {
             Py_BEGIN_ALLOW_THREADS
@@ -338,6 +334,11 @@
                 if (self->connection->text_factory == (PyObject*)&PyUnicode_Type) {
                     converted = PyUnicode_FromStringAndSize(val_str, nbytes);
                     if (!converted) {
+#ifdef Py_DEBUG
+                        /* in debug mode, type_call() fails with an assertion
+                           error if an exception is set when it is called */
+                        PyErr_Clear();
+#endif
                         colname = sqlite3_column_name(self->statement->st, i);
                         if (!colname) {
                             colname = "<unknown column name>";
@@ -370,9 +371,8 @@
                 nbytes = sqlite3_column_bytes(self->statement->st, i);
                 buffer = PyBytes_FromStringAndSize(
                     sqlite3_column_blob(self->statement->st, i), nbytes);
-                if (!buffer) {
+                if (!buffer)
                     break;
-                }
                 converted = buffer;
             }
         }
@@ -385,12 +385,14 @@
         }
     }
 
-    if (PyErr_Occurred()) {
-        Py_DECREF(row);
-        row = NULL;
-    }
+    if (PyErr_Occurred())
+        goto error;
 
     return row;
+
+error:
+    Py_DECREF(row);
+    return NULL;
 }
 
 /*
@@ -608,6 +610,10 @@
         while (1) {
             /* Actually execute the SQL statement. */
             rc = pysqlite_step(self->statement->st, self->connection);
+            if (PyErr_Occurred()) {
+                (void)pysqlite_statement_reset(self->statement);
+                goto error;
+            }
             if (rc == SQLITE_DONE ||  rc == SQLITE_ROW) {
                 /* If it worked, let's get out of the loop */
                 break;
@@ -681,6 +687,8 @@
             }
 
             self->next_row = _pysqlite_fetch_one_row(self);
+            if (self->next_row == NULL)
+                goto error;
         } else if (rc == SQLITE_DONE && !multiple) {
             pysqlite_statement_reset(self->statement);
             Py_CLEAR(self->statement);
@@ -803,7 +811,10 @@
         rc = SQLITE_ROW;
         while (rc == SQLITE_ROW) {
             rc = pysqlite_step(statement, self->connection);
-            /* TODO: we probably need more error handling here */
+            if (PyErr_Occurred()) {
+                (void)sqlite3_finalize(statement);
+                goto error;
+            }
         }
 
         if (rc != SQLITE_DONE) {
@@ -864,10 +875,15 @@
     }
 
     next_row_tuple = self->next_row;
+    assert(next_row_tuple != NULL);
     self->next_row = NULL;
 
     if (self->row_factory != Py_None) {
         next_row = PyObject_CallFunction(self->row_factory, "OO", self, next_row_tuple);
+        if (next_row == NULL) {
+            self->next_row = next_row_tuple;
+            return NULL;
+        }
         Py_DECREF(next_row_tuple);
     } else {
         next_row = next_row_tuple;
@@ -875,6 +891,11 @@
 
     if (self->statement) {
         rc = pysqlite_step(self->statement->st, self->connection);
+        if (PyErr_Occurred()) {
+            (void)pysqlite_statement_reset(self->statement);
+            Py_DECREF(next_row);
+            return NULL;
+        }
         if (rc != SQLITE_DONE && rc != SQLITE_ROW) {
             (void)pysqlite_statement_reset(self->statement);
             Py_DECREF(next_row);
@@ -884,6 +905,10 @@
 
         if (rc == SQLITE_ROW) {
             self->next_row = _pysqlite_fetch_one_row(self);
+            if (self->next_row == NULL) {
+                (void)pysqlite_statement_reset(self->statement);
+                return NULL;
+            }
         }
     }
 
diff --git a/Modules/_sqlite/module.c b/Modules/_sqlite/module.c
index bea6d6a..7a7e860 100644
--- a/Modules/_sqlite/module.c
+++ b/Modules/_sqlite/module.c
@@ -50,19 +50,26 @@
      * C-level, so this code is redundant with the one in connection_init in
      * connection.c and must always be copied from there ... */
 
-    static char *kwlist[] = {"database", "timeout", "detect_types", "isolation_level", "check_same_thread", "factory", "cached_statements", NULL, NULL};
+    static char *kwlist[] = {
+        "database", "timeout", "detect_types", "isolation_level",
+        "check_same_thread", "factory", "cached_statements", "uri",
+        NULL
+    };
     char* database;
     int detect_types = 0;
     PyObject* isolation_level;
     PyObject* factory = NULL;
     int check_same_thread = 1;
     int cached_statements;
+    int uri = 0;
     double timeout = 5.0;
 
     PyObject* result;
 
-    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s|diOiOi", kwlist,
-                                     &database, &timeout, &detect_types, &isolation_level, &check_same_thread, &factory, &cached_statements))
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s|diOiOip", kwlist,
+                                     &database, &timeout, &detect_types,
+                                     &isolation_level, &check_same_thread,
+                                     &factory, &cached_statements, &uri))
     {
         return NULL;
     }
@@ -77,7 +84,8 @@
 }
 
 PyDoc_STRVAR(module_connect_doc,
-"connect(database[, timeout, isolation_level, detect_types, factory])\n\
+"connect(database[, timeout, detect_types, isolation_level,\n\
+        check_same_thread, factory, cached_statements, uri])\n\
 \n\
 Opens a connection to the SQLite database file *database*. You can use\n\
 \":memory:\" to open a database connection to a database that resides in\n\
diff --git a/Modules/_sqlite/prepare_protocol.c b/Modules/_sqlite/prepare_protocol.c
index fc68874..f2c85f9 100644
--- a/Modules/_sqlite/prepare_protocol.c
+++ b/Modules/_sqlite/prepare_protocol.c
@@ -21,7 +21,6 @@
  * 3. This notice may not be removed or altered from any source distribution.
  */
 
-#include "sqlitecompat.h"
 #include "prepare_protocol.h"
 
 int pysqlite_prepare_protocol_init(pysqlite_PrepareProtocol* self, PyObject* args, PyObject* kwargs)
diff --git a/Modules/_sqlite/row.c b/Modules/_sqlite/row.c
index b50658c..64dfd06 100644
--- a/Modules/_sqlite/row.c
+++ b/Modules/_sqlite/row.c
@@ -23,7 +23,6 @@
 
 #include "row.h"
 #include "cursor.h"
-#include "sqlitecompat.h"
 
 void pysqlite_row_dealloc(pysqlite_Row* self)
 {
@@ -33,42 +32,55 @@
     Py_TYPE(self)->tp_free((PyObject*)self);
 }
 
-int pysqlite_row_init(pysqlite_Row* self, PyObject* args, PyObject* kwargs)
+static PyObject *
+pysqlite_row_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
 {
+    pysqlite_Row *self;
     PyObject* data;
     pysqlite_Cursor* cursor;
 
-    self->data = 0;
-    self->description = 0;
+    assert(type != NULL && type->tp_alloc != NULL);
 
-    if (!PyArg_ParseTuple(args, "OO", &cursor, &data)) {
-        return -1;
-    }
+    if (!_PyArg_NoKeywords("Row()", kwargs))
+        return NULL;
+    if (!PyArg_ParseTuple(args, "OO", &cursor, &data))
+        return NULL;
 
     if (!PyObject_IsInstance((PyObject*)cursor, (PyObject*)&pysqlite_CursorType)) {
         PyErr_SetString(PyExc_TypeError, "instance of cursor required for first argument");
-        return -1;
+        return NULL;
     }
 
     if (!PyTuple_Check(data)) {
         PyErr_SetString(PyExc_TypeError, "tuple required for second argument");
-        return -1;
+        return NULL;
     }
 
+    self = (pysqlite_Row *) type->tp_alloc(type, 0);
+    if (self == NULL)
+        return NULL;
+
     Py_INCREF(data);
     self->data = data;
 
     Py_INCREF(cursor->description);
     self->description = cursor->description;
 
-    return 0;
+    return (PyObject *) self;
+}
+
+PyObject* pysqlite_row_item(pysqlite_Row* self, Py_ssize_t idx)
+{
+   PyObject* item = PyTuple_GetItem(self->data, idx);
+   Py_XINCREF(item);
+   return item;
 }
 
 PyObject* pysqlite_row_subscript(pysqlite_Row* self, PyObject* idx)
 {
-    long _idx;
+    Py_ssize_t _idx;
     char* key;
-    int nitems, i;
+    Py_ssize_t nitems, i;
     char* compare_key;
 
     char* p1;
@@ -77,7 +89,11 @@
     PyObject* item;
 
     if (PyLong_Check(idx)) {
-        _idx = PyLong_AsLong(idx);
+        _idx = PyNumber_AsSsize_t(idx, PyExc_IndexError);
+        if (_idx == -1 && PyErr_Occurred())
+            return NULL;
+        if (_idx < 0)
+           _idx += PyTuple_GET_SIZE(self->data);
         item = PyTuple_GetItem(self->data, _idx);
         Py_XINCREF(item);
         return item;
@@ -89,7 +105,10 @@
         nitems = PyTuple_Size(self->description);
 
         for (i = 0; i < nitems; i++) {
-            compare_key = _PyUnicode_AsString(PyTuple_GET_ITEM(PyTuple_GET_ITEM(self->description, i), 0));
+            PyObject *obj;
+            obj = PyTuple_GET_ITEM(self->description, i);
+            obj = PyTuple_GET_ITEM(obj, 0);
+            compare_key = _PyUnicode_AsString(obj);
             if (!compare_key) {
                 return NULL;
             }
@@ -121,10 +140,12 @@
 
         PyErr_SetString(PyExc_IndexError, "No item with that key");
         return NULL;
-    } else if (PySlice_Check(idx)) {
+    }
+    else if (PySlice_Check(idx)) {
         PyErr_SetString(PyExc_ValueError, "slices not implemented, yet");
         return NULL;
-    } else {
+    }
+    else {
         PyErr_SetString(PyExc_IndexError, "Index must be int or string");
         return NULL;
     }
@@ -194,6 +215,14 @@
     /* mp_ass_subscript */ (objobjargproc)0,
 };
 
+static PySequenceMethods pysqlite_row_as_sequence = {
+   /* sq_length */         (lenfunc)pysqlite_row_length,
+   /* sq_concat */         0,
+   /* sq_repeat */         0,
+   /* sq_item */           (ssizeargfunc)pysqlite_row_item,
+};
+
+
 static PyMethodDef pysqlite_row_methods[] = {
     {"keys", (PyCFunction)pysqlite_row_keys, METH_NOARGS,
         PyDoc_STR("Returns the keys of the row.")},
@@ -237,7 +266,7 @@
         0,                                              /* tp_descr_get */
         0,                                              /* tp_descr_set */
         0,                                              /* tp_dictoffset */
-        (initproc)pysqlite_row_init,                    /* tp_init */
+        0,                                              /* tp_init */
         0,                                              /* tp_alloc */
         0,                                              /* tp_new */
         0                                               /* tp_free */
@@ -245,7 +274,8 @@
 
 extern int pysqlite_row_setup_types(void)
 {
-    pysqlite_RowType.tp_new = PyType_GenericNew;
+    pysqlite_RowType.tp_new = pysqlite_row_new;
     pysqlite_RowType.tp_as_mapping = &pysqlite_row_as_mapping;
+    pysqlite_RowType.tp_as_sequence = &pysqlite_row_as_sequence;
     return PyType_Ready(&pysqlite_RowType);
 }
diff --git a/Modules/_sqlite/sqlitecompat.h b/Modules/_sqlite/sqlitecompat.h
deleted file mode 100644
index cf20f16..0000000
--- a/Modules/_sqlite/sqlitecompat.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* sqlitecompat.h - compatibility macros
- *
- * Copyright (C) 2006-2010 Gerhard Häring <gh@ghaering.de>
- *
- * This file is part of pysqlite.
- *
- * 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.
- */
-
-#include "Python.h"
-
-#ifndef PYSQLITE_COMPAT_H
-#define PYSQLITE_COMPAT_H
-
-/* define Py_ssize_t for pre-2.5 versions of Python */
-
-#if PY_VERSION_HEX < 0x02050000
-typedef int Py_ssize_t;
-typedef int (*lenfunc)(PyObject*);
-#endif
-
-
-/* define PyDict_CheckExact for pre-2.4 versions of Python */
-#ifndef PyDict_CheckExact
-#define PyDict_CheckExact(op) ((op)->ob_type == &PyDict_Type)
-#endif
-
-/* define Py_CLEAR for pre-2.4 versions of Python */
-#ifndef Py_CLEAR
-#define Py_CLEAR(op)				\
-        do {                            	\
-                if (op) {			\
-                        PyObject *tmp = (PyObject *)(op);	\
-                        (op) = NULL;		\
-                        Py_DECREF(tmp);		\
-                }				\
-        } while (0)
-#endif
-
-#ifndef PyVarObject_HEAD_INIT
-#define PyVarObject_HEAD_INIT(type, size) \
-    PyObject_HEAD_INIT(type) size,
-#endif
-
-#ifndef Py_TYPE
-#define Py_TYPE(ob) ((ob)->ob_type)
-#endif
-
-#endif
diff --git a/Modules/_sqlite/statement.c b/Modules/_sqlite/statement.c
index 471a067..e870633 100644
--- a/Modules/_sqlite/statement.c
+++ b/Modules/_sqlite/statement.c
@@ -27,7 +27,6 @@
 #include "microprotocols.h"
 #include "prepare_protocol.h"
 #include "util.h"
-#include "sqlitecompat.h"
 
 /* prototypes */
 static int pysqlite_check_remaining_sql(const char* tail);
@@ -64,6 +63,10 @@
         rc = PYSQLITE_SQL_WRONG_TYPE;
         return rc;
     }
+    if (strlen(sql_cstr) != (size_t)sql_cstr_len) {
+        PyErr_SetString(PyExc_ValueError, "the query contains a null character");
+        return PYSQLITE_SQL_WRONG_TYPE;
+    }
 
     self->in_weakreflist = NULL;
     Py_INCREF(sql);
@@ -91,7 +94,6 @@
 int pysqlite_statement_bind_parameter(pysqlite_Statement* self, int pos, PyObject* parameter)
 {
     int rc = SQLITE_OK;
-    const char* buffer;
     char* string;
     Py_ssize_t buflen;
     parameter_type paramtype;
@@ -133,19 +135,31 @@
             break;
         case TYPE_UNICODE:
             string = _PyUnicode_AsStringAndSize(parameter, &buflen);
-            if (string != NULL)
-                rc = sqlite3_bind_text(self->st, pos, string, buflen, SQLITE_TRANSIENT);
-            else
-                rc = -1;
-            break;
-        case TYPE_BUFFER:
-            if (PyObject_AsCharBuffer(parameter, &buffer, &buflen) == 0) {
-                rc = sqlite3_bind_blob(self->st, pos, buffer, buflen, SQLITE_TRANSIENT);
-            } else {
-                PyErr_SetString(PyExc_ValueError, "could not convert BLOB to buffer");
-                rc = -1;
+            if (string == NULL)
+                return -1;
+            if (buflen > INT_MAX) {
+                PyErr_SetString(PyExc_OverflowError,
+                                "string longer than INT_MAX bytes");
+                return -1;
             }
+            rc = sqlite3_bind_text(self->st, pos, string, (int)buflen, SQLITE_TRANSIENT);
             break;
+        case TYPE_BUFFER: {
+            Py_buffer view;
+            if (PyObject_GetBuffer(parameter, &view, PyBUF_SIMPLE) != 0) {
+                PyErr_SetString(PyExc_ValueError, "could not convert BLOB to buffer");
+                return -1;
+            }
+            if (view.len > INT_MAX) {
+                PyErr_SetString(PyExc_OverflowError,
+                                "BLOB longer than INT_MAX bytes");
+                PyBuffer_Release(&view);
+                return -1;
+            }
+            rc = sqlite3_bind_blob(self->st, pos, view.buf, (int)view.len, SQLITE_TRANSIENT);
+            PyBuffer_Release(&view);
+            break;
+        }
         case TYPE_UNKNOWN:
             rc = -1;
     }
@@ -177,7 +191,7 @@
     int i;
     int rc;
     int num_params_needed;
-    int num_params;
+    Py_ssize_t num_params;
 
     Py_BEGIN_ALLOW_THREADS
     num_params_needed = sqlite3_bind_parameter_count(self->st);
@@ -193,7 +207,9 @@
             num_params = PySequence_Size(parameters);
         }
         if (num_params != num_params_needed) {
-            PyErr_Format(pysqlite_ProgrammingError, "Incorrect number of bindings supplied. The current statement uses %d, and there are %d supplied.",
+            PyErr_Format(pysqlite_ProgrammingError,
+                         "Incorrect number of bindings supplied. The current "
+                         "statement uses %d, and there are %zd supplied.",
                          num_params_needed, num_params);
             return;
         }
@@ -249,7 +265,7 @@
                 current_param = PyDict_GetItemString(parameters, binding_name);
                 Py_XINCREF(current_param);
             } else {
-                current_param = PyMapping_GetItemString(parameters, (char*)binding_name);
+                current_param = PyMapping_GetItemString(parameters, binding_name);
             }
             if (!current_param) {
                 PyErr_Format(pysqlite_ProgrammingError, "You did not supply a value for binding %d.", i);
diff --git a/Modules/_sqlite/util.c b/Modules/_sqlite/util.c
index d88bc3f..312fe3b 100644
--- a/Modules/_sqlite/util.c
+++ b/Modules/_sqlite/util.c
@@ -132,7 +132,7 @@
     }
 # endif
 #endif
-    return PyLong_FromLong(value);
+    return PyLong_FromLong(Py_SAFE_DOWNCAST(value, sqlite_int64, long));
 }
 
 sqlite_int64
diff --git a/Modules/_sre.c b/Modules/_sre.c
index b1258ee..300d883 100644
--- a/Modules/_sre.c
+++ b/Modules/_sre.c
@@ -4,24 +4,25 @@
  * regular expression matching engine
  *
  * partial history:
- * 1999-10-24 fl  created (based on existing template matcher code)
- * 2000-03-06 fl  first alpha, sort of
- * 2000-08-01 fl  fixes for 1.6b1
- * 2000-08-07 fl  use PyOS_CheckStack() if available
- * 2000-09-20 fl  added expand method
- * 2001-03-20 fl  lots of fixes for 2.1b2
- * 2001-04-15 fl  export copyright as Python attribute, not global
- * 2001-04-28 fl  added __copy__ methods (work in progress)
- * 2001-05-14 fl  fixes for 1.5.2 compatibility
- * 2001-07-01 fl  added BIGCHARSET support (from Martin von Loewis)
- * 2001-10-18 fl  fixed group reset issue (from Matthew Mueller)
- * 2001-10-20 fl  added split primitive; reenable unicode for 1.6/2.0/2.1
- * 2001-10-21 fl  added sub/subn primitive
- * 2001-10-24 fl  added finditer primitive (for 2.2 only)
- * 2001-12-07 fl  fixed memory leak in sub/subn (Guido van Rossum)
- * 2002-11-09 fl  fixed empty sub/subn return type
- * 2003-04-18 mvl fully support 4-byte codes
- * 2003-10-17 gn  implemented non recursive scheme
+ * 1999-10-24 fl   created (based on existing template matcher code)
+ * 2000-03-06 fl   first alpha, sort of
+ * 2000-08-01 fl   fixes for 1.6b1
+ * 2000-08-07 fl   use PyOS_CheckStack() if available
+ * 2000-09-20 fl   added expand method
+ * 2001-03-20 fl   lots of fixes for 2.1b2
+ * 2001-04-15 fl   export copyright as Python attribute, not global
+ * 2001-04-28 fl   added __copy__ methods (work in progress)
+ * 2001-05-14 fl   fixes for 1.5.2 compatibility
+ * 2001-07-01 fl   added BIGCHARSET support (from Martin von Loewis)
+ * 2001-10-18 fl   fixed group reset issue (from Matthew Mueller)
+ * 2001-10-20 fl   added split primitive; reenable unicode for 1.6/2.0/2.1
+ * 2001-10-21 fl   added sub/subn primitive
+ * 2001-10-24 fl   added finditer primitive (for 2.2 only)
+ * 2001-12-07 fl   fixed memory leak in sub/subn (Guido van Rossum)
+ * 2002-11-09 fl   fixed empty sub/subn return type
+ * 2003-04-18 mvl  fully support 4-byte codes
+ * 2003-10-17 gn   implemented non recursive scheme
+ * 2013-02-04 mrab added fullmatch primitive
  *
  * Copyright (c) 1997-2001 by Secret Labs AB.  All rights reserved.
  *
@@ -34,8 +35,6 @@
  * other compatibility work.
  */
 
-#ifndef SRE_RECURSIVE
-
 static char copyright[] =
     " SRE 2.2.2 Copyright (c) 1997-2002 by Secret Labs AB ";
 
@@ -46,6 +45,8 @@
 
 #include "sre.h"
 
+#define SRE_CODE_BITS (8 * sizeof(SRE_CODE))
+
 #include <ctype.h>
 
 /* name of this module, minus the leading underscore */
@@ -58,9 +59,6 @@
 /* defining this one enables tracing */
 #undef VERBOSE
 
-/* defining this enables unicode support (default under 1.6a1 and later) */
-#define HAVE_UNICODE
-
 /* -------------------------------------------------------------------- */
 /* optional features */
 
@@ -70,10 +68,6 @@
 /* enables copy/deepcopy handling (work in progress) */
 #undef USE_BUILTIN_COPY
 
-#if PY_VERSION_HEX < 0x01060000
-#define PyObject_DEL(op) PyMem_DEL((op))
-#endif
-
 /* -------------------------------------------------------------------- */
 
 #if defined(_MSC_VER)
@@ -150,9 +144,6 @@
 /* locale-specific character predicates */
 /* !(c & ~N) == (c < N+1) for any unsigned c, this avoids
  * warnings when c's type supports only numbers < N+1 */
-#define SRE_LOC_IS_DIGIT(ch) (!((ch) & ~255) ? isdigit((ch)) : 0)
-#define SRE_LOC_IS_SPACE(ch) (!((ch) & ~255) ? isspace((ch)) : 0)
-#define SRE_LOC_IS_LINEBREAK(ch) ((ch) == '\n')
 #define SRE_LOC_IS_ALNUM(ch) (!((ch) & ~255) ? isalnum((ch)) : 0)
 #define SRE_LOC_IS_WORD(ch) (SRE_LOC_IS_ALNUM((ch)) || (ch) == '_')
 
@@ -256,1380 +247,32 @@
 
 /* generate 8-bit version */
 
-#define SRE_CHAR unsigned char
-#define SRE_CHARGET(state, buf, index) ((unsigned char*)buf)[index]
-#define SRE_AT sre_at
-#define SRE_COUNT sre_count
-#define SRE_CHARSET sre_charset
-#define SRE_INFO sre_info
-#define SRE_MATCH sre_match
-#define SRE_MATCH_CONTEXT sre_match_context
-#define SRE_SEARCH sre_search
+#define SRE_CHAR Py_UCS1
+#define SIZEOF_SRE_CHAR 1
+#define SRE(F) sre_ucs1_##F
+#include "sre_lib.h"
 
-#define SRE_RECURSIVE
-#include "_sre.c"
-#undef SRE_RECURSIVE
+/* generate 16-bit unicode version */
 
-#undef SRE_SEARCH
-#undef SRE_MATCH
-#undef SRE_MATCH_CONTEXT
-#undef SRE_INFO
-#undef SRE_CHARSET
-#undef SRE_COUNT
-#undef SRE_AT
-#undef SRE_CHAR
-#undef SRE_CHARGET
+#define SRE_CHAR Py_UCS2
+#define SIZEOF_SRE_CHAR 2
+#define SRE(F) sre_ucs2_##F
+#include "sre_lib.h"
 
-/* generate 8/16/32-bit unicode version */
+/* generate 32-bit unicode version */
 
-#define SRE_CHAR void
-#define SRE_CHARGET(state, buf, index) \
-    ((state->charsize==1) ? ((Py_UCS1*)buf)[index] : \
-     (state->charsize==2) ? ((Py_UCS2*)buf)[index] : \
-     ((Py_UCS4*)buf)[index])
-#define SRE_AT sre_uat
-#define SRE_COUNT sre_ucount
-#define SRE_CHARSET sre_ucharset
-#define SRE_INFO sre_uinfo
-#define SRE_MATCH sre_umatch
-#define SRE_MATCH_CONTEXT sre_umatch_context
-#define SRE_SEARCH sre_usearch
-
-#endif /* SRE_RECURSIVE */
-
-/* -------------------------------------------------------------------- */
-/* String matching engine */
-
-/* the following section is compiled twice, with different character
-   settings */
-
-LOCAL(int)
-SRE_AT(SRE_STATE* state, char* ptr, SRE_CODE at)
-{
-    /* check if pointer is at given position */
-
-    Py_ssize_t thisp, thatp;
-
-    switch (at) {
-
-    case SRE_AT_BEGINNING:
-    case SRE_AT_BEGINNING_STRING:
-        return ((void*) ptr == state->beginning);
-
-    case SRE_AT_BEGINNING_LINE:
-        return ((void*) ptr == state->beginning ||
-                SRE_IS_LINEBREAK((int) SRE_CHARGET(state, ptr, -1)));
-
-    case SRE_AT_END:
-        return (((void*) (ptr+state->charsize) == state->end &&
-                 SRE_IS_LINEBREAK((int) SRE_CHARGET(state, ptr, 0))) ||
-                ((void*) ptr == state->end));
-
-    case SRE_AT_END_LINE:
-        return ((void*) ptr == state->end ||
-                SRE_IS_LINEBREAK((int) SRE_CHARGET(state, ptr, 0)));
-
-    case SRE_AT_END_STRING:
-        return ((void*) ptr == state->end);
-
-    case SRE_AT_BOUNDARY:
-        if (state->beginning == state->end)
-            return 0;
-        thatp = ((void*) ptr > state->beginning) ?
-            SRE_IS_WORD((int) SRE_CHARGET(state, ptr, -1)) : 0;
-        thisp = ((void*) ptr < state->end) ?
-            SRE_IS_WORD((int) SRE_CHARGET(state, ptr, 0)) : 0;
-        return thisp != thatp;
-
-    case SRE_AT_NON_BOUNDARY:
-        if (state->beginning == state->end)
-            return 0;
-        thatp = ((void*) ptr > state->beginning) ?
-            SRE_IS_WORD((int) SRE_CHARGET(state, ptr, -1)) : 0;
-        thisp = ((void*) ptr < state->end) ?
-            SRE_IS_WORD((int) SRE_CHARGET(state, ptr, 0)) : 0;
-        return thisp == thatp;
-
-    case SRE_AT_LOC_BOUNDARY:
-        if (state->beginning == state->end)
-            return 0;
-        thatp = ((void*) ptr > state->beginning) ?
-            SRE_LOC_IS_WORD((int) SRE_CHARGET(state, ptr, -1)) : 0;
-        thisp = ((void*) ptr < state->end) ?
-            SRE_LOC_IS_WORD((int) SRE_CHARGET(state, ptr, 0)) : 0;
-        return thisp != thatp;
-
-    case SRE_AT_LOC_NON_BOUNDARY:
-        if (state->beginning == state->end)
-            return 0;
-        thatp = ((void*) ptr > state->beginning) ?
-            SRE_LOC_IS_WORD((int) SRE_CHARGET(state, ptr, -1)) : 0;
-        thisp = ((void*) ptr < state->end) ?
-            SRE_LOC_IS_WORD((int) SRE_CHARGET(state, ptr, 0)) : 0;
-        return thisp == thatp;
-
-    case SRE_AT_UNI_BOUNDARY:
-        if (state->beginning == state->end)
-            return 0;
-        thatp = ((void*) ptr > state->beginning) ?
-            SRE_UNI_IS_WORD((int) SRE_CHARGET(state, ptr, -1)) : 0;
-        thisp = ((void*) ptr < state->end) ?
-            SRE_UNI_IS_WORD((int) SRE_CHARGET(state, ptr, 0)) : 0;
-        return thisp != thatp;
-
-    case SRE_AT_UNI_NON_BOUNDARY:
-        if (state->beginning == state->end)
-            return 0;
-        thatp = ((void*) ptr > state->beginning) ?
-            SRE_UNI_IS_WORD((int) SRE_CHARGET(state, ptr, -1)) : 0;
-        thisp = ((void*) ptr < state->end) ?
-            SRE_UNI_IS_WORD((int) SRE_CHARGET(state, ptr, 0)) : 0;
-        return thisp == thatp;
-
-    }
-
-    return 0;
-}
-
-LOCAL(int)
-SRE_CHARSET(SRE_CODE* set, SRE_CODE ch)
-{
-    /* check if character is a member of the given set */
-
-    int ok = 1;
-
-    for (;;) {
-        switch (*set++) {
-
-        case SRE_OP_FAILURE:
-            return !ok;
-
-        case SRE_OP_LITERAL:
-            /* <LITERAL> <code> */
-            if (ch == set[0])
-                return ok;
-            set++;
-            break;
-
-        case SRE_OP_CATEGORY:
-            /* <CATEGORY> <code> */
-            if (sre_category(set[0], (int) ch))
-                return ok;
-            set += 1;
-            break;
-
-        case SRE_OP_CHARSET:
-            if (sizeof(SRE_CODE) == 2) {
-                /* <CHARSET> <bitmap> (16 bits per code word) */
-                if (ch < 256 && (set[ch >> 4] & (1 << (ch & 15))))
-                    return ok;
-                set += 16;
-            }
-            else {
-                /* <CHARSET> <bitmap> (32 bits per code word) */
-                if (ch < 256 && (set[ch >> 5] & (1u << (ch & 31))))
-                    return ok;
-                set += 8;
-            }
-            break;
-
-        case SRE_OP_RANGE:
-            /* <RANGE> <lower> <upper> */
-            if (set[0] <= ch && ch <= set[1])
-                return ok;
-            set += 2;
-            break;
-
-        case SRE_OP_NEGATE:
-            ok = !ok;
-            break;
-
-        case SRE_OP_BIGCHARSET:
-            /* <BIGCHARSET> <blockcount> <256 blockindices> <blocks> */
-        {
-            Py_ssize_t count, block;
-            count = *(set++);
-
-            if (sizeof(SRE_CODE) == 2) {
-                block = ((unsigned char*)set)[ch >> 8];
-                set += 128;
-                if (set[block*16 + ((ch & 255)>>4)] & (1 << (ch & 15)))
-                    return ok;
-                set += count*16;
-            }
-            else {
-                /* !(c & ~N) == (c < N+1) for any unsigned c, this avoids
-                 * warnings when c's type supports only numbers < N+1 */
-                if (!(ch & ~65535))
-                    block = ((unsigned char*)set)[ch >> 8];
-                else
-                    block = -1;
-                set += 64;
-                if (block >=0 &&
-                    (set[block*8 + ((ch & 255)>>5)] & (1u << (ch & 31))))
-                    return ok;
-                set += count*8;
-            }
-            break;
-        }
-
-        default:
-            /* internal error -- there's not much we can do about it
-               here, so let's just pretend it didn't match... */
-            return 0;
-        }
-    }
-}
-
-LOCAL(Py_ssize_t) SRE_MATCH(SRE_STATE* state, SRE_CODE* pattern);
-
-LOCAL(Py_ssize_t)
-SRE_COUNT(SRE_STATE* state, SRE_CODE* pattern, Py_ssize_t maxcount)
-{
-    SRE_CODE chr;
-    char* ptr = (char *)state->ptr;
-    char* end = (char *)state->end;
-    Py_ssize_t i;
-
-    /* adjust end */
-    if (maxcount < (end - ptr) / state->charsize && maxcount != SRE_MAXREPEAT)
-        end = ptr + maxcount*state->charsize;
-
-    switch (pattern[0]) {
-
-    case SRE_OP_IN:
-        /* repeated set */
-        TRACE(("|%p|%p|COUNT IN\n", pattern, ptr));
-        while (ptr < end &&
-               SRE_CHARSET(pattern + 2, SRE_CHARGET(state, ptr, 0)))
-            ptr += state->charsize;
-        break;
-
-    case SRE_OP_ANY:
-        /* repeated dot wildcard. */
-        TRACE(("|%p|%p|COUNT ANY\n", pattern, ptr));
-        while (ptr < end && !SRE_IS_LINEBREAK(SRE_CHARGET(state, ptr, 0)))
-            ptr += state->charsize;
-        break;
-
-    case SRE_OP_ANY_ALL:
-        /* repeated dot wildcard.  skip to the end of the target
-           string, and backtrack from there */
-        TRACE(("|%p|%p|COUNT ANY_ALL\n", pattern, ptr));
-        ptr = end;
-        break;
-
-    case SRE_OP_LITERAL:
-        /* repeated literal */
-        chr = pattern[1];
-        TRACE(("|%p|%p|COUNT LITERAL %d\n", pattern, ptr, chr));
-        while (ptr < end && (SRE_CODE) SRE_CHARGET(state, ptr, 0) == chr)
-            ptr += state->charsize;
-        break;
-
-    case SRE_OP_LITERAL_IGNORE:
-        /* repeated literal */
-        chr = pattern[1];
-        TRACE(("|%p|%p|COUNT LITERAL_IGNORE %d\n", pattern, ptr, chr));
-        while (ptr < end && (SRE_CODE) state->lower(SRE_CHARGET(state, ptr, 0)) == chr)
-            ptr += state->charsize;
-        break;
-
-    case SRE_OP_NOT_LITERAL:
-        /* repeated non-literal */
-        chr = pattern[1];
-        TRACE(("|%p|%p|COUNT NOT_LITERAL %d\n", pattern, ptr, chr));
-        while (ptr < end && (SRE_CODE) SRE_CHARGET(state, ptr, 0) != chr)
-            ptr += state->charsize;
-        break;
-
-    case SRE_OP_NOT_LITERAL_IGNORE:
-        /* repeated non-literal */
-        chr = pattern[1];
-        TRACE(("|%p|%p|COUNT NOT_LITERAL_IGNORE %d\n", pattern, ptr, chr));
-        while (ptr < end && (SRE_CODE) state->lower(SRE_CHARGET(state, ptr, 0)) != chr)
-            ptr += state->charsize;
-        break;
-
-    default:
-        /* repeated single character pattern */
-        TRACE(("|%p|%p|COUNT SUBPATTERN\n", pattern, ptr));
-        while ((char*) state->ptr < end) {
-            i = SRE_MATCH(state, pattern);
-            if (i < 0)
-                return i;
-            if (!i)
-                break;
-        }
-        TRACE(("|%p|%p|COUNT %" PY_FORMAT_SIZE_T "d\n", pattern, ptr,
-               ((char*)state->ptr - ptr)/state->charsize));
-        return ((char*)state->ptr - ptr)/state->charsize;
-    }
-
-    TRACE(("|%p|%p|COUNT %" PY_FORMAT_SIZE_T "d\n", pattern, ptr,
-           (ptr - (char*) state->ptr)/state->charsize));
-    return (ptr - (char*) state->ptr)/state->charsize;
-}
-
-#if 0 /* not used in this release */
-LOCAL(int)
-SRE_INFO(SRE_STATE* state, SRE_CODE* pattern)
-{
-    /* check if an SRE_OP_INFO block matches at the current position.
-       returns the number of SRE_CODE objects to skip if successful, 0
-       if no match */
-
-    char* end = state->end;
-    char* ptr = state->ptr;
-    Py_ssize_t i;
-
-    /* check minimal length */
-    if (pattern[3] && (end - ptr)/state->charsize < pattern[3])
-        return 0;
-
-    /* check known prefix */
-    if (pattern[2] & SRE_INFO_PREFIX && pattern[5] > 1) {
-        /* <length> <skip> <prefix data> <overlap data> */
-        for (i = 0; i < pattern[5]; i++)
-            if ((SRE_CODE) SRE_CHARGET(state, ptr, i) != pattern[7 + i])
-                return 0;
-        return pattern[0] + 2 * pattern[6];
-    }
-    return pattern[0];
-}
-#endif
-
-/* The macros below should be used to protect recursive SRE_MATCH()
- * calls that *failed* and do *not* return immediately (IOW, those
- * that will backtrack). Explaining:
- *
- * - Recursive SRE_MATCH() returned true: that's usually a success
- *   (besides atypical cases like ASSERT_NOT), therefore there's no
- *   reason to restore lastmark;
- *
- * - Recursive SRE_MATCH() returned false but the current SRE_MATCH()
- *   is returning to the caller: If the current SRE_MATCH() is the
- *   top function of the recursion, returning false will be a matching
- *   failure, and it doesn't matter where lastmark is pointing to.
- *   If it's *not* the top function, it will be a recursive SRE_MATCH()
- *   failure by itself, and the calling SRE_MATCH() will have to deal
- *   with the failure by the same rules explained here (it will restore
- *   lastmark by itself if necessary);
- *
- * - Recursive SRE_MATCH() returned false, and will continue the
- *   outside 'for' loop: must be protected when breaking, since the next
- *   OP could potentially depend on lastmark;
- *
- * - Recursive SRE_MATCH() returned false, and will be called again
- *   inside a local for/while loop: must be protected between each
- *   loop iteration, since the recursive SRE_MATCH() could do anything,
- *   and could potentially depend on lastmark.
- *
- * For more information, check the discussion at SF patch #712900.
- */
-#define LASTMARK_SAVE()     \
-    do { \
-        ctx->lastmark = state->lastmark; \
-        ctx->lastindex = state->lastindex; \
-    } while (0)
-#define LASTMARK_RESTORE()  \
-    do { \
-        state->lastmark = ctx->lastmark; \
-        state->lastindex = ctx->lastindex; \
-    } while (0)
-
-#define RETURN_ERROR(i) do { return i; } while(0)
-#define RETURN_FAILURE do { ret = 0; goto exit; } while(0)
-#define RETURN_SUCCESS do { ret = 1; goto exit; } while(0)
-
-#define RETURN_ON_ERROR(i) \
-    do { if (i < 0) RETURN_ERROR(i); } while (0)
-#define RETURN_ON_SUCCESS(i) \
-    do { RETURN_ON_ERROR(i); if (i > 0) RETURN_SUCCESS; } while (0)
-#define RETURN_ON_FAILURE(i) \
-    do { RETURN_ON_ERROR(i); if (i == 0) RETURN_FAILURE; } while (0)
-
-#define SFY(x) #x
-
-#define DATA_STACK_ALLOC(state, type, ptr) \
-do { \
-    alloc_pos = state->data_stack_base; \
-    TRACE(("allocating %s in %" PY_FORMAT_SIZE_T "d " \
-           "(%" PY_FORMAT_SIZE_T "d)\n", \
-           SFY(type), alloc_pos, sizeof(type))); \
-    if (sizeof(type) > state->data_stack_size - alloc_pos) { \
-        int j = data_stack_grow(state, sizeof(type)); \
-        if (j < 0) return j; \
-        if (ctx_pos != -1) \
-            DATA_STACK_LOOKUP_AT(state, SRE_MATCH_CONTEXT, ctx, ctx_pos); \
-    } \
-    ptr = (type*)(state->data_stack+alloc_pos); \
-    state->data_stack_base += sizeof(type); \
-} while (0)
-
-#define DATA_STACK_LOOKUP_AT(state, type, ptr, pos) \
-do { \
-    TRACE(("looking up %s at %" PY_FORMAT_SIZE_T "d\n", SFY(type), pos)); \
-    ptr = (type*)(state->data_stack+pos); \
-} while (0)
-
-#define DATA_STACK_PUSH(state, data, size) \
-do { \
-    TRACE(("copy data in %p to %" PY_FORMAT_SIZE_T "d " \
-           "(%" PY_FORMAT_SIZE_T "d)\n", \
-           data, state->data_stack_base, size)); \
-    if (size > state->data_stack_size - state->data_stack_base) { \
-        int j = data_stack_grow(state, size); \
-        if (j < 0) return j; \
-        if (ctx_pos != -1) \
-            DATA_STACK_LOOKUP_AT(state, SRE_MATCH_CONTEXT, ctx, ctx_pos); \
-    } \
-    memcpy(state->data_stack+state->data_stack_base, data, size); \
-    state->data_stack_base += size; \
-} while (0)
-
-#define DATA_STACK_POP(state, data, size, discard) \
-do { \
-    TRACE(("copy data to %p from %" PY_FORMAT_SIZE_T "d " \
-           "(%" PY_FORMAT_SIZE_T "d)\n", \
-           data, state->data_stack_base-size, size)); \
-    memcpy(data, state->data_stack+state->data_stack_base-size, size); \
-    if (discard) \
-        state->data_stack_base -= size; \
-} while (0)
-
-#define DATA_STACK_POP_DISCARD(state, size) \
-do { \
-    TRACE(("discard data from %" PY_FORMAT_SIZE_T "d " \
-           "(%" PY_FORMAT_SIZE_T "d)\n", \
-           state->data_stack_base-size, size)); \
-    state->data_stack_base -= size; \
-} while(0)
-
-#define DATA_PUSH(x) \
-    DATA_STACK_PUSH(state, (x), sizeof(*(x)))
-#define DATA_POP(x) \
-    DATA_STACK_POP(state, (x), sizeof(*(x)), 1)
-#define DATA_POP_DISCARD(x) \
-    DATA_STACK_POP_DISCARD(state, sizeof(*(x)))
-#define DATA_ALLOC(t,p) \
-    DATA_STACK_ALLOC(state, t, p)
-#define DATA_LOOKUP_AT(t,p,pos) \
-    DATA_STACK_LOOKUP_AT(state,t,p,pos)
-
-#define MARK_PUSH(lastmark) \
-    do if (lastmark > 0) { \
-        i = lastmark; /* ctx->lastmark may change if reallocated */ \
-        DATA_STACK_PUSH(state, state->mark, (i+1)*sizeof(void*)); \
-    } while (0)
-#define MARK_POP(lastmark) \
-    do if (lastmark > 0) { \
-        DATA_STACK_POP(state, state->mark, (lastmark+1)*sizeof(void*), 1); \
-    } while (0)
-#define MARK_POP_KEEP(lastmark) \
-    do if (lastmark > 0) { \
-        DATA_STACK_POP(state, state->mark, (lastmark+1)*sizeof(void*), 0); \
-    } while (0)
-#define MARK_POP_DISCARD(lastmark) \
-    do if (lastmark > 0) { \
-        DATA_STACK_POP_DISCARD(state, (lastmark+1)*sizeof(void*)); \
-    } while (0)
-
-#define JUMP_NONE            0
-#define JUMP_MAX_UNTIL_1     1
-#define JUMP_MAX_UNTIL_2     2
-#define JUMP_MAX_UNTIL_3     3
-#define JUMP_MIN_UNTIL_1     4
-#define JUMP_MIN_UNTIL_2     5
-#define JUMP_MIN_UNTIL_3     6
-#define JUMP_REPEAT          7
-#define JUMP_REPEAT_ONE_1    8
-#define JUMP_REPEAT_ONE_2    9
-#define JUMP_MIN_REPEAT_ONE  10
-#define JUMP_BRANCH          11
-#define JUMP_ASSERT          12
-#define JUMP_ASSERT_NOT      13
-
-#define DO_JUMP(jumpvalue, jumplabel, nextpattern) \
-    DATA_ALLOC(SRE_MATCH_CONTEXT, nextctx); \
-    nextctx->last_ctx_pos = ctx_pos; \
-    nextctx->jump = jumpvalue; \
-    nextctx->pattern = nextpattern; \
-    ctx_pos = alloc_pos; \
-    ctx = nextctx; \
-    goto entrance; \
-    jumplabel: \
-    while (0) /* gcc doesn't like labels at end of scopes */ \
-
-typedef struct {
-    Py_ssize_t last_ctx_pos;
-    Py_ssize_t jump;
-    char* ptr;
-    SRE_CODE* pattern;
-    Py_ssize_t count;
-    Py_ssize_t lastmark;
-    Py_ssize_t lastindex;
-    union {
-        SRE_CODE chr;
-        SRE_REPEAT* rep;
-    } u;
-} SRE_MATCH_CONTEXT;
-
-/* check if string matches the given pattern.  returns <0 for
-   error, 0 for failure, and 1 for success */
-LOCAL(Py_ssize_t)
-SRE_MATCH(SRE_STATE* state, SRE_CODE* pattern)
-{
-    char* end = (char*)state->end;
-    Py_ssize_t alloc_pos, ctx_pos = -1;
-    Py_ssize_t i, ret = 0;
-    Py_ssize_t jump;
-    unsigned int sigcount=0;
-
-    SRE_MATCH_CONTEXT* ctx;
-    SRE_MATCH_CONTEXT* nextctx;
-
-    TRACE(("|%p|%p|ENTER\n", pattern, state->ptr));
-
-    DATA_ALLOC(SRE_MATCH_CONTEXT, ctx);
-    ctx->last_ctx_pos = -1;
-    ctx->jump = JUMP_NONE;
-    ctx->pattern = pattern;
-    ctx_pos = alloc_pos;
-
-entrance:
-
-    ctx->ptr = (char *)state->ptr;
-
-    if (ctx->pattern[0] == SRE_OP_INFO) {
-        /* optimization info block */
-        /* <INFO> <1=skip> <2=flags> <3=min> ... */
-        if (ctx->pattern[3] && (end - ctx->ptr)/state->charsize < ctx->pattern[3]) {
-            TRACE(("reject (got %" PY_FORMAT_SIZE_T "d chars, "
-                   "need %" PY_FORMAT_SIZE_T "d)\n",
-                   (end - ctx->ptr)/state->charsize,
-                   (Py_ssize_t) ctx->pattern[3]));
-            RETURN_FAILURE;
-        }
-        ctx->pattern += ctx->pattern[1] + 1;
-    }
-
-    for (;;) {
-        ++sigcount;
-        if ((0 == (sigcount & 0xfff)) && PyErr_CheckSignals())
-            RETURN_ERROR(SRE_ERROR_INTERRUPTED);
-
-        switch (*ctx->pattern++) {
-
-        case SRE_OP_MARK:
-            /* set mark */
-            /* <MARK> <gid> */
-            TRACE(("|%p|%p|MARK %d\n", ctx->pattern,
-                   ctx->ptr, ctx->pattern[0]));
-            i = ctx->pattern[0];
-            if (i & 1)
-                state->lastindex = i/2 + 1;
-            if (i > state->lastmark) {
-                /* state->lastmark is the highest valid index in the
-                   state->mark array.  If it is increased by more than 1,
-                   the intervening marks must be set to NULL to signal
-                   that these marks have not been encountered. */
-                Py_ssize_t j = state->lastmark + 1;
-                while (j < i)
-                    state->mark[j++] = NULL;
-                state->lastmark = i;
-            }
-            state->mark[i] = ctx->ptr;
-            ctx->pattern++;
-            break;
-
-        case SRE_OP_LITERAL:
-            /* match literal string */
-            /* <LITERAL> <code> */
-            TRACE(("|%p|%p|LITERAL %d\n", ctx->pattern,
-                   ctx->ptr, *ctx->pattern));
-            if (ctx->ptr >= end || (SRE_CODE) SRE_CHARGET(state, ctx->ptr, 0) != ctx->pattern[0])
-                RETURN_FAILURE;
-            ctx->pattern++;
-            ctx->ptr += state->charsize;
-            break;
-
-        case SRE_OP_NOT_LITERAL:
-            /* match anything that is not literal character */
-            /* <NOT_LITERAL> <code> */
-            TRACE(("|%p|%p|NOT_LITERAL %d\n", ctx->pattern,
-                   ctx->ptr, *ctx->pattern));
-            if (ctx->ptr >= end || (SRE_CODE) SRE_CHARGET(state, ctx->ptr, 0) == ctx->pattern[0])
-                RETURN_FAILURE;
-            ctx->pattern++;
-            ctx->ptr += state->charsize;
-            break;
-
-        case SRE_OP_SUCCESS:
-            /* end of pattern */
-            TRACE(("|%p|%p|SUCCESS\n", ctx->pattern, ctx->ptr));
-            state->ptr = ctx->ptr;
-            RETURN_SUCCESS;
-
-        case SRE_OP_AT:
-            /* match at given position */
-            /* <AT> <code> */
-            TRACE(("|%p|%p|AT %d\n", ctx->pattern, ctx->ptr, *ctx->pattern));
-            if (!SRE_AT(state, ctx->ptr, *ctx->pattern))
-                RETURN_FAILURE;
-            ctx->pattern++;
-            break;
-
-        case SRE_OP_CATEGORY:
-            /* match at given category */
-            /* <CATEGORY> <code> */
-            TRACE(("|%p|%p|CATEGORY %d\n", ctx->pattern,
-                   ctx->ptr, *ctx->pattern));
-            if (ctx->ptr >= end || !sre_category(ctx->pattern[0], SRE_CHARGET(state, ctx->ptr, 0)))
-                RETURN_FAILURE;
-            ctx->pattern++;
-            ctx->ptr += state->charsize;
-            break;
-
-        case SRE_OP_ANY:
-            /* match anything (except a newline) */
-            /* <ANY> */
-            TRACE(("|%p|%p|ANY\n", ctx->pattern, ctx->ptr));
-                if (ctx->ptr >= end || SRE_IS_LINEBREAK(SRE_CHARGET(state, ctx->ptr, 0)))
-                    RETURN_FAILURE;
-            ctx->ptr += state->charsize;
-            break;
-
-        case SRE_OP_ANY_ALL:
-            /* match anything */
-            /* <ANY_ALL> */
-            TRACE(("|%p|%p|ANY_ALL\n", ctx->pattern, ctx->ptr));
-            if (ctx->ptr >= end)
-                RETURN_FAILURE;
-            ctx->ptr += state->charsize;
-            break;
-
-        case SRE_OP_IN:
-            /* match set member (or non_member) */
-            /* <IN> <skip> <set> */
-            TRACE(("|%p|%p|IN\n", ctx->pattern, ctx->ptr));
-                if (ctx->ptr >= end || !SRE_CHARSET(ctx->pattern + 1, SRE_CHARGET(state, ctx->ptr, 0)))
-                    RETURN_FAILURE;
-            ctx->pattern += ctx->pattern[0];
-            ctx->ptr += state->charsize;
-            break;
-
-        case SRE_OP_LITERAL_IGNORE:
-            TRACE(("|%p|%p|LITERAL_IGNORE %d\n",
-                   ctx->pattern, ctx->ptr, ctx->pattern[0]));
-            if (ctx->ptr >= end ||
-                state->lower(SRE_CHARGET(state, ctx->ptr, 0)) != state->lower(*ctx->pattern))
-                RETURN_FAILURE;
-            ctx->pattern++;
-            ctx->ptr += state->charsize;
-            break;
-
-        case SRE_OP_NOT_LITERAL_IGNORE:
-            TRACE(("|%p|%p|NOT_LITERAL_IGNORE %d\n",
-                   ctx->pattern, ctx->ptr, *ctx->pattern));
-            if (ctx->ptr >= end ||
-                state->lower(SRE_CHARGET(state, ctx->ptr, 0)) == state->lower(*ctx->pattern))
-                RETURN_FAILURE;
-            ctx->pattern++;
-            ctx->ptr += state->charsize;
-            break;
-
-        case SRE_OP_IN_IGNORE:
-            TRACE(("|%p|%p|IN_IGNORE\n", ctx->pattern, ctx->ptr));
-            if (ctx->ptr >= end
-                || !SRE_CHARSET(ctx->pattern+1,
-                                (SRE_CODE)state->lower(SRE_CHARGET(state, ctx->ptr, 0))))
-                RETURN_FAILURE;
-            ctx->pattern += ctx->pattern[0];
-            ctx->ptr += state->charsize;
-            break;
-
-        case SRE_OP_JUMP:
-        case SRE_OP_INFO:
-            /* jump forward */
-            /* <JUMP> <offset> */
-            TRACE(("|%p|%p|JUMP %d\n", ctx->pattern,
-                   ctx->ptr, ctx->pattern[0]));
-            ctx->pattern += ctx->pattern[0];
-            break;
-
-        case SRE_OP_BRANCH:
-            /* alternation */
-            /* <BRANCH> <0=skip> code <JUMP> ... <NULL> */
-            TRACE(("|%p|%p|BRANCH\n", ctx->pattern, ctx->ptr));
-            LASTMARK_SAVE();
-            ctx->u.rep = state->repeat;
-            if (ctx->u.rep)
-                MARK_PUSH(ctx->lastmark);
-            for (; ctx->pattern[0]; ctx->pattern += ctx->pattern[0]) {
-                if (ctx->pattern[1] == SRE_OP_LITERAL &&
-                    (ctx->ptr >= end ||
-                     (SRE_CODE) SRE_CHARGET(state, ctx->ptr, 0) != ctx->pattern[2]))
-                    continue;
-                if (ctx->pattern[1] == SRE_OP_IN &&
-                    (ctx->ptr >= end ||
-                     !SRE_CHARSET(ctx->pattern + 3, (SRE_CODE) SRE_CHARGET(state, ctx->ptr, 0))))
-                    continue;
-                state->ptr = ctx->ptr;
-                DO_JUMP(JUMP_BRANCH, jump_branch, ctx->pattern+1);
-                if (ret) {
-                    if (ctx->u.rep)
-                        MARK_POP_DISCARD(ctx->lastmark);
-                    RETURN_ON_ERROR(ret);
-                    RETURN_SUCCESS;
-                }
-                if (ctx->u.rep)
-                    MARK_POP_KEEP(ctx->lastmark);
-                LASTMARK_RESTORE();
-            }
-            if (ctx->u.rep)
-                MARK_POP_DISCARD(ctx->lastmark);
-            RETURN_FAILURE;
-
-        case SRE_OP_REPEAT_ONE:
-            /* match repeated sequence (maximizing regexp) */
-
-            /* this operator only works if the repeated item is
-               exactly one character wide, and we're not already
-               collecting backtracking points.  for other cases,
-               use the MAX_REPEAT operator */
-
-            /* <REPEAT_ONE> <skip> <1=min> <2=max> item <SUCCESS> tail */
-
-            TRACE(("|%p|%p|REPEAT_ONE %d %d\n", ctx->pattern, ctx->ptr,
-                   ctx->pattern[1], ctx->pattern[2]));
-
-            if ((Py_ssize_t) ctx->pattern[1] > (end - ctx->ptr) / state->charsize)
-                RETURN_FAILURE; /* cannot match */
-
-            state->ptr = ctx->ptr;
-
-            ret = SRE_COUNT(state, ctx->pattern+3, ctx->pattern[2]);
-            RETURN_ON_ERROR(ret);
-            DATA_LOOKUP_AT(SRE_MATCH_CONTEXT, ctx, ctx_pos);
-            ctx->count = ret;
-            ctx->ptr += state->charsize * ctx->count;
-
-            /* when we arrive here, count contains the number of
-               matches, and ctx->ptr points to the tail of the target
-               string.  check if the rest of the pattern matches,
-               and backtrack if not. */
-
-            if (ctx->count < (Py_ssize_t) ctx->pattern[1])
-                RETURN_FAILURE;
-
-            if (ctx->pattern[ctx->pattern[0]] == SRE_OP_SUCCESS) {
-                /* tail is empty.  we're finished */
-                state->ptr = ctx->ptr;
-                RETURN_SUCCESS;
-            }
-
-            LASTMARK_SAVE();
-
-            if (ctx->pattern[ctx->pattern[0]] == SRE_OP_LITERAL) {
-                /* tail starts with a literal. skip positions where
-                   the rest of the pattern cannot possibly match */
-                ctx->u.chr = ctx->pattern[ctx->pattern[0]+1];
-                for (;;) {
-                    while (ctx->count >= (Py_ssize_t) ctx->pattern[1] &&
-                           (ctx->ptr >= end ||
-                            SRE_CHARGET(state, ctx->ptr, 0) != ctx->u.chr)) {
-                        ctx->ptr -= state->charsize;
-                        ctx->count--;
-                    }
-                    if (ctx->count < (Py_ssize_t) ctx->pattern[1])
-                        break;
-                    state->ptr = ctx->ptr;
-                    DO_JUMP(JUMP_REPEAT_ONE_1, jump_repeat_one_1,
-                            ctx->pattern+ctx->pattern[0]);
-                    if (ret) {
-                        RETURN_ON_ERROR(ret);
-                        RETURN_SUCCESS;
-                    }
-
-                    LASTMARK_RESTORE();
-
-                    ctx->ptr -= state->charsize;
-                    ctx->count--;
-                }
-
-            } else {
-                /* general case */
-                while (ctx->count >= (Py_ssize_t) ctx->pattern[1]) {
-                    state->ptr = ctx->ptr;
-                    DO_JUMP(JUMP_REPEAT_ONE_2, jump_repeat_one_2,
-                            ctx->pattern+ctx->pattern[0]);
-                    if (ret) {
-                        RETURN_ON_ERROR(ret);
-                        RETURN_SUCCESS;
-                    }
-                    ctx->ptr -= state->charsize;
-                    ctx->count--;
-                    LASTMARK_RESTORE();
-                }
-            }
-            RETURN_FAILURE;
-
-        case SRE_OP_MIN_REPEAT_ONE:
-            /* match repeated sequence (minimizing regexp) */
-
-            /* this operator only works if the repeated item is
-               exactly one character wide, and we're not already
-               collecting backtracking points.  for other cases,
-               use the MIN_REPEAT operator */
-
-            /* <MIN_REPEAT_ONE> <skip> <1=min> <2=max> item <SUCCESS> tail */
-
-            TRACE(("|%p|%p|MIN_REPEAT_ONE %d %d\n", ctx->pattern, ctx->ptr,
-                   ctx->pattern[1], ctx->pattern[2]));
-
-            if ((Py_ssize_t) ctx->pattern[1] > (end - ctx->ptr) / state->charsize)
-                RETURN_FAILURE; /* cannot match */
-
-            state->ptr = ctx->ptr;
-
-            if (ctx->pattern[1] == 0)
-                ctx->count = 0;
-            else {
-                /* count using pattern min as the maximum */
-                ret = SRE_COUNT(state, ctx->pattern+3, ctx->pattern[1]);
-                RETURN_ON_ERROR(ret);
-                DATA_LOOKUP_AT(SRE_MATCH_CONTEXT, ctx, ctx_pos);
-                if (ret < (Py_ssize_t) ctx->pattern[1])
-                    /* didn't match minimum number of times */
-                    RETURN_FAILURE;
-                /* advance past minimum matches of repeat */
-                ctx->count = ret;
-                ctx->ptr += state->charsize * ctx->count;
-            }
-
-            if (ctx->pattern[ctx->pattern[0]] == SRE_OP_SUCCESS) {
-                /* tail is empty.  we're finished */
-                state->ptr = ctx->ptr;
-                RETURN_SUCCESS;
-
-            } else {
-                /* general case */
-                LASTMARK_SAVE();
-                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,
-                            ctx->pattern+ctx->pattern[0]);
-                    if (ret) {
-                        RETURN_ON_ERROR(ret);
-                        RETURN_SUCCESS;
-                    }
-                    state->ptr = ctx->ptr;
-                    ret = SRE_COUNT(state, ctx->pattern+3, 1);
-                    RETURN_ON_ERROR(ret);
-                    DATA_LOOKUP_AT(SRE_MATCH_CONTEXT, ctx, ctx_pos);
-                    if (ret == 0)
-                        break;
-                    assert(ret == 1);
-                    ctx->ptr += state->charsize;
-                    ctx->count++;
-                    LASTMARK_RESTORE();
-                }
-            }
-            RETURN_FAILURE;
-
-        case SRE_OP_REPEAT:
-            /* create repeat context.  all the hard work is done
-               by the UNTIL operator (MAX_UNTIL, MIN_UNTIL) */
-            /* <REPEAT> <skip> <1=min> <2=max> item <UNTIL> tail */
-            TRACE(("|%p|%p|REPEAT %d %d\n", ctx->pattern, ctx->ptr,
-                   ctx->pattern[1], ctx->pattern[2]));
-
-            /* install new repeat context */
-            ctx->u.rep = (SRE_REPEAT*) PyObject_MALLOC(sizeof(*ctx->u.rep));
-            if (!ctx->u.rep) {
-                PyErr_NoMemory();
-                RETURN_FAILURE;
-            }
-            ctx->u.rep->count = -1;
-            ctx->u.rep->pattern = ctx->pattern;
-            ctx->u.rep->prev = state->repeat;
-            ctx->u.rep->last_ptr = NULL;
-            state->repeat = ctx->u.rep;
-
-            state->ptr = ctx->ptr;
-            DO_JUMP(JUMP_REPEAT, jump_repeat, ctx->pattern+ctx->pattern[0]);
-            state->repeat = ctx->u.rep->prev;
-            PyObject_FREE(ctx->u.rep);
-
-            if (ret) {
-                RETURN_ON_ERROR(ret);
-                RETURN_SUCCESS;
-            }
-            RETURN_FAILURE;
-
-        case SRE_OP_MAX_UNTIL:
-            /* maximizing repeat */
-            /* <REPEAT> <skip> <1=min> <2=max> item <MAX_UNTIL> tail */
-
-            /* FIXME: we probably need to deal with zero-width
-               matches in here... */
-
-            ctx->u.rep = state->repeat;
-            if (!ctx->u.rep)
-                RETURN_ERROR(SRE_ERROR_STATE);
-
-            state->ptr = ctx->ptr;
-
-            ctx->count = ctx->u.rep->count+1;
-
-            TRACE(("|%p|%p|MAX_UNTIL %" PY_FORMAT_SIZE_T "d\n", ctx->pattern,
-                   ctx->ptr, ctx->count));
-
-            if (ctx->count < (Py_ssize_t) ctx->u.rep->pattern[1]) {
-                /* not enough matches */
-                ctx->u.rep->count = ctx->count;
-                DO_JUMP(JUMP_MAX_UNTIL_1, jump_max_until_1,
-                        ctx->u.rep->pattern+3);
-                if (ret) {
-                    RETURN_ON_ERROR(ret);
-                    RETURN_SUCCESS;
-                }
-                ctx->u.rep->count = ctx->count-1;
-                state->ptr = ctx->ptr;
-                RETURN_FAILURE;
-            }
-
-            if ((ctx->count < (Py_ssize_t) ctx->u.rep->pattern[2] ||
-                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 */
-                ctx->u.rep->count = ctx->count;
-                LASTMARK_SAVE();
-                MARK_PUSH(ctx->lastmark);
-                /* zero-width match protection */
-                DATA_PUSH(&ctx->u.rep->last_ptr);
-                ctx->u.rep->last_ptr = state->ptr;
-                DO_JUMP(JUMP_MAX_UNTIL_2, jump_max_until_2,
-                        ctx->u.rep->pattern+3);
-                DATA_POP(&ctx->u.rep->last_ptr);
-                if (ret) {
-                    MARK_POP_DISCARD(ctx->lastmark);
-                    RETURN_ON_ERROR(ret);
-                    RETURN_SUCCESS;
-                }
-                MARK_POP(ctx->lastmark);
-                LASTMARK_RESTORE();
-                ctx->u.rep->count = ctx->count-1;
-                state->ptr = ctx->ptr;
-            }
-
-            /* cannot match more repeated items here.  make sure the
-               tail matches */
-            state->repeat = ctx->u.rep->prev;
-            DO_JUMP(JUMP_MAX_UNTIL_3, jump_max_until_3, ctx->pattern);
-            RETURN_ON_SUCCESS(ret);
-            state->repeat = ctx->u.rep;
-            state->ptr = ctx->ptr;
-            RETURN_FAILURE;
-
-        case SRE_OP_MIN_UNTIL:
-            /* minimizing repeat */
-            /* <REPEAT> <skip> <1=min> <2=max> item <MIN_UNTIL> tail */
-
-            ctx->u.rep = state->repeat;
-            if (!ctx->u.rep)
-                RETURN_ERROR(SRE_ERROR_STATE);
-
-            state->ptr = ctx->ptr;
-
-            ctx->count = ctx->u.rep->count+1;
-
-            TRACE(("|%p|%p|MIN_UNTIL %" PY_FORMAT_SIZE_T "d %p\n", ctx->pattern,
-                   ctx->ptr, ctx->count, ctx->u.rep->pattern));
-
-            if (ctx->count < (Py_ssize_t) ctx->u.rep->pattern[1]) {
-                /* not enough matches */
-                ctx->u.rep->count = ctx->count;
-                DO_JUMP(JUMP_MIN_UNTIL_1, jump_min_until_1,
-                        ctx->u.rep->pattern+3);
-                if (ret) {
-                    RETURN_ON_ERROR(ret);
-                    RETURN_SUCCESS;
-                }
-                ctx->u.rep->count = ctx->count-1;
-                state->ptr = ctx->ptr;
-                RETURN_FAILURE;
-            }
-
-            LASTMARK_SAVE();
-
-            /* see if the tail matches */
-            state->repeat = ctx->u.rep->prev;
-            DO_JUMP(JUMP_MIN_UNTIL_2, jump_min_until_2, ctx->pattern);
-            if (ret) {
-                RETURN_ON_ERROR(ret);
-                RETURN_SUCCESS;
-            }
-
-            state->repeat = ctx->u.rep;
-            state->ptr = ctx->ptr;
-
-            LASTMARK_RESTORE();
-
-            if ((ctx->count >= (Py_ssize_t) 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;
-            }
-            ctx->u.rep->count = ctx->count-1;
-            state->ptr = ctx->ptr;
-            RETURN_FAILURE;
-
-        case SRE_OP_GROUPREF:
-            /* match backreference */
-            TRACE(("|%p|%p|GROUPREF %d\n", ctx->pattern,
-                   ctx->ptr, ctx->pattern[0]));
-            i = ctx->pattern[0];
-            {
-                Py_ssize_t groupref = i+i;
-                if (groupref >= state->lastmark) {
-                    RETURN_FAILURE;
-                } else {
-                    char* p = (char*) state->mark[groupref];
-                    char* e = (char*) state->mark[groupref+1];
-                    if (!p || !e || e < p)
-                        RETURN_FAILURE;
-                    while (p < e) {
-                        if (ctx->ptr >= end ||
-                            SRE_CHARGET(state, ctx->ptr, 0) != SRE_CHARGET(state, p, 0))
-                            RETURN_FAILURE;
-                        p += state->charsize;
-                        ctx->ptr += state->charsize;
-                    }
-                }
-            }
-            ctx->pattern++;
-            break;
-
-        case SRE_OP_GROUPREF_IGNORE:
-            /* match backreference */
-            TRACE(("|%p|%p|GROUPREF_IGNORE %d\n", ctx->pattern,
-                   ctx->ptr, ctx->pattern[0]));
-            i = ctx->pattern[0];
-            {
-                Py_ssize_t groupref = i+i;
-                if (groupref >= state->lastmark) {
-                    RETURN_FAILURE;
-                } else {
-                    char* p = (char*) state->mark[groupref];
-                    char* e = (char*) state->mark[groupref+1];
-                    if (!p || !e || e < p)
-                        RETURN_FAILURE;
-                    while (p < e) {
-                        if (ctx->ptr >= end ||
-                            state->lower(SRE_CHARGET(state, ctx->ptr, 0)) !=
-                            state->lower(SRE_CHARGET(state, p, 0)))
-                            RETURN_FAILURE;
-                        p += state->charsize;
-                        ctx->ptr += state->charsize;
-                    }
-                }
-            }
-            ctx->pattern++;
-            break;
-
-        case SRE_OP_GROUPREF_EXISTS:
-            TRACE(("|%p|%p|GROUPREF_EXISTS %d\n", ctx->pattern,
-                   ctx->ptr, ctx->pattern[0]));
-            /* <GROUPREF_EXISTS> <group> <skip> codeyes <JUMP> codeno ... */
-            i = ctx->pattern[0];
-            {
-                Py_ssize_t groupref = i+i;
-                if (groupref >= state->lastmark) {
-                    ctx->pattern += ctx->pattern[1];
-                    break;
-                } else {
-                    SRE_CHAR* p = (SRE_CHAR*) state->mark[groupref];
-                    SRE_CHAR* e = (SRE_CHAR*) state->mark[groupref+1];
-                    if (!p || !e || e < p) {
-                        ctx->pattern += ctx->pattern[1];
-                        break;
-                    }
-                }
-            }
-            ctx->pattern += 2;
-            break;
-
-        case SRE_OP_ASSERT:
-            /* assert subpattern */
-            /* <ASSERT> <skip> <back> <pattern> */
-            TRACE(("|%p|%p|ASSERT %d\n", ctx->pattern,
-                   ctx->ptr, ctx->pattern[1]));
-            state->ptr = ctx->ptr - state->charsize * ctx->pattern[1];
-            if (state->ptr < state->beginning)
-                RETURN_FAILURE;
-            DO_JUMP(JUMP_ASSERT, jump_assert, ctx->pattern+2);
-            RETURN_ON_FAILURE(ret);
-            ctx->pattern += ctx->pattern[0];
-            break;
-
-        case SRE_OP_ASSERT_NOT:
-            /* assert not subpattern */
-            /* <ASSERT_NOT> <skip> <back> <pattern> */
-            TRACE(("|%p|%p|ASSERT_NOT %d\n", ctx->pattern,
-                   ctx->ptr, ctx->pattern[1]));
-            state->ptr = ctx->ptr - state->charsize * ctx->pattern[1];
-            if (state->ptr >= state->beginning) {
-                DO_JUMP(JUMP_ASSERT_NOT, jump_assert_not, ctx->pattern+2);
-                if (ret) {
-                    RETURN_ON_ERROR(ret);
-                    RETURN_FAILURE;
-                }
-            }
-            ctx->pattern += ctx->pattern[0];
-            break;
-
-        case SRE_OP_FAILURE:
-            /* immediate failure */
-            TRACE(("|%p|%p|FAILURE\n", ctx->pattern, ctx->ptr));
-            RETURN_FAILURE;
-
-        default:
-            TRACE(("|%p|%p|UNKNOWN %d\n", ctx->pattern, ctx->ptr,
-                   ctx->pattern[-1]));
-            RETURN_ERROR(SRE_ERROR_ILLEGAL);
-        }
-    }
-
-exit:
-    ctx_pos = ctx->last_ctx_pos;
-    jump = ctx->jump;
-    DATA_POP_DISCARD(ctx);
-    if (ctx_pos == -1)
-        return ret;
-    DATA_LOOKUP_AT(SRE_MATCH_CONTEXT, ctx, ctx_pos);
-
-    switch (jump) {
-        case JUMP_MAX_UNTIL_2:
-            TRACE(("|%p|%p|JUMP_MAX_UNTIL_2\n", ctx->pattern, ctx->ptr));
-            goto jump_max_until_2;
-        case JUMP_MAX_UNTIL_3:
-            TRACE(("|%p|%p|JUMP_MAX_UNTIL_3\n", ctx->pattern, ctx->ptr));
-            goto jump_max_until_3;
-        case JUMP_MIN_UNTIL_2:
-            TRACE(("|%p|%p|JUMP_MIN_UNTIL_2\n", ctx->pattern, ctx->ptr));
-            goto jump_min_until_2;
-        case JUMP_MIN_UNTIL_3:
-            TRACE(("|%p|%p|JUMP_MIN_UNTIL_3\n", ctx->pattern, ctx->ptr));
-            goto jump_min_until_3;
-        case JUMP_BRANCH:
-            TRACE(("|%p|%p|JUMP_BRANCH\n", ctx->pattern, ctx->ptr));
-            goto jump_branch;
-        case JUMP_MAX_UNTIL_1:
-            TRACE(("|%p|%p|JUMP_MAX_UNTIL_1\n", ctx->pattern, ctx->ptr));
-            goto jump_max_until_1;
-        case JUMP_MIN_UNTIL_1:
-            TRACE(("|%p|%p|JUMP_MIN_UNTIL_1\n", ctx->pattern, ctx->ptr));
-            goto jump_min_until_1;
-        case JUMP_REPEAT:
-            TRACE(("|%p|%p|JUMP_REPEAT\n", ctx->pattern, ctx->ptr));
-            goto jump_repeat;
-        case JUMP_REPEAT_ONE_1:
-            TRACE(("|%p|%p|JUMP_REPEAT_ONE_1\n", ctx->pattern, ctx->ptr));
-            goto jump_repeat_one_1;
-        case JUMP_REPEAT_ONE_2:
-            TRACE(("|%p|%p|JUMP_REPEAT_ONE_2\n", ctx->pattern, ctx->ptr));
-            goto jump_repeat_one_2;
-        case JUMP_MIN_REPEAT_ONE:
-            TRACE(("|%p|%p|JUMP_MIN_REPEAT_ONE\n", ctx->pattern, ctx->ptr));
-            goto jump_min_repeat_one;
-        case JUMP_ASSERT:
-            TRACE(("|%p|%p|JUMP_ASSERT\n", ctx->pattern, ctx->ptr));
-            goto jump_assert;
-        case JUMP_ASSERT_NOT:
-            TRACE(("|%p|%p|JUMP_ASSERT_NOT\n", ctx->pattern, ctx->ptr));
-            goto jump_assert_not;
-        case JUMP_NONE:
-            TRACE(("|%p|%p|RETURN %" PY_FORMAT_SIZE_T "d\n", ctx->pattern,
-                   ctx->ptr, ret));
-            break;
-    }
-
-    return ret; /* should never get here */
-}
-
-LOCAL(Py_ssize_t)
-SRE_SEARCH(SRE_STATE* state, SRE_CODE* pattern)
-{
-    char* ptr = (char*)state->start;
-    char* end = (char*)state->end;
-    Py_ssize_t status = 0;
-    Py_ssize_t prefix_len = 0;
-    Py_ssize_t prefix_skip = 0;
-    SRE_CODE* prefix = NULL;
-    SRE_CODE* charset = NULL;
-    SRE_CODE* overlap = NULL;
-    int flags = 0;
-
-    if (pattern[0] == SRE_OP_INFO) {
-        /* optimization info block */
-        /* <INFO> <1=skip> <2=flags> <3=min> <4=max> <5=prefix info>  */
-
-        flags = pattern[2];
-
-        if (pattern[3] > 1) {
-            /* adjust end point (but make sure we leave at least one
-               character in there, so literal search will work) */
-            end -= (pattern[3]-1) * state->charsize;
-            if (end <= ptr)
-                end = ptr + state->charsize;
-        }
-
-        if (flags & SRE_INFO_PREFIX) {
-            /* pattern starts with a known prefix */
-            /* <length> <skip> <prefix data> <overlap data> */
-            prefix_len = pattern[5];
-            prefix_skip = pattern[6];
-            prefix = pattern + 7;
-            overlap = prefix + prefix_len - 1;
-        } else if (flags & SRE_INFO_CHARSET)
-            /* pattern starts with a character from a known set */
-            /* <charset> */
-            charset = pattern + 5;
-
-        pattern += 1 + pattern[1];
-    }
-
-    TRACE(("prefix = %p %" PY_FORMAT_SIZE_T "d %" PY_FORMAT_SIZE_T "d\n",
-           prefix, prefix_len, prefix_skip));
-    TRACE(("charset = %p\n", charset));
-
-#if defined(USE_FAST_SEARCH)
-    if (prefix_len > 1) {
-        /* pattern starts with a known prefix.  use the overlap
-           table to skip forward as fast as we possibly can */
-        Py_ssize_t i = 0;
-        end = (char *)state->end;
-        while (ptr < end) {
-            for (;;) {
-                if ((SRE_CODE) SRE_CHARGET(state, ptr, 0) != prefix[i]) {
-                    if (!i)
-                        break;
-                    else
-                        i = overlap[i];
-                } else {
-                    if (++i == prefix_len) {
-                        /* found a potential match */
-                        TRACE(("|%p|%p|SEARCH SCAN\n", pattern, ptr));
-                        state->start = ptr - (prefix_len - 1) * state->charsize;
-                        state->ptr = ptr - (prefix_len - prefix_skip - 1) * state->charsize;
-                        if (flags & SRE_INFO_LITERAL)
-                            return 1; /* we got all of it */
-                        status = SRE_MATCH(state, pattern + 2*prefix_skip);
-                        if (status != 0)
-                            return status;
-                        /* close but no cigar -- try again */
-                        i = overlap[i];
-                    }
-                    break;
-                }
-            }
-            ptr += state->charsize;
-        }
-        return 0;
-    }
-#endif
-
-    if (pattern[0] == SRE_OP_LITERAL) {
-        /* pattern starts with a literal character.  this is used
-           for short prefixes, and if fast search is disabled */
-        SRE_CODE chr = pattern[1];
-        end = (char*)state->end;
-        for (;;) {
-            while (ptr < end && (SRE_CODE) SRE_CHARGET(state, ptr, 0) != chr)
-                ptr += state->charsize;
-            if (ptr >= end)
-                return 0;
-            TRACE(("|%p|%p|SEARCH LITERAL\n", pattern, ptr));
-            state->start = ptr;
-            ptr += state->charsize;
-            state->ptr = ptr;
-            if (flags & SRE_INFO_LITERAL)
-                return 1; /* we got all of it */
-            status = SRE_MATCH(state, pattern + 2);
-            if (status != 0)
-                break;
-        }
-    } else if (charset) {
-        /* pattern starts with a character from a known set */
-        end = (char*)state->end;
-        for (;;) {
-            while (ptr < end && !SRE_CHARSET(charset, SRE_CHARGET(state, ptr, 0)))
-                ptr += state->charsize;
-            if (ptr >= end)
-                return 0;
-            TRACE(("|%p|%p|SEARCH CHARSET\n", pattern, ptr));
-            state->start = ptr;
-            state->ptr = ptr;
-            status = SRE_MATCH(state, pattern);
-            if (status != 0)
-                break;
-            ptr += state->charsize;
-        }
-    } else
-        /* general case */
-        while (ptr <= end) {
-            TRACE(("|%p|%p|SEARCH\n", pattern, ptr));
-            state->start = state->ptr = ptr;
-            ptr += state->charsize;
-            status = SRE_MATCH(state, pattern);
-            if (status != 0)
-                break;
-        }
-
-    return status;
-}
-
-#if !defined(SRE_RECURSIVE)
+#define SRE_CHAR Py_UCS4
+#define SIZEOF_SRE_CHAR 4
+#define SRE(F) sre_ucs4_##F
+#include "sre_lib.h"
 
 /* -------------------------------------------------------------------- */
 /* factories and destructors */
 
 /* see sre.h for object declarations */
-static PyObject*pattern_new_match(PatternObject*, SRE_STATE*, int);
+static PyObject*pattern_new_match(PatternObject*, SRE_STATE*, Py_ssize_t);
 static PyObject*pattern_scanner(PatternObject*, PyObject*, PyObject* kw);
 
-static int
-sre_literal_template(int charsize, char* ptr, Py_ssize_t len)
-{
-    /* check if given string is a literal template (i.e. no escapes) */
-    struct {
-        int charsize;
-    } state = {
-        charsize
-    };
-    while (len-- > 0) {
-        if (SRE_CHARGET((&state), ptr, 0) == '\\')
-            return 0;
-        ptr += charsize;
-    }
-    return 1;
-}
-
 static PyObject *
 sre_codesize(PyObject* self, PyObject *unused)
 {
@@ -1665,72 +308,41 @@
 
 static void*
 getstring(PyObject* string, Py_ssize_t* p_length,
-          int* p_logical_charsize, int* p_charsize,
+          int* p_isbytes, int* p_charsize,
           Py_buffer *view)
 {
     /* given a python object, return a data pointer, a length (in
        characters), and a character size.  return NULL if the object
        is not a string (or not compatible) */
 
-    PyBufferProcs *buffer;
-    Py_ssize_t size, bytes;
-    int charsize;
-    void* ptr;
-
     /* Unicode objects do not support the buffer API. So, get the data
        directly instead. */
     if (PyUnicode_Check(string)) {
         if (PyUnicode_READY(string) == -1)
             return NULL;
-        ptr = PyUnicode_DATA(string);
         *p_length = PyUnicode_GET_LENGTH(string);
         *p_charsize = PyUnicode_KIND(string);
-        *p_logical_charsize = 4;
-        return ptr;
+        *p_isbytes = 0;
+        return PyUnicode_DATA(string);
     }
 
     /* get pointer to byte string buffer */
-    view->len = -1;
-    buffer = Py_TYPE(string)->tp_as_buffer;
-    if (!buffer || !buffer->bf_getbuffer ||
-        (*buffer->bf_getbuffer)(string, view, PyBUF_SIMPLE) < 0) {
-            PyErr_SetString(PyExc_TypeError, "expected string or buffer");
-            return NULL;
+    if (PyObject_GetBuffer(string, view, PyBUF_SIMPLE) != 0) {
+        PyErr_SetString(PyExc_TypeError, "expected string or buffer");
+        return NULL;
     }
 
-    /* determine buffer size */
-    bytes = view->len;
-    ptr = view->buf;
+    *p_length = view->len;
+    *p_charsize = 1;
+    *p_isbytes = 1;
 
-    if (bytes < 0) {
-        PyErr_SetString(PyExc_TypeError, "buffer has negative size");
-        goto err;
+    if (view->buf == NULL) {
+        PyErr_SetString(PyExc_ValueError, "Buffer is NULL");
+        PyBuffer_Release(view);
+        view->buf = NULL;
+        return NULL;
     }
-
-    /* determine character size */
-    size = PyObject_Size(string);
-
-    if (PyBytes_Check(string) || bytes == size)
-        charsize = 1;
-    else {
-        PyErr_SetString(PyExc_TypeError, "buffer size mismatch");
-        goto err;
-    }
-
-    *p_length = size;
-    *p_charsize = charsize;
-    *p_logical_charsize = charsize;
-
-    if (ptr == NULL) {
-            PyErr_SetString(PyExc_ValueError,
-                            "Buffer is NULL");
-            goto err;
-    }
-    return ptr;
-  err:
-    PyBuffer_Release(view);
-    view->buf = NULL;
-    return NULL;
+    return view->buf;
 }
 
 LOCAL(PyObject*)
@@ -1740,7 +352,7 @@
     /* prepare state object */
 
     Py_ssize_t length;
-    int logical_charsize, charsize;
+    int isbytes, charsize;
     void* ptr;
 
     memset(state, 0, sizeof(SRE_STATE));
@@ -1749,16 +361,16 @@
     state->lastindex = -1;
 
     state->buffer.buf = NULL;
-    ptr = getstring(string, &length, &logical_charsize, &charsize, &state->buffer);
+    ptr = getstring(string, &length, &isbytes, &charsize, &state->buffer);
     if (!ptr)
         goto err;
 
-    if (logical_charsize == 1 && pattern->logical_charsize > 1) {
+    if (isbytes && pattern->isbytes == 0) {
         PyErr_SetString(PyExc_TypeError,
                         "can't use a string pattern on a bytes-like object");
         goto err;
     }
-    if (logical_charsize > 1 && pattern->logical_charsize == 1) {
+    if (!isbytes && pattern->isbytes > 0) {
         PyErr_SetString(PyExc_TypeError,
                         "can't use a bytes pattern on a string-like object");
         goto err;
@@ -1775,7 +387,7 @@
     else if (end > length)
         end = length;
 
-    state->logical_charsize = logical_charsize;
+    state->isbytes = isbytes;
     state->charsize = charsize;
 
     state->beginning = ptr;
@@ -1816,6 +428,24 @@
     (((char*)(member) - (char*)(state)->beginning) / (state)->charsize)
 
 LOCAL(PyObject*)
+getslice(int isbytes, const void *ptr,
+         PyObject* string, Py_ssize_t start, Py_ssize_t end)
+{
+    if (isbytes) {
+        if (PyBytes_CheckExact(string) &&
+            start == 0 && end == PyBytes_GET_SIZE(string)) {
+            Py_INCREF(string);
+            return string;
+        }
+        return PyBytes_FromStringAndSize(
+                (const char *)ptr + start, end - start);
+    }
+    else {
+        return PyUnicode_Substring(string, start, end);
+    }
+}
+
+LOCAL(PyObject*)
 state_getslice(SRE_STATE* state, Py_ssize_t index, PyObject* string, int empty)
 {
     Py_ssize_t i, j;
@@ -1835,11 +465,11 @@
         j = STATE_OFFSET(state, state->mark[index+1]);
     }
 
-    return PySequence_GetSlice(string, i, j);
+    return getslice(state->isbytes, state->beginning, string, i, j);
 }
 
 static void
-pattern_error(int status)
+pattern_error(Py_ssize_t status)
 {
     switch (status) {
     case SRE_ERROR_RECURSION_LIMIT:
@@ -1868,15 +498,35 @@
 {
     if (self->weakreflist != NULL)
         PyObject_ClearWeakRefs((PyObject *) self);
-    if (self->view.buf)
-        PyBuffer_Release(&self->view);
     Py_XDECREF(self->pattern);
     Py_XDECREF(self->groupindex);
     Py_XDECREF(self->indexgroup);
     PyObject_DEL(self);
 }
 
-static PyObject*
+LOCAL(Py_ssize_t)
+sre_match(SRE_STATE* state, SRE_CODE* pattern, int match_all)
+{
+    if (state->charsize == 1)
+        return sre_ucs1_match(state, pattern, match_all);
+    if (state->charsize == 2)
+        return sre_ucs2_match(state, pattern, match_all);
+    assert(state->charsize == 4);
+    return sre_ucs4_match(state, pattern, match_all);
+}
+
+LOCAL(Py_ssize_t)
+sre_search(SRE_STATE* state, SRE_CODE* pattern)
+{
+    if (state->charsize == 1)
+        return sre_ucs1_search(state, pattern);
+    if (state->charsize == 2)
+        return sre_ucs2_search(state, pattern);
+    assert(state->charsize == 4);
+    return sre_ucs4_search(state, pattern);
+}
+
+static PyObject *
 fix_string_param(PyObject *string, PyObject *string2, const char *oldname)
 {
     if (string2 != NULL) {
@@ -1900,17 +550,54 @@
     return string;
 }
 
+static PyObject *
+pattern_match(PatternObject *self, PyObject *args, PyObject *kwargs)
+{
+    static char *_keywords[] = {"string", "pos", "endpos", "pattern", NULL};
+    PyObject *string = NULL;
+    Py_ssize_t pos = 0;
+    Py_ssize_t endpos = PY_SSIZE_T_MAX;
+    PyObject *pattern = NULL;
+    SRE_STATE state;
+    Py_ssize_t status;
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+        "|Onn$O:match", _keywords,
+        &string, &pos, &endpos, &pattern))
+        return NULL;
+    string = fix_string_param(string, pattern, "pattern");
+    if (!string)
+        return NULL;
+    string = state_init(&state, (PatternObject *)self, string, pos, endpos);
+    if (!string)
+        return NULL;
+
+    state.ptr = state.start;
+
+    TRACE(("|%p|%p|MATCH\n", PatternObject_GetCode(self), state.ptr));
+
+    status = sre_match(&state, PatternObject_GetCode(self), 0);
+
+    TRACE(("|%p|%p|END\n", PatternObject_GetCode(self), state.ptr));
+    if (PyErr_Occurred())
+        return NULL;
+
+    state_fini(&state);
+
+    return (PyObject *)pattern_new_match(self, &state, status);
+}
+
 static PyObject*
-pattern_match(PatternObject* self, PyObject* args, PyObject* kw)
+pattern_fullmatch(PatternObject* self, PyObject* args, PyObject* kw)
 {
     SRE_STATE state;
-    int status;
+    Py_ssize_t status;
 
     PyObject *string = NULL, *string2 = NULL;
     Py_ssize_t start = 0;
     Py_ssize_t end = PY_SSIZE_T_MAX;
     static char* kwlist[] = { "string", "pos", "endpos", "pattern", NULL };
-    if (!PyArg_ParseTupleAndKeywords(args, kw, "|Onn$O:match", kwlist,
+    if (!PyArg_ParseTupleAndKeywords(args, kw, "|Onn$O:fullmatch", kwlist,
                                      &string, &start, &end, &string2))
         return NULL;
 
@@ -1924,13 +611,9 @@
 
     state.ptr = state.start;
 
-    TRACE(("|%p|%p|MATCH\n", PatternObject_GetCode(self), state.ptr));
+    TRACE(("|%p|%p|FULLMATCH\n", PatternObject_GetCode(self), state.ptr));
 
-    if (state.logical_charsize == 1) {
-        status = sre_match(&state, PatternObject_GetCode(self));
-    } else {
-        status = sre_umatch(&state, PatternObject_GetCode(self));
-    }
+    status = sre_match(&state, PatternObject_GetCode(self), 1);
 
     TRACE(("|%p|%p|END\n", PatternObject_GetCode(self), state.ptr));
     if (PyErr_Occurred())
@@ -1945,7 +628,7 @@
 pattern_search(PatternObject* self, PyObject* args, PyObject* kw)
 {
     SRE_STATE state;
-    int status;
+    Py_ssize_t status;
 
     PyObject *string = NULL, *string2 = NULL;
     Py_ssize_t start = 0;
@@ -1965,11 +648,7 @@
 
     TRACE(("|%p|%p|SEARCH\n", PatternObject_GetCode(self), state.ptr));
 
-    if (state.logical_charsize == 1) {
-        status = sre_search(&state, PatternObject_GetCode(self));
-    } else {
-        status = sre_usearch(&state, PatternObject_GetCode(self));
-    }
+    status = sre_search(&state, PatternObject_GetCode(self));
 
     TRACE(("|%p|%p|END\n", PatternObject_GetCode(self), state.ptr));
 
@@ -2029,59 +708,11 @@
 #endif
 
 static PyObject*
-join_list(PyObject* list, PyObject* string)
-{
-    /* join list elements */
-
-    PyObject* joiner;
-#if PY_VERSION_HEX >= 0x01060000
-    PyObject* function;
-    PyObject* args;
-#endif
-    PyObject* result;
-
-    joiner = PySequence_GetSlice(string, 0, 0);
-    if (!joiner)
-        return NULL;
-
-    if (PyList_GET_SIZE(list) == 0) {
-        Py_DECREF(list);
-        return joiner;
-    }
-
-#if PY_VERSION_HEX >= 0x01060000
-    function = PyObject_GetAttrString(joiner, "join");
-    if (!function) {
-        Py_DECREF(joiner);
-        return NULL;
-    }
-    args = PyTuple_New(1);
-    if (!args) {
-        Py_DECREF(function);
-        Py_DECREF(joiner);
-        return NULL;
-    }
-    PyTuple_SET_ITEM(args, 0, list);
-    result = PyObject_CallObject(function, args);
-    Py_DECREF(args); /* also removes list */
-    Py_DECREF(function);
-#else
-    result = call(
-        "string", "join",
-        PyTuple_Pack(2, list, joiner)
-        );
-#endif
-    Py_DECREF(joiner);
-
-    return result;
-}
-
-static PyObject*
 pattern_findall(PatternObject* self, PyObject* args, PyObject* kw)
 {
     SRE_STATE state;
     PyObject* list;
-    int status;
+    Py_ssize_t status;
     Py_ssize_t i, b, e;
 
     PyObject *string = NULL, *string2 = NULL;
@@ -2114,12 +745,7 @@
 
         state.ptr = state.start;
 
-        if (state.logical_charsize == 1) {
-            status = sre_search(&state, PatternObject_GetCode(self));
-        } else {
-            status = sre_usearch(&state, PatternObject_GetCode(self));
-        }
-
+        status = sre_search(&state, PatternObject_GetCode(self));
         if (PyErr_Occurred())
             goto error;
 
@@ -2135,7 +761,8 @@
         case 0:
             b = STATE_OFFSET(&state, state.start);
             e = STATE_OFFSET(&state, state.ptr);
-            item = PySequence_GetSlice(string, b, e);
+            item = getslice(state.isbytes, state.beginning,
+                            string, b, e);
             if (!item)
                 goto error;
             break;
@@ -2181,7 +808,6 @@
 
 }
 
-#if PY_VERSION_HEX >= 0x02020000
 static PyObject*
 pattern_finditer(PatternObject* pattern, PyObject* args, PyObject* kw)
 {
@@ -2203,7 +829,6 @@
 
     return iterator;
 }
-#endif
 
 static PyObject*
 pattern_split(PatternObject* self, PyObject* args, PyObject* kw)
@@ -2211,7 +836,7 @@
     SRE_STATE state;
     PyObject* list;
     PyObject* item;
-    int status;
+    Py_ssize_t status;
     Py_ssize_t n;
     Py_ssize_t i;
     void* last;
@@ -2246,12 +871,7 @@
 
         state.ptr = state.start;
 
-        if (state.logical_charsize == 1) {
-            status = sre_search(&state, PatternObject_GetCode(self));
-        } else {
-            status = sre_usearch(&state, PatternObject_GetCode(self));
-        }
-
+        status = sre_search(&state, PatternObject_GetCode(self));
         if (PyErr_Occurred())
             goto error;
 
@@ -2271,7 +891,7 @@
         }
 
         /* get segment before this match */
-        item = PySequence_GetSlice(
+        item = getslice(state.isbytes, state.beginning,
             string, STATE_OFFSET(&state, last),
             STATE_OFFSET(&state, state.start)
             );
@@ -2300,7 +920,7 @@
     }
 
     /* get segment following last match (even if empty) */
-    item = PySequence_GetSlice(
+    item = getslice(state.isbytes, state.beginning,
         string, STATE_OFFSET(&state, last), state.endpos
         );
     if (!item)
@@ -2326,15 +946,16 @@
 {
     SRE_STATE state;
     PyObject* list;
+    PyObject* joiner;
     PyObject* item;
     PyObject* filter;
     PyObject* args;
     PyObject* match;
     void* ptr;
-    int status;
+    Py_ssize_t status;
     Py_ssize_t n;
     Py_ssize_t i, b, e;
-    int logical_charsize, charsize;
+    int isbytes, charsize;
     int filter_is_callable;
     Py_buffer view;
 
@@ -2347,10 +968,13 @@
         /* if not callable, check if it's a literal string */
         int literal;
         view.buf = NULL;
-        ptr = getstring(ptemplate, &n, &logical_charsize, &charsize, &view);
+        ptr = getstring(ptemplate, &n, &isbytes, &charsize, &view);
         b = charsize;
         if (ptr) {
-            literal = sre_literal_template(b, ptr, n);
+            if (charsize == 1)
+                literal = memchr(ptr, '\\', n) == NULL;
+            else
+                literal = PyUnicode_FindChar(ptemplate, '\\', 0, n, 1) == -1;
         } else {
             PyErr_Clear();
             literal = 0;
@@ -2394,12 +1018,7 @@
 
         state.ptr = state.start;
 
-        if (state.logical_charsize == 1) {
-            status = sre_search(&state, PatternObject_GetCode(self));
-        } else {
-            status = sre_usearch(&state, PatternObject_GetCode(self));
-        }
-
+        status = sre_search(&state, PatternObject_GetCode(self));
         if (PyErr_Occurred())
             goto error;
 
@@ -2415,7 +1034,8 @@
 
         if (i < b) {
             /* get segment before this match */
-            item = PySequence_GetSlice(string, i, b);
+            item = getslice(state.isbytes, state.beginning,
+                string, i, b);
             if (!item)
                 goto error;
             status = PyList_Append(list, item);
@@ -2470,7 +1090,8 @@
 
     /* get segment following last match */
     if (i < state.endpos) {
-        item = PySequence_GetSlice(string, i, state.endpos);
+        item = getslice(state.isbytes, state.beginning,
+                        string, i, state.endpos);
         if (!item)
             goto error;
         status = PyList_Append(list, item);
@@ -2484,10 +1105,25 @@
     Py_DECREF(filter);
 
     /* convert list to single string (also removes list) */
-    item = join_list(list, string);
-
-    if (!item)
+    joiner = getslice(state.isbytes, state.beginning, string, 0, 0);
+    if (!joiner) {
+        Py_DECREF(list);
         return NULL;
+    }
+    if (PyList_GET_SIZE(list) == 0) {
+        Py_DECREF(list);
+        item = joiner;
+    }
+    else {
+        if (state.isbytes)
+            item = _PyBytes_Join(joiner, list);
+        else
+            item = PyUnicode_Join(joiner, list);
+        Py_DECREF(joiner);
+        Py_DECREF(list);
+        if (!item)
+            return NULL;
+    }
 
     if (subn)
         return Py_BuildValue("Nn", item, n);
@@ -2581,10 +1217,94 @@
 #endif
 }
 
+static PyObject *
+pattern_repr(PatternObject *obj)
+{
+    static const struct {
+        const char *name;
+        int value;
+    } flag_names[] = {
+        {"re.TEMPLATE", SRE_FLAG_TEMPLATE},
+        {"re.IGNORECASE", SRE_FLAG_IGNORECASE},
+        {"re.LOCALE", SRE_FLAG_LOCALE},
+        {"re.MULTILINE", SRE_FLAG_MULTILINE},
+        {"re.DOTALL", SRE_FLAG_DOTALL},
+        {"re.UNICODE", SRE_FLAG_UNICODE},
+        {"re.VERBOSE", SRE_FLAG_VERBOSE},
+        {"re.DEBUG", SRE_FLAG_DEBUG},
+        {"re.ASCII", SRE_FLAG_ASCII},
+    };
+    PyObject *result = NULL;
+    PyObject *flag_items;
+    int i;
+    int flags = obj->flags;
+
+    /* Omit re.UNICODE for valid string patterns. */
+    if (obj->isbytes == 0 &&
+        (flags & (SRE_FLAG_LOCALE|SRE_FLAG_UNICODE|SRE_FLAG_ASCII)) ==
+         SRE_FLAG_UNICODE)
+        flags &= ~SRE_FLAG_UNICODE;
+
+    flag_items = PyList_New(0);
+    if (!flag_items)
+        return NULL;
+
+    for (i = 0; i < Py_ARRAY_LENGTH(flag_names); i++) {
+        if (flags & flag_names[i].value) {
+            PyObject *item = PyUnicode_FromString(flag_names[i].name);
+            if (!item)
+                goto done;
+
+            if (PyList_Append(flag_items, item) < 0) {
+                Py_DECREF(item);
+                goto done;
+            }
+            Py_DECREF(item);
+            flags &= ~flag_names[i].value;
+        }
+    }
+    if (flags) {
+        PyObject *item = PyUnicode_FromFormat("0x%x", flags);
+        if (!item)
+            goto done;
+
+        if (PyList_Append(flag_items, item) < 0) {
+            Py_DECREF(item);
+            goto done;
+        }
+        Py_DECREF(item);
+    }
+
+    if (PyList_Size(flag_items) > 0) {
+        PyObject *flags_result;
+        PyObject *sep = PyUnicode_FromString("|");
+        if (!sep)
+            goto done;
+        flags_result = PyUnicode_Join(sep, flag_items);
+        Py_DECREF(sep);
+        if (!flags_result)
+            goto done;
+        result = PyUnicode_FromFormat("re.compile(%.200R, %S)",
+                                      obj->pattern, flags_result);
+        Py_DECREF(flags_result);
+    }
+    else {
+        result = PyUnicode_FromFormat("re.compile(%.200R)", obj->pattern);
+    }
+
+done:
+    Py_DECREF(flag_items);
+    return result;
+}
+
 PyDoc_STRVAR(pattern_match_doc,
 "match(string[, pos[, endpos]]) -> match object or None.\n\
     Matches zero or more characters at the beginning of the string");
 
+PyDoc_STRVAR(pattern_fullmatch_doc,
+"fullmatch(string[, pos[, endpos]]) -> match object or None.\n\
+    Matches against all of the string");
+
 PyDoc_STRVAR(pattern_search_doc,
 "search(string[, pos[, endpos]]) -> match object or None.\n\
     Scan through string looking for a match, and return a corresponding\n\
@@ -2620,6 +1340,8 @@
 static PyMethodDef pattern_methods[] = {
     {"match", (PyCFunction) pattern_match, METH_VARARGS|METH_KEYWORDS,
         pattern_match_doc},
+    {"fullmatch", (PyCFunction) pattern_fullmatch, METH_VARARGS|METH_KEYWORDS,
+        pattern_fullmatch_doc},
     {"search", (PyCFunction) pattern_search, METH_VARARGS|METH_KEYWORDS,
         pattern_search_doc},
     {"sub", (PyCFunction) pattern_sub, METH_VARARGS|METH_KEYWORDS,
@@ -2630,10 +1352,8 @@
         pattern_split_doc},
     {"findall", (PyCFunction) pattern_findall, METH_VARARGS|METH_KEYWORDS,
         pattern_findall_doc},
-#if PY_VERSION_HEX >= 0x02020000
     {"finditer", (PyCFunction) pattern_finditer, METH_VARARGS|METH_KEYWORDS,
         pattern_finditer_doc},
-#endif
     {"scanner", (PyCFunction) pattern_scanner, METH_VARARGS|METH_KEYWORDS},
     {"__copy__", (PyCFunction) pattern_copy, METH_NOARGS},
     {"__deepcopy__", (PyCFunction) pattern_deepcopy, METH_O},
@@ -2658,7 +1378,7 @@
     0,                                  /* tp_getattr */
     0,                                  /* tp_setattr */
     0,                                  /* tp_reserved */
-    0,                                  /* tp_repr */
+    (reprfunc)pattern_repr,             /* tp_repr */
     0,                                  /* tp_as_number */
     0,                                  /* tp_as_sequence */
     0,                                  /* tp_as_mapping */
@@ -2711,7 +1431,6 @@
     self->pattern = NULL;
     self->groupindex = NULL;
     self->indexgroup = NULL;
-    self->view.buf = NULL;
 
     self->codesize = n;
 
@@ -2732,16 +1451,20 @@
     }
 
     if (pattern == Py_None) {
-        self->logical_charsize = -1;
-        self->charsize = -1;
+        self->isbytes = -1;
     }
     else {
         Py_ssize_t p_length;
-        if (!getstring(pattern, &p_length, &self->logical_charsize,
-                       &self->charsize, &self->view)) {
+        int charsize;
+        Py_buffer view;
+        view.buf = NULL;
+        if (!getstring(pattern, &p_length, &self->isbytes,
+                       &charsize, &view)) {
             Py_DECREF(self);
             return NULL;
         }
+        if (view.buf)
+            PyBuffer_Release(&view);
     }
 
     Py_INCREF(pattern);
@@ -2827,7 +1550,7 @@
         skip = *code;                                   \
         VTRACE(("%lu (skip to %p)\n",                   \
                (unsigned long)skip, code+skip));        \
-        if (skip-adj > end-code)                        \
+        if (skip-adj > (Py_uintptr_t)(end - code))      \
             FAIL;                                       \
         code++;                                         \
     } while (0)
@@ -2859,8 +1582,8 @@
             break;
 
         case SRE_OP_CHARSET:
-            offset = 32/sizeof(SRE_CODE); /* 32-byte bitmap */
-            if (offset > end-code)
+            offset = 256/SRE_CODE_BITS; /* 256-bit bitmap */
+            if (offset > (Py_uintptr_t)(end - code))
                 FAIL;
             code += offset;
             break;
@@ -2868,7 +1591,7 @@
         case SRE_OP_BIGCHARSET:
             GET_ARG; /* Number of blocks */
             offset = 256/sizeof(SRE_CODE); /* 256-byte table */
-            if (offset > end-code)
+            if (offset > (Py_uintptr_t)(end - code))
                 FAIL;
             /* Make sure that each byte points to a valid block */
             for (i = 0; i < 256; i++) {
@@ -2876,8 +1599,8 @@
                     FAIL;
             }
             code += offset;
-            offset = arg * 32/sizeof(SRE_CODE); /* 32-byte bitmap times arg */
-            if (offset > end-code)
+            offset = arg * (256/SRE_CODE_BITS); /* 256-bit bitmap times arg */
+            if (offset > (Py_uintptr_t)(end - code))
                 FAIL;
             code += offset;
             break;
@@ -2940,7 +1663,7 @@
                sre_match() code is robust even if they don't, and the worst
                you can get is nonsensical match results. */
             GET_ARG;
-            if (arg > 2*groups+1) {
+            if (arg > 2 * (size_t)groups + 1) {
                 VTRACE(("arg=%d, groups=%d\n", (int)arg, (int)groups));
                 FAIL;
             }
@@ -3028,11 +1751,11 @@
                     GET_ARG; prefix_len = arg;
                     GET_ARG;
                     /* Here comes the prefix string */
-                    if (prefix_len > newcode-code)
+                    if (prefix_len > (Py_uintptr_t)(newcode - code))
                         FAIL;
                     code += prefix_len;
                     /* And here comes the overlap table */
-                    if (prefix_len > newcode-code)
+                    if (prefix_len > (Py_uintptr_t)(newcode - code))
                         FAIL;
                     /* Each overlap value should be < prefix_len */
                     for (i = 0; i < prefix_len; i++) {
@@ -3123,7 +1846,7 @@
         case SRE_OP_GROUPREF:
         case SRE_OP_GROUPREF_IGNORE:
             GET_ARG;
-            if (arg >= groups)
+            if (arg >= (size_t)groups)
                 FAIL;
             break;
 
@@ -3132,7 +1855,7 @@
                'group' is either an integer group number or a group name,
                'then' and 'else' are sub-regexes, and 'else' is optional. */
             GET_ARG;
-            if (arg >= groups)
+            if (arg >= (size_t)groups)
                 FAIL;
             GET_SKIP_ADJ(1);
             code--; /* The skip is relative to the first arg! */
@@ -3161,7 +1884,7 @@
                to allow arbitrary jumps anywhere in the code; so we just look
                for a JUMP opcode preceding our skip target.
             */
-            if (skip >= 3 && skip-3 < end-code &&
+            if (skip >= 3 && skip-3 < (Py_uintptr_t)(end - code) &&
                 code[skip-3] == SRE_OP_JUMP)
             {
                 VTRACE(("both then and else parts present\n"));
@@ -3245,6 +1968,12 @@
 static PyObject*
 match_getslice_by_index(MatchObject* self, Py_ssize_t index, PyObject* def)
 {
+    Py_ssize_t length;
+    int isbytes, charsize;
+    Py_buffer view;
+    PyObject *result;
+    void* ptr;
+
     if (index < 0 || index >= self->groups) {
         /* raise IndexError if we were given a bad group number */
         PyErr_SetString(
@@ -3262,9 +1991,14 @@
         return def;
     }
 
-    return PySequence_GetSlice(
-        self->string, self->mark[index], self->mark[index+1]
-        );
+    ptr = getstring(self->string, &length, &isbytes, &charsize, &view);
+    if (ptr == NULL)
+        return NULL;
+    result = getslice(isbytes, ptr,
+                      self->string, self->mark[index], self->mark[index+1]);
+    if (isbytes && view.buf != NULL)
+        PyBuffer_Release(&view);
+    return result;
 }
 
 static Py_ssize_t
@@ -3684,6 +2418,22 @@
         return match_regs(self);
 }
 
+static PyObject *
+match_repr(MatchObject *self)
+{
+    PyObject *result;
+    PyObject *group0 = match_getslice_by_index(self, 0, Py_None);
+    if (group0 == NULL)
+        return NULL;
+    result = PyUnicode_FromFormat(
+            "<%s object; span=(%d, %d), match=%.50R>",
+            Py_TYPE(self)->tp_name,
+            self->mark[0], self->mark[1], group0);
+    Py_DECREF(group0);
+    return result;
+}
+
+
 static PyGetSetDef match_getset[] = {
     {"lastindex", (getter)match_lastindex_get, (setter)NULL},
     {"lastgroup", (getter)match_lastgroup_get, (setter)NULL},
@@ -3712,7 +2462,7 @@
     0,                          /* tp_getattr */
     0,                          /* tp_setattr */
     0,                          /* tp_reserved */
-    0,                          /* tp_repr */
+    (reprfunc)match_repr,       /* tp_repr */
     0,                          /* tp_as_number */
     0,                          /* tp_as_sequence */
     0,                          /* tp_as_mapping */
@@ -3736,7 +2486,7 @@
 };
 
 static PyObject*
-pattern_new_match(PatternObject* pattern, SRE_STATE* state, int status)
+pattern_new_match(PatternObject* pattern, SRE_STATE* state, Py_ssize_t status)
 {
     /* create match object (from state object) */
 
@@ -3815,17 +2565,13 @@
 {
     SRE_STATE* state = &self->state;
     PyObject* match;
-    int status;
+    Py_ssize_t status;
 
     state_reset(state);
 
     state->ptr = state->start;
 
-    if (state->logical_charsize == 1) {
-        status = sre_match(state, PatternObject_GetCode(self->pattern));
-    } else {
-        status = sre_umatch(state, PatternObject_GetCode(self->pattern));
-    }
+    status = sre_match(state, PatternObject_GetCode(self->pattern), 0);
     if (PyErr_Occurred())
         return NULL;
 
@@ -3846,17 +2592,13 @@
 {
     SRE_STATE* state = &self->state;
     PyObject* match;
-    int status;
+    Py_ssize_t status;
 
     state_reset(state);
 
     state->ptr = state->start;
 
-    if (state->logical_charsize == 1) {
-        status = sre_search(state, PatternObject_GetCode(self->pattern));
-    } else {
-        status = sre_usearch(state, PatternObject_GetCode(self->pattern));
-    }
+    status = sre_search(state, PatternObject_GetCode(self->pattern));
     if (PyErr_Occurred())
         return NULL;
 
@@ -4013,7 +2755,5 @@
     return m;
 }
 
-#endif /* !defined(SRE_RECURSIVE) */
-
 /* vim:ts=4:sw=4:et
 */
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
index 499e8ba..914d5aa 100644
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -14,6 +14,8 @@
        http://bugs.python.org/issue8108#msg102867 ?
 */
 
+#define PY_SSIZE_T_CLEAN
+
 #include "Python.h"
 
 #ifdef WITH_THREAD
@@ -42,6 +44,70 @@
 
 #endif
 
+/* Include symbols from _socket module */
+#include "socketmodule.h"
+
+static PySocketModule_APIObject PySocketModule;
+
+#if defined(HAVE_POLL_H)
+#include <poll.h>
+#elif defined(HAVE_SYS_POLL_H)
+#include <sys/poll.h>
+#endif
+
+/* Include OpenSSL header files */
+#include "openssl/rsa.h"
+#include "openssl/crypto.h"
+#include "openssl/x509.h"
+#include "openssl/x509v3.h"
+#include "openssl/pem.h"
+#include "openssl/ssl.h"
+#include "openssl/err.h"
+#include "openssl/rand.h"
+
+/* SSL error object */
+static PyObject *PySSLErrorObject;
+static PyObject *PySSLZeroReturnErrorObject;
+static PyObject *PySSLWantReadErrorObject;
+static PyObject *PySSLWantWriteErrorObject;
+static PyObject *PySSLSyscallErrorObject;
+static PyObject *PySSLEOFErrorObject;
+
+/* Error mappings */
+static PyObject *err_codes_to_names;
+static PyObject *err_names_to_codes;
+static PyObject *lib_codes_to_names;
+
+struct py_ssl_error_code {
+    const char *mnemonic;
+    int library, reason;
+};
+struct py_ssl_library_code {
+    const char *library;
+    int code;
+};
+
+/* Include generated data (error codes) */
+#include "_ssl_data.h"
+
+/* Openssl comes with TLSv1.1 and TLSv1.2 between 1.0.0h and 1.0.1
+    http://www.openssl.org/news/changelog.html
+ */
+#if OPENSSL_VERSION_NUMBER >= 0x10001000L
+# define HAVE_TLSv1_2 1
+#else
+# define HAVE_TLSv1_2 0
+#endif
+
+/* SNI support (client- and server-side) appeared in OpenSSL 1.0.0 and 0.9.8f
+ * This includes the SSL_set_SSL_CTX() function.
+ */
+#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
+# define HAVE_SNI 1
+#else
+# define HAVE_SNI 0
+#endif
+
 enum py_ssl_error {
     /* these mirror ssl.h */
     PY_SSL_ERROR_NONE,
@@ -73,55 +139,14 @@
     PY_SSL_VERSION_SSL2,
     PY_SSL_VERSION_SSL3=1,
     PY_SSL_VERSION_SSL23,
+#if HAVE_TLSv1_2
+    PY_SSL_VERSION_TLS1,
+    PY_SSL_VERSION_TLS1_1,
+    PY_SSL_VERSION_TLS1_2
+#else
     PY_SSL_VERSION_TLS1
-};
-
-struct py_ssl_error_code {
-    const char *mnemonic;
-    int library, reason;
-};
-
-struct py_ssl_library_code {
-    const char *library;
-    int code;
-};
-
-/* Include symbols from _socket module */
-#include "socketmodule.h"
-
-static PySocketModule_APIObject PySocketModule;
-
-#if defined(HAVE_POLL_H)
-#include <poll.h>
-#elif defined(HAVE_SYS_POLL_H)
-#include <sys/poll.h>
 #endif
-
-/* Include OpenSSL header files */
-#include "openssl/rsa.h"
-#include "openssl/crypto.h"
-#include "openssl/x509.h"
-#include "openssl/x509v3.h"
-#include "openssl/pem.h"
-#include "openssl/ssl.h"
-#include "openssl/err.h"
-#include "openssl/rand.h"
-
-/* Include generated data (error codes) */
-#include "_ssl_data.h"
-
-/* SSL error object */
-static PyObject *PySSLErrorObject;
-static PyObject *PySSLZeroReturnErrorObject;
-static PyObject *PySSLWantReadErrorObject;
-static PyObject *PySSLWantWriteErrorObject;
-static PyObject *PySSLSyscallErrorObject;
-static PyObject *PySSLEOFErrorObject;
-
-/* Error mappings */
-static PyObject *err_codes_to_names;
-static PyObject *err_names_to_codes;
-static PyObject *lib_codes_to_names;
+};
 
 #ifdef WITH_THREAD
 
@@ -173,6 +198,11 @@
 # define OPENSSL_NO_COMP
 #endif
 
+/* X509_VERIFY_PARAM got added to OpenSSL in 0.9.8 */
+#if OPENSSL_VERSION_NUMBER >= 0x0090800fL
+# define HAVE_OPENSSL_VERIFY_PARAM
+#endif
+
 
 typedef struct {
     PyObject_HEAD
@@ -181,14 +211,20 @@
     char *npn_protocols;
     int npn_protocols_len;
 #endif
+#ifndef OPENSSL_NO_TLSEXT
+    PyObject *set_hostname;
+#endif
+    int check_hostname;
 } PySSLContext;
 
 typedef struct {
     PyObject_HEAD
     PyObject *Socket; /* weakref to socket on which we're layered */
     SSL *ssl;
+    PySSLContext *ctx; /* weakref to SSL context */
     X509 *peer_cert;
-    int shutdown_seen_zero;
+    char shutdown_seen_zero;
+    char handshake_done;
     enum py_ssl_server_or_client socket_type;
 } PySSLSocket;
 
@@ -316,14 +352,18 @@
                                    lib_obj, errstr, lineno);
     else
         msg = PyUnicode_FromFormat("%s (_ssl.c:%d)", errstr, lineno);
-
     if (msg == NULL)
         goto fail;
+
     init_value = Py_BuildValue("iN", ssl_errno, msg);
+    if (init_value == NULL)
+        goto fail;
+
     err_value = PyObject_CallObject(type, init_value);
     Py_DECREF(init_value);
     if (err_value == NULL)
         goto fail;
+
     if (reason_obj == NULL)
         reason_obj = Py_None;
     if (_PyObject_SetAttrId(err_value, &PyId_reason, reason_obj))
@@ -437,11 +477,13 @@
  */
 
 static PySSLSocket *
-newPySSLSocket(SSL_CTX *ctx, PySocketSockObject *sock,
+newPySSLSocket(PySSLContext *sslctx, PySocketSockObject *sock,
                enum py_ssl_server_or_client socket_type,
                char *server_hostname)
 {
     PySSLSocket *self;
+    SSL_CTX *ctx = sslctx->ctx;
+    long mode;
 
     self = PyObject_New(PySSLSocket, &PySSLSocket_Type);
     if (self == NULL)
@@ -450,7 +492,10 @@
     self->peer_cert = NULL;
     self->ssl = NULL;
     self->Socket = NULL;
+    self->ctx = sslctx;
     self->shutdown_seen_zero = 0;
+    self->handshake_done = 0;
+    Py_INCREF(sslctx);
 
     /* Make sure the SSL error state is initialized */
     (void) ERR_get_state();
@@ -459,12 +504,15 @@
     PySSL_BEGIN_ALLOW_THREADS
     self->ssl = SSL_new(ctx);
     PySSL_END_ALLOW_THREADS
-    SSL_set_fd(self->ssl, sock->sock_fd);
+    SSL_set_app_data(self->ssl,self);
+    SSL_set_fd(self->ssl, Py_SAFE_DOWNCAST(sock->sock_fd, SOCKET_T, int));
+    mode = SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER;
 #ifdef SSL_MODE_AUTO_RETRY
-    SSL_set_mode(self->ssl, SSL_MODE_AUTO_RETRY);
+    mode |= SSL_MODE_AUTO_RETRY;
 #endif
+    SSL_set_mode(self->ssl, mode);
 
-#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
+#if HAVE_SNI
     if (server_hostname != NULL)
         SSL_set_tlsext_host_name(self->ssl, server_hostname);
 #endif
@@ -486,6 +534,10 @@
 
     self->socket_type = socket_type;
     self->Socket = PyWeakref_NewRef((PyObject *) sock, NULL);
+    if (self->Socket == NULL) {
+        Py_DECREF(self);
+        return NULL;
+    }
     return self;
 }
 
@@ -552,6 +604,7 @@
     PySSL_BEGIN_ALLOW_THREADS
     self->peer_cert = SSL_get_peer_certificate(self->ssl);
     PySSL_END_ALLOW_THREADS
+    self->handshake_done = 1;
 
     Py_INCREF(Py_None);
     return Py_None;
@@ -918,6 +971,126 @@
 }
 
 static PyObject *
+_get_aia_uri(X509 *certificate, int nid) {
+    PyObject *lst = NULL, *ostr = NULL;
+    int i, result;
+    AUTHORITY_INFO_ACCESS *info;
+
+    info = X509_get_ext_d2i(certificate, NID_info_access, NULL, NULL);
+    if ((info == NULL) || (sk_ACCESS_DESCRIPTION_num(info) == 0)) {
+        return Py_None;
+    }
+
+    if ((lst = PyList_New(0)) == NULL) {
+        goto fail;
+    }
+
+    for (i = 0; i < sk_ACCESS_DESCRIPTION_num(info); i++) {
+        ACCESS_DESCRIPTION *ad = sk_ACCESS_DESCRIPTION_value(info, i);
+        ASN1_IA5STRING *uri;
+
+        if ((OBJ_obj2nid(ad->method) != nid) ||
+                (ad->location->type != GEN_URI)) {
+            continue;
+        }
+        uri = ad->location->d.uniformResourceIdentifier;
+        ostr = PyUnicode_FromStringAndSize((char *)uri->data,
+                                           uri->length);
+        if (ostr == NULL) {
+            goto fail;
+        }
+        result = PyList_Append(lst, ostr);
+        Py_DECREF(ostr);
+        if (result < 0) {
+            goto fail;
+        }
+    }
+    AUTHORITY_INFO_ACCESS_free(info);
+
+    /* convert to tuple or None */
+    if (PyList_Size(lst) == 0) {
+        Py_DECREF(lst);
+        return Py_None;
+    } else {
+        PyObject *tup;
+        tup = PyList_AsTuple(lst);
+        Py_DECREF(lst);
+        return tup;
+    }
+
+  fail:
+    AUTHORITY_INFO_ACCESS_free(info);
+    Py_XDECREF(lst);
+    return NULL;
+}
+
+static PyObject *
+_get_crl_dp(X509 *certificate) {
+    STACK_OF(DIST_POINT) *dps;
+    int i, j, result;
+    PyObject *lst;
+
+#if OPENSSL_VERSION_NUMBER < 0x10001000L
+    dps = X509_get_ext_d2i(certificate, NID_crl_distribution_points,
+                           NULL, NULL);
+#else
+    /* Calls x509v3_cache_extensions and sets up crldp */
+    X509_check_ca(certificate);
+    dps = certificate->crldp;
+#endif
+
+    if (dps == NULL) {
+        return Py_None;
+    }
+
+    if ((lst = PyList_New(0)) == NULL) {
+        return NULL;
+    }
+
+    for (i=0; i < sk_DIST_POINT_num(dps); i++) {
+        DIST_POINT *dp;
+        STACK_OF(GENERAL_NAME) *gns;
+
+        dp = sk_DIST_POINT_value(dps, i);
+        gns = dp->distpoint->name.fullname;
+
+        for (j=0; j < sk_GENERAL_NAME_num(gns); j++) {
+            GENERAL_NAME *gn;
+            ASN1_IA5STRING *uri;
+            PyObject *ouri;
+
+            gn = sk_GENERAL_NAME_value(gns, j);
+            if (gn->type != GEN_URI) {
+                continue;
+            }
+            uri = gn->d.uniformResourceIdentifier;
+            ouri = PyUnicode_FromStringAndSize((char *)uri->data,
+                                               uri->length);
+            if (ouri == NULL) {
+                Py_DECREF(lst);
+                return NULL;
+            }
+            result = PyList_Append(lst, ouri);
+            Py_DECREF(ouri);
+            if (result < 0) {
+                Py_DECREF(lst);
+                return NULL;
+            }
+        }
+    }
+    /* convert to tuple or None */
+    if (PyList_Size(lst) == 0) {
+        Py_DECREF(lst);
+        return Py_None;
+    } else {
+        PyObject *tup;
+        tup = PyList_AsTuple(lst);
+        Py_DECREF(lst);
+        return tup;
+    }
+}
+
+static PyObject *
 _decode_certificate(X509 *certificate) {
 
     PyObject *retval = NULL;
@@ -927,9 +1100,10 @@
     PyObject *issuer;
     PyObject *version;
     PyObject *sn_obj;
+    PyObject *obj;
     ASN1_INTEGER *serialNumber;
     char buf[2048];
-    int len;
+    int len, result;
     ASN1_TIME *notBefore, *notAfter;
     PyObject *pnotBefore, *pnotAfter;
 
@@ -1035,6 +1209,41 @@
         Py_DECREF(peer_alt_names);
     }
 
+    /* Authority Information Access: OCSP URIs */
+    obj = _get_aia_uri(certificate, NID_ad_OCSP);
+    if (obj == NULL) {
+        goto fail1;
+    } else if (obj != Py_None) {
+        result = PyDict_SetItemString(retval, "OCSP", obj);
+        Py_DECREF(obj);
+        if (result < 0) {
+            goto fail1;
+        }
+    }
+
+    obj = _get_aia_uri(certificate, NID_ad_ca_issuers);
+    if (obj == NULL) {
+        goto fail1;
+    } else if (obj != Py_None) {
+        result = PyDict_SetItemString(retval, "caIssuers", obj);
+        Py_DECREF(obj);
+        if (result < 0) {
+            goto fail1;
+        }
+    }
+
+    /* CDP (CRL distribution points) */
+    obj = _get_crl_dp(certificate);
+    if (obj == NULL) {
+        goto fail1;
+    } else if (obj != Py_None) {
+        result = PyDict_SetItemString(retval, "crlDistributionPoints", obj);
+        Py_DECREF(obj);
+        if (result < 0) {
+            goto fail1;
+        }
+    }
+
     BIO_free(biobuf);
     return retval;
 
@@ -1046,6 +1255,24 @@
     return NULL;
 }
 
+static PyObject *
+_certificate_to_der(X509 *certificate)
+{
+    unsigned char *bytes_buf = NULL;
+    int len;
+    PyObject *retval;
+
+    bytes_buf = NULL;
+    len = i2d_X509(certificate, &bytes_buf);
+    if (len < 0) {
+        _setSSLError(NULL, 0, __FILE__, __LINE__);
+        return NULL;
+    }
+    /* this is actually an immutable bytes sequence */
+    retval = PyBytes_FromStringAndSize((const char *) bytes_buf, len);
+    OPENSSL_free(bytes_buf);
+    return retval;
+}
 
 static PyObject *
 PySSL_test_decode_certificate (PyObject *mod, PyObject *args) {
@@ -1091,34 +1318,23 @@
 static PyObject *
 PySSL_peercert(PySSLSocket *self, PyObject *args)
 {
-    PyObject *retval = NULL;
-    int len;
     int verification;
     int binary_mode = 0;
 
     if (!PyArg_ParseTuple(args, "|p:peer_certificate", &binary_mode))
         return NULL;
 
+    if (!self->handshake_done) {
+        PyErr_SetString(PyExc_ValueError,
+                        "handshake not done yet");
+        return NULL;
+    }
     if (!self->peer_cert)
         Py_RETURN_NONE;
 
     if (binary_mode) {
         /* return cert in DER-encoded format */
-
-        unsigned char *bytes_buf = NULL;
-
-        bytes_buf = NULL;
-        len = i2d_X509(self->peer_cert, &bytes_buf);
-        if (len < 0) {
-            PySSL_SetError(self, len, __FILE__, __LINE__);
-            return NULL;
-        }
-        /* this is actually an immutable bytes sequence */
-        retval = PyBytes_FromStringAndSize
-          ((const char *) bytes_buf, len);
-        OPENSSL_free(bytes_buf);
-        return retval;
-
+        return _certificate_to_der(self->peer_cert);
     } else {
         verification = SSL_CTX_get_verify_mode(SSL_get_SSL_CTX(self->ssl));
         if ((verification & SSL_VERIFY_PEER) == 0)
@@ -1221,6 +1437,43 @@
 #endif
 }
 
+static PySSLContext *PySSL_get_context(PySSLSocket *self, void *closure) {
+    Py_INCREF(self->ctx);
+    return self->ctx;
+}
+
+static int PySSL_set_context(PySSLSocket *self, PyObject *value,
+                                   void *closure) {
+
+    if (PyObject_TypeCheck(value, &PySSLContext_Type)) {
+#if !HAVE_SNI
+        PyErr_SetString(PyExc_NotImplementedError, "setting a socket's "
+                        "context is not supported by your OpenSSL library");
+        return -1;
+#else
+        Py_INCREF(value);
+        Py_DECREF(self->ctx);
+        self->ctx = (PySSLContext *) value;
+        SSL_set_SSL_CTX(self->ssl, self->ctx->ctx);
+#endif
+    } else {
+        PyErr_SetString(PyExc_TypeError, "The value must be a SSLContext");
+        return -1;
+    }
+
+    return 0;
+}
+
+PyDoc_STRVAR(PySSL_set_context_doc,
+"_setter_context(ctx)\n\
+\
+This changes the context associated with the SSLSocket. This is typically\n\
+used from within a callback function set by the set_servername_callback\n\
+on the SSLContext to change the certificate information associated with the\n\
+SSLSocket before the cryptographic exchange handshake messages\n");
+
+
+
 static void PySSL_dealloc(PySSLSocket *self)
 {
     if (self->peer_cert)        /* Possible not to have one? */
@@ -1228,6 +1481,7 @@
     if (self->ssl)
         SSL_free(self->ssl);
     Py_XDECREF(self->Socket);
+    Py_XDECREF(self->ctx);
     PyObject_Del(self);
 }
 
@@ -1286,9 +1540,11 @@
     /* See if the socket is ready */
     PySSL_BEGIN_ALLOW_THREADS
     if (writing)
-        rc = select(s->sock_fd+1, NULL, &fds, NULL, &tv);
+        rc = select(Py_SAFE_DOWNCAST(s->sock_fd+1, SOCKET_T, int),
+                    NULL, &fds, NULL, &tv);
     else
-        rc = select(s->sock_fd+1, &fds, NULL, NULL, &tv);
+        rc = select(Py_SAFE_DOWNCAST(s->sock_fd+1, SOCKET_T, int),
+                    &fds, NULL, NULL, &tv);
     PySSL_END_ALLOW_THREADS
 
 #ifdef HAVE_POLL
@@ -1668,6 +1924,12 @@
 
 #endif /* HAVE_OPENSSL_FINISHED */
 
+static PyGetSetDef ssl_getsetlist[] = {
+    {"context", (getter) PySSL_get_context,
+                (setter) PySSL_set_context, PySSL_set_context_doc},
+    {NULL},            /* sentinel */
+};
+
 static PyMethodDef PySSLMethods[] = {
     {"do_handshake", (PyCFunction)PySSL_SSLdo_handshake, METH_NOARGS},
     {"write", (PyCFunction)PySSL_SSLwrite, METH_VARARGS,
@@ -1722,6 +1984,8 @@
     0,                                  /*tp_iter*/
     0,                                  /*tp_iternext*/
     PySSLMethods,                       /*tp_methods*/
+    0,                                  /*tp_members*/
+    ssl_getsetlist,                     /*tp_getset*/
 };
 
 
@@ -1746,8 +2010,16 @@
     PySSL_BEGIN_ALLOW_THREADS
     if (proto_version == PY_SSL_VERSION_TLS1)
         ctx = SSL_CTX_new(TLSv1_method());
+#if HAVE_TLSv1_2
+    else if (proto_version == PY_SSL_VERSION_TLS1_1)
+        ctx = SSL_CTX_new(TLSv1_1_method());
+    else if (proto_version == PY_SSL_VERSION_TLS1_2)
+        ctx = SSL_CTX_new(TLSv1_2_method());
+#endif
+#ifndef OPENSSL_NO_SSL3
     else if (proto_version == PY_SSL_VERSION_SSL3)
         ctx = SSL_CTX_new(SSLv3_method());
+#endif
 #ifndef OPENSSL_NO_SSL2
     else if (proto_version == PY_SSL_VERSION_SSL2)
         ctx = SSL_CTX_new(SSLv2_method());
@@ -1779,6 +2051,11 @@
 #ifdef OPENSSL_NPN_NEGOTIATED
     self->npn_protocols = NULL;
 #endif
+#ifndef OPENSSL_NO_TLSEXT
+    self->set_hostname = NULL;
+#endif
+    /* Don't check host name by default */
+    self->check_hostname = 0;
     /* Defaults */
     SSL_CTX_set_verify(self->ctx, SSL_VERIFY_NONE, NULL);
     options = SSL_OP_ALL & ~SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS;
@@ -1786,6 +2063,21 @@
         options |= SSL_OP_NO_SSLv2;
     SSL_CTX_set_options(self->ctx, options);
 
+#ifndef OPENSSL_NO_ECDH
+    /* Allow automatic ECDH curve selection (on OpenSSL 1.0.2+), or use
+       prime256v1 by default.  This is Apache mod_ssl's initialization
+       policy, so we should be safe. */
+#if defined(SSL_CTX_set_ecdh_auto)
+    SSL_CTX_set_ecdh_auto(self->ctx, 1);
+#else
+    {
+        EC_KEY *key = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1);
+        SSL_CTX_set_tmp_ecdh(self->ctx, key);
+        EC_KEY_free(key);
+    }
+#endif
+#endif
+
 #define SID_CTX "Python"
     SSL_CTX_set_session_id_context(self->ctx, (const unsigned char *) SID_CTX,
                                    sizeof(SID_CTX));
@@ -1794,9 +2086,28 @@
     return (PyObject *)self;
 }
 
+static int
+context_traverse(PySSLContext *self, visitproc visit, void *arg)
+{
+#ifndef OPENSSL_NO_TLSEXT
+    Py_VISIT(self->set_hostname);
+#endif
+    return 0;
+}
+
+static int
+context_clear(PySSLContext *self)
+{
+#ifndef OPENSSL_NO_TLSEXT
+    Py_CLEAR(self->set_hostname);
+#endif
+    return 0;
+}
+
 static void
 context_dealloc(PySSLContext *self)
 {
+    context_clear(self);
     SSL_CTX_free(self->ctx);
 #ifdef OPENSSL_NPN_NEGOTIATED
     PyMem_Free(self->npn_protocols);
@@ -1943,10 +2254,56 @@
                         "invalid value for verify_mode");
         return -1;
     }
+    if (mode == SSL_VERIFY_NONE && self->check_hostname) {
+        PyErr_SetString(PyExc_ValueError,
+                        "Cannot set verify_mode to CERT_NONE when "
+                        "check_hostname is enabled.");
+        return -1;
+    }
     SSL_CTX_set_verify(self->ctx, mode, NULL);
     return 0;
 }
 
+#ifdef HAVE_OPENSSL_VERIFY_PARAM
+static PyObject *
+get_verify_flags(PySSLContext *self, void *c)
+{
+    X509_STORE *store;
+    unsigned long flags;
+
+    store = SSL_CTX_get_cert_store(self->ctx);
+    flags = X509_VERIFY_PARAM_get_flags(store->param);
+    return PyLong_FromUnsignedLong(flags);
+}
+
+static int
+set_verify_flags(PySSLContext *self, PyObject *arg, void *c)
+{
+    X509_STORE *store;
+    unsigned long new_flags, flags, set, clear;
+
+    if (!PyArg_Parse(arg, "k", &new_flags))
+        return -1;
+    store = SSL_CTX_get_cert_store(self->ctx);
+    flags = X509_VERIFY_PARAM_get_flags(store->param);
+    clear = flags & ~new_flags;
+    set = ~flags & new_flags;
+    if (clear) {
+        if (!X509_VERIFY_PARAM_clear_flags(store->param, clear)) {
+            _setSSLError(NULL, 0, __FILE__, __LINE__);
+            return -1;
+        }
+    }
+    if (set) {
+        if (!X509_VERIFY_PARAM_set_flags(store->param, set)) {
+            _setSSLError(NULL, 0, __FILE__, __LINE__);
+            return -1;
+        }
+    }
+    return 0;
+}
+#endif
+
 static PyObject *
 get_options(PySSLContext *self, void *c)
 {
@@ -1976,6 +2333,30 @@
     return 0;
 }
 
+static PyObject *
+get_check_hostname(PySSLContext *self, void *c)
+{
+    return PyBool_FromLong(self->check_hostname);
+}
+
+static int
+set_check_hostname(PySSLContext *self, PyObject *arg, void *c)
+{
+    int check_hostname;
+    if (!PyArg_Parse(arg, "p", &check_hostname))
+        return -1;
+    if (check_hostname &&
+            SSL_CTX_get_verify_mode(self->ctx) == SSL_VERIFY_NONE) {
+        PyErr_SetString(PyExc_ValueError,
+                        "check_hostname needs a SSL context with either "
+                        "CERT_OPTIONAL or CERT_REQUIRED");
+        return -1;
+    }
+    self->check_hostname = check_hostname;
+    return 0;
+}
+
+
 typedef struct {
     PyThreadState *thread_state;
     PyObject *callable;
@@ -2020,8 +2401,8 @@
         goto error;
     }
 
-    free(pw_info->password);
-    pw_info->password = malloc(size);
+    PyMem_Free(pw_info->password);
+    pw_info->password = PyMem_Malloc(size);
     if (!pw_info->password) {
         PyErr_SetString(PyExc_MemoryError,
                         "unable to allocate password buffer");
@@ -2165,72 +2546,212 @@
     }
     SSL_CTX_set_default_passwd_cb(self->ctx, orig_passwd_cb);
     SSL_CTX_set_default_passwd_cb_userdata(self->ctx, orig_passwd_userdata);
-    free(pw_info.password);
+    PyMem_Free(pw_info.password);
     Py_RETURN_NONE;
 
 error:
     SSL_CTX_set_default_passwd_cb(self->ctx, orig_passwd_cb);
     SSL_CTX_set_default_passwd_cb_userdata(self->ctx, orig_passwd_userdata);
-    free(pw_info.password);
+    PyMem_Free(pw_info.password);
     Py_XDECREF(keyfile_bytes);
     Py_XDECREF(certfile_bytes);
     return NULL;
 }
 
+/* internal helper function, returns -1 on error
+ */
+static int
+_add_ca_certs(PySSLContext *self, void *data, Py_ssize_t len,
+              int filetype)
+{
+    BIO *biobuf = NULL;
+    X509_STORE *store;
+    int retval = 0, err, loaded = 0;
+
+    assert(filetype == SSL_FILETYPE_ASN1 || filetype == SSL_FILETYPE_PEM);
+
+    if (len <= 0) {
+        PyErr_SetString(PyExc_ValueError,
+                        "Empty certificate data");
+        return -1;
+    } else if (len > INT_MAX) {
+        PyErr_SetString(PyExc_OverflowError,
+                        "Certificate data is too long.");
+        return -1;
+    }
+
+    biobuf = BIO_new_mem_buf(data, (int)len);
+    if (biobuf == NULL) {
+        _setSSLError("Can't allocate buffer", 0, __FILE__, __LINE__);
+        return -1;
+    }
+
+    store = SSL_CTX_get_cert_store(self->ctx);
+    assert(store != NULL);
+
+    while (1) {
+        X509 *cert = NULL;
+        int r;
+
+        if (filetype == SSL_FILETYPE_ASN1) {
+            cert = d2i_X509_bio(biobuf, NULL);
+        } else {
+            cert = PEM_read_bio_X509(biobuf, NULL,
+                                     self->ctx->default_passwd_callback,
+                                     self->ctx->default_passwd_callback_userdata);
+        }
+        if (cert == NULL) {
+            break;
+        }
+        r = X509_STORE_add_cert(store, cert);
+        X509_free(cert);
+        if (!r) {
+            err = ERR_peek_last_error();
+            if ((ERR_GET_LIB(err) == ERR_LIB_X509) &&
+                (ERR_GET_REASON(err) == X509_R_CERT_ALREADY_IN_HASH_TABLE)) {
+                /* cert already in hash table, not an error */
+                ERR_clear_error();
+            } else {
+                break;
+            }
+        }
+        loaded++;
+    }
+
+    err = ERR_peek_last_error();
+    if ((filetype == SSL_FILETYPE_ASN1) &&
+            (loaded > 0) &&
+            (ERR_GET_LIB(err) == ERR_LIB_ASN1) &&
+            (ERR_GET_REASON(err) == ASN1_R_HEADER_TOO_LONG)) {
+        /* EOF ASN1 file, not an error */
+        ERR_clear_error();
+        retval = 0;
+    } else if ((filetype == SSL_FILETYPE_PEM) &&
+                   (loaded > 0) &&
+                   (ERR_GET_LIB(err) == ERR_LIB_PEM) &&
+                   (ERR_GET_REASON(err) == PEM_R_NO_START_LINE)) {
+        /* EOF PEM file, not an error */
+        ERR_clear_error();
+        retval = 0;
+    } else {
+        _setSSLError(NULL, 0, __FILE__, __LINE__);
+        retval = -1;
+    }
+
+    BIO_free(biobuf);
+    return retval;
+}
+
+
 static PyObject *
 load_verify_locations(PySSLContext *self, PyObject *args, PyObject *kwds)
 {
-    char *kwlist[] = {"cafile", "capath", NULL};
-    PyObject *cafile = NULL, *capath = NULL;
+    char *kwlist[] = {"cafile", "capath", "cadata", NULL};
+    PyObject *cafile = NULL, *capath = NULL, *cadata = NULL;
     PyObject *cafile_bytes = NULL, *capath_bytes = NULL;
     const char *cafile_buf = NULL, *capath_buf = NULL;
-    int r;
+    int r = 0, ok = 1;
 
     errno = 0;
     if (!PyArg_ParseTupleAndKeywords(args, kwds,
-        "|OO:load_verify_locations", kwlist,
-        &cafile, &capath))
+        "|OOO:load_verify_locations", kwlist,
+        &cafile, &capath, &cadata))
         return NULL;
+
     if (cafile == Py_None)
         cafile = NULL;
     if (capath == Py_None)
         capath = NULL;
-    if (cafile == NULL && capath == NULL) {
+    if (cadata == Py_None)
+        cadata = NULL;
+
+    if (cafile == NULL && capath == NULL && cadata == NULL) {
         PyErr_SetString(PyExc_TypeError,
-                        "cafile and capath cannot be both omitted");
-        return NULL;
+                        "cafile, capath and cadata cannot be all omitted");
+        goto error;
     }
     if (cafile && !PyUnicode_FSConverter(cafile, &cafile_bytes)) {
         PyErr_SetString(PyExc_TypeError,
                         "cafile should be a valid filesystem path");
-        return NULL;
+        goto error;
     }
     if (capath && !PyUnicode_FSConverter(capath, &capath_bytes)) {
-        Py_XDECREF(cafile_bytes);
         PyErr_SetString(PyExc_TypeError,
                         "capath should be a valid filesystem path");
-        return NULL;
+        goto error;
     }
-    if (cafile)
-        cafile_buf = PyBytes_AS_STRING(cafile_bytes);
-    if (capath)
-        capath_buf = PyBytes_AS_STRING(capath_bytes);
-    PySSL_BEGIN_ALLOW_THREADS
-    r = SSL_CTX_load_verify_locations(self->ctx, cafile_buf, capath_buf);
-    PySSL_END_ALLOW_THREADS
+
+    /* validata cadata type and load cadata */
+    if (cadata) {
+        Py_buffer buf;
+        PyObject *cadata_ascii = NULL;
+
+        if (PyObject_GetBuffer(cadata, &buf, PyBUF_SIMPLE) == 0) {
+            if (!PyBuffer_IsContiguous(&buf, 'C') || buf.ndim > 1) {
+                PyBuffer_Release(&buf);
+                PyErr_SetString(PyExc_TypeError,
+                                "cadata should be a contiguous buffer with "
+                                "a single dimension");
+                goto error;
+            }
+            r = _add_ca_certs(self, buf.buf, buf.len, SSL_FILETYPE_ASN1);
+            PyBuffer_Release(&buf);
+            if (r == -1) {
+                goto error;
+            }
+        } else {
+            PyErr_Clear();
+            cadata_ascii = PyUnicode_AsASCIIString(cadata);
+            if (cadata_ascii == NULL) {
+                PyErr_SetString(PyExc_TypeError,
+                                "cadata should be a ASCII string or a "
+                                "bytes-like object");
+                goto error;
+            }
+            r = _add_ca_certs(self,
+                              PyBytes_AS_STRING(cadata_ascii),
+                              PyBytes_GET_SIZE(cadata_ascii),
+                              SSL_FILETYPE_PEM);
+            Py_DECREF(cadata_ascii);
+            if (r == -1) {
+                goto error;
+            }
+        }
+    }
+
+    /* load cafile or capath */
+    if (cafile || capath) {
+        if (cafile)
+            cafile_buf = PyBytes_AS_STRING(cafile_bytes);
+        if (capath)
+            capath_buf = PyBytes_AS_STRING(capath_bytes);
+        PySSL_BEGIN_ALLOW_THREADS
+        r = SSL_CTX_load_verify_locations(self->ctx, cafile_buf, capath_buf);
+        PySSL_END_ALLOW_THREADS
+        if (r != 1) {
+            ok = 0;
+            if (errno != 0) {
+                ERR_clear_error();
+                PyErr_SetFromErrno(PyExc_IOError);
+            }
+            else {
+                _setSSLError(NULL, 0, __FILE__, __LINE__);
+            }
+            goto error;
+        }
+    }
+    goto end;
+
+  error:
+    ok = 0;
+  end:
     Py_XDECREF(cafile_bytes);
     Py_XDECREF(capath_bytes);
-    if (r != 1) {
-        if (errno != 0) {
-            ERR_clear_error();
-            PyErr_SetFromErrno(PyExc_IOError);
-        }
-        else {
-            _setSSLError(NULL, 0, __FILE__, __LINE__);
-        }
+    if (ok) {
+        Py_RETURN_NONE;
+    } else {
         return NULL;
     }
-    Py_RETURN_NONE;
 }
 
 static PyObject *
@@ -2239,7 +2760,7 @@
     FILE *f;
     DH *dh;
 
-    f = _Py_fopen(filepath, "rb");
+    f = _Py_fopen_obj(filepath, "rb");
     if (f == NULL) {
         if (!PyErr_Occurred())
             PyErr_SetFromErrnoWithFilenameObject(PyExc_OSError, filepath);
@@ -2287,15 +2808,9 @@
             &sock, &server_side,
             "idna", &hostname))
             return NULL;
-#ifndef SSL_CTRL_SET_TLSEXT_HOSTNAME
-        PyMem_Free(hostname);
-        PyErr_SetString(PyExc_ValueError, "server_hostname is not supported "
-                        "by your OpenSSL library");
-        return NULL;
-#endif
     }
 
-    res = (PyObject *) newPySSLSocket(self->ctx, sock, server_side,
+    res = (PyObject *) newPySSLSocket(self, sock, server_side,
                                       hostname);
     if (hostname != NULL)
         PyMem_Free(hostname);
@@ -2380,9 +2895,259 @@
 }
 #endif
 
+#if HAVE_SNI && !defined(OPENSSL_NO_TLSEXT)
+static int
+_servername_callback(SSL *s, int *al, void *args)
+{
+    int ret;
+    PySSLContext *ssl_ctx = (PySSLContext *) args;
+    PySSLSocket *ssl;
+    PyObject *servername_o;
+    PyObject *servername_idna;
+    PyObject *result;
+    /* The high-level ssl.SSLSocket object */
+    PyObject *ssl_socket;
+    const char *servername = SSL_get_servername(s, TLSEXT_NAMETYPE_host_name);
+#ifdef WITH_THREAD
+    PyGILState_STATE gstate = PyGILState_Ensure();
+#endif
+
+    if (ssl_ctx->set_hostname == NULL) {
+        /* remove race condition in this the call back while if removing the
+         * callback is in progress */
+#ifdef WITH_THREAD
+        PyGILState_Release(gstate);
+#endif
+        return SSL_TLSEXT_ERR_OK;
+    }
+
+    ssl = SSL_get_app_data(s);
+    assert(PySSLSocket_Check(ssl));
+    ssl_socket = PyWeakref_GetObject(ssl->Socket);
+    Py_INCREF(ssl_socket);
+    if (ssl_socket == Py_None) {
+        goto error;
+    }
+
+    if (servername == NULL) {
+        result = PyObject_CallFunctionObjArgs(ssl_ctx->set_hostname, ssl_socket,
+                                              Py_None, ssl_ctx, NULL);
+    }
+    else {
+        servername_o = PyBytes_FromString(servername);
+        if (servername_o == NULL) {
+            PyErr_WriteUnraisable((PyObject *) ssl_ctx);
+            goto error;
+        }
+        servername_idna = PyUnicode_FromEncodedObject(servername_o, "idna", NULL);
+        if (servername_idna == NULL) {
+            PyErr_WriteUnraisable(servername_o);
+            Py_DECREF(servername_o);
+            goto error;
+        }
+        Py_DECREF(servername_o);
+        result = PyObject_CallFunctionObjArgs(ssl_ctx->set_hostname, ssl_socket,
+                                              servername_idna, ssl_ctx, NULL);
+        Py_DECREF(servername_idna);
+    }
+    Py_DECREF(ssl_socket);
+
+    if (result == NULL) {
+        PyErr_WriteUnraisable(ssl_ctx->set_hostname);
+        *al = SSL_AD_HANDSHAKE_FAILURE;
+        ret = SSL_TLSEXT_ERR_ALERT_FATAL;
+    }
+    else {
+        if (result != Py_None) {
+            *al = (int) PyLong_AsLong(result);
+            if (PyErr_Occurred()) {
+                PyErr_WriteUnraisable(result);
+                *al = SSL_AD_INTERNAL_ERROR;
+            }
+            ret = SSL_TLSEXT_ERR_ALERT_FATAL;
+        }
+        else {
+            ret = SSL_TLSEXT_ERR_OK;
+        }
+        Py_DECREF(result);
+    }
+
+#ifdef WITH_THREAD
+    PyGILState_Release(gstate);
+#endif
+    return ret;
+
+error:
+    Py_DECREF(ssl_socket);
+    *al = SSL_AD_INTERNAL_ERROR;
+    ret = SSL_TLSEXT_ERR_ALERT_FATAL;
+#ifdef WITH_THREAD
+    PyGILState_Release(gstate);
+#endif
+    return ret;
+}
+#endif
+
+PyDoc_STRVAR(PySSL_set_servername_callback_doc,
+"set_servername_callback(method)\n\
+\n\
+This sets a callback that will be called when a server name is provided by\n\
+the SSL/TLS client in the SNI extension.\n\
+\n\
+If the argument is None then the callback is disabled. The method is called\n\
+with the SSLSocket, the server name as a string, and the SSLContext object.\n\
+See RFC 6066 for details of the SNI extension.");
+
+static PyObject *
+set_servername_callback(PySSLContext *self, PyObject *args)
+{
+#if HAVE_SNI && !defined(OPENSSL_NO_TLSEXT)
+    PyObject *cb;
+
+    if (!PyArg_ParseTuple(args, "O", &cb))
+        return NULL;
+
+    Py_CLEAR(self->set_hostname);
+    if (cb == Py_None) {
+        SSL_CTX_set_tlsext_servername_callback(self->ctx, NULL);
+    }
+    else {
+        if (!PyCallable_Check(cb)) {
+            SSL_CTX_set_tlsext_servername_callback(self->ctx, NULL);
+            PyErr_SetString(PyExc_TypeError,
+                            "not a callable object");
+            return NULL;
+        }
+        Py_INCREF(cb);
+        self->set_hostname = cb;
+        SSL_CTX_set_tlsext_servername_callback(self->ctx, _servername_callback);
+        SSL_CTX_set_tlsext_servername_arg(self->ctx, self);
+    }
+    Py_RETURN_NONE;
+#else
+    PyErr_SetString(PyExc_NotImplementedError,
+                    "The TLS extension servername callback, "
+                    "SSL_CTX_set_tlsext_servername_callback, "
+                    "is not in the current OpenSSL library.");
+    return NULL;
+#endif
+}
+
+PyDoc_STRVAR(PySSL_get_stats_doc,
+"cert_store_stats() -> {'crl': int, 'x509_ca': int, 'x509': int}\n\
+\n\
+Returns quantities of loaded X.509 certificates. X.509 certificates with a\n\
+CA extension and certificate revocation lists inside the context's cert\n\
+store.\n\
+NOTE: Certificates in a capath directory aren't loaded unless they have\n\
+been used at least once.");
+
+static PyObject *
+cert_store_stats(PySSLContext *self)
+{
+    X509_STORE *store;
+    X509_OBJECT *obj;
+    int x509 = 0, crl = 0, pkey = 0, ca = 0, i;
+
+    store = SSL_CTX_get_cert_store(self->ctx);
+    for (i = 0; i < sk_X509_OBJECT_num(store->objs); i++) {
+        obj = sk_X509_OBJECT_value(store->objs, i);
+        switch (obj->type) {
+            case X509_LU_X509:
+                x509++;
+                if (X509_check_ca(obj->data.x509)) {
+                    ca++;
+                }
+                break;
+            case X509_LU_CRL:
+                crl++;
+                break;
+            case X509_LU_PKEY:
+                pkey++;
+                break;
+            default:
+                /* Ignore X509_LU_FAIL, X509_LU_RETRY, X509_LU_PKEY.
+                 * As far as I can tell they are internal states and never
+                 * stored in a cert store */
+                break;
+        }
+    }
+    return Py_BuildValue("{sisisi}", "x509", x509, "crl", crl,
+        "x509_ca", ca);
+}
+
+PyDoc_STRVAR(PySSL_get_ca_certs_doc,
+"get_ca_certs(binary_form=False) -> list of loaded certificate\n\
+\n\
+Returns a list of dicts with information of loaded CA certs. If the\n\
+optional argument is True, returns a DER-encoded copy of the CA certificate.\n\
+NOTE: Certificates in a capath directory aren't loaded unless they have\n\
+been used at least once.");
+
+static PyObject *
+get_ca_certs(PySSLContext *self, PyObject *args, PyObject *kwds)
+{
+    char *kwlist[] = {"binary_form", NULL};
+    X509_STORE *store;
+    PyObject *ci = NULL, *rlist = NULL;
+    int i;
+    int binary_mode = 0;
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwds, "|p:get_ca_certs",
+                                     kwlist, &binary_mode)) {
+        return NULL;
+    }
+
+    if ((rlist = PyList_New(0)) == NULL) {
+        return NULL;
+    }
+
+    store = SSL_CTX_get_cert_store(self->ctx);
+    for (i = 0; i < sk_X509_OBJECT_num(store->objs); i++) {
+        X509_OBJECT *obj;
+        X509 *cert;
+
+        obj = sk_X509_OBJECT_value(store->objs, i);
+        if (obj->type != X509_LU_X509) {
+            /* not a x509 cert */
+            continue;
+        }
+        /* CA for any purpose */
+        cert = obj->data.x509;
+        if (!X509_check_ca(cert)) {
+            continue;
+        }
+        if (binary_mode) {
+            ci = _certificate_to_der(cert);
+        } else {
+            ci = _decode_certificate(cert);
+        }
+        if (ci == NULL) {
+            goto error;
+        }
+        if (PyList_Append(rlist, ci) == -1) {
+            goto error;
+        }
+        Py_CLEAR(ci);
+    }
+    return rlist;
+
+  error:
+    Py_XDECREF(ci);
+    Py_XDECREF(rlist);
+    return NULL;
+}
+
+
 static PyGetSetDef context_getsetlist[] = {
+    {"check_hostname", (getter) get_check_hostname,
+                       (setter) set_check_hostname, NULL},
     {"options", (getter) get_options,
                 (setter) set_options, NULL},
+#ifdef HAVE_OPENSSL_VERIFY_PARAM
+    {"verify_flags", (getter) get_verify_flags,
+                     (setter) set_verify_flags, NULL},
+#endif
     {"verify_mode", (getter) get_verify_mode,
                     (setter) set_verify_mode, NULL},
     {NULL},            /* sentinel */
@@ -2409,6 +3174,12 @@
     {"set_ecdh_curve", (PyCFunction) set_ecdh_curve,
                        METH_O, NULL},
 #endif
+    {"set_servername_callback", (PyCFunction) set_servername_callback,
+                    METH_VARARGS, PySSL_set_servername_callback_doc},
+    {"cert_store_stats", (PyCFunction) cert_store_stats,
+                    METH_NOARGS, PySSL_get_stats_doc},
+    {"get_ca_certs", (PyCFunction) get_ca_certs,
+                    METH_VARARGS | METH_KEYWORDS, PySSL_get_ca_certs_doc},
     {NULL, NULL}        /* sentinel */
 };
 
@@ -2432,10 +3203,10 @@
     0,                                         /*tp_getattro*/
     0,                                         /*tp_setattro*/
     0,                                         /*tp_as_buffer*/
-    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,  /*tp_flags*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, /*tp_flags*/
     0,                                         /*tp_doc*/
-    0,                                         /*tp_traverse*/
-    0,                                         /*tp_clear*/
+    (traverseproc) context_traverse,           /*tp_traverse*/
+    (inquiry) context_clear,                   /*tp_clear*/
     0,                                         /*tp_richcompare*/
     0,                                         /*tp_weaklistoffset*/
     0,                                         /*tp_iter*/
@@ -2462,12 +3233,17 @@
 PySSL_RAND_add(PyObject *self, PyObject *args)
 {
     char *buf;
-    int len;
+    Py_ssize_t len, written;
     double entropy;
 
     if (!PyArg_ParseTuple(args, "s#d:RAND_add", &buf, &len, &entropy))
         return NULL;
-    RAND_add(buf, len, entropy);
+    do {
+        written = Py_MIN(len, INT_MAX);
+        RAND_add(buf, (int)written, entropy);
+        buf += written;
+        len -= written;
+    } while (len);
     Py_INCREF(Py_None);
     return Py_None;
 }
@@ -2559,6 +3335,7 @@
 It is necessary to seed the PRNG with RAND_add() on some platforms before\n\
 using the ssl() function.");
 
+#ifdef HAVE_RAND_EGD
 static PyObject *
 PySSL_RAND_egd(PyObject *self, PyObject *args)
 {
@@ -2586,11 +3363,389 @@
 Queries the entropy gather daemon (EGD) on the socket named by 'path'.\n\
 Returns number of bytes read.  Raises SSLError if connection to EGD\n\
 fails or if it does not provide enough data to seed PRNG.");
+#endif /* HAVE_RAND_EGD */
 
 #endif /* HAVE_OPENSSL_RAND */
 
 
+PyDoc_STRVAR(PySSL_get_default_verify_paths_doc,
+"get_default_verify_paths() -> tuple\n\
+\n\
+Return search paths and environment vars that are used by SSLContext's\n\
+set_default_verify_paths() to load default CAs. The values are\n\
+'cert_file_env', 'cert_file', 'cert_dir_env', 'cert_dir'.");
 
+static PyObject *
+PySSL_get_default_verify_paths(PyObject *self)
+{
+    PyObject *ofile_env = NULL;
+    PyObject *ofile = NULL;
+    PyObject *odir_env = NULL;
+    PyObject *odir = NULL;
+
+#define convert(info, target) { \
+        const char *tmp = (info); \
+        target = NULL; \
+        if (!tmp) { Py_INCREF(Py_None); target = Py_None; } \
+        else if ((target = PyUnicode_DecodeFSDefault(tmp)) == NULL) { \
+            target = PyBytes_FromString(tmp); } \
+        if (!target) goto error; \
+    } while(0)
+
+    convert(X509_get_default_cert_file_env(), ofile_env);
+    convert(X509_get_default_cert_file(), ofile);
+    convert(X509_get_default_cert_dir_env(), odir_env);
+    convert(X509_get_default_cert_dir(), odir);
+#undef convert
+
+    return Py_BuildValue("NNNN", ofile_env, ofile, odir_env, odir);
+
+  error:
+    Py_XDECREF(ofile_env);
+    Py_XDECREF(ofile);
+    Py_XDECREF(odir_env);
+    Py_XDECREF(odir);
+    return NULL;
+}
+
+static PyObject*
+asn1obj2py(ASN1_OBJECT *obj)
+{
+    int nid;
+    const char *ln, *sn;
+    char buf[100];
+    Py_ssize_t buflen;
+
+    nid = OBJ_obj2nid(obj);
+    if (nid == NID_undef) {
+        PyErr_Format(PyExc_ValueError, "Unknown object");
+        return NULL;
+    }
+    sn = OBJ_nid2sn(nid);
+    ln = OBJ_nid2ln(nid);
+    buflen = OBJ_obj2txt(buf, sizeof(buf), obj, 1);
+    if (buflen < 0) {
+        _setSSLError(NULL, 0, __FILE__, __LINE__);
+        return NULL;
+    }
+    if (buflen) {
+        return Py_BuildValue("isss#", nid, sn, ln, buf, buflen);
+    } else {
+        return Py_BuildValue("issO", nid, sn, ln, Py_None);
+    }
+}
+
+PyDoc_STRVAR(PySSL_txt2obj_doc,
+"txt2obj(txt, name=False) -> (nid, shortname, longname, oid)\n\
+\n\
+Lookup NID, short name, long name and OID of an ASN1_OBJECT. By default\n\
+objects are looked up by OID. With name=True short and long name are also\n\
+matched.");
+
+static PyObject*
+PySSL_txt2obj(PyObject *self, PyObject *args, PyObject *kwds)
+{
+    char *kwlist[] = {"txt", "name", NULL};
+    PyObject *result = NULL;
+    char *txt;
+    int name = 0;
+    ASN1_OBJECT *obj;
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|p:txt2obj",
+                                     kwlist, &txt, &name)) {
+        return NULL;
+    }
+    obj = OBJ_txt2obj(txt, name ? 0 : 1);
+    if (obj == NULL) {
+        PyErr_Format(PyExc_ValueError, "unknown object '%.100s'", txt);
+        return NULL;
+    }
+    result = asn1obj2py(obj);
+    ASN1_OBJECT_free(obj);
+    return result;
+}
+
+PyDoc_STRVAR(PySSL_nid2obj_doc,
+"nid2obj(nid) -> (nid, shortname, longname, oid)\n\
+\n\
+Lookup NID, short name, long name and OID of an ASN1_OBJECT by NID.");
+
+static PyObject*
+PySSL_nid2obj(PyObject *self, PyObject *args)
+{
+    PyObject *result = NULL;
+    int nid;
+    ASN1_OBJECT *obj;
+
+    if (!PyArg_ParseTuple(args, "i:nid2obj", &nid)) {
+        return NULL;
+    }
+    if (nid < NID_undef) {
+        PyErr_SetString(PyExc_ValueError, "NID must be positive.");
+        return NULL;
+    }
+    obj = OBJ_nid2obj(nid);
+    if (obj == NULL) {
+        PyErr_Format(PyExc_ValueError, "unknown NID %i", nid);
+        return NULL;
+    }
+    result = asn1obj2py(obj);
+    ASN1_OBJECT_free(obj);
+    return result;
+}
+
+#ifdef _MSC_VER
+
+static PyObject*
+certEncodingType(DWORD encodingType)
+{
+    static PyObject *x509_asn = NULL;
+    static PyObject *pkcs_7_asn = NULL;
+
+    if (x509_asn == NULL) {
+        x509_asn = PyUnicode_InternFromString("x509_asn");
+        if (x509_asn == NULL)
+            return NULL;
+    }
+    if (pkcs_7_asn == NULL) {
+        pkcs_7_asn = PyUnicode_InternFromString("pkcs_7_asn");
+        if (pkcs_7_asn == NULL)
+            return NULL;
+    }
+    switch(encodingType) {
+    case X509_ASN_ENCODING:
+        Py_INCREF(x509_asn);
+        return x509_asn;
+    case PKCS_7_ASN_ENCODING:
+        Py_INCREF(pkcs_7_asn);
+        return pkcs_7_asn;
+    default:
+        return PyLong_FromLong(encodingType);
+    }
+}
+
+static PyObject*
+parseKeyUsage(PCCERT_CONTEXT pCertCtx, DWORD flags)
+{
+    CERT_ENHKEY_USAGE *usage;
+    DWORD size, error, i;
+    PyObject *retval;
+
+    if (!CertGetEnhancedKeyUsage(pCertCtx, flags, NULL, &size)) {
+        error = GetLastError();
+        if (error == CRYPT_E_NOT_FOUND) {
+            Py_RETURN_TRUE;
+        }
+        return PyErr_SetFromWindowsErr(error);
+    }
+
+    usage = (CERT_ENHKEY_USAGE*)PyMem_Malloc(size);
+    if (usage == NULL) {
+        return PyErr_NoMemory();
+    }
+
+    /* Now get the actual enhanced usage property */
+    if (!CertGetEnhancedKeyUsage(pCertCtx, flags, usage, &size)) {
+        PyMem_Free(usage);
+        error = GetLastError();
+        if (error == CRYPT_E_NOT_FOUND) {
+            Py_RETURN_TRUE;
+        }
+        return PyErr_SetFromWindowsErr(error);
+    }
+    retval = PySet_New(NULL);
+    if (retval == NULL) {
+        goto error;
+    }
+    for (i = 0; i < usage->cUsageIdentifier; ++i) {
+        if (usage->rgpszUsageIdentifier[i]) {
+            PyObject *oid;
+            int err;
+            oid = PyUnicode_FromString(usage->rgpszUsageIdentifier[i]);
+            if (oid == NULL) {
+                Py_CLEAR(retval);
+                goto error;
+            }
+            err = PySet_Add(retval, oid);
+            Py_DECREF(oid);
+            if (err == -1) {
+                Py_CLEAR(retval);
+                goto error;
+            }
+        }
+    }
+  error:
+    PyMem_Free(usage);
+    return retval;
+}
+
+PyDoc_STRVAR(PySSL_enum_certificates_doc,
+"enum_certificates(store_name) -> []\n\
+\n\
+Retrieve certificates from Windows' cert store. store_name may be one of\n\
+'CA', 'ROOT' or 'MY'. The system may provide more cert storages, too.\n\
+The function returns a list of (bytes, encoding_type, trust) tuples. The\n\
+encoding_type flag can be interpreted with X509_ASN_ENCODING or\n\
+PKCS_7_ASN_ENCODING. The trust setting is either a set of OIDs or the\n\
+boolean True.");
+
+static PyObject *
+PySSL_enum_certificates(PyObject *self, PyObject *args, PyObject *kwds)
+{
+    char *kwlist[] = {"store_name", NULL};
+    char *store_name;
+    HCERTSTORE hStore = NULL;
+    PCCERT_CONTEXT pCertCtx = NULL;
+    PyObject *keyusage = NULL, *cert = NULL, *enc = NULL, *tup = NULL;
+    PyObject *result = NULL;
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|s:enum_certificates",
+                                     kwlist, &store_name)) {
+        return NULL;
+    }
+    result = PyList_New(0);
+    if (result == NULL) {
+        return NULL;
+    }
+    hStore = CertOpenSystemStore((HCRYPTPROV)NULL, store_name);
+    if (hStore == NULL) {
+        Py_DECREF(result);
+        return PyErr_SetFromWindowsErr(GetLastError());
+    }
+
+    while (pCertCtx = CertEnumCertificatesInStore(hStore, pCertCtx)) {
+        cert = PyBytes_FromStringAndSize((const char*)pCertCtx->pbCertEncoded,
+                                            pCertCtx->cbCertEncoded);
+        if (!cert) {
+            Py_CLEAR(result);
+            break;
+        }
+        if ((enc = certEncodingType(pCertCtx->dwCertEncodingType)) == NULL) {
+            Py_CLEAR(result);
+            break;
+        }
+        keyusage = parseKeyUsage(pCertCtx, CERT_FIND_PROP_ONLY_ENHKEY_USAGE_FLAG);
+        if (keyusage == Py_True) {
+            Py_DECREF(keyusage);
+            keyusage = parseKeyUsage(pCertCtx, CERT_FIND_EXT_ONLY_ENHKEY_USAGE_FLAG);
+        }
+        if (keyusage == NULL) {
+            Py_CLEAR(result);
+            break;
+        }
+        if ((tup = PyTuple_New(3)) == NULL) {
+            Py_CLEAR(result);
+            break;
+        }
+        PyTuple_SET_ITEM(tup, 0, cert);
+        cert = NULL;
+        PyTuple_SET_ITEM(tup, 1, enc);
+        enc = NULL;
+        PyTuple_SET_ITEM(tup, 2, keyusage);
+        keyusage = NULL;
+        if (PyList_Append(result, tup) < 0) {
+            Py_CLEAR(result);
+            break;
+        }
+        Py_CLEAR(tup);
+    }
+    if (pCertCtx) {
+        /* loop ended with an error, need to clean up context manually */
+        CertFreeCertificateContext(pCertCtx);
+    }
+
+    /* In error cases cert, enc and tup may not be NULL */
+    Py_XDECREF(cert);
+    Py_XDECREF(enc);
+    Py_XDECREF(keyusage);
+    Py_XDECREF(tup);
+
+    if (!CertCloseStore(hStore, 0)) {
+        /* This error case might shadow another exception.*/
+        Py_XDECREF(result);
+        return PyErr_SetFromWindowsErr(GetLastError());
+    }
+    return result;
+}
+
+PyDoc_STRVAR(PySSL_enum_crls_doc,
+"enum_crls(store_name) -> []\n\
+\n\
+Retrieve CRLs from Windows' cert store. store_name may be one of\n\
+'CA', 'ROOT' or 'MY'. The system may provide more cert storages, too.\n\
+The function returns a list of (bytes, encoding_type) tuples. The\n\
+encoding_type flag can be interpreted with X509_ASN_ENCODING or\n\
+PKCS_7_ASN_ENCODING.");
+
+static PyObject *
+PySSL_enum_crls(PyObject *self, PyObject *args, PyObject *kwds)
+{
+    char *kwlist[] = {"store_name", NULL};
+    char *store_name;
+    HCERTSTORE hStore = NULL;
+    PCCRL_CONTEXT pCrlCtx = NULL;
+    PyObject *crl = NULL, *enc = NULL, *tup = NULL;
+    PyObject *result = NULL;
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|s:enum_crls",
+                                     kwlist, &store_name)) {
+        return NULL;
+    }
+    result = PyList_New(0);
+    if (result == NULL) {
+        return NULL;
+    }
+    hStore = CertOpenSystemStore((HCRYPTPROV)NULL, store_name);
+    if (hStore == NULL) {
+        Py_DECREF(result);
+        return PyErr_SetFromWindowsErr(GetLastError());
+    }
+
+    while (pCrlCtx = CertEnumCRLsInStore(hStore, pCrlCtx)) {
+        crl = PyBytes_FromStringAndSize((const char*)pCrlCtx->pbCrlEncoded,
+                                            pCrlCtx->cbCrlEncoded);
+        if (!crl) {
+            Py_CLEAR(result);
+            break;
+        }
+        if ((enc = certEncodingType(pCrlCtx->dwCertEncodingType)) == NULL) {
+            Py_CLEAR(result);
+            break;
+        }
+        if ((tup = PyTuple_New(2)) == NULL) {
+            Py_CLEAR(result);
+            break;
+        }
+        PyTuple_SET_ITEM(tup, 0, crl);
+        crl = NULL;
+        PyTuple_SET_ITEM(tup, 1, enc);
+        enc = NULL;
+
+        if (PyList_Append(result, tup) < 0) {
+            Py_CLEAR(result);
+            break;
+        }
+        Py_CLEAR(tup);
+    }
+    if (pCrlCtx) {
+        /* loop ended with an error, need to clean up context manually */
+        CertFreeCRLContext(pCrlCtx);
+    }
+
+    /* In error cases cert, enc and tup may not be NULL */
+    Py_XDECREF(crl);
+    Py_XDECREF(enc);
+    Py_XDECREF(tup);
+
+    if (!CertCloseStore(hStore, 0)) {
+        /* This error case might shadow another exception.*/
+        Py_XDECREF(result);
+        return PyErr_SetFromWindowsErr(GetLastError());
+    }
+    return result;
+}
+
+#endif /* _MSC_VER */
 
 /* List of functions exported by this module. */
 
@@ -2604,11 +3759,25 @@
      PySSL_RAND_bytes_doc},
     {"RAND_pseudo_bytes",   PySSL_RAND_pseudo_bytes, METH_VARARGS,
      PySSL_RAND_pseudo_bytes_doc},
+#ifdef HAVE_RAND_EGD
     {"RAND_egd",            PySSL_RAND_egd, METH_VARARGS,
      PySSL_RAND_egd_doc},
+#endif
     {"RAND_status",         (PyCFunction)PySSL_RAND_status, METH_NOARGS,
      PySSL_RAND_status_doc},
 #endif
+    {"get_default_verify_paths", (PyCFunction)PySSL_get_default_verify_paths,
+     METH_NOARGS, PySSL_get_default_verify_paths_doc},
+#ifdef _MSC_VER
+    {"enum_certificates", (PyCFunction)PySSL_enum_certificates,
+     METH_VARARGS | METH_KEYWORDS, PySSL_enum_certificates_doc},
+    {"enum_crls", (PyCFunction)PySSL_enum_crls,
+     METH_VARARGS | METH_KEYWORDS, PySSL_enum_crls_doc},
+#endif
+    {"txt2obj", (PyCFunction)PySSL_txt2obj,
+     METH_VARARGS | METH_KEYWORDS, PySSL_txt2obj_doc},
+    {"nid2obj", (PyCFunction)PySSL_nid2obj,
+     METH_VARARGS, PySSL_nid2obj_doc},
     {NULL,                  NULL}            /* Sentinel */
 };
 
@@ -2670,7 +3839,7 @@
     if (_ssl_locks == NULL) {
         _ssl_locks_count = CRYPTO_num_locks();
         _ssl_locks = (PyThread_type_lock *)
-            malloc(sizeof(PyThread_type_lock) * _ssl_locks_count);
+            PyMem_Malloc(sizeof(PyThread_type_lock) * _ssl_locks_count);
         if (_ssl_locks == NULL)
             return 0;
         memset(_ssl_locks, 0,
@@ -2682,7 +3851,7 @@
                 for (j = 0;  j < i;  j++) {
                     PyThread_free_lock(_ssl_locks[j]);
                 }
-                free(_ssl_locks);
+                PyMem_Free(_ssl_locks);
                 return 0;
             }
         }
@@ -2836,18 +4005,86 @@
                             PY_SSL_CERT_OPTIONAL);
     PyModule_AddIntConstant(m, "CERT_REQUIRED",
                             PY_SSL_CERT_REQUIRED);
+    /* CRL verification for verification_flags */
+    PyModule_AddIntConstant(m, "VERIFY_DEFAULT",
+                            0);
+    PyModule_AddIntConstant(m, "VERIFY_CRL_CHECK_LEAF",
+                            X509_V_FLAG_CRL_CHECK);
+    PyModule_AddIntConstant(m, "VERIFY_CRL_CHECK_CHAIN",
+                            X509_V_FLAG_CRL_CHECK|X509_V_FLAG_CRL_CHECK_ALL);
+    PyModule_AddIntConstant(m, "VERIFY_X509_STRICT",
+                            X509_V_FLAG_X509_STRICT);
+
+    /* Alert Descriptions from ssl.h */
+    /* note RESERVED constants no longer intended for use have been removed */
+    /* http://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-parameters-6 */
+
+#define ADD_AD_CONSTANT(s) \
+    PyModule_AddIntConstant(m, "ALERT_DESCRIPTION_"#s, \
+                            SSL_AD_##s)
+
+    ADD_AD_CONSTANT(CLOSE_NOTIFY);
+    ADD_AD_CONSTANT(UNEXPECTED_MESSAGE);
+    ADD_AD_CONSTANT(BAD_RECORD_MAC);
+    ADD_AD_CONSTANT(RECORD_OVERFLOW);
+    ADD_AD_CONSTANT(DECOMPRESSION_FAILURE);
+    ADD_AD_CONSTANT(HANDSHAKE_FAILURE);
+    ADD_AD_CONSTANT(BAD_CERTIFICATE);
+    ADD_AD_CONSTANT(UNSUPPORTED_CERTIFICATE);
+    ADD_AD_CONSTANT(CERTIFICATE_REVOKED);
+    ADD_AD_CONSTANT(CERTIFICATE_EXPIRED);
+    ADD_AD_CONSTANT(CERTIFICATE_UNKNOWN);
+    ADD_AD_CONSTANT(ILLEGAL_PARAMETER);
+    ADD_AD_CONSTANT(UNKNOWN_CA);
+    ADD_AD_CONSTANT(ACCESS_DENIED);
+    ADD_AD_CONSTANT(DECODE_ERROR);
+    ADD_AD_CONSTANT(DECRYPT_ERROR);
+    ADD_AD_CONSTANT(PROTOCOL_VERSION);
+    ADD_AD_CONSTANT(INSUFFICIENT_SECURITY);
+    ADD_AD_CONSTANT(INTERNAL_ERROR);
+    ADD_AD_CONSTANT(USER_CANCELLED);
+    ADD_AD_CONSTANT(NO_RENEGOTIATION);
+    /* Not all constants are in old OpenSSL versions */
+#ifdef SSL_AD_UNSUPPORTED_EXTENSION
+    ADD_AD_CONSTANT(UNSUPPORTED_EXTENSION);
+#endif
+#ifdef SSL_AD_CERTIFICATE_UNOBTAINABLE
+    ADD_AD_CONSTANT(CERTIFICATE_UNOBTAINABLE);
+#endif
+#ifdef SSL_AD_UNRECOGNIZED_NAME
+    ADD_AD_CONSTANT(UNRECOGNIZED_NAME);
+#endif
+#ifdef SSL_AD_BAD_CERTIFICATE_STATUS_RESPONSE
+    ADD_AD_CONSTANT(BAD_CERTIFICATE_STATUS_RESPONSE);
+#endif
+#ifdef SSL_AD_BAD_CERTIFICATE_HASH_VALUE
+    ADD_AD_CONSTANT(BAD_CERTIFICATE_HASH_VALUE);
+#endif
+#ifdef SSL_AD_UNKNOWN_PSK_IDENTITY
+    ADD_AD_CONSTANT(UNKNOWN_PSK_IDENTITY);
+#endif
+
+#undef ADD_AD_CONSTANT
 
     /* protocol versions */
 #ifndef OPENSSL_NO_SSL2
     PyModule_AddIntConstant(m, "PROTOCOL_SSLv2",
                             PY_SSL_VERSION_SSL2);
 #endif
+#ifndef OPENSSL_NO_SSL3
     PyModule_AddIntConstant(m, "PROTOCOL_SSLv3",
                             PY_SSL_VERSION_SSL3);
+#endif
     PyModule_AddIntConstant(m, "PROTOCOL_SSLv23",
                             PY_SSL_VERSION_SSL23);
     PyModule_AddIntConstant(m, "PROTOCOL_TLSv1",
                             PY_SSL_VERSION_TLS1);
+#if HAVE_TLSv1_2
+    PyModule_AddIntConstant(m, "PROTOCOL_TLSv1_1",
+                            PY_SSL_VERSION_TLS1_1);
+    PyModule_AddIntConstant(m, "PROTOCOL_TLSv1_2",
+                            PY_SSL_VERSION_TLS1_2);
+#endif
 
     /* protocol options */
     PyModule_AddIntConstant(m, "OP_ALL",
@@ -2855,6 +4092,10 @@
     PyModule_AddIntConstant(m, "OP_NO_SSLv2", SSL_OP_NO_SSLv2);
     PyModule_AddIntConstant(m, "OP_NO_SSLv3", SSL_OP_NO_SSLv3);
     PyModule_AddIntConstant(m, "OP_NO_TLSv1", SSL_OP_NO_TLSv1);
+#if HAVE_TLSv1_2
+    PyModule_AddIntConstant(m, "OP_NO_TLSv1_1", SSL_OP_NO_TLSv1_1);
+    PyModule_AddIntConstant(m, "OP_NO_TLSv1_2", SSL_OP_NO_TLSv1_2);
+#endif
     PyModule_AddIntConstant(m, "OP_CIPHER_SERVER_PREFERENCE",
                             SSL_OP_CIPHER_SERVER_PREFERENCE);
     PyModule_AddIntConstant(m, "OP_SINGLE_DH_USE", SSL_OP_SINGLE_DH_USE);
@@ -2866,7 +4107,7 @@
                             SSL_OP_NO_COMPRESSION);
 #endif
 
-#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
+#if HAVE_SNI
     r = Py_True;
 #else
     r = Py_False;
diff --git a/Modules/_ssl_data.h b/Modules/_ssl_data.h
index 81a8d7b..85165b9 100644
--- a/Modules/_ssl_data.h
+++ b/Modules/_ssl_data.h
@@ -1,5 +1,5 @@
 /* File generated by Tools/ssl/make_ssl_data.py */
-/* Generated on 2012-05-16T23:56:40.981382 */
+/* Generated on 2015-01-17T20:33:43.377453 */
 
 static struct py_ssl_library_code library_codes[] = {
     {"PEM", ERR_LIB_PEM},
@@ -179,6 +179,11 @@
   #else
     {"BAD_CHECKSUM", ERR_LIB_SSL, 104},
   #endif
+  #ifdef SSL_R_BAD_DATA
+    {"BAD_DATA", ERR_LIB_SSL, SSL_R_BAD_DATA},
+  #else
+    {"BAD_DATA", ERR_LIB_SSL, 390},
+  #endif
   #ifdef SSL_R_BAD_DATA_RETURNED_BY_CALLBACK
     {"BAD_DATA_RETURNED_BY_CALLBACK", ERR_LIB_SSL, SSL_R_BAD_DATA_RETURNED_BY_CALLBACK},
   #else
@@ -309,6 +314,46 @@
   #else
     {"BAD_SIGNATURE", ERR_LIB_SSL, 123},
   #endif
+  #ifdef SSL_R_BAD_SRP_A_LENGTH
+    {"BAD_SRP_A_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_A_LENGTH},
+  #else
+    {"BAD_SRP_A_LENGTH", ERR_LIB_SSL, 347},
+  #endif
+  #ifdef SSL_R_BAD_SRP_B_LENGTH
+    {"BAD_SRP_B_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_B_LENGTH},
+  #else
+    {"BAD_SRP_B_LENGTH", ERR_LIB_SSL, 348},
+  #endif
+  #ifdef SSL_R_BAD_SRP_G_LENGTH
+    {"BAD_SRP_G_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_G_LENGTH},
+  #else
+    {"BAD_SRP_G_LENGTH", ERR_LIB_SSL, 349},
+  #endif
+  #ifdef SSL_R_BAD_SRP_N_LENGTH
+    {"BAD_SRP_N_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_N_LENGTH},
+  #else
+    {"BAD_SRP_N_LENGTH", ERR_LIB_SSL, 350},
+  #endif
+  #ifdef SSL_R_BAD_SRP_PARAMETERS
+    {"BAD_SRP_PARAMETERS", ERR_LIB_SSL, SSL_R_BAD_SRP_PARAMETERS},
+  #else
+    {"BAD_SRP_PARAMETERS", ERR_LIB_SSL, 371},
+  #endif
+  #ifdef SSL_R_BAD_SRP_S_LENGTH
+    {"BAD_SRP_S_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_S_LENGTH},
+  #else
+    {"BAD_SRP_S_LENGTH", ERR_LIB_SSL, 351},
+  #endif
+  #ifdef SSL_R_BAD_SRTP_MKI_VALUE
+    {"BAD_SRTP_MKI_VALUE", ERR_LIB_SSL, SSL_R_BAD_SRTP_MKI_VALUE},
+  #else
+    {"BAD_SRTP_MKI_VALUE", ERR_LIB_SSL, 352},
+  #endif
+  #ifdef SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST
+    {"BAD_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST},
+  #else
+    {"BAD_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, 353},
+  #endif
   #ifdef SSL_R_BAD_SSL_FILETYPE
     {"BAD_SSL_FILETYPE", ERR_LIB_SSL, SSL_R_BAD_SSL_FILETYPE},
   #else
@@ -324,6 +369,11 @@
   #else
     {"BAD_STATE", ERR_LIB_SSL, 126},
   #endif
+  #ifdef SSL_R_BAD_VALUE
+    {"BAD_VALUE", ERR_LIB_SSL, SSL_R_BAD_VALUE},
+  #else
+    {"BAD_VALUE", ERR_LIB_SSL, 384},
+  #endif
   #ifdef SSL_R_BAD_WRITE_RETRY
     {"BAD_WRITE_RETRY", ERR_LIB_SSL, SSL_R_BAD_WRITE_RETRY},
   #else
@@ -354,6 +404,16 @@
   #else
     {"CA_DN_TOO_LONG", ERR_LIB_SSL, 132},
   #endif
+  #ifdef SSL_R_CA_KEY_TOO_SMALL
+    {"CA_KEY_TOO_SMALL", ERR_LIB_SSL, SSL_R_CA_KEY_TOO_SMALL},
+  #else
+    {"CA_KEY_TOO_SMALL", ERR_LIB_SSL, 397},
+  #endif
+  #ifdef SSL_R_CA_MD_TOO_WEAK
+    {"CA_MD_TOO_WEAK", ERR_LIB_SSL, SSL_R_CA_MD_TOO_WEAK},
+  #else
+    {"CA_MD_TOO_WEAK", ERR_LIB_SSL, 398},
+  #endif
   #ifdef SSL_R_CCS_RECEIVED_EARLY
     {"CCS_RECEIVED_EARLY", ERR_LIB_SSL, SSL_R_CCS_RECEIVED_EARLY},
   #else
@@ -364,6 +424,11 @@
   #else
     {"CERTIFICATE_VERIFY_FAILED", ERR_LIB_SSL, 134},
   #endif
+  #ifdef SSL_R_CERT_CB_ERROR
+    {"CERT_CB_ERROR", ERR_LIB_SSL, SSL_R_CERT_CB_ERROR},
+  #else
+    {"CERT_CB_ERROR", ERR_LIB_SSL, 377},
+  #endif
   #ifdef SSL_R_CERT_LENGTH_MISMATCH
     {"CERT_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_CERT_LENGTH_MISMATCH},
   #else
@@ -454,6 +519,11 @@
   #else
     {"DECRYPTION_FAILED_OR_BAD_RECORD_MAC", ERR_LIB_SSL, 281},
   #endif
+  #ifdef SSL_R_DH_KEY_TOO_SMALL
+    {"DH_KEY_TOO_SMALL", ERR_LIB_SSL, SSL_R_DH_KEY_TOO_SMALL},
+  #else
+    {"DH_KEY_TOO_SMALL", ERR_LIB_SSL, 394},
+  #endif
   #ifdef SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG
     {"DH_PUBLIC_VALUE_LENGTH_IS_WRONG", ERR_LIB_SSL, SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG},
   #else
@@ -494,11 +564,26 @@
   #else
     {"ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE", ERR_LIB_SSL, 323},
   #endif
+  #ifdef SSL_R_ECDH_REQUIRED_FOR_SUITEB_MODE
+    {"ECDH_REQUIRED_FOR_SUITEB_MODE", ERR_LIB_SSL, SSL_R_ECDH_REQUIRED_FOR_SUITEB_MODE},
+  #else
+    {"ECDH_REQUIRED_FOR_SUITEB_MODE", ERR_LIB_SSL, 374},
+  #endif
   #ifdef SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER
     {"ECGROUP_TOO_LARGE_FOR_CIPHER", ERR_LIB_SSL, SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER},
   #else
     {"ECGROUP_TOO_LARGE_FOR_CIPHER", ERR_LIB_SSL, 310},
   #endif
+  #ifdef SSL_R_EE_KEY_TOO_SMALL
+    {"EE_KEY_TOO_SMALL", ERR_LIB_SSL, SSL_R_EE_KEY_TOO_SMALL},
+  #else
+    {"EE_KEY_TOO_SMALL", ERR_LIB_SSL, 399},
+  #endif
+  #ifdef SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST
+    {"EMPTY_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST},
+  #else
+    {"EMPTY_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, 354},
+  #endif
   #ifdef SSL_R_ENCRYPTED_LENGTH_TOO_LONG
     {"ENCRYPTED_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_ENCRYPTED_LENGTH_TOO_LONG},
   #else
@@ -529,6 +614,16 @@
   #else
     {"GOT_A_FIN_BEFORE_A_CCS", ERR_LIB_SSL, 154},
   #endif
+  #ifdef SSL_R_GOT_NEXT_PROTO_BEFORE_A_CCS
+    {"GOT_NEXT_PROTO_BEFORE_A_CCS", ERR_LIB_SSL, SSL_R_GOT_NEXT_PROTO_BEFORE_A_CCS},
+  #else
+    {"GOT_NEXT_PROTO_BEFORE_A_CCS", ERR_LIB_SSL, 355},
+  #endif
+  #ifdef SSL_R_GOT_NEXT_PROTO_WITHOUT_EXTENSION
+    {"GOT_NEXT_PROTO_WITHOUT_EXTENSION", ERR_LIB_SSL, SSL_R_GOT_NEXT_PROTO_WITHOUT_EXTENSION},
+  #else
+    {"GOT_NEXT_PROTO_WITHOUT_EXTENSION", ERR_LIB_SSL, 356},
+  #endif
   #ifdef SSL_R_HTTPS_PROXY_REQUEST
     {"HTTPS_PROXY_REQUEST", ERR_LIB_SSL, SSL_R_HTTPS_PROXY_REQUEST},
   #else
@@ -544,6 +639,16 @@
   #else
     {"ILLEGAL_PADDING", ERR_LIB_SSL, 283},
   #endif
+  #ifdef SSL_R_ILLEGAL_SUITEB_DIGEST
+    {"ILLEGAL_SUITEB_DIGEST", ERR_LIB_SSL, SSL_R_ILLEGAL_SUITEB_DIGEST},
+  #else
+    {"ILLEGAL_SUITEB_DIGEST", ERR_LIB_SSL, 380},
+  #endif
+  #ifdef SSL_R_INAPPROPRIATE_FALLBACK
+    {"INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, SSL_R_INAPPROPRIATE_FALLBACK},
+  #else
+    {"INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, 373},
+  #endif
   #ifdef SSL_R_INCONSISTENT_COMPRESSION
     {"INCONSISTENT_COMPRESSION", ERR_LIB_SSL, SSL_R_INCONSISTENT_COMPRESSION},
   #else
@@ -564,11 +669,26 @@
   #else
     {"INVALID_COMPRESSION_ALGORITHM", ERR_LIB_SSL, 341},
   #endif
+  #ifdef SSL_R_INVALID_NULL_CMD_NAME
+    {"INVALID_NULL_CMD_NAME", ERR_LIB_SSL, SSL_R_INVALID_NULL_CMD_NAME},
+  #else
+    {"INVALID_NULL_CMD_NAME", ERR_LIB_SSL, 385},
+  #endif
   #ifdef SSL_R_INVALID_PURPOSE
     {"INVALID_PURPOSE", ERR_LIB_SSL, SSL_R_INVALID_PURPOSE},
   #else
     {"INVALID_PURPOSE", ERR_LIB_SSL, 278},
   #endif
+  #ifdef SSL_R_INVALID_SERVERINFO_DATA
+    {"INVALID_SERVERINFO_DATA", ERR_LIB_SSL, SSL_R_INVALID_SERVERINFO_DATA},
+  #else
+    {"INVALID_SERVERINFO_DATA", ERR_LIB_SSL, 388},
+  #endif
+  #ifdef SSL_R_INVALID_SRP_USERNAME
+    {"INVALID_SRP_USERNAME", ERR_LIB_SSL, SSL_R_INVALID_SRP_USERNAME},
+  #else
+    {"INVALID_SRP_USERNAME", ERR_LIB_SSL, 357},
+  #endif
   #ifdef SSL_R_INVALID_STATUS_RESPONSE
     {"INVALID_STATUS_RESPONSE", ERR_LIB_SSL, SSL_R_INVALID_STATUS_RESPONSE},
   #else
@@ -689,6 +809,16 @@
   #else
     {"MISSING_DSA_SIGNING_CERT", ERR_LIB_SSL, 165},
   #endif
+  #ifdef SSL_R_MISSING_ECDH_CERT
+    {"MISSING_ECDH_CERT", ERR_LIB_SSL, SSL_R_MISSING_ECDH_CERT},
+  #else
+    {"MISSING_ECDH_CERT", ERR_LIB_SSL, 382},
+  #endif
+  #ifdef SSL_R_MISSING_ECDSA_SIGNING_CERT
+    {"MISSING_ECDSA_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_ECDSA_SIGNING_CERT},
+  #else
+    {"MISSING_ECDSA_SIGNING_CERT", ERR_LIB_SSL, 381},
+  #endif
   #ifdef SSL_R_MISSING_EXPORT_TMP_DH_KEY
     {"MISSING_EXPORT_TMP_DH_KEY", ERR_LIB_SSL, SSL_R_MISSING_EXPORT_TMP_DH_KEY},
   #else
@@ -714,6 +844,11 @@
   #else
     {"MISSING_RSA_SIGNING_CERT", ERR_LIB_SSL, 170},
   #endif
+  #ifdef SSL_R_MISSING_SRP_PARAM
+    {"MISSING_SRP_PARAM", ERR_LIB_SSL, SSL_R_MISSING_SRP_PARAM},
+  #else
+    {"MISSING_SRP_PARAM", ERR_LIB_SSL, 358},
+  #endif
   #ifdef SSL_R_MISSING_TMP_DH_KEY
     {"MISSING_TMP_DH_KEY", ERR_LIB_SSL, SSL_R_MISSING_TMP_DH_KEY},
   #else
@@ -739,6 +874,11 @@
   #else
     {"MISSING_VERIFY_MESSAGE", ERR_LIB_SSL, 174},
   #endif
+  #ifdef SSL_R_MULTIPLE_SGC_RESTARTS
+    {"MULTIPLE_SGC_RESTARTS", ERR_LIB_SSL, SSL_R_MULTIPLE_SGC_RESTARTS},
+  #else
+    {"MULTIPLE_SGC_RESTARTS", ERR_LIB_SSL, 346},
+  #endif
   #ifdef SSL_R_NON_SSLV2_INITIAL_PACKET
     {"NON_SSLV2_INITIAL_PACKET", ERR_LIB_SSL, SSL_R_NON_SSLV2_INITIAL_PACKET},
   #else
@@ -819,6 +959,11 @@
   #else
     {"NO_METHOD_SPECIFIED", ERR_LIB_SSL, 188},
   #endif
+  #ifdef SSL_R_NO_PEM_EXTENSIONS
+    {"NO_PEM_EXTENSIONS", ERR_LIB_SSL, SSL_R_NO_PEM_EXTENSIONS},
+  #else
+    {"NO_PEM_EXTENSIONS", ERR_LIB_SSL, 389},
+  #endif
   #ifdef SSL_R_NO_PRIVATEKEY
     {"NO_PRIVATEKEY", ERR_LIB_SSL, SSL_R_NO_PRIVATEKEY},
   #else
@@ -854,6 +999,16 @@
   #else
     {"NO_SHARED_CIPHER", ERR_LIB_SSL, 193},
   #endif
+  #ifdef SSL_R_NO_SHARED_SIGATURE_ALGORITHMS
+    {"NO_SHARED_SIGATURE_ALGORITHMS", ERR_LIB_SSL, SSL_R_NO_SHARED_SIGATURE_ALGORITHMS},
+  #else
+    {"NO_SHARED_SIGATURE_ALGORITHMS", ERR_LIB_SSL, 376},
+  #endif
+  #ifdef SSL_R_NO_SRTP_PROFILES
+    {"NO_SRTP_PROFILES", ERR_LIB_SSL, SSL_R_NO_SRTP_PROFILES},
+  #else
+    {"NO_SRTP_PROFILES", ERR_LIB_SSL, 359},
+  #endif
   #ifdef SSL_R_NO_VERIFY_CALLBACK
     {"NO_VERIFY_CALLBACK", ERR_LIB_SSL, SSL_R_NO_VERIFY_CALLBACK},
   #else
@@ -879,6 +1034,16 @@
   #else
     {"OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED", ERR_LIB_SSL, 344},
   #endif
+  #ifdef SSL_R_ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE
+    {"ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE", ERR_LIB_SSL, SSL_R_ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE},
+  #else
+    {"ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE", ERR_LIB_SSL, 387},
+  #endif
+  #ifdef SSL_R_ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE
+    {"ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE", ERR_LIB_SSL, SSL_R_ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE},
+  #else
+    {"ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE", ERR_LIB_SSL, 379},
+  #endif
   #ifdef SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE
     {"ONLY_TLS_ALLOWED_IN_FIPS_MODE", ERR_LIB_SSL, SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE},
   #else
@@ -934,6 +1099,16 @@
   #else
     {"PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE", ERR_LIB_SSL, 204},
   #endif
+  #ifdef SSL_R_PEM_NAME_BAD_PREFIX
+    {"PEM_NAME_BAD_PREFIX", ERR_LIB_SSL, SSL_R_PEM_NAME_BAD_PREFIX},
+  #else
+    {"PEM_NAME_BAD_PREFIX", ERR_LIB_SSL, 391},
+  #endif
+  #ifdef SSL_R_PEM_NAME_TOO_SHORT
+    {"PEM_NAME_TOO_SHORT", ERR_LIB_SSL, SSL_R_PEM_NAME_TOO_SHORT},
+  #else
+    {"PEM_NAME_TOO_SHORT", ERR_LIB_SSL, 392},
+  #endif
   #ifdef SSL_R_PRE_MAC_LENGTH_TOO_LONG
     {"PRE_MAC_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_PRE_MAC_LENGTH_TOO_LONG},
   #else
@@ -1069,11 +1244,36 @@
   #else
     {"SHORT_READ", ERR_LIB_SSL, 219},
   #endif
+  #ifdef SSL_R_SIGNATURE_ALGORITHMS_ERROR
+    {"SIGNATURE_ALGORITHMS_ERROR", ERR_LIB_SSL, SSL_R_SIGNATURE_ALGORITHMS_ERROR},
+  #else
+    {"SIGNATURE_ALGORITHMS_ERROR", ERR_LIB_SSL, 360},
+  #endif
   #ifdef SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE
     {"SIGNATURE_FOR_NON_SIGNING_CERTIFICATE", ERR_LIB_SSL, SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE},
   #else
     {"SIGNATURE_FOR_NON_SIGNING_CERTIFICATE", ERR_LIB_SSL, 220},
   #endif
+  #ifdef SSL_R_SRP_A_CALC
+    {"SRP_A_CALC", ERR_LIB_SSL, SSL_R_SRP_A_CALC},
+  #else
+    {"SRP_A_CALC", ERR_LIB_SSL, 361},
+  #endif
+  #ifdef SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES
+    {"SRTP_COULD_NOT_ALLOCATE_PROFILES", ERR_LIB_SSL, SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES},
+  #else
+    {"SRTP_COULD_NOT_ALLOCATE_PROFILES", ERR_LIB_SSL, 362},
+  #endif
+  #ifdef SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG
+    {"SRTP_PROTECTION_PROFILE_LIST_TOO_LONG", ERR_LIB_SSL, SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG},
+  #else
+    {"SRTP_PROTECTION_PROFILE_LIST_TOO_LONG", ERR_LIB_SSL, 363},
+  #endif
+  #ifdef SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE
+    {"SRTP_UNKNOWN_PROTECTION_PROFILE", ERR_LIB_SSL, SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE},
+  #else
+    {"SRTP_UNKNOWN_PROTECTION_PROFILE", ERR_LIB_SSL, 364},
+  #endif
   #ifdef SSL_R_SSL23_DOING_SESSION_ID_REUSE
     {"SSL23_DOING_SESSION_ID_REUSE", ERR_LIB_SSL, SSL_R_SSL23_DOING_SESSION_ID_REUSE},
   #else
@@ -1179,6 +1379,11 @@
   #else
     {"SSL_LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, 230},
   #endif
+  #ifdef SSL_R_SSL_NEGATIVE_LENGTH
+    {"SSL_NEGATIVE_LENGTH", ERR_LIB_SSL, SSL_R_SSL_NEGATIVE_LENGTH},
+  #else
+    {"SSL_NEGATIVE_LENGTH", ERR_LIB_SSL, 372},
+  #endif
   #ifdef SSL_R_SSL_SESSION_ID_CALLBACK_FAILED
     {"SSL_SESSION_ID_CALLBACK_FAILED", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_CALLBACK_FAILED},
   #else
@@ -1229,6 +1434,11 @@
   #else
     {"TLSV1_ALERT_EXPORT_RESTRICTION", ERR_LIB_SSL, 1060},
   #endif
+  #ifdef SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK
+    {"TLSV1_ALERT_INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK},
+  #else
+    {"TLSV1_ALERT_INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, 1086},
+  #endif
   #ifdef SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY
     {"TLSV1_ALERT_INSUFFICIENT_SECURITY", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY},
   #else
@@ -1294,6 +1504,21 @@
   #else
     {"TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER", ERR_LIB_SSL, 232},
   #endif
+  #ifdef SSL_R_TLS_HEARTBEAT_PEER_DOESNT_ACCEPT
+    {"TLS_HEARTBEAT_PEER_DOESNT_ACCEPT", ERR_LIB_SSL, SSL_R_TLS_HEARTBEAT_PEER_DOESNT_ACCEPT},
+  #else
+    {"TLS_HEARTBEAT_PEER_DOESNT_ACCEPT", ERR_LIB_SSL, 365},
+  #endif
+  #ifdef SSL_R_TLS_HEARTBEAT_PENDING
+    {"TLS_HEARTBEAT_PENDING", ERR_LIB_SSL, SSL_R_TLS_HEARTBEAT_PENDING},
+  #else
+    {"TLS_HEARTBEAT_PENDING", ERR_LIB_SSL, 366},
+  #endif
+  #ifdef SSL_R_TLS_ILLEGAL_EXPORTER_LABEL
+    {"TLS_ILLEGAL_EXPORTER_LABEL", ERR_LIB_SSL, SSL_R_TLS_ILLEGAL_EXPORTER_LABEL},
+  #else
+    {"TLS_ILLEGAL_EXPORTER_LABEL", ERR_LIB_SSL, 367},
+  #endif
   #ifdef SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST
     {"TLS_INVALID_ECPOINTFORMAT_LIST", ERR_LIB_SSL, SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST},
   #else
@@ -1399,6 +1624,16 @@
   #else
     {"UNKNOWN_CIPHER_TYPE", ERR_LIB_SSL, 249},
   #endif
+  #ifdef SSL_R_UNKNOWN_CMD_NAME
+    {"UNKNOWN_CMD_NAME", ERR_LIB_SSL, SSL_R_UNKNOWN_CMD_NAME},
+  #else
+    {"UNKNOWN_CMD_NAME", ERR_LIB_SSL, 386},
+  #endif
+  #ifdef SSL_R_UNKNOWN_DIGEST
+    {"UNKNOWN_DIGEST", ERR_LIB_SSL, SSL_R_UNKNOWN_DIGEST},
+  #else
+    {"UNKNOWN_DIGEST", ERR_LIB_SSL, 368},
+  #endif
   #ifdef SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE
     {"UNKNOWN_KEY_EXCHANGE_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE},
   #else
@@ -1469,16 +1704,36 @@
   #else
     {"UNSUPPORTED_STATUS_TYPE", ERR_LIB_SSL, 329},
   #endif
+  #ifdef SSL_R_USE_SRTP_NOT_NEGOTIATED
+    {"USE_SRTP_NOT_NEGOTIATED", ERR_LIB_SSL, SSL_R_USE_SRTP_NOT_NEGOTIATED},
+  #else
+    {"USE_SRTP_NOT_NEGOTIATED", ERR_LIB_SSL, 369},
+  #endif
+  #ifdef SSL_R_VERSION_TOO_LOW
+    {"VERSION_TOO_LOW", ERR_LIB_SSL, SSL_R_VERSION_TOO_LOW},
+  #else
+    {"VERSION_TOO_LOW", ERR_LIB_SSL, 396},
+  #endif
   #ifdef SSL_R_WRITE_BIO_NOT_SET
     {"WRITE_BIO_NOT_SET", ERR_LIB_SSL, SSL_R_WRITE_BIO_NOT_SET},
   #else
     {"WRITE_BIO_NOT_SET", ERR_LIB_SSL, 260},
   #endif
+  #ifdef SSL_R_WRONG_CERTIFICATE_TYPE
+    {"WRONG_CERTIFICATE_TYPE", ERR_LIB_SSL, SSL_R_WRONG_CERTIFICATE_TYPE},
+  #else
+    {"WRONG_CERTIFICATE_TYPE", ERR_LIB_SSL, 383},
+  #endif
   #ifdef SSL_R_WRONG_CIPHER_RETURNED
     {"WRONG_CIPHER_RETURNED", ERR_LIB_SSL, SSL_R_WRONG_CIPHER_RETURNED},
   #else
     {"WRONG_CIPHER_RETURNED", ERR_LIB_SSL, 261},
   #endif
+  #ifdef SSL_R_WRONG_CURVE
+    {"WRONG_CURVE", ERR_LIB_SSL, SSL_R_WRONG_CURVE},
+  #else
+    {"WRONG_CURVE", ERR_LIB_SSL, 378},
+  #endif
   #ifdef SSL_R_WRONG_MESSAGE_TYPE
     {"WRONG_MESSAGE_TYPE", ERR_LIB_SSL, SSL_R_WRONG_MESSAGE_TYPE},
   #else
@@ -1499,6 +1754,11 @@
   #else
     {"WRONG_SIGNATURE_SIZE", ERR_LIB_SSL, 265},
   #endif
+  #ifdef SSL_R_WRONG_SIGNATURE_TYPE
+    {"WRONG_SIGNATURE_TYPE", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_TYPE},
+  #else
+    {"WRONG_SIGNATURE_TYPE", ERR_LIB_SSL, 370},
+  #endif
   #ifdef SSL_R_WRONG_SSL_VERSION
     {"WRONG_SSL_VERSION", ERR_LIB_SSL, SSL_R_WRONG_SSL_VERSION},
   #else
@@ -1519,6 +1779,11 @@
   #else
     {"X509_VERIFICATION_SETUP_PROBLEMS", ERR_LIB_SSL, 269},
   #endif
+  #ifdef X509_R_AKID_MISMATCH
+    {"AKID_MISMATCH", ERR_LIB_X509, X509_R_AKID_MISMATCH},
+  #else
+    {"AKID_MISMATCH", ERR_LIB_X509, 110},
+  #endif
   #ifdef X509_R_BAD_X509_FILETYPE
     {"BAD_X509_FILETYPE", ERR_LIB_X509, X509_R_BAD_X509_FILETYPE},
   #else
@@ -1539,11 +1804,26 @@
   #else
     {"CERT_ALREADY_IN_HASH_TABLE", ERR_LIB_X509, 101},
   #endif
+  #ifdef X509_R_CRL_ALREADY_DELTA
+    {"CRL_ALREADY_DELTA", ERR_LIB_X509, X509_R_CRL_ALREADY_DELTA},
+  #else
+    {"CRL_ALREADY_DELTA", ERR_LIB_X509, 127},
+  #endif
+  #ifdef X509_R_CRL_VERIFY_FAILURE
+    {"CRL_VERIFY_FAILURE", ERR_LIB_X509, X509_R_CRL_VERIFY_FAILURE},
+  #else
+    {"CRL_VERIFY_FAILURE", ERR_LIB_X509, 131},
+  #endif
   #ifdef X509_R_ERR_ASN1_LIB
     {"ERR_ASN1_LIB", ERR_LIB_X509, X509_R_ERR_ASN1_LIB},
   #else
     {"ERR_ASN1_LIB", ERR_LIB_X509, 102},
   #endif
+  #ifdef X509_R_IDP_MISMATCH
+    {"IDP_MISMATCH", ERR_LIB_X509, X509_R_IDP_MISMATCH},
+  #else
+    {"IDP_MISMATCH", ERR_LIB_X509, 128},
+  #endif
   #ifdef X509_R_INVALID_DIRECTORY
     {"INVALID_DIRECTORY", ERR_LIB_X509, X509_R_INVALID_DIRECTORY},
   #else
@@ -1559,6 +1839,11 @@
   #else
     {"INVALID_TRUST", ERR_LIB_X509, 123},
   #endif
+  #ifdef X509_R_ISSUER_MISMATCH
+    {"ISSUER_MISMATCH", ERR_LIB_X509, X509_R_ISSUER_MISMATCH},
+  #else
+    {"ISSUER_MISMATCH", ERR_LIB_X509, 129},
+  #endif
   #ifdef X509_R_KEY_TYPE_MISMATCH
     {"KEY_TYPE_MISMATCH", ERR_LIB_X509, X509_R_KEY_TYPE_MISMATCH},
   #else
@@ -1584,11 +1869,21 @@
   #else
     {"METHOD_NOT_SUPPORTED", ERR_LIB_X509, 124},
   #endif
+  #ifdef X509_R_NEWER_CRL_NOT_NEWER
+    {"NEWER_CRL_NOT_NEWER", ERR_LIB_X509, X509_R_NEWER_CRL_NOT_NEWER},
+  #else
+    {"NEWER_CRL_NOT_NEWER", ERR_LIB_X509, 132},
+  #endif
   #ifdef X509_R_NO_CERT_SET_FOR_US_TO_VERIFY
     {"NO_CERT_SET_FOR_US_TO_VERIFY", ERR_LIB_X509, X509_R_NO_CERT_SET_FOR_US_TO_VERIFY},
   #else
     {"NO_CERT_SET_FOR_US_TO_VERIFY", ERR_LIB_X509, 105},
   #endif
+  #ifdef X509_R_NO_CRL_NUMBER
+    {"NO_CRL_NUMBER", ERR_LIB_X509, X509_R_NO_CRL_NUMBER},
+  #else
+    {"NO_CRL_NUMBER", ERR_LIB_X509, 130},
+  #endif
   #ifdef X509_R_PUBLIC_KEY_DECODE_ERROR
     {"PUBLIC_KEY_DECODE_ERROR", ERR_LIB_X509, X509_R_PUBLIC_KEY_DECODE_ERROR},
   #else
diff --git a/Modules/_stat.c b/Modules/_stat.c
new file mode 100644
index 0000000..a301fa8
--- /dev/null
+++ b/Modules/_stat.c
@@ -0,0 +1,563 @@
+/* stat.h interface
+ *
+ * The module defines all S_IF*, S_I*, UF_*, SF_* and ST_* constants to
+ * sensible default values as well as defines S_IS*() macros in order to keep
+ * backward compatibility with the old stat.py module.
+ *
+ * New constants and macros such as S_IFDOOR / S_ISDOOR() are always defined
+ * as int 0.
+ *
+ * NOTE: POSIX only defines the values of the S_I* permission bits.
+ *
+ */
+
+#define PY_SSIZE_T_CLEAN
+#include "Python.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif /* HAVE_SYS_TYPES_H */
+
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif /* HAVE_SYS_STAT_H */
+
+#ifdef MS_WINDOWS
+typedef unsigned short mode_t;
+#endif
+
+/* From Python's stat.py */
+#ifndef S_IMODE
+#  define S_IMODE 07777
+#endif
+
+/* S_IFXXX constants (file types)
+ *
+ * Only the names are defined by POSIX but not their value. All common file
+ * types seems to have the same numeric value on all platforms, though.
+ *
+ * pyport.h guarantees S_IFMT, S_IFDIR, S_IFCHR, S_IFREG and S_IFLNK
+ */
+
+#ifndef S_IFBLK
+#  define S_IFBLK 0060000
+#endif
+
+#ifndef S_IFIFO
+#  define S_IFIFO 0010000
+#endif
+
+#ifndef S_IFSOCK
+#  define S_IFSOCK 0140000
+#endif
+
+#ifndef S_IFDOOR
+#  define S_IFDOOR 0
+#endif
+
+#ifndef S_IFPORT
+#  define S_IFPORT 0
+#endif
+
+#ifndef S_IFWHT
+#  define S_IFWHT 0
+#endif
+
+
+/* S_ISXXX()
+ * pyport.h defines S_ISDIR(), S_ISREG() and S_ISCHR()
+ */
+
+#ifndef S_ISBLK
+#  define S_ISBLK(mode) (((mode) & S_IFMT) == S_IFBLK)
+#endif
+
+#ifndef S_ISFIFO
+#  define S_ISFIFO(mode) (((mode) & S_IFMT) == S_IFIFO)
+#endif
+
+#ifndef S_ISLNK
+#  define S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK)
+#endif
+
+#ifndef S_ISSOCK
+#  define S_ISSOCK(mode) (((mode) & S_IFMT) == S_IFSOCK)
+#endif
+
+#ifndef S_ISDOOR
+#  define S_ISDOOR(mode) 0
+#endif
+
+#ifndef S_ISPORT
+#  define S_ISPORT(mode) 0
+#endif
+
+#ifndef S_ISWHT
+#  define S_ISWHT(mode) 0
+#endif
+
+
+/* S_I* file permission
+ *
+ * The permission bit value are defined by POSIX standards.
+ */
+#ifndef S_ISUID
+#  define S_ISUID 04000
+#endif
+
+#ifndef S_ISGID
+#  define S_ISGID 02000
+#endif
+
+/* what is S_ENFMT? */
+#ifndef S_ENFMT
+#  define S_ENFMT S_ISGID
+#endif
+
+#ifndef S_ISVTX
+#  define S_ISVTX 01000
+#endif
+
+#ifndef S_IREAD
+#  define S_IREAD 00400
+#endif
+
+#ifndef S_IWRITE
+#  define S_IWRITE 00200
+#endif
+
+#ifndef S_IEXEC
+#  define S_IEXEC 00100
+#endif
+
+#ifndef S_IRWXU
+#  define S_IRWXU 00700
+#endif
+
+#ifndef S_IRUSR
+#  define S_IRUSR 00400
+#endif
+
+#ifndef S_IWUSR
+#  define S_IWUSR 00200
+#endif
+
+#ifndef S_IXUSR
+#  define S_IXUSR 00100
+#endif
+
+#ifndef S_IRWXG
+#  define S_IRWXG 00070
+#endif
+
+#ifndef S_IRGRP
+#  define S_IRGRP 00040
+#endif
+
+#ifndef S_IWGRP
+#  define S_IWGRP 00020
+#endif
+
+#ifndef S_IXGRP
+#  define S_IXGRP 00010
+#endif
+
+#ifndef S_IRWXO
+#  define S_IRWXO 00007
+#endif
+
+#ifndef S_IROTH
+#  define S_IROTH 00004
+#endif
+
+#ifndef S_IWOTH
+#  define S_IWOTH 00002
+#endif
+
+#ifndef S_IXOTH
+#  define S_IXOTH 00001
+#endif
+
+
+/* Names for file flags */
+#ifndef UF_NODUMP
+#  define UF_NODUMP 0x00000001
+#endif
+
+#ifndef UF_IMMUTABLE
+#  define UF_IMMUTABLE 0x00000002
+#endif
+
+#ifndef UF_APPEND
+#  define UF_APPEND 0x00000004
+#endif
+
+#ifndef UF_OPAQUE
+#  define UF_OPAQUE 0x00000008
+#endif
+
+#ifndef UF_NOUNLINK
+#  define UF_NOUNLINK 0x00000010
+#endif
+
+#ifndef UF_COMPRESSED
+#  define UF_COMPRESSED 0x00000020
+#endif
+
+#ifndef UF_HIDDEN
+#  define UF_HIDDEN 0x00008000
+#endif
+
+#ifndef SF_ARCHIVED
+#  define SF_ARCHIVED 0x00010000
+#endif
+
+#ifndef SF_IMMUTABLE
+#  define SF_IMMUTABLE 0x00020000
+#endif
+
+#ifndef SF_APPEND
+#  define SF_APPEND 0x00040000
+#endif
+
+#ifndef SF_NOUNLINK
+#  define SF_NOUNLINK 0x00100000
+#endif
+
+#ifndef SF_SNAPSHOT
+#  define SF_SNAPSHOT 0x00200000
+#endif
+
+static mode_t
+_PyLong_AsMode_t(PyObject *op)
+{
+    unsigned long value;
+    mode_t mode;
+
+    value = PyLong_AsUnsignedLong(op);
+    if ((value == (unsigned long)-1) && PyErr_Occurred())
+        return (mode_t)-1;
+
+    mode = (mode_t)value;
+    if ((unsigned long)mode != value) {
+        PyErr_SetString(PyExc_OverflowError, "mode out of range");
+        return (mode_t)-1;
+    }
+    return mode;
+}
+
+
+#define stat_S_ISFUNC(isfunc, doc)                             \
+    static PyObject *                                          \
+    stat_ ##isfunc (PyObject *self, PyObject *omode)           \
+    {                                                          \
+       mode_t mode = _PyLong_AsMode_t(omode);                   \
+       if ((mode == (mode_t)-1) && PyErr_Occurred())           \
+           return NULL;                                        \
+       return PyBool_FromLong(isfunc(mode));                   \
+    }                                                          \
+    PyDoc_STRVAR(stat_ ## isfunc ## _doc, doc)
+
+stat_S_ISFUNC(S_ISDIR,
+    "S_ISDIR(mode) -> bool\n\n"
+    "Return True if mode is from a directory.");
+
+stat_S_ISFUNC(S_ISCHR,
+    "S_ISCHR(mode) -> bool\n\n"
+    "Return True if mode is from a character special device file.");
+
+stat_S_ISFUNC(S_ISBLK,
+    "S_ISBLK(mode) -> bool\n\n"
+    "Return True if mode is from a block special device file.");
+
+stat_S_ISFUNC(S_ISREG,
+    "S_ISREG(mode) -> bool\n\n"
+    "Return True if mode is from a regular file.");
+
+stat_S_ISFUNC(S_ISFIFO,
+    "S_ISFIFO(mode) -> bool\n\n"
+    "Return True if mode is from a FIFO (named pipe).");
+
+stat_S_ISFUNC(S_ISLNK,
+    "S_ISLNK(mode) -> bool\n\n"
+    "Return True if mode is from a symbolic link.");
+
+stat_S_ISFUNC(S_ISSOCK,
+    "S_ISSOCK(mode) -> bool\n\n"
+    "Return True if mode is from a socket.");
+
+stat_S_ISFUNC(S_ISDOOR,
+    "S_ISDOOR(mode) -> bool\n\n"
+    "Return True if mode is from a door.");
+
+stat_S_ISFUNC(S_ISPORT,
+    "S_ISPORT(mode) -> bool\n\n"
+    "Return True if mode is from an event port.");
+
+stat_S_ISFUNC(S_ISWHT,
+    "S_ISWHT(mode) -> bool\n\n"
+    "Return True if mode is from a whiteout.");
+
+
+PyDoc_STRVAR(stat_S_IMODE_doc,
+"Return the portion of the file's mode that can be set by os.chmod().");
+
+static PyObject *
+stat_S_IMODE(PyObject *self, PyObject *omode)
+{
+    mode_t mode = _PyLong_AsMode_t(omode);
+    if ((mode == (mode_t)-1) && PyErr_Occurred())
+        return NULL;
+    return PyLong_FromUnsignedLong(mode & S_IMODE);
+}
+
+
+PyDoc_STRVAR(stat_S_IFMT_doc,
+"Return the portion of the file's mode that describes the file type.");
+
+static PyObject *
+stat_S_IFMT(PyObject *self, PyObject *omode)
+{
+    mode_t mode = _PyLong_AsMode_t(omode);
+    if ((mode == (mode_t)-1) && PyErr_Occurred())
+        return NULL;
+    return PyLong_FromUnsignedLong(mode & S_IFMT);
+}
+
+/* file type chars according to
+   http://en.wikibooks.org/wiki/C_Programming/POSIX_Reference/sys/stat.h */
+
+static char
+filetype(mode_t mode)
+{
+    /* common cases first */
+    if (S_ISREG(mode))  return '-';
+    if (S_ISDIR(mode))  return 'd';
+    if (S_ISLNK(mode))  return 'l';
+    /* special files */
+    if (S_ISBLK(mode))  return 'b';
+    if (S_ISCHR(mode))  return 'c';
+    if (S_ISFIFO(mode)) return 'p';
+    if (S_ISSOCK(mode)) return 's';
+    /* non-standard types */
+    if (S_ISDOOR(mode)) return 'D';
+    if (S_ISPORT(mode)) return 'P';
+    if (S_ISWHT(mode))  return 'w';
+    /* unknown */
+    return '?';
+}
+
+static void
+fileperm(mode_t mode, char *buf)
+{
+    buf[0] = mode & S_IRUSR ? 'r' : '-';
+    buf[1] = mode & S_IWUSR ? 'w' : '-';
+    if (mode & S_ISUID) {
+        buf[2] = mode & S_IXUSR ? 's' : 'S';
+    } else {
+        buf[2] = mode & S_IXUSR ? 'x' : '-';
+    }
+    buf[3] = mode & S_IRGRP ? 'r' : '-';
+    buf[4] = mode & S_IWGRP ? 'w' : '-';
+    if (mode & S_ISGID) {
+        buf[5] = mode & S_IXGRP ? 's' : 'S';
+    } else {
+        buf[5] = mode & S_IXGRP ? 'x' : '-';
+    }
+    buf[6] = mode & S_IROTH ? 'r' : '-';
+    buf[7] = mode & S_IWOTH ? 'w' : '-';
+    if (mode & S_ISVTX) {
+        buf[8] = mode & S_IXOTH ? 't' : 'T';
+    } else {
+        buf[8] = mode & S_IXOTH ? 'x' : '-';
+    }
+}
+
+PyDoc_STRVAR(stat_filemode_doc,
+"Convert a file's mode to a string of the form '-rwxrwxrwx'");
+
+static PyObject *
+stat_filemode(PyObject *self, PyObject *omode)
+{
+    char buf[10];
+    mode_t mode;
+
+    mode = _PyLong_AsMode_t(omode);
+    if ((mode == (mode_t)-1) && PyErr_Occurred())
+        return NULL;
+
+    buf[0] = filetype(mode);
+    fileperm(mode, &buf[1]);
+    return PyUnicode_FromStringAndSize(buf, 10);
+}
+
+
+static PyMethodDef stat_methods[] = {
+    {"S_ISDIR",         stat_S_ISDIR,  METH_O, stat_S_ISDIR_doc},
+    {"S_ISCHR",         stat_S_ISCHR,  METH_O, stat_S_ISCHR_doc},
+    {"S_ISBLK",         stat_S_ISBLK,  METH_O, stat_S_ISBLK_doc},
+    {"S_ISREG",         stat_S_ISREG,  METH_O, stat_S_ISREG_doc},
+    {"S_ISFIFO",        stat_S_ISFIFO, METH_O, stat_S_ISFIFO_doc},
+    {"S_ISLNK",         stat_S_ISLNK,  METH_O, stat_S_ISLNK_doc},
+    {"S_ISSOCK",        stat_S_ISSOCK, METH_O, stat_S_ISSOCK_doc},
+    {"S_ISDOOR",        stat_S_ISDOOR, METH_O, stat_S_ISDOOR_doc},
+    {"S_ISPORT",        stat_S_ISPORT, METH_O, stat_S_ISPORT_doc},
+    {"S_ISWHT",         stat_S_ISWHT,  METH_O, stat_S_ISWHT_doc},
+    {"S_IMODE",         stat_S_IMODE,  METH_O, stat_S_IMODE_doc},
+    {"S_IFMT",          stat_S_IFMT,   METH_O, stat_S_IFMT_doc},
+    {"filemode",        stat_filemode, METH_O, stat_filemode_doc},
+    {NULL,              NULL}           /* sentinel */
+};
+
+
+PyDoc_STRVAR(module_doc,
+"S_IFMT_: file type bits\n\
+S_IFDIR: directory\n\
+S_IFCHR: character device\n\
+S_IFBLK: block device\n\
+S_IFREG: regular file\n\
+S_IFIFO: fifo (named pipe)\n\
+S_IFLNK: symbolic link\n\
+S_IFSOCK: socket file\n\
+S_IFDOOR: door\n\
+S_IFPORT: event port\n\
+S_IFWHT: whiteout\n\
+\n"
+
+"S_ISUID: set UID bit\n\
+S_ISGID: set GID bit\n\
+S_ENFMT: file locking enforcement\n\
+S_ISVTX: sticky bit\n\
+S_IREAD: Unix V7 synonym for S_IRUSR\n\
+S_IWRITE: Unix V7 synonym for S_IWUSR\n\
+S_IEXEC: Unix V7 synonym for S_IXUSR\n\
+S_IRWXU: mask for owner permissions\n\
+S_IRUSR: read by owner\n\
+S_IWUSR: write by owner\n\
+S_IXUSR: execute by owner\n\
+S_IRWXG: mask for group permissions\n\
+S_IRGRP: read by group\n\
+S_IWGRP: write by group\n\
+S_IXGRP: execute by group\n\
+S_IRWXO: mask for others (not in group) permissions\n\
+S_IROTH: read by others\n\
+S_IWOTH: write by others\n\
+S_IXOTH: execute by others\n\
+\n"
+
+"UF_NODUMP: do not dump file\n\
+UF_IMMUTABLE: file may not be changed\n\
+UF_APPEND: file may only be appended to\n\
+UF_OPAQUE: directory is opaque when viewed through a union stack\n\
+UF_NOUNLINK: file may not be renamed or deleted\n\
+UF_COMPRESSED: OS X: file is hfs-compressed\n\
+UF_HIDDEN: OS X: file should not be displayed\n\
+SF_ARCHIVED: file may be archived\n\
+SF_IMMUTABLE: file may not be changed\n\
+SF_APPEND: file may only be appended to\n\
+SF_NOUNLINK: file may not be renamed or deleted\n\
+SF_SNAPSHOT: file is a snapshot file\n\
+\n"
+
+"ST_MODE\n\
+ST_INO\n\
+ST_DEV\n\
+ST_NLINK\n\
+ST_UID\n\
+ST_GID\n\
+ST_SIZE\n\
+ST_ATIME\n\
+ST_MTIME\n\
+ST_CTIME\n\
+");
+
+
+static struct PyModuleDef statmodule = {
+    PyModuleDef_HEAD_INIT,
+    "_stat",
+    module_doc,
+    -1,
+    stat_methods,
+    NULL,
+    NULL,
+    NULL,
+    NULL
+};
+
+PyMODINIT_FUNC
+PyInit__stat(void)
+{
+    PyObject *m;
+    m = PyModule_Create(&statmodule);
+    if (m == NULL)
+        return NULL;
+
+    if (PyModule_AddIntMacro(m, S_IFDIR)) return NULL;
+    if (PyModule_AddIntMacro(m, S_IFCHR)) return NULL;
+    if (PyModule_AddIntMacro(m, S_IFBLK)) return NULL;
+    if (PyModule_AddIntMacro(m, S_IFREG)) return NULL;
+    if (PyModule_AddIntMacro(m, S_IFIFO)) return NULL;
+    if (PyModule_AddIntMacro(m, S_IFLNK)) return NULL;
+    if (PyModule_AddIntMacro(m, S_IFSOCK)) return NULL;
+    if (PyModule_AddIntMacro(m, S_IFDOOR)) return NULL;
+    if (PyModule_AddIntMacro(m, S_IFPORT)) return NULL;
+    if (PyModule_AddIntMacro(m, S_IFWHT)) return NULL;
+
+    if (PyModule_AddIntMacro(m, S_ISUID)) return NULL;
+    if (PyModule_AddIntMacro(m, S_ISGID)) return NULL;
+    if (PyModule_AddIntMacro(m, S_ISVTX)) return NULL;
+    if (PyModule_AddIntMacro(m, S_ENFMT)) return NULL;
+
+    if (PyModule_AddIntMacro(m, S_IREAD)) return NULL;
+    if (PyModule_AddIntMacro(m, S_IWRITE)) return NULL;
+    if (PyModule_AddIntMacro(m, S_IEXEC)) return NULL;
+
+    if (PyModule_AddIntMacro(m, S_IRWXU)) return NULL;
+    if (PyModule_AddIntMacro(m, S_IRUSR)) return NULL;
+    if (PyModule_AddIntMacro(m, S_IWUSR)) return NULL;
+    if (PyModule_AddIntMacro(m, S_IXUSR)) return NULL;
+
+    if (PyModule_AddIntMacro(m, S_IRWXG)) return NULL;
+    if (PyModule_AddIntMacro(m, S_IRGRP)) return NULL;
+    if (PyModule_AddIntMacro(m, S_IWGRP)) return NULL;
+    if (PyModule_AddIntMacro(m, S_IXGRP)) return NULL;
+
+    if (PyModule_AddIntMacro(m, S_IRWXO)) return NULL;
+    if (PyModule_AddIntMacro(m, S_IROTH)) return NULL;
+    if (PyModule_AddIntMacro(m, S_IWOTH)) return NULL;
+    if (PyModule_AddIntMacro(m, S_IXOTH)) return NULL;
+
+    if (PyModule_AddIntMacro(m, UF_NODUMP)) return NULL;
+    if (PyModule_AddIntMacro(m, UF_IMMUTABLE)) return NULL;
+    if (PyModule_AddIntMacro(m, UF_APPEND)) return NULL;
+    if (PyModule_AddIntMacro(m, UF_OPAQUE)) return NULL;
+    if (PyModule_AddIntMacro(m, UF_NOUNLINK)) return NULL;
+    if (PyModule_AddIntMacro(m, UF_COMPRESSED)) return NULL;
+    if (PyModule_AddIntMacro(m, UF_HIDDEN)) return NULL;
+    if (PyModule_AddIntMacro(m, SF_ARCHIVED)) return NULL;
+    if (PyModule_AddIntMacro(m, SF_IMMUTABLE)) return NULL;
+    if (PyModule_AddIntMacro(m, SF_APPEND)) return NULL;
+    if (PyModule_AddIntMacro(m, SF_NOUNLINK)) return NULL;
+    if (PyModule_AddIntMacro(m, SF_SNAPSHOT)) return NULL;
+
+    if (PyModule_AddIntConstant(m, "ST_MODE", 0)) return NULL;
+    if (PyModule_AddIntConstant(m, "ST_INO", 1)) return NULL;
+    if (PyModule_AddIntConstant(m, "ST_DEV", 2)) return NULL;
+    if (PyModule_AddIntConstant(m, "ST_NLINK", 3)) return NULL;
+    if (PyModule_AddIntConstant(m, "ST_UID", 4)) return NULL;
+    if (PyModule_AddIntConstant(m, "ST_GID", 5)) return NULL;
+    if (PyModule_AddIntConstant(m, "ST_SIZE", 6)) return NULL;
+    if (PyModule_AddIntConstant(m, "ST_ATIME", 7)) return NULL;
+    if (PyModule_AddIntConstant(m, "ST_MTIME", 8)) return NULL;
+    if (PyModule_AddIntConstant(m, "ST_CTIME", 9)) return NULL;
+
+    return m;
+}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/Modules/_struct.c b/Modules/_struct.c
index a248753..ad9959e 100644
--- a/Modules/_struct.c
+++ b/Modules/_struct.c
@@ -26,6 +26,7 @@
     const struct _formatdef *fmtdef;
     Py_ssize_t offset;
     Py_ssize_t size;
+    Py_ssize_t repeat;
 } formatcode;
 
 /* Struct object interface */
@@ -1199,12 +1200,11 @@
     case '!': /* Network byte order is big-endian */
         return bigendian_table;
     case '=': { /* Host byte order -- different from native in alignment! */
-        int n = 1;
-        char *p = (char *) &n;
-        if (*p == 1)
-            return lilendian_table;
-        else
-            return bigendian_table;
+#if PY_LITTLE_ENDIAN
+        return lilendian_table;
+#else
+        return bigendian_table;
+#endif
     }
     default:
         --*pfmt; /* Back out of pointer increment */
@@ -1248,6 +1248,9 @@
     return size;
 }
 
+/*
+ * Struct object implementation.
+ */
 
 /* calculate the size of a format string */
 
@@ -1261,7 +1264,7 @@
     const char *s;
     const char *fmt;
     char c;
-    Py_ssize_t size, len, num, itemsize;
+    Py_ssize_t size, len, ncodes, num, itemsize;
 
     fmt = PyBytes_AS_STRING(self->s_format);
 
@@ -1270,6 +1273,7 @@
     s = fmt;
     size = 0;
     len = 0;
+    ncodes = 0;
     while ((c = *s++) != '\0') {
         if (Py_ISSPACE(Py_CHARMASK(c)))
             continue;
@@ -1299,9 +1303,9 @@
 
         switch (c) {
             case 's': /* fall through */
-            case 'p': len++; break;
+            case 'p': len++; ncodes++; break;
             case 'x': break;
-            default: len += num; break;
+            default: len += num; if (num) ncodes++; break;
         }
 
         itemsize = e->size;
@@ -1316,14 +1320,14 @@
     }
 
     /* check for overflow */
-    if ((len + 1) > (PY_SSIZE_T_MAX / sizeof(formatcode))) {
+    if ((ncodes + 1) > (PY_SSIZE_T_MAX / sizeof(formatcode))) {
         PyErr_NoMemory();
         return -1;
     }
 
     self->s_size = size;
     self->s_len = len;
-    codes = PyMem_MALLOC((len + 1) * sizeof(formatcode));
+    codes = PyMem_MALLOC((ncodes + 1) * sizeof(formatcode));
     if (codes == NULL) {
         PyErr_NoMemory();
         return -1;
@@ -1355,23 +1359,24 @@
             codes->offset = size;
             codes->size = num;
             codes->fmtdef = e;
+            codes->repeat = 1;
             codes++;
             size += num;
         } else if (c == 'x') {
             size += num;
-        } else {
-            while (--num >= 0) {
-                codes->offset = size;
-                codes->size = e->size;
-                codes->fmtdef = e;
-                codes++;
-                size += e->size;
-            }
+        } else if (num) {
+            codes->offset = size;
+            codes->size = e->size;
+            codes->fmtdef = e;
+            codes->repeat = num;
+            codes++;
+            size += e->size * num;
         }
     }
     codes->fmtdef = NULL;
     codes->offset = size;
     codes->size = 0;
+    codes->repeat = 0;
 
     return 0;
 
@@ -1460,22 +1465,26 @@
         return NULL;
 
     for (code = soself->s_codes; code->fmtdef != NULL; code++) {
-        PyObject *v;
         const formatdef *e = code->fmtdef;
         const char *res = startfrom + code->offset;
-        if (e->format == 's') {
-            v = PyBytes_FromStringAndSize(res, code->size);
-        } else if (e->format == 'p') {
-            Py_ssize_t n = *(unsigned char*)res;
-            if (n >= code->size)
-                n = code->size - 1;
-            v = PyBytes_FromStringAndSize(res + 1, n);
-        } else {
-            v = e->unpack(res, e);
+        Py_ssize_t j = code->repeat;
+        while (j--) {
+            PyObject *v;
+            if (e->format == 's') {
+                v = PyBytes_FromStringAndSize(res, code->size);
+            } else if (e->format == 'p') {
+                Py_ssize_t n = *(unsigned char*)res;
+                if (n >= code->size)
+                    n = code->size - 1;
+                v = PyBytes_FromStringAndSize(res + 1, n);
+            } else {
+                v = e->unpack(res, e);
+            }
+            if (v == NULL)
+                goto fail;
+            PyTuple_SET_ITEM(result, i++, v);
+            res += code->size;
         }
-        if (v == NULL)
-            goto fail;
-        PyTuple_SET_ITEM(result, i++, v);
     }
 
     return result;
@@ -1557,6 +1566,142 @@
 }
 
 
+/* Unpack iterator type */
+
+typedef struct {
+    PyObject_HEAD
+    PyStructObject *so;
+    Py_buffer buf;
+    Py_ssize_t index;
+} unpackiterobject;
+
+static void
+unpackiter_dealloc(unpackiterobject *self)
+{
+    Py_XDECREF(self->so);
+    PyBuffer_Release(&self->buf);
+    PyObject_GC_Del(self);
+}
+
+static int
+unpackiter_traverse(unpackiterobject *self, visitproc visit, void *arg)
+{
+    Py_VISIT(self->so);
+    Py_VISIT(self->buf.obj);
+    return 0;
+}
+
+static PyObject *
+unpackiter_len(unpackiterobject *self)
+{
+    Py_ssize_t len;
+    if (self->so == NULL)
+        len = 0;
+    else
+        len = (self->buf.len - self->index) / self->so->s_size;
+    return PyLong_FromSsize_t(len);
+}
+
+static PyMethodDef unpackiter_methods[] = {
+    {"__length_hint__", (PyCFunction) unpackiter_len, METH_NOARGS, NULL},
+    {NULL,              NULL}           /* sentinel */
+};
+
+static PyObject *
+unpackiter_iternext(unpackiterobject *self)
+{
+    PyObject *result;
+    if (self->so == NULL)
+        return NULL;
+    if (self->index >= self->buf.len) {
+        /* Iterator exhausted */
+        Py_CLEAR(self->so);
+        PyBuffer_Release(&self->buf);
+        return NULL;
+    }
+    assert(self->index + self->so->s_size <= self->buf.len);
+    result = s_unpack_internal(self->so,
+                               (char*) self->buf.buf + self->index);
+    self->index += self->so->s_size;
+    return result;
+}
+
+static PyTypeObject unpackiter_type = {
+    PyVarObject_HEAD_INIT(&PyType_Type, 0)
+    "unpack_iterator",                          /* tp_name */
+    sizeof(unpackiterobject),                   /* tp_basicsize */
+    0,                                          /* tp_itemsize */
+    (destructor)unpackiter_dealloc,             /* tp_dealloc */
+    0,                                          /* tp_print */
+    0,                                          /* tp_getattr */
+    0,                                          /* 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 */
+    PyObject_GenericGetAttr,                    /* tp_getattro */
+    0,                                          /* tp_setattro */
+    0,                                          /* tp_as_buffer */
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,    /* tp_flags */
+    0,                                          /* tp_doc */
+    (traverseproc)unpackiter_traverse,          /* tp_traverse */
+    0,                                          /* tp_clear */
+    0,                                          /* tp_richcompare */
+    0,                                          /* tp_weaklistoffset */
+    PyObject_SelfIter,                          /* tp_iter */
+    (iternextfunc)unpackiter_iternext,          /* tp_iternext */
+    unpackiter_methods                          /* tp_methods */
+};
+
+PyDoc_STRVAR(s_iter_unpack__doc__,
+"S.iter_unpack(buffer) -> iterator(v1, v2, ...)\n\
+\n\
+Return an iterator yielding tuples unpacked from the given bytes\n\
+source, like a repeated invocation of unpack_from().  Requires\n\
+that the bytes length be a multiple of the struct size.");
+
+static PyObject *
+s_iter_unpack(PyObject *_so, PyObject *input)
+{
+    PyStructObject *so = (PyStructObject *) _so;
+    unpackiterobject *self;
+
+    assert(PyStruct_Check(_so));
+    assert(so->s_codes != NULL);
+
+    if (so->s_size == 0) {
+        PyErr_Format(StructError,
+                     "cannot iteratively unpack with a struct of length 0");
+        return NULL;
+    }
+
+    self = (unpackiterobject *) PyType_GenericAlloc(&unpackiter_type, 0);
+    if (self == NULL)
+        return NULL;
+
+    if (PyObject_GetBuffer(input, &self->buf, PyBUF_SIMPLE) < 0) {
+        Py_DECREF(self);
+        return NULL;
+    }
+    if (self->buf.len % so->s_size != 0) {
+        PyErr_Format(StructError,
+                     "iterative unpacking requires a bytes length "
+                     "multiple of %zd",
+                     so->s_size);
+        Py_DECREF(self);
+        return NULL;
+    }
+    Py_INCREF(so);
+    self->so = so;
+    self->index = 0;
+    return (PyObject *) self;
+}
+
+
 /*
  * Guts of the pack function.
  *
@@ -1578,62 +1723,67 @@
     memset(buf, '\0', soself->s_size);
     i = offset;
     for (code = soself->s_codes; code->fmtdef != NULL; code++) {
-        Py_ssize_t n;
-        PyObject *v = PyTuple_GET_ITEM(args, i++);
         const formatdef *e = code->fmtdef;
         char *res = buf + code->offset;
-        if (e->format == 's') {
-            int isstring;
-            void *p;
-            isstring = PyBytes_Check(v);
-            if (!isstring && !PyByteArray_Check(v)) {
-                PyErr_SetString(StructError,
-                                "argument for 's' must be a bytes object");
-                return -1;
-            }
-            if (isstring) {
-                n = PyBytes_GET_SIZE(v);
-                p = PyBytes_AS_STRING(v);
-            }
-            else {
-                n = PyByteArray_GET_SIZE(v);
-                p = PyByteArray_AS_STRING(v);
-            }
-            if (n > code->size)
-                n = code->size;
-            if (n > 0)
-                memcpy(res, p, n);
-        } else if (e->format == 'p') {
-            int isstring;
-            void *p;
-            isstring = PyBytes_Check(v);
-            if (!isstring && !PyByteArray_Check(v)) {
-                PyErr_SetString(StructError,
-                                "argument for 'p' must be a bytes object");
-                return -1;
-            }
-            if (isstring) {
-                n = PyBytes_GET_SIZE(v);
-                p = PyBytes_AS_STRING(v);
-            }
-            else {
-                n = PyByteArray_GET_SIZE(v);
-                p = PyByteArray_AS_STRING(v);
-            }
-            if (n > (code->size - 1))
-                n = code->size - 1;
-            if (n > 0)
-                memcpy(res + 1, p, n);
-            if (n > 255)
-                n = 255;
-            *res = Py_SAFE_DOWNCAST(n, Py_ssize_t, unsigned char);
-        } else {
-            if (e->pack(res, v, e) < 0) {
-                if (PyLong_Check(v) && PyErr_ExceptionMatches(PyExc_OverflowError))
+        Py_ssize_t j = code->repeat;
+        while (j--) {
+            PyObject *v = PyTuple_GET_ITEM(args, i++);
+            if (e->format == 's') {
+                Py_ssize_t n;
+                int isstring;
+                void *p;
+                isstring = PyBytes_Check(v);
+                if (!isstring && !PyByteArray_Check(v)) {
                     PyErr_SetString(StructError,
-                                    "int too large to convert");
-                return -1;
+                                    "argument for 's' must be a bytes object");
+                    return -1;
+                }
+                if (isstring) {
+                    n = PyBytes_GET_SIZE(v);
+                    p = PyBytes_AS_STRING(v);
+                }
+                else {
+                    n = PyByteArray_GET_SIZE(v);
+                    p = PyByteArray_AS_STRING(v);
+                }
+                if (n > code->size)
+                    n = code->size;
+                if (n > 0)
+                    memcpy(res, p, n);
+            } else if (e->format == 'p') {
+                Py_ssize_t n;
+                int isstring;
+                void *p;
+                isstring = PyBytes_Check(v);
+                if (!isstring && !PyByteArray_Check(v)) {
+                    PyErr_SetString(StructError,
+                                    "argument for 'p' must be a bytes object");
+                    return -1;
+                }
+                if (isstring) {
+                    n = PyBytes_GET_SIZE(v);
+                    p = PyBytes_AS_STRING(v);
+                }
+                else {
+                    n = PyByteArray_GET_SIZE(v);
+                    p = PyByteArray_AS_STRING(v);
+                }
+                if (n > (code->size - 1))
+                    n = code->size - 1;
+                if (n > 0)
+                    memcpy(res + 1, p, n);
+                if (n > 255)
+                    n = 255;
+                *res = Py_SAFE_DOWNCAST(n, Py_ssize_t, unsigned char);
+            } else {
+                if (e->pack(res, v, e) < 0) {
+                    if (PyLong_Check(v) && PyErr_ExceptionMatches(PyExc_OverflowError))
+                        PyErr_SetString(StructError,
+                                        "int too large to convert");
+                    return -1;
+                }
             }
+            res += code->size;
         }
     }
 
@@ -1692,8 +1842,8 @@
 s_pack_into(PyObject *self, PyObject *args)
 {
     PyStructObject *soself;
-    char *buffer;
-    Py_ssize_t buffer_len, offset;
+    Py_buffer buffer;
+    Py_ssize_t offset;
 
     /* Validate arguments.  +1 is for the first arg as buffer. */
     soself = (PyStructObject *)self;
@@ -1718,34 +1868,37 @@
     }
 
     /* Extract a writable memory buffer from the first argument */
-    if ( PyObject_AsWriteBuffer(PyTuple_GET_ITEM(args, 0),
-                                                            (void**)&buffer, &buffer_len) == -1 ) {
+    if (!PyArg_Parse(PyTuple_GET_ITEM(args, 0), "w*", &buffer))
         return NULL;
-    }
-    assert( buffer_len >= 0 );
+    assert(buffer.len >= 0);
 
     /* Extract the offset from the first argument */
     offset = PyNumber_AsSsize_t(PyTuple_GET_ITEM(args, 1), PyExc_IndexError);
-    if (offset == -1 && PyErr_Occurred())
+    if (offset == -1 && PyErr_Occurred()) {
+        PyBuffer_Release(&buffer);
         return NULL;
+    }
 
     /* Support negative offsets. */
     if (offset < 0)
-        offset += buffer_len;
+        offset += buffer.len;
 
     /* Check boundaries */
-    if (offset < 0 || (buffer_len - offset) < soself->s_size) {
+    if (offset < 0 || (buffer.len - offset) < soself->s_size) {
         PyErr_Format(StructError,
                      "pack_into requires a buffer of at least %zd bytes",
                      soself->s_size);
+        PyBuffer_Release(&buffer);
         return NULL;
     }
 
     /* Call the guts */
-    if ( s_pack_internal(soself, args, 2, buffer + offset) != 0 ) {
+    if (s_pack_internal(soself, args, 2, (char*)buffer.buf + offset) != 0) {
+        PyBuffer_Release(&buffer);
         return NULL;
     }
 
+    PyBuffer_Release(&buffer);
     Py_RETURN_NONE;
 }
 
@@ -1769,14 +1922,18 @@
 s_sizeof(PyStructObject *self, void *unused)
 {
     Py_ssize_t size;
+    formatcode *code;
 
-    size = sizeof(PyStructObject) + sizeof(formatcode) * (self->s_len + 1);
+    size = sizeof(PyStructObject) + sizeof(formatcode);
+    for (code = self->s_codes; code->fmtdef != NULL; code++)
+        size += sizeof(formatcode);
     return PyLong_FromSsize_t(size);
 }
 
 /* List of functions */
 
 static struct PyMethodDef s_methods[] = {
+    {"iter_unpack",     s_iter_unpack,  METH_O, s_iter_unpack__doc__},
     {"pack",            s_pack,         METH_VARARGS, s_pack__doc__},
     {"pack_into",       s_pack_into,    METH_VARARGS, s_pack_into__doc__},
     {"unpack",          s_unpack,       METH_O, s_unpack__doc__},
@@ -2026,9 +2183,34 @@
     return result;
 }
 
+PyDoc_STRVAR(iter_unpack_doc,
+"iter_unpack(fmt, buffer) -> iterator(v1, v2, ...)\n\
+\n\
+Return an iterator yielding tuples unpacked from the given bytes\n\
+source according to the format string, like a repeated invocation of\n\
+unpack_from().  Requires that the bytes length be a multiple of the\n\
+format struct size.");
+
+static PyObject *
+iter_unpack(PyObject *self, PyObject *args)
+{
+    PyObject *s_object, *fmt, *input, *result;
+
+    if (!PyArg_ParseTuple(args, "OO:iter_unpack", &fmt, &input))
+        return NULL;
+
+    s_object = cache_struct(fmt);
+    if (s_object == NULL)
+        return NULL;
+    result = s_iter_unpack(s_object, input);
+    Py_DECREF(s_object);
+    return result;
+}
+
 static struct PyMethodDef module_functions[] = {
     {"_clearcache",     (PyCFunction)clearcache,        METH_NOARGS,    clearcache_doc},
     {"calcsize",        calcsize,       METH_O, calcsize_doc},
+    {"iter_unpack",     iter_unpack,    METH_VARARGS,   iter_unpack_doc},
     {"pack",            pack,           METH_VARARGS,   pack_doc},
     {"pack_into",       pack_into,      METH_VARARGS,   pack_into_doc},
     {"unpack",          unpack, METH_VARARGS,   unpack_doc},
@@ -2098,13 +2280,13 @@
 
     /* Check endian and swap in faster functions */
     {
-        int one = 1;
         formatdef *native = native_table;
         formatdef *other, *ptr;
-        if ((int)*(unsigned char*)&one)
-            other = lilendian_table;
-        else
-            other = bigendian_table;
+#if PY_LITTLE_ENDIAN
+        other = lilendian_table;
+#else
+        other = bigendian_table;
+#endif
         /* Scan through the native table, find a matching
            entry in the endian table and swap in the
            native implementations whenever possible
diff --git a/Modules/_testbuffer.c b/Modules/_testbuffer.c
index 316666e..0c6ef16 100644
--- a/Modules/_testbuffer.c
+++ b/Modules/_testbuffer.c
@@ -1815,7 +1815,7 @@
         if (init_slice(base, key, 0) < 0)
             goto err_occurred;
     }
-    else if PyTuple_Check(key) {
+    else if (PyTuple_Check(key)) {
         /* multi-dimensional slice */
         PyObject *tuple = key;
         Py_ssize_t i, n;
@@ -2837,36 +2837,36 @@
     if (simple_format == NULL)
         return NULL;
 
-    PyModule_AddIntConstant(m, "ND_MAX_NDIM", ND_MAX_NDIM);
-    PyModule_AddIntConstant(m, "ND_VAREXPORT", ND_VAREXPORT);
-    PyModule_AddIntConstant(m, "ND_WRITABLE", ND_WRITABLE);
-    PyModule_AddIntConstant(m, "ND_FORTRAN", ND_FORTRAN);
-    PyModule_AddIntConstant(m, "ND_SCALAR", ND_SCALAR);
-    PyModule_AddIntConstant(m, "ND_PIL", ND_PIL);
-    PyModule_AddIntConstant(m, "ND_GETBUF_FAIL", ND_GETBUF_FAIL);
-    PyModule_AddIntConstant(m, "ND_GETBUF_UNDEFINED", ND_GETBUF_UNDEFINED);
-    PyModule_AddIntConstant(m, "ND_REDIRECT", ND_REDIRECT);
+    PyModule_AddIntMacro(m, ND_MAX_NDIM);
+    PyModule_AddIntMacro(m, ND_VAREXPORT);
+    PyModule_AddIntMacro(m, ND_WRITABLE);
+    PyModule_AddIntMacro(m, ND_FORTRAN);
+    PyModule_AddIntMacro(m, ND_SCALAR);
+    PyModule_AddIntMacro(m, ND_PIL);
+    PyModule_AddIntMacro(m, ND_GETBUF_FAIL);
+    PyModule_AddIntMacro(m, ND_GETBUF_UNDEFINED);
+    PyModule_AddIntMacro(m, ND_REDIRECT);
 
-    PyModule_AddIntConstant(m, "PyBUF_SIMPLE", PyBUF_SIMPLE);
-    PyModule_AddIntConstant(m, "PyBUF_WRITABLE", PyBUF_WRITABLE);
-    PyModule_AddIntConstant(m, "PyBUF_FORMAT", PyBUF_FORMAT);
-    PyModule_AddIntConstant(m, "PyBUF_ND", PyBUF_ND);
-    PyModule_AddIntConstant(m, "PyBUF_STRIDES", PyBUF_STRIDES);
-    PyModule_AddIntConstant(m, "PyBUF_INDIRECT", PyBUF_INDIRECT);
-    PyModule_AddIntConstant(m, "PyBUF_C_CONTIGUOUS", PyBUF_C_CONTIGUOUS);
-    PyModule_AddIntConstant(m, "PyBUF_F_CONTIGUOUS", PyBUF_F_CONTIGUOUS);
-    PyModule_AddIntConstant(m, "PyBUF_ANY_CONTIGUOUS", PyBUF_ANY_CONTIGUOUS);
-    PyModule_AddIntConstant(m, "PyBUF_FULL", PyBUF_FULL);
-    PyModule_AddIntConstant(m, "PyBUF_FULL_RO", PyBUF_FULL_RO);
-    PyModule_AddIntConstant(m, "PyBUF_RECORDS", PyBUF_RECORDS);
-    PyModule_AddIntConstant(m, "PyBUF_RECORDS_RO", PyBUF_RECORDS_RO);
-    PyModule_AddIntConstant(m, "PyBUF_STRIDED", PyBUF_STRIDED);
-    PyModule_AddIntConstant(m, "PyBUF_STRIDED_RO", PyBUF_STRIDED_RO);
-    PyModule_AddIntConstant(m, "PyBUF_CONTIG", PyBUF_CONTIG);
-    PyModule_AddIntConstant(m, "PyBUF_CONTIG_RO", PyBUF_CONTIG_RO);
+    PyModule_AddIntMacro(m, PyBUF_SIMPLE);
+    PyModule_AddIntMacro(m, PyBUF_WRITABLE);
+    PyModule_AddIntMacro(m, PyBUF_FORMAT);
+    PyModule_AddIntMacro(m, PyBUF_ND);
+    PyModule_AddIntMacro(m, PyBUF_STRIDES);
+    PyModule_AddIntMacro(m, PyBUF_INDIRECT);
+    PyModule_AddIntMacro(m, PyBUF_C_CONTIGUOUS);
+    PyModule_AddIntMacro(m, PyBUF_F_CONTIGUOUS);
+    PyModule_AddIntMacro(m, PyBUF_ANY_CONTIGUOUS);
+    PyModule_AddIntMacro(m, PyBUF_FULL);
+    PyModule_AddIntMacro(m, PyBUF_FULL_RO);
+    PyModule_AddIntMacro(m, PyBUF_RECORDS);
+    PyModule_AddIntMacro(m, PyBUF_RECORDS_RO);
+    PyModule_AddIntMacro(m, PyBUF_STRIDED);
+    PyModule_AddIntMacro(m, PyBUF_STRIDED_RO);
+    PyModule_AddIntMacro(m, PyBUF_CONTIG);
+    PyModule_AddIntMacro(m, PyBUF_CONTIG_RO);
 
-    PyModule_AddIntConstant(m, "PyBUF_READ", PyBUF_READ);
-    PyModule_AddIntConstant(m, "PyBUF_WRITE", PyBUF_WRITE);
+    PyModule_AddIntMacro(m, PyBUF_READ);
+    PyModule_AddIntMacro(m, PyBUF_WRITE);
 
     return m;
 }
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index 91f291a..4a4209d 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -65,6 +65,69 @@
 }
 
 static PyObject*
+test_sizeof_c_types(PyObject *self)
+{
+#define CHECK_SIZEOF(TYPE, EXPECTED)         \
+    if (EXPECTED != sizeof(TYPE))  {         \
+        PyErr_Format(TestError,              \
+            "sizeof(%s) = %u instead of %u", \
+            #TYPE, sizeof(TYPE), EXPECTED);  \
+        return (PyObject*)NULL;              \
+    }
+#define IS_SIGNED(TYPE) (((TYPE)-1) < (TYPE)0)
+#define CHECK_SIGNNESS(TYPE, SIGNED)         \
+    if (IS_SIGNED(TYPE) != SIGNED) {         \
+        PyErr_Format(TestError,              \
+            "%s signness is, instead of %i",  \
+            #TYPE, IS_SIGNED(TYPE), SIGNED); \
+        return (PyObject*)NULL;              \
+    }
+
+    /* integer types */
+    CHECK_SIZEOF(Py_UCS1, 1);
+    CHECK_SIZEOF(Py_UCS2, 2);
+    CHECK_SIZEOF(Py_UCS4, 4);
+    CHECK_SIGNNESS(Py_UCS1, 0);
+    CHECK_SIGNNESS(Py_UCS2, 0);
+    CHECK_SIGNNESS(Py_UCS4, 0);
+#ifdef HAVE_INT32_T
+    CHECK_SIZEOF(PY_INT32_T, 4);
+    CHECK_SIGNNESS(PY_INT32_T, 1);
+#endif
+#ifdef HAVE_UINT32_T
+    CHECK_SIZEOF(PY_UINT32_T, 4);
+    CHECK_SIGNNESS(PY_UINT32_T, 0);
+#endif
+#ifdef HAVE_INT64_T
+    CHECK_SIZEOF(PY_INT64_T, 8);
+    CHECK_SIGNNESS(PY_INT64_T, 1);
+#endif
+#ifdef HAVE_UINT64_T
+    CHECK_SIZEOF(PY_UINT64_T, 8);
+    CHECK_SIGNNESS(PY_UINT64_T, 0);
+#endif
+
+    /* pointer/size types */
+    CHECK_SIZEOF(size_t, sizeof(void *));
+    CHECK_SIGNNESS(size_t, 0);
+    CHECK_SIZEOF(Py_ssize_t, sizeof(void *));
+    CHECK_SIGNNESS(Py_ssize_t, 1);
+
+    CHECK_SIZEOF(Py_uintptr_t, sizeof(void *));
+    CHECK_SIGNNESS(Py_uintptr_t, 0);
+    CHECK_SIZEOF(Py_intptr_t, sizeof(void *));
+    CHECK_SIGNNESS(Py_intptr_t, 1);
+
+    Py_INCREF(Py_None);
+    return Py_None;
+
+#undef IS_SIGNED
+#undef CHECK_SIGNESS
+#undef CHECK_SIZEOF
+}
+
+
+static PyObject*
 test_list_api(PyObject *self)
 {
     PyObject* list;
@@ -1424,6 +1487,20 @@
     else
         return raiseTestError("test_widechar",
                               "PyUnicode_FromUnicode(L\"\\U00110000\", 1) didn't fail");
+
+    wide = PyUnicode_FromUnicode(NULL, 1);
+    if (wide == NULL)
+        return NULL;
+    PyUnicode_AS_UNICODE(wide)[0] = invalid[0];
+    if (_PyUnicode_Ready(wide) < 0) {
+        Py_DECREF(wide);
+        PyErr_Clear();
+    }
+    else {
+        Py_DECREF(wide);
+        return raiseTestError("test_widechar",
+                              "PyUnicode_Ready() didn't fail");
+    }
 #endif
 
     Py_RETURN_NONE;
@@ -2390,6 +2467,56 @@
         return NULL;
     return PyMemoryView_FromBuffer(&info);
 }
+ 
+static PyObject *
+test_from_contiguous(PyObject* self, PyObject *noargs)
+{
+    int data[9] = {-1,-1,-1,-1,-1,-1,-1,-1,-1};
+    int init[5] = {0, 1, 2, 3, 4};
+    Py_ssize_t itemsize = sizeof(int);
+    Py_ssize_t shape = 5;
+    Py_ssize_t strides = 2 * itemsize;
+    Py_buffer view = {
+        data,
+        NULL,
+        5 * itemsize,
+        itemsize,
+        1,
+        1,
+        NULL,
+        &shape,
+        &strides,
+        NULL,
+        NULL
+    };
+    int *ptr;
+    int i;
+
+    PyBuffer_FromContiguous(&view, init, view.len, 'C');
+    ptr = view.buf;
+    for (i = 0; i < 5; i++) {
+        if (ptr[2*i] != i) {
+            PyErr_SetString(TestError,
+                "test_from_contiguous: incorrect result");
+            return NULL;
+        }
+    }
+
+    view.buf = &data[8];
+    view.strides[0] = -2 * itemsize;
+
+    PyBuffer_FromContiguous(&view, init, view.len, 'C');
+    ptr = view.buf;
+    for (i = 0; i < 5; i++) {
+        if (*(ptr-2*i) != i) {
+            PyErr_SetString(TestError,
+                "test_from_contiguous: incorrect result");
+            return NULL;
+        }
+    }
+
+    Py_RETURN_NONE;
+}
 
 /* Test that the fatal error from not having a current thread doesn't
    cause an infinite loop.  Run via Lib/test/test_capi.py */
@@ -2439,14 +2566,27 @@
     return PyLong_FromLong(r);
 }
 
+static int
+check_time_rounding(int round)
+{
+    if (round != _PyTime_ROUND_DOWN && round != _PyTime_ROUND_UP) {
+        PyErr_SetString(PyExc_ValueError, "invalid rounding");
+        return -1;
+    }
+    return 0;
+}
+
 static PyObject *
 test_pytime_object_to_time_t(PyObject *self, PyObject *args)
 {
     PyObject *obj;
     time_t sec;
-    if (!PyArg_ParseTuple(args, "O:pytime_object_to_time_t", &obj))
+    int round;
+    if (!PyArg_ParseTuple(args, "Oi:pytime_object_to_time_t", &obj, &round))
         return NULL;
-    if (_PyTime_ObjectToTime_t(obj, &sec) == -1)
+    if (check_time_rounding(round) < 0)
+        return NULL;
+    if (_PyTime_ObjectToTime_t(obj, &sec, round) == -1)
         return NULL;
     return _PyLong_FromTime_t(sec);
 }
@@ -2457,9 +2597,12 @@
     PyObject *obj;
     time_t sec;
     long usec;
-    if (!PyArg_ParseTuple(args, "O:pytime_object_to_timeval", &obj))
+    int round;
+    if (!PyArg_ParseTuple(args, "Oi:pytime_object_to_timeval", &obj, &round))
         return NULL;
-    if (_PyTime_ObjectToTimeval(obj, &sec, &usec) == -1)
+    if (check_time_rounding(round) < 0)
+        return NULL;
+    if (_PyTime_ObjectToTimeval(obj, &sec, &usec, round) == -1)
         return NULL;
     return Py_BuildValue("Nl", _PyLong_FromTime_t(sec), usec);
 }
@@ -2470,13 +2613,354 @@
     PyObject *obj;
     time_t sec;
     long nsec;
-    if (!PyArg_ParseTuple(args, "O:pytime_object_to_timespec", &obj))
+    int round;
+    if (!PyArg_ParseTuple(args, "Oi:pytime_object_to_timespec", &obj, &round))
         return NULL;
-    if (_PyTime_ObjectToTimespec(obj, &sec, &nsec) == -1)
+    if (check_time_rounding(round) < 0)
+        return NULL;
+    if (_PyTime_ObjectToTimespec(obj, &sec, &nsec, round) == -1)
         return NULL;
     return Py_BuildValue("Nl", _PyLong_FromTime_t(sec), nsec);
 }
 
+static void
+slot_tp_del(PyObject *self)
+{
+    _Py_IDENTIFIER(__tp_del__);
+    PyObject *del, *res;
+    PyObject *error_type, *error_value, *error_traceback;
+
+    /* Temporarily resurrect the object. */
+    assert(self->ob_refcnt == 0);
+    self->ob_refcnt = 1;
+
+    /* Save the current exception, if any. */
+    PyErr_Fetch(&error_type, &error_value, &error_traceback);
+
+    /* Execute __del__ method, if any. */
+    del = _PyObject_LookupSpecial(self, &PyId___tp_del__);
+    if (del != NULL) {
+        res = PyEval_CallObject(del, NULL);
+        if (res == NULL)
+            PyErr_WriteUnraisable(del);
+        else
+            Py_DECREF(res);
+        Py_DECREF(del);
+    }
+
+    /* Restore the saved exception. */
+    PyErr_Restore(error_type, error_value, error_traceback);
+
+    /* Undo the temporary resurrection; can't use DECREF here, it would
+     * cause a recursive call.
+     */
+    assert(self->ob_refcnt > 0);
+    if (--self->ob_refcnt == 0)
+        return;         /* this is the normal path out */
+
+    /* __del__ resurrected it!  Make it look like the original Py_DECREF
+     * never happened.
+     */
+    {
+        Py_ssize_t refcnt = self->ob_refcnt;
+        _Py_NewReference(self);
+        self->ob_refcnt = refcnt;
+    }
+    assert(!PyType_IS_GC(Py_TYPE(self)) ||
+           _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
+    /* If Py_REF_DEBUG, _Py_NewReference bumped _Py_RefTotal, so
+     * we need to undo that. */
+    _Py_DEC_REFTOTAL;
+    /* If Py_TRACE_REFS, _Py_NewReference re-added self to the object
+     * chain, so no more to do there.
+     * If COUNT_ALLOCS, the original decref bumped tp_frees, and
+     * _Py_NewReference bumped tp_allocs:  both of those need to be
+     * undone.
+     */
+#ifdef COUNT_ALLOCS
+    --Py_TYPE(self)->tp_frees;
+    --Py_TYPE(self)->tp_allocs;
+#endif
+}
+
+static PyObject *
+with_tp_del(PyObject *self, PyObject *args)
+{
+    PyObject *obj;
+    PyTypeObject *tp;
+
+    if (!PyArg_ParseTuple(args, "O:with_tp_del", &obj))
+        return NULL;
+    tp = (PyTypeObject *) obj;
+    if (!PyType_Check(obj) || !PyType_HasFeature(tp, Py_TPFLAGS_HEAPTYPE)) {
+        PyErr_Format(PyExc_TypeError,
+                     "heap type expected, got %R", obj);
+        return NULL;
+    }
+    tp->tp_del = slot_tp_del;
+    Py_INCREF(obj);
+    return obj;
+}
+
+static PyObject *
+_test_incref(PyObject *ob)
+{
+    Py_INCREF(ob);
+    return ob;
+}
+
+static PyObject *
+test_xincref_doesnt_leak(PyObject *ob)
+{
+    PyObject *obj = PyLong_FromLong(0);
+    Py_XINCREF(_test_incref(obj));
+    Py_DECREF(obj);
+    Py_DECREF(obj);
+    Py_DECREF(obj);
+    Py_RETURN_NONE;
+}
+
+static PyObject *
+test_incref_doesnt_leak(PyObject *ob)
+{
+    PyObject *obj = PyLong_FromLong(0);
+    Py_INCREF(_test_incref(obj));
+    Py_DECREF(obj);
+    Py_DECREF(obj);
+    Py_DECREF(obj);
+    Py_RETURN_NONE;
+}
+
+static PyObject *
+test_xdecref_doesnt_leak(PyObject *ob)
+{
+    Py_XDECREF(PyLong_FromLong(0));
+    Py_RETURN_NONE;
+}
+
+static PyObject *
+test_decref_doesnt_leak(PyObject *ob)
+{
+    Py_DECREF(PyLong_FromLong(0));
+    Py_RETURN_NONE;
+}
+
+static PyObject *
+test_incref_decref_API(PyObject *ob)
+{
+    PyObject *obj = PyLong_FromLong(0);
+    Py_IncRef(obj);
+    Py_DecRef(obj);
+    Py_DecRef(obj);
+    Py_RETURN_NONE;
+}
+
+static PyObject *
+test_pymem_alloc0(PyObject *self)
+{
+    void *ptr;
+
+    ptr = PyMem_Malloc(0);
+    if (ptr == NULL) {
+        PyErr_SetString(PyExc_RuntimeError, "PyMem_Malloc(0) returns NULL");
+        return NULL;
+    }
+    PyMem_Free(ptr);
+
+    ptr = PyObject_Malloc(0);
+    if (ptr == NULL) {
+        PyErr_SetString(PyExc_RuntimeError, "PyObject_Malloc(0) returns NULL");
+        return NULL;
+    }
+    PyObject_Free(ptr);
+
+    Py_RETURN_NONE;
+}
+
+typedef struct {
+    PyMemAllocator alloc;
+
+    size_t malloc_size;
+    void *realloc_ptr;
+    size_t realloc_new_size;
+    void *free_ptr;
+} alloc_hook_t;
+
+static void* hook_malloc (void* ctx, size_t size)
+{
+    alloc_hook_t *hook = (alloc_hook_t *)ctx;
+    hook->malloc_size = size;
+    return hook->alloc.malloc(hook->alloc.ctx, size);
+}
+
+static void* hook_realloc (void* ctx, void* ptr, size_t new_size)
+{
+    alloc_hook_t *hook = (alloc_hook_t *)ctx;
+    hook->realloc_ptr = ptr;
+    hook->realloc_new_size = new_size;
+    return hook->alloc.realloc(hook->alloc.ctx, ptr, new_size);
+}
+
+static void hook_free (void *ctx, void *ptr)
+{
+    alloc_hook_t *hook = (alloc_hook_t *)ctx;
+    hook->free_ptr = ptr;
+    hook->alloc.free(hook->alloc.ctx, ptr);
+}
+
+static PyObject *
+test_setallocators(PyMemAllocatorDomain domain)
+{
+    PyObject *res = NULL;
+    const char *error_msg;
+    alloc_hook_t hook;
+    PyMemAllocator alloc;
+    size_t size, size2;
+    void *ptr, *ptr2;
+
+    hook.malloc_size = 0;
+    hook.realloc_ptr = NULL;
+    hook.realloc_new_size = 0;
+    hook.free_ptr = NULL;
+
+    alloc.ctx = &hook;
+    alloc.malloc = &hook_malloc;
+    alloc.realloc = &hook_realloc;
+    alloc.free = &hook_free;
+    PyMem_GetAllocator(domain, &hook.alloc);
+    PyMem_SetAllocator(domain, &alloc);
+
+    size = 42;
+    switch(domain)
+    {
+    case PYMEM_DOMAIN_RAW: ptr = PyMem_RawMalloc(size); break;
+    case PYMEM_DOMAIN_MEM: ptr = PyMem_Malloc(size); break;
+    case PYMEM_DOMAIN_OBJ: ptr = PyObject_Malloc(size); break;
+    default: ptr = NULL; break;
+    }
+
+    if (ptr == NULL) {
+        error_msg = "malloc failed";
+        goto fail;
+    }
+
+    if (hook.malloc_size != size) {
+        error_msg = "malloc invalid size";
+        goto fail;
+    }
+
+    size2 = 200;
+    switch(domain)
+    {
+    case PYMEM_DOMAIN_RAW: ptr2 = PyMem_RawRealloc(ptr, size2); break;
+    case PYMEM_DOMAIN_MEM: ptr2 = PyMem_Realloc(ptr, size2); break;
+    case PYMEM_DOMAIN_OBJ: ptr2 = PyObject_Realloc(ptr, size2); break;
+    default: ptr2 = NULL; break;
+    }
+
+    if (ptr2 == NULL) {
+        error_msg = "realloc failed";
+        goto fail;
+    }
+
+    if (hook.realloc_ptr != ptr
+        || hook.realloc_new_size != size2) {
+        error_msg = "realloc invalid parameters";
+        goto fail;
+    }
+
+    switch(domain)
+    {
+    case PYMEM_DOMAIN_RAW: PyMem_RawFree(ptr2); break;
+    case PYMEM_DOMAIN_MEM: PyMem_Free(ptr2); break;
+    case PYMEM_DOMAIN_OBJ: PyObject_Free(ptr2); break;
+    }
+
+    if (hook.free_ptr != ptr2) {
+        error_msg = "free invalid pointer";
+        goto fail;
+    }
+
+    Py_INCREF(Py_None);
+    res = Py_None;
+    goto finally;
+
+fail:
+    PyErr_SetString(PyExc_RuntimeError, error_msg);
+
+finally:
+    PyMem_SetAllocator(domain, &hook.alloc);
+    return res;
+}
+
+static PyObject *
+test_pymem_setrawallocators(PyObject *self)
+{
+    return test_setallocators(PYMEM_DOMAIN_RAW);
+}
+
+static PyObject *
+test_pymem_setallocators(PyObject *self)
+{
+    return test_setallocators(PYMEM_DOMAIN_MEM);
+}
+
+static PyObject *
+test_pyobject_setallocators(PyObject *self)
+{
+    return test_setallocators(PYMEM_DOMAIN_OBJ);
+}
+
+PyDoc_STRVAR(docstring_empty,
+""
+);
+
+PyDoc_STRVAR(docstring_no_signature,
+"This docstring has no signature."
+);
+
+PyDoc_STRVAR(docstring_with_invalid_signature,
+"docstring_with_invalid_signature($module, /, boo)\n"
+"\n"
+"This docstring has an invalid signature."
+);
+
+PyDoc_STRVAR(docstring_with_invalid_signature2,
+"docstring_with_invalid_signature2($module, /, boo)\n"
+"\n"
+"--\n"
+"\n"
+"This docstring also has an invalid signature."
+);
+
+PyDoc_STRVAR(docstring_with_signature,
+"docstring_with_signature($module, /, sig)\n"
+"--\n"
+"\n"
+"This docstring has a valid signature."
+);
+
+PyDoc_STRVAR(docstring_with_signature_and_extra_newlines,
+"docstring_with_signature_and_extra_newlines($module, /, parameter)\n"
+"--\n"
+"\n"
+"\n"
+"This docstring has a valid signature and some extra newlines."
+);
+
+PyDoc_STRVAR(docstring_with_signature_with_defaults,
+"docstring_with_signature_with_defaults(module, s='avocado',\n"
+"        b=b'bytes', d=3.14, i=35, n=None, t=True, f=False,\n"
+"        local=the_number_three, sys=sys.maxsize,\n"
+"        exp=sys.maxsize - 1)\n"
+"--\n"
+"\n"
+"\n"
+"\n"
+"This docstring has a valid signature with parameters,\n"
+"and the parameters take defaults of varying types."
+);
+
 #ifdef WITH_THREAD
 typedef struct {
     PyThread_type_lock start_event;
@@ -2571,11 +3055,17 @@
     {"raise_exception",         raise_exception,                 METH_VARARGS},
     {"raise_memoryerror",   (PyCFunction)raise_memoryerror,  METH_NOARGS},
     {"test_config",             (PyCFunction)test_config,        METH_NOARGS},
+    {"test_sizeof_c_types",     (PyCFunction)test_sizeof_c_types, METH_NOARGS},
     {"test_datetime_capi",  test_datetime_capi,              METH_NOARGS},
     {"test_list_api",           (PyCFunction)test_list_api,      METH_NOARGS},
     {"test_dict_iteration",     (PyCFunction)test_dict_iteration,METH_NOARGS},
     {"test_lazy_hash_inheritance",      (PyCFunction)test_lazy_hash_inheritance,METH_NOARGS},
     {"test_long_api",           (PyCFunction)test_long_api,      METH_NOARGS},
+    {"test_xincref_doesnt_leak",(PyCFunction)test_xincref_doesnt_leak,      METH_NOARGS},
+    {"test_incref_doesnt_leak", (PyCFunction)test_incref_doesnt_leak,      METH_NOARGS},
+    {"test_xdecref_doesnt_leak",(PyCFunction)test_xdecref_doesnt_leak,      METH_NOARGS},
+    {"test_decref_doesnt_leak", (PyCFunction)test_decref_doesnt_leak,      METH_NOARGS},
+    {"test_incref_decref_API",  (PyCFunction)test_incref_decref_API,       METH_NOARGS},
     {"test_long_and_overflow", (PyCFunction)test_long_and_overflow,
      METH_NOARGS},
     {"test_long_as_double",     (PyCFunction)test_long_as_double,METH_NOARGS},
@@ -2591,6 +3081,7 @@
     {"test_string_to_double", (PyCFunction)test_string_to_double, METH_NOARGS},
     {"test_unicode_compare_with_ascii", (PyCFunction)test_unicode_compare_with_ascii, METH_NOARGS},
     {"test_capsule", (PyCFunction)test_capsule, METH_NOARGS},
+    {"test_from_contiguous", (PyCFunction)test_from_contiguous, METH_NOARGS},
     {"getargs_tuple",           getargs_tuple,                   METH_VARARGS},
     {"getargs_keywords", (PyCFunction)getargs_keywords,
       METH_VARARGS|METH_KEYWORDS},
@@ -2663,6 +3154,38 @@
     {"pytime_object_to_time_t", test_pytime_object_to_time_t,  METH_VARARGS},
     {"pytime_object_to_timeval", test_pytime_object_to_timeval,  METH_VARARGS},
     {"pytime_object_to_timespec", test_pytime_object_to_timespec,  METH_VARARGS},
+    {"with_tp_del",             with_tp_del,                     METH_VARARGS},
+    {"test_pymem_alloc0",
+     (PyCFunction)test_pymem_alloc0, METH_NOARGS},
+    {"test_pymem_setrawallocators",
+     (PyCFunction)test_pymem_setrawallocators, METH_NOARGS},
+    {"test_pymem_setallocators",
+     (PyCFunction)test_pymem_setallocators, METH_NOARGS},
+    {"test_pyobject_setallocators",
+     (PyCFunction)test_pyobject_setallocators, METH_NOARGS},
+    {"no_docstring",
+        (PyCFunction)test_with_docstring, METH_NOARGS},
+    {"docstring_empty",
+        (PyCFunction)test_with_docstring, METH_NOARGS,
+        docstring_empty},
+    {"docstring_no_signature",
+        (PyCFunction)test_with_docstring, METH_NOARGS,
+        docstring_no_signature},
+    {"docstring_with_invalid_signature",
+        (PyCFunction)test_with_docstring, METH_NOARGS,
+        docstring_with_invalid_signature},
+    {"docstring_with_invalid_signature2",
+        (PyCFunction)test_with_docstring, METH_NOARGS,
+        docstring_with_invalid_signature2},
+    {"docstring_with_signature",
+        (PyCFunction)test_with_docstring, METH_NOARGS,
+        docstring_with_signature},
+    {"docstring_with_signature_and_extra_newlines",
+        (PyCFunction)test_with_docstring, METH_NOARGS,
+        docstring_with_signature_and_extra_newlines},
+    {"docstring_with_signature_with_defaults",
+        (PyCFunction)test_with_docstring, METH_NOARGS,
+        docstring_with_signature_with_defaults},
 #ifdef WITH_THREAD
     {"call_in_temporary_c_thread", call_in_temporary_c_thread, METH_O,
      PyDoc_STR("set_error_class(error_class) -> None")},
@@ -2881,6 +3404,8 @@
     Py_INCREF(&PyInstanceMethod_Type);
     PyModule_AddObject(m, "instancemethod", (PyObject *)&PyInstanceMethod_Type);
 
+    PyModule_AddIntConstant(m, "the_number_three", 3);
+
     TestError = PyErr_NewException("_testcapi.error", NULL, NULL);
     Py_INCREF(TestError);
     PyModule_AddObject(m, "error", TestError);
diff --git a/Modules/_testembed.c b/Modules/_testembed.c
index 51b439f..a21d251 100644
--- a/Modules/_testembed.c
+++ b/Modules/_testembed.c
@@ -1,7 +1,26 @@
 #include <Python.h>
 #include <stdio.h>
 
-void print_subinterp(void)
+/*********************************************************
+ * Embedded interpreter tests that need a custom exe
+ *
+ * Executed via 'EmbeddingTests' in Lib/test/test_capi.py
+ *********************************************************/
+
+static void _testembed_Py_Initialize(void)
+{
+    /* HACK: the "./" at front avoids a search along the PATH in
+       Modules/getpath.c */
+    Py_SetProgramName(L"./_testembed");
+    Py_Initialize();
+}
+
+
+/*****************************************************
+ * Test repeated initalisation and subinterpreters
+ *****************************************************/
+
+static void print_subinterp(void)
 {
     /* Just output some debug stuff */
     PyThreadState *ts = PyThreadState_Get();
@@ -14,7 +33,7 @@
     );
 }
 
-int main(int argc, char *argv[])
+static void test_repeated_init_and_subinterpreters(void)
 {
     PyThreadState *mainstate, *substate;
 #ifdef WITH_THREAD
@@ -24,10 +43,7 @@
 
     for (i=0; i<3; i++) {
         printf("--- Pass %d ---\n", i);
-        /* HACK: the "./" at front avoids a search along the PATH in
-           Modules/getpath.c */
-        Py_SetProgramName(L"./_testembed");
-        Py_Initialize();
+        _testembed_Py_Initialize();
         mainstate = PyThreadState_Get();
 
 #ifdef WITH_THREAD
@@ -54,5 +70,71 @@
         PyEval_RestoreThread(mainstate);
         Py_Finalize();
     }
+}
+
+/*****************************************************
+ * Test forcing a particular IO encoding
+ *****************************************************/
+
+static void check_stdio_details(const char *encoding, const char * errors)
+{
+    /* Output info for the test case to check */
+    if (encoding) {
+        printf("Expected encoding: %s\n", encoding);
+    } else {
+        printf("Expected encoding: default\n");
+    }
+    if (errors) {
+        printf("Expected errors: %s\n", errors);
+    } else {
+        printf("Expected errors: default\n");
+    }
+    fflush(stdout);
+    /* Force the given IO encoding */
+    Py_SetStandardStreamEncoding(encoding, errors);
+    _testembed_Py_Initialize();
+    PyRun_SimpleString(
+        "import sys;"
+        "print('stdin: {0.encoding}:{0.errors}'.format(sys.stdin));"
+        "print('stdout: {0.encoding}:{0.errors}'.format(sys.stdout));"
+        "print('stderr: {0.encoding}:{0.errors}'.format(sys.stderr));"
+        "sys.stdout.flush()"
+    );
+    Py_Finalize();
+}
+
+static void test_forced_io_encoding(void)
+{
+    /* Check various combinations */
+    printf("--- Use defaults ---\n");
+    check_stdio_details(NULL, NULL);
+    printf("--- Set errors only ---\n");
+    check_stdio_details(NULL, "surrogateescape");
+    printf("--- Set encoding only ---\n");
+    check_stdio_details("latin-1", NULL);
+    printf("--- Set encoding and errors ---\n");
+    check_stdio_details("latin-1", "surrogateescape");
+
+    /* Check calling after initialization fails */
+    Py_Initialize();
+
+    if (Py_SetStandardStreamEncoding(NULL, NULL) == 0) {
+        printf("Unexpected success calling Py_SetStandardStreamEncoding");
+    }
+    Py_Finalize();
+}
+
+/* Different embedding tests */
+int main(int argc, char *argv[])
+{
+
+    /* TODO: Check the argument string to allow for more test cases */
+    if (argc > 1) {
+        /* For now: assume "forced_io_encoding */
+        test_forced_io_encoding();
+    } else {
+        /* Run the original embedding test case by default */
+        test_repeated_init_and_subinterpreters();
+    }
     return 0;
 }
diff --git a/Modules/_testimportmultiple.c b/Modules/_testimportmultiple.c
new file mode 100644
index 0000000..1caeb66
--- /dev/null
+++ b/Modules/_testimportmultiple.c
@@ -0,0 +1,57 @@
+/*
+ * C extensions module to test importing multiple modules from one compiled
+ * file (issue16421). This file defines 3 modules (_testimportmodule,
+ * foo, bar), only the first one is called the same as the compiled file.
+ */
+#include<Python.h>
+
+static struct PyModuleDef _testimportmultiple = {
+    PyModuleDef_HEAD_INIT,
+    "_testimportmultiple",
+    "_testimportmultiple doc",
+    -1,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL
+};
+
+PyMODINIT_FUNC PyInit__testimportmultiple(void)
+{
+    return PyModule_Create(&_testimportmultiple);
+}
+
+static struct PyModuleDef _foomodule = {
+    PyModuleDef_HEAD_INIT,
+    "_testimportmultiple_foo",
+    "_testimportmultiple_foo doc",
+    -1,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL
+};
+
+PyMODINIT_FUNC PyInit__testimportmultiple_foo(void)
+{
+    return PyModule_Create(&_foomodule);
+}
+
+static struct PyModuleDef _barmodule = {
+    PyModuleDef_HEAD_INIT,
+    "_testimportmultiple_bar",
+    "_testimportmultiple_bar doc",
+    -1,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL
+};
+
+PyMODINIT_FUNC PyInit__testimportmultiple_bar(void){
+    return PyModule_Create(&_barmodule);
+}
+
diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c
index d1dc61d..9925b0e 100644
--- a/Modules/_threadmodule.c
+++ b/Modules/_threadmodule.c
@@ -17,6 +17,8 @@
 static long nb_threads = 0;
 static PyObject *str_dict;
 
+_Py_IDENTIFIER(stderr);
+
 /* Lock objects */
 
 typedef struct {
@@ -68,7 +70,7 @@
             Py_BEGIN_ALLOW_THREADS
             r = PyThread_acquire_lock_timed(lock, microseconds, 1);
             Py_END_ALLOW_THREADS
-        } 
+        }
 
         if (r == PY_LOCK_INTR) {
             /* Run signal handlers if we were interrupted.  Propagate
@@ -255,14 +257,17 @@
 static void
 rlock_dealloc(rlockobject *self)
 {
-    assert(self->rlock_lock);
     if (self->in_weakreflist != NULL)
         PyObject_ClearWeakRefs((PyObject *) self);
-    /* Unlock the lock so it's safe to free it */
-    if (self->rlock_count > 0)
-        PyThread_release_lock(self->rlock_lock);
+    /* self->rlock_lock can be NULL if PyThread_allocate_lock() failed
+       in rlock_new() */
+    if (self->rlock_lock != NULL) {
+        /* Unlock the lock so it's safe to free it */
+        if (self->rlock_count > 0)
+            PyThread_release_lock(self->rlock_lock);
 
-    PyThread_free_lock(self->rlock_lock);
+        PyThread_free_lock(self->rlock_lock);
+    }
     Py_TYPE(self)->tp_free(self);
 }
 
@@ -374,13 +379,13 @@
 to be available for other threads.");
 
 static PyObject *
-rlock_acquire_restore(rlockobject *self, PyObject *arg)
+rlock_acquire_restore(rlockobject *self, PyObject *args)
 {
     long owner;
     unsigned long count;
     int r = 1;
 
-    if (!PyArg_ParseTuple(arg, "kl:_acquire_restore", &count, &owner))
+    if (!PyArg_ParseTuple(args, "(kl):_acquire_restore", &count, &owner))
         return NULL;
 
     if (!PyThread_acquire_lock(self->rlock_lock, 0)) {
@@ -452,15 +457,16 @@
 
     self = (rlockobject *) type->tp_alloc(type, 0);
     if (self != NULL) {
-        self->rlock_lock = PyThread_allocate_lock();
-        if (self->rlock_lock == NULL) {
-            type->tp_free(self);
-            PyErr_SetString(ThreadError, "can't allocate lock");
-            return NULL;
-        }
         self->in_weakreflist = NULL;
         self->rlock_owner = 0;
         self->rlock_count = 0;
+
+        self->rlock_lock = PyThread_allocate_lock();
+        if (self->rlock_lock == NULL) {
+            Py_DECREF(self);
+            PyErr_SetString(ThreadError, "can't allocate lock");
+            return NULL;
+        }
     }
 
     return (PyObject *) self;
@@ -482,7 +488,7 @@
     {"_is_owned",     (PyCFunction)rlock_is_owned,
      METH_NOARGS, rlock_is_owned_doc},
     {"_acquire_restore", (PyCFunction)rlock_acquire_restore,
-     METH_O, rlock_acquire_restore_doc},
+     METH_VARARGS, rlock_acquire_restore_doc},
     {"_release_save", (PyCFunction)rlock_release_save,
      METH_NOARGS, rlock_release_save_doc},
     {"__enter__",    (PyCFunction)rlock_acquire,
@@ -741,7 +747,7 @@
     wr = PyWeakref_NewRef((PyObject *) self, NULL);
     if (wr == NULL)
         goto err;
-    self->wr_callback = PyCFunction_New(&wr_callback_def, wr);
+    self->wr_callback = PyCFunction_NewEx(&wr_callback_def, wr, NULL);
     Py_DECREF(wr);
     if (self->wr_callback == NULL)
         goto err;
@@ -1001,7 +1007,7 @@
             PySys_WriteStderr(
                 "Unhandled exception in thread started by ");
             PyErr_Fetch(&exc, &value, &tb);
-            file = PySys_GetObject("stderr");
+            file = _PySys_GetObjectId(&PyId_stderr);
             if (file != NULL && file != Py_None)
                 PyFile_WriteObject(boot->func, file, 0);
             else
@@ -1172,6 +1178,66 @@
 This function is meant for internal and specialized purposes only.\n\
 In most applications `threading.enumerate()` should be used instead.");
 
+static void
+release_sentinel(void *wr)
+{
+    /* Tricky: this function is called when the current thread state
+       is being deleted.  Therefore, only simple C code can safely
+       execute here. */
+    PyObject *obj = PyWeakref_GET_OBJECT(wr);
+    lockobject *lock;
+    if (obj != Py_None) {
+        assert(Py_TYPE(obj) == &Locktype);
+        lock = (lockobject *) obj;
+        if (lock->locked) {
+            PyThread_release_lock(lock->lock_lock);
+            lock->locked = 0;
+        }
+    }
+    /* Deallocating a weakref with a NULL callback only calls
+       PyObject_GC_Del(), which can't call any Python code. */
+    Py_DECREF(wr);
+}
+
+static PyObject *
+thread__set_sentinel(PyObject *self)
+{
+    PyObject *wr;
+    PyThreadState *tstate = PyThreadState_Get();
+    lockobject *lock;
+
+    if (tstate->on_delete_data != NULL) {
+        /* We must support the re-creation of the lock from a
+           fork()ed child. */
+        assert(tstate->on_delete == &release_sentinel);
+        wr = (PyObject *) tstate->on_delete_data;
+        tstate->on_delete = NULL;
+        tstate->on_delete_data = NULL;
+        Py_DECREF(wr);
+    }
+    lock = newlockobject();
+    if (lock == NULL)
+        return NULL;
+    /* The lock is owned by whoever called _set_sentinel(), but the weakref
+       hangs to the thread state. */
+    wr = PyWeakref_NewRef((PyObject *) lock, NULL);
+    if (wr == NULL) {
+        Py_DECREF(lock);
+        return NULL;
+    }
+    tstate->on_delete_data = (void *) wr;
+    tstate->on_delete = &release_sentinel;
+    return (PyObject *) lock;
+}
+
+PyDoc_STRVAR(_set_sentinel_doc,
+"_set_sentinel() -> lock\n\
+\n\
+Set a sentinel lock that will be released when the current thread\n\
+state is finalized (after it is untied from the interpreter).\n\
+\n\
+This is a private API for the threading module.");
+
 static PyObject *
 thread_stack_size(PyObject *self, PyObject *args)
 {
@@ -1247,6 +1313,8 @@
      METH_NOARGS, _count_doc},
     {"stack_size",              (PyCFunction)thread_stack_size,
      METH_VARARGS, stack_size_doc},
+    {"_set_sentinel",           (PyCFunction)thread__set_sentinel,
+     METH_NOARGS, _set_sentinel_doc},
     {NULL,                      NULL}           /* sentinel */
 };
 
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
index 262d679..6d777d3 100644
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -114,52 +114,60 @@
 
 /* The threading situation is complicated.  Tcl is not thread-safe, except
    when configured with --enable-threads.
-   So we need to use a lock around all uses of Tcl.  Previously, the Python
-   interpreter lock was used for this.  However, this causes problems when
-   other Python threads need to run while Tcl is blocked waiting for events.
 
-   To solve this problem, a separate lock for Tcl is introduced.  Holding it
-   is incompatible with holding Python's interpreter lock.  The following four
-   macros manipulate both locks together.
+   So we need to use a lock around all uses of Tcl.  Previously, the
+   Python interpreter lock was used for this.  However, this causes
+   problems when other Python threads need to run while Tcl is blocked
+   waiting for events.
 
-   ENTER_TCL and LEAVE_TCL are brackets, just like Py_BEGIN_ALLOW_THREADS and
-   Py_END_ALLOW_THREADS.  They should be used whenever a call into Tcl is made
-   that could call an event handler, or otherwise affect the state of a Tcl
-   interpreter.  These assume that the surrounding code has the Python
-   interpreter lock; inside the brackets, the Python interpreter lock has been
-   released and the lock for Tcl has been acquired.
+   To solve this problem, a separate lock for Tcl is introduced.
+   Holding it is incompatible with holding Python's interpreter lock.
+   The following four macros manipulate both locks together.
 
-   Sometimes, it is necessary to have both the Python lock and the Tcl lock.
-   (For example, when transferring data from the Tcl interpreter result to a
-   Python string object.)  This can be done by using different macros to close
-   the ENTER_TCL block: ENTER_OVERLAP reacquires the Python lock (and restores
-   the thread state) but doesn't release the Tcl lock; LEAVE_OVERLAP_TCL
-   releases the Tcl lock.
+   ENTER_TCL and LEAVE_TCL are brackets, just like
+   Py_BEGIN_ALLOW_THREADS and Py_END_ALLOW_THREADS.  They should be
+   used whenever a call into Tcl is made that could call an event
+   handler, or otherwise affect the state of a Tcl interpreter.  These
+   assume that the surrounding code has the Python interpreter lock;
+   inside the brackets, the Python interpreter lock has been released
+   and the lock for Tcl has been acquired.
+
+   Sometimes, it is necessary to have both the Python lock and the Tcl
+   lock.  (For example, when transferring data from the Tcl
+   interpreter result to a Python string object.)  This can be done by
+   using different macros to close the ENTER_TCL block: ENTER_OVERLAP
+   reacquires the Python lock (and restores the thread state) but
+   doesn't release the Tcl lock; LEAVE_OVERLAP_TCL releases the Tcl
+   lock.
 
    By contrast, ENTER_PYTHON and LEAVE_PYTHON are used in Tcl event
-   handlers when the handler needs to use Python.  Such event handlers are
-   entered while the lock for Tcl is held; the event handler presumably needs
-   to use Python.  ENTER_PYTHON releases the lock for Tcl and acquires
-   the Python interpreter lock, restoring the appropriate thread state, and
-   LEAVE_PYTHON releases the Python interpreter lock and re-acquires the lock
-   for Tcl.  It is okay for ENTER_TCL/LEAVE_TCL pairs to be contained inside
-   the code between ENTER_PYTHON and LEAVE_PYTHON.
+   handlers when the handler needs to use Python.  Such event handlers
+   are entered while the lock for Tcl is held; the event handler
+   presumably needs to use Python.  ENTER_PYTHON releases the lock for
+   Tcl and acquires the Python interpreter lock, restoring the
+   appropriate thread state, and LEAVE_PYTHON releases the Python
+   interpreter lock and re-acquires the lock for Tcl.  It is okay for
+   ENTER_TCL/LEAVE_TCL pairs to be contained inside the code between
+   ENTER_PYTHON and LEAVE_PYTHON.
 
-   These locks expand to several statements and brackets; they should not be
-   used in branches of if statements and the like.
+   These locks expand to several statements and brackets; they should
+   not be used in branches of if statements and the like.
 
-   If Tcl is threaded, this approach won't work anymore. The Tcl interpreter is
-   only valid in the thread that created it, and all Tk activity must happen in this
-   thread, also. That means that the mainloop must be invoked in the thread that
-   created the interpreter. Invoking commands from other threads is possible;
-   _tkinter will queue an event for the interpreter thread, which will then
-   execute the command and pass back the result. If the main thread is not in the
-   mainloop, and invoking commands causes an exception; if the main loop is running
-   but not processing events, the command invocation will block.
+   If Tcl is threaded, this approach won't work anymore. The Tcl
+   interpreter is only valid in the thread that created it, and all Tk
+   activity must happen in this thread, also. That means that the
+   mainloop must be invoked in the thread that created the
+   interpreter. Invoking commands from other threads is possible;
+   _tkinter will queue an event for the interpreter thread, which will
+   then execute the command and pass back the result. If the main
+   thread is not in the mainloop, and invoking commands causes an
+   exception; if the main loop is running but not processing events,
+   the command invocation will block.
 
-   In addition, for a threaded Tcl, a single global tcl_tstate won't be sufficient
-   anymore, since multiple Tcl interpreters may simultaneously dispatch in different
-   threads. So we use the Tcl TLS API.
+   In addition, for a threaded Tcl, a single global tcl_tstate won't
+   be sufficient anymore, since multiple Tcl interpreters may
+   simultaneously dispatch in different threads. So we use the Tcl TLS
+   API.
 
 */
 
@@ -168,7 +176,8 @@
 #ifdef TCL_THREADS
 static Tcl_ThreadDataKey state_key;
 typedef PyThreadState *ThreadSpecificData;
-#define tcl_tstate (*(PyThreadState**)Tcl_GetThreadData(&state_key, sizeof(PyThreadState*)))
+#define tcl_tstate \
+    (*(PyThreadState**)Tcl_GetThreadData(&state_key, sizeof(PyThreadState*)))
 #else
 static PyThreadState *tcl_tstate = NULL;
 #endif
@@ -178,7 +187,8 @@
         if(tcl_lock)PyThread_acquire_lock(tcl_lock, 1); tcl_tstate = tstate;
 
 #define LEAVE_TCL \
-    tcl_tstate = NULL; if(tcl_lock)PyThread_release_lock(tcl_lock); Py_END_ALLOW_THREADS}
+    tcl_tstate = NULL; \
+    if(tcl_lock)PyThread_release_lock(tcl_lock); Py_END_ALLOW_THREADS}
 
 #define ENTER_OVERLAP \
     Py_END_ALLOW_THREADS
@@ -188,7 +198,8 @@
 
 #define ENTER_PYTHON \
     { PyThreadState *tstate = tcl_tstate; tcl_tstate = NULL; \
-        if(tcl_lock)PyThread_release_lock(tcl_lock); PyEval_RestoreThread((tstate)); }
+        if(tcl_lock) \
+          PyThread_release_lock(tcl_lock); PyEval_RestoreThread((tstate)); }
 
 #define LEAVE_PYTHON \
     { PyThreadState *tstate = PyEval_SaveThread(); \
@@ -197,7 +208,8 @@
 #define CHECK_TCL_APPARTMENT \
     if (((TkappObject *)self)->threaded && \
         ((TkappObject *)self)->thread_id != Tcl_GetCurrentThread()) { \
-        PyErr_SetString(PyExc_RuntimeError, "Calling Tcl from different appartment"); \
+        PyErr_SetString(PyExc_RuntimeError, \
+                        "Calling Tcl from different appartment"); \
         return 0; \
     }
 
@@ -219,7 +231,7 @@
 
 /**** Tkapp Object Declaration ****/
 
-static PyTypeObject Tkapp_Type;
+static PyObject *Tkapp_Type;
 
 typedef struct {
     PyObject_HEAD
@@ -239,7 +251,6 @@
     Tcl_ObjType *StringType;
 } TkappObject;
 
-#define Tkapp_Check(v) (Py_TYPE(v) == &Tkapp_Type)
 #define Tkapp_Interp(v) (((TkappObject *) (v))->interp)
 #define Tkapp_Result(v) Tcl_GetStringResult(Tkapp_Interp(v))
 
@@ -312,110 +323,9 @@
 #endif /* WITH_THREAD */
 
 
-static char *
-AsString(PyObject *value, PyObject *tmp)
-{
-    if (PyBytes_Check(value))
-        return PyBytes_AsString(value);
-    else if (PyUnicode_Check(value))
-        return PyUnicode_AsUTF8(value);
-    else {
-        PyObject *v = PyObject_Str(value);
-        if (v == NULL)
-            return NULL;
-        if (PyList_Append(tmp, v) != 0) {
-            Py_DECREF(v);
-            return NULL;
-        }
-        Py_DECREF(v);
-        return PyUnicode_AsUTF8(v);
-    }
-}
-
-
 
 #define ARGSZ 64
 
-static char *
-Merge(PyObject *args)
-{
-    PyObject *tmp = NULL;
-    char *argvStore[ARGSZ];
-    char **argv = NULL;
-    int fvStore[ARGSZ];
-    int *fv = NULL;
-    Py_ssize_t argc = 0, fvc = 0, i;
-    char *res = NULL;
-
-    if (!(tmp = PyList_New(0)))
-        return NULL;
-
-    argv = argvStore;
-    fv = fvStore;
-
-    if (args == NULL)
-        argc = 0;
-
-    else if (!PyTuple_Check(args)) {
-        argc = 1;
-        fv[0] = 0;
-        if (!(argv[0] = AsString(args, tmp)))
-            goto finally;
-    }
-    else {
-        argc = PyTuple_Size(args);
-
-        if (argc > ARGSZ) {
-            if (!CHECK_SIZE(argc, sizeof(char *))) {
-                PyErr_SetString(PyExc_OverflowError, "tuple is too long");
-                goto finally;
-            }
-            argv = (char **)ckalloc((size_t)argc * sizeof(char *));
-            fv = (int *)ckalloc((size_t)argc * sizeof(int));
-            if (argv == NULL || fv == NULL) {
-                PyErr_NoMemory();
-                goto finally;
-            }
-        }
-
-        for (i = 0; i < argc; i++) {
-            PyObject *v = PyTuple_GetItem(args, i);
-            if (PyTuple_Check(v)) {
-                fv[i] = 1;
-                if (!(argv[i] = Merge(v)))
-                    goto finally;
-                fvc++;
-            }
-            else if (v == Py_None) {
-                argc = i;
-                break;
-            }
-            else {
-                fv[i] = 0;
-                if (!(argv[i] = AsString(v, tmp)))
-                    goto finally;
-                fvc++;
-            }
-        }
-    }
-    res = Tcl_Merge(argc, argv);
-    if (res == NULL)
-        PyErr_SetString(Tkinter_TclError, "merge failed");
-
-  finally:
-    for (i = 0; i < fvc; i++)
-        if (fv[i]) {
-            ckfree(argv[i]);
-        }
-    if (argv != argvStore)
-        ckfree(FREECAST argv);
-    if (fv != fvStore)
-        ckfree(FREECAST fv);
-
-    Py_DECREF(tmp);
-    return res;
-}
-
 
 
 static PyObject *
@@ -429,8 +339,10 @@
             const char *e = s + size;
             PyErr_Clear();
             q = buf = (char *)PyMem_Malloc(size);
-            if (buf == NULL)
+            if (buf == NULL) {
+                PyErr_NoMemory();
                 return NULL;
+            }
             while (s != e) {
                 if (s + 1 != e && s[0] == '\xc0' && s[1] == '\x80') {
                     *q++ = '\0';
@@ -471,8 +383,7 @@
     PyObject *v;
 
     if (list == NULL) {
-        Py_INCREF(Py_None);
-        return Py_None;
+        Py_RETURN_NONE;
     }
 
     if (Tcl_SplitList((Tcl_Interp *)NULL, list, &argc, &argv) != TCL_OK) {
@@ -504,9 +415,9 @@
     return v;
 }
 
-/* In some cases, Tcl will still return strings that are supposed to be
-   lists. SplitObj walks through a nested tuple, finding string objects that
-   need to be split. */
+/* In some cases, Tcl will still return strings that are supposed to
+   be lists. SplitObj walks through a nested tuple, finding string
+   objects that need to be split. */
 
 static PyObject *
 SplitObj(PyObject *arg)
@@ -638,9 +549,10 @@
     TkappObject *v;
     char *argv0;
 
-    v = PyObject_New(TkappObject, &Tkapp_Type);
+    v = PyObject_New(TkappObject, (PyTypeObject *) Tkapp_Type);
     if (v == NULL)
         return NULL;
+    Py_INCREF(Tkapp_Type);
 
     v->interp = Tcl_CreateInterp();
     v->wantobjects = wantobjects;
@@ -651,7 +563,8 @@
 
 #ifndef TCL_THREADS
     if (v->threaded) {
-        PyErr_SetString(PyExc_RuntimeError, "Tcl is threaded but _tkinter is not");
+        PyErr_SetString(PyExc_RuntimeError,
+                        "Tcl is threaded but _tkinter is not");
         Py_DECREF(v);
         return 0;
     }
@@ -685,7 +598,7 @@
         Tcl_SetVar(v->interp, "tcl_interactive", "0", TCL_GLOBAL_ONLY);
 
     /* This is used to get the application class for Tk 4.1 and up */
-    argv0 = (char*)ckalloc(strlen(className) + 1);
+    argv0 = (char*)attemptckalloc(strlen(className) + 1);
     if (!argv0) {
         PyErr_NoMemory();
         Py_DECREF(v);
@@ -719,7 +632,7 @@
         if (use)
             len += strlen(use) + sizeof "-use ";
 
-        args = (char*)ckalloc(len);
+        args = (char*)attemptckalloc(len);
         if (!args) {
             PyErr_NoMemory();
             Py_DECREF(v);
@@ -788,16 +701,17 @@
     PyObject *string; /* This cannot cause cycles. */
 } PyTclObject;
 
-static PyTypeObject PyTclObject_Type;
-#define PyTclObject_Check(v)    ((v)->ob_type == &PyTclObject_Type)
+static PyObject *PyTclObject_Type;
+#define PyTclObject_Check(v) ((v)->ob_type == (PyTypeObject *) PyTclObject_Type)
 
 static PyObject *
 newPyTclObject(Tcl_Obj *arg)
 {
     PyTclObject *self;
-    self = PyObject_New(PyTclObject, &PyTclObject_Type);
+    self = PyObject_New(PyTclObject, (PyTypeObject *) PyTclObject_Type);
     if (self == NULL)
         return NULL;
+    Py_INCREF(PyTclObject_Type);
     Tcl_IncrRefCount(arg);
     self->value = arg;
     self->string = NULL;
@@ -807,9 +721,11 @@
 static void
 PyTclObject_dealloc(PyTclObject *self)
 {
+    PyObject *tp = (PyObject *) Py_TYPE(self);
     Tcl_DecrRefCount(self->value);
     Py_XDECREF(self->string);
     PyObject_Del(self);
+    Py_DECREF(tp);
 }
 
 static char*
@@ -848,8 +764,13 @@
 static PyObject *
 PyTclObject_repr(PyTclObject *self)
 {
-    return PyUnicode_FromFormat("<%s object at %p>",
-                                self->value->typePtr->name, self->value);
+    PyObject *repr, *str = PyTclObject_str(self, NULL);
+    if (str == NULL)
+        return NULL;
+    repr = PyUnicode_FromFormat("<%s object: %R>",
+                                self->value->typePtr->name, str);
+    Py_DECREF(str);
+    return repr;
 }
 
 #define TEST_COND(cond) ((cond) ? Py_True : Py_False)
@@ -923,50 +844,35 @@
     {0},
 };
 
-static PyTypeObject PyTclObject_Type = {
-    PyVarObject_HEAD_INIT(NULL, 0)
-    "_tkinter.Tcl_Obj",                 /*tp_name*/
-    sizeof(PyTclObject),                /*tp_basicsize*/
-    0,                                  /*tp_itemsize*/
-    /* methods */
-    (destructor)PyTclObject_dealloc,/*tp_dealloc*/
-    0,                                  /*tp_print*/
-    0,                                  /*tp_getattr*/
-    0,                                  /*tp_setattr*/
-    0,                                  /*tp_reserved*/
-    (reprfunc)PyTclObject_repr,         /*tp_repr*/
-    0,                                  /*tp_as_number*/
-    0,                                  /*tp_as_sequence*/
-    0,                                  /*tp_as_mapping*/
-    0,                                  /*tp_hash*/
-    0,                                  /*tp_call*/
-    (reprfunc)PyTclObject_str,          /*tp_str*/
-    PyObject_GenericGetAttr,            /*tp_getattro*/
-    0,                                  /*tp_setattro*/
-    0,                                  /*tp_as_buffer*/
-    Py_TPFLAGS_DEFAULT,                 /*tp_flags*/
-    0,                                  /*tp_doc*/
-    0,                                  /*tp_traverse*/
-    0,                                  /*tp_clear*/
-    PyTclObject_richcompare,            /*tp_richcompare*/
-    0,                                  /*tp_weaklistoffset*/
-    0,                                  /*tp_iter*/
-    0,                                  /*tp_iternext*/
-    0,                                  /*tp_methods*/
-    0,                                  /*tp_members*/
-    PyTclObject_getsetlist,             /*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*/
+static PyType_Slot PyTclObject_Type_slots[] = {
+    {Py_tp_dealloc, (destructor)PyTclObject_dealloc},
+    {Py_tp_repr, (reprfunc)PyTclObject_repr},
+    {Py_tp_str, (reprfunc)PyTclObject_str},
+    {Py_tp_getattro, PyObject_GenericGetAttr},
+    {Py_tp_richcompare, PyTclObject_richcompare},
+    {Py_tp_getset, PyTclObject_getsetlist},
+    {0, 0}
 };
 
+static PyType_Spec PyTclObject_Type_spec = {
+    "_tkinter.Tcl_Obj",
+    sizeof(PyTclObject),
+    0,
+    Py_TPFLAGS_DEFAULT,
+    PyTclObject_Type_slots,
+};
+
+
+#if PY_SIZE_MAX > INT_MAX
+#define CHECK_STRING_LENGTH(s) do {                                     \
+        if (s != NULL && strlen(s) >= INT_MAX) {                        \
+            PyErr_SetString(PyExc_OverflowError, "string is too long"); \
+            return NULL;                                                \
+        } } while(0)
+#else
+#define CHECK_STRING_LENGTH(s)
+#endif
+
 static Tcl_Obj*
 AsObj(PyObject *value)
 {
@@ -975,8 +881,8 @@
     int overflow;
 
     if (PyBytes_Check(value))
-        return Tcl_NewStringObj(PyBytes_AS_STRING(value),
-                                PyBytes_GET_SIZE(value));
+        return Tcl_NewByteArrayObj((unsigned char *)PyBytes_AS_STRING(value),
+                                   PyBytes_GET_SIZE(value));
     else if (PyBool_Check(value))
         return Tcl_NewBooleanObj(PyObject_IsTrue(value));
     else if (PyLong_CheckExact(value) &&
@@ -993,11 +899,13 @@
         Py_ssize_t size, i;
 
         size = PyTuple_Size(value);
+        if (size == 0)
+            return Tcl_NewListObj(0, NULL);
         if (!CHECK_SIZE(size, sizeof(Tcl_Obj *))) {
             PyErr_SetString(PyExc_OverflowError, "tuple is too long");
             return NULL;
         }
-        argv = (Tcl_Obj **) ckalloc(((size_t)size) * sizeof(Tcl_Obj *));
+        argv = (Tcl_Obj **) attemptckalloc(((size_t)size) * sizeof(Tcl_Obj *));
         if(!argv)
           return 0;
         for (i = 0; i < size; i++)
@@ -1019,6 +927,8 @@
 
         inbuf = PyUnicode_DATA(value);
         size = PyUnicode_GET_LENGTH(value);
+        if (size == 0)
+            return Tcl_NewUnicodeObj((const void *)"", 0);
         if (!CHECK_SIZE(size, sizeof(Tcl_UniChar))) {
             PyErr_SetString(PyExc_OverflowError, "string is too long");
             return NULL;
@@ -1027,7 +937,7 @@
         if (kind == sizeof(Tcl_UniChar))
             return Tcl_NewUnicodeObj(inbuf, size);
         allocsize = ((size_t)size) * sizeof(Tcl_UniChar);
-        outbuf = (Tcl_UniChar*)ckalloc(allocsize);
+        outbuf = (Tcl_UniChar*)attemptckalloc(allocsize);
         /* Else overflow occurred, and we take the next exit */
         if (!outbuf) {
             PyErr_NoMemory();
@@ -1192,7 +1102,7 @@
                 PyErr_SetString(PyExc_OverflowError, "tuple is too long");
                 return NULL;
             }
-            objv = (Tcl_Obj **)ckalloc(((size_t)objc) * sizeof(Tcl_Obj *));
+            objv = (Tcl_Obj **)attemptckalloc(((size_t)objc) * sizeof(Tcl_Obj *));
             if (objv == NULL) {
                 PyErr_NoMemory();
                 objc = 0;
@@ -1328,7 +1238,11 @@
         PyObject *exc_type, *exc_value, *exc_tb;
         if (!WaitForMainloop(self))
             return NULL;
-        ev = (Tkapp_CallEvent*)ckalloc(sizeof(Tkapp_CallEvent));
+        ev = (Tkapp_CallEvent*)attemptckalloc(sizeof(Tkapp_CallEvent));
+        if (ev == NULL) {
+            PyErr_NoMemory();
+            return NULL;
+        }
         ev->ev.proc = (Tcl_EventProc*)Tkapp_CallProc;
         ev->self = self;
         ev->args = args;
@@ -1376,42 +1290,6 @@
 
 
 static PyObject *
-Tkapp_GlobalCall(PyObject *self, PyObject *args)
-{
-    /* Could do the same here as for Tkapp_Call(), but this is not used
-       much, so I can't be bothered.  Unfortunately Tcl doesn't export a
-       way for the user to do what all its Global* variants do (save and
-       reset the scope pointer, call the local version, restore the saved
-       scope pointer). */
-
-    char *cmd;
-    PyObject *res = NULL;
-
-    if (PyErr_WarnEx(PyExc_DeprecationWarning,
-                     "globalcall is deprecated and will be removed in 3.4",
-                     1) < 0)
-        return 0;
-
-    CHECK_TCL_APPARTMENT;
-
-    cmd  = Merge(args);
-    if (cmd) {
-        int err;
-        ENTER_TCL
-        err = Tcl_GlobalEval(Tkapp_Interp(self), cmd);
-        ENTER_OVERLAP
-        if (err == TCL_ERROR)
-            res = Tkinter_Error(self);
-        else
-            res = PyUnicode_FromString(Tkapp_Result(self));
-        LEAVE_OVERLAP_TCL
-        ckfree(cmd);
-    }
-
-    return res;
-}
-
-static PyObject *
 Tkapp_Eval(PyObject *self, PyObject *args)
 {
     char *script;
@@ -1421,6 +1299,7 @@
     if (!PyArg_ParseTuple(args, "s:eval", &script))
         return NULL;
 
+    CHECK_STRING_LENGTH(script);
     CHECK_TCL_APPARTMENT;
 
     ENTER_TCL
@@ -1435,34 +1314,6 @@
 }
 
 static PyObject *
-Tkapp_GlobalEval(PyObject *self, PyObject *args)
-{
-    char *script;
-    PyObject *res = NULL;
-    int err;
-
-    if (PyErr_WarnEx(PyExc_DeprecationWarning,
-                     "globaleval is deprecated and will be removed in 3.4",
-                     1) < 0)
-        return 0;
-
-    if (!PyArg_ParseTuple(args, "s:globaleval", &script))
-        return NULL;
-
-    CHECK_TCL_APPARTMENT;
-
-    ENTER_TCL
-    err = Tcl_GlobalEval(Tkapp_Interp(self), script);
-    ENTER_OVERLAP
-    if (err == TCL_ERROR)
-        res = Tkinter_Error(self);
-    else
-        res = PyUnicode_FromString(Tkapp_Result(self));
-    LEAVE_OVERLAP_TCL
-    return res;
-}
-
-static PyObject *
 Tkapp_EvalFile(PyObject *self, PyObject *args)
 {
     char *fileName;
@@ -1472,6 +1323,7 @@
     if (!PyArg_ParseTuple(args, "s:evalfile", &fileName))
         return NULL;
 
+    CHECK_STRING_LENGTH(fileName);
     CHECK_TCL_APPARTMENT;
 
     ENTER_TCL
@@ -1492,9 +1344,10 @@
     PyObject *res = NULL;
     int err;
 
-    if (!PyArg_ParseTuple(args, "s", &script))
+    if (!PyArg_ParseTuple(args, "s:record", &script))
         return NULL;
 
+    CHECK_STRING_LENGTH(script);
     CHECK_TCL_APPARTMENT;
 
     ENTER_TCL
@@ -1515,14 +1368,14 @@
 
     if (!PyArg_ParseTuple(args, "s:adderrorinfo", &msg))
         return NULL;
+    CHECK_STRING_LENGTH(msg);
     CHECK_TCL_APPARTMENT;
 
     ENTER_TCL
     Tcl_AddErrorInfo(Tkapp_Interp(self), msg);
     LEAVE_TCL
 
-    Py_INCREF(Py_None);
-    return Py_None;
+    Py_RETURN_NONE;
 }
 
 
@@ -1640,8 +1493,11 @@
         if (!WaitForMainloop(self))
             return NULL;
 
-        ev = (VarEvent*)ckalloc(sizeof(VarEvent));
-
+        ev = (VarEvent*)attemptckalloc(sizeof(VarEvent));
+        if (ev == NULL) {
+            PyErr_NoMemory();
+            return NULL;
+        }
         ev->self = selfptr;
         ev->args = args;
         ev->flags = flags;
@@ -1699,6 +1555,8 @@
         if (!PyArg_ParseTuple(args, "ssO:setvar",
                               &name1, &name2, &newValue))
             return NULL;
+        CHECK_STRING_LENGTH(name1);
+        CHECK_STRING_LENGTH(name2);
         /* XXX must hold tcl lock already??? */
         newval = AsObj(newValue);
         ENTER_TCL
@@ -1744,11 +1602,13 @@
                           varname_converter, &name1, &name2))
         return NULL;
 
+    CHECK_STRING_LENGTH(name2);
     ENTER_TCL
     tres = Tcl_GetVar2Ex(Tkapp_Interp(self), name1, name2, flags);
     ENTER_OVERLAP
     if (tres == NULL) {
-        PyErr_SetString(Tkinter_TclError, Tcl_GetStringResult(Tkapp_Interp(self)));
+        PyErr_SetString(Tkinter_TclError,
+                        Tcl_GetStringResult(Tkapp_Interp(self)));
     } else {
         if (((TkappObject*)self)->wantobjects) {
             res = FromObj(self, tres);
@@ -1785,6 +1645,8 @@
     if (!PyArg_ParseTuple(args, "s|s:unsetvar", &name1, &name2))
         return NULL;
 
+    CHECK_STRING_LENGTH(name1);
+    CHECK_STRING_LENGTH(name2);
     ENTER_TCL
     code = Tcl_UnsetVar2(Tkapp_Interp(self), name1, name2, flags);
     ENTER_OVERLAP
@@ -1807,7 +1669,8 @@
 static PyObject *
 Tkapp_GlobalUnsetVar(PyObject *self, PyObject *args)
 {
-    return var_invoke(UnsetVar, self, args, TCL_LEAVE_ERR_MSG | TCL_GLOBAL_ONLY);
+    return var_invoke(UnsetVar, self, args,
+                      TCL_LEAVE_ERR_MSG | TCL_GLOBAL_ONLY);
 }
 
 
@@ -1829,6 +1692,7 @@
     }
     if (!PyArg_ParseTuple(args, "s:getint", &s))
         return NULL;
+    CHECK_STRING_LENGTH(s);
     if (Tcl_GetInt(Tkapp_Interp(self), s, &v) == TCL_ERROR)
         return Tkinter_Error(self);
     return Py_BuildValue("i", v);
@@ -1849,6 +1713,7 @@
     }
     if (!PyArg_ParseTuple(args, "s:getdouble", &s))
         return NULL;
+    CHECK_STRING_LENGTH(s);
     if (Tcl_GetDouble(Tkapp_Interp(self), s, &v) == TCL_ERROR)
         return Tkinter_Error(self);
     return Py_BuildValue("d", v);
@@ -1869,6 +1734,7 @@
     }
     if (!PyArg_ParseTuple(args, "s:getboolean", &s))
         return NULL;
+    CHECK_STRING_LENGTH(s);
     if (Tcl_GetBoolean(Tkapp_Interp(self), s, &v) == TCL_ERROR)
         return Tkinter_Error(self);
     return PyBool_FromLong(v);
@@ -1884,6 +1750,7 @@
     if (!PyArg_ParseTuple(args, "s:exprstring", &s))
         return NULL;
 
+    CHECK_STRING_LENGTH(s);
     CHECK_TCL_APPARTMENT;
 
     ENTER_TCL
@@ -1908,6 +1775,7 @@
     if (!PyArg_ParseTuple(args, "s:exprlong", &s))
         return NULL;
 
+    CHECK_STRING_LENGTH(s);
     CHECK_TCL_APPARTMENT;
 
     ENTER_TCL
@@ -1931,6 +1799,7 @@
 
     if (!PyArg_ParseTuple(args, "s:exprdouble", &s))
         return NULL;
+    CHECK_STRING_LENGTH(s);
     CHECK_TCL_APPARTMENT;
     PyFPE_START_PROTECT("Tkapp_ExprDouble", return 0)
     ENTER_TCL
@@ -1955,6 +1824,7 @@
 
     if (!PyArg_ParseTuple(args, "s:exprboolean", &s))
         return NULL;
+    CHECK_STRING_LENGTH(s);
     CHECK_TCL_APPARTMENT;
     ENTER_TCL
     retval = Tcl_ExprBoolean(Tkapp_Interp(self), s, &v);
@@ -2007,6 +1877,7 @@
     if (!PyArg_ParseTuple(args, "et:splitlist", "utf-8", &list))
         return NULL;
 
+    CHECK_STRING_LENGTH(list);
     if (Tcl_SplitList(Tkapp_Interp(self), list,
                       &argc, &argv) == TCL_ERROR)  {
         PyMem_Free(list);
@@ -2068,32 +1939,12 @@
 
     if (!PyArg_ParseTuple(args, "et:split", "utf-8", &list))
         return NULL;
+    CHECK_STRING_LENGTH(list);
     v = Split(list);
     PyMem_Free(list);
     return v;
 }
 
-static PyObject *
-Tkapp_Merge(PyObject *self, PyObject *args)
-{
-    char *s;
-    PyObject *res = NULL;
-
-    if (PyErr_WarnEx(PyExc_DeprecationWarning,
-                     "merge is deprecated and will be removed in 3.4",
-                     1) < 0)
-        return 0;
-
-    s = Merge(args);
-
-    if (s) {
-        res = PyUnicode_FromString(s);
-        ckfree(s);
-    }
-
-    return res;
-}
-
 
 
 /** Tcl Command **/
@@ -2220,6 +2071,7 @@
 
     if (!PyArg_ParseTuple(args, "sO:createcommand", &cmdName, &func))
         return NULL;
+    CHECK_STRING_LENGTH(cmdName);
     if (!PyCallable_Check(func)) {
         PyErr_SetString(PyExc_TypeError, "command not callable");
         return NULL;
@@ -2241,7 +2093,12 @@
 #ifdef WITH_THREAD
     if (self->threaded && self->thread_id != Tcl_GetCurrentThread()) {
         Tcl_Condition cond = NULL;
-        CommandEvent *ev = (CommandEvent*)ckalloc(sizeof(CommandEvent));
+        CommandEvent *ev = (CommandEvent*)attemptckalloc(sizeof(CommandEvent));
+        if (ev == NULL) {
+            PyErr_NoMemory();
+            PyMem_DEL(data);
+            return NULL;
+        }
         ev->ev.proc = (Tcl_EventProc*)Tkapp_CommandProc;
         ev->interp = self->interp;
         ev->create = 1;
@@ -2267,8 +2124,7 @@
         return NULL;
     }
 
-    Py_INCREF(Py_None);
-    return Py_None;
+    Py_RETURN_NONE;
 }
 
 
@@ -2282,12 +2138,17 @@
 
     if (!PyArg_ParseTuple(args, "s:deletecommand", &cmdName))
         return NULL;
+    CHECK_STRING_LENGTH(cmdName);
 
 #ifdef WITH_THREAD
     if (self->threaded && self->thread_id != Tcl_GetCurrentThread()) {
         Tcl_Condition cond = NULL;
         CommandEvent *ev;
-        ev = (CommandEvent*)ckalloc(sizeof(CommandEvent));
+        ev = (CommandEvent*)attemptckalloc(sizeof(CommandEvent));
+        if (ev == NULL) {
+            PyErr_NoMemory();
+            return NULL;
+        }
         ev->ev.proc = (Tcl_EventProc*)Tkapp_CommandProc;
         ev->interp = self->interp;
         ev->create = 0;
@@ -2309,8 +2170,7 @@
         PyErr_SetString(Tkinter_TclError, "can't delete Tcl command");
         return NULL;
     }
-    Py_INCREF(Py_None);
-    return Py_None;
+    Py_RETURN_NONE;
 }
 
 
@@ -2414,8 +2274,7 @@
     ENTER_TCL
     Tcl_CreateFileHandler(tfile, mask, FileHandler, (ClientData) data);
     LEAVE_TCL
-    Py_INCREF(Py_None);
-    return Py_None;
+    Py_RETURN_NONE;
 }
 
 static PyObject *
@@ -2439,15 +2298,14 @@
     ENTER_TCL
     Tcl_DeleteFileHandler(tfile);
     LEAVE_TCL
-    Py_INCREF(Py_None);
-    return Py_None;
+    Py_RETURN_NONE;
 }
 #endif /* HAVE_CREATEFILEHANDLER */
 
 
 /**** Tktt Object (timer token) ****/
 
-static PyTypeObject Tktt_Type;
+static PyObject *Tktt_Type;
 
 typedef struct {
     PyObject_HEAD
@@ -2472,8 +2330,7 @@
         Py_DECREF(func);
         Py_DECREF(v); /* See Tktt_New() */
     }
-    Py_INCREF(Py_None);
-    return Py_None;
+    Py_RETURN_NONE;
 }
 
 static PyMethodDef Tktt_methods[] =
@@ -2487,9 +2344,10 @@
 {
     TkttObject *v;
 
-    v = PyObject_New(TkttObject, &Tktt_Type);
+    v = PyObject_New(TkttObject, (PyTypeObject *) Tktt_Type);
     if (v == NULL)
         return NULL;
+    Py_INCREF(Tktt_Type);
 
     Py_INCREF(func);
     v->token = NULL;
@@ -2505,10 +2363,12 @@
 {
     TkttObject *v = (TkttObject *)self;
     PyObject *func = v->func;
+    PyObject *tp = (PyObject *) Py_TYPE(self);
 
     Py_XDECREF(func);
 
     PyObject_Del(self);
+    Py_DECREF(tp);
 }
 
 static PyObject *
@@ -2520,38 +2380,20 @@
                                 v->func == NULL ? ", handler deleted" : "");
 }
 
-static PyTypeObject Tktt_Type =
-{
-    PyVarObject_HEAD_INIT(NULL, 0)
-    "tktimertoken",                          /*tp_name */
-    sizeof(TkttObject),                      /*tp_basicsize */
-    0,                                       /*tp_itemsize */
-    Tktt_Dealloc,                            /*tp_dealloc */
-    0,                                       /*tp_print */
-    0,                                       /*tp_getattr */
-    0,                                       /*tp_setattr */
-    0,                                       /*tp_reserved */
-    Tktt_Repr,                               /*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_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*/
-    Tktt_methods,                            /*tp_methods*/
+static PyType_Slot Tktt_Type_slots[] = {
+    {Py_tp_dealloc, Tktt_Dealloc},
+    {Py_tp_repr, Tktt_Repr},
+    {Py_tp_methods, Tktt_methods},
+    {0, 0}
 };
 
+static PyType_Spec Tktt_Type_spec = {
+    "tktimertoken",
+    sizeof(TkttObject),
+    0,
+    Py_TPFLAGS_DEFAULT,
+    Tktt_Type_slots,
+};
 
 
 /** Timer Handler **/
@@ -2673,8 +2515,7 @@
         excInCmd = valInCmd = trbInCmd = NULL;
         return NULL;
     }
-    Py_INCREF(Py_None);
-    return Py_None;
+    Py_RETURN_NONE;
 }
 
 static PyObject *
@@ -2700,8 +2541,7 @@
         return NULL;
 
     quitMainLoop = 1;
-    Py_INCREF(Py_None);
-    return Py_None;
+    Py_RETURN_NONE;
 }
 
 static PyObject *
@@ -2751,15 +2591,15 @@
     }
     if (_tk_exists == NULL || strcmp(_tk_exists, "1") != 0)     {
         if (Tk_Init(interp)             == TCL_ERROR) {
-            PyErr_SetString(Tkinter_TclError, Tcl_GetStringResult(Tkapp_Interp(self)));
+            PyErr_SetString(Tkinter_TclError,
+                            Tcl_GetStringResult(Tkapp_Interp(self)));
 #ifdef TKINTER_PROTECT_LOADTK
             tk_load_failed = 1;
 #endif
             return NULL;
         }
     }
-    Py_INCREF(Py_None);
-    return Py_None;
+    Py_RETURN_NONE;
 }
 
 static PyObject *
@@ -2773,8 +2613,7 @@
         return PyBool_FromLong(((TkappObject*)self)->wantobjects);
     ((TkappObject*)self)->wantobjects = wantobjects;
 
-    Py_INCREF(Py_None);
-    return Py_None;
+    Py_RETURN_NONE;
 }
 
 static PyObject *
@@ -2783,8 +2622,7 @@
 
     ((TkappObject*)self)->dispatching = 1;
 
-    Py_INCREF(Py_None);
-    return Py_None;
+    Py_RETURN_NONE;
 }
 
 
@@ -2795,9 +2633,7 @@
     {"willdispatch",       Tkapp_WillDispatch, METH_NOARGS},
     {"wantobjects",            Tkapp_WantObjects, METH_VARARGS},
     {"call",                   Tkapp_Call, METH_VARARGS},
-    {"globalcall",             Tkapp_GlobalCall, METH_VARARGS},
     {"eval",                   Tkapp_Eval, METH_VARARGS},
-    {"globaleval",             Tkapp_GlobalEval, METH_VARARGS},
     {"evalfile",               Tkapp_EvalFile, METH_VARARGS},
     {"record",                 Tkapp_Record, METH_VARARGS},
     {"adderrorinfo",       Tkapp_AddErrorInfo, METH_VARARGS},
@@ -2816,7 +2652,6 @@
     {"exprboolean",        Tkapp_ExprBoolean, METH_VARARGS},
     {"splitlist",              Tkapp_SplitList, METH_VARARGS},
     {"split",                  Tkapp_Split, METH_VARARGS},
-    {"merge",                  Tkapp_Merge, METH_VARARGS},
     {"createcommand",      Tkapp_CreateCommand, METH_VARARGS},
     {"deletecommand",      Tkapp_DeleteCommand, METH_VARARGS},
 #ifdef HAVE_CREATEFILEHANDLER
@@ -2839,44 +2674,29 @@
 static void
 Tkapp_Dealloc(PyObject *self)
 {
+    PyObject *tp = (PyObject *) Py_TYPE(self);
     /*CHECK_TCL_APPARTMENT;*/
     ENTER_TCL
     Tcl_DeleteInterp(Tkapp_Interp(self));
     LEAVE_TCL
     PyObject_Del(self);
+    Py_DECREF(tp);
     DisableEventHook();
 }
 
-static PyTypeObject Tkapp_Type =
-{
-    PyVarObject_HEAD_INIT(NULL, 0)
-    "tkapp",                                 /*tp_name */
-    sizeof(TkappObject),                     /*tp_basicsize */
-    0,                                       /*tp_itemsize */
-    Tkapp_Dealloc,                           /*tp_dealloc */
-    0,                                       /*tp_print */
-    0,                                       /*tp_getattr */
-    0,                                       /*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_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*/
-    Tkapp_methods,                           /*tp_methods*/
+static PyType_Slot Tkapp_Type_slots[] = {
+    {Py_tp_dealloc, Tkapp_Dealloc},
+    {Py_tp_methods, Tkapp_methods},
+    {0, 0}
+};
+
+
+static PyType_Spec Tkapp_Type_spec = {
+    "tkapp",
+    sizeof(TkappObject),
+    0,
+    Py_TPFLAGS_DEFAULT,
+    Tkapp_Type_slots,
 };
 
 
@@ -3014,9 +2834,13 @@
                           &interactive, &wantobjects, &wantTk,
                           &sync, &use))
         return NULL;
+    CHECK_STRING_LENGTH(screenName);
+    CHECK_STRING_LENGTH(baseName);
+    CHECK_STRING_LENGTH(className);
+    CHECK_STRING_LENGTH(use);
 
     return (PyObject *) Tkapp_New(screenName, className,
-                                  interactive, wantobjects,     wantTk,
+                                  interactive, wantobjects, wantTk,
                                   sync, use);
 }
 
@@ -3032,8 +2856,7 @@
         return NULL;
     }
     Tkinter_busywaitinterval = new_val;
-    Py_INCREF(Py_None);
-    return Py_None;
+    Py_RETURN_NONE;
 }
 
 static char setbusywaitinterval_doc[] =
@@ -3166,27 +2989,6 @@
 }
 
 
-/* all errors will be checked in one fell swoop in init_tkinter() */
-static void
-ins_long(PyObject *d, char *name, long val)
-{
-    PyObject *v = PyLong_FromLong(val);
-    if (v) {
-        PyDict_SetItemString(d, name, v);
-        Py_DECREF(v);
-    }
-}
-static void
-ins_string(PyObject *d, char *name, char *val)
-{
-    PyObject *v = PyUnicode_FromString(val);
-    if (v) {
-        PyDict_SetItemString(d, name, v);
-        Py_DECREF(v);
-    }
-}
-
-
 static struct PyModuleDef _tkintermodule = {
     PyModuleDef_HEAD_INIT,
     "_tkinter",
@@ -3202,45 +3004,111 @@
 PyMODINIT_FUNC
 PyInit__tkinter(void)
 {
-    PyObject *m, *d, *uexe, *cexe;
-
-    if (PyType_Ready(&Tkapp_Type) < 0)
-        return NULL;
+  PyObject *m, *uexe, *cexe, *o;
 
 #ifdef WITH_THREAD
     tcl_lock = PyThread_allocate_lock();
+    if (tcl_lock == NULL)
+        return NULL;
 #endif
 
     m = PyModule_Create(&_tkintermodule);
     if (m == NULL)
         return NULL;
 
-    d = PyModule_GetDict(m);
-    Tkinter_TclError = PyErr_NewException("_tkinter.TclError", NULL, NULL);
-    PyDict_SetItemString(d, "TclError", Tkinter_TclError);
-
-    ins_long(d, "READABLE", TCL_READABLE);
-    ins_long(d, "WRITABLE", TCL_WRITABLE);
-    ins_long(d, "EXCEPTION", TCL_EXCEPTION);
-    ins_long(d, "WINDOW_EVENTS", TCL_WINDOW_EVENTS);
-    ins_long(d, "FILE_EVENTS", TCL_FILE_EVENTS);
-    ins_long(d, "TIMER_EVENTS", TCL_TIMER_EVENTS);
-    ins_long(d, "IDLE_EVENTS", TCL_IDLE_EVENTS);
-    ins_long(d, "ALL_EVENTS", TCL_ALL_EVENTS);
-    ins_long(d, "DONT_WAIT", TCL_DONT_WAIT);
-    ins_string(d, "TK_VERSION", TK_VERSION);
-    ins_string(d, "TCL_VERSION", TCL_VERSION);
-
-    PyDict_SetItemString(d, "TkappType", (PyObject *)&Tkapp_Type);
-
-    if (PyType_Ready(&Tktt_Type) < 0) {
+    o = PyErr_NewException("_tkinter.TclError", NULL, NULL);
+    if (o == NULL) {
         Py_DECREF(m);
         return NULL;
     }
-    PyDict_SetItemString(d, "TkttType", (PyObject *)&Tktt_Type);
+    Py_INCREF(o);
+    if (PyModule_AddObject(m, "TclError", o)) {
+        Py_DECREF(o);
+        Py_DECREF(m);
+        return NULL;
+    }
+    Tkinter_TclError = o;
 
-    Py_TYPE(&PyTclObject_Type) = &PyType_Type;
-    PyDict_SetItemString(d, "Tcl_Obj", (PyObject *)&PyTclObject_Type);
+    if (PyModule_AddIntConstant(m, "READABLE", TCL_READABLE)) {
+        Py_DECREF(m);
+        return NULL;
+    }
+    if (PyModule_AddIntConstant(m, "WRITABLE", TCL_WRITABLE)) {
+        Py_DECREF(m);
+        return NULL;
+    }
+    if (PyModule_AddIntConstant(m, "EXCEPTION", TCL_EXCEPTION)) {
+        Py_DECREF(m);
+        return NULL;
+    }
+    if (PyModule_AddIntConstant(m, "WINDOW_EVENTS", TCL_WINDOW_EVENTS)) {
+        Py_DECREF(m);
+        return NULL;
+    }
+    if (PyModule_AddIntConstant(m, "FILE_EVENTS", TCL_FILE_EVENTS)) {
+        Py_DECREF(m);
+        return NULL;
+    }
+    if (PyModule_AddIntConstant(m, "TIMER_EVENTS", TCL_TIMER_EVENTS)) {
+        Py_DECREF(m);
+        return NULL;
+    }
+    if (PyModule_AddIntConstant(m, "IDLE_EVENTS", TCL_IDLE_EVENTS)) {
+        Py_DECREF(m);
+        return NULL;
+    }
+    if (PyModule_AddIntConstant(m, "ALL_EVENTS", TCL_ALL_EVENTS)) {
+        Py_DECREF(m);
+        return NULL;
+    }
+    if (PyModule_AddIntConstant(m, "DONT_WAIT", TCL_DONT_WAIT)) {
+        Py_DECREF(m);
+        return NULL;
+    }
+    if (PyModule_AddStringConstant(m, "TK_VERSION", TK_VERSION)) {
+        Py_DECREF(m);
+        return NULL;
+    }
+    if (PyModule_AddStringConstant(m, "TCL_VERSION", TCL_VERSION)) {
+        Py_DECREF(m);
+        return NULL;
+    }
+
+    o = PyType_FromSpec(&Tkapp_Type_spec);
+    if (o == NULL) {
+        Py_DECREF(m);
+        return NULL;
+    }
+    if (PyModule_AddObject(m, "TkappType", o)) {
+        Py_DECREF(o);
+        Py_DECREF(m);
+        return NULL;
+    }
+    Tkapp_Type = o;
+
+    o = PyType_FromSpec(&Tktt_Type_spec);
+    if (o == NULL) {
+        Py_DECREF(m);
+        return NULL;
+    }
+    if (PyModule_AddObject(m, "TkttType", o)) {
+        Py_DECREF(o);
+        Py_DECREF(m);
+        return NULL;
+    }
+    Tktt_Type = o;
+
+    o = PyType_FromSpec(&PyTclObject_Type_spec);
+    if (o == NULL) {
+        Py_DECREF(m);
+        return NULL;
+    }
+    if (PyModule_AddObject(m, "Tcl_Obj", o)) {
+        Py_DECREF(o);
+        Py_DECREF(m);
+        return NULL;
+    }
+    PyTclObject_Type = o;
 
 #ifdef TK_AQUA
     /* Tk_MacOSXSetupTkNotifier must be called before Tcl's subsystems
diff --git a/Modules/_tracemalloc.c b/Modules/_tracemalloc.c
new file mode 100644
index 0000000..bbe7259
--- /dev/null
+++ b/Modules/_tracemalloc.c
@@ -0,0 +1,1429 @@
+#include "Python.h"
+#include "hashtable.h"
+#include "frameobject.h"
+#include "pythread.h"
+#include "osdefs.h"
+
+/* Trace memory blocks allocated by PyMem_RawMalloc() */
+#define TRACE_RAW_MALLOC
+
+/* Forward declaration */
+static void tracemalloc_stop(void);
+static void* raw_malloc(size_t size);
+static void raw_free(void *ptr);
+
+#ifdef Py_DEBUG
+#  define TRACE_DEBUG
+#endif
+
+#define _STR(VAL) #VAL
+#define STR(VAL) _STR(VAL)
+
+/* Protected by the GIL */
+static struct {
+    PyMemAllocator mem;
+    PyMemAllocator raw;
+    PyMemAllocator obj;
+} allocators;
+
+static struct {
+    /* Module initialized?
+       Variable protected by the GIL */
+    enum {
+        TRACEMALLOC_NOT_INITIALIZED,
+        TRACEMALLOC_INITIALIZED,
+        TRACEMALLOC_FINALIZED
+    } initialized;
+
+    /* Is tracemalloc tracing memory allocations?
+       Variable protected by the GIL */
+    int tracing;
+
+    /* limit of the number of frames in a traceback, 1 by default.
+       Variable protected by the GIL. */
+    int max_nframe;
+} tracemalloc_config = {TRACEMALLOC_NOT_INITIALIZED, 0, 1};
+
+#if defined(TRACE_RAW_MALLOC) && defined(WITH_THREAD)
+/* This lock is needed because tracemalloc_free() is called without
+   the GIL held from PyMem_RawFree(). It cannot acquire the lock because it
+   would introduce a deadlock in PyThreadState_DeleteCurrent(). */
+static PyThread_type_lock tables_lock;
+#  define TABLES_LOCK() PyThread_acquire_lock(tables_lock, 1)
+#  define TABLES_UNLOCK() PyThread_release_lock(tables_lock)
+#else
+   /* variables are protected by the GIL */
+#  define TABLES_LOCK()
+#  define TABLES_UNLOCK()
+#endif
+
+/* Pack the frame_t structure to reduce the memory footprint on 64-bit
+   architectures: 12 bytes instead of 16. This optimization might produce
+   SIGBUS on architectures not supporting unaligned memory accesses (64-bit
+   IPS CPU?): on such architecture, the structure must not be packed. */
+typedef struct
+#ifdef __GNUC__
+__attribute__((packed))
+#elif defined(_MSC_VER)
+_declspec(align(4))
+#endif
+{
+    PyObject *filename;
+    int lineno;
+} frame_t;
+
+typedef struct {
+    Py_uhash_t hash;
+    int nframe;
+    frame_t frames[1];
+} traceback_t;
+
+#define TRACEBACK_SIZE(NFRAME) \
+        (sizeof(traceback_t) + sizeof(frame_t) * (NFRAME - 1))
+
+#define MAX_NFRAME \
+        ((INT_MAX - sizeof(traceback_t)) / sizeof(frame_t) + 1)
+
+static PyObject *unknown_filename = NULL;
+static traceback_t tracemalloc_empty_traceback;
+
+/* Trace of a memory block */
+typedef struct {
+    /* Size of the memory block in bytes */
+    size_t size;
+
+    /* Traceback where the memory block was allocated */
+    traceback_t *traceback;
+} trace_t;
+
+/* Size in bytes of currently traced memory.
+   Protected by TABLES_LOCK(). */
+static size_t tracemalloc_traced_memory = 0;
+
+/* Peak size in bytes of traced memory.
+   Protected by TABLES_LOCK(). */
+static size_t tracemalloc_peak_traced_memory = 0;
+
+/* Hash table used as a set to intern filenames:
+   PyObject* => PyObject*.
+   Protected by the GIL */
+static _Py_hashtable_t *tracemalloc_filenames = NULL;
+
+/* Buffer to store a new traceback in traceback_new().
+   Protected by the GIL. */
+static traceback_t *tracemalloc_traceback = NULL;
+
+/* Hash table used as a set to intern tracebacks:
+   traceback_t* => traceback_t*
+   Protected by the GIL */
+static _Py_hashtable_t *tracemalloc_tracebacks = NULL;
+
+/* pointer (void*) => trace (trace_t).
+   Protected by TABLES_LOCK(). */
+static _Py_hashtable_t *tracemalloc_traces = NULL;
+
+#ifdef TRACE_DEBUG
+static void
+tracemalloc_error(const char *format, ...)
+{
+    va_list ap;
+    fprintf(stderr, "tracemalloc: ");
+    va_start(ap, format);
+    vfprintf(stderr, format, ap);
+    va_end(ap);
+    fprintf(stderr, "\n");
+    fflush(stderr);
+}
+#endif
+
+#if defined(WITH_THREAD) && defined(TRACE_RAW_MALLOC)
+#define REENTRANT_THREADLOCAL
+
+/* If your OS does not provide native thread local storage, you can implement
+   it manually using a lock. Functions of thread.c cannot be used because
+   they use PyMem_RawMalloc() which leads to a reentrant call. */
+#if !(defined(_POSIX_THREADS) || defined(NT_THREADS))
+#  error "need native thread local storage (TLS)"
+#endif
+
+static int tracemalloc_reentrant_key;
+
+/* Any non-NULL pointer can be used */
+#define REENTRANT Py_True
+
+static int
+get_reentrant(void)
+{
+    void *ptr = PyThread_get_key_value(tracemalloc_reentrant_key);
+    if (ptr != NULL) {
+        assert(ptr == REENTRANT);
+        return 1;
+    }
+    else
+        return 0;
+}
+
+static void
+set_reentrant(int reentrant)
+{
+    assert(reentrant == 0 || reentrant == 1);
+    if (reentrant) {
+        assert(PyThread_get_key_value(tracemalloc_reentrant_key) == NULL);
+        PyThread_set_key_value(tracemalloc_reentrant_key, REENTRANT);
+    }
+    else {
+        assert(PyThread_get_key_value(tracemalloc_reentrant_key) == REENTRANT);
+        PyThread_set_key_value(tracemalloc_reentrant_key, NULL);
+    }
+}
+
+#else
+
+/* WITH_THREAD not defined: Python compiled without threads,
+   or TRACE_RAW_MALLOC not defined: variable protected by the GIL */
+static int tracemalloc_reentrant = 0;
+
+static int
+get_reentrant(void)
+{
+    return tracemalloc_reentrant;
+}
+
+static void
+set_reentrant(int reentrant)
+{
+    assert(!reentrant || !get_reentrant());
+    tracemalloc_reentrant = reentrant;
+}
+#endif
+
+static int
+hashtable_compare_unicode(const void *key, const _Py_hashtable_entry_t *entry)
+{
+    if (key != NULL && entry->key != NULL)
+        return (PyUnicode_Compare((PyObject *)key, (PyObject *)entry->key) == 0);
+    else
+        return key == entry->key;
+}
+
+static _Py_hashtable_allocator_t hashtable_alloc = {malloc, free};
+
+static _Py_hashtable_t *
+hashtable_new(size_t data_size,
+              _Py_hashtable_hash_func hash_func,
+              _Py_hashtable_compare_func compare_func)
+{
+    return _Py_hashtable_new_full(data_size, 0,
+                                  hash_func, compare_func,
+                                  NULL, NULL, NULL, &hashtable_alloc);
+}
+
+static void*
+raw_malloc(size_t size)
+{
+    return allocators.raw.malloc(allocators.raw.ctx, size);
+}
+
+static void
+raw_free(void *ptr)
+{
+    allocators.raw.free(allocators.raw.ctx, ptr);
+}
+
+static Py_uhash_t
+hashtable_hash_traceback(const void *key)
+{
+    const traceback_t *traceback = key;
+    return traceback->hash;
+}
+
+static int
+hashtable_compare_traceback(const traceback_t *traceback1,
+                            const _Py_hashtable_entry_t *he)
+{
+    const traceback_t *traceback2 = he->key;
+    const frame_t *frame1, *frame2;
+    int i;
+
+    if (traceback1->nframe != traceback2->nframe)
+        return 0;
+
+    for (i=0; i < traceback1->nframe; i++) {
+        frame1 = &traceback1->frames[i];
+        frame2 = &traceback2->frames[i];
+
+        if (frame1->lineno != frame2->lineno)
+            return 0;
+
+        if (frame1->filename != frame2->filename) {
+            assert(PyUnicode_Compare(frame1->filename, frame2->filename) != 0);
+            return 0;
+        }
+    }
+    return 1;
+}
+
+static void
+tracemalloc_get_frame(PyFrameObject *pyframe, frame_t *frame)
+{
+    PyCodeObject *code;
+    PyObject *filename;
+    _Py_hashtable_entry_t *entry;
+
+    frame->filename = unknown_filename;
+    frame->lineno = PyFrame_GetLineNumber(pyframe);
+    assert(frame->lineno >= 0);
+    if (frame->lineno < 0)
+        frame->lineno = 0;
+
+    code = pyframe->f_code;
+    if (code == NULL) {
+#ifdef TRACE_DEBUG
+        tracemalloc_error("failed to get the code object of the frame");
+#endif
+        return;
+    }
+
+    if (code->co_filename == NULL) {
+#ifdef TRACE_DEBUG
+        tracemalloc_error("failed to get the filename of the code object");
+#endif
+        return;
+    }
+
+    filename = code->co_filename;
+    assert(filename != NULL);
+    if (filename == NULL)
+        return;
+
+    if (!PyUnicode_Check(filename)) {
+#ifdef TRACE_DEBUG
+        tracemalloc_error("filename is not an unicode string");
+#endif
+        return;
+    }
+    if (!PyUnicode_IS_READY(filename)) {
+        /* Don't make a Unicode string ready to avoid reentrant calls
+           to tracemalloc_malloc() or tracemalloc_realloc() */
+#ifdef TRACE_DEBUG
+        tracemalloc_error("filename is not a ready unicode string");
+#endif
+        return;
+    }
+
+    /* intern the filename */
+    entry = _Py_hashtable_get_entry(tracemalloc_filenames, filename);
+    if (entry != NULL) {
+        filename = (PyObject *)entry->key;
+    }
+    else {
+        /* tracemalloc_filenames is responsible to keep a reference
+           to the filename */
+        Py_INCREF(filename);
+        if (_Py_hashtable_set(tracemalloc_filenames, filename, NULL, 0) < 0) {
+            Py_DECREF(filename);
+#ifdef TRACE_DEBUG
+            tracemalloc_error("failed to intern the filename");
+#endif
+            return;
+        }
+    }
+
+    /* the tracemalloc_filenames table keeps a reference to the filename */
+    frame->filename = filename;
+}
+
+static Py_uhash_t
+traceback_hash(traceback_t *traceback)
+{
+    /* code based on tuplehash() of Objects/tupleobject.c */
+    Py_uhash_t x, y;  /* Unsigned for defined overflow behavior. */
+    int len = traceback->nframe;
+    Py_uhash_t mult = _PyHASH_MULTIPLIER;
+    frame_t *frame;
+
+    x = 0x345678UL;
+    frame = traceback->frames;
+    while (--len >= 0) {
+        y = (Py_uhash_t)PyObject_Hash(frame->filename);
+        y ^= (Py_uhash_t)frame->lineno;
+        frame++;
+
+        x = (x ^ y) * mult;
+        /* the cast might truncate len; that doesn't change hash stability */
+        mult += (Py_uhash_t)(82520UL + len + len);
+    }
+    x += 97531UL;
+    return x;
+}
+
+static void
+traceback_get_frames(traceback_t *traceback)
+{
+    PyThreadState *tstate;
+    PyFrameObject *pyframe;
+
+#ifdef WITH_THREAD
+    tstate = PyGILState_GetThisThreadState();
+#else
+    tstate = PyThreadState_Get();
+#endif
+    if (tstate == NULL) {
+#ifdef TRACE_DEBUG
+        tracemalloc_error("failed to get the current thread state");
+#endif
+        return;
+    }
+
+    for (pyframe = tstate->frame; pyframe != NULL; pyframe = pyframe->f_back) {
+        tracemalloc_get_frame(pyframe, &traceback->frames[traceback->nframe]);
+        assert(traceback->frames[traceback->nframe].filename != NULL);
+        assert(traceback->frames[traceback->nframe].lineno >= 0);
+        traceback->nframe++;
+        if (traceback->nframe == tracemalloc_config.max_nframe)
+            break;
+    }
+}
+
+static traceback_t *
+traceback_new(void)
+{
+    traceback_t *traceback;
+    _Py_hashtable_entry_t *entry;
+
+#ifdef WITH_THREAD
+    assert(PyGILState_Check());
+#endif
+
+    /* get frames */
+    traceback = tracemalloc_traceback;
+    traceback->nframe = 0;
+    traceback_get_frames(traceback);
+    if (traceback->nframe == 0)
+        return &tracemalloc_empty_traceback;
+    traceback->hash = traceback_hash(traceback);
+
+    /* intern the traceback */
+    entry = _Py_hashtable_get_entry(tracemalloc_tracebacks, traceback);
+    if (entry != NULL) {
+        traceback = (traceback_t *)entry->key;
+    }
+    else {
+        traceback_t *copy;
+        size_t traceback_size;
+
+        traceback_size = TRACEBACK_SIZE(traceback->nframe);
+
+        copy = raw_malloc(traceback_size);
+        if (copy == NULL) {
+#ifdef TRACE_DEBUG
+            tracemalloc_error("failed to intern the traceback: malloc failed");
+#endif
+            return NULL;
+        }
+        memcpy(copy, traceback, traceback_size);
+
+        if (_Py_hashtable_set(tracemalloc_tracebacks, copy, NULL, 0) < 0) {
+            raw_free(copy);
+#ifdef TRACE_DEBUG
+            tracemalloc_error("failed to intern the traceback: putdata failed");
+#endif
+            return NULL;
+        }
+        traceback = copy;
+    }
+    return traceback;
+}
+
+static int
+tracemalloc_add_trace(void *ptr, size_t size)
+{
+    traceback_t *traceback;
+    trace_t trace;
+    int res;
+
+#ifdef WITH_THREAD
+    assert(PyGILState_Check());
+#endif
+
+    traceback = traceback_new();
+    if (traceback == NULL)
+        return -1;
+
+    trace.size = size;
+    trace.traceback = traceback;
+
+    res = _Py_HASHTABLE_SET(tracemalloc_traces, ptr, trace);
+    if (res == 0) {
+        assert(tracemalloc_traced_memory <= PY_SIZE_MAX - size);
+        tracemalloc_traced_memory += size;
+        if (tracemalloc_traced_memory > tracemalloc_peak_traced_memory)
+            tracemalloc_peak_traced_memory = tracemalloc_traced_memory;
+    }
+
+    return res;
+}
+
+static void
+tracemalloc_remove_trace(void *ptr)
+{
+    trace_t trace;
+
+    if (_Py_hashtable_pop(tracemalloc_traces, ptr, &trace, sizeof(trace))) {
+        assert(tracemalloc_traced_memory >= trace.size);
+        tracemalloc_traced_memory -= trace.size;
+    }
+}
+
+static void*
+tracemalloc_malloc(void *ctx, size_t size)
+{
+    PyMemAllocator *alloc = (PyMemAllocator *)ctx;
+    void *ptr;
+
+    ptr = alloc->malloc(alloc->ctx, size);
+    if (ptr == NULL)
+        return NULL;
+
+    TABLES_LOCK();
+    if (tracemalloc_add_trace(ptr, size) < 0) {
+        /* Failed to allocate a trace for the new memory block */
+        TABLES_UNLOCK();
+        alloc->free(alloc->ctx, ptr);
+        return NULL;
+    }
+    TABLES_UNLOCK();
+    return ptr;
+}
+
+static void*
+tracemalloc_realloc(void *ctx, void *ptr, size_t new_size)
+{
+    PyMemAllocator *alloc = (PyMemAllocator *)ctx;
+    void *ptr2;
+
+    ptr2 = alloc->realloc(alloc->ctx, ptr, new_size);
+    if (ptr2 == NULL)
+        return NULL;
+
+    if (ptr != NULL) {
+        /* an existing memory block has been resized */
+
+        TABLES_LOCK();
+        tracemalloc_remove_trace(ptr);
+
+        if (tracemalloc_add_trace(ptr2, new_size) < 0) {
+            /* Memory allocation failed. The error cannot be reported to
+               the caller, because realloc() may already have shrinked the
+               memory block and so removed bytes.
+
+               This case is very unlikely: an hash entry has just been
+               released, so the hash table should have at least one free entry.
+
+               The GIL and the table lock ensures that only one thread is
+               allocating memory. */
+            assert(0 && "should never happen");
+        }
+        TABLES_UNLOCK();
+    }
+    else {
+        /* new allocation */
+
+        TABLES_LOCK();
+        if (tracemalloc_add_trace(ptr2, new_size) < 0) {
+            /* Failed to allocate a trace for the new memory block */
+            TABLES_UNLOCK();
+            alloc->free(alloc->ctx, ptr2);
+            return NULL;
+        }
+        TABLES_UNLOCK();
+    }
+    return ptr2;
+}
+
+static void
+tracemalloc_free(void *ctx, void *ptr)
+{
+    PyMemAllocator *alloc = (PyMemAllocator *)ctx;
+
+    if (ptr == NULL)
+        return;
+
+     /* GIL cannot be locked in PyMem_RawFree() because it would introduce
+        a deadlock in PyThreadState_DeleteCurrent(). */
+
+    alloc->free(alloc->ctx, ptr);
+
+    TABLES_LOCK();
+    tracemalloc_remove_trace(ptr);
+    TABLES_UNLOCK();
+}
+
+static void*
+tracemalloc_malloc_gil(void *ctx, size_t size)
+{
+    void *ptr;
+
+    if (get_reentrant()) {
+        PyMemAllocator *alloc = (PyMemAllocator *)ctx;
+        return alloc->malloc(alloc->ctx, size);
+    }
+
+    /* Ignore reentrant call. PyObjet_Malloc() calls PyMem_Malloc() for
+       allocations larger than 512 bytes, don't trace the same memory
+       allocation twice. */
+    set_reentrant(1);
+
+    ptr = tracemalloc_malloc(ctx, size);
+
+    set_reentrant(0);
+    return ptr;
+}
+
+static void*
+tracemalloc_realloc_gil(void *ctx, void *ptr, size_t new_size)
+{
+    void *ptr2;
+
+    if (get_reentrant()) {
+        /* Reentrant call to PyMem_Realloc() and PyMem_RawRealloc().
+           Example: PyMem_RawRealloc() is called internally by pymalloc
+           (_PyObject_Malloc() and  _PyObject_Realloc()) to allocate a new
+           arena (new_arena()). */
+        PyMemAllocator *alloc = (PyMemAllocator *)ctx;
+
+        ptr2 = alloc->realloc(alloc->ctx, ptr, new_size);
+        if (ptr2 != NULL && ptr != NULL) {
+            TABLES_LOCK();
+            tracemalloc_remove_trace(ptr);
+            TABLES_UNLOCK();
+        }
+        return ptr2;
+    }
+
+    /* Ignore reentrant call. PyObjet_Realloc() calls PyMem_Realloc() for
+       allocations larger than 512 bytes. Don't trace the same memory
+       allocation twice. */
+    set_reentrant(1);
+
+    ptr2 = tracemalloc_realloc(ctx, ptr, new_size);
+
+    set_reentrant(0);
+    return ptr2;
+}
+
+#ifdef TRACE_RAW_MALLOC
+static void*
+tracemalloc_raw_malloc(void *ctx, size_t size)
+{
+#ifdef WITH_THREAD
+    PyGILState_STATE gil_state;
+#endif
+    void *ptr;
+
+    if (get_reentrant()) {
+        PyMemAllocator *alloc = (PyMemAllocator *)ctx;
+        return alloc->malloc(alloc->ctx, size);
+    }
+
+    /* Ignore reentrant call. PyGILState_Ensure() may call PyMem_RawMalloc()
+       indirectly which would call PyGILState_Ensure() if reentrant are not
+       disabled. */
+    set_reentrant(1);
+
+#ifdef WITH_THREAD
+    gil_state = PyGILState_Ensure();
+    ptr = tracemalloc_malloc(ctx, size);
+    PyGILState_Release(gil_state);
+#else
+    ptr = tracemalloc_malloc(ctx, size);
+#endif
+
+    set_reentrant(0);
+    return ptr;
+}
+
+static void*
+tracemalloc_raw_realloc(void *ctx, void *ptr, size_t new_size)
+{
+#ifdef WITH_THREAD
+    PyGILState_STATE gil_state;
+#endif
+    void *ptr2;
+
+    if (get_reentrant()) {
+        /* Reentrant call to PyMem_RawRealloc(). */
+        PyMemAllocator *alloc = (PyMemAllocator *)ctx;
+
+        ptr2 = alloc->realloc(alloc->ctx, ptr, new_size);
+
+        if (ptr2 != NULL && ptr != NULL) {
+            TABLES_LOCK();
+            tracemalloc_remove_trace(ptr);
+            TABLES_UNLOCK();
+        }
+        return ptr2;
+    }
+
+    /* Ignore reentrant call. PyGILState_Ensure() may call PyMem_RawMalloc()
+       indirectly which would call PyGILState_Ensure() if reentrant calls are
+       not disabled. */
+    set_reentrant(1);
+
+#ifdef WITH_THREAD
+    gil_state = PyGILState_Ensure();
+    ptr2 = tracemalloc_realloc(ctx, ptr, new_size);
+    PyGILState_Release(gil_state);
+#else
+    ptr2 = tracemalloc_realloc(ctx, ptr, new_size);
+#endif
+
+    set_reentrant(0);
+    return ptr2;
+}
+#endif   /* TRACE_RAW_MALLOC */
+
+static int
+tracemalloc_clear_filename(_Py_hashtable_entry_t *entry, void *user_data)
+{
+    PyObject *filename = (PyObject *)entry->key;
+    Py_DECREF(filename);
+    return 0;
+}
+
+static int
+traceback_free_traceback(_Py_hashtable_entry_t *entry, void *user_data)
+{
+    traceback_t *traceback = (traceback_t *)entry->key;
+    raw_free(traceback);
+    return 0;
+}
+
+/* reentrant flag must be set to call this function and GIL must be held */
+static void
+tracemalloc_clear_traces(void)
+{
+#ifdef WITH_THREAD
+    /* The GIL protects variables againt concurrent access */
+    assert(PyGILState_Check());
+#endif
+
+    /* Disable also reentrant calls to tracemalloc_malloc() to not add a new
+       trace while we are clearing traces */
+    assert(get_reentrant());
+
+    TABLES_LOCK();
+    _Py_hashtable_clear(tracemalloc_traces);
+    tracemalloc_traced_memory = 0;
+    tracemalloc_peak_traced_memory = 0;
+    TABLES_UNLOCK();
+
+    _Py_hashtable_foreach(tracemalloc_tracebacks, traceback_free_traceback, NULL);
+    _Py_hashtable_clear(tracemalloc_tracebacks);
+
+    _Py_hashtable_foreach(tracemalloc_filenames, tracemalloc_clear_filename, NULL);
+    _Py_hashtable_clear(tracemalloc_filenames);
+}
+
+static int
+tracemalloc_init(void)
+{
+    if (tracemalloc_config.initialized == TRACEMALLOC_FINALIZED) {
+        PyErr_SetString(PyExc_RuntimeError,
+                        "the tracemalloc module has been unloaded");
+        return -1;
+    }
+
+    if (tracemalloc_config.initialized == TRACEMALLOC_INITIALIZED)
+        return 0;
+
+    PyMem_GetAllocator(PYMEM_DOMAIN_RAW, &allocators.raw);
+
+#ifdef REENTRANT_THREADLOCAL
+    tracemalloc_reentrant_key = PyThread_create_key();
+    if (tracemalloc_reentrant_key == -1) {
+#ifdef MS_WINDOWS
+        PyErr_SetFromWindowsErr(0);
+#else
+        PyErr_SetFromErrno(PyExc_OSError);
+#endif
+        return -1;
+    }
+#endif
+
+#if defined(WITH_THREAD) && defined(TRACE_RAW_MALLOC)
+    if (tables_lock == NULL) {
+        tables_lock = PyThread_allocate_lock();
+        if (tables_lock == NULL) {
+            PyErr_SetString(PyExc_RuntimeError, "cannot allocate lock");
+            return -1;
+        }
+    }
+#endif
+
+    tracemalloc_filenames = hashtable_new(0,
+                                          (_Py_hashtable_hash_func)PyObject_Hash,
+                                          hashtable_compare_unicode);
+
+    tracemalloc_tracebacks = hashtable_new(0,
+                                           (_Py_hashtable_hash_func)hashtable_hash_traceback,
+                                           (_Py_hashtable_compare_func)hashtable_compare_traceback);
+
+    tracemalloc_traces = hashtable_new(sizeof(trace_t),
+                                       _Py_hashtable_hash_ptr,
+                                       _Py_hashtable_compare_direct);
+
+    if (tracemalloc_filenames == NULL || tracemalloc_tracebacks == NULL
+        || tracemalloc_traces == NULL)
+    {
+        PyErr_NoMemory();
+        return -1;
+    }
+
+    unknown_filename = PyUnicode_FromString("<unknown>");
+    if (unknown_filename == NULL)
+        return -1;
+    PyUnicode_InternInPlace(&unknown_filename);
+
+    tracemalloc_empty_traceback.nframe = 1;
+    /* borrowed reference */
+    tracemalloc_empty_traceback.frames[0].filename = unknown_filename;
+    tracemalloc_empty_traceback.frames[0].lineno = 0;
+    tracemalloc_empty_traceback.hash = traceback_hash(&tracemalloc_empty_traceback);
+
+    /* Disable tracing allocations until hooks are installed. Set
+       also the reentrant flag to detect bugs: fail with an assertion error
+       if set_reentrant(1) is called while tracing is disabled. */
+    set_reentrant(1);
+
+    tracemalloc_config.initialized = TRACEMALLOC_INITIALIZED;
+    return 0;
+}
+
+static void
+tracemalloc_deinit(void)
+{
+    if (tracemalloc_config.initialized != TRACEMALLOC_INITIALIZED)
+        return;
+    tracemalloc_config.initialized = TRACEMALLOC_FINALIZED;
+
+    tracemalloc_stop();
+
+    /* destroy hash tables */
+    _Py_hashtable_destroy(tracemalloc_traces);
+    _Py_hashtable_destroy(tracemalloc_tracebacks);
+    _Py_hashtable_destroy(tracemalloc_filenames);
+
+#if defined(WITH_THREAD) && defined(TRACE_RAW_MALLOC)
+    if (tables_lock != NULL) {
+        PyThread_free_lock(tables_lock);
+        tables_lock = NULL;
+    }
+#endif
+
+#ifdef REENTRANT_THREADLOCAL
+    PyThread_delete_key(tracemalloc_reentrant_key);
+#endif
+
+    Py_XDECREF(unknown_filename);
+}
+
+static int
+tracemalloc_start(int max_nframe)
+{
+    PyMemAllocator alloc;
+    size_t size;
+
+    if (tracemalloc_init() < 0)
+        return -1;
+
+    if (tracemalloc_config.tracing) {
+        /* hook already installed: do nothing */
+        return 0;
+    }
+
+    assert(1 <= max_nframe && max_nframe <= MAX_NFRAME);
+    tracemalloc_config.max_nframe = max_nframe;
+
+    /* allocate a buffer to store a new traceback */
+    size = TRACEBACK_SIZE(max_nframe);
+    assert(tracemalloc_traceback == NULL);
+    tracemalloc_traceback = raw_malloc(size);
+    if (tracemalloc_traceback == NULL) {
+        PyErr_NoMemory();
+        return -1;
+    }
+
+#ifdef TRACE_RAW_MALLOC
+    alloc.malloc = tracemalloc_raw_malloc;
+    alloc.realloc = tracemalloc_raw_realloc;
+    alloc.free = tracemalloc_free;
+
+    alloc.ctx = &allocators.raw;
+    PyMem_GetAllocator(PYMEM_DOMAIN_RAW, &allocators.raw);
+    PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &alloc);
+#endif
+
+    alloc.malloc = tracemalloc_malloc_gil;
+    alloc.realloc = tracemalloc_realloc_gil;
+    alloc.free = tracemalloc_free;
+
+    alloc.ctx = &allocators.mem;
+    PyMem_GetAllocator(PYMEM_DOMAIN_MEM, &allocators.mem);
+    PyMem_SetAllocator(PYMEM_DOMAIN_MEM, &alloc);
+
+    alloc.ctx = &allocators.obj;
+    PyMem_GetAllocator(PYMEM_DOMAIN_OBJ, &allocators.obj);
+    PyMem_SetAllocator(PYMEM_DOMAIN_OBJ, &alloc);
+
+    /* everything is ready: start tracing Python memory allocations */
+    tracemalloc_config.tracing = 1;
+    set_reentrant(0);
+
+    return 0;
+}
+
+static void
+tracemalloc_stop(void)
+{
+    if (!tracemalloc_config.tracing)
+        return;
+
+    /* stop tracing Python memory allocations */
+    tracemalloc_config.tracing = 0;
+
+    /* set the reentrant flag to detect bugs: fail with an assertion error if
+       set_reentrant(1) is called while tracing is disabled. */
+    set_reentrant(1);
+
+    /* unregister the hook on memory allocators */
+#ifdef TRACE_RAW_MALLOC
+    PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &allocators.raw);
+#endif
+    PyMem_SetAllocator(PYMEM_DOMAIN_MEM, &allocators.mem);
+    PyMem_SetAllocator(PYMEM_DOMAIN_OBJ, &allocators.obj);
+
+    /* release memory */
+    tracemalloc_clear_traces();
+    raw_free(tracemalloc_traceback);
+    tracemalloc_traceback = NULL;
+}
+
+static PyObject*
+lineno_as_obj(int lineno)
+{
+    if (lineno >= 0)
+        return PyLong_FromLong(lineno);
+    else
+        Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(tracemalloc_is_tracing_doc,
+    "is_tracing()->bool\n"
+    "\n"
+    "True if the tracemalloc module is tracing Python memory allocations,\n"
+    "False otherwise.");
+
+static PyObject*
+py_tracemalloc_is_tracing(PyObject *self)
+{
+    return PyBool_FromLong(tracemalloc_config.tracing);
+}
+
+PyDoc_STRVAR(tracemalloc_clear_traces_doc,
+    "clear_traces()\n"
+    "\n"
+    "Clear traces of memory blocks allocated by Python.");
+
+static PyObject*
+py_tracemalloc_clear_traces(PyObject *self)
+{
+    if (!tracemalloc_config.tracing)
+        Py_RETURN_NONE;
+
+    set_reentrant(1);
+    tracemalloc_clear_traces();
+    set_reentrant(0);
+
+    Py_RETURN_NONE;
+}
+
+static PyObject*
+frame_to_pyobject(frame_t *frame)
+{
+    PyObject *frame_obj, *lineno_obj;
+
+    frame_obj = PyTuple_New(2);
+    if (frame_obj == NULL)
+        return NULL;
+
+    if (frame->filename == NULL)
+        frame->filename = Py_None;
+    Py_INCREF(frame->filename);
+    PyTuple_SET_ITEM(frame_obj, 0, frame->filename);
+
+    assert(frame->lineno >= 0);
+    lineno_obj = lineno_as_obj(frame->lineno);
+    if (lineno_obj == NULL) {
+        Py_DECREF(frame_obj);
+        return NULL;
+    }
+    PyTuple_SET_ITEM(frame_obj, 1, lineno_obj);
+
+    return frame_obj;
+}
+
+static PyObject*
+traceback_to_pyobject(traceback_t *traceback, _Py_hashtable_t *intern_table)
+{
+    int i;
+    PyObject *frames, *frame;
+
+    if (intern_table != NULL) {
+        if (_Py_HASHTABLE_GET(intern_table, traceback, frames)) {
+            Py_INCREF(frames);
+            return frames;
+        }
+    }
+
+    frames = PyTuple_New(traceback->nframe);
+    if (frames == NULL)
+        return NULL;
+
+    for (i=0; i < traceback->nframe; i++) {
+        frame = frame_to_pyobject(&traceback->frames[i]);
+        if (frame == NULL) {
+            Py_DECREF(frames);
+            return NULL;
+        }
+        PyTuple_SET_ITEM(frames, i, frame);
+    }
+
+    if (intern_table != NULL) {
+        if (_Py_HASHTABLE_SET(intern_table, traceback, frames) < 0) {
+            Py_DECREF(frames);
+            PyErr_NoMemory();
+            return NULL;
+        }
+        /* intern_table keeps a new reference to frames */
+        Py_INCREF(frames);
+    }
+    return frames;
+}
+
+static PyObject*
+trace_to_pyobject(trace_t *trace, _Py_hashtable_t *intern_tracebacks)
+{
+    PyObject *trace_obj = NULL;
+    PyObject *size, *traceback;
+
+    trace_obj = PyTuple_New(2);
+    if (trace_obj == NULL)
+        return NULL;
+
+    size = PyLong_FromSize_t(trace->size);
+    if (size == NULL) {
+        Py_DECREF(trace_obj);
+        return NULL;
+    }
+    PyTuple_SET_ITEM(trace_obj, 0, size);
+
+    traceback = traceback_to_pyobject(trace->traceback, intern_tracebacks);
+    if (traceback == NULL) {
+        Py_DECREF(trace_obj);
+        return NULL;
+    }
+    PyTuple_SET_ITEM(trace_obj, 1, traceback);
+
+    return trace_obj;
+}
+
+typedef struct {
+    _Py_hashtable_t *traces;
+    _Py_hashtable_t *tracebacks;
+    PyObject *list;
+} get_traces_t;
+
+static int
+tracemalloc_get_traces_fill(_Py_hashtable_entry_t *entry, void *user_data)
+{
+    get_traces_t *get_traces = user_data;
+    trace_t *trace;
+    PyObject *tracemalloc_obj;
+    int res;
+
+    trace = (trace_t *)_Py_HASHTABLE_ENTRY_DATA(entry);
+
+    tracemalloc_obj = trace_to_pyobject(trace, get_traces->tracebacks);
+    if (tracemalloc_obj == NULL)
+        return 1;
+
+    res = PyList_Append(get_traces->list, tracemalloc_obj);
+    Py_DECREF(tracemalloc_obj);
+    if (res < 0)
+        return 1;
+
+    return 0;
+}
+
+static int
+tracemalloc_pyobject_decref_cb(_Py_hashtable_entry_t *entry, void *user_data)
+{
+    PyObject *obj = (PyObject *)_Py_HASHTABLE_ENTRY_DATA_AS_VOID_P(entry);
+    Py_DECREF(obj);
+    return 0;
+}
+
+PyDoc_STRVAR(tracemalloc_get_traces_doc,
+    "_get_traces() -> list\n"
+    "\n"
+    "Get traces of all memory blocks allocated by Python.\n"
+    "Return a list of (size: int, traceback: tuple) tuples.\n"
+    "traceback is a tuple of (filename: str, lineno: int) tuples.\n"
+    "\n"
+    "Return an empty list if the tracemalloc module is disabled.");
+
+static PyObject*
+py_tracemalloc_get_traces(PyObject *self, PyObject *obj)
+{
+    get_traces_t get_traces;
+    int err;
+
+    get_traces.traces = NULL;
+    get_traces.tracebacks = NULL;
+    get_traces.list = PyList_New(0);
+    if (get_traces.list == NULL)
+        goto error;
+
+    if (!tracemalloc_config.tracing)
+        return get_traces.list;
+
+    /* the traceback hash table is used temporarily to intern traceback tuple
+       of (filename, lineno) tuples */
+    get_traces.tracebacks = hashtable_new(sizeof(PyObject *),
+                                          _Py_hashtable_hash_ptr,
+                                          _Py_hashtable_compare_direct);
+    if (get_traces.tracebacks == NULL) {
+        PyErr_NoMemory();
+        goto error;
+    }
+
+    TABLES_LOCK();
+    get_traces.traces = _Py_hashtable_copy(tracemalloc_traces);
+    TABLES_UNLOCK();
+
+    if (get_traces.traces == NULL) {
+        PyErr_NoMemory();
+        goto error;
+    }
+
+    set_reentrant(1);
+    err = _Py_hashtable_foreach(get_traces.traces,
+                                tracemalloc_get_traces_fill, &get_traces);
+    set_reentrant(0);
+    if (err)
+        goto error;
+
+    goto finally;
+
+error:
+    Py_CLEAR(get_traces.list);
+
+finally:
+    if (get_traces.tracebacks != NULL) {
+        _Py_hashtable_foreach(get_traces.tracebacks,
+                         tracemalloc_pyobject_decref_cb, NULL);
+        _Py_hashtable_destroy(get_traces.tracebacks);
+    }
+    if (get_traces.traces != NULL)
+        _Py_hashtable_destroy(get_traces.traces);
+
+    return get_traces.list;
+}
+
+PyDoc_STRVAR(tracemalloc_get_object_traceback_doc,
+    "_get_object_traceback(obj)\n"
+    "\n"
+    "Get the traceback where the Python object obj was allocated.\n"
+    "Return a tuple of (filename: str, lineno: int) tuples.\n"
+    "\n"
+    "Return None if the tracemalloc module is disabled or did not\n"
+    "trace the allocation of the object.");
+
+static PyObject*
+py_tracemalloc_get_object_traceback(PyObject *self, PyObject *obj)
+{
+    PyTypeObject *type;
+    void *ptr;
+    trace_t trace;
+    int found;
+
+    if (!tracemalloc_config.tracing)
+        Py_RETURN_NONE;
+
+    type = Py_TYPE(obj);
+    if (PyType_IS_GC(type))
+        ptr = (void *)((char *)obj - sizeof(PyGC_Head));
+    else
+        ptr = (void *)obj;
+
+    TABLES_LOCK();
+    found = _Py_HASHTABLE_GET(tracemalloc_traces, ptr, trace);
+    TABLES_UNLOCK();
+
+    if (!found)
+        Py_RETURN_NONE;
+
+    return traceback_to_pyobject(trace.traceback, NULL);
+}
+
+PyDoc_STRVAR(tracemalloc_start_doc,
+    "start(nframe: int=1)\n"
+    "\n"
+    "Start tracing Python memory allocations. Set also the maximum number \n"
+    "of frames stored in the traceback of a trace to nframe.");
+
+static PyObject*
+py_tracemalloc_start(PyObject *self, PyObject *args)
+{
+    Py_ssize_t nframe = 1;
+    int nframe_int;
+
+    if (!PyArg_ParseTuple(args, "|n:start", &nframe))
+        return NULL;
+
+    if (nframe < 1 || nframe > MAX_NFRAME) {
+        PyErr_Format(PyExc_ValueError,
+                     "the number of frames must be in range [1; %i]",
+                     (int)MAX_NFRAME);
+        return NULL;
+    }
+    nframe_int = Py_SAFE_DOWNCAST(nframe, Py_ssize_t, int);
+
+    if (tracemalloc_start(nframe_int) < 0)
+        return NULL;
+
+    Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(tracemalloc_stop_doc,
+    "stop()\n"
+    "\n"
+    "Stop tracing Python memory allocations and clear traces\n"
+    "of memory blocks allocated by Python.");
+
+static PyObject*
+py_tracemalloc_stop(PyObject *self)
+{
+    tracemalloc_stop();
+    Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(tracemalloc_get_traceback_limit_doc,
+    "get_traceback_limit() -> int\n"
+    "\n"
+    "Get the maximum number of frames stored in the traceback\n"
+    "of a trace.\n"
+    "\n"
+    "By default, a trace of an allocated memory block only stores\n"
+    "the most recent frame: the limit is 1.");
+
+static PyObject*
+py_tracemalloc_get_traceback_limit(PyObject *self)
+{
+    return PyLong_FromLong(tracemalloc_config.max_nframe);
+}
+
+PyDoc_STRVAR(tracemalloc_get_tracemalloc_memory_doc,
+    "get_tracemalloc_memory() -> int\n"
+    "\n"
+    "Get the memory usage in bytes of the tracemalloc module\n"
+    "used internally to trace memory allocations.");
+
+static PyObject*
+tracemalloc_get_tracemalloc_memory(PyObject *self)
+{
+    size_t size;
+    PyObject *size_obj;
+
+    size = _Py_hashtable_size(tracemalloc_tracebacks);
+    size += _Py_hashtable_size(tracemalloc_filenames);
+
+    TABLES_LOCK();
+    size += _Py_hashtable_size(tracemalloc_traces);
+    TABLES_UNLOCK();
+
+    size_obj = PyLong_FromSize_t(size);
+    return Py_BuildValue("N", size_obj);
+}
+
+PyDoc_STRVAR(tracemalloc_get_traced_memory_doc,
+    "get_traced_memory() -> (int, int)\n"
+    "\n"
+    "Get the current size and peak size of memory blocks traced\n"
+    "by the tracemalloc module as a tuple: (current: int, peak: int).");
+
+static PyObject*
+tracemalloc_get_traced_memory(PyObject *self)
+{
+    Py_ssize_t size, peak_size;
+    PyObject *size_obj, *peak_size_obj;
+
+    if (!tracemalloc_config.tracing)
+        return Py_BuildValue("ii", 0, 0);
+
+    TABLES_LOCK();
+    size = tracemalloc_traced_memory;
+    peak_size = tracemalloc_peak_traced_memory;
+    TABLES_UNLOCK();
+
+    size_obj = PyLong_FromSize_t(size);
+    peak_size_obj = PyLong_FromSize_t(peak_size);
+    return Py_BuildValue("NN", size_obj, peak_size_obj);
+}
+
+static PyMethodDef module_methods[] = {
+    {"is_tracing", (PyCFunction)py_tracemalloc_is_tracing,
+     METH_NOARGS, tracemalloc_is_tracing_doc},
+    {"clear_traces", (PyCFunction)py_tracemalloc_clear_traces,
+     METH_NOARGS, tracemalloc_clear_traces_doc},
+    {"_get_traces", (PyCFunction)py_tracemalloc_get_traces,
+     METH_NOARGS, tracemalloc_get_traces_doc},
+    {"_get_object_traceback", (PyCFunction)py_tracemalloc_get_object_traceback,
+     METH_O, tracemalloc_get_object_traceback_doc},
+    {"start", (PyCFunction)py_tracemalloc_start,
+      METH_VARARGS, tracemalloc_start_doc},
+    {"stop", (PyCFunction)py_tracemalloc_stop,
+      METH_NOARGS, tracemalloc_stop_doc},
+    {"get_traceback_limit", (PyCFunction)py_tracemalloc_get_traceback_limit,
+     METH_NOARGS, tracemalloc_get_traceback_limit_doc},
+    {"get_tracemalloc_memory", (PyCFunction)tracemalloc_get_tracemalloc_memory,
+     METH_NOARGS, tracemalloc_get_tracemalloc_memory_doc},
+    {"get_traced_memory", (PyCFunction)tracemalloc_get_traced_memory,
+     METH_NOARGS, tracemalloc_get_traced_memory_doc},
+
+    /* sentinel */
+    {NULL, NULL}
+};
+
+PyDoc_STRVAR(module_doc,
+"Debug module to trace memory blocks allocated by Python.");
+
+static struct PyModuleDef module_def = {
+    PyModuleDef_HEAD_INIT,
+    "_tracemalloc",
+    module_doc,
+    0, /* non-negative size to be able to unload the module */
+    module_methods,
+    NULL,
+};
+
+PyMODINIT_FUNC
+PyInit__tracemalloc(void)
+{
+    PyObject *m;
+    m = PyModule_Create(&module_def);
+    if (m == NULL)
+        return NULL;
+
+    if (tracemalloc_init() < 0)
+        return NULL;
+
+    return m;
+}
+
+static int
+parse_sys_xoptions(PyObject *value)
+{
+    PyObject *valuelong;
+    long nframe;
+
+    if (value == Py_True)
+        return 1;
+
+    assert(PyUnicode_Check(value));
+    if (PyUnicode_GetLength(value) == 0)
+        return -1;
+
+    valuelong = PyLong_FromUnicodeObject(value, 10);
+    if (valuelong == NULL)
+        return -1;
+
+    nframe = PyLong_AsLong(valuelong);
+    Py_DECREF(valuelong);
+    if (nframe == -1 && PyErr_Occurred())
+        return -1;
+
+    if (nframe < 1 || nframe > MAX_NFRAME)
+        return -1;
+
+    return Py_SAFE_DOWNCAST(nframe, long, int);
+}
+
+int
+_PyTraceMalloc_Init(void)
+{
+    char *p;
+    int nframe;
+
+#ifdef WITH_THREAD
+    assert(PyGILState_Check());
+#endif
+
+    if ((p = Py_GETENV("PYTHONTRACEMALLOC")) && *p != '\0') {
+        char *endptr = p;
+        long value;
+
+        errno = 0;
+        value = strtol(p, &endptr, 10);
+        if (*endptr != '\0'
+            || value < 1
+            || value > MAX_NFRAME
+            || errno == ERANGE)
+        {
+            Py_FatalError("PYTHONTRACEMALLOC: invalid number of frames");
+            return -1;
+        }
+
+        nframe = (int)value;
+    }
+    else {
+        PyObject *xoptions, *key, *value;
+
+        xoptions = PySys_GetXOptions();
+        if (xoptions == NULL)
+            return -1;
+
+        key = PyUnicode_FromString("tracemalloc");
+        if (key == NULL)
+            return -1;
+
+        value = PyDict_GetItemWithError(xoptions, key);
+        Py_DECREF(key);
+        if (value == NULL) {
+            if (PyErr_Occurred())
+                return -1;
+
+            /* -X tracemalloc is not used */
+            return 0;
+        }
+
+        nframe = parse_sys_xoptions(value);
+        Py_DECREF(value);
+        if (nframe < 0) {
+            Py_FatalError("-X tracemalloc=NFRAME: invalid number of frames");
+        }
+    }
+
+    return tracemalloc_start(nframe);
+}
+
+void
+_PyTraceMalloc_Fini(void)
+{
+#ifdef WITH_THREAD
+    assert(PyGILState_Check());
+#endif
+    tracemalloc_deinit();
+}
+
diff --git a/Modules/_weakref.c b/Modules/_weakref.c
index 88995b8..da58931 100644
--- a/Modules/_weakref.c
+++ b/Modules/_weakref.c
@@ -4,25 +4,59 @@
 #define GET_WEAKREFS_LISTPTR(o) \
         ((PyWeakReference **) PyObject_GET_WEAKREFS_LISTPTR(o))
 
+/*[clinic input]
+module _weakref
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=ffec73b85846596d]*/
 
-PyDoc_STRVAR(weakref_getweakrefcount__doc__,
-"getweakrefcount(object) -- return the number of weak references\n"
-"to 'object'.");
+/*[clinic input]
+
+_weakref.getweakrefcount -> Py_ssize_t
+
+  object: object
+  /
+
+Return the number of weak references to 'object'.
+[clinic start generated code]*/
+
+PyDoc_STRVAR(_weakref_getweakrefcount__doc__,
+"getweakrefcount($module, object, /)\n"
+"--\n"
+"\n"
+"Return the number of weak references to \'object\'.");
+
+#define _WEAKREF_GETWEAKREFCOUNT_METHODDEF    \
+    {"getweakrefcount", (PyCFunction)_weakref_getweakrefcount, METH_O, _weakref_getweakrefcount__doc__},
+
+static Py_ssize_t
+_weakref_getweakrefcount_impl(PyModuleDef *module, PyObject *object);
 
 static PyObject *
-weakref_getweakrefcount(PyObject *self, PyObject *object)
+_weakref_getweakrefcount(PyModuleDef *module, PyObject *object)
 {
-    PyObject *result = NULL;
+    PyObject *return_value = NULL;
+    Py_ssize_t _return_value;
 
-    if (PyType_SUPPORTS_WEAKREFS(Py_TYPE(object))) {
-        PyWeakReference **list = GET_WEAKREFS_LISTPTR(object);
+    _return_value = _weakref_getweakrefcount_impl(module, object);
+    if ((_return_value == -1) && PyErr_Occurred())
+        goto exit;
+    return_value = PyLong_FromSsize_t(_return_value);
 
-        result = PyLong_FromSsize_t(_PyWeakref_GetWeakrefCount(*list));
-    }
-    else
-        result = PyLong_FromLong(0);
+exit:
+    return return_value;
+}
 
-    return result;
+static Py_ssize_t
+_weakref_getweakrefcount_impl(PyModuleDef *module, PyObject *object)
+/*[clinic end generated code: output=032eedbfd7d69e10 input=cedb69711b6a2507]*/
+{
+    PyWeakReference **list;
+
+    if (!PyType_SUPPORTS_WEAKREFS(Py_TYPE(object)))
+        return 0;
+
+    list = GET_WEAKREFS_LISTPTR(object);
+    return _PyWeakref_GetWeakrefCount(*list);
 }
 
 
@@ -78,8 +112,7 @@
 
 static PyMethodDef
 weakref_functions[] =  {
-    {"getweakrefcount", weakref_getweakrefcount,        METH_O,
-     weakref_getweakrefcount__doc__},
+    _WEAKREF_GETWEAKREFCOUNT_METHODDEF
     {"getweakrefs",     weakref_getweakrefs,            METH_O,
      weakref_getweakrefs__doc__},
     {"proxy",           weakref_proxy,                  METH_VARARGS,
@@ -106,7 +139,7 @@
     PyObject *m;
 
     m = PyModule_Create(&weakrefmodule);
-                       
+
     if (m != NULL) {
         Py_INCREF(&_PyWeakref_RefType);
         PyModule_AddObject(m, "ref",
diff --git a/Modules/_winapi.c b/Modules/_winapi.c
index c53d55a..b755178 100644
--- a/Modules/_winapi.c
+++ b/Modules/_winapi.c
@@ -62,6 +62,8 @@
 
 #define T_HANDLE T_POINTER
 
+#define DWORD_MAX 4294967295U
+
 /* Grab CancelIoEx dynamically from kernel32 */
 static int has_CancelIoEx = -1;
 static BOOL (CALLBACK *Py_CancelIoEx)(HANDLE, LPOVERLAPPED);
@@ -105,17 +107,37 @@
 {
     DWORD bytes;
     int err = GetLastError();
+
     if (self->pending) {
-        /* make it a programming error to deallocate while operation
-           is pending, even if we can safely cancel it */
         if (check_CancelIoEx() &&
-                Py_CancelIoEx(self->handle, &self->overlapped))
-            GetOverlappedResult(self->handle, &self->overlapped, &bytes, TRUE);
-        PyErr_SetString(PyExc_RuntimeError,
-                        "I/O operations still in flight while destroying "
-                        "Overlapped object, the process may crash");
-        PyErr_WriteUnraisable(NULL);
+            Py_CancelIoEx(self->handle, &self->overlapped) &&
+            GetOverlappedResult(self->handle, &self->overlapped, &bytes, TRUE))
+        {
+            /* The operation is no longer pending -- nothing to do. */
+        }
+        else if (_Py_Finalizing == NULL)
+        {
+            /* The operation is still pending -- give a warning.  This
+               will probably only happen on Windows XP. */
+            PyErr_SetString(PyExc_RuntimeError,
+                            "I/O operations still in flight while destroying "
+                            "Overlapped object, the process may crash");
+            PyErr_WriteUnraisable(NULL);
+        }
+        else
+        {
+            /* The operation is still pending, but the process is
+               probably about to exit, so we need not worry too much
+               about memory leaks.  Leaking self prevents a potential
+               crash.  This can happen when a daemon thread is cleaned
+               up at exit -- see #19565.  We only expect to get here
+               on Windows XP. */
+            CloseHandle(self->overlapped.hEvent);
+            SetLastError(err);
+            return;
+        }
     }
+
     CloseHandle(self->overlapped.hEvent);
     SetLastError(err);
     if (self->write_buffer.obj)
@@ -1142,7 +1164,7 @@
     HANDLE handle;
     Py_buffer _buf, *buf;
     PyObject *bufobj;
-    DWORD written;
+    DWORD len, written;
     BOOL ret;
     int use_overlapped = 0;
     DWORD err;
@@ -1170,7 +1192,8 @@
     }
 
     Py_BEGIN_ALLOW_THREADS
-    ret = WriteFile(handle, buf->buf, buf->len, &written,
+    len = (DWORD)Py_MIN(buf->len, DWORD_MAX);
+    ret = WriteFile(handle, buf->buf, len, &written,
                     overlapped ? &overlapped->overlapped : NULL);
     Py_END_ALLOW_THREADS
 
@@ -1320,6 +1343,7 @@
     WINAPI_CONSTANT(F_DWORD, STILL_ACTIVE);
     WINAPI_CONSTANT(F_DWORD, SW_HIDE);
     WINAPI_CONSTANT(F_DWORD, WAIT_OBJECT_0);
+    WINAPI_CONSTANT(F_DWORD, WAIT_ABANDONED_0);
     WINAPI_CONSTANT(F_DWORD, WAIT_TIMEOUT);
 
     WINAPI_CONSTANT("i", NULL);
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c
index 3aba9ad..5ab1ab6 100644
--- a/Modules/arraymodule.c
+++ b/Modules/arraymodule.c
@@ -513,7 +513,7 @@
 static PyObject *
 getarrayitem(PyObject *op, Py_ssize_t i)
 {
-    register arrayobject *ap;
+    arrayobject *ap;
     assert(array_Check(op));
     ap = (arrayobject *)op;
     assert(i>=0 && i<Py_SIZE(ap));
@@ -968,8 +968,13 @@
     Py_ssize_t i;
 
     for (i = 0; i < Py_SIZE(self); i++) {
-        PyObject *selfi = getarrayitem((PyObject *)self, i);
-        int cmp = PyObject_RichCompareBool(selfi, v, Py_EQ);
+        PyObject *selfi;
+        int cmp;
+
+        selfi = getarrayitem((PyObject *)self, i);
+        if (selfi == NULL)
+            return NULL;
+        cmp = PyObject_RichCompareBool(selfi, v, Py_EQ);
         Py_DECREF(selfi);
         if (cmp > 0)
             count++;
@@ -990,8 +995,13 @@
     Py_ssize_t i;
 
     for (i = 0; i < Py_SIZE(self); i++) {
-        PyObject *selfi = getarrayitem((PyObject *)self, i);
-        int cmp = PyObject_RichCompareBool(selfi, v, Py_EQ);
+        PyObject *selfi;
+        int cmp;
+
+        selfi = getarrayitem((PyObject *)self, i);
+        if (selfi == NULL)
+            return NULL;
+        cmp = PyObject_RichCompareBool(selfi, v, Py_EQ);
         Py_DECREF(selfi);
         if (cmp > 0) {
             return PyLong_FromLong((long)i);
@@ -1016,6 +1026,8 @@
 
     for (i = 0, cmp = 0 ; cmp == 0 && i < Py_SIZE(self); i++) {
         PyObject *selfi = getarrayitem((PyObject *)self, i);
+        if (selfi == NULL)
+            return -1;
         cmp = PyObject_RichCompareBool(selfi, v, Py_EQ);
         Py_DECREF(selfi);
     }
@@ -1028,8 +1040,13 @@
     int i;
 
     for (i = 0; i < Py_SIZE(self); i++) {
-        PyObject *selfi = getarrayitem((PyObject *)self,i);
-        int cmp = PyObject_RichCompareBool(selfi, v, Py_EQ);
+        PyObject *selfi;
+        int cmp;
+
+        selfi = getarrayitem((PyObject *)self,i);
+        if (selfi == NULL)
+            return NULL;
+        cmp = PyObject_RichCompareBool(selfi, v, Py_EQ);
         Py_DECREF(selfi);
         if (cmp > 0) {
             if (array_ass_slice(self, i, i+1,
@@ -1068,7 +1085,9 @@
         PyErr_SetString(PyExc_IndexError, "pop index out of range");
         return NULL;
     }
-    v = getarrayitem((PyObject *)self,i);
+    v = getarrayitem((PyObject *)self, i);
+    if (v == NULL)
+        return NULL;
     if (array_ass_slice(self, i, i+1, (PyObject *)NULL) != 0) {
         Py_DECREF(v);
         return NULL;
@@ -1114,13 +1133,25 @@
 static PyObject *
 array_buffer_info(arrayobject *self, PyObject *unused)
 {
-    PyObject* retval = NULL;
+    PyObject *retval = NULL, *v;
+
     retval = PyTuple_New(2);
     if (!retval)
         return NULL;
 
-    PyTuple_SET_ITEM(retval, 0, PyLong_FromVoidPtr(self->ob_item));
-    PyTuple_SET_ITEM(retval, 1, PyLong_FromLong((long)(Py_SIZE(self))));
+    v = PyLong_FromVoidPtr(self->ob_item);
+    if (v == NULL) {
+        Py_DECREF(retval);
+        return NULL;
+    }
+    PyTuple_SET_ITEM(retval, 0, v);
+
+    v = PyLong_FromLong((long)(Py_SIZE(self)));
+    if (v == NULL) {
+        Py_DECREF(retval);
+        return NULL;
+    }
+    PyTuple_SET_ITEM(retval, 1, v);
 
     return retval;
 }
@@ -1206,8 +1237,8 @@
 static PyObject *
 array_reverse(arrayobject *self, PyObject *unused)
 {
-    register Py_ssize_t itemsize = self->ob_descr->itemsize;
-    register char *p, *q;
+    Py_ssize_t itemsize = self->ob_descr->itemsize;
+    char *p, *q;
     /* little buffer to hold items while swapping */
     char tmp[256];      /* 8 is probably enough -- but why skimp */
     assert((size_t)itemsize <= sizeof(tmp));
@@ -1386,13 +1417,16 @@
         return NULL;
     for (i = 0; i < Py_SIZE(self); i++) {
         PyObject *v = getarrayitem((PyObject *)self, i);
-        if (v == NULL) {
-            Py_DECREF(list);
-            return NULL;
-        }
-        PyList_SetItem(list, i, v);
+        if (v == NULL)
+            goto error;
+        if (PyList_SetItem(list, i, v) < 0)
+            goto error;
     }
     return list;
+
+error:
+    Py_DECREF(list);
+    return NULL;
 }
 
 PyDoc_STRVAR(tolist_doc,
@@ -1407,14 +1441,14 @@
     Py_ssize_t n;
     if (buffer->itemsize != 1) {
         PyBuffer_Release(buffer);
-        PyErr_SetString(PyExc_TypeError, "string/buffer of bytes required.");
+        PyErr_SetString(PyExc_TypeError, "a bytes-like object is required");
         return NULL;
     }
     n = buffer->len;
     if (n % itemsize != 0) {
         PyBuffer_Release(buffer);
         PyErr_SetString(PyExc_ValueError,
-                   "string length not a multiple of item size");
+                   "bytes length not a multiple of item size");
         return NULL;
     }
     n = n / itemsize;
@@ -1664,11 +1698,8 @@
 static enum machine_format_code
 typecode_to_mformat_code(char typecode)
 {
-#ifdef WORDS_BIGENDIAN
-    const int is_big_endian = 1;
-#else
-    const int is_big_endian = 0;
-#endif
+    const int is_big_endian = PY_BIG_ENDIAN;
+
     size_t intsize;
     int is_signed;
 
@@ -2487,6 +2518,20 @@
     if (!PyArg_ParseTuple(args, "C|O:array", &c, &initial))
         return NULL;
 
+    if (initial && c != 'u') {
+        if (PyUnicode_Check(initial)) {
+            PyErr_Format(PyExc_TypeError, "cannot use a str to initialize "
+                         "an array with typecode '%c'", c);
+            return NULL;
+        }
+        else if (array_Check(initial) &&
+                 ((arrayobject*)initial)->ob_descr->typecode == 'u') {
+            PyErr_Format(PyExc_TypeError, "cannot use a unicode array to "
+                         "initialize an array with typecode '%c'", c);
+            return NULL;
+        }
+    }
+
     if (!(initial == NULL || PyList_Check(initial)
           || PyByteArray_Check(initial)
           || PyBytes_Check(initial)
@@ -2583,7 +2628,7 @@
                     self->allocated = Py_SIZE(self);
                 }
             }
-            else if (initial != NULL && array_Check(initial)) {
+            else if (initial != NULL && array_Check(initial) && len > 0) {
                 arrayobject *self = (arrayobject *)a;
                 arrayobject *other = (arrayobject *)initial;
                 memcpy(self->ob_item, other->ob_item, len * other->ob_descr->itemsize);
@@ -2613,9 +2658,19 @@
 "This module defines an object type which can efficiently represent\n\
 an array of basic values: characters, integers, floating point\n\
 numbers.  Arrays are sequence types and behave very much like lists,\n\
-except that the type of objects stored in them is constrained.  The\n\
-type is specified at object creation time by using a type code, which\n\
-is a single character.  The following type codes are defined:\n\
+except that the type of objects stored in them is constrained.\n");
+
+PyDoc_STRVAR(arraytype_doc,
+"array(typecode [, initializer]) -> array\n\
+\n\
+Return a new array whose items are restricted by typecode, and\n\
+initialized from the optional initializer value, which must be a list,\n\
+string or iterable over elements of the appropriate type.\n\
+\n\
+Arrays represent basic values and behave very much like lists, except\n\
+the type of objects stored in them is constrained. The type is specified\n\
+at object creation time by using a type code, which is a single character.\n\
+The following type codes are defined:\n\
 \n\
     Type code   C Type             Minimum size in bytes \n\
     'b'         signed integer     1 \n\
@@ -2639,21 +2694,6 @@
 C compiler used to build Python supports 'long long', or, on Windows, \n\
 '__int64'.\n\
 \n\
-The constructor is:\n\
-\n\
-array(typecode [, initializer]) -- create a new array\n\
-");
-
-PyDoc_STRVAR(arraytype_doc,
-"array(typecode [, initializer]) -> array\n\
-\n\
-Return a new array whose items are restricted by typecode, and\n\
-initialized from the optional initializer value, which must be a list,\n\
-string or iterable over elements of the appropriate type.\n\
-\n\
-Arrays represent basic values and behave very much like lists, except\n\
-the type of objects stored in them is constrained.\n\
-\n\
 Methods:\n\
 \n\
 append() -- append a new item to the end of the array\n\
diff --git a/Modules/atexitmodule.c b/Modules/atexitmodule.c
index f68d804..9887014 100644
--- a/Modules/atexitmodule.c
+++ b/Modules/atexitmodule.c
@@ -10,8 +10,6 @@
 
 /* Forward declaration (for atexit_cleanup) */
 static PyObject *atexit_clear(PyObject*, PyObject*);
-/* Forward declaration (for atexit_callfuncs) */
-static void atexit_cleanup(PyObject*);
 /* Forward declaration of module object */
 static struct PyModuleDef atexitmodule;
 
@@ -33,6 +31,35 @@
 #define GET_ATEXIT_STATE(mod) ((atexitmodule_state*)PyModule_GetState(mod))
 
 
+static void
+atexit_delete_cb(atexitmodule_state *modstate, int i)
+{
+    atexit_callback *cb;
+
+    cb = modstate->atexit_callbacks[i];
+    modstate->atexit_callbacks[i] = NULL;
+    Py_DECREF(cb->func);
+    Py_DECREF(cb->args);
+    Py_XDECREF(cb->kwargs);
+    PyMem_Free(cb);
+}
+
+/* Clear all callbacks without calling them */
+static void
+atexit_cleanup(atexitmodule_state *modstate)
+{
+    atexit_callback *cb;
+    int i;
+    for (i = 0; i < modstate->ncallbacks; i++) {
+        cb = modstate->atexit_callbacks[i];
+        if (cb == NULL)
+            continue;
+
+        atexit_delete_cb(modstate, i);
+    }
+    modstate->ncallbacks = 0;
+}
+
 /* Installed into pythonrun.c's atexit mechanism */
 
 static void
@@ -78,34 +105,12 @@
         }
     }
 
-    atexit_cleanup(module);
+    atexit_cleanup(modstate);
 
     if (exc_type)
         PyErr_Restore(exc_type, exc_value, exc_tb);
 }
 
-static void
-atexit_delete_cb(PyObject *self, int i)
-{
-    atexitmodule_state *modstate;
-    atexit_callback *cb;
-
-    modstate = GET_ATEXIT_STATE(self);
-    cb = modstate->atexit_callbacks[i];
-    modstate->atexit_callbacks[i] = NULL;
-    Py_DECREF(cb->func);
-    Py_DECREF(cb->args);
-    Py_XDECREF(cb->kwargs);
-    PyMem_Free(cb);
-}
-
-static void
-atexit_cleanup(PyObject *self)
-{
-    PyObject *r = atexit_clear(self, NULL);
-    Py_DECREF(r);
-}
-
 /* ===================================================================== */
 /* Module methods. */
 
@@ -194,21 +199,50 @@
 static PyObject *
 atexit_clear(PyObject *self, PyObject *unused)
 {
+    atexit_cleanup(GET_ATEXIT_STATE(self));
+    Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(atexit_ncallbacks__doc__,
+"_ncallbacks() -> int\n\
+\n\
+Return the number of registered exit functions.");
+
+static PyObject *
+atexit_ncallbacks(PyObject *self, PyObject *unused)
+{
     atexitmodule_state *modstate;
-    atexit_callback *cb;
-    int i;
 
     modstate = GET_ATEXIT_STATE(self);
 
+    return PyLong_FromSsize_t(modstate->ncallbacks);
+}
+
+static int
+atexit_m_traverse(PyObject *self, visitproc visit, void *arg)
+{
+    int i;
+    atexitmodule_state *modstate;
+
+    modstate = GET_ATEXIT_STATE(self);
     for (i = 0; i < modstate->ncallbacks; i++) {
-        cb = modstate->atexit_callbacks[i];
+        atexit_callback *cb = modstate->atexit_callbacks[i];
         if (cb == NULL)
             continue;
-
-        atexit_delete_cb(self, i);
+        Py_VISIT(cb->func);
+        Py_VISIT(cb->args);
+        Py_VISIT(cb->kwargs);
     }
-    modstate->ncallbacks = 0;
-    Py_RETURN_NONE;
+    return 0;
+}
+
+static int
+atexit_m_clear(PyObject *self)
+{
+    atexitmodule_state *modstate;
+    modstate = GET_ATEXIT_STATE(self);
+    atexit_cleanup(modstate);
+    return 0;
 }
 
 static void
@@ -216,6 +250,7 @@
 {
     atexitmodule_state *modstate;
     modstate = GET_ATEXIT_STATE(m);
+    atexit_cleanup(modstate);
     PyMem_Free(modstate->atexit_callbacks);
 }
 
@@ -246,7 +281,7 @@
         if (eq < 0)
             return NULL;
         if (eq)
-            atexit_delete_cb(self, i);
+            atexit_delete_cb(modstate, i);
     }
     Py_RETURN_NONE;
 }
@@ -260,6 +295,8 @@
         atexit_unregister__doc__},
     {"_run_exitfuncs", (PyCFunction) atexit_run_exitfuncs, METH_NOARGS,
         atexit_run_exitfuncs__doc__},
+    {"_ncallbacks", (PyCFunction) atexit_ncallbacks, METH_NOARGS,
+        atexit_ncallbacks__doc__},
     {NULL, NULL}        /* sentinel */
 };
 
@@ -275,15 +312,15 @@
 
 
 static struct PyModuleDef atexitmodule = {
-	PyModuleDef_HEAD_INIT,
-	"atexit",
-	atexit__doc__,
-	sizeof(atexitmodule_state),
-	atexit_methods,
-	NULL,
-	NULL,
-	NULL,
-	(freefunc)atexit_free
+    PyModuleDef_HEAD_INIT,
+    "atexit",
+    atexit__doc__,
+    sizeof(atexitmodule_state),
+    atexit_methods,
+    NULL,
+    atexit_m_traverse,
+    atexit_m_clear,
+    (freefunc)atexit_free
 };
 
 PyMODINIT_FUNC
diff --git a/Modules/audioop.c b/Modules/audioop.c
index 3f04762..2d287f2 100644
--- a/Modules/audioop.c
+++ b/Modules/audioop.c
@@ -5,18 +5,6 @@
 
 #include "Python.h"
 
-#if SIZEOF_INT == 4
-typedef int Py_Int32;
-typedef unsigned int Py_UInt32;
-#else
-#if SIZEOF_LONG == 4
-typedef long Py_Int32;
-typedef unsigned long Py_UInt32;
-#else
-#error "No 4-byte integral type"
-#endif
-#endif
-
 typedef short PyInt16;
 
 #if defined(__CHAR_UNSIGNED__)
@@ -38,7 +26,7 @@
         val = maxval;
     else if (val < minval + 1)
         val = minval;
-    return val;
+    return (int)val;
 }
 
 
@@ -161,9 +149,6 @@
     PyInt16         seg;
     unsigned char   uval;
 
-    /* The original sox code does this in the calling function, not here */
-    pcm_val = pcm_val >> 2;
-
     /* u-law inverts all bits */
     /* Get the sign and the magnitude of the value. */
     if (pcm_val < 0) {
@@ -258,9 +243,6 @@
     short           seg;
     unsigned char   aval;
 
-    /* The original sox code does this in the calling function, not here */
-    pcm_val = pcm_val >> 3;
-
     /* A-law using even bit inversion */
     if (pcm_val >= 0) {
         mask = 0xD5;            /* sign (7th) bit = 1 */
@@ -305,19 +287,91 @@
     15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767
 };
 
-#define CHARP(cp, i) ((signed char *)(cp+i))
-#define SHORTP(cp, i) ((short *)(cp+i))
-#define LONGP(cp, i) ((Py_Int32 *)(cp+i))
+#define GETINTX(T, cp, i)  (*(T *)((unsigned char *)(cp) + (i)))
+#define SETINTX(T, cp, i, val)  do {                    \
+        *(T *)((unsigned char *)(cp) + (i)) = (T)(val); \
+    } while (0)
 
 
+#define GETINT8(cp, i)          GETINTX(signed char, (cp), (i))
+#define GETINT16(cp, i)         GETINTX(short, (cp), (i))
+#define GETINT32(cp, i)         GETINTX(PY_INT32_T, (cp), (i))
+
+#if WORDS_BIGENDIAN
+#define GETINT24(cp, i)  (                              \
+        ((unsigned char *)(cp) + (i))[2] +              \
+        (((unsigned char *)(cp) + (i))[1] << 8) +       \
+        (((signed char *)(cp) + (i))[0] << 16) )
+#else
+#define GETINT24(cp, i)  (                              \
+        ((unsigned char *)(cp) + (i))[0] +              \
+        (((unsigned char *)(cp) + (i))[1] << 8) +       \
+        (((signed char *)(cp) + (i))[2] << 16) )
+#endif
+
+
+#define SETINT8(cp, i, val)     SETINTX(signed char, (cp), (i), (val))
+#define SETINT16(cp, i, val)    SETINTX(short, (cp), (i), (val))
+#define SETINT32(cp, i, val)    SETINTX(PY_INT32_T, (cp), (i), (val))
+
+#if WORDS_BIGENDIAN
+#define SETINT24(cp, i, val)  do {                              \
+        ((unsigned char *)(cp) + (i))[2] = (int)(val);          \
+        ((unsigned char *)(cp) + (i))[1] = (int)(val) >> 8;     \
+        ((signed char *)(cp) + (i))[0] = (int)(val) >> 16;      \
+    } while (0)
+#else
+#define SETINT24(cp, i, val)  do {                              \
+        ((unsigned char *)(cp) + (i))[0] = (int)(val);          \
+        ((unsigned char *)(cp) + (i))[1] = (int)(val) >> 8;     \
+        ((signed char *)(cp) + (i))[2] = (int)(val) >> 16;      \
+    } while (0)
+#endif
+
+
+#define GETRAWSAMPLE(size, cp, i)  (                    \
+        (size == 1) ? (int)GETINT8((cp), (i)) :         \
+        (size == 2) ? (int)GETINT16((cp), (i)) :        \
+        (size == 3) ? (int)GETINT24((cp), (i)) :        \
+                      (int)GETINT32((cp), (i)))
+
+#define SETRAWSAMPLE(size, cp, i, val)  do {    \
+        if (size == 1)                          \
+            SETINT8((cp), (i), (val));          \
+        else if (size == 2)                     \
+            SETINT16((cp), (i), (val));         \
+        else if (size == 3)                     \
+            SETINT24((cp), (i), (val));         \
+        else                                    \
+            SETINT32((cp), (i), (val));         \
+    } while(0)
+
+
+#define GETSAMPLE32(size, cp, i)  (                     \
+        (size == 1) ? (int)GETINT8((cp), (i)) << 24 :   \
+        (size == 2) ? (int)GETINT16((cp), (i)) << 16 :  \
+        (size == 3) ? (int)GETINT24((cp), (i)) << 8 :   \
+                      (int)GETINT32((cp), (i)))
+
+#define SETSAMPLE32(size, cp, i, val)  do {     \
+        if (size == 1)                          \
+            SETINT8((cp), (i), (val) >> 24);    \
+        else if (size == 2)                     \
+            SETINT16((cp), (i), (val) >> 16);   \
+        else if (size == 3)                     \
+            SETINT24((cp), (i), (val) >> 8);    \
+        else                                    \
+            SETINT32((cp), (i), (val));         \
+    } while(0)
+
 
 static PyObject *AudioopError;
 
 static int
 audioop_check_size(int size)
 {
-    if (size != 1 && size != 2 && size != 4) {
-        PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
+    if (size < 1 || size > 4) {
+        PyErr_SetString(AudioopError, "Size should be 1, 2, 3 or 4");
         return 0;
     }
     else
@@ -336,43 +390,60 @@
     return 1;
 }
 
-static PyObject *
-audioop_getsample(PyObject *self, PyObject *args)
-{
-    signed char *cp;
-    Py_ssize_t len, i;
-    int size, val = 0;
+/*[clinic input]
+output preset file
+module audioop
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=5619f935f269199a]*/
 
-    if ( !PyArg_ParseTuple(args, "s#in:getsample", &cp, &len, &size, &i) )
-        return 0;
-    if (!audioop_check_parameters(len, size))
+/*[clinic input]
+audioop.getsample
+
+    fragment: Py_buffer
+    width: int
+    index: Py_ssize_t
+    /
+
+Return the value of sample index from the fragment.
+[clinic start generated code]*/
+
+static PyObject *
+audioop_getsample_impl(PyModuleDef *module, Py_buffer *fragment, int width, Py_ssize_t index)
+/*[clinic end generated code: output=f4482497e6f6e78f input=88edbe2871393549]*/
+{
+    int val;
+
+    if (!audioop_check_parameters(fragment->len, width))
         return NULL;
-    if ( i < 0 || i >= len/size ) {
+    if (index < 0 || index >= fragment->len/width) {
         PyErr_SetString(AudioopError, "Index out of range");
-        return 0;
+        return NULL;
     }
-    if ( size == 1 )      val = (int)*CHARP(cp, i);
-    else if ( size == 2 ) val = (int)*SHORTP(cp, i*2);
-    else if ( size == 4 ) val = (int)*LONGP(cp, i*4);
+    val = GETRAWSAMPLE(width, fragment->buf, index*width);
     return PyLong_FromLong(val);
 }
 
+/*[clinic input]
+audioop.max
+
+    fragment: Py_buffer
+    width: int
+    /
+
+Return the maximum of the absolute value of all samples in a fragment.
+[clinic start generated code]*/
+
 static PyObject *
-audioop_max(PyObject *self, PyObject *args)
+audioop_max_impl(PyModuleDef *module, Py_buffer *fragment, int width)
+/*[clinic end generated code: output=85047ee1001f2305 input=32bea5ea0ac8c223]*/
 {
-    signed char *cp;
-    Py_ssize_t len, i;
-    int size, val = 0;
+    Py_ssize_t i;
     unsigned int absval, max = 0;
 
-    if ( !PyArg_ParseTuple(args, "s#i:max", &cp, &len, &size) )
-        return 0;
-    if (!audioop_check_parameters(len, size))
+    if (!audioop_check_parameters(fragment->len, width))
         return NULL;
-    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);
+    for (i = 0; i < fragment->len; i += width) {
+        int val = GETRAWSAMPLE(width, fragment->buf, i);
         if (val < 0) absval = (-val);
         else absval = val;
         if (absval > max) max = absval;
@@ -380,82 +451,96 @@
     return PyLong_FromUnsignedLong(max);
 }
 
+/*[clinic input]
+audioop.minmax
+
+    fragment: Py_buffer
+    width: int
+    /
+
+Return the minimum and maximum values of all samples in the sound fragment.
+[clinic start generated code]*/
+
 static PyObject *
-audioop_minmax(PyObject *self, PyObject *args)
+audioop_minmax_impl(PyModuleDef *module, Py_buffer *fragment, int width)
+/*[clinic end generated code: output=ae8f5513c64fd569 input=89848e9b927a0696]*/
 {
-    signed char *cp;
-    Py_ssize_t len, i;
-    int size, val = 0;
+    Py_ssize_t i;
     /* -1 trick below is needed on Windows to support -0x80000000 without
     a warning */
     int min = 0x7fffffff, max = -0x7FFFFFFF-1;
 
-    if (!PyArg_ParseTuple(args, "s#i:minmax", &cp, &len, &size))
+    if (!audioop_check_parameters(fragment->len, width))
         return NULL;
-    if (!audioop_check_parameters(len, size))
-        return NULL;
-    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);
+    for (i = 0; i < fragment->len; i += width) {
+        int val = GETRAWSAMPLE(width, fragment->buf, i);
         if (val > max) max = val;
         if (val < min) min = val;
     }
     return Py_BuildValue("(ii)", min, max);
 }
 
-static PyObject *
-audioop_avg(PyObject *self, PyObject *args)
-{
-    signed char *cp;
-    Py_ssize_t len, i;
-    int size, val = 0;
-    double avg = 0.0;
+/*[clinic input]
+audioop.avg
 
-    if ( !PyArg_ParseTuple(args, "s#i:avg", &cp, &len, &size) )
-        return 0;
-    if (!audioop_check_parameters(len, size))
+    fragment: Py_buffer
+    width: int
+    /
+
+Return the average over all samples in the fragment.
+[clinic start generated code]*/
+
+static PyObject *
+audioop_avg_impl(PyModuleDef *module, Py_buffer *fragment, int width)
+/*[clinic end generated code: output=7fccd645c95f4860 input=1114493c7611334d]*/
+{
+    Py_ssize_t i;
+    int avg;
+    double sum = 0.0;
+
+    if (!audioop_check_parameters(fragment->len, width))
         return NULL;
-    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);
-        avg += val;
-    }
-    if ( len == 0 )
-        val = 0;
+    for (i = 0; i < fragment->len; i += width)
+        sum += GETRAWSAMPLE(width, fragment->buf, i);
+    if (fragment->len == 0)
+        avg = 0;
     else
-        val = (int)floor(avg / (double)(len/size));
-    return PyLong_FromLong(val);
+        avg = (int)floor(sum / (double)(fragment->len/width));
+    return PyLong_FromLong(avg);
 }
 
+/*[clinic input]
+audioop.rms
+
+    fragment: Py_buffer
+    width: int
+    /
+
+Return the root-mean-square of the fragment, i.e. sqrt(sum(S_i^2)/n).
+[clinic start generated code]*/
+
 static PyObject *
-audioop_rms(PyObject *self, PyObject *args)
+audioop_rms_impl(PyModuleDef *module, Py_buffer *fragment, int width)
+/*[clinic end generated code: output=7b398702c81b709d input=4cc57c6c94219d78]*/
 {
-    signed char *cp;
-    Py_ssize_t len, i;
-    int size, val = 0;
+    Py_ssize_t i;
     unsigned int res;
     double sum_squares = 0.0;
 
-    if ( !PyArg_ParseTuple(args, "s#i:rms", &cp, &len, &size) )
-        return 0;
-    if (!audioop_check_parameters(len, size))
+    if (!audioop_check_parameters(fragment->len, width))
         return NULL;
-    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);
-        sum_squares += (double)val*(double)val;
+    for (i = 0; i < fragment->len; i += width) {
+        double val = GETRAWSAMPLE(width, fragment->buf, i);
+        sum_squares += val*val;
     }
-    if ( len == 0 )
+    if (fragment->len == 0)
         res = 0;
     else
-        res = (unsigned int)sqrt(sum_squares / (double)(len/size));
+        res = (unsigned int)sqrt(sum_squares / (double)(fragment->len/width));
     return PyLong_FromUnsignedLong(res);
 }
 
-static double _sum2(short *a, short *b, Py_ssize_t len)
+static double _sum2(const short *a, const short *b, Py_ssize_t len)
 {
     Py_ssize_t i;
     double sum = 0.0;
@@ -498,32 +583,38 @@
 ** sum_ri is calculated once, sum_aij_2 is updated each step and sum_aij_ri
 ** is completely recalculated each step.
 */
+/*[clinic input]
+audioop.findfit
+
+    fragment: Py_buffer
+    reference: Py_buffer
+    /
+
+Try to match reference as well as possible to a portion of fragment.
+[clinic start generated code]*/
+
 static PyObject *
-audioop_findfit(PyObject *self, PyObject *args)
+audioop_findfit_impl(PyModuleDef *module, Py_buffer *fragment, Py_buffer *reference)
+/*[clinic end generated code: output=505fd04d4244db31 input=62c305605e183c9a]*/
 {
-    short *cp1, *cp2;
+    const short *cp1, *cp2;
     Py_ssize_t len1, len2;
     Py_ssize_t j, best_j;
     double aj_m1, aj_lm1;
     double sum_ri_2, sum_aij_2, sum_aij_ri, result, best_result, factor;
 
-    /* Passing a short** for an 's' argument is correct only
-       if the string contents is aligned for interpretation
-       as short[]. Due to the definition of PyBytesObject,
-       this is currently (Python 2.6) the case. */
-    if ( !PyArg_ParseTuple(args, "s#s#:findfit",
-                           (char**)&cp1, &len1, (char**)&cp2, &len2) )
-        return 0;
-    if ( len1 & 1 || len2 & 1 ) {
+    if (fragment->len & 1 || reference->len & 1) {
         PyErr_SetString(AudioopError, "Strings should be even-sized");
-        return 0;
+        return NULL;
     }
-    len1 >>= 1;
-    len2 >>= 1;
+    cp1 = (const short *)fragment->buf;
+    len1 = fragment->len >> 1;
+    cp2 = (const short *)reference->buf;
+    len2 = reference->len >> 1;
 
-    if ( len1 < len2 ) {
+    if (len1 < len2) {
         PyErr_SetString(AudioopError, "First sample should be longer");
-        return 0;
+        return NULL;
     }
     sum_ri_2 = _sum2(cp2, cp2, len2);
     sum_aij_2 = _sum2(cp1, cp1, len2);
@@ -560,27 +651,37 @@
 ** findfactor finds a factor f so that the energy in A-fB is minimal.
 ** See the comment for findfit for details.
 */
+/*[clinic input]
+audioop.findfactor
+
+    fragment: Py_buffer
+    reference: Py_buffer
+    /
+
+Return a factor F such that rms(add(fragment, mul(reference, -F))) is minimal.
+[clinic start generated code]*/
+
 static PyObject *
-audioop_findfactor(PyObject *self, PyObject *args)
+audioop_findfactor_impl(PyModuleDef *module, Py_buffer *fragment, Py_buffer *reference)
+/*[clinic end generated code: output=ddf35a1e57575ce4 input=816680301d012b21]*/
 {
-    short *cp1, *cp2;
-    Py_ssize_t len1, len2;
+    const short *cp1, *cp2;
+    Py_ssize_t len;
     double sum_ri_2, sum_aij_ri, result;
 
-    if ( !PyArg_ParseTuple(args, "s#s#:findfactor",
-                           (char**)&cp1, &len1, (char**)&cp2, &len2) )
-        return 0;
-    if ( len1 & 1 || len2 & 1 ) {
+    if (fragment->len & 1 || reference->len & 1) {
         PyErr_SetString(AudioopError, "Strings should be even-sized");
-        return 0;
+        return NULL;
     }
-    if ( len1 != len2 ) {
+    if (fragment->len != reference->len) {
         PyErr_SetString(AudioopError, "Samples should be same size");
-        return 0;
+        return NULL;
     }
-    len2 >>= 1;
-    sum_ri_2 = _sum2(cp2, cp2, len2);
-    sum_aij_ri = _sum2(cp1, cp2, len2);
+    cp1 = (const short *)fragment->buf;
+    cp2 = (const short *)reference->buf;
+    len = fragment->len >> 1;
+    sum_ri_2 = _sum2(cp2, cp2, len);
+    sum_aij_ri = _sum2(cp1, cp2, len);
 
     result = sum_aij_ri / sum_ri_2;
 
@@ -591,37 +692,46 @@
 ** findmax returns the index of the n-sized segment of the input sample
 ** that contains the most energy.
 */
+/*[clinic input]
+audioop.findmax
+
+    fragment: Py_buffer
+    length: Py_ssize_t
+    /
+
+Search fragment for a slice of specified number of samples with maximum energy.
+[clinic start generated code]*/
+
 static PyObject *
-audioop_findmax(PyObject *self, PyObject *args)
+audioop_findmax_impl(PyModuleDef *module, Py_buffer *fragment, Py_ssize_t length)
+/*[clinic end generated code: output=21d0c2a1e5655134 input=2f304801ed42383c]*/
 {
-    short *cp1;
-    Py_ssize_t len1, len2;
+    const short *cp1;
+    Py_ssize_t len1;
     Py_ssize_t j, best_j;
     double aj_m1, aj_lm1;
     double result, best_result;
 
-    if ( !PyArg_ParseTuple(args, "s#n:findmax",
-                           (char**)&cp1, &len1, &len2) )
-        return 0;
-    if ( len1 & 1 ) {
+    if (fragment->len & 1) {
         PyErr_SetString(AudioopError, "Strings should be even-sized");
-        return 0;
+        return NULL;
     }
-    len1 >>= 1;
+    cp1 = (const short *)fragment->buf;
+    len1 = fragment->len >> 1;
 
-    if ( len2 < 0 || len1 < len2 ) {
+    if (length < 0 || len1 < length) {
         PyErr_SetString(AudioopError, "Input sample should be longer");
-        return 0;
+        return NULL;
     }
 
-    result = _sum2(cp1, cp1, len2);
+    result = _sum2(cp1, cp1, length);
 
     best_result = result;
     best_j = 0;
 
-    for ( j=1; j<=len1-len2; j++) {
+    for ( j=1; j<=len1-length; j++) {
         aj_m1 = (double)cp1[j-1];
-        aj_lm1 = (double)cp1[j+len2-1];
+        aj_lm1 = (double)cp1[j+length-1];
 
         result = result + aj_lm1*aj_lm1 - aj_m1*aj_m1;
 
@@ -635,31 +745,34 @@
     return PyLong_FromSsize_t(best_j);
 }
 
+/*[clinic input]
+audioop.avgpp
+
+    fragment: Py_buffer
+    width: int
+    /
+
+Return the average peak-peak value over all samples in the fragment.
+[clinic start generated code]*/
+
 static PyObject *
-audioop_avgpp(PyObject *self, PyObject *args)
+audioop_avgpp_impl(PyModuleDef *module, Py_buffer *fragment, int width)
+/*[clinic end generated code: output=06c8380fd6e34207 input=0b3cceeae420a7d9]*/
 {
-    signed char *cp;
-    Py_ssize_t len, i;
-    int size, val = 0, prevval = 0, prevextremevalid = 0,
-        prevextreme = 0;
+    Py_ssize_t i;
+    int prevval, prevextremevalid = 0, prevextreme = 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))
+    if (!audioop_check_parameters(fragment->len, width))
         return NULL;
-    if (len <= size)
+    if (fragment->len <= width)
         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);
+    prevval = GETRAWSAMPLE(width, fragment->buf, 0);
     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);
+    for (i = width; i < fragment->len; i += width) {
+        int val = GETRAWSAMPLE(width, fragment->buf, i);
         if (val != prevval) {
             diff = val < prevval;
             if (prevdiff == !diff) {
@@ -667,7 +780,12 @@
                 ** extreme value and remember.
                 */
                 if (prevextremevalid) {
-                    sum += fabs((double)prevval - (double)prevextreme);
+                    if (prevval < prevextreme)
+                        sum += (double)((unsigned int)prevextreme -
+                                        (unsigned int)prevval);
+                    else
+                        sum += (double)((unsigned int)prevval -
+                                        (unsigned int)prevextreme);
                     nextreme++;
                 }
                 prevextremevalid = 1;
@@ -684,30 +802,33 @@
     return PyLong_FromUnsignedLong(avg);
 }
 
+/*[clinic input]
+audioop.maxpp
+
+    fragment: Py_buffer
+    width: int
+    /
+
+Return the maximum peak-peak value in the sound fragment.
+[clinic start generated code]*/
+
 static PyObject *
-audioop_maxpp(PyObject *self, PyObject *args)
+audioop_maxpp_impl(PyModuleDef *module, Py_buffer *fragment, int width)
+/*[clinic end generated code: output=c300c0bd7e8535c0 input=671a13e1518f80a1]*/
 {
-    signed char *cp;
-    Py_ssize_t len, i;
-    int size, val = 0, prevval = 0, prevextremevalid = 0,
-        prevextreme = 0;
+    Py_ssize_t i;
+    int prevval, prevextremevalid = 0, prevextreme = 0;
     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))
+    if (!audioop_check_parameters(fragment->len, width))
         return NULL;
-    if (len <= size)
+    if (fragment->len <= width)
         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);
+    prevval = GETRAWSAMPLE(width, fragment->buf, 0);
     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);
+    for (i = width; i < fragment->len; i += width) {
+        int val = GETRAWSAMPLE(width, fragment->buf, i);
         if (val != prevval) {
             diff = val < prevval;
             if (prevdiff == !diff) {
@@ -734,209 +855,212 @@
     return PyLong_FromUnsignedLong(max);
 }
 
+/*[clinic input]
+audioop.cross
+
+    fragment: Py_buffer
+    width: int
+    /
+
+Return the number of zero crossings in the fragment passed as an argument.
+[clinic start generated code]*/
+
 static PyObject *
-audioop_cross(PyObject *self, PyObject *args)
+audioop_cross_impl(PyModuleDef *module, Py_buffer *fragment, int width)
+/*[clinic end generated code: output=99e6572d7d7cdbf1 input=b1b3f15b83f6b41a]*/
 {
-    signed char *cp;
-    Py_ssize_t len, i;
-    int size, val = 0;
+    Py_ssize_t i;
     int prevval;
     Py_ssize_t ncross;
 
-    if ( !PyArg_ParseTuple(args, "s#i:cross", &cp, &len, &size) )
-        return 0;
-    if (!audioop_check_parameters(len, size))
+    if (!audioop_check_parameters(fragment->len, width))
         return NULL;
     ncross = -1;
     prevval = 17; /* Anything <> 0,1 */
-    for ( i=0; i<len; i+= size) {
-        if ( size == 1 )      val = ((int)*CHARP(cp, i)) >> 7;
-        else if ( size == 2 ) val = ((int)*SHORTP(cp, i)) >> 15;
-        else if ( size == 4 ) val = ((int)*LONGP(cp, i)) >> 31;
-        val = val & 1;
-        if ( val != prevval ) ncross++;
+    for (i = 0; i < fragment->len; i += width) {
+        int val = GETRAWSAMPLE(width, fragment->buf, i) < 0;
+        if (val != prevval) ncross++;
         prevval = val;
     }
     return PyLong_FromSsize_t(ncross);
 }
 
+/*[clinic input]
+audioop.mul
+
+    fragment: Py_buffer
+    width: int
+    factor: double
+    /
+
+Return a fragment that has all samples in the original fragment multiplied by the floating-point value factor.
+[clinic start generated code]*/
+
 static PyObject *
-audioop_mul(PyObject *self, PyObject *args)
+audioop_mul_impl(PyModuleDef *module, Py_buffer *fragment, int width, double factor)
+/*[clinic end generated code: output=a697ebbd5852d38f input=c726667baa157d3c]*/
 {
-    signed char *cp, *ncp;
-    Py_ssize_t len, i;
-    int size, val = 0;
-    double factor, fval, maxval, minval;
+    signed char *ncp;
+    Py_ssize_t i;
+    double maxval, minval;
     PyObject *rv;
 
-    if ( !PyArg_ParseTuple(args, "s#id:mul", &cp, &len, &size, &factor ) )
-        return 0;
-    if (!audioop_check_parameters(len, size))
+    if (!audioop_check_parameters(fragment->len, width))
         return NULL;
 
-    maxval = (double) maxvals[size];
-    minval = (double) minvals[size];
+    maxval = (double) maxvals[width];
+    minval = (double) minvals[width];
 
-    rv = PyBytes_FromStringAndSize(NULL, len);
-    if ( rv == 0 )
-        return 0;
+    rv = PyBytes_FromStringAndSize(NULL, fragment->len);
+    if (rv == NULL)
+        return NULL;
     ncp = (signed char *)PyBytes_AsString(rv);
 
-
-    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);
-        fval = (double)val*factor;
-        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;
+    for (i = 0; i < fragment->len; i += width) {
+        double val = GETRAWSAMPLE(width, fragment->buf, i);
+        val *= factor;
+        val = floor(fbound(val, minval, maxval));
+        SETRAWSAMPLE(width, ncp, i, (int)val);
     }
     return rv;
 }
 
+/*[clinic input]
+audioop.tomono
+
+    fragment: Py_buffer
+    width: int
+    lfactor: double
+    rfactor: double
+    /
+
+Convert a stereo fragment to a mono fragment.
+[clinic start generated code]*/
+
 static PyObject *
-audioop_tomono(PyObject *self, PyObject *args)
+audioop_tomono_impl(PyModuleDef *module, Py_buffer *fragment, int width, double lfactor, double rfactor)
+/*[clinic end generated code: output=436e7710521661dd input=c4ec949b3f4dddfa]*/
 {
-    Py_buffer pcp;
     signed char *cp, *ncp;
     Py_ssize_t len, i;
-    int size, val1 = 0, val2 = 0;
-    double fac1, fac2, fval, maxval, minval;
+    double maxval, minval;
     PyObject *rv;
 
-    if ( !PyArg_ParseTuple(args, "s*idd:tomono",
-                           &pcp, &size, &fac1, &fac2 ) )
-        return 0;
-    cp = pcp.buf;
-    len = pcp.len;
-    if (!audioop_check_parameters(len, size)) {
-        PyBuffer_Release(&pcp);
+    cp = fragment->buf;
+    len = fragment->len;
+    if (!audioop_check_parameters(len, width))
         return NULL;
-    }
-    if (((len / size) & 1) != 0) {
+    if (((len / width) & 1) != 0) {
         PyErr_SetString(AudioopError, "not a whole number of frames");
-        PyBuffer_Release(&pcp);
         return NULL;
     }
 
-    maxval = (double) maxvals[size];
-    minval = (double) minvals[size];
+    maxval = (double) maxvals[width];
+    minval = (double) minvals[width];
 
     rv = PyBytes_FromStringAndSize(NULL, len/2);
-    if ( rv == 0 ) {
-        PyBuffer_Release(&pcp);
-        return 0;
-    }
+    if (rv == NULL)
+        return NULL;
     ncp = (signed char *)PyBytes_AsString(rv);
 
-
-    for ( i=0; i < len; i += size*2 ) {
-        if ( size == 1 )      val1 = (int)*CHARP(cp, i);
-        else if ( size == 2 ) val1 = (int)*SHORTP(cp, i);
-        else if ( size == 4 ) val1 = (int)*LONGP(cp, i);
-        if ( size == 1 )      val2 = (int)*CHARP(cp, i+1);
-        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;
-        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;
+    for (i = 0; i < len; i += width*2) {
+        double val1 = GETRAWSAMPLE(width, cp, i);
+        double val2 = GETRAWSAMPLE(width, cp, i + width);
+        double val = val1*lfactor + val2*rfactor;
+        val = floor(fbound(val, minval, maxval));
+        SETRAWSAMPLE(width, ncp, i/2, val);
     }
-    PyBuffer_Release(&pcp);
     return rv;
 }
 
+/*[clinic input]
+audioop.tostereo
+
+    fragment: Py_buffer
+    width: int
+    lfactor: double
+    rfactor: double
+    /
+
+Generate a stereo fragment from a mono fragment.
+[clinic start generated code]*/
+
 static PyObject *
-audioop_tostereo(PyObject *self, PyObject *args)
+audioop_tostereo_impl(PyModuleDef *module, Py_buffer *fragment, int width, double lfactor, double rfactor)
+/*[clinic end generated code: output=6ff50681c87f4c1c input=27b6395ebfdff37a]*/
 {
-    signed char *cp, *ncp;
-    Py_ssize_t len, i;
-    int size, val1, val2, val = 0;
-    double fac1, fac2, fval, maxval, minval;
+    signed char *ncp;
+    Py_ssize_t i;
+    double maxval, minval;
     PyObject *rv;
 
-    if ( !PyArg_ParseTuple(args, "s#idd:tostereo",
-                           &cp, &len, &size, &fac1, &fac2 ) )
-        return 0;
-    if (!audioop_check_parameters(len, size))
+    if (!audioop_check_parameters(fragment->len, width))
         return NULL;
 
-    maxval = (double) maxvals[size];
-    minval = (double) minvals[size];
+    maxval = (double) maxvals[width];
+    minval = (double) minvals[width];
 
-    if (len > PY_SSIZE_T_MAX/2) {
+    if (fragment->len > PY_SSIZE_T_MAX/2) {
         PyErr_SetString(PyExc_MemoryError,
                         "not enough memory for output buffer");
-        return 0;
+        return NULL;
     }
 
-    rv = PyBytes_FromStringAndSize(NULL, len*2);
-    if ( rv == 0 )
-        return 0;
+    rv = PyBytes_FromStringAndSize(NULL, fragment->len*2);
+    if (rv == NULL)
+        return NULL;
     ncp = (signed char *)PyBytes_AsString(rv);
 
-
-    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);
-
-        fval = (double)val*fac1;
-        val1 = (int)floor(fbound(fval, minval, maxval));
-
-        fval = (double)val*fac2;
-        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;
-        else if ( size == 4 ) *LONGP(ncp, i*2) = (Py_Int32)val1;
-
-        if ( size == 1 )      *CHARP(ncp, i*2+1) = (signed char)val2;
-        else if ( size == 2 ) *SHORTP(ncp, i*2+2) = (short)val2;
-        else if ( size == 4 ) *LONGP(ncp, i*2+4) = (Py_Int32)val2;
+    for (i = 0; i < fragment->len; i += width) {
+        double val = GETRAWSAMPLE(width, fragment->buf, i);
+        int val1 = (int)floor(fbound(val*lfactor, minval, maxval));
+        int val2 = (int)floor(fbound(val*rfactor, minval, maxval));
+        SETRAWSAMPLE(width, ncp, i*2, val1);
+        SETRAWSAMPLE(width, ncp, i*2 + width, val2);
     }
     return rv;
 }
 
+/*[clinic input]
+audioop.add
+
+    fragment1: Py_buffer
+    fragment2: Py_buffer
+    width: int
+    /
+
+Return a fragment which is the addition of the two samples passed as parameters.
+[clinic start generated code]*/
+
 static PyObject *
-audioop_add(PyObject *self, PyObject *args)
+audioop_add_impl(PyModuleDef *module, Py_buffer *fragment1, Py_buffer *fragment2, int width)
+/*[clinic end generated code: output=f9218bf9ea75c3f1 input=4a8d4bae4c1605c7]*/
 {
-    signed char *cp1, *cp2, *ncp;
-    Py_ssize_t len1, len2, i;
-    int size, val1 = 0, val2 = 0, minval, maxval, newval;
+    signed char *ncp;
+    Py_ssize_t i;
+    int minval, maxval, newval;
     PyObject *rv;
 
-    if ( !PyArg_ParseTuple(args, "s#s#i:add",
-                      &cp1, &len1, &cp2, &len2, &size ) )
-        return 0;
-    if (!audioop_check_parameters(len1, size))
+    if (!audioop_check_parameters(fragment1->len, width))
         return NULL;
-    if ( len1 != len2 ) {
+    if (fragment1->len != fragment2->len) {
         PyErr_SetString(AudioopError, "Lengths should be the same");
-        return 0;
+        return NULL;
     }
 
-    maxval = maxvals[size];
-    minval = minvals[size];
+    maxval = maxvals[width];
+    minval = minvals[width];
 
-    rv = PyBytes_FromStringAndSize(NULL, len1);
-    if ( rv == 0 )
-        return 0;
+    rv = PyBytes_FromStringAndSize(NULL, fragment1->len);
+    if (rv == NULL)
+        return NULL;
     ncp = (signed char *)PyBytes_AsString(rv);
 
-    for ( i=0; i < len1; i += size ) {
-        if ( size == 1 )      val1 = (int)*CHARP(cp1, i);
-        else if ( size == 2 ) val1 = (int)*SHORTP(cp1, i);
-        else if ( size == 4 ) val1 = (int)*LONGP(cp1, i);
+    for (i = 0; i < fragment1->len; i += width) {
+        int val1 = GETRAWSAMPLE(width, fragment1->buf, i);
+        int val2 = GETRAWSAMPLE(width, fragment2->buf, i);
 
-        if ( size == 1 )      val2 = (int)*CHARP(cp2, i);
-        else if ( size == 2 ) val2 = (int)*SHORTP(cp2, i);
-        else if ( size == 4 ) val2 = (int)*LONGP(cp2, i);
-
-        if (size < 4) {
+        if (width < 4) {
             newval = val1 + val2;
             /* truncate in case of overflow */
             if (newval > maxval)
@@ -950,123 +1074,175 @@
             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;
-        else if ( size == 4 ) *LONGP(ncp, i) = (Py_Int32)newval;
+        SETRAWSAMPLE(width, ncp, i, newval);
     }
     return rv;
 }
 
+/*[clinic input]
+audioop.bias
+
+    fragment: Py_buffer
+    width: int
+    bias: int
+    /
+
+Return a fragment that is the original fragment with a bias added to each sample.
+[clinic start generated code]*/
+
 static PyObject *
-audioop_bias(PyObject *self, PyObject *args)
+audioop_bias_impl(PyModuleDef *module, Py_buffer *fragment, int width, int bias)
+/*[clinic end generated code: output=8ec80b3f5d510a51 input=2b5cce5c3bb4838c]*/
 {
-    signed char *cp, *ncp;
-    Py_ssize_t len, i;
-    int size, bias;
+    signed char *ncp;
+    Py_ssize_t i;
     unsigned int val = 0, mask;
     PyObject *rv;
 
-    if ( !PyArg_ParseTuple(args, "s#ii:bias",
-                      &cp, &len, &size , &bias) )
-        return 0;
-
-    if (!audioop_check_parameters(len, size))
+    if (!audioop_check_parameters(fragment->len, width))
         return NULL;
 
-    rv = PyBytes_FromStringAndSize(NULL, len);
-    if ( rv == 0 )
-        return 0;
+    rv = PyBytes_FromStringAndSize(NULL, fragment->len);
+    if (rv == NULL)
+        return NULL;
     ncp = (signed char *)PyBytes_AsString(rv);
 
-    mask = masks[size];
+    mask = masks[width];
 
-    for ( i=0; i < len; i += size ) {
-        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);
+    for (i = 0; i < fragment->len; i += width) {
+        if (width == 1)
+            val = GETINTX(unsigned char, fragment->buf, i);
+        else if (width == 2)
+            val = GETINTX(unsigned short, fragment->buf, i);
+        else if (width == 3)
+            val = ((unsigned int)GETINT24(fragment->buf, i)) & 0xffffffu;
+        else {
+            assert(width == 4);
+            val = GETINTX(PY_UINT32_T, fragment->buf, i);
+        }
 
         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;
+        if (width == 1)
+            SETINTX(unsigned char, ncp, i, val);
+        else if (width == 2)
+            SETINTX(unsigned short, ncp, i, val);
+        else if (width == 3)
+            SETINT24(ncp, i, (int)val);
+        else {
+            assert(width == 4);
+            SETINTX(PY_UINT32_T, ncp, i, val);
+        }
     }
     return rv;
 }
 
+/*[clinic input]
+audioop.reverse
+
+    fragment: Py_buffer
+    width: int
+    /
+
+Reverse the samples in a fragment and returns the modified fragment.
+[clinic start generated code]*/
+
 static PyObject *
-audioop_reverse(PyObject *self, PyObject *args)
+audioop_reverse_impl(PyModuleDef *module, Py_buffer *fragment, int width)
+/*[clinic end generated code: output=6ec3c91337f5925e input=668f890cf9f9d225]*/
 {
-    signed char *cp;
     unsigned char *ncp;
-    Py_ssize_t len, i, j;
-    int size, val = 0;
+    Py_ssize_t i;
     PyObject *rv;
 
-    if ( !PyArg_ParseTuple(args, "s#i:reverse",
-                      &cp, &len, &size) )
-        return 0;
-
-    if (!audioop_check_parameters(len, size))
+    if (!audioop_check_parameters(fragment->len, width))
         return NULL;
 
-    rv = PyBytes_FromStringAndSize(NULL, len);
-    if ( rv == 0 )
-        return 0;
+    rv = PyBytes_FromStringAndSize(NULL, fragment->len);
+    if (rv == NULL)
+        return NULL;
     ncp = (unsigned char *)PyBytes_AsString(rv);
 
-    for ( i=0; i < len; i += size ) {
-        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 >> 24);
-        else if ( size == 2 ) *SHORTP(ncp, j) = (short)(val >> 16);
-        else if ( size == 4 ) *LONGP(ncp, j) = (Py_Int32)val;
+    for (i = 0; i < fragment->len; i += width) {
+        int val = GETRAWSAMPLE(width, fragment->buf, i);
+        SETRAWSAMPLE(width, ncp, fragment->len - i - width, val);
     }
     return rv;
 }
 
+/*[clinic input]
+audioop.byteswap
+
+    fragment: Py_buffer
+    width: int
+    /
+
+Convert big-endian samples to little-endian and vice versa.
+[clinic start generated code]*/
+
 static PyObject *
-audioop_lin2lin(PyObject *self, PyObject *args)
+audioop_byteswap_impl(PyModuleDef *module, Py_buffer *fragment, int width)
+/*[clinic end generated code: output=bfe4aa584b7a3f5b input=fae7611ceffa5c82]*/
 {
-    signed char *cp;
     unsigned char *ncp;
-    Py_ssize_t len, i, j;
-    int size, size2, val = 0;
+    Py_ssize_t i;
     PyObject *rv;
 
-    if ( !PyArg_ParseTuple(args, "s#ii:lin2lin",
-                      &cp, &len, &size, &size2) )
-        return 0;
-
-    if (!audioop_check_parameters(len, size))
-        return NULL;
-    if (!audioop_check_size(size2))
+    if (!audioop_check_parameters(fragment->len, width))
         return NULL;
 
-    if (len/size > PY_SSIZE_T_MAX/size2) {
+    rv = PyBytes_FromStringAndSize(NULL, fragment->len);
+    if (rv == NULL)
+        return NULL;
+    ncp = (unsigned char *)PyBytes_AsString(rv);
+
+    for (i = 0; i < fragment->len; i += width) {
+        int j;
+        for (j = 0; j < width; j++)
+            ncp[i + width - 1 - j] = ((unsigned char *)fragment->buf)[i + j];
+    }
+    return rv;
+}
+
+/*[clinic input]
+audioop.lin2lin
+
+    fragment: Py_buffer
+    width: int
+    newwidth: int
+    /
+
+Convert samples between 1-, 2-, 3- and 4-byte formats.
+[clinic start generated code]*/
+
+static PyObject *
+audioop_lin2lin_impl(PyModuleDef *module, Py_buffer *fragment, int width, int newwidth)
+/*[clinic end generated code: output=3f9468a74472a93e input=5ce08c8aa2f24d96]*/
+{
+    unsigned char *ncp;
+    Py_ssize_t i, j;
+    PyObject *rv;
+
+    if (!audioop_check_parameters(fragment->len, width))
+        return NULL;
+    if (!audioop_check_size(newwidth))
+        return NULL;
+
+    if (fragment->len/width > PY_SSIZE_T_MAX/newwidth) {
         PyErr_SetString(PyExc_MemoryError,
                         "not enough memory for output buffer");
-        return 0;
+        return NULL;
     }
-    rv = PyBytes_FromStringAndSize(NULL, (len/size)*size2);
-    if ( rv == 0 )
-        return 0;
+    rv = PyBytes_FromStringAndSize(NULL, (fragment->len/width)*newwidth);
+    if (rv == NULL)
+        return NULL;
     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)) << 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 >> 24);
-        else if ( size2 == 2 ) *SHORTP(ncp, j) = (short)(val >> 16);
-        else if ( size2 == 4 ) *LONGP(ncp, j) = (Py_Int32)val;
+    for (i = j = 0; i < fragment->len; i += width, j += newwidth) {
+        int val = GETSAMPLE32(width, fragment->buf, i);
+        SETSAMPLE32(newwidth, ncp, j, val);
     }
     return rv;
 }
@@ -1082,29 +1258,39 @@
     return a;
 }
 
+/*[clinic input]
+audioop.ratecv
+
+    fragment: Py_buffer
+    width: int
+    nchannels: int
+    inrate: int
+    outrate: int
+    state: object
+    weightA: int = 1
+    weightB: int = 0
+    /
+
+Convert the frame rate of the input fragment.
+[clinic start generated code]*/
+
 static PyObject *
-audioop_ratecv(PyObject *self, PyObject *args)
+audioop_ratecv_impl(PyModuleDef *module, Py_buffer *fragment, int width, int nchannels, int inrate, int outrate, PyObject *state, int weightA, int weightB)
+/*[clinic end generated code: output=5585dddc4b5ff236 input=aff3acdc94476191]*/
 {
     char *cp, *ncp;
     Py_ssize_t len;
-    int size, nchannels, inrate, outrate, weightA, weightB;
     int chan, d, *prev_i, *cur_i, cur_o;
-    PyObject *state, *samps, *str, *rv = NULL;
+    PyObject *samps, *str, *rv = NULL;
     int bytes_per_frame;
 
-    weightA = 1;
-    weightB = 0;
-    if (!PyArg_ParseTuple(args, "s#iiiiO|ii:ratecv", &cp, &len, &size,
-                          &nchannels, &inrate, &outrate, &state,
-                          &weightA, &weightB))
-        return NULL;
-    if (!audioop_check_size(size))
+    if (!audioop_check_size(width))
         return NULL;
     if (nchannels < 1) {
         PyErr_SetString(AudioopError, "# of channels should be >= 1");
         return NULL;
     }
-    if (size > INT_MAX / nchannels) {
+    if (width > 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. */
@@ -1112,13 +1298,14 @@
                         "width * nchannels too big for a C int");
         return NULL;
     }
-    bytes_per_frame = size * nchannels;
+    bytes_per_frame = width * nchannels;
     if (weightA < 1 || weightB < 0) {
         PyErr_SetString(AudioopError,
             "weightA should be >= 1, weightB should be >= 0");
         return NULL;
     }
-    if (len % bytes_per_frame != 0) {
+    assert(fragment->len >= 0);
+    if (fragment->len % bytes_per_frame != 0) {
         PyErr_SetString(AudioopError, "not a whole number of frames");
         return NULL;
     }
@@ -1138,16 +1325,16 @@
     if ((size_t)nchannels > PY_SIZE_MAX/sizeof(int)) {
         PyErr_SetString(PyExc_MemoryError,
                         "not enough memory for output buffer");
-        return 0;
+        return NULL;
     }
-    prev_i = (int *) malloc(nchannels * sizeof(int));
-    cur_i = (int *) malloc(nchannels * sizeof(int));
+    prev_i = (int *) PyMem_Malloc(nchannels * sizeof(int));
+    cur_i = (int *) PyMem_Malloc(nchannels * sizeof(int));
     if (prev_i == NULL || cur_i == NULL) {
         (void) PyErr_NoMemory();
         goto exit;
     }
 
-    len /= bytes_per_frame; /* # of frames */
+    len = fragment->len / bytes_per_frame; /* # of frames */
 
     if (state == Py_None) {
         d = -outrate;
@@ -1184,7 +1371,7 @@
            case ceiling(len/inrate) * outrate. */
 
         /* compute ceiling(len/inrate) without overflow */
-        Py_ssize_t q = len > 0 ? 1 + (len - 1) / inrate : 0;
+        Py_ssize_t q = 1 + (len - 1) / inrate;
         if (outrate > PY_SSIZE_T_MAX / q / bytes_per_frame)
             str = NULL;
         else
@@ -1197,6 +1384,7 @@
         goto exit;
     }
     ncp = PyBytes_AsString(str);
+    cp = fragment->buf;
 
     for (;;) {
         while (d < 0) {
@@ -1227,13 +1415,8 @@
             }
             for (chan = 0; chan < nchannels; chan++) {
                 prev_i[chan] = cur_i[chan];
-                if (size == 1)
-                    cur_i[chan] = ((int)*CHARP(cp, 0)) << 24;
-                else if (size == 2)
-                    cur_i[chan] = ((int)*SHORTP(cp, 0)) << 16;
-                else if (size == 4)
-                    cur_i[chan] = (int)*LONGP(cp, 0);
-                cp += size;
+                cur_i[chan] = GETSAMPLE32(width, cp, 0);
+                cp += width;
                 /* implements a simple digital filter */
                 cur_i[chan] = (int)(
                     ((double)weightA * (double)cur_i[chan] +
@@ -1248,184 +1431,193 @@
                 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 >> 24);
-                else if (size == 2)
-                    *SHORTP(ncp, 0) = (short)(cur_o >> 16);
-                else if (size == 4)
-                    *LONGP(ncp, 0) = (Py_Int32)(cur_o);
-                ncp += size;
+                SETSAMPLE32(width, ncp, 0, cur_o);
+                ncp += width;
             }
             d -= inrate;
         }
     }
   exit:
-    if (prev_i != NULL)
-        free(prev_i);
-    if (cur_i != NULL)
-        free(cur_i);
+    PyMem_Free(prev_i);
+    PyMem_Free(cur_i);
     return rv;
 }
 
+/*[clinic input]
+audioop.lin2ulaw
+
+    fragment: Py_buffer
+    width: int
+    /
+
+Convert samples in the audio fragment to u-LAW encoding.
+[clinic start generated code]*/
+
 static PyObject *
-audioop_lin2ulaw(PyObject *self, PyObject *args)
+audioop_lin2ulaw_impl(PyModuleDef *module, Py_buffer *fragment, int width)
+/*[clinic end generated code: output=26263cc877c5e1bc input=2450d1b870b6bac2]*/
 {
-    signed char *cp;
     unsigned char *ncp;
-    Py_ssize_t len, i;
-    int size, val = 0;
+    Py_ssize_t i;
     PyObject *rv;
 
-    if ( !PyArg_ParseTuple(args, "s#i:lin2ulaw",
-                           &cp, &len, &size) )
-        return 0 ;
-
-    if (!audioop_check_parameters(len, size))
+    if (!audioop_check_parameters(fragment->len, width))
         return NULL;
 
-    rv = PyBytes_FromStringAndSize(NULL, len/size);
-    if ( rv == 0 )
-        return 0;
+    rv = PyBytes_FromStringAndSize(NULL, fragment->len/width);
+    if (rv == NULL)
+        return NULL;
     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;
-
-        *ncp++ = st_14linear2ulaw(val);
+    for (i = 0; i < fragment->len; i += width) {
+        int val = GETSAMPLE32(width, fragment->buf, i);
+        *ncp++ = st_14linear2ulaw(val >> 18);
     }
     return rv;
 }
 
+/*[clinic input]
+audioop.ulaw2lin
+
+    fragment: Py_buffer
+    width: int
+    /
+
+Convert sound fragments in u-LAW encoding to linearly encoded sound fragments.
+[clinic start generated code]*/
+
 static PyObject *
-audioop_ulaw2lin(PyObject *self, PyObject *args)
+audioop_ulaw2lin_impl(PyModuleDef *module, Py_buffer *fragment, int width)
+/*[clinic end generated code: output=9864cb34e3a1d876 input=45d53ddce5be7d06]*/
 {
     unsigned char *cp;
-    unsigned char cval;
     signed char *ncp;
-    Py_ssize_t len, i;
-    int size, val;
+    Py_ssize_t i;
     PyObject *rv;
 
-    if ( !PyArg_ParseTuple(args, "s#i:ulaw2lin",
-                           &cp, &len, &size) )
-        return 0;
-
-    if (!audioop_check_size(size))
+    if (!audioop_check_size(width))
         return NULL;
 
-    if (len > PY_SSIZE_T_MAX/size) {
+    if (fragment->len > PY_SSIZE_T_MAX/width) {
         PyErr_SetString(PyExc_MemoryError,
                         "not enough memory for output buffer");
-        return 0;
+        return NULL;
     }
-    rv = PyBytes_FromStringAndSize(NULL, len*size);
-    if ( rv == 0 )
-        return 0;
+    rv = PyBytes_FromStringAndSize(NULL, fragment->len*width);
+    if (rv == NULL)
+        return NULL;
     ncp = (signed char *)PyBytes_AsString(rv);
 
-    for ( i=0; i < len*size; i += size ) {
-        cval = *cp++;
-        val = st_ulaw2linear16(cval);
-
-        if ( size == 1 )      *CHARP(ncp, i) = (signed char)(val >> 8);
-        else if ( size == 2 ) *SHORTP(ncp, i) = (short)(val);
-        else if ( size == 4 ) *LONGP(ncp, i) = (Py_Int32)(val<<16);
+    cp = fragment->buf;
+    for (i = 0; i < fragment->len*width; i += width) {
+        int val = st_ulaw2linear16(*cp++) << 16;
+        SETSAMPLE32(width, ncp, i, val);
     }
     return rv;
 }
 
+/*[clinic input]
+audioop.lin2alaw
+
+    fragment: Py_buffer
+    width: int
+    /
+
+Convert samples in the audio fragment to a-LAW encoding.
+[clinic start generated code]*/
+
 static PyObject *
-audioop_lin2alaw(PyObject *self, PyObject *args)
+audioop_lin2alaw_impl(PyModuleDef *module, Py_buffer *fragment, int width)
+/*[clinic end generated code: output=d5bf14bd0fe6fdcd input=ffb1ef8bb39da945]*/
 {
-    signed char *cp;
     unsigned char *ncp;
-    Py_ssize_t len, i;
-    int size, val = 0;
+    Py_ssize_t i;
     PyObject *rv;
 
-    if ( !PyArg_ParseTuple(args, "s#i:lin2alaw",
-                           &cp, &len, &size) )
-        return 0;
-
-    if (!audioop_check_parameters(len, size))
+    if (!audioop_check_parameters(fragment->len, width))
         return NULL;
 
-    rv = PyBytes_FromStringAndSize(NULL, len/size);
-    if ( rv == 0 )
-        return 0;
+    rv = PyBytes_FromStringAndSize(NULL, fragment->len/width);
+    if (rv == NULL)
+        return NULL;
     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;
-
-        *ncp++ = st_linear2alaw(val);
+    for (i = 0; i < fragment->len; i += width) {
+        int val = GETSAMPLE32(width, fragment->buf, i);
+        *ncp++ = st_linear2alaw(val >> 19);
     }
     return rv;
 }
 
+/*[clinic input]
+audioop.alaw2lin
+
+    fragment: Py_buffer
+    width: int
+    /
+
+Convert sound fragments in a-LAW encoding to linearly encoded sound fragments.
+[clinic start generated code]*/
+
 static PyObject *
-audioop_alaw2lin(PyObject *self, PyObject *args)
+audioop_alaw2lin_impl(PyModuleDef *module, Py_buffer *fragment, int width)
+/*[clinic end generated code: output=d2b604ddd036e1cd input=4140626046cd1772]*/
 {
     unsigned char *cp;
-    unsigned char cval;
     signed char *ncp;
-    Py_ssize_t len, i;
-    int size, val;
+    Py_ssize_t i;
+    int val;
     PyObject *rv;
 
-    if ( !PyArg_ParseTuple(args, "s#i:alaw2lin",
-                           &cp, &len, &size) )
-        return 0;
-
-    if (!audioop_check_size(size))
+    if (!audioop_check_size(width))
         return NULL;
 
-    if (len > PY_SSIZE_T_MAX/size) {
+    if (fragment->len > PY_SSIZE_T_MAX/width) {
         PyErr_SetString(PyExc_MemoryError,
                         "not enough memory for output buffer");
-        return 0;
+        return NULL;
     }
-    rv = PyBytes_FromStringAndSize(NULL, len*size);
-    if ( rv == 0 )
-        return 0;
+    rv = PyBytes_FromStringAndSize(NULL, fragment->len*width);
+    if (rv == NULL)
+        return NULL;
     ncp = (signed char *)PyBytes_AsString(rv);
+    cp = fragment->buf;
 
-    for ( i=0; i < len*size; i += size ) {
-        cval = *cp++;
-        val = st_alaw2linear16(cval);
-
-        if ( size == 1 )      *CHARP(ncp, i) = (signed char)(val >> 8);
-        else if ( size == 2 ) *SHORTP(ncp, i) = (short)(val);
-        else if ( size == 4 ) *LONGP(ncp, i) = (Py_Int32)(val<<16);
+    for (i = 0; i < fragment->len*width; i += width) {
+        val = st_alaw2linear16(*cp++) << 16;
+        SETSAMPLE32(width, ncp, i, val);
     }
     return rv;
 }
 
+/*[clinic input]
+audioop.lin2adpcm
+
+    fragment: Py_buffer
+    width: int
+    state: object
+    /
+
+Convert samples to 4 bit Intel/DVI ADPCM encoding.
+[clinic start generated code]*/
+
 static PyObject *
-audioop_lin2adpcm(PyObject *self, PyObject *args)
+audioop_lin2adpcm_impl(PyModuleDef *module, Py_buffer *fragment, int width, PyObject *state)
+/*[clinic end generated code: output=4654c29d2731fafe input=12919d549b90c90a]*/
 {
-    signed char *cp;
     signed char *ncp;
-    Py_ssize_t len, i;
-    int size, val = 0, step, valpred, delta,
+    Py_ssize_t i;
+    int step, valpred, delta,
         index, sign, vpdiff, diff;
-    PyObject *rv, *state, *str;
+    PyObject *rv = NULL, *str;
     int outputbuffer = 0, bufferstep;
 
-    if ( !PyArg_ParseTuple(args, "s#iO:lin2adpcm",
-                           &cp, &len, &size, &state) )
-        return 0;
-
-    if (!audioop_check_parameters(len, size))
+    if (!audioop_check_parameters(fragment->len, width))
         return NULL;
 
-    str = PyBytes_FromStringAndSize(NULL, len/(size*2));
-    if ( str == 0 )
-        return 0;
+    str = PyBytes_FromStringAndSize(NULL, fragment->len/(width*2));
+    if (str == NULL)
+        return NULL;
     ncp = (signed char *)PyBytes_AsString(str);
 
     /* Decode state, should have (value, step) */
@@ -1433,21 +1625,28 @@
         /* First time, it seems. Set defaults */
         valpred = 0;
         index = 0;
-    } else if ( !PyArg_ParseTuple(state, "ii", &valpred, &index) )
-        return 0;
+    } else if (!PyTuple_Check(state)) {
+        PyErr_SetString(PyExc_TypeError, "state must be a tuple or None");
+        goto exit;
+    } else if (!PyArg_ParseTuple(state, "ii", &valpred, &index)) {
+        goto exit;
+    }
 
     step = stepsizeTable[index];
     bufferstep = 1;
 
-    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;
+    for (i = 0; i < fragment->len; i += width) {
+        int val = GETSAMPLE32(width, fragment->buf, i) >> 16;
 
         /* Step 1 - compute difference with previous value */
-        diff = val - valpred;
-        sign = (diff < 0) ? 8 : 0;
-        if ( sign ) diff = (-diff);
+        if (val < valpred) {
+            diff = valpred - val;
+            sign = 8;
+        }
+        else {
+            diff = val - valpred;
+            sign = 0;
+        }
 
         /* Step 2 - Divide and clamp */
         /* Note:
@@ -1507,25 +1706,35 @@
         bufferstep = !bufferstep;
     }
     rv = Py_BuildValue("(O(ii))", str, valpred, index);
+
+  exit:
     Py_DECREF(str);
     return rv;
 }
 
+/*[clinic input]
+audioop.adpcm2lin
+
+    fragment: Py_buffer
+    width: int
+    state: object
+    /
+
+Decode an Intel/DVI ADPCM coded fragment to a linear fragment.
+[clinic start generated code]*/
+
 static PyObject *
-audioop_adpcm2lin(PyObject *self, PyObject *args)
+audioop_adpcm2lin_impl(PyModuleDef *module, Py_buffer *fragment, int width, PyObject *state)
+/*[clinic end generated code: output=371965cdcc0aa69b input=f5221144f5ca9ef0]*/
 {
     signed char *cp;
     signed char *ncp;
-    Py_ssize_t len, i;
-    int size, valpred, step, delta, index, sign, vpdiff;
-    PyObject *rv, *str, *state;
+    Py_ssize_t i, outlen;
+    int valpred, step, delta, index, sign, vpdiff;
+    PyObject *rv, *str;
     int inputbuffer = 0, bufferstep;
 
-    if ( !PyArg_ParseTuple(args, "s#iO:adpcm2lin",
-                           &cp, &len, &size, &state) )
-        return 0;
-
-    if (!audioop_check_size(size))
+    if (!audioop_check_size(width))
         return NULL;
 
     /* Decode state, should have (value, step) */
@@ -1533,23 +1742,28 @@
         /* First time, it seems. Set defaults */
         valpred = 0;
         index = 0;
-    } else if ( !PyArg_ParseTuple(state, "ii", &valpred, &index) )
-        return 0;
+    } else if (!PyTuple_Check(state)) {
+        PyErr_SetString(PyExc_TypeError, "state must be a tuple or None");
+        return NULL;
+    } else if (!PyArg_ParseTuple(state, "ii", &valpred, &index))
+        return NULL;
 
-    if (len > (PY_SSIZE_T_MAX/2)/size) {
+    if (fragment->len > (PY_SSIZE_T_MAX/2)/width) {
         PyErr_SetString(PyExc_MemoryError,
                         "not enough memory for output buffer");
-        return 0;
+        return NULL;
     }
-    str = PyBytes_FromStringAndSize(NULL, len*size*2);
-    if ( str == 0 )
-        return 0;
+    outlen = fragment->len*width*2;
+    str = PyBytes_FromStringAndSize(NULL, outlen);
+    if (str == NULL)
+        return NULL;
     ncp = (signed char *)PyBytes_AsString(str);
+    cp = fragment->buf;
 
     step = stepsizeTable[index];
     bufferstep = 0;
 
-    for ( i=0; i < len*size*2; i += size ) {
+    for (i = 0; i < outlen; i += width) {
         /* Step 1 - get the delta value and compute next index */
         if ( bufferstep ) {
             delta = inputbuffer & 0xf;
@@ -1594,9 +1808,7 @@
         step = stepsizeTable[index];
 
         /* Step 6 - Output value */
-        if ( size == 1 ) *CHARP(ncp, i) = (signed char)(valpred >> 8);
-        else if ( size == 2 ) *SHORTP(ncp, i) = (short)(valpred);
-        else if ( size == 4 ) *LONGP(ncp, i) = (Py_Int32)(valpred<<16);
+        SETSAMPLE32(width, ncp, i, valpred << 16);
     }
 
     rv = Py_BuildValue("(O(ii))", str, valpred, index);
@@ -1604,32 +1816,35 @@
     return rv;
 }
 
+#include "clinic/audioop.c.h"
+
 static PyMethodDef audioop_methods[] = {
-    { "max", audioop_max, METH_VARARGS },
-    { "minmax", audioop_minmax, METH_VARARGS },
-    { "avg", audioop_avg, METH_VARARGS },
-    { "maxpp", audioop_maxpp, METH_VARARGS },
-    { "avgpp", audioop_avgpp, METH_VARARGS },
-    { "rms", audioop_rms, METH_VARARGS },
-    { "findfit", audioop_findfit, METH_VARARGS },
-    { "findmax", audioop_findmax, METH_VARARGS },
-    { "findfactor", audioop_findfactor, METH_VARARGS },
-    { "cross", audioop_cross, METH_VARARGS },
-    { "mul", audioop_mul, METH_VARARGS },
-    { "add", audioop_add, METH_VARARGS },
-    { "bias", audioop_bias, METH_VARARGS },
-    { "ulaw2lin", audioop_ulaw2lin, METH_VARARGS },
-    { "lin2ulaw", audioop_lin2ulaw, METH_VARARGS },
-    { "alaw2lin", audioop_alaw2lin, METH_VARARGS },
-    { "lin2alaw", audioop_lin2alaw, METH_VARARGS },
-    { "lin2lin", audioop_lin2lin, METH_VARARGS },
-    { "adpcm2lin", audioop_adpcm2lin, METH_VARARGS },
-    { "lin2adpcm", audioop_lin2adpcm, METH_VARARGS },
-    { "tomono", audioop_tomono, METH_VARARGS },
-    { "tostereo", audioop_tostereo, METH_VARARGS },
-    { "getsample", audioop_getsample, METH_VARARGS },
-    { "reverse", audioop_reverse, METH_VARARGS },
-    { "ratecv", audioop_ratecv, METH_VARARGS },
+    AUDIOOP_MAX_METHODDEF
+    AUDIOOP_MINMAX_METHODDEF
+    AUDIOOP_AVG_METHODDEF
+    AUDIOOP_MAXPP_METHODDEF
+    AUDIOOP_AVGPP_METHODDEF
+    AUDIOOP_RMS_METHODDEF
+    AUDIOOP_FINDFIT_METHODDEF
+    AUDIOOP_FINDMAX_METHODDEF
+    AUDIOOP_FINDFACTOR_METHODDEF
+    AUDIOOP_CROSS_METHODDEF
+    AUDIOOP_MUL_METHODDEF
+    AUDIOOP_ADD_METHODDEF
+    AUDIOOP_BIAS_METHODDEF
+    AUDIOOP_ULAW2LIN_METHODDEF
+    AUDIOOP_LIN2ULAW_METHODDEF
+    AUDIOOP_ALAW2LIN_METHODDEF
+    AUDIOOP_LIN2ALAW_METHODDEF
+    AUDIOOP_LIN2LIN_METHODDEF
+    AUDIOOP_ADPCM2LIN_METHODDEF
+    AUDIOOP_LIN2ADPCM_METHODDEF
+    AUDIOOP_TOMONO_METHODDEF
+    AUDIOOP_TOSTEREO_METHODDEF
+    AUDIOOP_GETSAMPLE_METHODDEF
+    AUDIOOP_REVERSE_METHODDEF
+    AUDIOOP_BYTESWAP_METHODDEF
+    AUDIOOP_RATECV_METHODDEF
     { 0,          0 }
 };
 
diff --git a/Modules/binascii.c b/Modules/binascii.c
index a84badc..86b63bb 100644
--- a/Modules/binascii.c
+++ b/Modules/binascii.c
@@ -183,6 +183,27 @@
     0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0,
 };
 
+/*[clinic input]
+output preset file
+module binascii
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=44c6f840ce708f0c]*/
+
+/*[python input]
+
+class ascii_buffer_converter(CConverter):
+    type = 'Py_buffer'
+    converter = 'ascii_buffer_converter'
+    impl_by_reference = True
+    c_default = "{NULL, NULL}"
+
+    def cleanup(self):
+        name = self.name
+        return "".join(["if (", name, ".obj)\n   PyBuffer_Release(&", name, ");\n"])
+
+[python start generated code]*/
+/*[python end generated code: output=da39a3ee5e6b4b0d input=3eb7b63610da92cd]*/
+
 static int
 ascii_buffer_converter(PyObject *arg, Py_buffer *buf)
 {
@@ -220,13 +241,21 @@
     return Py_CLEANUP_SUPPORTED;
 }
 
+#include "clinic/binascii.c.h"
 
-PyDoc_STRVAR(doc_a2b_uu, "(ascii) -> bin. Decode a line of uuencoded data");
+/*[clinic input]
+binascii.a2b_uu
+
+    data: ascii_buffer
+    /
+
+Decode a line of uuencoded data.
+[clinic start generated code]*/
 
 static PyObject *
-binascii_a2b_uu(PyObject *self, PyObject *args)
+binascii_a2b_uu_impl(PyModuleDef *module, Py_buffer *data)
+/*[clinic end generated code: output=5779f39b0b48459f input=7cafeaf73df63d1c]*/
 {
-    Py_buffer pascii;
     unsigned char *ascii_data, *bin_data;
     int leftbits = 0;
     unsigned char this_ch;
@@ -234,10 +263,8 @@
     PyObject *rv;
     Py_ssize_t ascii_len, bin_len;
 
-    if ( !PyArg_ParseTuple(args, "O&:a2b_uu", ascii_buffer_converter, &pascii) )
-        return NULL;
-    ascii_data = pascii.buf;
-    ascii_len = pascii.len;
+    ascii_data = data->buf;
+    ascii_len = data->len;
 
     assert(ascii_len >= 0);
 
@@ -246,10 +273,8 @@
     ascii_len--;
 
     /* Allocate the buffer */
-    if ( (rv=PyBytes_FromStringAndSize(NULL, bin_len)) == NULL ) {
-        PyBuffer_Release(&pascii);
+    if ( (rv=PyBytes_FromStringAndSize(NULL, bin_len)) == NULL )
         return NULL;
-    }
     bin_data = (unsigned char *)PyBytes_AS_STRING(rv);
 
     for( ; bin_len > 0 ; ascii_len--, ascii_data++ ) {
@@ -269,7 +294,6 @@
             */
             if ( this_ch < ' ' || this_ch > (' ' + 64)) {
                 PyErr_SetString(Error, "Illegal char");
-                PyBuffer_Release(&pascii);
                 Py_DECREF(rv);
                 return NULL;
             }
@@ -298,21 +322,26 @@
         if ( this_ch != ' ' && this_ch != ' '+64 &&
              this_ch != '\n' && this_ch != '\r' ) {
             PyErr_SetString(Error, "Trailing garbage");
-            PyBuffer_Release(&pascii);
             Py_DECREF(rv);
             return NULL;
         }
     }
-    PyBuffer_Release(&pascii);
     return rv;
 }
 
-PyDoc_STRVAR(doc_b2a_uu, "(bin) -> ascii. Uuencode line of data");
+/*[clinic input]
+binascii.b2a_uu
+
+    data: Py_buffer
+    /
+
+Uuencode line of data.
+[clinic start generated code]*/
 
 static PyObject *
-binascii_b2a_uu(PyObject *self, PyObject *args)
+binascii_b2a_uu_impl(PyModuleDef *module, Py_buffer *data)
+/*[clinic end generated code: output=181021b69bb9a414 input=00fdf458ce8b465b]*/
 {
-    Py_buffer pbin;
     unsigned char *ascii_data, *bin_data;
     int leftbits = 0;
     unsigned char this_ch;
@@ -320,22 +349,17 @@
     PyObject *rv;
     Py_ssize_t bin_len;
 
-    if ( !PyArg_ParseTuple(args, "y*:b2a_uu", &pbin) )
-        return NULL;
-    bin_data = pbin.buf;
-    bin_len = pbin.len;
+    bin_data = data->buf;
+    bin_len = data->len;
     if ( bin_len > 45 ) {
         /* The 45 is a limit that appears in all uuencode's */
         PyErr_SetString(Error, "At most 45 bytes at once");
-        PyBuffer_Release(&pbin);
         return NULL;
     }
 
     /* We're lazy and allocate to much (fixed up later) */
-    if ( (rv=PyBytes_FromStringAndSize(NULL, 2 + (bin_len+2)/3*4)) == NULL ) {
-        PyBuffer_Release(&pbin);
+    if ( (rv=PyBytes_FromStringAndSize(NULL, 2 + (bin_len+2)/3*4)) == NULL )
         return NULL;
-    }
     ascii_data = (unsigned char *)PyBytes_AS_STRING(rv);
 
     /* Store the length */
@@ -361,10 +385,8 @@
     if (_PyBytes_Resize(&rv,
                        (ascii_data -
                         (unsigned char *)PyBytes_AS_STRING(rv))) < 0) {
-        Py_DECREF(rv);
-        rv = NULL;
+        Py_CLEAR(rv);
     }
-    PyBuffer_Release(&pbin);
     return rv;
 }
 
@@ -394,12 +416,19 @@
     return ret;
 }
 
-PyDoc_STRVAR(doc_a2b_base64, "(ascii) -> bin. Decode a line of base64 data");
+/*[clinic input]
+binascii.a2b_base64
+
+    data: ascii_buffer
+    /
+
+Decode a line of base64 data.
+[clinic start generated code]*/
 
 static PyObject *
-binascii_a2b_base64(PyObject *self, PyObject *args)
+binascii_a2b_base64_impl(PyModuleDef *module, Py_buffer *data)
+/*[clinic end generated code: output=3e351b702bed56d2 input=5872acf6e1cac243]*/
 {
-    Py_buffer pascii;
     unsigned char *ascii_data, *bin_data;
     int leftbits = 0;
     unsigned char this_ch;
@@ -408,25 +437,19 @@
     Py_ssize_t ascii_len, bin_len;
     int quad_pos = 0;
 
-    if ( !PyArg_ParseTuple(args, "O&:a2b_base64", ascii_buffer_converter, &pascii) )
-        return NULL;
-    ascii_data = pascii.buf;
-    ascii_len = pascii.len;
+    ascii_data = data->buf;
+    ascii_len = data->len;
 
     assert(ascii_len >= 0);
 
-    if (ascii_len > PY_SSIZE_T_MAX - 3) {
-        PyBuffer_Release(&pascii);
+    if (ascii_len > PY_SSIZE_T_MAX - 3)
         return PyErr_NoMemory();
-    }
 
     bin_len = ((ascii_len+3)/4)*3; /* Upper bound, corrected later */
 
     /* Allocate the buffer */
-    if ( (rv=PyBytes_FromStringAndSize(NULL, bin_len)) == NULL ) {
-        PyBuffer_Release(&pascii);
+    if ( (rv=PyBytes_FromStringAndSize(NULL, bin_len)) == NULL )
         return NULL;
-    }
     bin_data = (unsigned char *)PyBytes_AS_STRING(rv);
     bin_len = 0;
 
@@ -479,7 +502,6 @@
     }
 
     if (leftbits != 0) {
-        PyBuffer_Release(&pascii);
         PyErr_SetString(Error, "Incorrect padding");
         Py_DECREF(rv);
         return NULL;
@@ -491,24 +513,30 @@
     */
     if (bin_len > 0) {
         if (_PyBytes_Resize(&rv, bin_len) < 0) {
-            Py_DECREF(rv);
-            rv = NULL;
+            Py_CLEAR(rv);
         }
     }
     else {
         Py_DECREF(rv);
         rv = PyBytes_FromStringAndSize("", 0);
     }
-    PyBuffer_Release(&pascii);
     return rv;
 }
 
-PyDoc_STRVAR(doc_b2a_base64, "(bin) -> ascii. Base64-code line of data");
+
+/*[clinic input]
+binascii.b2a_base64
+
+    data: Py_buffer
+    /
+
+Base64-code line of data.
+[clinic start generated code]*/
 
 static PyObject *
-binascii_b2a_base64(PyObject *self, PyObject *args)
+binascii_b2a_base64_impl(PyModuleDef *module, Py_buffer *data)
+/*[clinic end generated code: output=3cd61fbee2913285 input=14ec4e47371174a9]*/
 {
-    Py_buffer pbuf;
     unsigned char *ascii_data, *bin_data;
     int leftbits = 0;
     unsigned char this_ch;
@@ -516,26 +544,21 @@
     PyObject *rv;
     Py_ssize_t bin_len;
 
-    if ( !PyArg_ParseTuple(args, "y*:b2a_base64", &pbuf) )
-        return NULL;
-    bin_data = pbuf.buf;
-    bin_len = pbuf.len;
+    bin_data = data->buf;
+    bin_len = data->len;
 
     assert(bin_len >= 0);
 
     if ( bin_len > BASE64_MAXBIN ) {
         PyErr_SetString(Error, "Too much data for base64 line");
-        PyBuffer_Release(&pbuf);
         return NULL;
     }
 
     /* We're lazy and allocate too much (fixed up later).
        "+3" leaves room for up to two pad characters and a trailing
        newline.  Note that 'b' gets encoded as 'Yg==\n' (1 in, 5 out). */
-    if ( (rv=PyBytes_FromStringAndSize(NULL, bin_len*2 + 3)) == NULL ) {
-        PyBuffer_Release(&pbuf);
+    if ( (rv=PyBytes_FromStringAndSize(NULL, bin_len*2 + 3)) == NULL )
         return NULL;
-    }
     ascii_data = (unsigned char *)PyBytes_AS_STRING(rv);
 
     for( ; bin_len > 0 ; bin_len--, bin_data++ ) {
@@ -563,19 +586,24 @@
     if (_PyBytes_Resize(&rv,
                        (ascii_data -
                         (unsigned char *)PyBytes_AS_STRING(rv))) < 0) {
-        Py_DECREF(rv);
-        rv = NULL;
+        Py_CLEAR(rv);
     }
-    PyBuffer_Release(&pbuf);
     return rv;
 }
 
-PyDoc_STRVAR(doc_a2b_hqx, "ascii -> bin, done. Decode .hqx coding");
+/*[clinic input]
+binascii.a2b_hqx
+
+    data: ascii_buffer
+    /
+
+Decode .hqx coding.
+[clinic start generated code]*/
 
 static PyObject *
-binascii_a2b_hqx(PyObject *self, PyObject *args)
+binascii_a2b_hqx_impl(PyModuleDef *module, Py_buffer *data)
+/*[clinic end generated code: output=60bcdbbd28b105cd input=0d914c680e0eed55]*/
 {
-    Py_buffer pascii;
     unsigned char *ascii_data, *bin_data;
     int leftbits = 0;
     unsigned char this_ch;
@@ -584,25 +612,19 @@
     Py_ssize_t len;
     int done = 0;
 
-    if ( !PyArg_ParseTuple(args, "O&:a2b_hqx", ascii_buffer_converter, &pascii) )
-        return NULL;
-    ascii_data = pascii.buf;
-    len = pascii.len;
+    ascii_data = data->buf;
+    len = data->len;
 
     assert(len >= 0);
 
-    if (len > PY_SSIZE_T_MAX - 2) {
-        PyBuffer_Release(&pascii);
+    if (len > PY_SSIZE_T_MAX - 2)
         return PyErr_NoMemory();
-    }
 
     /* Allocate a string that is too big (fixed later)
        Add two to the initial length to prevent interning which
        would preclude subsequent resizing.  */
-    if ( (rv=PyBytes_FromStringAndSize(NULL, len+2)) == NULL ) {
-        PyBuffer_Release(&pascii);
+    if ( (rv=PyBytes_FromStringAndSize(NULL, len+2)) == NULL )
         return NULL;
-    }
     bin_data = (unsigned char *)PyBytes_AS_STRING(rv);
 
     for( ; len > 0 ; len--, ascii_data++ ) {
@@ -612,7 +634,6 @@
             continue;
         if ( this_ch == FAIL ) {
             PyErr_SetString(Error, "Illegal char");
-            PyBuffer_Release(&pascii);
             Py_DECREF(rv);
             return NULL;
         }
@@ -635,55 +656,53 @@
     if ( leftbits && !done ) {
         PyErr_SetString(Incomplete,
                         "String has incomplete number of bytes");
-        PyBuffer_Release(&pascii);
         Py_DECREF(rv);
         return NULL;
     }
     if (_PyBytes_Resize(&rv,
                        (bin_data -
                         (unsigned char *)PyBytes_AS_STRING(rv))) < 0) {
-        Py_DECREF(rv);
-        rv = NULL;
+        Py_CLEAR(rv);
     }
     if (rv) {
         PyObject *rrv = Py_BuildValue("Oi", rv, done);
-        PyBuffer_Release(&pascii);
         Py_DECREF(rv);
         return rrv;
     }
 
-    PyBuffer_Release(&pascii);
     return NULL;
 }
 
-PyDoc_STRVAR(doc_rlecode_hqx, "Binhex RLE-code binary data");
+
+/*[clinic input]
+binascii.rlecode_hqx
+
+    data: Py_buffer
+    /
+
+Binhex RLE-code binary data.
+[clinic start generated code]*/
 
 static PyObject *
-binascii_rlecode_hqx(PyObject *self, PyObject *args)
+binascii_rlecode_hqx_impl(PyModuleDef *module, Py_buffer *data)
+/*[clinic end generated code: output=0905da344dbf0648 input=e1f1712447a82b09]*/
 {
-    Py_buffer pbuf;
     unsigned char *in_data, *out_data;
     PyObject *rv;
     unsigned char ch;
     Py_ssize_t in, inend, len;
 
-    if ( !PyArg_ParseTuple(args, "y*:rlecode_hqx", &pbuf) )
-        return NULL;
-    in_data = pbuf.buf;
-    len = pbuf.len;
+    in_data = data->buf;
+    len = data->len;
 
     assert(len >= 0);
 
-    if (len > PY_SSIZE_T_MAX / 2 - 2) {
-        PyBuffer_Release(&pbuf);
+    if (len > PY_SSIZE_T_MAX / 2 - 2)
         return PyErr_NoMemory();
-    }
 
     /* Worst case: output is twice as big as input (fixed later) */
-    if ( (rv=PyBytes_FromStringAndSize(NULL, len*2+2)) == NULL ) {
-        PyBuffer_Release(&pbuf);
+    if ( (rv=PyBytes_FromStringAndSize(NULL, len*2+2)) == NULL )
         return NULL;
-    }
     out_data = (unsigned char *)PyBytes_AS_STRING(rv);
 
     for( in=0; in<len; in++) {
@@ -713,19 +732,25 @@
     if (_PyBytes_Resize(&rv,
                        (out_data -
                         (unsigned char *)PyBytes_AS_STRING(rv))) < 0) {
-        Py_DECREF(rv);
-        rv = NULL;
+        Py_CLEAR(rv);
     }
-    PyBuffer_Release(&pbuf);
     return rv;
 }
 
-PyDoc_STRVAR(doc_b2a_hqx, "Encode .hqx data");
+
+/*[clinic input]
+binascii.b2a_hqx
+
+    data: Py_buffer
+    /
+
+Encode .hqx data.
+[clinic start generated code]*/
 
 static PyObject *
-binascii_b2a_hqx(PyObject *self, PyObject *args)
+binascii_b2a_hqx_impl(PyModuleDef *module, Py_buffer *data)
+/*[clinic end generated code: output=5a987810d5e3cdbb input=9596ebe019fe12ba]*/
 {
-    Py_buffer pbin;
     unsigned char *ascii_data, *bin_data;
     int leftbits = 0;
     unsigned char this_ch;
@@ -733,23 +758,17 @@
     PyObject *rv;
     Py_ssize_t len;
 
-    if ( !PyArg_ParseTuple(args, "y*:b2a_hqx", &pbin) )
-        return NULL;
-    bin_data = pbin.buf;
-    len = pbin.len;
+    bin_data = data->buf;
+    len = data->len;
 
     assert(len >= 0);
 
-    if (len > PY_SSIZE_T_MAX / 2 - 2) {
-        PyBuffer_Release(&pbin);
+    if (len > PY_SSIZE_T_MAX / 2 - 2)
         return PyErr_NoMemory();
-    }
 
     /* Allocate a buffer that is at least large enough */
-    if ( (rv=PyBytes_FromStringAndSize(NULL, len*2+2)) == NULL ) {
-        PyBuffer_Release(&pbin);
+    if ( (rv=PyBytes_FromStringAndSize(NULL, len*2+2)) == NULL )
         return NULL;
-    }
     ascii_data = (unsigned char *)PyBytes_AS_STRING(rv);
 
     for( ; len > 0 ; len--, bin_data++ ) {
@@ -770,47 +789,45 @@
     if (_PyBytes_Resize(&rv,
                        (ascii_data -
                         (unsigned char *)PyBytes_AS_STRING(rv))) < 0) {
-        Py_DECREF(rv);
-        rv = NULL;
+        Py_CLEAR(rv);
     }
-    PyBuffer_Release(&pbin);
     return rv;
 }
 
-PyDoc_STRVAR(doc_rledecode_hqx, "Decode hexbin RLE-coded string");
+
+/*[clinic input]
+binascii.rledecode_hqx
+
+    data: Py_buffer
+    /
+
+Decode hexbin RLE-coded string.
+[clinic start generated code]*/
 
 static PyObject *
-binascii_rledecode_hqx(PyObject *self, PyObject *args)
+binascii_rledecode_hqx_impl(PyModuleDef *module, Py_buffer *data)
+/*[clinic end generated code: output=f7afd89b789946ab input=54cdd49fc014402c]*/
 {
-    Py_buffer pin;
     unsigned char *in_data, *out_data;
     unsigned char in_byte, in_repeat;
     PyObject *rv;
     Py_ssize_t in_len, out_len, out_len_left;
 
-    if ( !PyArg_ParseTuple(args, "y*:rledecode_hqx", &pin) )
-        return NULL;
-    in_data = pin.buf;
-    in_len = pin.len;
+    in_data = data->buf;
+    in_len = data->len;
 
     assert(in_len >= 0);
 
     /* Empty string is a special case */
-    if ( in_len == 0 ) {
-        PyBuffer_Release(&pin);
+    if ( in_len == 0 )
         return PyBytes_FromStringAndSize("", 0);
-    }
-    else if (in_len > PY_SSIZE_T_MAX / 2) {
-        PyBuffer_Release(&pin);
+    else if (in_len > PY_SSIZE_T_MAX / 2)
         return PyErr_NoMemory();
-    }
 
     /* Allocate a buffer of reasonable size. Resized when needed */
     out_len = in_len*2;
-    if ( (rv=PyBytes_FromStringAndSize(NULL, out_len)) == NULL ) {
-        PyBuffer_Release(&pin);
+    if ( (rv=PyBytes_FromStringAndSize(NULL, out_len)) == NULL )
         return NULL;
-    }
     out_len_left = out_len;
     out_data = (unsigned char *)PyBytes_AS_STRING(rv);
 
@@ -823,7 +840,6 @@
              if ( --in_len < 0 ) { \
                        PyErr_SetString(Incomplete, ""); \
                        Py_DECREF(rv); \
-                       PyBuffer_Release(&pin); \
                        return NULL; \
              } \
              b = *in_data++; \
@@ -834,7 +850,7 @@
              if ( --out_len_left < 0 ) { \
                       if ( out_len > PY_SSIZE_T_MAX / 2) return PyErr_NoMemory(); \
                       if (_PyBytes_Resize(&rv, 2*out_len) < 0) \
-                        { Py_DECREF(rv); PyBuffer_Release(&pin); return NULL; } \
+                        { Py_XDECREF(rv); return NULL; } \
                       out_data = (unsigned char *)PyBytes_AS_STRING(rv) \
                                                              + out_len; \
                       out_len_left = out_len-1; \
@@ -856,7 +872,6 @@
             ** of the string only). This is a programmer error.
             */
             PyErr_SetString(Error, "Orphaned RLE code at start");
-            PyBuffer_Release(&pin);
             Py_DECREF(rv);
             return NULL;
         }
@@ -887,60 +902,41 @@
     if (_PyBytes_Resize(&rv,
                        (out_data -
                         (unsigned char *)PyBytes_AS_STRING(rv))) < 0) {
-        Py_DECREF(rv);
-        rv = NULL;
+        Py_CLEAR(rv);
     }
-    PyBuffer_Release(&pin);
     return rv;
 }
 
-PyDoc_STRVAR(doc_crc_hqx,
-"(data, oldcrc) -> newcrc. Compute hqx CRC incrementally");
 
-static PyObject *
-binascii_crc_hqx(PyObject *self, PyObject *args)
+/*[clinic input]
+binascii.crc_hqx -> int
+
+    data: Py_buffer
+    crc: int
+    /
+
+Compute hqx CRC incrementally.
+[clinic start generated code]*/
+
+static int
+binascii_crc_hqx_impl(PyModuleDef *module, Py_buffer *data, int crc)
+/*[clinic end generated code: output=634dac18dfa863d7 input=68060931b2f51c8a]*/
 {
-    Py_buffer pin;
     unsigned char *bin_data;
-    unsigned int crc;
+    unsigned int ucrc = (unsigned int)crc;
     Py_ssize_t len;
 
-    if ( !PyArg_ParseTuple(args, "y*i:crc_hqx", &pin, &crc) )
-        return NULL;
-    bin_data = pin.buf;
-    len = pin.len;
+    bin_data = data->buf;
+    len = data->len;
 
     while(len-- > 0) {
-        crc=((crc<<8)&0xff00)^crctab_hqx[((crc>>8)&0xff)^*bin_data++];
+        ucrc=((ucrc<<8)&0xff00)^crctab_hqx[((ucrc>>8)&0xff)^*bin_data++];
     }
 
-    PyBuffer_Release(&pin);
-    return Py_BuildValue("i", crc);
+    return (int)ucrc;
 }
 
-PyDoc_STRVAR(doc_crc32,
-"(data, oldcrc = 0) -> newcrc. Compute CRC-32 incrementally");
-
-#ifdef USE_ZLIB_CRC32
-/* This was taken from zlibmodule.c PyZlib_crc32 (but is PY_SSIZE_T_CLEAN) */
-static PyObject *
-binascii_crc32(PyObject *self, PyObject *args)
-{
-    unsigned int crc32val = 0;  /* crc32(0L, Z_NULL, 0) */
-    Py_buffer pbuf;
-    Byte *buf;
-    Py_ssize_t len;
-    int signed_val;
-
-    if (!PyArg_ParseTuple(args, "y*|I:crc32", &pbuf, &crc32val))
-    return NULL;
-    buf = (Byte*)pbuf.buf;
-    len = pbuf.len;
-    signed_val = crc32(crc32val, buf, len);
-    PyBuffer_Release(&pbuf);
-    return PyLong_FromUnsignedLong(signed_val & 0xffffffffU);
-}
-#else  /* USE_ZLIB_CRC32 */
+#ifndef USE_ZLIB_CRC32
 /*  Crc - 32 BIT ANSI X3.66 CRC checksum files
     Also known as: ISO 3307
 **********************************************************************|
@@ -1058,20 +1054,42 @@
 0x5d681b02U, 0x2a6f2b94U, 0xb40bbe37U, 0xc30c8ea1U, 0x5a05df1bU,
 0x2d02ef8dU
 };
+#endif  /* USE_ZLIB_CRC32 */
 
-static PyObject *
-binascii_crc32(PyObject *self, PyObject *args)
+/*[clinic input]
+binascii.crc32 -> unsigned_int
+
+    data: Py_buffer
+    crc: unsigned_int(bitwise=True) = 0
+    /
+
+Compute CRC-32 incrementally.
+[clinic start generated code]*/
+
+static unsigned int
+binascii_crc32_impl(PyModuleDef *module, Py_buffer *data, unsigned int crc)
+/*[clinic end generated code: output=620a961643393c4f input=bbe340bc99d25aa8]*/
+
+#ifdef USE_ZLIB_CRC32
+/* This was taken from zlibmodule.c PyZlib_crc32 (but is PY_SSIZE_T_CLEAN) */
+{
+    Byte *buf;
+    Py_ssize_t len;
+    int signed_val;
+
+    buf = (Byte*)data->buf;
+    len = data->len;
+    signed_val = crc32(crc, buf, len);
+    return (unsigned int)signed_val & 0xffffffffU;
+}
+#else  /* USE_ZLIB_CRC32 */
 { /* By Jim Ahlstrom; All rights transferred to CNRI */
-    Py_buffer pbin;
     unsigned char *bin_data;
-    unsigned int crc = 0;       /* initial value of CRC */
     Py_ssize_t len;
     unsigned int result;
 
-    if ( !PyArg_ParseTuple(args, "y*|I:crc32", &pbin, &crc) )
-        return NULL;
-    bin_data = pbin.buf;
-    len = pbin.len;
+    bin_data = data->buf;
+    len = data->len;
 
     crc = ~ crc;
     while (len-- > 0) {
@@ -1080,38 +1098,42 @@
     }
 
     result = (crc ^ 0xFFFFFFFF);
-    PyBuffer_Release(&pbin);
-    return PyLong_FromUnsignedLong(result & 0xffffffff);
+    return result & 0xffffffff;
 }
 #endif  /* USE_ZLIB_CRC32 */
 
+/*[clinic input]
+binascii.b2a_hex
+
+    data: Py_buffer
+    /
+
+Hexadecimal representation of binary data.
+
+The return value is a bytes object.  This function is also
+available as "hexlify()".
+[clinic start generated code]*/
 
 static PyObject *
-binascii_hexlify(PyObject *self, PyObject *args)
+binascii_b2a_hex_impl(PyModuleDef *module, Py_buffer *data)
+/*[clinic end generated code: output=179318922c2f8fda input=96423cfa299ff3b1]*/
 {
-    Py_buffer parg;
     char* argbuf;
     Py_ssize_t arglen;
     PyObject *retval;
     char* retbuf;
     Py_ssize_t i, j;
 
-    if (!PyArg_ParseTuple(args, "y*:b2a_hex", &parg))
-        return NULL;
-    argbuf = parg.buf;
-    arglen = parg.len;
+    argbuf = data->buf;
+    arglen = data->len;
 
     assert(arglen >= 0);
-    if (arglen > PY_SSIZE_T_MAX / 2) {
-        PyBuffer_Release(&parg);
+    if (arglen > PY_SSIZE_T_MAX / 2)
         return PyErr_NoMemory();
-    }
 
     retval = PyBytes_FromStringAndSize(NULL, arglen*2);
-    if (!retval) {
-        PyBuffer_Release(&parg);
+    if (!retval)
         return NULL;
-    }
     retbuf = PyBytes_AS_STRING(retval);
 
     /* make hex version of string, taken from shamodule.c */
@@ -1122,16 +1144,23 @@
         c = argbuf[i] & 0xf;
         retbuf[j++] = Py_hexdigits[c];
     }
-    PyBuffer_Release(&parg);
     return retval;
 }
 
-PyDoc_STRVAR(doc_hexlify,
-"b2a_hex(data) -> s; Hexadecimal representation of binary data.\n\
-\n\
-The return value is a bytes object.  This function is also\n\
-available as \"hexlify()\".");
+/*[clinic input]
+binascii.hexlify = binascii.b2a_hex
 
+Hexadecimal representation of binary data.
+
+The return value is a bytes object.
+[clinic start generated code]*/
+
+static PyObject *
+binascii_hexlify_impl(PyModuleDef *module, Py_buffer *data)
+/*[clinic end generated code: output=6098440091fb61dc input=2e3afae7f083f061]*/
+{
+    return binascii_b2a_hex_impl(module, data);
+}
 
 static int
 to_int(int c)
@@ -1148,20 +1177,30 @@
 }
 
 
+/*[clinic input]
+binascii.a2b_hex
+
+    hexstr: ascii_buffer
+    /
+
+Binary data of hexadecimal representation.
+
+hexstr must contain an even number of hex digits (upper or lower case).
+This function is also available as "unhexlify()".
+[clinic start generated code]*/
+
 static PyObject *
-binascii_unhexlify(PyObject *self, PyObject *args)
+binascii_a2b_hex_impl(PyModuleDef *module, Py_buffer *hexstr)
+/*[clinic end generated code: output=d61da452b5c6d290 input=9e1e7f2f94db24fd]*/
 {
-    Py_buffer parg;
     char* argbuf;
     Py_ssize_t arglen;
     PyObject *retval;
     char* retbuf;
     Py_ssize_t i, j;
 
-    if (!PyArg_ParseTuple(args, "O&:a2b_hex", ascii_buffer_converter, &parg))
-        return NULL;
-    argbuf = parg.buf;
-    arglen = parg.len;
+    argbuf = hexstr->buf;
+    arglen = hexstr->len;
 
     assert(arglen >= 0);
 
@@ -1170,16 +1209,13 @@
      * raise an exception.
      */
     if (arglen % 2) {
-        PyBuffer_Release(&parg);
         PyErr_SetString(Error, "Odd-length string");
         return NULL;
     }
 
     retval = PyBytes_FromStringAndSize(NULL, (arglen/2));
-    if (!retval) {
-        PyBuffer_Release(&parg);
+    if (!retval)
         return NULL;
-    }
     retbuf = PyBytes_AS_STRING(retval);
 
     for (i=j=0; i < arglen; i += 2) {
@@ -1192,20 +1228,27 @@
         }
         retbuf[j++] = (top << 4) + bot;
     }
-    PyBuffer_Release(&parg);
     return retval;
 
   finally:
-    PyBuffer_Release(&parg);
     Py_DECREF(retval);
     return NULL;
 }
 
-PyDoc_STRVAR(doc_unhexlify,
-"a2b_hex(hexstr) -> s; Binary data of hexadecimal representation.\n\
-\n\
-hexstr must contain an even number of hex digits (upper or lower case).\n\
-This function is also available as \"unhexlify()\"");
+/*[clinic input]
+binascii.unhexlify = binascii.a2b_hex
+
+Binary data of hexadecimal representation.
+
+hexstr must contain an even number of hex digits (upper or lower case).
+[clinic start generated code]*/
+
+static PyObject *
+binascii_unhexlify_impl(PyModuleDef *module, Py_buffer *hexstr)
+/*[clinic end generated code: output=17cec7544499803e input=dd8c012725f462da]*/
+{
+    return binascii_a2b_hex_impl(module, hexstr);
+}
 
 static int table_hex[128] = {
   -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
@@ -1222,25 +1265,28 @@
 
 #define MAXLINESIZE 76
 
-PyDoc_STRVAR(doc_a2b_qp, "Decode a string of qp-encoded data");
 
-static PyObject*
-binascii_a2b_qp(PyObject *self, PyObject *args, PyObject *kwargs)
+/*[clinic input]
+binascii.a2b_qp
+
+    data: ascii_buffer
+    header: int(c_default="0") = False
+
+Decode a string of qp-encoded data.
+[clinic start generated code]*/
+
+static PyObject *
+binascii_a2b_qp_impl(PyModuleDef *module, Py_buffer *data, int header)
+/*[clinic end generated code: output=a44ef88270352114 input=5187a0d3d8e54f3b]*/
 {
     Py_ssize_t in, out;
     char ch;
-    Py_buffer pdata;
-    unsigned char *data, *odata;
+    unsigned char *ascii_data, *odata;
     Py_ssize_t datalen = 0;
     PyObject *rv;
-    static char *kwlist[] = {"data", "header", NULL};
-    int header = 0;
 
-    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&|i:a2b_qp", kwlist,
-                                     ascii_buffer_converter, &pdata, &header))
-        return NULL;
-    data = pdata.buf;
-    datalen = pdata.len;
+    ascii_data = data->buf;
+    datalen = data->len;
 
     /* We allocate the output same size as input, this is overkill.
      * The previous implementation used calloc() so we'll zero out the
@@ -1248,7 +1294,6 @@
      */
     odata = (unsigned char *) PyMem_Malloc(datalen);
     if (odata == NULL) {
-        PyBuffer_Release(&pdata);
         PyErr_NoMemory();
         return NULL;
     }
@@ -1256,31 +1301,31 @@
 
     in = out = 0;
     while (in < datalen) {
-        if (data[in] == '=') {
+        if (ascii_data[in] == '=') {
             in++;
             if (in >= datalen) break;
             /* Soft line breaks */
-            if ((data[in] == '\n') || (data[in] == '\r')) {
-                if (data[in] != '\n') {
-                    while (in < datalen && data[in] != '\n') in++;
+            if ((ascii_data[in] == '\n') || (ascii_data[in] == '\r')) {
+                if (ascii_data[in] != '\n') {
+                    while (in < datalen && ascii_data[in] != '\n') in++;
                 }
                 if (in < datalen) in++;
             }
-            else if (data[in] == '=') {
+            else if (ascii_data[in] == '=') {
                 /* broken case from broken python qp */
                 odata[out++] = '=';
                 in++;
             }
-            else if (((data[in] >= 'A' && data[in] <= 'F') ||
-                      (data[in] >= 'a' && data[in] <= 'f') ||
-                      (data[in] >= '0' && data[in] <= '9')) &&
-                     ((data[in+1] >= 'A' && data[in+1] <= 'F') ||
-                      (data[in+1] >= 'a' && data[in+1] <= 'f') ||
-                      (data[in+1] >= '0' && data[in+1] <= '9'))) {
+            else if (((ascii_data[in] >= 'A' && ascii_data[in] <= 'F') ||
+                      (ascii_data[in] >= 'a' && ascii_data[in] <= 'f') ||
+                      (ascii_data[in] >= '0' && ascii_data[in] <= '9')) &&
+                     ((ascii_data[in+1] >= 'A' && ascii_data[in+1] <= 'F') ||
+                      (ascii_data[in+1] >= 'a' && ascii_data[in+1] <= 'f') ||
+                      (ascii_data[in+1] >= '0' && ascii_data[in+1] <= '9'))) {
                 /* hexval */
-                ch = hexval(data[in]) << 4;
+                ch = hexval(ascii_data[in]) << 4;
                 in++;
-                ch |= hexval(data[in]);
+                ch |= hexval(ascii_data[in]);
                 in++;
                 odata[out++] = ch;
             }
@@ -1288,22 +1333,20 @@
               odata[out++] = '=';
             }
         }
-        else if (header && data[in] == '_') {
+        else if (header && ascii_data[in] == '_') {
             odata[out++] = ' ';
             in++;
         }
         else {
-            odata[out] = data[in];
+            odata[out] = ascii_data[in];
             in++;
             out++;
         }
     }
     if ((rv = PyBytes_FromStringAndSize((char *)odata, out)) == NULL) {
-        PyBuffer_Release(&pdata);
         PyMem_Free(odata);
         return NULL;
     }
-    PyBuffer_Release(&pdata);
     PyMem_Free(odata);
     return rv;
 }
@@ -1319,62 +1362,62 @@
     return 0;
 }
 
-PyDoc_STRVAR(doc_b2a_qp,
-"b2a_qp(data, quotetabs=0, istext=1, header=0) -> s; \n\
- Encode a string using quoted-printable encoding. \n\
-\n\
-On encoding, when istext is set, newlines are not encoded, and white \n\
-space at end of lines is.  When istext is not set, \\r and \\n (CR/LF) are \n\
-both encoded.  When quotetabs is set, space and tabs are encoded.");
-
 /* XXX: This is ridiculously complicated to be backward compatible
  * (mostly) with the quopri module.  It doesn't re-create the quopri
  * module bug where text ending in CRLF has the CR encoded */
-static PyObject*
-binascii_b2a_qp (PyObject *self, PyObject *args, PyObject *kwargs)
+
+/*[clinic input]
+binascii.b2a_qp
+
+    data: Py_buffer
+    quotetabs: int(c_default="0") = False
+    istext: int(c_default="1") = True
+    header: int(c_default="0") = False
+
+Encode a string using quoted-printable encoding.
+
+On encoding, when istext is set, newlines are not encoded, and white
+space at end of lines is.  When istext is not set, \r and \n (CR/LF)
+are both encoded.  When quotetabs is set, space and tabs are encoded.
+[clinic start generated code]*/
+
+static PyObject *
+binascii_b2a_qp_impl(PyModuleDef *module, Py_buffer *data, int quotetabs, int istext, int header)
+/*[clinic end generated code: output=ff2991ba640fff3e input=7f2a9aaa008e92b2]*/
 {
     Py_ssize_t in, out;
-    Py_buffer pdata;
-    unsigned char *data, *odata;
+    unsigned char *databuf, *odata;
     Py_ssize_t datalen = 0, odatalen = 0;
     PyObject *rv;
     unsigned int linelen = 0;
-    static char *kwlist[] = {"data", "quotetabs", "istext",
-                                   "header", NULL};
-    int istext = 1;
-    int quotetabs = 0;
-    int header = 0;
     unsigned char ch;
     int crlf = 0;
     unsigned char *p;
 
-    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "y*|iii", kwlist, &pdata,
-          &quotetabs, &istext, &header))
-        return NULL;
-    data = pdata.buf;
-    datalen = pdata.len;
+    databuf = data->buf;
+    datalen = data->len;
 
     /* See if this string is using CRLF line ends */
     /* XXX: this function has the side effect of converting all of
      * the end of lines to be the same depending on this detection
      * here */
-    p = (unsigned char *) memchr(data, '\n', datalen);
-    if ((p != NULL) && (p > data) && (*(p-1) == '\r'))
+    p = (unsigned char *) memchr(databuf, '\n', datalen);
+    if ((p != NULL) && (p > databuf) && (*(p-1) == '\r'))
         crlf = 1;
 
     /* First, scan to see how many characters need to be encoded */
     in = 0;
     while (in < datalen) {
-        if ((data[in] > 126) ||
-            (data[in] == '=') ||
-            (header && data[in] == '_') ||
-            ((data[in] == '.') && (linelen == 0) &&
-             (data[in+1] == '\n' || data[in+1] == '\r' || data[in+1] == 0)) ||
-            (!istext && ((data[in] == '\r') || (data[in] == '\n'))) ||
-            ((data[in] == '\t' || data[in] == ' ') && (in + 1 == datalen)) ||
-            ((data[in] < 33) &&
-             (data[in] != '\r') && (data[in] != '\n') &&
-             (quotetabs || ((data[in] != '\t') && (data[in] != ' ')))))
+        if ((databuf[in] > 126) ||
+            (databuf[in] == '=') ||
+            (header && databuf[in] == '_') ||
+            ((databuf[in] == '.') && (linelen == 0) &&
+             (databuf[in+1] == '\n' || databuf[in+1] == '\r' || databuf[in+1] == 0)) ||
+            (!istext && ((databuf[in] == '\r') || (databuf[in] == '\n'))) ||
+            ((databuf[in] == '\t' || databuf[in] == ' ') && (in + 1 == datalen)) ||
+            ((databuf[in] < 33) &&
+             (databuf[in] != '\r') && (databuf[in] != '\n') &&
+             (quotetabs || ((databuf[in] != '\t') && (databuf[in] != ' ')))))
         {
             if ((linelen + 3) >= MAXLINESIZE) {
                 linelen = 0;
@@ -1389,26 +1432,26 @@
         }
         else {
             if (istext &&
-                ((data[in] == '\n') ||
-                 ((in+1 < datalen) && (data[in] == '\r') &&
-                 (data[in+1] == '\n'))))
+                ((databuf[in] == '\n') ||
+                 ((in+1 < datalen) && (databuf[in] == '\r') &&
+                 (databuf[in+1] == '\n'))))
             {
                 linelen = 0;
                 /* Protect against whitespace on end of line */
-                if (in && ((data[in-1] == ' ') || (data[in-1] == '\t')))
+                if (in && ((databuf[in-1] == ' ') || (databuf[in-1] == '\t')))
                     odatalen += 2;
                 if (crlf)
                     odatalen += 2;
                 else
                     odatalen += 1;
-                if (data[in] == '\r')
+                if (databuf[in] == '\r')
                     in += 2;
                 else
                     in++;
             }
             else {
                 if ((in + 1 != datalen) &&
-                    (data[in+1] != '\n') &&
+                    (databuf[in+1] != '\n') &&
                     (linelen + 1) >= MAXLINESIZE) {
                     linelen = 0;
                     if (crlf)
@@ -1429,7 +1472,6 @@
      */
     odata = (unsigned char *) PyMem_Malloc(odatalen);
     if (odata == NULL) {
-        PyBuffer_Release(&pdata);
         PyErr_NoMemory();
         return NULL;
     }
@@ -1437,17 +1479,17 @@
 
     in = out = linelen = 0;
     while (in < datalen) {
-        if ((data[in] > 126) ||
-            (data[in] == '=') ||
-            (header && data[in] == '_') ||
-            ((data[in] == '.') && (linelen == 0) &&
-             (data[in+1] == '\n' || data[in+1] == '\r' || data[in+1] == 0)) ||
-            (!istext && ((data[in] == '\r') || (data[in] == '\n'))) ||
-            ((data[in] == '\t' || data[in] == ' ') && (in + 1 == datalen)) ||
-            ((data[in] < 33) &&
-             (data[in] != '\r') && (data[in] != '\n') &&
+        if ((databuf[in] > 126) ||
+            (databuf[in] == '=') ||
+            (header && databuf[in] == '_') ||
+            ((databuf[in] == '.') && (linelen == 0) &&
+             (databuf[in+1] == '\n' || databuf[in+1] == '\r' || databuf[in+1] == 0)) ||
+            (!istext && ((databuf[in] == '\r') || (databuf[in] == '\n'))) ||
+            ((databuf[in] == '\t' || databuf[in] == ' ') && (in + 1 == datalen)) ||
+            ((databuf[in] < 33) &&
+             (databuf[in] != '\r') && (databuf[in] != '\n') &&
              (quotetabs ||
-            (!quotetabs && ((data[in] != '\t') && (data[in] != ' '))))))
+            (!quotetabs && ((databuf[in] != '\t') && (databuf[in] != ' '))))))
         {
             if ((linelen + 3 )>= MAXLINESIZE) {
                 odata[out++] = '=';
@@ -1456,16 +1498,16 @@
                 linelen = 0;
             }
             odata[out++] = '=';
-            to_hex(data[in], &odata[out]);
+            to_hex(databuf[in], &odata[out]);
             out += 2;
             in++;
             linelen += 3;
         }
         else {
             if (istext &&
-                ((data[in] == '\n') ||
-                 ((in+1 < datalen) && (data[in] == '\r') &&
-                 (data[in+1] == '\n'))))
+                ((databuf[in] == '\n') ||
+                 ((in+1 < datalen) && (databuf[in] == '\r') &&
+                 (databuf[in+1] == '\n'))))
             {
                 linelen = 0;
                 /* Protect against whitespace on end of line */
@@ -1478,14 +1520,14 @@
 
                 if (crlf) odata[out++] = '\r';
                 odata[out++] = '\n';
-                if (data[in] == '\r')
+                if (databuf[in] == '\r')
                     in += 2;
                 else
                     in++;
             }
             else {
                 if ((in + 1 != datalen) &&
-                    (data[in+1] != '\n') &&
+                    (databuf[in+1] != '\n') &&
                     (linelen + 1) >= MAXLINESIZE) {
                     odata[out++] = '=';
                     if (crlf) odata[out++] = '\r';
@@ -1493,22 +1535,20 @@
                     linelen = 0;
                 }
                 linelen++;
-                if (header && data[in] == ' ') {
+                if (header && databuf[in] == ' ') {
                     odata[out++] = '_';
                     in++;
                 }
                 else {
-                    odata[out++] = data[in++];
+                    odata[out++] = databuf[in++];
                 }
             }
         }
     }
     if ((rv = PyBytes_FromStringAndSize((char *)odata, out)) == NULL) {
-        PyBuffer_Release(&pdata);
         PyMem_Free(odata);
         return NULL;
     }
-    PyBuffer_Release(&pdata);
     PyMem_Free(odata);
     return rv;
 }
@@ -1516,25 +1556,22 @@
 /* List of functions defined in the module */
 
 static struct PyMethodDef binascii_module_methods[] = {
-    {"a2b_uu",     binascii_a2b_uu,     METH_VARARGS, doc_a2b_uu},
-    {"b2a_uu",     binascii_b2a_uu,     METH_VARARGS, doc_b2a_uu},
-    {"a2b_base64", binascii_a2b_base64, METH_VARARGS, doc_a2b_base64},
-    {"b2a_base64", binascii_b2a_base64, METH_VARARGS, doc_b2a_base64},
-    {"a2b_hqx",    binascii_a2b_hqx,    METH_VARARGS, doc_a2b_hqx},
-    {"b2a_hqx",    binascii_b2a_hqx,    METH_VARARGS, doc_b2a_hqx},
-    {"b2a_hex",    binascii_hexlify,    METH_VARARGS, doc_hexlify},
-    {"a2b_hex",    binascii_unhexlify,  METH_VARARGS, doc_unhexlify},
-    {"hexlify",    binascii_hexlify,    METH_VARARGS, doc_hexlify},
-    {"unhexlify",  binascii_unhexlify,  METH_VARARGS, doc_unhexlify},
-    {"rlecode_hqx",   binascii_rlecode_hqx, METH_VARARGS, doc_rlecode_hqx},
-    {"rledecode_hqx", binascii_rledecode_hqx, METH_VARARGS,
-     doc_rledecode_hqx},
-    {"crc_hqx",    binascii_crc_hqx,    METH_VARARGS, doc_crc_hqx},
-    {"crc32",      binascii_crc32,      METH_VARARGS, doc_crc32},
-    {"a2b_qp", (PyCFunction)binascii_a2b_qp, METH_VARARGS | METH_KEYWORDS,
-      doc_a2b_qp},
-    {"b2a_qp", (PyCFunction)binascii_b2a_qp, METH_VARARGS | METH_KEYWORDS,
-      doc_b2a_qp},
+    BINASCII_A2B_UU_METHODDEF
+    BINASCII_B2A_UU_METHODDEF
+    BINASCII_A2B_BASE64_METHODDEF
+    BINASCII_B2A_BASE64_METHODDEF
+    BINASCII_A2B_HQX_METHODDEF
+    BINASCII_B2A_HQX_METHODDEF
+    BINASCII_A2B_HEX_METHODDEF
+    BINASCII_B2A_HEX_METHODDEF
+    BINASCII_HEXLIFY_METHODDEF
+    BINASCII_UNHEXLIFY_METHODDEF
+    BINASCII_RLECODE_HQX_METHODDEF
+    BINASCII_RLEDECODE_HQX_METHODDEF
+    BINASCII_CRC_HQX_METHODDEF
+    BINASCII_CRC32_METHODDEF
+    BINASCII_A2B_QP_METHODDEF
+    BINASCII_B2A_QP_METHODDEF
     {NULL, NULL}                             /* sentinel */
 };
 
diff --git a/Modules/cjkcodecs/_codecs_cn.c b/Modules/cjkcodecs/_codecs_cn.c
index 9e9e96c..1a070f2 100644
--- a/Modules/cjkcodecs/_codecs_cn.c
+++ b/Modules/cjkcodecs/_codecs_cn.c
@@ -15,7 +15,7 @@
 #undef hz
 #endif
 
-/* GBK and GB2312 map differently in few codepoints that are listed below:
+/* GBK and GB2312 map differently in few code points that are listed below:
  *
  *              gb2312                          gbk
  * A1A4         U+30FB KATAKANA MIDDLE DOT      U+00B7 MIDDLE DOT
@@ -23,18 +23,33 @@
  * A844         undefined                       U+2015 HORIZONTAL BAR
  */
 
-#define GBK_DECODE(dc1, dc2, assi) \
-    if ((dc1) == 0xa1 && (dc2) == 0xaa) (assi) = 0x2014; \
-    else if ((dc1) == 0xa8 && (dc2) == 0x44) (assi) = 0x2015; \
-    else if ((dc1) == 0xa1 && (dc2) == 0xa4) (assi) = 0x00b7; \
-    else TRYMAP_DEC(gb2312, assi, dc1 ^ 0x80, dc2 ^ 0x80); \
-    else TRYMAP_DEC(gbkext, assi, dc1, dc2);
+#define GBK_DECODE(dc1, dc2, writer)                                \
+    if ((dc1) == 0xa1 && (dc2) == 0xaa) {                           \
+        OUTCHAR(0x2014);                                            \
+    }                                                               \
+    else if ((dc1) == 0xa8 && (dc2) == 0x44) {                      \
+        OUTCHAR(0x2015);                                            \
+    }                                                               \
+    else if ((dc1) == 0xa1 && (dc2) == 0xa4) {                      \
+        OUTCHAR(0x00b7);                                            \
+    }                                                               \
+    else if (TRYMAP_DEC(gb2312, decoded, dc1 ^ 0x80, dc2 ^ 0x80)) { \
+        OUTCHAR(decoded);                                           \
+    }                                                               \
+    else if (TRYMAP_DEC(gbkext, decoded, dc1, dc2)) {               \
+        OUTCHAR(decoded);                                           \
+    }
 
-#define GBK_ENCODE(code, assi) \
-    if ((code) == 0x2014) (assi) = 0xa1aa; \
-    else if ((code) == 0x2015) (assi) = 0xa844; \
-    else if ((code) == 0x00b7) (assi) = 0xa1a4; \
-    else if ((code) != 0x30fb && TRYMAP_ENC_COND(gbcommon, assi, code));
+#define GBK_ENCODE(code, assi)                                         \
+    if ((code) == 0x2014) {                                            \
+        (assi) = 0xa1aa;                                               \
+    } else if ((code) == 0x2015) {                                     \
+        (assi) = 0xa844;                                               \
+    } else if ((code) == 0x00b7) {                                     \
+        (assi) = 0xa1a4;                                               \
+    } else if ((code) != 0x30fb && TRYMAP_ENC(gbcommon, assi, code)) { \
+        ;                                                              \
+    }
 
 /*
  * GB2312 codec
@@ -42,27 +57,31 @@
 
 ENCODER(gb2312)
 {
-    while (inleft > 0) {
-        Py_UNICODE c = IN1;
+    while (*inpos < inlen) {
+        Py_UCS4 c = INCHAR1;
         DBCHAR code;
 
         if (c < 0x80) {
-            WRITE1((unsigned char)c)
-            NEXT(1, 1)
+            WRITEBYTE1((unsigned char)c);
+            NEXT(1, 1);
             continue;
         }
-        UCS4INVALID(c)
 
-        REQUIRE_OUTBUF(2)
-        TRYMAP_ENC(gbcommon, code, c);
-        else return 1;
+        if (c > 0xFFFF)
+            return 1;
+
+        REQUIRE_OUTBUF(2);
+        if (TRYMAP_ENC(gbcommon, code, c))
+            ;
+        else
+            return 1;
 
         if (code & 0x8000) /* MSB set: GBK */
             return 1;
 
-        OUT1((code >> 8) | 0x80)
-        OUT2((code & 0xFF) | 0x80)
-        NEXT(1, 2)
+        OUTBYTE1((code >> 8) | 0x80);
+        OUTBYTE2((code & 0xFF) | 0x80);
+        NEXT(1, 2);
     }
 
     return 0;
@@ -72,20 +91,21 @@
 {
     while (inleft > 0) {
         unsigned char c = **inbuf;
-
-        REQUIRE_OUTBUF(1)
+        Py_UCS4 decoded;
 
         if (c < 0x80) {
-            OUT1(c)
-            NEXT(1, 1)
+            OUTCHAR(c);
+            NEXT_IN(1);
             continue;
         }
 
-        REQUIRE_INBUF(2)
-        TRYMAP_DEC(gb2312, **outbuf, c ^ 0x80, IN2 ^ 0x80) {
-            NEXT(2, 1)
+        REQUIRE_INBUF(2);
+        if (TRYMAP_DEC(gb2312, decoded, c ^ 0x80, INBYTE2 ^ 0x80)) {
+            OUTCHAR(decoded);
+            NEXT_IN(2);
         }
-        else return 1;
+        else
+            return 1;
     }
 
     return 0;
@@ -98,28 +118,31 @@
 
 ENCODER(gbk)
 {
-    while (inleft > 0) {
-        Py_UNICODE c = IN1;
+    while (*inpos < inlen) {
+        Py_UCS4 c = INCHAR1;
         DBCHAR code;
 
         if (c < 0x80) {
-            WRITE1((unsigned char)c)
-            NEXT(1, 1)
+            WRITEBYTE1((unsigned char)c);
+            NEXT(1, 1);
             continue;
         }
-        UCS4INVALID(c)
 
-        REQUIRE_OUTBUF(2)
+        if (c > 0xFFFF)
+            return 1;
+
+        REQUIRE_OUTBUF(2);
 
         GBK_ENCODE(c, code)
-        else return 1;
-
-        OUT1((code >> 8) | 0x80)
-        if (code & 0x8000)
-            OUT2((code & 0xFF)) /* MSB set: GBK */
         else
-            OUT2((code & 0xFF) | 0x80) /* MSB unset: GB2312 */
-        NEXT(1, 2)
+            return 1;
+
+        OUTBYTE1((code >> 8) | 0x80);
+        if (code & 0x8000)
+            OUTBYTE2((code & 0xFF)); /* MSB set: GBK */
+        else
+            OUTBYTE2((code & 0xFF) | 0x80); /* MSB unset: GB2312 */
+        NEXT(1, 2);
     }
 
     return 0;
@@ -128,22 +151,22 @@
 DECODER(gbk)
 {
     while (inleft > 0) {
-        unsigned char c = IN1;
-
-        REQUIRE_OUTBUF(1)
+        unsigned char c = INBYTE1;
+        Py_UCS4 decoded;
 
         if (c < 0x80) {
-            OUT1(c)
-            NEXT(1, 1)
+            OUTCHAR(c);
+            NEXT_IN(1);
             continue;
         }
 
-        REQUIRE_INBUF(2)
+        REQUIRE_INBUF(2);
 
-        GBK_DECODE(c, IN2, **outbuf)
-        else return 1;
+        GBK_DECODE(c, INBYTE2, writer)
+        else
+            return 1;
 
-        NEXT(2, 1)
+        NEXT_IN(2);
     }
 
     return 0;
@@ -156,72 +179,63 @@
 
 ENCODER(gb18030)
 {
-    while (inleft > 0) {
-        ucs4_t c = IN1;
+    while (*inpos < inlen) {
+        Py_UCS4 c = INCHAR1;
         DBCHAR code;
 
         if (c < 0x80) {
-            WRITE1(c)
-            NEXT(1, 1)
+            WRITEBYTE1(c);
+            NEXT(1, 1);
             continue;
         }
 
-        DECODE_SURROGATE(c)
-        if (c > 0x10FFFF)
-#if Py_UNICODE_SIZE == 2
-            return 2; /* surrogates pair */
-#else
-            return 1;
-#endif
-        else if (c >= 0x10000) {
-            ucs4_t tc = c - 0x10000;
+        if (c >= 0x10000) {
+            Py_UCS4 tc = c - 0x10000;
+            assert (c <= 0x10FFFF);
 
-            REQUIRE_OUTBUF(4)
+            REQUIRE_OUTBUF(4);
 
-            OUT4((unsigned char)(tc % 10) + 0x30)
+            OUTBYTE4((unsigned char)(tc % 10) + 0x30);
             tc /= 10;
-            OUT3((unsigned char)(tc % 126) + 0x81)
+            OUTBYTE3((unsigned char)(tc % 126) + 0x81);
             tc /= 126;
-            OUT2((unsigned char)(tc % 10) + 0x30)
+            OUTBYTE2((unsigned char)(tc % 10) + 0x30);
             tc /= 10;
-            OUT1((unsigned char)(tc + 0x90))
+            OUTBYTE1((unsigned char)(tc + 0x90));
 
-#if Py_UNICODE_SIZE == 2
-            NEXT(2, 4) /* surrogates pair */
-#else
-            NEXT(1, 4)
-#endif
+            NEXT(1, 4);
             continue;
         }
 
-        REQUIRE_OUTBUF(2)
+        REQUIRE_OUTBUF(2);
 
         GBK_ENCODE(c, code)
-        else TRYMAP_ENC(gb18030ext, code, c);
+        else if (TRYMAP_ENC(gb18030ext, code, c))
+            ;
         else {
             const struct _gb18030_to_unibmp_ranges *utrrange;
 
-            REQUIRE_OUTBUF(4)
+            REQUIRE_OUTBUF(4);
 
             for (utrrange = gb18030_to_unibmp_ranges;
                  utrrange->first != 0;
                  utrrange++)
                 if (utrrange->first <= c &&
                     c <= utrrange->last) {
-                    Py_UNICODE tc;
+                    Py_UCS4 tc;
 
                     tc = c - utrrange->first +
                          utrrange->base;
 
-                    OUT4((unsigned char)(tc % 10) + 0x30)
+                    OUTBYTE4((unsigned char)(tc % 10) + 0x30);
                     tc /= 10;
-                    OUT3((unsigned char)(tc % 126) + 0x81)
+                    OUTBYTE3((unsigned char)(tc % 126) + 0x81);
                     tc /= 126;
-                    OUT2((unsigned char)(tc % 10) + 0x30)
+                    OUTBYTE2((unsigned char)(tc % 10) + 0x30);
                     tc /= 10;
-                    OUT1((unsigned char)tc + 0x81)
+                    OUTBYTE1((unsigned char)tc + 0x81);
 
-                    NEXT(1, 4)
+                    NEXT(1, 4);
                     break;
                 }
 
@@ -230,13 +244,13 @@
             continue;
         }
 
-        OUT1((code >> 8) | 0x80)
+        OUTBYTE1((code >> 8) | 0x80);
         if (code & 0x8000)
-            OUT2((code & 0xFF)) /* MSB set: GBK or GB18030ext */
+            OUTBYTE2((code & 0xFF)); /* MSB set: GBK or GB18030ext */
         else
-            OUT2((code & 0xFF) | 0x80) /* MSB unset: GB2312 */
+            OUTBYTE2((code & 0xFF) | 0x80); /* MSB unset: GB2312 */
 
-        NEXT(1, 2)
+        NEXT(1, 2);
     }
 
     return 0;
@@ -245,61 +259,62 @@
 DECODER(gb18030)
 {
     while (inleft > 0) {
-        unsigned char c = IN1, c2;
-
-        REQUIRE_OUTBUF(1)
+        unsigned char c = INBYTE1, c2;
+        Py_UCS4 decoded;
 
         if (c < 0x80) {
-            OUT1(c)
-            NEXT(1, 1)
+            OUTCHAR(c);
+            NEXT_IN(1);
             continue;
         }
 
-        REQUIRE_INBUF(2)
+        REQUIRE_INBUF(2);
 
-        c2 = IN2;
+        c2 = INBYTE2;
         if (c2 >= 0x30 && c2 <= 0x39) { /* 4 bytes seq */
             const struct _gb18030_to_unibmp_ranges *utr;
             unsigned char c3, c4;
-            ucs4_t lseq;
+            Py_UCS4 lseq;
 
-            REQUIRE_INBUF(4)
-            c3 = IN3;
-            c4 = IN4;
+            REQUIRE_INBUF(4);
+            c3 = INBYTE3;
+            c4 = INBYTE4;
             if (c < 0x81 || c3 < 0x81 || c4 < 0x30 || c4 > 0x39)
                 return 1;
             c -= 0x81;  c2 -= 0x30;
             c3 -= 0x81; c4 -= 0x30;
 
             if (c < 4) { /* U+0080 - U+FFFF */
-                lseq = ((ucs4_t)c * 10 + c2) * 1260 +
-                    (ucs4_t)c3 * 10 + c4;
+                lseq = ((Py_UCS4)c * 10 + c2) * 1260 +
+                    (Py_UCS4)c3 * 10 + c4;
                 if (lseq < 39420) {
                     for (utr = gb18030_to_unibmp_ranges;
                          lseq >= (utr + 1)->base;
                          utr++) ;
-                    OUT1(utr->first - utr->base + lseq)
-                    NEXT(4, 1)
+                    OUTCHAR(utr->first - utr->base + lseq);
+                    NEXT_IN(4);
                     continue;
                 }
             }
             else if (c >= 15) { /* U+10000 - U+10FFFF */
-                lseq = 0x10000 + (((ucs4_t)c-15) * 10 + c2)
-                    * 1260 + (ucs4_t)c3 * 10 + c4;
+                lseq = 0x10000 + (((Py_UCS4)c-15) * 10 + c2)
+                    * 1260 + (Py_UCS4)c3 * 10 + c4;
                 if (lseq <= 0x10FFFF) {
-                    WRITEUCS4(lseq);
-                    NEXT_IN(4)
+                    OUTCHAR(lseq);
+                    NEXT_IN(4);
                     continue;
                 }
             }
             return 1;
         }
 
-        GBK_DECODE(c, c2, **outbuf)
-        else TRYMAP_DEC(gb18030ext, **outbuf, c, c2);
-        else return 1;
+        GBK_DECODE(c, c2, writer)
+        else if (TRYMAP_DEC(gb18030ext, decoded, c, c2))
+            OUTCHAR(decoded);
+        else
+            return 1;
 
-        NEXT(2, 1)
+        NEXT_IN(2);
     }
 
     return 0;
@@ -319,48 +334,51 @@
 ENCODER_RESET(hz)
 {
     if (state->i != 0) {
-        WRITE2('~', '}')
+        WRITEBYTE2('~', '}');
         state->i = 0;
-        NEXT_OUT(2)
+        NEXT_OUT(2);
     }
     return 0;
 }
 
 ENCODER(hz)
 {
-    while (inleft > 0) {
-        Py_UNICODE c = IN1;
+    while (*inpos < inlen) {
+        Py_UCS4 c = INCHAR1;
         DBCHAR code;
 
         if (c < 0x80) {
             if (state->i == 0) {
-                WRITE1((unsigned char)c)
-                NEXT(1, 1)
+                WRITEBYTE1((unsigned char)c);
+                NEXT(1, 1);
             }
             else {
-                WRITE3('~', '}', (unsigned char)c)
-                NEXT(1, 3)
+                WRITEBYTE3('~', '}', (unsigned char)c);
+                NEXT(1, 3);
                 state->i = 0;
             }
             continue;
         }
 
-        UCS4INVALID(c)
+        if (c > 0xFFFF)
+            return 1;
 
-        TRYMAP_ENC(gbcommon, code, c);
-        else return 1;
+        if (TRYMAP_ENC(gbcommon, code, c))
+            ;
+        else
+            return 1;
 
         if (code & 0x8000) /* MSB set: GBK */
             return 1;
 
         if (state->i == 0) {
-            WRITE4('~', '{', code >> 8, code & 0xff)
-            NEXT(1, 4)
+            WRITEBYTE4('~', '{', code >> 8, code & 0xff);
+            NEXT(1, 4);
             state->i = 1;
         }
         else {
-            WRITE2(code >> 8, code & 0xff)
-            NEXT(1, 2)
+            WRITEBYTE2(code >> 8, code & 0xff);
+            NEXT(1, 2);
         }
     }
 
@@ -382,15 +400,16 @@
 DECODER(hz)
 {
     while (inleft > 0) {
-        unsigned char c = IN1;
+        unsigned char c = INBYTE1;
+        Py_UCS4 decoded;
 
         if (c == '~') {
-            unsigned char c2 = IN2;
+            unsigned char c2 = INBYTE2;
 
-            REQUIRE_INBUF(2)
+            REQUIRE_INBUF(2);
             if (c2 == '~') {
-                WRITE1('~')
-                NEXT(2, 1)
+                OUTCHAR('~');
+                NEXT_IN(2);
                 continue;
             }
             else if (c2 == '{' && state->i == 0)
@@ -401,7 +420,7 @@
                 ; /* line-continuation */
             else
                 return 1;
-            NEXT(2, 0);
+            NEXT_IN(2);
             continue;
         }
 
@@ -409,14 +428,14 @@
             return 1;
 
         if (state->i == 0) { /* ASCII mode */
-            WRITE1(c)
-            NEXT(1, 1)
+            OUTCHAR(c);
+            NEXT_IN(1);
         }
         else { /* GB mode */
-            REQUIRE_INBUF(2)
-            REQUIRE_OUTBUF(1)
-            TRYMAP_DEC(gb2312, **outbuf, c, IN2) {
-                NEXT(2, 1)
+            REQUIRE_INBUF(2);
+            if (TRYMAP_DEC(gb2312, decoded, c, INBYTE2)) {
+                OUTCHAR(decoded);
+                NEXT_IN(2);
             }
             else
                 return 1;
diff --git a/Modules/cjkcodecs/_codecs_hk.c b/Modules/cjkcodecs/_codecs_hk.c
index d3ad04b..4f21569 100644
--- a/Modules/cjkcodecs/_codecs_hk.c
+++ b/Modules/cjkcodecs/_codecs_hk.c
@@ -38,35 +38,39 @@
 
 ENCODER(big5hkscs)
 {
-    while (inleft > 0) {
-        ucs4_t c = **inbuf;
+    while (*inpos < inlen) {
+        Py_UCS4 c = INCHAR1;
         DBCHAR code;
         Py_ssize_t insize;
 
         if (c < 0x80) {
-            REQUIRE_OUTBUF(1)
+            REQUIRE_OUTBUF(1);
             **outbuf = (unsigned char)c;
-            NEXT(1, 1)
+            NEXT(1, 1);
             continue;
         }
 
-        DECODE_SURROGATE(c)
-        insize = GET_INSIZE(c);
-
-        REQUIRE_OUTBUF(2)
+        insize = 1;
+        REQUIRE_OUTBUF(2);
 
         if (c < 0x10000) {
-            TRYMAP_ENC(big5hkscs_bmp, code, c) {
+            if (TRYMAP_ENC(big5hkscs_bmp, code, c)) {
                 if (code == MULTIC) {
-                    if (inleft >= 2 &&
+                    Py_UCS4 c2;
+                    if (inlen - *inpos >= 2)
+                        c2 = INCHAR2;
+                    else
+                        c2 = 0;
+
+                    if (inlen - *inpos >= 2 &&
                         ((c & 0xffdf) == 0x00ca) &&
-                        (((*inbuf)[1] & 0xfff7) == 0x0304)) {
+                        ((c2 & 0xfff7) == 0x0304)) {
                         code = big5hkscs_pairenc_table[
                             ((c >> 4) |
-                             ((*inbuf)[1] >> 3)) & 3];
+                             (c2 >> 3)) & 3];
                         insize = 2;
                     }
-                    else if (inleft < 2 &&
+                    else if (inlen - *inpos < 2 &&
                              !(flags & MBENC_FLUSH))
                         return MBERR_TOOFEW;
                     else {
@@ -77,21 +81,25 @@
                     }
                 }
             }
-            else TRYMAP_ENC(big5, code, c);
-            else return 1;
+            else if (TRYMAP_ENC(big5, code, c))
+                ;
+            else
+                return 1;
         }
         else if (c < 0x20000)
             return insize;
         else if (c < 0x30000) {
-            TRYMAP_ENC(big5hkscs_nonbmp, code, c & 0xffff);
-            else return insize;
+            if (TRYMAP_ENC(big5hkscs_nonbmp, code, c & 0xffff))
+                ;
+            else
+                return insize;
         }
         else
             return insize;
 
-        OUT1(code >> 8)
-        OUT2(code & 0xFF)
-        NEXT(insize, 2)
+        OUTBYTE1(code >> 8);
+        OUTBYTE2(code & 0xFF);
+        NEXT(insize, 2);
     }
 
     return 0;
@@ -102,33 +110,32 @@
 DECODER(big5hkscs)
 {
     while (inleft > 0) {
-        unsigned char c = IN1;
-        ucs4_t decoded;
-
-        REQUIRE_OUTBUF(1)
+        unsigned char c = INBYTE1;
+        Py_UCS4 decoded;
 
         if (c < 0x80) {
-            OUT1(c)
-            NEXT(1, 1)
+            OUTCHAR(c);
+            NEXT_IN(1);
             continue;
         }
 
-        REQUIRE_INBUF(2)
+        REQUIRE_INBUF(2);
 
-        if (0xc6 > c || c > 0xc8 || (c < 0xc7 && IN2 < 0xa1)) {
-            TRYMAP_DEC(big5, **outbuf, c, IN2) {
-                NEXT(2, 1)
+        if (0xc6 > c || c > 0xc8 || (c < 0xc7 && INBYTE2 < 0xa1)) {
+            if (TRYMAP_DEC(big5, decoded, c, INBYTE2)) {
+                OUTCHAR(decoded);
+                NEXT_IN(2);
                 continue;
             }
         }
 
-        TRYMAP_DEC(big5hkscs, decoded, c, IN2)
+        if (TRYMAP_DEC(big5hkscs, decoded, c, INBYTE2))
         {
-            int s = BH2S(c, IN2);
+            int s = BH2S(c, INBYTE2);
             const unsigned char *hintbase;
 
             assert(0x87 <= c && c <= 0xfe);
-            assert(0x40 <= IN2 && IN2 <= 0xfe);
+            assert(0x40 <= INBYTE2 && INBYTE2 <= 0xfe);
 
             if (BH2S(0x87, 0x40) <= s && s <= BH2S(0xa0, 0xfe)) {
                     hintbase = big5hkscs_phint_0;
@@ -146,25 +153,25 @@
                     return MBERR_INTERNAL;
 
             if (hintbase[s >> 3] & (1 << (s & 7))) {
-                    WRITEUCS4(decoded | 0x20000)
-                    NEXT_IN(2)
+                    OUTCHAR(decoded | 0x20000);
+                    NEXT_IN(2);
             }
             else {
-                    OUT1(decoded)
-                    NEXT(2, 1)
+                    OUTCHAR(decoded);
+                    NEXT_IN(2);
             }
             continue;
         }
 
-        switch ((c << 8) | IN2) {
-        case 0x8862: WRITE2(0x00ca, 0x0304); break;
-        case 0x8864: WRITE2(0x00ca, 0x030c); break;
-        case 0x88a3: WRITE2(0x00ea, 0x0304); break;
-        case 0x88a5: WRITE2(0x00ea, 0x030c); break;
+        switch ((c << 8) | INBYTE2) {
+        case 0x8862: OUTCHAR2(0x00ca, 0x0304); break;
+        case 0x8864: OUTCHAR2(0x00ca, 0x030c); break;
+        case 0x88a3: OUTCHAR2(0x00ea, 0x0304); break;
+        case 0x88a5: OUTCHAR2(0x00ea, 0x030c); break;
         default: return 1;
         }
 
-        NEXT(2, 2) /* all decoded codepoints are pairs, above. */
+        NEXT_IN(2); /* all decoded code points are pairs, above. */
     }
 
     return 0;
diff --git a/Modules/cjkcodecs/_codecs_iso2022.c b/Modules/cjkcodecs/_codecs_iso2022.c
index cbc1542..5c401aa 100644
--- a/Modules/cjkcodecs/_codecs_iso2022.c
+++ b/Modules/cjkcodecs/_codecs_iso2022.c
@@ -73,7 +73,7 @@
 #define F_SHIFTED               0x01
 #define F_ESCTHROUGHOUT         0x02
 
-#define STATE_SETG(dn, v)       ((state)->c[dn]) = (v);
+#define STATE_SETG(dn, v)       do { ((state)->c[dn]) = (v); } while (0)
 #define STATE_GETG(dn)          ((state)->c[dn])
 
 #define STATE_G0                STATE_GETG(0)
@@ -85,10 +85,10 @@
 #define STATE_SETG2(v)          STATE_SETG(2, v)
 #define STATE_SETG3(v)          STATE_SETG(3, v)
 
-#define STATE_SETFLAG(f)        ((state)->c[4]) |= (f);
+#define STATE_SETFLAG(f)        do { ((state)->c[4]) |= (f); } while (0)
 #define STATE_GETFLAG(f)        ((state)->c[4] & (f))
-#define STATE_CLEARFLAG(f)      ((state)->c[4]) &= ~(f);
-#define STATE_CLEARFLAGS()      ((state)->c[4]) = 0;
+#define STATE_CLEARFLAG(f)      do { ((state)->c[4]) &= ~(f); } while (0)
+#define STATE_CLEARFLAGS()      do { ((state)->c[4]) = 0; } while (0)
 
 #define ISO2022_CONFIG          ((const struct iso2022_config *)config)
 #define CONFIG_ISSET(flag)      (ISO2022_CONFIG->flags & (flag))
@@ -102,8 +102,8 @@
 /*-*- internal data structures -*-*/
 
 typedef int (*iso2022_init_func)(void);
-typedef ucs4_t (*iso2022_decode_func)(const unsigned char *data);
-typedef DBCHAR (*iso2022_encode_func)(const ucs4_t *data, Py_ssize_t *length);
+typedef Py_UCS4 (*iso2022_decode_func)(const unsigned char *data);
+typedef DBCHAR (*iso2022_encode_func)(const Py_UCS4 *data, Py_ssize_t *length);
 
 struct iso2022_designation {
     unsigned char mark;
@@ -132,53 +132,52 @@
 
 ENCODER_INIT(iso2022)
 {
-    STATE_CLEARFLAGS()
-    STATE_SETG0(CHARSET_ASCII)
-    STATE_SETG1(CHARSET_ASCII)
+    STATE_CLEARFLAGS();
+    STATE_SETG0(CHARSET_ASCII);
+    STATE_SETG1(CHARSET_ASCII);
     return 0;
 }
 
 ENCODER_RESET(iso2022)
 {
     if (STATE_GETFLAG(F_SHIFTED)) {
-        WRITE1(SI)
-        NEXT_OUT(1)
-        STATE_CLEARFLAG(F_SHIFTED)
+        WRITEBYTE1(SI);
+        NEXT_OUT(1);
+        STATE_CLEARFLAG(F_SHIFTED);
     }
     if (STATE_G0 != CHARSET_ASCII) {
-        WRITE3(ESC, '(', 'B')
-        NEXT_OUT(3)
-        STATE_SETG0(CHARSET_ASCII)
+        WRITEBYTE3(ESC, '(', 'B');
+        NEXT_OUT(3);
+        STATE_SETG0(CHARSET_ASCII);
     }
     return 0;
 }
 
 ENCODER(iso2022)
 {
-    while (inleft > 0) {
+    while (*inpos < inlen) {
         const struct iso2022_designation *dsg;
         DBCHAR encoded;
-        ucs4_t c = **inbuf;
+        Py_UCS4 c = INCHAR1;
         Py_ssize_t insize;
 
         if (c < 0x80) {
             if (STATE_G0 != CHARSET_ASCII) {
-                WRITE3(ESC, '(', 'B')
-                STATE_SETG0(CHARSET_ASCII)
-                NEXT_OUT(3)
+                WRITEBYTE3(ESC, '(', 'B');
+                STATE_SETG0(CHARSET_ASCII);
+                NEXT_OUT(3);
             }
             if (STATE_GETFLAG(F_SHIFTED)) {
-                WRITE1(SI)
-                STATE_CLEARFLAG(F_SHIFTED)
-                NEXT_OUT(1)
+                WRITEBYTE1(SI);
+                STATE_CLEARFLAG(F_SHIFTED);
+                NEXT_OUT(1);
             }
-            WRITE1((unsigned char)c)
-            NEXT(1, 1)
+            WRITEBYTE1((unsigned char)c);
+            NEXT(1, 1);
             continue;
         }
 
-        DECODE_SURROGATE(c)
-        insize = GET_INSIZE(c);
+        insize = 1;
 
         encoded = MAP_UNMAPPABLE;
         for (dsg = CONFIG_DESIGNATIONS; dsg->mark; dsg++) {
@@ -187,24 +186,14 @@
             if (encoded == MAP_MULTIPLE_AVAIL) {
                 /* this implementation won't work for pair
                  * of non-bmp characters. */
-                if (inleft < 2) {
+                if (inlen - *inpos < 2) {
                     if (!(flags & MBENC_FLUSH))
                         return MBERR_TOOFEW;
                     length = -1;
                 }
                 else
                     length = 2;
-#if Py_UNICODE_SIZE == 2
-                if (length == 2) {
-                    ucs4_t u4in[2];
-                    u4in[0] = (ucs4_t)IN1;
-                    u4in[1] = (ucs4_t)IN2;
-                    encoded = dsg->encoder(u4in, &length);
-                } else
-                    encoded = dsg->encoder(&c, &length);
-#else
                 encoded = dsg->encoder(&c, &length);
-#endif
                 if (encoded != MAP_UNMAPPABLE) {
                     insize = length;
                     break;
@@ -221,47 +210,46 @@
         switch (dsg->plane) {
         case 0: /* G0 */
             if (STATE_GETFLAG(F_SHIFTED)) {
-                WRITE1(SI)
-                STATE_CLEARFLAG(F_SHIFTED)
-                NEXT_OUT(1)
+                WRITEBYTE1(SI);
+                STATE_CLEARFLAG(F_SHIFTED);
+                NEXT_OUT(1);
             }
             if (STATE_G0 != dsg->mark) {
                 if (dsg->width == 1) {
-                    WRITE3(ESC, '(', ESCMARK(dsg->mark))
-                    STATE_SETG0(dsg->mark)
-                    NEXT_OUT(3)
+                    WRITEBYTE3(ESC, '(', ESCMARK(dsg->mark));
+                    STATE_SETG0(dsg->mark);
+                    NEXT_OUT(3);
                 }
                 else if (dsg->mark == CHARSET_JISX0208) {
-                    WRITE3(ESC, '$', ESCMARK(dsg->mark))
-                    STATE_SETG0(dsg->mark)
-                    NEXT_OUT(3)
+                    WRITEBYTE3(ESC, '$', ESCMARK(dsg->mark));
+                    STATE_SETG0(dsg->mark);
+                    NEXT_OUT(3);
                 }
                 else {
-                    WRITE4(ESC, '$', '(',
-                        ESCMARK(dsg->mark))
-                    STATE_SETG0(dsg->mark)
-                    NEXT_OUT(4)
+                    WRITEBYTE4(ESC, '$', '(',
+                        ESCMARK(dsg->mark));
+                    STATE_SETG0(dsg->mark);
+                    NEXT_OUT(4);
                 }
             }
             break;
         case 1: /* G1 */
             if (STATE_G1 != dsg->mark) {
                 if (dsg->width == 1) {
-                    WRITE3(ESC, ')', ESCMARK(dsg->mark))
-                    STATE_SETG1(dsg->mark)
-                    NEXT_OUT(3)
+                    WRITEBYTE3(ESC, ')', ESCMARK(dsg->mark));
+                    STATE_SETG1(dsg->mark);
+                    NEXT_OUT(3);
                 }
                 else {
-                    WRITE4(ESC, '$', ')',
-                        ESCMARK(dsg->mark))
-                    STATE_SETG1(dsg->mark)
-                    NEXT_OUT(4)
+                    WRITEBYTE4(ESC, '$', ')', ESCMARK(dsg->mark));
+                    STATE_SETG1(dsg->mark);
+                    NEXT_OUT(4);
                 }
             }
             if (!STATE_GETFLAG(F_SHIFTED)) {
-                WRITE1(SO)
-                STATE_SETFLAG(F_SHIFTED)
-                NEXT_OUT(1)
+                WRITEBYTE1(SO);
+                STATE_SETFLAG(F_SHIFTED);
+                NEXT_OUT(1);
             }
             break;
         default: /* G2 and G3 is not supported: no encoding in
@@ -270,14 +258,14 @@
         }
 
         if (dsg->width == 1) {
-            WRITE1((unsigned char)encoded)
-            NEXT_OUT(1)
+            WRITEBYTE1((unsigned char)encoded);
+            NEXT_OUT(1);
         }
         else {
-            WRITE2(encoded >> 8, encoded & 0xff)
-            NEXT_OUT(2)
+            WRITEBYTE2(encoded >> 8, encoded & 0xff);
+            NEXT_OUT(2);
         }
-        NEXT_IN(insize)
+        NEXT_INCHAR(insize);
     }
 
     return 0;
@@ -285,17 +273,17 @@
 
 DECODER_INIT(iso2022)
 {
-    STATE_CLEARFLAGS()
-    STATE_SETG0(CHARSET_ASCII)
-    STATE_SETG1(CHARSET_ASCII)
-    STATE_SETG2(CHARSET_ASCII)
+    STATE_CLEARFLAGS();
+    STATE_SETG0(CHARSET_ASCII);
+    STATE_SETG1(CHARSET_ASCII);
+    STATE_SETG2(CHARSET_ASCII);
     return 0;
 }
 
 DECODER_RESET(iso2022)
 {
-    STATE_SETG0(CHARSET_ASCII)
-    STATE_CLEARFLAG(F_SHIFTED)
+    STATE_SETG0(CHARSET_ASCII);
+    STATE_CLEARFLAG(F_SHIFTED);
     return 0;
 }
 
@@ -314,8 +302,9 @@
             break;
         }
         else if (CONFIG_ISSET(USE_JISX0208_EXT) && i+1 < *inleft &&
-                 (*inbuf)[i] == '&' && (*inbuf)[i+1] == '@')
+                 (*inbuf)[i] == '&' && (*inbuf)[i+1] == '@') {
             i += 2;
+        }
     }
 
     if (i >= MAX_ESCSEQLEN)
@@ -323,27 +312,33 @@
 
     switch (esclen) {
     case 3:
-        if (IN2 == '$') {
-            charset = IN3 | CHARSET_DBCS;
+        if (INBYTE2 == '$') {
+            charset = INBYTE3 | CHARSET_DBCS;
             designation = 0;
         }
         else {
-            charset = IN3;
-            if (IN2 == '(') designation = 0;
-            else if (IN2 == ')') designation = 1;
-            else if (CONFIG_ISSET(USE_G2) && IN2 == '.')
+            charset = INBYTE3;
+            if (INBYTE2 == '(')
+                designation = 0;
+            else if (INBYTE2 == ')')
+                designation = 1;
+            else if (CONFIG_ISSET(USE_G2) && INBYTE2 == '.')
                 designation = 2;
-            else return 3;
+            else
+                return 3;
         }
         break;
     case 4:
-        if (IN2 != '$')
+        if (INBYTE2 != '$')
             return 4;
 
-        charset = IN4 | CHARSET_DBCS;
-        if (IN3 == '(') designation = 0;
-        else if (IN3 == ')') designation = 1;
-        else return 4;
+        charset = INBYTE4 | CHARSET_DBCS;
+        if (INBYTE3 == '(')
+            designation = 0;
+        else if (INBYTE3 == ')')
+            designation = 1;
+        else
+            return 4;
         break;
     case 6: /* designation with prefix */
         if (CONFIG_ISSET(USE_JISX0208_EXT) &&
@@ -363,58 +358,65 @@
     if (charset != CHARSET_ASCII) {
         const struct iso2022_designation *dsg;
 
-        for (dsg = CONFIG_DESIGNATIONS; dsg->mark; dsg++)
+        for (dsg = CONFIG_DESIGNATIONS; dsg->mark; dsg++) {
             if (dsg->mark == charset)
                 break;
+        }
         if (!dsg->mark)
             return esclen;
     }
 
-    STATE_SETG(designation, charset)
+    STATE_SETG(designation, charset);
     *inleft -= esclen;
     (*inbuf) += esclen;
     return 0;
 }
 
-#define ISO8859_7_DECODE(c, assi)                                       \
-    if ((c) < 0xa0) (assi) = (c);                                       \
-    else if ((c) < 0xc0 && (0x288f3bc9L & (1L << ((c)-0xa0))))          \
-        (assi) = (c);                                                   \
-    else if ((c) >= 0xb4 && (c) <= 0xfe && ((c) >= 0xd4 ||              \
-             (0xbffffd77L & (1L << ((c)-0xb4)))))                       \
-        (assi) = 0x02d0 + (c);                                          \
-    else if ((c) == 0xa1) (assi) = 0x2018;                              \
-    else if ((c) == 0xa2) (assi) = 0x2019;                              \
-    else if ((c) == 0xaf) (assi) = 0x2015;
+#define ISO8859_7_DECODE(c, writer)                                \
+    if ((c) < 0xa0) {                                              \
+        OUTCHAR(c);                                                \
+    } else if ((c) < 0xc0 && (0x288f3bc9L & (1L << ((c)-0xa0)))) { \
+        OUTCHAR(c);                                                \
+    } else if ((c) >= 0xb4 && (c) <= 0xfe && ((c) >= 0xd4 ||       \
+             (0xbffffd77L & (1L << ((c)-0xb4))))) {                \
+        OUTCHAR(0x02d0 + (c));                                     \
+    } else if ((c) == 0xa1) {                                      \
+        OUTCHAR(0x2018);                                           \
+    } else if ((c) == 0xa2) {                                      \
+        OUTCHAR(0x2019);                                           \
+    } else if ((c) == 0xaf) {                                      \
+        OUTCHAR(0x2015);                                           \
+    }
 
 static Py_ssize_t
 iso2022processg2(const void *config, MultibyteCodec_State *state,
                  const unsigned char **inbuf, Py_ssize_t *inleft,
-                 Py_UNICODE **outbuf, Py_ssize_t *outleft)
+                 _PyUnicodeWriter *writer)
 {
     /* not written to use encoder, decoder functions because only few
      * encodings use G2 designations in CJKCodecs */
     if (STATE_G2 == CHARSET_ISO8859_1) {
-        if (IN3 < 0x80)
-            OUT1(IN3 + 0x80)
+        if (INBYTE3 < 0x80)
+            OUTCHAR(INBYTE3 + 0x80);
         else
             return 3;
     }
     else if (STATE_G2 == CHARSET_ISO8859_7) {
-        ISO8859_7_DECODE(IN3 ^ 0x80, **outbuf)
-        else return 3;
+        ISO8859_7_DECODE(INBYTE3 ^ 0x80, writer)
+        else
+            return 3;
     }
     else if (STATE_G2 == CHARSET_ASCII) {
-        if (IN3 & 0x80) return 3;
-        else **outbuf = IN3;
+        if (INBYTE3 & 0x80)
+            return 3;
+        else
+            OUTCHAR(INBYTE3);
     }
     else
         return MBERR_INTERNAL;
 
     (*inbuf) += 3;
     *inleft -= 3;
-    (*outbuf) += 1;
-    *outleft -= 1;
     return 0;
 }
 
@@ -423,58 +425,58 @@
     const struct iso2022_designation *dsgcache = NULL;
 
     while (inleft > 0) {
-        unsigned char c = IN1;
+        unsigned char c = INBYTE1;
         Py_ssize_t err;
 
         if (STATE_GETFLAG(F_ESCTHROUGHOUT)) {
             /* ESC throughout mode:
              * for non-iso2022 escape sequences */
-            WRITE1(c) /* assume as ISO-8859-1 */
-            NEXT(1, 1)
+            OUTCHAR(c); /* assume as ISO-8859-1 */
+            NEXT_IN(1);
             if (IS_ESCEND(c)) {
-                STATE_CLEARFLAG(F_ESCTHROUGHOUT)
+                STATE_CLEARFLAG(F_ESCTHROUGHOUT);
             }
             continue;
         }
 
         switch (c) {
         case ESC:
-            REQUIRE_INBUF(2)
-            if (IS_ISO2022ESC(IN2)) {
+            REQUIRE_INBUF(2);
+            if (IS_ISO2022ESC(INBYTE2)) {
                 err = iso2022processesc(config, state,
                                         inbuf, &inleft);
                 if (err != 0)
                     return err;
             }
-            else if (CONFIG_ISSET(USE_G2) && IN2 == 'N') {/* SS2 */
-                REQUIRE_INBUF(3)
+            else if (CONFIG_ISSET(USE_G2) && INBYTE2 == 'N') {/* SS2 */
+                REQUIRE_INBUF(3);
                 err = iso2022processg2(config, state,
-                    inbuf, &inleft, outbuf, &outleft);
+                                       inbuf, &inleft, writer);
                 if (err != 0)
                     return err;
             }
             else {
-                WRITE1(ESC)
-                STATE_SETFLAG(F_ESCTHROUGHOUT)
-                NEXT(1, 1)
+                OUTCHAR(ESC);
+                STATE_SETFLAG(F_ESCTHROUGHOUT);
+                NEXT_IN(1);
             }
             break;
         case SI:
             if (CONFIG_ISSET(NO_SHIFT))
                 goto bypass;
-            STATE_CLEARFLAG(F_SHIFTED)
-            NEXT_IN(1)
+            STATE_CLEARFLAG(F_SHIFTED);
+            NEXT_IN(1);
             break;
         case SO:
             if (CONFIG_ISSET(NO_SHIFT))
                 goto bypass;
-            STATE_SETFLAG(F_SHIFTED)
-            NEXT_IN(1)
+            STATE_SETFLAG(F_SHIFTED);
+            NEXT_IN(1);
             break;
         case LF:
-            STATE_CLEARFLAG(F_SHIFTED)
-            WRITE1(LF)
-            NEXT(1, 1)
+            STATE_CLEARFLAG(F_SHIFTED);
+            OUTCHAR(LF);
+            NEXT_IN(1);
             break;
         default:
             if (c < 0x20) /* C0 */
@@ -484,7 +486,7 @@
             else {
                 const struct iso2022_designation *dsg;
                 unsigned char charset;
-                ucs4_t decoded;
+                Py_UCS4 decoded;
 
                 if (STATE_GETFLAG(F_SHIFTED))
                     charset = STATE_G1;
@@ -492,43 +494,44 @@
                     charset = STATE_G0;
 
                 if (charset == CHARSET_ASCII) {
-bypass:                                 WRITE1(c)
-                                        NEXT(1, 1)
-                                        break;
-                                }
-
-                                if (dsgcache != NULL &&
-                                    dsgcache->mark == charset)
-                                        dsg = dsgcache;
-                                else {
-                                        for (dsg = CONFIG_DESIGNATIONS;
-                                             dsg->mark != charset
-#ifdef Py_DEBUG
-                                                && dsg->mark != '\0'
-#endif
-                                             ;dsg++)
-                                                /* noop */;
-                                        assert(dsg->mark != '\0');
-                                        dsgcache = dsg;
-                                }
-
-                                REQUIRE_INBUF(dsg->width)
-                                decoded = dsg->decoder(*inbuf);
-                                if (decoded == MAP_UNMAPPABLE)
-                                        return dsg->width;
-
-                                if (decoded < 0x10000) {
-                                        WRITE1(decoded)
-                                        NEXT_OUT(1)
-                                }
-                                else if (decoded < 0x30000) {
-                                        WRITEUCS4(decoded)
-                                }
-                                else { /* JIS X 0213 pairs */
-                    WRITE2(decoded >> 16, decoded & 0xffff)
-                    NEXT_OUT(2)
+bypass:
+                    OUTCHAR(c);
+                    NEXT_IN(1);
+                    break;
                 }
-                NEXT_IN(dsg->width)
+
+                if (dsgcache != NULL &&
+                    dsgcache->mark == charset)
+                        dsg = dsgcache;
+                else {
+                    for (dsg = CONFIG_DESIGNATIONS;
+                         dsg->mark != charset
+#ifdef Py_DEBUG
+                            && dsg->mark != '\0'
+#endif
+                         ; dsg++)
+                    {
+                        /* noop */
+                    }
+                    assert(dsg->mark != '\0');
+                    dsgcache = dsg;
+                }
+
+                REQUIRE_INBUF(dsg->width);
+                decoded = dsg->decoder(*inbuf);
+                if (decoded == MAP_UNMAPPABLE)
+                    return dsg->width;
+
+                if (decoded < 0x10000) {
+                    OUTCHAR(decoded);
+                }
+                else if (decoded < 0x30000) {
+                    OUTCHAR(decoded);
+                }
+                else { /* JIS X 0213 pairs */
+                    OUTCHAR2(decoded >> 16, decoded & 0xffff);
+                }
+                NEXT_IN(dsg->width);
             }
             break;
         }
@@ -577,25 +580,26 @@
     return 0;
 }
 
-static ucs4_t
+static Py_UCS4
 ksx1001_decoder(const unsigned char *data)
 {
-    ucs4_t u;
-    TRYMAP_DEC(ksx1001, u, data[0], data[1])
+    Py_UCS4 u;
+    if (TRYMAP_DEC(ksx1001, u, data[0], data[1]))
         return u;
     else
         return MAP_UNMAPPABLE;
 }
 
 static DBCHAR
-ksx1001_encoder(const ucs4_t *data, Py_ssize_t *length)
+ksx1001_encoder(const Py_UCS4 *data, Py_ssize_t *length)
 {
     DBCHAR coded;
     assert(*length == 1);
     if (*data < 0x10000) {
-        TRYMAP_ENC(cp949, coded, *data)
+        if (TRYMAP_ENC(cp949, coded, *data)) {
             if (!(coded & 0x8000))
                 return coded;
+        }
     }
     return MAP_UNMAPPABLE;
 }
@@ -613,27 +617,27 @@
     return 0;
 }
 
-static ucs4_t
+static Py_UCS4
 jisx0208_decoder(const unsigned char *data)
 {
-    ucs4_t u;
+    Py_UCS4 u;
     if (data[0] == 0x21 && data[1] == 0x40) /* F/W REVERSE SOLIDUS */
         return 0xff3c;
-    else TRYMAP_DEC(jisx0208, u, data[0], data[1])
+    else if (TRYMAP_DEC(jisx0208, u, data[0], data[1]))
         return u;
     else
         return MAP_UNMAPPABLE;
 }
 
 static DBCHAR
-jisx0208_encoder(const ucs4_t *data, Py_ssize_t *length)
+jisx0208_encoder(const Py_UCS4 *data, Py_ssize_t *length)
 {
     DBCHAR coded;
     assert(*length == 1);
     if (*data < 0x10000) {
         if (*data == 0xff3c) /* F/W REVERSE SOLIDUS */
             return 0x2140;
-        else TRYMAP_ENC(jisxcommon, coded, *data) {
+        else if (TRYMAP_ENC(jisxcommon, coded, *data)) {
             if (!(coded & 0x8000))
                 return coded;
         }
@@ -654,23 +658,23 @@
     return 0;
 }
 
-static ucs4_t
+static Py_UCS4
 jisx0212_decoder(const unsigned char *data)
 {
-    ucs4_t u;
-    TRYMAP_DEC(jisx0212, u, data[0], data[1])
+    Py_UCS4 u;
+    if (TRYMAP_DEC(jisx0212, u, data[0], data[1]))
         return u;
     else
         return MAP_UNMAPPABLE;
 }
 
 static DBCHAR
-jisx0212_encoder(const ucs4_t *data, Py_ssize_t *length)
+jisx0212_encoder(const Py_UCS4 *data, Py_ssize_t *length)
 {
     DBCHAR coded;
     assert(*length == 1);
     if (*data < 0x10000) {
-        TRYMAP_ENC(jisxcommon, coded, *data) {
+        if (TRYMAP_ENC(jisxcommon, coded, *data)) {
             if (coded & 0x8000)
                 return coded & 0x7fff;
         }
@@ -705,30 +709,34 @@
 }
 
 #define config ((void *)2000)
-static ucs4_t
+static Py_UCS4
 jisx0213_2000_1_decoder(const unsigned char *data)
 {
-    ucs4_t u;
+    Py_UCS4 u;
     EMULATE_JISX0213_2000_DECODE_PLANE1(u, data[0], data[1])
     else if (data[0] == 0x21 && data[1] == 0x40) /* F/W REVERSE SOLIDUS */
         return 0xff3c;
-    else TRYMAP_DEC(jisx0208, u, data[0], data[1]);
-    else TRYMAP_DEC(jisx0213_1_bmp, u, data[0], data[1]);
-    else TRYMAP_DEC(jisx0213_1_emp, u, data[0], data[1])
+    else if (TRYMAP_DEC(jisx0208, u, data[0], data[1]))
+        ;
+    else if (TRYMAP_DEC(jisx0213_1_bmp, u, data[0], data[1]))
+        ;
+    else if (TRYMAP_DEC(jisx0213_1_emp, u, data[0], data[1]))
         u |= 0x20000;
-    else TRYMAP_DEC(jisx0213_pair, u, data[0], data[1]);
+    else if (TRYMAP_DEC(jisx0213_pair, u, data[0], data[1]))
+        ;
     else
         return MAP_UNMAPPABLE;
     return u;
 }
 
-static ucs4_t
+static Py_UCS4
 jisx0213_2000_2_decoder(const unsigned char *data)
 {
-    ucs4_t u;
-    EMULATE_JISX0213_2000_DECODE_PLANE2(u, data[0], data[1])
-    TRYMAP_DEC(jisx0213_2_bmp, u, data[0], data[1]);
-    else TRYMAP_DEC(jisx0213_2_emp, u, data[0], data[1])
+    Py_UCS4 u;
+    EMULATE_JISX0213_2000_DECODE_PLANE2_CHAR(u, data[0], data[1])
+    if (TRYMAP_DEC(jisx0213_2_bmp, u, data[0], data[1]))
+        ;
+    else if (TRYMAP_DEC(jisx0213_2_emp, u, data[0], data[1]))
         u |= 0x20000;
     else
         return MAP_UNMAPPABLE;
@@ -736,28 +744,32 @@
 }
 #undef config
 
-static ucs4_t
+static Py_UCS4
 jisx0213_2004_1_decoder(const unsigned char *data)
 {
-    ucs4_t u;
+    Py_UCS4 u;
     if (data[0] == 0x21 && data[1] == 0x40) /* F/W REVERSE SOLIDUS */
         return 0xff3c;
-    else TRYMAP_DEC(jisx0208, u, data[0], data[1]);
-    else TRYMAP_DEC(jisx0213_1_bmp, u, data[0], data[1]);
-    else TRYMAP_DEC(jisx0213_1_emp, u, data[0], data[1])
+    else if (TRYMAP_DEC(jisx0208, u, data[0], data[1]))
+        ;
+    else if (TRYMAP_DEC(jisx0213_1_bmp, u, data[0], data[1]))
+        ;
+    else if (TRYMAP_DEC(jisx0213_1_emp, u, data[0], data[1]))
         u |= 0x20000;
-    else TRYMAP_DEC(jisx0213_pair, u, data[0], data[1]);
+    else if (TRYMAP_DEC(jisx0213_pair, u, data[0], data[1]))
+        ;
     else
         return MAP_UNMAPPABLE;
     return u;
 }
 
-static ucs4_t
+static Py_UCS4
 jisx0213_2004_2_decoder(const unsigned char *data)
 {
-    ucs4_t u;
-    TRYMAP_DEC(jisx0213_2_bmp, u, data[0], data[1]);
-    else TRYMAP_DEC(jisx0213_2_emp, u, data[0], data[1])
+    Py_UCS4 u;
+    if (TRYMAP_DEC(jisx0213_2_bmp, u, data[0], data[1]))
+        ;
+    else if (TRYMAP_DEC(jisx0213_2_emp, u, data[0], data[1]))
         u |= 0x20000;
     else
         return MAP_UNMAPPABLE;
@@ -765,7 +777,7 @@
 }
 
 static DBCHAR
-jisx0213_encoder(const ucs4_t *data, Py_ssize_t *length, void *config)
+jisx0213_encoder(const Py_UCS4 *data, Py_ssize_t *length, void *config)
 {
     DBCHAR coded;
 
@@ -774,28 +786,28 @@
         if (*data >= 0x10000) {
             if ((*data) >> 16 == 0x20000 >> 16) {
                 EMULATE_JISX0213_2000_ENCODE_EMP(coded, *data)
-                else TRYMAP_ENC(jisx0213_emp, coded,
-                                (*data) & 0xffff)
+                else if (TRYMAP_ENC(jisx0213_emp, coded, (*data) & 0xffff))
                     return coded;
             }
             return MAP_UNMAPPABLE;
         }
 
         EMULATE_JISX0213_2000_ENCODE_BMP(coded, *data)
-        else TRYMAP_ENC(jisx0213_bmp, coded, *data) {
+        else if (TRYMAP_ENC(jisx0213_bmp, coded, *data)) {
             if (coded == MULTIC)
                 return MAP_MULTIPLE_AVAIL;
         }
-        else TRYMAP_ENC(jisxcommon, coded, *data) {
+        else if (TRYMAP_ENC(jisxcommon, coded, *data)) {
             if (coded & 0x8000)
                 return MAP_UNMAPPABLE;
         }
         else
             return MAP_UNMAPPABLE;
         return coded;
+
     case 2: /* second character of unicode pair */
         coded = find_pairencmap((ucs2_t)data[0], (ucs2_t)data[1],
-                        jisx0213_pair_encmap, JISX0213_ENCPAIRS);
+                                jisx0213_pair_encmap, JISX0213_ENCPAIRS);
         if (coded == DBCINV) {
             *length = 1;
             coded = find_pairencmap((ucs2_t)data[0], 0,
@@ -805,21 +817,24 @@
         }
         else
             return coded;
+
     case -1: /* flush unterminated */
         *length = 1;
         coded = find_pairencmap((ucs2_t)data[0], 0,
-                        jisx0213_pair_encmap, JISX0213_ENCPAIRS);
+                                jisx0213_pair_encmap, JISX0213_ENCPAIRS);
         if (coded == DBCINV)
             return MAP_UNMAPPABLE;
         else
             return coded;
+        break;
+
     default:
         return MAP_UNMAPPABLE;
     }
 }
 
 static DBCHAR
-jisx0213_2000_1_encoder(const ucs4_t *data, Py_ssize_t *length)
+jisx0213_2000_1_encoder(const Py_UCS4 *data, Py_ssize_t *length)
 {
     DBCHAR coded = jisx0213_encoder(data, length, (void *)2000);
     if (coded == MAP_UNMAPPABLE || coded == MAP_MULTIPLE_AVAIL)
@@ -831,7 +846,7 @@
 }
 
 static DBCHAR
-jisx0213_2000_1_encoder_paironly(const ucs4_t *data, Py_ssize_t *length)
+jisx0213_2000_1_encoder_paironly(const Py_UCS4 *data, Py_ssize_t *length)
 {
     DBCHAR coded;
     Py_ssize_t ilength = *length;
@@ -854,7 +869,7 @@
 }
 
 static DBCHAR
-jisx0213_2000_2_encoder(const ucs4_t *data, Py_ssize_t *length)
+jisx0213_2000_2_encoder(const Py_UCS4 *data, Py_ssize_t *length)
 {
     DBCHAR coded = jisx0213_encoder(data, length, (void *)2000);
     if (coded == MAP_UNMAPPABLE || coded == MAP_MULTIPLE_AVAIL)
@@ -866,7 +881,7 @@
 }
 
 static DBCHAR
-jisx0213_2004_1_encoder(const ucs4_t *data, Py_ssize_t *length)
+jisx0213_2004_1_encoder(const Py_UCS4 *data, Py_ssize_t *length)
 {
     DBCHAR coded = jisx0213_encoder(data, length, NULL);
     if (coded == MAP_UNMAPPABLE || coded == MAP_MULTIPLE_AVAIL)
@@ -878,7 +893,7 @@
 }
 
 static DBCHAR
-jisx0213_2004_1_encoder_paironly(const ucs4_t *data, Py_ssize_t *length)
+jisx0213_2004_1_encoder_paironly(const Py_UCS4 *data, Py_ssize_t *length)
 {
     DBCHAR coded;
     Py_ssize_t ilength = *length;
@@ -901,7 +916,7 @@
 }
 
 static DBCHAR
-jisx0213_2004_2_encoder(const ucs4_t *data, Py_ssize_t *length)
+jisx0213_2004_2_encoder(const Py_UCS4 *data, Py_ssize_t *length)
 {
     DBCHAR coded = jisx0213_encoder(data, length, NULL);
     if (coded == MAP_UNMAPPABLE || coded == MAP_MULTIPLE_AVAIL)
@@ -912,39 +927,43 @@
         return MAP_UNMAPPABLE;
 }
 
-static ucs4_t
+static Py_UCS4
 jisx0201_r_decoder(const unsigned char *data)
 {
-    ucs4_t u;
-    JISX0201_R_DECODE(*data, u)
-    else return MAP_UNMAPPABLE;
+    Py_UCS4 u;
+    JISX0201_R_DECODE_CHAR(*data, u)
+    else
+        return MAP_UNMAPPABLE;
     return u;
 }
 
 static DBCHAR
-jisx0201_r_encoder(const ucs4_t *data, Py_ssize_t *length)
+jisx0201_r_encoder(const Py_UCS4 *data, Py_ssize_t *length)
 {
     DBCHAR coded;
     JISX0201_R_ENCODE(*data, coded)
-    else return MAP_UNMAPPABLE;
+    else
+        return MAP_UNMAPPABLE;
     return coded;
 }
 
-static ucs4_t
+static Py_UCS4
 jisx0201_k_decoder(const unsigned char *data)
 {
-    ucs4_t u;
-    JISX0201_K_DECODE(*data ^ 0x80, u)
-    else return MAP_UNMAPPABLE;
+    Py_UCS4 u;
+    JISX0201_K_DECODE_CHAR(*data ^ 0x80, u)
+    else
+        return MAP_UNMAPPABLE;
     return u;
 }
 
 static DBCHAR
-jisx0201_k_encoder(const ucs4_t *data, Py_ssize_t *length)
+jisx0201_k_encoder(const Py_UCS4 *data, Py_ssize_t *length)
 {
     DBCHAR coded;
     JISX0201_K_ENCODE(*data, coded)
-    else return MAP_UNMAPPABLE;
+    else
+        return MAP_UNMAPPABLE;
     return coded - 0x80;
 }
 
@@ -961,23 +980,23 @@
     return 0;
 }
 
-static ucs4_t
+static Py_UCS4
 gb2312_decoder(const unsigned char *data)
 {
-    ucs4_t u;
-    TRYMAP_DEC(gb2312, u, data[0], data[1])
+    Py_UCS4 u;
+    if (TRYMAP_DEC(gb2312, u, data[0], data[1]))
         return u;
     else
         return MAP_UNMAPPABLE;
 }
 
 static DBCHAR
-gb2312_encoder(const ucs4_t *data, Py_ssize_t *length)
+gb2312_encoder(const Py_UCS4 *data, Py_ssize_t *length)
 {
     DBCHAR coded;
     assert(*length == 1);
     if (*data < 0x10000) {
-        TRYMAP_ENC(gbcommon, coded, *data) {
+        if (TRYMAP_ENC(gbcommon, coded, *data)) {
             if (!(coded & 0x8000))
                 return coded;
         }
@@ -986,14 +1005,14 @@
 }
 
 
-static ucs4_t
+static Py_UCS4
 dummy_decoder(const unsigned char *data)
 {
     return MAP_UNMAPPABLE;
 }
 
 static DBCHAR
-dummy_encoder(const ucs4_t *data, Py_ssize_t *length)
+dummy_encoder(const Py_UCS4 *data, Py_ssize_t *length)
 {
     return MAP_UNMAPPABLE;
 }
diff --git a/Modules/cjkcodecs/_codecs_jp.c b/Modules/cjkcodecs/_codecs_jp.c
index a500696..2c7788a 100644
--- a/Modules/cjkcodecs/_codecs_jp.c
+++ b/Modules/cjkcodecs/_codecs_jp.c
@@ -19,40 +19,41 @@
 
 ENCODER(cp932)
 {
-    while (inleft > 0) {
-        Py_UNICODE c = IN1;
+    while (*inpos < inlen) {
+        Py_UCS4 c = INCHAR1;
         DBCHAR code;
         unsigned char c1, c2;
 
         if (c <= 0x80) {
-            WRITE1((unsigned char)c)
-            NEXT(1, 1)
+            WRITEBYTE1((unsigned char)c);
+            NEXT(1, 1);
             continue;
         }
         else if (c >= 0xff61 && c <= 0xff9f) {
-            WRITE1(c - 0xfec0)
-            NEXT(1, 1)
+            WRITEBYTE1(c - 0xfec0);
+            NEXT(1, 1);
             continue;
         }
         else if (c >= 0xf8f0 && c <= 0xf8f3) {
             /* Windows compatibility */
-            REQUIRE_OUTBUF(1)
+            REQUIRE_OUTBUF(1);
             if (c == 0xf8f0)
-                OUT1(0xa0)
+                OUTBYTE1(0xa0);
             else
-                OUT1(c - 0xfef1 + 0xfd)
-            NEXT(1, 1)
+                OUTBYTE1(c - 0xfef1 + 0xfd);
+            NEXT(1, 1);
             continue;
         }
 
-        UCS4INVALID(c)
-        REQUIRE_OUTBUF(2)
+        if (c > 0xFFFF)
+            return 1;
+        REQUIRE_OUTBUF(2);
 
-        TRYMAP_ENC(cp932ext, code, c) {
-            OUT1(code >> 8)
-            OUT2(code & 0xff)
+        if (TRYMAP_ENC(cp932ext, code, c)) {
+            OUTBYTE1(code >> 8);
+            OUTBYTE2(code & 0xff);
         }
-        else TRYMAP_ENC(jisxcommon, code, c) {
+        else if (TRYMAP_ENC(jisxcommon, code, c)) {
             if (code & 0x8000) /* MSB set: JIS X 0212 */
                 return 1;
 
@@ -61,20 +62,20 @@
             c2 = code & 0xff;
             c2 = (((c1 - 0x21) & 1) ? 0x5e : 0) + (c2 - 0x21);
             c1 = (c1 - 0x21) >> 1;
-            OUT1(c1 < 0x1f ? c1 + 0x81 : c1 + 0xc1)
-            OUT2(c2 < 0x3f ? c2 + 0x40 : c2 + 0x41)
+            OUTBYTE1(c1 < 0x1f ? c1 + 0x81 : c1 + 0xc1);
+            OUTBYTE2(c2 < 0x3f ? c2 + 0x40 : c2 + 0x41);
         }
         else if (c >= 0xe000 && c < 0xe758) {
             /* User-defined area */
-            c1 = (Py_UNICODE)(c - 0xe000) / 188;
-            c2 = (Py_UNICODE)(c - 0xe000) % 188;
-            OUT1(c1 + 0xf0)
-            OUT2(c2 < 0x3f ? c2 + 0x40 : c2 + 0x41)
+            c1 = (Py_UCS4)(c - 0xe000) / 188;
+            c2 = (Py_UCS4)(c - 0xe000) % 188;
+            OUTBYTE1(c1 + 0xf0);
+            OUTBYTE2(c2 < 0x3f ? c2 + 0x40 : c2 + 0x41);
         }
         else
             return 1;
 
-        NEXT(1, 2)
+        NEXT(1, 2);
     }
 
     return 0;
@@ -83,33 +84,34 @@
 DECODER(cp932)
 {
     while (inleft > 0) {
-        unsigned char c = IN1, c2;
+        unsigned char c = INBYTE1, c2;
+        Py_UCS4 decoded;
 
-        REQUIRE_OUTBUF(1)
         if (c <= 0x80) {
-            OUT1(c)
-            NEXT(1, 1)
+            OUTCHAR(c);
+            NEXT_IN(1);
             continue;
         }
         else if (c >= 0xa0 && c <= 0xdf) {
             if (c == 0xa0)
-                OUT1(0xf8f0) /* half-width katakana */
+                OUTCHAR(0xf8f0); /* half-width katakana */
             else
-                OUT1(0xfec0 + c)
-            NEXT(1, 1)
+                OUTCHAR(0xfec0 + c);
+            NEXT_IN(1);
             continue;
         }
         else if (c >= 0xfd/* && c <= 0xff*/) {
             /* Windows compatibility */
-            OUT1(0xf8f1 - 0xfd + c)
-            NEXT(1, 1)
+            OUTCHAR(0xf8f1 - 0xfd + c);
+            NEXT_IN(1);
             continue;
         }
 
-        REQUIRE_INBUF(2)
-        c2 = IN2;
+        REQUIRE_INBUF(2);
+        c2 = INBYTE2;
 
-        TRYMAP_DEC(cp932ext, **outbuf, c, c2);
+        if (TRYMAP_DEC(cp932ext, decoded, c, c2))
+            OUTCHAR(decoded);
         else if ((c >= 0x81 && c <= 0x9f) || (c >= 0xe0 && c <= 0xea)){
             if (c2 < 0x40 || (c2 > 0x7e && c2 < 0x80) || c2 > 0xfc)
                 return 1;
@@ -119,21 +121,23 @@
             c = (2 * c + (c2 < 0x5e ? 0 : 1) + 0x21);
             c2 = (c2 < 0x5e ? c2 : c2 - 0x5e) + 0x21;
 
-            TRYMAP_DEC(jisx0208, **outbuf, c, c2);
-            else return 1;
+            if (TRYMAP_DEC(jisx0208, decoded, c, c2))
+                OUTCHAR(decoded);
+            else
+                return 1;
         }
         else if (c >= 0xf0 && c <= 0xf9) {
             if ((c2 >= 0x40 && c2 <= 0x7e) ||
                 (c2 >= 0x80 && c2 <= 0xfc))
-                OUT1(0xe000 + 188 * (c - 0xf0) +
-                     (c2 < 0x80 ? c2 - 0x40 : c2 - 0x41))
+                OUTCHAR(0xe000 + 188 * (c - 0xf0) +
+                    (c2 < 0x80 ? c2 - 0x40 : c2 - 0x41));
             else
                 return 1;
         }
         else
             return 1;
 
-        NEXT(2, 1)
+        NEXT_IN(2);
     }
 
     return 0;
@@ -146,25 +150,24 @@
 
 ENCODER(euc_jis_2004)
 {
-    while (inleft > 0) {
-        ucs4_t c = IN1;
+    while (*inpos < inlen) {
+        Py_UCS4 c = INCHAR1;
         DBCHAR code;
         Py_ssize_t insize;
 
         if (c < 0x80) {
-            WRITE1(c)
-            NEXT(1, 1)
+            WRITEBYTE1(c);
+            NEXT(1, 1);
             continue;
         }
 
-        DECODE_SURROGATE(c)
-        insize = GET_INSIZE(c);
+        insize = 1;
 
         if (c <= 0xFFFF) {
             EMULATE_JISX0213_2000_ENCODE_BMP(code, c)
-            else TRYMAP_ENC(jisx0213_bmp, code, c) {
+            else if (TRYMAP_ENC(jisx0213_bmp, code, c)) {
                 if (code == MULTIC) {
-                    if (inleft < 2) {
+                    if (inlen - *inpos < 2) {
                         if (flags & MBENC_FLUSH) {
                             code = find_pairencmap(
                                 (ucs2_t)c, 0,
@@ -177,8 +180,9 @@
                             return MBERR_TOOFEW;
                     }
                     else {
+                        Py_UCS4 c2 = INCHAR2;
                         code = find_pairencmap(
-                            (ucs2_t)c, (*inbuf)[1],
+                            (ucs2_t)c, c2,
                             jisx0213_pair_encmap,
                             JISX0213_ENCPAIRS);
                         if (code == DBCINV) {
@@ -193,11 +197,12 @@
                     }
                 }
             }
-            else TRYMAP_ENC(jisxcommon, code, c);
+            else if (TRYMAP_ENC(jisxcommon, code, c))
+                ;
             else if (c >= 0xff61 && c <= 0xff9f) {
                 /* JIS X 0201 half-width katakana */
-                WRITE2(0x8e, c - 0xfec0)
-                NEXT(1, 2)
+                WRITEBYTE2(0x8e, c - 0xfec0);
+                NEXT(1, 2);
                 continue;
             }
             else if (c == 0xff3c)
@@ -211,20 +216,22 @@
         }
         else if (c >> 16 == EMPBASE >> 16) {
             EMULATE_JISX0213_2000_ENCODE_EMP(code, c)
-            else TRYMAP_ENC(jisx0213_emp, code, c & 0xffff);
-            else return insize;
+            else if (TRYMAP_ENC(jisx0213_emp, code, c & 0xffff))
+                ;
+            else
+                return insize;
         }
         else
             return insize;
 
         if (code & 0x8000) {
             /* Codeset 2 */
-            WRITE3(0x8f, code >> 8, (code & 0xFF) | 0x80)
-            NEXT(insize, 3)
+            WRITEBYTE3(0x8f, code >> 8, (code & 0xFF) | 0x80);
+            NEXT(insize, 3);
         } else {
             /* Codeset 1 */
-            WRITE2((code >> 8) | 0x80, (code & 0xFF) | 0x80)
-            NEXT(insize, 2)
+            WRITEBYTE2((code >> 8) | 0x80, (code & 0xFF) | 0x80);
+            NEXT(insize, 2);
         }
     }
 
@@ -234,14 +241,12 @@
 DECODER(euc_jis_2004)
 {
     while (inleft > 0) {
-        unsigned char c = IN1;
-        ucs4_t code;
-
-        REQUIRE_OUTBUF(1)
+        unsigned char c = INBYTE1;
+        Py_UCS4 code, decoded;
 
         if (c < 0x80) {
-            OUT1(c)
-            NEXT(1, 1)
+            OUTCHAR(c);
+            NEXT_IN(1);
             continue;
         }
 
@@ -249,11 +254,11 @@
             /* JIS X 0201 half-width katakana */
             unsigned char c2;
 
-            REQUIRE_INBUF(2)
-            c2 = IN2;
+            REQUIRE_INBUF(2);
+            c2 = INBYTE2;
             if (c2 >= 0xa1 && c2 <= 0xdf) {
-                OUT1(0xfec0 + c2)
-                NEXT(2, 1)
+                OUTCHAR(0xfec0 + c2);
+                NEXT_IN(2);
             }
             else
                 return 1;
@@ -261,47 +266,55 @@
         else if (c == 0x8f) {
             unsigned char c2, c3;
 
-            REQUIRE_INBUF(3)
-            c2 = IN2 ^ 0x80;
-            c3 = IN3 ^ 0x80;
+            REQUIRE_INBUF(3);
+            c2 = INBYTE2 ^ 0x80;
+            c3 = INBYTE3 ^ 0x80;
 
             /* JIS X 0213 Plane 2 or JIS X 0212 (see NOTES) */
-            EMULATE_JISX0213_2000_DECODE_PLANE2(**outbuf, c2, c3)
-            else TRYMAP_DEC(jisx0213_2_bmp, **outbuf, c2, c3) ;
-            else TRYMAP_DEC(jisx0213_2_emp, code, c2, c3) {
-                WRITEUCS4(EMPBASE | code)
-                NEXT_IN(3)
+            EMULATE_JISX0213_2000_DECODE_PLANE2(writer, c2, c3)
+            else if (TRYMAP_DEC(jisx0213_2_bmp, decoded, c2, c3))
+                OUTCHAR(decoded);
+            else if (TRYMAP_DEC(jisx0213_2_emp, code, c2, c3)) {
+                OUTCHAR(EMPBASE | code);
+                NEXT_IN(3);
                 continue;
             }
-            else TRYMAP_DEC(jisx0212, **outbuf, c2, c3) ;
-            else return 1;
-            NEXT(3, 1)
+            else if (TRYMAP_DEC(jisx0212, decoded, c2, c3))
+                OUTCHAR(decoded);
+            else
+                return 1;
+            NEXT_IN(3);
         }
         else {
             unsigned char c2;
 
-            REQUIRE_INBUF(2)
+            REQUIRE_INBUF(2);
             c ^= 0x80;
-            c2 = IN2 ^ 0x80;
+            c2 = INBYTE2 ^ 0x80;
 
             /* JIS X 0213 Plane 1 */
-            EMULATE_JISX0213_2000_DECODE_PLANE1(**outbuf, c, c2)
-            else if (c == 0x21 && c2 == 0x40) **outbuf = 0xff3c;
-            else if (c == 0x22 && c2 == 0x32) **outbuf = 0xff5e;
-            else TRYMAP_DEC(jisx0208, **outbuf, c, c2);
-            else TRYMAP_DEC(jisx0213_1_bmp, **outbuf, c, c2);
-            else TRYMAP_DEC(jisx0213_1_emp, code, c, c2) {
-                WRITEUCS4(EMPBASE | code)
-                NEXT_IN(2)
+            EMULATE_JISX0213_2000_DECODE_PLANE1(writer, c, c2)
+            else if (c == 0x21 && c2 == 0x40)
+                OUTCHAR(0xff3c);
+            else if (c == 0x22 && c2 == 0x32)
+                OUTCHAR(0xff5e);
+            else if (TRYMAP_DEC(jisx0208, decoded, c, c2))
+                OUTCHAR(decoded);
+            else if (TRYMAP_DEC(jisx0213_1_bmp, decoded, c, c2))
+                OUTCHAR(decoded);
+            else if (TRYMAP_DEC(jisx0213_1_emp, code, c, c2)) {
+                OUTCHAR(EMPBASE | code);
+                NEXT_IN(2);
                 continue;
             }
-            else TRYMAP_DEC(jisx0213_pair, code, c, c2) {
-                WRITE2(code >> 16, code & 0xffff)
-                NEXT(2, 2)
+            else if (TRYMAP_DEC(jisx0213_pair, code, c, c2)) {
+                OUTCHAR2(code >> 16, code & 0xffff);
+                NEXT_IN(2);
                 continue;
             }
-            else return 1;
-            NEXT(2, 1)
+            else
+                return 1;
+            NEXT_IN(2);
         }
     }
 
@@ -315,35 +328,37 @@
 
 ENCODER(euc_jp)
 {
-    while (inleft > 0) {
-        Py_UNICODE c = IN1;
+    while (*inpos < inlen) {
+        Py_UCS4 c = INCHAR1;
         DBCHAR code;
 
         if (c < 0x80) {
-            WRITE1((unsigned char)c)
-            NEXT(1, 1)
+            WRITEBYTE1((unsigned char)c);
+            NEXT(1, 1);
             continue;
         }
 
-        UCS4INVALID(c)
+        if (c > 0xFFFF)
+            return 1;
 
-        TRYMAP_ENC(jisxcommon, code, c);
+        if (TRYMAP_ENC(jisxcommon, code, c))
+            ;
         else if (c >= 0xff61 && c <= 0xff9f) {
             /* JIS X 0201 half-width katakana */
-            WRITE2(0x8e, c - 0xfec0)
-            NEXT(1, 2)
+            WRITEBYTE2(0x8e, c - 0xfec0);
+            NEXT(1, 2);
             continue;
         }
 #ifndef STRICT_BUILD
         else if (c == 0xff3c) /* FULL-WIDTH REVERSE SOLIDUS */
             code = 0x2140;
         else if (c == 0xa5) { /* YEN SIGN */
-            WRITE1(0x5c);
-            NEXT(1, 1)
+            WRITEBYTE1(0x5c);
+            NEXT(1, 1);
             continue;
         } else if (c == 0x203e) { /* OVERLINE */
-            WRITE1(0x7e);
-            NEXT(1, 1)
+            WRITEBYTE1(0x7e);
+            NEXT(1, 1);
             continue;
         }
 #endif
@@ -352,12 +367,12 @@
 
         if (code & 0x8000) {
             /* JIS X 0212 */
-            WRITE3(0x8f, code >> 8, (code & 0xFF) | 0x80)
-            NEXT(1, 3)
+            WRITEBYTE3(0x8f, code >> 8, (code & 0xFF) | 0x80);
+            NEXT(1, 3);
         } else {
             /* JIS X 0208 */
-            WRITE2((code >> 8) | 0x80, (code & 0xFF) | 0x80)
-            NEXT(1, 2)
+            WRITEBYTE2((code >> 8) | 0x80, (code & 0xFF) | 0x80);
+            NEXT(1, 2);
         }
     }
 
@@ -367,13 +382,12 @@
 DECODER(euc_jp)
 {
     while (inleft > 0) {
-        unsigned char c = IN1;
-
-        REQUIRE_OUTBUF(1)
+        unsigned char c = INBYTE1;
+        Py_UCS4 decoded;
 
         if (c < 0x80) {
-            OUT1(c)
-            NEXT(1, 1)
+            OUTCHAR(c);
+            NEXT_IN(1);
             continue;
         }
 
@@ -381,11 +395,11 @@
             /* JIS X 0201 half-width katakana */
             unsigned char c2;
 
-            REQUIRE_INBUF(2)
-            c2 = IN2;
+            REQUIRE_INBUF(2);
+            c2 = INBYTE2;
             if (c2 >= 0xa1 && c2 <= 0xdf) {
-                OUT1(0xfec0 + c2)
-                NEXT(2, 1)
+                OUTCHAR(0xfec0 + c2);
+                NEXT_IN(2);
             }
             else
                 return 1;
@@ -393,12 +407,13 @@
         else if (c == 0x8f) {
             unsigned char c2, c3;
 
-            REQUIRE_INBUF(3)
-            c2 = IN2;
-            c3 = IN3;
+            REQUIRE_INBUF(3);
+            c2 = INBYTE2;
+            c3 = INBYTE3;
             /* JIS X 0212 */
-            TRYMAP_DEC(jisx0212, **outbuf, c2 ^ 0x80, c3 ^ 0x80) {
-                NEXT(3, 1)
+            if (TRYMAP_DEC(jisx0212, decoded, c2 ^ 0x80, c3 ^ 0x80)) {
+                OUTCHAR(decoded);
+                NEXT_IN(3);
             }
             else
                 return 1;
@@ -406,19 +421,20 @@
         else {
             unsigned char c2;
 
-            REQUIRE_INBUF(2)
-            c2 = IN2;
+            REQUIRE_INBUF(2);
+            c2 = INBYTE2;
             /* JIS X 0208 */
 #ifndef STRICT_BUILD
             if (c == 0xa1 && c2 == 0xc0)
                 /* FULL-WIDTH REVERSE SOLIDUS */
-                **outbuf = 0xff3c;
+                OUTCHAR(0xff3c);
             else
 #endif
-                TRYMAP_DEC(jisx0208, **outbuf,
-                           c ^ 0x80, c2 ^ 0x80) ;
-            else return 1;
-            NEXT(2, 1)
+            if (TRYMAP_DEC(jisx0208, decoded, c ^ 0x80, c2 ^ 0x80))
+                OUTCHAR(decoded);
+            else
+                return 1;
+            NEXT_IN(2);
         }
     }
 
@@ -432,34 +448,40 @@
 
 ENCODER(shift_jis)
 {
-    while (inleft > 0) {
-        Py_UNICODE c = IN1;
+    while (*inpos < inlen) {
+        Py_UCS4 c = INCHAR1;
         DBCHAR code;
         unsigned char c1, c2;
 
 #ifdef STRICT_BUILD
         JISX0201_R_ENCODE(c, code)
 #else
-        if (c < 0x80) code = c;
-        else if (c == 0x00a5) code = 0x5c; /* YEN SIGN */
-        else if (c == 0x203e) code = 0x7e; /* OVERLINE */
+        if (c < 0x80)
+            code = c;
+        else if (c == 0x00a5)
+            code = 0x5c; /* YEN SIGN */
+        else if (c == 0x203e)
+            code = 0x7e; /* OVERLINE */
 #endif
         else JISX0201_K_ENCODE(c, code)
-        else UCS4INVALID(c)
-        else code = NOCHAR;
+        else if (c > 0xFFFF)
+            return 1;
+        else
+            code = NOCHAR;
 
         if (code < 0x80 || (code >= 0xa1 && code <= 0xdf)) {
-            REQUIRE_OUTBUF(1)
+            REQUIRE_OUTBUF(1);
 
-            OUT1((unsigned char)code)
-            NEXT(1, 1)
+            OUTBYTE1((unsigned char)code);
+            NEXT(1, 1);
             continue;
         }
 
-        REQUIRE_OUTBUF(2)
+        REQUIRE_OUTBUF(2);
 
         if (code == NOCHAR) {
-            TRYMAP_ENC(jisxcommon, code, c);
+            if (TRYMAP_ENC(jisxcommon, code, c))
+                ;
 #ifndef STRICT_BUILD
             else if (c == 0xff3c)
                 code = 0x2140; /* FULL-WIDTH REVERSE SOLIDUS */
@@ -475,9 +497,9 @@
         c2 = code & 0xff;
         c2 = (((c1 - 0x21) & 1) ? 0x5e : 0) + (c2 - 0x21);
         c1 = (c1 - 0x21) >> 1;
-        OUT1(c1 < 0x1f ? c1 + 0x81 : c1 + 0xc1)
-        OUT2(c2 < 0x3f ? c2 + 0x40 : c2 + 0x41)
-        NEXT(1, 2)
+        OUTBYTE1(c1 < 0x1f ? c1 + 0x81 : c1 + 0xc1);
+        OUTBYTE2(c2 < 0x3f ? c2 + 0x40 : c2 + 0x41);
+        NEXT(1, 2);
     }
 
     return 0;
@@ -486,21 +508,21 @@
 DECODER(shift_jis)
 {
     while (inleft > 0) {
-        unsigned char c = IN1;
-
-        REQUIRE_OUTBUF(1)
+        unsigned char c = INBYTE1;
+        Py_UCS4 decoded;
 
 #ifdef STRICT_BUILD
-        JISX0201_R_DECODE(c, **outbuf)
+        JISX0201_R_DECODE(c, writer)
 #else
-        if (c < 0x80) **outbuf = c;
+        if (c < 0x80)
+            OUTCHAR(c);
 #endif
-        else JISX0201_K_DECODE(c, **outbuf)
+        else JISX0201_K_DECODE(c, writer)
         else if ((c >= 0x81 && c <= 0x9f) || (c >= 0xe0 && c <= 0xea)){
             unsigned char c1, c2;
 
-            REQUIRE_INBUF(2)
-            c2 = IN2;
+            REQUIRE_INBUF(2);
+            c2 = INBYTE2;
             if (c2 < 0x40 || (c2 > 0x7e && c2 < 0x80) || c2 > 0xfc)
                 return 1;
 
@@ -512,13 +534,14 @@
 #ifndef STRICT_BUILD
             if (c1 == 0x21 && c2 == 0x40) {
                 /* FULL-WIDTH REVERSE SOLIDUS */
-                OUT1(0xff3c)
-                NEXT(2, 1)
+                OUTCHAR(0xff3c);
+                NEXT_IN(2);
                 continue;
             }
 #endif
-            TRYMAP_DEC(jisx0208, **outbuf, c1, c2) {
-                NEXT(2, 1)
+            if (TRYMAP_DEC(jisx0208, decoded, c1, c2)) {
+                OUTCHAR(decoded);
+                NEXT_IN(2);
                 continue;
             }
             else
@@ -527,7 +550,7 @@
         else
             return 1;
 
-        NEXT(1, 1) /* JIS X 0201 */
+        NEXT_IN(1); /* JIS X 0201 */
     }
 
     return 0;
@@ -540,30 +563,29 @@
 
 ENCODER(shift_jis_2004)
 {
-    while (inleft > 0) {
-        ucs4_t c = IN1;
+    while (*inpos < inlen) {
+        Py_UCS4 c = INCHAR1;
         DBCHAR code = NOCHAR;
         int c1, c2;
         Py_ssize_t insize;
 
         JISX0201_ENCODE(c, code)
-        else DECODE_SURROGATE(c)
 
         if (code < 0x80 || (code >= 0xa1 && code <= 0xdf)) {
-            WRITE1((unsigned char)code)
-            NEXT(1, 1)
+            WRITEBYTE1((unsigned char)code);
+            NEXT(1, 1);
             continue;
         }
 
-        REQUIRE_OUTBUF(2)
-        insize = GET_INSIZE(c);
+        REQUIRE_OUTBUF(2);
+        insize = 1;
 
         if (code == NOCHAR) {
             if (c <= 0xffff) {
                 EMULATE_JISX0213_2000_ENCODE_BMP(code, c)
-                else TRYMAP_ENC(jisx0213_bmp, code, c) {
+                else if (TRYMAP_ENC(jisx0213_bmp, code, c)) {
                     if (code == MULTIC) {
-                        if (inleft < 2) {
+                        if (inlen - *inpos < 2) {
                             if (flags & MBENC_FLUSH) {
                             code = find_pairencmap
                                 ((ucs2_t)c, 0,
@@ -576,8 +598,9 @@
                                 return MBERR_TOOFEW;
                         }
                         else {
+                            Py_UCS4 ch2 = INCHAR2;
                             code = find_pairencmap(
-                                (ucs2_t)c, IN2,
+                                (ucs2_t)c, ch2,
                               jisx0213_pair_encmap,
                                 JISX0213_ENCPAIRS);
                             if (code == DBCINV) {
@@ -593,17 +616,20 @@
                         }
                     }
                 }
-                else TRYMAP_ENC(jisxcommon, code, c) {
+                else if (TRYMAP_ENC(jisxcommon, code, c)) {
                     /* abandon JIS X 0212 codes */
                     if (code & 0x8000)
                         return 1;
                 }
-                else return 1;
+                else
+                    return 1;
             }
             else if (c >> 16 == EMPBASE >> 16) {
                 EMULATE_JISX0213_2000_ENCODE_EMP(code, c)
-                else TRYMAP_ENC(jisx0213_emp, code, c&0xffff);
-                else return insize;
+                else if (TRYMAP_ENC(jisx0213_emp, code, c&0xffff))
+                    ;
+                else
+                    return insize;
             }
             else
                 return insize;
@@ -612,20 +638,27 @@
         c1 = code >> 8;
         c2 = (code & 0xff) - 0x21;
 
-        if (c1 & 0x80) { /* Plane 2 */
-            if (c1 >= 0xee) c1 -= 0x87;
-            else if (c1 >= 0xac || c1 == 0xa8) c1 -= 0x49;
-            else c1 -= 0x43;
+        if (c1 & 0x80) {
+            /* Plane 2 */
+            if (c1 >= 0xee)
+                c1 -= 0x87;
+            else if (c1 >= 0xac || c1 == 0xa8)
+                c1 -= 0x49;
+            else
+                c1 -= 0x43;
         }
-        else /* Plane 1 */
+        else {
+            /* Plane 1 */
             c1 -= 0x21;
+        }
 
-        if (c1 & 1) c2 += 0x5e;
+        if (c1 & 1)
+            c2 += 0x5e;
         c1 >>= 1;
-        OUT1(c1 + (c1 < 0x1f ? 0x81 : 0xc1))
-        OUT2(c2 + (c2 < 0x3f ? 0x40 : 0x41))
+        OUTBYTE1(c1 + (c1 < 0x1f ? 0x81 : 0xc1));
+        OUTBYTE2(c2 + (c2 < 0x3f ? 0x40 : 0x41));
 
-        NEXT(insize, 2)
+        NEXT(insize, 2);
     }
 
     return 0;
@@ -634,16 +667,15 @@
 DECODER(shift_jis_2004)
 {
     while (inleft > 0) {
-        unsigned char c = IN1;
+        unsigned char c = INBYTE1;
 
-        REQUIRE_OUTBUF(1)
-        JISX0201_DECODE(c, **outbuf)
+        JISX0201_DECODE(c, writer)
         else if ((c >= 0x81 && c <= 0x9f) || (c >= 0xe0 && c <= 0xfc)){
             unsigned char c1, c2;
-            ucs4_t code;
+            Py_UCS4 code, decoded;
 
-            REQUIRE_INBUF(2)
-            c2 = IN2;
+            REQUIRE_INBUF(2);
+            c2 = INBYTE2;
             if (c2 < 0x40 || (c2 > 0x7e && c2 < 0x80) || c2 > 0xfc)
                 return 1;
 
@@ -654,50 +686,47 @@
 
             if (c1 < 0x5e) { /* Plane 1 */
                 c1 += 0x21;
-                EMULATE_JISX0213_2000_DECODE_PLANE1(**outbuf,
+                EMULATE_JISX0213_2000_DECODE_PLANE1(writer,
                                 c1, c2)
-                else TRYMAP_DEC(jisx0208, **outbuf, c1, c2) {
-                    NEXT_OUT(1)
-                }
-                else TRYMAP_DEC(jisx0213_1_bmp, **outbuf,
-                                c1, c2) {
-                    NEXT_OUT(1)
-                }
-                else TRYMAP_DEC(jisx0213_1_emp, code, c1, c2) {
-                    WRITEUCS4(EMPBASE | code)
-                }
-                else TRYMAP_DEC(jisx0213_pair, code, c1, c2) {
-                    WRITE2(code >> 16, code & 0xffff)
-                    NEXT_OUT(2)
-                }
+                else if (TRYMAP_DEC(jisx0208, decoded, c1, c2))
+                    OUTCHAR(decoded);
+                else if (TRYMAP_DEC(jisx0213_1_bmp, decoded, c1, c2))
+                    OUTCHAR(decoded);
+                else if (TRYMAP_DEC(jisx0213_1_emp, code, c1, c2))
+                    OUTCHAR(EMPBASE | code);
+                else if (TRYMAP_DEC(jisx0213_pair, code, c1, c2))
+                    OUTCHAR2(code >> 16, code & 0xffff);
                 else
                     return 1;
-                NEXT_IN(2)
+                NEXT_IN(2);
             }
             else { /* Plane 2 */
-                if (c1 >= 0x67) c1 += 0x07;
-                else if (c1 >= 0x63 || c1 == 0x5f) c1 -= 0x37;
-                else c1 -= 0x3d;
+                if (c1 >= 0x67)
+                    c1 += 0x07;
+                else if (c1 >= 0x63 || c1 == 0x5f)
+                    c1 -= 0x37;
+                else
+                    c1 -= 0x3d;
 
-                EMULATE_JISX0213_2000_DECODE_PLANE2(**outbuf,
+                EMULATE_JISX0213_2000_DECODE_PLANE2(writer,
                                 c1, c2)
-                else TRYMAP_DEC(jisx0213_2_bmp, **outbuf,
-                                c1, c2) ;
-                else TRYMAP_DEC(jisx0213_2_emp, code, c1, c2) {
-                    WRITEUCS4(EMPBASE | code)
-                    NEXT_IN(2)
+                else if (TRYMAP_DEC(jisx0213_2_bmp, decoded, c1, c2))
+                    OUTCHAR(decoded);
+                else if (TRYMAP_DEC(jisx0213_2_emp, code, c1, c2)) {
+                    OUTCHAR(EMPBASE | code);
+                    NEXT_IN(2);
                     continue;
                 }
                 else
                     return 1;
-                NEXT(2, 1)
+                NEXT_IN(2);
             }
             continue;
         }
         else
             return 1;
 
-        NEXT(1, 1) /* JIS X 0201 */
+        NEXT_IN(1); /* JIS X 0201 */
     }
 
     return 0;
diff --git a/Modules/cjkcodecs/_codecs_kr.c b/Modules/cjkcodecs/_codecs_kr.c
index f5697dd..6d6acb5 100644
--- a/Modules/cjkcodecs/_codecs_kr.c
+++ b/Modules/cjkcodecs/_codecs_kr.c
@@ -33,51 +33,56 @@
 
 ENCODER(euc_kr)
 {
-    while (inleft > 0) {
-        Py_UNICODE c = IN1;
+    while (*inpos < inlen) {
+        Py_UCS4 c = INCHAR1;
         DBCHAR code;
 
         if (c < 0x80) {
-            WRITE1((unsigned char)c)
-            NEXT(1, 1)
+            WRITEBYTE1((unsigned char)c);
+            NEXT(1, 1);
             continue;
         }
-        UCS4INVALID(c)
 
-        REQUIRE_OUTBUF(2)
-        TRYMAP_ENC(cp949, code, c);
-        else return 1;
+        if (c > 0xFFFF)
+            return 1;
+
+        REQUIRE_OUTBUF(2);
+        if (TRYMAP_ENC(cp949, code, c))
+            ;
+        else
+            return 1;
 
         if ((code & 0x8000) == 0) {
             /* KS X 1001 coded character */
-            OUT1((code >> 8) | 0x80)
-            OUT2((code & 0xFF) | 0x80)
-            NEXT(1, 2)
+            OUTBYTE1((code >> 8) | 0x80);
+            OUTBYTE2((code & 0xFF) | 0x80);
+            NEXT(1, 2);
         }
-        else {          /* Mapping is found in CP949 extension,
-                 * but we encode it in KS X 1001:1998 Annex 3,
-                 * make-up sequence for EUC-KR. */
+        else {
+            /* Mapping is found in CP949 extension,
+               but we encode it in KS X 1001:1998 Annex 3,
+               make-up sequence for EUC-KR. */
 
-            REQUIRE_OUTBUF(8)
+            REQUIRE_OUTBUF(8);
 
             /* syllable composition precedence */
-            OUT1(EUCKR_JAMO_FIRSTBYTE)
-            OUT2(EUCKR_JAMO_FILLER)
+            OUTBYTE1(EUCKR_JAMO_FIRSTBYTE);
+            OUTBYTE2(EUCKR_JAMO_FILLER);
 
-            /* All codepoints in CP949 extension are in unicode
+            /* All code points in CP949 extension are in unicode
              * Hangul Syllable area. */
             assert(0xac00 <= c && c <= 0xd7a3);
             c -= 0xac00;
 
-            OUT3(EUCKR_JAMO_FIRSTBYTE)
-            OUT4(u2cgk_choseong[c / 588])
-            NEXT_OUT(4)
+            OUTBYTE3(EUCKR_JAMO_FIRSTBYTE);
+            OUTBYTE4(u2cgk_choseong[c / 588]);
+            NEXT_OUT(4);
 
-            OUT1(EUCKR_JAMO_FIRSTBYTE)
-            OUT2(u2cgk_jungseong[(c / 28) % 21])
-            OUT3(EUCKR_JAMO_FIRSTBYTE)
-            OUT4(u2cgk_jongseong[c % 28])
-            NEXT(1, 4)
+            OUTBYTE1(EUCKR_JAMO_FIRSTBYTE);
+            OUTBYTE2(u2cgk_jungseong[(c / 28) % 21]);
+            OUTBYTE3(EUCKR_JAMO_FIRSTBYTE);
+            OUTBYTE4(u2cgk_jongseong[c % 28]);
+            NEXT(1, 4);
         }
     }
 
@@ -102,24 +107,23 @@
 DECODER(euc_kr)
 {
     while (inleft > 0) {
-        unsigned char c = IN1;
-
-        REQUIRE_OUTBUF(1)
+        unsigned char c = INBYTE1;
+        Py_UCS4 decoded;
 
         if (c < 0x80) {
-            OUT1(c)
-            NEXT(1, 1)
+            OUTCHAR(c);
+            NEXT_IN(1);
             continue;
         }
 
-        REQUIRE_INBUF(2)
+        REQUIRE_INBUF(2);
 
         if (c == EUCKR_JAMO_FIRSTBYTE &&
-            IN2 == EUCKR_JAMO_FILLER) {
+            INBYTE2 == EUCKR_JAMO_FILLER) {
             /* KS X 1001:1998 Annex 3 make-up sequence */
             DBCHAR cho, jung, jong;
 
-            REQUIRE_INBUF(8)
+            REQUIRE_INBUF(8);
             if ((*inbuf)[2] != EUCKR_JAMO_FIRSTBYTE ||
                 (*inbuf)[4] != EUCKR_JAMO_FIRSTBYTE ||
                 (*inbuf)[6] != EUCKR_JAMO_FIRSTBYTE)
@@ -145,11 +149,12 @@
             if (cho == NONE || jung == NONE || jong == NONE)
                 return 1;
 
-            OUT1(0xac00 + cho*588 + jung*28 + jong);
-            NEXT(8, 1)
+            OUTCHAR(0xac00 + cho*588 + jung*28 + jong);
+            NEXT_IN(8);
         }
-        else TRYMAP_DEC(ksx1001, **outbuf, c ^ 0x80, IN2 ^ 0x80) {
-            NEXT(2, 1)
+        else if (TRYMAP_DEC(ksx1001, decoded, c ^ 0x80, INBYTE2 ^ 0x80)) {
+            OUTCHAR(decoded);
+            NEXT_IN(2);
         }
         else
             return 1;
@@ -166,27 +171,31 @@
 
 ENCODER(cp949)
 {
-    while (inleft > 0) {
-        Py_UNICODE c = IN1;
+    while (*inpos < inlen) {
+        Py_UCS4 c = INCHAR1;
         DBCHAR code;
 
         if (c < 0x80) {
-            WRITE1((unsigned char)c)
-            NEXT(1, 1)
+            WRITEBYTE1((unsigned char)c);
+            NEXT(1, 1);
             continue;
         }
-        UCS4INVALID(c)
 
-        REQUIRE_OUTBUF(2)
-        TRYMAP_ENC(cp949, code, c);
-        else return 1;
+        if (c > 0xFFFF)
+            return 1;
 
-        OUT1((code >> 8) | 0x80)
-        if (code & 0x8000)
-            OUT2(code & 0xFF) /* MSB set: CP949 */
+        REQUIRE_OUTBUF(2);
+        if (TRYMAP_ENC(cp949, code, c))
+            ;
         else
-            OUT2((code & 0xFF) | 0x80) /* MSB unset: ks x 1001 */
-        NEXT(1, 2)
+            return 1;
+
+        OUTBYTE1((code >> 8) | 0x80);
+        if (code & 0x8000)
+            OUTBYTE2(code & 0xFF); /* MSB set: CP949 */
+        else
+            OUTBYTE2((code & 0xFF) | 0x80); /* MSB unset: ks x 1001 */
+        NEXT(1, 2);
     }
 
     return 0;
@@ -195,22 +204,24 @@
 DECODER(cp949)
 {
     while (inleft > 0) {
-        unsigned char c = IN1;
-
-        REQUIRE_OUTBUF(1)
+        unsigned char c = INBYTE1;
+        Py_UCS4 decoded;
 
         if (c < 0x80) {
-            OUT1(c)
-            NEXT(1, 1)
+            OUTCHAR(c);
+            NEXT_IN(1);
             continue;
         }
 
-        REQUIRE_INBUF(2)
-        TRYMAP_DEC(ksx1001, **outbuf, c ^ 0x80, IN2 ^ 0x80);
-        else TRYMAP_DEC(cp949ext, **outbuf, c, IN2);
-        else return 1;
+        REQUIRE_INBUF(2);
+        if (TRYMAP_DEC(ksx1001, decoded, c ^ 0x80, INBYTE2 ^ 0x80))
+            OUTCHAR(decoded);
+        else if (TRYMAP_DEC(cp949ext, decoded, c, INBYTE2))
+            OUTCHAR(decoded);
+        else
+            return 1;
 
-        NEXT(2, 1)
+        NEXT_IN(2);
     }
 
     return 0;
@@ -250,18 +261,20 @@
 
 ENCODER(johab)
 {
-    while (inleft > 0) {
-        Py_UNICODE c = IN1;
+    while (*inpos < inlen) {
+        Py_UCS4 c = INCHAR1;
         DBCHAR code;
 
         if (c < 0x80) {
-            WRITE1((unsigned char)c)
-            NEXT(1, 1)
+            WRITEBYTE1((unsigned char)c);
+            NEXT(1, 1);
             continue;
         }
-        UCS4INVALID(c)
 
-        REQUIRE_OUTBUF(2)
+        if (c > 0xFFFF)
+            return 1;
+
+        REQUIRE_OUTBUF(2);
 
         if (c >= 0xac00 && c <= 0xd7a3) {
             c -= 0xac00;
@@ -272,7 +285,7 @@
         }
         else if (c >= 0x3131 && c <= 0x3163)
             code = u2johabjamo[c - 0x3131];
-        else TRYMAP_ENC(cp949, code, c) {
+        else if (TRYMAP_ENC(cp949, code, c)) {
             unsigned char c1, c2, t2;
             unsigned short t1;
 
@@ -285,9 +298,9 @@
                 t1 = (c1 < 0x4a ? (c1 - 0x21 + 0x1b2) :
                           (c1 - 0x21 + 0x197));
                 t2 = ((t1 & 1) ? 0x5e : 0) + (c2 - 0x21);
-                OUT1(t1 >> 1)
-                OUT2(t2 < 0x4e ? t2 + 0x31 : t2 + 0x43)
-                NEXT(1, 2)
+                OUTBYTE1(t1 >> 1);
+                OUTBYTE2(t2 < 0x4e ? t2 + 0x31 : t2 + 0x43);
+                NEXT(1, 2);
                 continue;
             }
             else
@@ -296,9 +309,9 @@
         else
             return 1;
 
-        OUT1(code >> 8)
-        OUT2(code & 0xff)
-        NEXT(1, 2)
+        OUTBYTE1(code >> 8);
+        OUTBYTE2(code & 0xff);
+        NEXT(1, 2);
     }
 
     return 0;
@@ -348,18 +361,17 @@
 DECODER(johab)
 {
     while (inleft > 0) {
-        unsigned char    c = IN1, c2;
-
-        REQUIRE_OUTBUF(1)
+        unsigned char c = INBYTE1, c2;
+        Py_UCS4 decoded;
 
         if (c < 0x80) {
-            OUT1(c)
-            NEXT(1, 1)
+            OUTCHAR(c);
+            NEXT_IN(1);
             continue;
         }
 
-        REQUIRE_INBUF(2)
-        c2 = IN2;
+        REQUIRE_INBUF(2);
+        c2 = INBYTE2;
 
         if (c < 0xd8) {
             /* johab hangul */
@@ -381,33 +393,33 @@
             if (i_cho == FILL) {
                 if (i_jung == FILL) {
                     if (i_jong == FILL)
-                        OUT1(0x3000)
+                        OUTCHAR(0x3000);
                     else
-                        OUT1(0x3100 |
-                          johabjamo_jongseong[c_jong])
+                        OUTCHAR(0x3100 |
+                            johabjamo_jongseong[c_jong]);
                 }
                 else {
                     if (i_jong == FILL)
-                        OUT1(0x3100 |
-                          johabjamo_jungseong[c_jung])
+                        OUTCHAR(0x3100 |
+                            johabjamo_jungseong[c_jung]);
                     else
                         return 1;
                 }
             } else {
                 if (i_jung == FILL) {
                     if (i_jong == FILL)
-                        OUT1(0x3100 |
-                          johabjamo_choseong[c_cho])
+                        OUTCHAR(0x3100 |
+                            johabjamo_choseong[c_cho]);
                     else
                         return 1;
                 }
                 else
-                    OUT1(0xac00 +
-                         i_cho * 588 +
-                         i_jung * 28 +
-                         (i_jong == FILL ? 0 : i_jong))
+                    OUTCHAR(0xac00 +
+                        i_cho * 588 +
+                        i_jung * 28 +
+                        (i_jong == FILL ? 0 : i_jong));
             }
-            NEXT(2, 1)
+            NEXT_IN(2);
         } else {
             /* KS X 1001 except hangul jamos and syllables */
             if (c == 0xdf || c > 0xf9 ||
@@ -424,9 +436,13 @@
                 t1 = t1 + (t2 < 0x5e ? 0 : 1) + 0x21;
                 t2 = (t2 < 0x5e ? t2 : t2 - 0x5e) + 0x21;
 
-                TRYMAP_DEC(ksx1001, **outbuf, t1, t2);
-                else return 1;
-                NEXT(2, 1)
+                if (TRYMAP_DEC(ksx1001, decoded, t1, t2)) {
+                    OUTCHAR(decoded);
+                    NEXT_IN(2);
+                }
+                else {
+                    return 1;
+                }
             }
         }
     }
diff --git a/Modules/cjkcodecs/_codecs_tw.c b/Modules/cjkcodecs/_codecs_tw.c
index 916298d..722b26b 100644
--- a/Modules/cjkcodecs/_codecs_tw.c
+++ b/Modules/cjkcodecs/_codecs_tw.c
@@ -13,26 +13,30 @@
 
 ENCODER(big5)
 {
-    while (inleft > 0) {
-        Py_UNICODE c = **inbuf;
+    while (*inpos < inlen) {
+        Py_UCS4 c = INCHAR1;
         DBCHAR code;
 
         if (c < 0x80) {
-            REQUIRE_OUTBUF(1)
+            REQUIRE_OUTBUF(1);
             **outbuf = (unsigned char)c;
-            NEXT(1, 1)
+            NEXT(1, 1);
             continue;
         }
-        UCS4INVALID(c)
 
-        REQUIRE_OUTBUF(2)
+        if (c > 0xFFFF)
+            return 1;
 
-        TRYMAP_ENC(big5, code, c);
-        else return 1;
+        REQUIRE_OUTBUF(2);
 
-        OUT1(code >> 8)
-        OUT2(code & 0xFF)
-        NEXT(1, 2)
+        if (TRYMAP_ENC(big5, code, c))
+            ;
+        else
+            return 1;
+
+        OUTBYTE1(code >> 8);
+        OUTBYTE2(code & 0xFF);
+        NEXT(1, 2);
     }
 
     return 0;
@@ -41,19 +45,19 @@
 DECODER(big5)
 {
     while (inleft > 0) {
-        unsigned char c = IN1;
-
-        REQUIRE_OUTBUF(1)
+        unsigned char c = INBYTE1;
+        Py_UCS4 decoded;
 
         if (c < 0x80) {
-            OUT1(c)
-            NEXT(1, 1)
+            OUTCHAR(c);
+            NEXT_IN(1);
             continue;
         }
 
-        REQUIRE_INBUF(2)
-        TRYMAP_DEC(big5, **outbuf, c, IN2) {
-            NEXT(2, 1)
+        REQUIRE_INBUF(2);
+        if (TRYMAP_DEC(big5, decoded, c, INBYTE2)) {
+            OUTCHAR(decoded);
+            NEXT_IN(2);
         }
         else return 1;
     }
@@ -68,25 +72,30 @@
 
 ENCODER(cp950)
 {
-    while (inleft > 0) {
-        Py_UNICODE c = IN1;
+    while (*inpos < inlen) {
+        Py_UCS4 c = INCHAR1;
         DBCHAR code;
 
         if (c < 0x80) {
-            WRITE1((unsigned char)c)
-            NEXT(1, 1)
+            WRITEBYTE1((unsigned char)c);
+            NEXT(1, 1);
             continue;
         }
-        UCS4INVALID(c)
 
-        REQUIRE_OUTBUF(2)
-        TRYMAP_ENC(cp950ext, code, c);
-        else TRYMAP_ENC(big5, code, c);
-        else return 1;
+        if (c > 0xFFFF)
+            return 1;
 
-        OUT1(code >> 8)
-        OUT2(code & 0xFF)
-        NEXT(1, 2)
+        REQUIRE_OUTBUF(2);
+        if (TRYMAP_ENC(cp950ext, code, c))
+            ;
+        else if (TRYMAP_ENC(big5, code, c))
+            ;
+        else
+            return 1;
+
+        OUTBYTE1(code >> 8);
+        OUTBYTE2(code & 0xFF);
+        NEXT(1, 2);
     }
 
     return 0;
@@ -95,23 +104,25 @@
 DECODER(cp950)
 {
     while (inleft > 0) {
-        unsigned char c = IN1;
-
-        REQUIRE_OUTBUF(1)
+        unsigned char c = INBYTE1;
+        Py_UCS4 decoded;
 
         if (c < 0x80) {
-            OUT1(c)
-            NEXT(1, 1)
+            OUTCHAR(c);
+            NEXT_IN(1);
             continue;
         }
 
-        REQUIRE_INBUF(2)
+        REQUIRE_INBUF(2);
 
-        TRYMAP_DEC(cp950ext, **outbuf, c, IN2);
-        else TRYMAP_DEC(big5, **outbuf, c, IN2);
-        else return 1;
+        if (TRYMAP_DEC(cp950ext, decoded, c, INBYTE2))
+            OUTCHAR(decoded);
+        else if (TRYMAP_DEC(big5, decoded, c, INBYTE2))
+            OUTCHAR(decoded);
+        else
+            return 1;
 
-        NEXT(2, 1)
+        NEXT_IN(2);
     }
 
     return 0;
diff --git a/Modules/cjkcodecs/alg_jisx0201.h b/Modules/cjkcodecs/alg_jisx0201.h
index 0bc7db5..3034b5a 100644
--- a/Modules/cjkcodecs/alg_jisx0201.h
+++ b/Modules/cjkcodecs/alg_jisx0201.h
@@ -1,24 +1,65 @@
 #define JISX0201_R_ENCODE(c, assi)                      \
-    if ((c) < 0x80 && (c) != 0x5c && (c) != 0x7e)       \
+    if ((c) < 0x80 && (c) != 0x5c && (c) != 0x7e) {     \
         (assi) = (c);                                   \
-    else if ((c) == 0x00a5) (assi) = 0x5c;              \
-    else if ((c) == 0x203e) (assi) = 0x7e;
+    }                                                   \
+    else if ((c) == 0x00a5) {                           \
+        (assi) = 0x5c;                                  \
+    }                                                   \
+    else if ((c) == 0x203e) {                           \
+        (assi) = 0x7e;                                  \
+    }
+
 #define JISX0201_K_ENCODE(c, assi)                      \
-    if ((c) >= 0xff61 && (c) <= 0xff9f)                 \
-        (assi) = (c) - 0xfec0;
+    if ((c) >= 0xff61 && (c) <= 0xff9f) {               \
+        (assi) = (c) - 0xfec0;                          \
+    }
+
 #define JISX0201_ENCODE(c, assi)                        \
     JISX0201_R_ENCODE(c, assi)                          \
     else JISX0201_K_ENCODE(c, assi)
 
-#define JISX0201_R_DECODE(c, assi)                      \
-    if ((c) < 0x5c) (assi) = (c);                       \
-    else if ((c) == 0x5c) (assi) = 0x00a5;              \
-    else if ((c) < 0x7e) (assi) = (c);                  \
-    else if ((c) == 0x7e) (assi) = 0x203e;              \
-    else if ((c) == 0x7f) (assi) = 0x7f;
-#define JISX0201_K_DECODE(c, assi)                      \
-    if ((c) >= 0xa1 && (c) <= 0xdf)                     \
-    (assi) = 0xfec0 + (c);
-#define JISX0201_DECODE(c, assi)                        \
-    JISX0201_R_DECODE(c, assi)                          \
-    else JISX0201_K_DECODE(c, assi)
+#define JISX0201_R_DECODE_CHAR(c, assi)                 \
+    if ((c) < 0x5c) {                                   \
+        (assi) = (c);                                   \
+    }                                                   \
+    else if ((c) == 0x5c) {                             \
+        (assi) = 0x00a5;                                \
+    }                                                   \
+    else if ((c) < 0x7e) {                              \
+        (assi) = (c);                                   \
+    }                                                   \
+    else if ((c) == 0x7e) {                             \
+        (assi) = 0x203e;                                \
+    }                                                   \
+    else if ((c) == 0x7f) {                             \
+        (assi) = 0x7f;                                  \
+    }
+
+#define JISX0201_R_DECODE(c, writer)                    \
+    if ((c) < 0x5c) {                                   \
+        OUTCHAR(c);                                     \
+    }                                                   \
+    else if ((c) == 0x5c) {                             \
+        OUTCHAR(0x00a5);                                \
+    }                                                   \
+    else if ((c) < 0x7e) {                              \
+        OUTCHAR(c);                                     \
+    }                                                   \
+    else if ((c) == 0x7e) {                             \
+        OUTCHAR(0x203e);                                \
+    }                                                   \
+    else if ((c) == 0x7f) {                             \
+        OUTCHAR(0x7f);                                  \
+    }
+
+#define JISX0201_K_DECODE(c, writer)                    \
+    if ((c) >= 0xa1 && (c) <= 0xdf) {                   \
+        OUTCHAR(0xfec0 + (c));                          \
+    }
+#define JISX0201_K_DECODE_CHAR(c, assi)                 \
+    if ((c) >= 0xa1 && (c) <= 0xdf) {                   \
+        (assi) = 0xfec0 + (c);                          \
+    }
+#define JISX0201_DECODE(c, writer)                      \
+    JISX0201_R_DECODE(c, writer)                        \
+    else JISX0201_K_DECODE(c, writer)
diff --git a/Modules/cjkcodecs/cjkcodecs.h b/Modules/cjkcodecs/cjkcodecs.h
index ab0682a..d15ccfb 100644
--- a/Modules/cjkcodecs/cjkcodecs.h
+++ b/Modules/cjkcodecs/cjkcodecs.h
@@ -12,10 +12,10 @@
 #include "multibytecodec.h"
 
 
-/* a unicode "undefined" codepoint */
+/* a unicode "undefined" code point */
 #define UNIINV  0xFFFE
 
-/* internal-use DBCS codepoints which aren't used by any charsets */
+/* internal-use DBCS code points which aren't used by any charsets */
 #define NOCHAR  0xFFFF
 #define MULTIC  0xFFFE
 #define DBCINV  0xFFFD
@@ -33,7 +33,7 @@
 typedef struct dbcs_index decode_map;
 
 struct widedbcs_index {
-    const ucs4_t *map;
+    const Py_UCS4 *map;
     unsigned char bottom, top;
 };
 typedef struct widedbcs_index widedecode_map;
@@ -56,7 +56,7 @@
 };
 
 struct pair_encodemap {
-    ucs4_t uniseq;
+    Py_UCS4 uniseq;
     DBCHAR code;
 };
 
@@ -72,7 +72,8 @@
 #define ENCODER(encoding)                                               \
     static Py_ssize_t encoding##_encode(                                \
         MultibyteCodec_State *state, const void *config,                \
-        const Py_UNICODE **inbuf, Py_ssize_t inleft,                    \
+        int kind, void *data,                          \
+        Py_ssize_t *inpos, Py_ssize_t inlen,                            \
         unsigned char **outbuf, Py_ssize_t outleft, int flags)
 #define ENCODER_RESET(encoding)                                         \
     static Py_ssize_t encoding##_encode_reset(                          \
@@ -86,120 +87,118 @@
     static Py_ssize_t encoding##_decode(                                \
         MultibyteCodec_State *state, const void *config,                \
         const unsigned char **inbuf, Py_ssize_t inleft,                 \
-        Py_UNICODE **outbuf, Py_ssize_t outleft)
+        _PyUnicodeWriter *writer)
 #define DECODER_RESET(encoding)                                         \
     static Py_ssize_t encoding##_decode_reset(                          \
         MultibyteCodec_State *state, const void *config)
 
-#if Py_UNICODE_SIZE == 4
-#define UCS4INVALID(code)       \
-    if ((code) > 0xFFFF)        \
-    return 1;
-#else
-#define UCS4INVALID(code)       \
-    if (0) ;
-#endif
-
 #define NEXT_IN(i)                              \
-    (*inbuf) += (i);                            \
-    (inleft) -= (i);
+    do {                                        \
+        (*inbuf) += (i);                        \
+        (inleft) -= (i);                        \
+    } while (0)
+#define NEXT_INCHAR(i)                          \
+    do {                                        \
+        (*inpos) += (i);                        \
+    } while (0)
 #define NEXT_OUT(o)                             \
-    (*outbuf) += (o);                           \
-    (outleft) -= (o);
+    do {                                        \
+        (*outbuf) += (o);                       \
+        (outleft) -= (o);                       \
+    } while (0)
 #define NEXT(i, o)                              \
-    NEXT_IN(i) NEXT_OUT(o)
+    do {                                        \
+        NEXT_INCHAR(i);                         \
+        NEXT_OUT(o);                            \
+    } while (0)
 
 #define REQUIRE_INBUF(n)                        \
-    if (inleft < (n))                           \
-        return MBERR_TOOFEW;
+    do {                                        \
+        if (inleft < (n))                       \
+            return MBERR_TOOFEW;                \
+    } while (0)
+
 #define REQUIRE_OUTBUF(n)                       \
-    if (outleft < (n))                          \
-        return MBERR_TOOSMALL;
+    do {                                        \
+        if (outleft < (n))                      \
+            return MBERR_TOOSMALL;              \
+    } while (0)
 
-#define IN1 ((*inbuf)[0])
-#define IN2 ((*inbuf)[1])
-#define IN3 ((*inbuf)[2])
-#define IN4 ((*inbuf)[3])
+#define INBYTE1 ((*inbuf)[0])
+#define INBYTE2 ((*inbuf)[1])
+#define INBYTE3 ((*inbuf)[2])
+#define INBYTE4 ((*inbuf)[3])
 
-#define OUT1(c) ((*outbuf)[0]) = (c);
-#define OUT2(c) ((*outbuf)[1]) = (c);
-#define OUT3(c) ((*outbuf)[2]) = (c);
-#define OUT4(c) ((*outbuf)[3]) = (c);
+#define INCHAR1 (PyUnicode_READ(kind, data, *inpos))
+#define INCHAR2 (PyUnicode_READ(kind, data, *inpos + 1))
 
-#define WRITE1(c1)              \
-    REQUIRE_OUTBUF(1)           \
-    (*outbuf)[0] = (c1);
-#define WRITE2(c1, c2)          \
-    REQUIRE_OUTBUF(2)           \
-    (*outbuf)[0] = (c1);        \
-    (*outbuf)[1] = (c2);
-#define WRITE3(c1, c2, c3)      \
-    REQUIRE_OUTBUF(3)           \
-    (*outbuf)[0] = (c1);        \
-    (*outbuf)[1] = (c2);        \
-    (*outbuf)[2] = (c3);
-#define WRITE4(c1, c2, c3, c4)  \
-    REQUIRE_OUTBUF(4)           \
-    (*outbuf)[0] = (c1);        \
-    (*outbuf)[1] = (c2);        \
-    (*outbuf)[2] = (c3);        \
-    (*outbuf)[3] = (c4);
+#define OUTCHAR(c)                                                         \
+    do {                                                                   \
+        if (_PyUnicodeWriter_WriteChar(writer, (c)) < 0)                   \
+            return MBERR_EXCEPTION;                                         \
+    } while (0)
 
-#if Py_UNICODE_SIZE == 2
-# define WRITEUCS4(c)                                           \
-    REQUIRE_OUTBUF(2)                                           \
-    (*outbuf)[0] = 0xd800 + (((c) - 0x10000) >> 10);            \
-    (*outbuf)[1] = 0xdc00 + (((c) - 0x10000) & 0x3ff);          \
-    NEXT_OUT(2)
-#else
-# define WRITEUCS4(c)                                           \
-    REQUIRE_OUTBUF(1)                                           \
-    **outbuf = (Py_UNICODE)(c);                                 \
-    NEXT_OUT(1)
-#endif
+#define OUTCHAR2(c1, c2)                                                   \
+    do {                                                                   \
+        Py_UCS4 _c1 = (c1);                                                \
+        Py_UCS4 _c2 = (c2);                                                \
+        if (_PyUnicodeWriter_Prepare(writer, 2, Py_MAX(_c1, c2)) < 0)      \
+            return MBERR_EXCEPTION;                                        \
+        PyUnicode_WRITE(writer->kind, writer->data, writer->pos, _c1);     \
+        PyUnicode_WRITE(writer->kind, writer->data, writer->pos + 1, _c2); \
+        writer->pos += 2;                                                  \
+    } while (0)
+
+#define OUTBYTE1(c) \
+    do { ((*outbuf)[0]) = (c); } while (0)
+#define OUTBYTE2(c) \
+    do { ((*outbuf)[1]) = (c); } while (0)
+#define OUTBYTE3(c) \
+    do { ((*outbuf)[2]) = (c); } while (0)
+#define OUTBYTE4(c) \
+    do { ((*outbuf)[3]) = (c); } while (0)
+
+#define WRITEBYTE1(c1)              \
+    do {                            \
+        REQUIRE_OUTBUF(1);          \
+        (*outbuf)[0] = (c1);        \
+    } while (0)
+#define WRITEBYTE2(c1, c2)          \
+    do {                            \
+        REQUIRE_OUTBUF(2);          \
+        (*outbuf)[0] = (c1);        \
+        (*outbuf)[1] = (c2);        \
+    } while (0)
+#define WRITEBYTE3(c1, c2, c3)      \
+    do {                            \
+        REQUIRE_OUTBUF(3);          \
+        (*outbuf)[0] = (c1);        \
+        (*outbuf)[1] = (c2);        \
+        (*outbuf)[2] = (c3);        \
+    } while (0)
+#define WRITEBYTE4(c1, c2, c3, c4)  \
+    do {                            \
+        REQUIRE_OUTBUF(4);          \
+        (*outbuf)[0] = (c1);        \
+        (*outbuf)[1] = (c2);        \
+        (*outbuf)[2] = (c3);        \
+        (*outbuf)[3] = (c4);        \
+    } while (0)
 
 #define _TRYMAP_ENC(m, assi, val)                               \
     ((m)->map != NULL && (val) >= (m)->bottom &&                \
         (val)<= (m)->top && ((assi) = (m)->map[(val) -          \
         (m)->bottom]) != NOCHAR)
-#define TRYMAP_ENC_COND(charset, assi, uni)                     \
+#define TRYMAP_ENC(charset, assi, uni)                     \
     _TRYMAP_ENC(&charset##_encmap[(uni) >> 8], assi, (uni) & 0xff)
-#define TRYMAP_ENC(charset, assi, uni)                          \
-    if TRYMAP_ENC_COND(charset, assi, uni)
 
-#define _TRYMAP_DEC(m, assi, val)                               \
-    ((m)->map != NULL && (val) >= (m)->bottom &&                \
-        (val)<= (m)->top && ((assi) = (m)->map[(val) -          \
-        (m)->bottom]) != UNIINV)
-#define TRYMAP_DEC(charset, assi, c1, c2)                       \
-    if _TRYMAP_DEC(&charset##_decmap[c1], assi, c2)
-
-#define _TRYMAP_ENC_MPLANE(m, assplane, asshi, asslo, val)      \
-    ((m)->map != NULL && (val) >= (m)->bottom &&                \
-        (val)<= (m)->top &&                                     \
-        ((assplane) = (m)->map[((val) - (m)->bottom)*3]) != 0 && \
-        (((asshi) = (m)->map[((val) - (m)->bottom)*3 + 1]), 1) && \
-        (((asslo) = (m)->map[((val) - (m)->bottom)*3 + 2]), 1))
-#define TRYMAP_ENC_MPLANE(charset, assplane, asshi, asslo, uni) \
-    if _TRYMAP_ENC_MPLANE(&charset##_encmap[(uni) >> 8], \
-                       assplane, asshi, asslo, (uni) & 0xff)
-#define TRYMAP_DEC_MPLANE(charset, assi, plane, c1, c2)         \
-    if _TRYMAP_DEC(&charset##_decmap[plane][c1], assi, c2)
-
-#if Py_UNICODE_SIZE == 2
-#define DECODE_SURROGATE(c)                                     \
-    if (c >> 10 == 0xd800 >> 10) { /* high surrogate */         \
-        REQUIRE_INBUF(2)                                        \
-        if (IN2 >> 10 == 0xdc00 >> 10) { /* low surrogate */ \
-            c = 0x10000 + ((ucs4_t)(c - 0xd800) << 10) + \
-            ((ucs4_t)(IN2) - 0xdc00);                           \
-        }                                                       \
-    }
-#define GET_INSIZE(c)   ((c) > 0xffff ? 2 : 1)
-#else
-#define DECODE_SURROGATE(c) {;}
-#define GET_INSIZE(c)   1
-#endif
+#define _TRYMAP_DEC(m, assi, val)                             \
+    ((m)->map != NULL &&                                        \
+     (val) >= (m)->bottom &&                                    \
+     (val)<= (m)->top &&                                        \
+     ((assi) = (m)->map[(val) - (m)->bottom]) != UNIINV)
+#define TRYMAP_DEC(charset, assi, c1, c2)                     \
+    _TRYMAP_DEC(&charset##_decmap[c1], assi, c2)
 
 #define BEGIN_MAPPINGS_LIST static const struct dbcs_map _mapping_list[] = {
 #define MAPPING_ENCONLY(enc) {#enc, (void*)enc##_encmap, NULL},
@@ -324,7 +323,7 @@
                 const struct pair_encodemap *haystack, int haystacksize)
 {
     int pos, min, max;
-    ucs4_t value = body << 16 | modifier;
+    Py_UCS4 value = body << 16 | modifier;
 
     min = 0;
     max = haystacksize;
@@ -359,7 +358,7 @@
 {
     PyObject *o, *mod;
 
-    mod = PyImport_ImportModule((char *)modname);
+    mod = PyImport_ImportModule(modname);
     if (mod == NULL)
         return -1;
 
diff --git a/Modules/cjkcodecs/emu_jisx0213_2000.h b/Modules/cjkcodecs/emu_jisx0213_2000.h
index 4227fb2..a5d5a70 100644
--- a/Modules/cjkcodecs/emu_jisx0213_2000.h
+++ b/Modules/cjkcodecs/emu_jisx0213_2000.h
@@ -2,7 +2,7 @@
  * standards. */
 
 #ifndef EMULATE_JISX0213_2000_ENCODE_INVALID
-#define EMULATE_JISX0213_2000_ENCODE_INVALID 1
+#  define EMULATE_JISX0213_2000_ENCODE_INVALID 1
 #endif
 
 #define EMULATE_JISX0213_2000_ENCODE_BMP(assi, c)                       \
@@ -11,17 +11,20 @@
                     (c) == 0x525D || (c) == 0x541E ||                   \
                     (c) == 0x5653 || (c) == 0x59F8 ||                   \
                     (c) == 0x5C5B || (c) == 0x5E77 ||                   \
-                    (c) == 0x7626 || (c) == 0x7E6B))                    \
+                    (c) == 0x7626 || (c) == 0x7E6B)) {                  \
         return EMULATE_JISX0213_2000_ENCODE_INVALID;                    \
-    else if (config == (void *)2000 && (c) == 0x9B1D)                   \
+    }                                                                   \
+    else if (config == (void *)2000 && (c) == 0x9B1D) {                 \
         (assi) = 0x8000 | 0x7d3b;                                       \
+    }
 
 #define EMULATE_JISX0213_2000_ENCODE_EMP(assi, c)                       \
-    if (config == (void *)2000 && (c) == 0x20B9F)                       \
-        return EMULATE_JISX0213_2000_ENCODE_INVALID;
+    if (config == (void *)2000 && (c) == 0x20B9F) {                     \
+        return EMULATE_JISX0213_2000_ENCODE_INVALID;                    \
+    }
 
 #ifndef EMULATE_JISX0213_2000_DECODE_INVALID
-#define EMULATE_JISX0213_2000_DECODE_INVALID 2
+#  define EMULATE_JISX0213_2000_DECODE_INVALID 2
 #endif
 
 #define EMULATE_JISX0213_2000_DECODE_PLANE1(assi, c1, c2)               \
@@ -35,9 +38,17 @@
                      ((c1) == 0x7E && (c2) == 0x7B) ||                  \
                      ((c1) == 0x7E && (c2) == 0x7C) ||                  \
                      ((c1) == 0x7E && (c2) == 0x7D) ||                  \
-                     ((c1) == 0x7E && (c2) == 0x7E)))                   \
-        return EMULATE_JISX0213_2000_DECODE_INVALID;
+                     ((c1) == 0x7E && (c2) == 0x7E))) {                 \
+        return EMULATE_JISX0213_2000_DECODE_INVALID;                    \
+    }
 
-#define EMULATE_JISX0213_2000_DECODE_PLANE2(assi, c1, c2)               \
-    if (config == (void *)2000 && (c1) == 0x7D && (c2) == 0x3B)         \
-        (assi) = 0x9B1D;
+#define EMULATE_JISX0213_2000_DECODE_PLANE2(writer, c1, c2)             \
+    if (config == (void *)2000 && (c1) == 0x7D && (c2) == 0x3B) {       \
+        OUTCHAR(0x9B1D);                                                \
+    }
+
+#define EMULATE_JISX0213_2000_DECODE_PLANE2_CHAR(assi, c1, c2)          \
+    if (config == (void *)2000 && (c1) == 0x7D && (c2) == 0x3B) {       \
+        (assi) = 0x9B1D;                                                \
+    }
+
diff --git a/Modules/cjkcodecs/mappings_cn.h b/Modules/cjkcodecs/mappings_cn.h
index a6dcebf..1f8c299 100644
--- a/Modules/cjkcodecs/mappings_cn.h
+++ b/Modules/cjkcodecs/mappings_cn.h
@@ -4049,7 +4049,7 @@
 
 
 static const struct _gb18030_to_unibmp_ranges {
-    Py_UNICODE   first, last;
+    Py_UCS4   first, last;
     DBCHAR       base;
 } gb18030_to_unibmp_ranges[] = {
 {128,163,0},{165,166,36},{169,175,38},{178,182,45},{184,214,50},{216,223,81},{
diff --git a/Modules/cjkcodecs/mappings_jisx0213_pair.h b/Modules/cjkcodecs/mappings_jisx0213_pair.h
index eda8e9e..729e4bc 100644
--- a/Modules/cjkcodecs/mappings_jisx0213_pair.h
+++ b/Modules/cjkcodecs/mappings_jisx0213_pair.h
@@ -3,7 +3,7 @@
 static const struct widedbcs_index *jisx0213_pair_decmap;
 static const struct pair_encodemap *jisx0213_pair_encmap;
 #else
-static const ucs4_t __jisx0213_pair_decmap[49] = {
+static const Py_UCS4 __jisx0213_pair_decmap[49] = {
 810234010,810365082,810496154,810627226,810758298,816525466,816656538,
 816787610,816918682,817049754,817574042,818163866,818426010,838283418,
 15074048,U,U,U,39060224,39060225,42730240,42730241,39387904,39387905,39453440,
diff --git a/Modules/cjkcodecs/multibytecodec.c b/Modules/cjkcodecs/multibytecodec.c
index c032cdb..087ae9b 100644
--- a/Modules/cjkcodecs/multibytecodec.c
+++ b/Modules/cjkcodecs/multibytecodec.c
@@ -10,15 +10,16 @@
 #include "multibytecodec.h"
 
 typedef struct {
-    const Py_UNICODE    *inbuf, *inbuf_top, *inbuf_end;
+    PyObject            *inobj;
+    Py_ssize_t          inpos, inlen;
     unsigned char       *outbuf, *outbuf_end;
     PyObject            *excobj, *outobj;
 } MultibyteEncodeBuffer;
 
 typedef struct {
     const unsigned char *inbuf, *inbuf_top, *inbuf_end;
-    Py_UNICODE          *outbuf, *outbuf_end;
-    PyObject            *excobj, *outobj;
+    PyObject            *excobj;
+    _PyUnicodeWriter    writer;
 } MultibyteDecodeBuffer;
 
 PyDoc_STRVAR(MultibyteCodec_Encode__doc__,
@@ -45,11 +46,13 @@
 static char *streamkwarglist[] = {"stream", "errors", NULL};
 
 static PyObject *multibytecodec_encode(MultibyteCodec *,
-                MultibyteCodec_State *, const Py_UNICODE **, Py_ssize_t,
+                MultibyteCodec_State *, PyObject *, Py_ssize_t *,
                 PyObject *, int);
 
 #define MBENC_RESET     MBENC_MAX<<1 /* reset after an encoding session */
 
+_Py_IDENTIFIER(write);
+
 static PyObject *
 make_tuple(PyObject *object, Py_ssize_t len)
 {
@@ -197,29 +200,6 @@
             goto errorexit;                                             \
 }
 
-static int
-expand_decodebuffer(MultibyteDecodeBuffer *buf, Py_ssize_t esize)
-{
-    Py_ssize_t orgpos, orgsize;
-
-    orgpos = (Py_ssize_t)(buf->outbuf - PyUnicode_AS_UNICODE(buf->outobj));
-    orgsize = PyUnicode_GET_SIZE(buf->outobj);
-    if (PyUnicode_Resize(&buf->outobj, orgsize + (
-        esize < (orgsize >> 1) ? (orgsize >> 1) | 1 : esize)) == -1)
-        return -1;
-
-    buf->outbuf = PyUnicode_AS_UNICODE(buf->outobj) + orgpos;
-    buf->outbuf_end = PyUnicode_AS_UNICODE(buf->outobj)
-                      + PyUnicode_GET_SIZE(buf->outobj);
-
-    return 0;
-}
-#define REQUIRE_DECODEBUFFER(buf, s) {                                  \
-    if ((s) < 1 || (buf)->outbuf + (s) > (buf)->outbuf_end)             \
-        if (expand_decodebuffer(buf, s) == -1)                          \
-            goto errorexit;                                             \
-}
-
 
 /**
  * MultibyteCodec object
@@ -247,7 +227,7 @@
             return 0; /* retry it */
         case MBERR_TOOFEW:
             reason = "incomplete multibyte sequence";
-            esize = (Py_ssize_t)(buf->inbuf_end - buf->inbuf);
+            esize = (Py_ssize_t)buf->inpos;
             break;
         case MBERR_INTERNAL:
             PyErr_SetString(PyExc_RuntimeError,
@@ -261,14 +241,24 @@
     }
 
     if (errors == ERROR_REPLACE) {
-        const Py_UNICODE replchar = '?', *inbuf = &replchar;
+        PyObject *replchar;
         Py_ssize_t r;
+        Py_ssize_t inpos;
+        int kind;
+        void *data;
 
+        replchar = PyUnicode_FromOrdinal('?');
+        if (replchar == NULL)
+            goto errorexit;
+        kind = PyUnicode_KIND(replchar);
+        data = PyUnicode_DATA(replchar);
+
+        inpos = 0;
         for (;;) {
-            Py_ssize_t outleft;
+            Py_ssize_t outleft = (Py_ssize_t)(buf->outbuf_end - buf->outbuf);
 
-            outleft = (Py_ssize_t)(buf->outbuf_end - buf->outbuf);
-            r = codec->encode(state, codec->config, &inbuf, 1,
+            r = codec->encode(state, codec->config,
+                              kind, data, &inpos, 1,
                               &buf->outbuf, outleft, 0);
             if (r == MBERR_TOOSMALL) {
                 REQUIRE_ENCODEBUFFER(buf, -1);
@@ -278,25 +268,27 @@
                 break;
         }
 
+        Py_DECREF(replchar);
+
         if (r != 0) {
             REQUIRE_ENCODEBUFFER(buf, 1);
             *buf->outbuf++ = '?';
         }
     }
     if (errors == ERROR_IGNORE || errors == ERROR_REPLACE) {
-        buf->inbuf += esize;
+        buf->inpos += esize;
         return 0;
     }
 
-    start = (Py_ssize_t)(buf->inbuf - buf->inbuf_top);
+    start = (Py_ssize_t)buf->inpos;
     end = start + esize;
 
     /* use cached exception object if available */
     if (buf->excobj == NULL) {
-        buf->excobj = PyUnicodeEncodeError_Create(codec->encoding,
-                        buf->inbuf_top,
-                        buf->inbuf_end - buf->inbuf_top,
-                        start, end, reason);
+        buf->excobj =  PyObject_CallFunction(PyExc_UnicodeEncodeError,
+                                             "sOnns",
+                                             codec->encoding, buf->inobj,
+                                             start, end, reason);
         if (buf->excobj == NULL)
             goto errorexit;
     }
@@ -325,10 +317,10 @@
     }
 
     if (PyUnicode_Check(tobj)) {
-        const Py_UNICODE *uraw = PyUnicode_AS_UNICODE(tobj);
+        Py_ssize_t inpos;
 
-        retstr = multibytecodec_encode(codec, state, &uraw,
-                        PyUnicode_GET_SIZE(tobj), ERROR_STRICT,
+        retstr = multibytecodec_encode(codec, state, tobj,
+                        &inpos, ERROR_STRICT,
                         MBENC_FLUSH);
         if (retstr == NULL)
             goto errorexit;
@@ -347,15 +339,15 @@
 
     newpos = PyLong_AsSsize_t(PyTuple_GET_ITEM(retobj, 1));
     if (newpos < 0 && !PyErr_Occurred())
-        newpos += (Py_ssize_t)(buf->inbuf_end - buf->inbuf_top);
-    if (newpos < 0 || buf->inbuf_top + newpos > buf->inbuf_end) {
+        newpos += (Py_ssize_t)buf->inlen;
+    if (newpos < 0 || newpos > buf->inlen) {
         PyErr_Clear();
         PyErr_Format(PyExc_IndexError,
                      "position %zd from error handler out of bounds",
                      newpos);
         goto errorexit;
     }
-    buf->inbuf = buf->inbuf_top + newpos;
+    buf->inpos = newpos;
 
     Py_DECREF(retobj);
     Py_DECREF(retstr);
@@ -374,7 +366,7 @@
                         PyObject *errors, Py_ssize_t e)
 {
     PyObject *retobj = NULL, *retuni = NULL;
-    Py_ssize_t retunisize, newpos;
+    Py_ssize_t newpos;
     const char *reason;
     Py_ssize_t esize, start, end;
 
@@ -385,7 +377,6 @@
     else {
         switch (e) {
         case MBERR_TOOSMALL:
-            REQUIRE_DECODEBUFFER(buf, -1);
             return 0; /* retry it */
         case MBERR_TOOFEW:
             reason = "incomplete multibyte sequence";
@@ -395,6 +386,8 @@
             PyErr_SetString(PyExc_RuntimeError,
                             "internal codec error");
             return -1;
+        case MBERR_EXCEPTION:
+            return -1;
         default:
             PyErr_SetString(PyExc_RuntimeError,
                             "unknown runtime error");
@@ -403,8 +396,9 @@
     }
 
     if (errors == ERROR_REPLACE) {
-        REQUIRE_DECODEBUFFER(buf, 1);
-        *buf->outbuf++ = Py_UNICODE_REPLACEMENT_CHARACTER;
+        if (_PyUnicodeWriter_WriteChar(&buf->writer,
+                                       Py_UNICODE_REPLACEMENT_CHARACTER) < 0)
+            goto errorexit;
     }
     if (errors == ERROR_IGNORE || errors == ERROR_REPLACE) {
         buf->inbuf += esize;
@@ -447,15 +441,8 @@
         goto errorexit;
     }
 
-    if (PyUnicode_AsUnicode(retuni) == NULL)
+    if (_PyUnicodeWriter_WriteStr(&buf->writer, retuni) < 0)
         goto errorexit;
-    retunisize = PyUnicode_GET_SIZE(retuni);
-    if (retunisize > 0) {
-        REQUIRE_DECODEBUFFER(buf, retunisize);
-        memcpy((char *)buf->outbuf, PyUnicode_AS_UNICODE(retuni),
-                        retunisize * Py_UNICODE_SIZE);
-        buf->outbuf += retunisize;
-    }
 
     newpos = PyLong_AsSsize_t(PyTuple_GET_ITEM(retobj, 1));
     if (newpos < 0 && !PyErr_Occurred())
@@ -479,19 +466,29 @@
 static PyObject *
 multibytecodec_encode(MultibyteCodec *codec,
                       MultibyteCodec_State *state,
-                      const Py_UNICODE **data, Py_ssize_t datalen,
+                      PyObject *text, Py_ssize_t *inpos_t,
                       PyObject *errors, int flags)
 {
     MultibyteEncodeBuffer buf;
     Py_ssize_t finalsize, r = 0;
+    Py_ssize_t datalen;
+    int kind;
+    void *data;
+
+    if (PyUnicode_READY(text) < 0)
+        return NULL;
+    datalen = PyUnicode_GET_LENGTH(text);
 
     if (datalen == 0 && !(flags & MBENC_RESET))
         return PyBytes_FromStringAndSize(NULL, 0);
 
     buf.excobj = NULL;
     buf.outobj = NULL;
-    buf.inbuf = buf.inbuf_top = *data;
-    buf.inbuf_end = buf.inbuf_top + datalen;
+    buf.inobj = text;   /* borrowed reference */
+    buf.inpos = 0;
+    buf.inlen = datalen;
+    kind = PyUnicode_KIND(buf.inobj);
+    data = PyUnicode_DATA(buf.inobj);
 
     if (datalen > (PY_SSIZE_T_MAX - 16) / 2) {
         PyErr_NoMemory();
@@ -504,14 +501,14 @@
     buf.outbuf = (unsigned char *)PyBytes_AS_STRING(buf.outobj);
     buf.outbuf_end = buf.outbuf + PyBytes_GET_SIZE(buf.outobj);
 
-    while (buf.inbuf < buf.inbuf_end) {
-        Py_ssize_t inleft, outleft;
-
+    while (buf.inpos < buf.inlen) {
         /* we don't reuse inleft and outleft here.
          * error callbacks can relocate the cursor anywhere on buffer*/
-        inleft = (Py_ssize_t)(buf.inbuf_end - buf.inbuf);
-        outleft = (Py_ssize_t)(buf.outbuf_end - buf.outbuf);
-        r = codec->encode(state, codec->config, &buf.inbuf, inleft,
+        Py_ssize_t outleft = (Py_ssize_t)(buf.outbuf_end - buf.outbuf);
+
+        r = codec->encode(state, codec->config,
+                          kind, data,
+                          &buf.inpos, buf.inlen,
                           &buf.outbuf, outleft, flags);
         if ((r == 0) || (r == MBERR_TOOFEW && !(flags & MBENC_FLUSH)))
             break;
@@ -542,7 +539,8 @@
         if (_PyBytes_Resize(&buf.outobj, finalsize) == -1)
             goto errorexit;
 
-    *data = buf.inbuf;
+    if (inpos_t)
+        *inpos_t = buf.inpos;
     Py_XDECREF(buf.excobj);
     return buf.outobj;
 
@@ -557,7 +555,6 @@
                       PyObject *args, PyObject *kwargs)
 {
     MultibyteCodec_State state;
-    Py_UNICODE *data;
     PyObject *errorcb, *r, *arg, *ucvt;
     const char *errors = NULL;
     Py_ssize_t datalen;
@@ -580,11 +577,11 @@
         }
     }
 
-    data = PyUnicode_AsUnicodeAndSize(arg, &datalen);
-    if (data == NULL) {
+    if (PyUnicode_READY(arg) < 0) {
         Py_XDECREF(ucvt);
         return NULL;
     }
+    datalen = PyUnicode_GET_LENGTH(arg);
 
     errorcb = internal_error_callback(errors);
     if (errorcb == NULL) {
@@ -596,7 +593,7 @@
         self->codec->encinit(&state, self->codec->config) != 0)
         goto errorexit;
     r = multibytecodec_encode(self->codec, &state,
-                    (const Py_UNICODE **)&data, datalen, errorcb,
+                    arg, NULL, errorcb,
                     MBENC_FLUSH | MBENC_RESET);
     if (r == NULL)
         goto errorexit;
@@ -617,10 +614,10 @@
 {
     MultibyteCodec_State state;
     MultibyteDecodeBuffer buf;
-    PyObject *errorcb;
+    PyObject *errorcb, *res;
     Py_buffer pdata;
     const char *data, *errors = NULL;
-    Py_ssize_t datalen, finalsize;
+    Py_ssize_t datalen;
 
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "y*|z:decode",
                             codeckwarglist, &pdata, &errors))
@@ -640,29 +637,23 @@
         return make_tuple(PyUnicode_New(0, 0), 0);
     }
 
+    _PyUnicodeWriter_Init(&buf.writer);
+    buf.writer.min_length = datalen;
     buf.excobj = NULL;
     buf.inbuf = buf.inbuf_top = (unsigned char *)data;
     buf.inbuf_end = buf.inbuf_top + datalen;
-    buf.outobj = PyUnicode_FromUnicode(NULL, datalen);
-    if (buf.outobj == NULL)
-        goto errorexit;
-    buf.outbuf = PyUnicode_AS_UNICODE(buf.outobj);
-    if (buf.outbuf == NULL)
-        goto errorexit;
-    buf.outbuf_end = buf.outbuf + PyUnicode_GET_SIZE(buf.outobj);
 
     if (self->codec->decinit != NULL &&
         self->codec->decinit(&state, self->codec->config) != 0)
         goto errorexit;
 
     while (buf.inbuf < buf.inbuf_end) {
-        Py_ssize_t inleft, outleft, r;
+        Py_ssize_t inleft, r;
 
         inleft = (Py_ssize_t)(buf.inbuf_end - buf.inbuf);
-        outleft = (Py_ssize_t)(buf.outbuf_end - buf.outbuf);
 
         r = self->codec->decode(&state, self->codec->config,
-                        &buf.inbuf, inleft, &buf.outbuf, outleft);
+                        &buf.inbuf, inleft, &buf.writer);
         if (r == 0)
             break;
         else if (multibytecodec_decerror(self->codec, &state,
@@ -670,23 +661,20 @@
             goto errorexit;
     }
 
-    finalsize = (Py_ssize_t)(buf.outbuf -
-                             PyUnicode_AS_UNICODE(buf.outobj));
-
-    if (finalsize != PyUnicode_GET_SIZE(buf.outobj))
-        if (PyUnicode_Resize(&buf.outobj, finalsize) == -1)
-            goto errorexit;
+    res = _PyUnicodeWriter_Finish(&buf.writer);
+    if (res == NULL)
+        goto errorexit;
 
     PyBuffer_Release(&pdata);
     Py_XDECREF(buf.excobj);
     ERROR_DECREF(errorcb);
-    return make_tuple(buf.outobj, datalen);
+    return make_tuple(res, datalen);
 
 errorexit:
     PyBuffer_Release(&pdata);
     ERROR_DECREF(errorcb);
     Py_XDECREF(buf.excobj);
-    Py_XDECREF(buf.outobj);
+    _PyUnicodeWriter_Dealloc(&buf.writer);
 
     return NULL;
 }
@@ -752,9 +740,9 @@
                         PyObject *unistr, int final)
 {
     PyObject *ucvt, *r = NULL;
-    Py_UNICODE *inbuf, *inbuf_end, *inbuf_tmp = NULL;
-    Py_ssize_t datalen, origpending;
-    wchar_t *data;
+    PyObject *inbuf = NULL;
+    Py_ssize_t inpos, datalen;
+    PyObject *origpending = NULL;
 
     if (PyUnicode_Check(unistr))
         ucvt = NULL;
@@ -770,69 +758,66 @@
         }
     }
 
-    data = PyUnicode_AsUnicodeAndSize(unistr, &datalen);
-    if (data == NULL)
-        goto errorexit;
-    origpending = ctx->pendingsize;
+    if (ctx->pending) {
+        PyObject *inbuf_tmp;
 
-    if (origpending > 0) {
-        if (datalen > PY_SSIZE_T_MAX - ctx->pendingsize) {
-            PyErr_NoMemory();
-            /* inbuf_tmp == NULL */
-            goto errorexit;
-        }
-        inbuf_tmp = PyMem_New(Py_UNICODE, datalen + ctx->pendingsize);
+        Py_INCREF(ctx->pending);
+        origpending = ctx->pending;
+
+        Py_INCREF(ctx->pending);
+        inbuf_tmp = ctx->pending;
+        PyUnicode_Append(&inbuf_tmp, unistr);
         if (inbuf_tmp == NULL)
             goto errorexit;
-        memcpy(inbuf_tmp, ctx->pending,
-            Py_UNICODE_SIZE * ctx->pendingsize);
-        memcpy(inbuf_tmp + ctx->pendingsize,
-            PyUnicode_AS_UNICODE(unistr),
-            Py_UNICODE_SIZE * datalen);
-        datalen += ctx->pendingsize;
-        ctx->pendingsize = 0;
+        Py_CLEAR(ctx->pending);
         inbuf = inbuf_tmp;
     }
-    else
-        inbuf = (Py_UNICODE *)PyUnicode_AS_UNICODE(unistr);
+    else {
+        origpending = NULL;
 
-    inbuf_end = inbuf + datalen;
+        Py_INCREF(unistr);
+        inbuf = unistr;
+    }
+    if (PyUnicode_READY(inbuf) < 0)
+        goto errorexit;
+    inpos = 0;
+    datalen = PyUnicode_GET_LENGTH(inbuf);
 
     r = multibytecodec_encode(ctx->codec, &ctx->state,
-                    (const Py_UNICODE **)&inbuf, datalen,
-                    ctx->errors, final ? MBENC_FLUSH | MBENC_RESET : 0);
+                              inbuf, &inpos,
+                              ctx->errors, final ? MBENC_FLUSH | MBENC_RESET : 0);
     if (r == NULL) {
         /* recover the original pending buffer */
-        if (origpending > 0)
-            memcpy(ctx->pending, inbuf_tmp,
-                Py_UNICODE_SIZE * origpending);
-        ctx->pendingsize = origpending;
+        Py_CLEAR(ctx->pending);
+        ctx->pending = origpending;
+        origpending = NULL;
         goto errorexit;
     }
+    Py_XDECREF(origpending);
 
-    if (inbuf < inbuf_end) {
-        ctx->pendingsize = (Py_ssize_t)(inbuf_end - inbuf);
-        if (ctx->pendingsize > MAXENCPENDING) {
+    if (inpos < datalen) {
+        if (datalen - inpos > MAXENCPENDING) {
             /* normal codecs can't reach here */
-            ctx->pendingsize = 0;
             PyErr_SetString(PyExc_UnicodeError,
                             "pending buffer overflow");
             goto errorexit;
         }
-        memcpy(ctx->pending, inbuf,
-            ctx->pendingsize * Py_UNICODE_SIZE);
+        ctx->pending = PyUnicode_Substring(inbuf, inpos, datalen);
+        if (ctx->pending == NULL) {
+            /* normal codecs can't reach here */
+            goto errorexit;
+        }
     }
 
-    if (inbuf_tmp != NULL)
-        PyMem_Del(inbuf_tmp);
+    Py_DECREF(inbuf);
     Py_XDECREF(ucvt);
     return r;
 
 errorexit:
-    if (inbuf_tmp != NULL)
-        PyMem_Del(inbuf_tmp);
     Py_XDECREF(r);
     Py_XDECREF(ucvt);
+    Py_XDECREF(origpending);
+    Py_XDECREF(inbuf);
     return NULL;
 }
 
@@ -859,17 +844,7 @@
 {
     buf->inbuf = buf->inbuf_top = (const unsigned char *)data;
     buf->inbuf_end = buf->inbuf_top + size;
-    if (buf->outobj == NULL) { /* only if outobj is not allocated yet */
-        buf->outobj = PyUnicode_FromUnicode(NULL, size);
-        if (buf->outobj == NULL)
-            return -1;
-        buf->outbuf = PyUnicode_AsUnicode(buf->outobj);
-        if (buf->outbuf == NULL)
-            return -1;
-        buf->outbuf_end = buf->outbuf +
-                          PyUnicode_GET_SIZE(buf->outobj);
-    }
-
+    buf->writer.min_length += size;
     return 0;
 }
 
@@ -878,14 +853,13 @@
                     MultibyteDecodeBuffer *buf)
 {
     while (buf->inbuf < buf->inbuf_end) {
-        Py_ssize_t inleft, outleft;
+        Py_ssize_t inleft;
         Py_ssize_t r;
 
         inleft = (Py_ssize_t)(buf->inbuf_end - buf->inbuf);
-        outleft = (Py_ssize_t)(buf->outbuf_end - buf->outbuf);
 
         r = ctx->codec->decode(&ctx->state, ctx->codec->config,
-            &buf->inbuf, inleft, &buf->outbuf, outleft);
+            &buf->inbuf, inleft, &buf->writer);
         if (r == 0 || r == MBERR_TOOFEW)
             break;
         else if (multibytecodec_decerror(ctx->codec, &ctx->state,
@@ -927,7 +901,7 @@
         if (r != 0)
             return NULL;
     }
-    self->pendingsize = 0;
+    Py_CLEAR(self->pending);
     Py_RETURN_NONE;
 }
 
@@ -963,7 +937,7 @@
     }
 
     self->codec = ((MultibyteCodecObject *)codec)->codec;
-    self->pendingsize = 0;
+    self->pending = NULL;
     self->errors = internal_error_callback(errors);
     if (self->errors == NULL)
         goto errorexit;
@@ -1058,8 +1032,9 @@
     MultibyteDecodeBuffer buf;
     char *data, *wdata = NULL;
     Py_buffer pdata;
-    Py_ssize_t wsize, finalsize = 0, size, origpending;
+    Py_ssize_t wsize, size, origpending;
     int final = 0;
+    PyObject *res;
 
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "y*|i:decode",
                     incrementalkwarglist, &pdata, &final))
@@ -1067,7 +1042,8 @@
     data = pdata.buf;
     size = pdata.len;
 
-    buf.outobj = buf.excobj = NULL;
+    _PyUnicodeWriter_Init(&buf.writer);
+    buf.excobj = NULL;
     origpending = self->pendingsize;
 
     if (self->pendingsize == 0) {
@@ -1081,8 +1057,10 @@
         }
         wsize = size + self->pendingsize;
         wdata = PyMem_Malloc(wsize);
-        if (wdata == NULL)
+        if (wdata == NULL) {
+            PyErr_NoMemory();
             goto errorexit;
+        }
         memcpy(wdata, self->pending, self->pendingsize);
         memcpy(wdata + self->pendingsize, data, size);
         self->pendingsize = 0;
@@ -1109,23 +1087,22 @@
             goto errorexit;
     }
 
-    finalsize = (Py_ssize_t)(buf.outbuf - PyUnicode_AS_UNICODE(buf.outobj));
-    if (finalsize != PyUnicode_GET_SIZE(buf.outobj))
-        if (PyUnicode_Resize(&buf.outobj, finalsize) == -1)
-            goto errorexit;
+    res = _PyUnicodeWriter_Finish(&buf.writer);
+    if (res == NULL)
+        goto errorexit;
 
     PyBuffer_Release(&pdata);
     if (wdata != data)
         PyMem_Del(wdata);
     Py_XDECREF(buf.excobj);
-    return buf.outobj;
+    return res;
 
 errorexit:
     PyBuffer_Release(&pdata);
     if (wdata != NULL && wdata != data)
         PyMem_Del(wdata);
     Py_XDECREF(buf.excobj);
-    Py_XDECREF(buf.outobj);
+    _PyUnicodeWriter_Dealloc(&buf.writer);
     return NULL;
 }
 
@@ -1265,13 +1242,14 @@
                      const char *method, Py_ssize_t sizehint)
 {
     MultibyteDecodeBuffer buf;
-    PyObject *cres;
-    Py_ssize_t rsize, finalsize = 0;
+    PyObject *cres, *res;
+    Py_ssize_t rsize;
 
     if (sizehint == 0)
         return PyUnicode_New(0, 0);
 
-    buf.outobj = buf.excobj = NULL;
+    _PyUnicodeWriter_Init(&buf.writer);
+    buf.excobj = NULL;
     cres = NULL;
 
     for (;;) {
@@ -1303,19 +1281,19 @@
             if (PyBytes_GET_SIZE(cres) > PY_SSIZE_T_MAX - self->pendingsize) {
                 PyErr_NoMemory();
                 goto errorexit;
-        }
-                    rsize = PyBytes_GET_SIZE(cres) + self->pendingsize;
-                    ctr = PyBytes_FromStringAndSize(NULL, rsize);
-                    if (ctr == NULL)
-                            goto errorexit;
-                    ctrdata = PyBytes_AS_STRING(ctr);
-                    memcpy(ctrdata, self->pending, self->pendingsize);
-                    memcpy(ctrdata + self->pendingsize,
-                            PyBytes_AS_STRING(cres),
-                            PyBytes_GET_SIZE(cres));
-                    Py_DECREF(cres);
-                    cres = ctr;
-                    self->pendingsize = 0;
+            }
+            rsize = PyBytes_GET_SIZE(cres) + self->pendingsize;
+            ctr = PyBytes_FromStringAndSize(NULL, rsize);
+            if (ctr == NULL)
+                goto errorexit;
+            ctrdata = PyBytes_AS_STRING(ctr);
+            memcpy(ctrdata, self->pending, self->pendingsize);
+            memcpy(ctrdata + self->pendingsize,
+                    PyBytes_AS_STRING(cres),
+                    PyBytes_GET_SIZE(cres));
+            Py_DECREF(cres);
+            cres = ctr;
+            self->pendingsize = 0;
         }
 
         rsize = PyBytes_GET_SIZE(cres);
@@ -1340,29 +1318,27 @@
                 goto errorexit;
         }
 
-        finalsize = (Py_ssize_t)(buf.outbuf -
-                        PyUnicode_AS_UNICODE(buf.outobj));
         Py_DECREF(cres);
         cres = NULL;
 
-        if (sizehint < 0 || finalsize != 0 || rsize == 0)
+        if (sizehint < 0 || buf.writer.pos != 0 || rsize == 0)
             break;
 
         sizehint = 1; /* read 1 more byte and retry */
     }
 
-    if (finalsize != PyUnicode_GET_SIZE(buf.outobj))
-        if (PyUnicode_Resize(&buf.outobj, finalsize) == -1)
-            goto errorexit;
+    res = _PyUnicodeWriter_Finish(&buf.writer);
+    if (res == NULL)
+        goto errorexit;
 
     Py_XDECREF(cres);
     Py_XDECREF(buf.excobj);
-    return buf.outobj;
+    return res;
 
 errorexit:
     Py_XDECREF(cres);
     Py_XDECREF(buf.excobj);
-    Py_XDECREF(buf.outobj);
+    _PyUnicodeWriter_Dealloc(&buf.writer);
     return NULL;
 }
 
@@ -1595,7 +1571,6 @@
                       PyObject *unistr)
 {
     PyObject *str, *wr;
-    _Py_IDENTIFIER(write);
 
     str = encoder_encode_stateful(STATEFUL_ECTX(self), unistr, 0);
     if (str == NULL)
@@ -1649,25 +1624,22 @@
 static PyObject *
 mbstreamwriter_reset(MultibyteStreamWriterObject *self)
 {
-    const Py_UNICODE *pending;
     PyObject *pwrt;
 
-    pending = self->pending;
     pwrt = multibytecodec_encode(self->codec, &self->state,
-                    &pending, self->pendingsize, self->errors,
+                    self->pending, NULL, self->errors,
                     MBENC_FLUSH | MBENC_RESET);
     /* some pending buffer can be truncated when UnicodeEncodeError is
      * raised on 'strict' mode. but, 'reset' method is designed to
      * reset the pending buffer or states so failed string sequence
      * ought to be missed */
-    self->pendingsize = 0;
+    Py_CLEAR(self->pending);
     if (pwrt == NULL)
         return NULL;
 
     assert(PyBytes_Check(pwrt));
     if (PyBytes_Size(pwrt) > 0) {
         PyObject *wr;
-        _Py_IDENTIFIER(write);
 
         wr = _PyObject_CallMethodId(self->stream, &PyId_write, "O", pwrt);
         if (wr == NULL) {
@@ -1706,7 +1678,7 @@
     self->codec = ((MultibyteCodecObject *)codec)->codec;
     self->stream = stream;
     Py_INCREF(stream);
-    self->pendingsize = 0;
+    self->pending = NULL;
     self->errors = internal_error_callback(errors);
     if (self->errors == NULL)
         goto errorexit;
diff --git a/Modules/cjkcodecs/multibytecodec.h b/Modules/cjkcodecs/multibytecodec.h
index 1b6ef55..5b8c222 100644
--- a/Modules/cjkcodecs/multibytecodec.h
+++ b/Modules/cjkcodecs/multibytecodec.h
@@ -10,12 +10,6 @@
 extern "C" {
 #endif
 
-#ifdef uint32_t
-typedef uint32_t ucs4_t;
-#else
-typedef unsigned int ucs4_t;
-#endif
-
 #ifdef uint16_t
 typedef uint16_t ucs2_t, DBCHAR;
 #else
@@ -27,13 +21,14 @@
     int i;
     unsigned char c[8];
     ucs2_t u2[4];
-    ucs4_t u4[2];
+    Py_UCS4 u4[2];
 } MultibyteCodec_State;
 
 typedef int (*mbcodec_init)(const void *config);
 typedef Py_ssize_t (*mbencode_func)(MultibyteCodec_State *state,
                         const void *config,
-                        const Py_UNICODE **inbuf, Py_ssize_t inleft,
+                        int kind, void *data,
+                        Py_ssize_t *inpos, Py_ssize_t inlen,
                         unsigned char **outbuf, Py_ssize_t outleft,
                         int flags);
 typedef int (*mbencodeinit_func)(MultibyteCodec_State *state,
@@ -44,7 +39,7 @@
 typedef Py_ssize_t (*mbdecode_func)(MultibyteCodec_State *state,
                         const void *config,
                         const unsigned char **inbuf, Py_ssize_t inleft,
-                        Py_UNICODE **outbuf, Py_ssize_t outleft);
+                        _PyUnicodeWriter *writer);
 typedef int (*mbdecodeinit_func)(MultibyteCodec_State *state,
                                  const void *config);
 typedef Py_ssize_t (*mbdecodereset_func)(MultibyteCodec_State *state,
@@ -81,8 +76,7 @@
 #define MAXENCPENDING   2
 #define _MultibyteStatefulEncoder_HEAD          \
     _MultibyteStatefulCodec_HEAD                \
-    Py_UNICODE pending[MAXENCPENDING];          \
-    Py_ssize_t pendingsize;
+    PyObject *pending;
 typedef struct {
     _MultibyteStatefulEncoder_HEAD
 } MultibyteStatefulEncoderContext;
@@ -118,16 +112,17 @@
 #define MBERR_TOOSMALL          (-1) /* insufficient output buffer space */
 #define MBERR_TOOFEW            (-2) /* incomplete input buffer */
 #define MBERR_INTERNAL          (-3) /* internal runtime error */
+#define MBERR_EXCEPTION         (-4) /* an exception has been raised */
 
 #define ERROR_STRICT            (PyObject *)(1)
 #define ERROR_IGNORE            (PyObject *)(2)
 #define ERROR_REPLACE           (PyObject *)(3)
 #define ERROR_ISCUSTOM(p)       ((p) < ERROR_STRICT || ERROR_REPLACE < (p))
-#define ERROR_DECREF(p) do {                    \
-    if (p != NULL && ERROR_ISCUSTOM(p)) {       \
-        Py_DECREF(p);                           \
-    }                                           \
-} while (0);
+#define ERROR_DECREF(p)                             \
+    do {                                            \
+        if (p != NULL && ERROR_ISCUSTOM(p))         \
+            Py_DECREF(p);                           \
+    } while (0);
 
 #define MBENC_FLUSH             0x0001 /* encode all characters encodable */
 #define MBENC_MAX               MBENC_FLUSH
diff --git a/Modules/clinic/_bz2module.c.h b/Modules/clinic/_bz2module.c.h
new file mode 100644
index 0000000..8a201a0
--- /dev/null
+++ b/Modules/clinic/_bz2module.c.h
@@ -0,0 +1,162 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+PyDoc_STRVAR(_bz2_BZ2Compressor_compress__doc__,
+"compress($self, data, /)\n"
+"--\n"
+"\n"
+"Provide data to the compressor object.\n"
+"\n"
+"Returns a chunk of compressed data if possible, or b\'\' otherwise.\n"
+"\n"
+"When you have finished providing data to the compressor, call the\n"
+"flush() method to finish the compression process.");
+
+#define _BZ2_BZ2COMPRESSOR_COMPRESS_METHODDEF    \
+    {"compress", (PyCFunction)_bz2_BZ2Compressor_compress, METH_VARARGS, _bz2_BZ2Compressor_compress__doc__},
+
+static PyObject *
+_bz2_BZ2Compressor_compress_impl(BZ2Compressor *self, Py_buffer *data);
+
+static PyObject *
+_bz2_BZ2Compressor_compress(BZ2Compressor *self, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer data = {NULL, NULL};
+
+    if (!PyArg_ParseTuple(args,
+        "y*:compress",
+        &data))
+        goto exit;
+    return_value = _bz2_BZ2Compressor_compress_impl(self, &data);
+
+exit:
+    /* Cleanup for data */
+    if (data.obj)
+       PyBuffer_Release(&data);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(_bz2_BZ2Compressor_flush__doc__,
+"flush($self, /)\n"
+"--\n"
+"\n"
+"Finish the compression process.\n"
+"\n"
+"Returns the compressed data left in internal buffers.\n"
+"\n"
+"The compressor object may not be used after this method is called.");
+
+#define _BZ2_BZ2COMPRESSOR_FLUSH_METHODDEF    \
+    {"flush", (PyCFunction)_bz2_BZ2Compressor_flush, METH_NOARGS, _bz2_BZ2Compressor_flush__doc__},
+
+static PyObject *
+_bz2_BZ2Compressor_flush_impl(BZ2Compressor *self);
+
+static PyObject *
+_bz2_BZ2Compressor_flush(BZ2Compressor *self, PyObject *Py_UNUSED(ignored))
+{
+    return _bz2_BZ2Compressor_flush_impl(self);
+}
+
+PyDoc_STRVAR(_bz2_BZ2Compressor___init____doc__,
+"BZ2Compressor(compresslevel=9, /)\n"
+"--\n"
+"\n"
+"Create a compressor object for compressing data incrementally.\n"
+"\n"
+"  compresslevel\n"
+"    Compression level, as a number between 1 and 9.\n"
+"\n"
+"For one-shot compression, use the compress() function instead.");
+
+static int
+_bz2_BZ2Compressor___init___impl(BZ2Compressor *self, int compresslevel);
+
+static int
+_bz2_BZ2Compressor___init__(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+    int return_value = -1;
+    int compresslevel = 9;
+
+    if ((Py_TYPE(self) == &BZ2Compressor_Type) &&
+        !_PyArg_NoKeywords("BZ2Compressor", kwargs))
+        goto exit;
+    if (!PyArg_ParseTuple(args,
+        "|i:BZ2Compressor",
+        &compresslevel))
+        goto exit;
+    return_value = _bz2_BZ2Compressor___init___impl((BZ2Compressor *)self, compresslevel);
+
+exit:
+    return return_value;
+}
+
+PyDoc_STRVAR(_bz2_BZ2Decompressor_decompress__doc__,
+"decompress($self, data, /)\n"
+"--\n"
+"\n"
+"Provide data to the decompressor object.\n"
+"\n"
+"Returns a chunk of decompressed data if possible, or b\'\' otherwise.\n"
+"\n"
+"Attempting to decompress data after the end of stream is reached\n"
+"raises an EOFError.  Any data found after the end of the stream\n"
+"is ignored and saved in the unused_data attribute.");
+
+#define _BZ2_BZ2DECOMPRESSOR_DECOMPRESS_METHODDEF    \
+    {"decompress", (PyCFunction)_bz2_BZ2Decompressor_decompress, METH_VARARGS, _bz2_BZ2Decompressor_decompress__doc__},
+
+static PyObject *
+_bz2_BZ2Decompressor_decompress_impl(BZ2Decompressor *self, Py_buffer *data);
+
+static PyObject *
+_bz2_BZ2Decompressor_decompress(BZ2Decompressor *self, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer data = {NULL, NULL};
+
+    if (!PyArg_ParseTuple(args,
+        "y*:decompress",
+        &data))
+        goto exit;
+    return_value = _bz2_BZ2Decompressor_decompress_impl(self, &data);
+
+exit:
+    /* Cleanup for data */
+    if (data.obj)
+       PyBuffer_Release(&data);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(_bz2_BZ2Decompressor___init____doc__,
+"BZ2Decompressor()\n"
+"--\n"
+"\n"
+"Create a decompressor object for decompressing data incrementally.\n"
+"\n"
+"For one-shot decompression, use the decompress() function instead.");
+
+static int
+_bz2_BZ2Decompressor___init___impl(BZ2Decompressor *self);
+
+static int
+_bz2_BZ2Decompressor___init__(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+    int return_value = -1;
+
+    if ((Py_TYPE(self) == &BZ2Decompressor_Type) &&
+        !_PyArg_NoPositional("BZ2Decompressor", args))
+        goto exit;
+    if ((Py_TYPE(self) == &BZ2Decompressor_Type) &&
+        !_PyArg_NoKeywords("BZ2Decompressor", kwargs))
+        goto exit;
+    return_value = _bz2_BZ2Decompressor___init___impl((BZ2Decompressor *)self);
+
+exit:
+    return return_value;
+}
+/*[clinic end generated code: output=21ca4405519a0931 input=a9049054013a1b77]*/
diff --git a/Modules/clinic/_lzmamodule.c.h b/Modules/clinic/_lzmamodule.c.h
new file mode 100644
index 0000000..c1ad882
--- /dev/null
+++ b/Modules/clinic/_lzmamodule.c.h
@@ -0,0 +1,245 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+PyDoc_STRVAR(_lzma_LZMACompressor_compress__doc__,
+"compress($self, data, /)\n"
+"--\n"
+"\n"
+"Provide data to the compressor object.\n"
+"\n"
+"Returns a chunk of compressed data if possible, or b\'\' otherwise.\n"
+"\n"
+"When you have finished providing data to the compressor, call the\n"
+"flush() method to finish the compression process.");
+
+#define _LZMA_LZMACOMPRESSOR_COMPRESS_METHODDEF    \
+    {"compress", (PyCFunction)_lzma_LZMACompressor_compress, METH_VARARGS, _lzma_LZMACompressor_compress__doc__},
+
+static PyObject *
+_lzma_LZMACompressor_compress_impl(Compressor *self, Py_buffer *data);
+
+static PyObject *
+_lzma_LZMACompressor_compress(Compressor *self, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer data = {NULL, NULL};
+
+    if (!PyArg_ParseTuple(args,
+        "y*:compress",
+        &data))
+        goto exit;
+    return_value = _lzma_LZMACompressor_compress_impl(self, &data);
+
+exit:
+    /* Cleanup for data */
+    if (data.obj)
+       PyBuffer_Release(&data);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(_lzma_LZMACompressor_flush__doc__,
+"flush($self, /)\n"
+"--\n"
+"\n"
+"Finish the compression process.\n"
+"\n"
+"Returns the compressed data left in internal buffers.\n"
+"\n"
+"The compressor object may not be used after this method is called.");
+
+#define _LZMA_LZMACOMPRESSOR_FLUSH_METHODDEF    \
+    {"flush", (PyCFunction)_lzma_LZMACompressor_flush, METH_NOARGS, _lzma_LZMACompressor_flush__doc__},
+
+static PyObject *
+_lzma_LZMACompressor_flush_impl(Compressor *self);
+
+static PyObject *
+_lzma_LZMACompressor_flush(Compressor *self, PyObject *Py_UNUSED(ignored))
+{
+    return _lzma_LZMACompressor_flush_impl(self);
+}
+
+PyDoc_STRVAR(_lzma_LZMADecompressor_decompress__doc__,
+"decompress($self, data, /)\n"
+"--\n"
+"\n"
+"Provide data to the decompressor object.\n"
+"\n"
+"Returns a chunk of decompressed data if possible, or b\'\' otherwise.\n"
+"\n"
+"Attempting to decompress data after the end of stream is reached\n"
+"raises an EOFError.  Any data found after the end of the stream\n"
+"is ignored and saved in the unused_data attribute.");
+
+#define _LZMA_LZMADECOMPRESSOR_DECOMPRESS_METHODDEF    \
+    {"decompress", (PyCFunction)_lzma_LZMADecompressor_decompress, METH_VARARGS, _lzma_LZMADecompressor_decompress__doc__},
+
+static PyObject *
+_lzma_LZMADecompressor_decompress_impl(Decompressor *self, Py_buffer *data);
+
+static PyObject *
+_lzma_LZMADecompressor_decompress(Decompressor *self, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer data = {NULL, NULL};
+
+    if (!PyArg_ParseTuple(args,
+        "y*:decompress",
+        &data))
+        goto exit;
+    return_value = _lzma_LZMADecompressor_decompress_impl(self, &data);
+
+exit:
+    /* Cleanup for data */
+    if (data.obj)
+       PyBuffer_Release(&data);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(_lzma_LZMADecompressor___init____doc__,
+"LZMADecompressor(format=FORMAT_AUTO, memlimit=None, filters=None)\n"
+"--\n"
+"\n"
+"Create a decompressor object for decompressing data incrementally.\n"
+"\n"
+"  format\n"
+"    Specifies the container format of the input stream.  If this is\n"
+"    FORMAT_AUTO (the default), the decompressor will automatically detect\n"
+"    whether the input is FORMAT_XZ or FORMAT_ALONE.  Streams created with\n"
+"    FORMAT_RAW cannot be autodetected.\n"
+"  memlimit\n"
+"    Limit the amount of memory used by the decompressor.  This will cause\n"
+"    decompression to fail if the input cannot be decompressed within the\n"
+"    given limit.\n"
+"  filters\n"
+"    A custom filter chain.  This argument is required for FORMAT_RAW, and\n"
+"    not accepted with any other format.  When provided, this should be a\n"
+"    sequence of dicts, each indicating the ID and options for a single\n"
+"    filter.\n"
+"\n"
+"For one-shot decompression, use the decompress() function instead.");
+
+static int
+_lzma_LZMADecompressor___init___impl(Decompressor *self, int format, PyObject *memlimit, PyObject *filters);
+
+static int
+_lzma_LZMADecompressor___init__(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+    int return_value = -1;
+    static char *_keywords[] = {"format", "memlimit", "filters", NULL};
+    int format = FORMAT_AUTO;
+    PyObject *memlimit = Py_None;
+    PyObject *filters = Py_None;
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+        "|iOO:LZMADecompressor", _keywords,
+        &format, &memlimit, &filters))
+        goto exit;
+    return_value = _lzma_LZMADecompressor___init___impl((Decompressor *)self, format, memlimit, filters);
+
+exit:
+    return return_value;
+}
+
+PyDoc_STRVAR(_lzma_is_check_supported__doc__,
+"is_check_supported($module, check_id, /)\n"
+"--\n"
+"\n"
+"Test whether the given integrity check is supported.\n"
+"\n"
+"Always returns True for CHECK_NONE and CHECK_CRC32.");
+
+#define _LZMA_IS_CHECK_SUPPORTED_METHODDEF    \
+    {"is_check_supported", (PyCFunction)_lzma_is_check_supported, METH_VARARGS, _lzma_is_check_supported__doc__},
+
+static PyObject *
+_lzma_is_check_supported_impl(PyModuleDef *module, int check_id);
+
+static PyObject *
+_lzma_is_check_supported(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    int check_id;
+
+    if (!PyArg_ParseTuple(args,
+        "i:is_check_supported",
+        &check_id))
+        goto exit;
+    return_value = _lzma_is_check_supported_impl(module, check_id);
+
+exit:
+    return return_value;
+}
+
+PyDoc_STRVAR(_lzma__encode_filter_properties__doc__,
+"_encode_filter_properties($module, filter, /)\n"
+"--\n"
+"\n"
+"Return a bytes object encoding the options (properties) of the filter specified by *filter* (a dict).\n"
+"\n"
+"The result does not include the filter ID itself, only the options.");
+
+#define _LZMA__ENCODE_FILTER_PROPERTIES_METHODDEF    \
+    {"_encode_filter_properties", (PyCFunction)_lzma__encode_filter_properties, METH_VARARGS, _lzma__encode_filter_properties__doc__},
+
+static PyObject *
+_lzma__encode_filter_properties_impl(PyModuleDef *module, lzma_filter filter);
+
+static PyObject *
+_lzma__encode_filter_properties(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    lzma_filter filter = {LZMA_VLI_UNKNOWN, NULL};
+
+    if (!PyArg_ParseTuple(args,
+        "O&:_encode_filter_properties",
+        lzma_filter_converter, &filter))
+        goto exit;
+    return_value = _lzma__encode_filter_properties_impl(module, filter);
+
+exit:
+    /* Cleanup for filter */
+    if (filter.id != LZMA_VLI_UNKNOWN)
+       PyMem_Free(filter.options);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(_lzma__decode_filter_properties__doc__,
+"_decode_filter_properties($module, filter_id, encoded_props, /)\n"
+"--\n"
+"\n"
+"Return a bytes object encoding the options (properties) of the filter specified by *filter* (a dict).\n"
+"\n"
+"The result does not include the filter ID itself, only the options.");
+
+#define _LZMA__DECODE_FILTER_PROPERTIES_METHODDEF    \
+    {"_decode_filter_properties", (PyCFunction)_lzma__decode_filter_properties, METH_VARARGS, _lzma__decode_filter_properties__doc__},
+
+static PyObject *
+_lzma__decode_filter_properties_impl(PyModuleDef *module, lzma_vli filter_id, Py_buffer *encoded_props);
+
+static PyObject *
+_lzma__decode_filter_properties(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    lzma_vli filter_id;
+    Py_buffer encoded_props = {NULL, NULL};
+
+    if (!PyArg_ParseTuple(args,
+        "O&y*:_decode_filter_properties",
+        lzma_vli_converter, &filter_id, &encoded_props))
+        goto exit;
+    return_value = _lzma__decode_filter_properties_impl(module, filter_id, &encoded_props);
+
+exit:
+    /* Cleanup for encoded_props */
+    if (encoded_props.obj)
+       PyBuffer_Release(&encoded_props);
+
+    return return_value;
+}
+/*[clinic end generated code: output=808fec8216ac712b input=a9049054013a1b77]*/
diff --git a/Modules/clinic/_pickle.c.h b/Modules/clinic/_pickle.c.h
new file mode 100644
index 0000000..975298c
--- /dev/null
+++ b/Modules/clinic/_pickle.c.h
@@ -0,0 +1,545 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+PyDoc_STRVAR(_pickle_Pickler_clear_memo__doc__,
+"clear_memo($self, /)\n"
+"--\n"
+"\n"
+"Clears the pickler\'s \"memo\".\n"
+"\n"
+"The memo is the data structure that remembers which objects the\n"
+"pickler has already seen, so that shared or recursive objects are\n"
+"pickled by reference and not by value.  This method is useful when\n"
+"re-using picklers.");
+
+#define _PICKLE_PICKLER_CLEAR_MEMO_METHODDEF    \
+    {"clear_memo", (PyCFunction)_pickle_Pickler_clear_memo, METH_NOARGS, _pickle_Pickler_clear_memo__doc__},
+
+static PyObject *
+_pickle_Pickler_clear_memo_impl(PicklerObject *self);
+
+static PyObject *
+_pickle_Pickler_clear_memo(PicklerObject *self, PyObject *Py_UNUSED(ignored))
+{
+    return _pickle_Pickler_clear_memo_impl(self);
+}
+
+PyDoc_STRVAR(_pickle_Pickler_dump__doc__,
+"dump($self, obj, /)\n"
+"--\n"
+"\n"
+"Write a pickled representation of the given object to the open file.");
+
+#define _PICKLE_PICKLER_DUMP_METHODDEF    \
+    {"dump", (PyCFunction)_pickle_Pickler_dump, METH_O, _pickle_Pickler_dump__doc__},
+
+PyDoc_STRVAR(_pickle_Pickler___sizeof____doc__,
+"__sizeof__($self, /)\n"
+"--\n"
+"\n"
+"Returns size in memory, in bytes.");
+
+#define _PICKLE_PICKLER___SIZEOF___METHODDEF    \
+    {"__sizeof__", (PyCFunction)_pickle_Pickler___sizeof__, METH_NOARGS, _pickle_Pickler___sizeof____doc__},
+
+static Py_ssize_t
+_pickle_Pickler___sizeof___impl(PicklerObject *self);
+
+static PyObject *
+_pickle_Pickler___sizeof__(PicklerObject *self, PyObject *Py_UNUSED(ignored))
+{
+    PyObject *return_value = NULL;
+    Py_ssize_t _return_value;
+
+    _return_value = _pickle_Pickler___sizeof___impl(self);
+    if ((_return_value == -1) && PyErr_Occurred())
+        goto exit;
+    return_value = PyLong_FromSsize_t(_return_value);
+
+exit:
+    return return_value;
+}
+
+PyDoc_STRVAR(_pickle_Pickler___init____doc__,
+"Pickler(file, protocol=None, fix_imports=True)\n"
+"--\n"
+"\n"
+"This takes a binary file for writing a pickle data stream.\n"
+"\n"
+"The optional *protocol* argument tells the pickler to use the given\n"
+"protocol; supported protocols are 0, 1, 2, 3 and 4.  The default\n"
+"protocol is 3; a backward-incompatible protocol designed for Python 3.\n"
+"\n"
+"Specifying a negative protocol version selects the highest protocol\n"
+"version supported.  The higher the protocol used, the more recent the\n"
+"version of Python needed to read the pickle produced.\n"
+"\n"
+"The *file* argument must have a write() method that accepts a single\n"
+"bytes argument. It can thus be a file object opened for binary\n"
+"writing, a io.BytesIO instance, or any other custom object that meets\n"
+"this interface.\n"
+"\n"
+"If *fix_imports* is True and protocol is less than 3, pickle will try\n"
+"to map the new Python 3 names to the old module names used in Python\n"
+"2, so that the pickle data stream is readable with Python 2.");
+
+static int
+_pickle_Pickler___init___impl(PicklerObject *self, PyObject *file, PyObject *protocol, int fix_imports);
+
+static int
+_pickle_Pickler___init__(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+    int return_value = -1;
+    static char *_keywords[] = {"file", "protocol", "fix_imports", NULL};
+    PyObject *file;
+    PyObject *protocol = NULL;
+    int fix_imports = 1;
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+        "O|Op:Pickler", _keywords,
+        &file, &protocol, &fix_imports))
+        goto exit;
+    return_value = _pickle_Pickler___init___impl((PicklerObject *)self, file, protocol, fix_imports);
+
+exit:
+    return return_value;
+}
+
+PyDoc_STRVAR(_pickle_PicklerMemoProxy_clear__doc__,
+"clear($self, /)\n"
+"--\n"
+"\n"
+"Remove all items from memo.");
+
+#define _PICKLE_PICKLERMEMOPROXY_CLEAR_METHODDEF    \
+    {"clear", (PyCFunction)_pickle_PicklerMemoProxy_clear, METH_NOARGS, _pickle_PicklerMemoProxy_clear__doc__},
+
+static PyObject *
+_pickle_PicklerMemoProxy_clear_impl(PicklerMemoProxyObject *self);
+
+static PyObject *
+_pickle_PicklerMemoProxy_clear(PicklerMemoProxyObject *self, PyObject *Py_UNUSED(ignored))
+{
+    return _pickle_PicklerMemoProxy_clear_impl(self);
+}
+
+PyDoc_STRVAR(_pickle_PicklerMemoProxy_copy__doc__,
+"copy($self, /)\n"
+"--\n"
+"\n"
+"Copy the memo to a new object.");
+
+#define _PICKLE_PICKLERMEMOPROXY_COPY_METHODDEF    \
+    {"copy", (PyCFunction)_pickle_PicklerMemoProxy_copy, METH_NOARGS, _pickle_PicklerMemoProxy_copy__doc__},
+
+static PyObject *
+_pickle_PicklerMemoProxy_copy_impl(PicklerMemoProxyObject *self);
+
+static PyObject *
+_pickle_PicklerMemoProxy_copy(PicklerMemoProxyObject *self, PyObject *Py_UNUSED(ignored))
+{
+    return _pickle_PicklerMemoProxy_copy_impl(self);
+}
+
+PyDoc_STRVAR(_pickle_PicklerMemoProxy___reduce____doc__,
+"__reduce__($self, /)\n"
+"--\n"
+"\n"
+"Implement pickle support.");
+
+#define _PICKLE_PICKLERMEMOPROXY___REDUCE___METHODDEF    \
+    {"__reduce__", (PyCFunction)_pickle_PicklerMemoProxy___reduce__, METH_NOARGS, _pickle_PicklerMemoProxy___reduce____doc__},
+
+static PyObject *
+_pickle_PicklerMemoProxy___reduce___impl(PicklerMemoProxyObject *self);
+
+static PyObject *
+_pickle_PicklerMemoProxy___reduce__(PicklerMemoProxyObject *self, PyObject *Py_UNUSED(ignored))
+{
+    return _pickle_PicklerMemoProxy___reduce___impl(self);
+}
+
+PyDoc_STRVAR(_pickle_Unpickler_load__doc__,
+"load($self, /)\n"
+"--\n"
+"\n"
+"Load a pickle.\n"
+"\n"
+"Read a pickled object representation from the open file object given\n"
+"in the constructor, and return the reconstituted object hierarchy\n"
+"specified therein.");
+
+#define _PICKLE_UNPICKLER_LOAD_METHODDEF    \
+    {"load", (PyCFunction)_pickle_Unpickler_load, METH_NOARGS, _pickle_Unpickler_load__doc__},
+
+static PyObject *
+_pickle_Unpickler_load_impl(UnpicklerObject *self);
+
+static PyObject *
+_pickle_Unpickler_load(UnpicklerObject *self, PyObject *Py_UNUSED(ignored))
+{
+    return _pickle_Unpickler_load_impl(self);
+}
+
+PyDoc_STRVAR(_pickle_Unpickler_find_class__doc__,
+"find_class($self, module_name, global_name, /)\n"
+"--\n"
+"\n"
+"Return an object from a specified module.\n"
+"\n"
+"If necessary, the module will be imported. Subclasses may override\n"
+"this method (e.g. to restrict unpickling of arbitrary classes and\n"
+"functions).\n"
+"\n"
+"This method is called whenever a class or a function object is\n"
+"needed.  Both arguments passed are str objects.");
+
+#define _PICKLE_UNPICKLER_FIND_CLASS_METHODDEF    \
+    {"find_class", (PyCFunction)_pickle_Unpickler_find_class, METH_VARARGS, _pickle_Unpickler_find_class__doc__},
+
+static PyObject *
+_pickle_Unpickler_find_class_impl(UnpicklerObject *self, PyObject *module_name, PyObject *global_name);
+
+static PyObject *
+_pickle_Unpickler_find_class(UnpicklerObject *self, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    PyObject *module_name;
+    PyObject *global_name;
+
+    if (!PyArg_UnpackTuple(args, "find_class",
+        2, 2,
+        &module_name, &global_name))
+        goto exit;
+    return_value = _pickle_Unpickler_find_class_impl(self, module_name, global_name);
+
+exit:
+    return return_value;
+}
+
+PyDoc_STRVAR(_pickle_Unpickler___sizeof____doc__,
+"__sizeof__($self, /)\n"
+"--\n"
+"\n"
+"Returns size in memory, in bytes.");
+
+#define _PICKLE_UNPICKLER___SIZEOF___METHODDEF    \
+    {"__sizeof__", (PyCFunction)_pickle_Unpickler___sizeof__, METH_NOARGS, _pickle_Unpickler___sizeof____doc__},
+
+static Py_ssize_t
+_pickle_Unpickler___sizeof___impl(UnpicklerObject *self);
+
+static PyObject *
+_pickle_Unpickler___sizeof__(UnpicklerObject *self, PyObject *Py_UNUSED(ignored))
+{
+    PyObject *return_value = NULL;
+    Py_ssize_t _return_value;
+
+    _return_value = _pickle_Unpickler___sizeof___impl(self);
+    if ((_return_value == -1) && PyErr_Occurred())
+        goto exit;
+    return_value = PyLong_FromSsize_t(_return_value);
+
+exit:
+    return return_value;
+}
+
+PyDoc_STRVAR(_pickle_Unpickler___init____doc__,
+"Unpickler(file, *, fix_imports=True, encoding=\'ASCII\', errors=\'strict\')\n"
+"--\n"
+"\n"
+"This takes a binary file for reading a pickle data stream.\n"
+"\n"
+"The protocol version of the pickle is detected automatically, so no\n"
+"protocol argument is needed.  Bytes past the pickled object\'s\n"
+"representation are ignored.\n"
+"\n"
+"The argument *file* must have two methods, a read() method that takes\n"
+"an integer argument, and a readline() method that requires no\n"
+"arguments.  Both methods should return bytes.  Thus *file* can be a\n"
+"binary file object opened for reading, a io.BytesIO object, or any\n"
+"other custom object that meets this interface.\n"
+"\n"
+"Optional keyword arguments are *fix_imports*, *encoding* and *errors*,\n"
+"which are used to control compatiblity support for pickle stream\n"
+"generated by Python 2.  If *fix_imports* is True, pickle will try to\n"
+"map the old Python 2 names to the new names used in Python 3.  The\n"
+"*encoding* and *errors* tell pickle how to decode 8-bit string\n"
+"instances pickled by Python 2; these default to \'ASCII\' and \'strict\',\n"
+"respectively.  The *encoding* can be \'bytes\' to read these 8-bit\n"
+"string instances as bytes objects.");
+
+static int
+_pickle_Unpickler___init___impl(UnpicklerObject *self, PyObject *file, int fix_imports, const char *encoding, const char *errors);
+
+static int
+_pickle_Unpickler___init__(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+    int return_value = -1;
+    static char *_keywords[] = {"file", "fix_imports", "encoding", "errors", NULL};
+    PyObject *file;
+    int fix_imports = 1;
+    const char *encoding = "ASCII";
+    const char *errors = "strict";
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+        "O|$pss:Unpickler", _keywords,
+        &file, &fix_imports, &encoding, &errors))
+        goto exit;
+    return_value = _pickle_Unpickler___init___impl((UnpicklerObject *)self, file, fix_imports, encoding, errors);
+
+exit:
+    return return_value;
+}
+
+PyDoc_STRVAR(_pickle_UnpicklerMemoProxy_clear__doc__,
+"clear($self, /)\n"
+"--\n"
+"\n"
+"Remove all items from memo.");
+
+#define _PICKLE_UNPICKLERMEMOPROXY_CLEAR_METHODDEF    \
+    {"clear", (PyCFunction)_pickle_UnpicklerMemoProxy_clear, METH_NOARGS, _pickle_UnpicklerMemoProxy_clear__doc__},
+
+static PyObject *
+_pickle_UnpicklerMemoProxy_clear_impl(UnpicklerMemoProxyObject *self);
+
+static PyObject *
+_pickle_UnpicklerMemoProxy_clear(UnpicklerMemoProxyObject *self, PyObject *Py_UNUSED(ignored))
+{
+    return _pickle_UnpicklerMemoProxy_clear_impl(self);
+}
+
+PyDoc_STRVAR(_pickle_UnpicklerMemoProxy_copy__doc__,
+"copy($self, /)\n"
+"--\n"
+"\n"
+"Copy the memo to a new object.");
+
+#define _PICKLE_UNPICKLERMEMOPROXY_COPY_METHODDEF    \
+    {"copy", (PyCFunction)_pickle_UnpicklerMemoProxy_copy, METH_NOARGS, _pickle_UnpicklerMemoProxy_copy__doc__},
+
+static PyObject *
+_pickle_UnpicklerMemoProxy_copy_impl(UnpicklerMemoProxyObject *self);
+
+static PyObject *
+_pickle_UnpicklerMemoProxy_copy(UnpicklerMemoProxyObject *self, PyObject *Py_UNUSED(ignored))
+{
+    return _pickle_UnpicklerMemoProxy_copy_impl(self);
+}
+
+PyDoc_STRVAR(_pickle_UnpicklerMemoProxy___reduce____doc__,
+"__reduce__($self, /)\n"
+"--\n"
+"\n"
+"Implement pickling support.");
+
+#define _PICKLE_UNPICKLERMEMOPROXY___REDUCE___METHODDEF    \
+    {"__reduce__", (PyCFunction)_pickle_UnpicklerMemoProxy___reduce__, METH_NOARGS, _pickle_UnpicklerMemoProxy___reduce____doc__},
+
+static PyObject *
+_pickle_UnpicklerMemoProxy___reduce___impl(UnpicklerMemoProxyObject *self);
+
+static PyObject *
+_pickle_UnpicklerMemoProxy___reduce__(UnpicklerMemoProxyObject *self, PyObject *Py_UNUSED(ignored))
+{
+    return _pickle_UnpicklerMemoProxy___reduce___impl(self);
+}
+
+PyDoc_STRVAR(_pickle_dump__doc__,
+"dump($module, /, obj, file, protocol=None, *, fix_imports=True)\n"
+"--\n"
+"\n"
+"Write a pickled representation of obj to the open file object file.\n"
+"\n"
+"This is equivalent to ``Pickler(file, protocol).dump(obj)``, but may\n"
+"be more efficient.\n"
+"\n"
+"The optional *protocol* argument tells the pickler to use the given\n"
+"protocol supported protocols are 0, 1, 2, 3 and 4.  The default\n"
+"protocol is 3; a backward-incompatible protocol designed for Python 3.\n"
+"\n"
+"Specifying a negative protocol version selects the highest protocol\n"
+"version supported.  The higher the protocol used, the more recent the\n"
+"version of Python needed to read the pickle produced.\n"
+"\n"
+"The *file* argument must have a write() method that accepts a single\n"
+"bytes argument.  It can thus be a file object opened for binary\n"
+"writing, a io.BytesIO instance, or any other custom object that meets\n"
+"this interface.\n"
+"\n"
+"If *fix_imports* is True and protocol is less than 3, pickle will try\n"
+"to map the new Python 3 names to the old module names used in Python\n"
+"2, so that the pickle data stream is readable with Python 2.");
+
+#define _PICKLE_DUMP_METHODDEF    \
+    {"dump", (PyCFunction)_pickle_dump, METH_VARARGS|METH_KEYWORDS, _pickle_dump__doc__},
+
+static PyObject *
+_pickle_dump_impl(PyModuleDef *module, PyObject *obj, PyObject *file, PyObject *protocol, int fix_imports);
+
+static PyObject *
+_pickle_dump(PyModuleDef *module, PyObject *args, PyObject *kwargs)
+{
+    PyObject *return_value = NULL;
+    static char *_keywords[] = {"obj", "file", "protocol", "fix_imports", NULL};
+    PyObject *obj;
+    PyObject *file;
+    PyObject *protocol = NULL;
+    int fix_imports = 1;
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+        "OO|O$p:dump", _keywords,
+        &obj, &file, &protocol, &fix_imports))
+        goto exit;
+    return_value = _pickle_dump_impl(module, obj, file, protocol, fix_imports);
+
+exit:
+    return return_value;
+}
+
+PyDoc_STRVAR(_pickle_dumps__doc__,
+"dumps($module, /, obj, protocol=None, *, fix_imports=True)\n"
+"--\n"
+"\n"
+"Return the pickled representation of the object as a bytes object.\n"
+"\n"
+"The optional *protocol* argument tells the pickler to use the given\n"
+"protocol; supported protocols are 0, 1, 2, 3 and 4.  The default\n"
+"protocol is 3; a backward-incompatible protocol designed for Python 3.\n"
+"\n"
+"Specifying a negative protocol version selects the highest protocol\n"
+"version supported.  The higher the protocol used, the more recent the\n"
+"version of Python needed to read the pickle produced.\n"
+"\n"
+"If *fix_imports* is True and *protocol* is less than 3, pickle will\n"
+"try to map the new Python 3 names to the old module names used in\n"
+"Python 2, so that the pickle data stream is readable with Python 2.");
+
+#define _PICKLE_DUMPS_METHODDEF    \
+    {"dumps", (PyCFunction)_pickle_dumps, METH_VARARGS|METH_KEYWORDS, _pickle_dumps__doc__},
+
+static PyObject *
+_pickle_dumps_impl(PyModuleDef *module, PyObject *obj, PyObject *protocol, int fix_imports);
+
+static PyObject *
+_pickle_dumps(PyModuleDef *module, PyObject *args, PyObject *kwargs)
+{
+    PyObject *return_value = NULL;
+    static char *_keywords[] = {"obj", "protocol", "fix_imports", NULL};
+    PyObject *obj;
+    PyObject *protocol = NULL;
+    int fix_imports = 1;
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+        "O|O$p:dumps", _keywords,
+        &obj, &protocol, &fix_imports))
+        goto exit;
+    return_value = _pickle_dumps_impl(module, obj, protocol, fix_imports);
+
+exit:
+    return return_value;
+}
+
+PyDoc_STRVAR(_pickle_load__doc__,
+"load($module, /, file, *, fix_imports=True, encoding=\'ASCII\',\n"
+"     errors=\'strict\')\n"
+"--\n"
+"\n"
+"Read and return an object from the pickle data stored in a file.\n"
+"\n"
+"This is equivalent to ``Unpickler(file).load()``, but may be more\n"
+"efficient.\n"
+"\n"
+"The protocol version of the pickle is detected automatically, so no\n"
+"protocol argument is needed.  Bytes past the pickled object\'s\n"
+"representation are ignored.\n"
+"\n"
+"The argument *file* must have two methods, a read() method that takes\n"
+"an integer argument, and a readline() method that requires no\n"
+"arguments.  Both methods should return bytes.  Thus *file* can be a\n"
+"binary file object opened for reading, a io.BytesIO object, or any\n"
+"other custom object that meets this interface.\n"
+"\n"
+"Optional keyword arguments are *fix_imports*, *encoding* and *errors*,\n"
+"which are used to control compatiblity support for pickle stream\n"
+"generated by Python 2.  If *fix_imports* is True, pickle will try to\n"
+"map the old Python 2 names to the new names used in Python 3.  The\n"
+"*encoding* and *errors* tell pickle how to decode 8-bit string\n"
+"instances pickled by Python 2; these default to \'ASCII\' and \'strict\',\n"
+"respectively.  The *encoding* can be \'bytes\' to read these 8-bit\n"
+"string instances as bytes objects.");
+
+#define _PICKLE_LOAD_METHODDEF    \
+    {"load", (PyCFunction)_pickle_load, METH_VARARGS|METH_KEYWORDS, _pickle_load__doc__},
+
+static PyObject *
+_pickle_load_impl(PyModuleDef *module, PyObject *file, int fix_imports, const char *encoding, const char *errors);
+
+static PyObject *
+_pickle_load(PyModuleDef *module, PyObject *args, PyObject *kwargs)
+{
+    PyObject *return_value = NULL;
+    static char *_keywords[] = {"file", "fix_imports", "encoding", "errors", NULL};
+    PyObject *file;
+    int fix_imports = 1;
+    const char *encoding = "ASCII";
+    const char *errors = "strict";
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+        "O|$pss:load", _keywords,
+        &file, &fix_imports, &encoding, &errors))
+        goto exit;
+    return_value = _pickle_load_impl(module, file, fix_imports, encoding, errors);
+
+exit:
+    return return_value;
+}
+
+PyDoc_STRVAR(_pickle_loads__doc__,
+"loads($module, /, data, *, fix_imports=True, encoding=\'ASCII\',\n"
+"      errors=\'strict\')\n"
+"--\n"
+"\n"
+"Read and return an object from the given pickle data.\n"
+"\n"
+"The protocol version of the pickle is detected automatically, so no\n"
+"protocol argument is needed.  Bytes past the pickled object\'s\n"
+"representation are ignored.\n"
+"\n"
+"Optional keyword arguments are *fix_imports*, *encoding* and *errors*,\n"
+"which are used to control compatiblity support for pickle stream\n"
+"generated by Python 2.  If *fix_imports* is True, pickle will try to\n"
+"map the old Python 2 names to the new names used in Python 3.  The\n"
+"*encoding* and *errors* tell pickle how to decode 8-bit string\n"
+"instances pickled by Python 2; these default to \'ASCII\' and \'strict\',\n"
+"respectively.  The *encoding* can be \'bytes\' to read these 8-bit\n"
+"string instances as bytes objects.");
+
+#define _PICKLE_LOADS_METHODDEF    \
+    {"loads", (PyCFunction)_pickle_loads, METH_VARARGS|METH_KEYWORDS, _pickle_loads__doc__},
+
+static PyObject *
+_pickle_loads_impl(PyModuleDef *module, PyObject *data, int fix_imports, const char *encoding, const char *errors);
+
+static PyObject *
+_pickle_loads(PyModuleDef *module, PyObject *args, PyObject *kwargs)
+{
+    PyObject *return_value = NULL;
+    static char *_keywords[] = {"data", "fix_imports", "encoding", "errors", NULL};
+    PyObject *data;
+    int fix_imports = 1;
+    const char *encoding = "ASCII";
+    const char *errors = "strict";
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+        "O|$pss:loads", _keywords,
+        &data, &fix_imports, &encoding, &errors))
+        goto exit;
+    return_value = _pickle_loads_impl(module, data, fix_imports, encoding, errors);
+
+exit:
+    return return_value;
+}
+/*[clinic end generated code: output=3aba79576e240c62 input=a9049054013a1b77]*/
diff --git a/Modules/clinic/audioop.c.h b/Modules/clinic/audioop.c.h
new file mode 100644
index 0000000..40ef5e2
--- /dev/null
+++ b/Modules/clinic/audioop.c.h
@@ -0,0 +1,889 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+PyDoc_STRVAR(audioop_getsample__doc__,
+"getsample($module, fragment, width, index, /)\n"
+"--\n"
+"\n"
+"Return the value of sample index from the fragment.");
+
+#define AUDIOOP_GETSAMPLE_METHODDEF    \
+    {"getsample", (PyCFunction)audioop_getsample, METH_VARARGS, audioop_getsample__doc__},
+
+static PyObject *
+audioop_getsample_impl(PyModuleDef *module, Py_buffer *fragment, int width, Py_ssize_t index);
+
+static PyObject *
+audioop_getsample(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer fragment = {NULL, NULL};
+    int width;
+    Py_ssize_t index;
+
+    if (!PyArg_ParseTuple(args,
+        "y*in:getsample",
+        &fragment, &width, &index))
+        goto exit;
+    return_value = audioop_getsample_impl(module, &fragment, width, index);
+
+exit:
+    /* Cleanup for fragment */
+    if (fragment.obj)
+       PyBuffer_Release(&fragment);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(audioop_max__doc__,
+"max($module, fragment, width, /)\n"
+"--\n"
+"\n"
+"Return the maximum of the absolute value of all samples in a fragment.");
+
+#define AUDIOOP_MAX_METHODDEF    \
+    {"max", (PyCFunction)audioop_max, METH_VARARGS, audioop_max__doc__},
+
+static PyObject *
+audioop_max_impl(PyModuleDef *module, Py_buffer *fragment, int width);
+
+static PyObject *
+audioop_max(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer fragment = {NULL, NULL};
+    int width;
+
+    if (!PyArg_ParseTuple(args,
+        "y*i:max",
+        &fragment, &width))
+        goto exit;
+    return_value = audioop_max_impl(module, &fragment, width);
+
+exit:
+    /* Cleanup for fragment */
+    if (fragment.obj)
+       PyBuffer_Release(&fragment);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(audioop_minmax__doc__,
+"minmax($module, fragment, width, /)\n"
+"--\n"
+"\n"
+"Return the minimum and maximum values of all samples in the sound fragment.");
+
+#define AUDIOOP_MINMAX_METHODDEF    \
+    {"minmax", (PyCFunction)audioop_minmax, METH_VARARGS, audioop_minmax__doc__},
+
+static PyObject *
+audioop_minmax_impl(PyModuleDef *module, Py_buffer *fragment, int width);
+
+static PyObject *
+audioop_minmax(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer fragment = {NULL, NULL};
+    int width;
+
+    if (!PyArg_ParseTuple(args,
+        "y*i:minmax",
+        &fragment, &width))
+        goto exit;
+    return_value = audioop_minmax_impl(module, &fragment, width);
+
+exit:
+    /* Cleanup for fragment */
+    if (fragment.obj)
+       PyBuffer_Release(&fragment);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(audioop_avg__doc__,
+"avg($module, fragment, width, /)\n"
+"--\n"
+"\n"
+"Return the average over all samples in the fragment.");
+
+#define AUDIOOP_AVG_METHODDEF    \
+    {"avg", (PyCFunction)audioop_avg, METH_VARARGS, audioop_avg__doc__},
+
+static PyObject *
+audioop_avg_impl(PyModuleDef *module, Py_buffer *fragment, int width);
+
+static PyObject *
+audioop_avg(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer fragment = {NULL, NULL};
+    int width;
+
+    if (!PyArg_ParseTuple(args,
+        "y*i:avg",
+        &fragment, &width))
+        goto exit;
+    return_value = audioop_avg_impl(module, &fragment, width);
+
+exit:
+    /* Cleanup for fragment */
+    if (fragment.obj)
+       PyBuffer_Release(&fragment);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(audioop_rms__doc__,
+"rms($module, fragment, width, /)\n"
+"--\n"
+"\n"
+"Return the root-mean-square of the fragment, i.e. sqrt(sum(S_i^2)/n).");
+
+#define AUDIOOP_RMS_METHODDEF    \
+    {"rms", (PyCFunction)audioop_rms, METH_VARARGS, audioop_rms__doc__},
+
+static PyObject *
+audioop_rms_impl(PyModuleDef *module, Py_buffer *fragment, int width);
+
+static PyObject *
+audioop_rms(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer fragment = {NULL, NULL};
+    int width;
+
+    if (!PyArg_ParseTuple(args,
+        "y*i:rms",
+        &fragment, &width))
+        goto exit;
+    return_value = audioop_rms_impl(module, &fragment, width);
+
+exit:
+    /* Cleanup for fragment */
+    if (fragment.obj)
+       PyBuffer_Release(&fragment);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(audioop_findfit__doc__,
+"findfit($module, fragment, reference, /)\n"
+"--\n"
+"\n"
+"Try to match reference as well as possible to a portion of fragment.");
+
+#define AUDIOOP_FINDFIT_METHODDEF    \
+    {"findfit", (PyCFunction)audioop_findfit, METH_VARARGS, audioop_findfit__doc__},
+
+static PyObject *
+audioop_findfit_impl(PyModuleDef *module, Py_buffer *fragment, Py_buffer *reference);
+
+static PyObject *
+audioop_findfit(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer fragment = {NULL, NULL};
+    Py_buffer reference = {NULL, NULL};
+
+    if (!PyArg_ParseTuple(args,
+        "y*y*:findfit",
+        &fragment, &reference))
+        goto exit;
+    return_value = audioop_findfit_impl(module, &fragment, &reference);
+
+exit:
+    /* Cleanup for fragment */
+    if (fragment.obj)
+       PyBuffer_Release(&fragment);
+    /* Cleanup for reference */
+    if (reference.obj)
+       PyBuffer_Release(&reference);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(audioop_findfactor__doc__,
+"findfactor($module, fragment, reference, /)\n"
+"--\n"
+"\n"
+"Return a factor F such that rms(add(fragment, mul(reference, -F))) is minimal.");
+
+#define AUDIOOP_FINDFACTOR_METHODDEF    \
+    {"findfactor", (PyCFunction)audioop_findfactor, METH_VARARGS, audioop_findfactor__doc__},
+
+static PyObject *
+audioop_findfactor_impl(PyModuleDef *module, Py_buffer *fragment, Py_buffer *reference);
+
+static PyObject *
+audioop_findfactor(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer fragment = {NULL, NULL};
+    Py_buffer reference = {NULL, NULL};
+
+    if (!PyArg_ParseTuple(args,
+        "y*y*:findfactor",
+        &fragment, &reference))
+        goto exit;
+    return_value = audioop_findfactor_impl(module, &fragment, &reference);
+
+exit:
+    /* Cleanup for fragment */
+    if (fragment.obj)
+       PyBuffer_Release(&fragment);
+    /* Cleanup for reference */
+    if (reference.obj)
+       PyBuffer_Release(&reference);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(audioop_findmax__doc__,
+"findmax($module, fragment, length, /)\n"
+"--\n"
+"\n"
+"Search fragment for a slice of specified number of samples with maximum energy.");
+
+#define AUDIOOP_FINDMAX_METHODDEF    \
+    {"findmax", (PyCFunction)audioop_findmax, METH_VARARGS, audioop_findmax__doc__},
+
+static PyObject *
+audioop_findmax_impl(PyModuleDef *module, Py_buffer *fragment, Py_ssize_t length);
+
+static PyObject *
+audioop_findmax(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer fragment = {NULL, NULL};
+    Py_ssize_t length;
+
+    if (!PyArg_ParseTuple(args,
+        "y*n:findmax",
+        &fragment, &length))
+        goto exit;
+    return_value = audioop_findmax_impl(module, &fragment, length);
+
+exit:
+    /* Cleanup for fragment */
+    if (fragment.obj)
+       PyBuffer_Release(&fragment);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(audioop_avgpp__doc__,
+"avgpp($module, fragment, width, /)\n"
+"--\n"
+"\n"
+"Return the average peak-peak value over all samples in the fragment.");
+
+#define AUDIOOP_AVGPP_METHODDEF    \
+    {"avgpp", (PyCFunction)audioop_avgpp, METH_VARARGS, audioop_avgpp__doc__},
+
+static PyObject *
+audioop_avgpp_impl(PyModuleDef *module, Py_buffer *fragment, int width);
+
+static PyObject *
+audioop_avgpp(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer fragment = {NULL, NULL};
+    int width;
+
+    if (!PyArg_ParseTuple(args,
+        "y*i:avgpp",
+        &fragment, &width))
+        goto exit;
+    return_value = audioop_avgpp_impl(module, &fragment, width);
+
+exit:
+    /* Cleanup for fragment */
+    if (fragment.obj)
+       PyBuffer_Release(&fragment);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(audioop_maxpp__doc__,
+"maxpp($module, fragment, width, /)\n"
+"--\n"
+"\n"
+"Return the maximum peak-peak value in the sound fragment.");
+
+#define AUDIOOP_MAXPP_METHODDEF    \
+    {"maxpp", (PyCFunction)audioop_maxpp, METH_VARARGS, audioop_maxpp__doc__},
+
+static PyObject *
+audioop_maxpp_impl(PyModuleDef *module, Py_buffer *fragment, int width);
+
+static PyObject *
+audioop_maxpp(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer fragment = {NULL, NULL};
+    int width;
+
+    if (!PyArg_ParseTuple(args,
+        "y*i:maxpp",
+        &fragment, &width))
+        goto exit;
+    return_value = audioop_maxpp_impl(module, &fragment, width);
+
+exit:
+    /* Cleanup for fragment */
+    if (fragment.obj)
+       PyBuffer_Release(&fragment);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(audioop_cross__doc__,
+"cross($module, fragment, width, /)\n"
+"--\n"
+"\n"
+"Return the number of zero crossings in the fragment passed as an argument.");
+
+#define AUDIOOP_CROSS_METHODDEF    \
+    {"cross", (PyCFunction)audioop_cross, METH_VARARGS, audioop_cross__doc__},
+
+static PyObject *
+audioop_cross_impl(PyModuleDef *module, Py_buffer *fragment, int width);
+
+static PyObject *
+audioop_cross(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer fragment = {NULL, NULL};
+    int width;
+
+    if (!PyArg_ParseTuple(args,
+        "y*i:cross",
+        &fragment, &width))
+        goto exit;
+    return_value = audioop_cross_impl(module, &fragment, width);
+
+exit:
+    /* Cleanup for fragment */
+    if (fragment.obj)
+       PyBuffer_Release(&fragment);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(audioop_mul__doc__,
+"mul($module, fragment, width, factor, /)\n"
+"--\n"
+"\n"
+"Return a fragment that has all samples in the original fragment multiplied by the floating-point value factor.");
+
+#define AUDIOOP_MUL_METHODDEF    \
+    {"mul", (PyCFunction)audioop_mul, METH_VARARGS, audioop_mul__doc__},
+
+static PyObject *
+audioop_mul_impl(PyModuleDef *module, Py_buffer *fragment, int width, double factor);
+
+static PyObject *
+audioop_mul(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer fragment = {NULL, NULL};
+    int width;
+    double factor;
+
+    if (!PyArg_ParseTuple(args,
+        "y*id:mul",
+        &fragment, &width, &factor))
+        goto exit;
+    return_value = audioop_mul_impl(module, &fragment, width, factor);
+
+exit:
+    /* Cleanup for fragment */
+    if (fragment.obj)
+       PyBuffer_Release(&fragment);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(audioop_tomono__doc__,
+"tomono($module, fragment, width, lfactor, rfactor, /)\n"
+"--\n"
+"\n"
+"Convert a stereo fragment to a mono fragment.");
+
+#define AUDIOOP_TOMONO_METHODDEF    \
+    {"tomono", (PyCFunction)audioop_tomono, METH_VARARGS, audioop_tomono__doc__},
+
+static PyObject *
+audioop_tomono_impl(PyModuleDef *module, Py_buffer *fragment, int width, double lfactor, double rfactor);
+
+static PyObject *
+audioop_tomono(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer fragment = {NULL, NULL};
+    int width;
+    double lfactor;
+    double rfactor;
+
+    if (!PyArg_ParseTuple(args,
+        "y*idd:tomono",
+        &fragment, &width, &lfactor, &rfactor))
+        goto exit;
+    return_value = audioop_tomono_impl(module, &fragment, width, lfactor, rfactor);
+
+exit:
+    /* Cleanup for fragment */
+    if (fragment.obj)
+       PyBuffer_Release(&fragment);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(audioop_tostereo__doc__,
+"tostereo($module, fragment, width, lfactor, rfactor, /)\n"
+"--\n"
+"\n"
+"Generate a stereo fragment from a mono fragment.");
+
+#define AUDIOOP_TOSTEREO_METHODDEF    \
+    {"tostereo", (PyCFunction)audioop_tostereo, METH_VARARGS, audioop_tostereo__doc__},
+
+static PyObject *
+audioop_tostereo_impl(PyModuleDef *module, Py_buffer *fragment, int width, double lfactor, double rfactor);
+
+static PyObject *
+audioop_tostereo(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer fragment = {NULL, NULL};
+    int width;
+    double lfactor;
+    double rfactor;
+
+    if (!PyArg_ParseTuple(args,
+        "y*idd:tostereo",
+        &fragment, &width, &lfactor, &rfactor))
+        goto exit;
+    return_value = audioop_tostereo_impl(module, &fragment, width, lfactor, rfactor);
+
+exit:
+    /* Cleanup for fragment */
+    if (fragment.obj)
+       PyBuffer_Release(&fragment);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(audioop_add__doc__,
+"add($module, fragment1, fragment2, width, /)\n"
+"--\n"
+"\n"
+"Return a fragment which is the addition of the two samples passed as parameters.");
+
+#define AUDIOOP_ADD_METHODDEF    \
+    {"add", (PyCFunction)audioop_add, METH_VARARGS, audioop_add__doc__},
+
+static PyObject *
+audioop_add_impl(PyModuleDef *module, Py_buffer *fragment1, Py_buffer *fragment2, int width);
+
+static PyObject *
+audioop_add(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer fragment1 = {NULL, NULL};
+    Py_buffer fragment2 = {NULL, NULL};
+    int width;
+
+    if (!PyArg_ParseTuple(args,
+        "y*y*i:add",
+        &fragment1, &fragment2, &width))
+        goto exit;
+    return_value = audioop_add_impl(module, &fragment1, &fragment2, width);
+
+exit:
+    /* Cleanup for fragment1 */
+    if (fragment1.obj)
+       PyBuffer_Release(&fragment1);
+    /* Cleanup for fragment2 */
+    if (fragment2.obj)
+       PyBuffer_Release(&fragment2);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(audioop_bias__doc__,
+"bias($module, fragment, width, bias, /)\n"
+"--\n"
+"\n"
+"Return a fragment that is the original fragment with a bias added to each sample.");
+
+#define AUDIOOP_BIAS_METHODDEF    \
+    {"bias", (PyCFunction)audioop_bias, METH_VARARGS, audioop_bias__doc__},
+
+static PyObject *
+audioop_bias_impl(PyModuleDef *module, Py_buffer *fragment, int width, int bias);
+
+static PyObject *
+audioop_bias(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer fragment = {NULL, NULL};
+    int width;
+    int bias;
+
+    if (!PyArg_ParseTuple(args,
+        "y*ii:bias",
+        &fragment, &width, &bias))
+        goto exit;
+    return_value = audioop_bias_impl(module, &fragment, width, bias);
+
+exit:
+    /* Cleanup for fragment */
+    if (fragment.obj)
+       PyBuffer_Release(&fragment);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(audioop_reverse__doc__,
+"reverse($module, fragment, width, /)\n"
+"--\n"
+"\n"
+"Reverse the samples in a fragment and returns the modified fragment.");
+
+#define AUDIOOP_REVERSE_METHODDEF    \
+    {"reverse", (PyCFunction)audioop_reverse, METH_VARARGS, audioop_reverse__doc__},
+
+static PyObject *
+audioop_reverse_impl(PyModuleDef *module, Py_buffer *fragment, int width);
+
+static PyObject *
+audioop_reverse(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer fragment = {NULL, NULL};
+    int width;
+
+    if (!PyArg_ParseTuple(args,
+        "y*i:reverse",
+        &fragment, &width))
+        goto exit;
+    return_value = audioop_reverse_impl(module, &fragment, width);
+
+exit:
+    /* Cleanup for fragment */
+    if (fragment.obj)
+       PyBuffer_Release(&fragment);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(audioop_byteswap__doc__,
+"byteswap($module, fragment, width, /)\n"
+"--\n"
+"\n"
+"Convert big-endian samples to little-endian and vice versa.");
+
+#define AUDIOOP_BYTESWAP_METHODDEF    \
+    {"byteswap", (PyCFunction)audioop_byteswap, METH_VARARGS, audioop_byteswap__doc__},
+
+static PyObject *
+audioop_byteswap_impl(PyModuleDef *module, Py_buffer *fragment, int width);
+
+static PyObject *
+audioop_byteswap(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer fragment = {NULL, NULL};
+    int width;
+
+    if (!PyArg_ParseTuple(args,
+        "y*i:byteswap",
+        &fragment, &width))
+        goto exit;
+    return_value = audioop_byteswap_impl(module, &fragment, width);
+
+exit:
+    /* Cleanup for fragment */
+    if (fragment.obj)
+       PyBuffer_Release(&fragment);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(audioop_lin2lin__doc__,
+"lin2lin($module, fragment, width, newwidth, /)\n"
+"--\n"
+"\n"
+"Convert samples between 1-, 2-, 3- and 4-byte formats.");
+
+#define AUDIOOP_LIN2LIN_METHODDEF    \
+    {"lin2lin", (PyCFunction)audioop_lin2lin, METH_VARARGS, audioop_lin2lin__doc__},
+
+static PyObject *
+audioop_lin2lin_impl(PyModuleDef *module, Py_buffer *fragment, int width, int newwidth);
+
+static PyObject *
+audioop_lin2lin(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer fragment = {NULL, NULL};
+    int width;
+    int newwidth;
+
+    if (!PyArg_ParseTuple(args,
+        "y*ii:lin2lin",
+        &fragment, &width, &newwidth))
+        goto exit;
+    return_value = audioop_lin2lin_impl(module, &fragment, width, newwidth);
+
+exit:
+    /* Cleanup for fragment */
+    if (fragment.obj)
+       PyBuffer_Release(&fragment);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(audioop_ratecv__doc__,
+"ratecv($module, fragment, width, nchannels, inrate, outrate, state,\n"
+"       weightA=1, weightB=0, /)\n"
+"--\n"
+"\n"
+"Convert the frame rate of the input fragment.");
+
+#define AUDIOOP_RATECV_METHODDEF    \
+    {"ratecv", (PyCFunction)audioop_ratecv, METH_VARARGS, audioop_ratecv__doc__},
+
+static PyObject *
+audioop_ratecv_impl(PyModuleDef *module, Py_buffer *fragment, int width, int nchannels, int inrate, int outrate, PyObject *state, int weightA, int weightB);
+
+static PyObject *
+audioop_ratecv(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer fragment = {NULL, NULL};
+    int width;
+    int nchannels;
+    int inrate;
+    int outrate;
+    PyObject *state;
+    int weightA = 1;
+    int weightB = 0;
+
+    if (!PyArg_ParseTuple(args,
+        "y*iiiiO|ii:ratecv",
+        &fragment, &width, &nchannels, &inrate, &outrate, &state, &weightA, &weightB))
+        goto exit;
+    return_value = audioop_ratecv_impl(module, &fragment, width, nchannels, inrate, outrate, state, weightA, weightB);
+
+exit:
+    /* Cleanup for fragment */
+    if (fragment.obj)
+       PyBuffer_Release(&fragment);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(audioop_lin2ulaw__doc__,
+"lin2ulaw($module, fragment, width, /)\n"
+"--\n"
+"\n"
+"Convert samples in the audio fragment to u-LAW encoding.");
+
+#define AUDIOOP_LIN2ULAW_METHODDEF    \
+    {"lin2ulaw", (PyCFunction)audioop_lin2ulaw, METH_VARARGS, audioop_lin2ulaw__doc__},
+
+static PyObject *
+audioop_lin2ulaw_impl(PyModuleDef *module, Py_buffer *fragment, int width);
+
+static PyObject *
+audioop_lin2ulaw(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer fragment = {NULL, NULL};
+    int width;
+
+    if (!PyArg_ParseTuple(args,
+        "y*i:lin2ulaw",
+        &fragment, &width))
+        goto exit;
+    return_value = audioop_lin2ulaw_impl(module, &fragment, width);
+
+exit:
+    /* Cleanup for fragment */
+    if (fragment.obj)
+       PyBuffer_Release(&fragment);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(audioop_ulaw2lin__doc__,
+"ulaw2lin($module, fragment, width, /)\n"
+"--\n"
+"\n"
+"Convert sound fragments in u-LAW encoding to linearly encoded sound fragments.");
+
+#define AUDIOOP_ULAW2LIN_METHODDEF    \
+    {"ulaw2lin", (PyCFunction)audioop_ulaw2lin, METH_VARARGS, audioop_ulaw2lin__doc__},
+
+static PyObject *
+audioop_ulaw2lin_impl(PyModuleDef *module, Py_buffer *fragment, int width);
+
+static PyObject *
+audioop_ulaw2lin(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer fragment = {NULL, NULL};
+    int width;
+
+    if (!PyArg_ParseTuple(args,
+        "y*i:ulaw2lin",
+        &fragment, &width))
+        goto exit;
+    return_value = audioop_ulaw2lin_impl(module, &fragment, width);
+
+exit:
+    /* Cleanup for fragment */
+    if (fragment.obj)
+       PyBuffer_Release(&fragment);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(audioop_lin2alaw__doc__,
+"lin2alaw($module, fragment, width, /)\n"
+"--\n"
+"\n"
+"Convert samples in the audio fragment to a-LAW encoding.");
+
+#define AUDIOOP_LIN2ALAW_METHODDEF    \
+    {"lin2alaw", (PyCFunction)audioop_lin2alaw, METH_VARARGS, audioop_lin2alaw__doc__},
+
+static PyObject *
+audioop_lin2alaw_impl(PyModuleDef *module, Py_buffer *fragment, int width);
+
+static PyObject *
+audioop_lin2alaw(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer fragment = {NULL, NULL};
+    int width;
+
+    if (!PyArg_ParseTuple(args,
+        "y*i:lin2alaw",
+        &fragment, &width))
+        goto exit;
+    return_value = audioop_lin2alaw_impl(module, &fragment, width);
+
+exit:
+    /* Cleanup for fragment */
+    if (fragment.obj)
+       PyBuffer_Release(&fragment);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(audioop_alaw2lin__doc__,
+"alaw2lin($module, fragment, width, /)\n"
+"--\n"
+"\n"
+"Convert sound fragments in a-LAW encoding to linearly encoded sound fragments.");
+
+#define AUDIOOP_ALAW2LIN_METHODDEF    \
+    {"alaw2lin", (PyCFunction)audioop_alaw2lin, METH_VARARGS, audioop_alaw2lin__doc__},
+
+static PyObject *
+audioop_alaw2lin_impl(PyModuleDef *module, Py_buffer *fragment, int width);
+
+static PyObject *
+audioop_alaw2lin(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer fragment = {NULL, NULL};
+    int width;
+
+    if (!PyArg_ParseTuple(args,
+        "y*i:alaw2lin",
+        &fragment, &width))
+        goto exit;
+    return_value = audioop_alaw2lin_impl(module, &fragment, width);
+
+exit:
+    /* Cleanup for fragment */
+    if (fragment.obj)
+       PyBuffer_Release(&fragment);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(audioop_lin2adpcm__doc__,
+"lin2adpcm($module, fragment, width, state, /)\n"
+"--\n"
+"\n"
+"Convert samples to 4 bit Intel/DVI ADPCM encoding.");
+
+#define AUDIOOP_LIN2ADPCM_METHODDEF    \
+    {"lin2adpcm", (PyCFunction)audioop_lin2adpcm, METH_VARARGS, audioop_lin2adpcm__doc__},
+
+static PyObject *
+audioop_lin2adpcm_impl(PyModuleDef *module, Py_buffer *fragment, int width, PyObject *state);
+
+static PyObject *
+audioop_lin2adpcm(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer fragment = {NULL, NULL};
+    int width;
+    PyObject *state;
+
+    if (!PyArg_ParseTuple(args,
+        "y*iO:lin2adpcm",
+        &fragment, &width, &state))
+        goto exit;
+    return_value = audioop_lin2adpcm_impl(module, &fragment, width, state);
+
+exit:
+    /* Cleanup for fragment */
+    if (fragment.obj)
+       PyBuffer_Release(&fragment);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(audioop_adpcm2lin__doc__,
+"adpcm2lin($module, fragment, width, state, /)\n"
+"--\n"
+"\n"
+"Decode an Intel/DVI ADPCM coded fragment to a linear fragment.");
+
+#define AUDIOOP_ADPCM2LIN_METHODDEF    \
+    {"adpcm2lin", (PyCFunction)audioop_adpcm2lin, METH_VARARGS, audioop_adpcm2lin__doc__},
+
+static PyObject *
+audioop_adpcm2lin_impl(PyModuleDef *module, Py_buffer *fragment, int width, PyObject *state);
+
+static PyObject *
+audioop_adpcm2lin(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer fragment = {NULL, NULL};
+    int width;
+    PyObject *state;
+
+    if (!PyArg_ParseTuple(args,
+        "y*iO:adpcm2lin",
+        &fragment, &width, &state))
+        goto exit;
+    return_value = audioop_adpcm2lin_impl(module, &fragment, width, state);
+
+exit:
+    /* Cleanup for fragment */
+    if (fragment.obj)
+       PyBuffer_Release(&fragment);
+
+    return return_value;
+}
+/*[clinic end generated code: output=be840bba5d40c2ce input=a9049054013a1b77]*/
diff --git a/Modules/clinic/binascii.c.h b/Modules/clinic/binascii.c.h
new file mode 100644
index 0000000..f647032
--- /dev/null
+++ b/Modules/clinic/binascii.c.h
@@ -0,0 +1,546 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+PyDoc_STRVAR(binascii_a2b_uu__doc__,
+"a2b_uu($module, data, /)\n"
+"--\n"
+"\n"
+"Decode a line of uuencoded data.");
+
+#define BINASCII_A2B_UU_METHODDEF    \
+    {"a2b_uu", (PyCFunction)binascii_a2b_uu, METH_VARARGS, binascii_a2b_uu__doc__},
+
+static PyObject *
+binascii_a2b_uu_impl(PyModuleDef *module, Py_buffer *data);
+
+static PyObject *
+binascii_a2b_uu(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer data = {NULL, NULL};
+
+    if (!PyArg_ParseTuple(args,
+        "O&:a2b_uu",
+        ascii_buffer_converter, &data))
+        goto exit;
+    return_value = binascii_a2b_uu_impl(module, &data);
+
+exit:
+    /* Cleanup for data */
+    if (data.obj)
+       PyBuffer_Release(&data);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(binascii_b2a_uu__doc__,
+"b2a_uu($module, data, /)\n"
+"--\n"
+"\n"
+"Uuencode line of data.");
+
+#define BINASCII_B2A_UU_METHODDEF    \
+    {"b2a_uu", (PyCFunction)binascii_b2a_uu, METH_VARARGS, binascii_b2a_uu__doc__},
+
+static PyObject *
+binascii_b2a_uu_impl(PyModuleDef *module, Py_buffer *data);
+
+static PyObject *
+binascii_b2a_uu(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer data = {NULL, NULL};
+
+    if (!PyArg_ParseTuple(args,
+        "y*:b2a_uu",
+        &data))
+        goto exit;
+    return_value = binascii_b2a_uu_impl(module, &data);
+
+exit:
+    /* Cleanup for data */
+    if (data.obj)
+       PyBuffer_Release(&data);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(binascii_a2b_base64__doc__,
+"a2b_base64($module, data, /)\n"
+"--\n"
+"\n"
+"Decode a line of base64 data.");
+
+#define BINASCII_A2B_BASE64_METHODDEF    \
+    {"a2b_base64", (PyCFunction)binascii_a2b_base64, METH_VARARGS, binascii_a2b_base64__doc__},
+
+static PyObject *
+binascii_a2b_base64_impl(PyModuleDef *module, Py_buffer *data);
+
+static PyObject *
+binascii_a2b_base64(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer data = {NULL, NULL};
+
+    if (!PyArg_ParseTuple(args,
+        "O&:a2b_base64",
+        ascii_buffer_converter, &data))
+        goto exit;
+    return_value = binascii_a2b_base64_impl(module, &data);
+
+exit:
+    /* Cleanup for data */
+    if (data.obj)
+       PyBuffer_Release(&data);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(binascii_b2a_base64__doc__,
+"b2a_base64($module, data, /)\n"
+"--\n"
+"\n"
+"Base64-code line of data.");
+
+#define BINASCII_B2A_BASE64_METHODDEF    \
+    {"b2a_base64", (PyCFunction)binascii_b2a_base64, METH_VARARGS, binascii_b2a_base64__doc__},
+
+static PyObject *
+binascii_b2a_base64_impl(PyModuleDef *module, Py_buffer *data);
+
+static PyObject *
+binascii_b2a_base64(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer data = {NULL, NULL};
+
+    if (!PyArg_ParseTuple(args,
+        "y*:b2a_base64",
+        &data))
+        goto exit;
+    return_value = binascii_b2a_base64_impl(module, &data);
+
+exit:
+    /* Cleanup for data */
+    if (data.obj)
+       PyBuffer_Release(&data);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(binascii_a2b_hqx__doc__,
+"a2b_hqx($module, data, /)\n"
+"--\n"
+"\n"
+"Decode .hqx coding.");
+
+#define BINASCII_A2B_HQX_METHODDEF    \
+    {"a2b_hqx", (PyCFunction)binascii_a2b_hqx, METH_VARARGS, binascii_a2b_hqx__doc__},
+
+static PyObject *
+binascii_a2b_hqx_impl(PyModuleDef *module, Py_buffer *data);
+
+static PyObject *
+binascii_a2b_hqx(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer data = {NULL, NULL};
+
+    if (!PyArg_ParseTuple(args,
+        "O&:a2b_hqx",
+        ascii_buffer_converter, &data))
+        goto exit;
+    return_value = binascii_a2b_hqx_impl(module, &data);
+
+exit:
+    /* Cleanup for data */
+    if (data.obj)
+       PyBuffer_Release(&data);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(binascii_rlecode_hqx__doc__,
+"rlecode_hqx($module, data, /)\n"
+"--\n"
+"\n"
+"Binhex RLE-code binary data.");
+
+#define BINASCII_RLECODE_HQX_METHODDEF    \
+    {"rlecode_hqx", (PyCFunction)binascii_rlecode_hqx, METH_VARARGS, binascii_rlecode_hqx__doc__},
+
+static PyObject *
+binascii_rlecode_hqx_impl(PyModuleDef *module, Py_buffer *data);
+
+static PyObject *
+binascii_rlecode_hqx(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer data = {NULL, NULL};
+
+    if (!PyArg_ParseTuple(args,
+        "y*:rlecode_hqx",
+        &data))
+        goto exit;
+    return_value = binascii_rlecode_hqx_impl(module, &data);
+
+exit:
+    /* Cleanup for data */
+    if (data.obj)
+       PyBuffer_Release(&data);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(binascii_b2a_hqx__doc__,
+"b2a_hqx($module, data, /)\n"
+"--\n"
+"\n"
+"Encode .hqx data.");
+
+#define BINASCII_B2A_HQX_METHODDEF    \
+    {"b2a_hqx", (PyCFunction)binascii_b2a_hqx, METH_VARARGS, binascii_b2a_hqx__doc__},
+
+static PyObject *
+binascii_b2a_hqx_impl(PyModuleDef *module, Py_buffer *data);
+
+static PyObject *
+binascii_b2a_hqx(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer data = {NULL, NULL};
+
+    if (!PyArg_ParseTuple(args,
+        "y*:b2a_hqx",
+        &data))
+        goto exit;
+    return_value = binascii_b2a_hqx_impl(module, &data);
+
+exit:
+    /* Cleanup for data */
+    if (data.obj)
+       PyBuffer_Release(&data);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(binascii_rledecode_hqx__doc__,
+"rledecode_hqx($module, data, /)\n"
+"--\n"
+"\n"
+"Decode hexbin RLE-coded string.");
+
+#define BINASCII_RLEDECODE_HQX_METHODDEF    \
+    {"rledecode_hqx", (PyCFunction)binascii_rledecode_hqx, METH_VARARGS, binascii_rledecode_hqx__doc__},
+
+static PyObject *
+binascii_rledecode_hqx_impl(PyModuleDef *module, Py_buffer *data);
+
+static PyObject *
+binascii_rledecode_hqx(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer data = {NULL, NULL};
+
+    if (!PyArg_ParseTuple(args,
+        "y*:rledecode_hqx",
+        &data))
+        goto exit;
+    return_value = binascii_rledecode_hqx_impl(module, &data);
+
+exit:
+    /* Cleanup for data */
+    if (data.obj)
+       PyBuffer_Release(&data);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(binascii_crc_hqx__doc__,
+"crc_hqx($module, data, crc, /)\n"
+"--\n"
+"\n"
+"Compute hqx CRC incrementally.");
+
+#define BINASCII_CRC_HQX_METHODDEF    \
+    {"crc_hqx", (PyCFunction)binascii_crc_hqx, METH_VARARGS, binascii_crc_hqx__doc__},
+
+static int
+binascii_crc_hqx_impl(PyModuleDef *module, Py_buffer *data, int crc);
+
+static PyObject *
+binascii_crc_hqx(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer data = {NULL, NULL};
+    int crc;
+    int _return_value;
+
+    if (!PyArg_ParseTuple(args,
+        "y*i:crc_hqx",
+        &data, &crc))
+        goto exit;
+    _return_value = binascii_crc_hqx_impl(module, &data, crc);
+    if ((_return_value == -1) && PyErr_Occurred())
+        goto exit;
+    return_value = PyLong_FromLong((long)_return_value);
+
+exit:
+    /* Cleanup for data */
+    if (data.obj)
+       PyBuffer_Release(&data);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(binascii_crc32__doc__,
+"crc32($module, data, crc=0, /)\n"
+"--\n"
+"\n"
+"Compute CRC-32 incrementally.");
+
+#define BINASCII_CRC32_METHODDEF    \
+    {"crc32", (PyCFunction)binascii_crc32, METH_VARARGS, binascii_crc32__doc__},
+
+static unsigned int
+binascii_crc32_impl(PyModuleDef *module, Py_buffer *data, unsigned int crc);
+
+static PyObject *
+binascii_crc32(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer data = {NULL, NULL};
+    unsigned int crc = 0;
+    unsigned int _return_value;
+
+    if (!PyArg_ParseTuple(args,
+        "y*|I:crc32",
+        &data, &crc))
+        goto exit;
+    _return_value = binascii_crc32_impl(module, &data, crc);
+    if ((_return_value == -1) && PyErr_Occurred())
+        goto exit;
+    return_value = PyLong_FromUnsignedLong((unsigned long)_return_value);
+
+exit:
+    /* Cleanup for data */
+    if (data.obj)
+       PyBuffer_Release(&data);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(binascii_b2a_hex__doc__,
+"b2a_hex($module, data, /)\n"
+"--\n"
+"\n"
+"Hexadecimal representation of binary data.\n"
+"\n"
+"The return value is a bytes object.  This function is also\n"
+"available as \"hexlify()\".");
+
+#define BINASCII_B2A_HEX_METHODDEF    \
+    {"b2a_hex", (PyCFunction)binascii_b2a_hex, METH_VARARGS, binascii_b2a_hex__doc__},
+
+static PyObject *
+binascii_b2a_hex_impl(PyModuleDef *module, Py_buffer *data);
+
+static PyObject *
+binascii_b2a_hex(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer data = {NULL, NULL};
+
+    if (!PyArg_ParseTuple(args,
+        "y*:b2a_hex",
+        &data))
+        goto exit;
+    return_value = binascii_b2a_hex_impl(module, &data);
+
+exit:
+    /* Cleanup for data */
+    if (data.obj)
+       PyBuffer_Release(&data);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(binascii_hexlify__doc__,
+"hexlify($module, data, /)\n"
+"--\n"
+"\n"
+"Hexadecimal representation of binary data.\n"
+"\n"
+"The return value is a bytes object.");
+
+#define BINASCII_HEXLIFY_METHODDEF    \
+    {"hexlify", (PyCFunction)binascii_hexlify, METH_VARARGS, binascii_hexlify__doc__},
+
+static PyObject *
+binascii_hexlify_impl(PyModuleDef *module, Py_buffer *data);
+
+static PyObject *
+binascii_hexlify(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer data = {NULL, NULL};
+
+    if (!PyArg_ParseTuple(args,
+        "y*:hexlify",
+        &data))
+        goto exit;
+    return_value = binascii_hexlify_impl(module, &data);
+
+exit:
+    /* Cleanup for data */
+    if (data.obj)
+       PyBuffer_Release(&data);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(binascii_a2b_hex__doc__,
+"a2b_hex($module, hexstr, /)\n"
+"--\n"
+"\n"
+"Binary data of hexadecimal representation.\n"
+"\n"
+"hexstr must contain an even number of hex digits (upper or lower case).\n"
+"This function is also available as \"unhexlify()\".");
+
+#define BINASCII_A2B_HEX_METHODDEF    \
+    {"a2b_hex", (PyCFunction)binascii_a2b_hex, METH_VARARGS, binascii_a2b_hex__doc__},
+
+static PyObject *
+binascii_a2b_hex_impl(PyModuleDef *module, Py_buffer *hexstr);
+
+static PyObject *
+binascii_a2b_hex(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer hexstr = {NULL, NULL};
+
+    if (!PyArg_ParseTuple(args,
+        "O&:a2b_hex",
+        ascii_buffer_converter, &hexstr))
+        goto exit;
+    return_value = binascii_a2b_hex_impl(module, &hexstr);
+
+exit:
+    /* Cleanup for hexstr */
+    if (hexstr.obj)
+       PyBuffer_Release(&hexstr);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(binascii_unhexlify__doc__,
+"unhexlify($module, hexstr, /)\n"
+"--\n"
+"\n"
+"Binary data of hexadecimal representation.\n"
+"\n"
+"hexstr must contain an even number of hex digits (upper or lower case).");
+
+#define BINASCII_UNHEXLIFY_METHODDEF    \
+    {"unhexlify", (PyCFunction)binascii_unhexlify, METH_VARARGS, binascii_unhexlify__doc__},
+
+static PyObject *
+binascii_unhexlify_impl(PyModuleDef *module, Py_buffer *hexstr);
+
+static PyObject *
+binascii_unhexlify(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer hexstr = {NULL, NULL};
+
+    if (!PyArg_ParseTuple(args,
+        "O&:unhexlify",
+        ascii_buffer_converter, &hexstr))
+        goto exit;
+    return_value = binascii_unhexlify_impl(module, &hexstr);
+
+exit:
+    /* Cleanup for hexstr */
+    if (hexstr.obj)
+       PyBuffer_Release(&hexstr);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(binascii_a2b_qp__doc__,
+"a2b_qp($module, /, data, header=False)\n"
+"--\n"
+"\n"
+"Decode a string of qp-encoded data.");
+
+#define BINASCII_A2B_QP_METHODDEF    \
+    {"a2b_qp", (PyCFunction)binascii_a2b_qp, METH_VARARGS|METH_KEYWORDS, binascii_a2b_qp__doc__},
+
+static PyObject *
+binascii_a2b_qp_impl(PyModuleDef *module, Py_buffer *data, int header);
+
+static PyObject *
+binascii_a2b_qp(PyModuleDef *module, PyObject *args, PyObject *kwargs)
+{
+    PyObject *return_value = NULL;
+    static char *_keywords[] = {"data", "header", NULL};
+    Py_buffer data = {NULL, NULL};
+    int header = 0;
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+        "O&|i:a2b_qp", _keywords,
+        ascii_buffer_converter, &data, &header))
+        goto exit;
+    return_value = binascii_a2b_qp_impl(module, &data, header);
+
+exit:
+    /* Cleanup for data */
+    if (data.obj)
+       PyBuffer_Release(&data);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(binascii_b2a_qp__doc__,
+"b2a_qp($module, /, data, quotetabs=False, istext=True, header=False)\n"
+"--\n"
+"\n"
+"Encode a string using quoted-printable encoding.\n"
+"\n"
+"On encoding, when istext is set, newlines are not encoded, and white\n"
+"space at end of lines is.  When istext is not set, \\r and \\n (CR/LF)\n"
+"are both encoded.  When quotetabs is set, space and tabs are encoded.");
+
+#define BINASCII_B2A_QP_METHODDEF    \
+    {"b2a_qp", (PyCFunction)binascii_b2a_qp, METH_VARARGS|METH_KEYWORDS, binascii_b2a_qp__doc__},
+
+static PyObject *
+binascii_b2a_qp_impl(PyModuleDef *module, Py_buffer *data, int quotetabs, int istext, int header);
+
+static PyObject *
+binascii_b2a_qp(PyModuleDef *module, PyObject *args, PyObject *kwargs)
+{
+    PyObject *return_value = NULL;
+    static char *_keywords[] = {"data", "quotetabs", "istext", "header", NULL};
+    Py_buffer data = {NULL, NULL};
+    int quotetabs = 0;
+    int istext = 1;
+    int header = 0;
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+        "y*|iii:b2a_qp", _keywords,
+        &data, &quotetabs, &istext, &header))
+        goto exit;
+    return_value = binascii_b2a_qp_impl(module, &data, quotetabs, istext, header);
+
+exit:
+    /* Cleanup for data */
+    if (data.obj)
+       PyBuffer_Release(&data);
+
+    return return_value;
+}
+/*[clinic end generated code: output=e46d29f8c9adae7e input=a9049054013a1b77]*/
diff --git a/Modules/clinic/zlibmodule.c.h b/Modules/clinic/zlibmodule.c.h
new file mode 100644
index 0000000..f54a805
--- /dev/null
+++ b/Modules/clinic/zlibmodule.c.h
@@ -0,0 +1,453 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+PyDoc_STRVAR(zlib_compress__doc__,
+"compress($module, bytes, level=Z_DEFAULT_COMPRESSION, /)\n"
+"--\n"
+"\n"
+"Returns a bytes object containing compressed data.\n"
+"\n"
+"  bytes\n"
+"    Binary data to be compressed.\n"
+"  level\n"
+"    Compression level, in 0-9.");
+
+#define ZLIB_COMPRESS_METHODDEF    \
+    {"compress", (PyCFunction)zlib_compress, METH_VARARGS, zlib_compress__doc__},
+
+static PyObject *
+zlib_compress_impl(PyModuleDef *module, Py_buffer *bytes, int level);
+
+static PyObject *
+zlib_compress(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer bytes = {NULL, NULL};
+    int level = Z_DEFAULT_COMPRESSION;
+
+    if (!PyArg_ParseTuple(args,
+        "y*|i:compress",
+        &bytes, &level))
+        goto exit;
+    return_value = zlib_compress_impl(module, &bytes, level);
+
+exit:
+    /* Cleanup for bytes */
+    if (bytes.obj)
+       PyBuffer_Release(&bytes);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(zlib_decompress__doc__,
+"decompress($module, data, wbits=MAX_WBITS, bufsize=DEF_BUF_SIZE, /)\n"
+"--\n"
+"\n"
+"Returns a bytes object containing the uncompressed data.\n"
+"\n"
+"  data\n"
+"    Compressed data.\n"
+"  wbits\n"
+"    The window buffer size.\n"
+"  bufsize\n"
+"    The initial output buffer size.");
+
+#define ZLIB_DECOMPRESS_METHODDEF    \
+    {"decompress", (PyCFunction)zlib_decompress, METH_VARARGS, zlib_decompress__doc__},
+
+static PyObject *
+zlib_decompress_impl(PyModuleDef *module, Py_buffer *data, int wbits, unsigned int bufsize);
+
+static PyObject *
+zlib_decompress(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer data = {NULL, NULL};
+    int wbits = MAX_WBITS;
+    unsigned int bufsize = DEF_BUF_SIZE;
+
+    if (!PyArg_ParseTuple(args,
+        "y*|iO&:decompress",
+        &data, &wbits, uint_converter, &bufsize))
+        goto exit;
+    return_value = zlib_decompress_impl(module, &data, wbits, bufsize);
+
+exit:
+    /* Cleanup for data */
+    if (data.obj)
+       PyBuffer_Release(&data);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(zlib_compressobj__doc__,
+"compressobj($module, /, level=Z_DEFAULT_COMPRESSION, method=DEFLATED,\n"
+"            wbits=MAX_WBITS, memLevel=DEF_MEM_LEVEL,\n"
+"            strategy=Z_DEFAULT_STRATEGY, zdict=None)\n"
+"--\n"
+"\n"
+"Return a compressor object.\n"
+"\n"
+"  level\n"
+"    The compression level (an integer in the range 0-9; default is 6).\n"
+"    Higher compression levels are slower, but produce smaller results.\n"
+"  method\n"
+"    The compression algorithm.  If given, this must be DEFLATED.\n"
+"  wbits\n"
+"    The base two logarithm of the window size (range: 8..15).\n"
+"  memLevel\n"
+"    Controls the amount of memory used for internal compression state.\n"
+"    Valid values range from 1 to 9.  Higher values result in higher memory\n"
+"    usage, faster compression, and smaller output.\n"
+"  strategy\n"
+"    Used to tune the compression algorithm.  Possible values are\n"
+"    Z_DEFAULT_STRATEGY, Z_FILTERED, and Z_HUFFMAN_ONLY.\n"
+"  zdict\n"
+"    The predefined compression dictionary - a sequence of bytes\n"
+"    containing subsequences that are likely to occur in the input data.");
+
+#define ZLIB_COMPRESSOBJ_METHODDEF    \
+    {"compressobj", (PyCFunction)zlib_compressobj, METH_VARARGS|METH_KEYWORDS, zlib_compressobj__doc__},
+
+static PyObject *
+zlib_compressobj_impl(PyModuleDef *module, int level, int method, int wbits, int memLevel, int strategy, Py_buffer *zdict);
+
+static PyObject *
+zlib_compressobj(PyModuleDef *module, PyObject *args, PyObject *kwargs)
+{
+    PyObject *return_value = NULL;
+    static char *_keywords[] = {"level", "method", "wbits", "memLevel", "strategy", "zdict", NULL};
+    int level = Z_DEFAULT_COMPRESSION;
+    int method = DEFLATED;
+    int wbits = MAX_WBITS;
+    int memLevel = DEF_MEM_LEVEL;
+    int strategy = Z_DEFAULT_STRATEGY;
+    Py_buffer zdict = {NULL, NULL};
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+        "|iiiiiy*:compressobj", _keywords,
+        &level, &method, &wbits, &memLevel, &strategy, &zdict))
+        goto exit;
+    return_value = zlib_compressobj_impl(module, level, method, wbits, memLevel, strategy, &zdict);
+
+exit:
+    /* Cleanup for zdict */
+    if (zdict.obj)
+       PyBuffer_Release(&zdict);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(zlib_decompressobj__doc__,
+"decompressobj($module, /, wbits=MAX_WBITS, zdict=b\'\')\n"
+"--\n"
+"\n"
+"Return a decompressor object.\n"
+"\n"
+"  wbits\n"
+"    The window buffer size.\n"
+"  zdict\n"
+"    The predefined compression dictionary.  This must be the same\n"
+"    dictionary as used by the compressor that produced the input data.");
+
+#define ZLIB_DECOMPRESSOBJ_METHODDEF    \
+    {"decompressobj", (PyCFunction)zlib_decompressobj, METH_VARARGS|METH_KEYWORDS, zlib_decompressobj__doc__},
+
+static PyObject *
+zlib_decompressobj_impl(PyModuleDef *module, int wbits, PyObject *zdict);
+
+static PyObject *
+zlib_decompressobj(PyModuleDef *module, PyObject *args, PyObject *kwargs)
+{
+    PyObject *return_value = NULL;
+    static char *_keywords[] = {"wbits", "zdict", NULL};
+    int wbits = MAX_WBITS;
+    PyObject *zdict = NULL;
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+        "|iO:decompressobj", _keywords,
+        &wbits, &zdict))
+        goto exit;
+    return_value = zlib_decompressobj_impl(module, wbits, zdict);
+
+exit:
+    return return_value;
+}
+
+PyDoc_STRVAR(zlib_Compress_compress__doc__,
+"compress($self, data, /)\n"
+"--\n"
+"\n"
+"Returns a bytes object containing compressed data.\n"
+"\n"
+"  data\n"
+"    Binary data to be compressed.\n"
+"\n"
+"After calling this function, some of the input data may still\n"
+"be stored in internal buffers for later processing.\n"
+"Call the flush() method to clear these buffers.");
+
+#define ZLIB_COMPRESS_COMPRESS_METHODDEF    \
+    {"compress", (PyCFunction)zlib_Compress_compress, METH_VARARGS, zlib_Compress_compress__doc__},
+
+static PyObject *
+zlib_Compress_compress_impl(compobject *self, Py_buffer *data);
+
+static PyObject *
+zlib_Compress_compress(compobject *self, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer data = {NULL, NULL};
+
+    if (!PyArg_ParseTuple(args,
+        "y*:compress",
+        &data))
+        goto exit;
+    return_value = zlib_Compress_compress_impl(self, &data);
+
+exit:
+    /* Cleanup for data */
+    if (data.obj)
+       PyBuffer_Release(&data);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(zlib_Decompress_decompress__doc__,
+"decompress($self, data, max_length=0, /)\n"
+"--\n"
+"\n"
+"Return a bytes object containing the decompressed version of the data.\n"
+"\n"
+"  data\n"
+"    The binary data to decompress.\n"
+"  max_length\n"
+"    The maximum allowable length of the decompressed data.\n"
+"    Unconsumed input data will be stored in\n"
+"    the unconsumed_tail attribute.\n"
+"\n"
+"After calling this function, some of the input data may still be stored in\n"
+"internal buffers for later processing.\n"
+"Call the flush() method to clear these buffers.");
+
+#define ZLIB_DECOMPRESS_DECOMPRESS_METHODDEF    \
+    {"decompress", (PyCFunction)zlib_Decompress_decompress, METH_VARARGS, zlib_Decompress_decompress__doc__},
+
+static PyObject *
+zlib_Decompress_decompress_impl(compobject *self, Py_buffer *data, unsigned int max_length);
+
+static PyObject *
+zlib_Decompress_decompress(compobject *self, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer data = {NULL, NULL};
+    unsigned int max_length = 0;
+
+    if (!PyArg_ParseTuple(args,
+        "y*|O&:decompress",
+        &data, uint_converter, &max_length))
+        goto exit;
+    return_value = zlib_Decompress_decompress_impl(self, &data, max_length);
+
+exit:
+    /* Cleanup for data */
+    if (data.obj)
+       PyBuffer_Release(&data);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(zlib_Compress_flush__doc__,
+"flush($self, mode=zlib.Z_FINISH, /)\n"
+"--\n"
+"\n"
+"Return a bytes object containing any remaining compressed data.\n"
+"\n"
+"  mode\n"
+"    One of the constants Z_SYNC_FLUSH, Z_FULL_FLUSH, Z_FINISH.\n"
+"    If mode == Z_FINISH, the compressor object can no longer be\n"
+"    used after calling the flush() method.  Otherwise, more data\n"
+"    can still be compressed.");
+
+#define ZLIB_COMPRESS_FLUSH_METHODDEF    \
+    {"flush", (PyCFunction)zlib_Compress_flush, METH_VARARGS, zlib_Compress_flush__doc__},
+
+static PyObject *
+zlib_Compress_flush_impl(compobject *self, int mode);
+
+static PyObject *
+zlib_Compress_flush(compobject *self, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    int mode = Z_FINISH;
+
+    if (!PyArg_ParseTuple(args,
+        "|i:flush",
+        &mode))
+        goto exit;
+    return_value = zlib_Compress_flush_impl(self, mode);
+
+exit:
+    return return_value;
+}
+
+#if defined(HAVE_ZLIB_COPY)
+
+PyDoc_STRVAR(zlib_Compress_copy__doc__,
+"copy($self, /)\n"
+"--\n"
+"\n"
+"Return a copy of the compression object.");
+
+#define ZLIB_COMPRESS_COPY_METHODDEF    \
+    {"copy", (PyCFunction)zlib_Compress_copy, METH_NOARGS, zlib_Compress_copy__doc__},
+
+static PyObject *
+zlib_Compress_copy_impl(compobject *self);
+
+static PyObject *
+zlib_Compress_copy(compobject *self, PyObject *Py_UNUSED(ignored))
+{
+    return zlib_Compress_copy_impl(self);
+}
+
+#endif /* defined(HAVE_ZLIB_COPY) */
+
+#ifndef ZLIB_COMPRESS_COPY_METHODDEF
+    #define ZLIB_COMPRESS_COPY_METHODDEF
+#endif /* !defined(ZLIB_COMPRESS_COPY_METHODDEF) */
+
+#if defined(HAVE_ZLIB_COPY)
+
+PyDoc_STRVAR(zlib_Decompress_copy__doc__,
+"copy($self, /)\n"
+"--\n"
+"\n"
+"Return a copy of the decompression object.");
+
+#define ZLIB_DECOMPRESS_COPY_METHODDEF    \
+    {"copy", (PyCFunction)zlib_Decompress_copy, METH_NOARGS, zlib_Decompress_copy__doc__},
+
+static PyObject *
+zlib_Decompress_copy_impl(compobject *self);
+
+static PyObject *
+zlib_Decompress_copy(compobject *self, PyObject *Py_UNUSED(ignored))
+{
+    return zlib_Decompress_copy_impl(self);
+}
+
+#endif /* defined(HAVE_ZLIB_COPY) */
+
+#ifndef ZLIB_DECOMPRESS_COPY_METHODDEF
+    #define ZLIB_DECOMPRESS_COPY_METHODDEF
+#endif /* !defined(ZLIB_DECOMPRESS_COPY_METHODDEF) */
+
+PyDoc_STRVAR(zlib_Decompress_flush__doc__,
+"flush($self, length=zlib.DEF_BUF_SIZE, /)\n"
+"--\n"
+"\n"
+"Return a bytes object containing any remaining decompressed data.\n"
+"\n"
+"  length\n"
+"    the initial size of the output buffer.");
+
+#define ZLIB_DECOMPRESS_FLUSH_METHODDEF    \
+    {"flush", (PyCFunction)zlib_Decompress_flush, METH_VARARGS, zlib_Decompress_flush__doc__},
+
+static PyObject *
+zlib_Decompress_flush_impl(compobject *self, unsigned int length);
+
+static PyObject *
+zlib_Decompress_flush(compobject *self, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    unsigned int length = DEF_BUF_SIZE;
+
+    if (!PyArg_ParseTuple(args,
+        "|O&:flush",
+        uint_converter, &length))
+        goto exit;
+    return_value = zlib_Decompress_flush_impl(self, length);
+
+exit:
+    return return_value;
+}
+
+PyDoc_STRVAR(zlib_adler32__doc__,
+"adler32($module, data, value=1, /)\n"
+"--\n"
+"\n"
+"Compute an Adler-32 checksum of data.\n"
+"\n"
+"  value\n"
+"    Starting value of the checksum.\n"
+"\n"
+"The returned checksum is an integer.");
+
+#define ZLIB_ADLER32_METHODDEF    \
+    {"adler32", (PyCFunction)zlib_adler32, METH_VARARGS, zlib_adler32__doc__},
+
+static PyObject *
+zlib_adler32_impl(PyModuleDef *module, Py_buffer *data, unsigned int value);
+
+static PyObject *
+zlib_adler32(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer data = {NULL, NULL};
+    unsigned int value = 1;
+
+    if (!PyArg_ParseTuple(args,
+        "y*|I:adler32",
+        &data, &value))
+        goto exit;
+    return_value = zlib_adler32_impl(module, &data, value);
+
+exit:
+    /* Cleanup for data */
+    if (data.obj)
+       PyBuffer_Release(&data);
+
+    return return_value;
+}
+
+PyDoc_STRVAR(zlib_crc32__doc__,
+"crc32($module, data, value=0, /)\n"
+"--\n"
+"\n"
+"Compute a CRC-32 checksum of data.\n"
+"\n"
+"  value\n"
+"    Starting value of the checksum.\n"
+"\n"
+"The returned checksum is an integer.");
+
+#define ZLIB_CRC32_METHODDEF    \
+    {"crc32", (PyCFunction)zlib_crc32, METH_VARARGS, zlib_crc32__doc__},
+
+static PyObject *
+zlib_crc32_impl(PyModuleDef *module, Py_buffer *data, unsigned int value);
+
+static PyObject *
+zlib_crc32(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
+    Py_buffer data = {NULL, NULL};
+    unsigned int value = 0;
+
+    if (!PyArg_ParseTuple(args,
+        "y*|I:crc32",
+        &data, &value))
+        goto exit;
+    return_value = zlib_crc32_impl(module, &data, value);
+
+exit:
+    /* Cleanup for data */
+    if (data.obj)
+       PyBuffer_Release(&data);
+
+    return return_value;
+}
+/*[clinic end generated code: output=bc9473721ca7c962 input=a9049054013a1b77]*/
diff --git a/Modules/cmathmodule.c b/Modules/cmathmodule.c
index 36bf4a1..eb2853c 100644
--- a/Modules/cmathmodule.c
+++ b/Modules/cmathmodule.c
@@ -192,7 +192,7 @@
 PyDoc_STRVAR(c_acosh_doc,
 "acosh(x)\n"
 "\n"
-"Return the hyperbolic arccosine of x.");
+"Return the inverse hyperbolic cosine of x.");
 
 
 static Py_complex
@@ -249,7 +249,7 @@
 PyDoc_STRVAR(c_asinh_doc,
 "asinh(x)\n"
 "\n"
-"Return the hyperbolic arc sine of x.");
+"Return the inverse hyperbolic sine of x.");
 
 
 static Py_complex
@@ -353,7 +353,7 @@
 PyDoc_STRVAR(c_atanh_doc,
 "atanh(x)\n"
 "\n"
-"Return the hyperbolic arc tangent of x.");
+"Return the inverse hyperbolic tangent of x.");
 
 
 static Py_complex
@@ -1060,7 +1060,7 @@
 cmath_isinf(PyObject *self, PyObject *args)
 {
     Py_complex z;
-    if (!PyArg_ParseTuple(args, "D:isnan", &z))
+    if (!PyArg_ParseTuple(args, "D:isinf", &z))
         return NULL;
     return PyBool_FromLong(Py_IS_INFINITY(z.real) ||
                            Py_IS_INFINITY(z.imag));
diff --git a/Modules/expat/xmlparse.c b/Modules/expat/xmlparse.c
index f35aa36..0ac0317 100644
--- a/Modules/expat/xmlparse.c
+++ b/Modules/expat/xmlparse.c
@@ -2,12 +2,6 @@
    See the file COPYING for copying permission.
 */
 
-#include <stddef.h>
-#include <string.h>                     /* memset(), memcpy() */
-#include <assert.h>
-#include <limits.h>                     /* UINT_MAX */
-#include <time.h>                       /* time() */
-
 #define XML_BUILDING_EXPAT 1
 
 #ifdef COMPILED_FROM_DSP
@@ -22,6 +16,12 @@
 #include <expat_config.h>
 #endif /* ndef COMPILED_FROM_DSP */
 
+#include <stddef.h>
+#include <string.h>                     /* memset(), memcpy() */
+#include <assert.h>
+#include <limits.h>                     /* UINT_MAX */
+#include <time.h>                       /* time() */
+
 #include "ascii.h"
 #include "expat.h"
 
diff --git a/Modules/expat/xmlrole.c b/Modules/expat/xmlrole.c
index 44772e2..9a8f85d 100644
--- a/Modules/expat/xmlrole.c
+++ b/Modules/expat/xmlrole.c
@@ -2,8 +2,6 @@
    See the file COPYING for copying permission.
 */
 
-#include <stddef.h>
-
 #ifdef COMPILED_FROM_DSP
 #include "winconfig.h"
 #elif defined(MACOS_CLASSIC)
@@ -18,6 +16,8 @@
 #endif
 #endif /* ndef COMPILED_FROM_DSP */
 
+#include <stddef.h>
+
 #include "expat_external.h"
 #include "internal.h"
 #include "xmlrole.h"
diff --git a/Modules/expat/xmltok.c b/Modules/expat/xmltok.c
index b9cd7a4..fd6bf7a 100644
--- a/Modules/expat/xmltok.c
+++ b/Modules/expat/xmltok.c
@@ -2,8 +2,6 @@
    See the file COPYING for copying permission.
 */
 
-#include <stddef.h>
-
 #ifdef COMPILED_FROM_DSP
 #include "winconfig.h"
 #elif defined(MACOS_CLASSIC)
@@ -18,6 +16,8 @@
 #endif
 #endif /* ndef COMPILED_FROM_DSP */
 
+#include <stddef.h>
+
 #include "expat_external.h"
 #include "internal.h"
 #include "xmltok.h"
diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c
index 680f630..c17ffd8 100644
--- a/Modules/faulthandler.c
+++ b/Modules/faulthandler.c
@@ -22,7 +22,14 @@
 #  define FAULTHANDLER_USER
 #endif
 
-#define PUTS(fd, str) write(fd, str, strlen(str))
+/* cast size_t to int because write() takes an int on Windows
+   (anyway, the length is smaller than 30 characters) */
+#define PUTS(fd, str) write(fd, str, (int)strlen(str))
+
+_Py_IDENTIFIER(enable);
+_Py_IDENTIFIER(fileno);
+_Py_IDENTIFIER(flush);
+_Py_IDENTIFIER(stderr);
 
 #ifdef HAVE_SIGACTION
 typedef struct sigaction _Py_sighandler_t;
@@ -79,9 +86,6 @@
 static user_signal_t *user_signals;
 
 /* the following macros come from Python: Modules/signalmodule.c */
-#if defined(PYOS_OS2) && !defined(PYCC_GCC)
-#define NSIG 12
-#endif
 #ifndef NSIG
 # if defined(_NSIG)
 #  define NSIG _NSIG            /* For BSD/SysV */
@@ -131,17 +135,19 @@
 faulthandler_get_fileno(PyObject *file, int *p_fd)
 {
     PyObject *result;
-    _Py_IDENTIFIER(fileno);
-    _Py_IDENTIFIER(flush);
     long fd_long;
     int fd;
 
     if (file == NULL || file == Py_None) {
-        file = PySys_GetObject("stderr");
+        file = _PySys_GetObjectId(&PyId_stderr);
         if (file == NULL) {
             PyErr_SetString(PyExc_RuntimeError, "unable to get sys.stderr");
             return NULL;
         }
+        if (file == Py_None) {
+            PyErr_SetString(PyExc_RuntimeError, "sys.stderr is None");
+            return NULL;
+        }
     }
 
     result = _PyObject_CallMethodId(file, &PyId_fileno, "");
@@ -448,7 +454,7 @@
         /* get the thread holding the GIL, NULL if no thread hold the GIL */
         current = _Py_atomic_load_relaxed(&_PyThreadState_Current);
 
-        write(thread.fd, thread.header, thread.header_len);
+        write(thread.fd, thread.header, (int)thread.header_len);
 
         errmsg = _Py_DumpTracebackThreads(thread.fd, thread.interp, current);
         ok = (errmsg == NULL);
@@ -476,7 +482,7 @@
 
     Py_CLEAR(thread.file);
     if (thread.header) {
-        free(thread.header);
+        PyMem_Free(thread.header);
         thread.header = NULL;
     }
 }
@@ -505,7 +511,7 @@
                       "Timeout (%lu:%02lu:%02lu)!\n",
                       hour, min, sec);
 
-    return strdup(buffer);
+    return _PyMem_Strdup(buffer);
 }
 
 static PyObject*
@@ -571,7 +577,7 @@
     if (PyThread_start_new_thread(faulthandler_thread, NULL) == -1) {
         PyThread_release_lock(thread.running);
         Py_CLEAR(thread.file);
-        free(header);
+        PyMem_Free(header);
         thread.header = NULL;
         PyErr_SetString(PyExc_RuntimeError,
                         "unable to start watchdog thread");
@@ -730,9 +736,10 @@
         return NULL;
 
     if (user_signals == NULL) {
-        user_signals = calloc(NSIG, sizeof(user_signal_t));
+        user_signals = PyMem_Malloc(NSIG * sizeof(user_signal_t));
         if (user_signals == NULL)
             return PyErr_NoMemory();
+        memset(user_signals, 0, NSIG * sizeof(user_signal_t));
     }
     user = &user_signals[signum];
 
@@ -802,23 +809,15 @@
 {
     volatile int *x;
     volatile int y;
-    int release_gil = 0;
-    if (!PyArg_ParseTuple(args, "|i:_read_null", &release_gil))
-        return NULL;
 
     x = NULL;
-    if (release_gil) {
-        Py_BEGIN_ALLOW_THREADS
-        y = *x;
-        Py_END_ALLOW_THREADS
-    } else
-        y = *x;
+    y = *x;
     return PyLong_FromLong(y);
 
 }
 
-static PyObject *
-faulthandler_sigsegv(PyObject *self, PyObject *args)
+static void
+faulthandler_raise_sigsegv(void)
 {
 #if defined(MS_WINDOWS)
     /* For SIGSEGV, faulthandler_fatal_error() restores the previous signal
@@ -837,6 +836,22 @@
 #else
     raise(SIGSEGV);
 #endif
+}
+
+static PyObject *
+faulthandler_sigsegv(PyObject *self, PyObject *args)
+{
+    int release_gil = 0;
+    if (!PyArg_ParseTuple(args, "|i:_read_null", &release_gil))
+        return NULL;
+
+    if (release_gil) {
+        Py_BEGIN_ALLOW_THREADS
+        faulthandler_raise_sigsegv();
+        Py_END_ALLOW_THREADS
+    } else {
+        faulthandler_raise_sigsegv();
+    }
     Py_RETURN_NONE;
 }
 
@@ -996,12 +1011,12 @@
                 "'signum' registered by register()")},
 #endif
 
-    {"_read_null", faulthandler_read_null, METH_VARARGS,
-     PyDoc_STR("_read_null(release_gil=False): read from NULL, raise "
+    {"_read_null", faulthandler_read_null, METH_NOARGS,
+     PyDoc_STR("_read_null(): read from NULL, raise "
                "a SIGSEGV or SIGBUS signal depending on the platform")},
     {"_sigsegv", faulthandler_sigsegv, METH_VARARGS,
-     PyDoc_STR("_sigsegv(): raise a SIGSEGV signal")},
-    {"_sigabrt", faulthandler_sigabrt, METH_VARARGS,
+     PyDoc_STR("_sigsegv(release_gil=False): raise a SIGSEGV signal")},
+    {"_sigabrt", faulthandler_sigabrt, METH_NOARGS,
      PyDoc_STR("_sigabrt(): raise a SIGABRT signal")},
     {"_sigfpe", (PyCFunction)faulthandler_sigfpe, METH_NOARGS,
      PyDoc_STR("_sigfpe(): raise a SIGFPE signal")},
@@ -1047,9 +1062,11 @@
 faulthandler_env_options(void)
 {
     PyObject *xoptions, *key, *module, *res;
-    _Py_IDENTIFIER(enable);
+    char *p;
 
-    if (!Py_GETENV("PYTHONFAULTHANDLER")) {
+    if (!((p = Py_GETENV("PYTHONFAULTHANDLER")) && *p != '\0')) {
+        /* PYTHONFAULTHANDLER environment variable is missing
+           or an empty string */
         int has_key;
 
         xoptions = PySys_GetXOptions();
@@ -1137,7 +1154,7 @@
     if (user_signals != NULL) {
         for (signum=0; signum < NSIG; signum++)
             faulthandler_unregister(&user_signals[signum], signum);
-        free(user_signals);
+        PyMem_Free(user_signals);
         user_signals = NULL;
     }
 #endif
diff --git a/Modules/fcntlmodule.c b/Modules/fcntlmodule.c
index 6769098..9325940 100644
--- a/Modules/fcntlmodule.c
+++ b/Modules/fcntlmodule.c
@@ -34,7 +34,7 @@
 {
     int fd;
     int code;
-    long arg;
+    int arg;
     int ret;
     char *str;
     Py_ssize_t len;
@@ -61,7 +61,7 @@
     PyErr_Clear();
     arg = 0;
     if (!PyArg_ParseTuple(args,
-         "O&i|l;fcntl requires a file or file descriptor,"
+         "O&i|I;fcntl requires a file or file descriptor,"
          " an integer and optionally a third integer or a string",
                           conv_descriptor, &fd, &code, &arg)) {
       return NULL;
@@ -208,11 +208,7 @@
       return NULL;
     }
     Py_BEGIN_ALLOW_THREADS
-#ifdef __VMS
-    ret = ioctl(fd, code, (void *)arg);
-#else
     ret = ioctl(fd, code, arg);
-#endif
     Py_END_ALLOW_THREADS
     if (ret < 0) {
         PyErr_SetFromErrno(PyExc_IOError);
@@ -327,11 +323,6 @@
                           &lenobj, &startobj, &whence))
         return NULL;
 
-#if defined(PYOS_OS2) && defined(PYCC_GCC)
-    PyErr_SetString(PyExc_NotImplementedError,
-                    "lockf not supported on OS/2 (EMX)");
-    return NULL;
-#else
 #ifndef LOCK_SH
 #define LOCK_SH         1       /* shared lock */
 #define LOCK_EX         2       /* exclusive lock */
@@ -385,7 +376,6 @@
     }
     Py_INCREF(Py_None);
     return Py_None;
-#endif  /* defined(PYOS_OS2) && defined(PYCC_GCC) */
 }
 
 PyDoc_STRVAR(lockf_doc,
@@ -432,188 +422,179 @@
 
 /* Module initialisation */
 
-static int
-ins(PyObject* d, char* symbol, long value)
-{
-    PyObject* v = PyLong_FromLong(value);
-    if (!v || PyDict_SetItemString(d, symbol, v) < 0)
-        return -1;
-
-    Py_DECREF(v);
-    return 0;
-}
-
-#define INS(x) if (ins(d, #x, (long)x)) return -1
 
 static int
-all_ins(PyObject* d)
+all_ins(PyObject* m)
 {
-    if (ins(d, "LOCK_SH", (long)LOCK_SH)) return -1;
-    if (ins(d, "LOCK_EX", (long)LOCK_EX)) return -1;
-    if (ins(d, "LOCK_NB", (long)LOCK_NB)) return -1;
-    if (ins(d, "LOCK_UN", (long)LOCK_UN)) return -1;
+    if (PyModule_AddIntMacro(m, LOCK_SH)) return -1;
+    if (PyModule_AddIntMacro(m, LOCK_EX)) return -1;
+    if (PyModule_AddIntMacro(m, LOCK_NB)) return -1;
+    if (PyModule_AddIntMacro(m, LOCK_UN)) return -1;
 /* GNU extensions, as of glibc 2.2.4 */
 #ifdef LOCK_MAND
-    if (ins(d, "LOCK_MAND", (long)LOCK_MAND)) return -1;
+    if (PyModule_AddIntMacro(m, LOCK_MAND)) return -1;
 #endif
 #ifdef LOCK_READ
-    if (ins(d, "LOCK_READ", (long)LOCK_READ)) return -1;
+    if (PyModule_AddIntMacro(m, LOCK_READ)) return -1;
 #endif
 #ifdef LOCK_WRITE
-    if (ins(d, "LOCK_WRITE", (long)LOCK_WRITE)) return -1;
+    if (PyModule_AddIntMacro(m, LOCK_WRITE)) return -1;
 #endif
 #ifdef LOCK_RW
-    if (ins(d, "LOCK_RW", (long)LOCK_RW)) return -1;
+    if (PyModule_AddIntMacro(m, LOCK_RW)) return -1;
 #endif
 
 #ifdef F_DUPFD
-    if (ins(d, "F_DUPFD", (long)F_DUPFD)) return -1;
+    if (PyModule_AddIntMacro(m, F_DUPFD)) return -1;
+#endif
+#ifdef F_DUPFD_CLOEXEC
+    if (PyModule_AddIntMacro(m, F_DUPFD_CLOEXEC)) return -1;
 #endif
 #ifdef F_GETFD
-    if (ins(d, "F_GETFD", (long)F_GETFD)) return -1;
+    if (PyModule_AddIntMacro(m, F_GETFD)) return -1;
 #endif
 #ifdef F_SETFD
-    if (ins(d, "F_SETFD", (long)F_SETFD)) return -1;
+    if (PyModule_AddIntMacro(m, F_SETFD)) return -1;
 #endif
 #ifdef F_GETFL
-    if (ins(d, "F_GETFL", (long)F_GETFL)) return -1;
+    if (PyModule_AddIntMacro(m, F_GETFL)) return -1;
 #endif
 #ifdef F_SETFL
-    if (ins(d, "F_SETFL", (long)F_SETFL)) return -1;
+    if (PyModule_AddIntMacro(m, F_SETFL)) return -1;
 #endif
 #ifdef F_GETLK
-    if (ins(d, "F_GETLK", (long)F_GETLK)) return -1;
+    if (PyModule_AddIntMacro(m, F_GETLK)) return -1;
 #endif
 #ifdef F_SETLK
-    if (ins(d, "F_SETLK", (long)F_SETLK)) return -1;
+    if (PyModule_AddIntMacro(m, F_SETLK)) return -1;
 #endif
 #ifdef F_SETLKW
-    if (ins(d, "F_SETLKW", (long)F_SETLKW)) return -1;
+    if (PyModule_AddIntMacro(m, F_SETLKW)) return -1;
 #endif
 #ifdef F_GETOWN
-    if (ins(d, "F_GETOWN", (long)F_GETOWN)) return -1;
+    if (PyModule_AddIntMacro(m, F_GETOWN)) return -1;
 #endif
 #ifdef F_SETOWN
-    if (ins(d, "F_SETOWN", (long)F_SETOWN)) return -1;
+    if (PyModule_AddIntMacro(m, F_SETOWN)) return -1;
 #endif
 #ifdef F_GETSIG
-    if (ins(d, "F_GETSIG", (long)F_GETSIG)) return -1;
+    if (PyModule_AddIntMacro(m, F_GETSIG)) return -1;
 #endif
 #ifdef F_SETSIG
-    if (ins(d, "F_SETSIG", (long)F_SETSIG)) return -1;
+    if (PyModule_AddIntMacro(m, F_SETSIG)) return -1;
 #endif
 #ifdef F_RDLCK
-    if (ins(d, "F_RDLCK", (long)F_RDLCK)) return -1;
+    if (PyModule_AddIntMacro(m, F_RDLCK)) return -1;
 #endif
 #ifdef F_WRLCK
-    if (ins(d, "F_WRLCK", (long)F_WRLCK)) return -1;
+    if (PyModule_AddIntMacro(m, F_WRLCK)) return -1;
 #endif
 #ifdef F_UNLCK
-    if (ins(d, "F_UNLCK", (long)F_UNLCK)) return -1;
+    if (PyModule_AddIntMacro(m, F_UNLCK)) return -1;
 #endif
 /* LFS constants */
 #ifdef F_GETLK64
-    if (ins(d, "F_GETLK64", (long)F_GETLK64)) return -1;
+    if (PyModule_AddIntMacro(m, F_GETLK64)) return -1;
 #endif
 #ifdef F_SETLK64
-    if (ins(d, "F_SETLK64", (long)F_SETLK64)) return -1;
+    if (PyModule_AddIntMacro(m, F_SETLK64)) return -1;
 #endif
 #ifdef F_SETLKW64
-    if (ins(d, "F_SETLKW64", (long)F_SETLKW64)) return -1;
+    if (PyModule_AddIntMacro(m, F_SETLKW64)) return -1;
 #endif
 /* GNU extensions, as of glibc 2.2.4. */
 #ifdef FASYNC
-    if (ins(d, "FASYNC", (long)FASYNC)) return -1;
+    if (PyModule_AddIntMacro(m, FASYNC)) return -1;
 #endif
 #ifdef F_SETLEASE
-    if (ins(d, "F_SETLEASE", (long)F_SETLEASE)) return -1;
+    if (PyModule_AddIntMacro(m, F_SETLEASE)) return -1;
 #endif
 #ifdef F_GETLEASE
-    if (ins(d, "F_GETLEASE", (long)F_GETLEASE)) return -1;
+    if (PyModule_AddIntMacro(m, F_GETLEASE)) return -1;
 #endif
 #ifdef F_NOTIFY
-    if (ins(d, "F_NOTIFY", (long)F_NOTIFY)) return -1;
+    if (PyModule_AddIntMacro(m, F_NOTIFY)) return -1;
 #endif
 /* Old BSD flock(). */
 #ifdef F_EXLCK
-    if (ins(d, "F_EXLCK", (long)F_EXLCK)) return -1;
+    if (PyModule_AddIntMacro(m, F_EXLCK)) return -1;
 #endif
 #ifdef F_SHLCK
-    if (ins(d, "F_SHLCK", (long)F_SHLCK)) return -1;
+    if (PyModule_AddIntMacro(m, F_SHLCK)) return -1;
 #endif
 
 /* OS X specifics */
 #ifdef F_FULLFSYNC
-    if (ins(d, "F_FULLFSYNC", (long)F_FULLFSYNC)) return -1;
+    if (PyModule_AddIntMacro(m, F_FULLFSYNC)) return -1;
 #endif
 #ifdef F_NOCACHE
-    if (ins(d, "F_NOCACHE", (long)F_NOCACHE)) return -1;
+    if (PyModule_AddIntMacro(m, F_NOCACHE)) return -1;
 #endif
 
 /* For F_{GET|SET}FL */
 #ifdef FD_CLOEXEC
-    if (ins(d, "FD_CLOEXEC", (long)FD_CLOEXEC)) return -1;
+    if (PyModule_AddIntMacro(m, FD_CLOEXEC)) return -1;
 #endif
 
 /* For F_NOTIFY */
 #ifdef DN_ACCESS
-    if (ins(d, "DN_ACCESS", (long)DN_ACCESS)) return -1;
+    if (PyModule_AddIntMacro(m, DN_ACCESS)) return -1;
 #endif
 #ifdef DN_MODIFY
-    if (ins(d, "DN_MODIFY", (long)DN_MODIFY)) return -1;
+    if (PyModule_AddIntMacro(m, DN_MODIFY)) return -1;
 #endif
 #ifdef DN_CREATE
-    if (ins(d, "DN_CREATE", (long)DN_CREATE)) return -1;
+    if (PyModule_AddIntMacro(m, DN_CREATE)) return -1;
 #endif
 #ifdef DN_DELETE
-    if (ins(d, "DN_DELETE", (long)DN_DELETE)) return -1;
+    if (PyModule_AddIntMacro(m, DN_DELETE)) return -1;
 #endif
 #ifdef DN_RENAME
-    if (ins(d, "DN_RENAME", (long)DN_RENAME)) return -1;
+    if (PyModule_AddIntMacro(m, DN_RENAME)) return -1;
 #endif
 #ifdef DN_ATTRIB
-    if (ins(d, "DN_ATTRIB", (long)DN_ATTRIB)) return -1;
+    if (PyModule_AddIntMacro(m, DN_ATTRIB)) return -1;
 #endif
 #ifdef DN_MULTISHOT
-    if (ins(d, "DN_MULTISHOT", (long)DN_MULTISHOT)) return -1;
+    if (PyModule_AddIntMacro(m, DN_MULTISHOT)) return -1;
 #endif
 
 #ifdef HAVE_STROPTS_H
     /* Unix 98 guarantees that these are in stropts.h. */
-    INS(I_PUSH);
-    INS(I_POP);
-    INS(I_LOOK);
-    INS(I_FLUSH);
-    INS(I_FLUSHBAND);
-    INS(I_SETSIG);
-    INS(I_GETSIG);
-    INS(I_FIND);
-    INS(I_PEEK);
-    INS(I_SRDOPT);
-    INS(I_GRDOPT);
-    INS(I_NREAD);
-    INS(I_FDINSERT);
-    INS(I_STR);
-    INS(I_SWROPT);
+    if (PyModule_AddIntMacro(m, I_PUSH)) return -1;
+    if (PyModule_AddIntMacro(m, I_POP)) return -1;
+    if (PyModule_AddIntMacro(m, I_LOOK)) return -1;
+    if (PyModule_AddIntMacro(m, I_FLUSH)) return -1;
+    if (PyModule_AddIntMacro(m, I_FLUSHBAND)) return -1;
+    if (PyModule_AddIntMacro(m, I_SETSIG)) return -1;
+    if (PyModule_AddIntMacro(m, I_GETSIG)) return -1;
+    if (PyModule_AddIntMacro(m, I_FIND)) return -1;
+    if (PyModule_AddIntMacro(m, I_PEEK)) return -1;
+    if (PyModule_AddIntMacro(m, I_SRDOPT)) return -1;
+    if (PyModule_AddIntMacro(m, I_GRDOPT)) return -1;
+    if (PyModule_AddIntMacro(m, I_NREAD)) return -1;
+    if (PyModule_AddIntMacro(m, I_FDINSERT)) return -1;
+    if (PyModule_AddIntMacro(m, I_STR)) return -1;
+    if (PyModule_AddIntMacro(m, I_SWROPT)) return -1;
 #ifdef I_GWROPT
     /* despite the comment above, old-ish glibcs miss a couple... */
-    INS(I_GWROPT);
+    if (PyModule_AddIntMacro(m, I_GWROPT)) return -1;
 #endif
-    INS(I_SENDFD);
-    INS(I_RECVFD);
-    INS(I_LIST);
-    INS(I_ATMARK);
-    INS(I_CKBAND);
-    INS(I_GETBAND);
-    INS(I_CANPUT);
-    INS(I_SETCLTIME);
+    if (PyModule_AddIntMacro(m, I_SENDFD)) return -1;
+    if (PyModule_AddIntMacro(m, I_RECVFD)) return -1;
+    if (PyModule_AddIntMacro(m, I_LIST)) return -1;
+    if (PyModule_AddIntMacro(m, I_ATMARK)) return -1;
+    if (PyModule_AddIntMacro(m, I_CKBAND)) return -1;
+    if (PyModule_AddIntMacro(m, I_GETBAND)) return -1;
+    if (PyModule_AddIntMacro(m, I_CANPUT)) return -1;
+    if (PyModule_AddIntMacro(m, I_SETCLTIME)) return -1;
 #ifdef I_GETCLTIME
-    INS(I_GETCLTIME);
+    if (PyModule_AddIntMacro(m, I_GETCLTIME)) return -1;
 #endif
-    INS(I_LINK);
-    INS(I_UNLINK);
-    INS(I_PLINK);
-    INS(I_PUNLINK);
+    if (PyModule_AddIntMacro(m, I_LINK)) return -1;
+    if (PyModule_AddIntMacro(m, I_UNLINK)) return -1;
+    if (PyModule_AddIntMacro(m, I_PLINK)) return -1;
+    if (PyModule_AddIntMacro(m, I_PUNLINK)) return -1;
 #endif
 
     return 0;
@@ -635,7 +616,7 @@
 PyMODINIT_FUNC
 PyInit_fcntl(void)
 {
-    PyObject *m, *d;
+    PyObject *m;
 
     /* Create the module and add the functions and documentation */
     m = PyModule_Create(&fcntlmodule);
@@ -643,7 +624,8 @@
         return NULL;
 
     /* Add some symbolic constants to the module */
-    d = PyModule_GetDict(m);
-    all_ins(d);
+    if (all_ins(m) < 0)
+        return NULL;
+
     return m;
 }
diff --git a/Modules/fpectlmodule.c b/Modules/fpectlmodule.c
index 6af2f82..052b834 100644
--- a/Modules/fpectlmodule.c
+++ b/Modules/fpectlmodule.c
@@ -70,10 +70,6 @@
 
 #if defined(__FreeBSD__)
 #  include <ieeefp.h>
-#elif defined(__VMS)
-#define __NEW_STARLET
-#include <starlet.h>
-#include <ieeedef.h>
 #endif
 
 #ifndef WANT_SIGFPE_HANDLER
@@ -182,23 +178,6 @@
     ieee_set_fp_control(fp_control);
     PyOS_setsig(SIGFPE, handler);
 
-/*-- DEC ALPHA VMS --------------------------------------------------------*/
-#elif defined(__ALPHA) && defined(__VMS)
-        IEEE clrmsk;
-        IEEE setmsk;
-        clrmsk.ieee$q_flags =
-                IEEE$M_TRAP_ENABLE_UNF |  IEEE$M_TRAP_ENABLE_INE |
-                 IEEE$M_MAP_UMZ;
-        setmsk.ieee$q_flags =
-                IEEE$M_TRAP_ENABLE_INV | IEEE$M_TRAP_ENABLE_DZE |
-                IEEE$M_TRAP_ENABLE_OVF;
-        sys$ieee_set_fp_control(&clrmsk, &setmsk, 0);
-        PyOS_setsig(SIGFPE, handler);
-
-/*-- HP IA64 VMS --------------------------------------------------------*/
-#elif defined(__ia64) && defined(__VMS)
-    PyOS_setsig(SIGFPE, handler);
-
 /*-- Cray Unicos ----------------------------------------------------------*/
 #elif defined(cray)
     /* UNICOS delivers SIGFPE by default, but no matherr */
@@ -251,14 +230,6 @@
 #ifdef __FreeBSD__
     fpresetsticky(fpgetsticky());
     fpsetmask(0);
-#elif defined(__VMS)
-        IEEE clrmsk;
-         clrmsk.ieee$q_flags =
-                IEEE$M_TRAP_ENABLE_UNF |  IEEE$M_TRAP_ENABLE_INE |
-                IEEE$M_MAP_UMZ | IEEE$M_TRAP_ENABLE_INV |
-                IEEE$M_TRAP_ENABLE_DZE | IEEE$M_TRAP_ENABLE_OVF |
-                IEEE$M_INHERIT;
-        sys$ieee_set_fp_control(&clrmsk, 0, 0);
 #else
     fputs("Operation not implemented\n", stderr);
 #endif
diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c
index c66dd38..9bb3666 100644
--- a/Modules/gcmodule.c
+++ b/Modules/gcmodule.c
@@ -168,6 +168,18 @@
 static int debug;
 static PyObject *tmod = NULL;
 
+/* Running stats per generation */
+struct gc_generation_stats {
+    /* total number of collections */
+    Py_ssize_t collections;
+    /* total number of collected objects */
+    Py_ssize_t collected;
+    /* total number of uncollectable objects (put into gc.garbage) */
+    Py_ssize_t uncollectable;
+};
+
+static struct gc_generation_stats generation_stats[NUM_GENERATIONS];
+
 /*--------------------------------------------------------------------------
 gc_refs values.
 
@@ -211,10 +223,10 @@
 #define GC_REACHABLE                    _PyGC_REFS_REACHABLE
 #define GC_TENTATIVELY_UNREACHABLE      _PyGC_REFS_TENTATIVELY_UNREACHABLE
 
-#define IS_TRACKED(o) ((AS_GC(o))->gc.gc_refs != GC_UNTRACKED)
-#define IS_REACHABLE(o) ((AS_GC(o))->gc.gc_refs == GC_REACHABLE)
+#define IS_TRACKED(o) (_PyGC_REFS(o) != GC_UNTRACKED)
+#define IS_REACHABLE(o) (_PyGC_REFS(o) == GC_REACHABLE)
 #define IS_TENTATIVELY_UNREACHABLE(o) ( \
-    (AS_GC(o))->gc.gc_refs == GC_TENTATIVELY_UNREACHABLE)
+    _PyGC_REFS(o) == GC_TENTATIVELY_UNREACHABLE)
 
 /*** list functions ***/
 
@@ -329,8 +341,8 @@
 {
     PyGC_Head *gc = containers->gc.gc_next;
     for (; gc != containers; gc = gc->gc.gc_next) {
-        assert(gc->gc.gc_refs == GC_REACHABLE);
-        gc->gc.gc_refs = Py_REFCNT(FROM_GC(gc));
+        assert(_PyGCHead_REFS(gc) == GC_REACHABLE);
+        _PyGCHead_SET_REFS(gc, Py_REFCNT(FROM_GC(gc)));
         /* Python's cyclic gc should never see an incoming refcount
          * of 0:  if something decref'ed to 0, it should have been
          * deallocated immediately at that time.
@@ -349,7 +361,7 @@
          * so serious that maybe this should be a release-build
          * check instead of an assert?
          */
-        assert(gc->gc.gc_refs != 0);
+        assert(_PyGCHead_REFS(gc) != 0);
     }
 }
 
@@ -364,9 +376,9 @@
          * generation being collected, which can be recognized
          * because only they have positive gc_refs.
          */
-        assert(gc->gc.gc_refs != 0); /* else refcount was too small */
-        if (gc->gc.gc_refs > 0)
-            gc->gc.gc_refs--;
+        assert(_PyGCHead_REFS(gc) != 0); /* else refcount was too small */
+        if (_PyGCHead_REFS(gc) > 0)
+            _PyGCHead_DECREF(gc);
     }
     return 0;
 }
@@ -395,7 +407,7 @@
 {
     if (PyObject_IS_GC(op)) {
         PyGC_Head *gc = AS_GC(op);
-        const Py_ssize_t gc_refs = gc->gc.gc_refs;
+        const Py_ssize_t gc_refs = _PyGCHead_REFS(gc);
 
         if (gc_refs == 0) {
             /* This is in move_unreachable's 'young' list, but
@@ -403,7 +415,7 @@
              * we need to do is tell move_unreachable that it's
              * reachable.
              */
-            gc->gc.gc_refs = 1;
+            _PyGCHead_SET_REFS(gc, 1);
         }
         else if (gc_refs == GC_TENTATIVELY_UNREACHABLE) {
             /* This had gc_refs = 0 when move_unreachable got
@@ -413,7 +425,7 @@
              * again.
              */
             gc_list_move(gc, reachable);
-            gc->gc.gc_refs = 1;
+            _PyGCHead_SET_REFS(gc, 1);
         }
         /* Else there's nothing to do.
          * If gc_refs > 0, it must be in move_unreachable's 'young'
@@ -457,7 +469,7 @@
     while (gc != young) {
         PyGC_Head *next;
 
-        if (gc->gc.gc_refs) {
+        if (_PyGCHead_REFS(gc)) {
             /* gc is definitely reachable from outside the
              * original 'young'.  Mark it as such, and traverse
              * its pointers to find any other objects that may
@@ -468,8 +480,8 @@
              */
             PyObject *op = FROM_GC(gc);
             traverseproc traverse = Py_TYPE(op)->tp_traverse;
-            assert(gc->gc.gc_refs > 0);
-            gc->gc.gc_refs = GC_REACHABLE;
+            assert(_PyGCHead_REFS(gc) > 0);
+            _PyGCHead_SET_REFS(gc, GC_REACHABLE);
             (void) traverse(op,
                             (visitproc)visit_reachable,
                             (void *)young);
@@ -488,7 +500,7 @@
              */
             next = gc->gc.gc_next;
             gc_list_move(gc, unreachable);
-            gc->gc.gc_refs = GC_TENTATIVELY_UNREACHABLE;
+            _PyGCHead_SET_REFS(gc, GC_TENTATIVELY_UNREACHABLE);
         }
         gc = next;
     }
@@ -508,22 +520,19 @@
     }
 }
 
-/* Return true if object has a finalization method. */
+/* Return true if object has a pre-PEP 442 finalization method. */
 static int
-has_finalizer(PyObject *op)
+has_legacy_finalizer(PyObject *op)
 {
-    if (PyGen_CheckExact(op))
-        return PyGen_NeedsFinalizing((PyGenObject *)op);
-    else
-        return op->ob_type->tp_del != NULL;
+    return op->ob_type->tp_del != NULL;
 }
 
-/* Move the objects in unreachable with __del__ methods into `finalizers`.
+/* Move the objects in unreachable with tp_del slots into `finalizers`.
  * Objects moved into `finalizers` have gc_refs set to GC_REACHABLE; the
  * objects remaining in unreachable are left at GC_TENTATIVELY_UNREACHABLE.
  */
 static void
-move_finalizers(PyGC_Head *unreachable, PyGC_Head *finalizers)
+move_legacy_finalizers(PyGC_Head *unreachable, PyGC_Head *finalizers)
 {
     PyGC_Head *gc;
     PyGC_Head *next;
@@ -537,14 +546,14 @@
         assert(IS_TENTATIVELY_UNREACHABLE(op));
         next = gc->gc.gc_next;
 
-        if (has_finalizer(op)) {
+        if (has_legacy_finalizer(op)) {
             gc_list_move(gc, finalizers);
-            gc->gc.gc_refs = GC_REACHABLE;
+            _PyGCHead_SET_REFS(gc, GC_REACHABLE);
         }
     }
 }
 
-/* A traversal callback for move_finalizer_reachable. */
+/* A traversal callback for move_legacy_finalizer_reachable. */
 static int
 visit_move(PyObject *op, PyGC_Head *tolist)
 {
@@ -552,7 +561,7 @@
         if (IS_TENTATIVELY_UNREACHABLE(op)) {
             PyGC_Head *gc = AS_GC(op);
             gc_list_move(gc, tolist);
-            gc->gc.gc_refs = GC_REACHABLE;
+            _PyGCHead_SET_REFS(gc, GC_REACHABLE);
         }
     }
     return 0;
@@ -562,7 +571,7 @@
  * into finalizers set.
  */
 static void
-move_finalizer_reachable(PyGC_Head *finalizers)
+move_legacy_finalizer_reachable(PyGC_Head *finalizers)
 {
     traverseproc traverse;
     PyGC_Head *gc = finalizers->gc.gc_next;
@@ -735,7 +744,7 @@
                        msg, Py_TYPE(op)->tp_name, op);
 }
 
-/* Handle uncollectable garbage (cycles with finalizers, and stuff reachable
+/* Handle uncollectable garbage (cycles with tp_del slots, and stuff reachable
  * only from such cycles).
  * If DEBUG_SAVEALL, all objects in finalizers are appended to the module
  * garbage list (a Python list), else only the objects in finalizers with
@@ -745,7 +754,7 @@
  * The finalizers list is made empty on a successful return.
  */
 static int
-handle_finalizers(PyGC_Head *finalizers, PyGC_Head *old)
+handle_legacy_finalizers(PyGC_Head *finalizers, PyGC_Head *old)
 {
     PyGC_Head *gc = finalizers->gc.gc_next;
 
@@ -757,7 +766,7 @@
     for (; gc != finalizers; gc = gc->gc.gc_next) {
         PyObject *op = FROM_GC(gc);
 
-        if ((debug & DEBUG_SAVEALL) || has_finalizer(op)) {
+        if ((debug & DEBUG_SAVEALL) || has_legacy_finalizer(op)) {
             if (PyList_Append(garbage, op) < 0)
                 return -1;
         }
@@ -767,6 +776,74 @@
     return 0;
 }
 
+/* Run first-time finalizers (if any) on all the objects in collectable.
+ * Note that this may remove some (or even all) of the objects from the
+ * list, due to refcounts falling to 0.
+ */
+static void
+finalize_garbage(PyGC_Head *collectable)
+{
+    destructor finalize;
+    PyGC_Head seen;
+
+    /* While we're going through the loop, `finalize(op)` may cause op, or
+     * other objects, to be reclaimed via refcounts falling to zero.  So
+     * there's little we can rely on about the structure of the input
+     * `collectable` list across iterations.  For safety, we always take the
+     * first object in that list and move it to a temporary `seen` list.
+     * If objects vanish from the `collectable` and `seen` lists we don't
+     * care.
+     */
+    gc_list_init(&seen);
+
+    while (!gc_list_is_empty(collectable)) {
+        PyGC_Head *gc = collectable->gc.gc_next;
+        PyObject *op = FROM_GC(gc);
+        gc_list_move(gc, &seen);
+        if (!_PyGCHead_FINALIZED(gc) &&
+                PyType_HasFeature(Py_TYPE(op), Py_TPFLAGS_HAVE_FINALIZE) &&
+                (finalize = Py_TYPE(op)->tp_finalize) != NULL) {
+            _PyGCHead_SET_FINALIZED(gc, 1);
+            Py_INCREF(op);
+            finalize(op);
+            Py_DECREF(op);
+        }
+    }
+    gc_list_merge(&seen, collectable);
+}
+
+/* Walk the collectable list and check that they are really unreachable
+   from the outside (some objects could have been resurrected by a
+   finalizer). */
+static int
+check_garbage(PyGC_Head *collectable)
+{
+    PyGC_Head *gc;
+    for (gc = collectable->gc.gc_next; gc != collectable;
+         gc = gc->gc.gc_next) {
+        _PyGCHead_SET_REFS(gc, Py_REFCNT(FROM_GC(gc)));
+        assert(_PyGCHead_REFS(gc) != 0);
+    }
+    subtract_refs(collectable);
+    for (gc = collectable->gc.gc_next; gc != collectable;
+         gc = gc->gc.gc_next) {
+        assert(_PyGCHead_REFS(gc) >= 0);
+        if (_PyGCHead_REFS(gc) != 0)
+            return -1;
+    }
+    return 0;
+}
+
+static void
+revive_garbage(PyGC_Head *collectable)
+{
+    PyGC_Head *gc;
+    for (gc = collectable->gc.gc_next; gc != collectable;
+         gc = gc->gc.gc_next) {
+        _PyGCHead_SET_REFS(gc, GC_REACHABLE);
+    }
+}
+
 /* Break reference cycles by clearing the containers involved.  This is
  * tricky business as the lists can be changing and we don't know which
  * objects may be freed.  It is possible I screwed something up here.
@@ -780,7 +857,6 @@
         PyGC_Head *gc = collectable->gc.gc_next;
         PyObject *op = FROM_GC(gc);
 
-        assert(IS_TENTATIVELY_UNREACHABLE(op));
         if (debug & DEBUG_SAVEALL) {
             PyList_Append(garbage, op);
         }
@@ -794,7 +870,7 @@
         if (collectable->gc.gc_next == gc) {
             /* object is still alive, move it, it may die later */
             gc_list_move(gc, old);
-            gc->gc.gc_refs = GC_REACHABLE;
+            _PyGCHead_SET_REFS(gc, GC_REACHABLE);
         }
     }
 }
@@ -841,7 +917,8 @@
 /* This is the main function.  Read this to understand how the
  * collection process works. */
 static Py_ssize_t
-collect(int generation, Py_ssize_t *n_collected, Py_ssize_t *n_uncollectable)
+collect(int generation, Py_ssize_t *n_collected, Py_ssize_t *n_uncollectable,
+        int nofail)
 {
     int i;
     Py_ssize_t m = 0; /* # objects collected */
@@ -852,6 +929,7 @@
     PyGC_Head finalizers;  /* objects with, & reachable from, __del__ */
     PyGC_Head *gc;
     double t1 = 0.0;
+    struct gc_generation_stats *stats = &generation_stats[generation];
 
     if (debug & DEBUG_STATS) {
         PySys_WriteStderr("gc: collecting generation %d...\n",
@@ -915,19 +993,15 @@
     }
 
     /* All objects in unreachable are trash, but objects reachable from
-     * finalizers can't safely be deleted.  Python programmers should take
-     * care not to create such things.  For Python, finalizers means
-     * instance objects with __del__ methods.  Weakrefs with callbacks
-     * can also call arbitrary Python code but they will be dealt with by
-     * handle_weakrefs().
+     * legacy finalizers (e.g. tp_del) can't safely be deleted.
      */
     gc_list_init(&finalizers);
-    move_finalizers(&unreachable, &finalizers);
-    /* finalizers contains the unreachable objects with a finalizer;
+    move_legacy_finalizers(&unreachable, &finalizers);
+    /* finalizers contains the unreachable objects with a legacy finalizer;
      * unreachable objects reachable *from* those are also uncollectable,
      * and we move those into the finalizers list too.
      */
-    move_finalizer_reachable(&finalizers);
+    move_legacy_finalizer_reachable(&finalizers);
 
     /* Collect statistics on collectable objects found and print
      * debugging information.
@@ -943,11 +1017,20 @@
     /* Clear weakrefs and invoke callbacks as necessary. */
     m += handle_weakrefs(&unreachable, old);
 
-    /* Call tp_clear on objects in the unreachable set.  This will cause
-     * the reference cycles to be broken.  It may also cause some objects
-     * in finalizers to be freed.
-     */
-    delete_garbage(&unreachable, old);
+    /* Call tp_finalize on objects which have one. */
+    finalize_garbage(&unreachable);
+
+    if (check_garbage(&unreachable)) {
+        revive_garbage(&unreachable);
+        gc_list_merge(&unreachable, old);
+    }
+    else {
+        /* Call tp_clear on objects in the unreachable set.  This will cause
+         * the reference cycles to be broken.  It may also cause some objects
+         * in finalizers to be freed.
+         */
+        delete_garbage(&unreachable, old);
+    }
 
     /* Collect statistics on uncollectable objects found and print
      * debugging information. */
@@ -978,7 +1061,7 @@
      * reachable list of garbage.  The programmer has to deal with
      * this if they insist on creating this type of structure.
      */
-    (void)handle_finalizers(&finalizers, old);
+    (void)handle_legacy_finalizers(&finalizers, old);
 
     /* Clear free list only during the collection of the highest
      * generation */
@@ -987,16 +1070,25 @@
     }
 
     if (PyErr_Occurred()) {
-        if (gc_str == NULL)
-            gc_str = PyUnicode_FromString("garbage collection");
-        PyErr_WriteUnraisable(gc_str);
-        Py_FatalError("unexpected exception during garbage collection");
+        if (nofail) {
+            PyErr_Clear();
+        }
+        else {
+            if (gc_str == NULL)
+                gc_str = PyUnicode_FromString("garbage collection");
+            PyErr_WriteUnraisable(gc_str);
+            Py_FatalError("unexpected exception during garbage collection");
+        }
     }
 
+    /* Update stats */
     if (n_collected)
         *n_collected = m;
     if (n_uncollectable)
         *n_uncollectable = n;
+    stats->collections++;
+    stats->collected += m;
+    stats->uncollectable += n;
     return n+m;
 }
 
@@ -1045,7 +1137,7 @@
 {
     Py_ssize_t result, collected, uncollectable;
     invoke_gc_callback("start", generation, 0, 0);
-    result = collect(generation, &collected, &uncollectable);
+    result = collect(generation, &collected, &uncollectable, 0);
     invoke_gc_callback("stop", generation, collected, uncollectable);
     return result;
 }
@@ -1343,6 +1435,52 @@
     return result;
 }
 
+PyDoc_STRVAR(gc_get_stats__doc__,
+"get_stats() -> [...]\n"
+"\n"
+"Return a list of dictionaries containing per-generation statistics.\n");
+
+static PyObject *
+gc_get_stats(PyObject *self, PyObject *noargs)
+{
+    int i;
+    PyObject *result;
+    struct gc_generation_stats stats[NUM_GENERATIONS], *st;
+
+    /* To get consistent values despite allocations while constructing
+       the result list, we use a snapshot of the running stats. */
+    for (i = 0; i < NUM_GENERATIONS; i++) {
+        stats[i] = generation_stats[i];
+    }
+
+    result = PyList_New(0);
+    if (result == NULL)
+        return NULL;
+
+    for (i = 0; i < NUM_GENERATIONS; i++) {
+        PyObject *dict;
+        st = &stats[i];
+        dict = Py_BuildValue("{snsnsn}",
+                             "collections", st->collections,
+                             "collected", st->collected,
+                             "uncollectable", st->uncollectable
+                            );
+        if (dict == NULL)
+            goto error;
+        if (PyList_Append(result, dict)) {
+            Py_DECREF(dict);
+            goto error;
+        }
+        Py_DECREF(dict);
+    }
+    return result;
+
+error:
+    Py_XDECREF(result);
+    return NULL;
+}
+
+
 PyDoc_STRVAR(gc_is_tracked__doc__,
 "is_tracked(obj) -> bool\n"
 "\n"
@@ -1372,6 +1510,7 @@
 "isenabled() -- Returns true if automatic collection is enabled.\n"
 "collect() -- Do a full collection right now.\n"
 "get_count() -- Return the current collection counts.\n"
+"get_stats() -- Return list of dictionaries containing per-generation stats.\n"
 "set_debug() -- Set debugging flags.\n"
 "get_debug() -- Get debugging flags.\n"
 "set_threshold() -- Set the collection thresholds.\n"
@@ -1393,6 +1532,7 @@
     {"collect",            (PyCFunction)gc_collect,
         METH_VARARGS | METH_KEYWORDS,           gc_collect__doc__},
     {"get_objects",    gc_get_objects,METH_NOARGS,  gc_get_objects__doc__},
+    {"get_stats",      gc_get_stats, METH_NOARGS, gc_get_stats__doc__},
     {"is_tracked",     gc_is_tracked, METH_O,       gc_is_tracked__doc__},
     {"get_referrers",  gc_get_referrers, METH_VARARGS,
         gc_get_referrers__doc__},
@@ -1480,8 +1620,29 @@
     return n;
 }
 
+Py_ssize_t
+_PyGC_CollectNoFail(void)
+{
+    Py_ssize_t n;
+
+    /* Ideally, this function is only called on interpreter shutdown,
+       and therefore not recursively.  Unfortunately, when there are daemon
+       threads, a daemon thread can start a cyclic garbage collection
+       during interpreter shutdown (and then never finish it).
+       See http://bugs.python.org/issue8713#msg195178 for an example.
+       */
+    if (collecting)
+        n = 0;
+    else {
+        collecting = 1;
+        n = collect(NUM_GENERATIONS - 1, NULL, NULL, 1);
+        collecting = 0;
+    }
+    return n;
+}
+
 void
-_PyGC_Fini(void)
+_PyGC_DumpShutdownStats(void)
 {
     if (!(debug & DEBUG_SAVEALL)
         && garbage != NULL && PyList_GET_SIZE(garbage) > 0) {
@@ -1492,8 +1653,12 @@
         else
             message = "gc: %zd uncollectable objects at " \
                 "shutdown; use gc.set_debug(gc.DEBUG_UNCOLLECTABLE) to list them";
-        if (PyErr_WarnFormat(PyExc_ResourceWarning, 0, message,
-                             PyList_GET_SIZE(garbage)) < 0)
+        /* PyErr_WarnFormat does too many things and we are at shutdown,
+           the warnings module's dependencies (e.g. linecache) may be gone
+           already. */
+        if (PyErr_WarnExplicitFormat(PyExc_ResourceWarning, "gc", 0,
+                                     "gc", NULL, message,
+                                     PyList_GET_SIZE(garbage)))
             PyErr_WriteUnraisable(NULL);
         if (debug & DEBUG_UNCOLLECTABLE) {
             PyObject *repr = NULL, *bytes = NULL;
@@ -1502,7 +1667,7 @@
                 PyErr_WriteUnraisable(garbage);
             else {
                 PySys_WriteStderr(
-                    "    %s\n",
+                    "      %s\n",
                     PyBytes_AS_STRING(bytes)
                     );
             }
@@ -1510,7 +1675,13 @@
             Py_XDECREF(bytes);
         }
     }
+}
+
+void
+_PyGC_Fini(void)
+{
     Py_CLEAR(callbacks);
+    Py_CLEAR(tmod);
 }
 
 /* for debugging */
@@ -1555,7 +1726,8 @@
         sizeof(PyGC_Head) + basicsize);
     if (g == NULL)
         return PyErr_NoMemory();
-    g->gc.gc_refs = GC_UNTRACKED;
+    g->gc.gc_refs = 0;
+    _PyGCHead_SET_REFS(g, GC_UNTRACKED);
     generations[0].count++; /* number of allocated GC objects */
     if (generations[0].count > generations[0].threshold &&
         enabled &&
@@ -1582,8 +1754,15 @@
 PyVarObject *
 _PyObject_GC_NewVar(PyTypeObject *tp, Py_ssize_t nitems)
 {
-    const size_t size = _PyObject_VAR_SIZE(tp, nitems);
-    PyVarObject *op = (PyVarObject *) _PyObject_GC_Malloc(size);
+    size_t size;
+    PyVarObject *op;
+
+    if (nitems < 0) {
+        PyErr_BadInternalCall();
+        return NULL;
+    }
+    size = _PyObject_VAR_SIZE(tp, nitems);
+    op = (PyVarObject *) _PyObject_GC_Malloc(size);
     if (op != NULL)
         op = PyObject_INIT_VAR(op, tp, nitems);
     return op;
diff --git a/Modules/getpath.c b/Modules/getpath.c
index ff14fdd..c057737 100644
--- a/Modules/getpath.c
+++ b/Modules/getpath.c
@@ -110,11 +110,7 @@
 #endif
 
 #ifndef PREFIX
-#  ifdef __VMS
-#    define PREFIX ""
-#  else
-#    define PREFIX "/usr/local"
-#  endif
+#  define PREFIX "/usr/local"
 #endif
 
 #ifndef EXEC_PREFIX
@@ -134,8 +130,6 @@
 static wchar_t exec_prefix[MAXPATHLEN+1];
 static wchar_t progpath[MAXPATHLEN+1];
 static wchar_t *module_search_path = NULL;
-static int module_search_path_malloced = 0;
-static wchar_t *lib_python = L"lib/python" VERSION;
 
 static void
 reduce(wchar_t *dir)
@@ -317,7 +311,8 @@
    bytes long.
 */
 static int
-search_for_prefix(wchar_t *argv0_path, wchar_t *home, wchar_t *_prefix)
+search_for_prefix(wchar_t *argv0_path, wchar_t *home, wchar_t *_prefix,
+                  wchar_t *lib_python)
 {
     size_t n;
     wchar_t *vpath;
@@ -346,7 +341,7 @@
             wcsncpy(prefix, argv0_path, MAXPATHLEN);
             prefix[MAXPATHLEN] = L'\0';
             joinpath(prefix, vpath);
-            PyMem_Free(vpath);
+            PyMem_RawFree(vpath);
             joinpath(prefix, L"Lib");
             joinpath(prefix, LANDMARK);
             if (ismodule(prefix))
@@ -383,7 +378,8 @@
    MAXPATHLEN bytes long.
 */
 static int
-search_for_exec_prefix(wchar_t *argv0_path, wchar_t *home, wchar_t *_exec_prefix)
+search_for_exec_prefix(wchar_t *argv0_path, wchar_t *home,
+                       wchar_t *_exec_prefix, wchar_t *lib_python)
 {
     size_t n;
 
@@ -493,12 +489,14 @@
     char execpath[MAXPATHLEN+1];
 #endif
     wchar_t *_pythonpath, *_prefix, *_exec_prefix;
+    wchar_t *lib_python;
 
     _pythonpath = _Py_char2wchar(PYTHONPATH, NULL);
     _prefix = _Py_char2wchar(PREFIX, NULL);
     _exec_prefix = _Py_char2wchar(EXEC_PREFIX, NULL);
+    lib_python = _Py_char2wchar("lib/python" VERSION, NULL);
 
-    if (!_pythonpath || !_prefix || !_exec_prefix) {
+    if (!_pythonpath || !_prefix || !_exec_prefix || !lib_python) {
         Py_FatalError(
             "Unable to decode path variables in getpath.c: "
             "memory error");
@@ -562,8 +560,7 @@
     }
     else
         progpath[0] = '\0';
-    if (path_buffer != NULL)
-        PyMem_Free(path_buffer);
+    PyMem_RawFree(path_buffer);
     if (progpath[0] != SEP && progpath[0] != '\0')
         absolutize(progpath);
     wcsncpy(argv0_path, progpath, MAXPATHLEN);
@@ -605,7 +602,7 @@
             /* Use the location of the library as the progpath */
             wcsncpy(argv0_path, wbuf, MAXPATHLEN);
         }
-        PyMem_Free(wbuf);
+        PyMem_RawFree(wbuf);
     }
 #endif
 
@@ -667,7 +664,8 @@
         }
     }
 
-    if (!(pfound = search_for_prefix(argv0_path, home, _prefix))) {
+    pfound = search_for_prefix(argv0_path, home, _prefix, lib_python);
+    if (!pfound) {
         if (!Py_FrozenFlag)
             fprintf(stderr,
                 "Could not find platform independent libraries <prefix>\n");
@@ -690,7 +688,9 @@
     zip_path[bufsz - 6] = VERSION[0];
     zip_path[bufsz - 5] = VERSION[2];
 
-    if (!(efound = search_for_exec_prefix(argv0_path, home, _exec_prefix))) {
+    efound = search_for_exec_prefix(argv0_path, home,
+                                    _exec_prefix, lib_python);
+    if (!efound) {
         if (!Py_FrozenFlag)
             fprintf(stderr,
                 "Could not find platform dependent libraries <exec_prefix>\n");
@@ -707,13 +707,11 @@
      */
     bufsz = 0;
 
-    if (_rtpypath) {
+    if (_rtpypath && _rtpypath[0] != '\0') {
         size_t rtpypath_len;
         rtpypath = _Py_char2wchar(_rtpypath, &rtpypath_len);
         if (rtpypath != NULL)
             bufsz += rtpypath_len + 1;
-        else
-            _rtpypath = NULL;
     }
 
     defpath = _pythonpath;
@@ -737,60 +735,55 @@
     bufsz += wcslen(zip_path) + 1;
     bufsz += wcslen(exec_prefix) + 1;
 
-    buf = (wchar_t *)PyMem_Malloc(bufsz*sizeof(wchar_t));
-
+    buf = (wchar_t *)PyMem_Malloc(bufsz * sizeof(wchar_t));
     if (buf == NULL) {
-        /* We can't exit, so print a warning and limp along */
-        fprintf(stderr, "Not enough memory for dynamic PYTHONPATH.\n");
-        fprintf(stderr, "Using default static PYTHONPATH.\n");
-        module_search_path = L"" PYTHONPATH;
+        Py_FatalError(
+            "Not enough memory for dynamic PYTHONPATH");
     }
-    else {
-        /* Run-time value of $PYTHONPATH goes first */
-        if (rtpypath) {
-            wcscpy(buf, rtpypath);
-            wcscat(buf, delimiter);
-        }
-        else
-            buf[0] = '\0';
 
-        /* Next is the default zip path */
-        wcscat(buf, zip_path);
+    /* Run-time value of $PYTHONPATH goes first */
+    if (rtpypath) {
+        wcscpy(buf, rtpypath);
         wcscat(buf, delimiter);
-
-        /* Next goes merge of compile-time $PYTHONPATH with
-         * dynamically located prefix.
-         */
-        defpath = _pythonpath;
-        while (1) {
-            wchar_t *delim = wcschr(defpath, DELIM);
-
-            if (defpath[0] != SEP) {
-                wcscat(buf, prefix);
-                wcscat(buf, separator);
-            }
-
-            if (delim) {
-                size_t len = delim - defpath + 1;
-                size_t end = wcslen(buf) + len;
-                wcsncat(buf, defpath, len);
-                *(buf + end) = '\0';
-            }
-            else {
-                wcscat(buf, defpath);
-                break;
-            }
-            defpath = delim + 1;
-        }
-        wcscat(buf, delimiter);
-
-        /* Finally, on goes the directory for dynamic-load modules */
-        wcscat(buf, exec_prefix);
-
-        /* And publish the results */
-        module_search_path = buf;
-        module_search_path_malloced = 1;
     }
+    else
+        buf[0] = '\0';
+
+    /* Next is the default zip path */
+    wcscat(buf, zip_path);
+    wcscat(buf, delimiter);
+
+    /* Next goes merge of compile-time $PYTHONPATH with
+     * dynamically located prefix.
+     */
+    defpath = _pythonpath;
+    while (1) {
+        wchar_t *delim = wcschr(defpath, DELIM);
+
+        if (defpath[0] != SEP) {
+            wcscat(buf, prefix);
+            wcscat(buf, separator);
+        }
+
+        if (delim) {
+            size_t len = delim - defpath + 1;
+            size_t end = wcslen(buf) + len;
+            wcsncat(buf, defpath, len);
+            *(buf + end) = '\0';
+        }
+        else {
+            wcscat(buf, defpath);
+            break;
+        }
+        defpath = delim + 1;
+    }
+    wcscat(buf, delimiter);
+
+    /* Finally, on goes the directory for dynamic-load modules */
+    wcscat(buf, exec_prefix);
+
+    /* And publish the results */
+    module_search_path = buf;
 
     /* Reduce prefix and exec_prefix to their essence,
      * e.g. /usr/local/lib/python1.5 is reduced to /usr/local.
@@ -818,11 +811,11 @@
     else
         wcsncpy(exec_prefix, _exec_prefix, MAXPATHLEN);
 
-    PyMem_Free(_pythonpath);
-    PyMem_Free(_prefix);
-    PyMem_Free(_exec_prefix);
-    if (rtpypath != NULL)
-        PyMem_Free(rtpypath);
+    PyMem_RawFree(_pythonpath);
+    PyMem_RawFree(_prefix);
+    PyMem_RawFree(_exec_prefix);
+    PyMem_RawFree(lib_python);
+    PyMem_RawFree(rtpypath);
 }
 
 
@@ -831,18 +824,15 @@
 Py_SetPath(const wchar_t *path)
 {
     if (module_search_path != NULL) {
-        if (module_search_path_malloced)
-            PyMem_Free(module_search_path);
+        PyMem_RawFree(module_search_path);
         module_search_path = NULL;
-        module_search_path_malloced = 0;
     }
     if (path != NULL) {
         extern wchar_t *Py_GetProgramName(void);
         wchar_t *prog = Py_GetProgramName();
         wcsncpy(progpath, prog, MAXPATHLEN);
         exec_prefix[0] = prefix[0] = L'\0';
-        module_search_path = PyMem_Malloc((wcslen(path) + 1) * sizeof(wchar_t));
-        module_search_path_malloced = 1;
+        module_search_path = PyMem_RawMalloc((wcslen(path) + 1) * sizeof(wchar_t));
         if (module_search_path != NULL)
             wcscpy(module_search_path, path);
     }
diff --git a/Modules/grpmodule.c b/Modules/grpmodule.c
index 042cf05..da78253 100644
--- a/Modules/grpmodule.c
+++ b/Modules/grpmodule.c
@@ -58,17 +58,12 @@
 
 #define SET(i,val) PyStructSequence_SET_ITEM(v, i, val)
     SET(setIndex++, PyUnicode_DecodeFSDefault(p->gr_name));
-#ifdef __VMS
-    SET(setIndex++, Py_None);
-    Py_INCREF(Py_None);
-#else
     if (p->gr_passwd)
             SET(setIndex++, PyUnicode_DecodeFSDefault(p->gr_passwd));
     else {
             SET(setIndex++, Py_None);
             Py_INCREF(Py_None);
     }
-#endif
     SET(setIndex++, _PyLong_FromGid(p->gr_gid));
     SET(setIndex++, w);
 #undef SET
@@ -157,11 +152,11 @@
 
 static PyMethodDef grp_methods[] = {
     {"getgrgid",        grp_getgrgid,   METH_O,
-     "getgrgid(id) -> tuple\n\
+     "getgrgid(id) -> (gr_name,gr_passwd,gr_gid,gr_mem)\n\
 Return the group database entry for the given numeric group ID.  If\n\
 id is not valid, raise KeyError."},
     {"getgrnam",        grp_getgrnam,   METH_VARARGS,
-     "getgrnam(name) -> tuple\n\
+     "getgrnam(name) -> (gr_name,gr_passwd,gr_gid,gr_mem)\n\
 Return the group database entry for the given group name.  If\n\
 name is not valid, raise KeyError."},
     {"getgrall",        grp_getgrall,   METH_NOARGS,
@@ -178,10 +173,10 @@
 Group entries are reported as 4-tuples containing the following fields\n\
 from the group database, in order:\n\
 \n\
-  name   - name of the group\n\
-  passwd - group password (encrypted); often empty\n\
-  gid    - numeric ID of the group\n\
-  mem    - list of members\n\
+  gr_name   - name of the group\n\
+  gr_passwd - group password (encrypted); often empty\n\
+  gr_gid    - numeric ID of the group\n\
+  gr_mem    - list of members\n\
 \n\
 The gid is an integer, name and password are strings.  (Note that most\n\
 users are not explicitly listed as members of the groups they are in\n\
@@ -210,9 +205,14 @@
     if (m == NULL)
         return NULL;
     d = PyModule_GetDict(m);
-    if (!initialized)
-            PyStructSequence_InitType(&StructGrpType, &struct_group_type_desc);
-    PyDict_SetItemString(d, "struct_group", (PyObject *) &StructGrpType);
+    if (!initialized) {
+        if (PyStructSequence_InitType2(&StructGrpType,
+                                       &struct_group_type_desc) < 0)
+            return NULL;
+    }
+    if (PyDict_SetItemString(d, "struct_group",
+                             (PyObject *)&StructGrpType) < 0)
+        return NULL;
     initialized = 1;
     return m;
 }
diff --git a/Modules/hashlib.h b/Modules/hashlib.h
index 4599146..51c68f6 100644
--- a/Modules/hashlib.h
+++ b/Modules/hashlib.h
@@ -26,3 +26,36 @@
             return NULL; \
         } \
     } while(0);
+
+/*
+ * Helper code to synchronize access to the hash object when the GIL is
+ * released around a CPU consuming hashlib operation. All code paths that
+ * access a mutable part of obj must be enclosed in a ENTER_HASHLIB /
+ * LEAVE_HASHLIB block or explicitly acquire and release the lock inside
+ * a PY_BEGIN / END_ALLOW_THREADS block if they wish to release the GIL for
+ * an operation.
+ */
+
+#ifdef WITH_THREAD
+#include "pythread.h"
+    #define ENTER_HASHLIB(obj) \
+        if ((obj)->lock) { \
+            if (!PyThread_acquire_lock((obj)->lock, 0)) { \
+                Py_BEGIN_ALLOW_THREADS \
+                PyThread_acquire_lock((obj)->lock, 1); \
+                Py_END_ALLOW_THREADS \
+            } \
+        }
+    #define LEAVE_HASHLIB(obj) \
+        if ((obj)->lock) { \
+            PyThread_release_lock((obj)->lock); \
+        }
+#else
+    #define ENTER_HASHLIB(obj)
+    #define LEAVE_HASHLIB(obj)
+#endif
+
+/* TODO(gps): We should probably make this a module or EVPobject attribute
+ * to allow the user to optimize based on the platform they're using. */
+#define HASHLIB_GIL_MINSIZE 2048
+
diff --git a/Modules/hashtable.c b/Modules/hashtable.c
new file mode 100644
index 0000000..133f313
--- /dev/null
+++ b/Modules/hashtable.c
@@ -0,0 +1,519 @@
+/* The implementation of the hash table (_Py_hashtable_t) is based on the cfuhash
+   project:
+   http://sourceforge.net/projects/libcfu/
+
+   Copyright of cfuhash:
+   ----------------------------------
+   Creation date: 2005-06-24 21:22:40
+   Authors: Don
+   Change log:
+
+   Copyright (c) 2005 Don Owens
+   All rights reserved.
+
+   This code is released under the BSD 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.
+
+     * 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.
+
+     * Neither the name of the author 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.
+   ----------------------------------
+*/
+
+#include "Python.h"
+#include "hashtable.h"
+
+#define HASHTABLE_MIN_SIZE 16
+#define HASHTABLE_HIGH 0.50
+#define HASHTABLE_LOW 0.10
+#define HASHTABLE_REHASH_FACTOR 2.0 / (HASHTABLE_LOW + HASHTABLE_HIGH)
+
+#define BUCKETS_HEAD(SLIST) \
+        ((_Py_hashtable_entry_t *)_Py_SLIST_HEAD(&(SLIST)))
+#define TABLE_HEAD(HT, BUCKET) \
+        ((_Py_hashtable_entry_t *)_Py_SLIST_HEAD(&(HT)->buckets[BUCKET]))
+#define ENTRY_NEXT(ENTRY) \
+        ((_Py_hashtable_entry_t *)_Py_SLIST_ITEM_NEXT(ENTRY))
+#define HASHTABLE_ITEM_SIZE(HT) \
+        (sizeof(_Py_hashtable_entry_t) + (HT)->data_size)
+
+/* Forward declaration */
+static void hashtable_rehash(_Py_hashtable_t *ht);
+
+static void
+_Py_slist_init(_Py_slist_t *list)
+{
+    list->head = NULL;
+}
+
+static void
+_Py_slist_prepend(_Py_slist_t *list, _Py_slist_item_t *item)
+{
+    item->next = list->head;
+    list->head = item;
+}
+
+static void
+_Py_slist_remove(_Py_slist_t *list, _Py_slist_item_t *previous,
+                 _Py_slist_item_t *item)
+{
+    if (previous != NULL)
+        previous->next = item->next;
+    else
+        list->head = item->next;
+}
+
+Py_uhash_t
+_Py_hashtable_hash_int(const void *key)
+{
+    return (Py_uhash_t)key;
+}
+
+Py_uhash_t
+_Py_hashtable_hash_ptr(const void *key)
+{
+    return (Py_uhash_t)_Py_HashPointer((void *)key);
+}
+
+int
+_Py_hashtable_compare_direct(const void *key, const _Py_hashtable_entry_t *entry)
+{
+    return entry->key == key;
+}
+
+/* makes sure the real size of the buckets array is a power of 2 */
+static size_t
+round_size(size_t s)
+{
+    size_t i;
+    if (s < HASHTABLE_MIN_SIZE)
+        return HASHTABLE_MIN_SIZE;
+    i = 1;
+    while (i < s)
+        i <<= 1;
+    return i;
+}
+
+_Py_hashtable_t *
+_Py_hashtable_new_full(size_t data_size, size_t init_size,
+                       _Py_hashtable_hash_func hash_func,
+                       _Py_hashtable_compare_func compare_func,
+                       _Py_hashtable_copy_data_func copy_data_func,
+                       _Py_hashtable_free_data_func free_data_func,
+                       _Py_hashtable_get_data_size_func get_data_size_func,
+                       _Py_hashtable_allocator_t *allocator)
+{
+    _Py_hashtable_t *ht;
+    size_t buckets_size;
+    _Py_hashtable_allocator_t alloc;
+
+    if (allocator == NULL) {
+        alloc.malloc = PyMem_RawMalloc;
+        alloc.free = PyMem_RawFree;
+    }
+    else
+        alloc = *allocator;
+
+    ht = (_Py_hashtable_t *)alloc.malloc(sizeof(_Py_hashtable_t));
+    if (ht == NULL)
+        return ht;
+
+    ht->num_buckets = round_size(init_size);
+    ht->entries = 0;
+    ht->data_size = data_size;
+
+    buckets_size = ht->num_buckets * sizeof(ht->buckets[0]);
+    ht->buckets = alloc.malloc(buckets_size);
+    if (ht->buckets == NULL) {
+        alloc.free(ht);
+        return NULL;
+    }
+    memset(ht->buckets, 0, buckets_size);
+
+    ht->hash_func = hash_func;
+    ht->compare_func = compare_func;
+    ht->copy_data_func = copy_data_func;
+    ht->free_data_func = free_data_func;
+    ht->get_data_size_func = get_data_size_func;
+    ht->alloc = alloc;
+    return ht;
+}
+
+_Py_hashtable_t *
+_Py_hashtable_new(size_t data_size,
+                  _Py_hashtable_hash_func hash_func,
+                  _Py_hashtable_compare_func compare_func)
+{
+    return _Py_hashtable_new_full(data_size, HASHTABLE_MIN_SIZE,
+                                  hash_func, compare_func,
+                                  NULL, NULL, NULL, NULL);
+}
+
+size_t
+_Py_hashtable_size(_Py_hashtable_t *ht)
+{
+    size_t size;
+    size_t hv;
+
+    size = sizeof(_Py_hashtable_t);
+
+    /* buckets */
+    size += ht->num_buckets * sizeof(_Py_hashtable_entry_t *);
+
+    /* entries */
+    size += ht->entries * HASHTABLE_ITEM_SIZE(ht);
+
+    /* data linked from entries */
+    if (ht->get_data_size_func) {
+        for (hv = 0; hv < ht->num_buckets; hv++) {
+            _Py_hashtable_entry_t *entry;
+
+            for (entry = TABLE_HEAD(ht, hv); entry; entry = ENTRY_NEXT(entry)) {
+                void *data;
+
+                data = _Py_HASHTABLE_ENTRY_DATA_AS_VOID_P(entry);
+                size += ht->get_data_size_func(data);
+            }
+        }
+    }
+    return size;
+}
+
+#ifdef Py_DEBUG
+void
+_Py_hashtable_print_stats(_Py_hashtable_t *ht)
+{
+    size_t size;
+    size_t chain_len, max_chain_len, total_chain_len, nchains;
+    _Py_hashtable_entry_t *entry;
+    size_t hv;
+    double load;
+
+    size = _Py_hashtable_size(ht);
+
+    load = (double)ht->entries / ht->num_buckets;
+
+    max_chain_len = 0;
+    total_chain_len = 0;
+    nchains = 0;
+    for (hv = 0; hv < ht->num_buckets; hv++) {
+        entry = TABLE_HEAD(ht, hv);
+        if (entry != NULL) {
+            chain_len = 0;
+            for (; entry; entry = ENTRY_NEXT(entry)) {
+                chain_len++;
+            }
+            if (chain_len > max_chain_len)
+                max_chain_len = chain_len;
+            total_chain_len += chain_len;
+            nchains++;
+        }
+    }
+    printf("hash table %p: entries=%"
+           PY_FORMAT_SIZE_T "u/%" PY_FORMAT_SIZE_T "u (%.0f%%), ",
+           ht, ht->entries, ht->num_buckets, load * 100.0);
+    if (nchains)
+        printf("avg_chain_len=%.1f, ", (double)total_chain_len / nchains);
+    printf("max_chain_len=%" PY_FORMAT_SIZE_T "u, %" PY_FORMAT_SIZE_T "u kB\n",
+           max_chain_len, size / 1024);
+}
+#endif
+
+/* Get an entry. Return NULL if the key does not exist. */
+_Py_hashtable_entry_t *
+_Py_hashtable_get_entry(_Py_hashtable_t *ht, const void *key)
+{
+    Py_uhash_t key_hash;
+    size_t index;
+    _Py_hashtable_entry_t *entry;
+
+    key_hash = ht->hash_func(key);
+    index = key_hash & (ht->num_buckets - 1);
+
+    for (entry = TABLE_HEAD(ht, index); entry != NULL; entry = ENTRY_NEXT(entry)) {
+        if (entry->key_hash == key_hash && ht->compare_func(key, entry))
+            break;
+    }
+
+    return entry;
+}
+
+static int
+_hashtable_pop_entry(_Py_hashtable_t *ht, const void *key, void *data, size_t data_size)
+{
+    Py_uhash_t key_hash;
+    size_t index;
+    _Py_hashtable_entry_t *entry, *previous;
+
+    key_hash = ht->hash_func(key);
+    index = key_hash & (ht->num_buckets - 1);
+
+    previous = NULL;
+    for (entry = TABLE_HEAD(ht, index); entry != NULL; entry = ENTRY_NEXT(entry)) {
+        if (entry->key_hash == key_hash && ht->compare_func(key, entry))
+            break;
+        previous = entry;
+    }
+
+    if (entry == NULL)
+        return 0;
+
+    _Py_slist_remove(&ht->buckets[index], (_Py_slist_item_t *)previous,
+                     (_Py_slist_item_t *)entry);
+    ht->entries--;
+
+    if (data != NULL)
+        _Py_HASHTABLE_ENTRY_READ_DATA(ht, data, data_size, entry);
+    ht->alloc.free(entry);
+
+    if ((float)ht->entries / (float)ht->num_buckets < HASHTABLE_LOW)
+        hashtable_rehash(ht);
+    return 1;
+}
+
+/* Add a new entry to the hash. The key must not be present in the hash table.
+   Return 0 on success, -1 on memory error. */
+int
+_Py_hashtable_set(_Py_hashtable_t *ht, const void *key,
+                  void *data, size_t data_size)
+{
+    Py_uhash_t key_hash;
+    size_t index;
+    _Py_hashtable_entry_t *entry;
+
+    assert(data != NULL || data_size == 0);
+#ifndef NDEBUG
+    /* Don't write the assertion on a single line because it is interesting
+       to know the duplicated entry if the assertion failed. The entry can
+       be read using a debugger. */
+    entry = _Py_hashtable_get_entry(ht, key);
+    assert(entry == NULL);
+#endif
+
+    key_hash = ht->hash_func(key);
+    index = key_hash & (ht->num_buckets - 1);
+
+    entry = ht->alloc.malloc(HASHTABLE_ITEM_SIZE(ht));
+    if (entry == NULL) {
+        /* memory allocation failed */
+        return -1;
+    }
+
+    entry->key = (void *)key;
+    entry->key_hash = key_hash;
+
+    assert(data_size == ht->data_size);
+    memcpy(_Py_HASHTABLE_ENTRY_DATA(entry), data, data_size);
+
+    _Py_slist_prepend(&ht->buckets[index], (_Py_slist_item_t*)entry);
+    ht->entries++;
+
+    if ((float)ht->entries / (float)ht->num_buckets > HASHTABLE_HIGH)
+        hashtable_rehash(ht);
+    return 0;
+}
+
+/* Get data from an entry. Copy entry data into data and return 1 if the entry
+   exists, return 0 if the entry does not exist. */
+int
+_Py_hashtable_get(_Py_hashtable_t *ht, const void *key, void *data, size_t data_size)
+{
+    _Py_hashtable_entry_t *entry;
+
+    assert(data != NULL);
+
+    entry = _Py_hashtable_get_entry(ht, key);
+    if (entry == NULL)
+        return 0;
+    _Py_HASHTABLE_ENTRY_READ_DATA(ht, data, data_size, entry);
+    return 1;
+}
+
+int
+_Py_hashtable_pop(_Py_hashtable_t *ht, const void *key, void *data, size_t data_size)
+{
+    assert(data != NULL);
+    assert(ht->free_data_func == NULL);
+    return _hashtable_pop_entry(ht, key, data, data_size);
+}
+
+/* Delete an entry. The entry must exist. */
+void
+_Py_hashtable_delete(_Py_hashtable_t *ht, const void *key)
+{
+#ifndef NDEBUG
+    int found = _hashtable_pop_entry(ht, key, NULL, 0);
+    assert(found);
+#else
+    (void)_hashtable_pop_entry(ht, key, NULL, 0);
+#endif
+}
+
+/* Prototype for a pointer to a function to be called foreach
+   key/value pair in the hash by hashtable_foreach().  Iteration
+   stops if a non-zero value is returned. */
+int
+_Py_hashtable_foreach(_Py_hashtable_t *ht,
+                      int (*func) (_Py_hashtable_entry_t *entry, void *arg),
+                      void *arg)
+{
+    _Py_hashtable_entry_t *entry;
+    size_t hv;
+
+    for (hv = 0; hv < ht->num_buckets; hv++) {
+        for (entry = TABLE_HEAD(ht, hv); entry; entry = ENTRY_NEXT(entry)) {
+            int res = func(entry, arg);
+            if (res)
+                return res;
+        }
+    }
+    return 0;
+}
+
+static void
+hashtable_rehash(_Py_hashtable_t *ht)
+{
+    size_t buckets_size, new_size, bucket;
+    _Py_slist_t *old_buckets = NULL;
+    size_t old_num_buckets;
+
+    new_size = round_size((size_t)(ht->entries * HASHTABLE_REHASH_FACTOR));
+    if (new_size == ht->num_buckets)
+        return;
+
+    old_num_buckets = ht->num_buckets;
+
+    buckets_size = new_size * sizeof(ht->buckets[0]);
+    old_buckets = ht->buckets;
+    ht->buckets = ht->alloc.malloc(buckets_size);
+    if (ht->buckets == NULL) {
+        /* cancel rehash on memory allocation failure */
+        ht->buckets = old_buckets ;
+        /* memory allocation failed */
+        return;
+    }
+    memset(ht->buckets, 0, buckets_size);
+
+    ht->num_buckets = new_size;
+
+    for (bucket = 0; bucket < old_num_buckets; bucket++) {
+        _Py_hashtable_entry_t *entry, *next;
+        for (entry = BUCKETS_HEAD(old_buckets[bucket]); entry != NULL; entry = next) {
+            size_t entry_index;
+
+            assert(ht->hash_func(entry->key) == entry->key_hash);
+            next = ENTRY_NEXT(entry);
+            entry_index = entry->key_hash & (new_size - 1);
+
+            _Py_slist_prepend(&ht->buckets[entry_index], (_Py_slist_item_t*)entry);
+        }
+    }
+
+    ht->alloc.free(old_buckets);
+}
+
+void
+_Py_hashtable_clear(_Py_hashtable_t *ht)
+{
+    _Py_hashtable_entry_t *entry, *next;
+    size_t i;
+
+    for (i=0; i < ht->num_buckets; i++) {
+        for (entry = TABLE_HEAD(ht, i); entry != NULL; entry = next) {
+            next = ENTRY_NEXT(entry);
+            if (ht->free_data_func)
+                ht->free_data_func(_Py_HASHTABLE_ENTRY_DATA_AS_VOID_P(entry));
+            ht->alloc.free(entry);
+        }
+        _Py_slist_init(&ht->buckets[i]);
+    }
+    ht->entries = 0;
+    hashtable_rehash(ht);
+}
+
+void
+_Py_hashtable_destroy(_Py_hashtable_t *ht)
+{
+    size_t i;
+
+    for (i = 0; i < ht->num_buckets; i++) {
+        _Py_slist_item_t *entry = ht->buckets[i].head;
+        while (entry) {
+            _Py_slist_item_t *entry_next = entry->next;
+            if (ht->free_data_func)
+                ht->free_data_func(_Py_HASHTABLE_ENTRY_DATA_AS_VOID_P(entry));
+            ht->alloc.free(entry);
+            entry = entry_next;
+        }
+    }
+
+    ht->alloc.free(ht->buckets);
+    ht->alloc.free(ht);
+}
+
+/* Return a copy of the hash table */
+_Py_hashtable_t *
+_Py_hashtable_copy(_Py_hashtable_t *src)
+{
+    _Py_hashtable_t *dst;
+    _Py_hashtable_entry_t *entry;
+    size_t bucket;
+    int err;
+    void *data, *new_data;
+
+    dst = _Py_hashtable_new_full(src->data_size, src->num_buckets,
+                            src->hash_func, src->compare_func,
+                            src->copy_data_func, src->free_data_func,
+                            src->get_data_size_func, &src->alloc);
+    if (dst == NULL)
+        return NULL;
+
+    for (bucket=0; bucket < src->num_buckets; bucket++) {
+        entry = TABLE_HEAD(src, bucket);
+        for (; entry; entry = ENTRY_NEXT(entry)) {
+            if (src->copy_data_func) {
+                data = _Py_HASHTABLE_ENTRY_DATA_AS_VOID_P(entry);
+                new_data = src->copy_data_func(data);
+                if (new_data != NULL)
+                    err = _Py_hashtable_set(dst, entry->key,
+                                        &new_data, src->data_size);
+                else
+                    err = 1;
+            }
+            else {
+                data = _Py_HASHTABLE_ENTRY_DATA(entry);
+                err = _Py_hashtable_set(dst, entry->key, data, src->data_size);
+            }
+            if (err) {
+                _Py_hashtable_destroy(dst);
+                return NULL;
+            }
+        }
+    }
+    return dst;
+}
+
diff --git a/Modules/hashtable.h b/Modules/hashtable.h
new file mode 100644
index 0000000..a9f9993
--- /dev/null
+++ b/Modules/hashtable.h
@@ -0,0 +1,128 @@
+#ifndef Py_HASHTABLE_H
+#define Py_HASHTABLE_H
+
+/* The whole API is private */
+#ifndef Py_LIMITED_API
+
+typedef struct _Py_slist_item_s {
+    struct _Py_slist_item_s *next;
+} _Py_slist_item_t;
+
+typedef struct {
+    _Py_slist_item_t *head;
+} _Py_slist_t;
+
+#define _Py_SLIST_ITEM_NEXT(ITEM) (((_Py_slist_item_t *)ITEM)->next)
+
+#define _Py_SLIST_HEAD(SLIST) (((_Py_slist_t *)SLIST)->head)
+
+typedef struct {
+    /* used by _Py_hashtable_t.buckets to link entries */
+    _Py_slist_item_t _Py_slist_item;
+
+    const void *key;
+    Py_uhash_t key_hash;
+
+    /* data follows */
+} _Py_hashtable_entry_t;
+
+#define _Py_HASHTABLE_ENTRY_DATA(ENTRY) \
+        ((char *)(ENTRY) + sizeof(_Py_hashtable_entry_t))
+
+#define _Py_HASHTABLE_ENTRY_DATA_AS_VOID_P(ENTRY) \
+        (*(void **)_Py_HASHTABLE_ENTRY_DATA(ENTRY))
+
+#define _Py_HASHTABLE_ENTRY_READ_DATA(TABLE, DATA, DATA_SIZE, ENTRY) \
+    do { \
+        assert((DATA_SIZE) == (TABLE)->data_size); \
+        memcpy(DATA, _Py_HASHTABLE_ENTRY_DATA(ENTRY), DATA_SIZE); \
+    } while (0)
+
+typedef Py_uhash_t (*_Py_hashtable_hash_func) (const void *key);
+typedef int (*_Py_hashtable_compare_func) (const void *key, const _Py_hashtable_entry_t *he);
+typedef void* (*_Py_hashtable_copy_data_func)(void *data);
+typedef void (*_Py_hashtable_free_data_func)(void *data);
+typedef size_t (*_Py_hashtable_get_data_size_func)(void *data);
+
+typedef struct {
+    /* allocate a memory block */
+    void* (*malloc) (size_t size);
+
+    /* release a memory block */
+    void (*free) (void *ptr);
+} _Py_hashtable_allocator_t;
+
+typedef struct {
+    size_t num_buckets;
+    size_t entries; /* Total number of entries in the table. */
+    _Py_slist_t *buckets;
+    size_t data_size;
+
+    _Py_hashtable_hash_func hash_func;
+    _Py_hashtable_compare_func compare_func;
+    _Py_hashtable_copy_data_func copy_data_func;
+    _Py_hashtable_free_data_func free_data_func;
+    _Py_hashtable_get_data_size_func get_data_size_func;
+    _Py_hashtable_allocator_t alloc;
+} _Py_hashtable_t;
+
+/* hash and compare functions for integers and pointers */
+PyAPI_FUNC(Py_uhash_t) _Py_hashtable_hash_ptr(const void *key);
+PyAPI_FUNC(Py_uhash_t) _Py_hashtable_hash_int(const void *key);
+PyAPI_FUNC(int) _Py_hashtable_compare_direct(const void *key, const _Py_hashtable_entry_t *entry);
+
+PyAPI_FUNC(_Py_hashtable_t *) _Py_hashtable_new(
+    size_t data_size,
+    _Py_hashtable_hash_func hash_func,
+    _Py_hashtable_compare_func compare_func);
+PyAPI_FUNC(_Py_hashtable_t *) _Py_hashtable_new_full(
+    size_t data_size,
+    size_t init_size,
+    _Py_hashtable_hash_func hash_func,
+    _Py_hashtable_compare_func compare_func,
+    _Py_hashtable_copy_data_func copy_data_func,
+    _Py_hashtable_free_data_func free_data_func,
+    _Py_hashtable_get_data_size_func get_data_size_func,
+    _Py_hashtable_allocator_t *allocator);
+PyAPI_FUNC(_Py_hashtable_t *) _Py_hashtable_copy(_Py_hashtable_t *src);
+PyAPI_FUNC(void) _Py_hashtable_clear(_Py_hashtable_t *ht);
+PyAPI_FUNC(void) _Py_hashtable_destroy(_Py_hashtable_t *ht);
+
+typedef int (*_Py_hashtable_foreach_func) (_Py_hashtable_entry_t *entry, void *arg);
+
+PyAPI_FUNC(int) _Py_hashtable_foreach(
+    _Py_hashtable_t *ht,
+    _Py_hashtable_foreach_func func, void *arg);
+PyAPI_FUNC(size_t) _Py_hashtable_size(_Py_hashtable_t *ht);
+
+PyAPI_FUNC(_Py_hashtable_entry_t*) _Py_hashtable_get_entry(
+    _Py_hashtable_t *ht,
+    const void *key);
+PyAPI_FUNC(int) _Py_hashtable_set(
+    _Py_hashtable_t *ht,
+    const void *key,
+    void *data,
+    size_t data_size);
+PyAPI_FUNC(int) _Py_hashtable_get(
+    _Py_hashtable_t *ht,
+    const void *key,
+    void *data,
+    size_t data_size);
+PyAPI_FUNC(int) _Py_hashtable_pop(
+    _Py_hashtable_t *ht,
+    const void *key,
+    void *data,
+    size_t data_size);
+PyAPI_FUNC(void) _Py_hashtable_delete(
+    _Py_hashtable_t *ht,
+    const void *key);
+
+#define _Py_HASHTABLE_SET(TABLE, KEY, DATA) \
+    _Py_hashtable_set(TABLE, KEY, &(DATA), sizeof(DATA))
+
+#define _Py_HASHTABLE_GET(TABLE, KEY, DATA) \
+    _Py_hashtable_get(TABLE, KEY, &(DATA), sizeof(DATA))
+
+#endif   /* Py_LIMITED_API */
+
+#endif
diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c
index a9e5709..1f42022 100644
--- a/Modules/itertoolsmodule.c
+++ b/Modules/itertoolsmodule.c
@@ -401,7 +401,7 @@
 typedef struct {
     PyObject_HEAD
     PyObject *it;
-    int numread;
+    int numread;  /* 0 <= numread <= LINKCELLS */
     PyObject *nextlink;
     PyObject *(values[LINKCELLS]);
 } teedataobject;
@@ -409,7 +409,7 @@
 typedef struct {
     PyObject_HEAD
     teedataobject *dataobj;
-    int index;
+    int index;    /* 0 <= index <= LINKCELLS */
     PyObject *weakreflist;
 } teeobject;
 
@@ -1492,19 +1492,22 @@
     Py_ssize_t oldnext;
     PyObject *(*iternext)(PyObject *);
 
+    if (it == NULL)
+        return NULL;
+
     iternext = *Py_TYPE(it)->tp_iternext;
     while (lz->cnt < lz->next) {
         item = iternext(it);
         if (item == NULL)
-            return NULL;
+            goto empty;
         Py_DECREF(item);
         lz->cnt++;
     }
     if (stop != -1 && lz->cnt >= stop)
-        return NULL;
+        goto empty;
     item = iternext(it);
     if (item == NULL)
-        return NULL;
+        goto empty;
     lz->cnt++;
     oldnext = lz->next;
     /* The (size_t) cast below avoids the danger of undefined
@@ -1513,6 +1516,10 @@
     if (lz->next < oldnext || (stop != -1 && lz->next > stop))
         lz->next = stop;
     return item;
+
+empty:
+    Py_CLEAR(lz->it);
+    return NULL;
 }
 
 static PyObject *
@@ -1522,6 +1529,18 @@
      * then 'setstate' with the next and count
      */
     PyObject *stop;
+    if (lz->it == NULL) {
+        PyObject *empty_list;
+        PyObject *empty_it;
+        empty_list = PyList_New(0);
+        if (empty_list == NULL)
+            return NULL;
+        empty_it = PyObject_GetIter(empty_list);
+        Py_DECREF(empty_list);
+        if (empty_it == NULL)
+            return NULL;
+        return Py_BuildValue("O(Nn)n", Py_TYPE(lz), empty_it, 0, 0);
+    }
     if (lz->stop == -1) {
         stop = Py_None;
         Py_INCREF(stop);
@@ -2065,6 +2084,18 @@
     Py_TYPE(lz)->tp_free(lz);
 }
 
+static PyObject *
+product_sizeof(productobject *lz, void *unused)
+{
+    Py_ssize_t res;
+
+    res = sizeof(productobject);
+    res += PyTuple_GET_SIZE(lz->pools) * sizeof(Py_ssize_t);
+    return PyLong_FromSsize_t(res);
+}
+
+PyDoc_STRVAR(sizeof_doc, "Returns size in memory, in bytes.");
+
 static int
 product_traverse(productobject *lz, visitproc visit, void *arg)
 {
@@ -2234,6 +2265,8 @@
      reduce_doc},
     {"__setstate__",    (PyCFunction)product_setstate,    METH_O,
      setstate_doc},
+    {"__sizeof__",      (PyCFunction)product_sizeof,      METH_NOARGS,
+     sizeof_doc},
     {NULL,              NULL}   /* sentinel */
 };
 
@@ -2374,6 +2407,16 @@
     Py_TYPE(co)->tp_free(co);
 }
 
+static PyObject *
+combinations_sizeof(combinationsobject *co, void *unused)
+{
+    Py_ssize_t res;
+
+    res = sizeof(combinationsobject);
+    res += co->r * sizeof(Py_ssize_t);
+    return PyLong_FromSsize_t(res);
+}
+
 static int
 combinations_traverse(combinationsobject *co, visitproc visit, void *arg)
 {
@@ -2545,6 +2588,8 @@
      reduce_doc},
     {"__setstate__",    (PyCFunction)combinations_setstate,    METH_O,
      setstate_doc},
+    {"__sizeof__",      (PyCFunction)combinations_sizeof,      METH_NOARGS,
+     sizeof_doc},
     {NULL,              NULL}   /* sentinel */
 };
 
@@ -2703,6 +2748,16 @@
     Py_TYPE(co)->tp_free(co);
 }
 
+static PyObject *
+cwr_sizeof(cwrobject *co, void *unused)
+{
+    Py_ssize_t res;
+
+    res = sizeof(cwrobject);
+    res += co->r * sizeof(Py_ssize_t);
+    return PyLong_FromSsize_t(res);
+}
+
 static int
 cwr_traverse(cwrobject *co, visitproc visit, void *arg)
 {
@@ -2862,6 +2917,8 @@
      reduce_doc},
     {"__setstate__",    (PyCFunction)cwr_setstate,    METH_O,
      setstate_doc},
+    {"__sizeof__",      (PyCFunction)cwr_sizeof,      METH_NOARGS,
+     sizeof_doc},
     {NULL,              NULL}   /* sentinel */
 };
 
@@ -3038,6 +3095,17 @@
     Py_TYPE(po)->tp_free(po);
 }
 
+static PyObject *
+permutations_sizeof(permutationsobject *po, void *unused)
+{
+    Py_ssize_t res;
+
+    res = sizeof(permutationsobject);
+    res += PyTuple_GET_SIZE(po->pool) * sizeof(Py_ssize_t);
+    res += po->r * sizeof(Py_ssize_t);
+    return PyLong_FromSsize_t(res);
+}
+
 static int
 permutations_traverse(permutationsobject *po, visitproc visit, void *arg)
 {
@@ -3243,6 +3311,8 @@
      reduce_doc},
     {"__setstate__",    (PyCFunction)permutations_setstate,    METH_O,
      setstate_doc},
+    {"__sizeof__",      (PyCFunction)permutations_sizeof,      METH_NOARGS,
+     sizeof_doc},
     {NULL,              NULL}   /* sentinel */
 };
 
@@ -4047,14 +4117,17 @@
 {
     repeatobject *ro;
     PyObject *element;
-    Py_ssize_t cnt = -1;
+    Py_ssize_t cnt = -1, n_kwds = 0;
     static char *kwargs[] = {"object", "times", NULL};
 
     if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|n:repeat", kwargs,
                                      &element, &cnt))
         return NULL;
 
-    if (PyTuple_Size(args) == 2 && cnt < 0)
+    if (kwds != NULL)
+        n_kwds = PyDict_Size(kwds);
+    /* Does user supply times argument? */
+    if ((PyTuple_Size(args) + n_kwds == 2) && cnt < 0)
         cnt = 0;
 
     ro = (repeatobject *)type->tp_alloc(type, 0);
diff --git a/Modules/main.c b/Modules/main.c
index 3cfc9c3..87a21d7 100644
--- a/Modules/main.c
+++ b/Modules/main.c
@@ -5,11 +5,6 @@
 
 #include <locale.h>
 
-#ifdef __VMS
-#error "PEP 11: VMS is now unsupported, code will be removed in Python 3.4"
-#include <unixlib.h>
-#endif
-
 #if defined(MS_WINDOWS) || defined(__CYGWIN__)
 #include <windows.h>
 #ifdef HAVE_FCNTL_H
@@ -22,15 +17,11 @@
 #include <crtdbg.h>
 #endif
 
-#if (defined(PYOS_OS2) && !defined(PYCC_GCC)) || defined(MS_WINDOWS)
+#if defined(MS_WINDOWS)
 #define PYTHONHOMEHELP "<prefix>\\lib"
 #else
-#if defined(PYOS_OS2) && defined(PYCC_GCC)
-#define PYTHONHOMEHELP "<prefix>/Lib"
-#else
 #define PYTHONHOMEHELP "<prefix>/pythonX.X"
 #endif
-#endif
 
 #include "pygetopt.h"
 
@@ -47,7 +38,7 @@
 static int  orig_argc;
 
 /* command line options */
-#define BASE_OPTS L"bBc:dEhiJm:OqRsStuvVW:xX:?"
+#define BASE_OPTS L"bBc:dEhiIJm:OqRsStuvVW:xX:?"
 
 #define PROGRAM_OPTS BASE_OPTS
 
@@ -69,6 +60,7 @@
 static char *usage_2 = "\
 -i     : inspect interactively after running script; forces a prompt even\n\
          if stdin does not appear to be a terminal; also PYTHONINSPECT=x\n\
+-I     : isolate Python from the user's environment (implies -E and -s)\n\
 -m mod : run library module as a script (terminates option list)\n\
 -O     : optimize generated bytecode slightly; also PYTHONOPTIMIZE=x\n\
 -OO    : remove doc-strings in addition to the -O optimizations\n\
@@ -127,26 +119,14 @@
         fprintf(f, usage_5, DELIM, PYTHONHOMEHELP);
         fputs(usage_6, f);
     }
-#if defined(__VMS)
-    if (exitcode == 0) {
-        /* suppress 'error' message */
-        return 1;
-    }
-    else {
-        /* STS$M_INHIB_MSG + SS$_ABORT */
-        return 0x1000002c;
-    }
-#else
     return exitcode;
-#endif
-    /*NOTREACHED*/
 }
 
 static void RunStartupFile(PyCompilerFlags *cf)
 {
     char *startup = Py_GETENV("PYTHONSTARTUP");
     if (startup != NULL && startup[0] != '\0') {
-        FILE *fp = fopen(startup, "r");
+        FILE *fp = _Py_fopen(startup, "r");
         if (fp != NULL) {
             (void) PyRun_SimpleFileExFlags(fp, startup, 0, cf);
             PyErr_Clear();
@@ -165,6 +145,32 @@
     }
 }
 
+static void RunInteractiveHook(void)
+{
+    PyObject *sys, *hook, *result;
+    sys = PyImport_ImportModule("sys");
+    if (sys == NULL)
+        goto error;
+    hook = PyObject_GetAttrString(sys, "__interactivehook__");
+    Py_DECREF(sys);
+    if (hook == NULL)
+        PyErr_Clear();
+    else {
+        result = PyObject_CallObject(hook, NULL);
+        Py_DECREF(hook);
+        if (result == NULL)
+            goto error;
+        else
+            Py_DECREF(result);
+    }
+    return;
+
+error:
+    PySys_WriteStderr("Failed calling sys.__interactivehook__\n");
+    PyErr_Print();
+    PyErr_Clear();
+}
+
 
 static int RunModule(wchar_t *modname, int set_argv0)
 {
@@ -172,17 +178,20 @@
     runpy = PyImport_ImportModule("runpy");
     if (runpy == NULL) {
         fprintf(stderr, "Could not import runpy module\n");
+        PyErr_Print();
         return -1;
     }
     runmodule = PyObject_GetAttrString(runpy, "_run_module_as_main");
     if (runmodule == NULL) {
         fprintf(stderr, "Could not access runpy._run_module_as_main\n");
+        PyErr_Print();
         Py_DECREF(runpy);
         return -1;
     }
     module = PyUnicode_FromWideChar(modname, wcslen(modname));
     if (module == NULL) {
         fprintf(stderr, "Could not convert module name to unicode\n");
+        PyErr_Print();
         Py_DECREF(runpy);
         Py_DECREF(runmodule);
         return -1;
@@ -191,6 +200,7 @@
     if (runargs == NULL) {
         fprintf(stderr,
             "Could not create arguments for runpy._run_module_as_main\n");
+        PyErr_Print();
         Py_DECREF(runpy);
         Py_DECREF(runmodule);
         Py_DECREF(module);
@@ -235,8 +245,10 @@
     /* argv0 is usable as an import source, so put it in sys.path[0]
        and import __main__ */
     sys_path = PySys_GetObject("path");
-    if (sys_path == NULL)
+    if (sys_path == NULL) {
+        PyErr_SetString(PyExc_RuntimeError, "unable to get sys.path");
         goto error;
+    }
     if (PyList_SetItem(sys_path, 0, argv0)) {
         argv0 = NULL;
         goto error;
@@ -366,7 +378,7 @@
                command to interpret. */
 
             len = wcslen(_PyOS_optarg) + 1 + 1;
-            command = (wchar_t *)malloc(sizeof(wchar_t) * len);
+            command = (wchar_t *)PyMem_RawMalloc(sizeof(wchar_t) * len);
             if (command == NULL)
                 Py_FatalError(
                    "not enough memory to copy -c argument");
@@ -398,6 +410,12 @@
             Py_InteractiveFlag++;
             break;
 
+        case 'I':
+            Py_IsolatedFlag++;
+            Py_NoUserSiteDirectory++;
+            Py_IgnoreEnvironmentFlag++;
+            break;
+
         /* case 'J': reserved for Jython */
 
         case 'O':
@@ -475,7 +493,7 @@
         return usage(0, argv[0]);
 
     if (version) {
-        fprintf(stderr, "Python %s\n", PY_VERSION);
+        printf("Python %s\n", PY_VERSION);
         return 0;
     }
 
@@ -495,7 +513,7 @@
         *wp != L'\0') {
         wchar_t *buf, *warning;
 
-        buf = (wchar_t *)malloc((wcslen(wp) + 1) * sizeof(wchar_t));
+        buf = (wchar_t *)PyMem_RawMalloc((wcslen(wp) + 1) * sizeof(wchar_t));
         if (buf == NULL)
             Py_FatalError(
                "not enough memory to copy PYTHONWARNINGS");
@@ -505,7 +523,7 @@
              warning = wcstok(NULL, L",")) {
             PySys_AddWarnOption(warning);
         }
-        free(buf);
+        PyMem_RawFree(buf);
     }
 #else
     if ((p = Py_GETENV("PYTHONWARNINGS")) && *p != '\0') {
@@ -514,12 +532,12 @@
 
         /* settle for strtok here as there's no one standard
            C89 wcstok */
-        buf = (char *)malloc(strlen(p) + 1);
+        buf = (char *)PyMem_RawMalloc(strlen(p) + 1);
         if (buf == NULL)
             Py_FatalError(
                "not enough memory to copy PYTHONWARNINGS");
         strcpy(buf, p);
-        oldloc = strdup(setlocale(LC_ALL, NULL));
+        oldloc = _PyMem_RawStrdup(setlocale(LC_ALL, NULL));
         setlocale(LC_ALL, "");
         for (p = strtok(buf, ","); p != NULL; p = strtok(NULL, ",")) {
 #ifdef __APPLE__
@@ -537,22 +555,15 @@
             Py_DECREF(unicode);
         }
         setlocale(LC_ALL, oldloc);
-        free(oldloc);
-        free(buf);
+        PyMem_RawFree(oldloc);
+        PyMem_RawFree(buf);
     }
 #endif
 
     if (command == NULL && module == NULL && _PyOS_optind < argc &&
         wcscmp(argv[_PyOS_optind], L"-") != 0)
     {
-#ifdef __VMS
-        filename = decc$translate_vms(argv[_PyOS_optind]);
-        if (filename == (char *)0 || filename == (char *)-1)
-            filename = argv[_PyOS_optind];
-
-#else
         filename = argv[_PyOS_optind];
-#endif
     }
 
     stdin_is_interactive = Py_FdIsInteractive(stdin, (char *)0);
@@ -588,11 +599,6 @@
 #endif /* !MS_WINDOWS */
         /* Leave stderr alone - it should be unbuffered anyway. */
     }
-#ifdef __VMS
-    else {
-        setvbuf (stdout, (char *)NULL, _IOLBF, BUFSIZ);
-    }
-#endif /* __VMS */
 
 #ifdef __APPLE__
     /* On MacOS X, when the Python interpreter is embedded in an
@@ -608,7 +614,7 @@
         wchar_t* buffer;
         size_t len = strlen(p) + 1;
 
-        buffer = malloc(len * sizeof(wchar_t));
+        buffer = PyMem_RawMalloc(len * sizeof(wchar_t));
         if (buffer == NULL) {
             Py_FatalError(
                "not enough memory to copy PYTHONEXECUTABLE");
@@ -682,7 +688,7 @@
 
     if (command) {
         sts = run_command(command, &cf);
-        free(command);
+        PyMem_RawFree(command);
     } else if (module) {
         sts = (RunModule(module, 1) != 0);
     }
@@ -691,6 +697,7 @@
         if (filename == NULL && stdin_is_interactive) {
             Py_InspectFlag = 0; /* do exit on SystemExit */
             RunStartupFile(&cf);
+            RunInteractiveHook();
         }
         /* XXX */
 
@@ -756,6 +763,7 @@
     if (Py_InspectFlag && stdin_is_interactive &&
         (filename != NULL || command != NULL || module != NULL)) {
         Py_InspectFlag = 0;
+        RunInteractiveHook();
         /* XXX */
         sts = PyRun_AnyFileFlags(stdin, "<stdin>", &cf) != 0;
     }
diff --git a/Modules/makesetup b/Modules/makesetup
index 40dfa9d..8b5cc28 100755
--- a/Modules/makesetup
+++ b/Modules/makesetup
@@ -217,7 +217,7 @@
 			*) src='$(srcdir)/'"$srcdir/$src";;
 			esac
 			case $doconfig in
-			no)	cc="$cc \$(CCSHARED) \$(CFLAGS) \$(CPPFLAGS)";;
+			no)	cc="$cc \$(CCSHARED) \$(PY_CFLAGS) \$(PY_CPPFLAGS)";;
 			*)
 				cc="$cc \$(PY_CORE_CFLAGS)";;
 			esac
@@ -229,11 +229,7 @@
 		esac
 		for mod in $mods
 		do
-			case $objs in
-			*$mod.o*)	base=$mod;;
-			*)		base=${mod}module;;
-			esac
-			file="$srcdir/$base\$(SO)"
+			file="$srcdir/$mod\$(EXT_SUFFIX)"
 			case $doconfig in
 			no)	SHAREDMODS="$SHAREDMODS $file";;
 			esac
diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c
index 7f094ff..910d5ea 100644
--- a/Modules/mathmodule.c
+++ b/Modules/mathmodule.c
@@ -873,18 +873,18 @@
 FUNC1(acos, acos, 0,
       "acos(x)\n\nReturn the arc cosine (measured in radians) of x.")
 FUNC1(acosh, m_acosh, 0,
-      "acosh(x)\n\nReturn the hyperbolic arc cosine (measured in radians) of x.")
+      "acosh(x)\n\nReturn the inverse hyperbolic cosine of x.")
 FUNC1(asin, asin, 0,
       "asin(x)\n\nReturn the arc sine (measured in radians) of x.")
 FUNC1(asinh, m_asinh, 0,
-      "asinh(x)\n\nReturn the hyperbolic arc sine (measured in radians) of x.")
+      "asinh(x)\n\nReturn the inverse hyperbolic sine of x.")
 FUNC1(atan, atan, 0,
       "atan(x)\n\nReturn the arc tangent (measured in radians) of x.")
 FUNC2(atan2, m_atan2,
       "atan2(y, x)\n\nReturn the arc tangent (measured in radians) of y/x.\n"
       "Unlike atan(y/x), the signs of both x and y are considered.")
 FUNC1(atanh, m_atanh, 0,
-      "atanh(x)\n\nReturn the hyperbolic arc tangent (measured in radians) of x.")
+      "atanh(x)\n\nReturn the inverse hyperbolic tangent of x.")
 
 static PyObject * math_ceil(PyObject *self, PyObject *number) {
     _Py_IDENTIFIER(__ceil__);
diff --git a/Modules/md5module.c b/Modules/md5module.c
index 12e187c..5cb3d36 100644
--- a/Modules/md5module.c
+++ b/Modules/md5module.c
@@ -91,10 +91,6 @@
        (y)[3] = (unsigned char)(((x)>>24)&255); (y)[2] = (unsigned char)(((x)>>16)&255);   \
        (y)[1] = (unsigned char)(((x)>>8)&255); (y)[0] = (unsigned char)((x)&255); }
 
-#ifndef MIN
-   #define MIN(x, y) ( ((x)<(y))?(x):(y) )
-#endif
-
 
 /* MD5 macros */
 
@@ -244,9 +240,9 @@
            in             += MD5_BLOCKSIZE;
            inlen          -= MD5_BLOCKSIZE;
         } else {
-           n = MIN(inlen, (Py_ssize_t)(MD5_BLOCKSIZE - md5->curlen));
+           n = Py_MIN(inlen, (Py_ssize_t)(MD5_BLOCKSIZE - md5->curlen));
            memcpy(md5->buf + md5->curlen, in, (size_t)n);
-           md5->curlen    += n;
+           md5->curlen    += (MD5_INT32)n;
            in             += n;
            inlen          -= n;
            if (md5->curlen == MD5_BLOCKSIZE) {
@@ -443,7 +439,7 @@
 static PyObject *
 MD5_get_name(PyObject *self, void *closure)
 {
-    return PyUnicode_FromStringAndSize("MD5", 3);
+    return PyUnicode_FromStringAndSize("md5", 3);
 }
 
 static PyObject *
@@ -576,8 +572,17 @@
 PyMODINIT_FUNC
 PyInit__md5(void)
 {
+    PyObject *m;
+
     Py_TYPE(&MD5type) = &PyType_Type;
     if (PyType_Ready(&MD5type) < 0)
         return NULL;
-    return PyModule_Create(&_md5module);
+
+    m = PyModule_Create(&_md5module);
+    if (m == NULL)
+        return NULL;
+
+    Py_INCREF((PyObject *)&MD5type);
+    PyModule_AddObject(m, "MD5Type", (PyObject *)&MD5type);
+    return m;
 }
diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c
index 1107eb8..1371424 100644
--- a/Modules/mmapmodule.c
+++ b/Modules/mmapmodule.c
@@ -20,6 +20,7 @@
 
 #define PY_SSIZE_T_CLEAN
 #include <Python.h>
+#include "structmember.h"
 
 #ifndef MS_WINDOWS
 #define UNIX
@@ -108,6 +109,7 @@
     int fd;
 #endif
 
+    PyObject *weakreflist;
     access_mode access;
 } mmap_object;
 
@@ -134,6 +136,8 @@
     }
 #endif /* UNIX */
 
+    if (m_obj->weakreflist != NULL)
+        PyObject_ClearWeakRefs((PyObject *) m_obj);
     Py_TYPE(m_obj)->tp_free((PyObject*)m_obj);
 }
 
@@ -705,6 +709,19 @@
     return _PyObject_CallMethodId(self, &PyId_close, NULL);
 }
 
+#ifdef MS_WINDOWS
+static PyObject *
+mmap__sizeof__method(mmap_object *self, void *unused)
+{
+    Py_ssize_t res;
+
+    res = sizeof(mmap_object);
+    if (self->tagname)
+        res += strlen(self->tagname) + 1;
+    return PyLong_FromSsize_t(res);
+}
+#endif
+
 static struct PyMethodDef mmap_object_methods[] = {
     {"close",           (PyCFunction) mmap_close_method,        METH_NOARGS},
     {"find",            (PyCFunction) mmap_find_method,         METH_VARARGS},
@@ -722,6 +739,9 @@
     {"write_byte",      (PyCFunction) mmap_write_byte_method,   METH_VARARGS},
     {"__enter__",       (PyCFunction) mmap__enter__method,      METH_NOARGS},
     {"__exit__",        (PyCFunction) mmap__exit__method,       METH_VARARGS},
+#ifdef MS_WINDOWS
+    {"__sizeof__",      (PyCFunction) mmap__sizeof__method,     METH_NOARGS},
+#endif
     {NULL,         NULL}       /* sentinel */
 };
 
@@ -1032,7 +1052,7 @@
     0,                                          /* tp_traverse */
     0,                                          /* tp_clear */
     0,                                          /* tp_richcompare */
-    0,                                          /* tp_weaklistoffset */
+    offsetof(mmap_object, weakreflist),         /* tp_weaklistoffset */
     0,                                          /* tp_iter */
     0,                                          /* tp_iternext */
     mmap_object_methods,                        /* tp_methods */
@@ -1154,12 +1174,6 @@
         (void)fcntl(fd, F_FULLFSYNC);
 #endif
 #ifdef HAVE_FSTAT
-#  ifdef __VMS
-    /* on OpenVMS we must ensure that all bytes are written to the file */
-    if (fd != -1) {
-        fsync(fd);
-    }
-#  endif
     if (fd != -1 && fstat(fd, &st) == 0 && S_ISREG(st.st_mode)) {
         if (map_size == 0) {
             if (st.st_size == 0) {
@@ -1190,6 +1204,7 @@
     m_obj->data = NULL;
     m_obj->size = (size_t) map_size;
     m_obj->pos = (size_t) 0;
+    m_obj->weakreflist = NULL;
     m_obj->exports = 0;
     m_obj->offset = offset;
     if (fd == -1) {
@@ -1203,18 +1218,18 @@
         flags |= MAP_ANONYMOUS;
 #else
         /* SVR4 method to map anonymous memory is to open /dev/zero */
-        fd = devzero = open("/dev/zero", O_RDWR);
+        fd = devzero = _Py_open("/dev/zero", O_RDWR);
         if (devzero == -1) {
             Py_DECREF(m_obj);
             PyErr_SetFromErrno(PyExc_OSError);
             return NULL;
         }
 #endif
-    } else {
-        m_obj->fd = dup(fd);
+    }
+    else {
+        m_obj->fd = _Py_dup(fd);
         if (m_obj->fd == -1) {
             Py_DECREF(m_obj);
-            PyErr_SetFromErrno(PyExc_OSError);
             return NULL;
         }
     }
@@ -1394,6 +1409,7 @@
     /* set the initial position */
     m_obj->pos = (size_t) 0;
 
+    m_obj->weakreflist = NULL;
     m_obj->exports = 0;
     /* set the tag name */
     if (tagname != NULL && *tagname != '\0') {
diff --git a/Modules/ossaudiodev.c b/Modules/ossaudiodev.c
index 817e204..2d0dd09 100644
--- a/Modules/ossaudiodev.c
+++ b/Modules/ossaudiodev.c
@@ -115,7 +115,9 @@
        one open at a time.  This does *not* affect later I/O; OSS
        provides a special ioctl() for non-blocking read/write, which is
        exposed via oss_nonblock() below. */
-    if ((fd = open(devicename, imode|O_NONBLOCK)) == -1) {
+    fd = _Py_open(devicename, imode|O_NONBLOCK);
+
+    if (fd == -1) {
         PyErr_SetFromErrnoWithFilename(PyExc_IOError, devicename);
         return NULL;
     }
@@ -177,7 +179,8 @@
             devicename = "/dev/mixer";
     }
 
-    if ((fd = open(devicename, O_RDWR)) == -1) {
+    fd = _Py_open(devicename, O_RDWR);
+    if (fd == -1) {
         PyErr_SetFromErrnoWithFilename(PyExc_IOError, devicename);
         return NULL;
     }
@@ -245,7 +248,7 @@
     int arg;
 
     assert(strlen(fname) <= 30);
-    strcat(argfmt, fname);
+    strncat(argfmt, fname, 30);
     if (!PyArg_ParseTuple(args, argfmt, &arg))
         return NULL;
 
@@ -270,7 +273,7 @@
     int arg = 0;
 
     assert(strlen(fname) <= 30);
-    strcat(argfmt, fname);
+    strncat(argfmt, fname, 30);
     if (!PyArg_ParseTuple(args, argfmt, &arg))
         return NULL;
 
@@ -290,7 +293,7 @@
     int rv;
 
     assert(strlen(fname) <= 30);
-    strcat(argfmt, fname);
+    strncat(argfmt, fname, 30);
     if (!PyArg_ParseTuple(args, argfmt))
         return NULL;
 
@@ -891,7 +894,7 @@
     /* Aliases for backwards compatibility */
     { "flush",          (PyCFunction)oss_sync, METH_VARARGS },
 
-    /* Support for the context manager protocol */
+    /* Support for the context management protocol */
     { "__enter__",      oss_self, METH_NOARGS },
     { "__exit__",       oss_exit, METH_VARARGS },
 
@@ -903,7 +906,7 @@
     { "close",          (PyCFunction)oss_mixer_close, METH_NOARGS },
     { "fileno",         (PyCFunction)oss_mixer_fileno, METH_NOARGS },
 
-    /* Support for the context manager protocol */
+    /* Support for the context management protocol */
     { "__enter__",      oss_self, METH_NOARGS },
     { "__exit__",       oss_exit, METH_VARARGS },
 
diff --git a/Modules/overlapped.c b/Modules/overlapped.c
new file mode 100644
index 0000000..ef77c88
--- /dev/null
+++ b/Modules/overlapped.c
@@ -0,0 +1,1337 @@
+/*
+ * Support for overlapped IO
+ *
+ * Some code borrowed from Modules/_winapi.c of CPython
+ */
+
+/* XXX check overflow and DWORD <-> Py_ssize_t conversions
+   Check itemsize */
+
+#include "Python.h"
+#include "structmember.h"
+
+#define WINDOWS_LEAN_AND_MEAN
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#include <mswsock.h>
+
+#if defined(MS_WIN32) && !defined(MS_WIN64)
+#  define F_POINTER "k"
+#  define T_POINTER T_ULONG
+#else
+#  define F_POINTER "K"
+#  define T_POINTER T_ULONGLONG
+#endif
+
+#define F_HANDLE F_POINTER
+#define F_ULONG_PTR F_POINTER
+#define F_DWORD "k"
+#define F_BOOL "i"
+#define F_UINT "I"
+
+#define T_HANDLE T_POINTER
+
+enum {TYPE_NONE, TYPE_NOT_STARTED, TYPE_READ, TYPE_WRITE, TYPE_ACCEPT,
+      TYPE_CONNECT, TYPE_DISCONNECT, TYPE_CONNECT_NAMED_PIPE,
+      TYPE_WAIT_NAMED_PIPE_AND_CONNECT};
+
+typedef struct {
+    PyObject_HEAD
+    OVERLAPPED overlapped;
+    /* For convenience, we store the file handle too */
+    HANDLE handle;
+    /* Error returned by last method call */
+    DWORD error;
+    /* Type of operation */
+    DWORD type;
+    union {
+        /* Buffer used for reading: TYPE_READ and TYPE_ACCEPT */
+        PyObject *read_buffer;
+        /* Buffer used for writing: TYPE_WRITE */
+        Py_buffer write_buffer;
+    };
+} OverlappedObject;
+
+/*
+ * Map Windows error codes to subclasses of OSError
+ */
+
+static PyObject *
+SetFromWindowsErr(DWORD err)
+{
+    PyObject *exception_type;
+
+    if (err == 0)
+        err = GetLastError();
+    switch (err) {
+        case ERROR_CONNECTION_REFUSED:
+            exception_type = PyExc_ConnectionRefusedError;
+            break;
+        case ERROR_CONNECTION_ABORTED:
+            exception_type = PyExc_ConnectionAbortedError;
+            break;
+        default:
+            exception_type = PyExc_OSError;
+    }
+    return PyErr_SetExcFromWindowsErr(exception_type, err);
+}
+
+/*
+ * Some functions should be loaded at runtime
+ */
+
+static LPFN_ACCEPTEX Py_AcceptEx = NULL;
+static LPFN_CONNECTEX Py_ConnectEx = NULL;
+static LPFN_DISCONNECTEX Py_DisconnectEx = NULL;
+static BOOL (CALLBACK *Py_CancelIoEx)(HANDLE, LPOVERLAPPED) = NULL;
+
+#define GET_WSA_POINTER(s, x)                                           \
+    (SOCKET_ERROR != WSAIoctl(s, SIO_GET_EXTENSION_FUNCTION_POINTER,    \
+                              &Guid##x, sizeof(Guid##x), &Py_##x,       \
+                              sizeof(Py_##x), &dwBytes, NULL, NULL))
+
+static int
+initialize_function_pointers(void)
+{
+    GUID GuidAcceptEx = WSAID_ACCEPTEX;
+    GUID GuidConnectEx = WSAID_CONNECTEX;
+    GUID GuidDisconnectEx = WSAID_DISCONNECTEX;
+    HINSTANCE hKernel32;
+    SOCKET s;
+    DWORD dwBytes;
+
+    s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
+    if (s == INVALID_SOCKET) {
+        SetFromWindowsErr(WSAGetLastError());
+        return -1;
+    }
+
+    if (!GET_WSA_POINTER(s, AcceptEx) ||
+        !GET_WSA_POINTER(s, ConnectEx) ||
+        !GET_WSA_POINTER(s, DisconnectEx))
+    {
+        closesocket(s);
+        SetFromWindowsErr(WSAGetLastError());
+        return -1;
+    }
+
+    closesocket(s);
+
+    /* On WinXP we will have Py_CancelIoEx == NULL */
+    hKernel32 = GetModuleHandle("KERNEL32");
+    *(FARPROC *)&Py_CancelIoEx = GetProcAddress(hKernel32, "CancelIoEx");
+    return 0;
+}
+
+/*
+ * Completion port stuff
+ */
+
+PyDoc_STRVAR(
+    CreateIoCompletionPort_doc,
+    "CreateIoCompletionPort(handle, port, key, concurrency) -> port\n\n"
+    "Create a completion port or register a handle with a port.");
+
+static PyObject *
+overlapped_CreateIoCompletionPort(PyObject *self, PyObject *args)
+{
+    HANDLE FileHandle;
+    HANDLE ExistingCompletionPort;
+    ULONG_PTR CompletionKey;
+    DWORD NumberOfConcurrentThreads;
+    HANDLE ret;
+
+    if (!PyArg_ParseTuple(args, F_HANDLE F_HANDLE F_ULONG_PTR F_DWORD,
+                          &FileHandle, &ExistingCompletionPort, &CompletionKey,
+                          &NumberOfConcurrentThreads))
+        return NULL;
+
+    Py_BEGIN_ALLOW_THREADS
+    ret = CreateIoCompletionPort(FileHandle, ExistingCompletionPort,
+                                 CompletionKey, NumberOfConcurrentThreads);
+    Py_END_ALLOW_THREADS
+
+    if (ret == NULL)
+        return SetFromWindowsErr(0);
+    return Py_BuildValue(F_HANDLE, ret);
+}
+
+PyDoc_STRVAR(
+    GetQueuedCompletionStatus_doc,
+    "GetQueuedCompletionStatus(port, msecs) -> (err, bytes, key, address)\n\n"
+    "Get a message from completion port.  Wait for up to msecs milliseconds.");
+
+static PyObject *
+overlapped_GetQueuedCompletionStatus(PyObject *self, PyObject *args)
+{
+    HANDLE CompletionPort = NULL;
+    DWORD NumberOfBytes = 0;
+    ULONG_PTR CompletionKey = 0;
+    OVERLAPPED *Overlapped = NULL;
+    DWORD Milliseconds;
+    DWORD err;
+    BOOL ret;
+
+    if (!PyArg_ParseTuple(args, F_HANDLE F_DWORD,
+                          &CompletionPort, &Milliseconds))
+        return NULL;
+
+    Py_BEGIN_ALLOW_THREADS
+    ret = GetQueuedCompletionStatus(CompletionPort, &NumberOfBytes,
+                                    &CompletionKey, &Overlapped, Milliseconds);
+    Py_END_ALLOW_THREADS
+
+    err = ret ? ERROR_SUCCESS : GetLastError();
+    if (Overlapped == NULL) {
+        if (err == WAIT_TIMEOUT)
+            Py_RETURN_NONE;
+        else
+            return SetFromWindowsErr(err);
+    }
+    return Py_BuildValue(F_DWORD F_DWORD F_ULONG_PTR F_POINTER,
+                         err, NumberOfBytes, CompletionKey, Overlapped);
+}
+
+PyDoc_STRVAR(
+    PostQueuedCompletionStatus_doc,
+    "PostQueuedCompletionStatus(port, bytes, key, address) -> None\n\n"
+    "Post a message to completion port.");
+
+static PyObject *
+overlapped_PostQueuedCompletionStatus(PyObject *self, PyObject *args)
+{
+    HANDLE CompletionPort;
+    DWORD NumberOfBytes;
+    ULONG_PTR CompletionKey;
+    OVERLAPPED *Overlapped;
+    BOOL ret;
+
+    if (!PyArg_ParseTuple(args, F_HANDLE F_DWORD F_ULONG_PTR F_POINTER,
+                          &CompletionPort, &NumberOfBytes, &CompletionKey,
+                          &Overlapped))
+        return NULL;
+
+    Py_BEGIN_ALLOW_THREADS
+    ret = PostQueuedCompletionStatus(CompletionPort, NumberOfBytes,
+                                     CompletionKey, Overlapped);
+    Py_END_ALLOW_THREADS
+
+    if (!ret)
+        return SetFromWindowsErr(0);
+    Py_RETURN_NONE;
+}
+
+/*
+ * Wait for a handle
+ */
+
+struct PostCallbackData {
+    HANDLE CompletionPort;
+    LPOVERLAPPED Overlapped;
+};
+
+static VOID CALLBACK
+PostToQueueCallback(PVOID lpParameter, BOOL TimerOrWaitFired)
+{
+    struct PostCallbackData *p = (struct PostCallbackData*) lpParameter;
+
+    PostQueuedCompletionStatus(p->CompletionPort, TimerOrWaitFired,
+                               0, p->Overlapped);
+    /* ignore possible error! */
+    PyMem_Free(p);
+}
+
+PyDoc_STRVAR(
+    RegisterWaitWithQueue_doc,
+    "RegisterWaitWithQueue(Object, CompletionPort, Overlapped, Timeout)\n"
+    "    -> WaitHandle\n\n"
+    "Register wait for Object; when complete CompletionPort is notified.\n");
+
+static PyObject *
+overlapped_RegisterWaitWithQueue(PyObject *self, PyObject *args)
+{
+    HANDLE NewWaitObject;
+    HANDLE Object;
+    ULONG Milliseconds;
+    struct PostCallbackData data, *pdata;
+
+    if (!PyArg_ParseTuple(args, F_HANDLE F_HANDLE F_POINTER F_DWORD,
+                          &Object,
+                          &data.CompletionPort,
+                          &data.Overlapped,
+                          &Milliseconds))
+        return NULL;
+
+    pdata = PyMem_Malloc(sizeof(struct PostCallbackData));
+    if (pdata == NULL)
+        return SetFromWindowsErr(0);
+
+    *pdata = data;
+
+    if (!RegisterWaitForSingleObject(
+            &NewWaitObject, Object, (WAITORTIMERCALLBACK)PostToQueueCallback,
+            pdata, Milliseconds,
+            WT_EXECUTEINWAITTHREAD | WT_EXECUTEONLYONCE))
+    {
+        PyMem_Free(pdata);
+        return SetFromWindowsErr(0);
+    }
+
+    return Py_BuildValue(F_HANDLE, NewWaitObject);
+}
+
+PyDoc_STRVAR(
+    UnregisterWait_doc,
+    "UnregisterWait(WaitHandle) -> None\n\n"
+    "Unregister wait handle.\n");
+
+static PyObject *
+overlapped_UnregisterWait(PyObject *self, PyObject *args)
+{
+    HANDLE WaitHandle;
+    BOOL ret;
+
+    if (!PyArg_ParseTuple(args, F_HANDLE, &WaitHandle))
+        return NULL;
+
+    Py_BEGIN_ALLOW_THREADS
+    ret = UnregisterWait(WaitHandle);
+    Py_END_ALLOW_THREADS
+
+    if (!ret)
+        return SetFromWindowsErr(0);
+    Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(
+    UnregisterWaitEx_doc,
+    "UnregisterWaitEx(WaitHandle, Event) -> None\n\n"
+    "Unregister wait handle.\n");
+
+static PyObject *
+overlapped_UnregisterWaitEx(PyObject *self, PyObject *args)
+{
+    HANDLE WaitHandle, Event;
+    BOOL ret;
+
+    if (!PyArg_ParseTuple(args, F_HANDLE F_HANDLE, &WaitHandle, &Event))
+        return NULL;
+
+    Py_BEGIN_ALLOW_THREADS
+    ret = UnregisterWaitEx(WaitHandle, Event);
+    Py_END_ALLOW_THREADS
+
+    if (!ret)
+        return SetFromWindowsErr(0);
+    Py_RETURN_NONE;
+}
+
+/*
+ * Event functions -- currently only used by tests
+ */
+
+PyDoc_STRVAR(
+    CreateEvent_doc,
+    "CreateEvent(EventAttributes, ManualReset, InitialState, Name)"
+    " -> Handle\n\n"
+    "Create an event.  EventAttributes must be None.\n");
+
+static PyObject *
+overlapped_CreateEvent(PyObject *self, PyObject *args)
+{
+    PyObject *EventAttributes;
+    BOOL ManualReset;
+    BOOL InitialState;
+    Py_UNICODE *Name;
+    HANDLE Event;
+
+    if (!PyArg_ParseTuple(args, "O" F_BOOL F_BOOL "Z",
+                          &EventAttributes, &ManualReset,
+                          &InitialState, &Name))
+        return NULL;
+
+    if (EventAttributes != Py_None) {
+        PyErr_SetString(PyExc_ValueError, "EventAttributes must be None");
+        return NULL;
+    }
+
+    Py_BEGIN_ALLOW_THREADS
+    Event = CreateEventW(NULL, ManualReset, InitialState, Name);
+    Py_END_ALLOW_THREADS
+
+    if (Event == NULL)
+        return SetFromWindowsErr(0);
+    return Py_BuildValue(F_HANDLE, Event);
+}
+
+PyDoc_STRVAR(
+    SetEvent_doc,
+    "SetEvent(Handle) -> None\n\n"
+    "Set event.\n");
+
+static PyObject *
+overlapped_SetEvent(PyObject *self, PyObject *args)
+{
+    HANDLE Handle;
+    BOOL ret;
+
+    if (!PyArg_ParseTuple(args, F_HANDLE, &Handle))
+        return NULL;
+
+    Py_BEGIN_ALLOW_THREADS
+    ret = SetEvent(Handle);
+    Py_END_ALLOW_THREADS
+
+    if (!ret)
+        return SetFromWindowsErr(0);
+    Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(
+    ResetEvent_doc,
+    "ResetEvent(Handle) -> None\n\n"
+    "Reset event.\n");
+
+static PyObject *
+overlapped_ResetEvent(PyObject *self, PyObject *args)
+{
+    HANDLE Handle;
+    BOOL ret;
+
+    if (!PyArg_ParseTuple(args, F_HANDLE, &Handle))
+        return NULL;
+
+    Py_BEGIN_ALLOW_THREADS
+    ret = ResetEvent(Handle);
+    Py_END_ALLOW_THREADS
+
+    if (!ret)
+        return SetFromWindowsErr(0);
+    Py_RETURN_NONE;
+}
+
+/*
+ * Bind socket handle to local port without doing slow getaddrinfo()
+ */
+
+PyDoc_STRVAR(
+    BindLocal_doc,
+    "BindLocal(handle, family) -> None\n\n"
+    "Bind a socket handle to an arbitrary local port.\n"
+    "family should AF_INET or AF_INET6.\n");
+
+static PyObject *
+overlapped_BindLocal(PyObject *self, PyObject *args)
+{
+    SOCKET Socket;
+    int Family;
+    BOOL ret;
+
+    if (!PyArg_ParseTuple(args, F_HANDLE "i", &Socket, &Family))
+        return NULL;
+
+    if (Family == AF_INET) {
+        struct sockaddr_in addr;
+        memset(&addr, 0, sizeof(addr));
+        addr.sin_family = AF_INET;
+        addr.sin_port = 0;
+        addr.sin_addr.S_un.S_addr = INADDR_ANY;
+        ret = bind(Socket, (SOCKADDR*)&addr, sizeof(addr)) != SOCKET_ERROR;
+    } else if (Family == AF_INET6) {
+        struct sockaddr_in6 addr;
+        memset(&addr, 0, sizeof(addr));
+        addr.sin6_family = AF_INET6;
+        addr.sin6_port = 0;
+        addr.sin6_addr = in6addr_any;
+        ret = bind(Socket, (SOCKADDR*)&addr, sizeof(addr)) != SOCKET_ERROR;
+    } else {
+        PyErr_SetString(PyExc_ValueError, "expected tuple of length 2 or 4");
+        return NULL;
+    }
+
+    if (!ret)
+        return SetFromWindowsErr(WSAGetLastError());
+    Py_RETURN_NONE;
+}
+
+/*
+ * Windows equivalent of os.strerror() -- compare _ctypes/callproc.c
+ */
+
+PyDoc_STRVAR(
+    FormatMessage_doc,
+    "FormatMessage(error_code) -> error_message\n\n"
+    "Return error message for an error code.");
+
+static PyObject *
+overlapped_FormatMessage(PyObject *ignore, PyObject *args)
+{
+    DWORD code, n;
+    WCHAR *lpMsgBuf;
+    PyObject *res;
+
+    if (!PyArg_ParseTuple(args, F_DWORD, &code))
+        return NULL;
+
+    n = FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER |
+                       FORMAT_MESSAGE_FROM_SYSTEM,
+                       NULL,
+                       code,
+                       MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+                       (LPWSTR) &lpMsgBuf,
+                       0,
+                       NULL);
+    if (n) {
+        while (iswspace(lpMsgBuf[n-1]))
+            --n;
+        lpMsgBuf[n] = L'\0';
+        res = Py_BuildValue("u", lpMsgBuf);
+    } else {
+        res = PyUnicode_FromFormat("unknown error code %u", code);
+    }
+    LocalFree(lpMsgBuf);
+    return res;
+}
+
+
+/*
+ * Mark operation as completed - used when reading produces ERROR_BROKEN_PIPE
+ */
+
+static void
+mark_as_completed(OVERLAPPED *ov)
+{
+    ov->Internal = 0;
+    if (ov->hEvent != NULL)
+        SetEvent(ov->hEvent);
+}
+
+/*
+ * A Python object wrapping an OVERLAPPED structure and other useful data
+ * for overlapped I/O
+ */
+
+PyDoc_STRVAR(
+    Overlapped_doc,
+    "Overlapped object");
+
+static PyObject *
+Overlapped_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    OverlappedObject *self;
+    HANDLE event = INVALID_HANDLE_VALUE;
+    static char *kwlist[] = {"event", NULL};
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwds, "|" F_HANDLE, kwlist, &event))
+        return NULL;
+
+    if (event == INVALID_HANDLE_VALUE) {
+        event = CreateEvent(NULL, TRUE, FALSE, NULL);
+        if (event == NULL)
+            return SetFromWindowsErr(0);
+    }
+
+    self = PyObject_New(OverlappedObject, type);
+    if (self == NULL) {
+        if (event != NULL)
+            CloseHandle(event);
+        return NULL;
+    }
+
+    self->handle = NULL;
+    self->error = 0;
+    self->type = TYPE_NONE;
+    self->read_buffer = NULL;
+    memset(&self->overlapped, 0, sizeof(OVERLAPPED));
+    memset(&self->write_buffer, 0, sizeof(Py_buffer));
+    if (event)
+        self->overlapped.hEvent = event;
+    return (PyObject *)self;
+}
+
+static void
+Overlapped_dealloc(OverlappedObject *self)
+{
+    DWORD bytes;
+    DWORD olderr = GetLastError();
+    BOOL wait = FALSE;
+    BOOL ret;
+
+    if (!HasOverlappedIoCompleted(&self->overlapped) &&
+        self->type != TYPE_NOT_STARTED)
+    {
+        if (Py_CancelIoEx && Py_CancelIoEx(self->handle, &self->overlapped))
+            wait = TRUE;
+
+        Py_BEGIN_ALLOW_THREADS
+        ret = GetOverlappedResult(self->handle, &self->overlapped,
+                                  &bytes, wait);
+        Py_END_ALLOW_THREADS
+
+        switch (ret ? ERROR_SUCCESS : GetLastError()) {
+            case ERROR_SUCCESS:
+            case ERROR_NOT_FOUND:
+            case ERROR_OPERATION_ABORTED:
+                break;
+            default:
+                PyErr_Format(
+                    PyExc_RuntimeError,
+                    "%R still has pending operation at "
+                    "deallocation, the process may crash", self);
+                PyErr_WriteUnraisable(NULL);
+        }
+    }
+
+    if (self->overlapped.hEvent != NULL)
+        CloseHandle(self->overlapped.hEvent);
+
+    switch (self->type) {
+    case TYPE_READ:
+    case TYPE_ACCEPT:
+        Py_CLEAR(self->read_buffer);
+        break;
+    case TYPE_WRITE:
+        if (self->write_buffer.obj)
+            PyBuffer_Release(&self->write_buffer);
+        break;
+    }
+    PyObject_Del(self);
+    SetLastError(olderr);
+}
+
+PyDoc_STRVAR(
+    Overlapped_cancel_doc,
+    "cancel() -> None\n\n"
+    "Cancel overlapped operation");
+
+static PyObject *
+Overlapped_cancel(OverlappedObject *self)
+{
+    BOOL ret = TRUE;
+
+    if (self->type == TYPE_NOT_STARTED
+        || self->type == TYPE_WAIT_NAMED_PIPE_AND_CONNECT)
+        Py_RETURN_NONE;
+
+    if (!HasOverlappedIoCompleted(&self->overlapped)) {
+        Py_BEGIN_ALLOW_THREADS
+        if (Py_CancelIoEx)
+            ret = Py_CancelIoEx(self->handle, &self->overlapped);
+        else
+            ret = CancelIo(self->handle);
+        Py_END_ALLOW_THREADS
+    }
+
+    /* CancelIoEx returns ERROR_NOT_FOUND if the I/O completed in-between */
+    if (!ret && GetLastError() != ERROR_NOT_FOUND)
+        return SetFromWindowsErr(0);
+    Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(
+    Overlapped_getresult_doc,
+    "getresult(wait=False) -> result\n\n"
+    "Retrieve result of operation.  If wait is true then it blocks\n"
+    "until the operation is finished.  If wait is false and the\n"
+    "operation is still pending then an error is raised.");
+
+static PyObject *
+Overlapped_getresult(OverlappedObject *self, PyObject *args)
+{
+    BOOL wait = FALSE;
+    DWORD transferred = 0;
+    BOOL ret;
+    DWORD err;
+
+    if (!PyArg_ParseTuple(args, "|" F_BOOL, &wait))
+        return NULL;
+
+    if (self->type == TYPE_NONE) {
+        PyErr_SetString(PyExc_ValueError, "operation not yet attempted");
+        return NULL;
+    }
+
+    if (self->type == TYPE_NOT_STARTED) {
+        PyErr_SetString(PyExc_ValueError, "operation failed to start");
+        return NULL;
+    }
+
+    Py_BEGIN_ALLOW_THREADS
+    ret = GetOverlappedResult(self->handle, &self->overlapped, &transferred,
+                              wait);
+    Py_END_ALLOW_THREADS
+
+    self->error = err = ret ? ERROR_SUCCESS : GetLastError();
+    switch (err) {
+        case ERROR_SUCCESS:
+        case ERROR_MORE_DATA:
+            break;
+        case ERROR_BROKEN_PIPE:
+            if ((self->type == TYPE_READ || self->type == TYPE_ACCEPT) && self->read_buffer != NULL)
+                break;
+            /* fall through */
+        default:
+            return SetFromWindowsErr(err);
+    }
+
+    switch (self->type) {
+        case TYPE_READ:
+            assert(PyBytes_CheckExact(self->read_buffer));
+            if (transferred != PyBytes_GET_SIZE(self->read_buffer) &&
+                _PyBytes_Resize(&self->read_buffer, transferred))
+                return NULL;
+            Py_INCREF(self->read_buffer);
+            return self->read_buffer;
+        default:
+            return PyLong_FromUnsignedLong((unsigned long) transferred);
+    }
+}
+
+PyDoc_STRVAR(
+    Overlapped_ReadFile_doc,
+    "ReadFile(handle, size) -> Overlapped[message]\n\n"
+    "Start overlapped read");
+
+static PyObject *
+Overlapped_ReadFile(OverlappedObject *self, PyObject *args)
+{
+    HANDLE handle;
+    DWORD size;
+    DWORD nread;
+    PyObject *buf;
+    BOOL ret;
+    DWORD err;
+
+    if (!PyArg_ParseTuple(args, F_HANDLE F_DWORD, &handle, &size))
+        return NULL;
+
+    if (self->type != TYPE_NONE) {
+        PyErr_SetString(PyExc_ValueError, "operation already attempted");
+        return NULL;
+    }
+
+#if SIZEOF_SIZE_T <= SIZEOF_LONG
+    size = Py_MIN(size, (DWORD)PY_SSIZE_T_MAX);
+#endif
+    buf = PyBytes_FromStringAndSize(NULL, Py_MAX(size, 1));
+    if (buf == NULL)
+        return NULL;
+
+    self->type = TYPE_READ;
+    self->handle = handle;
+    self->read_buffer = buf;
+
+    Py_BEGIN_ALLOW_THREADS
+    ret = ReadFile(handle, PyBytes_AS_STRING(buf), size, &nread,
+                   &self->overlapped);
+    Py_END_ALLOW_THREADS
+
+    self->error = err = ret ? ERROR_SUCCESS : GetLastError();
+    switch (err) {
+        case ERROR_BROKEN_PIPE:
+            mark_as_completed(&self->overlapped);
+            return SetFromWindowsErr(err);
+        case ERROR_SUCCESS:
+        case ERROR_MORE_DATA:
+        case ERROR_IO_PENDING:
+            Py_RETURN_NONE;
+        default:
+            self->type = TYPE_NOT_STARTED;
+            return SetFromWindowsErr(err);
+    }
+}
+
+PyDoc_STRVAR(
+    Overlapped_WSARecv_doc,
+    "RecvFile(handle, size, flags) -> Overlapped[message]\n\n"
+    "Start overlapped receive");
+
+static PyObject *
+Overlapped_WSARecv(OverlappedObject *self, PyObject *args)
+{
+    HANDLE handle;
+    DWORD size;
+    DWORD flags = 0;
+    DWORD nread;
+    PyObject *buf;
+    WSABUF wsabuf;
+    int ret;
+    DWORD err;
+
+    if (!PyArg_ParseTuple(args, F_HANDLE F_DWORD "|" F_DWORD,
+                          &handle, &size, &flags))
+        return NULL;
+
+    if (self->type != TYPE_NONE) {
+        PyErr_SetString(PyExc_ValueError, "operation already attempted");
+        return NULL;
+    }
+
+#if SIZEOF_SIZE_T <= SIZEOF_LONG
+    size = Py_MIN(size, (DWORD)PY_SSIZE_T_MAX);
+#endif
+    buf = PyBytes_FromStringAndSize(NULL, Py_MAX(size, 1));
+    if (buf == NULL)
+        return NULL;
+
+    self->type = TYPE_READ;
+    self->handle = handle;
+    self->read_buffer = buf;
+    wsabuf.len = size;
+    wsabuf.buf = PyBytes_AS_STRING(buf);
+
+    Py_BEGIN_ALLOW_THREADS
+    ret = WSARecv((SOCKET)handle, &wsabuf, 1, &nread, &flags,
+                  &self->overlapped, NULL);
+    Py_END_ALLOW_THREADS
+
+    self->error = err = (ret < 0 ? WSAGetLastError() : ERROR_SUCCESS);
+    switch (err) {
+        case ERROR_BROKEN_PIPE:
+            mark_as_completed(&self->overlapped);
+            return SetFromWindowsErr(err);
+        case ERROR_SUCCESS:
+        case ERROR_MORE_DATA:
+        case ERROR_IO_PENDING:
+            Py_RETURN_NONE;
+        default:
+            self->type = TYPE_NOT_STARTED;
+            return SetFromWindowsErr(err);
+    }
+}
+
+PyDoc_STRVAR(
+    Overlapped_WriteFile_doc,
+    "WriteFile(handle, buf) -> Overlapped[bytes_transferred]\n\n"
+    "Start overlapped write");
+
+static PyObject *
+Overlapped_WriteFile(OverlappedObject *self, PyObject *args)
+{
+    HANDLE handle;
+    PyObject *bufobj;
+    DWORD written;
+    BOOL ret;
+    DWORD err;
+
+    if (!PyArg_ParseTuple(args, F_HANDLE "O", &handle, &bufobj))
+        return NULL;
+
+    if (self->type != TYPE_NONE) {
+        PyErr_SetString(PyExc_ValueError, "operation already attempted");
+        return NULL;
+    }
+
+    if (!PyArg_Parse(bufobj, "y*", &self->write_buffer))
+        return NULL;
+
+#if SIZEOF_SIZE_T > SIZEOF_LONG
+    if (self->write_buffer.len > (Py_ssize_t)ULONG_MAX) {
+        PyBuffer_Release(&self->write_buffer);
+        PyErr_SetString(PyExc_ValueError, "buffer to large");
+        return NULL;
+    }
+#endif
+
+    self->type = TYPE_WRITE;
+    self->handle = handle;
+
+    Py_BEGIN_ALLOW_THREADS
+    ret = WriteFile(handle, self->write_buffer.buf,
+                    (DWORD)self->write_buffer.len,
+                    &written, &self->overlapped);
+    Py_END_ALLOW_THREADS
+
+    self->error = err = ret ? ERROR_SUCCESS : GetLastError();
+    switch (err) {
+        case ERROR_SUCCESS:
+        case ERROR_IO_PENDING:
+            Py_RETURN_NONE;
+        default:
+            self->type = TYPE_NOT_STARTED;
+            return SetFromWindowsErr(err);
+    }
+}
+
+PyDoc_STRVAR(
+    Overlapped_WSASend_doc,
+    "WSASend(handle, buf, flags) -> Overlapped[bytes_transferred]\n\n"
+    "Start overlapped send");
+
+static PyObject *
+Overlapped_WSASend(OverlappedObject *self, PyObject *args)
+{
+    HANDLE handle;
+    PyObject *bufobj;
+    DWORD flags;
+    DWORD written;
+    WSABUF wsabuf;
+    int ret;
+    DWORD err;
+
+    if (!PyArg_ParseTuple(args, F_HANDLE "O" F_DWORD,
+                          &handle, &bufobj, &flags))
+        return NULL;
+
+    if (self->type != TYPE_NONE) {
+        PyErr_SetString(PyExc_ValueError, "operation already attempted");
+        return NULL;
+    }
+
+    if (!PyArg_Parse(bufobj, "y*", &self->write_buffer))
+        return NULL;
+
+#if SIZEOF_SIZE_T > SIZEOF_LONG
+    if (self->write_buffer.len > (Py_ssize_t)ULONG_MAX) {
+        PyBuffer_Release(&self->write_buffer);
+        PyErr_SetString(PyExc_ValueError, "buffer to large");
+        return NULL;
+    }
+#endif
+
+    self->type = TYPE_WRITE;
+    self->handle = handle;
+    wsabuf.len = (DWORD)self->write_buffer.len;
+    wsabuf.buf = self->write_buffer.buf;
+
+    Py_BEGIN_ALLOW_THREADS
+    ret = WSASend((SOCKET)handle, &wsabuf, 1, &written, flags,
+                  &self->overlapped, NULL);
+    Py_END_ALLOW_THREADS
+
+    self->error = err = (ret < 0 ? WSAGetLastError() : ERROR_SUCCESS);
+    switch (err) {
+        case ERROR_SUCCESS:
+        case ERROR_IO_PENDING:
+            Py_RETURN_NONE;
+        default:
+            self->type = TYPE_NOT_STARTED;
+            return SetFromWindowsErr(err);
+    }
+}
+
+PyDoc_STRVAR(
+    Overlapped_AcceptEx_doc,
+    "AcceptEx(listen_handle, accept_handle) -> Overlapped[address_as_bytes]\n\n"
+    "Start overlapped wait for client to connect");
+
+static PyObject *
+Overlapped_AcceptEx(OverlappedObject *self, PyObject *args)
+{
+    SOCKET ListenSocket;
+    SOCKET AcceptSocket;
+    DWORD BytesReceived;
+    DWORD size;
+    PyObject *buf;
+    BOOL ret;
+    DWORD err;
+
+    if (!PyArg_ParseTuple(args, F_HANDLE F_HANDLE,
+                          &ListenSocket, &AcceptSocket))
+        return NULL;
+
+    if (self->type != TYPE_NONE) {
+        PyErr_SetString(PyExc_ValueError, "operation already attempted");
+        return NULL;
+    }
+
+    size = sizeof(struct sockaddr_in6) + 16;
+    buf = PyBytes_FromStringAndSize(NULL, size*2);
+    if (!buf)
+        return NULL;
+
+    self->type = TYPE_ACCEPT;
+    self->handle = (HANDLE)ListenSocket;
+    self->read_buffer = buf;
+
+    Py_BEGIN_ALLOW_THREADS
+    ret = Py_AcceptEx(ListenSocket, AcceptSocket, PyBytes_AS_STRING(buf),
+                      0, size, size, &BytesReceived, &self->overlapped);
+    Py_END_ALLOW_THREADS
+
+    self->error = err = ret ? ERROR_SUCCESS : WSAGetLastError();
+    switch (err) {
+        case ERROR_SUCCESS:
+        case ERROR_IO_PENDING:
+            Py_RETURN_NONE;
+        default:
+            self->type = TYPE_NOT_STARTED;
+            return SetFromWindowsErr(err);
+    }
+}
+
+
+static int
+parse_address(PyObject *obj, SOCKADDR *Address, int Length)
+{
+    char *Host;
+    unsigned short Port;
+    unsigned long FlowInfo;
+    unsigned long ScopeId;
+
+    memset(Address, 0, Length);
+
+    if (PyArg_ParseTuple(obj, "sH", &Host, &Port))
+    {
+        Address->sa_family = AF_INET;
+        if (WSAStringToAddressA(Host, AF_INET, NULL, Address, &Length) < 0) {
+            SetFromWindowsErr(WSAGetLastError());
+            return -1;
+        }
+        ((SOCKADDR_IN*)Address)->sin_port = htons(Port);
+        return Length;
+    }
+    else if (PyArg_ParseTuple(obj, "sHkk", &Host, &Port, &FlowInfo, &ScopeId))
+    {
+        PyErr_Clear();
+        Address->sa_family = AF_INET6;
+        if (WSAStringToAddressA(Host, AF_INET6, NULL, Address, &Length) < 0) {
+            SetFromWindowsErr(WSAGetLastError());
+            return -1;
+        }
+        ((SOCKADDR_IN6*)Address)->sin6_port = htons(Port);
+        ((SOCKADDR_IN6*)Address)->sin6_flowinfo = FlowInfo;
+        ((SOCKADDR_IN6*)Address)->sin6_scope_id = ScopeId;
+        return Length;
+    }
+
+    return -1;
+}
+
+
+PyDoc_STRVAR(
+    Overlapped_ConnectEx_doc,
+    "ConnectEx(client_handle, address_as_bytes) -> Overlapped[None]\n\n"
+    "Start overlapped connect.  client_handle should be unbound.");
+
+static PyObject *
+Overlapped_ConnectEx(OverlappedObject *self, PyObject *args)
+{
+    SOCKET ConnectSocket;
+    PyObject *AddressObj;
+    char AddressBuf[sizeof(struct sockaddr_in6)];
+    SOCKADDR *Address = (SOCKADDR*)AddressBuf;
+    int Length;
+    BOOL ret;
+    DWORD err;
+
+    if (!PyArg_ParseTuple(args, F_HANDLE "O", &ConnectSocket, &AddressObj))
+        return NULL;
+
+    if (self->type != TYPE_NONE) {
+        PyErr_SetString(PyExc_ValueError, "operation already attempted");
+        return NULL;
+    }
+
+    Length = sizeof(AddressBuf);
+    Length = parse_address(AddressObj, Address, Length);
+    if (Length < 0)
+        return NULL;
+
+    self->type = TYPE_CONNECT;
+    self->handle = (HANDLE)ConnectSocket;
+
+    Py_BEGIN_ALLOW_THREADS
+    ret = Py_ConnectEx(ConnectSocket, Address, Length,
+                       NULL, 0, NULL, &self->overlapped);
+    Py_END_ALLOW_THREADS
+
+    self->error = err = ret ? ERROR_SUCCESS : WSAGetLastError();
+    switch (err) {
+        case ERROR_SUCCESS:
+        case ERROR_IO_PENDING:
+            Py_RETURN_NONE;
+        default:
+            self->type = TYPE_NOT_STARTED;
+            return SetFromWindowsErr(err);
+    }
+}
+
+PyDoc_STRVAR(
+    Overlapped_DisconnectEx_doc,
+    "DisconnectEx(handle, flags) -> Overlapped[None]\n\n"
+    "Start overlapped connect.  client_handle should be unbound.");
+
+static PyObject *
+Overlapped_DisconnectEx(OverlappedObject *self, PyObject *args)
+{
+    SOCKET Socket;
+    DWORD flags;
+    BOOL ret;
+    DWORD err;
+
+    if (!PyArg_ParseTuple(args, F_HANDLE F_DWORD, &Socket, &flags))
+        return NULL;
+
+    if (self->type != TYPE_NONE) {
+        PyErr_SetString(PyExc_ValueError, "operation already attempted");
+        return NULL;
+    }
+
+    self->type = TYPE_DISCONNECT;
+    self->handle = (HANDLE)Socket;
+
+    Py_BEGIN_ALLOW_THREADS
+    ret = Py_DisconnectEx(Socket, &self->overlapped, flags, 0);
+    Py_END_ALLOW_THREADS
+
+    self->error = err = ret ? ERROR_SUCCESS : WSAGetLastError();
+    switch (err) {
+        case ERROR_SUCCESS:
+        case ERROR_IO_PENDING:
+            Py_RETURN_NONE;
+        default:
+            self->type = TYPE_NOT_STARTED;
+            return SetFromWindowsErr(err);
+    }
+}
+
+PyDoc_STRVAR(
+    Overlapped_ConnectNamedPipe_doc,
+    "ConnectNamedPipe(handle) -> Overlapped[None]\n\n"
+    "Start overlapped wait for a client to connect.");
+
+static PyObject *
+Overlapped_ConnectNamedPipe(OverlappedObject *self, PyObject *args)
+{
+    HANDLE Pipe;
+    BOOL ret;
+    DWORD err;
+
+    if (!PyArg_ParseTuple(args, F_HANDLE, &Pipe))
+        return NULL;
+
+    if (self->type != TYPE_NONE) {
+        PyErr_SetString(PyExc_ValueError, "operation already attempted");
+        return NULL;
+    }
+
+    self->type = TYPE_CONNECT_NAMED_PIPE;
+    self->handle = Pipe;
+
+    Py_BEGIN_ALLOW_THREADS
+    ret = ConnectNamedPipe(Pipe, &self->overlapped);
+    Py_END_ALLOW_THREADS
+
+    self->error = err = ret ? ERROR_SUCCESS : GetLastError();
+    switch (err) {
+        case ERROR_PIPE_CONNECTED:
+            mark_as_completed(&self->overlapped);
+            Py_RETURN_TRUE;
+        case ERROR_SUCCESS:
+        case ERROR_IO_PENDING:
+            Py_RETURN_FALSE;
+        default:
+            self->type = TYPE_NOT_STARTED;
+            return SetFromWindowsErr(err);
+    }
+}
+
+PyDoc_STRVAR(
+    ConnectPipe_doc,
+    "ConnectPipe(addr) -> pipe_handle\n\n"
+    "Connect to the pipe for asynchronous I/O (overlapped).");
+
+static PyObject *
+ConnectPipe(OverlappedObject *self, PyObject *args)
+{
+    PyObject *AddressObj;
+    wchar_t *Address;
+    HANDLE PipeHandle;
+
+    if (!PyArg_ParseTuple(args, "U",  &AddressObj))
+        return NULL;
+
+    Address = PyUnicode_AsWideCharString(AddressObj, NULL);
+    if (Address == NULL)
+        return NULL;
+
+    Py_BEGIN_ALLOW_THREADS
+    PipeHandle = CreateFileW(Address,
+                             GENERIC_READ | GENERIC_WRITE,
+                             0, NULL, OPEN_EXISTING,
+                             FILE_FLAG_OVERLAPPED, NULL);
+    Py_END_ALLOW_THREADS
+
+    PyMem_Free(Address);
+    if (PipeHandle == INVALID_HANDLE_VALUE)
+        return SetFromWindowsErr(0);
+    return Py_BuildValue(F_HANDLE, PipeHandle);
+}
+
+static PyObject*
+Overlapped_getaddress(OverlappedObject *self)
+{
+    return PyLong_FromVoidPtr(&self->overlapped);
+}
+
+static PyObject*
+Overlapped_getpending(OverlappedObject *self)
+{
+    return PyBool_FromLong(!HasOverlappedIoCompleted(&self->overlapped) &&
+                           self->type != TYPE_NOT_STARTED);
+}
+
+static PyMethodDef Overlapped_methods[] = {
+    {"getresult", (PyCFunction) Overlapped_getresult,
+     METH_VARARGS, Overlapped_getresult_doc},
+    {"cancel", (PyCFunction) Overlapped_cancel,
+     METH_NOARGS, Overlapped_cancel_doc},
+    {"ReadFile", (PyCFunction) Overlapped_ReadFile,
+     METH_VARARGS, Overlapped_ReadFile_doc},
+    {"WSARecv", (PyCFunction) Overlapped_WSARecv,
+     METH_VARARGS, Overlapped_WSARecv_doc},
+    {"WriteFile", (PyCFunction) Overlapped_WriteFile,
+     METH_VARARGS, Overlapped_WriteFile_doc},
+    {"WSASend", (PyCFunction) Overlapped_WSASend,
+     METH_VARARGS, Overlapped_WSASend_doc},
+    {"AcceptEx", (PyCFunction) Overlapped_AcceptEx,
+     METH_VARARGS, Overlapped_AcceptEx_doc},
+    {"ConnectEx", (PyCFunction) Overlapped_ConnectEx,
+     METH_VARARGS, Overlapped_ConnectEx_doc},
+    {"DisconnectEx", (PyCFunction) Overlapped_DisconnectEx,
+     METH_VARARGS, Overlapped_DisconnectEx_doc},
+    {"ConnectNamedPipe", (PyCFunction) Overlapped_ConnectNamedPipe,
+     METH_VARARGS, Overlapped_ConnectNamedPipe_doc},
+    {NULL}
+};
+
+static PyMemberDef Overlapped_members[] = {
+    {"error", T_ULONG,
+     offsetof(OverlappedObject, error),
+     READONLY, "Error from last operation"},
+    {"event", T_HANDLE,
+     offsetof(OverlappedObject, overlapped) + offsetof(OVERLAPPED, hEvent),
+     READONLY, "Overlapped event handle"},
+    {NULL}
+};
+
+static PyGetSetDef Overlapped_getsets[] = {
+    {"address", (getter)Overlapped_getaddress, NULL,
+     "Address of overlapped structure"},
+    {"pending", (getter)Overlapped_getpending, NULL,
+     "Whether the operation is pending"},
+    {NULL},
+};
+
+PyTypeObject OverlappedType = {
+    PyVarObject_HEAD_INIT(NULL, 0)
+    /* tp_name           */ "_overlapped.Overlapped",
+    /* tp_basicsize      */ sizeof(OverlappedObject),
+    /* tp_itemsize       */ 0,
+    /* tp_dealloc        */ (destructor) Overlapped_dealloc,
+    /* tp_print          */ 0,
+    /* tp_getattr        */ 0,
+    /* 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_getattro       */ 0,
+    /* tp_setattro       */ 0,
+    /* tp_as_buffer      */ 0,
+    /* tp_flags          */ Py_TPFLAGS_DEFAULT,
+    /* tp_doc            */ "OVERLAPPED structure wrapper",
+    /* tp_traverse       */ 0,
+    /* tp_clear          */ 0,
+    /* tp_richcompare    */ 0,
+    /* tp_weaklistoffset */ 0,
+    /* tp_iter           */ 0,
+    /* tp_iternext       */ 0,
+    /* tp_methods        */ Overlapped_methods,
+    /* tp_members        */ Overlapped_members,
+    /* tp_getset         */ Overlapped_getsets,
+    /* 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            */ Overlapped_new,
+};
+
+static PyMethodDef overlapped_functions[] = {
+    {"CreateIoCompletionPort", overlapped_CreateIoCompletionPort,
+     METH_VARARGS, CreateIoCompletionPort_doc},
+    {"GetQueuedCompletionStatus", overlapped_GetQueuedCompletionStatus,
+     METH_VARARGS, GetQueuedCompletionStatus_doc},
+    {"PostQueuedCompletionStatus", overlapped_PostQueuedCompletionStatus,
+     METH_VARARGS, PostQueuedCompletionStatus_doc},
+    {"FormatMessage", overlapped_FormatMessage,
+     METH_VARARGS, FormatMessage_doc},
+    {"BindLocal", overlapped_BindLocal,
+     METH_VARARGS, BindLocal_doc},
+    {"RegisterWaitWithQueue", overlapped_RegisterWaitWithQueue,
+     METH_VARARGS, RegisterWaitWithQueue_doc},
+    {"UnregisterWait", overlapped_UnregisterWait,
+     METH_VARARGS, UnregisterWait_doc},
+    {"UnregisterWaitEx", overlapped_UnregisterWaitEx,
+     METH_VARARGS, UnregisterWaitEx_doc},
+    {"CreateEvent", overlapped_CreateEvent,
+     METH_VARARGS, CreateEvent_doc},
+    {"SetEvent", overlapped_SetEvent,
+     METH_VARARGS, SetEvent_doc},
+    {"ResetEvent", overlapped_ResetEvent,
+     METH_VARARGS, ResetEvent_doc},
+    {"ConnectPipe",
+     (PyCFunction) ConnectPipe,
+     METH_VARARGS, ConnectPipe_doc},
+    {NULL}
+};
+
+static struct PyModuleDef overlapped_module = {
+    PyModuleDef_HEAD_INIT,
+    "_overlapped",
+    NULL,
+    -1,
+    overlapped_functions,
+    NULL,
+    NULL,
+    NULL,
+    NULL
+};
+
+#define WINAPI_CONSTANT(fmt, con) \
+    PyDict_SetItemString(d, #con, Py_BuildValue(fmt, con))
+
+PyMODINIT_FUNC
+PyInit__overlapped(void)
+{
+    PyObject *m, *d;
+
+    /* Ensure WSAStartup() called before initializing function pointers */
+    m = PyImport_ImportModule("_socket");
+    if (!m)
+        return NULL;
+    Py_DECREF(m);
+
+    if (initialize_function_pointers() < 0)
+        return NULL;
+
+    if (PyType_Ready(&OverlappedType) < 0)
+        return NULL;
+
+    m = PyModule_Create(&overlapped_module);
+    if (PyModule_AddObject(m, "Overlapped", (PyObject *)&OverlappedType) < 0)
+        return NULL;
+
+    d = PyModule_GetDict(m);
+
+    WINAPI_CONSTANT(F_DWORD,  ERROR_IO_PENDING);
+    WINAPI_CONSTANT(F_DWORD,  ERROR_NETNAME_DELETED);
+    WINAPI_CONSTANT(F_DWORD,  ERROR_SEM_TIMEOUT);
+    WINAPI_CONSTANT(F_DWORD,  ERROR_PIPE_BUSY);
+    WINAPI_CONSTANT(F_DWORD,  INFINITE);
+    WINAPI_CONSTANT(F_HANDLE, INVALID_HANDLE_VALUE);
+    WINAPI_CONSTANT(F_HANDLE, NULL);
+    WINAPI_CONSTANT(F_DWORD,  SO_UPDATE_ACCEPT_CONTEXT);
+    WINAPI_CONSTANT(F_DWORD,  SO_UPDATE_CONNECT_CONTEXT);
+    WINAPI_CONSTANT(F_DWORD,  TF_REUSE_SOCKET);
+
+    return m;
+}
diff --git a/Modules/parsermodule.c b/Modules/parsermodule.c
index e598046..36e9893 100644
--- a/Modules/parsermodule.c
+++ b/Modules/parsermodule.c
@@ -83,54 +83,78 @@
            int lineno,                  /* include line numbers?         */
            int col_offset)              /* include column offsets?       */
 {
+    PyObject *result = NULL, *w;
+
     if (n == NULL) {
         Py_INCREF(Py_None);
-        return (Py_None);
+        return Py_None;
     }
+
     if (ISNONTERMINAL(TYPE(n))) {
         int i;
-        PyObject *v;
-        PyObject *w;
 
-        v = mkseq(1 + NCH(n) + (TYPE(n) == encoding_decl));
-        if (v == NULL)
-            return (v);
+        result = mkseq(1 + NCH(n) + (TYPE(n) == encoding_decl));
+        if (result == NULL)
+            goto error;
+
         w = PyLong_FromLong(TYPE(n));
-        if (w == NULL) {
-            Py_DECREF(v);
-            return ((PyObject*) NULL);
-        }
-        (void) addelem(v, 0, w);
+        if (w == NULL)
+            goto error;
+        (void) addelem(result, 0, w);
+
         for (i = 0; i < NCH(n); i++) {
             w = node2tuple(CHILD(n, i), mkseq, addelem, lineno, col_offset);
-            if (w == NULL) {
-                Py_DECREF(v);
-                return ((PyObject*) NULL);
-            }
-            (void) addelem(v, i+1, w);
+            if (w == NULL)
+                goto error;
+            (void) addelem(result, i+1, w);
         }
 
-        if (TYPE(n) == encoding_decl)
-            (void) addelem(v, i+1, PyUnicode_FromString(STR(n)));
-        return (v);
+        if (TYPE(n) == encoding_decl) {
+            w = PyUnicode_FromString(STR(n));
+            if (w == NULL)
+                goto error;
+            (void) addelem(result, i+1, w);
+        }
     }
     else if (ISTERMINAL(TYPE(n))) {
-        PyObject *result = mkseq(2 + lineno + col_offset);
-        if (result != NULL) {
-            (void) addelem(result, 0, PyLong_FromLong(TYPE(n)));
-            (void) addelem(result, 1, PyUnicode_FromString(STR(n)));
-            if (lineno == 1)
-                (void) addelem(result, 2, PyLong_FromLong(n->n_lineno));
-            if (col_offset == 1)
-                (void) addelem(result, 3, PyLong_FromLong(n->n_col_offset));
+        result = mkseq(2 + lineno + col_offset);
+        if (result == NULL)
+            goto error;
+
+        w = PyLong_FromLong(TYPE(n));
+        if (w == NULL)
+            goto error;
+        (void) addelem(result, 0, w);
+
+        w = PyUnicode_FromString(STR(n));
+        if (w == NULL)
+            goto error;
+        (void) addelem(result, 1, w);
+
+        if (lineno == 1) {
+            w = PyLong_FromLong(n->n_lineno);
+            if (w == NULL)
+                goto error;
+            (void) addelem(result, 2, w);
         }
-        return (result);
+
+        if (col_offset == 1) {
+            w = PyLong_FromLong(n->n_col_offset);
+            if (w == NULL)
+                goto error;
+            (void) addelem(result, 3, w);
+        }
     }
     else {
         PyErr_SetString(PyExc_SystemError,
                         "unrecognized parse tree node type");
         return ((PyObject*) NULL);
     }
+    return result;
+
+error:
+    Py_XDECREF(result);
+    return NULL;
 }
 /*
  *  End of material copyrighted by Stichting Mathematisch Centrum.
@@ -453,33 +477,46 @@
 static PyObject*
 parser_compilest(PyST_Object *self, PyObject *args, PyObject *kw)
 {
-    PyObject*     res = 0;
-    PyArena*      arena;
+    PyObject*     res = NULL;
+    PyArena*      arena = NULL;
     mod_ty        mod;
-    char*         str = "<syntax-tree>";
+    PyObject*     filename = NULL;
     int ok;
 
     static char *keywords[] = {"st", "filename", NULL};
 
     if (self == NULL || PyModule_Check(self))
-        ok = PyArg_ParseTupleAndKeywords(args, kw, "O!|s:compilest", keywords,
-                                         &PyST_Type, &self, &str);
+        ok = PyArg_ParseTupleAndKeywords(args, kw, "O!|O&:compilest", keywords,
+                                         &PyST_Type, &self,
+                                         PyUnicode_FSDecoder, &filename);
     else
-        ok = PyArg_ParseTupleAndKeywords(args, kw, "|s:compile", &keywords[1],
-                                         &str);
+        ok = PyArg_ParseTupleAndKeywords(args, kw, "|O&:compile", &keywords[1],
+                                         PyUnicode_FSDecoder, &filename);
+    if (!ok)
+        goto error;
 
-    if (ok) {
-        arena = PyArena_New();
-        if (arena) {
-           mod = PyAST_FromNode(self->st_node, &(self->st_flags), str, arena);
-           if (mod) {
-               res = (PyObject *)PyAST_Compile(mod, str, &(self->st_flags), arena);
-           }
-           PyArena_Free(arena);
-        }
+    if (filename == NULL) {
+        filename = PyUnicode_FromString("<syntax-tree>");
+        if (filename == NULL)
+            goto error;
     }
 
-    return (res);
+    arena = PyArena_New();
+    if (!arena)
+        goto error;
+
+    mod = PyAST_FromNodeObject(self->st_node, &self->st_flags,
+                               filename, arena);
+    if (!mod)
+        goto error;
+
+    res = (PyObject *)PyAST_CompileObject(mod, filename,
+                                          &self->st_flags, -1, arena);
+error:
+    Py_XDECREF(filename);
+    if (arena != NULL)
+        PyArena_Free(arena);
+    return res;
 }
 
 
@@ -809,8 +846,13 @@
                 return 0;
             }
             strn = (char *)PyObject_MALLOC(len + 1);
-            if (strn != NULL)
-                (void) memcpy(strn, temp_str, len + 1);
+            if (strn == NULL) {
+                Py_DECREF(temp);
+                Py_XDECREF(elem);
+                PyErr_NoMemory();
+                return 0;
+            }
+            (void) memcpy(strn, temp_str, len + 1);
             Py_DECREF(temp);
         }
         else if (!ISNONTERMINAL(type)) {
@@ -870,7 +912,7 @@
          *  The tuple is simple, but it doesn't start with a start symbol.
          *  Raise an exception now and be done with it.
          */
-        tuple = Py_BuildValue("os", tuple,
+        tuple = Py_BuildValue("Os", tuple,
                     "Illegal syntax-tree; cannot start with terminal symbol.");
         PyErr_SetObject(parser_error, tuple);
         Py_XDECREF(tuple);
@@ -906,8 +948,14 @@
                     return NULL;
                 }
                 res->n_str = (char *)PyObject_MALLOC(len + 1);
-                if (res->n_str != NULL && temp != NULL)
-                    (void) memcpy(res->n_str, temp, len + 1);
+                if (res->n_str == NULL) {
+                    Py_DECREF(res);
+                    Py_DECREF(encoding);
+                    Py_DECREF(tuple);
+                    PyErr_NoMemory();
+                    return NULL;
+                }
+                (void) memcpy(res->n_str, temp, len + 1);
                 Py_DECREF(encoding);
                 Py_DECREF(tuple);
             }
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 767a665..628dec2 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -1,15 +1,14 @@
 
 /* POSIX module implementation */
 
-/* This file is also used for Windows NT/MS-Win and OS/2.  In that case the
-   module actually calls itself 'nt' or 'os2', not 'posix', and a few
+/* This file is also used for Windows NT/MS-Win.  In that case the
+   module actually calls itself 'nt', not 'posix', and a few
    functions are either unimplemented or implemented differently.  The source
    assumes that for Windows NT, the macro 'MS_WINDOWS' is defined independent
    of the compiler used.  Different compilers define their own feature
-   test macro, e.g. '__BORLANDC__' or '_MSC_VER'.  For OS/2, the compiler
-   independent macro PYOS_OS2 should be defined.  On OS/2 the default
-   compiler is assumed to be IBM's VisualAge C++ (VACPP).  PYCC_GCC is used
-   as the compiler specific macro for the EMX port of gcc to OS/2. */
+   test macro, e.g. '__BORLANDC__' or '_MSC_VER'. */
+
+
 
 #ifdef __APPLE__
    /*
@@ -30,11 +29,6 @@
 #include "posixmodule.h"
 #endif
 
-#if defined(__VMS)
-#    error "PEP 11: VMS is now unsupported, code will be removed in Python 3.4"
-#    include <unixio.h>
-#endif /* defined(__VMS) */
-
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -46,22 +40,6 @@
 corresponding Unix manual entries for more information on calls.");
 
 
-#if defined(PYOS_OS2)
-#error "PEP 11: OS/2 is now unsupported, code will be removed in Python 3.4"
-#define  INCL_DOS
-#define  INCL_DOSERRORS
-#define  INCL_DOSPROCESS
-#define  INCL_NOPMAPI
-#include <os2.h>
-#if defined(PYCC_GCC)
-#include <ctype.h>
-#include <io.h>
-#include <stdio.h>
-#include <process.h>
-#endif
-#include "osdefs.h"
-#endif
-
 #ifdef HAVE_SYS_UIO_H
 #include <sys/uio.h>
 #endif
@@ -114,7 +92,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
 
@@ -132,6 +110,18 @@
 #include <dlfcn.h>
 #endif
 
+#ifdef __hpux
+#include <sys/mpctl.h>
+#endif
+
+#if defined(__DragonFly__) || \
+    defined(__OpenBSD__)   || \
+    defined(__FreeBSD__)   || \
+    defined(__NetBSD__)    || \
+    defined(__APPLE__)
+#include <sys/sysctl.h>
+#endif
+
 #if defined(MS_WINDOWS)
 #  define TERMSIZE_USE_CONIO
 #elif defined(HAVE_SYS_IOCTL_H)
@@ -146,29 +136,19 @@
 
 /* Various compilers have only certain posix functions */
 /* XXX Gosh I wish these were all moved into pyconfig.h */
-#if defined(PYCC_VACPP) && defined(PYOS_OS2)
-#include <process.h>
-#else
 #if defined(__WATCOMC__) && !defined(__QNX__)           /* Watcom compiler */
-#define HAVE_GETCWD     1
 #define HAVE_OPENDIR    1
 #define HAVE_SYSTEM     1
-#if defined(__OS2__)
-#define HAVE_EXECV      1
-#define HAVE_WAIT       1
-#endif
 #include <process.h>
 #else
 #ifdef __BORLANDC__             /* Borland compiler */
 #define HAVE_EXECV      1
-#define HAVE_GETCWD     1
 #define HAVE_OPENDIR    1
 #define HAVE_PIPE       1
 #define HAVE_SYSTEM     1
 #define HAVE_WAIT       1
 #else
 #ifdef _MSC_VER         /* Microsoft compiler */
-#define HAVE_GETCWD     1
 #define HAVE_GETPPID    1
 #define HAVE_GETLOGIN   1
 #define HAVE_SPAWNV     1
@@ -179,16 +159,12 @@
 #define HAVE_FSYNC      1
 #define fsync _commit
 #else
-#if defined(PYOS_OS2) && defined(PYCC_GCC) || defined(__VMS)
-/* Everything needed is defined in PC/os2emx/pyconfig.h or vms/pyconfig.h */
-#else                   /* all other compilers */
 /* Unix functions that the configure script doesn't check for */
 #define HAVE_EXECV      1
 #define HAVE_FORK       1
 #if defined(__USLC__) && defined(__SCO_VERSION__)       /* SCO UDK Compiler */
 #define HAVE_FORK1      1
 #endif
-#define HAVE_GETCWD     1
 #define HAVE_GETEGID    1
 #define HAVE_GETEUID    1
 #define HAVE_GETGID     1
@@ -200,14 +176,15 @@
 #define HAVE_SYSTEM     1
 #define HAVE_WAIT       1
 #define HAVE_TTYNAME    1
-#endif  /* PYOS_OS2 && PYCC_GCC && __VMS */
 #endif  /* _MSC_VER */
 #endif  /* __BORLANDC__ */
 #endif  /* ! __WATCOMC__ || __QNX__ */
-#endif /* ! __IBMC__ */
 
 
-
+/*[clinic input]
+module os
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=8cff096d1133288f]*/
 
 #ifndef _MSC_VER
 
@@ -335,10 +312,6 @@
 #endif
 #endif /* _MSC_VER */
 
-#if defined(PYCC_VACPP) && defined(PYOS_OS2)
-#include <io.h>
-#endif /* OS2 */
-
 #ifndef MAXPATHLEN
 #if defined(PATH_MAX) && PATH_MAX > 1024
 #define MAXPATHLEN PATH_MAX
@@ -380,7 +353,7 @@
 #undef STAT
 #undef FSTAT
 #undef STRUCT_STAT
-#if defined(MS_WIN64) || defined(MS_WINDOWS)
+#ifdef MS_WINDOWS
 #       define STAT win32_stat
 #       define LSTAT win32_lstat
 #       define FSTAT win32_fstat
@@ -403,6 +376,8 @@
 #endif
 #endif
 
+#define DWORD_MAX 4294967295U
+
 
 #ifdef MS_WINDOWS
 static int
@@ -436,113 +411,241 @@
 int
 _Py_Uid_Converter(PyObject *obj, void *p)
 {
+    uid_t uid;
+    PyObject *index;
     int overflow;
     long result;
-    if (PyFloat_Check(obj)) {
-        PyErr_SetString(PyExc_TypeError,
-                        "integer argument expected, got float");
+    unsigned long uresult;
+
+    index = PyNumber_Index(obj);
+    if (index == NULL) {
+        PyErr_Format(PyExc_TypeError,
+                     "uid should be integer, not %.200s",
+                     Py_TYPE(obj)->tp_name);
         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;
+
+    /*
+     * Handling uid_t is complicated for two reasons:
+     *  * Although uid_t is (always?) unsigned, it still
+     *    accepts -1.
+     *  * We don't know its size in advance--it may be
+     *    bigger than an int, or it may be smaller than
+     *    a long.
+     *
+     * So a bit of defensive programming is in order.
+     * Start with interpreting the value passed
+     * in as a signed long and see if it works.
+     */
+
+    result = PyLong_AsLongAndOverflow(index, &overflow);
+
+    if (!overflow) {
+        uid = (uid_t)result;
+
+        if (result == -1) {
+            if (PyErr_Occurred())
+                goto fail;
+            /* It's a legitimate -1, we're done. */
+            goto success;
         }
+
+        /* Any other negative number is disallowed. */
+        if (result < 0)
+            goto underflow;
+
+        /* Ensure the value wasn't truncated. */
         if (sizeof(uid_t) < sizeof(long) &&
-            (unsigned long)(uid_t)uresult != uresult)
-            goto OverflowUp;
-        *(uid_t *)p = (uid_t)uresult;
+            (long)uid != result)
+            goto underflow;
+        goto success;
     }
+
+    if (overflow < 0)
+        goto underflow;
+
+    /*
+     * Okay, the value overflowed a signed long.  If it
+     * fits in an *unsigned* long, it may still be okay,
+     * as uid_t may be unsigned long on this platform.
+     */
+    uresult = PyLong_AsUnsignedLong(index);
+    if (PyErr_Occurred()) {
+        if (PyErr_ExceptionMatches(PyExc_OverflowError))
+            goto overflow;
+        goto fail;
+    }
+
+    uid = (uid_t)uresult;
+
+    /*
+     * If uid == (uid_t)-1, the user actually passed in ULONG_MAX,
+     * but this value would get interpreted as (uid_t)-1  by chown
+     * and its siblings.   That's not what the user meant!  So we
+     * throw an overflow exception instead.   (We already
+     * handled a real -1 with PyLong_AsLongAndOverflow() above.)
+     */
+    if (uid == (uid_t)-1)
+        goto overflow;
+
+    /* Ensure the value wasn't truncated. */
+    if (sizeof(uid_t) < sizeof(long) &&
+        (unsigned long)uid != uresult)
+        goto overflow;
+    /* fallthrough */
+
+success:
+    Py_DECREF(index);
+    *(uid_t *)p = uid;
     return 1;
 
-OverflowDown:
+underflow:
     PyErr_SetString(PyExc_OverflowError,
-                    "user id is less than minimum");
-    return 0;
+                    "uid is less than minimum");
+    goto fail;
 
-OverflowUp:
+overflow:
     PyErr_SetString(PyExc_OverflowError,
-                    "user id is greater than maximum");
+                    "uid is greater than maximum");
+    /* fallthrough */
+
+fail:
+    Py_DECREF(index);
     return 0;
 }
 
 int
 _Py_Gid_Converter(PyObject *obj, void *p)
 {
+    gid_t gid;
+    PyObject *index;
     int overflow;
     long result;
-    if (PyFloat_Check(obj)) {
-        PyErr_SetString(PyExc_TypeError,
-                        "integer argument expected, got float");
+    unsigned long uresult;
+
+    index = PyNumber_Index(obj);
+    if (index == NULL) {
+        PyErr_Format(PyExc_TypeError,
+                     "gid should be integer, not %.200s",
+                     Py_TYPE(obj)->tp_name);
         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;
+
+    /*
+     * Handling gid_t is complicated for two reasons:
+     *  * Although gid_t is (always?) unsigned, it still
+     *    accepts -1.
+     *  * We don't know its size in advance--it may be
+     *    bigger than an int, or it may be smaller than
+     *    a long.
+     *
+     * So a bit of defensive programming is in order.
+     * Start with interpreting the value passed
+     * in as a signed long and see if it works.
+     */
+
+    result = PyLong_AsLongAndOverflow(index, &overflow);
+
+    if (!overflow) {
+        gid = (gid_t)result;
+
+        if (result == -1) {
+            if (PyErr_Occurred())
+                goto fail;
+            /* It's a legitimate -1, we're done. */
+            goto success;
         }
+
+        /* Any other negative number is disallowed. */
+        if (result < 0) {
+            goto underflow;
+        }
+
+        /* Ensure the value wasn't truncated. */
         if (sizeof(gid_t) < sizeof(long) &&
-            (unsigned long)(gid_t)uresult != uresult)
-            goto OverflowUp;
-        *(gid_t *)p = (gid_t)uresult;
+            (long)gid != result)
+            goto underflow;
+        goto success;
     }
+
+    if (overflow < 0)
+        goto underflow;
+
+    /*
+     * Okay, the value overflowed a signed long.  If it
+     * fits in an *unsigned* long, it may still be okay,
+     * as gid_t may be unsigned long on this platform.
+     */
+    uresult = PyLong_AsUnsignedLong(index);
+    if (PyErr_Occurred()) {
+        if (PyErr_ExceptionMatches(PyExc_OverflowError))
+            goto overflow;
+        goto fail;
+    }
+
+    gid = (gid_t)uresult;
+
+    /*
+     * If gid == (gid_t)-1, the user actually passed in ULONG_MAX,
+     * but this value would get interpreted as (gid_t)-1  by chown
+     * and its siblings.   That's not what the user meant!  So we
+     * throw an overflow exception instead.   (We already
+     * handled a real -1 with PyLong_AsLongAndOverflow() above.)
+     */
+    if (gid == (gid_t)-1)
+        goto overflow;
+
+    /* Ensure the value wasn't truncated. */
+    if (sizeof(gid_t) < sizeof(long) &&
+        (unsigned long)gid != uresult)
+        goto overflow;
+    /* fallthrough */
+
+success:
+    Py_DECREF(index);
+    *(gid_t *)p = gid;
     return 1;
 
-OverflowDown:
+underflow:
     PyErr_SetString(PyExc_OverflowError,
-                    "group id is less than minimum");
-    return 0;
+                    "gid is less than minimum");
+    goto fail;
 
-OverflowUp:
+overflow:
     PyErr_SetString(PyExc_OverflowError,
-                    "group id is greater than maximum");
+                    "gid is greater than maximum");
+    /* fallthrough */
+
+fail:
+    Py_DECREF(index);
     return 0;
 }
 #endif /* MS_WINDOWS */
 
 
+#ifdef HAVE_LONG_LONG
+#  define _PyLong_FromDev PyLong_FromLongLong
+#else
+#  define _PyLong_FromDev PyLong_FromLong
+#endif
+
+
+#if defined(HAVE_MKNOD) && defined(HAVE_MAKEDEV)
+static int
+_Py_Dev_Converter(PyObject *obj, void *p)
+{
+#ifdef HAVE_LONG_LONG
+    *((dev_t *)p) = PyLong_AsUnsignedLongLong(obj);
+#else
+    *((dev_t *)p) = PyLong_AsUnsignedLong(obj);
+#endif
+    if (PyErr_Occurred())
+        return 0;
+    return 1;
+}
+#endif /* HAVE_MKNOD && HAVE_MAKEDEV */
+
+
 #ifdef AT_FDCWD
 /*
  * Why the (int) cast?  Solaris 10 defines AT_FDCWD as 0xffd19553 (-3041965);
@@ -560,25 +663,29 @@
 _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();
+    long long_value;
+
+    PyObject *index = PyNumber_Index(o);
+    if (index == NULL) {
         PyErr_Format(PyExc_TypeError,
-                        "argument should be %s, not %.200s",
-                        allowed, Py_TYPE(o)->tp_name);
+                     "argument should be %s, not %.200s",
+                     allowed, Py_TYPE(o)->tp_name);
         return 0;
     }
+
+    long_value = PyLong_AsLongAndOverflow(index, &overflow);
+    Py_DECREF(index);
     if (overflow > 0 || long_value > INT_MAX) {
         PyErr_SetString(PyExc_OverflowError,
-                        "signed integer is greater than maximum");
+                        "fd is greater than maximum");
         return 0;
     }
     if (overflow < 0 || long_value < INT_MIN) {
         PyErr_SetString(PyExc_OverflowError,
-                        "signed integer is less than minimum");
+                        "fd is less than minimum");
         return 0;
     }
+
     *p = (int)long_value;
     return 1;
 }
@@ -626,7 +733,7 @@
  *   path.function_name
  *     If non-NULL, path_converter will use that as the name
  *     of the function in error messages.
- *     (If path.argument_name is NULL it omits the function name.)
+ *     (If path.function_name is NULL it omits the function name.)
  *   path.argument_name
  *     If non-NULL, path_converter will use that as the name
  *     of the parameter in error messages.
@@ -678,8 +785,8 @@
  * path_cleanup().  However it is safe to do so.)
  */
 typedef struct {
-    char *function_name;
-    char *argument_name;
+    const char *function_name;
+    const char *argument_name;
     int nullable;
     int allow_fd;
     wchar_t *wide;
@@ -690,6 +797,9 @@
     PyObject *cleanup;
 } path_t;
 
+#define PATH_T_INITIALIZE(function_name, nullable, allow_fd) \
+    {function_name, NULL, nullable, allow_fd, NULL, NULL, 0, 0, NULL, NULL}
+
 static void
 path_cleanup(path_t *path) {
     if (path->cleanup) {
@@ -737,15 +847,14 @@
     if (unicode) {
 #ifdef MS_WINDOWS
         wchar_t *wide;
-        length = PyUnicode_GET_SIZE(unicode);
-        if (length > 32767) {
-            FORMAT_EXCEPTION(PyExc_ValueError, "%s too long for Windows");
+
+        wide = PyUnicode_AsUnicodeAndSize(unicode, &length);
+        if (!wide) {
             Py_DECREF(unicode);
             return 0;
         }
-
-        wide = PyUnicode_AsUnicode(unicode);
-        if (!wide) {
+        if (length > 32767) {
+            FORMAT_EXCEPTION(PyExc_ValueError, "%s too long for Windows");
             Py_DECREF(unicode);
             return 0;
         }
@@ -803,7 +912,7 @@
 
     length = PyBytes_GET_SIZE(bytes);
 #ifdef MS_WINDOWS
-    if (length > MAX_PATH) {
+    if (length > MAX_PATH-1) {
         FORMAT_EXCEPTION(PyExc_ValueError, "%s too long for Windows");
         Py_DECREF(bytes);
         return 0;
@@ -1104,10 +1213,6 @@
 #else
     char **e;
 #endif
-#if defined(PYOS_OS2)
-    APIRET rc;
-    char   buffer[1024]; /* OS/2 Provides a Documented Max of 1024 Chars */
-#endif
 
     d = PyDict_New();
     if (d == NULL)
@@ -1176,20 +1281,6 @@
         Py_DECREF(v);
     }
 #endif
-#if defined(PYOS_OS2)
-    rc = DosQueryExtLIBPATH(buffer, BEGIN_LIBPATH);
-    if (rc == NO_ERROR) { /* (not a type, envname is NOT 'BEGIN_LIBPATH') */
-        PyObject *v = PyBytes_FromString(buffer);
-        PyDict_SetItemString(d, "BEGINLIBPATH", v);
-        Py_DECREF(v);
-    }
-    rc = DosQueryExtLIBPATH(buffer, END_LIBPATH);
-    if (rc == NO_ERROR) { /* (not a typo, envname is NOT 'END_LIBPATH') */
-        PyObject *v = PyBytes_FromString(buffer);
-        PyDict_SetItemString(d, "ENDLIBPATH", v);
-        Py_DECREF(v);
-    }
-#endif
     return d;
 }
 
@@ -1200,25 +1291,6 @@
 {
     return PyErr_SetFromErrno(PyExc_OSError);
 }
-static PyObject *
-posix_error_with_filename(char* name)
-{
-    return PyErr_SetFromErrnoWithFilename(PyExc_OSError, name);
-}
-
-
-static PyObject *
-posix_error_with_allocated_filename(PyObject* name)
-{
-    PyObject *name_str, *rc;
-    name_str = PyUnicode_DecodeFSDefaultAndSize(PyBytes_AsString(name),
-                                                PyBytes_GET_SIZE(name));
-    Py_DECREF(name);
-    rc = PyErr_SetFromErrnoWithFilenameObject(PyExc_OSError,
-                                              name_str);
-    Py_XDECREF(name_str);
-    return rc;
-}
 
 #ifdef MS_WINDOWS
 static PyObject *
@@ -1237,24 +1309,13 @@
 }
 
 static PyObject *
-win32_error_unicode(char* function, wchar_t* filename)
-{
-    /* XXX - see win32_error for comments on 'function' */
-    errno = GetLastError();
-    if (filename)
-        return PyErr_SetFromWindowsErrWithUnicodeFilename(errno, filename);
-    else
-        return PyErr_SetFromWindowsErr(errno);
-}
-
-static PyObject *
 win32_error_object(char* function, PyObject* filename)
 {
     /* XXX - see win32_error for comments on 'function' */
     errno = GetLastError();
     if (filename)
         return PyErr_SetExcFromWindowsErrWithFilenameObject(
-                    PyExc_WindowsError,
+                    PyExc_OSError,
                     errno,
                     filename);
     else
@@ -1263,108 +1324,30 @@
 
 #endif /* MS_WINDOWS */
 
-/*
- * Some functions return Win32 errors, others only ever use posix_error
- * (this is for backwards compatibility with exceptions)
- */
 static PyObject *
-path_posix_error(char *function_name, path_t *path)
-{
-    if (path->narrow)
-        return posix_error_with_filename(path->narrow);
-    return posix_error();
-}
-
-static PyObject *
-path_error(char *function_name, path_t *path)
+path_error(path_t *path)
 {
 #ifdef MS_WINDOWS
-    if (path->narrow)
-        return win32_error(function_name, path->narrow);
-    if (path->wide)
-        return win32_error_unicode(function_name, path->wide);
-    return win32_error(function_name, NULL);
+    return PyErr_SetExcFromWindowsErrWithFilenameObject(PyExc_OSError,
+                                                        0, path->object);
 #else
-    return path_posix_error(function_name, path);
+    return PyErr_SetFromErrnoWithFilenameObject(PyExc_OSError, path->object);
 #endif
 }
 
-#if defined(PYOS_OS2)
-/**********************************************************************
- *         Helper Function to Trim and Format OS/2 Messages
- **********************************************************************/
-static void
-os2_formatmsg(char *msgbuf, int msglen, char *reason)
-{
-    msgbuf[msglen] = '\0'; /* OS/2 Doesn't Guarantee a Terminator */
-
-    if (strlen(msgbuf) > 0) { /* If Non-Empty Msg, Trim CRLF */
-        char *lastc = &msgbuf[ strlen(msgbuf)-1 ];
-
-        while (lastc > msgbuf && Py_ISSPACE(Py_CHARMASK(*lastc)))
-            *lastc-- = '\0'; /* Trim Trailing Whitespace (CRLF) */
-    }
-
-    /* Add Optional Reason Text */
-    if (reason) {
-        strcat(msgbuf, " : ");
-        strcat(msgbuf, reason);
-    }
-}
-
-/**********************************************************************
- *             Decode an OS/2 Operating System Error Code
- *
- * A convenience function to lookup an OS/2 error code and return a
- * text message we can use to raise a Python exception.
- *
- * Notes:
- *   The messages for errors returned from the OS/2 kernel reside in
- *   the file OSO001.MSG in the \OS2 directory hierarchy.
- *
- **********************************************************************/
-static char *
-os2_strerror(char *msgbuf, int msgbuflen, int errorcode, char *reason)
-{
-    APIRET rc;
-    ULONG  msglen;
-
-    /* Retrieve Kernel-Related Error Message from OSO001.MSG File */
-    Py_BEGIN_ALLOW_THREADS
-    rc = DosGetMessage(NULL, 0, msgbuf, msgbuflen,
-                       errorcode, "oso001.msg", &msglen);
-    Py_END_ALLOW_THREADS
-
-    if (rc == NO_ERROR)
-        os2_formatmsg(msgbuf, msglen, reason);
-    else
-        PyOS_snprintf(msgbuf, msgbuflen,
-                      "unknown OS error #%d", errorcode);
-
-    return msgbuf;
-}
-
-/* Set an OS/2-specific error and return NULL.  OS/2 kernel
-   errors are not in a global variable e.g. 'errno' nor are
-   they congruent with posix error numbers. */
 
 static PyObject *
-os2_error(int code)
+path_error2(path_t *path, path_t *path2)
 {
-    char text[1024];
-    PyObject *v;
-
-    os2_strerror(text, sizeof(text), code, "");
-
-    v = Py_BuildValue("(is)", code, text);
-    if (v != NULL) {
-        PyErr_SetObject(PyExc_OSError, v);
-        Py_DECREF(v);
-    }
-    return NULL; /* Signal to Python that an Exception is Pending */
+#ifdef MS_WINDOWS
+    return PyErr_SetExcFromWindowsErrWithFilenameObjects(PyExc_OSError,
+            0, path->object, path2->object);
+#else
+    return PyErr_SetFromErrnoWithFilenameObjects(PyExc_OSError,
+        path->object, path2->object);
+#endif
 }
 
-#endif /* OS2 */
 
 /* POSIX generic methods */
 
@@ -1388,65 +1371,31 @@
 }
 
 static PyObject *
-posix_1str(PyObject *args, char *format, int (*func)(const char*))
+posix_1str(const char *func_name, PyObject *args, char *format,
+           int (*func)(const char*))
 {
-    PyObject *opath1 = NULL;
-    char *path1;
+    path_t path;
     int res;
+    memset(&path, 0, sizeof(path));
+    path.function_name = func_name;
     if (!PyArg_ParseTuple(args, format,
-                          PyUnicode_FSConverter, &opath1))
+                          path_converter, &path))
         return NULL;
-    path1 = PyBytes_AsString(opath1);
     Py_BEGIN_ALLOW_THREADS
-    res = (*func)(path1);
+    res = (*func)(path.narrow);
     Py_END_ALLOW_THREADS
-    if (res < 0)
-        return posix_error_with_allocated_filename(opath1);
-    Py_DECREF(opath1);
+    if (res < 0) {
+        path_error(&path);
+        path_cleanup(&path);
+        return NULL;
+    }
+    path_cleanup(&path);
     Py_INCREF(Py_None);
     return Py_None;
 }
 
 
 #ifdef MS_WINDOWS
-static PyObject*
-win32_1str(PyObject* args, char* func,
-           char* format, BOOL (__stdcall *funcA)(LPCSTR),
-           char* wformat, BOOL (__stdcall *funcW)(LPWSTR))
-{
-    PyObject *uni;
-    const char *ansi;
-    BOOL result;
-
-    if (PyArg_ParseTuple(args, wformat, &uni))
-    {
-        wchar_t *wstr = PyUnicode_AsUnicode(uni);
-        if (wstr == NULL)
-            return NULL;
-        Py_BEGIN_ALLOW_THREADS
-        result = funcW(wstr);
-        Py_END_ALLOW_THREADS
-        if (!result)
-            return win32_error_object(func, uni);
-        Py_INCREF(Py_None);
-        return Py_None;
-    }
-    PyErr_Clear();
-
-    if (!PyArg_ParseTuple(args, format, &ansi))
-        return NULL;
-    if (win32_warn_bytes_api())
-        return NULL;
-    Py_BEGIN_ALLOW_THREADS
-    result = funcA(ansi);
-    Py_END_ALLOW_THREADS
-    if (!result)
-        return win32_error(func, ansi);
-    Py_INCREF(Py_None);
-    return Py_None;
-
-}
-
 /* This is a reimplementation of the C library's chdir function,
    but one that produces Win32 errors instead of DOS error codes.
    chdir is essentially a wrapper around SetCurrentDirectory; however,
@@ -1455,18 +1404,18 @@
 static BOOL __stdcall
 win32_chdir(LPCSTR path)
 {
-    char new_path[MAX_PATH+1];
+    char new_path[MAX_PATH];
     int result;
     char env[4] = "=x:";
 
     if(!SetCurrentDirectoryA(path))
         return FALSE;
-    result = GetCurrentDirectoryA(MAX_PATH+1, new_path);
+    result = GetCurrentDirectoryA(Py_ARRAY_LENGTH(new_path), new_path);
     if (!result)
         return FALSE;
     /* In the ANSI API, there should not be any paths longer
-       than MAX_PATH. */
-    assert(result <= MAX_PATH+1);
+       than MAX_PATH-1 (not including the final null character). */
+    assert(result < Py_ARRAY_LENGTH(new_path));
     if (strncmp(new_path, "\\\\", 2) == 0 ||
         strncmp(new_path, "//", 2) == 0)
         /* UNC path, nothing to do. */
@@ -1480,24 +1429,24 @@
 static BOOL __stdcall
 win32_wchdir(LPCWSTR path)
 {
-    wchar_t _new_path[MAX_PATH+1], *new_path = _new_path;
+    wchar_t _new_path[MAX_PATH], *new_path = _new_path;
     int result;
     wchar_t env[4] = L"=x:";
 
     if(!SetCurrentDirectoryW(path))
         return FALSE;
-    result = GetCurrentDirectoryW(MAX_PATH+1, new_path);
+    result = GetCurrentDirectoryW(Py_ARRAY_LENGTH(new_path), new_path);
     if (!result)
         return FALSE;
-    if (result > MAX_PATH+1) {
-        new_path = malloc(result * sizeof(wchar_t));
+    if (result > Py_ARRAY_LENGTH(new_path)) {
+        new_path = PyMem_RawMalloc(result * sizeof(wchar_t));
         if (!new_path) {
             SetLastError(ERROR_OUTOFMEMORY);
             return FALSE;
         }
         result = GetCurrentDirectoryW(result, new_path);
         if (!result) {
-            free(new_path);
+            PyMem_RawFree(new_path);
             return FALSE;
         }
     }
@@ -1508,7 +1457,7 @@
     env[1] = new_path[0];
     result = SetEnvironmentVariableW(env, new_path);
     if (new_path != _new_path)
-        free(new_path);
+        PyMem_RawFree(new_path);
     return result;
 }
 #endif
@@ -1523,13 +1472,13 @@
 #define HAVE_STAT_NSEC 1
 
 struct win32_stat{
-    int st_dev;
+    unsigned long st_dev;
     __int64 st_ino;
     unsigned short st_mode;
     int st_nlink;
     int st_uid;
     int st_gid;
-    int st_rdev;
+    unsigned long st_rdev;
     __int64 st_size;
     time_t st_atime;
     int st_atime_nsec;
@@ -1588,6 +1537,8 @@
     memset(result, 0, sizeof(*result));
     result->st_mode = attributes_to_mode(info->dwFileAttributes);
     result->st_size = (((__int64)info->nFileSizeHigh)<<32) + info->nFileSizeLow;
+    result->st_dev = info->dwVolumeSerialNumber;
+    result->st_rdev = result->st_dev;
     FILE_TIME_to_time_t_nsec(&info->ftCreationTime, &result->st_ctime, &result->st_ctime_nsec);
     FILE_TIME_to_time_t_nsec(&info->ftLastWriteTime, &result->st_mtime, &result->st_mtime_nsec);
     FILE_TIME_to_time_t_nsec(&info->ftLastAccessTime, &result->st_atime, &result->st_atime_nsec);
@@ -1595,9 +1546,9 @@
     result->st_ino = (((__int64)info->nFileIndexHigh)<<32) + info->nFileIndexLow;
     if (reparse_tag == IO_REPARSE_TAG_SYMLINK) {
         /* first clear the S_IFMT bits */
-        result->st_mode ^= (result->st_mode & 0170000);
+        result->st_mode ^= (result->st_mode & S_IFMT);
         /* now set the bits that make this a symlink */
-        result->st_mode |= 0120000;
+        result->st_mode |= S_IFLNK;
     }
 
     return 0;
@@ -1650,7 +1601,7 @@
 }
 
 /* Grab GetFinalPathNameByHandle dynamically from kernel32 */
-static int has_GetFinalPathNameByHandle = 0;
+static int has_GetFinalPathNameByHandle = -1;
 static DWORD (CALLBACK *Py_GetFinalPathNameByHandleW)(HANDLE, LPWSTR, DWORD,
                                                       DWORD);
 static int
@@ -1661,7 +1612,7 @@
                                                    DWORD);
 
     /* only recheck */
-    if (!has_GetFinalPathNameByHandle)
+    if (-1 == has_GetFinalPathNameByHandle)
     {
         hKernel32 = GetModuleHandleW(L"KERNEL32");
         *(FARPROC*)&Py_GetFinalPathNameByHandleA = GetProcAddress(hKernel32,
@@ -1687,7 +1638,7 @@
     if(!buf_size)
         return FALSE;
 
-    buf = (wchar_t *)malloc((buf_size+1)*sizeof(wchar_t));
+    buf = (wchar_t *)PyMem_Malloc((buf_size+1)*sizeof(wchar_t));
     if (!buf) {
         SetLastError(ERROR_OUTOFMEMORY);
         return FALSE;
@@ -1697,12 +1648,12 @@
                        buf, buf_size, VOLUME_NAME_DOS);
 
     if(!result_length) {
-        free(buf);
+        PyMem_Free(buf);
         return FALSE;
     }
 
     if(!CloseHandle(hdl)) {
-        free(buf);
+        PyMem_Free(buf);
         return FALSE;
     }
 
@@ -1793,7 +1744,7 @@
                     return -1;
 
                 code = win32_xstat_impl_w(target_path, result, FALSE);
-                free(target_path);
+                PyMem_Free(target_path);
                 return code;
             }
         } else
@@ -1889,7 +1840,7 @@
                     return -1;
 
                 code = win32_xstat_impl_w(target_path, result, FALSE);
-                free(target_path);
+                PyMem_Free(target_path);
                 return code;
             }
         } else
@@ -2288,11 +2239,10 @@
 #else
     PyStructSequence_SET_ITEM(v, 1, PyLong_FromLong((long)st->st_ino));
 #endif
-#if defined(HAVE_LONG_LONG) && !defined(MS_WINDOWS)
-    PyStructSequence_SET_ITEM(v, 2,
-                              PyLong_FromLongLong((PY_LONG_LONG)st->st_dev));
+#ifdef MS_WINDOWS
+    PyStructSequence_SET_ITEM(v, 2, PyLong_FromUnsignedLong(st->st_dev));
 #else
-    PyStructSequence_SET_ITEM(v, 2, PyLong_FromLong((long)st->st_dev));
+    PyStructSequence_SET_ITEM(v, 2, _PyLong_FromDev(st->st_dev));
 #endif
     PyStructSequence_SET_ITEM(v, 3, PyLong_FromLong((long)st->st_nlink));
 #if defined(MS_WINDOWS)
@@ -2423,53 +2373,158 @@
         result = STAT(path->narrow, &st);
     Py_END_ALLOW_THREADS
 
-    if (result != 0)
-        return path_error("stat", path);
+    if (result != 0) {
+        return path_error(path);
+    }
 
     return _pystat_fromstructstat(&st);
 }
 
-PyDoc_STRVAR(posix_stat__doc__,
-"stat(path, *, dir_fd=None, follow_symlinks=True) -> stat result\n\n\
-Perform a stat system call on the given path.\n\
-\n\
-path may be specified as either a string or as an open file descriptor.\n\
-\n\
-If dir_fd is not None, it should be a file descriptor open to a directory,\n\
-  and path should be relative; path will then be relative to that directory.\n\
-  dir_fd may not be supported on your platform; if it is unavailable, using\n\
-  it will raise a NotImplementedError.\n\
-If follow_symlinks is False, and the last element of the path is a symbolic\n\
-  link, stat will examine the symbolic link itself instead of the file the\n\
-  link points to.\n\
-It is an error to use dir_fd or follow_symlinks when specifying path as\n\
-  an open file descriptor.");
+#ifdef HAVE_FSTATAT
+    #define OS_STAT_DIR_FD_CONVERTER dir_fd_converter
+#else
+    #define OS_STAT_DIR_FD_CONVERTER dir_fd_unavailable
+#endif
+
+
+/*[python input]
+
+class path_t_converter(CConverter):
+
+    type = "path_t"
+    impl_by_reference = True
+    parse_by_reference = True
+
+    converter = 'path_converter'
+
+    def converter_init(self, *, allow_fd=False, nullable=False):
+        # right now path_t doesn't support default values.
+        # to support a default value, you'll need to override initialize().
+        if self.default is not unspecified:
+            fail("Can't specify a default to the path_t converter!")
+
+        if self.c_default is not None:
+            fail("Can't specify a c_default to the path_t converter!")
+
+        self.nullable = nullable
+        self.allow_fd = allow_fd
+
+    def pre_render(self):
+        def strify(value):
+            return str(int(bool(value)))
+
+        # add self.py_name here when merging with posixmodule conversion
+        self.c_default = 'PATH_T_INITIALIZE("{}", {}, {})'.format(
+            self.function.name,
+            strify(self.nullable),
+            strify(self.allow_fd),
+            )
+
+    def cleanup(self):
+        return "path_cleanup(&" + self.name + ");\n"
+
+
+class dir_fd_converter(CConverter):
+    type = 'int'
+    converter = 'OS_STAT_DIR_FD_CONVERTER'
+
+    def converter_init(self):
+        if self.default in (unspecified, None):
+            self.c_default = 'DEFAULT_DIR_FD'
+
+
+[python start generated code]*/
+/*[python end generated code: output=da39a3ee5e6b4b0d input=5c9f456f53244fc3]*/
+
+/*[clinic input]
+
+os.stat
+
+    path : path_t(allow_fd=True)
+        Path to be examined; can be string, bytes, or open-file-descriptor int.
+
+    *
+
+    dir_fd : dir_fd = None
+        If not None, it should be a file descriptor open to a directory,
+        and path should be a relative string; path will then be relative to
+        that directory.
+
+    follow_symlinks: bool = True
+        If False, and the last element of the path is a symbolic link,
+        stat will examine the symbolic link itself instead of the file
+        the link points to.
+
+Perform a stat system call on the given path.
+
+dir_fd and follow_symlinks may not be implemented
+  on your platform.  If they are unavailable, using them will raise a
+  NotImplementedError.
+
+It's an error to use dir_fd or follow_symlinks when specifying path as
+  an open file descriptor.
+
+[clinic start generated code]*/
+
+PyDoc_STRVAR(os_stat__doc__,
+"stat($module, /, path, *, dir_fd=None, follow_symlinks=True)\n"
+"--\n"
+"\n"
+"Perform a stat system call on the given path.\n"
+"\n"
+"  path\n"
+"    Path to be examined; can be string, bytes, or open-file-descriptor int.\n"
+"  dir_fd\n"
+"    If not None, it should be a file descriptor open to a directory,\n"
+"    and path should be a relative string; path will then be relative to\n"
+"    that directory.\n"
+"  follow_symlinks\n"
+"    If False, and the last element of the path is a symbolic link,\n"
+"    stat will examine the symbolic link itself instead of the file\n"
+"    the link points to.\n"
+"\n"
+"dir_fd and follow_symlinks may not be implemented\n"
+"  on your platform.  If they are unavailable, using them will raise a\n"
+"  NotImplementedError.\n"
+"\n"
+"It\'s an error to use dir_fd or follow_symlinks when specifying path as\n"
+"  an open file descriptor.");
+
+#define OS_STAT_METHODDEF    \
+    {"stat", (PyCFunction)os_stat, METH_VARARGS|METH_KEYWORDS, os_stat__doc__},
 
 static PyObject *
-posix_stat(PyObject *self, PyObject *args, PyObject *kwargs)
+os_stat_impl(PyModuleDef *module, path_t *path, int dir_fd, int follow_symlinks);
+
+static PyObject *
+os_stat(PyModuleDef *module, PyObject *args, PyObject *kwargs)
 {
-    static char *keywords[] = {"path", "dir_fd", "follow_symlinks", NULL};
-    path_t path;
+    PyObject *return_value = NULL;
+    static char *_keywords[] = {"path", "dir_fd", "follow_symlinks", NULL};
+    path_t path = PATH_T_INITIALIZE("stat", 0, 1);
     int dir_fd = DEFAULT_DIR_FD;
     int follow_symlinks = 1;
-    PyObject *return_value;
 
-    memset(&path, 0, sizeof(path));
-    path.allow_fd = 1;
-    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&|$O&p:stat", keywords,
-        path_converter, &path,
-#ifdef HAVE_FSTATAT
-        dir_fd_converter, &dir_fd,
-#else
-        dir_fd_unavailable, &dir_fd,
-#endif
-        &follow_symlinks))
-        return NULL;
-    return_value = posix_do_stat("stat", &path, dir_fd, follow_symlinks);
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+        "O&|$O&p:stat", _keywords,
+        path_converter, &path, OS_STAT_DIR_FD_CONVERTER, &dir_fd, &follow_symlinks))
+        goto exit;
+    return_value = os_stat_impl(module, &path, dir_fd, follow_symlinks);
+
+exit:
+    /* Cleanup for path */
     path_cleanup(&path);
+
     return return_value;
 }
 
+static PyObject *
+os_stat_impl(PyModuleDef *module, path_t *path, int dir_fd, int follow_symlinks)
+/*[clinic end generated code: output=f1dcaa5e24db9882 input=5ae155bd475fd20a]*/
+{
+    return posix_do_stat("stat", path, dir_fd, follow_symlinks);
+}
+
 PyDoc_STRVAR(posix_lstat__doc__,
 "lstat(path, *, dir_fd=None) -> stat result\n\n\
 Like stat(), but do not follow symbolic links.\n\
@@ -2485,6 +2540,7 @@
     PyObject *return_value;
 
     memset(&path, 0, sizeof(path));
+    path.function_name = "lstat";
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&|$O&:lstat", keywords,
         path_converter, &path,
 #ifdef HAVE_FSTATAT
@@ -2494,44 +2550,122 @@
 #endif
         ))
         return NULL;
-    return_value = posix_do_stat("stat", &path, dir_fd, follow_symlinks);
+    return_value = posix_do_stat("lstat", &path, dir_fd, follow_symlinks);
     path_cleanup(&path);
     return return_value;
 }
 
-PyDoc_STRVAR(posix_access__doc__,
-"access(path, mode, *, dir_fd=None, effective_ids=False,\
- follow_symlinks=True)\n\n\
-Use the real uid/gid to test for access to a path.  Returns True if granted,\n\
-False otherwise.\n\
-\n\
-If dir_fd is not None, it should be a file descriptor open to a directory,\n\
-  and path should be relative; path will then be relative to that directory.\n\
-If effective_ids is True, access will use the effective uid/gid instead of\n\
-  the real uid/gid.\n\
-If follow_symlinks is False, and the last element of the path is a symbolic\n\
-  link, access will examine the symbolic link itself instead of the file the\n\
-  link points to.\n\
-dir_fd, effective_ids, and follow_symlinks may not be implemented\n\
-  on your platform.  If they are unavailable, using them will raise a\n\
-  NotImplementedError.\n\
-\n\
-Note that most operations will use the effective uid/gid, therefore this\n\
-  routine can be used in a suid/sgid environment to test if the invoking user\n\
-  has the specified access to the path.\n\
-The mode argument can be F_OK to test existence, or the inclusive-OR\n\
-  of R_OK, W_OK, and X_OK.");
+
+#ifdef HAVE_FACCESSAT
+    #define OS_ACCESS_DIR_FD_CONVERTER dir_fd_converter
+#else
+    #define OS_ACCESS_DIR_FD_CONVERTER dir_fd_unavailable
+#endif
+/*[clinic input]
+os.access
+
+    path: path_t(allow_fd=True)
+        Path to be tested; can be string, bytes, or open-file-descriptor int.
+
+    mode: int
+        Operating-system mode bitfield.  Can be F_OK to test existence,
+        or the inclusive-OR of R_OK, W_OK, and X_OK.
+
+    *
+
+    dir_fd : dir_fd = None
+        If not None, it should be a file descriptor open to a directory,
+        and path should be relative; path will then be relative to that
+        directory.
+
+    effective_ids: bool = False
+        If True, access will use the effective uid/gid instead of
+        the real uid/gid.
+
+    follow_symlinks: bool = True
+        If False, and the last element of the path is a symbolic link,
+        access will examine the symbolic link itself instead of the file
+        the link points to.
+
+Use the real uid/gid to test for access to a path.
+
+{parameters}
+dir_fd, effective_ids, and follow_symlinks may not be implemented
+  on your platform.  If they are unavailable, using them will raise a
+  NotImplementedError.
+
+Note that most operations will use the effective uid/gid, therefore this
+  routine can be used in a suid/sgid environment to test if the invoking user
+  has the specified access to the path.
+
+[clinic start generated code]*/
+
+PyDoc_STRVAR(os_access__doc__,
+"access($module, /, path, mode, *, dir_fd=None, effective_ids=False,\n"
+"       follow_symlinks=True)\n"
+"--\n"
+"\n"
+"Use the real uid/gid to test for access to a path.\n"
+"\n"
+"  path\n"
+"    Path to be tested; can be string, bytes, or open-file-descriptor int.\n"
+"  mode\n"
+"    Operating-system mode bitfield.  Can be F_OK to test existence,\n"
+"    or the inclusive-OR of R_OK, W_OK, and X_OK.\n"
+"  dir_fd\n"
+"    If not None, it should be a file descriptor open to a directory,\n"
+"    and path should be relative; path will then be relative to that\n"
+"    directory.\n"
+"  effective_ids\n"
+"    If True, access will use the effective uid/gid instead of\n"
+"    the real uid/gid.\n"
+"  follow_symlinks\n"
+"    If False, and the last element of the path is a symbolic link,\n"
+"    access will examine the symbolic link itself instead of the file\n"
+"    the link points to.\n"
+"\n"
+"dir_fd, effective_ids, and follow_symlinks may not be implemented\n"
+"  on your platform.  If they are unavailable, using them will raise a\n"
+"  NotImplementedError.\n"
+"\n"
+"Note that most operations will use the effective uid/gid, therefore this\n"
+"  routine can be used in a suid/sgid environment to test if the invoking user\n"
+"  has the specified access to the path.");
+
+#define OS_ACCESS_METHODDEF    \
+    {"access", (PyCFunction)os_access, METH_VARARGS|METH_KEYWORDS, os_access__doc__},
 
 static PyObject *
-posix_access(PyObject *self, PyObject *args, PyObject *kwargs)
+os_access_impl(PyModuleDef *module, path_t *path, int mode, int dir_fd, int effective_ids, int follow_symlinks);
+
+static PyObject *
+os_access(PyModuleDef *module, PyObject *args, PyObject *kwargs)
 {
-    static char *keywords[] = {"path", "mode", "dir_fd", "effective_ids",
-                                "follow_symlinks", NULL};
-    path_t path;
+    PyObject *return_value = NULL;
+    static char *_keywords[] = {"path", "mode", "dir_fd", "effective_ids", "follow_symlinks", NULL};
+    path_t path = PATH_T_INITIALIZE("access", 0, 1);
     int mode;
     int dir_fd = DEFAULT_DIR_FD;
     int effective_ids = 0;
     int follow_symlinks = 1;
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+        "O&i|$O&pp:access", _keywords,
+        path_converter, &path, &mode, OS_STAT_DIR_FD_CONVERTER, &dir_fd, &effective_ids, &follow_symlinks))
+        goto exit;
+    return_value = os_access_impl(module, &path, mode, dir_fd, effective_ids, follow_symlinks);
+
+exit:
+    /* Cleanup for path */
+    path_cleanup(&path);
+
+    return return_value;
+}
+
+static PyObject *
+os_access_impl(PyModuleDef *module, path_t *path, int mode, int dir_fd, int effective_ids, int follow_symlinks)
+/*[clinic end generated code: output=a6ed4f151be9df0f input=2e2e7594371f5b7e]*/
+{
     PyObject *return_value = NULL;
 
 #ifdef MS_WINDOWS
@@ -2540,17 +2674,6 @@
     int result;
 #endif
 
-    memset(&path, 0, sizeof(path));
-    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&i|$O&pp:access", keywords,
-        path_converter, &path, &mode,
-#ifdef HAVE_FACCESSAT
-        dir_fd_converter, &dir_fd,
-#else
-        dir_fd_unavailable, &dir_fd,
-#endif
-        &effective_ids, &follow_symlinks))
-        return NULL;
-
 #ifndef HAVE_FACCESSAT
     if (follow_symlinks_specified("access", follow_symlinks))
         goto exit;
@@ -2563,10 +2686,10 @@
 
 #ifdef MS_WINDOWS
     Py_BEGIN_ALLOW_THREADS
-    if (path.wide != NULL)
-        attr = GetFileAttributesW(path.wide);
+    if (path->wide != NULL)
+        attr = GetFileAttributesW(path->wide);
     else
-        attr = GetFileAttributesA(path.narrow);
+        attr = GetFileAttributesA(path->narrow);
     Py_END_ALLOW_THREADS
 
     /*
@@ -2578,7 +2701,7 @@
      * (Directories cannot be read-only on Windows.)
     */
     return_value = PyBool_FromLong(
-        (attr != 0xFFFFFFFF) &&
+        (attr != INVALID_FILE_ATTRIBUTES) &&
             (!(mode & 2) ||
             !(attr & FILE_ATTRIBUTE_READONLY) ||
             (attr & FILE_ATTRIBUTE_DIRECTORY)));
@@ -2594,11 +2717,11 @@
             flags |= AT_SYMLINK_NOFOLLOW;
         if (effective_ids)
             flags |= AT_EACCESS;
-        result = faccessat(dir_fd, path.narrow, mode, flags);
+        result = faccessat(dir_fd, path->narrow, mode, flags);
     }
     else
 #endif
-        result = access(path.narrow, mode);
+        result = access(path->narrow, mode);
     Py_END_ALLOW_THREADS
     return_value = PyBool_FromLong(!result);
 #endif
@@ -2606,7 +2729,6 @@
 #ifndef HAVE_FACCESSAT
 exit:
 #endif
-    path_cleanup(&path);
     return return_value;
 }
 
@@ -2623,35 +2745,68 @@
 #define X_OK 1
 #endif
 
+
 #ifdef HAVE_TTYNAME
-PyDoc_STRVAR(posix_ttyname__doc__,
-"ttyname(fd) -> string\n\n\
-Return the name of the terminal device connected to 'fd'.");
+
+/*[clinic input]
+os.ttyname -> DecodeFSDefault
+
+    fd: int
+        Integer file descriptor handle.
+
+    /
+
+Return the name of the terminal device connected to 'fd'.
+[clinic start generated code]*/
+
+PyDoc_STRVAR(os_ttyname__doc__,
+"ttyname($module, fd, /)\n"
+"--\n"
+"\n"
+"Return the name of the terminal device connected to \'fd\'.\n"
+"\n"
+"  fd\n"
+"    Integer file descriptor handle.");
+
+#define OS_TTYNAME_METHODDEF    \
+    {"ttyname", (PyCFunction)os_ttyname, METH_VARARGS, os_ttyname__doc__},
+
+static char *
+os_ttyname_impl(PyModuleDef *module, int fd);
 
 static PyObject *
-posix_ttyname(PyObject *self, PyObject *args)
+os_ttyname(PyModuleDef *module, PyObject *args)
 {
-    int id;
+    PyObject *return_value = NULL;
+    int fd;
+    char *_return_value;
+
+    if (!PyArg_ParseTuple(args,
+        "i:ttyname",
+        &fd))
+        goto exit;
+    _return_value = os_ttyname_impl(module, fd);
+    if (_return_value == NULL)
+        goto exit;
+    return_value = PyUnicode_DecodeFSDefault(_return_value);
+
+exit:
+    return return_value;
+}
+
+static char *
+os_ttyname_impl(PyModuleDef *module, int fd)
+/*[clinic end generated code: output=cee7bc4cffec01a2 input=5f72ca83e76b3b45]*/
+{
     char *ret;
 
-    if (!PyArg_ParseTuple(args, "i:ttyname", &id))
-        return NULL;
-
-#if defined(__VMS)
-    /* file descriptor 0 only, the default input device (stdin) */
-    if (id == 0) {
-        ret = ttyname();
-    }
-    else {
-        ret = NULL;
-    }
-#else
-    ret = ttyname(id);
-#endif
+    ret = ttyname(fd);
     if (ret == NULL)
-        return posix_error();
-    return PyUnicode_DecodeFSDefault(ret);
+        posix_error();
+    return ret;
 }
+#else
+#define OS_TTYNAME_METHODDEF
 #endif
 
 #ifdef HAVE_CTERMID
@@ -2693,6 +2848,7 @@
     static char *keywords[] = {"path", NULL};
 
     memset(&path, 0, sizeof(path));
+    path.function_name = "chdir";
 #ifdef HAVE_FCHDIR
     path.allow_fd = 1;
 #endif
@@ -2708,8 +2864,6 @@
     else
         result = win32_chdir(path.narrow);
     result = !result; /* on unix, success = 0, on windows, success = !0 */
-#elif defined(PYOS_OS2) && defined(PYCC_GCC)
-    result = _chdir2(path.narrow);
 #else
 #ifdef HAVE_FCHDIR
     if (path.fd != -1)
@@ -2721,7 +2875,7 @@
     Py_END_ALLOW_THREADS
 
     if (result) {
-        return_value = path_error("chdir", &path);
+        return_value = path_error(&path);
         goto exit;
     }
 
@@ -2785,6 +2939,7 @@
 #endif
 
     memset(&path, 0, sizeof(path));
+    path.function_name = "chmod";
 #ifdef HAVE_FCHMOD
     path.allow_fd = 1;
 #endif
@@ -2810,7 +2965,7 @@
         attr = GetFileAttributesW(path.wide);
     else
         attr = GetFileAttributesA(path.narrow);
-    if (attr == 0xFFFFFFFF)
+    if (attr == INVALID_FILE_ATTRIBUTES)
         result = 0;
     else {
         if (mode & _S_IWRITE)
@@ -2825,7 +2980,7 @@
     Py_END_ALLOW_THREADS
 
     if (!result) {
-        return_value = win32_error_object("chmod", path.object);
+        return_value = path_error(&path);
         goto exit;
     }
 #else /* MS_WINDOWS */
@@ -2879,7 +3034,7 @@
         }
         else
 #endif
-            return_value = path_error("chmod", &path);
+            return_value = path_error(&path);
         goto exit;
     }
 #endif
@@ -2923,20 +3078,23 @@
 static PyObject *
 posix_lchmod(PyObject *self, PyObject *args)
 {
-    PyObject *opath;
-    char *path;
+    path_t path;
     int i;
     int res;
-    if (!PyArg_ParseTuple(args, "O&i:lchmod", PyUnicode_FSConverter,
-                          &opath, &i))
+    memset(&path, 0, sizeof(path));
+    path.function_name = "lchmod";
+    if (!PyArg_ParseTuple(args, "O&i:lchmod",
+                          path_converter, &path, &i))
         return NULL;
-    path = PyBytes_AsString(opath);
     Py_BEGIN_ALLOW_THREADS
-    res = lchmod(path, i);
+    res = lchmod(path.narrow, i);
     Py_END_ALLOW_THREADS
-    if (res < 0)
-        return posix_error_with_allocated_filename(opath);
-    Py_DECREF(opath);
+    if (res < 0) {
+        path_error(&path);
+        path_cleanup(&path);
+        return NULL;
+    }
+    path_cleanup(&path);
     Py_RETURN_NONE;
 }
 #endif /* HAVE_LCHMOD */
@@ -2964,6 +3122,7 @@
     static char *keywords[] = {"path", "flags", "follow_symlinks", NULL};
 
     memset(&path, 0, sizeof(path));
+    path.function_name = "chflags";
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&k|$i:chflags", keywords,
                           path_converter, &path,
                           &flags, &follow_symlinks))
@@ -2984,7 +3143,7 @@
     Py_END_ALLOW_THREADS
 
     if (result) {
-        return_value = path_posix_error("chflags", &path);
+        return_value = path_error(&path);
         goto exit;
     }
 
@@ -3007,22 +3166,24 @@
 static PyObject *
 posix_lchflags(PyObject *self, PyObject *args)
 {
-    PyObject *opath;
-    char *path;
+    path_t path;
     unsigned long flags;
     int res;
+    memset(&path, 0, sizeof(path));
+    path.function_name = "lchflags";
     if (!PyArg_ParseTuple(args, "O&k:lchflags",
-                          PyUnicode_FSConverter, &opath, &flags))
+                          path_converter, &path, &flags))
         return NULL;
-    path = PyBytes_AsString(opath);
     Py_BEGIN_ALLOW_THREADS
-    res = lchflags(path, flags);
+    res = lchflags(path.narrow, flags);
     Py_END_ALLOW_THREADS
-    if (res < 0)
-        return posix_error_with_allocated_filename(opath);
-    Py_DECREF(opath);
-    Py_INCREF(Py_None);
-    return Py_None;
+    if (res < 0) {
+        path_error(&path);
+        path_cleanup(&path);
+        return NULL;
+    }
+    path_cleanup(&path);
+    Py_RETURN_NONE;
 }
 #endif /* HAVE_LCHFLAGS */
 
@@ -3034,7 +3195,7 @@
 static PyObject *
 posix_chroot(PyObject *self, PyObject *args)
 {
-    return posix_1str(args, "O&:chroot", chroot);
+    return posix_1str("chroot", args, "O&:chroot", chroot);
 }
 #endif
 
@@ -3116,6 +3277,7 @@
                                "follow_symlinks", NULL};
 
     memset(&path, 0, sizeof(path));
+    path.function_name = "chown";
 #ifdef HAVE_FCHOWN
     path.allow_fd = 1;
 #endif
@@ -3173,7 +3335,7 @@
     Py_END_ALLOW_THREADS
 
     if (result) {
-        return_value = path_posix_error("chown", &path);
+        return_value = path_error(&path);
         goto exit;
     }
 
@@ -3222,30 +3384,32 @@
 static PyObject *
 posix_lchown(PyObject *self, PyObject *args)
 {
-    PyObject *opath;
-    char *path;
+    path_t path;
     uid_t uid;
     gid_t gid;
     int res;
+    memset(&path, 0, sizeof(path));
+    path.function_name = "lchown";
     if (!PyArg_ParseTuple(args, "O&O&O&:lchown",
-                          PyUnicode_FSConverter, &opath,
+                          path_converter, &path,
                           _Py_Uid_Converter, &uid,
                           _Py_Gid_Converter, &gid))
         return NULL;
-    path = PyBytes_AsString(opath);
     Py_BEGIN_ALLOW_THREADS
-    res = lchown(path, uid, gid);
+    res = lchown(path.narrow, uid, gid);
     Py_END_ALLOW_THREADS
-    if (res < 0)
-        return posix_error_with_allocated_filename(opath);
-    Py_DECREF(opath);
+    if (res < 0) {
+        path_error(&path);
+        path_cleanup(&path);
+        return NULL;
+    }
+    path_cleanup(&path);
     Py_INCREF(Py_None);
     return Py_None;
 }
 #endif /* HAVE_LCHOWN */
 
 
-#ifdef HAVE_GETCWD
 static PyObject *
 posix_getcwd(int use_bytes)
 {
@@ -3259,12 +3423,12 @@
         PyObject *resobj;
         DWORD len;
         Py_BEGIN_ALLOW_THREADS
-        len = GetCurrentDirectoryW(sizeof wbuf/ sizeof wbuf[0], wbuf);
+        len = GetCurrentDirectoryW(Py_ARRAY_LENGTH(wbuf), wbuf);
         /* If the buffer is large enough, len does not include the
            terminating \0. If the buffer is too small, len includes
            the space needed for the terminator. */
-        if (len >= sizeof wbuf/ sizeof wbuf[0]) {
-            wbuf2 = malloc(len * sizeof(wchar_t));
+        if (len >= Py_ARRAY_LENGTH(wbuf)) {
+            wbuf2 = PyMem_RawMalloc(len * sizeof(wchar_t));
             if (wbuf2)
                 len = GetCurrentDirectoryW(len, wbuf2);
         }
@@ -3274,11 +3438,13 @@
             return NULL;
         }
         if (!len) {
-            if (wbuf2 != wbuf) free(wbuf2);
-            return win32_error("getcwdu", NULL);
+            if (wbuf2 != wbuf)
+                PyMem_RawFree(wbuf2);
+            return PyErr_SetFromWindowsErr(0);
         }
         resobj = PyUnicode_FromWideChar(wbuf2, len);
-        if (wbuf2 != wbuf) free(wbuf2);
+        if (wbuf2 != wbuf)
+            PyMem_RawFree(wbuf2);
         return resobj;
     }
 
@@ -3287,11 +3453,7 @@
 #endif
 
     Py_BEGIN_ALLOW_THREADS
-#if defined(PYOS_OS2) && defined(PYCC_GCC)
-    res = _getcwd2(buf, sizeof buf);
-#else
     res = getcwd(buf, sizeof buf);
-#endif
     Py_END_ALLOW_THREADS
     if (res == NULL)
         return posix_error();
@@ -3319,7 +3481,6 @@
 {
     return posix_getcwd(1);
 }
-#endif
 
 #if ((!defined(HAVE_LINK)) && defined(MS_WINDOWS))
 #define HAVE_LINK 1
@@ -3358,6 +3519,8 @@
 
     memset(&src, 0, sizeof(src));
     memset(&dst, 0, sizeof(dst));
+    src.function_name = "link";
+    dst.function_name = "link";
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&O&|O&O&p:link", keywords,
             path_converter, &src,
             path_converter, &dst,
@@ -3388,7 +3551,7 @@
     Py_END_ALLOW_THREADS
 
     if (!result) {
-        return_value = win32_error_object("link", dst.object);
+        return_value = path_error2(&src, &dst);
         goto exit;
     }
 #else
@@ -3406,7 +3569,7 @@
     Py_END_ALLOW_THREADS
 
     if (result) {
-        return_value = path_error("link", &dst);
+        return_value = path_error2(&src, &dst);
         goto exit;
     }
 #endif
@@ -3436,72 +3599,35 @@
   the file descriptor must refer to a directory.\n\
   If this functionality is unavailable, using it raises NotImplementedError.");
 
-static PyObject *
-posix_listdir(PyObject *self, PyObject *args, PyObject *kwargs)
-{
-    path_t path;
-    PyObject *list = NULL;
-    static char *keywords[] = {"path", NULL};
-#ifdef HAVE_FDOPENDIR
-    int fd = -1;
-#endif /* HAVE_FDOPENDIR */
-
 #if defined(MS_WINDOWS) && !defined(HAVE_OPENDIR)
+static PyObject *
+_listdir_windows_no_opendir(path_t *path, PyObject *list)
+{
+    static char *keywords[] = {"path", NULL};
     PyObject *v;
     HANDLE hFindFile = INVALID_HANDLE_VALUE;
     BOOL result;
     WIN32_FIND_DATA FileData;
-    char namebuf[MAX_PATH+5]; /* Overallocate for \\*.*\0 */
+    char namebuf[MAX_PATH+4]; /* Overallocate for "\*.*" */
     char *bufptr = namebuf;
     /* only claim to have space for MAX_PATH */
-    Py_ssize_t len = sizeof(namebuf)-5;
+    Py_ssize_t len = Py_ARRAY_LENGTH(namebuf)-4;
     PyObject *po = NULL;
     wchar_t *wnamebuf = NULL;
-#elif defined(PYOS_OS2)
-#ifndef MAX_PATH
-#define MAX_PATH    CCHMAXPATH
-#endif
-    char *pt;
-    PyObject *v;
-    char namebuf[MAX_PATH+5];
-    HDIR  hdir = 1;
-    ULONG srchcnt = 1;
-    FILEFINDBUF3   ep;
-    APIRET rc;
-#else
-    PyObject *v;
-    DIR *dirp = NULL;
-    struct dirent *ep;
-    int return_str; /* if false, return bytes */
-#endif
 
-    memset(&path, 0, sizeof(path));
-    path.nullable = 1;
-#ifdef HAVE_FDOPENDIR
-    path.allow_fd = 1;
-    path.fd = -1;
-#endif
-    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O&:listdir", keywords,
-        path_converter, &path
-        ))
-        return NULL;
-
-    /* XXX Should redo this putting the (now four) versions of opendir
-       in separate files instead of having them all here... */
-#if defined(MS_WINDOWS) && !defined(HAVE_OPENDIR)
-    if (!path.narrow) {
+    if (!path->narrow) {
         WIN32_FIND_DATAW wFileData;
         wchar_t *po_wchars;
 
-        if (!path.wide) { /* Default arg: "." */
+        if (!path->wide) { /* Default arg: "." */
             po_wchars = L".";
             len = 1;
         } else {
-            po_wchars = path.wide;
-            len = wcslen(path.wide);
+            po_wchars = path->wide;
+            len = wcslen(path->wide);
         }
         /* The +5 is so we can append "\\*.*\0" */
-        wnamebuf = malloc((len + 5) * sizeof(wchar_t));
+        wnamebuf = PyMem_Malloc((len + 5) * sizeof(wchar_t));
         if (!wnamebuf) {
             PyErr_NoMemory();
             goto exit;
@@ -3509,8 +3635,8 @@
         wcscpy(wnamebuf, po_wchars);
         if (len > 0) {
             wchar_t wch = wnamebuf[len-1];
-            if (wch != L'/' && wch != L'\\' && wch != L':')
-                wnamebuf[len++] = L'\\';
+            if (wch != SEP && wch != ALTSEP && wch != L':')
+                wnamebuf[len++] = SEP;
             wcscpy(wnamebuf + len, L"*.*");
         }
         if ((list = PyList_New(0)) == NULL) {
@@ -3524,8 +3650,7 @@
             if (error == ERROR_FILE_NOT_FOUND)
                 goto exit;
             Py_DECREF(list);
-            list = NULL;
-            win32_error_unicode("FindFirstFileW", wnamebuf);
+            list = path_error(path);
             goto exit;
         }
         do {
@@ -3554,19 +3679,19 @@
                it got to the end of the directory. */
             if (!result && GetLastError() != ERROR_NO_MORE_FILES) {
                 Py_DECREF(list);
-                list = win32_error_unicode("FindNextFileW", wnamebuf);
+                list = path_error(path);
                 goto exit;
             }
         } while (result == TRUE);
 
         goto exit;
     }
-    strcpy(namebuf, path.narrow);
-    len = path.length;
+    strcpy(namebuf, path->narrow);
+    len = path->length;
     if (len > 0) {
         char ch = namebuf[len-1];
-        if (ch != SEP && ch != ALTSEP && ch != ':')
-            namebuf[len++] = '/';
+        if (ch != '\\' && ch != '/' && ch != ':')
+            namebuf[len++] = '\\';
         strcpy(namebuf + len, "*.*");
     }
 
@@ -3581,7 +3706,7 @@
         if (error == ERROR_FILE_NOT_FOUND)
             goto exit;
         Py_DECREF(list);
-        list = win32_error("FindFirstFile", namebuf);
+        list = path_error(path);
         goto exit;
     }
     do {
@@ -3609,7 +3734,7 @@
            it got to the end of the directory. */
         if (!result && GetLastError() != ERROR_NO_MORE_FILES) {
             Py_DECREF(list);
-            list = win32_error("FindNextFile", namebuf);
+            list = path_error(path);
             goto exit;
         }
     } while (result == TRUE);
@@ -3619,92 +3744,35 @@
         if (FindClose(hFindFile) == FALSE) {
             if (list != NULL) {
                 Py_DECREF(list);
-                list = win32_error_object("FindClose", path.object);
+                list = path_error(path);
             }
         }
     }
-    if (wnamebuf)
-        free(wnamebuf);
-    path_cleanup(&path);
+    PyMem_Free(wnamebuf);
 
     return list;
+}  /* end of _listdir_windows_no_opendir */
 
-#elif defined(PYOS_OS2)
-    if (path.length >= MAX_PATH) {
-        PyErr_SetString(PyExc_ValueError, "path too long");
-        goto exit;
-    }
-    strcpy(namebuf, path.narrow);
-    for (pt = namebuf; *pt; pt++)
-        if (*pt == ALTSEP)
-            *pt = SEP;
-    if (namebuf[len-1] != SEP)
-        namebuf[len++] = SEP;
-    strcpy(namebuf + len, "*.*");
+#else  /* thus POSIX, ie: not (MS_WINDOWS and not HAVE_OPENDIR) */
 
-    if ((list = PyList_New(0)) == NULL) {
-        goto exit;
-    }
-
-    rc = DosFindFirst(namebuf,         /* Wildcard Pattern to Match */
-                      &hdir,           /* Handle to Use While Search Directory */
-                      FILE_READONLY | FILE_HIDDEN | FILE_SYSTEM | FILE_DIRECTORY,
-                      &ep, sizeof(ep), /* Structure to Receive Directory Entry */
-                      &srchcnt,        /* Max and Actual Count of Entries Per Iteration */
-                      FIL_STANDARD);   /* Format of Entry (EAs or Not) */
-
-    if (rc != NO_ERROR) {
-        errno = ENOENT;
-        Py_DECREF(list);
-        list = posix_error_with_filename(path.narrow);
-        goto exit;
-    }
-
-    if (srchcnt > 0) { /* If Directory is NOT Totally Empty, */
-        do {
-            if (ep.achName[0] == '.'
-            && (ep.achName[1] == '\0' || (ep.achName[1] == '.' && ep.achName[2] == '\0')))
-                continue; /* Skip Over "." and ".." Names */
-
-            strcpy(namebuf, ep.achName);
-
-            /* Leave Case of Name Alone -- In Native Form */
-            /* (Removed Forced Lowercasing Code) */
-
-            v = PyBytes_FromString(namebuf);
-            if (v == NULL) {
-                Py_DECREF(list);
-                list = NULL;
-                break;
-            }
-            if (PyList_Append(list, v) != 0) {
-                Py_DECREF(v);
-                Py_DECREF(list);
-                list = NULL;
-                break;
-            }
-            Py_DECREF(v);
-        } while (DosFindNext(hdir, &ep, sizeof(ep), &srchcnt) == NO_ERROR && srchcnt > 0);
-    }
-
-exit:
-    path_cleanup(&path);
-
-    return list;
-#else
+static PyObject *
+_posix_listdir(path_t *path, PyObject *list)
+{
+    PyObject *v;
+    DIR *dirp = NULL;
+    struct dirent *ep;
+    int return_str; /* if false, return bytes */
+#ifdef HAVE_FDOPENDIR
+    int fd = -1;
+#endif
 
     errno = 0;
 #ifdef HAVE_FDOPENDIR
-    if (path.fd != -1) {
+    if (path->fd != -1) {
         /* closedir() closes the FD, so we duplicate it */
-        Py_BEGIN_ALLOW_THREADS
-        fd = dup(path.fd);
-        Py_END_ALLOW_THREADS
-
-        if (fd == -1) {
-            list = posix_error();
-            goto exit;
-        }
+        fd = _Py_dup(path->fd);
+        if (fd == -1)
+            return NULL;
 
         return_str = 1;
 
@@ -3716,10 +3784,10 @@
 #endif
     {
         char *name;
-        if (path.narrow) {
-            name = path.narrow;
+        if (path->narrow) {
+            name = path->narrow;
             /* only return bytes if they specified a bytes object */
-            return_str = !(PyBytes_Check(path.object));
+            return_str = !(PyBytes_Check(path->object));
         }
         else {
             name = ".";
@@ -3732,14 +3800,14 @@
     }
 
     if (dirp == NULL) {
-        list = path_error("listdir", &path);
+        list = path_error(path);
 #ifdef HAVE_FDOPENDIR
         if (fd != -1) {
             Py_BEGIN_ALLOW_THREADS
             close(fd);
             Py_END_ALLOW_THREADS
         }
-#endif /* HAVE_FDOPENDIR */
+#endif
         goto exit;
     }
     if ((list = PyList_New(0)) == NULL) {
@@ -3755,7 +3823,7 @@
                 break;
             } else {
                 Py_DECREF(list);
-                list = path_error("listdir", &path);
+                list = path_error(path);
                 goto exit;
             }
         }
@@ -3785,17 +3853,44 @@
 #ifdef HAVE_FDOPENDIR
         if (fd > -1)
             rewinddir(dirp);
-#endif /* HAVE_FDOPENDIR */
+#endif
         closedir(dirp);
         Py_END_ALLOW_THREADS
     }
 
-    path_cleanup(&path);
-
     return list;
+}  /* end of _posix_listdir */
+#endif  /* which OS */
 
-#endif /* which OS */
-}  /* end of posix_listdir */
+static PyObject *
+posix_listdir(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+    path_t path;
+    PyObject *list = NULL;
+    static char *keywords[] = {"path", NULL};
+    PyObject *return_value;
+
+    memset(&path, 0, sizeof(path));
+    path.function_name = "listdir";
+    path.nullable = 1;
+#ifdef HAVE_FDOPENDIR
+    path.allow_fd = 1;
+    path.fd = -1;
+#endif
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O&:listdir", keywords,
+                                     path_converter, &path)) {
+        return NULL;
+    }
+
+#if defined(MS_WINDOWS) && !defined(HAVE_OPENDIR)
+    return_value = _listdir_windows_no_opendir(&path, list);
+#else
+    return_value = _posix_listdir(&path, list);
+#endif
+    path_cleanup(&path);
+    return return_value;
+}
 
 #ifdef MS_WINDOWS
 /* A helper function for abspath on win32 */
@@ -3803,14 +3898,14 @@
 posix__getfullpathname(PyObject *self, PyObject *args)
 {
     const char *path;
-    char outbuf[MAX_PATH*2];
+    char outbuf[MAX_PATH];
     char *temp;
     PyObject *po;
 
     if (PyArg_ParseTuple(args, "U|:_getfullpathname", &po))
     {
         wchar_t *wpath;
-        wchar_t woutbuf[MAX_PATH*2], *woutbufp = woutbuf;
+        wchar_t woutbuf[MAX_PATH], *woutbufp = woutbuf;
         wchar_t *wtemp;
         DWORD result;
         PyObject *v;
@@ -3822,7 +3917,7 @@
                                   Py_ARRAY_LENGTH(woutbuf),
                                   woutbuf, &wtemp);
         if (result > Py_ARRAY_LENGTH(woutbuf)) {
-            woutbufp = malloc(result * sizeof(wchar_t));
+            woutbufp = PyMem_Malloc(result * sizeof(wchar_t));
             if (!woutbufp)
                 return PyErr_NoMemory();
             result = GetFullPathNameW(wpath, result, woutbufp, &wtemp);
@@ -3832,7 +3927,7 @@
         else
             v = win32_error_object("GetFullPathNameW", po);
         if (woutbufp != woutbuf)
-            free(woutbufp);
+            PyMem_Free(woutbufp);
         return v;
     }
     /* Drop the argument parsing error as narrow strings
@@ -3902,7 +3997,7 @@
     if(!buf_size)
         return win32_error_object("GetFinalPathNameByHandle", po);
 
-    target_path = (wchar_t *)malloc((buf_size+1)*sizeof(wchar_t));
+    target_path = (wchar_t *)PyMem_Malloc((buf_size+1)*sizeof(wchar_t));
     if(!target_path)
         return PyErr_NoMemory();
 
@@ -3916,36 +4011,11 @@
 
     target_path[result_length] = 0;
     result = PyUnicode_FromWideChar(target_path, result_length);
-    free(target_path);
+    PyMem_Free(target_path);
     return result;
 
 } /* end of posix__getfinalpathname */
 
-static PyObject *
-posix__getfileinformation(PyObject *self, PyObject *args)
-{
-    HANDLE hFile;
-    BY_HANDLE_FILE_INFORMATION info;
-    int fd;
-
-    if (!PyArg_ParseTuple(args, "i:_getfileinformation", &fd))
-        return NULL;
-
-    if (!_PyVerify_fd(fd))
-        return posix_error();
-
-    hFile = (HANDLE)_get_osfhandle(fd);
-    if (hFile == INVALID_HANDLE_VALUE)
-        return posix_error();
-
-    if (!GetFileInformationByHandle(hFile, &info))
-        return win32_error("_getfileinformation", NULL);
-
-    return Py_BuildValue("iii", info.dwVolumeSerialNumber,
-                                info.nFileIndexHigh,
-                                info.nFileIndexLow);
-}
-
 PyDoc_STRVAR(posix__isdir__doc__,
 "Return true if the pathname refers to an existing directory.");
 
@@ -3984,6 +4054,55 @@
     else
         Py_RETURN_FALSE;
 }
+
+PyDoc_STRVAR(posix__getvolumepathname__doc__,
+"Return volume mount point of the specified path.");
+
+/* A helper function for ismount on windows */
+static PyObject *
+posix__getvolumepathname(PyObject *self, PyObject *args)
+{
+    PyObject *po, *result;
+    wchar_t *path, *mountpath=NULL;
+    size_t buflen;
+    BOOL ret;
+
+    if (!PyArg_ParseTuple(args, "U|:_getvolumepathname", &po))
+        return NULL;
+    path = PyUnicode_AsUnicodeAndSize(po, &buflen);
+    if (path == NULL)
+        return NULL;
+    buflen += 1;
+
+    /* Volume path should be shorter than entire path */
+    buflen = Py_MAX(buflen, MAX_PATH);
+
+    if (buflen > DWORD_MAX) {
+        PyErr_SetString(PyExc_OverflowError, "path too long");
+        return NULL;
+    }
+
+    mountpath = (wchar_t *)PyMem_Malloc(buflen * sizeof(wchar_t));
+    if (mountpath == NULL)
+        return PyErr_NoMemory();
+
+    Py_BEGIN_ALLOW_THREADS
+    ret = GetVolumePathNameW(path, mountpath,
+                             Py_SAFE_DOWNCAST(buflen, size_t, DWORD));
+    Py_END_ALLOW_THREADS
+
+    if (!ret) {
+        result = win32_error_object("_getvolumepathname", po);
+        goto exit;
+    }
+    result = PyUnicode_FromWideChar(mountpath, wcslen(mountpath));
+
+exit:
+    PyMem_Free(mountpath);
+    return result;
+}
+/* end of posix__getvolumepathname */
+
 #endif /* MS_WINDOWS */
 
 PyDoc_STRVAR(posix_mkdir__doc__,
@@ -4008,6 +4127,7 @@
     int result;
 
     memset(&path, 0, sizeof(path));
+    path.function_name = "mkdir";
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&|i$O&:mkdir", keywords,
         path_converter, &path, &mode,
 #ifdef HAVE_MKDIRAT
@@ -4027,7 +4147,7 @@
     Py_END_ALLOW_THREADS
 
     if (!result) {
-        return_value = win32_error_object("mkdir", path.object);
+        return_value = path_error(&path);
         goto exit;
     }
 #else
@@ -4044,7 +4164,7 @@
 #endif
     Py_END_ALLOW_THREADS
     if (result < 0) {
-        return_value = path_error("mkdir", &path);
+        return_value = path_error(&path);
         goto exit;
     }
 #endif
@@ -4162,6 +4282,8 @@
 
     memset(&src, 0, sizeof(src));
     memset(&dst, 0, sizeof(dst));
+    src.function_name = function_name;
+    dst.function_name = function_name;
     strcpy(format, "O&O&|$O&O&:");
     strcat(format, function_name);
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, format, keywords,
@@ -4195,7 +4317,7 @@
     Py_END_ALLOW_THREADS
 
     if (!result) {
-        return_value = win32_error_object(function_name, dst.object);
+        return_value = path_error2(&src, &dst);
         goto exit;
     }
 
@@ -4210,7 +4332,7 @@
     Py_END_ALLOW_THREADS
 
     if (result) {
-        return_value = path_error(function_name, &dst);
+        return_value = path_error2(&src, &dst);
         goto exit;
     }
 #endif
@@ -4274,6 +4396,7 @@
     PyObject *return_value = NULL;
 
     memset(&path, 0, sizeof(path));
+    path.function_name = "rmdir";
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&|$O&:rmdir", keywords,
             path_converter, &path,
 #ifdef HAVE_UNLINKAT
@@ -4302,7 +4425,7 @@
     Py_END_ALLOW_THREADS
 
     if (result) {
-        return_value = path_error("rmdir", &path);
+        return_value = path_error(&path);
         goto exit;
     }
 
@@ -4430,6 +4553,7 @@
     PyObject *return_value = NULL;
 
     memset(&path, 0, sizeof(path));
+    path.function_name = "unlink";
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&|$O&:unlink", keywords,
             path_converter, &path,
 #ifdef HAVE_UNLINKAT
@@ -4458,7 +4582,7 @@
     Py_END_ALLOW_THREADS
 
     if (result) {
-        return_value = path_error("unlink", &path);
+        return_value = path_error(&path);
         goto exit;
     }
 
@@ -4580,55 +4704,55 @@
 } utime_t;
 
 /*
- * these macros assume that "utime" is a pointer to a utime_t
+ * these macros assume that "ut" is a pointer to a utime_t
  * they also intentionally leak the declaration of a pointer named "time"
  */
 #define UTIME_TO_TIMESPEC \
     struct timespec ts[2]; \
     struct timespec *time; \
-    if (utime->now) \
+    if (ut->now) \
         time = NULL; \
     else { \
-        ts[0].tv_sec = utime->atime_s; \
-        ts[0].tv_nsec = utime->atime_ns; \
-        ts[1].tv_sec = utime->mtime_s; \
-        ts[1].tv_nsec = utime->mtime_ns; \
+        ts[0].tv_sec = ut->atime_s; \
+        ts[0].tv_nsec = ut->atime_ns; \
+        ts[1].tv_sec = ut->mtime_s; \
+        ts[1].tv_nsec = ut->mtime_ns; \
         time = ts; \
     } \
 
 #define UTIME_TO_TIMEVAL \
     struct timeval tv[2]; \
     struct timeval *time; \
-    if (utime->now) \
+    if (ut->now) \
         time = NULL; \
     else { \
-        tv[0].tv_sec = utime->atime_s; \
-        tv[0].tv_usec = utime->atime_ns / 1000; \
-        tv[1].tv_sec = utime->mtime_s; \
-        tv[1].tv_usec = utime->mtime_ns / 1000; \
+        tv[0].tv_sec = ut->atime_s; \
+        tv[0].tv_usec = ut->atime_ns / 1000; \
+        tv[1].tv_sec = ut->mtime_s; \
+        tv[1].tv_usec = ut->mtime_ns / 1000; \
         time = tv; \
     } \
 
 #define UTIME_TO_UTIMBUF \
-    struct utimbuf u[2]; \
+    struct utimbuf u; \
     struct utimbuf *time; \
-    if (utime->now) \
+    if (ut->now) \
         time = NULL; \
     else { \
-        u.actime = utime->atime_s; \
-        u.modtime = utime->mtime_s; \
-        time = u; \
+        u.actime = ut->atime_s; \
+        u.modtime = ut->mtime_s; \
+        time = &u; \
     }
 
 #define UTIME_TO_TIME_T \
     time_t timet[2]; \
-    struct timet time; \
-    if (utime->now) \
+    time_t *time; \
+    if (ut->now) \
         time = NULL; \
     else { \
-        timet[0] = utime->atime_s; \
-        timet[1] = utime->mtime_s; \
-        time = &timet; \
+        timet[0] = ut->atime_s; \
+        timet[1] = ut->mtime_s; \
+        time = timet; \
     } \
 
 
@@ -4637,7 +4761,7 @@
 #if UTIME_HAVE_DIR_FD
 
 static int
-utime_dir_fd(utime_t *utime, int dir_fd, char *path, int follow_symlinks)
+utime_dir_fd(utime_t *ut, int dir_fd, char *path, int follow_symlinks)
 {
 #ifdef HAVE_UTIMENSAT
     int flags = follow_symlinks ? 0 : AT_SYMLINK_NOFOLLOW;
@@ -4662,7 +4786,7 @@
 #if UTIME_HAVE_FD
 
 static int
-utime_fd(utime_t *utime, int fd)
+utime_fd(utime_t *ut, int fd)
 {
 #ifdef HAVE_FUTIMENS
     UTIME_TO_TIMESPEC;
@@ -4682,7 +4806,7 @@
 #if UTIME_HAVE_NOFOLLOW_SYMLINKS
 
 static int
-utime_nofollow_symlinks(utime_t *utime, char *path)
+utime_nofollow_symlinks(utime_t *ut, char *path)
 {
 #ifdef HAVE_UTIMENSAT
     UTIME_TO_TIMESPEC;
@@ -4698,7 +4822,7 @@
 #ifndef MS_WINDOWS
 
 static int
-utime_default(utime_t *utime, char *path)
+utime_default(utime_t *ut, char *path)
 {
 #ifdef HAVE_UTIMENSAT
     UTIME_TO_TIMESPEC;
@@ -4761,6 +4885,7 @@
     PyObject *return_value = NULL;
 
     memset(&path, 0, sizeof(path));
+    path.function_name = "utime";
     memset(&utime, 0, sizeof(utime_t));
 #if UTIME_HAVE_FD
     path.allow_fd = 1;
@@ -4796,9 +4921,9 @@
         }
         utime.now = 0;
         if (_PyTime_ObjectToTimespec(PyTuple_GET_ITEM(times, 0),
-                                     &a_sec, &a_nsec) == -1 ||
+                                     &a_sec, &a_nsec, _PyTime_ROUND_DOWN) == -1 ||
             _PyTime_ObjectToTimespec(PyTuple_GET_ITEM(times, 1),
-                                     &m_sec, &m_nsec) == -1) {
+                                     &m_sec, &m_nsec, _PyTime_ROUND_DOWN) == -1) {
             goto exit;
         }
         utime.atime_s = a_sec;
@@ -4856,18 +4981,13 @@
                             FILE_FLAG_BACKUP_SEMANTICS, NULL);
     Py_END_ALLOW_THREADS
     if (hFile == INVALID_HANDLE_VALUE) {
-        win32_error_object("utime", path.object);
+        path_error(&path);
         goto exit;
     }
 
     if (utime.now) {
-        SYSTEMTIME now;
-        GetSystemTime(&now);
-        if (!SystemTimeToFileTime(&now, &mtime) ||
-            !SystemTimeToFileTime(&now, &atime)) {
-            win32_error("utime", NULL);
-            goto exit;
-        }
+        GetSystemTimeAsFileTime(&mtime);
+        atime = mtime;
     }
     else {
         time_t_to_FILE_TIME(utime.atime_s, utime.atime_ns, &atime);
@@ -4878,7 +4998,7 @@
            as that may confuse the user into believing that
            something is wrong with the file, when it also
            could be the time stamp that gives a problem. */
-        win32_error("utime", NULL);
+        PyErr_SetFromWindowsErr(0);
         goto exit;
     }
 #else /* MS_WINDOWS */
@@ -4961,8 +5081,10 @@
         return 0;
     size = PyBytes_GET_SIZE(bytes);
     *out = PyMem_Malloc(size+1);
-    if (!*out)
+    if (!*out) {
+        PyErr_NoMemory();
         return 0;
+    }
     memcpy(*out, PyBytes_AsString(bytes), size+1);
     Py_DECREF(bytes);
     return 1;
@@ -4990,8 +5112,10 @@
     }
     envc = 0;
     keys = PyMapping_Keys(env);
+    if (!keys)
+        goto error;
     vals = PyMapping_Values(env);
-    if (!keys || !vals)
+    if (!vals)
         goto error;
     if (!PyList_Check(keys) || !PyList_Check(vals)) {
         PyErr_Format(PyExc_TypeError,
@@ -5012,10 +5136,6 @@
             goto error;
         }
 
-#if defined(PYOS_OS2)
-        /* Omit Pseudo-Env Vars that Would Confuse Programs if Passed On */
-        if (stricmp(k, "BEGINLIBPATH") != 0 && stricmp(k, "ENDLIBPATH") != 0) {
-#endif
         k = PyBytes_AsString(key2);
         v = PyBytes_AsString(val2);
         len = PyBytes_GET_SIZE(key2) + PyBytes_GET_SIZE(val2) + 2;
@@ -5031,9 +5151,6 @@
         envlist[envc++] = p;
         Py_DECREF(key2);
         Py_DECREF(val2);
-#if defined(PYOS_OS2)
-        }
-#endif
     }
     Py_DECREF(vals);
     Py_DECREF(keys);
@@ -5159,6 +5276,7 @@
        like posix.environ. */
 
     memset(&path, 0, sizeof(path));
+    path.function_name = "execve";
 #ifdef HAVE_FEXECVE
     path.allow_fd = 1;
 #endif
@@ -5198,7 +5316,7 @@
 
     /* If we get here it's definitely an error */
 
-    path_posix_error("execve", &path);
+    path_error(&path);
 
     while (--envc >= 0)
         PyMem_DEL(envlist[envc]);
@@ -5274,18 +5392,12 @@
     }
     argvlist[argc] = NULL;
 
-#if defined(PYOS_OS2) && defined(PYCC_GCC)
-    Py_BEGIN_ALLOW_THREADS
-    spawnval = spawnv(mode, path, argvlist);
-    Py_END_ALLOW_THREADS
-#else
     if (mode == _OLD_P_OVERLAY)
         mode = _P_OVERLAY;
 
     Py_BEGIN_ALLOW_THREADS
     spawnval = _spawnv(mode, path, argvlist);
     Py_END_ALLOW_THREADS
-#endif
 
     free_string_array(argvlist, argc);
     Py_DECREF(opath);
@@ -5293,11 +5405,7 @@
     if (spawnval == -1)
         return posix_error();
     else
-#if SIZEOF_LONG == SIZEOF_VOID_P
-        return Py_BuildValue("l", (long) spawnval);
-#else
-        return Py_BuildValue("L", (PY_LONG_LONG) spawnval);
-#endif
+        return Py_BuildValue(_Py_PARSE_INTPTR, spawnval);
 }
 
 
@@ -5373,27 +5481,17 @@
     if (envlist == NULL)
         goto fail_1;
 
-#if defined(PYOS_OS2) && defined(PYCC_GCC)
-    Py_BEGIN_ALLOW_THREADS
-    spawnval = spawnve(mode, path, argvlist, envlist);
-    Py_END_ALLOW_THREADS
-#else
     if (mode == _OLD_P_OVERLAY)
         mode = _P_OVERLAY;
 
     Py_BEGIN_ALLOW_THREADS
     spawnval = _spawnve(mode, path, argvlist, envlist);
     Py_END_ALLOW_THREADS
-#endif
 
     if (spawnval == -1)
         (void) posix_error();
     else
-#if SIZEOF_LONG == SIZEOF_VOID_P
-        res = Py_BuildValue("l", (long) spawnval);
-#else
-        res = Py_BuildValue("L", (PY_LONG_LONG) spawnval);
-#endif
+        res = Py_BuildValue(_Py_PARSE_INTPTR, spawnval);
 
     while (--envc >= 0)
         PyMem_DEL(envlist[envc]);
@@ -5405,183 +5503,6 @@
     return res;
 }
 
-/* OS/2 supports spawnvp & spawnvpe natively */
-#if defined(PYOS_OS2)
-PyDoc_STRVAR(posix_spawnvp__doc__,
-"spawnvp(mode, file, args)\n\n\
-Execute the program 'file' in a new process, using the environment\n\
-search path to find the file.\n\
-\n\
-    mode: mode of process creation\n\
-    file: executable file name\n\
-    args: tuple or list of strings");
-
-static PyObject *
-posix_spawnvp(PyObject *self, PyObject *args)
-{
-    PyObject *opath;
-    char *path;
-    PyObject *argv;
-    char **argvlist;
-    int mode, i, argc;
-    Py_intptr_t spawnval;
-    PyObject *(*getitem)(PyObject *, Py_ssize_t);
-
-    /* spawnvp has three arguments: (mode, path, argv), where
-       argv is a list or tuple of strings. */
-
-    if (!PyArg_ParseTuple(args, "iO&O:spawnvp", &mode,
-                          PyUnicode_FSConverter,
-                          &opath, &argv))
-        return NULL;
-    path = PyBytes_AsString(opath);
-    if (PyList_Check(argv)) {
-        argc = PyList_Size(argv);
-        getitem = PyList_GetItem;
-    }
-    else if (PyTuple_Check(argv)) {
-        argc = PyTuple_Size(argv);
-        getitem = PyTuple_GetItem;
-    }
-    else {
-        PyErr_SetString(PyExc_TypeError,
-                        "spawnvp() arg 2 must be a tuple or list");
-        Py_DECREF(opath);
-        return NULL;
-    }
-
-    argvlist = PyMem_NEW(char *, argc+1);
-    if (argvlist == NULL) {
-        Py_DECREF(opath);
-        return PyErr_NoMemory();
-    }
-    for (i = 0; i < argc; i++) {
-        if (!fsconvert_strdup((*getitem)(argv, i),
-                              &argvlist[i])) {
-            free_string_array(argvlist, i);
-            PyErr_SetString(
-                PyExc_TypeError,
-                "spawnvp() arg 2 must contain only strings");
-            Py_DECREF(opath);
-            return NULL;
-        }
-    }
-    argvlist[argc] = NULL;
-
-    Py_BEGIN_ALLOW_THREADS
-#if defined(PYCC_GCC)
-    spawnval = spawnvp(mode, path, argvlist);
-#else
-    spawnval = _spawnvp(mode, path, argvlist);
-#endif
-    Py_END_ALLOW_THREADS
-
-    free_string_array(argvlist, argc);
-    Py_DECREF(opath);
-
-    if (spawnval == -1)
-        return posix_error();
-    else
-        return Py_BuildValue("l", (long) spawnval);
-}
-
-
-PyDoc_STRVAR(posix_spawnvpe__doc__,
-"spawnvpe(mode, file, args, env)\n\n\
-Execute the program 'file' in a new process, using the environment\n\
-search path to find the file.\n\
-\n\
-    mode: mode of process creation\n\
-    file: executable file name\n\
-    args: tuple or list of arguments\n\
-    env: dictionary of strings mapping to strings");
-
-static PyObject *
-posix_spawnvpe(PyObject *self, PyObject *args)
-{
-    PyObject *opath;
-    char *path;
-    PyObject *argv, *env;
-    char **argvlist;
-    char **envlist;
-    PyObject *res=NULL;
-    int mode;
-    Py_ssize_t argc, i, envc;
-    Py_intptr_t spawnval;
-    PyObject *(*getitem)(PyObject *, Py_ssize_t);
-    int lastarg = 0;
-
-    /* spawnvpe has four arguments: (mode, path, argv, env), where
-       argv is a list or tuple of strings and env is a dictionary
-       like posix.environ. */
-
-    if (!PyArg_ParseTuple(args, "ietOO:spawnvpe", &mode,
-                          PyUnicode_FSConverter,
-                          &opath, &argv, &env))
-        return NULL;
-    path = PyBytes_AsString(opath);
-    if (PyList_Check(argv)) {
-        argc = PyList_Size(argv);
-        getitem = PyList_GetItem;
-    }
-    else if (PyTuple_Check(argv)) {
-        argc = PyTuple_Size(argv);
-        getitem = PyTuple_GetItem;
-    }
-    else {
-        PyErr_SetString(PyExc_TypeError,
-                        "spawnvpe() arg 2 must be a tuple or list");
-        goto fail_0;
-    }
-    if (!PyMapping_Check(env)) {
-        PyErr_SetString(PyExc_TypeError,
-                        "spawnvpe() arg 3 must be a mapping object");
-        goto fail_0;
-    }
-
-    argvlist = PyMem_NEW(char *, argc+1);
-    if (argvlist == NULL) {
-        PyErr_NoMemory();
-        goto fail_0;
-    }
-    for (i = 0; i < argc; i++) {
-        if (!fsconvert_strdup((*getitem)(argv, i),
-                              &argvlist[i]))
-        {
-            lastarg = i;
-            goto fail_1;
-        }
-    }
-    lastarg = argc;
-    argvlist[argc] = NULL;
-
-    envlist = parse_envlist(env, &envc);
-    if (envlist == NULL)
-        goto fail_1;
-
-    Py_BEGIN_ALLOW_THREADS
-#if defined(PYCC_GCC)
-    spawnval = spawnvpe(mode, path, argvlist, envlist);
-#else
-    spawnval = _spawnvpe(mode, path, argvlist, envlist);
-#endif
-    Py_END_ALLOW_THREADS
-
-    if (spawnval == -1)
-        (void) posix_error();
-    else
-        res = Py_BuildValue("l", (long) spawnval);
-
-    while (--envc >= 0)
-        PyMem_DEL(envlist[envc]);
-    PyMem_DEL(envlist);
-  fail_1:
-    free_string_array(argvlist, lastarg);
-  fail_0:
-    Py_DECREF(opath);
-    return res;
-}
-#endif /* PYOS_OS2 */
 #endif /* HAVE_SPAWNV */
 
 
@@ -6084,7 +6005,7 @@
 static PyObject *
 posix_openpty(PyObject *self, PyObject *noargs)
 {
-    int master_fd, slave_fd;
+    int master_fd = -1, slave_fd = -1;
 #ifndef HAVE_OPENPTY
     char * slave_name;
 #endif
@@ -6097,37 +6018,56 @@
 
 #ifdef HAVE_OPENPTY
     if (openpty(&master_fd, &slave_fd, NULL, NULL, NULL) != 0)
-        return posix_error();
+        goto posix_error;
+
+    if (_Py_set_inheritable(master_fd, 0, NULL) < 0)
+        goto error;
+    if (_Py_set_inheritable(slave_fd, 0, NULL) < 0)
+        goto error;
+
 #elif defined(HAVE__GETPTY)
     slave_name = _getpty(&master_fd, O_RDWR, 0666, 0);
     if (slave_name == NULL)
-        return posix_error();
+        goto posix_error;
+    if (_Py_set_inheritable(master_fd, 0, NULL) < 0)
+        goto error;
 
-    slave_fd = open(slave_name, O_RDWR);
+    slave_fd = _Py_open(slave_name, O_RDWR);
     if (slave_fd < 0)
-        return posix_error();
+        goto posix_error;
+
 #else
     master_fd = open(DEV_PTY_FILE, O_RDWR | O_NOCTTY); /* open master */
     if (master_fd < 0)
-        return posix_error();
+        goto posix_error;
+
     sig_saved = PyOS_setsig(SIGCHLD, SIG_DFL);
+
     /* change permission of slave */
     if (grantpt(master_fd) < 0) {
         PyOS_setsig(SIGCHLD, sig_saved);
-        return posix_error();
+        goto posix_error;
     }
+
     /* unlock slave */
     if (unlockpt(master_fd) < 0) {
         PyOS_setsig(SIGCHLD, sig_saved);
-        return posix_error();
+        goto posix_error;
     }
+
     PyOS_setsig(SIGCHLD, sig_saved);
+
     slave_name = ptsname(master_fd); /* get name of slave */
     if (slave_name == NULL)
-        return posix_error();
-    slave_fd = open(slave_name, O_RDWR | O_NOCTTY); /* open slave */
+        goto posix_error;
+
+    slave_fd = _Py_open(slave_name, O_RDWR | O_NOCTTY); /* open slave */
     if (slave_fd < 0)
-        return posix_error();
+        goto posix_error;
+
+    if (_Py_set_inheritable(master_fd, 0, NULL) < 0)
+        goto posix_error;
+
 #if !defined(__CYGWIN__) && !defined(HAVE_DEV_PTC)
     ioctl(slave_fd, I_PUSH, "ptem"); /* push ptem */
     ioctl(slave_fd, I_PUSH, "ldterm"); /* push ldterm */
@@ -6139,6 +6079,16 @@
 
     return Py_BuildValue("(ii)", master_fd, slave_fd);
 
+posix_error:
+    posix_error();
+#if defined(HAVE_OPENPTY) || defined(HAVE__GETPTY)
+error:
+#endif
+    if (master_fd != -1)
+        close(master_fd);
+    if (slave_fd != -1)
+        close(slave_fd);
+    return NULL;
 }
 #endif /* defined(HAVE_OPENPTY) || defined(HAVE__GETPTY) || defined(HAVE_DEV_PTMX) */
 
@@ -6631,23 +6581,8 @@
     int sig;
     if (!PyArg_ParseTuple(args, _Py_PARSE_PID "i:kill", &pid, &sig))
         return NULL;
-#if defined(PYOS_OS2) && !defined(PYCC_GCC)
-    if (sig == XCPT_SIGNAL_INTR || sig == XCPT_SIGNAL_BREAK) {
-        APIRET rc;
-        if ((rc = DosSendSignalException(pid, sig)) != NO_ERROR)
-            return os2_error(rc);
-
-    } else if (sig == XCPT_SIGNAL_KILLPROC) {
-        APIRET rc;
-        if ((rc = DosKillProcess(DKP_PROCESS, pid)) != NO_ERROR)
-            return os2_error(rc);
-
-    } else
-        return NULL; /* Unrecognized Signal Requested */
-#else
     if (kill(pid, sig) == -1)
         return posix_error();
-#endif
     Py_INCREF(Py_None);
     return Py_None;
 }
@@ -6685,16 +6620,17 @@
 win32_kill(PyObject *self, PyObject *args)
 {
     PyObject *result;
-    DWORD pid, sig, err;
+    pid_t pid;
+    DWORD sig, err;
     HANDLE handle;
 
-    if (!PyArg_ParseTuple(args, "kk:kill", &pid, &sig))
+    if (!PyArg_ParseTuple(args, _Py_PARSE_PID "k:kill", &pid, &sig))
         return NULL;
 
     /* Console processes which share a common console can be sent CTRL+C or
        CTRL+BREAK events, provided they handle said events. */
     if (sig == CTRL_C_EVENT || sig == CTRL_BREAK_EVENT) {
-        if (GenerateConsoleCtrlEvent(sig, pid) == 0) {
+        if (GenerateConsoleCtrlEvent(sig, (DWORD)pid) == 0) {
             err = GetLastError();
             PyErr_SetFromWindowsErr(err);
         }
@@ -6704,7 +6640,7 @@
 
     /* If the signal is outside of what GenerateConsoleCtrlEvent can use,
        attempt to open and terminate the process. */
-    handle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid);
+    handle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, (DWORD)pid);
     if (handle == NULL) {
         err = GetLastError();
         return PyErr_SetFromWindowsErr(err);
@@ -7110,7 +7046,7 @@
     Py_intptr_t pid;
     int status, options;
 
-    if (!PyArg_ParseTuple(args, _Py_PARSE_PID "i:waitpid", &pid, &options))
+    if (!PyArg_ParseTuple(args, _Py_PARSE_INTPTR "i:waitpid", &pid, &options))
         return NULL;
     Py_BEGIN_ALLOW_THREADS
     pid = _cwait(&status, pid, options);
@@ -7119,7 +7055,7 @@
         return posix_error();
 
     /* shift the status left a byte so this is more like the POSIX waitpid */
-    return Py_BuildValue("Ni", PyLong_FromPid(pid), status << 8);
+    return Py_BuildValue(_Py_PARSE_INTPTR "i", pid, status << 8);
 }
 #endif /* HAVE_WAITPID || HAVE_CWAIT */
 
@@ -7170,6 +7106,7 @@
     static char *keywords[] = {"path", "dir_fd", NULL};
 
     memset(&path, 0, sizeof(path));
+    path.function_name = "readlink";
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&|$O&:readlink", keywords,
                           path_converter, &path,
 #ifdef HAVE_READLINKAT
@@ -7190,7 +7127,7 @@
     Py_END_ALLOW_THREADS
 
     if (length < 0) {
-        return_value = path_posix_error("readlink", &path);
+        return_value = path_error(&path);
         goto exit;
     }
 
@@ -7226,8 +7163,9 @@
 /* Grab CreateSymbolicLinkW dynamically from kernel32 */
 static DWORD (CALLBACK *Py_CreateSymbolicLinkW)(LPWSTR, LPWSTR, DWORD) = NULL;
 static DWORD (CALLBACK *Py_CreateSymbolicLinkA)(LPSTR, LPSTR, DWORD) = NULL;
+
 static int
-check_CreateSymbolicLink()
+check_CreateSymbolicLink(void)
 {
     HINSTANCE hKernel32;
     /* only recheck */
@@ -7241,55 +7179,57 @@
     return (Py_CreateSymbolicLinkW && Py_CreateSymbolicLinkA);
 }
 
-void _dirnameW(WCHAR *path) {
-    /* Remove the last portion of the path */
-
+/* Remove the last portion of the path */
+static void
+_dirnameW(WCHAR *path)
+{
     WCHAR *ptr;
 
     /* walk the path from the end until a backslash is encountered */
-    for(ptr = path + wcslen(path); ptr != path; ptr--)
-    {
-        if(*ptr == *L"\\" || *ptr == *L"/") {
+    for(ptr = path + wcslen(path); ptr != path; ptr--) {
+        if (*ptr == L'\\' || *ptr == L'/')
             break;
-        }
     }
     *ptr = 0;
 }
 
-void _dirnameA(char *path) {
-    /* Remove the last portion of the path */
-
+/* Remove the last portion of the path */
+static void
+_dirnameA(char *path)
+{
     char *ptr;
 
     /* walk the path from the end until a backslash is encountered */
-    for(ptr = path + strlen(path); ptr != path; ptr--)
-    {
-        if(*ptr == '\\' || *ptr == '/') {
+    for(ptr = path + strlen(path); ptr != path; ptr--) {
+        if (*ptr == '\\' || *ptr == '/')
             break;
-        }
     }
     *ptr = 0;
 }
 
-int _is_absW(WCHAR *path) {
-    /* Is this path absolute? */
-
+/* Is this path absolute? */
+static int
+_is_absW(const WCHAR *path)
+{
     return path[0] == L'\\' || path[0] == L'/' || path[1] == L':';
 
 }
 
-int _is_absA(char *path) {
-    /* Is this path absolute? */
-
+/* Is this path absolute? */
+static int
+_is_absA(const char *path)
+{
     return path[0] == '\\' || path[0] == '/' || path[1] == ':';
 
 }
 
-void _joinW(WCHAR *dest_path, const WCHAR *root, const WCHAR *rest) {
-    /* join root and rest with a backslash */
-    int root_len;
+/* join root and rest with a backslash */
+static void
+_joinW(WCHAR *dest_path, const WCHAR *root, const WCHAR *rest)
+{
+    size_t root_len;
 
-    if(_is_absW(rest)) {
+    if (_is_absW(rest)) {
         wcscpy(dest_path, rest);
         return;
     }
@@ -7298,17 +7238,19 @@
 
     wcscpy(dest_path, root);
     if(root_len) {
-        dest_path[root_len] = *L"\\";
-        root_len += 1;
+        dest_path[root_len] = L'\\';
+        root_len++;
     }
     wcscpy(dest_path+root_len, rest);
 }
 
-void _joinA(char *dest_path, const char *root, const char *rest) {
-    /* join root and rest with a backslash */
-    int root_len;
+/* join root and rest with a backslash */
+static void
+_joinA(char *dest_path, const char *root, const char *rest)
+{
+    size_t root_len;
 
-    if(_is_absA(rest)) {
+    if (_is_absA(rest)) {
         strcpy(dest_path, rest);
         return;
     }
@@ -7318,14 +7260,15 @@
     strcpy(dest_path, root);
     if(root_len) {
         dest_path[root_len] = '\\';
-        root_len += 1;
+        root_len++;
     }
     strcpy(dest_path+root_len, rest);
 }
 
-int _check_dirW(WCHAR *src, WCHAR *dest)
+/* Return True if the path at src relative to dest is a directory */
+static int
+_check_dirW(WCHAR *src, WCHAR *dest)
 {
-    /* Return True if the path at src relative to dest is a directory */
     WIN32_FILE_ATTRIBUTE_DATA src_info;
     WCHAR dest_parent[MAX_PATH];
     WCHAR src_resolved[MAX_PATH] = L"";
@@ -7341,18 +7284,19 @@
     );
 }
 
-int _check_dirA(char *src, char *dest)
+/* Return True if the path at src relative to dest is a directory */
+static int
+_check_dirA(char *src, char *dest)
 {
-    /* Return True if the path at src relative to dest is a directory */
     WIN32_FILE_ATTRIBUTE_DATA src_info;
     char dest_parent[MAX_PATH];
     char src_resolved[MAX_PATH] = "";
 
     /* dest_parent = os.path.dirname(dest) */
     strcpy(dest_parent, dest);
-    _dirnameW(dest_parent);
+    _dirnameA(dest_parent);
     /* src_resolved = os.path.join(dest_parent, src) */
-    _joinW(src_resolved, dest_parent, src);
+    _joinA(src_resolved, dest_parent, src);
     return (
         GetFileAttributesExA(src_resolved, GetFileExInfoStandard, &src_info)
         && src_info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY
@@ -7378,8 +7322,10 @@
 #endif
 
     memset(&src, 0, sizeof(src));
+    src.function_name = "symlink";
     src.argument_name = "src";
     memset(&dst, 0, sizeof(dst));
+    dst.function_name = "symlink";
     dst.argument_name = "dst";
 
 #ifdef MS_WINDOWS
@@ -7432,7 +7378,7 @@
     Py_END_ALLOW_THREADS
 
     if (!result) {
-        return_value = win32_error_object("symlink", src.object);
+        return_value = path_error2(&src, &dst);
         goto exit;
     }
 
@@ -7448,7 +7394,7 @@
     Py_END_ALLOW_THREADS
 
     if (result) {
-        return_value = path_error("symlink", &dst);
+        return_value = path_error2(&src, &dst);
         goto exit;
     }
 #endif
@@ -7610,31 +7556,7 @@
 times.  The object behaves like a named tuple with these fields:\n\
   (utime, stime, cutime, cstime, elapsed_time)");
 
-#if defined(PYCC_VACPP) && defined(PYOS_OS2)
-static long
-system_uptime(void)
-{
-    ULONG     value = 0;
-
-    Py_BEGIN_ALLOW_THREADS
-    DosQuerySysInfo(QSV_MS_COUNT, QSV_MS_COUNT, &value, sizeof(value));
-    Py_END_ALLOW_THREADS
-
-    return value;
-}
-
-static PyObject *
-posix_times(PyObject *self, PyObject *noargs)
-{
-    /* Currently Only Uptime is Provided -- Others Later */
-    return build_times_result(
-                         (double)0 /* t.tms_utime / HZ */,
-                         (double)0 /* t.tms_stime / HZ */,
-                         (double)0 /* t.tms_cutime / HZ */,
-                         (double)0 /* t.tms_cstime / HZ */,
-                         (double)system_uptime() / 1000);
-}
-#elif defined(MS_WINDOWS)
+#if defined(MS_WINDOWS)
 static PyObject *
 posix_times(PyObject *self, PyObject *noargs)
 {
@@ -7656,7 +7578,7 @@
         (double)0,
         (double)0);
 }
-#else /* Neither Windows nor OS/2 */
+#else /* Not Windows */
 #define NEED_TICKS_PER_SECOND
 static long ticks_per_second = -1;
 static PyObject *
@@ -7776,6 +7698,10 @@
 
 /* Functions acting on file descriptors */
 
+#ifdef O_CLOEXEC
+extern int _Py_open_cloexec_works;
+#endif
+
 PyDoc_STRVAR(posix_open__doc__,
 "open(path, flags, mode=0o777, *, dir_fd=None)\n\n\
 Open a file for low level IO.  Returns a file handle (integer).\n\
@@ -7795,8 +7721,14 @@
     int fd;
     PyObject *return_value = NULL;
     static char *keywords[] = {"path", "flags", "mode", "dir_fd", NULL};
+#ifdef O_CLOEXEC
+    int *atomic_flag_works = &_Py_open_cloexec_works;
+#elif !defined(MS_WINDOWS)
+    int *atomic_flag_works = NULL;
+#endif
 
     memset(&path, 0, sizeof(path));
+    path.function_name = "open";
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&i|i$O&:open", keywords,
         path_converter, &path,
         &flags, &mode,
@@ -7808,6 +7740,12 @@
         ))
         return NULL;
 
+#ifdef MS_WINDOWS
+    flags |= O_NOINHERIT;
+#elif defined(O_CLOEXEC)
+    flags |= O_CLOEXEC;
+#endif
+
     Py_BEGIN_ALLOW_THREADS
 #ifdef MS_WINDOWS
     if (path.wide)
@@ -7823,16 +7761,17 @@
     Py_END_ALLOW_THREADS
 
     if (fd == -1) {
-#ifdef MS_WINDOWS
-        /* force use of posix_error here for exact backwards compatibility */
-        if (path.wide)
-            return_value = posix_error();
-        else
-#endif
-        return_value = path_error("open", &path);
+        PyErr_SetFromErrnoWithFilenameObject(PyExc_OSError, path.object);
         goto exit;
     }
 
+#ifndef MS_WINDOWS
+    if (_Py_set_inheritable(fd, 0, atomic_flag_works) < 0) {
+        close(fd);
+        goto exit;
+    }
+#endif
+
     return_value = PyLong_FromLong((long)fd);
 
 exit:
@@ -7893,13 +7832,14 @@
 posix_dup(PyObject *self, PyObject *args)
 {
     int fd;
+
     if (!PyArg_ParseTuple(args, "i:dup", &fd))
         return NULL;
-    if (!_PyVerify_fd(fd))
-        return posix_error();
-    fd = dup(fd);
-    if (fd < 0)
-        return posix_error();
+
+    fd = _Py_dup(fd);
+    if (fd == -1)
+        return NULL;
+
     return PyLong_FromLong((long)fd);
 }
 
@@ -7909,16 +7849,82 @@
 Duplicate file descriptor.");
 
 static PyObject *
-posix_dup2(PyObject *self, PyObject *args)
+posix_dup2(PyObject *self, PyObject *args, PyObject *kwargs)
 {
-    int fd, fd2, res;
-    if (!PyArg_ParseTuple(args, "ii:dup2", &fd, &fd2))
+    static char *keywords[] = {"fd", "fd2", "inheritable", NULL};
+    int fd, fd2;
+    int inheritable = 1;
+    int res;
+#if defined(HAVE_DUP3) && \
+    !(defined(HAVE_FCNTL_H) && defined(F_DUP2FD_CLOEXEC))
+    /* dup3() is available on Linux 2.6.27+ and glibc 2.9 */
+    int dup3_works = -1;
+#endif
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "ii|i:dup2", keywords,
+                                     &fd, &fd2, &inheritable))
         return NULL;
+
     if (!_PyVerify_fd_dup2(fd, fd2))
         return posix_error();
+
+#ifdef MS_WINDOWS
+    Py_BEGIN_ALLOW_THREADS
     res = dup2(fd, fd2);
+    Py_END_ALLOW_THREADS
     if (res < 0)
         return posix_error();
+
+    /* Character files like console cannot be make non-inheritable */
+    if (!inheritable && _Py_set_inheritable(fd2, 0, NULL) < 0) {
+        close(fd2);
+        return NULL;
+    }
+
+#elif defined(HAVE_FCNTL_H) && defined(F_DUP2FD_CLOEXEC)
+    Py_BEGIN_ALLOW_THREADS
+    if (!inheritable)
+        res = fcntl(fd, F_DUP2FD_CLOEXEC, fd2);
+    else
+        res = dup2(fd, fd2);
+    Py_END_ALLOW_THREADS
+    if (res < 0)
+        return posix_error();
+
+#else
+
+#ifdef HAVE_DUP3
+    if (!inheritable && dup3_works != 0) {
+        Py_BEGIN_ALLOW_THREADS
+        res = dup3(fd, fd2, O_CLOEXEC);
+        Py_END_ALLOW_THREADS
+        if (res < 0) {
+            if (dup3_works == -1)
+                dup3_works = (errno != ENOSYS);
+            if (dup3_works)
+                return posix_error();
+        }
+    }
+
+    if (inheritable || dup3_works == 0)
+    {
+#endif
+        Py_BEGIN_ALLOW_THREADS
+        res = dup2(fd, fd2);
+        Py_END_ALLOW_THREADS
+        if (res < 0)
+            return posix_error();
+
+        if (!inheritable && _Py_set_inheritable(fd2, 0, NULL) < 0) {
+            close(fd2);
+            return NULL;
+        }
+#ifdef HAVE_DUP3
+    }
+#endif
+
+#endif
+
     Py_INCREF(Py_None);
     return Py_None;
 }
@@ -7962,7 +7968,7 @@
 posix_lseek(PyObject *self, PyObject *args)
 {
     int fd, how;
-#if defined(MS_WIN64) || defined(MS_WINDOWS)
+#ifdef MS_WINDOWS
     PY_LONG_LONG pos, res;
 #else
     off_t pos, res;
@@ -7990,7 +7996,7 @@
     if (!_PyVerify_fd(fd))
         return posix_error();
     Py_BEGIN_ALLOW_THREADS
-#if defined(MS_WIN64) || defined(MS_WINDOWS)
+#ifdef MS_WINDOWS
     res = _lseeki64(fd, pos, how);
 #else
     res = lseek(fd, pos, how);
@@ -8202,7 +8208,7 @@
     }
     len = pbuf.len;
     Py_BEGIN_ALLOW_THREADS
-#if defined(MS_WIN64) || defined(MS_WINDOWS)
+#ifdef MS_WINDOWS
     if (len > INT_MAX)
         len = INT_MAX;
     size = write(fd, pbuf.buf, (int)len);
@@ -8239,12 +8245,13 @@
     off_t sbytes;
     struct sf_hdtr sf;
     int flags = 0;
-    sf.headers = NULL;
-    sf.trailers = NULL;
     static char *keywords[] = {"out", "in",
                                 "offset", "count",
                                 "headers", "trailers", "flags", NULL};
 
+    sf.headers = NULL;
+    sf.trailers = NULL;
+
 #ifdef __APPLE__
     if (!PyArg_ParseTupleAndKeywords(args, kwdict, "iiO&O&|OOi:sendfile",
         keywords, &out, &in, _parse_off_t, &offset, _parse_off_t, &sbytes,
@@ -8368,16 +8375,12 @@
     int res;
     if (!PyArg_ParseTuple(args, "i:fstat", &fd))
         return NULL;
-#ifdef __VMS
-    /* on OpenVMS we must ensure that all bytes are written to the file */
-    fsync(fd);
-#endif
     Py_BEGIN_ALLOW_THREADS
     res = FSTAT(fd, &st);
     Py_END_ALLOW_THREADS
     if (res != 0) {
 #ifdef MS_WINDOWS
-        return win32_error("fstat", NULL);
+        return PyErr_SetFromWindowsErr(0);
 #else
         return posix_error();
 #endif
@@ -8410,35 +8413,69 @@
 static PyObject *
 posix_pipe(PyObject *self, PyObject *noargs)
 {
-#if defined(PYOS_OS2)
-    HFILE read, write;
-    APIRET rc;
-
-    rc = DosCreatePipe( &read, &write, 4096);
-    if (rc != NO_ERROR)
-        return os2_error(rc);
-
-    return Py_BuildValue("(ii)", read, write);
-#else
-#if !defined(MS_WINDOWS)
     int fds[2];
-    int res;
-    res = pipe(fds);
-    if (res != 0)
-        return posix_error();
-    return Py_BuildValue("(ii)", fds[0], fds[1]);
-#else /* MS_WINDOWS */
+#ifdef MS_WINDOWS
     HANDLE read, write;
-    int read_fd, write_fd;
+    SECURITY_ATTRIBUTES attr;
     BOOL ok;
-    ok = CreatePipe(&read, &write, NULL, 0);
-    if (!ok)
-        return win32_error("CreatePipe", NULL);
-    read_fd = _open_osfhandle((Py_intptr_t)read, 0);
-    write_fd = _open_osfhandle((Py_intptr_t)write, 1);
-    return Py_BuildValue("(ii)", read_fd, write_fd);
-#endif /* MS_WINDOWS */
+#else
+    int res;
 #endif
+
+#ifdef MS_WINDOWS
+    attr.nLength = sizeof(attr);
+    attr.lpSecurityDescriptor = NULL;
+    attr.bInheritHandle = FALSE;
+
+    Py_BEGIN_ALLOW_THREADS
+    ok = CreatePipe(&read, &write, &attr, 0);
+    if (ok) {
+        fds[0] = _open_osfhandle((Py_intptr_t)read, _O_RDONLY);
+        fds[1] = _open_osfhandle((Py_intptr_t)write, _O_WRONLY);
+        if (fds[0] == -1 || fds[1] == -1) {
+            CloseHandle(read);
+            CloseHandle(write);
+            ok = 0;
+        }
+    }
+    Py_END_ALLOW_THREADS
+
+    if (!ok)
+        return PyErr_SetFromWindowsErr(0);
+#else
+
+#ifdef HAVE_PIPE2
+    Py_BEGIN_ALLOW_THREADS
+    res = pipe2(fds, O_CLOEXEC);
+    Py_END_ALLOW_THREADS
+
+    if (res != 0 && errno == ENOSYS)
+    {
+#endif
+        Py_BEGIN_ALLOW_THREADS
+        res = pipe(fds);
+        Py_END_ALLOW_THREADS
+
+        if (res == 0) {
+            if (_Py_set_inheritable(fds[0], 0, NULL) < 0) {
+                close(fds[0]);
+                close(fds[1]);
+                return NULL;
+            }
+            if (_Py_set_inheritable(fds[1], 0, NULL) < 0) {
+                close(fds[0]);
+                close(fds[1]);
+                return NULL;
+            }
+        }
+#ifdef HAVE_PIPE2
+    }
+#endif
+
+    if (res != 0)
+        return PyErr_SetFromErrno(PyExc_OSError);
+#endif /* !MS_WINDOWS */
+    return Py_BuildValue("(ii)", fds[0], fds[1]);
 }
 #endif  /* HAVE_PIPE */
 
@@ -8616,16 +8653,16 @@
 {
     path_t path;
     int mode = 0666;
-    int device = 0;
+    dev_t device = 0;
     int dir_fd = DEFAULT_DIR_FD;
     int result;
     PyObject *return_value = NULL;
     static char *keywords[] = {"path", "mode", "device", "dir_fd", NULL};
 
     memset(&path, 0, sizeof(path));
-    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&|ii$O&:mknod", keywords,
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&|iO&$O&:mknod", keywords,
         path_converter, &path,
-        &mode, &device,
+        &mode, _Py_Dev_Converter, &device,
 #ifdef HAVE_MKNODAT
         dir_fd_converter, &dir_fd
 #else
@@ -8665,8 +8702,8 @@
 static PyObject *
 posix_major(PyObject *self, PyObject *args)
 {
-    int device;
-    if (!PyArg_ParseTuple(args, "i:major", &device))
+    dev_t device;
+    if (!PyArg_ParseTuple(args, "O&:major", _Py_Dev_Converter, &device))
         return NULL;
     return PyLong_FromLong((long)major(device));
 }
@@ -8678,8 +8715,8 @@
 static PyObject *
 posix_minor(PyObject *self, PyObject *args)
 {
-    int device;
-    if (!PyArg_ParseTuple(args, "i:minor", &device))
+    dev_t device;
+    if (!PyArg_ParseTuple(args, "O&:minor", _Py_Dev_Converter, &device))
         return NULL;
     return PyLong_FromLong((long)minor(device));
 }
@@ -8694,7 +8731,7 @@
     int major, minor;
     if (!PyArg_ParseTuple(args, "ii:makedev", &major, &minor))
         return NULL;
-    return PyLong_FromLong((long)makedev(major, minor));
+    return _PyLong_FromDev(makedev(major, minor));
 }
 #endif /* device macros */
 
@@ -8741,6 +8778,7 @@
     static char *keywords[] = {"path", "length", NULL};
 
     memset(&path, 0, sizeof(path));
+    path.function_name = "truncate";
 #ifdef HAVE_FTRUNCATE
     path.allow_fd = 1;
 #endif
@@ -8758,7 +8796,7 @@
         res = truncate(path.narrow, length);
     Py_END_ALLOW_THREADS
     if (res < 0)
-        result = path_posix_error("truncate", &path);
+        result = path_error(&path);
     else {
         Py_INCREF(Py_None);
         result = Py_None;
@@ -8768,7 +8806,15 @@
 }
 #endif
 
-#ifdef HAVE_POSIX_FALLOCATE
+/* Issue #22396: On 32-bit AIX platform, the prototypes of os.posix_fadvise()
+   and os.posix_fallocate() in system headers are wrong if _LARGE_FILES is
+   defined, which is the case in Python on AIX. AIX bug report:
+   http://www-01.ibm.com/support/docview.wss?uid=isg1IV56170 */
+#if defined(_AIX) && defined(_LARGE_FILES) && !defined(__64BIT__)
+#  define POSIX_FADVISE_AIX_BUG
+#endif
+
+#if defined(HAVE_POSIX_FALLOCATE) && !defined(POSIX_FADVISE_AIX_BUG)
 PyDoc_STRVAR(posix_posix_fallocate__doc__,
 "posix_fallocate(fd, offset, len)\n\n\
 Ensures that enough disk space is allocated for the file specified by fd\n\
@@ -8795,7 +8841,7 @@
 }
 #endif
 
-#ifdef HAVE_POSIX_FADVISE
+#if defined(HAVE_POSIX_FADVISE) && !defined(POSIX_FADVISE_AIX_BUG)
 PyDoc_STRVAR(posix_posix_fadvise__doc__,
 "posix_fadvise(fd, offset, len, advice)\n\n\
 Announces an intention to access data in a specific pattern thus allowing\n\
@@ -9181,6 +9227,10 @@
     PyStructSequence_SET_ITEM(v, 8, PyLong_FromLong((long) st.f_flag));
     PyStructSequence_SET_ITEM(v, 9, PyLong_FromLong((long) st.f_namemax));
 #endif
+    if (PyErr_Occurred()) {
+        Py_DECREF(v);
+        return NULL;
+    }
 
     return v;
 }
@@ -9230,6 +9280,7 @@
     struct statvfs st;
 
     memset(&path, 0, sizeof(path));
+    path.function_name = "statvfs";
 #ifdef HAVE_FSTATVFS
     path.allow_fd = 1;
 #endif
@@ -9256,7 +9307,7 @@
     Py_END_ALLOW_THREADS
 
     if (result) {
-        return_value = path_posix_error("statvfs", &path);
+        return_value = path_error(&path);
         goto exit;
     }
 
@@ -9493,6 +9544,7 @@
     static char *keywords[] = {"path", "name", NULL};
 
     memset(&path, 0, sizeof(path));
+    path.function_name = "pathconf";
 #ifdef HAVE_FPATHCONF
     path.allow_fd = 1;
 #endif
@@ -9513,7 +9565,7 @@
             /* could be a path or name problem */
             posix_error();
         else
-            result = path_posix_error("pathconf", &path);
+            result = path_error(&path);
     }
     else
         result = PyLong_FromLong(limit);
@@ -9695,7 +9747,7 @@
     PyObject *result = NULL;
     int name;
     char buffer[255];
-    int len;
+    size_t len;
 
     if (!PyArg_ParseTuple(args, "O&:confstr", conv_confstr_confname, &name))
         return NULL;
@@ -9712,7 +9764,7 @@
         }
     }
 
-    if ((unsigned int)len >= sizeof(buffer)) {
+    if (len >= sizeof(buffer)) {
         char *buf = PyMem_Malloc(len);
         if (buf == NULL)
             return PyErr_NoMemory();
@@ -10242,7 +10294,7 @@
     int name;
 
     if (PyArg_ParseTuple(args, "O&:sysconf", conv_sysconf_confname, &name)) {
-        int value;
+        long value;
 
         errno = 0;
         value = sysconf(name);
@@ -10257,7 +10309,7 @@
 
 
 /* This code is used to ensure that the tables of configuration value names
- * are in sorted order as required by conv_confname(), and also to build the
+ * are in sorted order as required by conv_confname(), and also to build
  * the exported dictionaries that are used to publish information about the
  * names available on the host platform.
  *
@@ -10572,6 +10624,8 @@
 
     memset(&path, 0, sizeof(path));
     memset(&attribute, 0, sizeof(attribute));
+    path.function_name = "getxattr";
+    attribute.function_name = "getxattr";
     path.allow_fd = 1;
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&O&|$p:getxattr", keywords,
         path_converter, &path,
@@ -10588,7 +10642,7 @@
         static Py_ssize_t buffer_sizes[] = {128, XATTR_SIZE_MAX, 0};
         Py_ssize_t buffer_size = buffer_sizes[i];
         if (!buffer_size) {
-            path_error("getxattr", &path);
+            path_error(&path);
             goto exit;
         }
         buffer = PyBytes_FromStringAndSize(NULL, buffer_size);
@@ -10610,7 +10664,7 @@
             buffer = NULL;
             if (errno == ERANGE)
                 continue;
-            path_error("getxattr", &path);
+            path_error(&path);
             goto exit;
         }
 
@@ -10649,6 +10703,7 @@
                                "flags", "follow_symlinks", NULL};
 
     memset(&path, 0, sizeof(path));
+    path.function_name = "setxattr";
     path.allow_fd = 1;
     memset(&attribute, 0, sizeof(attribute));
     memset(&value, 0, sizeof(value));
@@ -10676,7 +10731,7 @@
     Py_END_ALLOW_THREADS;
 
     if (result) {
-        return_value = path_error("setxattr", &path);
+        return_value = path_error(&path);
         goto exit;
     }
 
@@ -10710,7 +10765,9 @@
     static char *keywords[] = {"path", "attribute", "follow_symlinks", NULL};
 
     memset(&path, 0, sizeof(path));
+    path.function_name = "removexattr";
     memset(&attribute, 0, sizeof(attribute));
+    attribute.function_name = "removexattr";
     path.allow_fd = 1;
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&O&|$p:removexattr",
                                      keywords,
@@ -10732,7 +10789,7 @@
     Py_END_ALLOW_THREADS;
 
     if (result) {
-        return_value = path_error("removexattr", &path);
+        return_value = path_error(&path);
         goto exit;
     }
 
@@ -10768,6 +10825,7 @@
     static char *keywords[] = {"path", "follow_symlinks", NULL};
 
     memset(&path, 0, sizeof(path));
+    path.function_name = "listxattr";
     path.allow_fd = 1;
     path.fd = -1;
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O&$p:listxattr", keywords,
@@ -10786,7 +10844,7 @@
         Py_ssize_t buffer_size = buffer_sizes[i];
         if (!buffer_size) {
             /* ERANGE */
-            path_error("listxattr", &path);
+            path_error(&path);
             break;
         }
         buffer = PyMem_MALLOC(buffer_size);
@@ -10810,7 +10868,7 @@
                 buffer = NULL;
                 continue;
             }
-            path_error("listxattr", &path);
+            path_error(&path);
             break;
         }
 
@@ -10988,14 +11046,154 @@
 }
 #endif /* defined(TERMSIZE_USE_CONIO) || defined(TERMSIZE_USE_IOCTL) */
 
+PyDoc_STRVAR(posix_cpu_count__doc__,
+"cpu_count() -> integer\n\n\
+Return the number of CPUs in the system, or None if this value cannot be\n\
+established.");
+
+static PyObject *
+posix_cpu_count(PyObject *self)
+{
+    int ncpu = 0;
+#ifdef MS_WINDOWS
+    SYSTEM_INFO sysinfo;
+    GetSystemInfo(&sysinfo);
+    ncpu = sysinfo.dwNumberOfProcessors;
+#elif defined(__hpux)
+    ncpu = mpctl(MPC_GETNUMSPUS, NULL, NULL);
+#elif defined(HAVE_SYSCONF) && defined(_SC_NPROCESSORS_ONLN)
+    ncpu = sysconf(_SC_NPROCESSORS_ONLN);
+#elif defined(__DragonFly__) || \
+      defined(__OpenBSD__)   || \
+      defined(__FreeBSD__)   || \
+      defined(__NetBSD__)    || \
+      defined(__APPLE__)
+    int mib[2];
+    size_t len = sizeof(ncpu);
+    mib[0] = CTL_HW;
+    mib[1] = HW_NCPU;
+    if (sysctl(mib, 2, &ncpu, &len, NULL, 0) != 0)
+        ncpu = 0;
+#endif
+    if (ncpu >= 1)
+        return PyLong_FromLong(ncpu);
+    else
+        Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(get_inheritable__doc__,
+    "get_inheritable(fd) -> bool\n" \
+    "\n" \
+    "Get the close-on-exe flag of the specified file descriptor.");
+
+static PyObject*
+posix_get_inheritable(PyObject *self, PyObject *args)
+{
+    int fd;
+    int inheritable;
+
+    if (!PyArg_ParseTuple(args, "i:get_inheritable", &fd))
+        return NULL;
+
+    if (!_PyVerify_fd(fd))
+        return posix_error();
+
+    inheritable = _Py_get_inheritable(fd);
+    if (inheritable < 0)
+        return NULL;
+    return PyBool_FromLong(inheritable);
+}
+
+PyDoc_STRVAR(set_inheritable__doc__,
+    "set_inheritable(fd, inheritable)\n" \
+    "\n" \
+    "Set the inheritable flag of the specified file descriptor.");
+
+static PyObject*
+posix_set_inheritable(PyObject *self, PyObject *args)
+{
+    int fd, inheritable;
+
+    if (!PyArg_ParseTuple(args, "ii:set_inheritable", &fd, &inheritable))
+        return NULL;
+
+    if (!_PyVerify_fd(fd))
+        return posix_error();
+
+    if (_Py_set_inheritable(fd, inheritable, NULL) < 0)
+        return NULL;
+    Py_RETURN_NONE;
+}
+
+
+#ifdef MS_WINDOWS
+PyDoc_STRVAR(get_handle_inheritable__doc__,
+    "get_handle_inheritable(fd) -> bool\n" \
+    "\n" \
+    "Get the close-on-exe flag of the specified file descriptor.");
+
+static PyObject*
+posix_get_handle_inheritable(PyObject *self, PyObject *args)
+{
+    Py_intptr_t handle;
+    DWORD flags;
+
+    if (!PyArg_ParseTuple(args, _Py_PARSE_INTPTR ":get_handle_inheritable", &handle))
+        return NULL;
+
+    if (!GetHandleInformation((HANDLE)handle, &flags)) {
+        PyErr_SetFromWindowsErr(0);
+        return NULL;
+    }
+
+    return PyBool_FromLong(flags & HANDLE_FLAG_INHERIT);
+}
+
+PyDoc_STRVAR(set_handle_inheritable__doc__,
+    "set_handle_inheritable(fd, inheritable)\n" \
+    "\n" \
+    "Set the inheritable flag of the specified handle.");
+
+static PyObject*
+posix_set_handle_inheritable(PyObject *self, PyObject *args)
+{
+    int inheritable = 1;
+    Py_intptr_t handle;
+    DWORD flags;
+
+    if (!PyArg_ParseTuple(args, _Py_PARSE_INTPTR "i:set_handle_inheritable",
+                          &handle, &inheritable))
+        return NULL;
+
+    if (inheritable)
+        flags = HANDLE_FLAG_INHERIT;
+    else
+        flags = 0;
+    if (!SetHandleInformation((HANDLE)handle, HANDLE_FLAG_INHERIT, flags)) {
+        PyErr_SetFromWindowsErr(0);
+        return NULL;
+    }
+    Py_RETURN_NONE;
+}
+#endif   /* MS_WINDOWS */
+
+
+/*[clinic input]
+dump buffer
+[clinic start generated code]*/
+
+#ifndef OS_TTYNAME_METHODDEF
+    #define OS_TTYNAME_METHODDEF
+#endif /* !defined(OS_TTYNAME_METHODDEF) */
+/*[clinic end generated code: output=5d071bbc8f49ea12 input=524ce2e021e4eba6]*/
+
 
 static PyMethodDef posix_methods[] = {
-    {"access",          (PyCFunction)posix_access,
-                        METH_VARARGS | METH_KEYWORDS,
-                        posix_access__doc__},
-#ifdef HAVE_TTYNAME
-    {"ttyname",         posix_ttyname, METH_VARARGS, posix_ttyname__doc__},
-#endif
+
+    OS_STAT_METHODDEF
+    OS_ACCESS_METHODDEF
+    OS_TTYNAME_METHODDEF
+
     {"chdir",           (PyCFunction)posix_chdir,
                         METH_VARARGS | METH_KEYWORDS,
                         posix_chdir__doc__},
@@ -11033,12 +11231,10 @@
 #ifdef HAVE_CTERMID
     {"ctermid",         posix_ctermid, METH_NOARGS, posix_ctermid__doc__},
 #endif
-#ifdef HAVE_GETCWD
     {"getcwd",          (PyCFunction)posix_getcwd_unicode,
     METH_NOARGS, posix_getcwd__doc__},
     {"getcwdb",         (PyCFunction)posix_getcwd_bytes,
     METH_NOARGS, posix_getcwdb__doc__},
-#endif
 #if defined(HAVE_LINK) || defined(MS_WINDOWS)
     {"link",            (PyCFunction)posix_link,
                         METH_VARARGS | METH_KEYWORDS,
@@ -11081,9 +11277,6 @@
     {"rmdir",           (PyCFunction)posix_rmdir,
                         METH_VARARGS | METH_KEYWORDS,
                         posix_rmdir__doc__},
-    {"stat",            (PyCFunction)posix_stat,
-                        METH_VARARGS | METH_KEYWORDS,
-                        posix_stat__doc__},
     {"stat_float_times", stat_float_times, METH_VARARGS, stat_float_times__doc__},
 #if defined(HAVE_SYMLINK)
     {"symlink",         (PyCFunction)posix_symlink,
@@ -11118,10 +11311,6 @@
 #ifdef HAVE_SPAWNV
     {"spawnv",          posix_spawnv, METH_VARARGS, posix_spawnv__doc__},
     {"spawnve",         posix_spawnve, METH_VARARGS, posix_spawnve__doc__},
-#if defined(PYOS_OS2)
-    {"spawnvp",         posix_spawnvp, METH_VARARGS, posix_spawnvp__doc__},
-    {"spawnvpe",        posix_spawnvpe, METH_VARARGS, posix_spawnvpe__doc__},
-#endif /* PYOS_OS2 */
 #endif /* HAVE_SPAWNV */
 #ifdef HAVE_FORK1
     {"fork1",       posix_fork1, METH_NOARGS, posix_fork1__doc__},
@@ -11269,7 +11458,8 @@
     {"closerange",      posix_closerange, METH_VARARGS, posix_closerange__doc__},
     {"device_encoding", device_encoding, METH_VARARGS, device_encoding__doc__},
     {"dup",             posix_dup, METH_VARARGS, posix_dup__doc__},
-    {"dup2",            posix_dup2, METH_VARARGS, posix_dup2__doc__},
+    {"dup2",            (PyCFunction)posix_dup2,
+                        METH_VARARGS | METH_KEYWORDS, posix_dup2__doc__},
 #ifdef HAVE_LOCKF
     {"lockf",           posix_lockf, METH_VARARGS, posix_lockf__doc__},
 #endif
@@ -11323,10 +11513,10 @@
                         METH_VARARGS | METH_KEYWORDS,
                         posix_truncate__doc__},
 #endif
-#ifdef HAVE_POSIX_FALLOCATE
+#if defined(HAVE_POSIX_FALLOCATE) && !defined(POSIX_FADVISE_AIX_BUG)
     {"posix_fallocate", posix_posix_fallocate, METH_VARARGS, posix_posix_fallocate__doc__},
 #endif
-#ifdef HAVE_POSIX_FADVISE
+#if defined(HAVE_POSIX_FADVISE) && !defined(POSIX_FADVISE_AIX_BUG)
     {"posix_fadvise",   posix_posix_fadvise, METH_VARARGS, posix_posix_fadvise__doc__},
 #endif
 #ifdef HAVE_PUTENV
@@ -11400,9 +11590,9 @@
 #ifdef MS_WINDOWS
     {"_getfullpathname",        posix__getfullpathname, METH_VARARGS, NULL},
     {"_getfinalpathname",       posix__getfinalpathname, METH_VARARGS, NULL},
-    {"_getfileinformation",     posix__getfileinformation, METH_VARARGS, NULL},
     {"_isdir",                  posix__isdir, METH_VARARGS, posix__isdir__doc__},
     {"_getdiskusage",           win32__getdiskusage, METH_VARARGS, win32__getdiskusage__doc__},
+    {"_getvolumepathname",      posix__getvolumepathname, METH_VARARGS, posix__getvolumepathname__doc__},
 #endif
 #ifdef HAVE_GETLOADAVG
     {"getloadavg",      posix_getloadavg, METH_NOARGS, posix_getloadavg__doc__},
@@ -11438,69 +11628,20 @@
 #if defined(TERMSIZE_USE_CONIO) || defined(TERMSIZE_USE_IOCTL)
     {"get_terminal_size", get_terminal_size, METH_VARARGS, termsize__doc__},
 #endif
+    {"cpu_count", (PyCFunction)posix_cpu_count,
+                  METH_NOARGS, posix_cpu_count__doc__},
+    {"get_inheritable", posix_get_inheritable, METH_VARARGS, get_inheritable__doc__},
+    {"set_inheritable", posix_set_inheritable, METH_VARARGS, set_inheritable__doc__},
+#ifdef MS_WINDOWS
+    {"get_handle_inheritable", posix_get_handle_inheritable,
+     METH_VARARGS, get_handle_inheritable__doc__},
+    {"set_handle_inheritable", posix_set_handle_inheritable,
+     METH_VARARGS, set_handle_inheritable__doc__},
+#endif
     {NULL,              NULL}            /* Sentinel */
 };
 
 
-static int
-ins(PyObject *module, char *symbol, long value)
-{
-    return PyModule_AddIntConstant(module, symbol, value);
-}
-
-#if defined(PYOS_OS2)
-/* Insert Platform-Specific Constant Values (Strings & Numbers) of Common Use */
-static int insertvalues(PyObject *module)
-{
-    APIRET    rc;
-    ULONG     values[QSV_MAX+1];
-    PyObject *v;
-    char     *ver, tmp[50];
-
-    Py_BEGIN_ALLOW_THREADS
-    rc = DosQuerySysInfo(1L, QSV_MAX, &values[1], sizeof(ULONG) * QSV_MAX);
-    Py_END_ALLOW_THREADS
-
-    if (rc != NO_ERROR) {
-        os2_error(rc);
-        return -1;
-    }
-
-    if (ins(module, "meminstalled", values[QSV_TOTPHYSMEM])) return -1;
-    if (ins(module, "memkernel",    values[QSV_TOTRESMEM])) return -1;
-    if (ins(module, "memvirtual",   values[QSV_TOTAVAILMEM])) return -1;
-    if (ins(module, "maxpathlen",   values[QSV_MAX_PATH_LENGTH])) return -1;
-    if (ins(module, "maxnamelen",   values[QSV_MAX_COMP_LENGTH])) return -1;
-    if (ins(module, "revision",     values[QSV_VERSION_REVISION])) return -1;
-    if (ins(module, "timeslice",    values[QSV_MIN_SLICE])) return -1;
-
-    switch (values[QSV_VERSION_MINOR]) {
-    case 0:  ver = "2.00"; break;
-    case 10: ver = "2.10"; break;
-    case 11: ver = "2.11"; break;
-    case 30: ver = "3.00"; break;
-    case 40: ver = "4.00"; break;
-    case 50: ver = "5.00"; break;
-    default:
-        PyOS_snprintf(tmp, sizeof(tmp),
-                      "%d-%d", values[QSV_VERSION_MAJOR],
-                      values[QSV_VERSION_MINOR]);
-        ver = &tmp[0];
-    }
-
-    /* Add Indicator of the Version of the Operating System */
-    if (PyModule_AddStringConstant(module, "version", tmp) < 0)
-        return -1;
-
-    /* Add Indicator of Which Drive was Used to Boot the System */
-    tmp[0] = 'A' + values[QSV_BOOT_DRIVE] - 1;
-    tmp[1] = ':';
-    tmp[2] = '\0';
-
-    return PyModule_AddStringConstant(module, "bootdrive", tmp);
-}
-#endif
-
 #if defined(HAVE_SYMLINK) && defined(MS_WINDOWS)
 static int
 enable_symlink()
@@ -11531,401 +11672,410 @@
 #endif /* defined(HAVE_SYMLINK) && defined(MS_WINDOWS) */
 
 static int
-all_ins(PyObject *d)
+all_ins(PyObject *m)
 {
 #ifdef F_OK
-    if (ins(d, "F_OK", (long)F_OK)) return -1;
+    if (PyModule_AddIntMacro(m, F_OK)) return -1;
 #endif
 #ifdef R_OK
-    if (ins(d, "R_OK", (long)R_OK)) return -1;
+    if (PyModule_AddIntMacro(m, R_OK)) return -1;
 #endif
 #ifdef W_OK
-    if (ins(d, "W_OK", (long)W_OK)) return -1;
+    if (PyModule_AddIntMacro(m, W_OK)) return -1;
 #endif
 #ifdef X_OK
-    if (ins(d, "X_OK", (long)X_OK)) return -1;
+    if (PyModule_AddIntMacro(m, X_OK)) return -1;
 #endif
 #ifdef NGROUPS_MAX
-    if (ins(d, "NGROUPS_MAX", (long)NGROUPS_MAX)) return -1;
+    if (PyModule_AddIntMacro(m, NGROUPS_MAX)) return -1;
 #endif
 #ifdef TMP_MAX
-    if (ins(d, "TMP_MAX", (long)TMP_MAX)) return -1;
+    if (PyModule_AddIntMacro(m, TMP_MAX)) return -1;
 #endif
 #ifdef WCONTINUED
-    if (ins(d, "WCONTINUED", (long)WCONTINUED)) return -1;
+    if (PyModule_AddIntMacro(m, WCONTINUED)) return -1;
 #endif
 #ifdef WNOHANG
-    if (ins(d, "WNOHANG", (long)WNOHANG)) return -1;
+    if (PyModule_AddIntMacro(m, WNOHANG)) return -1;
 #endif
 #ifdef WUNTRACED
-    if (ins(d, "WUNTRACED", (long)WUNTRACED)) return -1;
+    if (PyModule_AddIntMacro(m, WUNTRACED)) return -1;
 #endif
 #ifdef O_RDONLY
-    if (ins(d, "O_RDONLY", (long)O_RDONLY)) return -1;
+    if (PyModule_AddIntMacro(m, O_RDONLY)) return -1;
 #endif
 #ifdef O_WRONLY
-    if (ins(d, "O_WRONLY", (long)O_WRONLY)) return -1;
+    if (PyModule_AddIntMacro(m, O_WRONLY)) return -1;
 #endif
 #ifdef O_RDWR
-    if (ins(d, "O_RDWR", (long)O_RDWR)) return -1;
+    if (PyModule_AddIntMacro(m, O_RDWR)) return -1;
 #endif
 #ifdef O_NDELAY
-    if (ins(d, "O_NDELAY", (long)O_NDELAY)) return -1;
+    if (PyModule_AddIntMacro(m, O_NDELAY)) return -1;
 #endif
 #ifdef O_NONBLOCK
-    if (ins(d, "O_NONBLOCK", (long)O_NONBLOCK)) return -1;
+    if (PyModule_AddIntMacro(m, O_NONBLOCK)) return -1;
 #endif
 #ifdef O_APPEND
-    if (ins(d, "O_APPEND", (long)O_APPEND)) return -1;
+    if (PyModule_AddIntMacro(m, O_APPEND)) return -1;
 #endif
 #ifdef O_DSYNC
-    if (ins(d, "O_DSYNC", (long)O_DSYNC)) return -1;
+    if (PyModule_AddIntMacro(m, O_DSYNC)) return -1;
 #endif
 #ifdef O_RSYNC
-    if (ins(d, "O_RSYNC", (long)O_RSYNC)) return -1;
+    if (PyModule_AddIntMacro(m, O_RSYNC)) return -1;
 #endif
 #ifdef O_SYNC
-    if (ins(d, "O_SYNC", (long)O_SYNC)) return -1;
+    if (PyModule_AddIntMacro(m, O_SYNC)) return -1;
 #endif
 #ifdef O_NOCTTY
-    if (ins(d, "O_NOCTTY", (long)O_NOCTTY)) return -1;
+    if (PyModule_AddIntMacro(m, O_NOCTTY)) return -1;
 #endif
 #ifdef O_CREAT
-    if (ins(d, "O_CREAT", (long)O_CREAT)) return -1;
+    if (PyModule_AddIntMacro(m, O_CREAT)) return -1;
 #endif
 #ifdef O_EXCL
-    if (ins(d, "O_EXCL", (long)O_EXCL)) return -1;
+    if (PyModule_AddIntMacro(m, O_EXCL)) return -1;
 #endif
 #ifdef O_TRUNC
-    if (ins(d, "O_TRUNC", (long)O_TRUNC)) return -1;
+    if (PyModule_AddIntMacro(m, O_TRUNC)) return -1;
 #endif
 #ifdef O_BINARY
-    if (ins(d, "O_BINARY", (long)O_BINARY)) return -1;
+    if (PyModule_AddIntMacro(m, O_BINARY)) return -1;
 #endif
 #ifdef O_TEXT
-    if (ins(d, "O_TEXT", (long)O_TEXT)) return -1;
+    if (PyModule_AddIntMacro(m, O_TEXT)) return -1;
 #endif
 #ifdef O_XATTR
-    if (ins(d, "O_XATTR", (long)O_XATTR)) return -1;
+    if (PyModule_AddIntMacro(m, O_XATTR)) return -1;
 #endif
 #ifdef O_LARGEFILE
-    if (ins(d, "O_LARGEFILE", (long)O_LARGEFILE)) return -1;
+    if (PyModule_AddIntMacro(m, O_LARGEFILE)) return -1;
 #endif
 #ifdef O_SHLOCK
-    if (ins(d, "O_SHLOCK", (long)O_SHLOCK)) return -1;
+    if (PyModule_AddIntMacro(m, O_SHLOCK)) return -1;
 #endif
 #ifdef O_EXLOCK
-    if (ins(d, "O_EXLOCK", (long)O_EXLOCK)) return -1;
+    if (PyModule_AddIntMacro(m, O_EXLOCK)) return -1;
 #endif
 #ifdef O_EXEC
-    if (ins(d, "O_EXEC", (long)O_EXEC)) return -1;
+    if (PyModule_AddIntMacro(m, O_EXEC)) return -1;
 #endif
 #ifdef O_SEARCH
-    if (ins(d, "O_SEARCH", (long)O_SEARCH)) return -1;
+    if (PyModule_AddIntMacro(m, O_SEARCH)) return -1;
+#endif
+#ifdef O_PATH
+    if (PyModule_AddIntMacro(m, O_PATH)) return -1;
 #endif
 #ifdef O_TTY_INIT
-    if (ins(d, "O_TTY_INIT", (long)O_TTY_INIT)) return -1;
+    if (PyModule_AddIntMacro(m, O_TTY_INIT)) return -1;
+#endif
+#ifdef O_TMPFILE
+    if (PyModule_AddIntMacro(m, O_TMPFILE)) return -1;
 #endif
 #ifdef PRIO_PROCESS
-    if (ins(d, "PRIO_PROCESS", (long)PRIO_PROCESS)) return -1;
+    if (PyModule_AddIntMacro(m, PRIO_PROCESS)) return -1;
 #endif
 #ifdef PRIO_PGRP
-    if (ins(d, "PRIO_PGRP", (long)PRIO_PGRP)) return -1;
+    if (PyModule_AddIntMacro(m, PRIO_PGRP)) return -1;
 #endif
 #ifdef PRIO_USER
-    if (ins(d, "PRIO_USER", (long)PRIO_USER)) return -1;
+    if (PyModule_AddIntMacro(m, PRIO_USER)) return -1;
 #endif
 #ifdef O_CLOEXEC
-    if (ins(d, "O_CLOEXEC", (long)O_CLOEXEC)) return -1;
+    if (PyModule_AddIntMacro(m, O_CLOEXEC)) return -1;
 #endif
 #ifdef O_ACCMODE
-    if (ins(d, "O_ACCMODE", (long)O_ACCMODE)) return -1;
+    if (PyModule_AddIntMacro(m, O_ACCMODE)) return -1;
 #endif
 
 
 #ifdef SEEK_HOLE
-    if (ins(d, "SEEK_HOLE", (long)SEEK_HOLE)) return -1;
+    if (PyModule_AddIntMacro(m, SEEK_HOLE)) return -1;
 #endif
 #ifdef SEEK_DATA
-    if (ins(d, "SEEK_DATA", (long)SEEK_DATA)) return -1;
+    if (PyModule_AddIntMacro(m, SEEK_DATA)) return -1;
 #endif
 
 /* MS Windows */
 #ifdef O_NOINHERIT
     /* Don't inherit in child processes. */
-    if (ins(d, "O_NOINHERIT", (long)O_NOINHERIT)) return -1;
+    if (PyModule_AddIntMacro(m, O_NOINHERIT)) return -1;
 #endif
 #ifdef _O_SHORT_LIVED
     /* Optimize for short life (keep in memory). */
     /* MS forgot to define this one with a non-underscore form too. */
-    if (ins(d, "O_SHORT_LIVED", (long)_O_SHORT_LIVED)) return -1;
+    if (PyModule_AddIntConstant(m, "O_SHORT_LIVED", _O_SHORT_LIVED)) return -1;
 #endif
 #ifdef O_TEMPORARY
     /* Automatically delete when last handle is closed. */
-    if (ins(d, "O_TEMPORARY", (long)O_TEMPORARY)) return -1;
+    if (PyModule_AddIntMacro(m, O_TEMPORARY)) return -1;
 #endif
 #ifdef O_RANDOM
     /* Optimize for random access. */
-    if (ins(d, "O_RANDOM", (long)O_RANDOM)) return -1;
+    if (PyModule_AddIntMacro(m, O_RANDOM)) return -1;
 #endif
 #ifdef O_SEQUENTIAL
     /* Optimize for sequential access. */
-    if (ins(d, "O_SEQUENTIAL", (long)O_SEQUENTIAL)) return -1;
+    if (PyModule_AddIntMacro(m, O_SEQUENTIAL)) return -1;
 #endif
 
 /* GNU extensions. */
 #ifdef O_ASYNC
     /* Send a SIGIO signal whenever input or output
        becomes available on file descriptor */
-    if (ins(d, "O_ASYNC", (long)O_ASYNC)) return -1;
+    if (PyModule_AddIntMacro(m, O_ASYNC)) return -1;
 #endif
 #ifdef O_DIRECT
     /* Direct disk access. */
-    if (ins(d, "O_DIRECT", (long)O_DIRECT)) return -1;
+    if (PyModule_AddIntMacro(m, O_DIRECT)) return -1;
 #endif
 #ifdef O_DIRECTORY
     /* Must be a directory.      */
-    if (ins(d, "O_DIRECTORY", (long)O_DIRECTORY)) return -1;
+    if (PyModule_AddIntMacro(m, O_DIRECTORY)) return -1;
 #endif
 #ifdef O_NOFOLLOW
     /* Do not follow links.      */
-    if (ins(d, "O_NOFOLLOW", (long)O_NOFOLLOW)) return -1;
+    if (PyModule_AddIntMacro(m, O_NOFOLLOW)) return -1;
 #endif
 #ifdef O_NOLINKS
     /* Fails if link count of the named file is greater than 1 */
-    if (ins(d, "O_NOLINKS", (long)O_NOLINKS)) return -1;
+    if (PyModule_AddIntMacro(m, O_NOLINKS)) return -1;
 #endif
 #ifdef O_NOATIME
     /* Do not update the access time. */
-    if (ins(d, "O_NOATIME", (long)O_NOATIME)) return -1;
+    if (PyModule_AddIntMacro(m, O_NOATIME)) return -1;
 #endif
 
     /* These come from sysexits.h */
 #ifdef EX_OK
-    if (ins(d, "EX_OK", (long)EX_OK)) return -1;
+    if (PyModule_AddIntMacro(m, EX_OK)) return -1;
 #endif /* EX_OK */
 #ifdef EX_USAGE
-    if (ins(d, "EX_USAGE", (long)EX_USAGE)) return -1;
+    if (PyModule_AddIntMacro(m, EX_USAGE)) return -1;
 #endif /* EX_USAGE */
 #ifdef EX_DATAERR
-    if (ins(d, "EX_DATAERR", (long)EX_DATAERR)) return -1;
+    if (PyModule_AddIntMacro(m, EX_DATAERR)) return -1;
 #endif /* EX_DATAERR */
 #ifdef EX_NOINPUT
-    if (ins(d, "EX_NOINPUT", (long)EX_NOINPUT)) return -1;
+    if (PyModule_AddIntMacro(m, EX_NOINPUT)) return -1;
 #endif /* EX_NOINPUT */
 #ifdef EX_NOUSER
-    if (ins(d, "EX_NOUSER", (long)EX_NOUSER)) return -1;
+    if (PyModule_AddIntMacro(m, EX_NOUSER)) return -1;
 #endif /* EX_NOUSER */
 #ifdef EX_NOHOST
-    if (ins(d, "EX_NOHOST", (long)EX_NOHOST)) return -1;
+    if (PyModule_AddIntMacro(m, EX_NOHOST)) return -1;
 #endif /* EX_NOHOST */
 #ifdef EX_UNAVAILABLE
-    if (ins(d, "EX_UNAVAILABLE", (long)EX_UNAVAILABLE)) return -1;
+    if (PyModule_AddIntMacro(m, EX_UNAVAILABLE)) return -1;
 #endif /* EX_UNAVAILABLE */
 #ifdef EX_SOFTWARE
-    if (ins(d, "EX_SOFTWARE", (long)EX_SOFTWARE)) return -1;
+    if (PyModule_AddIntMacro(m, EX_SOFTWARE)) return -1;
 #endif /* EX_SOFTWARE */
 #ifdef EX_OSERR
-    if (ins(d, "EX_OSERR", (long)EX_OSERR)) return -1;
+    if (PyModule_AddIntMacro(m, EX_OSERR)) return -1;
 #endif /* EX_OSERR */
 #ifdef EX_OSFILE
-    if (ins(d, "EX_OSFILE", (long)EX_OSFILE)) return -1;
+    if (PyModule_AddIntMacro(m, EX_OSFILE)) return -1;
 #endif /* EX_OSFILE */
 #ifdef EX_CANTCREAT
-    if (ins(d, "EX_CANTCREAT", (long)EX_CANTCREAT)) return -1;
+    if (PyModule_AddIntMacro(m, EX_CANTCREAT)) return -1;
 #endif /* EX_CANTCREAT */
 #ifdef EX_IOERR
-    if (ins(d, "EX_IOERR", (long)EX_IOERR)) return -1;
+    if (PyModule_AddIntMacro(m, EX_IOERR)) return -1;
 #endif /* EX_IOERR */
 #ifdef EX_TEMPFAIL
-    if (ins(d, "EX_TEMPFAIL", (long)EX_TEMPFAIL)) return -1;
+    if (PyModule_AddIntMacro(m, EX_TEMPFAIL)) return -1;
 #endif /* EX_TEMPFAIL */
 #ifdef EX_PROTOCOL
-    if (ins(d, "EX_PROTOCOL", (long)EX_PROTOCOL)) return -1;
+    if (PyModule_AddIntMacro(m, EX_PROTOCOL)) return -1;
 #endif /* EX_PROTOCOL */
 #ifdef EX_NOPERM
-    if (ins(d, "EX_NOPERM", (long)EX_NOPERM)) return -1;
+    if (PyModule_AddIntMacro(m, EX_NOPERM)) return -1;
 #endif /* EX_NOPERM */
 #ifdef EX_CONFIG
-    if (ins(d, "EX_CONFIG", (long)EX_CONFIG)) return -1;
+    if (PyModule_AddIntMacro(m, EX_CONFIG)) return -1;
 #endif /* EX_CONFIG */
 #ifdef EX_NOTFOUND
-    if (ins(d, "EX_NOTFOUND", (long)EX_NOTFOUND)) return -1;
+    if (PyModule_AddIntMacro(m, EX_NOTFOUND)) return -1;
 #endif /* EX_NOTFOUND */
 
     /* statvfs */
 #ifdef ST_RDONLY
-    if (ins(d, "ST_RDONLY", (long)ST_RDONLY)) return -1;
+    if (PyModule_AddIntMacro(m, ST_RDONLY)) return -1;
 #endif /* ST_RDONLY */
 #ifdef ST_NOSUID
-    if (ins(d, "ST_NOSUID", (long)ST_NOSUID)) return -1;
+    if (PyModule_AddIntMacro(m, ST_NOSUID)) return -1;
 #endif /* ST_NOSUID */
 
+       /* GNU extensions */
+#ifdef ST_NODEV
+    if (PyModule_AddIntMacro(m, ST_NODEV)) return -1;
+#endif /* ST_NODEV */
+#ifdef ST_NOEXEC
+    if (PyModule_AddIntMacro(m, ST_NOEXEC)) return -1;
+#endif /* ST_NOEXEC */
+#ifdef ST_SYNCHRONOUS
+    if (PyModule_AddIntMacro(m, ST_SYNCHRONOUS)) return -1;
+#endif /* ST_SYNCHRONOUS */
+#ifdef ST_MANDLOCK
+    if (PyModule_AddIntMacro(m, ST_MANDLOCK)) return -1;
+#endif /* ST_MANDLOCK */
+#ifdef ST_WRITE
+    if (PyModule_AddIntMacro(m, ST_WRITE)) return -1;
+#endif /* ST_WRITE */
+#ifdef ST_APPEND
+    if (PyModule_AddIntMacro(m, ST_APPEND)) return -1;
+#endif /* ST_APPEND */
+#ifdef ST_NOATIME
+    if (PyModule_AddIntMacro(m, ST_NOATIME)) return -1;
+#endif /* ST_NOATIME */
+#ifdef ST_NODIRATIME
+    if (PyModule_AddIntMacro(m, ST_NODIRATIME)) return -1;
+#endif /* ST_NODIRATIME */
+#ifdef ST_RELATIME
+    if (PyModule_AddIntMacro(m, ST_RELATIME)) return -1;
+#endif /* ST_RELATIME */
+
     /* FreeBSD sendfile() constants */
 #ifdef SF_NODISKIO
-    if (ins(d, "SF_NODISKIO", (long)SF_NODISKIO)) return -1;
+    if (PyModule_AddIntMacro(m, SF_NODISKIO)) return -1;
 #endif
 #ifdef SF_MNOWAIT
-    if (ins(d, "SF_MNOWAIT", (long)SF_MNOWAIT)) return -1;
+    if (PyModule_AddIntMacro(m, SF_MNOWAIT)) return -1;
 #endif
 #ifdef SF_SYNC
-    if (ins(d, "SF_SYNC", (long)SF_SYNC)) return -1;
+    if (PyModule_AddIntMacro(m, SF_SYNC)) return -1;
 #endif
 
     /* constants for posix_fadvise */
 #ifdef POSIX_FADV_NORMAL
-    if (ins(d, "POSIX_FADV_NORMAL", (long)POSIX_FADV_NORMAL)) return -1;
+    if (PyModule_AddIntMacro(m, POSIX_FADV_NORMAL)) return -1;
 #endif
 #ifdef POSIX_FADV_SEQUENTIAL
-    if (ins(d, "POSIX_FADV_SEQUENTIAL", (long)POSIX_FADV_SEQUENTIAL)) return -1;
+    if (PyModule_AddIntMacro(m, POSIX_FADV_SEQUENTIAL)) return -1;
 #endif
 #ifdef POSIX_FADV_RANDOM
-    if (ins(d, "POSIX_FADV_RANDOM", (long)POSIX_FADV_RANDOM)) return -1;
+    if (PyModule_AddIntMacro(m, POSIX_FADV_RANDOM)) return -1;
 #endif
 #ifdef POSIX_FADV_NOREUSE
-    if (ins(d, "POSIX_FADV_NOREUSE", (long)POSIX_FADV_NOREUSE)) return -1;
+    if (PyModule_AddIntMacro(m, POSIX_FADV_NOREUSE)) return -1;
 #endif
 #ifdef POSIX_FADV_WILLNEED
-    if (ins(d, "POSIX_FADV_WILLNEED", (long)POSIX_FADV_WILLNEED)) return -1;
+    if (PyModule_AddIntMacro(m, POSIX_FADV_WILLNEED)) return -1;
 #endif
 #ifdef POSIX_FADV_DONTNEED
-    if (ins(d, "POSIX_FADV_DONTNEED", (long)POSIX_FADV_DONTNEED)) return -1;
+    if (PyModule_AddIntMacro(m, POSIX_FADV_DONTNEED)) return -1;
 #endif
 
     /* constants for waitid */
 #if defined(HAVE_SYS_WAIT_H) && defined(HAVE_WAITID)
-    if (ins(d, "P_PID", (long)P_PID)) return -1;
-    if (ins(d, "P_PGID", (long)P_PGID)) return -1;
-    if (ins(d, "P_ALL", (long)P_ALL)) return -1;
+    if (PyModule_AddIntMacro(m, P_PID)) return -1;
+    if (PyModule_AddIntMacro(m, P_PGID)) return -1;
+    if (PyModule_AddIntMacro(m, P_ALL)) return -1;
 #endif
 #ifdef WEXITED
-    if (ins(d, "WEXITED", (long)WEXITED)) return -1;
+    if (PyModule_AddIntMacro(m, WEXITED)) return -1;
 #endif
 #ifdef WNOWAIT
-    if (ins(d, "WNOWAIT", (long)WNOWAIT)) return -1;
+    if (PyModule_AddIntMacro(m, WNOWAIT)) return -1;
 #endif
 #ifdef WSTOPPED
-    if (ins(d, "WSTOPPED", (long)WSTOPPED)) return -1;
+    if (PyModule_AddIntMacro(m, WSTOPPED)) return -1;
 #endif
 #ifdef CLD_EXITED
-    if (ins(d, "CLD_EXITED", (long)CLD_EXITED)) return -1;
+    if (PyModule_AddIntMacro(m, CLD_EXITED)) return -1;
 #endif
 #ifdef CLD_DUMPED
-    if (ins(d, "CLD_DUMPED", (long)CLD_DUMPED)) return -1;
+    if (PyModule_AddIntMacro(m, CLD_DUMPED)) return -1;
 #endif
 #ifdef CLD_TRAPPED
-    if (ins(d, "CLD_TRAPPED", (long)CLD_TRAPPED)) return -1;
+    if (PyModule_AddIntMacro(m, CLD_TRAPPED)) return -1;
 #endif
 #ifdef CLD_CONTINUED
-    if (ins(d, "CLD_CONTINUED", (long)CLD_CONTINUED)) return -1;
+    if (PyModule_AddIntMacro(m, CLD_CONTINUED)) return -1;
 #endif
 
     /* constants for lockf */
 #ifdef F_LOCK
-    if (ins(d, "F_LOCK", (long)F_LOCK)) return -1;
+    if (PyModule_AddIntMacro(m, F_LOCK)) return -1;
 #endif
 #ifdef F_TLOCK
-    if (ins(d, "F_TLOCK", (long)F_TLOCK)) return -1;
+    if (PyModule_AddIntMacro(m, F_TLOCK)) return -1;
 #endif
 #ifdef F_ULOCK
-    if (ins(d, "F_ULOCK", (long)F_ULOCK)) return -1;
+    if (PyModule_AddIntMacro(m, F_ULOCK)) return -1;
 #endif
 #ifdef F_TEST
-    if (ins(d, "F_TEST", (long)F_TEST)) return -1;
+    if (PyModule_AddIntMacro(m, F_TEST)) return -1;
 #endif
 
 #ifdef HAVE_SPAWNV
-#if defined(PYOS_OS2) && defined(PYCC_GCC)
-    if (ins(d, "P_WAIT", (long)P_WAIT)) return -1;
-    if (ins(d, "P_NOWAIT", (long)P_NOWAIT)) return -1;
-    if (ins(d, "P_OVERLAY", (long)P_OVERLAY)) return -1;
-    if (ins(d, "P_DEBUG", (long)P_DEBUG)) return -1;
-    if (ins(d, "P_SESSION", (long)P_SESSION)) return -1;
-    if (ins(d, "P_DETACH", (long)P_DETACH)) return -1;
-    if (ins(d, "P_PM", (long)P_PM)) return -1;
-    if (ins(d, "P_DEFAULT", (long)P_DEFAULT)) return -1;
-    if (ins(d, "P_MINIMIZE", (long)P_MINIMIZE)) return -1;
-    if (ins(d, "P_MAXIMIZE", (long)P_MAXIMIZE)) return -1;
-    if (ins(d, "P_FULLSCREEN", (long)P_FULLSCREEN)) return -1;
-    if (ins(d, "P_WINDOWED", (long)P_WINDOWED)) return -1;
-    if (ins(d, "P_FOREGROUND", (long)P_FOREGROUND)) return -1;
-    if (ins(d, "P_BACKGROUND", (long)P_BACKGROUND)) return -1;
-    if (ins(d, "P_NOCLOSE", (long)P_NOCLOSE)) return -1;
-    if (ins(d, "P_NOSESSION", (long)P_NOSESSION)) return -1;
-    if (ins(d, "P_QUOTE", (long)P_QUOTE)) return -1;
-    if (ins(d, "P_TILDE", (long)P_TILDE)) return -1;
-    if (ins(d, "P_UNRELATED", (long)P_UNRELATED)) return -1;
-    if (ins(d, "P_DEBUGDESC", (long)P_DEBUGDESC)) return -1;
-#else
-    if (ins(d, "P_WAIT", (long)_P_WAIT)) return -1;
-    if (ins(d, "P_NOWAIT", (long)_P_NOWAIT)) return -1;
-    if (ins(d, "P_OVERLAY", (long)_OLD_P_OVERLAY)) return -1;
-    if (ins(d, "P_NOWAITO", (long)_P_NOWAITO)) return -1;
-    if (ins(d, "P_DETACH", (long)_P_DETACH)) return -1;
-#endif
+    if (PyModule_AddIntConstant(m, "P_WAIT", _P_WAIT)) return -1;
+    if (PyModule_AddIntConstant(m, "P_NOWAIT", _P_NOWAIT)) return -1;
+    if (PyModule_AddIntConstant(m, "P_OVERLAY", _OLD_P_OVERLAY)) return -1;
+    if (PyModule_AddIntConstant(m, "P_NOWAITO", _P_NOWAITO)) return -1;
+    if (PyModule_AddIntConstant(m, "P_DETACH", _P_DETACH)) return -1;
 #endif
 
 #ifdef HAVE_SCHED_H
-    if (ins(d, "SCHED_OTHER", (long)SCHED_OTHER)) return -1;
-    if (ins(d, "SCHED_FIFO", (long)SCHED_FIFO)) return -1;
-    if (ins(d, "SCHED_RR", (long)SCHED_RR)) return -1;
+    if (PyModule_AddIntMacro(m, SCHED_OTHER)) return -1;
+    if (PyModule_AddIntMacro(m, SCHED_FIFO)) return -1;
+    if (PyModule_AddIntMacro(m, SCHED_RR)) return -1;
 #ifdef SCHED_SPORADIC
-    if (ins(d, "SCHED_SPORADIC", (long)SCHED_SPORADIC)) return -1;
+    if (PyModule_AddIntMacro(m, SCHED_SPORADIC) return -1;
 #endif
 #ifdef SCHED_BATCH
-    if (ins(d, "SCHED_BATCH", (long)SCHED_BATCH)) return -1;
+    if (PyModule_AddIntMacro(m, SCHED_BATCH)) return -1;
 #endif
 #ifdef SCHED_IDLE
-    if (ins(d, "SCHED_IDLE", (long)SCHED_IDLE)) return -1;
+    if (PyModule_AddIntMacro(m, SCHED_IDLE)) return -1;
 #endif
 #ifdef SCHED_RESET_ON_FORK
-    if (ins(d, "SCHED_RESET_ON_FORK", (long)SCHED_RESET_ON_FORK)) return -1;
+    if (PyModule_AddIntMacro(m, SCHED_RESET_ON_FORK)) return -1;
 #endif
 #ifdef SCHED_SYS
-    if (ins(d, "SCHED_SYS", (long)SCHED_SYS)) return -1;
+    if (PyModule_AddIntMacro(m, SCHED_SYS)) return -1;
 #endif
 #ifdef SCHED_IA
-    if (ins(d, "SCHED_IA", (long)SCHED_IA)) return -1;
+    if (PyModule_AddIntMacro(m, SCHED_IA)) return -1;
 #endif
 #ifdef SCHED_FSS
-    if (ins(d, "SCHED_FSS", (long)SCHED_FSS)) return -1;
+    if (PyModule_AddIntMacro(m, SCHED_FSS)) return -1;
 #endif
 #ifdef SCHED_FX
-    if (ins(d, "SCHED_FX", (long)SCHED_FSS)) return -1;
+    if (PyModule_AddIntConstant(m, "SCHED_FX", SCHED_FSS)) return -1;
 #endif
 #endif
 
 #ifdef USE_XATTRS
-    if (ins(d, "XATTR_CREATE", (long)XATTR_CREATE)) return -1;
-    if (ins(d, "XATTR_REPLACE", (long)XATTR_REPLACE)) return -1;
-    if (ins(d, "XATTR_SIZE_MAX", (long)XATTR_SIZE_MAX)) return -1;
+    if (PyModule_AddIntMacro(m, XATTR_CREATE)) return -1;
+    if (PyModule_AddIntMacro(m, XATTR_REPLACE)) return -1;
+    if (PyModule_AddIntMacro(m, XATTR_SIZE_MAX)) return -1;
 #endif
 
 #ifdef RTLD_LAZY
-    if (PyModule_AddIntMacro(d, RTLD_LAZY)) return -1;
+    if (PyModule_AddIntMacro(m, RTLD_LAZY)) return -1;
 #endif
 #ifdef RTLD_NOW
-    if (PyModule_AddIntMacro(d, RTLD_NOW)) return -1;
+    if (PyModule_AddIntMacro(m, RTLD_NOW)) return -1;
 #endif
 #ifdef RTLD_GLOBAL
-    if (PyModule_AddIntMacro(d, RTLD_GLOBAL)) return -1;
+    if (PyModule_AddIntMacro(m, RTLD_GLOBAL)) return -1;
 #endif
 #ifdef RTLD_LOCAL
-    if (PyModule_AddIntMacro(d, RTLD_LOCAL)) return -1;
+    if (PyModule_AddIntMacro(m, RTLD_LOCAL)) return -1;
 #endif
 #ifdef RTLD_NODELETE
-    if (PyModule_AddIntMacro(d, RTLD_NODELETE)) return -1;
+    if (PyModule_AddIntMacro(m, RTLD_NODELETE)) return -1;
 #endif
 #ifdef RTLD_NOLOAD
-    if (PyModule_AddIntMacro(d, RTLD_NOLOAD)) return -1;
+    if (PyModule_AddIntMacro(m, RTLD_NOLOAD)) return -1;
 #endif
 #ifdef RTLD_DEEPBIND
-    if (PyModule_AddIntMacro(d, RTLD_DEEPBIND)) return -1;
+    if (PyModule_AddIntMacro(m, RTLD_DEEPBIND)) return -1;
 #endif
 
-#if defined(PYOS_OS2)
-    if (insertvalues(d)) return -1;
-#endif
     return 0;
 }
 
@@ -11934,10 +12084,6 @@
 #define INITFUNC PyInit_nt
 #define MODNAME "nt"
 
-#elif defined(PYOS_OS2)
-#define INITFUNC PyInit_os2
-#define MODNAME "os2"
-
 #else
 #define INITFUNC PyInit_posix
 #define MODNAME "posix"
@@ -12125,19 +12271,23 @@
     if (!initialized) {
 #if defined(HAVE_WAITID) && !defined(__APPLE__)
         waitid_result_desc.name = MODNAME ".waitid_result";
-        PyStructSequence_InitType(&WaitidResultType, &waitid_result_desc);
+        if (PyStructSequence_InitType2(&WaitidResultType, &waitid_result_desc) < 0)
+            return NULL;
 #endif
 
-        stat_result_desc.name = MODNAME ".stat_result";
+        stat_result_desc.name = "os.stat_result"; /* see issue #19209 */
         stat_result_desc.fields[7].name = PyStructSequence_UnnamedField;
         stat_result_desc.fields[8].name = PyStructSequence_UnnamedField;
         stat_result_desc.fields[9].name = PyStructSequence_UnnamedField;
-        PyStructSequence_InitType(&StatResultType, &stat_result_desc);
+        if (PyStructSequence_InitType2(&StatResultType, &stat_result_desc) < 0)
+            return NULL;
         structseq_new = StatResultType.tp_new;
         StatResultType.tp_new = statresult_new;
 
-        statvfs_result_desc.name = MODNAME ".statvfs_result";
-        PyStructSequence_InitType(&StatVFSResultType, &statvfs_result_desc);
+        statvfs_result_desc.name = "os.statvfs_result"; /* see issue #19209 */
+        if (PyStructSequence_InitType2(&StatVFSResultType,
+                                       &statvfs_result_desc) < 0)
+            return NULL;
 #ifdef NEED_TICKS_PER_SECOND
 #  if defined(HAVE_SYSCONF) && defined(_SC_CLK_TCK)
         ticks_per_second = sysconf(_SC_CLK_TCK);
@@ -12150,12 +12300,15 @@
 
 #if defined(HAVE_SCHED_SETPARAM) || defined(HAVE_SCHED_SETSCHEDULER)
         sched_param_desc.name = MODNAME ".sched_param";
-        PyStructSequence_InitType(&SchedParamType, &sched_param_desc);
+        if (PyStructSequence_InitType2(&SchedParamType, &sched_param_desc) < 0)
+            return NULL;
         SchedParamType.tp_new = sched_param_new;
 #endif
 
         /* initialize TerminalSize_info */
-        PyStructSequence_InitType(&TerminalSizeType, &TerminalSize_desc);
+        if (PyStructSequence_InitType2(&TerminalSizeType,
+                                       &TerminalSize_desc) < 0)
+            return NULL;
     }
 #if defined(HAVE_WAITID) && !defined(__APPLE__)
     Py_INCREF((PyObject*) &WaitidResultType);
@@ -12173,11 +12326,13 @@
 #endif
 
     times_result_desc.name = MODNAME ".times_result";
-    PyStructSequence_InitType(&TimesResultType, &times_result_desc);
+    if (PyStructSequence_InitType2(&TimesResultType, &times_result_desc) < 0)
+        return NULL;
     PyModule_AddObject(m, "times_result", (PyObject *)&TimesResultType);
 
     uname_result_desc.name = MODNAME ".uname_result";
-    PyStructSequence_InitType(&UnameResultType, &uname_result_desc);
+    if (PyStructSequence_InitType2(&UnameResultType, &uname_result_desc) < 0)
+        return NULL;
     PyModule_AddObject(m, "uname_result", (PyObject *)&UnameResultType);
 
 #ifdef __APPLE__
@@ -12255,7 +12410,6 @@
     initialized = 1;
 
     return m;
-
 }
 
 #ifdef __cplusplus
diff --git a/Modules/pwdmodule.c b/Modules/pwdmodule.c
index 285fd9c..ebb8712 100644
--- a/Modules/pwdmodule.c
+++ b/Modules/pwdmodule.c
@@ -69,18 +69,10 @@
 #define SETS(i,val) sets(v, i, val)
 
     SETS(setIndex++, p->pw_name);
-#ifdef __VMS
-    SETS(setIndex++, "");
-#else
     SETS(setIndex++, p->pw_passwd);
-#endif
     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
     SETS(setIndex++, p->pw_gecos);
-#endif
     SETS(setIndex++, p->pw_dir);
     SETS(setIndex++, p->pw_shell);
 
@@ -168,12 +160,8 @@
     struct passwd *p;
     if ((d = PyList_New(0)) == NULL)
         return NULL;
-#if defined(PYOS_OS2) && defined(PYCC_GCC)
-    if ((p = getpwuid(0)) != NULL) {
-#else
     setpwent();
     while ((p = getpwent()) != NULL) {
-#endif
         PyObject *v = mkpwent(p);
         if (v == NULL || PyList_Append(d, v) != 0) {
             Py_XDECREF(v);
@@ -220,8 +208,9 @@
         return NULL;
 
     if (!initialized) {
-        PyStructSequence_InitType(&StructPwdType,
-                                  &struct_pwd_type_desc);
+        if (PyStructSequence_InitType2(&StructPwdType,
+                                       &struct_pwd_type_desc) < 0)
+            return NULL;
         initialized = 1;
     }
     Py_INCREF((PyObject *) &StructPwdType);
diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c
index 45680ae..4ced53b 100644
--- a/Modules/pyexpat.c
+++ b/Modules/pyexpat.c
@@ -8,7 +8,8 @@
 
 #define XML_COMBINED_VERSION (10000*XML_MAJOR_VERSION+100*XML_MINOR_VERSION+XML_MICRO_VERSION)
 
-#define FIX_TRACE
+static XML_Memory_Handling_Suite ExpatMemoryHandler = {
+    PyObject_Malloc, PyObject_Realloc, PyObject_Free};
 
 enum HandlerTypes {
     StartElement,
@@ -207,121 +208,17 @@
                                     error_external_entity_ref_handler);
 }
 
-static PyCodeObject*
-getcode(enum HandlerTypes slot, char* func_name, int lineno)
-{
-    if (handler_info[slot].tb_code == NULL) {
-        handler_info[slot].tb_code =
-            PyCode_NewEmpty(__FILE__, func_name, lineno);
-    }
-    return handler_info[slot].tb_code;
-}
-
-#ifdef FIX_TRACE
-static int
-trace_frame(PyThreadState *tstate, PyFrameObject *f, int code, PyObject *val)
-{
-    int result = 0;
-    if (!tstate->use_tracing || tstate->tracing)
-        return 0;
-    if (tstate->c_profilefunc != NULL) {
-        tstate->tracing++;
-        result = tstate->c_profilefunc(tstate->c_profileobj,
-                                       f, code , val);
-        tstate->use_tracing = ((tstate->c_tracefunc != NULL)
-                               || (tstate->c_profilefunc != NULL));
-        tstate->tracing--;
-        if (result)
-            return result;
-    }
-    if (tstate->c_tracefunc != NULL) {
-        tstate->tracing++;
-        result = tstate->c_tracefunc(tstate->c_traceobj,
-                                     f, code , val);
-        tstate->use_tracing = ((tstate->c_tracefunc != NULL)
-                               || (tstate->c_profilefunc != NULL));
-        tstate->tracing--;
-    }
-    return result;
-}
-
-static int
-trace_frame_exc(PyThreadState *tstate, PyFrameObject *f)
-{
-    PyObject *type, *value, *traceback, *arg;
-    int err;
-
-    if (tstate->c_tracefunc == NULL)
-        return 0;
-
-    PyErr_Fetch(&type, &value, &traceback);
-    if (value == NULL) {
-        value = Py_None;
-        Py_INCREF(value);
-    }
-    arg = PyTuple_Pack(3, type, value, traceback);
-    if (arg == NULL) {
-        PyErr_Restore(type, value, traceback);
-        return 0;
-    }
-    err = trace_frame(tstate, f, PyTrace_EXCEPTION, arg);
-    Py_DECREF(arg);
-    if (err == 0)
-        PyErr_Restore(type, value, traceback);
-    else {
-        Py_XDECREF(type);
-        Py_XDECREF(value);
-        Py_XDECREF(traceback);
-    }
-    return err;
-}
-#endif
-
 static PyObject*
-call_with_frame(PyCodeObject *c, PyObject* func, PyObject* args,
+call_with_frame(char *funcname, int lineno, PyObject* func, PyObject* args,
                 xmlparseobject *self)
 {
-    PyThreadState *tstate = PyThreadState_GET();
-    PyFrameObject *f;
-    PyObject *res, *globals;
+    PyObject *res;
 
-    if (c == NULL)
-        return NULL;
-
-    globals = PyEval_GetGlobals();
-    if (globals == NULL) {
-        return NULL;
-    }
-
-    f = PyFrame_New(tstate, c, globals, NULL);
-    if (f == NULL)
-        return NULL;
-    tstate->frame = f;
-#ifdef FIX_TRACE
-    if (trace_frame(tstate, f, PyTrace_CALL, Py_None) < 0) {
-        return NULL;
-    }
-#endif
     res = PyEval_CallObject(func, args);
     if (res == NULL) {
-        if (tstate->curexc_traceback == NULL)
-            PyTraceBack_Here(f);
+        _PyTraceback_Add(funcname, __FILE__, lineno);
         XML_StopParser(self->itself, XML_FALSE);
-#ifdef FIX_TRACE
-        if (trace_frame_exc(tstate, f) < 0) {
-            return NULL;
-        }
     }
-    else {
-        if (trace_frame(tstate, f, PyTrace_RETURN, res) < 0) {
-            Py_CLEAR(res);
-        }
-    }
-#else
-    }
-#endif
-    tstate->frame = f->f_back;
-    Py_DECREF(f);
     return res;
 }
 
@@ -373,7 +270,7 @@
     PyTuple_SET_ITEM(args, 0, temp);
     /* temp is now a borrowed reference; consider it unused. */
     self->in_callback = 1;
-    temp = call_with_frame(getcode(CharacterData, "CharacterData", __LINE__),
+    temp = call_with_frame("CharacterData", __LINE__,
                            self->handlers[CharacterData], args, self);
     /* temp is an owned reference again, or NULL */
     self->in_callback = 0;
@@ -403,6 +300,10 @@
 my_CharacterDataHandler(void *userData, const XML_Char *data, int len)
 {
     xmlparseobject *self = (xmlparseobject *) userData;
+
+    if (PyErr_Occurred())
+        return;
+
     if (self->buffer == NULL)
         call_character_handler(self, data, len);
     else {
@@ -437,6 +338,9 @@
         PyObject *container, *rv, *args;
         int i, max;
 
+        if (PyErr_Occurred())
+            return;
+
         if (flush_character_buffer(self) < 0)
             return;
         /* Set max to the number of slots filled in atts[]; max/2 is
@@ -498,7 +402,7 @@
         }
         /* Container is now a borrowed reference; ignore it. */
         self->in_callback = 1;
-        rv = call_with_frame(getcode(StartElement, "StartElement", __LINE__),
+        rv = call_with_frame("StartElement", __LINE__,
                              self->handlers[StartElement], args, self);
         self->in_callback = 0;
         Py_DECREF(args);
@@ -520,12 +424,14 @@
     INIT \
 \
     if (have_handler(self, NAME)) { \
+        if (PyErr_Occurred()) \
+            return RETURN; \
         if (flush_character_buffer(self) < 0) \
             return RETURN; \
         args = Py_BuildValue PARAM_FORMAT ;\
         if (!args) { flag_error(self); return RETURN;} \
         self->in_callback = 1; \
-        rv = call_with_frame(getcode(NAME,#NAME,__LINE__), \
+        rv = call_with_frame(#NAME,__LINE__, \
                              self->handlers[NAME], args, self); \
         self->in_callback = 0; \
         Py_DECREF(args); \
@@ -634,6 +540,9 @@
         PyObject *rv = NULL;
         PyObject *modelobj, *nameobj;
 
+        if (PyErr_Occurred())
+            return;
+
         if (flush_character_buffer(self) < 0)
             goto finally;
         modelobj = conv_content_model(model, (conv_string_to_unicode));
@@ -654,7 +563,7 @@
             goto finally;
         }
         self->in_callback = 1;
-        rv = call_with_frame(getcode(ElementDecl, "ElementDecl", __LINE__),
+        rv = call_with_frame("ElementDecl", __LINE__,
                              self->handlers[ElementDecl], args, self);
         self->in_callback = 0;
         if (rv == NULL) {
@@ -819,7 +728,8 @@
         s += MAX_CHUNK_SIZE;
         slen -= MAX_CHUNK_SIZE;
     }
-    rc = XML_Parse(self->itself, s, slen, isFinal);
+    assert(MAX_CHUNK_SIZE < INT_MAX && slen < INT_MAX);
+    rc = XML_Parse(self->itself, s, (int)slen, isFinal);
 
 done:
     if (view.buf != NULL)
@@ -892,7 +802,7 @@
         void *buf = XML_GetBuffer(self->itself, BUF_SIZE);
         if (buf == NULL) {
             Py_XDECREF(readmethod);
-            return PyErr_NoMemory();
+            return get_parse_result(self, 0);
         }
 
         bytes_read = readinst(buf, BUF_SIZE, readmethod);
@@ -1001,7 +911,7 @@
     PyObject_GC_Track(new_parser);
 
     if (self->buffer != NULL) {
-        new_parser->buffer = malloc(new_parser->buffer_size);
+        new_parser->buffer = PyMem_Malloc(new_parser->buffer_size);
         if (new_parser->buffer == NULL) {
             Py_DECREF(new_parser);
             return PyErr_NoMemory();
@@ -1018,7 +928,7 @@
     for (i = 0; handler_info[i].name != NULL; i++)
         /* do nothing */;
 
-    new_parser->handlers = malloc(sizeof(PyObject *) * i);
+    new_parser->handlers = PyMem_Malloc(sizeof(PyObject *) * i);
     if (!new_parser->handlers) {
         Py_DECREF(new_parser);
         return PyErr_NoMemory();
@@ -1126,14 +1036,19 @@
     void *data;
     unsigned int kind;
 
+    if (PyErr_Occurred())
+        return XML_STATUS_ERROR;
+
     if (template_buffer[1] == 0) {
         for (i = 0; i < 256; i++)
             template_buffer[i] = i;
     }
 
     u = PyUnicode_Decode((char*) template_buffer, 256, name, "replace");
-    if (u == NULL || PyUnicode_READY(u))
+    if (u == NULL || PyUnicode_READY(u)) {
+        Py_XDECREF(u);
         return XML_STATUS_ERROR;
+    }
 
     if (PyUnicode_GET_LENGTH(u) != 256) {
         Py_DECREF(u);
@@ -1179,28 +1094,26 @@
     self->in_callback = 0;
     self->ns_prefixes = 0;
     self->handlers = NULL;
-    if (namespace_separator != NULL) {
-        self->itself = XML_ParserCreateNS(encoding, *namespace_separator);
-    }
-    else {
-        self->itself = XML_ParserCreate(encoding);
-    }
-#if ((XML_MAJOR_VERSION >= 2) && (XML_MINOR_VERSION >= 1)) || defined(XML_HAS_SET_HASH_SALT)
-    /* This feature was added upstream in libexpat 2.1.0.  Our expat copy
-     * has a backport of this feature where we also define XML_HAS_SET_HASH_SALT
-     * to indicate that we can still use it. */
-    XML_SetHashSalt(self->itself,
-                    (unsigned long)_Py_HashSecret.prefix);
-#endif
     self->intern = intern;
     Py_XINCREF(self->intern);
     PyObject_GC_Track(self);
+
+    /* namespace_separator is either NULL or contains one char + \0 */
+    self->itself = XML_ParserCreate_MM(encoding, &ExpatMemoryHandler,
+                                       namespace_separator);
     if (self->itself == NULL) {
         PyErr_SetString(PyExc_RuntimeError,
                         "XML_ParserCreate failed");
         Py_DECREF(self);
         return NULL;
     }
+#if ((XML_MAJOR_VERSION >= 2) && (XML_MINOR_VERSION >= 1)) || defined(XML_HAS_SET_HASH_SALT)
+    /* This feature was added upstream in libexpat 2.1.0.  Our expat copy
+     * has a backport of this feature where we also define XML_HAS_SET_HASH_SALT
+     * to indicate that we can still use it. */
+    XML_SetHashSalt(self->itself,
+                    (unsigned long)_Py_HashSecret.expat.hashsalt);
+#endif
     XML_SetUserData(self->itself, (void *)self);
     XML_SetUnknownEncodingHandler(self->itself,
                   (XML_UnknownEncodingHandler) PyUnknownEncodingHandler, NULL);
@@ -1208,7 +1121,7 @@
     for (i = 0; handler_info[i].name != NULL; i++)
         /* do nothing */;
 
-    self->handlers = malloc(sizeof(PyObject *) * i);
+    self->handlers = PyMem_Malloc(sizeof(PyObject *) * i);
     if (!self->handlers) {
         Py_DECREF(self);
         return PyErr_NoMemory();
@@ -1235,11 +1148,11 @@
             self->handlers[i] = NULL;
             Py_XDECREF(temp);
         }
-        free(self->handlers);
+        PyMem_Free(self->handlers);
         self->handlers = NULL;
     }
     if (self->buffer != NULL) {
-        free(self->buffer);
+        PyMem_Free(self->buffer);
         self->buffer = NULL;
     }
     Py_XDECREF(self->intern);
@@ -1439,7 +1352,7 @@
             return -1;
         if (b) {
             if (self->buffer == NULL) {
-                self->buffer = malloc(self->buffer_size);
+                self->buffer = PyMem_Malloc(self->buffer_size);
                 if (self->buffer == NULL) {
                     PyErr_NoMemory();
                     return -1;
@@ -1450,7 +1363,7 @@
         else if (self->buffer != NULL) {
             if (flush_character_buffer(self) < 0)
                 return -1;
-            free(self->buffer);
+            PyMem_Free(self->buffer);
             self->buffer = NULL;
         }
         return 0;
@@ -1512,9 +1425,9 @@
             }
         }
         /* free existing buffer */
-        free(self->buffer);
+        PyMem_Free(self->buffer);
       }
-      self->buffer = malloc(new_buffer_size);
+      self->buffer = PyMem_Malloc(new_buffer_size);
       if (self->buffer == NULL) {
         PyErr_NoMemory();
         return -1;
diff --git a/Modules/python.c b/Modules/python.c
index f781d9a..9811c01 100644
--- a/Modules/python.c
+++ b/Modules/python.c
@@ -23,9 +23,12 @@
     wchar_t **argv_copy2;
     int i, res;
     char *oldloc;
+#ifdef __FreeBSD__
+    fp_except_t m;
+#endif
 
-    argv_copy = (wchar_t **)PyMem_Malloc(sizeof(wchar_t*)*(argc+1));
-    argv_copy2 = (wchar_t **)PyMem_Malloc(sizeof(wchar_t*)*(argc+1));
+    argv_copy = (wchar_t **)PyMem_RawMalloc(sizeof(wchar_t*) * (argc+1));
+    argv_copy2 = (wchar_t **)PyMem_RawMalloc(sizeof(wchar_t*) * (argc+1));
     if (!argv_copy || !argv_copy2) {
         fprintf(stderr, "out of memory\n");
         return 1;
@@ -37,17 +40,21 @@
      * exceptions by default.  Here we disable them.
      */
 #ifdef __FreeBSD__
-    fp_except_t m;
-
     m = fpgetmask();
     fpsetmask(m & ~FP_X_OFL);
 #endif
-    oldloc = strdup(setlocale(LC_ALL, NULL));
+
+    oldloc = _PyMem_RawStrdup(setlocale(LC_ALL, NULL));
+    if (!oldloc) {
+        fprintf(stderr, "out of memory\n");
+        return 1;
+    }
+
     setlocale(LC_ALL, "");
     for (i = 0; i < argc; i++) {
         argv_copy[i] = _Py_char2wchar(argv[i], NULL);
         if (!argv_copy[i]) {
-            free(oldloc);
+            PyMem_RawFree(oldloc);
             fprintf(stderr, "Fatal Python error: "
                             "unable to decode the command line argument #%i\n",
                             i + 1);
@@ -58,13 +65,13 @@
     argv_copy2[argc] = argv_copy[argc] = NULL;
 
     setlocale(LC_ALL, oldloc);
-    free(oldloc);
+    PyMem_RawFree(oldloc);
     res = Py_Main(argc, argv_copy);
     for (i = 0; i < argc; i++) {
-        PyMem_Free(argv_copy2[i]);
+        PyMem_RawFree(argv_copy2[i]);
     }
-    PyMem_Free(argv_copy);
-    PyMem_Free(argv_copy2);
+    PyMem_RawFree(argv_copy);
+    PyMem_RawFree(argv_copy2);
     return res;
 }
 #endif
diff --git a/Modules/readline.c b/Modules/readline.c
index 8fac526..f349d3b 100644
--- a/Modules/readline.c
+++ b/Modules/readline.c
@@ -6,6 +6,7 @@
 
 /* Standard definitions */
 #include "Python.h"
+#include <stddef.h>
 #include <setjmp.h>
 #include <signal.h>
 #include <errno.h>
@@ -76,6 +77,55 @@
    (see issue #17289 for the motivation). */
 static char *completer_word_break_characters;
 
+typedef struct {
+  PyObject *completion_display_matches_hook;
+  PyObject *startup_hook;
+  PyObject *pre_input_hook;
+  PyObject *completer;
+  PyObject *begidx;
+  PyObject *endidx;
+} readlinestate;
+
+
+#define readline_state(o) ((readlinestate *)PyModule_GetState(o))
+
+static int
+readline_clear(PyObject *m)
+{
+   readlinestate *state = readline_state(m);
+   Py_CLEAR(state->completion_display_matches_hook);
+   Py_CLEAR(state->startup_hook);
+   Py_CLEAR(state->pre_input_hook);
+   Py_CLEAR(state->completer);
+   Py_CLEAR(state->begidx);
+   Py_CLEAR(state->endidx);
+   return 0;
+}
+
+static int
+readline_traverse(PyObject *m, visitproc visit, void *arg)
+{
+    readlinestate *state = readline_state(m);
+    Py_VISIT(state->completion_display_matches_hook);
+    Py_VISIT(state->startup_hook);
+    Py_VISIT(state->pre_input_hook);
+    Py_VISIT(state->completer);
+    Py_VISIT(state->begidx);
+    Py_VISIT(state->endidx);
+    return 0;
+}
+
+static void
+readline_free(void *m)
+{
+    readline_clear((PyObject *)m);
+}
+
+static PyModuleDef readlinemodule;
+
+#define readlinestate_global ((readlinestate *)PyModule_GetState(PyState_FindModule(&readlinemodule)))
+
+
 /* Exported function to send one line to readline's init file parser */
 
 static PyObject *
@@ -86,12 +136,12 @@
         return NULL;
     /* Make a copy -- rl_parse_and_bind() modifies its argument */
     /* Bernard Herzog */
-    copy = malloc(1 + strlen(s));
+    copy = PyMem_Malloc(1 + strlen(s));
     if (copy == NULL)
         return PyErr_NoMemory();
     strcpy(copy, s);
     rl_parse_and_bind(copy);
-    free(copy); /* Free the copy */
+    PyMem_Free(copy); /* Free the copy */
     Py_RETURN_NONE;
 }
 
@@ -251,23 +301,21 @@
 
 /* Exported functions to specify hook functions in Python */
 
-static PyObject *completion_display_matches_hook = NULL;
-static PyObject *startup_hook = NULL;
 
 #ifdef HAVE_RL_PRE_INPUT_HOOK
-static PyObject *pre_input_hook = NULL;
+
 #endif
 
 static PyObject *
 set_completion_display_matches_hook(PyObject *self, PyObject *args)
 {
     PyObject *result = set_hook("completion_display_matches_hook",
-                    &completion_display_matches_hook, args);
+                    &readlinestate_global->completion_display_matches_hook, args);
 #ifdef HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK
     /* We cannot set this hook globally, since it replaces the
        default completion display. */
     rl_completion_display_matches_hook =
-        completion_display_matches_hook ?
+        readlinestate_global->completion_display_matches_hook ?
 #if defined(_RL_FUNCTION_TYPEDEF)
         (rl_compdisp_func_t *)on_completion_display_matches_hook : 0;
 #else
@@ -288,7 +336,7 @@
 static PyObject *
 set_startup_hook(PyObject *self, PyObject *args)
 {
-    return set_hook("startup_hook", &startup_hook, args);
+    return set_hook("startup_hook", &readlinestate_global->startup_hook, args);
 }
 
 PyDoc_STRVAR(doc_set_startup_hook,
@@ -305,7 +353,7 @@
 static PyObject *
 set_pre_input_hook(PyObject *self, PyObject *args)
 {
-    return set_hook("pre_input_hook", &pre_input_hook, args);
+    return set_hook("pre_input_hook", &readlinestate_global->pre_input_hook, args);
 }
 
 PyDoc_STRVAR(doc_set_pre_input_hook,
@@ -320,10 +368,10 @@
 
 /* Exported function to specify a word completer in Python */
 
-static PyObject *completer = NULL;
 
-static PyObject *begidx = NULL;
-static PyObject *endidx = NULL;
+
+
+
 
 
 /* Get the completion type for the scope of the tab-completion */
@@ -343,8 +391,8 @@
 static PyObject *
 get_begidx(PyObject *self, PyObject *noarg)
 {
-    Py_INCREF(begidx);
-    return begidx;
+    Py_INCREF(readlinestate_global->begidx);
+    return readlinestate_global->begidx;
 }
 
 PyDoc_STRVAR(doc_get_begidx,
@@ -357,8 +405,8 @@
 static PyObject *
 get_endidx(PyObject *self, PyObject *noarg)
 {
-    Py_INCREF(endidx);
-    return endidx;
+    Py_INCREF(readlinestate_global->endidx);
+    return readlinestate_global->endidx;
 }
 
 PyDoc_STRVAR(doc_get_endidx,
@@ -523,7 +571,7 @@
 static PyObject *
 set_completer(PyObject *self, PyObject *args)
 {
-    return set_hook("completer", &completer, args);
+    return set_hook("completer", &readlinestate_global->completer, args);
 }
 
 PyDoc_STRVAR(doc_set_completer,
@@ -537,11 +585,11 @@
 static PyObject *
 get_completer(PyObject *self, PyObject *noargs)
 {
-    if (completer == NULL) {
+    if (readlinestate_global->completer == NULL) {
         Py_RETURN_NONE;
     }
-    Py_INCREF(completer);
-    return completer;
+    Py_INCREF(readlinestate_global->completer);
+    return readlinestate_global->completer;
 }
 
 PyDoc_STRVAR(doc_get_completer,
@@ -745,9 +793,6 @@
     int result = 0;
     if (func != NULL) {
         PyObject *r;
-#ifdef WITH_THREAD
-        PyGILState_STATE gilstate = PyGILState_Ensure();
-#endif
         r = PyObject_CallFunction(func, NULL);
         if (r == NULL)
             goto error;
@@ -764,9 +809,6 @@
         PyErr_Clear();
         Py_XDECREF(r);
       done:
-#ifdef WITH_THREAD
-        PyGILState_Release(gilstate);
-#endif
         return result;
     }
     return result;
@@ -779,7 +821,15 @@
 on_startup_hook()
 #endif
 {
-    return on_hook(startup_hook);
+    int r;
+#ifdef WITH_THREAD
+    PyGILState_STATE gilstate = PyGILState_Ensure();
+#endif
+    r = on_hook(readlinestate_global->startup_hook);
+#ifdef WITH_THREAD
+    PyGILState_Release(gilstate);
+#endif
+    return r;
 }
 
 #ifdef HAVE_RL_PRE_INPUT_HOOK
@@ -790,7 +840,15 @@
 on_pre_input_hook()
 #endif
 {
-    return on_hook(pre_input_hook);
+    int r;
+#ifdef WITH_THREAD
+    PyGILState_STATE gilstate = PyGILState_Ensure();
+#endif
+    r = on_hook(readlinestate_global->pre_input_hook);
+#ifdef WITH_THREAD
+    PyGILState_Release(gilstate);
+#endif
+    return r;
 }
 #endif
 
@@ -817,7 +875,7 @@
         if (PyList_SetItem(m, i, s) == -1)
             goto error;
     }
-    r = PyObject_CallFunction(completion_display_matches_hook,
+    r = PyObject_CallFunction(readlinestate_global->completion_display_matches_hook,
                               "sOi", matches[0], m, max_length);
 
     Py_DECREF(m); m=NULL;
@@ -847,13 +905,13 @@
 on_completion(const char *text, int state)
 {
     char *result = NULL;
-    if (completer != NULL) {
+    if (readlinestate_global->completer != NULL) {
         PyObject *r;
 #ifdef WITH_THREAD
         PyGILState_STATE gilstate = PyGILState_Ensure();
 #endif
         rl_attempted_completion_over = 1;
-        r = PyObject_CallFunction(completer, "si", text, state);
+        r = PyObject_CallFunction(readlinestate_global->completer, "si", text, state);
         if (r == NULL)
             goto error;
         if (r == Py_None) {
@@ -886,24 +944,32 @@
 static char **
 flex_complete(const char *text, int start, int end)
 {
+    char **result;
+#ifdef WITH_THREAD
+    PyGILState_STATE gilstate = PyGILState_Ensure();
+#endif
 #ifdef HAVE_RL_COMPLETION_APPEND_CHARACTER
     rl_completion_append_character ='\0';
 #endif
 #ifdef HAVE_RL_COMPLETION_SUPPRESS_APPEND
     rl_completion_suppress_append = 0;
 #endif
-    Py_XDECREF(begidx);
-    Py_XDECREF(endidx);
-    begidx = PyLong_FromLong((long) start);
-    endidx = PyLong_FromLong((long) end);
-    return completion_matches(text, *on_completion);
+    Py_XDECREF(readlinestate_global->begidx);
+    Py_XDECREF(readlinestate_global->endidx);
+    readlinestate_global->begidx = PyLong_FromLong((long) start);
+    readlinestate_global->endidx = PyLong_FromLong((long) end);
+    result = completion_matches(text, *on_completion);
+#ifdef WITH_THREAD
+    PyGILState_Release(gilstate);
+#endif
+    return result;
 }
 
 
 /* Helper to initialize GNU readline properly. */
 
 static void
-setup_readline(void)
+setup_readline(readlinestate *mod_state)
 {
 #ifdef SAVE_LOCALE
     char *saved_locale = strdup(setlocale(LC_CTYPE, NULL));
@@ -933,10 +999,6 @@
     using_history();
 
     rl_readline_name = "python";
-#if defined(PYOS_OS2) && defined(PYCC_GCC)
-    /* Allow $if term= in .inputrc to work */
-    rl_terminal_name = getenv("TERM");
-#endif
     /* Force rebind of TAB to insert-tab */
     rl_bind_key('\t', rl_insert);
     /* Bind both ESC-TAB and ESC-ESC to the completion function */
@@ -955,8 +1017,23 @@
         strdup(" \t\n`~!@#$%^&*()-=+[{]}\\|;:'\",<>/?");
         /* All nonalphanums except '.' */
 
-    begidx = PyLong_FromLong(0L);
-    endidx = PyLong_FromLong(0L);
+    mod_state->begidx = PyLong_FromLong(0L);
+    mod_state->endidx = PyLong_FromLong(0L);
+
+#ifndef __APPLE__
+    if (!isatty(STDOUT_FILENO)) {
+        /* Issue #19884: stdout is no a terminal. Disable meta modifier
+           keys to not write the ANSI sequence "\033[1034h" into stdout. On
+           terminals supporting 8 bit characters like TERM=xterm-256color
+           (which is now the default Fedora since Fedora 18), the meta key is
+           used to enable support of 8 bit characters (ANSI sequence
+           "\033[1034h").
+
+           With libedit, this call makes readline() crash. */
+        rl_variable_bind ("enable-meta-key", "off");
+    }
+#endif
+
     /* Initialize (allows .inputrc to override)
      *
      * XXX: A bug in the readline-2.2 library causes a memory leak
@@ -988,7 +1065,7 @@
 extern PyThreadState* _PyOS_ReadlineTState;
 
 static char *
-readline_until_enter_or_signal(char *prompt, int *signal)
+readline_until_enter_or_signal(const char *prompt, int *signal)
 {
     char * not_done_reading = "";
     fd_set selectset;
@@ -1063,7 +1140,7 @@
 
 
 static char *
-readline_until_enter_or_signal(char *prompt, int *signal)
+readline_until_enter_or_signal(const char *prompt, int *signal)
 {
     PyOS_sighandler_t old_inthandler;
     char *p;
@@ -1090,7 +1167,7 @@
 
 
 static char *
-call_readline(FILE *sys_stdin, FILE *sys_stdout, char *prompt)
+call_readline(FILE *sys_stdin, FILE *sys_stdout, const char *prompt)
 {
     size_t n;
     char *p, *q;
@@ -1121,7 +1198,7 @@
 
     /* We got an EOF, return a empty string. */
     if (p == NULL) {
-        p = PyMem_Malloc(1);
+        p = PyMem_RawMalloc(1);
         if (p != NULL)
             *p = '\0';
         RESTORE_LOCALE(saved_locale)
@@ -1149,7 +1226,7 @@
     /* Copy the malloc'ed buffer into a PyMem_Malloc'ed one and
        release the original. */
     q = p;
-    p = PyMem_Malloc(n+2);
+    p = PyMem_RawMalloc(n+2);
     if (p != NULL) {
         strncpy(p, q, n);
         p[n] = '\n';
@@ -1175,12 +1252,12 @@
     PyModuleDef_HEAD_INIT,
     "readline",
     doc_module,
-    -1,
+    sizeof(readlinestate),
     readline_methods,
     NULL,
-    NULL,
-    NULL,
-    NULL
+    readline_traverse,
+    readline_clear,
+    readline_free
 };
 
 
@@ -1188,6 +1265,7 @@
 PyInit_readline(void)
 {
     PyObject *m;
+    readlinestate *mod_state;
 
 #ifdef __APPLE__
     if (strncmp(rl_library_version, libedit_version_tag, strlen(libedit_version_tag)) == 0) {
@@ -1204,7 +1282,12 @@
     if (m == NULL)
         return NULL;
 
+    mod_state = (readlinestate *) PyModule_GetState(m);
     PyOS_ReadlineFunctionPointer = call_readline;
-    setup_readline();
+    setup_readline(mod_state);
+
+    PyModule_AddIntConstant(m, "_READLINE_VERSION", RL_READLINE_VERSION);
+    PyModule_AddIntConstant(m, "_READLINE_RUNTIME_VERSION", rl_readline_version);
+
     return m;
 }
diff --git a/Modules/resource.c b/Modules/resource.c
index b294a8c..3a1cf09 100644
--- a/Modules/resource.c
+++ b/Modules/resource.c
@@ -106,6 +106,44 @@
     return result;
 }
 
+static int
+py2rlimit(PyObject *curobj, PyObject *maxobj, struct rlimit *rl_out)
+{
+#if !defined(HAVE_LARGEFILE_SUPPORT)
+    rl_out->rlim_cur = PyLong_AsLong(curobj);
+    if (rl_out->rlim_cur == (rlim_t)-1 && PyErr_Occurred())
+        return -1;
+    rl_out->rlim_max = PyLong_AsLong(maxobj);
+    if (rl_out->rlim_max == (rlim_t)-1 && PyErr_Occurred())
+        return -1;
+#else
+    /* The limits are probably bigger than a long */
+    rl_out->rlim_cur = PyLong_AsLongLong(curobj);
+    if (rl_out->rlim_cur == (rlim_t)-1 && PyErr_Occurred())
+        return -1;
+    rl_out->rlim_max = PyLong_AsLongLong(maxobj);
+    if (rl_out->rlim_max == (rlim_t)-1 && PyErr_Occurred())
+        return -1;
+#endif
+
+    rl_out->rlim_cur = rl_out->rlim_cur & RLIM_INFINITY;
+    rl_out->rlim_max = rl_out->rlim_max & RLIM_INFINITY;
+    return 0;
+
+}
+
+static PyObject*
+rlimit2py(struct rlimit rl)
+{
+#if defined(HAVE_LONG_LONG)
+    if (sizeof(rl.rlim_cur) > sizeof(long)) {
+        return Py_BuildValue("LL",
+                             (PY_LONG_LONG) rl.rlim_cur,
+                             (PY_LONG_LONG) rl.rlim_max);
+    }
+#endif
+    return Py_BuildValue("ll", (long) rl.rlim_cur, (long) rl.rlim_max);
+}
 
 static PyObject *
 resource_getrlimit(PyObject *self, PyObject *args)
@@ -126,15 +164,7 @@
         PyErr_SetFromErrno(PyExc_OSError);
         return NULL;
     }
-
-#if defined(HAVE_LONG_LONG)
-    if (sizeof(rl.rlim_cur) > sizeof(long)) {
-        return Py_BuildValue("LL",
-                             (PY_LONG_LONG) rl.rlim_cur,
-                             (PY_LONG_LONG) rl.rlim_max);
-    }
-#endif
-    return Py_BuildValue("ll", (long) rl.rlim_cur, (long) rl.rlim_max);
+    return rlimit2py(rl);
 }
 
 static PyObject *
@@ -166,25 +196,10 @@
     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())
+    if (py2rlimit(curobj, maxobj, &rl) < 0) {
         goto error;
-    rl.rlim_max = PyLong_AsLong(maxobj);
-    if (rl.rlim_max == (rlim_t)-1 && PyErr_Occurred())
-        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())
-        goto error;
-    rl.rlim_max = PyLong_AsLongLong(maxobj);
-    if (rl.rlim_max == (rlim_t)-1 && PyErr_Occurred())
-        goto error;
-#endif
+    }
 
-    rl.rlim_cur = rl.rlim_cur & RLIM_INFINITY;
-    rl.rlim_max = rl.rlim_max & RLIM_INFINITY;
     if (setrlimit(resource, &rl) == -1) {
         if (errno == EINVAL)
             PyErr_SetString(PyExc_ValueError,
@@ -205,6 +220,48 @@
     return NULL;
 }
 
+#ifdef HAVE_PRLIMIT
+static PyObject *
+resource_prlimit(PyObject *self, PyObject *args)
+{
+    struct rlimit old_limit, new_limit;
+    int resource, retval;
+    pid_t pid;
+    PyObject *curobj=NULL, *maxobj=NULL;
+
+    if (!PyArg_ParseTuple(args, _Py_PARSE_PID "i|(OO):prlimit",
+                          &pid, &resource, &curobj, &maxobj))
+        return NULL;
+
+    if (resource < 0 || resource >= RLIM_NLIMITS) {
+        PyErr_SetString(PyExc_ValueError,
+                        "invalid resource specified");
+        return NULL;
+    }
+
+    if (curobj != NULL) {
+        if (py2rlimit(curobj, maxobj, &new_limit) < 0) {
+            return NULL;
+        }
+        retval = prlimit(pid, resource, &new_limit, &old_limit);
+    }
+    else {
+        retval = prlimit(pid, resource, NULL, &old_limit);
+    }
+
+    if (retval == -1) {
+        if (errno == EINVAL) {
+            PyErr_SetString(PyExc_ValueError,
+                            "current limit exceeds maximum limit");
+        } else {
+            PyErr_SetFromErrno(PyExc_OSError);
+        }
+        return NULL;
+    }
+    return rlimit2py(old_limit);
+}
+#endif /* HAVE_PRLIMIT */
+
 static PyObject *
 resource_getpagesize(PyObject *self, PyObject *unused)
 {
@@ -229,6 +286,9 @@
 resource_methods[] = {
     {"getrusage",    resource_getrusage,   METH_VARARGS},
     {"getrlimit",    resource_getrlimit,   METH_VARARGS},
+#ifdef HAVE_PRLIMIT
+    {"prlimit",      resource_prlimit,     METH_VARARGS},
+#endif
     {"setrlimit",    resource_setrlimit,   METH_VARARGS},
     {"getpagesize",  resource_getpagesize, METH_NOARGS},
     {NULL, NULL}                             /* sentinel */
@@ -263,80 +323,119 @@
     /* Add some symbolic constants to the module */
     Py_INCREF(PyExc_OSError);
     PyModule_AddObject(m, "error", PyExc_OSError);
-    if (!initialized)
-        PyStructSequence_InitType(&StructRUsageType,
-                                  &struct_rusage_desc);
+    if (!initialized) {
+        if (PyStructSequence_InitType2(&StructRUsageType,
+                                       &struct_rusage_desc) < 0)
+            return NULL;
+    }
+
     Py_INCREF(&StructRUsageType);
     PyModule_AddObject(m, "struct_rusage",
                        (PyObject*) &StructRUsageType);
 
     /* insert constants */
 #ifdef RLIMIT_CPU
-    PyModule_AddIntConstant(m, "RLIMIT_CPU", RLIMIT_CPU);
+    PyModule_AddIntMacro(m, RLIMIT_CPU);
 #endif
 
 #ifdef RLIMIT_FSIZE
-    PyModule_AddIntConstant(m, "RLIMIT_FSIZE", RLIMIT_FSIZE);
+    PyModule_AddIntMacro(m, RLIMIT_FSIZE);
 #endif
 
 #ifdef RLIMIT_DATA
-    PyModule_AddIntConstant(m, "RLIMIT_DATA", RLIMIT_DATA);
+    PyModule_AddIntMacro(m, RLIMIT_DATA);
 #endif
 
 #ifdef RLIMIT_STACK
-    PyModule_AddIntConstant(m, "RLIMIT_STACK", RLIMIT_STACK);
+    PyModule_AddIntMacro(m, RLIMIT_STACK);
 #endif
 
 #ifdef RLIMIT_CORE
-    PyModule_AddIntConstant(m, "RLIMIT_CORE", RLIMIT_CORE);
+    PyModule_AddIntMacro(m, RLIMIT_CORE);
 #endif
 
 #ifdef RLIMIT_NOFILE
-    PyModule_AddIntConstant(m, "RLIMIT_NOFILE", RLIMIT_NOFILE);
+    PyModule_AddIntMacro(m, RLIMIT_NOFILE);
 #endif
 
 #ifdef RLIMIT_OFILE
-    PyModule_AddIntConstant(m, "RLIMIT_OFILE", RLIMIT_OFILE);
+    PyModule_AddIntMacro(m, RLIMIT_OFILE);
 #endif
 
 #ifdef RLIMIT_VMEM
-    PyModule_AddIntConstant(m, "RLIMIT_VMEM", RLIMIT_VMEM);
+    PyModule_AddIntMacro(m, RLIMIT_VMEM);
 #endif
 
 #ifdef RLIMIT_AS
-    PyModule_AddIntConstant(m, "RLIMIT_AS", RLIMIT_AS);
+    PyModule_AddIntMacro(m, RLIMIT_AS);
 #endif
 
 #ifdef RLIMIT_RSS
-    PyModule_AddIntConstant(m, "RLIMIT_RSS", RLIMIT_RSS);
+    PyModule_AddIntMacro(m, RLIMIT_RSS);
 #endif
 
 #ifdef RLIMIT_NPROC
-    PyModule_AddIntConstant(m, "RLIMIT_NPROC", RLIMIT_NPROC);
+    PyModule_AddIntMacro(m, RLIMIT_NPROC);
 #endif
 
 #ifdef RLIMIT_MEMLOCK
-    PyModule_AddIntConstant(m, "RLIMIT_MEMLOCK", RLIMIT_MEMLOCK);
+    PyModule_AddIntMacro(m, RLIMIT_MEMLOCK);
 #endif
 
 #ifdef RLIMIT_SBSIZE
-    PyModule_AddIntConstant(m, "RLIMIT_SBSIZE", RLIMIT_SBSIZE);
+    PyModule_AddIntMacro(m, RLIMIT_SBSIZE);
 #endif
 
+/* Linux specific */
+#ifdef RLIMIT_MSGQUEUE
+    PyModule_AddIntMacro(m, RLIMIT_MSGQUEUE);
+#endif
+
+#ifdef RLIMIT_NICE
+    PyModule_AddIntMacro(m, RLIMIT_NICE);
+#endif
+
+#ifdef RLIMIT_RTPRIO
+    PyModule_AddIntMacro(m, RLIMIT_RTPRIO);
+#endif
+
+#ifdef RLIMIT_RTTIME
+    PyModule_AddIntMacro(m, RLIMIT_RTTIME);
+#endif
+
+#ifdef RLIMIT_SIGPENDING
+    PyModule_AddIntMacro(m, RLIMIT_SIGPENDING);
+#endif
+
+/* target */
 #ifdef RUSAGE_SELF
-    PyModule_AddIntConstant(m, "RUSAGE_SELF", RUSAGE_SELF);
+    PyModule_AddIntMacro(m, RUSAGE_SELF);
 #endif
 
 #ifdef RUSAGE_CHILDREN
-    PyModule_AddIntConstant(m, "RUSAGE_CHILDREN", RUSAGE_CHILDREN);
+    PyModule_AddIntMacro(m, RUSAGE_CHILDREN);
 #endif
 
 #ifdef RUSAGE_BOTH
-    PyModule_AddIntConstant(m, "RUSAGE_BOTH", RUSAGE_BOTH);
+    PyModule_AddIntMacro(m, RUSAGE_BOTH);
 #endif
 
 #ifdef RUSAGE_THREAD
-    PyModule_AddIntConstant(m, "RUSAGE_THREAD", RUSAGE_THREAD);
+    PyModule_AddIntMacro(m, RUSAGE_THREAD);
+#endif
+
+/* FreeBSD specific */
+
+#ifdef RLIMIT_SWAP
+    PyModule_AddIntMacro(m, RLIMIT_SWAP);
+#endif
+
+#ifdef RLIMIT_SBSIZE
+    PyModule_AddIntMacro(m, RLIMIT_SBSIZE);
+#endif
+
+#ifdef RLIMIT_NPTS
+    PyModule_AddIntMacro(m, RLIMIT_NPTS);
 #endif
 
 #if defined(HAVE_LONG_LONG)
diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c
index 952a091..ffaf865 100644
--- a/Modules/selectmodule.c
+++ b/Modules/selectmodule.c
@@ -47,19 +47,11 @@
 #include <sys/types.h>
 #endif
 
-#if defined(PYOS_OS2) && !defined(PYCC_GCC)
-#include <sys/time.h>
-#include <utils.h>
-#endif
-
 #ifdef MS_WINDOWS
 #  define WIN32_LEAN_AND_MEAN
 #  include <winsock.h>
 #else
 #  define SOCKET int
-#  if defined(__VMS)
-#    include <socket.h>
-#  endif
 #endif
 
 /* list of Python objects and their file descriptor */
@@ -220,10 +212,18 @@
         return NULL;
     }
     else {
-#ifdef MS_WINDOWS
+        /* On OpenBSD 5.4, timeval.tv_sec is a long.
+         * Example: long is 64-bit, whereas time_t is 32-bit. */
         time_t sec;
-        if (_PyTime_ObjectToTimeval(tout, &sec, &tv.tv_usec) == -1)
+        /* On OS X 64-bit, timeval.tv_usec is an int (and thus still 4
+           bytes as required), but no longer defined by a long. */
+        long usec;
+        if (_PyTime_ObjectToTimeval(tout, &sec, &usec,
+                                    _PyTime_ROUND_UP) == -1)
             return NULL;
+#ifdef MS_WINDOWS
+        /* On Windows, timeval.tv_sec is a long (32 bit),
+         * whereas time_t can be 64-bit. */
         assert(sizeof(tv.tv_sec) == sizeof(long));
 #if SIZEOF_TIME_T > SIZEOF_LONG
         if (sec > LONG_MAX) {
@@ -234,13 +234,10 @@
 #endif
         tv.tv_sec = (long)sec;
 #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;
-        if (_PyTime_ObjectToTimeval(tout, &tv.tv_sec, &tv_usec) == -1)
-            return NULL;
-        tv.tv_usec = tv_usec;
+        assert(sizeof(tv.tv_sec) >= sizeof(sec));
+        tv.tv_sec = sec;
 #endif
+        tv.tv_usec = usec;
         if (tv.tv_sec < 0) {
             PyErr_SetString(PyExc_ValueError, "timeout must be non-negative");
             return NULL;
@@ -303,9 +300,9 @@
         else
             ret = PyTuple_Pack(3, ifdlist, ofdlist, efdlist);
 
-        Py_DECREF(ifdlist);
-        Py_DECREF(ofdlist);
-        Py_DECREF(efdlist);
+        Py_XDECREF(ifdlist);
+        Py_XDECREF(ofdlist);
+        Py_XDECREF(efdlist);
     }
 
   finally:
@@ -705,6 +702,13 @@
 
 static PyTypeObject devpoll_Type;
 
+static PyObject *
+devpoll_err_closed(void)
+{
+    PyErr_SetString(PyExc_ValueError, "I/O operation on closed devpoll object");
+    return NULL;
+}
+
 static int devpoll_flush(devpollObject *self)
 {
     int size, n;
@@ -746,6 +750,9 @@
     int fd;
     unsigned short events = POLLIN | POLLPRI | POLLOUT;
 
+    if (self->fd_devpoll < 0)
+        return devpoll_err_closed();
+
     if (!PyArg_ParseTuple(args, "O|O&:register", &o, ushort_converter, &events))
         return NULL;
 
@@ -809,6 +816,9 @@
 {
     int fd;
 
+    if (self->fd_devpoll < 0)
+        return devpoll_err_closed();
+
     fd = PyObject_AsFileDescriptor( o );
     if (fd == -1)
         return NULL;
@@ -838,6 +848,9 @@
     long timeout;
     PyObject *value, *num1, *num2;
 
+    if (self->fd_devpoll < 0)
+        return devpoll_err_closed();
+
     if (!PyArg_UnpackTuple(args, "poll", 0, 1, &tout)) {
         return NULL;
     }
@@ -916,6 +929,60 @@
     return NULL;
 }
 
+static int
+devpoll_internal_close(devpollObject *self)
+{
+    int save_errno = 0;
+    if (self->fd_devpoll >= 0) {
+        int fd = self->fd_devpoll;
+        self->fd_devpoll = -1;
+        Py_BEGIN_ALLOW_THREADS
+        if (close(fd) < 0)
+            save_errno = errno;
+        Py_END_ALLOW_THREADS
+    }
+    return save_errno;
+}
+
+static PyObject*
+devpoll_close(devpollObject *self)
+{
+    errno = devpoll_internal_close(self);
+    if (errno < 0) {
+        PyErr_SetFromErrno(PyExc_OSError);
+        return NULL;
+    }
+    Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(devpoll_close_doc,
+"close() -> None\n\
+\n\
+Close the devpoll file descriptor. Further operations on the devpoll\n\
+object will raise an exception.");
+
+static PyObject*
+devpoll_get_closed(devpollObject *self)
+{
+    if (self->fd_devpoll < 0)
+        Py_RETURN_TRUE;
+    else
+        Py_RETURN_FALSE;
+}
+
+static PyObject*
+devpoll_fileno(devpollObject *self)
+{
+    if (self->fd_devpoll < 0)
+        return devpoll_err_closed();
+    return PyLong_FromLong(self->fd_devpoll);
+}
+
+PyDoc_STRVAR(devpoll_fileno_doc,
+"fileno() -> int\n\
+\n\
+Return the file descriptor.");
+
 static PyMethodDef devpoll_methods[] = {
     {"register",        (PyCFunction)devpoll_register,
      METH_VARARGS,  devpoll_register_doc},
@@ -925,9 +992,19 @@
      METH_O,        devpoll_unregister_doc},
     {"poll",            (PyCFunction)devpoll_poll,
      METH_VARARGS,  devpoll_poll_doc},
+    {"close",           (PyCFunction)devpoll_close,    METH_NOARGS,
+     devpoll_close_doc},
+    {"fileno",          (PyCFunction)devpoll_fileno,    METH_NOARGS,
+     devpoll_fileno_doc},
     {NULL,              NULL}           /* sentinel */
 };
 
+static PyGetSetDef devpoll_getsetlist[] = {
+    {"closed", (getter)devpoll_get_closed, NULL,
+     "True if the devpoll object is closed"},
+    {0},
+};
+
 static devpollObject *
 newDevPollObject(void)
 {
@@ -945,7 +1022,7 @@
     */
     limit_result = getrlimit(RLIMIT_NOFILE, &limit);
     if (limit_result != -1)
-        fd_devpoll = open("/dev/poll", O_RDWR);
+        fd_devpoll = _Py_open("/dev/poll", O_RDWR);
     Py_END_ALLOW_THREADS
 
     if (limit_result == -1) {
@@ -981,12 +1058,8 @@
 static void
 devpoll_dealloc(devpollObject *self)
 {
-    Py_BEGIN_ALLOW_THREADS
-    close(self->fd_devpoll);
-    Py_END_ALLOW_THREADS
-
+    (void)devpoll_internal_close(self);
     PyMem_DEL(self->fds);
-
     PyObject_Del(self);
 }
 
@@ -1022,6 +1095,8 @@
     0,                          /*tp_iter*/
     0,                          /*tp_iternext*/
     devpoll_methods,            /*tp_methods*/
+    0,                          /* tp_members */
+    devpoll_getsetlist,         /* tp_getset */
 };
 #endif  /* HAVE_SYS_DEVPOLL_H */
 
@@ -1105,7 +1180,7 @@
 static PyObject *
 pyepoll_err_closed(void)
 {
-    PyErr_SetString(PyExc_ValueError, "I/O operation on closed epoll fd");
+    PyErr_SetString(PyExc_ValueError, "I/O operation on closed epoll object");
     return NULL;
 }
 
@@ -1137,6 +1212,7 @@
     if (fd == -1) {
         Py_BEGIN_ALLOW_THREADS
 #ifdef HAVE_EPOLL_CREATE1
+        flags |= EPOLL_CLOEXEC;
         if (flags)
             self->epfd = epoll_create1(flags);
         else
@@ -1152,6 +1228,14 @@
         PyErr_SetFromErrno(PyExc_OSError);
         return NULL;
     }
+
+#ifndef HAVE_EPOLL_CREATE1
+    if (fd == -1 && _Py_set_inheritable(self->epfd, 0, NULL) < 0) {
+        Py_DECREF(self);
+        return NULL;
+    }
+#endif
+
     return (PyObject *)self;
 }
 
@@ -1251,16 +1335,16 @@
         return NULL;
     }
 
-    switch(op) {
-        case EPOLL_CTL_ADD:
-        case EPOLL_CTL_MOD:
+    switch (op) {
+    case EPOLL_CTL_ADD:
+    case EPOLL_CTL_MOD:
         ev.events = events;
         ev.data.fd = fd;
         Py_BEGIN_ALLOW_THREADS
         result = epoll_ctl(epfd, op, fd, &ev);
         Py_END_ALLOW_THREADS
         break;
-        case EPOLL_CTL_DEL:
+    case EPOLL_CTL_DEL:
         /* In kernel versions before 2.6.9, the EPOLL_CTL_DEL
          * operation required a non-NULL pointer in event, even
          * though this argument is ignored. */
@@ -1273,7 +1357,7 @@
         }
         Py_END_ALLOW_THREADS
         break;
-        default:
+    default:
         result = -1;
         errno = EINVAL;
     }
@@ -1378,7 +1462,9 @@
         return NULL;
     }
     else {
-        timeout = (int)(dtimeout * 1000.0);
+        /* epoll_wait() has a resolution of 1 millisecond, round away from zero
+           to wait *at least* dtimeout seconds. */
+        timeout = (int)ceil(dtimeout * 1000.0);
     }
 
     if (maxevents == -1) {
@@ -1393,7 +1479,6 @@
 
     evs = PyMem_New(struct epoll_event, maxevents);
     if (evs == NULL) {
-        Py_DECREF(self);
         PyErr_NoMemory();
         return NULL;
     }
@@ -1432,6 +1517,24 @@
 in seconds (as float). -1 makes poll wait indefinitely.\n\
 Up to maxevents are returned to the caller.");
 
+static PyObject *
+pyepoll_enter(pyEpoll_Object *self, PyObject *args)
+{
+    if (self->epfd < 0)
+        return pyepoll_err_closed();
+
+    Py_INCREF(self);
+    return (PyObject *)self;
+}
+
+static PyObject *
+pyepoll_exit(PyObject *self, PyObject *args)
+{
+    _Py_IDENTIFIER(close);
+
+    return _PyObject_CallMethodId(self, &PyId_close, NULL);
+}
+
 static PyMethodDef pyepoll_methods[] = {
     {"fromfd",          (PyCFunction)pyepoll_fromfd,
      METH_VARARGS | METH_CLASS, pyepoll_fromfd_doc},
@@ -1447,6 +1550,10 @@
      METH_VARARGS | METH_KEYWORDS,      pyepoll_unregister_doc},
     {"poll",            (PyCFunction)pyepoll_poll,
      METH_VARARGS | METH_KEYWORDS,      pyepoll_poll_doc},
+    {"__enter__",           (PyCFunction)pyepoll_enter,     METH_NOARGS,
+     NULL},
+    {"__exit__",           (PyCFunction)pyepoll_exit,     METH_VARARGS,
+     NULL},
     {NULL,      NULL},
 };
 
@@ -1604,17 +1711,17 @@
  * kevent is not standard and its members vary across BSDs.
  */
 #if !defined(__OpenBSD__)
-#   define IDENT_TYPE	T_UINTPTRT
-#   define IDENT_CAST	Py_intptr_t
-#   define DATA_TYPE	T_INTPTRT
+#   define IDENT_TYPE  T_UINTPTRT
+#   define IDENT_CAST  Py_intptr_t
+#   define DATA_TYPE   T_INTPTRT
 #   define DATA_FMT_UNIT INTPTRT_FMT_UNIT
-#   define IDENT_AsType	PyLong_AsUintptr_t
+#   define IDENT_AsType PyLong_AsUintptr_t
 #else
-#   define IDENT_TYPE	T_UINT
-#   define IDENT_CAST	int
-#   define DATA_TYPE	T_INT
+#   define IDENT_TYPE  T_UINT
+#   define IDENT_CAST  int
+#   define DATA_TYPE   T_INT
 #   define DATA_FMT_UNIT "i"
-#   define IDENT_AsType	PyLong_AsUnsignedLong
+#   define IDENT_AsType PyLong_AsUnsignedLong
 #endif
 
 /* Unfortunately, we can't store python objects in udata, because
@@ -1666,7 +1773,7 @@
 
     if (PyLong_Check(pfd)
 #if IDENT_TYPE == T_UINT
-	&& PyLong_AsUnsignedLong(pfd) <= UINT_MAX
+        && PyLong_AsUnsignedLong(pfd) <= UINT_MAX
 #endif
     ) {
         self->e.ident = IDENT_AsType(pfd);
@@ -1708,22 +1815,22 @@
     }
 
     switch (op) {
-        case Py_EQ:
+    case Py_EQ:
         result = (result == 0);
         break;
-        case Py_NE:
+    case Py_NE:
         result = (result != 0);
         break;
-        case Py_LE:
+    case Py_LE:
         result = (result <= 0);
         break;
-        case Py_GE:
+    case Py_GE:
         result = (result >= 0);
         break;
-        case Py_LT:
+    case Py_LT:
         result = (result < 0);
         break;
-        case Py_GT:
+    case Py_GT:
         result = (result > 0);
         break;
     }
@@ -1775,7 +1882,7 @@
 static PyObject *
 kqueue_queue_err_closed(void)
 {
-    PyErr_SetString(PyExc_ValueError, "I/O operation on closed kqueue fd");
+    PyErr_SetString(PyExc_ValueError, "I/O operation on closed kqueue object");
     return NULL;
 }
 
@@ -1817,13 +1924,19 @@
         PyErr_SetFromErrno(PyExc_OSError);
         return NULL;
     }
+
+    if (fd == -1) {
+        if (_Py_set_inheritable(self->kqfd, 0, NULL) < 0) {
+            Py_DECREF(self);
+            return NULL;
+        }
+    }
     return (PyObject *)self;
 }
 
 static PyObject *
 kqueue_queue_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
 {
-
     if ((args != NULL && PyObject_Size(args)) ||
                     (kwds != NULL && PyObject_Size(kwds))) {
         PyErr_SetString(PyExc_ValueError,
@@ -1929,8 +2042,8 @@
         ptimeoutspec = NULL;
     }
     else if (PyNumber_Check(otimeout)) {
-        if (_PyTime_ObjectToTimespec(otimeout,
-                                     &timeout.tv_sec, &timeout.tv_nsec) == -1)
+        if (_PyTime_ObjectToTimespec(otimeout, &timeout.tv_sec,
+                                     &timeout.tv_nsec, _PyTime_ROUND_UP) == -1)
             return NULL;
 
         if (timeout.tv_sec < 0) {
@@ -2143,7 +2256,7 @@
 that are ready.\n\
 \n\
 *** IMPORTANT NOTICE ***\n\
-On Windows and OpenVMS, only sockets are supported; on Unix, all file\n\
+On Windows only sockets are supported; on Unix, all file\n\
 descriptors can be used.");
 
 static PyMethodDef select_methods[] = {
@@ -2161,7 +2274,7 @@
 "This module supports asynchronous I/O on multiple file descriptors.\n\
 \n\
 *** IMPORTANT NOTICE ***\n\
-On Windows and OpenVMS, only sockets are supported; on Unix, all file descriptors.");
+On Windows only sockets are supported; on Unix, all file descriptors.");
 
 
 static struct PyModuleDef selectmodule = {
@@ -2195,7 +2308,7 @@
 #undef PIPE_BUF
 #define PIPE_BUF 512
 #endif
-    PyModule_AddIntConstant(m, "PIPE_BUF", PIPE_BUF);
+    PyModule_AddIntMacro(m, PIPE_BUF);
 #endif
 
 #if defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)
@@ -2210,27 +2323,27 @@
 #endif
         if (PyType_Ready(&poll_Type) < 0)
             return NULL;
-        PyModule_AddIntConstant(m, "POLLIN", POLLIN);
-        PyModule_AddIntConstant(m, "POLLPRI", POLLPRI);
-        PyModule_AddIntConstant(m, "POLLOUT", POLLOUT);
-        PyModule_AddIntConstant(m, "POLLERR", POLLERR);
-        PyModule_AddIntConstant(m, "POLLHUP", POLLHUP);
-        PyModule_AddIntConstant(m, "POLLNVAL", POLLNVAL);
+        PyModule_AddIntMacro(m, POLLIN);
+        PyModule_AddIntMacro(m, POLLPRI);
+        PyModule_AddIntMacro(m, POLLOUT);
+        PyModule_AddIntMacro(m, POLLERR);
+        PyModule_AddIntMacro(m, POLLHUP);
+        PyModule_AddIntMacro(m, POLLNVAL);
 
 #ifdef POLLRDNORM
-        PyModule_AddIntConstant(m, "POLLRDNORM", POLLRDNORM);
+        PyModule_AddIntMacro(m, POLLRDNORM);
 #endif
 #ifdef POLLRDBAND
-        PyModule_AddIntConstant(m, "POLLRDBAND", POLLRDBAND);
+        PyModule_AddIntMacro(m, POLLRDBAND);
 #endif
 #ifdef POLLWRNORM
-        PyModule_AddIntConstant(m, "POLLWRNORM", POLLWRNORM);
+        PyModule_AddIntMacro(m, POLLWRNORM);
 #endif
 #ifdef POLLWRBAND
-        PyModule_AddIntConstant(m, "POLLWRBAND", POLLWRBAND);
+        PyModule_AddIntMacro(m, POLLWRBAND);
 #endif
 #ifdef POLLMSG
-        PyModule_AddIntConstant(m, "POLLMSG", POLLMSG);
+        PyModule_AddIntMacro(m, POLLMSG);
 #endif
     }
 #endif /* HAVE_POLL */
@@ -2248,25 +2361,25 @@
     Py_INCREF(&pyEpoll_Type);
     PyModule_AddObject(m, "epoll", (PyObject *) &pyEpoll_Type);
 
-    PyModule_AddIntConstant(m, "EPOLLIN", EPOLLIN);
-    PyModule_AddIntConstant(m, "EPOLLOUT", EPOLLOUT);
-    PyModule_AddIntConstant(m, "EPOLLPRI", EPOLLPRI);
-    PyModule_AddIntConstant(m, "EPOLLERR", EPOLLERR);
-    PyModule_AddIntConstant(m, "EPOLLHUP", EPOLLHUP);
-    PyModule_AddIntConstant(m, "EPOLLET", EPOLLET);
+    PyModule_AddIntMacro(m, EPOLLIN);
+    PyModule_AddIntMacro(m, EPOLLOUT);
+    PyModule_AddIntMacro(m, EPOLLPRI);
+    PyModule_AddIntMacro(m, EPOLLERR);
+    PyModule_AddIntMacro(m, EPOLLHUP);
+    PyModule_AddIntMacro(m, EPOLLET);
 #ifdef EPOLLONESHOT
     /* Kernel 2.6.2+ */
-    PyModule_AddIntConstant(m, "EPOLLONESHOT", EPOLLONESHOT);
+    PyModule_AddIntMacro(m, EPOLLONESHOT);
 #endif
     /* PyModule_AddIntConstant(m, "EPOLL_RDHUP", EPOLLRDHUP); */
-    PyModule_AddIntConstant(m, "EPOLLRDNORM", EPOLLRDNORM);
-    PyModule_AddIntConstant(m, "EPOLLRDBAND", EPOLLRDBAND);
-    PyModule_AddIntConstant(m, "EPOLLWRNORM", EPOLLWRNORM);
-    PyModule_AddIntConstant(m, "EPOLLWRBAND", EPOLLWRBAND);
-    PyModule_AddIntConstant(m, "EPOLLMSG", EPOLLMSG);
+    PyModule_AddIntMacro(m, EPOLLRDNORM);
+    PyModule_AddIntMacro(m, EPOLLRDBAND);
+    PyModule_AddIntMacro(m, EPOLLWRNORM);
+    PyModule_AddIntMacro(m, EPOLLWRBAND);
+    PyModule_AddIntMacro(m, EPOLLMSG);
 
 #ifdef EPOLL_CLOEXEC
-    PyModule_AddIntConstant(m, "EPOLL_CLOEXEC", EPOLL_CLOEXEC);
+    PyModule_AddIntMacro(m, EPOLL_CLOEXEC);
 #endif
 #endif /* HAVE_EPOLL */
 
diff --git a/Modules/sha1module.c b/Modules/sha1module.c
index d0f318d..b44fe18 100644
--- a/Modules/sha1module.c
+++ b/Modules/sha1module.c
@@ -92,10 +92,6 @@
      (y)[4] = (unsigned char)(((x)>>24)&255); (y)[5] = (unsigned char)(((x)>>16)&255);     \
      (y)[6] = (unsigned char)(((x)>>8)&255); (y)[7] = (unsigned char)((x)&255); }
 
-#ifndef MIN
-   #define MIN(x, y) ( ((x)<(y))?(x):(y) )
-#endif
-
 
 /* SHA1 macros */
 
@@ -220,9 +216,9 @@
            in             += SHA1_BLOCKSIZE;
            inlen          -= SHA1_BLOCKSIZE;
         } else {
-           n = MIN(inlen, (Py_ssize_t)(SHA1_BLOCKSIZE - sha1->curlen));
+           n = Py_MIN(inlen, (Py_ssize_t)(SHA1_BLOCKSIZE - sha1->curlen));
            memcpy(sha1->buf + sha1->curlen, in, (size_t)n);
-           sha1->curlen   += n;
+           sha1->curlen   += (SHA1_INT32)n;
            in             += n;
            inlen          -= n;
            if (sha1->curlen == SHA1_BLOCKSIZE) {
@@ -415,7 +411,7 @@
 static PyObject *
 SHA1_get_name(PyObject *self, void *closure)
 {
-    return PyUnicode_FromStringAndSize("SHA1", 4);
+    return PyUnicode_FromStringAndSize("sha1", 4);
 }
 
 static PyObject *
@@ -548,8 +544,17 @@
 PyMODINIT_FUNC
 PyInit__sha1(void)
 {
+    PyObject *m;
+
     Py_TYPE(&SHA1type) = &PyType_Type;
     if (PyType_Ready(&SHA1type) < 0)
         return NULL;
-    return PyModule_Create(&_sha1module);
+
+    m = PyModule_Create(&_sha1module);
+    if (m == NULL)
+        return NULL;
+
+    Py_INCREF((PyObject *)&SHA1type);
+    PyModule_AddObject(m, "SHA1Type", (PyObject *)&SHA1type);
+    return m;
 }
diff --git a/Modules/sha256module.c b/Modules/sha256module.c
index 9f6b416..b05bfc1 100644
--- a/Modules/sha256module.c
+++ b/Modules/sha256module.c
@@ -21,13 +21,6 @@
 #include "hashlib.h"
 
 
-/* Endianness testing and definitions */
-#define TestEndianness(variable) {int i=1; variable=PCT_BIG_ENDIAN;\
-        if (*((char*)&i)==1) variable=PCT_LITTLE_ENDIAN;}
-
-#define PCT_LITTLE_ENDIAN 1
-#define PCT_BIG_ENDIAN 0
-
 /* Some useful types */
 
 typedef unsigned char SHA_BYTE;
@@ -50,7 +43,6 @@
     SHA_INT32 digest[8];                /* Message digest */
     SHA_INT32 count_lo, count_hi;       /* 64-bit bit count */
     SHA_BYTE data[SHA_BLOCKSIZE];       /* SHA data buffer */
-    int Endianness;
     int local;                          /* unprocessed amount in data */
     int digestsize;
 } SHAobject;
@@ -58,13 +50,11 @@
 /* When run on a little-endian CPU we need to perform byte reversal on an
    array of longwords. */
 
-static void longReverse(SHA_INT32 *buffer, int byteCount, int Endianness)
+#if PY_LITTLE_ENDIAN
+static void longReverse(SHA_INT32 *buffer, int byteCount)
 {
     SHA_INT32 value;
 
-    if ( Endianness == PCT_BIG_ENDIAN )
-        return;
-
     byteCount /= sizeof(*buffer);
     while (byteCount--) {
         value = *buffer;
@@ -73,10 +63,10 @@
         *buffer++ = ( value << 16 ) | ( value >> 16 );
     }
 }
+#endif
 
 static void SHAcopy(SHAobject *src, SHAobject *dest)
 {
-    dest->Endianness = src->Endianness;
     dest->local = src->local;
     dest->digestsize = src->digestsize;
     dest->count_lo = src->count_lo;
@@ -131,7 +121,9 @@
         SHA_INT32 S[8], W[64], t0, t1;
 
     memcpy(W, sha_info->data, sizeof(sha_info->data));
-    longReverse(W, (int)sizeof(sha_info->data), sha_info->Endianness);
+#if PY_LITTLE_ENDIAN
+    longReverse(W, (int)sizeof(sha_info->data));
+#endif
 
     for (i = 16; i < 64; ++i) {
                 W[i] = Gamma1(W[i - 2]) + W[i - 7] + Gamma0(W[i - 15]) + W[i - 16];
@@ -228,7 +220,6 @@
 static void
 sha_init(SHAobject *sha_info)
 {
-    TestEndianness(sha_info->Endianness)
     sha_info->digest[0] = 0x6A09E667L;
     sha_info->digest[1] = 0xBB67AE85L;
     sha_info->digest[2] = 0x3C6EF372L;
@@ -246,7 +237,6 @@
 static void
 sha224_init(SHAobject *sha_info)
 {
-    TestEndianness(sha_info->Endianness)
     sha_info->digest[0] = 0xc1059ed8L;
     sha_info->digest[1] = 0x367cd507L;
     sha_info->digest[2] = 0x3070dd17L;
@@ -284,7 +274,7 @@
         memcpy(((SHA_BYTE *) sha_info->data) + sha_info->local, buffer, i);
         count -= i;
         buffer += i;
-        sha_info->local += i;
+        sha_info->local += (int)i;
         if (sha_info->local == SHA_BLOCKSIZE) {
             sha_transform(sha_info);
         }
@@ -299,7 +289,7 @@
         sha_transform(sha_info);
     }
     memcpy(sha_info->data, buffer, count);
-    sha_info->local = count;
+    sha_info->local = (int)count;
 }
 
 /* finish computing the SHA digest */
@@ -511,9 +501,9 @@
 SHA256_get_name(PyObject *self, void *closure)
 {
     if (((SHAobject *)self)->digestsize == 32)
-        return PyUnicode_FromStringAndSize("SHA256", 6);
+        return PyUnicode_FromStringAndSize("sha256", 6);
     else
-        return PyUnicode_FromStringAndSize("SHA224", 6);
+        return PyUnicode_FromStringAndSize("sha224", 6);
 }
 
 static PyGetSetDef SHA_getseters[] = {
@@ -716,11 +706,23 @@
 PyMODINIT_FUNC
 PyInit__sha256(void)
 {
+    PyObject *m;
+
     Py_TYPE(&SHA224type) = &PyType_Type;
     if (PyType_Ready(&SHA224type) < 0)
         return NULL;
     Py_TYPE(&SHA256type) = &PyType_Type;
     if (PyType_Ready(&SHA256type) < 0)
         return NULL;
-    return PyModule_Create(&_sha256module);
+
+    m = PyModule_Create(&_sha256module);
+    if (m == NULL)
+        return NULL;
+
+    Py_INCREF((PyObject *)&SHA224type);
+    PyModule_AddObject(m, "SHA224Type", (PyObject *)&SHA224type);
+    Py_INCREF((PyObject *)&SHA256type);
+    PyModule_AddObject(m, "SHA256Type", (PyObject *)&SHA256type);
+    return m;
+
 }
diff --git a/Modules/sha512module.c b/Modules/sha512module.c
index 5536fd5..47c57e5 100644
--- a/Modules/sha512module.c
+++ b/Modules/sha512module.c
@@ -22,13 +22,6 @@
 
 #ifdef PY_LONG_LONG /* If no PY_LONG_LONG, don't compile anything! */
 
-/* Endianness testing and definitions */
-#define TestEndianness(variable) {int i=1; variable=PCT_BIG_ENDIAN;\
-        if (*((char*)&i)==1) variable=PCT_LITTLE_ENDIAN;}
-
-#define PCT_LITTLE_ENDIAN 1
-#define PCT_BIG_ENDIAN 0
-
 /* Some useful types */
 
 typedef unsigned char SHA_BYTE;
@@ -52,7 +45,6 @@
     SHA_INT64 digest[8];                /* Message digest */
     SHA_INT32 count_lo, count_hi;       /* 64-bit bit count */
     SHA_BYTE data[SHA_BLOCKSIZE];       /* SHA data buffer */
-    int Endianness;
     int local;                          /* unprocessed amount in data */
     int digestsize;
 } SHAobject;
@@ -60,13 +52,11 @@
 /* When run on a little-endian CPU we need to perform byte reversal on an
    array of longwords. */
 
-static void longReverse(SHA_INT64 *buffer, int byteCount, int Endianness)
+#if PY_LITTLE_ENDIAN
+static void longReverse(SHA_INT64 *buffer, int byteCount)
 {
     SHA_INT64 value;
 
-    if ( Endianness == PCT_BIG_ENDIAN )
-        return;
-
     byteCount /= sizeof(*buffer);
     while (byteCount--) {
         value = *buffer;
@@ -83,10 +73,10 @@
                 buffer++;
     }
 }
+#endif
 
 static void SHAcopy(SHAobject *src, SHAobject *dest)
 {
-    dest->Endianness = src->Endianness;
     dest->local = src->local;
     dest->digestsize = src->digestsize;
     dest->count_lo = src->count_lo;
@@ -141,7 +131,9 @@
     SHA_INT64 S[8], W[80], t0, t1;
 
     memcpy(W, sha_info->data, sizeof(sha_info->data));
-    longReverse(W, (int)sizeof(sha_info->data), sha_info->Endianness);
+#if PY_LITTLE_ENDIAN
+    longReverse(W, (int)sizeof(sha_info->data));
+#endif
 
     for (i = 16; i < 80; ++i) {
                 W[i] = Gamma1(W[i - 2]) + W[i - 7] + Gamma0(W[i - 15]) + W[i - 16];
@@ -254,7 +246,6 @@
 static void
 sha512_init(SHAobject *sha_info)
 {
-    TestEndianness(sha_info->Endianness)
     sha_info->digest[0] = Py_ULL(0x6a09e667f3bcc908);
     sha_info->digest[1] = Py_ULL(0xbb67ae8584caa73b);
     sha_info->digest[2] = Py_ULL(0x3c6ef372fe94f82b);
@@ -272,7 +263,6 @@
 static void
 sha384_init(SHAobject *sha_info)
 {
-    TestEndianness(sha_info->Endianness)
     sha_info->digest[0] = Py_ULL(0xcbbb9d5dc1059ed8);
     sha_info->digest[1] = Py_ULL(0x629a292a367cd507);
     sha_info->digest[2] = Py_ULL(0x9159015a3070dd17);
@@ -310,7 +300,7 @@
         memcpy(((SHA_BYTE *) sha_info->data) + sha_info->local, buffer, i);
         count -= i;
         buffer += i;
-        sha_info->local += i;
+        sha_info->local += (int)i;
         if (sha_info->local == SHA_BLOCKSIZE) {
             sha512_transform(sha_info);
         }
@@ -325,7 +315,7 @@
         sha512_transform(sha_info);
     }
     memcpy(sha_info->data, buffer, count);
-    sha_info->local = count;
+    sha_info->local = (int)count;
 }
 
 /* finish computing the SHA digest */
@@ -577,9 +567,9 @@
 SHA512_get_name(PyObject *self, void *closure)
 {
     if (((SHAobject *)self)->digestsize == 64)
-        return PyUnicode_FromStringAndSize("SHA512", 6);
+        return PyUnicode_FromStringAndSize("sha512", 6);
     else
-        return PyUnicode_FromStringAndSize("SHA384", 6);
+        return PyUnicode_FromStringAndSize("sha384", 6);
 }
 
 static PyGetSetDef SHA_getseters[] = {
@@ -782,13 +772,24 @@
 PyMODINIT_FUNC
 PyInit__sha512(void)
 {
+    PyObject *m;
+
     Py_TYPE(&SHA384type) = &PyType_Type;
     if (PyType_Ready(&SHA384type) < 0)
         return NULL;
     Py_TYPE(&SHA512type) = &PyType_Type;
     if (PyType_Ready(&SHA512type) < 0)
         return NULL;
-    return PyModule_Create(&_sha512module);
+
+    m = PyModule_Create(&_sha512module);
+    if (m == NULL)
+        return NULL;
+
+    Py_INCREF((PyObject *)&SHA384type);
+    PyModule_AddObject(m, "SHA384Type", (PyObject *)&SHA384type);
+    Py_INCREF((PyObject *)&SHA512type);
+    PyModule_AddObject(m, "SHA512Type", (PyObject *)&SHA512type);
+    return m;
 }
 
 #endif
diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c
index 704c9f5..fedaddf 100644
--- a/Modules/signalmodule.c
+++ b/Modules/signalmodule.c
@@ -9,7 +9,7 @@
 #endif
 
 #ifdef MS_WINDOWS
-#include <Windows.h>
+#include <windows.h>
 #ifdef HAVE_PROCESS_H
 #include <process.h>
 #endif
@@ -37,11 +37,6 @@
 #define SIG_ERR ((PyOS_sighandler_t)(-1))
 #endif
 
-#if defined(PYOS_OS2) && !defined(PYCC_GCC)
-#define NSIG 12
-#include <process.h>
-#endif
-
 #ifndef NSIG
 # if defined(_NSIG)
 #  define NSIG _NSIG            /* For BSD/SysV */
@@ -78,10 +73,6 @@
    a working implementation that works in all three cases -- the
    handler ignores signals if getpid() isn't the same as in the main
    thread.  XXX This is a hack.
-
-   GNU pth is a user-space threading library, and as such, all threads
-   run within the same process. In this case, if the currently running
-   thread is not the main_thread, send the signal to the main_thread.
 */
 
 #ifdef WITH_THREAD
@@ -180,15 +171,31 @@
     return PyErr_CheckSignals();
 }
 
+static int
+report_wakeup_error(void *data)
+{
+    int save_errno = errno;
+    errno = (int) (Py_intptr_t) data;
+    PyErr_SetFromErrno(PyExc_OSError);
+    PySys_WriteStderr("Exception ignored when trying to write to the "
+                      "signal wakeup fd:\n");
+    PyErr_WriteUnraisable(NULL);
+    errno = save_errno;
+    return 0;
+}
+
 static void
 trip_signal(int sig_num)
 {
     unsigned char byte;
+    int rc = 0;
 
     Handlers[sig_num].tripped = 1;
     if (wakeup_fd != -1) {
         byte = (unsigned char)sig_num;
-        write(wakeup_fd, &byte, 1);
+        while ((rc = write(wakeup_fd, &byte, 1)) == -1 && errno == EINTR);
+        if (rc == -1)
+            Py_AddPendingCall(report_wakeup_error, (void *) (Py_intptr_t) errno);
     }
     if (is_tripped)
         return;
@@ -203,13 +210,6 @@
 {
     int save_errno = errno;
 
-#if defined(WITH_THREAD) && defined(WITH_PTH)
-    if (PyThread_get_thread_ident() != main_thread) {
-        pth_raise(*(pth_t *) main_thread, sig_num);
-    }
-    else
-#endif
-    {
 #ifdef WITH_THREAD
     /* See NOTES section above */
     if (getpid() == main_pid)
@@ -231,7 +231,6 @@
      * makes this true.  See also issue8354. */
     PyOS_setsig(sig_num, signal_handler);
 #endif
-    }
 
     /* Issue #10311: asynchronously executing signal handlers should not
        mutate errno under the feet of unsuspecting C code. */
@@ -800,7 +799,8 @@
                           &signals, &timeout))
         return NULL;
 
-    if (_PyTime_ObjectToTimespec(timeout, &tv_sec, &tv_nsec) == -1)
+    if (_PyTime_ObjectToTimespec(timeout, &tv_sec, &tv_nsec,
+                                 _PyTime_ROUND_DOWN) == -1)
         return NULL;
     buf.tv_sec = tv_sec;
     buf.tv_nsec = tv_nsec;
@@ -983,9 +983,10 @@
         return NULL;
 
 #if defined(HAVE_SIGWAITINFO) || defined(HAVE_SIGTIMEDWAIT)
-    if (!initialized)
-        PyStructSequence_InitType(&SiginfoType, &struct_siginfo_desc);
-
+    if (!initialized) {
+        if (PyStructSequence_InitType2(&SiginfoType, &struct_siginfo_desc) < 0)
+            return NULL;
+    }
     Py_INCREF((PyObject*) &SiginfoType);
     PyModule_AddObject(m, "struct_siginfo", (PyObject*) &SiginfoType);
     initialized = 1;
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index 32b4eba..cb44d05 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -15,7 +15,7 @@
 
 Module interface:
 
-- socket.error: exception raised for socket specific errors
+- socket.error: exception raised for socket specific errors, alias for OSError
 - socket.gaierror: exception raised for getaddrinfo/getnameinfo errors,
     a subclass of socket.error
 - socket.herror: exception raised for gethostby* errors,
@@ -33,8 +33,8 @@
 - socket.ntohl(32 bit value) --> new int object
 - socket.htons(16 bit value) --> new int object
 - socket.htonl(32 bit value) --> new int object
-- socket.getaddrinfo(host, port [, family, socktype, proto, flags])
-    --> List of (family, socktype, proto, canonname, sockaddr)
+- socket.getaddrinfo(host, port [, family, type, proto, flags])
+    --> List of (family, type, proto, canonname, sockaddr)
 - socket.getnameinfo(sockaddr, flags) --> (host, port)
 - socket.AF_INET, socket.SOCK_STREAM, etc.: constants from <socket.h>
 - socket.has_ipv6: boolean value indicating if IPv6 is supported
@@ -95,18 +95,16 @@
 #include "Python.h"
 #include "structmember.h"
 
-#undef MAX
-#define MAX(x, y) ((x) < (y) ? (y) : (x))
-
 /* Socket object documentation */
 PyDoc_STRVAR(sock_doc,
-"socket([family[, type[, proto]]]) -> socket object\n\
+"socket(family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None) -> socket object\n\
 \n\
 Open a socket of the given type.  The family argument specifies the\n\
 address family; it defaults to AF_INET.  The type argument specifies\n\
 whether this is a stream (SOCK_STREAM, this is the default)\n\
 or datagram (SOCK_DGRAM) socket.  The protocol argument defaults to 0,\n\
 specifying the default protocol.  Keyword arguments are accepted.\n\
+The socket is created as non-inheritable.\n\
 \n\
 A socket object represents one endpoint of a network connection.\n\
 \n\
@@ -117,7 +115,7 @@
 close() -- close the socket\n\
 connect(addr) -- connect the socket to a remote address\n\
 connect_ex(addr) -- connect, return an error code instead of an exception\n\
-_dup() -- return a new socket fd duplicated from fileno()\n\
+dup() -- return a new socket fd duplicated from fileno()\n\
 fileno() -- return underlying file descriptor\n\
 getpeername() -- return remote address [*]\n\
 getsockname() -- return local address\n\
@@ -190,7 +188,7 @@
 #if defined(WITH_THREAD) && (defined(__APPLE__) || \
     (defined(__FreeBSD__) && __FreeBSD_version+0 < 503000) || \
     defined(__OpenBSD__) || defined(__NetBSD__) || \
-    defined(__VMS) || !defined(HAVE_GETADDRINFO))
+    !defined(HAVE_GETADDRINFO))
 #define USE_GETADDRINFO_LOCK
 #endif
 
@@ -214,22 +212,11 @@
 # include <ctype.h>
 #endif
 
-#if defined(__VMS)
-#  include <ioctl.h>
-#endif
-
 #ifdef __APPLE__
 # include <sys/ioctl.h>
 #endif
 
 
-#if defined(PYOS_OS2)
-# define  INCL_DOS
-# define  INCL_DOSERRORS
-# define  INCL_NOPMAPI
-# include <os2.h>
-#endif
-
 #if defined(__sgi) && _COMPILER_VERSION>700 && !_SGIAPI
 /* make sure that the reentrant (gethostbyaddr_r etc)
    functions are declared correctly if compiling with
@@ -286,12 +273,7 @@
 # include <unistd.h>
 
 /* Headers needed for inet_ntoa() and inet_addr() */
-# if defined(PYOS_OS2) && defined(PYCC_VACPP)
-#  include <netdb.h>
-typedef size_t socklen_t;
-# else
 #   include <arpa/inet.h>
-# endif
 
 #  include <fcntl.h>
 
@@ -371,22 +353,7 @@
 #endif
 
 #ifdef MS_WINDOWS
-/* On Windows a socket is really a handle not an fd */
-static SOCKET
-dup_socket(SOCKET handle)
-{
-    WSAPROTOCOL_INFO info;
-
-    if (WSADuplicateSocket(handle, GetCurrentProcessId(), &info))
-        return INVALID_SOCKET;
-
-    return WSASocket(FROM_PROTOCOL_INFO, FROM_PROTOCOL_INFO,
-                     FROM_PROTOCOL_INFO, &info, 0, WSA_FLAG_OVERLAPPED);
-}
 #define SOCKETCLOSE closesocket
-#else
-/* On Unix we can use dup to duplicate the file descriptor of a socket*/
-#define dup_socket(fd) dup(fd)
 #endif
 
 #ifdef MS_WIN32
@@ -395,11 +362,6 @@
 #define snprintf _snprintf
 #endif
 
-#if defined(PYOS_OS2) && !defined(PYCC_GCC)
-#define SOCKETCLOSE soclose
-#define NO_DUP /* Sockets are Not Actual File Handles under OS/2 */
-#endif
-
 #ifndef SOCKETCLOSE
 #define SOCKETCLOSE close
 #endif
@@ -437,11 +399,6 @@
 #endif
 #endif
 
-#ifdef __VMS
-/* TCP/IP Services for VMS uses a maximum send/recv buffer length */
-#define SEGMENT_SIZE (32 * 1024 -1)
-#endif
-
 /* Convert "sock_addr_t *" to "struct sockaddr *". */
 #define SAS2SA(x)       (&((x)->sa))
 
@@ -459,6 +416,10 @@
 #define INVALID_SOCKET (-1)
 #endif
 
+#ifndef INADDR_NONE
+#define INADDR_NONE (-1)
+#endif
+
 /* XXX There's a problem here: *static* functions are not supposed to have
    a Py prefix (or use CapitalizedWords).  Later... */
 
@@ -519,6 +480,11 @@
     (errno == expected)
 #endif
 
+#ifdef MS_WINDOWS
+/* Does WSASocket() support the WSA_FLAG_NO_HANDLE_INHERIT flag? */
+static int support_wsa_no_inherit = -1;
+#endif
+
 /* Convenience function to raise an error according to errno
    and return a NULL pointer from a function. */
 
@@ -534,42 +500,6 @@
         return PyErr_SetExcFromWindowsErr(PyExc_OSError, err_no);
 #endif
 
-#if defined(PYOS_OS2) && !defined(PYCC_GCC)
-    if (sock_errno() != NO_ERROR) {
-        APIRET rc;
-        ULONG  msglen;
-        char outbuf[100];
-        int myerrorcode = sock_errno();
-
-        /* Retrieve socket-related error message from MPTN.MSG file */
-        rc = DosGetMessage(NULL, 0, outbuf, sizeof(outbuf),
-                           myerrorcode - SOCBASEERR + 26,
-                           "mptn.msg",
-                           &msglen);
-        if (rc == NO_ERROR) {
-            PyObject *v;
-
-            /* OS/2 doesn't guarantee a terminator */
-            outbuf[msglen] = '\0';
-            if (strlen(outbuf) > 0) {
-                /* If non-empty msg, trim CRLF */
-                char *lastc = &outbuf[ strlen(outbuf)-1 ];
-                while (lastc > outbuf &&
-                       Py_ISSPACE(Py_CHARMASK(*lastc))) {
-                    /* Trim trailing whitespace (CRLF) */
-                    *lastc-- = '\0';
-                }
-            }
-            v = Py_BuildValue("(is)", myerrorcode, outbuf);
-            if (v != NULL) {
-                PyErr_SetObject(PyExc_OSError, v);
-                Py_DECREF(v);
-            }
-            return NULL;
-        }
-    }
-#endif
-
     return PyErr_SetFromErrno(PyExc_OSError);
 }
 
@@ -617,37 +547,14 @@
     return NULL;
 }
 
-#ifdef __VMS
-/* Function to send in segments */
-static int
-sendsegmented(int sock_fd, char *buf, int len, int flags)
-{
-    int n = 0;
-    int remaining = len;
-
-    while (remaining > 0) {
-        unsigned int segment;
-
-        segment = (remaining >= SEGMENT_SIZE ? SEGMENT_SIZE : remaining);
-        n = send(sock_fd, buf, segment, flags);
-        if (n < 0) {
-            return n;
-        }
-        remaining -= segment;
-        buf += segment;
-    } /* end while */
-
-    return len;
-}
-#endif
-
 /* Function to perform the setting of socket blocking mode
    internally. block = (1 | 0). */
 static int
 internal_setblocking(PySocketSockObject *s, int block)
 {
-#ifndef MS_WINDOWS
-    int delay_flag;
+#if !defined(MS_WINDOWS) \
+    && !((defined(HAVE_SYS_IOCTL_H) && defined(FIONBIO)))
+    int delay_flag, new_delay_flag;
 #endif
 #ifdef SOCK_NONBLOCK
     if (block)
@@ -658,20 +565,18 @@
 
     Py_BEGIN_ALLOW_THREADS
 #ifndef MS_WINDOWS
-#if defined(PYOS_OS2) && !defined(PYCC_GCC)
-    block = !block;
-    ioctl(s->sock_fd, FIONBIO, (caddr_t)&block, sizeof(block));
-#elif defined(__VMS)
+#if (defined(HAVE_SYS_IOCTL_H) && defined(FIONBIO))
     block = !block;
     ioctl(s->sock_fd, FIONBIO, (unsigned int *)&block);
-#else  /* !PYOS_OS2 && !__VMS */
+#else
     delay_flag = fcntl(s->sock_fd, F_GETFL, 0);
     if (block)
-        delay_flag &= (~O_NONBLOCK);
+        new_delay_flag = delay_flag & (~O_NONBLOCK);
     else
-        delay_flag |= O_NONBLOCK;
-    fcntl(s->sock_fd, F_SETFL, delay_flag);
-#endif /* !PYOS_OS2 */
+        new_delay_flag = delay_flag | O_NONBLOCK;
+    if (new_delay_flag != delay_flag)
+        fcntl(s->sock_fd, F_SETFL, new_delay_flag);
+#endif
 #else /* MS_WINDOWS */
     block = !block;
     ioctlsocket(s->sock_fd, FIONBIO, (u_long*)&block);
@@ -855,8 +760,6 @@
 {
     struct addrinfo hints, *res;
     int error;
-    int d1, d2, d3, d4;
-    char ch;
 
     memset((void *) addr_ret, '\0', sizeof(*addr_ret));
     if (name[0] == '\0') {
@@ -905,7 +808,10 @@
         freeaddrinfo(res);
         return siz;
     }
-    if (name[0] == '<' && strcmp(name, "<broadcast>") == 0) {
+    /* special-case broadcast - inet_addr() below can return INADDR_NONE for
+     * this */
+    if (strcmp(name, "255.255.255.255") == 0 ||
+        strcmp(name, "<broadcast>") == 0) {
         struct sockaddr_in *sin;
         if (af != AF_INET && af != AF_UNSPEC) {
             PyErr_SetString(PyExc_OSError,
@@ -921,20 +827,53 @@
         sin->sin_addr.s_addr = INADDR_BROADCAST;
         return sizeof(sin->sin_addr);
     }
-    if (sscanf(name, "%d.%d.%d.%d%c", &d1, &d2, &d3, &d4, &ch) == 4 &&
-        0 <= d1 && d1 <= 255 && 0 <= d2 && d2 <= 255 &&
-        0 <= d3 && d3 <= 255 && 0 <= d4 && d4 <= 255) {
-        struct sockaddr_in *sin;
-        sin = (struct sockaddr_in *)addr_ret;
-        sin->sin_addr.s_addr = htonl(
-            ((long) d1 << 24) | ((long) d2 << 16) |
-            ((long) d3 << 8) | ((long) d4 << 0));
-        sin->sin_family = AF_INET;
+
+    /* avoid a name resolution in case of numeric address */
+#ifdef HAVE_INET_PTON
+    /* check for an IPv4 address */
+    if (af == AF_UNSPEC || af == AF_INET) {
+        struct sockaddr_in *sin = (struct sockaddr_in *)addr_ret;
+        memset(sin, 0, sizeof(*sin));
+        if (inet_pton(AF_INET, name, &sin->sin_addr) > 0) {
+            sin->sin_family = AF_INET;
 #ifdef HAVE_SOCKADDR_SA_LEN
-        sin->sin_len = sizeof(*sin);
+            sin->sin_len = sizeof(*sin);
 #endif
-        return 4;
+            return 4;
+        }
     }
+#ifdef ENABLE_IPV6
+    /* check for an IPv6 address - if the address contains a scope ID, we
+     * fallback to getaddrinfo(), which can handle translation from interface
+     * name to interface index */
+    if ((af == AF_UNSPEC || af == AF_INET6) && !strchr(name, '%')) {
+        struct sockaddr_in6 *sin = (struct sockaddr_in6 *)addr_ret;
+        memset(sin, 0, sizeof(*sin));
+        if (inet_pton(AF_INET6, name, &sin->sin6_addr) > 0) {
+            sin->sin6_family = AF_INET6;
+#ifdef HAVE_SOCKADDR_SA_LEN
+            sin->sin6_len = sizeof(*sin);
+#endif
+            return 16;
+        }
+    }
+#endif /* ENABLE_IPV6 */
+#else /* HAVE_INET_PTON */
+    /* check for an IPv4 address */
+    if (af == AF_INET || af == AF_UNSPEC) {
+        struct sockaddr_in *sin = (struct sockaddr_in *)addr_ret;
+        memset(sin, 0, sizeof(*sin));
+        if ((sin->sin_addr.s_addr = inet_addr(name)) != INADDR_NONE) {
+            sin->sin_family = AF_INET;
+#ifdef HAVE_SOCKADDR_SA_LEN
+            sin->sin_len = sizeof(*sin);
+#endif
+            return 4;
+        }
+    }
+#endif /* HAVE_INET_PTON */
+
+    /* perform a name resolution */
     memset(&hints, 0, sizeof(hints));
     hints.ai_family = af;
     Py_BEGIN_ALLOW_THREADS
@@ -1226,7 +1165,7 @@
     }
 #endif
 
-#ifdef HAVE_LINUX_CAN_H
+#ifdef AF_CAN
     case AF_CAN:
     {
         struct sockaddr_can *a = (struct sockaddr_can *)addr;
@@ -1329,11 +1268,7 @@
         }
         addr->sun_family = s->sock_family;
         memcpy(addr->sun_path, path, len);
-#if defined(PYOS_OS2)
-        *len_ret = sizeof(*addr);
-#else
         *len_ret = len + offsetof(struct sockaddr_un, sun_path);
-#endif
         retval = 1;
     unix_out:
         Py_DECREF(args);
@@ -1654,10 +1589,12 @@
     }
 #endif
 
-#ifdef HAVE_LINUX_CAN_H
+#if defined(AF_CAN) && defined(CAN_RAW) && defined(CAN_BCM)
     case AF_CAN:
         switch (s->sock_proto) {
         case CAN_RAW:
+        /* fall-through */
+        case CAN_BCM:
         {
             struct sockaddr_can *addr;
             PyObject *interfaceName;
@@ -1859,7 +1796,7 @@
     }
 #endif
 
-#ifdef HAVE_LINUX_CAN_H
+#ifdef AF_CAN
     case AF_CAN:
     {
         *len_ret = sizeof (struct sockaddr_can);
@@ -1948,8 +1885,22 @@
                                         sizeof(cmsgh->cmsg_len));
 
     /* Note that POSIX allows msg_controllen to be of signed type. */
-    if (cmsgh == NULL || msg->msg_control == NULL || msg->msg_controllen < 0)
+    if (cmsgh == NULL || msg->msg_control == NULL)
         return 0;
+    /* Note that POSIX allows msg_controllen to be of a signed type. This is
+       annoying under OS X as it's unsigned there and so it triggers a
+       tautological comparison warning under Clang when compared against 0.
+       Since the check is valid on other platforms, silence the warning under
+       Clang. */
+    #ifdef __clang__
+    #pragma clang diagnostic push
+    #pragma clang diagnostic ignored "-Wtautological-compare"
+    #endif
+    if (msg->msg_controllen < 0)
+        return 0;
+    #ifdef __clang__
+    #pragma clang diagnostic pop
+    #endif
     if (space < cmsg_len_end)
         space = cmsg_len_end;
     cmsg_offset = (char *)cmsgh - (char *)msg->msg_control;
@@ -2016,6 +1967,11 @@
     PyObject *addr = NULL;
     PyObject *res = NULL;
     int timeout;
+#if defined(HAVE_ACCEPT4) && defined(SOCK_CLOEXEC)
+    /* accept4() is available on Linux 2.6.28+ and glibc 2.10 */
+    static int accept4_works = -1;
+#endif
+
     if (!getsockaddrlen(s, &addrlen))
         return NULL;
     memset(&addrbuf, 0, addrlen);
@@ -2024,10 +1980,24 @@
         return select_error();
 
     BEGIN_SELECT_LOOP(s)
+
     Py_BEGIN_ALLOW_THREADS
     timeout = internal_select_ex(s, 0, interval);
     if (!timeout) {
+#if defined(HAVE_ACCEPT4) && defined(SOCK_CLOEXEC)
+        if (accept4_works != 0) {
+            newfd = accept4(s->sock_fd, SAS2SA(&addrbuf), &addrlen,
+                            SOCK_CLOEXEC);
+            if (newfd == INVALID_SOCKET && accept4_works == -1) {
+                /* On Linux older than 2.6.28, accept4() fails with ENOSYS */
+                accept4_works = (errno != ENOSYS);
+            }
+        }
+        if (accept4_works == 0)
+            newfd = accept(s->sock_fd, SAS2SA(&addrbuf), &addrlen);
+#else
         newfd = accept(s->sock_fd, SAS2SA(&addrbuf), &addrlen);
+#endif
     }
     Py_END_ALLOW_THREADS
 
@@ -2040,6 +2010,25 @@
     if (newfd == INVALID_SOCKET)
         return s->errorhandler();
 
+#ifdef MS_WINDOWS
+    if (!SetHandleInformation((HANDLE)newfd, HANDLE_FLAG_INHERIT, 0)) {
+        PyErr_SetFromWindowsErr(0);
+        SOCKETCLOSE(newfd);
+        goto finally;
+    }
+#else
+
+#if defined(HAVE_ACCEPT4) && defined(SOCK_CLOEXEC)
+    if (!accept4_works)
+#endif
+    {
+        if (_Py_set_inheritable(newfd, 0, NULL) < 0) {
+            SOCKETCLOSE(newfd);
+            goto finally;
+        }
+    }
+#endif
+
     sock = PyLong_FromSocket_t(newfd);
     if (sock == NULL) {
         SOCKETCLOSE(newfd);
@@ -2219,13 +2208,7 @@
             return s->errorhandler();
         return PyLong_FromLong(flag);
     }
-#ifdef __VMS
-    /* socklen_t is unsigned so no negative test is needed,
-       test buflen == 0 is previously done */
-    if (buflen > 1024) {
-#else
     if (buflen <= 0 || buflen > 1024) {
-#endif
         PyErr_SetString(PyExc_OSError,
                         "getsockopt buflen out of range");
         return NULL;
@@ -2314,8 +2297,8 @@
 PyDoc_STRVAR(detach_doc,
 "detach()\n\
 \n\
-Close the socket object without closing the underlying file descriptor.\
-The object cannot be used after this call, but the file descriptor\
+Close the socket object without closing the underlying file descriptor.\n\
+The object cannot be used after this call, but the file descriptor\n\
 can be reused for other purposes.  The file descriptor is returned.");
 
 static int
@@ -2595,10 +2578,6 @@
 {
     Py_ssize_t outlen = -1;
     int timeout;
-#ifdef __VMS
-    int remaining;
-    char *read_buf;
-#endif
 
     if (!IS_SELECTABLE(s)) {
         select_error();
@@ -2609,12 +2588,18 @@
         return 0;
     }
 
-#ifndef __VMS
     BEGIN_SELECT_LOOP(s)
     Py_BEGIN_ALLOW_THREADS
     timeout = internal_select_ex(s, 0, interval);
-    if (!timeout)
+    if (!timeout) {
+#ifdef MS_WINDOWS
+        if (len > INT_MAX)
+            len = INT_MAX;
+        outlen = recv(s->sock_fd, cbuf, (int)len, flags);
+#else
         outlen = recv(s->sock_fd, cbuf, len, flags);
+#endif
+    }
     Py_END_ALLOW_THREADS
 
     if (timeout == 1) {
@@ -2628,48 +2613,6 @@
         s->errorhandler();
         return -1;
     }
-#else
-    read_buf = cbuf;
-    remaining = len;
-    while (remaining != 0) {
-        unsigned int segment;
-        int nread = -1;
-
-        segment = remaining /SEGMENT_SIZE;
-        if (segment != 0) {
-            segment = SEGMENT_SIZE;
-        }
-        else {
-            segment = remaining;
-        }
-
-        BEGIN_SELECT_LOOP(s)
-        Py_BEGIN_ALLOW_THREADS
-        timeout = internal_select_ex(s, 0, interval);
-        if (!timeout)
-            nread = recv(s->sock_fd, read_buf, segment, flags);
-        Py_END_ALLOW_THREADS
-        if (timeout == 1) {
-            PyErr_SetString(socket_timeout, "timed out");
-            return -1;
-        }
-        END_SELECT_LOOP(s)
-
-        if (nread < 0) {
-            s->errorhandler();
-            return -1;
-        }
-        if (nread != remaining) {
-            read_buf += nread;
-            break;
-        }
-
-        remaining -= segment;
-        read_buf += segment;
-    }
-    outlen = read_buf - cbuf;
-#endif /* !__VMS */
-
     return outlen;
 }
 
@@ -2820,14 +2763,11 @@
     memset(&addrbuf, 0, addrlen);
     timeout = internal_select_ex(s, 0, interval);
     if (!timeout) {
-#ifndef MS_WINDOWS
-#if defined(PYOS_OS2) && !defined(PYCC_GCC)
-        n = recvfrom(s->sock_fd, cbuf, len, flags,
-                     SAS2SA(&addrbuf), &addrlen);
-#else
-        n = recvfrom(s->sock_fd, cbuf, len, flags,
+#ifdef MS_WINDOWS
+        if (len > INT_MAX)
+            len = INT_MAX;
+        n = recvfrom(s->sock_fd, cbuf, (int)len, flags,
                      (void *) &addrbuf, &addrlen);
-#endif
 #else
         n = recvfrom(s->sock_fd, cbuf, len, flags,
                      SAS2SA(&addrbuf), &addrlen);
@@ -3309,12 +3249,15 @@
     BEGIN_SELECT_LOOP(s)
     Py_BEGIN_ALLOW_THREADS
     timeout = internal_select_ex(s, 1, interval);
-    if (!timeout)
-#ifdef __VMS
-        n = sendsegmented(s->sock_fd, buf, len, flags);
+    if (!timeout) {
+#ifdef MS_WINDOWS
+        if (len > INT_MAX)
+            len = INT_MAX;
+        n = send(s->sock_fd, buf, (int)len, flags);
 #else
         n = send(s->sock_fd, buf, len, flags);
 #endif
+    }
     Py_END_ALLOW_THREADS
     if (timeout == 1) {
         PyBuffer_Release(&pbuf);
@@ -3362,8 +3305,10 @@
         timeout = internal_select(s, 1);
         n = -1;
         if (!timeout) {
-#ifdef __VMS
-            n = sendsegmented(s->sock_fd, buf, len, flags);
+#ifdef MS_WINDOWS
+            if (len > INT_MAX)
+                len = INT_MAX;
+            n = send(s->sock_fd, buf, (int)len, flags);
 #else
             n = send(s->sock_fd, buf, len, flags);
 #endif
@@ -3458,8 +3403,17 @@
     BEGIN_SELECT_LOOP(s)
     Py_BEGIN_ALLOW_THREADS
     timeout = internal_select_ex(s, 1, interval);
-    if (!timeout)
-        n = sendto(s->sock_fd, buf, len, flags, SAS2SA(&addrbuf), addrlen);
+    if (!timeout) {
+#ifdef MS_WINDOWS
+        if (len > INT_MAX)
+            len = INT_MAX;
+        n = sendto(s->sock_fd, buf, (int)len, flags,
+                   SAS2SA(&addrbuf), addrlen);
+#else
+        n = sendto(s->sock_fd, buf, len, flags,
+                   SAS2SA(&addrbuf), addrlen);
+#endif
+    }
     Py_END_ALLOW_THREADS
 
     if (timeout == 1) {
@@ -3539,7 +3493,7 @@
     for (; ndatabufs < ndataparts; ndatabufs++) {
         if (!PyArg_Parse(PySequence_Fast_GET_ITEM(data_fast, ndatabufs),
                          "y*;sendmsg() argument 1 must be an iterable of "
-                         "buffer-compatible objects",
+                         "bytes-like objects",
                          &databufs[ndatabufs]))
             goto finally;
         iovs[ndatabufs].iov_base = databufs[ndatabufs].buf;
@@ -3696,12 +3650,12 @@
 Send normal and ancillary data to the socket, gathering the\n\
 non-ancillary data from a series of buffers and concatenating it into\n\
 a single message.  The buffers argument specifies the non-ancillary\n\
-data as an iterable of buffer-compatible objects (e.g. bytes objects).\n\
+data as an iterable of bytes-like objects (e.g. bytes objects).\n\
 The ancdata argument specifies the ancillary data (control messages)\n\
 as an iterable of zero or more tuples (cmsg_level, cmsg_type,\n\
 cmsg_data), where cmsg_level and cmsg_type are integers specifying the\n\
 protocol level and protocol-specific type respectively, and cmsg_data\n\
-is a buffer-compatible object holding the associated data.  The flags\n\
+is a bytes-like object holding the associated data.  The flags\n\
 argument defaults to 0 and has the same meaning as for send().  If\n\
 address is supplied and not None, it sets a destination address for\n\
 the message.  The return value is the number of bytes of non-ancillary\n\
@@ -3914,8 +3868,13 @@
 static PyObject *
 sock_repr(PySocketSockObject *s)
 {
+    long sock_fd;
+    /* On Windows, this test is needed because SOCKET_T is unsigned */
+    if (s->sock_fd == INVALID_SOCKET) {
+        sock_fd = -1;
+    }
 #if SIZEOF_SOCKET_T > SIZEOF_LONG
-    if (s->sock_fd > LONG_MAX) {
+    else if (s->sock_fd > LONG_MAX) {
         /* this can occur on Win64, and actually there is a special
            ugly printf formatter for decimal pointer length integer
            printing, only bother if necessary*/
@@ -3925,9 +3884,11 @@
         return NULL;
     }
 #endif
+    else
+        sock_fd = (long)s->sock_fd;
     return PyUnicode_FromFormat(
         "<socket object, fd=%ld, family=%d, type=%d, proto=%d>",
-        (long)s->sock_fd, s->sock_family,
+        sock_fd, s->sock_family,
         s->sock_type,
         s->sock_proto);
 }
@@ -3952,6 +3913,12 @@
 
 /* Initialize a new socket object. */
 
+#ifdef SOCK_CLOEXEC
+/* socket() and socketpair() fail with EINVAL on Linux kernel older
+ * than 2.6.27 if SOCK_CLOEXEC flag is set in the socket type. */
+static int sock_cloexec_works = -1;
+#endif
+
 /*ARGSUSED*/
 static int
 sock_initobj(PyObject *self, PyObject *args, PyObject *kwds)
@@ -3961,6 +3928,13 @@
     SOCKET_T fd = INVALID_SOCKET;
     int family = AF_INET, type = SOCK_STREAM, proto = 0;
     static char *keywords[] = {"family", "type", "proto", "fileno", 0};
+#ifndef MS_WINDOWS
+#ifdef SOCK_CLOEXEC
+    int *atomic_flag_works = &sock_cloexec_works;
+#else
+    int *atomic_flag_works = NULL;
+#endif
+#endif
 
     if (!PyArg_ParseTupleAndKeywords(args, kwds,
                                      "|iiiO:socket", keywords,
@@ -4005,14 +3979,74 @@
         }
     }
     else {
+#ifdef MS_WINDOWS
+        /* Windows implementation */
+#ifndef WSA_FLAG_NO_HANDLE_INHERIT
+#define WSA_FLAG_NO_HANDLE_INHERIT 0x80
+#endif
+
         Py_BEGIN_ALLOW_THREADS
-        fd = socket(family, type, proto);
+        if (support_wsa_no_inherit) {
+            fd = WSASocket(family, type, proto,
+                           NULL, 0,
+                           WSA_FLAG_OVERLAPPED | WSA_FLAG_NO_HANDLE_INHERIT);
+            if (fd == INVALID_SOCKET) {
+                /* Windows 7 or Windows 2008 R2 without SP1 or the hotfix */
+                support_wsa_no_inherit = 0;
+                fd = socket(family, type, proto);
+            }
+        }
+        else {
+            fd = socket(family, type, proto);
+        }
         Py_END_ALLOW_THREADS
 
         if (fd == INVALID_SOCKET) {
             set_error();
             return -1;
         }
+
+        if (!support_wsa_no_inherit) {
+            if (!SetHandleInformation((HANDLE)fd, HANDLE_FLAG_INHERIT, 0)) {
+                closesocket(fd);
+                PyErr_SetFromWindowsErr(0);
+                return -1;
+            }
+        }
+#else
+        /* UNIX */
+        Py_BEGIN_ALLOW_THREADS
+#ifdef SOCK_CLOEXEC
+        if (sock_cloexec_works != 0) {
+            fd = socket(family, type | SOCK_CLOEXEC, proto);
+            if (sock_cloexec_works == -1) {
+                if (fd >= 0) {
+                    sock_cloexec_works = 1;
+                }
+                else if (errno == EINVAL) {
+                    /* Linux older than 2.6.27 does not support SOCK_CLOEXEC */
+                    sock_cloexec_works = 0;
+                    fd = socket(family, type, proto);
+                }
+            }
+        }
+        else
+#endif
+        {
+            fd = socket(family, type, proto);
+        }
+        Py_END_ALLOW_THREADS
+
+        if (fd == INVALID_SOCKET) {
+            set_error();
+            return -1;
+        }
+
+        if (_Py_set_inheritable(fd, 0, atomic_flag_works) < 0) {
+            SOCKETCLOSE(fd);
+            return -1;
+        }
+#endif
     }
     init_sockobject(s, fd, family, type, proto);
 
@@ -4578,16 +4612,36 @@
 {
     SOCKET_T fd, newfd;
     PyObject *newfdobj;
-
+#ifdef MS_WINDOWS
+    WSAPROTOCOL_INFO info;
+#endif
 
     fd = PyLong_AsSocket_t(fdobj);
     if (fd == (SOCKET_T)(-1) && PyErr_Occurred())
         return NULL;
 
-    newfd = dup_socket(fd);
+#ifdef MS_WINDOWS
+    if (WSADuplicateSocket(fd, GetCurrentProcessId(), &info))
+        return set_error();
+
+    newfd = WSASocket(FROM_PROTOCOL_INFO, FROM_PROTOCOL_INFO,
+                      FROM_PROTOCOL_INFO,
+                      &info, 0, WSA_FLAG_OVERLAPPED);
     if (newfd == INVALID_SOCKET)
         return set_error();
 
+    if (!SetHandleInformation((HANDLE)newfd, HANDLE_FLAG_INHERIT, 0)) {
+        closesocket(newfd);
+        PyErr_SetFromWindowsErr(0);
+        return NULL;
+    }
+#else
+    /* On UNIX, dup can be used to duplicate the file descriptor of a socket */
+    newfd = _Py_dup(fd);
+    if (newfd == INVALID_SOCKET)
+        return NULL;
+#endif
+
     newfdobj = PyLong_FromSocket_t(newfd);
     if (newfdobj == NULL)
         SOCKETCLOSE(newfd);
@@ -4615,6 +4669,12 @@
     SOCKET_T sv[2];
     int family, type = SOCK_STREAM, proto = 0;
     PyObject *res = NULL;
+#ifdef SOCK_CLOEXEC
+    int *atomic_flag_works = &sock_cloexec_works;
+#else
+    int *atomic_flag_works = NULL;
+#endif
+    int ret;
 
 #if defined(AF_UNIX)
     family = AF_UNIX;
@@ -4624,9 +4684,38 @@
     if (!PyArg_ParseTuple(args, "|iii:socketpair",
                           &family, &type, &proto))
         return NULL;
+
     /* Create a pair of socket fds */
-    if (socketpair(family, type, proto, sv) < 0)
+    Py_BEGIN_ALLOW_THREADS
+#ifdef SOCK_CLOEXEC
+    if (sock_cloexec_works != 0) {
+        ret = socketpair(family, type | SOCK_CLOEXEC, proto, sv);
+        if (sock_cloexec_works == -1) {
+            if (ret >= 0) {
+                sock_cloexec_works = 1;
+            }
+            else if (errno == EINVAL) {
+                /* Linux older than 2.6.27 does not support SOCK_CLOEXEC */
+                sock_cloexec_works = 0;
+                ret = socketpair(family, type, proto, sv);
+            }
+        }
+    }
+    else
+#endif
+    {
+        ret = socketpair(family, type, proto, sv);
+    }
+    Py_END_ALLOW_THREADS
+
+    if (ret < 0)
         return set_error();
+
+    if (_Py_set_inheritable(sv[0], 0, atomic_flag_works) < 0)
+        goto finally;
+    if (_Py_set_inheritable(sv[1], 0, atomic_flag_works) < 0)
+        goto finally;
+
     s0 = new_sockobject(sv[0], family, type, proto);
     if (s0 == NULL)
         goto finally;
@@ -4648,7 +4737,7 @@
 }
 
 PyDoc_STRVAR(socketpair_doc,
-"socketpair([family[, type[, proto]]]) -> (socket object, socket object)\n\
+"socketpair([family[, type [, proto]]]) -> (socket object, socket object)\n\
 \n\
 Create a pair of socket objects from the sockets returned by the platform\n\
 socketpair() function.\n\
@@ -4782,9 +4871,6 @@
 static PyObject*
 socket_inet_aton(PyObject *self, PyObject *args)
 {
-#ifndef INADDR_NONE
-#define INADDR_NONE (-1)
-#endif
 #ifdef HAVE_INET_ATON
     struct in_addr buf;
 #endif
@@ -4826,7 +4912,7 @@
     /* special-case this address as inet_addr might return INADDR_NONE
      * for this */
     if (strcmp(ip_addr, "255.255.255.255") == 0) {
-        packed_addr = 0xFFFFFFFF;
+        packed_addr = INADDR_BROADCAST;
     } else {
 
         packed_addr = inet_addr(ip_addr);
@@ -4874,7 +4960,7 @@
     return PyUnicode_FromString(inet_ntoa(packed_addr));
 }
 
-#ifdef HAVE_INET_PTON
+#if defined(HAVE_INET_PTON) || defined(MS_WINDOWS)
 
 PyDoc_STRVAR(inet_pton_doc,
 "inet_pton(af, ip) -> packed IP address string\n\
@@ -4882,6 +4968,10 @@
 Convert an IP address from string format to a packed string suitable\n\
 for use with low-level network functions.");
 
+#endif
+
+#ifdef HAVE_INET_PTON
+
 static PyObject *
 socket_inet_pton(PyObject *self, PyObject *args)
 {
@@ -4889,7 +4979,7 @@
     char* ip;
     int retval;
 #ifdef ENABLE_IPV6
-    char packed[MAX(sizeof(struct in_addr), sizeof(struct in6_addr))];
+    char packed[Py_MAX(sizeof(struct in_addr), sizeof(struct in6_addr))];
 #else
     char packed[sizeof(struct in_addr)];
 #endif
@@ -4926,12 +5016,52 @@
         return NULL;
     }
 }
+#elif defined(MS_WINDOWS)
+
+static PyObject *
+socket_inet_pton(PyObject *self, PyObject *args)
+{
+    int af;
+    char* ip;
+    struct sockaddr_in6 addr;
+    INT ret, size;
+
+    if (!PyArg_ParseTuple(args, "is:inet_pton", &af, &ip)) {
+        return NULL;
+    }
+
+    size = sizeof(addr);
+    ret = WSAStringToAddressA(ip, af, NULL, (LPSOCKADDR)&addr, &size);
+
+    if (ret) {
+        PyErr_SetExcFromWindowsErr(PyExc_OSError, WSAGetLastError());
+        return NULL;
+    } else if(af == AF_INET) {
+        struct sockaddr_in *addr4 = (struct sockaddr_in*)&addr;
+        return PyBytes_FromStringAndSize((const char *)&(addr4->sin_addr),
+                                         sizeof(addr4->sin_addr));
+    } else if (af == AF_INET6) {
+        return PyBytes_FromStringAndSize((const char *)&(addr.sin6_addr),
+                                          sizeof(addr.sin6_addr));
+    } else {
+        PyErr_SetString(PyExc_OSError, "unknown address family");
+        return NULL;
+    }
+}
+
+#endif
+
+#if defined(HAVE_INET_PTON) || defined(MS_WINDOWS)
 
 PyDoc_STRVAR(inet_ntop_doc,
 "inet_ntop(af, packed_ip) -> string formatted IP address\n\
 \n\
 Convert a packed IP address of the given family to string format.");
 
+#endif
+
+
+#ifdef HAVE_INET_PTON
 static PyObject *
 socket_inet_ntop(PyObject *self, PyObject *args)
 {
@@ -4940,7 +5070,7 @@
     int len;
     const char* retval;
 #ifdef ENABLE_IPV6
-    char ip[MAX(INET_ADDRSTRLEN, INET6_ADDRSTRLEN) + 1];
+    char ip[Py_MAX(INET_ADDRSTRLEN, INET6_ADDRSTRLEN) + 1];
 #else
     char ip[INET_ADDRSTRLEN + 1];
 #endif
@@ -4985,6 +5115,70 @@
     return NULL;
 }
 
+#elif defined(MS_WINDOWS)
+
+static PyObject *
+socket_inet_ntop(PyObject *self, PyObject *args)
+{
+    int af;
+    char* packed;
+    int len;
+    struct sockaddr_in6 addr;
+    DWORD addrlen, ret, retlen;
+#ifdef ENABLE_IPV6
+    char ip[Py_MAX(INET_ADDRSTRLEN, INET6_ADDRSTRLEN) + 1];
+#else
+    char ip[INET_ADDRSTRLEN + 1];
+#endif
+
+    /* Guarantee NUL-termination for PyUnicode_FromString() below */
+    memset((void *) &ip[0], '\0', sizeof(ip));
+
+    if (!PyArg_ParseTuple(args, "iy#:inet_ntop", &af, &packed, &len)) {
+        return NULL;
+    }
+
+    if (af == AF_INET) {
+        struct sockaddr_in * addr4 = (struct sockaddr_in *)&addr;
+
+        if (len != sizeof(struct in_addr)) {
+            PyErr_SetString(PyExc_ValueError,
+                "invalid length of packed IP address string");
+            return NULL;
+        }
+        memset(addr4, 0, sizeof(struct sockaddr_in));
+        addr4->sin_family = AF_INET;
+        memcpy(&(addr4->sin_addr), packed, sizeof(addr4->sin_addr));
+        addrlen = sizeof(struct sockaddr_in);
+    } else if (af == AF_INET6) {
+        if (len != sizeof(struct in6_addr)) {
+            PyErr_SetString(PyExc_ValueError,
+                "invalid length of packed IP address string");
+            return NULL;
+        }
+
+        memset(&addr, 0, sizeof(addr));
+        addr.sin6_family = AF_INET6;
+        memcpy(&(addr.sin6_addr), packed, sizeof(addr.sin6_addr));
+        addrlen = sizeof(addr);
+    } else {
+        PyErr_Format(PyExc_ValueError,
+            "unknown address family %d", af);
+        return NULL;
+    }
+
+    retlen = sizeof(ip);
+    ret = WSAAddressToStringA((struct sockaddr*)&addr, addrlen, NULL,
+                              ip, &retlen);
+
+    if (ret) {
+        PyErr_SetExcFromWindowsErr(PyExc_OSError, WSAGetLastError());
+        return NULL;
+    } else {
+        return PyUnicode_FromString(ip);
+    }
+}
+
 #endif /* HAVE_INET_PTON */
 
 /* Python interface to getaddrinfo(host, port). */
@@ -5006,7 +5200,7 @@
     PyObject *all = (PyObject *)NULL;
     PyObject *idna = NULL;
 
-    family = socktype = protocol = flags = 0;
+    socktype = protocol = flags = 0;
     family = AF_UNSPEC;
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO|iiii:getaddrinfo",
                           kwnames, &hobj, &pobj, &family, &socktype,
@@ -5051,9 +5245,9 @@
 #if defined(__APPLE__) && defined(AI_NUMERICSERV)
     if ((flags & AI_NUMERICSERV) && (pptr == NULL || (pptr[0] == '0' && pptr[1] == 0))) {
         /* On OSX upto at least OSX 10.8 getaddrinfo crashes
-	 * if AI_NUMERICSERV is set and the servname is NULL or "0".
-	 * This workaround avoids a segfault in libsystem.
-	 */
+         * if AI_NUMERICSERV is set and the servname is NULL or "0".
+         * This workaround avoids a segfault in libsystem.
+         */
         pptr = "00";
     }
 #endif
@@ -5105,8 +5299,8 @@
 }
 
 PyDoc_STRVAR(getaddrinfo_doc,
-"getaddrinfo(host, port [, family, socktype, proto, flags])\n\
-    -> list of (family, socktype, proto, canonname, sockaddr)\n\
+"getaddrinfo(host, port [, family, type, proto, flags])\n\
+    -> list of (family, type, proto, canonname, sockaddr)\n\
 \n\
 Resolve host and port into addrinfo struct.");
 
@@ -5451,7 +5645,7 @@
      METH_VARARGS, inet_aton_doc},
     {"inet_ntoa",               socket_inet_ntoa,
      METH_VARARGS, inet_ntoa_doc},
-#ifdef HAVE_INET_PTON
+#if defined(HAVE_INET_PTON) || defined(MS_WINDOWS)
     {"inet_pton",               socket_inet_pton,
      METH_VARARGS, inet_pton_doc},
     {"inet_ntop",               socket_inet_ntop,
@@ -5526,32 +5720,6 @@
 #endif /* MS_WINDOWS */
 
 
-#ifdef PYOS_OS2
-#define OS_INIT_DEFINED
-
-/* Additional initialization for OS/2 */
-
-static int
-os_init(void)
-{
-#ifndef PYCC_GCC
-    int rc = sock_init();
-
-    if (rc == 0) {
-        return 1; /* Success */
-    }
-
-    PyErr_Format(PyExc_ImportError, "OS/2 TCP/IP Error# %d", sock_errno());
-
-    return 0;  /* Failure */
-#else
-    /* No need to initialize sockets with GCC/EMX */
-    return 1; /* Success */
-#endif
-}
-
-#endif /* PYOS_OS2 */
-
 
 #ifndef OS_INIT_DEFINED
 static int
@@ -5608,6 +5776,16 @@
     if (!os_init())
         return NULL;
 
+#ifdef MS_WINDOWS
+    if (support_wsa_no_inherit == -1) {
+        DWORD version = GetVersion();
+        DWORD major = (DWORD)LOBYTE(LOWORD(version));
+        DWORD minor = (DWORD)HIBYTE(LOWORD(version));
+        /* need Windows 7 SP1, 2008 R2 SP1 or later */
+        support_wsa_no_inherit = (major >= 6 && minor >= 1);
+    }
+#endif
+
     Py_TYPE(&sock_type) = &PyType_Type;
     m = PyModule_Create(&socketmodule);
     if (m == NULL)
@@ -5661,184 +5839,187 @@
 
     /* Address families (we only support AF_INET and AF_UNIX) */
 #ifdef AF_UNSPEC
-    PyModule_AddIntConstant(m, "AF_UNSPEC", AF_UNSPEC);
+    PyModule_AddIntMacro(m, AF_UNSPEC);
 #endif
-    PyModule_AddIntConstant(m, "AF_INET", AF_INET);
+    PyModule_AddIntMacro(m, AF_INET);
 #ifdef AF_INET6
-    PyModule_AddIntConstant(m, "AF_INET6", AF_INET6);
+    PyModule_AddIntMacro(m, AF_INET6);
 #endif /* AF_INET6 */
 #if defined(AF_UNIX)
-    PyModule_AddIntConstant(m, "AF_UNIX", AF_UNIX);
+    PyModule_AddIntMacro(m, AF_UNIX);
 #endif /* AF_UNIX */
 #ifdef AF_AX25
     /* Amateur Radio AX.25 */
-    PyModule_AddIntConstant(m, "AF_AX25", AF_AX25);
+    PyModule_AddIntMacro(m, AF_AX25);
 #endif
 #ifdef AF_IPX
-    PyModule_AddIntConstant(m, "AF_IPX", AF_IPX); /* Novell IPX */
+    PyModule_AddIntMacro(m, AF_IPX); /* Novell IPX */
 #endif
 #ifdef AF_APPLETALK
     /* Appletalk DDP */
-    PyModule_AddIntConstant(m, "AF_APPLETALK", AF_APPLETALK);
+    PyModule_AddIntMacro(m, AF_APPLETALK);
 #endif
 #ifdef AF_NETROM
     /* Amateur radio NetROM */
-    PyModule_AddIntConstant(m, "AF_NETROM", AF_NETROM);
+    PyModule_AddIntMacro(m, AF_NETROM);
 #endif
 #ifdef AF_BRIDGE
     /* Multiprotocol bridge */
-    PyModule_AddIntConstant(m, "AF_BRIDGE", AF_BRIDGE);
+    PyModule_AddIntMacro(m, AF_BRIDGE);
 #endif
 #ifdef AF_ATMPVC
     /* ATM PVCs */
-    PyModule_AddIntConstant(m, "AF_ATMPVC", AF_ATMPVC);
+    PyModule_AddIntMacro(m, AF_ATMPVC);
 #endif
 #ifdef AF_AAL5
     /* Reserved for Werner's ATM */
-    PyModule_AddIntConstant(m, "AF_AAL5", AF_AAL5);
+    PyModule_AddIntMacro(m, AF_AAL5);
 #endif
 #ifdef AF_X25
     /* Reserved for X.25 project */
-    PyModule_AddIntConstant(m, "AF_X25", AF_X25);
+    PyModule_AddIntMacro(m, AF_X25);
 #endif
 #ifdef AF_INET6
-    PyModule_AddIntConstant(m, "AF_INET6", AF_INET6); /* IP version 6 */
+    PyModule_AddIntMacro(m, AF_INET6); /* IP version 6 */
 #endif
 #ifdef AF_ROSE
     /* Amateur Radio X.25 PLP */
-    PyModule_AddIntConstant(m, "AF_ROSE", AF_ROSE);
+    PyModule_AddIntMacro(m, AF_ROSE);
 #endif
 #ifdef AF_DECnet
     /* Reserved for DECnet project */
-    PyModule_AddIntConstant(m, "AF_DECnet", AF_DECnet);
+    PyModule_AddIntMacro(m, AF_DECnet);
 #endif
 #ifdef AF_NETBEUI
     /* Reserved for 802.2LLC project */
-    PyModule_AddIntConstant(m, "AF_NETBEUI", AF_NETBEUI);
+    PyModule_AddIntMacro(m, AF_NETBEUI);
 #endif
 #ifdef AF_SECURITY
     /* Security callback pseudo AF */
-    PyModule_AddIntConstant(m, "AF_SECURITY", AF_SECURITY);
+    PyModule_AddIntMacro(m, AF_SECURITY);
 #endif
 #ifdef AF_KEY
     /* PF_KEY key management API */
-    PyModule_AddIntConstant(m, "AF_KEY", AF_KEY);
+    PyModule_AddIntMacro(m, AF_KEY);
 #endif
 #ifdef AF_NETLINK
     /*  */
-    PyModule_AddIntConstant(m, "AF_NETLINK", AF_NETLINK);
-    PyModule_AddIntConstant(m, "NETLINK_ROUTE", NETLINK_ROUTE);
+    PyModule_AddIntMacro(m, AF_NETLINK);
+    PyModule_AddIntMacro(m, NETLINK_ROUTE);
 #ifdef NETLINK_SKIP
-    PyModule_AddIntConstant(m, "NETLINK_SKIP", NETLINK_SKIP);
+    PyModule_AddIntMacro(m, NETLINK_SKIP);
 #endif
 #ifdef NETLINK_W1
-    PyModule_AddIntConstant(m, "NETLINK_W1", NETLINK_W1);
+    PyModule_AddIntMacro(m, NETLINK_W1);
 #endif
-    PyModule_AddIntConstant(m, "NETLINK_USERSOCK", NETLINK_USERSOCK);
-    PyModule_AddIntConstant(m, "NETLINK_FIREWALL", NETLINK_FIREWALL);
+    PyModule_AddIntMacro(m, NETLINK_USERSOCK);
+    PyModule_AddIntMacro(m, NETLINK_FIREWALL);
 #ifdef NETLINK_TCPDIAG
-    PyModule_AddIntConstant(m, "NETLINK_TCPDIAG", NETLINK_TCPDIAG);
+    PyModule_AddIntMacro(m, NETLINK_TCPDIAG);
 #endif
 #ifdef NETLINK_NFLOG
-    PyModule_AddIntConstant(m, "NETLINK_NFLOG", NETLINK_NFLOG);
+    PyModule_AddIntMacro(m, NETLINK_NFLOG);
 #endif
 #ifdef NETLINK_XFRM
-    PyModule_AddIntConstant(m, "NETLINK_XFRM", NETLINK_XFRM);
+    PyModule_AddIntMacro(m, NETLINK_XFRM);
 #endif
 #ifdef NETLINK_ARPD
-    PyModule_AddIntConstant(m, "NETLINK_ARPD", NETLINK_ARPD);
+    PyModule_AddIntMacro(m, NETLINK_ARPD);
 #endif
 #ifdef NETLINK_ROUTE6
-    PyModule_AddIntConstant(m, "NETLINK_ROUTE6", NETLINK_ROUTE6);
+    PyModule_AddIntMacro(m, NETLINK_ROUTE6);
 #endif
-    PyModule_AddIntConstant(m, "NETLINK_IP6_FW", NETLINK_IP6_FW);
+    PyModule_AddIntMacro(m, NETLINK_IP6_FW);
 #ifdef NETLINK_DNRTMSG
-    PyModule_AddIntConstant(m, "NETLINK_DNRTMSG", NETLINK_DNRTMSG);
+    PyModule_AddIntMacro(m, NETLINK_DNRTMSG);
 #endif
 #ifdef NETLINK_TAPBASE
-    PyModule_AddIntConstant(m, "NETLINK_TAPBASE", NETLINK_TAPBASE);
+    PyModule_AddIntMacro(m, NETLINK_TAPBASE);
 #endif
 #endif /* AF_NETLINK */
 #ifdef AF_ROUTE
     /* Alias to emulate 4.4BSD */
-    PyModule_AddIntConstant(m, "AF_ROUTE", AF_ROUTE);
+    PyModule_AddIntMacro(m, AF_ROUTE);
+#endif
+#ifdef AF_LINK
+    PyModule_AddIntMacro(m, AF_LINK);
 #endif
 #ifdef AF_ASH
     /* Ash */
-    PyModule_AddIntConstant(m, "AF_ASH", AF_ASH);
+    PyModule_AddIntMacro(m, AF_ASH);
 #endif
 #ifdef AF_ECONET
     /* Acorn Econet */
-    PyModule_AddIntConstant(m, "AF_ECONET", AF_ECONET);
+    PyModule_AddIntMacro(m, AF_ECONET);
 #endif
 #ifdef AF_ATMSVC
     /* ATM SVCs */
-    PyModule_AddIntConstant(m, "AF_ATMSVC", AF_ATMSVC);
+    PyModule_AddIntMacro(m, AF_ATMSVC);
 #endif
 #ifdef AF_SNA
     /* Linux SNA Project (nutters!) */
-    PyModule_AddIntConstant(m, "AF_SNA", AF_SNA);
+    PyModule_AddIntMacro(m, AF_SNA);
 #endif
 #ifdef AF_IRDA
     /* IRDA sockets */
-    PyModule_AddIntConstant(m, "AF_IRDA", AF_IRDA);
+    PyModule_AddIntMacro(m, AF_IRDA);
 #endif
 #ifdef AF_PPPOX
     /* PPPoX sockets */
-    PyModule_AddIntConstant(m, "AF_PPPOX", AF_PPPOX);
+    PyModule_AddIntMacro(m, AF_PPPOX);
 #endif
 #ifdef AF_WANPIPE
     /* Wanpipe API Sockets */
-    PyModule_AddIntConstant(m, "AF_WANPIPE", AF_WANPIPE);
+    PyModule_AddIntMacro(m, AF_WANPIPE);
 #endif
 #ifdef AF_LLC
     /* Linux LLC */
-    PyModule_AddIntConstant(m, "AF_LLC", AF_LLC);
+    PyModule_AddIntMacro(m, AF_LLC);
 #endif
 
 #ifdef USE_BLUETOOTH
-    PyModule_AddIntConstant(m, "AF_BLUETOOTH", AF_BLUETOOTH);
-    PyModule_AddIntConstant(m, "BTPROTO_L2CAP", BTPROTO_L2CAP);
-    PyModule_AddIntConstant(m, "BTPROTO_HCI", BTPROTO_HCI);
-    PyModule_AddIntConstant(m, "SOL_HCI", SOL_HCI);
+    PyModule_AddIntMacro(m, AF_BLUETOOTH);
+    PyModule_AddIntMacro(m, BTPROTO_L2CAP);
+    PyModule_AddIntMacro(m, BTPROTO_HCI);
+    PyModule_AddIntMacro(m, SOL_HCI);
 #if !defined(__NetBSD__) && !defined(__DragonFly__)
-    PyModule_AddIntConstant(m, "HCI_FILTER", HCI_FILTER);
+    PyModule_AddIntMacro(m, HCI_FILTER);
 #endif
 #if !defined(__FreeBSD__)
 #if !defined(__NetBSD__) && !defined(__DragonFly__)
-    PyModule_AddIntConstant(m, "HCI_TIME_STAMP", HCI_TIME_STAMP);
+    PyModule_AddIntMacro(m, HCI_TIME_STAMP);
 #endif
-    PyModule_AddIntConstant(m, "HCI_DATA_DIR", HCI_DATA_DIR);
-    PyModule_AddIntConstant(m, "BTPROTO_SCO", BTPROTO_SCO);
+    PyModule_AddIntMacro(m, HCI_DATA_DIR);
+    PyModule_AddIntMacro(m, BTPROTO_SCO);
 #endif
-    PyModule_AddIntConstant(m, "BTPROTO_RFCOMM", BTPROTO_RFCOMM);
+    PyModule_AddIntMacro(m, BTPROTO_RFCOMM);
     PyModule_AddStringConstant(m, "BDADDR_ANY", "00:00:00:00:00:00");
     PyModule_AddStringConstant(m, "BDADDR_LOCAL", "00:00:00:FF:FF:FF");
 #endif
 
 #ifdef AF_CAN
     /* Controller Area Network */
-    PyModule_AddIntConstant(m, "AF_CAN", AF_CAN);
+    PyModule_AddIntMacro(m, AF_CAN);
 #endif
 #ifdef PF_CAN
     /* Controller Area Network */
-    PyModule_AddIntConstant(m, "PF_CAN", PF_CAN);
+    PyModule_AddIntMacro(m, PF_CAN);
 #endif
 
 /* Reliable Datagram Sockets */
 #ifdef AF_RDS
-    PyModule_AddIntConstant(m, "AF_RDS", AF_RDS);
+    PyModule_AddIntMacro(m, AF_RDS);
 #endif
 #ifdef PF_RDS
-    PyModule_AddIntConstant(m, "PF_RDS", PF_RDS);
+    PyModule_AddIntMacro(m, PF_RDS);
 #endif
 
 /* Kernel event messages */
 #ifdef PF_SYSTEM
-    PyModule_AddIntConstant(m, "PF_SYSTEM", PF_SYSTEM);
+    PyModule_AddIntMacro(m, PF_SYSTEM);
 #endif
 #ifdef AF_SYSTEM
-    PyModule_AddIntConstant(m, "AF_SYSTEM", AF_SYSTEM);
+    PyModule_AddIntMacro(m, AF_SYSTEM);
 #endif
 
 #ifdef AF_PACKET
@@ -5870,447 +6051,463 @@
 #endif
 
 #ifdef HAVE_LINUX_TIPC_H
-    PyModule_AddIntConstant(m, "AF_TIPC", AF_TIPC);
+    PyModule_AddIntMacro(m, AF_TIPC);
 
     /* for addresses */
-    PyModule_AddIntConstant(m, "TIPC_ADDR_NAMESEQ", TIPC_ADDR_NAMESEQ);
-    PyModule_AddIntConstant(m, "TIPC_ADDR_NAME", TIPC_ADDR_NAME);
-    PyModule_AddIntConstant(m, "TIPC_ADDR_ID", TIPC_ADDR_ID);
+    PyModule_AddIntMacro(m, TIPC_ADDR_NAMESEQ);
+    PyModule_AddIntMacro(m, TIPC_ADDR_NAME);
+    PyModule_AddIntMacro(m, TIPC_ADDR_ID);
 
-    PyModule_AddIntConstant(m, "TIPC_ZONE_SCOPE", TIPC_ZONE_SCOPE);
-    PyModule_AddIntConstant(m, "TIPC_CLUSTER_SCOPE", TIPC_CLUSTER_SCOPE);
-    PyModule_AddIntConstant(m, "TIPC_NODE_SCOPE", TIPC_NODE_SCOPE);
+    PyModule_AddIntMacro(m, TIPC_ZONE_SCOPE);
+    PyModule_AddIntMacro(m, TIPC_CLUSTER_SCOPE);
+    PyModule_AddIntMacro(m, TIPC_NODE_SCOPE);
 
     /* for setsockopt() */
-    PyModule_AddIntConstant(m, "SOL_TIPC", SOL_TIPC);
-    PyModule_AddIntConstant(m, "TIPC_IMPORTANCE", TIPC_IMPORTANCE);
-    PyModule_AddIntConstant(m, "TIPC_SRC_DROPPABLE", TIPC_SRC_DROPPABLE);
-    PyModule_AddIntConstant(m, "TIPC_DEST_DROPPABLE",
-                    TIPC_DEST_DROPPABLE);
-    PyModule_AddIntConstant(m, "TIPC_CONN_TIMEOUT", TIPC_CONN_TIMEOUT);
+    PyModule_AddIntMacro(m, SOL_TIPC);
+    PyModule_AddIntMacro(m, TIPC_IMPORTANCE);
+    PyModule_AddIntMacro(m, TIPC_SRC_DROPPABLE);
+    PyModule_AddIntMacro(m, TIPC_DEST_DROPPABLE);
+    PyModule_AddIntMacro(m, TIPC_CONN_TIMEOUT);
 
-    PyModule_AddIntConstant(m, "TIPC_LOW_IMPORTANCE",
-                    TIPC_LOW_IMPORTANCE);
-    PyModule_AddIntConstant(m, "TIPC_MEDIUM_IMPORTANCE",
-                    TIPC_MEDIUM_IMPORTANCE);
-    PyModule_AddIntConstant(m, "TIPC_HIGH_IMPORTANCE",
-                    TIPC_HIGH_IMPORTANCE);
-    PyModule_AddIntConstant(m, "TIPC_CRITICAL_IMPORTANCE",
-                    TIPC_CRITICAL_IMPORTANCE);
+    PyModule_AddIntMacro(m, TIPC_LOW_IMPORTANCE);
+    PyModule_AddIntMacro(m, TIPC_MEDIUM_IMPORTANCE);
+    PyModule_AddIntMacro(m, TIPC_HIGH_IMPORTANCE);
+    PyModule_AddIntMacro(m, TIPC_CRITICAL_IMPORTANCE);
 
     /* for subscriptions */
-    PyModule_AddIntConstant(m, "TIPC_SUB_PORTS", TIPC_SUB_PORTS);
-    PyModule_AddIntConstant(m, "TIPC_SUB_SERVICE", TIPC_SUB_SERVICE);
+    PyModule_AddIntMacro(m, TIPC_SUB_PORTS);
+    PyModule_AddIntMacro(m, TIPC_SUB_SERVICE);
 #ifdef TIPC_SUB_CANCEL
     /* doesn't seem to be available everywhere */
-    PyModule_AddIntConstant(m, "TIPC_SUB_CANCEL", TIPC_SUB_CANCEL);
+    PyModule_AddIntMacro(m, TIPC_SUB_CANCEL);
 #endif
-    PyModule_AddIntConstant(m, "TIPC_WAIT_FOREVER", TIPC_WAIT_FOREVER);
-    PyModule_AddIntConstant(m, "TIPC_PUBLISHED", TIPC_PUBLISHED);
-    PyModule_AddIntConstant(m, "TIPC_WITHDRAWN", TIPC_WITHDRAWN);
-    PyModule_AddIntConstant(m, "TIPC_SUBSCR_TIMEOUT", TIPC_SUBSCR_TIMEOUT);
-    PyModule_AddIntConstant(m, "TIPC_CFG_SRV", TIPC_CFG_SRV);
-    PyModule_AddIntConstant(m, "TIPC_TOP_SRV", TIPC_TOP_SRV);
+    PyModule_AddIntMacro(m, TIPC_WAIT_FOREVER);
+    PyModule_AddIntMacro(m, TIPC_PUBLISHED);
+    PyModule_AddIntMacro(m, TIPC_WITHDRAWN);
+    PyModule_AddIntMacro(m, TIPC_SUBSCR_TIMEOUT);
+    PyModule_AddIntMacro(m, TIPC_CFG_SRV);
+    PyModule_AddIntMacro(m, TIPC_TOP_SRV);
 #endif
 
     /* Socket types */
-    PyModule_AddIntConstant(m, "SOCK_STREAM", SOCK_STREAM);
-    PyModule_AddIntConstant(m, "SOCK_DGRAM", SOCK_DGRAM);
+    PyModule_AddIntMacro(m, SOCK_STREAM);
+    PyModule_AddIntMacro(m, SOCK_DGRAM);
 /* We have incomplete socket support. */
-    PyModule_AddIntConstant(m, "SOCK_RAW", SOCK_RAW);
-    PyModule_AddIntConstant(m, "SOCK_SEQPACKET", SOCK_SEQPACKET);
+    PyModule_AddIntMacro(m, SOCK_RAW);
+    PyModule_AddIntMacro(m, SOCK_SEQPACKET);
 #if defined(SOCK_RDM)
-    PyModule_AddIntConstant(m, "SOCK_RDM", SOCK_RDM);
+    PyModule_AddIntMacro(m, SOCK_RDM);
 #endif
 #ifdef SOCK_CLOEXEC
-    PyModule_AddIntConstant(m, "SOCK_CLOEXEC", SOCK_CLOEXEC);
+    PyModule_AddIntMacro(m, SOCK_CLOEXEC);
 #endif
 #ifdef SOCK_NONBLOCK
-    PyModule_AddIntConstant(m, "SOCK_NONBLOCK", SOCK_NONBLOCK);
+    PyModule_AddIntMacro(m, SOCK_NONBLOCK);
 #endif
 
 #ifdef  SO_DEBUG
-    PyModule_AddIntConstant(m, "SO_DEBUG", SO_DEBUG);
+    PyModule_AddIntMacro(m, SO_DEBUG);
 #endif
 #ifdef  SO_ACCEPTCONN
-    PyModule_AddIntConstant(m, "SO_ACCEPTCONN", SO_ACCEPTCONN);
+    PyModule_AddIntMacro(m, SO_ACCEPTCONN);
 #endif
 #ifdef  SO_REUSEADDR
-    PyModule_AddIntConstant(m, "SO_REUSEADDR", SO_REUSEADDR);
+    PyModule_AddIntMacro(m, SO_REUSEADDR);
 #endif
 #ifdef SO_EXCLUSIVEADDRUSE
-    PyModule_AddIntConstant(m, "SO_EXCLUSIVEADDRUSE", SO_EXCLUSIVEADDRUSE);
+    PyModule_AddIntMacro(m, SO_EXCLUSIVEADDRUSE);
 #endif
 
 #ifdef  SO_KEEPALIVE
-    PyModule_AddIntConstant(m, "SO_KEEPALIVE", SO_KEEPALIVE);
+    PyModule_AddIntMacro(m, SO_KEEPALIVE);
 #endif
 #ifdef  SO_DONTROUTE
-    PyModule_AddIntConstant(m, "SO_DONTROUTE", SO_DONTROUTE);
+    PyModule_AddIntMacro(m, SO_DONTROUTE);
 #endif
 #ifdef  SO_BROADCAST
-    PyModule_AddIntConstant(m, "SO_BROADCAST", SO_BROADCAST);
+    PyModule_AddIntMacro(m, SO_BROADCAST);
 #endif
 #ifdef  SO_USELOOPBACK
-    PyModule_AddIntConstant(m, "SO_USELOOPBACK", SO_USELOOPBACK);
+    PyModule_AddIntMacro(m, SO_USELOOPBACK);
 #endif
 #ifdef  SO_LINGER
-    PyModule_AddIntConstant(m, "SO_LINGER", SO_LINGER);
+    PyModule_AddIntMacro(m, SO_LINGER);
 #endif
 #ifdef  SO_OOBINLINE
-    PyModule_AddIntConstant(m, "SO_OOBINLINE", SO_OOBINLINE);
+    PyModule_AddIntMacro(m, SO_OOBINLINE);
 #endif
 #ifdef  SO_REUSEPORT
-    PyModule_AddIntConstant(m, "SO_REUSEPORT", SO_REUSEPORT);
+    PyModule_AddIntMacro(m, SO_REUSEPORT);
 #endif
 #ifdef  SO_SNDBUF
-    PyModule_AddIntConstant(m, "SO_SNDBUF", SO_SNDBUF);
+    PyModule_AddIntMacro(m, SO_SNDBUF);
 #endif
 #ifdef  SO_RCVBUF
-    PyModule_AddIntConstant(m, "SO_RCVBUF", SO_RCVBUF);
+    PyModule_AddIntMacro(m, SO_RCVBUF);
 #endif
 #ifdef  SO_SNDLOWAT
-    PyModule_AddIntConstant(m, "SO_SNDLOWAT", SO_SNDLOWAT);
+    PyModule_AddIntMacro(m, SO_SNDLOWAT);
 #endif
 #ifdef  SO_RCVLOWAT
-    PyModule_AddIntConstant(m, "SO_RCVLOWAT", SO_RCVLOWAT);
+    PyModule_AddIntMacro(m, SO_RCVLOWAT);
 #endif
 #ifdef  SO_SNDTIMEO
-    PyModule_AddIntConstant(m, "SO_SNDTIMEO", SO_SNDTIMEO);
+    PyModule_AddIntMacro(m, SO_SNDTIMEO);
 #endif
 #ifdef  SO_RCVTIMEO
-    PyModule_AddIntConstant(m, "SO_RCVTIMEO", SO_RCVTIMEO);
+    PyModule_AddIntMacro(m, SO_RCVTIMEO);
 #endif
 #ifdef  SO_ERROR
-    PyModule_AddIntConstant(m, "SO_ERROR", SO_ERROR);
+    PyModule_AddIntMacro(m, SO_ERROR);
 #endif
 #ifdef  SO_TYPE
-    PyModule_AddIntConstant(m, "SO_TYPE", SO_TYPE);
+    PyModule_AddIntMacro(m, SO_TYPE);
 #endif
 #ifdef  SO_SETFIB
-    PyModule_AddIntConstant(m, "SO_SETFIB", SO_SETFIB);
+    PyModule_AddIntMacro(m, SO_SETFIB);
 #endif
 #ifdef  SO_PASSCRED
-    PyModule_AddIntConstant(m, "SO_PASSCRED", SO_PASSCRED);
+    PyModule_AddIntMacro(m, SO_PASSCRED);
 #endif
 #ifdef  SO_PEERCRED
-    PyModule_AddIntConstant(m, "SO_PEERCRED", SO_PEERCRED);
+    PyModule_AddIntMacro(m, SO_PEERCRED);
 #endif
 #ifdef  LOCAL_PEERCRED
-    PyModule_AddIntConstant(m, "LOCAL_PEERCRED", LOCAL_PEERCRED);
+    PyModule_AddIntMacro(m, LOCAL_PEERCRED);
 #endif
 #ifdef  SO_BINDTODEVICE
     PyModule_AddIntMacro(m, SO_BINDTODEVICE);
 #endif
+#ifdef  SO_PRIORITY
+    PyModule_AddIntMacro(m, SO_PRIORITY);
+#endif
 
     /* Maximum number of connections for "listen" */
 #ifdef  SOMAXCONN
-    PyModule_AddIntConstant(m, "SOMAXCONN", SOMAXCONN);
+    PyModule_AddIntMacro(m, SOMAXCONN);
 #else
     PyModule_AddIntConstant(m, "SOMAXCONN", 5); /* Common value */
 #endif
 
     /* Ancilliary message types */
 #ifdef  SCM_RIGHTS
-    PyModule_AddIntConstant(m, "SCM_RIGHTS", SCM_RIGHTS);
+    PyModule_AddIntMacro(m, SCM_RIGHTS);
 #endif
 #ifdef  SCM_CREDENTIALS
-    PyModule_AddIntConstant(m, "SCM_CREDENTIALS", SCM_CREDENTIALS);
+    PyModule_AddIntMacro(m, SCM_CREDENTIALS);
 #endif
 #ifdef  SCM_CREDS
-    PyModule_AddIntConstant(m, "SCM_CREDS", SCM_CREDS);
+    PyModule_AddIntMacro(m, SCM_CREDS);
 #endif
 
     /* Flags for send, recv */
 #ifdef  MSG_OOB
-    PyModule_AddIntConstant(m, "MSG_OOB", MSG_OOB);
+    PyModule_AddIntMacro(m, MSG_OOB);
 #endif
 #ifdef  MSG_PEEK
-    PyModule_AddIntConstant(m, "MSG_PEEK", MSG_PEEK);
+    PyModule_AddIntMacro(m, MSG_PEEK);
 #endif
 #ifdef  MSG_DONTROUTE
-    PyModule_AddIntConstant(m, "MSG_DONTROUTE", MSG_DONTROUTE);
+    PyModule_AddIntMacro(m, MSG_DONTROUTE);
 #endif
 #ifdef  MSG_DONTWAIT
-    PyModule_AddIntConstant(m, "MSG_DONTWAIT", MSG_DONTWAIT);
+    PyModule_AddIntMacro(m, MSG_DONTWAIT);
 #endif
 #ifdef  MSG_EOR
-    PyModule_AddIntConstant(m, "MSG_EOR", MSG_EOR);
+    PyModule_AddIntMacro(m, MSG_EOR);
 #endif
 #ifdef  MSG_TRUNC
-    PyModule_AddIntConstant(m, "MSG_TRUNC", MSG_TRUNC);
+    PyModule_AddIntMacro(m, MSG_TRUNC);
 #endif
 #ifdef  MSG_CTRUNC
-    PyModule_AddIntConstant(m, "MSG_CTRUNC", MSG_CTRUNC);
+    PyModule_AddIntMacro(m, MSG_CTRUNC);
 #endif
 #ifdef  MSG_WAITALL
-    PyModule_AddIntConstant(m, "MSG_WAITALL", MSG_WAITALL);
+    PyModule_AddIntMacro(m, MSG_WAITALL);
 #endif
 #ifdef  MSG_BTAG
-    PyModule_AddIntConstant(m, "MSG_BTAG", MSG_BTAG);
+    PyModule_AddIntMacro(m, MSG_BTAG);
 #endif
 #ifdef  MSG_ETAG
-    PyModule_AddIntConstant(m, "MSG_ETAG", MSG_ETAG);
+    PyModule_AddIntMacro(m, MSG_ETAG);
 #endif
 #ifdef  MSG_NOSIGNAL
-    PyModule_AddIntConstant(m, "MSG_NOSIGNAL", MSG_NOSIGNAL);
+    PyModule_AddIntMacro(m, MSG_NOSIGNAL);
 #endif
 #ifdef  MSG_NOTIFICATION
-    PyModule_AddIntConstant(m, "MSG_NOTIFICATION", MSG_NOTIFICATION);
+    PyModule_AddIntMacro(m, MSG_NOTIFICATION);
 #endif
 #ifdef  MSG_CMSG_CLOEXEC
-    PyModule_AddIntConstant(m, "MSG_CMSG_CLOEXEC", MSG_CMSG_CLOEXEC);
+    PyModule_AddIntMacro(m, MSG_CMSG_CLOEXEC);
 #endif
 #ifdef  MSG_ERRQUEUE
-    PyModule_AddIntConstant(m, "MSG_ERRQUEUE", MSG_ERRQUEUE);
+    PyModule_AddIntMacro(m, MSG_ERRQUEUE);
 #endif
 #ifdef  MSG_CONFIRM
-    PyModule_AddIntConstant(m, "MSG_CONFIRM", MSG_CONFIRM);
+    PyModule_AddIntMacro(m, MSG_CONFIRM);
 #endif
 #ifdef  MSG_MORE
-    PyModule_AddIntConstant(m, "MSG_MORE", MSG_MORE);
+    PyModule_AddIntMacro(m, MSG_MORE);
 #endif
 #ifdef  MSG_EOF
-    PyModule_AddIntConstant(m, "MSG_EOF", MSG_EOF);
+    PyModule_AddIntMacro(m, MSG_EOF);
 #endif
 #ifdef  MSG_BCAST
-    PyModule_AddIntConstant(m, "MSG_BCAST", MSG_BCAST);
+    PyModule_AddIntMacro(m, MSG_BCAST);
 #endif
 #ifdef  MSG_MCAST
-    PyModule_AddIntConstant(m, "MSG_MCAST", MSG_MCAST);
+    PyModule_AddIntMacro(m, MSG_MCAST);
+#endif
+#ifdef MSG_FASTOPEN
+    PyModule_AddIntMacro(m, MSG_FASTOPEN);
 #endif
 
     /* Protocol level and numbers, usable for [gs]etsockopt */
 #ifdef  SOL_SOCKET
-    PyModule_AddIntConstant(m, "SOL_SOCKET", SOL_SOCKET);
+    PyModule_AddIntMacro(m, SOL_SOCKET);
 #endif
 #ifdef  SOL_IP
-    PyModule_AddIntConstant(m, "SOL_IP", SOL_IP);
+    PyModule_AddIntMacro(m, SOL_IP);
 #else
     PyModule_AddIntConstant(m, "SOL_IP", 0);
 #endif
 #ifdef  SOL_IPX
-    PyModule_AddIntConstant(m, "SOL_IPX", SOL_IPX);
+    PyModule_AddIntMacro(m, SOL_IPX);
 #endif
 #ifdef  SOL_AX25
-    PyModule_AddIntConstant(m, "SOL_AX25", SOL_AX25);
+    PyModule_AddIntMacro(m, SOL_AX25);
 #endif
 #ifdef  SOL_ATALK
-    PyModule_AddIntConstant(m, "SOL_ATALK", SOL_ATALK);
+    PyModule_AddIntMacro(m, SOL_ATALK);
 #endif
 #ifdef  SOL_NETROM
-    PyModule_AddIntConstant(m, "SOL_NETROM", SOL_NETROM);
+    PyModule_AddIntMacro(m, SOL_NETROM);
 #endif
 #ifdef  SOL_ROSE
-    PyModule_AddIntConstant(m, "SOL_ROSE", SOL_ROSE);
+    PyModule_AddIntMacro(m, SOL_ROSE);
 #endif
 #ifdef  SOL_TCP
-    PyModule_AddIntConstant(m, "SOL_TCP", SOL_TCP);
+    PyModule_AddIntMacro(m, SOL_TCP);
 #else
     PyModule_AddIntConstant(m, "SOL_TCP", 6);
 #endif
 #ifdef  SOL_UDP
-    PyModule_AddIntConstant(m, "SOL_UDP", SOL_UDP);
+    PyModule_AddIntMacro(m, SOL_UDP);
 #else
     PyModule_AddIntConstant(m, "SOL_UDP", 17);
 #endif
 #ifdef SOL_CAN_BASE
-    PyModule_AddIntConstant(m, "SOL_CAN_BASE", SOL_CAN_BASE);
+    PyModule_AddIntMacro(m, SOL_CAN_BASE);
 #endif
 #ifdef SOL_CAN_RAW
-    PyModule_AddIntConstant(m, "SOL_CAN_RAW", SOL_CAN_RAW);
-    PyModule_AddIntConstant(m, "CAN_RAW", CAN_RAW);
+    PyModule_AddIntMacro(m, SOL_CAN_RAW);
+    PyModule_AddIntMacro(m, CAN_RAW);
 #endif
 #ifdef HAVE_LINUX_CAN_H
-    PyModule_AddIntConstant(m, "CAN_EFF_FLAG", CAN_EFF_FLAG);
-    PyModule_AddIntConstant(m, "CAN_RTR_FLAG", CAN_RTR_FLAG);
-    PyModule_AddIntConstant(m, "CAN_ERR_FLAG", CAN_ERR_FLAG);
+    PyModule_AddIntMacro(m, CAN_EFF_FLAG);
+    PyModule_AddIntMacro(m, CAN_RTR_FLAG);
+    PyModule_AddIntMacro(m, CAN_ERR_FLAG);
 
-    PyModule_AddIntConstant(m, "CAN_SFF_MASK", CAN_SFF_MASK);
-    PyModule_AddIntConstant(m, "CAN_EFF_MASK", CAN_EFF_MASK);
-    PyModule_AddIntConstant(m, "CAN_ERR_MASK", CAN_ERR_MASK);
+    PyModule_AddIntMacro(m, CAN_SFF_MASK);
+    PyModule_AddIntMacro(m, CAN_EFF_MASK);
+    PyModule_AddIntMacro(m, CAN_ERR_MASK);
 #endif
 #ifdef HAVE_LINUX_CAN_RAW_H
-    PyModule_AddIntConstant(m, "CAN_RAW_FILTER", CAN_RAW_FILTER);
-    PyModule_AddIntConstant(m, "CAN_RAW_ERR_FILTER", CAN_RAW_ERR_FILTER);
-    PyModule_AddIntConstant(m, "CAN_RAW_LOOPBACK", CAN_RAW_LOOPBACK);
-    PyModule_AddIntConstant(m, "CAN_RAW_RECV_OWN_MSGS", CAN_RAW_RECV_OWN_MSGS);
+    PyModule_AddIntMacro(m, CAN_RAW_FILTER);
+    PyModule_AddIntMacro(m, CAN_RAW_ERR_FILTER);
+    PyModule_AddIntMacro(m, CAN_RAW_LOOPBACK);
+    PyModule_AddIntMacro(m, CAN_RAW_RECV_OWN_MSGS);
+#endif
+#ifdef HAVE_LINUX_CAN_BCM_H
+    PyModule_AddIntMacro(m, CAN_BCM);
+    PyModule_AddIntConstant(m, "CAN_BCM_TX_SETUP", TX_SETUP);
+    PyModule_AddIntConstant(m, "CAN_BCM_TX_DELETE", TX_DELETE);
+    PyModule_AddIntConstant(m, "CAN_BCM_TX_READ", TX_READ);
+    PyModule_AddIntConstant(m, "CAN_BCM_TX_SEND", TX_SEND);
+    PyModule_AddIntConstant(m, "CAN_BCM_RX_SETUP", RX_SETUP);
+    PyModule_AddIntConstant(m, "CAN_BCM_RX_DELETE", RX_DELETE);
+    PyModule_AddIntConstant(m, "CAN_BCM_RX_READ", RX_READ);
+    PyModule_AddIntConstant(m, "CAN_BCM_TX_STATUS", TX_STATUS);
+    PyModule_AddIntConstant(m, "CAN_BCM_TX_EXPIRED", TX_EXPIRED);
+    PyModule_AddIntConstant(m, "CAN_BCM_RX_STATUS", RX_STATUS);
+    PyModule_AddIntConstant(m, "CAN_BCM_RX_TIMEOUT", RX_TIMEOUT);
+    PyModule_AddIntConstant(m, "CAN_BCM_RX_CHANGED", RX_CHANGED);
 #endif
 #ifdef SOL_RDS
-    PyModule_AddIntConstant(m, "SOL_RDS", SOL_RDS);
+    PyModule_AddIntMacro(m, SOL_RDS);
 #endif
 #ifdef RDS_CANCEL_SENT_TO
-    PyModule_AddIntConstant(m, "RDS_CANCEL_SENT_TO", RDS_CANCEL_SENT_TO);
+    PyModule_AddIntMacro(m, RDS_CANCEL_SENT_TO);
 #endif
 #ifdef RDS_GET_MR
-    PyModule_AddIntConstant(m, "RDS_GET_MR", RDS_GET_MR);
+    PyModule_AddIntMacro(m, RDS_GET_MR);
 #endif
 #ifdef RDS_FREE_MR
-    PyModule_AddIntConstant(m, "RDS_FREE_MR", RDS_FREE_MR);
+    PyModule_AddIntMacro(m, RDS_FREE_MR);
 #endif
 #ifdef RDS_RECVERR
-    PyModule_AddIntConstant(m, "RDS_RECVERR", RDS_RECVERR);
+    PyModule_AddIntMacro(m, RDS_RECVERR);
 #endif
 #ifdef RDS_CONG_MONITOR
-    PyModule_AddIntConstant(m, "RDS_CONG_MONITOR", RDS_CONG_MONITOR);
+    PyModule_AddIntMacro(m, RDS_CONG_MONITOR);
 #endif
 #ifdef RDS_GET_MR_FOR_DEST
-    PyModule_AddIntConstant(m, "RDS_GET_MR_FOR_DEST", RDS_GET_MR_FOR_DEST);
+    PyModule_AddIntMacro(m, RDS_GET_MR_FOR_DEST);
 #endif
 #ifdef  IPPROTO_IP
-    PyModule_AddIntConstant(m, "IPPROTO_IP", IPPROTO_IP);
+    PyModule_AddIntMacro(m, IPPROTO_IP);
 #else
     PyModule_AddIntConstant(m, "IPPROTO_IP", 0);
 #endif
 #ifdef  IPPROTO_HOPOPTS
-    PyModule_AddIntConstant(m, "IPPROTO_HOPOPTS", IPPROTO_HOPOPTS);
+    PyModule_AddIntMacro(m, IPPROTO_HOPOPTS);
 #endif
 #ifdef  IPPROTO_ICMP
-    PyModule_AddIntConstant(m, "IPPROTO_ICMP", IPPROTO_ICMP);
+    PyModule_AddIntMacro(m, IPPROTO_ICMP);
 #else
     PyModule_AddIntConstant(m, "IPPROTO_ICMP", 1);
 #endif
 #ifdef  IPPROTO_IGMP
-    PyModule_AddIntConstant(m, "IPPROTO_IGMP", IPPROTO_IGMP);
+    PyModule_AddIntMacro(m, IPPROTO_IGMP);
 #endif
 #ifdef  IPPROTO_GGP
-    PyModule_AddIntConstant(m, "IPPROTO_GGP", IPPROTO_GGP);
+    PyModule_AddIntMacro(m, IPPROTO_GGP);
 #endif
 #ifdef  IPPROTO_IPV4
-    PyModule_AddIntConstant(m, "IPPROTO_IPV4", IPPROTO_IPV4);
+    PyModule_AddIntMacro(m, IPPROTO_IPV4);
 #endif
 #ifdef  IPPROTO_IPV6
-    PyModule_AddIntConstant(m, "IPPROTO_IPV6", IPPROTO_IPV6);
+    PyModule_AddIntMacro(m, IPPROTO_IPV6);
 #endif
 #ifdef  IPPROTO_IPIP
-    PyModule_AddIntConstant(m, "IPPROTO_IPIP", IPPROTO_IPIP);
+    PyModule_AddIntMacro(m, IPPROTO_IPIP);
 #endif
 #ifdef  IPPROTO_TCP
-    PyModule_AddIntConstant(m, "IPPROTO_TCP", IPPROTO_TCP);
+    PyModule_AddIntMacro(m, IPPROTO_TCP);
 #else
     PyModule_AddIntConstant(m, "IPPROTO_TCP", 6);
 #endif
 #ifdef  IPPROTO_EGP
-    PyModule_AddIntConstant(m, "IPPROTO_EGP", IPPROTO_EGP);
+    PyModule_AddIntMacro(m, IPPROTO_EGP);
 #endif
 #ifdef  IPPROTO_PUP
-    PyModule_AddIntConstant(m, "IPPROTO_PUP", IPPROTO_PUP);
+    PyModule_AddIntMacro(m, IPPROTO_PUP);
 #endif
 #ifdef  IPPROTO_UDP
-    PyModule_AddIntConstant(m, "IPPROTO_UDP", IPPROTO_UDP);
+    PyModule_AddIntMacro(m, IPPROTO_UDP);
 #else
     PyModule_AddIntConstant(m, "IPPROTO_UDP", 17);
 #endif
 #ifdef  IPPROTO_IDP
-    PyModule_AddIntConstant(m, "IPPROTO_IDP", IPPROTO_IDP);
+    PyModule_AddIntMacro(m, IPPROTO_IDP);
 #endif
 #ifdef  IPPROTO_HELLO
-    PyModule_AddIntConstant(m, "IPPROTO_HELLO", IPPROTO_HELLO);
+    PyModule_AddIntMacro(m, IPPROTO_HELLO);
 #endif
 #ifdef  IPPROTO_ND
-    PyModule_AddIntConstant(m, "IPPROTO_ND", IPPROTO_ND);
+    PyModule_AddIntMacro(m, IPPROTO_ND);
 #endif
 #ifdef  IPPROTO_TP
-    PyModule_AddIntConstant(m, "IPPROTO_TP", IPPROTO_TP);
+    PyModule_AddIntMacro(m, IPPROTO_TP);
 #endif
 #ifdef  IPPROTO_IPV6
-    PyModule_AddIntConstant(m, "IPPROTO_IPV6", IPPROTO_IPV6);
+    PyModule_AddIntMacro(m, IPPROTO_IPV6);
 #endif
 #ifdef  IPPROTO_ROUTING
-    PyModule_AddIntConstant(m, "IPPROTO_ROUTING", IPPROTO_ROUTING);
+    PyModule_AddIntMacro(m, IPPROTO_ROUTING);
 #endif
 #ifdef  IPPROTO_FRAGMENT
-    PyModule_AddIntConstant(m, "IPPROTO_FRAGMENT", IPPROTO_FRAGMENT);
+    PyModule_AddIntMacro(m, IPPROTO_FRAGMENT);
 #endif
 #ifdef  IPPROTO_RSVP
-    PyModule_AddIntConstant(m, "IPPROTO_RSVP", IPPROTO_RSVP);
+    PyModule_AddIntMacro(m, IPPROTO_RSVP);
 #endif
 #ifdef  IPPROTO_GRE
-    PyModule_AddIntConstant(m, "IPPROTO_GRE", IPPROTO_GRE);
+    PyModule_AddIntMacro(m, IPPROTO_GRE);
 #endif
 #ifdef  IPPROTO_ESP
-    PyModule_AddIntConstant(m, "IPPROTO_ESP", IPPROTO_ESP);
+    PyModule_AddIntMacro(m, IPPROTO_ESP);
 #endif
 #ifdef  IPPROTO_AH
-    PyModule_AddIntConstant(m, "IPPROTO_AH", IPPROTO_AH);
+    PyModule_AddIntMacro(m, IPPROTO_AH);
 #endif
 #ifdef  IPPROTO_MOBILE
-    PyModule_AddIntConstant(m, "IPPROTO_MOBILE", IPPROTO_MOBILE);
+    PyModule_AddIntMacro(m, IPPROTO_MOBILE);
 #endif
 #ifdef  IPPROTO_ICMPV6
-    PyModule_AddIntConstant(m, "IPPROTO_ICMPV6", IPPROTO_ICMPV6);
+    PyModule_AddIntMacro(m, IPPROTO_ICMPV6);
 #endif
 #ifdef  IPPROTO_NONE
-    PyModule_AddIntConstant(m, "IPPROTO_NONE", IPPROTO_NONE);
+    PyModule_AddIntMacro(m, IPPROTO_NONE);
 #endif
 #ifdef  IPPROTO_DSTOPTS
-    PyModule_AddIntConstant(m, "IPPROTO_DSTOPTS", IPPROTO_DSTOPTS);
+    PyModule_AddIntMacro(m, IPPROTO_DSTOPTS);
 #endif
 #ifdef  IPPROTO_XTP
-    PyModule_AddIntConstant(m, "IPPROTO_XTP", IPPROTO_XTP);
+    PyModule_AddIntMacro(m, IPPROTO_XTP);
 #endif
 #ifdef  IPPROTO_EON
-    PyModule_AddIntConstant(m, "IPPROTO_EON", IPPROTO_EON);
+    PyModule_AddIntMacro(m, IPPROTO_EON);
 #endif
 #ifdef  IPPROTO_PIM
-    PyModule_AddIntConstant(m, "IPPROTO_PIM", IPPROTO_PIM);
+    PyModule_AddIntMacro(m, IPPROTO_PIM);
 #endif
 #ifdef  IPPROTO_IPCOMP
-    PyModule_AddIntConstant(m, "IPPROTO_IPCOMP", IPPROTO_IPCOMP);
+    PyModule_AddIntMacro(m, IPPROTO_IPCOMP);
 #endif
 #ifdef  IPPROTO_VRRP
-    PyModule_AddIntConstant(m, "IPPROTO_VRRP", IPPROTO_VRRP);
+    PyModule_AddIntMacro(m, IPPROTO_VRRP);
 #endif
 #ifdef  IPPROTO_SCTP
-    PyModule_AddIntConstant(m, "IPPROTO_SCTP", IPPROTO_SCTP);
+    PyModule_AddIntMacro(m, IPPROTO_SCTP);
 #endif
 #ifdef  IPPROTO_BIP
-    PyModule_AddIntConstant(m, "IPPROTO_BIP", IPPROTO_BIP);
+    PyModule_AddIntMacro(m, IPPROTO_BIP);
 #endif
 /**/
 #ifdef  IPPROTO_RAW
-    PyModule_AddIntConstant(m, "IPPROTO_RAW", IPPROTO_RAW);
+    PyModule_AddIntMacro(m, IPPROTO_RAW);
 #else
     PyModule_AddIntConstant(m, "IPPROTO_RAW", 255);
 #endif
 #ifdef  IPPROTO_MAX
-    PyModule_AddIntConstant(m, "IPPROTO_MAX", IPPROTO_MAX);
+    PyModule_AddIntMacro(m, IPPROTO_MAX);
 #endif
 
 #ifdef  SYSPROTO_CONTROL
-    PyModule_AddIntConstant(m, "SYSPROTO_CONTROL", SYSPROTO_CONTROL);
+    PyModule_AddIntMacro(m, SYSPROTO_CONTROL);
 #endif
 
     /* Some port configuration */
 #ifdef  IPPORT_RESERVED
-    PyModule_AddIntConstant(m, "IPPORT_RESERVED", IPPORT_RESERVED);
+    PyModule_AddIntMacro(m, IPPORT_RESERVED);
 #else
     PyModule_AddIntConstant(m, "IPPORT_RESERVED", 1024);
 #endif
 #ifdef  IPPORT_USERRESERVED
-    PyModule_AddIntConstant(m, "IPPORT_USERRESERVED", IPPORT_USERRESERVED);
+    PyModule_AddIntMacro(m, IPPORT_USERRESERVED);
 #else
     PyModule_AddIntConstant(m, "IPPORT_USERRESERVED", 5000);
 #endif
 
     /* Some reserved IP v.4 addresses */
 #ifdef  INADDR_ANY
-    PyModule_AddIntConstant(m, "INADDR_ANY", INADDR_ANY);
+    PyModule_AddIntMacro(m, INADDR_ANY);
 #else
     PyModule_AddIntConstant(m, "INADDR_ANY", 0x00000000);
 #endif
 #ifdef  INADDR_BROADCAST
-    PyModule_AddIntConstant(m, "INADDR_BROADCAST", INADDR_BROADCAST);
+    PyModule_AddIntMacro(m, INADDR_BROADCAST);
 #else
     PyModule_AddIntConstant(m, "INADDR_BROADCAST", 0xffffffff);
 #endif
 #ifdef  INADDR_LOOPBACK
-    PyModule_AddIntConstant(m, "INADDR_LOOPBACK", INADDR_LOOPBACK);
+    PyModule_AddIntMacro(m, INADDR_LOOPBACK);
 #else
     PyModule_AddIntConstant(m, "INADDR_LOOPBACK", 0x7F000001);
 #endif
 #ifdef  INADDR_UNSPEC_GROUP
-    PyModule_AddIntConstant(m, "INADDR_UNSPEC_GROUP", INADDR_UNSPEC_GROUP);
+    PyModule_AddIntMacro(m, INADDR_UNSPEC_GROUP);
 #else
     PyModule_AddIntConstant(m, "INADDR_UNSPEC_GROUP", 0xe0000000);
 #endif
@@ -6321,354 +6518,353 @@
     PyModule_AddIntConstant(m, "INADDR_ALLHOSTS_GROUP", 0xe0000001);
 #endif
 #ifdef  INADDR_MAX_LOCAL_GROUP
-    PyModule_AddIntConstant(m, "INADDR_MAX_LOCAL_GROUP",
-                            INADDR_MAX_LOCAL_GROUP);
+    PyModule_AddIntMacro(m, INADDR_MAX_LOCAL_GROUP);
 #else
     PyModule_AddIntConstant(m, "INADDR_MAX_LOCAL_GROUP", 0xe00000ff);
 #endif
 #ifdef  INADDR_NONE
-    PyModule_AddIntConstant(m, "INADDR_NONE", INADDR_NONE);
+    PyModule_AddIntMacro(m, INADDR_NONE);
 #else
     PyModule_AddIntConstant(m, "INADDR_NONE", 0xffffffff);
 #endif
 
     /* IPv4 [gs]etsockopt options */
 #ifdef  IP_OPTIONS
-    PyModule_AddIntConstant(m, "IP_OPTIONS", IP_OPTIONS);
+    PyModule_AddIntMacro(m, IP_OPTIONS);
 #endif
 #ifdef  IP_HDRINCL
-    PyModule_AddIntConstant(m, "IP_HDRINCL", IP_HDRINCL);
+    PyModule_AddIntMacro(m, IP_HDRINCL);
 #endif
 #ifdef  IP_TOS
-    PyModule_AddIntConstant(m, "IP_TOS", IP_TOS);
+    PyModule_AddIntMacro(m, IP_TOS);
 #endif
 #ifdef  IP_TTL
-    PyModule_AddIntConstant(m, "IP_TTL", IP_TTL);
+    PyModule_AddIntMacro(m, IP_TTL);
 #endif
 #ifdef  IP_RECVOPTS
-    PyModule_AddIntConstant(m, "IP_RECVOPTS", IP_RECVOPTS);
+    PyModule_AddIntMacro(m, IP_RECVOPTS);
 #endif
 #ifdef  IP_RECVRETOPTS
-    PyModule_AddIntConstant(m, "IP_RECVRETOPTS", IP_RECVRETOPTS);
+    PyModule_AddIntMacro(m, IP_RECVRETOPTS);
 #endif
 #ifdef  IP_RECVDSTADDR
-    PyModule_AddIntConstant(m, "IP_RECVDSTADDR", IP_RECVDSTADDR);
+    PyModule_AddIntMacro(m, IP_RECVDSTADDR);
 #endif
 #ifdef  IP_RETOPTS
-    PyModule_AddIntConstant(m, "IP_RETOPTS", IP_RETOPTS);
+    PyModule_AddIntMacro(m, IP_RETOPTS);
 #endif
 #ifdef  IP_MULTICAST_IF
-    PyModule_AddIntConstant(m, "IP_MULTICAST_IF", IP_MULTICAST_IF);
+    PyModule_AddIntMacro(m, IP_MULTICAST_IF);
 #endif
 #ifdef  IP_MULTICAST_TTL
-    PyModule_AddIntConstant(m, "IP_MULTICAST_TTL", IP_MULTICAST_TTL);
+    PyModule_AddIntMacro(m, IP_MULTICAST_TTL);
 #endif
 #ifdef  IP_MULTICAST_LOOP
-    PyModule_AddIntConstant(m, "IP_MULTICAST_LOOP", IP_MULTICAST_LOOP);
+    PyModule_AddIntMacro(m, IP_MULTICAST_LOOP);
 #endif
 #ifdef  IP_ADD_MEMBERSHIP
-    PyModule_AddIntConstant(m, "IP_ADD_MEMBERSHIP", IP_ADD_MEMBERSHIP);
+    PyModule_AddIntMacro(m, IP_ADD_MEMBERSHIP);
 #endif
 #ifdef  IP_DROP_MEMBERSHIP
-    PyModule_AddIntConstant(m, "IP_DROP_MEMBERSHIP", IP_DROP_MEMBERSHIP);
+    PyModule_AddIntMacro(m, IP_DROP_MEMBERSHIP);
 #endif
 #ifdef  IP_DEFAULT_MULTICAST_TTL
-    PyModule_AddIntConstant(m, "IP_DEFAULT_MULTICAST_TTL",
-                            IP_DEFAULT_MULTICAST_TTL);
+    PyModule_AddIntMacro(m, IP_DEFAULT_MULTICAST_TTL);
 #endif
 #ifdef  IP_DEFAULT_MULTICAST_LOOP
-    PyModule_AddIntConstant(m, "IP_DEFAULT_MULTICAST_LOOP",
-                            IP_DEFAULT_MULTICAST_LOOP);
+    PyModule_AddIntMacro(m, IP_DEFAULT_MULTICAST_LOOP);
 #endif
 #ifdef  IP_MAX_MEMBERSHIPS
-    PyModule_AddIntConstant(m, "IP_MAX_MEMBERSHIPS", IP_MAX_MEMBERSHIPS);
+    PyModule_AddIntMacro(m, IP_MAX_MEMBERSHIPS);
 #endif
 #ifdef  IP_TRANSPARENT
-    PyModule_AddIntConstant(m, "IP_TRANSPARENT", IP_TRANSPARENT);
+    PyModule_AddIntMacro(m, IP_TRANSPARENT);
 #endif
 
     /* IPv6 [gs]etsockopt options, defined in RFC2553 */
 #ifdef  IPV6_JOIN_GROUP
-    PyModule_AddIntConstant(m, "IPV6_JOIN_GROUP", IPV6_JOIN_GROUP);
+    PyModule_AddIntMacro(m, IPV6_JOIN_GROUP);
 #endif
 #ifdef  IPV6_LEAVE_GROUP
-    PyModule_AddIntConstant(m, "IPV6_LEAVE_GROUP", IPV6_LEAVE_GROUP);
+    PyModule_AddIntMacro(m, IPV6_LEAVE_GROUP);
 #endif
 #ifdef  IPV6_MULTICAST_HOPS
-    PyModule_AddIntConstant(m, "IPV6_MULTICAST_HOPS", IPV6_MULTICAST_HOPS);
+    PyModule_AddIntMacro(m, IPV6_MULTICAST_HOPS);
 #endif
 #ifdef  IPV6_MULTICAST_IF
-    PyModule_AddIntConstant(m, "IPV6_MULTICAST_IF", IPV6_MULTICAST_IF);
+    PyModule_AddIntMacro(m, IPV6_MULTICAST_IF);
 #endif
 #ifdef  IPV6_MULTICAST_LOOP
-    PyModule_AddIntConstant(m, "IPV6_MULTICAST_LOOP", IPV6_MULTICAST_LOOP);
+    PyModule_AddIntMacro(m, IPV6_MULTICAST_LOOP);
 #endif
 #ifdef  IPV6_UNICAST_HOPS
-    PyModule_AddIntConstant(m, "IPV6_UNICAST_HOPS", IPV6_UNICAST_HOPS);
+    PyModule_AddIntMacro(m, IPV6_UNICAST_HOPS);
 #endif
     /* Additional IPV6 socket options, defined in RFC 3493 */
 #ifdef IPV6_V6ONLY
-    PyModule_AddIntConstant(m, "IPV6_V6ONLY", IPV6_V6ONLY);
+    PyModule_AddIntMacro(m, IPV6_V6ONLY);
 #endif
     /* Advanced IPV6 socket options, from RFC 3542 */
 #ifdef IPV6_CHECKSUM
-    PyModule_AddIntConstant(m, "IPV6_CHECKSUM", IPV6_CHECKSUM);
+    PyModule_AddIntMacro(m, IPV6_CHECKSUM);
 #endif
 #ifdef IPV6_DONTFRAG
-    PyModule_AddIntConstant(m, "IPV6_DONTFRAG", IPV6_DONTFRAG);
+    PyModule_AddIntMacro(m, IPV6_DONTFRAG);
 #endif
 #ifdef IPV6_DSTOPTS
-    PyModule_AddIntConstant(m, "IPV6_DSTOPTS", IPV6_DSTOPTS);
+    PyModule_AddIntMacro(m, IPV6_DSTOPTS);
 #endif
 #ifdef IPV6_HOPLIMIT
-    PyModule_AddIntConstant(m, "IPV6_HOPLIMIT", IPV6_HOPLIMIT);
+    PyModule_AddIntMacro(m, IPV6_HOPLIMIT);
 #endif
 #ifdef IPV6_HOPOPTS
-    PyModule_AddIntConstant(m, "IPV6_HOPOPTS", IPV6_HOPOPTS);
+    PyModule_AddIntMacro(m, IPV6_HOPOPTS);
 #endif
 #ifdef IPV6_NEXTHOP
-    PyModule_AddIntConstant(m, "IPV6_NEXTHOP", IPV6_NEXTHOP);
+    PyModule_AddIntMacro(m, IPV6_NEXTHOP);
 #endif
 #ifdef IPV6_PATHMTU
-    PyModule_AddIntConstant(m, "IPV6_PATHMTU", IPV6_PATHMTU);
+    PyModule_AddIntMacro(m, IPV6_PATHMTU);
 #endif
 #ifdef IPV6_PKTINFO
-    PyModule_AddIntConstant(m, "IPV6_PKTINFO", IPV6_PKTINFO);
+    PyModule_AddIntMacro(m, IPV6_PKTINFO);
 #endif
 #ifdef IPV6_RECVDSTOPTS
-    PyModule_AddIntConstant(m, "IPV6_RECVDSTOPTS", IPV6_RECVDSTOPTS);
+    PyModule_AddIntMacro(m, IPV6_RECVDSTOPTS);
 #endif
 #ifdef IPV6_RECVHOPLIMIT
-    PyModule_AddIntConstant(m, "IPV6_RECVHOPLIMIT", IPV6_RECVHOPLIMIT);
+    PyModule_AddIntMacro(m, IPV6_RECVHOPLIMIT);
 #endif
 #ifdef IPV6_RECVHOPOPTS
-    PyModule_AddIntConstant(m, "IPV6_RECVHOPOPTS", IPV6_RECVHOPOPTS);
+    PyModule_AddIntMacro(m, IPV6_RECVHOPOPTS);
 #endif
 #ifdef IPV6_RECVPKTINFO
-    PyModule_AddIntConstant(m, "IPV6_RECVPKTINFO", IPV6_RECVPKTINFO);
+    PyModule_AddIntMacro(m, IPV6_RECVPKTINFO);
 #endif
 #ifdef IPV6_RECVRTHDR
-    PyModule_AddIntConstant(m, "IPV6_RECVRTHDR", IPV6_RECVRTHDR);
+    PyModule_AddIntMacro(m, IPV6_RECVRTHDR);
 #endif
 #ifdef IPV6_RECVTCLASS
-    PyModule_AddIntConstant(m, "IPV6_RECVTCLASS", IPV6_RECVTCLASS);
+    PyModule_AddIntMacro(m, IPV6_RECVTCLASS);
 #endif
 #ifdef IPV6_RTHDR
-    PyModule_AddIntConstant(m, "IPV6_RTHDR", IPV6_RTHDR);
+    PyModule_AddIntMacro(m, IPV6_RTHDR);
 #endif
 #ifdef IPV6_RTHDRDSTOPTS
-    PyModule_AddIntConstant(m, "IPV6_RTHDRDSTOPTS", IPV6_RTHDRDSTOPTS);
+    PyModule_AddIntMacro(m, IPV6_RTHDRDSTOPTS);
 #endif
 #ifdef IPV6_RTHDR_TYPE_0
-    PyModule_AddIntConstant(m, "IPV6_RTHDR_TYPE_0", IPV6_RTHDR_TYPE_0);
+    PyModule_AddIntMacro(m, IPV6_RTHDR_TYPE_0);
 #endif
 #ifdef IPV6_RECVPATHMTU
-    PyModule_AddIntConstant(m, "IPV6_RECVPATHMTU", IPV6_RECVPATHMTU);
+    PyModule_AddIntMacro(m, IPV6_RECVPATHMTU);
 #endif
 #ifdef IPV6_TCLASS
-    PyModule_AddIntConstant(m, "IPV6_TCLASS", IPV6_TCLASS);
+    PyModule_AddIntMacro(m, IPV6_TCLASS);
 #endif
 #ifdef IPV6_USE_MIN_MTU
-    PyModule_AddIntConstant(m, "IPV6_USE_MIN_MTU", IPV6_USE_MIN_MTU);
+    PyModule_AddIntMacro(m, IPV6_USE_MIN_MTU);
 #endif
 
     /* TCP options */
 #ifdef  TCP_NODELAY
-    PyModule_AddIntConstant(m, "TCP_NODELAY", TCP_NODELAY);
+    PyModule_AddIntMacro(m, TCP_NODELAY);
 #endif
 #ifdef  TCP_MAXSEG
-    PyModule_AddIntConstant(m, "TCP_MAXSEG", TCP_MAXSEG);
+    PyModule_AddIntMacro(m, TCP_MAXSEG);
 #endif
 #ifdef  TCP_CORK
-    PyModule_AddIntConstant(m, "TCP_CORK", TCP_CORK);
+    PyModule_AddIntMacro(m, TCP_CORK);
 #endif
 #ifdef  TCP_KEEPIDLE
-    PyModule_AddIntConstant(m, "TCP_KEEPIDLE", TCP_KEEPIDLE);
+    PyModule_AddIntMacro(m, TCP_KEEPIDLE);
 #endif
 #ifdef  TCP_KEEPINTVL
-    PyModule_AddIntConstant(m, "TCP_KEEPINTVL", TCP_KEEPINTVL);
+    PyModule_AddIntMacro(m, TCP_KEEPINTVL);
 #endif
 #ifdef  TCP_KEEPCNT
-    PyModule_AddIntConstant(m, "TCP_KEEPCNT", TCP_KEEPCNT);
+    PyModule_AddIntMacro(m, TCP_KEEPCNT);
 #endif
 #ifdef  TCP_SYNCNT
-    PyModule_AddIntConstant(m, "TCP_SYNCNT", TCP_SYNCNT);
+    PyModule_AddIntMacro(m, TCP_SYNCNT);
 #endif
 #ifdef  TCP_LINGER2
-    PyModule_AddIntConstant(m, "TCP_LINGER2", TCP_LINGER2);
+    PyModule_AddIntMacro(m, TCP_LINGER2);
 #endif
 #ifdef  TCP_DEFER_ACCEPT
-    PyModule_AddIntConstant(m, "TCP_DEFER_ACCEPT", TCP_DEFER_ACCEPT);
+    PyModule_AddIntMacro(m, TCP_DEFER_ACCEPT);
 #endif
 #ifdef  TCP_WINDOW_CLAMP
-    PyModule_AddIntConstant(m, "TCP_WINDOW_CLAMP", TCP_WINDOW_CLAMP);
+    PyModule_AddIntMacro(m, TCP_WINDOW_CLAMP);
 #endif
 #ifdef  TCP_INFO
-    PyModule_AddIntConstant(m, "TCP_INFO", TCP_INFO);
+    PyModule_AddIntMacro(m, TCP_INFO);
 #endif
 #ifdef  TCP_QUICKACK
-    PyModule_AddIntConstant(m, "TCP_QUICKACK", TCP_QUICKACK);
+    PyModule_AddIntMacro(m, TCP_QUICKACK);
 #endif
-
+#ifdef  TCP_FASTOPEN
+    PyModule_AddIntMacro(m, TCP_FASTOPEN);
+#endif
 
     /* IPX options */
 #ifdef  IPX_TYPE
-    PyModule_AddIntConstant(m, "IPX_TYPE", IPX_TYPE);
+    PyModule_AddIntMacro(m, IPX_TYPE);
 #endif
 
 /* Reliable Datagram Sockets */
 #ifdef RDS_CMSG_RDMA_ARGS
-    PyModule_AddIntConstant(m, "RDS_CMSG_RDMA_ARGS", RDS_CMSG_RDMA_ARGS);
+    PyModule_AddIntMacro(m, RDS_CMSG_RDMA_ARGS);
 #endif
 #ifdef RDS_CMSG_RDMA_DEST
-    PyModule_AddIntConstant(m, "RDS_CMSG_RDMA_DEST", RDS_CMSG_RDMA_DEST);
+    PyModule_AddIntMacro(m, RDS_CMSG_RDMA_DEST);
 #endif
 #ifdef RDS_CMSG_RDMA_MAP
-    PyModule_AddIntConstant(m, "RDS_CMSG_RDMA_MAP", RDS_CMSG_RDMA_MAP);
+    PyModule_AddIntMacro(m, RDS_CMSG_RDMA_MAP);
 #endif
 #ifdef RDS_CMSG_RDMA_STATUS
-    PyModule_AddIntConstant(m, "RDS_CMSG_RDMA_STATUS", RDS_CMSG_RDMA_STATUS);
+    PyModule_AddIntMacro(m, RDS_CMSG_RDMA_STATUS);
 #endif
 #ifdef RDS_CMSG_RDMA_UPDATE
-    PyModule_AddIntConstant(m, "RDS_CMSG_RDMA_UPDATE", RDS_CMSG_RDMA_UPDATE);
+    PyModule_AddIntMacro(m, RDS_CMSG_RDMA_UPDATE);
 #endif
 #ifdef RDS_RDMA_READWRITE
-    PyModule_AddIntConstant(m, "RDS_RDMA_READWRITE", RDS_RDMA_READWRITE);
+    PyModule_AddIntMacro(m, RDS_RDMA_READWRITE);
 #endif
 #ifdef RDS_RDMA_FENCE
-    PyModule_AddIntConstant(m, "RDS_RDMA_FENCE", RDS_RDMA_FENCE);
+    PyModule_AddIntMacro(m, RDS_RDMA_FENCE);
 #endif
 #ifdef RDS_RDMA_INVALIDATE
-    PyModule_AddIntConstant(m, "RDS_RDMA_INVALIDATE", RDS_RDMA_INVALIDATE);
+    PyModule_AddIntMacro(m, RDS_RDMA_INVALIDATE);
 #endif
 #ifdef RDS_RDMA_USE_ONCE
-    PyModule_AddIntConstant(m, "RDS_RDMA_USE_ONCE", RDS_RDMA_USE_ONCE);
+    PyModule_AddIntMacro(m, RDS_RDMA_USE_ONCE);
 #endif
 #ifdef RDS_RDMA_DONTWAIT
-    PyModule_AddIntConstant(m, "RDS_RDMA_DONTWAIT", RDS_RDMA_DONTWAIT);
+    PyModule_AddIntMacro(m, RDS_RDMA_DONTWAIT);
 #endif
 #ifdef RDS_RDMA_NOTIFY_ME
-    PyModule_AddIntConstant(m, "RDS_RDMA_NOTIFY_ME", RDS_RDMA_NOTIFY_ME);
+    PyModule_AddIntMacro(m, RDS_RDMA_NOTIFY_ME);
 #endif
 #ifdef RDS_RDMA_SILENT
-    PyModule_AddIntConstant(m, "RDS_RDMA_SILENT", RDS_RDMA_SILENT);
+    PyModule_AddIntMacro(m, RDS_RDMA_SILENT);
 #endif
 
     /* get{addr,name}info parameters */
 #ifdef EAI_ADDRFAMILY
-    PyModule_AddIntConstant(m, "EAI_ADDRFAMILY", EAI_ADDRFAMILY);
+    PyModule_AddIntMacro(m, EAI_ADDRFAMILY);
 #endif
 #ifdef EAI_AGAIN
-    PyModule_AddIntConstant(m, "EAI_AGAIN", EAI_AGAIN);
+    PyModule_AddIntMacro(m, EAI_AGAIN);
 #endif
 #ifdef EAI_BADFLAGS
-    PyModule_AddIntConstant(m, "EAI_BADFLAGS", EAI_BADFLAGS);
+    PyModule_AddIntMacro(m, EAI_BADFLAGS);
 #endif
 #ifdef EAI_FAIL
-    PyModule_AddIntConstant(m, "EAI_FAIL", EAI_FAIL);
+    PyModule_AddIntMacro(m, EAI_FAIL);
 #endif
 #ifdef EAI_FAMILY
-    PyModule_AddIntConstant(m, "EAI_FAMILY", EAI_FAMILY);
+    PyModule_AddIntMacro(m, EAI_FAMILY);
 #endif
 #ifdef EAI_MEMORY
-    PyModule_AddIntConstant(m, "EAI_MEMORY", EAI_MEMORY);
+    PyModule_AddIntMacro(m, EAI_MEMORY);
 #endif
 #ifdef EAI_NODATA
-    PyModule_AddIntConstant(m, "EAI_NODATA", EAI_NODATA);
+    PyModule_AddIntMacro(m, EAI_NODATA);
 #endif
 #ifdef EAI_NONAME
-    PyModule_AddIntConstant(m, "EAI_NONAME", EAI_NONAME);
+    PyModule_AddIntMacro(m, EAI_NONAME);
 #endif
 #ifdef EAI_OVERFLOW
-    PyModule_AddIntConstant(m, "EAI_OVERFLOW", EAI_OVERFLOW);
+    PyModule_AddIntMacro(m, EAI_OVERFLOW);
 #endif
 #ifdef EAI_SERVICE
-    PyModule_AddIntConstant(m, "EAI_SERVICE", EAI_SERVICE);
+    PyModule_AddIntMacro(m, EAI_SERVICE);
 #endif
 #ifdef EAI_SOCKTYPE
-    PyModule_AddIntConstant(m, "EAI_SOCKTYPE", EAI_SOCKTYPE);
+    PyModule_AddIntMacro(m, EAI_SOCKTYPE);
 #endif
 #ifdef EAI_SYSTEM
-    PyModule_AddIntConstant(m, "EAI_SYSTEM", EAI_SYSTEM);
+    PyModule_AddIntMacro(m, EAI_SYSTEM);
 #endif
 #ifdef EAI_BADHINTS
-    PyModule_AddIntConstant(m, "EAI_BADHINTS", EAI_BADHINTS);
+    PyModule_AddIntMacro(m, EAI_BADHINTS);
 #endif
 #ifdef EAI_PROTOCOL
-    PyModule_AddIntConstant(m, "EAI_PROTOCOL", EAI_PROTOCOL);
+    PyModule_AddIntMacro(m, EAI_PROTOCOL);
 #endif
 #ifdef EAI_MAX
-    PyModule_AddIntConstant(m, "EAI_MAX", EAI_MAX);
+    PyModule_AddIntMacro(m, EAI_MAX);
 #endif
 #ifdef AI_PASSIVE
-    PyModule_AddIntConstant(m, "AI_PASSIVE", AI_PASSIVE);
+    PyModule_AddIntMacro(m, AI_PASSIVE);
 #endif
 #ifdef AI_CANONNAME
-    PyModule_AddIntConstant(m, "AI_CANONNAME", AI_CANONNAME);
+    PyModule_AddIntMacro(m, AI_CANONNAME);
 #endif
 #ifdef AI_NUMERICHOST
-    PyModule_AddIntConstant(m, "AI_NUMERICHOST", AI_NUMERICHOST);
+    PyModule_AddIntMacro(m, AI_NUMERICHOST);
 #endif
 #ifdef AI_NUMERICSERV
-    PyModule_AddIntConstant(m, "AI_NUMERICSERV", AI_NUMERICSERV);
+    PyModule_AddIntMacro(m, AI_NUMERICSERV);
 #endif
 #ifdef AI_MASK
-    PyModule_AddIntConstant(m, "AI_MASK", AI_MASK);
+    PyModule_AddIntMacro(m, AI_MASK);
 #endif
 #ifdef AI_ALL
-    PyModule_AddIntConstant(m, "AI_ALL", AI_ALL);
+    PyModule_AddIntMacro(m, AI_ALL);
 #endif
 #ifdef AI_V4MAPPED_CFG
-    PyModule_AddIntConstant(m, "AI_V4MAPPED_CFG", AI_V4MAPPED_CFG);
+    PyModule_AddIntMacro(m, AI_V4MAPPED_CFG);
 #endif
 #ifdef AI_ADDRCONFIG
-    PyModule_AddIntConstant(m, "AI_ADDRCONFIG", AI_ADDRCONFIG);
+    PyModule_AddIntMacro(m, AI_ADDRCONFIG);
 #endif
 #ifdef AI_V4MAPPED
-    PyModule_AddIntConstant(m, "AI_V4MAPPED", AI_V4MAPPED);
+    PyModule_AddIntMacro(m, AI_V4MAPPED);
 #endif
 #ifdef AI_DEFAULT
-    PyModule_AddIntConstant(m, "AI_DEFAULT", AI_DEFAULT);
+    PyModule_AddIntMacro(m, AI_DEFAULT);
 #endif
 #ifdef NI_MAXHOST
-    PyModule_AddIntConstant(m, "NI_MAXHOST", NI_MAXHOST);
+    PyModule_AddIntMacro(m, NI_MAXHOST);
 #endif
 #ifdef NI_MAXSERV
-    PyModule_AddIntConstant(m, "NI_MAXSERV", NI_MAXSERV);
+    PyModule_AddIntMacro(m, NI_MAXSERV);
 #endif
 #ifdef NI_NOFQDN
-    PyModule_AddIntConstant(m, "NI_NOFQDN", NI_NOFQDN);
+    PyModule_AddIntMacro(m, NI_NOFQDN);
 #endif
 #ifdef NI_NUMERICHOST
-    PyModule_AddIntConstant(m, "NI_NUMERICHOST", NI_NUMERICHOST);
+    PyModule_AddIntMacro(m, NI_NUMERICHOST);
 #endif
 #ifdef NI_NAMEREQD
-    PyModule_AddIntConstant(m, "NI_NAMEREQD", NI_NAMEREQD);
+    PyModule_AddIntMacro(m, NI_NAMEREQD);
 #endif
 #ifdef NI_NUMERICSERV
-    PyModule_AddIntConstant(m, "NI_NUMERICSERV", NI_NUMERICSERV);
+    PyModule_AddIntMacro(m, NI_NUMERICSERV);
 #endif
 #ifdef NI_DGRAM
-    PyModule_AddIntConstant(m, "NI_DGRAM", NI_DGRAM);
+    PyModule_AddIntMacro(m, NI_DGRAM);
 #endif
 
     /* shutdown() parameters */
 #ifdef SHUT_RD
-    PyModule_AddIntConstant(m, "SHUT_RD", SHUT_RD);
+    PyModule_AddIntMacro(m, SHUT_RD);
 #elif defined(SD_RECEIVE)
     PyModule_AddIntConstant(m, "SHUT_RD", SD_RECEIVE);
 #else
     PyModule_AddIntConstant(m, "SHUT_RD", 0);
 #endif
 #ifdef SHUT_WR
-    PyModule_AddIntConstant(m, "SHUT_WR", SHUT_WR);
+    PyModule_AddIntMacro(m, SHUT_WR);
 #elif defined(SD_SEND)
     PyModule_AddIntConstant(m, "SHUT_WR", SD_SEND);
 #else
     PyModule_AddIntConstant(m, "SHUT_WR", 1);
 #endif
 #ifdef SHUT_RDWR
-    PyModule_AddIntConstant(m, "SHUT_RDWR", SHUT_RDWR);
+    PyModule_AddIntMacro(m, SHUT_RDWR);
 #elif defined(SD_BOTH)
     PyModule_AddIntConstant(m, "SHUT_RDWR", SD_BOTH);
 #else
@@ -6688,14 +6884,14 @@
             PyModule_AddObject(m, names[i], tmp);
         }
     }
-    PyModule_AddIntConstant(m, "RCVALL_OFF", RCVALL_OFF);
-    PyModule_AddIntConstant(m, "RCVALL_ON", RCVALL_ON);
-    PyModule_AddIntConstant(m, "RCVALL_SOCKETLEVELONLY", RCVALL_SOCKETLEVELONLY);
+    PyModule_AddIntMacro(m, RCVALL_OFF);
+    PyModule_AddIntMacro(m, RCVALL_ON);
+    PyModule_AddIntMacro(m, RCVALL_SOCKETLEVELONLY);
 #ifdef RCVALL_IPLEVEL
-    PyModule_AddIntConstant(m, "RCVALL_IPLEVEL", RCVALL_IPLEVEL);
+    PyModule_AddIntMacro(m, RCVALL_IPLEVEL);
 #endif
 #ifdef RCVALL_MAX
-    PyModule_AddIntConstant(m, "RCVALL_MAX", RCVALL_MAX);
+    PyModule_AddIntMacro(m, RCVALL_MAX);
 #endif
 #endif /* _MSTCPIP_ */
 
diff --git a/Modules/socketmodule.h b/Modules/socketmodule.h
index 0435878..b83f9af 100644
--- a/Modules/socketmodule.h
+++ b/Modules/socketmodule.h
@@ -8,7 +8,7 @@
 #   include <sys/socket.h>
 # endif
 # include <netinet/in.h>
-# if !(defined(__CYGWIN__) || (defined(PYOS_OS2) && defined(PYCC_VACPP)))
+# if !defined(__CYGWIN__)
 #  include <netinet/tcp.h>
 # endif
 
@@ -80,6 +80,10 @@
 #include <linux/can/raw.h>
 #endif
 
+#ifdef HAVE_LINUX_CAN_BCM_H
+#include <linux/can/bcm.h>
+#endif
+
 #ifdef HAVE_SYS_SYS_DOMAIN_H
 #include <sys/sys_domain.h>
 #endif
diff --git a/Modules/spwdmodule.c b/Modules/spwdmodule.c
index 194ae19..68ea1b5 100644
--- a/Modules/spwdmodule.c
+++ b/Modules/spwdmodule.c
@@ -26,22 +26,24 @@
 #if defined(HAVE_GETSPNAM) || defined(HAVE_GETSPENT)
 
 static PyStructSequence_Field struct_spwd_type_fields[] = {
-    {"sp_nam", "login name"},
-    {"sp_pwd", "encrypted password"},
+    {"sp_namp", "login name"},
+    {"sp_pwdp", "encrypted password"},
     {"sp_lstchg", "date of last change"},
     {"sp_min", "min #days between changes"},
     {"sp_max", "max #days between changes"},
     {"sp_warn", "#days before pw expires to warn user about it"},
-    {"sp_inact", "#days after pw expires until account is blocked"},
-    {"sp_expire", "#days since 1970-01-01 until account is disabled"},
+    {"sp_inact", "#days after pw expires until account is disabled"},
+    {"sp_expire", "#days since 1970-01-01 when account expires"},
     {"sp_flag", "reserved"},
+    {"sp_nam", "login name; deprecated"}, /* Backward compatibility */
+    {"sp_pwd", "encrypted password; deprecated"}, /* Backward compatibility */
     {0}
 };
 
 PyDoc_STRVAR(struct_spwd__doc__,
 "spwd.struct_spwd: Results from getsp*() routines.\n\n\
 This object may be accessed either as a 9-tuple of\n\
-  (sp_nam,sp_pwd,sp_lstchg,sp_min,sp_max,sp_warn,sp_inact,sp_expire,sp_flag)\n\
+  (sp_namp,sp_pwdp,sp_lstchg,sp_min,sp_max,sp_warn,sp_inact,sp_expire,sp_flag)\n\
 or via the object attributes as named in the above tuple.");
 
 static PyStructSequence_Desc struct_spwd_type_desc = {
@@ -86,6 +88,8 @@
     SETI(setIndex++, p->sp_inact);
     SETI(setIndex++, p->sp_expire);
     SETI(setIndex++, p->sp_flag);
+    SETS(setIndex++, p->sp_namp); /* Backward compatibility for sp_nam */
+    SETS(setIndex++, p->sp_pwdp); /* Backward compatibility for sp_pwd */
 
 #undef SETS
 #undef SETI
@@ -196,9 +200,11 @@
     m=PyModule_Create(&spwdmodule);
     if (m == NULL)
         return NULL;
-    if (!initialized)
-        PyStructSequence_InitType(&StructSpwdType,
-                                  &struct_spwd_type_desc);
+    if (!initialized) {
+        if (PyStructSequence_InitType2(&StructSpwdType,
+                                       &struct_spwd_type_desc) < 0)
+            return NULL;
+    }
     Py_INCREF((PyObject *) &StructSpwdType);
     PyModule_AddObject(m, "struct_spwd", (PyObject *) &StructSpwdType);
     initialized = 1;
diff --git a/Modules/sre.h b/Modules/sre.h
index 0a8f0cf..42fe28d 100644
--- a/Modules/sre.h
+++ b/Modules/sre.h
@@ -31,9 +31,7 @@
     PyObject* pattern; /* pattern source (or None) */
     int flags; /* flags used when compiling pattern source */
     PyObject *weakreflist; /* List of weak references */
-    int logical_charsize; /* pattern charsize (or -1) */
-    int charsize;
-    Py_buffer view;
+    int isbytes; /* pattern type (1 - bytes, 0 - string, -1 - None) */
     /* pattern code */
     Py_ssize_t codesize;
     SRE_CODE code[1];
@@ -73,9 +71,8 @@
     /* attributes for the match object */
     PyObject* string;
     Py_ssize_t pos, endpos;
-    /* character size */
-    int logical_charsize; /* kind of thing: 1 - bytes, 2/4 - unicode */
-    int charsize;
+    int isbytes;
+    int charsize; /* character size */
     /* registers */
     Py_ssize_t lastindex;
     Py_ssize_t lastmark;
diff --git a/Modules/sre_constants.h b/Modules/sre_constants.h
index 13c8958..5940d5a 100644
--- a/Modules/sre_constants.h
+++ b/Modules/sre_constants.h
@@ -81,6 +81,8 @@
 #define SRE_FLAG_DOTALL 16
 #define SRE_FLAG_UNICODE 32
 #define SRE_FLAG_VERBOSE 64
+#define SRE_FLAG_DEBUG 128
+#define SRE_FLAG_ASCII 256
 #define SRE_INFO_PREFIX 1
 #define SRE_INFO_LITERAL 2
 #define SRE_INFO_CHARSET 4
diff --git a/Modules/sre_lib.h b/Modules/sre_lib.h
new file mode 100644
index 0000000..5c6c5a5
--- /dev/null
+++ b/Modules/sre_lib.h
@@ -0,0 +1,1343 @@
+/*
+ * Secret Labs' Regular Expression Engine
+ *
+ * regular expression matching engine
+ *
+ * Copyright (c) 1997-2001 by Secret Labs AB.  All rights reserved.
+ *
+ * See the _sre.c file for information on usage and redistribution.
+ */
+
+/* String matching engine */
+
+/* This file is included three times, with different character settings */
+
+LOCAL(int)
+SRE(at)(SRE_STATE* state, SRE_CHAR* ptr, SRE_CODE at)
+{
+    /* check if pointer is at given position */
+
+    Py_ssize_t thisp, thatp;
+
+    switch (at) {
+
+    case SRE_AT_BEGINNING:
+    case SRE_AT_BEGINNING_STRING:
+        return ((void*) ptr == state->beginning);
+
+    case SRE_AT_BEGINNING_LINE:
+        return ((void*) ptr == state->beginning ||
+                SRE_IS_LINEBREAK((int) ptr[-1]));
+
+    case SRE_AT_END:
+        return (((void*) (ptr+1) == state->end &&
+                 SRE_IS_LINEBREAK((int) ptr[0])) ||
+                ((void*) ptr == state->end));
+
+    case SRE_AT_END_LINE:
+        return ((void*) ptr == state->end ||
+                SRE_IS_LINEBREAK((int) ptr[0]));
+
+    case SRE_AT_END_STRING:
+        return ((void*) ptr == state->end);
+
+    case SRE_AT_BOUNDARY:
+        if (state->beginning == state->end)
+            return 0;
+        thatp = ((void*) ptr > state->beginning) ?
+            SRE_IS_WORD((int) ptr[-1]) : 0;
+        thisp = ((void*) ptr < state->end) ?
+            SRE_IS_WORD((int) ptr[0]) : 0;
+        return thisp != thatp;
+
+    case SRE_AT_NON_BOUNDARY:
+        if (state->beginning == state->end)
+            return 0;
+        thatp = ((void*) ptr > state->beginning) ?
+            SRE_IS_WORD((int) ptr[-1]) : 0;
+        thisp = ((void*) ptr < state->end) ?
+            SRE_IS_WORD((int) ptr[0]) : 0;
+        return thisp == thatp;
+
+    case SRE_AT_LOC_BOUNDARY:
+        if (state->beginning == state->end)
+            return 0;
+        thatp = ((void*) ptr > state->beginning) ?
+            SRE_LOC_IS_WORD((int) ptr[-1]) : 0;
+        thisp = ((void*) ptr < state->end) ?
+            SRE_LOC_IS_WORD((int) ptr[0]) : 0;
+        return thisp != thatp;
+
+    case SRE_AT_LOC_NON_BOUNDARY:
+        if (state->beginning == state->end)
+            return 0;
+        thatp = ((void*) ptr > state->beginning) ?
+            SRE_LOC_IS_WORD((int) ptr[-1]) : 0;
+        thisp = ((void*) ptr < state->end) ?
+            SRE_LOC_IS_WORD((int) ptr[0]) : 0;
+        return thisp == thatp;
+
+    case SRE_AT_UNI_BOUNDARY:
+        if (state->beginning == state->end)
+            return 0;
+        thatp = ((void*) ptr > state->beginning) ?
+            SRE_UNI_IS_WORD((int) ptr[-1]) : 0;
+        thisp = ((void*) ptr < state->end) ?
+            SRE_UNI_IS_WORD((int) ptr[0]) : 0;
+        return thisp != thatp;
+
+    case SRE_AT_UNI_NON_BOUNDARY:
+        if (state->beginning == state->end)
+            return 0;
+        thatp = ((void*) ptr > state->beginning) ?
+            SRE_UNI_IS_WORD((int) ptr[-1]) : 0;
+        thisp = ((void*) ptr < state->end) ?
+            SRE_UNI_IS_WORD((int) ptr[0]) : 0;
+        return thisp == thatp;
+
+    }
+
+    return 0;
+}
+
+LOCAL(int)
+SRE(charset)(SRE_CODE* set, SRE_CODE ch)
+{
+    /* check if character is a member of the given set */
+
+    int ok = 1;
+
+    for (;;) {
+        switch (*set++) {
+
+        case SRE_OP_FAILURE:
+            return !ok;
+
+        case SRE_OP_LITERAL:
+            /* <LITERAL> <code> */
+            if (ch == set[0])
+                return ok;
+            set++;
+            break;
+
+        case SRE_OP_CATEGORY:
+            /* <CATEGORY> <code> */
+            if (sre_category(set[0], (int) ch))
+                return ok;
+            set++;
+            break;
+
+        case SRE_OP_CHARSET:
+            /* <CHARSET> <bitmap> */
+            if (ch < 256 &&
+                (set[ch/SRE_CODE_BITS] & (1u << (ch & (SRE_CODE_BITS-1)))))
+                return ok;
+            set += 256/SRE_CODE_BITS;
+            break;
+
+        case SRE_OP_RANGE:
+            /* <RANGE> <lower> <upper> */
+            if (set[0] <= ch && ch <= set[1])
+                return ok;
+            set += 2;
+            break;
+
+        case SRE_OP_NEGATE:
+            ok = !ok;
+            break;
+
+        case SRE_OP_BIGCHARSET:
+            /* <BIGCHARSET> <blockcount> <256 blockindices> <blocks> */
+        {
+            Py_ssize_t count, block;
+            count = *(set++);
+
+            if (ch < 0x10000u)
+                block = ((unsigned char*)set)[ch >> 8];
+            else
+                block = -1;
+            set += 256/sizeof(SRE_CODE);
+            if (block >=0 &&
+                (set[(block * 256 + (ch & 255))/SRE_CODE_BITS] &
+                    (1u << (ch & (SRE_CODE_BITS-1)))))
+                return ok;
+            set += count * (256/SRE_CODE_BITS);
+            break;
+        }
+
+        default:
+            /* internal error -- there's not much we can do about it
+               here, so let's just pretend it didn't match... */
+            return 0;
+        }
+    }
+}
+
+LOCAL(Py_ssize_t) SRE(match)(SRE_STATE* state, SRE_CODE* pattern, int match_all);
+
+LOCAL(Py_ssize_t)
+SRE(count)(SRE_STATE* state, SRE_CODE* pattern, Py_ssize_t maxcount)
+{
+    SRE_CODE chr;
+    SRE_CHAR c;
+    SRE_CHAR* ptr = (SRE_CHAR *)state->ptr;
+    SRE_CHAR* end = (SRE_CHAR *)state->end;
+    Py_ssize_t i;
+
+    /* adjust end */
+    if (maxcount < end - ptr && maxcount != SRE_MAXREPEAT)
+        end = ptr + maxcount;
+
+    switch (pattern[0]) {
+
+    case SRE_OP_IN:
+        /* repeated set */
+        TRACE(("|%p|%p|COUNT IN\n", pattern, ptr));
+        while (ptr < end && SRE(charset)(pattern + 2, *ptr))
+            ptr++;
+        break;
+
+    case SRE_OP_ANY:
+        /* repeated dot wildcard. */
+        TRACE(("|%p|%p|COUNT ANY\n", pattern, ptr));
+        while (ptr < end && !SRE_IS_LINEBREAK(*ptr))
+            ptr++;
+        break;
+
+    case SRE_OP_ANY_ALL:
+        /* repeated dot wildcard.  skip to the end of the target
+           string, and backtrack from there */
+        TRACE(("|%p|%p|COUNT ANY_ALL\n", pattern, ptr));
+        ptr = end;
+        break;
+
+    case SRE_OP_LITERAL:
+        /* repeated literal */
+        chr = pattern[1];
+        TRACE(("|%p|%p|COUNT LITERAL %d\n", pattern, ptr, chr));
+        c = (SRE_CHAR) chr;
+#if SIZEOF_SRE_CHAR < 4
+        if ((SRE_CODE) c != chr)
+            ; /* literal can't match: doesn't fit in char width */
+        else
+#endif
+        while (ptr < end && *ptr == c)
+            ptr++;
+        break;
+
+    case SRE_OP_LITERAL_IGNORE:
+        /* repeated literal */
+        chr = pattern[1];
+        TRACE(("|%p|%p|COUNT LITERAL_IGNORE %d\n", pattern, ptr, chr));
+        while (ptr < end && (SRE_CODE) state->lower(*ptr) == chr)
+            ptr++;
+        break;
+
+    case SRE_OP_NOT_LITERAL:
+        /* repeated non-literal */
+        chr = pattern[1];
+        TRACE(("|%p|%p|COUNT NOT_LITERAL %d\n", pattern, ptr, chr));
+        c = (SRE_CHAR) chr;
+#if SIZEOF_SRE_CHAR < 4
+        if ((SRE_CODE) c != chr)
+            ptr = end; /* literal can't match: doesn't fit in char width */
+        else
+#endif
+        while (ptr < end && *ptr != c)
+            ptr++;
+        break;
+
+    case SRE_OP_NOT_LITERAL_IGNORE:
+        /* repeated non-literal */
+        chr = pattern[1];
+        TRACE(("|%p|%p|COUNT NOT_LITERAL_IGNORE %d\n", pattern, ptr, chr));
+        while (ptr < end && (SRE_CODE) state->lower(*ptr) != chr)
+            ptr++;
+        break;
+
+    default:
+        /* repeated single character pattern */
+        TRACE(("|%p|%p|COUNT SUBPATTERN\n", pattern, ptr));
+        while ((SRE_CHAR*) state->ptr < end) {
+            i = SRE(match)(state, pattern, 0);
+            if (i < 0)
+                return i;
+            if (!i)
+                break;
+        }
+        TRACE(("|%p|%p|COUNT %" PY_FORMAT_SIZE_T "d\n", pattern, ptr,
+               (SRE_CHAR*) state->ptr - ptr));
+        return (SRE_CHAR*) state->ptr - ptr;
+    }
+
+    TRACE(("|%p|%p|COUNT %" PY_FORMAT_SIZE_T "d\n", pattern, ptr,
+           ptr - (SRE_CHAR*) state->ptr));
+    return ptr - (SRE_CHAR*) state->ptr;
+}
+
+#if 0 /* not used in this release */
+LOCAL(int)
+SRE(info)(SRE_STATE* state, SRE_CODE* pattern)
+{
+    /* check if an SRE_OP_INFO block matches at the current position.
+       returns the number of SRE_CODE objects to skip if successful, 0
+       if no match */
+
+    SRE_CHAR* end = (SRE_CHAR*) state->end;
+    SRE_CHAR* ptr = (SRE_CHAR*) state->ptr;
+    Py_ssize_t i;
+
+    /* check minimal length */
+    if (pattern[3] && end - ptr < pattern[3])
+        return 0;
+
+    /* check known prefix */
+    if (pattern[2] & SRE_INFO_PREFIX && pattern[5] > 1) {
+        /* <length> <skip> <prefix data> <overlap data> */
+        for (i = 0; i < pattern[5]; i++)
+            if ((SRE_CODE) ptr[i] != pattern[7 + i])
+                return 0;
+        return pattern[0] + 2 * pattern[6];
+    }
+    return pattern[0];
+}
+#endif
+
+/* The macros below should be used to protect recursive SRE(match)()
+ * calls that *failed* and do *not* return immediately (IOW, those
+ * that will backtrack). Explaining:
+ *
+ * - Recursive SRE(match)() returned true: that's usually a success
+ *   (besides atypical cases like ASSERT_NOT), therefore there's no
+ *   reason to restore lastmark;
+ *
+ * - Recursive SRE(match)() returned false but the current SRE(match)()
+ *   is returning to the caller: If the current SRE(match)() is the
+ *   top function of the recursion, returning false will be a matching
+ *   failure, and it doesn't matter where lastmark is pointing to.
+ *   If it's *not* the top function, it will be a recursive SRE(match)()
+ *   failure by itself, and the calling SRE(match)() will have to deal
+ *   with the failure by the same rules explained here (it will restore
+ *   lastmark by itself if necessary);
+ *
+ * - Recursive SRE(match)() returned false, and will continue the
+ *   outside 'for' loop: must be protected when breaking, since the next
+ *   OP could potentially depend on lastmark;
+ *
+ * - Recursive SRE(match)() returned false, and will be called again
+ *   inside a local for/while loop: must be protected between each
+ *   loop iteration, since the recursive SRE(match)() could do anything,
+ *   and could potentially depend on lastmark.
+ *
+ * For more information, check the discussion at SF patch #712900.
+ */
+#define LASTMARK_SAVE()     \
+    do { \
+        ctx->lastmark = state->lastmark; \
+        ctx->lastindex = state->lastindex; \
+    } while (0)
+#define LASTMARK_RESTORE()  \
+    do { \
+        state->lastmark = ctx->lastmark; \
+        state->lastindex = ctx->lastindex; \
+    } while (0)
+
+#define RETURN_ERROR(i) do { return i; } while(0)
+#define RETURN_FAILURE do { ret = 0; goto exit; } while(0)
+#define RETURN_SUCCESS do { ret = 1; goto exit; } while(0)
+
+#define RETURN_ON_ERROR(i) \
+    do { if (i < 0) RETURN_ERROR(i); } while (0)
+#define RETURN_ON_SUCCESS(i) \
+    do { RETURN_ON_ERROR(i); if (i > 0) RETURN_SUCCESS; } while (0)
+#define RETURN_ON_FAILURE(i) \
+    do { RETURN_ON_ERROR(i); if (i == 0) RETURN_FAILURE; } while (0)
+
+#define SFY(x) #x
+
+#define DATA_STACK_ALLOC(state, type, ptr) \
+do { \
+    alloc_pos = state->data_stack_base; \
+    TRACE(("allocating %s in %" PY_FORMAT_SIZE_T "d " \
+           "(%" PY_FORMAT_SIZE_T "d)\n", \
+           SFY(type), alloc_pos, sizeof(type))); \
+    if (sizeof(type) > state->data_stack_size - alloc_pos) { \
+        int j = data_stack_grow(state, sizeof(type)); \
+        if (j < 0) return j; \
+        if (ctx_pos != -1) \
+            DATA_STACK_LOOKUP_AT(state, SRE(match_context), ctx, ctx_pos); \
+    } \
+    ptr = (type*)(state->data_stack+alloc_pos); \
+    state->data_stack_base += sizeof(type); \
+} while (0)
+
+#define DATA_STACK_LOOKUP_AT(state, type, ptr, pos) \
+do { \
+    TRACE(("looking up %s at %" PY_FORMAT_SIZE_T "d\n", SFY(type), pos)); \
+    ptr = (type*)(state->data_stack+pos); \
+} while (0)
+
+#define DATA_STACK_PUSH(state, data, size) \
+do { \
+    TRACE(("copy data in %p to %" PY_FORMAT_SIZE_T "d " \
+           "(%" PY_FORMAT_SIZE_T "d)\n", \
+           data, state->data_stack_base, size)); \
+    if (size > state->data_stack_size - state->data_stack_base) { \
+        int j = data_stack_grow(state, size); \
+        if (j < 0) return j; \
+        if (ctx_pos != -1) \
+            DATA_STACK_LOOKUP_AT(state, SRE(match_context), ctx, ctx_pos); \
+    } \
+    memcpy(state->data_stack+state->data_stack_base, data, size); \
+    state->data_stack_base += size; \
+} while (0)
+
+#define DATA_STACK_POP(state, data, size, discard) \
+do { \
+    TRACE(("copy data to %p from %" PY_FORMAT_SIZE_T "d " \
+           "(%" PY_FORMAT_SIZE_T "d)\n", \
+           data, state->data_stack_base-size, size)); \
+    memcpy(data, state->data_stack+state->data_stack_base-size, size); \
+    if (discard) \
+        state->data_stack_base -= size; \
+} while (0)
+
+#define DATA_STACK_POP_DISCARD(state, size) \
+do { \
+    TRACE(("discard data from %" PY_FORMAT_SIZE_T "d " \
+           "(%" PY_FORMAT_SIZE_T "d)\n", \
+           state->data_stack_base-size, size)); \
+    state->data_stack_base -= size; \
+} while(0)
+
+#define DATA_PUSH(x) \
+    DATA_STACK_PUSH(state, (x), sizeof(*(x)))
+#define DATA_POP(x) \
+    DATA_STACK_POP(state, (x), sizeof(*(x)), 1)
+#define DATA_POP_DISCARD(x) \
+    DATA_STACK_POP_DISCARD(state, sizeof(*(x)))
+#define DATA_ALLOC(t,p) \
+    DATA_STACK_ALLOC(state, t, p)
+#define DATA_LOOKUP_AT(t,p,pos) \
+    DATA_STACK_LOOKUP_AT(state,t,p,pos)
+
+#define MARK_PUSH(lastmark) \
+    do if (lastmark > 0) { \
+        i = lastmark; /* ctx->lastmark may change if reallocated */ \
+        DATA_STACK_PUSH(state, state->mark, (i+1)*sizeof(void*)); \
+    } while (0)
+#define MARK_POP(lastmark) \
+    do if (lastmark > 0) { \
+        DATA_STACK_POP(state, state->mark, (lastmark+1)*sizeof(void*), 1); \
+    } while (0)
+#define MARK_POP_KEEP(lastmark) \
+    do if (lastmark > 0) { \
+        DATA_STACK_POP(state, state->mark, (lastmark+1)*sizeof(void*), 0); \
+    } while (0)
+#define MARK_POP_DISCARD(lastmark) \
+    do if (lastmark > 0) { \
+        DATA_STACK_POP_DISCARD(state, (lastmark+1)*sizeof(void*)); \
+    } while (0)
+
+#define JUMP_NONE            0
+#define JUMP_MAX_UNTIL_1     1
+#define JUMP_MAX_UNTIL_2     2
+#define JUMP_MAX_UNTIL_3     3
+#define JUMP_MIN_UNTIL_1     4
+#define JUMP_MIN_UNTIL_2     5
+#define JUMP_MIN_UNTIL_3     6
+#define JUMP_REPEAT          7
+#define JUMP_REPEAT_ONE_1    8
+#define JUMP_REPEAT_ONE_2    9
+#define JUMP_MIN_REPEAT_ONE  10
+#define JUMP_BRANCH          11
+#define JUMP_ASSERT          12
+#define JUMP_ASSERT_NOT      13
+
+#define DO_JUMPX(jumpvalue, jumplabel, nextpattern, matchall) \
+    DATA_ALLOC(SRE(match_context), nextctx); \
+    nextctx->last_ctx_pos = ctx_pos; \
+    nextctx->jump = jumpvalue; \
+    nextctx->pattern = nextpattern; \
+    nextctx->match_all = matchall; \
+    ctx_pos = alloc_pos; \
+    ctx = nextctx; \
+    goto entrance; \
+    jumplabel: \
+    while (0) /* gcc doesn't like labels at end of scopes */ \
+
+#define DO_JUMP(jumpvalue, jumplabel, nextpattern) \
+    DO_JUMPX(jumpvalue, jumplabel, nextpattern, ctx->match_all)
+
+#define DO_JUMP0(jumpvalue, jumplabel, nextpattern) \
+    DO_JUMPX(jumpvalue, jumplabel, nextpattern, 0)
+
+typedef struct {
+    Py_ssize_t last_ctx_pos;
+    Py_ssize_t jump;
+    SRE_CHAR* ptr;
+    SRE_CODE* pattern;
+    Py_ssize_t count;
+    Py_ssize_t lastmark;
+    Py_ssize_t lastindex;
+    union {
+        SRE_CODE chr;
+        SRE_REPEAT* rep;
+    } u;
+    int match_all;
+} SRE(match_context);
+
+/* check if string matches the given pattern.  returns <0 for
+   error, 0 for failure, and 1 for success */
+LOCAL(Py_ssize_t)
+SRE(match)(SRE_STATE* state, SRE_CODE* pattern, int match_all)
+{
+    SRE_CHAR* end = (SRE_CHAR *)state->end;
+    Py_ssize_t alloc_pos, ctx_pos = -1;
+    Py_ssize_t i, ret = 0;
+    Py_ssize_t jump;
+    unsigned int sigcount=0;
+
+    SRE(match_context)* ctx;
+    SRE(match_context)* nextctx;
+
+    TRACE(("|%p|%p|ENTER\n", pattern, state->ptr));
+
+    DATA_ALLOC(SRE(match_context), ctx);
+    ctx->last_ctx_pos = -1;
+    ctx->jump = JUMP_NONE;
+    ctx->pattern = pattern;
+    ctx->match_all = match_all;
+    ctx_pos = alloc_pos;
+
+entrance:
+
+    ctx->ptr = (SRE_CHAR *)state->ptr;
+
+    if (ctx->pattern[0] == SRE_OP_INFO) {
+        /* optimization info block */
+        /* <INFO> <1=skip> <2=flags> <3=min> ... */
+        if (ctx->pattern[3] && (Py_uintptr_t)(end - ctx->ptr) < ctx->pattern[3]) {
+            TRACE(("reject (got %" PY_FORMAT_SIZE_T "d chars, "
+                   "need %" PY_FORMAT_SIZE_T "d)\n",
+                   end - ctx->ptr, (Py_ssize_t) ctx->pattern[3]));
+            RETURN_FAILURE;
+        }
+        ctx->pattern += ctx->pattern[1] + 1;
+    }
+
+    for (;;) {
+        ++sigcount;
+        if ((0 == (sigcount & 0xfff)) && PyErr_CheckSignals())
+            RETURN_ERROR(SRE_ERROR_INTERRUPTED);
+
+        switch (*ctx->pattern++) {
+
+        case SRE_OP_MARK:
+            /* set mark */
+            /* <MARK> <gid> */
+            TRACE(("|%p|%p|MARK %d\n", ctx->pattern,
+                   ctx->ptr, ctx->pattern[0]));
+            i = ctx->pattern[0];
+            if (i & 1)
+                state->lastindex = i/2 + 1;
+            if (i > state->lastmark) {
+                /* state->lastmark is the highest valid index in the
+                   state->mark array.  If it is increased by more than 1,
+                   the intervening marks must be set to NULL to signal
+                   that these marks have not been encountered. */
+                Py_ssize_t j = state->lastmark + 1;
+                while (j < i)
+                    state->mark[j++] = NULL;
+                state->lastmark = i;
+            }
+            state->mark[i] = ctx->ptr;
+            ctx->pattern++;
+            break;
+
+        case SRE_OP_LITERAL:
+            /* match literal string */
+            /* <LITERAL> <code> */
+            TRACE(("|%p|%p|LITERAL %d\n", ctx->pattern,
+                   ctx->ptr, *ctx->pattern));
+            if (ctx->ptr >= end || (SRE_CODE) ctx->ptr[0] != ctx->pattern[0])
+                RETURN_FAILURE;
+            ctx->pattern++;
+            ctx->ptr++;
+            break;
+
+        case SRE_OP_NOT_LITERAL:
+            /* match anything that is not literal character */
+            /* <NOT_LITERAL> <code> */
+            TRACE(("|%p|%p|NOT_LITERAL %d\n", ctx->pattern,
+                   ctx->ptr, *ctx->pattern));
+            if (ctx->ptr >= end || (SRE_CODE) ctx->ptr[0] == ctx->pattern[0])
+                RETURN_FAILURE;
+            ctx->pattern++;
+            ctx->ptr++;
+            break;
+
+        case SRE_OP_SUCCESS:
+            /* end of pattern */
+            TRACE(("|%p|%p|SUCCESS\n", ctx->pattern, ctx->ptr));
+            if (!ctx->match_all || ctx->ptr == state->end) {
+                state->ptr = ctx->ptr;
+                RETURN_SUCCESS;
+            }
+            RETURN_FAILURE;
+
+        case SRE_OP_AT:
+            /* match at given position */
+            /* <AT> <code> */
+            TRACE(("|%p|%p|AT %d\n", ctx->pattern, ctx->ptr, *ctx->pattern));
+            if (!SRE(at)(state, ctx->ptr, *ctx->pattern))
+                RETURN_FAILURE;
+            ctx->pattern++;
+            break;
+
+        case SRE_OP_CATEGORY:
+            /* match at given category */
+            /* <CATEGORY> <code> */
+            TRACE(("|%p|%p|CATEGORY %d\n", ctx->pattern,
+                   ctx->ptr, *ctx->pattern));
+            if (ctx->ptr >= end || !sre_category(ctx->pattern[0], ctx->ptr[0]))
+                RETURN_FAILURE;
+            ctx->pattern++;
+            ctx->ptr++;
+            break;
+
+        case SRE_OP_ANY:
+            /* match anything (except a newline) */
+            /* <ANY> */
+            TRACE(("|%p|%p|ANY\n", ctx->pattern, ctx->ptr));
+            if (ctx->ptr >= end || SRE_IS_LINEBREAK(ctx->ptr[0]))
+                RETURN_FAILURE;
+            ctx->ptr++;
+            break;
+
+        case SRE_OP_ANY_ALL:
+            /* match anything */
+            /* <ANY_ALL> */
+            TRACE(("|%p|%p|ANY_ALL\n", ctx->pattern, ctx->ptr));
+            if (ctx->ptr >= end)
+                RETURN_FAILURE;
+            ctx->ptr++;
+            break;
+
+        case SRE_OP_IN:
+            /* match set member (or non_member) */
+            /* <IN> <skip> <set> */
+            TRACE(("|%p|%p|IN\n", ctx->pattern, ctx->ptr));
+            if (ctx->ptr >= end || !SRE(charset)(ctx->pattern + 1, *ctx->ptr))
+                RETURN_FAILURE;
+            ctx->pattern += ctx->pattern[0];
+            ctx->ptr++;
+            break;
+
+        case SRE_OP_LITERAL_IGNORE:
+            TRACE(("|%p|%p|LITERAL_IGNORE %d\n",
+                   ctx->pattern, ctx->ptr, ctx->pattern[0]));
+            if (ctx->ptr >= end ||
+                state->lower(*ctx->ptr) != state->lower(*ctx->pattern))
+                RETURN_FAILURE;
+            ctx->pattern++;
+            ctx->ptr++;
+            break;
+
+        case SRE_OP_NOT_LITERAL_IGNORE:
+            TRACE(("|%p|%p|NOT_LITERAL_IGNORE %d\n",
+                   ctx->pattern, ctx->ptr, *ctx->pattern));
+            if (ctx->ptr >= end ||
+                state->lower(*ctx->ptr) == state->lower(*ctx->pattern))
+                RETURN_FAILURE;
+            ctx->pattern++;
+            ctx->ptr++;
+            break;
+
+        case SRE_OP_IN_IGNORE:
+            TRACE(("|%p|%p|IN_IGNORE\n", ctx->pattern, ctx->ptr));
+            if (ctx->ptr >= end
+                || !SRE(charset)(ctx->pattern+1,
+                                 (SRE_CODE)state->lower(*ctx->ptr)))
+                RETURN_FAILURE;
+            ctx->pattern += ctx->pattern[0];
+            ctx->ptr++;
+            break;
+
+        case SRE_OP_JUMP:
+        case SRE_OP_INFO:
+            /* jump forward */
+            /* <JUMP> <offset> */
+            TRACE(("|%p|%p|JUMP %d\n", ctx->pattern,
+                   ctx->ptr, ctx->pattern[0]));
+            ctx->pattern += ctx->pattern[0];
+            break;
+
+        case SRE_OP_BRANCH:
+            /* alternation */
+            /* <BRANCH> <0=skip> code <JUMP> ... <NULL> */
+            TRACE(("|%p|%p|BRANCH\n", ctx->pattern, ctx->ptr));
+            LASTMARK_SAVE();
+            ctx->u.rep = state->repeat;
+            if (ctx->u.rep)
+                MARK_PUSH(ctx->lastmark);
+            for (; ctx->pattern[0]; ctx->pattern += ctx->pattern[0]) {
+                if (ctx->pattern[1] == SRE_OP_LITERAL &&
+                    (ctx->ptr >= end ||
+                     (SRE_CODE) *ctx->ptr != ctx->pattern[2]))
+                    continue;
+                if (ctx->pattern[1] == SRE_OP_IN &&
+                    (ctx->ptr >= end ||
+                     !SRE(charset)(ctx->pattern + 3, (SRE_CODE) *ctx->ptr)))
+                    continue;
+                state->ptr = ctx->ptr;
+                DO_JUMP(JUMP_BRANCH, jump_branch, ctx->pattern+1);
+                if (ret) {
+                    if (ctx->u.rep)
+                        MARK_POP_DISCARD(ctx->lastmark);
+                    RETURN_ON_ERROR(ret);
+                    RETURN_SUCCESS;
+                }
+                if (ctx->u.rep)
+                    MARK_POP_KEEP(ctx->lastmark);
+                LASTMARK_RESTORE();
+            }
+            if (ctx->u.rep)
+                MARK_POP_DISCARD(ctx->lastmark);
+            RETURN_FAILURE;
+
+        case SRE_OP_REPEAT_ONE:
+            /* match repeated sequence (maximizing regexp) */
+
+            /* this operator only works if the repeated item is
+               exactly one character wide, and we're not already
+               collecting backtracking points.  for other cases,
+               use the MAX_REPEAT operator */
+
+            /* <REPEAT_ONE> <skip> <1=min> <2=max> item <SUCCESS> tail */
+
+            TRACE(("|%p|%p|REPEAT_ONE %d %d\n", ctx->pattern, ctx->ptr,
+                   ctx->pattern[1], ctx->pattern[2]));
+
+            if ((Py_ssize_t) ctx->pattern[1] > end - ctx->ptr)
+                RETURN_FAILURE; /* cannot match */
+
+            state->ptr = ctx->ptr;
+
+            ret = SRE(count)(state, ctx->pattern+3, ctx->pattern[2]);
+            RETURN_ON_ERROR(ret);
+            DATA_LOOKUP_AT(SRE(match_context), ctx, ctx_pos);
+            ctx->count = ret;
+            ctx->ptr += ctx->count;
+
+            /* when we arrive here, count contains the number of
+               matches, and ctx->ptr points to the tail of the target
+               string.  check if the rest of the pattern matches,
+               and backtrack if not. */
+
+            if (ctx->count < (Py_ssize_t) ctx->pattern[1])
+                RETURN_FAILURE;
+
+            if (ctx->pattern[ctx->pattern[0]] == SRE_OP_SUCCESS &&
+                ctx->ptr == state->end) {
+                /* tail is empty.  we're finished */
+                state->ptr = ctx->ptr;
+                RETURN_SUCCESS;
+            }
+
+            LASTMARK_SAVE();
+
+            if (ctx->pattern[ctx->pattern[0]] == SRE_OP_LITERAL) {
+                /* tail starts with a literal. skip positions where
+                   the rest of the pattern cannot possibly match */
+                ctx->u.chr = ctx->pattern[ctx->pattern[0]+1];
+                for (;;) {
+                    while (ctx->count >= (Py_ssize_t) ctx->pattern[1] &&
+                           (ctx->ptr >= end || *ctx->ptr != ctx->u.chr)) {
+                        ctx->ptr--;
+                        ctx->count--;
+                    }
+                    if (ctx->count < (Py_ssize_t) ctx->pattern[1])
+                        break;
+                    state->ptr = ctx->ptr;
+                    DO_JUMP(JUMP_REPEAT_ONE_1, jump_repeat_one_1,
+                            ctx->pattern+ctx->pattern[0]);
+                    if (ret) {
+                        RETURN_ON_ERROR(ret);
+                        RETURN_SUCCESS;
+                    }
+
+                    LASTMARK_RESTORE();
+
+                    ctx->ptr--;
+                    ctx->count--;
+                }
+
+            } else {
+                /* general case */
+                while (ctx->count >= (Py_ssize_t) ctx->pattern[1]) {
+                    state->ptr = ctx->ptr;
+                    DO_JUMP(JUMP_REPEAT_ONE_2, jump_repeat_one_2,
+                            ctx->pattern+ctx->pattern[0]);
+                    if (ret) {
+                        RETURN_ON_ERROR(ret);
+                        RETURN_SUCCESS;
+                    }
+                    ctx->ptr--;
+                    ctx->count--;
+                    LASTMARK_RESTORE();
+                }
+            }
+            RETURN_FAILURE;
+
+        case SRE_OP_MIN_REPEAT_ONE:
+            /* match repeated sequence (minimizing regexp) */
+
+            /* this operator only works if the repeated item is
+               exactly one character wide, and we're not already
+               collecting backtracking points.  for other cases,
+               use the MIN_REPEAT operator */
+
+            /* <MIN_REPEAT_ONE> <skip> <1=min> <2=max> item <SUCCESS> tail */
+
+            TRACE(("|%p|%p|MIN_REPEAT_ONE %d %d\n", ctx->pattern, ctx->ptr,
+                   ctx->pattern[1], ctx->pattern[2]));
+
+            if ((Py_ssize_t) ctx->pattern[1] > end - ctx->ptr)
+                RETURN_FAILURE; /* cannot match */
+
+            state->ptr = ctx->ptr;
+
+            if (ctx->pattern[1] == 0)
+                ctx->count = 0;
+            else {
+                /* count using pattern min as the maximum */
+                ret = SRE(count)(state, ctx->pattern+3, ctx->pattern[1]);
+                RETURN_ON_ERROR(ret);
+                DATA_LOOKUP_AT(SRE(match_context), ctx, ctx_pos);
+                if (ret < (Py_ssize_t) ctx->pattern[1])
+                    /* didn't match minimum number of times */
+                    RETURN_FAILURE;
+                /* advance past minimum matches of repeat */
+                ctx->count = ret;
+                ctx->ptr += ctx->count;
+            }
+
+            if (ctx->pattern[ctx->pattern[0]] == SRE_OP_SUCCESS &&
+                (!match_all || ctx->ptr == state->end)) {
+                /* tail is empty.  we're finished */
+                state->ptr = ctx->ptr;
+                RETURN_SUCCESS;
+
+            } else {
+                /* general case */
+                LASTMARK_SAVE();
+                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,
+                            ctx->pattern+ctx->pattern[0]);
+                    if (ret) {
+                        RETURN_ON_ERROR(ret);
+                        RETURN_SUCCESS;
+                    }
+                    state->ptr = ctx->ptr;
+                    ret = SRE(count)(state, ctx->pattern+3, 1);
+                    RETURN_ON_ERROR(ret);
+                    DATA_LOOKUP_AT(SRE(match_context), ctx, ctx_pos);
+                    if (ret == 0)
+                        break;
+                    assert(ret == 1);
+                    ctx->ptr++;
+                    ctx->count++;
+                    LASTMARK_RESTORE();
+                }
+            }
+            RETURN_FAILURE;
+
+        case SRE_OP_REPEAT:
+            /* create repeat context.  all the hard work is done
+               by the UNTIL operator (MAX_UNTIL, MIN_UNTIL) */
+            /* <REPEAT> <skip> <1=min> <2=max> item <UNTIL> tail */
+            TRACE(("|%p|%p|REPEAT %d %d\n", ctx->pattern, ctx->ptr,
+                   ctx->pattern[1], ctx->pattern[2]));
+
+            /* install new repeat context */
+            ctx->u.rep = (SRE_REPEAT*) PyObject_MALLOC(sizeof(*ctx->u.rep));
+            if (!ctx->u.rep) {
+                PyErr_NoMemory();
+                RETURN_FAILURE;
+            }
+            ctx->u.rep->count = -1;
+            ctx->u.rep->pattern = ctx->pattern;
+            ctx->u.rep->prev = state->repeat;
+            ctx->u.rep->last_ptr = NULL;
+            state->repeat = ctx->u.rep;
+
+            state->ptr = ctx->ptr;
+            DO_JUMP(JUMP_REPEAT, jump_repeat, ctx->pattern+ctx->pattern[0]);
+            state->repeat = ctx->u.rep->prev;
+            PyObject_FREE(ctx->u.rep);
+
+            if (ret) {
+                RETURN_ON_ERROR(ret);
+                RETURN_SUCCESS;
+            }
+            RETURN_FAILURE;
+
+        case SRE_OP_MAX_UNTIL:
+            /* maximizing repeat */
+            /* <REPEAT> <skip> <1=min> <2=max> item <MAX_UNTIL> tail */
+
+            /* FIXME: we probably need to deal with zero-width
+               matches in here... */
+
+            ctx->u.rep = state->repeat;
+            if (!ctx->u.rep)
+                RETURN_ERROR(SRE_ERROR_STATE);
+
+            state->ptr = ctx->ptr;
+
+            ctx->count = ctx->u.rep->count+1;
+
+            TRACE(("|%p|%p|MAX_UNTIL %" PY_FORMAT_SIZE_T "d\n", ctx->pattern,
+                   ctx->ptr, ctx->count));
+
+            if (ctx->count < (Py_ssize_t) ctx->u.rep->pattern[1]) {
+                /* not enough matches */
+                ctx->u.rep->count = ctx->count;
+                DO_JUMP(JUMP_MAX_UNTIL_1, jump_max_until_1,
+                        ctx->u.rep->pattern+3);
+                if (ret) {
+                    RETURN_ON_ERROR(ret);
+                    RETURN_SUCCESS;
+                }
+                ctx->u.rep->count = ctx->count-1;
+                state->ptr = ctx->ptr;
+                RETURN_FAILURE;
+            }
+
+            if ((ctx->count < (Py_ssize_t) ctx->u.rep->pattern[2] ||
+                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 */
+                ctx->u.rep->count = ctx->count;
+                LASTMARK_SAVE();
+                MARK_PUSH(ctx->lastmark);
+                /* zero-width match protection */
+                DATA_PUSH(&ctx->u.rep->last_ptr);
+                ctx->u.rep->last_ptr = state->ptr;
+                DO_JUMP(JUMP_MAX_UNTIL_2, jump_max_until_2,
+                        ctx->u.rep->pattern+3);
+                DATA_POP(&ctx->u.rep->last_ptr);
+                if (ret) {
+                    MARK_POP_DISCARD(ctx->lastmark);
+                    RETURN_ON_ERROR(ret);
+                    RETURN_SUCCESS;
+                }
+                MARK_POP(ctx->lastmark);
+                LASTMARK_RESTORE();
+                ctx->u.rep->count = ctx->count-1;
+                state->ptr = ctx->ptr;
+            }
+
+            /* cannot match more repeated items here.  make sure the
+               tail matches */
+            state->repeat = ctx->u.rep->prev;
+            DO_JUMP(JUMP_MAX_UNTIL_3, jump_max_until_3, ctx->pattern);
+            RETURN_ON_SUCCESS(ret);
+            state->repeat = ctx->u.rep;
+            state->ptr = ctx->ptr;
+            RETURN_FAILURE;
+
+        case SRE_OP_MIN_UNTIL:
+            /* minimizing repeat */
+            /* <REPEAT> <skip> <1=min> <2=max> item <MIN_UNTIL> tail */
+
+            ctx->u.rep = state->repeat;
+            if (!ctx->u.rep)
+                RETURN_ERROR(SRE_ERROR_STATE);
+
+            state->ptr = ctx->ptr;
+
+            ctx->count = ctx->u.rep->count+1;
+
+            TRACE(("|%p|%p|MIN_UNTIL %" PY_FORMAT_SIZE_T "d %p\n", ctx->pattern,
+                   ctx->ptr, ctx->count, ctx->u.rep->pattern));
+
+            if (ctx->count < (Py_ssize_t) ctx->u.rep->pattern[1]) {
+                /* not enough matches */
+                ctx->u.rep->count = ctx->count;
+                DO_JUMP(JUMP_MIN_UNTIL_1, jump_min_until_1,
+                        ctx->u.rep->pattern+3);
+                if (ret) {
+                    RETURN_ON_ERROR(ret);
+                    RETURN_SUCCESS;
+                }
+                ctx->u.rep->count = ctx->count-1;
+                state->ptr = ctx->ptr;
+                RETURN_FAILURE;
+            }
+
+            LASTMARK_SAVE();
+
+            /* see if the tail matches */
+            state->repeat = ctx->u.rep->prev;
+            DO_JUMP(JUMP_MIN_UNTIL_2, jump_min_until_2, ctx->pattern);
+            if (ret) {
+                RETURN_ON_ERROR(ret);
+                RETURN_SUCCESS;
+            }
+
+            state->repeat = ctx->u.rep;
+            state->ptr = ctx->ptr;
+
+            LASTMARK_RESTORE();
+
+            if ((ctx->count >= (Py_ssize_t) 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;
+            }
+            ctx->u.rep->count = ctx->count-1;
+            state->ptr = ctx->ptr;
+            RETURN_FAILURE;
+
+        case SRE_OP_GROUPREF:
+            /* match backreference */
+            TRACE(("|%p|%p|GROUPREF %d\n", ctx->pattern,
+                   ctx->ptr, ctx->pattern[0]));
+            i = ctx->pattern[0];
+            {
+                Py_ssize_t groupref = i+i;
+                if (groupref >= state->lastmark) {
+                    RETURN_FAILURE;
+                } else {
+                    SRE_CHAR* p = (SRE_CHAR*) state->mark[groupref];
+                    SRE_CHAR* e = (SRE_CHAR*) state->mark[groupref+1];
+                    if (!p || !e || e < p)
+                        RETURN_FAILURE;
+                    while (p < e) {
+                        if (ctx->ptr >= end || *ctx->ptr != *p)
+                            RETURN_FAILURE;
+                        p++;
+                        ctx->ptr++;
+                    }
+                }
+            }
+            ctx->pattern++;
+            break;
+
+        case SRE_OP_GROUPREF_IGNORE:
+            /* match backreference */
+            TRACE(("|%p|%p|GROUPREF_IGNORE %d\n", ctx->pattern,
+                   ctx->ptr, ctx->pattern[0]));
+            i = ctx->pattern[0];
+            {
+                Py_ssize_t groupref = i+i;
+                if (groupref >= state->lastmark) {
+                    RETURN_FAILURE;
+                } else {
+                    SRE_CHAR* p = (SRE_CHAR*) state->mark[groupref];
+                    SRE_CHAR* e = (SRE_CHAR*) state->mark[groupref+1];
+                    if (!p || !e || e < p)
+                        RETURN_FAILURE;
+                    while (p < e) {
+                        if (ctx->ptr >= end ||
+                            state->lower(*ctx->ptr) != state->lower(*p))
+                            RETURN_FAILURE;
+                        p++;
+                        ctx->ptr++;
+                    }
+                }
+            }
+            ctx->pattern++;
+            break;
+
+        case SRE_OP_GROUPREF_EXISTS:
+            TRACE(("|%p|%p|GROUPREF_EXISTS %d\n", ctx->pattern,
+                   ctx->ptr, ctx->pattern[0]));
+            /* <GROUPREF_EXISTS> <group> <skip> codeyes <JUMP> codeno ... */
+            i = ctx->pattern[0];
+            {
+                Py_ssize_t groupref = i+i;
+                if (groupref >= state->lastmark) {
+                    ctx->pattern += ctx->pattern[1];
+                    break;
+                } else {
+                    SRE_CHAR* p = (SRE_CHAR*) state->mark[groupref];
+                    SRE_CHAR* e = (SRE_CHAR*) state->mark[groupref+1];
+                    if (!p || !e || e < p) {
+                        ctx->pattern += ctx->pattern[1];
+                        break;
+                    }
+                }
+            }
+            ctx->pattern += 2;
+            break;
+
+        case SRE_OP_ASSERT:
+            /* assert subpattern */
+            /* <ASSERT> <skip> <back> <pattern> */
+            TRACE(("|%p|%p|ASSERT %d\n", ctx->pattern,
+                   ctx->ptr, ctx->pattern[1]));
+            state->ptr = ctx->ptr - ctx->pattern[1];
+            if (state->ptr < state->beginning)
+                RETURN_FAILURE;
+            DO_JUMP0(JUMP_ASSERT, jump_assert, ctx->pattern+2);
+            RETURN_ON_FAILURE(ret);
+            ctx->pattern += ctx->pattern[0];
+            break;
+
+        case SRE_OP_ASSERT_NOT:
+            /* assert not subpattern */
+            /* <ASSERT_NOT> <skip> <back> <pattern> */
+            TRACE(("|%p|%p|ASSERT_NOT %d\n", ctx->pattern,
+                   ctx->ptr, ctx->pattern[1]));
+            state->ptr = ctx->ptr - ctx->pattern[1];
+            if (state->ptr >= state->beginning) {
+                DO_JUMP0(JUMP_ASSERT_NOT, jump_assert_not, ctx->pattern+2);
+                if (ret) {
+                    RETURN_ON_ERROR(ret);
+                    RETURN_FAILURE;
+                }
+            }
+            ctx->pattern += ctx->pattern[0];
+            break;
+
+        case SRE_OP_FAILURE:
+            /* immediate failure */
+            TRACE(("|%p|%p|FAILURE\n", ctx->pattern, ctx->ptr));
+            RETURN_FAILURE;
+
+        default:
+            TRACE(("|%p|%p|UNKNOWN %d\n", ctx->pattern, ctx->ptr,
+                   ctx->pattern[-1]));
+            RETURN_ERROR(SRE_ERROR_ILLEGAL);
+        }
+    }
+
+exit:
+    ctx_pos = ctx->last_ctx_pos;
+    jump = ctx->jump;
+    DATA_POP_DISCARD(ctx);
+    if (ctx_pos == -1)
+        return ret;
+    DATA_LOOKUP_AT(SRE(match_context), ctx, ctx_pos);
+
+    switch (jump) {
+        case JUMP_MAX_UNTIL_2:
+            TRACE(("|%p|%p|JUMP_MAX_UNTIL_2\n", ctx->pattern, ctx->ptr));
+            goto jump_max_until_2;
+        case JUMP_MAX_UNTIL_3:
+            TRACE(("|%p|%p|JUMP_MAX_UNTIL_3\n", ctx->pattern, ctx->ptr));
+            goto jump_max_until_3;
+        case JUMP_MIN_UNTIL_2:
+            TRACE(("|%p|%p|JUMP_MIN_UNTIL_2\n", ctx->pattern, ctx->ptr));
+            goto jump_min_until_2;
+        case JUMP_MIN_UNTIL_3:
+            TRACE(("|%p|%p|JUMP_MIN_UNTIL_3\n", ctx->pattern, ctx->ptr));
+            goto jump_min_until_3;
+        case JUMP_BRANCH:
+            TRACE(("|%p|%p|JUMP_BRANCH\n", ctx->pattern, ctx->ptr));
+            goto jump_branch;
+        case JUMP_MAX_UNTIL_1:
+            TRACE(("|%p|%p|JUMP_MAX_UNTIL_1\n", ctx->pattern, ctx->ptr));
+            goto jump_max_until_1;
+        case JUMP_MIN_UNTIL_1:
+            TRACE(("|%p|%p|JUMP_MIN_UNTIL_1\n", ctx->pattern, ctx->ptr));
+            goto jump_min_until_1;
+        case JUMP_REPEAT:
+            TRACE(("|%p|%p|JUMP_REPEAT\n", ctx->pattern, ctx->ptr));
+            goto jump_repeat;
+        case JUMP_REPEAT_ONE_1:
+            TRACE(("|%p|%p|JUMP_REPEAT_ONE_1\n", ctx->pattern, ctx->ptr));
+            goto jump_repeat_one_1;
+        case JUMP_REPEAT_ONE_2:
+            TRACE(("|%p|%p|JUMP_REPEAT_ONE_2\n", ctx->pattern, ctx->ptr));
+            goto jump_repeat_one_2;
+        case JUMP_MIN_REPEAT_ONE:
+            TRACE(("|%p|%p|JUMP_MIN_REPEAT_ONE\n", ctx->pattern, ctx->ptr));
+            goto jump_min_repeat_one;
+        case JUMP_ASSERT:
+            TRACE(("|%p|%p|JUMP_ASSERT\n", ctx->pattern, ctx->ptr));
+            goto jump_assert;
+        case JUMP_ASSERT_NOT:
+            TRACE(("|%p|%p|JUMP_ASSERT_NOT\n", ctx->pattern, ctx->ptr));
+            goto jump_assert_not;
+        case JUMP_NONE:
+            TRACE(("|%p|%p|RETURN %" PY_FORMAT_SIZE_T "d\n", ctx->pattern,
+                   ctx->ptr, ret));
+            break;
+    }
+
+    return ret; /* should never get here */
+}
+
+LOCAL(Py_ssize_t)
+SRE(search)(SRE_STATE* state, SRE_CODE* pattern)
+{
+    SRE_CHAR* ptr = (SRE_CHAR *)state->start;
+    SRE_CHAR* end = (SRE_CHAR *)state->end;
+    Py_ssize_t status = 0;
+    Py_ssize_t prefix_len = 0;
+    Py_ssize_t prefix_skip = 0;
+    SRE_CODE* prefix = NULL;
+    SRE_CODE* charset = NULL;
+    SRE_CODE* overlap = NULL;
+    int flags = 0;
+
+    if (pattern[0] == SRE_OP_INFO) {
+        /* optimization info block */
+        /* <INFO> <1=skip> <2=flags> <3=min> <4=max> <5=prefix info>  */
+
+        flags = pattern[2];
+
+        if (pattern[3] > 1) {
+            /* adjust end point (but make sure we leave at least one
+               character in there, so literal search will work) */
+            end -= pattern[3] - 1;
+            if (end <= ptr)
+                end = ptr;
+        }
+
+        if (flags & SRE_INFO_PREFIX) {
+            /* pattern starts with a known prefix */
+            /* <length> <skip> <prefix data> <overlap data> */
+            prefix_len = pattern[5];
+            prefix_skip = pattern[6];
+            prefix = pattern + 7;
+            overlap = prefix + prefix_len - 1;
+        } else if (flags & SRE_INFO_CHARSET)
+            /* pattern starts with a character from a known set */
+            /* <charset> */
+            charset = pattern + 5;
+
+        pattern += 1 + pattern[1];
+    }
+
+    TRACE(("prefix = %p %" PY_FORMAT_SIZE_T "d %" PY_FORMAT_SIZE_T "d\n",
+           prefix, prefix_len, prefix_skip));
+    TRACE(("charset = %p\n", charset));
+
+#if defined(USE_FAST_SEARCH)
+    if (prefix_len > 1) {
+        /* pattern starts with a known prefix.  use the overlap
+           table to skip forward as fast as we possibly can */
+        Py_ssize_t i = 0;
+
+        end = (SRE_CHAR *)state->end;
+        if (prefix_len > end - ptr)
+            return 0;
+#if SIZEOF_SRE_CHAR < 4
+        for (i = 0; i < prefix_len; i++)
+            if ((SRE_CODE)(SRE_CHAR) prefix[i] != prefix[i])
+                return 0; /* literal can't match: doesn't fit in char width */
+#endif
+        while (ptr < end) {
+            SRE_CHAR c = (SRE_CHAR) prefix[0];
+            while (*ptr++ != c) {
+                if (ptr >= end)
+                    return 0;
+            }
+            if (ptr >= end)
+                return 0;
+
+            i = 1;
+            do {
+                if (*ptr == (SRE_CHAR) prefix[i]) {
+                    if (++i != prefix_len) {
+                        if (++ptr >= end)
+                            return 0;
+                        continue;
+                    }
+                    /* found a potential match */
+                    TRACE(("|%p|%p|SEARCH SCAN\n", pattern, ptr));
+                    state->start = ptr - (prefix_len - 1);
+                    state->ptr = ptr - (prefix_len - prefix_skip - 1);
+                    if (flags & SRE_INFO_LITERAL)
+                        return 1; /* we got all of it */
+                    status = SRE(match)(state, pattern + 2*prefix_skip, 0);
+                    if (status != 0)
+                        return status;
+                    /* close but no cigar -- try again */
+                    if (++ptr >= end)
+                        return 0;
+                }
+                i = overlap[i];
+            } while (i != 0);
+        }
+        return 0;
+    }
+#endif
+
+    if (pattern[0] == SRE_OP_LITERAL) {
+        /* pattern starts with a literal character.  this is used
+           for short prefixes, and if fast search is disabled */
+        SRE_CHAR c = (SRE_CHAR) pattern[1];
+#if SIZEOF_SRE_CHAR < 4
+        if ((SRE_CODE) c != pattern[1])
+            return 0; /* literal can't match: doesn't fit in char width */
+#endif
+        end = (SRE_CHAR *)state->end;
+        while (ptr < end) {
+            while (*ptr != c) {
+                if (++ptr >= end)
+                    return 0;
+            }
+            TRACE(("|%p|%p|SEARCH LITERAL\n", pattern, ptr));
+            state->start = ptr;
+            state->ptr = ++ptr;
+            if (flags & SRE_INFO_LITERAL)
+                return 1; /* we got all of it */
+            status = SRE(match)(state, pattern + 2, 0);
+            if (status != 0)
+                break;
+        }
+    } else if (charset) {
+        /* pattern starts with a character from a known set */
+        end = (SRE_CHAR *)state->end;
+        for (;;) {
+            while (ptr < end && !SRE(charset)(charset, *ptr))
+                ptr++;
+            if (ptr >= end)
+                return 0;
+            TRACE(("|%p|%p|SEARCH CHARSET\n", pattern, ptr));
+            state->start = ptr;
+            state->ptr = ptr;
+            status = SRE(match)(state, pattern, 0);
+            if (status != 0)
+                break;
+            ptr++;
+        }
+    } else
+        /* general case */
+        while (ptr <= end) {
+            TRACE(("|%p|%p|SEARCH\n", pattern, ptr));
+            state->start = state->ptr = ptr++;
+            status = SRE(match)(state, pattern, 0);
+            if (status != 0)
+                break;
+        }
+
+    return status;
+}
+
+#undef SRE_CHAR
+#undef SIZEOF_SRE_CHAR
+#undef SRE
+
+/* vim:ts=4:sw=4:et
+*/
diff --git a/Modules/symtablemodule.c b/Modules/symtablemodule.c
index 37df82d..cdb4ffc 100644
--- a/Modules/symtablemodule.c
+++ b/Modules/symtablemodule.c
@@ -11,12 +11,12 @@
     PyObject *t;
 
     char *str;
-    char *filename;
+    PyObject *filename;
     char *startstr;
     int start;
 
-    if (!PyArg_ParseTuple(args, "sss:symtable", &str, &filename,
-                          &startstr))
+    if (!PyArg_ParseTuple(args, "sO&s:symtable",
+                          &str, PyUnicode_FSDecoder, &filename, &startstr))
         return NULL;
     if (strcmp(startstr, "exec") == 0)
         start = Py_file_input;
@@ -27,9 +27,11 @@
     else {
         PyErr_SetString(PyExc_ValueError,
            "symtable() arg 3 must be 'exec' or 'eval' or 'single'");
+        Py_DECREF(filename);
         return NULL;
     }
-    st = Py_SymtableString(str, filename, start);
+    st = Py_SymtableStringObject(str, filename, start);
+    Py_DECREF(filename);
     if (st == NULL)
         return NULL;
     t = (PyObject *)st->st_top;
@@ -69,30 +71,30 @@
     m = PyModule_Create(&symtablemodule);
     if (m == NULL)
         return NULL;
-    PyModule_AddIntConstant(m, "USE", USE);
-    PyModule_AddIntConstant(m, "DEF_GLOBAL", DEF_GLOBAL);
-    PyModule_AddIntConstant(m, "DEF_LOCAL", DEF_LOCAL);
-    PyModule_AddIntConstant(m, "DEF_PARAM", DEF_PARAM);
-    PyModule_AddIntConstant(m, "DEF_FREE", DEF_FREE);
-    PyModule_AddIntConstant(m, "DEF_FREE_CLASS", DEF_FREE_CLASS);
-    PyModule_AddIntConstant(m, "DEF_IMPORT", DEF_IMPORT);
-    PyModule_AddIntConstant(m, "DEF_BOUND", DEF_BOUND);
+    PyModule_AddIntMacro(m, USE);
+    PyModule_AddIntMacro(m, DEF_GLOBAL);
+    PyModule_AddIntMacro(m, DEF_LOCAL);
+    PyModule_AddIntMacro(m, DEF_PARAM);
+    PyModule_AddIntMacro(m, DEF_FREE);
+    PyModule_AddIntMacro(m, DEF_FREE_CLASS);
+    PyModule_AddIntMacro(m, DEF_IMPORT);
+    PyModule_AddIntMacro(m, DEF_BOUND);
 
     PyModule_AddIntConstant(m, "TYPE_FUNCTION", FunctionBlock);
     PyModule_AddIntConstant(m, "TYPE_CLASS", ClassBlock);
     PyModule_AddIntConstant(m, "TYPE_MODULE", ModuleBlock);
 
-    PyModule_AddIntConstant(m, "OPT_IMPORT_STAR", OPT_IMPORT_STAR);
-    PyModule_AddIntConstant(m, "OPT_TOPLEVEL", OPT_TOPLEVEL);
+    PyModule_AddIntMacro(m, OPT_IMPORT_STAR);
+    PyModule_AddIntMacro(m, OPT_TOPLEVEL);
 
-    PyModule_AddIntConstant(m, "LOCAL", LOCAL);
-    PyModule_AddIntConstant(m, "GLOBAL_EXPLICIT", GLOBAL_EXPLICIT);
-    PyModule_AddIntConstant(m, "GLOBAL_IMPLICIT", GLOBAL_IMPLICIT);
-    PyModule_AddIntConstant(m, "FREE", FREE);
-    PyModule_AddIntConstant(m, "CELL", CELL);
+    PyModule_AddIntMacro(m, LOCAL);
+    PyModule_AddIntMacro(m, GLOBAL_EXPLICIT);
+    PyModule_AddIntMacro(m, GLOBAL_IMPLICIT);
+    PyModule_AddIntMacro(m, FREE);
+    PyModule_AddIntMacro(m, CELL);
 
     PyModule_AddIntConstant(m, "SCOPE_OFF", SCOPE_OFFSET);
-    PyModule_AddIntConstant(m, "SCOPE_MASK", SCOPE_MASK);
+    PyModule_AddIntMacro(m, SCOPE_MASK);
 
     if (PyErr_Occurred()) {
         Py_DECREF(m);
diff --git a/Modules/syslogmodule.c b/Modules/syslogmodule.c
index fc3f375..f2d44ff 100644
--- a/Modules/syslogmodule.c
+++ b/Modules/syslogmodule.c
@@ -277,44 +277,44 @@
     /* Add some symbolic constants to the module */
 
     /* Priorities */
-    PyModule_AddIntConstant(m, "LOG_EMERG",       LOG_EMERG);
-    PyModule_AddIntConstant(m, "LOG_ALERT",       LOG_ALERT);
-    PyModule_AddIntConstant(m, "LOG_CRIT",        LOG_CRIT);
-    PyModule_AddIntConstant(m, "LOG_ERR",         LOG_ERR);
-    PyModule_AddIntConstant(m, "LOG_WARNING", LOG_WARNING);
-    PyModule_AddIntConstant(m, "LOG_NOTICE",  LOG_NOTICE);
-    PyModule_AddIntConstant(m, "LOG_INFO",        LOG_INFO);
-    PyModule_AddIntConstant(m, "LOG_DEBUG",       LOG_DEBUG);
+    PyModule_AddIntMacro(m, LOG_EMERG);
+    PyModule_AddIntMacro(m, LOG_ALERT);
+    PyModule_AddIntMacro(m, LOG_CRIT);
+    PyModule_AddIntMacro(m, LOG_ERR);
+    PyModule_AddIntMacro(m, LOG_WARNING);
+    PyModule_AddIntMacro(m, LOG_NOTICE);
+    PyModule_AddIntMacro(m, LOG_INFO);
+    PyModule_AddIntMacro(m, LOG_DEBUG);
 
     /* openlog() option flags */
-    PyModule_AddIntConstant(m, "LOG_PID",         LOG_PID);
-    PyModule_AddIntConstant(m, "LOG_CONS",        LOG_CONS);
-    PyModule_AddIntConstant(m, "LOG_NDELAY",  LOG_NDELAY);
+    PyModule_AddIntMacro(m, LOG_PID);
+    PyModule_AddIntMacro(m, LOG_CONS);
+    PyModule_AddIntMacro(m, LOG_NDELAY);
 #ifdef LOG_ODELAY
-    PyModule_AddIntConstant(m, "LOG_ODELAY",  LOG_ODELAY);
+    PyModule_AddIntMacro(m, LOG_ODELAY);
 #endif
 #ifdef LOG_NOWAIT
-    PyModule_AddIntConstant(m, "LOG_NOWAIT",  LOG_NOWAIT);
+    PyModule_AddIntMacro(m, LOG_NOWAIT);
 #endif
 #ifdef LOG_PERROR
-    PyModule_AddIntConstant(m, "LOG_PERROR",  LOG_PERROR);
+    PyModule_AddIntMacro(m, LOG_PERROR);
 #endif
 
     /* Facilities */
-    PyModule_AddIntConstant(m, "LOG_KERN",        LOG_KERN);
-    PyModule_AddIntConstant(m, "LOG_USER",        LOG_USER);
-    PyModule_AddIntConstant(m, "LOG_MAIL",        LOG_MAIL);
-    PyModule_AddIntConstant(m, "LOG_DAEMON",  LOG_DAEMON);
-    PyModule_AddIntConstant(m, "LOG_AUTH",        LOG_AUTH);
-    PyModule_AddIntConstant(m, "LOG_LPR",         LOG_LPR);
-    PyModule_AddIntConstant(m, "LOG_LOCAL0",  LOG_LOCAL0);
-    PyModule_AddIntConstant(m, "LOG_LOCAL1",  LOG_LOCAL1);
-    PyModule_AddIntConstant(m, "LOG_LOCAL2",  LOG_LOCAL2);
-    PyModule_AddIntConstant(m, "LOG_LOCAL3",  LOG_LOCAL3);
-    PyModule_AddIntConstant(m, "LOG_LOCAL4",  LOG_LOCAL4);
-    PyModule_AddIntConstant(m, "LOG_LOCAL5",  LOG_LOCAL5);
-    PyModule_AddIntConstant(m, "LOG_LOCAL6",  LOG_LOCAL6);
-    PyModule_AddIntConstant(m, "LOG_LOCAL7",  LOG_LOCAL7);
+    PyModule_AddIntMacro(m, LOG_KERN);
+    PyModule_AddIntMacro(m, LOG_USER);
+    PyModule_AddIntMacro(m, LOG_MAIL);
+    PyModule_AddIntMacro(m, LOG_DAEMON);
+    PyModule_AddIntMacro(m, LOG_AUTH);
+    PyModule_AddIntMacro(m, LOG_LPR);
+    PyModule_AddIntMacro(m, LOG_LOCAL0);
+    PyModule_AddIntMacro(m, LOG_LOCAL1);
+    PyModule_AddIntMacro(m, LOG_LOCAL2);
+    PyModule_AddIntMacro(m, LOG_LOCAL3);
+    PyModule_AddIntMacro(m, LOG_LOCAL4);
+    PyModule_AddIntMacro(m, LOG_LOCAL5);
+    PyModule_AddIntMacro(m, LOG_LOCAL6);
+    PyModule_AddIntMacro(m, LOG_LOCAL7);
 
 #ifndef LOG_SYSLOG
 #define LOG_SYSLOG              LOG_DAEMON
@@ -329,13 +329,13 @@
 #define LOG_CRON                LOG_DAEMON
 #endif
 
-    PyModule_AddIntConstant(m, "LOG_SYSLOG",  LOG_SYSLOG);
-    PyModule_AddIntConstant(m, "LOG_CRON",        LOG_CRON);
-    PyModule_AddIntConstant(m, "LOG_UUCP",        LOG_UUCP);
-    PyModule_AddIntConstant(m, "LOG_NEWS",        LOG_NEWS);
+    PyModule_AddIntMacro(m, LOG_SYSLOG);
+    PyModule_AddIntMacro(m, LOG_CRON);
+    PyModule_AddIntMacro(m, LOG_UUCP);
+    PyModule_AddIntMacro(m, LOG_NEWS);
 
 #ifdef LOG_AUTHPRIV
-    PyModule_AddIntConstant(m, "LOG_AUTHPRIV",    LOG_AUTHPRIV);
+    PyModule_AddIntMacro(m, LOG_AUTHPRIV);
 #endif
 
     return m;
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index 42ec366..d0917a4 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -37,16 +37,6 @@
 #endif /* MS_WINDOWS */
 #endif /* !__WATCOMC__ || __QNX__ */
 
-#if defined(PYOS_OS2)
-#define INCL_DOS
-#define INCL_ERRORS
-#include <os2.h>
-#endif
-
-#if defined(PYCC_VACPP)
-#include <sys/time.h>
-#endif
-
 #if defined(__APPLE__)
 #include <mach/mach_time.h>
 #endif
@@ -203,7 +193,7 @@
     if (!PyArg_ParseTuple(args, "iO:clock_settime", &clk_id, &obj))
         return NULL;
 
-    if (_PyTime_ObjectToTimespec(obj, &tv_sec, &tv_nsec) == -1)
+    if (_PyTime_ObjectToTimespec(obj, &tv_sec, &tv_nsec, _PyTime_ROUND_DOWN) == -1)
         return NULL;
     tp.tv_sec = tv_sec;
     tp.tv_nsec = tv_nsec;
@@ -351,7 +341,7 @@
         whent = time(NULL);
     }
     else {
-        if (_PyTime_ObjectToTime_t(ot, &whent) == -1)
+        if (_PyTime_ObjectToTime_t(ot, &whent, _PyTime_ROUND_DOWN) == -1)
             return 0;
     }
     *pwhen = whent;
@@ -543,6 +533,26 @@
    /* wcsftime() doesn't format correctly time zones, see issue #10653 */
 #  undef HAVE_WCSFTIME
 #endif
+#define STRFTIME_FORMAT_CODES \
+"Commonly used format codes:\n\
+\n\
+%Y  Year with century as a decimal number.\n\
+%m  Month as a decimal number [01,12].\n\
+%d  Day of the month as a decimal number [01,31].\n\
+%H  Hour (24-hour clock) as a decimal number [00,23].\n\
+%M  Minute as a decimal number [00,59].\n\
+%S  Second as a decimal number [00,61].\n\
+%z  Time zone offset from UTC.\n\
+%a  Locale's abbreviated weekday name.\n\
+%A  Locale's full weekday name.\n\
+%b  Locale's abbreviated month name.\n\
+%B  Locale's full month name.\n\
+%c  Locale's appropriate date and time representation.\n\
+%I  Hour (12-hour clock) as a decimal number [01,12].\n\
+%p  Locale's equivalent of either AM or PM.\n\
+\n\
+Other codes may be available on your platform.  See documentation for\n\
+the C library strftime function.\n"
 
 #ifdef HAVE_STRFTIME
 #ifdef HAVE_WCSFTIME
@@ -640,6 +650,19 @@
             return NULL;
         }
     }
+#elif (defined(_AIX) || defined(sun)) && defined(HAVE_WCSFTIME)
+    for(outbuf = wcschr(fmt, '%');
+        outbuf != NULL;
+        outbuf = wcschr(outbuf+2, '%'))
+    {
+        /* Issue #19634: On AIX, wcsftime("y", (1899, 1, 1, 0, 0, 0, 0, 0, 0))
+           returns "0/" instead of "99" */
+        if (outbuf[1] == L'y' && buf.tm_year < 0) {
+            PyErr_SetString(PyExc_ValueError,
+                            "format %y requires year >= 1900 on AIX");
+            return NULL;
+        }
+    }
 #endif
 
     fmtlen = time_strlen(fmt);
@@ -694,13 +717,13 @@
 
 #undef time_char
 #undef format_time
-
 PyDoc_STRVAR(strftime_doc,
 "strftime(format[, tuple]) -> string\n\
 \n\
 Convert a time tuple to a string according to a format specification.\n\
 See the library reference manual for formatting codes. When the time tuple\n\
-is not present, current time as returned by localtime() is used.");
+is not present, current time as returned by localtime() is used.\n\
+\n" STRFTIME_FORMAT_CODES);
 #endif /* HAVE_STRFTIME */
 
 static PyObject *
@@ -723,7 +746,9 @@
 "strptime(string, format) -> struct_time\n\
 \n\
 Parse a string to a time tuple according to a format specification.\n\
-See the library reference manual for formatting codes (same as strftime()).");
+See the library reference manual for formatting codes (same as\n\
+strftime()).\n\
+\n" STRFTIME_FORMAT_CODES);
 
 static PyObject *
 _asctime(struct tm *timeptr)
@@ -798,11 +823,31 @@
     time_t tt;
     if (!gettmarg(tup, &buf))
         return NULL;
+#ifdef _AIX
+    /* year < 1902 or year > 2037 */
+    if (buf.tm_year < 2 || buf.tm_year > 137) {
+        /* Issue #19748: On AIX, mktime() doesn't report overflow error for
+         * timestamp < -2^31 or timestamp > 2**31-1. */
+        PyErr_SetString(PyExc_OverflowError,
+                        "mktime argument out of range");
+        return NULL;
+    }
+#else
     buf.tm_wday = -1;  /* sentinel; original value ignored */
+#endif
     tt = mktime(&buf);
     /* Return value of -1 does not necessarily mean an error, but tm_wday
      * cannot remain set to -1 if mktime succeeded. */
-    if (tt == (time_t)(-1) && buf.tm_wday == -1) {
+    if (tt == (time_t)(-1)
+#ifndef _AIX
+        /* Return value of -1 does not necessarily mean an error, but
+         * tm_wday cannot remain set to -1 if mktime succeeded. */
+        && buf.tm_wday == -1
+#else
+        /* on AIX, tm_wday is always sets, even on error */
+#endif
+       )
+    {
         PyErr_SetString(PyExc_OverflowError,
                         "mktime argument out of range");
         return NULL;
@@ -837,6 +882,8 @@
     /* Reset timezone, altzone, daylight and tzname */
     PyInit_timezone(m);
     Py_DECREF(m);
+    if (PyErr_Occurred())
+        return NULL;
 
     Py_INCREF(Py_None);
     return Py_None;
@@ -1273,19 +1320,11 @@
 #if defined(HAVE_TZNAME) && !defined(__GLIBC__) && !defined(__CYGWIN__)
     PyObject *otz0, *otz1;
     tzset();
-#ifdef PYOS_OS2
-    PyModule_AddIntConstant(m, "timezone", _timezone);
-#else /* !PYOS_OS2 */
     PyModule_AddIntConstant(m, "timezone", timezone);
-#endif /* PYOS_OS2 */
 #ifdef HAVE_ALTZONE
     PyModule_AddIntConstant(m, "altzone", altzone);
 #else
-#ifdef PYOS_OS2
-    PyModule_AddIntConstant(m, "altzone", _timezone-3600);
-#else /* !PYOS_OS2 */
     PyModule_AddIntConstant(m, "altzone", timezone-3600);
-#endif /* PYOS_OS2 */
 #endif
     PyModule_AddIntConstant(m, "daylight", daylight);
     otz0 = PyUnicode_DecodeLocale(tzname[0], "surrogateescape");
@@ -1468,8 +1507,9 @@
     PyInit_timezone(m);
 
     if (!initialized) {
-        PyStructSequence_InitType(&StructTimeType,
-                                  &struct_time_type_desc);
+        if (PyStructSequence_InitType2(&StructTimeType,
+                                       &struct_time_type_desc) < 0)
+            return NULL;
 
 #ifdef MS_WINDOWS
         winver.dwOSVersionInfoSize = sizeof(winver);
@@ -1581,7 +1621,7 @@
             DWORD rc;
             HANDLE hInterruptEvent = _PyOS_SigintEvent();
             ResetEvent(hInterruptEvent);
-            rc = WaitForSingleObject(hInterruptEvent, ul_millis);
+            rc = WaitForSingleObjectEx(hInterruptEvent, ul_millis, FALSE);
             if (rc == WAIT_OBJECT_0) {
                 Py_BLOCK_THREADS
                 errno = EINTR;
@@ -1591,15 +1631,6 @@
         }
         Py_END_ALLOW_THREADS
     }
-#elif defined(PYOS_OS2)
-    /* This Sleep *IS* Interruptable by Exceptions */
-    Py_BEGIN_ALLOW_THREADS
-    if (DosSleep(secs * 1000) != NO_ERROR) {
-        Py_BLOCK_THREADS
-        PyErr_SetFromErrno(PyExc_IOError);
-        return -1;
-    }
-    Py_END_ALLOW_THREADS
 #else
     /* XXX Can't interrupt this sleep */
     Py_BEGIN_ALLOW_THREADS
diff --git a/Modules/unicodedata.c b/Modules/unicodedata.c
index f4d3608..ec70e7a 100644
--- a/Modules/unicodedata.c
+++ b/Modules/unicodedata.c
@@ -13,10 +13,18 @@
 
    ------------------------------------------------------------------------ */
 
+#define PY_SSIZE_T_CLEAN
+
 #include "Python.h"
 #include "ucnhash.h"
 #include "structmember.h"
 
+/*[clinic input]
+module unicodedata
+class unicodedata.UCD 'PreviousDBVersion *' '&UCD_Type'
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=6dac153082d150bc]*/
+
 /* character properties */
 
 typedef struct {
@@ -107,25 +115,63 @@
 
 /* --- Module API --------------------------------------------------------- */
 
-PyDoc_STRVAR(unicodedata_decimal__doc__,
-"decimal(unichr[, default])\n\
-\n\
-Returns the decimal value assigned to the Unicode character unichr\n\
-as integer. If no such value is defined, default is returned, or, if\n\
-not given, ValueError is raised.");
+/*[clinic input]
+
+unicodedata.UCD.decimal
+
+    unichr: object(type='PyUnicodeObject *', subclass_of='&PyUnicode_Type')
+    default: object=NULL
+    /
+
+Converts a Unicode character into its equivalent decimal value.
+
+Returns the decimal value assigned to the Unicode character unichr
+as integer. If no such value is defined, default is returned, or, if
+not given, ValueError is raised.
+[clinic start generated code]*/
+
+PyDoc_STRVAR(unicodedata_UCD_decimal__doc__,
+"decimal($self, unichr, default=None, /)\n"
+"--\n"
+"\n"
+"Converts a Unicode character into its equivalent decimal value.\n"
+"\n"
+"Returns the decimal value assigned to the Unicode character unichr\n"
+"as integer. If no such value is defined, default is returned, or, if\n"
+"not given, ValueError is raised.");
+
+#define UNICODEDATA_UCD_DECIMAL_METHODDEF    \
+    {"decimal", (PyCFunction)unicodedata_UCD_decimal, METH_VARARGS, unicodedata_UCD_decimal__doc__},
 
 static PyObject *
-unicodedata_decimal(PyObject *self, PyObject *args)
+unicodedata_UCD_decimal_impl(PreviousDBVersion *self, PyUnicodeObject *unichr, PyObject *default_value);
+
+static PyObject *
+unicodedata_UCD_decimal(PreviousDBVersion *self, PyObject *args)
 {
-    PyUnicodeObject *v;
-    PyObject *defobj = NULL;
+    PyObject *return_value = NULL;
+    PyUnicodeObject *unichr;
+    PyObject *default_value = NULL;
+
+    if (!PyArg_ParseTuple(args,
+        "O!|O:decimal",
+        &PyUnicode_Type, &unichr, &default_value))
+        goto exit;
+    return_value = unicodedata_UCD_decimal_impl(self, unichr, default_value);
+
+exit:
+    return return_value;
+}
+
+static PyObject *
+unicodedata_UCD_decimal_impl(PreviousDBVersion *self, PyUnicodeObject *unichr, PyObject *default_value)
+/*[clinic end generated code: output=8689669896d293df input=c25c9d2b4de076b1]*/
+{
     int have_old = 0;
     long rc;
     Py_UCS4 c;
 
-    if (!PyArg_ParseTuple(args, "O!|O:decimal", &PyUnicode_Type, &v, &defobj))
-        return NULL;
-    c = getuchar(v);
+    c = getuchar(unichr);
     if (c == (Py_UCS4)-1)
         return NULL;
 
@@ -145,14 +191,14 @@
     if (!have_old)
         rc = Py_UNICODE_TODECIMAL(c);
     if (rc < 0) {
-        if (defobj == NULL) {
+        if (default_value == NULL) {
             PyErr_SetString(PyExc_ValueError,
                             "not a decimal");
             return NULL;
         }
         else {
-            Py_INCREF(defobj);
-            return defobj;
+            Py_INCREF(default_value);
+            return default_value;
         }
     }
     return PyLong_FromLong(rc);
@@ -930,7 +976,7 @@
         (0x2B740 <= code && code <= 0x2B81D);   /* CJK Ideograph Extension D */
 }
 
-/* macros used to determine if the given codepoint is in the PUA range that
+/* macros used to determine if the given code point is in the PUA range that
  * we are using to store aliases and named sequences */
 #define IS_ALIAS(cp) ((cp >= aliases_start) && (cp < aliases_end))
 #define IS_NAMED_SEQ(cp) ((cp >= named_sequences_start) && \
@@ -940,7 +986,7 @@
 _getucname(PyObject *self, Py_UCS4 code, char* buffer, int buflen,
            int with_alias_and_seq)
 {
-    /* Find the name associated with the given codepoint.
+    /* Find the name associated with the given code point.
      * If with_alias_and_seq is 1, check for names in the Private Use Area 15
      * that we are using for aliases and named sequences. */
     int offset;
@@ -951,7 +997,7 @@
     if (code >= 0x110000)
         return 0;
 
-    /* XXX should we just skip all the codepoints in the PUAs here? */
+    /* XXX should we just skip all the code points in the PUAs here? */
     if (!with_alias_and_seq && (IS_ALIAS(code) || IS_NAMED_SEQ(code)))
         return 0;
 
@@ -1079,8 +1125,8 @@
     /* check if named sequences are allowed */
     if (!with_named_seq && IS_NAMED_SEQ(cp))
         return 0;
-    /* if the codepoint is in the PUA range that we use for aliases,
-     * convert it to obtain the right codepoint */
+    /* if the code point is in the PUA range that we use for aliases,
+     * convert it to obtain the right code point */
     if (IS_ALIAS(cp))
         *code = name_aliases[cp-aliases_start];
     else
@@ -1092,9 +1138,9 @@
 _getcode(PyObject* self, const char* name, int namelen, Py_UCS4* code,
          int with_named_seq)
 {
-    /* Return the codepoint associated with the given name.
+    /* Return the code point associated with the given name.
      * Named aliases are resolved too (unless self != NULL (i.e. we are using
-     * 3.2.0)).  If with_named_seq is 1, returns the PUA codepoint that we are
+     * 3.2.0)).  If with_named_seq is 1, returns the PUA code point that we are
      * using for the named sequence, and the caller must then convert it. */
     unsigned int h, v;
     unsigned int mask = code_size-1;
@@ -1227,12 +1273,16 @@
     Py_UCS4 code;
 
     char* name;
-    int namelen;
+    Py_ssize_t namelen;
     unsigned int index;
     if (!PyArg_ParseTuple(args, "s#:lookup", &name, &namelen))
         return NULL;
+    if (namelen > INT_MAX) {
+        PyErr_SetString(PyExc_KeyError, "name too long");
+        return NULL;
+    }
 
-    if (!_getcode(self, name, namelen, &code, 1)) {
+    if (!_getcode(self, name, (int)namelen, &code, 1)) {
         PyErr_Format(PyExc_KeyError, "undefined character name '%s'", name);
         return NULL;
     }
@@ -1250,7 +1300,7 @@
 /* XXX Add doc strings. */
 
 static PyMethodDef unicodedata_functions[] = {
-    {"decimal", unicodedata_decimal, METH_VARARGS, unicodedata_decimal__doc__},
+    UNICODEDATA_UCD_DECIMAL_METHODDEF
     {"digit", unicodedata_digit, METH_VARARGS, unicodedata_digit__doc__},
     {"numeric", unicodedata_numeric, METH_VARARGS, unicodedata_numeric__doc__},
     {"category", unicodedata_category, METH_VARARGS,
@@ -1327,7 +1377,6 @@
 The module uses the same names and symbols as defined by the\n\
 UnicodeData File Format " UNIDATA_VERSION ".");
 
-
 static struct PyModuleDef unicodedatamodule = {
         PyModuleDef_HEAD_INIT,
         "unicodedata",
diff --git a/Modules/unicodedata_db.h b/Modules/unicodedata_db.h
index 5d5dca8..ec11fa1 100644
--- a/Modules/unicodedata_db.h
+++ b/Modules/unicodedata_db.h
@@ -1,6 +1,6 @@
 /* this file was generated by Tools/unicode/makeunicodedata.py 3.2 */
 
-#define UNIDATA_VERSION "6.1.0"
+#define UNIDATA_VERSION "6.3.0"
 /* a list of unique database records */
 const _PyUnicode_DatabaseRecord _PyUnicode_Database_Records[] = {
     {0, 0, 0, 0, 0, 0},
@@ -120,6 +120,7 @@
     {4, 30, 14, 0, 5, 0},
     {4, 31, 14, 0, 5, 0},
     {4, 32, 14, 0, 5, 0},
+    {14, 0, 5, 0, 5, 0},
     {19, 0, 5, 0, 5, 0},
     {19, 0, 5, 0, 5, 10},
     {18, 0, 5, 0, 5, 0},
@@ -136,7 +137,6 @@
     {19, 0, 5, 0, 5, 136},
     {7, 0, 9, 0, 5, 0},
     {30, 0, 5, 0, 5, 0},
-    {14, 0, 5, 0, 5, 0},
     {4, 36, 14, 0, 5, 0},
     {4, 0, 14, 0, 5, 0},
     {7, 0, 4, 0, 5, 0},
@@ -177,6 +177,7 @@
     {19, 0, 1, 0, 5, 80},
     {10, 0, 18, 0, 5, 0},
     {8, 0, 1, 0, 5, 0},
+    {14, 0, 15, 0, 5, 0},
     {5, 9, 1, 0, 5, 0},
     {4, 1, 14, 0, 5, 0},
     {4, 234, 14, 0, 5, 0},
@@ -190,7 +191,6 @@
     {29, 0, 19, 0, 5, 170},
     {10, 0, 18, 0, 5, 170},
     {10, 0, 18, 0, 5, 136},
-    {14, 0, 15, 0, 5, 0},
     {14, 0, 1, 0, 5, 0},
     {14, 0, 4, 0, 5, 0},
     {21, 0, 19, 0, 4, 0},
@@ -213,6 +213,10 @@
     {26, 0, 11, 0, 5, 136},
     {20, 0, 19, 0, 5, 0},
     {27, 0, 13, 0, 5, 0},
+    {14, 0, 20, 0, 5, 0},
+    {14, 0, 21, 0, 5, 0},
+    {14, 0, 22, 0, 5, 0},
+    {14, 0, 23, 0, 5, 0},
     {9, 0, 9, 0, 5, 136},
     {27, 0, 10, 0, 5, 136},
     {27, 0, 19, 0, 5, 136},
@@ -638,6 +642,10 @@
     "S",
     "WS",
     "ON",
+    "LRI",
+    "RLI",
+    "FSI",
+    "PDI",
     NULL
 };
 const char *_PyUnicode_EastAsianWidthNames[] = {
@@ -1273,35 +1281,35 @@
     107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 0, 0, 0, 0, 
     0, 107, 107, 107, 104, 104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 108, 108, 
     108, 108, 108, 0, 78, 78, 109, 110, 110, 111, 112, 113, 26, 26, 81, 81, 
-    81, 81, 81, 81, 81, 81, 114, 115, 116, 113, 0, 0, 113, 113, 117, 117, 
-    118, 118, 118, 118, 118, 117, 117, 117, 117, 117, 117, 117, 117, 117, 
-    117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 
-    117, 117, 119, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 120, 
-    121, 122, 114, 115, 116, 123, 124, 125, 125, 126, 86, 81, 81, 81, 81, 81, 
-    86, 81, 81, 86, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 110, 
-    128, 128, 113, 117, 117, 129, 117, 117, 117, 117, 130, 130, 130, 130, 
-    117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 
-    117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 
-    117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 
-    117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 
-    117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 
-    117, 118, 117, 118, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 
-    117, 117, 117, 117, 117, 117, 118, 113, 117, 81, 81, 81, 81, 81, 81, 81, 
-    108, 26, 81, 81, 81, 81, 86, 81, 119, 119, 81, 81, 26, 86, 81, 81, 86, 
-    117, 117, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 117, 117, 
-    117, 132, 132, 117, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 
-    113, 113, 113, 113, 0, 133, 117, 134, 117, 117, 117, 117, 117, 117, 117, 
-    117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 
-    117, 117, 117, 117, 117, 117, 117, 117, 117, 81, 86, 81, 81, 86, 81, 81, 
+    81, 81, 81, 81, 81, 81, 114, 115, 116, 113, 117, 0, 113, 113, 118, 118, 
+    119, 119, 119, 119, 119, 118, 118, 118, 118, 118, 118, 118, 118, 118, 
+    118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 
+    118, 118, 120, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 121, 
+    122, 123, 114, 115, 116, 124, 125, 126, 126, 127, 86, 81, 81, 81, 81, 81, 
+    86, 81, 81, 86, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 110, 
+    129, 129, 113, 118, 118, 130, 118, 118, 118, 118, 131, 131, 131, 131, 
+    118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 
+    118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 
+    118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 
+    118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 
+    118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 
+    118, 119, 118, 119, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 
+    118, 118, 118, 118, 118, 118, 119, 113, 118, 81, 81, 81, 81, 81, 81, 81, 
+    108, 26, 81, 81, 81, 81, 86, 81, 120, 120, 81, 81, 26, 86, 81, 81, 86, 
+    118, 118, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 118, 118, 
+    118, 133, 133, 118, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 
+    113, 113, 113, 113, 0, 117, 118, 134, 118, 118, 118, 118, 118, 118, 118, 
+    118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 
+    118, 118, 118, 118, 118, 118, 118, 118, 118, 81, 86, 81, 81, 86, 81, 81, 
     86, 86, 86, 81, 86, 86, 81, 86, 81, 81, 81, 86, 81, 86, 81, 86, 81, 86, 
-    81, 81, 0, 0, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 
-    117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 
-    117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 
-    117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 
-    117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 
-    117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 
-    117, 117, 117, 117, 117, 117, 117, 135, 135, 135, 135, 135, 135, 135, 
-    135, 135, 135, 135, 117, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 136, 
+    81, 81, 0, 0, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 
+    118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 
+    118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 
+    118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 
+    118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 
+    118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 
+    118, 118, 118, 118, 118, 118, 118, 135, 135, 135, 135, 135, 135, 135, 
+    135, 135, 135, 135, 118, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 136, 
     136, 136, 136, 136, 136, 136, 136, 136, 136, 107, 107, 107, 107, 107, 
     107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
     107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 81, 
@@ -1314,11 +1322,11 @@
     107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 86, 86, 86, 
     0, 0, 104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 117, 0, 117, 
-    117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 118, 0, 118, 
+    118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 81, 
-    81, 86, 81, 81, 86, 81, 81, 81, 86, 86, 86, 120, 121, 122, 81, 81, 81, 
+    81, 86, 81, 81, 86, 81, 81, 81, 86, 86, 86, 121, 122, 123, 81, 81, 81, 
     86, 81, 81, 86, 86, 81, 81, 81, 81, 0, 135, 135, 135, 139, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 140, 48, 
@@ -1444,41 +1452,40 @@
     171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 170, 170, 170, 170, 170, 171, 171, 171, 171, 171, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 171, 171, 171, 171, 171, 171, 
     171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 
-    171, 171, 171, 171, 171, 171, 171, 171, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 170, 170, 170, 170, 170, 170, 
+    171, 171, 171, 171, 171, 171, 171, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 0, 48, 48, 48, 48, 0, 0, 48, 48, 48, 48, 48, 48, 48, 0, 48, 0, 48, 
-    48, 48, 48, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 48, 48, 48, 48, 0, 0, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 48, 48, 48, 48, 0, 0, 
-    48, 48, 48, 48, 48, 48, 48, 0, 48, 0, 48, 48, 48, 48, 0, 0, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 48, 
-    48, 48, 48, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 
+    48, 48, 48, 48, 0, 0, 48, 48, 48, 48, 48, 48, 48, 0, 48, 0, 48, 48, 48, 
+    48, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 0, 48, 48, 48, 48, 0, 0, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 48, 48, 48, 48, 0, 0, 48, 48, 
+    48, 48, 48, 48, 48, 0, 48, 0, 48, 48, 48, 48, 0, 0, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 48, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 
-    81, 81, 81, 83, 83, 83, 83, 83, 83, 83, 83, 83, 148, 148, 148, 148, 148, 
-    148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 
-    148, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 0, 0, 0, 0, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 48, 48, 48, 
+    48, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 81, 81, 
+    81, 83, 83, 83, 83, 83, 83, 83, 83, 83, 148, 148, 148, 148, 148, 148, 
+    148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 0, 
+    0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 26, 
+    26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    84, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
@@ -1498,15 +1505,16 @@
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 83, 83, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 172, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 163, 164, 0, 
-    0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 83, 83, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 172, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 163, 164, 0, 0, 0, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 83, 83, 83, 173, 173, 173, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 83, 83, 83, 173, 173, 173, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 48, 
     48, 48, 48, 135, 135, 142, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 135, 135, 
     142, 83, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 
@@ -1521,7 +1529,7 @@
     83, 53, 83, 83, 83, 85, 48, 81, 0, 0, 144, 144, 144, 144, 144, 144, 144, 
     144, 144, 144, 0, 0, 0, 0, 0, 0, 153, 153, 153, 153, 153, 153, 153, 153, 
     153, 153, 0, 0, 0, 0, 0, 0, 138, 138, 138, 138, 138, 138, 84, 138, 138, 
-    138, 138, 135, 135, 135, 172, 0, 144, 144, 144, 144, 144, 144, 144, 144, 
+    138, 138, 135, 135, 135, 174, 0, 144, 144, 144, 144, 144, 144, 144, 144, 
     144, 144, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 53, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
@@ -1550,7 +1558,7 @@
     0, 0, 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
     26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 81, 86, 139, 139, 139, 0, 0, 83, 83, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 81, 86, 139, 139, 135, 0, 0, 83, 83, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 139, 135, 139, 135, 
@@ -1566,17 +1574,17 @@
     140, 48, 140, 48, 140, 48, 140, 48, 48, 48, 140, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 145, 146, 135, 135, 135, 135, 135, 
-    147, 135, 147, 139, 139, 147, 147, 135, 147, 174, 48, 48, 48, 48, 48, 48, 
+    147, 135, 147, 139, 139, 147, 147, 135, 147, 175, 48, 48, 48, 48, 48, 48, 
     48, 0, 0, 0, 0, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 83, 83, 
     83, 83, 83, 83, 83, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 81, 86, 81, 
     81, 81, 81, 81, 81, 81, 80, 80, 80, 80, 80, 80, 80, 80, 80, 0, 0, 0, 135, 
     135, 139, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 139, 135, 135, 
-    135, 135, 139, 139, 135, 135, 174, 142, 139, 139, 48, 48, 144, 144, 144, 
+    135, 135, 139, 139, 135, 135, 175, 142, 139, 139, 48, 48, 144, 144, 144, 
     144, 144, 144, 144, 144, 144, 144, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 145, 
-    139, 135, 135, 139, 139, 139, 135, 139, 135, 135, 135, 174, 174, 0, 0, 0, 
+    139, 135, 135, 139, 139, 139, 135, 139, 135, 135, 135, 175, 175, 0, 0, 0, 
     0, 0, 0, 0, 0, 83, 83, 83, 83, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 139, 139, 139, 139, 139, 139, 139, 139, 
@@ -1588,8 +1596,8 @@
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 83, 83, 83, 83, 83, 
-    83, 83, 0, 0, 0, 0, 0, 0, 0, 0, 81, 81, 81, 83, 175, 86, 86, 86, 86, 86, 
-    81, 81, 86, 86, 86, 86, 81, 139, 175, 175, 175, 175, 175, 175, 175, 48, 
+    83, 83, 0, 0, 0, 0, 0, 0, 0, 0, 81, 81, 81, 83, 176, 86, 86, 86, 86, 86, 
+    81, 81, 86, 86, 86, 86, 81, 139, 176, 176, 176, 176, 176, 176, 176, 48, 
     48, 48, 48, 86, 48, 48, 48, 48, 139, 139, 81, 48, 48, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 
     47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 
@@ -1602,9 +1610,9 @@
     47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 51, 51, 51, 51, 51, 
     51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 
     51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 81, 81, 86, 81, 
-    81, 81, 81, 81, 81, 81, 86, 81, 81, 176, 177, 86, 178, 81, 81, 81, 81, 
+    81, 81, 81, 81, 81, 81, 86, 81, 81, 177, 178, 86, 179, 81, 81, 81, 81, 
     81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 179, 86, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 180, 86, 
     81, 86, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 
     38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 
     38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 
@@ -1613,7 +1621,7 @@
     38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 
     38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 
     38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 
-    38, 43, 38, 43, 38, 43, 38, 43, 43, 43, 43, 43, 35, 180, 47, 47, 44, 47, 
+    38, 43, 38, 43, 38, 43, 38, 43, 43, 43, 43, 43, 35, 181, 47, 47, 44, 47, 
     38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 
     38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 
     38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 
@@ -1625,65 +1633,65 @@
     43, 43, 43, 43, 43, 43, 43, 38, 38, 38, 38, 38, 38, 38, 38, 43, 43, 43, 
     43, 43, 43, 0, 0, 38, 38, 38, 38, 38, 38, 0, 0, 43, 43, 43, 43, 43, 43, 
     43, 43, 0, 38, 0, 38, 0, 38, 0, 38, 43, 43, 43, 43, 43, 43, 43, 43, 38, 
-    38, 38, 38, 38, 38, 38, 38, 43, 181, 43, 181, 43, 181, 43, 181, 43, 181, 
-    43, 181, 43, 181, 0, 0, 43, 43, 43, 43, 43, 43, 43, 43, 182, 182, 182, 
-    182, 182, 182, 182, 182, 43, 43, 43, 43, 43, 43, 43, 43, 182, 182, 182, 
-    182, 182, 182, 182, 182, 43, 43, 43, 43, 43, 43, 43, 43, 182, 182, 182, 
-    182, 182, 182, 182, 182, 43, 43, 43, 43, 43, 0, 43, 43, 38, 38, 38, 183, 
-    182, 58, 181, 58, 58, 76, 43, 43, 43, 0, 43, 43, 38, 183, 38, 183, 182, 
-    76, 76, 76, 43, 43, 43, 181, 0, 0, 43, 43, 38, 38, 38, 183, 0, 76, 76, 
-    76, 43, 43, 43, 181, 43, 43, 43, 43, 38, 38, 38, 183, 38, 76, 184, 184, 
-    0, 0, 43, 43, 43, 0, 43, 43, 38, 183, 38, 183, 182, 184, 58, 0, 185, 185, 
-    186, 186, 186, 186, 186, 186, 186, 186, 186, 187, 187, 187, 188, 189, 
+    38, 38, 38, 38, 38, 38, 38, 43, 182, 43, 182, 43, 182, 43, 182, 43, 182, 
+    43, 182, 43, 182, 0, 0, 43, 43, 43, 43, 43, 43, 43, 43, 183, 183, 183, 
+    183, 183, 183, 183, 183, 43, 43, 43, 43, 43, 43, 43, 43, 183, 183, 183, 
+    183, 183, 183, 183, 183, 43, 43, 43, 43, 43, 43, 43, 43, 183, 183, 183, 
+    183, 183, 183, 183, 183, 43, 43, 43, 43, 43, 0, 43, 43, 38, 38, 38, 184, 
+    183, 58, 182, 58, 58, 76, 43, 43, 43, 0, 43, 43, 38, 184, 38, 184, 183, 
+    76, 76, 76, 43, 43, 43, 182, 0, 0, 43, 43, 38, 38, 38, 184, 0, 76, 76, 
+    76, 43, 43, 43, 182, 43, 43, 43, 43, 38, 38, 38, 184, 38, 76, 185, 185, 
+    0, 0, 43, 43, 43, 0, 43, 43, 38, 184, 38, 184, 183, 185, 58, 0, 186, 186, 
+    187, 187, 187, 187, 187, 187, 187, 187, 187, 174, 174, 174, 188, 189, 
     190, 191, 84, 190, 190, 190, 22, 192, 193, 194, 195, 196, 193, 194, 195, 
     196, 22, 22, 22, 138, 197, 197, 197, 22, 198, 199, 200, 201, 202, 203, 
     204, 21, 205, 110, 205, 206, 207, 22, 192, 192, 138, 28, 36, 22, 192, 
     138, 197, 208, 208, 138, 138, 138, 209, 163, 164, 192, 192, 192, 138, 
     138, 138, 138, 138, 138, 138, 138, 78, 138, 208, 138, 138, 192, 138, 138, 
-    138, 138, 138, 138, 138, 186, 187, 187, 187, 187, 187, 0, 0, 0, 0, 0, 
-    187, 187, 187, 187, 187, 187, 210, 51, 0, 0, 34, 210, 210, 210, 210, 210, 
-    211, 211, 212, 213, 214, 215, 210, 34, 34, 34, 34, 210, 210, 210, 210, 
-    210, 211, 211, 212, 213, 214, 0, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 
-    51, 51, 51, 0, 0, 0, 85, 85, 85, 85, 85, 85, 85, 85, 216, 217, 85, 85, 
-    23, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 81, 81, 175, 175, 81, 81, 
-    81, 81, 175, 175, 175, 81, 81, 82, 82, 82, 82, 81, 82, 82, 82, 175, 175, 
-    81, 86, 81, 175, 175, 86, 86, 86, 86, 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 218, 218, 49, 219, 26, 219, 218, 49, 26, 219, 35, 49, 49, 
-    49, 35, 35, 49, 49, 49, 46, 26, 49, 219, 26, 78, 49, 49, 49, 49, 49, 26, 
-    26, 218, 219, 219, 26, 49, 26, 220, 26, 49, 26, 183, 220, 49, 49, 221, 
-    35, 49, 49, 44, 49, 35, 156, 156, 156, 156, 35, 26, 218, 35, 35, 49, 49, 
-    222, 78, 78, 78, 78, 49, 35, 35, 35, 35, 26, 78, 26, 26, 47, 80, 223, 
-    223, 223, 37, 37, 223, 223, 223, 223, 223, 223, 37, 37, 37, 37, 223, 224, 
-    224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 225, 225, 225, 
-    225, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 225, 225, 225, 
-    225, 225, 225, 173, 173, 173, 44, 47, 173, 173, 173, 173, 37, 0, 0, 0, 0, 
-    0, 0, 40, 40, 40, 40, 40, 30, 30, 30, 30, 30, 226, 226, 26, 26, 26, 26, 
-    78, 26, 26, 78, 26, 26, 78, 26, 26, 26, 26, 26, 26, 26, 226, 26, 26, 26, 
+    138, 138, 138, 138, 138, 187, 174, 174, 174, 174, 174, 0, 210, 211, 212, 
+    213, 174, 174, 174, 174, 174, 174, 214, 51, 0, 0, 34, 214, 214, 214, 214, 
+    214, 215, 215, 216, 217, 218, 219, 214, 34, 34, 34, 34, 214, 214, 214, 
+    214, 214, 215, 215, 216, 217, 218, 0, 51, 51, 51, 51, 51, 51, 51, 51, 51, 
+    51, 51, 51, 51, 0, 0, 0, 85, 85, 85, 85, 85, 85, 85, 85, 220, 221, 85, 
+    85, 23, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 81, 81, 176, 176, 
+    81, 81, 81, 81, 176, 176, 176, 81, 81, 82, 82, 82, 82, 81, 82, 82, 82, 
+    176, 176, 81, 86, 81, 176, 176, 86, 86, 86, 86, 81, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 222, 222, 49, 223, 26, 223, 222, 49, 26, 223, 35, 
+    49, 49, 49, 35, 35, 49, 49, 49, 46, 26, 49, 223, 26, 78, 49, 49, 49, 49, 
+    49, 26, 26, 222, 223, 223, 26, 49, 26, 224, 26, 49, 26, 184, 224, 49, 49, 
+    225, 35, 49, 49, 44, 49, 35, 156, 156, 156, 156, 35, 26, 222, 35, 35, 49, 
+    49, 226, 78, 78, 78, 78, 49, 35, 35, 35, 35, 26, 78, 26, 26, 47, 80, 227, 
+    227, 227, 37, 37, 227, 227, 227, 227, 227, 227, 37, 37, 37, 37, 227, 228, 
+    228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 229, 229, 229, 
+    229, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 229, 229, 229, 
+    229, 229, 229, 173, 173, 173, 44, 47, 173, 173, 173, 173, 37, 0, 0, 0, 0, 
+    0, 0, 40, 40, 40, 40, 40, 30, 30, 30, 30, 30, 230, 230, 26, 26, 26, 26, 
+    78, 26, 26, 78, 26, 26, 78, 26, 26, 26, 26, 26, 26, 26, 230, 26, 26, 26, 
     26, 26, 26, 26, 26, 26, 30, 30, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
-    26, 26, 26, 26, 26, 26, 26, 26, 26, 227, 226, 226, 26, 26, 40, 26, 40, 
+    26, 26, 26, 26, 26, 26, 26, 26, 26, 231, 230, 230, 26, 26, 40, 26, 40, 
     26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
     30, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 78, 78, 78, 78, 78, 
-    78, 78, 78, 78, 78, 78, 78, 40, 228, 229, 229, 230, 78, 78, 40, 229, 230, 
-    228, 229, 230, 228, 78, 40, 78, 229, 231, 232, 78, 229, 228, 78, 78, 78, 
-    229, 228, 228, 229, 40, 229, 229, 228, 228, 40, 230, 40, 230, 40, 40, 40, 
-    40, 229, 233, 222, 229, 222, 222, 228, 228, 228, 40, 40, 40, 40, 78, 228, 
-    78, 228, 229, 229, 228, 228, 228, 230, 228, 228, 230, 228, 228, 230, 229, 
-    230, 228, 228, 229, 78, 78, 78, 78, 78, 229, 228, 228, 228, 78, 78, 78, 
-    78, 78, 78, 78, 78, 78, 228, 234, 40, 230, 78, 229, 229, 229, 229, 228, 
-    228, 229, 229, 78, 226, 234, 234, 230, 230, 228, 228, 230, 230, 228, 228, 
-    230, 230, 228, 228, 228, 228, 228, 228, 230, 230, 229, 229, 230, 230, 
-    229, 229, 230, 230, 228, 228, 228, 78, 78, 228, 228, 228, 228, 78, 78, 
-    40, 78, 78, 228, 40, 78, 78, 78, 78, 78, 78, 78, 78, 228, 228, 78, 40, 
-    228, 228, 228, 228, 228, 228, 230, 230, 230, 230, 228, 228, 228, 228, 
-    228, 228, 228, 228, 228, 78, 78, 78, 78, 78, 228, 229, 78, 78, 78, 78, 
-    78, 78, 78, 78, 78, 228, 228, 228, 228, 228, 78, 78, 228, 228, 78, 78, 
-    78, 78, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 230, 230, 230, 
-    230, 228, 228, 228, 228, 228, 228, 230, 230, 230, 230, 78, 78, 228, 228, 
-    228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 26, 
-    26, 26, 26, 26, 26, 26, 26, 228, 228, 228, 228, 26, 26, 26, 26, 26, 26, 
-    30, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 228, 228, 26, 26, 
-    26, 26, 26, 26, 26, 235, 236, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
+    78, 78, 78, 78, 78, 78, 78, 40, 232, 233, 233, 234, 78, 78, 40, 233, 234, 
+    232, 233, 234, 232, 78, 40, 78, 233, 235, 236, 78, 233, 232, 78, 78, 78, 
+    233, 232, 232, 233, 40, 233, 233, 232, 232, 40, 234, 40, 234, 40, 40, 40, 
+    40, 233, 237, 226, 233, 226, 226, 232, 232, 232, 40, 40, 40, 40, 78, 232, 
+    78, 232, 233, 233, 232, 232, 232, 234, 232, 232, 234, 232, 232, 234, 233, 
+    234, 232, 232, 233, 78, 78, 78, 78, 78, 233, 232, 232, 232, 78, 78, 78, 
+    78, 78, 78, 78, 78, 78, 232, 238, 40, 234, 78, 233, 233, 233, 233, 232, 
+    232, 233, 233, 78, 230, 238, 238, 234, 234, 232, 232, 234, 234, 232, 232, 
+    234, 234, 232, 232, 232, 232, 232, 232, 234, 234, 233, 233, 234, 234, 
+    233, 233, 234, 234, 232, 232, 232, 78, 78, 232, 232, 232, 232, 78, 78, 
+    40, 78, 78, 232, 40, 78, 78, 78, 78, 78, 78, 78, 78, 232, 232, 78, 40, 
+    232, 232, 232, 232, 232, 232, 234, 234, 234, 234, 232, 232, 232, 232, 
+    232, 232, 232, 232, 232, 78, 78, 78, 78, 78, 232, 233, 78, 78, 78, 78, 
+    78, 78, 78, 78, 78, 232, 232, 232, 232, 232, 78, 78, 232, 232, 78, 78, 
+    78, 78, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 234, 234, 234, 
+    234, 232, 232, 232, 232, 232, 232, 234, 234, 234, 234, 78, 78, 232, 232, 
+    232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 26, 
+    26, 26, 26, 26, 26, 26, 26, 163, 164, 163, 164, 26, 26, 26, 26, 26, 26, 
+    30, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 232, 232, 26, 26, 
+    26, 26, 26, 26, 26, 239, 240, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
     80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 
     80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 
     80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 
@@ -1703,14 +1711,14 @@
     37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 
     37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 34, 
     34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 
-    34, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 
-    237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 
-    237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 
-    237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 
-    237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 
-    237, 237, 237, 237, 237, 237, 237, 237, 223, 238, 238, 238, 238, 238, 
-    238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 
-    238, 238, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 
+    34, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 
+    241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 
+    241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 
+    241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 
+    241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 
+    241, 241, 241, 241, 241, 241, 241, 241, 227, 242, 242, 242, 242, 242, 
+    242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 
+    242, 242, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 
     30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 
     30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 
     30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 
@@ -1745,14 +1753,14 @@
     26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
     26, 26, 26, 26, 26, 26, 26, 30, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
     26, 26, 26, 26, 26, 26, 163, 164, 163, 164, 163, 164, 163, 164, 163, 164, 
-    163, 164, 163, 164, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 
+    163, 164, 163, 164, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 
     153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 
     153, 153, 153, 153, 153, 153, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
     26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
-    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 228, 78, 78, 
-    228, 228, 163, 164, 78, 228, 228, 78, 228, 228, 228, 78, 78, 78, 78, 78, 
-    228, 228, 228, 228, 78, 78, 78, 78, 78, 228, 228, 228, 78, 78, 78, 228, 
-    228, 228, 228, 9, 10, 9, 10, 9, 10, 9, 10, 163, 164, 78, 78, 78, 78, 78, 
+    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 232, 78, 78, 
+    232, 232, 163, 164, 78, 232, 232, 78, 232, 232, 232, 78, 78, 78, 78, 78, 
+    232, 232, 232, 232, 78, 78, 78, 78, 78, 232, 232, 232, 78, 78, 78, 232, 
+    232, 232, 232, 9, 10, 9, 10, 9, 10, 9, 10, 163, 164, 78, 78, 78, 78, 78, 
     78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 80, 80, 80, 80, 80, 80, 80, 
     80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 
     80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 
@@ -1769,30 +1777,30 @@
     78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 
     78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 
     163, 164, 9, 10, 163, 164, 163, 164, 163, 164, 163, 164, 163, 164, 163, 
-    164, 163, 164, 163, 164, 163, 164, 78, 78, 228, 228, 228, 228, 228, 228, 
-    228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 
-    228, 78, 78, 78, 78, 78, 78, 78, 78, 228, 78, 78, 78, 78, 78, 78, 78, 
-    228, 228, 228, 228, 228, 228, 78, 78, 78, 228, 78, 78, 78, 78, 228, 228, 
-    228, 228, 228, 78, 228, 228, 78, 78, 163, 164, 163, 164, 228, 78, 78, 78, 
-    78, 228, 78, 228, 228, 228, 78, 78, 228, 228, 78, 78, 78, 78, 78, 78, 78, 
-    78, 78, 78, 228, 228, 228, 228, 228, 228, 78, 78, 163, 164, 78, 78, 78, 
-    78, 78, 78, 78, 78, 78, 78, 78, 78, 228, 228, 222, 228, 228, 228, 228, 
-    228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 78, 228, 228, 
-    228, 228, 78, 78, 228, 78, 228, 78, 78, 228, 78, 228, 228, 228, 228, 78, 
-    78, 78, 78, 78, 228, 228, 78, 78, 78, 78, 78, 78, 228, 228, 228, 78, 78, 
+    164, 163, 164, 163, 164, 163, 164, 78, 78, 232, 232, 232, 232, 232, 232, 
+    232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 
+    232, 78, 78, 78, 78, 78, 78, 78, 78, 232, 78, 78, 78, 78, 78, 78, 78, 
+    232, 232, 232, 232, 232, 232, 78, 78, 78, 232, 78, 78, 78, 78, 232, 232, 
+    232, 232, 232, 78, 232, 232, 78, 78, 163, 164, 163, 164, 232, 78, 78, 78, 
+    78, 232, 78, 232, 232, 232, 78, 78, 232, 232, 78, 78, 78, 78, 78, 78, 78, 
+    78, 78, 78, 232, 232, 232, 232, 232, 232, 78, 78, 163, 164, 78, 78, 78, 
+    78, 78, 78, 78, 78, 78, 78, 78, 78, 232, 232, 226, 232, 232, 232, 232, 
+    232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 78, 232, 232, 
+    232, 232, 78, 78, 232, 78, 232, 78, 78, 232, 78, 232, 232, 232, 232, 78, 
+    78, 78, 78, 78, 232, 232, 78, 78, 78, 78, 78, 78, 232, 232, 232, 78, 78, 
     78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 
-    78, 78, 78, 78, 228, 228, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 
-    228, 228, 78, 78, 78, 78, 228, 228, 228, 228, 78, 228, 228, 78, 78, 228, 
-    222, 212, 212, 78, 78, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 
-    228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 
-    228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 
-    228, 228, 228, 228, 228, 78, 78, 228, 228, 228, 228, 228, 228, 228, 228, 
-    78, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 
-    228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 
-    228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 78, 78, 78, 
-    78, 78, 239, 78, 228, 78, 78, 78, 228, 228, 228, 228, 228, 78, 78, 78, 
-    78, 78, 228, 228, 228, 78, 78, 78, 78, 228, 78, 78, 78, 228, 228, 228, 
-    228, 228, 78, 228, 78, 78, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
+    78, 78, 78, 78, 232, 232, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 
+    232, 232, 78, 78, 78, 78, 232, 232, 232, 232, 78, 232, 232, 78, 78, 232, 
+    226, 216, 216, 78, 78, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 
+    232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 
+    232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 
+    232, 232, 232, 232, 232, 78, 78, 232, 232, 232, 232, 232, 232, 232, 232, 
+    78, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 
+    232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 
+    232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 78, 78, 78, 
+    78, 78, 243, 78, 232, 78, 78, 78, 232, 232, 232, 232, 232, 78, 78, 78, 
+    78, 78, 232, 232, 232, 78, 78, 78, 78, 232, 78, 78, 78, 232, 232, 232, 
+    232, 232, 78, 232, 78, 78, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
     26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
     26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
     26, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 
@@ -1838,105 +1846,105 @@
     138, 52, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 84, 84, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 240, 240, 240, 240, 
-    240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 
-    240, 240, 240, 240, 240, 240, 240, 240, 0, 240, 240, 240, 240, 241, 240, 
-    240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 
-    240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 
-    240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 
-    240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 
-    240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 
-    240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 241, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 241, 241, 241, 241, 241, 241, 241, 241, 241, 
-    241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 
-    241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 
-    241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 
-    241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 
-    241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 
-    241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 
-    241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 
-    241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 
-    241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 
-    241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 
-    241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 
-    241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 
-    241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 
-    241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 
-    241, 241, 241, 241, 241, 241, 241, 241, 241, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 240, 240, 240, 240, 
-    240, 240, 240, 240, 240, 240, 240, 240, 0, 0, 0, 0, 242, 243, 243, 243, 
-    240, 244, 170, 245, 246, 247, 246, 247, 246, 247, 246, 247, 246, 247, 
-    240, 240, 246, 247, 246, 247, 246, 247, 246, 247, 248, 249, 250, 250, 
-    240, 245, 245, 245, 245, 245, 245, 245, 245, 245, 251, 252, 253, 254, 
-    255, 255, 248, 244, 244, 244, 244, 244, 241, 240, 256, 256, 256, 244, 
-    170, 243, 240, 26, 0, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 
-    170, 257, 170, 257, 170, 257, 170, 257, 170, 257, 170, 257, 170, 257, 
-    170, 257, 170, 257, 170, 257, 170, 257, 170, 257, 170, 170, 257, 170, 
-    257, 170, 257, 170, 170, 170, 170, 170, 170, 257, 257, 170, 257, 257, 
-    170, 257, 257, 170, 257, 257, 170, 257, 257, 170, 170, 170, 170, 170, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 244, 244, 244, 244, 
+    244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 
+    244, 244, 244, 244, 244, 244, 244, 244, 0, 244, 244, 244, 244, 245, 244, 
+    244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 
+    244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 
+    244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 
+    244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 
+    244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 
+    244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 245, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 245, 245, 245, 245, 245, 245, 245, 245, 245, 
+    245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 
+    245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 
+    245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 
+    245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 
+    245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 
+    245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 
+    245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 
+    245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 
+    245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 
+    245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 
+    245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 
+    245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 
+    245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 
+    245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 
+    245, 245, 245, 245, 245, 245, 245, 245, 245, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 244, 244, 244, 244, 
+    244, 244, 244, 244, 244, 244, 244, 244, 0, 0, 0, 0, 246, 247, 247, 247, 
+    244, 248, 170, 249, 250, 251, 250, 251, 250, 251, 250, 251, 250, 251, 
+    244, 244, 250, 251, 250, 251, 250, 251, 250, 251, 252, 253, 254, 254, 
+    244, 249, 249, 249, 249, 249, 249, 249, 249, 249, 255, 256, 257, 258, 
+    259, 259, 252, 248, 248, 248, 248, 248, 245, 244, 260, 260, 260, 248, 
+    170, 247, 244, 26, 0, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 
+    170, 261, 170, 261, 170, 261, 170, 261, 170, 261, 170, 261, 170, 261, 
+    170, 261, 170, 261, 170, 261, 170, 261, 170, 261, 170, 170, 261, 170, 
+    261, 170, 261, 170, 170, 170, 170, 170, 170, 261, 261, 170, 261, 261, 
+    170, 261, 261, 170, 261, 261, 170, 261, 261, 170, 170, 170, 170, 170, 
     170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 
-    170, 170, 170, 257, 170, 170, 0, 0, 258, 258, 259, 259, 244, 260, 261, 
-    248, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 257, 170, 
-    257, 170, 257, 170, 257, 170, 257, 170, 257, 170, 257, 170, 257, 170, 
-    257, 170, 257, 170, 257, 170, 257, 170, 170, 257, 170, 257, 170, 257, 
-    170, 170, 170, 170, 170, 170, 257, 257, 170, 257, 257, 170, 257, 257, 
-    170, 257, 257, 170, 257, 257, 170, 170, 170, 170, 170, 170, 170, 170, 
+    170, 170, 170, 261, 170, 170, 0, 0, 262, 262, 263, 263, 248, 264, 265, 
+    252, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 261, 170, 
+    261, 170, 261, 170, 261, 170, 261, 170, 261, 170, 261, 170, 261, 170, 
+    261, 170, 261, 170, 261, 170, 261, 170, 170, 261, 170, 261, 170, 261, 
+    170, 170, 170, 170, 170, 170, 261, 261, 170, 261, 261, 170, 261, 261, 
+    170, 261, 261, 170, 261, 261, 170, 170, 170, 170, 170, 170, 170, 170, 
     170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 
-    257, 170, 170, 257, 257, 257, 257, 243, 244, 244, 260, 261, 0, 0, 0, 0, 
+    261, 170, 170, 261, 261, 261, 261, 247, 248, 248, 264, 265, 0, 0, 0, 0, 
     0, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 
     170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 
     170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 0, 0, 0, 
-    261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 
-    261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 
-    261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 
-    261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 
-    261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 
-    261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 
-    261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 0, 262, 262, 263, 263, 
-    263, 263, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 170, 170, 
+    265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 
+    265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 
+    265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 
+    265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 
+    265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 
+    265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 
+    265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 0, 266, 266, 267, 267, 
+    267, 267, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 170, 170, 
     170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 
     170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 0, 0, 0, 0, 0, 
-    240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 
-    240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 
-    240, 240, 240, 240, 240, 240, 240, 240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 
+    244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 
+    244, 244, 244, 244, 244, 244, 244, 244, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 
-    170, 170, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 
-    264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 
-    264, 264, 264, 241, 241, 0, 263, 263, 263, 263, 263, 263, 263, 263, 263, 
-    263, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 
-    264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 
-    264, 264, 264, 265, 265, 265, 265, 265, 265, 265, 265, 241, 266, 266, 
-    266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 264, 
-    264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 
-    264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 241, 
-    241, 241, 262, 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, 264, 
-    264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 
-    264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 
-    264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 266, 266, 266, 266, 
-    266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 264, 264, 264, 
-    264, 264, 264, 264, 264, 264, 264, 264, 264, 241, 241, 241, 241, 264, 
-    264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 
-    264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 
-    264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 
-    264, 264, 264, 264, 0, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 
-    264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 
-    264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 
-    264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 
-    264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 
-    264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 
-    264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 
-    264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 
-    264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 241, 241, 241, 
-    241, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 
-    264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 
-    264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 
-    264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 
-    264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 
-    264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 
-    264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 
-    264, 264, 241, 241, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 
-    264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 
-    264, 264, 264, 264, 264, 264, 264, 241, 170, 170, 170, 170, 170, 170, 
+    170, 170, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 
+    268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 
+    268, 268, 268, 245, 245, 0, 267, 267, 267, 267, 267, 267, 267, 267, 267, 
+    267, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 
+    268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 
+    268, 268, 268, 269, 269, 269, 269, 269, 269, 269, 269, 245, 270, 270, 
+    270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 268, 
+    268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 
+    268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 245, 
+    245, 245, 266, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 268, 
+    268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 
+    268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 
+    268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 270, 270, 270, 270, 
+    270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 268, 268, 268, 
+    268, 268, 268, 268, 268, 268, 268, 268, 268, 245, 245, 245, 245, 268, 
+    268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 
+    268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 
+    268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 
+    268, 268, 268, 268, 0, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 
+    268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 
+    268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 
+    268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 
+    268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 
+    268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 
+    268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 
+    268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 
+    268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 245, 245, 245, 
+    245, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 
+    268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 
+    268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 
+    268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 
+    268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 
+    268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 
+    268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 
+    268, 268, 245, 245, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 
+    268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 
+    268, 268, 268, 268, 268, 268, 268, 245, 170, 170, 170, 170, 170, 170, 
     170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 
     170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 
     170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 
@@ -1962,7 +1970,7 @@
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 
-    170, 170, 170, 170, 170, 170, 170, 170, 244, 170, 170, 170, 170, 170, 
+    170, 170, 170, 170, 170, 170, 170, 170, 248, 170, 170, 170, 170, 170, 
     170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 
     170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 
     170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 
@@ -1971,11 +1979,11 @@
     170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 
     170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 
     170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 
-    170, 170, 0, 0, 0, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 
-    240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 
-    240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 
-    240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 
-    240, 240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    170, 170, 0, 0, 0, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 
+    244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 
+    244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 
+    244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 
+    244, 244, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 53, 53, 53, 53, 53, 
     53, 83, 83, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 53, 138, 138, 
@@ -1999,7 +2007,7 @@
     44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 
     44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 
     44, 47, 44, 47, 44, 47, 51, 47, 47, 47, 47, 47, 47, 47, 47, 44, 47, 44, 
-    47, 44, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 52, 267, 267, 44, 47, 44, 
+    47, 44, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 52, 271, 271, 44, 47, 44, 
     47, 0, 44, 47, 44, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 47, 44, 
     47, 44, 47, 44, 47, 44, 47, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
@@ -2008,7 +2016,7 @@
     48, 48, 48, 135, 48, 48, 48, 142, 48, 48, 48, 48, 135, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
     48, 139, 139, 135, 135, 139, 26, 26, 26, 26, 0, 0, 0, 0, 148, 148, 148, 
-    148, 148, 148, 80, 80, 85, 221, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 
+    148, 148, 148, 80, 80, 85, 225, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 138, 138, 138, 138, 0, 0, 0, 0, 
@@ -2024,13 +2032,13 @@
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 135, 135, 135, 135, 135, 86, 
     86, 86, 83, 83, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 135, 135, 135, 135, 135, 135, 135, 
-    135, 135, 135, 135, 139, 174, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 170, 
+    135, 135, 135, 135, 139, 175, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 170, 
     170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 
     170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 0, 
     0, 0, 135, 135, 135, 139, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 145, 
-    139, 139, 135, 135, 135, 135, 139, 139, 135, 139, 139, 139, 174, 83, 83, 
+    139, 139, 135, 135, 135, 135, 139, 139, 135, 139, 139, 139, 175, 83, 83, 
     83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 0, 53, 144, 144, 144, 144, 
     144, 144, 144, 144, 144, 144, 0, 0, 0, 0, 83, 83, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
@@ -2060,497 +2068,496 @@
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 139, 139, 135, 139, 139, 135, 139, 139, 83, 139, 
     142, 0, 0, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 0, 0, 0, 0, 
-    0, 0, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 
-    257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 
-    257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 
-    257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 
-    257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 
-    257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 
-    257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 
-    257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 
-    257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 
-    257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 
-    257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 
-    257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 
-    170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 0, 0, 0, 0, 
-    170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 
-    170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 
-    170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 
-    170, 170, 170, 170, 170, 170, 170, 0, 0, 0, 0, 268, 268, 268, 268, 268, 
-    268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 
-    268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 
-    268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 
-    268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 
-    268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 
-    268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 
-    268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 
-    268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 
-    268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 269, 269, 269, 
-    269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 
-    269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 
-    269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 
-    269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 
-    269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 
-    269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 
-    269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 
-    269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 
-    269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 270, 
-    270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 
-    270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 
-    270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 
-    270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 
-    270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 
-    270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 
-    270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 
-    270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 
-    270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 
-    270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 
-    270, 170, 170, 270, 170, 270, 170, 170, 270, 270, 270, 270, 270, 270, 
-    270, 270, 270, 270, 170, 270, 170, 270, 170, 170, 270, 270, 170, 170, 
-    170, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 
-    270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 
-    270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 
-    270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 
-    270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 0, 0, 
-    270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 
-    270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 
-    270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 
-    270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 
-    270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 
-    270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 
-    270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 
-    270, 270, 270, 270, 270, 270, 270, 270, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 35, 35, 35, 35, 35, 35, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    35, 35, 35, 35, 35, 0, 0, 0, 0, 0, 271, 272, 271, 273, 273, 273, 273, 
-    273, 273, 273, 273, 273, 211, 271, 271, 271, 271, 271, 271, 271, 271, 
-    271, 271, 271, 271, 271, 0, 271, 271, 271, 271, 271, 0, 271, 0, 271, 271, 
-    0, 271, 271, 0, 271, 271, 271, 271, 271, 271, 271, 271, 271, 273, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 274, 
+    0, 0, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 
+    261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 
+    261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 
+    261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 
+    261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 
+    261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 
+    261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 
+    261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 
+    261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 
+    261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 
+    261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 
+    261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 0, 0, 0, 0, 272, 272, 272, 272, 272, 272, 
+    272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 
+    272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 
+    272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 
+    272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 
+    272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 
+    272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 
+    272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 
+    272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 
+    272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 273, 273, 273, 273, 
+    273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 
+    273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 
+    273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 
+    273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 
+    273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 
+    273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 
+    273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 
+    273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 
+    273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 274, 274, 
     274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 
-    274, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 195, 275, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 0, 0, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 0, 0, 0, 0, 0, 0, 
+    274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 
+    274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 
+    274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 
+    274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 
+    274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 
+    274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 
+    274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 
+    274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 
+    274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 
+    170, 170, 274, 170, 274, 170, 170, 274, 274, 274, 274, 274, 274, 274, 
+    274, 274, 274, 170, 274, 170, 274, 170, 170, 274, 274, 170, 170, 170, 
+    274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 
+    274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 
+    274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 
+    274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 
+    274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 0, 0, 274, 
+    274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 
+    274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 
+    274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 
+    274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 
+    274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 
+    274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 
+    274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 
+    274, 274, 274, 274, 274, 274, 274, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 130, 130, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 130, 276, 26, 0, 0, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
-    71, 71, 71, 71, 71, 71, 71, 277, 277, 277, 277, 277, 277, 277, 278, 279, 
-    277, 0, 0, 0, 0, 0, 0, 81, 81, 81, 81, 81, 81, 81, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 277, 280, 280, 281, 281, 278, 279, 278, 279, 278, 279, 278, 279, 
-    278, 279, 278, 279, 278, 279, 278, 279, 243, 243, 278, 279, 277, 277, 
-    277, 277, 281, 281, 281, 282, 277, 282, 0, 277, 282, 277, 277, 280, 283, 
-    284, 283, 284, 283, 284, 285, 277, 277, 286, 287, 288, 288, 289, 0, 277, 
-    290, 285, 277, 0, 0, 0, 0, 130, 130, 130, 117, 130, 0, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 0, 0, 187, 0, 291, 291, 292, 293, 292, 291, 
-    291, 294, 295, 291, 296, 297, 298, 297, 297, 299, 299, 299, 299, 299, 
-    299, 299, 299, 299, 299, 297, 291, 300, 301, 300, 291, 291, 302, 302, 
-    302, 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, 
-    302, 302, 302, 302, 302, 302, 302, 302, 302, 302, 294, 291, 295, 303, 
-    304, 303, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 
-    305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 
-    294, 301, 295, 301, 294, 295, 306, 307, 308, 306, 306, 309, 309, 309, 
-    309, 309, 309, 309, 309, 309, 309, 310, 309, 309, 309, 309, 309, 309, 
-    309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 
-    309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 
-    309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 310, 310, 309, 
-    309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 
-    309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 
-    309, 309, 0, 0, 0, 309, 309, 309, 309, 309, 309, 0, 0, 309, 309, 309, 
-    309, 309, 309, 0, 0, 309, 309, 309, 309, 309, 309, 0, 0, 309, 309, 309, 
-    0, 0, 0, 293, 293, 301, 303, 311, 293, 293, 0, 312, 313, 313, 313, 313, 
-    312, 312, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 314, 314, 314, 26, 30, 0, 0, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 0, 48, 48, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 0, 0, 0, 0, 0, 83, 138, 83, 0, 0, 0, 0, 148, 148, 
-    148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 
-    148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 
-    148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 
-    148, 0, 0, 0, 80, 80, 80, 80, 80, 80, 80, 80, 80, 315, 315, 315, 315, 
-    315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 
-    315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 
-    315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 
-    315, 315, 315, 315, 315, 315, 315, 153, 153, 153, 153, 26, 26, 26, 26, 
-    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 153, 0, 0, 0, 0, 0, 
-    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 35, 35, 35, 35, 35, 35, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 
+    35, 35, 35, 35, 0, 0, 0, 0, 0, 275, 276, 275, 277, 277, 277, 277, 277, 
+    277, 277, 277, 277, 215, 275, 275, 275, 275, 275, 275, 275, 275, 275, 
+    275, 275, 275, 275, 0, 275, 275, 275, 275, 275, 0, 275, 0, 275, 275, 0, 
+    275, 275, 0, 275, 275, 275, 275, 275, 275, 275, 275, 275, 277, 131, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 278, 278, 
+    278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 131, 131, 131, 131, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 
+    131, 131, 131, 131, 131, 131, 195, 279, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 0, 0, 131, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 80, 80, 
+    0, 0, 0, 0, 0, 0, 0, 0, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 
+    131, 131, 280, 26, 0, 0, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
+    71, 71, 71, 71, 281, 281, 281, 281, 281, 281, 281, 282, 283, 281, 0, 0, 
+    0, 0, 0, 0, 81, 81, 81, 81, 81, 81, 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 281, 
+    284, 284, 285, 285, 282, 283, 282, 283, 282, 283, 282, 283, 282, 283, 
+    282, 283, 282, 283, 282, 283, 247, 247, 282, 283, 281, 281, 281, 281, 
+    285, 285, 285, 286, 281, 286, 0, 281, 286, 281, 281, 284, 287, 288, 287, 
+    288, 287, 288, 289, 281, 281, 290, 291, 292, 292, 293, 0, 281, 294, 289, 
+    281, 0, 0, 0, 0, 131, 131, 131, 118, 131, 0, 131, 131, 131, 131, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 
+    131, 131, 131, 131, 0, 0, 174, 0, 295, 295, 296, 297, 296, 295, 295, 298, 
+    299, 295, 300, 301, 302, 301, 301, 303, 303, 303, 303, 303, 303, 303, 
+    303, 303, 303, 301, 295, 304, 305, 304, 295, 295, 306, 306, 306, 306, 
+    306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 
+    306, 306, 306, 306, 306, 306, 306, 306, 298, 295, 299, 307, 308, 307, 
+    309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 
+    309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 298, 305, 
+    299, 305, 298, 299, 310, 311, 312, 310, 310, 313, 313, 313, 313, 313, 
+    313, 313, 313, 313, 313, 314, 313, 313, 313, 313, 313, 313, 313, 313, 
+    313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 
+    313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 
+    313, 313, 313, 313, 313, 313, 313, 313, 313, 314, 314, 313, 313, 313, 
+    313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 
+    313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 0, 
+    0, 0, 313, 313, 313, 313, 313, 313, 0, 0, 313, 313, 313, 313, 313, 313, 
+    0, 0, 313, 313, 313, 313, 313, 313, 0, 0, 313, 313, 313, 0, 0, 0, 297, 
+    297, 305, 307, 315, 297, 297, 0, 316, 317, 317, 317, 317, 316, 316, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 318, 318, 318, 26, 30, 0, 0, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    0, 48, 48, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 0, 0, 0, 0, 0, 83, 138, 83, 0, 0, 0, 0, 148, 148, 148, 148, 148, 148, 
+    148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 
+    148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 
+    148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 0, 0, 0, 80, 80, 
+    80, 80, 80, 80, 80, 80, 80, 319, 319, 319, 319, 319, 319, 319, 319, 319, 
+    319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 
+    319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 
+    319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 
+    319, 319, 153, 153, 153, 153, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
+    26, 26, 26, 26, 26, 26, 153, 0, 0, 0, 0, 0, 26, 26, 26, 26, 26, 26, 26, 
+    26, 26, 26, 26, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 
     80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 
-    80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 
-    80, 80, 80, 80, 80, 80, 86, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 86, 0, 0, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 148, 148, 148, 148, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 173, 48, 48, 48, 48, 48, 48, 48, 48, 173, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 83, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 0, 
-    0, 48, 48, 48, 48, 48, 48, 48, 48, 83, 173, 173, 173, 173, 173, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 44, 44, 44, 44, 44, 44, 
-    44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 
-    44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 47, 47, 47, 
-    47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 
-    47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 
-    47, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 0, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 0, 0, 144, 144, 144, 144, 144, 144, 144, 144, 
-    144, 144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 107, 107, 107, 107, 
-    107, 107, 0, 0, 107, 0, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
-    107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
-    107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
-    107, 107, 107, 107, 107, 107, 0, 107, 107, 0, 0, 0, 107, 0, 0, 107, 107, 
-    107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
-    107, 107, 107, 107, 107, 107, 107, 0, 104, 316, 316, 316, 316, 316, 316, 
-    316, 316, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 107, 107, 107, 107, 107, 107, 107, 107, 
-    107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
-    316, 316, 316, 316, 316, 316, 0, 0, 0, 138, 107, 107, 107, 107, 107, 107, 
-    107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
-    107, 107, 107, 107, 107, 107, 0, 0, 0, 0, 0, 104, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
-    107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
-    107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
-    107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
-    107, 107, 107, 107, 0, 0, 0, 0, 0, 0, 107, 107, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 107, 135, 135, 135, 0, 135, 135, 0, 0, 0, 0, 0, 
-    135, 86, 135, 81, 107, 107, 107, 107, 0, 107, 107, 107, 0, 107, 107, 107, 
-    107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
-    107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 0, 0, 0, 0, 81, 175, 
-    86, 0, 0, 0, 0, 142, 316, 316, 316, 316, 316, 316, 316, 316, 0, 0, 0, 0, 
-    0, 0, 0, 0, 104, 104, 104, 104, 104, 104, 104, 104, 104, 0, 0, 0, 0, 0, 
-    0, 0, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
-    107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
-    107, 107, 316, 316, 104, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
-    107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
-    107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
-    107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
-    107, 107, 107, 0, 0, 0, 138, 138, 138, 138, 138, 138, 138, 107, 107, 107, 
-    107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
-    107, 107, 107, 107, 107, 0, 0, 316, 316, 316, 316, 316, 316, 316, 316, 
-    107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
-    107, 107, 107, 107, 107, 0, 0, 0, 0, 0, 316, 316, 316, 316, 316, 316, 
-    316, 316, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
-    107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
-    107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
-    107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
-    107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
-    107, 107, 107, 107, 107, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 317, 317, 317, 317, 317, 
-    317, 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, 
-    317, 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, 0, 139, 135, 
-    139, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 
-    142, 83, 83, 83, 83, 83, 83, 83, 0, 0, 0, 0, 153, 153, 153, 153, 153, 
-    153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 
-    153, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 135, 135, 139, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 140, 48, 
-    140, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 140, 48, 48, 
-    48, 48, 139, 139, 139, 135, 135, 135, 135, 139, 139, 142, 141, 83, 83, 
-    188, 83, 83, 83, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 0, 0, 0, 0, 0, 0, 0, 144, 144, 144, 144, 144, 144, 
-    144, 144, 144, 144, 0, 0, 0, 0, 0, 0, 81, 81, 81, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 149, 135, 135, 135, 135, 
-    139, 135, 150, 150, 135, 135, 135, 142, 142, 0, 144, 144, 144, 144, 144, 
-    144, 144, 144, 144, 144, 83, 83, 83, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 135, 135, 139, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 139, 139, 
-    139, 135, 135, 135, 135, 135, 135, 135, 135, 135, 139, 174, 48, 48, 48, 
-    48, 83, 83, 83, 83, 0, 0, 0, 0, 0, 0, 0, 144, 144, 144, 144, 144, 144, 
-    144, 144, 144, 144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 135, 139, 135, 139, 139, 135, 135, 135, 135, 135, 135, 
-    174, 145, 0, 0, 0, 0, 0, 0, 0, 0, 144, 144, 144, 144, 144, 144, 144, 144, 
-    144, 144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 
-    173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 
-    173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 
-    173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 
-    173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 
-    173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 
-    173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 
-    173, 173, 173, 173, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 83, 83, 
-    83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    48, 48, 0, 148, 148, 148, 148, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 173, 48, 
+    48, 48, 48, 48, 48, 48, 48, 173, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 0, 83, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 
+    48, 83, 173, 173, 173, 173, 173, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 
+    44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 
+    44, 44, 44, 44, 44, 44, 44, 44, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 
+    47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 
+    47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
     48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    0, 0, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 107, 107, 107, 107, 107, 107, 0, 0, 107, 0, 107, 
+    107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
+    107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
+    107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
+    107, 0, 107, 107, 0, 0, 0, 107, 0, 0, 107, 107, 107, 107, 107, 107, 107, 
+    107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
+    107, 107, 0, 104, 320, 320, 320, 320, 320, 320, 320, 320, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
+    107, 107, 107, 107, 107, 107, 107, 107, 107, 320, 320, 320, 320, 320, 
+    320, 0, 0, 0, 138, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
+    107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
+    107, 0, 0, 0, 0, 0, 104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
+    107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
+    107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
+    107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 0, 
+    0, 0, 0, 0, 0, 107, 107, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    107, 135, 135, 135, 0, 135, 135, 0, 0, 0, 0, 0, 135, 86, 135, 81, 107, 
+    107, 107, 107, 0, 107, 107, 107, 0, 107, 107, 107, 107, 107, 107, 107, 
+    107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
+    107, 107, 107, 107, 107, 107, 0, 0, 0, 0, 81, 176, 86, 0, 0, 0, 0, 142, 
+    320, 320, 320, 320, 320, 320, 320, 320, 0, 0, 0, 0, 0, 0, 0, 0, 104, 104, 
+    104, 104, 104, 104, 104, 104, 104, 0, 0, 0, 0, 0, 0, 0, 107, 107, 107, 
+    107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
+    107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 320, 320, 
+    104, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
+    107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
+    107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
+    107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 0, 0, 0, 
+    138, 138, 138, 138, 138, 138, 138, 107, 107, 107, 107, 107, 107, 107, 
+    107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
+    107, 0, 0, 320, 320, 320, 320, 320, 320, 320, 320, 107, 107, 107, 107, 
+    107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
+    107, 0, 0, 0, 0, 0, 320, 320, 320, 320, 320, 320, 320, 320, 107, 107, 
+    107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
+    107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
+    107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
+    107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
+    107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 
+    107, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 
+    321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 
+    321, 321, 321, 321, 321, 321, 321, 0, 139, 135, 139, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 135, 135, 135, 135, 135, 
+    135, 135, 135, 135, 135, 135, 135, 135, 135, 142, 83, 83, 83, 83, 83, 83, 
+    83, 0, 0, 0, 0, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 
+    153, 153, 153, 153, 153, 153, 153, 153, 153, 144, 144, 144, 144, 144, 
+    144, 144, 144, 144, 144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    135, 135, 139, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 140, 48, 140, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 140, 48, 48, 48, 48, 139, 139, 139, 135, 
+    135, 135, 135, 139, 139, 142, 141, 83, 83, 188, 83, 83, 83, 83, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 0, 0, 
+    0, 0, 0, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 0, 0, 0, 0, 0, 
+    0, 81, 81, 81, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 149, 135, 135, 135, 135, 139, 135, 150, 150, 135, 135, 
+    135, 142, 142, 0, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 83, 
+    83, 83, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 135, 135, 139, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 139, 139, 139, 135, 135, 135, 
+    135, 135, 135, 135, 135, 135, 139, 175, 48, 48, 48, 48, 83, 83, 83, 83, 
+    0, 0, 0, 0, 0, 0, 0, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 135, 
+    139, 135, 139, 139, 135, 135, 135, 135, 135, 135, 175, 145, 0, 0, 0, 0, 
+    0, 0, 0, 0, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 173, 
+    173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 
+    173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 
+    173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 
+    173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 
+    173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 
+    173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 
+    173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 83, 83, 83, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 
+    48, 48, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 139, 139, 139, 139, 139, 
     139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 
     139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 
-    139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 
-    139, 139, 139, 139, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 135, 
-    135, 135, 135, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 0, 0, 
+    139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 135, 135, 135, 135, 53, 53, 53, 
+    53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 170, 
-    170, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 170, 170, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 80, 
     80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 
     80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 
     80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 
     80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 
     80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 
-    80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 
     80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 
-    80, 80, 80, 80, 80, 80, 80, 0, 0, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 
+    80, 80, 80, 80, 80, 80, 80, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 80, 80, 
     80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 
     80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 
-    80, 80, 80, 80, 80, 80, 80, 318, 318, 318, 318, 318, 318, 318, 319, 319, 
-    175, 175, 175, 80, 80, 80, 320, 319, 319, 319, 319, 319, 187, 187, 187, 
-    187, 187, 187, 187, 187, 86, 86, 86, 86, 86, 86, 86, 86, 80, 80, 81, 81, 
-    81, 81, 81, 86, 86, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 
-    80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 81, 
-    81, 81, 81, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 318, 318, 
-    318, 318, 318, 318, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 
-    80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
+    0, 0, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 
+    80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 
+    80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 
+    322, 322, 322, 322, 322, 322, 322, 323, 323, 176, 176, 176, 80, 80, 80, 
+    324, 323, 323, 323, 323, 323, 174, 174, 174, 174, 174, 174, 174, 174, 86, 
+    86, 86, 86, 86, 86, 86, 86, 80, 80, 81, 81, 81, 81, 81, 86, 86, 80, 80, 
+    80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 
+    80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 81, 81, 81, 81, 80, 80, 80, 80, 
+    80, 80, 80, 80, 80, 80, 80, 80, 80, 322, 322, 322, 322, 322, 322, 80, 80, 
+    80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 
+    80, 80, 80, 80, 80, 80, 80, 80, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 26, 
     26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
     26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
-    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 81, 
-    81, 81, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
+    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 81, 81, 81, 26, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 26, 26, 26, 26, 26, 26, 26, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
     26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
     26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
     26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
     26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
-    26, 26, 26, 26, 26, 26, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 148, 148, 148, 
-    148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 
-    148, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 49, 49, 49, 49, 49, 
-    49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 
-    49, 49, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
-    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 49, 49, 49, 49, 49, 49, 49, 49, 
-    49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 
-    35, 35, 35, 35, 35, 35, 35, 0, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
-    35, 35, 35, 35, 35, 35, 35, 35, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 
-    49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 35, 35, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 148, 148, 148, 148, 148, 148, 148, 148, 148, 
+    148, 148, 148, 148, 148, 148, 148, 148, 148, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 
+    49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 35, 35, 35, 35, 35, 35, 
     35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
-    35, 35, 35, 35, 35, 35, 49, 0, 49, 49, 0, 0, 49, 0, 0, 49, 49, 0, 0, 49, 
-    49, 49, 49, 0, 49, 49, 49, 49, 49, 49, 49, 49, 35, 35, 35, 35, 0, 35, 0, 
-    35, 35, 35, 35, 35, 35, 35, 0, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
+    35, 35, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 
+    49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 35, 35, 35, 35, 35, 35, 35, 0, 
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
+    49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 
+    49, 49, 49, 49, 49, 49, 49, 49, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 49, 0, 
+    49, 49, 0, 0, 49, 0, 0, 49, 49, 0, 0, 49, 49, 49, 49, 0, 49, 49, 49, 49, 
+    49, 49, 49, 49, 35, 35, 35, 35, 0, 35, 0, 35, 35, 35, 35, 35, 35, 35, 0, 
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 49, 49, 49, 49, 49, 49, 49, 
+    49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 
+    49, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 49, 49, 0, 49, 49, 49, 49, 0, 0, 49, 
+    49, 49, 49, 49, 49, 49, 49, 0, 49, 49, 49, 49, 49, 49, 49, 0, 35, 35, 35, 
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
+    35, 35, 35, 35, 35, 49, 49, 0, 49, 49, 49, 49, 0, 49, 49, 49, 49, 49, 0, 
+    49, 0, 0, 0, 49, 49, 49, 49, 49, 49, 49, 0, 35, 35, 35, 35, 35, 35, 35, 
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
     35, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 
     49, 49, 49, 49, 49, 49, 49, 49, 49, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
     35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 49, 
-    49, 0, 49, 49, 49, 49, 0, 0, 49, 49, 49, 49, 49, 49, 49, 49, 0, 49, 49, 
-    49, 49, 49, 49, 49, 0, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
-    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 49, 49, 0, 49, 
-    49, 49, 49, 0, 49, 49, 49, 49, 49, 0, 49, 0, 0, 0, 49, 49, 49, 49, 49, 
-    49, 49, 0, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
+    49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 
+    49, 49, 49, 49, 49, 49, 49, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 49, 49, 49, 
+    49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 
+    49, 49, 49, 49, 49, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 49, 49, 49, 49, 49, 
+    49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 
+    49, 49, 49, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
     35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 49, 49, 49, 49, 49, 49, 49, 
     49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 
     49, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
     35, 35, 35, 35, 35, 35, 35, 35, 35, 49, 49, 49, 49, 49, 49, 49, 49, 49, 
     49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 35, 
     35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
-    35, 35, 35, 35, 35, 35, 35, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 
-    49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 35, 35, 35, 
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 0, 0, 49, 49, 49, 49, 49, 49, 49, 49, 
+    49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 325, 
     35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
-    35, 35, 35, 35, 35, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 
-    49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 35, 35, 35, 35, 35, 
-    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
-    35, 35, 35, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 
-    49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 35, 35, 35, 35, 35, 35, 35, 
-    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
-    35, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 
-    49, 49, 49, 49, 49, 49, 49, 49, 49, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
-    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
-    35, 0, 0, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 
-    49, 49, 49, 49, 49, 49, 49, 49, 49, 321, 35, 35, 35, 35, 35, 35, 35, 35, 
-    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 222, 
-    35, 35, 35, 35, 35, 35, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 
-    49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 321, 35, 35, 35, 35, 
-    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
-    35, 35, 35, 222, 35, 35, 35, 35, 35, 35, 49, 49, 49, 49, 49, 49, 49, 49, 
-    49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 321, 
-    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
-    35, 35, 35, 35, 35, 35, 35, 222, 35, 35, 35, 35, 35, 35, 49, 49, 49, 49, 
+    35, 35, 35, 35, 35, 35, 35, 226, 35, 35, 35, 35, 35, 35, 49, 49, 49, 49, 
     49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 
-    49, 49, 49, 321, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
-    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 222, 35, 35, 35, 35, 35, 35, 
+    49, 49, 49, 325, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 226, 35, 35, 35, 35, 35, 35, 
     49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 
-    49, 49, 49, 49, 49, 49, 49, 321, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
-    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 222, 35, 35, 
-    35, 35, 35, 35, 49, 35, 0, 0, 322, 322, 322, 322, 322, 322, 322, 322, 
-    322, 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, 
-    322, 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, 
-    322, 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, 
-    130, 130, 130, 130, 0, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 0, 130, 130, 0, 130, 0, 0, 130, 0, 130, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 0, 130, 130, 130, 130, 0, 130, 0, 130, 0, 
-    0, 0, 0, 0, 0, 130, 0, 0, 0, 0, 130, 0, 130, 0, 130, 0, 130, 130, 130, 0, 
-    130, 130, 0, 130, 0, 0, 130, 0, 130, 0, 130, 0, 130, 0, 130, 0, 130, 130, 
-    0, 130, 0, 0, 130, 130, 130, 130, 0, 130, 130, 130, 130, 130, 130, 130, 
-    0, 130, 130, 130, 130, 0, 130, 130, 130, 130, 0, 130, 0, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 0, 130, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 0, 0, 0, 0, 0, 130, 
-    130, 130, 0, 130, 130, 130, 130, 130, 0, 130, 130, 130, 130, 130, 130, 
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 0, 0, 0, 0, 0, 0, 
+    49, 49, 49, 49, 49, 49, 49, 325, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 226, 35, 35, 
+    35, 35, 35, 35, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 
+    49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 325, 35, 35, 35, 35, 35, 35, 
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
+    35, 226, 35, 35, 35, 35, 35, 35, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 
+    49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 325, 35, 35, 
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
+    35, 35, 35, 35, 35, 226, 35, 35, 35, 35, 35, 35, 49, 35, 0, 0, 326, 326, 
+    326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 
+    326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 
+    326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 
+    326, 326, 326, 326, 326, 326, 131, 131, 131, 131, 0, 131, 131, 131, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 0, 131, 131, 0, 131, 0, 0, 
+    131, 0, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 0, 131, 131, 
+    131, 131, 0, 131, 0, 131, 0, 0, 0, 0, 0, 0, 131, 0, 0, 0, 0, 131, 0, 131, 
+    0, 131, 0, 131, 131, 131, 0, 131, 131, 0, 131, 0, 0, 131, 0, 131, 0, 131, 
+    0, 131, 0, 131, 0, 131, 131, 0, 131, 0, 0, 131, 131, 131, 131, 0, 131, 
+    131, 131, 131, 131, 131, 131, 0, 131, 131, 131, 131, 0, 131, 131, 131, 
+    131, 0, 131, 0, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 0, 131, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 
+    131, 131, 0, 0, 0, 0, 0, 131, 131, 131, 0, 131, 131, 131, 131, 131, 0, 
+    131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 
+    131, 131, 131, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 78, 78, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 26, 26, 26, 26, 26, 26, 26, 
-    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
-    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
-    0, 0, 0, 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
-    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
-    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
-    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
-    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
-    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
-    26, 0, 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 
-    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 26, 26, 
-    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 0, 0, 0, 0, 0, 237, 237, 
-    237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 
-    237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 
-    323, 0, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 
-    237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 
-    237, 237, 237, 237, 237, 324, 324, 324, 324, 324, 324, 324, 324, 324, 
-    324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 
-    324, 324, 324, 218, 218, 0, 0, 0, 0, 324, 324, 324, 324, 324, 324, 324, 
-    324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 
-    324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 237, 324, 324, 
-    324, 324, 324, 324, 324, 324, 324, 324, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 80, 80, 80, 80, 80, 
-    80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 
-    80, 80, 264, 264, 264, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 264, 264, 
-    264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 
-    264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 
-    264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 0, 0, 0, 
-    0, 0, 264, 264, 264, 264, 264, 264, 264, 264, 264, 0, 0, 0, 0, 0, 0, 0, 
-    264, 264, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 78, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
-    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 26, 26, 26, 26, 26, 0, 26, 26, 
+    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
+    26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 0, 0, 26, 26, 26, 26, 26, 26, 
     26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
     26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
     26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
-    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 0, 26, 26, 
-    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
-    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
-    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 26, 26, 26, 26, 26, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 26, 26, 26, 26, 
-    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
     26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
     26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
-    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 26, 0, 26, 26, 
+    26, 26, 26, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 26, 26, 26, 26, 
+    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 26, 26, 26, 26, 26, 26, 26, 
+    26, 26, 26, 26, 26, 26, 26, 0, 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
+    26, 26, 26, 26, 26, 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
+    26, 26, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 34, 34, 34, 34, 34, 34, 34, 34, 
+    34, 34, 0, 0, 0, 0, 0, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 
+    241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 
+    241, 241, 241, 241, 241, 241, 327, 0, 241, 241, 241, 241, 241, 241, 241, 
+    241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 
+    241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 328, 328, 328, 
+    328, 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, 
+    328, 328, 328, 328, 328, 328, 328, 328, 328, 222, 222, 0, 0, 0, 0, 328, 
+    328, 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, 
+    328, 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, 
+    328, 328, 328, 241, 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 
+    80, 80, 80, 80, 80, 80, 80, 80, 80, 268, 268, 268, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 
+    268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 
+    268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 
+    268, 268, 268, 268, 0, 0, 0, 0, 0, 268, 268, 268, 268, 268, 268, 268, 
+    268, 268, 0, 0, 0, 0, 0, 0, 0, 268, 268, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
+    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
+    26, 26, 26, 26, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 26, 
+    26, 26, 26, 26, 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
+    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
+    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
+    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
+    26, 26, 26, 0, 0, 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
+    26, 26, 26, 26, 26, 26, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 26, 
+    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
+    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 
+    26, 26, 26, 26, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
+    26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 26, 26, 26, 26, 26, 
+    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
+    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
+    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
+    26, 26, 26, 0, 26, 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
     26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
     26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
     26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
@@ -2560,77 +2567,76 @@
     26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
     26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
     26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
-    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
-    0, 26, 26, 26, 26, 0, 0, 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
+    26, 26, 26, 26, 26, 26, 26, 0, 26, 26, 26, 26, 0, 0, 0, 26, 26, 26, 26, 
     26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
     26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
-    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 26, 26, 
-    26, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 26, 26, 26, 26, 26, 26, 
+    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
+    26, 26, 26, 26, 0, 0, 26, 26, 26, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
+    26, 26, 26, 26, 26, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
+    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
+    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
+    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
+    26, 26, 26, 26, 26, 26, 0, 0, 0, 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
+    26, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
+    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
+    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
     26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
-    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
-    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
-    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 
-    0, 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 26, 26, 26, 26, 26, 
-    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
-    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
-    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
-    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 
+    0, 0, 0, 0, 0, 0, 0, 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
     26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
     26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
     26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
     26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
     26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
-    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 
-    26, 26, 26, 26, 26, 26, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 170, 170, 
+    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 
     170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 
     170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 
     170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 
     170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 
     170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 
-    170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 
-    170, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 170, 170, 170, 170, 
+    170, 170, 170, 170, 170, 170, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 
     170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 
     170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 
-    170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 
-    170, 170, 170, 170, 170, 170, 170, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 170, 
+    170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 
     170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 
     170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 
     170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 
     170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 
     170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 
-    170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 
-    170, 170, 170, 170, 170, 170, 170, 170, 170, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 270, 270, 270, 270, 
-    270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 
-    270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 
+    274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 
+    274, 274, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 187, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 
-    187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 
-    187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 
-    187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 
-    187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 
-    187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 
-    187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 
-    187, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
+    0, 0, 0, 0, 0, 0, 174, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 174, 174, 174, 174, 174, 174, 174, 
+    174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 
+    174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 
+    174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 
+    174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 
+    174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 
+    174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 
+    174, 174, 174, 174, 174, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
     71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
     71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
     71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
@@ -2643,17 +2649,17 @@
     71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
     71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
     71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
-    71, 71, 71, 71, 71, 71, 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 
-    269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 
-    269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 
-    269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 
-    269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 
-    269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 
-    269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 
-    269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 
-    269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 0, 
-    0, 
+    71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 
+    273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 
+    273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 
+    273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 
+    273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 
+    273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 
+    273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 
+    273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 
+    273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 
+    273, 273, 273, 273, 0, 0, 
 };
 
 /* decomposition data */
@@ -5178,7 +5184,6 @@
 	{ 255, 7, 8, 255, 0 },
 	{ 255, 7, 9, 255, 0 },
 	{ 1, 5, 255, 255, 0 },
-	{ 15, 14, 255, 255, 0 },
 	{ 255, 10, 255, 255, 0 },
 	{ 18, 255, 255, 255, 0 },
 	{ 19, 255, 255, 255, 0 },
@@ -5191,6 +5196,7 @@
 	{ 255, 255, 9, 255, 0 },
 	{ 19, 30, 255, 255, 0 },
 	{ 255, 8, 255, 255, 0 },
+	{ 255, 27, 255, 255, 0 },
 	{ 255, 22, 255, 255, 0 },
 	{ 255, 23, 255, 255, 0 },
 	{ 9, 255, 255, 255, 0 },
@@ -5205,8 +5211,8 @@
 static unsigned char changes_3_2_0_index[] = {
     0, 1, 2, 2, 3, 4, 5, 6, 2, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 
     19, 20, 21, 22, 23, 24, 2, 2, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 
-    36, 2, 2, 2, 37, 38, 2, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 
-    51, 2, 52, 2, 2, 53, 54, 55, 56, 57, 2, 2, 58, 59, 60, 2, 2, 61, 62, 63, 
+    36, 2, 2, 2, 37, 38, 2, 39, 2, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 
+    50, 2, 51, 2, 2, 52, 53, 54, 55, 56, 2, 57, 58, 59, 60, 2, 2, 61, 62, 63, 
     64, 65, 65, 2, 2, 2, 2, 66, 2, 67, 68, 69, 70, 71, 2, 2, 2, 72, 73, 74, 
     75, 76, 77, 78, 79, 80, 81, 2, 2, 2, 2, 2, 2, 82, 2, 2, 2, 2, 2, 83, 2, 
     2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
@@ -5217,8 +5223,8 @@
     2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
     2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 92, 2, 2, 2, 2, 
     2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 93, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
-    2, 2, 2, 2, 2, 2, 2, 2, 2, 94, 95, 2, 2, 2, 2, 2, 2, 2, 2, 96, 50, 50, 
-    97, 98, 50, 99, 100, 101, 102, 103, 104, 105, 106, 107, 2, 2, 2, 2, 2, 2, 
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 94, 95, 2, 2, 2, 2, 2, 2, 2, 2, 96, 49, 49, 
+    97, 98, 49, 99, 100, 101, 102, 103, 104, 105, 106, 107, 2, 2, 2, 2, 2, 2, 
     2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
     2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
     2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
@@ -5229,13 +5235,13 @@
     119, 120, 121, 122, 2, 123, 124, 125, 126, 127, 2, 2, 2, 2, 2, 2, 128, 2, 
     129, 130, 131, 2, 132, 2, 133, 2, 2, 2, 134, 2, 2, 2, 135, 136, 137, 138, 
     2, 2, 2, 2, 2, 2, 2, 2, 2, 139, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
-    2, 2, 2, 2, 50, 50, 50, 50, 50, 50, 140, 2, 141, 2, 2, 2, 2, 2, 2, 2, 2, 
-    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 50, 50, 50, 50, 50, 50, 50, 
-    50, 142, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
+    2, 2, 2, 2, 49, 49, 49, 49, 49, 49, 140, 2, 141, 2, 2, 2, 2, 2, 2, 2, 2, 
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 49, 49, 49, 49, 49, 49, 49, 
+    49, 142, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
     2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
     2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
     2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
-    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 50, 50, 50, 50, 143, 2, 2, 2, 2, 2, 2, 2, 
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 49, 49, 49, 49, 143, 2, 2, 2, 2, 2, 2, 2, 
     2, 2, 144, 145, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
     2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
     2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
@@ -5262,9 +5268,9 @@
     2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
     2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
     2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
-    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 50, 50, 50, 
-    50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 
-    50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 178, 50, 179, 2, 2, 2, 2, 2, 
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 49, 49, 49, 
+    49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 
+    49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 178, 49, 179, 2, 2, 2, 2, 2, 
     2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
     2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
     2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
@@ -5505,7 +5511,7 @@
     2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
     2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
     2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
-    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 50, 180, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 49, 180, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
     2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
     2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
     2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
@@ -5627,7 +5633,7 @@
     9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 0, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 9, 0, 9, 0, 0, 0, 0, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 0, 9, 0, 9, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 
     9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
@@ -5787,709 +5793,267 @@
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 
     9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 9, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
     9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
     9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 9, 0, 0, 0, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 9, 9, 9, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 9, 
-    0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 
-    9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
     9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
     9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
     9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
     9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
     9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 
     9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 
+    9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 9, 0, 9, 9, 9, 
+    9, 0, 0, 0, 0, 0, 0, 35, 4, 0, 0, 36, 37, 38, 39, 40, 41, 1, 1, 0, 0, 0, 
+    4, 35, 8, 6, 7, 36, 37, 38, 39, 40, 41, 1, 1, 0, 0, 0, 0, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 9, 
     9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 9, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 44, 44, 44, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    45, 46, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 
+    47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 
+    47, 47, 47, 47, 47, 47, 47, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
     9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
     9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
     9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
     9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 
+    9, 9, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 9, 0, 9, 0, 0, 0, 0, 9, 9, 9, 0, 9, 0, 0, 0, 0, 0, 0, 
+    0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 
+    9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 34, 34, 34, 34, 
+    34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 
+    34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 
+    34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 
+    34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 
+    34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 
+    34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 
+    34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 0, 0, 0, 0, 0, 9, 0, 0, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 
+    9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 
+    9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 
+    9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
     9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
     9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 9, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 9, 9, 9, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
     9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 0, 0, 
-    0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 4, 0, 0, 37, 38, 39, 40, 
-    41, 42, 1, 1, 0, 0, 0, 4, 36, 8, 6, 7, 37, 38, 39, 40, 41, 42, 1, 1, 0, 
-    0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 
+    0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
     9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 0, 0, 
-    0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 
-    9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 44, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45, 
-    46, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 
-    47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 
-    47, 47, 47, 47, 47, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 9, 9, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 9, 0, 9, 0, 0, 0, 0, 9, 9, 9, 0, 9, 0, 0, 0, 0, 0, 0, 0, 9, 
-    9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 35, 35, 35, 35, 35, 
-    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
-    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
-    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
-    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
-    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
-    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 
-    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 
-    0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 0, 0, 0, 0, 0, 9, 0, 0, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 
-    9, 0, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 
-    9, 0, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 
-    9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 9, 9, 9, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    19, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 
-    0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 
-    0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 
-    9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 9, 9, 9, 
-    9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 
-    9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 
     0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 19, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 9, 9, 9, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 
-    9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 21, 21, 21, 21, 21, 21, 0, 0, 0, 1, 1, 21, 21, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 14, 14, 14, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    0, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    0, 0, 0, 0, 0, 9, 9, 9, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 0, 
-    0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 0, 0, 9, 0, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 0, 0, 
-    0, 9, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 0, 9, 9, 0, 0, 0, 0, 
-    0, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 9, 9, 9, 
-    0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 
-    0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 0, 0, 0, 9, 
-    9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 0, 9, 0, 0, 9, 0, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 0, 9, 0, 9, 0, 0, 0, 0, 0, 0, 9, 
-    0, 0, 0, 0, 9, 0, 9, 0, 9, 0, 9, 9, 9, 0, 9, 9, 0, 9, 0, 0, 9, 0, 9, 0, 
-    9, 0, 9, 0, 9, 0, 9, 9, 0, 9, 0, 0, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 
-    0, 9, 9, 9, 9, 0, 9, 9, 9, 9, 0, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 9, 9, 
-    9, 0, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 0, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 0, 0, 0, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    19, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
@@ -6497,15 +6061,20 @@
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
@@ -6515,33 +6084,470 @@
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 
+    0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 9, 
+    9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 
+    9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 19, 
+    0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 19, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 21, 21, 21, 21, 21, 21, 0, 0, 0, 1, 1, 21, 21, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 14, 14, 14, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 0, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 0, 0, 0, 0, 0, 9, 9, 9, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    53, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 0, 0, 9, 
+    0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 
+    0, 0, 0, 9, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 9, 9, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 0, 9, 9, 0, 0, 
+    0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 9, 
+    9, 9, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 0, 0, 
+    0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 0, 9, 0, 0, 9, 0, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 0, 9, 0, 9, 0, 0, 0, 0, 0, 
+    0, 9, 0, 0, 0, 0, 9, 0, 9, 0, 9, 0, 9, 9, 9, 0, 9, 9, 0, 9, 0, 0, 9, 0, 
+    9, 0, 9, 0, 9, 0, 9, 0, 9, 9, 0, 9, 0, 0, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 
+    9, 9, 0, 9, 9, 9, 9, 0, 9, 9, 9, 9, 0, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 
+    9, 9, 9, 0, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 0, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 
+    9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 
+    0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 0, 0, 0, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 9, 9, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 
     9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
     9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
     9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
     9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 
+    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 
 };
 
 static const change_record* get_change_3_2_0(Py_UCS4 n)
diff --git a/Modules/unicodename_db.h b/Modules/unicodename_db.h
index 3838882..7ccb126 100644
--- a/Modules/unicodename_db.h
+++ b/Modules/unicodename_db.h
@@ -6,7 +6,7 @@
 static unsigned char lexicon[] = {
     76, 69, 84, 84, 69, 210, 87, 73, 84, 200, 83, 89, 76, 76, 65, 66, 76, 
     197, 83, 77, 65, 76, 204, 83, 73, 71, 206, 67, 65, 80, 73, 84, 65, 204, 
-    76, 65, 84, 73, 206, 89, 201, 67, 74, 203, 65, 82, 65, 66, 73, 195, 77, 
+    76, 65, 84, 73, 206, 89, 201, 65, 82, 65, 66, 73, 195, 67, 74, 203, 77, 
     65, 84, 72, 69, 77, 65, 84, 73, 67, 65, 204, 69, 71, 89, 80, 84, 73, 65, 
     206, 72, 73, 69, 82, 79, 71, 76, 89, 80, 200, 67, 79, 77, 80, 65, 84, 73, 
     66, 73, 76, 73, 84, 217, 67, 85, 78, 69, 73, 70, 79, 82, 205, 83, 89, 77, 
@@ -27,24 +27,24 @@
     75, 65, 78, 193, 194, 77, 79, 68, 73, 70, 73, 69, 210, 68, 79, 212, 75, 
     65, 78, 71, 88, 201, 65, 128, 76, 73, 78, 69, 65, 210, 84, 73, 66, 69, 
     84, 65, 206, 79, 198, 73, 78, 73, 84, 73, 65, 204, 77, 69, 69, 205, 86, 
-    69, 82, 84, 73, 67, 65, 204, 77, 89, 65, 78, 77, 65, 210, 75, 72, 77, 69, 
-    210, 85, 128, 87, 72, 73, 84, 197, 67, 65, 82, 82, 73, 69, 210, 73, 128, 
-    65, 82, 82, 79, 87, 128, 79, 128, 65, 66, 79, 86, 197, 77, 65, 82, 75, 
-    128, 89, 69, 200, 65, 82, 82, 79, 215, 67, 79, 80, 84, 73, 195, 80, 72, 
-    65, 83, 69, 45, 197, 77, 79, 78, 71, 79, 76, 73, 65, 206, 68, 69, 86, 65, 
-    78, 65, 71, 65, 82, 201, 66, 76, 65, 67, 203, 84, 73, 76, 197, 83, 89, 
-    77, 66, 79, 76, 128, 80, 65, 82, 69, 78, 84, 72, 69, 83, 73, 90, 69, 196, 
-    84, 72, 65, 205, 74, 79, 78, 71, 83, 69, 79, 78, 199, 83, 84, 82, 79, 75, 
-    69, 128, 83, 81, 85, 65, 82, 69, 196, 66, 79, 216, 72, 69, 66, 82, 69, 
-    215, 77, 73, 65, 207, 80, 76, 85, 211, 82, 73, 71, 72, 84, 87, 65, 82, 
-    68, 211, 71, 69, 79, 82, 71, 73, 65, 206, 68, 82, 65, 87, 73, 78, 71, 
-    211, 67, 72, 79, 83, 69, 79, 78, 199, 72, 65, 76, 70, 87, 73, 68, 84, 
+    69, 82, 84, 73, 67, 65, 204, 77, 89, 65, 78, 77, 65, 210, 85, 128, 75, 
+    72, 77, 69, 210, 87, 72, 73, 84, 197, 65, 66, 79, 86, 197, 67, 65, 82, 
+    82, 73, 69, 210, 73, 128, 65, 82, 82, 79, 87, 128, 89, 69, 200, 79, 128, 
+    77, 65, 82, 75, 128, 65, 82, 82, 79, 215, 67, 79, 80, 84, 73, 195, 80, 
+    72, 65, 83, 69, 45, 197, 77, 79, 78, 71, 79, 76, 73, 65, 206, 68, 69, 86, 
+    65, 78, 65, 71, 65, 82, 201, 66, 76, 65, 67, 203, 84, 73, 76, 197, 83, 
+    89, 77, 66, 79, 76, 128, 80, 65, 82, 69, 78, 84, 72, 69, 83, 73, 90, 69, 
+    196, 84, 72, 65, 205, 74, 79, 78, 71, 83, 69, 79, 78, 199, 83, 84, 82, 
+    79, 75, 69, 128, 83, 81, 85, 65, 82, 69, 196, 66, 79, 216, 72, 69, 66, 
+    82, 69, 215, 77, 73, 65, 207, 80, 76, 85, 211, 82, 73, 71, 72, 84, 87, 
+    65, 82, 68, 211, 71, 69, 79, 82, 71, 73, 65, 206, 68, 82, 65, 87, 73, 78, 
+    71, 211, 67, 72, 79, 83, 69, 79, 78, 199, 72, 65, 76, 70, 87, 73, 68, 84, 
     200, 66, 65, 76, 73, 78, 69, 83, 197, 72, 79, 79, 75, 128, 213, 84, 87, 
     79, 128, 73, 68, 69, 79, 71, 82, 65, 205, 80, 72, 65, 83, 69, 45, 196, 
-    65, 76, 67, 72, 69, 77, 73, 67, 65, 204, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 73, 195, 79, 78, 69, 128, 84, 79, 128, 65, 76, 69, 198, 84, 87, 207, 
-    72, 69, 65, 86, 217, 67, 79, 78, 83, 79, 78, 65, 78, 212, 79, 86, 69, 
-    210, 66, 82, 65, 72, 77, 201, 83, 67, 82, 73, 80, 212, 85, 208, 76, 79, 
+    65, 76, 67, 72, 69, 77, 73, 67, 65, 204, 65, 76, 69, 198, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 73, 195, 79, 78, 69, 128, 84, 79, 128, 84, 87, 207, 
+    72, 69, 65, 86, 217, 79, 86, 69, 210, 67, 79, 78, 83, 79, 78, 65, 78, 
+    212, 66, 82, 65, 72, 77, 201, 83, 67, 82, 73, 80, 212, 85, 208, 76, 79, 
     215, 72, 65, 200, 79, 78, 197, 68, 79, 87, 206, 72, 73, 71, 200, 70, 85, 
     76, 76, 87, 73, 68, 84, 200, 66, 82, 65, 67, 75, 69, 84, 128, 69, 81, 85, 
     65, 204, 84, 65, 199, 66, 65, 82, 128, 68, 79, 77, 73, 78, 207, 78, 85, 
@@ -65,49 +65,49 @@
     76, 85, 197, 83, 72, 65, 82, 65, 68, 193, 83, 73, 78, 72, 65, 76, 193, 
     75, 65, 128, 82, 85, 78, 73, 195, 83, 65, 85, 82, 65, 83, 72, 84, 82, 
     193, 84, 69, 84, 82, 65, 71, 82, 65, 205, 68, 69, 83, 69, 82, 69, 212, 
-    84, 73, 76, 68, 69, 128, 71, 85, 82, 77, 85, 75, 72, 201, 77, 65, 128, 
-    77, 65, 89, 69, 203, 77, 69, 69, 84, 69, 201, 78, 79, 84, 65, 84, 73, 79, 
-    206, 83, 89, 82, 73, 65, 195, 70, 73, 86, 69, 128, 80, 65, 128, 89, 65, 
-    128, 76, 73, 71, 72, 212, 83, 73, 88, 128, 69, 73, 71, 72, 84, 128, 76, 
-    69, 80, 67, 72, 193, 78, 65, 128, 83, 69, 86, 69, 78, 128, 76, 79, 78, 
-    199, 78, 73, 78, 69, 128, 84, 85, 82, 75, 73, 195, 72, 65, 77, 90, 193, 
-    72, 79, 82, 73, 90, 79, 78, 84, 65, 204, 79, 80, 69, 206, 82, 65, 128, 
-    83, 65, 128, 83, 85, 78, 68, 65, 78, 69, 83, 197, 86, 73, 69, 212, 76, 
-    65, 207, 90, 90, 89, 88, 128, 90, 90, 89, 84, 128, 90, 90, 89, 82, 88, 
-    128, 90, 90, 89, 82, 128, 90, 90, 89, 80, 128, 90, 90, 89, 65, 128, 90, 
-    90, 89, 128, 90, 90, 85, 88, 128, 90, 90, 85, 82, 88, 128, 90, 90, 85, 
-    82, 128, 90, 90, 85, 80, 128, 90, 90, 85, 128, 90, 90, 83, 89, 65, 128, 
-    90, 90, 83, 65, 128, 90, 90, 79, 88, 128, 90, 90, 79, 80, 128, 90, 90, 
-    79, 128, 90, 90, 73, 88, 128, 90, 90, 73, 84, 128, 90, 90, 73, 80, 128, 
-    90, 90, 73, 69, 88, 128, 90, 90, 73, 69, 84, 128, 90, 90, 73, 69, 80, 
-    128, 90, 90, 73, 69, 128, 90, 90, 73, 128, 90, 90, 69, 88, 128, 90, 90, 
-    69, 80, 128, 90, 90, 69, 69, 128, 90, 90, 69, 128, 90, 90, 65, 88, 128, 
-    90, 90, 65, 84, 128, 90, 90, 65, 80, 128, 90, 90, 65, 65, 128, 90, 90, 
-    65, 128, 90, 89, 71, 79, 83, 128, 90, 87, 83, 80, 128, 90, 87, 78, 74, 
-    128, 90, 87, 78, 66, 83, 80, 128, 90, 87, 74, 128, 90, 87, 65, 82, 65, 
-    75, 65, 89, 128, 90, 87, 65, 128, 90, 85, 84, 128, 90, 85, 79, 88, 128, 
-    90, 85, 79, 80, 128, 90, 85, 79, 128, 90, 85, 77, 128, 90, 85, 66, 85, 
-    82, 128, 90, 85, 53, 128, 90, 85, 181, 90, 83, 72, 65, 128, 90, 82, 65, 
-    128, 90, 81, 65, 80, 72, 193, 90, 79, 84, 128, 90, 79, 79, 128, 90, 79, 
-    65, 128, 90, 76, 65, 77, 193, 90, 76, 65, 128, 90, 76, 193, 90, 74, 69, 
-    128, 90, 73, 90, 50, 128, 90, 73, 81, 65, 65, 128, 90, 73, 78, 79, 82, 
-    128, 90, 73, 76, 68, 69, 128, 90, 73, 71, 90, 65, 199, 90, 73, 71, 128, 
-    90, 73, 68, 193, 90, 73, 66, 128, 90, 73, 194, 90, 73, 51, 128, 90, 201, 
-    90, 72, 89, 88, 128, 90, 72, 89, 84, 128, 90, 72, 89, 82, 88, 128, 90, 
-    72, 89, 82, 128, 90, 72, 89, 80, 128, 90, 72, 89, 128, 90, 72, 87, 69, 
-    128, 90, 72, 87, 65, 128, 90, 72, 85, 88, 128, 90, 72, 85, 84, 128, 90, 
-    72, 85, 82, 88, 128, 90, 72, 85, 82, 128, 90, 72, 85, 80, 128, 90, 72, 
-    85, 79, 88, 128, 90, 72, 85, 79, 80, 128, 90, 72, 85, 79, 128, 90, 72, 
-    85, 128, 90, 72, 79, 88, 128, 90, 72, 79, 84, 128, 90, 72, 79, 80, 128, 
-    90, 72, 79, 79, 128, 90, 72, 79, 128, 90, 72, 73, 86, 69, 84, 69, 128, 
-    90, 72, 73, 128, 90, 72, 69, 88, 128, 90, 72, 69, 84, 128, 90, 72, 69, 
-    80, 128, 90, 72, 69, 69, 128, 90, 72, 69, 128, 90, 72, 197, 90, 72, 65, 
-    88, 128, 90, 72, 65, 84, 128, 90, 72, 65, 82, 128, 90, 72, 65, 80, 128, 
-    90, 72, 65, 73, 78, 128, 90, 72, 65, 65, 128, 90, 72, 65, 128, 90, 72, 
-    128, 90, 69, 84, 65, 128, 90, 69, 82, 79, 128, 90, 69, 82, 207, 90, 69, 
-    78, 128, 90, 69, 77, 76, 89, 65, 128, 90, 69, 77, 76, 74, 65, 128, 90, 
-    69, 50, 128, 90, 197, 90, 65, 89, 78, 128, 90, 65, 89, 73, 78, 128, 90, 
-    65, 89, 73, 206, 90, 65, 86, 73, 89, 65, 78, 73, 128, 90, 65, 84, 65, 
+    72, 65, 77, 90, 193, 83, 89, 82, 73, 65, 195, 84, 73, 76, 68, 69, 128, 
+    71, 85, 82, 77, 85, 75, 72, 201, 77, 65, 128, 77, 65, 89, 69, 203, 77, 
+    69, 69, 84, 69, 201, 78, 79, 84, 65, 84, 73, 79, 206, 70, 73, 86, 69, 
+    128, 80, 65, 128, 89, 65, 128, 76, 73, 71, 72, 212, 83, 73, 88, 128, 69, 
+    73, 71, 72, 84, 128, 76, 69, 80, 67, 72, 193, 78, 65, 128, 83, 69, 86, 
+    69, 78, 128, 76, 79, 78, 199, 78, 73, 78, 69, 128, 84, 85, 82, 75, 73, 
+    195, 72, 79, 82, 73, 90, 79, 78, 84, 65, 204, 79, 80, 69, 206, 82, 65, 
+    128, 83, 65, 128, 83, 85, 78, 68, 65, 78, 69, 83, 197, 86, 73, 69, 212, 
+    76, 65, 207, 90, 90, 89, 88, 128, 90, 90, 89, 84, 128, 90, 90, 89, 82, 
+    88, 128, 90, 90, 89, 82, 128, 90, 90, 89, 80, 128, 90, 90, 89, 65, 128, 
+    90, 90, 89, 128, 90, 90, 85, 88, 128, 90, 90, 85, 82, 88, 128, 90, 90, 
+    85, 82, 128, 90, 90, 85, 80, 128, 90, 90, 85, 128, 90, 90, 83, 89, 65, 
+    128, 90, 90, 83, 65, 128, 90, 90, 79, 88, 128, 90, 90, 79, 80, 128, 90, 
+    90, 79, 128, 90, 90, 73, 88, 128, 90, 90, 73, 84, 128, 90, 90, 73, 80, 
+    128, 90, 90, 73, 69, 88, 128, 90, 90, 73, 69, 84, 128, 90, 90, 73, 69, 
+    80, 128, 90, 90, 73, 69, 128, 90, 90, 73, 128, 90, 90, 69, 88, 128, 90, 
+    90, 69, 80, 128, 90, 90, 69, 69, 128, 90, 90, 69, 128, 90, 90, 65, 88, 
+    128, 90, 90, 65, 84, 128, 90, 90, 65, 80, 128, 90, 90, 65, 65, 128, 90, 
+    90, 65, 128, 90, 89, 71, 79, 83, 128, 90, 87, 83, 80, 128, 90, 87, 78, 
+    74, 128, 90, 87, 78, 66, 83, 80, 128, 90, 87, 74, 128, 90, 87, 65, 82, 
+    65, 75, 65, 89, 128, 90, 87, 65, 128, 90, 85, 84, 128, 90, 85, 79, 88, 
+    128, 90, 85, 79, 80, 128, 90, 85, 79, 128, 90, 85, 77, 128, 90, 85, 66, 
+    85, 82, 128, 90, 85, 53, 128, 90, 85, 181, 90, 83, 72, 65, 128, 90, 82, 
+    65, 128, 90, 81, 65, 80, 72, 193, 90, 79, 84, 128, 90, 79, 79, 128, 90, 
+    79, 65, 128, 90, 76, 65, 77, 193, 90, 76, 65, 128, 90, 76, 193, 90, 74, 
+    69, 128, 90, 73, 90, 50, 128, 90, 73, 81, 65, 65, 128, 90, 73, 78, 79, 
+    82, 128, 90, 73, 76, 68, 69, 128, 90, 73, 71, 90, 65, 199, 90, 73, 71, 
+    128, 90, 73, 68, 193, 90, 73, 66, 128, 90, 73, 194, 90, 73, 51, 128, 90, 
+    201, 90, 72, 89, 88, 128, 90, 72, 89, 84, 128, 90, 72, 89, 82, 88, 128, 
+    90, 72, 89, 82, 128, 90, 72, 89, 80, 128, 90, 72, 89, 128, 90, 72, 87, 
+    69, 128, 90, 72, 87, 65, 128, 90, 72, 85, 88, 128, 90, 72, 85, 84, 128, 
+    90, 72, 85, 82, 88, 128, 90, 72, 85, 82, 128, 90, 72, 85, 80, 128, 90, 
+    72, 85, 79, 88, 128, 90, 72, 85, 79, 80, 128, 90, 72, 85, 79, 128, 90, 
+    72, 85, 128, 90, 72, 79, 88, 128, 90, 72, 79, 84, 128, 90, 72, 79, 80, 
+    128, 90, 72, 79, 79, 128, 90, 72, 79, 128, 90, 72, 73, 86, 69, 84, 69, 
+    128, 90, 72, 73, 128, 90, 72, 69, 88, 128, 90, 72, 69, 84, 128, 90, 72, 
+    69, 80, 128, 90, 72, 69, 69, 128, 90, 72, 69, 128, 90, 72, 197, 90, 72, 
+    65, 88, 128, 90, 72, 65, 84, 128, 90, 72, 65, 82, 128, 90, 72, 65, 80, 
+    128, 90, 72, 65, 73, 78, 128, 90, 72, 65, 65, 128, 90, 72, 65, 128, 90, 
+    72, 128, 90, 69, 84, 65, 128, 90, 69, 82, 79, 128, 90, 69, 82, 207, 90, 
+    69, 78, 128, 90, 69, 77, 76, 89, 65, 128, 90, 69, 77, 76, 74, 65, 128, 
+    90, 69, 50, 128, 90, 197, 90, 65, 89, 78, 128, 90, 65, 89, 73, 78, 128, 
+    90, 65, 89, 73, 206, 90, 65, 86, 73, 89, 65, 78, 73, 128, 90, 65, 84, 65, 
     128, 90, 65, 82, 81, 65, 128, 90, 65, 81, 69, 198, 90, 65, 77, 88, 128, 
     90, 65, 204, 90, 65, 73, 78, 128, 90, 65, 73, 206, 90, 65, 73, 128, 90, 
     65, 72, 128, 90, 65, 200, 90, 65, 71, 128, 90, 65, 69, 70, 128, 90, 48, 
@@ -525,79 +525,79 @@
     84, 85, 84, 84, 89, 128, 84, 85, 84, 69, 89, 65, 83, 65, 84, 128, 84, 85, 
     84, 128, 84, 85, 82, 88, 128, 84, 85, 82, 85, 128, 84, 85, 82, 84, 76, 
     69, 128, 84, 85, 82, 79, 50, 128, 84, 85, 82, 78, 83, 84, 73, 76, 69, 
-    128, 84, 85, 82, 78, 69, 196, 84, 85, 82, 206, 84, 85, 82, 66, 65, 78, 
-    128, 84, 85, 82, 128, 84, 85, 80, 128, 84, 85, 79, 88, 128, 84, 85, 79, 
-    84, 128, 84, 85, 79, 80, 128, 84, 85, 79, 128, 84, 85, 78, 78, 89, 128, 
-    84, 85, 77, 69, 84, 69, 83, 128, 84, 85, 77, 65, 69, 128, 84, 85, 77, 
-    128, 84, 85, 76, 73, 80, 128, 84, 85, 75, 87, 69, 78, 84, 73, 83, 128, 
-    84, 85, 75, 128, 84, 85, 71, 82, 73, 203, 84, 85, 71, 50, 128, 84, 85, 
-    71, 178, 84, 85, 65, 82, 69, 199, 84, 85, 65, 69, 80, 128, 84, 85, 65, 
-    69, 128, 84, 213, 84, 84, 85, 85, 128, 84, 84, 85, 68, 68, 65, 71, 128, 
-    84, 84, 85, 68, 68, 65, 65, 71, 128, 84, 84, 85, 128, 84, 84, 84, 72, 65, 
-    128, 84, 84, 84, 65, 128, 84, 84, 83, 85, 128, 84, 84, 83, 79, 128, 84, 
-    84, 83, 73, 128, 84, 84, 83, 69, 69, 128, 84, 84, 83, 69, 128, 84, 84, 
-    83, 65, 128, 84, 84, 79, 79, 128, 84, 84, 73, 73, 128, 84, 84, 73, 128, 
-    84, 84, 72, 87, 69, 128, 84, 84, 72, 85, 128, 84, 84, 72, 79, 79, 128, 
-    84, 84, 72, 79, 128, 84, 84, 72, 73, 128, 84, 84, 72, 69, 69, 128, 84, 
-    84, 72, 69, 128, 84, 84, 72, 65, 65, 128, 84, 84, 72, 128, 84, 84, 69, 
-    72, 69, 72, 128, 84, 84, 69, 72, 69, 200, 84, 84, 69, 72, 128, 84, 84, 
-    69, 200, 84, 84, 69, 69, 128, 84, 84, 65, 89, 65, 78, 78, 65, 128, 84, 
-    84, 65, 85, 128, 84, 84, 65, 73, 128, 84, 84, 65, 65, 128, 84, 84, 50, 
-    128, 84, 83, 87, 69, 128, 84, 83, 87, 65, 128, 84, 83, 86, 128, 84, 83, 
-    83, 69, 128, 84, 83, 83, 65, 128, 84, 83, 72, 85, 71, 83, 128, 84, 83, 
-    72, 79, 79, 75, 128, 84, 83, 72, 79, 79, 203, 84, 83, 72, 69, 83, 128, 
-    84, 83, 72, 69, 71, 128, 84, 83, 72, 69, 199, 84, 83, 72, 69, 128, 84, 
-    83, 72, 65, 128, 84, 83, 69, 82, 69, 128, 84, 83, 65, 68, 73, 128, 84, 
-    83, 65, 68, 201, 84, 83, 65, 65, 68, 73, 89, 128, 84, 83, 65, 65, 128, 
-    84, 83, 193, 84, 82, 89, 66, 76, 73, 79, 206, 84, 82, 85, 84, 72, 128, 
-    84, 82, 85, 78, 75, 128, 84, 82, 85, 78, 67, 65, 84, 69, 196, 84, 82, 85, 
-    77, 80, 69, 84, 128, 84, 82, 85, 69, 128, 84, 82, 85, 67, 75, 128, 84, 
-    82, 79, 80, 73, 67, 65, 204, 84, 82, 79, 80, 72, 89, 128, 84, 82, 79, 77, 
-    73, 75, 79, 83, 89, 78, 65, 71, 77, 65, 128, 84, 82, 79, 77, 73, 75, 79, 
-    80, 83, 73, 70, 73, 83, 84, 79, 78, 128, 84, 82, 79, 77, 73, 75, 79, 80, 
-    65, 82, 65, 75, 65, 76, 69, 83, 77, 65, 128, 84, 82, 79, 77, 73, 75, 79, 
-    78, 128, 84, 82, 79, 77, 73, 75, 79, 206, 84, 82, 79, 77, 73, 75, 79, 76, 
-    89, 71, 73, 83, 77, 65, 128, 84, 82, 79, 76, 76, 69, 89, 66, 85, 83, 128, 
-    84, 82, 79, 75, 85, 84, 65, 83, 84, 201, 84, 82, 79, 69, 90, 69, 78, 73, 
-    65, 206, 84, 82, 73, 85, 77, 80, 72, 128, 84, 82, 73, 84, 79, 211, 84, 
-    82, 73, 84, 73, 77, 79, 82, 73, 79, 78, 128, 84, 82, 73, 83, 73, 77, 79, 
-    85, 128, 84, 82, 73, 83, 69, 77, 69, 128, 84, 82, 73, 80, 79, 68, 128, 
-    84, 82, 73, 80, 76, 73, 128, 84, 82, 73, 80, 76, 197, 84, 82, 73, 79, 
-    206, 84, 82, 73, 73, 83, 65, 80, 128, 84, 82, 73, 71, 82, 65, 77, 77, 79, 
-    211, 84, 82, 73, 71, 82, 65, 205, 84, 82, 73, 71, 79, 82, 71, 79, 78, 
-    128, 84, 82, 73, 70, 79, 78, 73, 65, 83, 128, 84, 82, 73, 70, 79, 76, 73, 
-    65, 84, 197, 84, 82, 73, 68, 69, 78, 84, 128, 84, 82, 73, 68, 69, 78, 
-    212, 84, 82, 73, 67, 79, 76, 79, 78, 128, 84, 82, 73, 65, 78, 71, 85, 76, 
-    65, 210, 84, 82, 73, 65, 78, 71, 76, 69, 45, 82, 79, 85, 78, 196, 84, 82, 
-    73, 65, 78, 71, 76, 69, 45, 72, 69, 65, 68, 69, 196, 84, 82, 73, 65, 78, 
-    71, 76, 69, 128, 84, 82, 73, 65, 78, 71, 76, 197, 84, 82, 73, 65, 128, 
-    84, 82, 73, 128, 84, 82, 69, 83, 73, 76, 76, 79, 128, 84, 82, 69, 78, 68, 
-    128, 84, 82, 69, 78, 196, 84, 82, 69, 77, 79, 76, 79, 45, 51, 128, 84, 
-    82, 69, 77, 79, 76, 79, 45, 50, 128, 84, 82, 69, 77, 79, 76, 79, 45, 49, 
-    128, 84, 82, 69, 69, 128, 84, 82, 69, 197, 84, 82, 69, 65, 68, 73, 78, 
-    71, 128, 84, 82, 65, 89, 128, 84, 82, 65, 80, 69, 90, 73, 85, 77, 128, 
-    84, 82, 65, 78, 83, 86, 69, 82, 83, 65, 204, 84, 82, 65, 78, 83, 80, 79, 
-    83, 73, 84, 73, 79, 206, 84, 82, 65, 78, 83, 77, 73, 212, 84, 82, 65, 78, 
-    83, 77, 73, 83, 83, 73, 79, 78, 128, 84, 82, 65, 78, 83, 77, 73, 83, 83, 
-    73, 79, 206, 84, 82, 65, 77, 87, 65, 89, 128, 84, 82, 65, 77, 128, 84, 
-    82, 65, 205, 84, 82, 65, 73, 78, 128, 84, 82, 65, 73, 206, 84, 82, 65, 
-    73, 76, 73, 78, 199, 84, 82, 65, 70, 70, 73, 67, 128, 84, 82, 65, 70, 70, 
-    73, 195, 84, 82, 65, 68, 197, 84, 82, 65, 67, 84, 79, 82, 128, 84, 82, 
-    65, 67, 75, 128, 84, 82, 128, 84, 79, 88, 128, 84, 79, 87, 69, 82, 128, 
-    84, 79, 85, 82, 78, 79, 73, 211, 84, 79, 84, 65, 204, 84, 79, 84, 128, 
-    84, 79, 82, 84, 79, 73, 83, 197, 84, 79, 82, 67, 85, 76, 85, 83, 128, 84, 
-    79, 82, 67, 85, 76, 85, 211, 84, 79, 82, 67, 72, 128, 84, 79, 81, 128, 
-    84, 79, 80, 66, 65, 82, 128, 84, 79, 80, 45, 76, 73, 71, 72, 84, 69, 196, 
-    84, 79, 80, 128, 84, 79, 208, 84, 79, 79, 84, 72, 128, 84, 79, 79, 78, 
-    128, 84, 79, 78, 79, 83, 128, 84, 79, 78, 71, 85, 69, 128, 84, 79, 78, 
-    71, 85, 197, 84, 79, 78, 71, 128, 84, 79, 78, 69, 45, 56, 128, 84, 79, 
-    78, 69, 45, 55, 128, 84, 79, 78, 69, 45, 54, 128, 84, 79, 78, 69, 45, 53, 
-    128, 84, 79, 78, 69, 45, 52, 128, 84, 79, 78, 69, 45, 51, 128, 84, 79, 
-    78, 69, 45, 50, 128, 84, 79, 78, 69, 45, 49, 128, 84, 79, 78, 69, 128, 
-    84, 79, 78, 65, 204, 84, 79, 77, 80, 73, 128, 84, 79, 77, 65, 84, 79, 
-    128, 84, 79, 76, 79, 78, 71, 128, 84, 79, 75, 89, 207, 84, 79, 73, 76, 
-    69, 84, 128, 84, 79, 71, 69, 84, 72, 69, 82, 128, 84, 79, 68, 207, 84, 
-    79, 65, 78, 68, 65, 75, 72, 73, 65, 84, 128, 84, 79, 65, 128, 84, 78, 
+    128, 84, 85, 82, 78, 69, 196, 84, 85, 82, 206, 84, 85, 82, 75, 73, 83, 
+    200, 84, 85, 82, 66, 65, 78, 128, 84, 85, 82, 128, 84, 85, 80, 128, 84, 
+    85, 79, 88, 128, 84, 85, 79, 84, 128, 84, 85, 79, 80, 128, 84, 85, 79, 
+    128, 84, 85, 78, 78, 89, 128, 84, 85, 77, 69, 84, 69, 83, 128, 84, 85, 
+    77, 65, 69, 128, 84, 85, 77, 128, 84, 85, 76, 73, 80, 128, 84, 85, 75, 
+    87, 69, 78, 84, 73, 83, 128, 84, 85, 75, 128, 84, 85, 71, 82, 73, 203, 
+    84, 85, 71, 50, 128, 84, 85, 71, 178, 84, 85, 65, 82, 69, 199, 84, 85, 
+    65, 69, 80, 128, 84, 85, 65, 69, 128, 84, 213, 84, 84, 85, 85, 128, 84, 
+    84, 85, 68, 68, 65, 71, 128, 84, 84, 85, 68, 68, 65, 65, 71, 128, 84, 84, 
+    85, 128, 84, 84, 84, 72, 65, 128, 84, 84, 84, 65, 128, 84, 84, 83, 85, 
+    128, 84, 84, 83, 79, 128, 84, 84, 83, 73, 128, 84, 84, 83, 69, 69, 128, 
+    84, 84, 83, 69, 128, 84, 84, 83, 65, 128, 84, 84, 79, 79, 128, 84, 84, 
+    73, 73, 128, 84, 84, 73, 128, 84, 84, 72, 87, 69, 128, 84, 84, 72, 85, 
+    128, 84, 84, 72, 79, 79, 128, 84, 84, 72, 79, 128, 84, 84, 72, 73, 128, 
+    84, 84, 72, 69, 69, 128, 84, 84, 72, 69, 128, 84, 84, 72, 65, 65, 128, 
+    84, 84, 72, 128, 84, 84, 69, 72, 69, 72, 128, 84, 84, 69, 72, 69, 200, 
+    84, 84, 69, 72, 128, 84, 84, 69, 200, 84, 84, 69, 69, 128, 84, 84, 65, 
+    89, 65, 78, 78, 65, 128, 84, 84, 65, 85, 128, 84, 84, 65, 73, 128, 84, 
+    84, 65, 65, 128, 84, 84, 50, 128, 84, 83, 87, 69, 128, 84, 83, 87, 65, 
+    128, 84, 83, 86, 128, 84, 83, 83, 69, 128, 84, 83, 83, 65, 128, 84, 83, 
+    72, 85, 71, 83, 128, 84, 83, 72, 79, 79, 75, 128, 84, 83, 72, 79, 79, 
+    203, 84, 83, 72, 69, 83, 128, 84, 83, 72, 69, 71, 128, 84, 83, 72, 69, 
+    199, 84, 83, 72, 69, 128, 84, 83, 72, 65, 128, 84, 83, 69, 82, 69, 128, 
+    84, 83, 65, 68, 73, 128, 84, 83, 65, 68, 201, 84, 83, 65, 65, 68, 73, 89, 
+    128, 84, 83, 65, 65, 128, 84, 83, 193, 84, 82, 89, 66, 76, 73, 79, 206, 
+    84, 82, 85, 84, 72, 128, 84, 82, 85, 78, 75, 128, 84, 82, 85, 78, 67, 65, 
+    84, 69, 196, 84, 82, 85, 77, 80, 69, 84, 128, 84, 82, 85, 69, 128, 84, 
+    82, 85, 67, 75, 128, 84, 82, 79, 80, 73, 67, 65, 204, 84, 82, 79, 80, 72, 
+    89, 128, 84, 82, 79, 77, 73, 75, 79, 83, 89, 78, 65, 71, 77, 65, 128, 84, 
+    82, 79, 77, 73, 75, 79, 80, 83, 73, 70, 73, 83, 84, 79, 78, 128, 84, 82, 
+    79, 77, 73, 75, 79, 80, 65, 82, 65, 75, 65, 76, 69, 83, 77, 65, 128, 84, 
+    82, 79, 77, 73, 75, 79, 78, 128, 84, 82, 79, 77, 73, 75, 79, 206, 84, 82, 
+    79, 77, 73, 75, 79, 76, 89, 71, 73, 83, 77, 65, 128, 84, 82, 79, 76, 76, 
+    69, 89, 66, 85, 83, 128, 84, 82, 79, 75, 85, 84, 65, 83, 84, 201, 84, 82, 
+    79, 69, 90, 69, 78, 73, 65, 206, 84, 82, 73, 85, 77, 80, 72, 128, 84, 82, 
+    73, 84, 79, 211, 84, 82, 73, 84, 73, 77, 79, 82, 73, 79, 78, 128, 84, 82, 
+    73, 83, 73, 77, 79, 85, 128, 84, 82, 73, 83, 69, 77, 69, 128, 84, 82, 73, 
+    80, 79, 68, 128, 84, 82, 73, 80, 76, 73, 128, 84, 82, 73, 80, 76, 197, 
+    84, 82, 73, 79, 206, 84, 82, 73, 73, 83, 65, 80, 128, 84, 82, 73, 71, 82, 
+    65, 77, 77, 79, 211, 84, 82, 73, 71, 82, 65, 205, 84, 82, 73, 71, 79, 82, 
+    71, 79, 78, 128, 84, 82, 73, 70, 79, 78, 73, 65, 83, 128, 84, 82, 73, 70, 
+    79, 76, 73, 65, 84, 197, 84, 82, 73, 68, 69, 78, 84, 128, 84, 82, 73, 68, 
+    69, 78, 212, 84, 82, 73, 67, 79, 76, 79, 78, 128, 84, 82, 73, 65, 78, 71, 
+    85, 76, 65, 210, 84, 82, 73, 65, 78, 71, 76, 69, 45, 82, 79, 85, 78, 196, 
+    84, 82, 73, 65, 78, 71, 76, 69, 45, 72, 69, 65, 68, 69, 196, 84, 82, 73, 
+    65, 78, 71, 76, 69, 128, 84, 82, 73, 65, 78, 71, 76, 197, 84, 82, 73, 65, 
+    128, 84, 82, 73, 128, 84, 82, 69, 83, 73, 76, 76, 79, 128, 84, 82, 69, 
+    78, 68, 128, 84, 82, 69, 78, 196, 84, 82, 69, 77, 79, 76, 79, 45, 51, 
+    128, 84, 82, 69, 77, 79, 76, 79, 45, 50, 128, 84, 82, 69, 77, 79, 76, 79, 
+    45, 49, 128, 84, 82, 69, 69, 128, 84, 82, 69, 197, 84, 82, 69, 65, 68, 
+    73, 78, 71, 128, 84, 82, 65, 89, 128, 84, 82, 65, 80, 69, 90, 73, 85, 77, 
+    128, 84, 82, 65, 78, 83, 86, 69, 82, 83, 65, 204, 84, 82, 65, 78, 83, 80, 
+    79, 83, 73, 84, 73, 79, 206, 84, 82, 65, 78, 83, 77, 73, 212, 84, 82, 65, 
+    78, 83, 77, 73, 83, 83, 73, 79, 78, 128, 84, 82, 65, 78, 83, 77, 73, 83, 
+    83, 73, 79, 206, 84, 82, 65, 77, 87, 65, 89, 128, 84, 82, 65, 77, 128, 
+    84, 82, 65, 205, 84, 82, 65, 73, 78, 128, 84, 82, 65, 73, 206, 84, 82, 
+    65, 73, 76, 73, 78, 199, 84, 82, 65, 70, 70, 73, 67, 128, 84, 82, 65, 70, 
+    70, 73, 195, 84, 82, 65, 68, 197, 84, 82, 65, 67, 84, 79, 82, 128, 84, 
+    82, 65, 67, 75, 128, 84, 82, 128, 84, 79, 88, 128, 84, 79, 87, 69, 82, 
+    128, 84, 79, 85, 82, 78, 79, 73, 211, 84, 79, 84, 65, 204, 84, 79, 84, 
+    128, 84, 79, 82, 84, 79, 73, 83, 197, 84, 79, 82, 67, 85, 76, 85, 83, 
+    128, 84, 79, 82, 67, 85, 76, 85, 211, 84, 79, 82, 67, 72, 128, 84, 79, 
+    81, 128, 84, 79, 80, 66, 65, 82, 128, 84, 79, 80, 45, 76, 73, 71, 72, 84, 
+    69, 196, 84, 79, 80, 128, 84, 79, 208, 84, 79, 79, 84, 72, 128, 84, 79, 
+    79, 78, 128, 84, 79, 78, 79, 83, 128, 84, 79, 78, 71, 85, 69, 128, 84, 
+    79, 78, 71, 85, 197, 84, 79, 78, 71, 128, 84, 79, 78, 69, 45, 56, 128, 
+    84, 79, 78, 69, 45, 55, 128, 84, 79, 78, 69, 45, 54, 128, 84, 79, 78, 69, 
+    45, 53, 128, 84, 79, 78, 69, 45, 52, 128, 84, 79, 78, 69, 45, 51, 128, 
+    84, 79, 78, 69, 45, 50, 128, 84, 79, 78, 69, 45, 49, 128, 84, 79, 78, 69, 
+    128, 84, 79, 78, 65, 204, 84, 79, 77, 80, 73, 128, 84, 79, 77, 65, 84, 
+    79, 128, 84, 79, 76, 79, 78, 71, 128, 84, 79, 75, 89, 207, 84, 79, 73, 
+    76, 69, 84, 128, 84, 79, 71, 69, 84, 72, 69, 82, 128, 84, 79, 68, 207, 
+    84, 79, 65, 78, 68, 65, 75, 72, 73, 65, 84, 128, 84, 79, 65, 128, 84, 78, 
     128, 84, 76, 86, 128, 84, 76, 85, 128, 84, 76, 79, 128, 84, 76, 73, 128, 
     84, 76, 72, 89, 65, 128, 84, 76, 72, 87, 69, 128, 84, 76, 72, 85, 128, 
     84, 76, 72, 79, 79, 128, 84, 76, 72, 79, 128, 84, 76, 72, 73, 128, 84, 
@@ -796,409 +796,410 @@
     69, 84, 128, 83, 85, 65, 69, 78, 128, 83, 85, 65, 69, 128, 83, 85, 65, 
     128, 83, 213, 83, 84, 88, 128, 83, 84, 87, 65, 128, 83, 84, 85, 68, 89, 
     128, 83, 84, 85, 67, 75, 45, 79, 85, 212, 83, 84, 83, 128, 83, 84, 82, 
-    79, 75, 69, 83, 128, 83, 84, 82, 79, 75, 69, 211, 83, 84, 82, 79, 75, 69, 
-    45, 57, 128, 83, 84, 82, 79, 75, 69, 45, 56, 128, 83, 84, 82, 79, 75, 69, 
-    45, 55, 128, 83, 84, 82, 79, 75, 69, 45, 54, 128, 83, 84, 82, 79, 75, 69, 
-    45, 53, 128, 83, 84, 82, 79, 75, 69, 45, 52, 128, 83, 84, 82, 79, 75, 69, 
-    45, 51, 128, 83, 84, 82, 79, 75, 69, 45, 50, 128, 83, 84, 82, 79, 75, 69, 
-    45, 49, 49, 128, 83, 84, 82, 79, 75, 69, 45, 49, 48, 128, 83, 84, 82, 79, 
-    75, 69, 45, 49, 128, 83, 84, 82, 79, 75, 197, 83, 84, 82, 73, 80, 69, 
-    128, 83, 84, 82, 73, 78, 71, 128, 83, 84, 82, 73, 78, 199, 83, 84, 82, 
-    73, 75, 69, 84, 72, 82, 79, 85, 71, 72, 128, 83, 84, 82, 73, 68, 69, 128, 
-    83, 84, 82, 73, 67, 84, 76, 217, 83, 84, 82, 69, 84, 67, 72, 69, 196, 83, 
-    84, 82, 69, 83, 211, 83, 84, 82, 69, 78, 71, 84, 72, 128, 83, 84, 82, 69, 
-    65, 77, 69, 82, 128, 83, 84, 82, 65, 87, 66, 69, 82, 82, 89, 128, 83, 84, 
-    82, 65, 84, 85, 77, 45, 50, 128, 83, 84, 82, 65, 84, 85, 77, 128, 83, 84, 
-    82, 65, 84, 85, 205, 83, 84, 82, 65, 84, 73, 65, 206, 83, 84, 82, 65, 73, 
-    78, 69, 82, 128, 83, 84, 82, 65, 73, 71, 72, 84, 78, 69, 83, 83, 128, 83, 
-    84, 82, 65, 73, 71, 72, 212, 83, 84, 82, 65, 73, 70, 128, 83, 84, 82, 65, 
-    71, 71, 73, 83, 77, 65, 84, 65, 128, 83, 84, 79, 86, 69, 128, 83, 84, 79, 
-    82, 69, 128, 83, 84, 79, 80, 87, 65, 84, 67, 72, 128, 83, 84, 79, 80, 80, 
-    73, 78, 71, 128, 83, 84, 79, 80, 80, 65, 71, 69, 128, 83, 84, 79, 80, 
-    128, 83, 84, 79, 208, 83, 84, 79, 78, 69, 128, 83, 84, 79, 67, 75, 128, 
-    83, 84, 73, 77, 77, 69, 128, 83, 84, 73, 76, 204, 83, 84, 73, 76, 197, 
-    83, 84, 73, 71, 77, 65, 128, 83, 84, 69, 80, 128, 83, 84, 69, 77, 128, 
-    83, 84, 69, 65, 77, 73, 78, 199, 83, 84, 69, 65, 77, 128, 83, 84, 69, 65, 
-    205, 83, 84, 65, 86, 82, 79, 85, 128, 83, 84, 65, 86, 82, 79, 83, 128, 
-    83, 84, 65, 86, 82, 79, 211, 83, 84, 65, 85, 82, 79, 83, 128, 83, 84, 65, 
-    84, 85, 197, 83, 84, 65, 84, 73, 79, 78, 128, 83, 84, 65, 84, 69, 82, 83, 
-    128, 83, 84, 65, 84, 69, 128, 83, 84, 65, 82, 212, 83, 84, 65, 82, 83, 
-    128, 83, 84, 65, 82, 82, 69, 196, 83, 84, 65, 82, 75, 128, 83, 84, 65, 
-    82, 128, 83, 84, 65, 210, 83, 84, 65, 78, 68, 83, 84, 73, 76, 76, 128, 
-    83, 84, 65, 78, 68, 65, 82, 196, 83, 84, 65, 78, 68, 128, 83, 84, 65, 78, 
-    128, 83, 84, 65, 76, 76, 73, 79, 78, 128, 83, 84, 65, 70, 70, 128, 83, 
-    84, 65, 70, 198, 83, 84, 65, 67, 67, 65, 84, 79, 128, 83, 84, 65, 67, 67, 
-    65, 84, 73, 83, 83, 73, 77, 79, 128, 83, 84, 50, 128, 83, 83, 89, 88, 
-    128, 83, 83, 89, 84, 128, 83, 83, 89, 82, 88, 128, 83, 83, 89, 82, 128, 
-    83, 83, 89, 80, 128, 83, 83, 89, 128, 83, 83, 85, 88, 128, 83, 83, 85, 
-    85, 128, 83, 83, 85, 84, 128, 83, 83, 85, 80, 128, 83, 83, 79, 88, 128, 
-    83, 83, 79, 84, 128, 83, 83, 79, 80, 128, 83, 83, 79, 79, 128, 83, 83, 
-    79, 128, 83, 83, 73, 88, 128, 83, 83, 73, 84, 128, 83, 83, 73, 80, 128, 
-    83, 83, 73, 73, 128, 83, 83, 73, 69, 88, 128, 83, 83, 73, 69, 80, 128, 
-    83, 83, 73, 69, 128, 83, 83, 73, 128, 83, 83, 72, 69, 128, 83, 83, 69, 
-    88, 128, 83, 83, 69, 80, 128, 83, 83, 69, 69, 128, 83, 83, 65, 88, 128, 
-    83, 83, 65, 85, 128, 83, 83, 65, 84, 128, 83, 83, 65, 80, 128, 83, 83, 
-    65, 78, 71, 89, 69, 79, 82, 73, 78, 72, 73, 69, 85, 72, 128, 83, 83, 65, 
-    78, 71, 84, 73, 75, 69, 85, 84, 45, 80, 73, 69, 85, 80, 128, 83, 83, 65, 
-    78, 71, 84, 73, 75, 69, 85, 84, 128, 83, 83, 65, 78, 71, 84, 72, 73, 69, 
-    85, 84, 72, 128, 83, 83, 65, 78, 71, 83, 73, 79, 83, 45, 84, 73, 75, 69, 
-    85, 84, 128, 83, 83, 65, 78, 71, 83, 73, 79, 83, 45, 80, 73, 69, 85, 80, 
-    128, 83, 83, 65, 78, 71, 83, 73, 79, 83, 45, 75, 73, 89, 69, 79, 75, 128, 
-    83, 83, 65, 78, 71, 83, 73, 79, 83, 128, 83, 83, 65, 78, 71, 82, 73, 69, 
-    85, 76, 45, 75, 72, 73, 69, 85, 75, 72, 128, 83, 83, 65, 78, 71, 82, 73, 
-    69, 85, 76, 128, 83, 83, 65, 78, 71, 80, 73, 69, 85, 80, 128, 83, 83, 65, 
-    78, 71, 78, 73, 69, 85, 78, 128, 83, 83, 65, 78, 71, 77, 73, 69, 85, 77, 
-    128, 83, 83, 65, 78, 71, 75, 73, 89, 69, 79, 75, 128, 83, 83, 65, 78, 71, 
-    73, 69, 85, 78, 71, 128, 83, 83, 65, 78, 71, 72, 73, 69, 85, 72, 128, 83, 
-    83, 65, 78, 71, 67, 73, 69, 85, 67, 45, 72, 73, 69, 85, 72, 128, 83, 83, 
-    65, 78, 71, 67, 73, 69, 85, 67, 128, 83, 83, 65, 78, 71, 65, 82, 65, 69, 
-    65, 128, 83, 83, 65, 73, 128, 83, 83, 65, 65, 128, 83, 83, 51, 128, 83, 
-    83, 50, 128, 83, 82, 128, 83, 81, 85, 73, 83, 200, 83, 81, 85, 73, 82, 
-    82, 69, 204, 83, 81, 85, 73, 71, 71, 76, 197, 83, 81, 85, 65, 212, 83, 
-    81, 85, 65, 82, 69, 83, 128, 83, 81, 85, 65, 82, 69, 68, 128, 83, 81, 85, 
-    65, 82, 69, 128, 83, 80, 87, 65, 128, 83, 80, 85, 78, 71, 211, 83, 80, 
-    82, 79, 85, 84, 128, 83, 80, 82, 73, 78, 71, 83, 128, 83, 80, 82, 73, 78, 
-    71, 128, 83, 80, 82, 69, 67, 72, 71, 69, 83, 65, 78, 199, 83, 80, 79, 85, 
-    84, 73, 78, 199, 83, 80, 79, 84, 128, 83, 80, 79, 79, 78, 128, 83, 80, 
-    76, 73, 84, 84, 73, 78, 199, 83, 80, 76, 65, 83, 72, 73, 78, 199, 83, 80, 
-    73, 82, 73, 84, 85, 211, 83, 80, 73, 82, 73, 84, 128, 83, 80, 73, 82, 73, 
-    212, 83, 80, 73, 82, 65, 78, 84, 128, 83, 80, 73, 82, 65, 76, 128, 83, 
-    80, 73, 82, 65, 204, 83, 80, 73, 68, 69, 82, 217, 83, 80, 73, 67, 69, 
-    128, 83, 80, 72, 69, 82, 73, 67, 65, 204, 83, 80, 69, 83, 77, 73, 76, 
-    207, 83, 80, 69, 69, 68, 66, 79, 65, 84, 128, 83, 80, 69, 69, 67, 72, 
-    128, 83, 80, 69, 69, 67, 200, 83, 80, 69, 67, 73, 65, 76, 128, 83, 80, 
-    69, 65, 82, 128, 83, 80, 69, 65, 75, 69, 82, 128, 83, 80, 69, 65, 75, 69, 
-    210, 83, 80, 69, 65, 75, 45, 78, 79, 45, 69, 86, 73, 204, 83, 80, 65, 84, 
-    72, 73, 128, 83, 80, 65, 82, 75, 76, 73, 78, 199, 83, 80, 65, 82, 75, 76, 
-    69, 83, 128, 83, 80, 65, 82, 75, 76, 69, 82, 128, 83, 80, 65, 82, 75, 76, 
-    69, 128, 83, 80, 65, 71, 72, 69, 84, 84, 73, 128, 83, 80, 65, 68, 69, 83, 
-    128, 83, 80, 65, 68, 197, 83, 80, 65, 67, 73, 78, 199, 83, 80, 65, 67, 
-    197, 83, 80, 65, 128, 83, 79, 89, 128, 83, 79, 87, 73, 76, 207, 83, 79, 
-    87, 128, 83, 79, 85, 84, 72, 69, 82, 206, 83, 79, 85, 84, 72, 45, 83, 76, 
-    65, 86, 69, 217, 83, 79, 85, 84, 200, 83, 79, 85, 82, 67, 69, 128, 83, 
-    79, 85, 78, 68, 128, 83, 79, 85, 78, 196, 83, 79, 85, 78, 65, 80, 128, 
-    83, 79, 85, 128, 83, 79, 83, 128, 83, 79, 82, 193, 83, 79, 81, 128, 83, 
-    79, 79, 206, 83, 79, 78, 74, 65, 77, 128, 83, 79, 78, 71, 128, 83, 79, 
-    78, 128, 83, 79, 77, 80, 69, 78, 199, 83, 79, 77, 128, 83, 79, 76, 73, 
-    68, 85, 83, 128, 83, 79, 76, 73, 68, 85, 211, 83, 79, 72, 128, 83, 79, 
-    71, 68, 73, 65, 206, 83, 79, 70, 84, 87, 65, 82, 69, 45, 70, 85, 78, 67, 
-    84, 73, 79, 206, 83, 79, 70, 84, 78, 69, 83, 83, 128, 83, 79, 70, 212, 
-    83, 79, 198, 83, 79, 67, 73, 69, 84, 89, 128, 83, 79, 67, 67, 69, 210, 
-    83, 79, 65, 80, 128, 83, 79, 65, 128, 83, 207, 83, 78, 79, 87, 77, 65, 
-    78, 128, 83, 78, 79, 87, 77, 65, 206, 83, 78, 79, 87, 70, 76, 65, 75, 69, 
-    128, 83, 78, 79, 87, 66, 79, 65, 82, 68, 69, 82, 128, 83, 78, 79, 87, 
-    128, 83, 78, 79, 85, 84, 128, 83, 78, 79, 85, 212, 83, 78, 65, 208, 83, 
-    78, 65, 75, 69, 128, 83, 78, 65, 75, 197, 83, 78, 65, 73, 76, 128, 83, 
-    78, 193, 83, 77, 79, 75, 73, 78, 199, 83, 77, 73, 82, 75, 73, 78, 199, 
-    83, 77, 73, 76, 73, 78, 199, 83, 77, 73, 76, 69, 128, 83, 77, 69, 65, 82, 
-    128, 83, 77, 65, 83, 200, 83, 77, 65, 76, 76, 69, 210, 83, 77, 65, 76, 
-    76, 128, 83, 76, 85, 82, 128, 83, 76, 79, 87, 76, 89, 128, 83, 76, 79, 
-    215, 83, 76, 79, 86, 79, 128, 83, 76, 79, 212, 83, 76, 79, 80, 73, 78, 
-    199, 83, 76, 79, 80, 69, 128, 83, 76, 73, 78, 71, 128, 83, 76, 73, 68, 
-    73, 78, 71, 128, 83, 76, 73, 67, 69, 128, 83, 76, 73, 67, 197, 83, 76, 
-    69, 69, 80, 217, 83, 76, 69, 69, 80, 73, 78, 199, 83, 76, 65, 86, 79, 78, 
-    73, 195, 83, 76, 65, 86, 69, 128, 83, 76, 65, 83, 72, 128, 83, 76, 65, 
-    83, 200, 83, 76, 65, 78, 84, 69, 196, 83, 75, 87, 65, 128, 83, 75, 87, 
-    128, 83, 75, 85, 76, 76, 128, 83, 75, 85, 76, 204, 83, 75, 76, 73, 82, 
-    79, 206, 83, 75, 73, 78, 128, 83, 75, 73, 69, 82, 128, 83, 75, 201, 83, 
-    75, 69, 87, 69, 196, 83, 75, 65, 84, 69, 128, 83, 75, 128, 83, 74, 69, 
-    128, 83, 73, 88, 84, 89, 45, 70, 79, 85, 82, 84, 200, 83, 73, 88, 84, 89, 
-    128, 83, 73, 88, 84, 217, 83, 73, 88, 84, 72, 83, 128, 83, 73, 88, 84, 
-    72, 211, 83, 73, 88, 84, 72, 128, 83, 73, 88, 84, 69, 69, 78, 84, 72, 83, 
-    128, 83, 73, 88, 84, 69, 69, 78, 84, 72, 128, 83, 73, 88, 84, 69, 69, 78, 
-    84, 200, 83, 73, 88, 84, 69, 69, 78, 128, 83, 73, 88, 84, 69, 69, 206, 
-    83, 73, 88, 45, 84, 72, 73, 82, 84, 89, 128, 83, 73, 88, 45, 83, 84, 82, 
-    73, 78, 199, 83, 73, 88, 45, 80, 69, 82, 45, 69, 205, 83, 73, 88, 45, 76, 
-    73, 78, 197, 83, 73, 216, 83, 73, 84, 69, 128, 83, 73, 83, 65, 128, 83, 
-    73, 82, 73, 78, 71, 85, 128, 83, 73, 79, 83, 45, 84, 72, 73, 69, 85, 84, 
-    72, 128, 83, 73, 79, 83, 45, 83, 83, 65, 78, 71, 83, 73, 79, 83, 128, 83, 
-    73, 79, 83, 45, 82, 73, 69, 85, 76, 128, 83, 73, 79, 83, 45, 80, 73, 69, 
-    85, 80, 45, 75, 73, 89, 69, 79, 75, 128, 83, 73, 79, 83, 45, 80, 72, 73, 
-    69, 85, 80, 72, 128, 83, 73, 79, 83, 45, 80, 65, 78, 83, 73, 79, 83, 128, 
-    83, 73, 79, 83, 45, 78, 73, 69, 85, 78, 128, 83, 73, 79, 83, 45, 77, 73, 
-    69, 85, 77, 128, 83, 73, 79, 83, 45, 75, 72, 73, 69, 85, 75, 72, 128, 83, 
-    73, 79, 83, 45, 75, 65, 80, 89, 69, 79, 85, 78, 80, 73, 69, 85, 80, 128, 
-    83, 73, 79, 83, 45, 73, 69, 85, 78, 71, 128, 83, 73, 79, 83, 45, 72, 73, 
-    69, 85, 72, 128, 83, 73, 79, 83, 45, 67, 73, 69, 85, 67, 128, 83, 73, 79, 
-    83, 45, 67, 72, 73, 69, 85, 67, 72, 128, 83, 73, 79, 211, 83, 73, 78, 75, 
-    73, 78, 71, 128, 83, 73, 78, 71, 76, 69, 45, 83, 72, 73, 70, 84, 45, 51, 
-    128, 83, 73, 78, 71, 76, 69, 45, 83, 72, 73, 70, 84, 45, 50, 128, 83, 73, 
-    78, 71, 76, 69, 45, 76, 73, 78, 197, 83, 73, 78, 71, 76, 69, 128, 83, 73, 
-    78, 71, 76, 197, 83, 73, 78, 71, 65, 65, 84, 128, 83, 73, 78, 197, 83, 
-    73, 78, 68, 72, 201, 83, 73, 206, 83, 73, 77, 80, 76, 73, 70, 73, 69, 
-    196, 83, 73, 77, 73, 76, 65, 82, 128, 83, 73, 77, 73, 76, 65, 210, 83, 
-    73, 77, 65, 78, 83, 73, 211, 83, 73, 77, 65, 76, 85, 78, 71, 85, 206, 83, 
-    73, 77, 65, 128, 83, 73, 76, 86, 69, 82, 128, 83, 73, 76, 75, 128, 83, 
-    73, 76, 73, 81, 85, 193, 83, 73, 76, 72, 79, 85, 69, 84, 84, 69, 128, 83, 
-    73, 76, 72, 79, 85, 69, 84, 84, 197, 83, 73, 76, 65, 51, 128, 83, 73, 75, 
-    73, 128, 83, 73, 75, 50, 128, 83, 73, 75, 178, 83, 73, 71, 78, 83, 128, 
-    83, 73, 71, 77, 65, 128, 83, 73, 71, 77, 193, 83, 73, 71, 69, 204, 83, 
-    73, 71, 52, 128, 83, 73, 71, 180, 83, 73, 71, 128, 83, 73, 69, 69, 128, 
-    83, 73, 68, 69, 87, 65, 89, 211, 83, 73, 67, 75, 78, 69, 83, 83, 128, 83, 
-    73, 67, 75, 76, 69, 128, 83, 73, 66, 197, 83, 201, 83, 72, 89, 88, 128, 
-    83, 72, 89, 84, 128, 83, 72, 89, 82, 88, 128, 83, 72, 89, 82, 128, 83, 
-    72, 89, 80, 128, 83, 72, 89, 69, 128, 83, 72, 89, 65, 128, 83, 72, 89, 
-    128, 83, 72, 87, 79, 89, 128, 83, 72, 87, 79, 79, 128, 83, 72, 87, 79, 
-    128, 83, 72, 87, 73, 73, 128, 83, 72, 87, 73, 128, 83, 72, 87, 69, 128, 
-    83, 72, 87, 65, 65, 128, 83, 72, 87, 65, 128, 83, 72, 85, 88, 128, 83, 
-    72, 85, 85, 128, 83, 72, 85, 84, 128, 83, 72, 85, 82, 88, 128, 83, 72, 
-    85, 82, 128, 83, 72, 85, 80, 128, 83, 72, 85, 79, 88, 128, 83, 72, 85, 
-    79, 80, 128, 83, 72, 85, 79, 128, 83, 72, 85, 77, 128, 83, 72, 85, 70, 
-    70, 76, 197, 83, 72, 85, 69, 81, 128, 83, 72, 85, 69, 78, 83, 72, 85, 69, 
-    84, 128, 83, 72, 85, 66, 85, 82, 128, 83, 72, 85, 50, 128, 83, 72, 85, 
-    178, 83, 72, 85, 128, 83, 72, 213, 83, 72, 84, 65, 80, 73, 67, 128, 83, 
-    72, 84, 65, 128, 83, 72, 82, 73, 78, 69, 128, 83, 72, 82, 73, 77, 80, 
-    128, 83, 72, 82, 73, 73, 128, 83, 72, 79, 89, 128, 83, 72, 79, 88, 128, 
-    83, 72, 79, 87, 69, 82, 128, 83, 72, 79, 85, 76, 68, 69, 82, 69, 196, 83, 
-    72, 79, 84, 128, 83, 72, 79, 82, 84, 83, 128, 83, 72, 79, 82, 84, 211, 
-    83, 72, 79, 82, 84, 69, 78, 69, 82, 128, 83, 72, 79, 82, 84, 67, 65, 75, 
-    69, 128, 83, 72, 79, 82, 84, 45, 84, 87, 73, 71, 45, 89, 82, 128, 83, 72, 
-    79, 82, 84, 45, 84, 87, 73, 71, 45, 84, 89, 210, 83, 72, 79, 82, 84, 45, 
-    84, 87, 73, 71, 45, 83, 79, 204, 83, 72, 79, 82, 84, 45, 84, 87, 73, 71, 
-    45, 79, 83, 211, 83, 72, 79, 82, 84, 45, 84, 87, 73, 71, 45, 78, 65, 85, 
-    196, 83, 72, 79, 82, 84, 45, 84, 87, 73, 71, 45, 77, 65, 68, 210, 83, 72, 
-    79, 82, 84, 45, 84, 87, 73, 71, 45, 72, 65, 71, 65, 76, 204, 83, 72, 79, 
-    82, 84, 45, 84, 87, 73, 71, 45, 66, 74, 65, 82, 75, 65, 206, 83, 72, 79, 
-    82, 84, 45, 84, 87, 73, 71, 45, 65, 210, 83, 72, 79, 82, 84, 128, 83, 72, 
-    79, 82, 212, 83, 72, 79, 81, 128, 83, 72, 79, 209, 83, 72, 79, 80, 128, 
-    83, 72, 79, 79, 84, 73, 78, 199, 83, 72, 79, 79, 84, 128, 83, 72, 79, 79, 
-    128, 83, 72, 79, 71, 201, 83, 72, 79, 199, 83, 72, 79, 69, 128, 83, 72, 
-    79, 197, 83, 72, 79, 65, 128, 83, 72, 79, 128, 83, 72, 73, 89, 89, 65, 
-    65, 76, 65, 65, 128, 83, 72, 73, 84, 65, 128, 83, 72, 73, 84, 193, 83, 
-    72, 73, 82, 212, 83, 72, 73, 82, 65, 69, 128, 83, 72, 73, 82, 128, 83, 
-    72, 73, 210, 83, 72, 73, 81, 128, 83, 72, 73, 80, 128, 83, 72, 73, 78, 
-    84, 207, 83, 72, 73, 78, 73, 71, 128, 83, 72, 73, 78, 68, 193, 83, 72, 
-    73, 78, 128, 83, 72, 73, 206, 83, 72, 73, 77, 65, 128, 83, 72, 73, 77, 
-    193, 83, 72, 73, 77, 128, 83, 72, 73, 205, 83, 72, 73, 73, 78, 128, 83, 
-    72, 73, 73, 128, 83, 72, 73, 70, 212, 83, 72, 73, 69, 76, 68, 128, 83, 
-    72, 73, 68, 128, 83, 72, 73, 196, 83, 72, 72, 65, 128, 83, 72, 72, 193, 
-    83, 72, 69, 88, 128, 83, 72, 69, 86, 65, 128, 83, 72, 69, 85, 88, 128, 
-    83, 72, 69, 85, 79, 81, 128, 83, 72, 69, 85, 65, 69, 81, 84, 85, 128, 83, 
-    72, 69, 85, 65, 69, 81, 128, 83, 72, 69, 85, 65, 69, 128, 83, 72, 69, 84, 
-    128, 83, 72, 69, 212, 83, 72, 69, 83, 72, 76, 65, 77, 128, 83, 72, 69, 
-    83, 72, 73, 71, 128, 83, 72, 69, 83, 72, 73, 199, 83, 72, 69, 83, 72, 50, 
-    128, 83, 72, 69, 83, 72, 128, 83, 72, 69, 81, 69, 204, 83, 72, 69, 80, 
-    128, 83, 72, 69, 78, 128, 83, 72, 69, 76, 76, 128, 83, 72, 69, 76, 204, 
-    83, 72, 69, 76, 70, 128, 83, 72, 69, 73, 128, 83, 72, 69, 71, 57, 128, 
-    83, 72, 69, 69, 80, 128, 83, 72, 69, 69, 78, 85, 128, 83, 72, 69, 69, 78, 
-    128, 83, 72, 69, 69, 206, 83, 72, 69, 69, 128, 83, 72, 69, 45, 71, 79, 
-    65, 84, 128, 83, 72, 197, 83, 72, 67, 72, 65, 128, 83, 72, 65, 89, 128, 
-    83, 72, 65, 88, 128, 83, 72, 65, 86, 73, 89, 65, 78, 73, 128, 83, 72, 65, 
-    86, 73, 65, 206, 83, 72, 65, 86, 69, 196, 83, 72, 65, 85, 128, 83, 72, 
-    65, 84, 128, 83, 72, 65, 82, 85, 128, 83, 72, 65, 82, 213, 83, 72, 65, 
-    82, 80, 128, 83, 72, 65, 82, 208, 83, 72, 65, 82, 65, 128, 83, 72, 65, 
-    82, 50, 128, 83, 72, 65, 82, 178, 83, 72, 65, 80, 73, 78, 71, 128, 83, 
-    72, 65, 80, 69, 83, 128, 83, 72, 65, 80, 197, 83, 72, 65, 80, 128, 83, 
-    72, 65, 78, 71, 128, 83, 72, 65, 78, 128, 83, 72, 65, 206, 83, 72, 65, 
-    77, 82, 79, 67, 75, 128, 83, 72, 65, 76, 83, 72, 69, 76, 69, 84, 128, 83, 
-    72, 65, 75, 84, 73, 128, 83, 72, 65, 73, 128, 83, 72, 65, 68, 79, 87, 69, 
-    196, 83, 72, 65, 68, 69, 128, 83, 72, 65, 68, 68, 65, 128, 83, 72, 65, 
-    68, 68, 193, 83, 72, 65, 68, 128, 83, 72, 65, 196, 83, 72, 65, 66, 54, 
-    128, 83, 72, 65, 65, 128, 83, 72, 65, 54, 128, 83, 72, 65, 51, 128, 83, 
-    72, 65, 179, 83, 71, 82, 193, 83, 71, 79, 210, 83, 71, 67, 128, 83, 71, 
-    65, 215, 83, 71, 65, 194, 83, 71, 128, 83, 69, 88, 84, 85, 76, 193, 83, 
-    69, 88, 84, 73, 76, 69, 128, 83, 69, 88, 84, 65, 78, 211, 83, 69, 86, 69, 
-    82, 65, 78, 67, 69, 128, 83, 69, 86, 69, 78, 84, 89, 128, 83, 69, 86, 69, 
-    78, 84, 217, 83, 69, 86, 69, 78, 84, 72, 128, 83, 69, 86, 69, 78, 84, 69, 
-    69, 78, 128, 83, 69, 86, 69, 78, 84, 69, 69, 206, 83, 69, 86, 69, 78, 45, 
-    84, 72, 73, 82, 84, 89, 128, 83, 69, 86, 69, 206, 83, 69, 85, 88, 128, 
-    83, 69, 85, 78, 89, 65, 77, 128, 83, 69, 85, 65, 69, 81, 128, 83, 69, 84, 
-    70, 79, 78, 128, 83, 69, 83, 84, 69, 82, 84, 73, 85, 211, 83, 69, 83, 81, 
-    85, 73, 81, 85, 65, 68, 82, 65, 84, 69, 128, 83, 69, 83, 65, 77, 197, 83, 
-    69, 82, 86, 73, 67, 197, 83, 69, 82, 73, 70, 83, 128, 83, 69, 82, 73, 70, 
-    211, 83, 69, 81, 85, 69, 78, 67, 197, 83, 69, 80, 84, 69, 77, 66, 69, 82, 
-    128, 83, 69, 80, 65, 82, 65, 84, 79, 82, 128, 83, 69, 80, 65, 82, 65, 84, 
-    79, 210, 83, 69, 78, 84, 79, 128, 83, 69, 78, 84, 73, 128, 83, 69, 77, 
-    85, 78, 67, 73, 193, 83, 69, 77, 75, 65, 84, 72, 128, 83, 69, 77, 75, 
-    128, 83, 69, 77, 73, 86, 79, 87, 69, 204, 83, 69, 77, 73, 83, 79, 70, 
-    212, 83, 69, 77, 73, 83, 69, 88, 84, 73, 76, 69, 128, 83, 69, 77, 73, 77, 
-    73, 78, 73, 77, 193, 83, 69, 77, 73, 68, 73, 82, 69, 67, 212, 83, 69, 77, 
-    73, 67, 79, 76, 79, 78, 128, 83, 69, 77, 73, 67, 79, 76, 79, 206, 83, 69, 
-    77, 73, 67, 73, 82, 67, 85, 76, 65, 210, 83, 69, 77, 73, 67, 73, 82, 67, 
-    76, 197, 83, 69, 77, 73, 66, 82, 69, 86, 73, 211, 83, 69, 77, 73, 45, 86, 
-    79, 73, 67, 69, 196, 83, 69, 76, 70, 128, 83, 69, 76, 69, 67, 84, 79, 82, 
-    45, 57, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 57, 56, 128, 83, 69, 
-    76, 69, 67, 84, 79, 82, 45, 57, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 
-    45, 57, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 57, 53, 128, 83, 69, 
-    76, 69, 67, 84, 79, 82, 45, 57, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 
-    45, 57, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 57, 50, 128, 83, 69, 
-    76, 69, 67, 84, 79, 82, 45, 57, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 
-    45, 57, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 57, 128, 83, 69, 76, 
-    69, 67, 84, 79, 82, 45, 56, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 
-    56, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 56, 55, 128, 83, 69, 76, 
-    69, 67, 84, 79, 82, 45, 56, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 
-    56, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 56, 52, 128, 83, 69, 76, 
-    69, 67, 84, 79, 82, 45, 56, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 
-    56, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 56, 49, 128, 83, 69, 76, 
-    69, 67, 84, 79, 82, 45, 56, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 
-    56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 55, 57, 128, 83, 69, 76, 69, 
-    67, 84, 79, 82, 45, 55, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 55, 
-    55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 55, 54, 128, 83, 69, 76, 69, 
-    67, 84, 79, 82, 45, 55, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 55, 
-    52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 55, 51, 128, 83, 69, 76, 69, 
-    67, 84, 79, 82, 45, 55, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 55, 
-    49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 55, 48, 128, 83, 69, 76, 69, 
-    67, 84, 79, 82, 45, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 54, 57, 
-    128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 54, 56, 128, 83, 69, 76, 69, 67, 
-    84, 79, 82, 45, 54, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 54, 54, 
-    128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 54, 53, 128, 83, 69, 76, 69, 67, 
-    84, 79, 82, 45, 54, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 54, 51, 
-    128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 54, 50, 128, 83, 69, 76, 69, 67, 
-    84, 79, 82, 45, 54, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 54, 48, 
-    128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 54, 128, 83, 69, 76, 69, 67, 84, 
-    79, 82, 45, 53, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 53, 56, 128, 
-    83, 69, 76, 69, 67, 84, 79, 82, 45, 53, 55, 128, 83, 69, 76, 69, 67, 84, 
-    79, 82, 45, 53, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 53, 53, 128, 
-    83, 69, 76, 69, 67, 84, 79, 82, 45, 53, 52, 128, 83, 69, 76, 69, 67, 84, 
-    79, 82, 45, 53, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 53, 50, 128, 
-    83, 69, 76, 69, 67, 84, 79, 82, 45, 53, 49, 128, 83, 69, 76, 69, 67, 84, 
-    79, 82, 45, 53, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 53, 128, 83, 
-    69, 76, 69, 67, 84, 79, 82, 45, 52, 57, 128, 83, 69, 76, 69, 67, 84, 79, 
-    82, 45, 52, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 52, 55, 128, 83, 
-    69, 76, 69, 67, 84, 79, 82, 45, 52, 54, 128, 83, 69, 76, 69, 67, 84, 79, 
-    82, 45, 52, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 52, 52, 128, 83, 
-    69, 76, 69, 67, 84, 79, 82, 45, 52, 51, 128, 83, 69, 76, 69, 67, 84, 79, 
-    82, 45, 52, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 52, 49, 128, 83, 
-    69, 76, 69, 67, 84, 79, 82, 45, 52, 48, 128, 83, 69, 76, 69, 67, 84, 79, 
-    82, 45, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 51, 57, 128, 83, 69, 
-    76, 69, 67, 84, 79, 82, 45, 51, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 
-    45, 51, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 51, 54, 128, 83, 69, 
-    76, 69, 67, 84, 79, 82, 45, 51, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 
-    45, 51, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 51, 51, 128, 83, 69, 
-    76, 69, 67, 84, 79, 82, 45, 51, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 
-    45, 51, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 51, 48, 128, 83, 69, 
-    76, 69, 67, 84, 79, 82, 45, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 
-    50, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 56, 128, 83, 69, 76, 
-    69, 67, 84, 79, 82, 45, 50, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 
-    50, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 53, 54, 128, 83, 69, 
-    76, 69, 67, 84, 79, 82, 45, 50, 53, 53, 128, 83, 69, 76, 69, 67, 84, 79, 
-    82, 45, 50, 53, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 53, 51, 
-    128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 53, 50, 128, 83, 69, 76, 69, 
-    67, 84, 79, 82, 45, 50, 53, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 
-    50, 53, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 53, 128, 83, 69, 
-    76, 69, 67, 84, 79, 82, 45, 50, 52, 57, 128, 83, 69, 76, 69, 67, 84, 79, 
-    82, 45, 50, 52, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 52, 55, 
-    128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 52, 54, 128, 83, 69, 76, 69, 
-    67, 84, 79, 82, 45, 50, 52, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 
-    50, 52, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 52, 51, 128, 83, 
-    69, 76, 69, 67, 84, 79, 82, 45, 50, 52, 50, 128, 83, 69, 76, 69, 67, 84, 
-    79, 82, 45, 50, 52, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 52, 
-    48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 52, 128, 83, 69, 76, 69, 
-    67, 84, 79, 82, 45, 50, 51, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 
-    50, 51, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 51, 55, 128, 83, 
-    69, 76, 69, 67, 84, 79, 82, 45, 50, 51, 54, 128, 83, 69, 76, 69, 67, 84, 
-    79, 82, 45, 50, 51, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 51, 
-    52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 51, 51, 128, 83, 69, 76, 
-    69, 67, 84, 79, 82, 45, 50, 51, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 
-    45, 50, 51, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 51, 48, 128, 
-    83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 51, 128, 83, 69, 76, 69, 67, 84, 
-    79, 82, 45, 50, 50, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 50, 
-    56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 50, 55, 128, 83, 69, 76, 
-    69, 67, 84, 79, 82, 45, 50, 50, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 
-    45, 50, 50, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 50, 52, 128, 
-    83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 50, 51, 128, 83, 69, 76, 69, 67, 
-    84, 79, 82, 45, 50, 50, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 
-    50, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 50, 48, 128, 83, 69, 
-    76, 69, 67, 84, 79, 82, 45, 50, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 
-    45, 50, 49, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 49, 56, 128, 
-    83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 49, 55, 128, 83, 69, 76, 69, 67, 
-    84, 79, 82, 45, 50, 49, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 
-    49, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 49, 52, 128, 83, 69, 
-    76, 69, 67, 84, 79, 82, 45, 50, 49, 51, 128, 83, 69, 76, 69, 67, 84, 79, 
-    82, 45, 50, 49, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 49, 49, 
-    128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 49, 48, 128, 83, 69, 76, 69, 
-    67, 84, 79, 82, 45, 50, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 
-    48, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 48, 56, 128, 83, 69, 
-    76, 69, 67, 84, 79, 82, 45, 50, 48, 55, 128, 83, 69, 76, 69, 67, 84, 79, 
-    82, 45, 50, 48, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 48, 53, 
-    128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 48, 52, 128, 83, 69, 76, 69, 
-    67, 84, 79, 82, 45, 50, 48, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 
-    50, 48, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 48, 49, 128, 83, 
-    69, 76, 69, 67, 84, 79, 82, 45, 50, 48, 48, 128, 83, 69, 76, 69, 67, 84, 
-    79, 82, 45, 50, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 128, 83, 
-    69, 76, 69, 67, 84, 79, 82, 45, 49, 57, 57, 128, 83, 69, 76, 69, 67, 84, 
-    79, 82, 45, 49, 57, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 57, 
-    55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 57, 54, 128, 83, 69, 76, 
-    69, 67, 84, 79, 82, 45, 49, 57, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 
-    45, 49, 57, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 57, 51, 128, 
-    83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 57, 50, 128, 83, 69, 76, 69, 67, 
-    84, 79, 82, 45, 49, 57, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 
-    57, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 57, 128, 83, 69, 76, 
-    69, 67, 84, 79, 82, 45, 49, 56, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 
-    45, 49, 56, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 56, 55, 128, 
-    83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 56, 54, 128, 83, 69, 76, 69, 67, 
-    84, 79, 82, 45, 49, 56, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 
-    56, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 56, 51, 128, 83, 69, 
-    76, 69, 67, 84, 79, 82, 45, 49, 56, 50, 128, 83, 69, 76, 69, 67, 84, 79, 
-    82, 45, 49, 56, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 56, 48, 
-    128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 56, 128, 83, 69, 76, 69, 67, 
-    84, 79, 82, 45, 49, 55, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 
-    55, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 55, 55, 128, 83, 69, 
-    76, 69, 67, 84, 79, 82, 45, 49, 55, 54, 128, 83, 69, 76, 69, 67, 84, 79, 
-    82, 45, 49, 55, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 55, 52, 
-    128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 55, 51, 128, 83, 69, 76, 69, 
-    67, 84, 79, 82, 45, 49, 55, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 
-    49, 55, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 55, 48, 128, 83, 
-    69, 76, 69, 67, 84, 79, 82, 45, 49, 55, 128, 83, 69, 76, 69, 67, 84, 79, 
-    82, 45, 49, 54, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 54, 56, 
-    128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 54, 55, 128, 83, 69, 76, 69, 
-    67, 84, 79, 82, 45, 49, 54, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 
-    49, 54, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 54, 52, 128, 83, 
-    69, 76, 69, 67, 84, 79, 82, 45, 49, 54, 51, 128, 83, 69, 76, 69, 67, 84, 
-    79, 82, 45, 49, 54, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 54, 
-    49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 54, 48, 128, 83, 69, 76, 
-    69, 67, 84, 79, 82, 45, 49, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 
-    49, 53, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 53, 56, 128, 83, 
-    69, 76, 69, 67, 84, 79, 82, 45, 49, 53, 55, 128, 83, 69, 76, 69, 67, 84, 
-    79, 82, 45, 49, 53, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 53, 
-    53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 53, 52, 128, 83, 69, 76, 
-    69, 67, 84, 79, 82, 45, 49, 53, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 
-    45, 49, 53, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 53, 49, 128, 
-    83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 53, 48, 128, 83, 69, 76, 69, 67, 
-    84, 79, 82, 45, 49, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 52, 
-    57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 52, 56, 128, 83, 69, 76, 
-    69, 67, 84, 79, 82, 45, 49, 52, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 
-    45, 49, 52, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 52, 53, 128, 
-    83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 52, 52, 128, 83, 69, 76, 69, 67, 
-    84, 79, 82, 45, 49, 52, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 
-    52, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 52, 49, 128, 83, 69, 
-    76, 69, 67, 84, 79, 82, 45, 49, 52, 48, 128, 83, 69, 76, 69, 67, 84, 79, 
-    82, 45, 49, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 51, 57, 128, 
-    83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 51, 56, 128, 83, 69, 76, 69, 67, 
-    84, 79, 82, 45, 49, 51, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 
-    51, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 51, 53, 128, 83, 69, 
-    76, 69, 67, 84, 79, 82, 45, 49, 51, 52, 128, 83, 69, 76, 69, 67, 84, 79, 
-    82, 45, 49, 51, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 51, 50, 
-    128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 51, 49, 128, 83, 69, 76, 69, 
-    67, 84, 79, 82, 45, 49, 51, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 
-    49, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 50, 57, 128, 83, 69, 
-    76, 69, 67, 84, 79, 82, 45, 49, 50, 56, 128, 83, 69, 76, 69, 67, 84, 79, 
-    82, 45, 49, 50, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 50, 54, 
-    128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 50, 53, 128, 83, 69, 76, 69, 
-    67, 84, 79, 82, 45, 49, 50, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 
-    49, 50, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 50, 50, 128, 83, 
-    69, 76, 69, 67, 84, 79, 82, 45, 49, 50, 49, 128, 83, 69, 76, 69, 67, 84, 
-    79, 82, 45, 49, 50, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 50, 
-    128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 49, 57, 128, 83, 69, 76, 69, 
-    67, 84, 79, 82, 45, 49, 49, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 
-    49, 49, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 49, 54, 128, 83, 
-    69, 76, 69, 67, 84, 79, 82, 45, 49, 49, 53, 128, 83, 69, 76, 69, 67, 84, 
-    79, 82, 45, 49, 49, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 49, 
-    51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 49, 50, 128, 83, 69, 76, 
-    69, 67, 84, 79, 82, 45, 49, 49, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 
-    45, 49, 49, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 49, 128, 83, 
-    69, 76, 69, 67, 84, 79, 82, 45, 49, 48, 57, 128, 83, 69, 76, 69, 67, 84, 
-    79, 82, 45, 49, 48, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 48, 
-    55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 48, 54, 128, 83, 69, 76, 
-    69, 67, 84, 79, 82, 45, 49, 48, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 
-    45, 49, 48, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 48, 51, 128, 
-    83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 48, 50, 128, 83, 69, 76, 69, 67, 
-    84, 79, 82, 45, 49, 48, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 
-    48, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 48, 128, 83, 69, 76, 
-    69, 67, 84, 79, 82, 45, 49, 128, 83, 69, 76, 69, 67, 84, 79, 210, 83, 69, 
-    76, 69, 67, 84, 69, 196, 83, 69, 73, 83, 77, 65, 128, 83, 69, 73, 83, 77, 
-    193, 83, 69, 72, 128, 83, 69, 71, 79, 76, 128, 83, 69, 71, 78, 79, 128, 
-    83, 69, 71, 77, 69, 78, 84, 128, 83, 69, 69, 78, 85, 128, 83, 69, 69, 78, 
+    79, 78, 199, 83, 84, 82, 79, 75, 69, 83, 128, 83, 84, 82, 79, 75, 69, 
+    211, 83, 84, 82, 79, 75, 69, 45, 57, 128, 83, 84, 82, 79, 75, 69, 45, 56, 
+    128, 83, 84, 82, 79, 75, 69, 45, 55, 128, 83, 84, 82, 79, 75, 69, 45, 54, 
+    128, 83, 84, 82, 79, 75, 69, 45, 53, 128, 83, 84, 82, 79, 75, 69, 45, 52, 
+    128, 83, 84, 82, 79, 75, 69, 45, 51, 128, 83, 84, 82, 79, 75, 69, 45, 50, 
+    128, 83, 84, 82, 79, 75, 69, 45, 49, 49, 128, 83, 84, 82, 79, 75, 69, 45, 
+    49, 48, 128, 83, 84, 82, 79, 75, 69, 45, 49, 128, 83, 84, 82, 79, 75, 
+    197, 83, 84, 82, 73, 80, 69, 128, 83, 84, 82, 73, 78, 71, 128, 83, 84, 
+    82, 73, 78, 199, 83, 84, 82, 73, 75, 69, 84, 72, 82, 79, 85, 71, 72, 128, 
+    83, 84, 82, 73, 68, 69, 128, 83, 84, 82, 73, 67, 84, 76, 217, 83, 84, 82, 
+    69, 84, 67, 72, 69, 196, 83, 84, 82, 69, 83, 211, 83, 84, 82, 69, 78, 71, 
+    84, 72, 128, 83, 84, 82, 69, 65, 77, 69, 82, 128, 83, 84, 82, 65, 87, 66, 
+    69, 82, 82, 89, 128, 83, 84, 82, 65, 84, 85, 77, 45, 50, 128, 83, 84, 82, 
+    65, 84, 85, 77, 128, 83, 84, 82, 65, 84, 85, 205, 83, 84, 82, 65, 84, 73, 
+    65, 206, 83, 84, 82, 65, 73, 78, 69, 82, 128, 83, 84, 82, 65, 73, 71, 72, 
+    84, 78, 69, 83, 83, 128, 83, 84, 82, 65, 73, 71, 72, 212, 83, 84, 82, 65, 
+    73, 70, 128, 83, 84, 82, 65, 71, 71, 73, 83, 77, 65, 84, 65, 128, 83, 84, 
+    79, 86, 69, 128, 83, 84, 79, 82, 69, 128, 83, 84, 79, 80, 87, 65, 84, 67, 
+    72, 128, 83, 84, 79, 80, 80, 73, 78, 71, 128, 83, 84, 79, 80, 80, 65, 71, 
+    69, 128, 83, 84, 79, 80, 128, 83, 84, 79, 208, 83, 84, 79, 78, 69, 128, 
+    83, 84, 79, 67, 75, 128, 83, 84, 73, 77, 77, 69, 128, 83, 84, 73, 76, 
+    204, 83, 84, 73, 76, 197, 83, 84, 73, 71, 77, 65, 128, 83, 84, 69, 80, 
+    128, 83, 84, 69, 77, 128, 83, 84, 69, 65, 77, 73, 78, 199, 83, 84, 69, 
+    65, 77, 128, 83, 84, 69, 65, 205, 83, 84, 65, 86, 82, 79, 85, 128, 83, 
+    84, 65, 86, 82, 79, 83, 128, 83, 84, 65, 86, 82, 79, 211, 83, 84, 65, 85, 
+    82, 79, 83, 128, 83, 84, 65, 84, 85, 197, 83, 84, 65, 84, 73, 79, 78, 
+    128, 83, 84, 65, 84, 69, 82, 83, 128, 83, 84, 65, 84, 69, 128, 83, 84, 
+    65, 82, 212, 83, 84, 65, 82, 83, 128, 83, 84, 65, 82, 82, 69, 196, 83, 
+    84, 65, 82, 75, 128, 83, 84, 65, 82, 128, 83, 84, 65, 210, 83, 84, 65, 
+    78, 68, 83, 84, 73, 76, 76, 128, 83, 84, 65, 78, 68, 65, 82, 196, 83, 84, 
+    65, 78, 68, 128, 83, 84, 65, 78, 128, 83, 84, 65, 76, 76, 73, 79, 78, 
+    128, 83, 84, 65, 70, 70, 128, 83, 84, 65, 70, 198, 83, 84, 65, 67, 67, 
+    65, 84, 79, 128, 83, 84, 65, 67, 67, 65, 84, 73, 83, 83, 73, 77, 79, 128, 
+    83, 84, 50, 128, 83, 83, 89, 88, 128, 83, 83, 89, 84, 128, 83, 83, 89, 
+    82, 88, 128, 83, 83, 89, 82, 128, 83, 83, 89, 80, 128, 83, 83, 89, 128, 
+    83, 83, 85, 88, 128, 83, 83, 85, 85, 128, 83, 83, 85, 84, 128, 83, 83, 
+    85, 80, 128, 83, 83, 79, 88, 128, 83, 83, 79, 84, 128, 83, 83, 79, 80, 
+    128, 83, 83, 79, 79, 128, 83, 83, 79, 128, 83, 83, 73, 88, 128, 83, 83, 
+    73, 84, 128, 83, 83, 73, 80, 128, 83, 83, 73, 73, 128, 83, 83, 73, 69, 
+    88, 128, 83, 83, 73, 69, 80, 128, 83, 83, 73, 69, 128, 83, 83, 73, 128, 
+    83, 83, 72, 69, 128, 83, 83, 69, 88, 128, 83, 83, 69, 80, 128, 83, 83, 
+    69, 69, 128, 83, 83, 65, 88, 128, 83, 83, 65, 85, 128, 83, 83, 65, 84, 
+    128, 83, 83, 65, 80, 128, 83, 83, 65, 78, 71, 89, 69, 79, 82, 73, 78, 72, 
+    73, 69, 85, 72, 128, 83, 83, 65, 78, 71, 84, 73, 75, 69, 85, 84, 45, 80, 
+    73, 69, 85, 80, 128, 83, 83, 65, 78, 71, 84, 73, 75, 69, 85, 84, 128, 83, 
+    83, 65, 78, 71, 84, 72, 73, 69, 85, 84, 72, 128, 83, 83, 65, 78, 71, 83, 
+    73, 79, 83, 45, 84, 73, 75, 69, 85, 84, 128, 83, 83, 65, 78, 71, 83, 73, 
+    79, 83, 45, 80, 73, 69, 85, 80, 128, 83, 83, 65, 78, 71, 83, 73, 79, 83, 
+    45, 75, 73, 89, 69, 79, 75, 128, 83, 83, 65, 78, 71, 83, 73, 79, 83, 128, 
+    83, 83, 65, 78, 71, 82, 73, 69, 85, 76, 45, 75, 72, 73, 69, 85, 75, 72, 
+    128, 83, 83, 65, 78, 71, 82, 73, 69, 85, 76, 128, 83, 83, 65, 78, 71, 80, 
+    73, 69, 85, 80, 128, 83, 83, 65, 78, 71, 78, 73, 69, 85, 78, 128, 83, 83, 
+    65, 78, 71, 77, 73, 69, 85, 77, 128, 83, 83, 65, 78, 71, 75, 73, 89, 69, 
+    79, 75, 128, 83, 83, 65, 78, 71, 73, 69, 85, 78, 71, 128, 83, 83, 65, 78, 
+    71, 72, 73, 69, 85, 72, 128, 83, 83, 65, 78, 71, 67, 73, 69, 85, 67, 45, 
+    72, 73, 69, 85, 72, 128, 83, 83, 65, 78, 71, 67, 73, 69, 85, 67, 128, 83, 
+    83, 65, 78, 71, 65, 82, 65, 69, 65, 128, 83, 83, 65, 73, 128, 83, 83, 65, 
+    65, 128, 83, 83, 51, 128, 83, 83, 50, 128, 83, 82, 128, 83, 81, 85, 73, 
+    83, 200, 83, 81, 85, 73, 82, 82, 69, 204, 83, 81, 85, 73, 71, 71, 76, 
+    197, 83, 81, 85, 65, 212, 83, 81, 85, 65, 82, 69, 83, 128, 83, 81, 85, 
+    65, 82, 69, 68, 128, 83, 81, 85, 65, 82, 69, 128, 83, 80, 87, 65, 128, 
+    83, 80, 85, 78, 71, 211, 83, 80, 82, 79, 85, 84, 128, 83, 80, 82, 73, 78, 
+    71, 83, 128, 83, 80, 82, 73, 78, 71, 128, 83, 80, 82, 69, 67, 72, 71, 69, 
+    83, 65, 78, 199, 83, 80, 79, 85, 84, 73, 78, 199, 83, 80, 79, 84, 128, 
+    83, 80, 79, 79, 78, 128, 83, 80, 76, 73, 84, 84, 73, 78, 199, 83, 80, 76, 
+    65, 83, 72, 73, 78, 199, 83, 80, 73, 82, 73, 84, 85, 211, 83, 80, 73, 82, 
+    73, 84, 128, 83, 80, 73, 82, 73, 212, 83, 80, 73, 82, 65, 78, 84, 128, 
+    83, 80, 73, 82, 65, 76, 128, 83, 80, 73, 82, 65, 204, 83, 80, 73, 68, 69, 
+    82, 217, 83, 80, 73, 67, 69, 128, 83, 80, 72, 69, 82, 73, 67, 65, 204, 
+    83, 80, 69, 83, 77, 73, 76, 207, 83, 80, 69, 69, 68, 66, 79, 65, 84, 128, 
+    83, 80, 69, 69, 67, 72, 128, 83, 80, 69, 69, 67, 200, 83, 80, 69, 67, 73, 
+    65, 76, 128, 83, 80, 69, 65, 82, 128, 83, 80, 69, 65, 75, 69, 82, 128, 
+    83, 80, 69, 65, 75, 69, 210, 83, 80, 69, 65, 75, 45, 78, 79, 45, 69, 86, 
+    73, 204, 83, 80, 65, 84, 72, 73, 128, 83, 80, 65, 82, 75, 76, 73, 78, 
+    199, 83, 80, 65, 82, 75, 76, 69, 83, 128, 83, 80, 65, 82, 75, 76, 69, 82, 
+    128, 83, 80, 65, 82, 75, 76, 69, 128, 83, 80, 65, 71, 72, 69, 84, 84, 73, 
+    128, 83, 80, 65, 68, 69, 83, 128, 83, 80, 65, 68, 197, 83, 80, 65, 67, 
+    73, 78, 199, 83, 80, 65, 67, 197, 83, 80, 65, 128, 83, 79, 89, 128, 83, 
+    79, 87, 73, 76, 207, 83, 79, 87, 128, 83, 79, 85, 84, 72, 69, 82, 206, 
+    83, 79, 85, 84, 72, 45, 83, 76, 65, 86, 69, 217, 83, 79, 85, 84, 200, 83, 
+    79, 85, 82, 67, 69, 128, 83, 79, 85, 78, 68, 128, 83, 79, 85, 78, 196, 
+    83, 79, 85, 78, 65, 80, 128, 83, 79, 85, 128, 83, 79, 83, 128, 83, 79, 
+    82, 193, 83, 79, 81, 128, 83, 79, 79, 206, 83, 79, 78, 74, 65, 77, 128, 
+    83, 79, 78, 71, 128, 83, 79, 78, 128, 83, 79, 77, 80, 69, 78, 199, 83, 
+    79, 77, 128, 83, 79, 76, 73, 68, 85, 83, 128, 83, 79, 76, 73, 68, 85, 
+    211, 83, 79, 72, 128, 83, 79, 71, 68, 73, 65, 206, 83, 79, 70, 84, 87, 
+    65, 82, 69, 45, 70, 85, 78, 67, 84, 73, 79, 206, 83, 79, 70, 84, 78, 69, 
+    83, 83, 128, 83, 79, 70, 212, 83, 79, 198, 83, 79, 67, 73, 69, 84, 89, 
+    128, 83, 79, 67, 67, 69, 210, 83, 79, 65, 80, 128, 83, 79, 65, 128, 83, 
+    207, 83, 78, 79, 87, 77, 65, 78, 128, 83, 78, 79, 87, 77, 65, 206, 83, 
+    78, 79, 87, 70, 76, 65, 75, 69, 128, 83, 78, 79, 87, 66, 79, 65, 82, 68, 
+    69, 82, 128, 83, 78, 79, 87, 128, 83, 78, 79, 85, 84, 128, 83, 78, 79, 
+    85, 212, 83, 78, 65, 208, 83, 78, 65, 75, 69, 128, 83, 78, 65, 75, 197, 
+    83, 78, 65, 73, 76, 128, 83, 78, 193, 83, 77, 79, 75, 73, 78, 199, 83, 
+    77, 73, 82, 75, 73, 78, 199, 83, 77, 73, 76, 73, 78, 199, 83, 77, 73, 76, 
+    69, 128, 83, 77, 69, 65, 82, 128, 83, 77, 65, 83, 200, 83, 77, 65, 76, 
+    76, 69, 210, 83, 77, 65, 76, 76, 128, 83, 76, 85, 82, 128, 83, 76, 79, 
+    87, 76, 89, 128, 83, 76, 79, 215, 83, 76, 79, 86, 79, 128, 83, 76, 79, 
+    212, 83, 76, 79, 80, 73, 78, 199, 83, 76, 79, 80, 69, 128, 83, 76, 73, 
+    78, 71, 128, 83, 76, 73, 68, 73, 78, 71, 128, 83, 76, 73, 67, 69, 128, 
+    83, 76, 73, 67, 197, 83, 76, 69, 69, 80, 217, 83, 76, 69, 69, 80, 73, 78, 
+    199, 83, 76, 65, 86, 79, 78, 73, 195, 83, 76, 65, 86, 69, 128, 83, 76, 
+    65, 83, 72, 128, 83, 76, 65, 83, 200, 83, 76, 65, 78, 84, 69, 196, 83, 
+    75, 87, 65, 128, 83, 75, 87, 128, 83, 75, 85, 76, 76, 128, 83, 75, 85, 
+    76, 204, 83, 75, 76, 73, 82, 79, 206, 83, 75, 73, 78, 128, 83, 75, 73, 
+    69, 82, 128, 83, 75, 201, 83, 75, 69, 87, 69, 196, 83, 75, 65, 84, 69, 
+    128, 83, 75, 128, 83, 74, 69, 128, 83, 73, 88, 84, 89, 45, 70, 79, 85, 
+    82, 84, 200, 83, 73, 88, 84, 89, 128, 83, 73, 88, 84, 217, 83, 73, 88, 
+    84, 72, 83, 128, 83, 73, 88, 84, 72, 211, 83, 73, 88, 84, 72, 128, 83, 
+    73, 88, 84, 69, 69, 78, 84, 72, 83, 128, 83, 73, 88, 84, 69, 69, 78, 84, 
+    72, 128, 83, 73, 88, 84, 69, 69, 78, 84, 200, 83, 73, 88, 84, 69, 69, 78, 
+    128, 83, 73, 88, 84, 69, 69, 206, 83, 73, 88, 45, 84, 72, 73, 82, 84, 89, 
+    128, 83, 73, 88, 45, 83, 84, 82, 73, 78, 199, 83, 73, 88, 45, 80, 69, 82, 
+    45, 69, 205, 83, 73, 88, 45, 76, 73, 78, 197, 83, 73, 216, 83, 73, 84, 
+    69, 128, 83, 73, 83, 65, 128, 83, 73, 82, 73, 78, 71, 85, 128, 83, 73, 
+    79, 83, 45, 84, 72, 73, 69, 85, 84, 72, 128, 83, 73, 79, 83, 45, 83, 83, 
+    65, 78, 71, 83, 73, 79, 83, 128, 83, 73, 79, 83, 45, 82, 73, 69, 85, 76, 
+    128, 83, 73, 79, 83, 45, 80, 73, 69, 85, 80, 45, 75, 73, 89, 69, 79, 75, 
+    128, 83, 73, 79, 83, 45, 80, 72, 73, 69, 85, 80, 72, 128, 83, 73, 79, 83, 
+    45, 80, 65, 78, 83, 73, 79, 83, 128, 83, 73, 79, 83, 45, 78, 73, 69, 85, 
+    78, 128, 83, 73, 79, 83, 45, 77, 73, 69, 85, 77, 128, 83, 73, 79, 83, 45, 
+    75, 72, 73, 69, 85, 75, 72, 128, 83, 73, 79, 83, 45, 75, 65, 80, 89, 69, 
+    79, 85, 78, 80, 73, 69, 85, 80, 128, 83, 73, 79, 83, 45, 73, 69, 85, 78, 
+    71, 128, 83, 73, 79, 83, 45, 72, 73, 69, 85, 72, 128, 83, 73, 79, 83, 45, 
+    67, 73, 69, 85, 67, 128, 83, 73, 79, 83, 45, 67, 72, 73, 69, 85, 67, 72, 
+    128, 83, 73, 79, 211, 83, 73, 78, 75, 73, 78, 71, 128, 83, 73, 78, 71, 
+    76, 69, 45, 83, 72, 73, 70, 84, 45, 51, 128, 83, 73, 78, 71, 76, 69, 45, 
+    83, 72, 73, 70, 84, 45, 50, 128, 83, 73, 78, 71, 76, 69, 45, 76, 73, 78, 
+    197, 83, 73, 78, 71, 76, 69, 128, 83, 73, 78, 71, 76, 197, 83, 73, 78, 
+    71, 65, 65, 84, 128, 83, 73, 78, 197, 83, 73, 78, 68, 72, 201, 83, 73, 
+    206, 83, 73, 77, 80, 76, 73, 70, 73, 69, 196, 83, 73, 77, 73, 76, 65, 82, 
+    128, 83, 73, 77, 73, 76, 65, 210, 83, 73, 77, 65, 78, 83, 73, 211, 83, 
+    73, 77, 65, 76, 85, 78, 71, 85, 206, 83, 73, 77, 65, 128, 83, 73, 76, 86, 
+    69, 82, 128, 83, 73, 76, 75, 128, 83, 73, 76, 73, 81, 85, 193, 83, 73, 
+    76, 72, 79, 85, 69, 84, 84, 69, 128, 83, 73, 76, 72, 79, 85, 69, 84, 84, 
+    197, 83, 73, 76, 65, 51, 128, 83, 73, 75, 73, 128, 83, 73, 75, 50, 128, 
+    83, 73, 75, 178, 83, 73, 71, 78, 83, 128, 83, 73, 71, 77, 65, 128, 83, 
+    73, 71, 77, 193, 83, 73, 71, 69, 204, 83, 73, 71, 52, 128, 83, 73, 71, 
+    180, 83, 73, 71, 128, 83, 73, 69, 69, 128, 83, 73, 68, 69, 87, 65, 89, 
+    211, 83, 73, 67, 75, 78, 69, 83, 83, 128, 83, 73, 67, 75, 76, 69, 128, 
+    83, 73, 66, 197, 83, 201, 83, 72, 89, 88, 128, 83, 72, 89, 84, 128, 83, 
+    72, 89, 82, 88, 128, 83, 72, 89, 82, 128, 83, 72, 89, 80, 128, 83, 72, 
+    89, 69, 128, 83, 72, 89, 65, 128, 83, 72, 89, 128, 83, 72, 87, 79, 89, 
+    128, 83, 72, 87, 79, 79, 128, 83, 72, 87, 79, 128, 83, 72, 87, 73, 73, 
+    128, 83, 72, 87, 73, 128, 83, 72, 87, 69, 128, 83, 72, 87, 65, 65, 128, 
+    83, 72, 87, 65, 128, 83, 72, 85, 88, 128, 83, 72, 85, 85, 128, 83, 72, 
+    85, 84, 128, 83, 72, 85, 82, 88, 128, 83, 72, 85, 82, 128, 83, 72, 85, 
+    80, 128, 83, 72, 85, 79, 88, 128, 83, 72, 85, 79, 80, 128, 83, 72, 85, 
+    79, 128, 83, 72, 85, 77, 128, 83, 72, 85, 70, 70, 76, 197, 83, 72, 85, 
+    69, 81, 128, 83, 72, 85, 69, 78, 83, 72, 85, 69, 84, 128, 83, 72, 85, 66, 
+    85, 82, 128, 83, 72, 85, 50, 128, 83, 72, 85, 178, 83, 72, 85, 128, 83, 
+    72, 213, 83, 72, 84, 65, 80, 73, 67, 128, 83, 72, 84, 65, 128, 83, 72, 
+    82, 73, 78, 69, 128, 83, 72, 82, 73, 77, 80, 128, 83, 72, 82, 73, 73, 
+    128, 83, 72, 79, 89, 128, 83, 72, 79, 88, 128, 83, 72, 79, 87, 69, 82, 
+    128, 83, 72, 79, 85, 76, 68, 69, 82, 69, 196, 83, 72, 79, 84, 128, 83, 
+    72, 79, 82, 84, 83, 128, 83, 72, 79, 82, 84, 211, 83, 72, 79, 82, 84, 69, 
+    78, 69, 82, 128, 83, 72, 79, 82, 84, 67, 65, 75, 69, 128, 83, 72, 79, 82, 
+    84, 45, 84, 87, 73, 71, 45, 89, 82, 128, 83, 72, 79, 82, 84, 45, 84, 87, 
+    73, 71, 45, 84, 89, 210, 83, 72, 79, 82, 84, 45, 84, 87, 73, 71, 45, 83, 
+    79, 204, 83, 72, 79, 82, 84, 45, 84, 87, 73, 71, 45, 79, 83, 211, 83, 72, 
+    79, 82, 84, 45, 84, 87, 73, 71, 45, 78, 65, 85, 196, 83, 72, 79, 82, 84, 
+    45, 84, 87, 73, 71, 45, 77, 65, 68, 210, 83, 72, 79, 82, 84, 45, 84, 87, 
+    73, 71, 45, 72, 65, 71, 65, 76, 204, 83, 72, 79, 82, 84, 45, 84, 87, 73, 
+    71, 45, 66, 74, 65, 82, 75, 65, 206, 83, 72, 79, 82, 84, 45, 84, 87, 73, 
+    71, 45, 65, 210, 83, 72, 79, 82, 84, 128, 83, 72, 79, 82, 212, 83, 72, 
+    79, 81, 128, 83, 72, 79, 209, 83, 72, 79, 80, 128, 83, 72, 79, 79, 84, 
+    73, 78, 199, 83, 72, 79, 79, 84, 128, 83, 72, 79, 79, 128, 83, 72, 79, 
+    71, 201, 83, 72, 79, 199, 83, 72, 79, 69, 128, 83, 72, 79, 197, 83, 72, 
+    79, 65, 128, 83, 72, 79, 128, 83, 72, 73, 89, 89, 65, 65, 76, 65, 65, 
+    128, 83, 72, 73, 84, 65, 128, 83, 72, 73, 84, 193, 83, 72, 73, 82, 212, 
+    83, 72, 73, 82, 65, 69, 128, 83, 72, 73, 82, 128, 83, 72, 73, 210, 83, 
+    72, 73, 81, 128, 83, 72, 73, 80, 128, 83, 72, 73, 78, 84, 207, 83, 72, 
+    73, 78, 73, 71, 128, 83, 72, 73, 78, 68, 193, 83, 72, 73, 78, 128, 83, 
+    72, 73, 206, 83, 72, 73, 77, 65, 128, 83, 72, 73, 77, 193, 83, 72, 73, 
+    77, 128, 83, 72, 73, 205, 83, 72, 73, 73, 78, 128, 83, 72, 73, 73, 128, 
+    83, 72, 73, 70, 212, 83, 72, 73, 69, 76, 68, 128, 83, 72, 73, 68, 128, 
+    83, 72, 73, 196, 83, 72, 72, 65, 128, 83, 72, 72, 193, 83, 72, 69, 88, 
+    128, 83, 72, 69, 86, 65, 128, 83, 72, 69, 85, 88, 128, 83, 72, 69, 85, 
+    79, 81, 128, 83, 72, 69, 85, 65, 69, 81, 84, 85, 128, 83, 72, 69, 85, 65, 
+    69, 81, 128, 83, 72, 69, 85, 65, 69, 128, 83, 72, 69, 84, 128, 83, 72, 
+    69, 212, 83, 72, 69, 83, 72, 76, 65, 77, 128, 83, 72, 69, 83, 72, 73, 71, 
+    128, 83, 72, 69, 83, 72, 73, 199, 83, 72, 69, 83, 72, 50, 128, 83, 72, 
+    69, 83, 72, 128, 83, 72, 69, 81, 69, 204, 83, 72, 69, 80, 128, 83, 72, 
+    69, 78, 128, 83, 72, 69, 76, 76, 128, 83, 72, 69, 76, 204, 83, 72, 69, 
+    76, 70, 128, 83, 72, 69, 73, 128, 83, 72, 69, 71, 57, 128, 83, 72, 69, 
+    69, 80, 128, 83, 72, 69, 69, 78, 85, 128, 83, 72, 69, 69, 78, 128, 83, 
+    72, 69, 69, 206, 83, 72, 69, 69, 128, 83, 72, 69, 45, 71, 79, 65, 84, 
+    128, 83, 72, 197, 83, 72, 67, 72, 65, 128, 83, 72, 65, 89, 128, 83, 72, 
+    65, 88, 128, 83, 72, 65, 86, 73, 89, 65, 78, 73, 128, 83, 72, 65, 86, 73, 
+    65, 206, 83, 72, 65, 86, 69, 196, 83, 72, 65, 85, 128, 83, 72, 65, 84, 
+    128, 83, 72, 65, 82, 85, 128, 83, 72, 65, 82, 213, 83, 72, 65, 82, 80, 
+    128, 83, 72, 65, 82, 208, 83, 72, 65, 82, 65, 128, 83, 72, 65, 82, 50, 
+    128, 83, 72, 65, 82, 178, 83, 72, 65, 80, 73, 78, 71, 128, 83, 72, 65, 
+    80, 69, 83, 128, 83, 72, 65, 80, 197, 83, 72, 65, 80, 128, 83, 72, 65, 
+    78, 71, 128, 83, 72, 65, 78, 128, 83, 72, 65, 206, 83, 72, 65, 77, 82, 
+    79, 67, 75, 128, 83, 72, 65, 76, 83, 72, 69, 76, 69, 84, 128, 83, 72, 65, 
+    75, 84, 73, 128, 83, 72, 65, 73, 128, 83, 72, 65, 68, 79, 87, 69, 196, 
+    83, 72, 65, 68, 69, 128, 83, 72, 65, 68, 68, 65, 128, 83, 72, 65, 68, 68, 
+    193, 83, 72, 65, 68, 128, 83, 72, 65, 196, 83, 72, 65, 66, 54, 128, 83, 
+    72, 65, 65, 128, 83, 72, 65, 54, 128, 83, 72, 65, 51, 128, 83, 72, 65, 
+    179, 83, 71, 82, 193, 83, 71, 79, 210, 83, 71, 67, 128, 83, 71, 65, 215, 
+    83, 71, 65, 194, 83, 71, 128, 83, 69, 88, 84, 85, 76, 193, 83, 69, 88, 
+    84, 73, 76, 69, 128, 83, 69, 88, 84, 65, 78, 211, 83, 69, 86, 69, 82, 65, 
+    78, 67, 69, 128, 83, 69, 86, 69, 78, 84, 89, 128, 83, 69, 86, 69, 78, 84, 
+    217, 83, 69, 86, 69, 78, 84, 72, 128, 83, 69, 86, 69, 78, 84, 69, 69, 78, 
+    128, 83, 69, 86, 69, 78, 84, 69, 69, 206, 83, 69, 86, 69, 78, 45, 84, 72, 
+    73, 82, 84, 89, 128, 83, 69, 86, 69, 206, 83, 69, 85, 88, 128, 83, 69, 
+    85, 78, 89, 65, 77, 128, 83, 69, 85, 65, 69, 81, 128, 83, 69, 84, 70, 79, 
+    78, 128, 83, 69, 83, 84, 69, 82, 84, 73, 85, 211, 83, 69, 83, 81, 85, 73, 
+    81, 85, 65, 68, 82, 65, 84, 69, 128, 83, 69, 83, 65, 77, 197, 83, 69, 82, 
+    86, 73, 67, 197, 83, 69, 82, 73, 70, 83, 128, 83, 69, 82, 73, 70, 211, 
+    83, 69, 81, 85, 69, 78, 67, 197, 83, 69, 80, 84, 69, 77, 66, 69, 82, 128, 
+    83, 69, 80, 65, 82, 65, 84, 79, 82, 128, 83, 69, 80, 65, 82, 65, 84, 79, 
+    210, 83, 69, 78, 84, 79, 128, 83, 69, 78, 84, 73, 128, 83, 69, 77, 85, 
+    78, 67, 73, 193, 83, 69, 77, 75, 65, 84, 72, 128, 83, 69, 77, 75, 128, 
+    83, 69, 77, 73, 86, 79, 87, 69, 204, 83, 69, 77, 73, 83, 79, 70, 212, 83, 
+    69, 77, 73, 83, 69, 88, 84, 73, 76, 69, 128, 83, 69, 77, 73, 77, 73, 78, 
+    73, 77, 193, 83, 69, 77, 73, 68, 73, 82, 69, 67, 212, 83, 69, 77, 73, 67, 
+    79, 76, 79, 78, 128, 83, 69, 77, 73, 67, 79, 76, 79, 206, 83, 69, 77, 73, 
+    67, 73, 82, 67, 85, 76, 65, 210, 83, 69, 77, 73, 67, 73, 82, 67, 76, 197, 
+    83, 69, 77, 73, 66, 82, 69, 86, 73, 211, 83, 69, 77, 73, 45, 86, 79, 73, 
+    67, 69, 196, 83, 69, 76, 70, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 57, 
+    57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 57, 56, 128, 83, 69, 76, 69, 
+    67, 84, 79, 82, 45, 57, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 57, 
+    54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 57, 53, 128, 83, 69, 76, 69, 
+    67, 84, 79, 82, 45, 57, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 57, 
+    51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 57, 50, 128, 83, 69, 76, 69, 
+    67, 84, 79, 82, 45, 57, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 57, 
+    48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 57, 128, 83, 69, 76, 69, 67, 
+    84, 79, 82, 45, 56, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 56, 56, 
+    128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 56, 55, 128, 83, 69, 76, 69, 67, 
+    84, 79, 82, 45, 56, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 56, 53, 
+    128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 56, 52, 128, 83, 69, 76, 69, 67, 
+    84, 79, 82, 45, 56, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 56, 50, 
+    128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 56, 49, 128, 83, 69, 76, 69, 67, 
+    84, 79, 82, 45, 56, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 56, 128, 
+    83, 69, 76, 69, 67, 84, 79, 82, 45, 55, 57, 128, 83, 69, 76, 69, 67, 84, 
+    79, 82, 45, 55, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 55, 55, 128, 
+    83, 69, 76, 69, 67, 84, 79, 82, 45, 55, 54, 128, 83, 69, 76, 69, 67, 84, 
+    79, 82, 45, 55, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 55, 52, 128, 
+    83, 69, 76, 69, 67, 84, 79, 82, 45, 55, 51, 128, 83, 69, 76, 69, 67, 84, 
+    79, 82, 45, 55, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 55, 49, 128, 
+    83, 69, 76, 69, 67, 84, 79, 82, 45, 55, 48, 128, 83, 69, 76, 69, 67, 84, 
+    79, 82, 45, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 54, 57, 128, 83, 
+    69, 76, 69, 67, 84, 79, 82, 45, 54, 56, 128, 83, 69, 76, 69, 67, 84, 79, 
+    82, 45, 54, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 54, 54, 128, 83, 
+    69, 76, 69, 67, 84, 79, 82, 45, 54, 53, 128, 83, 69, 76, 69, 67, 84, 79, 
+    82, 45, 54, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 54, 51, 128, 83, 
+    69, 76, 69, 67, 84, 79, 82, 45, 54, 50, 128, 83, 69, 76, 69, 67, 84, 79, 
+    82, 45, 54, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 54, 48, 128, 83, 
+    69, 76, 69, 67, 84, 79, 82, 45, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 
+    45, 53, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 53, 56, 128, 83, 69, 
+    76, 69, 67, 84, 79, 82, 45, 53, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 
+    45, 53, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 53, 53, 128, 83, 69, 
+    76, 69, 67, 84, 79, 82, 45, 53, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 
+    45, 53, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 53, 50, 128, 83, 69, 
+    76, 69, 67, 84, 79, 82, 45, 53, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 
+    45, 53, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 53, 128, 83, 69, 76, 
+    69, 67, 84, 79, 82, 45, 52, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 
+    52, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 52, 55, 128, 83, 69, 76, 
+    69, 67, 84, 79, 82, 45, 52, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 
+    52, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 52, 52, 128, 83, 69, 76, 
+    69, 67, 84, 79, 82, 45, 52, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 
+    52, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 52, 49, 128, 83, 69, 76, 
+    69, 67, 84, 79, 82, 45, 52, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 
+    52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 51, 57, 128, 83, 69, 76, 69, 
+    67, 84, 79, 82, 45, 51, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 51, 
+    55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 51, 54, 128, 83, 69, 76, 69, 
+    67, 84, 79, 82, 45, 51, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 51, 
+    52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 51, 51, 128, 83, 69, 76, 69, 
+    67, 84, 79, 82, 45, 51, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 51, 
+    49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 51, 48, 128, 83, 69, 76, 69, 
+    67, 84, 79, 82, 45, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 57, 
+    128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 56, 128, 83, 69, 76, 69, 67, 
+    84, 79, 82, 45, 50, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 54, 
+    128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 53, 54, 128, 83, 69, 76, 69, 
+    67, 84, 79, 82, 45, 50, 53, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 
+    50, 53, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 53, 51, 128, 83, 
+    69, 76, 69, 67, 84, 79, 82, 45, 50, 53, 50, 128, 83, 69, 76, 69, 67, 84, 
+    79, 82, 45, 50, 53, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 53, 
+    48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 53, 128, 83, 69, 76, 69, 
+    67, 84, 79, 82, 45, 50, 52, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 
+    50, 52, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 52, 55, 128, 83, 
+    69, 76, 69, 67, 84, 79, 82, 45, 50, 52, 54, 128, 83, 69, 76, 69, 67, 84, 
+    79, 82, 45, 50, 52, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 52, 
+    52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 52, 51, 128, 83, 69, 76, 
+    69, 67, 84, 79, 82, 45, 50, 52, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 
+    45, 50, 52, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 52, 48, 128, 
+    83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 52, 128, 83, 69, 76, 69, 67, 84, 
+    79, 82, 45, 50, 51, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 51, 
+    56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 51, 55, 128, 83, 69, 76, 
+    69, 67, 84, 79, 82, 45, 50, 51, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 
+    45, 50, 51, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 51, 52, 128, 
+    83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 51, 51, 128, 83, 69, 76, 69, 67, 
+    84, 79, 82, 45, 50, 51, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 
+    51, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 51, 48, 128, 83, 69, 
+    76, 69, 67, 84, 79, 82, 45, 50, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 
+    45, 50, 50, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 50, 56, 128, 
+    83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 50, 55, 128, 83, 69, 76, 69, 67, 
+    84, 79, 82, 45, 50, 50, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 
+    50, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 50, 52, 128, 83, 69, 
+    76, 69, 67, 84, 79, 82, 45, 50, 50, 51, 128, 83, 69, 76, 69, 67, 84, 79, 
+    82, 45, 50, 50, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 50, 49, 
+    128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 50, 48, 128, 83, 69, 76, 69, 
+    67, 84, 79, 82, 45, 50, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 
+    49, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 49, 56, 128, 83, 69, 
+    76, 69, 67, 84, 79, 82, 45, 50, 49, 55, 128, 83, 69, 76, 69, 67, 84, 79, 
+    82, 45, 50, 49, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 49, 53, 
+    128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 49, 52, 128, 83, 69, 76, 69, 
+    67, 84, 79, 82, 45, 50, 49, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 
+    50, 49, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 49, 49, 128, 83, 
+    69, 76, 69, 67, 84, 79, 82, 45, 50, 49, 48, 128, 83, 69, 76, 69, 67, 84, 
+    79, 82, 45, 50, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 48, 57, 
+    128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 48, 56, 128, 83, 69, 76, 69, 
+    67, 84, 79, 82, 45, 50, 48, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 
+    50, 48, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 48, 53, 128, 83, 
+    69, 76, 69, 67, 84, 79, 82, 45, 50, 48, 52, 128, 83, 69, 76, 69, 67, 84, 
+    79, 82, 45, 50, 48, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 48, 
+    50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 48, 49, 128, 83, 69, 76, 
+    69, 67, 84, 79, 82, 45, 50, 48, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 
+    45, 50, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 128, 83, 69, 76, 
+    69, 67, 84, 79, 82, 45, 49, 57, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 
+    45, 49, 57, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 57, 55, 128, 
+    83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 57, 54, 128, 83, 69, 76, 69, 67, 
+    84, 79, 82, 45, 49, 57, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 
+    57, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 57, 51, 128, 83, 69, 
+    76, 69, 67, 84, 79, 82, 45, 49, 57, 50, 128, 83, 69, 76, 69, 67, 84, 79, 
+    82, 45, 49, 57, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 57, 48, 
+    128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 57, 128, 83, 69, 76, 69, 67, 
+    84, 79, 82, 45, 49, 56, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 
+    56, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 56, 55, 128, 83, 69, 
+    76, 69, 67, 84, 79, 82, 45, 49, 56, 54, 128, 83, 69, 76, 69, 67, 84, 79, 
+    82, 45, 49, 56, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 56, 52, 
+    128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 56, 51, 128, 83, 69, 76, 69, 
+    67, 84, 79, 82, 45, 49, 56, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 
+    49, 56, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 56, 48, 128, 83, 
+    69, 76, 69, 67, 84, 79, 82, 45, 49, 56, 128, 83, 69, 76, 69, 67, 84, 79, 
+    82, 45, 49, 55, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 55, 56, 
+    128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 55, 55, 128, 83, 69, 76, 69, 
+    67, 84, 79, 82, 45, 49, 55, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 
+    49, 55, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 55, 52, 128, 83, 
+    69, 76, 69, 67, 84, 79, 82, 45, 49, 55, 51, 128, 83, 69, 76, 69, 67, 84, 
+    79, 82, 45, 49, 55, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 55, 
+    49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 55, 48, 128, 83, 69, 76, 
+    69, 67, 84, 79, 82, 45, 49, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 
+    49, 54, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 54, 56, 128, 83, 
+    69, 76, 69, 67, 84, 79, 82, 45, 49, 54, 55, 128, 83, 69, 76, 69, 67, 84, 
+    79, 82, 45, 49, 54, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 54, 
+    53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 54, 52, 128, 83, 69, 76, 
+    69, 67, 84, 79, 82, 45, 49, 54, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 
+    45, 49, 54, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 54, 49, 128, 
+    83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 54, 48, 128, 83, 69, 76, 69, 67, 
+    84, 79, 82, 45, 49, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 53, 
+    57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 53, 56, 128, 83, 69, 76, 
+    69, 67, 84, 79, 82, 45, 49, 53, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 
+    45, 49, 53, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 53, 53, 128, 
+    83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 53, 52, 128, 83, 69, 76, 69, 67, 
+    84, 79, 82, 45, 49, 53, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 
+    53, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 53, 49, 128, 83, 69, 
+    76, 69, 67, 84, 79, 82, 45, 49, 53, 48, 128, 83, 69, 76, 69, 67, 84, 79, 
+    82, 45, 49, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 52, 57, 128, 
+    83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 52, 56, 128, 83, 69, 76, 69, 67, 
+    84, 79, 82, 45, 49, 52, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 
+    52, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 52, 53, 128, 83, 69, 
+    76, 69, 67, 84, 79, 82, 45, 49, 52, 52, 128, 83, 69, 76, 69, 67, 84, 79, 
+    82, 45, 49, 52, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 52, 50, 
+    128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 52, 49, 128, 83, 69, 76, 69, 
+    67, 84, 79, 82, 45, 49, 52, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 
+    49, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 51, 57, 128, 83, 69, 
+    76, 69, 67, 84, 79, 82, 45, 49, 51, 56, 128, 83, 69, 76, 69, 67, 84, 79, 
+    82, 45, 49, 51, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 51, 54, 
+    128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 51, 53, 128, 83, 69, 76, 69, 
+    67, 84, 79, 82, 45, 49, 51, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 
+    49, 51, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 51, 50, 128, 83, 
+    69, 76, 69, 67, 84, 79, 82, 45, 49, 51, 49, 128, 83, 69, 76, 69, 67, 84, 
+    79, 82, 45, 49, 51, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 51, 
+    128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 50, 57, 128, 83, 69, 76, 69, 
+    67, 84, 79, 82, 45, 49, 50, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 
+    49, 50, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 50, 54, 128, 83, 
+    69, 76, 69, 67, 84, 79, 82, 45, 49, 50, 53, 128, 83, 69, 76, 69, 67, 84, 
+    79, 82, 45, 49, 50, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 50, 
+    51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 50, 50, 128, 83, 69, 76, 
+    69, 67, 84, 79, 82, 45, 49, 50, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 
+    45, 49, 50, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 50, 128, 83, 
+    69, 76, 69, 67, 84, 79, 82, 45, 49, 49, 57, 128, 83, 69, 76, 69, 67, 84, 
+    79, 82, 45, 49, 49, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 49, 
+    55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 49, 54, 128, 83, 69, 76, 
+    69, 67, 84, 79, 82, 45, 49, 49, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 
+    45, 49, 49, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 49, 51, 128, 
+    83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 49, 50, 128, 83, 69, 76, 69, 67, 
+    84, 79, 82, 45, 49, 49, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 
+    49, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 49, 128, 83, 69, 76, 
+    69, 67, 84, 79, 82, 45, 49, 48, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 
+    45, 49, 48, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 48, 55, 128, 
+    83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 48, 54, 128, 83, 69, 76, 69, 67, 
+    84, 79, 82, 45, 49, 48, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 
+    48, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 48, 51, 128, 83, 69, 
+    76, 69, 67, 84, 79, 82, 45, 49, 48, 50, 128, 83, 69, 76, 69, 67, 84, 79, 
+    82, 45, 49, 48, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 48, 48, 
+    128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 48, 128, 83, 69, 76, 69, 67, 
+    84, 79, 82, 45, 49, 128, 83, 69, 76, 69, 67, 84, 79, 210, 83, 69, 76, 69, 
+    67, 84, 69, 196, 83, 69, 73, 83, 77, 65, 128, 83, 69, 73, 83, 77, 193, 
+    83, 69, 72, 128, 83, 69, 71, 79, 76, 128, 83, 69, 71, 78, 79, 128, 83, 
+    69, 71, 77, 69, 78, 84, 128, 83, 69, 69, 78, 85, 128, 83, 69, 69, 78, 
     128, 83, 69, 69, 206, 83, 69, 69, 68, 76, 73, 78, 71, 128, 83, 69, 69, 
     45, 78, 79, 45, 69, 86, 73, 204, 83, 69, 67, 84, 79, 82, 128, 83, 69, 67, 
     84, 73, 79, 78, 128, 83, 69, 67, 84, 73, 79, 206, 83, 69, 67, 82, 69, 84, 
@@ -1292,2731 +1293,2733 @@
     67, 203, 82, 79, 67, 128, 82, 79, 66, 65, 84, 128, 82, 79, 65, 83, 84, 
     69, 196, 82, 79, 65, 82, 128, 82, 79, 65, 128, 82, 78, 89, 73, 78, 199, 
     82, 78, 79, 79, 78, 128, 82, 78, 79, 79, 206, 82, 78, 65, 205, 82, 77, 
-    84, 128, 82, 76, 79, 128, 82, 76, 77, 128, 82, 76, 69, 128, 82, 74, 69, 
-    211, 82, 74, 69, 128, 82, 74, 197, 82, 73, 86, 69, 82, 128, 82, 73, 84, 
-    85, 65, 76, 128, 82, 73, 84, 84, 79, 82, 85, 128, 82, 73, 84, 83, 73, 
-    128, 82, 73, 83, 73, 78, 199, 82, 73, 83, 72, 128, 82, 73, 82, 65, 128, 
-    82, 73, 80, 128, 82, 73, 78, 71, 211, 82, 73, 78, 70, 79, 82, 90, 65, 78, 
-    68, 79, 128, 82, 73, 206, 82, 73, 77, 71, 66, 65, 128, 82, 73, 75, 82, 
-    73, 75, 128, 82, 73, 71, 86, 69, 68, 73, 195, 82, 73, 71, 72, 84, 87, 65, 
-    82, 68, 83, 128, 82, 73, 71, 72, 84, 72, 65, 78, 196, 82, 73, 71, 72, 84, 
-    45, 84, 79, 45, 76, 69, 70, 212, 82, 73, 71, 72, 84, 45, 83, 73, 68, 197, 
-    82, 73, 71, 72, 84, 45, 83, 72, 65, 68, 79, 87, 69, 196, 82, 73, 71, 72, 
-    84, 45, 83, 72, 65, 68, 69, 196, 82, 73, 71, 72, 84, 45, 80, 79, 73, 78, 
-    84, 73, 78, 199, 82, 73, 71, 72, 84, 45, 72, 65, 78, 68, 69, 196, 82, 73, 
-    71, 72, 84, 45, 72, 65, 78, 196, 82, 73, 71, 72, 84, 45, 70, 65, 67, 73, 
-    78, 199, 82, 73, 71, 72, 84, 128, 82, 73, 69, 85, 76, 45, 89, 69, 83, 73, 
-    69, 85, 78, 71, 128, 82, 73, 69, 85, 76, 45, 89, 69, 79, 82, 73, 78, 72, 
-    73, 69, 85, 72, 45, 72, 73, 69, 85, 72, 128, 82, 73, 69, 85, 76, 45, 89, 
-    69, 79, 82, 73, 78, 72, 73, 69, 85, 72, 128, 82, 73, 69, 85, 76, 45, 84, 
-    73, 75, 69, 85, 84, 45, 72, 73, 69, 85, 72, 128, 82, 73, 69, 85, 76, 45, 
-    84, 73, 75, 69, 85, 84, 128, 82, 73, 69, 85, 76, 45, 84, 72, 73, 69, 85, 
-    84, 72, 128, 82, 73, 69, 85, 76, 45, 83, 83, 65, 78, 71, 84, 73, 75, 69, 
-    85, 84, 128, 82, 73, 69, 85, 76, 45, 83, 83, 65, 78, 71, 83, 73, 79, 83, 
-    128, 82, 73, 69, 85, 76, 45, 83, 83, 65, 78, 71, 80, 73, 69, 85, 80, 128, 
-    82, 73, 69, 85, 76, 45, 83, 83, 65, 78, 71, 75, 73, 89, 69, 79, 75, 128, 
-    82, 73, 69, 85, 76, 45, 83, 73, 79, 83, 128, 82, 73, 69, 85, 76, 45, 80, 
-    73, 69, 85, 80, 45, 84, 73, 75, 69, 85, 84, 128, 82, 73, 69, 85, 76, 45, 
-    80, 73, 69, 85, 80, 45, 83, 73, 79, 83, 128, 82, 73, 69, 85, 76, 45, 80, 
-    73, 69, 85, 80, 45, 80, 72, 73, 69, 85, 80, 72, 128, 82, 73, 69, 85, 76, 
-    45, 80, 73, 69, 85, 80, 45, 72, 73, 69, 85, 72, 128, 82, 73, 69, 85, 76, 
-    45, 80, 73, 69, 85, 80, 128, 82, 73, 69, 85, 76, 45, 80, 72, 73, 69, 85, 
-    80, 72, 128, 82, 73, 69, 85, 76, 45, 80, 65, 78, 83, 73, 79, 83, 128, 82, 
-    73, 69, 85, 76, 45, 78, 73, 69, 85, 78, 128, 82, 73, 69, 85, 76, 45, 77, 
-    73, 69, 85, 77, 45, 83, 73, 79, 83, 128, 82, 73, 69, 85, 76, 45, 77, 73, 
-    69, 85, 77, 45, 75, 73, 89, 69, 79, 75, 128, 82, 73, 69, 85, 76, 45, 77, 
-    73, 69, 85, 77, 45, 72, 73, 69, 85, 72, 128, 82, 73, 69, 85, 76, 45, 77, 
-    73, 69, 85, 77, 128, 82, 73, 69, 85, 76, 45, 75, 73, 89, 69, 79, 75, 45, 
-    83, 73, 79, 83, 128, 82, 73, 69, 85, 76, 45, 75, 73, 89, 69, 79, 75, 45, 
-    72, 73, 69, 85, 72, 128, 82, 73, 69, 85, 76, 45, 75, 73, 89, 69, 79, 75, 
-    128, 82, 73, 69, 85, 76, 45, 75, 65, 80, 89, 69, 79, 85, 78, 80, 73, 69, 
-    85, 80, 128, 82, 73, 69, 85, 76, 45, 72, 73, 69, 85, 72, 128, 82, 73, 69, 
-    85, 76, 45, 67, 73, 69, 85, 67, 128, 82, 73, 69, 85, 204, 82, 73, 69, 76, 
-    128, 82, 73, 69, 69, 128, 82, 73, 67, 69, 77, 128, 82, 73, 67, 69, 128, 
-    82, 73, 67, 197, 82, 73, 66, 66, 79, 78, 128, 82, 73, 65, 204, 82, 72, 
-    79, 84, 73, 195, 82, 72, 79, 128, 82, 72, 207, 82, 72, 65, 128, 82, 71, 
-    89, 73, 78, 71, 83, 128, 82, 71, 89, 65, 78, 128, 82, 71, 89, 193, 82, 
-    69, 86, 79, 76, 86, 73, 78, 199, 82, 69, 86, 79, 76, 85, 84, 73, 79, 78, 
-    128, 82, 69, 86, 77, 65, 128, 82, 69, 86, 73, 65, 128, 82, 69, 86, 69, 
-    82, 83, 69, 68, 128, 82, 69, 86, 69, 82, 83, 69, 196, 82, 69, 86, 69, 82, 
-    83, 197, 82, 69, 85, 88, 128, 82, 69, 85, 128, 82, 69, 84, 85, 82, 78, 
-    128, 82, 69, 84, 85, 82, 206, 82, 69, 84, 82, 79, 70, 76, 69, 216, 82, 
-    69, 84, 82, 69, 65, 84, 128, 82, 69, 84, 79, 82, 84, 128, 82, 69, 83, 85, 
-    80, 73, 78, 85, 83, 128, 82, 69, 83, 84, 82, 79, 79, 77, 128, 82, 69, 83, 
-    84, 82, 73, 67, 84, 69, 196, 82, 69, 83, 84, 128, 82, 69, 83, 80, 79, 78, 
-    83, 69, 128, 82, 69, 83, 79, 85, 82, 67, 69, 128, 82, 69, 83, 79, 76, 85, 
-    84, 73, 79, 78, 128, 82, 69, 83, 73, 83, 84, 65, 78, 67, 69, 128, 82, 69, 
-    83, 73, 68, 69, 78, 67, 69, 128, 82, 69, 83, 200, 82, 69, 82, 69, 78, 71, 
-    71, 65, 78, 128, 82, 69, 82, 69, 75, 65, 78, 128, 82, 69, 80, 82, 69, 83, 
-    69, 78, 84, 128, 82, 69, 80, 76, 65, 67, 69, 77, 69, 78, 212, 82, 69, 80, 
-    72, 128, 82, 69, 80, 69, 84, 73, 84, 73, 79, 206, 82, 69, 80, 69, 65, 84, 
-    69, 196, 82, 69, 80, 69, 65, 84, 128, 82, 69, 80, 69, 65, 212, 82, 69, 
-    80, 65, 89, 65, 128, 82, 69, 80, 65, 128, 82, 69, 80, 193, 82, 69, 78, 
-    84, 79, 71, 69, 78, 128, 82, 69, 78, 128, 82, 69, 206, 82, 69, 77, 85, 
-    128, 82, 69, 77, 69, 68, 89, 128, 82, 69, 76, 73, 71, 73, 79, 78, 128, 
-    82, 69, 76, 73, 69, 86, 69, 196, 82, 69, 76, 69, 65, 83, 69, 128, 82, 69, 
-    76, 65, 84, 73, 79, 78, 65, 204, 82, 69, 76, 65, 84, 73, 79, 78, 128, 82, 
-    69, 76, 65, 65, 128, 82, 69, 74, 65, 78, 199, 82, 69, 73, 196, 82, 69, 
-    71, 85, 76, 85, 83, 45, 52, 128, 82, 69, 71, 85, 76, 85, 83, 45, 51, 128, 
-    82, 69, 71, 85, 76, 85, 83, 45, 50, 128, 82, 69, 71, 85, 76, 85, 83, 128, 
-    82, 69, 71, 85, 76, 85, 211, 82, 69, 71, 73, 83, 84, 69, 82, 69, 196, 82, 
-    69, 71, 73, 79, 78, 65, 204, 82, 69, 71, 73, 65, 45, 50, 128, 82, 69, 71, 
-    73, 65, 128, 82, 69, 70, 79, 82, 77, 69, 196, 82, 69, 70, 69, 82, 69, 78, 
-    67, 197, 82, 69, 68, 85, 80, 76, 73, 67, 65, 84, 73, 79, 78, 128, 82, 69, 
-    67, 89, 67, 76, 73, 78, 199, 82, 69, 67, 89, 67, 76, 69, 196, 82, 69, 67, 
-    84, 73, 76, 73, 78, 69, 65, 210, 82, 69, 67, 84, 65, 78, 71, 85, 76, 65, 
-    210, 82, 69, 67, 84, 65, 78, 71, 76, 69, 128, 82, 69, 67, 84, 65, 78, 71, 
-    76, 197, 82, 69, 67, 82, 69, 65, 84, 73, 79, 78, 65, 204, 82, 69, 67, 79, 
-    82, 68, 73, 78, 199, 82, 69, 67, 79, 82, 68, 69, 82, 128, 82, 69, 67, 79, 
-    82, 196, 82, 69, 67, 69, 80, 84, 73, 86, 197, 82, 69, 67, 69, 73, 86, 69, 
-    82, 128, 82, 69, 65, 76, 71, 65, 82, 45, 50, 128, 82, 69, 65, 76, 71, 65, 
-    82, 128, 82, 69, 65, 72, 77, 85, 75, 128, 82, 69, 65, 67, 72, 128, 82, 
-    68, 207, 82, 68, 69, 204, 82, 66, 65, 83, 193, 82, 65, 89, 83, 128, 82, 
-    65, 89, 65, 78, 78, 65, 128, 82, 65, 84, 73, 79, 128, 82, 65, 84, 72, 65, 
-    128, 82, 65, 84, 72, 193, 82, 65, 84, 65, 128, 82, 65, 84, 128, 82, 65, 
-    83, 87, 65, 68, 73, 128, 82, 65, 83, 79, 85, 204, 82, 65, 83, 72, 65, 
-    128, 82, 65, 81, 128, 82, 65, 80, 73, 83, 77, 65, 128, 82, 65, 78, 71, 
-    197, 82, 65, 78, 65, 128, 82, 65, 78, 128, 82, 65, 77, 211, 82, 65, 77, 
-    66, 65, 84, 128, 82, 65, 75, 72, 65, 78, 71, 128, 82, 65, 75, 65, 65, 82, 
-    65, 65, 78, 83, 65, 89, 65, 128, 82, 65, 73, 83, 73, 78, 199, 82, 65, 73, 
-    83, 69, 196, 82, 65, 73, 78, 66, 79, 87, 128, 82, 65, 73, 76, 87, 65, 89, 
-    128, 82, 65, 73, 76, 87, 65, 217, 82, 65, 73, 76, 128, 82, 65, 73, 68, 
-    207, 82, 65, 73, 68, 65, 128, 82, 65, 72, 77, 65, 84, 85, 76, 76, 65, 
-    200, 82, 65, 72, 128, 82, 65, 70, 69, 128, 82, 65, 69, 77, 128, 82, 65, 
-    68, 73, 79, 65, 67, 84, 73, 86, 197, 82, 65, 68, 73, 79, 128, 82, 65, 68, 
-    73, 207, 82, 65, 68, 201, 82, 65, 68, 128, 82, 65, 196, 82, 65, 67, 81, 
-    85, 69, 212, 82, 65, 67, 73, 78, 71, 128, 82, 65, 66, 66, 73, 84, 128, 
-    82, 65, 66, 66, 73, 212, 82, 65, 66, 128, 82, 65, 65, 73, 128, 82, 65, 
-    51, 128, 82, 65, 50, 128, 82, 65, 45, 50, 128, 82, 48, 50, 57, 128, 82, 
-    48, 50, 56, 128, 82, 48, 50, 55, 128, 82, 48, 50, 54, 128, 82, 48, 50, 
-    53, 128, 82, 48, 50, 52, 128, 82, 48, 50, 51, 128, 82, 48, 50, 50, 128, 
-    82, 48, 50, 49, 128, 82, 48, 50, 48, 128, 82, 48, 49, 57, 128, 82, 48, 
-    49, 56, 128, 82, 48, 49, 55, 128, 82, 48, 49, 54, 65, 128, 82, 48, 49, 
-    54, 128, 82, 48, 49, 53, 128, 82, 48, 49, 52, 128, 82, 48, 49, 51, 128, 
-    82, 48, 49, 50, 128, 82, 48, 49, 49, 128, 82, 48, 49, 48, 65, 128, 82, 
-    48, 49, 48, 128, 82, 48, 48, 57, 128, 82, 48, 48, 56, 128, 82, 48, 48, 
-    55, 128, 82, 48, 48, 54, 128, 82, 48, 48, 53, 128, 82, 48, 48, 52, 128, 
-    82, 48, 48, 51, 66, 128, 82, 48, 48, 51, 65, 128, 82, 48, 48, 51, 128, 
-    82, 48, 48, 50, 65, 128, 82, 48, 48, 50, 128, 82, 48, 48, 49, 128, 82, 
-    45, 67, 82, 69, 197, 81, 89, 88, 128, 81, 89, 85, 128, 81, 89, 84, 128, 
-    81, 89, 82, 88, 128, 81, 89, 82, 128, 81, 89, 80, 128, 81, 89, 79, 128, 
-    81, 89, 73, 128, 81, 89, 69, 69, 128, 81, 89, 69, 128, 81, 89, 65, 65, 
-    128, 81, 89, 65, 128, 81, 89, 128, 81, 87, 73, 128, 81, 87, 69, 69, 128, 
-    81, 87, 69, 128, 81, 87, 65, 65, 128, 81, 87, 65, 128, 81, 85, 88, 128, 
-    81, 85, 86, 128, 81, 85, 85, 86, 128, 81, 85, 85, 128, 81, 85, 84, 128, 
-    81, 85, 83, 72, 83, 72, 65, 89, 65, 128, 81, 85, 82, 88, 128, 81, 85, 82, 
-    128, 81, 85, 80, 128, 81, 85, 79, 88, 128, 81, 85, 79, 84, 197, 81, 85, 
-    79, 84, 65, 84, 73, 79, 206, 81, 85, 79, 84, 128, 81, 85, 79, 80, 128, 
-    81, 85, 79, 128, 81, 85, 75, 128, 81, 85, 73, 78, 84, 69, 83, 83, 69, 78, 
-    67, 69, 128, 81, 85, 73, 78, 68, 73, 67, 69, 83, 73, 77, 193, 81, 85, 73, 
-    78, 67, 85, 78, 88, 128, 81, 85, 73, 78, 65, 82, 73, 85, 211, 81, 85, 73, 
-    76, 76, 128, 81, 85, 73, 67, 203, 81, 85, 73, 128, 81, 85, 70, 128, 81, 
-    85, 69, 83, 84, 73, 79, 78, 69, 196, 81, 85, 69, 83, 84, 73, 79, 78, 128, 
-    81, 85, 69, 83, 84, 73, 79, 206, 81, 85, 69, 69, 78, 128, 81, 85, 69, 69, 
-    206, 81, 85, 69, 128, 81, 85, 66, 85, 84, 83, 128, 81, 85, 65, 84, 69, 
-    82, 78, 73, 79, 206, 81, 85, 65, 82, 84, 69, 82, 83, 128, 81, 85, 65, 82, 
-    84, 69, 82, 211, 81, 85, 65, 82, 84, 69, 82, 128, 81, 85, 65, 82, 84, 69, 
-    210, 81, 85, 65, 78, 84, 73, 84, 217, 81, 85, 65, 68, 82, 85, 80, 76, 
-    197, 81, 85, 65, 68, 82, 65, 78, 84, 128, 81, 85, 65, 68, 82, 65, 78, 
-    212, 81, 85, 65, 68, 128, 81, 85, 65, 196, 81, 85, 65, 128, 81, 85, 128, 
-    81, 208, 81, 79, 88, 128, 81, 79, 84, 128, 81, 79, 80, 72, 128, 81, 79, 
-    80, 65, 128, 81, 79, 80, 128, 81, 79, 79, 128, 81, 79, 207, 81, 79, 70, 
-    128, 81, 79, 198, 81, 79, 65, 128, 81, 79, 128, 81, 78, 128, 81, 73, 88, 
-    128, 81, 73, 84, 83, 65, 128, 81, 73, 84, 128, 81, 73, 80, 128, 81, 73, 
-    73, 128, 81, 73, 69, 88, 128, 81, 73, 69, 84, 128, 81, 73, 69, 80, 128, 
-    81, 73, 69, 128, 81, 73, 128, 81, 72, 87, 73, 128, 81, 72, 87, 69, 69, 
-    128, 81, 72, 87, 69, 128, 81, 72, 87, 65, 65, 128, 81, 72, 87, 65, 128, 
-    81, 72, 85, 128, 81, 72, 79, 128, 81, 72, 73, 128, 81, 72, 69, 69, 128, 
-    81, 72, 69, 128, 81, 72, 65, 65, 128, 81, 72, 65, 128, 81, 71, 65, 128, 
-    81, 69, 84, 65, 78, 65, 128, 81, 69, 69, 128, 81, 69, 128, 81, 65, 85, 
-    128, 81, 65, 84, 65, 78, 128, 81, 65, 82, 78, 69, 217, 81, 65, 82, 128, 
-    81, 65, 81, 128, 81, 65, 80, 72, 128, 81, 65, 77, 65, 84, 83, 128, 81, 
-    65, 77, 65, 84, 211, 81, 65, 76, 193, 81, 65, 73, 82, 84, 72, 82, 65, 
-    128, 81, 65, 73, 128, 81, 65, 70, 128, 81, 65, 198, 81, 65, 68, 77, 65, 
-    128, 81, 65, 65, 73, 128, 81, 65, 65, 70, 85, 128, 81, 65, 65, 70, 128, 
-    81, 48, 48, 55, 128, 81, 48, 48, 54, 128, 81, 48, 48, 53, 128, 81, 48, 
-    48, 52, 128, 81, 48, 48, 51, 128, 81, 48, 48, 50, 128, 81, 48, 48, 49, 
-    128, 80, 90, 128, 80, 89, 88, 128, 80, 89, 84, 128, 80, 89, 82, 88, 128, 
-    80, 89, 82, 128, 80, 89, 80, 128, 80, 89, 128, 80, 87, 79, 89, 128, 80, 
-    87, 79, 79, 128, 80, 87, 79, 128, 80, 87, 207, 80, 87, 73, 73, 128, 80, 
-    87, 73, 128, 80, 87, 69, 69, 128, 80, 87, 69, 128, 80, 87, 65, 65, 128, 
-    80, 87, 128, 80, 86, 128, 80, 85, 88, 128, 80, 85, 85, 84, 128, 80, 85, 
-    85, 128, 80, 85, 84, 82, 69, 70, 65, 67, 84, 73, 79, 78, 128, 80, 85, 84, 
-    128, 80, 85, 212, 80, 85, 83, 72, 80, 73, 78, 128, 80, 85, 83, 72, 80, 
-    73, 75, 65, 128, 80, 85, 83, 72, 73, 78, 199, 80, 85, 82, 88, 128, 80, 
-    85, 82, 83, 69, 128, 80, 85, 82, 80, 76, 197, 80, 85, 82, 78, 65, 77, 65, 
-    128, 80, 85, 82, 73, 84, 89, 128, 80, 85, 82, 73, 70, 89, 128, 80, 85, 
-    82, 128, 80, 85, 81, 128, 80, 85, 80, 128, 80, 85, 79, 88, 128, 80, 85, 
-    79, 80, 128, 80, 85, 79, 128, 80, 85, 78, 71, 65, 65, 77, 128, 80, 85, 
-    78, 71, 128, 80, 85, 78, 67, 84, 85, 65, 84, 73, 79, 78, 128, 80, 85, 78, 
-    67, 84, 85, 65, 84, 73, 79, 206, 80, 85, 77, 80, 128, 80, 85, 77, 128, 
-    80, 85, 69, 128, 80, 85, 66, 76, 73, 195, 80, 85, 65, 81, 128, 80, 85, 
-    65, 69, 128, 80, 85, 50, 128, 80, 85, 49, 128, 80, 85, 128, 80, 84, 72, 
-    65, 72, 193, 80, 84, 69, 128, 80, 83, 73, 76, 201, 80, 83, 73, 70, 73, 
-    83, 84, 79, 83, 89, 78, 65, 71, 77, 65, 128, 80, 83, 73, 70, 73, 83, 84, 
-    79, 80, 65, 82, 65, 75, 65, 76, 69, 83, 77, 65, 128, 80, 83, 73, 70, 73, 
-    83, 84, 79, 206, 80, 83, 73, 70, 73, 83, 84, 79, 76, 89, 71, 73, 83, 77, 
-    65, 128, 80, 83, 73, 128, 80, 83, 128, 80, 82, 79, 86, 69, 128, 80, 82, 
-    79, 84, 79, 86, 65, 82, 89, 211, 80, 82, 79, 84, 79, 211, 80, 82, 79, 84, 
-    69, 67, 84, 69, 196, 80, 82, 79, 83, 71, 69, 71, 82, 65, 77, 77, 69, 78, 
-    73, 128, 80, 82, 79, 80, 79, 82, 84, 73, 79, 78, 65, 204, 80, 82, 79, 80, 
-    79, 82, 84, 73, 79, 78, 128, 80, 82, 79, 80, 69, 82, 84, 217, 80, 82, 79, 
-    80, 69, 76, 76, 69, 210, 80, 82, 79, 79, 70, 128, 80, 82, 79, 76, 79, 78, 
-    71, 69, 196, 80, 82, 79, 76, 65, 84, 73, 79, 78, 197, 80, 82, 79, 74, 69, 
-    67, 84, 73, 86, 69, 128, 80, 82, 79, 74, 69, 67, 84, 73, 79, 78, 128, 80, 
-    82, 79, 71, 82, 69, 83, 83, 128, 80, 82, 79, 71, 82, 65, 205, 80, 82, 79, 
-    70, 79, 85, 78, 68, 128, 80, 82, 79, 68, 85, 67, 84, 128, 80, 82, 79, 68, 
-    85, 67, 212, 80, 82, 73, 86, 65, 84, 69, 128, 80, 82, 73, 86, 65, 84, 
-    197, 80, 82, 73, 86, 65, 67, 217, 80, 82, 73, 83, 72, 84, 72, 65, 77, 65, 
-    84, 82, 193, 80, 82, 73, 78, 84, 83, 128, 80, 82, 73, 78, 84, 128, 80, 
-    82, 73, 78, 212, 80, 82, 73, 78, 67, 69, 83, 83, 128, 80, 82, 73, 77, 69, 
-    128, 80, 82, 73, 77, 197, 80, 82, 69, 86, 73, 79, 85, 211, 80, 82, 69, 
-    83, 69, 84, 128, 80, 82, 69, 83, 69, 78, 84, 65, 84, 73, 79, 206, 80, 82, 
-    69, 83, 67, 82, 73, 80, 84, 73, 79, 206, 80, 82, 69, 80, 79, 78, 68, 69, 
-    82, 65, 78, 67, 69, 128, 80, 82, 69, 78, 75, 72, 65, 128, 80, 82, 69, 70, 
-    65, 67, 197, 80, 82, 69, 67, 73, 80, 73, 84, 65, 84, 69, 128, 80, 82, 69, 
-    67, 69, 68, 73, 78, 199, 80, 82, 69, 67, 69, 68, 69, 83, 128, 80, 82, 69, 
-    67, 69, 68, 69, 211, 80, 82, 69, 67, 69, 68, 69, 196, 80, 82, 69, 67, 69, 
-    68, 69, 128, 80, 82, 69, 67, 69, 68, 197, 80, 82, 65, 77, 45, 80, 73, 73, 
-    128, 80, 82, 65, 77, 45, 80, 73, 201, 80, 82, 65, 77, 45, 77, 85, 79, 89, 
-    128, 80, 82, 65, 77, 45, 77, 85, 79, 217, 80, 82, 65, 77, 45, 66, 85, 79, 
-    78, 128, 80, 82, 65, 77, 45, 66, 85, 79, 206, 80, 82, 65, 77, 45, 66, 69, 
-    73, 128, 80, 82, 65, 77, 45, 66, 69, 201, 80, 82, 65, 77, 128, 80, 82, 
-    65, 205, 80, 82, 128, 80, 80, 86, 128, 80, 80, 77, 128, 80, 80, 65, 128, 
-    80, 79, 89, 128, 80, 79, 88, 128, 80, 79, 87, 69, 82, 211, 80, 79, 87, 
-    69, 82, 128, 80, 79, 87, 68, 69, 82, 69, 196, 80, 79, 87, 68, 69, 82, 
-    128, 80, 79, 85, 78, 196, 80, 79, 85, 76, 84, 82, 217, 80, 79, 85, 67, 
-    72, 128, 80, 79, 84, 65, 84, 79, 128, 80, 79, 84, 65, 66, 76, 197, 80, 
-    79, 212, 80, 79, 83, 84, 80, 79, 83, 73, 84, 73, 79, 206, 80, 79, 83, 84, 
-    66, 79, 88, 128, 80, 79, 83, 84, 65, 204, 80, 79, 83, 84, 128, 80, 79, 
-    83, 212, 80, 79, 83, 83, 69, 83, 83, 73, 79, 78, 128, 80, 79, 82, 82, 69, 
-    67, 84, 85, 83, 128, 80, 79, 82, 82, 69, 67, 84, 85, 211, 80, 79, 80, 80, 
-    69, 82, 128, 80, 79, 80, 128, 80, 79, 208, 80, 79, 79, 68, 76, 69, 128, 
-    80, 79, 79, 128, 80, 79, 78, 68, 79, 128, 80, 79, 206, 80, 79, 77, 77, 
-    69, 69, 128, 80, 79, 77, 77, 69, 197, 80, 79, 76, 73, 83, 72, 128, 80, 
-    79, 76, 73, 67, 197, 80, 79, 76, 201, 80, 79, 76, 69, 128, 80, 79, 76, 
-    197, 80, 79, 75, 82, 89, 84, 73, 69, 128, 80, 79, 75, 79, 74, 73, 128, 
-    80, 79, 73, 78, 84, 211, 80, 79, 73, 78, 84, 79, 128, 80, 79, 73, 78, 84, 
-    69, 82, 128, 80, 79, 73, 78, 84, 69, 196, 80, 79, 73, 78, 84, 128, 80, 
-    79, 73, 78, 212, 80, 79, 69, 84, 82, 217, 80, 79, 69, 84, 73, 195, 80, 
-    79, 68, 65, 84, 85, 83, 128, 80, 79, 65, 128, 80, 79, 128, 80, 207, 80, 
-    78, 69, 85, 77, 65, 84, 65, 128, 80, 76, 85, 84, 79, 128, 80, 76, 85, 83, 
-    45, 77, 73, 78, 85, 211, 80, 76, 85, 83, 128, 80, 76, 85, 82, 65, 76, 
-    128, 80, 76, 85, 77, 69, 196, 80, 76, 85, 77, 128, 80, 76, 85, 75, 128, 
-    80, 76, 85, 71, 128, 80, 76, 85, 128, 80, 76, 79, 87, 128, 80, 76, 79, 
-    80, 72, 85, 128, 80, 76, 69, 84, 72, 82, 79, 78, 128, 80, 76, 68, 128, 
-    80, 76, 65, 89, 73, 78, 199, 80, 76, 65, 83, 84, 73, 67, 83, 128, 80, 76, 
-    65, 78, 69, 128, 80, 76, 65, 78, 197, 80, 76, 65, 78, 67, 203, 80, 76, 
-    65, 75, 128, 80, 76, 65, 71, 73, 79, 211, 80, 76, 65, 67, 69, 72, 79, 76, 
-    68, 69, 210, 80, 76, 65, 67, 197, 80, 76, 65, 128, 80, 73, 90, 90, 73, 
-    67, 65, 84, 79, 128, 80, 73, 90, 90, 65, 128, 80, 73, 88, 128, 80, 73, 
-    87, 82, 128, 80, 73, 84, 67, 72, 70, 79, 82, 75, 128, 80, 73, 84, 67, 72, 
-    70, 79, 82, 203, 80, 73, 84, 128, 80, 73, 83, 84, 79, 76, 128, 80, 73, 
-    83, 69, 76, 69, 72, 128, 80, 73, 83, 67, 69, 83, 128, 80, 73, 82, 73, 71, 
-    128, 80, 73, 82, 73, 199, 80, 73, 82, 73, 69, 69, 78, 128, 80, 73, 80, 
-    73, 78, 71, 128, 80, 73, 80, 65, 69, 77, 71, 66, 73, 69, 69, 128, 80, 73, 
-    80, 65, 69, 77, 66, 65, 128, 80, 73, 80, 128, 80, 73, 78, 87, 72, 69, 69, 
-    204, 80, 73, 78, 69, 65, 80, 80, 76, 69, 128, 80, 73, 78, 197, 80, 73, 
-    78, 65, 82, 66, 79, 82, 65, 83, 128, 80, 73, 76, 76, 128, 80, 73, 76, 
-    197, 80, 73, 76, 67, 82, 79, 215, 80, 73, 75, 85, 82, 85, 128, 80, 73, 
-    75, 79, 128, 80, 73, 71, 128, 80, 73, 199, 80, 73, 69, 88, 128, 80, 73, 
-    69, 85, 80, 45, 84, 72, 73, 69, 85, 84, 72, 128, 80, 73, 69, 85, 80, 45, 
-    83, 83, 65, 78, 71, 83, 73, 79, 83, 128, 80, 73, 69, 85, 80, 45, 83, 73, 
-    79, 83, 45, 84, 73, 75, 69, 85, 84, 128, 80, 73, 69, 85, 80, 45, 83, 73, 
-    79, 83, 45, 84, 72, 73, 69, 85, 84, 72, 128, 80, 73, 69, 85, 80, 45, 83, 
-    73, 79, 83, 45, 80, 73, 69, 85, 80, 128, 80, 73, 69, 85, 80, 45, 83, 73, 
-    79, 83, 45, 75, 73, 89, 69, 79, 75, 128, 80, 73, 69, 85, 80, 45, 83, 73, 
-    79, 83, 45, 67, 73, 69, 85, 67, 128, 80, 73, 69, 85, 80, 45, 82, 73, 69, 
-    85, 76, 45, 80, 72, 73, 69, 85, 80, 72, 128, 80, 73, 69, 85, 80, 45, 82, 
-    73, 69, 85, 76, 128, 80, 73, 69, 85, 80, 45, 78, 73, 69, 85, 78, 128, 80, 
-    73, 69, 85, 80, 45, 77, 73, 69, 85, 77, 128, 80, 73, 69, 85, 80, 45, 75, 
-    72, 73, 69, 85, 75, 72, 128, 80, 73, 69, 85, 80, 45, 67, 73, 69, 85, 67, 
-    128, 80, 73, 69, 85, 80, 45, 67, 72, 73, 69, 85, 67, 72, 128, 80, 73, 69, 
-    85, 208, 80, 73, 69, 84, 128, 80, 73, 69, 80, 128, 80, 73, 69, 69, 84, 
-    128, 80, 73, 69, 69, 81, 128, 80, 73, 69, 67, 69, 128, 80, 73, 69, 128, 
-    80, 73, 67, 75, 69, 84, 128, 80, 73, 67, 75, 128, 80, 73, 65, 83, 85, 84, 
-    79, 82, 85, 128, 80, 73, 65, 83, 77, 193, 80, 73, 65, 78, 79, 128, 80, 
-    201, 80, 72, 87, 65, 128, 80, 72, 85, 84, 72, 65, 79, 128, 80, 72, 85, 
-    210, 80, 72, 85, 78, 71, 128, 80, 72, 82, 65, 83, 69, 128, 80, 72, 79, 
-    78, 69, 83, 128, 80, 72, 79, 69, 78, 73, 67, 73, 65, 206, 80, 72, 79, 65, 
-    128, 80, 72, 79, 128, 80, 72, 207, 80, 72, 78, 65, 69, 203, 80, 72, 73, 
-    78, 84, 72, 85, 128, 80, 72, 73, 76, 79, 83, 79, 80, 72, 69, 82, 211, 80, 
-    72, 73, 76, 73, 80, 80, 73, 78, 197, 80, 72, 73, 69, 85, 80, 72, 45, 84, 
-    72, 73, 69, 85, 84, 72, 128, 80, 72, 73, 69, 85, 80, 72, 45, 83, 73, 79, 
-    83, 128, 80, 72, 73, 69, 85, 80, 72, 45, 80, 73, 69, 85, 80, 128, 80, 72, 
-    73, 69, 85, 80, 72, 45, 72, 73, 69, 85, 72, 128, 80, 72, 73, 69, 85, 80, 
-    200, 80, 72, 73, 128, 80, 72, 201, 80, 72, 69, 69, 128, 80, 72, 69, 128, 
-    80, 72, 65, 83, 69, 45, 198, 80, 72, 65, 83, 69, 45, 194, 80, 72, 65, 82, 
-    89, 78, 71, 69, 65, 204, 80, 72, 65, 82, 128, 80, 72, 65, 78, 128, 80, 
-    72, 65, 77, 128, 80, 72, 65, 73, 83, 84, 79, 211, 80, 72, 65, 71, 83, 45, 
-    80, 193, 80, 72, 65, 65, 82, 75, 65, 65, 128, 80, 72, 65, 65, 128, 80, 
-    72, 65, 128, 80, 71, 128, 80, 70, 128, 80, 69, 85, 88, 128, 80, 69, 85, 
-    84, 65, 69, 128, 80, 69, 85, 84, 128, 80, 69, 84, 65, 83, 84, 79, 75, 79, 
-    85, 70, 73, 83, 77, 65, 128, 80, 69, 84, 65, 83, 84, 73, 128, 80, 69, 84, 
-    65, 83, 77, 65, 128, 80, 69, 84, 65, 76, 76, 69, 196, 80, 69, 83, 79, 
-    128, 80, 69, 83, 207, 80, 69, 83, 72, 50, 128, 80, 69, 83, 69, 84, 193, 
-    80, 69, 211, 80, 69, 82, 84, 72, 207, 80, 69, 82, 83, 80, 69, 67, 84, 73, 
-    86, 69, 128, 80, 69, 82, 83, 79, 78, 65, 204, 80, 69, 82, 83, 79, 78, 
-    128, 80, 69, 82, 83, 79, 206, 80, 69, 82, 83, 73, 65, 206, 80, 69, 82, 
-    83, 69, 86, 69, 82, 73, 78, 199, 80, 69, 82, 80, 69, 78, 68, 73, 67, 85, 
-    76, 65, 82, 128, 80, 69, 82, 80, 69, 78, 68, 73, 67, 85, 76, 65, 210, 80, 
-    69, 82, 77, 73, 84, 84, 69, 196, 80, 69, 82, 77, 65, 78, 69, 78, 212, 80, 
-    69, 82, 73, 83, 80, 79, 77, 69, 78, 73, 128, 80, 69, 82, 73, 83, 80, 79, 
-    77, 69, 78, 201, 80, 69, 82, 70, 79, 82, 77, 73, 78, 199, 80, 69, 82, 70, 
-    69, 67, 84, 85, 205, 80, 69, 82, 70, 69, 67, 84, 65, 128, 80, 69, 82, 70, 
-    69, 67, 84, 193, 80, 69, 82, 67, 85, 83, 83, 73, 86, 69, 128, 80, 69, 82, 
-    67, 69, 78, 212, 80, 69, 80, 69, 84, 128, 80, 69, 80, 69, 212, 80, 69, 
-    79, 82, 84, 200, 80, 69, 79, 80, 76, 69, 128, 80, 69, 78, 84, 65, 83, 69, 
-    77, 69, 128, 80, 69, 78, 84, 65, 71, 82, 65, 77, 128, 80, 69, 78, 84, 65, 
-    71, 79, 78, 128, 80, 69, 78, 83, 85, 128, 80, 69, 78, 83, 73, 86, 197, 
-    80, 69, 78, 78, 217, 80, 69, 78, 73, 72, 73, 128, 80, 69, 78, 71, 85, 73, 
-    78, 128, 80, 69, 78, 71, 75, 65, 76, 128, 80, 69, 78, 69, 84, 82, 65, 84, 
-    73, 79, 78, 128, 80, 69, 78, 67, 73, 76, 128, 80, 69, 76, 65, 83, 84, 79, 
-    78, 128, 80, 69, 76, 65, 83, 84, 79, 206, 80, 69, 73, 84, 72, 128, 80, 
-    69, 72, 69, 72, 128, 80, 69, 72, 69, 200, 80, 69, 72, 128, 80, 69, 200, 
-    80, 69, 69, 90, 73, 128, 80, 69, 69, 83, 72, 73, 128, 80, 69, 69, 80, 
-    128, 80, 69, 69, 77, 128, 80, 69, 69, 128, 80, 69, 68, 69, 83, 84, 82, 
-    73, 65, 78, 83, 128, 80, 69, 68, 69, 83, 84, 82, 73, 65, 78, 128, 80, 69, 
-    68, 69, 83, 84, 65, 76, 128, 80, 69, 68, 69, 83, 84, 65, 204, 80, 69, 68, 
-    65, 204, 80, 69, 65, 67, 72, 128, 80, 69, 65, 67, 69, 128, 80, 69, 65, 
-    67, 197, 80, 68, 70, 128, 80, 68, 128, 80, 67, 128, 80, 65, 90, 69, 82, 
-    128, 80, 65, 89, 69, 82, 79, 75, 128, 80, 65, 89, 65, 78, 78, 65, 128, 
-    80, 65, 89, 128, 80, 65, 88, 128, 80, 65, 87, 78, 128, 80, 65, 215, 80, 
-    65, 86, 73, 89, 65, 78, 73, 128, 80, 65, 85, 128, 80, 65, 84, 84, 69, 82, 
-    78, 128, 80, 65, 84, 72, 65, 77, 65, 83, 65, 84, 128, 80, 65, 84, 200, 
-    80, 65, 84, 65, 75, 128, 80, 65, 84, 65, 72, 128, 80, 65, 84, 128, 80, 
-    65, 83, 85, 81, 128, 80, 65, 83, 83, 80, 79, 82, 212, 80, 65, 83, 83, 73, 
-    86, 69, 45, 80, 85, 76, 76, 45, 85, 80, 45, 79, 85, 84, 80, 85, 212, 80, 
-    65, 83, 83, 73, 86, 69, 45, 80, 85, 76, 76, 45, 68, 79, 87, 78, 45, 79, 
-    85, 84, 80, 85, 212, 80, 65, 83, 72, 84, 65, 128, 80, 65, 83, 72, 65, 69, 
-    128, 80, 65, 83, 69, 81, 128, 80, 65, 83, 65, 78, 71, 65, 206, 80, 65, 
-    82, 85, 77, 128, 80, 65, 82, 84, 217, 80, 65, 82, 84, 78, 69, 82, 83, 72, 
-    73, 208, 80, 65, 82, 84, 73, 65, 76, 76, 89, 45, 82, 69, 67, 89, 67, 76, 
-    69, 196, 80, 65, 82, 84, 73, 65, 204, 80, 65, 82, 84, 72, 73, 65, 206, 
-    80, 65, 82, 212, 80, 65, 82, 73, 67, 72, 79, 78, 128, 80, 65, 82, 69, 83, 
-    84, 73, 71, 77, 69, 78, 79, 206, 80, 65, 82, 69, 82, 69, 78, 128, 80, 65, 
-    82, 69, 78, 84, 72, 69, 83, 73, 83, 128, 80, 65, 82, 69, 78, 84, 72, 69, 
-    83, 73, 211, 80, 65, 82, 65, 80, 72, 82, 65, 83, 197, 80, 65, 82, 65, 76, 
-    76, 69, 76, 79, 71, 82, 65, 77, 128, 80, 65, 82, 65, 76, 76, 69, 76, 128, 
-    80, 65, 82, 65, 76, 76, 69, 204, 80, 65, 82, 65, 75, 76, 73, 84, 73, 75, 
-    73, 128, 80, 65, 82, 65, 75, 76, 73, 84, 73, 75, 201, 80, 65, 82, 65, 75, 
-    65, 76, 69, 83, 77, 193, 80, 65, 82, 65, 71, 82, 65, 80, 72, 79, 83, 128, 
-    80, 65, 82, 65, 71, 82, 65, 80, 72, 128, 80, 65, 82, 65, 71, 82, 65, 80, 
-    200, 80, 65, 82, 65, 128, 80, 65, 82, 128, 80, 65, 80, 89, 82, 85, 83, 
-    128, 80, 65, 80, 69, 82, 67, 76, 73, 80, 128, 80, 65, 80, 69, 210, 80, 
-    65, 80, 128, 80, 65, 208, 80, 65, 207, 80, 65, 78, 89, 85, 75, 85, 128, 
-    80, 65, 78, 89, 73, 75, 85, 128, 80, 65, 78, 89, 69, 67, 69, 75, 128, 80, 
-    65, 78, 89, 65, 78, 71, 71, 65, 128, 80, 65, 78, 89, 65, 75, 82, 65, 128, 
-    80, 65, 78, 84, 73, 128, 80, 65, 78, 83, 73, 79, 83, 45, 80, 73, 69, 85, 
-    80, 128, 80, 65, 78, 83, 73, 79, 83, 45, 75, 65, 80, 89, 69, 79, 85, 78, 
-    80, 73, 69, 85, 80, 128, 80, 65, 78, 79, 78, 71, 79, 78, 65, 78, 128, 80, 
-    65, 78, 79, 76, 79, 78, 71, 128, 80, 65, 78, 71, 87, 73, 83, 65, 68, 128, 
-    80, 65, 78, 71, 82, 65, 78, 71, 75, 69, 80, 128, 80, 65, 78, 71, 79, 76, 
-    65, 84, 128, 80, 65, 78, 71, 76, 79, 78, 71, 128, 80, 65, 78, 71, 76, 65, 
-    89, 65, 82, 128, 80, 65, 78, 71, 75, 79, 78, 128, 80, 65, 78, 71, 75, 65, 
-    84, 128, 80, 65, 78, 71, 72, 85, 76, 85, 128, 80, 65, 78, 71, 128, 80, 
-    65, 78, 69, 85, 76, 69, 85, 78, 71, 128, 80, 65, 78, 68, 193, 80, 65, 78, 
-    65, 69, 76, 65, 69, 78, 71, 128, 80, 65, 78, 128, 80, 65, 77, 85, 78, 71, 
-    75, 65, 72, 128, 80, 65, 77, 85, 68, 80, 79, 68, 128, 80, 65, 77, 83, 72, 
-    65, 69, 128, 80, 65, 77, 80, 72, 89, 76, 73, 65, 206, 80, 65, 77, 73, 78, 
-    71, 75, 65, 76, 128, 80, 65, 77, 69, 80, 69, 84, 128, 80, 65, 77, 69, 78, 
-    69, 78, 71, 128, 80, 65, 77, 65, 68, 65, 128, 80, 65, 77, 65, 65, 69, 72, 
-    128, 80, 65, 76, 85, 84, 65, 128, 80, 65, 76, 79, 67, 72, 75, 65, 128, 
-    80, 65, 76, 205, 80, 65, 76, 76, 65, 87, 65, 128, 80, 65, 76, 76, 65, 83, 
-    128, 80, 65, 76, 69, 84, 84, 69, 128, 80, 65, 76, 65, 85, 78, 199, 80, 
-    65, 76, 65, 84, 65, 76, 73, 90, 69, 196, 80, 65, 76, 65, 84, 65, 76, 73, 
-    90, 65, 84, 73, 79, 78, 128, 80, 65, 76, 65, 84, 65, 204, 80, 65, 75, 80, 
-    65, 203, 80, 65, 73, 89, 65, 78, 78, 79, 73, 128, 80, 65, 73, 82, 84, 72, 
-    82, 65, 128, 80, 65, 73, 82, 69, 196, 80, 65, 73, 128, 80, 65, 72, 76, 
-    65, 86, 201, 80, 65, 72, 128, 80, 65, 71, 69, 82, 128, 80, 65, 71, 197, 
-    80, 65, 68, 77, 193, 80, 65, 68, 68, 73, 78, 199, 80, 65, 68, 193, 80, 
-    65, 68, 128, 80, 65, 67, 75, 73, 78, 71, 128, 80, 65, 67, 75, 65, 71, 69, 
-    128, 80, 65, 65, 84, 85, 128, 80, 65, 65, 83, 69, 78, 84, 79, 128, 80, 
-    65, 65, 82, 65, 69, 128, 80, 65, 65, 77, 128, 80, 65, 65, 73, 128, 80, 
-    65, 65, 45, 80, 73, 76, 76, 65, 128, 80, 65, 65, 128, 80, 50, 128, 80, 
-    48, 49, 49, 128, 80, 48, 49, 48, 128, 80, 48, 48, 57, 128, 80, 48, 48, 
-    56, 128, 80, 48, 48, 55, 128, 80, 48, 48, 54, 128, 80, 48, 48, 53, 128, 
-    80, 48, 48, 52, 128, 80, 48, 48, 51, 65, 128, 80, 48, 48, 51, 128, 80, 
-    48, 48, 50, 128, 80, 48, 48, 49, 65, 128, 80, 48, 48, 49, 128, 79, 89, 
-    82, 65, 78, 73, 83, 77, 193, 79, 89, 65, 78, 78, 65, 128, 79, 88, 73, 65, 
-    128, 79, 88, 73, 193, 79, 88, 69, 73, 65, 201, 79, 88, 69, 73, 193, 79, 
-    86, 69, 82, 82, 73, 68, 69, 128, 79, 86, 69, 82, 76, 79, 78, 199, 79, 86, 
-    69, 82, 76, 73, 78, 69, 128, 79, 86, 69, 82, 76, 65, 89, 128, 79, 86, 69, 
-    82, 76, 65, 80, 80, 73, 78, 199, 79, 86, 69, 82, 76, 65, 73, 68, 128, 79, 
-    86, 69, 82, 66, 65, 82, 128, 79, 86, 65, 204, 79, 86, 128, 79, 85, 84, 
-    76, 73, 78, 69, 196, 79, 85, 84, 76, 73, 78, 69, 128, 79, 85, 84, 69, 
-    210, 79, 85, 84, 66, 79, 216, 79, 85, 78, 75, 73, 193, 79, 85, 78, 67, 
-    69, 128, 79, 85, 78, 67, 197, 79, 84, 85, 128, 79, 84, 84, 65, 86, 193, 
-    79, 84, 84, 128, 79, 84, 72, 65, 76, 65, 206, 79, 84, 72, 65, 76, 128, 
-    79, 83, 77, 65, 78, 89, 193, 79, 83, 67, 128, 79, 82, 84, 72, 79, 71, 79, 
-    78, 65, 204, 79, 82, 84, 72, 79, 68, 79, 216, 79, 82, 78, 65, 84, 197, 
-    79, 82, 78, 65, 77, 69, 78, 84, 128, 79, 82, 78, 65, 77, 69, 78, 212, 79, 
-    82, 75, 72, 79, 206, 79, 82, 73, 71, 73, 78, 65, 204, 79, 82, 73, 71, 73, 
-    78, 128, 79, 82, 69, 45, 50, 128, 79, 82, 68, 73, 78, 65, 204, 79, 82, 
-    68, 69, 210, 79, 82, 67, 72, 73, 68, 128, 79, 82, 65, 78, 71, 197, 79, 
-    80, 84, 73, 79, 206, 79, 80, 84, 73, 67, 65, 204, 79, 80, 80, 82, 69, 83, 
-    83, 73, 79, 78, 128, 79, 80, 80, 79, 83, 73, 84, 73, 79, 78, 128, 79, 80, 
-    80, 79, 83, 73, 78, 199, 79, 80, 80, 79, 83, 69, 128, 79, 80, 72, 73, 85, 
-    67, 72, 85, 83, 128, 79, 80, 69, 82, 65, 84, 79, 82, 128, 79, 80, 69, 82, 
-    65, 84, 79, 210, 79, 80, 69, 82, 65, 84, 73, 78, 199, 79, 80, 69, 78, 73, 
-    78, 199, 79, 80, 69, 78, 45, 80, 128, 79, 80, 69, 78, 45, 79, 85, 84, 76, 
-    73, 78, 69, 196, 79, 80, 69, 78, 45, 72, 69, 65, 68, 69, 196, 79, 80, 69, 
-    78, 45, 67, 73, 82, 67, 85, 73, 84, 45, 79, 85, 84, 80, 85, 212, 79, 79, 
-    90, 69, 128, 79, 79, 89, 65, 78, 78, 65, 128, 79, 79, 85, 128, 79, 79, 
-    77, 85, 128, 79, 79, 69, 128, 79, 79, 66, 79, 79, 70, 73, 76, 73, 128, 
-    79, 78, 85, 128, 79, 78, 83, 85, 128, 79, 78, 78, 128, 79, 78, 75, 65, 
-    82, 128, 79, 78, 69, 83, 69, 76, 70, 128, 79, 78, 69, 45, 87, 65, 217, 
-    79, 78, 69, 45, 84, 72, 73, 82, 84, 89, 128, 79, 78, 69, 45, 76, 73, 78, 
-    197, 79, 78, 67, 79, 77, 73, 78, 199, 79, 78, 65, 80, 128, 79, 77, 73, 
-    83, 83, 73, 79, 206, 79, 77, 73, 67, 82, 79, 78, 128, 79, 77, 73, 67, 82, 
-    79, 206, 79, 77, 69, 71, 65, 128, 79, 77, 69, 71, 193, 79, 77, 65, 76, 
-    79, 78, 128, 79, 76, 73, 86, 69, 128, 79, 76, 73, 71, 79, 206, 79, 76, 
-    68, 128, 79, 75, 84, 207, 79, 75, 65, 82, 65, 128, 79, 75, 65, 82, 193, 
-    79, 74, 73, 66, 87, 65, 217, 79, 74, 69, 79, 78, 128, 79, 73, 76, 128, 
-    79, 72, 77, 128, 79, 72, 205, 79, 71, 82, 69, 128, 79, 71, 79, 78, 69, 
-    75, 128, 79, 71, 79, 78, 69, 203, 79, 71, 72, 65, 205, 79, 70, 70, 73, 
-    67, 69, 82, 128, 79, 70, 70, 73, 67, 69, 128, 79, 70, 70, 73, 67, 197, 
-    79, 70, 70, 128, 79, 69, 89, 128, 79, 69, 75, 128, 79, 68, 69, 78, 128, 
-    79, 68, 196, 79, 67, 84, 79, 80, 85, 83, 128, 79, 67, 84, 79, 66, 69, 82, 
-    128, 79, 67, 84, 69, 212, 79, 67, 210, 79, 67, 76, 79, 67, 75, 128, 79, 
-    67, 67, 76, 85, 83, 73, 79, 78, 128, 79, 66, 83, 84, 82, 85, 67, 84, 73, 
-    79, 78, 128, 79, 66, 79, 76, 211, 79, 66, 79, 204, 79, 66, 79, 70, 73, 
-    76, 73, 128, 79, 66, 76, 73, 81, 85, 197, 79, 66, 74, 69, 67, 212, 79, 
-    66, 69, 76, 85, 83, 128, 79, 66, 69, 76, 79, 83, 128, 79, 66, 128, 79, 
-    65, 89, 128, 79, 65, 75, 128, 79, 65, 66, 79, 65, 70, 73, 76, 73, 128, 
-    79, 193, 79, 48, 53, 49, 128, 79, 48, 53, 48, 66, 128, 79, 48, 53, 48, 
-    65, 128, 79, 48, 53, 48, 128, 79, 48, 52, 57, 128, 79, 48, 52, 56, 128, 
-    79, 48, 52, 55, 128, 79, 48, 52, 54, 128, 79, 48, 52, 53, 128, 79, 48, 
-    52, 52, 128, 79, 48, 52, 51, 128, 79, 48, 52, 50, 128, 79, 48, 52, 49, 
-    128, 79, 48, 52, 48, 128, 79, 48, 51, 57, 128, 79, 48, 51, 56, 128, 79, 
-    48, 51, 55, 128, 79, 48, 51, 54, 68, 128, 79, 48, 51, 54, 67, 128, 79, 
-    48, 51, 54, 66, 128, 79, 48, 51, 54, 65, 128, 79, 48, 51, 54, 128, 79, 
-    48, 51, 53, 128, 79, 48, 51, 52, 128, 79, 48, 51, 51, 65, 128, 79, 48, 
-    51, 51, 128, 79, 48, 51, 50, 128, 79, 48, 51, 49, 128, 79, 48, 51, 48, 
-    65, 128, 79, 48, 51, 48, 128, 79, 48, 50, 57, 65, 128, 79, 48, 50, 57, 
-    128, 79, 48, 50, 56, 128, 79, 48, 50, 55, 128, 79, 48, 50, 54, 128, 79, 
-    48, 50, 53, 65, 128, 79, 48, 50, 53, 128, 79, 48, 50, 52, 65, 128, 79, 
-    48, 50, 52, 128, 79, 48, 50, 51, 128, 79, 48, 50, 50, 128, 79, 48, 50, 
-    49, 128, 79, 48, 50, 48, 65, 128, 79, 48, 50, 48, 128, 79, 48, 49, 57, 
-    65, 128, 79, 48, 49, 57, 128, 79, 48, 49, 56, 128, 79, 48, 49, 55, 128, 
-    79, 48, 49, 54, 128, 79, 48, 49, 53, 128, 79, 48, 49, 52, 128, 79, 48, 
-    49, 51, 128, 79, 48, 49, 50, 128, 79, 48, 49, 49, 128, 79, 48, 49, 48, 
-    67, 128, 79, 48, 49, 48, 66, 128, 79, 48, 49, 48, 65, 128, 79, 48, 49, 
-    48, 128, 79, 48, 48, 57, 128, 79, 48, 48, 56, 128, 79, 48, 48, 55, 128, 
-    79, 48, 48, 54, 70, 128, 79, 48, 48, 54, 69, 128, 79, 48, 48, 54, 68, 
-    128, 79, 48, 48, 54, 67, 128, 79, 48, 48, 54, 66, 128, 79, 48, 48, 54, 
-    65, 128, 79, 48, 48, 54, 128, 79, 48, 48, 53, 65, 128, 79, 48, 48, 53, 
-    128, 79, 48, 48, 52, 128, 79, 48, 48, 51, 128, 79, 48, 48, 50, 128, 79, 
-    48, 48, 49, 65, 128, 79, 48, 48, 49, 128, 79, 45, 89, 69, 128, 79, 45, 
-    79, 45, 73, 128, 79, 45, 69, 128, 78, 90, 89, 88, 128, 78, 90, 89, 84, 
-    128, 78, 90, 89, 82, 88, 128, 78, 90, 89, 82, 128, 78, 90, 89, 80, 128, 
-    78, 90, 89, 128, 78, 90, 85, 88, 128, 78, 90, 85, 82, 88, 128, 78, 90, 
-    85, 82, 128, 78, 90, 85, 81, 128, 78, 90, 85, 80, 128, 78, 90, 85, 79, 
-    88, 128, 78, 90, 85, 79, 128, 78, 90, 85, 206, 78, 90, 85, 128, 78, 90, 
-    79, 88, 128, 78, 90, 79, 80, 128, 78, 90, 73, 88, 128, 78, 90, 73, 84, 
-    128, 78, 90, 73, 80, 128, 78, 90, 73, 69, 88, 128, 78, 90, 73, 69, 80, 
-    128, 78, 90, 73, 69, 128, 78, 90, 73, 128, 78, 90, 69, 88, 128, 78, 90, 
-    69, 85, 77, 128, 78, 90, 69, 128, 78, 90, 65, 88, 128, 78, 90, 65, 84, 
-    128, 78, 90, 65, 81, 128, 78, 90, 65, 80, 128, 78, 90, 65, 128, 78, 90, 
-    193, 78, 89, 87, 65, 128, 78, 89, 85, 88, 128, 78, 89, 85, 85, 128, 78, 
-    89, 85, 84, 128, 78, 89, 85, 80, 128, 78, 89, 85, 79, 88, 128, 78, 89, 
-    85, 79, 80, 128, 78, 89, 85, 79, 128, 78, 89, 85, 69, 128, 78, 89, 85, 
-    128, 78, 89, 79, 88, 128, 78, 89, 79, 84, 128, 78, 89, 79, 80, 128, 78, 
-    89, 79, 79, 128, 78, 89, 79, 65, 128, 78, 89, 79, 128, 78, 89, 74, 65, 
-    128, 78, 89, 73, 88, 128, 78, 89, 73, 84, 128, 78, 89, 73, 212, 78, 89, 
-    73, 211, 78, 89, 73, 210, 78, 89, 73, 80, 128, 78, 89, 73, 78, 45, 68, 
-    79, 128, 78, 89, 73, 73, 128, 78, 89, 73, 69, 88, 128, 78, 89, 73, 69, 
-    84, 128, 78, 89, 73, 69, 80, 128, 78, 89, 73, 69, 128, 78, 89, 73, 128, 
-    78, 89, 201, 78, 89, 72, 65, 128, 78, 89, 69, 84, 128, 78, 89, 69, 212, 
-    78, 89, 69, 72, 128, 78, 89, 69, 200, 78, 89, 69, 69, 128, 78, 89, 69, 
-    128, 78, 89, 196, 78, 89, 67, 65, 128, 78, 89, 65, 85, 128, 78, 89, 65, 
-    73, 128, 78, 89, 65, 72, 128, 78, 89, 65, 69, 77, 65, 69, 128, 78, 89, 
-    65, 65, 128, 78, 87, 79, 79, 128, 78, 87, 79, 128, 78, 87, 73, 73, 128, 
-    78, 87, 73, 128, 78, 87, 69, 128, 78, 87, 65, 65, 128, 78, 87, 65, 128, 
-    78, 87, 128, 78, 86, 128, 78, 85, 88, 128, 78, 85, 85, 78, 128, 78, 85, 
-    85, 128, 78, 85, 84, 73, 76, 76, 85, 128, 78, 85, 84, 128, 78, 85, 212, 
-    78, 85, 82, 88, 128, 78, 85, 82, 128, 78, 85, 80, 128, 78, 85, 79, 88, 
-    128, 78, 85, 79, 80, 128, 78, 85, 79, 128, 78, 85, 78, 85, 90, 128, 78, 
-    85, 78, 85, 218, 78, 85, 78, 71, 128, 78, 85, 78, 65, 86, 85, 212, 78, 
-    85, 78, 65, 86, 73, 203, 78, 85, 78, 128, 78, 85, 206, 78, 85, 77, 69, 
-    82, 207, 78, 85, 77, 69, 82, 65, 84, 79, 210, 78, 85, 77, 69, 82, 65, 
-    204, 78, 85, 77, 66, 69, 82, 83, 128, 78, 85, 77, 66, 69, 82, 128, 78, 
-    85, 77, 128, 78, 85, 76, 76, 128, 78, 85, 76, 204, 78, 85, 76, 128, 78, 
-    85, 75, 84, 65, 128, 78, 85, 69, 78, 71, 128, 78, 85, 69, 128, 78, 85, 
-    66, 73, 65, 206, 78, 85, 65, 69, 128, 78, 85, 49, 49, 128, 78, 85, 48, 
-    50, 50, 65, 128, 78, 85, 48, 50, 50, 128, 78, 85, 48, 50, 49, 128, 78, 
-    85, 48, 50, 48, 128, 78, 85, 48, 49, 57, 128, 78, 85, 48, 49, 56, 65, 
-    128, 78, 85, 48, 49, 56, 128, 78, 85, 48, 49, 55, 128, 78, 85, 48, 49, 
-    54, 128, 78, 85, 48, 49, 53, 128, 78, 85, 48, 49, 52, 128, 78, 85, 48, 
-    49, 51, 128, 78, 85, 48, 49, 50, 128, 78, 85, 48, 49, 49, 65, 128, 78, 
-    85, 48, 49, 49, 128, 78, 85, 48, 49, 48, 65, 128, 78, 85, 48, 49, 48, 
-    128, 78, 85, 48, 48, 57, 128, 78, 85, 48, 48, 56, 128, 78, 85, 48, 48, 
-    55, 128, 78, 85, 48, 48, 54, 128, 78, 85, 48, 48, 53, 128, 78, 85, 48, 
-    48, 52, 128, 78, 85, 48, 48, 51, 128, 78, 85, 48, 48, 50, 128, 78, 85, 
-    48, 48, 49, 128, 78, 84, 85, 85, 128, 78, 84, 85, 77, 128, 78, 84, 213, 
-    78, 84, 79, 81, 80, 69, 78, 128, 78, 84, 73, 69, 197, 78, 84, 69, 85, 78, 
-    71, 66, 65, 128, 78, 84, 69, 85, 77, 128, 78, 84, 69, 78, 128, 78, 84, 
-    69, 69, 128, 78, 84, 65, 80, 128, 78, 84, 65, 208, 78, 84, 65, 65, 128, 
-    78, 83, 85, 79, 212, 78, 83, 85, 78, 128, 78, 83, 85, 77, 128, 78, 83, 
-    79, 77, 128, 78, 83, 73, 69, 69, 84, 128, 78, 83, 73, 69, 69, 80, 128, 
-    78, 83, 73, 69, 69, 128, 78, 83, 72, 85, 84, 128, 78, 83, 72, 85, 212, 
-    78, 83, 72, 85, 79, 80, 128, 78, 83, 72, 85, 69, 128, 78, 83, 72, 73, 69, 
-    69, 128, 78, 83, 72, 69, 69, 128, 78, 83, 72, 65, 81, 128, 78, 83, 72, 
-    65, 128, 78, 83, 69, 85, 65, 69, 78, 128, 78, 83, 69, 78, 128, 78, 83, 
-    65, 128, 78, 82, 89, 88, 128, 78, 82, 89, 84, 128, 78, 82, 89, 82, 88, 
-    128, 78, 82, 89, 82, 128, 78, 82, 89, 80, 128, 78, 82, 89, 128, 78, 82, 
-    85, 88, 128, 78, 82, 85, 84, 128, 78, 82, 85, 82, 88, 128, 78, 82, 85, 
-    82, 128, 78, 82, 85, 80, 128, 78, 82, 85, 128, 78, 82, 79, 88, 128, 78, 
-    82, 79, 80, 128, 78, 82, 79, 128, 78, 82, 69, 88, 128, 78, 82, 69, 84, 
-    128, 78, 82, 69, 80, 128, 78, 82, 69, 128, 78, 82, 65, 88, 128, 78, 82, 
-    65, 84, 128, 78, 82, 65, 80, 128, 78, 82, 65, 128, 78, 79, 89, 128, 78, 
-    79, 88, 128, 78, 79, 86, 69, 77, 66, 69, 82, 128, 78, 79, 84, 84, 79, 
-    128, 78, 79, 84, 69, 83, 128, 78, 79, 84, 69, 72, 69, 65, 68, 128, 78, 
-    79, 84, 69, 72, 69, 65, 196, 78, 79, 84, 69, 66, 79, 79, 75, 128, 78, 79, 
-    84, 69, 66, 79, 79, 203, 78, 79, 84, 69, 128, 78, 79, 84, 197, 78, 79, 
-    84, 67, 72, 69, 196, 78, 79, 84, 67, 72, 128, 78, 79, 84, 128, 78, 79, 
-    212, 78, 79, 83, 69, 128, 78, 79, 82, 84, 72, 87, 69, 83, 212, 78, 79, 
-    82, 84, 72, 69, 82, 206, 78, 79, 82, 84, 200, 78, 79, 82, 77, 65, 204, 
-    78, 79, 210, 78, 79, 80, 128, 78, 79, 79, 78, 85, 128, 78, 79, 79, 128, 
-    78, 79, 78, 70, 79, 82, 75, 73, 78, 71, 128, 78, 79, 78, 45, 80, 79, 84, 
-    65, 66, 76, 197, 78, 79, 78, 45, 74, 79, 73, 78, 69, 82, 128, 78, 79, 78, 
-    45, 66, 82, 69, 65, 75, 73, 78, 199, 78, 79, 77, 73, 78, 65, 204, 78, 79, 
-    75, 72, 85, 75, 128, 78, 79, 68, 69, 128, 78, 79, 65, 128, 78, 79, 45, 
-    66, 82, 69, 65, 203, 78, 78, 85, 85, 128, 78, 78, 85, 128, 78, 78, 79, 
-    79, 128, 78, 78, 79, 128, 78, 78, 78, 85, 85, 128, 78, 78, 78, 85, 128, 
-    78, 78, 78, 79, 79, 128, 78, 78, 78, 79, 128, 78, 78, 78, 73, 73, 128, 
-    78, 78, 78, 73, 128, 78, 78, 78, 69, 69, 128, 78, 78, 78, 69, 128, 78, 
-    78, 78, 65, 85, 128, 78, 78, 78, 65, 73, 128, 78, 78, 78, 65, 65, 128, 
-    78, 78, 78, 65, 128, 78, 78, 78, 128, 78, 78, 72, 65, 128, 78, 78, 71, 
-    79, 79, 128, 78, 78, 71, 79, 128, 78, 78, 71, 73, 73, 128, 78, 78, 71, 
-    73, 128, 78, 78, 71, 65, 65, 128, 78, 78, 71, 65, 128, 78, 78, 71, 128, 
-    78, 78, 66, 83, 80, 128, 78, 77, 128, 78, 76, 48, 50, 48, 128, 78, 76, 
-    48, 49, 57, 128, 78, 76, 48, 49, 56, 128, 78, 76, 48, 49, 55, 65, 128, 
-    78, 76, 48, 49, 55, 128, 78, 76, 48, 49, 54, 128, 78, 76, 48, 49, 53, 
-    128, 78, 76, 48, 49, 52, 128, 78, 76, 48, 49, 51, 128, 78, 76, 48, 49, 
-    50, 128, 78, 76, 48, 49, 49, 128, 78, 76, 48, 49, 48, 128, 78, 76, 48, 
-    48, 57, 128, 78, 76, 48, 48, 56, 128, 78, 76, 48, 48, 55, 128, 78, 76, 
-    48, 48, 54, 128, 78, 76, 48, 48, 53, 65, 128, 78, 76, 48, 48, 53, 128, 
-    78, 76, 48, 48, 52, 128, 78, 76, 48, 48, 51, 128, 78, 76, 48, 48, 50, 
-    128, 78, 76, 48, 48, 49, 128, 78, 76, 128, 78, 75, 79, 77, 128, 78, 75, 
-    207, 78, 75, 73, 78, 68, 73, 128, 78, 75, 65, 65, 82, 65, 69, 128, 78, 
-    74, 89, 88, 128, 78, 74, 89, 84, 128, 78, 74, 89, 82, 88, 128, 78, 74, 
-    89, 82, 128, 78, 74, 89, 80, 128, 78, 74, 89, 128, 78, 74, 85, 88, 128, 
-    78, 74, 85, 82, 88, 128, 78, 74, 85, 82, 128, 78, 74, 85, 81, 65, 128, 
-    78, 74, 85, 80, 128, 78, 74, 85, 79, 88, 128, 78, 74, 85, 79, 128, 78, 
-    74, 85, 69, 81, 128, 78, 74, 85, 65, 69, 128, 78, 74, 85, 128, 78, 74, 
-    79, 88, 128, 78, 74, 79, 84, 128, 78, 74, 79, 80, 128, 78, 74, 79, 79, 
-    128, 78, 74, 79, 128, 78, 74, 73, 88, 128, 78, 74, 73, 84, 128, 78, 74, 
-    73, 80, 128, 78, 74, 73, 69, 88, 128, 78, 74, 73, 69, 84, 128, 78, 74, 
-    73, 69, 80, 128, 78, 74, 73, 69, 69, 128, 78, 74, 73, 69, 128, 78, 74, 
-    73, 128, 78, 74, 201, 78, 74, 69, 85, 88, 128, 78, 74, 69, 85, 84, 128, 
-    78, 74, 69, 85, 65, 69, 78, 65, 128, 78, 74, 69, 85, 65, 69, 77, 128, 78, 
-    74, 69, 69, 69, 69, 128, 78, 74, 69, 69, 128, 78, 74, 69, 197, 78, 74, 
-    69, 128, 78, 74, 65, 81, 128, 78, 74, 65, 80, 128, 78, 74, 65, 69, 77, 
-    76, 73, 128, 78, 74, 65, 69, 77, 128, 78, 74, 65, 65, 128, 78, 73, 88, 
-    128, 78, 73, 84, 82, 69, 128, 78, 73, 83, 65, 71, 128, 78, 73, 82, 85, 
-    71, 85, 128, 78, 73, 80, 128, 78, 73, 78, 84, 72, 128, 78, 73, 78, 69, 
-    84, 89, 128, 78, 73, 78, 69, 84, 217, 78, 73, 78, 69, 84, 69, 69, 78, 
-    128, 78, 73, 78, 69, 84, 69, 69, 206, 78, 73, 78, 69, 45, 84, 72, 73, 82, 
-    84, 89, 128, 78, 73, 78, 197, 78, 73, 78, 68, 65, 50, 128, 78, 73, 78, 
-    68, 65, 178, 78, 73, 77, 128, 78, 73, 205, 78, 73, 75, 72, 65, 72, 73, 
-    84, 128, 78, 73, 75, 65, 72, 73, 84, 128, 78, 73, 75, 65, 128, 78, 73, 
-    72, 83, 72, 86, 65, 83, 65, 128, 78, 73, 71, 73, 68, 65, 77, 73, 78, 128, 
-    78, 73, 71, 73, 68, 65, 69, 83, 72, 128, 78, 73, 71, 72, 84, 128, 78, 73, 
-    71, 72, 212, 78, 73, 71, 71, 65, 72, 73, 84, 65, 128, 78, 73, 69, 88, 
-    128, 78, 73, 69, 85, 78, 45, 84, 73, 75, 69, 85, 84, 128, 78, 73, 69, 85, 
-    78, 45, 84, 72, 73, 69, 85, 84, 72, 128, 78, 73, 69, 85, 78, 45, 83, 73, 
-    79, 83, 128, 78, 73, 69, 85, 78, 45, 82, 73, 69, 85, 76, 128, 78, 73, 69, 
-    85, 78, 45, 80, 73, 69, 85, 80, 128, 78, 73, 69, 85, 78, 45, 80, 65, 78, 
-    83, 73, 79, 83, 128, 78, 73, 69, 85, 78, 45, 75, 73, 89, 69, 79, 75, 128, 
-    78, 73, 69, 85, 78, 45, 72, 73, 69, 85, 72, 128, 78, 73, 69, 85, 78, 45, 
-    67, 73, 69, 85, 67, 128, 78, 73, 69, 85, 78, 45, 67, 72, 73, 69, 85, 67, 
-    72, 128, 78, 73, 69, 85, 206, 78, 73, 69, 80, 128, 78, 73, 69, 128, 78, 
-    73, 66, 128, 78, 73, 65, 128, 78, 73, 50, 128, 78, 72, 85, 69, 128, 78, 
-    72, 74, 65, 128, 78, 72, 128, 78, 71, 89, 69, 128, 78, 71, 86, 69, 128, 
-    78, 71, 85, 85, 128, 78, 71, 85, 79, 88, 128, 78, 71, 85, 79, 84, 128, 
-    78, 71, 85, 79, 128, 78, 71, 85, 65, 69, 84, 128, 78, 71, 85, 65, 69, 
-    128, 78, 71, 79, 88, 128, 78, 71, 79, 85, 128, 78, 71, 79, 213, 78, 71, 
-    79, 84, 128, 78, 71, 79, 81, 128, 78, 71, 79, 80, 128, 78, 71, 79, 78, 
-    128, 78, 71, 79, 77, 128, 78, 71, 79, 69, 72, 128, 78, 71, 79, 69, 200, 
-    78, 71, 207, 78, 71, 75, 89, 69, 69, 128, 78, 71, 75, 87, 65, 69, 78, 
-    128, 78, 71, 75, 85, 80, 128, 78, 71, 75, 85, 78, 128, 78, 71, 75, 85, 
-    77, 128, 78, 71, 75, 85, 69, 78, 90, 69, 85, 77, 128, 78, 71, 75, 85, 
-    197, 78, 71, 75, 73, 78, 68, 201, 78, 71, 75, 73, 69, 69, 128, 78, 71, 
-    75, 69, 85, 88, 128, 78, 71, 75, 69, 85, 82, 73, 128, 78, 71, 75, 69, 85, 
-    65, 69, 81, 128, 78, 71, 75, 69, 85, 65, 69, 77, 128, 78, 71, 75, 65, 81, 
-    128, 78, 71, 75, 65, 80, 128, 78, 71, 75, 65, 65, 77, 73, 128, 78, 71, 
-    75, 65, 128, 78, 71, 73, 69, 88, 128, 78, 71, 73, 69, 80, 128, 78, 71, 
-    73, 69, 128, 78, 71, 72, 65, 128, 78, 71, 71, 87, 65, 69, 78, 128, 78, 
-    71, 71, 85, 82, 65, 69, 128, 78, 71, 71, 85, 80, 128, 78, 71, 71, 85, 79, 
-    81, 128, 78, 71, 71, 85, 79, 209, 78, 71, 71, 85, 79, 78, 128, 78, 71, 
-    71, 85, 79, 77, 128, 78, 71, 71, 85, 77, 128, 78, 71, 71, 85, 69, 69, 84, 
-    128, 78, 71, 71, 85, 65, 69, 83, 72, 65, 197, 78, 71, 71, 85, 65, 69, 
-    206, 78, 71, 71, 85, 128, 78, 71, 71, 79, 79, 128, 78, 71, 71, 79, 128, 
-    78, 71, 71, 73, 128, 78, 71, 71, 69, 85, 88, 128, 78, 71, 71, 69, 85, 65, 
-    69, 84, 128, 78, 71, 71, 69, 85, 65, 69, 128, 78, 71, 71, 69, 213, 78, 
-    71, 71, 69, 78, 128, 78, 71, 71, 69, 69, 84, 128, 78, 71, 71, 69, 69, 69, 
-    69, 128, 78, 71, 71, 69, 69, 128, 78, 71, 71, 69, 128, 78, 71, 71, 65, 
-    80, 128, 78, 71, 71, 65, 65, 77, 65, 69, 128, 78, 71, 71, 65, 65, 77, 
-    128, 78, 71, 71, 128, 78, 71, 69, 88, 128, 78, 71, 69, 85, 82, 69, 85, 
-    84, 128, 78, 71, 69, 80, 128, 78, 71, 69, 78, 128, 78, 71, 69, 69, 128, 
-    78, 71, 69, 65, 68, 65, 76, 128, 78, 71, 65, 88, 128, 78, 71, 65, 85, 
-    128, 78, 71, 65, 84, 128, 78, 71, 65, 211, 78, 71, 65, 81, 128, 78, 71, 
-    65, 80, 128, 78, 71, 65, 78, 71, 85, 128, 78, 71, 65, 78, 128, 78, 71, 
-    65, 73, 128, 78, 71, 65, 72, 128, 78, 71, 65, 65, 73, 128, 78, 71, 193, 
-    78, 70, 128, 78, 69, 88, 212, 78, 69, 88, 128, 78, 69, 87, 83, 80, 65, 
-    80, 69, 82, 128, 78, 69, 87, 76, 73, 78, 69, 128, 78, 69, 87, 128, 78, 
-    69, 85, 84, 82, 65, 204, 78, 69, 85, 84, 69, 82, 128, 78, 69, 84, 128, 
-    78, 69, 212, 78, 69, 83, 84, 69, 196, 78, 69, 81, 85, 68, 65, 65, 128, 
-    78, 69, 80, 84, 85, 78, 69, 128, 78, 69, 80, 128, 78, 69, 79, 128, 78, 
-    69, 207, 78, 69, 78, 65, 78, 79, 128, 78, 69, 78, 128, 78, 69, 76, 128, 
-    78, 69, 73, 84, 72, 69, 210, 78, 69, 71, 65, 84, 73, 79, 206, 78, 69, 71, 
-    65, 84, 69, 196, 78, 69, 67, 75, 84, 73, 69, 128, 78, 69, 66, 69, 78, 83, 
-    84, 73, 77, 77, 69, 128, 78, 68, 85, 88, 128, 78, 68, 85, 84, 128, 78, 
-    68, 85, 82, 88, 128, 78, 68, 85, 82, 128, 78, 68, 85, 80, 128, 78, 68, 
-    85, 78, 128, 78, 68, 213, 78, 68, 79, 88, 128, 78, 68, 79, 84, 128, 78, 
-    68, 79, 80, 128, 78, 68, 79, 79, 128, 78, 68, 79, 78, 128, 78, 68, 79, 
-    77, 66, 85, 128, 78, 68, 79, 76, 197, 78, 68, 73, 88, 128, 78, 68, 73, 
-    84, 128, 78, 68, 73, 81, 128, 78, 68, 73, 80, 128, 78, 68, 73, 69, 88, 
-    128, 78, 68, 73, 69, 128, 78, 68, 73, 68, 65, 128, 78, 68, 73, 65, 81, 
-    128, 78, 68, 69, 88, 128, 78, 68, 69, 85, 88, 128, 78, 68, 69, 85, 84, 
-    128, 78, 68, 69, 85, 65, 69, 82, 69, 69, 128, 78, 68, 69, 80, 128, 78, 
-    68, 69, 69, 128, 78, 68, 69, 128, 78, 68, 65, 88, 128, 78, 68, 65, 84, 
-    128, 78, 68, 65, 80, 128, 78, 68, 65, 77, 128, 78, 68, 65, 65, 78, 71, 
-    71, 69, 85, 65, 69, 84, 128, 78, 68, 65, 65, 128, 78, 68, 65, 193, 78, 
-    66, 89, 88, 128, 78, 66, 89, 84, 128, 78, 66, 89, 82, 88, 128, 78, 66, 
-    89, 82, 128, 78, 66, 89, 80, 128, 78, 66, 89, 128, 78, 66, 85, 88, 128, 
-    78, 66, 85, 84, 128, 78, 66, 85, 82, 88, 128, 78, 66, 85, 82, 128, 78, 
-    66, 85, 80, 128, 78, 66, 85, 128, 78, 66, 79, 88, 128, 78, 66, 79, 84, 
-    128, 78, 66, 79, 80, 128, 78, 66, 79, 128, 78, 66, 73, 88, 128, 78, 66, 
-    73, 84, 128, 78, 66, 73, 80, 128, 78, 66, 73, 69, 88, 128, 78, 66, 73, 
-    69, 80, 128, 78, 66, 73, 69, 128, 78, 66, 73, 128, 78, 66, 72, 128, 78, 
-    66, 65, 88, 128, 78, 66, 65, 84, 128, 78, 66, 65, 80, 128, 78, 66, 65, 
-    128, 78, 65, 89, 65, 78, 78, 65, 128, 78, 65, 89, 128, 78, 65, 88, 73, 
-    65, 206, 78, 65, 88, 128, 78, 65, 85, 84, 72, 83, 128, 78, 65, 85, 68, 
-    73, 218, 78, 65, 84, 85, 82, 65, 204, 78, 65, 84, 73, 79, 78, 65, 204, 
-    78, 65, 83, 75, 65, 80, 201, 78, 65, 83, 72, 73, 128, 78, 65, 83, 65, 76, 
-    73, 90, 65, 84, 73, 79, 78, 128, 78, 65, 83, 65, 76, 73, 90, 65, 84, 73, 
-    79, 206, 78, 65, 82, 82, 79, 215, 78, 65, 82, 128, 78, 65, 81, 128, 78, 
-    65, 79, 211, 78, 65, 78, 83, 65, 78, 65, 81, 128, 78, 65, 78, 71, 77, 79, 
-    78, 84, 72, 79, 128, 78, 65, 78, 68, 128, 78, 65, 78, 65, 128, 78, 65, 
-    77, 69, 128, 78, 65, 77, 197, 78, 65, 77, 50, 128, 78, 65, 77, 128, 78, 
-    65, 75, 128, 78, 65, 73, 82, 193, 78, 65, 73, 204, 78, 65, 71, 82, 201, 
-    78, 65, 71, 65, 82, 128, 78, 65, 71, 65, 128, 78, 65, 71, 193, 78, 65, 
-    71, 128, 78, 65, 199, 78, 65, 69, 128, 78, 65, 66, 76, 65, 128, 78, 65, 
-    65, 83, 73, 75, 89, 65, 89, 65, 128, 78, 65, 65, 75, 83, 73, 75, 89, 65, 
-    89, 65, 128, 78, 65, 65, 73, 128, 78, 65, 193, 78, 65, 50, 128, 78, 65, 
-    45, 50, 128, 78, 48, 52, 50, 128, 78, 48, 52, 49, 128, 78, 48, 52, 48, 
-    128, 78, 48, 51, 57, 128, 78, 48, 51, 56, 128, 78, 48, 51, 55, 65, 128, 
-    78, 48, 51, 55, 128, 78, 48, 51, 54, 128, 78, 48, 51, 53, 65, 128, 78, 
-    48, 51, 53, 128, 78, 48, 51, 52, 65, 128, 78, 48, 51, 52, 128, 78, 48, 
-    51, 51, 65, 128, 78, 48, 51, 51, 128, 78, 48, 51, 50, 128, 78, 48, 51, 
-    49, 128, 78, 48, 51, 48, 128, 78, 48, 50, 57, 128, 78, 48, 50, 56, 128, 
-    78, 48, 50, 55, 128, 78, 48, 50, 54, 128, 78, 48, 50, 53, 65, 128, 78, 
-    48, 50, 53, 128, 78, 48, 50, 52, 128, 78, 48, 50, 51, 128, 78, 48, 50, 
-    50, 128, 78, 48, 50, 49, 128, 78, 48, 50, 48, 128, 78, 48, 49, 57, 128, 
-    78, 48, 49, 56, 66, 128, 78, 48, 49, 56, 65, 128, 78, 48, 49, 56, 128, 
-    78, 48, 49, 55, 128, 78, 48, 49, 54, 128, 78, 48, 49, 53, 128, 78, 48, 
-    49, 52, 128, 78, 48, 49, 51, 128, 78, 48, 49, 50, 128, 78, 48, 49, 49, 
-    128, 78, 48, 49, 48, 128, 78, 48, 48, 57, 128, 78, 48, 48, 56, 128, 78, 
-    48, 48, 55, 128, 78, 48, 48, 54, 128, 78, 48, 48, 53, 128, 78, 48, 48, 
-    52, 128, 78, 48, 48, 51, 128, 78, 48, 48, 50, 128, 78, 48, 48, 49, 128, 
-    78, 45, 67, 82, 69, 197, 78, 45, 65, 82, 217, 77, 89, 88, 128, 77, 89, 
-    84, 128, 77, 89, 83, 76, 73, 84, 69, 128, 77, 89, 80, 128, 77, 89, 65, 
-    128, 77, 89, 193, 77, 89, 128, 77, 217, 77, 87, 79, 79, 128, 77, 87, 79, 
-    128, 77, 87, 73, 73, 128, 77, 87, 73, 128, 77, 87, 69, 69, 128, 77, 87, 
-    69, 128, 77, 87, 65, 65, 128, 77, 87, 65, 128, 77, 87, 128, 77, 215, 77, 
-    86, 83, 128, 77, 86, 79, 80, 128, 77, 86, 73, 128, 77, 86, 69, 85, 65, 
-    69, 78, 71, 65, 77, 128, 77, 86, 128, 77, 214, 77, 85, 88, 128, 77, 85, 
-    85, 83, 73, 75, 65, 84, 79, 65, 78, 128, 77, 85, 85, 82, 68, 72, 65, 74, 
-    193, 77, 85, 85, 128, 77, 85, 84, 128, 77, 85, 83, 73, 67, 128, 77, 85, 
-    83, 73, 195, 77, 85, 83, 72, 82, 79, 79, 77, 128, 77, 85, 83, 72, 51, 
-    128, 77, 85, 83, 72, 179, 77, 85, 83, 72, 128, 77, 85, 83, 200, 77, 85, 
-    82, 88, 128, 77, 85, 82, 71, 85, 50, 128, 77, 85, 82, 69, 128, 77, 85, 
-    82, 68, 65, 128, 77, 85, 82, 68, 193, 77, 85, 82, 128, 77, 85, 81, 68, 
-    65, 77, 128, 77, 85, 80, 128, 77, 85, 79, 88, 128, 77, 85, 79, 84, 128, 
-    77, 85, 79, 80, 128, 77, 85, 79, 77, 65, 69, 128, 77, 85, 79, 128, 77, 
-    85, 78, 83, 85, 66, 128, 77, 85, 78, 65, 72, 128, 77, 85, 76, 84, 73, 83, 
-    69, 84, 128, 77, 85, 76, 84, 73, 83, 69, 212, 77, 85, 76, 84, 73, 80, 76, 
-    73, 67, 65, 84, 73, 79, 78, 128, 77, 85, 76, 84, 73, 80, 76, 73, 67, 65, 
-    84, 73, 79, 206, 77, 85, 76, 84, 73, 80, 76, 197, 77, 85, 76, 84, 73, 79, 
-    67, 85, 76, 65, 210, 77, 85, 76, 84, 73, 77, 65, 80, 128, 77, 85, 76, 84, 
-    201, 77, 85, 75, 80, 72, 82, 69, 78, 71, 128, 77, 85, 73, 78, 128, 77, 
-    85, 71, 83, 128, 77, 85, 71, 128, 77, 85, 199, 77, 85, 69, 128, 77, 85, 
-    67, 72, 128, 77, 85, 67, 200, 77, 85, 67, 65, 65, 68, 128, 77, 85, 65, 
-    78, 128, 77, 85, 65, 69, 128, 77, 85, 45, 71, 65, 65, 72, 76, 65, 193, 
-    77, 213, 77, 83, 128, 77, 80, 65, 128, 77, 79, 89, 65, 73, 128, 77, 79, 
-    88, 128, 77, 79, 86, 73, 197, 77, 79, 86, 69, 196, 77, 79, 85, 84, 72, 
-    128, 77, 79, 85, 84, 200, 77, 79, 85, 83, 69, 128, 77, 79, 85, 83, 197, 
-    77, 79, 85, 78, 84, 65, 73, 78, 83, 128, 77, 79, 85, 78, 84, 65, 73, 78, 
-    128, 77, 79, 85, 78, 84, 65, 73, 206, 77, 79, 85, 78, 212, 77, 79, 85, 
-    78, 68, 128, 77, 79, 85, 78, 196, 77, 79, 84, 72, 69, 82, 128, 77, 79, 
-    84, 128, 77, 79, 82, 84, 85, 85, 77, 128, 77, 79, 82, 84, 65, 82, 128, 
-    77, 79, 82, 80, 72, 79, 76, 79, 71, 73, 67, 65, 204, 77, 79, 82, 78, 73, 
-    78, 71, 128, 77, 79, 80, 128, 77, 79, 79, 83, 69, 45, 67, 82, 69, 197, 
-    77, 79, 79, 78, 128, 77, 79, 79, 206, 77, 79, 79, 77, 80, 85, 81, 128, 
-    77, 79, 79, 77, 69, 85, 84, 128, 77, 79, 79, 128, 77, 79, 78, 84, 73, 69, 
-    69, 78, 128, 77, 79, 78, 84, 72, 128, 77, 79, 78, 84, 200, 77, 79, 78, 
-    83, 84, 69, 82, 128, 77, 79, 78, 79, 83, 84, 65, 66, 76, 197, 77, 79, 78, 
-    79, 83, 80, 65, 67, 197, 77, 79, 78, 79, 82, 65, 73, 76, 128, 77, 79, 78, 
-    79, 71, 82, 65, 80, 200, 77, 79, 78, 79, 71, 82, 65, 77, 77, 79, 211, 77, 
-    79, 78, 79, 71, 82, 65, 205, 77, 79, 78, 79, 70, 79, 78, 73, 65, 83, 128, 
-    77, 79, 78, 79, 67, 85, 76, 65, 210, 77, 79, 78, 75, 69, 89, 128, 77, 79, 
-    78, 75, 69, 217, 77, 79, 78, 73, 128, 77, 79, 78, 71, 75, 69, 85, 65, 69, 
-    81, 128, 77, 79, 78, 69, 217, 77, 79, 78, 128, 77, 79, 206, 77, 79, 76, 
-    128, 77, 79, 72, 65, 77, 77, 65, 196, 77, 79, 68, 85, 76, 207, 77, 79, 
-    68, 69, 83, 84, 89, 128, 77, 79, 68, 69, 76, 83, 128, 77, 79, 68, 69, 76, 
-    128, 77, 79, 68, 69, 128, 77, 79, 66, 73, 76, 197, 77, 79, 65, 128, 77, 
-    207, 77, 78, 89, 65, 205, 77, 78, 65, 83, 128, 77, 77, 83, 80, 128, 77, 
-    77, 128, 77, 205, 77, 76, 65, 128, 77, 76, 128, 77, 75, 80, 65, 82, 65, 
-    209, 77, 73, 88, 128, 77, 73, 84, 128, 77, 73, 83, 82, 65, 128, 77, 73, 
-    82, 73, 66, 65, 65, 82, 85, 128, 77, 73, 82, 73, 128, 77, 73, 82, 69, 68, 
-    128, 77, 73, 80, 128, 77, 73, 78, 89, 128, 77, 73, 78, 85, 83, 45, 79, 
-    82, 45, 80, 76, 85, 211, 77, 73, 78, 85, 83, 128, 77, 73, 78, 73, 83, 84, 
-    69, 82, 128, 77, 73, 78, 73, 77, 65, 128, 77, 73, 78, 73, 68, 73, 83, 67, 
-    128, 77, 73, 78, 73, 66, 85, 83, 128, 77, 73, 77, 69, 128, 77, 73, 77, 
-    128, 77, 73, 76, 76, 73, 79, 78, 211, 77, 73, 76, 76, 69, 84, 128, 77, 
-    73, 76, 76, 197, 77, 73, 76, 204, 77, 73, 76, 75, 217, 77, 73, 76, 128, 
-    77, 73, 75, 85, 82, 79, 78, 128, 77, 73, 75, 82, 79, 206, 77, 73, 75, 82, 
-    73, 128, 77, 73, 73, 78, 128, 77, 73, 73, 128, 77, 73, 199, 77, 73, 69, 
-    88, 128, 77, 73, 69, 85, 77, 45, 84, 73, 75, 69, 85, 84, 128, 77, 73, 69, 
-    85, 77, 45, 83, 83, 65, 78, 71, 83, 73, 79, 83, 128, 77, 73, 69, 85, 77, 
-    45, 83, 83, 65, 78, 71, 78, 73, 69, 85, 78, 128, 77, 73, 69, 85, 77, 45, 
-    82, 73, 69, 85, 76, 128, 77, 73, 69, 85, 77, 45, 80, 73, 69, 85, 80, 45, 
-    83, 73, 79, 83, 128, 77, 73, 69, 85, 77, 45, 80, 73, 69, 85, 80, 128, 77, 
-    73, 69, 85, 77, 45, 80, 65, 78, 83, 73, 79, 83, 128, 77, 73, 69, 85, 77, 
-    45, 78, 73, 69, 85, 78, 128, 77, 73, 69, 85, 77, 45, 67, 73, 69, 85, 67, 
-    128, 77, 73, 69, 85, 77, 45, 67, 72, 73, 69, 85, 67, 72, 128, 77, 73, 69, 
-    85, 205, 77, 73, 69, 80, 128, 77, 73, 69, 69, 128, 77, 73, 69, 128, 77, 
-    73, 68, 76, 73, 78, 197, 77, 73, 68, 68, 76, 69, 45, 87, 69, 76, 83, 200, 
-    77, 73, 68, 68, 76, 197, 77, 73, 196, 77, 73, 67, 82, 79, 83, 67, 79, 80, 
-    69, 128, 77, 73, 67, 82, 79, 80, 72, 79, 78, 69, 128, 77, 73, 67, 82, 
-    207, 77, 73, 67, 210, 77, 72, 90, 128, 77, 72, 65, 128, 77, 72, 128, 77, 
-    71, 85, 88, 128, 77, 71, 85, 84, 128, 77, 71, 85, 82, 88, 128, 77, 71, 
-    85, 82, 128, 77, 71, 85, 80, 128, 77, 71, 85, 79, 88, 128, 77, 71, 85, 
-    79, 80, 128, 77, 71, 85, 79, 128, 77, 71, 85, 128, 77, 71, 79, 88, 128, 
-    77, 71, 79, 84, 128, 77, 71, 79, 80, 128, 77, 71, 79, 128, 77, 71, 207, 
-    77, 71, 73, 69, 88, 128, 77, 71, 73, 69, 128, 77, 71, 69, 88, 128, 77, 
-    71, 69, 80, 128, 77, 71, 69, 128, 77, 71, 66, 85, 128, 77, 71, 66, 79, 
-    79, 128, 77, 71, 66, 79, 70, 85, 77, 128, 77, 71, 66, 79, 128, 77, 71, 
-    66, 73, 128, 77, 71, 66, 69, 85, 78, 128, 77, 71, 66, 69, 78, 128, 77, 
-    71, 66, 69, 69, 128, 77, 71, 66, 69, 128, 77, 71, 66, 65, 83, 65, 81, 
-    128, 77, 71, 66, 65, 83, 65, 128, 77, 71, 65, 88, 128, 77, 71, 65, 84, 
-    128, 77, 71, 65, 80, 128, 77, 71, 65, 128, 77, 71, 128, 77, 70, 79, 78, 
-    128, 77, 70, 79, 206, 77, 70, 79, 128, 77, 70, 73, 89, 65, 81, 128, 77, 
-    70, 73, 69, 69, 128, 77, 70, 69, 85, 84, 128, 77, 70, 69, 85, 81, 128, 
-    77, 70, 69, 85, 65, 69, 128, 77, 70, 65, 65, 128, 77, 69, 90, 90, 79, 
-    128, 77, 69, 88, 128, 77, 69, 85, 212, 77, 69, 85, 81, 128, 77, 69, 85, 
-    78, 74, 79, 77, 78, 68, 69, 85, 81, 128, 77, 69, 85, 78, 128, 77, 69, 84, 
-    82, 79, 128, 77, 69, 84, 82, 73, 67, 65, 204, 77, 69, 84, 82, 73, 65, 
-    128, 77, 69, 84, 82, 69, 84, 69, 211, 77, 69, 84, 79, 66, 69, 76, 85, 83, 
-    128, 77, 69, 84, 69, 75, 128, 77, 69, 84, 69, 71, 128, 77, 69, 84, 65, 
-    76, 128, 77, 69, 84, 193, 77, 69, 83, 83, 69, 78, 73, 65, 206, 77, 69, 
-    83, 83, 65, 71, 69, 128, 77, 69, 83, 83, 65, 71, 197, 77, 69, 83, 79, 
-    128, 77, 69, 83, 73, 128, 77, 69, 83, 72, 128, 77, 69, 82, 79, 73, 84, 
-    73, 195, 77, 69, 82, 75, 72, 65, 128, 77, 69, 82, 75, 72, 193, 77, 69, 
-    82, 73, 68, 73, 65, 78, 83, 128, 77, 69, 82, 73, 128, 77, 69, 82, 71, 69, 
-    128, 77, 69, 82, 67, 85, 82, 89, 128, 77, 69, 82, 67, 85, 82, 217, 77, 
-    69, 78, 68, 85, 84, 128, 77, 69, 78, 128, 77, 69, 77, 79, 128, 77, 69, 
-    77, 66, 69, 82, 83, 72, 73, 80, 128, 77, 69, 77, 66, 69, 82, 128, 77, 69, 
-    77, 66, 69, 210, 77, 69, 77, 45, 81, 79, 80, 72, 128, 77, 69, 77, 128, 
-    77, 69, 205, 77, 69, 76, 79, 68, 73, 195, 77, 69, 76, 73, 75, 128, 77, 
-    69, 73, 90, 73, 128, 77, 69, 71, 65, 84, 79, 78, 128, 77, 69, 71, 65, 80, 
-    72, 79, 78, 69, 128, 77, 69, 71, 65, 76, 73, 128, 77, 69, 69, 84, 79, 82, 
-    85, 128, 77, 69, 69, 84, 128, 77, 69, 69, 77, 85, 128, 77, 69, 69, 77, 
-    128, 77, 69, 69, 69, 69, 128, 77, 69, 68, 73, 85, 77, 128, 77, 69, 68, 
-    73, 85, 205, 77, 69, 68, 73, 67, 73, 78, 69, 128, 77, 69, 68, 73, 67, 65, 
-    204, 77, 69, 65, 84, 128, 77, 69, 65, 212, 77, 69, 65, 83, 85, 82, 69, 
-    196, 77, 69, 65, 83, 85, 82, 69, 128, 77, 69, 65, 83, 85, 82, 197, 77, 
-    68, 85, 206, 77, 196, 77, 67, 72, 213, 77, 67, 72, 65, 206, 77, 195, 77, 
-    66, 85, 79, 81, 128, 77, 66, 85, 79, 128, 77, 66, 85, 69, 128, 77, 66, 
-    85, 65, 69, 77, 128, 77, 66, 85, 65, 69, 128, 77, 66, 79, 79, 128, 77, 
-    66, 79, 128, 77, 66, 73, 84, 128, 77, 66, 73, 212, 77, 66, 73, 82, 73, 
-    69, 69, 78, 128, 77, 66, 73, 128, 77, 66, 69, 85, 88, 128, 77, 66, 69, 
-    85, 82, 73, 128, 77, 66, 69, 85, 77, 128, 77, 66, 69, 82, 65, 69, 128, 
-    77, 66, 69, 78, 128, 77, 66, 69, 69, 75, 69, 69, 84, 128, 77, 66, 69, 69, 
-    128, 77, 66, 69, 128, 77, 66, 65, 81, 128, 77, 66, 65, 78, 89, 73, 128, 
-    77, 66, 65, 65, 82, 65, 69, 128, 77, 66, 65, 65, 75, 69, 84, 128, 77, 66, 
-    65, 65, 128, 77, 66, 65, 193, 77, 66, 193, 77, 66, 52, 128, 77, 66, 51, 
-    128, 77, 66, 50, 128, 77, 66, 128, 77, 194, 77, 65, 89, 65, 78, 78, 65, 
-    128, 77, 65, 89, 128, 77, 65, 88, 73, 77, 65, 128, 77, 65, 88, 128, 77, 
-    65, 85, 128, 77, 65, 84, 84, 79, 67, 75, 128, 77, 65, 84, 82, 73, 88, 
-    128, 77, 65, 84, 69, 82, 73, 65, 76, 83, 128, 77, 65, 84, 128, 77, 65, 
-    83, 213, 77, 65, 83, 83, 73, 78, 71, 128, 77, 65, 83, 83, 65, 71, 69, 
-    128, 77, 65, 83, 79, 82, 193, 77, 65, 83, 75, 128, 77, 65, 83, 72, 70, 
-    65, 65, 84, 128, 77, 65, 83, 72, 50, 128, 77, 65, 83, 67, 85, 76, 73, 78, 
-    197, 77, 65, 82, 89, 128, 77, 65, 82, 85, 75, 85, 128, 77, 65, 82, 84, 
-    89, 82, 73, 193, 77, 65, 82, 82, 89, 73, 78, 199, 77, 65, 82, 82, 73, 65, 
-    71, 197, 77, 65, 82, 75, 69, 82, 128, 77, 65, 82, 75, 45, 52, 128, 77, 
-    65, 82, 75, 45, 51, 128, 77, 65, 82, 75, 45, 50, 128, 77, 65, 82, 75, 45, 
-    49, 128, 77, 65, 82, 69, 128, 77, 65, 82, 67, 72, 128, 77, 65, 82, 67, 
-    65, 84, 79, 45, 83, 84, 65, 67, 67, 65, 84, 79, 128, 77, 65, 82, 67, 65, 
-    84, 79, 128, 77, 65, 82, 67, 65, 83, 73, 84, 69, 128, 77, 65, 82, 66, 85, 
-    84, 65, 128, 77, 65, 82, 66, 85, 84, 193, 77, 65, 82, 128, 77, 65, 81, 
-    65, 70, 128, 77, 65, 81, 128, 77, 65, 80, 76, 197, 77, 65, 80, 73, 81, 
-    128, 77, 65, 208, 77, 65, 79, 128, 77, 65, 78, 83, 89, 79, 78, 128, 77, 
-    65, 78, 83, 85, 65, 69, 128, 77, 65, 78, 78, 65, 218, 77, 65, 78, 78, 65, 
-    128, 77, 65, 78, 71, 65, 76, 65, 77, 128, 77, 65, 78, 68, 65, 73, 76, 73, 
-    78, 199, 77, 65, 78, 68, 65, 73, 195, 77, 65, 78, 67, 72, 213, 77, 65, 
-    78, 65, 67, 76, 69, 83, 128, 77, 65, 76, 84, 69, 83, 197, 77, 65, 76, 69, 
-    69, 82, 73, 128, 77, 65, 76, 69, 128, 77, 65, 76, 197, 77, 65, 76, 65, 
-    75, 79, 206, 77, 65, 75, 83, 85, 82, 65, 128, 77, 65, 75, 83, 85, 82, 
-    193, 77, 65, 73, 90, 69, 128, 77, 65, 73, 89, 65, 77, 79, 75, 128, 77, 
-    65, 73, 84, 65, 73, 75, 72, 85, 128, 77, 65, 73, 82, 85, 128, 77, 65, 73, 
-    77, 85, 65, 78, 128, 77, 65, 73, 77, 65, 76, 65, 73, 128, 77, 65, 73, 76, 
-    66, 79, 216, 77, 65, 73, 75, 85, 82, 79, 128, 77, 65, 73, 68, 69, 78, 
-    128, 77, 65, 73, 128, 77, 65, 72, 74, 79, 78, 199, 77, 65, 72, 72, 65, 
-    128, 77, 65, 72, 65, 80, 82, 65, 78, 65, 128, 77, 65, 72, 65, 80, 65, 75, 
-    72, 128, 77, 65, 72, 65, 65, 80, 82, 65, 65, 78, 193, 77, 65, 72, 128, 
-    77, 65, 71, 78, 73, 70, 89, 73, 78, 199, 77, 65, 69, 83, 73, 128, 77, 65, 
-    69, 78, 89, 73, 128, 77, 65, 69, 78, 74, 69, 84, 128, 77, 65, 69, 77, 86, 
-    69, 85, 88, 128, 77, 65, 69, 77, 75, 80, 69, 78, 128, 77, 65, 69, 77, 71, 
-    66, 73, 69, 69, 128, 77, 65, 69, 77, 66, 71, 66, 73, 69, 69, 128, 77, 65, 
-    69, 77, 66, 65, 128, 77, 65, 69, 77, 128, 77, 65, 69, 76, 69, 69, 128, 
-    77, 65, 69, 75, 69, 85, 80, 128, 77, 65, 68, 89, 65, 128, 77, 65, 68, 85, 
-    128, 77, 65, 68, 68, 65, 200, 77, 65, 68, 68, 65, 128, 77, 65, 68, 68, 
-    193, 77, 65, 67, 82, 79, 78, 45, 71, 82, 65, 86, 69, 128, 77, 65, 67, 82, 
-    79, 78, 45, 66, 82, 69, 86, 69, 128, 77, 65, 67, 82, 79, 78, 45, 65, 67, 
-    85, 84, 69, 128, 77, 65, 67, 82, 79, 78, 128, 77, 65, 67, 82, 79, 206, 
-    77, 65, 67, 72, 73, 78, 69, 128, 77, 65, 65, 89, 89, 65, 65, 128, 77, 65, 
-    65, 73, 128, 77, 65, 65, 128, 77, 65, 50, 128, 77, 48, 52, 52, 128, 77, 
-    48, 52, 51, 128, 77, 48, 52, 50, 128, 77, 48, 52, 49, 128, 77, 48, 52, 
-    48, 65, 128, 77, 48, 52, 48, 128, 77, 48, 51, 57, 128, 77, 48, 51, 56, 
-    128, 77, 48, 51, 55, 128, 77, 48, 51, 54, 128, 77, 48, 51, 53, 128, 77, 
-    48, 51, 52, 128, 77, 48, 51, 51, 66, 128, 77, 48, 51, 51, 65, 128, 77, 
-    48, 51, 51, 128, 77, 48, 51, 50, 128, 77, 48, 51, 49, 65, 128, 77, 48, 
-    51, 49, 128, 77, 48, 51, 48, 128, 77, 48, 50, 57, 128, 77, 48, 50, 56, 
-    65, 128, 77, 48, 50, 56, 128, 77, 48, 50, 55, 128, 77, 48, 50, 54, 128, 
-    77, 48, 50, 53, 128, 77, 48, 50, 52, 65, 128, 77, 48, 50, 52, 128, 77, 
-    48, 50, 51, 128, 77, 48, 50, 50, 65, 128, 77, 48, 50, 50, 128, 77, 48, 
-    50, 49, 128, 77, 48, 50, 48, 128, 77, 48, 49, 57, 128, 77, 48, 49, 56, 
-    128, 77, 48, 49, 55, 65, 128, 77, 48, 49, 55, 128, 77, 48, 49, 54, 65, 
-    128, 77, 48, 49, 54, 128, 77, 48, 49, 53, 65, 128, 77, 48, 49, 53, 128, 
-    77, 48, 49, 52, 128, 77, 48, 49, 51, 128, 77, 48, 49, 50, 72, 128, 77, 
-    48, 49, 50, 71, 128, 77, 48, 49, 50, 70, 128, 77, 48, 49, 50, 69, 128, 
-    77, 48, 49, 50, 68, 128, 77, 48, 49, 50, 67, 128, 77, 48, 49, 50, 66, 
-    128, 77, 48, 49, 50, 65, 128, 77, 48, 49, 50, 128, 77, 48, 49, 49, 128, 
-    77, 48, 49, 48, 65, 128, 77, 48, 49, 48, 128, 77, 48, 48, 57, 128, 77, 
-    48, 48, 56, 128, 77, 48, 48, 55, 128, 77, 48, 48, 54, 128, 77, 48, 48, 
-    53, 128, 77, 48, 48, 52, 128, 77, 48, 48, 51, 65, 128, 77, 48, 48, 51, 
-    128, 77, 48, 48, 50, 128, 77, 48, 48, 49, 66, 128, 77, 48, 48, 49, 65, 
-    128, 77, 48, 48, 49, 128, 76, 218, 76, 89, 89, 128, 76, 89, 88, 128, 76, 
-    89, 84, 128, 76, 89, 82, 88, 128, 76, 89, 82, 128, 76, 89, 80, 128, 76, 
-    89, 68, 73, 65, 206, 76, 89, 67, 73, 65, 206, 76, 88, 128, 76, 87, 79, 
-    79, 128, 76, 87, 79, 128, 76, 87, 73, 73, 128, 76, 87, 73, 128, 76, 87, 
-    69, 128, 76, 87, 65, 65, 128, 76, 87, 65, 128, 76, 85, 88, 128, 76, 85, 
-    85, 128, 76, 85, 84, 128, 76, 85, 82, 88, 128, 76, 85, 80, 128, 76, 85, 
-    79, 88, 128, 76, 85, 79, 84, 128, 76, 85, 79, 80, 128, 76, 85, 79, 128, 
-    76, 85, 78, 71, 83, 73, 128, 76, 85, 78, 65, 84, 197, 76, 85, 205, 76, 
-    85, 76, 128, 76, 85, 73, 83, 128, 76, 85, 72, 85, 82, 128, 76, 85, 72, 
-    128, 76, 85, 71, 71, 65, 71, 69, 128, 76, 85, 71, 65, 76, 128, 76, 85, 
-    71, 65, 204, 76, 85, 69, 128, 76, 85, 65, 69, 80, 128, 76, 85, 51, 128, 
-    76, 85, 50, 128, 76, 85, 178, 76, 82, 79, 128, 76, 82, 77, 128, 76, 82, 
-    69, 128, 76, 79, 90, 69, 78, 71, 69, 128, 76, 79, 90, 69, 78, 71, 197, 
-    76, 79, 88, 128, 76, 79, 87, 69, 82, 69, 196, 76, 79, 87, 69, 210, 76, 
-    79, 87, 45, 185, 76, 79, 86, 197, 76, 79, 85, 82, 69, 128, 76, 79, 85, 
-    68, 83, 80, 69, 65, 75, 69, 82, 128, 76, 79, 85, 68, 76, 217, 76, 79, 84, 
-    85, 83, 128, 76, 79, 84, 128, 76, 79, 82, 82, 89, 128, 76, 79, 82, 82, 
-    65, 73, 78, 69, 128, 76, 79, 81, 128, 76, 79, 80, 128, 76, 79, 79, 84, 
-    128, 76, 79, 79, 80, 69, 196, 76, 79, 79, 80, 128, 76, 79, 79, 208, 76, 
-    79, 79, 78, 128, 76, 79, 79, 203, 76, 79, 79, 128, 76, 79, 78, 83, 85, 
-    77, 128, 76, 79, 78, 71, 65, 128, 76, 79, 78, 71, 193, 76, 79, 78, 71, 
-    45, 66, 82, 65, 78, 67, 72, 45, 89, 82, 128, 76, 79, 78, 71, 45, 66, 82, 
-    65, 78, 67, 72, 45, 83, 79, 204, 76, 79, 78, 71, 45, 66, 82, 65, 78, 67, 
-    72, 45, 79, 83, 211, 76, 79, 78, 71, 45, 66, 82, 65, 78, 67, 72, 45, 77, 
-    65, 68, 210, 76, 79, 78, 71, 45, 66, 82, 65, 78, 67, 72, 45, 72, 65, 71, 
-    65, 76, 204, 76, 79, 78, 71, 45, 66, 82, 65, 78, 67, 72, 45, 65, 210, 76, 
-    79, 77, 77, 65, 69, 128, 76, 79, 77, 128, 76, 79, 205, 76, 79, 76, 76, 
-    73, 80, 79, 80, 128, 76, 79, 76, 76, 128, 76, 79, 71, 210, 76, 79, 71, 
-    79, 84, 89, 80, 197, 76, 79, 71, 79, 71, 82, 65, 205, 76, 79, 71, 128, 
-    76, 79, 68, 69, 83, 84, 79, 78, 69, 128, 76, 79, 67, 79, 77, 79, 84, 73, 
-    86, 69, 128, 76, 79, 67, 75, 73, 78, 71, 45, 83, 72, 73, 70, 212, 76, 79, 
-    67, 203, 76, 79, 67, 65, 84, 73, 86, 69, 128, 76, 79, 67, 65, 84, 73, 79, 
-    206, 76, 79, 65, 128, 76, 78, 128, 76, 76, 85, 85, 128, 76, 76, 79, 79, 
-    128, 76, 76, 76, 85, 85, 128, 76, 76, 76, 85, 128, 76, 76, 76, 79, 79, 
-    128, 76, 76, 76, 79, 128, 76, 76, 76, 73, 73, 128, 76, 76, 76, 73, 128, 
-    76, 76, 76, 69, 69, 128, 76, 76, 76, 69, 128, 76, 76, 76, 65, 85, 128, 
-    76, 76, 76, 65, 73, 128, 76, 76, 76, 65, 65, 128, 76, 76, 76, 65, 128, 
-    76, 76, 76, 128, 76, 74, 85, 68, 73, 74, 69, 128, 76, 74, 69, 128, 76, 
-    74, 128, 76, 73, 88, 128, 76, 73, 87, 78, 128, 76, 73, 86, 82, 197, 76, 
-    73, 84, 84, 76, 197, 76, 73, 84, 84, 69, 210, 76, 73, 84, 82, 193, 76, 
-    73, 84, 128, 76, 73, 83, 213, 76, 73, 82, 193, 76, 73, 81, 85, 73, 196, 
-    76, 73, 81, 128, 76, 73, 80, 83, 84, 73, 67, 75, 128, 76, 73, 78, 75, 73, 
-    78, 199, 76, 73, 78, 203, 76, 73, 78, 71, 83, 65, 128, 76, 73, 78, 69, 
-    83, 128, 76, 73, 78, 69, 211, 76, 73, 78, 69, 45, 57, 128, 76, 73, 78, 
-    69, 45, 55, 128, 76, 73, 78, 69, 45, 51, 128, 76, 73, 78, 69, 45, 49, 
-    128, 76, 73, 77, 77, 85, 52, 128, 76, 73, 77, 77, 85, 50, 128, 76, 73, 
-    77, 77, 85, 128, 76, 73, 77, 77, 213, 76, 73, 77, 73, 84, 69, 196, 76, 
-    73, 77, 73, 84, 65, 84, 73, 79, 78, 128, 76, 73, 77, 73, 84, 128, 76, 73, 
-    77, 69, 128, 76, 73, 77, 66, 213, 76, 73, 76, 89, 128, 76, 73, 76, 73, 
-    84, 72, 128, 76, 73, 76, 128, 76, 73, 71, 72, 84, 78, 73, 78, 71, 128, 
-    76, 73, 71, 72, 84, 72, 79, 85, 83, 69, 128, 76, 73, 71, 72, 84, 128, 76, 
-    73, 70, 69, 128, 76, 73, 69, 88, 128, 76, 73, 69, 84, 128, 76, 73, 69, 
-    80, 128, 76, 73, 69, 69, 128, 76, 73, 69, 128, 76, 73, 68, 128, 76, 73, 
-    66, 82, 65, 128, 76, 73, 66, 69, 82, 84, 89, 128, 76, 73, 65, 66, 73, 76, 
-    73, 84, 217, 76, 72, 73, 73, 128, 76, 72, 65, 86, 73, 89, 65, 78, 73, 
-    128, 76, 72, 65, 199, 76, 72, 65, 65, 128, 76, 72, 128, 76, 69, 90, 72, 
-    128, 76, 69, 88, 128, 76, 69, 86, 69, 204, 76, 69, 85, 77, 128, 76, 69, 
-    85, 65, 69, 80, 128, 76, 69, 85, 65, 69, 77, 128, 76, 69, 85, 128, 76, 
-    69, 213, 76, 69, 84, 84, 69, 82, 83, 128, 76, 69, 84, 84, 69, 82, 128, 
-    76, 69, 212, 76, 69, 83, 83, 69, 210, 76, 69, 83, 83, 45, 84, 72, 65, 78, 
-    128, 76, 69, 83, 83, 45, 84, 72, 65, 206, 76, 69, 80, 128, 76, 69, 79, 
-    80, 65, 82, 68, 128, 76, 69, 79, 128, 76, 69, 78, 84, 73, 67, 85, 76, 65, 
-    210, 76, 69, 78, 73, 83, 128, 76, 69, 78, 71, 84, 72, 69, 78, 69, 82, 
-    128, 76, 69, 78, 71, 84, 200, 76, 69, 78, 71, 65, 128, 76, 69, 78, 71, 
-    193, 76, 69, 77, 79, 78, 128, 76, 69, 77, 79, 73, 128, 76, 69, 76, 69, 
-    84, 128, 76, 69, 76, 69, 212, 76, 69, 203, 76, 69, 73, 77, 77, 65, 128, 
-    76, 69, 73, 77, 77, 193, 76, 69, 71, 83, 128, 76, 69, 71, 73, 79, 78, 
-    128, 76, 69, 71, 69, 84, 79, 211, 76, 69, 71, 128, 76, 69, 70, 84, 87, 
-    65, 82, 68, 83, 128, 76, 69, 70, 84, 45, 84, 79, 45, 82, 73, 71, 72, 212, 
-    76, 69, 70, 84, 45, 83, 84, 69, 205, 76, 69, 70, 84, 45, 83, 73, 68, 197, 
-    76, 69, 70, 84, 45, 83, 72, 65, 68, 69, 196, 76, 69, 70, 84, 45, 80, 79, 
-    73, 78, 84, 73, 78, 199, 76, 69, 70, 84, 45, 72, 65, 78, 68, 69, 196, 76, 
-    69, 70, 84, 45, 72, 65, 78, 196, 76, 69, 70, 84, 45, 70, 65, 67, 73, 78, 
-    199, 76, 69, 70, 84, 128, 76, 69, 69, 82, 65, 69, 87, 65, 128, 76, 69, 
-    69, 75, 128, 76, 69, 69, 69, 69, 128, 76, 69, 68, 71, 69, 82, 128, 76, 
-    69, 65, 84, 72, 69, 82, 128, 76, 69, 65, 70, 128, 76, 69, 65, 198, 76, 
-    69, 65, 68, 73, 78, 199, 76, 69, 65, 68, 69, 82, 128, 76, 69, 65, 196, 
-    76, 68, 65, 78, 128, 76, 68, 50, 128, 76, 67, 201, 76, 67, 197, 76, 65, 
-    90, 217, 76, 65, 89, 65, 78, 78, 65, 128, 76, 65, 88, 128, 76, 65, 87, 
-    128, 76, 65, 215, 76, 65, 85, 76, 65, 128, 76, 65, 85, 75, 65, 218, 76, 
-    65, 84, 73, 78, 65, 84, 197, 76, 65, 84, 73, 75, 128, 76, 65, 84, 69, 82, 
-    65, 204, 76, 65, 84, 197, 76, 65, 83, 212, 76, 65, 82, 89, 78, 71, 69, 
-    65, 204, 76, 65, 82, 71, 69, 210, 76, 65, 82, 71, 69, 128, 76, 65, 82, 
-    71, 197, 76, 65, 81, 128, 76, 65, 80, 65, 81, 128, 76, 65, 80, 128, 76, 
-    65, 78, 84, 69, 82, 78, 128, 76, 65, 78, 71, 85, 65, 71, 197, 76, 65, 78, 
-    69, 83, 128, 76, 65, 77, 69, 68, 72, 128, 76, 65, 77, 69, 68, 128, 76, 
-    65, 77, 69, 196, 76, 65, 77, 69, 128, 76, 65, 77, 197, 76, 65, 77, 68, 
-    65, 128, 76, 65, 77, 68, 128, 76, 65, 77, 66, 68, 193, 76, 65, 77, 65, 
-    68, 72, 128, 76, 65, 76, 128, 76, 65, 204, 76, 65, 75, 75, 72, 65, 78, 
-    71, 89, 65, 79, 128, 76, 65, 74, 65, 78, 89, 65, 76, 65, 78, 128, 76, 65, 
-    201, 76, 65, 72, 83, 72, 85, 128, 76, 65, 72, 128, 76, 65, 71, 85, 83, 
-    128, 76, 65, 71, 213, 76, 65, 71, 65, 82, 128, 76, 65, 71, 65, 210, 76, 
-    65, 71, 65, 66, 128, 76, 65, 71, 65, 194, 76, 65, 69, 86, 128, 76, 65, 
-    69, 128, 76, 65, 68, 217, 76, 65, 67, 75, 128, 76, 65, 67, 65, 128, 76, 
-    65, 66, 79, 85, 82, 73, 78, 71, 128, 76, 65, 66, 79, 82, 128, 76, 65, 66, 
-    73, 65, 76, 73, 90, 65, 84, 73, 79, 206, 76, 65, 66, 73, 65, 204, 76, 65, 
-    66, 65, 84, 128, 76, 65, 65, 78, 65, 69, 128, 76, 65, 65, 78, 128, 76, 
-    65, 65, 77, 85, 128, 76, 65, 65, 77, 128, 76, 65, 65, 73, 128, 76, 48, 
-    48, 54, 65, 128, 76, 48, 48, 50, 65, 128, 76, 45, 84, 89, 80, 197, 76, 
-    45, 83, 72, 65, 80, 69, 196, 75, 89, 85, 82, 73, 73, 128, 75, 89, 85, 
-    128, 75, 89, 79, 128, 75, 89, 76, 73, 83, 77, 65, 128, 75, 89, 73, 128, 
-    75, 89, 69, 128, 75, 89, 65, 84, 72, 79, 211, 75, 89, 65, 65, 128, 75, 
-    89, 65, 128, 75, 88, 87, 73, 128, 75, 88, 87, 69, 69, 128, 75, 88, 87, 
-    69, 128, 75, 88, 87, 65, 65, 128, 75, 88, 87, 65, 128, 75, 88, 85, 128, 
-    75, 88, 79, 128, 75, 88, 73, 128, 75, 88, 69, 69, 128, 75, 88, 69, 128, 
-    75, 88, 65, 65, 128, 75, 88, 65, 128, 75, 87, 85, 51, 49, 56, 128, 75, 
-    87, 79, 79, 128, 75, 87, 79, 128, 75, 87, 73, 73, 128, 75, 87, 73, 128, 
-    75, 87, 69, 69, 128, 75, 87, 69, 128, 75, 87, 65, 89, 128, 75, 87, 65, 
-    69, 84, 128, 75, 87, 65, 65, 128, 75, 86, 65, 128, 75, 86, 128, 75, 85, 
-    88, 128, 75, 85, 85, 72, 128, 75, 85, 84, 128, 75, 85, 83, 77, 65, 128, 
-    75, 85, 83, 72, 85, 50, 128, 75, 85, 82, 88, 128, 75, 85, 82, 85, 90, 69, 
-    73, 82, 79, 128, 75, 85, 82, 84, 128, 75, 85, 82, 79, 79, 78, 69, 128, 
-    75, 85, 82, 128, 75, 85, 210, 75, 85, 81, 128, 75, 85, 79, 88, 128, 75, 
-    85, 79, 80, 128, 75, 85, 79, 208, 75, 85, 79, 77, 128, 75, 85, 79, 128, 
-    75, 85, 78, 71, 128, 75, 85, 78, 68, 68, 65, 76, 73, 89, 65, 128, 75, 85, 
-    76, 128, 75, 85, 204, 75, 85, 69, 84, 128, 75, 85, 55, 128, 75, 85, 52, 
-    128, 75, 85, 180, 75, 85, 51, 128, 75, 85, 179, 75, 84, 128, 75, 83, 83, 
-    85, 85, 128, 75, 83, 83, 85, 128, 75, 83, 83, 79, 79, 128, 75, 83, 83, 
-    79, 128, 75, 83, 83, 73, 73, 128, 75, 83, 83, 73, 128, 75, 83, 83, 69, 
-    69, 128, 75, 83, 83, 69, 128, 75, 83, 83, 65, 85, 128, 75, 83, 83, 65, 
-    73, 128, 75, 83, 83, 65, 65, 128, 75, 83, 83, 65, 128, 75, 83, 83, 128, 
-    75, 83, 73, 128, 75, 82, 69, 77, 65, 83, 84, 73, 128, 75, 82, 65, 84, 73, 
-    77, 79, 89, 80, 79, 82, 82, 79, 79, 78, 128, 75, 82, 65, 84, 73, 77, 79, 
-    75, 79, 85, 70, 73, 83, 77, 65, 128, 75, 82, 65, 84, 73, 77, 65, 84, 65, 
-    128, 75, 82, 65, 84, 73, 77, 193, 75, 80, 85, 128, 75, 80, 79, 81, 128, 
-    75, 80, 79, 79, 128, 75, 80, 79, 128, 75, 80, 73, 128, 75, 80, 69, 85, 
-    88, 128, 75, 80, 69, 69, 128, 75, 80, 69, 128, 75, 80, 65, 82, 65, 81, 
-    128, 75, 80, 65, 78, 128, 75, 80, 65, 128, 75, 79, 88, 128, 75, 79, 86, 
-    85, 85, 128, 75, 79, 84, 79, 128, 75, 79, 82, 85, 78, 65, 128, 75, 79, 
-    82, 79, 78, 73, 83, 128, 75, 79, 82, 69, 65, 206, 75, 79, 82, 65, 78, 73, 
-    195, 75, 79, 81, 78, 68, 79, 78, 128, 75, 79, 80, 80, 65, 128, 75, 79, 
-    80, 128, 75, 79, 79, 80, 79, 128, 75, 79, 79, 77, 85, 85, 84, 128, 75, 
-    79, 79, 128, 75, 79, 78, 84, 69, 86, 77, 65, 128, 75, 79, 78, 84, 69, 86, 
-    77, 193, 75, 79, 77, 201, 75, 79, 77, 66, 85, 86, 65, 128, 75, 79, 77, 
-    66, 85, 86, 193, 75, 79, 77, 66, 213, 75, 79, 75, 79, 128, 75, 79, 75, 
-    128, 75, 79, 203, 75, 79, 73, 128, 75, 79, 201, 75, 79, 72, 128, 75, 79, 
-    71, 72, 79, 77, 128, 75, 79, 69, 84, 128, 75, 79, 65, 76, 65, 128, 75, 
-    79, 65, 128, 75, 78, 73, 71, 72, 84, 128, 75, 78, 73, 71, 72, 212, 75, 
-    78, 73, 70, 69, 128, 75, 78, 73, 70, 197, 75, 77, 128, 75, 205, 75, 76, 
-    73, 84, 79, 78, 128, 75, 76, 65, 83, 77, 65, 128, 75, 76, 65, 83, 77, 
-    193, 75, 76, 65, 128, 75, 76, 128, 75, 75, 85, 128, 75, 75, 79, 128, 75, 
-    75, 73, 128, 75, 75, 69, 69, 128, 75, 75, 69, 128, 75, 75, 65, 128, 75, 
-    75, 128, 75, 74, 69, 128, 75, 73, 89, 69, 79, 75, 45, 84, 73, 75, 69, 85, 
-    84, 128, 75, 73, 89, 69, 79, 75, 45, 83, 73, 79, 83, 45, 75, 73, 89, 69, 
-    79, 75, 128, 75, 73, 89, 69, 79, 75, 45, 82, 73, 69, 85, 76, 128, 75, 73, 
-    89, 69, 79, 75, 45, 80, 73, 69, 85, 80, 128, 75, 73, 89, 69, 79, 75, 45, 
-    78, 73, 69, 85, 78, 128, 75, 73, 89, 69, 79, 75, 45, 75, 72, 73, 69, 85, 
-    75, 72, 128, 75, 73, 89, 69, 79, 75, 45, 67, 72, 73, 69, 85, 67, 72, 128, 
-    75, 73, 89, 69, 79, 203, 75, 73, 88, 128, 75, 73, 84, 128, 75, 73, 83, 
-    83, 73, 78, 199, 75, 73, 83, 83, 128, 75, 73, 83, 211, 75, 73, 83, 73, 
-    77, 53, 128, 75, 73, 83, 73, 77, 181, 75, 73, 83, 72, 128, 75, 73, 83, 
-    65, 76, 128, 75, 73, 82, 79, 87, 65, 84, 84, 79, 128, 75, 73, 82, 79, 77, 
-    69, 69, 84, 79, 82, 85, 128, 75, 73, 82, 79, 71, 85, 82, 65, 77, 85, 128, 
-    75, 73, 82, 79, 128, 75, 73, 82, 71, 72, 73, 218, 75, 73, 81, 128, 75, 
-    73, 80, 128, 75, 73, 208, 75, 73, 78, 83, 72, 73, 80, 128, 75, 73, 78, 
-    68, 69, 82, 71, 65, 82, 84, 69, 78, 128, 75, 73, 77, 79, 78, 79, 128, 75, 
-    73, 73, 128, 75, 73, 72, 128, 75, 73, 69, 88, 128, 75, 73, 69, 80, 128, 
-    75, 73, 69, 69, 77, 128, 75, 73, 69, 128, 75, 73, 68, 128, 75, 73, 196, 
-    75, 73, 67, 75, 128, 75, 72, 90, 128, 75, 72, 87, 65, 73, 128, 75, 72, 
-    85, 69, 78, 45, 76, 85, 197, 75, 72, 85, 69, 206, 75, 72, 85, 68, 65, 77, 
-    128, 75, 72, 85, 65, 84, 128, 75, 72, 79, 85, 128, 75, 72, 79, 212, 75, 
-    72, 79, 78, 128, 75, 72, 79, 77, 85, 84, 128, 75, 72, 79, 128, 75, 72, 
-    207, 75, 72, 77, 213, 75, 72, 73, 84, 128, 75, 72, 73, 78, 89, 65, 128, 
-    75, 72, 73, 69, 85, 75, 200, 75, 72, 73, 128, 75, 72, 72, 79, 128, 75, 
-    72, 72, 65, 128, 75, 72, 69, 84, 72, 128, 75, 72, 69, 73, 128, 75, 72, 
-    69, 69, 128, 75, 72, 69, 128, 75, 72, 65, 82, 79, 83, 72, 84, 72, 201, 
-    75, 72, 65, 82, 128, 75, 72, 65, 80, 72, 128, 75, 72, 65, 78, 199, 75, 
-    72, 65, 78, 68, 193, 75, 72, 65, 78, 128, 75, 72, 65, 77, 84, 201, 75, 
-    72, 65, 75, 65, 83, 83, 73, 65, 206, 75, 72, 65, 73, 128, 75, 72, 65, 72, 
-    128, 75, 72, 65, 200, 75, 72, 65, 65, 128, 75, 71, 128, 75, 69, 89, 67, 
-    65, 80, 128, 75, 69, 89, 67, 65, 208, 75, 69, 89, 66, 79, 65, 82, 68, 
-    128, 75, 69, 88, 128, 75, 69, 85, 89, 69, 85, 88, 128, 75, 69, 85, 83, 
-    72, 69, 85, 65, 69, 80, 128, 75, 69, 85, 83, 69, 85, 88, 128, 75, 69, 85, 
-    80, 85, 81, 128, 75, 69, 85, 79, 212, 75, 69, 85, 77, 128, 75, 69, 85, 
-    75, 69, 85, 84, 78, 68, 65, 128, 75, 69, 85, 75, 65, 81, 128, 75, 69, 85, 
-    65, 69, 84, 77, 69, 85, 78, 128, 75, 69, 85, 65, 69, 82, 73, 128, 75, 69, 
-    84, 84, 201, 75, 69, 83, 72, 50, 128, 75, 69, 82, 69, 84, 128, 75, 69, 
-    79, 87, 128, 75, 69, 78, 84, 73, 77, 65, 84, 65, 128, 75, 69, 78, 84, 73, 
-    77, 65, 84, 193, 75, 69, 78, 84, 73, 77, 193, 75, 69, 78, 65, 84, 128, 
-    75, 69, 78, 128, 75, 69, 206, 75, 69, 77, 80, 85, 76, 128, 75, 69, 77, 
-    80, 85, 204, 75, 69, 77, 80, 76, 73, 128, 75, 69, 77, 80, 76, 201, 75, 
-    69, 77, 80, 72, 82, 69, 78, 71, 128, 75, 69, 77, 66, 65, 78, 71, 128, 75, 
-    69, 76, 86, 73, 206, 75, 69, 72, 69, 72, 128, 75, 69, 72, 69, 200, 75, 
-    69, 72, 128, 75, 69, 70, 85, 76, 65, 128, 75, 69, 69, 83, 85, 128, 75, 
-    69, 69, 80, 73, 78, 199, 75, 69, 69, 78, 71, 128, 75, 67, 65, 76, 128, 
-    75, 66, 128, 75, 65, 90, 65, 75, 200, 75, 65, 89, 65, 78, 78, 65, 128, 
-    75, 65, 89, 65, 200, 75, 65, 88, 128, 75, 65, 87, 73, 128, 75, 65, 86, 
-    89, 75, 65, 128, 75, 65, 85, 78, 65, 128, 75, 65, 85, 206, 75, 65, 85, 
-    128, 75, 65, 84, 79, 128, 75, 65, 84, 72, 73, 83, 84, 73, 128, 75, 65, 
-    84, 72, 65, 75, 193, 75, 65, 84, 65, 86, 65, 83, 77, 65, 128, 75, 65, 84, 
-    65, 86, 193, 75, 65, 84, 65, 75, 65, 78, 65, 45, 72, 73, 82, 65, 71, 65, 
-    78, 193, 75, 65, 83, 82, 65, 84, 65, 78, 128, 75, 65, 83, 82, 65, 84, 65, 
-    206, 75, 65, 83, 82, 65, 128, 75, 65, 83, 82, 193, 75, 65, 83, 75, 65, 
-    76, 128, 75, 65, 83, 75, 65, 204, 75, 65, 83, 72, 77, 73, 82, 201, 75, 
-    65, 82, 83, 72, 65, 78, 65, 128, 75, 65, 82, 79, 82, 73, 73, 128, 75, 65, 
-    82, 207, 75, 65, 82, 69, 206, 75, 65, 82, 65, 84, 84, 79, 128, 75, 65, 
-    82, 65, 78, 128, 75, 65, 80, 89, 69, 79, 85, 78, 83, 83, 65, 78, 71, 80, 
-    73, 69, 85, 80, 128, 75, 65, 80, 89, 69, 79, 85, 78, 82, 73, 69, 85, 76, 
-    128, 75, 65, 80, 89, 69, 79, 85, 78, 80, 72, 73, 69, 85, 80, 72, 128, 75, 
-    65, 80, 89, 69, 79, 85, 78, 77, 73, 69, 85, 77, 128, 75, 65, 80, 80, 65, 
-    128, 75, 65, 80, 80, 193, 75, 65, 80, 79, 128, 75, 65, 80, 72, 128, 75, 
-    65, 80, 65, 76, 128, 75, 65, 80, 65, 128, 75, 65, 78, 84, 65, 74, 193, 
-    75, 65, 78, 71, 128, 75, 65, 78, 199, 75, 65, 78, 65, 75, 79, 128, 75, 
-    65, 77, 52, 128, 75, 65, 77, 50, 128, 75, 65, 77, 128, 75, 65, 75, 79, 
-    128, 75, 65, 75, 65, 66, 65, 84, 128, 75, 65, 75, 128, 75, 65, 203, 75, 
-    65, 73, 84, 72, 201, 75, 65, 73, 82, 73, 128, 75, 65, 73, 128, 75, 65, 
-    201, 75, 65, 70, 65, 128, 75, 65, 70, 128, 75, 65, 198, 75, 65, 68, 53, 
-    128, 75, 65, 68, 181, 75, 65, 68, 52, 128, 75, 65, 68, 51, 128, 75, 65, 
-    68, 179, 75, 65, 68, 50, 128, 75, 65, 68, 128, 75, 65, 66, 193, 75, 65, 
-    66, 128, 75, 65, 65, 73, 128, 75, 65, 65, 70, 85, 128, 75, 65, 65, 70, 
-    128, 75, 65, 50, 128, 75, 65, 178, 75, 48, 48, 56, 128, 75, 48, 48, 55, 
-    128, 75, 48, 48, 54, 128, 75, 48, 48, 53, 128, 75, 48, 48, 52, 128, 75, 
-    48, 48, 51, 128, 75, 48, 48, 50, 128, 75, 48, 48, 49, 128, 74, 87, 65, 
-    128, 74, 85, 85, 128, 74, 85, 84, 128, 74, 85, 83, 84, 73, 70, 73, 67, 
-    65, 84, 73, 79, 78, 128, 74, 85, 80, 73, 84, 69, 82, 128, 74, 85, 79, 84, 
-    128, 74, 85, 79, 80, 128, 74, 85, 78, 79, 128, 74, 85, 78, 69, 128, 74, 
-    85, 76, 89, 128, 74, 85, 69, 85, 73, 128, 74, 85, 68, 85, 76, 128, 74, 
-    85, 68, 71, 69, 128, 74, 85, 68, 69, 79, 45, 83, 80, 65, 78, 73, 83, 200, 
-    74, 79, 89, 79, 85, 211, 74, 79, 89, 128, 74, 79, 86, 69, 128, 74, 79, 
-    212, 74, 79, 78, 71, 128, 74, 79, 78, 193, 74, 79, 75, 69, 82, 128, 74, 
-    79, 73, 78, 69, 68, 128, 74, 79, 73, 78, 128, 74, 79, 65, 128, 74, 74, 
-    89, 88, 128, 74, 74, 89, 84, 128, 74, 74, 89, 80, 128, 74, 74, 89, 128, 
-    74, 74, 85, 88, 128, 74, 74, 85, 84, 128, 74, 74, 85, 82, 88, 128, 74, 
-    74, 85, 82, 128, 74, 74, 85, 80, 128, 74, 74, 85, 79, 88, 128, 74, 74, 
-    85, 79, 80, 128, 74, 74, 85, 79, 128, 74, 74, 85, 128, 74, 74, 79, 88, 
-    128, 74, 74, 79, 84, 128, 74, 74, 79, 80, 128, 74, 74, 79, 128, 74, 74, 
-    73, 88, 128, 74, 74, 73, 84, 128, 74, 74, 73, 80, 128, 74, 74, 73, 69, 
-    88, 128, 74, 74, 73, 69, 84, 128, 74, 74, 73, 69, 80, 128, 74, 74, 73, 
-    69, 128, 74, 74, 73, 128, 74, 74, 69, 69, 128, 74, 74, 69, 128, 74, 74, 
-    65, 128, 74, 73, 76, 128, 74, 73, 73, 128, 74, 73, 72, 86, 65, 77, 85, 
-    76, 73, 89, 65, 128, 74, 73, 65, 128, 74, 72, 79, 128, 74, 72, 69, 72, 
-    128, 74, 72, 65, 78, 128, 74, 72, 65, 77, 128, 74, 72, 65, 65, 128, 74, 
-    72, 65, 128, 74, 69, 85, 128, 74, 69, 82, 85, 83, 65, 76, 69, 77, 128, 
-    74, 69, 82, 65, 206, 74, 69, 82, 65, 128, 74, 69, 82, 128, 74, 69, 72, 
-    128, 74, 69, 200, 74, 69, 71, 79, 71, 65, 78, 128, 74, 69, 69, 77, 128, 
-    74, 69, 65, 78, 83, 128, 74, 65, 89, 65, 78, 78, 65, 128, 74, 65, 86, 73, 
-    89, 65, 78, 73, 128, 74, 65, 85, 128, 74, 65, 82, 128, 74, 65, 80, 65, 
-    78, 69, 83, 197, 74, 65, 80, 65, 78, 128, 74, 65, 78, 85, 65, 82, 89, 
-    128, 74, 65, 76, 76, 65, 74, 65, 76, 65, 76, 79, 85, 72, 79, 85, 128, 74, 
-    65, 73, 128, 74, 65, 72, 128, 74, 65, 68, 69, 128, 74, 65, 67, 75, 45, 
-    79, 45, 76, 65, 78, 84, 69, 82, 78, 128, 74, 65, 67, 203, 74, 45, 83, 73, 
-    77, 80, 76, 73, 70, 73, 69, 196, 202, 73, 90, 72, 73, 84, 83, 65, 128, 
-    73, 90, 72, 73, 84, 83, 193, 73, 90, 72, 69, 128, 73, 90, 65, 75, 65, 89, 
-    193, 73, 89, 69, 75, 128, 73, 89, 65, 78, 78, 65, 128, 73, 85, 74, 65, 
-    128, 73, 85, 128, 73, 84, 211, 73, 84, 69, 82, 65, 84, 73, 79, 206, 73, 
-    84, 69, 77, 128, 73, 83, 83, 72, 65, 82, 128, 73, 83, 79, 78, 128, 73, 
-    83, 79, 206, 73, 83, 69, 78, 45, 73, 83, 69, 78, 128, 73, 83, 65, 75, 73, 
-    193, 73, 83, 45, 80, 73, 76, 76, 65, 128, 73, 82, 85, 89, 65, 78, 78, 65, 
-    128, 73, 82, 85, 85, 89, 65, 78, 78, 65, 128, 73, 82, 79, 78, 45, 67, 79, 
-    80, 80, 69, 210, 73, 82, 79, 78, 128, 73, 79, 84, 73, 70, 73, 69, 196, 
-    73, 79, 84, 65, 84, 69, 196, 73, 79, 84, 65, 128, 73, 79, 84, 193, 73, 
-    79, 82, 128, 73, 79, 68, 72, 65, 68, 72, 128, 73, 78, 86, 73, 83, 73, 66, 
-    76, 197, 73, 78, 86, 69, 82, 84, 69, 68, 128, 73, 78, 86, 69, 82, 84, 69, 
-    196, 73, 78, 86, 69, 82, 83, 197, 73, 78, 84, 82, 79, 68, 85, 67, 69, 82, 
-    128, 73, 78, 84, 73, 128, 73, 78, 84, 69, 82, 83, 89, 76, 76, 65, 66, 73, 
-    195, 73, 78, 84, 69, 82, 83, 69, 67, 84, 73, 79, 78, 128, 73, 78, 84, 69, 
-    82, 83, 69, 67, 84, 73, 79, 206, 73, 78, 84, 69, 82, 83, 69, 67, 84, 73, 
-    78, 199, 73, 78, 84, 69, 82, 82, 79, 66, 65, 78, 71, 128, 73, 78, 84, 69, 
-    82, 80, 79, 76, 65, 84, 73, 79, 206, 73, 78, 84, 69, 82, 76, 79, 67, 75, 
-    69, 196, 73, 78, 84, 69, 82, 76, 73, 78, 69, 65, 210, 73, 78, 84, 69, 82, 
-    76, 65, 67, 69, 196, 73, 78, 84, 69, 82, 73, 79, 210, 73, 78, 84, 69, 82, 
-    69, 83, 212, 73, 78, 84, 69, 82, 67, 65, 76, 65, 84, 69, 128, 73, 78, 84, 
-    69, 71, 82, 65, 84, 73, 79, 78, 128, 73, 78, 84, 69, 71, 82, 65, 84, 73, 
-    79, 206, 73, 78, 84, 69, 71, 82, 65, 76, 128, 73, 78, 84, 69, 71, 82, 65, 
-    204, 73, 78, 83, 85, 76, 65, 210, 73, 78, 83, 84, 82, 85, 77, 69, 78, 84, 
-    65, 204, 73, 78, 83, 73, 68, 69, 128, 73, 78, 83, 69, 82, 84, 73, 79, 
-    206, 73, 78, 83, 69, 67, 84, 128, 73, 78, 83, 67, 82, 73, 80, 84, 73, 79, 
-    78, 65, 204, 73, 78, 80, 85, 212, 73, 78, 78, 79, 67, 69, 78, 67, 69, 
-    128, 73, 78, 78, 78, 128, 73, 78, 78, 69, 82, 128, 73, 78, 78, 69, 210, 
-    73, 78, 78, 128, 73, 78, 73, 78, 71, 85, 128, 73, 78, 73, 128, 73, 78, 
-    72, 73, 66, 73, 212, 73, 78, 72, 69, 82, 69, 78, 212, 73, 78, 71, 87, 65, 
-    90, 128, 73, 78, 70, 79, 82, 77, 65, 84, 73, 79, 206, 73, 78, 70, 76, 85, 
-    69, 78, 67, 69, 128, 73, 78, 70, 73, 78, 73, 84, 89, 128, 73, 78, 70, 73, 
-    78, 73, 84, 217, 73, 78, 68, 85, 83, 84, 82, 73, 65, 204, 73, 78, 68, 73, 
-    82, 69, 67, 212, 73, 78, 68, 73, 67, 65, 84, 79, 82, 128, 73, 78, 68, 73, 
-    67, 65, 84, 79, 210, 73, 78, 68, 73, 195, 73, 78, 68, 73, 65, 206, 73, 
-    78, 68, 69, 88, 128, 73, 78, 68, 69, 80, 69, 78, 68, 69, 78, 212, 73, 78, 
-    67, 82, 69, 77, 69, 78, 84, 128, 73, 78, 67, 82, 69, 65, 83, 69, 211, 73, 
-    78, 67, 82, 69, 65, 83, 69, 128, 73, 78, 67, 79, 77, 80, 76, 69, 84, 197, 
-    73, 78, 67, 79, 77, 73, 78, 199, 73, 78, 67, 76, 85, 68, 73, 78, 199, 73, 
-    78, 67, 72, 128, 73, 78, 66, 79, 216, 73, 78, 65, 80, 128, 73, 78, 45, 
-    65, 76, 65, 70, 128, 73, 77, 80, 69, 82, 73, 65, 204, 73, 77, 80, 69, 82, 
-    70, 69, 67, 84, 85, 205, 73, 77, 80, 69, 82, 70, 69, 67, 84, 65, 128, 73, 
-    77, 80, 69, 82, 70, 69, 67, 84, 193, 73, 77, 78, 128, 73, 77, 73, 83, 69, 
-    79, 211, 73, 77, 73, 78, 51, 128, 73, 77, 73, 78, 128, 73, 77, 73, 206, 
-    73, 77, 73, 70, 84, 72, 79, 82, 79, 78, 128, 73, 77, 73, 70, 84, 72, 79, 
-    82, 65, 128, 73, 77, 73, 70, 79, 78, 79, 78, 128, 73, 77, 73, 68, 73, 65, 
-    82, 71, 79, 78, 128, 73, 77, 65, 71, 197, 73, 76, 85, 89, 65, 78, 78, 65, 
-    128, 73, 76, 85, 89, 128, 73, 76, 85, 85, 89, 65, 78, 78, 65, 128, 73, 
-    76, 85, 84, 128, 73, 76, 73, 77, 77, 85, 52, 128, 73, 76, 73, 77, 77, 85, 
-    51, 128, 73, 76, 73, 77, 77, 85, 128, 73, 76, 73, 77, 77, 213, 73, 76, 
-    50, 128, 73, 75, 65, 82, 65, 128, 73, 75, 65, 82, 193, 73, 74, 128, 73, 
-    73, 89, 65, 78, 78, 65, 128, 73, 71, 73, 128, 73, 71, 201, 73, 71, 71, 
-    87, 83, 128, 73, 70, 73, 78, 128, 73, 69, 85, 78, 71, 45, 84, 73, 75, 69, 
-    85, 84, 128, 73, 69, 85, 78, 71, 45, 84, 72, 73, 69, 85, 84, 72, 128, 73, 
-    69, 85, 78, 71, 45, 83, 83, 65, 78, 71, 75, 73, 89, 69, 79, 75, 128, 73, 
-    69, 85, 78, 71, 45, 82, 73, 69, 85, 76, 128, 73, 69, 85, 78, 71, 45, 80, 
-    73, 69, 85, 80, 128, 73, 69, 85, 78, 71, 45, 80, 72, 73, 69, 85, 80, 72, 
-    128, 73, 69, 85, 78, 71, 45, 75, 73, 89, 69, 79, 75, 128, 73, 69, 85, 78, 
-    71, 45, 75, 72, 73, 69, 85, 75, 72, 128, 73, 69, 85, 78, 71, 45, 67, 73, 
-    69, 85, 67, 128, 73, 69, 85, 78, 71, 45, 67, 72, 73, 69, 85, 67, 72, 128, 
-    73, 69, 85, 78, 199, 73, 68, 76, 69, 128, 73, 68, 73, 77, 128, 73, 68, 
-    73, 205, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 68, 57, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 68, 56, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 65, 68, 55, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 65, 68, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 65, 68, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 68, 
-    52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 68, 51, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 68, 50, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 65, 68, 49, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 65, 68, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 65, 67, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 
-    69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 68, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 67, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 65, 67, 66, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 65, 67, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 65, 67, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 
-    56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 55, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 54, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 65, 67, 53, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 65, 67, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 65, 67, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 
-    50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 49, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 48, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 65, 66, 70, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 65, 66, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 65, 66, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 66, 
-    67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 66, 66, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 66, 65, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 65, 66, 57, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 65, 66, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 65, 66, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 66, 
-    54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 66, 53, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 66, 52, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 65, 66, 51, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 65, 66, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 65, 66, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 66, 
-    48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 65, 70, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 65, 69, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 65, 65, 68, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 65, 65, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 65, 65, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 65, 
-    65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 65, 57, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 65, 56, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 65, 65, 55, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 65, 65, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 65, 65, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 65, 
-    52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 65, 51, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 65, 50, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 65, 65, 49, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 65, 65, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 65, 57, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 
-    69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 68, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 67, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 65, 57, 66, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 65, 57, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 65, 57, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 
-    56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 55, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 54, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 65, 57, 53, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 65, 57, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 65, 57, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 
-    50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 49, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 48, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 65, 56, 70, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 65, 56, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 65, 56, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 56, 
-    67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 56, 66, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 56, 65, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 65, 56, 57, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 65, 56, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 65, 56, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 56, 
-    54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 56, 53, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 56, 52, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 65, 56, 51, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 65, 56, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 65, 56, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 56, 
-    48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 55, 70, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 55, 69, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 65, 55, 68, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 65, 55, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 65, 55, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 55, 
-    65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 55, 57, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 55, 56, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 65, 55, 55, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 65, 55, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 65, 55, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 55, 
-    52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 55, 51, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 55, 50, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 65, 55, 49, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 65, 55, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 65, 54, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 54, 
-    67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 54, 66, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 54, 65, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 65, 54, 57, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 65, 54, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 65, 54, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 54, 
-    54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 54, 53, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 54, 52, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 65, 54, 51, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 65, 54, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 65, 54, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 54, 
-    48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 70, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 69, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 65, 53, 68, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 65, 53, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 65, 53, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 
-    65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 57, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 56, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 65, 53, 55, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 65, 53, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 65, 53, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 
-    52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 51, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 50, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 65, 53, 49, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 65, 53, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 65, 52, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 52, 
-    69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 52, 68, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 52, 67, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 65, 52, 66, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 65, 52, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 65, 52, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 52, 
-    56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 52, 55, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 52, 54, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 65, 52, 53, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 65, 52, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 65, 52, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 52, 
-    50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 52, 49, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 52, 48, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 65, 51, 70, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 65, 51, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 65, 51, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 51, 
-    67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 51, 66, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 51, 65, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 65, 51, 57, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 65, 51, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 65, 51, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 51, 
-    54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 51, 53, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 51, 52, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 65, 51, 51, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 65, 51, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 65, 51, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 51, 
-    48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 50, 70, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 50, 69, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 65, 50, 68, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 65, 50, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 65, 50, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 50, 
-    65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 50, 57, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 50, 56, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 65, 50, 55, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 65, 50, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 65, 50, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 50, 
-    52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 50, 51, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 50, 50, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 65, 50, 49, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 65, 50, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 65, 49, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 49, 
-    69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 49, 68, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 49, 67, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 65, 49, 66, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 65, 49, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 65, 49, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 49, 
-    56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 49, 55, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 49, 54, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 65, 49, 53, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 65, 49, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 65, 49, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 49, 
-    50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 49, 49, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 49, 48, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 65, 48, 70, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 65, 48, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 65, 48, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 48, 
-    67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 48, 66, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 48, 65, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 65, 48, 57, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 65, 48, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 65, 48, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 48, 
-    54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 48, 53, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 48, 52, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 65, 48, 51, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 65, 48, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 65, 48, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 48, 
-    48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 70, 70, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 70, 69, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 70, 68, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 70, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 57, 70, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 70, 
-    65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 70, 57, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 70, 56, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 70, 55, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 70, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 57, 70, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 70, 
-    52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 70, 51, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 70, 50, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 70, 49, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 70, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 57, 69, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 69, 
-    69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 69, 68, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 69, 67, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 69, 66, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 69, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 57, 69, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 69, 
-    56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 69, 55, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 69, 54, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 69, 53, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 69, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 57, 69, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 69, 
-    50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 69, 49, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 69, 48, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 68, 70, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 68, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 57, 68, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 68, 
-    67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 68, 66, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 68, 65, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 68, 57, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 68, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 57, 68, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 68, 
-    54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 68, 53, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 68, 52, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 68, 51, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 68, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 57, 68, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 68, 
-    48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 67, 70, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 67, 69, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 67, 68, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 67, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 57, 67, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 67, 
-    65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 67, 57, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 67, 56, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 67, 55, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 67, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 57, 67, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 67, 
-    52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 67, 51, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 67, 50, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 67, 49, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 67, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 57, 66, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 66, 
-    69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 66, 68, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 66, 67, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 66, 66, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 66, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 57, 66, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 66, 
-    56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 66, 55, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 66, 54, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 66, 53, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 66, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 57, 66, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 66, 
-    50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 66, 49, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 66, 48, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 65, 70, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 65, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 57, 65, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 65, 
-    67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 65, 66, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 65, 65, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 65, 57, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 65, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 57, 65, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 65, 
-    54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 65, 53, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 65, 52, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 65, 51, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 65, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 57, 65, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 65, 
-    48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 57, 70, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 57, 69, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 57, 68, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 57, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 57, 57, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 57, 
-    65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 57, 57, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 57, 56, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 57, 55, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 57, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 57, 57, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 57, 
-    52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 57, 51, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 57, 50, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 57, 49, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 57, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 57, 56, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 56, 
-    69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 56, 68, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 56, 67, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 56, 66, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 56, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 57, 56, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 56, 
-    56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 56, 55, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 56, 54, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 56, 53, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 56, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 57, 56, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 56, 
-    50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 56, 49, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 56, 48, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 55, 70, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 55, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 57, 55, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 55, 
-    67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 55, 66, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 55, 65, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 55, 57, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 55, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 57, 55, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 55, 
-    54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 55, 53, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 55, 52, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 55, 51, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 55, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 57, 55, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 55, 
-    48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 54, 70, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 54, 69, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 54, 68, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 54, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 57, 54, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 54, 
-    65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 54, 57, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 54, 56, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 54, 55, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 54, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 57, 54, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 54, 
-    52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 54, 51, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 54, 50, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 54, 49, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 54, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 57, 53, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 53, 
-    69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 53, 68, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 53, 67, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 53, 66, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 53, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 57, 53, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 53, 
-    56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 53, 55, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 53, 54, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 53, 53, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 53, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 57, 53, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 53, 
-    50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 53, 49, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 53, 48, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 52, 70, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 52, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 57, 52, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 52, 
-    67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 52, 66, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 52, 65, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 52, 57, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 52, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 57, 52, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 52, 
-    54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 52, 53, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 52, 52, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 52, 51, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 52, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 57, 52, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 52, 
-    48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 51, 70, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 51, 69, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 51, 68, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 51, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 57, 51, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 51, 
-    65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 51, 57, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 51, 56, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 51, 55, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 51, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 57, 51, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 51, 
-    52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 51, 51, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 51, 50, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 51, 49, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 51, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 57, 50, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 50, 
-    69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 50, 68, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 50, 67, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 50, 66, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 50, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 57, 50, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 50, 
-    56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 50, 55, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 50, 54, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 50, 53, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 50, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 57, 50, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 50, 
-    50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 50, 49, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 50, 48, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 49, 70, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 49, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 57, 49, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 49, 
-    67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 49, 66, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 49, 65, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 49, 57, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 49, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 57, 49, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 49, 
-    54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 49, 53, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 49, 52, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 49, 51, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 49, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 57, 49, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 49, 
-    48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 48, 70, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 48, 69, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 48, 68, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 48, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 57, 48, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 48, 
-    65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 48, 57, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 48, 56, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 48, 55, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 48, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    70, 57, 48, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 48, 
-    52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 48, 51, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 48, 50, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 70, 57, 48, 49, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 70, 57, 48, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    57, 48, 52, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 56, 68, 55, 
-    48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 56, 67, 65, 57, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 56, 57, 69, 51, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 55, 68, 52, 50, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 55, 65, 55, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    55, 57, 56, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 55, 54, 68, 
-    55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 55, 53, 51, 51, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 55, 53, 49, 70, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 55, 49, 50, 49, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 55, 48, 66, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    54, 70, 49, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 54, 69, 56, 
-    48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 54, 55, 50, 67, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 54, 55, 48, 57, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 54, 55, 48, 56, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 54, 54, 50, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    54, 53, 66, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 54, 53, 57, 
-    57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 54, 53, 53, 55, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 54, 51, 53, 53, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 54, 51, 48, 55, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 54, 50, 57, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    54, 50, 53, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 54, 50, 52, 
-    66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 53, 70, 56, 67, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 53, 68, 69, 54, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 53, 66, 56, 57, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 53, 66, 53, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    53, 57, 50, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 53, 57, 49, 
-    65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 53, 56, 70, 48, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 53, 53, 66, 54, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 53, 52, 51, 57, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 53, 52, 48, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    53, 51, 70, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 53, 51, 67, 
-    67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 53, 50, 68, 68, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 53, 50, 55, 50, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 53, 50, 52, 68, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 53, 50, 49, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    53, 49, 56, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 52, 69, 65, 
-    52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 52, 69, 56, 67, 128, 73, 
-    68, 69, 79, 71, 82, 65, 80, 72, 45, 52, 69, 50, 68, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 52, 69, 48, 57, 128, 73, 68, 69, 79, 71, 82, 65, 
-    80, 72, 45, 52, 69, 48, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 65, 49, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    65, 49, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 49, 
-    66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 49, 65, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 49, 57, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 49, 56, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 65, 49, 55, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 65, 49, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 65, 49, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 65, 49, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    65, 49, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 49, 
-    50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 49, 49, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 49, 48, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 48, 70, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 65, 48, 69, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 65, 48, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 65, 48, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 65, 48, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    65, 48, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 48, 
-    57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 48, 56, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 48, 55, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 48, 54, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 65, 48, 53, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 65, 48, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 65, 48, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 65, 48, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    65, 48, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 48, 
-    48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 70, 70, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 70, 69, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 70, 68, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 57, 70, 67, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 57, 70, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 57, 70, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 57, 70, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    57, 70, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 70, 
-    55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 70, 54, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 70, 53, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 70, 52, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 57, 70, 51, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 57, 70, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 57, 70, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 57, 70, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    57, 69, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 69, 
-    69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 69, 68, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 69, 67, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 69, 66, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 57, 69, 65, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 57, 69, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 57, 69, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 57, 69, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    57, 69, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 69, 
-    53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 69, 52, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 69, 51, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 69, 50, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 57, 69, 49, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 57, 69, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 57, 68, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 57, 68, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    57, 68, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 68, 
-    67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 68, 66, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 68, 65, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 68, 57, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 57, 68, 56, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 57, 68, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 57, 68, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 57, 68, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    57, 68, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 68, 
-    51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 68, 50, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 68, 49, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 68, 48, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 57, 67, 70, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 57, 67, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 57, 67, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 57, 67, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    57, 67, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 67, 
-    65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 67, 57, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 67, 56, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 67, 55, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 57, 67, 54, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 57, 67, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 57, 67, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 57, 67, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    57, 67, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 67, 
-    49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 67, 48, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 66, 70, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 66, 69, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 57, 66, 68, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 57, 66, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 57, 66, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 57, 66, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    57, 66, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 66, 
-    56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 66, 55, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 66, 54, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 66, 53, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 57, 66, 52, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 57, 66, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 57, 66, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 57, 66, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    57, 66, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 65, 
-    70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 65, 69, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 65, 68, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 65, 67, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 57, 65, 66, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 57, 65, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 57, 65, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 57, 65, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    57, 65, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 65, 
-    54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 65, 53, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 65, 52, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 65, 51, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 57, 65, 50, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 57, 65, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 57, 65, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 57, 57, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    57, 57, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 57, 
-    68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 57, 67, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 57, 66, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 57, 65, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 57, 57, 57, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 57, 57, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 57, 57, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 57, 57, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    57, 57, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 57, 
-    52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 57, 51, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 57, 50, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 57, 49, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 57, 57, 48, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 57, 56, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 57, 56, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 57, 56, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    57, 56, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 56, 
-    66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 56, 65, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 56, 57, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 56, 56, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 57, 56, 55, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 57, 56, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 57, 56, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 57, 56, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    57, 56, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 56, 
-    50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 56, 49, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 56, 48, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 55, 70, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 57, 55, 69, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 57, 55, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 57, 55, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 57, 55, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    57, 55, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 55, 
-    57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 55, 56, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 55, 55, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 55, 54, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 57, 55, 53, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 57, 55, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 57, 55, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 57, 55, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    57, 55, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 55, 
-    48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 54, 70, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 54, 69, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 54, 68, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 57, 54, 67, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 57, 54, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 57, 54, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 57, 54, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    57, 54, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 54, 
-    55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 54, 54, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 54, 53, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 54, 52, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 57, 54, 51, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 57, 54, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 57, 54, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 57, 54, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    57, 53, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 53, 
-    69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 53, 68, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 53, 67, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 53, 66, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 57, 53, 65, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 57, 53, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 57, 53, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 57, 53, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    57, 53, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 53, 
-    53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 53, 52, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 53, 51, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 53, 50, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 57, 53, 49, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 57, 53, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 57, 52, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 57, 52, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    57, 52, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 52, 
-    67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 52, 66, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 52, 65, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 52, 57, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 57, 52, 56, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 57, 52, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 57, 52, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 57, 52, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    57, 52, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 52, 
-    51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 52, 50, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 52, 49, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 52, 48, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 57, 51, 70, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 57, 51, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 57, 51, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 57, 51, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    57, 51, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 51, 
-    65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 51, 57, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 51, 56, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 51, 55, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 57, 51, 54, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 57, 51, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 57, 51, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 57, 51, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    57, 51, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 51, 
-    49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 51, 48, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 50, 70, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 50, 69, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 57, 50, 68, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 57, 50, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 57, 50, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 57, 50, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    57, 50, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 50, 
-    56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 50, 55, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 50, 54, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 50, 53, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 57, 50, 52, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 57, 50, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 57, 50, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 57, 50, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    57, 50, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 49, 
-    70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 49, 69, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 49, 68, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 49, 67, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 57, 49, 66, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 57, 49, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 57, 49, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 57, 49, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    57, 49, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 49, 
-    54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 49, 53, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 49, 52, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 49, 51, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 57, 49, 50, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 57, 49, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 57, 49, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 57, 48, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    57, 48, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 48, 
-    68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 48, 67, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 48, 66, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 48, 65, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 57, 48, 57, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 57, 48, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 57, 48, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 57, 48, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    57, 48, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 48, 
-    52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 48, 51, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 48, 50, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 48, 49, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 57, 48, 48, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 56, 70, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 56, 70, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 56, 70, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    56, 70, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 70, 
-    66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 70, 65, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 70, 57, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 70, 56, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 56, 70, 55, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 56, 70, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 56, 70, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 56, 70, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    56, 70, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 70, 
-    50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 70, 49, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 70, 48, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 69, 70, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 56, 69, 69, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 56, 69, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 56, 69, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 56, 69, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    56, 69, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 69, 
-    57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 69, 56, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 69, 55, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 69, 54, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 56, 69, 53, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 56, 69, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 56, 69, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 56, 69, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    56, 69, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 69, 
-    48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 68, 70, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 68, 69, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 68, 68, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 56, 68, 67, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 56, 68, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 56, 68, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 56, 68, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    56, 68, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 68, 
-    55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 68, 54, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 68, 53, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 68, 52, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 56, 68, 51, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 56, 68, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 56, 68, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 56, 68, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    56, 67, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 67, 
-    69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 67, 68, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 67, 67, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 67, 66, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 56, 67, 65, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 56, 67, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 56, 67, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 56, 67, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    56, 67, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 67, 
-    53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 67, 52, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 67, 51, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 67, 50, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 56, 67, 49, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 56, 67, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 56, 66, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 56, 66, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    56, 66, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 66, 
-    67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 66, 66, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 66, 65, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 66, 57, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 56, 66, 56, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 56, 66, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 56, 66, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 56, 66, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    56, 66, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 66, 
-    51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 66, 50, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 66, 49, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 66, 48, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 56, 65, 70, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 56, 65, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 56, 65, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 56, 65, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    56, 65, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 65, 
-    65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 65, 57, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 65, 56, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 65, 55, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 56, 65, 54, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 56, 65, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 56, 65, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 56, 65, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    56, 65, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 65, 
-    49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 65, 48, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 57, 70, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 57, 69, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 56, 57, 68, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 56, 57, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 56, 57, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 56, 57, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    56, 57, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 57, 
-    56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 57, 55, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 57, 54, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 57, 53, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 56, 57, 52, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 56, 57, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 56, 57, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 56, 57, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    56, 57, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 56, 
-    70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 56, 69, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 56, 68, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 56, 67, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 56, 56, 66, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 56, 56, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 56, 56, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 56, 56, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    56, 56, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 56, 
-    54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 56, 53, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 56, 52, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 56, 51, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 56, 56, 50, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 56, 56, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 56, 56, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 56, 55, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    56, 55, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 55, 
-    68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 55, 67, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 55, 66, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 55, 65, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 56, 55, 57, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 56, 55, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 56, 55, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 56, 55, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    56, 55, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 55, 
-    52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 55, 51, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 55, 50, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 55, 49, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 56, 55, 48, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 56, 54, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 56, 54, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 56, 54, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    56, 54, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 54, 
-    66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 54, 65, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 54, 57, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 54, 56, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 56, 54, 55, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 56, 54, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 56, 54, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 56, 54, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    56, 54, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 54, 
-    50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 54, 49, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 54, 48, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 53, 70, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 56, 53, 69, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 56, 53, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 56, 53, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 56, 53, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    56, 53, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 53, 
-    57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 53, 56, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 53, 55, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 53, 54, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 56, 53, 53, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 56, 53, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 56, 53, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 56, 53, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    56, 53, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 53, 
-    48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 52, 70, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 52, 69, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 52, 68, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 56, 52, 67, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 56, 52, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 56, 52, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 56, 52, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    56, 52, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 52, 
-    55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 52, 54, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 52, 53, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 52, 52, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 56, 52, 51, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 56, 52, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 56, 52, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 56, 52, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    56, 51, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 51, 
-    69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 51, 68, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 51, 67, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 51, 66, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 56, 51, 65, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 56, 51, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 56, 51, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 56, 51, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    56, 51, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 51, 
-    53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 51, 52, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 51, 51, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 51, 50, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 56, 51, 49, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 56, 51, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 56, 50, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 56, 50, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    56, 50, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 50, 
-    67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 50, 66, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 50, 65, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 50, 57, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 56, 50, 56, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 56, 50, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 56, 50, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 56, 50, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    56, 50, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 50, 
-    51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 50, 50, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 50, 49, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 50, 48, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 56, 49, 70, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 56, 49, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 56, 49, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 56, 49, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    56, 49, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 49, 
-    65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 49, 57, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 49, 56, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 49, 55, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 56, 49, 54, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 56, 49, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 56, 49, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 56, 49, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    56, 49, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 49, 
-    49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 49, 48, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 48, 70, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 48, 69, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 56, 48, 68, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 56, 48, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 56, 48, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 56, 48, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    56, 48, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 48, 
-    56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 48, 55, 128, 
-    73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 48, 54, 128, 73, 68, 
-    69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 48, 53, 128, 73, 68, 69, 79, 
-    71, 82, 65, 80, 72, 45, 50, 70, 56, 48, 52, 128, 73, 68, 69, 79, 71, 82, 
-    65, 80, 72, 45, 50, 70, 56, 48, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 
-    72, 45, 50, 70, 56, 48, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
-    50, 70, 56, 48, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 
-    56, 48, 48, 128, 73, 68, 69, 78, 84, 73, 70, 73, 67, 65, 84, 73, 79, 78, 
-    128, 73, 68, 69, 78, 84, 73, 67, 65, 204, 73, 67, 72, 79, 85, 128, 73, 
-    67, 72, 79, 83, 128, 73, 67, 72, 73, 77, 65, 84, 79, 83, 128, 73, 67, 72, 
-    65, 68, 73, 78, 128, 73, 67, 69, 76, 65, 78, 68, 73, 67, 45, 89, 82, 128, 
-    73, 66, 73, 70, 73, 76, 73, 128, 73, 65, 85, 68, 65, 128, 73, 48, 49, 53, 
-    128, 73, 48, 49, 52, 128, 73, 48, 49, 51, 128, 73, 48, 49, 50, 128, 73, 
-    48, 49, 49, 65, 128, 73, 48, 49, 49, 128, 73, 48, 49, 48, 65, 128, 73, 
-    48, 49, 48, 128, 73, 48, 48, 57, 65, 128, 73, 48, 48, 57, 128, 73, 48, 
-    48, 56, 128, 73, 48, 48, 55, 128, 73, 48, 48, 54, 128, 73, 48, 48, 53, 
-    65, 128, 73, 48, 48, 53, 128, 73, 48, 48, 52, 128, 73, 48, 48, 51, 128, 
-    73, 48, 48, 50, 128, 73, 48, 48, 49, 128, 73, 45, 89, 85, 128, 73, 45, 
-    89, 79, 128, 73, 45, 89, 69, 79, 128, 73, 45, 89, 69, 128, 73, 45, 89, 
-    65, 69, 128, 73, 45, 89, 65, 45, 79, 128, 73, 45, 89, 65, 128, 73, 45, 
-    79, 45, 73, 128, 73, 45, 79, 128, 73, 45, 69, 85, 128, 73, 45, 66, 69, 
-    65, 77, 128, 73, 45, 65, 82, 65, 69, 65, 128, 73, 45, 65, 128, 72, 90, 
-    90, 90, 71, 128, 72, 90, 90, 90, 128, 72, 90, 90, 80, 128, 72, 90, 90, 
-    128, 72, 90, 87, 71, 128, 72, 90, 87, 128, 72, 90, 84, 128, 72, 90, 71, 
-    128, 72, 89, 83, 84, 69, 82, 69, 83, 73, 211, 72, 89, 80, 79, 68, 73, 65, 
-    83, 84, 79, 76, 69, 128, 72, 89, 80, 72, 69, 78, 65, 84, 73, 79, 206, 72, 
-    89, 80, 72, 69, 78, 45, 77, 73, 78, 85, 83, 128, 72, 89, 80, 72, 69, 78, 
-    128, 72, 89, 80, 72, 69, 206, 72, 88, 87, 71, 128, 72, 88, 85, 79, 88, 
-    128, 72, 88, 85, 79, 84, 128, 72, 88, 85, 79, 80, 128, 72, 88, 85, 79, 
-    128, 72, 88, 79, 88, 128, 72, 88, 79, 84, 128, 72, 88, 79, 80, 128, 72, 
-    88, 79, 128, 72, 88, 73, 88, 128, 72, 88, 73, 84, 128, 72, 88, 73, 80, 
-    128, 72, 88, 73, 69, 88, 128, 72, 88, 73, 69, 84, 128, 72, 88, 73, 69, 
-    80, 128, 72, 88, 73, 69, 128, 72, 88, 73, 128, 72, 88, 69, 88, 128, 72, 
-    88, 69, 80, 128, 72, 88, 69, 128, 72, 88, 65, 88, 128, 72, 88, 65, 84, 
-    128, 72, 88, 65, 80, 128, 72, 88, 65, 128, 72, 87, 85, 128, 72, 87, 65, 
-    73, 82, 128, 72, 86, 128, 72, 85, 83, 72, 69, 196, 72, 85, 82, 65, 78, 
-    128, 72, 85, 79, 84, 128, 72, 85, 78, 68, 82, 69, 68, 128, 72, 85, 78, 
-    68, 82, 69, 196, 72, 85, 78, 128, 72, 85, 77, 65, 78, 128, 72, 85, 77, 
-    65, 206, 72, 85, 76, 50, 128, 72, 85, 73, 73, 84, 79, 128, 72, 85, 66, 
-    50, 128, 72, 85, 66, 178, 72, 85, 66, 128, 72, 85, 65, 82, 65, 68, 68, 
-    79, 128, 72, 84, 83, 128, 72, 84, 74, 128, 72, 82, 89, 86, 78, 73, 193, 
-    72, 80, 87, 71, 128, 72, 80, 65, 128, 72, 80, 128, 72, 79, 85, 83, 197, 
-    72, 79, 85, 82, 71, 76, 65, 83, 83, 128, 72, 79, 85, 82, 71, 76, 65, 83, 
-    211, 72, 79, 85, 82, 128, 72, 79, 85, 210, 72, 79, 84, 69, 76, 128, 72, 
-    79, 84, 65, 128, 72, 79, 83, 80, 73, 84, 65, 76, 128, 72, 79, 82, 83, 69, 
-    128, 72, 79, 82, 83, 197, 72, 79, 82, 78, 83, 128, 72, 79, 82, 73, 90, 
-    79, 78, 84, 65, 76, 76, 217, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 
-    48, 54, 45, 48, 54, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 
-    54, 45, 48, 53, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 54, 
-    45, 48, 52, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 54, 45, 
-    48, 51, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 54, 45, 48, 
-    50, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 54, 45, 48, 49, 
-    128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 54, 45, 48, 48, 128, 
-    72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 53, 45, 48, 54, 128, 72, 
-    79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 53, 45, 48, 53, 128, 72, 79, 
-    82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 53, 45, 48, 52, 128, 72, 79, 82, 
-    73, 90, 79, 78, 84, 65, 76, 45, 48, 53, 45, 48, 51, 128, 72, 79, 82, 73, 
-    90, 79, 78, 84, 65, 76, 45, 48, 53, 45, 48, 50, 128, 72, 79, 82, 73, 90, 
-    79, 78, 84, 65, 76, 45, 48, 53, 45, 48, 49, 128, 72, 79, 82, 73, 90, 79, 
-    78, 84, 65, 76, 45, 48, 53, 45, 48, 48, 128, 72, 79, 82, 73, 90, 79, 78, 
-    84, 65, 76, 45, 48, 52, 45, 48, 54, 128, 72, 79, 82, 73, 90, 79, 78, 84, 
-    65, 76, 45, 48, 52, 45, 48, 53, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 
-    76, 45, 48, 52, 45, 48, 52, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 
-    45, 48, 52, 45, 48, 51, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 
-    48, 52, 45, 48, 50, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 
-    52, 45, 48, 49, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 52, 
-    45, 48, 48, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 51, 45, 
-    48, 54, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 51, 45, 48, 
-    53, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 51, 45, 48, 52, 
-    128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 51, 45, 48, 51, 128, 
-    72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 51, 45, 48, 50, 128, 72, 
-    79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 51, 45, 48, 49, 128, 72, 79, 
-    82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 51, 45, 48, 48, 128, 72, 79, 82, 
-    73, 90, 79, 78, 84, 65, 76, 45, 48, 50, 45, 48, 54, 128, 72, 79, 82, 73, 
-    90, 79, 78, 84, 65, 76, 45, 48, 50, 45, 48, 53, 128, 72, 79, 82, 73, 90, 
-    79, 78, 84, 65, 76, 45, 48, 50, 45, 48, 52, 128, 72, 79, 82, 73, 90, 79, 
-    78, 84, 65, 76, 45, 48, 50, 45, 48, 51, 128, 72, 79, 82, 73, 90, 79, 78, 
-    84, 65, 76, 45, 48, 50, 45, 48, 50, 128, 72, 79, 82, 73, 90, 79, 78, 84, 
-    65, 76, 45, 48, 50, 45, 48, 49, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 
-    76, 45, 48, 50, 45, 48, 48, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 
-    45, 48, 49, 45, 48, 54, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 
-    48, 49, 45, 48, 53, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 
-    49, 45, 48, 52, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 49, 
-    45, 48, 51, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 49, 45, 
-    48, 50, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 49, 45, 48, 
-    49, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 49, 45, 48, 48, 
-    128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 48, 45, 48, 54, 128, 
-    72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 48, 45, 48, 53, 128, 72, 
-    79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 48, 45, 48, 52, 128, 72, 79, 
-    82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 48, 45, 48, 51, 128, 72, 79, 82, 
-    73, 90, 79, 78, 84, 65, 76, 45, 48, 48, 45, 48, 50, 128, 72, 79, 82, 73, 
-    90, 79, 78, 84, 65, 76, 45, 48, 48, 45, 48, 49, 128, 72, 79, 82, 73, 90, 
-    79, 78, 84, 65, 76, 45, 48, 48, 45, 48, 48, 128, 72, 79, 82, 73, 90, 79, 
-    78, 84, 65, 76, 128, 72, 79, 82, 73, 128, 72, 79, 82, 193, 72, 79, 79, 
-    82, 85, 128, 72, 79, 79, 80, 128, 72, 79, 79, 78, 128, 72, 79, 79, 75, 
-    69, 196, 72, 79, 78, 69, 89, 66, 69, 69, 128, 72, 79, 78, 69, 217, 72, 
-    79, 77, 79, 84, 72, 69, 84, 73, 67, 128, 72, 79, 77, 79, 84, 72, 69, 84, 
-    73, 195, 72, 79, 76, 69, 128, 72, 79, 76, 68, 73, 78, 199, 72, 79, 76, 
-    65, 77, 128, 72, 79, 76, 65, 205, 72, 79, 75, 65, 128, 72, 79, 73, 128, 
-    72, 79, 67, 72, 79, 128, 72, 78, 85, 84, 128, 72, 78, 85, 79, 88, 128, 
-    72, 78, 85, 79, 128, 72, 78, 79, 88, 128, 72, 78, 79, 84, 128, 72, 78, 
-    79, 80, 128, 72, 78, 73, 88, 128, 72, 78, 73, 84, 128, 72, 78, 73, 80, 
-    128, 72, 78, 73, 69, 88, 128, 72, 78, 73, 69, 84, 128, 72, 78, 73, 69, 
-    80, 128, 72, 78, 73, 69, 128, 72, 78, 73, 128, 72, 78, 69, 88, 128, 72, 
-    78, 69, 80, 128, 72, 78, 69, 128, 72, 78, 65, 88, 128, 72, 78, 65, 84, 
-    128, 72, 78, 65, 80, 128, 72, 78, 65, 128, 72, 77, 89, 88, 128, 72, 77, 
-    89, 82, 88, 128, 72, 77, 89, 82, 128, 72, 77, 89, 80, 128, 72, 77, 89, 
-    128, 72, 77, 85, 88, 128, 72, 77, 85, 84, 128, 72, 77, 85, 82, 88, 128, 
-    72, 77, 85, 82, 128, 72, 77, 85, 80, 128, 72, 77, 85, 79, 88, 128, 72, 
-    77, 85, 79, 80, 128, 72, 77, 85, 79, 128, 72, 77, 85, 128, 72, 77, 79, 
-    88, 128, 72, 77, 79, 84, 128, 72, 77, 79, 80, 128, 72, 77, 79, 128, 72, 
-    77, 73, 88, 128, 72, 77, 73, 84, 128, 72, 77, 73, 80, 128, 72, 77, 73, 
-    69, 88, 128, 72, 77, 73, 69, 80, 128, 72, 77, 73, 69, 128, 72, 77, 73, 
-    128, 72, 77, 69, 128, 72, 77, 65, 88, 128, 72, 77, 65, 84, 128, 72, 77, 
-    65, 80, 128, 72, 77, 65, 128, 72, 76, 89, 88, 128, 72, 76, 89, 84, 128, 
-    72, 76, 89, 82, 88, 128, 72, 76, 89, 82, 128, 72, 76, 89, 80, 128, 72, 
-    76, 89, 128, 72, 76, 85, 88, 128, 72, 76, 85, 84, 128, 72, 76, 85, 82, 
-    88, 128, 72, 76, 85, 82, 128, 72, 76, 85, 80, 128, 72, 76, 85, 79, 88, 
-    128, 72, 76, 85, 79, 80, 128, 72, 76, 85, 79, 128, 72, 76, 85, 128, 72, 
-    76, 79, 88, 128, 72, 76, 79, 80, 128, 72, 76, 79, 128, 72, 76, 73, 88, 
-    128, 72, 76, 73, 84, 128, 72, 76, 73, 80, 128, 72, 76, 73, 69, 88, 128, 
-    72, 76, 73, 69, 80, 128, 72, 76, 73, 69, 128, 72, 76, 73, 128, 72, 76, 
-    69, 88, 128, 72, 76, 69, 80, 128, 72, 76, 69, 128, 72, 76, 65, 88, 128, 
-    72, 76, 65, 84, 128, 72, 76, 65, 80, 128, 72, 76, 65, 128, 72, 75, 128, 
-    72, 73, 90, 66, 128, 72, 73, 83, 84, 79, 82, 73, 195, 72, 73, 82, 73, 81, 
-    128, 72, 73, 71, 72, 45, 83, 80, 69, 69, 196, 72, 73, 71, 72, 45, 82, 69, 
-    86, 69, 82, 83, 69, 68, 45, 185, 72, 73, 71, 72, 45, 72, 69, 69, 76, 69, 
-    196, 72, 73, 69, 88, 128, 72, 73, 69, 85, 72, 45, 83, 73, 79, 83, 128, 
-    72, 73, 69, 85, 72, 45, 82, 73, 69, 85, 76, 128, 72, 73, 69, 85, 72, 45, 
-    80, 73, 69, 85, 80, 128, 72, 73, 69, 85, 72, 45, 78, 73, 69, 85, 78, 128, 
-    72, 73, 69, 85, 72, 45, 77, 73, 69, 85, 77, 128, 72, 73, 69, 85, 200, 72, 
-    73, 69, 82, 79, 71, 76, 89, 80, 72, 73, 195, 72, 73, 69, 128, 72, 73, 68, 
-    73, 78, 199, 72, 73, 68, 69, 84, 128, 72, 73, 68, 69, 128, 72, 73, 66, 
-    73, 83, 67, 85, 83, 128, 72, 72, 87, 65, 128, 72, 72, 85, 128, 72, 72, 
-    73, 128, 72, 72, 69, 69, 128, 72, 72, 69, 128, 72, 72, 65, 65, 128, 72, 
-    71, 128, 72, 69, 88, 73, 70, 79, 82, 205, 72, 69, 88, 65, 71, 82, 65, 
-    205, 72, 69, 88, 65, 71, 79, 78, 128, 72, 69, 82, 85, 84, 85, 128, 72, 
-    69, 82, 85, 128, 72, 69, 82, 77, 73, 84, 73, 65, 206, 72, 69, 82, 77, 73, 
-    79, 78, 73, 65, 206, 72, 69, 82, 77, 69, 83, 128, 72, 69, 82, 69, 128, 
-    72, 69, 82, 66, 128, 72, 69, 82, 65, 69, 85, 205, 72, 69, 78, 71, 128, 
-    72, 69, 78, 199, 72, 69, 77, 80, 128, 72, 69, 76, 77, 69, 84, 128, 72, 
-    69, 76, 77, 69, 212, 72, 69, 76, 205, 72, 69, 76, 73, 67, 79, 80, 84, 69, 
-    82, 128, 72, 69, 75, 85, 84, 65, 65, 82, 85, 128, 72, 69, 73, 83, 69, 73, 
-    128, 72, 69, 65, 86, 89, 128, 72, 69, 65, 86, 69, 78, 76, 217, 72, 69, 
-    65, 86, 69, 78, 128, 72, 69, 65, 86, 69, 206, 72, 69, 65, 82, 84, 83, 
-    128, 72, 69, 65, 82, 84, 45, 83, 72, 65, 80, 69, 196, 72, 69, 65, 82, 84, 
-    128, 72, 69, 65, 82, 212, 72, 69, 65, 82, 45, 78, 79, 45, 69, 86, 73, 
-    204, 72, 69, 65, 68, 83, 84, 82, 79, 75, 69, 128, 72, 69, 65, 68, 83, 84, 
-    79, 78, 197, 72, 69, 65, 68, 80, 72, 79, 78, 69, 128, 72, 69, 65, 68, 73, 
-    78, 71, 128, 72, 66, 65, 83, 65, 45, 69, 83, 65, 83, 193, 72, 66, 65, 83, 
-    193, 72, 65, 89, 65, 78, 78, 65, 128, 72, 65, 86, 69, 128, 72, 65, 85, 
-    80, 84, 83, 84, 73, 77, 77, 69, 128, 72, 65, 84, 72, 73, 128, 72, 65, 84, 
-    69, 128, 72, 65, 84, 67, 72, 73, 78, 199, 72, 65, 84, 65, 198, 72, 65, 
-    83, 69, 210, 72, 65, 83, 65, 78, 84, 65, 128, 72, 65, 82, 80, 79, 79, 78, 
-    128, 72, 65, 82, 80, 79, 79, 206, 72, 65, 82, 77, 79, 78, 73, 67, 128, 
-    72, 65, 82, 75, 76, 69, 65, 206, 72, 65, 82, 68, 78, 69, 83, 83, 128, 72, 
-    65, 82, 196, 72, 65, 80, 80, 217, 72, 65, 78, 85, 78, 79, 207, 72, 65, 
-    78, 71, 90, 72, 79, 213, 72, 65, 78, 68, 83, 128, 72, 65, 78, 68, 211, 
-    72, 65, 78, 68, 76, 69, 83, 128, 72, 65, 78, 68, 76, 69, 128, 72, 65, 78, 
-    68, 66, 65, 71, 128, 72, 65, 78, 68, 128, 72, 65, 78, 45, 65, 75, 65, 84, 
-    128, 72, 65, 77, 90, 65, 128, 72, 65, 77, 83, 84, 69, 210, 72, 65, 77, 
-    77, 69, 82, 128, 72, 65, 77, 77, 69, 210, 72, 65, 77, 66, 85, 82, 71, 69, 
-    82, 128, 72, 65, 76, 81, 65, 128, 72, 65, 76, 79, 128, 72, 65, 76, 70, 
-    45, 67, 73, 82, 67, 76, 197, 72, 65, 76, 70, 128, 72, 65, 76, 66, 69, 82, 
-    68, 128, 72, 65, 76, 65, 78, 84, 65, 128, 72, 65, 73, 84, 85, 128, 72, 
-    65, 73, 82, 67, 85, 84, 128, 72, 65, 73, 82, 128, 72, 65, 71, 76, 65, 
-    218, 72, 65, 71, 76, 128, 72, 65, 70, 85, 75, 72, 65, 128, 72, 65, 70, 
-    85, 75, 72, 128, 72, 65, 69, 71, 204, 72, 65, 65, 82, 85, 128, 72, 65, 
-    65, 77, 128, 72, 65, 193, 72, 65, 45, 72, 65, 128, 72, 48, 48, 56, 128, 
-    72, 48, 48, 55, 128, 72, 48, 48, 54, 65, 128, 72, 48, 48, 54, 128, 72, 
-    48, 48, 53, 128, 72, 48, 48, 52, 128, 72, 48, 48, 51, 128, 72, 48, 48, 
-    50, 128, 72, 48, 48, 49, 128, 72, 45, 84, 89, 80, 197, 71, 89, 85, 128, 
-    71, 89, 79, 78, 128, 71, 89, 79, 128, 71, 89, 73, 128, 71, 89, 70, 213, 
-    71, 89, 69, 69, 128, 71, 89, 65, 83, 128, 71, 89, 65, 65, 128, 71, 89, 
-    65, 128, 71, 89, 128, 71, 87, 85, 128, 71, 87, 73, 128, 71, 87, 69, 69, 
-    128, 71, 87, 69, 128, 71, 87, 65, 65, 128, 71, 87, 65, 128, 71, 86, 128, 
-    71, 85, 82, 85, 83, 72, 128, 71, 85, 82, 85, 78, 128, 71, 85, 82, 65, 77, 
-    85, 84, 79, 78, 128, 71, 85, 82, 55, 128, 71, 85, 78, 85, 128, 71, 85, 
-    78, 213, 71, 85, 205, 71, 85, 76, 128, 71, 85, 73, 84, 65, 82, 128, 71, 
-    85, 199, 71, 85, 69, 72, 128, 71, 85, 69, 200, 71, 85, 68, 128, 71, 85, 
-    196, 71, 85, 65, 82, 68, 83, 77, 65, 78, 128, 71, 85, 65, 82, 68, 69, 68, 
-    78, 69, 83, 83, 128, 71, 85, 65, 82, 68, 69, 196, 71, 85, 65, 82, 68, 
-    128, 71, 85, 65, 82, 65, 78, 201, 71, 85, 193, 71, 85, 178, 71, 84, 69, 
-    210, 71, 83, 85, 77, 128, 71, 83, 85, 205, 71, 82, 213, 71, 82, 79, 87, 
-    73, 78, 199, 71, 82, 79, 85, 78, 68, 128, 71, 82, 79, 78, 84, 72, 73, 83, 
-    77, 65, 84, 65, 128, 71, 82, 73, 78, 78, 73, 78, 199, 71, 82, 73, 77, 65, 
-    67, 73, 78, 199, 71, 82, 69, 71, 79, 82, 73, 65, 206, 71, 82, 69, 69, 
-    206, 71, 82, 69, 65, 84, 78, 69, 83, 83, 128, 71, 82, 69, 65, 84, 69, 82, 
-    45, 84, 72, 65, 78, 128, 71, 82, 69, 65, 84, 69, 82, 45, 84, 72, 65, 206, 
-    71, 82, 69, 65, 84, 69, 210, 71, 82, 69, 65, 212, 71, 82, 65, 86, 69, 89, 
-    65, 82, 196, 71, 82, 65, 86, 69, 45, 77, 65, 67, 82, 79, 78, 128, 71, 82, 
-    65, 86, 69, 45, 65, 67, 85, 84, 69, 45, 71, 82, 65, 86, 69, 128, 71, 82, 
-    65, 86, 197, 71, 82, 65, 84, 69, 82, 128, 71, 82, 65, 83, 83, 128, 71, 
-    82, 65, 83, 211, 71, 82, 65, 80, 72, 69, 77, 197, 71, 82, 65, 80, 69, 83, 
-    128, 71, 82, 65, 77, 77, 193, 71, 82, 65, 73, 78, 128, 71, 82, 65, 68, 
-    85, 65, 84, 73, 79, 206, 71, 82, 65, 67, 69, 128, 71, 82, 65, 67, 197, 
-    71, 80, 65, 128, 71, 79, 82, 84, 72, 77, 73, 75, 79, 206, 71, 79, 82, 84, 
-    128, 71, 79, 82, 71, 79, 84, 69, 82, 73, 128, 71, 79, 82, 71, 79, 83, 89, 
-    78, 84, 72, 69, 84, 79, 78, 128, 71, 79, 82, 71, 79, 206, 71, 79, 82, 71, 
-    73, 128, 71, 79, 82, 65, 128, 71, 79, 79, 196, 71, 79, 78, 71, 128, 71, 
-    79, 76, 68, 128, 71, 79, 75, 128, 71, 79, 73, 78, 199, 71, 79, 66, 76, 
-    73, 78, 128, 71, 79, 65, 76, 128, 71, 79, 65, 204, 71, 79, 65, 128, 71, 
-    78, 89, 73, 83, 128, 71, 78, 65, 86, 73, 89, 65, 78, 73, 128, 71, 76, 79, 
-    87, 73, 78, 199, 71, 76, 79, 84, 84, 65, 204, 71, 76, 79, 66, 197, 71, 
-    76, 73, 83, 83, 65, 78, 68, 207, 71, 76, 69, 73, 67, 200, 71, 76, 65, 71, 
-    79, 76, 73, 128, 71, 76, 65, 128, 71, 74, 69, 128, 71, 73, 88, 128, 71, 
-    73, 84, 128, 71, 73, 83, 72, 128, 71, 73, 83, 200, 71, 73, 83, 65, 76, 
-    128, 71, 73, 82, 85, 68, 65, 65, 128, 71, 73, 82, 76, 128, 71, 73, 82, 
-    51, 128, 71, 73, 82, 179, 71, 73, 82, 50, 128, 71, 73, 82, 178, 71, 73, 
-    80, 128, 71, 73, 78, 73, 73, 128, 71, 73, 77, 69, 76, 128, 71, 73, 77, 
-    69, 204, 71, 73, 77, 128, 71, 73, 71, 65, 128, 71, 73, 69, 84, 128, 71, 
-    73, 68, 73, 77, 128, 71, 73, 66, 66, 79, 85, 211, 71, 73, 66, 65, 128, 
-    71, 73, 52, 128, 71, 73, 180, 71, 72, 90, 128, 71, 72, 87, 65, 128, 71, 
-    72, 85, 78, 78, 65, 128, 71, 72, 85, 78, 78, 193, 71, 72, 85, 128, 71, 
-    72, 79, 85, 128, 71, 72, 79, 83, 84, 128, 71, 72, 79, 128, 71, 72, 73, 
-    128, 71, 72, 72, 65, 128, 71, 72, 69, 85, 88, 128, 71, 72, 69, 85, 78, 
-    128, 71, 72, 69, 85, 71, 72, 69, 85, 65, 69, 77, 128, 71, 72, 69, 85, 71, 
-    72, 69, 78, 128, 71, 72, 69, 85, 65, 69, 82, 65, 69, 128, 71, 72, 69, 85, 
-    65, 69, 71, 72, 69, 85, 65, 69, 128, 71, 72, 69, 84, 128, 71, 72, 69, 69, 
-    128, 71, 72, 69, 128, 71, 72, 197, 71, 72, 65, 89, 78, 128, 71, 72, 65, 
-    82, 65, 69, 128, 71, 72, 65, 80, 128, 71, 72, 65, 78, 128, 71, 72, 65, 
-    77, 65, 76, 128, 71, 72, 65, 73, 78, 85, 128, 71, 72, 65, 73, 78, 128, 
-    71, 72, 65, 73, 206, 71, 72, 65, 68, 128, 71, 72, 65, 65, 77, 65, 69, 
-    128, 71, 72, 65, 65, 128, 71, 71, 87, 73, 128, 71, 71, 87, 69, 69, 128, 
-    71, 71, 87, 69, 128, 71, 71, 87, 65, 65, 128, 71, 71, 87, 65, 128, 71, 
-    71, 85, 88, 128, 71, 71, 85, 84, 128, 71, 71, 85, 82, 88, 128, 71, 71, 
-    85, 82, 128, 71, 71, 85, 79, 88, 128, 71, 71, 85, 79, 84, 128, 71, 71, 
-    85, 79, 80, 128, 71, 71, 85, 79, 128, 71, 71, 79, 88, 128, 71, 71, 79, 
-    84, 128, 71, 71, 79, 80, 128, 71, 71, 73, 88, 128, 71, 71, 73, 84, 128, 
-    71, 71, 73, 69, 88, 128, 71, 71, 73, 69, 80, 128, 71, 71, 73, 69, 128, 
-    71, 71, 69, 88, 128, 71, 71, 69, 84, 128, 71, 71, 69, 80, 128, 71, 71, 
-    65, 88, 128, 71, 71, 65, 84, 128, 71, 71, 65, 65, 128, 71, 69, 84, 193, 
-    71, 69, 83, 84, 85, 82, 69, 128, 71, 69, 83, 72, 85, 128, 71, 69, 83, 72, 
-    84, 73, 78, 128, 71, 69, 83, 72, 84, 73, 206, 71, 69, 83, 72, 50, 128, 
-    71, 69, 82, 83, 72, 65, 89, 73, 77, 128, 71, 69, 82, 77, 65, 206, 71, 69, 
-    82, 69, 83, 72, 128, 71, 69, 82, 69, 83, 200, 71, 69, 79, 77, 69, 84, 82, 
-    73, 67, 65, 76, 76, 217, 71, 69, 79, 77, 69, 84, 82, 73, 195, 71, 69, 78, 
-    84, 76, 197, 71, 69, 78, 73, 84, 73, 86, 69, 128, 71, 69, 78, 73, 75, 
-    201, 71, 69, 78, 69, 82, 73, 195, 71, 69, 77, 73, 78, 73, 128, 71, 69, 
-    77, 73, 78, 65, 84, 73, 79, 206, 71, 69, 205, 71, 69, 68, 79, 76, 65, 
-    128, 71, 69, 68, 69, 128, 71, 69, 66, 207, 71, 69, 66, 193, 71, 69, 65, 
-    82, 128, 71, 69, 65, 210, 71, 68, 65, 78, 128, 71, 67, 73, 71, 128, 71, 
-    67, 65, 206, 71, 66, 79, 78, 128, 71, 66, 73, 69, 197, 71, 66, 69, 85, 
-    88, 128, 71, 66, 69, 84, 128, 71, 66, 65, 89, 73, 128, 71, 66, 65, 75, 
-    85, 82, 85, 78, 69, 78, 128, 71, 66, 128, 71, 65, 89, 65, 78, 85, 75, 73, 
-    84, 84, 65, 128, 71, 65, 89, 65, 78, 78, 65, 128, 71, 65, 89, 128, 71, 
-    65, 85, 78, 84, 76, 69, 84, 128, 71, 65, 84, 72, 69, 82, 73, 78, 71, 128, 
-    71, 65, 84, 72, 69, 82, 73, 78, 199, 71, 65, 84, 69, 128, 71, 65, 83, 72, 
-    65, 78, 128, 71, 65, 82, 83, 72, 85, 78, 73, 128, 71, 65, 82, 79, 78, 
-    128, 71, 65, 82, 77, 69, 78, 84, 128, 71, 65, 82, 68, 69, 78, 128, 71, 
-    65, 82, 51, 128, 71, 65, 80, 80, 69, 196, 71, 65, 208, 71, 65, 78, 77, 
-    65, 128, 71, 65, 78, 71, 73, 65, 128, 71, 65, 78, 68, 193, 71, 65, 78, 
-    50, 128, 71, 65, 78, 178, 71, 65, 77, 77, 65, 128, 71, 65, 77, 76, 65, 
-    128, 71, 65, 77, 76, 128, 71, 65, 77, 69, 128, 71, 65, 77, 197, 71, 65, 
-    77, 65, 78, 128, 71, 65, 77, 65, 76, 128, 71, 65, 77, 65, 204, 71, 65, 
-    71, 128, 71, 65, 70, 128, 71, 65, 198, 71, 65, 69, 84, 84, 65, 45, 80, 
-    73, 76, 76, 65, 128, 71, 65, 68, 79, 76, 128, 71, 65, 68, 128, 71, 65, 
-    196, 71, 65, 66, 65, 128, 71, 65, 66, 193, 71, 65, 65, 70, 85, 128, 71, 
-    65, 178, 71, 48, 53, 52, 128, 71, 48, 53, 51, 128, 71, 48, 53, 50, 128, 
-    71, 48, 53, 49, 128, 71, 48, 53, 48, 128, 71, 48, 52, 57, 128, 71, 48, 
-    52, 56, 128, 71, 48, 52, 55, 128, 71, 48, 52, 54, 128, 71, 48, 52, 53, 
-    65, 128, 71, 48, 52, 53, 128, 71, 48, 52, 52, 128, 71, 48, 52, 51, 65, 
-    128, 71, 48, 52, 51, 128, 71, 48, 52, 50, 128, 71, 48, 52, 49, 128, 71, 
-    48, 52, 48, 128, 71, 48, 51, 57, 128, 71, 48, 51, 56, 128, 71, 48, 51, 
-    55, 65, 128, 71, 48, 51, 55, 128, 71, 48, 51, 54, 65, 128, 71, 48, 51, 
-    54, 128, 71, 48, 51, 53, 128, 71, 48, 51, 52, 128, 71, 48, 51, 51, 128, 
-    71, 48, 51, 50, 128, 71, 48, 51, 49, 128, 71, 48, 51, 48, 128, 71, 48, 
-    50, 57, 128, 71, 48, 50, 56, 128, 71, 48, 50, 55, 128, 71, 48, 50, 54, 
-    65, 128, 71, 48, 50, 54, 128, 71, 48, 50, 53, 128, 71, 48, 50, 52, 128, 
-    71, 48, 50, 51, 128, 71, 48, 50, 50, 128, 71, 48, 50, 49, 128, 71, 48, 
-    50, 48, 65, 128, 71, 48, 50, 48, 128, 71, 48, 49, 57, 128, 71, 48, 49, 
-    56, 128, 71, 48, 49, 55, 128, 71, 48, 49, 54, 128, 71, 48, 49, 53, 128, 
-    71, 48, 49, 52, 128, 71, 48, 49, 51, 128, 71, 48, 49, 50, 128, 71, 48, 
-    49, 49, 65, 128, 71, 48, 49, 49, 128, 71, 48, 49, 48, 128, 71, 48, 48, 
-    57, 128, 71, 48, 48, 56, 128, 71, 48, 48, 55, 66, 128, 71, 48, 48, 55, 
-    65, 128, 71, 48, 48, 55, 128, 71, 48, 48, 54, 65, 128, 71, 48, 48, 54, 
-    128, 71, 48, 48, 53, 128, 71, 48, 48, 52, 128, 71, 48, 48, 51, 128, 71, 
-    48, 48, 50, 128, 71, 48, 48, 49, 128, 70, 89, 88, 128, 70, 89, 84, 128, 
-    70, 89, 80, 128, 70, 89, 65, 128, 70, 87, 73, 128, 70, 87, 69, 69, 128, 
-    70, 87, 69, 128, 70, 87, 65, 65, 128, 70, 87, 65, 128, 70, 86, 83, 51, 
-    128, 70, 86, 83, 50, 128, 70, 86, 83, 49, 128, 70, 85, 88, 128, 70, 85, 
-    84, 128, 70, 85, 83, 69, 128, 70, 85, 83, 193, 70, 85, 82, 88, 128, 70, 
-    85, 80, 128, 70, 85, 78, 69, 82, 65, 204, 70, 85, 78, 67, 84, 73, 79, 78, 
-    65, 204, 70, 85, 78, 67, 84, 73, 79, 78, 128, 70, 85, 76, 76, 78, 69, 83, 
-    83, 128, 70, 85, 76, 204, 70, 85, 74, 73, 128, 70, 85, 69, 84, 128, 70, 
-    85, 69, 204, 70, 85, 69, 128, 70, 84, 72, 79, 82, 193, 70, 82, 79, 87, 
-    78, 73, 78, 71, 128, 70, 82, 79, 87, 78, 73, 78, 199, 70, 82, 79, 87, 78, 
-    128, 70, 82, 79, 78, 84, 45, 84, 73, 76, 84, 69, 196, 70, 82, 79, 78, 84, 
-    45, 70, 65, 67, 73, 78, 199, 70, 82, 79, 205, 70, 82, 79, 71, 128, 70, 
-    82, 79, 199, 70, 82, 73, 84, 85, 128, 70, 82, 73, 69, 83, 128, 70, 82, 
-    73, 69, 196, 70, 82, 73, 67, 65, 84, 73, 86, 69, 128, 70, 82, 69, 84, 66, 
-    79, 65, 82, 68, 128, 70, 82, 69, 78, 67, 200, 70, 82, 69, 69, 128, 70, 
-    82, 69, 197, 70, 82, 65, 78, 195, 70, 82, 65, 77, 69, 128, 70, 82, 65, 
-    71, 82, 65, 78, 84, 128, 70, 82, 65, 71, 77, 69, 78, 84, 128, 70, 82, 65, 
-    67, 84, 73, 79, 206, 70, 79, 88, 128, 70, 79, 85, 82, 84, 69, 69, 78, 
-    128, 70, 79, 85, 82, 84, 69, 69, 206, 70, 79, 85, 82, 45, 84, 72, 73, 82, 
-    84, 89, 128, 70, 79, 85, 82, 45, 83, 84, 82, 73, 78, 199, 70, 79, 85, 82, 
-    45, 80, 69, 82, 45, 69, 205, 70, 79, 85, 82, 45, 76, 73, 78, 197, 70, 79, 
-    85, 210, 70, 79, 85, 78, 84, 65, 73, 78, 128, 70, 79, 83, 84, 69, 82, 73, 
-    78, 71, 128, 70, 79, 82, 87, 65, 82, 68, 128, 70, 79, 82, 84, 89, 128, 
-    70, 79, 82, 84, 217, 70, 79, 82, 84, 69, 128, 70, 79, 82, 77, 211, 70, 
-    79, 82, 77, 65, 84, 84, 73, 78, 71, 128, 70, 79, 82, 75, 69, 196, 70, 79, 
-    82, 67, 69, 83, 128, 70, 79, 82, 67, 69, 128, 70, 79, 80, 128, 70, 79, 
-    79, 84, 83, 84, 79, 79, 76, 128, 70, 79, 79, 84, 80, 82, 73, 78, 84, 83, 
-    128, 70, 79, 79, 84, 78, 79, 84, 197, 70, 79, 79, 84, 66, 65, 76, 76, 
-    128, 70, 79, 79, 84, 128, 70, 79, 79, 68, 128, 70, 79, 79, 128, 70, 79, 
-    78, 71, 77, 65, 78, 128, 70, 79, 77, 128, 70, 79, 76, 76, 89, 128, 70, 
-    79, 76, 76, 79, 87, 73, 78, 71, 128, 70, 79, 76, 68, 69, 82, 128, 70, 79, 
-    76, 68, 69, 196, 70, 79, 71, 71, 89, 128, 70, 207, 70, 77, 128, 70, 76, 
-    89, 128, 70, 76, 85, 84, 84, 69, 82, 73, 78, 199, 70, 76, 85, 84, 69, 
-    128, 70, 76, 85, 83, 72, 69, 196, 70, 76, 79, 87, 73, 78, 199, 70, 76, 
-    79, 87, 69, 210, 70, 76, 79, 85, 82, 73, 83, 72, 128, 70, 76, 79, 82, 69, 
-    84, 84, 69, 128, 70, 76, 79, 82, 65, 204, 70, 76, 79, 80, 80, 217, 70, 
-    76, 79, 79, 82, 128, 70, 76, 73, 80, 128, 70, 76, 73, 71, 72, 84, 128, 
-    70, 76, 69, 88, 85, 83, 128, 70, 76, 69, 88, 69, 196, 70, 76, 69, 85, 82, 
-    45, 68, 69, 45, 76, 73, 83, 128, 70, 76, 65, 84, 84, 69, 78, 69, 196, 70, 
-    76, 65, 84, 78, 69, 83, 83, 128, 70, 76, 65, 84, 128, 70, 76, 65, 212, 
-    70, 76, 65, 71, 83, 128, 70, 76, 65, 71, 45, 53, 128, 70, 76, 65, 71, 45, 
-    52, 128, 70, 76, 65, 71, 45, 51, 128, 70, 76, 65, 71, 45, 50, 128, 70, 
-    76, 65, 71, 45, 49, 128, 70, 76, 65, 71, 128, 70, 76, 65, 199, 70, 76, 
-    65, 128, 70, 76, 128, 70, 73, 88, 69, 68, 45, 70, 79, 82, 205, 70, 73, 
-    88, 128, 70, 73, 86, 69, 45, 84, 72, 73, 82, 84, 89, 128, 70, 73, 86, 69, 
-    45, 76, 73, 78, 197, 70, 73, 86, 197, 70, 73, 84, 65, 128, 70, 73, 84, 
-    128, 70, 73, 83, 84, 69, 196, 70, 73, 83, 84, 128, 70, 73, 83, 72, 73, 
-    78, 199, 70, 73, 83, 72, 72, 79, 79, 75, 128, 70, 73, 83, 72, 72, 79, 79, 
-    203, 70, 73, 83, 72, 69, 89, 69, 128, 70, 73, 83, 72, 128, 70, 73, 83, 
-    200, 70, 73, 82, 83, 212, 70, 73, 82, 73, 128, 70, 73, 82, 69, 87, 79, 
-    82, 75, 83, 128, 70, 73, 82, 69, 87, 79, 82, 203, 70, 73, 82, 69, 128, 
-    70, 73, 82, 197, 70, 73, 80, 128, 70, 73, 78, 73, 84, 197, 70, 73, 78, 
-    71, 69, 82, 78, 65, 73, 76, 83, 128, 70, 73, 78, 71, 69, 82, 69, 196, 70, 
-    73, 78, 65, 78, 67, 73, 65, 76, 128, 70, 73, 76, 76, 69, 82, 128, 70, 73, 
-    76, 76, 69, 196, 70, 73, 76, 76, 128, 70, 73, 76, 204, 70, 73, 76, 197, 
-    70, 73, 73, 128, 70, 73, 71, 85, 82, 69, 45, 51, 128, 70, 73, 71, 85, 82, 
-    69, 45, 50, 128, 70, 73, 71, 85, 82, 69, 45, 49, 128, 70, 73, 71, 85, 82, 
-    197, 70, 73, 71, 72, 84, 128, 70, 73, 70, 84, 89, 128, 70, 73, 70, 84, 
-    217, 70, 73, 70, 84, 72, 83, 128, 70, 73, 70, 84, 72, 128, 70, 73, 70, 
-    84, 69, 69, 78, 128, 70, 73, 70, 84, 69, 69, 206, 70, 73, 69, 76, 68, 
-    128, 70, 72, 84, 79, 82, 193, 70, 70, 76, 128, 70, 70, 73, 128, 70, 69, 
-    85, 88, 128, 70, 69, 85, 70, 69, 85, 65, 69, 84, 128, 70, 69, 83, 84, 73, 
-    86, 65, 76, 128, 70, 69, 82, 82, 89, 128, 70, 69, 82, 82, 73, 211, 70, 
-    69, 82, 77, 65, 84, 65, 128, 70, 69, 82, 77, 65, 84, 193, 70, 69, 79, 
-    200, 70, 69, 78, 199, 70, 69, 78, 67, 69, 128, 70, 69, 77, 73, 78, 73, 
-    78, 197, 70, 69, 77, 65, 76, 69, 128, 70, 69, 77, 65, 76, 197, 70, 69, 
-    76, 76, 79, 87, 83, 72, 73, 80, 128, 70, 69, 73, 128, 70, 69, 72, 213, 
-    70, 69, 72, 128, 70, 69, 200, 70, 69, 69, 78, 71, 128, 70, 69, 69, 68, 
-    128, 70, 69, 69, 196, 70, 69, 69, 128, 70, 69, 66, 82, 85, 65, 82, 89, 
-    128, 70, 69, 65, 84, 72, 69, 82, 128, 70, 69, 65, 84, 72, 69, 210, 70, 
-    69, 65, 82, 78, 128, 70, 69, 65, 82, 70, 85, 204, 70, 69, 65, 82, 128, 
-    70, 65, 89, 65, 78, 78, 65, 128, 70, 65, 89, 128, 70, 65, 88, 128, 70, 
-    65, 216, 70, 65, 84, 73, 71, 85, 69, 128, 70, 65, 84, 72, 69, 82, 128, 
-    70, 65, 84, 72, 69, 210, 70, 65, 84, 72, 65, 84, 65, 78, 128, 70, 65, 84, 
-    72, 65, 84, 65, 206, 70, 65, 84, 72, 65, 128, 70, 65, 84, 72, 193, 70, 
-    65, 84, 128, 70, 65, 82, 83, 201, 70, 65, 81, 128, 70, 65, 80, 128, 70, 
-    65, 78, 71, 128, 70, 65, 78, 69, 82, 79, 83, 73, 211, 70, 65, 78, 128, 
-    70, 65, 77, 73, 76, 89, 128, 70, 65, 76, 76, 73, 78, 199, 70, 65, 76, 76, 
-    69, 206, 70, 65, 73, 76, 85, 82, 69, 128, 70, 65, 73, 72, 85, 128, 70, 
-    65, 72, 82, 69, 78, 72, 69, 73, 84, 128, 70, 65, 67, 84, 79, 82, 89, 128, 
-    70, 65, 67, 84, 79, 210, 70, 65, 67, 83, 73, 77, 73, 76, 197, 70, 65, 67, 
-    69, 45, 54, 128, 70, 65, 67, 69, 45, 53, 128, 70, 65, 67, 69, 45, 52, 
-    128, 70, 65, 67, 69, 45, 51, 128, 70, 65, 67, 69, 45, 50, 128, 70, 65, 
-    67, 69, 45, 49, 128, 70, 65, 65, 77, 65, 69, 128, 70, 65, 65, 73, 128, 
-    70, 65, 65, 70, 85, 128, 70, 48, 53, 51, 128, 70, 48, 53, 50, 128, 70, 
-    48, 53, 49, 67, 128, 70, 48, 53, 49, 66, 128, 70, 48, 53, 49, 65, 128, 
-    70, 48, 53, 49, 128, 70, 48, 53, 48, 128, 70, 48, 52, 57, 128, 70, 48, 
-    52, 56, 128, 70, 48, 52, 55, 65, 128, 70, 48, 52, 55, 128, 70, 48, 52, 
-    54, 65, 128, 70, 48, 52, 54, 128, 70, 48, 52, 53, 65, 128, 70, 48, 52, 
-    53, 128, 70, 48, 52, 52, 128, 70, 48, 52, 51, 128, 70, 48, 52, 50, 128, 
-    70, 48, 52, 49, 128, 70, 48, 52, 48, 128, 70, 48, 51, 57, 128, 70, 48, 
-    51, 56, 65, 128, 70, 48, 51, 56, 128, 70, 48, 51, 55, 65, 128, 70, 48, 
-    51, 55, 128, 70, 48, 51, 54, 128, 70, 48, 51, 53, 128, 70, 48, 51, 52, 
-    128, 70, 48, 51, 51, 128, 70, 48, 51, 50, 128, 70, 48, 51, 49, 65, 128, 
-    70, 48, 51, 49, 128, 70, 48, 51, 48, 128, 70, 48, 50, 57, 128, 70, 48, 
-    50, 56, 128, 70, 48, 50, 55, 128, 70, 48, 50, 54, 128, 70, 48, 50, 53, 
-    128, 70, 48, 50, 52, 128, 70, 48, 50, 51, 128, 70, 48, 50, 50, 128, 70, 
-    48, 50, 49, 65, 128, 70, 48, 50, 49, 128, 70, 48, 50, 48, 128, 70, 48, 
-    49, 57, 128, 70, 48, 49, 56, 128, 70, 48, 49, 55, 128, 70, 48, 49, 54, 
-    128, 70, 48, 49, 53, 128, 70, 48, 49, 52, 128, 70, 48, 49, 51, 65, 128, 
-    70, 48, 49, 51, 128, 70, 48, 49, 50, 128, 70, 48, 49, 49, 128, 70, 48, 
-    49, 48, 128, 70, 48, 48, 57, 128, 70, 48, 48, 56, 128, 70, 48, 48, 55, 
-    128, 70, 48, 48, 54, 128, 70, 48, 48, 53, 128, 70, 48, 48, 52, 128, 70, 
-    48, 48, 51, 128, 70, 48, 48, 50, 128, 70, 48, 48, 49, 65, 128, 70, 48, 
-    48, 49, 128, 69, 90, 200, 69, 90, 69, 78, 128, 69, 90, 69, 206, 69, 90, 
-    128, 69, 89, 69, 83, 128, 69, 89, 69, 71, 76, 65, 83, 83, 69, 83, 128, 
-    69, 89, 66, 69, 89, 70, 73, 76, 73, 128, 69, 89, 65, 78, 78, 65, 128, 69, 
-    88, 84, 82, 65, 84, 69, 82, 82, 69, 83, 84, 82, 73, 65, 204, 69, 88, 84, 
-    82, 65, 45, 76, 79, 215, 69, 88, 84, 82, 65, 45, 72, 73, 71, 200, 69, 88, 
-    84, 69, 78, 83, 73, 79, 78, 128, 69, 88, 84, 69, 78, 68, 69, 196, 69, 88, 
-    80, 82, 69, 83, 83, 73, 79, 78, 76, 69, 83, 211, 69, 88, 80, 79, 78, 69, 
-    78, 212, 69, 88, 79, 128, 69, 88, 207, 69, 88, 73, 83, 84, 83, 128, 69, 
-    88, 73, 83, 84, 128, 69, 88, 72, 65, 85, 83, 84, 73, 79, 78, 128, 69, 88, 
-    67, 76, 65, 77, 65, 84, 73, 79, 78, 128, 69, 88, 67, 76, 65, 77, 65, 84, 
-    73, 79, 206, 69, 88, 67, 72, 65, 78, 71, 69, 128, 69, 88, 67, 69, 83, 83, 
-    128, 69, 88, 67, 69, 76, 76, 69, 78, 84, 128, 69, 87, 69, 128, 69, 86, 
-    69, 82, 71, 82, 69, 69, 206, 69, 86, 69, 78, 73, 78, 71, 128, 69, 85, 82, 
-    79, 80, 69, 65, 206, 69, 85, 82, 79, 80, 69, 45, 65, 70, 82, 73, 67, 65, 
-    128, 69, 85, 82, 79, 45, 67, 85, 82, 82, 69, 78, 67, 217, 69, 85, 82, 
-    207, 69, 85, 76, 69, 210, 69, 85, 45, 85, 128, 69, 85, 45, 79, 128, 69, 
-    85, 45, 69, 85, 128, 69, 85, 45, 69, 79, 128, 69, 85, 45, 69, 128, 69, 
-    85, 45, 65, 128, 69, 84, 88, 128, 69, 84, 78, 65, 72, 84, 65, 128, 69, 
-    84, 72, 69, 204, 69, 84, 69, 82, 79, 206, 69, 84, 69, 82, 78, 73, 84, 89, 
-    128, 69, 84, 66, 128, 69, 83, 85, 75, 85, 85, 68, 79, 128, 69, 83, 84, 
-    73, 77, 65, 84, 69, 83, 128, 69, 83, 84, 73, 77, 65, 84, 69, 196, 69, 83, 
-    72, 69, 51, 128, 69, 83, 72, 50, 49, 128, 69, 83, 72, 178, 69, 83, 72, 
-    49, 54, 128, 69, 83, 67, 65, 80, 69, 128, 69, 83, 67, 128, 69, 83, 65, 
-    128, 69, 83, 45, 84, 69, 128, 69, 82, 82, 79, 82, 45, 66, 65, 82, 82, 69, 
-    196, 69, 82, 82, 128, 69, 82, 73, 78, 50, 128, 69, 82, 71, 128, 69, 82, 
-    65, 83, 197, 69, 81, 85, 73, 86, 65, 76, 69, 78, 212, 69, 81, 85, 73, 68, 
-    128, 69, 81, 85, 73, 65, 78, 71, 85, 76, 65, 210, 69, 81, 85, 65, 76, 83, 
-    128, 69, 81, 85, 65, 76, 211, 69, 81, 85, 65, 76, 128, 69, 80, 83, 73, 
-    76, 79, 78, 128, 69, 80, 83, 73, 76, 79, 206, 69, 80, 79, 67, 72, 128, 
-    69, 80, 73, 71, 82, 65, 80, 72, 73, 195, 69, 80, 73, 68, 65, 85, 82, 69, 
-    65, 206, 69, 80, 69, 78, 84, 72, 69, 84, 73, 195, 69, 80, 69, 71, 69, 82, 
-    77, 65, 128, 69, 79, 84, 128, 69, 79, 77, 128, 69, 79, 76, 72, 88, 128, 
-    69, 79, 76, 128, 69, 79, 72, 128, 69, 78, 89, 128, 69, 78, 86, 69, 76, 
-    79, 80, 69, 128, 69, 78, 86, 69, 76, 79, 80, 197, 69, 78, 85, 77, 69, 82, 
-    65, 84, 73, 79, 206, 69, 78, 84, 82, 89, 45, 50, 128, 69, 78, 84, 82, 89, 
-    45, 49, 128, 69, 78, 84, 82, 89, 128, 69, 78, 84, 82, 217, 69, 78, 84, 
-    72, 85, 83, 73, 65, 83, 77, 128, 69, 78, 84, 69, 82, 80, 82, 73, 83, 69, 
-    128, 69, 78, 84, 69, 82, 73, 78, 199, 69, 78, 84, 69, 82, 128, 69, 78, 
-    84, 69, 210, 69, 78, 81, 85, 73, 82, 89, 128, 69, 78, 81, 128, 69, 78, 
-    79, 211, 69, 78, 78, 128, 69, 78, 76, 65, 82, 71, 69, 77, 69, 78, 84, 
-    128, 69, 78, 71, 73, 78, 69, 128, 69, 78, 68, 79, 70, 79, 78, 79, 78, 
-    128, 69, 78, 68, 73, 78, 199, 69, 78, 68, 69, 80, 128, 69, 78, 68, 69, 
-    65, 86, 79, 85, 82, 128, 69, 78, 67, 79, 85, 78, 84, 69, 82, 83, 128, 69, 
-    78, 67, 76, 79, 83, 85, 82, 69, 128, 69, 78, 67, 76, 79, 83, 73, 78, 199, 
-    69, 78, 67, 128, 69, 78, 65, 82, 88, 73, 211, 69, 78, 65, 82, 77, 79, 78, 
-    73, 79, 211, 69, 77, 80, 84, 217, 69, 77, 80, 72, 65, 84, 73, 195, 69, 
-    77, 80, 72, 65, 83, 73, 211, 69, 77, 66, 82, 79, 73, 68, 69, 82, 89, 128, 
-    69, 77, 66, 76, 69, 77, 128, 69, 77, 66, 69, 76, 76, 73, 83, 72, 77, 69, 
-    78, 84, 128, 69, 77, 66, 69, 68, 68, 73, 78, 71, 128, 69, 76, 84, 128, 
-    69, 76, 76, 73, 80, 84, 73, 195, 69, 76, 76, 73, 80, 83, 73, 83, 128, 69, 
-    76, 76, 73, 80, 83, 69, 128, 69, 76, 73, 70, 73, 128, 69, 76, 69, 86, 69, 
-    78, 45, 84, 72, 73, 82, 84, 89, 128, 69, 76, 69, 86, 69, 78, 128, 69, 76, 
-    69, 86, 69, 206, 69, 76, 69, 80, 72, 65, 78, 84, 128, 69, 76, 69, 77, 69, 
-    78, 212, 69, 76, 69, 67, 84, 82, 73, 67, 65, 204, 69, 76, 69, 67, 84, 82, 
-    73, 195, 69, 76, 65, 70, 82, 79, 78, 128, 69, 75, 83, 84, 82, 69, 80, 84, 
-    79, 78, 128, 69, 75, 83, 128, 69, 75, 70, 79, 78, 73, 84, 73, 75, 79, 78, 
-    128, 69, 75, 65, 82, 65, 128, 69, 74, 69, 67, 212, 69, 73, 83, 128, 69, 
-    73, 71, 72, 84, 89, 128, 69, 73, 71, 72, 84, 217, 69, 73, 71, 72, 84, 72, 
-    83, 128, 69, 73, 71, 72, 84, 72, 211, 69, 73, 71, 72, 84, 72, 128, 69, 
-    73, 71, 72, 84, 69, 69, 78, 128, 69, 73, 71, 72, 84, 69, 69, 206, 69, 73, 
-    71, 72, 84, 45, 84, 72, 73, 82, 84, 89, 128, 69, 73, 69, 128, 69, 72, 87, 
-    65, 218, 69, 71, 89, 80, 84, 79, 76, 79, 71, 73, 67, 65, 204, 69, 71, 73, 
-    82, 128, 69, 71, 71, 128, 69, 69, 89, 65, 78, 78, 65, 128, 69, 69, 75, 
-    65, 65, 128, 69, 69, 72, 128, 69, 69, 66, 69, 69, 70, 73, 76, 73, 128, 
-    69, 68, 73, 84, 79, 82, 73, 65, 204, 69, 68, 73, 78, 128, 69, 68, 68, 
-    128, 69, 66, 69, 70, 73, 76, 73, 128, 69, 65, 83, 84, 69, 82, 206, 69, 
-    65, 83, 212, 69, 65, 82, 84, 72, 76, 217, 69, 65, 82, 84, 72, 128, 69, 
-    65, 82, 84, 200, 69, 65, 82, 83, 128, 69, 65, 82, 76, 217, 69, 65, 77, 
-    72, 65, 78, 67, 72, 79, 76, 76, 128, 69, 65, 71, 76, 69, 128, 69, 65, 68, 
-    72, 65, 68, 72, 128, 69, 65, 66, 72, 65, 68, 72, 128, 69, 178, 69, 48, 
-    51, 56, 128, 69, 48, 51, 55, 128, 69, 48, 51, 54, 128, 69, 48, 51, 52, 
-    65, 128, 69, 48, 51, 52, 128, 69, 48, 51, 51, 128, 69, 48, 51, 50, 128, 
-    69, 48, 51, 49, 128, 69, 48, 51, 48, 128, 69, 48, 50, 57, 128, 69, 48, 
-    50, 56, 65, 128, 69, 48, 50, 56, 128, 69, 48, 50, 55, 128, 69, 48, 50, 
-    54, 128, 69, 48, 50, 53, 128, 69, 48, 50, 52, 128, 69, 48, 50, 51, 128, 
-    69, 48, 50, 50, 128, 69, 48, 50, 49, 128, 69, 48, 50, 48, 65, 128, 69, 
-    48, 50, 48, 128, 69, 48, 49, 57, 128, 69, 48, 49, 56, 128, 69, 48, 49, 
-    55, 65, 128, 69, 48, 49, 55, 128, 69, 48, 49, 54, 65, 128, 69, 48, 49, 
-    54, 128, 69, 48, 49, 53, 128, 69, 48, 49, 52, 128, 69, 48, 49, 51, 128, 
-    69, 48, 49, 50, 128, 69, 48, 49, 49, 128, 69, 48, 49, 48, 128, 69, 48, 
-    48, 57, 65, 128, 69, 48, 48, 57, 128, 69, 48, 48, 56, 65, 128, 69, 48, 
-    48, 56, 128, 69, 48, 48, 55, 128, 69, 48, 48, 54, 128, 69, 48, 48, 53, 
-    128, 69, 48, 48, 52, 128, 69, 48, 48, 51, 128, 69, 48, 48, 50, 128, 69, 
-    48, 48, 49, 128, 69, 45, 77, 65, 73, 204, 68, 90, 90, 69, 128, 68, 90, 
-    90, 65, 128, 68, 90, 87, 69, 128, 68, 90, 85, 128, 68, 90, 79, 128, 68, 
-    90, 74, 69, 128, 68, 90, 73, 128, 68, 90, 72, 69, 128, 68, 90, 72, 65, 
-    128, 68, 90, 69, 76, 79, 128, 68, 90, 69, 69, 128, 68, 90, 69, 128, 68, 
-    90, 65, 65, 128, 68, 90, 65, 128, 68, 90, 128, 68, 218, 68, 89, 79, 128, 
-    68, 89, 207, 68, 89, 69, 72, 128, 68, 89, 69, 200, 68, 87, 79, 128, 68, 
-    87, 69, 128, 68, 87, 65, 128, 68, 86, 73, 83, 86, 65, 82, 65, 128, 68, 
-    86, 68, 128, 68, 86, 128, 68, 85, 84, 73, 69, 83, 128, 68, 85, 83, 75, 
-    128, 68, 85, 83, 72, 69, 78, 78, 65, 128, 68, 85, 82, 65, 84, 73, 79, 78, 
-    128, 68, 85, 82, 50, 128, 68, 85, 80, 79, 78, 68, 73, 85, 211, 68, 85, 
-    79, 88, 128, 68, 85, 79, 128, 68, 85, 78, 52, 128, 68, 85, 78, 51, 128, 
-    68, 85, 78, 179, 68, 85, 77, 128, 68, 85, 204, 68, 85, 72, 128, 68, 85, 
-    71, 85, 68, 128, 68, 85, 66, 50, 128, 68, 85, 66, 128, 68, 85, 194, 68, 
-    82, 89, 128, 68, 82, 217, 68, 82, 85, 77, 128, 68, 82, 85, 205, 68, 82, 
-    79, 80, 83, 128, 68, 82, 79, 80, 76, 69, 84, 128, 68, 82, 79, 80, 45, 83, 
-    72, 65, 68, 79, 87, 69, 196, 68, 82, 79, 77, 69, 68, 65, 82, 217, 68, 82, 
-    73, 86, 69, 128, 68, 82, 73, 86, 197, 68, 82, 73, 78, 75, 128, 68, 82, 
-    73, 204, 68, 82, 69, 83, 83, 128, 68, 82, 65, 85, 71, 72, 84, 211, 68, 
-    82, 65, 77, 128, 68, 82, 65, 205, 68, 82, 65, 71, 79, 78, 128, 68, 82, 
-    65, 71, 79, 206, 68, 82, 65, 70, 84, 73, 78, 199, 68, 82, 65, 67, 72, 77, 
-    65, 83, 128, 68, 82, 65, 67, 72, 77, 65, 128, 68, 82, 65, 67, 72, 77, 
-    193, 68, 79, 87, 78, 87, 65, 82, 68, 83, 128, 68, 79, 87, 78, 87, 65, 82, 
-    68, 211, 68, 79, 87, 78, 45, 80, 79, 73, 78, 84, 73, 78, 199, 68, 79, 87, 
-    78, 128, 68, 79, 86, 69, 128, 68, 79, 85, 71, 72, 78, 85, 84, 128, 68, 
-    79, 85, 66, 84, 128, 68, 79, 85, 66, 76, 69, 196, 68, 79, 85, 66, 76, 69, 
-    45, 76, 73, 78, 197, 68, 79, 85, 66, 76, 69, 45, 69, 78, 68, 69, 196, 68, 
-    79, 85, 66, 76, 69, 128, 68, 79, 84, 84, 69, 68, 45, 80, 128, 68, 79, 84, 
-    84, 69, 68, 45, 78, 128, 68, 79, 84, 84, 69, 68, 45, 76, 128, 68, 79, 84, 
-    84, 69, 68, 128, 68, 79, 84, 84, 69, 196, 68, 79, 84, 83, 45, 56, 128, 
-    68, 79, 84, 83, 45, 55, 56, 128, 68, 79, 84, 83, 45, 55, 128, 68, 79, 84, 
-    83, 45, 54, 56, 128, 68, 79, 84, 83, 45, 54, 55, 56, 128, 68, 79, 84, 83, 
-    45, 54, 55, 128, 68, 79, 84, 83, 45, 54, 128, 68, 79, 84, 83, 45, 53, 56, 
-    128, 68, 79, 84, 83, 45, 53, 55, 56, 128, 68, 79, 84, 83, 45, 53, 55, 
-    128, 68, 79, 84, 83, 45, 53, 54, 56, 128, 68, 79, 84, 83, 45, 53, 54, 55, 
-    56, 128, 68, 79, 84, 83, 45, 53, 54, 55, 128, 68, 79, 84, 83, 45, 53, 54, 
-    128, 68, 79, 84, 83, 45, 53, 128, 68, 79, 84, 83, 45, 52, 56, 128, 68, 
-    79, 84, 83, 45, 52, 55, 56, 128, 68, 79, 84, 83, 45, 52, 55, 128, 68, 79, 
-    84, 83, 45, 52, 54, 56, 128, 68, 79, 84, 83, 45, 52, 54, 55, 56, 128, 68, 
-    79, 84, 83, 45, 52, 54, 55, 128, 68, 79, 84, 83, 45, 52, 54, 128, 68, 79, 
-    84, 83, 45, 52, 53, 56, 128, 68, 79, 84, 83, 45, 52, 53, 55, 56, 128, 68, 
-    79, 84, 83, 45, 52, 53, 55, 128, 68, 79, 84, 83, 45, 52, 53, 54, 56, 128, 
-    68, 79, 84, 83, 45, 52, 53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 52, 53, 
-    54, 55, 128, 68, 79, 84, 83, 45, 52, 53, 54, 128, 68, 79, 84, 83, 45, 52, 
-    53, 128, 68, 79, 84, 83, 45, 52, 128, 68, 79, 84, 83, 45, 51, 56, 128, 
-    68, 79, 84, 83, 45, 51, 55, 56, 128, 68, 79, 84, 83, 45, 51, 55, 128, 68, 
-    79, 84, 83, 45, 51, 54, 56, 128, 68, 79, 84, 83, 45, 51, 54, 55, 56, 128, 
-    68, 79, 84, 83, 45, 51, 54, 55, 128, 68, 79, 84, 83, 45, 51, 54, 128, 68, 
-    79, 84, 83, 45, 51, 53, 56, 128, 68, 79, 84, 83, 45, 51, 53, 55, 56, 128, 
-    68, 79, 84, 83, 45, 51, 53, 55, 128, 68, 79, 84, 83, 45, 51, 53, 54, 56, 
-    128, 68, 79, 84, 83, 45, 51, 53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 51, 
-    53, 54, 55, 128, 68, 79, 84, 83, 45, 51, 53, 54, 128, 68, 79, 84, 83, 45, 
-    51, 53, 128, 68, 79, 84, 83, 45, 51, 52, 56, 128, 68, 79, 84, 83, 45, 51, 
-    52, 55, 56, 128, 68, 79, 84, 83, 45, 51, 52, 55, 128, 68, 79, 84, 83, 45, 
-    51, 52, 54, 56, 128, 68, 79, 84, 83, 45, 51, 52, 54, 55, 56, 128, 68, 79, 
-    84, 83, 45, 51, 52, 54, 55, 128, 68, 79, 84, 83, 45, 51, 52, 54, 128, 68, 
-    79, 84, 83, 45, 51, 52, 53, 56, 128, 68, 79, 84, 83, 45, 51, 52, 53, 55, 
-    56, 128, 68, 79, 84, 83, 45, 51, 52, 53, 55, 128, 68, 79, 84, 83, 45, 51, 
-    52, 53, 54, 56, 128, 68, 79, 84, 83, 45, 51, 52, 53, 54, 55, 56, 128, 68, 
-    79, 84, 83, 45, 51, 52, 53, 54, 55, 128, 68, 79, 84, 83, 45, 51, 52, 53, 
-    54, 128, 68, 79, 84, 83, 45, 51, 52, 53, 128, 68, 79, 84, 83, 45, 51, 52, 
-    128, 68, 79, 84, 83, 45, 51, 128, 68, 79, 84, 83, 45, 50, 56, 128, 68, 
-    79, 84, 83, 45, 50, 55, 56, 128, 68, 79, 84, 83, 45, 50, 55, 128, 68, 79, 
-    84, 83, 45, 50, 54, 56, 128, 68, 79, 84, 83, 45, 50, 54, 55, 56, 128, 68, 
-    79, 84, 83, 45, 50, 54, 55, 128, 68, 79, 84, 83, 45, 50, 54, 128, 68, 79, 
-    84, 83, 45, 50, 53, 56, 128, 68, 79, 84, 83, 45, 50, 53, 55, 56, 128, 68, 
-    79, 84, 83, 45, 50, 53, 55, 128, 68, 79, 84, 83, 45, 50, 53, 54, 56, 128, 
-    68, 79, 84, 83, 45, 50, 53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 50, 53, 
-    54, 55, 128, 68, 79, 84, 83, 45, 50, 53, 54, 128, 68, 79, 84, 83, 45, 50, 
-    53, 128, 68, 79, 84, 83, 45, 50, 52, 56, 128, 68, 79, 84, 83, 45, 50, 52, 
-    55, 56, 128, 68, 79, 84, 83, 45, 50, 52, 55, 128, 68, 79, 84, 83, 45, 50, 
-    52, 54, 56, 128, 68, 79, 84, 83, 45, 50, 52, 54, 55, 56, 128, 68, 79, 84, 
-    83, 45, 50, 52, 54, 55, 128, 68, 79, 84, 83, 45, 50, 52, 54, 128, 68, 79, 
-    84, 83, 45, 50, 52, 53, 56, 128, 68, 79, 84, 83, 45, 50, 52, 53, 55, 56, 
-    128, 68, 79, 84, 83, 45, 50, 52, 53, 55, 128, 68, 79, 84, 83, 45, 50, 52, 
-    53, 54, 56, 128, 68, 79, 84, 83, 45, 50, 52, 53, 54, 55, 56, 128, 68, 79, 
-    84, 83, 45, 50, 52, 53, 54, 55, 128, 68, 79, 84, 83, 45, 50, 52, 53, 54, 
-    128, 68, 79, 84, 83, 45, 50, 52, 53, 128, 68, 79, 84, 83, 45, 50, 52, 
-    128, 68, 79, 84, 83, 45, 50, 51, 56, 128, 68, 79, 84, 83, 45, 50, 51, 55, 
-    56, 128, 68, 79, 84, 83, 45, 50, 51, 55, 128, 68, 79, 84, 83, 45, 50, 51, 
-    54, 56, 128, 68, 79, 84, 83, 45, 50, 51, 54, 55, 56, 128, 68, 79, 84, 83, 
-    45, 50, 51, 54, 55, 128, 68, 79, 84, 83, 45, 50, 51, 54, 128, 68, 79, 84, 
-    83, 45, 50, 51, 53, 56, 128, 68, 79, 84, 83, 45, 50, 51, 53, 55, 56, 128, 
-    68, 79, 84, 83, 45, 50, 51, 53, 55, 128, 68, 79, 84, 83, 45, 50, 51, 53, 
-    54, 56, 128, 68, 79, 84, 83, 45, 50, 51, 53, 54, 55, 56, 128, 68, 79, 84, 
-    83, 45, 50, 51, 53, 54, 55, 128, 68, 79, 84, 83, 45, 50, 51, 53, 54, 128, 
-    68, 79, 84, 83, 45, 50, 51, 53, 128, 68, 79, 84, 83, 45, 50, 51, 52, 56, 
-    128, 68, 79, 84, 83, 45, 50, 51, 52, 55, 56, 128, 68, 79, 84, 83, 45, 50, 
-    51, 52, 55, 128, 68, 79, 84, 83, 45, 50, 51, 52, 54, 56, 128, 68, 79, 84, 
-    83, 45, 50, 51, 52, 54, 55, 56, 128, 68, 79, 84, 83, 45, 50, 51, 52, 54, 
-    55, 128, 68, 79, 84, 83, 45, 50, 51, 52, 54, 128, 68, 79, 84, 83, 45, 50, 
-    51, 52, 53, 56, 128, 68, 79, 84, 83, 45, 50, 51, 52, 53, 55, 56, 128, 68, 
-    79, 84, 83, 45, 50, 51, 52, 53, 55, 128, 68, 79, 84, 83, 45, 50, 51, 52, 
-    53, 54, 56, 128, 68, 79, 84, 83, 45, 50, 51, 52, 53, 54, 55, 56, 128, 68, 
-    79, 84, 83, 45, 50, 51, 52, 53, 54, 55, 128, 68, 79, 84, 83, 45, 50, 51, 
-    52, 53, 54, 128, 68, 79, 84, 83, 45, 50, 51, 52, 53, 128, 68, 79, 84, 83, 
-    45, 50, 51, 52, 128, 68, 79, 84, 83, 45, 50, 51, 128, 68, 79, 84, 83, 45, 
-    50, 128, 68, 79, 84, 83, 45, 49, 56, 128, 68, 79, 84, 83, 45, 49, 55, 56, 
-    128, 68, 79, 84, 83, 45, 49, 55, 128, 68, 79, 84, 83, 45, 49, 54, 56, 
-    128, 68, 79, 84, 83, 45, 49, 54, 55, 56, 128, 68, 79, 84, 83, 45, 49, 54, 
-    55, 128, 68, 79, 84, 83, 45, 49, 54, 128, 68, 79, 84, 83, 45, 49, 53, 56, 
-    128, 68, 79, 84, 83, 45, 49, 53, 55, 56, 128, 68, 79, 84, 83, 45, 49, 53, 
-    55, 128, 68, 79, 84, 83, 45, 49, 53, 54, 56, 128, 68, 79, 84, 83, 45, 49, 
-    53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 49, 53, 54, 55, 128, 68, 79, 84, 
-    83, 45, 49, 53, 54, 128, 68, 79, 84, 83, 45, 49, 53, 128, 68, 79, 84, 83, 
-    45, 49, 52, 56, 128, 68, 79, 84, 83, 45, 49, 52, 55, 56, 128, 68, 79, 84, 
-    83, 45, 49, 52, 55, 128, 68, 79, 84, 83, 45, 49, 52, 54, 56, 128, 68, 79, 
-    84, 83, 45, 49, 52, 54, 55, 56, 128, 68, 79, 84, 83, 45, 49, 52, 54, 55, 
-    128, 68, 79, 84, 83, 45, 49, 52, 54, 128, 68, 79, 84, 83, 45, 49, 52, 53, 
-    56, 128, 68, 79, 84, 83, 45, 49, 52, 53, 55, 56, 128, 68, 79, 84, 83, 45, 
-    49, 52, 53, 55, 128, 68, 79, 84, 83, 45, 49, 52, 53, 54, 56, 128, 68, 79, 
-    84, 83, 45, 49, 52, 53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 49, 52, 53, 
-    54, 55, 128, 68, 79, 84, 83, 45, 49, 52, 53, 54, 128, 68, 79, 84, 83, 45, 
-    49, 52, 53, 128, 68, 79, 84, 83, 45, 49, 52, 128, 68, 79, 84, 83, 45, 49, 
-    51, 56, 128, 68, 79, 84, 83, 45, 49, 51, 55, 56, 128, 68, 79, 84, 83, 45, 
-    49, 51, 55, 128, 68, 79, 84, 83, 45, 49, 51, 54, 56, 128, 68, 79, 84, 83, 
-    45, 49, 51, 54, 55, 56, 128, 68, 79, 84, 83, 45, 49, 51, 54, 55, 128, 68, 
-    79, 84, 83, 45, 49, 51, 54, 128, 68, 79, 84, 83, 45, 49, 51, 53, 56, 128, 
-    68, 79, 84, 83, 45, 49, 51, 53, 55, 56, 128, 68, 79, 84, 83, 45, 49, 51, 
-    53, 55, 128, 68, 79, 84, 83, 45, 49, 51, 53, 54, 56, 128, 68, 79, 84, 83, 
-    45, 49, 51, 53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 49, 51, 53, 54, 55, 
-    128, 68, 79, 84, 83, 45, 49, 51, 53, 54, 128, 68, 79, 84, 83, 45, 49, 51, 
-    53, 128, 68, 79, 84, 83, 45, 49, 51, 52, 56, 128, 68, 79, 84, 83, 45, 49, 
-    51, 52, 55, 56, 128, 68, 79, 84, 83, 45, 49, 51, 52, 55, 128, 68, 79, 84, 
-    83, 45, 49, 51, 52, 54, 56, 128, 68, 79, 84, 83, 45, 49, 51, 52, 54, 55, 
-    56, 128, 68, 79, 84, 83, 45, 49, 51, 52, 54, 55, 128, 68, 79, 84, 83, 45, 
-    49, 51, 52, 54, 128, 68, 79, 84, 83, 45, 49, 51, 52, 53, 56, 128, 68, 79, 
-    84, 83, 45, 49, 51, 52, 53, 55, 56, 128, 68, 79, 84, 83, 45, 49, 51, 52, 
-    53, 55, 128, 68, 79, 84, 83, 45, 49, 51, 52, 53, 54, 56, 128, 68, 79, 84, 
-    83, 45, 49, 51, 52, 53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 49, 51, 52, 
-    53, 54, 55, 128, 68, 79, 84, 83, 45, 49, 51, 52, 53, 54, 128, 68, 79, 84, 
-    83, 45, 49, 51, 52, 53, 128, 68, 79, 84, 83, 45, 49, 51, 52, 128, 68, 79, 
-    84, 83, 45, 49, 51, 128, 68, 79, 84, 83, 45, 49, 50, 56, 128, 68, 79, 84, 
-    83, 45, 49, 50, 55, 56, 128, 68, 79, 84, 83, 45, 49, 50, 55, 128, 68, 79, 
-    84, 83, 45, 49, 50, 54, 56, 128, 68, 79, 84, 83, 45, 49, 50, 54, 55, 56, 
-    128, 68, 79, 84, 83, 45, 49, 50, 54, 55, 128, 68, 79, 84, 83, 45, 49, 50, 
-    54, 128, 68, 79, 84, 83, 45, 49, 50, 53, 56, 128, 68, 79, 84, 83, 45, 49, 
-    50, 53, 55, 56, 128, 68, 79, 84, 83, 45, 49, 50, 53, 55, 128, 68, 79, 84, 
-    83, 45, 49, 50, 53, 54, 56, 128, 68, 79, 84, 83, 45, 49, 50, 53, 54, 55, 
-    56, 128, 68, 79, 84, 83, 45, 49, 50, 53, 54, 55, 128, 68, 79, 84, 83, 45, 
-    49, 50, 53, 54, 128, 68, 79, 84, 83, 45, 49, 50, 53, 128, 68, 79, 84, 83, 
-    45, 49, 50, 52, 56, 128, 68, 79, 84, 83, 45, 49, 50, 52, 55, 56, 128, 68, 
-    79, 84, 83, 45, 49, 50, 52, 55, 128, 68, 79, 84, 83, 45, 49, 50, 52, 54, 
-    56, 128, 68, 79, 84, 83, 45, 49, 50, 52, 54, 55, 56, 128, 68, 79, 84, 83, 
-    45, 49, 50, 52, 54, 55, 128, 68, 79, 84, 83, 45, 49, 50, 52, 54, 128, 68, 
-    79, 84, 83, 45, 49, 50, 52, 53, 56, 128, 68, 79, 84, 83, 45, 49, 50, 52, 
-    53, 55, 56, 128, 68, 79, 84, 83, 45, 49, 50, 52, 53, 55, 128, 68, 79, 84, 
-    83, 45, 49, 50, 52, 53, 54, 56, 128, 68, 79, 84, 83, 45, 49, 50, 52, 53, 
-    54, 55, 56, 128, 68, 79, 84, 83, 45, 49, 50, 52, 53, 54, 55, 128, 68, 79, 
-    84, 83, 45, 49, 50, 52, 53, 54, 128, 68, 79, 84, 83, 45, 49, 50, 52, 53, 
-    128, 68, 79, 84, 83, 45, 49, 50, 52, 128, 68, 79, 84, 83, 45, 49, 50, 51, 
-    56, 128, 68, 79, 84, 83, 45, 49, 50, 51, 55, 56, 128, 68, 79, 84, 83, 45, 
-    49, 50, 51, 55, 128, 68, 79, 84, 83, 45, 49, 50, 51, 54, 56, 128, 68, 79, 
-    84, 83, 45, 49, 50, 51, 54, 55, 56, 128, 68, 79, 84, 83, 45, 49, 50, 51, 
-    54, 55, 128, 68, 79, 84, 83, 45, 49, 50, 51, 54, 128, 68, 79, 84, 83, 45, 
-    49, 50, 51, 53, 56, 128, 68, 79, 84, 83, 45, 49, 50, 51, 53, 55, 56, 128, 
-    68, 79, 84, 83, 45, 49, 50, 51, 53, 55, 128, 68, 79, 84, 83, 45, 49, 50, 
-    51, 53, 54, 56, 128, 68, 79, 84, 83, 45, 49, 50, 51, 53, 54, 55, 56, 128, 
-    68, 79, 84, 83, 45, 49, 50, 51, 53, 54, 55, 128, 68, 79, 84, 83, 45, 49, 
-    50, 51, 53, 54, 128, 68, 79, 84, 83, 45, 49, 50, 51, 53, 128, 68, 79, 84, 
-    83, 45, 49, 50, 51, 52, 56, 128, 68, 79, 84, 83, 45, 49, 50, 51, 52, 55, 
-    56, 128, 68, 79, 84, 83, 45, 49, 50, 51, 52, 55, 128, 68, 79, 84, 83, 45, 
-    49, 50, 51, 52, 54, 56, 128, 68, 79, 84, 83, 45, 49, 50, 51, 52, 54, 55, 
-    56, 128, 68, 79, 84, 83, 45, 49, 50, 51, 52, 54, 55, 128, 68, 79, 84, 83, 
-    45, 49, 50, 51, 52, 54, 128, 68, 79, 84, 83, 45, 49, 50, 51, 52, 53, 56, 
-    128, 68, 79, 84, 83, 45, 49, 50, 51, 52, 53, 55, 56, 128, 68, 79, 84, 83, 
-    45, 49, 50, 51, 52, 53, 55, 128, 68, 79, 84, 83, 45, 49, 50, 51, 52, 53, 
-    54, 56, 128, 68, 79, 84, 83, 45, 49, 50, 51, 52, 53, 54, 55, 56, 128, 68, 
-    79, 84, 83, 45, 49, 50, 51, 52, 53, 54, 55, 128, 68, 79, 84, 83, 45, 49, 
-    50, 51, 52, 53, 54, 128, 68, 79, 84, 83, 45, 49, 50, 51, 52, 53, 128, 68, 
-    79, 84, 83, 45, 49, 50, 51, 52, 128, 68, 79, 84, 83, 45, 49, 50, 51, 128, 
-    68, 79, 84, 83, 45, 49, 50, 128, 68, 79, 84, 83, 45, 49, 128, 68, 79, 84, 
-    83, 128, 68, 79, 84, 76, 69, 83, 211, 68, 79, 82, 85, 128, 68, 79, 79, 
-    82, 128, 68, 79, 79, 78, 71, 128, 68, 79, 78, 71, 128, 68, 79, 77, 65, 
-    73, 206, 68, 79, 76, 80, 72, 73, 78, 128, 68, 79, 76, 76, 83, 128, 68, 
-    79, 76, 76, 65, 210, 68, 79, 76, 73, 85, 77, 128, 68, 79, 75, 77, 65, 73, 
-    128, 68, 79, 73, 84, 128, 68, 79, 71, 128, 68, 79, 199, 68, 79, 69, 211, 
-    68, 79, 68, 69, 75, 65, 84, 65, 128, 68, 79, 66, 82, 79, 128, 68, 79, 65, 
-    67, 72, 65, 83, 72, 77, 69, 69, 128, 68, 79, 65, 67, 72, 65, 83, 72, 77, 
-    69, 197, 68, 79, 65, 128, 68, 79, 45, 79, 128, 68, 77, 128, 68, 205, 68, 
-    76, 85, 128, 68, 76, 79, 128, 68, 76, 73, 128, 68, 76, 72, 89, 65, 128, 
-    68, 76, 72, 65, 128, 68, 76, 69, 69, 128, 68, 76, 65, 128, 68, 76, 128, 
-    68, 75, 65, 82, 128, 68, 75, 65, 210, 68, 74, 69, 82, 86, 73, 128, 68, 
-    74, 69, 82, 86, 128, 68, 74, 69, 128, 68, 74, 65, 128, 68, 73, 90, 90, 
-    217, 68, 73, 86, 79, 82, 67, 197, 68, 73, 86, 73, 83, 73, 79, 78, 128, 
-    68, 73, 86, 73, 83, 73, 79, 206, 68, 73, 86, 73, 78, 65, 84, 73, 79, 78, 
-    128, 68, 73, 86, 73, 68, 69, 83, 128, 68, 73, 86, 73, 68, 69, 82, 128, 
-    68, 73, 86, 73, 68, 69, 196, 68, 73, 86, 73, 68, 69, 128, 68, 73, 86, 73, 
-    68, 197, 68, 73, 86, 69, 82, 71, 69, 78, 67, 69, 128, 68, 73, 84, 84, 
-    207, 68, 73, 83, 84, 79, 82, 84, 73, 79, 78, 128, 68, 73, 83, 84, 73, 78, 
-    71, 85, 73, 83, 72, 128, 68, 73, 83, 84, 73, 76, 76, 128, 68, 73, 83, 83, 
-    79, 76, 86, 69, 45, 50, 128, 68, 73, 83, 83, 79, 76, 86, 69, 128, 68, 73, 
-    83, 80, 69, 82, 83, 73, 79, 78, 128, 68, 73, 83, 75, 128, 68, 73, 83, 73, 
-    77, 79, 85, 128, 68, 73, 83, 72, 128, 68, 73, 83, 67, 79, 78, 84, 73, 78, 
-    85, 79, 85, 211, 68, 73, 83, 195, 68, 73, 83, 65, 80, 80, 79, 73, 78, 84, 
-    69, 196, 68, 73, 83, 65, 66, 76, 69, 196, 68, 73, 82, 71, 193, 68, 73, 
-    82, 69, 67, 84, 76, 217, 68, 73, 82, 69, 67, 84, 73, 79, 78, 65, 204, 68, 
-    73, 80, 84, 69, 128, 68, 73, 80, 80, 69, 82, 128, 68, 73, 80, 76, 79, 85, 
-    78, 128, 68, 73, 80, 76, 73, 128, 68, 73, 80, 76, 201, 68, 73, 78, 71, 
-    66, 65, 212, 68, 73, 206, 68, 73, 77, 77, 73, 78, 71, 128, 68, 73, 77, 
-    73, 78, 85, 84, 73, 79, 78, 45, 51, 128, 68, 73, 77, 73, 78, 85, 84, 73, 
-    79, 78, 45, 50, 128, 68, 73, 77, 73, 78, 85, 84, 73, 79, 78, 45, 49, 128, 
-    68, 73, 77, 73, 78, 73, 83, 72, 77, 69, 78, 84, 128, 68, 73, 77, 73, 68, 
-    73, 193, 68, 73, 77, 69, 78, 83, 73, 79, 78, 65, 204, 68, 73, 77, 69, 78, 
-    83, 73, 79, 206, 68, 73, 77, 50, 128, 68, 73, 76, 128, 68, 73, 71, 82, 
-    65, 80, 72, 128, 68, 73, 71, 82, 65, 80, 200, 68, 73, 71, 82, 65, 77, 77, 
-    79, 211, 68, 73, 71, 82, 65, 77, 77, 193, 68, 73, 71, 82, 65, 205, 68, 
-    73, 71, 79, 82, 71, 79, 78, 128, 68, 73, 71, 79, 82, 71, 79, 206, 68, 73, 
-    71, 65, 77, 77, 65, 128, 68, 73, 71, 193, 68, 73, 70, 84, 79, 71, 71, 79, 
-    211, 68, 73, 70, 79, 78, 73, 65, 83, 128, 68, 73, 70, 70, 73, 67, 85, 76, 
-    84, 217, 68, 73, 70, 70, 73, 67, 85, 76, 84, 73, 69, 83, 128, 68, 73, 70, 
-    70, 69, 82, 69, 78, 84, 73, 65, 76, 128, 68, 73, 70, 70, 69, 82, 69, 78, 
-    67, 197, 68, 73, 70, 65, 84, 128, 68, 73, 69, 83, 73, 83, 128, 68, 73, 
-    69, 83, 73, 211, 68, 73, 69, 80, 128, 68, 73, 197, 68, 73, 66, 128, 68, 
-    73, 65, 84, 79, 78, 79, 206, 68, 73, 65, 84, 79, 78, 73, 75, 201, 68, 73, 
-    65, 83, 84, 79, 76, 201, 68, 73, 65, 77, 79, 78, 68, 83, 128, 68, 73, 65, 
-    77, 79, 78, 68, 128, 68, 73, 65, 77, 79, 78, 196, 68, 73, 65, 77, 69, 84, 
-    69, 210, 68, 73, 65, 76, 89, 84, 73, 75, 65, 128, 68, 73, 65, 76, 89, 84, 
-    73, 75, 193, 68, 73, 65, 76, 69, 67, 84, 45, 208, 68, 73, 65, 71, 79, 78, 
-    65, 76, 128, 68, 73, 65, 71, 79, 78, 65, 204, 68, 73, 65, 69, 82, 69, 83, 
-    73, 90, 69, 196, 68, 73, 65, 69, 82, 69, 83, 73, 83, 128, 68, 73, 65, 69, 
-    82, 69, 83, 73, 211, 68, 72, 79, 85, 128, 68, 72, 79, 79, 128, 68, 72, 
-    79, 128, 68, 72, 73, 128, 68, 72, 72, 85, 128, 68, 72, 72, 79, 79, 128, 
-    68, 72, 72, 79, 128, 68, 72, 72, 73, 128, 68, 72, 72, 69, 69, 128, 68, 
-    72, 72, 69, 128, 68, 72, 72, 65, 128, 68, 72, 69, 69, 128, 68, 72, 65, 
-    82, 77, 65, 128, 68, 72, 65, 76, 69, 84, 72, 128, 68, 72, 65, 76, 65, 84, 
-    72, 128, 68, 72, 65, 76, 128, 68, 72, 65, 68, 72, 69, 128, 68, 72, 65, 
-    65, 76, 85, 128, 68, 72, 65, 65, 128, 68, 72, 65, 128, 68, 69, 90, 200, 
-    68, 69, 89, 84, 69, 82, 79, 213, 68, 69, 89, 84, 69, 82, 79, 211, 68, 69, 
-    88, 73, 65, 128, 68, 69, 86, 73, 67, 197, 68, 69, 86, 69, 76, 79, 80, 77, 
-    69, 78, 84, 128, 68, 69, 85, 78, 71, 128, 68, 69, 83, 203, 68, 69, 83, 
-    73, 71, 78, 128, 68, 69, 83, 73, 128, 68, 69, 83, 67, 82, 73, 80, 84, 73, 
-    79, 206, 68, 69, 83, 67, 69, 78, 68, 73, 78, 199, 68, 69, 83, 67, 69, 78, 
-    68, 69, 82, 128, 68, 69, 82, 69, 84, 45, 72, 73, 68, 69, 84, 128, 68, 69, 
-    82, 69, 84, 128, 68, 69, 80, 65, 82, 84, 85, 82, 69, 128, 68, 69, 80, 65, 
-    82, 84, 77, 69, 78, 212, 68, 69, 80, 65, 82, 84, 73, 78, 199, 68, 69, 78, 
-    84, 73, 83, 84, 82, 217, 68, 69, 78, 84, 65, 204, 68, 69, 78, 79, 77, 73, 
-    78, 65, 84, 79, 82, 128, 68, 69, 78, 79, 77, 73, 78, 65, 84, 79, 210, 68, 
-    69, 78, 78, 69, 78, 128, 68, 69, 78, 71, 128, 68, 69, 78, 197, 68, 69, 
-    78, 65, 82, 73, 85, 211, 68, 69, 76, 84, 65, 128, 68, 69, 76, 84, 193, 
-    68, 69, 76, 84, 128, 68, 69, 76, 80, 72, 73, 195, 68, 69, 76, 73, 86, 69, 
-    82, 217, 68, 69, 76, 73, 86, 69, 82, 65, 78, 67, 69, 128, 68, 69, 76, 73, 
-    77, 73, 84, 69, 82, 128, 68, 69, 76, 73, 77, 73, 84, 69, 210, 68, 69, 76, 
-    73, 67, 73, 79, 85, 211, 68, 69, 76, 69, 84, 69, 128, 68, 69, 76, 69, 84, 
+    84, 128, 82, 76, 79, 128, 82, 76, 77, 128, 82, 76, 73, 128, 82, 76, 69, 
+    128, 82, 74, 69, 211, 82, 74, 69, 128, 82, 74, 197, 82, 73, 86, 69, 82, 
+    128, 82, 73, 84, 85, 65, 76, 128, 82, 73, 84, 84, 79, 82, 85, 128, 82, 
+    73, 84, 83, 73, 128, 82, 73, 83, 73, 78, 199, 82, 73, 83, 72, 128, 82, 
+    73, 82, 65, 128, 82, 73, 80, 128, 82, 73, 78, 71, 211, 82, 73, 78, 70, 
+    79, 82, 90, 65, 78, 68, 79, 128, 82, 73, 206, 82, 73, 77, 71, 66, 65, 
+    128, 82, 73, 75, 82, 73, 75, 128, 82, 73, 71, 86, 69, 68, 73, 195, 82, 
+    73, 71, 72, 84, 87, 65, 82, 68, 83, 128, 82, 73, 71, 72, 84, 72, 65, 78, 
+    196, 82, 73, 71, 72, 84, 45, 84, 79, 45, 76, 69, 70, 212, 82, 73, 71, 72, 
+    84, 45, 83, 73, 68, 197, 82, 73, 71, 72, 84, 45, 83, 72, 65, 68, 79, 87, 
+    69, 196, 82, 73, 71, 72, 84, 45, 83, 72, 65, 68, 69, 196, 82, 73, 71, 72, 
+    84, 45, 80, 79, 73, 78, 84, 73, 78, 199, 82, 73, 71, 72, 84, 45, 72, 65, 
+    78, 68, 69, 196, 82, 73, 71, 72, 84, 45, 72, 65, 78, 196, 82, 73, 71, 72, 
+    84, 45, 70, 65, 67, 73, 78, 199, 82, 73, 71, 72, 84, 128, 82, 73, 69, 85, 
+    76, 45, 89, 69, 83, 73, 69, 85, 78, 71, 128, 82, 73, 69, 85, 76, 45, 89, 
+    69, 79, 82, 73, 78, 72, 73, 69, 85, 72, 45, 72, 73, 69, 85, 72, 128, 82, 
+    73, 69, 85, 76, 45, 89, 69, 79, 82, 73, 78, 72, 73, 69, 85, 72, 128, 82, 
+    73, 69, 85, 76, 45, 84, 73, 75, 69, 85, 84, 45, 72, 73, 69, 85, 72, 128, 
+    82, 73, 69, 85, 76, 45, 84, 73, 75, 69, 85, 84, 128, 82, 73, 69, 85, 76, 
+    45, 84, 72, 73, 69, 85, 84, 72, 128, 82, 73, 69, 85, 76, 45, 83, 83, 65, 
+    78, 71, 84, 73, 75, 69, 85, 84, 128, 82, 73, 69, 85, 76, 45, 83, 83, 65, 
+    78, 71, 83, 73, 79, 83, 128, 82, 73, 69, 85, 76, 45, 83, 83, 65, 78, 71, 
+    80, 73, 69, 85, 80, 128, 82, 73, 69, 85, 76, 45, 83, 83, 65, 78, 71, 75, 
+    73, 89, 69, 79, 75, 128, 82, 73, 69, 85, 76, 45, 83, 73, 79, 83, 128, 82, 
+    73, 69, 85, 76, 45, 80, 73, 69, 85, 80, 45, 84, 73, 75, 69, 85, 84, 128, 
+    82, 73, 69, 85, 76, 45, 80, 73, 69, 85, 80, 45, 83, 73, 79, 83, 128, 82, 
+    73, 69, 85, 76, 45, 80, 73, 69, 85, 80, 45, 80, 72, 73, 69, 85, 80, 72, 
+    128, 82, 73, 69, 85, 76, 45, 80, 73, 69, 85, 80, 45, 72, 73, 69, 85, 72, 
+    128, 82, 73, 69, 85, 76, 45, 80, 73, 69, 85, 80, 128, 82, 73, 69, 85, 76, 
+    45, 80, 72, 73, 69, 85, 80, 72, 128, 82, 73, 69, 85, 76, 45, 80, 65, 78, 
+    83, 73, 79, 83, 128, 82, 73, 69, 85, 76, 45, 78, 73, 69, 85, 78, 128, 82, 
+    73, 69, 85, 76, 45, 77, 73, 69, 85, 77, 45, 83, 73, 79, 83, 128, 82, 73, 
+    69, 85, 76, 45, 77, 73, 69, 85, 77, 45, 75, 73, 89, 69, 79, 75, 128, 82, 
+    73, 69, 85, 76, 45, 77, 73, 69, 85, 77, 45, 72, 73, 69, 85, 72, 128, 82, 
+    73, 69, 85, 76, 45, 77, 73, 69, 85, 77, 128, 82, 73, 69, 85, 76, 45, 75, 
+    73, 89, 69, 79, 75, 45, 83, 73, 79, 83, 128, 82, 73, 69, 85, 76, 45, 75, 
+    73, 89, 69, 79, 75, 45, 72, 73, 69, 85, 72, 128, 82, 73, 69, 85, 76, 45, 
+    75, 73, 89, 69, 79, 75, 128, 82, 73, 69, 85, 76, 45, 75, 65, 80, 89, 69, 
+    79, 85, 78, 80, 73, 69, 85, 80, 128, 82, 73, 69, 85, 76, 45, 72, 73, 69, 
+    85, 72, 128, 82, 73, 69, 85, 76, 45, 67, 73, 69, 85, 67, 128, 82, 73, 69, 
+    85, 204, 82, 73, 69, 76, 128, 82, 73, 69, 69, 128, 82, 73, 67, 69, 77, 
+    128, 82, 73, 67, 69, 128, 82, 73, 67, 197, 82, 73, 66, 66, 79, 78, 128, 
+    82, 73, 65, 204, 82, 72, 79, 84, 73, 195, 82, 72, 79, 128, 82, 72, 207, 
+    82, 72, 65, 128, 82, 71, 89, 73, 78, 71, 83, 128, 82, 71, 89, 65, 78, 
+    128, 82, 71, 89, 193, 82, 69, 86, 79, 76, 86, 73, 78, 199, 82, 69, 86, 
+    79, 76, 85, 84, 73, 79, 78, 128, 82, 69, 86, 77, 65, 128, 82, 69, 86, 73, 
+    65, 128, 82, 69, 86, 69, 82, 83, 69, 68, 128, 82, 69, 86, 69, 82, 83, 69, 
+    196, 82, 69, 86, 69, 82, 83, 197, 82, 69, 85, 88, 128, 82, 69, 85, 128, 
+    82, 69, 84, 85, 82, 78, 128, 82, 69, 84, 85, 82, 206, 82, 69, 84, 82, 79, 
+    70, 76, 69, 216, 82, 69, 84, 82, 69, 65, 84, 128, 82, 69, 84, 79, 82, 84, 
+    128, 82, 69, 83, 85, 80, 73, 78, 85, 83, 128, 82, 69, 83, 84, 82, 79, 79, 
+    77, 128, 82, 69, 83, 84, 82, 73, 67, 84, 69, 196, 82, 69, 83, 84, 128, 
+    82, 69, 83, 80, 79, 78, 83, 69, 128, 82, 69, 83, 79, 85, 82, 67, 69, 128, 
+    82, 69, 83, 79, 76, 85, 84, 73, 79, 78, 128, 82, 69, 83, 73, 83, 84, 65, 
+    78, 67, 69, 128, 82, 69, 83, 73, 68, 69, 78, 67, 69, 128, 82, 69, 83, 
+    200, 82, 69, 82, 69, 78, 71, 71, 65, 78, 128, 82, 69, 82, 69, 75, 65, 78, 
+    128, 82, 69, 80, 82, 69, 83, 69, 78, 84, 128, 82, 69, 80, 76, 65, 67, 69, 
+    77, 69, 78, 212, 82, 69, 80, 72, 128, 82, 69, 80, 69, 84, 73, 84, 73, 79, 
+    206, 82, 69, 80, 69, 65, 84, 69, 196, 82, 69, 80, 69, 65, 84, 128, 82, 
+    69, 80, 69, 65, 212, 82, 69, 80, 65, 89, 65, 128, 82, 69, 80, 65, 128, 
+    82, 69, 80, 193, 82, 69, 78, 84, 79, 71, 69, 78, 128, 82, 69, 78, 128, 
+    82, 69, 206, 82, 69, 77, 85, 128, 82, 69, 77, 69, 68, 89, 128, 82, 69, 
+    76, 73, 71, 73, 79, 78, 128, 82, 69, 76, 73, 69, 86, 69, 196, 82, 69, 76, 
+    69, 65, 83, 69, 128, 82, 69, 76, 65, 84, 73, 79, 78, 65, 204, 82, 69, 76, 
+    65, 84, 73, 79, 78, 128, 82, 69, 76, 65, 65, 128, 82, 69, 74, 65, 78, 
+    199, 82, 69, 73, 196, 82, 69, 71, 85, 76, 85, 83, 45, 52, 128, 82, 69, 
+    71, 85, 76, 85, 83, 45, 51, 128, 82, 69, 71, 85, 76, 85, 83, 45, 50, 128, 
+    82, 69, 71, 85, 76, 85, 83, 128, 82, 69, 71, 85, 76, 85, 211, 82, 69, 71, 
+    73, 83, 84, 69, 82, 69, 196, 82, 69, 71, 73, 79, 78, 65, 204, 82, 69, 71, 
+    73, 65, 45, 50, 128, 82, 69, 71, 73, 65, 128, 82, 69, 70, 79, 82, 77, 69, 
+    196, 82, 69, 70, 69, 82, 69, 78, 67, 197, 82, 69, 68, 85, 80, 76, 73, 67, 
+    65, 84, 73, 79, 78, 128, 82, 69, 67, 89, 67, 76, 73, 78, 199, 82, 69, 67, 
+    89, 67, 76, 69, 196, 82, 69, 67, 84, 73, 76, 73, 78, 69, 65, 210, 82, 69, 
+    67, 84, 65, 78, 71, 85, 76, 65, 210, 82, 69, 67, 84, 65, 78, 71, 76, 69, 
+    128, 82, 69, 67, 84, 65, 78, 71, 76, 197, 82, 69, 67, 82, 69, 65, 84, 73, 
+    79, 78, 65, 204, 82, 69, 67, 79, 82, 68, 73, 78, 199, 82, 69, 67, 79, 82, 
+    68, 69, 82, 128, 82, 69, 67, 79, 82, 196, 82, 69, 67, 69, 80, 84, 73, 86, 
+    197, 82, 69, 67, 69, 73, 86, 69, 82, 128, 82, 69, 65, 76, 71, 65, 82, 45, 
+    50, 128, 82, 69, 65, 76, 71, 65, 82, 128, 82, 69, 65, 72, 77, 85, 75, 
+    128, 82, 69, 65, 67, 72, 128, 82, 68, 207, 82, 68, 69, 204, 82, 66, 65, 
+    83, 193, 82, 65, 89, 83, 128, 82, 65, 89, 65, 78, 78, 65, 128, 82, 65, 
+    84, 73, 79, 128, 82, 65, 84, 72, 65, 128, 82, 65, 84, 72, 193, 82, 65, 
+    84, 65, 128, 82, 65, 84, 128, 82, 65, 83, 87, 65, 68, 73, 128, 82, 65, 
+    83, 79, 85, 204, 82, 65, 83, 72, 65, 128, 82, 65, 81, 128, 82, 65, 80, 
+    73, 83, 77, 65, 128, 82, 65, 78, 71, 197, 82, 65, 78, 65, 128, 82, 65, 
+    78, 128, 82, 65, 77, 211, 82, 65, 77, 66, 65, 84, 128, 82, 65, 75, 72, 
+    65, 78, 71, 128, 82, 65, 75, 65, 65, 82, 65, 65, 78, 83, 65, 89, 65, 128, 
+    82, 65, 73, 83, 73, 78, 199, 82, 65, 73, 83, 69, 196, 82, 65, 73, 78, 66, 
+    79, 87, 128, 82, 65, 73, 76, 87, 65, 89, 128, 82, 65, 73, 76, 87, 65, 
+    217, 82, 65, 73, 76, 128, 82, 65, 73, 68, 207, 82, 65, 73, 68, 65, 128, 
+    82, 65, 72, 77, 65, 84, 85, 76, 76, 65, 200, 82, 65, 72, 128, 82, 65, 70, 
+    69, 128, 82, 65, 69, 77, 128, 82, 65, 68, 73, 79, 65, 67, 84, 73, 86, 
+    197, 82, 65, 68, 73, 79, 128, 82, 65, 68, 73, 207, 82, 65, 68, 201, 82, 
+    65, 68, 128, 82, 65, 196, 82, 65, 67, 81, 85, 69, 212, 82, 65, 67, 73, 
+    78, 71, 128, 82, 65, 66, 66, 73, 84, 128, 82, 65, 66, 66, 73, 212, 82, 
+    65, 66, 128, 82, 65, 65, 73, 128, 82, 65, 51, 128, 82, 65, 50, 128, 82, 
+    65, 45, 50, 128, 82, 48, 50, 57, 128, 82, 48, 50, 56, 128, 82, 48, 50, 
+    55, 128, 82, 48, 50, 54, 128, 82, 48, 50, 53, 128, 82, 48, 50, 52, 128, 
+    82, 48, 50, 51, 128, 82, 48, 50, 50, 128, 82, 48, 50, 49, 128, 82, 48, 
+    50, 48, 128, 82, 48, 49, 57, 128, 82, 48, 49, 56, 128, 82, 48, 49, 55, 
+    128, 82, 48, 49, 54, 65, 128, 82, 48, 49, 54, 128, 82, 48, 49, 53, 128, 
+    82, 48, 49, 52, 128, 82, 48, 49, 51, 128, 82, 48, 49, 50, 128, 82, 48, 
+    49, 49, 128, 82, 48, 49, 48, 65, 128, 82, 48, 49, 48, 128, 82, 48, 48, 
+    57, 128, 82, 48, 48, 56, 128, 82, 48, 48, 55, 128, 82, 48, 48, 54, 128, 
+    82, 48, 48, 53, 128, 82, 48, 48, 52, 128, 82, 48, 48, 51, 66, 128, 82, 
+    48, 48, 51, 65, 128, 82, 48, 48, 51, 128, 82, 48, 48, 50, 65, 128, 82, 
+    48, 48, 50, 128, 82, 48, 48, 49, 128, 82, 45, 67, 82, 69, 197, 81, 89, 
+    88, 128, 81, 89, 85, 128, 81, 89, 84, 128, 81, 89, 82, 88, 128, 81, 89, 
+    82, 128, 81, 89, 80, 128, 81, 89, 79, 128, 81, 89, 73, 128, 81, 89, 69, 
+    69, 128, 81, 89, 69, 128, 81, 89, 65, 65, 128, 81, 89, 65, 128, 81, 89, 
+    128, 81, 87, 73, 128, 81, 87, 69, 69, 128, 81, 87, 69, 128, 81, 87, 65, 
+    65, 128, 81, 87, 65, 128, 81, 85, 88, 128, 81, 85, 86, 128, 81, 85, 85, 
+    86, 128, 81, 85, 85, 128, 81, 85, 84, 128, 81, 85, 83, 72, 83, 72, 65, 
+    89, 65, 128, 81, 85, 82, 88, 128, 81, 85, 82, 128, 81, 85, 80, 128, 81, 
+    85, 79, 88, 128, 81, 85, 79, 84, 197, 81, 85, 79, 84, 65, 84, 73, 79, 
+    206, 81, 85, 79, 84, 128, 81, 85, 79, 80, 128, 81, 85, 79, 128, 81, 85, 
+    75, 128, 81, 85, 73, 78, 84, 69, 83, 83, 69, 78, 67, 69, 128, 81, 85, 73, 
+    78, 68, 73, 67, 69, 83, 73, 77, 193, 81, 85, 73, 78, 67, 85, 78, 88, 128, 
+    81, 85, 73, 78, 65, 82, 73, 85, 211, 81, 85, 73, 76, 76, 128, 81, 85, 73, 
+    67, 203, 81, 85, 73, 128, 81, 85, 70, 128, 81, 85, 69, 83, 84, 73, 79, 
+    78, 69, 196, 81, 85, 69, 83, 84, 73, 79, 78, 128, 81, 85, 69, 83, 84, 73, 
+    79, 206, 81, 85, 69, 69, 78, 128, 81, 85, 69, 69, 206, 81, 85, 69, 128, 
+    81, 85, 66, 85, 84, 83, 128, 81, 85, 65, 84, 69, 82, 78, 73, 79, 206, 81, 
+    85, 65, 82, 84, 69, 82, 83, 128, 81, 85, 65, 82, 84, 69, 82, 211, 81, 85, 
+    65, 82, 84, 69, 82, 128, 81, 85, 65, 82, 84, 69, 210, 81, 85, 65, 78, 84, 
+    73, 84, 217, 81, 85, 65, 68, 82, 85, 80, 76, 197, 81, 85, 65, 68, 82, 65, 
+    78, 84, 128, 81, 85, 65, 68, 82, 65, 78, 212, 81, 85, 65, 68, 128, 81, 
+    85, 65, 196, 81, 85, 65, 128, 81, 85, 128, 81, 208, 81, 79, 88, 128, 81, 
+    79, 84, 128, 81, 79, 80, 72, 128, 81, 79, 80, 65, 128, 81, 79, 80, 128, 
+    81, 79, 79, 128, 81, 79, 207, 81, 79, 70, 128, 81, 79, 198, 81, 79, 65, 
+    128, 81, 79, 128, 81, 78, 128, 81, 73, 88, 128, 81, 73, 84, 83, 65, 128, 
+    81, 73, 84, 128, 81, 73, 80, 128, 81, 73, 73, 128, 81, 73, 69, 88, 128, 
+    81, 73, 69, 84, 128, 81, 73, 69, 80, 128, 81, 73, 69, 128, 81, 73, 128, 
+    81, 72, 87, 73, 128, 81, 72, 87, 69, 69, 128, 81, 72, 87, 69, 128, 81, 
+    72, 87, 65, 65, 128, 81, 72, 87, 65, 128, 81, 72, 85, 128, 81, 72, 79, 
+    128, 81, 72, 73, 128, 81, 72, 69, 69, 128, 81, 72, 69, 128, 81, 72, 65, 
+    65, 128, 81, 72, 65, 128, 81, 71, 65, 128, 81, 69, 84, 65, 78, 65, 128, 
+    81, 69, 69, 128, 81, 69, 128, 81, 65, 85, 128, 81, 65, 84, 65, 78, 128, 
+    81, 65, 82, 78, 69, 217, 81, 65, 82, 128, 81, 65, 81, 128, 81, 65, 80, 
+    72, 128, 81, 65, 77, 65, 84, 83, 128, 81, 65, 77, 65, 84, 211, 81, 65, 
+    76, 193, 81, 65, 73, 82, 84, 72, 82, 65, 128, 81, 65, 73, 128, 81, 65, 
+    70, 128, 81, 65, 198, 81, 65, 68, 77, 65, 128, 81, 65, 65, 73, 128, 81, 
+    65, 65, 70, 85, 128, 81, 65, 65, 70, 128, 81, 48, 48, 55, 128, 81, 48, 
+    48, 54, 128, 81, 48, 48, 53, 128, 81, 48, 48, 52, 128, 81, 48, 48, 51, 
+    128, 81, 48, 48, 50, 128, 81, 48, 48, 49, 128, 80, 90, 128, 80, 89, 88, 
+    128, 80, 89, 84, 128, 80, 89, 82, 88, 128, 80, 89, 82, 128, 80, 89, 80, 
+    128, 80, 89, 128, 80, 87, 79, 89, 128, 80, 87, 79, 79, 128, 80, 87, 79, 
+    128, 80, 87, 207, 80, 87, 73, 73, 128, 80, 87, 73, 128, 80, 87, 69, 69, 
+    128, 80, 87, 69, 128, 80, 87, 65, 65, 128, 80, 87, 128, 80, 86, 128, 80, 
+    85, 88, 128, 80, 85, 85, 84, 128, 80, 85, 85, 128, 80, 85, 84, 82, 69, 
+    70, 65, 67, 84, 73, 79, 78, 128, 80, 85, 84, 128, 80, 85, 212, 80, 85, 
+    83, 72, 80, 73, 78, 128, 80, 85, 83, 72, 80, 73, 75, 65, 128, 80, 85, 83, 
+    72, 73, 78, 199, 80, 85, 82, 88, 128, 80, 85, 82, 83, 69, 128, 80, 85, 
+    82, 80, 76, 197, 80, 85, 82, 78, 65, 77, 65, 128, 80, 85, 82, 73, 84, 89, 
+    128, 80, 85, 82, 73, 70, 89, 128, 80, 85, 82, 128, 80, 85, 81, 128, 80, 
+    85, 80, 128, 80, 85, 79, 88, 128, 80, 85, 79, 80, 128, 80, 85, 79, 128, 
+    80, 85, 78, 71, 65, 65, 77, 128, 80, 85, 78, 71, 128, 80, 85, 78, 67, 84, 
+    85, 65, 84, 73, 79, 78, 128, 80, 85, 78, 67, 84, 85, 65, 84, 73, 79, 206, 
+    80, 85, 77, 80, 128, 80, 85, 77, 128, 80, 85, 69, 128, 80, 85, 66, 76, 
+    73, 195, 80, 85, 65, 81, 128, 80, 85, 65, 69, 128, 80, 85, 50, 128, 80, 
+    85, 49, 128, 80, 85, 128, 80, 84, 72, 65, 72, 193, 80, 84, 69, 128, 80, 
+    83, 73, 76, 201, 80, 83, 73, 70, 73, 83, 84, 79, 83, 89, 78, 65, 71, 77, 
+    65, 128, 80, 83, 73, 70, 73, 83, 84, 79, 80, 65, 82, 65, 75, 65, 76, 69, 
+    83, 77, 65, 128, 80, 83, 73, 70, 73, 83, 84, 79, 206, 80, 83, 73, 70, 73, 
+    83, 84, 79, 76, 89, 71, 73, 83, 77, 65, 128, 80, 83, 73, 128, 80, 83, 
+    128, 80, 82, 79, 86, 69, 128, 80, 82, 79, 84, 79, 86, 65, 82, 89, 211, 
+    80, 82, 79, 84, 79, 211, 80, 82, 79, 84, 69, 67, 84, 69, 196, 80, 82, 79, 
+    83, 71, 69, 71, 82, 65, 77, 77, 69, 78, 73, 128, 80, 82, 79, 80, 79, 82, 
+    84, 73, 79, 78, 65, 204, 80, 82, 79, 80, 79, 82, 84, 73, 79, 78, 128, 80, 
+    82, 79, 80, 69, 82, 84, 217, 80, 82, 79, 80, 69, 76, 76, 69, 210, 80, 82, 
+    79, 79, 70, 128, 80, 82, 79, 76, 79, 78, 71, 69, 196, 80, 82, 79, 76, 65, 
+    84, 73, 79, 78, 197, 80, 82, 79, 74, 69, 67, 84, 73, 86, 69, 128, 80, 82, 
+    79, 74, 69, 67, 84, 73, 79, 78, 128, 80, 82, 79, 71, 82, 69, 83, 83, 128, 
+    80, 82, 79, 71, 82, 65, 205, 80, 82, 79, 70, 79, 85, 78, 68, 128, 80, 82, 
+    79, 68, 85, 67, 84, 128, 80, 82, 79, 68, 85, 67, 212, 80, 82, 73, 86, 65, 
+    84, 69, 128, 80, 82, 73, 86, 65, 84, 197, 80, 82, 73, 86, 65, 67, 217, 
+    80, 82, 73, 83, 72, 84, 72, 65, 77, 65, 84, 82, 193, 80, 82, 73, 78, 84, 
+    83, 128, 80, 82, 73, 78, 84, 128, 80, 82, 73, 78, 212, 80, 82, 73, 78, 
+    67, 69, 83, 83, 128, 80, 82, 73, 77, 69, 128, 80, 82, 73, 77, 197, 80, 
+    82, 69, 86, 73, 79, 85, 211, 80, 82, 69, 83, 69, 84, 128, 80, 82, 69, 83, 
+    69, 78, 84, 65, 84, 73, 79, 206, 80, 82, 69, 83, 67, 82, 73, 80, 84, 73, 
+    79, 206, 80, 82, 69, 80, 79, 78, 68, 69, 82, 65, 78, 67, 69, 128, 80, 82, 
+    69, 78, 75, 72, 65, 128, 80, 82, 69, 70, 65, 67, 197, 80, 82, 69, 67, 73, 
+    80, 73, 84, 65, 84, 69, 128, 80, 82, 69, 67, 69, 68, 73, 78, 199, 80, 82, 
+    69, 67, 69, 68, 69, 83, 128, 80, 82, 69, 67, 69, 68, 69, 211, 80, 82, 69, 
+    67, 69, 68, 69, 196, 80, 82, 69, 67, 69, 68, 69, 128, 80, 82, 69, 67, 69, 
+    68, 197, 80, 82, 65, 77, 45, 80, 73, 73, 128, 80, 82, 65, 77, 45, 80, 73, 
+    201, 80, 82, 65, 77, 45, 77, 85, 79, 89, 128, 80, 82, 65, 77, 45, 77, 85, 
+    79, 217, 80, 82, 65, 77, 45, 66, 85, 79, 78, 128, 80, 82, 65, 77, 45, 66, 
+    85, 79, 206, 80, 82, 65, 77, 45, 66, 69, 73, 128, 80, 82, 65, 77, 45, 66, 
+    69, 201, 80, 82, 65, 77, 128, 80, 82, 65, 205, 80, 82, 128, 80, 80, 86, 
+    128, 80, 80, 77, 128, 80, 80, 65, 128, 80, 79, 89, 128, 80, 79, 88, 128, 
+    80, 79, 87, 69, 82, 211, 80, 79, 87, 69, 82, 128, 80, 79, 87, 68, 69, 82, 
+    69, 196, 80, 79, 87, 68, 69, 82, 128, 80, 79, 85, 78, 196, 80, 79, 85, 
+    76, 84, 82, 217, 80, 79, 85, 67, 72, 128, 80, 79, 84, 65, 84, 79, 128, 
+    80, 79, 84, 65, 66, 76, 197, 80, 79, 212, 80, 79, 83, 84, 80, 79, 83, 73, 
+    84, 73, 79, 206, 80, 79, 83, 84, 66, 79, 88, 128, 80, 79, 83, 84, 65, 
+    204, 80, 79, 83, 84, 128, 80, 79, 83, 212, 80, 79, 83, 83, 69, 83, 83, 
+    73, 79, 78, 128, 80, 79, 82, 82, 69, 67, 84, 85, 83, 128, 80, 79, 82, 82, 
+    69, 67, 84, 85, 211, 80, 79, 80, 80, 69, 82, 128, 80, 79, 80, 128, 80, 
+    79, 208, 80, 79, 79, 68, 76, 69, 128, 80, 79, 79, 128, 80, 79, 78, 68, 
+    79, 128, 80, 79, 206, 80, 79, 77, 77, 69, 69, 128, 80, 79, 77, 77, 69, 
+    197, 80, 79, 76, 73, 83, 72, 128, 80, 79, 76, 73, 67, 197, 80, 79, 76, 
+    201, 80, 79, 76, 69, 128, 80, 79, 76, 197, 80, 79, 75, 82, 89, 84, 73, 
+    69, 128, 80, 79, 75, 79, 74, 73, 128, 80, 79, 73, 78, 84, 211, 80, 79, 
+    73, 78, 84, 79, 128, 80, 79, 73, 78, 84, 69, 82, 128, 80, 79, 73, 78, 84, 
+    69, 196, 80, 79, 73, 78, 84, 128, 80, 79, 73, 78, 212, 80, 79, 69, 84, 
+    82, 217, 80, 79, 69, 84, 73, 195, 80, 79, 68, 65, 84, 85, 83, 128, 80, 
+    79, 65, 128, 80, 79, 128, 80, 207, 80, 78, 69, 85, 77, 65, 84, 65, 128, 
+    80, 76, 85, 84, 79, 128, 80, 76, 85, 83, 45, 77, 73, 78, 85, 211, 80, 76, 
+    85, 83, 128, 80, 76, 85, 82, 65, 76, 128, 80, 76, 85, 77, 69, 196, 80, 
+    76, 85, 77, 128, 80, 76, 85, 75, 128, 80, 76, 85, 71, 128, 80, 76, 85, 
+    128, 80, 76, 79, 87, 128, 80, 76, 79, 80, 72, 85, 128, 80, 76, 69, 84, 
+    72, 82, 79, 78, 128, 80, 76, 68, 128, 80, 76, 65, 89, 73, 78, 199, 80, 
+    76, 65, 83, 84, 73, 67, 83, 128, 80, 76, 65, 78, 69, 128, 80, 76, 65, 78, 
+    197, 80, 76, 65, 78, 67, 203, 80, 76, 65, 75, 128, 80, 76, 65, 71, 73, 
+    79, 211, 80, 76, 65, 67, 69, 72, 79, 76, 68, 69, 210, 80, 76, 65, 67, 
+    197, 80, 76, 65, 128, 80, 73, 90, 90, 73, 67, 65, 84, 79, 128, 80, 73, 
+    90, 90, 65, 128, 80, 73, 88, 128, 80, 73, 87, 82, 128, 80, 73, 84, 67, 
+    72, 70, 79, 82, 75, 128, 80, 73, 84, 67, 72, 70, 79, 82, 203, 80, 73, 84, 
+    128, 80, 73, 83, 84, 79, 76, 128, 80, 73, 83, 69, 76, 69, 72, 128, 80, 
+    73, 83, 67, 69, 83, 128, 80, 73, 82, 73, 71, 128, 80, 73, 82, 73, 199, 
+    80, 73, 82, 73, 69, 69, 78, 128, 80, 73, 80, 73, 78, 71, 128, 80, 73, 80, 
+    65, 69, 77, 71, 66, 73, 69, 69, 128, 80, 73, 80, 65, 69, 77, 66, 65, 128, 
+    80, 73, 80, 128, 80, 73, 78, 87, 72, 69, 69, 204, 80, 73, 78, 69, 65, 80, 
+    80, 76, 69, 128, 80, 73, 78, 197, 80, 73, 78, 65, 82, 66, 79, 82, 65, 83, 
+    128, 80, 73, 76, 76, 128, 80, 73, 76, 197, 80, 73, 76, 67, 82, 79, 215, 
+    80, 73, 75, 85, 82, 85, 128, 80, 73, 75, 79, 128, 80, 73, 71, 128, 80, 
+    73, 199, 80, 73, 69, 88, 128, 80, 73, 69, 85, 80, 45, 84, 72, 73, 69, 85, 
+    84, 72, 128, 80, 73, 69, 85, 80, 45, 83, 83, 65, 78, 71, 83, 73, 79, 83, 
+    128, 80, 73, 69, 85, 80, 45, 83, 73, 79, 83, 45, 84, 73, 75, 69, 85, 84, 
+    128, 80, 73, 69, 85, 80, 45, 83, 73, 79, 83, 45, 84, 72, 73, 69, 85, 84, 
+    72, 128, 80, 73, 69, 85, 80, 45, 83, 73, 79, 83, 45, 80, 73, 69, 85, 80, 
+    128, 80, 73, 69, 85, 80, 45, 83, 73, 79, 83, 45, 75, 73, 89, 69, 79, 75, 
+    128, 80, 73, 69, 85, 80, 45, 83, 73, 79, 83, 45, 67, 73, 69, 85, 67, 128, 
+    80, 73, 69, 85, 80, 45, 82, 73, 69, 85, 76, 45, 80, 72, 73, 69, 85, 80, 
+    72, 128, 80, 73, 69, 85, 80, 45, 82, 73, 69, 85, 76, 128, 80, 73, 69, 85, 
+    80, 45, 78, 73, 69, 85, 78, 128, 80, 73, 69, 85, 80, 45, 77, 73, 69, 85, 
+    77, 128, 80, 73, 69, 85, 80, 45, 75, 72, 73, 69, 85, 75, 72, 128, 80, 73, 
+    69, 85, 80, 45, 67, 73, 69, 85, 67, 128, 80, 73, 69, 85, 80, 45, 67, 72, 
+    73, 69, 85, 67, 72, 128, 80, 73, 69, 85, 208, 80, 73, 69, 84, 128, 80, 
+    73, 69, 80, 128, 80, 73, 69, 69, 84, 128, 80, 73, 69, 69, 81, 128, 80, 
+    73, 69, 67, 69, 128, 80, 73, 69, 128, 80, 73, 67, 75, 69, 84, 128, 80, 
+    73, 67, 75, 128, 80, 73, 65, 83, 85, 84, 79, 82, 85, 128, 80, 73, 65, 83, 
+    77, 193, 80, 73, 65, 78, 79, 128, 80, 201, 80, 72, 87, 65, 128, 80, 72, 
+    85, 84, 72, 65, 79, 128, 80, 72, 85, 210, 80, 72, 85, 78, 71, 128, 80, 
+    72, 82, 65, 83, 69, 128, 80, 72, 79, 78, 69, 83, 128, 80, 72, 79, 69, 78, 
+    73, 67, 73, 65, 206, 80, 72, 79, 65, 128, 80, 72, 79, 128, 80, 72, 207, 
+    80, 72, 78, 65, 69, 203, 80, 72, 73, 78, 84, 72, 85, 128, 80, 72, 73, 76, 
+    79, 83, 79, 80, 72, 69, 82, 211, 80, 72, 73, 76, 73, 80, 80, 73, 78, 197, 
+    80, 72, 73, 69, 85, 80, 72, 45, 84, 72, 73, 69, 85, 84, 72, 128, 80, 72, 
+    73, 69, 85, 80, 72, 45, 83, 73, 79, 83, 128, 80, 72, 73, 69, 85, 80, 72, 
+    45, 80, 73, 69, 85, 80, 128, 80, 72, 73, 69, 85, 80, 72, 45, 72, 73, 69, 
+    85, 72, 128, 80, 72, 73, 69, 85, 80, 200, 80, 72, 73, 128, 80, 72, 201, 
+    80, 72, 69, 69, 128, 80, 72, 69, 128, 80, 72, 65, 83, 69, 45, 198, 80, 
+    72, 65, 83, 69, 45, 194, 80, 72, 65, 82, 89, 78, 71, 69, 65, 204, 80, 72, 
+    65, 82, 128, 80, 72, 65, 78, 128, 80, 72, 65, 77, 128, 80, 72, 65, 73, 
+    83, 84, 79, 211, 80, 72, 65, 71, 83, 45, 80, 193, 80, 72, 65, 65, 82, 75, 
+    65, 65, 128, 80, 72, 65, 65, 128, 80, 72, 65, 128, 80, 71, 128, 80, 70, 
+    128, 80, 69, 85, 88, 128, 80, 69, 85, 84, 65, 69, 128, 80, 69, 85, 84, 
+    128, 80, 69, 84, 65, 83, 84, 79, 75, 79, 85, 70, 73, 83, 77, 65, 128, 80, 
+    69, 84, 65, 83, 84, 73, 128, 80, 69, 84, 65, 83, 77, 65, 128, 80, 69, 84, 
+    65, 76, 76, 69, 196, 80, 69, 83, 79, 128, 80, 69, 83, 207, 80, 69, 83, 
+    72, 50, 128, 80, 69, 83, 69, 84, 193, 80, 69, 211, 80, 69, 82, 84, 72, 
+    207, 80, 69, 82, 83, 80, 69, 67, 84, 73, 86, 69, 128, 80, 69, 82, 83, 79, 
+    78, 65, 204, 80, 69, 82, 83, 79, 78, 128, 80, 69, 82, 83, 79, 206, 80, 
+    69, 82, 83, 73, 65, 206, 80, 69, 82, 83, 69, 86, 69, 82, 73, 78, 199, 80, 
+    69, 82, 80, 69, 78, 68, 73, 67, 85, 76, 65, 82, 128, 80, 69, 82, 80, 69, 
+    78, 68, 73, 67, 85, 76, 65, 210, 80, 69, 82, 77, 73, 84, 84, 69, 196, 80, 
+    69, 82, 77, 65, 78, 69, 78, 212, 80, 69, 82, 73, 83, 80, 79, 77, 69, 78, 
+    73, 128, 80, 69, 82, 73, 83, 80, 79, 77, 69, 78, 201, 80, 69, 82, 70, 79, 
+    82, 77, 73, 78, 199, 80, 69, 82, 70, 69, 67, 84, 85, 205, 80, 69, 82, 70, 
+    69, 67, 84, 65, 128, 80, 69, 82, 70, 69, 67, 84, 193, 80, 69, 82, 67, 85, 
+    83, 83, 73, 86, 69, 128, 80, 69, 82, 67, 69, 78, 212, 80, 69, 80, 69, 84, 
+    128, 80, 69, 80, 69, 212, 80, 69, 79, 82, 84, 200, 80, 69, 79, 80, 76, 
+    69, 128, 80, 69, 78, 84, 65, 83, 69, 77, 69, 128, 80, 69, 78, 84, 65, 71, 
+    82, 65, 77, 128, 80, 69, 78, 84, 65, 71, 79, 78, 128, 80, 69, 78, 83, 85, 
+    128, 80, 69, 78, 83, 73, 86, 197, 80, 69, 78, 78, 217, 80, 69, 78, 73, 
+    72, 73, 128, 80, 69, 78, 71, 85, 73, 78, 128, 80, 69, 78, 71, 75, 65, 76, 
+    128, 80, 69, 78, 69, 84, 82, 65, 84, 73, 79, 78, 128, 80, 69, 78, 67, 73, 
+    76, 128, 80, 69, 76, 65, 83, 84, 79, 78, 128, 80, 69, 76, 65, 83, 84, 79, 
+    206, 80, 69, 73, 84, 72, 128, 80, 69, 72, 69, 72, 128, 80, 69, 72, 69, 
+    200, 80, 69, 72, 128, 80, 69, 200, 80, 69, 69, 90, 73, 128, 80, 69, 69, 
+    83, 72, 73, 128, 80, 69, 69, 80, 128, 80, 69, 69, 77, 128, 80, 69, 69, 
+    128, 80, 69, 68, 69, 83, 84, 82, 73, 65, 78, 83, 128, 80, 69, 68, 69, 83, 
+    84, 82, 73, 65, 78, 128, 80, 69, 68, 69, 83, 84, 65, 76, 128, 80, 69, 68, 
+    69, 83, 84, 65, 204, 80, 69, 68, 65, 204, 80, 69, 65, 67, 72, 128, 80, 
+    69, 65, 67, 69, 128, 80, 69, 65, 67, 197, 80, 68, 73, 128, 80, 68, 70, 
+    128, 80, 68, 128, 80, 67, 128, 80, 65, 90, 69, 82, 128, 80, 65, 89, 69, 
+    82, 79, 75, 128, 80, 65, 89, 65, 78, 78, 65, 128, 80, 65, 89, 128, 80, 
+    65, 88, 128, 80, 65, 87, 78, 128, 80, 65, 215, 80, 65, 86, 73, 89, 65, 
+    78, 73, 128, 80, 65, 85, 128, 80, 65, 84, 84, 69, 82, 78, 128, 80, 65, 
+    84, 72, 65, 77, 65, 83, 65, 84, 128, 80, 65, 84, 200, 80, 65, 84, 65, 75, 
+    128, 80, 65, 84, 65, 72, 128, 80, 65, 84, 128, 80, 65, 83, 85, 81, 128, 
+    80, 65, 83, 83, 80, 79, 82, 212, 80, 65, 83, 83, 73, 86, 69, 45, 80, 85, 
+    76, 76, 45, 85, 80, 45, 79, 85, 84, 80, 85, 212, 80, 65, 83, 83, 73, 86, 
+    69, 45, 80, 85, 76, 76, 45, 68, 79, 87, 78, 45, 79, 85, 84, 80, 85, 212, 
+    80, 65, 83, 72, 84, 65, 128, 80, 65, 83, 72, 65, 69, 128, 80, 65, 83, 69, 
+    81, 128, 80, 65, 83, 65, 78, 71, 65, 206, 80, 65, 82, 85, 77, 128, 80, 
+    65, 82, 84, 217, 80, 65, 82, 84, 78, 69, 82, 83, 72, 73, 208, 80, 65, 82, 
+    84, 73, 65, 76, 76, 89, 45, 82, 69, 67, 89, 67, 76, 69, 196, 80, 65, 82, 
+    84, 73, 65, 204, 80, 65, 82, 84, 72, 73, 65, 206, 80, 65, 82, 212, 80, 
+    65, 82, 73, 67, 72, 79, 78, 128, 80, 65, 82, 69, 83, 84, 73, 71, 77, 69, 
+    78, 79, 206, 80, 65, 82, 69, 82, 69, 78, 128, 80, 65, 82, 69, 78, 84, 72, 
+    69, 83, 73, 83, 128, 80, 65, 82, 69, 78, 84, 72, 69, 83, 73, 211, 80, 65, 
+    82, 65, 80, 72, 82, 65, 83, 197, 80, 65, 82, 65, 76, 76, 69, 76, 79, 71, 
+    82, 65, 77, 128, 80, 65, 82, 65, 76, 76, 69, 76, 128, 80, 65, 82, 65, 76, 
+    76, 69, 204, 80, 65, 82, 65, 75, 76, 73, 84, 73, 75, 73, 128, 80, 65, 82, 
+    65, 75, 76, 73, 84, 73, 75, 201, 80, 65, 82, 65, 75, 65, 76, 69, 83, 77, 
+    193, 80, 65, 82, 65, 71, 82, 65, 80, 72, 79, 83, 128, 80, 65, 82, 65, 71, 
+    82, 65, 80, 72, 128, 80, 65, 82, 65, 71, 82, 65, 80, 200, 80, 65, 82, 65, 
+    128, 80, 65, 82, 128, 80, 65, 80, 89, 82, 85, 83, 128, 80, 65, 80, 69, 
+    82, 67, 76, 73, 80, 128, 80, 65, 80, 69, 210, 80, 65, 80, 128, 80, 65, 
+    208, 80, 65, 207, 80, 65, 78, 89, 85, 75, 85, 128, 80, 65, 78, 89, 73, 
+    75, 85, 128, 80, 65, 78, 89, 69, 67, 69, 75, 128, 80, 65, 78, 89, 65, 78, 
+    71, 71, 65, 128, 80, 65, 78, 89, 65, 75, 82, 65, 128, 80, 65, 78, 84, 73, 
+    128, 80, 65, 78, 83, 73, 79, 83, 45, 80, 73, 69, 85, 80, 128, 80, 65, 78, 
+    83, 73, 79, 83, 45, 75, 65, 80, 89, 69, 79, 85, 78, 80, 73, 69, 85, 80, 
+    128, 80, 65, 78, 79, 78, 71, 79, 78, 65, 78, 128, 80, 65, 78, 79, 76, 79, 
+    78, 71, 128, 80, 65, 78, 71, 87, 73, 83, 65, 68, 128, 80, 65, 78, 71, 82, 
+    65, 78, 71, 75, 69, 80, 128, 80, 65, 78, 71, 79, 76, 65, 84, 128, 80, 65, 
+    78, 71, 76, 79, 78, 71, 128, 80, 65, 78, 71, 76, 65, 89, 65, 82, 128, 80, 
+    65, 78, 71, 75, 79, 78, 128, 80, 65, 78, 71, 75, 65, 84, 128, 80, 65, 78, 
+    71, 72, 85, 76, 85, 128, 80, 65, 78, 71, 128, 80, 65, 78, 69, 85, 76, 69, 
+    85, 78, 71, 128, 80, 65, 78, 68, 193, 80, 65, 78, 65, 69, 76, 65, 69, 78, 
+    71, 128, 80, 65, 78, 128, 80, 65, 77, 85, 78, 71, 75, 65, 72, 128, 80, 
+    65, 77, 85, 68, 80, 79, 68, 128, 80, 65, 77, 83, 72, 65, 69, 128, 80, 65, 
+    77, 80, 72, 89, 76, 73, 65, 206, 80, 65, 77, 73, 78, 71, 75, 65, 76, 128, 
+    80, 65, 77, 69, 80, 69, 84, 128, 80, 65, 77, 69, 78, 69, 78, 71, 128, 80, 
+    65, 77, 65, 68, 65, 128, 80, 65, 77, 65, 65, 69, 72, 128, 80, 65, 76, 85, 
+    84, 65, 128, 80, 65, 76, 79, 67, 72, 75, 65, 128, 80, 65, 76, 205, 80, 
+    65, 76, 76, 65, 87, 65, 128, 80, 65, 76, 76, 65, 83, 128, 80, 65, 76, 69, 
+    84, 84, 69, 128, 80, 65, 76, 65, 85, 78, 199, 80, 65, 76, 65, 84, 65, 76, 
+    73, 90, 69, 196, 80, 65, 76, 65, 84, 65, 76, 73, 90, 65, 84, 73, 79, 78, 
+    128, 80, 65, 76, 65, 84, 65, 204, 80, 65, 75, 80, 65, 203, 80, 65, 73, 
+    89, 65, 78, 78, 79, 73, 128, 80, 65, 73, 82, 84, 72, 82, 65, 128, 80, 65, 
+    73, 82, 69, 196, 80, 65, 73, 128, 80, 65, 72, 76, 65, 86, 201, 80, 65, 
+    72, 128, 80, 65, 71, 69, 82, 128, 80, 65, 71, 197, 80, 65, 68, 77, 193, 
+    80, 65, 68, 68, 73, 78, 199, 80, 65, 68, 193, 80, 65, 68, 128, 80, 65, 
+    67, 75, 73, 78, 71, 128, 80, 65, 67, 75, 65, 71, 69, 128, 80, 65, 65, 84, 
+    85, 128, 80, 65, 65, 83, 69, 78, 84, 79, 128, 80, 65, 65, 82, 65, 69, 
+    128, 80, 65, 65, 77, 128, 80, 65, 65, 73, 128, 80, 65, 65, 45, 80, 73, 
+    76, 76, 65, 128, 80, 65, 65, 128, 80, 50, 128, 80, 48, 49, 49, 128, 80, 
+    48, 49, 48, 128, 80, 48, 48, 57, 128, 80, 48, 48, 56, 128, 80, 48, 48, 
+    55, 128, 80, 48, 48, 54, 128, 80, 48, 48, 53, 128, 80, 48, 48, 52, 128, 
+    80, 48, 48, 51, 65, 128, 80, 48, 48, 51, 128, 80, 48, 48, 50, 128, 80, 
+    48, 48, 49, 65, 128, 80, 48, 48, 49, 128, 79, 89, 82, 65, 78, 73, 83, 77, 
+    193, 79, 89, 65, 78, 78, 65, 128, 79, 88, 73, 65, 128, 79, 88, 73, 193, 
+    79, 88, 69, 73, 65, 201, 79, 88, 69, 73, 193, 79, 86, 69, 82, 82, 73, 68, 
+    69, 128, 79, 86, 69, 82, 76, 79, 78, 199, 79, 86, 69, 82, 76, 73, 78, 69, 
+    128, 79, 86, 69, 82, 76, 65, 89, 128, 79, 86, 69, 82, 76, 65, 80, 80, 73, 
+    78, 199, 79, 86, 69, 82, 76, 65, 73, 68, 128, 79, 86, 69, 82, 66, 65, 82, 
+    128, 79, 86, 65, 204, 79, 86, 128, 79, 85, 84, 76, 73, 78, 69, 196, 79, 
+    85, 84, 76, 73, 78, 69, 128, 79, 85, 84, 69, 210, 79, 85, 84, 66, 79, 
+    216, 79, 85, 78, 75, 73, 193, 79, 85, 78, 67, 69, 128, 79, 85, 78, 67, 
+    197, 79, 84, 85, 128, 79, 84, 84, 65, 86, 193, 79, 84, 84, 128, 79, 84, 
+    72, 65, 76, 65, 206, 79, 84, 72, 65, 76, 128, 79, 83, 77, 65, 78, 89, 
+    193, 79, 83, 67, 128, 79, 82, 84, 72, 79, 71, 79, 78, 65, 204, 79, 82, 
+    84, 72, 79, 68, 79, 216, 79, 82, 78, 65, 84, 197, 79, 82, 78, 65, 77, 69, 
+    78, 84, 128, 79, 82, 78, 65, 77, 69, 78, 212, 79, 82, 75, 72, 79, 206, 
+    79, 82, 73, 71, 73, 78, 65, 204, 79, 82, 73, 71, 73, 78, 128, 79, 82, 69, 
+    45, 50, 128, 79, 82, 68, 73, 78, 65, 204, 79, 82, 68, 69, 210, 79, 82, 
+    67, 72, 73, 68, 128, 79, 82, 65, 78, 71, 197, 79, 80, 84, 73, 79, 206, 
+    79, 80, 84, 73, 67, 65, 204, 79, 80, 80, 82, 69, 83, 83, 73, 79, 78, 128, 
+    79, 80, 80, 79, 83, 73, 84, 73, 79, 78, 128, 79, 80, 80, 79, 83, 73, 78, 
+    199, 79, 80, 80, 79, 83, 69, 128, 79, 80, 72, 73, 85, 67, 72, 85, 83, 
+    128, 79, 80, 69, 82, 65, 84, 79, 82, 128, 79, 80, 69, 82, 65, 84, 79, 
+    210, 79, 80, 69, 82, 65, 84, 73, 78, 199, 79, 80, 69, 78, 73, 78, 199, 
+    79, 80, 69, 78, 45, 80, 128, 79, 80, 69, 78, 45, 79, 85, 84, 76, 73, 78, 
+    69, 196, 79, 80, 69, 78, 45, 72, 69, 65, 68, 69, 196, 79, 80, 69, 78, 45, 
+    67, 73, 82, 67, 85, 73, 84, 45, 79, 85, 84, 80, 85, 212, 79, 79, 90, 69, 
+    128, 79, 79, 89, 65, 78, 78, 65, 128, 79, 79, 85, 128, 79, 79, 77, 85, 
+    128, 79, 79, 69, 128, 79, 79, 66, 79, 79, 70, 73, 76, 73, 128, 79, 78, 
+    85, 128, 79, 78, 83, 85, 128, 79, 78, 78, 128, 79, 78, 75, 65, 82, 128, 
+    79, 78, 69, 83, 69, 76, 70, 128, 79, 78, 69, 45, 87, 65, 217, 79, 78, 69, 
+    45, 84, 72, 73, 82, 84, 89, 128, 79, 78, 69, 45, 76, 73, 78, 197, 79, 78, 
+    67, 79, 77, 73, 78, 199, 79, 78, 65, 80, 128, 79, 77, 73, 83, 83, 73, 79, 
+    206, 79, 77, 73, 67, 82, 79, 78, 128, 79, 77, 73, 67, 82, 79, 206, 79, 
+    77, 69, 71, 65, 128, 79, 77, 69, 71, 193, 79, 77, 65, 76, 79, 78, 128, 
+    79, 76, 73, 86, 69, 128, 79, 76, 73, 71, 79, 206, 79, 76, 68, 128, 79, 
+    75, 84, 207, 79, 75, 65, 82, 65, 128, 79, 75, 65, 82, 193, 79, 74, 73, 
+    66, 87, 65, 217, 79, 74, 69, 79, 78, 128, 79, 73, 76, 128, 79, 72, 77, 
+    128, 79, 72, 205, 79, 71, 82, 69, 128, 79, 71, 79, 78, 69, 75, 128, 79, 
+    71, 79, 78, 69, 203, 79, 71, 72, 65, 205, 79, 70, 70, 73, 67, 69, 82, 
+    128, 79, 70, 70, 73, 67, 69, 128, 79, 70, 70, 73, 67, 197, 79, 70, 70, 
+    128, 79, 69, 89, 128, 79, 69, 75, 128, 79, 68, 69, 78, 128, 79, 68, 196, 
+    79, 67, 84, 79, 80, 85, 83, 128, 79, 67, 84, 79, 66, 69, 82, 128, 79, 67, 
+    84, 69, 212, 79, 67, 210, 79, 67, 76, 79, 67, 75, 128, 79, 67, 67, 76, 
+    85, 83, 73, 79, 78, 128, 79, 66, 83, 84, 82, 85, 67, 84, 73, 79, 78, 128, 
+    79, 66, 79, 76, 211, 79, 66, 79, 204, 79, 66, 79, 70, 73, 76, 73, 128, 
+    79, 66, 76, 73, 81, 85, 197, 79, 66, 74, 69, 67, 212, 79, 66, 69, 76, 85, 
+    83, 128, 79, 66, 69, 76, 79, 83, 128, 79, 66, 128, 79, 65, 89, 128, 79, 
+    65, 75, 128, 79, 65, 66, 79, 65, 70, 73, 76, 73, 128, 79, 193, 79, 48, 
+    53, 49, 128, 79, 48, 53, 48, 66, 128, 79, 48, 53, 48, 65, 128, 79, 48, 
+    53, 48, 128, 79, 48, 52, 57, 128, 79, 48, 52, 56, 128, 79, 48, 52, 55, 
+    128, 79, 48, 52, 54, 128, 79, 48, 52, 53, 128, 79, 48, 52, 52, 128, 79, 
+    48, 52, 51, 128, 79, 48, 52, 50, 128, 79, 48, 52, 49, 128, 79, 48, 52, 
+    48, 128, 79, 48, 51, 57, 128, 79, 48, 51, 56, 128, 79, 48, 51, 55, 128, 
+    79, 48, 51, 54, 68, 128, 79, 48, 51, 54, 67, 128, 79, 48, 51, 54, 66, 
+    128, 79, 48, 51, 54, 65, 128, 79, 48, 51, 54, 128, 79, 48, 51, 53, 128, 
+    79, 48, 51, 52, 128, 79, 48, 51, 51, 65, 128, 79, 48, 51, 51, 128, 79, 
+    48, 51, 50, 128, 79, 48, 51, 49, 128, 79, 48, 51, 48, 65, 128, 79, 48, 
+    51, 48, 128, 79, 48, 50, 57, 65, 128, 79, 48, 50, 57, 128, 79, 48, 50, 
+    56, 128, 79, 48, 50, 55, 128, 79, 48, 50, 54, 128, 79, 48, 50, 53, 65, 
+    128, 79, 48, 50, 53, 128, 79, 48, 50, 52, 65, 128, 79, 48, 50, 52, 128, 
+    79, 48, 50, 51, 128, 79, 48, 50, 50, 128, 79, 48, 50, 49, 128, 79, 48, 
+    50, 48, 65, 128, 79, 48, 50, 48, 128, 79, 48, 49, 57, 65, 128, 79, 48, 
+    49, 57, 128, 79, 48, 49, 56, 128, 79, 48, 49, 55, 128, 79, 48, 49, 54, 
+    128, 79, 48, 49, 53, 128, 79, 48, 49, 52, 128, 79, 48, 49, 51, 128, 79, 
+    48, 49, 50, 128, 79, 48, 49, 49, 128, 79, 48, 49, 48, 67, 128, 79, 48, 
+    49, 48, 66, 128, 79, 48, 49, 48, 65, 128, 79, 48, 49, 48, 128, 79, 48, 
+    48, 57, 128, 79, 48, 48, 56, 128, 79, 48, 48, 55, 128, 79, 48, 48, 54, 
+    70, 128, 79, 48, 48, 54, 69, 128, 79, 48, 48, 54, 68, 128, 79, 48, 48, 
+    54, 67, 128, 79, 48, 48, 54, 66, 128, 79, 48, 48, 54, 65, 128, 79, 48, 
+    48, 54, 128, 79, 48, 48, 53, 65, 128, 79, 48, 48, 53, 128, 79, 48, 48, 
+    52, 128, 79, 48, 48, 51, 128, 79, 48, 48, 50, 128, 79, 48, 48, 49, 65, 
+    128, 79, 48, 48, 49, 128, 79, 45, 89, 69, 128, 79, 45, 79, 45, 73, 128, 
+    79, 45, 69, 128, 78, 90, 89, 88, 128, 78, 90, 89, 84, 128, 78, 90, 89, 
+    82, 88, 128, 78, 90, 89, 82, 128, 78, 90, 89, 80, 128, 78, 90, 89, 128, 
+    78, 90, 85, 88, 128, 78, 90, 85, 82, 88, 128, 78, 90, 85, 82, 128, 78, 
+    90, 85, 81, 128, 78, 90, 85, 80, 128, 78, 90, 85, 79, 88, 128, 78, 90, 
+    85, 79, 128, 78, 90, 85, 206, 78, 90, 85, 128, 78, 90, 79, 88, 128, 78, 
+    90, 79, 80, 128, 78, 90, 73, 88, 128, 78, 90, 73, 84, 128, 78, 90, 73, 
+    80, 128, 78, 90, 73, 69, 88, 128, 78, 90, 73, 69, 80, 128, 78, 90, 73, 
+    69, 128, 78, 90, 73, 128, 78, 90, 69, 88, 128, 78, 90, 69, 85, 77, 128, 
+    78, 90, 69, 128, 78, 90, 65, 88, 128, 78, 90, 65, 84, 128, 78, 90, 65, 
+    81, 128, 78, 90, 65, 80, 128, 78, 90, 65, 128, 78, 90, 193, 78, 89, 87, 
+    65, 128, 78, 89, 85, 88, 128, 78, 89, 85, 85, 128, 78, 89, 85, 84, 128, 
+    78, 89, 85, 80, 128, 78, 89, 85, 79, 88, 128, 78, 89, 85, 79, 80, 128, 
+    78, 89, 85, 79, 128, 78, 89, 85, 69, 128, 78, 89, 85, 128, 78, 89, 79, 
+    88, 128, 78, 89, 79, 84, 128, 78, 89, 79, 80, 128, 78, 89, 79, 79, 128, 
+    78, 89, 79, 65, 128, 78, 89, 79, 128, 78, 89, 74, 65, 128, 78, 89, 73, 
+    88, 128, 78, 89, 73, 84, 128, 78, 89, 73, 212, 78, 89, 73, 211, 78, 89, 
+    73, 210, 78, 89, 73, 80, 128, 78, 89, 73, 78, 45, 68, 79, 128, 78, 89, 
+    73, 73, 128, 78, 89, 73, 69, 88, 128, 78, 89, 73, 69, 84, 128, 78, 89, 
+    73, 69, 80, 128, 78, 89, 73, 69, 128, 78, 89, 73, 128, 78, 89, 201, 78, 
+    89, 72, 65, 128, 78, 89, 69, 84, 128, 78, 89, 69, 212, 78, 89, 69, 72, 
+    128, 78, 89, 69, 200, 78, 89, 69, 69, 128, 78, 89, 69, 128, 78, 89, 196, 
+    78, 89, 67, 65, 128, 78, 89, 65, 85, 128, 78, 89, 65, 73, 128, 78, 89, 
+    65, 72, 128, 78, 89, 65, 69, 77, 65, 69, 128, 78, 89, 65, 65, 128, 78, 
+    87, 79, 79, 128, 78, 87, 79, 128, 78, 87, 73, 73, 128, 78, 87, 73, 128, 
+    78, 87, 69, 128, 78, 87, 65, 65, 128, 78, 87, 65, 128, 78, 87, 128, 78, 
+    86, 128, 78, 85, 88, 128, 78, 85, 85, 78, 128, 78, 85, 85, 128, 78, 85, 
+    84, 73, 76, 76, 85, 128, 78, 85, 84, 128, 78, 85, 212, 78, 85, 82, 88, 
+    128, 78, 85, 82, 128, 78, 85, 80, 128, 78, 85, 79, 88, 128, 78, 85, 79, 
+    80, 128, 78, 85, 79, 128, 78, 85, 78, 85, 90, 128, 78, 85, 78, 85, 218, 
+    78, 85, 78, 71, 128, 78, 85, 78, 65, 86, 85, 212, 78, 85, 78, 65, 86, 73, 
+    203, 78, 85, 78, 128, 78, 85, 206, 78, 85, 77, 69, 82, 207, 78, 85, 77, 
+    69, 82, 65, 84, 79, 210, 78, 85, 77, 69, 82, 65, 204, 78, 85, 77, 66, 69, 
+    82, 83, 128, 78, 85, 77, 66, 69, 82, 128, 78, 85, 77, 128, 78, 85, 76, 
+    76, 128, 78, 85, 76, 204, 78, 85, 76, 128, 78, 85, 75, 84, 65, 128, 78, 
+    85, 69, 78, 71, 128, 78, 85, 69, 128, 78, 85, 66, 73, 65, 206, 78, 85, 
+    65, 69, 128, 78, 85, 49, 49, 128, 78, 85, 49, 177, 78, 85, 48, 50, 50, 
+    65, 128, 78, 85, 48, 50, 50, 128, 78, 85, 48, 50, 49, 128, 78, 85, 48, 
+    50, 48, 128, 78, 85, 48, 49, 57, 128, 78, 85, 48, 49, 56, 65, 128, 78, 
+    85, 48, 49, 56, 128, 78, 85, 48, 49, 55, 128, 78, 85, 48, 49, 54, 128, 
+    78, 85, 48, 49, 53, 128, 78, 85, 48, 49, 52, 128, 78, 85, 48, 49, 51, 
+    128, 78, 85, 48, 49, 50, 128, 78, 85, 48, 49, 49, 65, 128, 78, 85, 48, 
+    49, 49, 128, 78, 85, 48, 49, 48, 65, 128, 78, 85, 48, 49, 48, 128, 78, 
+    85, 48, 48, 57, 128, 78, 85, 48, 48, 56, 128, 78, 85, 48, 48, 55, 128, 
+    78, 85, 48, 48, 54, 128, 78, 85, 48, 48, 53, 128, 78, 85, 48, 48, 52, 
+    128, 78, 85, 48, 48, 51, 128, 78, 85, 48, 48, 50, 128, 78, 85, 48, 48, 
+    49, 128, 78, 84, 85, 85, 128, 78, 84, 85, 77, 128, 78, 84, 213, 78, 84, 
+    79, 81, 80, 69, 78, 128, 78, 84, 73, 69, 197, 78, 84, 69, 85, 78, 71, 66, 
+    65, 128, 78, 84, 69, 85, 77, 128, 78, 84, 69, 78, 128, 78, 84, 69, 69, 
+    128, 78, 84, 65, 80, 128, 78, 84, 65, 208, 78, 84, 65, 65, 128, 78, 83, 
+    85, 79, 212, 78, 83, 85, 78, 128, 78, 83, 85, 77, 128, 78, 83, 79, 77, 
+    128, 78, 83, 73, 69, 69, 84, 128, 78, 83, 73, 69, 69, 80, 128, 78, 83, 
+    73, 69, 69, 128, 78, 83, 72, 85, 84, 128, 78, 83, 72, 85, 212, 78, 83, 
+    72, 85, 79, 80, 128, 78, 83, 72, 85, 69, 128, 78, 83, 72, 73, 69, 69, 
+    128, 78, 83, 72, 69, 69, 128, 78, 83, 72, 65, 81, 128, 78, 83, 72, 65, 
+    128, 78, 83, 69, 85, 65, 69, 78, 128, 78, 83, 69, 78, 128, 78, 83, 65, 
+    128, 78, 82, 89, 88, 128, 78, 82, 89, 84, 128, 78, 82, 89, 82, 88, 128, 
+    78, 82, 89, 82, 128, 78, 82, 89, 80, 128, 78, 82, 89, 128, 78, 82, 85, 
+    88, 128, 78, 82, 85, 84, 128, 78, 82, 85, 82, 88, 128, 78, 82, 85, 82, 
+    128, 78, 82, 85, 80, 128, 78, 82, 85, 128, 78, 82, 79, 88, 128, 78, 82, 
+    79, 80, 128, 78, 82, 79, 128, 78, 82, 69, 88, 128, 78, 82, 69, 84, 128, 
+    78, 82, 69, 80, 128, 78, 82, 69, 128, 78, 82, 65, 88, 128, 78, 82, 65, 
+    84, 128, 78, 82, 65, 80, 128, 78, 82, 65, 128, 78, 79, 89, 128, 78, 79, 
+    88, 128, 78, 79, 86, 69, 77, 66, 69, 82, 128, 78, 79, 84, 84, 79, 128, 
+    78, 79, 84, 69, 83, 128, 78, 79, 84, 69, 72, 69, 65, 68, 128, 78, 79, 84, 
+    69, 72, 69, 65, 196, 78, 79, 84, 69, 66, 79, 79, 75, 128, 78, 79, 84, 69, 
+    66, 79, 79, 203, 78, 79, 84, 69, 128, 78, 79, 84, 197, 78, 79, 84, 67, 
+    72, 69, 196, 78, 79, 84, 67, 72, 128, 78, 79, 84, 128, 78, 79, 212, 78, 
+    79, 83, 69, 128, 78, 79, 82, 84, 72, 87, 69, 83, 212, 78, 79, 82, 84, 72, 
+    69, 82, 206, 78, 79, 82, 84, 200, 78, 79, 82, 77, 65, 204, 78, 79, 210, 
+    78, 79, 80, 128, 78, 79, 79, 78, 85, 128, 78, 79, 79, 128, 78, 79, 78, 
+    70, 79, 82, 75, 73, 78, 71, 128, 78, 79, 78, 45, 80, 79, 84, 65, 66, 76, 
+    197, 78, 79, 78, 45, 74, 79, 73, 78, 69, 82, 128, 78, 79, 78, 45, 66, 82, 
+    69, 65, 75, 73, 78, 199, 78, 79, 77, 73, 78, 65, 204, 78, 79, 75, 72, 85, 
+    75, 128, 78, 79, 68, 69, 128, 78, 79, 65, 128, 78, 79, 45, 66, 82, 69, 
+    65, 203, 78, 78, 85, 85, 128, 78, 78, 85, 128, 78, 78, 79, 79, 128, 78, 
+    78, 79, 128, 78, 78, 78, 85, 85, 128, 78, 78, 78, 85, 128, 78, 78, 78, 
+    79, 79, 128, 78, 78, 78, 79, 128, 78, 78, 78, 73, 73, 128, 78, 78, 78, 
+    73, 128, 78, 78, 78, 69, 69, 128, 78, 78, 78, 69, 128, 78, 78, 78, 65, 
+    85, 128, 78, 78, 78, 65, 73, 128, 78, 78, 78, 65, 65, 128, 78, 78, 78, 
+    65, 128, 78, 78, 78, 128, 78, 78, 72, 65, 128, 78, 78, 71, 79, 79, 128, 
+    78, 78, 71, 79, 128, 78, 78, 71, 73, 73, 128, 78, 78, 71, 73, 128, 78, 
+    78, 71, 65, 65, 128, 78, 78, 71, 65, 128, 78, 78, 71, 128, 78, 78, 66, 
+    83, 80, 128, 78, 77, 128, 78, 76, 48, 50, 48, 128, 78, 76, 48, 49, 57, 
+    128, 78, 76, 48, 49, 56, 128, 78, 76, 48, 49, 55, 65, 128, 78, 76, 48, 
+    49, 55, 128, 78, 76, 48, 49, 54, 128, 78, 76, 48, 49, 53, 128, 78, 76, 
+    48, 49, 52, 128, 78, 76, 48, 49, 51, 128, 78, 76, 48, 49, 50, 128, 78, 
+    76, 48, 49, 49, 128, 78, 76, 48, 49, 48, 128, 78, 76, 48, 48, 57, 128, 
+    78, 76, 48, 48, 56, 128, 78, 76, 48, 48, 55, 128, 78, 76, 48, 48, 54, 
+    128, 78, 76, 48, 48, 53, 65, 128, 78, 76, 48, 48, 53, 128, 78, 76, 48, 
+    48, 52, 128, 78, 76, 48, 48, 51, 128, 78, 76, 48, 48, 50, 128, 78, 76, 
+    48, 48, 49, 128, 78, 76, 128, 78, 75, 79, 77, 128, 78, 75, 207, 78, 75, 
+    73, 78, 68, 73, 128, 78, 75, 65, 65, 82, 65, 69, 128, 78, 74, 89, 88, 
+    128, 78, 74, 89, 84, 128, 78, 74, 89, 82, 88, 128, 78, 74, 89, 82, 128, 
+    78, 74, 89, 80, 128, 78, 74, 89, 128, 78, 74, 85, 88, 128, 78, 74, 85, 
+    82, 88, 128, 78, 74, 85, 82, 128, 78, 74, 85, 81, 65, 128, 78, 74, 85, 
+    80, 128, 78, 74, 85, 79, 88, 128, 78, 74, 85, 79, 128, 78, 74, 85, 69, 
+    81, 128, 78, 74, 85, 65, 69, 128, 78, 74, 85, 128, 78, 74, 79, 88, 128, 
+    78, 74, 79, 84, 128, 78, 74, 79, 80, 128, 78, 74, 79, 79, 128, 78, 74, 
+    79, 128, 78, 74, 73, 88, 128, 78, 74, 73, 84, 128, 78, 74, 73, 80, 128, 
+    78, 74, 73, 69, 88, 128, 78, 74, 73, 69, 84, 128, 78, 74, 73, 69, 80, 
+    128, 78, 74, 73, 69, 69, 128, 78, 74, 73, 69, 128, 78, 74, 73, 128, 78, 
+    74, 201, 78, 74, 69, 85, 88, 128, 78, 74, 69, 85, 84, 128, 78, 74, 69, 
+    85, 65, 69, 78, 65, 128, 78, 74, 69, 85, 65, 69, 77, 128, 78, 74, 69, 69, 
+    69, 69, 128, 78, 74, 69, 69, 128, 78, 74, 69, 197, 78, 74, 69, 128, 78, 
+    74, 65, 81, 128, 78, 74, 65, 80, 128, 78, 74, 65, 69, 77, 76, 73, 128, 
+    78, 74, 65, 69, 77, 128, 78, 74, 65, 65, 128, 78, 73, 88, 128, 78, 73, 
+    84, 82, 69, 128, 78, 73, 83, 65, 71, 128, 78, 73, 82, 85, 71, 85, 128, 
+    78, 73, 80, 128, 78, 73, 78, 84, 72, 128, 78, 73, 78, 69, 84, 89, 128, 
+    78, 73, 78, 69, 84, 217, 78, 73, 78, 69, 84, 69, 69, 78, 128, 78, 73, 78, 
+    69, 84, 69, 69, 206, 78, 73, 78, 69, 45, 84, 72, 73, 82, 84, 89, 128, 78, 
+    73, 78, 197, 78, 73, 78, 68, 65, 50, 128, 78, 73, 78, 68, 65, 178, 78, 
+    73, 77, 128, 78, 73, 205, 78, 73, 75, 72, 65, 72, 73, 84, 128, 78, 73, 
+    75, 65, 72, 73, 84, 128, 78, 73, 75, 65, 128, 78, 73, 72, 83, 72, 86, 65, 
+    83, 65, 128, 78, 73, 71, 73, 68, 65, 77, 73, 78, 128, 78, 73, 71, 73, 68, 
+    65, 69, 83, 72, 128, 78, 73, 71, 72, 84, 128, 78, 73, 71, 72, 212, 78, 
+    73, 71, 71, 65, 72, 73, 84, 65, 128, 78, 73, 69, 88, 128, 78, 73, 69, 85, 
+    78, 45, 84, 73, 75, 69, 85, 84, 128, 78, 73, 69, 85, 78, 45, 84, 72, 73, 
+    69, 85, 84, 72, 128, 78, 73, 69, 85, 78, 45, 83, 73, 79, 83, 128, 78, 73, 
+    69, 85, 78, 45, 82, 73, 69, 85, 76, 128, 78, 73, 69, 85, 78, 45, 80, 73, 
+    69, 85, 80, 128, 78, 73, 69, 85, 78, 45, 80, 65, 78, 83, 73, 79, 83, 128, 
+    78, 73, 69, 85, 78, 45, 75, 73, 89, 69, 79, 75, 128, 78, 73, 69, 85, 78, 
+    45, 72, 73, 69, 85, 72, 128, 78, 73, 69, 85, 78, 45, 67, 73, 69, 85, 67, 
+    128, 78, 73, 69, 85, 78, 45, 67, 72, 73, 69, 85, 67, 72, 128, 78, 73, 69, 
+    85, 206, 78, 73, 69, 80, 128, 78, 73, 69, 128, 78, 73, 66, 128, 78, 73, 
+    65, 128, 78, 73, 50, 128, 78, 72, 85, 69, 128, 78, 72, 74, 65, 128, 78, 
+    72, 128, 78, 71, 89, 69, 128, 78, 71, 86, 69, 128, 78, 71, 85, 85, 128, 
+    78, 71, 85, 79, 88, 128, 78, 71, 85, 79, 84, 128, 78, 71, 85, 79, 128, 
+    78, 71, 85, 65, 69, 84, 128, 78, 71, 85, 65, 69, 128, 78, 71, 79, 88, 
+    128, 78, 71, 79, 85, 128, 78, 71, 79, 213, 78, 71, 79, 84, 128, 78, 71, 
+    79, 81, 128, 78, 71, 79, 80, 128, 78, 71, 79, 78, 128, 78, 71, 79, 77, 
+    128, 78, 71, 79, 69, 72, 128, 78, 71, 79, 69, 200, 78, 71, 207, 78, 71, 
+    75, 89, 69, 69, 128, 78, 71, 75, 87, 65, 69, 78, 128, 78, 71, 75, 85, 80, 
+    128, 78, 71, 75, 85, 78, 128, 78, 71, 75, 85, 77, 128, 78, 71, 75, 85, 
+    69, 78, 90, 69, 85, 77, 128, 78, 71, 75, 85, 197, 78, 71, 75, 73, 78, 68, 
+    201, 78, 71, 75, 73, 69, 69, 128, 78, 71, 75, 69, 85, 88, 128, 78, 71, 
+    75, 69, 85, 82, 73, 128, 78, 71, 75, 69, 85, 65, 69, 81, 128, 78, 71, 75, 
+    69, 85, 65, 69, 77, 128, 78, 71, 75, 65, 81, 128, 78, 71, 75, 65, 80, 
+    128, 78, 71, 75, 65, 65, 77, 73, 128, 78, 71, 75, 65, 128, 78, 71, 73, 
+    69, 88, 128, 78, 71, 73, 69, 80, 128, 78, 71, 73, 69, 128, 78, 71, 72, 
+    65, 128, 78, 71, 71, 87, 65, 69, 78, 128, 78, 71, 71, 85, 82, 65, 69, 
+    128, 78, 71, 71, 85, 80, 128, 78, 71, 71, 85, 79, 81, 128, 78, 71, 71, 
+    85, 79, 209, 78, 71, 71, 85, 79, 78, 128, 78, 71, 71, 85, 79, 77, 128, 
+    78, 71, 71, 85, 77, 128, 78, 71, 71, 85, 69, 69, 84, 128, 78, 71, 71, 85, 
+    65, 69, 83, 72, 65, 197, 78, 71, 71, 85, 65, 69, 206, 78, 71, 71, 85, 
+    128, 78, 71, 71, 79, 79, 128, 78, 71, 71, 79, 128, 78, 71, 71, 73, 128, 
+    78, 71, 71, 69, 85, 88, 128, 78, 71, 71, 69, 85, 65, 69, 84, 128, 78, 71, 
+    71, 69, 85, 65, 69, 128, 78, 71, 71, 69, 213, 78, 71, 71, 69, 78, 128, 
+    78, 71, 71, 69, 69, 84, 128, 78, 71, 71, 69, 69, 69, 69, 128, 78, 71, 71, 
+    69, 69, 128, 78, 71, 71, 69, 128, 78, 71, 71, 65, 80, 128, 78, 71, 71, 
+    65, 65, 77, 65, 69, 128, 78, 71, 71, 65, 65, 77, 128, 78, 71, 71, 128, 
+    78, 71, 69, 88, 128, 78, 71, 69, 85, 82, 69, 85, 84, 128, 78, 71, 69, 80, 
+    128, 78, 71, 69, 78, 128, 78, 71, 69, 69, 128, 78, 71, 69, 65, 68, 65, 
+    76, 128, 78, 71, 65, 88, 128, 78, 71, 65, 85, 128, 78, 71, 65, 84, 128, 
+    78, 71, 65, 211, 78, 71, 65, 81, 128, 78, 71, 65, 80, 128, 78, 71, 65, 
+    78, 71, 85, 128, 78, 71, 65, 78, 128, 78, 71, 65, 73, 128, 78, 71, 65, 
+    72, 128, 78, 71, 65, 65, 73, 128, 78, 71, 193, 78, 70, 128, 78, 69, 88, 
+    212, 78, 69, 88, 128, 78, 69, 87, 83, 80, 65, 80, 69, 82, 128, 78, 69, 
+    87, 76, 73, 78, 69, 128, 78, 69, 87, 128, 78, 69, 85, 84, 82, 65, 204, 
+    78, 69, 85, 84, 69, 82, 128, 78, 69, 84, 128, 78, 69, 212, 78, 69, 83, 
+    84, 69, 196, 78, 69, 81, 85, 68, 65, 65, 128, 78, 69, 80, 84, 85, 78, 69, 
+    128, 78, 69, 80, 128, 78, 69, 79, 128, 78, 69, 207, 78, 69, 78, 65, 78, 
+    79, 128, 78, 69, 78, 128, 78, 69, 76, 128, 78, 69, 73, 84, 72, 69, 210, 
+    78, 69, 71, 65, 84, 73, 79, 206, 78, 69, 71, 65, 84, 69, 196, 78, 69, 67, 
+    75, 84, 73, 69, 128, 78, 69, 66, 69, 78, 83, 84, 73, 77, 77, 69, 128, 78, 
+    68, 85, 88, 128, 78, 68, 85, 84, 128, 78, 68, 85, 82, 88, 128, 78, 68, 
+    85, 82, 128, 78, 68, 85, 80, 128, 78, 68, 85, 78, 128, 78, 68, 213, 78, 
+    68, 79, 88, 128, 78, 68, 79, 84, 128, 78, 68, 79, 80, 128, 78, 68, 79, 
+    79, 128, 78, 68, 79, 78, 128, 78, 68, 79, 77, 66, 85, 128, 78, 68, 79, 
+    76, 197, 78, 68, 73, 88, 128, 78, 68, 73, 84, 128, 78, 68, 73, 81, 128, 
+    78, 68, 73, 80, 128, 78, 68, 73, 69, 88, 128, 78, 68, 73, 69, 128, 78, 
+    68, 73, 68, 65, 128, 78, 68, 73, 65, 81, 128, 78, 68, 69, 88, 128, 78, 
+    68, 69, 85, 88, 128, 78, 68, 69, 85, 84, 128, 78, 68, 69, 85, 65, 69, 82, 
+    69, 69, 128, 78, 68, 69, 80, 128, 78, 68, 69, 69, 128, 78, 68, 69, 128, 
+    78, 68, 65, 88, 128, 78, 68, 65, 84, 128, 78, 68, 65, 80, 128, 78, 68, 
+    65, 77, 128, 78, 68, 65, 65, 78, 71, 71, 69, 85, 65, 69, 84, 128, 78, 68, 
+    65, 65, 128, 78, 68, 65, 193, 78, 66, 89, 88, 128, 78, 66, 89, 84, 128, 
+    78, 66, 89, 82, 88, 128, 78, 66, 89, 82, 128, 78, 66, 89, 80, 128, 78, 
+    66, 89, 128, 78, 66, 85, 88, 128, 78, 66, 85, 84, 128, 78, 66, 85, 82, 
+    88, 128, 78, 66, 85, 82, 128, 78, 66, 85, 80, 128, 78, 66, 85, 128, 78, 
+    66, 79, 88, 128, 78, 66, 79, 84, 128, 78, 66, 79, 80, 128, 78, 66, 79, 
+    128, 78, 66, 73, 88, 128, 78, 66, 73, 84, 128, 78, 66, 73, 80, 128, 78, 
+    66, 73, 69, 88, 128, 78, 66, 73, 69, 80, 128, 78, 66, 73, 69, 128, 78, 
+    66, 73, 128, 78, 66, 72, 128, 78, 66, 65, 88, 128, 78, 66, 65, 84, 128, 
+    78, 66, 65, 80, 128, 78, 66, 65, 128, 78, 65, 89, 65, 78, 78, 65, 128, 
+    78, 65, 89, 128, 78, 65, 88, 73, 65, 206, 78, 65, 88, 128, 78, 65, 85, 
+    84, 72, 83, 128, 78, 65, 85, 68, 73, 218, 78, 65, 84, 85, 82, 65, 204, 
+    78, 65, 84, 73, 79, 78, 65, 204, 78, 65, 83, 75, 65, 80, 201, 78, 65, 83, 
+    72, 73, 128, 78, 65, 83, 65, 76, 73, 90, 65, 84, 73, 79, 78, 128, 78, 65, 
+    83, 65, 76, 73, 90, 65, 84, 73, 79, 206, 78, 65, 82, 82, 79, 215, 78, 65, 
+    82, 128, 78, 65, 81, 128, 78, 65, 79, 211, 78, 65, 78, 83, 65, 78, 65, 
+    81, 128, 78, 65, 78, 71, 77, 79, 78, 84, 72, 79, 128, 78, 65, 78, 68, 
+    128, 78, 65, 78, 65, 128, 78, 65, 77, 69, 128, 78, 65, 77, 197, 78, 65, 
+    77, 50, 128, 78, 65, 77, 128, 78, 65, 75, 128, 78, 65, 73, 82, 193, 78, 
+    65, 73, 204, 78, 65, 71, 82, 201, 78, 65, 71, 65, 82, 128, 78, 65, 71, 
+    65, 128, 78, 65, 71, 193, 78, 65, 71, 128, 78, 65, 199, 78, 65, 69, 128, 
+    78, 65, 66, 76, 65, 128, 78, 65, 65, 83, 73, 75, 89, 65, 89, 65, 128, 78, 
+    65, 65, 75, 83, 73, 75, 89, 65, 89, 65, 128, 78, 65, 65, 73, 128, 78, 65, 
+    193, 78, 65, 50, 128, 78, 65, 45, 50, 128, 78, 48, 52, 50, 128, 78, 48, 
+    52, 49, 128, 78, 48, 52, 48, 128, 78, 48, 51, 57, 128, 78, 48, 51, 56, 
+    128, 78, 48, 51, 55, 65, 128, 78, 48, 51, 55, 128, 78, 48, 51, 54, 128, 
+    78, 48, 51, 53, 65, 128, 78, 48, 51, 53, 128, 78, 48, 51, 52, 65, 128, 
+    78, 48, 51, 52, 128, 78, 48, 51, 51, 65, 128, 78, 48, 51, 51, 128, 78, 
+    48, 51, 50, 128, 78, 48, 51, 49, 128, 78, 48, 51, 48, 128, 78, 48, 50, 
+    57, 128, 78, 48, 50, 56, 128, 78, 48, 50, 55, 128, 78, 48, 50, 54, 128, 
+    78, 48, 50, 53, 65, 128, 78, 48, 50, 53, 128, 78, 48, 50, 52, 128, 78, 
+    48, 50, 51, 128, 78, 48, 50, 50, 128, 78, 48, 50, 49, 128, 78, 48, 50, 
+    48, 128, 78, 48, 49, 57, 128, 78, 48, 49, 56, 66, 128, 78, 48, 49, 56, 
+    65, 128, 78, 48, 49, 56, 128, 78, 48, 49, 55, 128, 78, 48, 49, 54, 128, 
+    78, 48, 49, 53, 128, 78, 48, 49, 52, 128, 78, 48, 49, 51, 128, 78, 48, 
+    49, 50, 128, 78, 48, 49, 49, 128, 78, 48, 49, 48, 128, 78, 48, 48, 57, 
+    128, 78, 48, 48, 56, 128, 78, 48, 48, 55, 128, 78, 48, 48, 54, 128, 78, 
+    48, 48, 53, 128, 78, 48, 48, 52, 128, 78, 48, 48, 51, 128, 78, 48, 48, 
+    50, 128, 78, 48, 48, 49, 128, 78, 45, 67, 82, 69, 197, 78, 45, 65, 82, 
+    217, 77, 89, 88, 128, 77, 89, 84, 128, 77, 89, 83, 76, 73, 84, 69, 128, 
+    77, 89, 80, 128, 77, 89, 65, 128, 77, 89, 193, 77, 89, 128, 77, 217, 77, 
+    87, 79, 79, 128, 77, 87, 79, 128, 77, 87, 73, 73, 128, 77, 87, 73, 128, 
+    77, 87, 69, 69, 128, 77, 87, 69, 128, 77, 87, 65, 65, 128, 77, 87, 65, 
+    128, 77, 87, 128, 77, 215, 77, 86, 83, 128, 77, 86, 79, 80, 128, 77, 86, 
+    73, 128, 77, 86, 69, 85, 65, 69, 78, 71, 65, 77, 128, 77, 86, 128, 77, 
+    214, 77, 85, 88, 128, 77, 85, 85, 83, 73, 75, 65, 84, 79, 65, 78, 128, 
+    77, 85, 85, 82, 68, 72, 65, 74, 193, 77, 85, 85, 128, 77, 85, 84, 128, 
+    77, 85, 83, 73, 67, 128, 77, 85, 83, 73, 195, 77, 85, 83, 72, 82, 79, 79, 
+    77, 128, 77, 85, 83, 72, 51, 128, 77, 85, 83, 72, 179, 77, 85, 83, 72, 
+    128, 77, 85, 83, 200, 77, 85, 82, 88, 128, 77, 85, 82, 71, 85, 50, 128, 
+    77, 85, 82, 69, 128, 77, 85, 82, 68, 65, 128, 77, 85, 82, 68, 193, 77, 
+    85, 82, 128, 77, 85, 81, 68, 65, 77, 128, 77, 85, 80, 128, 77, 85, 79, 
+    88, 128, 77, 85, 79, 84, 128, 77, 85, 79, 80, 128, 77, 85, 79, 77, 65, 
+    69, 128, 77, 85, 79, 128, 77, 85, 78, 83, 85, 66, 128, 77, 85, 78, 65, 
+    72, 128, 77, 85, 76, 84, 73, 83, 69, 84, 128, 77, 85, 76, 84, 73, 83, 69, 
+    212, 77, 85, 76, 84, 73, 80, 76, 73, 67, 65, 84, 73, 79, 78, 128, 77, 85, 
+    76, 84, 73, 80, 76, 73, 67, 65, 84, 73, 79, 206, 77, 85, 76, 84, 73, 80, 
+    76, 197, 77, 85, 76, 84, 73, 79, 67, 85, 76, 65, 210, 77, 85, 76, 84, 73, 
+    77, 65, 80, 128, 77, 85, 76, 84, 201, 77, 85, 75, 80, 72, 82, 69, 78, 71, 
+    128, 77, 85, 73, 78, 128, 77, 85, 71, 83, 128, 77, 85, 71, 128, 77, 85, 
+    199, 77, 85, 69, 128, 77, 85, 67, 72, 128, 77, 85, 67, 200, 77, 85, 67, 
+    65, 65, 68, 128, 77, 85, 65, 78, 128, 77, 85, 65, 69, 128, 77, 85, 45, 
+    71, 65, 65, 72, 76, 65, 193, 77, 213, 77, 83, 128, 77, 80, 65, 128, 77, 
+    79, 89, 65, 73, 128, 77, 79, 88, 128, 77, 79, 86, 73, 197, 77, 79, 86, 
+    69, 196, 77, 79, 85, 84, 72, 128, 77, 79, 85, 84, 200, 77, 79, 85, 83, 
+    69, 128, 77, 79, 85, 83, 197, 77, 79, 85, 78, 84, 65, 73, 78, 83, 128, 
+    77, 79, 85, 78, 84, 65, 73, 78, 128, 77, 79, 85, 78, 84, 65, 73, 206, 77, 
+    79, 85, 78, 212, 77, 79, 85, 78, 68, 128, 77, 79, 85, 78, 196, 77, 79, 
+    84, 72, 69, 82, 128, 77, 79, 84, 128, 77, 79, 82, 84, 85, 85, 77, 128, 
+    77, 79, 82, 84, 65, 82, 128, 77, 79, 82, 80, 72, 79, 76, 79, 71, 73, 67, 
+    65, 204, 77, 79, 82, 78, 73, 78, 71, 128, 77, 79, 80, 128, 77, 79, 79, 
+    83, 69, 45, 67, 82, 69, 197, 77, 79, 79, 78, 128, 77, 79, 79, 206, 77, 
+    79, 79, 77, 80, 85, 81, 128, 77, 79, 79, 77, 69, 85, 84, 128, 77, 79, 79, 
+    128, 77, 79, 78, 84, 73, 69, 69, 78, 128, 77, 79, 78, 84, 72, 128, 77, 
+    79, 78, 84, 200, 77, 79, 78, 83, 84, 69, 82, 128, 77, 79, 78, 79, 83, 84, 
+    65, 66, 76, 197, 77, 79, 78, 79, 83, 80, 65, 67, 197, 77, 79, 78, 79, 82, 
+    65, 73, 76, 128, 77, 79, 78, 79, 71, 82, 65, 80, 200, 77, 79, 78, 79, 71, 
+    82, 65, 77, 77, 79, 211, 77, 79, 78, 79, 71, 82, 65, 205, 77, 79, 78, 79, 
+    70, 79, 78, 73, 65, 83, 128, 77, 79, 78, 79, 67, 85, 76, 65, 210, 77, 79, 
+    78, 75, 69, 89, 128, 77, 79, 78, 75, 69, 217, 77, 79, 78, 73, 128, 77, 
+    79, 78, 71, 75, 69, 85, 65, 69, 81, 128, 77, 79, 78, 69, 217, 77, 79, 78, 
+    128, 77, 79, 206, 77, 79, 76, 128, 77, 79, 72, 65, 77, 77, 65, 196, 77, 
+    79, 68, 85, 76, 207, 77, 79, 68, 69, 83, 84, 89, 128, 77, 79, 68, 69, 76, 
+    83, 128, 77, 79, 68, 69, 76, 128, 77, 79, 68, 69, 128, 77, 79, 66, 73, 
+    76, 197, 77, 79, 65, 128, 77, 207, 77, 78, 89, 65, 205, 77, 78, 65, 83, 
+    128, 77, 77, 83, 80, 128, 77, 77, 128, 77, 205, 77, 76, 65, 128, 77, 76, 
+    128, 77, 75, 80, 65, 82, 65, 209, 77, 73, 88, 128, 77, 73, 84, 128, 77, 
+    73, 83, 82, 65, 128, 77, 73, 82, 73, 66, 65, 65, 82, 85, 128, 77, 73, 82, 
+    73, 128, 77, 73, 82, 69, 68, 128, 77, 73, 80, 128, 77, 73, 78, 89, 128, 
+    77, 73, 78, 85, 83, 45, 79, 82, 45, 80, 76, 85, 211, 77, 73, 78, 85, 83, 
+    128, 77, 73, 78, 73, 83, 84, 69, 82, 128, 77, 73, 78, 73, 77, 65, 128, 
+    77, 73, 78, 73, 68, 73, 83, 67, 128, 77, 73, 78, 73, 66, 85, 83, 128, 77, 
+    73, 77, 69, 128, 77, 73, 77, 128, 77, 73, 76, 76, 73, 79, 78, 211, 77, 
+    73, 76, 76, 69, 84, 128, 77, 73, 76, 76, 197, 77, 73, 76, 204, 77, 73, 
+    76, 75, 217, 77, 73, 76, 128, 77, 73, 75, 85, 82, 79, 78, 128, 77, 73, 
+    75, 82, 79, 206, 77, 73, 75, 82, 73, 128, 77, 73, 73, 78, 128, 77, 73, 
+    73, 128, 77, 73, 199, 77, 73, 69, 88, 128, 77, 73, 69, 85, 77, 45, 84, 
+    73, 75, 69, 85, 84, 128, 77, 73, 69, 85, 77, 45, 83, 83, 65, 78, 71, 83, 
+    73, 79, 83, 128, 77, 73, 69, 85, 77, 45, 83, 83, 65, 78, 71, 78, 73, 69, 
+    85, 78, 128, 77, 73, 69, 85, 77, 45, 82, 73, 69, 85, 76, 128, 77, 73, 69, 
+    85, 77, 45, 80, 73, 69, 85, 80, 45, 83, 73, 79, 83, 128, 77, 73, 69, 85, 
+    77, 45, 80, 73, 69, 85, 80, 128, 77, 73, 69, 85, 77, 45, 80, 65, 78, 83, 
+    73, 79, 83, 128, 77, 73, 69, 85, 77, 45, 78, 73, 69, 85, 78, 128, 77, 73, 
+    69, 85, 77, 45, 67, 73, 69, 85, 67, 128, 77, 73, 69, 85, 77, 45, 67, 72, 
+    73, 69, 85, 67, 72, 128, 77, 73, 69, 85, 205, 77, 73, 69, 80, 128, 77, 
+    73, 69, 69, 128, 77, 73, 69, 128, 77, 73, 68, 76, 73, 78, 197, 77, 73, 
+    68, 68, 76, 69, 45, 87, 69, 76, 83, 200, 77, 73, 68, 68, 76, 197, 77, 73, 
+    196, 77, 73, 67, 82, 79, 83, 67, 79, 80, 69, 128, 77, 73, 67, 82, 79, 80, 
+    72, 79, 78, 69, 128, 77, 73, 67, 82, 207, 77, 73, 67, 210, 77, 72, 90, 
+    128, 77, 72, 65, 128, 77, 72, 128, 77, 71, 85, 88, 128, 77, 71, 85, 84, 
+    128, 77, 71, 85, 82, 88, 128, 77, 71, 85, 82, 128, 77, 71, 85, 80, 128, 
+    77, 71, 85, 79, 88, 128, 77, 71, 85, 79, 80, 128, 77, 71, 85, 79, 128, 
+    77, 71, 85, 128, 77, 71, 79, 88, 128, 77, 71, 79, 84, 128, 77, 71, 79, 
+    80, 128, 77, 71, 79, 128, 77, 71, 207, 77, 71, 73, 69, 88, 128, 77, 71, 
+    73, 69, 128, 77, 71, 69, 88, 128, 77, 71, 69, 80, 128, 77, 71, 69, 128, 
+    77, 71, 66, 85, 128, 77, 71, 66, 79, 79, 128, 77, 71, 66, 79, 70, 85, 77, 
+    128, 77, 71, 66, 79, 128, 77, 71, 66, 73, 128, 77, 71, 66, 69, 85, 78, 
+    128, 77, 71, 66, 69, 78, 128, 77, 71, 66, 69, 69, 128, 77, 71, 66, 69, 
+    128, 77, 71, 66, 65, 83, 65, 81, 128, 77, 71, 66, 65, 83, 65, 128, 77, 
+    71, 65, 88, 128, 77, 71, 65, 84, 128, 77, 71, 65, 80, 128, 77, 71, 65, 
+    128, 77, 71, 128, 77, 70, 79, 78, 128, 77, 70, 79, 206, 77, 70, 79, 128, 
+    77, 70, 73, 89, 65, 81, 128, 77, 70, 73, 69, 69, 128, 77, 70, 69, 85, 84, 
+    128, 77, 70, 69, 85, 81, 128, 77, 70, 69, 85, 65, 69, 128, 77, 70, 65, 
+    65, 128, 77, 69, 90, 90, 79, 128, 77, 69, 88, 128, 77, 69, 85, 212, 77, 
+    69, 85, 81, 128, 77, 69, 85, 78, 74, 79, 77, 78, 68, 69, 85, 81, 128, 77, 
+    69, 85, 78, 128, 77, 69, 84, 82, 79, 128, 77, 69, 84, 82, 73, 67, 65, 
+    204, 77, 69, 84, 82, 73, 65, 128, 77, 69, 84, 82, 69, 84, 69, 211, 77, 
+    69, 84, 79, 66, 69, 76, 85, 83, 128, 77, 69, 84, 69, 75, 128, 77, 69, 84, 
+    69, 71, 128, 77, 69, 84, 65, 76, 128, 77, 69, 84, 193, 77, 69, 83, 83, 
+    69, 78, 73, 65, 206, 77, 69, 83, 83, 65, 71, 69, 128, 77, 69, 83, 83, 65, 
+    71, 197, 77, 69, 83, 79, 128, 77, 69, 83, 73, 128, 77, 69, 83, 72, 128, 
+    77, 69, 82, 79, 73, 84, 73, 195, 77, 69, 82, 75, 72, 65, 128, 77, 69, 82, 
+    75, 72, 193, 77, 69, 82, 73, 68, 73, 65, 78, 83, 128, 77, 69, 82, 73, 
+    128, 77, 69, 82, 71, 69, 128, 77, 69, 82, 67, 85, 82, 89, 128, 77, 69, 
+    82, 67, 85, 82, 217, 77, 69, 78, 68, 85, 84, 128, 77, 69, 78, 128, 77, 
+    69, 77, 79, 128, 77, 69, 77, 66, 69, 82, 83, 72, 73, 80, 128, 77, 69, 77, 
+    66, 69, 82, 128, 77, 69, 77, 66, 69, 210, 77, 69, 77, 45, 81, 79, 80, 72, 
+    128, 77, 69, 77, 128, 77, 69, 205, 77, 69, 76, 79, 68, 73, 195, 77, 69, 
+    76, 73, 75, 128, 77, 69, 73, 90, 73, 128, 77, 69, 71, 65, 84, 79, 78, 
+    128, 77, 69, 71, 65, 80, 72, 79, 78, 69, 128, 77, 69, 71, 65, 76, 73, 
+    128, 77, 69, 69, 84, 79, 82, 85, 128, 77, 69, 69, 84, 128, 77, 69, 69, 
+    77, 85, 128, 77, 69, 69, 77, 128, 77, 69, 69, 69, 69, 128, 77, 69, 68, 
+    73, 85, 77, 128, 77, 69, 68, 73, 85, 205, 77, 69, 68, 73, 67, 73, 78, 69, 
+    128, 77, 69, 68, 73, 67, 65, 204, 77, 69, 65, 84, 128, 77, 69, 65, 212, 
+    77, 69, 65, 83, 85, 82, 69, 196, 77, 69, 65, 83, 85, 82, 69, 128, 77, 69, 
+    65, 83, 85, 82, 197, 77, 68, 85, 206, 77, 196, 77, 67, 72, 213, 77, 67, 
+    72, 65, 206, 77, 195, 77, 66, 85, 79, 81, 128, 77, 66, 85, 79, 128, 77, 
+    66, 85, 69, 128, 77, 66, 85, 65, 69, 77, 128, 77, 66, 85, 65, 69, 128, 
+    77, 66, 79, 79, 128, 77, 66, 79, 128, 77, 66, 73, 84, 128, 77, 66, 73, 
+    212, 77, 66, 73, 82, 73, 69, 69, 78, 128, 77, 66, 73, 128, 77, 66, 69, 
+    85, 88, 128, 77, 66, 69, 85, 82, 73, 128, 77, 66, 69, 85, 77, 128, 77, 
+    66, 69, 82, 65, 69, 128, 77, 66, 69, 78, 128, 77, 66, 69, 69, 75, 69, 69, 
+    84, 128, 77, 66, 69, 69, 128, 77, 66, 69, 128, 77, 66, 65, 81, 128, 77, 
+    66, 65, 78, 89, 73, 128, 77, 66, 65, 65, 82, 65, 69, 128, 77, 66, 65, 65, 
+    75, 69, 84, 128, 77, 66, 65, 65, 128, 77, 66, 65, 193, 77, 66, 193, 77, 
+    66, 52, 128, 77, 66, 51, 128, 77, 66, 50, 128, 77, 66, 128, 77, 194, 77, 
+    65, 89, 65, 78, 78, 65, 128, 77, 65, 89, 128, 77, 65, 88, 73, 77, 65, 
+    128, 77, 65, 88, 128, 77, 65, 85, 128, 77, 65, 84, 84, 79, 67, 75, 128, 
+    77, 65, 84, 82, 73, 88, 128, 77, 65, 84, 69, 82, 73, 65, 76, 83, 128, 77, 
+    65, 84, 128, 77, 65, 83, 213, 77, 65, 83, 83, 73, 78, 71, 128, 77, 65, 
+    83, 83, 65, 71, 69, 128, 77, 65, 83, 79, 82, 193, 77, 65, 83, 75, 128, 
+    77, 65, 83, 72, 70, 65, 65, 84, 128, 77, 65, 83, 72, 50, 128, 77, 65, 83, 
+    67, 85, 76, 73, 78, 197, 77, 65, 82, 89, 128, 77, 65, 82, 85, 75, 85, 
+    128, 77, 65, 82, 84, 89, 82, 73, 193, 77, 65, 82, 82, 89, 73, 78, 199, 
+    77, 65, 82, 82, 73, 65, 71, 197, 77, 65, 82, 75, 69, 82, 128, 77, 65, 82, 
+    75, 45, 52, 128, 77, 65, 82, 75, 45, 51, 128, 77, 65, 82, 75, 45, 50, 
+    128, 77, 65, 82, 75, 45, 49, 128, 77, 65, 82, 69, 128, 77, 65, 82, 67, 
+    72, 128, 77, 65, 82, 67, 65, 84, 79, 45, 83, 84, 65, 67, 67, 65, 84, 79, 
+    128, 77, 65, 82, 67, 65, 84, 79, 128, 77, 65, 82, 67, 65, 83, 73, 84, 69, 
+    128, 77, 65, 82, 66, 85, 84, 65, 128, 77, 65, 82, 66, 85, 84, 193, 77, 
+    65, 82, 128, 77, 65, 81, 65, 70, 128, 77, 65, 81, 128, 77, 65, 80, 76, 
+    197, 77, 65, 80, 73, 81, 128, 77, 65, 208, 77, 65, 79, 128, 77, 65, 78, 
+    83, 89, 79, 78, 128, 77, 65, 78, 83, 85, 65, 69, 128, 77, 65, 78, 78, 65, 
+    218, 77, 65, 78, 78, 65, 128, 77, 65, 78, 71, 65, 76, 65, 77, 128, 77, 
+    65, 78, 68, 65, 73, 76, 73, 78, 199, 77, 65, 78, 68, 65, 73, 195, 77, 65, 
+    78, 67, 72, 213, 77, 65, 78, 65, 67, 76, 69, 83, 128, 77, 65, 76, 84, 69, 
+    83, 197, 77, 65, 76, 69, 69, 82, 73, 128, 77, 65, 76, 69, 128, 77, 65, 
+    76, 197, 77, 65, 76, 65, 75, 79, 206, 77, 65, 75, 83, 85, 82, 65, 128, 
+    77, 65, 75, 83, 85, 82, 193, 77, 65, 73, 90, 69, 128, 77, 65, 73, 89, 65, 
+    77, 79, 75, 128, 77, 65, 73, 84, 65, 73, 75, 72, 85, 128, 77, 65, 73, 82, 
+    85, 128, 77, 65, 73, 77, 85, 65, 78, 128, 77, 65, 73, 77, 65, 76, 65, 73, 
+    128, 77, 65, 73, 76, 66, 79, 216, 77, 65, 73, 75, 85, 82, 79, 128, 77, 
+    65, 73, 68, 69, 78, 128, 77, 65, 73, 128, 77, 65, 72, 74, 79, 78, 199, 
+    77, 65, 72, 72, 65, 128, 77, 65, 72, 65, 80, 82, 65, 78, 65, 128, 77, 65, 
+    72, 65, 80, 65, 75, 72, 128, 77, 65, 72, 65, 65, 80, 82, 65, 65, 78, 193, 
+    77, 65, 72, 128, 77, 65, 71, 78, 73, 70, 89, 73, 78, 199, 77, 65, 69, 83, 
+    73, 128, 77, 65, 69, 78, 89, 73, 128, 77, 65, 69, 78, 74, 69, 84, 128, 
+    77, 65, 69, 77, 86, 69, 85, 88, 128, 77, 65, 69, 77, 75, 80, 69, 78, 128, 
+    77, 65, 69, 77, 71, 66, 73, 69, 69, 128, 77, 65, 69, 77, 66, 71, 66, 73, 
+    69, 69, 128, 77, 65, 69, 77, 66, 65, 128, 77, 65, 69, 77, 128, 77, 65, 
+    69, 76, 69, 69, 128, 77, 65, 69, 75, 69, 85, 80, 128, 77, 65, 68, 89, 65, 
+    128, 77, 65, 68, 85, 128, 77, 65, 68, 68, 65, 200, 77, 65, 68, 68, 65, 
+    128, 77, 65, 68, 68, 193, 77, 65, 67, 82, 79, 78, 45, 71, 82, 65, 86, 69, 
+    128, 77, 65, 67, 82, 79, 78, 45, 66, 82, 69, 86, 69, 128, 77, 65, 67, 82, 
+    79, 78, 45, 65, 67, 85, 84, 69, 128, 77, 65, 67, 82, 79, 78, 128, 77, 65, 
+    67, 82, 79, 206, 77, 65, 67, 72, 73, 78, 69, 128, 77, 65, 65, 89, 89, 65, 
+    65, 128, 77, 65, 65, 73, 128, 77, 65, 65, 128, 77, 65, 50, 128, 77, 48, 
+    52, 52, 128, 77, 48, 52, 51, 128, 77, 48, 52, 50, 128, 77, 48, 52, 49, 
+    128, 77, 48, 52, 48, 65, 128, 77, 48, 52, 48, 128, 77, 48, 51, 57, 128, 
+    77, 48, 51, 56, 128, 77, 48, 51, 55, 128, 77, 48, 51, 54, 128, 77, 48, 
+    51, 53, 128, 77, 48, 51, 52, 128, 77, 48, 51, 51, 66, 128, 77, 48, 51, 
+    51, 65, 128, 77, 48, 51, 51, 128, 77, 48, 51, 50, 128, 77, 48, 51, 49, 
+    65, 128, 77, 48, 51, 49, 128, 77, 48, 51, 48, 128, 77, 48, 50, 57, 128, 
+    77, 48, 50, 56, 65, 128, 77, 48, 50, 56, 128, 77, 48, 50, 55, 128, 77, 
+    48, 50, 54, 128, 77, 48, 50, 53, 128, 77, 48, 50, 52, 65, 128, 77, 48, 
+    50, 52, 128, 77, 48, 50, 51, 128, 77, 48, 50, 50, 65, 128, 77, 48, 50, 
+    50, 128, 77, 48, 50, 49, 128, 77, 48, 50, 48, 128, 77, 48, 49, 57, 128, 
+    77, 48, 49, 56, 128, 77, 48, 49, 55, 65, 128, 77, 48, 49, 55, 128, 77, 
+    48, 49, 54, 65, 128, 77, 48, 49, 54, 128, 77, 48, 49, 53, 65, 128, 77, 
+    48, 49, 53, 128, 77, 48, 49, 52, 128, 77, 48, 49, 51, 128, 77, 48, 49, 
+    50, 72, 128, 77, 48, 49, 50, 71, 128, 77, 48, 49, 50, 70, 128, 77, 48, 
+    49, 50, 69, 128, 77, 48, 49, 50, 68, 128, 77, 48, 49, 50, 67, 128, 77, 
+    48, 49, 50, 66, 128, 77, 48, 49, 50, 65, 128, 77, 48, 49, 50, 128, 77, 
+    48, 49, 49, 128, 77, 48, 49, 48, 65, 128, 77, 48, 49, 48, 128, 77, 48, 
+    48, 57, 128, 77, 48, 48, 56, 128, 77, 48, 48, 55, 128, 77, 48, 48, 54, 
+    128, 77, 48, 48, 53, 128, 77, 48, 48, 52, 128, 77, 48, 48, 51, 65, 128, 
+    77, 48, 48, 51, 128, 77, 48, 48, 50, 128, 77, 48, 48, 49, 66, 128, 77, 
+    48, 48, 49, 65, 128, 77, 48, 48, 49, 128, 76, 218, 76, 89, 89, 128, 76, 
+    89, 88, 128, 76, 89, 84, 128, 76, 89, 82, 88, 128, 76, 89, 82, 128, 76, 
+    89, 80, 128, 76, 89, 68, 73, 65, 206, 76, 89, 67, 73, 65, 206, 76, 88, 
+    128, 76, 87, 79, 79, 128, 76, 87, 79, 128, 76, 87, 73, 73, 128, 76, 87, 
+    73, 128, 76, 87, 69, 128, 76, 87, 65, 65, 128, 76, 87, 65, 128, 76, 85, 
+    88, 128, 76, 85, 85, 128, 76, 85, 84, 128, 76, 85, 82, 88, 128, 76, 85, 
+    80, 128, 76, 85, 79, 88, 128, 76, 85, 79, 84, 128, 76, 85, 79, 80, 128, 
+    76, 85, 79, 128, 76, 85, 78, 71, 83, 73, 128, 76, 85, 78, 65, 84, 197, 
+    76, 85, 205, 76, 85, 76, 128, 76, 85, 73, 83, 128, 76, 85, 72, 85, 82, 
+    128, 76, 85, 72, 128, 76, 85, 71, 71, 65, 71, 69, 128, 76, 85, 71, 65, 
+    76, 128, 76, 85, 71, 65, 204, 76, 85, 69, 128, 76, 85, 65, 69, 80, 128, 
+    76, 85, 51, 128, 76, 85, 50, 128, 76, 85, 178, 76, 82, 79, 128, 76, 82, 
+    77, 128, 76, 82, 73, 128, 76, 82, 69, 128, 76, 79, 90, 69, 78, 71, 69, 
+    128, 76, 79, 90, 69, 78, 71, 197, 76, 79, 88, 128, 76, 79, 87, 69, 82, 
+    69, 196, 76, 79, 87, 69, 210, 76, 79, 87, 45, 185, 76, 79, 86, 197, 76, 
+    79, 85, 82, 69, 128, 76, 79, 85, 68, 83, 80, 69, 65, 75, 69, 82, 128, 76, 
+    79, 85, 68, 76, 217, 76, 79, 84, 85, 83, 128, 76, 79, 84, 128, 76, 79, 
+    82, 82, 89, 128, 76, 79, 82, 82, 65, 73, 78, 69, 128, 76, 79, 81, 128, 
+    76, 79, 80, 128, 76, 79, 79, 84, 128, 76, 79, 79, 80, 69, 196, 76, 79, 
+    79, 80, 128, 76, 79, 79, 208, 76, 79, 79, 78, 128, 76, 79, 79, 203, 76, 
+    79, 79, 128, 76, 79, 78, 83, 85, 77, 128, 76, 79, 78, 71, 65, 128, 76, 
+    79, 78, 71, 193, 76, 79, 78, 71, 45, 66, 82, 65, 78, 67, 72, 45, 89, 82, 
+    128, 76, 79, 78, 71, 45, 66, 82, 65, 78, 67, 72, 45, 83, 79, 204, 76, 79, 
+    78, 71, 45, 66, 82, 65, 78, 67, 72, 45, 79, 83, 211, 76, 79, 78, 71, 45, 
+    66, 82, 65, 78, 67, 72, 45, 77, 65, 68, 210, 76, 79, 78, 71, 45, 66, 82, 
+    65, 78, 67, 72, 45, 72, 65, 71, 65, 76, 204, 76, 79, 78, 71, 45, 66, 82, 
+    65, 78, 67, 72, 45, 65, 210, 76, 79, 77, 77, 65, 69, 128, 76, 79, 77, 
+    128, 76, 79, 205, 76, 79, 76, 76, 73, 80, 79, 80, 128, 76, 79, 76, 76, 
+    128, 76, 79, 71, 210, 76, 79, 71, 79, 84, 89, 80, 197, 76, 79, 71, 79, 
+    71, 82, 65, 205, 76, 79, 71, 128, 76, 79, 68, 69, 83, 84, 79, 78, 69, 
+    128, 76, 79, 67, 79, 77, 79, 84, 73, 86, 69, 128, 76, 79, 67, 75, 73, 78, 
+    71, 45, 83, 72, 73, 70, 212, 76, 79, 67, 203, 76, 79, 67, 65, 84, 73, 86, 
+    69, 128, 76, 79, 67, 65, 84, 73, 79, 206, 76, 79, 65, 128, 76, 78, 128, 
+    76, 76, 85, 85, 128, 76, 76, 79, 79, 128, 76, 76, 76, 85, 85, 128, 76, 
+    76, 76, 85, 128, 76, 76, 76, 79, 79, 128, 76, 76, 76, 79, 128, 76, 76, 
+    76, 73, 73, 128, 76, 76, 76, 73, 128, 76, 76, 76, 69, 69, 128, 76, 76, 
+    76, 69, 128, 76, 76, 76, 65, 85, 128, 76, 76, 76, 65, 73, 128, 76, 76, 
+    76, 65, 65, 128, 76, 76, 76, 65, 128, 76, 76, 76, 128, 76, 74, 85, 68, 
+    73, 74, 69, 128, 76, 74, 69, 128, 76, 74, 128, 76, 73, 88, 128, 76, 73, 
+    87, 78, 128, 76, 73, 86, 82, 197, 76, 73, 84, 84, 76, 197, 76, 73, 84, 
+    84, 69, 210, 76, 73, 84, 82, 193, 76, 73, 84, 128, 76, 73, 83, 213, 76, 
+    73, 82, 193, 76, 73, 81, 85, 73, 196, 76, 73, 81, 128, 76, 73, 80, 83, 
+    84, 73, 67, 75, 128, 76, 73, 78, 75, 73, 78, 199, 76, 73, 78, 203, 76, 
+    73, 78, 71, 83, 65, 128, 76, 73, 78, 69, 83, 128, 76, 73, 78, 69, 211, 
+    76, 73, 78, 69, 45, 57, 128, 76, 73, 78, 69, 45, 55, 128, 76, 73, 78, 69, 
+    45, 51, 128, 76, 73, 78, 69, 45, 49, 128, 76, 73, 77, 77, 85, 52, 128, 
+    76, 73, 77, 77, 85, 50, 128, 76, 73, 77, 77, 85, 128, 76, 73, 77, 77, 
+    213, 76, 73, 77, 73, 84, 69, 196, 76, 73, 77, 73, 84, 65, 84, 73, 79, 78, 
+    128, 76, 73, 77, 73, 84, 128, 76, 73, 77, 69, 128, 76, 73, 77, 66, 213, 
+    76, 73, 76, 89, 128, 76, 73, 76, 73, 84, 72, 128, 76, 73, 76, 128, 76, 
+    73, 71, 72, 84, 78, 73, 78, 71, 128, 76, 73, 71, 72, 84, 72, 79, 85, 83, 
+    69, 128, 76, 73, 71, 72, 84, 128, 76, 73, 70, 69, 128, 76, 73, 69, 88, 
+    128, 76, 73, 69, 84, 128, 76, 73, 69, 80, 128, 76, 73, 69, 69, 128, 76, 
+    73, 69, 128, 76, 73, 68, 128, 76, 73, 66, 82, 65, 128, 76, 73, 66, 69, 
+    82, 84, 89, 128, 76, 73, 65, 66, 73, 76, 73, 84, 217, 76, 72, 73, 73, 
+    128, 76, 72, 65, 86, 73, 89, 65, 78, 73, 128, 76, 72, 65, 199, 76, 72, 
+    65, 65, 128, 76, 72, 128, 76, 69, 90, 72, 128, 76, 69, 88, 128, 76, 69, 
+    86, 69, 204, 76, 69, 85, 77, 128, 76, 69, 85, 65, 69, 80, 128, 76, 69, 
+    85, 65, 69, 77, 128, 76, 69, 85, 128, 76, 69, 213, 76, 69, 84, 84, 69, 
+    82, 83, 128, 76, 69, 84, 84, 69, 82, 128, 76, 69, 212, 76, 69, 83, 83, 
+    69, 210, 76, 69, 83, 83, 45, 84, 72, 65, 78, 128, 76, 69, 83, 83, 45, 84, 
+    72, 65, 206, 76, 69, 80, 128, 76, 69, 79, 80, 65, 82, 68, 128, 76, 69, 
+    79, 128, 76, 69, 78, 84, 73, 67, 85, 76, 65, 210, 76, 69, 78, 73, 83, 
+    128, 76, 69, 78, 71, 84, 72, 69, 78, 69, 82, 128, 76, 69, 78, 71, 84, 
+    200, 76, 69, 78, 71, 65, 128, 76, 69, 78, 71, 193, 76, 69, 77, 79, 78, 
+    128, 76, 69, 77, 79, 73, 128, 76, 69, 76, 69, 84, 128, 76, 69, 76, 69, 
+    212, 76, 69, 203, 76, 69, 73, 77, 77, 65, 128, 76, 69, 73, 77, 77, 193, 
+    76, 69, 71, 83, 128, 76, 69, 71, 73, 79, 78, 128, 76, 69, 71, 69, 84, 79, 
+    211, 76, 69, 71, 128, 76, 69, 70, 84, 87, 65, 82, 68, 83, 128, 76, 69, 
+    70, 84, 45, 84, 79, 45, 82, 73, 71, 72, 212, 76, 69, 70, 84, 45, 83, 84, 
+    69, 205, 76, 69, 70, 84, 45, 83, 73, 68, 197, 76, 69, 70, 84, 45, 83, 72, 
+    65, 68, 69, 196, 76, 69, 70, 84, 45, 80, 79, 73, 78, 84, 73, 78, 199, 76, 
+    69, 70, 84, 45, 72, 65, 78, 68, 69, 196, 76, 69, 70, 84, 45, 72, 65, 78, 
+    196, 76, 69, 70, 84, 45, 70, 65, 67, 73, 78, 199, 76, 69, 70, 84, 128, 
+    76, 69, 69, 82, 65, 69, 87, 65, 128, 76, 69, 69, 75, 128, 76, 69, 69, 69, 
+    69, 128, 76, 69, 68, 71, 69, 82, 128, 76, 69, 65, 84, 72, 69, 82, 128, 
+    76, 69, 65, 70, 128, 76, 69, 65, 198, 76, 69, 65, 68, 73, 78, 199, 76, 
+    69, 65, 68, 69, 82, 128, 76, 69, 65, 196, 76, 68, 65, 78, 128, 76, 68, 
+    50, 128, 76, 67, 201, 76, 67, 197, 76, 65, 90, 217, 76, 65, 89, 65, 78, 
+    78, 65, 128, 76, 65, 88, 128, 76, 65, 87, 128, 76, 65, 215, 76, 65, 85, 
+    76, 65, 128, 76, 65, 85, 75, 65, 218, 76, 65, 84, 73, 78, 65, 84, 197, 
+    76, 65, 84, 73, 75, 128, 76, 65, 84, 69, 82, 65, 204, 76, 65, 84, 197, 
+    76, 65, 83, 212, 76, 65, 82, 89, 78, 71, 69, 65, 204, 76, 65, 82, 71, 69, 
+    210, 76, 65, 82, 71, 69, 128, 76, 65, 82, 71, 197, 76, 65, 81, 128, 76, 
+    65, 80, 65, 81, 128, 76, 65, 80, 128, 76, 65, 78, 84, 69, 82, 78, 128, 
+    76, 65, 78, 71, 85, 65, 71, 197, 76, 65, 78, 69, 83, 128, 76, 65, 77, 69, 
+    68, 72, 128, 76, 65, 77, 69, 68, 128, 76, 65, 77, 69, 196, 76, 65, 77, 
+    69, 128, 76, 65, 77, 197, 76, 65, 77, 68, 65, 128, 76, 65, 77, 68, 128, 
+    76, 65, 77, 66, 68, 193, 76, 65, 77, 65, 68, 72, 128, 76, 65, 76, 128, 
+    76, 65, 204, 76, 65, 75, 75, 72, 65, 78, 71, 89, 65, 79, 128, 76, 65, 74, 
+    65, 78, 89, 65, 76, 65, 78, 128, 76, 65, 201, 76, 65, 72, 83, 72, 85, 
+    128, 76, 65, 72, 128, 76, 65, 71, 85, 83, 128, 76, 65, 71, 213, 76, 65, 
+    71, 65, 82, 128, 76, 65, 71, 65, 210, 76, 65, 71, 65, 66, 128, 76, 65, 
+    71, 65, 194, 76, 65, 69, 86, 128, 76, 65, 69, 128, 76, 65, 68, 217, 76, 
+    65, 67, 75, 128, 76, 65, 67, 65, 128, 76, 65, 66, 79, 85, 82, 73, 78, 71, 
+    128, 76, 65, 66, 79, 82, 128, 76, 65, 66, 73, 65, 76, 73, 90, 65, 84, 73, 
+    79, 206, 76, 65, 66, 73, 65, 204, 76, 65, 66, 65, 84, 128, 76, 65, 65, 
+    78, 65, 69, 128, 76, 65, 65, 78, 128, 76, 65, 65, 77, 85, 128, 76, 65, 
+    65, 77, 128, 76, 65, 65, 73, 128, 76, 48, 48, 54, 65, 128, 76, 48, 48, 
+    50, 65, 128, 76, 45, 84, 89, 80, 197, 76, 45, 83, 72, 65, 80, 69, 196, 
+    75, 89, 85, 82, 73, 73, 128, 75, 89, 85, 128, 75, 89, 79, 128, 75, 89, 
+    76, 73, 83, 77, 65, 128, 75, 89, 73, 128, 75, 89, 69, 128, 75, 89, 65, 
+    84, 72, 79, 211, 75, 89, 65, 65, 128, 75, 89, 65, 128, 75, 88, 87, 73, 
+    128, 75, 88, 87, 69, 69, 128, 75, 88, 87, 69, 128, 75, 88, 87, 65, 65, 
+    128, 75, 88, 87, 65, 128, 75, 88, 85, 128, 75, 88, 79, 128, 75, 88, 73, 
+    128, 75, 88, 69, 69, 128, 75, 88, 69, 128, 75, 88, 65, 65, 128, 75, 88, 
+    65, 128, 75, 87, 85, 51, 49, 56, 128, 75, 87, 79, 79, 128, 75, 87, 79, 
+    128, 75, 87, 73, 73, 128, 75, 87, 73, 128, 75, 87, 69, 69, 128, 75, 87, 
+    69, 128, 75, 87, 65, 89, 128, 75, 87, 65, 69, 84, 128, 75, 87, 65, 65, 
+    128, 75, 86, 65, 128, 75, 86, 128, 75, 85, 88, 128, 75, 85, 85, 72, 128, 
+    75, 85, 84, 128, 75, 85, 83, 77, 65, 128, 75, 85, 83, 72, 85, 50, 128, 
+    75, 85, 82, 88, 128, 75, 85, 82, 85, 90, 69, 73, 82, 79, 128, 75, 85, 82, 
+    84, 128, 75, 85, 82, 79, 79, 78, 69, 128, 75, 85, 82, 128, 75, 85, 210, 
+    75, 85, 81, 128, 75, 85, 79, 88, 128, 75, 85, 79, 80, 128, 75, 85, 79, 
+    208, 75, 85, 79, 77, 128, 75, 85, 79, 128, 75, 85, 78, 71, 128, 75, 85, 
+    78, 68, 68, 65, 76, 73, 89, 65, 128, 75, 85, 76, 128, 75, 85, 204, 75, 
+    85, 69, 84, 128, 75, 85, 55, 128, 75, 85, 52, 128, 75, 85, 180, 75, 85, 
+    51, 128, 75, 85, 179, 75, 84, 128, 75, 83, 83, 85, 85, 128, 75, 83, 83, 
+    85, 128, 75, 83, 83, 79, 79, 128, 75, 83, 83, 79, 128, 75, 83, 83, 73, 
+    73, 128, 75, 83, 83, 73, 128, 75, 83, 83, 69, 69, 128, 75, 83, 83, 69, 
+    128, 75, 83, 83, 65, 85, 128, 75, 83, 83, 65, 73, 128, 75, 83, 83, 65, 
+    65, 128, 75, 83, 83, 65, 128, 75, 83, 83, 128, 75, 83, 73, 128, 75, 82, 
+    69, 77, 65, 83, 84, 73, 128, 75, 82, 65, 84, 73, 77, 79, 89, 80, 79, 82, 
+    82, 79, 79, 78, 128, 75, 82, 65, 84, 73, 77, 79, 75, 79, 85, 70, 73, 83, 
+    77, 65, 128, 75, 82, 65, 84, 73, 77, 65, 84, 65, 128, 75, 82, 65, 84, 73, 
+    77, 193, 75, 80, 85, 128, 75, 80, 79, 81, 128, 75, 80, 79, 79, 128, 75, 
+    80, 79, 128, 75, 80, 73, 128, 75, 80, 69, 85, 88, 128, 75, 80, 69, 69, 
+    128, 75, 80, 69, 128, 75, 80, 65, 82, 65, 81, 128, 75, 80, 65, 78, 128, 
+    75, 80, 65, 128, 75, 79, 88, 128, 75, 79, 86, 85, 85, 128, 75, 79, 84, 
+    79, 128, 75, 79, 82, 85, 78, 65, 128, 75, 79, 82, 79, 78, 73, 83, 128, 
+    75, 79, 82, 69, 65, 206, 75, 79, 82, 65, 78, 73, 195, 75, 79, 81, 78, 68, 
+    79, 78, 128, 75, 79, 80, 80, 65, 128, 75, 79, 80, 128, 75, 79, 79, 80, 
+    79, 128, 75, 79, 79, 77, 85, 85, 84, 128, 75, 79, 79, 128, 75, 79, 78, 
+    84, 69, 86, 77, 65, 128, 75, 79, 78, 84, 69, 86, 77, 193, 75, 79, 77, 
+    201, 75, 79, 77, 66, 85, 86, 65, 128, 75, 79, 77, 66, 85, 86, 193, 75, 
+    79, 77, 66, 213, 75, 79, 75, 79, 128, 75, 79, 75, 128, 75, 79, 203, 75, 
+    79, 73, 128, 75, 79, 201, 75, 79, 72, 128, 75, 79, 71, 72, 79, 77, 128, 
+    75, 79, 69, 84, 128, 75, 79, 65, 76, 65, 128, 75, 79, 65, 128, 75, 78, 
+    73, 71, 72, 84, 128, 75, 78, 73, 71, 72, 212, 75, 78, 73, 70, 69, 128, 
+    75, 78, 73, 70, 197, 75, 77, 128, 75, 205, 75, 76, 73, 84, 79, 78, 128, 
+    75, 76, 65, 83, 77, 65, 128, 75, 76, 65, 83, 77, 193, 75, 76, 65, 128, 
+    75, 76, 128, 75, 75, 85, 128, 75, 75, 79, 128, 75, 75, 73, 128, 75, 75, 
+    69, 69, 128, 75, 75, 69, 128, 75, 75, 65, 128, 75, 75, 128, 75, 74, 69, 
+    128, 75, 73, 89, 69, 79, 75, 45, 84, 73, 75, 69, 85, 84, 128, 75, 73, 89, 
+    69, 79, 75, 45, 83, 73, 79, 83, 45, 75, 73, 89, 69, 79, 75, 128, 75, 73, 
+    89, 69, 79, 75, 45, 82, 73, 69, 85, 76, 128, 75, 73, 89, 69, 79, 75, 45, 
+    80, 73, 69, 85, 80, 128, 75, 73, 89, 69, 79, 75, 45, 78, 73, 69, 85, 78, 
+    128, 75, 73, 89, 69, 79, 75, 45, 75, 72, 73, 69, 85, 75, 72, 128, 75, 73, 
+    89, 69, 79, 75, 45, 67, 72, 73, 69, 85, 67, 72, 128, 75, 73, 89, 69, 79, 
+    203, 75, 73, 88, 128, 75, 73, 84, 128, 75, 73, 83, 83, 73, 78, 199, 75, 
+    73, 83, 83, 128, 75, 73, 83, 211, 75, 73, 83, 73, 77, 53, 128, 75, 73, 
+    83, 73, 77, 181, 75, 73, 83, 72, 128, 75, 73, 83, 65, 76, 128, 75, 73, 
+    82, 79, 87, 65, 84, 84, 79, 128, 75, 73, 82, 79, 77, 69, 69, 84, 79, 82, 
+    85, 128, 75, 73, 82, 79, 71, 85, 82, 65, 77, 85, 128, 75, 73, 82, 79, 
+    128, 75, 73, 82, 71, 72, 73, 218, 75, 73, 81, 128, 75, 73, 80, 128, 75, 
+    73, 208, 75, 73, 78, 83, 72, 73, 80, 128, 75, 73, 78, 68, 69, 82, 71, 65, 
+    82, 84, 69, 78, 128, 75, 73, 77, 79, 78, 79, 128, 75, 73, 73, 128, 75, 
+    73, 72, 128, 75, 73, 69, 88, 128, 75, 73, 69, 80, 128, 75, 73, 69, 69, 
+    77, 128, 75, 73, 69, 128, 75, 73, 68, 128, 75, 73, 196, 75, 73, 67, 75, 
+    128, 75, 72, 90, 128, 75, 72, 87, 65, 73, 128, 75, 72, 85, 69, 78, 45, 
+    76, 85, 197, 75, 72, 85, 69, 206, 75, 72, 85, 68, 65, 77, 128, 75, 72, 
+    85, 65, 84, 128, 75, 72, 79, 85, 128, 75, 72, 79, 212, 75, 72, 79, 78, 
+    128, 75, 72, 79, 77, 85, 84, 128, 75, 72, 79, 128, 75, 72, 207, 75, 72, 
+    77, 213, 75, 72, 73, 84, 128, 75, 72, 73, 78, 89, 65, 128, 75, 72, 73, 
+    69, 85, 75, 200, 75, 72, 73, 128, 75, 72, 72, 79, 128, 75, 72, 72, 65, 
+    128, 75, 72, 69, 84, 72, 128, 75, 72, 69, 73, 128, 75, 72, 69, 69, 128, 
+    75, 72, 69, 128, 75, 72, 65, 82, 79, 83, 72, 84, 72, 201, 75, 72, 65, 82, 
+    128, 75, 72, 65, 80, 72, 128, 75, 72, 65, 78, 199, 75, 72, 65, 78, 68, 
+    193, 75, 72, 65, 78, 128, 75, 72, 65, 77, 84, 201, 75, 72, 65, 75, 65, 
+    83, 83, 73, 65, 206, 75, 72, 65, 73, 128, 75, 72, 65, 72, 128, 75, 72, 
+    65, 200, 75, 72, 65, 65, 128, 75, 71, 128, 75, 69, 89, 67, 65, 80, 128, 
+    75, 69, 89, 67, 65, 208, 75, 69, 89, 66, 79, 65, 82, 68, 128, 75, 69, 88, 
+    128, 75, 69, 85, 89, 69, 85, 88, 128, 75, 69, 85, 83, 72, 69, 85, 65, 69, 
+    80, 128, 75, 69, 85, 83, 69, 85, 88, 128, 75, 69, 85, 80, 85, 81, 128, 
+    75, 69, 85, 79, 212, 75, 69, 85, 77, 128, 75, 69, 85, 75, 69, 85, 84, 78, 
+    68, 65, 128, 75, 69, 85, 75, 65, 81, 128, 75, 69, 85, 65, 69, 84, 77, 69, 
+    85, 78, 128, 75, 69, 85, 65, 69, 82, 73, 128, 75, 69, 84, 84, 201, 75, 
+    69, 83, 72, 50, 128, 75, 69, 82, 69, 84, 128, 75, 69, 79, 87, 128, 75, 
+    69, 78, 84, 73, 77, 65, 84, 65, 128, 75, 69, 78, 84, 73, 77, 65, 84, 193, 
+    75, 69, 78, 84, 73, 77, 193, 75, 69, 78, 65, 84, 128, 75, 69, 78, 128, 
+    75, 69, 206, 75, 69, 77, 80, 85, 76, 128, 75, 69, 77, 80, 85, 204, 75, 
+    69, 77, 80, 76, 73, 128, 75, 69, 77, 80, 76, 201, 75, 69, 77, 80, 72, 82, 
+    69, 78, 71, 128, 75, 69, 77, 66, 65, 78, 71, 128, 75, 69, 76, 86, 73, 
+    206, 75, 69, 72, 69, 72, 128, 75, 69, 72, 69, 200, 75, 69, 72, 128, 75, 
+    69, 70, 85, 76, 65, 128, 75, 69, 69, 83, 85, 128, 75, 69, 69, 80, 73, 78, 
+    199, 75, 69, 69, 78, 71, 128, 75, 67, 65, 76, 128, 75, 66, 128, 75, 65, 
+    90, 65, 75, 200, 75, 65, 89, 65, 78, 78, 65, 128, 75, 65, 89, 65, 200, 
+    75, 65, 88, 128, 75, 65, 87, 73, 128, 75, 65, 86, 89, 75, 65, 128, 75, 
+    65, 85, 78, 65, 128, 75, 65, 85, 206, 75, 65, 85, 128, 75, 65, 84, 79, 
+    128, 75, 65, 84, 72, 73, 83, 84, 73, 128, 75, 65, 84, 72, 65, 75, 193, 
+    75, 65, 84, 65, 86, 65, 83, 77, 65, 128, 75, 65, 84, 65, 86, 193, 75, 65, 
+    84, 65, 75, 65, 78, 65, 45, 72, 73, 82, 65, 71, 65, 78, 193, 75, 65, 83, 
+    82, 65, 84, 65, 78, 128, 75, 65, 83, 82, 65, 84, 65, 206, 75, 65, 83, 82, 
+    65, 128, 75, 65, 83, 82, 193, 75, 65, 83, 75, 65, 76, 128, 75, 65, 83, 
+    75, 65, 204, 75, 65, 83, 72, 77, 73, 82, 201, 75, 65, 82, 83, 72, 65, 78, 
+    65, 128, 75, 65, 82, 79, 82, 73, 73, 128, 75, 65, 82, 207, 75, 65, 82, 
+    69, 206, 75, 65, 82, 65, 84, 84, 79, 128, 75, 65, 82, 65, 78, 128, 75, 
+    65, 80, 89, 69, 79, 85, 78, 83, 83, 65, 78, 71, 80, 73, 69, 85, 80, 128, 
+    75, 65, 80, 89, 69, 79, 85, 78, 82, 73, 69, 85, 76, 128, 75, 65, 80, 89, 
+    69, 79, 85, 78, 80, 72, 73, 69, 85, 80, 72, 128, 75, 65, 80, 89, 69, 79, 
+    85, 78, 77, 73, 69, 85, 77, 128, 75, 65, 80, 80, 65, 128, 75, 65, 80, 80, 
+    193, 75, 65, 80, 79, 128, 75, 65, 80, 72, 128, 75, 65, 80, 65, 76, 128, 
+    75, 65, 80, 65, 128, 75, 65, 78, 84, 65, 74, 193, 75, 65, 78, 71, 128, 
+    75, 65, 78, 199, 75, 65, 78, 65, 75, 79, 128, 75, 65, 77, 52, 128, 75, 
+    65, 77, 50, 128, 75, 65, 77, 128, 75, 65, 75, 79, 128, 75, 65, 75, 65, 
+    66, 65, 84, 128, 75, 65, 75, 128, 75, 65, 203, 75, 65, 73, 84, 72, 201, 
+    75, 65, 73, 82, 73, 128, 75, 65, 73, 128, 75, 65, 201, 75, 65, 70, 65, 
+    128, 75, 65, 70, 128, 75, 65, 198, 75, 65, 68, 53, 128, 75, 65, 68, 181, 
+    75, 65, 68, 52, 128, 75, 65, 68, 51, 128, 75, 65, 68, 179, 75, 65, 68, 
+    50, 128, 75, 65, 68, 128, 75, 65, 66, 193, 75, 65, 66, 128, 75, 65, 65, 
+    73, 128, 75, 65, 65, 70, 85, 128, 75, 65, 65, 70, 128, 75, 65, 50, 128, 
+    75, 65, 178, 75, 48, 48, 56, 128, 75, 48, 48, 55, 128, 75, 48, 48, 54, 
+    128, 75, 48, 48, 53, 128, 75, 48, 48, 52, 128, 75, 48, 48, 51, 128, 75, 
+    48, 48, 50, 128, 75, 48, 48, 49, 128, 74, 87, 65, 128, 74, 85, 85, 128, 
+    74, 85, 84, 128, 74, 85, 83, 84, 73, 70, 73, 67, 65, 84, 73, 79, 78, 128, 
+    74, 85, 80, 73, 84, 69, 82, 128, 74, 85, 79, 84, 128, 74, 85, 79, 80, 
+    128, 74, 85, 78, 79, 128, 74, 85, 78, 69, 128, 74, 85, 76, 89, 128, 74, 
+    85, 69, 85, 73, 128, 74, 85, 68, 85, 76, 128, 74, 85, 68, 71, 69, 128, 
+    74, 85, 68, 69, 79, 45, 83, 80, 65, 78, 73, 83, 200, 74, 79, 89, 79, 85, 
+    211, 74, 79, 89, 128, 74, 79, 86, 69, 128, 74, 79, 212, 74, 79, 78, 71, 
+    128, 74, 79, 78, 193, 74, 79, 75, 69, 82, 128, 74, 79, 73, 78, 69, 68, 
+    128, 74, 79, 73, 78, 128, 74, 79, 65, 128, 74, 74, 89, 88, 128, 74, 74, 
+    89, 84, 128, 74, 74, 89, 80, 128, 74, 74, 89, 128, 74, 74, 85, 88, 128, 
+    74, 74, 85, 84, 128, 74, 74, 85, 82, 88, 128, 74, 74, 85, 82, 128, 74, 
+    74, 85, 80, 128, 74, 74, 85, 79, 88, 128, 74, 74, 85, 79, 80, 128, 74, 
+    74, 85, 79, 128, 74, 74, 85, 128, 74, 74, 79, 88, 128, 74, 74, 79, 84, 
+    128, 74, 74, 79, 80, 128, 74, 74, 79, 128, 74, 74, 73, 88, 128, 74, 74, 
+    73, 84, 128, 74, 74, 73, 80, 128, 74, 74, 73, 69, 88, 128, 74, 74, 73, 
+    69, 84, 128, 74, 74, 73, 69, 80, 128, 74, 74, 73, 69, 128, 74, 74, 73, 
+    128, 74, 74, 69, 69, 128, 74, 74, 69, 128, 74, 74, 65, 128, 74, 73, 76, 
+    128, 74, 73, 73, 128, 74, 73, 72, 86, 65, 77, 85, 76, 73, 89, 65, 128, 
+    74, 73, 65, 128, 74, 72, 79, 128, 74, 72, 69, 72, 128, 74, 72, 65, 78, 
+    128, 74, 72, 65, 77, 128, 74, 72, 65, 65, 128, 74, 72, 65, 128, 74, 69, 
+    85, 128, 74, 69, 82, 85, 83, 65, 76, 69, 77, 128, 74, 69, 82, 65, 206, 
+    74, 69, 82, 65, 128, 74, 69, 82, 128, 74, 69, 72, 128, 74, 69, 200, 74, 
+    69, 71, 79, 71, 65, 78, 128, 74, 69, 69, 77, 128, 74, 69, 65, 78, 83, 
+    128, 74, 65, 89, 65, 78, 78, 65, 128, 74, 65, 86, 73, 89, 65, 78, 73, 
+    128, 74, 65, 85, 128, 74, 65, 82, 128, 74, 65, 80, 65, 78, 69, 83, 197, 
+    74, 65, 80, 65, 78, 128, 74, 65, 78, 85, 65, 82, 89, 128, 74, 65, 76, 76, 
+    65, 74, 65, 76, 65, 76, 79, 85, 72, 79, 85, 128, 74, 65, 73, 128, 74, 65, 
+    72, 128, 74, 65, 68, 69, 128, 74, 65, 67, 75, 45, 79, 45, 76, 65, 78, 84, 
+    69, 82, 78, 128, 74, 65, 67, 203, 74, 45, 83, 73, 77, 80, 76, 73, 70, 73, 
+    69, 196, 202, 73, 90, 72, 73, 84, 83, 65, 128, 73, 90, 72, 73, 84, 83, 
+    193, 73, 90, 72, 69, 128, 73, 90, 65, 75, 65, 89, 193, 73, 89, 69, 75, 
+    128, 73, 89, 65, 78, 78, 65, 128, 73, 85, 74, 65, 128, 73, 85, 128, 73, 
+    84, 211, 73, 84, 69, 82, 65, 84, 73, 79, 206, 73, 84, 69, 77, 128, 73, 
+    83, 83, 72, 65, 82, 128, 73, 83, 79, 78, 128, 73, 83, 79, 206, 73, 83, 
+    79, 76, 65, 84, 69, 128, 73, 83, 69, 78, 45, 73, 83, 69, 78, 128, 73, 83, 
+    65, 75, 73, 193, 73, 83, 45, 80, 73, 76, 76, 65, 128, 73, 82, 85, 89, 65, 
+    78, 78, 65, 128, 73, 82, 85, 85, 89, 65, 78, 78, 65, 128, 73, 82, 79, 78, 
+    45, 67, 79, 80, 80, 69, 210, 73, 82, 79, 78, 128, 73, 79, 84, 73, 70, 73, 
+    69, 196, 73, 79, 84, 65, 84, 69, 196, 73, 79, 84, 65, 128, 73, 79, 84, 
+    193, 73, 79, 82, 128, 73, 79, 68, 72, 65, 68, 72, 128, 73, 78, 86, 73, 
+    83, 73, 66, 76, 197, 73, 78, 86, 69, 82, 84, 69, 68, 128, 73, 78, 86, 69, 
+    82, 84, 69, 196, 73, 78, 86, 69, 82, 83, 197, 73, 78, 84, 82, 79, 68, 85, 
+    67, 69, 82, 128, 73, 78, 84, 73, 128, 73, 78, 84, 69, 82, 83, 89, 76, 76, 
+    65, 66, 73, 195, 73, 78, 84, 69, 82, 83, 69, 67, 84, 73, 79, 78, 128, 73, 
+    78, 84, 69, 82, 83, 69, 67, 84, 73, 79, 206, 73, 78, 84, 69, 82, 83, 69, 
+    67, 84, 73, 78, 199, 73, 78, 84, 69, 82, 82, 79, 66, 65, 78, 71, 128, 73, 
+    78, 84, 69, 82, 80, 79, 76, 65, 84, 73, 79, 206, 73, 78, 84, 69, 82, 76, 
+    79, 67, 75, 69, 196, 73, 78, 84, 69, 82, 76, 73, 78, 69, 65, 210, 73, 78, 
+    84, 69, 82, 76, 65, 67, 69, 196, 73, 78, 84, 69, 82, 73, 79, 210, 73, 78, 
+    84, 69, 82, 69, 83, 212, 73, 78, 84, 69, 82, 67, 65, 76, 65, 84, 69, 128, 
+    73, 78, 84, 69, 71, 82, 65, 84, 73, 79, 78, 128, 73, 78, 84, 69, 71, 82, 
+    65, 84, 73, 79, 206, 73, 78, 84, 69, 71, 82, 65, 76, 128, 73, 78, 84, 69, 
+    71, 82, 65, 204, 73, 78, 83, 85, 76, 65, 210, 73, 78, 83, 84, 82, 85, 77, 
+    69, 78, 84, 65, 204, 73, 78, 83, 73, 68, 69, 128, 73, 78, 83, 69, 82, 84, 
+    73, 79, 206, 73, 78, 83, 69, 67, 84, 128, 73, 78, 83, 67, 82, 73, 80, 84, 
+    73, 79, 78, 65, 204, 73, 78, 80, 85, 212, 73, 78, 78, 79, 67, 69, 78, 67, 
+    69, 128, 73, 78, 78, 78, 128, 73, 78, 78, 69, 82, 128, 73, 78, 78, 69, 
+    210, 73, 78, 78, 128, 73, 78, 73, 78, 71, 85, 128, 73, 78, 73, 128, 73, 
+    78, 72, 73, 66, 73, 212, 73, 78, 72, 69, 82, 69, 78, 212, 73, 78, 71, 87, 
+    65, 90, 128, 73, 78, 70, 79, 82, 77, 65, 84, 73, 79, 206, 73, 78, 70, 76, 
+    85, 69, 78, 67, 69, 128, 73, 78, 70, 73, 78, 73, 84, 89, 128, 73, 78, 70, 
+    73, 78, 73, 84, 217, 73, 78, 68, 85, 83, 84, 82, 73, 65, 204, 73, 78, 68, 
+    73, 82, 69, 67, 212, 73, 78, 68, 73, 67, 65, 84, 79, 82, 128, 73, 78, 68, 
+    73, 67, 65, 84, 79, 210, 73, 78, 68, 73, 195, 73, 78, 68, 73, 65, 206, 
+    73, 78, 68, 69, 88, 128, 73, 78, 68, 69, 80, 69, 78, 68, 69, 78, 212, 73, 
+    78, 67, 82, 69, 77, 69, 78, 84, 128, 73, 78, 67, 82, 69, 65, 83, 69, 211, 
+    73, 78, 67, 82, 69, 65, 83, 69, 128, 73, 78, 67, 79, 77, 80, 76, 69, 84, 
+    197, 73, 78, 67, 79, 77, 73, 78, 199, 73, 78, 67, 76, 85, 68, 73, 78, 
+    199, 73, 78, 67, 72, 128, 73, 78, 66, 79, 216, 73, 78, 65, 80, 128, 73, 
+    78, 45, 65, 76, 65, 70, 128, 73, 77, 80, 69, 82, 73, 65, 204, 73, 77, 80, 
+    69, 82, 70, 69, 67, 84, 85, 205, 73, 77, 80, 69, 82, 70, 69, 67, 84, 65, 
+    128, 73, 77, 80, 69, 82, 70, 69, 67, 84, 193, 73, 77, 78, 128, 73, 77, 
+    73, 83, 69, 79, 211, 73, 77, 73, 78, 51, 128, 73, 77, 73, 78, 128, 73, 
+    77, 73, 206, 73, 77, 73, 70, 84, 72, 79, 82, 79, 78, 128, 73, 77, 73, 70, 
+    84, 72, 79, 82, 65, 128, 73, 77, 73, 70, 79, 78, 79, 78, 128, 73, 77, 73, 
+    68, 73, 65, 82, 71, 79, 78, 128, 73, 77, 65, 71, 197, 73, 76, 85, 89, 65, 
+    78, 78, 65, 128, 73, 76, 85, 89, 128, 73, 76, 85, 85, 89, 65, 78, 78, 65, 
+    128, 73, 76, 85, 84, 128, 73, 76, 73, 77, 77, 85, 52, 128, 73, 76, 73, 
+    77, 77, 85, 51, 128, 73, 76, 73, 77, 77, 85, 128, 73, 76, 73, 77, 77, 
+    213, 73, 76, 50, 128, 73, 75, 65, 82, 65, 128, 73, 75, 65, 82, 193, 73, 
+    74, 128, 73, 73, 89, 65, 78, 78, 65, 128, 73, 71, 73, 128, 73, 71, 201, 
+    73, 71, 71, 87, 83, 128, 73, 70, 73, 78, 128, 73, 69, 85, 78, 71, 45, 84, 
+    73, 75, 69, 85, 84, 128, 73, 69, 85, 78, 71, 45, 84, 72, 73, 69, 85, 84, 
+    72, 128, 73, 69, 85, 78, 71, 45, 83, 83, 65, 78, 71, 75, 73, 89, 69, 79, 
+    75, 128, 73, 69, 85, 78, 71, 45, 82, 73, 69, 85, 76, 128, 73, 69, 85, 78, 
+    71, 45, 80, 73, 69, 85, 80, 128, 73, 69, 85, 78, 71, 45, 80, 72, 73, 69, 
+    85, 80, 72, 128, 73, 69, 85, 78, 71, 45, 75, 73, 89, 69, 79, 75, 128, 73, 
+    69, 85, 78, 71, 45, 75, 72, 73, 69, 85, 75, 72, 128, 73, 69, 85, 78, 71, 
+    45, 67, 73, 69, 85, 67, 128, 73, 69, 85, 78, 71, 45, 67, 72, 73, 69, 85, 
+    67, 72, 128, 73, 69, 85, 78, 199, 73, 68, 76, 69, 128, 73, 68, 73, 77, 
+    128, 73, 68, 73, 205, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 68, 
+    57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 68, 56, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 68, 55, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 65, 68, 54, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 65, 68, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 65, 68, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 68, 
+    51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 68, 50, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 68, 49, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 65, 68, 48, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 65, 67, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 65, 67, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 
+    68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 67, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 66, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 65, 67, 65, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 65, 67, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 65, 67, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 
+    55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 54, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 53, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 65, 67, 52, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 65, 67, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 65, 67, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 
+    49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 48, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 66, 70, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 65, 66, 69, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 65, 66, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 65, 66, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 66, 
+    66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 66, 65, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 66, 57, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 65, 66, 56, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 65, 66, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 65, 66, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 66, 
+    53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 66, 52, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 66, 51, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 65, 66, 50, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 65, 66, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 65, 66, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 65, 
+    70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 65, 69, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 65, 68, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 65, 65, 67, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 65, 65, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 65, 65, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 65, 
+    57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 65, 56, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 65, 55, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 65, 65, 54, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 65, 65, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 65, 65, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 65, 
+    51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 65, 50, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 65, 49, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 65, 65, 48, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 65, 57, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 65, 57, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 
+    68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 67, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 66, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 65, 57, 65, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 65, 57, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 65, 57, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 
+    55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 54, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 53, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 65, 57, 52, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 65, 57, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 65, 57, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 
+    49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 48, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 56, 70, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 65, 56, 69, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 65, 56, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 65, 56, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 56, 
+    66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 56, 65, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 56, 57, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 65, 56, 56, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 65, 56, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 65, 56, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 56, 
+    53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 56, 52, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 56, 51, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 65, 56, 50, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 65, 56, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 65, 56, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 55, 
+    70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 55, 69, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 55, 68, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 65, 55, 67, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 65, 55, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 65, 55, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 55, 
+    57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 55, 56, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 55, 55, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 65, 55, 54, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 65, 55, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 65, 55, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 55, 
+    51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 55, 50, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 55, 49, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 65, 55, 48, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 65, 54, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 65, 54, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 54, 
+    66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 54, 65, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 54, 57, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 65, 54, 56, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 65, 54, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 65, 54, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 54, 
+    53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 54, 52, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 54, 51, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 65, 54, 50, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 65, 54, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 65, 54, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 
+    70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 69, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 68, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 65, 53, 67, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 65, 53, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 65, 53, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 
+    57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 56, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 55, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 65, 53, 54, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 65, 53, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 65, 53, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 
+    51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 50, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 49, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 65, 53, 48, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 65, 52, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 65, 52, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 52, 
+    68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 52, 67, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 52, 66, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 65, 52, 65, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 65, 52, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 65, 52, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 52, 
+    55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 52, 54, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 52, 53, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 65, 52, 52, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 65, 52, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 65, 52, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 52, 
+    49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 52, 48, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 51, 70, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 65, 51, 69, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 65, 51, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 65, 51, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 51, 
+    66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 51, 65, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 51, 57, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 65, 51, 56, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 65, 51, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 65, 51, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 51, 
+    53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 51, 52, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 51, 51, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 65, 51, 50, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 65, 51, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 65, 51, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 50, 
+    70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 50, 69, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 50, 68, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 65, 50, 67, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 65, 50, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 65, 50, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 50, 
+    57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 50, 56, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 50, 55, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 65, 50, 54, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 65, 50, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 65, 50, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 50, 
+    51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 50, 50, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 50, 49, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 65, 50, 48, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 65, 49, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 65, 49, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 49, 
+    68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 49, 67, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 49, 66, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 65, 49, 65, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 65, 49, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 65, 49, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 49, 
+    55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 49, 54, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 49, 53, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 65, 49, 52, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 65, 49, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 65, 49, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 49, 
+    49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 49, 48, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 48, 70, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 65, 48, 69, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 65, 48, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 65, 48, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 48, 
+    66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 48, 65, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 48, 57, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 65, 48, 56, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 65, 48, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 65, 48, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 48, 
+    53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 48, 52, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 48, 51, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 65, 48, 50, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 65, 48, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 65, 48, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 70, 
+    70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 70, 69, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 70, 68, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 70, 67, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 57, 70, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 57, 70, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 70, 
+    57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 70, 56, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 70, 55, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 70, 54, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 57, 70, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 57, 70, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 70, 
+    51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 70, 50, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 70, 49, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 70, 48, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 57, 69, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 57, 69, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 69, 
+    68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 69, 67, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 69, 66, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 69, 65, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 57, 69, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 57, 69, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 69, 
+    55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 69, 54, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 69, 53, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 69, 52, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 57, 69, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 57, 69, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 69, 
+    49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 69, 48, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 68, 70, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 68, 69, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 57, 68, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 57, 68, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 68, 
+    66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 68, 65, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 68, 57, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 68, 56, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 57, 68, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 57, 68, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 68, 
+    53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 68, 52, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 68, 51, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 68, 50, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 57, 68, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 57, 68, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 67, 
+    70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 67, 69, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 67, 68, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 67, 67, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 57, 67, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 57, 67, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 67, 
+    57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 67, 56, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 67, 55, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 67, 54, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 57, 67, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 57, 67, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 67, 
+    51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 67, 50, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 67, 49, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 67, 48, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 57, 66, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 57, 66, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 66, 
+    68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 66, 67, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 66, 66, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 66, 65, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 57, 66, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 57, 66, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 66, 
+    55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 66, 54, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 66, 53, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 66, 52, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 57, 66, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 57, 66, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 66, 
+    49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 66, 48, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 65, 70, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 65, 69, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 57, 65, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 57, 65, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 65, 
+    66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 65, 65, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 65, 57, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 65, 56, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 57, 65, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 57, 65, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 65, 
+    53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 65, 52, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 65, 51, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 65, 50, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 57, 65, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 57, 65, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 57, 
+    70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 57, 69, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 57, 68, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 57, 67, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 57, 57, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 57, 57, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 57, 
+    57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 57, 56, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 57, 55, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 57, 54, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 57, 57, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 57, 57, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 57, 
+    51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 57, 50, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 57, 49, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 57, 48, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 57, 56, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 57, 56, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 56, 
+    68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 56, 67, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 56, 66, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 56, 65, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 57, 56, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 57, 56, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 56, 
+    55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 56, 54, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 56, 53, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 56, 52, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 57, 56, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 57, 56, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 56, 
+    49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 56, 48, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 55, 70, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 55, 69, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 57, 55, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 57, 55, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 55, 
+    66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 55, 65, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 55, 57, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 55, 56, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 57, 55, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 57, 55, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 55, 
+    53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 55, 52, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 55, 51, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 55, 50, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 57, 55, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 57, 55, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 54, 
+    70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 54, 69, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 54, 68, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 54, 67, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 57, 54, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 57, 54, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 54, 
+    57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 54, 56, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 54, 55, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 54, 54, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 57, 54, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 57, 54, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 54, 
+    51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 54, 50, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 54, 49, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 54, 48, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 57, 53, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 57, 53, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 53, 
+    68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 53, 67, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 53, 66, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 53, 65, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 57, 53, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 57, 53, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 53, 
+    55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 53, 54, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 53, 53, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 53, 52, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 57, 53, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 57, 53, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 53, 
+    49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 53, 48, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 52, 70, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 52, 69, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 57, 52, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 57, 52, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 52, 
+    66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 52, 65, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 52, 57, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 52, 56, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 57, 52, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 57, 52, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 52, 
+    53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 52, 52, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 52, 51, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 52, 50, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 57, 52, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 57, 52, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 51, 
+    70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 51, 69, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 51, 68, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 51, 67, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 57, 51, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 57, 51, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 51, 
+    57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 51, 56, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 51, 55, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 51, 54, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 57, 51, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 57, 51, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 51, 
+    51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 51, 50, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 51, 49, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 51, 48, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 57, 50, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 57, 50, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 50, 
+    68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 50, 67, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 50, 66, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 50, 65, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 57, 50, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 57, 50, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 50, 
+    55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 50, 54, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 50, 53, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 50, 52, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 57, 50, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 57, 50, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 50, 
+    49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 50, 48, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 49, 70, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 49, 69, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 57, 49, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 57, 49, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 49, 
+    66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 49, 65, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 49, 57, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 49, 56, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 57, 49, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 57, 49, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 49, 
+    53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 49, 52, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 49, 51, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 49, 50, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 57, 49, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 57, 49, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 48, 
+    70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 48, 69, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 48, 68, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 48, 67, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 57, 48, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 57, 48, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 48, 
+    57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 48, 56, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 48, 55, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 48, 54, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 70, 57, 48, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    70, 57, 48, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 48, 
+    51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 48, 50, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 48, 49, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 70, 57, 48, 48, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 57, 48, 52, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    56, 68, 55, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 56, 67, 65, 
+    57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 56, 57, 69, 51, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 55, 68, 52, 50, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 55, 65, 55, 65, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 55, 57, 56, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    55, 54, 68, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 55, 53, 51, 
+    51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 55, 53, 49, 70, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 55, 49, 50, 49, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 55, 48, 66, 57, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 54, 70, 49, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    54, 69, 56, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 54, 55, 50, 
+    67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 54, 55, 48, 57, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 54, 55, 48, 56, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 54, 54, 50, 48, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 54, 53, 66, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    54, 53, 57, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 54, 53, 53, 
+    55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 54, 51, 53, 53, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 54, 51, 48, 55, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 54, 50, 57, 53, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 54, 50, 53, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    54, 50, 52, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 53, 70, 56, 
+    67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 53, 68, 69, 54, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 53, 66, 56, 57, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 53, 66, 53, 55, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 53, 57, 50, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    53, 57, 49, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 53, 56, 70, 
+    48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 53, 53, 66, 54, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 53, 52, 51, 57, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 53, 52, 48, 56, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 53, 51, 70, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    53, 51, 67, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 53, 50, 68, 
+    68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 53, 50, 55, 50, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 53, 50, 52, 68, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 53, 50, 49, 68, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 53, 49, 56, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 
+    52, 69, 65, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 52, 69, 56, 
+    67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 52, 69, 50, 68, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 52, 69, 48, 57, 128, 73, 68, 69, 79, 
+    71, 82, 65, 80, 72, 45, 52, 69, 48, 48, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 65, 49, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 65, 49, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 65, 49, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 
+    49, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 49, 57, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 49, 56, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 49, 55, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 49, 54, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 65, 49, 53, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 65, 49, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 65, 49, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 65, 49, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 
+    49, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 49, 48, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 48, 70, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 48, 69, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 48, 68, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 65, 48, 67, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 65, 48, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 65, 48, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 65, 48, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 
+    48, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 48, 55, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 48, 54, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 48, 53, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 48, 52, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 65, 48, 51, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 65, 48, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 65, 48, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 65, 48, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 
+    70, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 70, 69, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 70, 68, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 70, 67, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 70, 66, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 57, 70, 65, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 57, 70, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 57, 70, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 57, 70, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 
+    70, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 70, 53, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 70, 52, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 70, 51, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 70, 50, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 57, 70, 49, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 57, 70, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 57, 69, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 57, 69, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 
+    69, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 69, 67, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 69, 66, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 69, 65, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 69, 57, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 57, 69, 56, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 57, 69, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 57, 69, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 57, 69, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 
+    69, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 69, 51, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 69, 50, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 69, 49, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 69, 48, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 57, 68, 70, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 57, 68, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 57, 68, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 57, 68, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 
+    68, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 68, 65, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 68, 57, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 68, 56, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 68, 55, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 57, 68, 54, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 57, 68, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 57, 68, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 57, 68, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 
+    68, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 68, 49, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 68, 48, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 67, 70, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 67, 69, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 57, 67, 68, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 57, 67, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 57, 67, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 57, 67, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 
+    67, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 67, 56, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 67, 55, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 67, 54, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 67, 53, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 57, 67, 52, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 57, 67, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 57, 67, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 57, 67, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 
+    67, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 66, 70, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 66, 69, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 66, 68, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 66, 67, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 57, 66, 66, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 57, 66, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 57, 66, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 57, 66, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 
+    66, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 66, 54, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 66, 53, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 66, 52, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 66, 51, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 57, 66, 50, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 57, 66, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 57, 66, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 57, 65, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 
+    65, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 65, 68, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 65, 67, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 65, 66, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 65, 65, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 57, 65, 57, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 57, 65, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 57, 65, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 57, 65, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 
+    65, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 65, 52, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 65, 51, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 65, 50, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 65, 49, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 57, 65, 48, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 57, 57, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 57, 57, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 57, 57, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 
+    57, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 57, 66, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 57, 65, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 57, 57, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 57, 56, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 57, 57, 55, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 57, 57, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 57, 57, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 57, 57, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 
+    57, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 57, 50, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 57, 49, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 57, 48, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 56, 70, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 57, 56, 69, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 57, 56, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 57, 56, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 57, 56, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 
+    56, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 56, 57, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 56, 56, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 56, 55, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 56, 54, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 57, 56, 53, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 57, 56, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 57, 56, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 57, 56, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 
+    56, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 56, 48, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 55, 70, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 55, 69, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 55, 68, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 57, 55, 67, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 57, 55, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 57, 55, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 57, 55, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 
+    55, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 55, 55, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 55, 54, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 55, 53, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 55, 52, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 57, 55, 51, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 57, 55, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 57, 55, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 57, 55, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 
+    54, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 54, 69, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 54, 68, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 54, 67, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 54, 66, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 57, 54, 65, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 57, 54, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 57, 54, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 57, 54, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 
+    54, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 54, 53, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 54, 52, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 54, 51, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 54, 50, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 57, 54, 49, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 57, 54, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 57, 53, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 57, 53, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 
+    53, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 53, 67, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 53, 66, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 53, 65, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 53, 57, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 57, 53, 56, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 57, 53, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 57, 53, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 57, 53, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 
+    53, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 53, 51, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 53, 50, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 53, 49, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 53, 48, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 57, 52, 70, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 57, 52, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 57, 52, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 57, 52, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 
+    52, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 52, 65, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 52, 57, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 52, 56, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 52, 55, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 57, 52, 54, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 57, 52, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 57, 52, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 57, 52, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 
+    52, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 52, 49, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 52, 48, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 51, 70, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 51, 69, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 57, 51, 68, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 57, 51, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 57, 51, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 57, 51, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 
+    51, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 51, 56, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 51, 55, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 51, 54, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 51, 53, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 57, 51, 52, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 57, 51, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 57, 51, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 57, 51, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 
+    51, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 50, 70, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 50, 69, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 50, 68, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 50, 67, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 57, 50, 66, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 57, 50, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 57, 50, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 57, 50, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 
+    50, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 50, 54, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 50, 53, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 50, 52, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 50, 51, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 57, 50, 50, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 57, 50, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 57, 50, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 57, 49, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 
+    49, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 49, 68, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 49, 67, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 49, 66, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 49, 65, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 57, 49, 57, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 57, 49, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 57, 49, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 57, 49, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 
+    49, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 49, 52, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 49, 51, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 49, 50, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 49, 49, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 57, 49, 48, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 57, 48, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 57, 48, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 57, 48, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 
+    48, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 48, 66, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 48, 65, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 48, 57, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 48, 56, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 57, 48, 55, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 57, 48, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 57, 48, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 57, 48, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 
+    48, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 48, 50, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 48, 49, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 48, 48, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 70, 70, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 56, 70, 69, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 56, 70, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 56, 70, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 56, 70, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 
+    70, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 70, 57, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 70, 56, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 70, 55, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 70, 54, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 56, 70, 53, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 56, 70, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 56, 70, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 56, 70, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 
+    70, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 70, 48, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 69, 70, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 69, 69, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 69, 68, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 56, 69, 67, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 56, 69, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 56, 69, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 56, 69, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 
+    69, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 69, 55, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 69, 54, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 69, 53, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 69, 52, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 56, 69, 51, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 56, 69, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 56, 69, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 56, 69, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 
+    68, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 68, 69, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 68, 68, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 68, 67, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 68, 66, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 56, 68, 65, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 56, 68, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 56, 68, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 56, 68, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 
+    68, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 68, 53, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 68, 52, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 68, 51, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 68, 50, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 56, 68, 49, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 56, 68, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 56, 67, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 56, 67, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 
+    67, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 67, 67, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 67, 66, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 67, 65, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 67, 57, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 56, 67, 56, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 56, 67, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 56, 67, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 56, 67, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 
+    67, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 67, 51, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 67, 50, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 67, 49, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 67, 48, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 56, 66, 70, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 56, 66, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 56, 66, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 56, 66, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 
+    66, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 66, 65, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 66, 57, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 66, 56, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 66, 55, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 56, 66, 54, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 56, 66, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 56, 66, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 56, 66, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 
+    66, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 66, 49, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 66, 48, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 65, 70, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 65, 69, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 56, 65, 68, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 56, 65, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 56, 65, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 56, 65, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 
+    65, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 65, 56, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 65, 55, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 65, 54, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 65, 53, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 56, 65, 52, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 56, 65, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 56, 65, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 56, 65, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 
+    65, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 57, 70, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 57, 69, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 57, 68, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 57, 67, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 56, 57, 66, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 56, 57, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 56, 57, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 56, 57, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 
+    57, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 57, 54, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 57, 53, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 57, 52, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 57, 51, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 56, 57, 50, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 56, 57, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 56, 57, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 56, 56, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 
+    56, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 56, 68, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 56, 67, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 56, 66, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 56, 65, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 56, 56, 57, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 56, 56, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 56, 56, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 56, 56, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 
+    56, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 56, 52, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 56, 51, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 56, 50, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 56, 49, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 56, 56, 48, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 56, 55, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 56, 55, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 56, 55, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 
+    55, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 55, 66, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 55, 65, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 55, 57, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 55, 56, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 56, 55, 55, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 56, 55, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 56, 55, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 56, 55, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 
+    55, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 55, 50, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 55, 49, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 55, 48, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 54, 70, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 56, 54, 69, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 56, 54, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 56, 54, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 56, 54, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 
+    54, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 54, 57, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 54, 56, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 54, 55, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 54, 54, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 56, 54, 53, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 56, 54, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 56, 54, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 56, 54, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 
+    54, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 54, 48, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 53, 70, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 53, 69, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 53, 68, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 56, 53, 67, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 56, 53, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 56, 53, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 56, 53, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 
+    53, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 53, 55, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 53, 54, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 53, 53, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 53, 52, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 56, 53, 51, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 56, 53, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 56, 53, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 56, 53, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 
+    52, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 52, 69, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 52, 68, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 52, 67, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 52, 66, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 56, 52, 65, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 56, 52, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 56, 52, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 56, 52, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 
+    52, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 52, 53, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 52, 52, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 52, 51, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 52, 50, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 56, 52, 49, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 56, 52, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 56, 51, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 56, 51, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 
+    51, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 51, 67, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 51, 66, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 51, 65, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 51, 57, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 56, 51, 56, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 56, 51, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 56, 51, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 56, 51, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 
+    51, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 51, 51, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 51, 50, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 51, 49, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 51, 48, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 56, 50, 70, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 56, 50, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 56, 50, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 56, 50, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 
+    50, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 50, 65, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 50, 57, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 50, 56, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 50, 55, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 56, 50, 54, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 56, 50, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 56, 50, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 56, 50, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 
+    50, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 50, 49, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 50, 48, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 49, 70, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 49, 69, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 56, 49, 68, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 56, 49, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 56, 49, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 56, 49, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 
+    49, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 49, 56, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 49, 55, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 49, 54, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 49, 53, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 56, 49, 52, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 56, 49, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 56, 49, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 56, 49, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 
+    49, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 48, 70, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 48, 69, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 48, 68, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 48, 67, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 56, 48, 66, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 56, 48, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 56, 48, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 
+    70, 56, 48, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 
+    48, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 48, 54, 
+    128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 48, 53, 128, 73, 
+    68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 48, 52, 128, 73, 68, 69, 
+    79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 48, 51, 128, 73, 68, 69, 79, 71, 
+    82, 65, 80, 72, 45, 50, 70, 56, 48, 50, 128, 73, 68, 69, 79, 71, 82, 65, 
+    80, 72, 45, 50, 70, 56, 48, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 
+    45, 50, 70, 56, 48, 48, 128, 73, 68, 69, 78, 84, 73, 70, 73, 67, 65, 84, 
+    73, 79, 78, 128, 73, 68, 69, 78, 84, 73, 67, 65, 204, 73, 67, 72, 79, 85, 
+    128, 73, 67, 72, 79, 83, 128, 73, 67, 72, 73, 77, 65, 84, 79, 83, 128, 
+    73, 67, 72, 65, 68, 73, 78, 128, 73, 67, 69, 76, 65, 78, 68, 73, 67, 45, 
+    89, 82, 128, 73, 66, 73, 70, 73, 76, 73, 128, 73, 65, 85, 68, 65, 128, 
+    73, 48, 49, 53, 128, 73, 48, 49, 52, 128, 73, 48, 49, 51, 128, 73, 48, 
+    49, 50, 128, 73, 48, 49, 49, 65, 128, 73, 48, 49, 49, 128, 73, 48, 49, 
+    48, 65, 128, 73, 48, 49, 48, 128, 73, 48, 48, 57, 65, 128, 73, 48, 48, 
+    57, 128, 73, 48, 48, 56, 128, 73, 48, 48, 55, 128, 73, 48, 48, 54, 128, 
+    73, 48, 48, 53, 65, 128, 73, 48, 48, 53, 128, 73, 48, 48, 52, 128, 73, 
+    48, 48, 51, 128, 73, 48, 48, 50, 128, 73, 48, 48, 49, 128, 73, 45, 89, 
+    85, 128, 73, 45, 89, 79, 128, 73, 45, 89, 69, 79, 128, 73, 45, 89, 69, 
+    128, 73, 45, 89, 65, 69, 128, 73, 45, 89, 65, 45, 79, 128, 73, 45, 89, 
+    65, 128, 73, 45, 79, 45, 73, 128, 73, 45, 79, 128, 73, 45, 69, 85, 128, 
+    73, 45, 66, 69, 65, 77, 128, 73, 45, 65, 82, 65, 69, 65, 128, 73, 45, 65, 
+    128, 72, 90, 90, 90, 71, 128, 72, 90, 90, 90, 128, 72, 90, 90, 80, 128, 
+    72, 90, 90, 128, 72, 90, 87, 71, 128, 72, 90, 87, 128, 72, 90, 84, 128, 
+    72, 90, 71, 128, 72, 89, 83, 84, 69, 82, 69, 83, 73, 211, 72, 89, 80, 79, 
+    68, 73, 65, 83, 84, 79, 76, 69, 128, 72, 89, 80, 72, 69, 78, 65, 84, 73, 
+    79, 206, 72, 89, 80, 72, 69, 78, 45, 77, 73, 78, 85, 83, 128, 72, 89, 80, 
+    72, 69, 78, 128, 72, 89, 80, 72, 69, 206, 72, 88, 87, 71, 128, 72, 88, 
+    85, 79, 88, 128, 72, 88, 85, 79, 84, 128, 72, 88, 85, 79, 80, 128, 72, 
+    88, 85, 79, 128, 72, 88, 79, 88, 128, 72, 88, 79, 84, 128, 72, 88, 79, 
+    80, 128, 72, 88, 79, 128, 72, 88, 73, 88, 128, 72, 88, 73, 84, 128, 72, 
+    88, 73, 80, 128, 72, 88, 73, 69, 88, 128, 72, 88, 73, 69, 84, 128, 72, 
+    88, 73, 69, 80, 128, 72, 88, 73, 69, 128, 72, 88, 73, 128, 72, 88, 69, 
+    88, 128, 72, 88, 69, 80, 128, 72, 88, 69, 128, 72, 88, 65, 88, 128, 72, 
+    88, 65, 84, 128, 72, 88, 65, 80, 128, 72, 88, 65, 128, 72, 87, 85, 128, 
+    72, 87, 65, 73, 82, 128, 72, 86, 128, 72, 85, 83, 72, 69, 196, 72, 85, 
+    82, 65, 78, 128, 72, 85, 79, 84, 128, 72, 85, 78, 68, 82, 69, 68, 128, 
+    72, 85, 78, 68, 82, 69, 196, 72, 85, 78, 128, 72, 85, 77, 65, 78, 128, 
+    72, 85, 77, 65, 206, 72, 85, 76, 50, 128, 72, 85, 73, 73, 84, 79, 128, 
+    72, 85, 66, 50, 128, 72, 85, 66, 178, 72, 85, 66, 128, 72, 85, 65, 82, 
+    65, 68, 68, 79, 128, 72, 84, 83, 128, 72, 84, 74, 128, 72, 82, 89, 86, 
+    78, 73, 193, 72, 80, 87, 71, 128, 72, 80, 65, 128, 72, 80, 128, 72, 79, 
+    85, 83, 197, 72, 79, 85, 82, 71, 76, 65, 83, 83, 128, 72, 79, 85, 82, 71, 
+    76, 65, 83, 211, 72, 79, 85, 82, 128, 72, 79, 85, 210, 72, 79, 84, 69, 
+    76, 128, 72, 79, 84, 65, 128, 72, 79, 83, 80, 73, 84, 65, 76, 128, 72, 
+    79, 82, 83, 69, 128, 72, 79, 82, 83, 197, 72, 79, 82, 78, 83, 128, 72, 
+    79, 82, 73, 90, 79, 78, 84, 65, 76, 76, 217, 72, 79, 82, 73, 90, 79, 78, 
+    84, 65, 76, 45, 48, 54, 45, 48, 54, 128, 72, 79, 82, 73, 90, 79, 78, 84, 
+    65, 76, 45, 48, 54, 45, 48, 53, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 
+    76, 45, 48, 54, 45, 48, 52, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 
+    45, 48, 54, 45, 48, 51, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 
+    48, 54, 45, 48, 50, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 
+    54, 45, 48, 49, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 54, 
+    45, 48, 48, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 53, 45, 
+    48, 54, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 53, 45, 48, 
+    53, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 53, 45, 48, 52, 
+    128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 53, 45, 48, 51, 128, 
+    72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 53, 45, 48, 50, 128, 72, 
+    79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 53, 45, 48, 49, 128, 72, 79, 
+    82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 53, 45, 48, 48, 128, 72, 79, 82, 
+    73, 90, 79, 78, 84, 65, 76, 45, 48, 52, 45, 48, 54, 128, 72, 79, 82, 73, 
+    90, 79, 78, 84, 65, 76, 45, 48, 52, 45, 48, 53, 128, 72, 79, 82, 73, 90, 
+    79, 78, 84, 65, 76, 45, 48, 52, 45, 48, 52, 128, 72, 79, 82, 73, 90, 79, 
+    78, 84, 65, 76, 45, 48, 52, 45, 48, 51, 128, 72, 79, 82, 73, 90, 79, 78, 
+    84, 65, 76, 45, 48, 52, 45, 48, 50, 128, 72, 79, 82, 73, 90, 79, 78, 84, 
+    65, 76, 45, 48, 52, 45, 48, 49, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 
+    76, 45, 48, 52, 45, 48, 48, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 
+    45, 48, 51, 45, 48, 54, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 
+    48, 51, 45, 48, 53, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 
+    51, 45, 48, 52, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 51, 
+    45, 48, 51, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 51, 45, 
+    48, 50, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 51, 45, 48, 
+    49, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 51, 45, 48, 48, 
+    128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 50, 45, 48, 54, 128, 
+    72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 50, 45, 48, 53, 128, 72, 
+    79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 50, 45, 48, 52, 128, 72, 79, 
+    82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 50, 45, 48, 51, 128, 72, 79, 82, 
+    73, 90, 79, 78, 84, 65, 76, 45, 48, 50, 45, 48, 50, 128, 72, 79, 82, 73, 
+    90, 79, 78, 84, 65, 76, 45, 48, 50, 45, 48, 49, 128, 72, 79, 82, 73, 90, 
+    79, 78, 84, 65, 76, 45, 48, 50, 45, 48, 48, 128, 72, 79, 82, 73, 90, 79, 
+    78, 84, 65, 76, 45, 48, 49, 45, 48, 54, 128, 72, 79, 82, 73, 90, 79, 78, 
+    84, 65, 76, 45, 48, 49, 45, 48, 53, 128, 72, 79, 82, 73, 90, 79, 78, 84, 
+    65, 76, 45, 48, 49, 45, 48, 52, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 
+    76, 45, 48, 49, 45, 48, 51, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 
+    45, 48, 49, 45, 48, 50, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 
+    48, 49, 45, 48, 49, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 
+    49, 45, 48, 48, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 48, 
+    45, 48, 54, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 48, 45, 
+    48, 53, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 48, 45, 48, 
+    52, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 48, 45, 48, 51, 
+    128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 48, 45, 48, 50, 128, 
+    72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 48, 45, 48, 49, 128, 72, 
+    79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 48, 45, 48, 48, 128, 72, 79, 
+    82, 73, 90, 79, 78, 84, 65, 76, 128, 72, 79, 82, 73, 128, 72, 79, 82, 
+    193, 72, 79, 79, 82, 85, 128, 72, 79, 79, 80, 128, 72, 79, 79, 78, 128, 
+    72, 79, 79, 75, 69, 196, 72, 79, 78, 69, 89, 66, 69, 69, 128, 72, 79, 78, 
+    69, 217, 72, 79, 77, 79, 84, 72, 69, 84, 73, 67, 128, 72, 79, 77, 79, 84, 
+    72, 69, 84, 73, 195, 72, 79, 76, 69, 128, 72, 79, 76, 68, 73, 78, 199, 
+    72, 79, 76, 65, 77, 128, 72, 79, 76, 65, 205, 72, 79, 75, 65, 128, 72, 
+    79, 73, 128, 72, 79, 67, 72, 79, 128, 72, 78, 85, 84, 128, 72, 78, 85, 
+    79, 88, 128, 72, 78, 85, 79, 128, 72, 78, 79, 88, 128, 72, 78, 79, 84, 
+    128, 72, 78, 79, 80, 128, 72, 78, 73, 88, 128, 72, 78, 73, 84, 128, 72, 
+    78, 73, 80, 128, 72, 78, 73, 69, 88, 128, 72, 78, 73, 69, 84, 128, 72, 
+    78, 73, 69, 80, 128, 72, 78, 73, 69, 128, 72, 78, 73, 128, 72, 78, 69, 
+    88, 128, 72, 78, 69, 80, 128, 72, 78, 69, 128, 72, 78, 65, 88, 128, 72, 
+    78, 65, 84, 128, 72, 78, 65, 80, 128, 72, 78, 65, 128, 72, 77, 89, 88, 
+    128, 72, 77, 89, 82, 88, 128, 72, 77, 89, 82, 128, 72, 77, 89, 80, 128, 
+    72, 77, 89, 128, 72, 77, 85, 88, 128, 72, 77, 85, 84, 128, 72, 77, 85, 
+    82, 88, 128, 72, 77, 85, 82, 128, 72, 77, 85, 80, 128, 72, 77, 85, 79, 
+    88, 128, 72, 77, 85, 79, 80, 128, 72, 77, 85, 79, 128, 72, 77, 85, 128, 
+    72, 77, 79, 88, 128, 72, 77, 79, 84, 128, 72, 77, 79, 80, 128, 72, 77, 
+    79, 128, 72, 77, 73, 88, 128, 72, 77, 73, 84, 128, 72, 77, 73, 80, 128, 
+    72, 77, 73, 69, 88, 128, 72, 77, 73, 69, 80, 128, 72, 77, 73, 69, 128, 
+    72, 77, 73, 128, 72, 77, 69, 128, 72, 77, 65, 88, 128, 72, 77, 65, 84, 
+    128, 72, 77, 65, 80, 128, 72, 77, 65, 128, 72, 76, 89, 88, 128, 72, 76, 
+    89, 84, 128, 72, 76, 89, 82, 88, 128, 72, 76, 89, 82, 128, 72, 76, 89, 
+    80, 128, 72, 76, 89, 128, 72, 76, 85, 88, 128, 72, 76, 85, 84, 128, 72, 
+    76, 85, 82, 88, 128, 72, 76, 85, 82, 128, 72, 76, 85, 80, 128, 72, 76, 
+    85, 79, 88, 128, 72, 76, 85, 79, 80, 128, 72, 76, 85, 79, 128, 72, 76, 
+    85, 128, 72, 76, 79, 88, 128, 72, 76, 79, 80, 128, 72, 76, 79, 128, 72, 
+    76, 73, 88, 128, 72, 76, 73, 84, 128, 72, 76, 73, 80, 128, 72, 76, 73, 
+    69, 88, 128, 72, 76, 73, 69, 80, 128, 72, 76, 73, 69, 128, 72, 76, 73, 
+    128, 72, 76, 69, 88, 128, 72, 76, 69, 80, 128, 72, 76, 69, 128, 72, 76, 
+    65, 88, 128, 72, 76, 65, 84, 128, 72, 76, 65, 80, 128, 72, 76, 65, 128, 
+    72, 75, 128, 72, 73, 90, 66, 128, 72, 73, 83, 84, 79, 82, 73, 195, 72, 
+    73, 82, 73, 81, 128, 72, 73, 71, 72, 45, 83, 80, 69, 69, 196, 72, 73, 71, 
+    72, 45, 82, 69, 86, 69, 82, 83, 69, 68, 45, 185, 72, 73, 71, 72, 45, 72, 
+    69, 69, 76, 69, 196, 72, 73, 69, 88, 128, 72, 73, 69, 85, 72, 45, 83, 73, 
+    79, 83, 128, 72, 73, 69, 85, 72, 45, 82, 73, 69, 85, 76, 128, 72, 73, 69, 
+    85, 72, 45, 80, 73, 69, 85, 80, 128, 72, 73, 69, 85, 72, 45, 78, 73, 69, 
+    85, 78, 128, 72, 73, 69, 85, 72, 45, 77, 73, 69, 85, 77, 128, 72, 73, 69, 
+    85, 200, 72, 73, 69, 82, 79, 71, 76, 89, 80, 72, 73, 195, 72, 73, 69, 
+    128, 72, 73, 68, 73, 78, 199, 72, 73, 68, 69, 84, 128, 72, 73, 68, 69, 
+    128, 72, 73, 66, 73, 83, 67, 85, 83, 128, 72, 72, 87, 65, 128, 72, 72, 
+    85, 128, 72, 72, 73, 128, 72, 72, 69, 69, 128, 72, 72, 69, 128, 72, 72, 
+    65, 65, 128, 72, 71, 128, 72, 69, 88, 73, 70, 79, 82, 205, 72, 69, 88, 
+    65, 71, 82, 65, 205, 72, 69, 88, 65, 71, 79, 78, 128, 72, 69, 82, 85, 84, 
+    85, 128, 72, 69, 82, 85, 128, 72, 69, 82, 77, 73, 84, 73, 65, 206, 72, 
+    69, 82, 77, 73, 79, 78, 73, 65, 206, 72, 69, 82, 77, 69, 83, 128, 72, 69, 
+    82, 69, 128, 72, 69, 82, 66, 128, 72, 69, 82, 65, 69, 85, 205, 72, 69, 
+    78, 71, 128, 72, 69, 78, 199, 72, 69, 77, 80, 128, 72, 69, 76, 77, 69, 
+    84, 128, 72, 69, 76, 77, 69, 212, 72, 69, 76, 205, 72, 69, 76, 73, 67, 
+    79, 80, 84, 69, 82, 128, 72, 69, 75, 85, 84, 65, 65, 82, 85, 128, 72, 69, 
+    73, 83, 69, 73, 128, 72, 69, 65, 86, 89, 128, 72, 69, 65, 86, 69, 78, 76, 
+    217, 72, 69, 65, 86, 69, 78, 128, 72, 69, 65, 86, 69, 206, 72, 69, 65, 
+    82, 84, 83, 128, 72, 69, 65, 82, 84, 45, 83, 72, 65, 80, 69, 196, 72, 69, 
+    65, 82, 84, 128, 72, 69, 65, 82, 212, 72, 69, 65, 82, 45, 78, 79, 45, 69, 
+    86, 73, 204, 72, 69, 65, 68, 83, 84, 82, 79, 75, 69, 128, 72, 69, 65, 68, 
+    83, 84, 79, 78, 197, 72, 69, 65, 68, 80, 72, 79, 78, 69, 128, 72, 69, 65, 
+    68, 73, 78, 71, 128, 72, 66, 65, 83, 65, 45, 69, 83, 65, 83, 193, 72, 66, 
+    65, 83, 193, 72, 65, 89, 65, 78, 78, 65, 128, 72, 65, 86, 69, 128, 72, 
+    65, 85, 80, 84, 83, 84, 73, 77, 77, 69, 128, 72, 65, 84, 72, 73, 128, 72, 
+    65, 84, 69, 128, 72, 65, 84, 67, 72, 73, 78, 199, 72, 65, 84, 65, 198, 
+    72, 65, 83, 69, 210, 72, 65, 83, 65, 78, 84, 65, 128, 72, 65, 82, 80, 79, 
+    79, 78, 128, 72, 65, 82, 80, 79, 79, 206, 72, 65, 82, 77, 79, 78, 73, 67, 
+    128, 72, 65, 82, 75, 76, 69, 65, 206, 72, 65, 82, 68, 78, 69, 83, 83, 
+    128, 72, 65, 82, 196, 72, 65, 80, 80, 217, 72, 65, 78, 85, 78, 79, 207, 
+    72, 65, 78, 71, 90, 72, 79, 213, 72, 65, 78, 68, 83, 128, 72, 65, 78, 68, 
+    211, 72, 65, 78, 68, 76, 69, 83, 128, 72, 65, 78, 68, 76, 69, 128, 72, 
+    65, 78, 68, 66, 65, 71, 128, 72, 65, 78, 68, 128, 72, 65, 78, 45, 65, 75, 
+    65, 84, 128, 72, 65, 77, 90, 65, 128, 72, 65, 77, 83, 84, 69, 210, 72, 
+    65, 77, 77, 69, 82, 128, 72, 65, 77, 77, 69, 210, 72, 65, 77, 66, 85, 82, 
+    71, 69, 82, 128, 72, 65, 76, 81, 65, 128, 72, 65, 76, 79, 128, 72, 65, 
+    76, 70, 45, 67, 73, 82, 67, 76, 197, 72, 65, 76, 70, 128, 72, 65, 76, 66, 
+    69, 82, 68, 128, 72, 65, 76, 65, 78, 84, 65, 128, 72, 65, 73, 84, 85, 
+    128, 72, 65, 73, 82, 67, 85, 84, 128, 72, 65, 73, 82, 128, 72, 65, 71, 
+    76, 65, 218, 72, 65, 71, 76, 128, 72, 65, 70, 85, 75, 72, 65, 128, 72, 
+    65, 70, 85, 75, 72, 128, 72, 65, 69, 71, 204, 72, 65, 65, 82, 85, 128, 
+    72, 65, 65, 77, 128, 72, 65, 193, 72, 65, 45, 72, 65, 128, 72, 48, 48, 
+    56, 128, 72, 48, 48, 55, 128, 72, 48, 48, 54, 65, 128, 72, 48, 48, 54, 
+    128, 72, 48, 48, 53, 128, 72, 48, 48, 52, 128, 72, 48, 48, 51, 128, 72, 
+    48, 48, 50, 128, 72, 48, 48, 49, 128, 72, 45, 84, 89, 80, 197, 71, 89, 
+    85, 128, 71, 89, 79, 78, 128, 71, 89, 79, 128, 71, 89, 73, 128, 71, 89, 
+    70, 213, 71, 89, 69, 69, 128, 71, 89, 65, 83, 128, 71, 89, 65, 65, 128, 
+    71, 89, 65, 128, 71, 89, 128, 71, 87, 85, 128, 71, 87, 73, 128, 71, 87, 
+    69, 69, 128, 71, 87, 69, 128, 71, 87, 65, 65, 128, 71, 87, 65, 128, 71, 
+    86, 128, 71, 85, 82, 85, 83, 72, 128, 71, 85, 82, 85, 78, 128, 71, 85, 
+    82, 65, 77, 85, 84, 79, 78, 128, 71, 85, 82, 55, 128, 71, 85, 78, 85, 
+    128, 71, 85, 78, 213, 71, 85, 205, 71, 85, 76, 128, 71, 85, 73, 84, 65, 
+    82, 128, 71, 85, 199, 71, 85, 69, 72, 128, 71, 85, 69, 200, 71, 85, 68, 
+    128, 71, 85, 196, 71, 85, 65, 82, 68, 83, 77, 65, 78, 128, 71, 85, 65, 
+    82, 68, 69, 68, 78, 69, 83, 83, 128, 71, 85, 65, 82, 68, 69, 196, 71, 85, 
+    65, 82, 68, 128, 71, 85, 65, 82, 65, 78, 201, 71, 85, 193, 71, 85, 178, 
+    71, 84, 69, 210, 71, 83, 85, 77, 128, 71, 83, 85, 205, 71, 82, 213, 71, 
+    82, 79, 87, 73, 78, 199, 71, 82, 79, 85, 78, 68, 128, 71, 82, 79, 78, 84, 
+    72, 73, 83, 77, 65, 84, 65, 128, 71, 82, 73, 78, 78, 73, 78, 199, 71, 82, 
+    73, 77, 65, 67, 73, 78, 199, 71, 82, 69, 71, 79, 82, 73, 65, 206, 71, 82, 
+    69, 69, 206, 71, 82, 69, 65, 84, 78, 69, 83, 83, 128, 71, 82, 69, 65, 84, 
+    69, 82, 45, 84, 72, 65, 78, 128, 71, 82, 69, 65, 84, 69, 82, 45, 84, 72, 
+    65, 206, 71, 82, 69, 65, 84, 69, 210, 71, 82, 69, 65, 212, 71, 82, 65, 
+    86, 69, 89, 65, 82, 196, 71, 82, 65, 86, 69, 45, 77, 65, 67, 82, 79, 78, 
+    128, 71, 82, 65, 86, 69, 45, 65, 67, 85, 84, 69, 45, 71, 82, 65, 86, 69, 
+    128, 71, 82, 65, 86, 197, 71, 82, 65, 84, 69, 82, 128, 71, 82, 65, 83, 
+    83, 128, 71, 82, 65, 83, 211, 71, 82, 65, 80, 72, 69, 77, 197, 71, 82, 
+    65, 80, 69, 83, 128, 71, 82, 65, 77, 77, 193, 71, 82, 65, 73, 78, 128, 
+    71, 82, 65, 68, 85, 65, 84, 73, 79, 206, 71, 82, 65, 67, 69, 128, 71, 82, 
+    65, 67, 197, 71, 80, 65, 128, 71, 79, 82, 84, 72, 77, 73, 75, 79, 206, 
+    71, 79, 82, 84, 128, 71, 79, 82, 71, 79, 84, 69, 82, 73, 128, 71, 79, 82, 
+    71, 79, 83, 89, 78, 84, 72, 69, 84, 79, 78, 128, 71, 79, 82, 71, 79, 206, 
+    71, 79, 82, 71, 73, 128, 71, 79, 82, 65, 128, 71, 79, 79, 196, 71, 79, 
+    78, 71, 128, 71, 79, 76, 68, 128, 71, 79, 75, 128, 71, 79, 73, 78, 199, 
+    71, 79, 66, 76, 73, 78, 128, 71, 79, 65, 76, 128, 71, 79, 65, 204, 71, 
+    79, 65, 128, 71, 78, 89, 73, 83, 128, 71, 78, 65, 86, 73, 89, 65, 78, 73, 
+    128, 71, 76, 79, 87, 73, 78, 199, 71, 76, 79, 84, 84, 65, 204, 71, 76, 
+    79, 66, 197, 71, 76, 73, 83, 83, 65, 78, 68, 207, 71, 76, 69, 73, 67, 
+    200, 71, 76, 65, 71, 79, 76, 73, 128, 71, 76, 65, 128, 71, 74, 69, 128, 
+    71, 73, 88, 128, 71, 73, 84, 128, 71, 73, 83, 72, 128, 71, 73, 83, 200, 
+    71, 73, 83, 65, 76, 128, 71, 73, 82, 85, 68, 65, 65, 128, 71, 73, 82, 76, 
+    128, 71, 73, 82, 51, 128, 71, 73, 82, 179, 71, 73, 82, 50, 128, 71, 73, 
+    82, 178, 71, 73, 80, 128, 71, 73, 78, 73, 73, 128, 71, 73, 77, 69, 76, 
+    128, 71, 73, 77, 69, 204, 71, 73, 77, 128, 71, 73, 71, 65, 128, 71, 73, 
+    69, 84, 128, 71, 73, 68, 73, 77, 128, 71, 73, 66, 66, 79, 85, 211, 71, 
+    73, 66, 65, 128, 71, 73, 52, 128, 71, 73, 180, 71, 72, 90, 128, 71, 72, 
+    87, 65, 128, 71, 72, 85, 78, 78, 65, 128, 71, 72, 85, 78, 78, 193, 71, 
+    72, 85, 128, 71, 72, 79, 85, 128, 71, 72, 79, 83, 84, 128, 71, 72, 79, 
+    128, 71, 72, 73, 128, 71, 72, 72, 65, 128, 71, 72, 69, 85, 88, 128, 71, 
+    72, 69, 85, 78, 128, 71, 72, 69, 85, 71, 72, 69, 85, 65, 69, 77, 128, 71, 
+    72, 69, 85, 71, 72, 69, 78, 128, 71, 72, 69, 85, 65, 69, 82, 65, 69, 128, 
+    71, 72, 69, 85, 65, 69, 71, 72, 69, 85, 65, 69, 128, 71, 72, 69, 84, 128, 
+    71, 72, 69, 69, 128, 71, 72, 69, 128, 71, 72, 197, 71, 72, 65, 89, 78, 
+    128, 71, 72, 65, 82, 65, 69, 128, 71, 72, 65, 80, 128, 71, 72, 65, 78, 
+    128, 71, 72, 65, 77, 65, 76, 128, 71, 72, 65, 73, 78, 85, 128, 71, 72, 
+    65, 73, 78, 128, 71, 72, 65, 73, 206, 71, 72, 65, 68, 128, 71, 72, 65, 
+    65, 77, 65, 69, 128, 71, 72, 65, 65, 128, 71, 71, 87, 73, 128, 71, 71, 
+    87, 69, 69, 128, 71, 71, 87, 69, 128, 71, 71, 87, 65, 65, 128, 71, 71, 
+    87, 65, 128, 71, 71, 85, 88, 128, 71, 71, 85, 84, 128, 71, 71, 85, 82, 
+    88, 128, 71, 71, 85, 82, 128, 71, 71, 85, 79, 88, 128, 71, 71, 85, 79, 
+    84, 128, 71, 71, 85, 79, 80, 128, 71, 71, 85, 79, 128, 71, 71, 79, 88, 
+    128, 71, 71, 79, 84, 128, 71, 71, 79, 80, 128, 71, 71, 73, 88, 128, 71, 
+    71, 73, 84, 128, 71, 71, 73, 69, 88, 128, 71, 71, 73, 69, 80, 128, 71, 
+    71, 73, 69, 128, 71, 71, 69, 88, 128, 71, 71, 69, 84, 128, 71, 71, 69, 
+    80, 128, 71, 71, 65, 88, 128, 71, 71, 65, 84, 128, 71, 71, 65, 65, 128, 
+    71, 69, 84, 193, 71, 69, 83, 84, 85, 82, 69, 128, 71, 69, 83, 72, 85, 
+    128, 71, 69, 83, 72, 84, 73, 78, 128, 71, 69, 83, 72, 84, 73, 206, 71, 
+    69, 83, 72, 50, 128, 71, 69, 82, 83, 72, 65, 89, 73, 77, 128, 71, 69, 82, 
+    77, 65, 206, 71, 69, 82, 69, 83, 72, 128, 71, 69, 82, 69, 83, 200, 71, 
+    69, 79, 77, 69, 84, 82, 73, 67, 65, 76, 76, 217, 71, 69, 79, 77, 69, 84, 
+    82, 73, 195, 71, 69, 78, 84, 76, 197, 71, 69, 78, 73, 84, 73, 86, 69, 
+    128, 71, 69, 78, 73, 75, 201, 71, 69, 78, 69, 82, 73, 195, 71, 69, 77, 
+    73, 78, 73, 128, 71, 69, 77, 73, 78, 65, 84, 73, 79, 206, 71, 69, 205, 
+    71, 69, 68, 79, 76, 65, 128, 71, 69, 68, 69, 128, 71, 69, 66, 207, 71, 
+    69, 66, 193, 71, 69, 65, 82, 128, 71, 69, 65, 210, 71, 68, 65, 78, 128, 
+    71, 67, 73, 71, 128, 71, 67, 65, 206, 71, 66, 79, 78, 128, 71, 66, 73, 
+    69, 197, 71, 66, 69, 85, 88, 128, 71, 66, 69, 84, 128, 71, 66, 65, 89, 
+    73, 128, 71, 66, 65, 75, 85, 82, 85, 78, 69, 78, 128, 71, 66, 128, 71, 
+    65, 89, 65, 78, 85, 75, 73, 84, 84, 65, 128, 71, 65, 89, 65, 78, 78, 65, 
+    128, 71, 65, 89, 128, 71, 65, 85, 78, 84, 76, 69, 84, 128, 71, 65, 84, 
+    72, 69, 82, 73, 78, 71, 128, 71, 65, 84, 72, 69, 82, 73, 78, 199, 71, 65, 
+    84, 69, 128, 71, 65, 83, 72, 65, 78, 128, 71, 65, 82, 83, 72, 85, 78, 73, 
+    128, 71, 65, 82, 79, 78, 128, 71, 65, 82, 77, 69, 78, 84, 128, 71, 65, 
+    82, 68, 69, 78, 128, 71, 65, 82, 51, 128, 71, 65, 80, 80, 69, 196, 71, 
+    65, 208, 71, 65, 78, 77, 65, 128, 71, 65, 78, 71, 73, 65, 128, 71, 65, 
+    78, 68, 193, 71, 65, 78, 50, 128, 71, 65, 78, 178, 71, 65, 77, 77, 65, 
+    128, 71, 65, 77, 76, 65, 128, 71, 65, 77, 76, 128, 71, 65, 77, 69, 128, 
+    71, 65, 77, 197, 71, 65, 77, 65, 78, 128, 71, 65, 77, 65, 76, 128, 71, 
+    65, 77, 65, 204, 71, 65, 71, 128, 71, 65, 70, 128, 71, 65, 198, 71, 65, 
+    69, 84, 84, 65, 45, 80, 73, 76, 76, 65, 128, 71, 65, 68, 79, 76, 128, 71, 
+    65, 68, 128, 71, 65, 196, 71, 65, 66, 65, 128, 71, 65, 66, 193, 71, 65, 
+    65, 70, 85, 128, 71, 65, 178, 71, 48, 53, 52, 128, 71, 48, 53, 51, 128, 
+    71, 48, 53, 50, 128, 71, 48, 53, 49, 128, 71, 48, 53, 48, 128, 71, 48, 
+    52, 57, 128, 71, 48, 52, 56, 128, 71, 48, 52, 55, 128, 71, 48, 52, 54, 
+    128, 71, 48, 52, 53, 65, 128, 71, 48, 52, 53, 128, 71, 48, 52, 52, 128, 
+    71, 48, 52, 51, 65, 128, 71, 48, 52, 51, 128, 71, 48, 52, 50, 128, 71, 
+    48, 52, 49, 128, 71, 48, 52, 48, 128, 71, 48, 51, 57, 128, 71, 48, 51, 
+    56, 128, 71, 48, 51, 55, 65, 128, 71, 48, 51, 55, 128, 71, 48, 51, 54, 
+    65, 128, 71, 48, 51, 54, 128, 71, 48, 51, 53, 128, 71, 48, 51, 52, 128, 
+    71, 48, 51, 51, 128, 71, 48, 51, 50, 128, 71, 48, 51, 49, 128, 71, 48, 
+    51, 48, 128, 71, 48, 50, 57, 128, 71, 48, 50, 56, 128, 71, 48, 50, 55, 
+    128, 71, 48, 50, 54, 65, 128, 71, 48, 50, 54, 128, 71, 48, 50, 53, 128, 
+    71, 48, 50, 52, 128, 71, 48, 50, 51, 128, 71, 48, 50, 50, 128, 71, 48, 
+    50, 49, 128, 71, 48, 50, 48, 65, 128, 71, 48, 50, 48, 128, 71, 48, 49, 
+    57, 128, 71, 48, 49, 56, 128, 71, 48, 49, 55, 128, 71, 48, 49, 54, 128, 
+    71, 48, 49, 53, 128, 71, 48, 49, 52, 128, 71, 48, 49, 51, 128, 71, 48, 
+    49, 50, 128, 71, 48, 49, 49, 65, 128, 71, 48, 49, 49, 128, 71, 48, 49, 
+    48, 128, 71, 48, 48, 57, 128, 71, 48, 48, 56, 128, 71, 48, 48, 55, 66, 
+    128, 71, 48, 48, 55, 65, 128, 71, 48, 48, 55, 128, 71, 48, 48, 54, 65, 
+    128, 71, 48, 48, 54, 128, 71, 48, 48, 53, 128, 71, 48, 48, 52, 128, 71, 
+    48, 48, 51, 128, 71, 48, 48, 50, 128, 71, 48, 48, 49, 128, 70, 89, 88, 
+    128, 70, 89, 84, 128, 70, 89, 80, 128, 70, 89, 65, 128, 70, 87, 73, 128, 
+    70, 87, 69, 69, 128, 70, 87, 69, 128, 70, 87, 65, 65, 128, 70, 87, 65, 
+    128, 70, 86, 83, 51, 128, 70, 86, 83, 50, 128, 70, 86, 83, 49, 128, 70, 
+    85, 88, 128, 70, 85, 84, 128, 70, 85, 83, 69, 128, 70, 85, 83, 193, 70, 
+    85, 82, 88, 128, 70, 85, 80, 128, 70, 85, 78, 69, 82, 65, 204, 70, 85, 
+    78, 67, 84, 73, 79, 78, 65, 204, 70, 85, 78, 67, 84, 73, 79, 78, 128, 70, 
+    85, 76, 76, 78, 69, 83, 83, 128, 70, 85, 76, 204, 70, 85, 74, 73, 128, 
+    70, 85, 69, 84, 128, 70, 85, 69, 204, 70, 85, 69, 128, 70, 84, 72, 79, 
+    82, 193, 70, 83, 73, 128, 70, 82, 79, 87, 78, 73, 78, 71, 128, 70, 82, 
+    79, 87, 78, 73, 78, 199, 70, 82, 79, 87, 78, 128, 70, 82, 79, 78, 84, 45, 
+    84, 73, 76, 84, 69, 196, 70, 82, 79, 78, 84, 45, 70, 65, 67, 73, 78, 199, 
+    70, 82, 79, 205, 70, 82, 79, 71, 128, 70, 82, 79, 199, 70, 82, 73, 84, 
+    85, 128, 70, 82, 73, 69, 83, 128, 70, 82, 73, 69, 196, 70, 82, 73, 67, 
+    65, 84, 73, 86, 69, 128, 70, 82, 69, 84, 66, 79, 65, 82, 68, 128, 70, 82, 
+    69, 78, 67, 200, 70, 82, 69, 69, 128, 70, 82, 69, 197, 70, 82, 65, 78, 
+    195, 70, 82, 65, 77, 69, 128, 70, 82, 65, 71, 82, 65, 78, 84, 128, 70, 
+    82, 65, 71, 77, 69, 78, 84, 128, 70, 82, 65, 67, 84, 73, 79, 206, 70, 79, 
+    88, 128, 70, 79, 85, 82, 84, 69, 69, 78, 128, 70, 79, 85, 82, 84, 69, 69, 
+    206, 70, 79, 85, 82, 45, 84, 72, 73, 82, 84, 89, 128, 70, 79, 85, 82, 45, 
+    83, 84, 82, 73, 78, 199, 70, 79, 85, 82, 45, 80, 69, 82, 45, 69, 205, 70, 
+    79, 85, 82, 45, 76, 73, 78, 197, 70, 79, 85, 210, 70, 79, 85, 78, 84, 65, 
+    73, 78, 128, 70, 79, 83, 84, 69, 82, 73, 78, 71, 128, 70, 79, 82, 87, 65, 
+    82, 68, 128, 70, 79, 82, 84, 89, 128, 70, 79, 82, 84, 217, 70, 79, 82, 
+    84, 69, 128, 70, 79, 82, 77, 211, 70, 79, 82, 77, 65, 84, 84, 73, 78, 71, 
+    128, 70, 79, 82, 75, 69, 196, 70, 79, 82, 67, 69, 83, 128, 70, 79, 82, 
+    67, 69, 128, 70, 79, 80, 128, 70, 79, 79, 84, 83, 84, 79, 79, 76, 128, 
+    70, 79, 79, 84, 80, 82, 73, 78, 84, 83, 128, 70, 79, 79, 84, 78, 79, 84, 
+    197, 70, 79, 79, 84, 66, 65, 76, 76, 128, 70, 79, 79, 84, 128, 70, 79, 
+    79, 68, 128, 70, 79, 79, 128, 70, 79, 78, 71, 77, 65, 78, 128, 70, 79, 
+    77, 128, 70, 79, 76, 76, 89, 128, 70, 79, 76, 76, 79, 87, 73, 78, 71, 
+    128, 70, 79, 76, 68, 69, 82, 128, 70, 79, 76, 68, 69, 196, 70, 79, 71, 
+    71, 89, 128, 70, 207, 70, 77, 128, 70, 76, 89, 128, 70, 76, 85, 84, 84, 
+    69, 82, 73, 78, 199, 70, 76, 85, 84, 69, 128, 70, 76, 85, 83, 72, 69, 
+    196, 70, 76, 79, 87, 73, 78, 199, 70, 76, 79, 87, 69, 210, 70, 76, 79, 
+    85, 82, 73, 83, 72, 128, 70, 76, 79, 82, 69, 84, 84, 69, 128, 70, 76, 79, 
+    82, 65, 204, 70, 76, 79, 80, 80, 217, 70, 76, 79, 79, 82, 128, 70, 76, 
+    73, 80, 128, 70, 76, 73, 71, 72, 84, 128, 70, 76, 69, 88, 85, 83, 128, 
+    70, 76, 69, 88, 69, 196, 70, 76, 69, 85, 82, 45, 68, 69, 45, 76, 73, 83, 
+    128, 70, 76, 65, 84, 84, 69, 78, 69, 196, 70, 76, 65, 84, 78, 69, 83, 83, 
+    128, 70, 76, 65, 84, 128, 70, 76, 65, 212, 70, 76, 65, 71, 83, 128, 70, 
+    76, 65, 71, 45, 53, 128, 70, 76, 65, 71, 45, 52, 128, 70, 76, 65, 71, 45, 
+    51, 128, 70, 76, 65, 71, 45, 50, 128, 70, 76, 65, 71, 45, 49, 128, 70, 
+    76, 65, 71, 128, 70, 76, 65, 199, 70, 76, 65, 128, 70, 76, 128, 70, 73, 
+    88, 69, 68, 45, 70, 79, 82, 205, 70, 73, 88, 128, 70, 73, 86, 69, 45, 84, 
+    72, 73, 82, 84, 89, 128, 70, 73, 86, 69, 45, 76, 73, 78, 197, 70, 73, 86, 
+    197, 70, 73, 84, 65, 128, 70, 73, 84, 128, 70, 73, 83, 84, 69, 196, 70, 
+    73, 83, 84, 128, 70, 73, 83, 72, 73, 78, 199, 70, 73, 83, 72, 72, 79, 79, 
+    75, 128, 70, 73, 83, 72, 72, 79, 79, 203, 70, 73, 83, 72, 69, 89, 69, 
+    128, 70, 73, 83, 72, 128, 70, 73, 83, 200, 70, 73, 82, 83, 212, 70, 73, 
+    82, 73, 128, 70, 73, 82, 69, 87, 79, 82, 75, 83, 128, 70, 73, 82, 69, 87, 
+    79, 82, 203, 70, 73, 82, 69, 128, 70, 73, 82, 197, 70, 73, 80, 128, 70, 
+    73, 78, 73, 84, 197, 70, 73, 78, 71, 69, 82, 78, 65, 73, 76, 83, 128, 70, 
+    73, 78, 71, 69, 82, 69, 196, 70, 73, 78, 65, 78, 67, 73, 65, 76, 128, 70, 
+    73, 76, 76, 69, 82, 128, 70, 73, 76, 76, 69, 196, 70, 73, 76, 76, 128, 
+    70, 73, 76, 204, 70, 73, 76, 197, 70, 73, 73, 128, 70, 73, 71, 85, 82, 
+    69, 45, 51, 128, 70, 73, 71, 85, 82, 69, 45, 50, 128, 70, 73, 71, 85, 82, 
+    69, 45, 49, 128, 70, 73, 71, 85, 82, 197, 70, 73, 71, 72, 84, 128, 70, 
+    73, 70, 84, 89, 128, 70, 73, 70, 84, 217, 70, 73, 70, 84, 72, 83, 128, 
+    70, 73, 70, 84, 72, 128, 70, 73, 70, 84, 69, 69, 78, 128, 70, 73, 70, 84, 
+    69, 69, 206, 70, 73, 69, 76, 68, 128, 70, 72, 84, 79, 82, 193, 70, 70, 
+    76, 128, 70, 70, 73, 128, 70, 69, 85, 88, 128, 70, 69, 85, 70, 69, 85, 
+    65, 69, 84, 128, 70, 69, 83, 84, 73, 86, 65, 76, 128, 70, 69, 82, 82, 89, 
+    128, 70, 69, 82, 82, 73, 211, 70, 69, 82, 77, 65, 84, 65, 128, 70, 69, 
+    82, 77, 65, 84, 193, 70, 69, 79, 200, 70, 69, 78, 199, 70, 69, 78, 67, 
+    69, 128, 70, 69, 77, 73, 78, 73, 78, 197, 70, 69, 77, 65, 76, 69, 128, 
+    70, 69, 77, 65, 76, 197, 70, 69, 76, 76, 79, 87, 83, 72, 73, 80, 128, 70, 
+    69, 73, 128, 70, 69, 72, 213, 70, 69, 72, 128, 70, 69, 200, 70, 69, 69, 
+    78, 71, 128, 70, 69, 69, 68, 128, 70, 69, 69, 196, 70, 69, 69, 128, 70, 
+    69, 66, 82, 85, 65, 82, 89, 128, 70, 69, 65, 84, 72, 69, 82, 128, 70, 69, 
+    65, 84, 72, 69, 210, 70, 69, 65, 82, 78, 128, 70, 69, 65, 82, 70, 85, 
+    204, 70, 69, 65, 82, 128, 70, 65, 89, 65, 78, 78, 65, 128, 70, 65, 89, 
+    128, 70, 65, 88, 128, 70, 65, 216, 70, 65, 84, 73, 71, 85, 69, 128, 70, 
+    65, 84, 72, 69, 82, 128, 70, 65, 84, 72, 69, 210, 70, 65, 84, 72, 65, 84, 
+    65, 78, 128, 70, 65, 84, 72, 65, 84, 65, 206, 70, 65, 84, 72, 65, 128, 
+    70, 65, 84, 72, 193, 70, 65, 84, 128, 70, 65, 82, 83, 201, 70, 65, 81, 
+    128, 70, 65, 80, 128, 70, 65, 78, 71, 128, 70, 65, 78, 69, 82, 79, 83, 
+    73, 211, 70, 65, 78, 128, 70, 65, 77, 73, 76, 89, 128, 70, 65, 76, 76, 
+    73, 78, 199, 70, 65, 76, 76, 69, 206, 70, 65, 73, 76, 85, 82, 69, 128, 
+    70, 65, 73, 72, 85, 128, 70, 65, 72, 82, 69, 78, 72, 69, 73, 84, 128, 70, 
+    65, 67, 84, 79, 82, 89, 128, 70, 65, 67, 84, 79, 210, 70, 65, 67, 83, 73, 
+    77, 73, 76, 197, 70, 65, 67, 69, 45, 54, 128, 70, 65, 67, 69, 45, 53, 
+    128, 70, 65, 67, 69, 45, 52, 128, 70, 65, 67, 69, 45, 51, 128, 70, 65, 
+    67, 69, 45, 50, 128, 70, 65, 67, 69, 45, 49, 128, 70, 65, 65, 77, 65, 69, 
+    128, 70, 65, 65, 73, 128, 70, 65, 65, 70, 85, 128, 70, 48, 53, 51, 128, 
+    70, 48, 53, 50, 128, 70, 48, 53, 49, 67, 128, 70, 48, 53, 49, 66, 128, 
+    70, 48, 53, 49, 65, 128, 70, 48, 53, 49, 128, 70, 48, 53, 48, 128, 70, 
+    48, 52, 57, 128, 70, 48, 52, 56, 128, 70, 48, 52, 55, 65, 128, 70, 48, 
+    52, 55, 128, 70, 48, 52, 54, 65, 128, 70, 48, 52, 54, 128, 70, 48, 52, 
+    53, 65, 128, 70, 48, 52, 53, 128, 70, 48, 52, 52, 128, 70, 48, 52, 51, 
+    128, 70, 48, 52, 50, 128, 70, 48, 52, 49, 128, 70, 48, 52, 48, 128, 70, 
+    48, 51, 57, 128, 70, 48, 51, 56, 65, 128, 70, 48, 51, 56, 128, 70, 48, 
+    51, 55, 65, 128, 70, 48, 51, 55, 128, 70, 48, 51, 54, 128, 70, 48, 51, 
+    53, 128, 70, 48, 51, 52, 128, 70, 48, 51, 51, 128, 70, 48, 51, 50, 128, 
+    70, 48, 51, 49, 65, 128, 70, 48, 51, 49, 128, 70, 48, 51, 48, 128, 70, 
+    48, 50, 57, 128, 70, 48, 50, 56, 128, 70, 48, 50, 55, 128, 70, 48, 50, 
+    54, 128, 70, 48, 50, 53, 128, 70, 48, 50, 52, 128, 70, 48, 50, 51, 128, 
+    70, 48, 50, 50, 128, 70, 48, 50, 49, 65, 128, 70, 48, 50, 49, 128, 70, 
+    48, 50, 48, 128, 70, 48, 49, 57, 128, 70, 48, 49, 56, 128, 70, 48, 49, 
+    55, 128, 70, 48, 49, 54, 128, 70, 48, 49, 53, 128, 70, 48, 49, 52, 128, 
+    70, 48, 49, 51, 65, 128, 70, 48, 49, 51, 128, 70, 48, 49, 50, 128, 70, 
+    48, 49, 49, 128, 70, 48, 49, 48, 128, 70, 48, 48, 57, 128, 70, 48, 48, 
+    56, 128, 70, 48, 48, 55, 128, 70, 48, 48, 54, 128, 70, 48, 48, 53, 128, 
+    70, 48, 48, 52, 128, 70, 48, 48, 51, 128, 70, 48, 48, 50, 128, 70, 48, 
+    48, 49, 65, 128, 70, 48, 48, 49, 128, 69, 90, 200, 69, 90, 69, 78, 128, 
+    69, 90, 69, 206, 69, 90, 128, 69, 89, 69, 83, 128, 69, 89, 69, 71, 76, 
+    65, 83, 83, 69, 83, 128, 69, 89, 66, 69, 89, 70, 73, 76, 73, 128, 69, 89, 
+    65, 78, 78, 65, 128, 69, 88, 84, 82, 65, 84, 69, 82, 82, 69, 83, 84, 82, 
+    73, 65, 204, 69, 88, 84, 82, 65, 45, 76, 79, 215, 69, 88, 84, 82, 65, 45, 
+    72, 73, 71, 200, 69, 88, 84, 69, 78, 83, 73, 79, 78, 128, 69, 88, 84, 69, 
+    78, 68, 69, 196, 69, 88, 80, 82, 69, 83, 83, 73, 79, 78, 76, 69, 83, 211, 
+    69, 88, 80, 79, 78, 69, 78, 212, 69, 88, 79, 128, 69, 88, 207, 69, 88, 
+    73, 83, 84, 83, 128, 69, 88, 73, 83, 84, 128, 69, 88, 72, 65, 85, 83, 84, 
+    73, 79, 78, 128, 69, 88, 67, 76, 65, 77, 65, 84, 73, 79, 78, 128, 69, 88, 
+    67, 76, 65, 77, 65, 84, 73, 79, 206, 69, 88, 67, 72, 65, 78, 71, 69, 128, 
+    69, 88, 67, 69, 83, 83, 128, 69, 88, 67, 69, 76, 76, 69, 78, 84, 128, 69, 
+    87, 69, 128, 69, 86, 69, 82, 71, 82, 69, 69, 206, 69, 86, 69, 78, 73, 78, 
+    71, 128, 69, 85, 82, 79, 80, 69, 65, 206, 69, 85, 82, 79, 80, 69, 45, 65, 
+    70, 82, 73, 67, 65, 128, 69, 85, 82, 79, 45, 67, 85, 82, 82, 69, 78, 67, 
+    217, 69, 85, 82, 207, 69, 85, 76, 69, 210, 69, 85, 45, 85, 128, 69, 85, 
+    45, 79, 128, 69, 85, 45, 69, 85, 128, 69, 85, 45, 69, 79, 128, 69, 85, 
+    45, 69, 128, 69, 85, 45, 65, 128, 69, 84, 88, 128, 69, 84, 78, 65, 72, 
+    84, 65, 128, 69, 84, 72, 69, 204, 69, 84, 69, 82, 79, 206, 69, 84, 69, 
+    82, 78, 73, 84, 89, 128, 69, 84, 66, 128, 69, 83, 85, 75, 85, 85, 68, 79, 
+    128, 69, 83, 84, 73, 77, 65, 84, 69, 83, 128, 69, 83, 84, 73, 77, 65, 84, 
+    69, 196, 69, 83, 72, 69, 51, 128, 69, 83, 72, 50, 49, 128, 69, 83, 72, 
+    178, 69, 83, 72, 49, 54, 128, 69, 83, 67, 65, 80, 69, 128, 69, 83, 67, 
+    128, 69, 83, 65, 128, 69, 83, 45, 84, 69, 128, 69, 82, 82, 79, 82, 45, 
+    66, 65, 82, 82, 69, 196, 69, 82, 82, 128, 69, 82, 73, 78, 50, 128, 69, 
+    82, 71, 128, 69, 82, 65, 83, 197, 69, 81, 85, 73, 86, 65, 76, 69, 78, 
+    212, 69, 81, 85, 73, 68, 128, 69, 81, 85, 73, 65, 78, 71, 85, 76, 65, 
+    210, 69, 81, 85, 65, 76, 83, 128, 69, 81, 85, 65, 76, 211, 69, 81, 85, 
+    65, 76, 128, 69, 80, 83, 73, 76, 79, 78, 128, 69, 80, 83, 73, 76, 79, 
+    206, 69, 80, 79, 67, 72, 128, 69, 80, 73, 71, 82, 65, 80, 72, 73, 195, 
+    69, 80, 73, 68, 65, 85, 82, 69, 65, 206, 69, 80, 69, 78, 84, 72, 69, 84, 
+    73, 195, 69, 80, 69, 71, 69, 82, 77, 65, 128, 69, 79, 84, 128, 69, 79, 
+    77, 128, 69, 79, 76, 72, 88, 128, 69, 79, 76, 128, 69, 79, 72, 128, 69, 
+    78, 89, 128, 69, 78, 86, 69, 76, 79, 80, 69, 128, 69, 78, 86, 69, 76, 79, 
+    80, 197, 69, 78, 85, 77, 69, 82, 65, 84, 73, 79, 206, 69, 78, 84, 82, 89, 
+    45, 50, 128, 69, 78, 84, 82, 89, 45, 49, 128, 69, 78, 84, 82, 89, 128, 
+    69, 78, 84, 82, 217, 69, 78, 84, 72, 85, 83, 73, 65, 83, 77, 128, 69, 78, 
+    84, 69, 82, 80, 82, 73, 83, 69, 128, 69, 78, 84, 69, 82, 73, 78, 199, 69, 
+    78, 84, 69, 82, 128, 69, 78, 84, 69, 210, 69, 78, 81, 85, 73, 82, 89, 
+    128, 69, 78, 81, 128, 69, 78, 79, 211, 69, 78, 78, 128, 69, 78, 76, 65, 
+    82, 71, 69, 77, 69, 78, 84, 128, 69, 78, 71, 73, 78, 69, 128, 69, 78, 68, 
+    79, 70, 79, 78, 79, 78, 128, 69, 78, 68, 73, 78, 199, 69, 78, 68, 69, 80, 
+    128, 69, 78, 68, 69, 65, 86, 79, 85, 82, 128, 69, 78, 67, 79, 85, 78, 84, 
+    69, 82, 83, 128, 69, 78, 67, 76, 79, 83, 85, 82, 69, 128, 69, 78, 67, 76, 
+    79, 83, 73, 78, 199, 69, 78, 67, 128, 69, 78, 65, 82, 88, 73, 211, 69, 
+    78, 65, 82, 77, 79, 78, 73, 79, 211, 69, 77, 80, 84, 217, 69, 77, 80, 72, 
+    65, 84, 73, 195, 69, 77, 80, 72, 65, 83, 73, 211, 69, 77, 66, 82, 79, 73, 
+    68, 69, 82, 89, 128, 69, 77, 66, 76, 69, 77, 128, 69, 77, 66, 69, 76, 76, 
+    73, 83, 72, 77, 69, 78, 84, 128, 69, 77, 66, 69, 68, 68, 73, 78, 71, 128, 
+    69, 76, 84, 128, 69, 76, 76, 73, 80, 84, 73, 195, 69, 76, 76, 73, 80, 83, 
+    73, 83, 128, 69, 76, 76, 73, 80, 83, 69, 128, 69, 76, 73, 70, 73, 128, 
+    69, 76, 69, 86, 69, 78, 45, 84, 72, 73, 82, 84, 89, 128, 69, 76, 69, 86, 
+    69, 78, 128, 69, 76, 69, 86, 69, 206, 69, 76, 69, 80, 72, 65, 78, 84, 
+    128, 69, 76, 69, 77, 69, 78, 212, 69, 76, 69, 67, 84, 82, 73, 67, 65, 
+    204, 69, 76, 69, 67, 84, 82, 73, 195, 69, 76, 65, 70, 82, 79, 78, 128, 
+    69, 75, 83, 84, 82, 69, 80, 84, 79, 78, 128, 69, 75, 83, 128, 69, 75, 70, 
+    79, 78, 73, 84, 73, 75, 79, 78, 128, 69, 75, 65, 82, 65, 128, 69, 74, 69, 
+    67, 212, 69, 73, 83, 128, 69, 73, 71, 72, 84, 89, 128, 69, 73, 71, 72, 
+    84, 217, 69, 73, 71, 72, 84, 72, 83, 128, 69, 73, 71, 72, 84, 72, 211, 
+    69, 73, 71, 72, 84, 72, 128, 69, 73, 71, 72, 84, 69, 69, 78, 128, 69, 73, 
+    71, 72, 84, 69, 69, 206, 69, 73, 71, 72, 84, 45, 84, 72, 73, 82, 84, 89, 
+    128, 69, 73, 69, 128, 69, 72, 87, 65, 218, 69, 71, 89, 80, 84, 79, 76, 
+    79, 71, 73, 67, 65, 204, 69, 71, 73, 82, 128, 69, 71, 71, 128, 69, 69, 
+    89, 65, 78, 78, 65, 128, 69, 69, 75, 65, 65, 128, 69, 69, 72, 128, 69, 
+    69, 66, 69, 69, 70, 73, 76, 73, 128, 69, 68, 73, 84, 79, 82, 73, 65, 204, 
+    69, 68, 73, 78, 128, 69, 68, 68, 128, 69, 66, 69, 70, 73, 76, 73, 128, 
+    69, 65, 83, 84, 69, 82, 206, 69, 65, 83, 212, 69, 65, 82, 84, 72, 76, 
+    217, 69, 65, 82, 84, 72, 128, 69, 65, 82, 84, 200, 69, 65, 82, 83, 128, 
+    69, 65, 82, 76, 217, 69, 65, 77, 72, 65, 78, 67, 72, 79, 76, 76, 128, 69, 
+    65, 71, 76, 69, 128, 69, 65, 68, 72, 65, 68, 72, 128, 69, 65, 66, 72, 65, 
+    68, 72, 128, 69, 178, 69, 48, 51, 56, 128, 69, 48, 51, 55, 128, 69, 48, 
+    51, 54, 128, 69, 48, 51, 52, 65, 128, 69, 48, 51, 52, 128, 69, 48, 51, 
+    51, 128, 69, 48, 51, 50, 128, 69, 48, 51, 49, 128, 69, 48, 51, 48, 128, 
+    69, 48, 50, 57, 128, 69, 48, 50, 56, 65, 128, 69, 48, 50, 56, 128, 69, 
+    48, 50, 55, 128, 69, 48, 50, 54, 128, 69, 48, 50, 53, 128, 69, 48, 50, 
+    52, 128, 69, 48, 50, 51, 128, 69, 48, 50, 50, 128, 69, 48, 50, 49, 128, 
+    69, 48, 50, 48, 65, 128, 69, 48, 50, 48, 128, 69, 48, 49, 57, 128, 69, 
+    48, 49, 56, 128, 69, 48, 49, 55, 65, 128, 69, 48, 49, 55, 128, 69, 48, 
+    49, 54, 65, 128, 69, 48, 49, 54, 128, 69, 48, 49, 53, 128, 69, 48, 49, 
+    52, 128, 69, 48, 49, 51, 128, 69, 48, 49, 50, 128, 69, 48, 49, 49, 128, 
+    69, 48, 49, 48, 128, 69, 48, 48, 57, 65, 128, 69, 48, 48, 57, 128, 69, 
+    48, 48, 56, 65, 128, 69, 48, 48, 56, 128, 69, 48, 48, 55, 128, 69, 48, 
+    48, 54, 128, 69, 48, 48, 53, 128, 69, 48, 48, 52, 128, 69, 48, 48, 51, 
+    128, 69, 48, 48, 50, 128, 69, 48, 48, 49, 128, 69, 45, 77, 65, 73, 204, 
+    68, 90, 90, 69, 128, 68, 90, 90, 65, 128, 68, 90, 87, 69, 128, 68, 90, 
+    85, 128, 68, 90, 79, 128, 68, 90, 74, 69, 128, 68, 90, 73, 128, 68, 90, 
+    72, 69, 128, 68, 90, 72, 65, 128, 68, 90, 69, 76, 79, 128, 68, 90, 69, 
+    69, 128, 68, 90, 69, 128, 68, 90, 65, 65, 128, 68, 90, 65, 128, 68, 90, 
+    128, 68, 218, 68, 89, 79, 128, 68, 89, 207, 68, 89, 69, 72, 128, 68, 89, 
+    69, 200, 68, 87, 79, 128, 68, 87, 69, 128, 68, 87, 65, 128, 68, 86, 73, 
+    83, 86, 65, 82, 65, 128, 68, 86, 68, 128, 68, 86, 128, 68, 85, 84, 73, 
+    69, 83, 128, 68, 85, 83, 75, 128, 68, 85, 83, 72, 69, 78, 78, 65, 128, 
+    68, 85, 82, 65, 84, 73, 79, 78, 128, 68, 85, 82, 50, 128, 68, 85, 80, 79, 
+    78, 68, 73, 85, 211, 68, 85, 79, 88, 128, 68, 85, 79, 128, 68, 85, 78, 
+    52, 128, 68, 85, 78, 51, 128, 68, 85, 78, 179, 68, 85, 77, 128, 68, 85, 
+    204, 68, 85, 72, 128, 68, 85, 71, 85, 68, 128, 68, 85, 66, 50, 128, 68, 
+    85, 66, 128, 68, 85, 194, 68, 82, 89, 128, 68, 82, 217, 68, 82, 85, 77, 
+    128, 68, 82, 85, 205, 68, 82, 79, 80, 83, 128, 68, 82, 79, 80, 76, 69, 
+    84, 128, 68, 82, 79, 80, 45, 83, 72, 65, 68, 79, 87, 69, 196, 68, 82, 79, 
+    77, 69, 68, 65, 82, 217, 68, 82, 73, 86, 69, 128, 68, 82, 73, 86, 197, 
+    68, 82, 73, 78, 75, 128, 68, 82, 73, 204, 68, 82, 69, 83, 83, 128, 68, 
+    82, 65, 85, 71, 72, 84, 211, 68, 82, 65, 77, 128, 68, 82, 65, 205, 68, 
+    82, 65, 71, 79, 78, 128, 68, 82, 65, 71, 79, 206, 68, 82, 65, 70, 84, 73, 
+    78, 199, 68, 82, 65, 67, 72, 77, 65, 83, 128, 68, 82, 65, 67, 72, 77, 65, 
+    128, 68, 82, 65, 67, 72, 77, 193, 68, 79, 87, 78, 87, 65, 82, 68, 83, 
+    128, 68, 79, 87, 78, 87, 65, 82, 68, 211, 68, 79, 87, 78, 45, 80, 79, 73, 
+    78, 84, 73, 78, 199, 68, 79, 87, 78, 128, 68, 79, 86, 69, 128, 68, 79, 
+    85, 71, 72, 78, 85, 84, 128, 68, 79, 85, 66, 84, 128, 68, 79, 85, 66, 76, 
+    69, 196, 68, 79, 85, 66, 76, 69, 45, 76, 73, 78, 197, 68, 79, 85, 66, 76, 
+    69, 45, 69, 78, 68, 69, 196, 68, 79, 85, 66, 76, 69, 128, 68, 79, 84, 84, 
+    69, 68, 45, 80, 128, 68, 79, 84, 84, 69, 68, 45, 78, 128, 68, 79, 84, 84, 
+    69, 68, 45, 76, 128, 68, 79, 84, 84, 69, 68, 128, 68, 79, 84, 84, 69, 
+    196, 68, 79, 84, 83, 45, 56, 128, 68, 79, 84, 83, 45, 55, 56, 128, 68, 
+    79, 84, 83, 45, 55, 128, 68, 79, 84, 83, 45, 54, 56, 128, 68, 79, 84, 83, 
+    45, 54, 55, 56, 128, 68, 79, 84, 83, 45, 54, 55, 128, 68, 79, 84, 83, 45, 
+    54, 128, 68, 79, 84, 83, 45, 53, 56, 128, 68, 79, 84, 83, 45, 53, 55, 56, 
+    128, 68, 79, 84, 83, 45, 53, 55, 128, 68, 79, 84, 83, 45, 53, 54, 56, 
+    128, 68, 79, 84, 83, 45, 53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 53, 54, 
+    55, 128, 68, 79, 84, 83, 45, 53, 54, 128, 68, 79, 84, 83, 45, 53, 128, 
+    68, 79, 84, 83, 45, 52, 56, 128, 68, 79, 84, 83, 45, 52, 55, 56, 128, 68, 
+    79, 84, 83, 45, 52, 55, 128, 68, 79, 84, 83, 45, 52, 54, 56, 128, 68, 79, 
+    84, 83, 45, 52, 54, 55, 56, 128, 68, 79, 84, 83, 45, 52, 54, 55, 128, 68, 
+    79, 84, 83, 45, 52, 54, 128, 68, 79, 84, 83, 45, 52, 53, 56, 128, 68, 79, 
+    84, 83, 45, 52, 53, 55, 56, 128, 68, 79, 84, 83, 45, 52, 53, 55, 128, 68, 
+    79, 84, 83, 45, 52, 53, 54, 56, 128, 68, 79, 84, 83, 45, 52, 53, 54, 55, 
+    56, 128, 68, 79, 84, 83, 45, 52, 53, 54, 55, 128, 68, 79, 84, 83, 45, 52, 
+    53, 54, 128, 68, 79, 84, 83, 45, 52, 53, 128, 68, 79, 84, 83, 45, 52, 
+    128, 68, 79, 84, 83, 45, 51, 56, 128, 68, 79, 84, 83, 45, 51, 55, 56, 
+    128, 68, 79, 84, 83, 45, 51, 55, 128, 68, 79, 84, 83, 45, 51, 54, 56, 
+    128, 68, 79, 84, 83, 45, 51, 54, 55, 56, 128, 68, 79, 84, 83, 45, 51, 54, 
+    55, 128, 68, 79, 84, 83, 45, 51, 54, 128, 68, 79, 84, 83, 45, 51, 53, 56, 
+    128, 68, 79, 84, 83, 45, 51, 53, 55, 56, 128, 68, 79, 84, 83, 45, 51, 53, 
+    55, 128, 68, 79, 84, 83, 45, 51, 53, 54, 56, 128, 68, 79, 84, 83, 45, 51, 
+    53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 51, 53, 54, 55, 128, 68, 79, 84, 
+    83, 45, 51, 53, 54, 128, 68, 79, 84, 83, 45, 51, 53, 128, 68, 79, 84, 83, 
+    45, 51, 52, 56, 128, 68, 79, 84, 83, 45, 51, 52, 55, 56, 128, 68, 79, 84, 
+    83, 45, 51, 52, 55, 128, 68, 79, 84, 83, 45, 51, 52, 54, 56, 128, 68, 79, 
+    84, 83, 45, 51, 52, 54, 55, 56, 128, 68, 79, 84, 83, 45, 51, 52, 54, 55, 
+    128, 68, 79, 84, 83, 45, 51, 52, 54, 128, 68, 79, 84, 83, 45, 51, 52, 53, 
+    56, 128, 68, 79, 84, 83, 45, 51, 52, 53, 55, 56, 128, 68, 79, 84, 83, 45, 
+    51, 52, 53, 55, 128, 68, 79, 84, 83, 45, 51, 52, 53, 54, 56, 128, 68, 79, 
+    84, 83, 45, 51, 52, 53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 51, 52, 53, 
+    54, 55, 128, 68, 79, 84, 83, 45, 51, 52, 53, 54, 128, 68, 79, 84, 83, 45, 
+    51, 52, 53, 128, 68, 79, 84, 83, 45, 51, 52, 128, 68, 79, 84, 83, 45, 51, 
+    128, 68, 79, 84, 83, 45, 50, 56, 128, 68, 79, 84, 83, 45, 50, 55, 56, 
+    128, 68, 79, 84, 83, 45, 50, 55, 128, 68, 79, 84, 83, 45, 50, 54, 56, 
+    128, 68, 79, 84, 83, 45, 50, 54, 55, 56, 128, 68, 79, 84, 83, 45, 50, 54, 
+    55, 128, 68, 79, 84, 83, 45, 50, 54, 128, 68, 79, 84, 83, 45, 50, 53, 56, 
+    128, 68, 79, 84, 83, 45, 50, 53, 55, 56, 128, 68, 79, 84, 83, 45, 50, 53, 
+    55, 128, 68, 79, 84, 83, 45, 50, 53, 54, 56, 128, 68, 79, 84, 83, 45, 50, 
+    53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 50, 53, 54, 55, 128, 68, 79, 84, 
+    83, 45, 50, 53, 54, 128, 68, 79, 84, 83, 45, 50, 53, 128, 68, 79, 84, 83, 
+    45, 50, 52, 56, 128, 68, 79, 84, 83, 45, 50, 52, 55, 56, 128, 68, 79, 84, 
+    83, 45, 50, 52, 55, 128, 68, 79, 84, 83, 45, 50, 52, 54, 56, 128, 68, 79, 
+    84, 83, 45, 50, 52, 54, 55, 56, 128, 68, 79, 84, 83, 45, 50, 52, 54, 55, 
+    128, 68, 79, 84, 83, 45, 50, 52, 54, 128, 68, 79, 84, 83, 45, 50, 52, 53, 
+    56, 128, 68, 79, 84, 83, 45, 50, 52, 53, 55, 56, 128, 68, 79, 84, 83, 45, 
+    50, 52, 53, 55, 128, 68, 79, 84, 83, 45, 50, 52, 53, 54, 56, 128, 68, 79, 
+    84, 83, 45, 50, 52, 53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 50, 52, 53, 
+    54, 55, 128, 68, 79, 84, 83, 45, 50, 52, 53, 54, 128, 68, 79, 84, 83, 45, 
+    50, 52, 53, 128, 68, 79, 84, 83, 45, 50, 52, 128, 68, 79, 84, 83, 45, 50, 
+    51, 56, 128, 68, 79, 84, 83, 45, 50, 51, 55, 56, 128, 68, 79, 84, 83, 45, 
+    50, 51, 55, 128, 68, 79, 84, 83, 45, 50, 51, 54, 56, 128, 68, 79, 84, 83, 
+    45, 50, 51, 54, 55, 56, 128, 68, 79, 84, 83, 45, 50, 51, 54, 55, 128, 68, 
+    79, 84, 83, 45, 50, 51, 54, 128, 68, 79, 84, 83, 45, 50, 51, 53, 56, 128, 
+    68, 79, 84, 83, 45, 50, 51, 53, 55, 56, 128, 68, 79, 84, 83, 45, 50, 51, 
+    53, 55, 128, 68, 79, 84, 83, 45, 50, 51, 53, 54, 56, 128, 68, 79, 84, 83, 
+    45, 50, 51, 53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 50, 51, 53, 54, 55, 
+    128, 68, 79, 84, 83, 45, 50, 51, 53, 54, 128, 68, 79, 84, 83, 45, 50, 51, 
+    53, 128, 68, 79, 84, 83, 45, 50, 51, 52, 56, 128, 68, 79, 84, 83, 45, 50, 
+    51, 52, 55, 56, 128, 68, 79, 84, 83, 45, 50, 51, 52, 55, 128, 68, 79, 84, 
+    83, 45, 50, 51, 52, 54, 56, 128, 68, 79, 84, 83, 45, 50, 51, 52, 54, 55, 
+    56, 128, 68, 79, 84, 83, 45, 50, 51, 52, 54, 55, 128, 68, 79, 84, 83, 45, 
+    50, 51, 52, 54, 128, 68, 79, 84, 83, 45, 50, 51, 52, 53, 56, 128, 68, 79, 
+    84, 83, 45, 50, 51, 52, 53, 55, 56, 128, 68, 79, 84, 83, 45, 50, 51, 52, 
+    53, 55, 128, 68, 79, 84, 83, 45, 50, 51, 52, 53, 54, 56, 128, 68, 79, 84, 
+    83, 45, 50, 51, 52, 53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 50, 51, 52, 
+    53, 54, 55, 128, 68, 79, 84, 83, 45, 50, 51, 52, 53, 54, 128, 68, 79, 84, 
+    83, 45, 50, 51, 52, 53, 128, 68, 79, 84, 83, 45, 50, 51, 52, 128, 68, 79, 
+    84, 83, 45, 50, 51, 128, 68, 79, 84, 83, 45, 50, 128, 68, 79, 84, 83, 45, 
+    49, 56, 128, 68, 79, 84, 83, 45, 49, 55, 56, 128, 68, 79, 84, 83, 45, 49, 
+    55, 128, 68, 79, 84, 83, 45, 49, 54, 56, 128, 68, 79, 84, 83, 45, 49, 54, 
+    55, 56, 128, 68, 79, 84, 83, 45, 49, 54, 55, 128, 68, 79, 84, 83, 45, 49, 
+    54, 128, 68, 79, 84, 83, 45, 49, 53, 56, 128, 68, 79, 84, 83, 45, 49, 53, 
+    55, 56, 128, 68, 79, 84, 83, 45, 49, 53, 55, 128, 68, 79, 84, 83, 45, 49, 
+    53, 54, 56, 128, 68, 79, 84, 83, 45, 49, 53, 54, 55, 56, 128, 68, 79, 84, 
+    83, 45, 49, 53, 54, 55, 128, 68, 79, 84, 83, 45, 49, 53, 54, 128, 68, 79, 
+    84, 83, 45, 49, 53, 128, 68, 79, 84, 83, 45, 49, 52, 56, 128, 68, 79, 84, 
+    83, 45, 49, 52, 55, 56, 128, 68, 79, 84, 83, 45, 49, 52, 55, 128, 68, 79, 
+    84, 83, 45, 49, 52, 54, 56, 128, 68, 79, 84, 83, 45, 49, 52, 54, 55, 56, 
+    128, 68, 79, 84, 83, 45, 49, 52, 54, 55, 128, 68, 79, 84, 83, 45, 49, 52, 
+    54, 128, 68, 79, 84, 83, 45, 49, 52, 53, 56, 128, 68, 79, 84, 83, 45, 49, 
+    52, 53, 55, 56, 128, 68, 79, 84, 83, 45, 49, 52, 53, 55, 128, 68, 79, 84, 
+    83, 45, 49, 52, 53, 54, 56, 128, 68, 79, 84, 83, 45, 49, 52, 53, 54, 55, 
+    56, 128, 68, 79, 84, 83, 45, 49, 52, 53, 54, 55, 128, 68, 79, 84, 83, 45, 
+    49, 52, 53, 54, 128, 68, 79, 84, 83, 45, 49, 52, 53, 128, 68, 79, 84, 83, 
+    45, 49, 52, 128, 68, 79, 84, 83, 45, 49, 51, 56, 128, 68, 79, 84, 83, 45, 
+    49, 51, 55, 56, 128, 68, 79, 84, 83, 45, 49, 51, 55, 128, 68, 79, 84, 83, 
+    45, 49, 51, 54, 56, 128, 68, 79, 84, 83, 45, 49, 51, 54, 55, 56, 128, 68, 
+    79, 84, 83, 45, 49, 51, 54, 55, 128, 68, 79, 84, 83, 45, 49, 51, 54, 128, 
+    68, 79, 84, 83, 45, 49, 51, 53, 56, 128, 68, 79, 84, 83, 45, 49, 51, 53, 
+    55, 56, 128, 68, 79, 84, 83, 45, 49, 51, 53, 55, 128, 68, 79, 84, 83, 45, 
+    49, 51, 53, 54, 56, 128, 68, 79, 84, 83, 45, 49, 51, 53, 54, 55, 56, 128, 
+    68, 79, 84, 83, 45, 49, 51, 53, 54, 55, 128, 68, 79, 84, 83, 45, 49, 51, 
+    53, 54, 128, 68, 79, 84, 83, 45, 49, 51, 53, 128, 68, 79, 84, 83, 45, 49, 
+    51, 52, 56, 128, 68, 79, 84, 83, 45, 49, 51, 52, 55, 56, 128, 68, 79, 84, 
+    83, 45, 49, 51, 52, 55, 128, 68, 79, 84, 83, 45, 49, 51, 52, 54, 56, 128, 
+    68, 79, 84, 83, 45, 49, 51, 52, 54, 55, 56, 128, 68, 79, 84, 83, 45, 49, 
+    51, 52, 54, 55, 128, 68, 79, 84, 83, 45, 49, 51, 52, 54, 128, 68, 79, 84, 
+    83, 45, 49, 51, 52, 53, 56, 128, 68, 79, 84, 83, 45, 49, 51, 52, 53, 55, 
+    56, 128, 68, 79, 84, 83, 45, 49, 51, 52, 53, 55, 128, 68, 79, 84, 83, 45, 
+    49, 51, 52, 53, 54, 56, 128, 68, 79, 84, 83, 45, 49, 51, 52, 53, 54, 55, 
+    56, 128, 68, 79, 84, 83, 45, 49, 51, 52, 53, 54, 55, 128, 68, 79, 84, 83, 
+    45, 49, 51, 52, 53, 54, 128, 68, 79, 84, 83, 45, 49, 51, 52, 53, 128, 68, 
+    79, 84, 83, 45, 49, 51, 52, 128, 68, 79, 84, 83, 45, 49, 51, 128, 68, 79, 
+    84, 83, 45, 49, 50, 56, 128, 68, 79, 84, 83, 45, 49, 50, 55, 56, 128, 68, 
+    79, 84, 83, 45, 49, 50, 55, 128, 68, 79, 84, 83, 45, 49, 50, 54, 56, 128, 
+    68, 79, 84, 83, 45, 49, 50, 54, 55, 56, 128, 68, 79, 84, 83, 45, 49, 50, 
+    54, 55, 128, 68, 79, 84, 83, 45, 49, 50, 54, 128, 68, 79, 84, 83, 45, 49, 
+    50, 53, 56, 128, 68, 79, 84, 83, 45, 49, 50, 53, 55, 56, 128, 68, 79, 84, 
+    83, 45, 49, 50, 53, 55, 128, 68, 79, 84, 83, 45, 49, 50, 53, 54, 56, 128, 
+    68, 79, 84, 83, 45, 49, 50, 53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 49, 
+    50, 53, 54, 55, 128, 68, 79, 84, 83, 45, 49, 50, 53, 54, 128, 68, 79, 84, 
+    83, 45, 49, 50, 53, 128, 68, 79, 84, 83, 45, 49, 50, 52, 56, 128, 68, 79, 
+    84, 83, 45, 49, 50, 52, 55, 56, 128, 68, 79, 84, 83, 45, 49, 50, 52, 55, 
+    128, 68, 79, 84, 83, 45, 49, 50, 52, 54, 56, 128, 68, 79, 84, 83, 45, 49, 
+    50, 52, 54, 55, 56, 128, 68, 79, 84, 83, 45, 49, 50, 52, 54, 55, 128, 68, 
+    79, 84, 83, 45, 49, 50, 52, 54, 128, 68, 79, 84, 83, 45, 49, 50, 52, 53, 
+    56, 128, 68, 79, 84, 83, 45, 49, 50, 52, 53, 55, 56, 128, 68, 79, 84, 83, 
+    45, 49, 50, 52, 53, 55, 128, 68, 79, 84, 83, 45, 49, 50, 52, 53, 54, 56, 
+    128, 68, 79, 84, 83, 45, 49, 50, 52, 53, 54, 55, 56, 128, 68, 79, 84, 83, 
+    45, 49, 50, 52, 53, 54, 55, 128, 68, 79, 84, 83, 45, 49, 50, 52, 53, 54, 
+    128, 68, 79, 84, 83, 45, 49, 50, 52, 53, 128, 68, 79, 84, 83, 45, 49, 50, 
+    52, 128, 68, 79, 84, 83, 45, 49, 50, 51, 56, 128, 68, 79, 84, 83, 45, 49, 
+    50, 51, 55, 56, 128, 68, 79, 84, 83, 45, 49, 50, 51, 55, 128, 68, 79, 84, 
+    83, 45, 49, 50, 51, 54, 56, 128, 68, 79, 84, 83, 45, 49, 50, 51, 54, 55, 
+    56, 128, 68, 79, 84, 83, 45, 49, 50, 51, 54, 55, 128, 68, 79, 84, 83, 45, 
+    49, 50, 51, 54, 128, 68, 79, 84, 83, 45, 49, 50, 51, 53, 56, 128, 68, 79, 
+    84, 83, 45, 49, 50, 51, 53, 55, 56, 128, 68, 79, 84, 83, 45, 49, 50, 51, 
+    53, 55, 128, 68, 79, 84, 83, 45, 49, 50, 51, 53, 54, 56, 128, 68, 79, 84, 
+    83, 45, 49, 50, 51, 53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 49, 50, 51, 
+    53, 54, 55, 128, 68, 79, 84, 83, 45, 49, 50, 51, 53, 54, 128, 68, 79, 84, 
+    83, 45, 49, 50, 51, 53, 128, 68, 79, 84, 83, 45, 49, 50, 51, 52, 56, 128, 
+    68, 79, 84, 83, 45, 49, 50, 51, 52, 55, 56, 128, 68, 79, 84, 83, 45, 49, 
+    50, 51, 52, 55, 128, 68, 79, 84, 83, 45, 49, 50, 51, 52, 54, 56, 128, 68, 
+    79, 84, 83, 45, 49, 50, 51, 52, 54, 55, 56, 128, 68, 79, 84, 83, 45, 49, 
+    50, 51, 52, 54, 55, 128, 68, 79, 84, 83, 45, 49, 50, 51, 52, 54, 128, 68, 
+    79, 84, 83, 45, 49, 50, 51, 52, 53, 56, 128, 68, 79, 84, 83, 45, 49, 50, 
+    51, 52, 53, 55, 56, 128, 68, 79, 84, 83, 45, 49, 50, 51, 52, 53, 55, 128, 
+    68, 79, 84, 83, 45, 49, 50, 51, 52, 53, 54, 56, 128, 68, 79, 84, 83, 45, 
+    49, 50, 51, 52, 53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 49, 50, 51, 52, 
+    53, 54, 55, 128, 68, 79, 84, 83, 45, 49, 50, 51, 52, 53, 54, 128, 68, 79, 
+    84, 83, 45, 49, 50, 51, 52, 53, 128, 68, 79, 84, 83, 45, 49, 50, 51, 52, 
+    128, 68, 79, 84, 83, 45, 49, 50, 51, 128, 68, 79, 84, 83, 45, 49, 50, 
+    128, 68, 79, 84, 83, 45, 49, 128, 68, 79, 84, 83, 128, 68, 79, 84, 76, 
+    69, 83, 211, 68, 79, 82, 85, 128, 68, 79, 79, 82, 128, 68, 79, 79, 78, 
+    71, 128, 68, 79, 78, 71, 128, 68, 79, 77, 65, 73, 206, 68, 79, 76, 80, 
+    72, 73, 78, 128, 68, 79, 76, 76, 83, 128, 68, 79, 76, 76, 65, 210, 68, 
+    79, 76, 73, 85, 77, 128, 68, 79, 75, 77, 65, 73, 128, 68, 79, 73, 84, 
+    128, 68, 79, 71, 128, 68, 79, 199, 68, 79, 69, 211, 68, 79, 68, 69, 75, 
+    65, 84, 65, 128, 68, 79, 66, 82, 79, 128, 68, 79, 65, 67, 72, 65, 83, 72, 
+    77, 69, 69, 128, 68, 79, 65, 67, 72, 65, 83, 72, 77, 69, 197, 68, 79, 65, 
+    128, 68, 79, 45, 79, 128, 68, 77, 128, 68, 205, 68, 76, 85, 128, 68, 76, 
+    79, 128, 68, 76, 73, 128, 68, 76, 72, 89, 65, 128, 68, 76, 72, 65, 128, 
+    68, 76, 69, 69, 128, 68, 76, 65, 128, 68, 76, 128, 68, 75, 65, 82, 128, 
+    68, 75, 65, 210, 68, 74, 69, 82, 86, 73, 128, 68, 74, 69, 82, 86, 128, 
+    68, 74, 69, 128, 68, 74, 65, 128, 68, 73, 90, 90, 217, 68, 73, 86, 79, 
+    82, 67, 197, 68, 73, 86, 73, 83, 73, 79, 78, 128, 68, 73, 86, 73, 83, 73, 
+    79, 206, 68, 73, 86, 73, 78, 65, 84, 73, 79, 78, 128, 68, 73, 86, 73, 68, 
+    69, 83, 128, 68, 73, 86, 73, 68, 69, 82, 128, 68, 73, 86, 73, 68, 69, 
+    196, 68, 73, 86, 73, 68, 69, 128, 68, 73, 86, 73, 68, 197, 68, 73, 86, 
+    69, 82, 71, 69, 78, 67, 69, 128, 68, 73, 84, 84, 207, 68, 73, 83, 84, 79, 
+    82, 84, 73, 79, 78, 128, 68, 73, 83, 84, 73, 78, 71, 85, 73, 83, 72, 128, 
+    68, 73, 83, 84, 73, 76, 76, 128, 68, 73, 83, 83, 79, 76, 86, 69, 45, 50, 
+    128, 68, 73, 83, 83, 79, 76, 86, 69, 128, 68, 73, 83, 80, 69, 82, 83, 73, 
+    79, 78, 128, 68, 73, 83, 75, 128, 68, 73, 83, 73, 77, 79, 85, 128, 68, 
+    73, 83, 72, 128, 68, 73, 83, 67, 79, 78, 84, 73, 78, 85, 79, 85, 211, 68, 
+    73, 83, 195, 68, 73, 83, 65, 80, 80, 79, 73, 78, 84, 69, 196, 68, 73, 83, 
+    65, 66, 76, 69, 196, 68, 73, 82, 71, 193, 68, 73, 82, 69, 67, 84, 76, 
+    217, 68, 73, 82, 69, 67, 84, 73, 79, 78, 65, 204, 68, 73, 80, 84, 69, 
+    128, 68, 73, 80, 80, 69, 82, 128, 68, 73, 80, 76, 79, 85, 78, 128, 68, 
+    73, 80, 76, 73, 128, 68, 73, 80, 76, 201, 68, 73, 78, 71, 66, 65, 212, 
+    68, 73, 206, 68, 73, 77, 77, 73, 78, 71, 128, 68, 73, 77, 73, 78, 85, 84, 
+    73, 79, 78, 45, 51, 128, 68, 73, 77, 73, 78, 85, 84, 73, 79, 78, 45, 50, 
+    128, 68, 73, 77, 73, 78, 85, 84, 73, 79, 78, 45, 49, 128, 68, 73, 77, 73, 
+    78, 73, 83, 72, 77, 69, 78, 84, 128, 68, 73, 77, 73, 68, 73, 193, 68, 73, 
+    77, 69, 78, 83, 73, 79, 78, 65, 204, 68, 73, 77, 69, 78, 83, 73, 79, 206, 
+    68, 73, 77, 50, 128, 68, 73, 76, 128, 68, 73, 71, 82, 65, 80, 72, 128, 
+    68, 73, 71, 82, 65, 80, 200, 68, 73, 71, 82, 65, 77, 77, 79, 211, 68, 73, 
+    71, 82, 65, 77, 77, 193, 68, 73, 71, 82, 65, 205, 68, 73, 71, 79, 82, 71, 
+    79, 78, 128, 68, 73, 71, 79, 82, 71, 79, 206, 68, 73, 71, 65, 77, 77, 65, 
+    128, 68, 73, 71, 193, 68, 73, 70, 84, 79, 71, 71, 79, 211, 68, 73, 70, 
+    79, 78, 73, 65, 83, 128, 68, 73, 70, 70, 73, 67, 85, 76, 84, 217, 68, 73, 
+    70, 70, 73, 67, 85, 76, 84, 73, 69, 83, 128, 68, 73, 70, 70, 69, 82, 69, 
+    78, 84, 73, 65, 76, 128, 68, 73, 70, 70, 69, 82, 69, 78, 67, 197, 68, 73, 
+    70, 65, 84, 128, 68, 73, 69, 83, 73, 83, 128, 68, 73, 69, 83, 73, 211, 
+    68, 73, 69, 80, 128, 68, 73, 197, 68, 73, 66, 128, 68, 73, 65, 84, 79, 
+    78, 79, 206, 68, 73, 65, 84, 79, 78, 73, 75, 201, 68, 73, 65, 83, 84, 79, 
+    76, 201, 68, 73, 65, 77, 79, 78, 68, 83, 128, 68, 73, 65, 77, 79, 78, 68, 
+    128, 68, 73, 65, 77, 79, 78, 196, 68, 73, 65, 77, 69, 84, 69, 210, 68, 
+    73, 65, 76, 89, 84, 73, 75, 65, 128, 68, 73, 65, 76, 89, 84, 73, 75, 193, 
+    68, 73, 65, 76, 69, 67, 84, 45, 208, 68, 73, 65, 71, 79, 78, 65, 76, 128, 
+    68, 73, 65, 71, 79, 78, 65, 204, 68, 73, 65, 69, 82, 69, 83, 73, 90, 69, 
+    196, 68, 73, 65, 69, 82, 69, 83, 73, 83, 128, 68, 73, 65, 69, 82, 69, 83, 
+    73, 211, 68, 72, 79, 85, 128, 68, 72, 79, 79, 128, 68, 72, 79, 128, 68, 
+    72, 73, 128, 68, 72, 72, 85, 128, 68, 72, 72, 79, 79, 128, 68, 72, 72, 
+    79, 128, 68, 72, 72, 73, 128, 68, 72, 72, 69, 69, 128, 68, 72, 72, 69, 
+    128, 68, 72, 72, 65, 128, 68, 72, 69, 69, 128, 68, 72, 65, 82, 77, 65, 
+    128, 68, 72, 65, 76, 69, 84, 72, 128, 68, 72, 65, 76, 65, 84, 72, 128, 
+    68, 72, 65, 76, 128, 68, 72, 65, 68, 72, 69, 128, 68, 72, 65, 65, 76, 85, 
+    128, 68, 72, 65, 65, 128, 68, 72, 65, 128, 68, 69, 90, 200, 68, 69, 89, 
+    84, 69, 82, 79, 213, 68, 69, 89, 84, 69, 82, 79, 211, 68, 69, 88, 73, 65, 
+    128, 68, 69, 86, 73, 67, 197, 68, 69, 86, 69, 76, 79, 80, 77, 69, 78, 84, 
+    128, 68, 69, 85, 78, 71, 128, 68, 69, 83, 203, 68, 69, 83, 73, 71, 78, 
+    128, 68, 69, 83, 73, 128, 68, 69, 83, 67, 82, 73, 80, 84, 73, 79, 206, 
+    68, 69, 83, 67, 69, 78, 68, 73, 78, 199, 68, 69, 83, 67, 69, 78, 68, 69, 
+    82, 128, 68, 69, 82, 69, 84, 45, 72, 73, 68, 69, 84, 128, 68, 69, 82, 69, 
+    84, 128, 68, 69, 80, 65, 82, 84, 85, 82, 69, 128, 68, 69, 80, 65, 82, 84, 
+    77, 69, 78, 212, 68, 69, 80, 65, 82, 84, 73, 78, 199, 68, 69, 78, 84, 73, 
+    83, 84, 82, 217, 68, 69, 78, 84, 65, 204, 68, 69, 78, 79, 77, 73, 78, 65, 
+    84, 79, 82, 128, 68, 69, 78, 79, 77, 73, 78, 65, 84, 79, 210, 68, 69, 78, 
+    78, 69, 78, 128, 68, 69, 78, 71, 128, 68, 69, 78, 197, 68, 69, 78, 65, 
+    82, 73, 85, 211, 68, 69, 76, 84, 65, 128, 68, 69, 76, 84, 193, 68, 69, 
+    76, 84, 128, 68, 69, 76, 80, 72, 73, 195, 68, 69, 76, 73, 86, 69, 82, 
+    217, 68, 69, 76, 73, 86, 69, 82, 65, 78, 67, 69, 128, 68, 69, 76, 73, 77, 
+    73, 84, 69, 82, 128, 68, 69, 76, 73, 77, 73, 84, 69, 210, 68, 69, 76, 73, 
+    67, 73, 79, 85, 211, 68, 69, 76, 69, 84, 69, 128, 68, 69, 76, 69, 84, 
     197, 68, 69, 75, 65, 128, 68, 69, 75, 128, 68, 69, 73, 128, 68, 69, 72, 
     73, 128, 68, 69, 71, 82, 69, 197, 68, 69, 70, 73, 78, 73, 84, 73, 79, 78, 
     128, 68, 69, 70, 69, 67, 84, 73, 86, 69, 78, 69, 83, 211, 68, 69, 69, 82, 
@@ -4547,96 +4550,96 @@
     73, 79, 206, 65, 76, 84, 69, 82, 78, 65, 84, 197, 65, 76, 84, 65, 128, 
     65, 76, 80, 72, 65, 128, 65, 76, 80, 72, 193, 65, 76, 80, 65, 80, 82, 65, 
     78, 65, 128, 65, 76, 80, 65, 80, 82, 65, 65, 78, 193, 65, 76, 80, 65, 
-    128, 65, 76, 77, 79, 83, 212, 65, 76, 76, 79, 128, 65, 76, 76, 73, 65, 
-    78, 67, 69, 128, 65, 76, 76, 201, 65, 76, 76, 65, 200, 65, 76, 75, 65, 
-    76, 73, 45, 50, 128, 65, 76, 75, 65, 76, 73, 128, 65, 76, 73, 71, 78, 69, 
-    196, 65, 76, 73, 70, 85, 128, 65, 76, 73, 69, 78, 128, 65, 76, 73, 69, 
-    206, 65, 76, 71, 73, 218, 65, 76, 70, 65, 128, 65, 76, 69, 85, 212, 65, 
-    76, 69, 82, 84, 128, 65, 76, 69, 80, 72, 128, 65, 76, 69, 77, 66, 73, 67, 
-    128, 65, 76, 69, 70, 128, 65, 76, 65, 89, 72, 69, 128, 65, 76, 65, 89, 
-    72, 197, 65, 76, 65, 82, 205, 65, 76, 65, 80, 72, 128, 65, 76, 45, 76, 
-    65, 75, 85, 78, 65, 128, 65, 75, 84, 73, 69, 83, 69, 76, 83, 75, 65, 66, 
-    128, 65, 75, 83, 65, 128, 65, 75, 72, 77, 73, 77, 73, 195, 65, 75, 66, 
-    65, 210, 65, 75, 65, 82, 65, 128, 65, 75, 65, 82, 193, 65, 73, 89, 65, 
-    78, 78, 65, 128, 65, 73, 86, 73, 76, 73, 203, 65, 73, 84, 79, 206, 65, 
-    73, 82, 80, 76, 65, 78, 69, 128, 65, 73, 78, 213, 65, 73, 78, 78, 128, 
-    65, 73, 76, 77, 128, 65, 73, 75, 65, 82, 65, 128, 65, 73, 72, 86, 85, 83, 
-    128, 65, 72, 83, 68, 65, 128, 65, 72, 83, 65, 128, 65, 72, 65, 78, 199, 
-    65, 72, 65, 71, 71, 65, 210, 65, 72, 65, 68, 128, 65, 71, 85, 78, 71, 
-    128, 65, 71, 79, 71, 201, 65, 71, 71, 82, 65, 86, 65, 84, 73, 79, 78, 
-    128, 65, 71, 71, 82, 65, 86, 65, 84, 69, 196, 65, 71, 65, 73, 78, 128, 
-    65, 70, 84, 69, 210, 65, 70, 83, 65, 65, 81, 128, 65, 70, 82, 73, 67, 65, 
-    206, 65, 70, 79, 82, 69, 77, 69, 78, 84, 73, 79, 78, 69, 68, 128, 65, 70, 
-    71, 72, 65, 78, 201, 65, 70, 70, 82, 73, 67, 65, 84, 73, 79, 206, 65, 69, 
-    89, 65, 78, 78, 65, 128, 65, 69, 89, 128, 65, 69, 83, 67, 85, 76, 65, 80, 
-    73, 85, 83, 128, 65, 69, 83, 67, 128, 65, 69, 83, 128, 65, 69, 82, 73, 
-    65, 204, 65, 69, 82, 128, 65, 69, 76, 65, 45, 80, 73, 76, 76, 65, 128, 
-    65, 69, 76, 128, 65, 69, 75, 128, 65, 69, 71, 69, 65, 206, 65, 69, 71, 
-    128, 65, 69, 69, 89, 65, 78, 78, 65, 128, 65, 69, 69, 128, 65, 69, 68, 
-    65, 45, 80, 73, 76, 76, 65, 128, 65, 69, 68, 128, 65, 69, 66, 128, 65, 
-    68, 86, 65, 78, 84, 65, 71, 69, 128, 65, 68, 86, 65, 78, 67, 69, 128, 65, 
-    68, 69, 71, 128, 65, 68, 69, 199, 65, 68, 68, 82, 69, 83, 83, 69, 196, 
-    65, 68, 68, 82, 69, 83, 211, 65, 68, 68, 65, 75, 128, 65, 68, 65, 203, 
-    65, 67, 85, 84, 69, 45, 77, 65, 67, 82, 79, 78, 128, 65, 67, 85, 84, 69, 
-    45, 71, 82, 65, 86, 69, 45, 65, 67, 85, 84, 69, 128, 65, 67, 85, 84, 197, 
-    65, 67, 84, 85, 65, 76, 76, 217, 65, 67, 84, 73, 86, 65, 84, 197, 65, 67, 
-    82, 79, 80, 72, 79, 78, 73, 195, 65, 67, 75, 78, 79, 87, 76, 69, 68, 71, 
-    69, 128, 65, 67, 67, 85, 77, 85, 76, 65, 84, 73, 79, 78, 128, 65, 67, 67, 
-    79, 85, 78, 212, 65, 67, 67, 69, 80, 84, 128, 65, 67, 67, 69, 78, 84, 45, 
-    83, 84, 65, 67, 67, 65, 84, 79, 128, 65, 67, 67, 69, 78, 84, 128, 65, 67, 
-    67, 69, 78, 212, 65, 67, 65, 68, 69, 77, 217, 65, 66, 89, 83, 77, 65, 
-    204, 65, 66, 85, 78, 68, 65, 78, 67, 69, 128, 65, 66, 75, 72, 65, 83, 73, 
-    65, 206, 65, 66, 66, 82, 69, 86, 73, 65, 84, 73, 79, 206, 65, 66, 65, 70, 
-    73, 76, 73, 128, 65, 66, 178, 65, 65, 89, 65, 78, 78, 65, 128, 65, 65, 
-    89, 128, 65, 65, 87, 128, 65, 65, 79, 128, 65, 65, 74, 128, 65, 65, 66, 
-    65, 65, 70, 73, 76, 73, 128, 65, 65, 48, 51, 50, 128, 65, 65, 48, 51, 49, 
-    128, 65, 65, 48, 51, 48, 128, 65, 65, 48, 50, 57, 128, 65, 65, 48, 50, 
-    56, 128, 65, 65, 48, 50, 55, 128, 65, 65, 48, 50, 54, 128, 65, 65, 48, 
-    50, 53, 128, 65, 65, 48, 50, 52, 128, 65, 65, 48, 50, 51, 128, 65, 65, 
-    48, 50, 50, 128, 65, 65, 48, 50, 49, 128, 65, 65, 48, 50, 48, 128, 65, 
-    65, 48, 49, 57, 128, 65, 65, 48, 49, 56, 128, 65, 65, 48, 49, 55, 128, 
-    65, 65, 48, 49, 54, 128, 65, 65, 48, 49, 53, 128, 65, 65, 48, 49, 52, 
-    128, 65, 65, 48, 49, 51, 128, 65, 65, 48, 49, 50, 128, 65, 65, 48, 49, 
-    49, 128, 65, 65, 48, 49, 48, 128, 65, 65, 48, 48, 57, 128, 65, 65, 48, 
-    48, 56, 128, 65, 65, 48, 48, 55, 66, 128, 65, 65, 48, 48, 55, 65, 128, 
-    65, 65, 48, 48, 55, 128, 65, 65, 48, 48, 54, 128, 65, 65, 48, 48, 53, 
-    128, 65, 65, 48, 48, 52, 128, 65, 65, 48, 48, 51, 128, 65, 65, 48, 48, 
-    50, 128, 65, 65, 48, 48, 49, 128, 65, 48, 55, 48, 128, 65, 48, 54, 57, 
-    128, 65, 48, 54, 56, 128, 65, 48, 54, 55, 128, 65, 48, 54, 54, 128, 65, 
-    48, 54, 53, 128, 65, 48, 54, 52, 128, 65, 48, 54, 51, 128, 65, 48, 54, 
-    50, 128, 65, 48, 54, 49, 128, 65, 48, 54, 48, 128, 65, 48, 53, 57, 128, 
-    65, 48, 53, 56, 128, 65, 48, 53, 55, 128, 65, 48, 53, 54, 128, 65, 48, 
-    53, 53, 128, 65, 48, 53, 52, 128, 65, 48, 53, 51, 128, 65, 48, 53, 50, 
-    128, 65, 48, 53, 49, 128, 65, 48, 53, 48, 128, 65, 48, 52, 57, 128, 65, 
-    48, 52, 56, 128, 65, 48, 52, 55, 128, 65, 48, 52, 54, 128, 65, 48, 52, 
-    53, 65, 128, 65, 48, 52, 53, 128, 65, 48, 52, 52, 128, 65, 48, 52, 51, 
-    65, 128, 65, 48, 52, 51, 128, 65, 48, 52, 50, 65, 128, 65, 48, 52, 50, 
-    128, 65, 48, 52, 49, 128, 65, 48, 52, 48, 65, 128, 65, 48, 52, 48, 128, 
-    65, 48, 51, 57, 128, 65, 48, 51, 56, 128, 65, 48, 51, 55, 128, 65, 48, 
-    51, 54, 128, 65, 48, 51, 53, 128, 65, 48, 51, 52, 128, 65, 48, 51, 51, 
-    128, 65, 48, 51, 50, 65, 128, 65, 48, 49, 55, 65, 128, 65, 48, 49, 52, 
-    65, 128, 65, 48, 48, 54, 66, 128, 65, 48, 48, 54, 65, 128, 65, 48, 48, 
-    53, 65, 128, 65, 45, 69, 85, 128, 45, 85, 205, 45, 80, 72, 82, 85, 128, 
-    45, 75, 72, 89, 85, 196, 45, 75, 72, 89, 73, 76, 128, 45, 68, 90, 85, 
-    196, 45, 67, 72, 65, 210, 45, 67, 72, 65, 76, 128, 
+    128, 65, 76, 77, 79, 83, 212, 65, 76, 77, 128, 65, 76, 76, 79, 128, 65, 
+    76, 76, 73, 65, 78, 67, 69, 128, 65, 76, 76, 201, 65, 76, 76, 65, 200, 
+    65, 76, 75, 65, 76, 73, 45, 50, 128, 65, 76, 75, 65, 76, 73, 128, 65, 76, 
+    73, 71, 78, 69, 196, 65, 76, 73, 70, 85, 128, 65, 76, 73, 69, 78, 128, 
+    65, 76, 73, 69, 206, 65, 76, 71, 73, 218, 65, 76, 70, 65, 128, 65, 76, 
+    69, 85, 212, 65, 76, 69, 82, 84, 128, 65, 76, 69, 80, 72, 128, 65, 76, 
+    69, 77, 66, 73, 67, 128, 65, 76, 69, 70, 128, 65, 76, 65, 89, 72, 69, 
+    128, 65, 76, 65, 89, 72, 197, 65, 76, 65, 82, 205, 65, 76, 65, 80, 72, 
+    128, 65, 76, 45, 76, 65, 75, 85, 78, 65, 128, 65, 75, 84, 73, 69, 83, 69, 
+    76, 83, 75, 65, 66, 128, 65, 75, 83, 65, 128, 65, 75, 72, 77, 73, 77, 73, 
+    195, 65, 75, 66, 65, 210, 65, 75, 65, 82, 65, 128, 65, 75, 65, 82, 193, 
+    65, 73, 89, 65, 78, 78, 65, 128, 65, 73, 86, 73, 76, 73, 203, 65, 73, 84, 
+    79, 206, 65, 73, 82, 80, 76, 65, 78, 69, 128, 65, 73, 78, 213, 65, 73, 
+    78, 78, 128, 65, 73, 76, 77, 128, 65, 73, 75, 65, 82, 65, 128, 65, 73, 
+    72, 86, 85, 83, 128, 65, 72, 83, 68, 65, 128, 65, 72, 83, 65, 128, 65, 
+    72, 65, 78, 199, 65, 72, 65, 71, 71, 65, 210, 65, 72, 65, 68, 128, 65, 
+    71, 85, 78, 71, 128, 65, 71, 79, 71, 201, 65, 71, 71, 82, 65, 86, 65, 84, 
+    73, 79, 78, 128, 65, 71, 71, 82, 65, 86, 65, 84, 69, 196, 65, 71, 65, 73, 
+    78, 128, 65, 70, 84, 69, 210, 65, 70, 83, 65, 65, 81, 128, 65, 70, 82, 
+    73, 67, 65, 206, 65, 70, 79, 82, 69, 77, 69, 78, 84, 73, 79, 78, 69, 68, 
+    128, 65, 70, 71, 72, 65, 78, 201, 65, 70, 70, 82, 73, 67, 65, 84, 73, 79, 
+    206, 65, 69, 89, 65, 78, 78, 65, 128, 65, 69, 89, 128, 65, 69, 83, 67, 
+    85, 76, 65, 80, 73, 85, 83, 128, 65, 69, 83, 67, 128, 65, 69, 83, 128, 
+    65, 69, 82, 73, 65, 204, 65, 69, 82, 128, 65, 69, 76, 65, 45, 80, 73, 76, 
+    76, 65, 128, 65, 69, 76, 128, 65, 69, 75, 128, 65, 69, 71, 69, 65, 206, 
+    65, 69, 71, 128, 65, 69, 69, 89, 65, 78, 78, 65, 128, 65, 69, 69, 128, 
+    65, 69, 68, 65, 45, 80, 73, 76, 76, 65, 128, 65, 69, 68, 128, 65, 69, 66, 
+    128, 65, 68, 86, 65, 78, 84, 65, 71, 69, 128, 65, 68, 86, 65, 78, 67, 69, 
+    128, 65, 68, 69, 71, 128, 65, 68, 69, 199, 65, 68, 68, 82, 69, 83, 83, 
+    69, 196, 65, 68, 68, 82, 69, 83, 211, 65, 68, 68, 65, 75, 128, 65, 68, 
+    65, 203, 65, 67, 85, 84, 69, 45, 77, 65, 67, 82, 79, 78, 128, 65, 67, 85, 
+    84, 69, 45, 71, 82, 65, 86, 69, 45, 65, 67, 85, 84, 69, 128, 65, 67, 85, 
+    84, 197, 65, 67, 84, 85, 65, 76, 76, 217, 65, 67, 84, 73, 86, 65, 84, 
+    197, 65, 67, 82, 79, 80, 72, 79, 78, 73, 195, 65, 67, 75, 78, 79, 87, 76, 
+    69, 68, 71, 69, 128, 65, 67, 67, 85, 77, 85, 76, 65, 84, 73, 79, 78, 128, 
+    65, 67, 67, 79, 85, 78, 212, 65, 67, 67, 69, 80, 84, 128, 65, 67, 67, 69, 
+    78, 84, 45, 83, 84, 65, 67, 67, 65, 84, 79, 128, 65, 67, 67, 69, 78, 84, 
+    128, 65, 67, 67, 69, 78, 212, 65, 67, 65, 68, 69, 77, 217, 65, 66, 89, 
+    83, 77, 65, 204, 65, 66, 85, 78, 68, 65, 78, 67, 69, 128, 65, 66, 75, 72, 
+    65, 83, 73, 65, 206, 65, 66, 66, 82, 69, 86, 73, 65, 84, 73, 79, 206, 65, 
+    66, 65, 70, 73, 76, 73, 128, 65, 66, 178, 65, 65, 89, 65, 78, 78, 65, 
+    128, 65, 65, 89, 128, 65, 65, 87, 128, 65, 65, 79, 128, 65, 65, 74, 128, 
+    65, 65, 66, 65, 65, 70, 73, 76, 73, 128, 65, 65, 48, 51, 50, 128, 65, 65, 
+    48, 51, 49, 128, 65, 65, 48, 51, 48, 128, 65, 65, 48, 50, 57, 128, 65, 
+    65, 48, 50, 56, 128, 65, 65, 48, 50, 55, 128, 65, 65, 48, 50, 54, 128, 
+    65, 65, 48, 50, 53, 128, 65, 65, 48, 50, 52, 128, 65, 65, 48, 50, 51, 
+    128, 65, 65, 48, 50, 50, 128, 65, 65, 48, 50, 49, 128, 65, 65, 48, 50, 
+    48, 128, 65, 65, 48, 49, 57, 128, 65, 65, 48, 49, 56, 128, 65, 65, 48, 
+    49, 55, 128, 65, 65, 48, 49, 54, 128, 65, 65, 48, 49, 53, 128, 65, 65, 
+    48, 49, 52, 128, 65, 65, 48, 49, 51, 128, 65, 65, 48, 49, 50, 128, 65, 
+    65, 48, 49, 49, 128, 65, 65, 48, 49, 48, 128, 65, 65, 48, 48, 57, 128, 
+    65, 65, 48, 48, 56, 128, 65, 65, 48, 48, 55, 66, 128, 65, 65, 48, 48, 55, 
+    65, 128, 65, 65, 48, 48, 55, 128, 65, 65, 48, 48, 54, 128, 65, 65, 48, 
+    48, 53, 128, 65, 65, 48, 48, 52, 128, 65, 65, 48, 48, 51, 128, 65, 65, 
+    48, 48, 50, 128, 65, 65, 48, 48, 49, 128, 65, 48, 55, 48, 128, 65, 48, 
+    54, 57, 128, 65, 48, 54, 56, 128, 65, 48, 54, 55, 128, 65, 48, 54, 54, 
+    128, 65, 48, 54, 53, 128, 65, 48, 54, 52, 128, 65, 48, 54, 51, 128, 65, 
+    48, 54, 50, 128, 65, 48, 54, 49, 128, 65, 48, 54, 48, 128, 65, 48, 53, 
+    57, 128, 65, 48, 53, 56, 128, 65, 48, 53, 55, 128, 65, 48, 53, 54, 128, 
+    65, 48, 53, 53, 128, 65, 48, 53, 52, 128, 65, 48, 53, 51, 128, 65, 48, 
+    53, 50, 128, 65, 48, 53, 49, 128, 65, 48, 53, 48, 128, 65, 48, 52, 57, 
+    128, 65, 48, 52, 56, 128, 65, 48, 52, 55, 128, 65, 48, 52, 54, 128, 65, 
+    48, 52, 53, 65, 128, 65, 48, 52, 53, 128, 65, 48, 52, 52, 128, 65, 48, 
+    52, 51, 65, 128, 65, 48, 52, 51, 128, 65, 48, 52, 50, 65, 128, 65, 48, 
+    52, 50, 128, 65, 48, 52, 49, 128, 65, 48, 52, 48, 65, 128, 65, 48, 52, 
+    48, 128, 65, 48, 51, 57, 128, 65, 48, 51, 56, 128, 65, 48, 51, 55, 128, 
+    65, 48, 51, 54, 128, 65, 48, 51, 53, 128, 65, 48, 51, 52, 128, 65, 48, 
+    51, 51, 128, 65, 48, 51, 50, 65, 128, 65, 48, 49, 55, 65, 128, 65, 48, 
+    49, 52, 65, 128, 65, 48, 48, 54, 66, 128, 65, 48, 48, 54, 65, 128, 65, 
+    48, 48, 53, 65, 128, 65, 45, 69, 85, 128, 45, 85, 205, 45, 80, 72, 82, 
+    85, 128, 45, 75, 72, 89, 85, 196, 45, 75, 72, 89, 73, 76, 128, 45, 68, 
+    90, 85, 196, 45, 67, 72, 65, 210, 45, 67, 72, 65, 76, 128, 
 };
 
 static unsigned int lexicon_offset[] = {
-    0, 0, 6, 10, 18, 23, 27, 34, 39, 41, 44, 50, 62, 70, 80, 93, 102, 108, 
+    0, 0, 6, 10, 18, 23, 27, 34, 39, 41, 47, 50, 62, 70, 80, 93, 102, 108, 
     113, 121, 130, 135, 140, 143, 147, 153, 158, 163, 171, 178, 186, 191, 
     194, 200, 208, 215, 225, 230, 237, 246, 249, 254, 257, 263, 267, 272, 
     281, 288, 295, 301, 310, 315, 321, 327, 335, 144, 341, 349, 350, 358, 
-    361, 367, 369, 375, 382, 384, 391, 395, 403, 410, 415, 417, 422, 429, 
-    431, 299, 437, 439, 444, 449, 452, 457, 463, 470, 479, 489, 494, 498, 
+    361, 367, 369, 375, 382, 384, 391, 395, 403, 410, 412, 417, 422, 427, 
+    434, 436, 299, 442, 445, 447, 452, 457, 463, 470, 479, 489, 494, 498, 
     505, 518, 522, 531, 538, 545, 548, 554, 558, 562, 572, 580, 588, 596, 
-    605, 613, 618, 619, 623, 631, 638, 648, 659, 663, 666, 670, 673, 348, 
-    678, 687, 691, 697, 703, 705, 708, 711, 714, 718, 722, 731, 739, 744, 
+    605, 613, 618, 619, 623, 631, 638, 648, 652, 663, 667, 670, 673, 678, 
+    348, 682, 691, 697, 703, 705, 708, 711, 714, 718, 722, 731, 739, 744, 
     747, 751, 757, 764, 771, 776, 785, 794, 801, 805, 818, 827, 835, 841, 
     557, 850, 860, 867, 873, 879, 886, 894, 898, 749, 906, 915, 503, 923, 
     928, 934, 17, 943, 948, 951, 955, 959, 966, 969, 976, 980, 988, 992, 
-    1000, 1004, 1007, 1014, 1021, 192, 1024, 1029, 1039, 1048, 1055, 1061, 
-    1069, 1072, 1077, 1083, 1091, 1097, 1102, 1105, 1108, 111, 1113, 1117, 
-    1123, 1129, 1132, 1138, 1142, 1147, 1153, 1158, 1168, 1172, 1175, 1178, 
+    1000, 1004, 1007, 1014, 1021, 192, 1024, 1029, 1039, 1048, 1055, 1060, 
+    1066, 1072, 1080, 1083, 1088, 1094, 1102, 1107, 1110, 1113, 111, 1118, 
+    1122, 1128, 1134, 1137, 1143, 1147, 1152, 1158, 1168, 1172, 1175, 1178, 
     1187, 1191, 1194, 1199, 1204, 1210, 1215, 1220, 1225, 1229, 1234, 1240, 
     1245, 1250, 1254, 1260, 1265, 1270, 1275, 1279, 1284, 1289, 1294, 1300, 
     1306, 1312, 1317, 1321, 1326, 1331, 1336, 1340, 1345, 1350, 1355, 1360, 
@@ -4650,7 +4653,7 @@
     1665, 1670, 1675, 1679, 1682, 1687, 1692, 1697, 1702, 1708, 1713, 1717, 
     1322, 1720, 1725, 1730, 1327, 1734, 1738, 1745, 1332, 1752, 1337, 1756, 
     1758, 1763, 1769, 1341, 1774, 1783, 1346, 1788, 1794, 1351, 1799, 1804, 
-    1807, 1812, 1816, 1820, 1824, 1827, 1831, 1356, 1361, 1156, 1836, 1842, 
+    1807, 1812, 1816, 1820, 1824, 1827, 1831, 1356, 1361, 1058, 1836, 1842, 
     1848, 1854, 1860, 1866, 1872, 1878, 1884, 1889, 1895, 1901, 1907, 1913, 
     1919, 1925, 1931, 1937, 1943, 1948, 1953, 1958, 1963, 1968, 1973, 1978, 
     1983, 1988, 1993, 1999, 2004, 2010, 2015, 2021, 2027, 2032, 2038, 2044, 
@@ -4677,7 +4680,7 @@
     3241, 3245, 3248, 3261, 3265, 3269, 3273, 3277, 3281, 3284, 3288, 3292, 
     3297, 3301, 3306, 3311, 3316, 3320, 3323, 3326, 3332, 3336, 3340, 3343, 
     3347, 3351, 3354, 3360, 3365, 3370, 3376, 3381, 3386, 3392, 3398, 3403, 
-    3408, 3413, 1115, 547, 3418, 3421, 3426, 3430, 3433, 3437, 3442, 3447, 
+    3408, 3413, 1120, 547, 3418, 3421, 3426, 3430, 3433, 3437, 3442, 3447, 
     3451, 3456, 3460, 3465, 3469, 3473, 3479, 3485, 3488, 3491, 3497, 3504, 
     3511, 3517, 3524, 3529, 3533, 3540, 3547, 3552, 3556, 3566, 3570, 3574, 
     3579, 3584, 3594, 2107, 3599, 3603, 3606, 3612, 3617, 3623, 3629, 3634, 
@@ -4726,7 +4729,7 @@
     6683, 6698, 6713, 6728, 6743, 6758, 6773, 6788, 6803, 6818, 6833, 6848, 
     6863, 6878, 6893, 6908, 6923, 6938, 6953, 6968, 6983, 6998, 7013, 7028, 
     7037, 7046, 7051, 7057, 7067, 7071, 7076, 7081, 7089, 7093, 7096, 7100, 
-    2975, 7103, 7108, 298, 442, 7114, 7122, 7126, 7130, 7133, 7137, 7143, 
+    2975, 7103, 7108, 298, 425, 7114, 7122, 7126, 7130, 7133, 7137, 7143, 
     7147, 7155, 7161, 7166, 7173, 7180, 7186, 7191, 7198, 7204, 7212, 7216, 
     7221, 7233, 7244, 7251, 7255, 7259, 7265, 3233, 7269, 7275, 7280, 7285, 
     7290, 7296, 7301, 7306, 7311, 7316, 7322, 7327, 7332, 7338, 7343, 7349, 
@@ -4755,7252 +4758,7250 @@
     8645, 8649, 8653, 8658, 8665, 8676, 8684, 8694, 8700, 8707, 8712, 8716, 
     8727, 8740, 8751, 8764, 8775, 8787, 8799, 8811, 8824, 8837, 8844, 8850, 
     8864, 8871, 8877, 8881, 8886, 8890, 8897, 8905, 8909, 8915, 8919, 8925, 
-    8935, 8939, 8944, 8949, 8956, 8962, 8972, 7909, 8978, 8982, 8989, 768, 
-    8993, 8997, 9002, 9007, 9012, 9016, 9022, 9030, 9036, 9040, 9046, 9056, 
-    9060, 9066, 9071, 9075, 9081, 9087, 2161, 9092, 9094, 9099, 9107, 9116, 
-    9120, 9126, 9131, 9136, 9141, 9146, 9152, 9157, 9162, 4006, 9167, 9172, 
-    9176, 9182, 9187, 9193, 9198, 9203, 9209, 9214, 9121, 9220, 9224, 9231, 
-    9237, 9242, 9246, 6183, 9251, 9260, 9265, 9270, 8218, 8225, 9275, 2853, 
-    9279, 9284, 9289, 9132, 9293, 9298, 9137, 9142, 9303, 9310, 9317, 9323, 
-    9329, 9335, 9340, 9345, 9350, 9147, 9153, 9356, 9362, 9367, 9375, 9158, 
-    9380, 990, 9383, 9391, 9397, 9403, 9412, 9420, 9425, 9431, 9439, 9446, 
-    9461, 9478, 9497, 9506, 9514, 9529, 9540, 9550, 9560, 9568, 9574, 9586, 
-    9595, 9603, 9610, 9617, 9623, 9628, 9636, 9646, 9653, 9663, 9673, 9683, 
-    9691, 9698, 9707, 9717, 9731, 9746, 9755, 9763, 9768, 9772, 9781, 9787, 
-    9792, 9802, 9812, 9822, 9827, 9831, 9840, 9845, 9855, 9866, 9879, 9887, 
-    9900, 9912, 9920, 9925, 9929, 9935, 9940, 9948, 9956, 9963, 9968, 9976, 
-    9982, 9985, 9989, 9995, 10003, 10008, 10012, 10020, 10029, 10037, 10043, 
-    10047, 10054, 10065, 10069, 10072, 10078, 9163, 10083, 10089, 10096, 
-    10102, 10107, 10114, 10121, 10128, 10135, 10142, 10149, 10156, 10163, 
-    10168, 9474, 10173, 10179, 10186, 10193, 10198, 10205, 10214, 10218, 
-    10230, 8256, 10234, 10237, 10241, 10245, 10249, 10253, 10259, 10265, 
-    10270, 10276, 10281, 10286, 10292, 10297, 10302, 8952, 10307, 10311, 
-    10315, 10319, 10324, 10329, 10337, 10343, 10347, 10351, 10358, 10363, 
-    10371, 10376, 10380, 10383, 10389, 10396, 10400, 10403, 10408, 10412, 
-    4045, 10418, 10427, 36, 10435, 10441, 10446, 8967, 10451, 10456, 10460, 
-    10463, 10478, 10497, 10509, 10522, 10535, 10548, 10562, 10575, 10590, 
-    10597, 9168, 10603, 10617, 10622, 10628, 10633, 10641, 10646, 8040, 
-    10651, 10654, 10661, 10666, 10670, 2858, 998, 10676, 10680, 10686, 10692, 
-    10697, 10703, 10708, 9177, 10714, 10720, 10725, 10730, 10738, 10744, 
-    10757, 10765, 10772, 9183, 10778, 10786, 10794, 10801, 10814, 10826, 
-    10836, 10844, 10851, 10858, 10867, 10876, 10884, 10891, 10896, 10902, 
-    9188, 10907, 10913, 9194, 10918, 10921, 10928, 10934, 10947, 8669, 10958, 
-    10964, 10973, 10981, 10988, 10994, 11000, 11005, 11009, 11014, 10470, 
-    11020, 9199, 11027, 11032, 11039, 11045, 11051, 11056, 11064, 11072, 
-    11079, 11083, 11097, 11107, 11112, 11116, 11127, 11133, 11138, 11143, 
-    9204, 9210, 11147, 11150, 11155, 11167, 11174, 11179, 11183, 11188, 
-    11192, 11199, 11205, 9215, 9122, 11212, 2863, 8, 11219, 11224, 11228, 
-    11234, 11242, 11252, 11257, 11262, 11269, 11276, 11280, 11291, 11301, 
-    11310, 11322, 11327, 11331, 11339, 11353, 11357, 11360, 11368, 11375, 
-    11383, 11387, 11398, 11402, 11409, 11414, 11418, 11424, 11429, 11433, 
-    11439, 11444, 11455, 11459, 11462, 11468, 11473, 11479, 11485, 11492, 
-    11503, 11513, 11523, 11532, 11539, 11548, 9225, 9232, 9238, 9243, 11554, 
-    11560, 9247, 11566, 11569, 11576, 11581, 11596, 11612, 11627, 11635, 
-    11641, 11646, 838, 420, 11651, 11659, 11666, 11672, 11677, 11682, 9252, 
-    11684, 11688, 11693, 11697, 11707, 11712, 11716, 11725, 11729, 11732, 
-    9261, 11739, 11742, 11750, 11757, 11765, 11769, 11776, 11785, 11788, 
-    11792, 11796, 11802, 11806, 11810, 11814, 11820, 11830, 11834, 11842, 
-    11846, 11853, 11857, 11862, 11866, 11873, 11879, 11887, 11893, 11898, 
-    11908, 11913, 11918, 11922, 11930, 3905, 11938, 11943, 9266, 11947, 
-    11951, 11954, 11962, 11969, 11973, 5991, 11977, 11982, 11986, 11997, 
-    12007, 12012, 12018, 12022, 12025, 12033, 12038, 12043, 12050, 12055, 
-    9271, 12060, 12064, 12071, 1722, 6145, 12076, 12081, 12086, 12091, 12097, 
-    12102, 12108, 12113, 12118, 12123, 12128, 12133, 12138, 12143, 12148, 
-    12153, 12158, 12163, 12168, 12173, 12178, 12183, 12188, 12194, 12199, 
-    12204, 12209, 12214, 12219, 12225, 12230, 12235, 12241, 12246, 12252, 
-    12257, 12263, 12268, 12273, 12278, 12283, 12289, 12294, 12299, 12304, 
-    737, 139, 12312, 12316, 12321, 12326, 12330, 12334, 12338, 12343, 12347, 
-    12352, 12356, 12359, 12363, 12367, 12373, 12378, 12388, 12394, 12402, 
-    12406, 12410, 12417, 12425, 12434, 12445, 12452, 12459, 12463, 12472, 
-    12481, 12489, 12498, 12507, 12516, 12525, 12535, 12545, 12555, 12565, 
-    12575, 12584, 12594, 12604, 12614, 12624, 12634, 12644, 12654, 12663, 
-    12673, 12683, 12693, 12703, 12713, 12723, 12732, 12742, 12752, 12762, 
-    12772, 12782, 12792, 12802, 12812, 12822, 12831, 12841, 12851, 12861, 
-    12871, 12881, 12891, 12901, 12911, 12921, 12931, 12940, 1256, 12946, 
-    12949, 12953, 12958, 12965, 12971, 12976, 12980, 12985, 12994, 13002, 
-    13007, 13011, 13015, 13021, 13026, 13032, 9280, 13037, 13042, 13051, 
-    9285, 13056, 13059, 13065, 13073, 9290, 13080, 13084, 13088, 13092, 
-    13102, 13108, 13114, 13119, 13128, 13136, 13143, 13150, 13155, 13162, 
-    13167, 13171, 13174, 13185, 13195, 13204, 13212, 13223, 13235, 13245, 
-    13250, 13254, 13259, 13264, 13268, 13274, 13282, 13289, 13300, 13305, 
-    13315, 13319, 13322, 13329, 13339, 13348, 13355, 13359, 13366, 13372, 
-    13377, 13382, 13386, 13395, 13400, 13406, 13410, 13415, 13419, 13428, 
-    13436, 13444, 13451, 13459, 13471, 13482, 13492, 13499, 13505, 13514, 
-    13525, 13534, 13546, 13558, 13570, 13580, 13589, 13598, 13606, 13613, 
-    13622, 13630, 13634, 13640, 13646, 13651, 7753, 13655, 13657, 13661, 
-    13666, 13672, 13681, 13685, 13693, 13700, 13709, 13718, 13727, 13736, 
-    13745, 13754, 13763, 13772, 13782, 13792, 13801, 13807, 13814, 13821, 
-    13827, 13841, 13848, 13856, 13865, 13871, 13880, 13889, 13900, 13910, 
-    13918, 13925, 13933, 13942, 13955, 13963, 13970, 13983, 13989, 13995, 
-    14005, 14014, 14023, 14028, 14032, 14038, 14044, 14051, 8966, 14056, 
-    14061, 14068, 14073, 12369, 14078, 14086, 14092, 14097, 14105, 14113, 
-    14120, 14128, 14134, 14142, 14150, 14156, 14161, 14167, 14174, 14180, 
-    14185, 14189, 14200, 14208, 14214, 14219, 14228, 14234, 14239, 14248, 
-    14262, 3853, 14266, 14271, 14276, 14282, 14287, 14292, 14296, 14301, 
-    14306, 14311, 7752, 14316, 14321, 14326, 14331, 14336, 14340, 14345, 
-    14350, 14355, 14360, 14366, 14372, 14377, 14381, 14386, 14391, 14396, 
-    9294, 14401, 14406, 14411, 14416, 14421, 14438, 14456, 14468, 14481, 
-    14498, 14514, 14531, 14541, 14560, 14571, 14582, 14593, 14604, 14616, 
-    14627, 14638, 14655, 14666, 14677, 14682, 9299, 14687, 14691, 2381, 
-    14695, 14698, 14704, 14712, 14720, 14725, 14733, 14741, 14748, 14753, 
-    14759, 14766, 14774, 14781, 14793, 14801, 14806, 11590, 14812, 14821, 
-    14830, 14838, 14845, 14851, 14859, 14866, 14872, 14879, 14885, 14894, 
-    14902, 14912, 14919, 14925, 14933, 14939, 14947, 14954, 14967, 14974, 
-    14983, 14992, 15001, 15009, 15019, 15026, 15031, 3560, 15038, 15043, 
-    1372, 15047, 14317, 15051, 15057, 15061, 15069, 15081, 15086, 15093, 
-    15099, 15104, 15111, 14322, 15115, 15119, 15123, 14327, 15127, 14332, 
-    15131, 15138, 15143, 15147, 15154, 15158, 15166, 15173, 15177, 15184, 
-    15201, 15210, 15214, 15217, 15225, 15231, 15236, 3638, 15240, 15242, 
-    15250, 15257, 15267, 15279, 15284, 15290, 15295, 15299, 15305, 15310, 
-    15316, 15319, 15326, 15334, 15341, 15347, 15353, 15358, 15365, 15371, 
-    15376, 15383, 15387, 15393, 15397, 15404, 15410, 15416, 15424, 15430, 
-    15435, 15441, 15449, 15457, 15463, 15469, 15474, 15481, 15486, 15490, 
-    15496, 15501, 15508, 15513, 15519, 15522, 15528, 15534, 15537, 15541, 
-    15553, 15559, 15564, 15571, 15577, 15583, 15594, 15604, 15613, 15621, 
-    15628, 15639, 15649, 15659, 15667, 15670, 14346, 15675, 15680, 14351, 
-    14486, 15688, 15701, 15716, 15727, 14503, 15745, 15758, 15771, 15782, 
-    10485, 15793, 15806, 15825, 15836, 15847, 15858, 2649, 15871, 15875, 
-    15883, 15898, 15913, 15924, 15931, 15937, 15945, 15949, 15955, 15958, 
-    15968, 15976, 15983, 15991, 16001, 16006, 16013, 16018, 16025, 16036, 
-    16046, 16052, 16057, 16062, 14356, 16066, 16072, 16078, 16083, 16088, 
-    16093, 16097, 14361, 14367, 16101, 14373, 16106, 16114, 16123, 16130, 
-    9143, 16134, 16136, 16141, 16146, 16152, 16157, 16162, 16167, 16172, 
-    16176, 16182, 16188, 16193, 16199, 16204, 16209, 16215, 16220, 16225, 
-    16230, 16235, 16241, 16246, 16251, 16257, 16263, 16268, 16273, 16280, 
-    16286, 16297, 16304, 16309, 16313, 16317, 16320, 16328, 16333, 16340, 
-    16347, 16353, 16358, 16363, 16370, 16380, 16385, 16392, 16398, 16408, 
-    16418, 16432, 16446, 16460, 16474, 16489, 16504, 16521, 16539, 16552, 
-    16558, 16563, 16568, 16572, 16577, 16585, 16591, 16596, 16601, 16605, 
-    16610, 16614, 16619, 16623, 16634, 16640, 16645, 16650, 16657, 16662, 
-    16666, 16671, 16676, 16682, 16689, 16695, 16700, 16704, 16710, 16715, 
-    16720, 16724, 16730, 16735, 16740, 16747, 16752, 13104, 16756, 16761, 
-    16765, 16770, 16776, 16782, 16789, 16799, 16807, 16814, 16819, 16823, 
-    16832, 16840, 16847, 16854, 16860, 16866, 16871, 16876, 16882, 16887, 
-    16893, 16898, 16904, 16910, 16917, 16923, 16928, 16933, 9341, 16942, 
-    16945, 16951, 16956, 16961, 16971, 16978, 16984, 16989, 16994, 17000, 
-    17005, 17011, 17016, 17022, 17028, 17033, 17041, 17048, 17053, 17058, 
-    17064, 17069, 17073, 17082, 17093, 17100, 17105, 17113, 17119, 17126, 
-    17132, 17137, 17141, 17147, 17152, 17157, 17162, 1440, 7777, 2877, 17166, 
-    17170, 17174, 17178, 17182, 17186, 17189, 17196, 17204, 14387, 17211, 
-    17221, 17229, 17236, 17244, 17254, 17263, 17276, 17281, 17286, 17294, 
-    17301, 13200, 13209, 17308, 17318, 17333, 17339, 17346, 17353, 17359, 
-    17367, 17377, 17387, 14392, 17396, 17402, 17408, 17416, 17424, 17429, 
-    17438, 17446, 17458, 17468, 17478, 17488, 17497, 17509, 17519, 17529, 
-    17540, 17545, 17557, 17569, 17581, 17593, 17605, 17617, 17629, 17641, 
-    17653, 17665, 17676, 17688, 17700, 17712, 17724, 17736, 17748, 17760, 
-    17772, 17784, 17796, 17807, 17819, 17831, 17843, 17855, 17867, 17879, 
-    17891, 17903, 17915, 17927, 17938, 17950, 17962, 17974, 17986, 17998, 
-    18010, 18022, 18034, 18046, 18058, 18069, 18081, 18093, 18105, 18117, 
-    18129, 18141, 18153, 18165, 18177, 18189, 18200, 18212, 18224, 18236, 
-    18248, 18260, 18272, 18284, 18296, 18308, 18320, 18331, 18343, 18355, 
-    18367, 18379, 18391, 18403, 18415, 18427, 18439, 18451, 18462, 18474, 
-    18486, 18498, 18510, 18523, 18536, 18549, 18562, 18575, 18588, 18601, 
-    18613, 18626, 18639, 18652, 18665, 18678, 18691, 18704, 18717, 18730, 
-    18743, 18755, 18768, 18781, 18794, 18807, 18820, 18833, 18846, 18859, 
-    18872, 18885, 18897, 18910, 18923, 18936, 18949, 18962, 18975, 18988, 
-    19001, 19014, 19027, 19039, 19052, 19065, 19078, 19091, 19104, 19117, 
-    19130, 19143, 19156, 19169, 19181, 19194, 19207, 19220, 19233, 19246, 
-    19259, 19272, 19285, 19298, 19311, 19323, 19334, 19347, 19360, 19373, 
-    19386, 19399, 19412, 19425, 19438, 19451, 19464, 19476, 19489, 19502, 
-    19515, 19528, 19541, 19554, 19567, 19580, 19593, 19606, 19618, 19631, 
-    19644, 19657, 19670, 19683, 19696, 19709, 19722, 19735, 19748, 19760, 
-    19773, 19786, 19799, 19812, 19825, 19838, 19851, 19864, 19877, 19890, 
-    19902, 19915, 19928, 19941, 19954, 19967, 19980, 19993, 20006, 20019, 
-    20032, 20044, 20057, 20070, 20083, 20096, 20109, 20122, 20135, 20148, 
-    20161, 20174, 20186, 20199, 20212, 20225, 20238, 20251, 20264, 20277, 
-    20290, 20303, 20316, 20328, 20341, 20354, 20367, 20380, 20393, 20406, 
-    20419, 20432, 20445, 20458, 20470, 20483, 20496, 20509, 20522, 20535, 
-    20548, 20561, 20574, 20587, 20600, 20612, 20625, 20638, 20651, 20664, 
-    20677, 20690, 20703, 20716, 20729, 20742, 20754, 20765, 20773, 20781, 
-    20788, 20794, 20798, 20804, 20810, 20818, 20824, 20829, 20833, 20842, 
-    9148, 20853, 20860, 20868, 20875, 20882, 10941, 20889, 20898, 20903, 
-    20908, 7805, 20915, 20920, 20923, 20928, 20936, 20943, 20950, 20957, 
-    20963, 20972, 20981, 20987, 20996, 21000, 21006, 21011, 21021, 21028, 
-    21034, 21042, 21048, 21055, 21065, 21074, 21078, 21085, 21089, 21094, 
-    21100, 21108, 21112, 21122, 14402, 21131, 21137, 21141, 21150, 14407, 
-    21156, 21163, 21174, 21182, 21191, 21199, 8931, 21207, 21212, 21218, 
-    21223, 21227, 21231, 21235, 9632, 21240, 21248, 21255, 21264, 21271, 
-    21278, 10871, 21285, 21291, 21295, 21301, 21308, 21314, 21322, 21328, 
-    21335, 21341, 21347, 21356, 21360, 21368, 21377, 21384, 21389, 21393, 
-    21404, 21409, 21414, 21419, 21432, 7995, 21436, 21442, 21450, 21454, 
-    21461, 21470, 21475, 14678, 21483, 21487, 21499, 21504, 21508, 21511, 
-    21517, 21523, 21528, 21532, 21535, 21546, 21551, 9376, 21558, 21563, 
-    9381, 21568, 21573, 21578, 21583, 21588, 21593, 21598, 21603, 21608, 
-    21613, 21618, 21623, 21629, 21634, 21639, 21644, 21649, 21654, 21659, 
-    21664, 21669, 21674, 21680, 21686, 21691, 21696, 21701, 21706, 21711, 
-    21716, 21721, 21726, 21731, 21737, 21742, 21747, 21752, 21758, 21764, 
-    21769, 21774, 21779, 21784, 21789, 21794, 21799, 21804, 21810, 21815, 
-    21820, 21825, 21830, 21836, 21841, 21846, 21850, 1368, 129, 21858, 21862, 
-    21866, 21870, 21875, 21879, 13110, 12469, 21883, 21888, 21892, 21897, 
-    21901, 21906, 21910, 21916, 21921, 21925, 21929, 21937, 21941, 21945, 
-    21950, 21955, 21959, 21965, 21970, 21974, 21979, 21984, 21988, 21995, 
-    22002, 22009, 22013, 22017, 22022, 22026, 22029, 22035, 22048, 22053, 
-    22062, 22067, 9421, 22072, 22075, 2712, 2717, 22079, 22085, 22091, 7209, 
-    22096, 22101, 22106, 22112, 22117, 13896, 22122, 22127, 22132, 22137, 
-    22143, 22148, 22153, 22159, 22164, 22168, 22173, 22178, 22183, 22188, 
-    22192, 22197, 22201, 22206, 22211, 22216, 22221, 22225, 22230, 22234, 
-    22239, 22244, 22249, 22254, 2886, 22169, 22258, 22266, 22273, 9726, 
-    22285, 22293, 22174, 22300, 22305, 22313, 22179, 22318, 22323, 22331, 
-    22336, 22184, 22341, 22346, 22350, 22356, 22364, 22367, 22374, 22378, 
-    22382, 22388, 22395, 22400, 8958, 1727, 1732, 22404, 22410, 22416, 22421, 
-    22425, 22429, 22433, 22437, 22441, 22445, 22449, 22452, 22458, 22465, 
-    22473, 22479, 22485, 22490, 22495, 22499, 13816, 13823, 22504, 22516, 
-    22519, 22526, 16349, 22533, 22541, 22552, 22561, 22574, 22584, 22598, 
-    22610, 22624, 22636, 22646, 22658, 22664, 22679, 22703, 22721, 22740, 
-    22753, 22767, 22785, 22801, 22818, 22836, 22847, 22866, 22883, 22903, 
-    22921, 22933, 22947, 22961, 22973, 22990, 23009, 23027, 23039, 23057, 
-    23076, 14546, 23089, 23109, 23121, 10516, 23133, 23138, 23143, 23148, 
-    23154, 23159, 23163, 23170, 2398, 23174, 23180, 23184, 23187, 23191, 
-    23199, 23205, 22202, 23209, 23218, 23229, 23235, 23241, 23250, 23258, 
-    23265, 23270, 23274, 23281, 23287, 23296, 23304, 23311, 23321, 23330, 
-    23340, 23345, 23354, 23363, 23374, 23385, 3963, 23395, 23399, 23409, 
-    23417, 23427, 23438, 23443, 23453, 23461, 23468, 23474, 23481, 23486, 
-    22212, 23490, 23499, 23503, 23506, 23511, 23518, 23527, 23535, 23543, 
-    23553, 23562, 23568, 23574, 22217, 22222, 23578, 23588, 23598, 23608, 
-    23616, 23623, 23633, 23641, 23649, 23655, 23663, 930, 23672, 14737, 542, 
-    23686, 23695, 23703, 23714, 23725, 23735, 23744, 23756, 23765, 23774, 
-    23780, 23789, 23798, 23808, 23816, 23824, 9353, 23830, 23833, 23837, 
-    23842, 23847, 9841, 22235, 22240, 23855, 23861, 23867, 23872, 23877, 
-    23881, 23889, 23895, 23901, 23905, 3525, 23913, 23918, 23923, 23927, 
-    23931, 9921, 23938, 23946, 23960, 23967, 23973, 9930, 9936, 23981, 23989, 
-    23996, 24001, 24006, 22245, 24012, 24023, 24027, 24032, 2601, 24037, 
-    24048, 24054, 24059, 24063, 24067, 24070, 24077, 24084, 24091, 24097, 
-    24101, 22250, 24106, 24110, 24114, 1037, 24119, 24124, 24129, 24134, 
-    24139, 24144, 24149, 24154, 24159, 24164, 24169, 24174, 24179, 24184, 
-    24190, 24195, 24200, 24205, 24210, 24215, 24220, 24226, 24231, 24236, 
-    24241, 24246, 24251, 24256, 24261, 24267, 24273, 24278, 24284, 24289, 
-    24294, 5, 24300, 24304, 24308, 24312, 24317, 24321, 24325, 24329, 24333, 
-    24338, 24342, 24347, 24351, 24354, 24358, 24363, 24367, 24372, 24376, 
-    24380, 24384, 24389, 24393, 24397, 24407, 24412, 24416, 24420, 24425, 
-    24430, 24439, 24444, 24449, 24453, 24457, 24470, 24482, 24491, 24500, 
-    24506, 24511, 24515, 24519, 24529, 24538, 24546, 24552, 24557, 24561, 
-    24568, 24578, 24587, 24595, 24603, 24610, 24618, 24627, 24636, 24644, 
-    24649, 24653, 24657, 24660, 24662, 24666, 24670, 24675, 24680, 24684, 
-    24688, 24691, 24695, 24698, 24702, 24705, 24708, 24712, 24718, 24722, 
-    24726, 24730, 24735, 24740, 24745, 24749, 24752, 24757, 24763, 24768, 
-    24774, 24779, 24783, 24787, 24791, 24796, 24800, 24805, 24809, 24813, 
-    24820, 24824, 24827, 24831, 24837, 24843, 24847, 24851, 24856, 24863, 
-    24869, 24873, 24882, 24886, 24890, 24893, 24899, 24904, 24910, 1489, 
-    1791, 24915, 24920, 24925, 24930, 24935, 24940, 24945, 2148, 2194, 24950, 
-    24953, 24957, 24961, 24966, 24970, 24974, 24977, 24982, 24987, 24991, 
-    24994, 24999, 25003, 25008, 25012, 14749, 25017, 25020, 25023, 25027, 
-    25032, 25036, 25049, 25053, 25056, 25064, 25073, 25080, 25085, 25091, 
-    25097, 25105, 25112, 25119, 25123, 25127, 25131, 25136, 25141, 25145, 
-    25153, 25158, 25170, 25181, 25186, 25190, 25194, 25200, 25205, 25210, 
-    25214, 25218, 25221, 25227, 7915, 2316, 25231, 25236, 25252, 9468, 25272, 
-    25281, 25297, 25301, 25304, 25310, 25320, 25326, 25335, 25350, 25362, 
-    25373, 25381, 25390, 25396, 25405, 25415, 25426, 25437, 25446, 25453, 
-    25462, 25470, 25477, 25485, 25492, 25499, 25512, 25519, 25525, 25530, 
-    25539, 25545, 25550, 25558, 25565, 23419, 25577, 25589, 25603, 25611, 
-    25618, 25630, 25639, 25648, 25656, 25664, 25672, 25679, 25688, 25696, 
-    25706, 25715, 25725, 25734, 25743, 25751, 25756, 25760, 25763, 25767, 
-    25771, 25775, 25779, 25783, 25789, 25795, 25803, 14794, 25810, 25815, 
-    25822, 25828, 25835, 14802, 25842, 25845, 25857, 25865, 25871, 25876, 
-    25880, 9871, 25891, 25901, 25910, 25917, 25921, 14807, 25924, 25931, 
-    25935, 25941, 25944, 25951, 25957, 25964, 25970, 25974, 25979, 25983, 
-    25992, 25999, 26005, 7956, 26012, 26020, 26027, 26033, 26038, 26044, 
-    26050, 26058, 26062, 26065, 26067, 25768, 26076, 26082, 26092, 26097, 
-    26104, 26110, 26115, 26120, 26125, 26129, 26134, 26141, 26150, 26154, 
-    26161, 26170, 26176, 26181, 26187, 26192, 26199, 26210, 26215, 26219, 
-    26229, 26235, 26239, 26244, 26254, 26263, 26267, 26274, 26282, 26289, 
-    26295, 26300, 26308, 26315, 26327, 26336, 26340, 13046, 26348, 26358, 
-    26362, 25060, 26373, 26378, 26382, 26389, 26396, 21961, 25693, 26401, 
-    26405, 26408, 22853, 26413, 26427, 26443, 26461, 26480, 26497, 26515, 
-    22872, 26532, 26552, 22889, 26564, 26576, 15732, 26588, 22909, 26602, 
-    26614, 10529, 26628, 26633, 26638, 26643, 26649, 26655, 26661, 26665, 
-    26672, 26677, 26687, 26693, 10176, 26699, 26701, 26706, 26714, 26718, 
-    26137, 26724, 26731, 11517, 11527, 26738, 26748, 26753, 26757, 26760, 
-    26766, 26774, 26786, 26796, 26812, 26825, 26839, 15750, 26853, 26860, 
-    26864, 26867, 26872, 26876, 26883, 26890, 26900, 26905, 26910, 26915, 
-    26923, 26931, 26940, 26945, 9565, 26949, 26952, 26955, 26960, 26967, 
-    26972, 26988, 26996, 27004, 9416, 27012, 27017, 27021, 27027, 27033, 
-    27036, 27042, 27054, 27062, 27069, 27075, 27082, 27093, 27107, 27120, 
-    27129, 27138, 27150, 27161, 27171, 27180, 27189, 27197, 27208, 7938, 
-    27215, 27221, 27226, 27232, 27239, 27249, 27259, 27268, 27274, 27281, 
-    27286, 27293, 27301, 27309, 27321, 6246, 27328, 27337, 27345, 27351, 
-    27357, 27362, 27366, 27369, 27375, 27382, 27387, 27392, 27396, 27408, 
-    27419, 27428, 27436, 14934, 27441, 27447, 27453, 11510, 8635, 27458, 
-    27462, 27465, 27468, 27474, 27482, 27490, 27494, 27498, 27503, 27506, 
-    27515, 27519, 27527, 27538, 27542, 27548, 27554, 27558, 27564, 27572, 
-    27594, 27618, 27625, 27632, 27638, 27646, 27652, 27657, 27668, 27686, 
-    27693, 27701, 27705, 27714, 27727, 27735, 27747, 27758, 27768, 27782, 
-    27791, 27799, 27811, 9485, 27822, 27833, 27845, 27855, 27864, 27869, 
-    27873, 27881, 27891, 27896, 27900, 27903, 27906, 27914, 27922, 27931, 
-    27941, 27950, 27956, 27970, 2663, 27992, 28003, 28012, 28022, 28034, 
-    28043, 28052, 28062, 28070, 28078, 28087, 28092, 28103, 28108, 28119, 
-    28123, 28133, 28142, 28150, 28160, 28170, 28178, 28187, 28194, 28202, 
-    28209, 28218, 28222, 28230, 28237, 28245, 28252, 28263, 28278, 28285, 
-    28291, 28301, 28310, 28316, 28320, 28327, 28331, 14018, 28337, 28341, 
-    28346, 28353, 28357, 28361, 28369, 28377, 28383, 28392, 28399, 28404, 
-    28409, 28419, 23488, 28423, 28426, 28431, 28436, 28441, 28446, 28451, 
-    28456, 28461, 28466, 28472, 28477, 28482, 28488, 1218, 704, 28493, 28502, 
-    2364, 28509, 28514, 28518, 28524, 1267, 546, 318, 28529, 28538, 28546, 
-    28555, 28563, 28574, 28583, 28591, 28595, 28598, 28606, 28614, 28619, 
-    14762, 28625, 28631, 28637, 5872, 28642, 28646, 28652, 28656, 28663, 
-    1455, 28669, 28676, 9572, 28680, 28690, 28698, 28704, 28713, 28721, 
-    28727, 28735, 28742, 11103, 28748, 28755, 28760, 28767, 1496, 2147, 
-    28773, 28779, 28786, 28797, 28808, 28816, 28823, 28833, 28842, 28850, 
-    28859, 28866, 28873, 28886, 28897, 1272, 28916, 28921, 28929, 3575, 
-    28933, 28938, 28942, 1459, 24689, 28952, 28956, 28961, 28965, 3493, 
-    28971, 28979, 28986, 28997, 29005, 29013, 3576, 279, 29018, 29026, 29034, 
-    29041, 29047, 29052, 2216, 29059, 29065, 25975, 26205, 29071, 106, 29075, 
-    29079, 29085, 615, 9321, 29090, 29097, 29103, 2327, 29107, 29111, 15174, 
-    29114, 29119, 29126, 29132, 29137, 29145, 29152, 29158, 22338, 29162, 
-    29166, 3646, 16612, 29170, 29175, 29178, 29186, 29194, 29199, 29202, 
-    29209, 29219, 29231, 29236, 29240, 29248, 29255, 29261, 29268, 29275, 
-    29278, 29282, 29286, 1463, 29296, 29298, 29303, 29309, 29315, 29320, 
-    29325, 29330, 29335, 29340, 29345, 29350, 29355, 29360, 29365, 29370, 
-    29375, 29380, 29385, 29391, 29397, 29403, 29409, 29414, 29419, 29424, 
-    29430, 29435, 29440, 29445, 29451, 29456, 29462, 29467, 29472, 29477, 
-    29482, 29488, 29493, 29499, 29504, 29509, 29514, 29519, 29525, 29530, 
-    29536, 29541, 29546, 29551, 29556, 29561, 29566, 29571, 29576, 29581, 
-    29587, 29593, 29599, 29604, 29609, 29614, 29619, 29625, 29631, 29637, 
-    29643, 29649, 29655, 29660, 29666, 29671, 29676, 29681, 29686, 29692, 
-    2443, 29697, 2450, 2457, 2754, 29702, 2463, 2473, 29708, 29712, 29717, 
-    29722, 29728, 29733, 29738, 29742, 29747, 29753, 29758, 29763, 29768, 
-    29774, 29779, 29783, 29787, 29792, 29797, 29802, 29807, 29812, 29818, 
-    29824, 29829, 29833, 29838, 29844, 29848, 29853, 29858, 29863, 29868, 
-    29872, 29875, 29880, 29885, 29890, 29895, 29900, 29906, 29912, 29917, 
-    29922, 29926, 29931, 29936, 29941, 29946, 29951, 29955, 29960, 29965, 
-    29970, 29974, 29978, 29982, 29987, 29995, 30000, 30006, 30012, 30018, 
-    30023, 30027, 30030, 30035, 30040, 30044, 30049, 30053, 30058, 30062, 
-    30065, 30070, 17289, 30075, 30080, 30085, 30093, 21267, 28673, 9019, 
-    30098, 30103, 30107, 30112, 30116, 30120, 30125, 30129, 30132, 30135, 
-    30139, 30144, 30148, 30156, 30160, 30163, 30168, 30172, 30176, 30181, 
-    30186, 30190, 30196, 30201, 30206, 30213, 30220, 30224, 30227, 30233, 
-    30242, 30249, 30257, 30264, 30268, 30273, 30277, 30281, 30287, 30293, 
-    30297, 30303, 30308, 30313, 30320, 30326, 30332, 30338, 30344, 30351, 
-    30357, 30363, 30369, 30375, 30381, 30387, 30393, 30400, 30406, 30413, 
-    30419, 30425, 30431, 30437, 30443, 30449, 30455, 30461, 30467, 11411, 
-    30473, 30478, 30483, 30486, 30494, 30499, 30508, 30514, 30519, 30524, 
-    30529, 30533, 30538, 30543, 30548, 30553, 30558, 30565, 30572, 30578, 
-    30584, 30589, 16290, 30596, 30602, 30609, 30615, 30621, 30626, 30634, 
-    30639, 16069, 30643, 30648, 30653, 30659, 30664, 30669, 30673, 30678, 
-    30683, 30689, 30694, 30699, 30703, 30708, 30713, 30717, 30722, 30727, 
-    30732, 30736, 30741, 30746, 30751, 30755, 30759, 15280, 30763, 30772, 
-    30778, 30784, 30793, 30801, 30810, 30818, 30823, 30827, 30834, 30840, 
-    30844, 30847, 30852, 30861, 30869, 30874, 1495, 30880, 30883, 30887, 
-    22411, 22417, 30893, 30897, 30908, 30919, 30930, 30942, 30949, 30956, 
-    30961, 30965, 5909, 755, 21266, 30973, 30978, 30982, 30987, 30991, 30997, 
-    31002, 31008, 31013, 31019, 31024, 31030, 31035, 31041, 31047, 31053, 
-    31058, 31014, 31020, 31062, 31067, 31073, 31078, 31084, 31089, 31095, 
-    31100, 31025, 10414, 31104, 31036, 31042, 31048, 2831, 3423, 31110, 
-    31113, 31119, 31125, 31131, 31138, 31144, 31150, 31156, 31162, 31168, 
-    31174, 31180, 31186, 31192, 31198, 31204, 31210, 31217, 31223, 31229, 
-    31235, 31241, 31247, 31250, 31255, 31258, 31265, 31273, 31278, 31283, 
-    31289, 31294, 31299, 31303, 31308, 31314, 31319, 31325, 31330, 31336, 
-    31341, 31347, 31353, 31357, 31362, 31367, 31372, 31377, 31381, 31386, 
-    31391, 31396, 31402, 31408, 31414, 31420, 31425, 31429, 31432, 31438, 
-    31444, 31453, 31461, 31468, 31473, 31477, 31481, 31486, 15133, 31491, 
-    31499, 31505, 3683, 1377, 31510, 31514, 8005, 31520, 31526, 31533, 8014, 
-    31537, 31543, 31550, 31556, 31565, 31573, 31585, 31589, 31596, 31602, 
-    31606, 31609, 31618, 31626, 31015, 31631, 31641, 31651, 31661, 31667, 
-    31672, 31682, 31687, 31700, 31714, 31725, 31737, 31749, 31763, 31776, 
-    31788, 31800, 14587, 31814, 31819, 31824, 31828, 31832, 31836, 1780, 
-    27159, 31840, 31845, 31063, 31850, 31853, 31858, 31863, 31868, 31874, 
-    31880, 10091, 31885, 31892, 15684, 31898, 31903, 31908, 31912, 31917, 
-    31922, 31068, 31927, 31932, 31937, 31943, 31074, 31948, 31951, 31958, 
-    31966, 31972, 31978, 31984, 31995, 32000, 32007, 32014, 32021, 32029, 
-    32038, 32047, 32053, 32059, 32067, 31079, 32072, 32078, 32084, 31085, 
-    32089, 32094, 32102, 32110, 32116, 32123, 32129, 32136, 32143, 32149, 
-    32157, 32167, 32174, 32179, 32185, 32190, 32195, 32202, 32211, 32219, 
-    32224, 32230, 32237, 32245, 32251, 32256, 32262, 32271, 27936, 32278, 
-    32282, 32287, 32296, 32301, 32306, 32311, 12398, 32319, 32324, 32329, 
-    32334, 32338, 32343, 32348, 32355, 32360, 32365, 32370, 31090, 21203, 
-    32376, 2519, 244, 32379, 32382, 32386, 32390, 32400, 32408, 32412, 32419, 
-    32426, 32430, 32433, 32439, 32447, 32455, 32459, 32463, 32466, 32473, 
-    32477, 32481, 32488, 32496, 31026, 32503, 32511, 10151, 660, 308, 32523, 
-    32528, 32533, 32539, 32544, 32549, 3704, 32554, 32557, 32562, 32567, 
-    32572, 32577, 32582, 32589, 22512, 32594, 32599, 32604, 32609, 32614, 
-    32620, 32625, 32631, 31261, 32637, 32642, 32648, 32654, 32664, 32669, 
-    32674, 32678, 32683, 32688, 32693, 32698, 32711, 32716, 22289, 16692, 
-    3710, 32720, 32725, 32730, 32736, 32741, 32746, 32750, 32755, 32760, 
-    32766, 32771, 32776, 1382, 32780, 32785, 32790, 32795, 32799, 32804, 
-    32809, 32814, 32820, 32826, 32831, 32835, 32839, 32844, 32849, 32854, 
-    32858, 32866, 32870, 32876, 32880, 32887, 16485, 31037, 32893, 32900, 
-    32908, 32915, 32921, 32934, 32946, 32952, 32956, 2773, 32960, 32964, 
-    32468, 32973, 32984, 32989, 32994, 32999, 33003, 33008, 22422, 33012, 
-    33016, 33021, 31043, 21287, 33025, 33030, 33036, 33041, 33045, 33049, 
-    33052, 33056, 33062, 33073, 33085, 31049, 33090, 33093, 33097, 347, 
-    33102, 33107, 33112, 33117, 33122, 33127, 33133, 33138, 33143, 33149, 
-    33154, 33160, 33165, 33171, 33176, 33181, 33186, 33191, 33196, 33201, 
-    33206, 33211, 33217, 33222, 33227, 33232, 33237, 33242, 33247, 33252, 
-    33258, 33264, 33269, 33274, 33279, 33284, 33289, 33294, 33299, 33304, 
-    33309, 33314, 33319, 33324, 33329, 33334, 33339, 33344, 33349, 33354, 
-    33360, 313, 26, 33365, 33369, 33373, 33381, 33385, 33389, 33392, 33395, 
-    33397, 33402, 33406, 33411, 33415, 33420, 33424, 33429, 33433, 33436, 
-    33438, 33442, 33447, 33451, 33462, 33465, 33467, 33471, 33483, 33492, 
-    33496, 33500, 33506, 33511, 33520, 33526, 33531, 33536, 33540, 33545, 
-    33552, 33557, 33563, 33568, 33572, 33579, 25701, 25711, 33583, 33588, 
-    33593, 33598, 33605, 33609, 33616, 8113, 33622, 33631, 33639, 33654, 
-    33668, 33676, 33687, 33696, 33701, 7227, 33711, 33716, 33721, 33725, 
-    33728, 33732, 33737, 33741, 33748, 33753, 33758, 8912, 33768, 33770, 
-    33773, 33777, 33783, 33787, 33792, 33797, 33803, 33808, 33814, 33819, 
-    33829, 33838, 33846, 33851, 33857, 33862, 33869, 33873, 33881, 33888, 
-    33901, 33909, 33913, 33923, 33928, 33932, 33940, 33948, 33952, 33961, 
-    33967, 33972, 33980, 33990, 33999, 34008, 34017, 34028, 34036, 34047, 
-    34056, 34063, 34069, 34074, 34085, 34090, 34094, 34097, 34101, 34109, 
-    34115, 34123, 34130, 34136, 34141, 34147, 2418, 34151, 34153, 34158, 
-    34163, 34168, 34171, 34173, 34177, 34180, 34187, 34191, 9884, 34195, 
-    34201, 34211, 34216, 34222, 34226, 34231, 34244, 26087, 34250, 34259, 
-    17462, 34266, 34275, 31647, 34283, 34288, 34292, 34300, 34307, 34312, 
-    34316, 34321, 34325, 34333, 34339, 34345, 34350, 34354, 34357, 34362, 
-    34375, 34391, 22979, 34408, 34420, 34437, 34449, 34463, 22996, 23015, 
-    34475, 34487, 2680, 34501, 34506, 34511, 34516, 34520, 34527, 34539, 
-    34545, 34548, 34559, 34570, 34575, 32064, 695, 34579, 34583, 34587, 
-    34590, 34595, 34600, 34606, 34611, 34616, 34622, 34628, 34633, 34637, 
-    34642, 34647, 34652, 34656, 34659, 34665, 34670, 34675, 34680, 34684, 
-    34689, 34695, 34703, 26320, 34708, 34713, 34720, 34726, 34732, 34737, 
-    34745, 22521, 34752, 34757, 34762, 34767, 34771, 34774, 34779, 34783, 
-    34787, 34794, 34800, 34806, 34812, 34819, 34824, 34830, 33943, 34834, 
-    34838, 34843, 34856, 34861, 34867, 34875, 34882, 34890, 34900, 34906, 
-    34912, 34918, 34922, 34931, 34939, 34946, 34951, 34956, 10437, 34961, 
-    34969, 34976, 34982, 34992, 34997, 35003, 35011, 3608, 35018, 35025, 
-    3614, 35029, 35034, 35045, 35052, 35058, 35067, 35071, 4015, 35074, 
-    35081, 35087, 35093, 35101, 35111, 29042, 35118, 35126, 35131, 35137, 
-    35142, 25947, 35148, 35155, 35161, 35170, 23660, 35177, 35182, 35186, 
-    35194, 35202, 9600, 5895, 35209, 35213, 35215, 35219, 35224, 35226, 
-    35232, 35237, 35242, 35249, 32585, 35255, 35260, 35264, 35269, 35273, 
-    35282, 35286, 35292, 35299, 35305, 35312, 35317, 35326, 35331, 35335, 
-    35340, 35347, 35355, 35363, 35368, 21343, 35372, 35375, 35379, 35383, 
-    35387, 35390, 35392, 35400, 35404, 35411, 35415, 35419, 35427, 35434, 
-    35444, 35448, 35452, 35460, 35468, 35474, 35479, 35488, 13350, 35494, 
-    35503, 35508, 35515, 35523, 35531, 35539, 35546, 35553, 35560, 35567, 
-    35574, 35579, 35585, 35602, 35610, 35620, 35628, 35635, 407, 35639, 
-    35645, 35649, 35654, 33692, 35660, 35663, 35667, 35675, 3619, 35683, 
-    35689, 35695, 35704, 35714, 35721, 35727, 3625, 3631, 35736, 35743, 
-    35751, 35756, 35760, 35767, 35775, 35782, 35788, 35797, 35807, 35813, 
-    35821, 35830, 35837, 35845, 35852, 22019, 35856, 35863, 35869, 35879, 
-    35888, 35899, 35903, 35913, 35919, 35926, 35934, 35943, 35952, 35962, 
-    35973, 35980, 35985, 35992, 3029, 36000, 36006, 36011, 36017, 36023, 
-    36028, 36041, 36054, 36067, 36074, 36080, 36088, 36096, 36101, 36105, 
-    1469, 36109, 36114, 36119, 36124, 36129, 36135, 36140, 36145, 36150, 
-    36155, 36160, 36165, 36170, 36176, 36182, 36187, 36192, 36198, 36203, 
-    36208, 36213, 36219, 36224, 36229, 36234, 36239, 36245, 36250, 36255, 
-    36261, 36266, 36271, 36276, 36281, 36286, 36292, 36297, 36303, 36308, 
-    36314, 36319, 36324, 36329, 36335, 36341, 36347, 36353, 36359, 36365, 
-    36371, 36377, 36382, 36387, 36393, 36398, 36403, 36408, 36413, 36418, 
-    36423, 36428, 36434, 36439, 36444, 36450, 36456, 101, 36461, 36463, 
-    36467, 36471, 36475, 36480, 36484, 9521, 36488, 36494, 1741, 6280, 36500, 
-    36503, 36508, 36512, 36517, 36521, 36525, 36530, 10238, 36534, 36538, 
-    36542, 36546, 15372, 36551, 36555, 36560, 36565, 36570, 36574, 36581, 
-    26111, 36587, 36590, 36594, 36599, 36605, 36609, 36617, 36623, 36628, 
-    36632, 36638, 36642, 36646, 3462, 3467, 29234, 36649, 36653, 36657, 
-    36661, 36669, 36676, 36680, 36687, 36692, 317, 36697, 36701, 36707, 
-    36719, 36725, 36731, 36735, 36741, 36750, 36754, 36758, 36763, 36769, 
-    36774, 36778, 36783, 36787, 36791, 36798, 36804, 36809, 36824, 36839, 
-    36854, 36870, 36888, 10188, 36902, 36909, 36913, 36916, 36925, 36930, 
-    36934, 36942, 33894, 36950, 36954, 36964, 36975, 29204, 36988, 36992, 
-    37001, 37009, 9778, 14900, 37013, 22434, 37016, 30152, 37021, 9777, 
-    37026, 37032, 37037, 37043, 37048, 37054, 37059, 37065, 37070, 37076, 
-    37082, 37088, 37093, 37049, 37055, 37060, 37066, 37071, 37077, 37083, 
-    8126, 3874, 37097, 37105, 37109, 37112, 37116, 37121, 37126, 37132, 
-    37138, 37143, 37147, 25959, 37151, 37155, 37161, 37165, 9042, 37174, 
-    37181, 37185, 11868, 37192, 37198, 37203, 37210, 37217, 37224, 28550, 
-    8049, 37231, 37238, 37245, 37251, 37256, 37263, 37274, 37280, 37285, 
-    37290, 37295, 37302, 37050, 37306, 37316, 37327, 37333, 37338, 37343, 
-    37348, 37353, 37358, 37362, 37366, 37372, 37380, 2319, 865, 10254, 10266, 
-    10271, 10277, 37389, 10282, 10287, 10293, 37394, 37404, 37408, 10298, 
-    37413, 16890, 37416, 37421, 37425, 37430, 37435, 37442, 37449, 37453, 
-    37456, 37464, 10201, 37471, 37474, 37480, 37490, 5929, 37499, 37503, 
-    37511, 37515, 37525, 37531, 37542, 37548, 37554, 37559, 37565, 37571, 
-    37577, 37582, 37585, 37592, 37598, 37603, 37610, 37617, 37621, 37631, 
-    37644, 37653, 37662, 37673, 37686, 37697, 37706, 37717, 37722, 37731, 
-    37736, 10303, 37742, 37749, 37757, 37762, 37766, 37773, 37780, 3829, 16, 
-    37784, 37789, 16744, 37793, 37796, 37799, 28056, 37803, 28559, 37811, 
-    37815, 37819, 37822, 37828, 37072, 37834, 37842, 37848, 37855, 28039, 
-    37859, 28233, 37863, 37872, 37878, 37884, 37889, 37893, 37899, 37903, 
-    37911, 37919, 26177, 37925, 37932, 37938, 37943, 37948, 37952, 37958, 
-    37963, 37969, 4056, 791, 37976, 37980, 37983, 15262, 37995, 35826, 38006, 
-    38009, 38016, 38020, 38026, 38030, 38036, 38041, 38047, 38052, 38057, 
-    38061, 38065, 38070, 38075, 38085, 38091, 38104, 38110, 38116, 38123, 
-    38128, 38134, 38139, 16630, 1472, 1019, 31193, 31199, 38144, 31205, 
-    31218, 31224, 31230, 38150, 31236, 31242, 38156, 38162, 22, 38170, 38177, 
-    38181, 38185, 38193, 31953, 38197, 38201, 38208, 38213, 38217, 38222, 
-    38228, 38233, 38239, 38244, 38248, 38252, 38256, 38261, 38265, 38270, 
-    38274, 38281, 38286, 38290, 38295, 38299, 38304, 38308, 38313, 38319, 
-    15482, 15487, 38324, 38328, 38331, 38335, 21170, 38340, 38344, 38350, 
-    38357, 38362, 38372, 38377, 38385, 38389, 38392, 31968, 38396, 4109, 
-    38401, 38406, 38410, 38415, 38419, 38424, 13368, 38435, 38439, 38442, 
-    38447, 38451, 38455, 38458, 38462, 8145, 13384, 38465, 38468, 38474, 
-    38479, 38485, 38490, 38496, 38501, 38507, 38512, 38518, 38524, 38530, 
-    38535, 38539, 38543, 38552, 38568, 38584, 38594, 27946, 38601, 38605, 
-    38610, 38615, 38619, 38623, 35947, 38629, 38634, 38638, 38645, 38650, 
-    38654, 38658, 26979, 38664, 21438, 38669, 38676, 38684, 38690, 38697, 
-    38705, 38711, 38715, 38721, 38729, 38733, 38742, 9502, 38750, 38754, 
-    38762, 38769, 38774, 38779, 38783, 38786, 38790, 38793, 38797, 38804, 
-    38809, 38815, 26398, 31256, 38819, 38826, 38832, 38838, 38843, 38846, 
-    38848, 38855, 38862, 38868, 38872, 38875, 38879, 38883, 38887, 38892, 
-    38896, 38900, 38903, 38907, 38921, 23045, 38940, 38953, 38966, 38979, 
-    23063, 38994, 10490, 39009, 39015, 39019, 39023, 39030, 39035, 39039, 
-    39046, 39052, 39057, 39063, 39073, 39085, 39096, 39101, 39108, 39112, 
-    39116, 39119, 15878, 3677, 39127, 15509, 39140, 39147, 39151, 39155, 
-    39160, 39165, 39171, 39175, 39179, 39182, 7742, 15520, 39187, 39191, 
-    39197, 39206, 39211, 39218, 35803, 39224, 39229, 39233, 39238, 39245, 
-    39249, 39252, 39256, 39261, 14552, 39268, 39275, 1066, 39279, 39284, 
-    39289, 39295, 39300, 39305, 39309, 39319, 39324, 39330, 39335, 39341, 
-    39346, 39352, 39362, 39367, 39372, 39376, 7229, 7241, 39381, 39384, 
-    39391, 39397, 34059, 34066, 39406, 39410, 32016, 39418, 39429, 39437, 
-    35995, 39444, 39449, 39454, 39465, 39472, 39483, 32040, 21444, 39491, 
-    735, 39496, 39502, 28030, 39508, 39513, 39523, 39532, 39539, 39545, 
-    39549, 39552, 39559, 39565, 39572, 39578, 39588, 39596, 39602, 39608, 
-    39613, 39617, 39624, 39630, 39637, 38888, 535, 13805, 39643, 39648, 
-    39651, 39657, 39665, 1396, 39670, 39674, 39679, 39686, 39692, 39696, 
-    39700, 39705, 39714, 39721, 39731, 39737, 28074, 39754, 39763, 39771, 
-    39777, 39782, 39789, 39795, 39803, 39812, 39820, 39824, 39829, 39837, 
-    32049, 39843, 39862, 15811, 39876, 39892, 39906, 39912, 39917, 39922, 
-    39927, 39933, 32055, 39938, 39945, 39950, 39954, 345, 2936, 39961, 39966, 
-    39971, 27305, 39792, 39975, 39980, 39988, 39992, 39995, 40001, 40007, 
-    40011, 28129, 40014, 40019, 40023, 40026, 40031, 40035, 40040, 40045, 
-    40049, 40054, 40058, 40062, 21166, 21177, 40066, 40071, 40077, 26936, 
-    40082, 40086, 21253, 16059, 40089, 40094, 40099, 40104, 40109, 40114, 
-    40119, 40124, 447, 43, 31274, 31279, 31284, 31290, 31295, 31300, 40129, 
-    31304, 40133, 40137, 40141, 31309, 31315, 40155, 31326, 31331, 40163, 
-    40168, 31337, 40173, 40178, 40183, 40188, 40194, 40200, 40206, 31354, 
-    40219, 40225, 31358, 40229, 31363, 40234, 31368, 31373, 40237, 40242, 
-    40246, 30923, 40252, 13592, 40259, 40264, 31378, 40268, 40273, 40278, 
-    40283, 40287, 40292, 40297, 40303, 40308, 40313, 40319, 40325, 40330, 
-    40334, 40339, 40344, 40349, 40353, 40358, 40363, 40368, 40374, 40380, 
-    40386, 40391, 40395, 40400, 40404, 31382, 31387, 31392, 40408, 40412, 
-    40416, 31397, 31403, 31409, 31421, 40428, 25996, 40432, 40436, 40441, 
-    40446, 40451, 40456, 40460, 40464, 40474, 40479, 40484, 40488, 40492, 
-    40495, 40503, 31469, 40508, 1479, 40514, 40522, 40531, 40535, 40539, 
-    40547, 40553, 40561, 40577, 40581, 40585, 40590, 40605, 31506, 1749, 
-    12048, 40609, 1378, 40621, 40622, 40630, 40637, 40642, 40649, 40654, 
-    9372, 1114, 10325, 40661, 40666, 40669, 40672, 40681, 1286, 40686, 39036, 
-    40693, 40698, 22486, 2557, 40702, 10734, 40712, 40718, 2337, 2347, 40727, 
-    40736, 40746, 40757, 3293, 34212, 10377, 3807, 16668, 1291, 40762, 40770, 
-    40777, 40782, 40786, 40790, 23858, 10404, 40798, 40807, 40816, 40824, 
-    40831, 40842, 40847, 40860, 40873, 40885, 40897, 40909, 40922, 40933, 
-    40944, 40954, 40962, 40970, 40982, 40994, 41005, 41014, 41022, 41029, 
-    41041, 41048, 41057, 41064, 41077, 41082, 41092, 41097, 41103, 41108, 
-    37182, 41112, 41119, 41123, 41130, 41138, 2518, 41145, 41156, 41166, 
-    41175, 41183, 41193, 41201, 41211, 41220, 41225, 41231, 41237, 3709, 
-    41248, 41258, 41267, 41276, 41286, 41294, 41303, 41308, 41313, 41318, 
-    1705, 37, 41326, 41334, 41345, 41356, 16343, 41366, 41370, 41377, 41383, 
-    41388, 41392, 41403, 41413, 41422, 41433, 16717, 16722, 41438, 41447, 
-    41452, 41462, 41467, 41475, 41483, 41490, 41496, 7078, 228, 41500, 41506, 
-    41511, 41514, 2117, 39152, 41522, 41526, 41529, 1512, 41535, 13967, 1296, 
-    41540, 41553, 41567, 2643, 41585, 41597, 41609, 2657, 2674, 41623, 41636, 
-    2689, 41650, 41662, 2704, 41676, 1302, 1308, 1314, 10652, 41681, 41686, 
-    41691, 41695, 41710, 41725, 41740, 41755, 41770, 41785, 41800, 41815, 
-    41830, 41845, 41860, 41875, 41890, 41905, 41920, 41935, 41950, 41965, 
-    41980, 41995, 42010, 42025, 42040, 42055, 42070, 42085, 42100, 42115, 
-    42130, 42145, 42160, 42175, 42190, 42205, 42220, 42235, 42250, 42265, 
-    42280, 42295, 42310, 42325, 42340, 42355, 42370, 42385, 42400, 42415, 
-    42430, 42445, 42460, 42475, 42490, 42505, 42520, 42535, 42550, 42565, 
-    42580, 42595, 42610, 42625, 42640, 42655, 42670, 42685, 42700, 42715, 
-    42730, 42745, 42760, 42775, 42790, 42805, 42820, 42835, 42850, 42865, 
-    42880, 42895, 42910, 42925, 42940, 42955, 42970, 42985, 43000, 43015, 
-    43030, 43045, 43060, 43075, 43090, 43105, 43120, 43135, 43150, 43165, 
-    43180, 43195, 43210, 43225, 43240, 43255, 43270, 43285, 43300, 43315, 
-    43330, 43345, 43360, 43375, 43390, 43405, 43420, 43435, 43450, 43465, 
-    43480, 43495, 43510, 43525, 43540, 43555, 43570, 43585, 43600, 43615, 
-    43630, 43645, 43660, 43675, 43690, 43705, 43720, 43735, 43750, 43765, 
-    43780, 43795, 43810, 43825, 43840, 43855, 43870, 43885, 43900, 43915, 
-    43930, 43945, 43960, 43975, 43990, 44005, 44020, 44035, 44050, 44065, 
-    44080, 44095, 44110, 44125, 44140, 44155, 44170, 44185, 44200, 44215, 
-    44230, 44245, 44260, 44275, 44290, 44305, 44320, 44335, 44350, 44365, 
-    44380, 44395, 44410, 44425, 44440, 44455, 44470, 44485, 44500, 44515, 
-    44530, 44545, 44560, 44575, 44590, 44605, 44620, 44635, 44650, 44665, 
-    44680, 44695, 44710, 44725, 44740, 44755, 44770, 44785, 44800, 44815, 
-    44830, 44845, 44860, 44875, 44890, 44905, 44920, 44935, 44950, 44965, 
-    44980, 44995, 45010, 45025, 45040, 45055, 45070, 45085, 45100, 45115, 
-    45130, 45145, 45160, 45175, 45190, 45205, 45220, 45235, 45250, 45265, 
-    45280, 45295, 45310, 45325, 45340, 45355, 45370, 45385, 45400, 45415, 
-    45430, 45445, 45460, 45475, 45490, 45505, 45520, 45535, 45550, 45565, 
-    45580, 45595, 45610, 45625, 45640, 45655, 45670, 45685, 45700, 45715, 
-    45730, 45745, 45760, 45775, 45790, 45805, 45820, 45835, 45850, 45865, 
-    45880, 45895, 45910, 45925, 45940, 45955, 45970, 45985, 46000, 46015, 
-    46030, 46045, 46060, 46075, 46090, 46105, 46120, 46135, 46150, 46165, 
-    46180, 46195, 46210, 46225, 46240, 46255, 46270, 46285, 46300, 46315, 
-    46330, 46345, 46360, 46375, 46390, 46405, 46420, 46435, 46450, 46465, 
-    46480, 46495, 46510, 46525, 46540, 46555, 46570, 46585, 46600, 46615, 
-    46630, 46645, 46660, 46675, 46690, 46705, 46720, 46735, 46750, 46765, 
-    46780, 46795, 46810, 46825, 46840, 46855, 46870, 46885, 46900, 46915, 
-    46930, 46945, 46960, 46975, 46990, 47005, 47020, 47035, 47050, 47065, 
-    47080, 47095, 47110, 47125, 47140, 47155, 47170, 47185, 47200, 47215, 
-    47230, 47245, 47260, 47275, 47290, 47305, 47320, 47335, 47350, 47365, 
-    47380, 47395, 47410, 47425, 47440, 47455, 47470, 47485, 47500, 47515, 
-    47530, 47545, 47560, 47575, 47590, 47605, 47620, 47635, 47650, 47665, 
-    47680, 47695, 47710, 47725, 47740, 47755, 47770, 47785, 47800, 47815, 
-    47830, 47845, 47860, 47875, 47890, 47905, 47920, 47935, 47950, 47965, 
-    47980, 47995, 48010, 48025, 48040, 48055, 48070, 48085, 48100, 48115, 
-    48130, 48145, 48160, 48175, 48190, 48205, 48220, 48235, 48250, 48265, 
-    48280, 48295, 48310, 48325, 48340, 48355, 48370, 48385, 48400, 48415, 
-    48430, 48445, 48460, 48475, 48490, 48505, 48520, 48535, 48550, 48565, 
-    48580, 48595, 48610, 48625, 48640, 48655, 48670, 48685, 48700, 48715, 
-    48730, 48745, 48760, 48775, 48790, 48805, 48820, 48835, 48850, 48865, 
-    48880, 48895, 48910, 48925, 48940, 48955, 48970, 48985, 49000, 49015, 
-    49030, 49045, 49060, 49075, 49090, 49105, 49120, 49135, 49150, 49165, 
-    49180, 49195, 49210, 49225, 49240, 49255, 49270, 49285, 49300, 49315, 
-    49330, 49345, 49360, 49375, 49390, 49405, 49420, 49435, 49450, 49465, 
-    49480, 49495, 49511, 49527, 49543, 49559, 49575, 49591, 49607, 49623, 
-    49639, 49655, 49671, 49687, 49703, 49719, 49735, 49751, 49767, 49783, 
-    49799, 49815, 49831, 49847, 49863, 49879, 49895, 49911, 49927, 49943, 
-    49959, 49975, 49991, 50007, 50023, 50039, 50055, 50071, 50087, 50103, 
-    50119, 50135, 50151, 50167, 50183, 50199, 50215, 50231, 50247, 50263, 
-    50279, 50295, 50311, 50327, 50343, 50359, 50375, 50391, 50407, 50423, 
-    50439, 50455, 50471, 50487, 50503, 50519, 50535, 50551, 50567, 50583, 
-    50599, 50615, 50631, 50647, 50663, 50679, 50695, 50711, 50727, 50743, 
-    50759, 50775, 50791, 50807, 50823, 50839, 50855, 50871, 50887, 50903, 
-    50919, 50935, 50951, 50967, 50983, 50999, 51015, 51031, 51047, 51063, 
-    51079, 51095, 51111, 51127, 51143, 51159, 51175, 51191, 51207, 51223, 
-    51239, 51255, 51271, 51287, 51303, 51319, 51335, 51351, 51367, 51383, 
-    51399, 51415, 51431, 51447, 51463, 51479, 51495, 51511, 51527, 51543, 
-    51559, 51575, 51591, 51607, 51623, 51639, 51655, 51671, 51687, 51703, 
-    51719, 51735, 51751, 51767, 51783, 51799, 51815, 51831, 51847, 51863, 
-    51879, 51895, 51911, 51927, 51943, 51959, 51975, 51991, 52007, 52023, 
-    52039, 52055, 52071, 52087, 52103, 52119, 52135, 52151, 52167, 52183, 
-    52199, 52215, 52231, 52247, 52263, 52279, 52295, 52311, 52327, 52343, 
-    52359, 52375, 52391, 52407, 52423, 52439, 52455, 52471, 52487, 52503, 
-    52519, 52535, 52551, 52567, 52583, 52599, 52615, 52631, 52647, 52663, 
-    52679, 52695, 52711, 52727, 52743, 52759, 52775, 52791, 52807, 52823, 
-    52839, 52855, 52871, 52887, 52903, 52919, 52935, 52951, 52967, 52983, 
-    52999, 53015, 53031, 53047, 53063, 53079, 53095, 53111, 53127, 53143, 
-    53159, 53175, 53191, 53207, 53223, 53239, 53255, 53271, 53287, 53303, 
-    53319, 53335, 53351, 53367, 53383, 53399, 53415, 53431, 53447, 53463, 
-    53479, 53495, 53511, 53527, 53543, 53559, 53575, 53591, 53607, 53623, 
-    53639, 53655, 53671, 53687, 53703, 53719, 53735, 53751, 53767, 53783, 
-    53799, 53815, 53831, 53847, 53863, 53879, 53895, 53911, 53927, 53943, 
-    53959, 53975, 53991, 54007, 54023, 54039, 54055, 54071, 54087, 54103, 
-    54119, 54135, 54151, 54167, 54183, 54199, 54215, 54231, 54247, 54263, 
-    54279, 54295, 54311, 54327, 54343, 54359, 54375, 54391, 54407, 54423, 
-    54439, 54455, 54471, 54487, 54503, 54519, 54535, 54551, 54567, 54583, 
-    54599, 54615, 54631, 54647, 54663, 54679, 54695, 54711, 54727, 54743, 
-    54759, 54775, 54791, 54807, 54823, 54839, 54855, 54871, 54887, 54903, 
-    54919, 54935, 54951, 54967, 54983, 54999, 55015, 55031, 55047, 55063, 
-    55079, 55095, 55111, 55127, 55143, 55159, 55175, 55191, 55207, 55223, 
-    55239, 55255, 55271, 55287, 55303, 55319, 55335, 55351, 55367, 55383, 
-    55399, 55415, 55431, 55447, 55463, 55479, 55495, 55511, 55527, 55543, 
-    55559, 55575, 55591, 55607, 55623, 55639, 55655, 55671, 55687, 55703, 
-    55719, 55735, 55751, 55767, 55783, 55799, 55815, 55831, 55847, 55863, 
-    55879, 55895, 55911, 55927, 55943, 55959, 55975, 55991, 56007, 56023, 
-    56039, 56055, 56071, 56087, 56103, 56119, 56135, 56151, 56167, 56183, 
-    56199, 56215, 56231, 56247, 56263, 56279, 56295, 56311, 56327, 56343, 
-    56359, 56375, 56391, 56407, 56423, 56439, 56455, 56471, 56487, 56503, 
-    56519, 56535, 56551, 56567, 56583, 56599, 56615, 56631, 56647, 56663, 
-    56679, 56695, 56711, 56727, 56743, 56759, 56775, 56791, 56807, 56823, 
-    56839, 56855, 56871, 56887, 56903, 56919, 56935, 56951, 56967, 56983, 
-    56999, 57015, 57031, 57047, 57063, 57079, 57095, 57111, 57127, 57143, 
-    57159, 57175, 57191, 57207, 57223, 57239, 57255, 57271, 57287, 57303, 
-    57319, 57335, 57351, 57367, 57383, 57399, 57415, 57431, 57447, 57463, 
-    57479, 57495, 57511, 57527, 57543, 57559, 57575, 57591, 57607, 57623, 
-    57639, 57655, 57671, 57687, 57703, 57719, 57735, 57751, 57767, 57783, 
-    57799, 57815, 57831, 57847, 57863, 57879, 57895, 57911, 57927, 57943, 
-    57959, 57975, 57991, 58007, 58023, 58039, 58055, 58071, 58087, 58103, 
-    58119, 58135, 58151, 58167, 58182, 16749, 58191, 58197, 58203, 58213, 
-    58221, 14881, 15432, 9953, 58234, 1520, 58242, 3761, 27415, 7183, 58248, 
-    58253, 58258, 58263, 58268, 58274, 58279, 58285, 58290, 58296, 58301, 
-    58306, 58311, 58316, 58322, 58327, 58332, 58337, 58342, 58347, 58352, 
-    58357, 58363, 58368, 58374, 58381, 2561, 58386, 58392, 8526, 58396, 
-    58401, 58408, 58416, 40, 58420, 58426, 58431, 58436, 58440, 58445, 58449, 
-    58453, 10677, 58457, 58467, 58480, 58491, 58504, 58511, 58517, 58522, 
-    58528, 58534, 58540, 58545, 58550, 58555, 58560, 58564, 58569, 58574, 
-    58579, 58585, 58591, 58597, 58602, 58606, 58611, 58616, 58620, 58625, 
-    58630, 58635, 58639, 10693, 10704, 10709, 1563, 58643, 1568, 58649, 
-    16226, 58652, 58658, 1599, 58664, 1605, 1611, 10739, 58669, 58677, 58684, 
-    58688, 58694, 58699, 30952, 58704, 58711, 58716, 58720, 58724, 1616, 
-    16318, 58733, 58737, 16329, 1120, 58741, 58748, 58753, 58757, 16354, 
-    1620, 37321, 58760, 58765, 58775, 58784, 58789, 58793, 58799, 1625, 
-    39230, 58804, 58813, 58819, 58824, 10897, 10903, 58830, 58842, 58859, 
-    58876, 58893, 58910, 58927, 58944, 58961, 58978, 58995, 59012, 59029, 
-    59046, 59063, 59080, 59097, 59114, 59131, 59148, 59165, 59182, 59199, 
-    59216, 59233, 59250, 59267, 59284, 59301, 59318, 59335, 59352, 59369, 
-    59386, 59403, 59420, 59437, 59454, 59471, 59488, 59505, 59522, 59539, 
-    59556, 59573, 59590, 59607, 59624, 59641, 59658, 59675, 59686, 59691, 
-    1630, 59695, 59701, 59706, 59711, 9319, 1635, 59717, 59726, 27710, 59731, 
-    59742, 59752, 59757, 59764, 59770, 59775, 59780, 16606, 59784, 10914, 
-    1640, 10919, 59790, 59795, 59801, 59806, 59811, 59816, 59821, 59826, 
-    59831, 59836, 59842, 59848, 59854, 59859, 59863, 59868, 59873, 59877, 
-    59882, 59887, 59892, 59896, 59901, 59907, 59912, 59917, 59921, 59926, 
-    59931, 59937, 59942, 59947, 59953, 59959, 59964, 59968, 59973, 59978, 
-    59983, 59987, 59992, 59997, 60002, 60008, 60014, 60019, 60023, 60027, 
-    60032, 60037, 60042, 29108, 60046, 60051, 60056, 60062, 60067, 60072, 
-    60076, 60081, 60086, 60092, 60097, 60102, 60108, 60114, 60119, 60123, 
-    60128, 60133, 60137, 60142, 60147, 60152, 60158, 60164, 60169, 60173, 
-    60178, 60183, 60187, 60192, 60197, 60202, 60206, 60209, 31614, 60214, 
-    60222, 16672, 3663, 11010, 60228, 60238, 60253, 11015, 60264, 60269, 
-    60280, 60292, 60304, 60316, 2695, 60328, 60333, 60345, 60349, 60355, 
-    60361, 60366, 1652, 1067, 60375, 60380, 39280, 60384, 60388, 60393, 
-    60397, 16757, 60402, 60405, 60413, 60421, 1656, 11040, 11046, 1661, 
-    60429, 60436, 60441, 60450, 60460, 60467, 60472, 60477, 1666, 60484, 
-    60489, 16872, 60493, 60498, 60505, 60511, 60515, 60526, 60536, 16894, 
-    9227, 9234, 1671, 60543, 60549, 60557, 60564, 60570, 60577, 60589, 60595, 
-    60600, 60612, 60623, 60632, 60642, 3740, 30788, 30797, 16934, 1676, 1680, 
-    60650, 60661, 60666, 1683, 60674, 60679, 16985, 60691, 60697, 60702, 
-    60710, 1688, 60715, 60720, 60728, 60736, 60743, 60752, 60760, 60769, 
-    1693, 60773, 1698, 60778, 60785, 17059, 60793, 60799, 60804, 60812, 
-    60819, 60827, 22557, 60832, 11175, 60841, 60847, 60854, 60861, 60867, 
-    60877, 60883, 60888, 60899, 60904, 60912, 11184, 11189, 60920, 60926, 
-    60934, 3805, 17101, 39368, 60939, 60945, 60950, 60958, 60965, 12029, 
-    60970, 60976, 1709, 60981, 60984, 1127, 60990, 60995, 61000, 61006, 
-    61011, 61016, 61021, 61026, 61031, 61036, 1718, 9, 61042, 61046, 61051, 
-    61055, 61059, 61063, 31854, 61068, 61073, 61078, 61082, 61085, 61089, 
-    61093, 61098, 61102, 61107, 61111, 34591, 34596, 34601, 61114, 61121, 
-    61127, 39089, 61137, 34607, 32112, 31869, 31875, 34623, 31881, 61142, 
-    61147, 32145, 61151, 61154, 61158, 61165, 61168, 61173, 61177, 61181, 
-    61184, 61194, 61206, 61213, 61219, 61226, 33548, 61229, 8543, 877, 61232, 
-    61236, 61241, 3690, 61245, 61248, 13625, 61255, 61262, 61275, 61283, 
-    61292, 61301, 61306, 61316, 61329, 61341, 61348, 61353, 61362, 61375, 
-    36035, 61393, 61398, 61405, 61411, 652, 61416, 61424, 61431, 27254, 627, 
-    61437, 61443, 61453, 61459, 61464, 31899, 6003, 31913, 61468, 61478, 
-    61483, 61493, 61508, 61514, 61520, 31923, 61525, 31069, 61529, 61534, 
-    61539, 61543, 61548, 16937, 61555, 61560, 61564, 6044, 31949, 61568, 
-    61574, 312, 61584, 61591, 61598, 61603, 61612, 58769, 61618, 61626, 
-    61630, 61634, 61638, 61642, 61647, 61651, 61657, 61665, 61670, 61675, 
-    61679, 61684, 61688, 61692, 61698, 61704, 61709, 61713, 32073, 61718, 
-    32079, 32085, 61723, 61729, 61736, 61741, 61745, 31086, 16599, 61748, 
-    61752, 61757, 61764, 61770, 61774, 61779, 38799, 61785, 61789, 61793, 
-    61798, 61804, 61810, 61822, 61831, 61841, 61847, 61854, 61859, 61864, 
-    61868, 61871, 61877, 61884, 61889, 61894, 61901, 61908, 61914, 61919, 
-    61924, 61932, 32090, 2423, 61937, 61942, 61948, 61953, 61959, 61964, 
-    61969, 61974, 61980, 32111, 61985, 61991, 61997, 62003, 32175, 62008, 
-    62013, 62018, 32186, 62023, 62028, 62033, 62039, 62045, 32191, 62050, 
-    62055, 62060, 32246, 32252, 62065, 62070, 32257, 62075, 27937, 32279, 
-    32283, 62080, 62056, 62084, 62092, 62098, 62106, 62113, 62119, 62129, 
-    62135, 62142, 10624, 32297, 62148, 62161, 62170, 62176, 62185, 62191, 
-    23495, 62198, 62205, 62215, 32247, 62218, 62225, 62230, 62234, 62238, 
-    62243, 6120, 62247, 62252, 62257, 34685, 34690, 62261, 34704, 62266, 
-    34709, 62271, 62277, 34721, 34727, 34733, 62282, 62288, 22522, 62299, 
-    62302, 62314, 62322, 32320, 62326, 62335, 62345, 62354, 32330, 62359, 
-    62366, 62375, 62381, 62389, 62396, 6095, 4397, 62401, 32258, 62407, 
-    62410, 62416, 62423, 62428, 62433, 23405, 62437, 62443, 62449, 62454, 
-    62459, 62463, 62469, 62475, 33458, 863, 35698, 36619, 36625, 32366, 
-    62480, 62484, 62488, 62491, 62504, 62510, 62514, 62517, 62522, 33761, 
-    62526, 31091, 21274, 62532, 6024, 6032, 9068, 62535, 62540, 62545, 62550, 
-    62555, 62560, 62565, 62570, 62575, 62580, 62586, 62591, 62596, 62602, 
-    62607, 62612, 62617, 62622, 62627, 62632, 62638, 62643, 62649, 62654, 
-    62659, 62664, 62669, 62674, 62679, 62684, 62689, 62694, 62699, 62705, 
-    62710, 62715, 62720, 62725, 62730, 62735, 62741, 62746, 62751, 62756, 
-    62761, 62766, 62771, 62776, 62781, 62786, 62792, 62797, 62802, 62807, 
-    62812, 62818, 62824, 62829, 62835, 62840, 62845, 62850, 62855, 62860, 
-    1513, 245, 62865, 62869, 62873, 62877, 25116, 62881, 62885, 62890, 62894, 
-    62899, 62903, 62908, 62913, 62918, 62922, 62926, 62931, 62935, 13362, 
-    62940, 62944, 62951, 62961, 15193, 62970, 62979, 62983, 62988, 62993, 
-    62997, 24907, 3019, 63001, 17350, 63007, 63016, 63024, 63030, 63042, 
-    63054, 63058, 63063, 63067, 63073, 63079, 63084, 63094, 63104, 63110, 
-    63115, 63119, 63124, 63130, 63139, 63148, 63156, 15547, 63160, 63169, 
-    63177, 63189, 63200, 63211, 63220, 63224, 63233, 63243, 63251, 63257, 
-    63262, 63268, 63273, 98, 30900, 63284, 26249, 26259, 63290, 63297, 63303, 
-    63307, 63317, 63328, 63336, 63345, 63350, 63355, 63359, 17304, 63367, 
-    63371, 63377, 63387, 63394, 63400, 34784, 63406, 63408, 63411, 63415, 
-    63425, 63431, 63438, 13308, 63445, 63451, 63460, 63469, 63475, 63481, 
-    63487, 63492, 63499, 63506, 63512, 63525, 63534, 63543, 63548, 63552, 
-    63558, 63565, 63572, 63579, 63586, 63593, 63598, 63602, 63606, 63609, 
-    63619, 63623, 63635, 63644, 63648, 63653, 63657, 63663, 63668, 63675, 
-    63684, 63692, 63700, 63705, 63709, 63714, 63719, 63729, 63737, 63742, 
-    63746, 63750, 63756, 63768, 63776, 63786, 63793, 63799, 63804, 63808, 
-    63812, 63816, 63825, 63834, 63843, 63849, 63855, 63861, 63866, 63873, 
-    63879, 63887, 63894, 12456, 63900, 63906, 63910, 14231, 63914, 63919, 
-    63929, 63938, 63944, 63950, 63958, 63965, 63969, 63973, 63979, 63987, 
-    63994, 64000, 64011, 64015, 64019, 64023, 64026, 64032, 64037, 64041, 
-    64045, 64054, 64062, 64069, 64075, 64082, 24029, 38841, 64087, 64095, 
-    64099, 64103, 64106, 64114, 64121, 64127, 64136, 64144, 64150, 64155, 
-    64159, 64164, 64168, 64172, 64177, 64186, 64190, 64197, 64204, 64210, 
-    64218, 64224, 64235, 64243, 64249, 22652, 64258, 64265, 64272, 64279, 
-    64286, 64293, 41870, 13146, 64300, 64307, 64312, 34820, 6217, 64318, 
-    64323, 64328, 64334, 64340, 64346, 64351, 64356, 64361, 64366, 64372, 
-    64377, 64383, 64388, 64394, 64399, 64404, 64409, 64414, 64419, 64424, 
-    64429, 64435, 64440, 64446, 64451, 64456, 64461, 64466, 64471, 64476, 
-    64482, 64487, 64492, 64497, 64502, 64507, 64512, 64517, 64522, 64527, 
-    64532, 64538, 64543, 64548, 64553, 64558, 64563, 64568, 64573, 64578, 
-    64584, 64589, 64594, 64599, 64604, 64609, 64614, 64619, 64624, 64629, 
-    64634, 64639, 64644, 64650, 1834, 224, 37417, 64655, 64658, 64663, 64667, 
-    64670, 64675, 63696, 64686, 64696, 64703, 64719, 64728, 64738, 64748, 
-    64756, 64770, 64778, 64782, 64785, 64792, 64798, 64809, 64821, 64832, 
-    64841, 64848, 1297, 23294, 64858, 2590, 64862, 64871, 1133, 17277, 38054, 
-    64879, 64887, 64901, 64914, 64918, 64923, 64928, 64933, 64939, 64945, 
-    64950, 8535, 64955, 64959, 64967, 11041, 64972, 64978, 64987, 1721, 
-    11053, 736, 64991, 65000, 65010, 27013, 65019, 65025, 16849, 65031, 
-    65035, 3964, 11384, 65041, 65048, 60656, 65052, 65056, 3988, 189, 14146, 
-    65062, 65074, 65078, 65084, 27730, 65088, 11372, 2730, 4, 65093, 65103, 
-    65109, 65120, 65127, 65133, 65139, 65147, 65154, 65160, 65170, 65180, 
-    65190, 23482, 1309, 65199, 65203, 65207, 65213, 65217, 2753, 2759, 8532, 
-    2264, 65221, 65225, 65234, 65242, 65253, 65261, 65269, 65275, 65280, 
-    65291, 65302, 65310, 65316, 9687, 65321, 65329, 65333, 65337, 65341, 
-    65353, 28115, 65360, 65370, 65376, 65382, 9789, 65392, 65403, 65413, 
-    65422, 65426, 65433, 1135, 1170, 65443, 65448, 65456, 65464, 65475, 
-    65482, 65496, 14075, 393, 65506, 65510, 65518, 65527, 65535, 65541, 
-    65555, 65562, 65568, 65577, 65584, 65594, 65602, 3812, 156, 65610, 65621, 
-    65625, 65637, 27928, 161, 65643, 65648, 65652, 65659, 65665, 65673, 
-    65680, 8818, 65687, 65696, 65704, 3878, 65717, 8199, 65721, 2798, 450, 
-    65726, 65739, 65744, 1833, 668, 65748, 3895, 65756, 65762, 65766, 931, 
-    65776, 65785, 65790, 14915, 14922, 45232, 65794, 3822, 13034, 65802, 
-    65809, 23538, 65813, 65820, 65826, 65831, 65836, 14935, 372, 65841, 
-    65853, 65859, 65867, 2810, 1753, 65875, 65877, 65882, 65887, 65892, 
-    65898, 65903, 65908, 65913, 65918, 65923, 65928, 65934, 65939, 65944, 
-    65949, 65954, 65959, 65964, 65969, 65974, 65980, 65985, 65990, 65995, 
-    66001, 66006, 66012, 66017, 66022, 66027, 66032, 66037, 66042, 66047, 
-    66053, 66058, 66064, 66069, 66074, 66079, 66084, 66089, 66094, 66099, 
-    66104, 66110, 66115, 66120, 66125, 66129, 66133, 66138, 66142, 66147, 
-    66152, 66158, 66163, 66167, 66172, 66176, 66179, 66181, 66185, 66188, 
-    66193, 66197, 66201, 66205, 66209, 66218, 66222, 32524, 66225, 32529, 
-    66232, 66237, 32534, 66246, 66255, 32540, 66260, 32545, 66269, 66274, 
-    11571, 66278, 66283, 66288, 32550, 66292, 40196, 66296, 66299, 66303, 
-    8211, 66309, 66314, 66318, 3705, 32555, 66321, 66325, 66328, 66333, 
-    66337, 66343, 66351, 66364, 66373, 66379, 66384, 66390, 66394, 66400, 
-    66408, 66413, 66417, 66424, 66430, 66438, 66447, 66455, 32558, 66462, 
-    66472, 66481, 66494, 66499, 66504, 66513, 66519, 66526, 66537, 66549, 
-    66556, 66565, 66574, 66583, 66590, 66596, 66603, 66611, 66618, 66626, 
-    66635, 66643, 66650, 66658, 66667, 66675, 66684, 66694, 66703, 66711, 
-    66718, 66726, 66735, 66743, 66752, 66762, 66771, 66779, 66788, 66798, 
-    66807, 66817, 66828, 66838, 66847, 66855, 66862, 66870, 66879, 66887, 
-    66896, 66906, 66915, 66923, 66932, 66942, 66951, 66961, 66972, 66982, 
-    66991, 66999, 67008, 67018, 67027, 67037, 67048, 67058, 67067, 67077, 
-    67088, 67098, 67109, 67121, 67132, 67142, 67151, 67159, 67166, 67174, 
-    67183, 67191, 67200, 67210, 67219, 67227, 67236, 67246, 67255, 67265, 
-    67276, 67286, 67295, 67303, 67312, 67322, 67331, 67341, 67352, 67362, 
-    67371, 67381, 67392, 67402, 67413, 67425, 67436, 67446, 67455, 67463, 
-    67472, 67482, 67491, 67501, 67512, 67522, 67531, 67541, 67552, 67562, 
-    67573, 67585, 67596, 67606, 67615, 67625, 67636, 67646, 67657, 67669, 
-    67680, 67690, 67701, 67713, 67724, 67736, 67749, 67761, 67772, 67782, 
-    67791, 67799, 67806, 67814, 67823, 67831, 67840, 67850, 67859, 67867, 
-    67876, 67886, 67895, 67905, 67916, 67926, 67935, 67943, 67952, 67962, 
-    67971, 67981, 67992, 68002, 68011, 68021, 68032, 68042, 68053, 68065, 
-    68076, 68086, 68095, 68103, 68112, 68122, 68131, 68141, 68152, 68162, 
-    68171, 68181, 68192, 68202, 68213, 68225, 68236, 68246, 68255, 68265, 
-    68276, 68286, 68297, 68309, 68320, 68330, 68341, 68353, 68364, 68376, 
-    68389, 68401, 68412, 68422, 68431, 68439, 68448, 68458, 68467, 68477, 
-    68488, 68498, 68507, 68517, 68528, 68538, 68549, 68561, 68572, 68582, 
-    68591, 68601, 68612, 68622, 68633, 68645, 68656, 68666, 68677, 68689, 
-    68700, 68712, 68725, 68737, 68748, 68758, 68767, 68777, 68788, 68798, 
-    68809, 68821, 68832, 68842, 68853, 68865, 68876, 68888, 68901, 68913, 
-    68924, 68934, 68945, 68957, 68968, 68980, 68993, 69005, 69016, 69028, 
-    69041, 69053, 69066, 69080, 69093, 69105, 69116, 69126, 69135, 69143, 
-    69150, 69155, 8058, 69162, 32568, 69167, 69172, 32573, 69178, 20916, 
-    32578, 69183, 69189, 69197, 69203, 69209, 69216, 69223, 69228, 69232, 
-    69235, 69239, 69248, 69254, 69266, 69277, 69281, 3081, 8033, 69286, 
-    69289, 69291, 69295, 69299, 69303, 69309, 69314, 25927, 69319, 69323, 
-    69326, 69331, 69335, 69342, 69348, 69352, 6170, 69356, 32595, 69361, 
-    69368, 69377, 69385, 69396, 69404, 69412, 69419, 69426, 69432, 69443, 
-    32600, 69448, 69459, 69471, 69479, 69490, 69499, 69510, 69515, 69523, 
-    2556, 69528, 34270, 69541, 69545, 69557, 69565, 69570, 69578, 17472, 
-    69589, 69595, 69602, 69610, 69616, 32610, 69621, 3914, 58217, 69628, 
-    69631, 69639, 69652, 69665, 69678, 69691, 69698, 69709, 69718, 41687, 
-    41692, 69723, 69727, 69735, 69742, 69751, 69759, 69765, 69774, 69782, 
-    69790, 69794, 69803, 69812, 69822, 69835, 69848, 69858, 32615, 69864, 
-    69871, 69877, 32621, 69882, 69885, 69889, 69897, 69906, 41425, 69914, 
-    69923, 69931, 69938, 69946, 69956, 69965, 69974, 69983, 69991, 70002, 
-    70012, 9359, 21554, 70021, 70026, 70031, 70035, 70039, 70044, 70050, 
-    70055, 70060, 70066, 70071, 70076, 21519, 70081, 70088, 70096, 70104, 
-    70109, 70116, 70123, 70128, 70132, 70136, 70144, 70152, 32638, 70158, 
-    70164, 70176, 70182, 70186, 70193, 70198, 70209, 70219, 70229, 70241, 
-    70247, 70257, 70267, 32665, 70276, 70285, 70291, 70303, 70314, 70321, 
-    70326, 70330, 70338, 70344, 70349, 70354, 70361, 70369, 70381, 70391, 
-    70400, 70409, 70416, 34132, 23834, 70422, 70427, 70431, 70435, 70440, 
-    70446, 70457, 70470, 70475, 70482, 32670, 70487, 70499, 70508, 70518, 
-    70529, 70542, 70549, 70558, 70567, 70575, 70580, 70586, 1058, 70591, 
-    70596, 70601, 70606, 70612, 70617, 70622, 70628, 70634, 70639, 70643, 
-    70648, 70653, 70658, 58729, 70663, 70668, 70673, 70678, 70684, 70690, 
-    70695, 70699, 70704, 70709, 70714, 70720, 70725, 70731, 70736, 70741, 
-    70746, 70751, 70755, 70761, 70766, 70775, 70780, 70785, 70790, 70795, 
-    70799, 70806, 70812, 17122, 17129, 70817, 70821, 70825, 70829, 70833, 
-    45487, 70837, 70767, 70839, 70849, 32679, 70852, 70861, 70867, 6143, 
-    32684, 70871, 70877, 70882, 70888, 70893, 70897, 70904, 70909, 70919, 
-    70928, 70932, 70938, 70944, 70950, 70954, 70962, 70969, 70977, 70985, 
-    32689, 70992, 70995, 71002, 71008, 71013, 71017, 71023, 71030, 71035, 
-    71039, 71048, 71056, 71062, 71067, 32694, 71074, 71081, 71087, 71092, 
-    71098, 71105, 71111, 21281, 27438, 71117, 71122, 71128, 71140, 70800, 
-    70807, 21457, 71150, 71155, 71162, 71168, 71175, 71181, 71192, 71197, 
-    9103, 71205, 71208, 71214, 71218, 71222, 71225, 71231, 32443, 6194, 964, 
-    13412, 71238, 71244, 71250, 71256, 71262, 71268, 71274, 71280, 71286, 
-    71291, 71296, 71301, 71306, 71311, 71316, 71321, 71326, 71331, 71336, 
-    71341, 71346, 71351, 71357, 71362, 71367, 71373, 71378, 71383, 71389, 
-    71395, 71401, 71407, 71413, 71419, 71425, 71431, 71437, 71442, 71447, 
-    71453, 71458, 71463, 71469, 71474, 71479, 71484, 71489, 71494, 71499, 
-    71504, 71509, 71514, 71519, 71524, 71529, 71535, 71540, 71545, 71550, 
-    71556, 71561, 71566, 71571, 71576, 71582, 71587, 71592, 71597, 71602, 
-    71607, 71612, 71617, 71622, 71627, 71632, 71637, 71642, 71647, 71652, 
-    71657, 71662, 71667, 71672, 71677, 71683, 71688, 71693, 71698, 71703, 
-    71708, 71713, 71718, 1864, 142, 71723, 71727, 71731, 71736, 71744, 71748, 
-    71755, 71763, 71767, 71780, 71788, 71792, 71795, 71800, 71804, 71809, 
-    71813, 71821, 71825, 20924, 71830, 71834, 60930, 71838, 71841, 71849, 
-    71857, 71865, 71870, 71877, 71883, 71889, 71894, 71901, 71906, 71914, 
-    64906, 71921, 71926, 71931, 71935, 11638, 71939, 71944, 71949, 71953, 
-    71956, 71962, 71966, 71976, 71985, 71988, 71992, 71999, 72012, 72018, 
-    72026, 72037, 72048, 72059, 72070, 72079, 72085, 72094, 72102, 72112, 
-    72125, 72132, 72143, 72149, 72154, 72159, 72165, 72171, 72181, 72190, 
-    70489, 72198, 72204, 72212, 72218, 72226, 72229, 72233, 72237, 72240, 
-    72246, 72252, 72260, 72272, 72284, 72291, 72295, 72306, 72314, 72321, 
-    72333, 72341, 72349, 72356, 72362, 72372, 72381, 72386, 72396, 72405, 
-    40751, 72412, 72416, 72421, 72429, 72436, 72442, 72446, 72456, 72467, 
-    72475, 72482, 72494, 72506, 72515, 69531, 72522, 72533, 72547, 72555, 
-    72565, 72572, 72580, 72592, 72601, 72609, 72619, 72630, 72642, 72651, 
-    72661, 72668, 72677, 72692, 72700, 72710, 72719, 72727, 72740, 72755, 
-    72759, 72768, 72780, 72791, 72802, 72813, 72823, 72834, 72842, 72848, 
-    72858, 72866, 72872, 29007, 72877, 72883, 72888, 72895, 9701, 17492, 
-    72901, 72910, 72915, 72919, 72926, 72932, 72937, 72942, 72950, 72958, 
-    72962, 72965, 72968, 72970, 72977, 72983, 72994, 72999, 73003, 73010, 
-    73016, 73021, 73029, 65405, 65415, 73035, 73042, 73052, 10611, 73059, 
-    73064, 29203, 73073, 73078, 73085, 73095, 73103, 73111, 73120, 73126, 
-    73132, 73139, 73146, 73151, 73155, 73163, 73168, 73173, 73181, 73188, 
-    73193, 73199, 73202, 73206, 73215, 71775, 73224, 73228, 73234, 73245, 
-    73255, 17501, 73266, 73274, 17513, 73281, 73285, 73294, 27324, 73301, 
-    73305, 73310, 73327, 73339, 10569, 73351, 73356, 73361, 73366, 20997, 
-    73370, 73375, 73380, 73386, 73391, 5846, 21001, 73396, 73401, 73407, 
-    73414, 73419, 73424, 73430, 73436, 73442, 73447, 73453, 73457, 73471, 
-    73479, 73487, 73493, 73498, 73505, 73515, 73524, 73529, 73534, 73542, 
-    73547, 73553, 73558, 73567, 59786, 73572, 73575, 73593, 73612, 73625, 
-    73639, 73655, 73662, 73669, 73675, 73682, 73687, 73693, 73699, 73707, 
-    73713, 73718, 73723, 73739, 10582, 73753, 73760, 73768, 73774, 73778, 
-    73781, 73786, 73791, 73798, 73803, 73812, 73817, 73823, 73832, 73841, 
-    73846, 73850, 73858, 73867, 11667, 73876, 73884, 73889, 73895, 11678, 
-    73900, 73903, 73908, 73918, 73927, 73932, 73938, 73943, 73951, 73958, 
-    73969, 73979, 73984, 64834, 73989, 73995, 74000, 74007, 74016, 74024, 
-    74030, 74036, 74043, 74049, 74053, 16947, 3055, 74058, 74062, 74066, 
-    74072, 74081, 74087, 74094, 74098, 74119, 74141, 74157, 74174, 74193, 
-    74202, 74212, 74219, 74226, 27211, 74232, 74236, 74244, 74256, 74262, 
-    74270, 74274, 74282, 74289, 74293, 74299, 74305, 74310, 3563, 41887, 
-    74316, 74320, 74324, 74328, 74333, 74338, 74343, 74349, 74355, 74361, 
-    74368, 74374, 74381, 74387, 74393, 74398, 74404, 74409, 74413, 74418, 
-    74422, 74427, 41902, 74431, 74436, 74444, 74448, 74453, 74460, 74469, 
-    74475, 74479, 74486, 74490, 74493, 74500, 74509, 74514, 74518, 74526, 
-    74535, 74539, 74547, 74553, 74558, 74563, 74569, 74575, 74580, 74584, 
-    74590, 74595, 74599, 74603, 74606, 74611, 74619, 74629, 74634, 39387, 
-    74642, 74654, 74658, 74664, 74676, 74687, 74694, 74700, 74707, 74719, 
-    74726, 74732, 21075, 74736, 74742, 74749, 74755, 74761, 74766, 74771, 
-    74776, 74785, 7033, 74790, 16413, 74796, 74800, 74804, 74808, 74816, 
-    74825, 74829, 74836, 74845, 74858, 74864, 74423, 30067, 74869, 74871, 
-    74876, 74881, 74886, 74891, 74896, 74901, 74906, 74911, 74916, 74921, 
-    74926, 74931, 74936, 74941, 74947, 74952, 74957, 74962, 74967, 74972, 
-    74977, 74982, 74987, 74993, 74999, 75005, 75010, 75015, 75027, 75032, 
-    1870, 49, 75037, 75042, 32721, 75046, 32726, 32731, 32737, 32742, 75050, 
-    32747, 22070, 75072, 75076, 75080, 75085, 75089, 32751, 75093, 75101, 
-    32756, 75108, 75111, 75116, 75120, 9536, 75129, 32761, 21932, 75132, 
-    75136, 1428, 75141, 32772, 75144, 75149, 25720, 25730, 35233, 75154, 
-    75159, 75164, 75169, 75175, 75180, 75189, 75194, 75201, 75207, 75212, 
-    75217, 75222, 75232, 75241, 75246, 75254, 75258, 75266, 32586, 37288, 
-    75273, 75279, 75284, 75289, 12009, 75294, 75300, 75305, 75312, 75318, 
-    75323, 75331, 75341, 75351, 75357, 75362, 75368, 17523, 75375, 36048, 
-    75388, 75393, 75399, 30968, 75412, 75418, 75422, 75431, 75438, 75444, 
-    75452, 75461, 75468, 75474, 75477, 75481, 25861, 75485, 75492, 75498, 
-    75506, 75511, 23977, 75517, 75520, 75528, 75536, 75550, 75557, 75563, 
-    75570, 75576, 32786, 75580, 75587, 75595, 75603, 75609, 32791, 75617, 
-    75623, 75628, 75638, 75644, 75653, 30805, 34691, 75661, 75666, 75671, 
-    75675, 75680, 75684, 75692, 14907, 39400, 75697, 75702, 32796, 62232, 
-    75706, 75711, 75715, 75724, 75732, 75738, 75743, 75749, 75756, 75762, 
-    75767, 75772, 75781, 75793, 75808, 33058, 75814, 16532, 32800, 75818, 
-    75825, 24087, 75831, 75838, 75847, 75854, 75863, 75869, 75874, 75882, 
-    75888, 32810, 75893, 75902, 74682, 75911, 75918, 75924, 75930, 75940, 
-    75948, 75955, 75959, 32815, 75962, 32821, 32827, 75967, 75975, 75983, 
-    75993, 76002, 76010, 76017, 76027, 32832, 76031, 76033, 76037, 76042, 
-    76046, 76050, 76056, 76061, 76065, 76076, 76081, 76086, 3060, 76090, 
-    76097, 76101, 76110, 76118, 76125, 76130, 76135, 62278, 76139, 76142, 
-    76148, 76156, 76162, 76166, 76171, 76178, 76183, 76189, 34722, 76194, 
-    76197, 76202, 76206, 76211, 76216, 76220, 76228, 76232, 25739, 25748, 
-    76238, 76244, 76250, 76255, 76259, 76262, 76272, 76281, 76286, 76292, 
-    76299, 76305, 76309, 76317, 76322, 34728, 76326, 76334, 76340, 76347, 
-    76352, 76356, 76361, 58403, 34734, 76367, 76372, 76376, 76381, 76386, 
-    76391, 76395, 76400, 76405, 76411, 76416, 76421, 76427, 76433, 76438, 
-    76442, 76447, 76452, 76457, 76461, 24086, 76466, 76471, 76477, 76483, 
-    76489, 76494, 76498, 76503, 76508, 76513, 76517, 76522, 76527, 76532, 
-    76537, 76541, 32840, 76549, 76553, 76561, 76569, 76580, 76585, 76589, 
-    22384, 76594, 76600, 76610, 76617, 76622, 76631, 76636, 76640, 76645, 
-    76653, 76661, 76668, 65068, 76674, 76682, 76689, 76700, 76706, 76710, 
-    76716, 32850, 76719, 76726, 76734, 76739, 39591, 76743, 76748, 76755, 
-    76760, 8985, 76764, 76772, 76779, 76786, 76792, 76806, 63340, 76814, 
-    76820, 76824, 76827, 76835, 76842, 76847, 76860, 76867, 76871, 76878, 
-    76883, 60823, 76888, 76891, 76898, 76904, 76908, 76916, 76925, 76935, 
-    76945, 76954, 76962, 76973, 76978, 76982, 76987, 76991, 35364, 76999, 
-    21344, 35373, 77004, 77009, 77014, 77019, 77024, 77029, 77034, 77038, 
-    77043, 77048, 77053, 77058, 77063, 77068, 77072, 77077, 77082, 77086, 
-    77090, 77094, 77098, 77103, 77108, 77112, 77117, 77121, 77125, 77130, 
-    77135, 77140, 77145, 77149, 77154, 77159, 77163, 77168, 77173, 77178, 
-    77183, 77188, 77193, 77198, 77203, 77208, 77213, 77218, 77223, 77228, 
-    77233, 77238, 77243, 77248, 77253, 77258, 77263, 77267, 77272, 77277, 
-    77282, 77287, 77292, 77297, 77302, 77307, 77312, 77317, 77322, 77326, 
-    77331, 77335, 77340, 77345, 77350, 77355, 77360, 77365, 77370, 77375, 
-    77380, 77384, 77388, 77393, 77398, 77402, 77407, 77412, 77416, 77421, 
-    77426, 77431, 77436, 77440, 77445, 77450, 77454, 77459, 77463, 77467, 
-    77471, 77475, 77480, 77484, 77488, 77492, 77496, 77500, 77504, 77508, 
-    77512, 77516, 77521, 77526, 77531, 77536, 77541, 77546, 77551, 77556, 
-    77561, 77566, 77570, 77574, 77578, 77582, 77586, 77590, 77595, 77599, 
-    77604, 77608, 77613, 77618, 77622, 77626, 77631, 77635, 77639, 77643, 
-    77647, 77651, 77655, 77659, 77663, 77667, 77671, 77675, 77679, 77683, 
-    77687, 77692, 77697, 77701, 77705, 77709, 77713, 77717, 77721, 77726, 
-    77730, 77734, 77738, 77742, 77746, 77750, 77755, 77759, 77764, 77768, 
-    77772, 77776, 77780, 77784, 77788, 77792, 77796, 77800, 77804, 77808, 
+    8935, 8939, 8944, 8949, 8956, 8962, 8972, 7909, 8978, 8982, 8989, 8996, 
+    768, 9000, 9004, 9009, 9014, 9019, 9023, 9029, 9037, 9043, 9047, 9053, 
+    9063, 9067, 9073, 9078, 9082, 9088, 9094, 2161, 9099, 9101, 9106, 9114, 
+    9123, 9127, 9133, 9138, 9143, 9148, 9153, 9159, 9164, 9169, 4006, 9174, 
+    9179, 9183, 9189, 9194, 9200, 9205, 9210, 9216, 9221, 9128, 9227, 9231, 
+    9238, 9244, 9249, 9253, 6183, 9258, 9267, 9272, 9277, 8218, 8225, 9282, 
+    2853, 9286, 9291, 9296, 9139, 9300, 9305, 9144, 9149, 9310, 9317, 9324, 
+    9330, 9336, 9342, 9347, 9352, 9357, 9154, 9160, 9363, 9369, 9374, 9382, 
+    9165, 9387, 990, 9390, 9398, 9404, 9410, 9419, 9427, 9432, 9438, 9446, 
+    9453, 9468, 9485, 9504, 9513, 9521, 9536, 9547, 9557, 9567, 9575, 9581, 
+    9593, 9602, 9610, 9617, 9624, 9630, 9635, 9643, 9653, 9660, 9670, 9680, 
+    9690, 9698, 9705, 9714, 9724, 9738, 9753, 9762, 9770, 9775, 9779, 9788, 
+    9794, 9799, 9809, 9819, 9829, 9834, 9838, 9847, 9852, 9862, 9873, 9886, 
+    9894, 9907, 9919, 9927, 9932, 9936, 9942, 9947, 9955, 9963, 9970, 9975, 
+    9983, 9989, 9992, 9996, 10002, 10010, 10015, 10019, 10027, 10036, 10044, 
+    10050, 10054, 10061, 10072, 10076, 10079, 10085, 9170, 10090, 10096, 
+    10103, 10109, 10114, 10121, 10128, 10135, 10142, 10149, 10156, 10163, 
+    10170, 10175, 9481, 10180, 10186, 10193, 10200, 10205, 10212, 10221, 
+    10225, 10237, 8256, 10241, 10244, 10248, 10252, 10256, 10260, 10266, 
+    10272, 10277, 10283, 10288, 10293, 10299, 10304, 10309, 8952, 10314, 
+    10318, 10322, 10326, 10331, 10336, 10344, 10350, 10354, 10358, 10365, 
+    10370, 10378, 10383, 10387, 10390, 10396, 10403, 10407, 10410, 10415, 
+    10419, 4045, 10425, 10434, 36, 10442, 10448, 10453, 8967, 10458, 10463, 
+    10467, 10470, 10485, 10504, 10516, 10529, 10542, 10555, 10569, 10582, 
+    10597, 10604, 9175, 10610, 10624, 10629, 10635, 10640, 10648, 10653, 
+    8040, 10658, 10661, 10668, 10673, 10677, 2858, 998, 10683, 10687, 10693, 
+    10699, 10704, 10710, 10715, 9184, 10721, 10727, 10732, 10737, 10745, 
+    10751, 10764, 10772, 10779, 9190, 10785, 10793, 10801, 10808, 10821, 
+    10833, 10843, 10851, 10858, 10865, 10874, 10883, 10891, 10898, 10903, 
+    10909, 9195, 10914, 10920, 9201, 10925, 10928, 10935, 10941, 10954, 8669, 
+    10965, 10971, 10980, 10988, 10995, 11001, 11007, 11012, 11016, 11021, 
+    10477, 11027, 9206, 11034, 11039, 11046, 11052, 11058, 11063, 11071, 
+    11079, 11086, 11090, 11104, 11114, 11119, 11123, 11134, 11140, 11145, 
+    11150, 9211, 9217, 11154, 11157, 11162, 11174, 11181, 11186, 11190, 
+    11195, 11199, 11206, 11212, 9222, 9129, 11219, 2863, 8, 11226, 11231, 
+    11235, 11241, 11249, 11259, 11264, 11269, 11276, 11283, 11287, 11298, 
+    11308, 11317, 11329, 11334, 11338, 11346, 11360, 11364, 11367, 11375, 
+    11382, 11390, 11394, 11405, 11409, 11416, 11421, 11425, 11431, 11436, 
+    11440, 11446, 11451, 11462, 11466, 11469, 11475, 11480, 11486, 11492, 
+    11499, 11510, 11520, 11530, 11539, 11546, 11555, 9232, 9239, 9245, 9250, 
+    11561, 11567, 9254, 11573, 11576, 11583, 11588, 11603, 11619, 11634, 
+    11642, 11648, 11653, 838, 420, 11658, 11666, 11673, 11679, 11684, 11689, 
+    9259, 11691, 11695, 11700, 11704, 11714, 11719, 11723, 11732, 11736, 
+    11739, 9268, 11746, 11749, 11757, 11764, 11772, 11776, 11783, 11792, 
+    11795, 11799, 11803, 11809, 11813, 11817, 11821, 11827, 11837, 11841, 
+    11849, 11853, 11860, 11864, 11869, 11873, 11880, 11886, 11894, 11900, 
+    11905, 11915, 11920, 11925, 11929, 11937, 3905, 11945, 11950, 9273, 
+    11954, 11958, 11961, 11969, 11976, 11980, 5991, 11984, 11989, 11993, 
+    12004, 12014, 12019, 12025, 12029, 12032, 12040, 12045, 12050, 12057, 
+    12062, 9278, 12067, 12071, 12078, 1722, 6145, 12083, 12088, 12093, 12098, 
+    12104, 12109, 12115, 12120, 12125, 12130, 12135, 12140, 12145, 12150, 
+    12155, 12160, 12165, 12170, 12175, 12180, 12185, 12190, 12195, 12201, 
+    12206, 12211, 12216, 12221, 12226, 12232, 12237, 12242, 12248, 12253, 
+    12259, 12264, 12270, 12275, 12280, 12285, 12290, 12296, 12301, 12306, 
+    12311, 737, 139, 12319, 12323, 12328, 12333, 12337, 12341, 12345, 12350, 
+    12354, 12359, 12363, 12366, 12370, 12374, 12380, 12385, 12395, 12401, 
+    12409, 12413, 12417, 12424, 12432, 12441, 12452, 12459, 12466, 12470, 
+    12479, 12488, 12496, 12505, 12514, 12523, 12532, 12542, 12552, 12562, 
+    12572, 12582, 12591, 12601, 12611, 12621, 12631, 12641, 12651, 12661, 
+    12670, 12680, 12690, 12700, 12710, 12720, 12730, 12739, 12749, 12759, 
+    12769, 12779, 12789, 12799, 12809, 12819, 12829, 12838, 12848, 12858, 
+    12868, 12878, 12888, 12898, 12908, 12918, 12928, 12938, 12947, 1256, 
+    12953, 12956, 12960, 12965, 12972, 12978, 12983, 12987, 12992, 13001, 
+    13009, 13014, 13018, 13022, 13028, 13033, 13039, 9287, 13044, 13049, 
+    13058, 9292, 13063, 13066, 13072, 13080, 9297, 13087, 13091, 13095, 
+    13099, 13109, 13115, 13121, 13126, 13135, 13143, 13150, 13157, 13162, 
+    13169, 13174, 13178, 13181, 13192, 13202, 13211, 13219, 13230, 13242, 
+    13252, 13257, 13261, 13266, 13271, 13275, 13281, 13289, 13296, 13307, 
+    13312, 13322, 13326, 13329, 13336, 13346, 13355, 13362, 13366, 13373, 
+    13379, 13384, 13389, 13393, 13402, 13407, 13413, 13417, 13422, 13426, 
+    13435, 13443, 13451, 13458, 13466, 13478, 13489, 13499, 13506, 13512, 
+    13521, 13532, 13541, 13553, 13565, 13577, 13587, 13596, 13605, 13613, 
+    13620, 13629, 13637, 13641, 13647, 13653, 13658, 7753, 13662, 13664, 
+    13668, 13673, 13679, 13688, 13692, 13698, 13706, 13713, 13722, 13731, 
+    13740, 13749, 13758, 13767, 13776, 13785, 13795, 13805, 13814, 13820, 
+    13827, 13834, 13840, 13854, 13861, 13869, 13878, 13884, 13893, 13902, 
+    13913, 13923, 13931, 13938, 13946, 13955, 13968, 13976, 13983, 13996, 
+    14002, 14008, 14018, 14027, 14036, 14041, 14045, 14051, 14057, 14064, 
+    8966, 14069, 14074, 14081, 14086, 12376, 14091, 14099, 14105, 14110, 
+    14118, 14126, 14133, 14141, 14147, 14155, 14163, 14169, 14174, 14180, 
+    14187, 14193, 14198, 14202, 14213, 14221, 14227, 14232, 14241, 14247, 
+    14252, 14261, 14275, 3853, 14279, 14284, 14289, 14295, 14300, 14305, 
+    14309, 14314, 14319, 14324, 7752, 14329, 14334, 14339, 14344, 14349, 
+    14353, 14358, 14363, 14368, 14373, 14379, 14385, 14390, 14394, 14399, 
+    14404, 14409, 9301, 14414, 14419, 14424, 14429, 14434, 14451, 14469, 
+    14481, 14494, 14511, 14527, 14544, 14554, 14573, 14584, 14595, 14606, 
+    14617, 14629, 14640, 14651, 14668, 14679, 14690, 14695, 9306, 14700, 
+    14704, 2381, 14708, 14711, 14717, 14725, 14733, 14738, 14746, 14754, 
+    14761, 14766, 14772, 14779, 14787, 14794, 14806, 14814, 14819, 11597, 
+    14825, 14834, 14843, 14851, 14858, 14864, 14872, 14879, 14885, 14892, 
+    14898, 14907, 14915, 14925, 14932, 14938, 14946, 14952, 14960, 14967, 
+    14980, 14987, 14996, 15005, 15014, 15022, 15032, 15039, 15044, 3560, 
+    15051, 15056, 1372, 15060, 14330, 15064, 15070, 15074, 15082, 15094, 
+    15099, 15106, 15112, 15117, 15124, 14335, 15128, 15132, 15136, 14340, 
+    15140, 14345, 15144, 15151, 15156, 15160, 15167, 15171, 15179, 15186, 
+    15190, 15197, 15214, 15223, 15227, 15230, 15238, 15244, 15249, 3638, 
+    15253, 15255, 15263, 15270, 15280, 15292, 15297, 15303, 15308, 15312, 
+    15318, 15323, 15329, 15332, 15339, 15347, 15354, 15360, 15366, 15371, 
+    15378, 15384, 15389, 15396, 15400, 15406, 15410, 15417, 15423, 15429, 
+    15437, 15443, 15448, 15454, 15462, 15470, 15476, 15482, 15487, 15494, 
+    15499, 15503, 15509, 15514, 15521, 15526, 15532, 15535, 15541, 15547, 
+    15550, 15554, 15566, 15572, 15577, 15584, 15590, 15596, 15607, 15617, 
+    15626, 15634, 15641, 15652, 15662, 15672, 15680, 15683, 14359, 15688, 
+    15693, 14364, 14499, 15701, 15714, 15729, 15740, 14516, 15758, 15771, 
+    15784, 15795, 10492, 15806, 15819, 15838, 15849, 15860, 15871, 2649, 
+    15884, 15888, 15896, 15911, 15926, 15937, 15944, 15950, 15958, 15962, 
+    15968, 15971, 15981, 15989, 15996, 16004, 16014, 16019, 16026, 16031, 
+    16038, 16049, 16059, 16065, 16070, 16075, 14369, 16079, 16085, 16091, 
+    16096, 16101, 16106, 16110, 14374, 14380, 16114, 14386, 16119, 16127, 
+    16136, 16143, 9150, 16147, 16149, 16154, 16159, 16165, 16170, 16175, 
+    16180, 16185, 16189, 16195, 16201, 16206, 16212, 16217, 16222, 16228, 
+    16233, 16238, 16243, 16248, 16254, 16259, 16264, 16270, 16276, 16281, 
+    16286, 16293, 16299, 16310, 16317, 16322, 16326, 16330, 16333, 16341, 
+    16346, 16353, 16360, 16366, 16371, 16376, 16383, 16393, 16398, 16405, 
+    16411, 16421, 16431, 16445, 16459, 16473, 16487, 16502, 16517, 16534, 
+    16552, 16565, 16571, 16576, 16581, 16585, 16590, 16598, 16604, 16609, 
+    16614, 16618, 16623, 16627, 16632, 16636, 16647, 16653, 16658, 16663, 
+    16670, 16675, 16679, 16684, 16689, 16695, 16702, 16708, 16713, 16717, 
+    16723, 16728, 16733, 16737, 16743, 16748, 16753, 16760, 16765, 13111, 
+    16769, 16774, 16778, 16783, 16789, 16795, 16802, 16812, 16820, 16827, 
+    16832, 16836, 16845, 16853, 16860, 16867, 16873, 16879, 16884, 16889, 
+    16895, 16900, 16906, 16911, 16917, 16923, 16930, 16936, 16941, 16946, 
+    9348, 16955, 16958, 16964, 16969, 16974, 16984, 16991, 16997, 17002, 
+    17007, 17013, 17018, 17024, 17029, 17035, 17041, 17046, 17054, 17061, 
+    17066, 17071, 17077, 17082, 17086, 17095, 17106, 17113, 17118, 17126, 
+    17132, 17139, 17145, 17150, 17154, 17160, 17165, 17170, 17175, 1440, 
+    7777, 2877, 17179, 17183, 17187, 17191, 17195, 17199, 17202, 17209, 
+    17217, 14400, 17224, 17234, 17242, 17249, 17257, 17267, 17276, 17289, 
+    17294, 17299, 17307, 17314, 13207, 13216, 17321, 17331, 17346, 17352, 
+    17359, 17366, 17372, 17380, 17390, 17400, 14405, 17409, 17415, 17421, 
+    17429, 17437, 17442, 17451, 17459, 17471, 17481, 17491, 17501, 17510, 
+    17522, 17532, 17542, 17553, 17558, 17570, 17582, 17594, 17606, 17618, 
+    17630, 17642, 17654, 17666, 17678, 17689, 17701, 17713, 17725, 17737, 
+    17749, 17761, 17773, 17785, 17797, 17809, 17820, 17832, 17844, 17856, 
+    17868, 17880, 17892, 17904, 17916, 17928, 17940, 17951, 17963, 17975, 
+    17987, 17999, 18011, 18023, 18035, 18047, 18059, 18071, 18082, 18094, 
+    18106, 18118, 18130, 18142, 18154, 18166, 18178, 18190, 18202, 18213, 
+    18225, 18237, 18249, 18261, 18273, 18285, 18297, 18309, 18321, 18333, 
+    18344, 18356, 18368, 18380, 18392, 18404, 18416, 18428, 18440, 18452, 
+    18464, 18475, 18487, 18499, 18511, 18523, 18536, 18549, 18562, 18575, 
+    18588, 18601, 18614, 18626, 18639, 18652, 18665, 18678, 18691, 18704, 
+    18717, 18730, 18743, 18756, 18768, 18781, 18794, 18807, 18820, 18833, 
+    18846, 18859, 18872, 18885, 18898, 18910, 18923, 18936, 18949, 18962, 
+    18975, 18988, 19001, 19014, 19027, 19040, 19052, 19065, 19078, 19091, 
+    19104, 19117, 19130, 19143, 19156, 19169, 19182, 19194, 19207, 19220, 
+    19233, 19246, 19259, 19272, 19285, 19298, 19311, 19324, 19336, 19347, 
+    19360, 19373, 19386, 19399, 19412, 19425, 19438, 19451, 19464, 19477, 
+    19489, 19502, 19515, 19528, 19541, 19554, 19567, 19580, 19593, 19606, 
+    19619, 19631, 19644, 19657, 19670, 19683, 19696, 19709, 19722, 19735, 
+    19748, 19761, 19773, 19786, 19799, 19812, 19825, 19838, 19851, 19864, 
+    19877, 19890, 19903, 19915, 19928, 19941, 19954, 19967, 19980, 19993, 
+    20006, 20019, 20032, 20045, 20057, 20070, 20083, 20096, 20109, 20122, 
+    20135, 20148, 20161, 20174, 20187, 20199, 20212, 20225, 20238, 20251, 
+    20264, 20277, 20290, 20303, 20316, 20329, 20341, 20354, 20367, 20380, 
+    20393, 20406, 20419, 20432, 20445, 20458, 20471, 20483, 20496, 20509, 
+    20522, 20535, 20548, 20561, 20574, 20587, 20600, 20613, 20625, 20638, 
+    20651, 20664, 20677, 20690, 20703, 20716, 20729, 20742, 20755, 20767, 
+    20778, 20786, 20794, 20801, 20807, 20811, 20817, 20823, 20831, 20837, 
+    20842, 20846, 20855, 9155, 20866, 20873, 20881, 20888, 20895, 10948, 
+    20902, 20911, 20916, 20921, 7805, 20928, 20933, 20936, 20941, 20949, 
+    20956, 20963, 20970, 20976, 20985, 20994, 21000, 21009, 21013, 21019, 
+    21024, 21034, 21041, 21047, 21055, 21061, 21068, 21078, 21087, 21091, 
+    21098, 21102, 21107, 21113, 21121, 21125, 21135, 14415, 21144, 21150, 
+    21154, 21163, 14420, 21169, 21176, 21187, 21195, 21204, 21212, 8931, 
+    21220, 21225, 21231, 21236, 21240, 21244, 21248, 9639, 21253, 21261, 
+    21268, 21277, 21284, 21291, 10878, 21298, 21304, 21308, 21314, 21321, 
+    21327, 21335, 21341, 21348, 21354, 21360, 21369, 21373, 21381, 21390, 
+    21397, 21402, 21406, 21417, 21422, 21427, 21432, 21445, 7995, 21449, 
+    21455, 21463, 21467, 21474, 21483, 21488, 14691, 21496, 21500, 21512, 
+    21517, 21521, 21524, 21530, 21536, 21541, 21545, 21548, 21559, 21564, 
+    9383, 21571, 21576, 9388, 21581, 21586, 21591, 21596, 21601, 21606, 
+    21611, 21616, 21621, 21626, 21631, 21636, 21642, 21647, 21652, 21657, 
+    21662, 21667, 21672, 21677, 21682, 21687, 21693, 21699, 21704, 21709, 
+    21714, 21719, 21724, 21729, 21734, 21739, 21744, 21750, 21755, 21760, 
+    21765, 21771, 21777, 21782, 21787, 21792, 21797, 21802, 21807, 21812, 
+    21817, 21823, 21828, 21833, 21838, 21843, 21849, 21854, 21859, 21863, 
+    1368, 129, 21871, 21875, 21879, 21883, 21888, 21892, 13117, 12476, 21896, 
+    21901, 21905, 21910, 21914, 21919, 21923, 21929, 21934, 21938, 21942, 
+    21950, 21954, 21958, 21963, 21968, 21972, 21978, 21983, 21987, 21992, 
+    21997, 22001, 22008, 22015, 22022, 22026, 22030, 22035, 22039, 22042, 
+    22048, 22061, 22066, 22075, 22080, 9428, 22085, 22088, 2712, 2717, 22092, 
+    22098, 22104, 7209, 22109, 22114, 22119, 22125, 22130, 13909, 22135, 
+    22140, 22145, 22150, 22156, 22161, 22166, 22172, 22177, 22181, 22186, 
+    22191, 22196, 22201, 22205, 22210, 22214, 22219, 22224, 22229, 22234, 
+    22238, 22243, 22247, 22252, 22257, 22262, 22267, 2886, 22182, 22271, 
+    22279, 22286, 9733, 22298, 22306, 22187, 22313, 22318, 22326, 22192, 
+    22331, 22336, 22344, 22349, 22197, 22354, 22359, 22363, 22369, 22377, 
+    22380, 22387, 22391, 22395, 22401, 22408, 22413, 8958, 1727, 1732, 22417, 
+    22423, 22429, 22434, 22438, 22442, 22446, 22450, 22454, 22458, 22462, 
+    22466, 22469, 22475, 22482, 22490, 22496, 22502, 22507, 22512, 22516, 
+    13829, 13836, 22521, 22533, 22536, 22543, 16362, 22550, 22558, 22569, 
+    22578, 22591, 22601, 22615, 22627, 22641, 22653, 22663, 22675, 22681, 
+    22696, 22720, 22738, 22757, 22770, 22784, 22802, 22818, 22835, 22853, 
+    22864, 22883, 22900, 22920, 22938, 22950, 22964, 22978, 22990, 23007, 
+    23026, 23044, 23056, 23074, 23093, 14559, 23106, 23126, 23138, 10523, 
+    23150, 23155, 23160, 23165, 23171, 23176, 23180, 23187, 2398, 23191, 
+    23197, 23201, 23204, 23208, 23216, 23222, 22215, 23226, 23235, 23246, 
+    23252, 23258, 23267, 23275, 23282, 23287, 23291, 23298, 23304, 23313, 
+    23321, 23328, 23338, 23347, 23357, 23362, 23371, 23380, 23391, 23402, 
+    3963, 23412, 23416, 23426, 23434, 23444, 23455, 23460, 23470, 23478, 
+    23485, 23491, 23498, 23503, 22225, 23507, 23516, 23520, 23523, 23528, 
+    23535, 23544, 23552, 23560, 23570, 23579, 23585, 23591, 22230, 22235, 
+    23595, 23605, 23615, 23625, 23633, 23640, 23650, 23658, 23666, 23672, 
+    23680, 930, 23689, 14750, 542, 23703, 23712, 23720, 23731, 23742, 23752, 
+    23761, 23773, 23782, 23791, 23797, 23806, 23815, 23825, 23833, 23841, 
+    9360, 23847, 23850, 23854, 23859, 23864, 9848, 22248, 22253, 23872, 
+    23878, 23884, 23889, 23894, 23898, 23906, 23912, 23918, 23922, 3525, 
+    23930, 23935, 23940, 23944, 23948, 9928, 23955, 23963, 23977, 23984, 
+    23990, 9937, 9943, 23998, 24006, 24013, 24018, 24023, 22258, 24029, 
+    24040, 24044, 24049, 2601, 24054, 24065, 24071, 24076, 24080, 24084, 
+    24087, 24094, 24101, 24108, 24114, 24118, 22263, 24123, 24127, 24131, 
+    1037, 24136, 24141, 24146, 24151, 24156, 24161, 24166, 24171, 24176, 
+    24181, 24186, 24191, 24196, 24201, 24207, 24212, 24217, 24222, 24227, 
+    24232, 24237, 24243, 24248, 24253, 24258, 24263, 24268, 24273, 24278, 
+    24284, 24290, 24295, 24301, 24306, 24311, 5, 24317, 24321, 24325, 24329, 
+    24334, 24338, 24342, 24346, 24350, 24355, 24359, 24364, 24368, 24371, 
+    24375, 24380, 24384, 24389, 24393, 24397, 24401, 24406, 24410, 24414, 
+    24424, 24429, 24433, 24437, 24442, 24447, 24456, 24461, 24466, 24470, 
+    24474, 24487, 24499, 24508, 24517, 24523, 24528, 24532, 24536, 24546, 
+    24555, 24563, 24569, 24574, 24578, 24585, 24595, 24604, 24612, 24620, 
+    24627, 24635, 24644, 24653, 24661, 24666, 24670, 24674, 24677, 24679, 
+    24683, 24687, 24692, 24697, 24701, 24705, 24708, 24712, 24715, 24719, 
+    24722, 24725, 24729, 24735, 24739, 24743, 24747, 24752, 24757, 24762, 
+    24766, 24769, 24774, 24780, 24785, 24791, 24796, 24800, 24804, 24808, 
+    24813, 24817, 24822, 24826, 24830, 24837, 24841, 24844, 24848, 24854, 
+    24860, 24864, 24868, 24873, 24880, 24886, 24890, 24899, 24903, 24907, 
+    24910, 24916, 24921, 24927, 1489, 1791, 24932, 24937, 24942, 24947, 
+    24952, 24957, 24962, 2148, 2194, 24967, 24970, 24974, 24978, 24983, 
+    24987, 24991, 24994, 24999, 25004, 25008, 25011, 25016, 25020, 25025, 
+    25029, 14762, 25034, 25037, 25040, 25044, 25049, 25053, 25066, 25070, 
+    25073, 25081, 25090, 25097, 25102, 25108, 25114, 25122, 25129, 25136, 
+    25140, 25144, 25148, 25153, 25158, 25162, 25170, 25175, 25187, 25198, 
+    25203, 25207, 25211, 25217, 25222, 25227, 25231, 25235, 25238, 25244, 
+    7915, 2316, 25248, 25253, 25269, 9475, 25289, 25298, 25314, 25318, 25321, 
+    25327, 25337, 25343, 25352, 25367, 25379, 25390, 25398, 25407, 25413, 
+    25422, 25432, 25443, 25454, 25463, 25470, 25479, 25487, 25494, 25502, 
+    25509, 25516, 25529, 25536, 25542, 25547, 25556, 25562, 25567, 25575, 
+    25582, 23436, 25594, 25606, 25620, 25628, 25635, 25647, 25656, 25665, 
+    25673, 25681, 25689, 25696, 25705, 25713, 25723, 25732, 25742, 25751, 
+    25760, 25768, 25773, 25777, 25780, 25784, 25788, 25792, 25796, 25800, 
+    25806, 25812, 25820, 14807, 25827, 25832, 25839, 25845, 25852, 14815, 
+    25859, 25862, 25874, 25882, 25888, 25893, 25897, 9878, 25908, 25918, 
+    25927, 25934, 25938, 14820, 25941, 25948, 25952, 25958, 25961, 25968, 
+    25974, 25981, 25987, 25991, 25996, 26000, 26009, 26016, 26022, 7956, 
+    26029, 26037, 26044, 26050, 26055, 26061, 26067, 26075, 26079, 26082, 
+    26084, 25785, 26093, 26099, 26109, 26114, 26121, 26127, 26132, 26137, 
+    26142, 26146, 26151, 26158, 26167, 26171, 26178, 26187, 26193, 26198, 
+    26204, 26209, 26216, 26227, 26232, 26236, 26246, 26252, 26256, 26261, 
+    26271, 26280, 26284, 26291, 26299, 26306, 26312, 26317, 26325, 26332, 
+    26344, 26353, 26357, 13053, 26365, 26375, 26379, 25077, 26390, 26395, 
+    26399, 26406, 26413, 21974, 25710, 26418, 26422, 26425, 22870, 26430, 
+    26444, 26460, 26478, 26497, 26514, 26532, 22889, 26549, 26569, 22906, 
+    26581, 26593, 15745, 26605, 22926, 26619, 26631, 10536, 26645, 26650, 
+    26655, 26660, 26666, 26672, 26678, 26682, 26689, 26694, 26704, 26710, 
+    10183, 26716, 26718, 26723, 26731, 26735, 26154, 26741, 26748, 11524, 
+    11534, 26755, 26765, 26770, 26774, 26777, 26783, 26791, 26803, 26813, 
+    26829, 26842, 26856, 15763, 26870, 26877, 26881, 26884, 26889, 26893, 
+    26900, 26907, 26917, 26922, 26927, 26932, 26940, 26948, 26957, 26962, 
+    9572, 26966, 26969, 26972, 26977, 26984, 26989, 27005, 27013, 27021, 
+    9423, 27029, 27034, 27038, 27044, 27050, 27053, 27059, 27071, 27079, 
+    27086, 27092, 27099, 27110, 27124, 27137, 27146, 27155, 27167, 27178, 
+    27188, 27197, 27206, 27214, 27225, 7938, 27232, 27238, 27243, 27249, 
+    27256, 27266, 27276, 27285, 27291, 27298, 27303, 27310, 27318, 27326, 
+    27338, 6246, 27345, 27354, 27362, 27368, 27374, 27379, 27383, 27386, 
+    27392, 27399, 27404, 27409, 27413, 27425, 27436, 27445, 27453, 14947, 
+    27458, 27464, 27470, 11517, 8635, 27475, 27479, 27483, 27486, 27489, 
+    27495, 27503, 27511, 27515, 27519, 27524, 27527, 27536, 27540, 27548, 
+    27559, 27563, 27569, 27575, 27579, 27585, 27593, 27615, 27639, 27646, 
+    27653, 27659, 27667, 27673, 27678, 27689, 27707, 27714, 27722, 27726, 
+    27735, 27748, 27756, 27768, 27779, 27789, 27803, 27812, 27820, 27832, 
+    9492, 27843, 27854, 27866, 27876, 27885, 27890, 27894, 27902, 27912, 
+    27917, 27921, 27924, 27927, 27935, 27943, 27952, 27962, 27971, 27977, 
+    27991, 2663, 28013, 28024, 28033, 28043, 28055, 28064, 28073, 28083, 
+    28091, 28099, 28108, 28113, 28124, 28129, 28140, 28144, 28154, 28163, 
+    28171, 28181, 28191, 28199, 28208, 28215, 28223, 28230, 28239, 28243, 
+    28251, 28258, 28266, 28273, 28284, 28299, 28306, 28312, 28322, 28331, 
+    28337, 28341, 28348, 28352, 14031, 28358, 28362, 28367, 28374, 28378, 
+    28382, 28390, 28398, 28404, 28413, 28420, 28425, 28430, 28440, 23505, 
+    28444, 28447, 28452, 28457, 28462, 28467, 28472, 28477, 28482, 28487, 
+    28493, 28498, 28503, 28509, 1218, 704, 28514, 28523, 2364, 28530, 28535, 
+    28539, 28545, 1267, 546, 318, 28550, 28559, 28567, 28576, 28584, 28595, 
+    28604, 28612, 28616, 28619, 28627, 28635, 28640, 14775, 28646, 28652, 
+    28658, 5872, 28663, 28667, 28673, 28677, 28684, 1455, 28690, 28697, 9579, 
+    28701, 28711, 28719, 28725, 28734, 28742, 28748, 28756, 28763, 11110, 
+    28769, 28776, 28781, 28788, 1496, 2147, 28794, 28800, 28807, 28818, 
+    28829, 28837, 28844, 28854, 28863, 28871, 28880, 28887, 28894, 28907, 
+    28918, 1272, 28937, 28942, 28950, 3575, 28954, 28959, 28963, 1459, 24706, 
+    28973, 28977, 28982, 28986, 3493, 28992, 29000, 29007, 29018, 29026, 
+    29034, 3576, 279, 29039, 29047, 29055, 29062, 29068, 29073, 2216, 29080, 
+    29086, 25992, 26222, 29092, 106, 29096, 29100, 29106, 615, 9328, 29111, 
+    29118, 29124, 2327, 29128, 29132, 15187, 29135, 29140, 29147, 29153, 
+    29158, 29166, 29173, 29179, 22351, 29183, 29187, 3646, 16625, 29191, 
+    29196, 29199, 29207, 29215, 29220, 29223, 29230, 29240, 29252, 29257, 
+    29261, 29269, 29276, 29282, 29289, 29296, 29299, 29303, 29307, 1463, 
+    29317, 29319, 29324, 29330, 29336, 29341, 29346, 29351, 29356, 29361, 
+    29366, 29371, 29376, 29381, 29386, 29391, 29396, 29401, 29406, 29412, 
+    29418, 29424, 29430, 29435, 29440, 29445, 29451, 29456, 29461, 29466, 
+    29472, 29477, 29483, 29488, 29493, 29498, 29503, 29509, 29514, 29520, 
+    29525, 29530, 29535, 29540, 29546, 29551, 29557, 29562, 29567, 29572, 
+    29577, 29582, 29587, 29592, 29597, 29602, 29608, 29614, 29620, 29625, 
+    29630, 29635, 29640, 29646, 29652, 29658, 29664, 29670, 29676, 29681, 
+    29687, 29692, 29697, 29702, 29707, 29713, 2443, 29718, 2450, 2457, 2754, 
+    29723, 2463, 2473, 29729, 29733, 29738, 29743, 29749, 29754, 29759, 
+    29763, 29768, 29774, 29779, 29784, 29789, 29795, 29800, 29804, 29808, 
+    29813, 29818, 29823, 29828, 29833, 29839, 29845, 29850, 29854, 29859, 
+    29865, 29869, 29874, 29879, 29884, 29889, 29893, 29896, 29901, 29906, 
+    29911, 29916, 29921, 29927, 29933, 29938, 29943, 29947, 29952, 29957, 
+    29962, 29967, 29972, 29976, 29981, 29986, 29991, 29995, 29999, 30003, 
+    30008, 30016, 30021, 30027, 30033, 30039, 30044, 30048, 30051, 30056, 
+    30061, 30065, 30070, 30074, 30079, 30083, 30086, 30091, 17302, 30096, 
+    30101, 30106, 30114, 21280, 28694, 9026, 30119, 30124, 30128, 30133, 
+    30137, 30141, 30146, 30150, 30153, 30156, 30160, 30165, 30169, 30177, 
+    30181, 30184, 30189, 30193, 30197, 30202, 30207, 30211, 30217, 30222, 
+    30227, 30234, 30241, 30245, 30248, 30254, 30263, 30270, 30278, 30285, 
+    30289, 30294, 30298, 30302, 30308, 30314, 30318, 30324, 30329, 30334, 
+    30338, 30345, 30351, 30357, 30363, 30369, 30376, 30382, 30388, 30394, 
+    30400, 30406, 30412, 30418, 30425, 30431, 30438, 30444, 30450, 30456, 
+    30462, 30468, 30474, 30480, 30486, 30492, 11418, 30498, 30503, 30508, 
+    30511, 30519, 30524, 30533, 30539, 30544, 30549, 30554, 30558, 30563, 
+    30568, 30573, 30578, 30583, 30590, 30597, 30603, 30609, 30614, 16303, 
+    30621, 30627, 30634, 30640, 30646, 30651, 30659, 30664, 16082, 30668, 
+    30673, 30678, 30684, 30689, 30694, 30698, 30703, 30708, 30714, 30719, 
+    30724, 30728, 30733, 30738, 30742, 30747, 30752, 30757, 30761, 30766, 
+    30771, 30776, 30780, 30784, 15293, 30788, 30797, 30803, 30809, 30818, 
+    30826, 30835, 30843, 30848, 30852, 30859, 30865, 30869, 30872, 30877, 
+    30886, 30894, 30899, 1495, 30905, 30908, 30912, 22424, 22430, 30918, 
+    30922, 30933, 30944, 30955, 30967, 30974, 30981, 30986, 30990, 5909, 755, 
+    21279, 30998, 31003, 31007, 31012, 31016, 31022, 31027, 31033, 31038, 
+    31044, 31049, 31055, 31060, 31066, 31072, 31078, 31083, 31039, 31045, 
+    31087, 31092, 31098, 31103, 31109, 31114, 31120, 31125, 31050, 10421, 
+    31129, 31061, 31067, 31073, 2831, 3423, 31135, 31138, 31144, 31150, 
+    31156, 31163, 31169, 31175, 31181, 31187, 31193, 31199, 31205, 31211, 
+    31217, 31223, 31229, 31235, 31242, 31248, 31254, 31260, 31266, 31272, 
+    31275, 31280, 31283, 31290, 31298, 31303, 31308, 31314, 31319, 31324, 
+    31328, 31333, 31339, 31344, 31350, 31355, 31361, 31366, 31372, 31378, 
+    31382, 31387, 31392, 31397, 31402, 31406, 31411, 31416, 31421, 31427, 
+    31433, 31439, 31445, 31450, 31454, 31457, 31463, 31469, 31478, 31486, 
+    31493, 31498, 31502, 31506, 31511, 15146, 31516, 31524, 31530, 3683, 
+    1377, 31535, 31539, 8005, 31545, 31551, 31558, 8014, 31562, 31568, 31575, 
+    31581, 31590, 31598, 31610, 31614, 31621, 31627, 31631, 31634, 31643, 
+    31651, 31040, 31656, 31666, 31676, 31686, 31692, 31697, 31707, 31712, 
+    31725, 31739, 31750, 31762, 31774, 31788, 31801, 31813, 31825, 14600, 
+    31839, 31844, 31849, 31853, 31857, 31861, 1780, 27176, 31865, 31870, 
+    31088, 31875, 31878, 31883, 31888, 31893, 31899, 31905, 10098, 31910, 
+    31917, 15697, 31923, 31928, 31933, 31937, 31942, 31947, 31093, 31952, 
+    31957, 31962, 31968, 31099, 31973, 31976, 31983, 31991, 31997, 32003, 
+    32009, 32020, 32025, 32032, 32039, 32046, 32054, 32063, 32072, 32078, 
+    32084, 32092, 31104, 32097, 32103, 32109, 31110, 32114, 32119, 32127, 
+    32135, 32141, 32148, 32154, 32161, 32168, 32174, 32182, 32192, 32199, 
+    32204, 32210, 32215, 32220, 32227, 32236, 32244, 32249, 32255, 32262, 
+    32270, 32276, 32281, 32287, 32296, 27957, 32303, 32307, 32312, 32321, 
+    32326, 32331, 32336, 12405, 32344, 32349, 32354, 32359, 32363, 32368, 
+    32373, 32380, 32385, 32390, 32395, 31115, 21216, 32401, 2519, 244, 32404, 
+    32407, 32411, 32415, 32425, 32433, 32437, 32444, 32451, 32455, 32458, 
+    32464, 32472, 32480, 32484, 32488, 32491, 32498, 32502, 32506, 32513, 
+    32521, 31051, 32528, 32536, 10158, 664, 308, 32548, 32553, 32558, 32564, 
+    32569, 32574, 3704, 32579, 32582, 32587, 32592, 32597, 32602, 32607, 
+    32614, 22529, 32619, 32624, 32629, 32634, 32639, 32645, 32650, 32656, 
+    31286, 32662, 32667, 32673, 32679, 32689, 32694, 32699, 32703, 32708, 
+    32713, 32718, 32723, 32736, 32741, 22302, 16705, 3710, 32745, 32750, 
+    32755, 32761, 32766, 32771, 32775, 32780, 32785, 32791, 32796, 32801, 
+    1382, 32805, 32810, 32815, 32820, 32824, 32829, 32834, 32839, 32845, 
+    32851, 32856, 32860, 32864, 32869, 32874, 32879, 32883, 32891, 32895, 
+    32901, 32905, 32912, 16498, 31062, 32918, 32925, 32933, 32940, 32946, 
+    32959, 32971, 32977, 32981, 2773, 32985, 32989, 32493, 32998, 33009, 
+    33014, 33019, 33024, 33028, 33033, 22435, 33037, 33041, 33046, 31068, 
+    21300, 33050, 33055, 33061, 33066, 33070, 33074, 33077, 33081, 33087, 
+    33098, 33110, 31074, 33115, 33118, 33122, 347, 33127, 33132, 33137, 
+    33142, 33147, 33152, 33158, 33163, 33168, 33174, 33179, 33185, 33190, 
+    33196, 33201, 33206, 33211, 33216, 33221, 33226, 33231, 33236, 33242, 
+    33247, 33252, 33257, 33262, 33267, 33272, 33277, 33283, 33289, 33294, 
+    33299, 33304, 33309, 33314, 33319, 33324, 33329, 33334, 33339, 33344, 
+    33349, 33354, 33359, 33364, 33369, 33374, 33379, 33385, 313, 26, 33390, 
+    33394, 33398, 33406, 33410, 33414, 33417, 33420, 33422, 33427, 33431, 
+    33436, 33440, 33445, 33449, 33454, 33458, 33461, 33463, 33467, 33472, 
+    33476, 33487, 33490, 33492, 33496, 33508, 33517, 33521, 33525, 33531, 
+    33536, 33545, 33551, 33556, 33561, 33565, 33570, 33577, 33582, 33588, 
+    33593, 33597, 33604, 25718, 25728, 33608, 33613, 33618, 33623, 33630, 
+    33634, 33641, 8113, 33647, 33656, 33664, 33679, 33693, 33701, 33712, 
+    33721, 33726, 7227, 33736, 33741, 33746, 33750, 33753, 33757, 33762, 
+    33766, 33773, 33778, 33783, 8912, 33793, 33795, 33798, 33802, 33808, 
+    33812, 33817, 33822, 33828, 33833, 33839, 33844, 33854, 33863, 33871, 
+    33876, 33882, 33887, 33894, 33898, 33906, 33913, 33926, 33934, 33938, 
+    33948, 33953, 33957, 33965, 33973, 33977, 33986, 33992, 33997, 34005, 
+    34015, 34024, 34033, 34042, 34053, 34061, 34072, 34081, 34088, 34094, 
+    34099, 34110, 34115, 34119, 34122, 34126, 34134, 34140, 34148, 34155, 
+    34161, 34166, 34172, 2418, 34176, 34178, 34183, 34188, 34193, 34196, 
+    34198, 34202, 34205, 34212, 34216, 9891, 34220, 34226, 34236, 34241, 
+    34247, 34251, 34256, 34269, 26104, 34275, 34284, 17475, 34291, 34300, 
+    31672, 34308, 34313, 34317, 34325, 34332, 34337, 34341, 34346, 34350, 
+    34358, 34364, 34370, 34375, 34379, 34382, 34387, 34400, 34416, 22996, 
+    34433, 34445, 34462, 34474, 34488, 23013, 23032, 34500, 34512, 2680, 
+    34526, 34531, 34536, 34541, 34545, 34552, 34564, 34570, 34573, 34584, 
+    34595, 34600, 32089, 695, 34604, 34608, 34612, 34615, 34620, 34625, 
+    34631, 34636, 34641, 34647, 34653, 34658, 34662, 34667, 34672, 34677, 
+    34681, 34684, 34690, 34695, 34700, 34705, 34709, 34714, 34720, 34728, 
+    26337, 34733, 34738, 34745, 34751, 34757, 34762, 34770, 22538, 34777, 
+    34782, 34787, 34792, 34796, 34799, 34804, 34808, 34812, 34819, 34825, 
+    34831, 34837, 34844, 34849, 34855, 33968, 34859, 34863, 34868, 34881, 
+    34886, 34892, 34900, 34907, 34915, 34925, 34931, 34937, 34943, 34947, 
+    34956, 34964, 34971, 34976, 34981, 10444, 34986, 34994, 35001, 35007, 
+    35017, 35022, 35028, 35036, 3608, 35043, 35050, 3614, 35054, 35059, 
+    35070, 35077, 35083, 35092, 35096, 4015, 35099, 35106, 35112, 35118, 
+    35126, 35136, 29063, 35143, 35151, 35156, 35162, 35167, 25964, 35173, 
+    35180, 35186, 35195, 23677, 35202, 35207, 35211, 35219, 35227, 9607, 
+    5895, 35234, 35238, 35240, 35244, 35249, 35251, 35257, 35262, 35267, 
+    35274, 32610, 35280, 35285, 35289, 35294, 35298, 35307, 35311, 35317, 
+    35324, 35330, 35337, 35342, 35351, 35356, 35360, 35365, 35372, 35380, 
+    35388, 35393, 21356, 35397, 35400, 35404, 35408, 35412, 35415, 35417, 
+    35425, 35429, 35436, 35440, 35444, 35452, 35459, 35469, 35473, 35477, 
+    35485, 35493, 35499, 35504, 35513, 13357, 35519, 35528, 35533, 35540, 
+    35548, 35556, 35564, 35571, 35578, 35585, 35592, 35599, 35604, 35610, 
+    35627, 35635, 35645, 35653, 35660, 407, 35664, 35670, 35674, 35679, 
+    33717, 35685, 35688, 35692, 35700, 3619, 35708, 35714, 35720, 35729, 
+    35739, 35746, 35752, 3625, 3631, 35761, 35768, 35776, 35781, 35785, 
+    35792, 35800, 35807, 35813, 35822, 35832, 35838, 35846, 35855, 35862, 
+    35870, 35877, 22032, 35881, 35888, 35894, 35904, 35913, 35924, 35928, 
+    35938, 35944, 35951, 35959, 35968, 35977, 35987, 35998, 36005, 36010, 
+    36017, 3029, 36025, 36031, 36036, 36042, 36048, 36053, 36066, 36079, 
+    36092, 36099, 36105, 36113, 36121, 36126, 36130, 1469, 36134, 36139, 
+    36144, 36149, 36154, 36160, 36165, 36170, 36175, 36180, 36185, 36190, 
+    36195, 36201, 36207, 36212, 36217, 36223, 36228, 36233, 36238, 36244, 
+    36249, 36254, 36259, 36264, 36270, 36275, 36280, 36286, 36291, 36296, 
+    36301, 36306, 36311, 36317, 36322, 36328, 36333, 36339, 36344, 36349, 
+    36354, 36360, 36366, 36372, 36378, 36384, 36390, 36396, 36402, 36407, 
+    36412, 36418, 36423, 36428, 36433, 36438, 36443, 36448, 36453, 36459, 
+    36464, 36469, 36475, 36481, 101, 36486, 36488, 36492, 36496, 36500, 
+    36505, 36509, 9528, 36513, 36519, 1741, 6280, 36525, 36528, 36533, 36537, 
+    36542, 36546, 36550, 36555, 10245, 36559, 36563, 36567, 36571, 15385, 
+    36576, 36580, 36585, 36590, 36595, 36599, 36606, 26128, 36612, 36615, 
+    36619, 36624, 36630, 36634, 36642, 36648, 36653, 36657, 36663, 36667, 
+    36671, 3462, 3467, 29255, 36674, 36678, 36682, 36686, 36690, 36698, 
+    36705, 36709, 36716, 36721, 317, 36726, 36730, 36736, 36748, 36754, 
+    36760, 36764, 36770, 36779, 36783, 36787, 36792, 36798, 36803, 36807, 
+    36812, 36816, 36820, 36827, 36833, 36838, 36853, 36868, 36883, 36899, 
+    36917, 10195, 36931, 36938, 36942, 36945, 36954, 36959, 36963, 36971, 
+    33919, 36979, 36983, 36993, 37004, 29225, 37017, 37021, 37030, 37038, 
+    9785, 14913, 37042, 22447, 37045, 30173, 37050, 9784, 37055, 37061, 
+    37066, 37072, 37077, 37083, 37088, 37094, 37099, 37105, 37111, 37117, 
+    37122, 37078, 37084, 37089, 37095, 37100, 37106, 37112, 8126, 3874, 
+    37126, 37134, 37138, 37141, 37145, 37150, 37155, 37161, 37167, 37172, 
+    37176, 25976, 37180, 37184, 37190, 37194, 9049, 37203, 37210, 37214, 
+    11875, 37221, 37227, 37232, 37239, 37246, 37253, 28571, 8049, 37260, 
+    37267, 37274, 37280, 37285, 37292, 37303, 37309, 37314, 37319, 37324, 
+    37331, 37079, 37335, 37345, 37356, 37362, 37367, 37372, 37377, 37382, 
+    37387, 37391, 37395, 37401, 37409, 2319, 865, 10261, 10273, 10278, 10284, 
+    37418, 10289, 10294, 10300, 37423, 37433, 37437, 10305, 37442, 16903, 
+    37445, 37450, 37454, 37459, 37464, 37471, 37478, 37482, 37485, 37493, 
+    10208, 37500, 37503, 37509, 37519, 5929, 37528, 37532, 37540, 37544, 
+    37554, 37560, 37571, 37577, 37583, 37588, 37594, 37600, 37606, 37611, 
+    37614, 37621, 37627, 37632, 37639, 37646, 37650, 37660, 37673, 37682, 
+    37691, 37702, 37715, 37726, 37735, 37746, 37751, 37760, 37765, 10310, 
+    37771, 37778, 37786, 37791, 37795, 37802, 37809, 3829, 16, 37813, 37818, 
+    16757, 37822, 37825, 37828, 28077, 37832, 28580, 37840, 37844, 37848, 
+    37851, 37857, 37101, 37863, 37871, 37877, 37884, 28060, 37888, 28254, 
+    37892, 37901, 37907, 37913, 37918, 37922, 37928, 37932, 37940, 37948, 
+    26194, 37954, 37961, 37967, 37972, 37977, 37981, 37987, 37992, 37998, 
+    4056, 791, 38005, 38009, 38012, 15275, 38024, 35851, 38035, 38038, 38045, 
+    38049, 38055, 38059, 38065, 38070, 38076, 38081, 38086, 38090, 38094, 
+    38099, 38104, 38114, 38120, 38133, 38139, 38145, 38152, 38157, 38163, 
+    38168, 16643, 1472, 1019, 31218, 31224, 38173, 31230, 31243, 31249, 
+    31255, 38179, 31261, 31267, 38185, 38191, 22, 38199, 38206, 38210, 38214, 
+    38222, 31978, 38226, 38230, 38237, 38242, 38246, 38251, 38257, 38262, 
+    38268, 38273, 38277, 38281, 38285, 38290, 38294, 38299, 38303, 38310, 
+    38315, 38319, 38324, 38328, 38333, 38337, 38342, 38348, 15495, 15500, 
+    38353, 38357, 38360, 38364, 21183, 38369, 38373, 38379, 38386, 38391, 
+    38401, 38406, 38414, 38418, 38421, 31993, 38425, 4109, 38430, 38435, 
+    38439, 38444, 38448, 38453, 13375, 38464, 38468, 38471, 38476, 38480, 
+    38484, 38487, 38491, 8145, 13391, 38494, 38497, 38503, 38508, 38514, 
+    38519, 38525, 38530, 38536, 38541, 38547, 38553, 38559, 38564, 38568, 
+    38572, 38581, 38597, 38613, 38623, 27967, 38630, 38634, 38639, 38644, 
+    38648, 38652, 35972, 38658, 38663, 38667, 38674, 38679, 38683, 38687, 
+    26996, 38693, 21451, 38698, 38705, 38713, 38719, 38726, 38734, 38740, 
+    38744, 38750, 38758, 38762, 38771, 9509, 38779, 38783, 38791, 38798, 
+    38803, 38808, 38812, 38815, 38819, 38822, 38826, 38833, 38838, 38844, 
+    26415, 31281, 38848, 38855, 38861, 38867, 38872, 38875, 38877, 38884, 
+    38891, 38897, 38901, 38904, 38908, 38912, 38916, 38921, 38925, 38929, 
+    38932, 38936, 38950, 23062, 38969, 38982, 38995, 39008, 23080, 39023, 
+    10497, 39038, 39044, 39048, 39052, 39059, 39064, 39068, 39075, 39081, 
+    39086, 39092, 39102, 39114, 39125, 39130, 39137, 39141, 39145, 39148, 
+    15891, 3677, 39156, 15522, 39169, 39176, 39180, 39184, 39189, 39194, 
+    39200, 39204, 39208, 39211, 7742, 15533, 39216, 39220, 39226, 39235, 
+    39240, 39247, 35828, 39253, 39258, 39262, 39267, 39274, 39278, 39281, 
+    39285, 39290, 14565, 39297, 39304, 1077, 39308, 39313, 39318, 39324, 
+    39329, 39334, 39338, 39348, 39353, 39359, 39364, 39370, 39375, 39381, 
+    39391, 39396, 39401, 39405, 7229, 7241, 39410, 39413, 39420, 39426, 
+    34084, 34091, 39435, 39439, 32041, 39447, 39458, 39466, 36020, 39473, 
+    39478, 39483, 39494, 39501, 39512, 32065, 21457, 39520, 735, 39525, 
+    39531, 28051, 39537, 39542, 39552, 39561, 39568, 39574, 39578, 39581, 
+    39588, 39594, 39601, 39607, 39617, 39625, 39631, 39637, 39642, 39646, 
+    39653, 39659, 39666, 38917, 535, 13818, 39672, 39677, 39680, 39686, 
+    39694, 1396, 39699, 39703, 39708, 39715, 39721, 39725, 39729, 39734, 
+    39743, 39750, 39760, 39766, 28095, 39783, 39792, 39800, 39806, 39811, 
+    39818, 39824, 39832, 39841, 39849, 39853, 39858, 39866, 32074, 39872, 
+    39891, 15824, 39905, 39921, 39935, 39941, 39946, 39951, 39956, 39962, 
+    32080, 39967, 39974, 39979, 39983, 345, 2936, 39990, 39995, 40000, 27322, 
+    39821, 40004, 40009, 40017, 40021, 40024, 40030, 40036, 40040, 28150, 
+    40043, 40048, 40052, 40055, 40060, 40064, 40069, 40074, 40078, 40083, 
+    40087, 40091, 21179, 21190, 40095, 40100, 40106, 26953, 40111, 40115, 
+    21266, 16072, 40118, 40123, 40128, 40133, 40138, 40143, 40148, 40153, 
+    450, 49, 31299, 31304, 31309, 31315, 31320, 31325, 40158, 31329, 40162, 
+    40166, 40170, 31334, 31340, 40184, 31351, 31356, 40192, 40197, 31362, 
+    40202, 40207, 40212, 40217, 40223, 40229, 40235, 31379, 40248, 40254, 
+    31383, 40258, 31388, 40263, 31393, 31398, 40266, 40271, 40275, 30948, 
+    40281, 13599, 40288, 40293, 31403, 40297, 40302, 40307, 40312, 40316, 
+    40321, 40326, 40332, 40337, 40342, 40348, 40354, 40359, 40363, 40368, 
+    40373, 40378, 40382, 40387, 40392, 40397, 40403, 40409, 40415, 40420, 
+    40424, 40429, 40433, 31407, 31412, 31417, 40437, 40441, 40445, 31422, 
+    31428, 31434, 31446, 40457, 26013, 40461, 40465, 40470, 40475, 40480, 
+    40485, 40489, 40493, 40503, 40508, 40513, 40517, 40521, 40524, 40532, 
+    31494, 40537, 1479, 40543, 40551, 40560, 40564, 40568, 40576, 40582, 
+    40590, 40606, 40610, 40614, 40619, 40634, 31531, 1749, 12055, 40638, 
+    1378, 40650, 40651, 40659, 40666, 40671, 40678, 40683, 9379, 1119, 10332, 
+    40690, 40695, 40698, 40701, 40710, 1286, 40715, 39065, 40722, 40727, 
+    40731, 22503, 2557, 40739, 10741, 40749, 40755, 2337, 2347, 40764, 40773, 
+    40783, 40794, 3293, 34237, 10384, 3807, 16681, 1291, 40799, 40807, 40814, 
+    40819, 40823, 40827, 23875, 10411, 40835, 40844, 40853, 40861, 40868, 
+    40879, 40884, 40897, 40910, 40922, 40934, 40946, 40959, 40970, 40981, 
+    40991, 40999, 41007, 41019, 41031, 41042, 41051, 41059, 41066, 41078, 
+    41085, 41094, 41101, 41114, 41119, 41129, 41134, 41140, 41145, 37211, 
+    41149, 41156, 41160, 41167, 41175, 2518, 41182, 41193, 41203, 41212, 
+    41220, 41230, 41238, 41248, 41257, 41262, 41268, 41274, 3709, 41285, 
+    41295, 41304, 41313, 41323, 41331, 41340, 41345, 41350, 41355, 1705, 37, 
+    41363, 41371, 41382, 41393, 16356, 41403, 41407, 41414, 41420, 41425, 
+    41429, 41440, 41450, 41459, 41470, 16730, 16735, 41475, 41484, 41489, 
+    41499, 41504, 41512, 41520, 41527, 41533, 7078, 228, 41537, 41543, 41548, 
+    41551, 2117, 39181, 41559, 41563, 41566, 1512, 41572, 13980, 1296, 41577, 
+    41590, 41604, 2643, 41622, 41634, 41646, 2657, 2674, 41660, 41673, 2689, 
+    41687, 41699, 2704, 41713, 1302, 1308, 1314, 10659, 41718, 41723, 41728, 
+    41732, 41747, 41762, 41777, 41792, 41807, 41822, 41837, 41852, 41867, 
+    41882, 41897, 41912, 41927, 41942, 41957, 41972, 41987, 42002, 42017, 
+    42032, 42047, 42062, 42077, 42092, 42107, 42122, 42137, 42152, 42167, 
+    42182, 42197, 42212, 42227, 42242, 42257, 42272, 42287, 42302, 42317, 
+    42332, 42347, 42362, 42377, 42392, 42407, 42422, 42437, 42452, 42467, 
+    42482, 42497, 42512, 42527, 42542, 42557, 42572, 42587, 42602, 42617, 
+    42632, 42647, 42662, 42677, 42692, 42707, 42722, 42737, 42752, 42767, 
+    42782, 42797, 42812, 42827, 42842, 42857, 42872, 42887, 42902, 42917, 
+    42932, 42947, 42962, 42977, 42992, 43007, 43022, 43037, 43052, 43067, 
+    43082, 43097, 43112, 43127, 43142, 43157, 43172, 43187, 43202, 43217, 
+    43232, 43247, 43262, 43277, 43292, 43307, 43322, 43337, 43352, 43367, 
+    43382, 43397, 43412, 43427, 43442, 43457, 43472, 43487, 43502, 43517, 
+    43532, 43547, 43562, 43577, 43592, 43607, 43622, 43637, 43652, 43667, 
+    43682, 43697, 43712, 43727, 43742, 43757, 43772, 43787, 43802, 43817, 
+    43832, 43847, 43862, 43877, 43892, 43907, 43922, 43937, 43952, 43967, 
+    43982, 43997, 44012, 44027, 44042, 44057, 44072, 44087, 44102, 44117, 
+    44132, 44147, 44162, 44177, 44192, 44207, 44222, 44237, 44252, 44267, 
+    44282, 44297, 44312, 44327, 44342, 44357, 44372, 44387, 44402, 44417, 
+    44432, 44447, 44462, 44477, 44492, 44507, 44522, 44537, 44552, 44567, 
+    44582, 44597, 44612, 44627, 44642, 44657, 44672, 44687, 44702, 44717, 
+    44732, 44747, 44762, 44777, 44792, 44807, 44822, 44837, 44852, 44867, 
+    44882, 44897, 44912, 44927, 44942, 44957, 44972, 44987, 45002, 45017, 
+    45032, 45047, 45062, 45077, 45092, 45107, 45122, 45137, 45152, 45167, 
+    45182, 45197, 45212, 45227, 45242, 45257, 45272, 45287, 45302, 45317, 
+    45332, 45347, 45362, 45377, 45392, 45407, 45422, 45437, 45452, 45467, 
+    45482, 45497, 45512, 45527, 45542, 45557, 45572, 45587, 45602, 45617, 
+    45632, 45647, 45662, 45677, 45692, 45707, 45722, 45737, 45752, 45767, 
+    45782, 45797, 45812, 45827, 45842, 45857, 45872, 45887, 45902, 45917, 
+    45932, 45947, 45962, 45977, 45992, 46007, 46022, 46037, 46052, 46067, 
+    46082, 46097, 46112, 46127, 46142, 46157, 46172, 46187, 46202, 46217, 
+    46232, 46247, 46262, 46277, 46292, 46307, 46322, 46337, 46352, 46367, 
+    46382, 46397, 46412, 46427, 46442, 46457, 46472, 46487, 46502, 46517, 
+    46532, 46547, 46562, 46577, 46592, 46607, 46622, 46637, 46652, 46667, 
+    46682, 46697, 46712, 46727, 46742, 46757, 46772, 46787, 46802, 46817, 
+    46832, 46847, 46862, 46877, 46892, 46907, 46922, 46937, 46952, 46967, 
+    46982, 46997, 47012, 47027, 47042, 47057, 47072, 47087, 47102, 47117, 
+    47132, 47147, 47162, 47177, 47192, 47207, 47222, 47237, 47252, 47267, 
+    47282, 47297, 47312, 47327, 47342, 47357, 47372, 47387, 47402, 47417, 
+    47432, 47447, 47462, 47477, 47492, 47507, 47522, 47537, 47552, 47567, 
+    47582, 47597, 47612, 47627, 47642, 47657, 47672, 47687, 47702, 47717, 
+    47732, 47747, 47762, 47777, 47792, 47807, 47822, 47837, 47852, 47867, 
+    47882, 47897, 47912, 47927, 47942, 47957, 47972, 47987, 48002, 48017, 
+    48032, 48047, 48062, 48077, 48092, 48107, 48122, 48137, 48152, 48167, 
+    48182, 48197, 48212, 48227, 48242, 48257, 48272, 48287, 48302, 48317, 
+    48332, 48347, 48362, 48377, 48392, 48407, 48422, 48437, 48452, 48467, 
+    48482, 48497, 48512, 48527, 48542, 48557, 48572, 48587, 48602, 48617, 
+    48632, 48647, 48662, 48677, 48692, 48707, 48722, 48737, 48752, 48767, 
+    48782, 48797, 48812, 48827, 48842, 48857, 48872, 48887, 48902, 48917, 
+    48932, 48947, 48962, 48977, 48992, 49007, 49022, 49037, 49052, 49067, 
+    49082, 49097, 49112, 49127, 49142, 49157, 49172, 49187, 49202, 49217, 
+    49232, 49247, 49262, 49277, 49292, 49307, 49322, 49337, 49352, 49367, 
+    49382, 49397, 49412, 49427, 49442, 49457, 49472, 49487, 49502, 49517, 
+    49532, 49548, 49564, 49580, 49596, 49612, 49628, 49644, 49660, 49676, 
+    49692, 49708, 49724, 49740, 49756, 49772, 49788, 49804, 49820, 49836, 
+    49852, 49868, 49884, 49900, 49916, 49932, 49948, 49964, 49980, 49996, 
+    50012, 50028, 50044, 50060, 50076, 50092, 50108, 50124, 50140, 50156, 
+    50172, 50188, 50204, 50220, 50236, 50252, 50268, 50284, 50300, 50316, 
+    50332, 50348, 50364, 50380, 50396, 50412, 50428, 50444, 50460, 50476, 
+    50492, 50508, 50524, 50540, 50556, 50572, 50588, 50604, 50620, 50636, 
+    50652, 50668, 50684, 50700, 50716, 50732, 50748, 50764, 50780, 50796, 
+    50812, 50828, 50844, 50860, 50876, 50892, 50908, 50924, 50940, 50956, 
+    50972, 50988, 51004, 51020, 51036, 51052, 51068, 51084, 51100, 51116, 
+    51132, 51148, 51164, 51180, 51196, 51212, 51228, 51244, 51260, 51276, 
+    51292, 51308, 51324, 51340, 51356, 51372, 51388, 51404, 51420, 51436, 
+    51452, 51468, 51484, 51500, 51516, 51532, 51548, 51564, 51580, 51596, 
+    51612, 51628, 51644, 51660, 51676, 51692, 51708, 51724, 51740, 51756, 
+    51772, 51788, 51804, 51820, 51836, 51852, 51868, 51884, 51900, 51916, 
+    51932, 51948, 51964, 51980, 51996, 52012, 52028, 52044, 52060, 52076, 
+    52092, 52108, 52124, 52140, 52156, 52172, 52188, 52204, 52220, 52236, 
+    52252, 52268, 52284, 52300, 52316, 52332, 52348, 52364, 52380, 52396, 
+    52412, 52428, 52444, 52460, 52476, 52492, 52508, 52524, 52540, 52556, 
+    52572, 52588, 52604, 52620, 52636, 52652, 52668, 52684, 52700, 52716, 
+    52732, 52748, 52764, 52780, 52796, 52812, 52828, 52844, 52860, 52876, 
+    52892, 52908, 52924, 52940, 52956, 52972, 52988, 53004, 53020, 53036, 
+    53052, 53068, 53084, 53100, 53116, 53132, 53148, 53164, 53180, 53196, 
+    53212, 53228, 53244, 53260, 53276, 53292, 53308, 53324, 53340, 53356, 
+    53372, 53388, 53404, 53420, 53436, 53452, 53468, 53484, 53500, 53516, 
+    53532, 53548, 53564, 53580, 53596, 53612, 53628, 53644, 53660, 53676, 
+    53692, 53708, 53724, 53740, 53756, 53772, 53788, 53804, 53820, 53836, 
+    53852, 53868, 53884, 53900, 53916, 53932, 53948, 53964, 53980, 53996, 
+    54012, 54028, 54044, 54060, 54076, 54092, 54108, 54124, 54140, 54156, 
+    54172, 54188, 54204, 54220, 54236, 54252, 54268, 54284, 54300, 54316, 
+    54332, 54348, 54364, 54380, 54396, 54412, 54428, 54444, 54460, 54476, 
+    54492, 54508, 54524, 54540, 54556, 54572, 54588, 54604, 54620, 54636, 
+    54652, 54668, 54684, 54700, 54716, 54732, 54748, 54764, 54780, 54796, 
+    54812, 54828, 54844, 54860, 54876, 54892, 54908, 54924, 54940, 54956, 
+    54972, 54988, 55004, 55020, 55036, 55052, 55068, 55084, 55100, 55116, 
+    55132, 55148, 55164, 55180, 55196, 55212, 55228, 55244, 55260, 55276, 
+    55292, 55308, 55324, 55340, 55356, 55372, 55388, 55404, 55420, 55436, 
+    55452, 55468, 55484, 55500, 55516, 55532, 55548, 55564, 55580, 55596, 
+    55612, 55628, 55644, 55660, 55676, 55692, 55708, 55724, 55740, 55756, 
+    55772, 55788, 55804, 55820, 55836, 55852, 55868, 55884, 55900, 55916, 
+    55932, 55948, 55964, 55980, 55996, 56012, 56028, 56044, 56060, 56076, 
+    56092, 56108, 56124, 56140, 56156, 56172, 56188, 56204, 56220, 56236, 
+    56252, 56268, 56284, 56300, 56316, 56332, 56348, 56364, 56380, 56396, 
+    56412, 56428, 56444, 56460, 56476, 56492, 56508, 56524, 56540, 56556, 
+    56572, 56588, 56604, 56620, 56636, 56652, 56668, 56684, 56700, 56716, 
+    56732, 56748, 56764, 56780, 56796, 56812, 56828, 56844, 56860, 56876, 
+    56892, 56908, 56924, 56940, 56956, 56972, 56988, 57004, 57020, 57036, 
+    57052, 57068, 57084, 57100, 57116, 57132, 57148, 57164, 57180, 57196, 
+    57212, 57228, 57244, 57260, 57276, 57292, 57308, 57324, 57340, 57356, 
+    57372, 57388, 57404, 57420, 57436, 57452, 57468, 57484, 57500, 57516, 
+    57532, 57548, 57564, 57580, 57596, 57612, 57628, 57644, 57660, 57676, 
+    57692, 57708, 57724, 57740, 57756, 57772, 57788, 57804, 57820, 57836, 
+    57852, 57868, 57884, 57900, 57916, 57932, 57948, 57964, 57980, 57996, 
+    58012, 58028, 58044, 58060, 58076, 58092, 58108, 58124, 58140, 58156, 
+    58172, 58188, 58204, 58219, 16762, 58228, 58234, 58240, 58250, 58258, 
+    14894, 15445, 9960, 58271, 1520, 58279, 3761, 27432, 7183, 58285, 58290, 
+    58295, 58300, 58305, 58311, 58316, 58322, 58327, 58333, 58338, 58343, 
+    58348, 58353, 58359, 58364, 58369, 58374, 58379, 58384, 58389, 58394, 
+    58400, 58405, 58411, 58418, 2561, 58423, 58429, 8526, 58433, 58438, 
+    58445, 58453, 40, 58457, 58463, 58468, 58473, 58477, 58482, 58486, 58490, 
+    10684, 58494, 58504, 58517, 58528, 58541, 58548, 58554, 58559, 58565, 
+    58571, 58577, 58582, 58587, 58592, 58597, 58601, 58606, 58611, 58616, 
+    58622, 58628, 58634, 58639, 58643, 58648, 58653, 58657, 58662, 58667, 
+    58672, 58676, 10700, 10711, 10716, 1563, 58680, 1568, 58686, 16239, 
+    58689, 58695, 1599, 58701, 1605, 1611, 10746, 58706, 58714, 58721, 58725, 
+    58731, 58736, 30977, 58741, 58748, 58753, 58757, 58761, 1616, 16331, 
+    58770, 58774, 16342, 1125, 58778, 58785, 58790, 58794, 16367, 1620, 
+    37350, 58797, 58802, 58812, 58821, 58826, 58830, 58836, 1625, 39259, 
+    58841, 58850, 58856, 58861, 10904, 10910, 58867, 58879, 58896, 58913, 
+    58930, 58947, 58964, 58981, 58998, 59015, 59032, 59049, 59066, 59083, 
+    59100, 59117, 59134, 59151, 59168, 59185, 59202, 59219, 59236, 59253, 
+    59270, 59287, 59304, 59321, 59338, 59355, 59372, 59389, 59406, 59423, 
+    59440, 59457, 59474, 59491, 59508, 59525, 59542, 59559, 59576, 59593, 
+    59610, 59627, 59644, 59661, 59678, 59695, 59712, 59723, 59728, 1630, 
+    59732, 59738, 59743, 59748, 9326, 1635, 59754, 59763, 27731, 59768, 
+    59779, 59789, 59794, 59801, 59807, 59812, 59817, 16619, 59821, 10921, 
+    1640, 10926, 59827, 59832, 59838, 59843, 59848, 59853, 59858, 59863, 
+    59868, 59873, 59879, 59885, 59891, 59896, 59900, 59905, 59910, 59914, 
+    59919, 59924, 59929, 59933, 59938, 59944, 59949, 59954, 59958, 59963, 
+    59968, 59974, 59979, 59984, 59990, 59996, 60001, 60005, 60010, 60015, 
+    60020, 60024, 60029, 60034, 60039, 60045, 60051, 60056, 60060, 60064, 
+    60069, 60074, 60079, 29129, 60083, 60088, 60093, 60099, 60104, 60109, 
+    60113, 60118, 60123, 60129, 60134, 60139, 60145, 60151, 60156, 60160, 
+    60165, 60170, 60174, 60179, 60184, 60189, 60195, 60201, 60206, 60210, 
+    60215, 60220, 60224, 60229, 60234, 60239, 60243, 60246, 31639, 60251, 
+    60259, 16685, 3663, 11017, 60265, 60275, 60290, 11022, 60301, 60306, 
+    60317, 60329, 60341, 60353, 2695, 60365, 60370, 60382, 60386, 60392, 
+    60398, 60403, 1652, 1078, 60412, 60417, 39309, 60421, 60425, 60430, 
+    60434, 16770, 60439, 60442, 60450, 60458, 1656, 11047, 11053, 1661, 
+    60466, 60473, 60478, 60487, 60497, 60504, 60509, 60514, 1666, 60521, 
+    60526, 16885, 60530, 60535, 60542, 60548, 60552, 60563, 60573, 16907, 
+    9234, 9241, 1671, 60580, 60586, 60594, 60601, 60607, 60614, 60626, 60632, 
+    60637, 60649, 60660, 60669, 60679, 3740, 30813, 30822, 16947, 1676, 1680, 
+    60687, 60698, 60703, 1683, 60711, 60716, 16998, 60728, 60734, 60739, 
+    60747, 1688, 60752, 60757, 60765, 60773, 60780, 60789, 60797, 60806, 
+    1693, 60810, 1698, 60815, 60822, 17072, 60830, 60836, 60841, 60849, 
+    60856, 60864, 22574, 60869, 11182, 60878, 60884, 60891, 60898, 60904, 
+    60914, 60920, 60925, 60936, 60941, 60949, 11191, 11196, 60957, 60963, 
+    60971, 3805, 17114, 39397, 60976, 60982, 60987, 60995, 61002, 12036, 
+    61007, 61013, 1709, 61018, 61021, 1132, 61027, 61032, 61037, 61043, 
+    61048, 61053, 61058, 61063, 61068, 61073, 1718, 9, 61079, 61083, 61088, 
+    61092, 61096, 61100, 31879, 61105, 61110, 61115, 61119, 61122, 61126, 
+    61130, 61135, 61139, 61144, 61148, 34616, 34621, 34626, 61151, 61158, 
+    61164, 39118, 61174, 34632, 32137, 31894, 31900, 34648, 31906, 61179, 
+    61184, 32170, 61188, 61191, 61195, 61202, 61205, 61210, 61214, 61218, 
+    61221, 61231, 61243, 61250, 61256, 61263, 33573, 61266, 8543, 877, 61269, 
+    61273, 61278, 3690, 61282, 61285, 13632, 61292, 61299, 61312, 61320, 
+    61329, 61338, 61343, 61353, 61366, 61378, 61385, 61390, 61399, 61412, 
+    36060, 61430, 61435, 61442, 61448, 656, 61453, 61461, 61468, 27271, 627, 
+    61474, 61480, 61490, 61496, 61501, 31924, 6003, 31938, 61505, 61515, 
+    61520, 61530, 61545, 61551, 61557, 31948, 61562, 31094, 61566, 61571, 
+    61576, 61580, 61585, 16950, 61592, 61597, 61601, 6044, 31974, 61605, 
+    61611, 312, 61621, 61628, 61635, 61640, 61649, 58806, 61655, 61663, 
+    61667, 61671, 61675, 61679, 61684, 61688, 61694, 61702, 61707, 61712, 
+    61716, 61721, 61725, 61729, 61735, 61741, 61746, 61750, 32098, 61755, 
+    32104, 32110, 61760, 61766, 61773, 61778, 61782, 31111, 16612, 61785, 
+    61789, 61794, 61801, 61807, 61811, 61816, 38828, 61822, 61826, 61830, 
+    61835, 61841, 61847, 61859, 61868, 61878, 61884, 61891, 61896, 61901, 
+    61905, 61908, 61914, 61921, 61926, 61931, 61938, 61945, 61951, 61956, 
+    61961, 61969, 32115, 2423, 61974, 61979, 61985, 61990, 61996, 62001, 
+    62006, 62011, 62017, 32136, 62022, 62028, 62034, 62040, 32200, 62045, 
+    62050, 62055, 32211, 62060, 62065, 62070, 62076, 62082, 32216, 62087, 
+    62092, 62097, 32271, 32277, 62102, 62107, 32282, 62112, 27958, 32304, 
+    32308, 62117, 62093, 62121, 62129, 62135, 62143, 62150, 62156, 62166, 
+    62172, 62179, 10631, 32322, 62185, 62198, 62207, 62213, 62222, 62228, 
+    23512, 62235, 62242, 62252, 32272, 62255, 62262, 62267, 62271, 62275, 
+    62280, 6120, 62284, 62289, 62294, 34710, 34715, 62298, 34729, 62303, 
+    34734, 62308, 62314, 34746, 34752, 34758, 62319, 62325, 22539, 62336, 
+    62339, 62351, 62359, 32345, 62363, 62372, 62382, 62391, 32355, 62396, 
+    62403, 62412, 62418, 62426, 62433, 6095, 4397, 62438, 32283, 62444, 
+    62447, 62453, 62460, 62465, 62470, 23422, 62474, 62480, 62486, 62491, 
+    62496, 62500, 62506, 62512, 33483, 863, 35723, 36644, 36650, 32391, 
+    62517, 62521, 62525, 62528, 62541, 62547, 62551, 62554, 62559, 33786, 
+    62563, 31116, 21287, 62569, 6024, 6032, 9075, 62572, 62577, 62582, 62587, 
+    62592, 62597, 62602, 62607, 62612, 62617, 62623, 62628, 62633, 62639, 
+    62644, 62649, 62654, 62659, 62664, 62669, 62675, 62680, 62686, 62691, 
+    62696, 62701, 62706, 62711, 62716, 62721, 62726, 62731, 62736, 62742, 
+    62747, 62752, 62757, 62762, 62767, 62772, 62778, 62783, 62788, 62793, 
+    62798, 62803, 62808, 62813, 62818, 62823, 62829, 62834, 62839, 62844, 
+    62849, 62855, 62861, 62866, 62872, 62877, 62882, 62887, 62892, 62897, 
+    1513, 245, 62902, 62906, 62910, 62914, 25133, 62918, 62922, 62927, 62931, 
+    62936, 62940, 62945, 62950, 62955, 62959, 62963, 62968, 62972, 13369, 
+    62977, 62981, 62988, 62998, 15206, 63007, 63016, 63020, 63025, 63030, 
+    63034, 24924, 3019, 63038, 63044, 17363, 63048, 63057, 63065, 63071, 
+    63083, 63095, 63099, 63104, 63108, 63114, 63120, 63125, 63135, 63145, 
+    63151, 63156, 63160, 63165, 63171, 63180, 63189, 63197, 15560, 63201, 
+    63210, 63218, 63230, 63241, 63252, 63261, 63265, 63274, 63284, 63292, 
+    63298, 63303, 63309, 63314, 98, 30925, 63325, 26266, 26276, 63331, 63338, 
+    63344, 63348, 63358, 63369, 63377, 63386, 63391, 63396, 63400, 17317, 
+    63408, 63412, 63418, 63428, 63435, 63441, 34809, 63447, 63449, 63452, 
+    63456, 63466, 63472, 63479, 13315, 63486, 63492, 63501, 63510, 63516, 
+    63522, 63528, 63533, 63540, 63547, 63553, 63566, 63575, 63584, 63589, 
+    63593, 63599, 63606, 63613, 63620, 63627, 63634, 63639, 63643, 63647, 
+    63650, 63660, 63664, 63676, 63685, 63689, 63694, 63698, 63704, 63709, 
+    63716, 63725, 63733, 63741, 63746, 63750, 63755, 63760, 63770, 63778, 
+    63783, 63787, 63791, 63797, 63809, 63817, 63827, 63834, 63840, 63845, 
+    63849, 63853, 63857, 63866, 63875, 63884, 63890, 63896, 63902, 63907, 
+    63914, 63920, 63928, 63935, 12463, 63941, 63947, 63951, 14244, 63955, 
+    63960, 63970, 63979, 63985, 63991, 63999, 64006, 64010, 64014, 64020, 
+    64028, 64035, 64041, 64052, 64056, 64060, 64064, 64067, 64073, 64078, 
+    64082, 64086, 64095, 64103, 64110, 64116, 64123, 24046, 38870, 64128, 
+    64136, 64140, 64144, 64147, 64155, 64162, 64168, 64177, 64185, 64191, 
+    64196, 64200, 64205, 64209, 64213, 64218, 64227, 64231, 64238, 64245, 
+    64251, 64259, 64265, 64276, 64284, 64290, 22669, 64299, 64306, 64313, 
+    64320, 64327, 64334, 41907, 13153, 64341, 64348, 64353, 34845, 6217, 
+    64359, 64364, 64369, 64375, 64381, 64387, 64392, 64397, 64402, 64407, 
+    64413, 64418, 64424, 64429, 64435, 64440, 64445, 64450, 64455, 64460, 
+    64465, 64470, 64476, 64481, 64487, 64492, 64497, 64502, 64507, 64512, 
+    64517, 64523, 64528, 64533, 64538, 64543, 64548, 64553, 64558, 64563, 
+    64568, 64573, 64579, 64584, 64589, 64594, 64599, 64604, 64609, 64614, 
+    64619, 64625, 64630, 64635, 64640, 64645, 64650, 64655, 64660, 64665, 
+    64670, 64675, 64680, 64685, 64691, 1834, 224, 37446, 64696, 64699, 64704, 
+    64708, 64711, 64716, 63737, 64727, 64737, 64744, 64760, 64769, 64779, 
+    64789, 64797, 64811, 64819, 64823, 64826, 64833, 64839, 64850, 64862, 
+    64873, 64882, 64889, 1297, 23311, 64899, 2590, 64903, 64912, 1138, 17290, 
+    38083, 64920, 64928, 64942, 64955, 64959, 64964, 64969, 64974, 64980, 
+    64986, 64991, 8535, 64996, 65000, 65008, 11048, 65013, 65019, 65028, 
+    1721, 11060, 736, 65032, 65041, 65051, 27030, 65060, 65066, 16862, 65072, 
+    65076, 3964, 11391, 65082, 65089, 60693, 65093, 65097, 3988, 189, 14159, 
+    65103, 65115, 65119, 65125, 27751, 65129, 11379, 2730, 4, 65134, 65144, 
+    65150, 65161, 65168, 65174, 65180, 65188, 65195, 65201, 65211, 65221, 
+    65231, 23499, 1309, 65240, 65244, 65248, 65254, 65258, 2753, 2759, 8532, 
+    2264, 65262, 65266, 65275, 65283, 65294, 65302, 65310, 65316, 65321, 
+    65332, 65343, 65351, 65357, 9694, 65362, 65370, 65374, 65378, 65382, 
+    65394, 28136, 65401, 65411, 65417, 65423, 9796, 65433, 65444, 65454, 
+    65463, 65467, 65474, 1140, 1170, 65484, 65489, 65497, 65505, 65516, 
+    65523, 65537, 14088, 393, 65547, 65551, 65559, 65568, 65576, 65582, 
+    65596, 65603, 65609, 65618, 65625, 65635, 65643, 3812, 156, 65651, 65662, 
+    65666, 65678, 27949, 161, 65684, 65689, 65693, 65700, 65706, 65714, 
+    65721, 8818, 65728, 65737, 65745, 3878, 65758, 8199, 65762, 2798, 443, 
+    65767, 65780, 65785, 1833, 650, 65789, 3895, 65797, 65803, 65807, 931, 
+    65817, 65826, 65831, 14928, 14935, 45269, 65835, 3822, 13041, 65843, 
+    65850, 23555, 65854, 65861, 65867, 65872, 65877, 14948, 372, 65882, 
+    65894, 65900, 65908, 2810, 1753, 65916, 65918, 65923, 65928, 65933, 
+    65939, 65944, 65949, 65954, 65959, 65964, 65969, 65975, 65980, 65985, 
+    65990, 65995, 66000, 66005, 66010, 66015, 66021, 66026, 66031, 66036, 
+    66042, 66047, 66053, 66058, 66063, 66068, 66073, 66078, 66083, 66088, 
+    66094, 66099, 66105, 66110, 66115, 66120, 66125, 66130, 66135, 66140, 
+    66145, 66151, 66156, 66161, 66166, 66170, 66174, 66179, 66183, 66188, 
+    66193, 66199, 66204, 66208, 66213, 66217, 66220, 66222, 66226, 66229, 
+    66234, 66238, 66242, 66246, 66250, 66259, 66263, 32549, 66266, 32554, 
+    66273, 66278, 32559, 66287, 66296, 32565, 66301, 32570, 66310, 66315, 
+    11578, 66319, 66324, 66329, 32575, 66333, 40225, 66337, 66340, 66344, 
+    8211, 66350, 66355, 66359, 3705, 32580, 66362, 66366, 66369, 66374, 
+    66378, 66384, 66392, 66405, 66414, 66420, 66425, 66431, 66435, 66441, 
+    66449, 66454, 66458, 66465, 66471, 66479, 66488, 66496, 32583, 66503, 
+    66513, 66522, 66535, 66540, 66545, 66554, 66560, 66567, 66578, 66590, 
+    66597, 66606, 66615, 66624, 66631, 66637, 66644, 66652, 66659, 66667, 
+    66676, 66684, 66691, 66699, 66708, 66716, 66725, 66735, 66744, 66752, 
+    66759, 66767, 66776, 66784, 66793, 66803, 66812, 66820, 66829, 66839, 
+    66848, 66858, 66869, 66879, 66888, 66896, 66903, 66911, 66920, 66928, 
+    66937, 66947, 66956, 66964, 66973, 66983, 66992, 67002, 67013, 67023, 
+    67032, 67040, 67049, 67059, 67068, 67078, 67089, 67099, 67108, 67118, 
+    67129, 67139, 67150, 67162, 67173, 67183, 67192, 67200, 67207, 67215, 
+    67224, 67232, 67241, 67251, 67260, 67268, 67277, 67287, 67296, 67306, 
+    67317, 67327, 67336, 67344, 67353, 67363, 67372, 67382, 67393, 67403, 
+    67412, 67422, 67433, 67443, 67454, 67466, 67477, 67487, 67496, 67504, 
+    67513, 67523, 67532, 67542, 67553, 67563, 67572, 67582, 67593, 67603, 
+    67614, 67626, 67637, 67647, 67656, 67666, 67677, 67687, 67698, 67710, 
+    67721, 67731, 67742, 67754, 67765, 67777, 67790, 67802, 67813, 67823, 
+    67832, 67840, 67847, 67855, 67864, 67872, 67881, 67891, 67900, 67908, 
+    67917, 67927, 67936, 67946, 67957, 67967, 67976, 67984, 67993, 68003, 
+    68012, 68022, 68033, 68043, 68052, 68062, 68073, 68083, 68094, 68106, 
+    68117, 68127, 68136, 68144, 68153, 68163, 68172, 68182, 68193, 68203, 
+    68212, 68222, 68233, 68243, 68254, 68266, 68277, 68287, 68296, 68306, 
+    68317, 68327, 68338, 68350, 68361, 68371, 68382, 68394, 68405, 68417, 
+    68430, 68442, 68453, 68463, 68472, 68480, 68489, 68499, 68508, 68518, 
+    68529, 68539, 68548, 68558, 68569, 68579, 68590, 68602, 68613, 68623, 
+    68632, 68642, 68653, 68663, 68674, 68686, 68697, 68707, 68718, 68730, 
+    68741, 68753, 68766, 68778, 68789, 68799, 68808, 68818, 68829, 68839, 
+    68850, 68862, 68873, 68883, 68894, 68906, 68917, 68929, 68942, 68954, 
+    68965, 68975, 68986, 68998, 69009, 69021, 69034, 69046, 69057, 69069, 
+    69082, 69094, 69107, 69121, 69134, 69146, 69157, 69167, 69176, 69184, 
+    69191, 69196, 8058, 69203, 32593, 69208, 69213, 32598, 69219, 20929, 
+    32603, 69224, 69230, 69238, 69244, 69250, 69257, 69264, 69269, 69273, 
+    69276, 69280, 69289, 69295, 69307, 69318, 69322, 3081, 8033, 69327, 
+    69330, 69332, 69336, 69340, 69344, 69350, 69355, 25944, 69360, 69364, 
+    69367, 69372, 69376, 69383, 69389, 69393, 6170, 69397, 32620, 69402, 
+    69409, 69418, 69426, 69437, 69445, 69453, 69460, 69467, 69473, 69484, 
+    32625, 69489, 69500, 69512, 69520, 69531, 69540, 69551, 69556, 69564, 
+    2556, 69569, 34295, 69582, 69586, 69598, 69606, 69611, 69619, 17485, 
+    69630, 69636, 69643, 69651, 69657, 32635, 69662, 3914, 58254, 69669, 
+    69672, 69680, 69693, 69706, 69719, 69732, 69739, 69750, 69759, 41724, 
+    41729, 69764, 69768, 69776, 69783, 69792, 69800, 69806, 69815, 69823, 
+    69831, 69835, 69844, 69853, 69863, 69876, 69889, 69899, 32640, 69905, 
+    69912, 69918, 32646, 69923, 69926, 69930, 69938, 69947, 41462, 69955, 
+    69964, 69972, 69979, 69987, 69997, 70006, 70015, 70024, 70032, 70043, 
+    70053, 9366, 21567, 70062, 70067, 70072, 70076, 70080, 70085, 70091, 
+    70096, 70101, 70107, 70112, 70117, 21532, 70122, 70129, 70137, 70145, 
+    70150, 70157, 70164, 70169, 70173, 70177, 70185, 70193, 32663, 70199, 
+    70205, 70217, 70223, 70227, 70234, 70239, 70250, 70260, 70270, 70282, 
+    70288, 70298, 70308, 32690, 70317, 70326, 70332, 70344, 70355, 70362, 
+    70367, 70371, 70379, 70385, 70390, 70395, 70402, 70410, 70422, 70432, 
+    70441, 70450, 70457, 34157, 23851, 70463, 70468, 70472, 70476, 70481, 
+    70487, 70498, 70511, 70516, 70523, 32695, 70528, 70540, 70549, 70559, 
+    70570, 70583, 70590, 70599, 70608, 70616, 70621, 70627, 1069, 70632, 
+    70637, 70642, 70647, 70653, 70658, 70663, 70669, 70675, 70680, 70684, 
+    70689, 70694, 70699, 58766, 70704, 70709, 70714, 70719, 70725, 70731, 
+    70736, 70740, 70745, 70750, 70755, 70761, 70766, 70772, 70777, 70782, 
+    70787, 70792, 70796, 70802, 70807, 70816, 70821, 70826, 70831, 70836, 
+    70840, 70847, 70853, 17135, 17142, 70858, 70862, 70866, 70870, 70874, 
+    45524, 70878, 70808, 70880, 70890, 32704, 70893, 70902, 70908, 6143, 
+    32709, 70912, 70918, 70923, 70929, 70934, 70938, 70945, 70950, 70960, 
+    70969, 70973, 70979, 70985, 70991, 70995, 71003, 71010, 71018, 71026, 
+    32714, 71033, 71036, 71043, 71049, 71054, 71058, 71064, 71071, 71076, 
+    71080, 71089, 71097, 71103, 71108, 32719, 71115, 71122, 71128, 71133, 
+    71139, 71146, 71152, 21294, 27455, 71158, 71163, 71169, 71181, 70841, 
+    70848, 21470, 71191, 71196, 71203, 71209, 71216, 71222, 71233, 71238, 
+    9110, 71246, 71249, 71255, 71259, 71263, 71266, 71272, 32468, 6194, 964, 
+    13419, 71279, 71285, 71291, 71297, 71303, 71309, 71315, 71321, 71327, 
+    71332, 71337, 71342, 71347, 71352, 71357, 71362, 71367, 71372, 71377, 
+    71382, 71387, 71392, 71398, 71403, 71408, 71414, 71419, 71424, 71430, 
+    71436, 71442, 71448, 71454, 71460, 71466, 71472, 71478, 71483, 71488, 
+    71494, 71499, 71504, 71510, 71515, 71520, 71525, 71530, 71535, 71540, 
+    71545, 71550, 71555, 71560, 71565, 71570, 71576, 71581, 71586, 71591, 
+    71597, 71602, 71607, 71612, 71617, 71623, 71628, 71633, 71638, 71643, 
+    71648, 71653, 71658, 71663, 71668, 71673, 71678, 71683, 71688, 71693, 
+    71698, 71703, 71708, 71713, 71718, 71724, 71729, 71734, 71739, 71744, 
+    71749, 71754, 71759, 1864, 142, 71764, 71768, 71772, 71777, 71785, 71789, 
+    71796, 71804, 71808, 71821, 71829, 71833, 71836, 71841, 71845, 71850, 
+    71854, 71862, 71866, 20937, 71871, 71875, 60967, 71879, 71882, 71890, 
+    71898, 71906, 71911, 71918, 71924, 71930, 71935, 71942, 71947, 71955, 
+    64947, 71962, 71967, 71972, 71976, 11645, 71980, 71985, 71990, 71994, 
+    71997, 72003, 72007, 72017, 72026, 72029, 72033, 72040, 72053, 72059, 
+    72067, 72078, 72089, 72100, 72111, 72120, 72126, 72135, 72143, 72153, 
+    72166, 72173, 72184, 72190, 72195, 72200, 72206, 72212, 72222, 72231, 
+    70530, 72239, 72245, 72253, 72259, 72267, 72270, 72274, 72278, 72281, 
+    72287, 72293, 72301, 72313, 72325, 72332, 72336, 72347, 72355, 72362, 
+    72374, 72382, 72390, 72397, 72403, 72413, 72422, 72427, 72437, 72446, 
+    40788, 72453, 72457, 72462, 72470, 72477, 72483, 72487, 72497, 72508, 
+    72516, 72523, 72535, 72547, 72556, 69572, 72563, 72574, 72588, 72596, 
+    72606, 72613, 72621, 72633, 72642, 72650, 72660, 72671, 72683, 72692, 
+    72702, 72709, 72718, 72733, 72741, 72751, 72760, 72768, 72781, 72796, 
+    72800, 72809, 72821, 72832, 72843, 72854, 72864, 72875, 72883, 72889, 
+    72899, 72907, 72913, 29028, 72918, 72924, 72929, 72936, 9708, 17505, 
+    72942, 72951, 72956, 72960, 72967, 72973, 72978, 72983, 72991, 72999, 
+    73003, 73006, 73009, 73011, 73018, 73024, 73035, 73040, 73044, 73051, 
+    73057, 73062, 73070, 65446, 65456, 73076, 73083, 73093, 10618, 73100, 
+    73105, 29224, 73114, 73119, 73126, 73136, 73144, 73152, 73161, 73167, 
+    73173, 73180, 73187, 73192, 73196, 73204, 73209, 73214, 73222, 73229, 
+    73234, 73240, 73243, 73247, 73256, 71816, 73265, 73269, 73275, 73286, 
+    73296, 17514, 73307, 73315, 17526, 73322, 73326, 73335, 27341, 73342, 
+    73346, 73351, 73368, 73380, 10576, 73392, 73397, 73402, 73407, 21010, 
+    73411, 73416, 73421, 73427, 73432, 5846, 21014, 73437, 73442, 73448, 
+    73455, 73460, 73465, 73471, 73477, 73483, 73488, 73494, 73498, 73512, 
+    73520, 73528, 73534, 73539, 73546, 73556, 73565, 73570, 73575, 73583, 
+    73588, 73594, 73599, 73608, 59823, 73613, 73616, 73634, 73653, 73666, 
+    73680, 73696, 73703, 73710, 73716, 73723, 73728, 73734, 73740, 73748, 
+    73754, 73759, 73764, 73780, 10589, 73794, 73801, 73809, 73815, 73819, 
+    73822, 73827, 73832, 73839, 73844, 73853, 73858, 73864, 73873, 73882, 
+    73887, 73891, 73899, 73908, 11674, 73917, 73925, 73930, 73936, 11685, 
+    73941, 73944, 73949, 73959, 73968, 73973, 73979, 73984, 73992, 73999, 
+    74010, 74020, 74025, 64875, 74030, 74036, 74041, 74048, 74057, 74065, 
+    74071, 74077, 74084, 74090, 74094, 16960, 3055, 74099, 74103, 74107, 
+    74113, 74122, 74128, 74135, 74139, 74160, 74182, 74198, 74215, 74234, 
+    74243, 74253, 74260, 74267, 27228, 74273, 74277, 74285, 74297, 74303, 
+    74311, 74315, 74323, 74330, 74334, 74340, 74346, 74351, 3563, 41924, 
+    74357, 74361, 74365, 74369, 74374, 74379, 74384, 74390, 74396, 74402, 
+    74409, 74415, 74422, 74428, 74434, 74439, 74445, 74450, 74454, 74459, 
+    74463, 74468, 41939, 74472, 74477, 74485, 74489, 74494, 74501, 74510, 
+    74516, 74520, 74527, 74531, 74534, 74541, 74550, 74555, 74559, 74567, 
+    74576, 74580, 74588, 74594, 74599, 74604, 74610, 74616, 74621, 74625, 
+    74631, 74636, 74640, 74644, 74647, 74652, 74660, 74670, 74675, 39416, 
+    74683, 74695, 74699, 74705, 74717, 74728, 74735, 74741, 74748, 74760, 
+    74767, 74773, 21088, 74777, 74783, 74790, 74796, 74802, 74807, 74812, 
+    74817, 74826, 7033, 74831, 16426, 74837, 74841, 74845, 74849, 74857, 
+    74866, 74870, 74877, 74886, 74899, 74905, 74464, 30088, 74910, 74912, 
+    74917, 74922, 74927, 74932, 74937, 74942, 74947, 74952, 74957, 74962, 
+    74967, 74972, 74977, 74982, 74988, 74993, 74998, 75003, 75008, 75013, 
+    75018, 75023, 75028, 75034, 75040, 75046, 75051, 75056, 75068, 75073, 
+    1870, 46, 75078, 75083, 32746, 75087, 32751, 32756, 32762, 32767, 75091, 
+    32772, 22083, 75113, 75117, 75121, 75126, 75130, 32776, 75134, 75142, 
+    32781, 75149, 75152, 75157, 75161, 9543, 75170, 32786, 21945, 75173, 
+    75177, 1428, 75182, 32797, 75185, 75190, 25737, 25747, 35258, 75195, 
+    75200, 75205, 75210, 75216, 75221, 75230, 75235, 75242, 75248, 75253, 
+    75258, 75263, 75273, 75282, 75287, 75295, 75299, 75307, 32611, 37317, 
+    75314, 75320, 75325, 75330, 12016, 75335, 75341, 75346, 75353, 75359, 
+    75364, 75372, 75382, 75392, 75398, 75403, 75409, 17536, 75416, 36073, 
+    75429, 75434, 75440, 30993, 75453, 75459, 75463, 75472, 75479, 75485, 
+    75493, 75502, 75509, 75515, 75518, 75522, 25878, 75526, 75533, 75539, 
+    75547, 75552, 23994, 75558, 75561, 75569, 75577, 75591, 75598, 75604, 
+    75611, 75617, 32811, 75621, 75628, 75636, 75644, 75650, 32816, 75658, 
+    75664, 75669, 75679, 75685, 75694, 30830, 34716, 75702, 75707, 75712, 
+    75716, 75721, 75725, 75733, 14920, 39429, 75738, 75743, 32821, 62269, 
+    75747, 75752, 75756, 75765, 75773, 75779, 75784, 75790, 75797, 75803, 
+    75808, 75813, 75822, 75834, 75849, 33083, 75855, 16545, 32825, 75859, 
+    75866, 24104, 75872, 75879, 75888, 75895, 75904, 75910, 75915, 75923, 
+    75929, 32835, 75934, 75943, 74723, 75952, 75959, 75965, 75971, 75981, 
+    75989, 75996, 76000, 32840, 76003, 32846, 32852, 76008, 76016, 76024, 
+    76034, 76043, 76051, 76058, 76068, 32857, 76072, 76074, 76078, 76083, 
+    76087, 76091, 76097, 76102, 76106, 76117, 76122, 76127, 3060, 76131, 
+    76138, 76142, 76151, 76159, 76166, 76171, 76176, 62315, 76180, 76183, 
+    76189, 76197, 76203, 76207, 76212, 76219, 76224, 76230, 34747, 76235, 
+    76238, 76243, 76247, 76252, 76257, 76261, 76269, 76273, 25756, 25765, 
+    76279, 76285, 76291, 76296, 76300, 76303, 76313, 76322, 76327, 76333, 
+    76340, 76346, 76350, 76358, 76363, 34753, 76367, 76375, 76381, 76388, 
+    76393, 76397, 76402, 58440, 34759, 76408, 76413, 76417, 76422, 76427, 
+    76432, 76436, 76441, 76446, 76452, 76457, 76462, 76468, 76474, 76479, 
+    76483, 76488, 76493, 76498, 76502, 24103, 76507, 76512, 76518, 76524, 
+    76530, 76535, 76539, 76544, 76549, 76554, 76558, 76563, 76568, 76573, 
+    76578, 76582, 32865, 76590, 76594, 76602, 76610, 76621, 76626, 76630, 
+    22397, 76635, 76641, 76651, 76658, 76663, 76672, 76677, 76681, 76686, 
+    76694, 76702, 76709, 65109, 76715, 76723, 76730, 76741, 76747, 76751, 
+    76757, 32875, 76760, 76767, 76775, 76780, 39620, 76784, 76789, 76796, 
+    76801, 8992, 76805, 76813, 76820, 76827, 76833, 76847, 63381, 76855, 
+    76861, 76865, 76868, 76876, 76883, 76888, 76901, 76908, 76912, 76919, 
+    76924, 60860, 76929, 76932, 76939, 76945, 76949, 76957, 76966, 76976, 
+    76986, 76995, 77003, 77014, 77019, 77023, 77028, 77032, 35389, 77040, 
+    21357, 35398, 77045, 77050, 77055, 77060, 77065, 77070, 77075, 77079, 
+    77084, 77089, 77094, 77099, 77104, 77109, 77113, 77118, 77123, 77127, 
+    77131, 77135, 77139, 77144, 77149, 77153, 77158, 77162, 77166, 77171, 
+    77176, 77181, 77186, 77190, 77195, 77200, 77204, 77209, 77214, 77219, 
+    77224, 77229, 77234, 77239, 77244, 77249, 77254, 77259, 77264, 77269, 
+    77274, 77279, 77284, 77289, 77294, 77299, 77304, 77308, 77313, 77318, 
+    77323, 77328, 77333, 77338, 77343, 77348, 77353, 77358, 77363, 77367, 
+    77372, 77376, 77381, 77386, 77391, 77396, 77401, 77406, 77411, 77416, 
+    77421, 77425, 77429, 77434, 77439, 77443, 77448, 77453, 77457, 77462, 
+    77467, 77472, 77477, 77481, 77486, 77491, 77495, 77500, 77504, 77508, 
+    77512, 77516, 77521, 77525, 77529, 77533, 77537, 77541, 77545, 77549, 
+    77553, 77557, 77562, 77567, 77572, 77577, 77582, 77587, 77592, 77597, 
+    77602, 77607, 77611, 77615, 77619, 77623, 77627, 77631, 77636, 77640, 
+    77645, 77649, 77654, 77659, 77663, 77667, 77672, 77676, 77680, 77684, 
+    77688, 77692, 77696, 77700, 77704, 77708, 77712, 77716, 77720, 77724, 
+    77728, 77733, 77738, 77742, 77746, 77750, 77754, 77758, 77762, 77767, 
+    77771, 77775, 77779, 77783, 77787, 77791, 77796, 77800, 77805, 77809, 
     77813, 77817, 77821, 77825, 77829, 77833, 77837, 77841, 77845, 77849, 
-    77853, 77857, 77862, 77866, 77870, 77875, 77880, 77884, 77888, 77892, 
-    77896, 77900, 77904, 77908, 77912, 77917, 77921, 77926, 77930, 77935, 
-    77939, 77944, 77948, 77954, 77959, 77963, 77968, 77972, 77977, 77981, 
-    77986, 77990, 77995, 1521, 77999, 2824, 1759, 1764, 78003, 78007, 2828, 
-    78011, 1397, 78016, 1342, 78020, 2840, 78024, 78031, 78038, 78052, 2844, 
-    7131, 78061, 78069, 78076, 78087, 78096, 78103, 78115, 78128, 78141, 
-    78152, 78157, 78164, 78176, 78180, 2848, 11740, 78190, 78195, 78204, 
-    78214, 2852, 78219, 78223, 78228, 78235, 78241, 78249, 78261, 1347, 
-    13035, 78271, 78275, 78281, 78295, 78307, 78319, 78329, 78338, 78347, 
-    78356, 78364, 78375, 78383, 4051, 78393, 78404, 78413, 78419, 78434, 
-    78441, 78447, 35489, 78452, 2876, 13039, 78456, 78463, 8930, 78472, 2881, 
-    32336, 78478, 60572, 78485, 78491, 78502, 78508, 78515, 78521, 78529, 
-    78536, 78542, 78552, 78561, 78572, 78579, 78585, 78595, 78603, 78609, 
-    78624, 78630, 78635, 78642, 78645, 78651, 78658, 78664, 78672, 78681, 
-    78689, 78695, 78704, 41427, 78718, 78723, 78729, 14744, 78734, 78747, 
-    78756, 78764, 78771, 78775, 78779, 78782, 78789, 78796, 78804, 78812, 
-    78821, 78829, 14671, 78837, 78842, 78846, 78858, 78865, 78874, 748, 
-    78884, 78893, 78904, 2897, 78908, 78912, 78918, 78931, 78943, 78953, 
-    78962, 78974, 26352, 78985, 78993, 79002, 79013, 79024, 79034, 79044, 
-    79053, 79061, 11305, 79068, 79072, 79075, 79080, 79085, 79089, 79095, 
-    1352, 11811, 79102, 79113, 79122, 79130, 79139, 79147, 79163, 79174, 
-    79183, 79191, 79203, 79214, 79230, 79240, 79261, 79274, 79282, 79289, 
-    14855, 79302, 79307, 79313, 5908, 79319, 79322, 79329, 79339, 8176, 
-    79346, 79351, 79356, 79361, 79369, 79378, 79386, 9749, 9758, 79391, 
-    79402, 79407, 79413, 2913, 2918, 79419, 10872, 79425, 79432, 79439, 
-    79452, 2251, 68, 79457, 79462, 79472, 79478, 79487, 79495, 79505, 79509, 
-    79514, 79518, 79530, 2941, 79538, 79546, 79551, 79562, 79573, 79582, 
-    79587, 79593, 79598, 79608, 79618, 79623, 79629, 79634, 79643, 21397, 
-    79647, 4128, 20, 79652, 79661, 79668, 79675, 79681, 79687, 864, 79692, 
-    79697, 60900, 79702, 79707, 79713, 79719, 79727, 79732, 79739, 79745, 
-    79750, 38001, 41321, 79756, 2945, 32, 79766, 79779, 79784, 79792, 79797, 
-    79803, 2967, 28289, 79808, 79816, 79823, 79828, 58645, 61903, 79837, 
-    79841, 1704, 1813, 79846, 79851, 79858, 1817, 247, 79865, 79871, 2989, 
-    79876, 79881, 79888, 1821, 79893, 79899, 79904, 79916, 6119, 79926, 1828, 
-    79932, 79937, 79944, 79951, 79966, 79973, 79984, 79992, 2618, 79996, 
-    80008, 80013, 80017, 80023, 28114, 2256, 80027, 80038, 80042, 80046, 
-    80052, 80056, 80065, 80069, 80080, 80084, 2302, 32165, 80088, 80098, 
-    3080, 9364, 80106, 80111, 80115, 80124, 80131, 80137, 3050, 17139, 80141, 
-    80154, 80172, 80177, 80185, 80193, 80203, 9978, 13147, 80215, 80228, 
-    80235, 80242, 80258, 80265, 80271, 1095, 80278, 80285, 80295, 80304, 
-    80316, 42291, 80324, 3064, 12023, 80327, 80335, 80339, 78231, 3068, 
-    80343, 21178, 12039, 3756, 80347, 3074, 80351, 80361, 80367, 80373, 
-    80379, 80385, 80391, 80397, 80403, 80409, 80415, 80421, 80427, 80433, 
-    80439, 80445, 80451, 80457, 80463, 80469, 80475, 80481, 80487, 80493, 
-    80499, 80505, 80511, 80518, 80525, 80531, 80537, 80543, 80549, 80555, 
-    80561, 1357, 16049, 12061, 80567, 80572, 80577, 80582, 80587, 80592, 
-    80597, 80602, 80607, 80612, 80617, 80622, 80627, 80632, 80637, 80642, 
-    80647, 80652, 80657, 80662, 80667, 80672, 80677, 80682, 80687, 80692, 
-    80698, 80703, 80708, 80714, 80719, 80725, 80730, 80735, 80741, 80746, 
-    80751, 80756, 80761, 80766, 80771, 80776, 80781, 80362, 80368, 80374, 
-    80380, 80386, 80392, 80398, 80404, 80410, 80416, 80422, 80428, 80434, 
-    80440, 80446, 80787, 80452, 80458, 80464, 80793, 80470, 80476, 80482, 
-    80488, 80494, 80500, 80506, 80526, 80799, 80805, 80532, 80811, 80538, 
-    80544, 80550, 80556, 80562, 3091, 3096, 80817, 80822, 80825, 80831, 
-    80837, 80844, 80849, 80854, 2307, 
+    77854, 77858, 77862, 77866, 77870, 77874, 77878, 77882, 77886, 77890, 
+    77894, 77898, 77903, 77907, 77911, 77916, 77921, 77925, 77929, 77933, 
+    77937, 77941, 77945, 77949, 77953, 77958, 77962, 77967, 77971, 77976, 
+    77980, 77985, 77989, 77995, 78000, 78004, 78009, 78013, 78018, 78022, 
+    78027, 78031, 78036, 1521, 78040, 2824, 1759, 1764, 78044, 78048, 2828, 
+    78052, 1397, 78057, 1342, 78061, 2840, 78065, 78072, 78079, 78093, 2844, 
+    7131, 78102, 78110, 78117, 78128, 78137, 78144, 78156, 78169, 78182, 
+    78193, 78198, 78205, 78217, 78221, 2848, 11747, 78231, 78236, 78245, 
+    78255, 2852, 78260, 78264, 78269, 78276, 78282, 78290, 78302, 1347, 
+    13042, 78312, 78316, 78322, 78336, 78348, 78360, 78370, 78379, 78388, 
+    78397, 78405, 78416, 78424, 4051, 78434, 78445, 78454, 78460, 78475, 
+    78482, 78488, 35514, 78493, 2876, 13046, 78497, 78504, 8930, 78513, 2881, 
+    32361, 78519, 60609, 78526, 78532, 78543, 78549, 78556, 78562, 78570, 
+    78577, 78583, 78593, 78602, 78613, 78620, 78626, 78636, 78644, 78650, 
+    78665, 78671, 78676, 78683, 78686, 78692, 78699, 78705, 78713, 78722, 
+    78730, 78736, 78745, 41464, 78759, 78764, 78770, 14757, 78775, 78788, 
+    78797, 78805, 78812, 78816, 78820, 78823, 78830, 78837, 78845, 78853, 
+    78862, 78870, 14684, 78878, 78883, 78887, 78899, 78906, 78915, 748, 
+    78925, 78934, 78945, 2897, 78949, 78953, 78959, 78972, 78984, 78994, 
+    79003, 79015, 26369, 79026, 79034, 79043, 79054, 79065, 79075, 79085, 
+    79094, 79102, 11312, 79109, 79113, 79116, 79121, 79126, 79130, 79136, 
+    1352, 11818, 79143, 79154, 79163, 79171, 79180, 79188, 79204, 79215, 
+    79224, 79232, 79244, 79255, 79271, 79281, 79302, 79315, 79323, 79330, 
+    14868, 79343, 79348, 79354, 5908, 79360, 79363, 79370, 79380, 8176, 
+    79387, 79392, 79397, 79402, 79410, 79419, 79427, 9756, 9765, 79432, 
+    79443, 79448, 79454, 2913, 2918, 79460, 10879, 79466, 79473, 79480, 
+    79493, 2251, 68, 79498, 79503, 79513, 79519, 79528, 79536, 79546, 79550, 
+    79555, 79559, 79571, 2941, 79579, 79587, 79592, 79603, 79614, 79623, 
+    79628, 79634, 79639, 79649, 79659, 79664, 79670, 79674, 79679, 79688, 
+    21410, 79692, 4128, 20, 79697, 79706, 79713, 79720, 79726, 79732, 864, 
+    79737, 79742, 60937, 79747, 79752, 79758, 79764, 79772, 79777, 79784, 
+    79790, 79795, 38030, 41358, 79801, 2945, 32, 79811, 79824, 79829, 79837, 
+    79842, 79848, 2967, 28310, 79853, 79861, 79868, 79873, 58682, 61940, 
+    79882, 79886, 1704, 1813, 79891, 79896, 79903, 1817, 247, 79910, 79916, 
+    2989, 79921, 79926, 79933, 1821, 79938, 79944, 79949, 79961, 6119, 79971, 
+    1828, 79977, 79982, 79989, 79996, 80011, 80018, 80029, 80037, 2618, 
+    80041, 80053, 80058, 80062, 80068, 28135, 2256, 80072, 80083, 80087, 
+    80091, 80097, 80101, 80110, 80114, 80125, 80129, 2302, 32190, 80133, 
+    80143, 3080, 9371, 80151, 80156, 80160, 80169, 80176, 80182, 3050, 17152, 
+    80186, 80199, 80217, 80222, 80230, 80238, 80248, 9985, 13154, 80260, 
+    80273, 80280, 80287, 80303, 80310, 80316, 1064, 80323, 80330, 80340, 
+    80349, 80361, 42328, 80369, 3064, 12030, 80372, 80380, 80384, 78272, 
+    3068, 80388, 21191, 12046, 3756, 80392, 3074, 80396, 80406, 80412, 80418, 
+    80424, 80430, 80436, 80442, 80448, 80454, 80460, 80466, 80472, 80478, 
+    80484, 80490, 80496, 80502, 80508, 80514, 80520, 80526, 80532, 80538, 
+    80544, 80550, 80556, 80563, 80570, 80576, 80582, 80588, 80594, 80600, 
+    80606, 1357, 16062, 12068, 80612, 80617, 80622, 80627, 80632, 80637, 
+    80642, 80647, 80652, 80657, 80662, 80667, 80672, 80677, 80682, 80687, 
+    80692, 80697, 80702, 80707, 80712, 80717, 80722, 80727, 80732, 80737, 
+    80743, 80748, 80753, 80759, 80764, 80770, 80775, 80780, 80786, 80791, 
+    80796, 80801, 80806, 80811, 80816, 80821, 80826, 80407, 80413, 80419, 
+    80425, 80431, 80437, 80443, 80449, 80455, 80461, 80467, 80473, 80479, 
+    80485, 80491, 80832, 80497, 80503, 80509, 80838, 80515, 80521, 80527, 
+    80533, 80539, 80545, 80551, 80571, 80844, 80850, 80577, 80856, 80583, 
+    80589, 80595, 80601, 80607, 3091, 3096, 80862, 80867, 80870, 80876, 
+    80882, 80889, 80894, 80899, 2307, 
 };
 
 /* code->name phrasebook */
 #define phrasebook_shift 7
 #define phrasebook_short 209
 static unsigned char phrasebook[] = {
-    0, 219, 18, 245, 31, 78, 223, 254, 78, 54, 50, 247, 132, 50, 225, 182, 
-    50, 254, 126, 254, 57, 43, 226, 3, 44, 226, 3, 253, 216, 96, 50, 249, 
-    219, 240, 167, 243, 229, 218, 129, 219, 46, 21, 210, 86, 21, 110, 21, 
-    105, 21, 158, 21, 161, 21, 189, 21, 194, 21, 198, 21, 195, 21, 200, 249, 
-    226, 220, 150, 233, 15, 50, 245, 98, 50, 242, 130, 50, 224, 13, 78, 249, 
-    217, 253, 206, 7, 6, 1, 61, 7, 6, 1, 253, 158, 7, 6, 1, 251, 66, 7, 6, 1, 
-    249, 60, 7, 6, 1, 75, 7, 6, 1, 245, 6, 7, 6, 1, 243, 202, 7, 6, 1, 242, 
-    60, 7, 6, 1, 73, 7, 6, 1, 235, 144, 7, 6, 1, 235, 23, 7, 6, 1, 156, 7, 6, 
-    1, 193, 7, 6, 1, 230, 25, 7, 6, 1, 76, 7, 6, 1, 226, 105, 7, 6, 1, 224, 
-    96, 7, 6, 1, 153, 7, 6, 1, 222, 91, 7, 6, 1, 217, 152, 7, 6, 1, 70, 7, 6, 
-    1, 214, 105, 7, 6, 1, 212, 98, 7, 6, 1, 211, 178, 7, 6, 1, 211, 117, 7, 
-    6, 1, 210, 159, 43, 42, 127, 223, 50, 219, 46, 44, 42, 127, 250, 31, 255, 
-    14, 121, 232, 213, 242, 137, 255, 14, 7, 4, 1, 61, 7, 4, 1, 253, 158, 7, 
-    4, 1, 251, 66, 7, 4, 1, 249, 60, 7, 4, 1, 75, 7, 4, 1, 245, 6, 7, 4, 1, 
-    243, 202, 7, 4, 1, 242, 60, 7, 4, 1, 73, 7, 4, 1, 235, 144, 7, 4, 1, 235, 
-    23, 7, 4, 1, 156, 7, 4, 1, 193, 7, 4, 1, 230, 25, 7, 4, 1, 76, 7, 4, 1, 
-    226, 105, 7, 4, 1, 224, 96, 7, 4, 1, 153, 7, 4, 1, 222, 91, 7, 4, 1, 217, 
-    152, 7, 4, 1, 70, 7, 4, 1, 214, 105, 7, 4, 1, 212, 98, 7, 4, 1, 211, 178, 
-    7, 4, 1, 211, 117, 7, 4, 1, 210, 159, 43, 249, 99, 127, 67, 232, 213, 44, 
-    249, 99, 127, 182, 228, 73, 219, 18, 235, 193, 245, 31, 78, 250, 176, 50, 
-    224, 228, 50, 249, 98, 50, 211, 40, 50, 251, 135, 130, 221, 173, 50, 248, 
-    1, 249, 163, 50, 244, 136, 226, 154, 235, 238, 233, 42, 52, 254, 110, 
-    223, 254, 78, 228, 52, 50, 219, 52, 240, 168, 223, 102, 50, 231, 232, 
-    248, 71, 50, 225, 21, 50, 218, 23, 105, 218, 23, 158, 255, 3, 255, 14, 
-    230, 228, 50, 225, 68, 50, 230, 224, 247, 120, 250, 183, 218, 23, 110, 
-    231, 148, 226, 154, 235, 238, 222, 247, 52, 254, 110, 223, 254, 78, 212, 
-    114, 244, 2, 123, 224, 21, 212, 114, 244, 2, 123, 242, 27, 212, 114, 244, 
-    2, 134, 224, 19, 235, 193, 224, 13, 78, 7, 6, 1, 115, 2, 242, 136, 7, 6, 
-    1, 115, 2, 142, 7, 6, 1, 115, 2, 250, 30, 7, 6, 1, 115, 2, 182, 7, 6, 1, 
-    115, 2, 248, 1, 7, 6, 1, 115, 2, 222, 234, 48, 7, 6, 1, 254, 243, 7, 6, 
-    1, 251, 67, 2, 250, 183, 7, 6, 1, 160, 2, 242, 136, 7, 6, 1, 160, 2, 142, 
-    7, 6, 1, 160, 2, 250, 30, 7, 6, 1, 160, 2, 248, 1, 7, 6, 1, 240, 154, 2, 
-    242, 136, 7, 6, 1, 240, 154, 2, 142, 7, 6, 1, 240, 154, 2, 250, 30, 7, 6, 
-    1, 240, 154, 2, 248, 1, 7, 6, 1, 245, 59, 7, 6, 1, 230, 26, 2, 182, 7, 6, 
-    1, 144, 2, 242, 136, 7, 6, 1, 144, 2, 142, 7, 6, 1, 144, 2, 250, 30, 7, 
-    6, 1, 144, 2, 182, 7, 6, 1, 144, 2, 248, 1, 230, 84, 50, 7, 6, 1, 144, 2, 
-    91, 7, 6, 1, 104, 2, 242, 136, 7, 6, 1, 104, 2, 142, 7, 6, 1, 104, 2, 
-    250, 30, 7, 6, 1, 104, 2, 248, 1, 7, 6, 1, 211, 118, 2, 142, 7, 6, 1, 
-    216, 151, 7, 4, 1, 220, 76, 222, 91, 7, 4, 1, 115, 2, 242, 136, 7, 4, 1, 
-    115, 2, 142, 7, 4, 1, 115, 2, 250, 30, 7, 4, 1, 115, 2, 182, 7, 4, 1, 
-    115, 2, 248, 1, 7, 4, 1, 115, 2, 222, 234, 48, 7, 4, 1, 254, 243, 7, 4, 
-    1, 251, 67, 2, 250, 183, 7, 4, 1, 160, 2, 242, 136, 7, 4, 1, 160, 2, 142, 
-    7, 4, 1, 160, 2, 250, 30, 7, 4, 1, 160, 2, 248, 1, 7, 4, 1, 240, 154, 2, 
-    242, 136, 7, 4, 1, 240, 154, 2, 142, 7, 4, 1, 240, 154, 2, 250, 30, 7, 4, 
-    1, 240, 154, 2, 248, 1, 7, 4, 1, 245, 59, 7, 4, 1, 230, 26, 2, 182, 7, 4, 
-    1, 144, 2, 242, 136, 7, 4, 1, 144, 2, 142, 7, 4, 1, 144, 2, 250, 30, 7, 
-    4, 1, 144, 2, 182, 7, 4, 1, 144, 2, 248, 1, 247, 169, 50, 7, 4, 1, 144, 
-    2, 91, 7, 4, 1, 104, 2, 242, 136, 7, 4, 1, 104, 2, 142, 7, 4, 1, 104, 2, 
-    250, 30, 7, 4, 1, 104, 2, 248, 1, 7, 4, 1, 211, 118, 2, 142, 7, 4, 1, 
-    216, 151, 7, 4, 1, 211, 118, 2, 248, 1, 7, 6, 1, 115, 2, 231, 232, 7, 4, 
-    1, 115, 2, 231, 232, 7, 6, 1, 115, 2, 251, 146, 7, 4, 1, 115, 2, 251, 
-    146, 7, 6, 1, 115, 2, 226, 224, 7, 4, 1, 115, 2, 226, 224, 7, 6, 1, 251, 
-    67, 2, 142, 7, 4, 1, 251, 67, 2, 142, 7, 6, 1, 251, 67, 2, 250, 30, 7, 4, 
-    1, 251, 67, 2, 250, 30, 7, 6, 1, 251, 67, 2, 59, 48, 7, 4, 1, 251, 67, 2, 
-    59, 48, 7, 6, 1, 251, 67, 2, 250, 234, 7, 4, 1, 251, 67, 2, 250, 234, 7, 
-    6, 1, 249, 61, 2, 250, 234, 7, 4, 1, 249, 61, 2, 250, 234, 7, 6, 1, 249, 
-    61, 2, 91, 7, 4, 1, 249, 61, 2, 91, 7, 6, 1, 160, 2, 231, 232, 7, 4, 1, 
-    160, 2, 231, 232, 7, 6, 1, 160, 2, 251, 146, 7, 4, 1, 160, 2, 251, 146, 
-    7, 6, 1, 160, 2, 59, 48, 7, 4, 1, 160, 2, 59, 48, 7, 6, 1, 160, 2, 226, 
-    224, 7, 4, 1, 160, 2, 226, 224, 7, 6, 1, 160, 2, 250, 234, 7, 4, 1, 160, 
-    2, 250, 234, 7, 6, 1, 243, 203, 2, 250, 30, 7, 4, 1, 243, 203, 2, 250, 
-    30, 7, 6, 1, 243, 203, 2, 251, 146, 7, 4, 1, 243, 203, 2, 251, 146, 7, 6, 
-    1, 243, 203, 2, 59, 48, 7, 4, 1, 243, 203, 2, 59, 48, 7, 6, 1, 243, 203, 
-    2, 250, 183, 7, 4, 1, 243, 203, 2, 250, 183, 7, 6, 1, 242, 61, 2, 250, 
-    30, 7, 4, 1, 242, 61, 2, 250, 30, 7, 6, 1, 242, 61, 2, 91, 7, 4, 1, 242, 
-    61, 2, 91, 7, 6, 1, 240, 154, 2, 182, 7, 4, 1, 240, 154, 2, 182, 7, 6, 1, 
-    240, 154, 2, 231, 232, 7, 4, 1, 240, 154, 2, 231, 232, 7, 6, 1, 240, 154, 
-    2, 251, 146, 7, 4, 1, 240, 154, 2, 251, 146, 7, 6, 1, 240, 154, 2, 226, 
-    224, 7, 4, 1, 240, 154, 2, 226, 224, 7, 6, 1, 240, 154, 2, 59, 48, 7, 4, 
-    1, 247, 119, 73, 7, 6, 27, 236, 31, 7, 4, 27, 236, 31, 7, 6, 1, 235, 145, 
-    2, 250, 30, 7, 4, 1, 235, 145, 2, 250, 30, 7, 6, 1, 235, 24, 2, 250, 183, 
-    7, 4, 1, 235, 24, 2, 250, 183, 7, 4, 1, 233, 239, 7, 6, 1, 233, 149, 2, 
-    142, 7, 4, 1, 233, 149, 2, 142, 7, 6, 1, 233, 149, 2, 250, 183, 7, 4, 1, 
-    233, 149, 2, 250, 183, 7, 6, 1, 233, 149, 2, 250, 234, 7, 4, 1, 233, 149, 
-    2, 250, 234, 7, 6, 1, 233, 149, 2, 230, 224, 247, 120, 7, 4, 1, 233, 149, 
-    2, 230, 224, 247, 120, 7, 6, 1, 233, 149, 2, 91, 7, 4, 1, 233, 149, 2, 
-    91, 7, 6, 1, 230, 26, 2, 142, 7, 4, 1, 230, 26, 2, 142, 7, 6, 1, 230, 26, 
-    2, 250, 183, 7, 4, 1, 230, 26, 2, 250, 183, 7, 6, 1, 230, 26, 2, 250, 
-    234, 7, 4, 1, 230, 26, 2, 250, 234, 7, 4, 1, 230, 26, 224, 204, 251, 78, 
-    254, 57, 7, 6, 1, 245, 138, 7, 4, 1, 245, 138, 7, 6, 1, 144, 2, 231, 232, 
-    7, 4, 1, 144, 2, 231, 232, 7, 6, 1, 144, 2, 251, 146, 7, 4, 1, 144, 2, 
-    251, 146, 7, 6, 1, 144, 2, 52, 142, 7, 4, 1, 144, 2, 52, 142, 7, 6, 27, 
-    226, 234, 7, 4, 27, 226, 234, 7, 6, 1, 223, 224, 2, 142, 7, 4, 1, 223, 
-    224, 2, 142, 7, 6, 1, 223, 224, 2, 250, 183, 7, 4, 1, 223, 224, 2, 250, 
-    183, 7, 6, 1, 223, 224, 2, 250, 234, 7, 4, 1, 223, 224, 2, 250, 234, 7, 
-    6, 1, 222, 92, 2, 142, 7, 4, 1, 222, 92, 2, 142, 7, 6, 1, 222, 92, 2, 
-    250, 30, 7, 4, 1, 222, 92, 2, 250, 30, 7, 6, 1, 222, 92, 2, 250, 183, 7, 
-    4, 1, 222, 92, 2, 250, 183, 7, 6, 1, 222, 92, 2, 250, 234, 7, 4, 1, 222, 
-    92, 2, 250, 234, 7, 6, 1, 217, 153, 2, 250, 183, 7, 4, 1, 217, 153, 2, 
-    250, 183, 7, 6, 1, 217, 153, 2, 250, 234, 7, 4, 1, 217, 153, 2, 250, 234, 
-    7, 6, 1, 217, 153, 2, 91, 7, 4, 1, 217, 153, 2, 91, 7, 6, 1, 104, 2, 182, 
-    7, 4, 1, 104, 2, 182, 7, 6, 1, 104, 2, 231, 232, 7, 4, 1, 104, 2, 231, 
-    232, 7, 6, 1, 104, 2, 251, 146, 7, 4, 1, 104, 2, 251, 146, 7, 6, 1, 104, 
-    2, 222, 234, 48, 7, 4, 1, 104, 2, 222, 234, 48, 7, 6, 1, 104, 2, 52, 142, 
-    7, 4, 1, 104, 2, 52, 142, 7, 6, 1, 104, 2, 226, 224, 7, 4, 1, 104, 2, 
-    226, 224, 7, 6, 1, 212, 99, 2, 250, 30, 7, 4, 1, 212, 99, 2, 250, 30, 7, 
-    6, 1, 211, 118, 2, 250, 30, 7, 4, 1, 211, 118, 2, 250, 30, 7, 6, 1, 211, 
-    118, 2, 248, 1, 7, 6, 1, 210, 160, 2, 142, 7, 4, 1, 210, 160, 2, 142, 7, 
-    6, 1, 210, 160, 2, 59, 48, 7, 4, 1, 210, 160, 2, 59, 48, 7, 6, 1, 210, 
-    160, 2, 250, 234, 7, 4, 1, 210, 160, 2, 250, 234, 7, 4, 1, 199, 222, 91, 
-    7, 4, 1, 57, 2, 91, 7, 6, 1, 57, 2, 103, 7, 6, 1, 57, 2, 216, 11, 7, 4, 
-    1, 57, 2, 216, 11, 7, 6, 1, 138, 194, 7, 4, 1, 138, 194, 7, 6, 1, 204, 
-    76, 7, 6, 1, 251, 67, 2, 103, 7, 4, 1, 251, 67, 2, 103, 7, 6, 1, 254, 
-    219, 249, 60, 7, 6, 1, 249, 61, 2, 103, 7, 6, 1, 249, 61, 2, 216, 11, 7, 
-    4, 1, 249, 61, 2, 216, 11, 7, 4, 1, 215, 94, 248, 54, 7, 6, 1, 223, 49, 
-    75, 7, 6, 1, 221, 195, 7, 6, 1, 204, 75, 7, 6, 1, 245, 7, 2, 103, 7, 4, 
-    1, 245, 7, 2, 103, 7, 6, 1, 243, 203, 2, 103, 7, 6, 1, 243, 107, 7, 4, 1, 
-    240, 201, 7, 6, 1, 235, 185, 7, 6, 1, 240, 154, 2, 91, 7, 6, 1, 235, 24, 
-    2, 103, 7, 4, 1, 235, 24, 2, 103, 7, 4, 1, 233, 149, 2, 130, 7, 4, 1, 
-    233, 100, 2, 91, 7, 6, 1, 215, 94, 193, 7, 6, 1, 230, 26, 2, 43, 103, 7, 
-    4, 1, 230, 26, 2, 199, 44, 233, 36, 7, 6, 1, 144, 2, 230, 224, 182, 7, 6, 
-    1, 144, 2, 240, 248, 7, 4, 1, 144, 2, 240, 248, 7, 6, 1, 226, 219, 7, 4, 
-    1, 226, 219, 7, 6, 1, 226, 106, 2, 103, 7, 4, 1, 226, 106, 2, 103, 7, 1, 
-    210, 214, 7, 6, 1, 138, 105, 7, 4, 1, 138, 105, 7, 6, 1, 245, 75, 7, 1, 
-    223, 49, 245, 76, 232, 123, 7, 4, 1, 217, 153, 2, 226, 66, 103, 7, 6, 1, 
-    217, 153, 2, 103, 7, 4, 1, 217, 153, 2, 103, 7, 6, 1, 217, 153, 2, 223, 
-    55, 103, 7, 6, 1, 104, 2, 240, 248, 7, 4, 1, 104, 2, 240, 248, 7, 6, 1, 
-    214, 157, 7, 6, 1, 214, 106, 2, 103, 7, 6, 1, 211, 118, 2, 103, 7, 4, 1, 
-    211, 118, 2, 103, 7, 6, 1, 210, 160, 2, 91, 7, 4, 1, 210, 160, 2, 91, 7, 
-    6, 1, 245, 8, 7, 6, 1, 245, 9, 223, 48, 7, 4, 1, 245, 9, 223, 48, 7, 4, 
-    1, 245, 9, 2, 217, 77, 7, 1, 113, 2, 91, 7, 6, 1, 138, 189, 7, 4, 1, 138, 
-    189, 7, 1, 235, 193, 242, 180, 218, 130, 2, 91, 7, 1, 211, 181, 7, 1, 
-    248, 47, 250, 11, 7, 1, 233, 77, 250, 11, 7, 1, 254, 137, 250, 11, 7, 1, 
-    223, 55, 250, 11, 7, 6, 1, 246, 40, 2, 250, 234, 7, 6, 1, 249, 61, 2, 4, 
-    1, 210, 160, 2, 250, 234, 7, 4, 1, 246, 40, 2, 250, 234, 7, 6, 1, 232, 
-    188, 7, 6, 1, 233, 149, 2, 4, 1, 235, 144, 7, 4, 1, 232, 188, 7, 6, 1, 
-    228, 186, 7, 6, 1, 230, 26, 2, 4, 1, 235, 144, 7, 4, 1, 228, 186, 7, 6, 
-    1, 115, 2, 250, 234, 7, 4, 1, 115, 2, 250, 234, 7, 6, 1, 240, 154, 2, 
-    250, 234, 7, 4, 1, 240, 154, 2, 250, 234, 7, 6, 1, 144, 2, 250, 234, 7, 
-    4, 1, 144, 2, 250, 234, 7, 6, 1, 104, 2, 250, 234, 7, 4, 1, 104, 2, 250, 
-    234, 7, 6, 1, 104, 2, 248, 2, 22, 231, 232, 7, 4, 1, 104, 2, 248, 2, 22, 
-    231, 232, 7, 6, 1, 104, 2, 248, 2, 22, 142, 7, 4, 1, 104, 2, 248, 2, 22, 
-    142, 7, 6, 1, 104, 2, 248, 2, 22, 250, 234, 7, 4, 1, 104, 2, 248, 2, 22, 
-    250, 234, 7, 6, 1, 104, 2, 248, 2, 22, 242, 136, 7, 4, 1, 104, 2, 248, 2, 
-    22, 242, 136, 7, 4, 1, 215, 94, 75, 7, 6, 1, 115, 2, 248, 2, 22, 231, 
-    232, 7, 4, 1, 115, 2, 248, 2, 22, 231, 232, 7, 6, 1, 115, 2, 59, 77, 22, 
-    231, 232, 7, 4, 1, 115, 2, 59, 77, 22, 231, 232, 7, 6, 1, 254, 244, 2, 
-    231, 232, 7, 4, 1, 254, 244, 2, 231, 232, 7, 6, 1, 243, 203, 2, 91, 7, 4, 
-    1, 243, 203, 2, 91, 7, 6, 1, 243, 203, 2, 250, 234, 7, 4, 1, 243, 203, 2, 
-    250, 234, 7, 6, 1, 235, 24, 2, 250, 234, 7, 4, 1, 235, 24, 2, 250, 234, 
-    7, 6, 1, 144, 2, 226, 224, 7, 4, 1, 144, 2, 226, 224, 7, 6, 1, 144, 2, 
-    226, 225, 22, 231, 232, 7, 4, 1, 144, 2, 226, 225, 22, 231, 232, 7, 6, 1, 
-    245, 9, 2, 250, 234, 7, 4, 1, 245, 9, 2, 250, 234, 7, 4, 1, 235, 145, 2, 
-    250, 234, 7, 6, 1, 246, 39, 7, 6, 1, 249, 61, 2, 4, 1, 210, 159, 7, 4, 1, 
-    246, 39, 7, 6, 1, 243, 203, 2, 142, 7, 4, 1, 243, 203, 2, 142, 7, 6, 1, 
-    240, 199, 7, 6, 1, 211, 181, 7, 6, 1, 230, 26, 2, 242, 136, 7, 4, 1, 230, 
-    26, 2, 242, 136, 7, 6, 1, 115, 2, 222, 234, 77, 22, 142, 7, 4, 1, 115, 2, 
-    222, 234, 77, 22, 142, 7, 6, 1, 254, 244, 2, 142, 7, 4, 1, 254, 244, 2, 
-    142, 7, 6, 1, 144, 2, 218, 103, 22, 142, 7, 4, 1, 144, 2, 218, 103, 22, 
-    142, 7, 6, 1, 115, 2, 52, 242, 136, 7, 4, 1, 115, 2, 52, 242, 136, 7, 6, 
-    1, 115, 2, 235, 193, 251, 146, 7, 4, 1, 115, 2, 235, 193, 251, 146, 7, 6, 
-    1, 160, 2, 52, 242, 136, 7, 4, 1, 160, 2, 52, 242, 136, 7, 6, 1, 160, 2, 
-    235, 193, 251, 146, 7, 4, 1, 160, 2, 235, 193, 251, 146, 7, 6, 1, 240, 
-    154, 2, 52, 242, 136, 7, 4, 1, 240, 154, 2, 52, 242, 136, 7, 6, 1, 240, 
-    154, 2, 235, 193, 251, 146, 7, 4, 1, 240, 154, 2, 235, 193, 251, 146, 7, 
-    6, 1, 144, 2, 52, 242, 136, 7, 4, 1, 144, 2, 52, 242, 136, 7, 6, 1, 144, 
-    2, 235, 193, 251, 146, 7, 4, 1, 144, 2, 235, 193, 251, 146, 7, 6, 1, 223, 
-    224, 2, 52, 242, 136, 7, 4, 1, 223, 224, 2, 52, 242, 136, 7, 6, 1, 223, 
-    224, 2, 235, 193, 251, 146, 7, 4, 1, 223, 224, 2, 235, 193, 251, 146, 7, 
-    6, 1, 104, 2, 52, 242, 136, 7, 4, 1, 104, 2, 52, 242, 136, 7, 6, 1, 104, 
-    2, 235, 193, 251, 146, 7, 4, 1, 104, 2, 235, 193, 251, 146, 7, 6, 1, 222, 
-    92, 2, 249, 220, 51, 7, 4, 1, 222, 92, 2, 249, 220, 51, 7, 6, 1, 217, 
-    153, 2, 249, 220, 51, 7, 4, 1, 217, 153, 2, 249, 220, 51, 7, 6, 1, 210, 
-    231, 7, 4, 1, 210, 231, 7, 6, 1, 242, 61, 2, 250, 234, 7, 4, 1, 242, 61, 
-    2, 250, 234, 7, 6, 1, 230, 26, 2, 199, 44, 233, 36, 7, 4, 1, 249, 61, 2, 
-    249, 100, 7, 6, 1, 226, 134, 7, 4, 1, 226, 134, 7, 6, 1, 210, 160, 2, 
-    103, 7, 4, 1, 210, 160, 2, 103, 7, 6, 1, 115, 2, 59, 48, 7, 4, 1, 115, 2, 
-    59, 48, 7, 6, 1, 160, 2, 250, 183, 7, 4, 1, 160, 2, 250, 183, 7, 6, 1, 
-    144, 2, 248, 2, 22, 231, 232, 7, 4, 1, 144, 2, 248, 2, 22, 231, 232, 7, 
-    6, 1, 144, 2, 216, 89, 22, 231, 232, 7, 4, 1, 144, 2, 216, 89, 22, 231, 
-    232, 7, 6, 1, 144, 2, 59, 48, 7, 4, 1, 144, 2, 59, 48, 7, 6, 1, 144, 2, 
-    59, 77, 22, 231, 232, 7, 4, 1, 144, 2, 59, 77, 22, 231, 232, 7, 6, 1, 
-    211, 118, 2, 231, 232, 7, 4, 1, 211, 118, 2, 231, 232, 7, 4, 1, 233, 149, 
-    2, 249, 100, 7, 4, 1, 230, 26, 2, 249, 100, 7, 4, 1, 217, 153, 2, 249, 
-    100, 7, 4, 1, 247, 119, 235, 144, 7, 4, 1, 248, 143, 247, 220, 7, 4, 1, 
-    224, 31, 247, 220, 7, 6, 1, 115, 2, 91, 7, 6, 1, 251, 67, 2, 91, 7, 4, 1, 
-    251, 67, 2, 91, 7, 6, 1, 233, 149, 2, 130, 7, 6, 1, 217, 153, 2, 247, 
-    255, 91, 7, 4, 1, 222, 92, 2, 217, 250, 217, 77, 7, 4, 1, 210, 160, 2, 
-    217, 250, 217, 77, 7, 6, 1, 242, 180, 218, 129, 7, 4, 1, 242, 180, 218, 
-    129, 7, 6, 1, 57, 2, 91, 7, 6, 1, 104, 130, 7, 6, 1, 215, 94, 214, 105, 
-    7, 6, 1, 160, 2, 91, 7, 4, 1, 160, 2, 91, 7, 6, 1, 235, 145, 2, 91, 7, 4, 
-    1, 235, 145, 2, 91, 7, 6, 1, 4, 224, 97, 2, 241, 52, 217, 77, 7, 4, 1, 
-    224, 97, 2, 241, 52, 217, 77, 7, 6, 1, 223, 224, 2, 91, 7, 4, 1, 223, 
-    224, 2, 91, 7, 6, 1, 211, 118, 2, 91, 7, 4, 1, 211, 118, 2, 91, 7, 4, 1, 
-    215, 94, 61, 7, 4, 1, 254, 143, 7, 4, 1, 215, 94, 254, 143, 7, 4, 1, 57, 
-    2, 103, 7, 4, 1, 204, 76, 7, 4, 1, 251, 67, 2, 249, 100, 7, 4, 1, 249, 
-    61, 2, 217, 77, 7, 4, 1, 249, 61, 2, 103, 7, 4, 1, 223, 49, 75, 7, 4, 1, 
-    221, 195, 7, 4, 1, 221, 196, 2, 103, 7, 4, 1, 204, 75, 7, 4, 1, 223, 49, 
-    204, 75, 7, 4, 1, 223, 49, 204, 160, 2, 103, 7, 4, 1, 250, 0, 223, 49, 
-    204, 75, 7, 4, 1, 247, 119, 235, 145, 2, 91, 7, 4, 1, 243, 203, 2, 103, 
-    7, 4, 1, 119, 243, 202, 7, 1, 4, 6, 243, 202, 7, 4, 1, 243, 107, 7, 4, 1, 
-    223, 151, 240, 248, 7, 4, 1, 215, 94, 242, 60, 7, 4, 1, 242, 61, 2, 103, 
-    7, 4, 1, 241, 208, 2, 103, 7, 4, 1, 240, 154, 2, 91, 7, 4, 1, 235, 185, 
-    7, 1, 4, 6, 73, 7, 4, 1, 233, 149, 2, 230, 224, 182, 7, 4, 1, 233, 149, 
-    2, 252, 41, 7, 4, 1, 233, 149, 2, 223, 55, 103, 7, 4, 1, 233, 1, 7, 4, 1, 
-    215, 94, 193, 7, 4, 1, 215, 94, 232, 50, 2, 199, 233, 36, 7, 4, 1, 232, 
-    50, 2, 103, 7, 4, 1, 230, 26, 2, 43, 103, 7, 4, 1, 230, 26, 2, 223, 55, 
-    103, 7, 1, 4, 6, 230, 25, 7, 4, 1, 252, 134, 76, 7, 1, 4, 6, 226, 234, 7, 
-    4, 1, 250, 0, 226, 201, 7, 4, 1, 225, 133, 7, 4, 1, 215, 94, 153, 7, 4, 
-    1, 215, 94, 223, 224, 2, 199, 233, 36, 7, 4, 1, 215, 94, 223, 224, 2, 
-    103, 7, 4, 1, 223, 224, 2, 199, 233, 36, 7, 4, 1, 223, 224, 2, 217, 77, 
-    7, 4, 1, 223, 224, 2, 244, 87, 7, 4, 1, 223, 49, 223, 224, 2, 244, 87, 7, 
-    1, 4, 6, 153, 7, 1, 4, 6, 235, 193, 153, 7, 4, 1, 222, 92, 2, 103, 7, 4, 
-    1, 245, 75, 7, 4, 1, 247, 119, 235, 145, 2, 218, 103, 22, 103, 7, 4, 1, 
-    218, 231, 223, 49, 245, 75, 7, 4, 1, 245, 76, 2, 249, 100, 7, 4, 1, 215, 
-    94, 217, 152, 7, 4, 1, 217, 153, 2, 223, 55, 103, 7, 4, 1, 104, 130, 7, 
-    4, 1, 214, 157, 7, 4, 1, 214, 106, 2, 103, 7, 4, 1, 215, 94, 214, 105, 7, 
-    4, 1, 215, 94, 212, 98, 7, 4, 1, 215, 94, 211, 117, 7, 1, 4, 6, 211, 117, 
-    7, 4, 1, 210, 160, 2, 223, 55, 103, 7, 4, 1, 210, 160, 2, 249, 100, 7, 4, 
-    1, 245, 8, 7, 4, 1, 245, 9, 2, 249, 100, 7, 1, 242, 180, 218, 129, 7, 1, 
-    225, 139, 213, 135, 243, 249, 7, 1, 235, 193, 242, 180, 218, 129, 7, 1, 
-    218, 110, 251, 66, 7, 1, 251, 246, 250, 11, 7, 1, 4, 6, 253, 158, 7, 4, 
-    1, 250, 0, 204, 75, 7, 1, 4, 6, 243, 203, 2, 103, 7, 1, 4, 6, 242, 60, 7, 
-    4, 1, 235, 145, 2, 249, 127, 7, 4, 1, 215, 94, 235, 23, 7, 1, 4, 6, 156, 
-    7, 4, 1, 224, 97, 2, 103, 7, 1, 242, 180, 218, 130, 2, 91, 7, 1, 223, 49, 
-    242, 180, 218, 130, 2, 91, 7, 4, 1, 246, 40, 247, 220, 7, 4, 1, 248, 26, 
-    247, 220, 7, 4, 1, 246, 40, 247, 221, 2, 249, 100, 7, 4, 1, 215, 185, 
-    247, 220, 7, 4, 1, 216, 235, 247, 220, 7, 4, 1, 217, 29, 247, 221, 2, 
-    249, 100, 7, 4, 1, 244, 134, 247, 220, 7, 4, 1, 232, 100, 247, 220, 7, 4, 
-    1, 232, 51, 247, 220, 7, 1, 251, 246, 225, 181, 7, 1, 251, 254, 225, 181, 
-    7, 4, 1, 215, 94, 242, 61, 2, 244, 87, 7, 4, 1, 215, 94, 242, 61, 2, 244, 
-    88, 22, 217, 77, 58, 1, 4, 242, 60, 58, 1, 4, 242, 61, 2, 103, 58, 1, 4, 
-    235, 144, 58, 1, 4, 153, 58, 1, 4, 215, 94, 153, 58, 1, 4, 215, 94, 223, 
-    224, 2, 103, 58, 1, 4, 6, 235, 193, 153, 58, 1, 4, 212, 98, 58, 1, 4, 
-    211, 117, 58, 1, 224, 190, 58, 1, 52, 224, 190, 58, 1, 215, 94, 249, 219, 
-    58, 1, 254, 57, 58, 1, 223, 49, 249, 219, 58, 1, 44, 163, 222, 233, 58, 
-    1, 43, 163, 222, 233, 58, 1, 242, 180, 218, 129, 58, 1, 223, 49, 242, 
-    180, 218, 129, 58, 1, 43, 253, 249, 58, 1, 44, 253, 249, 58, 1, 120, 253, 
-    249, 58, 1, 124, 253, 249, 58, 1, 250, 31, 255, 14, 250, 234, 58, 1, 67, 
-    232, 213, 58, 1, 231, 232, 58, 1, 255, 3, 255, 14, 58, 1, 242, 137, 255, 
-    14, 58, 1, 121, 67, 232, 213, 58, 1, 121, 231, 232, 58, 1, 121, 242, 137, 
-    255, 14, 58, 1, 121, 255, 3, 255, 14, 58, 1, 215, 222, 249, 226, 58, 1, 
-    163, 215, 222, 249, 226, 58, 1, 250, 173, 44, 163, 222, 233, 58, 1, 250, 
-    173, 43, 163, 222, 233, 58, 1, 120, 217, 87, 58, 1, 124, 217, 87, 58, 1, 
-    96, 50, 58, 1, 230, 182, 50, 251, 146, 59, 48, 222, 234, 48, 226, 224, 4, 
-    182, 52, 255, 3, 255, 14, 58, 1, 223, 36, 103, 58, 1, 249, 131, 255, 14, 
-    58, 1, 4, 243, 107, 58, 1, 4, 156, 58, 1, 4, 222, 91, 58, 1, 4, 211, 178, 
-    58, 1, 4, 223, 49, 242, 180, 218, 129, 58, 1, 245, 20, 138, 130, 58, 1, 
-    125, 138, 130, 58, 1, 230, 225, 138, 130, 58, 1, 121, 138, 130, 58, 1, 
-    245, 19, 138, 130, 58, 1, 210, 254, 248, 44, 138, 78, 58, 1, 211, 70, 
-    248, 44, 138, 78, 58, 1, 213, 133, 58, 1, 214, 186, 58, 1, 52, 254, 57, 
-    58, 1, 121, 124, 253, 249, 58, 1, 121, 120, 253, 249, 58, 1, 121, 43, 
-    253, 249, 58, 1, 121, 44, 253, 249, 58, 1, 121, 222, 233, 58, 1, 230, 
-    224, 242, 137, 255, 14, 58, 1, 230, 224, 52, 242, 137, 255, 14, 58, 1, 
-    230, 224, 52, 255, 3, 255, 14, 58, 1, 121, 182, 58, 1, 223, 157, 249, 
-    226, 58, 1, 252, 58, 125, 216, 30, 58, 1, 245, 143, 125, 216, 30, 58, 1, 
-    252, 58, 121, 216, 30, 58, 1, 245, 143, 121, 216, 30, 58, 1, 220, 54, 58, 
-    1, 204, 220, 54, 58, 1, 121, 43, 74, 38, 242, 137, 255, 14, 38, 255, 3, 
-    255, 14, 38, 250, 31, 255, 14, 38, 182, 38, 231, 232, 38, 226, 119, 38, 
-    251, 146, 38, 59, 48, 38, 248, 1, 38, 241, 52, 48, 38, 222, 234, 48, 38, 
-    52, 255, 3, 255, 14, 38, 250, 234, 38, 67, 232, 214, 48, 38, 52, 67, 232, 
-    214, 48, 38, 52, 242, 137, 255, 14, 38, 250, 255, 38, 235, 193, 251, 146, 
-    38, 215, 94, 249, 220, 48, 38, 249, 220, 48, 38, 223, 49, 249, 220, 48, 
-    38, 249, 220, 77, 222, 251, 38, 242, 137, 255, 15, 51, 38, 255, 3, 255, 
-    15, 51, 38, 43, 217, 88, 51, 38, 44, 217, 88, 51, 38, 43, 254, 110, 48, 
-    38, 240, 248, 38, 43, 163, 222, 234, 51, 38, 120, 217, 88, 51, 38, 124, 
-    217, 88, 51, 38, 96, 5, 51, 38, 230, 182, 5, 51, 38, 226, 64, 241, 52, 
-    51, 38, 223, 55, 241, 52, 51, 38, 59, 51, 38, 248, 2, 51, 38, 222, 234, 
-    51, 38, 249, 220, 51, 38, 250, 183, 38, 226, 224, 38, 67, 232, 214, 51, 
-    38, 251, 140, 51, 38, 235, 193, 52, 254, 24, 51, 38, 250, 235, 51, 38, 
-    250, 31, 255, 15, 51, 38, 251, 147, 51, 38, 235, 193, 251, 147, 51, 38, 
-    216, 89, 51, 38, 231, 233, 51, 38, 121, 232, 213, 38, 52, 121, 232, 213, 
-    38, 216, 89, 226, 120, 38, 219, 251, 218, 103, 226, 120, 38, 199, 218, 
-    103, 226, 120, 38, 219, 251, 219, 47, 226, 120, 38, 199, 219, 47, 226, 
-    120, 38, 44, 163, 222, 234, 51, 38, 235, 193, 251, 140, 51, 38, 42, 51, 
-    38, 221, 180, 51, 38, 211, 179, 48, 38, 67, 182, 38, 52, 226, 119, 38, 
-    242, 137, 138, 78, 38, 255, 3, 138, 78, 38, 26, 225, 175, 38, 26, 234, 2, 
-    38, 26, 247, 252, 216, 18, 38, 26, 210, 219, 38, 251, 140, 48, 38, 245, 
-    98, 5, 51, 38, 52, 67, 232, 214, 51, 38, 43, 254, 110, 51, 38, 228, 52, 
-    216, 89, 48, 38, 241, 58, 48, 38, 254, 148, 128, 216, 42, 48, 38, 43, 44, 
-    80, 51, 38, 214, 153, 80, 51, 38, 242, 142, 235, 63, 38, 44, 253, 250, 
-    48, 38, 43, 163, 222, 234, 48, 38, 244, 131, 38, 211, 179, 51, 38, 43, 
-    253, 250, 51, 38, 44, 253, 250, 51, 38, 44, 253, 250, 22, 120, 253, 250, 
-    51, 38, 44, 163, 222, 234, 48, 38, 59, 77, 222, 251, 38, 253, 217, 51, 
-    38, 52, 222, 234, 51, 38, 210, 35, 48, 38, 52, 251, 147, 51, 38, 52, 251, 
-    146, 38, 52, 231, 232, 38, 52, 231, 233, 51, 38, 52, 182, 38, 52, 235, 
-    193, 251, 146, 38, 52, 97, 80, 51, 38, 7, 4, 1, 61, 38, 7, 4, 1, 75, 38, 
-    7, 4, 1, 73, 38, 7, 4, 1, 76, 38, 7, 4, 1, 70, 38, 7, 4, 1, 251, 66, 38, 
-    7, 4, 1, 249, 60, 38, 7, 4, 1, 242, 60, 38, 7, 4, 1, 193, 38, 7, 4, 1, 
-    153, 38, 7, 4, 1, 217, 152, 38, 7, 4, 1, 214, 105, 38, 7, 4, 1, 211, 178, 
-    26, 6, 1, 241, 196, 26, 4, 1, 241, 196, 26, 6, 1, 254, 23, 221, 246, 26, 
-    4, 1, 254, 23, 221, 246, 26, 227, 198, 50, 26, 232, 108, 227, 198, 50, 
-    26, 6, 1, 226, 51, 247, 227, 26, 4, 1, 226, 51, 247, 227, 26, 210, 219, 
-    26, 4, 223, 49, 232, 83, 219, 178, 87, 26, 4, 246, 118, 232, 83, 219, 
-    178, 87, 26, 4, 223, 49, 246, 118, 232, 83, 219, 178, 87, 26, 224, 13, 
-    78, 26, 216, 18, 26, 247, 252, 216, 18, 26, 6, 1, 254, 144, 2, 216, 18, 
-    26, 254, 97, 217, 2, 26, 6, 1, 245, 101, 2, 216, 18, 26, 6, 1, 245, 64, 
-    2, 216, 18, 26, 6, 1, 235, 186, 2, 216, 18, 26, 6, 1, 226, 200, 2, 216, 
-    18, 26, 6, 1, 214, 158, 2, 216, 18, 26, 6, 1, 226, 202, 2, 216, 18, 26, 
-    4, 1, 235, 186, 2, 247, 252, 22, 216, 18, 26, 6, 1, 254, 143, 26, 6, 1, 
-    252, 26, 26, 6, 1, 243, 107, 26, 6, 1, 248, 54, 26, 6, 1, 245, 100, 26, 
-    6, 1, 210, 85, 26, 6, 1, 245, 63, 26, 6, 1, 216, 179, 26, 6, 1, 235, 185, 
-    26, 6, 1, 234, 222, 26, 6, 1, 233, 98, 26, 6, 1, 230, 102, 26, 6, 1, 227, 
-    237, 26, 6, 1, 211, 157, 26, 6, 1, 226, 199, 26, 6, 1, 225, 108, 26, 6, 
-    1, 223, 37, 26, 6, 1, 219, 177, 26, 6, 1, 217, 41, 26, 6, 1, 214, 157, 
-    26, 6, 1, 225, 133, 26, 6, 1, 250, 110, 26, 6, 1, 224, 161, 26, 6, 1, 
-    226, 201, 26, 6, 1, 235, 186, 2, 247, 251, 26, 6, 1, 214, 158, 2, 247, 
-    251, 26, 4, 1, 254, 144, 2, 216, 18, 26, 4, 1, 245, 101, 2, 216, 18, 26, 
-    4, 1, 245, 64, 2, 216, 18, 26, 4, 1, 235, 186, 2, 216, 18, 26, 4, 1, 214, 
-    158, 2, 247, 252, 22, 216, 18, 26, 4, 1, 254, 143, 26, 4, 1, 252, 26, 26, 
-    4, 1, 243, 107, 26, 4, 1, 248, 54, 26, 4, 1, 245, 100, 26, 4, 1, 210, 85, 
-    26, 4, 1, 245, 63, 26, 4, 1, 216, 179, 26, 4, 1, 235, 185, 26, 4, 1, 234, 
-    222, 26, 4, 1, 233, 98, 26, 4, 1, 230, 102, 26, 4, 1, 227, 237, 26, 4, 1, 
-    211, 157, 26, 4, 1, 226, 199, 26, 4, 1, 225, 108, 26, 4, 1, 223, 37, 26, 
-    4, 1, 40, 219, 177, 26, 4, 1, 219, 177, 26, 4, 1, 217, 41, 26, 4, 1, 214, 
-    157, 26, 4, 1, 225, 133, 26, 4, 1, 250, 110, 26, 4, 1, 224, 161, 26, 4, 
-    1, 226, 201, 26, 4, 1, 235, 186, 2, 247, 251, 26, 4, 1, 214, 158, 2, 247, 
-    251, 26, 4, 1, 226, 200, 2, 216, 18, 26, 4, 1, 214, 158, 2, 216, 18, 26, 
-    4, 1, 226, 202, 2, 216, 18, 26, 6, 234, 247, 87, 26, 252, 27, 87, 26, 
-    216, 180, 87, 26, 214, 158, 2, 241, 52, 87, 26, 214, 158, 2, 255, 3, 22, 
-    241, 52, 87, 26, 214, 158, 2, 248, 2, 22, 241, 52, 87, 26, 225, 134, 87, 
-    26, 225, 109, 87, 26, 234, 247, 87, 26, 1, 254, 23, 234, 6, 26, 4, 1, 
-    254, 23, 234, 6, 26, 1, 218, 137, 26, 4, 1, 218, 137, 26, 1, 247, 227, 
-    26, 4, 1, 247, 227, 26, 1, 234, 6, 26, 4, 1, 234, 6, 26, 1, 221, 246, 26, 
-    4, 1, 221, 246, 81, 6, 1, 220, 55, 81, 4, 1, 220, 55, 81, 6, 1, 244, 140, 
-    81, 4, 1, 244, 140, 81, 6, 1, 234, 117, 81, 4, 1, 234, 117, 81, 6, 1, 
-    241, 45, 81, 4, 1, 241, 45, 81, 6, 1, 243, 102, 81, 4, 1, 243, 102, 81, 
-    6, 1, 220, 22, 81, 4, 1, 220, 22, 81, 6, 1, 248, 69, 81, 4, 1, 248, 69, 
-    26, 234, 223, 87, 26, 223, 38, 87, 26, 232, 83, 219, 178, 87, 26, 1, 210, 
-    224, 26, 6, 216, 180, 87, 26, 232, 83, 245, 101, 87, 26, 223, 49, 232, 
-    83, 245, 101, 87, 26, 6, 1, 220, 7, 26, 4, 1, 220, 7, 26, 6, 232, 83, 
-    219, 178, 87, 26, 6, 1, 221, 243, 26, 4, 1, 221, 243, 26, 223, 38, 2, 
-    218, 103, 87, 26, 6, 223, 49, 232, 83, 219, 178, 87, 26, 6, 246, 118, 
-    232, 83, 219, 178, 87, 26, 6, 223, 49, 246, 118, 232, 83, 219, 178, 87, 
-    33, 6, 1, 236, 61, 2, 242, 136, 33, 6, 1, 235, 189, 33, 6, 1, 247, 162, 
-    33, 6, 1, 242, 187, 33, 6, 1, 214, 202, 236, 60, 33, 6, 1, 246, 36, 33, 
-    6, 1, 251, 76, 73, 33, 6, 1, 211, 8, 33, 6, 1, 235, 126, 33, 6, 1, 232, 
-    187, 33, 6, 1, 228, 178, 33, 6, 1, 215, 174, 33, 6, 1, 234, 48, 33, 6, 1, 
-    240, 154, 2, 242, 136, 33, 6, 1, 219, 251, 70, 33, 6, 1, 246, 32, 33, 6, 
-    1, 61, 33, 6, 1, 252, 75, 33, 6, 1, 213, 255, 33, 6, 1, 242, 236, 33, 6, 
-    1, 248, 90, 33, 6, 1, 236, 60, 33, 6, 1, 210, 74, 33, 6, 1, 210, 94, 33, 
-    6, 1, 73, 33, 6, 1, 219, 251, 73, 33, 6, 1, 176, 33, 6, 1, 245, 174, 33, 
-    6, 1, 245, 159, 33, 6, 1, 245, 150, 33, 6, 1, 76, 33, 6, 1, 225, 221, 33, 
-    6, 1, 245, 92, 33, 6, 1, 245, 82, 33, 6, 1, 217, 22, 33, 6, 1, 70, 33, 6, 
-    1, 245, 202, 33, 6, 1, 162, 33, 6, 1, 215, 178, 33, 6, 1, 250, 131, 33, 
-    6, 1, 220, 102, 33, 6, 1, 220, 65, 33, 6, 1, 242, 3, 50, 33, 6, 1, 211, 
-    27, 33, 6, 1, 219, 52, 50, 33, 6, 1, 75, 33, 6, 1, 210, 212, 33, 6, 1, 
-    191, 33, 4, 1, 61, 33, 4, 1, 252, 75, 33, 4, 1, 213, 255, 33, 4, 1, 242, 
-    236, 33, 4, 1, 248, 90, 33, 4, 1, 236, 60, 33, 4, 1, 210, 74, 33, 4, 1, 
-    210, 94, 33, 4, 1, 73, 33, 4, 1, 219, 251, 73, 33, 4, 1, 176, 33, 4, 1, 
-    245, 174, 33, 4, 1, 245, 159, 33, 4, 1, 245, 150, 33, 4, 1, 76, 33, 4, 1, 
-    225, 221, 33, 4, 1, 245, 92, 33, 4, 1, 245, 82, 33, 4, 1, 217, 22, 33, 4, 
-    1, 70, 33, 4, 1, 245, 202, 33, 4, 1, 162, 33, 4, 1, 215, 178, 33, 4, 1, 
-    250, 131, 33, 4, 1, 220, 102, 33, 4, 1, 220, 65, 33, 4, 1, 242, 3, 50, 
-    33, 4, 1, 211, 27, 33, 4, 1, 219, 52, 50, 33, 4, 1, 75, 33, 4, 1, 210, 
-    212, 33, 4, 1, 191, 33, 4, 1, 236, 61, 2, 242, 136, 33, 4, 1, 235, 189, 
-    33, 4, 1, 247, 162, 33, 4, 1, 242, 187, 33, 4, 1, 214, 202, 236, 60, 33, 
-    4, 1, 246, 36, 33, 4, 1, 251, 76, 73, 33, 4, 1, 211, 8, 33, 4, 1, 235, 
-    126, 33, 4, 1, 232, 187, 33, 4, 1, 228, 178, 33, 4, 1, 215, 174, 33, 4, 
-    1, 234, 48, 33, 4, 1, 240, 154, 2, 242, 136, 33, 4, 1, 219, 251, 70, 33, 
-    4, 1, 246, 32, 33, 6, 1, 226, 201, 33, 4, 1, 226, 201, 33, 6, 1, 211, 59, 
-    33, 4, 1, 211, 59, 33, 6, 1, 235, 183, 75, 33, 4, 1, 235, 183, 75, 33, 6, 
-    1, 232, 192, 210, 183, 33, 4, 1, 232, 192, 210, 183, 33, 6, 1, 235, 183, 
-    232, 192, 210, 183, 33, 4, 1, 235, 183, 232, 192, 210, 183, 33, 6, 1, 
-    251, 249, 210, 183, 33, 4, 1, 251, 249, 210, 183, 33, 6, 1, 235, 183, 
-    251, 249, 210, 183, 33, 4, 1, 235, 183, 251, 249, 210, 183, 33, 6, 1, 
-    233, 233, 33, 4, 1, 233, 233, 33, 6, 1, 224, 161, 33, 4, 1, 224, 161, 33, 
-    6, 1, 244, 82, 33, 4, 1, 244, 82, 33, 6, 1, 235, 146, 33, 4, 1, 235, 146, 
-    33, 6, 1, 235, 147, 2, 52, 242, 137, 255, 14, 33, 4, 1, 235, 147, 2, 52, 
-    242, 137, 255, 14, 33, 6, 1, 214, 205, 33, 4, 1, 214, 205, 33, 6, 1, 222, 
-    185, 226, 201, 33, 4, 1, 222, 185, 226, 201, 33, 6, 1, 226, 202, 2, 216, 
-    65, 33, 4, 1, 226, 202, 2, 216, 65, 33, 6, 1, 226, 140, 33, 4, 1, 226, 
-    140, 33, 6, 1, 234, 6, 33, 4, 1, 234, 6, 33, 216, 146, 50, 38, 33, 216, 
-    65, 38, 33, 226, 65, 38, 33, 248, 154, 225, 18, 38, 33, 224, 155, 225, 
-    18, 38, 33, 225, 3, 38, 33, 240, 211, 216, 146, 50, 38, 33, 230, 191, 50, 
-    33, 6, 1, 219, 251, 240, 154, 2, 217, 77, 33, 4, 1, 219, 251, 240, 154, 
-    2, 217, 77, 33, 6, 1, 220, 146, 50, 33, 4, 1, 220, 146, 50, 33, 6, 1, 
-    245, 93, 2, 216, 114, 33, 4, 1, 245, 93, 2, 216, 114, 33, 6, 1, 242, 237, 
-    2, 214, 156, 33, 4, 1, 242, 237, 2, 214, 156, 33, 6, 1, 242, 237, 2, 91, 
-    33, 4, 1, 242, 237, 2, 91, 33, 6, 1, 242, 237, 2, 230, 224, 103, 33, 4, 
-    1, 242, 237, 2, 230, 224, 103, 33, 6, 1, 210, 75, 2, 248, 39, 33, 4, 1, 
-    210, 75, 2, 248, 39, 33, 6, 1, 210, 95, 2, 248, 39, 33, 4, 1, 210, 95, 2, 
-    248, 39, 33, 6, 1, 235, 13, 2, 248, 39, 33, 4, 1, 235, 13, 2, 248, 39, 
-    33, 6, 1, 235, 13, 2, 67, 91, 33, 4, 1, 235, 13, 2, 67, 91, 33, 6, 1, 
-    235, 13, 2, 91, 33, 4, 1, 235, 13, 2, 91, 33, 6, 1, 252, 124, 176, 33, 4, 
-    1, 252, 124, 176, 33, 6, 1, 245, 151, 2, 248, 39, 33, 4, 1, 245, 151, 2, 
-    248, 39, 33, 6, 27, 245, 151, 242, 236, 33, 4, 27, 245, 151, 242, 236, 
-    33, 6, 1, 225, 222, 2, 230, 224, 103, 33, 4, 1, 225, 222, 2, 230, 224, 
-    103, 33, 6, 1, 255, 20, 162, 33, 4, 1, 255, 20, 162, 33, 6, 1, 245, 83, 
-    2, 248, 39, 33, 4, 1, 245, 83, 2, 248, 39, 33, 6, 1, 217, 23, 2, 248, 39, 
-    33, 4, 1, 217, 23, 2, 248, 39, 33, 6, 1, 218, 121, 70, 33, 4, 1, 218, 
-    121, 70, 33, 6, 1, 218, 121, 104, 2, 91, 33, 4, 1, 218, 121, 104, 2, 91, 
-    33, 6, 1, 242, 49, 2, 248, 39, 33, 4, 1, 242, 49, 2, 248, 39, 33, 6, 27, 
-    217, 23, 215, 178, 33, 4, 27, 217, 23, 215, 178, 33, 6, 1, 250, 132, 2, 
-    248, 39, 33, 4, 1, 250, 132, 2, 248, 39, 33, 6, 1, 250, 132, 2, 67, 91, 
-    33, 4, 1, 250, 132, 2, 67, 91, 33, 6, 1, 220, 33, 33, 4, 1, 220, 33, 33, 
-    6, 1, 255, 20, 250, 131, 33, 4, 1, 255, 20, 250, 131, 33, 6, 1, 255, 20, 
-    250, 132, 2, 248, 39, 33, 4, 1, 255, 20, 250, 132, 2, 248, 39, 33, 1, 
-    226, 58, 33, 6, 1, 210, 75, 2, 251, 146, 33, 4, 1, 210, 75, 2, 251, 146, 
-    33, 6, 1, 235, 13, 2, 103, 33, 4, 1, 235, 13, 2, 103, 33, 6, 1, 245, 175, 
-    2, 217, 77, 33, 4, 1, 245, 175, 2, 217, 77, 33, 6, 1, 245, 151, 2, 103, 
-    33, 4, 1, 245, 151, 2, 103, 33, 6, 1, 245, 151, 2, 217, 77, 33, 4, 1, 
-    245, 151, 2, 217, 77, 33, 6, 1, 234, 127, 250, 131, 33, 4, 1, 234, 127, 
-    250, 131, 33, 6, 1, 245, 160, 2, 217, 77, 33, 4, 1, 245, 160, 2, 217, 77, 
-    33, 4, 1, 226, 58, 33, 6, 1, 115, 2, 251, 146, 33, 4, 1, 115, 2, 251, 
-    146, 33, 6, 1, 115, 2, 248, 1, 33, 4, 1, 115, 2, 248, 1, 33, 6, 27, 115, 
-    236, 60, 33, 4, 27, 115, 236, 60, 33, 6, 1, 236, 61, 2, 251, 146, 33, 4, 
-    1, 236, 61, 2, 251, 146, 33, 6, 1, 221, 195, 33, 4, 1, 221, 195, 33, 6, 
-    1, 221, 196, 2, 248, 1, 33, 4, 1, 221, 196, 2, 248, 1, 33, 6, 1, 210, 75, 
-    2, 248, 1, 33, 4, 1, 210, 75, 2, 248, 1, 33, 6, 1, 210, 95, 2, 248, 1, 
-    33, 4, 1, 210, 95, 2, 248, 1, 33, 6, 1, 255, 20, 246, 36, 33, 4, 1, 255, 
-    20, 246, 36, 33, 6, 1, 240, 154, 2, 231, 232, 33, 4, 1, 240, 154, 2, 231, 
-    232, 33, 6, 1, 240, 154, 2, 248, 1, 33, 4, 1, 240, 154, 2, 248, 1, 33, 6, 
-    1, 144, 2, 248, 1, 33, 4, 1, 144, 2, 248, 1, 33, 6, 1, 252, 134, 76, 33, 
-    4, 1, 252, 134, 76, 33, 6, 1, 252, 134, 144, 2, 248, 1, 33, 4, 1, 252, 
-    134, 144, 2, 248, 1, 33, 6, 1, 160, 2, 248, 1, 33, 4, 1, 160, 2, 248, 1, 
-    33, 6, 1, 104, 2, 231, 232, 33, 4, 1, 104, 2, 231, 232, 33, 6, 1, 104, 2, 
-    248, 1, 33, 4, 1, 104, 2, 248, 1, 33, 6, 1, 104, 2, 52, 142, 33, 4, 1, 
-    104, 2, 52, 142, 33, 6, 1, 250, 132, 2, 248, 1, 33, 4, 1, 250, 132, 2, 
-    248, 1, 33, 6, 1, 242, 237, 2, 248, 39, 33, 4, 1, 242, 237, 2, 248, 39, 
-    33, 6, 1, 211, 28, 2, 248, 1, 33, 4, 1, 211, 28, 2, 248, 1, 33, 6, 1, 
-    242, 237, 2, 218, 103, 22, 103, 33, 4, 1, 242, 237, 2, 218, 103, 22, 103, 
-    33, 6, 1, 242, 49, 2, 103, 33, 4, 1, 242, 49, 2, 103, 33, 6, 1, 242, 49, 
-    2, 91, 33, 4, 1, 242, 49, 2, 91, 33, 6, 1, 234, 14, 248, 90, 33, 4, 1, 
-    234, 14, 248, 90, 33, 6, 1, 234, 14, 247, 162, 33, 4, 1, 234, 14, 247, 
-    162, 33, 6, 1, 234, 14, 210, 27, 33, 4, 1, 234, 14, 210, 27, 33, 6, 1, 
-    234, 14, 246, 30, 33, 4, 1, 234, 14, 246, 30, 33, 6, 1, 234, 14, 232, 
-    187, 33, 4, 1, 234, 14, 232, 187, 33, 6, 1, 234, 14, 228, 178, 33, 4, 1, 
-    234, 14, 228, 178, 33, 6, 1, 234, 14, 219, 109, 33, 4, 1, 234, 14, 219, 
-    109, 33, 6, 1, 234, 14, 216, 60, 33, 4, 1, 234, 14, 216, 60, 33, 6, 1, 
-    223, 49, 210, 94, 33, 4, 1, 223, 49, 210, 94, 33, 6, 1, 245, 175, 2, 103, 
-    33, 4, 1, 245, 175, 2, 103, 33, 6, 1, 232, 254, 33, 4, 1, 232, 254, 33, 
-    6, 1, 223, 39, 33, 4, 1, 223, 39, 33, 6, 1, 211, 92, 33, 4, 1, 211, 92, 
-    33, 6, 1, 224, 88, 33, 4, 1, 224, 88, 33, 6, 1, 212, 22, 33, 4, 1, 212, 
-    22, 33, 6, 1, 254, 166, 176, 33, 4, 1, 254, 166, 176, 33, 6, 1, 245, 175, 
-    2, 230, 224, 103, 33, 4, 1, 245, 175, 2, 230, 224, 103, 33, 6, 1, 245, 
-    151, 2, 230, 224, 103, 33, 4, 1, 245, 151, 2, 230, 224, 103, 33, 6, 1, 
-    225, 222, 2, 248, 39, 33, 4, 1, 225, 222, 2, 248, 39, 33, 6, 1, 220, 34, 
-    2, 248, 39, 33, 4, 1, 220, 34, 2, 248, 39, 150, 6, 1, 253, 164, 150, 6, 
-    1, 252, 39, 150, 6, 1, 242, 203, 150, 6, 1, 248, 221, 150, 6, 1, 245, 
-    213, 150, 6, 1, 210, 116, 150, 6, 1, 245, 197, 150, 6, 1, 245, 65, 150, 
-    6, 1, 111, 150, 6, 1, 210, 74, 150, 6, 1, 235, 227, 150, 6, 1, 232, 190, 
-    150, 6, 1, 211, 160, 150, 6, 1, 251, 33, 150, 6, 1, 234, 165, 150, 6, 1, 
-    241, 68, 150, 6, 1, 235, 141, 150, 6, 1, 242, 246, 150, 6, 1, 250, 126, 
-    150, 6, 1, 231, 58, 150, 6, 1, 211, 8, 150, 6, 1, 228, 39, 150, 6, 1, 
-    220, 102, 150, 6, 1, 213, 138, 150, 6, 1, 250, 157, 150, 6, 1, 225, 205, 
-    150, 6, 1, 235, 110, 150, 6, 1, 205, 150, 6, 1, 221, 161, 150, 6, 1, 213, 
-    179, 150, 6, 1, 216, 62, 150, 6, 1, 223, 95, 150, 6, 1, 249, 238, 150, 6, 
-    1, 210, 249, 150, 6, 1, 225, 46, 150, 6, 1, 234, 176, 150, 6, 1, 226, 
-    222, 150, 6, 1, 244, 142, 150, 58, 1, 43, 163, 222, 233, 150, 254, 57, 
-    150, 245, 154, 78, 150, 245, 31, 78, 150, 249, 219, 150, 224, 13, 78, 
-    150, 255, 21, 78, 150, 4, 1, 253, 164, 150, 4, 1, 252, 39, 150, 4, 1, 
-    242, 203, 150, 4, 1, 248, 221, 150, 4, 1, 245, 213, 150, 4, 1, 210, 116, 
-    150, 4, 1, 245, 197, 150, 4, 1, 245, 65, 150, 4, 1, 111, 150, 4, 1, 210, 
-    74, 150, 4, 1, 235, 227, 150, 4, 1, 232, 190, 150, 4, 1, 211, 160, 150, 
-    4, 1, 251, 33, 150, 4, 1, 234, 165, 150, 4, 1, 241, 68, 150, 4, 1, 235, 
-    141, 150, 4, 1, 242, 246, 150, 4, 1, 250, 126, 150, 4, 1, 231, 58, 150, 
-    4, 1, 211, 8, 150, 4, 1, 228, 39, 150, 4, 1, 220, 102, 150, 4, 1, 213, 
-    138, 150, 4, 1, 250, 157, 150, 4, 1, 225, 205, 150, 4, 1, 235, 110, 150, 
-    4, 1, 205, 150, 4, 1, 221, 161, 150, 4, 1, 213, 179, 150, 4, 1, 216, 62, 
-    150, 4, 1, 223, 95, 150, 4, 1, 249, 238, 150, 4, 1, 210, 249, 150, 4, 1, 
-    225, 46, 150, 4, 1, 234, 176, 150, 4, 1, 226, 222, 150, 4, 1, 244, 142, 
-    150, 4, 27, 245, 214, 210, 249, 150, 243, 229, 218, 129, 150, 240, 168, 
-    150, 246, 95, 50, 94, 255, 15, 245, 57, 94, 255, 15, 221, 162, 94, 255, 
-    15, 220, 88, 94, 255, 15, 210, 104, 224, 71, 94, 255, 15, 210, 104, 243, 
-    125, 94, 255, 15, 216, 75, 94, 255, 15, 223, 47, 94, 255, 15, 210, 103, 
-    94, 255, 15, 225, 245, 94, 255, 15, 211, 20, 94, 255, 15, 216, 214, 94, 
-    255, 15, 243, 41, 94, 255, 15, 243, 42, 230, 69, 94, 255, 15, 243, 39, 
-    94, 255, 15, 224, 72, 226, 16, 94, 255, 15, 216, 253, 243, 56, 94, 255, 
-    15, 225, 226, 94, 255, 15, 253, 200, 242, 41, 94, 255, 15, 230, 79, 94, 
-    255, 15, 231, 208, 94, 255, 15, 231, 49, 94, 255, 15, 231, 50, 234, 177, 
-    94, 255, 15, 248, 163, 94, 255, 15, 224, 83, 94, 255, 15, 216, 253, 224, 
-    67, 94, 255, 15, 211, 30, 252, 40, 210, 230, 94, 255, 15, 226, 207, 94, 
-    255, 15, 236, 19, 94, 255, 15, 248, 70, 94, 255, 15, 210, 33, 94, 164, 
-    231, 143, 250, 35, 94, 225, 11, 220, 36, 94, 225, 11, 241, 250, 221, 162, 
-    94, 225, 11, 241, 250, 225, 239, 94, 225, 11, 241, 250, 224, 76, 94, 225, 
-    11, 241, 158, 94, 225, 11, 215, 176, 94, 225, 11, 221, 162, 94, 225, 11, 
-    225, 239, 94, 225, 11, 224, 76, 94, 225, 11, 241, 61, 94, 225, 11, 241, 
-    62, 241, 252, 31, 214, 3, 94, 225, 11, 224, 17, 94, 225, 11, 248, 208, 
-    177, 231, 171, 94, 225, 11, 231, 38, 94, 224, 141, 231, 168, 94, 225, 11, 
-    223, 169, 94, 224, 141, 225, 247, 94, 225, 11, 220, 21, 247, 120, 94, 
-    225, 11, 219, 159, 247, 120, 94, 224, 141, 219, 53, 225, 241, 94, 164, 
-    214, 160, 247, 120, 94, 164, 232, 108, 247, 120, 94, 224, 141, 227, 195, 
-    242, 40, 94, 225, 11, 224, 77, 224, 71, 94, 1, 254, 170, 94, 1, 252, 28, 
-    94, 1, 242, 201, 94, 1, 248, 189, 94, 1, 241, 238, 94, 1, 214, 3, 94, 1, 
-    210, 97, 94, 1, 241, 197, 94, 1, 216, 230, 94, 1, 210, 233, 94, 1, 40, 
-    234, 250, 94, 1, 234, 250, 94, 1, 233, 94, 94, 1, 40, 231, 65, 94, 1, 
-    231, 65, 94, 1, 40, 227, 194, 94, 1, 227, 194, 94, 1, 221, 249, 94, 1, 
-    253, 162, 94, 1, 40, 225, 221, 94, 1, 225, 221, 94, 1, 40, 215, 179, 94, 
-    1, 215, 179, 94, 1, 224, 39, 94, 1, 223, 67, 94, 1, 220, 20, 94, 1, 217, 
-    38, 94, 27, 211, 6, 52, 214, 3, 94, 27, 211, 6, 214, 4, 210, 233, 94, 27, 
-    211, 6, 52, 210, 233, 94, 224, 141, 243, 41, 94, 224, 141, 243, 39, 10, 
-    54, 50, 10, 5, 221, 242, 10, 244, 30, 231, 154, 10, 5, 222, 23, 10, 5, 
-    221, 245, 254, 37, 249, 109, 222, 193, 254, 37, 244, 4, 222, 193, 10, 
-    223, 134, 254, 37, 225, 183, 230, 193, 50, 254, 37, 225, 183, 216, 248, 
-    216, 148, 50, 254, 221, 50, 10, 249, 219, 10, 248, 150, 220, 137, 10, 
-    225, 13, 213, 241, 50, 10, 5, 230, 174, 10, 5, 222, 3, 254, 172, 212, 45, 
-    10, 5, 254, 172, 253, 221, 10, 5, 223, 167, 254, 171, 10, 5, 223, 175, 
-    254, 152, 254, 104, 10, 5, 217, 70, 10, 4, 125, 217, 80, 10, 4, 125, 27, 
-    112, 2, 233, 103, 2, 211, 43, 10, 4, 125, 210, 108, 10, 4, 244, 165, 10, 
-    4, 248, 184, 10, 4, 234, 205, 10, 220, 150, 10, 215, 211, 59, 224, 141, 
-    78, 10, 224, 13, 78, 10, 1, 234, 209, 211, 43, 10, 1, 242, 19, 10, 1, 
-    112, 2, 231, 228, 48, 10, 1, 112, 2, 202, 48, 10, 1, 212, 31, 2, 202, 48, 
-    10, 1, 112, 2, 202, 51, 10, 1, 79, 2, 202, 48, 10, 1, 254, 170, 10, 1, 
-    252, 54, 10, 1, 217, 8, 231, 164, 10, 1, 217, 7, 10, 1, 216, 192, 10, 1, 
-    235, 123, 10, 1, 242, 37, 10, 1, 234, 129, 10, 1, 248, 195, 10, 1, 216, 
-    202, 10, 1, 223, 95, 10, 1, 210, 108, 10, 1, 221, 166, 10, 1, 220, 59, 
-    10, 1, 222, 26, 10, 1, 248, 216, 10, 1, 217, 80, 10, 1, 210, 111, 10, 1, 
-    254, 196, 10, 1, 242, 244, 10, 1, 234, 175, 2, 113, 170, 48, 10, 1, 234, 
-    175, 2, 134, 170, 51, 10, 1, 244, 168, 79, 2, 235, 193, 214, 105, 10, 1, 
-    244, 168, 79, 2, 113, 170, 48, 10, 1, 244, 168, 79, 2, 134, 170, 48, 10, 
-    217, 43, 10, 1, 244, 142, 10, 1, 224, 81, 10, 1, 234, 250, 10, 1, 233, 
-    102, 10, 1, 231, 78, 10, 1, 228, 62, 10, 1, 241, 218, 10, 1, 212, 30, 10, 
-    1, 112, 231, 192, 10, 1, 211, 43, 10, 244, 163, 10, 248, 182, 10, 234, 
-    203, 10, 244, 165, 10, 248, 184, 10, 234, 205, 10, 220, 93, 10, 218, 45, 
-    10, 231, 226, 48, 10, 202, 48, 10, 202, 51, 10, 218, 65, 254, 170, 10, 
-    235, 193, 248, 184, 10, 164, 228, 63, 242, 218, 10, 209, 255, 10, 25, 5, 
-    4, 214, 106, 48, 10, 25, 5, 235, 193, 4, 214, 106, 48, 10, 25, 5, 59, 51, 
-    10, 223, 49, 248, 184, 10, 244, 166, 2, 113, 247, 118, 10, 212, 32, 202, 
-    51, 254, 37, 21, 210, 86, 254, 37, 21, 110, 254, 37, 21, 105, 254, 37, 
-    21, 158, 254, 37, 21, 161, 254, 37, 21, 189, 254, 37, 21, 194, 254, 37, 
-    21, 198, 254, 37, 21, 195, 254, 37, 21, 200, 10, 225, 182, 50, 10, 248, 
-    83, 220, 137, 10, 216, 146, 220, 137, 10, 244, 81, 225, 9, 218, 156, 10, 
-    1, 247, 119, 252, 54, 10, 1, 247, 119, 224, 81, 10, 1, 218, 23, 254, 170, 
-    10, 1, 112, 212, 46, 10, 1, 112, 2, 212, 32, 202, 48, 10, 1, 112, 2, 212, 
-    32, 202, 51, 10, 1, 125, 242, 19, 10, 1, 125, 202, 254, 170, 10, 1, 125, 
-    202, 212, 30, 10, 1, 104, 2, 202, 48, 10, 1, 125, 202, 211, 43, 10, 1, 
-    215, 148, 10, 1, 215, 146, 10, 1, 252, 64, 10, 1, 217, 8, 2, 222, 233, 
-    10, 1, 217, 8, 2, 134, 170, 77, 246, 103, 10, 1, 225, 205, 10, 1, 217, 5, 
-    10, 1, 252, 52, 10, 1, 122, 2, 202, 48, 10, 1, 122, 2, 113, 170, 67, 48, 
-    10, 1, 227, 153, 10, 1, 246, 43, 10, 1, 122, 2, 134, 170, 48, 10, 1, 217, 
-    26, 10, 1, 217, 24, 10, 1, 248, 130, 10, 1, 248, 196, 2, 222, 233, 10, 1, 
-    248, 196, 2, 59, 51, 10, 1, 248, 196, 2, 59, 252, 43, 22, 4, 217, 80, 10, 
-    1, 248, 201, 10, 1, 248, 132, 10, 1, 246, 70, 10, 1, 248, 196, 2, 134, 
-    170, 77, 246, 103, 10, 1, 248, 196, 2, 244, 11, 170, 48, 10, 1, 222, 171, 
-    10, 1, 223, 96, 2, 4, 214, 105, 10, 1, 223, 96, 2, 222, 233, 10, 1, 223, 
-    96, 2, 59, 51, 10, 1, 223, 96, 2, 4, 214, 106, 51, 10, 1, 223, 96, 2, 59, 
-    252, 43, 22, 59, 48, 10, 1, 223, 96, 2, 113, 170, 48, 10, 1, 235, 120, 
-    10, 1, 223, 96, 2, 244, 11, 170, 48, 10, 1, 221, 167, 2, 59, 252, 43, 22, 
-    59, 48, 10, 1, 221, 167, 2, 134, 170, 51, 10, 1, 221, 167, 2, 134, 170, 
-    252, 43, 22, 134, 170, 48, 10, 1, 222, 27, 2, 113, 170, 51, 10, 1, 222, 
-    27, 2, 134, 170, 48, 10, 1, 217, 81, 2, 134, 170, 48, 10, 1, 254, 197, 2, 
-    134, 170, 48, 10, 1, 247, 119, 244, 142, 10, 1, 244, 143, 2, 59, 230, 
-    109, 51, 10, 1, 244, 143, 2, 59, 51, 10, 1, 213, 248, 10, 1, 244, 143, 2, 
-    134, 170, 51, 10, 1, 225, 203, 10, 1, 224, 82, 2, 59, 48, 10, 1, 224, 82, 
-    2, 134, 170, 48, 10, 1, 234, 174, 10, 1, 217, 250, 234, 250, 10, 1, 234, 
-    251, 2, 222, 233, 10, 1, 234, 251, 2, 59, 48, 10, 1, 229, 79, 10, 1, 234, 
-    251, 2, 134, 170, 51, 10, 1, 243, 122, 10, 1, 243, 123, 2, 222, 233, 10, 
-    1, 229, 2, 10, 1, 243, 123, 2, 113, 170, 51, 10, 1, 242, 101, 10, 1, 243, 
-    123, 2, 134, 170, 48, 10, 1, 233, 103, 2, 4, 214, 105, 10, 1, 233, 103, 
-    2, 59, 48, 10, 1, 233, 103, 2, 134, 170, 48, 10, 1, 233, 103, 2, 134, 
-    170, 51, 10, 1, 228, 63, 2, 59, 51, 10, 1, 228, 63, 242, 218, 10, 1, 222, 
-    214, 10, 1, 228, 63, 2, 222, 233, 10, 1, 228, 63, 2, 134, 170, 48, 10, 1, 
-    241, 219, 247, 141, 10, 1, 217, 27, 2, 59, 48, 10, 1, 241, 219, 2, 79, 
-    48, 10, 1, 241, 219, 242, 171, 10, 1, 241, 219, 242, 172, 2, 202, 48, 10, 
-    1, 217, 8, 231, 165, 242, 171, 10, 1, 212, 31, 2, 222, 233, 10, 1, 234, 
-    73, 226, 234, 10, 1, 226, 234, 10, 1, 70, 10, 1, 210, 212, 10, 1, 234, 
-    73, 210, 212, 10, 1, 212, 31, 2, 113, 170, 48, 10, 1, 213, 255, 10, 1, 
-    244, 168, 211, 43, 10, 1, 79, 2, 217, 77, 10, 1, 79, 2, 4, 214, 105, 10, 
-    1, 212, 31, 2, 59, 48, 10, 1, 75, 10, 1, 79, 2, 134, 170, 51, 10, 1, 79, 
-    252, 132, 10, 1, 79, 252, 133, 2, 202, 48, 10, 243, 229, 218, 129, 10, 1, 
-    254, 243, 10, 4, 125, 27, 222, 27, 2, 233, 103, 2, 112, 231, 192, 10, 4, 
-    125, 27, 224, 82, 2, 233, 103, 2, 112, 231, 192, 10, 4, 125, 66, 65, 17, 
-    10, 4, 125, 233, 103, 254, 170, 10, 4, 125, 235, 123, 10, 4, 125, 134, 
-    247, 118, 10, 4, 125, 221, 166, 10, 245, 143, 64, 253, 166, 10, 218, 152, 
-    64, 222, 138, 245, 175, 241, 155, 10, 4, 125, 222, 183, 210, 86, 10, 4, 
-    125, 214, 159, 223, 115, 210, 86, 10, 4, 125, 247, 119, 241, 236, 64, 
-    234, 129, 10, 4, 125, 66, 53, 17, 10, 4, 121, 221, 166, 10, 4, 125, 231, 
-    227, 10, 4, 212, 30, 10, 4, 211, 43, 10, 4, 125, 211, 43, 10, 4, 125, 
-    228, 62, 10, 225, 41, 64, 222, 13, 10, 245, 152, 250, 175, 121, 218, 129, 
-    10, 245, 152, 250, 175, 125, 218, 129, 10, 222, 183, 125, 218, 130, 2, 
-    244, 104, 250, 174, 10, 4, 121, 231, 78, 10, 1, 248, 196, 2, 235, 193, 
-    214, 105, 10, 1, 223, 96, 2, 235, 193, 214, 105, 245, 22, 254, 37, 21, 
-    210, 86, 245, 22, 254, 37, 21, 110, 245, 22, 254, 37, 21, 105, 245, 22, 
-    254, 37, 21, 158, 245, 22, 254, 37, 21, 161, 245, 22, 254, 37, 21, 189, 
-    245, 22, 254, 37, 21, 194, 245, 22, 254, 37, 21, 198, 245, 22, 254, 37, 
-    21, 195, 245, 22, 254, 37, 21, 200, 10, 1, 220, 60, 2, 59, 51, 10, 1, 
-    248, 217, 2, 59, 51, 10, 1, 242, 245, 2, 59, 51, 10, 5, 219, 158, 254, 
-    126, 10, 5, 219, 158, 224, 235, 231, 58, 10, 1, 241, 219, 2, 235, 193, 
-    214, 105, 188, 245, 143, 64, 226, 14, 188, 218, 19, 243, 229, 218, 129, 
-    188, 218, 67, 243, 229, 218, 129, 188, 218, 19, 249, 226, 188, 218, 67, 
-    249, 226, 188, 203, 249, 226, 188, 249, 227, 219, 106, 233, 46, 188, 249, 
-    227, 219, 106, 222, 251, 188, 218, 19, 249, 227, 219, 106, 233, 46, 188, 
-    218, 67, 249, 227, 219, 106, 222, 251, 188, 249, 180, 188, 242, 1, 226, 
-    250, 188, 242, 1, 231, 36, 188, 242, 1, 253, 218, 188, 255, 21, 78, 188, 
-    1, 254, 174, 188, 1, 218, 23, 254, 174, 188, 1, 252, 25, 188, 1, 243, 
-    113, 188, 1, 243, 114, 243, 91, 188, 1, 248, 192, 188, 1, 247, 119, 248, 
-    193, 222, 229, 188, 1, 241, 238, 188, 1, 212, 30, 188, 1, 210, 108, 188, 
-    1, 241, 195, 188, 1, 216, 226, 188, 1, 216, 227, 243, 91, 188, 1, 210, 
-    199, 188, 1, 210, 200, 241, 238, 188, 1, 234, 225, 188, 1, 233, 101, 188, 
-    1, 230, 190, 188, 1, 227, 194, 188, 1, 220, 143, 188, 1, 40, 220, 143, 
-    188, 1, 75, 188, 1, 225, 221, 188, 1, 223, 49, 225, 221, 188, 1, 222, 24, 
-    188, 1, 224, 75, 188, 1, 222, 229, 188, 1, 220, 20, 188, 1, 217, 36, 188, 
-    1, 225, 169, 252, 12, 188, 1, 225, 169, 242, 242, 188, 1, 225, 169, 248, 
-    20, 188, 224, 151, 48, 188, 224, 151, 51, 188, 224, 151, 246, 117, 188, 
-    210, 17, 48, 188, 210, 17, 51, 188, 210, 17, 246, 117, 188, 223, 131, 48, 
-    188, 223, 131, 51, 188, 246, 118, 210, 24, 241, 44, 188, 246, 118, 210, 
-    24, 254, 105, 188, 241, 241, 48, 188, 241, 241, 51, 188, 241, 240, 246, 
-    117, 188, 245, 79, 48, 188, 245, 79, 51, 188, 222, 107, 188, 244, 136, 
-    247, 120, 188, 223, 248, 188, 222, 134, 188, 113, 67, 170, 48, 188, 113, 
-    67, 170, 51, 188, 134, 170, 48, 188, 134, 170, 51, 188, 226, 248, 232, 
-    214, 48, 188, 226, 248, 232, 214, 51, 188, 230, 56, 188, 252, 131, 188, 
-    1, 219, 49, 210, 80, 188, 1, 219, 49, 234, 122, 188, 1, 219, 49, 244, 
-    154, 10, 1, 252, 55, 2, 134, 170, 240, 250, 51, 10, 1, 252, 55, 2, 59, 
-    252, 43, 22, 134, 170, 48, 10, 1, 252, 55, 2, 134, 170, 225, 7, 214, 153, 
-    51, 10, 1, 252, 55, 2, 134, 170, 225, 7, 214, 153, 252, 43, 22, 113, 170, 
-    48, 10, 1, 252, 55, 2, 113, 170, 252, 43, 22, 59, 48, 10, 1, 252, 55, 2, 
-    235, 193, 4, 214, 106, 51, 10, 1, 252, 55, 2, 4, 214, 105, 10, 1, 122, 2, 
-    113, 170, 48, 10, 1, 122, 2, 134, 170, 225, 7, 214, 153, 51, 10, 1, 248, 
-    196, 2, 113, 170, 213, 189, 252, 43, 22, 4, 217, 80, 10, 1, 248, 196, 2, 
-    235, 193, 4, 214, 106, 51, 10, 1, 223, 96, 2, 91, 10, 1, 221, 167, 2, 
-    244, 11, 170, 48, 10, 1, 254, 197, 2, 113, 170, 48, 10, 1, 254, 197, 2, 
-    134, 170, 225, 7, 246, 104, 48, 10, 1, 254, 197, 2, 113, 170, 213, 189, 
-    48, 10, 1, 244, 143, 2, 113, 170, 51, 10, 1, 244, 143, 2, 134, 170, 225, 
-    7, 214, 153, 51, 10, 1, 234, 175, 2, 59, 48, 10, 1, 234, 175, 2, 134, 
-    170, 48, 10, 1, 234, 175, 2, 134, 170, 225, 7, 214, 153, 51, 10, 1, 66, 
-    2, 59, 48, 10, 1, 66, 2, 59, 51, 10, 1, 228, 63, 2, 113, 170, 51, 10, 1, 
-    228, 63, 2, 4, 217, 80, 10, 1, 228, 63, 2, 4, 214, 105, 10, 1, 233, 103, 
-    2, 130, 10, 1, 223, 96, 2, 113, 170, 213, 189, 48, 10, 1, 223, 96, 2, 
-    202, 48, 10, 1, 221, 167, 2, 113, 170, 213, 189, 48, 10, 1, 122, 2, 4, 
-    10, 1, 217, 81, 51, 10, 1, 122, 2, 4, 10, 1, 217, 81, 22, 113, 247, 118, 
-    10, 1, 221, 167, 2, 4, 10, 1, 217, 81, 22, 113, 247, 118, 10, 1, 223, 96, 
-    2, 4, 10, 1, 217, 81, 22, 113, 247, 118, 10, 1, 122, 2, 4, 10, 1, 217, 
-    81, 48, 10, 1, 112, 2, 245, 22, 254, 37, 21, 113, 48, 10, 1, 112, 2, 245, 
-    22, 254, 37, 21, 134, 48, 10, 1, 244, 168, 79, 2, 245, 22, 254, 37, 21, 
-    113, 48, 10, 1, 244, 168, 79, 2, 245, 22, 254, 37, 21, 134, 48, 10, 1, 
-    244, 168, 79, 2, 245, 22, 254, 37, 21, 244, 11, 51, 10, 1, 212, 31, 2, 
-    245, 22, 254, 37, 21, 113, 48, 10, 1, 212, 31, 2, 245, 22, 254, 37, 21, 
-    134, 48, 10, 1, 79, 252, 133, 2, 245, 22, 254, 37, 21, 113, 48, 10, 1, 
-    79, 252, 133, 2, 245, 22, 254, 37, 21, 134, 48, 10, 1, 122, 2, 245, 22, 
-    254, 37, 21, 244, 11, 51, 10, 1, 221, 167, 2, 245, 22, 254, 37, 21, 244, 
-    11, 48, 10, 1, 221, 167, 2, 235, 193, 214, 105, 10, 1, 234, 251, 2, 113, 
-    170, 48, 216, 205, 1, 242, 46, 216, 205, 1, 220, 68, 216, 205, 1, 228, 
-    61, 216, 205, 1, 223, 184, 216, 205, 1, 252, 189, 216, 205, 1, 232, 251, 
-    216, 205, 1, 235, 8, 216, 205, 1, 254, 159, 216, 205, 1, 214, 25, 216, 
-    205, 1, 231, 77, 216, 205, 1, 244, 194, 216, 205, 1, 248, 23, 216, 205, 
-    1, 216, 207, 216, 205, 1, 233, 131, 216, 205, 1, 243, 131, 216, 205, 1, 
-    242, 177, 216, 205, 1, 221, 165, 216, 205, 1, 248, 148, 216, 205, 1, 210, 
-    100, 216, 205, 1, 217, 37, 216, 205, 1, 211, 103, 216, 205, 1, 225, 233, 
-    216, 205, 1, 235, 128, 216, 205, 1, 250, 134, 216, 205, 1, 215, 155, 216, 
-    205, 1, 241, 188, 216, 205, 1, 234, 131, 216, 205, 1, 216, 206, 216, 205, 
-    1, 210, 115, 216, 205, 1, 220, 58, 216, 205, 1, 222, 30, 216, 205, 1, 
-    248, 219, 216, 205, 1, 111, 216, 205, 1, 210, 23, 216, 205, 1, 254, 193, 
-    216, 205, 1, 242, 243, 216, 205, 1, 224, 85, 216, 205, 1, 212, 63, 216, 
-    205, 255, 22, 216, 205, 255, 38, 216, 205, 240, 114, 216, 205, 245, 208, 
-    216, 205, 214, 222, 216, 205, 226, 182, 216, 205, 245, 216, 216, 205, 
-    245, 16, 216, 205, 226, 247, 216, 205, 226, 255, 216, 205, 218, 45, 216, 
-    205, 1, 229, 225, 228, 137, 21, 210, 86, 228, 137, 21, 110, 228, 137, 21, 
-    105, 228, 137, 21, 158, 228, 137, 21, 161, 228, 137, 21, 189, 228, 137, 
-    21, 194, 228, 137, 21, 198, 228, 137, 21, 195, 228, 137, 21, 200, 228, 
-    137, 1, 61, 228, 137, 1, 245, 209, 228, 137, 1, 73, 228, 137, 1, 75, 228, 
-    137, 1, 70, 228, 137, 1, 226, 183, 228, 137, 1, 76, 228, 137, 1, 248, 
-    209, 228, 137, 1, 230, 25, 228, 137, 1, 252, 191, 228, 137, 1, 190, 228, 
-    137, 1, 217, 105, 228, 137, 1, 235, 141, 228, 137, 1, 250, 157, 228, 137, 
-    1, 248, 221, 228, 137, 1, 205, 228, 137, 1, 222, 179, 228, 137, 1, 206, 
-    228, 137, 1, 243, 79, 228, 137, 1, 244, 196, 228, 137, 1, 176, 228, 137, 
-    1, 233, 135, 228, 137, 1, 229, 229, 211, 223, 228, 137, 1, 184, 228, 137, 
-    1, 227, 165, 228, 137, 1, 197, 228, 137, 1, 162, 228, 137, 1, 212, 65, 
-    228, 137, 1, 191, 228, 137, 1, 227, 166, 211, 223, 228, 137, 1, 235, 61, 
-    235, 141, 228, 137, 1, 235, 61, 250, 157, 228, 137, 1, 235, 61, 205, 228, 
-    137, 38, 219, 251, 125, 216, 30, 228, 137, 38, 219, 251, 121, 216, 30, 
-    228, 137, 38, 219, 251, 222, 228, 216, 30, 228, 137, 38, 199, 248, 38, 
-    216, 30, 228, 137, 38, 199, 125, 216, 30, 228, 137, 38, 199, 121, 216, 
-    30, 228, 137, 38, 199, 222, 228, 216, 30, 228, 137, 38, 229, 193, 78, 
-    228, 137, 38, 52, 59, 48, 228, 137, 125, 138, 254, 57, 228, 137, 121, 
-    138, 254, 57, 228, 137, 16, 226, 184, 248, 50, 228, 137, 16, 243, 78, 
-    228, 137, 249, 219, 228, 137, 245, 31, 78, 228, 137, 233, 108, 221, 252, 
-    1, 254, 176, 221, 252, 1, 251, 228, 221, 252, 1, 243, 112, 221, 252, 1, 
-    248, 194, 221, 252, 1, 235, 152, 221, 252, 1, 252, 189, 221, 252, 1, 210, 
-    89, 221, 252, 1, 235, 160, 221, 252, 1, 216, 67, 221, 252, 1, 210, 182, 
-    221, 252, 1, 235, 9, 221, 252, 1, 233, 128, 221, 252, 1, 230, 190, 221, 
-    252, 1, 227, 194, 221, 252, 1, 219, 156, 221, 252, 1, 235, 255, 221, 252, 
-    1, 244, 121, 221, 252, 1, 215, 181, 221, 252, 1, 224, 10, 221, 252, 1, 
-    222, 229, 221, 252, 1, 220, 85, 221, 252, 1, 217, 100, 221, 252, 164, 
-    235, 255, 221, 252, 164, 235, 254, 221, 252, 164, 226, 243, 221, 252, 
-    164, 248, 207, 221, 252, 58, 1, 245, 105, 210, 182, 221, 252, 164, 245, 
-    105, 210, 182, 221, 252, 25, 5, 199, 75, 221, 252, 25, 5, 75, 221, 252, 
-    25, 5, 226, 118, 255, 73, 221, 252, 25, 5, 199, 255, 73, 221, 252, 25, 5, 
-    255, 73, 221, 252, 25, 5, 226, 118, 61, 221, 252, 25, 5, 199, 61, 221, 
-    252, 25, 5, 61, 221, 252, 58, 1, 219, 251, 61, 221, 252, 25, 5, 219, 251, 
-    61, 221, 252, 25, 5, 199, 70, 221, 252, 25, 5, 70, 221, 252, 58, 1, 73, 
-    221, 252, 25, 5, 199, 73, 221, 252, 25, 5, 73, 221, 252, 25, 5, 76, 221, 
-    252, 25, 5, 218, 45, 221, 252, 164, 229, 92, 221, 252, 224, 141, 229, 92, 
-    221, 252, 224, 141, 254, 218, 221, 252, 224, 141, 254, 114, 221, 252, 
-    224, 141, 252, 114, 221, 252, 224, 141, 253, 201, 221, 252, 224, 141, 
-    220, 8, 221, 252, 255, 21, 78, 221, 252, 224, 141, 231, 68, 224, 45, 221, 
-    252, 224, 141, 210, 31, 221, 252, 224, 141, 224, 45, 221, 252, 224, 141, 
-    210, 114, 221, 252, 224, 141, 215, 90, 221, 252, 224, 141, 254, 9, 221, 
-    252, 224, 141, 219, 53, 231, 145, 221, 252, 224, 141, 254, 100, 231, 182, 
-    1, 242, 24, 231, 182, 1, 255, 25, 231, 182, 1, 254, 216, 231, 182, 1, 
-    254, 255, 231, 182, 1, 254, 209, 231, 182, 1, 214, 124, 231, 182, 1, 253, 
-    160, 231, 182, 1, 235, 160, 231, 182, 1, 253, 198, 231, 182, 1, 254, 181, 
-    231, 182, 1, 254, 186, 231, 182, 1, 254, 178, 231, 182, 1, 254, 136, 231, 
-    182, 1, 254, 123, 231, 182, 1, 253, 237, 231, 182, 1, 235, 255, 231, 182, 
-    1, 254, 72, 231, 182, 1, 253, 208, 231, 182, 1, 254, 45, 231, 182, 1, 
-    254, 41, 231, 182, 1, 253, 231, 231, 182, 1, 253, 206, 231, 182, 1, 246, 
-    55, 231, 182, 1, 235, 2, 231, 182, 1, 254, 196, 231, 182, 254, 222, 78, 
-    231, 182, 213, 136, 78, 231, 182, 243, 53, 78, 231, 182, 224, 140, 10, 1, 
-    252, 55, 2, 4, 214, 106, 51, 10, 1, 151, 2, 113, 170, 48, 10, 1, 217, 81, 
-    2, 113, 170, 48, 10, 1, 244, 143, 2, 59, 252, 43, 22, 134, 170, 48, 10, 
-    1, 224, 82, 2, 59, 51, 10, 1, 233, 103, 2, 52, 130, 10, 1, 66, 2, 134, 
-    170, 48, 10, 1, 79, 2, 113, 170, 252, 43, 22, 202, 48, 10, 1, 79, 2, 113, 
-    170, 252, 43, 22, 59, 48, 10, 1, 223, 96, 2, 232, 123, 10, 1, 212, 31, 2, 
-    59, 211, 231, 10, 1, 222, 201, 211, 43, 10, 249, 99, 244, 165, 10, 249, 
-    99, 248, 184, 10, 249, 99, 234, 205, 10, 249, 99, 244, 163, 10, 249, 99, 
-    248, 182, 10, 249, 99, 234, 203, 10, 138, 123, 59, 48, 10, 138, 113, 170, 
-    48, 10, 138, 232, 124, 48, 10, 138, 123, 59, 51, 10, 138, 113, 170, 51, 
-    10, 138, 232, 124, 51, 10, 204, 244, 163, 10, 204, 248, 182, 10, 204, 
-    234, 203, 10, 4, 125, 212, 30, 10, 244, 166, 2, 222, 233, 10, 244, 166, 
-    2, 59, 48, 10, 234, 206, 2, 59, 51, 10, 43, 253, 250, 48, 10, 44, 253, 
-    250, 48, 10, 43, 253, 250, 51, 10, 44, 253, 250, 51, 10, 52, 44, 253, 
-    250, 48, 10, 52, 44, 253, 250, 77, 2, 247, 120, 10, 44, 253, 250, 77, 2, 
-    247, 120, 10, 248, 185, 2, 247, 120, 84, 5, 235, 193, 250, 255, 84, 5, 
-    250, 255, 84, 5, 254, 75, 84, 5, 213, 147, 84, 1, 219, 251, 61, 84, 1, 
-    61, 84, 1, 255, 73, 84, 1, 73, 84, 1, 236, 33, 84, 1, 70, 84, 1, 214, 
-    118, 84, 1, 149, 153, 84, 1, 149, 156, 84, 1, 251, 2, 75, 84, 1, 219, 
-    251, 75, 84, 1, 75, 84, 1, 254, 201, 84, 1, 251, 2, 76, 84, 1, 219, 251, 
-    76, 84, 1, 76, 84, 1, 253, 192, 84, 1, 176, 84, 1, 234, 132, 84, 1, 243, 
-    135, 84, 1, 242, 249, 84, 1, 229, 77, 84, 1, 251, 33, 84, 1, 250, 157, 
-    84, 1, 235, 141, 84, 1, 235, 114, 84, 1, 227, 165, 84, 1, 215, 156, 84, 
-    1, 215, 144, 84, 1, 248, 135, 84, 1, 248, 119, 84, 1, 228, 110, 84, 1, 
-    217, 105, 84, 1, 216, 208, 84, 1, 248, 221, 84, 1, 248, 25, 84, 1, 197, 
-    84, 1, 228, 92, 84, 1, 190, 84, 1, 225, 147, 84, 1, 252, 191, 84, 1, 252, 
-    18, 84, 1, 184, 84, 1, 191, 84, 1, 205, 84, 1, 222, 179, 84, 1, 233, 135, 
-    84, 1, 232, 184, 84, 1, 232, 175, 84, 1, 214, 27, 84, 1, 220, 102, 84, 1, 
-    218, 223, 84, 1, 206, 84, 1, 162, 84, 25, 5, 226, 234, 84, 25, 5, 226, 
-    181, 84, 5, 227, 205, 84, 5, 253, 175, 84, 25, 5, 255, 73, 84, 25, 5, 73, 
-    84, 25, 5, 236, 33, 84, 25, 5, 70, 84, 25, 5, 214, 118, 84, 25, 5, 149, 
-    153, 84, 25, 5, 149, 222, 180, 84, 25, 5, 251, 2, 75, 84, 25, 5, 219, 
-    251, 75, 84, 25, 5, 75, 84, 25, 5, 254, 201, 84, 25, 5, 251, 2, 76, 84, 
-    25, 5, 219, 251, 76, 84, 25, 5, 76, 84, 25, 5, 253, 192, 84, 5, 213, 152, 
-    84, 25, 5, 224, 185, 75, 84, 25, 5, 253, 171, 84, 226, 204, 84, 218, 111, 
-    5, 214, 216, 84, 218, 111, 5, 254, 77, 84, 242, 137, 255, 14, 84, 255, 3, 
-    255, 14, 84, 25, 5, 251, 2, 199, 75, 84, 25, 5, 214, 214, 84, 25, 5, 214, 
-    117, 84, 1, 224, 88, 84, 1, 234, 115, 84, 1, 242, 226, 84, 1, 210, 116, 
-    84, 1, 248, 124, 84, 1, 223, 39, 84, 1, 244, 196, 84, 1, 210, 168, 84, 1, 
-    149, 222, 180, 84, 1, 149, 232, 185, 84, 25, 5, 149, 156, 84, 25, 5, 149, 
-    232, 185, 84, 248, 178, 84, 52, 248, 178, 84, 21, 210, 86, 84, 21, 110, 
-    84, 21, 105, 84, 21, 158, 84, 21, 161, 84, 21, 189, 84, 21, 194, 84, 21, 
-    198, 84, 21, 195, 84, 21, 200, 84, 255, 21, 50, 84, 5, 125, 219, 17, 247, 
-    120, 84, 1, 251, 2, 61, 84, 1, 226, 234, 84, 1, 226, 181, 84, 1, 253, 
-    171, 84, 1, 214, 214, 84, 1, 214, 117, 84, 1, 210, 82, 84, 1, 114, 191, 
-    84, 1, 243, 29, 84, 1, 235, 96, 84, 1, 242, 180, 218, 129, 84, 1, 248, 
-    125, 84, 1, 252, 111, 146, 5, 250, 255, 146, 5, 254, 75, 146, 5, 213, 
-    147, 146, 1, 61, 146, 1, 255, 73, 146, 1, 73, 146, 1, 236, 33, 146, 1, 
-    70, 146, 1, 214, 118, 146, 1, 149, 153, 146, 1, 149, 156, 146, 1, 75, 
-    146, 1, 254, 201, 146, 1, 76, 146, 1, 253, 192, 146, 1, 176, 146, 1, 234, 
-    132, 146, 1, 243, 135, 146, 1, 242, 249, 146, 1, 229, 77, 146, 1, 251, 
-    33, 146, 1, 250, 157, 146, 1, 235, 141, 146, 1, 235, 114, 146, 1, 227, 
-    165, 146, 1, 215, 156, 146, 1, 215, 144, 146, 1, 248, 135, 146, 1, 248, 
-    119, 146, 1, 228, 110, 146, 1, 217, 105, 146, 1, 216, 208, 146, 1, 248, 
-    221, 146, 1, 248, 25, 146, 1, 197, 146, 1, 190, 146, 1, 225, 147, 146, 1, 
-    252, 191, 146, 1, 252, 18, 146, 1, 184, 146, 1, 191, 146, 1, 205, 146, 1, 
-    233, 135, 146, 1, 220, 102, 146, 1, 218, 223, 146, 1, 206, 146, 1, 162, 
-    146, 5, 227, 205, 146, 5, 253, 175, 146, 25, 5, 255, 73, 146, 25, 5, 73, 
-    146, 25, 5, 236, 33, 146, 25, 5, 70, 146, 25, 5, 214, 118, 146, 25, 5, 
-    149, 153, 146, 25, 5, 149, 222, 180, 146, 25, 5, 75, 146, 25, 5, 254, 
-    201, 146, 25, 5, 76, 146, 25, 5, 253, 192, 146, 5, 213, 152, 146, 1, 234, 
-    124, 217, 105, 146, 253, 193, 233, 23, 78, 146, 1, 222, 179, 146, 1, 223, 
-    39, 146, 1, 210, 168, 146, 1, 149, 222, 180, 146, 1, 149, 232, 185, 146, 
-    25, 5, 149, 156, 146, 25, 5, 149, 232, 185, 146, 21, 210, 86, 146, 21, 
-    110, 146, 21, 105, 146, 21, 158, 146, 21, 161, 146, 21, 189, 146, 21, 
-    194, 146, 21, 198, 146, 21, 195, 146, 21, 200, 146, 1, 223, 188, 2, 230, 
-    224, 247, 254, 146, 1, 223, 188, 2, 232, 108, 247, 254, 146, 222, 118, 
-    78, 146, 222, 118, 50, 146, 249, 98, 227, 197, 110, 146, 249, 98, 227, 
-    197, 105, 146, 249, 98, 227, 197, 158, 146, 249, 98, 227, 197, 161, 146, 
-    249, 98, 227, 197, 123, 233, 16, 216, 201, 216, 196, 248, 48, 146, 249, 
-    98, 248, 49, 219, 119, 146, 235, 161, 146, 243, 103, 78, 183, 5, 254, 
-    254, 251, 243, 183, 5, 251, 243, 183, 5, 213, 147, 183, 1, 61, 183, 1, 
-    255, 73, 183, 1, 73, 183, 1, 236, 33, 183, 1, 70, 183, 1, 214, 118, 183, 
-    1, 245, 209, 183, 1, 254, 201, 183, 1, 226, 183, 183, 1, 253, 192, 183, 
-    1, 176, 183, 1, 234, 132, 183, 1, 243, 135, 183, 1, 242, 249, 183, 1, 
-    229, 77, 183, 1, 251, 33, 183, 1, 250, 157, 183, 1, 235, 141, 183, 1, 
-    235, 114, 183, 1, 227, 165, 183, 1, 215, 156, 183, 1, 215, 144, 183, 1, 
-    248, 135, 183, 1, 248, 119, 183, 1, 228, 110, 183, 1, 217, 105, 183, 1, 
-    216, 208, 183, 1, 248, 221, 183, 1, 248, 25, 183, 1, 197, 183, 1, 190, 
-    183, 1, 225, 147, 183, 1, 252, 191, 183, 1, 252, 18, 183, 1, 184, 183, 1, 
-    191, 183, 1, 205, 183, 1, 233, 135, 183, 1, 232, 184, 183, 1, 214, 27, 
-    183, 1, 220, 102, 183, 1, 206, 183, 1, 162, 183, 5, 227, 205, 183, 25, 5, 
-    255, 73, 183, 25, 5, 73, 183, 25, 5, 236, 33, 183, 25, 5, 70, 183, 25, 5, 
-    214, 118, 183, 25, 5, 245, 209, 183, 25, 5, 254, 201, 183, 25, 5, 226, 
-    183, 183, 25, 5, 253, 192, 183, 5, 213, 152, 183, 5, 214, 218, 183, 1, 
-    234, 115, 183, 1, 242, 226, 183, 1, 210, 116, 183, 1, 222, 179, 183, 1, 
-    244, 196, 183, 21, 210, 86, 183, 21, 110, 183, 21, 105, 183, 21, 158, 
-    183, 21, 161, 183, 21, 189, 183, 21, 194, 183, 21, 198, 183, 21, 195, 
-    183, 21, 200, 183, 216, 74, 183, 254, 253, 183, 235, 178, 183, 214, 146, 
-    183, 245, 181, 226, 188, 183, 5, 211, 78, 171, 5, 250, 255, 171, 5, 254, 
-    75, 171, 5, 213, 147, 171, 1, 61, 171, 1, 255, 73, 171, 1, 73, 171, 1, 
-    236, 33, 171, 1, 70, 171, 1, 214, 118, 171, 1, 149, 153, 171, 1, 149, 
-    156, 171, 25, 251, 2, 75, 171, 1, 75, 171, 1, 254, 201, 171, 25, 251, 2, 
-    76, 171, 1, 76, 171, 1, 253, 192, 171, 1, 176, 171, 1, 234, 132, 171, 1, 
-    243, 135, 171, 1, 242, 249, 171, 1, 229, 77, 171, 1, 251, 33, 171, 1, 
-    250, 157, 171, 1, 235, 141, 171, 1, 235, 114, 171, 1, 227, 165, 171, 1, 
-    215, 156, 171, 1, 215, 144, 171, 1, 248, 135, 171, 1, 248, 119, 171, 1, 
-    228, 110, 171, 1, 217, 105, 171, 1, 216, 208, 171, 1, 248, 221, 171, 1, 
-    248, 25, 171, 1, 197, 171, 1, 190, 171, 1, 225, 147, 171, 1, 252, 191, 
-    171, 1, 252, 18, 171, 1, 184, 171, 1, 191, 171, 1, 205, 171, 1, 233, 135, 
-    171, 1, 232, 184, 171, 1, 214, 27, 171, 1, 220, 102, 171, 1, 218, 223, 
-    171, 1, 206, 171, 1, 162, 171, 5, 227, 205, 171, 5, 253, 175, 171, 25, 5, 
-    255, 73, 171, 25, 5, 73, 171, 25, 5, 236, 33, 171, 25, 5, 70, 171, 25, 5, 
-    214, 118, 171, 25, 5, 149, 153, 171, 25, 5, 149, 222, 180, 171, 25, 5, 
-    251, 2, 75, 171, 25, 5, 75, 171, 25, 5, 254, 201, 171, 25, 5, 251, 2, 76, 
-    171, 25, 5, 76, 171, 25, 5, 253, 192, 171, 5, 213, 152, 171, 226, 204, 
-    171, 1, 149, 222, 180, 171, 1, 149, 232, 185, 171, 25, 5, 149, 156, 171, 
-    25, 5, 149, 232, 185, 171, 21, 210, 86, 171, 21, 110, 171, 21, 105, 171, 
-    21, 158, 171, 21, 161, 171, 21, 189, 171, 21, 194, 171, 21, 198, 171, 21, 
-    195, 171, 21, 200, 171, 255, 21, 50, 171, 222, 118, 50, 157, 5, 250, 255, 
-    157, 5, 254, 75, 157, 5, 213, 147, 157, 1, 61, 157, 1, 255, 73, 157, 1, 
-    73, 157, 1, 236, 33, 157, 1, 70, 157, 1, 214, 118, 157, 1, 149, 153, 157, 
-    1, 149, 156, 157, 1, 75, 157, 1, 254, 201, 157, 1, 76, 157, 1, 253, 192, 
-    157, 1, 176, 157, 1, 234, 132, 157, 1, 243, 135, 157, 1, 242, 249, 157, 
-    1, 229, 77, 157, 1, 251, 33, 157, 1, 250, 157, 157, 1, 235, 141, 157, 1, 
-    235, 114, 157, 1, 227, 165, 157, 1, 215, 156, 157, 1, 215, 144, 157, 1, 
-    248, 135, 157, 1, 248, 119, 157, 1, 228, 110, 157, 1, 217, 105, 157, 1, 
-    216, 208, 157, 1, 248, 221, 157, 1, 248, 25, 157, 1, 197, 157, 1, 190, 
-    157, 1, 225, 147, 157, 1, 252, 191, 157, 1, 252, 18, 157, 1, 184, 157, 1, 
-    191, 157, 1, 205, 157, 1, 233, 135, 157, 1, 232, 184, 157, 1, 214, 27, 
-    157, 1, 220, 102, 157, 1, 218, 223, 157, 1, 206, 157, 1, 162, 157, 5, 
-    227, 205, 157, 5, 253, 175, 157, 25, 5, 255, 73, 157, 25, 5, 73, 157, 25, 
-    5, 236, 33, 157, 25, 5, 70, 157, 25, 5, 214, 118, 157, 25, 5, 149, 153, 
-    157, 25, 5, 149, 222, 180, 157, 25, 5, 75, 157, 25, 5, 254, 201, 157, 25, 
-    5, 76, 157, 25, 5, 253, 192, 157, 5, 213, 152, 157, 254, 202, 233, 23, 
-    78, 157, 253, 193, 233, 23, 78, 157, 1, 222, 179, 157, 1, 223, 39, 157, 
-    1, 210, 168, 157, 1, 149, 222, 180, 157, 1, 149, 232, 185, 157, 25, 5, 
-    149, 156, 157, 25, 5, 149, 232, 185, 157, 21, 210, 86, 157, 21, 110, 157, 
-    21, 105, 157, 21, 158, 157, 21, 161, 157, 21, 189, 157, 21, 194, 157, 21, 
-    198, 157, 21, 195, 157, 21, 200, 157, 235, 161, 157, 1, 212, 65, 157, 
-    244, 2, 123, 224, 21, 157, 244, 2, 123, 242, 27, 157, 244, 2, 134, 224, 
-    19, 157, 244, 2, 123, 219, 117, 157, 244, 2, 123, 245, 188, 157, 244, 2, 
-    134, 219, 116, 36, 5, 254, 75, 36, 5, 213, 147, 36, 1, 61, 36, 1, 255, 
-    73, 36, 1, 73, 36, 1, 236, 33, 36, 1, 70, 36, 1, 214, 118, 36, 1, 75, 36, 
-    1, 245, 209, 36, 1, 254, 201, 36, 1, 76, 36, 1, 226, 183, 36, 1, 253, 
-    192, 36, 1, 176, 36, 1, 229, 77, 36, 1, 251, 33, 36, 1, 235, 141, 36, 1, 
-    227, 165, 36, 1, 215, 156, 36, 1, 228, 110, 36, 1, 217, 105, 36, 1, 197, 
-    36, 1, 228, 92, 36, 1, 190, 36, 1, 184, 36, 1, 191, 36, 1, 205, 36, 1, 
-    222, 179, 36, 1, 233, 135, 36, 1, 232, 184, 36, 1, 232, 175, 36, 1, 214, 
-    27, 36, 1, 220, 102, 36, 1, 218, 223, 36, 1, 206, 36, 1, 162, 36, 25, 5, 
-    255, 73, 36, 25, 5, 73, 36, 25, 5, 236, 33, 36, 25, 5, 70, 36, 25, 5, 
-    214, 118, 36, 25, 5, 75, 36, 25, 5, 245, 209, 36, 25, 5, 254, 201, 36, 
-    25, 5, 76, 36, 25, 5, 226, 183, 36, 25, 5, 253, 192, 36, 5, 213, 152, 36, 
-    226, 204, 36, 253, 193, 233, 23, 78, 36, 21, 210, 86, 36, 21, 110, 36, 
-    21, 105, 36, 21, 158, 36, 21, 161, 36, 21, 189, 36, 21, 194, 36, 21, 198, 
-    36, 21, 195, 36, 21, 200, 36, 54, 216, 247, 36, 54, 123, 240, 210, 36, 
-    54, 123, 216, 147, 36, 248, 146, 50, 36, 230, 135, 50, 36, 211, 45, 50, 
-    36, 248, 87, 50, 36, 249, 139, 50, 36, 253, 238, 77, 50, 36, 222, 118, 
-    50, 36, 54, 50, 148, 5, 250, 255, 148, 5, 254, 75, 148, 5, 213, 147, 148, 
-    1, 61, 148, 1, 255, 73, 148, 1, 73, 148, 1, 236, 33, 148, 1, 70, 148, 1, 
-    214, 118, 148, 1, 149, 153, 148, 1, 149, 156, 148, 1, 75, 148, 1, 245, 
-    209, 148, 1, 254, 201, 148, 1, 76, 148, 1, 226, 183, 148, 1, 253, 192, 
-    148, 1, 176, 148, 1, 234, 132, 148, 1, 243, 135, 148, 1, 242, 249, 148, 
-    1, 229, 77, 148, 1, 251, 33, 148, 1, 250, 157, 148, 1, 235, 141, 148, 1, 
-    235, 114, 148, 1, 227, 165, 148, 1, 215, 156, 148, 1, 215, 144, 148, 1, 
-    248, 135, 148, 1, 248, 119, 148, 1, 228, 110, 148, 1, 217, 105, 148, 1, 
-    216, 208, 148, 1, 248, 221, 148, 1, 248, 25, 148, 1, 197, 148, 1, 190, 
-    148, 1, 225, 147, 148, 1, 252, 191, 148, 1, 252, 18, 148, 1, 184, 148, 1, 
-    191, 148, 1, 205, 148, 1, 222, 179, 148, 1, 233, 135, 148, 1, 232, 184, 
-    148, 1, 214, 27, 148, 1, 220, 102, 148, 1, 218, 223, 148, 1, 206, 148, 1, 
-    162, 148, 5, 253, 175, 148, 25, 5, 255, 73, 148, 25, 5, 73, 148, 25, 5, 
-    236, 33, 148, 25, 5, 70, 148, 25, 5, 214, 118, 148, 25, 5, 149, 153, 148, 
-    25, 5, 149, 222, 180, 148, 25, 5, 75, 148, 25, 5, 245, 209, 148, 25, 5, 
-    254, 201, 148, 25, 5, 76, 148, 25, 5, 226, 183, 148, 25, 5, 253, 192, 
-    148, 5, 213, 152, 148, 233, 23, 78, 148, 254, 202, 233, 23, 78, 148, 1, 
-    215, 183, 148, 1, 246, 38, 148, 1, 149, 222, 180, 148, 1, 149, 232, 185, 
-    148, 25, 5, 149, 156, 148, 25, 5, 149, 232, 185, 148, 21, 210, 86, 148, 
-    21, 110, 148, 21, 105, 148, 21, 158, 148, 21, 161, 148, 21, 189, 148, 21, 
-    194, 148, 21, 198, 148, 21, 195, 148, 21, 200, 148, 244, 2, 21, 210, 87, 
-    31, 226, 237, 224, 223, 64, 161, 148, 244, 2, 21, 123, 31, 226, 237, 224, 
-    223, 64, 161, 148, 244, 2, 21, 113, 31, 226, 237, 224, 223, 64, 161, 148, 
-    244, 2, 21, 134, 31, 226, 237, 224, 223, 64, 161, 148, 244, 2, 21, 123, 
-    31, 245, 42, 224, 223, 64, 161, 148, 244, 2, 21, 113, 31, 245, 42, 224, 
-    223, 64, 161, 148, 244, 2, 21, 134, 31, 245, 42, 224, 223, 64, 161, 148, 
-    5, 215, 84, 165, 5, 254, 75, 165, 5, 213, 147, 165, 1, 61, 165, 1, 255, 
-    73, 165, 1, 73, 165, 1, 236, 33, 165, 1, 70, 165, 1, 214, 118, 165, 1, 
-    149, 153, 165, 1, 149, 156, 165, 1, 75, 165, 1, 245, 209, 165, 1, 254, 
-    201, 165, 1, 76, 165, 1, 226, 183, 165, 1, 253, 192, 165, 1, 176, 165, 1, 
-    234, 132, 165, 1, 243, 135, 165, 1, 242, 249, 165, 1, 229, 77, 165, 1, 
-    251, 33, 165, 1, 250, 157, 165, 1, 235, 141, 165, 1, 235, 114, 165, 1, 
-    227, 165, 165, 1, 215, 156, 165, 1, 215, 144, 165, 1, 248, 135, 165, 1, 
-    248, 119, 165, 1, 228, 110, 165, 1, 217, 105, 165, 1, 216, 208, 165, 1, 
-    248, 221, 165, 1, 248, 25, 165, 1, 197, 165, 1, 190, 165, 1, 225, 147, 
-    165, 1, 252, 191, 165, 1, 252, 18, 165, 1, 184, 165, 1, 191, 165, 1, 205, 
-    165, 1, 222, 179, 165, 1, 233, 135, 165, 1, 232, 184, 165, 1, 214, 27, 
-    165, 1, 220, 102, 165, 1, 218, 223, 165, 1, 206, 165, 1, 162, 165, 5, 
-    227, 205, 165, 5, 253, 175, 165, 25, 5, 255, 73, 165, 25, 5, 73, 165, 25, 
-    5, 236, 33, 165, 25, 5, 70, 165, 25, 5, 214, 118, 165, 25, 5, 149, 153, 
-    165, 25, 5, 149, 222, 180, 165, 25, 5, 75, 165, 25, 5, 245, 209, 165, 25, 
-    5, 254, 201, 165, 25, 5, 76, 165, 25, 5, 226, 183, 165, 25, 5, 253, 192, 
-    165, 5, 213, 152, 165, 233, 23, 78, 165, 254, 202, 233, 23, 78, 165, 1, 
-    244, 196, 165, 1, 149, 222, 180, 165, 1, 149, 232, 185, 165, 25, 5, 149, 
-    156, 165, 25, 5, 149, 232, 185, 165, 21, 210, 86, 165, 21, 110, 165, 21, 
-    105, 165, 21, 158, 165, 21, 161, 165, 21, 189, 165, 21, 194, 165, 21, 
-    198, 165, 21, 195, 165, 21, 200, 165, 5, 235, 102, 165, 5, 214, 161, 136, 
-    5, 254, 75, 136, 5, 213, 147, 136, 1, 61, 136, 1, 255, 73, 136, 1, 73, 
-    136, 1, 236, 33, 136, 1, 70, 136, 1, 214, 118, 136, 1, 149, 153, 136, 1, 
-    149, 156, 136, 1, 75, 136, 1, 245, 209, 136, 1, 254, 201, 136, 1, 76, 
-    136, 1, 226, 183, 136, 1, 253, 192, 136, 1, 176, 136, 1, 234, 132, 136, 
-    1, 243, 135, 136, 1, 242, 249, 136, 1, 229, 77, 136, 1, 251, 33, 136, 1, 
-    250, 157, 136, 1, 235, 141, 136, 1, 235, 114, 136, 1, 227, 165, 136, 1, 
-    215, 156, 136, 1, 215, 144, 136, 1, 248, 135, 136, 1, 248, 119, 136, 1, 
-    228, 110, 136, 1, 217, 105, 136, 1, 216, 208, 136, 1, 248, 221, 136, 1, 
-    248, 25, 136, 1, 197, 136, 1, 228, 92, 136, 1, 190, 136, 1, 225, 147, 
-    136, 1, 252, 191, 136, 1, 252, 18, 136, 1, 184, 136, 1, 191, 136, 1, 205, 
-    136, 1, 222, 179, 136, 1, 233, 135, 136, 1, 232, 184, 136, 1, 232, 175, 
-    136, 1, 214, 27, 136, 1, 220, 102, 136, 1, 218, 223, 136, 1, 206, 136, 1, 
-    162, 136, 1, 215, 125, 136, 5, 253, 175, 136, 25, 5, 255, 73, 136, 25, 5, 
-    73, 136, 25, 5, 236, 33, 136, 25, 5, 70, 136, 25, 5, 214, 118, 136, 25, 
-    5, 149, 153, 136, 25, 5, 149, 222, 180, 136, 25, 5, 75, 136, 25, 5, 245, 
-    209, 136, 25, 5, 254, 201, 136, 25, 5, 76, 136, 25, 5, 226, 183, 136, 25, 
-    5, 253, 192, 136, 5, 213, 152, 136, 1, 59, 223, 73, 136, 253, 193, 233, 
-    23, 78, 136, 1, 149, 222, 180, 136, 1, 149, 232, 185, 136, 25, 5, 149, 
-    156, 136, 25, 5, 149, 232, 185, 136, 21, 210, 86, 136, 21, 110, 136, 21, 
-    105, 136, 21, 158, 136, 21, 161, 136, 21, 189, 136, 21, 194, 136, 21, 
-    198, 136, 21, 195, 136, 21, 200, 136, 54, 216, 247, 136, 54, 123, 240, 
-    210, 136, 54, 123, 216, 147, 136, 244, 2, 123, 224, 21, 136, 244, 2, 123, 
-    242, 27, 136, 244, 2, 134, 224, 19, 136, 248, 150, 78, 136, 1, 250, 99, 
-    228, 111, 136, 1, 250, 99, 230, 25, 136, 1, 250, 99, 222, 180, 136, 1, 
-    250, 99, 156, 136, 1, 250, 99, 232, 185, 136, 1, 250, 99, 235, 23, 175, 
-    5, 254, 74, 175, 5, 213, 146, 175, 1, 253, 165, 175, 1, 255, 27, 175, 1, 
-    254, 223, 175, 1, 254, 238, 175, 1, 235, 151, 175, 1, 236, 32, 175, 1, 
-    214, 110, 175, 1, 214, 112, 175, 1, 235, 173, 175, 1, 235, 174, 175, 1, 
-    236, 18, 175, 1, 236, 20, 175, 1, 245, 17, 175, 1, 245, 204, 175, 1, 254, 
-    188, 175, 1, 226, 108, 175, 1, 226, 177, 175, 1, 253, 178, 175, 1, 254, 
-    146, 234, 187, 175, 1, 231, 209, 234, 187, 175, 1, 254, 146, 243, 82, 
-    175, 1, 231, 209, 243, 82, 175, 1, 234, 229, 229, 222, 175, 1, 221, 236, 
-    243, 82, 175, 1, 254, 146, 250, 216, 175, 1, 231, 209, 250, 216, 175, 1, 
-    254, 146, 235, 127, 175, 1, 231, 209, 235, 127, 175, 1, 217, 98, 229, 
-    222, 175, 1, 217, 98, 221, 235, 229, 223, 175, 1, 221, 236, 235, 127, 
-    175, 1, 254, 146, 215, 152, 175, 1, 231, 209, 215, 152, 175, 1, 254, 146, 
-    248, 126, 175, 1, 231, 209, 248, 126, 175, 1, 230, 53, 229, 180, 175, 1, 
-    221, 236, 248, 126, 175, 1, 254, 146, 217, 30, 175, 1, 231, 209, 217, 30, 
-    175, 1, 254, 146, 248, 144, 175, 1, 231, 209, 248, 144, 175, 1, 248, 174, 
-    229, 180, 175, 1, 221, 236, 248, 144, 175, 1, 254, 146, 225, 228, 175, 1, 
-    231, 209, 225, 228, 175, 1, 254, 146, 252, 112, 175, 1, 231, 209, 252, 
-    112, 175, 1, 231, 131, 175, 1, 254, 131, 252, 112, 175, 1, 211, 51, 175, 
-    1, 223, 133, 175, 1, 248, 174, 233, 67, 175, 1, 214, 1, 175, 1, 217, 98, 
-    221, 210, 175, 1, 230, 53, 221, 210, 175, 1, 248, 174, 221, 210, 175, 1, 
-    241, 242, 175, 1, 230, 53, 233, 67, 175, 1, 244, 156, 175, 5, 254, 177, 
-    175, 25, 5, 254, 233, 175, 25, 5, 234, 155, 254, 240, 175, 25, 5, 247, 
-    228, 254, 240, 175, 25, 5, 234, 155, 235, 170, 175, 25, 5, 247, 228, 235, 
-    170, 175, 25, 5, 234, 155, 226, 88, 175, 25, 5, 247, 228, 226, 88, 175, 
-    25, 5, 243, 124, 175, 25, 5, 234, 15, 175, 25, 5, 247, 228, 234, 15, 175, 
-    25, 5, 234, 17, 248, 67, 175, 25, 5, 234, 16, 242, 47, 254, 233, 175, 25, 
-    5, 234, 16, 242, 47, 247, 228, 254, 233, 175, 25, 5, 234, 16, 242, 47, 
-    243, 81, 175, 25, 5, 243, 81, 175, 25, 5, 247, 228, 243, 124, 175, 25, 5, 
-    247, 228, 243, 81, 175, 224, 141, 233, 207, 168, 135, 234, 29, 234, 246, 
-    168, 135, 234, 106, 234, 128, 168, 135, 234, 106, 234, 99, 168, 135, 234, 
-    106, 234, 95, 168, 135, 234, 106, 234, 103, 168, 135, 234, 106, 223, 154, 
-    168, 135, 229, 5, 228, 248, 168, 135, 250, 87, 250, 147, 168, 135, 250, 
-    87, 250, 95, 168, 135, 250, 87, 250, 146, 168, 135, 219, 59, 219, 58, 
-    168, 135, 250, 87, 250, 83, 168, 135, 210, 245, 210, 252, 168, 135, 247, 
-    146, 250, 154, 168, 135, 216, 42, 225, 238, 168, 135, 216, 157, 216, 200, 
-    168, 135, 216, 157, 229, 201, 168, 135, 216, 157, 225, 111, 168, 135, 
-    228, 75, 229, 98, 168, 135, 247, 146, 248, 68, 168, 135, 216, 42, 217, 
-    55, 168, 135, 216, 157, 216, 131, 168, 135, 216, 157, 216, 204, 168, 135, 
-    216, 157, 216, 154, 168, 135, 228, 75, 227, 237, 168, 135, 251, 206, 252, 
-    164, 168, 135, 225, 17, 225, 42, 168, 135, 225, 122, 225, 113, 168, 135, 
-    244, 44, 244, 196, 168, 135, 225, 122, 225, 141, 168, 135, 244, 44, 244, 
-    173, 168, 135, 225, 122, 221, 247, 168, 135, 230, 162, 184, 168, 135, 
-    210, 245, 211, 79, 168, 135, 222, 212, 222, 139, 168, 135, 222, 140, 168, 
-    135, 232, 157, 232, 206, 168, 135, 232, 98, 168, 135, 211, 228, 212, 61, 
-    168, 135, 219, 59, 222, 6, 168, 135, 219, 59, 222, 114, 168, 135, 219, 
-    59, 218, 82, 168, 135, 241, 69, 241, 159, 168, 135, 232, 157, 250, 68, 
-    168, 135, 144, 254, 115, 168, 135, 241, 69, 228, 70, 168, 135, 226, 68, 
-    168, 135, 221, 230, 61, 168, 135, 231, 204, 242, 17, 168, 135, 221, 230, 
-    255, 73, 168, 135, 221, 230, 254, 136, 168, 135, 221, 230, 73, 168, 135, 
-    221, 230, 236, 33, 168, 135, 221, 230, 214, 214, 168, 135, 221, 230, 214, 
-    212, 168, 135, 221, 230, 70, 168, 135, 221, 230, 214, 118, 168, 135, 225, 
-    124, 168, 249, 98, 16, 252, 165, 168, 135, 221, 230, 75, 168, 135, 221, 
-    230, 254, 243, 168, 135, 221, 230, 76, 168, 135, 221, 230, 254, 202, 231, 
-    198, 168, 135, 221, 230, 254, 202, 231, 199, 168, 135, 233, 106, 168, 
-    135, 231, 195, 168, 135, 231, 196, 168, 135, 231, 204, 245, 180, 168, 
-    135, 231, 204, 216, 156, 168, 135, 231, 204, 215, 228, 168, 135, 231, 
-    204, 250, 135, 168, 135, 216, 198, 168, 135, 228, 205, 168, 135, 211, 73, 
-    168, 135, 244, 35, 168, 21, 210, 86, 168, 21, 110, 168, 21, 105, 168, 21, 
-    158, 168, 21, 161, 168, 21, 189, 168, 21, 194, 168, 21, 198, 168, 21, 
-    195, 168, 21, 200, 168, 135, 254, 111, 168, 135, 234, 104, 209, 209, 1, 
-    234, 28, 209, 209, 1, 234, 106, 218, 35, 209, 209, 1, 234, 106, 217, 62, 
-    209, 209, 1, 229, 4, 209, 209, 1, 249, 238, 209, 209, 1, 219, 59, 217, 
-    62, 209, 209, 1, 227, 134, 209, 209, 1, 247, 145, 209, 209, 1, 111, 209, 
-    209, 1, 216, 157, 218, 35, 209, 209, 1, 216, 157, 217, 62, 209, 209, 1, 
-    228, 74, 209, 209, 1, 251, 205, 209, 209, 1, 225, 16, 209, 209, 1, 225, 
-    122, 218, 35, 209, 209, 1, 244, 44, 217, 62, 209, 209, 1, 225, 122, 217, 
-    62, 209, 209, 1, 244, 44, 218, 35, 209, 209, 1, 230, 161, 209, 209, 1, 
-    210, 244, 209, 209, 1, 232, 157, 232, 206, 209, 209, 1, 232, 157, 232, 
-    121, 209, 209, 1, 211, 227, 209, 209, 1, 219, 59, 218, 35, 209, 209, 1, 
-    241, 69, 218, 35, 209, 209, 1, 76, 209, 209, 1, 241, 69, 217, 62, 209, 
-    209, 245, 163, 209, 209, 25, 5, 61, 209, 209, 25, 5, 231, 204, 234, 234, 
-    209, 209, 25, 5, 255, 73, 209, 209, 25, 5, 254, 136, 209, 209, 25, 5, 73, 
-    209, 209, 25, 5, 236, 33, 209, 209, 25, 5, 211, 117, 209, 209, 25, 5, 
-    210, 169, 209, 209, 25, 5, 70, 209, 209, 25, 5, 214, 118, 209, 209, 25, 
-    5, 231, 204, 234, 13, 209, 209, 220, 145, 5, 232, 156, 209, 209, 220, 
-    145, 5, 227, 134, 209, 209, 25, 5, 75, 209, 209, 25, 5, 245, 195, 209, 
-    209, 25, 5, 76, 209, 209, 25, 5, 253, 167, 209, 209, 25, 5, 254, 201, 
-    209, 209, 234, 29, 233, 135, 209, 209, 138, 231, 204, 245, 180, 209, 209, 
-    138, 231, 204, 216, 156, 209, 209, 138, 231, 204, 216, 117, 209, 209, 
-    138, 231, 204, 250, 223, 209, 209, 251, 4, 78, 209, 209, 228, 214, 209, 
-    209, 21, 210, 86, 209, 209, 21, 110, 209, 209, 21, 105, 209, 209, 21, 
-    158, 209, 209, 21, 161, 209, 209, 21, 189, 209, 209, 21, 194, 209, 209, 
-    21, 198, 209, 209, 21, 195, 209, 209, 21, 200, 209, 209, 241, 69, 228, 
-    74, 209, 209, 241, 69, 230, 161, 209, 209, 1, 234, 107, 242, 174, 209, 
-    209, 1, 234, 107, 227, 134, 63, 3, 226, 204, 63, 164, 242, 115, 211, 0, 
-    230, 248, 215, 189, 61, 63, 164, 242, 115, 211, 0, 230, 248, 255, 159, 
-    222, 216, 252, 77, 184, 63, 164, 242, 115, 211, 0, 230, 248, 255, 159, 
-    242, 115, 215, 173, 184, 63, 164, 65, 211, 0, 230, 248, 231, 93, 184, 63, 
-    164, 249, 252, 211, 0, 230, 248, 220, 109, 184, 63, 164, 250, 239, 211, 
-    0, 230, 248, 225, 112, 220, 96, 184, 63, 164, 211, 0, 230, 248, 215, 173, 
-    220, 96, 184, 63, 164, 221, 208, 220, 95, 63, 164, 251, 128, 211, 0, 230, 
-    247, 63, 164, 251, 223, 220, 3, 211, 0, 230, 247, 63, 164, 235, 197, 215, 
-    172, 63, 164, 248, 61, 215, 173, 251, 127, 63, 164, 220, 95, 63, 164, 
-    227, 139, 220, 95, 63, 164, 215, 173, 220, 95, 63, 164, 227, 139, 215, 
-    173, 220, 95, 63, 164, 222, 236, 250, 122, 218, 236, 220, 95, 63, 164, 
-    223, 42, 242, 146, 220, 95, 63, 164, 250, 239, 255, 163, 222, 144, 231, 
-    92, 199, 251, 7, 63, 164, 242, 115, 215, 172, 63, 232, 144, 5, 250, 155, 
-    222, 143, 63, 232, 144, 5, 232, 252, 222, 143, 63, 253, 212, 5, 220, 105, 
-    243, 65, 255, 164, 222, 143, 63, 253, 212, 5, 255, 161, 190, 63, 253, 
-    212, 5, 221, 182, 215, 168, 63, 5, 223, 130, 247, 159, 243, 64, 63, 5, 
-    223, 130, 247, 159, 242, 176, 63, 5, 223, 130, 247, 159, 242, 116, 63, 5, 
-    223, 130, 229, 219, 243, 64, 63, 5, 223, 130, 229, 219, 242, 176, 63, 5, 
-    223, 130, 247, 159, 223, 130, 229, 218, 63, 21, 210, 86, 63, 21, 110, 63, 
-    21, 105, 63, 21, 158, 63, 21, 161, 63, 21, 189, 63, 21, 194, 63, 21, 198, 
-    63, 21, 195, 63, 21, 200, 63, 21, 163, 110, 63, 21, 163, 105, 63, 21, 
-    163, 158, 63, 21, 163, 161, 63, 21, 163, 189, 63, 21, 163, 194, 63, 21, 
-    163, 198, 63, 21, 163, 195, 63, 21, 163, 200, 63, 21, 163, 210, 86, 63, 
-    164, 251, 130, 222, 143, 63, 164, 229, 68, 251, 68, 227, 149, 210, 25, 
-    63, 164, 250, 239, 255, 163, 222, 144, 251, 69, 230, 202, 251, 7, 63, 
-    164, 229, 68, 251, 68, 220, 106, 222, 143, 63, 164, 250, 132, 230, 247, 
-    63, 164, 215, 184, 255, 160, 63, 164, 242, 100, 222, 144, 242, 63, 63, 
-    164, 242, 100, 222, 144, 242, 69, 63, 164, 254, 116, 234, 123, 242, 63, 
-    63, 164, 254, 116, 234, 123, 242, 69, 63, 5, 211, 65, 215, 171, 63, 5, 
-    231, 167, 215, 171, 63, 1, 176, 63, 1, 234, 132, 63, 1, 243, 135, 63, 1, 
-    242, 249, 63, 1, 229, 77, 63, 1, 251, 33, 63, 1, 250, 157, 63, 1, 235, 
-    141, 63, 1, 227, 165, 63, 1, 215, 156, 63, 1, 215, 144, 63, 1, 248, 135, 
-    63, 1, 248, 119, 63, 1, 228, 110, 63, 1, 217, 105, 63, 1, 216, 208, 63, 
-    1, 248, 221, 63, 1, 248, 25, 63, 1, 197, 63, 1, 190, 63, 1, 225, 147, 63, 
-    1, 252, 191, 63, 1, 252, 18, 63, 1, 184, 63, 1, 215, 183, 63, 1, 215, 
-    175, 63, 1, 246, 38, 63, 1, 246, 33, 63, 1, 212, 65, 63, 1, 210, 82, 63, 
-    1, 210, 116, 63, 1, 255, 166, 63, 1, 191, 63, 1, 205, 63, 1, 233, 135, 
-    63, 1, 220, 102, 63, 1, 218, 223, 63, 1, 206, 63, 1, 162, 63, 1, 61, 63, 
-    1, 233, 231, 63, 1, 244, 77, 205, 63, 1, 234, 46, 63, 1, 222, 179, 63, 
-    25, 5, 255, 73, 63, 25, 5, 73, 63, 25, 5, 236, 33, 63, 25, 5, 70, 63, 25, 
-    5, 214, 118, 63, 25, 5, 149, 153, 63, 25, 5, 149, 222, 180, 63, 25, 5, 
-    149, 156, 63, 25, 5, 149, 232, 185, 63, 25, 5, 75, 63, 25, 5, 245, 209, 
-    63, 25, 5, 76, 63, 25, 5, 226, 183, 63, 5, 222, 221, 218, 84, 229, 78, 
-    222, 211, 63, 5, 222, 216, 252, 76, 63, 25, 5, 223, 49, 73, 63, 25, 5, 
-    223, 49, 236, 33, 63, 5, 227, 149, 210, 26, 229, 226, 248, 221, 63, 5, 
-    219, 71, 233, 60, 63, 164, 242, 29, 63, 164, 226, 57, 63, 5, 233, 63, 
-    222, 143, 63, 5, 211, 70, 222, 143, 63, 5, 233, 64, 215, 184, 251, 7, 63, 
-    5, 231, 95, 251, 7, 63, 5, 242, 119, 251, 8, 223, 40, 63, 5, 242, 119, 
-    231, 85, 223, 40, 63, 5, 235, 193, 231, 95, 251, 7, 63, 218, 73, 5, 233, 
-    64, 215, 184, 251, 7, 63, 218, 73, 5, 231, 95, 251, 7, 63, 218, 73, 5, 
-    235, 193, 231, 95, 251, 7, 63, 218, 73, 1, 176, 63, 218, 73, 1, 234, 132, 
-    63, 218, 73, 1, 243, 135, 63, 218, 73, 1, 242, 249, 63, 218, 73, 1, 229, 
-    77, 63, 218, 73, 1, 251, 33, 63, 218, 73, 1, 250, 157, 63, 218, 73, 1, 
-    235, 141, 63, 218, 73, 1, 227, 165, 63, 218, 73, 1, 215, 156, 63, 218, 
-    73, 1, 215, 144, 63, 218, 73, 1, 248, 135, 63, 218, 73, 1, 248, 119, 63, 
-    218, 73, 1, 228, 110, 63, 218, 73, 1, 217, 105, 63, 218, 73, 1, 216, 208, 
-    63, 218, 73, 1, 248, 221, 63, 218, 73, 1, 248, 25, 63, 218, 73, 1, 197, 
-    63, 218, 73, 1, 190, 63, 218, 73, 1, 225, 147, 63, 218, 73, 1, 252, 191, 
-    63, 218, 73, 1, 252, 18, 63, 218, 73, 1, 184, 63, 218, 73, 1, 215, 183, 
-    63, 218, 73, 1, 215, 175, 63, 218, 73, 1, 246, 38, 63, 218, 73, 1, 246, 
-    33, 63, 218, 73, 1, 212, 65, 63, 218, 73, 1, 210, 82, 63, 218, 73, 1, 
-    210, 116, 63, 218, 73, 1, 255, 166, 63, 218, 73, 1, 191, 63, 218, 73, 1, 
-    205, 63, 218, 73, 1, 233, 135, 63, 218, 73, 1, 220, 102, 63, 218, 73, 1, 
-    218, 223, 63, 218, 73, 1, 206, 63, 218, 73, 1, 162, 63, 218, 73, 1, 61, 
-    63, 218, 73, 1, 233, 231, 63, 218, 73, 1, 244, 77, 212, 65, 63, 218, 73, 
-    1, 244, 77, 191, 63, 218, 73, 1, 244, 77, 205, 63, 233, 218, 222, 141, 
-    234, 132, 63, 233, 218, 222, 141, 234, 133, 251, 69, 230, 202, 251, 7, 
-    63, 250, 252, 5, 114, 252, 70, 63, 250, 252, 5, 192, 252, 70, 63, 250, 
-    252, 5, 250, 253, 217, 20, 63, 250, 252, 5, 221, 207, 255, 165, 63, 16, 
-    246, 91, 251, 125, 63, 16, 223, 129, 222, 222, 63, 16, 226, 77, 243, 63, 
-    63, 16, 223, 129, 222, 223, 223, 42, 242, 145, 63, 16, 225, 112, 190, 63, 
-    16, 228, 59, 251, 125, 63, 16, 228, 59, 251, 126, 227, 139, 255, 162, 63, 
-    16, 228, 59, 251, 126, 242, 117, 255, 162, 63, 16, 228, 59, 251, 126, 
-    251, 69, 255, 162, 63, 5, 223, 130, 229, 219, 223, 130, 247, 158, 63, 5, 
-    223, 130, 229, 219, 242, 116, 63, 164, 251, 129, 220, 3, 242, 215, 230, 
-    248, 223, 41, 63, 164, 230, 163, 211, 0, 242, 215, 230, 248, 223, 41, 63, 
-    164, 227, 139, 215, 172, 63, 164, 65, 251, 152, 222, 213, 211, 0, 230, 
-    248, 231, 93, 184, 63, 164, 249, 252, 251, 152, 222, 213, 211, 0, 230, 
-    248, 220, 109, 184, 222, 250, 217, 255, 50, 233, 45, 217, 255, 50, 222, 
-    250, 217, 255, 5, 2, 247, 118, 233, 45, 217, 255, 5, 2, 247, 118, 63, 
-    164, 233, 55, 231, 96, 222, 143, 63, 164, 215, 250, 231, 96, 222, 143, 
-    68, 1, 176, 68, 1, 234, 132, 68, 1, 243, 135, 68, 1, 242, 249, 68, 1, 
-    229, 77, 68, 1, 251, 33, 68, 1, 250, 157, 68, 1, 235, 141, 68, 1, 235, 
-    114, 68, 1, 227, 165, 68, 1, 228, 76, 68, 1, 215, 156, 68, 1, 215, 144, 
-    68, 1, 248, 135, 68, 1, 248, 119, 68, 1, 228, 110, 68, 1, 217, 105, 68, 
-    1, 216, 208, 68, 1, 248, 221, 68, 1, 248, 25, 68, 1, 197, 68, 1, 190, 68, 
-    1, 225, 147, 68, 1, 252, 191, 68, 1, 252, 18, 68, 1, 184, 68, 1, 191, 68, 
-    1, 205, 68, 1, 233, 135, 68, 1, 212, 65, 68, 1, 206, 68, 1, 162, 68, 1, 
-    232, 184, 68, 1, 61, 68, 1, 220, 86, 61, 68, 1, 73, 68, 1, 236, 33, 68, 
-    1, 70, 68, 1, 214, 118, 68, 1, 75, 68, 1, 230, 151, 75, 68, 1, 76, 68, 1, 
-    253, 192, 68, 25, 5, 217, 64, 255, 73, 68, 25, 5, 255, 73, 68, 25, 5, 73, 
-    68, 25, 5, 236, 33, 68, 25, 5, 70, 68, 25, 5, 214, 118, 68, 25, 5, 75, 
-    68, 25, 5, 254, 201, 68, 25, 5, 230, 151, 236, 33, 68, 25, 5, 230, 151, 
-    76, 68, 25, 5, 160, 48, 68, 5, 254, 75, 68, 5, 59, 51, 68, 5, 213, 147, 
-    68, 5, 213, 152, 68, 5, 253, 235, 68, 116, 5, 147, 191, 68, 116, 5, 147, 
-    205, 68, 116, 5, 147, 212, 65, 68, 116, 5, 147, 162, 68, 1, 242, 132, 
-    206, 68, 21, 210, 86, 68, 21, 110, 68, 21, 105, 68, 21, 158, 68, 21, 161, 
-    68, 21, 189, 68, 21, 194, 68, 21, 198, 68, 21, 195, 68, 21, 200, 68, 5, 
-    232, 192, 221, 172, 68, 5, 221, 172, 68, 16, 232, 153, 68, 16, 249, 213, 
-    68, 16, 254, 220, 68, 16, 243, 48, 68, 1, 220, 102, 68, 1, 218, 223, 68, 
-    1, 149, 153, 68, 1, 149, 222, 180, 68, 1, 149, 156, 68, 1, 149, 232, 185, 
-    68, 25, 5, 149, 153, 68, 25, 5, 149, 222, 180, 68, 25, 5, 149, 156, 68, 
-    25, 5, 149, 232, 185, 68, 1, 230, 151, 229, 77, 68, 1, 230, 151, 235, 
-    114, 68, 1, 230, 151, 252, 111, 68, 1, 230, 151, 252, 106, 68, 116, 5, 
-    230, 151, 147, 197, 68, 116, 5, 230, 151, 147, 184, 68, 116, 5, 230, 151, 
-    147, 233, 135, 68, 1, 220, 108, 234, 213, 220, 102, 68, 25, 5, 220, 108, 
-    234, 213, 245, 55, 68, 138, 164, 220, 108, 234, 213, 241, 247, 68, 138, 
-    164, 220, 108, 234, 213, 234, 183, 225, 121, 68, 1, 212, 7, 224, 108, 
-    234, 213, 216, 208, 68, 1, 212, 7, 224, 108, 234, 213, 224, 114, 68, 25, 
-    5, 212, 7, 224, 108, 234, 213, 245, 55, 68, 25, 5, 212, 7, 224, 108, 234, 
-    213, 214, 214, 68, 5, 212, 7, 224, 108, 234, 213, 216, 29, 68, 5, 212, 7, 
-    224, 108, 234, 213, 216, 28, 68, 5, 212, 7, 224, 108, 234, 213, 216, 27, 
-    68, 5, 212, 7, 224, 108, 234, 213, 216, 26, 68, 5, 212, 7, 224, 108, 234, 
-    213, 216, 25, 68, 1, 245, 219, 224, 108, 234, 213, 228, 110, 68, 1, 245, 
-    219, 224, 108, 234, 213, 210, 176, 68, 1, 245, 219, 224, 108, 234, 213, 
-    242, 217, 68, 25, 5, 243, 59, 234, 213, 73, 68, 25, 5, 234, 188, 226, 
-    234, 68, 25, 5, 234, 188, 70, 68, 25, 5, 234, 188, 245, 209, 68, 1, 220, 
-    86, 176, 68, 1, 220, 86, 234, 132, 68, 1, 220, 86, 243, 135, 68, 1, 220, 
-    86, 251, 33, 68, 1, 220, 86, 210, 116, 68, 1, 220, 86, 227, 165, 68, 1, 
-    220, 86, 248, 221, 68, 1, 220, 86, 197, 68, 1, 220, 86, 225, 147, 68, 1, 
-    220, 86, 244, 196, 68, 1, 220, 86, 252, 191, 68, 1, 220, 86, 216, 208, 
-    68, 1, 220, 86, 162, 68, 116, 5, 220, 86, 147, 212, 65, 68, 25, 5, 220, 
-    86, 255, 73, 68, 25, 5, 220, 86, 75, 68, 25, 5, 220, 86, 160, 48, 68, 25, 
-    5, 220, 86, 40, 211, 117, 68, 5, 220, 86, 216, 28, 68, 5, 220, 86, 216, 
-    27, 68, 5, 220, 86, 216, 25, 68, 5, 220, 86, 216, 24, 68, 5, 220, 86, 
-    249, 152, 216, 28, 68, 5, 220, 86, 249, 152, 216, 27, 68, 5, 220, 86, 
-    249, 152, 245, 153, 216, 30, 68, 1, 222, 128, 226, 63, 244, 196, 68, 5, 
-    222, 128, 226, 63, 216, 25, 68, 220, 86, 21, 210, 86, 68, 220, 86, 21, 
-    110, 68, 220, 86, 21, 105, 68, 220, 86, 21, 158, 68, 220, 86, 21, 161, 
-    68, 220, 86, 21, 189, 68, 220, 86, 21, 194, 68, 220, 86, 21, 198, 68, 
-    220, 86, 21, 195, 68, 220, 86, 21, 200, 68, 5, 234, 126, 216, 29, 68, 5, 
-    234, 126, 216, 27, 68, 25, 5, 254, 190, 61, 68, 25, 5, 254, 190, 254, 
-    201, 68, 16, 220, 86, 110, 68, 16, 220, 86, 245, 30, 98, 6, 1, 254, 123, 
-    98, 6, 1, 252, 152, 98, 6, 1, 243, 106, 98, 6, 1, 247, 128, 98, 6, 1, 
-    245, 150, 98, 6, 1, 213, 160, 98, 6, 1, 210, 89, 98, 6, 1, 217, 60, 98, 
-    6, 1, 235, 255, 98, 6, 1, 234, 234, 98, 6, 1, 233, 81, 98, 6, 1, 231, 
-    185, 98, 6, 1, 229, 195, 98, 6, 1, 226, 196, 98, 6, 1, 226, 17, 98, 6, 1, 
-    210, 78, 98, 6, 1, 223, 171, 98, 6, 1, 221, 243, 98, 6, 1, 217, 50, 98, 
-    6, 1, 214, 190, 98, 6, 1, 225, 140, 98, 6, 1, 234, 121, 98, 6, 1, 242, 
-    241, 98, 6, 1, 224, 73, 98, 6, 1, 220, 20, 98, 6, 1, 250, 97, 98, 6, 1, 
-    251, 7, 98, 6, 1, 235, 100, 98, 6, 1, 250, 40, 98, 6, 1, 250, 143, 98, 6, 
-    1, 211, 163, 98, 6, 1, 235, 111, 98, 6, 1, 242, 43, 98, 6, 1, 241, 238, 
-    98, 6, 1, 241, 175, 98, 6, 1, 212, 22, 98, 6, 1, 242, 4, 98, 6, 1, 241, 
-    65, 98, 6, 1, 210, 246, 98, 6, 1, 254, 232, 98, 1, 254, 123, 98, 1, 252, 
-    152, 98, 1, 243, 106, 98, 1, 247, 128, 98, 1, 245, 150, 98, 1, 213, 160, 
-    98, 1, 210, 89, 98, 1, 217, 60, 98, 1, 235, 255, 98, 1, 234, 234, 98, 1, 
-    233, 81, 98, 1, 231, 185, 98, 1, 229, 195, 98, 1, 226, 196, 98, 1, 226, 
-    17, 98, 1, 210, 78, 98, 1, 223, 171, 98, 1, 221, 243, 98, 1, 217, 50, 98, 
-    1, 214, 190, 98, 1, 225, 140, 98, 1, 234, 121, 98, 1, 242, 241, 98, 1, 
-    224, 73, 98, 1, 220, 20, 98, 1, 250, 97, 98, 1, 251, 7, 98, 1, 235, 100, 
-    98, 1, 250, 40, 98, 1, 250, 143, 98, 1, 211, 163, 98, 1, 235, 111, 98, 1, 
-    242, 43, 98, 1, 241, 238, 98, 1, 241, 175, 98, 1, 212, 22, 98, 1, 242, 4, 
-    98, 1, 241, 65, 98, 1, 244, 121, 98, 1, 210, 246, 98, 1, 245, 165, 98, 1, 
-    215, 94, 243, 106, 98, 1, 254, 196, 98, 226, 15, 220, 137, 58, 1, 98, 
-    229, 195, 98, 1, 254, 232, 98, 1, 242, 3, 50, 98, 1, 233, 127, 50, 24, 
-    100, 234, 58, 24, 100, 218, 215, 24, 100, 228, 226, 24, 100, 216, 101, 
-    24, 100, 218, 204, 24, 100, 223, 26, 24, 100, 230, 217, 24, 100, 225, 95, 
-    24, 100, 218, 212, 24, 100, 219, 148, 24, 100, 218, 209, 24, 100, 236, 
-    56, 24, 100, 250, 46, 24, 100, 218, 219, 24, 100, 250, 106, 24, 100, 234, 
-    110, 24, 100, 216, 173, 24, 100, 225, 131, 24, 100, 241, 172, 24, 100, 
-    228, 222, 24, 100, 218, 213, 24, 100, 228, 216, 24, 100, 228, 220, 24, 
-    100, 216, 98, 24, 100, 223, 14, 24, 100, 218, 211, 24, 100, 223, 24, 24, 
-    100, 234, 218, 24, 100, 230, 210, 24, 100, 234, 221, 24, 100, 225, 90, 
-    24, 100, 225, 88, 24, 100, 225, 76, 24, 100, 225, 84, 24, 100, 225, 82, 
-    24, 100, 225, 79, 24, 100, 225, 81, 24, 100, 225, 78, 24, 100, 225, 83, 
-    24, 100, 225, 93, 24, 100, 225, 94, 24, 100, 225, 77, 24, 100, 225, 87, 
-    24, 100, 234, 219, 24, 100, 234, 217, 24, 100, 219, 141, 24, 100, 219, 
-    139, 24, 100, 219, 131, 24, 100, 219, 134, 24, 100, 219, 140, 24, 100, 
-    219, 136, 24, 100, 219, 135, 24, 100, 219, 133, 24, 100, 219, 144, 24, 
-    100, 219, 146, 24, 100, 219, 147, 24, 100, 219, 142, 24, 100, 219, 132, 
-    24, 100, 219, 137, 24, 100, 219, 145, 24, 100, 250, 90, 24, 100, 250, 88, 
-    24, 100, 250, 168, 24, 100, 250, 166, 24, 100, 226, 32, 24, 100, 236, 51, 
-    24, 100, 236, 42, 24, 100, 236, 50, 24, 100, 236, 47, 24, 100, 236, 45, 
-    24, 100, 236, 49, 24, 100, 218, 216, 24, 100, 236, 54, 24, 100, 236, 55, 
-    24, 100, 236, 43, 24, 100, 236, 48, 24, 100, 211, 26, 24, 100, 250, 45, 
-    24, 100, 250, 91, 24, 100, 250, 89, 24, 100, 250, 169, 24, 100, 250, 167, 
-    24, 100, 250, 104, 24, 100, 250, 105, 24, 100, 250, 92, 24, 100, 250, 
-    170, 24, 100, 225, 129, 24, 100, 234, 220, 24, 100, 218, 217, 24, 100, 
-    211, 32, 24, 100, 234, 49, 24, 100, 228, 218, 24, 100, 228, 224, 24, 100, 
-    228, 223, 24, 100, 216, 95, 24, 100, 244, 103, 24, 143, 244, 103, 24, 
-    143, 61, 24, 143, 254, 243, 24, 143, 191, 24, 143, 211, 92, 24, 143, 245, 
-    117, 24, 143, 75, 24, 143, 211, 36, 24, 143, 211, 47, 24, 143, 76, 24, 
-    143, 212, 65, 24, 143, 212, 62, 24, 143, 226, 234, 24, 143, 210, 244, 24, 
-    143, 70, 24, 143, 212, 11, 24, 143, 212, 22, 24, 143, 211, 250, 24, 143, 
-    210, 212, 24, 143, 245, 55, 24, 143, 211, 8, 24, 143, 73, 24, 143, 255, 
-    157, 24, 143, 255, 156, 24, 143, 211, 106, 24, 143, 211, 104, 24, 143, 
-    245, 115, 24, 143, 245, 114, 24, 143, 245, 116, 24, 143, 211, 35, 24, 
-    143, 211, 34, 24, 143, 227, 84, 24, 143, 227, 85, 24, 143, 227, 78, 24, 
-    143, 227, 83, 24, 143, 227, 81, 24, 143, 210, 238, 24, 143, 210, 237, 24, 
-    143, 210, 236, 24, 143, 210, 239, 24, 143, 210, 240, 24, 143, 215, 30, 
-    24, 143, 215, 29, 24, 143, 215, 27, 24, 143, 215, 24, 24, 143, 215, 25, 
-    24, 143, 210, 211, 24, 143, 210, 208, 24, 143, 210, 209, 24, 143, 210, 
-    203, 24, 143, 210, 204, 24, 143, 210, 205, 24, 143, 210, 207, 24, 143, 
-    245, 49, 24, 143, 245, 51, 24, 143, 211, 7, 24, 143, 240, 153, 24, 143, 
-    240, 145, 24, 143, 240, 148, 24, 143, 240, 146, 24, 143, 240, 150, 24, 
-    143, 240, 152, 24, 143, 254, 34, 24, 143, 254, 31, 24, 143, 254, 29, 24, 
-    143, 254, 30, 24, 143, 218, 220, 24, 143, 255, 158, 24, 143, 211, 105, 
-    24, 143, 211, 33, 24, 143, 227, 80, 24, 143, 227, 79, 24, 90, 234, 58, 
-    24, 90, 218, 215, 24, 90, 234, 51, 24, 90, 228, 226, 24, 90, 228, 224, 
-    24, 90, 228, 223, 24, 90, 216, 101, 24, 90, 223, 26, 24, 90, 223, 21, 24, 
-    90, 223, 18, 24, 90, 223, 11, 24, 90, 223, 6, 24, 90, 223, 1, 24, 90, 
-    223, 12, 24, 90, 223, 24, 24, 90, 230, 217, 24, 90, 225, 95, 24, 90, 225, 
-    84, 24, 90, 219, 148, 24, 90, 218, 209, 24, 90, 236, 56, 24, 90, 250, 46, 
-    24, 90, 250, 106, 24, 90, 234, 110, 24, 90, 216, 173, 24, 90, 225, 131, 
-    24, 90, 241, 172, 24, 90, 234, 52, 24, 90, 234, 50, 24, 90, 228, 222, 24, 
-    90, 228, 216, 24, 90, 228, 218, 24, 90, 228, 221, 24, 90, 228, 217, 24, 
-    90, 216, 98, 24, 90, 216, 95, 24, 90, 223, 19, 24, 90, 223, 14, 24, 90, 
-    223, 0, 24, 90, 222, 255, 24, 90, 218, 211, 24, 90, 223, 16, 24, 90, 223, 
-    15, 24, 90, 223, 8, 24, 90, 223, 10, 24, 90, 223, 23, 24, 90, 223, 3, 24, 
-    90, 223, 13, 24, 90, 223, 22, 24, 90, 222, 254, 24, 90, 230, 213, 24, 90, 
-    230, 208, 24, 90, 230, 210, 24, 90, 230, 207, 24, 90, 230, 205, 24, 90, 
-    230, 211, 24, 90, 230, 216, 24, 90, 230, 214, 24, 90, 234, 221, 24, 90, 
-    225, 86, 24, 90, 225, 87, 24, 90, 225, 92, 24, 90, 234, 219, 24, 90, 219, 
-    141, 24, 90, 219, 131, 24, 90, 219, 134, 24, 90, 219, 136, 24, 90, 226, 
-    32, 24, 90, 236, 51, 24, 90, 236, 44, 24, 90, 218, 216, 24, 90, 236, 52, 
-    24, 90, 211, 26, 24, 90, 211, 22, 24, 90, 211, 23, 24, 90, 225, 129, 24, 
-    90, 234, 220, 24, 90, 241, 170, 24, 90, 241, 168, 24, 90, 241, 171, 24, 
-    90, 241, 169, 24, 90, 211, 32, 24, 90, 234, 54, 24, 90, 234, 53, 24, 90, 
-    234, 57, 24, 90, 234, 55, 24, 90, 234, 56, 24, 90, 218, 213, 29, 3, 162, 
-    29, 3, 240, 222, 29, 3, 241, 180, 29, 3, 242, 46, 29, 3, 241, 220, 29, 3, 
-    241, 238, 29, 3, 241, 68, 29, 3, 241, 67, 29, 3, 233, 135, 29, 3, 232, 
-    98, 29, 3, 232, 241, 29, 3, 233, 134, 29, 3, 233, 50, 29, 3, 233, 58, 29, 
-    3, 232, 156, 29, 3, 232, 70, 29, 3, 241, 189, 29, 3, 241, 183, 29, 3, 
-    241, 185, 29, 3, 241, 188, 29, 3, 241, 186, 29, 3, 241, 187, 29, 3, 241, 
-    184, 29, 3, 241, 182, 29, 3, 184, 29, 3, 230, 102, 29, 3, 230, 230, 29, 
-    3, 231, 237, 29, 3, 231, 80, 29, 3, 231, 91, 29, 3, 230, 161, 29, 3, 230, 
-    42, 29, 3, 217, 163, 29, 3, 217, 157, 29, 3, 217, 159, 29, 3, 217, 162, 
-    29, 3, 217, 160, 29, 3, 217, 161, 29, 3, 217, 158, 29, 3, 217, 156, 29, 
-    3, 205, 29, 3, 222, 140, 29, 3, 223, 35, 29, 3, 223, 184, 29, 3, 223, 
-    108, 29, 3, 223, 128, 29, 3, 222, 211, 29, 3, 222, 109, 29, 3, 206, 29, 
-    3, 218, 83, 29, 3, 219, 191, 29, 3, 222, 31, 29, 3, 221, 170, 29, 3, 221, 
-    181, 29, 3, 219, 58, 29, 3, 217, 253, 29, 3, 220, 102, 29, 3, 219, 225, 
-    29, 3, 220, 32, 29, 3, 220, 98, 29, 3, 220, 61, 29, 3, 220, 63, 29, 3, 
-    220, 7, 29, 3, 219, 208, 29, 3, 224, 88, 29, 3, 224, 30, 29, 3, 224, 53, 
-    29, 3, 224, 87, 29, 3, 224, 68, 29, 3, 224, 69, 29, 3, 224, 42, 29, 3, 
-    224, 41, 29, 3, 223, 242, 29, 3, 223, 238, 29, 3, 223, 241, 29, 3, 223, 
-    239, 29, 3, 223, 240, 29, 3, 224, 65, 29, 3, 224, 59, 29, 3, 224, 61, 29, 
-    3, 224, 64, 29, 3, 224, 62, 29, 3, 224, 63, 29, 3, 224, 60, 29, 3, 224, 
-    58, 29, 3, 224, 54, 29, 3, 224, 57, 29, 3, 224, 55, 29, 3, 224, 56, 29, 
-    3, 252, 191, 29, 3, 251, 125, 29, 3, 252, 6, 29, 3, 252, 189, 29, 3, 252, 
-    66, 29, 3, 252, 75, 29, 3, 251, 205, 29, 3, 251, 83, 29, 3, 214, 27, 29, 
-    3, 212, 116, 29, 3, 213, 176, 29, 3, 214, 26, 29, 3, 213, 250, 29, 3, 
-    213, 255, 29, 3, 213, 138, 29, 3, 212, 107, 29, 3, 217, 105, 29, 3, 215, 
-    118, 29, 3, 216, 117, 29, 3, 217, 101, 29, 3, 217, 11, 29, 3, 217, 22, 
-    29, 3, 111, 29, 3, 215, 80, 29, 3, 251, 33, 29, 3, 249, 112, 29, 3, 250, 
-    51, 29, 3, 251, 32, 29, 3, 250, 182, 29, 3, 250, 190, 29, 3, 249, 238, 
-    29, 3, 249, 81, 29, 3, 211, 165, 29, 3, 211, 141, 29, 3, 211, 157, 29, 3, 
-    211, 164, 29, 3, 211, 161, 29, 3, 211, 162, 29, 3, 211, 148, 29, 3, 211, 
-    147, 29, 3, 211, 136, 29, 3, 211, 132, 29, 3, 211, 135, 29, 3, 211, 133, 
-    29, 3, 211, 134, 29, 3, 197, 29, 3, 227, 237, 29, 3, 228, 233, 29, 3, 
-    229, 225, 29, 3, 229, 103, 29, 3, 229, 107, 29, 3, 228, 74, 29, 3, 227, 
-    174, 29, 3, 227, 165, 29, 3, 227, 128, 29, 3, 227, 148, 29, 3, 227, 164, 
-    29, 3, 227, 155, 29, 3, 227, 156, 29, 3, 227, 134, 29, 3, 227, 119, 29, 
-    3, 242, 180, 61, 29, 3, 242, 180, 70, 29, 3, 242, 180, 73, 29, 3, 242, 
-    180, 255, 73, 29, 3, 242, 180, 245, 209, 29, 3, 242, 180, 75, 29, 3, 242, 
-    180, 76, 29, 3, 242, 180, 212, 65, 29, 3, 176, 29, 3, 233, 217, 29, 3, 
-    234, 92, 29, 3, 235, 10, 29, 3, 234, 181, 29, 3, 234, 182, 29, 3, 234, 
-    28, 29, 3, 234, 27, 29, 3, 233, 182, 29, 3, 233, 176, 29, 3, 233, 181, 
-    29, 3, 233, 177, 29, 3, 233, 178, 29, 3, 233, 171, 29, 3, 233, 165, 29, 
-    3, 233, 167, 29, 3, 233, 170, 29, 3, 233, 168, 29, 3, 233, 169, 29, 3, 
-    233, 166, 29, 3, 233, 164, 29, 3, 233, 160, 29, 3, 233, 163, 29, 3, 233, 
-    161, 29, 3, 233, 162, 29, 3, 212, 65, 29, 3, 211, 195, 29, 3, 211, 250, 
-    29, 3, 212, 64, 29, 3, 212, 17, 29, 3, 212, 22, 29, 3, 211, 227, 29, 3, 
-    211, 226, 29, 3, 225, 139, 61, 29, 3, 225, 139, 70, 29, 3, 225, 139, 73, 
-    29, 3, 225, 139, 255, 73, 29, 3, 225, 139, 245, 209, 29, 3, 225, 139, 75, 
-    29, 3, 225, 139, 76, 29, 3, 210, 116, 29, 3, 210, 13, 29, 3, 210, 44, 29, 
-    3, 210, 115, 29, 3, 210, 92, 29, 3, 210, 94, 29, 3, 210, 23, 29, 3, 210, 
-    0, 29, 3, 210, 82, 29, 3, 210, 62, 29, 3, 210, 69, 29, 3, 210, 81, 29, 3, 
-    210, 73, 29, 3, 210, 74, 29, 3, 210, 67, 29, 3, 210, 53, 29, 3, 191, 29, 
-    3, 210, 212, 29, 3, 211, 8, 29, 3, 211, 103, 29, 3, 211, 44, 29, 3, 211, 
-    47, 29, 3, 210, 244, 29, 3, 210, 235, 29, 3, 248, 221, 29, 3, 246, 78, 
-    29, 3, 248, 3, 29, 3, 248, 220, 29, 3, 248, 77, 29, 3, 248, 90, 29, 3, 
-    247, 145, 29, 3, 246, 47, 29, 3, 248, 135, 29, 3, 248, 100, 29, 3, 248, 
-    112, 29, 3, 248, 134, 29, 3, 248, 122, 29, 3, 248, 123, 29, 3, 248, 105, 
-    29, 3, 248, 91, 29, 3, 235, 141, 29, 3, 235, 51, 29, 3, 235, 108, 29, 3, 
-    235, 140, 29, 3, 235, 124, 29, 3, 235, 126, 29, 3, 235, 68, 29, 3, 235, 
-    31, 29, 3, 243, 135, 29, 3, 242, 113, 29, 3, 242, 214, 29, 3, 243, 132, 
-    29, 3, 243, 55, 29, 3, 243, 62, 29, 3, 242, 174, 29, 3, 242, 173, 29, 3, 
-    242, 78, 29, 3, 242, 74, 29, 3, 242, 77, 29, 3, 242, 75, 29, 3, 242, 76, 
-    29, 3, 243, 29, 29, 3, 243, 9, 29, 3, 243, 19, 29, 3, 243, 28, 29, 3, 
-    243, 23, 29, 3, 243, 24, 29, 3, 243, 13, 29, 3, 242, 254, 29, 3, 216, 
-    208, 29, 3, 216, 136, 29, 3, 216, 175, 29, 3, 216, 207, 29, 3, 216, 194, 
-    29, 3, 216, 195, 29, 3, 216, 156, 29, 3, 216, 128, 29, 3, 250, 157, 29, 
-    3, 250, 69, 29, 3, 250, 110, 29, 3, 250, 156, 29, 3, 250, 128, 29, 3, 
-    250, 131, 29, 3, 250, 86, 29, 3, 250, 58, 29, 3, 225, 147, 29, 3, 225, 
-    114, 29, 3, 225, 133, 29, 3, 225, 146, 29, 3, 225, 135, 29, 3, 225, 136, 
-    29, 3, 225, 121, 29, 3, 225, 110, 29, 3, 215, 183, 29, 3, 215, 163, 29, 
-    3, 215, 167, 29, 3, 215, 182, 29, 3, 215, 177, 29, 3, 215, 178, 29, 3, 
-    215, 166, 29, 3, 215, 161, 29, 3, 215, 39, 29, 3, 215, 31, 29, 3, 215, 
-    35, 29, 3, 215, 38, 29, 3, 215, 36, 29, 3, 215, 37, 29, 3, 215, 33, 29, 
-    3, 215, 32, 29, 3, 244, 196, 29, 3, 243, 234, 29, 3, 244, 121, 29, 3, 
-    244, 195, 29, 3, 244, 147, 29, 3, 244, 154, 29, 3, 244, 43, 29, 3, 243, 
-    213, 29, 3, 190, 29, 3, 224, 150, 29, 3, 225, 108, 29, 3, 226, 89, 29, 3, 
-    225, 211, 29, 3, 225, 221, 29, 3, 225, 16, 29, 3, 224, 114, 29, 3, 222, 
-    99, 29, 3, 230, 31, 29, 3, 243, 207, 29, 38, 243, 53, 22, 25, 233, 23, 
-    78, 29, 38, 25, 233, 23, 78, 29, 38, 243, 53, 78, 29, 221, 173, 78, 29, 
-    211, 208, 29, 243, 229, 218, 129, 29, 249, 219, 29, 220, 150, 29, 249, 
-    226, 29, 224, 199, 249, 226, 29, 224, 13, 78, 29, 226, 15, 220, 137, 29, 
-    21, 110, 29, 21, 105, 29, 21, 158, 29, 21, 161, 29, 21, 189, 29, 21, 194, 
-    29, 21, 198, 29, 21, 195, 29, 21, 200, 29, 54, 216, 247, 29, 54, 215, 73, 
-    29, 54, 216, 162, 29, 54, 244, 15, 29, 54, 244, 114, 29, 54, 219, 111, 
-    29, 54, 220, 116, 29, 54, 245, 184, 29, 54, 228, 195, 29, 54, 240, 210, 
-    29, 54, 216, 248, 216, 147, 29, 3, 221, 177, 230, 42, 29, 3, 230, 38, 29, 
-    3, 230, 39, 29, 3, 230, 40, 29, 3, 221, 177, 251, 83, 29, 3, 251, 80, 29, 
-    3, 251, 81, 29, 3, 251, 82, 29, 3, 221, 177, 243, 213, 29, 3, 243, 209, 
-    29, 3, 243, 210, 29, 3, 243, 211, 29, 3, 221, 177, 224, 114, 29, 3, 224, 
-    110, 29, 3, 224, 111, 29, 3, 224, 112, 29, 216, 31, 164, 210, 247, 29, 
-    216, 31, 164, 248, 41, 29, 216, 31, 164, 222, 238, 29, 216, 31, 164, 219, 
-    251, 222, 238, 29, 216, 31, 164, 247, 235, 29, 216, 31, 164, 234, 164, 
-    29, 216, 31, 164, 250, 94, 29, 216, 31, 164, 241, 177, 29, 216, 31, 164, 
-    248, 40, 29, 216, 31, 164, 233, 194, 169, 1, 61, 169, 1, 75, 169, 1, 73, 
-    169, 1, 76, 169, 1, 70, 169, 1, 214, 105, 169, 1, 243, 135, 169, 1, 176, 
-    169, 1, 243, 62, 169, 1, 242, 214, 169, 1, 242, 174, 169, 1, 242, 113, 
-    169, 1, 242, 79, 169, 1, 162, 169, 1, 241, 238, 169, 1, 241, 180, 169, 1, 
-    241, 68, 169, 1, 240, 222, 169, 1, 240, 201, 169, 1, 233, 135, 169, 1, 
-    233, 58, 169, 1, 232, 241, 169, 1, 232, 156, 169, 1, 232, 98, 169, 1, 
-    232, 71, 169, 1, 184, 169, 1, 231, 91, 169, 1, 230, 230, 169, 1, 230, 
-    161, 169, 1, 230, 102, 169, 1, 197, 169, 1, 241, 90, 169, 1, 229, 213, 
-    169, 1, 229, 107, 169, 1, 228, 233, 169, 1, 228, 74, 169, 1, 227, 237, 
-    169, 1, 227, 176, 169, 1, 224, 29, 169, 1, 224, 16, 169, 1, 224, 9, 169, 
-    1, 224, 1, 169, 1, 223, 246, 169, 1, 223, 244, 169, 1, 206, 169, 1, 222, 
-    91, 169, 1, 221, 181, 169, 1, 219, 191, 169, 1, 219, 58, 169, 1, 218, 83, 
-    169, 1, 218, 2, 169, 1, 248, 221, 169, 1, 217, 105, 169, 1, 248, 90, 169, 
-    1, 217, 22, 169, 1, 248, 3, 169, 1, 216, 117, 169, 1, 247, 145, 169, 1, 
-    246, 78, 169, 1, 246, 50, 169, 1, 247, 156, 169, 1, 216, 59, 169, 1, 216, 
-    58, 169, 1, 216, 47, 169, 1, 216, 46, 169, 1, 216, 45, 169, 1, 216, 44, 
-    169, 1, 215, 183, 169, 1, 215, 178, 169, 1, 215, 167, 169, 1, 215, 166, 
-    169, 1, 215, 163, 169, 1, 215, 162, 169, 1, 212, 65, 169, 1, 212, 22, 
-    169, 1, 211, 250, 169, 1, 211, 227, 169, 1, 211, 195, 169, 1, 211, 183, 
-    169, 1, 191, 169, 1, 211, 47, 169, 1, 211, 8, 169, 1, 210, 244, 169, 1, 
-    210, 212, 169, 1, 210, 177, 18, 19, 240, 168, 18, 19, 75, 18, 19, 255, 
-    37, 18, 19, 73, 18, 19, 236, 33, 18, 19, 76, 18, 19, 226, 183, 18, 19, 
-    211, 116, 226, 183, 18, 19, 72, 245, 209, 18, 19, 72, 73, 18, 19, 61, 18, 
-    19, 255, 73, 18, 19, 212, 22, 18, 19, 159, 212, 22, 18, 19, 211, 250, 18, 
-    19, 159, 211, 250, 18, 19, 211, 242, 18, 19, 159, 211, 242, 18, 19, 211, 
-    227, 18, 19, 159, 211, 227, 18, 19, 211, 215, 18, 19, 159, 211, 215, 18, 
-    19, 229, 190, 211, 215, 18, 19, 212, 65, 18, 19, 159, 212, 65, 18, 19, 
-    212, 64, 18, 19, 159, 212, 64, 18, 19, 229, 190, 212, 64, 18, 19, 254, 
-    201, 18, 19, 211, 116, 212, 98, 18, 19, 242, 180, 218, 129, 18, 19, 40, 
-    142, 18, 19, 40, 242, 136, 18, 19, 40, 251, 175, 163, 222, 233, 18, 19, 
-    40, 216, 14, 163, 222, 233, 18, 19, 40, 44, 163, 222, 233, 18, 19, 40, 
-    222, 233, 18, 19, 40, 52, 142, 18, 19, 40, 52, 219, 251, 67, 218, 90, 18, 
-    19, 40, 230, 224, 247, 120, 18, 19, 40, 219, 251, 203, 91, 18, 19, 40, 
-    225, 22, 18, 19, 40, 124, 217, 87, 18, 19, 245, 150, 18, 19, 235, 255, 
-    18, 19, 226, 196, 18, 19, 254, 123, 18, 19, 225, 221, 18, 19, 226, 87, 
-    18, 19, 225, 108, 18, 19, 225, 71, 18, 19, 225, 16, 18, 19, 224, 249, 18, 
-    19, 211, 116, 224, 249, 18, 19, 72, 241, 220, 18, 19, 72, 241, 180, 18, 
-    19, 190, 18, 19, 226, 89, 18, 19, 224, 112, 18, 19, 159, 224, 112, 18, 
-    19, 224, 110, 18, 19, 159, 224, 110, 18, 19, 224, 109, 18, 19, 159, 224, 
-    109, 18, 19, 224, 107, 18, 19, 159, 224, 107, 18, 19, 224, 106, 18, 19, 
-    159, 224, 106, 18, 19, 224, 114, 18, 19, 159, 224, 114, 18, 19, 224, 113, 
-    18, 19, 159, 224, 113, 18, 19, 211, 116, 224, 113, 18, 19, 226, 105, 18, 
-    19, 159, 226, 105, 18, 19, 72, 242, 60, 18, 19, 217, 22, 18, 19, 217, 99, 
-    18, 19, 216, 117, 18, 19, 216, 103, 18, 19, 111, 18, 19, 216, 17, 18, 19, 
-    211, 116, 216, 17, 18, 19, 72, 248, 77, 18, 19, 72, 248, 3, 18, 19, 217, 
-    105, 18, 19, 217, 101, 18, 19, 215, 78, 18, 19, 159, 215, 78, 18, 19, 
-    215, 62, 18, 19, 159, 215, 62, 18, 19, 215, 61, 18, 19, 159, 215, 61, 18, 
-    19, 105, 18, 19, 159, 105, 18, 19, 215, 54, 18, 19, 159, 215, 54, 18, 19, 
-    215, 80, 18, 19, 159, 215, 80, 18, 19, 215, 79, 18, 19, 159, 215, 79, 18, 
-    19, 229, 190, 215, 79, 18, 19, 217, 152, 18, 19, 215, 151, 18, 19, 215, 
-    135, 18, 19, 215, 133, 18, 19, 215, 156, 18, 19, 234, 182, 18, 19, 235, 
-    7, 18, 19, 234, 92, 18, 19, 234, 83, 18, 19, 234, 28, 18, 19, 234, 10, 
-    18, 19, 211, 116, 234, 10, 18, 19, 176, 18, 19, 235, 10, 18, 19, 233, 
-    178, 18, 19, 159, 233, 178, 18, 19, 233, 176, 18, 19, 159, 233, 176, 18, 
-    19, 233, 175, 18, 19, 159, 233, 175, 18, 19, 233, 174, 18, 19, 159, 233, 
-    174, 18, 19, 233, 173, 18, 19, 159, 233, 173, 18, 19, 233, 182, 18, 19, 
-    159, 233, 182, 18, 19, 233, 181, 18, 19, 159, 233, 181, 18, 19, 229, 190, 
-    233, 181, 18, 19, 235, 23, 18, 19, 233, 183, 18, 19, 219, 27, 234, 176, 
-    18, 19, 219, 27, 234, 84, 18, 19, 219, 27, 234, 23, 18, 19, 219, 27, 234, 
-    248, 18, 19, 250, 190, 18, 19, 251, 31, 18, 19, 250, 51, 18, 19, 250, 41, 
-    18, 19, 249, 238, 18, 19, 249, 174, 18, 19, 211, 116, 249, 174, 18, 19, 
-    251, 33, 18, 19, 251, 32, 18, 19, 249, 79, 18, 19, 159, 249, 79, 18, 19, 
-    249, 77, 18, 19, 159, 249, 77, 18, 19, 249, 76, 18, 19, 159, 249, 76, 18, 
-    19, 249, 75, 18, 19, 159, 249, 75, 18, 19, 249, 74, 18, 19, 159, 249, 74, 
-    18, 19, 249, 81, 18, 19, 159, 249, 81, 18, 19, 249, 80, 18, 19, 159, 249, 
-    80, 18, 19, 229, 190, 249, 80, 18, 19, 251, 66, 18, 19, 221, 209, 216, 
-    210, 18, 19, 231, 91, 18, 19, 231, 236, 18, 19, 230, 230, 18, 19, 230, 
-    201, 18, 19, 230, 161, 18, 19, 230, 132, 18, 19, 211, 116, 230, 132, 18, 
-    19, 184, 18, 19, 231, 237, 18, 19, 230, 40, 18, 19, 159, 230, 40, 18, 19, 
-    230, 38, 18, 19, 159, 230, 38, 18, 19, 230, 37, 18, 19, 159, 230, 37, 18, 
-    19, 230, 36, 18, 19, 159, 230, 36, 18, 19, 230, 35, 18, 19, 159, 230, 35, 
-    18, 19, 230, 42, 18, 19, 159, 230, 42, 18, 19, 230, 41, 18, 19, 159, 230, 
-    41, 18, 19, 229, 190, 230, 41, 18, 19, 193, 18, 19, 159, 193, 18, 19, 
-    230, 234, 18, 19, 253, 205, 193, 18, 19, 221, 209, 193, 18, 19, 229, 107, 
-    18, 19, 229, 224, 18, 19, 228, 233, 18, 19, 228, 208, 18, 19, 228, 74, 
-    18, 19, 228, 64, 18, 19, 211, 116, 228, 64, 18, 19, 197, 18, 19, 229, 
-    225, 18, 19, 227, 172, 18, 19, 159, 227, 172, 18, 19, 227, 174, 18, 19, 
-    159, 227, 174, 18, 19, 227, 173, 18, 19, 159, 227, 173, 18, 19, 229, 190, 
-    227, 173, 18, 19, 230, 25, 18, 19, 72, 229, 79, 18, 19, 228, 238, 18, 19, 
-    233, 58, 18, 19, 233, 133, 18, 19, 232, 241, 18, 19, 232, 227, 18, 19, 
-    232, 156, 18, 19, 232, 127, 18, 19, 211, 116, 232, 127, 18, 19, 233, 135, 
-    18, 19, 233, 134, 18, 19, 232, 68, 18, 19, 159, 232, 68, 18, 19, 232, 67, 
-    18, 19, 159, 232, 67, 18, 19, 232, 66, 18, 19, 159, 232, 66, 18, 19, 232, 
-    65, 18, 19, 159, 232, 65, 18, 19, 232, 64, 18, 19, 159, 232, 64, 18, 19, 
-    232, 70, 18, 19, 159, 232, 70, 18, 19, 232, 69, 18, 19, 159, 232, 69, 18, 
-    19, 156, 18, 19, 159, 156, 18, 19, 147, 156, 18, 19, 221, 181, 18, 19, 
-    222, 29, 18, 19, 219, 191, 18, 19, 219, 175, 18, 19, 219, 58, 18, 19, 
-    219, 40, 18, 19, 211, 116, 219, 40, 18, 19, 206, 18, 19, 222, 31, 18, 19, 
-    217, 249, 18, 19, 159, 217, 249, 18, 19, 217, 243, 18, 19, 159, 217, 243, 
-    18, 19, 217, 242, 18, 19, 159, 217, 242, 18, 19, 217, 238, 18, 19, 159, 
-    217, 238, 18, 19, 217, 237, 18, 19, 159, 217, 237, 18, 19, 217, 253, 18, 
-    19, 159, 217, 253, 18, 19, 217, 252, 18, 19, 159, 217, 252, 18, 19, 229, 
-    190, 217, 252, 18, 19, 222, 91, 18, 19, 253, 205, 222, 91, 18, 19, 217, 
-    254, 18, 19, 251, 218, 222, 91, 18, 19, 230, 127, 219, 108, 18, 19, 229, 
-    190, 219, 99, 18, 19, 229, 190, 222, 89, 18, 19, 229, 190, 218, 235, 18, 
-    19, 229, 190, 218, 86, 18, 19, 229, 190, 219, 98, 18, 19, 229, 190, 221, 
-    184, 18, 19, 220, 63, 18, 19, 220, 32, 18, 19, 220, 27, 18, 19, 220, 7, 
-    18, 19, 220, 1, 18, 19, 220, 102, 18, 19, 220, 98, 18, 19, 219, 206, 18, 
-    19, 159, 219, 206, 18, 19, 219, 205, 18, 19, 159, 219, 205, 18, 19, 219, 
-    204, 18, 19, 159, 219, 204, 18, 19, 219, 203, 18, 19, 159, 219, 203, 18, 
-    19, 219, 202, 18, 19, 159, 219, 202, 18, 19, 219, 208, 18, 19, 159, 219, 
-    208, 18, 19, 219, 207, 18, 19, 159, 219, 207, 18, 19, 220, 104, 18, 19, 
-    211, 47, 18, 19, 211, 101, 18, 19, 211, 8, 18, 19, 210, 255, 18, 19, 210, 
-    244, 18, 19, 210, 229, 18, 19, 211, 116, 210, 229, 18, 19, 191, 18, 19, 
-    211, 103, 18, 19, 210, 174, 18, 19, 159, 210, 174, 18, 19, 210, 173, 18, 
-    19, 159, 210, 173, 18, 19, 210, 172, 18, 19, 159, 210, 172, 18, 19, 210, 
-    171, 18, 19, 159, 210, 171, 18, 19, 210, 170, 18, 19, 159, 210, 170, 18, 
-    19, 210, 176, 18, 19, 159, 210, 176, 18, 19, 210, 175, 18, 19, 159, 210, 
-    175, 18, 19, 229, 190, 210, 175, 18, 19, 211, 117, 18, 19, 252, 4, 211, 
-    117, 18, 19, 159, 211, 117, 18, 19, 221, 209, 211, 8, 18, 19, 223, 128, 
-    18, 19, 223, 223, 223, 128, 18, 19, 159, 233, 58, 18, 19, 223, 183, 18, 
-    19, 223, 35, 18, 19, 222, 239, 18, 19, 222, 211, 18, 19, 222, 197, 18, 
-    19, 159, 232, 156, 18, 19, 205, 18, 19, 223, 184, 18, 19, 159, 233, 135, 
-    18, 19, 222, 108, 18, 19, 159, 222, 108, 18, 19, 153, 18, 19, 159, 153, 
-    18, 19, 147, 153, 18, 19, 244, 154, 18, 19, 244, 193, 18, 19, 244, 121, 
-    18, 19, 244, 108, 18, 19, 244, 43, 18, 19, 244, 34, 18, 19, 244, 196, 18, 
-    19, 244, 195, 18, 19, 243, 212, 18, 19, 159, 243, 212, 18, 19, 245, 6, 
-    18, 19, 216, 195, 18, 19, 230, 23, 216, 195, 18, 19, 216, 175, 18, 19, 
-    230, 23, 216, 175, 18, 19, 216, 171, 18, 19, 230, 23, 216, 171, 18, 19, 
-    216, 156, 18, 19, 216, 153, 18, 19, 216, 208, 18, 19, 216, 207, 18, 19, 
-    216, 127, 18, 19, 159, 216, 127, 18, 19, 216, 210, 18, 19, 215, 142, 18, 
-    19, 215, 140, 18, 19, 215, 139, 18, 19, 215, 144, 18, 19, 215, 145, 18, 
-    19, 215, 52, 18, 19, 215, 51, 18, 19, 215, 50, 18, 19, 215, 53, 18, 19, 
-    227, 193, 241, 238, 18, 19, 227, 193, 241, 180, 18, 19, 227, 193, 241, 
-    161, 18, 19, 227, 193, 241, 68, 18, 19, 227, 193, 241, 53, 18, 19, 227, 
-    193, 162, 18, 19, 227, 193, 242, 46, 18, 19, 227, 193, 242, 60, 18, 19, 
-    227, 192, 242, 60, 18, 19, 241, 154, 18, 19, 224, 84, 18, 19, 224, 53, 
-    18, 19, 224, 48, 18, 19, 224, 42, 18, 19, 224, 37, 18, 19, 224, 88, 18, 
-    19, 224, 87, 18, 19, 224, 96, 18, 19, 216, 55, 18, 19, 216, 53, 18, 19, 
-    216, 52, 18, 19, 216, 56, 18, 19, 159, 223, 128, 18, 19, 159, 223, 35, 
-    18, 19, 159, 222, 211, 18, 19, 159, 205, 18, 19, 229, 75, 18, 19, 229, 
-    27, 18, 19, 229, 23, 18, 19, 229, 4, 18, 19, 228, 255, 18, 19, 229, 77, 
-    18, 19, 229, 76, 18, 19, 229, 79, 18, 19, 228, 103, 18, 19, 221, 209, 
-    220, 63, 18, 19, 221, 209, 220, 32, 18, 19, 221, 209, 220, 7, 18, 19, 
-    221, 209, 220, 102, 18, 19, 211, 213, 216, 195, 18, 19, 211, 213, 216, 
-    175, 18, 19, 211, 213, 216, 156, 18, 19, 211, 213, 216, 208, 18, 19, 211, 
-    213, 216, 210, 18, 19, 232, 248, 18, 19, 232, 247, 18, 19, 232, 246, 18, 
-    19, 232, 245, 18, 19, 232, 254, 18, 19, 232, 253, 18, 19, 232, 255, 18, 
-    19, 216, 209, 216, 195, 18, 19, 216, 209, 216, 175, 18, 19, 216, 209, 
-    216, 171, 18, 19, 216, 209, 216, 156, 18, 19, 216, 209, 216, 153, 18, 19, 
-    216, 209, 216, 208, 18, 19, 216, 209, 216, 207, 18, 19, 216, 209, 216, 
-    210, 18, 19, 254, 189, 253, 158, 18, 19, 251, 218, 75, 18, 19, 251, 218, 
-    73, 18, 19, 251, 218, 76, 18, 19, 251, 218, 61, 18, 19, 251, 218, 212, 
-    22, 18, 19, 251, 218, 211, 250, 18, 19, 251, 218, 211, 227, 18, 19, 251, 
-    218, 212, 65, 18, 19, 251, 218, 229, 107, 18, 19, 251, 218, 228, 233, 18, 
-    19, 251, 218, 228, 74, 18, 19, 251, 218, 197, 18, 19, 251, 218, 234, 182, 
-    18, 19, 251, 218, 234, 92, 18, 19, 251, 218, 234, 28, 18, 19, 251, 218, 
-    176, 18, 19, 221, 209, 241, 238, 18, 19, 221, 209, 241, 180, 18, 19, 221, 
-    209, 241, 68, 18, 19, 221, 209, 162, 18, 19, 72, 242, 220, 18, 19, 72, 
-    242, 224, 18, 19, 72, 242, 236, 18, 19, 72, 242, 235, 18, 19, 72, 242, 
-    225, 18, 19, 72, 242, 249, 18, 19, 72, 222, 140, 18, 19, 72, 222, 211, 
-    18, 19, 72, 223, 128, 18, 19, 72, 223, 108, 18, 19, 72, 223, 35, 18, 19, 
-    72, 205, 18, 19, 72, 211, 195, 18, 19, 72, 211, 227, 18, 19, 72, 212, 22, 
-    18, 19, 72, 212, 17, 18, 19, 72, 211, 250, 18, 19, 72, 212, 65, 18, 19, 
-    72, 240, 194, 18, 19, 72, 240, 195, 18, 19, 72, 240, 198, 18, 19, 72, 
-    240, 197, 18, 19, 72, 240, 196, 18, 19, 72, 240, 200, 18, 19, 72, 216, 
-    136, 18, 19, 72, 216, 156, 18, 19, 72, 216, 195, 18, 19, 72, 216, 194, 
-    18, 19, 72, 216, 175, 18, 19, 72, 216, 208, 18, 19, 72, 215, 123, 18, 19, 
-    72, 215, 133, 18, 19, 72, 215, 151, 18, 19, 72, 215, 150, 18, 19, 72, 
-    215, 135, 18, 19, 72, 215, 156, 18, 19, 72, 224, 150, 18, 19, 72, 225, 
-    16, 18, 19, 72, 225, 221, 18, 19, 72, 225, 211, 18, 19, 72, 225, 108, 18, 
-    19, 72, 190, 18, 19, 72, 226, 105, 18, 19, 72, 242, 113, 18, 19, 72, 242, 
-    174, 18, 19, 72, 243, 62, 18, 19, 72, 243, 55, 18, 19, 72, 242, 214, 18, 
-    19, 72, 243, 135, 18, 19, 72, 234, 100, 18, 19, 72, 234, 105, 18, 19, 72, 
-    234, 119, 18, 19, 72, 234, 118, 18, 19, 72, 234, 112, 18, 19, 72, 234, 
-    132, 18, 19, 72, 234, 41, 18, 19, 72, 234, 42, 18, 19, 72, 234, 45, 18, 
-    19, 72, 234, 44, 18, 19, 72, 234, 43, 18, 19, 72, 234, 46, 18, 19, 72, 
-    234, 47, 18, 19, 72, 227, 237, 18, 19, 72, 228, 74, 18, 19, 72, 229, 107, 
-    18, 19, 72, 229, 103, 18, 19, 72, 228, 233, 18, 19, 72, 197, 18, 19, 72, 
-    230, 102, 18, 19, 72, 230, 161, 18, 19, 72, 231, 91, 18, 19, 72, 231, 80, 
-    18, 19, 72, 230, 230, 18, 19, 72, 184, 18, 19, 72, 210, 212, 18, 19, 72, 
-    210, 244, 18, 19, 72, 211, 47, 18, 19, 72, 211, 44, 18, 19, 72, 211, 8, 
-    18, 19, 72, 191, 18, 19, 72, 235, 51, 18, 19, 221, 209, 235, 51, 18, 19, 
-    72, 235, 68, 18, 19, 72, 235, 126, 18, 19, 72, 235, 124, 18, 19, 72, 235, 
-    108, 18, 19, 221, 209, 235, 108, 18, 19, 72, 235, 141, 18, 19, 72, 235, 
-    81, 18, 19, 72, 235, 85, 18, 19, 72, 235, 95, 18, 19, 72, 235, 94, 18, 
-    19, 72, 235, 93, 18, 19, 72, 235, 96, 18, 19, 72, 232, 98, 18, 19, 72, 
-    232, 156, 18, 19, 72, 233, 58, 18, 19, 72, 233, 50, 18, 19, 72, 232, 241, 
-    18, 19, 72, 233, 135, 18, 19, 72, 247, 149, 18, 19, 72, 247, 150, 18, 19, 
-    72, 247, 155, 18, 19, 72, 247, 154, 18, 19, 72, 247, 151, 18, 19, 72, 
-    247, 156, 18, 19, 72, 232, 244, 18, 19, 72, 232, 246, 18, 19, 72, 232, 
-    250, 18, 19, 72, 232, 249, 18, 19, 72, 232, 248, 18, 19, 72, 232, 254, 
-    18, 19, 72, 216, 50, 18, 19, 72, 216, 52, 18, 19, 72, 216, 55, 18, 19, 
-    72, 216, 54, 18, 19, 72, 216, 53, 18, 19, 72, 216, 56, 18, 19, 72, 216, 
-    45, 18, 19, 72, 216, 46, 18, 19, 72, 216, 58, 18, 19, 72, 216, 57, 18, 
-    19, 72, 216, 47, 18, 19, 72, 216, 59, 18, 19, 72, 210, 13, 18, 19, 72, 
-    210, 23, 18, 19, 72, 210, 94, 18, 19, 72, 210, 92, 18, 19, 72, 210, 44, 
-    18, 19, 72, 210, 116, 18, 19, 72, 210, 159, 18, 19, 72, 65, 210, 159, 18, 
-    19, 72, 246, 28, 18, 19, 72, 246, 29, 18, 19, 72, 246, 36, 18, 19, 72, 
-    246, 35, 18, 19, 72, 246, 31, 18, 19, 72, 246, 38, 18, 19, 72, 218, 83, 
-    18, 19, 72, 219, 58, 18, 19, 72, 221, 181, 18, 19, 72, 221, 170, 18, 19, 
-    72, 219, 191, 18, 19, 72, 206, 18, 19, 72, 219, 225, 18, 19, 72, 220, 7, 
-    18, 19, 72, 220, 63, 18, 19, 72, 220, 61, 18, 19, 72, 220, 32, 18, 19, 
-    72, 220, 102, 18, 19, 72, 220, 104, 18, 19, 72, 215, 163, 18, 19, 72, 
-    215, 166, 18, 19, 72, 215, 178, 18, 19, 72, 215, 177, 18, 19, 72, 215, 
-    167, 18, 19, 72, 215, 183, 18, 19, 72, 250, 69, 18, 19, 72, 250, 86, 18, 
-    19, 72, 250, 131, 18, 19, 72, 250, 128, 18, 19, 72, 250, 110, 18, 19, 72, 
-    250, 157, 18, 19, 72, 215, 126, 18, 19, 72, 215, 127, 18, 19, 72, 215, 
-    130, 18, 19, 72, 215, 129, 18, 19, 72, 215, 128, 18, 19, 72, 215, 131, 
-    18, 19, 250, 111, 50, 18, 19, 243, 229, 218, 129, 18, 19, 224, 80, 18, 
-    19, 229, 73, 18, 19, 228, 100, 18, 19, 228, 99, 18, 19, 228, 98, 18, 19, 
-    228, 97, 18, 19, 228, 102, 18, 19, 228, 101, 18, 19, 211, 213, 216, 125, 
-    18, 19, 211, 213, 216, 124, 18, 19, 211, 213, 216, 123, 18, 19, 211, 213, 
-    216, 122, 18, 19, 211, 213, 216, 121, 18, 19, 211, 213, 216, 128, 18, 19, 
-    211, 213, 216, 127, 18, 19, 211, 213, 40, 216, 210, 18, 19, 251, 218, 
-    212, 98, 226, 226, 219, 19, 78, 226, 226, 1, 252, 48, 226, 226, 1, 232, 
-    87, 226, 226, 1, 244, 151, 226, 226, 1, 222, 15, 226, 226, 1, 228, 193, 
-    226, 226, 1, 214, 226, 226, 226, 1, 248, 197, 226, 226, 1, 216, 80, 226, 
-    226, 1, 249, 229, 226, 226, 1, 250, 180, 226, 226, 1, 230, 91, 226, 226, 
-    1, 242, 156, 226, 226, 1, 229, 63, 226, 226, 1, 218, 122, 226, 226, 1, 
-    222, 135, 226, 226, 1, 254, 198, 226, 226, 1, 226, 187, 226, 226, 1, 214, 
-    150, 226, 226, 1, 245, 231, 226, 226, 1, 235, 188, 226, 226, 1, 245, 232, 
-    226, 226, 1, 226, 158, 226, 226, 1, 214, 206, 226, 226, 1, 236, 39, 226, 
-    226, 1, 245, 229, 226, 226, 1, 225, 202, 226, 226, 244, 150, 78, 226, 
-    226, 223, 49, 244, 150, 78, 178, 1, 244, 141, 244, 133, 244, 155, 245, 6, 
-    178, 1, 214, 105, 178, 1, 214, 135, 214, 151, 70, 178, 1, 210, 214, 178, 
-    1, 211, 117, 178, 1, 212, 98, 178, 1, 216, 130, 216, 129, 216, 151, 178, 
-    1, 245, 59, 178, 1, 254, 93, 61, 178, 1, 226, 143, 76, 178, 1, 255, 17, 
-    61, 178, 1, 254, 227, 178, 1, 232, 133, 76, 178, 1, 219, 244, 76, 178, 1, 
-    76, 178, 1, 226, 234, 178, 1, 226, 196, 178, 1, 223, 164, 223, 177, 223, 
-    94, 153, 178, 1, 234, 193, 178, 1, 250, 177, 178, 1, 234, 194, 235, 23, 
-    178, 1, 243, 202, 178, 1, 245, 138, 178, 1, 243, 58, 242, 66, 243, 202, 
-    178, 1, 243, 96, 178, 1, 211, 188, 211, 182, 212, 98, 178, 1, 242, 38, 
-    242, 60, 178, 1, 242, 42, 242, 60, 178, 1, 232, 135, 242, 60, 178, 1, 
-    219, 247, 242, 60, 178, 1, 229, 185, 227, 157, 229, 186, 230, 25, 178, 1, 
-    219, 245, 230, 25, 178, 1, 246, 115, 178, 1, 235, 168, 235, 172, 235, 
-    162, 73, 178, 1, 75, 178, 1, 235, 117, 235, 144, 178, 1, 243, 43, 178, 1, 
-    232, 136, 254, 243, 178, 1, 219, 249, 61, 178, 1, 235, 154, 245, 113, 
-    178, 1, 225, 164, 225, 186, 226, 105, 178, 1, 254, 163, 245, 111, 178, 1, 
-    219, 24, 222, 91, 178, 1, 219, 179, 232, 132, 222, 91, 178, 1, 219, 243, 
-    222, 91, 178, 1, 251, 66, 178, 1, 210, 159, 178, 1, 216, 63, 216, 73, 
-    215, 41, 217, 152, 178, 1, 219, 242, 217, 152, 178, 1, 249, 60, 178, 1, 
-    252, 31, 252, 34, 251, 224, 253, 158, 178, 1, 219, 248, 253, 158, 178, 1, 
-    246, 114, 178, 1, 226, 171, 178, 1, 245, 196, 245, 198, 75, 178, 1, 231, 
-    178, 231, 186, 193, 178, 1, 232, 134, 193, 178, 1, 219, 246, 193, 178, 1, 
-    233, 73, 233, 114, 232, 143, 156, 178, 1, 246, 116, 178, 1, 235, 230, 
-    178, 1, 235, 231, 178, 1, 248, 210, 248, 215, 249, 60, 178, 1, 226, 138, 
-    245, 58, 76, 178, 1, 245, 227, 178, 1, 235, 187, 178, 1, 249, 78, 178, 1, 
-    251, 17, 178, 1, 250, 189, 178, 1, 218, 161, 178, 1, 232, 131, 178, 1, 
-    219, 241, 178, 1, 240, 110, 178, 1, 224, 96, 178, 1, 211, 178, 178, 219, 
-    155, 224, 140, 178, 230, 85, 224, 140, 178, 249, 131, 224, 140, 178, 254, 
-    6, 87, 178, 215, 82, 87, 178, 252, 46, 87, 217, 83, 1, 61, 217, 83, 1, 
-    73, 217, 83, 1, 70, 217, 83, 1, 176, 217, 83, 1, 243, 135, 217, 83, 1, 
-    229, 77, 217, 83, 1, 217, 105, 217, 83, 1, 248, 221, 217, 83, 1, 197, 
-    217, 83, 1, 190, 217, 83, 1, 252, 191, 217, 83, 1, 184, 217, 83, 1, 191, 
-    217, 83, 1, 233, 135, 217, 83, 1, 212, 65, 217, 83, 1, 206, 217, 83, 1, 
-    162, 217, 83, 25, 5, 73, 217, 83, 25, 5, 70, 217, 83, 5, 213, 152, 242, 
-    7, 1, 61, 242, 7, 1, 73, 242, 7, 1, 70, 242, 7, 1, 176, 242, 7, 1, 243, 
-    135, 242, 7, 1, 229, 77, 242, 7, 1, 217, 105, 242, 7, 1, 248, 221, 242, 
-    7, 1, 197, 242, 7, 1, 190, 242, 7, 1, 252, 191, 242, 7, 1, 184, 242, 7, 
-    1, 191, 242, 7, 1, 205, 242, 7, 1, 233, 135, 242, 7, 1, 212, 65, 242, 7, 
-    1, 206, 242, 7, 1, 162, 242, 7, 25, 5, 73, 242, 7, 25, 5, 70, 242, 7, 5, 
-    226, 49, 225, 126, 219, 155, 224, 140, 225, 126, 52, 224, 140, 251, 120, 
-    1, 61, 251, 120, 1, 73, 251, 120, 1, 70, 251, 120, 1, 176, 251, 120, 1, 
-    243, 135, 251, 120, 1, 229, 77, 251, 120, 1, 217, 105, 251, 120, 1, 248, 
-    221, 251, 120, 1, 197, 251, 120, 1, 190, 251, 120, 1, 252, 191, 251, 120, 
-    1, 184, 251, 120, 1, 191, 251, 120, 1, 205, 251, 120, 1, 233, 135, 251, 
-    120, 1, 212, 65, 251, 120, 1, 206, 251, 120, 1, 162, 251, 120, 25, 5, 73, 
-    251, 120, 25, 5, 70, 217, 82, 1, 61, 217, 82, 1, 73, 217, 82, 1, 70, 217, 
-    82, 1, 176, 217, 82, 1, 243, 135, 217, 82, 1, 229, 77, 217, 82, 1, 217, 
-    105, 217, 82, 1, 248, 221, 217, 82, 1, 197, 217, 82, 1, 190, 217, 82, 1, 
-    252, 191, 217, 82, 1, 184, 217, 82, 1, 191, 217, 82, 1, 233, 135, 217, 
-    82, 1, 212, 65, 217, 82, 1, 206, 217, 82, 25, 5, 73, 217, 82, 25, 5, 70, 
-    69, 1, 176, 69, 1, 234, 132, 69, 1, 234, 28, 69, 1, 234, 105, 69, 1, 229, 
-    4, 69, 1, 251, 33, 69, 1, 250, 157, 69, 1, 249, 238, 69, 1, 250, 86, 69, 
-    1, 227, 134, 69, 1, 248, 221, 69, 1, 215, 144, 69, 1, 247, 145, 69, 1, 
-    215, 139, 69, 1, 228, 80, 69, 1, 217, 105, 69, 1, 216, 208, 69, 1, 111, 
-    69, 1, 216, 156, 69, 1, 228, 74, 69, 1, 252, 191, 69, 1, 225, 147, 69, 1, 
-    225, 16, 69, 1, 225, 121, 69, 1, 230, 161, 69, 1, 210, 244, 69, 1, 222, 
-    211, 69, 1, 232, 156, 69, 1, 213, 138, 69, 1, 220, 102, 69, 1, 218, 184, 
-    69, 1, 206, 69, 1, 162, 69, 1, 233, 135, 69, 1, 224, 88, 69, 235, 243, 
-    25, 224, 74, 69, 235, 243, 25, 224, 87, 69, 235, 243, 25, 224, 53, 69, 
-    235, 243, 25, 224, 48, 69, 235, 243, 25, 224, 30, 69, 235, 243, 25, 224, 
-    2, 69, 235, 243, 25, 223, 246, 69, 235, 243, 25, 223, 245, 69, 235, 243, 
-    25, 222, 100, 69, 235, 243, 25, 222, 93, 69, 235, 243, 25, 232, 62, 69, 
-    235, 243, 25, 232, 52, 69, 235, 243, 25, 224, 69, 69, 235, 243, 25, 224, 
-    80, 69, 235, 243, 25, 224, 38, 215, 49, 110, 69, 235, 243, 25, 224, 38, 
-    215, 49, 105, 69, 235, 243, 25, 224, 70, 69, 25, 235, 229, 254, 45, 69, 
-    25, 235, 229, 255, 73, 69, 25, 5, 255, 73, 69, 25, 5, 73, 69, 25, 5, 236, 
-    33, 69, 25, 5, 211, 117, 69, 25, 5, 210, 169, 69, 25, 5, 70, 69, 25, 5, 
-    214, 118, 69, 25, 5, 214, 229, 69, 25, 5, 226, 234, 69, 25, 5, 191, 69, 
-    25, 5, 236, 60, 69, 25, 5, 75, 69, 25, 5, 254, 243, 69, 25, 5, 254, 201, 
-    69, 25, 5, 226, 183, 69, 25, 5, 253, 192, 69, 5, 228, 206, 69, 5, 223, 
-    126, 69, 5, 210, 180, 69, 5, 230, 52, 69, 5, 215, 213, 69, 5, 252, 143, 
-    69, 5, 222, 206, 69, 5, 216, 40, 69, 5, 234, 241, 69, 5, 254, 203, 69, 5, 
-    221, 244, 221, 238, 69, 5, 213, 149, 69, 5, 249, 232, 69, 5, 252, 117, 
-    69, 5, 234, 125, 69, 5, 252, 137, 69, 5, 251, 9, 225, 72, 233, 187, 69, 
-    5, 233, 30, 216, 17, 69, 5, 252, 20, 69, 5, 225, 123, 230, 99, 69, 5, 
-    234, 9, 69, 249, 98, 16, 223, 28, 69, 5, 253, 174, 69, 5, 253, 195, 69, 
-    21, 210, 86, 69, 21, 110, 69, 21, 105, 69, 21, 158, 69, 21, 161, 69, 21, 
-    189, 69, 21, 194, 69, 21, 198, 69, 21, 195, 69, 21, 200, 69, 16, 233, 30, 
-    253, 197, 219, 43, 69, 16, 233, 30, 253, 197, 230, 71, 69, 16, 233, 30, 
-    253, 197, 225, 71, 69, 16, 233, 30, 253, 197, 252, 49, 69, 16, 233, 30, 
-    253, 197, 251, 103, 69, 16, 233, 30, 253, 197, 224, 215, 69, 16, 233, 30, 
-    253, 197, 224, 209, 69, 16, 233, 30, 253, 197, 224, 207, 69, 16, 233, 30, 
-    253, 197, 224, 213, 69, 16, 233, 30, 253, 197, 224, 211, 83, 251, 236, 
-    83, 245, 163, 83, 249, 219, 83, 243, 229, 218, 129, 83, 249, 226, 83, 
-    244, 11, 247, 118, 83, 216, 39, 219, 52, 240, 168, 83, 219, 190, 3, 251, 
-    172, 231, 154, 83, 231, 183, 249, 219, 83, 231, 183, 243, 229, 218, 129, 
-    83, 228, 191, 83, 243, 253, 45, 221, 157, 110, 83, 243, 253, 45, 221, 
-    157, 105, 83, 243, 253, 45, 221, 157, 158, 83, 25, 220, 137, 83, 21, 210, 
-    86, 83, 21, 110, 83, 21, 105, 83, 21, 158, 83, 21, 161, 83, 21, 189, 83, 
-    21, 194, 83, 21, 198, 83, 21, 195, 83, 21, 200, 83, 1, 61, 83, 1, 75, 83, 
-    1, 73, 83, 1, 76, 83, 1, 70, 83, 1, 226, 234, 83, 1, 214, 214, 83, 1, 
-    245, 209, 83, 1, 197, 83, 1, 254, 115, 83, 1, 252, 191, 83, 1, 190, 83, 
-    1, 224, 88, 83, 1, 243, 135, 83, 1, 184, 83, 1, 233, 135, 83, 1, 206, 83, 
-    1, 220, 102, 83, 1, 217, 105, 83, 1, 248, 221, 83, 1, 250, 157, 83, 1, 
-    235, 141, 83, 1, 191, 83, 1, 205, 83, 1, 212, 65, 83, 1, 244, 196, 83, 1, 
-    176, 83, 1, 234, 132, 83, 1, 215, 183, 83, 1, 210, 116, 83, 1, 242, 46, 
-    83, 1, 210, 16, 83, 1, 232, 254, 83, 1, 210, 69, 83, 1, 250, 110, 83, 1, 
-    216, 39, 199, 25, 50, 83, 1, 216, 39, 75, 83, 1, 216, 39, 73, 83, 1, 216, 
-    39, 76, 83, 1, 216, 39, 70, 83, 1, 216, 39, 226, 234, 83, 1, 216, 39, 
-    214, 214, 83, 1, 216, 39, 254, 115, 83, 1, 216, 39, 252, 191, 83, 1, 216, 
-    39, 190, 83, 1, 216, 39, 224, 88, 83, 1, 216, 39, 243, 135, 83, 1, 216, 
-    39, 184, 83, 1, 216, 39, 217, 105, 83, 1, 216, 39, 248, 221, 83, 1, 216, 
-    39, 250, 157, 83, 1, 216, 39, 235, 141, 83, 1, 216, 39, 215, 183, 83, 1, 
-    216, 39, 191, 83, 1, 216, 39, 212, 65, 83, 1, 216, 39, 176, 83, 1, 216, 
-    39, 243, 132, 83, 1, 216, 39, 242, 46, 83, 1, 216, 39, 235, 107, 83, 1, 
-    216, 39, 228, 231, 83, 1, 216, 39, 246, 38, 83, 1, 219, 190, 75, 83, 1, 
-    219, 190, 73, 83, 1, 219, 190, 235, 152, 83, 1, 219, 190, 214, 214, 83, 
-    1, 219, 190, 70, 83, 1, 219, 190, 254, 115, 83, 1, 219, 190, 176, 83, 1, 
-    219, 190, 243, 135, 83, 1, 219, 190, 162, 83, 1, 219, 190, 190, 83, 1, 
-    219, 190, 220, 102, 83, 1, 219, 190, 217, 105, 83, 1, 219, 190, 248, 221, 
-    83, 1, 219, 190, 235, 141, 83, 1, 219, 190, 244, 196, 83, 1, 219, 190, 
-    243, 132, 83, 1, 219, 190, 242, 46, 83, 1, 219, 190, 215, 183, 83, 1, 
-    219, 190, 210, 116, 83, 1, 219, 190, 223, 184, 83, 1, 219, 190, 250, 157, 
-    83, 1, 219, 190, 210, 82, 83, 1, 231, 183, 73, 83, 1, 231, 183, 176, 83, 
-    1, 231, 183, 205, 83, 1, 231, 183, 244, 196, 83, 1, 231, 183, 210, 82, 
-    83, 1, 254, 162, 243, 116, 254, 76, 110, 83, 1, 254, 162, 243, 116, 213, 
-    148, 110, 83, 1, 254, 162, 243, 116, 248, 186, 83, 1, 254, 162, 243, 116, 
-    214, 224, 83, 1, 254, 162, 243, 116, 235, 193, 214, 224, 83, 1, 254, 162, 
-    243, 116, 252, 155, 83, 1, 254, 162, 243, 116, 134, 252, 155, 83, 1, 254, 
-    162, 243, 116, 61, 83, 1, 254, 162, 243, 116, 73, 83, 1, 254, 162, 243, 
-    116, 176, 83, 1, 254, 162, 243, 116, 229, 77, 83, 1, 254, 162, 243, 116, 
-    251, 33, 83, 1, 254, 162, 243, 116, 215, 156, 83, 1, 254, 162, 243, 116, 
-    215, 144, 83, 1, 254, 162, 243, 116, 248, 135, 83, 1, 254, 162, 243, 116, 
-    228, 110, 83, 1, 254, 162, 243, 116, 217, 105, 83, 1, 254, 162, 243, 116, 
-    248, 221, 83, 1, 254, 162, 243, 116, 190, 83, 1, 254, 162, 243, 116, 225, 
-    147, 83, 1, 254, 162, 243, 116, 218, 223, 83, 1, 254, 162, 243, 116, 210, 
-    82, 83, 1, 254, 162, 243, 116, 210, 116, 83, 1, 254, 162, 243, 116, 254, 
-    209, 83, 1, 216, 39, 254, 162, 243, 116, 217, 105, 83, 1, 216, 39, 254, 
-    162, 243, 116, 210, 82, 83, 1, 231, 183, 254, 162, 243, 116, 242, 249, 
-    83, 1, 231, 183, 254, 162, 243, 116, 229, 77, 83, 1, 231, 183, 254, 162, 
-    243, 116, 251, 33, 83, 1, 231, 183, 254, 162, 243, 116, 235, 114, 83, 1, 
-    231, 183, 254, 162, 243, 116, 215, 156, 83, 1, 231, 183, 254, 162, 243, 
-    116, 248, 119, 83, 1, 231, 183, 254, 162, 243, 116, 217, 105, 83, 1, 231, 
-    183, 254, 162, 243, 116, 248, 25, 83, 1, 231, 183, 254, 162, 243, 116, 
-    218, 223, 83, 1, 231, 183, 254, 162, 243, 116, 249, 72, 83, 1, 231, 183, 
-    254, 162, 243, 116, 210, 82, 83, 1, 231, 183, 254, 162, 243, 116, 210, 
-    116, 83, 1, 254, 162, 243, 116, 163, 70, 83, 1, 254, 162, 243, 116, 163, 
-    191, 83, 1, 231, 183, 254, 162, 243, 116, 252, 18, 83, 1, 254, 162, 243, 
-    116, 248, 211, 83, 1, 231, 183, 254, 162, 243, 116, 232, 254, 18, 19, 
-    226, 109, 18, 19, 253, 167, 18, 19, 255, 28, 18, 19, 212, 25, 18, 19, 
-    224, 221, 18, 19, 225, 229, 18, 19, 224, 105, 18, 19, 217, 31, 18, 19, 
-    234, 189, 18, 19, 233, 179, 18, 19, 231, 132, 18, 19, 228, 37, 18, 19, 
-    229, 181, 18, 19, 233, 68, 18, 19, 219, 22, 18, 19, 221, 211, 18, 19, 
-    219, 232, 18, 19, 220, 66, 18, 19, 219, 201, 18, 19, 210, 220, 18, 19, 
-    211, 52, 18, 19, 223, 134, 18, 19, 227, 171, 18, 19, 226, 216, 227, 171, 
-    18, 19, 227, 170, 18, 19, 226, 216, 227, 170, 18, 19, 227, 169, 18, 19, 
-    226, 216, 227, 169, 18, 19, 227, 168, 18, 19, 226, 216, 227, 168, 18, 19, 
-    222, 105, 18, 19, 222, 104, 18, 19, 222, 103, 18, 19, 222, 102, 18, 19, 
-    222, 101, 18, 19, 222, 109, 18, 19, 226, 216, 226, 105, 18, 19, 226, 216, 
-    217, 152, 18, 19, 226, 216, 235, 23, 18, 19, 226, 216, 251, 66, 18, 19, 
-    226, 216, 193, 18, 19, 226, 216, 230, 25, 18, 19, 226, 216, 222, 91, 18, 
-    19, 226, 216, 220, 104, 18, 19, 245, 219, 212, 98, 18, 19, 212, 7, 212, 
-    98, 18, 19, 40, 4, 222, 233, 18, 19, 40, 223, 157, 247, 120, 18, 19, 223, 
-    223, 222, 106, 18, 19, 159, 232, 127, 18, 19, 159, 233, 134, 18, 19, 216, 
-    126, 18, 19, 216, 128, 18, 19, 215, 136, 18, 19, 215, 138, 18, 19, 215, 
-    143, 18, 19, 216, 49, 18, 19, 216, 51, 18, 19, 221, 209, 219, 206, 18, 
-    19, 221, 209, 220, 1, 18, 19, 221, 209, 241, 53, 18, 19, 72, 242, 73, 18, 
-    19, 72, 248, 52, 243, 55, 18, 19, 72, 243, 132, 18, 19, 72, 242, 78, 18, 
-    19, 221, 209, 235, 33, 18, 19, 72, 235, 31, 18, 19, 252, 68, 248, 52, 
-    156, 18, 19, 252, 68, 248, 52, 153, 18, 19, 72, 248, 47, 222, 91, 232, 
-    223, 213, 122, 233, 10, 232, 223, 1, 176, 232, 223, 1, 234, 132, 232, 
-    223, 1, 243, 135, 232, 223, 1, 242, 249, 232, 223, 1, 229, 77, 232, 223, 
-    1, 251, 33, 232, 223, 1, 250, 157, 232, 223, 1, 235, 141, 232, 223, 1, 
-    235, 114, 232, 223, 1, 211, 71, 232, 223, 1, 217, 105, 232, 223, 1, 216, 
-    208, 232, 223, 1, 248, 221, 232, 223, 1, 248, 25, 232, 223, 1, 197, 232, 
-    223, 1, 190, 232, 223, 1, 225, 147, 232, 223, 1, 252, 191, 232, 223, 1, 
-    252, 18, 232, 223, 1, 184, 232, 223, 1, 191, 232, 223, 1, 205, 232, 223, 
-    1, 233, 135, 232, 223, 1, 212, 65, 232, 223, 1, 220, 102, 232, 223, 1, 
-    218, 223, 232, 223, 1, 206, 232, 223, 1, 162, 232, 223, 25, 5, 61, 232, 
-    223, 25, 5, 73, 232, 223, 25, 5, 70, 232, 223, 25, 5, 245, 209, 232, 223, 
-    25, 5, 254, 201, 232, 223, 25, 5, 226, 183, 232, 223, 25, 5, 253, 192, 
-    232, 223, 25, 5, 75, 232, 223, 25, 5, 76, 232, 223, 218, 73, 1, 191, 232, 
-    223, 218, 73, 1, 205, 232, 223, 218, 73, 1, 212, 65, 232, 223, 4, 1, 176, 
-    232, 223, 4, 1, 229, 77, 232, 223, 4, 1, 254, 75, 232, 223, 4, 1, 217, 
-    105, 232, 223, 4, 1, 197, 232, 223, 4, 1, 190, 232, 223, 4, 1, 184, 232, 
-    223, 4, 1, 205, 232, 223, 4, 1, 233, 135, 232, 223, 5, 230, 89, 232, 223, 
-    5, 234, 171, 232, 223, 5, 222, 32, 232, 223, 5, 232, 127, 232, 223, 245, 
-    31, 78, 232, 223, 224, 13, 78, 232, 223, 21, 210, 86, 232, 223, 21, 110, 
-    232, 223, 21, 105, 232, 223, 21, 158, 232, 223, 21, 161, 232, 223, 21, 
-    189, 232, 223, 21, 194, 232, 223, 21, 198, 232, 223, 21, 195, 232, 223, 
-    21, 200, 39, 233, 59, 1, 176, 39, 233, 59, 1, 211, 165, 39, 233, 59, 1, 
-    229, 77, 39, 233, 59, 1, 215, 183, 39, 233, 59, 1, 206, 39, 233, 59, 1, 
-    191, 39, 233, 59, 1, 217, 105, 39, 233, 59, 1, 216, 208, 39, 233, 59, 1, 
-    233, 135, 39, 233, 59, 1, 190, 39, 233, 59, 1, 225, 147, 39, 233, 59, 1, 
-    184, 39, 233, 59, 1, 244, 196, 39, 233, 59, 1, 214, 27, 39, 233, 59, 1, 
-    162, 39, 233, 59, 1, 224, 88, 39, 233, 59, 1, 234, 132, 39, 233, 59, 1, 
-    215, 175, 39, 233, 59, 1, 197, 39, 233, 59, 1, 61, 39, 233, 59, 1, 73, 
-    39, 233, 59, 1, 245, 209, 39, 233, 59, 1, 245, 197, 39, 233, 59, 1, 70, 
-    39, 233, 59, 1, 226, 183, 39, 233, 59, 1, 76, 39, 233, 59, 1, 214, 214, 
-    39, 233, 59, 1, 75, 39, 233, 59, 1, 253, 190, 39, 233, 59, 1, 254, 201, 
-    39, 233, 59, 1, 216, 28, 39, 233, 59, 1, 216, 27, 39, 233, 59, 1, 216, 
-    26, 39, 233, 59, 1, 216, 25, 39, 233, 59, 1, 216, 24, 166, 39, 173, 1, 
-    125, 224, 88, 166, 39, 173, 1, 121, 224, 88, 166, 39, 173, 1, 125, 176, 
-    166, 39, 173, 1, 125, 211, 165, 166, 39, 173, 1, 125, 229, 77, 166, 39, 
-    173, 1, 121, 176, 166, 39, 173, 1, 121, 211, 165, 166, 39, 173, 1, 121, 
-    229, 77, 166, 39, 173, 1, 125, 215, 183, 166, 39, 173, 1, 125, 206, 166, 
-    39, 173, 1, 125, 191, 166, 39, 173, 1, 121, 215, 183, 166, 39, 173, 1, 
-    121, 206, 166, 39, 173, 1, 121, 191, 166, 39, 173, 1, 125, 217, 105, 166, 
-    39, 173, 1, 125, 216, 208, 166, 39, 173, 1, 125, 197, 166, 39, 173, 1, 
-    121, 217, 105, 166, 39, 173, 1, 121, 216, 208, 166, 39, 173, 1, 121, 197, 
-    166, 39, 173, 1, 125, 190, 166, 39, 173, 1, 125, 225, 147, 166, 39, 173, 
-    1, 125, 184, 166, 39, 173, 1, 121, 190, 166, 39, 173, 1, 121, 225, 147, 
-    166, 39, 173, 1, 121, 184, 166, 39, 173, 1, 125, 244, 196, 166, 39, 173, 
-    1, 125, 214, 27, 166, 39, 173, 1, 125, 233, 135, 166, 39, 173, 1, 121, 
-    244, 196, 166, 39, 173, 1, 121, 214, 27, 166, 39, 173, 1, 121, 233, 135, 
-    166, 39, 173, 1, 125, 162, 166, 39, 173, 1, 125, 248, 221, 166, 39, 173, 
-    1, 125, 252, 191, 166, 39, 173, 1, 121, 162, 166, 39, 173, 1, 121, 248, 
-    221, 166, 39, 173, 1, 121, 252, 191, 166, 39, 173, 1, 125, 233, 184, 166, 
-    39, 173, 1, 125, 211, 138, 166, 39, 173, 1, 121, 233, 184, 166, 39, 173, 
-    1, 121, 211, 138, 166, 39, 173, 1, 125, 218, 82, 166, 39, 173, 1, 121, 
-    218, 82, 166, 39, 173, 25, 5, 25, 219, 239, 166, 39, 173, 25, 5, 255, 73, 
-    166, 39, 173, 25, 5, 236, 33, 166, 39, 173, 25, 5, 70, 166, 39, 173, 25, 
-    5, 214, 118, 166, 39, 173, 25, 5, 75, 166, 39, 173, 25, 5, 254, 243, 166, 
-    39, 173, 25, 5, 76, 166, 39, 173, 25, 5, 227, 0, 166, 39, 173, 25, 5, 
-    214, 214, 166, 39, 173, 25, 5, 253, 167, 166, 39, 173, 25, 5, 255, 28, 
-    166, 39, 173, 25, 5, 214, 111, 166, 39, 173, 25, 5, 226, 109, 166, 39, 
-    173, 25, 5, 226, 253, 166, 39, 173, 25, 5, 214, 210, 166, 39, 173, 25, 5, 
-    235, 152, 166, 39, 173, 1, 40, 214, 105, 166, 39, 173, 1, 40, 229, 79, 
-    166, 39, 173, 1, 40, 230, 25, 166, 39, 173, 1, 40, 193, 166, 39, 173, 1, 
-    40, 235, 23, 166, 39, 173, 1, 40, 249, 60, 166, 39, 173, 1, 40, 253, 158, 
-    166, 39, 173, 138, 231, 158, 166, 39, 173, 138, 231, 157, 166, 39, 173, 
-    21, 210, 86, 166, 39, 173, 21, 110, 166, 39, 173, 21, 105, 166, 39, 173, 
-    21, 158, 166, 39, 173, 21, 161, 166, 39, 173, 21, 189, 166, 39, 173, 21, 
-    194, 166, 39, 173, 21, 198, 166, 39, 173, 21, 195, 166, 39, 173, 21, 200, 
-    166, 39, 173, 89, 21, 110, 166, 39, 173, 5, 233, 120, 166, 39, 173, 5, 
-    233, 119, 69, 16, 225, 236, 69, 16, 230, 72, 234, 25, 69, 16, 225, 72, 
-    234, 25, 69, 16, 252, 50, 234, 25, 69, 16, 251, 104, 234, 25, 69, 16, 
-    224, 216, 234, 25, 69, 16, 224, 210, 234, 25, 69, 16, 224, 208, 234, 25, 
-    69, 16, 224, 214, 234, 25, 69, 16, 224, 212, 234, 25, 69, 16, 248, 173, 
-    234, 25, 69, 16, 248, 169, 234, 25, 69, 16, 248, 168, 234, 25, 69, 16, 
-    248, 171, 234, 25, 69, 16, 248, 170, 234, 25, 69, 16, 248, 167, 234, 25, 
-    69, 16, 215, 87, 69, 16, 230, 72, 222, 205, 69, 16, 225, 72, 222, 205, 
-    69, 16, 252, 50, 222, 205, 69, 16, 251, 104, 222, 205, 69, 16, 224, 216, 
-    222, 205, 69, 16, 224, 210, 222, 205, 69, 16, 224, 208, 222, 205, 69, 16, 
-    224, 214, 222, 205, 69, 16, 224, 212, 222, 205, 69, 16, 248, 173, 222, 
-    205, 69, 16, 248, 169, 222, 205, 69, 16, 248, 168, 222, 205, 69, 16, 248, 
-    171, 222, 205, 69, 16, 248, 170, 222, 205, 69, 16, 248, 167, 222, 205, 
-    251, 121, 1, 176, 251, 121, 1, 243, 135, 251, 121, 1, 229, 77, 251, 121, 
-    1, 229, 22, 251, 121, 1, 190, 251, 121, 1, 252, 191, 251, 121, 1, 184, 
-    251, 121, 1, 230, 105, 251, 121, 1, 217, 105, 251, 121, 1, 248, 221, 251, 
-    121, 1, 197, 251, 121, 1, 228, 36, 251, 121, 1, 251, 33, 251, 121, 1, 
-    235, 141, 251, 121, 1, 227, 165, 251, 121, 1, 227, 158, 251, 121, 1, 191, 
-    251, 121, 1, 205, 251, 121, 1, 233, 135, 251, 121, 1, 214, 27, 251, 121, 
-    1, 206, 251, 121, 1, 61, 251, 121, 1, 162, 251, 121, 25, 5, 73, 251, 121, 
-    25, 5, 70, 251, 121, 25, 5, 75, 251, 121, 25, 5, 76, 251, 121, 25, 5, 
-    254, 243, 251, 121, 226, 60, 251, 121, 245, 143, 64, 221, 172, 39, 89, 1, 
-    125, 176, 39, 89, 1, 125, 234, 132, 39, 89, 1, 125, 233, 171, 39, 89, 1, 
-    121, 176, 39, 89, 1, 121, 233, 171, 39, 89, 1, 121, 234, 132, 39, 89, 1, 
-    229, 77, 39, 89, 1, 125, 251, 33, 39, 89, 1, 125, 250, 157, 39, 89, 1, 
-    121, 251, 33, 39, 89, 1, 121, 206, 39, 89, 1, 121, 250, 157, 39, 89, 1, 
-    227, 165, 39, 89, 1, 223, 140, 39, 89, 1, 125, 223, 138, 39, 89, 1, 248, 
-    221, 39, 89, 1, 121, 223, 138, 39, 89, 1, 223, 149, 39, 89, 1, 125, 217, 
-    105, 39, 89, 1, 125, 216, 208, 39, 89, 1, 121, 217, 105, 39, 89, 1, 121, 
-    216, 208, 39, 89, 1, 197, 39, 89, 1, 252, 191, 39, 89, 1, 125, 190, 39, 
-    89, 1, 125, 225, 147, 39, 89, 1, 125, 244, 196, 39, 89, 1, 121, 190, 39, 
-    89, 1, 121, 244, 196, 39, 89, 1, 121, 225, 147, 39, 89, 1, 184, 39, 89, 
-    1, 121, 191, 39, 89, 1, 125, 191, 39, 89, 1, 205, 39, 89, 1, 222, 137, 
-    39, 89, 1, 233, 135, 39, 89, 1, 232, 93, 39, 89, 1, 212, 65, 39, 89, 1, 
-    125, 220, 102, 39, 89, 1, 125, 218, 223, 39, 89, 1, 125, 206, 39, 89, 1, 
-    125, 162, 39, 89, 1, 232, 184, 39, 89, 1, 61, 39, 89, 1, 121, 162, 39, 
-    89, 1, 73, 39, 89, 1, 236, 33, 39, 89, 1, 70, 39, 89, 1, 214, 118, 39, 
-    89, 1, 245, 209, 39, 89, 1, 226, 183, 39, 89, 1, 233, 120, 39, 89, 1, 
-    242, 132, 206, 39, 89, 116, 5, 147, 205, 39, 89, 116, 5, 147, 233, 135, 
-    39, 89, 116, 5, 233, 136, 217, 58, 233, 109, 39, 89, 5, 231, 204, 234, 
-    231, 233, 109, 39, 89, 116, 5, 40, 229, 77, 39, 89, 116, 5, 121, 190, 39, 
-    89, 116, 5, 125, 223, 139, 177, 121, 190, 39, 89, 116, 5, 184, 39, 89, 
-    116, 5, 252, 191, 39, 89, 116, 5, 206, 39, 89, 5, 222, 10, 39, 89, 25, 5, 
-    61, 39, 89, 25, 5, 231, 204, 221, 226, 39, 89, 25, 5, 255, 73, 39, 89, 
-    25, 5, 217, 64, 255, 73, 39, 89, 25, 5, 73, 39, 89, 25, 5, 236, 33, 39, 
-    89, 25, 5, 214, 214, 39, 89, 25, 5, 214, 117, 39, 89, 25, 5, 70, 39, 89, 
-    25, 5, 214, 118, 39, 89, 25, 5, 76, 39, 89, 25, 5, 227, 1, 51, 39, 89, 
-    25, 5, 226, 109, 39, 89, 25, 5, 75, 39, 89, 25, 5, 254, 243, 39, 89, 25, 
-    5, 226, 183, 39, 89, 25, 5, 254, 201, 39, 89, 25, 5, 89, 254, 201, 39, 
-    89, 25, 5, 227, 1, 48, 39, 89, 5, 231, 204, 234, 230, 39, 89, 5, 216, 29, 
-    39, 89, 5, 216, 28, 39, 89, 5, 234, 97, 216, 27, 39, 89, 5, 234, 97, 216, 
-    26, 39, 89, 5, 234, 97, 216, 25, 39, 89, 5, 223, 188, 242, 45, 39, 89, 5, 
-    231, 204, 221, 253, 39, 89, 5, 234, 96, 234, 215, 39, 89, 38, 249, 115, 
-    247, 120, 39, 89, 241, 46, 21, 210, 86, 39, 89, 241, 46, 21, 110, 39, 89, 
-    241, 46, 21, 105, 39, 89, 241, 46, 21, 158, 39, 89, 241, 46, 21, 161, 39, 
-    89, 241, 46, 21, 189, 39, 89, 241, 46, 21, 194, 39, 89, 241, 46, 21, 198, 
-    39, 89, 241, 46, 21, 195, 39, 89, 241, 46, 21, 200, 39, 89, 89, 21, 210, 
-    86, 39, 89, 89, 21, 110, 39, 89, 89, 21, 105, 39, 89, 89, 21, 158, 39, 
-    89, 89, 21, 161, 39, 89, 89, 21, 189, 39, 89, 89, 21, 194, 39, 89, 89, 
-    21, 198, 39, 89, 89, 21, 195, 39, 89, 89, 21, 200, 39, 89, 5, 211, 249, 
-    39, 89, 5, 211, 248, 39, 89, 5, 221, 215, 39, 89, 5, 234, 160, 39, 89, 5, 
-    240, 232, 39, 89, 5, 247, 134, 39, 89, 5, 223, 49, 222, 187, 223, 149, 
-    39, 89, 5, 231, 204, 211, 72, 39, 89, 5, 235, 6, 39, 89, 5, 235, 5, 39, 
-    89, 5, 221, 222, 39, 89, 5, 221, 221, 39, 89, 5, 242, 9, 39, 89, 5, 251, 
-    30, 102, 5, 214, 200, 223, 30, 102, 5, 214, 200, 251, 1, 102, 5, 250, 
-    186, 102, 5, 218, 15, 102, 5, 251, 233, 102, 1, 254, 184, 102, 1, 254, 
-    185, 217, 13, 102, 1, 236, 29, 102, 1, 236, 30, 217, 13, 102, 1, 214, 
-    203, 102, 1, 214, 204, 217, 13, 102, 1, 223, 188, 223, 79, 102, 1, 223, 
-    188, 223, 80, 217, 13, 102, 1, 233, 136, 233, 24, 102, 1, 233, 136, 233, 
-    25, 217, 13, 102, 1, 245, 179, 102, 1, 254, 199, 102, 1, 226, 212, 102, 
-    1, 226, 213, 217, 13, 102, 1, 176, 102, 1, 235, 13, 231, 207, 102, 1, 
-    243, 135, 102, 1, 243, 136, 242, 161, 102, 1, 229, 77, 102, 1, 251, 33, 
-    102, 1, 251, 34, 233, 123, 102, 1, 235, 141, 102, 1, 235, 142, 235, 118, 
-    102, 1, 227, 165, 102, 1, 217, 106, 233, 76, 102, 1, 217, 106, 230, 67, 
-    231, 207, 102, 1, 248, 222, 230, 67, 254, 145, 102, 1, 248, 222, 230, 67, 
-    231, 207, 102, 1, 229, 229, 223, 152, 102, 1, 217, 105, 102, 1, 217, 106, 
-    217, 35, 102, 1, 248, 221, 102, 1, 248, 222, 231, 225, 102, 1, 197, 102, 
-    1, 190, 102, 1, 226, 90, 234, 226, 102, 1, 252, 191, 102, 1, 252, 192, 
-    234, 172, 102, 1, 184, 102, 1, 191, 102, 1, 205, 102, 1, 233, 135, 102, 
-    1, 212, 65, 102, 1, 222, 34, 222, 20, 102, 1, 222, 34, 221, 233, 102, 1, 
-    206, 102, 1, 162, 102, 5, 223, 70, 102, 25, 5, 217, 13, 102, 25, 5, 214, 
-    199, 102, 25, 5, 214, 200, 221, 229, 102, 25, 5, 218, 47, 102, 25, 5, 
-    218, 48, 236, 21, 102, 25, 5, 223, 188, 223, 79, 102, 25, 5, 223, 188, 
-    223, 80, 217, 13, 102, 25, 5, 233, 136, 233, 24, 102, 25, 5, 233, 136, 
-    233, 25, 217, 13, 102, 25, 5, 217, 65, 102, 25, 5, 217, 66, 223, 79, 102, 
-    25, 5, 217, 66, 217, 13, 102, 25, 5, 217, 66, 223, 80, 217, 13, 102, 25, 
-    5, 225, 184, 102, 25, 5, 225, 185, 217, 13, 102, 254, 250, 254, 249, 102, 
-    1, 234, 251, 221, 228, 102, 1, 234, 102, 221, 228, 102, 1, 215, 34, 221, 
-    228, 102, 1, 245, 203, 221, 228, 102, 1, 214, 0, 221, 228, 102, 1, 210, 
-    107, 221, 228, 102, 1, 253, 209, 221, 228, 102, 21, 210, 86, 102, 21, 
-    110, 102, 21, 105, 102, 21, 158, 102, 21, 161, 102, 21, 189, 102, 21, 
-    194, 102, 21, 198, 102, 21, 195, 102, 21, 200, 102, 226, 29, 102, 226, 
-    55, 102, 211, 238, 102, 250, 236, 226, 48, 102, 250, 236, 219, 172, 102, 
-    250, 236, 226, 2, 102, 226, 54, 102, 28, 16, 247, 126, 102, 28, 16, 248, 
-    51, 102, 28, 16, 246, 64, 102, 28, 16, 248, 176, 102, 28, 16, 248, 177, 
-    218, 15, 102, 28, 16, 247, 205, 102, 28, 16, 248, 214, 102, 28, 16, 248, 
-    33, 102, 28, 16, 248, 198, 102, 28, 16, 248, 177, 243, 57, 102, 28, 16, 
-    38, 217, 9, 102, 28, 16, 38, 245, 141, 102, 28, 16, 38, 234, 167, 102, 
-    28, 16, 38, 234, 169, 102, 28, 16, 38, 235, 122, 102, 28, 16, 38, 234, 
-    168, 2, 235, 122, 102, 28, 16, 38, 234, 170, 2, 235, 122, 102, 28, 16, 
-    38, 252, 37, 102, 28, 16, 38, 242, 165, 102, 28, 16, 222, 249, 204, 246, 
-    74, 102, 28, 16, 222, 249, 204, 248, 212, 102, 28, 16, 222, 249, 250, 0, 
-    215, 111, 102, 28, 16, 222, 249, 250, 0, 217, 73, 102, 28, 16, 233, 44, 
-    204, 226, 43, 102, 28, 16, 233, 44, 204, 224, 139, 102, 28, 16, 233, 44, 
-    250, 0, 225, 38, 102, 28, 16, 233, 44, 250, 0, 225, 26, 102, 28, 16, 233, 
-    44, 204, 225, 61, 207, 5, 226, 26, 207, 5, 226, 39, 207, 5, 226, 35, 207, 
-    1, 61, 207, 1, 73, 207, 1, 70, 207, 1, 254, 243, 207, 1, 76, 207, 1, 75, 
-    207, 1, 245, 55, 207, 1, 176, 207, 1, 224, 88, 207, 1, 243, 135, 207, 1, 
-    229, 77, 207, 1, 251, 33, 207, 1, 235, 141, 207, 1, 210, 116, 207, 1, 
-    227, 165, 207, 1, 217, 105, 207, 1, 248, 221, 207, 1, 197, 207, 1, 190, 
-    207, 1, 244, 196, 207, 1, 214, 27, 207, 1, 252, 191, 207, 1, 184, 207, 1, 
-    191, 207, 1, 205, 207, 1, 233, 135, 207, 1, 212, 65, 207, 1, 206, 207, 1, 
-    211, 165, 207, 1, 162, 207, 116, 5, 226, 52, 207, 116, 5, 226, 28, 207, 
-    116, 5, 226, 25, 207, 25, 5, 226, 42, 207, 25, 5, 226, 24, 207, 25, 5, 
-    226, 46, 207, 25, 5, 226, 34, 207, 25, 5, 226, 53, 207, 25, 5, 226, 44, 
-    207, 5, 226, 56, 207, 5, 213, 152, 207, 116, 5, 225, 248, 184, 207, 116, 
-    5, 225, 248, 212, 65, 207, 1, 234, 132, 207, 1, 217, 231, 207, 21, 210, 
-    86, 207, 21, 110, 207, 21, 105, 207, 21, 158, 207, 21, 161, 207, 21, 189, 
-    207, 21, 194, 207, 21, 198, 207, 21, 195, 207, 21, 200, 207, 253, 175, 
-    207, 1, 223, 52, 207, 1, 233, 7, 207, 1, 252, 18, 207, 1, 40, 235, 23, 
-    207, 1, 40, 193, 252, 120, 1, 61, 252, 120, 1, 219, 164, 61, 252, 120, 1, 
-    162, 252, 120, 1, 219, 164, 162, 252, 120, 1, 231, 181, 162, 252, 120, 1, 
-    252, 191, 252, 120, 1, 234, 212, 252, 191, 252, 120, 1, 190, 252, 120, 1, 
-    219, 164, 190, 252, 120, 1, 197, 252, 120, 1, 231, 181, 197, 252, 120, 1, 
-    212, 65, 252, 120, 1, 219, 164, 212, 65, 252, 120, 1, 226, 67, 212, 65, 
-    252, 120, 1, 243, 135, 252, 120, 1, 219, 164, 243, 135, 252, 120, 1, 235, 
-    141, 252, 120, 1, 248, 221, 252, 120, 1, 205, 252, 120, 1, 219, 164, 205, 
-    252, 120, 1, 184, 252, 120, 1, 219, 164, 184, 252, 120, 1, 219, 26, 217, 
-    105, 252, 120, 1, 228, 55, 217, 105, 252, 120, 1, 206, 252, 120, 1, 219, 
-    164, 206, 252, 120, 1, 231, 181, 206, 252, 120, 1, 191, 252, 120, 1, 219, 
-    164, 191, 252, 120, 1, 229, 77, 252, 120, 1, 233, 135, 252, 120, 1, 219, 
-    164, 233, 135, 252, 120, 1, 227, 165, 252, 120, 1, 251, 33, 252, 120, 1, 
-    229, 148, 252, 120, 1, 231, 124, 252, 120, 1, 73, 252, 120, 1, 70, 252, 
-    120, 5, 216, 33, 252, 120, 25, 5, 75, 252, 120, 25, 5, 226, 67, 75, 252, 
-    120, 25, 5, 245, 209, 252, 120, 25, 5, 73, 252, 120, 25, 5, 234, 212, 73, 
-    252, 120, 25, 5, 76, 252, 120, 25, 5, 234, 212, 76, 252, 120, 25, 5, 70, 
-    252, 120, 25, 5, 104, 31, 219, 164, 206, 252, 120, 116, 5, 229, 79, 252, 
-    120, 116, 5, 242, 60, 252, 120, 226, 37, 252, 120, 226, 33, 252, 120, 16, 
-    251, 241, 229, 229, 231, 37, 252, 120, 16, 251, 241, 225, 64, 252, 120, 
-    16, 251, 241, 235, 48, 252, 120, 16, 251, 241, 226, 37, 196, 1, 176, 196, 
-    1, 234, 39, 196, 1, 234, 132, 196, 1, 243, 135, 196, 1, 242, 186, 196, 1, 
-    229, 77, 196, 1, 251, 33, 196, 1, 250, 157, 196, 1, 235, 141, 196, 1, 
-    227, 165, 196, 1, 217, 105, 196, 1, 216, 208, 196, 1, 248, 221, 196, 1, 
-    197, 196, 1, 190, 196, 1, 225, 42, 196, 1, 225, 147, 196, 1, 244, 196, 
-    196, 1, 244, 75, 196, 1, 252, 191, 196, 1, 251, 222, 196, 1, 184, 196, 1, 
-    230, 168, 196, 1, 215, 183, 196, 1, 215, 175, 196, 1, 246, 38, 196, 1, 
-    191, 196, 1, 205, 196, 1, 233, 135, 196, 1, 162, 196, 1, 241, 153, 196, 
-    1, 214, 27, 196, 1, 206, 196, 1, 220, 102, 196, 1, 212, 65, 196, 1, 61, 
-    196, 218, 73, 1, 191, 196, 218, 73, 1, 205, 196, 25, 5, 255, 73, 196, 25, 
-    5, 73, 196, 25, 5, 76, 196, 25, 5, 226, 183, 196, 25, 5, 70, 196, 25, 5, 
-    214, 118, 196, 25, 5, 75, 196, 116, 5, 235, 23, 196, 116, 5, 193, 196, 
-    116, 5, 156, 196, 116, 5, 230, 25, 196, 116, 5, 226, 105, 196, 116, 5, 
-    153, 196, 116, 5, 217, 152, 196, 116, 5, 227, 142, 196, 116, 5, 234, 230, 
-    196, 5, 223, 150, 196, 5, 227, 205, 196, 224, 141, 217, 103, 196, 224, 
-    141, 227, 152, 216, 120, 217, 103, 196, 224, 141, 250, 164, 196, 224, 
-    141, 215, 170, 250, 164, 196, 224, 141, 215, 169, 196, 21, 210, 86, 196, 
-    21, 110, 196, 21, 105, 196, 21, 158, 196, 21, 161, 196, 21, 189, 196, 21, 
-    194, 196, 21, 198, 196, 21, 195, 196, 21, 200, 196, 1, 215, 156, 196, 1, 
-    215, 144, 196, 1, 248, 135, 226, 210, 250, 103, 21, 210, 86, 226, 210, 
-    250, 103, 21, 110, 226, 210, 250, 103, 21, 105, 226, 210, 250, 103, 21, 
-    158, 226, 210, 250, 103, 21, 161, 226, 210, 250, 103, 21, 189, 226, 210, 
-    250, 103, 21, 194, 226, 210, 250, 103, 21, 198, 226, 210, 250, 103, 21, 
-    195, 226, 210, 250, 103, 21, 200, 226, 210, 250, 103, 1, 233, 135, 226, 
-    210, 250, 103, 1, 253, 206, 226, 210, 250, 103, 1, 254, 216, 226, 210, 
-    250, 103, 1, 254, 115, 226, 210, 250, 103, 1, 254, 178, 226, 210, 250, 
-    103, 1, 233, 134, 226, 210, 250, 103, 1, 255, 35, 226, 210, 250, 103, 1, 
-    255, 36, 226, 210, 250, 103, 1, 255, 34, 226, 210, 250, 103, 1, 255, 29, 
-    226, 210, 250, 103, 1, 232, 241, 226, 210, 250, 103, 1, 235, 171, 226, 
-    210, 250, 103, 1, 236, 34, 226, 210, 250, 103, 1, 235, 190, 226, 210, 
-    250, 103, 1, 235, 179, 226, 210, 250, 103, 1, 232, 98, 226, 210, 250, 
-    103, 1, 214, 221, 226, 210, 250, 103, 1, 214, 219, 226, 210, 250, 103, 1, 
-    214, 168, 226, 210, 250, 103, 1, 214, 111, 226, 210, 250, 103, 1, 233, 
-    58, 226, 210, 250, 103, 1, 245, 108, 226, 210, 250, 103, 1, 245, 212, 
-    226, 210, 250, 103, 1, 245, 150, 226, 210, 250, 103, 1, 245, 86, 226, 
-    210, 250, 103, 1, 232, 156, 226, 210, 250, 103, 1, 226, 137, 226, 210, 
-    250, 103, 1, 226, 252, 226, 210, 250, 103, 1, 226, 125, 226, 210, 250, 
-    103, 1, 226, 222, 226, 210, 250, 103, 230, 103, 215, 121, 226, 210, 250, 
-    103, 243, 130, 215, 122, 226, 210, 250, 103, 230, 101, 215, 122, 226, 
-    210, 250, 103, 223, 92, 226, 210, 250, 103, 225, 145, 226, 210, 250, 103, 
-    254, 208, 226, 210, 250, 103, 224, 141, 230, 98, 226, 210, 250, 103, 224, 
-    141, 52, 230, 98, 207, 224, 141, 251, 241, 218, 8, 207, 224, 141, 251, 
-    241, 226, 38, 207, 224, 141, 251, 241, 224, 129, 207, 224, 141, 251, 241, 
-    251, 19, 207, 224, 141, 251, 241, 233, 8, 221, 225, 207, 224, 141, 251, 
-    241, 235, 13, 221, 225, 207, 224, 141, 251, 241, 248, 222, 221, 225, 207, 
-    224, 141, 251, 241, 252, 192, 221, 225, 213, 252, 138, 234, 210, 213, 
-    252, 138, 220, 77, 213, 252, 138, 224, 198, 213, 252, 5, 228, 209, 213, 
-    252, 5, 211, 80, 230, 222, 218, 0, 213, 252, 138, 211, 80, 254, 213, 235, 
-    243, 218, 0, 213, 252, 138, 211, 80, 235, 243, 218, 0, 213, 252, 138, 
-    211, 80, 234, 198, 235, 243, 218, 0, 213, 252, 138, 251, 2, 51, 213, 252, 
-    138, 211, 80, 234, 198, 235, 243, 218, 1, 221, 197, 213, 252, 138, 52, 
-    218, 0, 213, 252, 138, 215, 211, 218, 0, 213, 252, 138, 234, 198, 254, 
-    77, 213, 252, 138, 59, 51, 213, 252, 138, 113, 170, 51, 213, 252, 138, 
-    134, 170, 51, 213, 252, 138, 222, 240, 234, 209, 235, 243, 218, 0, 213, 
-    252, 138, 253, 204, 235, 243, 218, 0, 213, 252, 5, 213, 148, 218, 0, 213, 
-    252, 5, 213, 148, 214, 216, 213, 252, 5, 223, 49, 213, 148, 214, 216, 
-    213, 252, 5, 213, 148, 254, 77, 213, 252, 5, 223, 49, 213, 148, 254, 77, 
-    213, 252, 5, 213, 148, 214, 217, 2, 217, 77, 213, 252, 5, 213, 148, 254, 
-    78, 2, 217, 77, 213, 252, 5, 254, 76, 254, 91, 213, 252, 5, 254, 76, 252, 
-    166, 213, 252, 5, 254, 76, 214, 20, 213, 252, 5, 254, 76, 214, 21, 2, 
-    217, 77, 213, 252, 5, 216, 68, 213, 252, 5, 241, 191, 199, 254, 75, 213, 
-    252, 5, 199, 254, 75, 213, 252, 5, 222, 142, 199, 254, 75, 213, 252, 5, 
-    254, 76, 214, 223, 230, 90, 213, 252, 5, 254, 20, 213, 252, 5, 222, 187, 
-    254, 20, 213, 252, 138, 251, 2, 48, 213, 252, 5, 235, 102, 213, 252, 5, 
-    214, 161, 7, 1, 4, 6, 61, 7, 1, 4, 6, 254, 243, 7, 4, 1, 215, 94, 254, 
-    243, 7, 1, 4, 6, 252, 134, 253, 158, 7, 1, 4, 6, 251, 66, 7, 1, 4, 6, 
-    249, 60, 7, 1, 4, 6, 245, 59, 7, 1, 4, 6, 75, 7, 4, 1, 215, 94, 204, 75, 
-    7, 4, 1, 215, 94, 73, 7, 1, 4, 6, 235, 144, 7, 1, 4, 6, 235, 23, 7, 1, 4, 
-    6, 233, 149, 2, 91, 7, 1, 4, 6, 193, 7, 1, 4, 6, 223, 49, 230, 25, 7, 1, 
-    4, 6, 76, 7, 1, 4, 6, 204, 76, 7, 4, 1, 219, 187, 76, 7, 4, 1, 219, 187, 
-    204, 76, 7, 4, 1, 219, 187, 144, 2, 91, 7, 4, 1, 215, 94, 226, 234, 7, 1, 
-    4, 6, 226, 134, 7, 4, 1, 216, 14, 163, 76, 7, 4, 1, 251, 175, 163, 76, 7, 
-    1, 4, 6, 226, 105, 7, 1, 4, 6, 223, 49, 153, 7, 1, 4, 6, 215, 94, 153, 7, 
-    1, 4, 6, 217, 152, 7, 1, 4, 6, 70, 7, 4, 1, 219, 187, 70, 7, 4, 1, 219, 
-    187, 248, 0, 70, 7, 4, 1, 219, 187, 215, 94, 193, 7, 1, 4, 6, 214, 105, 
-    7, 1, 4, 6, 212, 98, 7, 1, 4, 6, 210, 159, 7, 1, 4, 6, 245, 8, 7, 1, 213, 
-    135, 233, 82, 218, 250, 7, 1, 254, 196, 26, 1, 4, 6, 243, 107, 26, 1, 4, 
-    6, 233, 98, 26, 1, 4, 6, 225, 108, 26, 1, 4, 6, 223, 37, 26, 1, 4, 6, 
-    224, 161, 33, 1, 4, 6, 245, 174, 58, 1, 6, 61, 58, 1, 6, 254, 243, 58, 1, 
-    6, 253, 158, 58, 1, 6, 252, 134, 253, 158, 58, 1, 6, 249, 60, 58, 1, 6, 
-    75, 58, 1, 6, 223, 49, 75, 58, 1, 6, 243, 202, 58, 1, 6, 242, 60, 58, 1, 
-    6, 73, 58, 1, 6, 235, 144, 58, 1, 6, 235, 23, 58, 1, 6, 156, 58, 1, 6, 
-    193, 58, 1, 6, 230, 25, 58, 1, 6, 223, 49, 230, 25, 58, 1, 6, 76, 58, 1, 
-    6, 226, 134, 58, 1, 6, 226, 105, 58, 1, 6, 153, 58, 1, 6, 217, 152, 58, 
-    1, 6, 70, 58, 1, 6, 212, 98, 58, 1, 4, 61, 58, 1, 4, 215, 94, 61, 58, 1, 
-    4, 254, 143, 58, 1, 4, 215, 94, 254, 243, 58, 1, 4, 253, 158, 58, 1, 4, 
-    249, 60, 58, 1, 4, 75, 58, 1, 4, 221, 195, 58, 1, 4, 204, 75, 58, 1, 4, 
-    215, 94, 204, 75, 58, 1, 4, 243, 202, 58, 1, 4, 215, 94, 73, 58, 1, 4, 
-    235, 23, 58, 1, 4, 193, 58, 1, 4, 245, 138, 58, 1, 4, 76, 58, 1, 4, 204, 
-    76, 58, 1, 4, 216, 14, 163, 76, 58, 1, 4, 251, 175, 163, 76, 58, 1, 4, 
-    226, 105, 58, 1, 4, 217, 152, 58, 1, 4, 70, 58, 1, 4, 219, 187, 70, 58, 
-    1, 4, 215, 94, 193, 58, 1, 4, 214, 105, 58, 1, 4, 254, 196, 58, 1, 4, 
-    252, 26, 58, 1, 4, 26, 243, 107, 58, 1, 4, 248, 54, 58, 1, 4, 26, 225, 
-    133, 58, 1, 4, 250, 110, 7, 218, 65, 4, 1, 73, 7, 218, 65, 4, 1, 153, 7, 
-    218, 65, 4, 1, 70, 7, 218, 65, 4, 1, 214, 105, 26, 218, 65, 4, 1, 252, 
-    26, 26, 218, 65, 4, 1, 243, 107, 26, 218, 65, 4, 1, 223, 37, 26, 218, 65, 
-    4, 1, 225, 133, 26, 218, 65, 4, 1, 250, 110, 7, 4, 1, 214, 214, 7, 4, 1, 
-    57, 2, 230, 224, 182, 7, 4, 1, 249, 61, 2, 230, 224, 182, 7, 4, 1, 245, 
-    7, 2, 230, 224, 182, 7, 4, 1, 232, 50, 2, 230, 224, 182, 7, 4, 1, 230, 
-    26, 2, 230, 224, 182, 7, 4, 1, 226, 106, 2, 230, 224, 182, 7, 4, 1, 223, 
-    224, 2, 230, 224, 182, 7, 4, 1, 223, 224, 2, 244, 88, 22, 230, 224, 182, 
-    7, 4, 1, 222, 92, 2, 230, 224, 182, 7, 4, 1, 217, 153, 2, 230, 224, 182, 
-    7, 4, 1, 210, 160, 2, 230, 224, 182, 7, 4, 1, 215, 94, 243, 202, 58, 1, 
-    33, 245, 150, 7, 4, 1, 235, 213, 243, 202, 7, 4, 1, 216, 211, 2, 218, 
-    107, 7, 4, 6, 1, 240, 154, 2, 91, 7, 4, 1, 235, 186, 2, 91, 7, 4, 1, 226, 
-    106, 2, 91, 7, 4, 6, 1, 104, 2, 91, 7, 4, 1, 214, 158, 2, 91, 7, 4, 1, 
-    57, 2, 226, 66, 103, 7, 4, 1, 249, 61, 2, 226, 66, 103, 7, 4, 1, 245, 7, 
-    2, 226, 66, 103, 7, 4, 1, 243, 203, 2, 226, 66, 103, 7, 4, 1, 235, 24, 2, 
-    226, 66, 103, 7, 4, 1, 233, 149, 2, 226, 66, 103, 7, 4, 1, 232, 50, 2, 
-    226, 66, 103, 7, 4, 1, 230, 26, 2, 226, 66, 103, 7, 4, 1, 226, 106, 2, 
-    226, 66, 103, 7, 4, 1, 223, 224, 2, 226, 66, 103, 7, 4, 1, 222, 92, 2, 
-    226, 66, 103, 7, 4, 1, 245, 76, 2, 226, 66, 103, 7, 4, 1, 214, 106, 2, 
-    226, 66, 103, 7, 4, 1, 211, 179, 2, 226, 66, 103, 7, 4, 1, 210, 160, 2, 
-    226, 66, 103, 7, 4, 1, 115, 2, 223, 55, 103, 7, 4, 1, 254, 144, 2, 223, 
-    55, 103, 7, 4, 1, 249, 61, 2, 241, 52, 22, 217, 77, 7, 4, 1, 160, 2, 223, 
-    55, 103, 7, 4, 1, 204, 160, 2, 223, 55, 103, 7, 4, 1, 223, 49, 204, 160, 
-    2, 223, 55, 103, 7, 4, 1, 221, 196, 2, 223, 55, 103, 7, 4, 1, 240, 154, 
-    2, 223, 55, 103, 7, 4, 1, 204, 144, 2, 223, 55, 103, 7, 4, 1, 245, 76, 2, 
-    223, 55, 103, 7, 4, 1, 104, 2, 223, 55, 103, 7, 4, 1, 245, 9, 2, 223, 55, 
-    103, 58, 1, 4, 215, 94, 254, 143, 58, 1, 4, 251, 66, 58, 1, 4, 251, 67, 
-    2, 249, 100, 58, 1, 4, 245, 59, 58, 1, 4, 223, 49, 204, 75, 58, 1, 4, 
-    245, 6, 58, 1, 4, 247, 119, 235, 145, 2, 91, 58, 1, 4, 119, 243, 202, 58, 
-    1, 4, 215, 94, 242, 60, 58, 1, 4, 240, 154, 2, 91, 58, 1, 4, 235, 185, 
-    58, 1, 4, 6, 73, 58, 1, 4, 6, 240, 154, 2, 91, 58, 1, 4, 235, 145, 2, 
-    249, 127, 58, 1, 4, 233, 149, 2, 223, 55, 103, 58, 1, 4, 233, 149, 2, 
-    226, 66, 103, 58, 1, 4, 6, 156, 58, 1, 4, 232, 50, 2, 103, 58, 1, 4, 215, 
-    94, 232, 50, 2, 199, 233, 36, 58, 1, 4, 230, 26, 2, 43, 103, 58, 1, 4, 
-    230, 26, 2, 223, 55, 103, 58, 1, 4, 6, 230, 25, 58, 1, 4, 252, 134, 76, 
-    58, 1, 4, 225, 133, 58, 1, 4, 222, 92, 2, 103, 58, 1, 4, 245, 75, 58, 1, 
-    4, 217, 153, 2, 226, 66, 103, 58, 1, 4, 104, 130, 58, 1, 4, 214, 157, 58, 
-    1, 4, 6, 70, 58, 1, 4, 214, 106, 2, 103, 58, 1, 4, 215, 94, 214, 105, 58, 
-    1, 4, 210, 159, 58, 1, 4, 210, 160, 2, 223, 55, 103, 58, 1, 4, 210, 160, 
-    2, 249, 100, 58, 1, 4, 245, 8, 58, 1, 4, 216, 179, 38, 246, 118, 242, 
-    137, 255, 14, 38, 246, 118, 255, 3, 255, 14, 38, 219, 69, 51, 38, 218, 6, 
-    78, 38, 231, 231, 38, 242, 134, 38, 231, 229, 38, 255, 1, 38, 242, 135, 
-    38, 255, 2, 38, 7, 4, 1, 223, 224, 51, 38, 251, 145, 38, 231, 230, 38, 
-    52, 250, 31, 48, 38, 226, 225, 48, 38, 210, 35, 51, 38, 235, 172, 51, 38, 
-    214, 151, 48, 38, 214, 134, 48, 38, 7, 4, 1, 244, 63, 204, 115, 48, 38, 
-    7, 4, 1, 254, 243, 38, 7, 4, 1, 254, 73, 38, 7, 4, 1, 253, 176, 38, 7, 4, 
-    1, 251, 67, 250, 183, 38, 7, 4, 1, 235, 213, 249, 60, 38, 7, 4, 1, 245, 
-    59, 38, 7, 4, 1, 243, 202, 38, 7, 1, 4, 6, 243, 202, 38, 7, 4, 1, 235, 
-    23, 38, 7, 4, 1, 156, 38, 7, 1, 4, 6, 156, 38, 7, 1, 4, 6, 193, 38, 7, 4, 
-    1, 230, 25, 38, 7, 1, 4, 6, 230, 25, 38, 7, 1, 4, 6, 153, 38, 7, 4, 1, 
-    223, 224, 222, 186, 38, 7, 4, 1, 222, 91, 38, 7, 4, 1, 199, 222, 91, 38, 
-    7, 4, 1, 210, 159, 38, 52, 235, 193, 251, 147, 51, 38, 254, 148, 128, 
-    216, 42, 51, 38, 43, 253, 250, 48, 38, 44, 253, 250, 22, 124, 253, 250, 
-    51, 7, 6, 1, 115, 2, 222, 234, 51, 7, 4, 1, 115, 2, 222, 234, 51, 7, 6, 
-    1, 57, 2, 59, 48, 7, 4, 1, 57, 2, 59, 48, 7, 6, 1, 57, 2, 59, 51, 7, 4, 
-    1, 57, 2, 59, 51, 7, 6, 1, 57, 2, 232, 214, 51, 7, 4, 1, 57, 2, 232, 214, 
-    51, 7, 6, 1, 251, 67, 2, 250, 184, 22, 142, 7, 4, 1, 251, 67, 2, 250, 
-    184, 22, 142, 7, 6, 1, 249, 61, 2, 59, 48, 7, 4, 1, 249, 61, 2, 59, 48, 
-    7, 6, 1, 249, 61, 2, 59, 51, 7, 4, 1, 249, 61, 2, 59, 51, 7, 6, 1, 249, 
-    61, 2, 232, 214, 51, 7, 4, 1, 249, 61, 2, 232, 214, 51, 7, 6, 1, 249, 61, 
-    2, 250, 183, 7, 4, 1, 249, 61, 2, 250, 183, 7, 6, 1, 249, 61, 2, 250, 31, 
-    51, 7, 4, 1, 249, 61, 2, 250, 31, 51, 7, 6, 1, 160, 2, 231, 233, 22, 242, 
-    136, 7, 4, 1, 160, 2, 231, 233, 22, 242, 136, 7, 6, 1, 160, 2, 231, 233, 
-    22, 142, 7, 4, 1, 160, 2, 231, 233, 22, 142, 7, 6, 1, 160, 2, 250, 31, 
-    51, 7, 4, 1, 160, 2, 250, 31, 51, 7, 6, 1, 160, 2, 216, 89, 51, 7, 4, 1, 
-    160, 2, 216, 89, 51, 7, 6, 1, 160, 2, 250, 184, 22, 251, 146, 7, 4, 1, 
-    160, 2, 250, 184, 22, 251, 146, 7, 6, 1, 245, 7, 2, 59, 48, 7, 4, 1, 245, 
-    7, 2, 59, 48, 7, 6, 1, 243, 203, 2, 231, 232, 7, 4, 1, 243, 203, 2, 231, 
-    232, 7, 6, 1, 242, 61, 2, 59, 48, 7, 4, 1, 242, 61, 2, 59, 48, 7, 6, 1, 
-    242, 61, 2, 59, 51, 7, 4, 1, 242, 61, 2, 59, 51, 7, 6, 1, 242, 61, 2, 
-    248, 1, 7, 4, 1, 242, 61, 2, 248, 1, 7, 6, 1, 242, 61, 2, 250, 183, 7, 4, 
-    1, 242, 61, 2, 250, 183, 7, 6, 1, 242, 61, 2, 251, 147, 51, 7, 4, 1, 242, 
-    61, 2, 251, 147, 51, 7, 6, 1, 240, 154, 2, 216, 89, 51, 7, 4, 1, 240, 
-    154, 2, 216, 89, 51, 7, 6, 1, 240, 154, 2, 248, 2, 22, 142, 7, 4, 1, 240, 
-    154, 2, 248, 2, 22, 142, 7, 6, 1, 235, 24, 2, 142, 7, 4, 1, 235, 24, 2, 
-    142, 7, 6, 1, 235, 24, 2, 59, 51, 7, 4, 1, 235, 24, 2, 59, 51, 7, 6, 1, 
-    235, 24, 2, 232, 214, 51, 7, 4, 1, 235, 24, 2, 232, 214, 51, 7, 6, 1, 
-    233, 149, 2, 59, 51, 7, 4, 1, 233, 149, 2, 59, 51, 7, 6, 1, 233, 149, 2, 
-    59, 252, 43, 22, 231, 232, 7, 4, 1, 233, 149, 2, 59, 252, 43, 22, 231, 
-    232, 7, 6, 1, 233, 149, 2, 232, 214, 51, 7, 4, 1, 233, 149, 2, 232, 214, 
-    51, 7, 6, 1, 233, 149, 2, 250, 31, 51, 7, 4, 1, 233, 149, 2, 250, 31, 51, 
-    7, 6, 1, 232, 50, 2, 142, 7, 4, 1, 232, 50, 2, 142, 7, 6, 1, 232, 50, 2, 
-    59, 48, 7, 4, 1, 232, 50, 2, 59, 48, 7, 6, 1, 232, 50, 2, 59, 51, 7, 4, 
-    1, 232, 50, 2, 59, 51, 7, 6, 1, 230, 26, 2, 59, 48, 7, 4, 1, 230, 26, 2, 
-    59, 48, 7, 6, 1, 230, 26, 2, 59, 51, 7, 4, 1, 230, 26, 2, 59, 51, 7, 6, 
-    1, 230, 26, 2, 232, 214, 51, 7, 4, 1, 230, 26, 2, 232, 214, 51, 7, 6, 1, 
-    230, 26, 2, 250, 31, 51, 7, 4, 1, 230, 26, 2, 250, 31, 51, 7, 6, 1, 144, 
-    2, 216, 89, 22, 142, 7, 4, 1, 144, 2, 216, 89, 22, 142, 7, 6, 1, 144, 2, 
-    216, 89, 22, 248, 1, 7, 4, 1, 144, 2, 216, 89, 22, 248, 1, 7, 6, 1, 144, 
-    2, 231, 233, 22, 242, 136, 7, 4, 1, 144, 2, 231, 233, 22, 242, 136, 7, 6, 
-    1, 144, 2, 231, 233, 22, 142, 7, 4, 1, 144, 2, 231, 233, 22, 142, 7, 6, 
-    1, 226, 106, 2, 142, 7, 4, 1, 226, 106, 2, 142, 7, 6, 1, 226, 106, 2, 59, 
-    48, 7, 4, 1, 226, 106, 2, 59, 48, 7, 6, 1, 223, 224, 2, 59, 48, 7, 4, 1, 
-    223, 224, 2, 59, 48, 7, 6, 1, 223, 224, 2, 59, 51, 7, 4, 1, 223, 224, 2, 
-    59, 51, 7, 6, 1, 223, 224, 2, 59, 252, 43, 22, 231, 232, 7, 4, 1, 223, 
-    224, 2, 59, 252, 43, 22, 231, 232, 7, 6, 1, 223, 224, 2, 232, 214, 51, 7, 
-    4, 1, 223, 224, 2, 232, 214, 51, 7, 6, 1, 222, 92, 2, 59, 48, 7, 4, 1, 
-    222, 92, 2, 59, 48, 7, 6, 1, 222, 92, 2, 59, 51, 7, 4, 1, 222, 92, 2, 59, 
-    51, 7, 6, 1, 222, 92, 2, 255, 3, 22, 59, 48, 7, 4, 1, 222, 92, 2, 255, 3, 
-    22, 59, 48, 7, 6, 1, 222, 92, 2, 250, 235, 22, 59, 48, 7, 4, 1, 222, 92, 
-    2, 250, 235, 22, 59, 48, 7, 6, 1, 222, 92, 2, 59, 252, 43, 22, 59, 48, 7, 
-    4, 1, 222, 92, 2, 59, 252, 43, 22, 59, 48, 7, 6, 1, 217, 153, 2, 59, 48, 
-    7, 4, 1, 217, 153, 2, 59, 48, 7, 6, 1, 217, 153, 2, 59, 51, 7, 4, 1, 217, 
-    153, 2, 59, 51, 7, 6, 1, 217, 153, 2, 232, 214, 51, 7, 4, 1, 217, 153, 2, 
-    232, 214, 51, 7, 6, 1, 217, 153, 2, 250, 31, 51, 7, 4, 1, 217, 153, 2, 
-    250, 31, 51, 7, 6, 1, 104, 2, 248, 2, 51, 7, 4, 1, 104, 2, 248, 2, 51, 7, 
-    6, 1, 104, 2, 216, 89, 51, 7, 4, 1, 104, 2, 216, 89, 51, 7, 6, 1, 104, 2, 
-    250, 31, 51, 7, 4, 1, 104, 2, 250, 31, 51, 7, 6, 1, 104, 2, 216, 89, 22, 
-    142, 7, 4, 1, 104, 2, 216, 89, 22, 142, 7, 6, 1, 104, 2, 231, 233, 22, 
-    248, 1, 7, 4, 1, 104, 2, 231, 233, 22, 248, 1, 7, 6, 1, 214, 106, 2, 182, 
-    7, 4, 1, 214, 106, 2, 182, 7, 6, 1, 214, 106, 2, 59, 51, 7, 4, 1, 214, 
-    106, 2, 59, 51, 7, 6, 1, 212, 99, 2, 242, 136, 7, 4, 1, 212, 99, 2, 242, 
-    136, 7, 6, 1, 212, 99, 2, 142, 7, 4, 1, 212, 99, 2, 142, 7, 6, 1, 212, 
-    99, 2, 248, 1, 7, 4, 1, 212, 99, 2, 248, 1, 7, 6, 1, 212, 99, 2, 59, 48, 
-    7, 4, 1, 212, 99, 2, 59, 48, 7, 6, 1, 212, 99, 2, 59, 51, 7, 4, 1, 212, 
-    99, 2, 59, 51, 7, 6, 1, 211, 179, 2, 59, 48, 7, 4, 1, 211, 179, 2, 59, 
-    48, 7, 6, 1, 211, 179, 2, 248, 1, 7, 4, 1, 211, 179, 2, 248, 1, 7, 6, 1, 
-    211, 118, 2, 59, 48, 7, 4, 1, 211, 118, 2, 59, 48, 7, 6, 1, 210, 160, 2, 
-    250, 30, 7, 4, 1, 210, 160, 2, 250, 30, 7, 6, 1, 210, 160, 2, 59, 51, 7, 
-    4, 1, 210, 160, 2, 59, 51, 7, 6, 1, 210, 160, 2, 232, 214, 51, 7, 4, 1, 
-    210, 160, 2, 232, 214, 51, 7, 4, 1, 242, 61, 2, 232, 214, 51, 7, 4, 1, 
-    217, 153, 2, 248, 1, 7, 4, 1, 212, 99, 2, 222, 234, 48, 7, 4, 1, 211, 
-    118, 2, 222, 234, 48, 7, 4, 1, 115, 2, 44, 163, 222, 233, 7, 4, 1, 199, 
-    222, 92, 2, 59, 48, 7, 4, 1, 199, 222, 92, 2, 247, 255, 91, 7, 4, 1, 199, 
-    222, 92, 2, 125, 91, 7, 6, 1, 220, 76, 222, 91, 7, 4, 1, 248, 54, 7, 6, 
-    1, 115, 2, 59, 51, 7, 4, 1, 115, 2, 59, 51, 7, 6, 1, 115, 2, 241, 52, 48, 
-    7, 4, 1, 115, 2, 241, 52, 48, 7, 6, 1, 115, 2, 250, 31, 22, 142, 7, 4, 1, 
-    115, 2, 250, 31, 22, 142, 7, 6, 1, 115, 2, 250, 31, 22, 242, 136, 7, 4, 
-    1, 115, 2, 250, 31, 22, 242, 136, 7, 6, 1, 115, 2, 250, 31, 22, 241, 52, 
-    48, 7, 4, 1, 115, 2, 250, 31, 22, 241, 52, 48, 7, 6, 1, 115, 2, 250, 31, 
-    22, 182, 7, 4, 1, 115, 2, 250, 31, 22, 182, 7, 6, 1, 115, 2, 250, 31, 22, 
-    59, 51, 7, 4, 1, 115, 2, 250, 31, 22, 59, 51, 7, 6, 1, 115, 2, 251, 147, 
-    22, 142, 7, 4, 1, 115, 2, 251, 147, 22, 142, 7, 6, 1, 115, 2, 251, 147, 
-    22, 242, 136, 7, 4, 1, 115, 2, 251, 147, 22, 242, 136, 7, 6, 1, 115, 2, 
-    251, 147, 22, 241, 52, 48, 7, 4, 1, 115, 2, 251, 147, 22, 241, 52, 48, 7, 
-    6, 1, 115, 2, 251, 147, 22, 182, 7, 4, 1, 115, 2, 251, 147, 22, 182, 7, 
-    6, 1, 115, 2, 251, 147, 22, 59, 51, 7, 4, 1, 115, 2, 251, 147, 22, 59, 
+    0, 219, 20, 245, 39, 79, 224, 1, 79, 54, 50, 247, 140, 50, 225, 185, 50, 
+    254, 134, 254, 65, 43, 226, 7, 44, 226, 7, 253, 224, 96, 50, 249, 227, 
+    240, 174, 243, 236, 218, 131, 219, 48, 21, 210, 86, 21, 111, 21, 105, 21, 
+    158, 21, 161, 21, 190, 21, 195, 21, 199, 21, 196, 21, 201, 249, 234, 220, 
+    152, 233, 21, 50, 245, 106, 50, 242, 137, 50, 224, 16, 79, 249, 225, 253, 
+    214, 7, 6, 1, 61, 7, 6, 1, 253, 166, 7, 6, 1, 251, 74, 7, 6, 1, 249, 68, 
+    7, 6, 1, 76, 7, 6, 1, 245, 14, 7, 6, 1, 243, 209, 7, 6, 1, 242, 67, 7, 6, 
+    1, 74, 7, 6, 1, 235, 150, 7, 6, 1, 235, 29, 7, 6, 1, 156, 7, 6, 1, 194, 
+    7, 6, 1, 230, 30, 7, 6, 1, 78, 7, 6, 1, 226, 109, 7, 6, 1, 224, 99, 7, 6, 
+    1, 153, 7, 6, 1, 222, 93, 7, 6, 1, 217, 153, 7, 6, 1, 69, 7, 6, 1, 214, 
+    105, 7, 6, 1, 212, 98, 7, 6, 1, 211, 178, 7, 6, 1, 211, 117, 7, 6, 1, 
+    210, 159, 43, 42, 127, 223, 53, 219, 48, 44, 42, 127, 250, 39, 255, 23, 
+    121, 232, 219, 242, 144, 255, 23, 7, 4, 1, 61, 7, 4, 1, 253, 166, 7, 4, 
+    1, 251, 74, 7, 4, 1, 249, 68, 7, 4, 1, 76, 7, 4, 1, 245, 14, 7, 4, 1, 
+    243, 209, 7, 4, 1, 242, 67, 7, 4, 1, 74, 7, 4, 1, 235, 150, 7, 4, 1, 235, 
+    29, 7, 4, 1, 156, 7, 4, 1, 194, 7, 4, 1, 230, 30, 7, 4, 1, 78, 7, 4, 1, 
+    226, 109, 7, 4, 1, 224, 99, 7, 4, 1, 153, 7, 4, 1, 222, 93, 7, 4, 1, 217, 
+    153, 7, 4, 1, 69, 7, 4, 1, 214, 105, 7, 4, 1, 212, 98, 7, 4, 1, 211, 178, 
+    7, 4, 1, 211, 117, 7, 4, 1, 210, 159, 43, 249, 107, 127, 67, 232, 219, 
+    44, 249, 107, 127, 184, 228, 78, 219, 20, 235, 200, 245, 39, 79, 250, 
+    184, 50, 224, 231, 50, 249, 106, 50, 211, 40, 50, 251, 143, 130, 221, 
+    175, 50, 248, 9, 249, 171, 50, 244, 144, 226, 158, 235, 245, 233, 48, 52, 
+    254, 118, 224, 1, 79, 228, 57, 50, 219, 54, 240, 175, 223, 105, 50, 231, 
+    237, 248, 79, 50, 225, 24, 50, 218, 24, 105, 218, 24, 158, 255, 12, 255, 
+    23, 230, 233, 50, 225, 71, 50, 230, 229, 247, 128, 250, 191, 218, 24, 
+    111, 231, 153, 226, 158, 235, 245, 222, 250, 52, 254, 118, 224, 1, 79, 
+    212, 114, 244, 10, 123, 224, 24, 212, 114, 244, 10, 123, 242, 34, 212, 
+    114, 244, 10, 134, 224, 22, 235, 200, 224, 16, 79, 7, 6, 1, 116, 2, 242, 
+    143, 7, 6, 1, 116, 2, 142, 7, 6, 1, 116, 2, 250, 38, 7, 6, 1, 116, 2, 
+    184, 7, 6, 1, 116, 2, 248, 9, 7, 6, 1, 116, 2, 222, 237, 48, 7, 6, 1, 
+    254, 252, 7, 6, 1, 251, 75, 2, 250, 191, 7, 6, 1, 160, 2, 242, 143, 7, 6, 
+    1, 160, 2, 142, 7, 6, 1, 160, 2, 250, 38, 7, 6, 1, 160, 2, 248, 9, 7, 6, 
+    1, 240, 161, 2, 242, 143, 7, 6, 1, 240, 161, 2, 142, 7, 6, 1, 240, 161, 
+    2, 250, 38, 7, 6, 1, 240, 161, 2, 248, 9, 7, 6, 1, 245, 67, 7, 6, 1, 230, 
+    31, 2, 184, 7, 6, 1, 144, 2, 242, 143, 7, 6, 1, 144, 2, 142, 7, 6, 1, 
+    144, 2, 250, 38, 7, 6, 1, 144, 2, 184, 7, 6, 1, 144, 2, 248, 9, 230, 89, 
+    50, 7, 6, 1, 144, 2, 91, 7, 6, 1, 104, 2, 242, 143, 7, 6, 1, 104, 2, 142, 
+    7, 6, 1, 104, 2, 250, 38, 7, 6, 1, 104, 2, 248, 9, 7, 6, 1, 211, 118, 2, 
+    142, 7, 6, 1, 216, 152, 7, 4, 1, 220, 78, 222, 93, 7, 4, 1, 116, 2, 242, 
+    143, 7, 4, 1, 116, 2, 142, 7, 4, 1, 116, 2, 250, 38, 7, 4, 1, 116, 2, 
+    184, 7, 4, 1, 116, 2, 248, 9, 7, 4, 1, 116, 2, 222, 237, 48, 7, 4, 1, 
+    254, 252, 7, 4, 1, 251, 75, 2, 250, 191, 7, 4, 1, 160, 2, 242, 143, 7, 4, 
+    1, 160, 2, 142, 7, 4, 1, 160, 2, 250, 38, 7, 4, 1, 160, 2, 248, 9, 7, 4, 
+    1, 240, 161, 2, 242, 143, 7, 4, 1, 240, 161, 2, 142, 7, 4, 1, 240, 161, 
+    2, 250, 38, 7, 4, 1, 240, 161, 2, 248, 9, 7, 4, 1, 245, 67, 7, 4, 1, 230, 
+    31, 2, 184, 7, 4, 1, 144, 2, 242, 143, 7, 4, 1, 144, 2, 142, 7, 4, 1, 
+    144, 2, 250, 38, 7, 4, 1, 144, 2, 184, 7, 4, 1, 144, 2, 248, 9, 247, 177, 
+    50, 7, 4, 1, 144, 2, 91, 7, 4, 1, 104, 2, 242, 143, 7, 4, 1, 104, 2, 142, 
+    7, 4, 1, 104, 2, 250, 38, 7, 4, 1, 104, 2, 248, 9, 7, 4, 1, 211, 118, 2, 
+    142, 7, 4, 1, 216, 152, 7, 4, 1, 211, 118, 2, 248, 9, 7, 6, 1, 116, 2, 
+    231, 237, 7, 4, 1, 116, 2, 231, 237, 7, 6, 1, 116, 2, 251, 154, 7, 4, 1, 
+    116, 2, 251, 154, 7, 6, 1, 116, 2, 226, 228, 7, 4, 1, 116, 2, 226, 228, 
+    7, 6, 1, 251, 75, 2, 142, 7, 4, 1, 251, 75, 2, 142, 7, 6, 1, 251, 75, 2, 
+    250, 38, 7, 4, 1, 251, 75, 2, 250, 38, 7, 6, 1, 251, 75, 2, 59, 48, 7, 4, 
+    1, 251, 75, 2, 59, 48, 7, 6, 1, 251, 75, 2, 250, 242, 7, 4, 1, 251, 75, 
+    2, 250, 242, 7, 6, 1, 249, 69, 2, 250, 242, 7, 4, 1, 249, 69, 2, 250, 
+    242, 7, 6, 1, 249, 69, 2, 91, 7, 4, 1, 249, 69, 2, 91, 7, 6, 1, 160, 2, 
+    231, 237, 7, 4, 1, 160, 2, 231, 237, 7, 6, 1, 160, 2, 251, 154, 7, 4, 1, 
+    160, 2, 251, 154, 7, 6, 1, 160, 2, 59, 48, 7, 4, 1, 160, 2, 59, 48, 7, 6, 
+    1, 160, 2, 226, 228, 7, 4, 1, 160, 2, 226, 228, 7, 6, 1, 160, 2, 250, 
+    242, 7, 4, 1, 160, 2, 250, 242, 7, 6, 1, 243, 210, 2, 250, 38, 7, 4, 1, 
+    243, 210, 2, 250, 38, 7, 6, 1, 243, 210, 2, 251, 154, 7, 4, 1, 243, 210, 
+    2, 251, 154, 7, 6, 1, 243, 210, 2, 59, 48, 7, 4, 1, 243, 210, 2, 59, 48, 
+    7, 6, 1, 243, 210, 2, 250, 191, 7, 4, 1, 243, 210, 2, 250, 191, 7, 6, 1, 
+    242, 68, 2, 250, 38, 7, 4, 1, 242, 68, 2, 250, 38, 7, 6, 1, 242, 68, 2, 
+    91, 7, 4, 1, 242, 68, 2, 91, 7, 6, 1, 240, 161, 2, 184, 7, 4, 1, 240, 
+    161, 2, 184, 7, 6, 1, 240, 161, 2, 231, 237, 7, 4, 1, 240, 161, 2, 231, 
+    237, 7, 6, 1, 240, 161, 2, 251, 154, 7, 4, 1, 240, 161, 2, 251, 154, 7, 
+    6, 1, 240, 161, 2, 226, 228, 7, 4, 1, 240, 161, 2, 226, 228, 7, 6, 1, 
+    240, 161, 2, 59, 48, 7, 4, 1, 247, 127, 74, 7, 6, 27, 236, 38, 7, 4, 27, 
+    236, 38, 7, 6, 1, 235, 151, 2, 250, 38, 7, 4, 1, 235, 151, 2, 250, 38, 7, 
+    6, 1, 235, 30, 2, 250, 191, 7, 4, 1, 235, 30, 2, 250, 191, 7, 4, 1, 233, 
+    245, 7, 6, 1, 233, 155, 2, 142, 7, 4, 1, 233, 155, 2, 142, 7, 6, 1, 233, 
+    155, 2, 250, 191, 7, 4, 1, 233, 155, 2, 250, 191, 7, 6, 1, 233, 155, 2, 
+    250, 242, 7, 4, 1, 233, 155, 2, 250, 242, 7, 6, 1, 233, 155, 2, 230, 229, 
+    247, 128, 7, 4, 1, 233, 155, 2, 230, 229, 247, 128, 7, 6, 1, 233, 155, 2, 
+    91, 7, 4, 1, 233, 155, 2, 91, 7, 6, 1, 230, 31, 2, 142, 7, 4, 1, 230, 31, 
+    2, 142, 7, 6, 1, 230, 31, 2, 250, 191, 7, 4, 1, 230, 31, 2, 250, 191, 7, 
+    6, 1, 230, 31, 2, 250, 242, 7, 4, 1, 230, 31, 2, 250, 242, 7, 4, 1, 230, 
+    31, 224, 207, 251, 86, 254, 65, 7, 6, 1, 245, 146, 7, 4, 1, 245, 146, 7, 
+    6, 1, 144, 2, 231, 237, 7, 4, 1, 144, 2, 231, 237, 7, 6, 1, 144, 2, 251, 
+    154, 7, 4, 1, 144, 2, 251, 154, 7, 6, 1, 144, 2, 52, 142, 7, 4, 1, 144, 
+    2, 52, 142, 7, 6, 27, 226, 238, 7, 4, 27, 226, 238, 7, 6, 1, 223, 227, 2, 
+    142, 7, 4, 1, 223, 227, 2, 142, 7, 6, 1, 223, 227, 2, 250, 191, 7, 4, 1, 
+    223, 227, 2, 250, 191, 7, 6, 1, 223, 227, 2, 250, 242, 7, 4, 1, 223, 227, 
+    2, 250, 242, 7, 6, 1, 222, 94, 2, 142, 7, 4, 1, 222, 94, 2, 142, 7, 6, 1, 
+    222, 94, 2, 250, 38, 7, 4, 1, 222, 94, 2, 250, 38, 7, 6, 1, 222, 94, 2, 
+    250, 191, 7, 4, 1, 222, 94, 2, 250, 191, 7, 6, 1, 222, 94, 2, 250, 242, 
+    7, 4, 1, 222, 94, 2, 250, 242, 7, 6, 1, 217, 154, 2, 250, 191, 7, 4, 1, 
+    217, 154, 2, 250, 191, 7, 6, 1, 217, 154, 2, 250, 242, 7, 4, 1, 217, 154, 
+    2, 250, 242, 7, 6, 1, 217, 154, 2, 91, 7, 4, 1, 217, 154, 2, 91, 7, 6, 1, 
+    104, 2, 184, 7, 4, 1, 104, 2, 184, 7, 6, 1, 104, 2, 231, 237, 7, 4, 1, 
+    104, 2, 231, 237, 7, 6, 1, 104, 2, 251, 154, 7, 4, 1, 104, 2, 251, 154, 
+    7, 6, 1, 104, 2, 222, 237, 48, 7, 4, 1, 104, 2, 222, 237, 48, 7, 6, 1, 
+    104, 2, 52, 142, 7, 4, 1, 104, 2, 52, 142, 7, 6, 1, 104, 2, 226, 228, 7, 
+    4, 1, 104, 2, 226, 228, 7, 6, 1, 212, 99, 2, 250, 38, 7, 4, 1, 212, 99, 
+    2, 250, 38, 7, 6, 1, 211, 118, 2, 250, 38, 7, 4, 1, 211, 118, 2, 250, 38, 
+    7, 6, 1, 211, 118, 2, 248, 9, 7, 6, 1, 210, 160, 2, 142, 7, 4, 1, 210, 
+    160, 2, 142, 7, 6, 1, 210, 160, 2, 59, 48, 7, 4, 1, 210, 160, 2, 59, 48, 
+    7, 6, 1, 210, 160, 2, 250, 242, 7, 4, 1, 210, 160, 2, 250, 242, 7, 4, 1, 
+    200, 222, 93, 7, 4, 1, 57, 2, 91, 7, 6, 1, 57, 2, 103, 7, 6, 1, 57, 2, 
+    216, 12, 7, 4, 1, 57, 2, 216, 12, 7, 6, 1, 138, 195, 7, 4, 1, 138, 195, 
+    7, 6, 1, 204, 78, 7, 6, 1, 251, 75, 2, 103, 7, 4, 1, 251, 75, 2, 103, 7, 
+    6, 1, 254, 228, 249, 68, 7, 6, 1, 249, 69, 2, 103, 7, 6, 1, 249, 69, 2, 
+    216, 12, 7, 4, 1, 249, 69, 2, 216, 12, 7, 4, 1, 215, 94, 248, 62, 7, 6, 
+    1, 223, 52, 76, 7, 6, 1, 221, 197, 7, 6, 1, 204, 76, 7, 6, 1, 245, 15, 2, 
+    103, 7, 4, 1, 245, 15, 2, 103, 7, 6, 1, 243, 210, 2, 103, 7, 6, 1, 243, 
+    114, 7, 4, 1, 240, 208, 7, 6, 1, 235, 192, 7, 6, 1, 240, 161, 2, 91, 7, 
+    6, 1, 235, 30, 2, 103, 7, 4, 1, 235, 30, 2, 103, 7, 4, 1, 233, 155, 2, 
+    130, 7, 4, 1, 233, 106, 2, 91, 7, 6, 1, 215, 94, 194, 7, 6, 1, 230, 31, 
+    2, 43, 103, 7, 4, 1, 230, 31, 2, 200, 44, 233, 42, 7, 6, 1, 144, 2, 230, 
+    229, 184, 7, 6, 1, 144, 2, 240, 255, 7, 4, 1, 144, 2, 240, 255, 7, 6, 1, 
+    226, 223, 7, 4, 1, 226, 223, 7, 6, 1, 226, 110, 2, 103, 7, 4, 1, 226, 
+    110, 2, 103, 7, 1, 210, 214, 7, 6, 1, 138, 105, 7, 4, 1, 138, 105, 7, 6, 
+    1, 245, 83, 7, 1, 223, 52, 245, 84, 232, 129, 7, 4, 1, 217, 154, 2, 226, 
+    70, 103, 7, 6, 1, 217, 154, 2, 103, 7, 4, 1, 217, 154, 2, 103, 7, 6, 1, 
+    217, 154, 2, 223, 58, 103, 7, 6, 1, 104, 2, 240, 255, 7, 4, 1, 104, 2, 
+    240, 255, 7, 6, 1, 214, 157, 7, 6, 1, 214, 106, 2, 103, 7, 6, 1, 211, 
+    118, 2, 103, 7, 4, 1, 211, 118, 2, 103, 7, 6, 1, 210, 160, 2, 91, 7, 4, 
+    1, 210, 160, 2, 91, 7, 6, 1, 245, 16, 7, 6, 1, 245, 17, 223, 51, 7, 4, 1, 
+    245, 17, 223, 51, 7, 4, 1, 245, 17, 2, 217, 78, 7, 1, 113, 2, 91, 7, 6, 
+    1, 138, 190, 7, 4, 1, 138, 190, 7, 1, 235, 200, 242, 187, 218, 132, 2, 
+    91, 7, 1, 211, 181, 7, 1, 248, 55, 250, 19, 7, 1, 233, 83, 250, 19, 7, 1, 
+    254, 145, 250, 19, 7, 1, 223, 58, 250, 19, 7, 6, 1, 246, 48, 2, 250, 242, 
+    7, 6, 1, 249, 69, 2, 4, 1, 210, 160, 2, 250, 242, 7, 4, 1, 246, 48, 2, 
+    250, 242, 7, 6, 1, 232, 194, 7, 6, 1, 233, 155, 2, 4, 1, 235, 150, 7, 4, 
+    1, 232, 194, 7, 6, 1, 228, 191, 7, 6, 1, 230, 31, 2, 4, 1, 235, 150, 7, 
+    4, 1, 228, 191, 7, 6, 1, 116, 2, 250, 242, 7, 4, 1, 116, 2, 250, 242, 7, 
+    6, 1, 240, 161, 2, 250, 242, 7, 4, 1, 240, 161, 2, 250, 242, 7, 6, 1, 
+    144, 2, 250, 242, 7, 4, 1, 144, 2, 250, 242, 7, 6, 1, 104, 2, 250, 242, 
+    7, 4, 1, 104, 2, 250, 242, 7, 6, 1, 104, 2, 248, 10, 22, 231, 237, 7, 4, 
+    1, 104, 2, 248, 10, 22, 231, 237, 7, 6, 1, 104, 2, 248, 10, 22, 142, 7, 
+    4, 1, 104, 2, 248, 10, 22, 142, 7, 6, 1, 104, 2, 248, 10, 22, 250, 242, 
+    7, 4, 1, 104, 2, 248, 10, 22, 250, 242, 7, 6, 1, 104, 2, 248, 10, 22, 
+    242, 143, 7, 4, 1, 104, 2, 248, 10, 22, 242, 143, 7, 4, 1, 215, 94, 76, 
+    7, 6, 1, 116, 2, 248, 10, 22, 231, 237, 7, 4, 1, 116, 2, 248, 10, 22, 
+    231, 237, 7, 6, 1, 116, 2, 59, 72, 22, 231, 237, 7, 4, 1, 116, 2, 59, 72, 
+    22, 231, 237, 7, 6, 1, 254, 253, 2, 231, 237, 7, 4, 1, 254, 253, 2, 231, 
+    237, 7, 6, 1, 243, 210, 2, 91, 7, 4, 1, 243, 210, 2, 91, 7, 6, 1, 243, 
+    210, 2, 250, 242, 7, 4, 1, 243, 210, 2, 250, 242, 7, 6, 1, 235, 30, 2, 
+    250, 242, 7, 4, 1, 235, 30, 2, 250, 242, 7, 6, 1, 144, 2, 226, 228, 7, 4, 
+    1, 144, 2, 226, 228, 7, 6, 1, 144, 2, 226, 229, 22, 231, 237, 7, 4, 1, 
+    144, 2, 226, 229, 22, 231, 237, 7, 6, 1, 245, 17, 2, 250, 242, 7, 4, 1, 
+    245, 17, 2, 250, 242, 7, 4, 1, 235, 151, 2, 250, 242, 7, 6, 1, 246, 47, 
+    7, 6, 1, 249, 69, 2, 4, 1, 210, 159, 7, 4, 1, 246, 47, 7, 6, 1, 243, 210, 
+    2, 142, 7, 4, 1, 243, 210, 2, 142, 7, 6, 1, 240, 206, 7, 6, 1, 211, 181, 
+    7, 6, 1, 230, 31, 2, 242, 143, 7, 4, 1, 230, 31, 2, 242, 143, 7, 6, 1, 
+    116, 2, 222, 237, 72, 22, 142, 7, 4, 1, 116, 2, 222, 237, 72, 22, 142, 7, 
+    6, 1, 254, 253, 2, 142, 7, 4, 1, 254, 253, 2, 142, 7, 6, 1, 144, 2, 218, 
+    105, 22, 142, 7, 4, 1, 144, 2, 218, 105, 22, 142, 7, 6, 1, 116, 2, 52, 
+    242, 143, 7, 4, 1, 116, 2, 52, 242, 143, 7, 6, 1, 116, 2, 235, 200, 251, 
+    154, 7, 4, 1, 116, 2, 235, 200, 251, 154, 7, 6, 1, 160, 2, 52, 242, 143, 
+    7, 4, 1, 160, 2, 52, 242, 143, 7, 6, 1, 160, 2, 235, 200, 251, 154, 7, 4, 
+    1, 160, 2, 235, 200, 251, 154, 7, 6, 1, 240, 161, 2, 52, 242, 143, 7, 4, 
+    1, 240, 161, 2, 52, 242, 143, 7, 6, 1, 240, 161, 2, 235, 200, 251, 154, 
+    7, 4, 1, 240, 161, 2, 235, 200, 251, 154, 7, 6, 1, 144, 2, 52, 242, 143, 
+    7, 4, 1, 144, 2, 52, 242, 143, 7, 6, 1, 144, 2, 235, 200, 251, 154, 7, 4, 
+    1, 144, 2, 235, 200, 251, 154, 7, 6, 1, 223, 227, 2, 52, 242, 143, 7, 4, 
+    1, 223, 227, 2, 52, 242, 143, 7, 6, 1, 223, 227, 2, 235, 200, 251, 154, 
+    7, 4, 1, 223, 227, 2, 235, 200, 251, 154, 7, 6, 1, 104, 2, 52, 242, 143, 
+    7, 4, 1, 104, 2, 52, 242, 143, 7, 6, 1, 104, 2, 235, 200, 251, 154, 7, 4, 
+    1, 104, 2, 235, 200, 251, 154, 7, 6, 1, 222, 94, 2, 249, 228, 51, 7, 4, 
+    1, 222, 94, 2, 249, 228, 51, 7, 6, 1, 217, 154, 2, 249, 228, 51, 7, 4, 1, 
+    217, 154, 2, 249, 228, 51, 7, 6, 1, 210, 231, 7, 4, 1, 210, 231, 7, 6, 1, 
+    242, 68, 2, 250, 242, 7, 4, 1, 242, 68, 2, 250, 242, 7, 6, 1, 230, 31, 2, 
+    200, 44, 233, 42, 7, 4, 1, 249, 69, 2, 249, 108, 7, 6, 1, 226, 138, 7, 4, 
+    1, 226, 138, 7, 6, 1, 210, 160, 2, 103, 7, 4, 1, 210, 160, 2, 103, 7, 6, 
+    1, 116, 2, 59, 48, 7, 4, 1, 116, 2, 59, 48, 7, 6, 1, 160, 2, 250, 191, 7, 
+    4, 1, 160, 2, 250, 191, 7, 6, 1, 144, 2, 248, 10, 22, 231, 237, 7, 4, 1, 
+    144, 2, 248, 10, 22, 231, 237, 7, 6, 1, 144, 2, 216, 90, 22, 231, 237, 7, 
+    4, 1, 144, 2, 216, 90, 22, 231, 237, 7, 6, 1, 144, 2, 59, 48, 7, 4, 1, 
+    144, 2, 59, 48, 7, 6, 1, 144, 2, 59, 72, 22, 231, 237, 7, 4, 1, 144, 2, 
+    59, 72, 22, 231, 237, 7, 6, 1, 211, 118, 2, 231, 237, 7, 4, 1, 211, 118, 
+    2, 231, 237, 7, 4, 1, 233, 155, 2, 249, 108, 7, 4, 1, 230, 31, 2, 249, 
+    108, 7, 4, 1, 217, 154, 2, 249, 108, 7, 4, 1, 247, 127, 235, 150, 7, 4, 
+    1, 248, 151, 247, 228, 7, 4, 1, 224, 34, 247, 228, 7, 6, 1, 116, 2, 91, 
+    7, 6, 1, 251, 75, 2, 91, 7, 4, 1, 251, 75, 2, 91, 7, 6, 1, 233, 155, 2, 
+    130, 7, 6, 1, 217, 154, 2, 248, 7, 91, 7, 4, 1, 222, 94, 2, 217, 251, 
+    217, 78, 7, 4, 1, 210, 160, 2, 217, 251, 217, 78, 7, 6, 1, 242, 187, 218, 
+    131, 7, 4, 1, 242, 187, 218, 131, 7, 6, 1, 57, 2, 91, 7, 6, 1, 104, 130, 
+    7, 6, 1, 215, 94, 214, 105, 7, 6, 1, 160, 2, 91, 7, 4, 1, 160, 2, 91, 7, 
+    6, 1, 235, 151, 2, 91, 7, 4, 1, 235, 151, 2, 91, 7, 6, 1, 4, 224, 100, 2, 
+    241, 59, 217, 78, 7, 4, 1, 224, 100, 2, 241, 59, 217, 78, 7, 6, 1, 223, 
+    227, 2, 91, 7, 4, 1, 223, 227, 2, 91, 7, 6, 1, 211, 118, 2, 91, 7, 4, 1, 
+    211, 118, 2, 91, 7, 4, 1, 215, 94, 61, 7, 4, 1, 254, 151, 7, 4, 1, 215, 
+    94, 254, 151, 7, 4, 1, 57, 2, 103, 7, 4, 1, 204, 78, 7, 4, 1, 251, 75, 2, 
+    249, 108, 7, 4, 1, 249, 69, 2, 217, 78, 7, 4, 1, 249, 69, 2, 103, 7, 4, 
+    1, 223, 52, 76, 7, 4, 1, 221, 197, 7, 4, 1, 221, 198, 2, 103, 7, 4, 1, 
+    204, 76, 7, 4, 1, 223, 52, 204, 76, 7, 4, 1, 223, 52, 204, 160, 2, 103, 
+    7, 4, 1, 250, 8, 223, 52, 204, 76, 7, 4, 1, 247, 127, 235, 151, 2, 91, 7, 
+    4, 1, 243, 210, 2, 103, 7, 4, 1, 119, 243, 209, 7, 1, 4, 6, 243, 209, 7, 
+    4, 1, 243, 114, 7, 4, 1, 223, 154, 240, 255, 7, 4, 1, 215, 94, 242, 67, 
+    7, 4, 1, 242, 68, 2, 103, 7, 4, 1, 241, 215, 2, 103, 7, 4, 1, 240, 161, 
+    2, 91, 7, 4, 1, 235, 192, 7, 1, 4, 6, 74, 7, 4, 1, 233, 155, 2, 230, 229, 
+    184, 7, 4, 1, 233, 155, 2, 252, 49, 7, 4, 1, 233, 155, 2, 223, 58, 103, 
+    7, 4, 1, 233, 7, 7, 4, 1, 215, 94, 194, 7, 4, 1, 215, 94, 232, 55, 2, 
+    200, 233, 42, 7, 4, 1, 232, 55, 2, 103, 7, 4, 1, 230, 31, 2, 43, 103, 7, 
+    4, 1, 230, 31, 2, 223, 58, 103, 7, 1, 4, 6, 230, 30, 7, 4, 1, 252, 142, 
+    78, 7, 1, 4, 6, 226, 238, 7, 4, 1, 250, 8, 226, 205, 7, 4, 1, 225, 136, 
+    7, 4, 1, 215, 94, 153, 7, 4, 1, 215, 94, 223, 227, 2, 200, 233, 42, 7, 4, 
+    1, 215, 94, 223, 227, 2, 103, 7, 4, 1, 223, 227, 2, 200, 233, 42, 7, 4, 
+    1, 223, 227, 2, 217, 78, 7, 4, 1, 223, 227, 2, 244, 95, 7, 4, 1, 223, 52, 
+    223, 227, 2, 244, 95, 7, 1, 4, 6, 153, 7, 1, 4, 6, 235, 200, 153, 7, 4, 
+    1, 222, 94, 2, 103, 7, 4, 1, 245, 83, 7, 4, 1, 247, 127, 235, 151, 2, 
+    218, 105, 22, 103, 7, 4, 1, 218, 233, 223, 52, 245, 83, 7, 4, 1, 245, 84, 
+    2, 249, 108, 7, 4, 1, 215, 94, 217, 153, 7, 4, 1, 217, 154, 2, 223, 58, 
+    103, 7, 4, 1, 104, 130, 7, 4, 1, 214, 157, 7, 4, 1, 214, 106, 2, 103, 7, 
+    4, 1, 215, 94, 214, 105, 7, 4, 1, 215, 94, 212, 98, 7, 4, 1, 215, 94, 
+    211, 117, 7, 1, 4, 6, 211, 117, 7, 4, 1, 210, 160, 2, 223, 58, 103, 7, 4, 
+    1, 210, 160, 2, 249, 108, 7, 4, 1, 245, 16, 7, 4, 1, 245, 17, 2, 249, 
+    108, 7, 1, 242, 187, 218, 131, 7, 1, 225, 142, 213, 135, 244, 1, 7, 1, 
+    235, 200, 242, 187, 218, 131, 7, 1, 218, 112, 251, 74, 7, 1, 251, 254, 
+    250, 19, 7, 1, 4, 6, 253, 166, 7, 4, 1, 250, 8, 204, 76, 7, 1, 4, 6, 243, 
+    210, 2, 103, 7, 1, 4, 6, 242, 67, 7, 4, 1, 235, 151, 2, 249, 135, 7, 4, 
+    1, 215, 94, 235, 29, 7, 1, 4, 6, 156, 7, 4, 1, 224, 100, 2, 103, 7, 1, 
+    242, 187, 218, 132, 2, 91, 7, 1, 223, 52, 242, 187, 218, 132, 2, 91, 7, 
+    4, 1, 246, 48, 247, 228, 7, 4, 1, 248, 34, 247, 228, 7, 4, 1, 246, 48, 
+    247, 229, 2, 249, 108, 7, 4, 1, 215, 186, 247, 228, 7, 4, 1, 216, 236, 
+    247, 228, 7, 4, 1, 217, 30, 247, 229, 2, 249, 108, 7, 4, 1, 244, 142, 
+    247, 228, 7, 4, 1, 232, 105, 247, 228, 7, 4, 1, 232, 56, 247, 228, 7, 1, 
+    251, 254, 225, 184, 7, 1, 252, 6, 225, 184, 7, 4, 1, 215, 94, 242, 68, 2, 
+    244, 95, 7, 4, 1, 215, 94, 242, 68, 2, 244, 96, 22, 217, 78, 58, 1, 4, 
+    242, 67, 58, 1, 4, 242, 68, 2, 103, 58, 1, 4, 235, 150, 58, 1, 4, 153, 
+    58, 1, 4, 215, 94, 153, 58, 1, 4, 215, 94, 223, 227, 2, 103, 58, 1, 4, 6, 
+    235, 200, 153, 58, 1, 4, 212, 98, 58, 1, 4, 211, 117, 58, 1, 224, 193, 
+    58, 1, 52, 224, 193, 58, 1, 215, 94, 249, 227, 58, 1, 254, 65, 58, 1, 
+    223, 52, 249, 227, 58, 1, 44, 163, 222, 236, 58, 1, 43, 163, 222, 236, 
+    58, 1, 242, 187, 218, 131, 58, 1, 223, 52, 242, 187, 218, 131, 58, 1, 43, 
+    254, 1, 58, 1, 44, 254, 1, 58, 1, 120, 254, 1, 58, 1, 124, 254, 1, 58, 1, 
+    250, 39, 255, 23, 250, 242, 58, 1, 67, 232, 219, 58, 1, 231, 237, 58, 1, 
+    255, 12, 255, 23, 58, 1, 242, 144, 255, 23, 58, 1, 121, 67, 232, 219, 58, 
+    1, 121, 231, 237, 58, 1, 121, 242, 144, 255, 23, 58, 1, 121, 255, 12, 
+    255, 23, 58, 1, 215, 223, 249, 234, 58, 1, 163, 215, 223, 249, 234, 58, 
+    1, 250, 181, 44, 163, 222, 236, 58, 1, 250, 181, 43, 163, 222, 236, 58, 
+    1, 120, 217, 88, 58, 1, 124, 217, 88, 58, 1, 96, 50, 58, 1, 230, 187, 50, 
+    251, 154, 59, 48, 222, 237, 48, 226, 228, 4, 184, 52, 255, 12, 255, 23, 
+    58, 1, 223, 39, 103, 58, 1, 249, 139, 255, 23, 58, 1, 4, 243, 114, 58, 1, 
+    4, 156, 58, 1, 4, 222, 93, 58, 1, 4, 211, 178, 58, 1, 4, 223, 52, 242, 
+    187, 218, 131, 58, 1, 245, 28, 138, 130, 58, 1, 125, 138, 130, 58, 1, 
+    230, 230, 138, 130, 58, 1, 121, 138, 130, 58, 1, 245, 27, 138, 130, 58, 
+    1, 210, 254, 248, 52, 138, 79, 58, 1, 211, 70, 248, 52, 138, 79, 58, 1, 
+    213, 133, 58, 1, 214, 186, 58, 1, 52, 254, 65, 58, 1, 121, 124, 254, 1, 
+    58, 1, 121, 120, 254, 1, 58, 1, 121, 43, 254, 1, 58, 1, 121, 44, 254, 1, 
+    58, 1, 121, 222, 236, 58, 1, 230, 229, 242, 144, 255, 23, 58, 1, 230, 
+    229, 52, 242, 144, 255, 23, 58, 1, 230, 229, 52, 255, 12, 255, 23, 58, 1, 
+    121, 184, 58, 1, 223, 160, 249, 234, 58, 1, 252, 66, 125, 216, 31, 58, 1, 
+    245, 151, 125, 216, 31, 58, 1, 252, 66, 121, 216, 31, 58, 1, 245, 151, 
+    121, 216, 31, 58, 1, 220, 56, 58, 1, 204, 220, 56, 58, 1, 121, 43, 75, 
+    38, 242, 144, 255, 23, 38, 255, 12, 255, 23, 38, 250, 39, 255, 23, 38, 
+    184, 38, 231, 237, 38, 226, 123, 38, 251, 154, 38, 59, 48, 38, 248, 9, 
+    38, 241, 59, 48, 38, 222, 237, 48, 38, 52, 255, 12, 255, 23, 38, 250, 
+    242, 38, 67, 232, 220, 48, 38, 52, 67, 232, 220, 48, 38, 52, 242, 144, 
+    255, 23, 38, 251, 7, 38, 235, 200, 251, 154, 38, 215, 94, 249, 228, 48, 
+    38, 249, 228, 48, 38, 223, 52, 249, 228, 48, 38, 249, 228, 72, 222, 254, 
+    38, 242, 144, 255, 24, 51, 38, 255, 12, 255, 24, 51, 38, 43, 217, 89, 51, 
+    38, 44, 217, 89, 51, 38, 43, 254, 118, 48, 38, 240, 255, 38, 43, 163, 
+    222, 237, 51, 38, 120, 217, 89, 51, 38, 124, 217, 89, 51, 38, 96, 5, 51, 
+    38, 230, 187, 5, 51, 38, 226, 68, 241, 59, 51, 38, 223, 58, 241, 59, 51, 
+    38, 59, 51, 38, 248, 10, 51, 38, 222, 237, 51, 38, 249, 228, 51, 38, 250, 
+    191, 38, 226, 228, 38, 67, 232, 220, 51, 38, 251, 148, 51, 38, 235, 200, 
+    52, 254, 32, 51, 38, 250, 243, 51, 38, 250, 39, 255, 24, 51, 38, 251, 
+    155, 51, 38, 235, 200, 251, 155, 51, 38, 216, 90, 51, 38, 231, 238, 51, 
+    38, 121, 232, 219, 38, 52, 121, 232, 219, 38, 216, 90, 226, 124, 38, 219, 
+    253, 218, 105, 226, 124, 38, 200, 218, 105, 226, 124, 38, 219, 253, 219, 
+    49, 226, 124, 38, 200, 219, 49, 226, 124, 38, 44, 163, 222, 237, 51, 38, 
+    235, 200, 251, 148, 51, 38, 42, 51, 38, 221, 182, 51, 38, 211, 179, 48, 
+    38, 67, 184, 38, 52, 226, 123, 38, 242, 144, 138, 79, 38, 255, 12, 138, 
+    79, 38, 26, 225, 178, 38, 26, 234, 8, 38, 26, 248, 4, 216, 19, 38, 26, 
+    210, 219, 38, 251, 148, 48, 38, 245, 106, 5, 51, 38, 52, 67, 232, 220, 
+    51, 38, 43, 254, 118, 51, 38, 228, 57, 216, 90, 48, 38, 241, 65, 48, 38, 
+    254, 156, 128, 216, 43, 48, 38, 43, 44, 80, 51, 38, 214, 153, 80, 51, 38, 
+    242, 149, 235, 69, 38, 44, 254, 2, 48, 38, 43, 163, 222, 237, 48, 38, 
+    244, 139, 38, 211, 179, 51, 38, 43, 254, 2, 51, 38, 44, 254, 2, 51, 38, 
+    44, 254, 2, 22, 120, 254, 2, 51, 38, 44, 163, 222, 237, 48, 38, 59, 72, 
+    222, 254, 38, 253, 225, 51, 38, 52, 222, 237, 51, 38, 210, 35, 48, 38, 
+    52, 251, 155, 51, 38, 52, 251, 154, 38, 52, 231, 237, 38, 52, 231, 238, 
+    51, 38, 52, 184, 38, 52, 235, 200, 251, 154, 38, 52, 97, 80, 51, 38, 7, 
+    4, 1, 61, 38, 7, 4, 1, 76, 38, 7, 4, 1, 74, 38, 7, 4, 1, 78, 38, 7, 4, 1, 
+    69, 38, 7, 4, 1, 251, 74, 38, 7, 4, 1, 249, 68, 38, 7, 4, 1, 242, 67, 38, 
+    7, 4, 1, 194, 38, 7, 4, 1, 153, 38, 7, 4, 1, 217, 153, 38, 7, 4, 1, 214, 
+    105, 38, 7, 4, 1, 211, 178, 26, 6, 1, 241, 203, 26, 4, 1, 241, 203, 26, 
+    6, 1, 254, 31, 221, 248, 26, 4, 1, 254, 31, 221, 248, 26, 227, 202, 50, 
+    26, 232, 114, 227, 202, 50, 26, 6, 1, 226, 55, 247, 235, 26, 4, 1, 226, 
+    55, 247, 235, 26, 210, 219, 26, 4, 223, 52, 232, 88, 219, 180, 87, 26, 4, 
+    246, 126, 232, 88, 219, 180, 87, 26, 4, 223, 52, 246, 126, 232, 88, 219, 
+    180, 87, 26, 224, 16, 79, 26, 216, 19, 26, 248, 4, 216, 19, 26, 6, 1, 
+    254, 152, 2, 216, 19, 26, 254, 105, 217, 3, 26, 6, 1, 245, 109, 2, 216, 
+    19, 26, 6, 1, 245, 72, 2, 216, 19, 26, 6, 1, 235, 193, 2, 216, 19, 26, 6, 
+    1, 226, 204, 2, 216, 19, 26, 6, 1, 214, 158, 2, 216, 19, 26, 6, 1, 226, 
+    206, 2, 216, 19, 26, 4, 1, 235, 193, 2, 248, 4, 22, 216, 19, 26, 6, 1, 
+    254, 151, 26, 6, 1, 252, 34, 26, 6, 1, 243, 114, 26, 6, 1, 248, 62, 26, 
+    6, 1, 245, 108, 26, 6, 1, 210, 85, 26, 6, 1, 245, 71, 26, 6, 1, 216, 180, 
+    26, 6, 1, 235, 192, 26, 6, 1, 234, 228, 26, 6, 1, 233, 104, 26, 6, 1, 
+    230, 107, 26, 6, 1, 227, 242, 26, 6, 1, 211, 157, 26, 6, 1, 226, 203, 26, 
+    6, 1, 225, 111, 26, 6, 1, 223, 40, 26, 6, 1, 219, 179, 26, 6, 1, 217, 42, 
+    26, 6, 1, 214, 157, 26, 6, 1, 225, 136, 26, 6, 1, 250, 118, 26, 6, 1, 
+    224, 164, 26, 6, 1, 226, 205, 26, 6, 1, 235, 193, 2, 248, 3, 26, 6, 1, 
+    214, 158, 2, 248, 3, 26, 4, 1, 254, 152, 2, 216, 19, 26, 4, 1, 245, 109, 
+    2, 216, 19, 26, 4, 1, 245, 72, 2, 216, 19, 26, 4, 1, 235, 193, 2, 216, 
+    19, 26, 4, 1, 214, 158, 2, 248, 4, 22, 216, 19, 26, 4, 1, 254, 151, 26, 
+    4, 1, 252, 34, 26, 4, 1, 243, 114, 26, 4, 1, 248, 62, 26, 4, 1, 245, 108, 
+    26, 4, 1, 210, 85, 26, 4, 1, 245, 71, 26, 4, 1, 216, 180, 26, 4, 1, 235, 
+    192, 26, 4, 1, 234, 228, 26, 4, 1, 233, 104, 26, 4, 1, 230, 107, 26, 4, 
+    1, 227, 242, 26, 4, 1, 211, 157, 26, 4, 1, 226, 203, 26, 4, 1, 225, 111, 
+    26, 4, 1, 223, 40, 26, 4, 1, 40, 219, 179, 26, 4, 1, 219, 179, 26, 4, 1, 
+    217, 42, 26, 4, 1, 214, 157, 26, 4, 1, 225, 136, 26, 4, 1, 250, 118, 26, 
+    4, 1, 224, 164, 26, 4, 1, 226, 205, 26, 4, 1, 235, 193, 2, 248, 3, 26, 4, 
+    1, 214, 158, 2, 248, 3, 26, 4, 1, 226, 204, 2, 216, 19, 26, 4, 1, 214, 
+    158, 2, 216, 19, 26, 4, 1, 226, 206, 2, 216, 19, 26, 6, 234, 253, 87, 26, 
+    252, 35, 87, 26, 216, 181, 87, 26, 214, 158, 2, 241, 59, 87, 26, 214, 
+    158, 2, 255, 12, 22, 241, 59, 87, 26, 214, 158, 2, 248, 10, 22, 241, 59, 
+    87, 26, 225, 137, 87, 26, 225, 112, 87, 26, 234, 253, 87, 26, 1, 254, 31, 
+    234, 12, 26, 4, 1, 254, 31, 234, 12, 26, 1, 218, 139, 26, 4, 1, 218, 139, 
+    26, 1, 247, 235, 26, 4, 1, 247, 235, 26, 1, 234, 12, 26, 4, 1, 234, 12, 
+    26, 1, 221, 248, 26, 4, 1, 221, 248, 81, 6, 1, 220, 57, 81, 4, 1, 220, 
+    57, 81, 6, 1, 244, 148, 81, 4, 1, 244, 148, 81, 6, 1, 234, 123, 81, 4, 1, 
+    234, 123, 81, 6, 1, 241, 52, 81, 4, 1, 241, 52, 81, 6, 1, 243, 109, 81, 
+    4, 1, 243, 109, 81, 6, 1, 220, 24, 81, 4, 1, 220, 24, 81, 6, 1, 248, 77, 
+    81, 4, 1, 248, 77, 26, 234, 229, 87, 26, 223, 41, 87, 26, 232, 88, 219, 
+    180, 87, 26, 1, 210, 224, 26, 6, 216, 181, 87, 26, 232, 88, 245, 109, 87, 
+    26, 223, 52, 232, 88, 245, 109, 87, 26, 6, 1, 220, 9, 26, 4, 1, 220, 9, 
+    26, 6, 232, 88, 219, 180, 87, 26, 6, 1, 221, 245, 26, 4, 1, 221, 245, 26, 
+    223, 41, 2, 218, 105, 87, 26, 6, 223, 52, 232, 88, 219, 180, 87, 26, 6, 
+    246, 126, 232, 88, 219, 180, 87, 26, 6, 223, 52, 246, 126, 232, 88, 219, 
+    180, 87, 33, 6, 1, 236, 68, 2, 242, 143, 33, 6, 1, 235, 196, 33, 6, 1, 
+    247, 170, 33, 6, 1, 242, 194, 33, 6, 1, 214, 202, 236, 67, 33, 6, 1, 246, 
+    44, 33, 6, 1, 251, 84, 74, 33, 6, 1, 211, 8, 33, 6, 1, 235, 132, 33, 6, 
+    1, 232, 193, 33, 6, 1, 228, 183, 33, 6, 1, 215, 175, 33, 6, 1, 234, 54, 
+    33, 6, 1, 240, 161, 2, 242, 143, 33, 6, 1, 219, 253, 69, 33, 6, 1, 246, 
+    40, 33, 6, 1, 61, 33, 6, 1, 252, 83, 33, 6, 1, 213, 255, 33, 6, 1, 242, 
+    243, 33, 6, 1, 248, 98, 33, 6, 1, 236, 67, 33, 6, 1, 210, 74, 33, 6, 1, 
+    210, 94, 33, 6, 1, 74, 33, 6, 1, 219, 253, 74, 33, 6, 1, 176, 33, 6, 1, 
+    245, 182, 33, 6, 1, 245, 167, 33, 6, 1, 245, 158, 33, 6, 1, 78, 33, 6, 1, 
+    225, 224, 33, 6, 1, 245, 100, 33, 6, 1, 245, 90, 33, 6, 1, 217, 23, 33, 
+    6, 1, 69, 33, 6, 1, 245, 210, 33, 6, 1, 162, 33, 6, 1, 215, 179, 33, 6, 
+    1, 250, 139, 33, 6, 1, 220, 104, 33, 6, 1, 220, 67, 33, 6, 1, 242, 10, 
+    50, 33, 6, 1, 211, 27, 33, 6, 1, 219, 54, 50, 33, 6, 1, 76, 33, 6, 1, 
+    210, 212, 33, 6, 1, 192, 33, 4, 1, 61, 33, 4, 1, 252, 83, 33, 4, 1, 213, 
+    255, 33, 4, 1, 242, 243, 33, 4, 1, 248, 98, 33, 4, 1, 236, 67, 33, 4, 1, 
+    210, 74, 33, 4, 1, 210, 94, 33, 4, 1, 74, 33, 4, 1, 219, 253, 74, 33, 4, 
+    1, 176, 33, 4, 1, 245, 182, 33, 4, 1, 245, 167, 33, 4, 1, 245, 158, 33, 
+    4, 1, 78, 33, 4, 1, 225, 224, 33, 4, 1, 245, 100, 33, 4, 1, 245, 90, 33, 
+    4, 1, 217, 23, 33, 4, 1, 69, 33, 4, 1, 245, 210, 33, 4, 1, 162, 33, 4, 1, 
+    215, 179, 33, 4, 1, 250, 139, 33, 4, 1, 220, 104, 33, 4, 1, 220, 67, 33, 
+    4, 1, 242, 10, 50, 33, 4, 1, 211, 27, 33, 4, 1, 219, 54, 50, 33, 4, 1, 
+    76, 33, 4, 1, 210, 212, 33, 4, 1, 192, 33, 4, 1, 236, 68, 2, 242, 143, 
+    33, 4, 1, 235, 196, 33, 4, 1, 247, 170, 33, 4, 1, 242, 194, 33, 4, 1, 
+    214, 202, 236, 67, 33, 4, 1, 246, 44, 33, 4, 1, 251, 84, 74, 33, 4, 1, 
+    211, 8, 33, 4, 1, 235, 132, 33, 4, 1, 232, 193, 33, 4, 1, 228, 183, 33, 
+    4, 1, 215, 175, 33, 4, 1, 234, 54, 33, 4, 1, 240, 161, 2, 242, 143, 33, 
+    4, 1, 219, 253, 69, 33, 4, 1, 246, 40, 33, 6, 1, 226, 205, 33, 4, 1, 226, 
+    205, 33, 6, 1, 211, 59, 33, 4, 1, 211, 59, 33, 6, 1, 235, 190, 76, 33, 4, 
+    1, 235, 190, 76, 33, 6, 1, 232, 198, 210, 183, 33, 4, 1, 232, 198, 210, 
+    183, 33, 6, 1, 235, 190, 232, 198, 210, 183, 33, 4, 1, 235, 190, 232, 
+    198, 210, 183, 33, 6, 1, 252, 1, 210, 183, 33, 4, 1, 252, 1, 210, 183, 
+    33, 6, 1, 235, 190, 252, 1, 210, 183, 33, 4, 1, 235, 190, 252, 1, 210, 
+    183, 33, 6, 1, 233, 239, 33, 4, 1, 233, 239, 33, 6, 1, 224, 164, 33, 4, 
+    1, 224, 164, 33, 6, 1, 244, 90, 33, 4, 1, 244, 90, 33, 6, 1, 235, 152, 
+    33, 4, 1, 235, 152, 33, 6, 1, 235, 153, 2, 52, 242, 144, 255, 23, 33, 4, 
+    1, 235, 153, 2, 52, 242, 144, 255, 23, 33, 6, 1, 214, 205, 33, 4, 1, 214, 
+    205, 33, 6, 1, 222, 187, 226, 205, 33, 4, 1, 222, 187, 226, 205, 33, 6, 
+    1, 226, 206, 2, 216, 66, 33, 4, 1, 226, 206, 2, 216, 66, 33, 6, 1, 226, 
+    144, 33, 4, 1, 226, 144, 33, 6, 1, 234, 12, 33, 4, 1, 234, 12, 33, 216, 
+    147, 50, 38, 33, 216, 66, 38, 33, 226, 69, 38, 33, 248, 162, 225, 21, 38, 
+    33, 224, 158, 225, 21, 38, 33, 225, 6, 38, 33, 240, 218, 216, 147, 50, 
+    38, 33, 230, 196, 50, 33, 6, 1, 219, 253, 240, 161, 2, 217, 78, 33, 4, 1, 
+    219, 253, 240, 161, 2, 217, 78, 33, 6, 1, 220, 148, 50, 33, 4, 1, 220, 
+    148, 50, 33, 6, 1, 245, 101, 2, 216, 115, 33, 4, 1, 245, 101, 2, 216, 
+    115, 33, 6, 1, 242, 244, 2, 214, 156, 33, 4, 1, 242, 244, 2, 214, 156, 
+    33, 6, 1, 242, 244, 2, 91, 33, 4, 1, 242, 244, 2, 91, 33, 6, 1, 242, 244, 
+    2, 230, 229, 103, 33, 4, 1, 242, 244, 2, 230, 229, 103, 33, 6, 1, 210, 
+    75, 2, 248, 47, 33, 4, 1, 210, 75, 2, 248, 47, 33, 6, 1, 210, 95, 2, 248, 
+    47, 33, 4, 1, 210, 95, 2, 248, 47, 33, 6, 1, 235, 19, 2, 248, 47, 33, 4, 
+    1, 235, 19, 2, 248, 47, 33, 6, 1, 235, 19, 2, 67, 91, 33, 4, 1, 235, 19, 
+    2, 67, 91, 33, 6, 1, 235, 19, 2, 91, 33, 4, 1, 235, 19, 2, 91, 33, 6, 1, 
+    252, 132, 176, 33, 4, 1, 252, 132, 176, 33, 6, 1, 245, 159, 2, 248, 47, 
+    33, 4, 1, 245, 159, 2, 248, 47, 33, 6, 27, 245, 159, 242, 243, 33, 4, 27, 
+    245, 159, 242, 243, 33, 6, 1, 225, 225, 2, 230, 229, 103, 33, 4, 1, 225, 
+    225, 2, 230, 229, 103, 33, 6, 1, 255, 29, 162, 33, 4, 1, 255, 29, 162, 
+    33, 6, 1, 245, 91, 2, 248, 47, 33, 4, 1, 245, 91, 2, 248, 47, 33, 6, 1, 
+    217, 24, 2, 248, 47, 33, 4, 1, 217, 24, 2, 248, 47, 33, 6, 1, 218, 123, 
+    69, 33, 4, 1, 218, 123, 69, 33, 6, 1, 218, 123, 104, 2, 91, 33, 4, 1, 
+    218, 123, 104, 2, 91, 33, 6, 1, 242, 56, 2, 248, 47, 33, 4, 1, 242, 56, 
+    2, 248, 47, 33, 6, 27, 217, 24, 215, 179, 33, 4, 27, 217, 24, 215, 179, 
+    33, 6, 1, 250, 140, 2, 248, 47, 33, 4, 1, 250, 140, 2, 248, 47, 33, 6, 1, 
+    250, 140, 2, 67, 91, 33, 4, 1, 250, 140, 2, 67, 91, 33, 6, 1, 220, 35, 
+    33, 4, 1, 220, 35, 33, 6, 1, 255, 29, 250, 139, 33, 4, 1, 255, 29, 250, 
+    139, 33, 6, 1, 255, 29, 250, 140, 2, 248, 47, 33, 4, 1, 255, 29, 250, 
+    140, 2, 248, 47, 33, 1, 226, 62, 33, 6, 1, 210, 75, 2, 251, 154, 33, 4, 
+    1, 210, 75, 2, 251, 154, 33, 6, 1, 235, 19, 2, 103, 33, 4, 1, 235, 19, 2, 
+    103, 33, 6, 1, 245, 183, 2, 217, 78, 33, 4, 1, 245, 183, 2, 217, 78, 33, 
+    6, 1, 245, 159, 2, 103, 33, 4, 1, 245, 159, 2, 103, 33, 6, 1, 245, 159, 
+    2, 217, 78, 33, 4, 1, 245, 159, 2, 217, 78, 33, 6, 1, 234, 133, 250, 139, 
+    33, 4, 1, 234, 133, 250, 139, 33, 6, 1, 245, 168, 2, 217, 78, 33, 4, 1, 
+    245, 168, 2, 217, 78, 33, 4, 1, 226, 62, 33, 6, 1, 116, 2, 251, 154, 33, 
+    4, 1, 116, 2, 251, 154, 33, 6, 1, 116, 2, 248, 9, 33, 4, 1, 116, 2, 248, 
+    9, 33, 6, 27, 116, 236, 67, 33, 4, 27, 116, 236, 67, 33, 6, 1, 236, 68, 
+    2, 251, 154, 33, 4, 1, 236, 68, 2, 251, 154, 33, 6, 1, 221, 197, 33, 4, 
+    1, 221, 197, 33, 6, 1, 221, 198, 2, 248, 9, 33, 4, 1, 221, 198, 2, 248, 
+    9, 33, 6, 1, 210, 75, 2, 248, 9, 33, 4, 1, 210, 75, 2, 248, 9, 33, 6, 1, 
+    210, 95, 2, 248, 9, 33, 4, 1, 210, 95, 2, 248, 9, 33, 6, 1, 255, 29, 246, 
+    44, 33, 4, 1, 255, 29, 246, 44, 33, 6, 1, 240, 161, 2, 231, 237, 33, 4, 
+    1, 240, 161, 2, 231, 237, 33, 6, 1, 240, 161, 2, 248, 9, 33, 4, 1, 240, 
+    161, 2, 248, 9, 33, 6, 1, 144, 2, 248, 9, 33, 4, 1, 144, 2, 248, 9, 33, 
+    6, 1, 252, 142, 78, 33, 4, 1, 252, 142, 78, 33, 6, 1, 252, 142, 144, 2, 
+    248, 9, 33, 4, 1, 252, 142, 144, 2, 248, 9, 33, 6, 1, 160, 2, 248, 9, 33, 
+    4, 1, 160, 2, 248, 9, 33, 6, 1, 104, 2, 231, 237, 33, 4, 1, 104, 2, 231, 
+    237, 33, 6, 1, 104, 2, 248, 9, 33, 4, 1, 104, 2, 248, 9, 33, 6, 1, 104, 
+    2, 52, 142, 33, 4, 1, 104, 2, 52, 142, 33, 6, 1, 250, 140, 2, 248, 9, 33, 
+    4, 1, 250, 140, 2, 248, 9, 33, 6, 1, 242, 244, 2, 248, 47, 33, 4, 1, 242, 
+    244, 2, 248, 47, 33, 6, 1, 211, 28, 2, 248, 9, 33, 4, 1, 211, 28, 2, 248, 
+    9, 33, 6, 1, 242, 244, 2, 218, 105, 22, 103, 33, 4, 1, 242, 244, 2, 218, 
+    105, 22, 103, 33, 6, 1, 242, 56, 2, 103, 33, 4, 1, 242, 56, 2, 103, 33, 
+    6, 1, 242, 56, 2, 91, 33, 4, 1, 242, 56, 2, 91, 33, 6, 1, 234, 20, 248, 
+    98, 33, 4, 1, 234, 20, 248, 98, 33, 6, 1, 234, 20, 247, 170, 33, 4, 1, 
+    234, 20, 247, 170, 33, 6, 1, 234, 20, 210, 27, 33, 4, 1, 234, 20, 210, 
+    27, 33, 6, 1, 234, 20, 246, 38, 33, 4, 1, 234, 20, 246, 38, 33, 6, 1, 
+    234, 20, 232, 193, 33, 4, 1, 234, 20, 232, 193, 33, 6, 1, 234, 20, 228, 
+    183, 33, 4, 1, 234, 20, 228, 183, 33, 6, 1, 234, 20, 219, 111, 33, 4, 1, 
+    234, 20, 219, 111, 33, 6, 1, 234, 20, 216, 61, 33, 4, 1, 234, 20, 216, 
+    61, 33, 6, 1, 223, 52, 210, 94, 33, 4, 1, 223, 52, 210, 94, 33, 6, 1, 
+    245, 183, 2, 103, 33, 4, 1, 245, 183, 2, 103, 33, 6, 1, 233, 4, 33, 4, 1, 
+    233, 4, 33, 6, 1, 223, 42, 33, 4, 1, 223, 42, 33, 6, 1, 211, 92, 33, 4, 
+    1, 211, 92, 33, 6, 1, 224, 91, 33, 4, 1, 224, 91, 33, 6, 1, 212, 22, 33, 
+    4, 1, 212, 22, 33, 6, 1, 254, 175, 176, 33, 4, 1, 254, 175, 176, 33, 6, 
+    1, 245, 183, 2, 230, 229, 103, 33, 4, 1, 245, 183, 2, 230, 229, 103, 33, 
+    6, 1, 245, 159, 2, 230, 229, 103, 33, 4, 1, 245, 159, 2, 230, 229, 103, 
+    33, 6, 1, 225, 225, 2, 248, 47, 33, 4, 1, 225, 225, 2, 248, 47, 33, 6, 1, 
+    220, 36, 2, 248, 47, 33, 4, 1, 220, 36, 2, 248, 47, 150, 6, 1, 253, 172, 
+    150, 6, 1, 252, 47, 150, 6, 1, 242, 210, 150, 6, 1, 248, 229, 150, 6, 1, 
+    245, 221, 150, 6, 1, 210, 116, 150, 6, 1, 245, 205, 150, 6, 1, 245, 73, 
+    150, 6, 1, 112, 150, 6, 1, 210, 74, 150, 6, 1, 235, 234, 150, 6, 1, 232, 
+    196, 150, 6, 1, 211, 160, 150, 6, 1, 251, 41, 150, 6, 1, 234, 171, 150, 
+    6, 1, 241, 75, 150, 6, 1, 235, 147, 150, 6, 1, 242, 253, 150, 6, 1, 250, 
+    134, 150, 6, 1, 231, 63, 150, 6, 1, 211, 8, 150, 6, 1, 228, 44, 150, 6, 
+    1, 220, 104, 150, 6, 1, 213, 138, 150, 6, 1, 250, 165, 150, 6, 1, 225, 
+    208, 150, 6, 1, 235, 116, 150, 6, 1, 205, 150, 6, 1, 221, 163, 150, 6, 1, 
+    213, 179, 150, 6, 1, 216, 63, 150, 6, 1, 223, 98, 150, 6, 1, 249, 246, 
+    150, 6, 1, 210, 249, 150, 6, 1, 225, 49, 150, 6, 1, 234, 182, 150, 6, 1, 
+    226, 226, 150, 6, 1, 244, 150, 150, 58, 1, 43, 163, 222, 236, 150, 254, 
+    65, 150, 245, 162, 79, 150, 245, 39, 79, 150, 249, 227, 150, 224, 16, 79, 
+    150, 255, 30, 79, 150, 4, 1, 253, 172, 150, 4, 1, 252, 47, 150, 4, 1, 
+    242, 210, 150, 4, 1, 248, 229, 150, 4, 1, 245, 221, 150, 4, 1, 210, 116, 
+    150, 4, 1, 245, 205, 150, 4, 1, 245, 73, 150, 4, 1, 112, 150, 4, 1, 210, 
+    74, 150, 4, 1, 235, 234, 150, 4, 1, 232, 196, 150, 4, 1, 211, 160, 150, 
+    4, 1, 251, 41, 150, 4, 1, 234, 171, 150, 4, 1, 241, 75, 150, 4, 1, 235, 
+    147, 150, 4, 1, 242, 253, 150, 4, 1, 250, 134, 150, 4, 1, 231, 63, 150, 
+    4, 1, 211, 8, 150, 4, 1, 228, 44, 150, 4, 1, 220, 104, 150, 4, 1, 213, 
+    138, 150, 4, 1, 250, 165, 150, 4, 1, 225, 208, 150, 4, 1, 235, 116, 150, 
+    4, 1, 205, 150, 4, 1, 221, 163, 150, 4, 1, 213, 179, 150, 4, 1, 216, 63, 
+    150, 4, 1, 223, 98, 150, 4, 1, 249, 246, 150, 4, 1, 210, 249, 150, 4, 1, 
+    225, 49, 150, 4, 1, 234, 182, 150, 4, 1, 226, 226, 150, 4, 1, 244, 150, 
+    150, 4, 27, 245, 222, 210, 249, 150, 243, 236, 218, 131, 150, 240, 175, 
+    150, 246, 103, 50, 94, 255, 24, 245, 65, 94, 255, 24, 221, 164, 94, 255, 
+    24, 220, 90, 94, 255, 24, 210, 104, 224, 74, 94, 255, 24, 210, 104, 243, 
+    132, 94, 255, 24, 216, 76, 94, 255, 24, 223, 50, 94, 255, 24, 210, 103, 
+    94, 255, 24, 225, 249, 94, 255, 24, 211, 20, 94, 255, 24, 216, 215, 94, 
+    255, 24, 243, 48, 94, 255, 24, 243, 49, 230, 74, 94, 255, 24, 243, 46, 
+    94, 255, 24, 224, 75, 226, 20, 94, 255, 24, 216, 254, 243, 63, 94, 255, 
+    24, 225, 230, 94, 255, 24, 253, 208, 242, 48, 94, 255, 24, 230, 84, 94, 
+    255, 24, 231, 213, 94, 255, 24, 231, 54, 94, 255, 24, 231, 55, 234, 183, 
+    94, 255, 24, 248, 171, 94, 255, 24, 224, 86, 94, 255, 24, 216, 254, 224, 
+    70, 94, 255, 24, 211, 30, 252, 48, 210, 230, 94, 255, 24, 226, 211, 94, 
+    255, 24, 236, 26, 94, 255, 24, 248, 78, 94, 255, 24, 210, 33, 94, 164, 
+    231, 148, 250, 43, 94, 225, 14, 220, 38, 94, 225, 14, 242, 1, 221, 164, 
+    94, 225, 14, 242, 1, 225, 243, 94, 225, 14, 242, 1, 224, 79, 94, 225, 14, 
+    241, 165, 94, 225, 14, 215, 177, 94, 225, 14, 221, 164, 94, 225, 14, 225, 
+    243, 94, 225, 14, 224, 79, 94, 225, 14, 241, 68, 94, 225, 14, 241, 69, 
+    242, 3, 31, 214, 3, 94, 225, 14, 224, 20, 94, 225, 14, 248, 216, 177, 
+    231, 176, 94, 225, 14, 231, 43, 94, 224, 144, 231, 173, 94, 225, 14, 223, 
+    172, 94, 224, 144, 225, 251, 94, 225, 14, 220, 23, 247, 128, 94, 225, 14, 
+    219, 161, 247, 128, 94, 224, 144, 219, 55, 225, 245, 94, 164, 214, 160, 
+    247, 128, 94, 164, 232, 114, 247, 128, 94, 224, 144, 227, 199, 242, 47, 
+    94, 225, 14, 224, 80, 224, 74, 94, 1, 254, 179, 94, 1, 252, 36, 94, 1, 
+    242, 208, 94, 1, 248, 197, 94, 1, 241, 245, 94, 1, 214, 3, 94, 1, 210, 
+    97, 94, 1, 241, 204, 94, 1, 216, 231, 94, 1, 210, 233, 94, 1, 40, 235, 0, 
+    94, 1, 235, 0, 94, 1, 233, 100, 94, 1, 40, 231, 70, 94, 1, 231, 70, 94, 
+    1, 40, 227, 198, 94, 1, 227, 198, 94, 1, 221, 251, 94, 1, 253, 170, 94, 
+    1, 40, 225, 224, 94, 1, 225, 224, 94, 1, 40, 215, 180, 94, 1, 215, 180, 
+    94, 1, 224, 42, 94, 1, 223, 70, 94, 1, 220, 22, 94, 1, 217, 39, 94, 27, 
+    211, 6, 52, 214, 3, 94, 27, 211, 6, 214, 4, 210, 233, 94, 27, 211, 6, 52, 
+    210, 233, 94, 224, 144, 243, 48, 94, 224, 144, 243, 46, 9, 54, 50, 9, 5, 
+    221, 244, 9, 244, 38, 231, 159, 9, 5, 222, 25, 9, 5, 221, 247, 254, 45, 
+    249, 117, 222, 195, 254, 45, 244, 12, 222, 195, 9, 223, 137, 254, 45, 
+    225, 186, 230, 198, 50, 254, 45, 225, 186, 216, 249, 216, 149, 50, 254, 
+    230, 50, 9, 249, 227, 9, 248, 158, 220, 139, 9, 225, 16, 213, 241, 50, 9, 
+    5, 230, 179, 9, 5, 222, 5, 254, 181, 212, 45, 9, 5, 254, 181, 253, 229, 
+    9, 5, 223, 170, 254, 180, 9, 5, 223, 178, 254, 161, 254, 112, 9, 5, 217, 
+    71, 9, 4, 125, 217, 81, 9, 4, 125, 27, 109, 2, 233, 109, 2, 211, 43, 9, 
+    4, 125, 210, 108, 9, 4, 244, 173, 9, 4, 248, 192, 9, 4, 234, 211, 9, 220, 
+    152, 9, 1, 79, 9, 215, 212, 59, 224, 144, 79, 9, 224, 16, 79, 9, 1, 234, 
+    215, 211, 43, 9, 1, 242, 26, 9, 1, 109, 2, 231, 233, 48, 9, 1, 109, 2, 
+    182, 48, 9, 1, 212, 31, 2, 182, 48, 9, 1, 109, 2, 182, 51, 9, 1, 77, 2, 
+    182, 48, 9, 1, 254, 179, 9, 1, 252, 62, 9, 1, 217, 9, 231, 169, 9, 1, 
+    217, 8, 9, 1, 216, 193, 9, 1, 235, 129, 9, 1, 242, 44, 9, 1, 234, 135, 9, 
+    1, 248, 203, 9, 1, 216, 203, 9, 1, 223, 98, 9, 1, 210, 108, 9, 1, 221, 
+    168, 9, 1, 220, 61, 9, 1, 222, 28, 9, 1, 248, 224, 9, 1, 217, 81, 9, 1, 
+    210, 111, 9, 1, 254, 205, 9, 1, 242, 251, 9, 1, 234, 181, 2, 113, 170, 
+    48, 9, 1, 234, 181, 2, 134, 170, 51, 9, 1, 244, 176, 77, 2, 235, 200, 
+    214, 105, 9, 1, 244, 176, 77, 2, 113, 170, 48, 9, 1, 244, 176, 77, 2, 
+    134, 170, 48, 9, 217, 44, 9, 1, 244, 150, 9, 1, 224, 84, 9, 1, 235, 0, 9, 
+    1, 233, 108, 9, 1, 231, 83, 9, 1, 228, 67, 9, 1, 241, 225, 9, 1, 212, 30, 
+    9, 1, 109, 231, 197, 9, 1, 211, 43, 9, 244, 171, 9, 248, 190, 9, 234, 
+    209, 9, 244, 173, 9, 248, 192, 9, 234, 211, 9, 220, 95, 9, 218, 46, 9, 
+    231, 231, 48, 9, 182, 48, 9, 182, 51, 9, 218, 66, 254, 179, 9, 235, 200, 
+    248, 192, 9, 164, 228, 68, 242, 225, 9, 209, 255, 9, 25, 5, 4, 214, 106, 
+    48, 9, 25, 5, 235, 200, 4, 214, 106, 48, 9, 25, 5, 59, 51, 9, 223, 52, 
+    248, 192, 9, 244, 174, 2, 113, 247, 126, 9, 212, 32, 182, 51, 254, 45, 
+    21, 210, 86, 254, 45, 21, 111, 254, 45, 21, 105, 254, 45, 21, 158, 254, 
+    45, 21, 161, 254, 45, 21, 190, 254, 45, 21, 195, 254, 45, 21, 199, 254, 
+    45, 21, 196, 254, 45, 21, 201, 9, 225, 185, 50, 9, 248, 91, 220, 139, 9, 
+    216, 147, 220, 139, 9, 244, 89, 225, 12, 218, 158, 9, 1, 247, 127, 252, 
+    62, 9, 1, 247, 127, 224, 84, 9, 1, 218, 24, 254, 179, 9, 1, 109, 212, 46, 
+    9, 1, 109, 2, 212, 32, 182, 48, 9, 1, 109, 2, 212, 32, 182, 51, 9, 1, 
+    125, 242, 26, 9, 1, 125, 182, 254, 179, 9, 1, 125, 182, 212, 30, 9, 1, 
+    104, 2, 182, 48, 9, 1, 125, 182, 211, 43, 9, 1, 215, 149, 9, 1, 215, 147, 
+    9, 1, 252, 72, 9, 1, 217, 9, 2, 222, 236, 9, 1, 217, 9, 2, 134, 170, 72, 
+    246, 111, 9, 1, 225, 208, 9, 1, 217, 6, 9, 1, 252, 60, 9, 1, 122, 2, 182, 
+    48, 9, 1, 122, 2, 113, 170, 67, 48, 9, 1, 227, 157, 9, 1, 246, 51, 9, 1, 
+    122, 2, 134, 170, 48, 9, 1, 217, 27, 9, 1, 217, 25, 9, 1, 248, 138, 9, 1, 
+    248, 204, 2, 222, 236, 9, 1, 248, 204, 2, 59, 51, 9, 1, 248, 204, 2, 59, 
+    252, 51, 22, 4, 217, 81, 9, 1, 248, 209, 9, 1, 248, 140, 9, 1, 246, 78, 
+    9, 1, 248, 204, 2, 134, 170, 72, 246, 111, 9, 1, 248, 204, 2, 244, 19, 
+    170, 48, 9, 1, 222, 173, 9, 1, 223, 99, 2, 4, 214, 105, 9, 1, 223, 99, 2, 
+    222, 236, 9, 1, 223, 99, 2, 59, 51, 9, 1, 223, 99, 2, 4, 214, 106, 51, 9, 
+    1, 223, 99, 2, 59, 252, 51, 22, 59, 48, 9, 1, 223, 99, 2, 113, 170, 48, 
+    9, 1, 235, 126, 9, 1, 223, 99, 2, 244, 19, 170, 48, 9, 1, 221, 169, 2, 
+    59, 252, 51, 22, 59, 48, 9, 1, 221, 169, 2, 134, 170, 51, 9, 1, 221, 169, 
+    2, 134, 170, 252, 51, 22, 134, 170, 48, 9, 1, 222, 29, 2, 113, 170, 51, 
+    9, 1, 222, 29, 2, 134, 170, 48, 9, 1, 217, 82, 2, 134, 170, 48, 9, 1, 
+    254, 206, 2, 134, 170, 48, 9, 1, 247, 127, 244, 150, 9, 1, 244, 151, 2, 
+    59, 230, 114, 51, 9, 1, 244, 151, 2, 59, 51, 9, 1, 213, 248, 9, 1, 244, 
+    151, 2, 134, 170, 51, 9, 1, 225, 206, 9, 1, 224, 85, 2, 59, 48, 9, 1, 
+    224, 85, 2, 134, 170, 48, 9, 1, 234, 180, 9, 1, 217, 251, 235, 0, 9, 1, 
+    235, 1, 2, 222, 236, 9, 1, 235, 1, 2, 59, 48, 9, 1, 229, 84, 9, 1, 235, 
+    1, 2, 134, 170, 51, 9, 1, 243, 129, 9, 1, 243, 130, 2, 222, 236, 9, 1, 
+    229, 7, 9, 1, 243, 130, 2, 113, 170, 51, 9, 1, 242, 108, 9, 1, 243, 130, 
+    2, 134, 170, 48, 9, 1, 233, 109, 2, 4, 214, 105, 9, 1, 233, 109, 2, 59, 
+    48, 9, 1, 233, 109, 2, 134, 170, 48, 9, 1, 233, 109, 2, 134, 170, 51, 9, 
+    1, 228, 68, 2, 59, 51, 9, 1, 228, 68, 242, 225, 9, 1, 222, 216, 9, 1, 
+    228, 68, 2, 222, 236, 9, 1, 228, 68, 2, 134, 170, 48, 9, 1, 241, 226, 
+    247, 149, 9, 1, 217, 28, 2, 59, 48, 9, 1, 241, 226, 2, 77, 48, 9, 1, 241, 
+    226, 242, 178, 9, 1, 241, 226, 242, 179, 2, 182, 48, 9, 1, 217, 9, 231, 
+    170, 242, 178, 9, 1, 212, 31, 2, 222, 236, 9, 1, 234, 79, 226, 238, 9, 1, 
+    226, 238, 9, 1, 69, 9, 1, 210, 212, 9, 1, 234, 79, 210, 212, 9, 1, 212, 
+    31, 2, 113, 170, 48, 9, 1, 213, 255, 9, 1, 244, 176, 211, 43, 9, 1, 77, 
+    2, 217, 78, 9, 1, 77, 2, 4, 214, 105, 9, 1, 212, 31, 2, 59, 48, 9, 1, 76, 
+    9, 1, 77, 2, 134, 170, 51, 9, 1, 77, 252, 140, 9, 1, 77, 252, 141, 2, 
+    182, 48, 9, 243, 236, 218, 131, 9, 1, 254, 252, 9, 4, 125, 27, 222, 29, 
+    2, 233, 109, 2, 109, 231, 197, 9, 4, 125, 27, 224, 85, 2, 233, 109, 2, 
+    109, 231, 197, 9, 4, 125, 66, 65, 17, 9, 4, 125, 233, 109, 254, 179, 9, 
+    4, 125, 235, 129, 9, 4, 125, 134, 247, 126, 9, 4, 125, 221, 168, 9, 245, 
+    151, 64, 253, 174, 9, 218, 154, 64, 222, 140, 245, 183, 241, 162, 9, 4, 
+    125, 222, 185, 210, 86, 9, 4, 125, 214, 159, 223, 118, 210, 86, 9, 4, 
+    125, 247, 127, 241, 243, 64, 234, 135, 9, 4, 125, 66, 53, 17, 9, 4, 121, 
+    221, 168, 9, 4, 125, 231, 232, 9, 4, 212, 30, 9, 4, 211, 43, 9, 4, 125, 
+    211, 43, 9, 4, 125, 228, 67, 9, 225, 44, 64, 222, 15, 9, 245, 160, 250, 
+    183, 121, 218, 131, 9, 245, 160, 250, 183, 125, 218, 131, 9, 222, 185, 
+    125, 218, 132, 2, 244, 112, 250, 182, 9, 4, 121, 231, 83, 9, 1, 248, 204, 
+    2, 235, 200, 214, 105, 9, 1, 223, 99, 2, 235, 200, 214, 105, 245, 30, 
+    254, 45, 21, 210, 86, 245, 30, 254, 45, 21, 111, 245, 30, 254, 45, 21, 
+    105, 245, 30, 254, 45, 21, 158, 245, 30, 254, 45, 21, 161, 245, 30, 254, 
+    45, 21, 190, 245, 30, 254, 45, 21, 195, 245, 30, 254, 45, 21, 199, 245, 
+    30, 254, 45, 21, 196, 245, 30, 254, 45, 21, 201, 9, 1, 220, 62, 2, 59, 
+    51, 9, 1, 248, 225, 2, 59, 51, 9, 1, 242, 252, 2, 59, 51, 9, 5, 219, 160, 
+    254, 134, 9, 5, 219, 160, 224, 238, 231, 63, 9, 1, 241, 226, 2, 235, 200, 
+    214, 105, 183, 245, 151, 64, 226, 18, 183, 218, 20, 243, 236, 218, 131, 
+    183, 218, 68, 243, 236, 218, 131, 183, 218, 20, 249, 234, 183, 218, 68, 
+    249, 234, 183, 203, 249, 234, 183, 249, 235, 219, 108, 233, 52, 183, 249, 
+    235, 219, 108, 222, 254, 183, 218, 20, 249, 235, 219, 108, 233, 52, 183, 
+    218, 68, 249, 235, 219, 108, 222, 254, 183, 249, 188, 183, 242, 8, 226, 
+    254, 183, 242, 8, 231, 41, 183, 242, 8, 253, 226, 183, 255, 30, 79, 183, 
+    1, 254, 183, 183, 1, 218, 24, 254, 183, 183, 1, 252, 33, 183, 1, 243, 
+    120, 183, 1, 243, 121, 243, 98, 183, 1, 248, 200, 183, 1, 247, 127, 248, 
+    201, 222, 232, 183, 1, 241, 245, 183, 1, 212, 30, 183, 1, 210, 108, 183, 
+    1, 241, 202, 183, 1, 216, 227, 183, 1, 216, 228, 243, 98, 183, 1, 210, 
+    199, 183, 1, 210, 200, 241, 245, 183, 1, 234, 231, 183, 1, 233, 107, 183, 
+    1, 230, 195, 183, 1, 227, 198, 183, 1, 220, 145, 183, 1, 40, 220, 145, 
+    183, 1, 76, 183, 1, 225, 224, 183, 1, 223, 52, 225, 224, 183, 1, 222, 26, 
+    183, 1, 224, 78, 183, 1, 222, 232, 183, 1, 220, 22, 183, 1, 217, 37, 183, 
+    1, 225, 172, 252, 20, 183, 1, 225, 172, 242, 249, 183, 1, 225, 172, 248, 
+    28, 183, 224, 154, 48, 183, 224, 154, 51, 183, 224, 154, 246, 125, 183, 
+    210, 17, 48, 183, 210, 17, 51, 183, 210, 17, 246, 125, 183, 223, 134, 48, 
+    183, 223, 134, 51, 183, 246, 126, 210, 24, 241, 51, 183, 246, 126, 210, 
+    24, 254, 113, 183, 241, 248, 48, 183, 241, 248, 51, 183, 241, 247, 246, 
+    125, 183, 245, 87, 48, 183, 245, 87, 51, 183, 222, 109, 183, 244, 144, 
+    247, 128, 183, 223, 251, 183, 222, 136, 183, 113, 67, 170, 48, 183, 113, 
+    67, 170, 51, 183, 134, 170, 48, 183, 134, 170, 51, 183, 226, 252, 232, 
+    220, 48, 183, 226, 252, 232, 220, 51, 183, 230, 61, 183, 252, 139, 183, 
+    1, 219, 51, 210, 80, 183, 1, 219, 51, 234, 128, 183, 1, 219, 51, 244, 
+    162, 9, 1, 252, 63, 2, 134, 170, 241, 1, 51, 9, 1, 252, 63, 2, 59, 252, 
+    51, 22, 134, 170, 48, 9, 1, 252, 63, 2, 134, 170, 225, 10, 214, 153, 51, 
+    9, 1, 252, 63, 2, 134, 170, 225, 10, 214, 153, 252, 51, 22, 113, 170, 48, 
+    9, 1, 252, 63, 2, 113, 170, 252, 51, 22, 59, 48, 9, 1, 252, 63, 2, 235, 
+    200, 4, 214, 106, 51, 9, 1, 252, 63, 2, 4, 214, 105, 9, 1, 122, 2, 113, 
+    170, 48, 9, 1, 122, 2, 134, 170, 225, 10, 214, 153, 51, 9, 1, 248, 204, 
+    2, 113, 170, 213, 189, 252, 51, 22, 4, 217, 81, 9, 1, 248, 204, 2, 235, 
+    200, 4, 214, 106, 51, 9, 1, 223, 99, 2, 91, 9, 1, 221, 169, 2, 244, 19, 
+    170, 48, 9, 1, 254, 206, 2, 113, 170, 48, 9, 1, 254, 206, 2, 134, 170, 
+    225, 10, 246, 112, 48, 9, 1, 254, 206, 2, 113, 170, 213, 189, 48, 9, 1, 
+    244, 151, 2, 113, 170, 51, 9, 1, 244, 151, 2, 134, 170, 225, 10, 214, 
+    153, 51, 9, 1, 234, 181, 2, 59, 48, 9, 1, 234, 181, 2, 134, 170, 48, 9, 
+    1, 234, 181, 2, 134, 170, 225, 10, 214, 153, 51, 9, 1, 66, 2, 59, 48, 9, 
+    1, 66, 2, 59, 51, 9, 1, 228, 68, 2, 113, 170, 51, 9, 1, 228, 68, 2, 4, 
+    217, 81, 9, 1, 228, 68, 2, 4, 214, 105, 9, 1, 233, 109, 2, 130, 9, 1, 
+    223, 99, 2, 113, 170, 213, 189, 48, 9, 1, 223, 99, 2, 182, 48, 9, 1, 221, 
+    169, 2, 113, 170, 213, 189, 48, 9, 1, 122, 2, 4, 9, 1, 217, 82, 51, 9, 1, 
+    122, 2, 4, 9, 1, 217, 82, 22, 113, 247, 126, 9, 1, 221, 169, 2, 4, 9, 1, 
+    217, 82, 22, 113, 247, 126, 9, 1, 223, 99, 2, 4, 9, 1, 217, 82, 22, 113, 
+    247, 126, 9, 1, 122, 2, 4, 9, 1, 217, 82, 48, 9, 1, 109, 2, 245, 30, 254, 
+    45, 21, 113, 48, 9, 1, 109, 2, 245, 30, 254, 45, 21, 134, 48, 9, 1, 244, 
+    176, 77, 2, 245, 30, 254, 45, 21, 113, 48, 9, 1, 244, 176, 77, 2, 245, 
+    30, 254, 45, 21, 134, 48, 9, 1, 244, 176, 77, 2, 245, 30, 254, 45, 21, 
+    244, 19, 51, 9, 1, 212, 31, 2, 245, 30, 254, 45, 21, 113, 48, 9, 1, 212, 
+    31, 2, 245, 30, 254, 45, 21, 134, 48, 9, 1, 77, 252, 141, 2, 245, 30, 
+    254, 45, 21, 113, 48, 9, 1, 77, 252, 141, 2, 245, 30, 254, 45, 21, 134, 
+    48, 9, 1, 122, 2, 245, 30, 254, 45, 21, 244, 19, 51, 9, 1, 221, 169, 2, 
+    245, 30, 254, 45, 21, 244, 19, 48, 9, 1, 221, 169, 2, 235, 200, 214, 105, 
+    9, 1, 235, 1, 2, 113, 170, 48, 216, 206, 1, 242, 53, 216, 206, 1, 220, 
+    70, 216, 206, 1, 228, 66, 216, 206, 1, 223, 187, 216, 206, 1, 252, 197, 
+    216, 206, 1, 233, 1, 216, 206, 1, 235, 14, 216, 206, 1, 254, 168, 216, 
+    206, 1, 214, 25, 216, 206, 1, 231, 82, 216, 206, 1, 244, 202, 216, 206, 
+    1, 248, 31, 216, 206, 1, 216, 208, 216, 206, 1, 233, 137, 216, 206, 1, 
+    243, 138, 216, 206, 1, 242, 184, 216, 206, 1, 221, 167, 216, 206, 1, 248, 
+    156, 216, 206, 1, 210, 100, 216, 206, 1, 217, 38, 216, 206, 1, 211, 103, 
+    216, 206, 1, 225, 237, 216, 206, 1, 235, 134, 216, 206, 1, 250, 142, 216, 
+    206, 1, 215, 156, 216, 206, 1, 241, 195, 216, 206, 1, 234, 137, 216, 206, 
+    1, 216, 207, 216, 206, 1, 210, 115, 216, 206, 1, 220, 60, 216, 206, 1, 
+    222, 32, 216, 206, 1, 248, 227, 216, 206, 1, 112, 216, 206, 1, 210, 23, 
+    216, 206, 1, 254, 202, 216, 206, 1, 242, 250, 216, 206, 1, 224, 88, 216, 
+    206, 1, 212, 63, 216, 206, 255, 31, 216, 206, 255, 47, 216, 206, 240, 
+    121, 216, 206, 245, 216, 216, 206, 214, 222, 216, 206, 226, 186, 216, 
+    206, 245, 224, 216, 206, 245, 24, 216, 206, 226, 251, 216, 206, 227, 3, 
+    216, 206, 218, 46, 216, 206, 1, 229, 230, 228, 142, 21, 210, 86, 228, 
+    142, 21, 111, 228, 142, 21, 105, 228, 142, 21, 158, 228, 142, 21, 161, 
+    228, 142, 21, 190, 228, 142, 21, 195, 228, 142, 21, 199, 228, 142, 21, 
+    196, 228, 142, 21, 201, 228, 142, 1, 61, 228, 142, 1, 245, 217, 228, 142, 
+    1, 74, 228, 142, 1, 76, 228, 142, 1, 69, 228, 142, 1, 226, 187, 228, 142, 
+    1, 78, 228, 142, 1, 248, 217, 228, 142, 1, 230, 30, 228, 142, 1, 252, 
+    199, 228, 142, 1, 191, 228, 142, 1, 217, 106, 228, 142, 1, 235, 147, 228, 
+    142, 1, 250, 165, 228, 142, 1, 248, 229, 228, 142, 1, 205, 228, 142, 1, 
+    222, 181, 228, 142, 1, 206, 228, 142, 1, 243, 86, 228, 142, 1, 244, 204, 
+    228, 142, 1, 176, 228, 142, 1, 233, 141, 228, 142, 1, 229, 234, 211, 223, 
+    228, 142, 1, 186, 228, 142, 1, 227, 169, 228, 142, 1, 198, 228, 142, 1, 
+    162, 228, 142, 1, 212, 65, 228, 142, 1, 192, 228, 142, 1, 227, 170, 211, 
+    223, 228, 142, 1, 235, 67, 235, 147, 228, 142, 1, 235, 67, 250, 165, 228, 
+    142, 1, 235, 67, 205, 228, 142, 38, 219, 253, 125, 216, 31, 228, 142, 38, 
+    219, 253, 121, 216, 31, 228, 142, 38, 219, 253, 222, 231, 216, 31, 228, 
+    142, 38, 200, 248, 46, 216, 31, 228, 142, 38, 200, 125, 216, 31, 228, 
+    142, 38, 200, 121, 216, 31, 228, 142, 38, 200, 222, 231, 216, 31, 228, 
+    142, 38, 229, 198, 79, 228, 142, 38, 52, 59, 48, 228, 142, 125, 138, 254, 
+    65, 228, 142, 121, 138, 254, 65, 228, 142, 16, 226, 188, 248, 58, 228, 
+    142, 16, 243, 85, 228, 142, 249, 227, 228, 142, 245, 39, 79, 228, 142, 
+    233, 114, 221, 254, 1, 254, 185, 221, 254, 1, 251, 236, 221, 254, 1, 243, 
+    119, 221, 254, 1, 248, 202, 221, 254, 1, 235, 158, 221, 254, 1, 252, 197, 
+    221, 254, 1, 210, 89, 221, 254, 1, 235, 166, 221, 254, 1, 216, 68, 221, 
+    254, 1, 210, 182, 221, 254, 1, 235, 15, 221, 254, 1, 233, 134, 221, 254, 
+    1, 230, 195, 221, 254, 1, 227, 198, 221, 254, 1, 219, 158, 221, 254, 1, 
+    236, 6, 221, 254, 1, 244, 129, 221, 254, 1, 215, 182, 221, 254, 1, 224, 
+    13, 221, 254, 1, 222, 232, 221, 254, 1, 220, 87, 221, 254, 1, 217, 101, 
+    221, 254, 164, 236, 6, 221, 254, 164, 236, 5, 221, 254, 164, 226, 247, 
+    221, 254, 164, 248, 215, 221, 254, 58, 1, 245, 113, 210, 182, 221, 254, 
+    164, 245, 113, 210, 182, 221, 254, 25, 5, 200, 76, 221, 254, 25, 5, 76, 
+    221, 254, 25, 5, 226, 122, 255, 82, 221, 254, 25, 5, 200, 255, 82, 221, 
+    254, 25, 5, 255, 82, 221, 254, 25, 5, 226, 122, 61, 221, 254, 25, 5, 200, 
+    61, 221, 254, 25, 5, 61, 221, 254, 58, 1, 219, 253, 61, 221, 254, 25, 5, 
+    219, 253, 61, 221, 254, 25, 5, 200, 69, 221, 254, 25, 5, 69, 221, 254, 
+    58, 1, 74, 221, 254, 25, 5, 200, 74, 221, 254, 25, 5, 74, 221, 254, 25, 
+    5, 78, 221, 254, 25, 5, 218, 46, 221, 254, 164, 229, 97, 221, 254, 224, 
+    144, 229, 97, 221, 254, 224, 144, 254, 227, 221, 254, 224, 144, 254, 122, 
+    221, 254, 224, 144, 252, 122, 221, 254, 224, 144, 253, 209, 221, 254, 
+    224, 144, 220, 10, 221, 254, 255, 30, 79, 221, 254, 224, 144, 231, 73, 
+    224, 48, 221, 254, 224, 144, 210, 31, 221, 254, 224, 144, 224, 48, 221, 
+    254, 224, 144, 210, 114, 221, 254, 224, 144, 215, 90, 221, 254, 224, 144, 
+    254, 17, 221, 254, 224, 144, 219, 55, 231, 150, 221, 254, 224, 144, 254, 
+    108, 231, 187, 1, 242, 31, 231, 187, 1, 255, 34, 231, 187, 1, 254, 225, 
+    231, 187, 1, 255, 8, 231, 187, 1, 254, 218, 231, 187, 1, 214, 124, 231, 
+    187, 1, 253, 168, 231, 187, 1, 235, 166, 231, 187, 1, 253, 206, 231, 187, 
+    1, 254, 190, 231, 187, 1, 254, 195, 231, 187, 1, 254, 187, 231, 187, 1, 
+    254, 144, 231, 187, 1, 254, 131, 231, 187, 1, 253, 245, 231, 187, 1, 236, 
+    6, 231, 187, 1, 254, 80, 231, 187, 1, 253, 216, 231, 187, 1, 254, 53, 
+    231, 187, 1, 254, 49, 231, 187, 1, 253, 239, 231, 187, 1, 253, 214, 231, 
+    187, 1, 246, 63, 231, 187, 1, 235, 8, 231, 187, 1, 254, 205, 231, 187, 
+    254, 231, 79, 231, 187, 213, 136, 79, 231, 187, 243, 60, 79, 231, 187, 
+    224, 143, 9, 1, 252, 63, 2, 4, 214, 106, 51, 9, 1, 151, 2, 113, 170, 48, 
+    9, 1, 217, 82, 2, 113, 170, 48, 9, 1, 244, 151, 2, 59, 252, 51, 22, 134, 
+    170, 48, 9, 1, 224, 85, 2, 59, 51, 9, 1, 233, 109, 2, 52, 130, 9, 1, 66, 
+    2, 134, 170, 48, 9, 1, 77, 2, 113, 170, 252, 51, 22, 182, 48, 9, 1, 77, 
+    2, 113, 170, 252, 51, 22, 59, 48, 9, 1, 223, 99, 2, 232, 129, 9, 1, 212, 
+    31, 2, 59, 211, 231, 9, 1, 222, 203, 211, 43, 9, 249, 107, 244, 173, 9, 
+    249, 107, 248, 192, 9, 249, 107, 234, 211, 9, 249, 107, 244, 171, 9, 249, 
+    107, 248, 190, 9, 249, 107, 234, 209, 9, 138, 123, 59, 48, 9, 138, 113, 
+    170, 48, 9, 138, 232, 130, 48, 9, 138, 123, 59, 51, 9, 138, 113, 170, 51, 
+    9, 138, 232, 130, 51, 9, 204, 244, 171, 9, 204, 248, 190, 9, 204, 234, 
+    209, 9, 4, 125, 212, 30, 9, 244, 174, 2, 222, 236, 9, 244, 174, 2, 59, 
+    48, 9, 234, 212, 2, 59, 51, 9, 43, 254, 2, 48, 9, 44, 254, 2, 48, 9, 43, 
+    254, 2, 51, 9, 44, 254, 2, 51, 9, 52, 44, 254, 2, 48, 9, 52, 44, 254, 2, 
+    72, 2, 247, 128, 9, 44, 254, 2, 72, 2, 247, 128, 9, 248, 193, 2, 247, 
+    128, 84, 5, 235, 200, 251, 7, 84, 5, 251, 7, 84, 5, 254, 83, 84, 5, 213, 
+    147, 84, 1, 219, 253, 61, 84, 1, 61, 84, 1, 255, 82, 84, 1, 74, 84, 1, 
+    236, 40, 84, 1, 69, 84, 1, 214, 118, 84, 1, 149, 153, 84, 1, 149, 156, 
+    84, 1, 251, 10, 76, 84, 1, 219, 253, 76, 84, 1, 76, 84, 1, 254, 210, 84, 
+    1, 251, 10, 78, 84, 1, 219, 253, 78, 84, 1, 78, 84, 1, 253, 200, 84, 1, 
+    176, 84, 1, 234, 138, 84, 1, 243, 142, 84, 1, 243, 0, 84, 1, 229, 82, 84, 
+    1, 251, 41, 84, 1, 250, 165, 84, 1, 235, 147, 84, 1, 235, 120, 84, 1, 
+    227, 169, 84, 1, 215, 157, 84, 1, 215, 145, 84, 1, 248, 143, 84, 1, 248, 
+    127, 84, 1, 228, 115, 84, 1, 217, 106, 84, 1, 216, 209, 84, 1, 248, 229, 
+    84, 1, 248, 33, 84, 1, 198, 84, 1, 228, 97, 84, 1, 191, 84, 1, 225, 150, 
+    84, 1, 252, 199, 84, 1, 252, 26, 84, 1, 186, 84, 1, 192, 84, 1, 205, 84, 
+    1, 222, 181, 84, 1, 233, 141, 84, 1, 232, 190, 84, 1, 232, 181, 84, 1, 
+    214, 27, 84, 1, 220, 104, 84, 1, 218, 225, 84, 1, 206, 84, 1, 162, 84, 
+    25, 5, 226, 238, 84, 25, 5, 226, 185, 84, 5, 227, 209, 84, 5, 253, 183, 
+    84, 25, 5, 255, 82, 84, 25, 5, 74, 84, 25, 5, 236, 40, 84, 25, 5, 69, 84, 
+    25, 5, 214, 118, 84, 25, 5, 149, 153, 84, 25, 5, 149, 222, 182, 84, 25, 
+    5, 251, 10, 76, 84, 25, 5, 219, 253, 76, 84, 25, 5, 76, 84, 25, 5, 254, 
+    210, 84, 25, 5, 251, 10, 78, 84, 25, 5, 219, 253, 78, 84, 25, 5, 78, 84, 
+    25, 5, 253, 200, 84, 5, 213, 152, 84, 25, 5, 224, 188, 76, 84, 25, 5, 
+    253, 179, 84, 226, 208, 84, 218, 113, 5, 214, 216, 84, 218, 113, 5, 254, 
+    85, 84, 242, 144, 255, 23, 84, 255, 12, 255, 23, 84, 25, 5, 251, 10, 200, 
+    76, 84, 25, 5, 214, 214, 84, 25, 5, 214, 117, 84, 1, 224, 91, 84, 1, 234, 
+    121, 84, 1, 242, 233, 84, 1, 210, 116, 84, 1, 248, 132, 84, 1, 223, 42, 
+    84, 1, 244, 204, 84, 1, 210, 168, 84, 1, 149, 222, 182, 84, 1, 149, 232, 
+    191, 84, 25, 5, 149, 156, 84, 25, 5, 149, 232, 191, 84, 248, 186, 84, 52, 
+    248, 186, 84, 21, 210, 86, 84, 21, 111, 84, 21, 105, 84, 21, 158, 84, 21, 
+    161, 84, 21, 190, 84, 21, 195, 84, 21, 199, 84, 21, 196, 84, 21, 201, 84, 
+    255, 30, 50, 84, 5, 125, 219, 19, 247, 128, 84, 1, 251, 10, 61, 84, 1, 
+    226, 238, 84, 1, 226, 185, 84, 1, 253, 179, 84, 1, 214, 214, 84, 1, 214, 
+    117, 84, 1, 210, 82, 84, 1, 114, 192, 84, 1, 243, 36, 84, 1, 235, 102, 
+    84, 1, 242, 187, 218, 131, 84, 1, 248, 133, 84, 1, 252, 119, 146, 5, 251, 
+    7, 146, 5, 254, 83, 146, 5, 213, 147, 146, 1, 61, 146, 1, 255, 82, 146, 
+    1, 74, 146, 1, 236, 40, 146, 1, 69, 146, 1, 214, 118, 146, 1, 149, 153, 
+    146, 1, 149, 156, 146, 1, 76, 146, 1, 254, 210, 146, 1, 78, 146, 1, 253, 
+    200, 146, 1, 176, 146, 1, 234, 138, 146, 1, 243, 142, 146, 1, 243, 0, 
+    146, 1, 229, 82, 146, 1, 251, 41, 146, 1, 250, 165, 146, 1, 235, 147, 
+    146, 1, 235, 120, 146, 1, 227, 169, 146, 1, 215, 157, 146, 1, 215, 145, 
+    146, 1, 248, 143, 146, 1, 248, 127, 146, 1, 228, 115, 146, 1, 217, 106, 
+    146, 1, 216, 209, 146, 1, 248, 229, 146, 1, 248, 33, 146, 1, 198, 146, 1, 
+    191, 146, 1, 225, 150, 146, 1, 252, 199, 146, 1, 252, 26, 146, 1, 186, 
+    146, 1, 192, 146, 1, 205, 146, 1, 233, 141, 146, 1, 220, 104, 146, 1, 
+    218, 225, 146, 1, 206, 146, 1, 162, 146, 5, 227, 209, 146, 5, 253, 183, 
+    146, 25, 5, 255, 82, 146, 25, 5, 74, 146, 25, 5, 236, 40, 146, 25, 5, 69, 
+    146, 25, 5, 214, 118, 146, 25, 5, 149, 153, 146, 25, 5, 149, 222, 182, 
+    146, 25, 5, 76, 146, 25, 5, 254, 210, 146, 25, 5, 78, 146, 25, 5, 253, 
+    200, 146, 5, 213, 152, 146, 1, 234, 130, 217, 106, 146, 253, 201, 233, 
+    29, 79, 146, 1, 222, 181, 146, 1, 223, 42, 146, 1, 210, 168, 146, 1, 149, 
+    222, 182, 146, 1, 149, 232, 191, 146, 25, 5, 149, 156, 146, 25, 5, 149, 
+    232, 191, 146, 21, 210, 86, 146, 21, 111, 146, 21, 105, 146, 21, 158, 
+    146, 21, 161, 146, 21, 190, 146, 21, 195, 146, 21, 199, 146, 21, 196, 
+    146, 21, 201, 146, 1, 223, 191, 2, 230, 229, 248, 6, 146, 1, 223, 191, 2, 
+    232, 114, 248, 6, 146, 222, 120, 79, 146, 222, 120, 50, 146, 249, 106, 
+    227, 201, 111, 146, 249, 106, 227, 201, 105, 146, 249, 106, 227, 201, 
+    158, 146, 249, 106, 227, 201, 161, 146, 249, 106, 227, 201, 123, 233, 22, 
+    216, 202, 216, 197, 248, 56, 146, 249, 106, 248, 57, 219, 121, 146, 235, 
+    167, 146, 243, 110, 79, 185, 5, 255, 7, 251, 251, 185, 5, 251, 251, 185, 
+    5, 213, 147, 185, 1, 61, 185, 1, 255, 82, 185, 1, 74, 185, 1, 236, 40, 
+    185, 1, 69, 185, 1, 214, 118, 185, 1, 245, 217, 185, 1, 254, 210, 185, 1, 
+    226, 187, 185, 1, 253, 200, 185, 1, 176, 185, 1, 234, 138, 185, 1, 243, 
+    142, 185, 1, 243, 0, 185, 1, 229, 82, 185, 1, 251, 41, 185, 1, 250, 165, 
+    185, 1, 235, 147, 185, 1, 235, 120, 185, 1, 227, 169, 185, 1, 215, 157, 
+    185, 1, 215, 145, 185, 1, 248, 143, 185, 1, 248, 127, 185, 1, 228, 115, 
+    185, 1, 217, 106, 185, 1, 216, 209, 185, 1, 248, 229, 185, 1, 248, 33, 
+    185, 1, 198, 185, 1, 191, 185, 1, 225, 150, 185, 1, 252, 199, 185, 1, 
+    252, 26, 185, 1, 186, 185, 1, 192, 185, 1, 205, 185, 1, 233, 141, 185, 1, 
+    232, 190, 185, 1, 214, 27, 185, 1, 220, 104, 185, 1, 206, 185, 1, 162, 
+    185, 5, 227, 209, 185, 25, 5, 255, 82, 185, 25, 5, 74, 185, 25, 5, 236, 
+    40, 185, 25, 5, 69, 185, 25, 5, 214, 118, 185, 25, 5, 245, 217, 185, 25, 
+    5, 254, 210, 185, 25, 5, 226, 187, 185, 25, 5, 253, 200, 185, 5, 213, 
+    152, 185, 5, 214, 218, 185, 1, 234, 121, 185, 1, 242, 233, 185, 1, 210, 
+    116, 185, 1, 222, 181, 185, 1, 244, 204, 185, 21, 210, 86, 185, 21, 111, 
+    185, 21, 105, 185, 21, 158, 185, 21, 161, 185, 21, 190, 185, 21, 195, 
+    185, 21, 199, 185, 21, 196, 185, 21, 201, 185, 216, 75, 185, 255, 6, 185, 
+    235, 185, 185, 214, 146, 185, 245, 189, 226, 192, 185, 5, 211, 78, 171, 
+    5, 251, 7, 171, 5, 254, 83, 171, 5, 213, 147, 171, 1, 61, 171, 1, 255, 
+    82, 171, 1, 74, 171, 1, 236, 40, 171, 1, 69, 171, 1, 214, 118, 171, 1, 
+    149, 153, 171, 1, 149, 156, 171, 25, 251, 10, 76, 171, 1, 76, 171, 1, 
+    254, 210, 171, 25, 251, 10, 78, 171, 1, 78, 171, 1, 253, 200, 171, 1, 
+    176, 171, 1, 234, 138, 171, 1, 243, 142, 171, 1, 243, 0, 171, 1, 229, 82, 
+    171, 1, 251, 41, 171, 1, 250, 165, 171, 1, 235, 147, 171, 1, 235, 120, 
+    171, 1, 227, 169, 171, 1, 215, 157, 171, 1, 215, 145, 171, 1, 248, 143, 
+    171, 1, 248, 127, 171, 1, 228, 115, 171, 1, 217, 106, 171, 1, 216, 209, 
+    171, 1, 248, 229, 171, 1, 248, 33, 171, 1, 198, 171, 1, 191, 171, 1, 225, 
+    150, 171, 1, 252, 199, 171, 1, 252, 26, 171, 1, 186, 171, 1, 192, 171, 1, 
+    205, 171, 1, 233, 141, 171, 1, 232, 190, 171, 1, 214, 27, 171, 1, 220, 
+    104, 171, 1, 218, 225, 171, 1, 206, 171, 1, 162, 171, 5, 227, 209, 171, 
+    5, 253, 183, 171, 25, 5, 255, 82, 171, 25, 5, 74, 171, 25, 5, 236, 40, 
+    171, 25, 5, 69, 171, 25, 5, 214, 118, 171, 25, 5, 149, 153, 171, 25, 5, 
+    149, 222, 182, 171, 25, 5, 251, 10, 76, 171, 25, 5, 76, 171, 25, 5, 254, 
+    210, 171, 25, 5, 251, 10, 78, 171, 25, 5, 78, 171, 25, 5, 253, 200, 171, 
+    5, 213, 152, 171, 226, 208, 171, 1, 149, 222, 182, 171, 1, 149, 232, 191, 
+    171, 25, 5, 149, 156, 171, 25, 5, 149, 232, 191, 171, 21, 210, 86, 171, 
+    21, 111, 171, 21, 105, 171, 21, 158, 171, 21, 161, 171, 21, 190, 171, 21, 
+    195, 171, 21, 199, 171, 21, 196, 171, 21, 201, 171, 255, 30, 50, 171, 
+    222, 120, 50, 157, 5, 251, 7, 157, 5, 254, 83, 157, 5, 213, 147, 157, 1, 
+    61, 157, 1, 255, 82, 157, 1, 74, 157, 1, 236, 40, 157, 1, 69, 157, 1, 
+    214, 118, 157, 1, 149, 153, 157, 1, 149, 156, 157, 1, 76, 157, 1, 254, 
+    210, 157, 1, 78, 157, 1, 253, 200, 157, 1, 176, 157, 1, 234, 138, 157, 1, 
+    243, 142, 157, 1, 243, 0, 157, 1, 229, 82, 157, 1, 251, 41, 157, 1, 250, 
+    165, 157, 1, 235, 147, 157, 1, 235, 120, 157, 1, 227, 169, 157, 1, 215, 
+    157, 157, 1, 215, 145, 157, 1, 248, 143, 157, 1, 248, 127, 157, 1, 228, 
+    115, 157, 1, 217, 106, 157, 1, 216, 209, 157, 1, 248, 229, 157, 1, 248, 
+    33, 157, 1, 198, 157, 1, 191, 157, 1, 225, 150, 157, 1, 252, 199, 157, 1, 
+    252, 26, 157, 1, 186, 157, 1, 192, 157, 1, 205, 157, 1, 233, 141, 157, 1, 
+    232, 190, 157, 1, 214, 27, 157, 1, 220, 104, 157, 1, 218, 225, 157, 1, 
+    206, 157, 1, 162, 157, 5, 227, 209, 157, 5, 253, 183, 157, 25, 5, 255, 
+    82, 157, 25, 5, 74, 157, 25, 5, 236, 40, 157, 25, 5, 69, 157, 25, 5, 214, 
+    118, 157, 25, 5, 149, 153, 157, 25, 5, 149, 222, 182, 157, 25, 5, 76, 
+    157, 25, 5, 254, 210, 157, 25, 5, 78, 157, 25, 5, 253, 200, 157, 5, 213, 
+    152, 157, 254, 211, 233, 29, 79, 157, 253, 201, 233, 29, 79, 157, 1, 222, 
+    181, 157, 1, 223, 42, 157, 1, 210, 168, 157, 1, 149, 222, 182, 157, 1, 
+    149, 232, 191, 157, 25, 5, 149, 156, 157, 25, 5, 149, 232, 191, 157, 21, 
+    210, 86, 157, 21, 111, 157, 21, 105, 157, 21, 158, 157, 21, 161, 157, 21, 
+    190, 157, 21, 195, 157, 21, 199, 157, 21, 196, 157, 21, 201, 157, 235, 
+    167, 157, 1, 212, 65, 157, 244, 10, 123, 224, 24, 157, 244, 10, 123, 242, 
+    34, 157, 244, 10, 134, 224, 22, 157, 244, 10, 123, 219, 119, 157, 244, 
+    10, 123, 245, 196, 157, 244, 10, 134, 219, 118, 36, 5, 254, 83, 36, 5, 
+    213, 147, 36, 1, 61, 36, 1, 255, 82, 36, 1, 74, 36, 1, 236, 40, 36, 1, 
+    69, 36, 1, 214, 118, 36, 1, 76, 36, 1, 245, 217, 36, 1, 254, 210, 36, 1, 
+    78, 36, 1, 226, 187, 36, 1, 253, 200, 36, 1, 176, 36, 1, 229, 82, 36, 1, 
+    251, 41, 36, 1, 235, 147, 36, 1, 227, 169, 36, 1, 215, 157, 36, 1, 228, 
+    115, 36, 1, 217, 106, 36, 1, 198, 36, 1, 228, 97, 36, 1, 191, 36, 1, 186, 
+    36, 1, 192, 36, 1, 205, 36, 1, 222, 181, 36, 1, 233, 141, 36, 1, 232, 
+    190, 36, 1, 232, 181, 36, 1, 214, 27, 36, 1, 220, 104, 36, 1, 218, 225, 
+    36, 1, 206, 36, 1, 162, 36, 25, 5, 255, 82, 36, 25, 5, 74, 36, 25, 5, 
+    236, 40, 36, 25, 5, 69, 36, 25, 5, 214, 118, 36, 25, 5, 76, 36, 25, 5, 
+    245, 217, 36, 25, 5, 254, 210, 36, 25, 5, 78, 36, 25, 5, 226, 187, 36, 
+    25, 5, 253, 200, 36, 5, 213, 152, 36, 226, 208, 36, 253, 201, 233, 29, 
+    79, 36, 21, 210, 86, 36, 21, 111, 36, 21, 105, 36, 21, 158, 36, 21, 161, 
+    36, 21, 190, 36, 21, 195, 36, 21, 199, 36, 21, 196, 36, 21, 201, 36, 54, 
+    216, 248, 36, 54, 123, 240, 217, 36, 54, 123, 216, 148, 36, 248, 154, 50, 
+    36, 230, 140, 50, 36, 211, 45, 50, 36, 248, 95, 50, 36, 249, 147, 50, 36, 
+    253, 246, 72, 50, 36, 222, 120, 50, 36, 54, 50, 148, 5, 251, 7, 148, 5, 
+    254, 83, 148, 5, 213, 147, 148, 1, 61, 148, 1, 255, 82, 148, 1, 74, 148, 
+    1, 236, 40, 148, 1, 69, 148, 1, 214, 118, 148, 1, 149, 153, 148, 1, 149, 
+    156, 148, 1, 76, 148, 1, 245, 217, 148, 1, 254, 210, 148, 1, 78, 148, 1, 
+    226, 187, 148, 1, 253, 200, 148, 1, 176, 148, 1, 234, 138, 148, 1, 243, 
+    142, 148, 1, 243, 0, 148, 1, 229, 82, 148, 1, 251, 41, 148, 1, 250, 165, 
+    148, 1, 235, 147, 148, 1, 235, 120, 148, 1, 227, 169, 148, 1, 215, 157, 
+    148, 1, 215, 145, 148, 1, 248, 143, 148, 1, 248, 127, 148, 1, 228, 115, 
+    148, 1, 217, 106, 148, 1, 216, 209, 148, 1, 248, 229, 148, 1, 248, 33, 
+    148, 1, 198, 148, 1, 191, 148, 1, 225, 150, 148, 1, 252, 199, 148, 1, 
+    252, 26, 148, 1, 186, 148, 1, 192, 148, 1, 205, 148, 1, 222, 181, 148, 1, 
+    233, 141, 148, 1, 232, 190, 148, 1, 214, 27, 148, 1, 220, 104, 148, 1, 
+    218, 225, 148, 1, 206, 148, 1, 162, 148, 5, 253, 183, 148, 25, 5, 255, 
+    82, 148, 25, 5, 74, 148, 25, 5, 236, 40, 148, 25, 5, 69, 148, 25, 5, 214, 
+    118, 148, 25, 5, 149, 153, 148, 25, 5, 149, 222, 182, 148, 25, 5, 76, 
+    148, 25, 5, 245, 217, 148, 25, 5, 254, 210, 148, 25, 5, 78, 148, 25, 5, 
+    226, 187, 148, 25, 5, 253, 200, 148, 5, 213, 152, 148, 233, 29, 79, 148, 
+    254, 211, 233, 29, 79, 148, 1, 215, 184, 148, 1, 246, 46, 148, 1, 149, 
+    222, 182, 148, 1, 149, 232, 191, 148, 25, 5, 149, 156, 148, 25, 5, 149, 
+    232, 191, 148, 21, 210, 86, 148, 21, 111, 148, 21, 105, 148, 21, 158, 
+    148, 21, 161, 148, 21, 190, 148, 21, 195, 148, 21, 199, 148, 21, 196, 
+    148, 21, 201, 148, 244, 10, 21, 210, 87, 31, 226, 241, 224, 226, 64, 161, 
+    148, 244, 10, 21, 123, 31, 226, 241, 224, 226, 64, 161, 148, 244, 10, 21, 
+    113, 31, 226, 241, 224, 226, 64, 161, 148, 244, 10, 21, 134, 31, 226, 
+    241, 224, 226, 64, 161, 148, 244, 10, 21, 123, 31, 245, 50, 224, 226, 64, 
+    161, 148, 244, 10, 21, 113, 31, 245, 50, 224, 226, 64, 161, 148, 244, 10, 
+    21, 134, 31, 245, 50, 224, 226, 64, 161, 148, 5, 215, 84, 165, 5, 254, 
+    83, 165, 5, 213, 147, 165, 1, 61, 165, 1, 255, 82, 165, 1, 74, 165, 1, 
+    236, 40, 165, 1, 69, 165, 1, 214, 118, 165, 1, 149, 153, 165, 1, 149, 
+    156, 165, 1, 76, 165, 1, 245, 217, 165, 1, 254, 210, 165, 1, 78, 165, 1, 
+    226, 187, 165, 1, 253, 200, 165, 1, 176, 165, 1, 234, 138, 165, 1, 243, 
+    142, 165, 1, 243, 0, 165, 1, 229, 82, 165, 1, 251, 41, 165, 1, 250, 165, 
+    165, 1, 235, 147, 165, 1, 235, 120, 165, 1, 227, 169, 165, 1, 215, 157, 
+    165, 1, 215, 145, 165, 1, 248, 143, 165, 1, 248, 127, 165, 1, 228, 115, 
+    165, 1, 217, 106, 165, 1, 216, 209, 165, 1, 248, 229, 165, 1, 248, 33, 
+    165, 1, 198, 165, 1, 191, 165, 1, 225, 150, 165, 1, 252, 199, 165, 1, 
+    252, 26, 165, 1, 186, 165, 1, 192, 165, 1, 205, 165, 1, 222, 181, 165, 1, 
+    233, 141, 165, 1, 232, 190, 165, 1, 214, 27, 165, 1, 220, 104, 165, 1, 
+    218, 225, 165, 1, 206, 165, 1, 162, 165, 5, 227, 209, 165, 5, 253, 183, 
+    165, 25, 5, 255, 82, 165, 25, 5, 74, 165, 25, 5, 236, 40, 165, 25, 5, 69, 
+    165, 25, 5, 214, 118, 165, 25, 5, 149, 153, 165, 25, 5, 149, 222, 182, 
+    165, 25, 5, 76, 165, 25, 5, 245, 217, 165, 25, 5, 254, 210, 165, 25, 5, 
+    78, 165, 25, 5, 226, 187, 165, 25, 5, 253, 200, 165, 5, 213, 152, 165, 
+    233, 29, 79, 165, 254, 211, 233, 29, 79, 165, 1, 244, 204, 165, 1, 149, 
+    222, 182, 165, 1, 149, 232, 191, 165, 25, 5, 149, 156, 165, 25, 5, 149, 
+    232, 191, 165, 21, 210, 86, 165, 21, 111, 165, 21, 105, 165, 21, 158, 
+    165, 21, 161, 165, 21, 190, 165, 21, 195, 165, 21, 199, 165, 21, 196, 
+    165, 21, 201, 165, 5, 235, 108, 165, 5, 214, 161, 136, 5, 254, 83, 136, 
+    5, 213, 147, 136, 1, 61, 136, 1, 255, 82, 136, 1, 74, 136, 1, 236, 40, 
+    136, 1, 69, 136, 1, 214, 118, 136, 1, 149, 153, 136, 1, 149, 156, 136, 1, 
+    76, 136, 1, 245, 217, 136, 1, 254, 210, 136, 1, 78, 136, 1, 226, 187, 
+    136, 1, 253, 200, 136, 1, 176, 136, 1, 234, 138, 136, 1, 243, 142, 136, 
+    1, 243, 0, 136, 1, 229, 82, 136, 1, 251, 41, 136, 1, 250, 165, 136, 1, 
+    235, 147, 136, 1, 235, 120, 136, 1, 227, 169, 136, 1, 215, 157, 136, 1, 
+    215, 145, 136, 1, 248, 143, 136, 1, 248, 127, 136, 1, 228, 115, 136, 1, 
+    217, 106, 136, 1, 216, 209, 136, 1, 248, 229, 136, 1, 248, 33, 136, 1, 
+    198, 136, 1, 228, 97, 136, 1, 191, 136, 1, 225, 150, 136, 1, 252, 199, 
+    136, 1, 252, 26, 136, 1, 186, 136, 1, 192, 136, 1, 205, 136, 1, 222, 181, 
+    136, 1, 233, 141, 136, 1, 232, 190, 136, 1, 232, 181, 136, 1, 214, 27, 
+    136, 1, 220, 104, 136, 1, 218, 225, 136, 1, 206, 136, 1, 162, 136, 1, 
+    215, 126, 136, 5, 253, 183, 136, 25, 5, 255, 82, 136, 25, 5, 74, 136, 25, 
+    5, 236, 40, 136, 25, 5, 69, 136, 25, 5, 214, 118, 136, 25, 5, 149, 153, 
+    136, 25, 5, 149, 222, 182, 136, 25, 5, 76, 136, 25, 5, 245, 217, 136, 25, 
+    5, 254, 210, 136, 25, 5, 78, 136, 25, 5, 226, 187, 136, 25, 5, 253, 200, 
+    136, 5, 213, 152, 136, 1, 59, 223, 76, 136, 253, 201, 233, 29, 79, 136, 
+    1, 149, 222, 182, 136, 1, 149, 232, 191, 136, 25, 5, 149, 156, 136, 25, 
+    5, 149, 232, 191, 136, 21, 210, 86, 136, 21, 111, 136, 21, 105, 136, 21, 
+    158, 136, 21, 161, 136, 21, 190, 136, 21, 195, 136, 21, 199, 136, 21, 
+    196, 136, 21, 201, 136, 54, 216, 248, 136, 54, 123, 240, 217, 136, 54, 
+    123, 216, 148, 136, 244, 10, 123, 224, 24, 136, 244, 10, 123, 242, 34, 
+    136, 244, 10, 134, 224, 22, 136, 248, 158, 79, 136, 1, 250, 107, 228, 
+    116, 136, 1, 250, 107, 230, 30, 136, 1, 250, 107, 222, 182, 136, 1, 250, 
+    107, 156, 136, 1, 250, 107, 232, 191, 136, 1, 250, 107, 235, 29, 175, 5, 
+    254, 82, 175, 5, 213, 146, 175, 1, 253, 173, 175, 1, 255, 36, 175, 1, 
+    254, 232, 175, 1, 254, 247, 175, 1, 235, 157, 175, 1, 236, 39, 175, 1, 
+    214, 110, 175, 1, 214, 112, 175, 1, 235, 180, 175, 1, 235, 181, 175, 1, 
+    236, 25, 175, 1, 236, 27, 175, 1, 245, 25, 175, 1, 245, 212, 175, 1, 254, 
+    197, 175, 1, 226, 112, 175, 1, 226, 181, 175, 1, 253, 186, 175, 1, 254, 
+    154, 234, 193, 175, 1, 231, 214, 234, 193, 175, 1, 254, 154, 243, 89, 
+    175, 1, 231, 214, 243, 89, 175, 1, 234, 235, 229, 227, 175, 1, 221, 238, 
+    243, 89, 175, 1, 254, 154, 250, 224, 175, 1, 231, 214, 250, 224, 175, 1, 
+    254, 154, 235, 133, 175, 1, 231, 214, 235, 133, 175, 1, 217, 99, 229, 
+    227, 175, 1, 217, 99, 221, 237, 229, 228, 175, 1, 221, 238, 235, 133, 
+    175, 1, 254, 154, 215, 153, 175, 1, 231, 214, 215, 153, 175, 1, 254, 154, 
+    248, 134, 175, 1, 231, 214, 248, 134, 175, 1, 230, 58, 229, 185, 175, 1, 
+    221, 238, 248, 134, 175, 1, 254, 154, 217, 31, 175, 1, 231, 214, 217, 31, 
+    175, 1, 254, 154, 248, 152, 175, 1, 231, 214, 248, 152, 175, 1, 248, 182, 
+    229, 185, 175, 1, 221, 238, 248, 152, 175, 1, 254, 154, 225, 232, 175, 1, 
+    231, 214, 225, 232, 175, 1, 254, 154, 252, 120, 175, 1, 231, 214, 252, 
+    120, 175, 1, 231, 136, 175, 1, 254, 139, 252, 120, 175, 1, 211, 51, 175, 
+    1, 223, 136, 175, 1, 248, 182, 233, 73, 175, 1, 214, 1, 175, 1, 217, 99, 
+    221, 212, 175, 1, 230, 58, 221, 212, 175, 1, 248, 182, 221, 212, 175, 1, 
+    241, 249, 175, 1, 230, 58, 233, 73, 175, 1, 244, 164, 175, 5, 254, 186, 
+    175, 25, 5, 254, 242, 175, 25, 5, 234, 161, 254, 249, 175, 25, 5, 247, 
+    236, 254, 249, 175, 25, 5, 234, 161, 235, 177, 175, 25, 5, 247, 236, 235, 
+    177, 175, 25, 5, 234, 161, 226, 92, 175, 25, 5, 247, 236, 226, 92, 175, 
+    25, 5, 243, 131, 175, 25, 5, 234, 21, 175, 25, 5, 247, 236, 234, 21, 175, 
+    25, 5, 234, 23, 248, 75, 175, 25, 5, 234, 22, 242, 54, 254, 242, 175, 25, 
+    5, 234, 22, 242, 54, 247, 236, 254, 242, 175, 25, 5, 234, 22, 242, 54, 
+    243, 88, 175, 25, 5, 243, 88, 175, 25, 5, 247, 236, 243, 131, 175, 25, 5, 
+    247, 236, 243, 88, 175, 224, 144, 233, 213, 168, 135, 234, 35, 234, 252, 
+    168, 135, 234, 112, 234, 134, 168, 135, 234, 112, 234, 105, 168, 135, 
+    234, 112, 234, 101, 168, 135, 234, 112, 234, 109, 168, 135, 234, 112, 
+    223, 157, 168, 135, 229, 10, 228, 253, 168, 135, 250, 95, 250, 155, 168, 
+    135, 250, 95, 250, 103, 168, 135, 250, 95, 250, 154, 168, 135, 219, 61, 
+    219, 60, 168, 135, 250, 95, 250, 91, 168, 135, 210, 245, 210, 252, 168, 
+    135, 247, 154, 250, 162, 168, 135, 216, 43, 225, 242, 168, 135, 216, 158, 
+    216, 201, 168, 135, 216, 158, 229, 206, 168, 135, 216, 158, 225, 114, 
+    168, 135, 228, 80, 229, 103, 168, 135, 247, 154, 248, 76, 168, 135, 216, 
+    43, 217, 56, 168, 135, 216, 158, 216, 132, 168, 135, 216, 158, 216, 205, 
+    168, 135, 216, 158, 216, 155, 168, 135, 228, 80, 227, 242, 168, 135, 251, 
+    214, 252, 172, 168, 135, 225, 20, 225, 45, 168, 135, 225, 125, 225, 116, 
+    168, 135, 244, 52, 244, 204, 168, 135, 225, 125, 225, 144, 168, 135, 244, 
+    52, 244, 181, 168, 135, 225, 125, 221, 249, 168, 135, 230, 167, 186, 168, 
+    135, 210, 245, 211, 79, 168, 135, 222, 214, 222, 141, 168, 135, 222, 142, 
+    168, 135, 232, 163, 232, 212, 168, 135, 232, 103, 168, 135, 211, 228, 
+    212, 61, 168, 135, 219, 61, 222, 8, 168, 135, 219, 61, 222, 116, 168, 
+    135, 219, 61, 218, 83, 168, 135, 241, 76, 241, 166, 168, 135, 232, 163, 
+    250, 76, 168, 135, 144, 254, 123, 168, 135, 241, 76, 228, 75, 168, 135, 
+    226, 72, 168, 135, 221, 232, 61, 168, 135, 231, 209, 242, 24, 168, 135, 
+    221, 232, 255, 82, 168, 135, 221, 232, 254, 144, 168, 135, 221, 232, 74, 
+    168, 135, 221, 232, 236, 40, 168, 135, 221, 232, 214, 214, 168, 135, 221, 
+    232, 214, 212, 168, 135, 221, 232, 69, 168, 135, 221, 232, 214, 118, 168, 
+    135, 225, 127, 168, 249, 106, 16, 252, 173, 168, 135, 221, 232, 76, 168, 
+    135, 221, 232, 254, 252, 168, 135, 221, 232, 78, 168, 135, 221, 232, 254, 
+    211, 231, 203, 168, 135, 221, 232, 254, 211, 231, 204, 168, 135, 233, 
+    112, 168, 135, 231, 200, 168, 135, 231, 201, 168, 135, 231, 209, 245, 
+    188, 168, 135, 231, 209, 216, 157, 168, 135, 231, 209, 215, 229, 168, 
+    135, 231, 209, 250, 143, 168, 135, 216, 199, 168, 135, 228, 210, 168, 
+    135, 211, 73, 168, 135, 244, 43, 168, 21, 210, 86, 168, 21, 111, 168, 21, 
+    105, 168, 21, 158, 168, 21, 161, 168, 21, 190, 168, 21, 195, 168, 21, 
+    199, 168, 21, 196, 168, 21, 201, 168, 135, 254, 119, 168, 135, 234, 110, 
+    209, 209, 1, 234, 34, 209, 209, 1, 234, 112, 218, 36, 209, 209, 1, 234, 
+    112, 217, 63, 209, 209, 1, 229, 9, 209, 209, 1, 249, 246, 209, 209, 1, 
+    219, 61, 217, 63, 209, 209, 1, 227, 138, 209, 209, 1, 247, 153, 209, 209, 
+    1, 112, 209, 209, 1, 216, 158, 218, 36, 209, 209, 1, 216, 158, 217, 63, 
+    209, 209, 1, 228, 79, 209, 209, 1, 251, 213, 209, 209, 1, 225, 19, 209, 
+    209, 1, 225, 125, 218, 36, 209, 209, 1, 244, 52, 217, 63, 209, 209, 1, 
+    225, 125, 217, 63, 209, 209, 1, 244, 52, 218, 36, 209, 209, 1, 230, 166, 
+    209, 209, 1, 210, 244, 209, 209, 1, 232, 163, 232, 212, 209, 209, 1, 232, 
+    163, 232, 127, 209, 209, 1, 211, 227, 209, 209, 1, 219, 61, 218, 36, 209, 
+    209, 1, 241, 76, 218, 36, 209, 209, 1, 78, 209, 209, 1, 241, 76, 217, 63, 
+    209, 209, 245, 171, 209, 209, 25, 5, 61, 209, 209, 25, 5, 231, 209, 234, 
+    240, 209, 209, 25, 5, 255, 82, 209, 209, 25, 5, 254, 144, 209, 209, 25, 
+    5, 74, 209, 209, 25, 5, 236, 40, 209, 209, 25, 5, 211, 117, 209, 209, 25, 
+    5, 210, 169, 209, 209, 25, 5, 69, 209, 209, 25, 5, 214, 118, 209, 209, 
+    25, 5, 231, 209, 234, 19, 209, 209, 220, 147, 5, 232, 162, 209, 209, 220, 
+    147, 5, 227, 138, 209, 209, 25, 5, 76, 209, 209, 25, 5, 245, 203, 209, 
+    209, 25, 5, 78, 209, 209, 25, 5, 253, 175, 209, 209, 25, 5, 254, 210, 
+    209, 209, 234, 35, 233, 141, 209, 209, 138, 231, 209, 245, 188, 209, 209, 
+    138, 231, 209, 216, 157, 209, 209, 138, 231, 209, 216, 118, 209, 209, 
+    138, 231, 209, 250, 231, 209, 209, 251, 12, 79, 209, 209, 228, 219, 209, 
+    209, 21, 210, 86, 209, 209, 21, 111, 209, 209, 21, 105, 209, 209, 21, 
+    158, 209, 209, 21, 161, 209, 209, 21, 190, 209, 209, 21, 195, 209, 209, 
+    21, 199, 209, 209, 21, 196, 209, 209, 21, 201, 209, 209, 241, 76, 228, 
+    79, 209, 209, 241, 76, 230, 166, 209, 209, 1, 234, 113, 242, 181, 209, 
+    209, 1, 234, 113, 227, 138, 63, 3, 226, 208, 63, 164, 242, 122, 211, 0, 
+    230, 253, 215, 190, 61, 63, 164, 242, 122, 211, 0, 230, 253, 255, 168, 
+    222, 218, 252, 85, 186, 63, 164, 242, 122, 211, 0, 230, 253, 255, 168, 
+    242, 122, 215, 174, 186, 63, 164, 65, 211, 0, 230, 253, 231, 98, 186, 63, 
+    164, 250, 4, 211, 0, 230, 253, 220, 111, 186, 63, 164, 250, 247, 211, 0, 
+    230, 253, 225, 115, 220, 98, 186, 63, 164, 211, 0, 230, 253, 215, 174, 
+    220, 98, 186, 63, 164, 221, 210, 220, 97, 63, 164, 251, 136, 211, 0, 230, 
+    252, 63, 164, 251, 231, 220, 5, 211, 0, 230, 252, 63, 164, 235, 204, 215, 
+    173, 63, 164, 248, 69, 215, 174, 251, 135, 63, 164, 220, 97, 63, 164, 
+    227, 143, 220, 97, 63, 164, 215, 174, 220, 97, 63, 164, 227, 143, 215, 
+    174, 220, 97, 63, 164, 222, 239, 250, 130, 218, 238, 220, 97, 63, 164, 
+    223, 45, 242, 153, 220, 97, 63, 164, 250, 247, 255, 172, 222, 146, 231, 
+    97, 200, 251, 15, 63, 164, 242, 122, 215, 173, 63, 232, 150, 5, 250, 163, 
+    222, 145, 63, 232, 150, 5, 233, 2, 222, 145, 63, 253, 220, 5, 220, 107, 
+    243, 72, 255, 173, 222, 145, 63, 253, 220, 5, 255, 170, 191, 63, 253, 
+    220, 5, 221, 184, 215, 169, 63, 5, 223, 133, 247, 167, 243, 71, 63, 5, 
+    223, 133, 247, 167, 242, 183, 63, 5, 223, 133, 247, 167, 242, 123, 63, 5, 
+    223, 133, 229, 224, 243, 71, 63, 5, 223, 133, 229, 224, 242, 183, 63, 5, 
+    223, 133, 247, 167, 223, 133, 229, 223, 63, 21, 210, 86, 63, 21, 111, 63, 
+    21, 105, 63, 21, 158, 63, 21, 161, 63, 21, 190, 63, 21, 195, 63, 21, 199, 
+    63, 21, 196, 63, 21, 201, 63, 21, 163, 111, 63, 21, 163, 105, 63, 21, 
+    163, 158, 63, 21, 163, 161, 63, 21, 163, 190, 63, 21, 163, 195, 63, 21, 
+    163, 199, 63, 21, 163, 196, 63, 21, 163, 201, 63, 21, 163, 210, 86, 63, 
+    164, 251, 138, 222, 145, 63, 164, 229, 73, 251, 76, 227, 153, 210, 25, 
+    63, 164, 250, 247, 255, 172, 222, 146, 251, 77, 230, 207, 251, 15, 63, 
+    164, 229, 73, 251, 76, 220, 108, 222, 145, 63, 164, 250, 140, 230, 252, 
+    63, 164, 215, 185, 255, 169, 63, 164, 242, 107, 222, 146, 242, 70, 63, 
+    164, 242, 107, 222, 146, 242, 76, 63, 164, 254, 124, 234, 129, 242, 70, 
+    63, 164, 254, 124, 234, 129, 242, 76, 63, 5, 211, 65, 215, 172, 63, 5, 
+    231, 172, 215, 172, 63, 1, 176, 63, 1, 234, 138, 63, 1, 243, 142, 63, 1, 
+    243, 0, 63, 1, 229, 82, 63, 1, 251, 41, 63, 1, 250, 165, 63, 1, 235, 147, 
+    63, 1, 227, 169, 63, 1, 215, 157, 63, 1, 215, 145, 63, 1, 248, 143, 63, 
+    1, 248, 127, 63, 1, 228, 115, 63, 1, 217, 106, 63, 1, 216, 209, 63, 1, 
+    248, 229, 63, 1, 248, 33, 63, 1, 198, 63, 1, 191, 63, 1, 225, 150, 63, 1, 
+    252, 199, 63, 1, 252, 26, 63, 1, 186, 63, 1, 215, 184, 63, 1, 215, 176, 
+    63, 1, 246, 46, 63, 1, 246, 41, 63, 1, 212, 65, 63, 1, 210, 82, 63, 1, 
+    210, 116, 63, 1, 255, 175, 63, 1, 192, 63, 1, 205, 63, 1, 233, 141, 63, 
+    1, 220, 104, 63, 1, 218, 225, 63, 1, 206, 63, 1, 162, 63, 1, 61, 63, 1, 
+    233, 237, 63, 1, 244, 85, 205, 63, 1, 234, 52, 63, 1, 222, 181, 63, 25, 
+    5, 255, 82, 63, 25, 5, 74, 63, 25, 5, 236, 40, 63, 25, 5, 69, 63, 25, 5, 
+    214, 118, 63, 25, 5, 149, 153, 63, 25, 5, 149, 222, 182, 63, 25, 5, 149, 
+    156, 63, 25, 5, 149, 232, 191, 63, 25, 5, 76, 63, 25, 5, 245, 217, 63, 
+    25, 5, 78, 63, 25, 5, 226, 187, 63, 5, 222, 224, 218, 85, 229, 83, 222, 
+    213, 63, 5, 222, 218, 252, 84, 63, 25, 5, 223, 52, 74, 63, 25, 5, 223, 
+    52, 236, 40, 63, 5, 227, 153, 210, 26, 229, 231, 248, 229, 63, 5, 219, 
+    73, 233, 66, 63, 164, 242, 36, 63, 164, 226, 61, 63, 5, 233, 69, 222, 
+    145, 63, 5, 211, 70, 222, 145, 63, 5, 233, 70, 215, 185, 251, 15, 63, 5, 
+    231, 100, 251, 15, 63, 5, 242, 126, 251, 16, 223, 43, 63, 5, 242, 126, 
+    231, 90, 223, 43, 63, 5, 235, 200, 231, 100, 251, 15, 63, 218, 74, 5, 
+    233, 70, 215, 185, 251, 15, 63, 218, 74, 5, 231, 100, 251, 15, 63, 218, 
+    74, 5, 235, 200, 231, 100, 251, 15, 63, 218, 74, 1, 176, 63, 218, 74, 1, 
+    234, 138, 63, 218, 74, 1, 243, 142, 63, 218, 74, 1, 243, 0, 63, 218, 74, 
+    1, 229, 82, 63, 218, 74, 1, 251, 41, 63, 218, 74, 1, 250, 165, 63, 218, 
+    74, 1, 235, 147, 63, 218, 74, 1, 227, 169, 63, 218, 74, 1, 215, 157, 63, 
+    218, 74, 1, 215, 145, 63, 218, 74, 1, 248, 143, 63, 218, 74, 1, 248, 127, 
+    63, 218, 74, 1, 228, 115, 63, 218, 74, 1, 217, 106, 63, 218, 74, 1, 216, 
+    209, 63, 218, 74, 1, 248, 229, 63, 218, 74, 1, 248, 33, 63, 218, 74, 1, 
+    198, 63, 218, 74, 1, 191, 63, 218, 74, 1, 225, 150, 63, 218, 74, 1, 252, 
+    199, 63, 218, 74, 1, 252, 26, 63, 218, 74, 1, 186, 63, 218, 74, 1, 215, 
+    184, 63, 218, 74, 1, 215, 176, 63, 218, 74, 1, 246, 46, 63, 218, 74, 1, 
+    246, 41, 63, 218, 74, 1, 212, 65, 63, 218, 74, 1, 210, 82, 63, 218, 74, 
+    1, 210, 116, 63, 218, 74, 1, 255, 175, 63, 218, 74, 1, 192, 63, 218, 74, 
+    1, 205, 63, 218, 74, 1, 233, 141, 63, 218, 74, 1, 220, 104, 63, 218, 74, 
+    1, 218, 225, 63, 218, 74, 1, 206, 63, 218, 74, 1, 162, 63, 218, 74, 1, 
+    61, 63, 218, 74, 1, 233, 237, 63, 218, 74, 1, 244, 85, 212, 65, 63, 218, 
+    74, 1, 244, 85, 192, 63, 218, 74, 1, 244, 85, 205, 63, 233, 224, 222, 
+    143, 234, 138, 63, 233, 224, 222, 143, 234, 139, 251, 77, 230, 207, 251, 
+    15, 63, 251, 4, 5, 114, 252, 78, 63, 251, 4, 5, 193, 252, 78, 63, 251, 4, 
+    5, 251, 5, 217, 21, 63, 251, 4, 5, 221, 209, 255, 174, 63, 16, 246, 99, 
+    251, 133, 63, 16, 223, 132, 222, 225, 63, 16, 226, 81, 243, 70, 63, 16, 
+    223, 132, 222, 226, 223, 45, 242, 152, 63, 16, 225, 115, 191, 63, 16, 
+    228, 64, 251, 133, 63, 16, 228, 64, 251, 134, 227, 143, 255, 171, 63, 16, 
+    228, 64, 251, 134, 242, 124, 255, 171, 63, 16, 228, 64, 251, 134, 251, 
+    77, 255, 171, 63, 5, 223, 133, 229, 224, 223, 133, 247, 166, 63, 5, 223, 
+    133, 229, 224, 242, 123, 63, 164, 251, 137, 220, 5, 242, 222, 230, 253, 
+    223, 44, 63, 164, 230, 168, 211, 0, 242, 222, 230, 253, 223, 44, 63, 164, 
+    227, 143, 215, 173, 63, 164, 65, 251, 160, 222, 215, 211, 0, 230, 253, 
+    231, 98, 186, 63, 164, 250, 4, 251, 160, 222, 215, 211, 0, 230, 253, 220, 
+    111, 186, 222, 253, 218, 0, 50, 233, 51, 218, 0, 50, 222, 253, 218, 0, 5, 
+    2, 247, 126, 233, 51, 218, 0, 5, 2, 247, 126, 63, 164, 233, 61, 231, 101, 
+    222, 145, 63, 164, 215, 251, 231, 101, 222, 145, 68, 1, 176, 68, 1, 234, 
+    138, 68, 1, 243, 142, 68, 1, 243, 0, 68, 1, 229, 82, 68, 1, 251, 41, 68, 
+    1, 250, 165, 68, 1, 235, 147, 68, 1, 235, 120, 68, 1, 227, 169, 68, 1, 
+    228, 81, 68, 1, 215, 157, 68, 1, 215, 145, 68, 1, 248, 143, 68, 1, 248, 
+    127, 68, 1, 228, 115, 68, 1, 217, 106, 68, 1, 216, 209, 68, 1, 248, 229, 
+    68, 1, 248, 33, 68, 1, 198, 68, 1, 191, 68, 1, 225, 150, 68, 1, 252, 199, 
+    68, 1, 252, 26, 68, 1, 186, 68, 1, 192, 68, 1, 205, 68, 1, 233, 141, 68, 
+    1, 212, 65, 68, 1, 206, 68, 1, 162, 68, 1, 232, 190, 68, 1, 61, 68, 1, 
+    220, 88, 61, 68, 1, 74, 68, 1, 236, 40, 68, 1, 69, 68, 1, 214, 118, 68, 
+    1, 76, 68, 1, 230, 156, 76, 68, 1, 78, 68, 1, 253, 200, 68, 25, 5, 217, 
+    65, 255, 82, 68, 25, 5, 255, 82, 68, 25, 5, 74, 68, 25, 5, 236, 40, 68, 
+    25, 5, 69, 68, 25, 5, 214, 118, 68, 25, 5, 76, 68, 25, 5, 254, 210, 68, 
+    25, 5, 230, 156, 236, 40, 68, 25, 5, 230, 156, 78, 68, 25, 5, 160, 48, 
+    68, 5, 254, 83, 68, 5, 59, 51, 68, 5, 213, 147, 68, 5, 213, 152, 68, 5, 
+    253, 243, 68, 117, 5, 147, 192, 68, 117, 5, 147, 205, 68, 117, 5, 147, 
+    212, 65, 68, 117, 5, 147, 162, 68, 1, 242, 139, 206, 68, 21, 210, 86, 68, 
+    21, 111, 68, 21, 105, 68, 21, 158, 68, 21, 161, 68, 21, 190, 68, 21, 195, 
+    68, 21, 199, 68, 21, 196, 68, 21, 201, 68, 5, 232, 198, 221, 174, 68, 5, 
+    221, 174, 68, 16, 232, 159, 68, 16, 249, 221, 68, 16, 254, 229, 68, 16, 
+    243, 55, 68, 1, 220, 104, 68, 1, 218, 225, 68, 1, 149, 153, 68, 1, 149, 
+    222, 182, 68, 1, 149, 156, 68, 1, 149, 232, 191, 68, 25, 5, 149, 153, 68, 
+    25, 5, 149, 222, 182, 68, 25, 5, 149, 156, 68, 25, 5, 149, 232, 191, 68, 
+    1, 230, 156, 229, 82, 68, 1, 230, 156, 235, 120, 68, 1, 230, 156, 252, 
+    119, 68, 1, 230, 156, 252, 114, 68, 117, 5, 230, 156, 147, 198, 68, 117, 
+    5, 230, 156, 147, 186, 68, 117, 5, 230, 156, 147, 233, 141, 68, 1, 220, 
+    110, 234, 219, 220, 104, 68, 25, 5, 220, 110, 234, 219, 245, 63, 68, 138, 
+    164, 220, 110, 234, 219, 241, 254, 68, 138, 164, 220, 110, 234, 219, 234, 
+    189, 225, 124, 68, 1, 212, 7, 224, 111, 234, 219, 216, 209, 68, 1, 212, 
+    7, 224, 111, 234, 219, 224, 117, 68, 25, 5, 212, 7, 224, 111, 234, 219, 
+    245, 63, 68, 25, 5, 212, 7, 224, 111, 234, 219, 214, 214, 68, 5, 212, 7, 
+    224, 111, 234, 219, 216, 30, 68, 5, 212, 7, 224, 111, 234, 219, 216, 29, 
+    68, 5, 212, 7, 224, 111, 234, 219, 216, 28, 68, 5, 212, 7, 224, 111, 234, 
+    219, 216, 27, 68, 5, 212, 7, 224, 111, 234, 219, 216, 26, 68, 1, 245, 
+    227, 224, 111, 234, 219, 228, 115, 68, 1, 245, 227, 224, 111, 234, 219, 
+    210, 176, 68, 1, 245, 227, 224, 111, 234, 219, 242, 224, 68, 25, 5, 243, 
+    66, 234, 219, 74, 68, 25, 5, 234, 194, 226, 238, 68, 25, 5, 234, 194, 69, 
+    68, 25, 5, 234, 194, 245, 217, 68, 1, 220, 88, 176, 68, 1, 220, 88, 234, 
+    138, 68, 1, 220, 88, 243, 142, 68, 1, 220, 88, 251, 41, 68, 1, 220, 88, 
+    210, 116, 68, 1, 220, 88, 227, 169, 68, 1, 220, 88, 248, 229, 68, 1, 220, 
+    88, 198, 68, 1, 220, 88, 225, 150, 68, 1, 220, 88, 244, 204, 68, 1, 220, 
+    88, 252, 199, 68, 1, 220, 88, 216, 209, 68, 1, 220, 88, 162, 68, 117, 5, 
+    220, 88, 147, 212, 65, 68, 25, 5, 220, 88, 255, 82, 68, 25, 5, 220, 88, 
+    76, 68, 25, 5, 220, 88, 160, 48, 68, 25, 5, 220, 88, 40, 211, 117, 68, 5, 
+    220, 88, 216, 29, 68, 5, 220, 88, 216, 28, 68, 5, 220, 88, 216, 26, 68, 
+    5, 220, 88, 216, 25, 68, 5, 220, 88, 249, 160, 216, 29, 68, 5, 220, 88, 
+    249, 160, 216, 28, 68, 5, 220, 88, 249, 160, 245, 161, 216, 31, 68, 1, 
+    222, 130, 226, 67, 244, 204, 68, 5, 222, 130, 226, 67, 216, 26, 68, 220, 
+    88, 21, 210, 86, 68, 220, 88, 21, 111, 68, 220, 88, 21, 105, 68, 220, 88, 
+    21, 158, 68, 220, 88, 21, 161, 68, 220, 88, 21, 190, 68, 220, 88, 21, 
+    195, 68, 220, 88, 21, 199, 68, 220, 88, 21, 196, 68, 220, 88, 21, 201, 
+    68, 5, 234, 132, 216, 30, 68, 5, 234, 132, 216, 28, 68, 25, 5, 254, 199, 
+    61, 68, 25, 5, 254, 199, 254, 210, 68, 16, 220, 88, 111, 68, 16, 220, 88, 
+    245, 38, 98, 6, 1, 254, 131, 98, 6, 1, 252, 160, 98, 6, 1, 243, 113, 98, 
+    6, 1, 247, 136, 98, 6, 1, 245, 158, 98, 6, 1, 213, 160, 98, 6, 1, 210, 
+    89, 98, 6, 1, 217, 61, 98, 6, 1, 236, 6, 98, 6, 1, 234, 240, 98, 6, 1, 
+    233, 87, 98, 6, 1, 231, 190, 98, 6, 1, 229, 200, 98, 6, 1, 226, 200, 98, 
+    6, 1, 226, 21, 98, 6, 1, 210, 78, 98, 6, 1, 223, 174, 98, 6, 1, 221, 245, 
+    98, 6, 1, 217, 51, 98, 6, 1, 214, 190, 98, 6, 1, 225, 143, 98, 6, 1, 234, 
+    127, 98, 6, 1, 242, 248, 98, 6, 1, 224, 76, 98, 6, 1, 220, 22, 98, 6, 1, 
+    250, 105, 98, 6, 1, 251, 15, 98, 6, 1, 235, 106, 98, 6, 1, 250, 48, 98, 
+    6, 1, 250, 151, 98, 6, 1, 211, 163, 98, 6, 1, 235, 117, 98, 6, 1, 242, 
+    50, 98, 6, 1, 241, 245, 98, 6, 1, 241, 182, 98, 6, 1, 212, 22, 98, 6, 1, 
+    242, 11, 98, 6, 1, 241, 72, 98, 6, 1, 210, 246, 98, 6, 1, 254, 241, 98, 
+    1, 254, 131, 98, 1, 252, 160, 98, 1, 243, 113, 98, 1, 247, 136, 98, 1, 
+    245, 158, 98, 1, 213, 160, 98, 1, 210, 89, 98, 1, 217, 61, 98, 1, 236, 6, 
+    98, 1, 234, 240, 98, 1, 233, 87, 98, 1, 231, 190, 98, 1, 229, 200, 98, 1, 
+    226, 200, 98, 1, 226, 21, 98, 1, 210, 78, 98, 1, 223, 174, 98, 1, 221, 
+    245, 98, 1, 217, 51, 98, 1, 214, 190, 98, 1, 225, 143, 98, 1, 234, 127, 
+    98, 1, 242, 248, 98, 1, 224, 76, 98, 1, 220, 22, 98, 1, 250, 105, 98, 1, 
+    251, 15, 98, 1, 235, 106, 98, 1, 250, 48, 98, 1, 250, 151, 98, 1, 211, 
+    163, 98, 1, 235, 117, 98, 1, 242, 50, 98, 1, 241, 245, 98, 1, 241, 182, 
+    98, 1, 212, 22, 98, 1, 242, 11, 98, 1, 241, 72, 98, 1, 244, 129, 98, 1, 
+    210, 246, 98, 1, 245, 173, 98, 1, 215, 94, 243, 113, 98, 1, 254, 205, 98, 
+    226, 19, 220, 139, 58, 1, 98, 229, 200, 98, 1, 254, 241, 98, 1, 242, 10, 
+    50, 98, 1, 233, 133, 50, 24, 100, 234, 64, 24, 100, 218, 217, 24, 100, 
+    228, 231, 24, 100, 216, 102, 24, 100, 218, 206, 24, 100, 223, 29, 24, 
+    100, 230, 222, 24, 100, 225, 98, 24, 100, 218, 214, 24, 100, 219, 150, 
+    24, 100, 218, 211, 24, 100, 236, 63, 24, 100, 250, 54, 24, 100, 218, 221, 
+    24, 100, 250, 114, 24, 100, 234, 116, 24, 100, 216, 174, 24, 100, 225, 
+    134, 24, 100, 241, 179, 24, 100, 228, 227, 24, 100, 218, 215, 24, 100, 
+    228, 221, 24, 100, 228, 225, 24, 100, 216, 99, 24, 100, 223, 17, 24, 100, 
+    218, 213, 24, 100, 223, 27, 24, 100, 234, 224, 24, 100, 230, 215, 24, 
+    100, 234, 227, 24, 100, 225, 93, 24, 100, 225, 91, 24, 100, 225, 79, 24, 
+    100, 225, 87, 24, 100, 225, 85, 24, 100, 225, 82, 24, 100, 225, 84, 24, 
+    100, 225, 81, 24, 100, 225, 86, 24, 100, 225, 96, 24, 100, 225, 97, 24, 
+    100, 225, 80, 24, 100, 225, 90, 24, 100, 234, 225, 24, 100, 234, 223, 24, 
+    100, 219, 143, 24, 100, 219, 141, 24, 100, 219, 133, 24, 100, 219, 136, 
+    24, 100, 219, 142, 24, 100, 219, 138, 24, 100, 219, 137, 24, 100, 219, 
+    135, 24, 100, 219, 146, 24, 100, 219, 148, 24, 100, 219, 149, 24, 100, 
+    219, 144, 24, 100, 219, 134, 24, 100, 219, 139, 24, 100, 219, 147, 24, 
+    100, 250, 98, 24, 100, 250, 96, 24, 100, 250, 176, 24, 100, 250, 174, 24, 
+    100, 226, 36, 24, 100, 236, 58, 24, 100, 236, 49, 24, 100, 236, 57, 24, 
+    100, 236, 54, 24, 100, 236, 52, 24, 100, 236, 56, 24, 100, 218, 218, 24, 
+    100, 236, 61, 24, 100, 236, 62, 24, 100, 236, 50, 24, 100, 236, 55, 24, 
+    100, 211, 26, 24, 100, 250, 53, 24, 100, 250, 99, 24, 100, 250, 97, 24, 
+    100, 250, 177, 24, 100, 250, 175, 24, 100, 250, 112, 24, 100, 250, 113, 
+    24, 100, 250, 100, 24, 100, 250, 178, 24, 100, 225, 132, 24, 100, 234, 
+    226, 24, 100, 218, 219, 24, 100, 211, 32, 24, 100, 234, 55, 24, 100, 228, 
+    223, 24, 100, 228, 229, 24, 100, 228, 228, 24, 100, 216, 96, 24, 100, 
+    244, 111, 24, 143, 244, 111, 24, 143, 61, 24, 143, 254, 252, 24, 143, 
+    192, 24, 143, 211, 92, 24, 143, 245, 125, 24, 143, 76, 24, 143, 211, 36, 
+    24, 143, 211, 47, 24, 143, 78, 24, 143, 212, 65, 24, 143, 212, 62, 24, 
+    143, 226, 238, 24, 143, 210, 244, 24, 143, 69, 24, 143, 212, 11, 24, 143, 
+    212, 22, 24, 143, 211, 250, 24, 143, 210, 212, 24, 143, 245, 63, 24, 143, 
+    211, 8, 24, 143, 74, 24, 143, 255, 166, 24, 143, 255, 165, 24, 143, 211, 
+    106, 24, 143, 211, 104, 24, 143, 245, 123, 24, 143, 245, 122, 24, 143, 
+    245, 124, 24, 143, 211, 35, 24, 143, 211, 34, 24, 143, 227, 88, 24, 143, 
+    227, 89, 24, 143, 227, 82, 24, 143, 227, 87, 24, 143, 227, 85, 24, 143, 
+    210, 238, 24, 143, 210, 237, 24, 143, 210, 236, 24, 143, 210, 239, 24, 
+    143, 210, 240, 24, 143, 215, 30, 24, 143, 215, 29, 24, 143, 215, 27, 24, 
+    143, 215, 24, 24, 143, 215, 25, 24, 143, 210, 211, 24, 143, 210, 208, 24, 
+    143, 210, 209, 24, 143, 210, 203, 24, 143, 210, 204, 24, 143, 210, 205, 
+    24, 143, 210, 207, 24, 143, 245, 57, 24, 143, 245, 59, 24, 143, 211, 7, 
+    24, 143, 240, 160, 24, 143, 240, 152, 24, 143, 240, 155, 24, 143, 240, 
+    153, 24, 143, 240, 157, 24, 143, 240, 159, 24, 143, 254, 42, 24, 143, 
+    254, 39, 24, 143, 254, 37, 24, 143, 254, 38, 24, 143, 218, 222, 24, 143, 
+    255, 167, 24, 143, 211, 105, 24, 143, 211, 33, 24, 143, 227, 84, 24, 143, 
+    227, 83, 24, 90, 234, 64, 24, 90, 218, 217, 24, 90, 234, 57, 24, 90, 228, 
+    231, 24, 90, 228, 229, 24, 90, 228, 228, 24, 90, 216, 102, 24, 90, 223, 
+    29, 24, 90, 223, 24, 24, 90, 223, 21, 24, 90, 223, 14, 24, 90, 223, 9, 
+    24, 90, 223, 4, 24, 90, 223, 15, 24, 90, 223, 27, 24, 90, 230, 222, 24, 
+    90, 225, 98, 24, 90, 225, 87, 24, 90, 219, 150, 24, 90, 218, 211, 24, 90, 
+    236, 63, 24, 90, 250, 54, 24, 90, 250, 114, 24, 90, 234, 116, 24, 90, 
+    216, 174, 24, 90, 225, 134, 24, 90, 241, 179, 24, 90, 234, 58, 24, 90, 
+    234, 56, 24, 90, 228, 227, 24, 90, 228, 221, 24, 90, 228, 223, 24, 90, 
+    228, 226, 24, 90, 228, 222, 24, 90, 216, 99, 24, 90, 216, 96, 24, 90, 
+    223, 22, 24, 90, 223, 17, 24, 90, 223, 3, 24, 90, 223, 2, 24, 90, 218, 
+    213, 24, 90, 223, 19, 24, 90, 223, 18, 24, 90, 223, 11, 24, 90, 223, 13, 
+    24, 90, 223, 26, 24, 90, 223, 6, 24, 90, 223, 16, 24, 90, 223, 25, 24, 
+    90, 223, 1, 24, 90, 230, 218, 24, 90, 230, 213, 24, 90, 230, 215, 24, 90, 
+    230, 212, 24, 90, 230, 210, 24, 90, 230, 216, 24, 90, 230, 221, 24, 90, 
+    230, 219, 24, 90, 234, 227, 24, 90, 225, 89, 24, 90, 225, 90, 24, 90, 
+    225, 95, 24, 90, 234, 225, 24, 90, 219, 143, 24, 90, 219, 133, 24, 90, 
+    219, 136, 24, 90, 219, 138, 24, 90, 226, 36, 24, 90, 236, 58, 24, 90, 
+    236, 51, 24, 90, 218, 218, 24, 90, 236, 59, 24, 90, 211, 26, 24, 90, 211, 
+    22, 24, 90, 211, 23, 24, 90, 225, 132, 24, 90, 234, 226, 24, 90, 241, 
+    177, 24, 90, 241, 175, 24, 90, 241, 178, 24, 90, 241, 176, 24, 90, 211, 
+    32, 24, 90, 234, 60, 24, 90, 234, 59, 24, 90, 234, 63, 24, 90, 234, 61, 
+    24, 90, 234, 62, 24, 90, 218, 215, 29, 3, 162, 29, 3, 240, 229, 29, 3, 
+    241, 187, 29, 3, 242, 53, 29, 3, 241, 227, 29, 3, 241, 245, 29, 3, 241, 
+    75, 29, 3, 241, 74, 29, 3, 233, 141, 29, 3, 232, 103, 29, 3, 232, 247, 
+    29, 3, 233, 140, 29, 3, 233, 56, 29, 3, 233, 64, 29, 3, 232, 162, 29, 3, 
+    232, 75, 29, 3, 241, 196, 29, 3, 241, 190, 29, 3, 241, 192, 29, 3, 241, 
+    195, 29, 3, 241, 193, 29, 3, 241, 194, 29, 3, 241, 191, 29, 3, 241, 189, 
+    29, 3, 186, 29, 3, 230, 107, 29, 3, 230, 235, 29, 3, 231, 242, 29, 3, 
+    231, 85, 29, 3, 231, 96, 29, 3, 230, 166, 29, 3, 230, 47, 29, 3, 217, 
+    164, 29, 3, 217, 158, 29, 3, 217, 160, 29, 3, 217, 163, 29, 3, 217, 161, 
+    29, 3, 217, 162, 29, 3, 217, 159, 29, 3, 217, 157, 29, 3, 205, 29, 3, 
+    222, 142, 29, 3, 223, 38, 29, 3, 223, 187, 29, 3, 223, 111, 29, 3, 223, 
+    131, 29, 3, 222, 213, 29, 3, 222, 111, 29, 3, 206, 29, 3, 218, 84, 29, 3, 
+    219, 193, 29, 3, 222, 33, 29, 3, 221, 172, 29, 3, 221, 183, 29, 3, 219, 
+    60, 29, 3, 217, 254, 29, 3, 220, 104, 29, 3, 219, 227, 29, 3, 220, 34, 
+    29, 3, 220, 100, 29, 3, 220, 63, 29, 3, 220, 65, 29, 3, 220, 9, 29, 3, 
+    219, 210, 29, 3, 224, 91, 29, 3, 224, 33, 29, 3, 224, 56, 29, 3, 224, 90, 
+    29, 3, 224, 71, 29, 3, 224, 72, 29, 3, 224, 45, 29, 3, 224, 44, 29, 3, 
+    223, 245, 29, 3, 223, 241, 29, 3, 223, 244, 29, 3, 223, 242, 29, 3, 223, 
+    243, 29, 3, 224, 68, 29, 3, 224, 62, 29, 3, 224, 64, 29, 3, 224, 67, 29, 
+    3, 224, 65, 29, 3, 224, 66, 29, 3, 224, 63, 29, 3, 224, 61, 29, 3, 224, 
+    57, 29, 3, 224, 60, 29, 3, 224, 58, 29, 3, 224, 59, 29, 3, 252, 199, 29, 
+    3, 251, 133, 29, 3, 252, 14, 29, 3, 252, 197, 29, 3, 252, 74, 29, 3, 252, 
+    83, 29, 3, 251, 213, 29, 3, 251, 91, 29, 3, 214, 27, 29, 3, 212, 116, 29, 
+    3, 213, 176, 29, 3, 214, 26, 29, 3, 213, 250, 29, 3, 213, 255, 29, 3, 
+    213, 138, 29, 3, 212, 107, 29, 3, 217, 106, 29, 3, 215, 119, 29, 3, 216, 
+    118, 29, 3, 217, 102, 29, 3, 217, 12, 29, 3, 217, 23, 29, 3, 112, 29, 3, 
+    215, 80, 29, 3, 251, 41, 29, 3, 249, 120, 29, 3, 250, 59, 29, 3, 251, 40, 
+    29, 3, 250, 190, 29, 3, 250, 198, 29, 3, 249, 246, 29, 3, 249, 89, 29, 3, 
+    211, 165, 29, 3, 211, 141, 29, 3, 211, 157, 29, 3, 211, 164, 29, 3, 211, 
+    161, 29, 3, 211, 162, 29, 3, 211, 148, 29, 3, 211, 147, 29, 3, 211, 136, 
+    29, 3, 211, 132, 29, 3, 211, 135, 29, 3, 211, 133, 29, 3, 211, 134, 29, 
+    3, 198, 29, 3, 227, 242, 29, 3, 228, 238, 29, 3, 229, 230, 29, 3, 229, 
+    108, 29, 3, 229, 112, 29, 3, 228, 79, 29, 3, 227, 178, 29, 3, 227, 169, 
+    29, 3, 227, 132, 29, 3, 227, 152, 29, 3, 227, 168, 29, 3, 227, 159, 29, 
+    3, 227, 160, 29, 3, 227, 138, 29, 3, 227, 123, 29, 3, 242, 187, 61, 29, 
+    3, 242, 187, 69, 29, 3, 242, 187, 74, 29, 3, 242, 187, 255, 82, 29, 3, 
+    242, 187, 245, 217, 29, 3, 242, 187, 76, 29, 3, 242, 187, 78, 29, 3, 242, 
+    187, 212, 65, 29, 3, 176, 29, 3, 233, 223, 29, 3, 234, 98, 29, 3, 235, 
+    16, 29, 3, 234, 187, 29, 3, 234, 188, 29, 3, 234, 34, 29, 3, 234, 33, 29, 
+    3, 233, 188, 29, 3, 233, 182, 29, 3, 233, 187, 29, 3, 233, 183, 29, 3, 
+    233, 184, 29, 3, 233, 177, 29, 3, 233, 171, 29, 3, 233, 173, 29, 3, 233, 
+    176, 29, 3, 233, 174, 29, 3, 233, 175, 29, 3, 233, 172, 29, 3, 233, 170, 
+    29, 3, 233, 166, 29, 3, 233, 169, 29, 3, 233, 167, 29, 3, 233, 168, 29, 
+    3, 212, 65, 29, 3, 211, 195, 29, 3, 211, 250, 29, 3, 212, 64, 29, 3, 212, 
+    17, 29, 3, 212, 22, 29, 3, 211, 227, 29, 3, 211, 226, 29, 3, 225, 142, 
+    61, 29, 3, 225, 142, 69, 29, 3, 225, 142, 74, 29, 3, 225, 142, 255, 82, 
+    29, 3, 225, 142, 245, 217, 29, 3, 225, 142, 76, 29, 3, 225, 142, 78, 29, 
+    3, 210, 116, 29, 3, 210, 13, 29, 3, 210, 44, 29, 3, 210, 115, 29, 3, 210, 
+    92, 29, 3, 210, 94, 29, 3, 210, 23, 29, 3, 210, 0, 29, 3, 210, 82, 29, 3, 
+    210, 62, 29, 3, 210, 69, 29, 3, 210, 81, 29, 3, 210, 73, 29, 3, 210, 74, 
+    29, 3, 210, 67, 29, 3, 210, 53, 29, 3, 192, 29, 3, 210, 212, 29, 3, 211, 
+    8, 29, 3, 211, 103, 29, 3, 211, 44, 29, 3, 211, 47, 29, 3, 210, 244, 29, 
+    3, 210, 235, 29, 3, 248, 229, 29, 3, 246, 86, 29, 3, 248, 11, 29, 3, 248, 
+    228, 29, 3, 248, 85, 29, 3, 248, 98, 29, 3, 247, 153, 29, 3, 246, 55, 29, 
+    3, 248, 143, 29, 3, 248, 108, 29, 3, 248, 120, 29, 3, 248, 142, 29, 3, 
+    248, 130, 29, 3, 248, 131, 29, 3, 248, 113, 29, 3, 248, 99, 29, 3, 235, 
+    147, 29, 3, 235, 57, 29, 3, 235, 114, 29, 3, 235, 146, 29, 3, 235, 130, 
+    29, 3, 235, 132, 29, 3, 235, 74, 29, 3, 235, 37, 29, 3, 243, 142, 29, 3, 
+    242, 120, 29, 3, 242, 221, 29, 3, 243, 139, 29, 3, 243, 62, 29, 3, 243, 
+    69, 29, 3, 242, 181, 29, 3, 242, 180, 29, 3, 242, 85, 29, 3, 242, 81, 29, 
+    3, 242, 84, 29, 3, 242, 82, 29, 3, 242, 83, 29, 3, 243, 36, 29, 3, 243, 
+    16, 29, 3, 243, 26, 29, 3, 243, 35, 29, 3, 243, 30, 29, 3, 243, 31, 29, 
+    3, 243, 20, 29, 3, 243, 5, 29, 3, 216, 209, 29, 3, 216, 137, 29, 3, 216, 
+    176, 29, 3, 216, 208, 29, 3, 216, 195, 29, 3, 216, 196, 29, 3, 216, 157, 
+    29, 3, 216, 129, 29, 3, 250, 165, 29, 3, 250, 77, 29, 3, 250, 118, 29, 3, 
+    250, 164, 29, 3, 250, 136, 29, 3, 250, 139, 29, 3, 250, 94, 29, 3, 250, 
+    66, 29, 3, 225, 150, 29, 3, 225, 117, 29, 3, 225, 136, 29, 3, 225, 149, 
+    29, 3, 225, 138, 29, 3, 225, 139, 29, 3, 225, 124, 29, 3, 225, 113, 29, 
+    3, 215, 184, 29, 3, 215, 164, 29, 3, 215, 168, 29, 3, 215, 183, 29, 3, 
+    215, 178, 29, 3, 215, 179, 29, 3, 215, 167, 29, 3, 215, 162, 29, 3, 215, 
+    39, 29, 3, 215, 31, 29, 3, 215, 35, 29, 3, 215, 38, 29, 3, 215, 36, 29, 
+    3, 215, 37, 29, 3, 215, 33, 29, 3, 215, 32, 29, 3, 244, 204, 29, 3, 243, 
+    241, 29, 3, 244, 129, 29, 3, 244, 203, 29, 3, 244, 155, 29, 3, 244, 162, 
+    29, 3, 244, 51, 29, 3, 243, 220, 29, 3, 191, 29, 3, 224, 153, 29, 3, 225, 
+    111, 29, 3, 226, 93, 29, 3, 225, 214, 29, 3, 225, 224, 29, 3, 225, 19, 
+    29, 3, 224, 117, 29, 3, 222, 101, 29, 3, 230, 36, 29, 3, 243, 214, 29, 
+    38, 243, 60, 22, 25, 233, 29, 79, 29, 38, 25, 233, 29, 79, 29, 38, 243, 
+    60, 79, 29, 221, 175, 79, 29, 211, 208, 29, 243, 236, 218, 131, 29, 249, 
+    227, 29, 220, 152, 29, 249, 234, 29, 224, 202, 249, 234, 29, 224, 16, 79, 
+    29, 226, 19, 220, 139, 29, 21, 111, 29, 21, 105, 29, 21, 158, 29, 21, 
+    161, 29, 21, 190, 29, 21, 195, 29, 21, 199, 29, 21, 196, 29, 21, 201, 29, 
+    54, 216, 248, 29, 54, 215, 73, 29, 54, 216, 163, 29, 54, 244, 23, 29, 54, 
+    244, 122, 29, 54, 219, 113, 29, 54, 220, 118, 29, 54, 245, 192, 29, 54, 
+    228, 200, 29, 54, 240, 217, 29, 54, 216, 249, 216, 148, 29, 3, 221, 179, 
+    230, 47, 29, 3, 230, 43, 29, 3, 230, 44, 29, 3, 230, 45, 29, 3, 221, 179, 
+    251, 91, 29, 3, 251, 88, 29, 3, 251, 89, 29, 3, 251, 90, 29, 3, 221, 179, 
+    243, 220, 29, 3, 243, 216, 29, 3, 243, 217, 29, 3, 243, 218, 29, 3, 221, 
+    179, 224, 117, 29, 3, 224, 113, 29, 3, 224, 114, 29, 3, 224, 115, 29, 
+    216, 32, 164, 210, 247, 29, 216, 32, 164, 248, 49, 29, 216, 32, 164, 222, 
+    241, 29, 216, 32, 164, 219, 253, 222, 241, 29, 216, 32, 164, 247, 243, 
+    29, 216, 32, 164, 234, 170, 29, 216, 32, 164, 250, 102, 29, 216, 32, 164, 
+    241, 184, 29, 216, 32, 164, 248, 48, 29, 216, 32, 164, 233, 200, 169, 1, 
+    61, 169, 1, 76, 169, 1, 74, 169, 1, 78, 169, 1, 69, 169, 1, 214, 105, 
+    169, 1, 243, 142, 169, 1, 176, 169, 1, 243, 69, 169, 1, 242, 221, 169, 1, 
+    242, 181, 169, 1, 242, 120, 169, 1, 242, 86, 169, 1, 162, 169, 1, 241, 
+    245, 169, 1, 241, 187, 169, 1, 241, 75, 169, 1, 240, 229, 169, 1, 240, 
+    208, 169, 1, 233, 141, 169, 1, 233, 64, 169, 1, 232, 247, 169, 1, 232, 
+    162, 169, 1, 232, 103, 169, 1, 232, 76, 169, 1, 186, 169, 1, 231, 96, 
+    169, 1, 230, 235, 169, 1, 230, 166, 169, 1, 230, 107, 169, 1, 198, 169, 
+    1, 241, 97, 169, 1, 229, 218, 169, 1, 229, 112, 169, 1, 228, 238, 169, 1, 
+    228, 79, 169, 1, 227, 242, 169, 1, 227, 180, 169, 1, 224, 32, 169, 1, 
+    224, 19, 169, 1, 224, 12, 169, 1, 224, 4, 169, 1, 223, 249, 169, 1, 223, 
+    247, 169, 1, 206, 169, 1, 222, 93, 169, 1, 221, 183, 169, 1, 219, 193, 
+    169, 1, 219, 60, 169, 1, 218, 84, 169, 1, 218, 3, 169, 1, 248, 229, 169, 
+    1, 217, 106, 169, 1, 248, 98, 169, 1, 217, 23, 169, 1, 248, 11, 169, 1, 
+    216, 118, 169, 1, 247, 153, 169, 1, 246, 86, 169, 1, 246, 58, 169, 1, 
+    247, 164, 169, 1, 216, 60, 169, 1, 216, 59, 169, 1, 216, 48, 169, 1, 216, 
+    47, 169, 1, 216, 46, 169, 1, 216, 45, 169, 1, 215, 184, 169, 1, 215, 179, 
+    169, 1, 215, 168, 169, 1, 215, 167, 169, 1, 215, 164, 169, 1, 215, 163, 
+    169, 1, 212, 65, 169, 1, 212, 22, 169, 1, 211, 250, 169, 1, 211, 227, 
+    169, 1, 211, 195, 169, 1, 211, 183, 169, 1, 192, 169, 1, 211, 47, 169, 1, 
+    211, 8, 169, 1, 210, 244, 169, 1, 210, 212, 169, 1, 210, 177, 18, 19, 
+    240, 175, 18, 19, 76, 18, 19, 255, 46, 18, 19, 74, 18, 19, 236, 40, 18, 
+    19, 78, 18, 19, 226, 187, 18, 19, 211, 116, 226, 187, 18, 19, 73, 245, 
+    217, 18, 19, 73, 74, 18, 19, 61, 18, 19, 255, 82, 18, 19, 212, 22, 18, 
+    19, 159, 212, 22, 18, 19, 211, 250, 18, 19, 159, 211, 250, 18, 19, 211, 
+    242, 18, 19, 159, 211, 242, 18, 19, 211, 227, 18, 19, 159, 211, 227, 18, 
+    19, 211, 215, 18, 19, 159, 211, 215, 18, 19, 229, 195, 211, 215, 18, 19, 
+    212, 65, 18, 19, 159, 212, 65, 18, 19, 212, 64, 18, 19, 159, 212, 64, 18, 
+    19, 229, 195, 212, 64, 18, 19, 254, 210, 18, 19, 211, 116, 212, 98, 18, 
+    19, 242, 187, 218, 131, 18, 19, 40, 142, 18, 19, 40, 242, 143, 18, 19, 
+    40, 251, 183, 163, 222, 236, 18, 19, 40, 216, 15, 163, 222, 236, 18, 19, 
+    40, 44, 163, 222, 236, 18, 19, 40, 222, 236, 18, 19, 40, 52, 142, 18, 19, 
+    40, 52, 219, 253, 67, 218, 92, 18, 19, 40, 230, 229, 247, 128, 18, 19, 
+    40, 219, 253, 203, 91, 18, 19, 40, 225, 25, 18, 19, 40, 124, 217, 88, 18, 
+    19, 245, 158, 18, 19, 236, 6, 18, 19, 226, 200, 18, 19, 254, 131, 18, 19, 
+    225, 224, 18, 19, 226, 91, 18, 19, 225, 111, 18, 19, 225, 74, 18, 19, 
+    225, 19, 18, 19, 224, 252, 18, 19, 211, 116, 224, 252, 18, 19, 73, 241, 
+    227, 18, 19, 73, 241, 187, 18, 19, 191, 18, 19, 226, 93, 18, 19, 224, 
+    115, 18, 19, 159, 224, 115, 18, 19, 224, 113, 18, 19, 159, 224, 113, 18, 
+    19, 224, 112, 18, 19, 159, 224, 112, 18, 19, 224, 110, 18, 19, 159, 224, 
+    110, 18, 19, 224, 109, 18, 19, 159, 224, 109, 18, 19, 224, 117, 18, 19, 
+    159, 224, 117, 18, 19, 224, 116, 18, 19, 159, 224, 116, 18, 19, 211, 116, 
+    224, 116, 18, 19, 226, 109, 18, 19, 159, 226, 109, 18, 19, 73, 242, 67, 
+    18, 19, 217, 23, 18, 19, 217, 100, 18, 19, 216, 118, 18, 19, 216, 104, 
+    18, 19, 112, 18, 19, 216, 18, 18, 19, 211, 116, 216, 18, 18, 19, 73, 248, 
+    85, 18, 19, 73, 248, 11, 18, 19, 217, 106, 18, 19, 217, 102, 18, 19, 215, 
+    78, 18, 19, 159, 215, 78, 18, 19, 215, 62, 18, 19, 159, 215, 62, 18, 19, 
+    215, 61, 18, 19, 159, 215, 61, 18, 19, 105, 18, 19, 159, 105, 18, 19, 
+    215, 54, 18, 19, 159, 215, 54, 18, 19, 215, 80, 18, 19, 159, 215, 80, 18, 
+    19, 215, 79, 18, 19, 159, 215, 79, 18, 19, 229, 195, 215, 79, 18, 19, 
+    217, 153, 18, 19, 215, 152, 18, 19, 215, 136, 18, 19, 215, 134, 18, 19, 
+    215, 157, 18, 19, 234, 188, 18, 19, 235, 13, 18, 19, 234, 98, 18, 19, 
+    234, 89, 18, 19, 234, 34, 18, 19, 234, 16, 18, 19, 211, 116, 234, 16, 18, 
+    19, 176, 18, 19, 235, 16, 18, 19, 233, 184, 18, 19, 159, 233, 184, 18, 
+    19, 233, 182, 18, 19, 159, 233, 182, 18, 19, 233, 181, 18, 19, 159, 233, 
+    181, 18, 19, 233, 180, 18, 19, 159, 233, 180, 18, 19, 233, 179, 18, 19, 
+    159, 233, 179, 18, 19, 233, 188, 18, 19, 159, 233, 188, 18, 19, 233, 187, 
+    18, 19, 159, 233, 187, 18, 19, 229, 195, 233, 187, 18, 19, 235, 29, 18, 
+    19, 233, 189, 18, 19, 219, 29, 234, 182, 18, 19, 219, 29, 234, 90, 18, 
+    19, 219, 29, 234, 29, 18, 19, 219, 29, 234, 254, 18, 19, 250, 198, 18, 
+    19, 251, 39, 18, 19, 250, 59, 18, 19, 250, 49, 18, 19, 249, 246, 18, 19, 
+    249, 182, 18, 19, 211, 116, 249, 182, 18, 19, 251, 41, 18, 19, 251, 40, 
+    18, 19, 249, 87, 18, 19, 159, 249, 87, 18, 19, 249, 85, 18, 19, 159, 249, 
+    85, 18, 19, 249, 84, 18, 19, 159, 249, 84, 18, 19, 249, 83, 18, 19, 159, 
+    249, 83, 18, 19, 249, 82, 18, 19, 159, 249, 82, 18, 19, 249, 89, 18, 19, 
+    159, 249, 89, 18, 19, 249, 88, 18, 19, 159, 249, 88, 18, 19, 229, 195, 
+    249, 88, 18, 19, 251, 74, 18, 19, 221, 211, 216, 211, 18, 19, 231, 96, 
+    18, 19, 231, 241, 18, 19, 230, 235, 18, 19, 230, 206, 18, 19, 230, 166, 
+    18, 19, 230, 137, 18, 19, 211, 116, 230, 137, 18, 19, 186, 18, 19, 231, 
+    242, 18, 19, 230, 45, 18, 19, 159, 230, 45, 18, 19, 230, 43, 18, 19, 159, 
+    230, 43, 18, 19, 230, 42, 18, 19, 159, 230, 42, 18, 19, 230, 41, 18, 19, 
+    159, 230, 41, 18, 19, 230, 40, 18, 19, 159, 230, 40, 18, 19, 230, 47, 18, 
+    19, 159, 230, 47, 18, 19, 230, 46, 18, 19, 159, 230, 46, 18, 19, 229, 
+    195, 230, 46, 18, 19, 194, 18, 19, 159, 194, 18, 19, 230, 239, 18, 19, 
+    253, 213, 194, 18, 19, 221, 211, 194, 18, 19, 229, 112, 18, 19, 229, 229, 
+    18, 19, 228, 238, 18, 19, 228, 213, 18, 19, 228, 79, 18, 19, 228, 69, 18, 
+    19, 211, 116, 228, 69, 18, 19, 198, 18, 19, 229, 230, 18, 19, 227, 176, 
+    18, 19, 159, 227, 176, 18, 19, 227, 178, 18, 19, 159, 227, 178, 18, 19, 
+    227, 177, 18, 19, 159, 227, 177, 18, 19, 229, 195, 227, 177, 18, 19, 230, 
+    30, 18, 19, 73, 229, 84, 18, 19, 228, 243, 18, 19, 233, 64, 18, 19, 233, 
+    139, 18, 19, 232, 247, 18, 19, 232, 233, 18, 19, 232, 162, 18, 19, 232, 
+    133, 18, 19, 211, 116, 232, 133, 18, 19, 233, 141, 18, 19, 233, 140, 18, 
+    19, 232, 73, 18, 19, 159, 232, 73, 18, 19, 232, 72, 18, 19, 159, 232, 72, 
+    18, 19, 232, 71, 18, 19, 159, 232, 71, 18, 19, 232, 70, 18, 19, 159, 232, 
+    70, 18, 19, 232, 69, 18, 19, 159, 232, 69, 18, 19, 232, 75, 18, 19, 159, 
+    232, 75, 18, 19, 232, 74, 18, 19, 159, 232, 74, 18, 19, 156, 18, 19, 159, 
+    156, 18, 19, 147, 156, 18, 19, 221, 183, 18, 19, 222, 31, 18, 19, 219, 
+    193, 18, 19, 219, 177, 18, 19, 219, 60, 18, 19, 219, 42, 18, 19, 211, 
+    116, 219, 42, 18, 19, 206, 18, 19, 222, 33, 18, 19, 217, 250, 18, 19, 
+    159, 217, 250, 18, 19, 217, 244, 18, 19, 159, 217, 244, 18, 19, 217, 243, 
+    18, 19, 159, 217, 243, 18, 19, 217, 239, 18, 19, 159, 217, 239, 18, 19, 
+    217, 238, 18, 19, 159, 217, 238, 18, 19, 217, 254, 18, 19, 159, 217, 254, 
+    18, 19, 217, 253, 18, 19, 159, 217, 253, 18, 19, 229, 195, 217, 253, 18, 
+    19, 222, 93, 18, 19, 253, 213, 222, 93, 18, 19, 217, 255, 18, 19, 251, 
+    226, 222, 93, 18, 19, 230, 132, 219, 110, 18, 19, 229, 195, 219, 101, 18, 
+    19, 229, 195, 222, 91, 18, 19, 229, 195, 218, 237, 18, 19, 229, 195, 218, 
+    87, 18, 19, 229, 195, 219, 100, 18, 19, 229, 195, 221, 186, 18, 19, 220, 
+    65, 18, 19, 220, 34, 18, 19, 220, 29, 18, 19, 220, 9, 18, 19, 220, 3, 18, 
+    19, 220, 104, 18, 19, 220, 100, 18, 19, 219, 208, 18, 19, 159, 219, 208, 
+    18, 19, 219, 207, 18, 19, 159, 219, 207, 18, 19, 219, 206, 18, 19, 159, 
+    219, 206, 18, 19, 219, 205, 18, 19, 159, 219, 205, 18, 19, 219, 204, 18, 
+    19, 159, 219, 204, 18, 19, 219, 210, 18, 19, 159, 219, 210, 18, 19, 219, 
+    209, 18, 19, 159, 219, 209, 18, 19, 220, 106, 18, 19, 211, 47, 18, 19, 
+    211, 101, 18, 19, 211, 8, 18, 19, 210, 255, 18, 19, 210, 244, 18, 19, 
+    210, 229, 18, 19, 211, 116, 210, 229, 18, 19, 192, 18, 19, 211, 103, 18, 
+    19, 210, 174, 18, 19, 159, 210, 174, 18, 19, 210, 173, 18, 19, 159, 210, 
+    173, 18, 19, 210, 172, 18, 19, 159, 210, 172, 18, 19, 210, 171, 18, 19, 
+    159, 210, 171, 18, 19, 210, 170, 18, 19, 159, 210, 170, 18, 19, 210, 176, 
+    18, 19, 159, 210, 176, 18, 19, 210, 175, 18, 19, 159, 210, 175, 18, 19, 
+    229, 195, 210, 175, 18, 19, 211, 117, 18, 19, 252, 12, 211, 117, 18, 19, 
+    159, 211, 117, 18, 19, 221, 211, 211, 8, 18, 19, 223, 131, 18, 19, 223, 
+    226, 223, 131, 18, 19, 159, 233, 64, 18, 19, 223, 186, 18, 19, 223, 38, 
+    18, 19, 222, 242, 18, 19, 222, 213, 18, 19, 222, 199, 18, 19, 159, 232, 
+    162, 18, 19, 205, 18, 19, 223, 187, 18, 19, 159, 233, 141, 18, 19, 222, 
+    110, 18, 19, 159, 222, 110, 18, 19, 153, 18, 19, 159, 153, 18, 19, 147, 
+    153, 18, 19, 244, 162, 18, 19, 244, 201, 18, 19, 244, 129, 18, 19, 244, 
+    116, 18, 19, 244, 51, 18, 19, 244, 42, 18, 19, 244, 204, 18, 19, 244, 
+    203, 18, 19, 243, 219, 18, 19, 159, 243, 219, 18, 19, 245, 14, 18, 19, 
+    216, 196, 18, 19, 230, 28, 216, 196, 18, 19, 216, 176, 18, 19, 230, 28, 
+    216, 176, 18, 19, 216, 172, 18, 19, 230, 28, 216, 172, 18, 19, 216, 157, 
+    18, 19, 216, 154, 18, 19, 216, 209, 18, 19, 216, 208, 18, 19, 216, 128, 
+    18, 19, 159, 216, 128, 18, 19, 216, 211, 18, 19, 215, 143, 18, 19, 215, 
+    141, 18, 19, 215, 140, 18, 19, 215, 145, 18, 19, 215, 146, 18, 19, 215, 
+    52, 18, 19, 215, 51, 18, 19, 215, 50, 18, 19, 215, 53, 18, 19, 227, 197, 
+    241, 245, 18, 19, 227, 197, 241, 187, 18, 19, 227, 197, 241, 168, 18, 19, 
+    227, 197, 241, 75, 18, 19, 227, 197, 241, 60, 18, 19, 227, 197, 162, 18, 
+    19, 227, 197, 242, 53, 18, 19, 227, 197, 242, 67, 18, 19, 227, 196, 242, 
+    67, 18, 19, 241, 161, 18, 19, 224, 87, 18, 19, 224, 56, 18, 19, 224, 51, 
+    18, 19, 224, 45, 18, 19, 224, 40, 18, 19, 224, 91, 18, 19, 224, 90, 18, 
+    19, 224, 99, 18, 19, 216, 56, 18, 19, 216, 54, 18, 19, 216, 53, 18, 19, 
+    216, 57, 18, 19, 159, 223, 131, 18, 19, 159, 223, 38, 18, 19, 159, 222, 
+    213, 18, 19, 159, 205, 18, 19, 229, 80, 18, 19, 229, 32, 18, 19, 229, 28, 
+    18, 19, 229, 9, 18, 19, 229, 4, 18, 19, 229, 82, 18, 19, 229, 81, 18, 19, 
+    229, 84, 18, 19, 228, 108, 18, 19, 221, 211, 220, 65, 18, 19, 221, 211, 
+    220, 34, 18, 19, 221, 211, 220, 9, 18, 19, 221, 211, 220, 104, 18, 19, 
+    211, 213, 216, 196, 18, 19, 211, 213, 216, 176, 18, 19, 211, 213, 216, 
+    157, 18, 19, 211, 213, 216, 209, 18, 19, 211, 213, 216, 211, 18, 19, 232, 
+    254, 18, 19, 232, 253, 18, 19, 232, 252, 18, 19, 232, 251, 18, 19, 233, 
+    4, 18, 19, 233, 3, 18, 19, 233, 5, 18, 19, 216, 210, 216, 196, 18, 19, 
+    216, 210, 216, 176, 18, 19, 216, 210, 216, 172, 18, 19, 216, 210, 216, 
+    157, 18, 19, 216, 210, 216, 154, 18, 19, 216, 210, 216, 209, 18, 19, 216, 
+    210, 216, 208, 18, 19, 216, 210, 216, 211, 18, 19, 254, 198, 253, 166, 
+    18, 19, 251, 226, 76, 18, 19, 251, 226, 74, 18, 19, 251, 226, 78, 18, 19, 
+    251, 226, 61, 18, 19, 251, 226, 212, 22, 18, 19, 251, 226, 211, 250, 18, 
+    19, 251, 226, 211, 227, 18, 19, 251, 226, 212, 65, 18, 19, 251, 226, 229, 
+    112, 18, 19, 251, 226, 228, 238, 18, 19, 251, 226, 228, 79, 18, 19, 251, 
+    226, 198, 18, 19, 251, 226, 234, 188, 18, 19, 251, 226, 234, 98, 18, 19, 
+    251, 226, 234, 34, 18, 19, 251, 226, 176, 18, 19, 221, 211, 241, 245, 18, 
+    19, 221, 211, 241, 187, 18, 19, 221, 211, 241, 75, 18, 19, 221, 211, 162, 
+    18, 19, 73, 242, 227, 18, 19, 73, 242, 231, 18, 19, 73, 242, 243, 18, 19, 
+    73, 242, 242, 18, 19, 73, 242, 232, 18, 19, 73, 243, 0, 18, 19, 73, 222, 
+    142, 18, 19, 73, 222, 213, 18, 19, 73, 223, 131, 18, 19, 73, 223, 111, 
+    18, 19, 73, 223, 38, 18, 19, 73, 205, 18, 19, 73, 211, 195, 18, 19, 73, 
+    211, 227, 18, 19, 73, 212, 22, 18, 19, 73, 212, 17, 18, 19, 73, 211, 250, 
+    18, 19, 73, 212, 65, 18, 19, 73, 240, 201, 18, 19, 73, 240, 202, 18, 19, 
+    73, 240, 205, 18, 19, 73, 240, 204, 18, 19, 73, 240, 203, 18, 19, 73, 
+    240, 207, 18, 19, 73, 216, 137, 18, 19, 73, 216, 157, 18, 19, 73, 216, 
+    196, 18, 19, 73, 216, 195, 18, 19, 73, 216, 176, 18, 19, 73, 216, 209, 
+    18, 19, 73, 215, 124, 18, 19, 73, 215, 134, 18, 19, 73, 215, 152, 18, 19, 
+    73, 215, 151, 18, 19, 73, 215, 136, 18, 19, 73, 215, 157, 18, 19, 73, 
+    224, 153, 18, 19, 73, 225, 19, 18, 19, 73, 225, 224, 18, 19, 73, 225, 
+    214, 18, 19, 73, 225, 111, 18, 19, 73, 191, 18, 19, 73, 226, 109, 18, 19, 
+    73, 242, 120, 18, 19, 73, 242, 181, 18, 19, 73, 243, 69, 18, 19, 73, 243, 
+    62, 18, 19, 73, 242, 221, 18, 19, 73, 243, 142, 18, 19, 73, 234, 106, 18, 
+    19, 73, 234, 111, 18, 19, 73, 234, 125, 18, 19, 73, 234, 124, 18, 19, 73, 
+    234, 118, 18, 19, 73, 234, 138, 18, 19, 73, 234, 47, 18, 19, 73, 234, 48, 
+    18, 19, 73, 234, 51, 18, 19, 73, 234, 50, 18, 19, 73, 234, 49, 18, 19, 
+    73, 234, 52, 18, 19, 73, 234, 53, 18, 19, 73, 227, 242, 18, 19, 73, 228, 
+    79, 18, 19, 73, 229, 112, 18, 19, 73, 229, 108, 18, 19, 73, 228, 238, 18, 
+    19, 73, 198, 18, 19, 73, 230, 107, 18, 19, 73, 230, 166, 18, 19, 73, 231, 
+    96, 18, 19, 73, 231, 85, 18, 19, 73, 230, 235, 18, 19, 73, 186, 18, 19, 
+    73, 210, 212, 18, 19, 73, 210, 244, 18, 19, 73, 211, 47, 18, 19, 73, 211, 
+    44, 18, 19, 73, 211, 8, 18, 19, 73, 192, 18, 19, 73, 235, 57, 18, 19, 
+    221, 211, 235, 57, 18, 19, 73, 235, 74, 18, 19, 73, 235, 132, 18, 19, 73, 
+    235, 130, 18, 19, 73, 235, 114, 18, 19, 221, 211, 235, 114, 18, 19, 73, 
+    235, 147, 18, 19, 73, 235, 87, 18, 19, 73, 235, 91, 18, 19, 73, 235, 101, 
+    18, 19, 73, 235, 100, 18, 19, 73, 235, 99, 18, 19, 73, 235, 102, 18, 19, 
+    73, 232, 103, 18, 19, 73, 232, 162, 18, 19, 73, 233, 64, 18, 19, 73, 233, 
+    56, 18, 19, 73, 232, 247, 18, 19, 73, 233, 141, 18, 19, 73, 247, 157, 18, 
+    19, 73, 247, 158, 18, 19, 73, 247, 163, 18, 19, 73, 247, 162, 18, 19, 73, 
+    247, 159, 18, 19, 73, 247, 164, 18, 19, 73, 232, 250, 18, 19, 73, 232, 
+    252, 18, 19, 73, 233, 0, 18, 19, 73, 232, 255, 18, 19, 73, 232, 254, 18, 
+    19, 73, 233, 4, 18, 19, 73, 216, 51, 18, 19, 73, 216, 53, 18, 19, 73, 
+    216, 56, 18, 19, 73, 216, 55, 18, 19, 73, 216, 54, 18, 19, 73, 216, 57, 
+    18, 19, 73, 216, 46, 18, 19, 73, 216, 47, 18, 19, 73, 216, 59, 18, 19, 
+    73, 216, 58, 18, 19, 73, 216, 48, 18, 19, 73, 216, 60, 18, 19, 73, 210, 
+    13, 18, 19, 73, 210, 23, 18, 19, 73, 210, 94, 18, 19, 73, 210, 92, 18, 
+    19, 73, 210, 44, 18, 19, 73, 210, 116, 18, 19, 73, 210, 159, 18, 19, 73, 
+    65, 210, 159, 18, 19, 73, 246, 36, 18, 19, 73, 246, 37, 18, 19, 73, 246, 
+    44, 18, 19, 73, 246, 43, 18, 19, 73, 246, 39, 18, 19, 73, 246, 46, 18, 
+    19, 73, 218, 84, 18, 19, 73, 219, 60, 18, 19, 73, 221, 183, 18, 19, 73, 
+    221, 172, 18, 19, 73, 219, 193, 18, 19, 73, 206, 18, 19, 73, 219, 227, 
+    18, 19, 73, 220, 9, 18, 19, 73, 220, 65, 18, 19, 73, 220, 63, 18, 19, 73, 
+    220, 34, 18, 19, 73, 220, 104, 18, 19, 73, 220, 106, 18, 19, 73, 215, 
+    164, 18, 19, 73, 215, 167, 18, 19, 73, 215, 179, 18, 19, 73, 215, 178, 
+    18, 19, 73, 215, 168, 18, 19, 73, 215, 184, 18, 19, 73, 250, 77, 18, 19, 
+    73, 250, 94, 18, 19, 73, 250, 139, 18, 19, 73, 250, 136, 18, 19, 73, 250, 
+    118, 18, 19, 73, 250, 165, 18, 19, 73, 215, 127, 18, 19, 73, 215, 128, 
+    18, 19, 73, 215, 131, 18, 19, 73, 215, 130, 18, 19, 73, 215, 129, 18, 19, 
+    73, 215, 132, 18, 19, 250, 119, 50, 18, 19, 243, 236, 218, 131, 18, 19, 
+    224, 83, 18, 19, 229, 78, 18, 19, 228, 105, 18, 19, 228, 104, 18, 19, 
+    228, 103, 18, 19, 228, 102, 18, 19, 228, 107, 18, 19, 228, 106, 18, 19, 
+    211, 213, 216, 126, 18, 19, 211, 213, 216, 125, 18, 19, 211, 213, 216, 
+    124, 18, 19, 211, 213, 216, 123, 18, 19, 211, 213, 216, 122, 18, 19, 211, 
+    213, 216, 129, 18, 19, 211, 213, 216, 128, 18, 19, 211, 213, 40, 216, 
+    211, 18, 19, 251, 226, 212, 98, 226, 230, 219, 21, 79, 226, 230, 1, 252, 
+    56, 226, 230, 1, 232, 92, 226, 230, 1, 244, 159, 226, 230, 1, 222, 17, 
+    226, 230, 1, 228, 198, 226, 230, 1, 214, 226, 226, 230, 1, 248, 205, 226, 
+    230, 1, 216, 81, 226, 230, 1, 249, 237, 226, 230, 1, 250, 188, 226, 230, 
+    1, 230, 96, 226, 230, 1, 242, 163, 226, 230, 1, 229, 68, 226, 230, 1, 
+    218, 124, 226, 230, 1, 222, 137, 226, 230, 1, 254, 207, 226, 230, 1, 226, 
+    191, 226, 230, 1, 214, 150, 226, 230, 1, 245, 239, 226, 230, 1, 235, 195, 
+    226, 230, 1, 245, 240, 226, 230, 1, 226, 162, 226, 230, 1, 214, 206, 226, 
+    230, 1, 236, 46, 226, 230, 1, 245, 237, 226, 230, 1, 225, 205, 226, 230, 
+    244, 158, 79, 226, 230, 223, 52, 244, 158, 79, 178, 1, 244, 149, 244, 
+    141, 244, 163, 245, 14, 178, 1, 214, 105, 178, 1, 214, 135, 214, 151, 69, 
+    178, 1, 210, 214, 178, 1, 211, 117, 178, 1, 212, 98, 178, 1, 216, 131, 
+    216, 130, 216, 152, 178, 1, 245, 67, 178, 1, 254, 101, 61, 178, 1, 226, 
+    147, 78, 178, 1, 255, 26, 61, 178, 1, 254, 236, 178, 1, 232, 139, 78, 
+    178, 1, 219, 246, 78, 178, 1, 78, 178, 1, 226, 238, 178, 1, 226, 200, 
+    178, 1, 223, 167, 223, 180, 223, 97, 153, 178, 1, 234, 199, 178, 1, 250, 
+    185, 178, 1, 234, 200, 235, 29, 178, 1, 243, 209, 178, 1, 245, 146, 178, 
+    1, 243, 65, 242, 73, 243, 209, 178, 1, 243, 103, 178, 1, 211, 188, 211, 
+    182, 212, 98, 178, 1, 242, 45, 242, 67, 178, 1, 242, 49, 242, 67, 178, 1, 
+    232, 141, 242, 67, 178, 1, 219, 249, 242, 67, 178, 1, 229, 190, 227, 161, 
+    229, 191, 230, 30, 178, 1, 219, 247, 230, 30, 178, 1, 246, 123, 178, 1, 
+    235, 175, 235, 179, 235, 168, 74, 178, 1, 76, 178, 1, 235, 123, 235, 150, 
+    178, 1, 243, 50, 178, 1, 232, 142, 254, 252, 178, 1, 219, 251, 61, 178, 
+    1, 235, 160, 245, 121, 178, 1, 225, 167, 225, 189, 226, 109, 178, 1, 254, 
+    172, 245, 119, 178, 1, 219, 26, 222, 93, 178, 1, 219, 181, 232, 138, 222, 
+    93, 178, 1, 219, 245, 222, 93, 178, 1, 251, 74, 178, 1, 210, 159, 178, 1, 
+    216, 64, 216, 74, 215, 41, 217, 153, 178, 1, 219, 244, 217, 153, 178, 1, 
+    249, 68, 178, 1, 252, 39, 252, 42, 251, 232, 253, 166, 178, 1, 219, 250, 
+    253, 166, 178, 1, 246, 122, 178, 1, 226, 175, 178, 1, 245, 204, 245, 206, 
+    76, 178, 1, 231, 183, 231, 191, 194, 178, 1, 232, 140, 194, 178, 1, 219, 
+    248, 194, 178, 1, 233, 79, 233, 120, 232, 149, 156, 178, 1, 246, 124, 
+    178, 1, 235, 237, 178, 1, 235, 238, 178, 1, 248, 218, 248, 223, 249, 68, 
+    178, 1, 226, 142, 245, 66, 78, 178, 1, 245, 235, 178, 1, 235, 194, 178, 
+    1, 249, 86, 178, 1, 251, 25, 178, 1, 250, 197, 178, 1, 218, 163, 178, 1, 
+    232, 137, 178, 1, 219, 243, 178, 1, 240, 117, 178, 1, 224, 99, 178, 1, 
+    211, 178, 178, 219, 157, 224, 143, 178, 230, 90, 224, 143, 178, 249, 139, 
+    224, 143, 178, 254, 14, 87, 178, 215, 82, 87, 178, 252, 54, 87, 217, 84, 
+    1, 61, 217, 84, 1, 74, 217, 84, 1, 69, 217, 84, 1, 176, 217, 84, 1, 243, 
+    142, 217, 84, 1, 229, 82, 217, 84, 1, 217, 106, 217, 84, 1, 248, 229, 
+    217, 84, 1, 198, 217, 84, 1, 191, 217, 84, 1, 252, 199, 217, 84, 1, 186, 
+    217, 84, 1, 192, 217, 84, 1, 233, 141, 217, 84, 1, 212, 65, 217, 84, 1, 
+    206, 217, 84, 1, 162, 217, 84, 25, 5, 74, 217, 84, 25, 5, 69, 217, 84, 5, 
+    213, 152, 242, 14, 1, 61, 242, 14, 1, 74, 242, 14, 1, 69, 242, 14, 1, 
+    176, 242, 14, 1, 243, 142, 242, 14, 1, 229, 82, 242, 14, 1, 217, 106, 
+    242, 14, 1, 248, 229, 242, 14, 1, 198, 242, 14, 1, 191, 242, 14, 1, 252, 
+    199, 242, 14, 1, 186, 242, 14, 1, 192, 242, 14, 1, 205, 242, 14, 1, 233, 
+    141, 242, 14, 1, 212, 65, 242, 14, 1, 206, 242, 14, 1, 162, 242, 14, 25, 
+    5, 74, 242, 14, 25, 5, 69, 242, 14, 5, 226, 53, 225, 129, 219, 157, 224, 
+    143, 225, 129, 52, 224, 143, 251, 128, 1, 61, 251, 128, 1, 74, 251, 128, 
+    1, 69, 251, 128, 1, 176, 251, 128, 1, 243, 142, 251, 128, 1, 229, 82, 
+    251, 128, 1, 217, 106, 251, 128, 1, 248, 229, 251, 128, 1, 198, 251, 128, 
+    1, 191, 251, 128, 1, 252, 199, 251, 128, 1, 186, 251, 128, 1, 192, 251, 
+    128, 1, 205, 251, 128, 1, 233, 141, 251, 128, 1, 212, 65, 251, 128, 1, 
+    206, 251, 128, 1, 162, 251, 128, 25, 5, 74, 251, 128, 25, 5, 69, 217, 83, 
+    1, 61, 217, 83, 1, 74, 217, 83, 1, 69, 217, 83, 1, 176, 217, 83, 1, 243, 
+    142, 217, 83, 1, 229, 82, 217, 83, 1, 217, 106, 217, 83, 1, 248, 229, 
+    217, 83, 1, 198, 217, 83, 1, 191, 217, 83, 1, 252, 199, 217, 83, 1, 186, 
+    217, 83, 1, 192, 217, 83, 1, 233, 141, 217, 83, 1, 212, 65, 217, 83, 1, 
+    206, 217, 83, 25, 5, 74, 217, 83, 25, 5, 69, 70, 1, 176, 70, 1, 234, 138, 
+    70, 1, 234, 34, 70, 1, 234, 111, 70, 1, 229, 9, 70, 1, 251, 41, 70, 1, 
+    250, 165, 70, 1, 249, 246, 70, 1, 250, 94, 70, 1, 227, 138, 70, 1, 248, 
+    229, 70, 1, 215, 145, 70, 1, 247, 153, 70, 1, 215, 140, 70, 1, 228, 85, 
+    70, 1, 217, 106, 70, 1, 216, 209, 70, 1, 112, 70, 1, 216, 157, 70, 1, 
+    228, 79, 70, 1, 252, 199, 70, 1, 225, 150, 70, 1, 225, 19, 70, 1, 225, 
+    124, 70, 1, 230, 166, 70, 1, 210, 244, 70, 1, 222, 213, 70, 1, 232, 162, 
+    70, 1, 213, 138, 70, 1, 220, 104, 70, 1, 218, 186, 70, 1, 206, 70, 1, 
+    162, 70, 1, 233, 141, 70, 1, 224, 91, 70, 235, 250, 25, 224, 77, 70, 235, 
+    250, 25, 224, 90, 70, 235, 250, 25, 224, 56, 70, 235, 250, 25, 224, 51, 
+    70, 235, 250, 25, 224, 33, 70, 235, 250, 25, 224, 5, 70, 235, 250, 25, 
+    223, 249, 70, 235, 250, 25, 223, 248, 70, 235, 250, 25, 222, 102, 70, 
+    235, 250, 25, 222, 95, 70, 235, 250, 25, 232, 67, 70, 235, 250, 25, 232, 
+    57, 70, 235, 250, 25, 224, 72, 70, 235, 250, 25, 224, 83, 70, 235, 250, 
+    25, 224, 41, 215, 49, 111, 70, 235, 250, 25, 224, 41, 215, 49, 105, 70, 
+    235, 250, 25, 224, 73, 70, 25, 235, 236, 254, 53, 70, 25, 235, 236, 255, 
+    82, 70, 25, 5, 255, 82, 70, 25, 5, 74, 70, 25, 5, 236, 40, 70, 25, 5, 
+    211, 117, 70, 25, 5, 210, 169, 70, 25, 5, 69, 70, 25, 5, 214, 118, 70, 
+    25, 5, 214, 229, 70, 25, 5, 226, 238, 70, 25, 5, 192, 70, 25, 5, 236, 67, 
+    70, 25, 5, 76, 70, 25, 5, 254, 252, 70, 25, 5, 254, 210, 70, 25, 5, 226, 
+    187, 70, 25, 5, 253, 200, 70, 5, 228, 211, 70, 5, 223, 129, 70, 5, 210, 
+    180, 70, 5, 230, 57, 70, 5, 215, 214, 70, 5, 252, 151, 70, 5, 222, 208, 
+    70, 5, 216, 41, 70, 5, 234, 247, 70, 5, 254, 212, 70, 5, 221, 246, 221, 
+    240, 70, 5, 213, 149, 70, 5, 249, 240, 70, 5, 252, 125, 70, 5, 234, 131, 
+    70, 5, 252, 145, 70, 5, 251, 17, 225, 75, 233, 193, 70, 5, 233, 36, 216, 
+    18, 70, 5, 252, 28, 70, 5, 225, 126, 230, 104, 70, 5, 234, 15, 70, 249, 
+    106, 16, 223, 31, 70, 5, 253, 182, 70, 5, 253, 203, 70, 21, 210, 86, 70, 
+    21, 111, 70, 21, 105, 70, 21, 158, 70, 21, 161, 70, 21, 190, 70, 21, 195, 
+    70, 21, 199, 70, 21, 196, 70, 21, 201, 70, 16, 233, 36, 253, 205, 219, 
+    45, 70, 16, 233, 36, 253, 205, 230, 76, 70, 16, 233, 36, 253, 205, 225, 
+    74, 70, 16, 233, 36, 253, 205, 252, 57, 70, 16, 233, 36, 253, 205, 251, 
+    111, 70, 16, 233, 36, 253, 205, 224, 218, 70, 16, 233, 36, 253, 205, 224, 
+    212, 70, 16, 233, 36, 253, 205, 224, 210, 70, 16, 233, 36, 253, 205, 224, 
+    216, 70, 16, 233, 36, 253, 205, 224, 214, 83, 251, 244, 83, 245, 171, 83, 
+    249, 227, 83, 243, 236, 218, 131, 83, 249, 234, 83, 244, 19, 247, 126, 
+    83, 216, 40, 219, 54, 240, 175, 83, 219, 192, 3, 251, 180, 231, 159, 83, 
+    231, 188, 249, 227, 83, 231, 188, 243, 236, 218, 131, 83, 228, 196, 83, 
+    244, 5, 45, 221, 159, 111, 83, 244, 5, 45, 221, 159, 105, 83, 244, 5, 45, 
+    221, 159, 158, 83, 25, 220, 139, 83, 21, 210, 86, 83, 21, 111, 83, 21, 
+    105, 83, 21, 158, 83, 21, 161, 83, 21, 190, 83, 21, 195, 83, 21, 199, 83, 
+    21, 196, 83, 21, 201, 83, 1, 61, 83, 1, 76, 83, 1, 74, 83, 1, 78, 83, 1, 
+    69, 83, 1, 226, 238, 83, 1, 214, 214, 83, 1, 245, 217, 83, 1, 198, 83, 1, 
+    254, 123, 83, 1, 252, 199, 83, 1, 191, 83, 1, 224, 91, 83, 1, 243, 142, 
+    83, 1, 186, 83, 1, 233, 141, 83, 1, 206, 83, 1, 220, 104, 83, 1, 217, 
+    106, 83, 1, 248, 229, 83, 1, 250, 165, 83, 1, 235, 147, 83, 1, 192, 83, 
+    1, 205, 83, 1, 212, 65, 83, 1, 244, 204, 83, 1, 176, 83, 1, 234, 138, 83, 
+    1, 215, 184, 83, 1, 210, 116, 83, 1, 242, 53, 83, 1, 210, 16, 83, 1, 233, 
+    4, 83, 1, 210, 69, 83, 1, 250, 118, 83, 1, 216, 40, 200, 25, 50, 83, 1, 
+    216, 40, 76, 83, 1, 216, 40, 74, 83, 1, 216, 40, 78, 83, 1, 216, 40, 69, 
+    83, 1, 216, 40, 226, 238, 83, 1, 216, 40, 214, 214, 83, 1, 216, 40, 254, 
+    123, 83, 1, 216, 40, 252, 199, 83, 1, 216, 40, 191, 83, 1, 216, 40, 224, 
+    91, 83, 1, 216, 40, 243, 142, 83, 1, 216, 40, 186, 83, 1, 216, 40, 217, 
+    106, 83, 1, 216, 40, 248, 229, 83, 1, 216, 40, 250, 165, 83, 1, 216, 40, 
+    235, 147, 83, 1, 216, 40, 215, 184, 83, 1, 216, 40, 192, 83, 1, 216, 40, 
+    212, 65, 83, 1, 216, 40, 176, 83, 1, 216, 40, 243, 139, 83, 1, 216, 40, 
+    242, 53, 83, 1, 216, 40, 235, 113, 83, 1, 216, 40, 228, 236, 83, 1, 216, 
+    40, 246, 46, 83, 1, 219, 192, 76, 83, 1, 219, 192, 74, 83, 1, 219, 192, 
+    235, 158, 83, 1, 219, 192, 214, 214, 83, 1, 219, 192, 69, 83, 1, 219, 
+    192, 254, 123, 83, 1, 219, 192, 176, 83, 1, 219, 192, 243, 142, 83, 1, 
+    219, 192, 162, 83, 1, 219, 192, 191, 83, 1, 219, 192, 220, 104, 83, 1, 
+    219, 192, 217, 106, 83, 1, 219, 192, 248, 229, 83, 1, 219, 192, 235, 147, 
+    83, 1, 219, 192, 244, 204, 83, 1, 219, 192, 243, 139, 83, 1, 219, 192, 
+    242, 53, 83, 1, 219, 192, 215, 184, 83, 1, 219, 192, 210, 116, 83, 1, 
+    219, 192, 223, 187, 83, 1, 219, 192, 250, 165, 83, 1, 219, 192, 210, 82, 
+    83, 1, 231, 188, 74, 83, 1, 231, 188, 176, 83, 1, 231, 188, 205, 83, 1, 
+    231, 188, 244, 204, 83, 1, 231, 188, 210, 82, 83, 1, 254, 171, 243, 123, 
+    254, 84, 111, 83, 1, 254, 171, 243, 123, 213, 148, 111, 83, 1, 254, 171, 
+    243, 123, 248, 194, 83, 1, 254, 171, 243, 123, 214, 224, 83, 1, 254, 171, 
+    243, 123, 235, 200, 214, 224, 83, 1, 254, 171, 243, 123, 252, 163, 83, 1, 
+    254, 171, 243, 123, 134, 252, 163, 83, 1, 254, 171, 243, 123, 61, 83, 1, 
+    254, 171, 243, 123, 74, 83, 1, 254, 171, 243, 123, 176, 83, 1, 254, 171, 
+    243, 123, 229, 82, 83, 1, 254, 171, 243, 123, 251, 41, 83, 1, 254, 171, 
+    243, 123, 215, 157, 83, 1, 254, 171, 243, 123, 215, 145, 83, 1, 254, 171, 
+    243, 123, 248, 143, 83, 1, 254, 171, 243, 123, 228, 115, 83, 1, 254, 171, 
+    243, 123, 217, 106, 83, 1, 254, 171, 243, 123, 248, 229, 83, 1, 254, 171, 
+    243, 123, 191, 83, 1, 254, 171, 243, 123, 225, 150, 83, 1, 254, 171, 243, 
+    123, 218, 225, 83, 1, 254, 171, 243, 123, 210, 82, 83, 1, 254, 171, 243, 
+    123, 210, 116, 83, 1, 254, 171, 243, 123, 254, 218, 83, 1, 216, 40, 254, 
+    171, 243, 123, 217, 106, 83, 1, 216, 40, 254, 171, 243, 123, 210, 82, 83, 
+    1, 231, 188, 254, 171, 243, 123, 243, 0, 83, 1, 231, 188, 254, 171, 243, 
+    123, 229, 82, 83, 1, 231, 188, 254, 171, 243, 123, 251, 41, 83, 1, 231, 
+    188, 254, 171, 243, 123, 235, 120, 83, 1, 231, 188, 254, 171, 243, 123, 
+    215, 157, 83, 1, 231, 188, 254, 171, 243, 123, 248, 127, 83, 1, 231, 188, 
+    254, 171, 243, 123, 217, 106, 83, 1, 231, 188, 254, 171, 243, 123, 248, 
+    33, 83, 1, 231, 188, 254, 171, 243, 123, 218, 225, 83, 1, 231, 188, 254, 
+    171, 243, 123, 249, 80, 83, 1, 231, 188, 254, 171, 243, 123, 210, 82, 83, 
+    1, 231, 188, 254, 171, 243, 123, 210, 116, 83, 1, 254, 171, 243, 123, 
+    163, 69, 83, 1, 254, 171, 243, 123, 163, 192, 83, 1, 231, 188, 254, 171, 
+    243, 123, 252, 26, 83, 1, 254, 171, 243, 123, 248, 219, 83, 1, 231, 188, 
+    254, 171, 243, 123, 233, 4, 18, 19, 226, 113, 18, 19, 253, 175, 18, 19, 
+    255, 37, 18, 19, 212, 25, 18, 19, 224, 224, 18, 19, 225, 233, 18, 19, 
+    224, 108, 18, 19, 217, 32, 18, 19, 234, 195, 18, 19, 233, 185, 18, 19, 
+    231, 137, 18, 19, 228, 42, 18, 19, 229, 186, 18, 19, 233, 74, 18, 19, 
+    219, 24, 18, 19, 221, 213, 18, 19, 219, 234, 18, 19, 220, 68, 18, 19, 
+    219, 203, 18, 19, 210, 220, 18, 19, 211, 52, 18, 19, 223, 137, 18, 19, 
+    227, 175, 18, 19, 226, 220, 227, 175, 18, 19, 227, 174, 18, 19, 226, 220, 
+    227, 174, 18, 19, 227, 173, 18, 19, 226, 220, 227, 173, 18, 19, 227, 172, 
+    18, 19, 226, 220, 227, 172, 18, 19, 222, 107, 18, 19, 222, 106, 18, 19, 
+    222, 105, 18, 19, 222, 104, 18, 19, 222, 103, 18, 19, 222, 111, 18, 19, 
+    226, 220, 226, 109, 18, 19, 226, 220, 217, 153, 18, 19, 226, 220, 235, 
+    29, 18, 19, 226, 220, 251, 74, 18, 19, 226, 220, 194, 18, 19, 226, 220, 
+    230, 30, 18, 19, 226, 220, 222, 93, 18, 19, 226, 220, 220, 106, 18, 19, 
+    245, 227, 212, 98, 18, 19, 212, 7, 212, 98, 18, 19, 40, 4, 222, 236, 18, 
+    19, 40, 223, 160, 247, 128, 18, 19, 223, 226, 222, 108, 18, 19, 159, 232, 
+    133, 18, 19, 159, 233, 140, 18, 19, 216, 127, 18, 19, 216, 129, 18, 19, 
+    215, 137, 18, 19, 215, 139, 18, 19, 215, 144, 18, 19, 216, 50, 18, 19, 
+    216, 52, 18, 19, 221, 211, 219, 208, 18, 19, 221, 211, 220, 3, 18, 19, 
+    221, 211, 241, 60, 18, 19, 73, 242, 80, 18, 19, 73, 248, 60, 243, 62, 18, 
+    19, 73, 243, 139, 18, 19, 73, 242, 85, 18, 19, 221, 211, 235, 39, 18, 19, 
+    73, 235, 37, 18, 19, 252, 76, 248, 60, 156, 18, 19, 252, 76, 248, 60, 
+    153, 18, 19, 73, 248, 55, 222, 93, 232, 229, 213, 122, 233, 16, 232, 229, 
+    1, 176, 232, 229, 1, 234, 138, 232, 229, 1, 243, 142, 232, 229, 1, 243, 
+    0, 232, 229, 1, 229, 82, 232, 229, 1, 251, 41, 232, 229, 1, 250, 165, 
+    232, 229, 1, 235, 147, 232, 229, 1, 235, 120, 232, 229, 1, 211, 71, 232, 
+    229, 1, 217, 106, 232, 229, 1, 216, 209, 232, 229, 1, 248, 229, 232, 229, 
+    1, 248, 33, 232, 229, 1, 198, 232, 229, 1, 191, 232, 229, 1, 225, 150, 
+    232, 229, 1, 252, 199, 232, 229, 1, 252, 26, 232, 229, 1, 186, 232, 229, 
+    1, 192, 232, 229, 1, 205, 232, 229, 1, 233, 141, 232, 229, 1, 212, 65, 
+    232, 229, 1, 220, 104, 232, 229, 1, 218, 225, 232, 229, 1, 206, 232, 229, 
+    1, 162, 232, 229, 25, 5, 61, 232, 229, 25, 5, 74, 232, 229, 25, 5, 69, 
+    232, 229, 25, 5, 245, 217, 232, 229, 25, 5, 254, 210, 232, 229, 25, 5, 
+    226, 187, 232, 229, 25, 5, 253, 200, 232, 229, 25, 5, 76, 232, 229, 25, 
+    5, 78, 232, 229, 218, 74, 1, 192, 232, 229, 218, 74, 1, 205, 232, 229, 
+    218, 74, 1, 212, 65, 232, 229, 4, 1, 176, 232, 229, 4, 1, 229, 82, 232, 
+    229, 4, 1, 254, 83, 232, 229, 4, 1, 217, 106, 232, 229, 4, 1, 198, 232, 
+    229, 4, 1, 191, 232, 229, 4, 1, 186, 232, 229, 4, 1, 205, 232, 229, 4, 1, 
+    233, 141, 232, 229, 5, 230, 94, 232, 229, 5, 234, 177, 232, 229, 5, 222, 
+    34, 232, 229, 5, 232, 133, 232, 229, 245, 39, 79, 232, 229, 224, 16, 79, 
+    232, 229, 21, 210, 86, 232, 229, 21, 111, 232, 229, 21, 105, 232, 229, 
+    21, 158, 232, 229, 21, 161, 232, 229, 21, 190, 232, 229, 21, 195, 232, 
+    229, 21, 199, 232, 229, 21, 196, 232, 229, 21, 201, 39, 233, 65, 1, 176, 
+    39, 233, 65, 1, 211, 165, 39, 233, 65, 1, 229, 82, 39, 233, 65, 1, 215, 
+    184, 39, 233, 65, 1, 206, 39, 233, 65, 1, 192, 39, 233, 65, 1, 217, 106, 
+    39, 233, 65, 1, 216, 209, 39, 233, 65, 1, 233, 141, 39, 233, 65, 1, 191, 
+    39, 233, 65, 1, 225, 150, 39, 233, 65, 1, 186, 39, 233, 65, 1, 244, 204, 
+    39, 233, 65, 1, 214, 27, 39, 233, 65, 1, 162, 39, 233, 65, 1, 224, 91, 
+    39, 233, 65, 1, 234, 138, 39, 233, 65, 1, 215, 176, 39, 233, 65, 1, 198, 
+    39, 233, 65, 1, 61, 39, 233, 65, 1, 74, 39, 233, 65, 1, 245, 217, 39, 
+    233, 65, 1, 245, 205, 39, 233, 65, 1, 69, 39, 233, 65, 1, 226, 187, 39, 
+    233, 65, 1, 78, 39, 233, 65, 1, 214, 214, 39, 233, 65, 1, 76, 39, 233, 
+    65, 1, 253, 198, 39, 233, 65, 1, 254, 210, 39, 233, 65, 1, 216, 29, 39, 
+    233, 65, 1, 216, 28, 39, 233, 65, 1, 216, 27, 39, 233, 65, 1, 216, 26, 
+    39, 233, 65, 1, 216, 25, 166, 39, 173, 1, 125, 224, 91, 166, 39, 173, 1, 
+    121, 224, 91, 166, 39, 173, 1, 125, 176, 166, 39, 173, 1, 125, 211, 165, 
+    166, 39, 173, 1, 125, 229, 82, 166, 39, 173, 1, 121, 176, 166, 39, 173, 
+    1, 121, 211, 165, 166, 39, 173, 1, 121, 229, 82, 166, 39, 173, 1, 125, 
+    215, 184, 166, 39, 173, 1, 125, 206, 166, 39, 173, 1, 125, 192, 166, 39, 
+    173, 1, 121, 215, 184, 166, 39, 173, 1, 121, 206, 166, 39, 173, 1, 121, 
+    192, 166, 39, 173, 1, 125, 217, 106, 166, 39, 173, 1, 125, 216, 209, 166, 
+    39, 173, 1, 125, 198, 166, 39, 173, 1, 121, 217, 106, 166, 39, 173, 1, 
+    121, 216, 209, 166, 39, 173, 1, 121, 198, 166, 39, 173, 1, 125, 191, 166, 
+    39, 173, 1, 125, 225, 150, 166, 39, 173, 1, 125, 186, 166, 39, 173, 1, 
+    121, 191, 166, 39, 173, 1, 121, 225, 150, 166, 39, 173, 1, 121, 186, 166, 
+    39, 173, 1, 125, 244, 204, 166, 39, 173, 1, 125, 214, 27, 166, 39, 173, 
+    1, 125, 233, 141, 166, 39, 173, 1, 121, 244, 204, 166, 39, 173, 1, 121, 
+    214, 27, 166, 39, 173, 1, 121, 233, 141, 166, 39, 173, 1, 125, 162, 166, 
+    39, 173, 1, 125, 248, 229, 166, 39, 173, 1, 125, 252, 199, 166, 39, 173, 
+    1, 121, 162, 166, 39, 173, 1, 121, 248, 229, 166, 39, 173, 1, 121, 252, 
+    199, 166, 39, 173, 1, 125, 233, 190, 166, 39, 173, 1, 125, 211, 138, 166, 
+    39, 173, 1, 121, 233, 190, 166, 39, 173, 1, 121, 211, 138, 166, 39, 173, 
+    1, 125, 218, 83, 166, 39, 173, 1, 121, 218, 83, 166, 39, 173, 25, 5, 25, 
+    219, 241, 166, 39, 173, 25, 5, 255, 82, 166, 39, 173, 25, 5, 236, 40, 
+    166, 39, 173, 25, 5, 69, 166, 39, 173, 25, 5, 214, 118, 166, 39, 173, 25, 
+    5, 76, 166, 39, 173, 25, 5, 254, 252, 166, 39, 173, 25, 5, 78, 166, 39, 
+    173, 25, 5, 227, 4, 166, 39, 173, 25, 5, 214, 214, 166, 39, 173, 25, 5, 
+    253, 175, 166, 39, 173, 25, 5, 255, 37, 166, 39, 173, 25, 5, 214, 111, 
+    166, 39, 173, 25, 5, 226, 113, 166, 39, 173, 25, 5, 227, 1, 166, 39, 173, 
+    25, 5, 214, 210, 166, 39, 173, 25, 5, 235, 158, 166, 39, 173, 1, 40, 214, 
+    105, 166, 39, 173, 1, 40, 229, 84, 166, 39, 173, 1, 40, 230, 30, 166, 39, 
+    173, 1, 40, 194, 166, 39, 173, 1, 40, 235, 29, 166, 39, 173, 1, 40, 249, 
+    68, 166, 39, 173, 1, 40, 253, 166, 166, 39, 173, 138, 231, 163, 166, 39, 
+    173, 138, 231, 162, 166, 39, 173, 21, 210, 86, 166, 39, 173, 21, 111, 
+    166, 39, 173, 21, 105, 166, 39, 173, 21, 158, 166, 39, 173, 21, 161, 166, 
+    39, 173, 21, 190, 166, 39, 173, 21, 195, 166, 39, 173, 21, 199, 166, 39, 
+    173, 21, 196, 166, 39, 173, 21, 201, 166, 39, 173, 89, 21, 111, 166, 39, 
+    173, 5, 233, 126, 166, 39, 173, 5, 233, 125, 70, 16, 225, 240, 70, 16, 
+    230, 77, 234, 31, 70, 16, 225, 75, 234, 31, 70, 16, 252, 58, 234, 31, 70, 
+    16, 251, 112, 234, 31, 70, 16, 224, 219, 234, 31, 70, 16, 224, 213, 234, 
+    31, 70, 16, 224, 211, 234, 31, 70, 16, 224, 217, 234, 31, 70, 16, 224, 
+    215, 234, 31, 70, 16, 248, 181, 234, 31, 70, 16, 248, 177, 234, 31, 70, 
+    16, 248, 176, 234, 31, 70, 16, 248, 179, 234, 31, 70, 16, 248, 178, 234, 
+    31, 70, 16, 248, 175, 234, 31, 70, 16, 215, 87, 70, 16, 230, 77, 222, 
+    207, 70, 16, 225, 75, 222, 207, 70, 16, 252, 58, 222, 207, 70, 16, 251, 
+    112, 222, 207, 70, 16, 224, 219, 222, 207, 70, 16, 224, 213, 222, 207, 
+    70, 16, 224, 211, 222, 207, 70, 16, 224, 217, 222, 207, 70, 16, 224, 215, 
+    222, 207, 70, 16, 248, 181, 222, 207, 70, 16, 248, 177, 222, 207, 70, 16, 
+    248, 176, 222, 207, 70, 16, 248, 179, 222, 207, 70, 16, 248, 178, 222, 
+    207, 70, 16, 248, 175, 222, 207, 251, 129, 1, 176, 251, 129, 1, 243, 142, 
+    251, 129, 1, 229, 82, 251, 129, 1, 229, 27, 251, 129, 1, 191, 251, 129, 
+    1, 252, 199, 251, 129, 1, 186, 251, 129, 1, 230, 110, 251, 129, 1, 217, 
+    106, 251, 129, 1, 248, 229, 251, 129, 1, 198, 251, 129, 1, 228, 41, 251, 
+    129, 1, 251, 41, 251, 129, 1, 235, 147, 251, 129, 1, 227, 169, 251, 129, 
+    1, 227, 162, 251, 129, 1, 192, 251, 129, 1, 205, 251, 129, 1, 233, 141, 
+    251, 129, 1, 214, 27, 251, 129, 1, 206, 251, 129, 1, 61, 251, 129, 1, 
+    162, 251, 129, 25, 5, 74, 251, 129, 25, 5, 69, 251, 129, 25, 5, 76, 251, 
+    129, 25, 5, 78, 251, 129, 25, 5, 254, 252, 251, 129, 226, 64, 251, 129, 
+    245, 151, 64, 221, 174, 39, 89, 1, 125, 176, 39, 89, 1, 125, 234, 138, 
+    39, 89, 1, 125, 233, 177, 39, 89, 1, 121, 176, 39, 89, 1, 121, 233, 177, 
+    39, 89, 1, 121, 234, 138, 39, 89, 1, 229, 82, 39, 89, 1, 125, 251, 41, 
+    39, 89, 1, 125, 250, 165, 39, 89, 1, 121, 251, 41, 39, 89, 1, 121, 206, 
+    39, 89, 1, 121, 250, 165, 39, 89, 1, 227, 169, 39, 89, 1, 223, 143, 39, 
+    89, 1, 125, 223, 141, 39, 89, 1, 248, 229, 39, 89, 1, 121, 223, 141, 39, 
+    89, 1, 223, 152, 39, 89, 1, 125, 217, 106, 39, 89, 1, 125, 216, 209, 39, 
+    89, 1, 121, 217, 106, 39, 89, 1, 121, 216, 209, 39, 89, 1, 198, 39, 89, 
+    1, 252, 199, 39, 89, 1, 125, 191, 39, 89, 1, 125, 225, 150, 39, 89, 1, 
+    125, 244, 204, 39, 89, 1, 121, 191, 39, 89, 1, 121, 244, 204, 39, 89, 1, 
+    121, 225, 150, 39, 89, 1, 186, 39, 89, 1, 121, 192, 39, 89, 1, 125, 192, 
+    39, 89, 1, 205, 39, 89, 1, 222, 139, 39, 89, 1, 233, 141, 39, 89, 1, 232, 
+    98, 39, 89, 1, 212, 65, 39, 89, 1, 125, 220, 104, 39, 89, 1, 125, 218, 
+    225, 39, 89, 1, 125, 206, 39, 89, 1, 125, 162, 39, 89, 1, 232, 190, 39, 
+    89, 1, 61, 39, 89, 1, 121, 162, 39, 89, 1, 74, 39, 89, 1, 236, 40, 39, 
+    89, 1, 69, 39, 89, 1, 214, 118, 39, 89, 1, 245, 217, 39, 89, 1, 226, 187, 
+    39, 89, 1, 233, 126, 39, 89, 1, 242, 139, 206, 39, 89, 117, 5, 147, 205, 
+    39, 89, 117, 5, 147, 233, 141, 39, 89, 117, 5, 233, 142, 217, 59, 233, 
+    115, 39, 89, 5, 231, 209, 234, 237, 233, 115, 39, 89, 117, 5, 40, 229, 
+    82, 39, 89, 117, 5, 121, 191, 39, 89, 117, 5, 125, 223, 142, 177, 121, 
+    191, 39, 89, 117, 5, 186, 39, 89, 117, 5, 252, 199, 39, 89, 117, 5, 206, 
+    39, 89, 5, 222, 12, 39, 89, 25, 5, 61, 39, 89, 25, 5, 231, 209, 221, 228, 
+    39, 89, 25, 5, 255, 82, 39, 89, 25, 5, 217, 65, 255, 82, 39, 89, 25, 5, 
+    74, 39, 89, 25, 5, 236, 40, 39, 89, 25, 5, 214, 214, 39, 89, 25, 5, 214, 
+    117, 39, 89, 25, 5, 69, 39, 89, 25, 5, 214, 118, 39, 89, 25, 5, 78, 39, 
+    89, 25, 5, 227, 5, 51, 39, 89, 25, 5, 226, 113, 39, 89, 25, 5, 76, 39, 
+    89, 25, 5, 254, 252, 39, 89, 25, 5, 226, 187, 39, 89, 25, 5, 254, 210, 
+    39, 89, 25, 5, 89, 254, 210, 39, 89, 25, 5, 227, 5, 48, 39, 89, 5, 231, 
+    209, 234, 236, 39, 89, 5, 216, 30, 39, 89, 5, 216, 29, 39, 89, 5, 234, 
+    103, 216, 28, 39, 89, 5, 234, 103, 216, 27, 39, 89, 5, 234, 103, 216, 26, 
+    39, 89, 5, 223, 191, 242, 52, 39, 89, 5, 231, 209, 221, 255, 39, 89, 5, 
+    234, 102, 234, 221, 39, 89, 38, 249, 123, 247, 128, 39, 89, 241, 53, 21, 
+    210, 86, 39, 89, 241, 53, 21, 111, 39, 89, 241, 53, 21, 105, 39, 89, 241, 
+    53, 21, 158, 39, 89, 241, 53, 21, 161, 39, 89, 241, 53, 21, 190, 39, 89, 
+    241, 53, 21, 195, 39, 89, 241, 53, 21, 199, 39, 89, 241, 53, 21, 196, 39, 
+    89, 241, 53, 21, 201, 39, 89, 89, 21, 210, 86, 39, 89, 89, 21, 111, 39, 
+    89, 89, 21, 105, 39, 89, 89, 21, 158, 39, 89, 89, 21, 161, 39, 89, 89, 
+    21, 190, 39, 89, 89, 21, 195, 39, 89, 89, 21, 199, 39, 89, 89, 21, 196, 
+    39, 89, 89, 21, 201, 39, 89, 5, 211, 249, 39, 89, 5, 211, 248, 39, 89, 5, 
+    221, 217, 39, 89, 5, 234, 166, 39, 89, 5, 240, 239, 39, 89, 5, 247, 142, 
+    39, 89, 5, 223, 52, 222, 189, 223, 152, 39, 89, 5, 231, 209, 211, 72, 39, 
+    89, 5, 235, 12, 39, 89, 5, 235, 11, 39, 89, 5, 221, 224, 39, 89, 5, 221, 
+    223, 39, 89, 5, 242, 16, 39, 89, 5, 251, 38, 102, 5, 214, 200, 223, 33, 
+    102, 5, 214, 200, 251, 9, 102, 5, 250, 194, 102, 5, 218, 16, 102, 5, 251, 
+    241, 102, 1, 254, 193, 102, 1, 254, 194, 217, 14, 102, 1, 236, 36, 102, 
+    1, 236, 37, 217, 14, 102, 1, 214, 203, 102, 1, 214, 204, 217, 14, 102, 1, 
+    223, 191, 223, 82, 102, 1, 223, 191, 223, 83, 217, 14, 102, 1, 233, 142, 
+    233, 30, 102, 1, 233, 142, 233, 31, 217, 14, 102, 1, 245, 187, 102, 1, 
+    254, 208, 102, 1, 226, 216, 102, 1, 226, 217, 217, 14, 102, 1, 176, 102, 
+    1, 235, 19, 231, 212, 102, 1, 243, 142, 102, 1, 243, 143, 242, 168, 102, 
+    1, 229, 82, 102, 1, 251, 41, 102, 1, 251, 42, 233, 129, 102, 1, 235, 147, 
+    102, 1, 235, 148, 235, 124, 102, 1, 227, 169, 102, 1, 217, 107, 233, 82, 
+    102, 1, 217, 107, 230, 72, 231, 212, 102, 1, 248, 230, 230, 72, 254, 153, 
+    102, 1, 248, 230, 230, 72, 231, 212, 102, 1, 229, 234, 223, 155, 102, 1, 
+    217, 106, 102, 1, 217, 107, 217, 36, 102, 1, 248, 229, 102, 1, 248, 230, 
+    231, 230, 102, 1, 198, 102, 1, 191, 102, 1, 226, 94, 234, 232, 102, 1, 
+    252, 199, 102, 1, 252, 200, 234, 178, 102, 1, 186, 102, 1, 192, 102, 1, 
+    205, 102, 1, 233, 141, 102, 1, 212, 65, 102, 1, 222, 36, 222, 22, 102, 1, 
+    222, 36, 221, 235, 102, 1, 206, 102, 1, 162, 102, 5, 223, 73, 102, 25, 5, 
+    217, 14, 102, 25, 5, 214, 199, 102, 25, 5, 214, 200, 221, 231, 102, 25, 
+    5, 218, 48, 102, 25, 5, 218, 49, 236, 28, 102, 25, 5, 223, 191, 223, 82, 
+    102, 25, 5, 223, 191, 223, 83, 217, 14, 102, 25, 5, 233, 142, 233, 30, 
+    102, 25, 5, 233, 142, 233, 31, 217, 14, 102, 25, 5, 217, 66, 102, 25, 5, 
+    217, 67, 223, 82, 102, 25, 5, 217, 67, 217, 14, 102, 25, 5, 217, 67, 223, 
+    83, 217, 14, 102, 25, 5, 225, 187, 102, 25, 5, 225, 188, 217, 14, 102, 
+    255, 3, 255, 2, 102, 1, 235, 1, 221, 230, 102, 1, 234, 108, 221, 230, 
+    102, 1, 215, 34, 221, 230, 102, 1, 245, 211, 221, 230, 102, 1, 214, 0, 
+    221, 230, 102, 1, 210, 107, 221, 230, 102, 1, 253, 217, 221, 230, 102, 
+    21, 210, 86, 102, 21, 111, 102, 21, 105, 102, 21, 158, 102, 21, 161, 102, 
+    21, 190, 102, 21, 195, 102, 21, 199, 102, 21, 196, 102, 21, 201, 102, 
+    226, 33, 102, 226, 59, 102, 211, 238, 102, 250, 244, 226, 52, 102, 250, 
+    244, 219, 174, 102, 250, 244, 226, 6, 102, 226, 58, 102, 28, 16, 247, 
+    134, 102, 28, 16, 248, 59, 102, 28, 16, 246, 72, 102, 28, 16, 248, 184, 
+    102, 28, 16, 248, 185, 218, 16, 102, 28, 16, 247, 213, 102, 28, 16, 248, 
+    222, 102, 28, 16, 248, 41, 102, 28, 16, 248, 206, 102, 28, 16, 248, 185, 
+    243, 64, 102, 28, 16, 38, 217, 10, 102, 28, 16, 38, 245, 149, 102, 28, 
+    16, 38, 234, 173, 102, 28, 16, 38, 234, 175, 102, 28, 16, 38, 235, 128, 
+    102, 28, 16, 38, 234, 174, 2, 235, 128, 102, 28, 16, 38, 234, 176, 2, 
+    235, 128, 102, 28, 16, 38, 252, 45, 102, 28, 16, 38, 242, 172, 102, 28, 
+    16, 222, 252, 204, 246, 82, 102, 28, 16, 222, 252, 204, 248, 220, 102, 
+    28, 16, 222, 252, 250, 8, 215, 112, 102, 28, 16, 222, 252, 250, 8, 217, 
+    74, 102, 28, 16, 233, 50, 204, 226, 47, 102, 28, 16, 233, 50, 204, 224, 
+    142, 102, 28, 16, 233, 50, 250, 8, 225, 41, 102, 28, 16, 233, 50, 250, 8, 
+    225, 29, 102, 28, 16, 233, 50, 204, 225, 64, 207, 5, 226, 30, 207, 5, 
+    226, 43, 207, 5, 226, 39, 207, 1, 61, 207, 1, 74, 207, 1, 69, 207, 1, 
+    254, 252, 207, 1, 78, 207, 1, 76, 207, 1, 245, 63, 207, 1, 176, 207, 1, 
+    224, 91, 207, 1, 243, 142, 207, 1, 229, 82, 207, 1, 251, 41, 207, 1, 235, 
+    147, 207, 1, 210, 116, 207, 1, 227, 169, 207, 1, 217, 106, 207, 1, 248, 
+    229, 207, 1, 198, 207, 1, 191, 207, 1, 244, 204, 207, 1, 214, 27, 207, 1, 
+    252, 199, 207, 1, 186, 207, 1, 192, 207, 1, 205, 207, 1, 233, 141, 207, 
+    1, 212, 65, 207, 1, 206, 207, 1, 211, 165, 207, 1, 162, 207, 117, 5, 226, 
+    56, 207, 117, 5, 226, 32, 207, 117, 5, 226, 29, 207, 25, 5, 226, 46, 207, 
+    25, 5, 226, 28, 207, 25, 5, 226, 50, 207, 25, 5, 226, 38, 207, 25, 5, 
+    226, 57, 207, 25, 5, 226, 48, 207, 5, 226, 60, 207, 5, 213, 152, 207, 
+    117, 5, 225, 252, 186, 207, 117, 5, 225, 252, 212, 65, 207, 1, 234, 138, 
+    207, 1, 217, 232, 207, 21, 210, 86, 207, 21, 111, 207, 21, 105, 207, 21, 
+    158, 207, 21, 161, 207, 21, 190, 207, 21, 195, 207, 21, 199, 207, 21, 
+    196, 207, 21, 201, 207, 253, 183, 207, 1, 223, 55, 207, 1, 233, 13, 207, 
+    1, 252, 26, 207, 1, 40, 235, 29, 207, 1, 40, 194, 252, 128, 1, 61, 252, 
+    128, 1, 219, 166, 61, 252, 128, 1, 162, 252, 128, 1, 219, 166, 162, 252, 
+    128, 1, 231, 186, 162, 252, 128, 1, 252, 199, 252, 128, 1, 234, 218, 252, 
+    199, 252, 128, 1, 191, 252, 128, 1, 219, 166, 191, 252, 128, 1, 198, 252, 
+    128, 1, 231, 186, 198, 252, 128, 1, 212, 65, 252, 128, 1, 219, 166, 212, 
+    65, 252, 128, 1, 226, 71, 212, 65, 252, 128, 1, 243, 142, 252, 128, 1, 
+    219, 166, 243, 142, 252, 128, 1, 235, 147, 252, 128, 1, 248, 229, 252, 
+    128, 1, 205, 252, 128, 1, 219, 166, 205, 252, 128, 1, 186, 252, 128, 1, 
+    219, 166, 186, 252, 128, 1, 219, 28, 217, 106, 252, 128, 1, 228, 60, 217, 
+    106, 252, 128, 1, 206, 252, 128, 1, 219, 166, 206, 252, 128, 1, 231, 186, 
+    206, 252, 128, 1, 192, 252, 128, 1, 219, 166, 192, 252, 128, 1, 229, 82, 
+    252, 128, 1, 233, 141, 252, 128, 1, 219, 166, 233, 141, 252, 128, 1, 227, 
+    169, 252, 128, 1, 251, 41, 252, 128, 1, 229, 153, 252, 128, 1, 231, 129, 
+    252, 128, 1, 74, 252, 128, 1, 69, 252, 128, 5, 216, 34, 252, 128, 25, 5, 
+    76, 252, 128, 25, 5, 226, 71, 76, 252, 128, 25, 5, 245, 217, 252, 128, 
+    25, 5, 74, 252, 128, 25, 5, 234, 218, 74, 252, 128, 25, 5, 78, 252, 128, 
+    25, 5, 234, 218, 78, 252, 128, 25, 5, 69, 252, 128, 25, 5, 104, 31, 219, 
+    166, 206, 252, 128, 117, 5, 229, 84, 252, 128, 117, 5, 242, 67, 252, 128, 
+    226, 41, 252, 128, 226, 37, 252, 128, 16, 251, 249, 229, 234, 231, 42, 
+    252, 128, 16, 251, 249, 225, 67, 252, 128, 16, 251, 249, 235, 54, 252, 
+    128, 16, 251, 249, 226, 41, 197, 1, 176, 197, 1, 234, 45, 197, 1, 234, 
+    138, 197, 1, 243, 142, 197, 1, 242, 193, 197, 1, 229, 82, 197, 1, 251, 
+    41, 197, 1, 250, 165, 197, 1, 235, 147, 197, 1, 227, 169, 197, 1, 217, 
+    106, 197, 1, 216, 209, 197, 1, 248, 229, 197, 1, 198, 197, 1, 191, 197, 
+    1, 225, 45, 197, 1, 225, 150, 197, 1, 244, 204, 197, 1, 244, 83, 197, 1, 
+    252, 199, 197, 1, 251, 230, 197, 1, 186, 197, 1, 230, 173, 197, 1, 215, 
+    184, 197, 1, 215, 176, 197, 1, 246, 46, 197, 1, 192, 197, 1, 205, 197, 1, 
+    233, 141, 197, 1, 162, 197, 1, 241, 160, 197, 1, 214, 27, 197, 1, 206, 
+    197, 1, 220, 104, 197, 1, 212, 65, 197, 1, 61, 197, 218, 74, 1, 192, 197, 
+    218, 74, 1, 205, 197, 25, 5, 255, 82, 197, 25, 5, 74, 197, 25, 5, 78, 
+    197, 25, 5, 226, 187, 197, 25, 5, 69, 197, 25, 5, 214, 118, 197, 25, 5, 
+    76, 197, 117, 5, 235, 29, 197, 117, 5, 194, 197, 117, 5, 156, 197, 117, 
+    5, 230, 30, 197, 117, 5, 226, 109, 197, 117, 5, 153, 197, 117, 5, 217, 
+    153, 197, 117, 5, 227, 146, 197, 117, 5, 234, 236, 197, 5, 223, 153, 197, 
+    5, 227, 209, 197, 224, 144, 217, 104, 197, 224, 144, 227, 156, 216, 121, 
+    217, 104, 197, 224, 144, 250, 172, 197, 224, 144, 215, 171, 250, 172, 
+    197, 224, 144, 215, 170, 197, 21, 210, 86, 197, 21, 111, 197, 21, 105, 
+    197, 21, 158, 197, 21, 161, 197, 21, 190, 197, 21, 195, 197, 21, 199, 
+    197, 21, 196, 197, 21, 201, 197, 1, 215, 157, 197, 1, 215, 145, 197, 1, 
+    248, 143, 226, 214, 250, 111, 21, 210, 86, 226, 214, 250, 111, 21, 111, 
+    226, 214, 250, 111, 21, 105, 226, 214, 250, 111, 21, 158, 226, 214, 250, 
+    111, 21, 161, 226, 214, 250, 111, 21, 190, 226, 214, 250, 111, 21, 195, 
+    226, 214, 250, 111, 21, 199, 226, 214, 250, 111, 21, 196, 226, 214, 250, 
+    111, 21, 201, 226, 214, 250, 111, 1, 233, 141, 226, 214, 250, 111, 1, 
+    253, 214, 226, 214, 250, 111, 1, 254, 225, 226, 214, 250, 111, 1, 254, 
+    123, 226, 214, 250, 111, 1, 254, 187, 226, 214, 250, 111, 1, 233, 140, 
+    226, 214, 250, 111, 1, 255, 44, 226, 214, 250, 111, 1, 255, 45, 226, 214, 
+    250, 111, 1, 255, 43, 226, 214, 250, 111, 1, 255, 38, 226, 214, 250, 111, 
+    1, 232, 247, 226, 214, 250, 111, 1, 235, 178, 226, 214, 250, 111, 1, 236, 
+    41, 226, 214, 250, 111, 1, 235, 197, 226, 214, 250, 111, 1, 235, 186, 
+    226, 214, 250, 111, 1, 232, 103, 226, 214, 250, 111, 1, 214, 221, 226, 
+    214, 250, 111, 1, 214, 219, 226, 214, 250, 111, 1, 214, 168, 226, 214, 
+    250, 111, 1, 214, 111, 226, 214, 250, 111, 1, 233, 64, 226, 214, 250, 
+    111, 1, 245, 116, 226, 214, 250, 111, 1, 245, 220, 226, 214, 250, 111, 1, 
+    245, 158, 226, 214, 250, 111, 1, 245, 94, 226, 214, 250, 111, 1, 232, 
+    162, 226, 214, 250, 111, 1, 226, 141, 226, 214, 250, 111, 1, 227, 0, 226, 
+    214, 250, 111, 1, 226, 129, 226, 214, 250, 111, 1, 226, 226, 226, 214, 
+    250, 111, 230, 108, 215, 122, 226, 214, 250, 111, 243, 137, 215, 123, 
+    226, 214, 250, 111, 230, 106, 215, 123, 226, 214, 250, 111, 223, 95, 226, 
+    214, 250, 111, 225, 148, 226, 214, 250, 111, 254, 217, 226, 214, 250, 
+    111, 224, 144, 230, 103, 226, 214, 250, 111, 224, 144, 52, 230, 103, 207, 
+    224, 144, 251, 249, 218, 9, 207, 224, 144, 251, 249, 226, 42, 207, 224, 
+    144, 251, 249, 224, 132, 207, 224, 144, 251, 249, 251, 27, 207, 224, 144, 
+    251, 249, 233, 14, 221, 227, 207, 224, 144, 251, 249, 235, 19, 221, 227, 
+    207, 224, 144, 251, 249, 248, 230, 221, 227, 207, 224, 144, 251, 249, 
+    252, 200, 221, 227, 213, 252, 138, 234, 216, 213, 252, 138, 220, 79, 213, 
+    252, 138, 224, 201, 213, 252, 5, 228, 214, 213, 252, 5, 211, 80, 230, 
+    227, 218, 1, 213, 252, 138, 211, 80, 254, 222, 235, 250, 218, 1, 213, 
+    252, 138, 211, 80, 235, 250, 218, 1, 213, 252, 138, 211, 80, 234, 204, 
+    235, 250, 218, 1, 213, 252, 138, 251, 10, 51, 213, 252, 138, 211, 80, 
+    234, 204, 235, 250, 218, 2, 221, 199, 213, 252, 138, 52, 218, 1, 213, 
+    252, 138, 215, 212, 218, 1, 213, 252, 138, 234, 204, 254, 85, 213, 252, 
+    138, 59, 51, 213, 252, 138, 113, 170, 51, 213, 252, 138, 134, 170, 51, 
+    213, 252, 138, 222, 243, 234, 215, 235, 250, 218, 1, 213, 252, 138, 253, 
+    212, 235, 250, 218, 1, 213, 252, 5, 213, 148, 218, 1, 213, 252, 5, 213, 
+    148, 214, 216, 213, 252, 5, 223, 52, 213, 148, 214, 216, 213, 252, 5, 
+    213, 148, 254, 85, 213, 252, 5, 223, 52, 213, 148, 254, 85, 213, 252, 5, 
+    213, 148, 214, 217, 2, 217, 78, 213, 252, 5, 213, 148, 254, 86, 2, 217, 
+    78, 213, 252, 5, 254, 84, 254, 99, 213, 252, 5, 254, 84, 252, 174, 213, 
+    252, 5, 254, 84, 214, 20, 213, 252, 5, 254, 84, 214, 21, 2, 217, 78, 213, 
+    252, 5, 216, 69, 213, 252, 5, 241, 198, 200, 254, 83, 213, 252, 5, 200, 
+    254, 83, 213, 252, 5, 222, 144, 200, 254, 83, 213, 252, 5, 254, 84, 214, 
+    223, 230, 95, 213, 252, 5, 254, 28, 213, 252, 5, 222, 189, 254, 28, 213, 
+    252, 138, 251, 10, 48, 213, 252, 5, 235, 108, 213, 252, 5, 214, 161, 7, 
+    1, 4, 6, 61, 7, 1, 4, 6, 254, 252, 7, 4, 1, 215, 94, 254, 252, 7, 1, 4, 
+    6, 252, 142, 253, 166, 7, 1, 4, 6, 251, 74, 7, 1, 4, 6, 249, 68, 7, 1, 4, 
+    6, 245, 67, 7, 1, 4, 6, 76, 7, 4, 1, 215, 94, 204, 76, 7, 4, 1, 215, 94, 
+    74, 7, 1, 4, 6, 235, 150, 7, 1, 4, 6, 235, 29, 7, 1, 4, 6, 233, 155, 2, 
+    91, 7, 1, 4, 6, 194, 7, 1, 4, 6, 223, 52, 230, 30, 7, 1, 4, 6, 78, 7, 1, 
+    4, 6, 204, 78, 7, 4, 1, 219, 189, 78, 7, 4, 1, 219, 189, 204, 78, 7, 4, 
+    1, 219, 189, 144, 2, 91, 7, 4, 1, 215, 94, 226, 238, 7, 1, 4, 6, 226, 
+    138, 7, 4, 1, 216, 15, 163, 78, 7, 4, 1, 251, 183, 163, 78, 7, 1, 4, 6, 
+    226, 109, 7, 1, 4, 6, 223, 52, 153, 7, 1, 4, 6, 215, 94, 153, 7, 1, 4, 6, 
+    217, 153, 7, 1, 4, 6, 69, 7, 4, 1, 219, 189, 69, 7, 4, 1, 219, 189, 248, 
+    8, 69, 7, 4, 1, 219, 189, 215, 94, 194, 7, 1, 4, 6, 214, 105, 7, 1, 4, 6, 
+    212, 98, 7, 1, 4, 6, 210, 159, 7, 1, 4, 6, 245, 16, 7, 1, 213, 135, 233, 
+    88, 218, 252, 7, 1, 254, 205, 26, 1, 4, 6, 243, 114, 26, 1, 4, 6, 233, 
+    104, 26, 1, 4, 6, 225, 111, 26, 1, 4, 6, 223, 40, 26, 1, 4, 6, 224, 164, 
+    33, 1, 4, 6, 245, 182, 58, 1, 6, 61, 58, 1, 6, 254, 252, 58, 1, 6, 253, 
+    166, 58, 1, 6, 252, 142, 253, 166, 58, 1, 6, 249, 68, 58, 1, 6, 76, 58, 
+    1, 6, 223, 52, 76, 58, 1, 6, 243, 209, 58, 1, 6, 242, 67, 58, 1, 6, 74, 
+    58, 1, 6, 235, 150, 58, 1, 6, 235, 29, 58, 1, 6, 156, 58, 1, 6, 194, 58, 
+    1, 6, 230, 30, 58, 1, 6, 223, 52, 230, 30, 58, 1, 6, 78, 58, 1, 6, 226, 
+    138, 58, 1, 6, 226, 109, 58, 1, 6, 153, 58, 1, 6, 217, 153, 58, 1, 6, 69, 
+    58, 1, 6, 212, 98, 58, 1, 4, 61, 58, 1, 4, 215, 94, 61, 58, 1, 4, 254, 
+    151, 58, 1, 4, 215, 94, 254, 252, 58, 1, 4, 253, 166, 58, 1, 4, 249, 68, 
+    58, 1, 4, 76, 58, 1, 4, 221, 197, 58, 1, 4, 204, 76, 58, 1, 4, 215, 94, 
+    204, 76, 58, 1, 4, 243, 209, 58, 1, 4, 215, 94, 74, 58, 1, 4, 235, 29, 
+    58, 1, 4, 194, 58, 1, 4, 245, 146, 58, 1, 4, 78, 58, 1, 4, 204, 78, 58, 
+    1, 4, 216, 15, 163, 78, 58, 1, 4, 251, 183, 163, 78, 58, 1, 4, 226, 109, 
+    58, 1, 4, 217, 153, 58, 1, 4, 69, 58, 1, 4, 219, 189, 69, 58, 1, 4, 215, 
+    94, 194, 58, 1, 4, 214, 105, 58, 1, 4, 254, 205, 58, 1, 4, 252, 34, 58, 
+    1, 4, 26, 243, 114, 58, 1, 4, 248, 62, 58, 1, 4, 26, 225, 136, 58, 1, 4, 
+    250, 118, 7, 218, 66, 4, 1, 74, 7, 218, 66, 4, 1, 153, 7, 218, 66, 4, 1, 
+    69, 7, 218, 66, 4, 1, 214, 105, 26, 218, 66, 4, 1, 252, 34, 26, 218, 66, 
+    4, 1, 243, 114, 26, 218, 66, 4, 1, 223, 40, 26, 218, 66, 4, 1, 225, 136, 
+    26, 218, 66, 4, 1, 250, 118, 7, 4, 1, 214, 214, 7, 4, 1, 57, 2, 230, 229, 
+    184, 7, 4, 1, 249, 69, 2, 230, 229, 184, 7, 4, 1, 245, 15, 2, 230, 229, 
+    184, 7, 4, 1, 232, 55, 2, 230, 229, 184, 7, 4, 1, 230, 31, 2, 230, 229, 
+    184, 7, 4, 1, 226, 110, 2, 230, 229, 184, 7, 4, 1, 223, 227, 2, 230, 229, 
+    184, 7, 4, 1, 223, 227, 2, 244, 96, 22, 230, 229, 184, 7, 4, 1, 222, 94, 
+    2, 230, 229, 184, 7, 4, 1, 217, 154, 2, 230, 229, 184, 7, 4, 1, 210, 160, 
+    2, 230, 229, 184, 7, 4, 1, 215, 94, 243, 209, 58, 1, 33, 245, 158, 7, 4, 
+    1, 235, 220, 243, 209, 7, 4, 1, 216, 212, 2, 218, 109, 7, 4, 6, 1, 240, 
+    161, 2, 91, 7, 4, 1, 235, 193, 2, 91, 7, 4, 1, 226, 110, 2, 91, 7, 4, 6, 
+    1, 104, 2, 91, 7, 4, 1, 214, 158, 2, 91, 7, 4, 1, 57, 2, 226, 70, 103, 7, 
+    4, 1, 249, 69, 2, 226, 70, 103, 7, 4, 1, 245, 15, 2, 226, 70, 103, 7, 4, 
+    1, 243, 210, 2, 226, 70, 103, 7, 4, 1, 235, 30, 2, 226, 70, 103, 7, 4, 1, 
+    233, 155, 2, 226, 70, 103, 7, 4, 1, 232, 55, 2, 226, 70, 103, 7, 4, 1, 
+    230, 31, 2, 226, 70, 103, 7, 4, 1, 226, 110, 2, 226, 70, 103, 7, 4, 1, 
+    223, 227, 2, 226, 70, 103, 7, 4, 1, 222, 94, 2, 226, 70, 103, 7, 4, 1, 
+    245, 84, 2, 226, 70, 103, 7, 4, 1, 214, 106, 2, 226, 70, 103, 7, 4, 1, 
+    211, 179, 2, 226, 70, 103, 7, 4, 1, 210, 160, 2, 226, 70, 103, 7, 4, 1, 
+    116, 2, 223, 58, 103, 7, 4, 1, 254, 152, 2, 223, 58, 103, 7, 4, 1, 249, 
+    69, 2, 241, 59, 22, 217, 78, 7, 4, 1, 160, 2, 223, 58, 103, 7, 4, 1, 204, 
+    160, 2, 223, 58, 103, 7, 4, 1, 223, 52, 204, 160, 2, 223, 58, 103, 7, 4, 
+    1, 221, 198, 2, 223, 58, 103, 7, 4, 1, 240, 161, 2, 223, 58, 103, 7, 4, 
+    1, 204, 144, 2, 223, 58, 103, 7, 4, 1, 245, 84, 2, 223, 58, 103, 7, 4, 1, 
+    104, 2, 223, 58, 103, 7, 4, 1, 245, 17, 2, 223, 58, 103, 58, 1, 4, 215, 
+    94, 254, 151, 58, 1, 4, 251, 74, 58, 1, 4, 251, 75, 2, 249, 108, 58, 1, 
+    4, 245, 67, 58, 1, 4, 223, 52, 204, 76, 58, 1, 4, 245, 14, 58, 1, 4, 247, 
+    127, 235, 151, 2, 91, 58, 1, 4, 119, 243, 209, 58, 1, 4, 215, 94, 242, 
+    67, 58, 1, 4, 240, 161, 2, 91, 58, 1, 4, 235, 192, 58, 1, 4, 6, 74, 58, 
+    1, 4, 6, 240, 161, 2, 91, 58, 1, 4, 235, 151, 2, 249, 135, 58, 1, 4, 233, 
+    155, 2, 223, 58, 103, 58, 1, 4, 233, 155, 2, 226, 70, 103, 58, 1, 4, 6, 
+    156, 58, 1, 4, 232, 55, 2, 103, 58, 1, 4, 215, 94, 232, 55, 2, 200, 233, 
+    42, 58, 1, 4, 230, 31, 2, 43, 103, 58, 1, 4, 230, 31, 2, 223, 58, 103, 
+    58, 1, 4, 6, 230, 30, 58, 1, 4, 252, 142, 78, 58, 1, 4, 225, 136, 58, 1, 
+    4, 222, 94, 2, 103, 58, 1, 4, 245, 83, 58, 1, 4, 217, 154, 2, 226, 70, 
+    103, 58, 1, 4, 104, 130, 58, 1, 4, 214, 157, 58, 1, 4, 6, 69, 58, 1, 4, 
+    214, 106, 2, 103, 58, 1, 4, 215, 94, 214, 105, 58, 1, 4, 210, 159, 58, 1, 
+    4, 210, 160, 2, 223, 58, 103, 58, 1, 4, 210, 160, 2, 249, 108, 58, 1, 4, 
+    245, 16, 58, 1, 4, 216, 180, 38, 246, 126, 242, 144, 255, 23, 38, 246, 
+    126, 255, 12, 255, 23, 38, 219, 71, 51, 38, 218, 7, 79, 38, 231, 236, 38, 
+    242, 141, 38, 231, 234, 38, 255, 10, 38, 242, 142, 38, 255, 11, 38, 7, 4, 
+    1, 223, 227, 51, 38, 251, 153, 38, 231, 235, 38, 52, 250, 39, 48, 38, 
+    226, 229, 48, 38, 210, 35, 51, 38, 235, 179, 51, 38, 214, 151, 48, 38, 
+    214, 134, 48, 38, 7, 4, 1, 244, 71, 204, 116, 48, 38, 7, 4, 1, 254, 252, 
+    38, 7, 4, 1, 254, 81, 38, 7, 4, 1, 253, 184, 38, 7, 4, 1, 251, 75, 250, 
+    191, 38, 7, 4, 1, 235, 220, 249, 68, 38, 7, 4, 1, 245, 67, 38, 7, 4, 1, 
+    243, 209, 38, 7, 1, 4, 6, 243, 209, 38, 7, 4, 1, 235, 29, 38, 7, 4, 1, 
+    156, 38, 7, 1, 4, 6, 156, 38, 7, 1, 4, 6, 194, 38, 7, 4, 1, 230, 30, 38, 
+    7, 1, 4, 6, 230, 30, 38, 7, 1, 4, 6, 153, 38, 7, 4, 1, 223, 227, 222, 
+    188, 38, 7, 4, 1, 222, 93, 38, 7, 4, 1, 200, 222, 93, 38, 7, 4, 1, 210, 
+    159, 38, 52, 235, 200, 251, 155, 51, 38, 254, 156, 128, 216, 43, 51, 38, 
+    43, 254, 2, 48, 38, 44, 254, 2, 22, 124, 254, 2, 51, 7, 6, 1, 116, 2, 
+    222, 237, 51, 7, 4, 1, 116, 2, 222, 237, 51, 7, 6, 1, 57, 2, 59, 48, 7, 
+    4, 1, 57, 2, 59, 48, 7, 6, 1, 57, 2, 59, 51, 7, 4, 1, 57, 2, 59, 51, 7, 
+    6, 1, 57, 2, 232, 220, 51, 7, 4, 1, 57, 2, 232, 220, 51, 7, 6, 1, 251, 
+    75, 2, 250, 192, 22, 142, 7, 4, 1, 251, 75, 2, 250, 192, 22, 142, 7, 6, 
+    1, 249, 69, 2, 59, 48, 7, 4, 1, 249, 69, 2, 59, 48, 7, 6, 1, 249, 69, 2, 
+    59, 51, 7, 4, 1, 249, 69, 2, 59, 51, 7, 6, 1, 249, 69, 2, 232, 220, 51, 
+    7, 4, 1, 249, 69, 2, 232, 220, 51, 7, 6, 1, 249, 69, 2, 250, 191, 7, 4, 
+    1, 249, 69, 2, 250, 191, 7, 6, 1, 249, 69, 2, 250, 39, 51, 7, 4, 1, 249, 
+    69, 2, 250, 39, 51, 7, 6, 1, 160, 2, 231, 238, 22, 242, 143, 7, 4, 1, 
+    160, 2, 231, 238, 22, 242, 143, 7, 6, 1, 160, 2, 231, 238, 22, 142, 7, 4, 
+    1, 160, 2, 231, 238, 22, 142, 7, 6, 1, 160, 2, 250, 39, 51, 7, 4, 1, 160, 
+    2, 250, 39, 51, 7, 6, 1, 160, 2, 216, 90, 51, 7, 4, 1, 160, 2, 216, 90, 
+    51, 7, 6, 1, 160, 2, 250, 192, 22, 251, 154, 7, 4, 1, 160, 2, 250, 192, 
+    22, 251, 154, 7, 6, 1, 245, 15, 2, 59, 48, 7, 4, 1, 245, 15, 2, 59, 48, 
+    7, 6, 1, 243, 210, 2, 231, 237, 7, 4, 1, 243, 210, 2, 231, 237, 7, 6, 1, 
+    242, 68, 2, 59, 48, 7, 4, 1, 242, 68, 2, 59, 48, 7, 6, 1, 242, 68, 2, 59, 
+    51, 7, 4, 1, 242, 68, 2, 59, 51, 7, 6, 1, 242, 68, 2, 248, 9, 7, 4, 1, 
+    242, 68, 2, 248, 9, 7, 6, 1, 242, 68, 2, 250, 191, 7, 4, 1, 242, 68, 2, 
+    250, 191, 7, 6, 1, 242, 68, 2, 251, 155, 51, 7, 4, 1, 242, 68, 2, 251, 
+    155, 51, 7, 6, 1, 240, 161, 2, 216, 90, 51, 7, 4, 1, 240, 161, 2, 216, 
+    90, 51, 7, 6, 1, 240, 161, 2, 248, 10, 22, 142, 7, 4, 1, 240, 161, 2, 
+    248, 10, 22, 142, 7, 6, 1, 235, 30, 2, 142, 7, 4, 1, 235, 30, 2, 142, 7, 
+    6, 1, 235, 30, 2, 59, 51, 7, 4, 1, 235, 30, 2, 59, 51, 7, 6, 1, 235, 30, 
+    2, 232, 220, 51, 7, 4, 1, 235, 30, 2, 232, 220, 51, 7, 6, 1, 233, 155, 2, 
+    59, 51, 7, 4, 1, 233, 155, 2, 59, 51, 7, 6, 1, 233, 155, 2, 59, 252, 51, 
+    22, 231, 237, 7, 4, 1, 233, 155, 2, 59, 252, 51, 22, 231, 237, 7, 6, 1, 
+    233, 155, 2, 232, 220, 51, 7, 4, 1, 233, 155, 2, 232, 220, 51, 7, 6, 1, 
+    233, 155, 2, 250, 39, 51, 7, 4, 1, 233, 155, 2, 250, 39, 51, 7, 6, 1, 
+    232, 55, 2, 142, 7, 4, 1, 232, 55, 2, 142, 7, 6, 1, 232, 55, 2, 59, 48, 
+    7, 4, 1, 232, 55, 2, 59, 48, 7, 6, 1, 232, 55, 2, 59, 51, 7, 4, 1, 232, 
+    55, 2, 59, 51, 7, 6, 1, 230, 31, 2, 59, 48, 7, 4, 1, 230, 31, 2, 59, 48, 
+    7, 6, 1, 230, 31, 2, 59, 51, 7, 4, 1, 230, 31, 2, 59, 51, 7, 6, 1, 230, 
+    31, 2, 232, 220, 51, 7, 4, 1, 230, 31, 2, 232, 220, 51, 7, 6, 1, 230, 31, 
+    2, 250, 39, 51, 7, 4, 1, 230, 31, 2, 250, 39, 51, 7, 6, 1, 144, 2, 216, 
+    90, 22, 142, 7, 4, 1, 144, 2, 216, 90, 22, 142, 7, 6, 1, 144, 2, 216, 90, 
+    22, 248, 9, 7, 4, 1, 144, 2, 216, 90, 22, 248, 9, 7, 6, 1, 144, 2, 231, 
+    238, 22, 242, 143, 7, 4, 1, 144, 2, 231, 238, 22, 242, 143, 7, 6, 1, 144, 
+    2, 231, 238, 22, 142, 7, 4, 1, 144, 2, 231, 238, 22, 142, 7, 6, 1, 226, 
+    110, 2, 142, 7, 4, 1, 226, 110, 2, 142, 7, 6, 1, 226, 110, 2, 59, 48, 7, 
+    4, 1, 226, 110, 2, 59, 48, 7, 6, 1, 223, 227, 2, 59, 48, 7, 4, 1, 223, 
+    227, 2, 59, 48, 7, 6, 1, 223, 227, 2, 59, 51, 7, 4, 1, 223, 227, 2, 59, 
+    51, 7, 6, 1, 223, 227, 2, 59, 252, 51, 22, 231, 237, 7, 4, 1, 223, 227, 
+    2, 59, 252, 51, 22, 231, 237, 7, 6, 1, 223, 227, 2, 232, 220, 51, 7, 4, 
+    1, 223, 227, 2, 232, 220, 51, 7, 6, 1, 222, 94, 2, 59, 48, 7, 4, 1, 222, 
+    94, 2, 59, 48, 7, 6, 1, 222, 94, 2, 59, 51, 7, 4, 1, 222, 94, 2, 59, 51, 
+    7, 6, 1, 222, 94, 2, 255, 12, 22, 59, 48, 7, 4, 1, 222, 94, 2, 255, 12, 
+    22, 59, 48, 7, 6, 1, 222, 94, 2, 250, 243, 22, 59, 48, 7, 4, 1, 222, 94, 
+    2, 250, 243, 22, 59, 48, 7, 6, 1, 222, 94, 2, 59, 252, 51, 22, 59, 48, 7, 
+    4, 1, 222, 94, 2, 59, 252, 51, 22, 59, 48, 7, 6, 1, 217, 154, 2, 59, 48, 
+    7, 4, 1, 217, 154, 2, 59, 48, 7, 6, 1, 217, 154, 2, 59, 51, 7, 4, 1, 217, 
+    154, 2, 59, 51, 7, 6, 1, 217, 154, 2, 232, 220, 51, 7, 4, 1, 217, 154, 2, 
+    232, 220, 51, 7, 6, 1, 217, 154, 2, 250, 39, 51, 7, 4, 1, 217, 154, 2, 
+    250, 39, 51, 7, 6, 1, 104, 2, 248, 10, 51, 7, 4, 1, 104, 2, 248, 10, 51, 
+    7, 6, 1, 104, 2, 216, 90, 51, 7, 4, 1, 104, 2, 216, 90, 51, 7, 6, 1, 104, 
+    2, 250, 39, 51, 7, 4, 1, 104, 2, 250, 39, 51, 7, 6, 1, 104, 2, 216, 90, 
+    22, 142, 7, 4, 1, 104, 2, 216, 90, 22, 142, 7, 6, 1, 104, 2, 231, 238, 
+    22, 248, 9, 7, 4, 1, 104, 2, 231, 238, 22, 248, 9, 7, 6, 1, 214, 106, 2, 
+    184, 7, 4, 1, 214, 106, 2, 184, 7, 6, 1, 214, 106, 2, 59, 51, 7, 4, 1, 
+    214, 106, 2, 59, 51, 7, 6, 1, 212, 99, 2, 242, 143, 7, 4, 1, 212, 99, 2, 
+    242, 143, 7, 6, 1, 212, 99, 2, 142, 7, 4, 1, 212, 99, 2, 142, 7, 6, 1, 
+    212, 99, 2, 248, 9, 7, 4, 1, 212, 99, 2, 248, 9, 7, 6, 1, 212, 99, 2, 59, 
+    48, 7, 4, 1, 212, 99, 2, 59, 48, 7, 6, 1, 212, 99, 2, 59, 51, 7, 4, 1, 
+    212, 99, 2, 59, 51, 7, 6, 1, 211, 179, 2, 59, 48, 7, 4, 1, 211, 179, 2, 
+    59, 48, 7, 6, 1, 211, 179, 2, 248, 9, 7, 4, 1, 211, 179, 2, 248, 9, 7, 6, 
+    1, 211, 118, 2, 59, 48, 7, 4, 1, 211, 118, 2, 59, 48, 7, 6, 1, 210, 160, 
+    2, 250, 38, 7, 4, 1, 210, 160, 2, 250, 38, 7, 6, 1, 210, 160, 2, 59, 51, 
+    7, 4, 1, 210, 160, 2, 59, 51, 7, 6, 1, 210, 160, 2, 232, 220, 51, 7, 4, 
+    1, 210, 160, 2, 232, 220, 51, 7, 4, 1, 242, 68, 2, 232, 220, 51, 7, 4, 1, 
+    217, 154, 2, 248, 9, 7, 4, 1, 212, 99, 2, 222, 237, 48, 7, 4, 1, 211, 
+    118, 2, 222, 237, 48, 7, 4, 1, 116, 2, 44, 163, 222, 236, 7, 4, 1, 200, 
+    222, 94, 2, 59, 48, 7, 4, 1, 200, 222, 94, 2, 248, 7, 91, 7, 4, 1, 200, 
+    222, 94, 2, 125, 91, 7, 6, 1, 220, 78, 222, 93, 7, 4, 1, 248, 62, 7, 6, 
+    1, 116, 2, 59, 51, 7, 4, 1, 116, 2, 59, 51, 7, 6, 1, 116, 2, 241, 59, 48, 
+    7, 4, 1, 116, 2, 241, 59, 48, 7, 6, 1, 116, 2, 250, 39, 22, 142, 7, 4, 1, 
+    116, 2, 250, 39, 22, 142, 7, 6, 1, 116, 2, 250, 39, 22, 242, 143, 7, 4, 
+    1, 116, 2, 250, 39, 22, 242, 143, 7, 6, 1, 116, 2, 250, 39, 22, 241, 59, 
+    48, 7, 4, 1, 116, 2, 250, 39, 22, 241, 59, 48, 7, 6, 1, 116, 2, 250, 39, 
+    22, 184, 7, 4, 1, 116, 2, 250, 39, 22, 184, 7, 6, 1, 116, 2, 250, 39, 22, 
+    59, 51, 7, 4, 1, 116, 2, 250, 39, 22, 59, 51, 7, 6, 1, 116, 2, 251, 155, 
+    22, 142, 7, 4, 1, 116, 2, 251, 155, 22, 142, 7, 6, 1, 116, 2, 251, 155, 
+    22, 242, 143, 7, 4, 1, 116, 2, 251, 155, 22, 242, 143, 7, 6, 1, 116, 2, 
+    251, 155, 22, 241, 59, 48, 7, 4, 1, 116, 2, 251, 155, 22, 241, 59, 48, 7, 
+    6, 1, 116, 2, 251, 155, 22, 184, 7, 4, 1, 116, 2, 251, 155, 22, 184, 7, 
+    6, 1, 116, 2, 251, 155, 22, 59, 51, 7, 4, 1, 116, 2, 251, 155, 22, 59, 
     51, 7, 6, 1, 160, 2, 59, 51, 7, 4, 1, 160, 2, 59, 51, 7, 6, 1, 160, 2, 
-    241, 52, 48, 7, 4, 1, 160, 2, 241, 52, 48, 7, 6, 1, 160, 2, 182, 7, 4, 1, 
-    160, 2, 182, 7, 6, 1, 160, 2, 250, 31, 22, 142, 7, 4, 1, 160, 2, 250, 31, 
-    22, 142, 7, 6, 1, 160, 2, 250, 31, 22, 242, 136, 7, 4, 1, 160, 2, 250, 
-    31, 22, 242, 136, 7, 6, 1, 160, 2, 250, 31, 22, 241, 52, 48, 7, 4, 1, 
-    160, 2, 250, 31, 22, 241, 52, 48, 7, 6, 1, 160, 2, 250, 31, 22, 182, 7, 
-    4, 1, 160, 2, 250, 31, 22, 182, 7, 6, 1, 160, 2, 250, 31, 22, 59, 51, 7, 
-    4, 1, 160, 2, 250, 31, 22, 59, 51, 7, 6, 1, 240, 154, 2, 241, 52, 48, 7, 
-    4, 1, 240, 154, 2, 241, 52, 48, 7, 6, 1, 240, 154, 2, 59, 51, 7, 4, 1, 
-    240, 154, 2, 59, 51, 7, 6, 1, 144, 2, 59, 51, 7, 4, 1, 144, 2, 59, 51, 7, 
-    6, 1, 144, 2, 241, 52, 48, 7, 4, 1, 144, 2, 241, 52, 48, 7, 6, 1, 144, 2, 
-    250, 31, 22, 142, 7, 4, 1, 144, 2, 250, 31, 22, 142, 7, 6, 1, 144, 2, 
-    250, 31, 22, 242, 136, 7, 4, 1, 144, 2, 250, 31, 22, 242, 136, 7, 6, 1, 
-    144, 2, 250, 31, 22, 241, 52, 48, 7, 4, 1, 144, 2, 250, 31, 22, 241, 52, 
-    48, 7, 6, 1, 144, 2, 250, 31, 22, 182, 7, 4, 1, 144, 2, 250, 31, 22, 182, 
-    7, 6, 1, 144, 2, 250, 31, 22, 59, 51, 7, 4, 1, 144, 2, 250, 31, 22, 59, 
-    51, 7, 6, 1, 144, 2, 240, 249, 22, 142, 7, 4, 1, 144, 2, 240, 249, 22, 
-    142, 7, 6, 1, 144, 2, 240, 249, 22, 242, 136, 7, 4, 1, 144, 2, 240, 249, 
-    22, 242, 136, 7, 6, 1, 144, 2, 240, 249, 22, 241, 52, 48, 7, 4, 1, 144, 
-    2, 240, 249, 22, 241, 52, 48, 7, 6, 1, 144, 2, 240, 249, 22, 182, 7, 4, 
-    1, 144, 2, 240, 249, 22, 182, 7, 6, 1, 144, 2, 240, 249, 22, 59, 51, 7, 
-    4, 1, 144, 2, 240, 249, 22, 59, 51, 7, 6, 1, 104, 2, 59, 51, 7, 4, 1, 
-    104, 2, 59, 51, 7, 6, 1, 104, 2, 241, 52, 48, 7, 4, 1, 104, 2, 241, 52, 
-    48, 7, 6, 1, 104, 2, 240, 249, 22, 142, 7, 4, 1, 104, 2, 240, 249, 22, 
-    142, 7, 6, 1, 104, 2, 240, 249, 22, 242, 136, 7, 4, 1, 104, 2, 240, 249, 
-    22, 242, 136, 7, 6, 1, 104, 2, 240, 249, 22, 241, 52, 48, 7, 4, 1, 104, 
-    2, 240, 249, 22, 241, 52, 48, 7, 6, 1, 104, 2, 240, 249, 22, 182, 7, 4, 
-    1, 104, 2, 240, 249, 22, 182, 7, 6, 1, 104, 2, 240, 249, 22, 59, 51, 7, 
-    4, 1, 104, 2, 240, 249, 22, 59, 51, 7, 6, 1, 211, 118, 2, 242, 136, 7, 4, 
-    1, 211, 118, 2, 242, 136, 7, 6, 1, 211, 118, 2, 59, 51, 7, 4, 1, 211, 
-    118, 2, 59, 51, 7, 6, 1, 211, 118, 2, 241, 52, 48, 7, 4, 1, 211, 118, 2, 
-    241, 52, 48, 7, 6, 1, 211, 118, 2, 182, 7, 4, 1, 211, 118, 2, 182, 7, 6, 
-    1, 230, 223, 232, 185, 7, 4, 1, 230, 223, 232, 185, 7, 6, 1, 230, 223, 
-    214, 105, 7, 4, 1, 230, 223, 214, 105, 7, 6, 1, 211, 118, 2, 232, 123, 7, 
-    4, 1, 211, 118, 2, 232, 123, 26, 4, 1, 254, 144, 2, 224, 154, 26, 4, 1, 
-    254, 144, 2, 248, 153, 26, 4, 1, 254, 144, 2, 224, 155, 22, 214, 13, 26, 
-    4, 1, 254, 144, 2, 248, 154, 22, 214, 13, 26, 4, 1, 254, 144, 2, 224, 
-    155, 22, 226, 110, 26, 4, 1, 254, 144, 2, 248, 154, 22, 226, 110, 26, 4, 
-    1, 254, 144, 2, 224, 155, 22, 225, 175, 26, 4, 1, 254, 144, 2, 248, 154, 
-    22, 225, 175, 26, 6, 1, 254, 144, 2, 224, 154, 26, 6, 1, 254, 144, 2, 
-    248, 153, 26, 6, 1, 254, 144, 2, 224, 155, 22, 214, 13, 26, 6, 1, 254, 
-    144, 2, 248, 154, 22, 214, 13, 26, 6, 1, 254, 144, 2, 224, 155, 22, 226, 
-    110, 26, 6, 1, 254, 144, 2, 248, 154, 22, 226, 110, 26, 6, 1, 254, 144, 
-    2, 224, 155, 22, 225, 175, 26, 6, 1, 254, 144, 2, 248, 154, 22, 225, 175, 
-    26, 4, 1, 245, 101, 2, 224, 154, 26, 4, 1, 245, 101, 2, 248, 153, 26, 4, 
-    1, 245, 101, 2, 224, 155, 22, 214, 13, 26, 4, 1, 245, 101, 2, 248, 154, 
-    22, 214, 13, 26, 4, 1, 245, 101, 2, 224, 155, 22, 226, 110, 26, 4, 1, 
-    245, 101, 2, 248, 154, 22, 226, 110, 26, 6, 1, 245, 101, 2, 224, 154, 26, 
-    6, 1, 245, 101, 2, 248, 153, 26, 6, 1, 245, 101, 2, 224, 155, 22, 214, 
-    13, 26, 6, 1, 245, 101, 2, 248, 154, 22, 214, 13, 26, 6, 1, 245, 101, 2, 
-    224, 155, 22, 226, 110, 26, 6, 1, 245, 101, 2, 248, 154, 22, 226, 110, 
-    26, 4, 1, 245, 64, 2, 224, 154, 26, 4, 1, 245, 64, 2, 248, 153, 26, 4, 1, 
-    245, 64, 2, 224, 155, 22, 214, 13, 26, 4, 1, 245, 64, 2, 248, 154, 22, 
-    214, 13, 26, 4, 1, 245, 64, 2, 224, 155, 22, 226, 110, 26, 4, 1, 245, 64, 
-    2, 248, 154, 22, 226, 110, 26, 4, 1, 245, 64, 2, 224, 155, 22, 225, 175, 
-    26, 4, 1, 245, 64, 2, 248, 154, 22, 225, 175, 26, 6, 1, 245, 64, 2, 224, 
-    154, 26, 6, 1, 245, 64, 2, 248, 153, 26, 6, 1, 245, 64, 2, 224, 155, 22, 
-    214, 13, 26, 6, 1, 245, 64, 2, 248, 154, 22, 214, 13, 26, 6, 1, 245, 64, 
-    2, 224, 155, 22, 226, 110, 26, 6, 1, 245, 64, 2, 248, 154, 22, 226, 110, 
-    26, 6, 1, 245, 64, 2, 224, 155, 22, 225, 175, 26, 6, 1, 245, 64, 2, 248, 
-    154, 22, 225, 175, 26, 4, 1, 235, 186, 2, 224, 154, 26, 4, 1, 235, 186, 
-    2, 248, 153, 26, 4, 1, 235, 186, 2, 224, 155, 22, 214, 13, 26, 4, 1, 235, 
-    186, 2, 248, 154, 22, 214, 13, 26, 4, 1, 235, 186, 2, 224, 155, 22, 226, 
-    110, 26, 4, 1, 235, 186, 2, 248, 154, 22, 226, 110, 26, 4, 1, 235, 186, 
-    2, 224, 155, 22, 225, 175, 26, 4, 1, 235, 186, 2, 248, 154, 22, 225, 175, 
-    26, 6, 1, 235, 186, 2, 224, 154, 26, 6, 1, 235, 186, 2, 248, 153, 26, 6, 
-    1, 235, 186, 2, 224, 155, 22, 214, 13, 26, 6, 1, 235, 186, 2, 248, 154, 
-    22, 214, 13, 26, 6, 1, 235, 186, 2, 224, 155, 22, 226, 110, 26, 6, 1, 
-    235, 186, 2, 248, 154, 22, 226, 110, 26, 6, 1, 235, 186, 2, 224, 155, 22, 
-    225, 175, 26, 6, 1, 235, 186, 2, 248, 154, 22, 225, 175, 26, 4, 1, 226, 
-    200, 2, 224, 154, 26, 4, 1, 226, 200, 2, 248, 153, 26, 4, 1, 226, 200, 2, 
-    224, 155, 22, 214, 13, 26, 4, 1, 226, 200, 2, 248, 154, 22, 214, 13, 26, 
-    4, 1, 226, 200, 2, 224, 155, 22, 226, 110, 26, 4, 1, 226, 200, 2, 248, 
-    154, 22, 226, 110, 26, 6, 1, 226, 200, 2, 224, 154, 26, 6, 1, 226, 200, 
-    2, 248, 153, 26, 6, 1, 226, 200, 2, 224, 155, 22, 214, 13, 26, 6, 1, 226, 
-    200, 2, 248, 154, 22, 214, 13, 26, 6, 1, 226, 200, 2, 224, 155, 22, 226, 
-    110, 26, 6, 1, 226, 200, 2, 248, 154, 22, 226, 110, 26, 4, 1, 214, 158, 
-    2, 224, 154, 26, 4, 1, 214, 158, 2, 248, 153, 26, 4, 1, 214, 158, 2, 224, 
-    155, 22, 214, 13, 26, 4, 1, 214, 158, 2, 248, 154, 22, 214, 13, 26, 4, 1, 
-    214, 158, 2, 224, 155, 22, 226, 110, 26, 4, 1, 214, 158, 2, 248, 154, 22, 
-    226, 110, 26, 4, 1, 214, 158, 2, 224, 155, 22, 225, 175, 26, 4, 1, 214, 
-    158, 2, 248, 154, 22, 225, 175, 26, 6, 1, 214, 158, 2, 248, 153, 26, 6, 
-    1, 214, 158, 2, 248, 154, 22, 214, 13, 26, 6, 1, 214, 158, 2, 248, 154, 
-    22, 226, 110, 26, 6, 1, 214, 158, 2, 248, 154, 22, 225, 175, 26, 4, 1, 
-    226, 202, 2, 224, 154, 26, 4, 1, 226, 202, 2, 248, 153, 26, 4, 1, 226, 
-    202, 2, 224, 155, 22, 214, 13, 26, 4, 1, 226, 202, 2, 248, 154, 22, 214, 
-    13, 26, 4, 1, 226, 202, 2, 224, 155, 22, 226, 110, 26, 4, 1, 226, 202, 2, 
-    248, 154, 22, 226, 110, 26, 4, 1, 226, 202, 2, 224, 155, 22, 225, 175, 
-    26, 4, 1, 226, 202, 2, 248, 154, 22, 225, 175, 26, 6, 1, 226, 202, 2, 
-    224, 154, 26, 6, 1, 226, 202, 2, 248, 153, 26, 6, 1, 226, 202, 2, 224, 
-    155, 22, 214, 13, 26, 6, 1, 226, 202, 2, 248, 154, 22, 214, 13, 26, 6, 1, 
-    226, 202, 2, 224, 155, 22, 226, 110, 26, 6, 1, 226, 202, 2, 248, 154, 22, 
-    226, 110, 26, 6, 1, 226, 202, 2, 224, 155, 22, 225, 175, 26, 6, 1, 226, 
-    202, 2, 248, 154, 22, 225, 175, 26, 4, 1, 254, 144, 2, 214, 13, 26, 4, 1, 
-    254, 144, 2, 226, 110, 26, 4, 1, 245, 101, 2, 214, 13, 26, 4, 1, 245, 
-    101, 2, 226, 110, 26, 4, 1, 245, 64, 2, 214, 13, 26, 4, 1, 245, 64, 2, 
-    226, 110, 26, 4, 1, 235, 186, 2, 214, 13, 26, 4, 1, 235, 186, 2, 226, 
-    110, 26, 4, 1, 226, 200, 2, 214, 13, 26, 4, 1, 226, 200, 2, 226, 110, 26, 
-    4, 1, 214, 158, 2, 214, 13, 26, 4, 1, 214, 158, 2, 226, 110, 26, 4, 1, 
-    226, 202, 2, 214, 13, 26, 4, 1, 226, 202, 2, 226, 110, 26, 4, 1, 254, 
-    144, 2, 224, 155, 22, 210, 219, 26, 4, 1, 254, 144, 2, 248, 154, 22, 210, 
-    219, 26, 4, 1, 254, 144, 2, 224, 155, 22, 214, 14, 22, 210, 219, 26, 4, 
-    1, 254, 144, 2, 248, 154, 22, 214, 14, 22, 210, 219, 26, 4, 1, 254, 144, 
-    2, 224, 155, 22, 226, 111, 22, 210, 219, 26, 4, 1, 254, 144, 2, 248, 154, 
-    22, 226, 111, 22, 210, 219, 26, 4, 1, 254, 144, 2, 224, 155, 22, 225, 
-    176, 22, 210, 219, 26, 4, 1, 254, 144, 2, 248, 154, 22, 225, 176, 22, 
-    210, 219, 26, 6, 1, 254, 144, 2, 224, 155, 22, 224, 167, 26, 6, 1, 254, 
-    144, 2, 248, 154, 22, 224, 167, 26, 6, 1, 254, 144, 2, 224, 155, 22, 214, 
-    14, 22, 224, 167, 26, 6, 1, 254, 144, 2, 248, 154, 22, 214, 14, 22, 224, 
-    167, 26, 6, 1, 254, 144, 2, 224, 155, 22, 226, 111, 22, 224, 167, 26, 6, 
-    1, 254, 144, 2, 248, 154, 22, 226, 111, 22, 224, 167, 26, 6, 1, 254, 144, 
-    2, 224, 155, 22, 225, 176, 22, 224, 167, 26, 6, 1, 254, 144, 2, 248, 154, 
-    22, 225, 176, 22, 224, 167, 26, 4, 1, 245, 64, 2, 224, 155, 22, 210, 219, 
-    26, 4, 1, 245, 64, 2, 248, 154, 22, 210, 219, 26, 4, 1, 245, 64, 2, 224, 
-    155, 22, 214, 14, 22, 210, 219, 26, 4, 1, 245, 64, 2, 248, 154, 22, 214, 
-    14, 22, 210, 219, 26, 4, 1, 245, 64, 2, 224, 155, 22, 226, 111, 22, 210, 
-    219, 26, 4, 1, 245, 64, 2, 248, 154, 22, 226, 111, 22, 210, 219, 26, 4, 
-    1, 245, 64, 2, 224, 155, 22, 225, 176, 22, 210, 219, 26, 4, 1, 245, 64, 
-    2, 248, 154, 22, 225, 176, 22, 210, 219, 26, 6, 1, 245, 64, 2, 224, 155, 
-    22, 224, 167, 26, 6, 1, 245, 64, 2, 248, 154, 22, 224, 167, 26, 6, 1, 
-    245, 64, 2, 224, 155, 22, 214, 14, 22, 224, 167, 26, 6, 1, 245, 64, 2, 
-    248, 154, 22, 214, 14, 22, 224, 167, 26, 6, 1, 245, 64, 2, 224, 155, 22, 
-    226, 111, 22, 224, 167, 26, 6, 1, 245, 64, 2, 248, 154, 22, 226, 111, 22, 
-    224, 167, 26, 6, 1, 245, 64, 2, 224, 155, 22, 225, 176, 22, 224, 167, 26, 
-    6, 1, 245, 64, 2, 248, 154, 22, 225, 176, 22, 224, 167, 26, 4, 1, 226, 
-    202, 2, 224, 155, 22, 210, 219, 26, 4, 1, 226, 202, 2, 248, 154, 22, 210, 
-    219, 26, 4, 1, 226, 202, 2, 224, 155, 22, 214, 14, 22, 210, 219, 26, 4, 
-    1, 226, 202, 2, 248, 154, 22, 214, 14, 22, 210, 219, 26, 4, 1, 226, 202, 
-    2, 224, 155, 22, 226, 111, 22, 210, 219, 26, 4, 1, 226, 202, 2, 248, 154, 
-    22, 226, 111, 22, 210, 219, 26, 4, 1, 226, 202, 2, 224, 155, 22, 225, 
-    176, 22, 210, 219, 26, 4, 1, 226, 202, 2, 248, 154, 22, 225, 176, 22, 
-    210, 219, 26, 6, 1, 226, 202, 2, 224, 155, 22, 224, 167, 26, 6, 1, 226, 
-    202, 2, 248, 154, 22, 224, 167, 26, 6, 1, 226, 202, 2, 224, 155, 22, 214, 
-    14, 22, 224, 167, 26, 6, 1, 226, 202, 2, 248, 154, 22, 214, 14, 22, 224, 
-    167, 26, 6, 1, 226, 202, 2, 224, 155, 22, 226, 111, 22, 224, 167, 26, 6, 
-    1, 226, 202, 2, 248, 154, 22, 226, 111, 22, 224, 167, 26, 6, 1, 226, 202, 
-    2, 224, 155, 22, 225, 176, 22, 224, 167, 26, 6, 1, 226, 202, 2, 248, 154, 
-    22, 225, 176, 22, 224, 167, 26, 4, 1, 254, 144, 2, 213, 120, 26, 4, 1, 
-    254, 144, 2, 231, 232, 26, 4, 1, 254, 144, 2, 214, 14, 22, 210, 219, 26, 
-    4, 1, 254, 144, 2, 210, 219, 26, 4, 1, 254, 144, 2, 226, 111, 22, 210, 
-    219, 26, 4, 1, 254, 144, 2, 225, 175, 26, 4, 1, 254, 144, 2, 225, 176, 
-    22, 210, 219, 26, 6, 1, 254, 144, 2, 213, 120, 26, 6, 1, 254, 144, 2, 
-    231, 232, 26, 6, 1, 254, 144, 2, 214, 13, 26, 6, 1, 254, 144, 2, 226, 
-    110, 26, 6, 1, 254, 144, 2, 224, 167, 26, 234, 2, 26, 224, 167, 26, 224, 
-    154, 26, 225, 175, 26, 247, 252, 22, 225, 175, 26, 4, 1, 245, 64, 2, 214, 
-    14, 22, 210, 219, 26, 4, 1, 245, 64, 2, 210, 219, 26, 4, 1, 245, 64, 2, 
-    226, 111, 22, 210, 219, 26, 4, 1, 245, 64, 2, 225, 175, 26, 4, 1, 245, 
-    64, 2, 225, 176, 22, 210, 219, 26, 6, 1, 245, 101, 2, 214, 13, 26, 6, 1, 
-    245, 101, 2, 226, 110, 26, 6, 1, 245, 64, 2, 214, 13, 26, 6, 1, 245, 64, 
-    2, 226, 110, 26, 6, 1, 245, 64, 2, 224, 167, 26, 224, 155, 22, 214, 13, 
-    26, 224, 155, 22, 226, 110, 26, 224, 155, 22, 225, 175, 26, 4, 1, 235, 
-    186, 2, 213, 120, 26, 4, 1, 235, 186, 2, 231, 232, 26, 4, 1, 235, 186, 2, 
-    247, 252, 22, 214, 13, 26, 4, 1, 235, 186, 2, 247, 252, 22, 226, 110, 26, 
-    4, 1, 235, 186, 2, 225, 175, 26, 4, 1, 235, 186, 2, 247, 252, 22, 225, 
-    175, 26, 6, 1, 235, 186, 2, 213, 120, 26, 6, 1, 235, 186, 2, 231, 232, 
-    26, 6, 1, 235, 186, 2, 214, 13, 26, 6, 1, 235, 186, 2, 226, 110, 26, 248, 
-    154, 22, 214, 13, 26, 248, 154, 22, 226, 110, 26, 248, 154, 22, 225, 175, 
-    26, 4, 1, 214, 158, 2, 213, 120, 26, 4, 1, 214, 158, 2, 231, 232, 26, 4, 
-    1, 214, 158, 2, 247, 252, 22, 214, 13, 26, 4, 1, 214, 158, 2, 247, 252, 
-    22, 226, 110, 26, 4, 1, 223, 38, 2, 224, 154, 26, 4, 1, 223, 38, 2, 248, 
-    153, 26, 4, 1, 214, 158, 2, 225, 175, 26, 4, 1, 214, 158, 2, 247, 252, 
-    22, 225, 175, 26, 6, 1, 214, 158, 2, 213, 120, 26, 6, 1, 214, 158, 2, 
-    231, 232, 26, 6, 1, 214, 158, 2, 214, 13, 26, 6, 1, 214, 158, 2, 226, 
-    110, 26, 6, 1, 223, 38, 2, 248, 153, 26, 247, 252, 22, 214, 13, 26, 247, 
-    252, 22, 226, 110, 26, 214, 13, 26, 4, 1, 226, 202, 2, 214, 14, 22, 210, 
-    219, 26, 4, 1, 226, 202, 2, 210, 219, 26, 4, 1, 226, 202, 2, 226, 111, 
-    22, 210, 219, 26, 4, 1, 226, 202, 2, 225, 175, 26, 4, 1, 226, 202, 2, 
-    225, 176, 22, 210, 219, 26, 6, 1, 226, 200, 2, 214, 13, 26, 6, 1, 226, 
-    200, 2, 226, 110, 26, 6, 1, 226, 202, 2, 214, 13, 26, 6, 1, 226, 202, 2, 
-    226, 110, 26, 6, 1, 226, 202, 2, 224, 167, 26, 226, 110, 26, 248, 153, 
-    245, 151, 224, 27, 245, 160, 224, 27, 245, 151, 219, 18, 245, 160, 219, 
-    18, 216, 141, 219, 18, 244, 9, 219, 18, 219, 123, 219, 18, 244, 112, 219, 
-    18, 224, 141, 219, 18, 216, 170, 219, 18, 242, 35, 219, 18, 210, 87, 211, 
-    245, 219, 18, 210, 87, 211, 245, 228, 67, 210, 87, 211, 245, 235, 63, 
-    233, 38, 78, 222, 243, 78, 240, 168, 228, 68, 240, 168, 244, 112, 248, 
-    156, 245, 151, 248, 156, 245, 160, 248, 156, 203, 130, 52, 67, 232, 213, 
-    52, 121, 232, 213, 43, 219, 155, 223, 254, 78, 44, 219, 155, 223, 254, 
-    78, 219, 155, 232, 109, 223, 254, 78, 219, 155, 241, 163, 223, 254, 78, 
-    43, 52, 223, 254, 78, 44, 52, 223, 254, 78, 52, 232, 109, 223, 254, 78, 
-    52, 241, 163, 223, 254, 78, 248, 205, 52, 248, 205, 251, 113, 215, 222, 
-    251, 113, 123, 59, 233, 56, 113, 59, 233, 56, 203, 245, 163, 240, 166, 
-    225, 10, 232, 214, 220, 137, 226, 15, 220, 137, 233, 38, 245, 158, 222, 
-    243, 245, 158, 224, 246, 247, 196, 244, 19, 233, 38, 226, 117, 222, 243, 
-    226, 117, 229, 194, 228, 73, 219, 18, 225, 183, 230, 193, 50, 225, 183, 
-    216, 248, 216, 148, 50, 224, 190, 52, 224, 190, 215, 211, 224, 190, 223, 
-    49, 224, 190, 223, 49, 52, 224, 190, 223, 49, 215, 211, 224, 190, 250, 
-    238, 219, 155, 233, 42, 254, 110, 223, 254, 78, 219, 155, 222, 247, 254, 
-    110, 223, 254, 78, 223, 107, 78, 52, 245, 31, 78, 235, 201, 226, 119, 
-    214, 180, 135, 216, 111, 250, 239, 235, 216, 225, 10, 253, 214, 240, 169, 
-    251, 113, 244, 2, 219, 95, 43, 42, 251, 158, 2, 224, 7, 44, 42, 251, 158, 
-    2, 224, 7, 52, 224, 13, 78, 224, 13, 245, 31, 78, 245, 31, 224, 13, 78, 
-    216, 70, 5, 245, 65, 223, 49, 225, 68, 50, 85, 140, 251, 113, 85, 97, 
-    251, 113, 121, 253, 216, 223, 49, 220, 150, 250, 1, 214, 163, 113, 253, 
-    215, 254, 158, 213, 188, 249, 217, 230, 182, 50, 217, 234, 248, 156, 235, 
-    193, 214, 180, 244, 52, 224, 141, 78, 134, 59, 224, 140, 224, 24, 224, 
-    190, 244, 11, 59, 224, 140, 244, 81, 59, 224, 140, 113, 59, 224, 140, 
-    244, 11, 59, 78, 246, 118, 249, 130, 215, 221, 67, 244, 11, 247, 118, 
-    231, 82, 11, 219, 18, 211, 209, 235, 63, 243, 227, 254, 52, 235, 191, 
-    216, 85, 235, 191, 220, 137, 235, 191, 225, 22, 235, 228, 217, 182, 217, 
-    251, 255, 5, 217, 182, 217, 251, 235, 228, 10, 244, 20, 220, 80, 255, 5, 
-    10, 244, 20, 220, 80, 229, 189, 21, 220, 81, 228, 69, 21, 220, 81, 218, 
-    23, 210, 86, 218, 23, 7, 4, 1, 73, 218, 23, 161, 218, 23, 189, 218, 23, 
-    194, 218, 23, 198, 218, 23, 195, 218, 23, 200, 218, 23, 96, 50, 218, 23, 
-    230, 181, 218, 23, 245, 98, 50, 218, 23, 43, 226, 3, 218, 23, 44, 226, 3, 
-    218, 23, 7, 4, 1, 230, 25, 218, 65, 210, 86, 218, 65, 110, 218, 65, 105, 
-    218, 65, 158, 218, 65, 161, 218, 65, 189, 218, 65, 194, 218, 65, 198, 
-    218, 65, 195, 218, 65, 200, 218, 65, 96, 50, 218, 65, 230, 181, 218, 65, 
-    245, 98, 50, 218, 65, 43, 226, 3, 218, 65, 44, 226, 3, 7, 218, 65, 4, 1, 
-    61, 7, 218, 65, 4, 1, 75, 7, 218, 65, 4, 1, 76, 7, 218, 65, 4, 1, 211, 
-    178, 7, 218, 65, 4, 1, 221, 195, 7, 218, 65, 4, 1, 242, 60, 7, 218, 65, 
-    4, 1, 235, 23, 7, 218, 65, 4, 1, 156, 7, 218, 65, 4, 1, 193, 7, 218, 65, 
-    4, 1, 230, 25, 7, 218, 65, 4, 1, 226, 105, 7, 218, 65, 4, 1, 222, 91, 7, 
-    218, 65, 4, 1, 217, 152, 245, 46, 50, 249, 227, 50, 249, 117, 50, 243, 
-    251, 243, 254, 50, 232, 198, 50, 230, 194, 50, 229, 210, 50, 225, 162, 
-    50, 222, 118, 50, 211, 217, 50, 166, 220, 49, 50, 247, 127, 50, 245, 47, 
-    50, 234, 76, 50, 215, 112, 50, 246, 101, 50, 243, 40, 225, 193, 50, 225, 
-    160, 50, 242, 109, 50, 253, 182, 50, 240, 228, 50, 250, 185, 50, 232, 
-    191, 216, 3, 50, 219, 0, 50, 216, 245, 50, 235, 241, 222, 118, 50, 38, 
-    43, 241, 255, 48, 38, 44, 241, 255, 48, 38, 199, 67, 232, 214, 226, 120, 
-    38, 219, 251, 67, 232, 214, 226, 120, 38, 254, 88, 80, 48, 38, 250, 2, 
-    80, 48, 38, 43, 80, 48, 38, 44, 80, 48, 38, 222, 234, 226, 120, 38, 250, 
-    2, 222, 234, 226, 120, 38, 254, 88, 222, 234, 226, 120, 38, 134, 170, 48, 
-    38, 244, 11, 170, 48, 38, 245, 146, 250, 35, 38, 245, 146, 218, 234, 38, 
-    245, 146, 247, 248, 38, 245, 146, 250, 36, 252, 180, 38, 43, 44, 80, 48, 
-    38, 245, 146, 221, 188, 38, 245, 146, 234, 135, 38, 245, 146, 214, 155, 
-    225, 7, 215, 225, 38, 223, 50, 219, 47, 226, 120, 38, 52, 67, 218, 103, 
-    226, 120, 38, 254, 98, 87, 38, 215, 211, 214, 182, 38, 211, 247, 251, 
-    140, 48, 38, 140, 80, 226, 120, 38, 199, 52, 219, 47, 226, 120, 38, 97, 
-    241, 255, 2, 252, 139, 246, 103, 38, 140, 241, 255, 2, 252, 139, 246, 
-    103, 38, 43, 80, 51, 38, 44, 80, 51, 38, 253, 217, 48, 255, 11, 226, 231, 
-    254, 251, 216, 42, 216, 196, 218, 74, 139, 6, 251, 66, 248, 71, 250, 178, 
-    250, 175, 232, 214, 87, 250, 240, 226, 231, 251, 26, 214, 189, 245, 48, 
-    249, 191, 221, 185, 248, 71, 244, 179, 119, 4, 243, 202, 119, 6, 242, 60, 
-    251, 219, 6, 242, 60, 139, 6, 242, 60, 225, 37, 249, 191, 225, 37, 249, 
-    192, 117, 113, 225, 108, 119, 6, 73, 251, 219, 6, 73, 119, 6, 156, 119, 
-    4, 156, 233, 149, 57, 252, 141, 87, 139, 6, 230, 25, 227, 196, 50, 219, 
-    31, 223, 119, 249, 162, 119, 6, 226, 105, 139, 6, 226, 105, 139, 6, 224, 
-    96, 119, 6, 153, 251, 219, 6, 153, 139, 6, 153, 224, 196, 217, 71, 223, 
-    62, 220, 132, 78, 217, 1, 50, 215, 253, 164, 50, 213, 240, 139, 6, 210, 
-    159, 226, 133, 50, 226, 221, 50, 235, 193, 226, 221, 50, 251, 219, 6, 
-    210, 159, 215, 94, 26, 4, 1, 235, 185, 234, 173, 50, 254, 107, 50, 119, 
-    6, 253, 158, 251, 219, 6, 251, 66, 245, 68, 87, 119, 4, 75, 119, 6, 75, 
-    119, 6, 245, 6, 215, 94, 6, 245, 6, 119, 6, 193, 119, 4, 76, 112, 87, 
-    252, 29, 87, 242, 202, 87, 248, 190, 87, 235, 232, 219, 29, 222, 187, 6, 
-    224, 96, 244, 182, 50, 139, 4, 225, 108, 139, 4, 243, 107, 139, 6, 243, 
-    107, 139, 6, 225, 108, 139, 230, 24, 218, 40, 215, 94, 35, 6, 243, 202, 
-    215, 94, 35, 6, 156, 223, 49, 35, 6, 156, 215, 94, 35, 6, 211, 117, 139, 
-    32, 6, 249, 60, 139, 32, 4, 249, 60, 139, 32, 4, 75, 139, 32, 4, 73, 139, 
-    32, 4, 235, 144, 224, 170, 232, 213, 215, 94, 254, 126, 225, 183, 50, 
-    254, 180, 215, 94, 4, 245, 6, 16, 31, 221, 252, 219, 29, 212, 114, 244, 
-    2, 123, 220, 118, 212, 114, 244, 2, 123, 228, 194, 212, 114, 244, 2, 123, 
-    216, 241, 212, 114, 244, 2, 123, 216, 168, 212, 114, 244, 2, 113, 216, 
-    166, 212, 114, 244, 2, 123, 244, 117, 212, 114, 244, 2, 113, 244, 116, 
-    212, 114, 244, 2, 134, 244, 116, 212, 114, 244, 2, 244, 11, 244, 116, 
-    212, 114, 244, 2, 123, 219, 115, 212, 114, 244, 2, 244, 81, 219, 113, 
-    212, 114, 244, 2, 123, 245, 188, 212, 114, 244, 2, 134, 245, 186, 212, 
-    114, 244, 2, 244, 81, 245, 186, 212, 114, 244, 2, 220, 122, 245, 186, 
-    244, 2, 227, 197, 110, 222, 198, 227, 198, 110, 222, 198, 227, 198, 105, 
-    222, 198, 227, 198, 158, 222, 198, 227, 198, 161, 222, 198, 227, 198, 
-    189, 222, 198, 227, 198, 194, 222, 198, 227, 198, 198, 222, 198, 227, 
-    198, 195, 222, 198, 227, 198, 200, 222, 198, 227, 198, 216, 247, 222, 
-    198, 227, 198, 245, 167, 222, 198, 227, 198, 215, 76, 222, 198, 227, 198, 
-    244, 114, 222, 198, 227, 198, 123, 240, 210, 222, 198, 227, 198, 244, 81, 
-    240, 210, 222, 198, 227, 198, 123, 216, 147, 4, 222, 198, 227, 198, 110, 
-    4, 222, 198, 227, 198, 105, 4, 222, 198, 227, 198, 158, 4, 222, 198, 227, 
-    198, 161, 4, 222, 198, 227, 198, 189, 4, 222, 198, 227, 198, 194, 4, 222, 
-    198, 227, 198, 198, 4, 222, 198, 227, 198, 195, 4, 222, 198, 227, 198, 
-    200, 4, 222, 198, 227, 198, 216, 247, 4, 222, 198, 227, 198, 245, 167, 4, 
-    222, 198, 227, 198, 215, 76, 4, 222, 198, 227, 198, 244, 114, 4, 222, 
-    198, 227, 198, 123, 240, 210, 4, 222, 198, 227, 198, 244, 81, 240, 210, 
-    4, 222, 198, 227, 198, 123, 216, 147, 222, 198, 227, 198, 123, 216, 148, 
-    251, 67, 249, 60, 222, 198, 227, 198, 244, 81, 216, 147, 222, 198, 227, 
-    198, 216, 248, 216, 147, 222, 198, 227, 198, 223, 49, 123, 240, 210, 7, 
-    4, 1, 223, 49, 251, 66, 222, 198, 227, 198, 219, 125, 233, 78, 17, 222, 
-    198, 227, 198, 244, 115, 245, 226, 17, 222, 198, 227, 198, 244, 115, 216, 
-    147, 222, 198, 227, 198, 123, 240, 211, 216, 147, 212, 114, 244, 2, 210, 
-    87, 216, 166, 140, 74, 214, 153, 74, 97, 74, 246, 104, 74, 43, 44, 74, 
-    120, 124, 74, 228, 56, 212, 9, 74, 228, 56, 245, 220, 74, 219, 28, 245, 
-    220, 74, 219, 28, 212, 9, 74, 140, 80, 2, 91, 97, 80, 2, 91, 140, 212, 
-    36, 74, 97, 212, 36, 74, 140, 113, 241, 234, 74, 214, 153, 113, 241, 234, 
-    74, 97, 113, 241, 234, 74, 246, 104, 113, 241, 234, 74, 140, 80, 2, 217, 
-    77, 97, 80, 2, 217, 77, 140, 80, 243, 243, 130, 214, 153, 80, 243, 243, 
-    130, 97, 80, 243, 243, 130, 246, 104, 80, 243, 243, 130, 120, 124, 80, 2, 
-    252, 127, 140, 80, 2, 103, 97, 80, 2, 103, 140, 80, 2, 232, 123, 97, 80, 
-    2, 232, 123, 43, 44, 212, 36, 74, 43, 44, 80, 2, 91, 246, 104, 210, 35, 
-    74, 214, 153, 80, 2, 216, 77, 233, 37, 214, 153, 80, 2, 216, 77, 222, 
-    241, 246, 104, 80, 2, 216, 77, 233, 37, 246, 104, 80, 2, 216, 77, 222, 
-    241, 97, 80, 2, 249, 161, 246, 103, 246, 104, 80, 2, 249, 161, 233, 37, 
-    254, 88, 216, 14, 220, 153, 74, 250, 2, 216, 14, 220, 153, 74, 228, 56, 
-    212, 9, 80, 216, 42, 199, 130, 140, 80, 216, 42, 252, 141, 117, 97, 80, 
-    216, 42, 130, 254, 88, 204, 250, 36, 74, 250, 2, 204, 250, 36, 74, 140, 
-    241, 255, 2, 252, 139, 214, 152, 140, 241, 255, 2, 252, 139, 246, 103, 
-    214, 153, 241, 255, 2, 252, 139, 222, 241, 214, 153, 241, 255, 2, 252, 
-    139, 233, 37, 97, 241, 255, 2, 252, 139, 214, 152, 97, 241, 255, 2, 252, 
-    139, 246, 103, 246, 104, 241, 255, 2, 252, 139, 222, 241, 246, 104, 241, 
-    255, 2, 252, 139, 233, 37, 97, 80, 117, 140, 74, 214, 153, 80, 140, 64, 
-    246, 104, 74, 140, 80, 117, 97, 74, 140, 226, 70, 253, 247, 214, 153, 
-    226, 70, 253, 247, 97, 226, 70, 253, 247, 246, 104, 226, 70, 253, 247, 
-    140, 241, 255, 117, 97, 241, 254, 97, 241, 255, 117, 140, 241, 254, 140, 
-    52, 80, 2, 91, 43, 44, 52, 80, 2, 91, 97, 52, 80, 2, 91, 140, 52, 74, 
-    214, 153, 52, 74, 97, 52, 74, 246, 104, 52, 74, 43, 44, 52, 74, 120, 124, 
-    52, 74, 228, 56, 212, 9, 52, 74, 228, 56, 245, 220, 52, 74, 219, 28, 245, 
-    220, 52, 74, 219, 28, 212, 9, 52, 74, 140, 215, 211, 74, 97, 215, 211, 
-    74, 140, 218, 230, 74, 97, 218, 230, 74, 214, 153, 80, 2, 52, 91, 246, 
-    104, 80, 2, 52, 91, 140, 248, 155, 74, 214, 153, 248, 155, 74, 97, 248, 
-    155, 74, 246, 104, 248, 155, 74, 140, 80, 216, 42, 130, 97, 80, 216, 42, 
-    130, 140, 71, 74, 214, 153, 71, 74, 97, 71, 74, 246, 104, 71, 74, 214, 
-    153, 71, 80, 243, 243, 130, 214, 153, 71, 80, 226, 197, 225, 214, 214, 
-    153, 71, 80, 226, 197, 225, 215, 2, 203, 130, 214, 153, 71, 80, 226, 197, 
-    225, 215, 2, 67, 130, 214, 153, 71, 52, 74, 214, 153, 71, 52, 80, 226, 
-    197, 225, 214, 97, 71, 80, 243, 243, 212, 56, 228, 56, 212, 9, 80, 216, 
-    42, 249, 160, 219, 28, 245, 220, 80, 216, 42, 249, 160, 120, 124, 71, 74, 
-    44, 80, 2, 4, 250, 35, 246, 104, 80, 140, 64, 214, 153, 74, 134, 97, 253, 
-    247, 140, 80, 2, 67, 91, 97, 80, 2, 67, 91, 43, 44, 80, 2, 67, 91, 140, 
-    80, 2, 52, 67, 91, 97, 80, 2, 52, 67, 91, 43, 44, 80, 2, 52, 67, 91, 140, 
-    226, 173, 74, 97, 226, 173, 74, 43, 44, 226, 173, 74, 31, 254, 154, 249, 
-    214, 225, 253, 247, 233, 216, 187, 245, 27, 216, 187, 247, 138, 228, 52, 
-    245, 28, 245, 152, 220, 127, 235, 245, 229, 221, 245, 170, 226, 231, 228, 
-    52, 254, 124, 245, 170, 226, 231, 4, 245, 170, 226, 231, 249, 186, 253, 
-    238, 231, 62, 247, 138, 228, 52, 249, 188, 253, 238, 231, 62, 4, 249, 
-    186, 253, 238, 231, 62, 245, 143, 64, 224, 172, 230, 24, 224, 180, 230, 
-    24, 249, 165, 230, 24, 218, 40, 230, 182, 50, 230, 180, 50, 59, 225, 22, 
-    247, 169, 219, 95, 220, 128, 230, 181, 253, 217, 226, 167, 222, 234, 226, 
-    167, 251, 114, 226, 167, 42, 222, 193, 249, 109, 222, 193, 244, 4, 222, 
-    193, 224, 168, 111, 235, 234, 44, 254, 109, 254, 109, 231, 88, 254, 109, 
-    218, 255, 254, 109, 247, 171, 247, 138, 228, 52, 247, 174, 226, 8, 111, 
-    228, 52, 226, 8, 111, 232, 146, 254, 118, 232, 146, 226, 158, 235, 198, 
-    214, 175, 235, 211, 52, 235, 211, 215, 211, 235, 211, 249, 182, 235, 211, 
-    218, 13, 235, 211, 213, 129, 235, 211, 250, 2, 235, 211, 250, 2, 249, 
-    182, 235, 211, 254, 88, 249, 182, 235, 211, 216, 186, 252, 67, 223, 137, 
-    224, 169, 59, 230, 181, 245, 33, 243, 46, 224, 169, 241, 57, 216, 89, 
-    226, 167, 223, 49, 182, 235, 193, 233, 65, 222, 91, 219, 157, 212, 35, 
-    211, 200, 224, 180, 228, 52, 182, 230, 182, 182, 253, 210, 128, 111, 228, 
-    52, 253, 210, 128, 111, 254, 48, 128, 111, 254, 48, 251, 88, 228, 52, 
-    255, 4, 128, 111, 229, 100, 254, 48, 228, 59, 255, 4, 128, 111, 254, 148, 
-    128, 111, 228, 52, 254, 148, 128, 111, 254, 148, 128, 177, 128, 111, 215, 
-    211, 182, 254, 155, 128, 111, 245, 94, 111, 243, 45, 245, 94, 111, 247, 
-    234, 252, 23, 254, 50, 216, 196, 232, 221, 243, 45, 128, 111, 254, 48, 
-    128, 216, 42, 177, 216, 196, 236, 15, 226, 231, 236, 15, 64, 177, 254, 
-    48, 128, 111, 249, 227, 245, 97, 245, 98, 249, 226, 222, 234, 236, 0, 
-    128, 111, 222, 234, 128, 111, 249, 154, 111, 245, 67, 245, 96, 111, 218, 
-    157, 245, 97, 248, 55, 128, 111, 128, 216, 42, 251, 78, 248, 72, 231, 88, 
-    251, 77, 224, 11, 128, 111, 228, 52, 128, 111, 240, 104, 111, 228, 52, 
-    240, 104, 111, 218, 109, 245, 94, 111, 233, 15, 177, 128, 111, 242, 130, 
-    177, 128, 111, 233, 15, 117, 128, 111, 242, 130, 117, 128, 111, 233, 15, 
-    251, 88, 228, 52, 128, 111, 242, 130, 251, 88, 228, 52, 128, 111, 230, 
-    97, 233, 14, 230, 97, 242, 129, 252, 23, 228, 52, 245, 94, 111, 228, 52, 
-    233, 14, 228, 52, 242, 129, 229, 100, 233, 15, 228, 59, 128, 111, 229, 
-    100, 242, 130, 228, 59, 128, 111, 233, 15, 177, 245, 94, 111, 242, 130, 
-    177, 245, 94, 111, 229, 100, 233, 15, 228, 59, 245, 94, 111, 229, 100, 
-    242, 130, 228, 59, 245, 94, 111, 233, 15, 177, 242, 129, 242, 130, 177, 
-    233, 14, 229, 100, 233, 15, 228, 59, 242, 129, 229, 100, 242, 130, 228, 
-    59, 233, 14, 224, 202, 218, 55, 224, 203, 177, 128, 111, 218, 56, 177, 
-    128, 111, 224, 203, 177, 245, 94, 111, 218, 56, 177, 245, 94, 111, 247, 
-    138, 228, 52, 224, 205, 247, 138, 228, 52, 218, 57, 218, 64, 226, 231, 
-    218, 22, 226, 231, 228, 52, 115, 218, 64, 226, 231, 228, 52, 115, 218, 
-    22, 226, 231, 218, 64, 64, 177, 128, 111, 218, 22, 64, 177, 128, 111, 
-    229, 100, 115, 218, 64, 64, 228, 59, 128, 111, 229, 100, 115, 218, 22, 
-    64, 228, 59, 128, 111, 218, 64, 64, 2, 228, 52, 128, 111, 218, 22, 64, 2, 
-    228, 52, 128, 111, 230, 81, 230, 82, 230, 83, 230, 82, 214, 175, 42, 236, 
-    15, 226, 231, 42, 226, 150, 226, 231, 42, 236, 15, 64, 177, 128, 111, 42, 
-    226, 150, 64, 177, 128, 111, 42, 250, 251, 42, 249, 102, 37, 225, 22, 37, 
-    230, 181, 37, 216, 85, 37, 247, 169, 219, 95, 37, 59, 226, 167, 37, 222, 
-    234, 226, 167, 37, 253, 217, 226, 167, 37, 245, 97, 37, 248, 156, 92, 
-    225, 22, 92, 230, 181, 92, 216, 85, 92, 59, 226, 167, 44, 217, 87, 43, 
-    217, 87, 124, 217, 87, 120, 217, 87, 253, 220, 230, 156, 215, 191, 244, 
-    25, 215, 211, 67, 252, 141, 44, 215, 93, 52, 67, 252, 141, 52, 44, 215, 
-    93, 247, 138, 228, 52, 224, 163, 228, 52, 215, 191, 247, 138, 228, 52, 
-    244, 26, 229, 102, 52, 67, 252, 141, 52, 44, 215, 93, 224, 203, 214, 184, 
-    223, 91, 218, 56, 214, 184, 223, 91, 228, 57, 218, 77, 226, 231, 249, 
-    186, 253, 238, 228, 57, 218, 76, 228, 57, 218, 77, 64, 177, 128, 111, 
-    249, 186, 253, 238, 228, 57, 218, 77, 177, 128, 111, 226, 150, 226, 231, 
-    236, 15, 226, 231, 230, 87, 241, 200, 249, 196, 231, 137, 235, 208, 211, 
-    145, 229, 202, 228, 58, 44, 254, 110, 2, 254, 25, 44, 215, 225, 230, 24, 
-    232, 146, 254, 118, 230, 24, 232, 146, 226, 158, 230, 24, 235, 198, 230, 
-    24, 214, 175, 247, 249, 226, 167, 59, 226, 167, 218, 157, 226, 167, 247, 
-    169, 216, 85, 251, 164, 43, 228, 57, 244, 181, 220, 149, 224, 180, 44, 
-    228, 57, 244, 181, 220, 149, 224, 180, 43, 220, 149, 224, 180, 44, 220, 
-    149, 224, 180, 223, 49, 216, 89, 245, 97, 249, 99, 232, 146, 226, 158, 
-    249, 99, 232, 146, 254, 118, 52, 218, 63, 52, 218, 21, 52, 235, 198, 52, 
-    214, 175, 225, 47, 128, 22, 226, 8, 111, 233, 15, 2, 247, 120, 242, 130, 
-    2, 247, 120, 213, 187, 230, 97, 233, 14, 213, 187, 230, 97, 242, 129, 
-    233, 15, 128, 216, 42, 177, 242, 129, 242, 130, 128, 216, 42, 177, 233, 
-    14, 128, 216, 42, 177, 233, 14, 128, 216, 42, 177, 242, 129, 128, 216, 
-    42, 177, 224, 202, 128, 216, 42, 177, 218, 55, 247, 138, 228, 52, 224, 
-    206, 177, 245, 99, 247, 138, 228, 52, 218, 58, 177, 245, 99, 228, 52, 42, 
-    236, 15, 64, 177, 128, 111, 228, 52, 42, 226, 150, 64, 177, 128, 111, 42, 
-    236, 15, 64, 177, 228, 52, 128, 111, 42, 226, 150, 64, 177, 228, 52, 128, 
-    111, 233, 15, 251, 88, 228, 52, 245, 94, 111, 242, 130, 251, 88, 228, 52, 
-    245, 94, 111, 224, 203, 251, 88, 228, 52, 245, 94, 111, 218, 56, 251, 88, 
-    228, 52, 245, 94, 111, 228, 52, 228, 57, 218, 77, 226, 231, 247, 138, 
-    228, 52, 249, 188, 253, 238, 228, 57, 218, 76, 228, 52, 228, 57, 218, 77, 
-    64, 177, 128, 111, 247, 138, 228, 52, 249, 188, 253, 238, 228, 57, 218, 
-    77, 177, 245, 99, 67, 245, 163, 230, 222, 203, 245, 163, 120, 44, 247, 
-    255, 245, 163, 124, 44, 247, 255, 245, 163, 245, 170, 64, 2, 199, 203, 
-    91, 245, 170, 64, 2, 67, 252, 141, 253, 207, 245, 143, 64, 203, 91, 4, 
-    245, 170, 64, 2, 67, 252, 141, 253, 207, 245, 143, 64, 203, 91, 245, 170, 
-    64, 2, 59, 48, 245, 170, 64, 2, 226, 123, 4, 245, 170, 64, 2, 226, 123, 
-    245, 170, 64, 2, 214, 183, 245, 170, 64, 2, 113, 203, 218, 90, 249, 186, 
-    2, 199, 203, 91, 249, 186, 2, 67, 252, 141, 253, 207, 245, 143, 64, 203, 
-    91, 4, 249, 186, 2, 67, 252, 141, 253, 207, 245, 143, 64, 203, 91, 249, 
-    186, 2, 226, 123, 4, 249, 186, 2, 226, 123, 210, 160, 187, 252, 173, 231, 
-    61, 247, 250, 50, 245, 172, 74, 240, 234, 120, 253, 249, 124, 253, 249, 
-    224, 175, 225, 165, 212, 32, 232, 213, 43, 250, 181, 44, 250, 181, 43, 
-    244, 57, 44, 244, 57, 251, 175, 44, 249, 132, 251, 175, 43, 249, 132, 
-    216, 14, 44, 249, 132, 216, 14, 43, 249, 132, 223, 49, 228, 52, 50, 42, 
-    232, 104, 254, 25, 221, 164, 221, 171, 217, 1, 223, 120, 224, 241, 235, 
-    238, 213, 165, 218, 234, 225, 41, 64, 235, 207, 50, 215, 94, 228, 52, 50, 
-    212, 42, 240, 236, 216, 14, 43, 249, 160, 216, 14, 44, 249, 160, 251, 
-    175, 43, 249, 160, 251, 175, 44, 249, 160, 216, 14, 163, 235, 211, 251, 
-    175, 163, 235, 211, 243, 240, 219, 75, 120, 253, 250, 252, 24, 113, 203, 
-    252, 129, 226, 160, 234, 138, 245, 90, 216, 42, 216, 196, 222, 251, 211, 
-    179, 236, 0, 115, 223, 117, 251, 163, 234, 137, 233, 42, 254, 110, 127, 
-    222, 247, 254, 110, 127, 245, 90, 216, 42, 216, 196, 233, 46, 252, 35, 
-    222, 233, 249, 70, 254, 155, 254, 1, 217, 181, 216, 4, 222, 123, 247, 
-    215, 226, 151, 249, 198, 217, 52, 219, 86, 249, 151, 249, 150, 254, 66, 
-    243, 225, 16, 240, 151, 254, 66, 243, 225, 16, 218, 228, 224, 27, 254, 
-    66, 243, 225, 16, 224, 28, 245, 99, 254, 66, 243, 225, 16, 224, 28, 247, 
-    174, 254, 66, 243, 225, 16, 224, 28, 247, 248, 254, 66, 243, 225, 16, 
-    224, 28, 235, 56, 254, 66, 243, 225, 16, 224, 28, 250, 35, 254, 66, 243, 
-    225, 16, 250, 36, 218, 135, 254, 66, 243, 225, 16, 250, 36, 235, 56, 254, 
-    66, 243, 225, 16, 219, 96, 130, 254, 66, 243, 225, 16, 252, 181, 130, 
-    254, 66, 243, 225, 16, 224, 28, 219, 95, 254, 66, 243, 225, 16, 224, 28, 
-    252, 180, 254, 66, 243, 225, 16, 224, 28, 233, 14, 254, 66, 243, 225, 16, 
-    224, 28, 242, 129, 254, 66, 243, 225, 16, 140, 214, 19, 254, 66, 243, 
-    225, 16, 97, 214, 19, 254, 66, 243, 225, 16, 224, 28, 140, 74, 254, 66, 
-    243, 225, 16, 224, 28, 97, 74, 254, 66, 243, 225, 16, 250, 36, 252, 180, 
-    254, 66, 243, 225, 16, 124, 217, 88, 214, 183, 254, 66, 243, 225, 16, 
-    248, 55, 218, 135, 254, 66, 243, 225, 16, 224, 28, 124, 250, 238, 254, 
-    66, 243, 225, 16, 224, 28, 248, 54, 254, 66, 243, 225, 16, 124, 217, 88, 
-    235, 56, 254, 66, 243, 225, 16, 214, 153, 214, 19, 254, 66, 243, 225, 16, 
-    224, 28, 214, 153, 74, 254, 66, 243, 225, 16, 120, 217, 88, 226, 123, 
-    254, 66, 243, 225, 16, 248, 66, 218, 135, 254, 66, 243, 225, 16, 224, 28, 
-    120, 250, 238, 254, 66, 243, 225, 16, 224, 28, 248, 65, 254, 66, 243, 
-    225, 16, 120, 217, 88, 235, 56, 254, 66, 243, 225, 16, 246, 104, 214, 19, 
-    254, 66, 243, 225, 16, 224, 28, 246, 104, 74, 254, 66, 243, 225, 16, 223, 
-    253, 214, 183, 254, 66, 243, 225, 16, 248, 55, 214, 183, 254, 66, 243, 
-    225, 16, 247, 249, 214, 183, 254, 66, 243, 225, 16, 235, 57, 214, 183, 
-    254, 66, 243, 225, 16, 250, 36, 214, 183, 254, 66, 243, 225, 16, 120, 
-    220, 5, 235, 56, 254, 66, 243, 225, 16, 223, 253, 224, 27, 254, 66, 243, 
-    225, 16, 250, 36, 218, 156, 254, 66, 243, 225, 16, 224, 28, 249, 226, 
-    254, 66, 243, 225, 16, 120, 217, 88, 248, 1, 254, 66, 243, 225, 16, 248, 
-    66, 248, 1, 254, 66, 243, 225, 16, 218, 157, 248, 1, 254, 66, 243, 225, 
-    16, 235, 57, 248, 1, 254, 66, 243, 225, 16, 250, 36, 248, 1, 254, 66, 
-    243, 225, 16, 124, 220, 5, 218, 135, 254, 66, 243, 225, 16, 43, 220, 5, 
-    218, 135, 254, 66, 243, 225, 16, 216, 89, 248, 1, 254, 66, 243, 225, 16, 
-    242, 130, 248, 1, 254, 66, 243, 225, 16, 249, 220, 130, 254, 66, 243, 
-    225, 16, 248, 66, 182, 254, 66, 243, 225, 16, 210, 34, 254, 66, 243, 225, 
-    16, 218, 136, 182, 254, 66, 243, 225, 16, 220, 151, 214, 183, 254, 66, 
-    243, 225, 16, 224, 28, 228, 52, 245, 99, 254, 66, 243, 225, 16, 224, 28, 
-    224, 12, 254, 66, 243, 225, 16, 124, 250, 239, 182, 254, 66, 243, 225, 
-    16, 120, 250, 239, 182, 254, 66, 243, 225, 16, 235, 185, 254, 66, 243, 
-    225, 16, 223, 37, 254, 66, 243, 225, 16, 226, 201, 254, 66, 243, 225, 16, 
-    254, 144, 214, 183, 254, 66, 243, 225, 16, 245, 101, 214, 183, 254, 66, 
-    243, 225, 16, 235, 186, 214, 183, 254, 66, 243, 225, 16, 226, 202, 214, 
-    183, 254, 66, 243, 225, 16, 254, 143, 228, 52, 250, 130, 78, 44, 254, 
-    110, 2, 246, 104, 210, 35, 74, 219, 235, 204, 251, 163, 252, 45, 87, 67, 
-    232, 214, 2, 230, 224, 247, 120, 235, 216, 87, 249, 183, 214, 181, 87, 
-    247, 189, 214, 181, 87, 245, 154, 87, 249, 210, 87, 71, 42, 2, 250, 175, 
-    67, 232, 213, 245, 130, 87, 254, 139, 234, 139, 87, 241, 213, 87, 37, 
-    203, 252, 141, 2, 228, 50, 37, 215, 226, 246, 106, 251, 135, 250, 36, 2, 
-    228, 54, 74, 214, 179, 87, 230, 137, 87, 240, 164, 87, 226, 174, 242, 59, 
-    87, 226, 174, 233, 147, 87, 225, 244, 87, 225, 243, 87, 247, 197, 249, 
-    97, 16, 244, 20, 105, 219, 50, 87, 254, 66, 243, 225, 16, 224, 27, 248, 
-    83, 220, 138, 234, 139, 87, 224, 192, 226, 75, 229, 82, 226, 75, 224, 
-    188, 221, 189, 87, 250, 17, 221, 189, 87, 43, 226, 4, 214, 160, 103, 43, 
-    226, 4, 245, 21, 43, 226, 4, 232, 108, 103, 44, 226, 4, 214, 160, 103, 
-    44, 226, 4, 245, 21, 44, 226, 4, 232, 108, 103, 43, 42, 251, 158, 214, 
-    160, 249, 160, 43, 42, 251, 158, 245, 21, 43, 42, 251, 158, 232, 108, 
-    249, 160, 44, 42, 251, 158, 214, 160, 249, 160, 44, 42, 251, 158, 245, 
-    21, 44, 42, 251, 158, 232, 108, 249, 160, 43, 249, 99, 251, 158, 214, 
-    160, 103, 43, 249, 99, 251, 158, 230, 224, 225, 101, 43, 249, 99, 251, 
-    158, 232, 108, 103, 249, 99, 251, 158, 245, 21, 44, 249, 99, 251, 158, 
-    214, 160, 103, 44, 249, 99, 251, 158, 230, 224, 225, 101, 44, 249, 99, 
-    251, 158, 232, 108, 103, 235, 212, 245, 21, 203, 232, 214, 245, 21, 214, 
-    160, 43, 177, 232, 108, 44, 249, 99, 251, 158, 221, 172, 214, 160, 44, 
-    177, 232, 108, 43, 249, 99, 251, 158, 221, 172, 218, 41, 216, 13, 218, 
-    41, 251, 174, 216, 14, 42, 127, 251, 175, 42, 127, 251, 175, 42, 251, 
-    158, 117, 216, 14, 42, 127, 34, 16, 251, 174, 43, 67, 93, 232, 213, 44, 
-    67, 93, 232, 213, 203, 221, 205, 232, 212, 203, 221, 205, 232, 211, 203, 
-    221, 205, 232, 210, 203, 221, 205, 232, 209, 248, 46, 16, 192, 67, 22, 
-    216, 14, 222, 251, 248, 46, 16, 192, 67, 22, 251, 175, 222, 251, 248, 46, 
-    16, 192, 67, 2, 250, 35, 248, 46, 16, 192, 124, 22, 203, 2, 250, 35, 248, 
-    46, 16, 192, 120, 22, 203, 2, 250, 35, 248, 46, 16, 192, 67, 2, 215, 225, 
-    248, 46, 16, 192, 124, 22, 203, 2, 215, 225, 248, 46, 16, 192, 120, 22, 
-    203, 2, 215, 225, 248, 46, 16, 192, 67, 22, 212, 35, 248, 46, 16, 192, 
-    124, 22, 203, 2, 212, 35, 248, 46, 16, 192, 120, 22, 203, 2, 212, 35, 
-    248, 46, 16, 192, 124, 22, 241, 44, 248, 46, 16, 192, 120, 22, 241, 44, 
-    248, 46, 16, 192, 67, 22, 216, 14, 233, 46, 248, 46, 16, 192, 67, 22, 
-    251, 175, 233, 46, 42, 244, 32, 223, 54, 87, 245, 182, 87, 67, 232, 214, 
-    245, 21, 231, 33, 251, 146, 231, 33, 199, 117, 219, 250, 231, 33, 219, 
-    251, 117, 232, 137, 231, 33, 199, 117, 113, 219, 237, 231, 33, 113, 219, 
-    238, 117, 232, 137, 231, 33, 113, 219, 238, 235, 64, 231, 33, 215, 208, 
-    231, 33, 216, 223, 231, 33, 225, 188, 245, 224, 242, 122, 243, 219, 216, 
-    14, 226, 3, 251, 175, 226, 3, 216, 14, 249, 99, 127, 251, 175, 249, 99, 
-    127, 216, 14, 216, 6, 220, 53, 127, 251, 175, 216, 6, 220, 53, 127, 71, 
-    215, 239, 252, 35, 222, 234, 2, 250, 35, 218, 120, 244, 64, 255, 17, 249, 
-    96, 245, 171, 235, 198, 248, 83, 245, 24, 87, 85, 222, 247, 52, 215, 225, 
-    85, 233, 42, 52, 215, 225, 85, 214, 162, 52, 215, 225, 85, 246, 105, 52, 
-    215, 225, 85, 222, 247, 52, 215, 226, 2, 67, 130, 85, 233, 42, 52, 215, 
-    226, 2, 67, 130, 85, 222, 247, 215, 226, 2, 52, 67, 130, 254, 173, 250, 
-    3, 218, 126, 216, 86, 250, 3, 240, 237, 2, 244, 50, 221, 241, 16, 31, 
-    227, 202, 16, 31, 218, 152, 64, 241, 233, 16, 31, 218, 152, 64, 216, 212, 
-    16, 31, 245, 143, 64, 216, 212, 16, 31, 245, 143, 64, 215, 243, 16, 31, 
-    245, 132, 16, 31, 255, 7, 16, 31, 252, 44, 16, 31, 252, 179, 16, 31, 203, 
-    217, 89, 16, 31, 232, 214, 244, 145, 16, 31, 67, 217, 89, 16, 31, 244, 
-    20, 244, 145, 16, 31, 250, 230, 223, 53, 16, 31, 220, 28, 226, 130, 16, 
-    31, 220, 28, 235, 255, 16, 31, 248, 151, 232, 204, 245, 77, 16, 31, 248, 
-    31, 249, 178, 110, 16, 31, 248, 31, 249, 178, 105, 16, 31, 248, 31, 249, 
-    178, 158, 16, 31, 248, 31, 249, 178, 161, 16, 31, 152, 255, 7, 16, 31, 
-    217, 177, 236, 62, 16, 31, 245, 143, 64, 215, 244, 251, 213, 16, 31, 251, 
-    5, 16, 31, 245, 143, 64, 231, 81, 16, 31, 218, 61, 16, 31, 245, 77, 16, 
-    31, 244, 107, 220, 137, 16, 31, 242, 121, 220, 137, 16, 31, 223, 121, 
-    220, 137, 16, 31, 214, 174, 220, 137, 16, 31, 219, 18, 16, 31, 248, 63, 
-    251, 216, 87, 204, 251, 163, 16, 31, 229, 85, 16, 31, 248, 64, 244, 20, 
-    105, 16, 31, 218, 62, 244, 20, 105, 226, 241, 103, 226, 241, 250, 152, 
-    226, 241, 244, 23, 226, 241, 235, 193, 244, 23, 226, 241, 252, 42, 251, 
-    124, 226, 241, 251, 170, 216, 111, 226, 241, 251, 155, 252, 146, 240, 
-    103, 226, 241, 254, 127, 64, 250, 129, 226, 241, 248, 156, 226, 241, 249, 
-    87, 255, 11, 227, 200, 226, 241, 52, 252, 180, 37, 21, 110, 37, 21, 105, 
-    37, 21, 158, 37, 21, 161, 37, 21, 189, 37, 21, 194, 37, 21, 198, 37, 21, 
-    195, 37, 21, 200, 37, 54, 216, 247, 37, 54, 245, 167, 37, 54, 215, 76, 
-    37, 54, 216, 164, 37, 54, 244, 5, 37, 54, 244, 118, 37, 54, 219, 119, 37, 
-    54, 220, 119, 37, 54, 245, 190, 37, 54, 228, 197, 37, 54, 215, 73, 88, 
-    21, 110, 88, 21, 105, 88, 21, 158, 88, 21, 161, 88, 21, 189, 88, 21, 194, 
-    88, 21, 198, 88, 21, 195, 88, 21, 200, 88, 54, 216, 247, 88, 54, 245, 
-    167, 88, 54, 215, 76, 88, 54, 216, 164, 88, 54, 244, 5, 88, 54, 244, 118, 
-    88, 54, 219, 119, 88, 54, 220, 119, 88, 54, 245, 190, 88, 54, 228, 197, 
-    88, 54, 215, 73, 21, 123, 243, 229, 218, 129, 21, 113, 243, 229, 218, 
-    129, 21, 134, 243, 229, 218, 129, 21, 244, 11, 243, 229, 218, 129, 21, 
-    244, 81, 243, 229, 218, 129, 21, 219, 125, 243, 229, 218, 129, 21, 220, 
-    122, 243, 229, 218, 129, 21, 245, 193, 243, 229, 218, 129, 21, 228, 200, 
-    243, 229, 218, 129, 54, 216, 248, 243, 229, 218, 129, 54, 245, 168, 243, 
-    229, 218, 129, 54, 215, 77, 243, 229, 218, 129, 54, 216, 165, 243, 229, 
-    218, 129, 54, 244, 6, 243, 229, 218, 129, 54, 244, 119, 243, 229, 218, 
-    129, 54, 219, 120, 243, 229, 218, 129, 54, 220, 120, 243, 229, 218, 129, 
-    54, 245, 191, 243, 229, 218, 129, 54, 228, 198, 243, 229, 218, 129, 54, 
-    215, 74, 243, 229, 218, 129, 88, 7, 4, 1, 61, 88, 7, 4, 1, 253, 158, 88, 
-    7, 4, 1, 251, 66, 88, 7, 4, 1, 249, 60, 88, 7, 4, 1, 75, 88, 7, 4, 1, 
-    245, 6, 88, 7, 4, 1, 243, 202, 88, 7, 4, 1, 242, 60, 88, 7, 4, 1, 73, 88, 
-    7, 4, 1, 235, 144, 88, 7, 4, 1, 235, 23, 88, 7, 4, 1, 156, 88, 7, 4, 1, 
-    193, 88, 7, 4, 1, 230, 25, 88, 7, 4, 1, 76, 88, 7, 4, 1, 226, 105, 88, 7, 
-    4, 1, 224, 96, 88, 7, 4, 1, 153, 88, 7, 4, 1, 222, 91, 88, 7, 4, 1, 217, 
-    152, 88, 7, 4, 1, 70, 88, 7, 4, 1, 214, 105, 88, 7, 4, 1, 212, 98, 88, 7, 
-    4, 1, 211, 178, 88, 7, 4, 1, 211, 117, 88, 7, 4, 1, 210, 159, 37, 7, 6, 
-    1, 61, 37, 7, 6, 1, 253, 158, 37, 7, 6, 1, 251, 66, 37, 7, 6, 1, 249, 60, 
-    37, 7, 6, 1, 75, 37, 7, 6, 1, 245, 6, 37, 7, 6, 1, 243, 202, 37, 7, 6, 1, 
-    242, 60, 37, 7, 6, 1, 73, 37, 7, 6, 1, 235, 144, 37, 7, 6, 1, 235, 23, 
-    37, 7, 6, 1, 156, 37, 7, 6, 1, 193, 37, 7, 6, 1, 230, 25, 37, 7, 6, 1, 
-    76, 37, 7, 6, 1, 226, 105, 37, 7, 6, 1, 224, 96, 37, 7, 6, 1, 153, 37, 7, 
-    6, 1, 222, 91, 37, 7, 6, 1, 217, 152, 37, 7, 6, 1, 70, 37, 7, 6, 1, 214, 
-    105, 37, 7, 6, 1, 212, 98, 37, 7, 6, 1, 211, 178, 37, 7, 6, 1, 211, 117, 
-    37, 7, 6, 1, 210, 159, 37, 7, 4, 1, 61, 37, 7, 4, 1, 253, 158, 37, 7, 4, 
-    1, 251, 66, 37, 7, 4, 1, 249, 60, 37, 7, 4, 1, 75, 37, 7, 4, 1, 245, 6, 
-    37, 7, 4, 1, 243, 202, 37, 7, 4, 1, 242, 60, 37, 7, 4, 1, 73, 37, 7, 4, 
-    1, 235, 144, 37, 7, 4, 1, 235, 23, 37, 7, 4, 1, 156, 37, 7, 4, 1, 193, 
-    37, 7, 4, 1, 230, 25, 37, 7, 4, 1, 76, 37, 7, 4, 1, 226, 105, 37, 7, 4, 
-    1, 224, 96, 37, 7, 4, 1, 153, 37, 7, 4, 1, 222, 91, 37, 7, 4, 1, 217, 
-    152, 37, 7, 4, 1, 70, 37, 7, 4, 1, 214, 105, 37, 7, 4, 1, 212, 98, 37, 7, 
-    4, 1, 211, 178, 37, 7, 4, 1, 211, 117, 37, 7, 4, 1, 210, 159, 37, 21, 
-    210, 86, 152, 37, 54, 245, 167, 152, 37, 54, 215, 76, 152, 37, 54, 216, 
-    164, 152, 37, 54, 244, 5, 152, 37, 54, 244, 118, 152, 37, 54, 219, 119, 
-    152, 37, 54, 220, 119, 152, 37, 54, 245, 190, 152, 37, 54, 228, 197, 152, 
-    37, 54, 215, 73, 52, 37, 21, 110, 52, 37, 21, 105, 52, 37, 21, 158, 52, 
-    37, 21, 161, 52, 37, 21, 189, 52, 37, 21, 194, 52, 37, 21, 198, 52, 37, 
-    21, 195, 52, 37, 21, 200, 52, 37, 54, 216, 247, 152, 37, 21, 210, 86, 93, 
-    99, 192, 241, 44, 93, 99, 114, 241, 44, 93, 99, 192, 213, 239, 93, 99, 
-    114, 213, 239, 93, 99, 192, 215, 211, 248, 157, 241, 44, 93, 99, 114, 
-    215, 211, 248, 157, 241, 44, 93, 99, 192, 215, 211, 248, 157, 213, 239, 
-    93, 99, 114, 215, 211, 248, 157, 213, 239, 93, 99, 192, 224, 24, 248, 
-    157, 241, 44, 93, 99, 114, 224, 24, 248, 157, 241, 44, 93, 99, 192, 224, 
-    24, 248, 157, 213, 239, 93, 99, 114, 224, 24, 248, 157, 213, 239, 93, 99, 
-    192, 124, 22, 222, 251, 93, 99, 124, 192, 22, 44, 241, 221, 93, 99, 124, 
-    114, 22, 44, 232, 230, 93, 99, 114, 124, 22, 222, 251, 93, 99, 192, 124, 
-    22, 233, 46, 93, 99, 124, 192, 22, 43, 241, 221, 93, 99, 124, 114, 22, 
-    43, 232, 230, 93, 99, 114, 124, 22, 233, 46, 93, 99, 192, 120, 22, 222, 
-    251, 93, 99, 120, 192, 22, 44, 241, 221, 93, 99, 120, 114, 22, 44, 232, 
-    230, 93, 99, 114, 120, 22, 222, 251, 93, 99, 192, 120, 22, 233, 46, 93, 
-    99, 120, 192, 22, 43, 241, 221, 93, 99, 120, 114, 22, 43, 232, 230, 93, 
-    99, 114, 120, 22, 233, 46, 93, 99, 192, 67, 22, 222, 251, 93, 99, 67, 
-    192, 22, 44, 241, 221, 93, 99, 120, 114, 22, 44, 124, 232, 230, 93, 99, 
-    124, 114, 22, 44, 120, 232, 230, 93, 99, 67, 114, 22, 44, 232, 230, 93, 
-    99, 124, 192, 22, 44, 120, 241, 221, 93, 99, 120, 192, 22, 44, 124, 241, 
-    221, 93, 99, 114, 67, 22, 222, 251, 93, 99, 192, 67, 22, 233, 46, 93, 99, 
-    67, 192, 22, 43, 241, 221, 93, 99, 120, 114, 22, 43, 124, 232, 230, 93, 
-    99, 124, 114, 22, 43, 120, 232, 230, 93, 99, 67, 114, 22, 43, 232, 230, 
-    93, 99, 124, 192, 22, 43, 120, 241, 221, 93, 99, 120, 192, 22, 43, 124, 
-    241, 221, 93, 99, 114, 67, 22, 233, 46, 93, 99, 192, 124, 22, 241, 44, 
-    93, 99, 43, 114, 22, 44, 124, 232, 230, 93, 99, 44, 114, 22, 43, 124, 
-    232, 230, 93, 99, 124, 192, 22, 203, 241, 221, 93, 99, 124, 114, 22, 203, 
-    232, 230, 93, 99, 44, 192, 22, 43, 124, 241, 221, 93, 99, 43, 192, 22, 
-    44, 124, 241, 221, 93, 99, 114, 124, 22, 241, 44, 93, 99, 192, 120, 22, 
-    241, 44, 93, 99, 43, 114, 22, 44, 120, 232, 230, 93, 99, 44, 114, 22, 43, 
-    120, 232, 230, 93, 99, 120, 192, 22, 203, 241, 221, 93, 99, 120, 114, 22, 
-    203, 232, 230, 93, 99, 44, 192, 22, 43, 120, 241, 221, 93, 99, 43, 192, 
-    22, 44, 120, 241, 221, 93, 99, 114, 120, 22, 241, 44, 93, 99, 192, 67, 
-    22, 241, 44, 93, 99, 43, 114, 22, 44, 67, 232, 230, 93, 99, 44, 114, 22, 
-    43, 67, 232, 230, 93, 99, 67, 192, 22, 203, 241, 221, 93, 99, 120, 114, 
-    22, 124, 203, 232, 230, 93, 99, 124, 114, 22, 120, 203, 232, 230, 93, 99, 
-    67, 114, 22, 203, 232, 230, 93, 99, 43, 120, 114, 22, 44, 124, 232, 230, 
-    93, 99, 44, 120, 114, 22, 43, 124, 232, 230, 93, 99, 43, 124, 114, 22, 
-    44, 120, 232, 230, 93, 99, 44, 124, 114, 22, 43, 120, 232, 230, 93, 99, 
-    124, 192, 22, 120, 203, 241, 221, 93, 99, 120, 192, 22, 124, 203, 241, 
-    221, 93, 99, 44, 192, 22, 43, 67, 241, 221, 93, 99, 43, 192, 22, 44, 67, 
-    241, 221, 93, 99, 114, 67, 22, 241, 44, 93, 99, 192, 52, 248, 157, 241, 
-    44, 93, 99, 114, 52, 248, 157, 241, 44, 93, 99, 192, 52, 248, 157, 213, 
-    239, 93, 99, 114, 52, 248, 157, 213, 239, 93, 99, 52, 241, 44, 93, 99, 
-    52, 213, 239, 93, 99, 124, 219, 155, 22, 44, 246, 113, 93, 99, 124, 52, 
-    22, 44, 219, 154, 93, 99, 52, 124, 22, 222, 251, 93, 99, 124, 219, 155, 
-    22, 43, 246, 113, 93, 99, 124, 52, 22, 43, 219, 154, 93, 99, 52, 124, 22, 
-    233, 46, 93, 99, 120, 219, 155, 22, 44, 246, 113, 93, 99, 120, 52, 22, 
-    44, 219, 154, 93, 99, 52, 120, 22, 222, 251, 93, 99, 120, 219, 155, 22, 
-    43, 246, 113, 93, 99, 120, 52, 22, 43, 219, 154, 93, 99, 52, 120, 22, 
-    233, 46, 93, 99, 67, 219, 155, 22, 44, 246, 113, 93, 99, 67, 52, 22, 44, 
-    219, 154, 93, 99, 52, 67, 22, 222, 251, 93, 99, 67, 219, 155, 22, 43, 
-    246, 113, 93, 99, 67, 52, 22, 43, 219, 154, 93, 99, 52, 67, 22, 233, 46, 
-    93, 99, 124, 219, 155, 22, 203, 246, 113, 93, 99, 124, 52, 22, 203, 219, 
-    154, 93, 99, 52, 124, 22, 241, 44, 93, 99, 120, 219, 155, 22, 203, 246, 
-    113, 93, 99, 120, 52, 22, 203, 219, 154, 93, 99, 52, 120, 22, 241, 44, 
-    93, 99, 67, 219, 155, 22, 203, 246, 113, 93, 99, 67, 52, 22, 203, 219, 
-    154, 93, 99, 52, 67, 22, 241, 44, 93, 99, 192, 254, 26, 124, 22, 222, 
-    251, 93, 99, 192, 254, 26, 124, 22, 233, 46, 93, 99, 192, 254, 26, 120, 
-    22, 233, 46, 93, 99, 192, 254, 26, 120, 22, 222, 251, 93, 99, 192, 247, 
-    255, 214, 160, 44, 216, 42, 232, 108, 233, 46, 93, 99, 192, 247, 255, 
-    214, 160, 43, 216, 42, 232, 108, 222, 251, 93, 99, 192, 247, 255, 249, 
-    130, 93, 99, 192, 233, 46, 93, 99, 192, 214, 163, 93, 99, 192, 222, 251, 
-    93, 99, 192, 246, 106, 93, 99, 114, 233, 46, 93, 99, 114, 214, 163, 93, 
-    99, 114, 222, 251, 93, 99, 114, 246, 106, 93, 99, 192, 43, 22, 114, 222, 
-    251, 93, 99, 192, 120, 22, 114, 246, 106, 93, 99, 114, 43, 22, 192, 222, 
-    251, 93, 99, 114, 120, 22, 192, 246, 106, 214, 160, 163, 251, 213, 232, 
-    108, 123, 245, 189, 251, 213, 232, 108, 123, 224, 22, 251, 213, 232, 108, 
-    134, 245, 187, 251, 213, 232, 108, 163, 251, 213, 232, 108, 244, 81, 245, 
-    187, 251, 213, 232, 108, 134, 224, 20, 251, 213, 232, 108, 220, 122, 245, 
-    187, 251, 213, 243, 229, 251, 213, 43, 220, 122, 245, 187, 251, 213, 43, 
-    134, 224, 20, 251, 213, 43, 244, 81, 245, 187, 251, 213, 43, 163, 251, 
-    213, 43, 134, 245, 187, 251, 213, 43, 123, 224, 22, 251, 213, 43, 123, 
-    245, 189, 251, 213, 44, 163, 251, 213, 192, 220, 92, 231, 82, 220, 92, 
-    248, 162, 220, 92, 214, 160, 123, 245, 189, 251, 213, 44, 123, 245, 189, 
-    251, 213, 224, 26, 232, 108, 233, 46, 224, 26, 232, 108, 222, 251, 224, 
-    26, 214, 160, 233, 46, 224, 26, 214, 160, 43, 22, 232, 108, 43, 22, 232, 
-    108, 222, 251, 224, 26, 214, 160, 43, 22, 232, 108, 222, 251, 224, 26, 
-    214, 160, 43, 22, 214, 160, 44, 22, 232, 108, 233, 46, 224, 26, 214, 160, 
-    43, 22, 214, 160, 44, 22, 232, 108, 222, 251, 224, 26, 214, 160, 222, 
-    251, 224, 26, 214, 160, 44, 22, 232, 108, 233, 46, 224, 26, 214, 160, 44, 
-    22, 232, 108, 43, 22, 232, 108, 222, 251, 85, 218, 234, 71, 218, 234, 71, 
-    42, 2, 222, 183, 249, 159, 71, 42, 249, 187, 85, 4, 218, 234, 42, 2, 203, 
-    244, 105, 42, 2, 67, 244, 105, 42, 2, 226, 144, 249, 126, 244, 105, 42, 
-    2, 214, 160, 43, 216, 42, 232, 108, 44, 244, 105, 42, 2, 214, 160, 44, 
-    216, 42, 232, 108, 43, 244, 105, 42, 2, 247, 255, 249, 126, 244, 105, 85, 
-    4, 218, 234, 71, 4, 218, 234, 85, 223, 116, 71, 223, 116, 85, 67, 223, 
-    116, 71, 67, 223, 116, 85, 226, 6, 71, 226, 6, 85, 214, 162, 215, 225, 
-    71, 214, 162, 215, 225, 85, 214, 162, 4, 215, 225, 71, 214, 162, 4, 215, 
-    225, 85, 222, 247, 215, 225, 71, 222, 247, 215, 225, 85, 222, 247, 4, 
-    215, 225, 71, 222, 247, 4, 215, 225, 85, 222, 247, 225, 8, 71, 222, 247, 
-    225, 8, 85, 246, 105, 215, 225, 71, 246, 105, 215, 225, 85, 246, 105, 4, 
-    215, 225, 71, 246, 105, 4, 215, 225, 85, 233, 42, 215, 225, 71, 233, 42, 
-    215, 225, 85, 233, 42, 4, 215, 225, 71, 233, 42, 4, 215, 225, 85, 233, 
-    42, 225, 8, 71, 233, 42, 225, 8, 85, 247, 248, 71, 247, 248, 71, 247, 
-    249, 249, 187, 85, 4, 247, 248, 244, 89, 232, 104, 71, 250, 35, 246, 118, 
-    250, 35, 250, 36, 2, 67, 244, 105, 251, 111, 85, 250, 35, 250, 36, 2, 43, 
-    163, 251, 221, 250, 36, 2, 44, 163, 251, 221, 250, 36, 2, 232, 108, 163, 
-    251, 221, 250, 36, 2, 214, 160, 163, 251, 221, 250, 36, 2, 214, 160, 44, 
-    224, 26, 251, 221, 250, 36, 2, 254, 155, 251, 88, 214, 160, 43, 224, 26, 
-    251, 221, 43, 163, 85, 250, 35, 44, 163, 85, 250, 35, 235, 194, 251, 113, 
-    235, 194, 71, 250, 35, 214, 160, 163, 235, 194, 71, 250, 35, 232, 108, 
-    163, 235, 194, 71, 250, 35, 214, 160, 43, 224, 26, 250, 33, 254, 25, 214, 
-    160, 44, 224, 26, 250, 33, 254, 25, 232, 108, 44, 224, 26, 250, 33, 254, 
-    25, 232, 108, 43, 224, 26, 250, 33, 254, 25, 214, 160, 163, 250, 35, 232, 
-    108, 163, 250, 35, 85, 232, 108, 44, 215, 225, 85, 232, 108, 43, 215, 
-    225, 85, 214, 160, 43, 215, 225, 85, 214, 160, 44, 215, 225, 71, 251, 
-    113, 42, 2, 43, 163, 251, 221, 42, 2, 44, 163, 251, 221, 42, 2, 214, 160, 
-    43, 247, 255, 163, 251, 221, 42, 2, 232, 108, 44, 247, 255, 163, 251, 
-    221, 71, 42, 2, 67, 251, 232, 232, 213, 71, 214, 162, 215, 226, 2, 247, 
-    120, 214, 162, 215, 226, 2, 43, 163, 251, 221, 214, 162, 215, 226, 2, 44, 
-    163, 251, 221, 233, 85, 250, 35, 71, 42, 2, 214, 160, 43, 224, 25, 71, 
-    42, 2, 232, 108, 43, 224, 25, 71, 42, 2, 232, 108, 44, 224, 25, 71, 42, 
-    2, 214, 160, 44, 224, 25, 71, 250, 36, 2, 214, 160, 43, 224, 25, 71, 250, 
-    36, 2, 232, 108, 43, 224, 25, 71, 250, 36, 2, 232, 108, 44, 224, 25, 71, 
-    250, 36, 2, 214, 160, 44, 224, 25, 214, 160, 43, 215, 225, 214, 160, 44, 
-    215, 225, 232, 108, 43, 215, 225, 71, 231, 82, 218, 234, 85, 231, 82, 
-    218, 234, 71, 231, 82, 4, 218, 234, 85, 231, 82, 4, 218, 234, 232, 108, 
-    44, 215, 225, 85, 218, 38, 2, 223, 132, 249, 247, 214, 194, 219, 60, 249, 
-    222, 85, 218, 156, 71, 218, 156, 232, 228, 216, 132, 218, 37, 253, 234, 
-    228, 71, 248, 38, 228, 71, 249, 195, 226, 163, 85, 217, 0, 71, 217, 0, 
-    252, 156, 251, 163, 252, 156, 93, 2, 250, 129, 252, 156, 93, 2, 211, 178, 
-    221, 254, 214, 195, 2, 223, 160, 246, 84, 240, 243, 252, 22, 71, 220, 2, 
-    225, 101, 85, 220, 2, 225, 101, 220, 87, 223, 49, 222, 187, 244, 55, 241, 
-    228, 251, 113, 85, 43, 225, 7, 235, 242, 85, 44, 225, 7, 235, 242, 71, 
-    43, 225, 7, 235, 242, 71, 120, 225, 7, 235, 242, 71, 44, 225, 7, 235, 
-    242, 71, 124, 225, 7, 235, 242, 219, 101, 22, 249, 129, 250, 219, 50, 
-    223, 172, 50, 251, 239, 50, 251, 25, 254, 102, 226, 145, 249, 130, 250, 
-    111, 223, 37, 249, 131, 64, 232, 118, 249, 131, 64, 235, 116, 218, 157, 
-    22, 249, 136, 244, 168, 87, 254, 248, 220, 89, 242, 22, 22, 219, 189, 
-    225, 220, 87, 210, 254, 211, 69, 215, 215, 31, 241, 223, 215, 215, 31, 
-    233, 107, 215, 215, 31, 244, 96, 215, 215, 31, 216, 133, 215, 215, 31, 
-    211, 239, 215, 215, 31, 212, 40, 215, 215, 31, 230, 115, 215, 215, 31, 
-    245, 223, 212, 1, 64, 248, 18, 71, 243, 239, 244, 190, 71, 219, 74, 244, 
-    190, 85, 219, 74, 244, 190, 71, 218, 38, 2, 223, 132, 244, 92, 224, 22, 
-    230, 128, 233, 80, 224, 22, 230, 128, 231, 54, 244, 138, 50, 245, 223, 
-    231, 190, 50, 235, 38, 221, 220, 214, 145, 229, 93, 225, 20, 254, 12, 
-    217, 40, 243, 52, 251, 3, 233, 19, 213, 150, 232, 238, 221, 191, 222, 19, 
-    250, 248, 254, 42, 225, 52, 71, 250, 117, 234, 78, 71, 250, 117, 224, 14, 
-    71, 250, 117, 222, 195, 71, 250, 117, 251, 231, 71, 250, 117, 234, 30, 
-    71, 250, 117, 225, 231, 85, 250, 117, 234, 78, 85, 250, 117, 224, 14, 85, 
-    250, 117, 222, 195, 85, 250, 117, 251, 231, 85, 250, 117, 234, 30, 85, 
-    250, 117, 225, 231, 85, 219, 16, 218, 50, 71, 241, 228, 218, 50, 71, 247, 
-    249, 218, 50, 85, 249, 245, 218, 50, 71, 219, 16, 218, 50, 85, 241, 228, 
-    218, 50, 85, 247, 249, 218, 50, 71, 249, 245, 218, 50, 240, 243, 218, 
-    238, 224, 22, 228, 47, 245, 189, 228, 47, 252, 73, 245, 189, 228, 42, 
-    252, 73, 219, 118, 228, 42, 230, 57, 244, 66, 50, 230, 57, 229, 188, 50, 
-    230, 57, 220, 76, 50, 212, 9, 188, 249, 130, 245, 220, 188, 249, 130, 
-    214, 171, 223, 112, 87, 223, 112, 16, 31, 215, 48, 225, 34, 223, 112, 16, 
-    31, 215, 47, 225, 34, 223, 112, 16, 31, 215, 46, 225, 34, 223, 112, 16, 
-    31, 215, 45, 225, 34, 223, 112, 16, 31, 215, 44, 225, 34, 223, 112, 16, 
-    31, 215, 43, 225, 34, 223, 112, 16, 31, 215, 42, 225, 34, 223, 112, 16, 
-    31, 243, 50, 231, 138, 85, 214, 171, 223, 112, 87, 223, 113, 226, 20, 87, 
-    225, 252, 226, 20, 87, 225, 174, 226, 20, 50, 211, 255, 87, 247, 241, 
-    244, 189, 247, 241, 244, 188, 247, 241, 244, 187, 247, 241, 244, 186, 
-    247, 241, 244, 185, 247, 241, 244, 184, 71, 250, 36, 2, 59, 222, 251, 71, 
-    250, 36, 2, 113, 247, 118, 85, 250, 36, 2, 71, 59, 222, 251, 85, 250, 36, 
-    2, 113, 71, 247, 118, 230, 142, 31, 211, 69, 230, 142, 31, 210, 253, 247, 
-    224, 31, 242, 131, 211, 69, 247, 224, 31, 233, 13, 210, 253, 247, 224, 
-    31, 233, 13, 211, 69, 247, 224, 31, 242, 131, 210, 253, 71, 244, 73, 85, 
-    244, 73, 242, 22, 22, 225, 104, 254, 120, 249, 128, 217, 235, 218, 164, 
-    64, 254, 226, 221, 206, 254, 169, 244, 51, 243, 60, 218, 164, 64, 241, 
-    202, 253, 199, 87, 244, 62, 226, 126, 71, 218, 156, 134, 232, 208, 249, 
-    175, 222, 251, 134, 232, 208, 249, 175, 233, 46, 212, 50, 50, 125, 213, 
-    130, 50, 246, 110, 244, 138, 50, 246, 110, 231, 190, 50, 235, 203, 244, 
-    138, 22, 231, 190, 50, 231, 190, 22, 244, 138, 50, 231, 190, 2, 218, 103, 
-    50, 231, 190, 2, 218, 103, 22, 231, 190, 22, 244, 138, 50, 67, 231, 190, 
-    2, 218, 103, 50, 203, 231, 190, 2, 218, 103, 50, 231, 82, 71, 250, 35, 
-    231, 82, 85, 250, 35, 231, 82, 4, 71, 250, 35, 231, 153, 87, 247, 167, 
-    87, 214, 169, 225, 251, 87, 249, 231, 243, 224, 214, 141, 229, 88, 250, 
-    161, 226, 61, 235, 44, 213, 185, 250, 93, 85, 230, 129, 232, 225, 220, 
-    112, 220, 147, 224, 5, 220, 130, 219, 55, 252, 159, 252, 126, 92, 234, 
-    138, 71, 246, 93, 231, 185, 71, 246, 93, 234, 78, 85, 246, 93, 231, 185, 
-    85, 246, 93, 234, 78, 219, 61, 211, 230, 219, 64, 218, 38, 252, 51, 249, 
-    247, 223, 159, 85, 219, 60, 216, 134, 249, 248, 22, 223, 159, 215, 94, 
-    71, 220, 2, 225, 101, 215, 94, 85, 220, 2, 225, 101, 71, 247, 249, 236, 
-    0, 218, 234, 249, 125, 233, 91, 247, 193, 250, 244, 226, 166, 225, 104, 
-    250, 245, 219, 88, 241, 212, 2, 71, 249, 130, 37, 249, 125, 233, 91, 250, 
-    153, 228, 75, 245, 124, 254, 141, 226, 191, 43, 212, 26, 215, 251, 85, 
-    215, 55, 43, 212, 26, 215, 251, 71, 215, 55, 43, 212, 26, 215, 251, 85, 
-    43, 233, 92, 231, 53, 71, 43, 233, 92, 231, 53, 246, 89, 219, 82, 50, 
-    114, 71, 246, 105, 215, 225, 43, 250, 0, 245, 124, 92, 221, 254, 244, 
-    175, 247, 255, 236, 0, 71, 250, 36, 236, 0, 85, 218, 234, 85, 215, 192, 
-    223, 60, 43, 245, 123, 223, 60, 43, 245, 122, 253, 211, 16, 31, 214, 145, 
-    114, 250, 36, 2, 218, 103, 22, 113, 170, 48, 225, 189, 222, 248, 235, 
-    205, 225, 189, 233, 43, 235, 205, 225, 189, 235, 193, 225, 189, 85, 249, 
-    131, 226, 197, 220, 29, 220, 17, 219, 229, 250, 61, 250, 226, 241, 157, 
-    219, 126, 243, 61, 211, 230, 240, 220, 243, 61, 2, 242, 12, 231, 173, 16, 
-    31, 232, 229, 230, 115, 214, 195, 226, 197, 242, 122, 244, 12, 244, 74, 
-    236, 0, 241, 59, 244, 129, 222, 14, 42, 244, 11, 249, 159, 219, 104, 240, 
-    112, 219, 107, 225, 168, 2, 252, 159, 216, 242, 235, 131, 252, 146, 87, 
-    241, 231, 242, 133, 87, 243, 232, 224, 142, 249, 103, 226, 197, 85, 218, 
-    234, 71, 244, 74, 2, 203, 230, 224, 85, 218, 104, 214, 160, 251, 217, 
-    221, 193, 85, 221, 193, 232, 108, 251, 217, 221, 193, 71, 221, 193, 71, 
-    114, 250, 130, 78, 217, 1, 232, 154, 50, 217, 53, 246, 88, 254, 191, 245, 
-    119, 223, 157, 244, 85, 223, 157, 242, 15, 213, 174, 242, 15, 211, 198, 
-    242, 15, 232, 108, 44, 225, 198, 225, 198, 214, 160, 44, 225, 198, 71, 
-    228, 230, 85, 228, 230, 250, 130, 78, 114, 250, 130, 78, 230, 84, 211, 
-    178, 114, 230, 84, 211, 178, 252, 156, 211, 178, 114, 252, 156, 211, 178, 
-    226, 126, 26, 249, 130, 114, 26, 249, 130, 204, 250, 175, 249, 130, 114, 
-    204, 250, 175, 249, 130, 7, 249, 130, 220, 91, 71, 7, 249, 130, 226, 126, 
-    7, 249, 130, 231, 187, 249, 130, 218, 157, 64, 248, 149, 244, 11, 217, 
-    15, 253, 216, 244, 11, 252, 157, 253, 216, 114, 244, 11, 252, 157, 253, 
-    216, 244, 11, 249, 243, 253, 216, 85, 244, 11, 225, 9, 218, 156, 71, 244, 
-    11, 225, 9, 218, 156, 219, 11, 218, 111, 226, 126, 71, 218, 156, 37, 71, 
-    218, 156, 204, 250, 175, 85, 218, 156, 85, 250, 175, 71, 218, 156, 226, 
-    126, 85, 218, 156, 114, 226, 126, 85, 218, 156, 225, 60, 218, 156, 220, 
-    91, 71, 218, 156, 114, 253, 216, 204, 250, 175, 253, 216, 245, 193, 218, 
-    244, 253, 216, 245, 193, 225, 9, 85, 218, 156, 245, 193, 225, 9, 225, 60, 
-    218, 156, 219, 125, 225, 9, 85, 218, 156, 245, 193, 225, 9, 223, 114, 85, 
-    218, 156, 114, 245, 193, 225, 9, 223, 114, 85, 218, 156, 215, 77, 225, 9, 
-    85, 218, 156, 219, 120, 225, 9, 253, 216, 217, 15, 253, 216, 204, 250, 
-    175, 217, 15, 253, 216, 114, 217, 15, 253, 216, 219, 125, 225, 157, 85, 
-    22, 71, 244, 54, 85, 244, 54, 71, 244, 54, 245, 193, 225, 157, 226, 126, 
-    85, 244, 54, 37, 204, 250, 175, 245, 193, 225, 9, 218, 156, 114, 217, 15, 
-    225, 60, 253, 216, 219, 62, 216, 105, 215, 218, 219, 62, 114, 250, 114, 
-    219, 62, 219, 13, 114, 219, 13, 252, 157, 253, 216, 245, 193, 217, 15, 
-    224, 171, 253, 216, 114, 245, 193, 217, 15, 224, 171, 253, 216, 249, 131, 
-    78, 220, 91, 71, 250, 35, 152, 92, 249, 131, 78, 232, 108, 44, 246, 86, 
-    71, 218, 234, 214, 160, 44, 246, 86, 71, 218, 234, 232, 108, 44, 220, 91, 
-    71, 218, 234, 214, 160, 44, 220, 91, 71, 218, 234, 85, 224, 13, 164, 226, 
-    147, 71, 224, 13, 164, 226, 147, 71, 245, 31, 164, 226, 147, 85, 247, 
-    249, 230, 182, 71, 211, 178, 114, 245, 31, 164, 87, 192, 67, 130, 231, 
-    82, 67, 130, 114, 67, 130, 114, 219, 155, 215, 94, 249, 220, 223, 254, 
-    164, 226, 147, 114, 219, 155, 249, 220, 223, 254, 164, 226, 147, 114, 52, 
-    215, 94, 249, 220, 223, 254, 164, 226, 147, 114, 52, 249, 220, 223, 254, 
-    164, 226, 147, 114, 121, 219, 155, 249, 220, 223, 254, 164, 226, 147, 
-    114, 121, 52, 249, 220, 223, 254, 164, 226, 147, 249, 91, 218, 140, 226, 
-    15, 5, 226, 147, 114, 245, 31, 164, 226, 147, 114, 241, 228, 245, 31, 
-    164, 226, 147, 114, 85, 241, 227, 222, 187, 114, 85, 241, 228, 251, 113, 
-    244, 55, 241, 227, 222, 187, 244, 55, 241, 228, 251, 113, 231, 82, 43, 
-    226, 4, 226, 147, 231, 82, 44, 226, 4, 226, 147, 231, 82, 244, 63, 43, 
-    226, 4, 226, 147, 231, 82, 244, 63, 44, 226, 4, 226, 147, 231, 82, 233, 
-    42, 254, 110, 251, 158, 226, 147, 231, 82, 222, 247, 254, 110, 251, 158, 
-    226, 147, 114, 233, 42, 254, 110, 223, 254, 164, 226, 147, 114, 222, 247, 
-    254, 110, 223, 254, 164, 226, 147, 114, 233, 42, 254, 110, 251, 158, 226, 
-    147, 114, 222, 247, 254, 110, 251, 158, 226, 147, 192, 43, 216, 6, 220, 
-    53, 251, 158, 226, 147, 192, 44, 216, 6, 220, 53, 251, 158, 226, 147, 
-    231, 82, 43, 249, 99, 251, 158, 226, 147, 231, 82, 44, 249, 99, 251, 158, 
-    226, 147, 247, 204, 152, 37, 21, 110, 247, 204, 152, 37, 21, 105, 247, 
-    204, 152, 37, 21, 158, 247, 204, 152, 37, 21, 161, 247, 204, 152, 37, 21, 
-    189, 247, 204, 152, 37, 21, 194, 247, 204, 152, 37, 21, 198, 247, 204, 
-    152, 37, 21, 195, 247, 204, 152, 37, 21, 200, 247, 204, 152, 37, 54, 216, 
-    247, 247, 204, 37, 35, 21, 110, 247, 204, 37, 35, 21, 105, 247, 204, 37, 
-    35, 21, 158, 247, 204, 37, 35, 21, 161, 247, 204, 37, 35, 21, 189, 247, 
-    204, 37, 35, 21, 194, 247, 204, 37, 35, 21, 198, 247, 204, 37, 35, 21, 
-    195, 247, 204, 37, 35, 21, 200, 247, 204, 37, 35, 54, 216, 247, 247, 204, 
-    152, 37, 35, 21, 110, 247, 204, 152, 37, 35, 21, 105, 247, 204, 152, 37, 
-    35, 21, 158, 247, 204, 152, 37, 35, 21, 161, 247, 204, 152, 37, 35, 21, 
-    189, 247, 204, 152, 37, 35, 21, 194, 247, 204, 152, 37, 35, 21, 198, 247, 
-    204, 152, 37, 35, 21, 195, 247, 204, 152, 37, 35, 21, 200, 247, 204, 152, 
-    37, 35, 54, 216, 247, 114, 211, 246, 97, 74, 114, 96, 50, 114, 230, 182, 
-    50, 114, 247, 169, 50, 114, 219, 28, 245, 220, 74, 114, 97, 74, 114, 228, 
-    56, 245, 220, 74, 246, 98, 225, 11, 97, 74, 114, 222, 184, 97, 74, 215, 
-    224, 97, 74, 114, 215, 224, 97, 74, 248, 155, 215, 224, 97, 74, 114, 248, 
-    155, 215, 224, 97, 74, 85, 97, 74, 216, 144, 216, 12, 97, 253, 249, 216, 
-    144, 251, 173, 97, 253, 249, 85, 97, 253, 249, 114, 85, 249, 91, 246, 
-    104, 22, 97, 74, 114, 85, 249, 91, 214, 153, 22, 97, 74, 218, 231, 85, 
-    97, 74, 114, 249, 206, 85, 97, 74, 222, 246, 71, 97, 74, 233, 41, 71, 97, 
-    74, 252, 183, 220, 91, 71, 97, 74, 243, 241, 220, 91, 71, 97, 74, 114, 
-    232, 108, 222, 245, 71, 97, 74, 114, 214, 160, 222, 245, 71, 97, 74, 228, 
-    49, 232, 108, 222, 245, 71, 97, 74, 249, 99, 232, 123, 228, 49, 214, 160, 
-    222, 245, 71, 97, 74, 37, 114, 71, 97, 74, 211, 252, 97, 74, 251, 220, 
-    219, 28, 245, 220, 74, 251, 220, 97, 74, 251, 220, 228, 56, 245, 220, 74, 
-    114, 251, 220, 219, 28, 245, 220, 74, 114, 251, 220, 97, 74, 114, 251, 
-    220, 228, 56, 245, 220, 74, 217, 17, 97, 74, 114, 217, 16, 97, 74, 212, 
-    18, 97, 74, 114, 212, 18, 97, 74, 226, 172, 97, 74, 52, 249, 99, 232, 
-    123, 134, 247, 214, 254, 109, 71, 215, 226, 249, 187, 4, 71, 215, 225, 
-    225, 171, 204, 218, 63, 204, 218, 21, 43, 222, 90, 252, 173, 248, 60, 44, 
-    222, 90, 252, 173, 248, 60, 177, 2, 59, 235, 215, 223, 50, 219, 47, 224, 
-    201, 218, 63, 218, 22, 224, 201, 219, 46, 67, 252, 141, 2, 203, 91, 11, 
-    222, 228, 247, 254, 199, 247, 168, 11, 244, 175, 247, 254, 92, 232, 146, 
-    254, 118, 92, 232, 146, 226, 158, 71, 247, 249, 2, 250, 173, 247, 120, 
-    22, 2, 247, 120, 245, 170, 64, 226, 170, 214, 152, 232, 108, 44, 249, 
-    161, 2, 247, 120, 214, 160, 43, 249, 161, 2, 247, 120, 43, 226, 128, 235, 
-    66, 44, 226, 128, 235, 66, 243, 229, 226, 128, 235, 66, 233, 85, 120, 
-    217, 87, 233, 85, 124, 217, 87, 43, 22, 44, 52, 215, 93, 43, 22, 44, 217, 
-    87, 43, 230, 87, 199, 44, 217, 87, 199, 43, 217, 87, 120, 217, 88, 2, 
-    250, 36, 48, 232, 105, 247, 173, 251, 78, 203, 222, 133, 71, 249, 205, 
-    247, 248, 71, 249, 205, 247, 249, 2, 140, 216, 114, 71, 249, 205, 247, 
-    249, 2, 97, 216, 114, 71, 42, 2, 140, 216, 114, 71, 42, 2, 97, 216, 114, 
-    11, 43, 71, 42, 127, 11, 44, 71, 42, 127, 11, 43, 254, 110, 127, 11, 44, 
-    254, 110, 127, 11, 43, 52, 254, 110, 127, 11, 44, 52, 254, 110, 127, 11, 
-    43, 71, 216, 6, 220, 53, 127, 11, 44, 71, 216, 6, 220, 53, 127, 11, 43, 
-    244, 63, 226, 3, 11, 44, 244, 63, 226, 3, 214, 153, 224, 24, 74, 246, 
-    104, 224, 24, 74, 254, 88, 243, 98, 250, 36, 74, 250, 2, 243, 98, 250, 
-    36, 74, 44, 80, 2, 37, 225, 22, 199, 140, 74, 199, 97, 74, 199, 43, 44, 
-    74, 199, 140, 52, 74, 199, 97, 52, 74, 199, 43, 44, 52, 74, 199, 140, 80, 
-    243, 243, 130, 199, 97, 80, 243, 243, 130, 199, 140, 52, 80, 243, 243, 
-    130, 199, 97, 52, 80, 243, 243, 130, 199, 97, 218, 230, 74, 46, 47, 251, 
-    215, 46, 47, 247, 117, 46, 47, 246, 245, 46, 47, 247, 116, 46, 47, 246, 
-    181, 46, 47, 247, 52, 46, 47, 246, 244, 46, 47, 247, 115, 46, 47, 246, 
-    149, 46, 47, 247, 20, 46, 47, 246, 212, 46, 47, 247, 83, 46, 47, 246, 
-    180, 46, 47, 247, 51, 46, 47, 246, 243, 46, 47, 247, 114, 46, 47, 246, 
-    133, 46, 47, 247, 4, 46, 47, 246, 196, 46, 47, 247, 67, 46, 47, 246, 164, 
-    46, 47, 247, 35, 46, 47, 246, 227, 46, 47, 247, 98, 46, 47, 246, 148, 46, 
-    47, 247, 19, 46, 47, 246, 211, 46, 47, 247, 82, 46, 47, 246, 179, 46, 47, 
-    247, 50, 46, 47, 246, 242, 46, 47, 247, 113, 46, 47, 246, 125, 46, 47, 
-    246, 252, 46, 47, 246, 188, 46, 47, 247, 59, 46, 47, 246, 156, 46, 47, 
-    247, 27, 46, 47, 246, 219, 46, 47, 247, 90, 46, 47, 246, 140, 46, 47, 
-    247, 11, 46, 47, 246, 203, 46, 47, 247, 74, 46, 47, 246, 171, 46, 47, 
-    247, 42, 46, 47, 246, 234, 46, 47, 247, 105, 46, 47, 246, 132, 46, 47, 
-    247, 3, 46, 47, 246, 195, 46, 47, 247, 66, 46, 47, 246, 163, 46, 47, 247, 
-    34, 46, 47, 246, 226, 46, 47, 247, 97, 46, 47, 246, 147, 46, 47, 247, 18, 
-    46, 47, 246, 210, 46, 47, 247, 81, 46, 47, 246, 178, 46, 47, 247, 49, 46, 
-    47, 246, 241, 46, 47, 247, 112, 46, 47, 246, 121, 46, 47, 246, 248, 46, 
-    47, 246, 184, 46, 47, 247, 55, 46, 47, 246, 152, 46, 47, 247, 23, 46, 47, 
-    246, 215, 46, 47, 247, 86, 46, 47, 246, 136, 46, 47, 247, 7, 46, 47, 246, 
-    199, 46, 47, 247, 70, 46, 47, 246, 167, 46, 47, 247, 38, 46, 47, 246, 
-    230, 46, 47, 247, 101, 46, 47, 246, 128, 46, 47, 246, 255, 46, 47, 246, 
-    191, 46, 47, 247, 62, 46, 47, 246, 159, 46, 47, 247, 30, 46, 47, 246, 
-    222, 46, 47, 247, 93, 46, 47, 246, 143, 46, 47, 247, 14, 46, 47, 246, 
-    206, 46, 47, 247, 77, 46, 47, 246, 174, 46, 47, 247, 45, 46, 47, 246, 
-    237, 46, 47, 247, 108, 46, 47, 246, 124, 46, 47, 246, 251, 46, 47, 246, 
-    187, 46, 47, 247, 58, 46, 47, 246, 155, 46, 47, 247, 26, 46, 47, 246, 
-    218, 46, 47, 247, 89, 46, 47, 246, 139, 46, 47, 247, 10, 46, 47, 246, 
-    202, 46, 47, 247, 73, 46, 47, 246, 170, 46, 47, 247, 41, 46, 47, 246, 
-    233, 46, 47, 247, 104, 46, 47, 246, 131, 46, 47, 247, 2, 46, 47, 246, 
-    194, 46, 47, 247, 65, 46, 47, 246, 162, 46, 47, 247, 33, 46, 47, 246, 
-    225, 46, 47, 247, 96, 46, 47, 246, 146, 46, 47, 247, 17, 46, 47, 246, 
-    209, 46, 47, 247, 80, 46, 47, 246, 177, 46, 47, 247, 48, 46, 47, 246, 
-    240, 46, 47, 247, 111, 46, 47, 246, 119, 46, 47, 246, 246, 46, 47, 246, 
-    182, 46, 47, 247, 53, 46, 47, 246, 150, 46, 47, 247, 21, 46, 47, 246, 
-    213, 46, 47, 247, 84, 46, 47, 246, 134, 46, 47, 247, 5, 46, 47, 246, 197, 
-    46, 47, 247, 68, 46, 47, 246, 165, 46, 47, 247, 36, 46, 47, 246, 228, 46, 
-    47, 247, 99, 46, 47, 246, 126, 46, 47, 246, 253, 46, 47, 246, 189, 46, 
-    47, 247, 60, 46, 47, 246, 157, 46, 47, 247, 28, 46, 47, 246, 220, 46, 47, 
-    247, 91, 46, 47, 246, 141, 46, 47, 247, 12, 46, 47, 246, 204, 46, 47, 
-    247, 75, 46, 47, 246, 172, 46, 47, 247, 43, 46, 47, 246, 235, 46, 47, 
-    247, 106, 46, 47, 246, 122, 46, 47, 246, 249, 46, 47, 246, 185, 46, 47, 
-    247, 56, 46, 47, 246, 153, 46, 47, 247, 24, 46, 47, 246, 216, 46, 47, 
-    247, 87, 46, 47, 246, 137, 46, 47, 247, 8, 46, 47, 246, 200, 46, 47, 247, 
-    71, 46, 47, 246, 168, 46, 47, 247, 39, 46, 47, 246, 231, 46, 47, 247, 
-    102, 46, 47, 246, 129, 46, 47, 247, 0, 46, 47, 246, 192, 46, 47, 247, 63, 
-    46, 47, 246, 160, 46, 47, 247, 31, 46, 47, 246, 223, 46, 47, 247, 94, 46, 
-    47, 246, 144, 46, 47, 247, 15, 46, 47, 246, 207, 46, 47, 247, 78, 46, 47, 
-    246, 175, 46, 47, 247, 46, 46, 47, 246, 238, 46, 47, 247, 109, 46, 47, 
-    246, 120, 46, 47, 246, 247, 46, 47, 246, 183, 46, 47, 247, 54, 46, 47, 
-    246, 151, 46, 47, 247, 22, 46, 47, 246, 214, 46, 47, 247, 85, 46, 47, 
-    246, 135, 46, 47, 247, 6, 46, 47, 246, 198, 46, 47, 247, 69, 46, 47, 246, 
-    166, 46, 47, 247, 37, 46, 47, 246, 229, 46, 47, 247, 100, 46, 47, 246, 
-    127, 46, 47, 246, 254, 46, 47, 246, 190, 46, 47, 247, 61, 46, 47, 246, 
-    158, 46, 47, 247, 29, 46, 47, 246, 221, 46, 47, 247, 92, 46, 47, 246, 
-    142, 46, 47, 247, 13, 46, 47, 246, 205, 46, 47, 247, 76, 46, 47, 246, 
-    173, 46, 47, 247, 44, 46, 47, 246, 236, 46, 47, 247, 107, 46, 47, 246, 
-    123, 46, 47, 246, 250, 46, 47, 246, 186, 46, 47, 247, 57, 46, 47, 246, 
-    154, 46, 47, 247, 25, 46, 47, 246, 217, 46, 47, 247, 88, 46, 47, 246, 
-    138, 46, 47, 247, 9, 46, 47, 246, 201, 46, 47, 247, 72, 46, 47, 246, 169, 
-    46, 47, 247, 40, 46, 47, 246, 232, 46, 47, 247, 103, 46, 47, 246, 130, 
-    46, 47, 247, 1, 46, 47, 246, 193, 46, 47, 247, 64, 46, 47, 246, 161, 46, 
-    47, 247, 32, 46, 47, 246, 224, 46, 47, 247, 95, 46, 47, 246, 145, 46, 47, 
-    247, 16, 46, 47, 246, 208, 46, 47, 247, 79, 46, 47, 246, 176, 46, 47, 
-    247, 47, 46, 47, 246, 239, 46, 47, 247, 110, 97, 215, 58, 80, 2, 67, 91, 
-    97, 215, 58, 80, 2, 52, 67, 91, 140, 52, 80, 2, 67, 91, 97, 52, 80, 2, 
-    67, 91, 43, 44, 52, 80, 2, 67, 91, 97, 215, 58, 80, 243, 243, 130, 140, 
-    52, 80, 243, 243, 130, 97, 52, 80, 243, 243, 130, 246, 104, 80, 2, 203, 
-    91, 214, 153, 80, 2, 203, 91, 214, 153, 215, 211, 74, 246, 104, 215, 211, 
-    74, 140, 52, 248, 157, 74, 97, 52, 248, 157, 74, 140, 215, 211, 248, 157, 
-    74, 97, 215, 211, 248, 157, 74, 97, 215, 58, 215, 211, 248, 157, 74, 97, 
-    80, 2, 246, 118, 218, 139, 214, 153, 80, 216, 42, 130, 246, 104, 80, 216, 
-    42, 130, 97, 80, 2, 217, 78, 2, 67, 91, 97, 80, 2, 217, 78, 2, 52, 67, 
-    91, 97, 215, 58, 80, 2, 217, 77, 97, 215, 58, 80, 2, 217, 78, 2, 67, 91, 
-    97, 215, 58, 80, 2, 217, 78, 2, 52, 67, 91, 140, 253, 251, 97, 253, 251, 
-    140, 52, 253, 251, 97, 52, 253, 251, 140, 80, 216, 42, 85, 247, 248, 97, 
-    80, 216, 42, 85, 247, 248, 140, 80, 243, 243, 252, 141, 216, 42, 85, 247, 
-    248, 97, 80, 243, 243, 252, 141, 216, 42, 85, 247, 248, 228, 56, 212, 9, 
-    22, 219, 28, 245, 220, 74, 228, 56, 245, 220, 22, 219, 28, 212, 9, 74, 
-    228, 56, 212, 9, 80, 2, 103, 228, 56, 245, 220, 80, 2, 103, 219, 28, 245, 
-    220, 80, 2, 103, 219, 28, 212, 9, 80, 2, 103, 228, 56, 212, 9, 80, 22, 
-    228, 56, 245, 220, 74, 228, 56, 245, 220, 80, 22, 219, 28, 245, 220, 74, 
-    219, 28, 245, 220, 80, 22, 219, 28, 212, 9, 74, 219, 28, 212, 9, 80, 22, 
-    228, 56, 212, 9, 74, 222, 228, 247, 255, 249, 125, 244, 175, 247, 254, 
-    244, 175, 247, 255, 249, 125, 222, 228, 247, 254, 219, 28, 245, 220, 80, 
-    249, 125, 228, 56, 245, 220, 74, 228, 56, 245, 220, 80, 249, 125, 219, 
-    28, 245, 220, 74, 244, 175, 247, 255, 249, 125, 228, 56, 245, 220, 74, 
-    222, 228, 247, 255, 249, 125, 219, 28, 245, 220, 74, 228, 56, 245, 220, 
-    80, 249, 125, 228, 56, 212, 9, 74, 228, 56, 212, 9, 80, 249, 125, 228, 
-    56, 245, 220, 74, 212, 36, 80, 225, 7, 247, 195, 222, 251, 80, 225, 7, 
-    97, 216, 188, 249, 90, 214, 152, 80, 225, 7, 97, 216, 188, 249, 90, 246, 
-    103, 80, 225, 7, 246, 104, 216, 188, 249, 90, 233, 37, 80, 225, 7, 246, 
-    104, 216, 188, 249, 90, 222, 241, 222, 244, 254, 26, 250, 2, 74, 233, 40, 
-    254, 26, 254, 88, 74, 216, 14, 254, 26, 254, 88, 74, 251, 175, 254, 26, 
-    254, 88, 74, 216, 14, 254, 26, 250, 2, 80, 2, 230, 181, 216, 14, 254, 26, 
-    254, 88, 80, 2, 225, 22, 232, 108, 44, 220, 152, 250, 2, 74, 232, 108, 
-    43, 220, 152, 254, 88, 74, 254, 88, 250, 0, 250, 36, 74, 250, 2, 250, 0, 
-    250, 36, 74, 97, 80, 77, 219, 251, 140, 74, 140, 80, 77, 219, 251, 97, 
-    74, 219, 251, 97, 80, 77, 140, 74, 97, 80, 2, 96, 51, 140, 80, 2, 96, 51, 
-    97, 80, 216, 139, 211, 178, 43, 44, 80, 216, 139, 4, 250, 35, 214, 153, 
-    215, 58, 80, 243, 243, 4, 250, 35, 43, 252, 139, 120, 44, 252, 139, 124, 
-    241, 254, 43, 252, 139, 124, 44, 252, 139, 120, 241, 254, 120, 252, 139, 
-    44, 124, 252, 139, 43, 241, 254, 120, 252, 139, 43, 124, 252, 139, 44, 
-    241, 254, 43, 252, 139, 120, 44, 252, 139, 120, 241, 254, 120, 252, 139, 
-    44, 124, 252, 139, 44, 241, 254, 43, 252, 139, 124, 44, 252, 139, 124, 
-    241, 254, 120, 252, 139, 43, 124, 252, 139, 43, 241, 254, 140, 241, 255, 
-    2, 252, 139, 120, 216, 42, 130, 97, 241, 255, 2, 252, 139, 120, 216, 42, 
-    130, 214, 153, 241, 255, 2, 252, 139, 44, 216, 42, 130, 246, 104, 241, 
-    255, 2, 252, 139, 44, 216, 42, 130, 140, 241, 255, 2, 252, 139, 124, 216, 
-    42, 130, 97, 241, 255, 2, 252, 139, 124, 216, 42, 130, 214, 153, 241, 
-    255, 2, 252, 139, 43, 216, 42, 130, 246, 104, 241, 255, 2, 252, 139, 43, 
-    216, 42, 130, 140, 241, 255, 2, 252, 139, 120, 243, 243, 130, 97, 241, 
-    255, 2, 252, 139, 120, 243, 243, 130, 214, 153, 241, 255, 2, 252, 139, 
-    44, 243, 243, 130, 246, 104, 241, 255, 2, 252, 139, 44, 243, 243, 130, 
-    140, 241, 255, 2, 252, 139, 124, 243, 243, 130, 97, 241, 255, 2, 252, 
-    139, 124, 243, 243, 130, 214, 153, 241, 255, 2, 252, 139, 43, 243, 243, 
-    130, 246, 104, 241, 255, 2, 252, 139, 43, 243, 243, 130, 140, 241, 255, 
-    2, 252, 139, 120, 77, 140, 241, 255, 2, 252, 139, 246, 106, 214, 153, 
-    241, 255, 2, 252, 139, 43, 252, 30, 214, 153, 241, 255, 2, 252, 139, 222, 
-    251, 97, 241, 255, 2, 252, 139, 120, 77, 97, 241, 255, 2, 252, 139, 246, 
-    106, 246, 104, 241, 255, 2, 252, 139, 43, 252, 30, 246, 104, 241, 255, 2, 
-    252, 139, 222, 251, 140, 241, 255, 2, 252, 139, 120, 77, 97, 241, 255, 2, 
-    252, 139, 214, 163, 140, 241, 255, 2, 252, 139, 124, 77, 97, 241, 255, 2, 
-    252, 139, 246, 106, 97, 241, 255, 2, 252, 139, 120, 77, 140, 241, 255, 2, 
-    252, 139, 214, 163, 97, 241, 255, 2, 252, 139, 124, 77, 140, 241, 255, 2, 
-    252, 139, 246, 106, 140, 241, 255, 2, 252, 139, 120, 77, 199, 248, 156, 
-    140, 241, 255, 2, 252, 139, 124, 252, 43, 199, 248, 156, 97, 241, 255, 2, 
-    252, 139, 120, 77, 199, 248, 156, 97, 241, 255, 2, 252, 139, 124, 252, 
-    43, 199, 248, 156, 214, 153, 241, 255, 2, 252, 139, 43, 252, 30, 246, 
-    104, 241, 255, 2, 252, 139, 222, 251, 246, 104, 241, 255, 2, 252, 139, 
-    43, 252, 30, 214, 153, 241, 255, 2, 252, 139, 222, 251, 44, 52, 80, 2, 
-    222, 183, 241, 235, 245, 98, 5, 77, 97, 74, 216, 89, 226, 168, 77, 97, 
-    74, 140, 80, 77, 216, 89, 226, 167, 97, 80, 77, 216, 89, 226, 167, 97, 
-    80, 77, 254, 148, 128, 111, 233, 15, 77, 140, 74, 140, 80, 216, 139, 233, 
-    14, 242, 130, 77, 97, 74, 218, 64, 77, 97, 74, 140, 80, 216, 139, 218, 
-    63, 218, 22, 77, 140, 74, 43, 244, 91, 217, 77, 44, 244, 91, 217, 77, 
-    120, 244, 91, 217, 77, 124, 244, 91, 217, 77, 215, 211, 67, 252, 141, 
-    248, 60, 210, 160, 187, 218, 242, 210, 160, 187, 215, 49, 249, 226, 43, 
-    71, 249, 99, 127, 44, 71, 249, 99, 127, 43, 71, 226, 3, 44, 71, 226, 3, 
-    210, 160, 187, 43, 236, 15, 127, 210, 160, 187, 44, 236, 15, 127, 210, 
-    160, 187, 43, 251, 242, 127, 210, 160, 187, 44, 251, 242, 127, 43, 42, 
-    251, 158, 2, 214, 183, 44, 42, 251, 158, 2, 214, 183, 43, 42, 251, 158, 
-    2, 216, 115, 236, 0, 216, 14, 249, 160, 44, 42, 251, 158, 2, 216, 115, 
-    236, 0, 251, 175, 249, 160, 43, 42, 251, 158, 2, 216, 115, 236, 0, 251, 
-    175, 249, 160, 44, 42, 251, 158, 2, 216, 115, 236, 0, 216, 14, 249, 160, 
-    43, 254, 110, 251, 158, 2, 247, 120, 44, 254, 110, 251, 158, 2, 247, 120, 
-    43, 254, 26, 233, 15, 127, 44, 254, 26, 242, 130, 127, 52, 43, 254, 26, 
-    242, 130, 127, 52, 44, 254, 26, 233, 15, 127, 43, 85, 216, 6, 220, 53, 
-    127, 44, 85, 216, 6, 220, 53, 127, 246, 118, 244, 135, 67, 210, 35, 232, 
-    213, 231, 88, 254, 110, 226, 170, 233, 46, 44, 254, 110, 214, 12, 2, 218, 
-    234, 231, 88, 44, 254, 110, 2, 247, 120, 254, 110, 2, 222, 92, 235, 215, 
-    255, 3, 254, 109, 218, 255, 254, 110, 226, 170, 233, 46, 218, 255, 254, 
-    110, 226, 170, 214, 163, 215, 94, 254, 109, 223, 49, 254, 109, 254, 110, 
-    2, 214, 183, 223, 49, 254, 110, 2, 214, 183, 226, 248, 254, 110, 226, 
-    170, 214, 163, 226, 248, 254, 110, 226, 170, 246, 106, 231, 88, 254, 110, 
-    2, 204, 254, 5, 245, 140, 236, 0, 80, 225, 7, 120, 22, 222, 251, 231, 88, 
-    254, 110, 2, 204, 254, 5, 245, 140, 236, 0, 80, 225, 7, 120, 22, 233, 46, 
-    231, 88, 254, 110, 2, 204, 254, 5, 245, 140, 236, 0, 80, 225, 7, 124, 22, 
-    222, 251, 231, 88, 254, 110, 2, 204, 254, 5, 245, 140, 236, 0, 80, 225, 
-    7, 124, 22, 233, 46, 231, 88, 254, 110, 2, 204, 254, 5, 245, 140, 236, 0, 
-    80, 225, 7, 44, 22, 214, 163, 231, 88, 254, 110, 2, 204, 254, 5, 245, 
-    140, 236, 0, 80, 225, 7, 43, 22, 214, 163, 231, 88, 254, 110, 2, 204, 
-    254, 5, 245, 140, 236, 0, 80, 225, 7, 44, 22, 246, 106, 231, 88, 254, 
-    110, 2, 204, 254, 5, 245, 140, 236, 0, 80, 225, 7, 43, 22, 246, 106, 223, 
-    49, 245, 152, 220, 127, 245, 152, 220, 128, 2, 226, 123, 245, 152, 220, 
-    128, 2, 4, 250, 36, 48, 245, 152, 220, 128, 2, 44, 80, 48, 245, 152, 220, 
-    128, 2, 43, 80, 48, 250, 36, 2, 203, 130, 37, 67, 130, 37, 226, 7, 37, 
-    223, 50, 219, 46, 37, 225, 171, 250, 36, 247, 173, 251, 78, 203, 252, 
-    141, 22, 216, 14, 163, 247, 173, 251, 78, 67, 130, 250, 36, 2, 218, 24, 
-    211, 178, 37, 254, 87, 247, 169, 50, 120, 80, 216, 139, 250, 35, 37, 71, 
-    251, 113, 37, 251, 113, 37, 233, 14, 37, 242, 129, 250, 36, 2, 4, 250, 
-    36, 216, 42, 216, 196, 222, 251, 250, 36, 2, 113, 203, 218, 91, 216, 42, 
-    216, 196, 222, 251, 92, 222, 228, 247, 255, 219, 95, 92, 244, 175, 247, 
-    255, 219, 95, 92, 253, 216, 92, 4, 250, 35, 92, 218, 234, 113, 235, 65, 
-    218, 232, 215, 226, 2, 59, 48, 215, 226, 2, 214, 183, 222, 92, 236, 0, 
-    215, 225, 215, 226, 2, 220, 134, 253, 207, 251, 174, 44, 215, 226, 77, 
-    43, 215, 225, 43, 215, 226, 252, 30, 67, 130, 67, 252, 141, 252, 30, 44, 
-    215, 225, 251, 165, 2, 43, 163, 251, 221, 251, 165, 2, 44, 163, 251, 221, 
-    85, 251, 164, 30, 2, 43, 163, 251, 221, 30, 2, 44, 163, 251, 221, 71, 
-    240, 236, 85, 240, 236, 43, 211, 244, 244, 135, 44, 211, 244, 244, 135, 
-    43, 52, 211, 244, 244, 135, 44, 52, 211, 244, 244, 135, 235, 248, 235, 
-    234, 216, 112, 117, 235, 234, 235, 235, 229, 102, 2, 67, 130, 246, 112, 
-    230, 87, 42, 2, 249, 181, 226, 127, 235, 246, 253, 237, 219, 219, 224, 
-    180, 245, 98, 5, 22, 219, 97, 226, 7, 245, 98, 5, 22, 219, 97, 226, 8, 2, 
-    216, 89, 48, 240, 104, 216, 42, 22, 219, 97, 226, 7, 242, 183, 218, 155, 
-    216, 185, 246, 105, 215, 226, 2, 43, 163, 251, 221, 246, 105, 215, 226, 
-    2, 44, 163, 251, 221, 85, 247, 249, 2, 124, 74, 85, 232, 104, 71, 250, 
-    36, 2, 124, 74, 85, 250, 36, 2, 124, 74, 245, 85, 71, 218, 234, 245, 85, 
-    85, 218, 234, 245, 85, 71, 247, 248, 245, 85, 85, 247, 248, 245, 85, 71, 
-    250, 35, 245, 85, 85, 250, 35, 222, 132, 223, 50, 219, 47, 226, 167, 219, 
-    47, 2, 226, 123, 223, 50, 219, 47, 2, 203, 91, 251, 249, 219, 46, 251, 
-    249, 223, 50, 219, 46, 52, 225, 22, 215, 211, 225, 22, 233, 42, 249, 91, 
-    254, 110, 127, 222, 247, 249, 91, 254, 110, 127, 216, 78, 230, 179, 230, 
-    24, 37, 59, 226, 167, 230, 24, 37, 96, 226, 167, 230, 24, 37, 30, 226, 
-    167, 230, 24, 214, 176, 226, 168, 2, 247, 120, 230, 24, 214, 176, 226, 
-    168, 2, 225, 22, 230, 24, 42, 235, 199, 226, 167, 230, 24, 42, 214, 176, 
-    226, 167, 113, 232, 146, 22, 226, 167, 113, 232, 146, 177, 226, 167, 230, 
-    24, 30, 226, 167, 230, 154, 113, 218, 43, 218, 41, 2, 235, 211, 224, 24, 
-    235, 212, 226, 167, 244, 99, 225, 255, 235, 211, 235, 212, 2, 52, 91, 
-    235, 212, 253, 173, 2, 219, 95, 250, 32, 243, 226, 254, 88, 235, 209, 
-    232, 214, 235, 210, 2, 223, 115, 225, 237, 254, 2, 225, 1, 232, 214, 235, 
-    210, 2, 220, 152, 225, 237, 254, 2, 225, 1, 232, 214, 235, 210, 228, 52, 
-    235, 250, 216, 196, 225, 1, 235, 212, 254, 2, 115, 225, 11, 226, 167, 
-    224, 18, 235, 212, 226, 167, 235, 212, 2, 140, 80, 2, 103, 235, 212, 2, 
-    30, 50, 235, 212, 2, 235, 198, 235, 212, 2, 214, 175, 235, 212, 2, 226, 
-    123, 235, 212, 2, 214, 183, 235, 66, 233, 85, 43, 215, 226, 226, 167, 
-    210, 160, 187, 221, 201, 249, 209, 210, 160, 187, 221, 201, 225, 56, 210, 
-    160, 187, 221, 201, 224, 176, 96, 5, 2, 4, 250, 36, 48, 96, 5, 2, 250, 
-    31, 255, 15, 48, 96, 5, 2, 216, 89, 48, 96, 5, 2, 59, 51, 96, 5, 2, 216, 
-    89, 51, 96, 5, 2, 218, 65, 105, 96, 5, 2, 85, 215, 225, 230, 182, 5, 2, 
-    249, 220, 48, 230, 182, 5, 2, 59, 51, 230, 182, 5, 2, 244, 175, 247, 118, 
-    230, 182, 5, 2, 222, 228, 247, 118, 96, 5, 236, 0, 43, 163, 250, 35, 96, 
-    5, 236, 0, 44, 163, 250, 35, 213, 254, 177, 249, 131, 224, 180, 230, 84, 
-    5, 2, 59, 48, 230, 84, 5, 2, 214, 183, 220, 149, 224, 181, 2, 251, 175, 
-    249, 255, 219, 77, 224, 180, 230, 84, 5, 236, 0, 43, 163, 250, 35, 230, 
-    84, 5, 236, 0, 44, 163, 250, 35, 37, 230, 84, 5, 2, 250, 31, 255, 14, 
-    230, 84, 5, 236, 0, 52, 250, 35, 37, 247, 169, 50, 96, 5, 236, 0, 215, 
-    225, 230, 182, 5, 236, 0, 215, 225, 230, 84, 5, 236, 0, 215, 225, 235, 
-    206, 224, 180, 222, 242, 235, 206, 224, 180, 210, 160, 187, 223, 90, 249, 
-    209, 254, 134, 177, 249, 165, 235, 199, 2, 247, 120, 214, 176, 2, 230, 
-    182, 50, 214, 176, 2, 226, 123, 235, 199, 2, 226, 123, 235, 199, 2, 232, 
-    146, 254, 118, 214, 176, 2, 232, 146, 226, 158, 214, 176, 77, 235, 198, 
-    235, 199, 77, 214, 175, 214, 176, 77, 252, 141, 77, 235, 198, 235, 199, 
-    77, 252, 141, 77, 214, 175, 214, 176, 252, 30, 22, 235, 65, 2, 214, 175, 
-    235, 199, 252, 30, 22, 235, 65, 2, 235, 198, 250, 0, 214, 176, 2, 220, 
-    133, 250, 0, 235, 199, 2, 220, 133, 52, 42, 235, 198, 52, 42, 214, 175, 
-    250, 0, 214, 176, 2, 220, 134, 22, 219, 77, 224, 180, 232, 146, 22, 2, 
-    59, 48, 232, 146, 177, 2, 59, 48, 52, 232, 146, 254, 118, 52, 232, 146, 
-    226, 158, 113, 235, 200, 232, 146, 254, 118, 113, 235, 200, 232, 146, 
-    226, 158, 219, 85, 233, 85, 226, 158, 219, 85, 233, 85, 254, 118, 232, 
-    146, 177, 226, 121, 232, 146, 254, 118, 232, 146, 22, 2, 230, 224, 218, 
-    139, 232, 146, 177, 2, 230, 224, 218, 139, 232, 146, 22, 2, 203, 248, 
-    156, 232, 146, 177, 2, 203, 248, 156, 232, 146, 22, 2, 52, 226, 123, 232, 
-    146, 22, 2, 214, 183, 232, 146, 22, 2, 52, 214, 183, 4, 213, 251, 2, 214, 
-    183, 232, 146, 177, 2, 52, 226, 123, 232, 146, 177, 2, 52, 214, 183, 210, 
-    160, 187, 247, 129, 254, 79, 210, 160, 187, 223, 148, 254, 79, 245, 98, 
-    5, 2, 59, 51, 240, 104, 2, 59, 48, 215, 211, 203, 252, 141, 2, 52, 67, 
-    91, 215, 211, 203, 252, 141, 2, 215, 211, 67, 91, 216, 89, 226, 168, 2, 
-    59, 48, 216, 89, 226, 168, 2, 222, 228, 247, 118, 219, 162, 230, 182, 
-    219, 161, 249, 199, 2, 59, 48, 245, 98, 2, 253, 216, 254, 148, 128, 216, 
-    42, 2, 250, 31, 255, 14, 254, 48, 128, 177, 128, 111, 245, 98, 5, 77, 96, 
-    50, 96, 5, 77, 245, 98, 50, 245, 98, 5, 77, 216, 89, 226, 167, 52, 249, 
-    227, 245, 99, 113, 249, 194, 245, 98, 219, 176, 134, 249, 194, 245, 98, 
-    219, 176, 245, 98, 5, 2, 113, 170, 77, 22, 113, 170, 51, 245, 94, 2, 244, 
-    11, 170, 48, 233, 15, 2, 250, 36, 235, 215, 242, 130, 2, 250, 36, 235, 
-    215, 233, 15, 2, 224, 13, 164, 48, 242, 130, 2, 224, 13, 164, 48, 233, 
-    15, 177, 219, 97, 128, 111, 242, 130, 177, 219, 97, 128, 111, 233, 15, 
-    177, 219, 97, 128, 216, 42, 2, 59, 235, 215, 242, 130, 177, 219, 97, 128, 
-    216, 42, 2, 59, 235, 215, 233, 15, 177, 219, 97, 128, 216, 42, 2, 59, 48, 
-    242, 130, 177, 219, 97, 128, 216, 42, 2, 59, 48, 233, 15, 177, 219, 97, 
-    128, 216, 42, 2, 59, 77, 222, 251, 242, 130, 177, 219, 97, 128, 216, 42, 
-    2, 59, 77, 233, 46, 233, 15, 177, 254, 49, 242, 130, 177, 254, 49, 233, 
-    15, 22, 219, 153, 228, 52, 128, 111, 242, 130, 22, 219, 153, 228, 52, 
-    128, 111, 233, 15, 22, 228, 52, 254, 49, 242, 130, 22, 228, 52, 254, 49, 
-    233, 15, 77, 246, 111, 128, 77, 242, 129, 242, 130, 77, 246, 111, 128, 
-    77, 233, 14, 233, 15, 77, 219, 162, 177, 245, 99, 242, 130, 77, 219, 162, 
-    177, 245, 99, 233, 15, 77, 219, 162, 77, 242, 129, 242, 130, 77, 219, 
-    162, 77, 233, 14, 233, 15, 77, 242, 130, 77, 246, 111, 245, 99, 242, 130, 
-    77, 233, 15, 77, 246, 111, 245, 99, 233, 15, 77, 219, 97, 128, 77, 242, 
-    130, 77, 219, 97, 245, 99, 242, 130, 77, 219, 97, 128, 77, 233, 15, 77, 
-    219, 97, 245, 99, 219, 97, 128, 216, 42, 177, 233, 14, 219, 97, 128, 216, 
-    42, 177, 242, 129, 219, 97, 128, 216, 42, 177, 233, 15, 2, 59, 235, 215, 
-    219, 97, 128, 216, 42, 177, 242, 130, 2, 59, 235, 215, 246, 111, 128, 
-    216, 42, 177, 233, 14, 246, 111, 128, 216, 42, 177, 242, 129, 246, 111, 
-    219, 97, 128, 216, 42, 177, 233, 14, 246, 111, 219, 97, 128, 216, 42, 
-    177, 242, 129, 219, 162, 177, 233, 14, 219, 162, 177, 242, 129, 219, 162, 
-    77, 233, 15, 77, 245, 98, 50, 219, 162, 77, 242, 130, 77, 245, 98, 50, 
-    52, 229, 91, 233, 14, 52, 229, 91, 242, 129, 52, 229, 91, 233, 15, 2, 
-    214, 183, 242, 130, 226, 121, 233, 14, 242, 130, 252, 30, 233, 14, 233, 
-    15, 250, 0, 251, 78, 249, 92, 242, 130, 250, 0, 251, 78, 249, 92, 233, 
-    15, 250, 0, 251, 78, 249, 93, 77, 219, 97, 245, 99, 242, 130, 250, 0, 
-    251, 78, 249, 93, 77, 219, 97, 245, 99, 219, 78, 216, 200, 233, 83, 216, 
-    200, 219, 78, 216, 201, 177, 128, 111, 233, 83, 216, 201, 177, 128, 111, 
-    245, 98, 5, 2, 251, 108, 48, 224, 203, 77, 219, 153, 245, 98, 50, 218, 
-    56, 77, 219, 153, 245, 98, 50, 224, 203, 77, 219, 153, 228, 52, 128, 111, 
-    218, 56, 77, 219, 153, 228, 52, 128, 111, 224, 203, 77, 245, 98, 50, 218, 
-    56, 77, 245, 98, 50, 224, 203, 77, 228, 52, 128, 111, 218, 56, 77, 228, 
-    52, 128, 111, 224, 203, 77, 254, 148, 128, 111, 218, 56, 77, 254, 148, 
-    128, 111, 224, 203, 77, 228, 52, 254, 148, 128, 111, 218, 56, 77, 228, 
-    52, 254, 148, 128, 111, 52, 224, 202, 52, 218, 55, 218, 64, 2, 247, 120, 
-    218, 22, 2, 247, 120, 218, 64, 2, 96, 5, 51, 218, 22, 2, 96, 5, 51, 218, 
-    64, 2, 230, 84, 5, 51, 218, 22, 2, 230, 84, 5, 51, 218, 64, 64, 177, 128, 
-    216, 42, 2, 59, 48, 218, 22, 64, 177, 128, 216, 42, 2, 59, 48, 218, 64, 
-    64, 77, 245, 98, 50, 218, 22, 64, 77, 245, 98, 50, 218, 64, 64, 77, 216, 
-    89, 226, 167, 218, 22, 64, 77, 216, 89, 226, 167, 218, 64, 64, 77, 254, 
-    148, 128, 111, 218, 22, 64, 77, 254, 148, 128, 111, 218, 64, 64, 77, 228, 
-    52, 128, 111, 218, 22, 64, 77, 228, 52, 128, 111, 42, 43, 204, 93, 226, 
-    167, 42, 44, 204, 93, 226, 167, 250, 0, 218, 63, 250, 0, 218, 21, 250, 0, 
-    218, 64, 177, 128, 111, 250, 0, 218, 22, 177, 128, 111, 218, 64, 77, 218, 
-    21, 218, 22, 77, 218, 63, 218, 64, 77, 218, 63, 218, 22, 77, 218, 21, 
-    218, 22, 252, 30, 218, 63, 218, 22, 252, 30, 22, 235, 65, 251, 78, 248, 
-    157, 2, 218, 63, 245, 170, 64, 226, 170, 246, 103, 225, 48, 2, 217, 12, 
-    216, 13, 215, 240, 235, 198, 244, 21, 228, 65, 219, 251, 43, 217, 87, 
-    219, 251, 124, 217, 87, 219, 251, 120, 217, 87, 225, 172, 2, 222, 91, 67, 
-    252, 141, 215, 211, 44, 215, 93, 52, 67, 252, 141, 43, 215, 93, 67, 252, 
-    141, 52, 43, 215, 93, 52, 67, 252, 141, 52, 43, 215, 93, 199, 248, 157, 
-    243, 243, 43, 231, 63, 64, 52, 213, 239, 219, 251, 124, 217, 88, 2, 226, 
-    123, 219, 251, 120, 217, 88, 2, 214, 183, 219, 251, 120, 217, 88, 77, 
-    219, 251, 124, 217, 87, 52, 124, 217, 87, 52, 120, 217, 87, 52, 218, 103, 
-    228, 52, 50, 223, 49, 52, 218, 103, 228, 52, 50, 247, 138, 228, 52, 247, 
-    175, 2, 223, 49, 229, 101, 219, 95, 67, 232, 214, 2, 250, 36, 48, 67, 
-    232, 214, 2, 250, 36, 51, 124, 217, 88, 2, 250, 36, 51, 226, 8, 2, 203, 
-    91, 226, 8, 2, 216, 89, 226, 167, 215, 211, 67, 252, 141, 251, 244, 223, 
-    91, 215, 211, 67, 252, 141, 2, 203, 91, 215, 211, 249, 227, 226, 167, 
-    215, 211, 229, 91, 233, 14, 215, 211, 229, 91, 242, 129, 246, 111, 219, 
-    97, 233, 15, 177, 128, 111, 246, 111, 219, 97, 242, 130, 177, 128, 111, 
-    215, 211, 219, 47, 251, 244, 223, 91, 233, 85, 215, 211, 67, 252, 141, 
-    226, 167, 52, 219, 47, 226, 167, 71, 67, 130, 230, 24, 71, 67, 130, 228, 
-    56, 245, 220, 71, 74, 228, 56, 212, 9, 71, 74, 219, 28, 245, 220, 71, 74, 
-    219, 28, 212, 9, 71, 74, 43, 44, 71, 74, 140, 85, 74, 214, 153, 85, 74, 
-    246, 104, 85, 74, 228, 56, 245, 220, 85, 74, 228, 56, 212, 9, 85, 74, 
-    219, 28, 245, 220, 85, 74, 219, 28, 212, 9, 85, 74, 43, 44, 85, 74, 120, 
-    124, 85, 74, 97, 80, 2, 216, 77, 246, 103, 97, 80, 2, 216, 77, 214, 152, 
-    140, 80, 2, 216, 77, 246, 103, 140, 80, 2, 216, 77, 214, 152, 42, 2, 216, 
-    14, 163, 251, 221, 42, 2, 251, 175, 163, 251, 221, 42, 2, 214, 160, 44, 
-    247, 255, 163, 251, 221, 42, 2, 232, 108, 43, 247, 255, 163, 251, 221, 
-    247, 249, 2, 43, 163, 251, 221, 247, 249, 2, 44, 163, 251, 221, 247, 249, 
-    2, 216, 14, 163, 251, 221, 247, 249, 2, 251, 175, 163, 251, 221, 246, 
-    118, 218, 234, 85, 233, 85, 218, 234, 71, 233, 85, 218, 234, 85, 213, 
-    187, 4, 218, 234, 71, 213, 187, 4, 218, 234, 85, 225, 190, 71, 225, 190, 
-    71, 241, 193, 85, 241, 193, 203, 85, 241, 193, 85, 233, 85, 250, 35, 85, 
-    231, 82, 247, 248, 71, 231, 82, 247, 248, 85, 231, 82, 232, 104, 71, 231, 
-    82, 232, 104, 85, 4, 247, 248, 85, 4, 232, 104, 71, 4, 232, 104, 85, 203, 
-    245, 164, 71, 203, 245, 164, 85, 67, 245, 164, 71, 67, 245, 164, 43, 80, 
-    2, 4, 250, 35, 134, 140, 253, 247, 43, 80, 2, 37, 225, 22, 199, 140, 218, 
-    230, 74, 140, 215, 58, 80, 2, 67, 91, 140, 215, 58, 80, 2, 52, 67, 91, 
-    140, 215, 58, 80, 243, 243, 130, 140, 215, 58, 215, 211, 248, 157, 74, 
-    140, 80, 2, 246, 118, 218, 139, 140, 80, 2, 217, 78, 2, 67, 91, 140, 80, 
-    2, 217, 78, 2, 52, 67, 91, 140, 215, 58, 80, 2, 217, 77, 140, 215, 58, 
-    80, 2, 217, 78, 2, 67, 91, 140, 215, 58, 80, 2, 217, 78, 2, 52, 67, 91, 
-    140, 80, 216, 139, 211, 178, 212, 36, 80, 225, 7, 247, 195, 233, 46, 245, 
-    98, 5, 77, 140, 74, 223, 50, 216, 89, 226, 168, 77, 140, 74, 140, 80, 77, 
-    223, 50, 254, 148, 128, 111, 97, 80, 216, 139, 242, 129, 97, 80, 216, 
-    139, 218, 21, 140, 224, 24, 74, 97, 224, 24, 74, 223, 50, 216, 89, 226, 
-    168, 77, 97, 74, 97, 80, 77, 223, 50, 254, 148, 128, 111, 216, 89, 226, 
-    168, 77, 140, 74, 140, 80, 77, 254, 148, 128, 111, 140, 80, 77, 223, 50, 
-    216, 89, 226, 167, 97, 80, 77, 223, 50, 216, 89, 226, 167, 71, 231, 82, 
-    218, 156, 85, 4, 218, 156, 71, 4, 218, 156, 85, 222, 247, 225, 190, 71, 
-    222, 247, 225, 190, 114, 233, 85, 250, 35, 114, 226, 124, 2, 226, 124, 
-    235, 215, 114, 250, 36, 2, 250, 36, 235, 215, 114, 250, 35, 114, 37, 221, 
-    254, 145, 6, 1, 253, 159, 145, 6, 1, 251, 117, 145, 6, 1, 213, 253, 145, 
-    6, 1, 242, 185, 145, 6, 1, 247, 140, 145, 6, 1, 211, 21, 145, 6, 1, 210, 
-    68, 145, 6, 1, 246, 34, 145, 6, 1, 210, 91, 145, 6, 1, 235, 148, 145, 6, 
-    1, 65, 235, 148, 145, 6, 1, 73, 145, 6, 1, 247, 160, 145, 6, 1, 234, 240, 
-    145, 6, 1, 232, 186, 145, 6, 1, 230, 29, 145, 6, 1, 229, 191, 145, 6, 1, 
-    226, 185, 145, 6, 1, 225, 4, 145, 6, 1, 222, 227, 145, 6, 1, 219, 83, 
-    145, 6, 1, 215, 81, 145, 6, 1, 214, 201, 145, 6, 1, 243, 246, 145, 6, 1, 
-    241, 199, 145, 6, 1, 226, 135, 145, 6, 1, 225, 221, 145, 6, 1, 219, 228, 
-    145, 6, 1, 215, 167, 145, 6, 1, 250, 75, 145, 6, 1, 220, 102, 145, 6, 1, 
-    211, 27, 145, 6, 1, 211, 29, 145, 6, 1, 211, 57, 145, 6, 1, 218, 253, 
-    162, 145, 6, 1, 210, 212, 145, 6, 1, 4, 210, 183, 145, 6, 1, 4, 210, 184, 
-    2, 217, 77, 145, 6, 1, 210, 244, 145, 6, 1, 235, 184, 4, 210, 183, 145, 
-    6, 1, 251, 249, 210, 183, 145, 6, 1, 235, 184, 251, 249, 210, 183, 145, 
-    6, 1, 244, 82, 145, 6, 1, 235, 146, 145, 6, 1, 219, 227, 145, 6, 1, 215, 
-    202, 61, 145, 6, 1, 233, 75, 230, 29, 145, 4, 1, 253, 159, 145, 4, 1, 
-    251, 117, 145, 4, 1, 213, 253, 145, 4, 1, 242, 185, 145, 4, 1, 247, 140, 
-    145, 4, 1, 211, 21, 145, 4, 1, 210, 68, 145, 4, 1, 246, 34, 145, 4, 1, 
-    210, 91, 145, 4, 1, 235, 148, 145, 4, 1, 65, 235, 148, 145, 4, 1, 73, 
-    145, 4, 1, 247, 160, 145, 4, 1, 234, 240, 145, 4, 1, 232, 186, 145, 4, 1, 
-    230, 29, 145, 4, 1, 229, 191, 145, 4, 1, 226, 185, 145, 4, 1, 225, 4, 
-    145, 4, 1, 222, 227, 145, 4, 1, 219, 83, 145, 4, 1, 215, 81, 145, 4, 1, 
-    214, 201, 145, 4, 1, 243, 246, 145, 4, 1, 241, 199, 145, 4, 1, 226, 135, 
-    145, 4, 1, 225, 221, 145, 4, 1, 219, 228, 145, 4, 1, 215, 167, 145, 4, 1, 
-    250, 75, 145, 4, 1, 220, 102, 145, 4, 1, 211, 27, 145, 4, 1, 211, 29, 
-    145, 4, 1, 211, 57, 145, 4, 1, 218, 253, 162, 145, 4, 1, 210, 212, 145, 
-    4, 1, 4, 210, 183, 145, 4, 1, 4, 210, 184, 2, 217, 77, 145, 4, 1, 210, 
-    244, 145, 4, 1, 235, 184, 4, 210, 183, 145, 4, 1, 251, 249, 210, 183, 
-    145, 4, 1, 235, 184, 251, 249, 210, 183, 145, 4, 1, 244, 82, 145, 4, 1, 
-    235, 146, 145, 4, 1, 219, 227, 145, 4, 1, 215, 202, 61, 145, 4, 1, 233, 
-    75, 230, 29, 7, 6, 1, 233, 149, 2, 52, 130, 7, 4, 1, 233, 149, 2, 52, 
-    130, 7, 6, 1, 233, 149, 2, 230, 224, 182, 7, 6, 1, 226, 106, 2, 91, 7, 6, 
-    1, 223, 224, 2, 217, 77, 7, 4, 1, 115, 2, 91, 7, 4, 1, 217, 153, 2, 247, 
-    255, 91, 7, 6, 1, 242, 61, 2, 248, 39, 7, 4, 1, 242, 61, 2, 248, 39, 7, 
-    6, 1, 235, 24, 2, 248, 39, 7, 4, 1, 235, 24, 2, 248, 39, 7, 6, 1, 210, 
-    160, 2, 248, 39, 7, 4, 1, 210, 160, 2, 248, 39, 7, 6, 1, 254, 143, 7, 6, 
-    1, 232, 50, 2, 103, 7, 6, 1, 215, 94, 61, 7, 6, 1, 215, 94, 254, 143, 7, 
-    4, 1, 214, 106, 2, 44, 103, 7, 6, 1, 212, 99, 2, 103, 7, 4, 1, 212, 99, 
-    2, 103, 7, 4, 1, 214, 106, 2, 249, 100, 7, 6, 1, 163, 242, 60, 7, 4, 1, 
-    163, 242, 60, 7, 4, 1, 217, 75, 225, 133, 7, 4, 1, 160, 2, 228, 50, 7, 4, 
-    1, 215, 94, 223, 224, 2, 217, 77, 7, 4, 1, 144, 2, 121, 222, 234, 235, 
-    215, 7, 1, 4, 6, 215, 94, 75, 7, 218, 65, 4, 1, 235, 144, 58, 1, 6, 214, 
-    105, 7, 6, 1, 222, 92, 2, 217, 250, 217, 77, 7, 6, 1, 210, 160, 2, 217, 
-    250, 217, 77, 81, 6, 1, 254, 164, 81, 4, 1, 254, 164, 81, 6, 1, 213, 173, 
-    81, 4, 1, 213, 173, 81, 6, 1, 243, 107, 81, 4, 1, 243, 107, 81, 6, 1, 
-    248, 191, 81, 4, 1, 248, 191, 81, 6, 1, 245, 194, 81, 4, 1, 245, 194, 81, 
-    6, 1, 219, 33, 81, 4, 1, 219, 33, 81, 6, 1, 210, 101, 81, 4, 1, 210, 101, 
-    81, 6, 1, 241, 248, 81, 4, 1, 241, 248, 81, 6, 1, 216, 177, 81, 4, 1, 
-    216, 177, 81, 6, 1, 240, 116, 81, 4, 1, 240, 116, 81, 6, 1, 234, 227, 81, 
-    4, 1, 234, 227, 81, 6, 1, 233, 72, 81, 4, 1, 233, 72, 81, 6, 1, 230, 230, 
-    81, 4, 1, 230, 230, 81, 6, 1, 228, 233, 81, 4, 1, 228, 233, 81, 6, 1, 
-    233, 233, 81, 4, 1, 233, 233, 81, 6, 1, 76, 81, 4, 1, 76, 81, 6, 1, 225, 
-    108, 81, 4, 1, 225, 108, 81, 6, 1, 222, 211, 81, 4, 1, 222, 211, 81, 6, 
-    1, 219, 165, 81, 4, 1, 219, 165, 81, 6, 1, 217, 41, 81, 4, 1, 217, 41, 
-    81, 6, 1, 214, 229, 81, 4, 1, 214, 229, 81, 6, 1, 244, 121, 81, 4, 1, 
-    244, 121, 81, 6, 1, 234, 112, 81, 4, 1, 234, 112, 81, 6, 1, 224, 161, 81, 
-    4, 1, 224, 161, 81, 6, 1, 226, 178, 81, 4, 1, 226, 178, 81, 6, 1, 247, 
-    253, 254, 170, 81, 4, 1, 247, 253, 254, 170, 81, 6, 1, 55, 81, 254, 196, 
-    81, 4, 1, 55, 81, 254, 196, 81, 6, 1, 249, 115, 245, 194, 81, 4, 1, 249, 
-    115, 245, 194, 81, 6, 1, 247, 253, 234, 227, 81, 4, 1, 247, 253, 234, 
-    227, 81, 6, 1, 247, 253, 228, 233, 81, 4, 1, 247, 253, 228, 233, 81, 6, 
-    1, 249, 115, 228, 233, 81, 4, 1, 249, 115, 228, 233, 81, 6, 1, 55, 81, 
-    226, 178, 81, 4, 1, 55, 81, 226, 178, 81, 6, 1, 221, 246, 81, 4, 1, 221, 
-    246, 81, 6, 1, 249, 128, 220, 55, 81, 4, 1, 249, 128, 220, 55, 81, 6, 1, 
-    55, 81, 220, 55, 81, 4, 1, 55, 81, 220, 55, 81, 6, 1, 55, 81, 245, 75, 
-    81, 4, 1, 55, 81, 245, 75, 81, 6, 1, 254, 182, 234, 117, 81, 4, 1, 254, 
-    182, 234, 117, 81, 6, 1, 247, 253, 241, 45, 81, 4, 1, 247, 253, 241, 45, 
-    81, 6, 1, 55, 81, 241, 45, 81, 4, 1, 55, 81, 241, 45, 81, 6, 1, 55, 81, 
-    162, 81, 4, 1, 55, 81, 162, 81, 6, 1, 233, 148, 162, 81, 4, 1, 233, 148, 
-    162, 81, 6, 1, 55, 81, 241, 217, 81, 4, 1, 55, 81, 241, 217, 81, 6, 1, 
-    55, 81, 241, 251, 81, 4, 1, 55, 81, 241, 251, 81, 6, 1, 55, 81, 243, 102, 
-    81, 4, 1, 55, 81, 243, 102, 81, 6, 1, 55, 81, 247, 163, 81, 4, 1, 55, 81, 
-    247, 163, 81, 6, 1, 55, 81, 220, 22, 81, 4, 1, 55, 81, 220, 22, 81, 6, 1, 
-    55, 227, 208, 220, 22, 81, 4, 1, 55, 227, 208, 220, 22, 81, 6, 1, 55, 
-    227, 208, 229, 27, 81, 4, 1, 55, 227, 208, 229, 27, 81, 6, 1, 55, 227, 
-    208, 227, 148, 81, 4, 1, 55, 227, 208, 227, 148, 81, 6, 1, 55, 227, 208, 
-    212, 37, 81, 4, 1, 55, 227, 208, 212, 37, 81, 16, 234, 246, 81, 16, 230, 
-    231, 222, 211, 81, 16, 225, 109, 222, 211, 81, 16, 218, 147, 81, 16, 217, 
-    42, 222, 211, 81, 16, 234, 113, 222, 211, 81, 16, 220, 23, 219, 165, 81, 
-    6, 1, 249, 115, 220, 55, 81, 4, 1, 249, 115, 220, 55, 81, 6, 1, 249, 115, 
-    243, 102, 81, 4, 1, 249, 115, 243, 102, 81, 38, 228, 234, 48, 81, 38, 
-    218, 247, 253, 224, 81, 38, 218, 247, 233, 21, 81, 6, 1, 251, 199, 234, 
-    117, 81, 4, 1, 251, 199, 234, 117, 81, 55, 227, 208, 243, 229, 218, 129, 
-    81, 55, 227, 208, 247, 197, 224, 13, 78, 81, 55, 227, 208, 235, 237, 224, 
-    13, 78, 81, 55, 227, 208, 213, 241, 247, 172, 81, 244, 2, 123, 242, 27, 
-    81, 243, 229, 218, 129, 81, 230, 124, 247, 172, 98, 4, 1, 254, 123, 98, 
-    4, 1, 252, 152, 98, 4, 1, 243, 106, 98, 4, 1, 247, 128, 98, 4, 1, 245, 
-    150, 98, 4, 1, 213, 160, 98, 4, 1, 210, 89, 98, 4, 1, 217, 60, 98, 4, 1, 
-    235, 255, 98, 4, 1, 234, 234, 98, 4, 1, 233, 81, 98, 4, 1, 231, 185, 98, 
-    4, 1, 229, 195, 98, 4, 1, 226, 196, 98, 4, 1, 226, 17, 98, 4, 1, 210, 78, 
-    98, 4, 1, 223, 171, 98, 4, 1, 221, 243, 98, 4, 1, 217, 50, 98, 4, 1, 214, 
-    190, 98, 4, 1, 225, 140, 98, 4, 1, 234, 121, 98, 4, 1, 242, 241, 98, 4, 
-    1, 224, 73, 98, 4, 1, 220, 20, 98, 4, 1, 250, 97, 98, 4, 1, 251, 7, 98, 
-    4, 1, 235, 100, 98, 4, 1, 250, 40, 98, 4, 1, 250, 143, 98, 4, 1, 211, 
-    163, 98, 4, 1, 235, 111, 98, 4, 1, 242, 43, 98, 4, 1, 241, 238, 98, 4, 1, 
-    241, 175, 98, 4, 1, 212, 22, 98, 4, 1, 242, 4, 98, 4, 1, 241, 65, 98, 4, 
-    1, 210, 246, 98, 4, 1, 254, 232, 216, 108, 1, 191, 216, 108, 1, 211, 99, 
-    216, 108, 1, 211, 98, 216, 108, 1, 211, 88, 216, 108, 1, 211, 86, 216, 
-    108, 1, 252, 32, 255, 16, 211, 81, 216, 108, 1, 211, 81, 216, 108, 1, 
-    211, 96, 216, 108, 1, 211, 93, 216, 108, 1, 211, 95, 216, 108, 1, 211, 
-    94, 216, 108, 1, 211, 12, 216, 108, 1, 211, 90, 216, 108, 1, 211, 79, 
-    216, 108, 1, 215, 115, 211, 79, 216, 108, 1, 211, 76, 216, 108, 1, 211, 
-    84, 216, 108, 1, 252, 32, 255, 16, 211, 84, 216, 108, 1, 215, 115, 211, 
-    84, 216, 108, 1, 211, 83, 216, 108, 1, 211, 103, 216, 108, 1, 211, 77, 
-    216, 108, 1, 215, 115, 211, 77, 216, 108, 1, 211, 66, 216, 108, 1, 215, 
-    115, 211, 66, 216, 108, 1, 211, 8, 216, 108, 1, 211, 49, 216, 108, 1, 
-    254, 207, 211, 49, 216, 108, 1, 215, 115, 211, 49, 216, 108, 1, 211, 75, 
-    216, 108, 1, 211, 74, 216, 108, 1, 211, 71, 216, 108, 1, 215, 115, 211, 
-    85, 216, 108, 1, 215, 115, 211, 69, 216, 108, 1, 211, 67, 216, 108, 1, 
-    210, 212, 216, 108, 1, 211, 64, 216, 108, 1, 211, 63, 216, 108, 1, 211, 
-    87, 216, 108, 1, 215, 115, 211, 87, 216, 108, 1, 253, 163, 211, 87, 216, 
-    108, 1, 211, 62, 216, 108, 1, 211, 60, 216, 108, 1, 211, 61, 216, 108, 1, 
-    211, 59, 216, 108, 1, 211, 58, 216, 108, 1, 211, 97, 216, 108, 1, 211, 
-    56, 216, 108, 1, 211, 54, 216, 108, 1, 211, 53, 216, 108, 1, 211, 52, 
-    216, 108, 1, 211, 50, 216, 108, 1, 217, 34, 211, 50, 216, 108, 1, 211, 
-    48, 216, 108, 1, 211, 47, 216, 108, 1, 210, 244, 216, 108, 58, 1, 233, 
-    126, 78, 216, 108, 220, 138, 78, 216, 108, 116, 235, 63, 29, 3, 232, 155, 
-    29, 3, 230, 160, 29, 3, 222, 209, 29, 3, 219, 57, 29, 3, 220, 6, 29, 3, 
-    251, 204, 29, 3, 216, 41, 29, 3, 249, 237, 29, 3, 228, 72, 29, 3, 227, 
-    133, 29, 3, 242, 180, 227, 0, 29, 3, 210, 22, 29, 3, 247, 143, 29, 3, 
-    248, 104, 29, 3, 235, 67, 29, 3, 216, 155, 29, 3, 250, 85, 29, 3, 225, 
-    120, 29, 3, 225, 15, 29, 3, 242, 255, 29, 3, 242, 251, 29, 3, 242, 252, 
-    29, 3, 242, 253, 29, 3, 218, 223, 29, 3, 218, 179, 29, 3, 218, 192, 29, 
-    3, 218, 222, 29, 3, 218, 196, 29, 3, 218, 197, 29, 3, 218, 184, 29, 3, 
-    250, 213, 29, 3, 250, 192, 29, 3, 250, 194, 29, 3, 250, 212, 29, 3, 250, 
-    210, 29, 3, 250, 211, 29, 3, 250, 193, 29, 3, 209, 243, 29, 3, 209, 221, 
-    29, 3, 209, 234, 29, 3, 209, 242, 29, 3, 209, 237, 29, 3, 209, 238, 29, 
-    3, 209, 226, 29, 3, 250, 208, 29, 3, 250, 195, 29, 3, 250, 197, 29, 3, 
-    250, 207, 29, 3, 250, 205, 29, 3, 250, 206, 29, 3, 250, 196, 29, 3, 223, 
-    236, 29, 3, 223, 226, 29, 3, 223, 232, 29, 3, 223, 235, 29, 3, 223, 233, 
-    29, 3, 223, 234, 29, 3, 223, 231, 29, 3, 233, 159, 29, 3, 233, 151, 29, 
-    3, 233, 154, 29, 3, 233, 158, 29, 3, 233, 155, 29, 3, 233, 156, 29, 3, 
-    233, 152, 29, 3, 211, 130, 29, 3, 211, 120, 29, 3, 211, 126, 29, 3, 211, 
-    129, 29, 3, 211, 127, 29, 3, 211, 128, 29, 3, 211, 125, 29, 3, 242, 71, 
-    29, 3, 242, 62, 29, 3, 242, 65, 29, 3, 242, 70, 29, 3, 242, 67, 29, 3, 
-    242, 68, 29, 3, 242, 64, 38, 33, 1, 252, 75, 38, 33, 1, 213, 255, 38, 33, 
-    1, 242, 236, 38, 33, 1, 248, 90, 38, 33, 1, 210, 74, 38, 33, 1, 210, 94, 
-    38, 33, 1, 176, 38, 33, 1, 245, 174, 38, 33, 1, 245, 159, 38, 33, 1, 245, 
-    150, 38, 33, 1, 76, 38, 33, 1, 225, 221, 38, 33, 1, 245, 92, 38, 33, 1, 
-    245, 82, 38, 33, 1, 217, 22, 38, 33, 1, 162, 38, 33, 1, 215, 178, 38, 33, 
-    1, 250, 131, 38, 33, 1, 220, 102, 38, 33, 1, 220, 65, 38, 33, 1, 244, 82, 
-    38, 33, 1, 245, 81, 38, 33, 1, 61, 38, 33, 1, 236, 60, 38, 33, 1, 247, 
-    161, 38, 33, 1, 230, 140, 214, 205, 38, 33, 1, 211, 59, 38, 33, 1, 210, 
-    212, 38, 33, 1, 235, 183, 61, 38, 33, 1, 232, 192, 210, 183, 38, 33, 1, 
-    251, 249, 210, 183, 38, 33, 1, 235, 183, 251, 249, 210, 183, 44, 254, 
-    110, 218, 60, 231, 154, 44, 254, 110, 246, 118, 218, 60, 231, 154, 43, 
-    218, 60, 127, 44, 218, 60, 127, 43, 246, 118, 218, 60, 127, 44, 246, 118, 
-    218, 60, 127, 223, 157, 235, 202, 231, 154, 223, 157, 246, 118, 235, 202, 
-    231, 154, 246, 118, 215, 241, 231, 154, 43, 215, 241, 127, 44, 215, 241, 
-    127, 223, 157, 218, 234, 43, 223, 157, 226, 198, 127, 44, 223, 157, 226, 
-    198, 127, 245, 210, 249, 158, 226, 13, 244, 22, 226, 13, 223, 49, 244, 
-    22, 226, 13, 240, 165, 246, 118, 226, 251, 246, 104, 254, 119, 214, 153, 
-    254, 119, 246, 118, 222, 247, 254, 109, 52, 226, 248, 240, 168, 235, 193, 
-    235, 201, 226, 59, 251, 154, 240, 169, 2, 248, 1, 216, 89, 2, 222, 234, 
-    48, 43, 121, 226, 5, 127, 44, 121, 226, 5, 127, 216, 89, 2, 59, 48, 216, 
-    89, 2, 59, 51, 43, 67, 252, 141, 2, 224, 7, 44, 67, 252, 141, 2, 224, 7, 
-    216, 14, 43, 163, 127, 216, 14, 44, 163, 127, 251, 175, 43, 163, 127, 
-    251, 175, 44, 163, 127, 43, 219, 187, 104, 127, 44, 219, 187, 104, 127, 
-    43, 52, 226, 3, 44, 52, 226, 3, 113, 170, 117, 123, 59, 224, 140, 123, 
-    59, 117, 113, 170, 224, 140, 92, 244, 11, 59, 224, 140, 244, 81, 59, 78, 
-    223, 49, 224, 13, 78, 67, 182, 222, 234, 225, 10, 211, 209, 220, 138, 
-    230, 224, 247, 120, 215, 94, 249, 219, 223, 157, 247, 120, 223, 157, 249, 
-    219, 215, 94, 220, 150, 248, 206, 2, 43, 242, 108, 248, 206, 2, 44, 242, 
-    108, 215, 94, 248, 205, 216, 14, 163, 221, 173, 50, 215, 59, 248, 156, 
-    216, 143, 248, 156, 9, 34, 223, 76, 9, 34, 250, 10, 9, 34, 221, 176, 110, 
-    9, 34, 221, 176, 105, 9, 34, 221, 176, 158, 9, 34, 225, 167, 9, 34, 251, 
-    163, 9, 34, 217, 92, 9, 34, 234, 33, 110, 9, 34, 234, 33, 105, 9, 34, 
-    247, 170, 9, 34, 221, 179, 9, 34, 4, 110, 9, 34, 4, 105, 9, 34, 233, 97, 
-    110, 9, 34, 233, 97, 105, 9, 34, 233, 97, 158, 9, 34, 233, 97, 161, 9, 
-    34, 219, 68, 9, 34, 216, 145, 9, 34, 219, 66, 110, 9, 34, 219, 66, 105, 
-    9, 34, 241, 228, 110, 9, 34, 241, 228, 105, 9, 34, 242, 15, 9, 34, 223, 
-    147, 9, 34, 250, 82, 9, 34, 218, 37, 9, 34, 230, 128, 9, 34, 248, 88, 9, 
-    34, 230, 120, 9, 34, 250, 25, 9, 34, 212, 41, 110, 9, 34, 212, 41, 105, 
-    9, 34, 244, 96, 9, 34, 225, 232, 110, 9, 34, 225, 232, 105, 9, 34, 219, 
-    160, 163, 215, 236, 215, 188, 9, 34, 249, 145, 9, 34, 247, 136, 9, 34, 
-    235, 137, 9, 34, 251, 198, 64, 249, 250, 9, 34, 245, 15, 9, 34, 218, 249, 
-    110, 9, 34, 218, 249, 105, 9, 34, 252, 154, 9, 34, 219, 167, 9, 34, 251, 
-    63, 219, 167, 9, 34, 229, 90, 110, 9, 34, 229, 90, 105, 9, 34, 229, 90, 
-    158, 9, 34, 229, 90, 161, 9, 34, 231, 46, 9, 34, 220, 57, 9, 34, 223, 
-    153, 9, 34, 245, 37, 9, 34, 226, 209, 9, 34, 251, 133, 110, 9, 34, 251, 
-    133, 105, 9, 34, 231, 86, 9, 34, 230, 123, 9, 34, 242, 140, 110, 9, 34, 
-    242, 140, 105, 9, 34, 242, 140, 158, 9, 34, 216, 106, 9, 34, 249, 249, 9, 
-    34, 212, 9, 110, 9, 34, 212, 9, 105, 9, 34, 251, 63, 221, 170, 9, 34, 
-    219, 160, 240, 248, 9, 34, 240, 248, 9, 34, 251, 63, 219, 2, 9, 34, 251, 
-    63, 220, 52, 9, 34, 244, 32, 9, 34, 251, 63, 250, 228, 9, 34, 219, 160, 
-    212, 57, 9, 34, 212, 58, 110, 9, 34, 212, 58, 105, 9, 34, 250, 27, 9, 34, 
-    251, 63, 242, 166, 9, 34, 199, 110, 9, 34, 199, 105, 9, 34, 251, 63, 232, 
-    137, 9, 34, 251, 63, 243, 88, 9, 34, 230, 119, 110, 9, 34, 230, 119, 105, 
-    9, 34, 223, 159, 9, 34, 251, 207, 9, 34, 251, 63, 217, 56, 233, 52, 9, 
-    34, 251, 63, 233, 53, 9, 34, 251, 63, 211, 239, 9, 34, 251, 63, 244, 46, 
-    9, 34, 245, 218, 110, 9, 34, 245, 218, 105, 9, 34, 245, 218, 158, 9, 34, 
-    251, 63, 245, 217, 9, 34, 241, 235, 9, 34, 251, 63, 240, 245, 9, 34, 251, 
-    194, 9, 34, 242, 222, 9, 34, 251, 63, 244, 90, 9, 34, 251, 63, 251, 237, 
-    9, 34, 251, 63, 222, 1, 9, 34, 219, 160, 212, 2, 9, 34, 219, 160, 211, 
-    41, 9, 34, 251, 63, 243, 244, 9, 34, 235, 143, 245, 41, 9, 34, 251, 63, 
-    245, 41, 9, 34, 235, 143, 216, 15, 9, 34, 251, 63, 216, 15, 9, 34, 235, 
-    143, 246, 96, 9, 34, 251, 63, 246, 96, 9, 34, 215, 91, 9, 34, 235, 143, 
-    215, 91, 9, 34, 251, 63, 215, 91, 60, 34, 110, 60, 34, 232, 213, 60, 34, 
-    247, 120, 60, 34, 219, 95, 60, 34, 221, 175, 60, 34, 103, 60, 34, 105, 
-    60, 34, 232, 237, 60, 34, 231, 185, 60, 34, 233, 33, 60, 34, 245, 129, 
-    60, 34, 195, 60, 34, 124, 251, 163, 60, 34, 249, 147, 60, 34, 240, 111, 
-    60, 34, 217, 92, 60, 34, 204, 251, 163, 60, 34, 234, 32, 60, 34, 224, 
-    224, 60, 34, 211, 202, 60, 34, 218, 243, 60, 34, 44, 204, 251, 163, 60, 
-    34, 241, 176, 245, 145, 60, 34, 216, 247, 60, 34, 247, 170, 60, 34, 221, 
-    179, 60, 34, 250, 10, 60, 34, 224, 182, 60, 34, 254, 215, 60, 34, 230, 
-    110, 60, 34, 245, 145, 60, 34, 245, 223, 60, 34, 221, 200, 60, 34, 242, 
-    174, 60, 34, 242, 175, 219, 81, 60, 34, 245, 40, 60, 34, 251, 248, 60, 
-    34, 211, 221, 60, 34, 250, 101, 60, 34, 222, 196, 60, 34, 235, 251, 60, 
-    34, 219, 79, 60, 34, 233, 96, 60, 34, 249, 156, 60, 34, 218, 237, 60, 34, 
-    230, 115, 60, 34, 222, 224, 60, 34, 211, 206, 60, 34, 226, 190, 60, 34, 
-    215, 97, 60, 34, 246, 80, 60, 34, 219, 251, 216, 145, 60, 34, 246, 118, 
-    250, 10, 60, 34, 199, 218, 108, 60, 34, 113, 242, 10, 60, 34, 220, 0, 60, 
-    34, 251, 169, 60, 34, 219, 65, 60, 34, 251, 137, 60, 34, 218, 138, 60, 
-    34, 241, 227, 60, 34, 242, 28, 60, 34, 247, 123, 60, 34, 242, 15, 60, 34, 
-    251, 154, 60, 34, 223, 147, 60, 34, 221, 187, 60, 34, 247, 199, 60, 34, 
-    253, 168, 60, 34, 218, 234, 60, 34, 228, 51, 60, 34, 218, 37, 60, 34, 
-    221, 211, 60, 34, 230, 128, 60, 34, 215, 235, 60, 34, 233, 122, 60, 34, 
-    218, 129, 60, 34, 248, 88, 60, 34, 212, 21, 60, 34, 247, 146, 228, 51, 
-    60, 34, 249, 215, 60, 34, 243, 222, 60, 34, 250, 21, 60, 34, 218, 142, 
-    60, 34, 212, 40, 60, 34, 244, 96, 60, 34, 250, 18, 60, 34, 244, 161, 60, 
-    34, 52, 211, 178, 60, 34, 163, 215, 236, 215, 188, 60, 34, 219, 89, 60, 
-    34, 244, 171, 60, 34, 249, 145, 60, 34, 247, 136, 60, 34, 224, 179, 60, 
-    34, 235, 137, 60, 34, 231, 67, 60, 34, 216, 88, 60, 34, 217, 245, 60, 34, 
-    232, 231, 60, 34, 214, 131, 60, 34, 244, 120, 60, 34, 251, 198, 64, 249, 
-    250, 60, 34, 219, 188, 60, 34, 246, 118, 216, 242, 60, 34, 211, 253, 60, 
-    34, 219, 103, 60, 34, 247, 187, 60, 34, 245, 15, 60, 34, 219, 5, 60, 34, 
-    74, 60, 34, 218, 131, 60, 34, 218, 248, 60, 34, 215, 255, 60, 34, 242, 
-    147, 60, 34, 250, 218, 60, 34, 218, 160, 60, 34, 252, 154, 60, 34, 223, 
-    31, 60, 34, 219, 167, 60, 34, 235, 130, 60, 34, 229, 89, 60, 34, 220, 57, 
-    60, 34, 244, 149, 60, 34, 226, 209, 60, 34, 254, 118, 60, 34, 225, 29, 
-    60, 34, 245, 227, 60, 34, 251, 132, 60, 34, 231, 86, 60, 34, 230, 183, 
-    60, 34, 220, 156, 60, 34, 253, 252, 60, 34, 230, 123, 60, 34, 216, 19, 
-    60, 34, 226, 165, 60, 34, 251, 201, 60, 34, 218, 127, 60, 34, 249, 225, 
-    60, 34, 242, 139, 60, 34, 216, 106, 60, 34, 235, 217, 60, 34, 251, 211, 
-    60, 34, 212, 58, 245, 145, 60, 34, 249, 249, 60, 34, 212, 8, 60, 34, 221, 
-    170, 60, 34, 240, 248, 60, 34, 219, 2, 60, 34, 214, 22, 60, 34, 252, 72, 
-    60, 34, 225, 73, 60, 34, 252, 174, 60, 34, 220, 52, 60, 34, 223, 110, 60, 
-    34, 222, 126, 60, 34, 244, 32, 60, 34, 251, 200, 60, 34, 250, 228, 60, 
-    34, 251, 226, 60, 34, 230, 125, 60, 34, 212, 57, 60, 34, 250, 27, 60, 34, 
-    211, 236, 60, 34, 247, 180, 60, 34, 213, 161, 60, 34, 242, 166, 60, 34, 
-    232, 137, 60, 34, 243, 88, 60, 34, 230, 118, 60, 34, 219, 94, 60, 34, 
-    219, 251, 217, 76, 251, 237, 60, 34, 223, 159, 60, 34, 251, 207, 60, 34, 
-    211, 197, 60, 34, 244, 190, 60, 34, 233, 52, 60, 34, 217, 56, 233, 52, 
-    60, 34, 233, 48, 60, 34, 219, 30, 60, 34, 233, 53, 60, 34, 211, 239, 60, 
-    34, 244, 46, 60, 34, 245, 217, 60, 34, 241, 235, 60, 34, 244, 0, 60, 34, 
-    240, 245, 60, 34, 251, 194, 60, 34, 217, 63, 60, 34, 242, 34, 60, 34, 
-    244, 113, 60, 34, 222, 28, 211, 236, 60, 34, 250, 220, 60, 34, 242, 222, 
-    60, 34, 244, 90, 60, 34, 251, 237, 60, 34, 222, 1, 60, 34, 248, 74, 60, 
-    34, 212, 2, 60, 34, 241, 210, 60, 34, 211, 41, 60, 34, 230, 192, 60, 34, 
-    251, 221, 60, 34, 245, 155, 60, 34, 243, 244, 60, 34, 215, 209, 60, 34, 
-    246, 82, 60, 34, 223, 141, 60, 34, 228, 53, 60, 34, 245, 41, 60, 34, 216, 
-    15, 60, 34, 246, 96, 60, 34, 215, 91, 60, 34, 244, 48, 109, 248, 37, 135, 
-    43, 216, 42, 222, 251, 109, 248, 37, 135, 77, 216, 42, 51, 109, 248, 37, 
-    135, 43, 216, 42, 230, 224, 22, 222, 251, 109, 248, 37, 135, 77, 216, 42, 
-    230, 224, 22, 51, 109, 248, 37, 135, 243, 229, 218, 10, 109, 248, 37, 
-    135, 218, 11, 243, 243, 48, 109, 248, 37, 135, 218, 11, 243, 243, 51, 
-    109, 248, 37, 135, 218, 11, 243, 243, 233, 46, 109, 248, 37, 135, 218, 
-    11, 243, 243, 214, 160, 233, 46, 109, 248, 37, 135, 218, 11, 243, 243, 
-    214, 160, 222, 251, 109, 248, 37, 135, 218, 11, 243, 243, 232, 108, 233, 
-    46, 109, 248, 37, 135, 226, 122, 109, 219, 18, 109, 249, 219, 109, 243, 
-    229, 218, 129, 247, 177, 78, 235, 131, 235, 236, 218, 159, 87, 109, 235, 
-    158, 78, 109, 249, 252, 78, 109, 54, 210, 86, 43, 254, 110, 127, 44, 254, 
-    110, 127, 43, 52, 254, 110, 127, 44, 52, 254, 110, 127, 43, 249, 161, 
-    127, 44, 249, 161, 127, 43, 71, 249, 161, 127, 44, 71, 249, 161, 127, 43, 
-    85, 233, 20, 127, 44, 85, 233, 20, 127, 224, 237, 78, 243, 32, 78, 43, 
-    216, 6, 220, 53, 127, 44, 216, 6, 220, 53, 127, 43, 71, 233, 20, 127, 44, 
-    71, 233, 20, 127, 43, 71, 216, 6, 220, 53, 127, 44, 71, 216, 6, 220, 53, 
-    127, 43, 71, 42, 127, 44, 71, 42, 127, 212, 36, 248, 156, 223, 49, 52, 
-    224, 191, 223, 254, 78, 52, 224, 191, 223, 254, 78, 121, 52, 224, 191, 
-    223, 254, 78, 224, 237, 164, 244, 190, 242, 8, 227, 198, 110, 242, 8, 
-    227, 198, 105, 242, 8, 227, 198, 158, 242, 8, 227, 198, 161, 242, 8, 227, 
-    198, 189, 242, 8, 227, 198, 194, 242, 8, 227, 198, 198, 242, 8, 227, 198, 
-    195, 242, 8, 227, 198, 200, 109, 233, 3, 138, 78, 109, 222, 228, 138, 78, 
-    109, 248, 44, 138, 78, 109, 245, 128, 138, 78, 24, 219, 155, 59, 138, 78, 
-    24, 52, 59, 138, 78, 212, 32, 248, 156, 67, 234, 233, 223, 77, 78, 67, 
-    234, 233, 223, 77, 2, 213, 135, 219, 31, 78, 67, 234, 233, 223, 77, 164, 
-    214, 160, 242, 27, 67, 234, 233, 223, 77, 2, 213, 135, 219, 31, 164, 214, 
-    160, 242, 27, 67, 234, 233, 223, 77, 164, 232, 108, 242, 27, 37, 224, 
-    237, 78, 109, 217, 3, 232, 214, 244, 146, 220, 138, 87, 242, 8, 227, 198, 
-    216, 247, 242, 8, 227, 198, 215, 73, 242, 8, 227, 198, 216, 162, 67, 109, 
-    235, 158, 78, 231, 140, 78, 225, 255, 254, 140, 78, 109, 45, 235, 238, 
-    109, 163, 244, 106, 219, 18, 141, 1, 4, 61, 141, 1, 61, 141, 1, 4, 73, 
-    141, 1, 73, 141, 1, 4, 70, 141, 1, 70, 141, 1, 4, 75, 141, 1, 75, 141, 1, 
-    4, 76, 141, 1, 76, 141, 1, 176, 141, 1, 243, 135, 141, 1, 234, 92, 141, 
-    1, 242, 214, 141, 1, 233, 217, 141, 1, 242, 113, 141, 1, 234, 182, 141, 
-    1, 243, 62, 141, 1, 234, 28, 141, 1, 242, 174, 141, 1, 206, 141, 1, 210, 
-    116, 141, 1, 219, 191, 141, 1, 210, 44, 141, 1, 218, 83, 141, 1, 210, 13, 
-    141, 1, 221, 181, 141, 1, 210, 94, 141, 1, 219, 58, 141, 1, 210, 23, 141, 
-    1, 217, 105, 141, 1, 248, 221, 141, 1, 216, 117, 141, 1, 248, 3, 141, 1, 
-    4, 215, 118, 141, 1, 215, 118, 141, 1, 246, 78, 141, 1, 217, 22, 141, 1, 
-    248, 90, 141, 1, 111, 141, 1, 247, 145, 141, 1, 197, 141, 1, 228, 233, 
-    141, 1, 227, 237, 141, 1, 229, 107, 141, 1, 228, 74, 141, 1, 162, 141, 1, 
-    252, 191, 141, 1, 190, 141, 1, 241, 180, 141, 1, 252, 6, 141, 1, 225, 
-    108, 141, 1, 240, 222, 141, 1, 251, 125, 141, 1, 224, 150, 141, 1, 241, 
-    238, 141, 1, 252, 75, 141, 1, 225, 221, 141, 1, 241, 68, 141, 1, 251, 
-    205, 141, 1, 225, 16, 141, 1, 184, 141, 1, 230, 230, 141, 1, 230, 102, 
-    141, 1, 231, 91, 141, 1, 230, 161, 141, 1, 4, 191, 141, 1, 191, 141, 1, 
-    4, 210, 212, 141, 1, 210, 212, 141, 1, 4, 210, 244, 141, 1, 210, 244, 
-    141, 1, 205, 141, 1, 223, 35, 141, 1, 222, 140, 141, 1, 223, 128, 141, 1, 
-    222, 211, 141, 1, 4, 212, 65, 141, 1, 212, 65, 141, 1, 211, 250, 141, 1, 
-    212, 22, 141, 1, 211, 227, 141, 1, 230, 25, 141, 1, 212, 116, 141, 1, 4, 
-    176, 141, 1, 4, 234, 182, 38, 234, 201, 213, 135, 219, 31, 78, 38, 234, 
-    201, 220, 155, 219, 31, 78, 234, 201, 213, 135, 219, 31, 78, 234, 201, 
-    220, 155, 219, 31, 78, 141, 235, 158, 78, 141, 213, 135, 235, 158, 78, 
-    141, 247, 221, 210, 225, 234, 201, 52, 240, 168, 56, 1, 4, 61, 56, 1, 61, 
-    56, 1, 4, 73, 56, 1, 73, 56, 1, 4, 70, 56, 1, 70, 56, 1, 4, 75, 56, 1, 
-    75, 56, 1, 4, 76, 56, 1, 76, 56, 1, 176, 56, 1, 243, 135, 56, 1, 234, 92, 
-    56, 1, 242, 214, 56, 1, 233, 217, 56, 1, 242, 113, 56, 1, 234, 182, 56, 
-    1, 243, 62, 56, 1, 234, 28, 56, 1, 242, 174, 56, 1, 206, 56, 1, 210, 116, 
-    56, 1, 219, 191, 56, 1, 210, 44, 56, 1, 218, 83, 56, 1, 210, 13, 56, 1, 
-    221, 181, 56, 1, 210, 94, 56, 1, 219, 58, 56, 1, 210, 23, 56, 1, 217, 
-    105, 56, 1, 248, 221, 56, 1, 216, 117, 56, 1, 248, 3, 56, 1, 4, 215, 118, 
-    56, 1, 215, 118, 56, 1, 246, 78, 56, 1, 217, 22, 56, 1, 248, 90, 56, 1, 
-    111, 56, 1, 247, 145, 56, 1, 197, 56, 1, 228, 233, 56, 1, 227, 237, 56, 
-    1, 229, 107, 56, 1, 228, 74, 56, 1, 162, 56, 1, 252, 191, 56, 1, 190, 56, 
-    1, 241, 180, 56, 1, 252, 6, 56, 1, 225, 108, 56, 1, 240, 222, 56, 1, 251, 
-    125, 56, 1, 224, 150, 56, 1, 241, 238, 56, 1, 252, 75, 56, 1, 225, 221, 
-    56, 1, 241, 68, 56, 1, 251, 205, 56, 1, 225, 16, 56, 1, 184, 56, 1, 230, 
-    230, 56, 1, 230, 102, 56, 1, 231, 91, 56, 1, 230, 161, 56, 1, 4, 191, 56, 
-    1, 191, 56, 1, 4, 210, 212, 56, 1, 210, 212, 56, 1, 4, 210, 244, 56, 1, 
-    210, 244, 56, 1, 205, 56, 1, 223, 35, 56, 1, 222, 140, 56, 1, 223, 128, 
-    56, 1, 222, 211, 56, 1, 4, 212, 65, 56, 1, 212, 65, 56, 1, 211, 250, 56, 
-    1, 212, 22, 56, 1, 211, 227, 56, 1, 230, 25, 56, 1, 212, 116, 56, 1, 4, 
-    176, 56, 1, 4, 234, 182, 56, 1, 214, 27, 56, 1, 213, 176, 56, 1, 213, 
-    255, 56, 1, 213, 138, 56, 230, 224, 247, 120, 234, 201, 224, 173, 219, 
-    31, 78, 56, 235, 158, 78, 56, 213, 135, 235, 158, 78, 56, 247, 221, 233, 
-    255, 251, 184, 1, 253, 158, 251, 184, 1, 226, 105, 251, 184, 1, 193, 251, 
-    184, 1, 245, 6, 251, 184, 1, 249, 60, 251, 184, 1, 217, 152, 251, 184, 1, 
-    230, 25, 251, 184, 1, 156, 251, 184, 1, 243, 202, 251, 184, 1, 235, 23, 
-    251, 184, 1, 242, 60, 251, 184, 1, 235, 144, 251, 184, 1, 224, 96, 251, 
-    184, 1, 211, 178, 251, 184, 1, 210, 83, 251, 184, 1, 250, 158, 251, 184, 
-    1, 220, 104, 251, 184, 1, 153, 251, 184, 1, 210, 159, 251, 184, 1, 251, 
-    66, 251, 184, 1, 222, 91, 251, 184, 1, 61, 251, 184, 1, 76, 251, 184, 1, 
-    75, 251, 184, 1, 245, 197, 251, 184, 1, 254, 201, 251, 184, 1, 245, 195, 
-    251, 184, 1, 253, 192, 251, 184, 1, 226, 134, 251, 184, 1, 254, 123, 251, 
-    184, 1, 245, 150, 251, 184, 1, 254, 115, 251, 184, 1, 245, 138, 251, 184, 
-    1, 245, 92, 251, 184, 1, 73, 251, 184, 1, 70, 251, 184, 1, 235, 156, 251, 
-    184, 1, 214, 105, 251, 184, 1, 229, 79, 251, 184, 1, 242, 178, 251, 184, 
-    1, 236, 34, 24, 1, 234, 58, 24, 1, 218, 215, 24, 1, 234, 51, 24, 1, 228, 
-    226, 24, 1, 228, 224, 24, 1, 228, 223, 24, 1, 216, 101, 24, 1, 218, 204, 
-    24, 1, 223, 26, 24, 1, 223, 21, 24, 1, 223, 18, 24, 1, 223, 11, 24, 1, 
-    223, 6, 24, 1, 223, 1, 24, 1, 223, 12, 24, 1, 223, 24, 24, 1, 230, 217, 
-    24, 1, 225, 95, 24, 1, 218, 212, 24, 1, 225, 84, 24, 1, 219, 148, 24, 1, 
-    218, 209, 24, 1, 236, 56, 24, 1, 250, 46, 24, 1, 218, 219, 24, 1, 250, 
-    106, 24, 1, 234, 110, 24, 1, 216, 173, 24, 1, 225, 131, 24, 1, 241, 172, 
-    24, 1, 61, 24, 1, 254, 243, 24, 1, 191, 24, 1, 211, 92, 24, 1, 245, 117, 
-    24, 1, 75, 24, 1, 211, 36, 24, 1, 211, 47, 24, 1, 76, 24, 1, 212, 65, 24, 
-    1, 212, 62, 24, 1, 226, 234, 24, 1, 210, 244, 24, 1, 70, 24, 1, 212, 11, 
-    24, 1, 212, 22, 24, 1, 211, 250, 24, 1, 210, 212, 24, 1, 245, 55, 24, 1, 
-    211, 8, 24, 1, 73, 24, 244, 103, 24, 1, 218, 213, 24, 1, 228, 216, 24, 1, 
-    228, 218, 24, 1, 228, 221, 24, 1, 223, 19, 24, 1, 223, 0, 24, 1, 223, 8, 
-    24, 1, 223, 13, 24, 1, 222, 254, 24, 1, 230, 210, 24, 1, 230, 207, 24, 1, 
-    230, 211, 24, 1, 234, 221, 24, 1, 225, 90, 24, 1, 225, 76, 24, 1, 225, 
-    82, 24, 1, 225, 79, 24, 1, 225, 93, 24, 1, 225, 77, 24, 1, 234, 219, 24, 
-    1, 234, 217, 24, 1, 219, 141, 24, 1, 219, 139, 24, 1, 219, 131, 24, 1, 
-    219, 136, 24, 1, 219, 146, 24, 1, 226, 32, 24, 1, 218, 216, 24, 1, 211, 
-    26, 24, 1, 211, 22, 24, 1, 211, 23, 24, 1, 234, 220, 24, 1, 218, 217, 24, 
-    1, 211, 32, 24, 1, 210, 238, 24, 1, 210, 237, 24, 1, 210, 240, 24, 1, 
-    210, 203, 24, 1, 210, 204, 24, 1, 210, 207, 24, 1, 254, 34, 24, 1, 254, 
-    28, 109, 254, 99, 232, 203, 78, 109, 254, 99, 223, 50, 78, 109, 254, 99, 
-    123, 78, 109, 254, 99, 113, 78, 109, 254, 99, 134, 78, 109, 254, 99, 244, 
-    11, 78, 109, 254, 99, 216, 14, 78, 109, 254, 99, 230, 224, 78, 109, 254, 
-    99, 251, 175, 78, 109, 254, 99, 244, 92, 78, 109, 254, 99, 221, 176, 78, 
-    109, 254, 99, 216, 169, 78, 109, 254, 99, 244, 4, 78, 109, 254, 99, 241, 
-    224, 78, 109, 254, 99, 245, 224, 78, 109, 254, 99, 231, 186, 78, 251, 
-    184, 1, 251, 125, 251, 184, 1, 210, 44, 251, 184, 1, 235, 108, 251, 184, 
-    1, 242, 113, 251, 184, 1, 245, 209, 251, 184, 1, 245, 135, 251, 184, 1, 
-    226, 183, 251, 184, 1, 226, 187, 251, 184, 1, 235, 179, 251, 184, 1, 254, 
-    101, 251, 184, 1, 235, 224, 251, 184, 1, 214, 168, 251, 184, 1, 236, 16, 
-    251, 184, 1, 229, 57, 251, 184, 1, 254, 195, 251, 184, 1, 253, 187, 251, 
-    184, 1, 254, 136, 251, 184, 1, 226, 204, 251, 184, 1, 226, 189, 251, 184, 
-    1, 235, 221, 251, 184, 40, 1, 226, 105, 251, 184, 40, 1, 217, 152, 251, 
-    184, 40, 1, 235, 23, 251, 184, 40, 1, 242, 60, 251, 184, 1, 242, 250, 
-    251, 184, 1, 232, 255, 251, 184, 1, 209, 250, 9, 218, 103, 217, 152, 9, 
-    218, 103, 212, 4, 9, 218, 103, 211, 158, 9, 218, 103, 251, 79, 9, 218, 
-    103, 217, 254, 9, 218, 103, 240, 158, 9, 218, 103, 240, 162, 9, 218, 103, 
-    240, 231, 9, 218, 103, 240, 159, 9, 218, 103, 217, 155, 9, 218, 103, 240, 
-    161, 9, 218, 103, 240, 157, 9, 218, 103, 240, 229, 9, 218, 103, 240, 160, 
-    9, 218, 103, 240, 156, 9, 218, 103, 230, 25, 9, 218, 103, 242, 60, 9, 
-    218, 103, 222, 91, 9, 218, 103, 226, 105, 9, 218, 103, 219, 21, 9, 218, 
-    103, 249, 60, 9, 218, 103, 240, 163, 9, 218, 103, 241, 190, 9, 218, 103, 
-    217, 164, 9, 218, 103, 217, 233, 9, 218, 103, 218, 168, 9, 218, 103, 220, 
-    110, 9, 218, 103, 225, 224, 9, 218, 103, 224, 98, 9, 218, 103, 216, 43, 
-    9, 218, 103, 217, 154, 9, 218, 103, 217, 244, 9, 218, 103, 240, 170, 9, 
-    218, 103, 240, 155, 9, 218, 103, 225, 149, 9, 218, 103, 224, 96, 56, 1, 
-    4, 233, 217, 56, 1, 4, 219, 191, 56, 1, 4, 218, 83, 56, 1, 4, 111, 56, 1, 
-    4, 227, 237, 56, 1, 4, 162, 56, 1, 4, 241, 180, 56, 1, 4, 240, 222, 56, 
-    1, 4, 241, 238, 56, 1, 4, 241, 68, 56, 1, 4, 230, 102, 56, 1, 4, 205, 56, 
-    1, 4, 223, 35, 56, 1, 4, 222, 140, 56, 1, 4, 223, 128, 56, 1, 4, 222, 
-    211, 88, 24, 234, 58, 88, 24, 228, 226, 88, 24, 216, 101, 88, 24, 223, 
-    26, 88, 24, 230, 217, 88, 24, 225, 95, 88, 24, 219, 148, 88, 24, 236, 56, 
-    88, 24, 250, 46, 88, 24, 250, 106, 88, 24, 234, 110, 88, 24, 216, 173, 
-    88, 24, 225, 131, 88, 24, 241, 172, 88, 24, 234, 59, 61, 88, 24, 228, 
-    227, 61, 88, 24, 216, 102, 61, 88, 24, 223, 27, 61, 88, 24, 230, 218, 61, 
-    88, 24, 225, 96, 61, 88, 24, 219, 149, 61, 88, 24, 236, 57, 61, 88, 24, 
-    250, 47, 61, 88, 24, 250, 107, 61, 88, 24, 234, 111, 61, 88, 24, 216, 
-    174, 61, 88, 24, 225, 132, 61, 88, 24, 241, 173, 61, 88, 24, 250, 47, 70, 
-    88, 234, 3, 135, 226, 217, 88, 234, 3, 135, 144, 240, 222, 88, 154, 110, 
-    88, 154, 105, 88, 154, 158, 88, 154, 161, 88, 154, 189, 88, 154, 194, 88, 
-    154, 198, 88, 154, 195, 88, 154, 200, 88, 154, 216, 247, 88, 154, 230, 
-    128, 88, 154, 244, 96, 88, 154, 212, 40, 88, 154, 211, 214, 88, 154, 231, 
-    39, 88, 154, 245, 223, 88, 154, 218, 37, 88, 154, 218, 132, 88, 154, 241, 
-    244, 88, 154, 219, 54, 88, 154, 229, 204, 88, 154, 219, 4, 88, 154, 244, 
-    102, 88, 154, 249, 200, 88, 154, 233, 125, 88, 154, 223, 71, 88, 154, 
-    251, 15, 88, 154, 218, 87, 88, 154, 218, 20, 88, 154, 245, 127, 88, 154, 
-    223, 63, 88, 154, 254, 150, 88, 154, 244, 128, 88, 154, 223, 61, 88, 154, 
-    220, 156, 88, 154, 223, 127, 37, 154, 224, 12, 37, 154, 234, 80, 37, 154, 
-    221, 198, 37, 154, 233, 255, 37, 54, 216, 248, 226, 197, 85, 218, 234, 
-    37, 54, 215, 74, 226, 197, 85, 218, 234, 37, 54, 216, 163, 226, 197, 85, 
-    218, 234, 37, 54, 244, 16, 226, 197, 85, 218, 234, 37, 54, 244, 115, 226, 
-    197, 85, 218, 234, 37, 54, 219, 112, 226, 197, 85, 218, 234, 37, 54, 220, 
-    117, 226, 197, 85, 218, 234, 37, 54, 245, 185, 226, 197, 85, 218, 234, 
-    225, 251, 50, 37, 54, 215, 74, 110, 37, 54, 215, 74, 105, 37, 54, 215, 
-    74, 158, 37, 54, 215, 74, 161, 37, 54, 215, 74, 189, 37, 54, 215, 74, 
-    194, 37, 54, 215, 74, 198, 37, 54, 215, 74, 195, 37, 54, 215, 74, 200, 
-    37, 54, 216, 162, 37, 54, 216, 163, 110, 37, 54, 216, 163, 105, 37, 54, 
-    216, 163, 158, 37, 54, 216, 163, 161, 37, 54, 216, 163, 189, 37, 24, 234, 
-    58, 37, 24, 228, 226, 37, 24, 216, 101, 37, 24, 223, 26, 37, 24, 230, 
-    217, 37, 24, 225, 95, 37, 24, 219, 148, 37, 24, 236, 56, 37, 24, 250, 46, 
-    37, 24, 250, 106, 37, 24, 234, 110, 37, 24, 216, 173, 37, 24, 225, 131, 
-    37, 24, 241, 172, 37, 24, 234, 59, 61, 37, 24, 228, 227, 61, 37, 24, 216, 
-    102, 61, 37, 24, 223, 27, 61, 37, 24, 230, 218, 61, 37, 24, 225, 96, 61, 
-    37, 24, 219, 149, 61, 37, 24, 236, 57, 61, 37, 24, 250, 47, 61, 37, 24, 
-    250, 107, 61, 37, 24, 234, 111, 61, 37, 24, 216, 174, 61, 37, 24, 225, 
-    132, 61, 37, 24, 241, 173, 61, 37, 234, 3, 135, 250, 148, 37, 234, 3, 
-    135, 235, 47, 37, 24, 236, 57, 70, 234, 3, 218, 159, 87, 37, 154, 110, 
-    37, 154, 105, 37, 154, 158, 37, 154, 161, 37, 154, 189, 37, 154, 194, 37, 
-    154, 198, 37, 154, 195, 37, 154, 200, 37, 154, 216, 247, 37, 154, 230, 
-    128, 37, 154, 244, 96, 37, 154, 212, 40, 37, 154, 211, 214, 37, 154, 231, 
-    39, 37, 154, 245, 223, 37, 154, 218, 37, 37, 154, 218, 132, 37, 154, 241, 
-    244, 37, 154, 219, 54, 37, 154, 229, 204, 37, 154, 219, 4, 37, 154, 244, 
-    102, 37, 154, 249, 200, 37, 154, 233, 125, 37, 154, 221, 174, 37, 154, 
-    231, 189, 37, 154, 244, 137, 37, 154, 218, 49, 37, 154, 245, 34, 37, 154, 
-    224, 187, 37, 154, 253, 196, 37, 154, 235, 159, 37, 154, 223, 61, 37, 
-    154, 249, 164, 37, 154, 249, 155, 37, 154, 241, 165, 37, 154, 250, 174, 
-    37, 154, 232, 110, 37, 154, 233, 46, 37, 154, 222, 251, 37, 154, 231, 83, 
-    37, 154, 223, 87, 37, 154, 218, 87, 37, 154, 218, 20, 37, 154, 245, 127, 
-    37, 154, 223, 63, 37, 154, 254, 150, 37, 154, 228, 212, 37, 54, 216, 163, 
-    194, 37, 54, 216, 163, 198, 37, 54, 216, 163, 195, 37, 54, 216, 163, 200, 
-    37, 54, 244, 15, 37, 54, 244, 16, 110, 37, 54, 244, 16, 105, 37, 54, 244, 
-    16, 158, 37, 54, 244, 16, 161, 37, 54, 244, 16, 189, 37, 54, 244, 16, 
-    194, 37, 54, 244, 16, 198, 37, 54, 244, 16, 195, 37, 54, 244, 16, 200, 
-    37, 54, 244, 114, 109, 217, 3, 16, 31, 235, 133, 109, 217, 3, 16, 31, 
-    244, 148, 109, 217, 3, 16, 31, 231, 160, 109, 217, 3, 16, 31, 254, 47, 
-    109, 217, 3, 16, 31, 231, 132, 109, 217, 3, 16, 31, 235, 45, 109, 217, 3, 
-    16, 31, 235, 46, 109, 217, 3, 16, 31, 253, 188, 109, 217, 3, 16, 31, 220, 
-    136, 109, 217, 3, 16, 31, 226, 239, 109, 217, 3, 16, 31, 228, 40, 109, 
-    217, 3, 16, 31, 248, 85, 42, 241, 190, 42, 245, 88, 42, 245, 43, 232, 
-    219, 232, 240, 50, 37, 56, 61, 37, 56, 73, 37, 56, 70, 37, 56, 75, 37, 
-    56, 76, 37, 56, 176, 37, 56, 234, 92, 37, 56, 233, 217, 37, 56, 234, 182, 
-    37, 56, 234, 28, 37, 56, 206, 37, 56, 219, 191, 37, 56, 218, 83, 37, 56, 
-    221, 181, 37, 56, 219, 58, 37, 56, 217, 105, 37, 56, 216, 117, 37, 56, 
-    215, 118, 37, 56, 217, 22, 37, 56, 111, 37, 56, 197, 37, 56, 228, 233, 
-    37, 56, 227, 237, 37, 56, 229, 107, 37, 56, 228, 74, 37, 56, 162, 37, 56, 
-    241, 180, 37, 56, 240, 222, 37, 56, 241, 238, 37, 56, 241, 68, 37, 56, 
-    184, 37, 56, 230, 230, 37, 56, 230, 102, 37, 56, 231, 91, 37, 56, 230, 
-    161, 37, 56, 191, 37, 56, 210, 212, 37, 56, 210, 244, 37, 56, 205, 37, 
-    56, 223, 35, 37, 56, 222, 140, 37, 56, 223, 128, 37, 56, 222, 211, 37, 
-    56, 212, 65, 37, 56, 211, 250, 37, 56, 212, 22, 37, 56, 211, 227, 42, 
-    254, 71, 42, 253, 239, 42, 254, 95, 42, 255, 31, 42, 235, 226, 42, 235, 
-    196, 42, 214, 166, 42, 245, 66, 42, 245, 206, 42, 226, 186, 42, 226, 180, 
-    42, 234, 245, 42, 234, 214, 42, 234, 211, 42, 243, 92, 42, 243, 101, 42, 
-    242, 204, 42, 242, 200, 42, 233, 150, 42, 242, 193, 42, 234, 72, 42, 234, 
-    71, 42, 234, 70, 42, 234, 69, 42, 242, 86, 42, 242, 85, 42, 233, 193, 42, 
-    233, 195, 42, 234, 178, 42, 234, 1, 42, 234, 8, 42, 222, 16, 42, 221, 
-    237, 42, 219, 129, 42, 220, 141, 42, 220, 140, 42, 248, 218, 42, 248, 36, 
-    42, 247, 121, 42, 216, 32, 42, 229, 200, 42, 228, 41, 42, 242, 32, 42, 
-    226, 84, 42, 226, 83, 42, 252, 188, 42, 225, 105, 42, 225, 69, 42, 225, 
-    70, 42, 251, 234, 42, 240, 221, 42, 240, 217, 42, 251, 91, 42, 240, 204, 
-    42, 241, 215, 42, 225, 159, 42, 225, 194, 42, 241, 198, 42, 225, 191, 42, 
-    225, 207, 42, 252, 61, 42, 225, 6, 42, 251, 180, 42, 241, 56, 42, 224, 
-    250, 42, 241, 48, 42, 241, 50, 42, 231, 201, 42, 231, 197, 42, 231, 206, 
-    42, 231, 150, 42, 231, 175, 42, 230, 197, 42, 230, 176, 42, 230, 175, 42, 
-    231, 74, 42, 231, 71, 42, 231, 75, 42, 211, 102, 42, 211, 100, 42, 210, 
-    201, 42, 222, 226, 42, 222, 230, 42, 222, 117, 42, 222, 111, 42, 223, 85, 
-    42, 223, 82, 42, 212, 38, 109, 217, 3, 16, 31, 240, 239, 210, 86, 109, 
-    217, 3, 16, 31, 240, 239, 110, 109, 217, 3, 16, 31, 240, 239, 105, 109, 
-    217, 3, 16, 31, 240, 239, 158, 109, 217, 3, 16, 31, 240, 239, 161, 109, 
-    217, 3, 16, 31, 240, 239, 189, 109, 217, 3, 16, 31, 240, 239, 194, 109, 
-    217, 3, 16, 31, 240, 239, 198, 109, 217, 3, 16, 31, 240, 239, 195, 109, 
-    217, 3, 16, 31, 240, 239, 200, 109, 217, 3, 16, 31, 240, 239, 216, 247, 
-    109, 217, 3, 16, 31, 240, 239, 245, 167, 109, 217, 3, 16, 31, 240, 239, 
-    215, 76, 109, 217, 3, 16, 31, 240, 239, 216, 164, 109, 217, 3, 16, 31, 
-    240, 239, 244, 5, 109, 217, 3, 16, 31, 240, 239, 244, 118, 109, 217, 3, 
-    16, 31, 240, 239, 219, 119, 109, 217, 3, 16, 31, 240, 239, 220, 119, 109, 
-    217, 3, 16, 31, 240, 239, 245, 190, 109, 217, 3, 16, 31, 240, 239, 228, 
-    197, 109, 217, 3, 16, 31, 240, 239, 215, 73, 109, 217, 3, 16, 31, 240, 
-    239, 215, 67, 109, 217, 3, 16, 31, 240, 239, 215, 63, 109, 217, 3, 16, 
-    31, 240, 239, 215, 64, 109, 217, 3, 16, 31, 240, 239, 215, 69, 42, 240, 
-    230, 42, 248, 221, 42, 253, 192, 42, 130, 42, 226, 125, 42, 225, 225, 42, 
-    247, 147, 42, 247, 148, 218, 233, 42, 247, 148, 249, 108, 42, 235, 156, 
-    42, 245, 91, 229, 205, 241, 216, 42, 245, 91, 229, 205, 217, 174, 42, 
-    245, 91, 229, 205, 217, 74, 42, 245, 91, 229, 205, 231, 70, 42, 249, 157, 
-    42, 226, 90, 254, 125, 42, 197, 42, 230, 103, 61, 42, 184, 42, 176, 42, 
-    234, 185, 42, 231, 129, 42, 243, 80, 42, 251, 18, 42, 234, 184, 42, 225, 
-    150, 42, 229, 81, 42, 230, 103, 245, 6, 42, 230, 103, 243, 202, 42, 231, 
-    15, 42, 234, 134, 42, 240, 163, 42, 234, 94, 42, 230, 232, 42, 242, 216, 
-    42, 216, 119, 42, 230, 103, 156, 42, 230, 169, 42, 247, 157, 42, 234, 40, 
-    42, 244, 45, 42, 228, 112, 42, 230, 103, 193, 42, 230, 166, 42, 249, 239, 
-    42, 234, 34, 42, 230, 167, 218, 233, 42, 249, 240, 218, 233, 42, 232, 50, 
-    218, 233, 42, 234, 35, 218, 233, 42, 230, 167, 249, 108, 42, 249, 240, 
-    249, 108, 42, 232, 50, 249, 108, 42, 234, 35, 249, 108, 42, 232, 50, 117, 
-    222, 91, 42, 232, 50, 117, 222, 92, 218, 233, 42, 190, 42, 233, 251, 42, 
-    230, 105, 42, 242, 151, 42, 223, 176, 42, 223, 177, 117, 222, 91, 42, 
-    223, 177, 117, 222, 92, 218, 233, 42, 224, 162, 42, 228, 13, 42, 230, 
-    103, 222, 91, 42, 230, 104, 42, 224, 116, 42, 227, 176, 42, 230, 103, 
-    214, 105, 42, 230, 49, 42, 233, 185, 42, 230, 50, 231, 74, 42, 224, 115, 
-    42, 227, 175, 42, 230, 103, 212, 98, 42, 230, 43, 42, 233, 183, 42, 230, 
-    44, 231, 74, 42, 235, 24, 226, 220, 42, 232, 50, 226, 220, 42, 254, 136, 
-    42, 251, 160, 42, 250, 214, 42, 250, 191, 42, 251, 67, 117, 234, 134, 42, 
-    249, 238, 42, 248, 142, 42, 242, 72, 42, 162, 42, 240, 231, 42, 235, 255, 
-    42, 234, 47, 42, 234, 35, 250, 250, 42, 233, 219, 42, 232, 159, 42, 232, 
-    158, 42, 232, 147, 42, 232, 63, 42, 231, 130, 219, 79, 42, 230, 196, 42, 
-    230, 152, 42, 225, 148, 42, 225, 19, 42, 224, 219, 42, 224, 217, 42, 218, 
-    227, 42, 218, 2, 42, 212, 24, 42, 214, 106, 117, 193, 42, 115, 117, 193, 
-    109, 217, 3, 16, 31, 248, 146, 110, 109, 217, 3, 16, 31, 248, 146, 105, 
-    109, 217, 3, 16, 31, 248, 146, 158, 109, 217, 3, 16, 31, 248, 146, 161, 
-    109, 217, 3, 16, 31, 248, 146, 189, 109, 217, 3, 16, 31, 248, 146, 194, 
-    109, 217, 3, 16, 31, 248, 146, 198, 109, 217, 3, 16, 31, 248, 146, 195, 
-    109, 217, 3, 16, 31, 248, 146, 200, 109, 217, 3, 16, 31, 248, 146, 216, 
-    247, 109, 217, 3, 16, 31, 248, 146, 245, 167, 109, 217, 3, 16, 31, 248, 
-    146, 215, 76, 109, 217, 3, 16, 31, 248, 146, 216, 164, 109, 217, 3, 16, 
-    31, 248, 146, 244, 5, 109, 217, 3, 16, 31, 248, 146, 244, 118, 109, 217, 
-    3, 16, 31, 248, 146, 219, 119, 109, 217, 3, 16, 31, 248, 146, 220, 119, 
-    109, 217, 3, 16, 31, 248, 146, 245, 190, 109, 217, 3, 16, 31, 248, 146, 
-    228, 197, 109, 217, 3, 16, 31, 248, 146, 215, 73, 109, 217, 3, 16, 31, 
-    248, 146, 215, 67, 109, 217, 3, 16, 31, 248, 146, 215, 63, 109, 217, 3, 
-    16, 31, 248, 146, 215, 64, 109, 217, 3, 16, 31, 248, 146, 215, 69, 109, 
-    217, 3, 16, 31, 248, 146, 215, 70, 109, 217, 3, 16, 31, 248, 146, 215, 
-    65, 109, 217, 3, 16, 31, 248, 146, 215, 66, 109, 217, 3, 16, 31, 248, 
-    146, 215, 72, 109, 217, 3, 16, 31, 248, 146, 215, 68, 109, 217, 3, 16, 
-    31, 248, 146, 216, 162, 109, 217, 3, 16, 31, 248, 146, 216, 161, 42, 243, 
-    118, 241, 192, 31, 216, 196, 249, 140, 241, 223, 241, 192, 31, 216, 196, 
-    223, 122, 245, 223, 241, 192, 31, 247, 231, 253, 207, 216, 196, 252, 56, 
-    241, 192, 31, 210, 223, 244, 38, 241, 192, 31, 212, 59, 241, 192, 31, 
-    249, 203, 241, 192, 31, 216, 196, 254, 3, 241, 192, 31, 241, 60, 216, 38, 
-    241, 192, 31, 4, 217, 61, 241, 192, 31, 215, 237, 241, 192, 31, 225, 219, 
-    241, 192, 31, 218, 158, 241, 192, 31, 244, 139, 241, 192, 31, 242, 132, 
-    224, 240, 241, 192, 31, 230, 155, 241, 192, 31, 245, 126, 241, 192, 31, 
-    244, 39, 241, 192, 31, 211, 207, 226, 197, 216, 196, 248, 86, 241, 192, 
-    31, 254, 51, 241, 192, 31, 249, 185, 241, 192, 31, 251, 227, 216, 138, 
-    241, 192, 31, 242, 149, 241, 192, 31, 218, 245, 254, 70, 241, 192, 31, 
-    223, 53, 241, 192, 31, 235, 220, 241, 192, 31, 242, 132, 217, 61, 241, 
-    192, 31, 230, 111, 249, 159, 241, 192, 31, 242, 132, 224, 197, 241, 192, 
-    31, 216, 196, 255, 18, 212, 40, 241, 192, 31, 216, 196, 250, 8, 244, 96, 
-    241, 192, 31, 235, 233, 241, 192, 31, 246, 57, 241, 192, 31, 223, 56, 
-    241, 192, 31, 242, 132, 224, 224, 241, 192, 31, 224, 177, 241, 192, 31, 
-    248, 161, 64, 216, 196, 232, 230, 241, 192, 31, 216, 196, 244, 174, 241, 
-    192, 31, 226, 163, 241, 192, 31, 226, 244, 241, 192, 31, 248, 59, 241, 
-    192, 31, 248, 79, 241, 192, 31, 235, 247, 241, 192, 31, 251, 149, 241, 
-    192, 31, 249, 221, 216, 42, 231, 76, 241, 192, 31, 243, 87, 216, 38, 241, 
-    192, 31, 224, 125, 214, 154, 241, 192, 31, 226, 162, 241, 192, 31, 216, 
-    196, 212, 13, 241, 192, 31, 223, 45, 241, 192, 31, 216, 196, 250, 220, 
-    241, 192, 31, 216, 196, 253, 255, 216, 133, 241, 192, 31, 216, 196, 234, 
-    179, 218, 134, 230, 115, 241, 192, 31, 248, 32, 241, 192, 31, 216, 196, 
-    231, 152, 231, 202, 241, 192, 31, 255, 19, 241, 192, 31, 216, 196, 212, 
-    54, 241, 192, 31, 216, 196, 243, 47, 211, 239, 241, 192, 31, 216, 196, 
-    235, 52, 233, 107, 241, 192, 31, 247, 184, 241, 192, 31, 232, 220, 241, 
-    192, 31, 235, 223, 215, 187, 241, 192, 31, 4, 224, 197, 241, 192, 31, 
-    254, 217, 249, 212, 241, 192, 31, 252, 59, 249, 212, 8, 3, 235, 160, 8, 
-    3, 235, 153, 8, 3, 73, 8, 3, 235, 182, 8, 3, 236, 58, 8, 3, 236, 41, 8, 
-    3, 236, 60, 8, 3, 236, 59, 8, 3, 253, 206, 8, 3, 253, 169, 8, 3, 61, 8, 
-    3, 254, 72, 8, 3, 214, 164, 8, 3, 214, 167, 8, 3, 214, 165, 8, 3, 226, 
-    140, 8, 3, 226, 114, 8, 3, 76, 8, 3, 226, 175, 8, 3, 245, 35, 8, 3, 75, 
-    8, 3, 211, 195, 8, 3, 251, 228, 8, 3, 251, 225, 8, 3, 252, 6, 8, 3, 251, 
-    238, 8, 3, 251, 251, 8, 3, 251, 250, 8, 3, 251, 253, 8, 3, 251, 252, 8, 
-    3, 252, 121, 8, 3, 252, 113, 8, 3, 252, 191, 8, 3, 252, 142, 8, 3, 251, 
-    101, 8, 3, 251, 105, 8, 3, 251, 102, 8, 3, 251, 179, 8, 3, 251, 163, 8, 
-    3, 251, 205, 8, 3, 251, 185, 8, 3, 252, 21, 8, 3, 252, 75, 8, 3, 252, 33, 
-    8, 3, 251, 87, 8, 3, 251, 84, 8, 3, 251, 125, 8, 3, 251, 100, 8, 3, 251, 
-    94, 8, 3, 251, 98, 8, 3, 251, 72, 8, 3, 251, 70, 8, 3, 251, 77, 8, 3, 
-    251, 75, 8, 3, 251, 73, 8, 3, 251, 74, 8, 3, 225, 49, 8, 3, 225, 45, 8, 
-    3, 225, 108, 8, 3, 225, 59, 8, 3, 225, 75, 8, 3, 225, 102, 8, 3, 225, 98, 
-    8, 3, 225, 240, 8, 3, 225, 230, 8, 3, 190, 8, 3, 226, 21, 8, 3, 224, 135, 
-    8, 3, 224, 137, 8, 3, 224, 136, 8, 3, 224, 233, 8, 3, 224, 222, 8, 3, 
-    225, 16, 8, 3, 224, 245, 8, 3, 224, 121, 8, 3, 224, 117, 8, 3, 224, 150, 
-    8, 3, 224, 134, 8, 3, 224, 126, 8, 3, 224, 132, 8, 3, 224, 100, 8, 3, 
-    224, 99, 8, 3, 224, 104, 8, 3, 224, 103, 8, 3, 224, 101, 8, 3, 224, 102, 
-    8, 3, 252, 96, 8, 3, 252, 95, 8, 3, 252, 102, 8, 3, 252, 97, 8, 3, 252, 
-    99, 8, 3, 252, 98, 8, 3, 252, 101, 8, 3, 252, 100, 8, 3, 252, 108, 8, 3, 
-    252, 107, 8, 3, 252, 111, 8, 3, 252, 109, 8, 3, 252, 87, 8, 3, 252, 89, 
-    8, 3, 252, 88, 8, 3, 252, 92, 8, 3, 252, 91, 8, 3, 252, 94, 8, 3, 252, 
-    93, 8, 3, 252, 103, 8, 3, 252, 106, 8, 3, 252, 104, 8, 3, 252, 83, 8, 3, 
-    252, 82, 8, 3, 252, 90, 8, 3, 252, 86, 8, 3, 252, 84, 8, 3, 252, 85, 8, 
-    3, 252, 79, 8, 3, 252, 78, 8, 3, 252, 81, 8, 3, 252, 80, 8, 3, 229, 169, 
-    8, 3, 229, 168, 8, 3, 229, 174, 8, 3, 229, 170, 8, 3, 229, 171, 8, 3, 
-    229, 173, 8, 3, 229, 172, 8, 3, 229, 177, 8, 3, 229, 176, 8, 3, 229, 179, 
-    8, 3, 229, 178, 8, 3, 229, 165, 8, 3, 229, 164, 8, 3, 229, 167, 8, 3, 
-    229, 166, 8, 3, 229, 158, 8, 3, 229, 157, 8, 3, 229, 162, 8, 3, 229, 161, 
-    8, 3, 229, 159, 8, 3, 229, 160, 8, 3, 229, 152, 8, 3, 229, 151, 8, 3, 
-    229, 156, 8, 3, 229, 155, 8, 3, 229, 153, 8, 3, 229, 154, 8, 3, 241, 110, 
-    8, 3, 241, 109, 8, 3, 241, 115, 8, 3, 241, 111, 8, 3, 241, 112, 8, 3, 
-    241, 114, 8, 3, 241, 113, 8, 3, 241, 118, 8, 3, 241, 117, 8, 3, 241, 120, 
-    8, 3, 241, 119, 8, 3, 241, 101, 8, 3, 241, 103, 8, 3, 241, 102, 8, 3, 
-    241, 106, 8, 3, 241, 105, 8, 3, 241, 108, 8, 3, 241, 107, 8, 3, 241, 97, 
-    8, 3, 241, 96, 8, 3, 241, 104, 8, 3, 241, 100, 8, 3, 241, 98, 8, 3, 241, 
-    99, 8, 3, 241, 91, 8, 3, 241, 95, 8, 3, 241, 94, 8, 3, 241, 92, 8, 3, 
-    241, 93, 8, 3, 230, 172, 8, 3, 230, 171, 8, 3, 230, 230, 8, 3, 230, 178, 
-    8, 3, 230, 203, 8, 3, 230, 221, 8, 3, 230, 219, 8, 3, 231, 139, 8, 3, 
-    231, 134, 8, 3, 184, 8, 3, 231, 172, 8, 3, 230, 74, 8, 3, 230, 73, 8, 3, 
-    230, 77, 8, 3, 230, 75, 8, 3, 230, 121, 8, 3, 230, 107, 8, 3, 230, 161, 
-    8, 3, 230, 126, 8, 3, 231, 26, 8, 3, 231, 91, 8, 3, 230, 55, 8, 3, 230, 
-    51, 8, 3, 230, 102, 8, 3, 230, 70, 8, 3, 230, 63, 8, 3, 230, 68, 8, 3, 
-    230, 28, 8, 3, 230, 27, 8, 3, 230, 33, 8, 3, 230, 30, 8, 3, 244, 83, 8, 
-    3, 244, 78, 8, 3, 244, 121, 8, 3, 244, 98, 8, 3, 244, 167, 8, 3, 244, 
-    158, 8, 3, 244, 196, 8, 3, 244, 170, 8, 3, 244, 3, 8, 3, 244, 43, 8, 3, 
-    244, 27, 8, 3, 243, 218, 8, 3, 243, 217, 8, 3, 243, 234, 8, 3, 243, 223, 
-    8, 3, 243, 221, 8, 3, 243, 222, 8, 3, 243, 205, 8, 3, 243, 204, 8, 3, 
-    243, 208, 8, 3, 243, 206, 8, 3, 213, 144, 8, 3, 213, 139, 8, 3, 213, 176, 
-    8, 3, 213, 153, 8, 3, 213, 166, 8, 3, 213, 163, 8, 3, 213, 168, 8, 3, 
-    213, 167, 8, 3, 214, 7, 8, 3, 214, 2, 8, 3, 214, 27, 8, 3, 214, 18, 8, 3, 
-    213, 125, 8, 3, 213, 121, 8, 3, 213, 138, 8, 3, 213, 126, 8, 3, 213, 178, 
-    8, 3, 213, 244, 8, 3, 212, 110, 8, 3, 212, 108, 8, 3, 212, 116, 8, 3, 
-    212, 113, 8, 3, 212, 111, 8, 3, 212, 112, 8, 3, 212, 102, 8, 3, 212, 101, 
-    8, 3, 212, 106, 8, 3, 212, 105, 8, 3, 212, 103, 8, 3, 212, 104, 8, 3, 
-    247, 178, 8, 3, 247, 166, 8, 3, 248, 3, 8, 3, 247, 203, 8, 3, 247, 236, 
-    8, 3, 247, 240, 8, 3, 247, 239, 8, 3, 248, 152, 8, 3, 248, 147, 8, 3, 
-    248, 221, 8, 3, 248, 172, 8, 3, 246, 62, 8, 3, 246, 63, 8, 3, 247, 120, 
-    8, 3, 246, 102, 8, 3, 247, 145, 8, 3, 247, 122, 8, 3, 248, 30, 8, 3, 248, 
-    90, 8, 3, 248, 45, 8, 3, 246, 53, 8, 3, 246, 51, 8, 3, 246, 78, 8, 3, 
-    246, 61, 8, 3, 246, 56, 8, 3, 246, 59, 8, 3, 216, 67, 8, 3, 216, 61, 8, 
-    3, 216, 117, 8, 3, 216, 76, 8, 3, 216, 109, 8, 3, 216, 111, 8, 3, 216, 
-    110, 8, 3, 217, 46, 8, 3, 217, 33, 8, 3, 217, 105, 8, 3, 217, 54, 8, 3, 
-    215, 102, 8, 3, 215, 101, 8, 3, 215, 104, 8, 3, 215, 103, 8, 3, 216, 5, 
-    8, 3, 216, 1, 8, 3, 111, 8, 3, 216, 13, 8, 3, 216, 213, 8, 3, 217, 22, 8, 
-    3, 216, 237, 8, 3, 215, 88, 8, 3, 215, 83, 8, 3, 215, 118, 8, 3, 215, 
-    100, 8, 3, 215, 89, 8, 3, 215, 98, 8, 3, 248, 107, 8, 3, 248, 106, 8, 3, 
-    248, 112, 8, 3, 248, 108, 8, 3, 248, 109, 8, 3, 248, 111, 8, 3, 248, 110, 
-    8, 3, 248, 128, 8, 3, 248, 127, 8, 3, 248, 135, 8, 3, 248, 129, 8, 3, 
-    248, 97, 8, 3, 248, 99, 8, 3, 248, 98, 8, 3, 248, 102, 8, 3, 248, 101, 8, 
-    3, 248, 105, 8, 3, 248, 103, 8, 3, 248, 120, 8, 3, 248, 123, 8, 3, 248, 
-    121, 8, 3, 248, 93, 8, 3, 248, 92, 8, 3, 248, 100, 8, 3, 248, 96, 8, 3, 
-    248, 94, 8, 3, 248, 95, 8, 3, 229, 126, 8, 3, 229, 125, 8, 3, 229, 133, 
-    8, 3, 229, 128, 8, 3, 229, 129, 8, 3, 229, 130, 8, 3, 229, 142, 8, 3, 
-    229, 141, 8, 3, 229, 148, 8, 3, 229, 143, 8, 3, 229, 118, 8, 3, 229, 117, 
-    8, 3, 229, 124, 8, 3, 229, 119, 8, 3, 229, 134, 8, 3, 229, 140, 8, 3, 
-    229, 138, 8, 3, 229, 110, 8, 3, 229, 109, 8, 3, 229, 115, 8, 3, 229, 113, 
-    8, 3, 229, 111, 8, 3, 229, 112, 8, 3, 241, 77, 8, 3, 241, 76, 8, 3, 241, 
-    83, 8, 3, 241, 78, 8, 3, 241, 80, 8, 3, 241, 79, 8, 3, 241, 82, 8, 3, 
-    241, 81, 8, 3, 241, 88, 8, 3, 241, 87, 8, 3, 241, 90, 8, 3, 241, 89, 8, 
-    3, 241, 71, 8, 3, 241, 72, 8, 3, 241, 74, 8, 3, 241, 73, 8, 3, 241, 75, 
-    8, 3, 241, 84, 8, 3, 241, 86, 8, 3, 241, 85, 8, 3, 241, 70, 8, 3, 228, 
-    189, 8, 3, 228, 187, 8, 3, 228, 233, 8, 3, 228, 192, 8, 3, 228, 215, 8, 
-    3, 228, 229, 8, 3, 228, 228, 8, 3, 229, 183, 8, 3, 197, 8, 3, 229, 197, 
-    8, 3, 227, 186, 8, 3, 227, 188, 8, 3, 227, 187, 8, 3, 228, 51, 8, 3, 228, 
-    38, 8, 3, 228, 74, 8, 3, 228, 60, 8, 3, 229, 83, 8, 3, 229, 107, 8, 3, 
-    229, 94, 8, 3, 227, 181, 8, 3, 227, 177, 8, 3, 227, 237, 8, 3, 227, 185, 
-    8, 3, 227, 183, 8, 3, 227, 184, 8, 3, 241, 141, 8, 3, 241, 140, 8, 3, 
-    241, 146, 8, 3, 241, 142, 8, 3, 241, 143, 8, 3, 241, 145, 8, 3, 241, 144, 
-    8, 3, 241, 151, 8, 3, 241, 150, 8, 3, 241, 153, 8, 3, 241, 152, 8, 3, 
-    241, 133, 8, 3, 241, 135, 8, 3, 241, 134, 8, 3, 241, 137, 8, 3, 241, 139, 
-    8, 3, 241, 138, 8, 3, 241, 147, 8, 3, 241, 149, 8, 3, 241, 148, 8, 3, 
-    241, 129, 8, 3, 241, 128, 8, 3, 241, 136, 8, 3, 241, 132, 8, 3, 241, 130, 
-    8, 3, 241, 131, 8, 3, 241, 123, 8, 3, 241, 122, 8, 3, 241, 127, 8, 3, 
-    241, 126, 8, 3, 241, 124, 8, 3, 241, 125, 8, 3, 232, 195, 8, 3, 232, 189, 
-    8, 3, 232, 241, 8, 3, 232, 202, 8, 3, 232, 233, 8, 3, 232, 232, 8, 3, 
-    232, 236, 8, 3, 232, 234, 8, 3, 233, 79, 8, 3, 233, 69, 8, 3, 233, 135, 
-    8, 3, 233, 88, 8, 3, 232, 79, 8, 3, 232, 78, 8, 3, 232, 81, 8, 3, 232, 
-    80, 8, 3, 232, 116, 8, 3, 232, 106, 8, 3, 232, 156, 8, 3, 232, 120, 8, 3, 
-    233, 2, 8, 3, 233, 58, 8, 3, 233, 17, 8, 3, 232, 74, 8, 3, 232, 72, 8, 3, 
-    232, 98, 8, 3, 232, 77, 8, 3, 232, 75, 8, 3, 232, 76, 8, 3, 232, 54, 8, 
-    3, 232, 53, 8, 3, 232, 62, 8, 3, 232, 57, 8, 3, 232, 55, 8, 3, 232, 56, 
-    8, 3, 242, 189, 8, 3, 242, 188, 8, 3, 242, 214, 8, 3, 242, 199, 8, 3, 
-    242, 206, 8, 3, 242, 205, 8, 3, 242, 208, 8, 3, 242, 207, 8, 3, 243, 89, 
-    8, 3, 243, 84, 8, 3, 243, 135, 8, 3, 243, 99, 8, 3, 242, 91, 8, 3, 242, 
-    90, 8, 3, 242, 93, 8, 3, 242, 92, 8, 3, 242, 154, 8, 3, 242, 152, 8, 3, 
-    242, 174, 8, 3, 242, 162, 8, 3, 243, 33, 8, 3, 243, 31, 8, 3, 243, 62, 8, 
-    3, 243, 44, 8, 3, 242, 81, 8, 3, 242, 80, 8, 3, 242, 113, 8, 3, 242, 89, 
-    8, 3, 242, 82, 8, 3, 242, 88, 8, 3, 234, 61, 8, 3, 234, 60, 8, 3, 234, 
-    92, 8, 3, 234, 75, 8, 3, 234, 85, 8, 3, 234, 88, 8, 3, 234, 86, 8, 3, 
-    234, 202, 8, 3, 234, 190, 8, 3, 176, 8, 3, 234, 228, 8, 3, 233, 200, 8, 
-    3, 233, 205, 8, 3, 233, 202, 8, 3, 234, 0, 8, 3, 233, 252, 8, 3, 234, 28, 
-    8, 3, 234, 7, 8, 3, 234, 156, 8, 3, 234, 140, 8, 3, 234, 182, 8, 3, 234, 
-    159, 8, 3, 233, 189, 8, 3, 233, 186, 8, 3, 233, 217, 8, 3, 233, 199, 8, 
-    3, 233, 192, 8, 3, 233, 196, 8, 3, 243, 15, 8, 3, 243, 14, 8, 3, 243, 19, 
-    8, 3, 243, 16, 8, 3, 243, 18, 8, 3, 243, 17, 8, 3, 243, 26, 8, 3, 243, 
-    25, 8, 3, 243, 29, 8, 3, 243, 27, 8, 3, 243, 6, 8, 3, 243, 5, 8, 3, 243, 
-    8, 8, 3, 243, 7, 8, 3, 243, 11, 8, 3, 243, 10, 8, 3, 243, 13, 8, 3, 243, 
-    12, 8, 3, 243, 21, 8, 3, 243, 20, 8, 3, 243, 24, 8, 3, 243, 22, 8, 3, 
-    243, 1, 8, 3, 243, 0, 8, 3, 243, 9, 8, 3, 243, 4, 8, 3, 243, 2, 8, 3, 
-    243, 3, 8, 3, 230, 249, 8, 3, 230, 250, 8, 3, 231, 12, 8, 3, 231, 11, 8, 
-    3, 231, 14, 8, 3, 231, 13, 8, 3, 230, 240, 8, 3, 230, 242, 8, 3, 230, 
-    241, 8, 3, 230, 245, 8, 3, 230, 244, 8, 3, 230, 247, 8, 3, 230, 246, 8, 
-    3, 230, 251, 8, 3, 230, 253, 8, 3, 230, 252, 8, 3, 230, 236, 8, 3, 230, 
-    235, 8, 3, 230, 243, 8, 3, 230, 239, 8, 3, 230, 237, 8, 3, 230, 238, 8, 
-    3, 240, 180, 8, 3, 240, 179, 8, 3, 240, 186, 8, 3, 240, 181, 8, 3, 240, 
-    183, 8, 3, 240, 182, 8, 3, 240, 185, 8, 3, 240, 184, 8, 3, 240, 191, 8, 
-    3, 240, 190, 8, 3, 240, 193, 8, 3, 240, 192, 8, 3, 240, 172, 8, 3, 240, 
-    171, 8, 3, 240, 174, 8, 3, 240, 173, 8, 3, 240, 176, 8, 3, 240, 175, 8, 
-    3, 240, 178, 8, 3, 240, 177, 8, 3, 240, 187, 8, 3, 240, 189, 8, 3, 240, 
-    188, 8, 3, 229, 24, 8, 3, 229, 26, 8, 3, 229, 25, 8, 3, 229, 67, 8, 3, 
-    229, 65, 8, 3, 229, 77, 8, 3, 229, 70, 8, 3, 228, 243, 8, 3, 228, 242, 8, 
-    3, 228, 244, 8, 3, 228, 252, 8, 3, 228, 249, 8, 3, 229, 4, 8, 3, 228, 
-    254, 8, 3, 229, 58, 8, 3, 229, 64, 8, 3, 229, 60, 8, 3, 241, 156, 8, 3, 
-    241, 166, 8, 3, 241, 175, 8, 3, 241, 251, 8, 3, 241, 243, 8, 3, 162, 8, 
-    3, 242, 6, 8, 3, 240, 206, 8, 3, 240, 205, 8, 3, 240, 208, 8, 3, 240, 
-    207, 8, 3, 240, 242, 8, 3, 240, 233, 8, 3, 241, 68, 8, 3, 241, 47, 8, 3, 
-    241, 194, 8, 3, 241, 238, 8, 3, 241, 206, 8, 3, 212, 43, 8, 3, 212, 28, 
-    8, 3, 212, 65, 8, 3, 212, 51, 8, 3, 211, 185, 8, 3, 211, 187, 8, 3, 211, 
-    186, 8, 3, 211, 203, 8, 3, 211, 227, 8, 3, 211, 210, 8, 3, 212, 5, 8, 3, 
-    212, 22, 8, 3, 212, 10, 8, 3, 210, 30, 8, 3, 210, 29, 8, 3, 210, 44, 8, 
-    3, 210, 32, 8, 3, 210, 37, 8, 3, 210, 39, 8, 3, 210, 38, 8, 3, 210, 102, 
-    8, 3, 210, 99, 8, 3, 210, 116, 8, 3, 210, 105, 8, 3, 210, 6, 8, 3, 210, 
-    8, 8, 3, 210, 7, 8, 3, 210, 19, 8, 3, 210, 18, 8, 3, 210, 23, 8, 3, 210, 
-    20, 8, 3, 210, 84, 8, 3, 210, 94, 8, 3, 210, 88, 8, 3, 210, 2, 8, 3, 210, 
-    1, 8, 3, 210, 13, 8, 3, 210, 5, 8, 3, 210, 3, 8, 3, 210, 4, 8, 3, 209, 
-    245, 8, 3, 209, 244, 8, 3, 209, 250, 8, 3, 209, 248, 8, 3, 209, 246, 8, 
-    3, 209, 247, 8, 3, 250, 28, 8, 3, 250, 24, 8, 3, 250, 51, 8, 3, 250, 37, 
-    8, 3, 250, 48, 8, 3, 250, 42, 8, 3, 250, 50, 8, 3, 250, 49, 8, 3, 250, 
-    224, 8, 3, 250, 217, 8, 3, 251, 33, 8, 3, 250, 251, 8, 3, 249, 104, 8, 3, 
-    249, 106, 8, 3, 249, 105, 8, 3, 249, 153, 8, 3, 249, 144, 8, 3, 249, 238, 
-    8, 3, 249, 169, 8, 3, 250, 160, 8, 3, 250, 190, 8, 3, 250, 165, 8, 3, 
-    249, 84, 8, 3, 249, 82, 8, 3, 249, 112, 8, 3, 249, 102, 8, 3, 249, 89, 8, 
-    3, 249, 101, 8, 3, 249, 63, 8, 3, 249, 62, 8, 3, 249, 73, 8, 3, 249, 69, 
-    8, 3, 249, 64, 8, 3, 249, 66, 8, 3, 209, 228, 8, 3, 209, 227, 8, 3, 209, 
-    234, 8, 3, 209, 229, 8, 3, 209, 231, 8, 3, 209, 230, 8, 3, 209, 233, 8, 
-    3, 209, 232, 8, 3, 209, 240, 8, 3, 209, 239, 8, 3, 209, 243, 8, 3, 209, 
-    241, 8, 3, 209, 224, 8, 3, 209, 226, 8, 3, 209, 225, 8, 3, 209, 235, 8, 
-    3, 209, 238, 8, 3, 209, 236, 8, 3, 209, 217, 8, 3, 209, 221, 8, 3, 209, 
-    220, 8, 3, 209, 218, 8, 3, 209, 219, 8, 3, 209, 211, 8, 3, 209, 210, 8, 
-    3, 209, 216, 8, 3, 209, 214, 8, 3, 209, 212, 8, 3, 209, 213, 8, 3, 227, 
-    104, 8, 3, 227, 103, 8, 3, 227, 109, 8, 3, 227, 105, 8, 3, 227, 106, 8, 
-    3, 227, 108, 8, 3, 227, 107, 8, 3, 227, 114, 8, 3, 227, 113, 8, 3, 227, 
-    117, 8, 3, 227, 116, 8, 3, 227, 97, 8, 3, 227, 98, 8, 3, 227, 101, 8, 3, 
-    227, 102, 8, 3, 227, 110, 8, 3, 227, 112, 8, 3, 227, 92, 8, 3, 227, 100, 
-    8, 3, 227, 96, 8, 3, 227, 93, 8, 3, 227, 94, 8, 3, 227, 87, 8, 3, 227, 
-    86, 8, 3, 227, 91, 8, 3, 227, 90, 8, 3, 227, 88, 8, 3, 227, 89, 8, 3, 
-    219, 127, 8, 3, 194, 8, 3, 219, 191, 8, 3, 219, 130, 8, 3, 219, 183, 8, 
-    3, 219, 186, 8, 3, 219, 184, 8, 3, 221, 226, 8, 3, 221, 214, 8, 3, 206, 
-    8, 3, 221, 234, 8, 3, 218, 28, 8, 3, 218, 30, 8, 3, 218, 29, 8, 3, 219, 
-    34, 8, 3, 219, 23, 8, 3, 219, 58, 8, 3, 219, 38, 8, 3, 220, 114, 8, 3, 
-    221, 181, 8, 3, 220, 139, 8, 3, 218, 5, 8, 3, 218, 3, 8, 3, 218, 83, 8, 
-    3, 218, 27, 8, 3, 218, 9, 8, 3, 218, 17, 8, 3, 217, 166, 8, 3, 217, 165, 
-    8, 3, 217, 232, 8, 3, 217, 173, 8, 3, 217, 168, 8, 3, 217, 172, 8, 3, 
-    218, 186, 8, 3, 218, 185, 8, 3, 218, 192, 8, 3, 218, 187, 8, 3, 218, 189, 
-    8, 3, 218, 191, 8, 3, 218, 190, 8, 3, 218, 200, 8, 3, 218, 198, 8, 3, 
-    218, 223, 8, 3, 218, 201, 8, 3, 218, 181, 8, 3, 218, 180, 8, 3, 218, 184, 
-    8, 3, 218, 182, 8, 3, 218, 194, 8, 3, 218, 197, 8, 3, 218, 195, 8, 3, 
-    218, 177, 8, 3, 218, 175, 8, 3, 218, 179, 8, 3, 218, 178, 8, 3, 218, 170, 
-    8, 3, 218, 169, 8, 3, 218, 174, 8, 3, 218, 173, 8, 3, 218, 171, 8, 3, 
-    218, 172, 8, 3, 210, 77, 8, 3, 210, 76, 8, 3, 210, 82, 8, 3, 210, 79, 8, 
-    3, 210, 59, 8, 3, 210, 61, 8, 3, 210, 60, 8, 3, 210, 64, 8, 3, 210, 63, 
-    8, 3, 210, 67, 8, 3, 210, 65, 8, 3, 210, 71, 8, 3, 210, 70, 8, 3, 210, 
-    74, 8, 3, 210, 72, 8, 3, 210, 55, 8, 3, 210, 54, 8, 3, 210, 62, 8, 3, 
-    210, 58, 8, 3, 210, 56, 8, 3, 210, 57, 8, 3, 210, 47, 8, 3, 210, 46, 8, 
-    3, 210, 51, 8, 3, 210, 50, 8, 3, 210, 48, 8, 3, 210, 49, 8, 3, 250, 136, 
-    8, 3, 250, 133, 8, 3, 250, 157, 8, 3, 250, 144, 8, 3, 250, 65, 8, 3, 250, 
-    64, 8, 3, 250, 67, 8, 3, 250, 66, 8, 3, 250, 79, 8, 3, 250, 78, 8, 3, 
-    250, 86, 8, 3, 250, 81, 8, 3, 250, 115, 8, 3, 250, 113, 8, 3, 250, 131, 
-    8, 3, 250, 121, 8, 3, 250, 59, 8, 3, 250, 69, 8, 3, 250, 63, 8, 3, 250, 
-    60, 8, 3, 250, 62, 8, 3, 250, 53, 8, 3, 250, 52, 8, 3, 250, 57, 8, 3, 
-    250, 56, 8, 3, 250, 54, 8, 3, 250, 55, 8, 3, 222, 175, 8, 3, 222, 179, 8, 
-    3, 222, 158, 8, 3, 222, 159, 8, 3, 222, 162, 8, 3, 222, 161, 8, 3, 222, 
-    165, 8, 3, 222, 163, 8, 3, 222, 169, 8, 3, 222, 168, 8, 3, 222, 174, 8, 
-    3, 222, 170, 8, 3, 222, 154, 8, 3, 222, 152, 8, 3, 222, 160, 8, 3, 222, 
-    157, 8, 3, 222, 155, 8, 3, 222, 156, 8, 3, 222, 147, 8, 3, 222, 146, 8, 
-    3, 222, 151, 8, 3, 222, 150, 8, 3, 222, 148, 8, 3, 222, 149, 8, 3, 228, 
-    34, 8, 3, 228, 33, 8, 3, 228, 36, 8, 3, 228, 35, 8, 3, 228, 26, 8, 3, 
-    228, 28, 8, 3, 228, 27, 8, 3, 228, 30, 8, 3, 228, 29, 8, 3, 228, 32, 8, 
-    3, 228, 31, 8, 3, 228, 21, 8, 3, 228, 20, 8, 3, 228, 25, 8, 3, 228, 24, 
-    8, 3, 228, 22, 8, 3, 228, 23, 8, 3, 228, 15, 8, 3, 228, 14, 8, 3, 228, 
-    19, 8, 3, 228, 18, 8, 3, 228, 16, 8, 3, 228, 17, 8, 3, 220, 72, 8, 3, 
-    220, 67, 8, 3, 220, 102, 8, 3, 220, 83, 8, 3, 219, 215, 8, 3, 219, 217, 
-    8, 3, 219, 216, 8, 3, 219, 236, 8, 3, 219, 233, 8, 3, 220, 7, 8, 3, 219, 
-    254, 8, 3, 220, 42, 8, 3, 220, 35, 8, 3, 220, 63, 8, 3, 220, 50, 8, 3, 
-    219, 211, 8, 3, 219, 209, 8, 3, 219, 225, 8, 3, 219, 214, 8, 3, 219, 212, 
-    8, 3, 219, 213, 8, 3, 219, 194, 8, 3, 219, 193, 8, 3, 219, 200, 8, 3, 
-    219, 197, 8, 3, 219, 195, 8, 3, 219, 196, 8, 3, 223, 141, 8, 3, 223, 135, 
-    8, 3, 205, 8, 3, 223, 147, 8, 3, 222, 120, 8, 3, 222, 122, 8, 3, 222, 
-    121, 8, 3, 222, 188, 8, 3, 222, 181, 8, 3, 222, 211, 8, 3, 222, 192, 8, 
-    3, 223, 43, 8, 3, 223, 128, 8, 3, 223, 81, 8, 3, 222, 113, 8, 3, 222, 
-    110, 8, 3, 222, 140, 8, 3, 222, 119, 8, 3, 222, 115, 8, 3, 222, 116, 8, 
-    3, 222, 95, 8, 3, 222, 94, 8, 3, 222, 100, 8, 3, 222, 98, 8, 3, 222, 96, 
-    8, 3, 222, 97, 8, 3, 235, 98, 8, 3, 235, 97, 8, 3, 235, 108, 8, 3, 235, 
-    99, 8, 3, 235, 104, 8, 3, 235, 103, 8, 3, 235, 106, 8, 3, 235, 105, 8, 3, 
-    235, 41, 8, 3, 235, 40, 8, 3, 235, 43, 8, 3, 235, 42, 8, 3, 235, 56, 8, 
-    3, 235, 54, 8, 3, 235, 68, 8, 3, 235, 58, 8, 3, 235, 34, 8, 3, 235, 32, 
-    8, 3, 235, 51, 8, 3, 235, 39, 8, 3, 235, 36, 8, 3, 235, 37, 8, 3, 235, 
-    26, 8, 3, 235, 25, 8, 3, 235, 30, 8, 3, 235, 29, 8, 3, 235, 27, 8, 3, 
-    235, 28, 8, 3, 224, 46, 8, 3, 224, 44, 8, 3, 224, 53, 8, 3, 224, 47, 8, 
-    3, 224, 50, 8, 3, 224, 49, 8, 3, 224, 52, 8, 3, 224, 51, 8, 3, 223, 255, 
-    8, 3, 223, 252, 8, 3, 224, 1, 8, 3, 224, 0, 8, 3, 224, 33, 8, 3, 224, 32, 
-    8, 3, 224, 42, 8, 3, 224, 36, 8, 3, 223, 247, 8, 3, 223, 243, 8, 3, 224, 
-    30, 8, 3, 223, 251, 8, 3, 223, 249, 8, 3, 223, 250, 8, 3, 223, 227, 8, 3, 
-    223, 225, 8, 3, 223, 237, 8, 3, 223, 230, 8, 3, 223, 228, 8, 3, 223, 229, 
-    8, 3, 235, 87, 8, 3, 235, 86, 8, 3, 235, 93, 8, 3, 235, 88, 8, 3, 235, 
-    90, 8, 3, 235, 89, 8, 3, 235, 92, 8, 3, 235, 91, 8, 3, 235, 78, 8, 3, 
-    235, 80, 8, 3, 235, 79, 8, 3, 235, 83, 8, 3, 235, 82, 8, 3, 235, 85, 8, 
-    3, 235, 84, 8, 3, 235, 74, 8, 3, 235, 73, 8, 3, 235, 81, 8, 3, 235, 77, 
-    8, 3, 235, 75, 8, 3, 235, 76, 8, 3, 235, 70, 8, 3, 235, 69, 8, 3, 235, 
-    72, 8, 3, 235, 71, 8, 3, 228, 162, 8, 3, 228, 161, 8, 3, 228, 169, 8, 3, 
-    228, 163, 8, 3, 228, 165, 8, 3, 228, 164, 8, 3, 228, 168, 8, 3, 228, 166, 
-    8, 3, 228, 151, 8, 3, 228, 152, 8, 3, 228, 157, 8, 3, 228, 156, 8, 3, 
-    228, 160, 8, 3, 228, 158, 8, 3, 228, 146, 8, 3, 228, 155, 8, 3, 228, 150, 
-    8, 3, 228, 147, 8, 3, 228, 148, 8, 3, 228, 141, 8, 3, 228, 140, 8, 3, 
-    228, 145, 8, 3, 228, 144, 8, 3, 228, 142, 8, 3, 228, 143, 8, 3, 227, 137, 
-    8, 3, 227, 136, 8, 3, 227, 148, 8, 3, 227, 141, 8, 3, 227, 145, 8, 3, 
-    227, 144, 8, 3, 227, 147, 8, 3, 227, 146, 8, 3, 227, 124, 8, 3, 227, 126, 
-    8, 3, 227, 125, 8, 3, 227, 130, 8, 3, 227, 129, 8, 3, 227, 134, 8, 3, 
-    227, 131, 8, 3, 227, 122, 8, 3, 227, 120, 8, 3, 227, 128, 8, 3, 227, 123, 
-    8, 3, 211, 150, 8, 3, 211, 149, 8, 3, 211, 157, 8, 3, 211, 152, 8, 3, 
-    211, 154, 8, 3, 211, 153, 8, 3, 211, 156, 8, 3, 211, 155, 8, 3, 211, 139, 
-    8, 3, 211, 140, 8, 3, 211, 144, 8, 3, 211, 143, 8, 3, 211, 148, 8, 3, 
-    211, 146, 8, 3, 211, 121, 8, 3, 211, 119, 8, 3, 211, 131, 8, 3, 211, 124, 
-    8, 3, 211, 122, 8, 3, 211, 123, 8, 3, 210, 250, 8, 3, 210, 248, 8, 3, 
-    211, 8, 8, 3, 210, 251, 8, 3, 211, 2, 8, 3, 211, 1, 8, 3, 211, 5, 8, 3, 
-    211, 3, 8, 3, 210, 191, 8, 3, 210, 190, 8, 3, 210, 194, 8, 3, 210, 192, 
-    8, 3, 210, 224, 8, 3, 210, 221, 8, 3, 210, 244, 8, 3, 210, 228, 8, 3, 
-    210, 182, 8, 3, 210, 178, 8, 3, 210, 212, 8, 3, 210, 189, 8, 3, 210, 185, 
-    8, 3, 210, 186, 8, 3, 210, 162, 8, 3, 210, 161, 8, 3, 210, 169, 8, 3, 
-    210, 165, 8, 3, 210, 163, 8, 3, 210, 164, 8, 34, 224, 33, 8, 34, 232, 
-    241, 8, 34, 234, 61, 8, 34, 227, 141, 8, 34, 249, 69, 8, 34, 218, 192, 8, 
-    34, 243, 12, 8, 34, 243, 44, 8, 34, 230, 230, 8, 34, 240, 180, 8, 34, 
-    232, 56, 8, 34, 252, 83, 8, 34, 230, 126, 8, 34, 210, 244, 8, 34, 224, 
-    121, 8, 34, 240, 174, 8, 34, 217, 46, 8, 34, 243, 135, 8, 34, 210, 5, 8, 
-    34, 249, 63, 8, 34, 248, 95, 8, 34, 251, 98, 8, 34, 243, 8, 8, 34, 227, 
-    131, 8, 34, 215, 118, 8, 34, 226, 175, 8, 34, 235, 74, 8, 34, 210, 19, 8, 
-    34, 224, 100, 8, 34, 241, 108, 8, 34, 210, 250, 8, 34, 212, 112, 8, 34, 
-    219, 200, 8, 34, 213, 244, 8, 34, 210, 116, 8, 34, 235, 68, 8, 34, 227, 
-    96, 8, 34, 235, 72, 8, 34, 242, 154, 8, 34, 235, 92, 8, 34, 211, 227, 8, 
-    34, 246, 78, 8, 34, 219, 213, 8, 34, 232, 236, 8, 34, 249, 73, 8, 34, 
-    249, 105, 8, 34, 250, 37, 8, 34, 240, 177, 8, 34, 220, 72, 8, 34, 210, 4, 
-    8, 34, 219, 254, 8, 34, 250, 131, 8, 34, 209, 231, 8, 34, 229, 173, 8, 
-    34, 234, 182, 232, 196, 1, 252, 191, 232, 196, 1, 190, 232, 196, 1, 225, 
-    147, 232, 196, 1, 248, 221, 232, 196, 1, 217, 105, 232, 196, 1, 216, 208, 
-    232, 196, 1, 243, 135, 232, 196, 1, 176, 232, 196, 1, 234, 132, 232, 196, 
-    1, 235, 141, 232, 196, 1, 251, 33, 232, 196, 1, 250, 157, 232, 196, 1, 
-    246, 38, 232, 196, 1, 215, 183, 232, 196, 1, 215, 175, 232, 196, 1, 184, 
-    232, 196, 1, 197, 232, 196, 1, 233, 135, 232, 196, 1, 206, 232, 196, 1, 
-    210, 82, 232, 196, 1, 210, 116, 232, 196, 1, 229, 77, 232, 196, 1, 162, 
-    232, 196, 1, 211, 165, 232, 196, 1, 241, 189, 232, 196, 1, 244, 196, 232, 
-    196, 1, 212, 65, 232, 196, 1, 220, 102, 232, 196, 1, 191, 232, 196, 1, 
-    242, 249, 232, 196, 1, 61, 232, 196, 1, 254, 243, 232, 196, 1, 75, 232, 
-    196, 1, 245, 55, 232, 196, 1, 73, 232, 196, 1, 76, 232, 196, 1, 70, 232, 
-    196, 1, 214, 214, 232, 196, 1, 214, 208, 232, 196, 1, 226, 234, 232, 196, 
-    1, 138, 230, 32, 216, 117, 232, 196, 1, 138, 229, 229, 225, 16, 232, 196, 
-    1, 138, 230, 32, 249, 72, 232, 196, 1, 138, 230, 32, 251, 205, 232, 196, 
-    1, 138, 230, 32, 197, 232, 196, 1, 138, 230, 32, 235, 115, 232, 196, 224, 
-    141, 249, 219, 232, 196, 224, 141, 243, 229, 218, 129, 41, 3, 245, 209, 
-    41, 3, 245, 205, 41, 3, 241, 220, 41, 3, 212, 17, 41, 3, 212, 16, 41, 3, 
-    225, 211, 41, 3, 252, 13, 41, 3, 252, 66, 41, 3, 231, 116, 41, 3, 233, 
-    247, 41, 3, 231, 6, 41, 3, 243, 75, 41, 3, 244, 147, 41, 3, 213, 250, 41, 
-    3, 217, 11, 41, 3, 216, 194, 41, 3, 248, 16, 41, 3, 248, 13, 41, 3, 233, 
-    50, 41, 3, 223, 108, 41, 3, 248, 77, 41, 3, 229, 139, 41, 3, 221, 170, 
-    41, 3, 220, 61, 41, 3, 210, 92, 41, 3, 210, 73, 41, 3, 250, 182, 41, 3, 
-    235, 124, 41, 3, 228, 176, 41, 3, 211, 44, 41, 3, 234, 181, 41, 3, 229, 
-    51, 41, 3, 243, 55, 41, 3, 231, 80, 41, 3, 229, 103, 41, 3, 227, 155, 41, 
-    3, 73, 41, 3, 235, 255, 41, 3, 241, 180, 41, 3, 241, 160, 41, 3, 211, 
-    250, 41, 3, 211, 241, 41, 3, 225, 108, 41, 3, 252, 11, 41, 3, 252, 6, 41, 
-    3, 231, 109, 41, 3, 233, 244, 41, 3, 231, 3, 41, 3, 243, 71, 41, 3, 244, 
-    121, 41, 3, 213, 176, 41, 3, 216, 117, 41, 3, 216, 175, 41, 3, 248, 8, 
-    41, 3, 248, 12, 41, 3, 232, 241, 41, 3, 223, 35, 41, 3, 248, 3, 41, 3, 
-    229, 133, 41, 3, 219, 191, 41, 3, 220, 32, 41, 3, 210, 44, 41, 3, 210, 
-    69, 41, 3, 250, 51, 41, 3, 235, 108, 41, 3, 228, 169, 41, 3, 211, 8, 41, 
-    3, 234, 92, 41, 3, 229, 43, 41, 3, 242, 214, 41, 3, 230, 230, 41, 3, 228, 
-    233, 41, 3, 227, 148, 41, 3, 61, 41, 3, 254, 123, 41, 3, 229, 72, 41, 3, 
-    162, 41, 3, 242, 18, 41, 3, 212, 65, 41, 3, 212, 55, 41, 3, 190, 41, 3, 
-    252, 18, 41, 3, 252, 191, 41, 3, 231, 124, 41, 3, 233, 251, 41, 3, 233, 
-    250, 41, 3, 231, 10, 41, 3, 243, 79, 41, 3, 244, 196, 41, 3, 214, 27, 41, 
-    3, 217, 105, 41, 3, 216, 208, 41, 3, 248, 25, 41, 3, 248, 15, 41, 3, 233, 
-    135, 41, 3, 205, 41, 3, 248, 221, 41, 3, 229, 148, 41, 3, 206, 41, 3, 
-    220, 102, 41, 3, 210, 116, 41, 3, 210, 82, 41, 3, 251, 33, 41, 3, 235, 
-    141, 41, 3, 228, 185, 41, 3, 191, 41, 3, 176, 41, 3, 234, 234, 41, 3, 
-    229, 56, 41, 3, 243, 135, 41, 3, 184, 41, 3, 197, 41, 3, 227, 165, 41, 3, 
-    226, 183, 41, 3, 226, 179, 41, 3, 241, 53, 41, 3, 211, 215, 41, 3, 211, 
-    211, 41, 3, 224, 249, 41, 3, 252, 9, 41, 3, 251, 193, 41, 3, 231, 104, 
-    41, 3, 233, 242, 41, 3, 230, 255, 41, 3, 243, 67, 41, 3, 244, 34, 41, 3, 
-    213, 127, 41, 3, 216, 17, 41, 3, 216, 153, 41, 3, 248, 6, 41, 3, 248, 10, 
-    41, 3, 232, 127, 41, 3, 222, 197, 41, 3, 247, 125, 41, 3, 229, 120, 41, 
-    3, 219, 40, 41, 3, 220, 1, 41, 3, 210, 21, 41, 3, 210, 66, 41, 3, 249, 
-    174, 41, 3, 235, 59, 41, 3, 228, 159, 41, 3, 210, 229, 41, 3, 234, 10, 
-    41, 3, 229, 41, 41, 3, 242, 164, 41, 3, 230, 132, 41, 3, 228, 64, 41, 3, 
-    227, 132, 41, 3, 70, 41, 3, 214, 190, 41, 3, 240, 222, 41, 3, 240, 212, 
-    41, 3, 211, 195, 41, 3, 211, 189, 41, 3, 224, 150, 41, 3, 252, 8, 41, 3, 
-    251, 125, 41, 3, 231, 103, 41, 3, 233, 240, 41, 3, 230, 254, 41, 3, 243, 
-    66, 41, 3, 243, 234, 41, 3, 212, 116, 41, 3, 215, 118, 41, 3, 216, 136, 
-    41, 3, 248, 4, 41, 3, 248, 9, 41, 3, 232, 98, 41, 3, 222, 140, 41, 3, 
-    246, 78, 41, 3, 229, 115, 41, 3, 218, 83, 41, 3, 219, 225, 41, 3, 210, 
-    13, 41, 3, 210, 62, 41, 3, 249, 112, 41, 3, 235, 51, 41, 3, 228, 155, 41, 
-    3, 210, 212, 41, 3, 233, 217, 41, 3, 229, 40, 41, 3, 242, 113, 41, 3, 
-    230, 102, 41, 3, 227, 237, 41, 3, 227, 128, 41, 3, 76, 41, 3, 226, 196, 
-    41, 3, 229, 0, 41, 3, 241, 68, 41, 3, 241, 56, 41, 3, 211, 227, 41, 3, 
-    211, 216, 41, 3, 225, 16, 41, 3, 252, 10, 41, 3, 251, 205, 41, 3, 231, 
-    105, 41, 3, 233, 243, 41, 3, 231, 1, 41, 3, 243, 69, 41, 3, 243, 68, 41, 
-    3, 244, 43, 41, 3, 213, 138, 41, 3, 111, 41, 3, 216, 156, 41, 3, 248, 7, 
-    41, 3, 248, 11, 41, 3, 232, 156, 41, 3, 222, 211, 41, 3, 247, 145, 41, 3, 
-    229, 124, 41, 3, 219, 58, 41, 3, 220, 7, 41, 3, 210, 23, 41, 3, 210, 67, 
-    41, 3, 249, 238, 41, 3, 235, 68, 41, 3, 228, 160, 41, 3, 210, 244, 41, 3, 
-    234, 28, 41, 3, 229, 42, 41, 3, 242, 174, 41, 3, 230, 161, 41, 3, 228, 
-    74, 41, 3, 227, 134, 41, 3, 75, 41, 3, 245, 150, 41, 3, 229, 61, 41, 3, 
-    241, 238, 41, 3, 241, 209, 41, 3, 212, 22, 41, 3, 212, 12, 41, 3, 225, 
-    221, 41, 3, 252, 14, 41, 3, 252, 75, 41, 3, 231, 117, 41, 3, 233, 248, 
-    41, 3, 233, 246, 41, 3, 231, 7, 41, 3, 243, 76, 41, 3, 243, 74, 41, 3, 
-    244, 154, 41, 3, 213, 255, 41, 3, 217, 22, 41, 3, 216, 195, 41, 3, 248, 
-    17, 41, 3, 248, 14, 41, 3, 233, 58, 41, 3, 223, 128, 41, 3, 248, 90, 41, 
-    3, 229, 140, 41, 3, 221, 181, 41, 3, 220, 63, 41, 3, 210, 94, 41, 3, 210, 
-    74, 41, 3, 250, 190, 41, 3, 235, 126, 41, 3, 228, 178, 41, 3, 211, 47, 
-    41, 3, 234, 182, 41, 3, 229, 52, 41, 3, 229, 48, 41, 3, 243, 62, 41, 3, 
-    243, 51, 41, 3, 231, 91, 41, 3, 229, 107, 41, 3, 227, 156, 41, 3, 229, 
-    79, 41, 3, 233, 22, 41, 249, 219, 41, 243, 229, 218, 129, 41, 224, 13, 
-    78, 41, 3, 229, 123, 244, 196, 41, 3, 229, 123, 176, 41, 3, 229, 123, 
-    219, 40, 41, 16, 244, 144, 41, 16, 234, 180, 41, 16, 216, 81, 41, 16, 
-    228, 208, 41, 16, 252, 147, 41, 16, 244, 195, 41, 16, 217, 101, 41, 16, 
-    248, 176, 41, 16, 247, 124, 41, 16, 233, 206, 41, 16, 216, 21, 41, 16, 
-    247, 144, 41, 16, 235, 60, 41, 21, 210, 86, 41, 21, 110, 41, 21, 105, 41, 
-    21, 158, 41, 21, 161, 41, 21, 189, 41, 21, 194, 41, 21, 198, 41, 21, 195, 
-    41, 21, 200, 41, 3, 229, 123, 184, 41, 3, 229, 123, 247, 145, 33, 6, 1, 
-    210, 90, 33, 4, 1, 210, 90, 33, 6, 1, 246, 34, 33, 4, 1, 246, 34, 33, 6, 
-    1, 223, 49, 246, 36, 33, 4, 1, 223, 49, 246, 36, 33, 6, 1, 235, 185, 33, 
-    4, 1, 235, 185, 33, 6, 1, 247, 161, 33, 4, 1, 247, 161, 33, 6, 1, 230, 
-    140, 214, 205, 33, 4, 1, 230, 140, 214, 205, 33, 6, 1, 251, 136, 226, 
-    201, 33, 4, 1, 251, 136, 226, 201, 33, 6, 1, 229, 87, 211, 31, 33, 4, 1, 
-    229, 87, 211, 31, 33, 6, 1, 211, 28, 2, 252, 185, 211, 31, 33, 4, 1, 211, 
-    28, 2, 252, 185, 211, 31, 33, 6, 1, 235, 183, 211, 59, 33, 4, 1, 235, 
-    183, 211, 59, 33, 6, 1, 223, 49, 210, 212, 33, 4, 1, 223, 49, 210, 212, 
-    33, 6, 1, 235, 183, 61, 33, 4, 1, 235, 183, 61, 33, 6, 1, 250, 0, 232, 
-    192, 210, 183, 33, 4, 1, 250, 0, 232, 192, 210, 183, 33, 6, 1, 251, 214, 
-    210, 183, 33, 4, 1, 251, 214, 210, 183, 33, 6, 1, 235, 183, 250, 0, 232, 
-    192, 210, 183, 33, 4, 1, 235, 183, 250, 0, 232, 192, 210, 183, 33, 6, 1, 
-    210, 246, 33, 4, 1, 210, 246, 33, 6, 1, 223, 49, 215, 178, 33, 4, 1, 223, 
-    49, 215, 178, 33, 6, 1, 219, 52, 248, 90, 33, 4, 1, 219, 52, 248, 90, 33, 
-    6, 1, 219, 52, 245, 174, 33, 4, 1, 219, 52, 245, 174, 33, 6, 1, 219, 52, 
-    245, 159, 33, 4, 1, 219, 52, 245, 159, 33, 6, 1, 230, 144, 76, 33, 4, 1, 
-    230, 144, 76, 33, 6, 1, 251, 240, 76, 33, 4, 1, 251, 240, 76, 33, 6, 1, 
-    52, 230, 144, 76, 33, 4, 1, 52, 230, 144, 76, 33, 1, 230, 86, 76, 38, 33, 
-    212, 100, 38, 33, 216, 248, 230, 191, 50, 38, 33, 240, 211, 230, 191, 50, 
-    38, 33, 216, 148, 230, 191, 50, 219, 93, 253, 216, 38, 33, 1, 214, 202, 
-    236, 60, 38, 33, 1, 73, 38, 33, 1, 211, 8, 38, 33, 1, 70, 38, 33, 1, 242, 
-    3, 50, 38, 33, 1, 211, 27, 38, 33, 1, 219, 52, 50, 38, 33, 1, 226, 201, 
-    38, 33, 234, 192, 38, 33, 225, 227, 33, 234, 192, 33, 225, 227, 33, 6, 1, 
-    246, 46, 33, 4, 1, 246, 46, 33, 6, 1, 246, 27, 33, 4, 1, 246, 27, 33, 6, 
-    1, 210, 52, 33, 4, 1, 210, 52, 33, 6, 1, 250, 206, 33, 4, 1, 250, 206, 
-    33, 6, 1, 246, 25, 33, 4, 1, 246, 25, 33, 6, 1, 217, 23, 2, 230, 224, 
-    103, 33, 4, 1, 217, 23, 2, 230, 224, 103, 33, 6, 1, 215, 78, 33, 4, 1, 
-    215, 78, 33, 6, 1, 215, 160, 33, 4, 1, 215, 160, 33, 6, 1, 215, 164, 33, 
-    4, 1, 215, 164, 33, 6, 1, 217, 28, 33, 4, 1, 217, 28, 33, 6, 1, 240, 198, 
-    33, 4, 1, 240, 198, 33, 6, 1, 219, 206, 33, 4, 1, 219, 206, 38, 33, 1, 
-    235, 183, 75, 20, 1, 61, 20, 1, 176, 20, 1, 70, 20, 1, 233, 217, 20, 1, 
-    245, 209, 20, 1, 223, 108, 20, 1, 217, 86, 20, 1, 76, 20, 1, 227, 148, 
-    20, 1, 73, 20, 1, 233, 135, 20, 1, 190, 20, 1, 222, 239, 20, 1, 223, 29, 
-    20, 1, 233, 49, 20, 1, 231, 79, 20, 1, 217, 101, 20, 1, 229, 146, 20, 1, 
-    228, 183, 20, 1, 193, 20, 1, 218, 4, 20, 1, 230, 102, 20, 1, 220, 27, 20, 
-    1, 219, 191, 20, 1, 220, 37, 20, 1, 220, 123, 20, 1, 233, 155, 20, 1, 
-    234, 156, 20, 1, 227, 209, 20, 1, 227, 237, 20, 1, 228, 154, 20, 1, 210, 
-    226, 20, 1, 219, 225, 20, 1, 210, 187, 20, 1, 191, 20, 1, 228, 9, 20, 1, 
-    234, 142, 20, 1, 225, 151, 20, 1, 228, 176, 20, 1, 227, 246, 20, 1, 224, 
-    144, 20, 1, 211, 192, 20, 1, 225, 211, 20, 1, 244, 147, 20, 1, 222, 140, 
-    20, 1, 232, 98, 20, 1, 230, 230, 20, 1, 228, 233, 20, 1, 223, 51, 20, 1, 
-    223, 171, 20, 1, 234, 165, 20, 1, 229, 7, 20, 1, 229, 56, 20, 1, 229, 77, 
-    20, 1, 220, 7, 20, 1, 224, 147, 20, 1, 243, 234, 20, 1, 244, 37, 20, 1, 
-    212, 65, 20, 1, 197, 20, 1, 232, 241, 20, 1, 225, 108, 20, 1, 232, 119, 
-    20, 1, 234, 28, 20, 1, 231, 114, 20, 1, 223, 83, 20, 1, 231, 58, 20, 1, 
-    184, 20, 1, 216, 117, 20, 1, 234, 92, 20, 1, 230, 161, 20, 1, 231, 122, 
-    20, 1, 216, 230, 20, 1, 233, 251, 20, 1, 216, 247, 20, 1, 227, 238, 20, 
-    1, 221, 251, 20, 1, 244, 192, 20, 1, 233, 253, 20, 1, 234, 24, 20, 38, 
-    164, 234, 5, 20, 38, 164, 215, 110, 20, 228, 182, 20, 243, 229, 218, 129, 
-    20, 249, 226, 20, 249, 219, 20, 220, 150, 20, 224, 13, 78, 58, 1, 250, 
-    96, 138, 210, 254, 225, 61, 58, 1, 250, 96, 138, 211, 70, 225, 61, 58, 1, 
-    250, 96, 138, 210, 254, 220, 84, 58, 1, 250, 96, 138, 211, 70, 220, 84, 
-    58, 1, 250, 96, 138, 210, 254, 224, 30, 58, 1, 250, 96, 138, 211, 70, 
-    224, 30, 58, 1, 250, 96, 138, 210, 254, 222, 140, 58, 1, 250, 96, 138, 
-    211, 70, 222, 140, 58, 1, 245, 20, 246, 118, 138, 130, 58, 1, 125, 246, 
-    118, 138, 130, 58, 1, 230, 225, 246, 118, 138, 130, 58, 1, 121, 246, 118, 
-    138, 130, 58, 1, 245, 19, 246, 118, 138, 130, 58, 1, 245, 20, 246, 118, 
-    233, 39, 138, 130, 58, 1, 125, 246, 118, 233, 39, 138, 130, 58, 1, 230, 
-    225, 246, 118, 233, 39, 138, 130, 58, 1, 121, 246, 118, 233, 39, 138, 
-    130, 58, 1, 245, 19, 246, 118, 233, 39, 138, 130, 58, 1, 245, 20, 233, 
-    39, 138, 130, 58, 1, 125, 233, 39, 138, 130, 58, 1, 230, 225, 233, 39, 
-    138, 130, 58, 1, 121, 233, 39, 138, 130, 58, 1, 245, 19, 233, 39, 138, 
-    130, 58, 1, 59, 67, 130, 58, 1, 59, 219, 95, 58, 1, 59, 203, 130, 58, 1, 
-    232, 108, 44, 249, 161, 254, 109, 58, 1, 223, 157, 120, 74, 58, 1, 223, 
-    157, 124, 74, 58, 1, 223, 157, 245, 31, 78, 58, 1, 223, 157, 235, 193, 
-    245, 31, 78, 58, 1, 121, 235, 193, 245, 31, 78, 58, 1, 218, 111, 22, 125, 
-    216, 30, 58, 1, 218, 111, 22, 121, 216, 30, 7, 6, 1, 245, 199, 254, 170, 
-    7, 4, 1, 245, 199, 254, 170, 7, 6, 1, 245, 199, 254, 196, 7, 4, 1, 245, 
-    199, 254, 196, 7, 6, 1, 241, 207, 7, 4, 1, 241, 207, 7, 6, 1, 215, 40, 7, 
-    4, 1, 215, 40, 7, 6, 1, 215, 229, 7, 4, 1, 215, 229, 7, 6, 1, 249, 110, 
-    7, 4, 1, 249, 110, 7, 6, 1, 249, 111, 2, 249, 219, 7, 4, 1, 249, 111, 2, 
-    249, 219, 7, 1, 4, 6, 245, 6, 7, 1, 4, 6, 222, 91, 7, 6, 1, 255, 73, 7, 
-    4, 1, 255, 73, 7, 6, 1, 254, 73, 7, 4, 1, 254, 73, 7, 6, 1, 253, 192, 7, 
-    4, 1, 253, 192, 7, 6, 1, 253, 176, 7, 4, 1, 253, 176, 7, 6, 1, 253, 177, 
-    2, 203, 130, 7, 4, 1, 253, 177, 2, 203, 130, 7, 6, 1, 253, 167, 7, 4, 1, 
-    253, 167, 7, 6, 1, 223, 49, 251, 67, 2, 247, 120, 7, 4, 1, 223, 49, 251, 
-    67, 2, 247, 120, 7, 6, 1, 235, 24, 2, 91, 7, 4, 1, 235, 24, 2, 91, 7, 6, 
-    1, 235, 24, 2, 247, 255, 91, 7, 4, 1, 235, 24, 2, 247, 255, 91, 7, 6, 1, 
-    235, 24, 2, 218, 103, 22, 247, 255, 91, 7, 4, 1, 235, 24, 2, 218, 103, 
-    22, 247, 255, 91, 7, 6, 1, 251, 135, 156, 7, 4, 1, 251, 135, 156, 7, 6, 
-    1, 233, 149, 2, 125, 91, 7, 4, 1, 233, 149, 2, 125, 91, 7, 6, 1, 144, 2, 
-    199, 218, 103, 226, 120, 7, 4, 1, 144, 2, 199, 218, 103, 226, 120, 7, 6, 
-    1, 144, 2, 232, 123, 7, 4, 1, 144, 2, 232, 123, 7, 6, 1, 226, 183, 7, 4, 
-    1, 226, 183, 7, 6, 1, 226, 106, 2, 218, 103, 216, 139, 248, 39, 7, 4, 1, 
-    226, 106, 2, 218, 103, 216, 139, 248, 39, 7, 6, 1, 226, 106, 2, 244, 53, 
-    7, 4, 1, 226, 106, 2, 244, 53, 7, 6, 1, 226, 106, 2, 218, 229, 217, 77, 
-    7, 4, 1, 226, 106, 2, 218, 229, 217, 77, 7, 6, 1, 224, 97, 2, 218, 103, 
-    216, 139, 248, 39, 7, 4, 1, 224, 97, 2, 218, 103, 216, 139, 248, 39, 7, 
-    6, 1, 224, 97, 2, 247, 255, 91, 7, 4, 1, 224, 97, 2, 247, 255, 91, 7, 6, 
-    1, 223, 224, 222, 186, 7, 4, 1, 223, 224, 222, 186, 7, 6, 1, 222, 130, 
-    222, 186, 7, 4, 1, 222, 130, 222, 186, 7, 6, 1, 214, 106, 2, 247, 255, 
-    91, 7, 4, 1, 214, 106, 2, 247, 255, 91, 7, 6, 1, 212, 106, 7, 4, 1, 212, 
-    106, 7, 6, 1, 213, 145, 210, 159, 7, 4, 1, 213, 145, 210, 159, 7, 6, 1, 
-    216, 152, 2, 91, 7, 4, 1, 216, 152, 2, 91, 7, 6, 1, 216, 152, 2, 218, 
-    103, 216, 139, 248, 39, 7, 4, 1, 216, 152, 2, 218, 103, 216, 139, 248, 
-    39, 7, 6, 1, 213, 245, 7, 4, 1, 213, 245, 7, 6, 1, 245, 65, 7, 4, 1, 245, 
-    65, 7, 6, 1, 235, 171, 7, 4, 1, 235, 171, 7, 6, 1, 249, 207, 7, 4, 1, 
-    249, 207, 58, 1, 214, 133, 7, 4, 1, 246, 69, 7, 4, 1, 232, 84, 7, 4, 1, 
-    230, 80, 7, 4, 1, 227, 201, 7, 4, 1, 222, 129, 7, 1, 4, 6, 222, 129, 7, 
-    4, 1, 215, 108, 7, 4, 1, 214, 197, 7, 6, 1, 235, 213, 249, 60, 7, 4, 1, 
-    235, 213, 249, 60, 7, 6, 1, 235, 213, 245, 6, 7, 4, 1, 235, 213, 245, 6, 
-    7, 6, 1, 235, 213, 243, 202, 7, 6, 1, 215, 94, 235, 213, 243, 202, 7, 4, 
-    1, 215, 94, 235, 213, 243, 202, 7, 6, 1, 215, 94, 156, 7, 4, 1, 215, 94, 
-    156, 7, 6, 1, 235, 213, 153, 7, 4, 1, 235, 213, 153, 7, 6, 1, 235, 213, 
-    222, 91, 7, 4, 1, 235, 213, 222, 91, 7, 6, 1, 235, 213, 217, 152, 7, 4, 
-    1, 235, 213, 217, 152, 58, 1, 121, 250, 31, 255, 14, 58, 1, 249, 226, 58, 
-    1, 219, 251, 245, 98, 50, 7, 6, 1, 221, 255, 7, 4, 1, 221, 255, 7, 6, 1, 
-    215, 94, 242, 60, 7, 4, 1, 233, 149, 2, 223, 55, 241, 52, 22, 252, 41, 7, 
-    6, 1, 230, 26, 2, 248, 39, 7, 4, 1, 230, 26, 2, 248, 39, 7, 6, 1, 251, 
-    67, 2, 130, 7, 4, 1, 251, 67, 2, 130, 7, 6, 1, 243, 203, 2, 226, 248, 91, 
-    7, 4, 1, 243, 203, 2, 226, 248, 91, 7, 6, 1, 235, 24, 2, 226, 248, 91, 7, 
-    4, 1, 235, 24, 2, 226, 248, 91, 7, 6, 1, 230, 26, 2, 226, 248, 91, 7, 4, 
-    1, 230, 26, 2, 226, 248, 91, 7, 6, 1, 223, 224, 2, 226, 248, 91, 7, 4, 1, 
-    223, 224, 2, 226, 248, 91, 7, 6, 1, 222, 92, 2, 226, 248, 91, 7, 4, 1, 
-    222, 92, 2, 226, 248, 91, 7, 6, 1, 242, 61, 2, 103, 58, 1, 6, 242, 61, 2, 
-    91, 58, 1, 4, 27, 226, 234, 7, 1, 4, 6, 215, 94, 193, 7, 245, 103, 1, 
-    223, 49, 245, 6, 7, 245, 103, 1, 223, 49, 226, 105, 7, 245, 103, 1, 235, 
-    193, 193, 7, 245, 103, 1, 240, 154, 232, 129, 7, 245, 103, 1, 254, 23, 
-    193, 217, 230, 229, 214, 1, 61, 217, 230, 229, 214, 1, 73, 217, 230, 229, 
-    214, 5, 246, 48, 217, 230, 229, 214, 1, 70, 217, 230, 229, 214, 1, 75, 
-    217, 230, 229, 214, 1, 76, 217, 230, 229, 214, 5, 241, 253, 217, 230, 
-    229, 214, 1, 234, 28, 217, 230, 229, 214, 1, 234, 105, 217, 230, 229, 
-    214, 1, 242, 174, 217, 230, 229, 214, 1, 242, 224, 217, 230, 229, 214, 5, 
-    254, 75, 217, 230, 229, 214, 1, 249, 238, 217, 230, 229, 214, 1, 250, 86, 
-    217, 230, 229, 214, 1, 235, 68, 217, 230, 229, 214, 1, 235, 109, 217, 
-    230, 229, 214, 1, 215, 133, 217, 230, 229, 214, 1, 215, 139, 217, 230, 
-    229, 214, 1, 248, 105, 217, 230, 229, 214, 1, 248, 114, 217, 230, 229, 
-    214, 1, 111, 217, 230, 229, 214, 1, 216, 156, 217, 230, 229, 214, 1, 247, 
-    145, 217, 230, 229, 214, 1, 248, 7, 217, 230, 229, 214, 1, 228, 74, 217, 
-    230, 229, 214, 1, 225, 16, 217, 230, 229, 214, 1, 225, 121, 217, 230, 
-    229, 214, 1, 251, 205, 217, 230, 229, 214, 1, 252, 10, 217, 230, 229, 
-    214, 1, 230, 161, 217, 230, 229, 214, 1, 222, 211, 217, 230, 229, 214, 1, 
-    232, 156, 217, 230, 229, 214, 1, 222, 165, 217, 230, 229, 214, 1, 219, 
-    58, 217, 230, 229, 214, 1, 241, 68, 217, 230, 229, 214, 25, 5, 61, 217, 
-    230, 229, 214, 25, 5, 73, 217, 230, 229, 214, 25, 5, 70, 217, 230, 229, 
-    214, 25, 5, 75, 217, 230, 229, 214, 25, 5, 226, 183, 217, 230, 229, 214, 
-    225, 12, 231, 158, 217, 230, 229, 214, 225, 12, 231, 157, 217, 230, 229, 
-    214, 225, 12, 231, 156, 217, 230, 229, 214, 225, 12, 231, 155, 228, 56, 
-    235, 240, 244, 2, 123, 224, 21, 228, 56, 235, 240, 244, 2, 123, 242, 27, 
-    228, 56, 235, 240, 244, 2, 134, 224, 19, 228, 56, 235, 240, 244, 2, 123, 
-    219, 117, 228, 56, 235, 240, 244, 2, 123, 245, 188, 228, 56, 235, 240, 
-    244, 2, 134, 219, 116, 228, 56, 235, 240, 224, 22, 78, 228, 56, 235, 240, 
-    225, 40, 78, 228, 56, 235, 240, 222, 118, 78, 228, 56, 235, 240, 224, 23, 
-    78, 225, 144, 1, 176, 225, 144, 1, 234, 132, 225, 144, 1, 243, 135, 225, 
-    144, 1, 229, 77, 225, 144, 1, 251, 33, 225, 144, 1, 250, 157, 225, 144, 
-    1, 235, 141, 225, 144, 1, 227, 165, 225, 144, 1, 217, 105, 225, 144, 1, 
-    216, 208, 225, 144, 1, 248, 221, 225, 144, 1, 197, 225, 144, 1, 190, 225, 
-    144, 1, 225, 147, 225, 144, 1, 252, 191, 225, 144, 1, 184, 225, 144, 1, 
-    215, 183, 225, 144, 1, 215, 175, 225, 144, 1, 246, 38, 225, 144, 1, 212, 
-    65, 225, 144, 1, 210, 82, 225, 144, 1, 210, 116, 225, 144, 1, 4, 61, 225, 
-    144, 1, 191, 225, 144, 1, 205, 225, 144, 1, 233, 135, 225, 144, 1, 220, 
-    102, 225, 144, 1, 206, 225, 144, 1, 162, 225, 144, 1, 61, 225, 144, 1, 
-    73, 225, 144, 1, 70, 225, 144, 1, 75, 225, 144, 1, 76, 225, 144, 1, 224, 
-    88, 225, 144, 1, 211, 165, 225, 144, 1, 244, 196, 225, 144, 1, 243, 29, 
-    225, 144, 1, 245, 209, 225, 144, 218, 73, 1, 212, 65, 225, 144, 218, 73, 
-    1, 191, 225, 144, 1, 215, 156, 225, 144, 1, 215, 144, 225, 144, 1, 248, 
-    135, 225, 144, 1, 228, 110, 225, 144, 1, 254, 141, 191, 225, 144, 1, 213, 
-    134, 220, 102, 225, 144, 1, 213, 135, 162, 225, 144, 1, 253, 223, 244, 
-    196, 225, 144, 218, 73, 1, 205, 225, 144, 218, 25, 1, 205, 225, 144, 1, 
-    250, 255, 225, 144, 219, 155, 241, 236, 78, 225, 144, 52, 241, 236, 78, 
-    225, 144, 164, 220, 95, 225, 144, 164, 52, 220, 95, 179, 5, 254, 75, 179, 
-    5, 213, 147, 179, 1, 61, 179, 1, 255, 73, 179, 1, 73, 179, 1, 236, 33, 
-    179, 1, 70, 179, 1, 214, 118, 179, 1, 149, 153, 179, 1, 149, 222, 180, 
-    179, 1, 149, 156, 179, 1, 149, 232, 185, 179, 1, 75, 179, 1, 245, 209, 
-    179, 1, 254, 201, 179, 1, 76, 179, 1, 226, 183, 179, 1, 253, 192, 179, 1, 
-    176, 179, 1, 234, 132, 179, 1, 243, 135, 179, 1, 242, 249, 179, 1, 229, 
-    77, 179, 1, 251, 33, 179, 1, 250, 157, 179, 1, 235, 141, 179, 1, 235, 
-    114, 179, 1, 227, 165, 179, 1, 215, 156, 179, 1, 215, 144, 179, 1, 248, 
-    135, 179, 1, 248, 119, 179, 1, 228, 110, 179, 1, 217, 105, 179, 1, 216, 
-    208, 179, 1, 248, 221, 179, 1, 248, 25, 179, 1, 197, 179, 1, 190, 179, 1, 
-    225, 147, 179, 1, 252, 191, 179, 1, 252, 18, 179, 1, 184, 179, 1, 191, 
-    179, 1, 205, 179, 1, 233, 135, 179, 1, 214, 27, 179, 1, 220, 102, 179, 1, 
-    218, 223, 179, 1, 206, 179, 1, 162, 179, 1, 232, 184, 179, 116, 5, 242, 
-    44, 179, 25, 5, 255, 73, 179, 25, 5, 73, 179, 25, 5, 236, 33, 179, 25, 5, 
-    70, 179, 25, 5, 214, 118, 179, 25, 5, 149, 153, 179, 25, 5, 149, 222, 
-    180, 179, 25, 5, 149, 156, 179, 25, 5, 149, 232, 185, 179, 25, 5, 75, 
-    179, 25, 5, 245, 209, 179, 25, 5, 254, 201, 179, 25, 5, 76, 179, 25, 5, 
-    226, 183, 179, 25, 5, 253, 192, 179, 5, 213, 152, 179, 248, 178, 179, 52, 
-    248, 178, 179, 21, 210, 86, 179, 21, 110, 179, 21, 105, 179, 21, 158, 
-    179, 21, 161, 179, 21, 189, 179, 21, 194, 179, 21, 198, 179, 21, 195, 
-    179, 21, 200, 38, 84, 21, 210, 86, 38, 84, 21, 110, 38, 84, 21, 105, 38, 
-    84, 21, 158, 38, 84, 21, 161, 38, 84, 21, 189, 38, 84, 21, 194, 38, 84, 
-    21, 198, 38, 84, 21, 195, 38, 84, 21, 200, 38, 84, 1, 61, 38, 84, 1, 70, 
-    38, 84, 1, 176, 38, 84, 1, 197, 38, 84, 1, 190, 38, 84, 1, 205, 38, 84, 
-    1, 213, 176, 38, 84, 5, 253, 175, 84, 5, 219, 17, 250, 255, 84, 5, 251, 
-    0, 213, 152, 84, 5, 52, 251, 0, 213, 152, 84, 5, 251, 0, 105, 84, 5, 251, 
-    0, 158, 84, 5, 251, 0, 253, 175, 84, 5, 224, 124, 84, 243, 100, 244, 103, 
-    84, 250, 238, 84, 241, 230, 234, 188, 232, 242, 21, 210, 86, 234, 188, 
-    232, 242, 21, 110, 234, 188, 232, 242, 21, 105, 234, 188, 232, 242, 21, 
-    158, 234, 188, 232, 242, 21, 161, 234, 188, 232, 242, 21, 189, 234, 188, 
-    232, 242, 21, 194, 234, 188, 232, 242, 21, 198, 234, 188, 232, 242, 21, 
-    195, 234, 188, 232, 242, 21, 200, 234, 188, 232, 242, 1, 176, 234, 188, 
-    232, 242, 1, 234, 132, 234, 188, 232, 242, 1, 243, 135, 234, 188, 232, 
-    242, 1, 229, 77, 234, 188, 232, 242, 1, 206, 234, 188, 232, 242, 1, 220, 
-    102, 234, 188, 232, 242, 1, 210, 116, 234, 188, 232, 242, 1, 227, 165, 
-    234, 188, 232, 242, 1, 217, 105, 234, 188, 232, 242, 1, 240, 226, 234, 
-    188, 232, 242, 1, 197, 234, 188, 232, 242, 1, 190, 234, 188, 232, 242, 1, 
-    225, 147, 234, 188, 232, 242, 1, 184, 234, 188, 232, 242, 1, 248, 221, 
-    234, 188, 232, 242, 1, 252, 191, 234, 188, 232, 242, 1, 205, 234, 188, 
-    232, 242, 1, 191, 234, 188, 232, 242, 1, 233, 135, 234, 188, 232, 242, 1, 
-    212, 65, 234, 188, 232, 242, 1, 216, 208, 234, 188, 232, 242, 1, 162, 
-    234, 188, 232, 242, 1, 214, 27, 234, 188, 232, 242, 1, 251, 33, 234, 188, 
-    232, 242, 1, 61, 234, 188, 232, 242, 1, 226, 234, 234, 188, 232, 242, 1, 
-    73, 234, 188, 232, 242, 1, 226, 183, 234, 188, 232, 242, 25, 214, 214, 
-    234, 188, 232, 242, 25, 75, 234, 188, 232, 242, 25, 70, 234, 188, 232, 
-    242, 25, 245, 209, 234, 188, 232, 242, 25, 76, 234, 188, 232, 242, 138, 
-    225, 30, 234, 188, 232, 242, 138, 251, 12, 234, 188, 232, 242, 138, 251, 
-    13, 225, 30, 234, 188, 232, 242, 5, 249, 77, 234, 188, 232, 242, 5, 219, 
-    199, 223, 93, 1, 176, 223, 93, 1, 243, 135, 223, 93, 1, 229, 77, 223, 93, 
-    1, 217, 105, 223, 93, 1, 248, 221, 223, 93, 1, 197, 223, 93, 1, 190, 223, 
-    93, 1, 252, 191, 223, 93, 1, 184, 223, 93, 1, 251, 33, 223, 93, 1, 235, 
-    141, 223, 93, 1, 227, 165, 223, 93, 1, 206, 223, 93, 1, 205, 223, 93, 1, 
-    233, 135, 223, 93, 1, 191, 223, 93, 1, 212, 65, 223, 93, 1, 162, 223, 93, 
-    1, 231, 124, 223, 93, 1, 229, 56, 223, 93, 1, 229, 148, 223, 93, 1, 227, 
-    135, 223, 93, 1, 61, 223, 93, 25, 5, 73, 223, 93, 25, 5, 70, 223, 93, 25, 
-    5, 75, 223, 93, 25, 5, 254, 201, 223, 93, 25, 5, 76, 223, 93, 25, 5, 253, 
-    192, 223, 93, 25, 5, 245, 55, 223, 93, 25, 5, 245, 233, 223, 93, 116, 5, 
-    229, 79, 223, 93, 116, 5, 230, 25, 223, 93, 116, 5, 153, 223, 93, 116, 5, 
-    242, 60, 223, 93, 213, 152, 223, 93, 221, 173, 78, 24, 100, 216, 97, 24, 
-    100, 216, 96, 24, 100, 216, 94, 24, 100, 216, 99, 24, 100, 223, 21, 24, 
-    100, 223, 5, 24, 100, 223, 0, 24, 100, 223, 2, 24, 100, 223, 18, 24, 100, 
-    223, 11, 24, 100, 223, 4, 24, 100, 223, 23, 24, 100, 223, 6, 24, 100, 
-    223, 25, 24, 100, 223, 22, 24, 100, 230, 213, 24, 100, 230, 204, 24, 100, 
-    230, 207, 24, 100, 225, 80, 24, 100, 225, 91, 24, 100, 225, 92, 24, 100, 
-    218, 207, 24, 100, 236, 46, 24, 100, 236, 53, 24, 100, 218, 218, 24, 100, 
-    218, 205, 24, 100, 225, 130, 24, 100, 241, 167, 24, 100, 218, 202, 155, 
-    5, 226, 27, 155, 5, 250, 187, 155, 5, 233, 66, 155, 5, 211, 243, 155, 1, 
-    61, 155, 1, 240, 154, 234, 191, 155, 1, 73, 155, 1, 236, 33, 155, 1, 70, 
-    155, 1, 226, 90, 250, 163, 155, 1, 229, 78, 233, 28, 155, 1, 229, 78, 
-    233, 29, 223, 142, 155, 1, 75, 155, 1, 254, 201, 155, 1, 76, 155, 1, 176, 
-    155, 1, 235, 13, 221, 228, 155, 1, 235, 13, 230, 66, 155, 1, 243, 135, 
-    155, 1, 243, 136, 230, 66, 155, 1, 229, 77, 155, 1, 251, 33, 155, 1, 251, 
-    34, 230, 66, 155, 1, 235, 141, 155, 1, 227, 166, 230, 66, 155, 1, 235, 
-    142, 231, 207, 155, 1, 227, 165, 155, 1, 215, 156, 155, 1, 215, 157, 231, 
-    207, 155, 1, 248, 135, 155, 1, 248, 136, 231, 207, 155, 1, 229, 229, 230, 
-    66, 155, 1, 217, 105, 155, 1, 217, 106, 230, 66, 155, 1, 248, 221, 155, 
-    1, 248, 222, 231, 207, 155, 1, 197, 155, 1, 190, 155, 1, 226, 90, 230, 
-    66, 155, 1, 252, 191, 155, 1, 252, 192, 230, 66, 155, 1, 184, 155, 1, 
-    191, 155, 1, 205, 155, 1, 223, 188, 254, 210, 155, 1, 233, 135, 155, 1, 
-    212, 65, 155, 1, 222, 34, 230, 66, 155, 1, 222, 34, 231, 207, 155, 1, 
-    206, 155, 1, 162, 155, 5, 250, 188, 216, 250, 155, 25, 5, 217, 47, 155, 
-    25, 5, 216, 35, 155, 25, 5, 211, 190, 155, 25, 5, 211, 191, 231, 69, 155, 
-    25, 5, 218, 47, 155, 25, 5, 218, 48, 231, 57, 155, 25, 5, 217, 65, 155, 
-    25, 5, 247, 194, 230, 65, 155, 25, 5, 225, 184, 155, 116, 5, 234, 158, 
-    155, 116, 5, 225, 196, 155, 116, 5, 251, 19, 155, 226, 40, 155, 43, 223, 
-    69, 155, 44, 223, 69, 155, 226, 79, 254, 117, 155, 226, 79, 231, 224, 
-    155, 226, 79, 232, 88, 155, 226, 79, 211, 238, 155, 226, 79, 226, 41, 
-    155, 226, 79, 232, 205, 155, 226, 79, 232, 82, 155, 226, 79, 254, 249, 
-    155, 226, 79, 254, 250, 254, 249, 155, 226, 79, 225, 51, 155, 215, 94, 
-    226, 79, 225, 51, 155, 226, 36, 155, 21, 210, 86, 155, 21, 110, 155, 21, 
-    105, 155, 21, 158, 155, 21, 161, 155, 21, 189, 155, 21, 194, 155, 21, 
-    198, 155, 21, 195, 155, 21, 200, 155, 226, 79, 216, 69, 215, 106, 155, 
-    226, 79, 235, 167, 172, 1, 61, 172, 1, 73, 172, 1, 70, 172, 1, 75, 172, 
-    1, 254, 201, 172, 1, 76, 172, 1, 176, 172, 1, 234, 132, 172, 1, 243, 135, 
-    172, 1, 242, 249, 172, 1, 228, 245, 172, 1, 229, 77, 172, 1, 250, 157, 
-    172, 1, 250, 112, 172, 1, 235, 141, 172, 1, 235, 114, 172, 1, 228, 235, 
-    172, 1, 228, 237, 172, 1, 228, 236, 172, 1, 217, 105, 172, 1, 216, 208, 
-    172, 1, 248, 221, 172, 1, 248, 25, 172, 1, 227, 207, 172, 1, 197, 172, 1, 
-    248, 135, 172, 1, 190, 172, 1, 224, 220, 172, 1, 225, 147, 172, 1, 252, 
-    191, 172, 1, 252, 18, 172, 1, 230, 95, 172, 1, 184, 172, 1, 252, 111, 
-    172, 1, 191, 172, 1, 205, 172, 1, 233, 135, 172, 1, 214, 27, 172, 1, 218, 
-    223, 172, 1, 206, 172, 1, 162, 172, 25, 5, 255, 73, 172, 25, 5, 73, 172, 
-    25, 5, 236, 33, 172, 25, 5, 245, 195, 172, 25, 5, 70, 172, 25, 5, 226, 
-    234, 172, 25, 5, 76, 172, 25, 5, 254, 201, 172, 25, 5, 253, 192, 172, 25, 
-    5, 214, 214, 172, 116, 5, 191, 172, 116, 5, 205, 172, 116, 5, 233, 135, 
-    172, 116, 5, 212, 65, 172, 1, 40, 235, 23, 172, 1, 40, 243, 202, 172, 1, 
-    40, 229, 79, 172, 116, 5, 40, 229, 79, 172, 1, 40, 250, 158, 172, 1, 40, 
-    217, 152, 172, 1, 40, 230, 25, 172, 1, 40, 226, 105, 172, 1, 40, 211, 
-    117, 172, 1, 40, 153, 172, 1, 40, 156, 172, 1, 40, 218, 226, 172, 116, 5, 
-    40, 193, 172, 116, 5, 40, 242, 60, 172, 21, 210, 86, 172, 21, 110, 172, 
-    21, 105, 172, 21, 158, 172, 21, 161, 172, 21, 189, 172, 21, 194, 172, 21, 
-    198, 172, 21, 195, 172, 21, 200, 172, 224, 141, 218, 251, 172, 224, 141, 
-    248, 178, 172, 224, 141, 52, 248, 178, 172, 224, 141, 215, 211, 248, 178, 
-    68, 1, 234, 126, 243, 135, 68, 1, 234, 126, 251, 33, 68, 1, 234, 126, 
-    250, 157, 68, 1, 234, 126, 235, 141, 68, 1, 234, 126, 235, 114, 68, 1, 
-    234, 126, 227, 165, 68, 1, 234, 126, 215, 156, 68, 1, 234, 126, 215, 144, 
-    68, 1, 234, 126, 248, 135, 68, 1, 234, 126, 248, 119, 68, 1, 234, 126, 
-    248, 25, 68, 1, 234, 126, 197, 68, 1, 234, 126, 206, 68, 1, 234, 126, 
-    162, 68, 1, 234, 126, 241, 189, 68, 1, 234, 126, 244, 196, 68, 58, 1, 
-    234, 126, 223, 109, 68, 1, 234, 126, 211, 165, 68, 1, 234, 126, 210, 116, 
-    68, 1, 234, 126, 205, 68, 232, 145, 234, 126, 226, 253, 68, 232, 145, 
-    234, 126, 224, 43, 68, 232, 145, 234, 126, 241, 121, 68, 16, 254, 190, 
-    245, 30, 68, 16, 254, 190, 110, 68, 16, 254, 190, 105, 68, 1, 254, 190, 
-    205, 68, 5, 226, 23, 234, 213, 216, 30, 39, 208, 1, 121, 234, 28, 39, 
-    208, 1, 125, 234, 28, 39, 208, 1, 121, 234, 105, 39, 208, 1, 125, 234, 
-    105, 39, 208, 1, 121, 234, 114, 39, 208, 1, 125, 234, 114, 39, 208, 1, 
-    121, 242, 174, 39, 208, 1, 125, 242, 174, 39, 208, 1, 121, 229, 4, 39, 
-    208, 1, 125, 229, 4, 39, 208, 1, 121, 249, 238, 39, 208, 1, 125, 249, 
-    238, 39, 208, 1, 121, 250, 86, 39, 208, 1, 125, 250, 86, 39, 208, 1, 121, 
-    219, 58, 39, 208, 1, 125, 219, 58, 39, 208, 1, 121, 227, 134, 39, 208, 1, 
-    125, 227, 134, 39, 208, 1, 121, 247, 145, 39, 208, 1, 125, 247, 145, 39, 
-    208, 1, 121, 111, 39, 208, 1, 125, 111, 39, 208, 1, 121, 216, 156, 39, 
-    208, 1, 125, 216, 156, 39, 208, 1, 121, 228, 74, 39, 208, 1, 125, 228, 
-    74, 39, 208, 1, 121, 251, 205, 39, 208, 1, 125, 251, 205, 39, 208, 1, 
-    121, 225, 16, 39, 208, 1, 125, 225, 16, 39, 208, 1, 121, 225, 121, 39, 
-    208, 1, 125, 225, 121, 39, 208, 1, 121, 244, 43, 39, 208, 1, 125, 244, 
-    43, 39, 208, 1, 121, 230, 161, 39, 208, 1, 125, 230, 161, 39, 208, 1, 
-    121, 210, 244, 39, 208, 1, 125, 210, 244, 39, 208, 1, 121, 222, 211, 39, 
-    208, 1, 125, 222, 211, 39, 208, 1, 121, 232, 156, 39, 208, 1, 125, 232, 
-    156, 39, 208, 1, 121, 213, 138, 39, 208, 1, 125, 213, 138, 39, 208, 1, 
-    121, 241, 68, 39, 208, 1, 125, 241, 68, 39, 208, 1, 121, 76, 39, 208, 1, 
-    125, 76, 39, 208, 231, 204, 234, 230, 39, 208, 25, 255, 73, 39, 208, 25, 
-    73, 39, 208, 25, 214, 214, 39, 208, 25, 70, 39, 208, 25, 75, 39, 208, 25, 
-    76, 39, 208, 231, 204, 234, 108, 39, 208, 25, 240, 119, 39, 208, 25, 214, 
-    213, 39, 208, 25, 214, 229, 39, 208, 25, 253, 190, 39, 208, 25, 253, 167, 
-    39, 208, 25, 254, 123, 39, 208, 25, 254, 136, 39, 208, 138, 231, 204, 
-    245, 180, 39, 208, 138, 231, 204, 227, 206, 39, 208, 138, 231, 204, 216, 
-    156, 39, 208, 138, 231, 204, 219, 42, 39, 208, 16, 234, 13, 39, 208, 16, 
-    227, 206, 39, 208, 16, 221, 253, 39, 208, 16, 241, 69, 241, 64, 39, 208, 
-    16, 234, 22, 234, 21, 186, 185, 1, 75, 186, 185, 1, 76, 186, 185, 1, 250, 
-    157, 186, 185, 1, 227, 165, 186, 185, 1, 215, 156, 186, 185, 1, 215, 144, 
-    186, 185, 1, 248, 135, 186, 185, 1, 248, 119, 186, 185, 1, 228, 110, 186, 
-    185, 1, 220, 102, 186, 185, 1, 218, 223, 186, 185, 25, 5, 236, 33, 186, 
-    185, 25, 5, 214, 118, 186, 185, 25, 5, 255, 37, 186, 185, 25, 5, 253, 
-    192, 186, 185, 25, 5, 255, 30, 186, 185, 250, 125, 186, 185, 254, 206, 
-    234, 98, 186, 185, 254, 103, 186, 185, 3, 223, 74, 78, 186, 185, 211, 
-    209, 223, 74, 78, 186, 185, 25, 5, 213, 147, 186, 185, 213, 152, 29, 3, 
-    215, 137, 29, 3, 215, 140, 29, 3, 215, 143, 29, 3, 215, 141, 29, 3, 215, 
-    142, 29, 3, 215, 139, 29, 3, 248, 113, 29, 3, 248, 115, 29, 3, 248, 118, 
-    29, 3, 248, 116, 29, 3, 248, 117, 29, 3, 248, 114, 29, 3, 246, 28, 29, 3, 
-    246, 31, 29, 3, 246, 37, 29, 3, 246, 35, 29, 3, 246, 36, 29, 3, 246, 29, 
-    29, 3, 250, 204, 29, 3, 250, 198, 29, 3, 250, 200, 29, 3, 250, 203, 29, 
-    3, 250, 201, 29, 3, 250, 202, 29, 3, 250, 199, 29, 3, 252, 111, 29, 3, 
-    252, 90, 29, 3, 252, 102, 29, 3, 252, 110, 29, 3, 252, 105, 29, 3, 252, 
-    106, 29, 3, 252, 94, 186, 185, 1, 234, 19, 186, 185, 1, 221, 253, 186, 
-    185, 1, 233, 109, 186, 185, 1, 230, 172, 186, 185, 1, 190, 186, 185, 1, 
-    197, 186, 185, 1, 250, 102, 186, 185, 1, 216, 90, 186, 185, 1, 234, 101, 
-    186, 185, 1, 228, 250, 186, 185, 1, 216, 150, 186, 185, 1, 212, 60, 186, 
-    185, 1, 211, 69, 186, 185, 1, 240, 216, 186, 185, 1, 214, 190, 186, 185, 
-    1, 73, 186, 185, 1, 225, 142, 186, 185, 1, 253, 202, 186, 185, 1, 242, 
-    167, 186, 185, 1, 235, 112, 186, 185, 1, 223, 166, 186, 185, 1, 252, 191, 
-    186, 185, 1, 235, 100, 186, 185, 1, 247, 219, 186, 185, 1, 242, 221, 186, 
-    185, 1, 248, 5, 186, 185, 1, 252, 16, 186, 185, 1, 234, 20, 232, 128, 
-    186, 185, 1, 233, 110, 232, 128, 186, 185, 1, 230, 173, 232, 128, 186, 
-    185, 1, 226, 90, 232, 128, 186, 185, 1, 229, 229, 232, 128, 186, 185, 1, 
-    216, 91, 232, 128, 186, 185, 1, 228, 251, 232, 128, 186, 185, 1, 240, 
-    154, 232, 128, 186, 185, 25, 5, 226, 195, 186, 185, 25, 5, 235, 253, 186, 
-    185, 25, 5, 254, 122, 186, 185, 25, 5, 211, 38, 186, 185, 25, 5, 219, 32, 
-    186, 185, 25, 5, 214, 187, 186, 185, 25, 5, 250, 123, 186, 185, 25, 5, 
-    227, 191, 186, 185, 250, 124, 186, 185, 232, 85, 235, 150, 186, 185, 254, 
-    46, 235, 150, 186, 185, 21, 210, 86, 186, 185, 21, 110, 186, 185, 21, 
-    105, 186, 185, 21, 158, 186, 185, 21, 161, 186, 185, 21, 189, 186, 185, 
-    21, 194, 186, 185, 21, 198, 186, 185, 21, 195, 186, 185, 21, 200, 24, 
-    143, 227, 77, 24, 143, 227, 82, 24, 143, 210, 243, 24, 143, 210, 242, 24, 
-    143, 210, 241, 24, 143, 215, 23, 24, 143, 215, 26, 24, 143, 210, 210, 24, 
-    143, 210, 206, 24, 143, 245, 54, 24, 143, 245, 52, 24, 143, 245, 53, 24, 
-    143, 245, 50, 24, 143, 240, 144, 24, 143, 240, 143, 24, 143, 240, 141, 
-    24, 143, 240, 142, 24, 143, 240, 147, 24, 143, 240, 140, 24, 143, 240, 
-    139, 24, 143, 240, 149, 24, 143, 254, 33, 24, 143, 254, 32, 24, 90, 228, 
-    219, 24, 90, 228, 225, 24, 90, 218, 204, 24, 90, 218, 203, 24, 90, 216, 
-    96, 24, 90, 216, 94, 24, 90, 216, 93, 24, 90, 216, 99, 24, 90, 216, 100, 
-    24, 90, 216, 92, 24, 90, 223, 5, 24, 90, 223, 20, 24, 90, 218, 210, 24, 
-    90, 223, 17, 24, 90, 223, 7, 24, 90, 223, 9, 24, 90, 222, 252, 24, 90, 
-    222, 253, 24, 90, 234, 218, 24, 90, 230, 212, 24, 90, 230, 206, 24, 90, 
-    218, 214, 24, 90, 230, 209, 24, 90, 230, 215, 24, 90, 225, 76, 24, 90, 
-    225, 85, 24, 90, 225, 89, 24, 90, 218, 212, 24, 90, 225, 79, 24, 90, 225, 
-    93, 24, 90, 225, 94, 24, 90, 219, 140, 24, 90, 219, 143, 24, 90, 218, 
-    208, 24, 90, 218, 206, 24, 90, 219, 138, 24, 90, 219, 146, 24, 90, 219, 
-    147, 24, 90, 219, 132, 24, 90, 219, 145, 24, 90, 226, 30, 24, 90, 226, 
-    31, 24, 90, 211, 24, 24, 90, 211, 25, 24, 90, 250, 44, 24, 90, 250, 43, 
-    24, 90, 218, 219, 24, 90, 225, 128, 24, 90, 225, 127, 9, 14, 238, 24, 9, 
-    14, 238, 23, 9, 14, 238, 22, 9, 14, 238, 21, 9, 14, 238, 20, 9, 14, 238, 
-    19, 9, 14, 238, 18, 9, 14, 238, 17, 9, 14, 238, 16, 9, 14, 238, 15, 9, 
-    14, 238, 14, 9, 14, 238, 13, 9, 14, 238, 12, 9, 14, 238, 11, 9, 14, 238, 
-    10, 9, 14, 238, 9, 9, 14, 238, 8, 9, 14, 238, 7, 9, 14, 238, 6, 9, 14, 
-    238, 5, 9, 14, 238, 4, 9, 14, 238, 3, 9, 14, 238, 2, 9, 14, 238, 1, 9, 
-    14, 238, 0, 9, 14, 237, 255, 9, 14, 237, 254, 9, 14, 237, 253, 9, 14, 
-    237, 252, 9, 14, 237, 251, 9, 14, 237, 250, 9, 14, 237, 249, 9, 14, 237, 
-    248, 9, 14, 237, 247, 9, 14, 237, 246, 9, 14, 237, 245, 9, 14, 237, 244, 
-    9, 14, 237, 243, 9, 14, 237, 242, 9, 14, 237, 241, 9, 14, 237, 240, 9, 
-    14, 237, 239, 9, 14, 237, 238, 9, 14, 237, 237, 9, 14, 237, 236, 9, 14, 
-    237, 235, 9, 14, 237, 234, 9, 14, 237, 233, 9, 14, 237, 232, 9, 14, 237, 
-    231, 9, 14, 237, 230, 9, 14, 237, 229, 9, 14, 237, 228, 9, 14, 237, 227, 
-    9, 14, 237, 226, 9, 14, 237, 225, 9, 14, 237, 224, 9, 14, 237, 223, 9, 
-    14, 237, 222, 9, 14, 237, 221, 9, 14, 237, 220, 9, 14, 237, 219, 9, 14, 
-    237, 218, 9, 14, 237, 217, 9, 14, 237, 216, 9, 14, 237, 215, 9, 14, 237, 
-    214, 9, 14, 237, 213, 9, 14, 237, 212, 9, 14, 237, 211, 9, 14, 237, 210, 
-    9, 14, 237, 209, 9, 14, 237, 208, 9, 14, 237, 207, 9, 14, 237, 206, 9, 
-    14, 237, 205, 9, 14, 237, 204, 9, 14, 237, 203, 9, 14, 237, 202, 9, 14, 
-    237, 201, 9, 14, 237, 200, 9, 14, 237, 199, 9, 14, 237, 198, 9, 14, 237, 
-    197, 9, 14, 237, 196, 9, 14, 237, 195, 9, 14, 237, 194, 9, 14, 237, 193, 
-    9, 14, 237, 192, 9, 14, 237, 191, 9, 14, 237, 190, 9, 14, 237, 189, 9, 
-    14, 237, 188, 9, 14, 237, 187, 9, 14, 237, 186, 9, 14, 237, 185, 9, 14, 
-    237, 184, 9, 14, 237, 183, 9, 14, 237, 182, 9, 14, 237, 181, 9, 14, 237, 
-    180, 9, 14, 237, 179, 9, 14, 237, 178, 9, 14, 237, 177, 9, 14, 237, 176, 
-    9, 14, 237, 175, 9, 14, 237, 174, 9, 14, 237, 173, 9, 14, 237, 172, 9, 
-    14, 237, 171, 9, 14, 237, 170, 9, 14, 237, 169, 9, 14, 237, 168, 9, 14, 
-    237, 167, 9, 14, 237, 166, 9, 14, 237, 165, 9, 14, 237, 164, 9, 14, 237, 
-    163, 9, 14, 237, 162, 9, 14, 237, 161, 9, 14, 237, 160, 9, 14, 237, 159, 
-    9, 14, 237, 158, 9, 14, 237, 157, 9, 14, 237, 156, 9, 14, 237, 155, 9, 
-    14, 237, 154, 9, 14, 237, 153, 9, 14, 237, 152, 9, 14, 237, 151, 9, 14, 
-    237, 150, 9, 14, 237, 149, 9, 14, 237, 148, 9, 14, 237, 147, 9, 14, 237, 
-    146, 9, 14, 237, 145, 9, 14, 237, 144, 9, 14, 237, 143, 9, 14, 237, 142, 
-    9, 14, 237, 141, 9, 14, 237, 140, 9, 14, 237, 139, 9, 14, 237, 138, 9, 
-    14, 237, 137, 9, 14, 237, 136, 9, 14, 237, 135, 9, 14, 237, 134, 9, 14, 
-    237, 133, 9, 14, 237, 132, 9, 14, 237, 131, 9, 14, 237, 130, 9, 14, 237, 
-    129, 9, 14, 237, 128, 9, 14, 237, 127, 9, 14, 237, 126, 9, 14, 237, 125, 
-    9, 14, 237, 124, 9, 14, 237, 123, 9, 14, 237, 122, 9, 14, 237, 121, 9, 
-    14, 237, 120, 9, 14, 237, 119, 9, 14, 237, 118, 9, 14, 237, 117, 9, 14, 
-    237, 116, 9, 14, 237, 115, 9, 14, 237, 114, 9, 14, 237, 113, 9, 14, 237, 
-    112, 9, 14, 237, 111, 9, 14, 237, 110, 9, 14, 237, 109, 9, 14, 237, 108, 
-    9, 14, 237, 107, 9, 14, 237, 106, 9, 14, 237, 105, 9, 14, 237, 104, 9, 
-    14, 237, 103, 9, 14, 237, 102, 9, 14, 237, 101, 9, 14, 237, 100, 9, 14, 
-    237, 99, 9, 14, 237, 98, 9, 14, 237, 97, 9, 14, 237, 96, 9, 14, 237, 95, 
-    9, 14, 237, 94, 9, 14, 237, 93, 9, 14, 237, 92, 9, 14, 237, 91, 9, 14, 
-    237, 90, 9, 14, 237, 89, 9, 14, 237, 88, 9, 14, 237, 87, 9, 14, 237, 86, 
-    9, 14, 237, 85, 9, 14, 237, 84, 9, 14, 237, 83, 9, 14, 237, 82, 9, 14, 
-    237, 81, 9, 14, 237, 80, 9, 14, 237, 79, 9, 14, 237, 78, 9, 14, 237, 77, 
-    9, 14, 237, 76, 9, 14, 237, 75, 9, 14, 237, 74, 9, 14, 237, 73, 9, 14, 
-    237, 72, 9, 14, 237, 71, 9, 14, 237, 70, 9, 14, 237, 69, 9, 14, 237, 68, 
-    9, 14, 237, 67, 9, 14, 237, 66, 9, 14, 237, 65, 9, 14, 237, 64, 9, 14, 
-    237, 63, 9, 14, 237, 62, 9, 14, 237, 61, 9, 14, 237, 60, 9, 14, 237, 59, 
-    9, 14, 237, 58, 9, 14, 237, 57, 9, 14, 237, 56, 9, 14, 237, 55, 9, 14, 
-    237, 54, 9, 14, 237, 53, 9, 14, 237, 52, 9, 14, 237, 51, 9, 14, 237, 50, 
-    9, 14, 237, 49, 9, 14, 237, 48, 9, 14, 237, 47, 9, 14, 237, 46, 9, 14, 
-    237, 45, 9, 14, 237, 44, 9, 14, 237, 43, 9, 14, 237, 42, 9, 14, 237, 41, 
-    9, 14, 237, 40, 9, 14, 237, 39, 9, 14, 237, 38, 9, 14, 237, 37, 9, 14, 
-    237, 36, 9, 14, 237, 35, 9, 14, 237, 34, 9, 14, 237, 33, 9, 14, 237, 32, 
-    9, 14, 237, 31, 9, 14, 237, 30, 9, 14, 237, 29, 9, 14, 237, 28, 9, 14, 
-    237, 27, 9, 14, 237, 26, 9, 14, 237, 25, 9, 14, 237, 24, 9, 14, 237, 23, 
-    9, 14, 237, 22, 9, 14, 237, 21, 9, 14, 237, 20, 9, 14, 237, 19, 9, 14, 
-    237, 18, 9, 14, 237, 17, 9, 14, 237, 16, 9, 14, 237, 15, 9, 14, 237, 14, 
-    9, 14, 237, 13, 9, 14, 237, 12, 9, 14, 237, 11, 9, 14, 237, 10, 9, 14, 
-    237, 9, 9, 14, 237, 8, 9, 14, 237, 7, 9, 14, 237, 6, 9, 14, 237, 5, 9, 
-    14, 237, 4, 9, 14, 237, 3, 9, 14, 237, 2, 9, 14, 237, 1, 9, 14, 237, 0, 
-    9, 14, 236, 255, 9, 14, 236, 254, 9, 14, 236, 253, 9, 14, 236, 252, 9, 
-    14, 236, 251, 9, 14, 236, 250, 9, 14, 236, 249, 9, 14, 236, 248, 9, 14, 
-    236, 247, 9, 14, 236, 246, 9, 14, 236, 245, 9, 14, 236, 244, 9, 14, 236, 
-    243, 9, 14, 236, 242, 9, 14, 236, 241, 9, 14, 236, 240, 9, 14, 236, 239, 
-    9, 14, 236, 238, 9, 14, 236, 237, 9, 14, 236, 236, 9, 14, 236, 235, 9, 
-    14, 236, 234, 9, 14, 236, 233, 9, 14, 236, 232, 9, 14, 236, 231, 9, 14, 
-    236, 230, 9, 14, 236, 229, 9, 14, 236, 228, 9, 14, 236, 227, 9, 14, 236, 
-    226, 9, 14, 236, 225, 9, 14, 236, 224, 9, 14, 236, 223, 9, 14, 236, 222, 
-    9, 14, 236, 221, 9, 14, 236, 220, 9, 14, 236, 219, 9, 14, 236, 218, 9, 
-    14, 236, 217, 9, 14, 236, 216, 9, 14, 236, 215, 9, 14, 236, 214, 9, 14, 
-    236, 213, 9, 14, 236, 212, 9, 14, 236, 211, 9, 14, 236, 210, 9, 14, 236, 
-    209, 9, 14, 236, 208, 9, 14, 236, 207, 9, 14, 236, 206, 9, 14, 236, 205, 
-    9, 14, 236, 204, 9, 14, 236, 203, 9, 14, 236, 202, 9, 14, 236, 201, 9, 
-    14, 236, 200, 9, 14, 236, 199, 9, 14, 236, 198, 9, 14, 236, 197, 9, 14, 
-    236, 196, 9, 14, 236, 195, 9, 14, 236, 194, 9, 14, 236, 193, 9, 14, 236, 
-    192, 9, 14, 236, 191, 9, 14, 236, 190, 9, 14, 236, 189, 9, 14, 236, 188, 
-    9, 14, 236, 187, 9, 14, 236, 186, 9, 14, 236, 185, 9, 14, 236, 184, 9, 
-    14, 236, 183, 9, 14, 236, 182, 9, 14, 236, 181, 9, 14, 236, 180, 9, 14, 
-    236, 179, 9, 14, 236, 178, 9, 14, 236, 177, 9, 14, 236, 176, 9, 14, 236, 
-    175, 9, 14, 236, 174, 9, 14, 236, 173, 9, 14, 236, 172, 9, 14, 236, 171, 
-    9, 14, 236, 170, 9, 14, 236, 169, 9, 14, 236, 168, 9, 14, 236, 167, 9, 
-    14, 236, 166, 9, 14, 236, 165, 9, 14, 236, 164, 9, 14, 236, 163, 9, 14, 
-    236, 162, 9, 14, 236, 161, 9, 14, 236, 160, 9, 14, 236, 159, 9, 14, 236, 
-    158, 9, 14, 236, 157, 9, 14, 236, 156, 9, 14, 236, 155, 9, 14, 236, 154, 
-    9, 14, 236, 153, 9, 14, 236, 152, 9, 14, 236, 151, 9, 14, 236, 150, 9, 
-    14, 236, 149, 9, 14, 236, 148, 9, 14, 236, 147, 9, 14, 236, 146, 9, 14, 
-    236, 145, 9, 14, 236, 144, 9, 14, 236, 143, 9, 14, 236, 142, 9, 14, 236, 
-    141, 9, 14, 236, 140, 9, 14, 236, 139, 9, 14, 236, 138, 9, 14, 236, 137, 
-    9, 14, 236, 136, 9, 14, 236, 135, 9, 14, 236, 134, 9, 14, 236, 133, 9, 
-    14, 236, 132, 9, 14, 236, 131, 9, 14, 236, 130, 9, 14, 236, 129, 9, 14, 
-    236, 128, 9, 14, 236, 127, 9, 14, 236, 126, 9, 14, 236, 125, 9, 14, 236, 
-    124, 9, 14, 236, 123, 9, 14, 236, 122, 9, 14, 236, 121, 9, 14, 236, 120, 
-    9, 14, 236, 119, 9, 14, 236, 118, 9, 14, 236, 117, 9, 14, 236, 116, 9, 
-    14, 236, 115, 9, 14, 236, 114, 9, 14, 236, 113, 9, 14, 236, 112, 9, 14, 
-    236, 111, 9, 14, 236, 110, 9, 14, 236, 109, 9, 14, 236, 108, 9, 14, 236, 
-    107, 9, 14, 236, 106, 9, 14, 236, 105, 9, 14, 236, 104, 9, 14, 236, 103, 
-    9, 14, 236, 102, 9, 14, 236, 101, 9, 14, 236, 100, 9, 14, 236, 99, 9, 14, 
-    236, 98, 9, 14, 236, 97, 9, 14, 236, 96, 9, 14, 236, 95, 9, 14, 236, 94, 
-    9, 14, 236, 93, 9, 14, 236, 92, 9, 14, 236, 91, 9, 14, 236, 90, 9, 14, 
-    236, 89, 9, 14, 236, 88, 9, 14, 236, 87, 9, 14, 236, 86, 9, 14, 236, 85, 
-    9, 14, 236, 84, 9, 14, 236, 83, 9, 14, 236, 82, 9, 14, 236, 81, 9, 14, 
-    236, 80, 9, 14, 236, 79, 9, 14, 236, 78, 9, 14, 236, 77, 9, 14, 236, 76, 
-    9, 14, 236, 75, 9, 14, 236, 74, 9, 14, 236, 73, 9, 14, 236, 72, 9, 14, 
-    236, 71, 9, 14, 236, 70, 9, 14, 236, 69, 9, 14, 236, 68, 9, 14, 236, 67, 
-    9, 14, 236, 66, 9, 14, 236, 65, 7, 4, 27, 244, 125, 7, 4, 27, 244, 121, 
-    7, 4, 27, 244, 76, 7, 4, 27, 244, 124, 7, 4, 27, 244, 123, 7, 4, 27, 199, 
-    222, 92, 217, 152, 7, 4, 27, 218, 168, 150, 4, 27, 231, 59, 228, 39, 150, 
-    4, 27, 231, 59, 245, 213, 150, 4, 27, 231, 59, 235, 227, 150, 4, 27, 213, 
-    180, 228, 39, 150, 4, 27, 231, 59, 211, 160, 94, 1, 210, 234, 2, 241, 
-    158, 94, 225, 11, 235, 50, 214, 11, 94, 27, 211, 6, 210, 234, 210, 234, 
-    225, 239, 94, 1, 254, 139, 253, 162, 94, 1, 211, 247, 254, 170, 94, 1, 
-    211, 247, 248, 189, 94, 1, 211, 247, 241, 238, 94, 1, 211, 247, 234, 250, 
-    94, 1, 211, 247, 233, 94, 94, 1, 211, 247, 40, 231, 65, 94, 1, 211, 247, 
-    223, 67, 94, 1, 211, 247, 217, 38, 94, 1, 254, 139, 96, 50, 94, 1, 220, 
-    21, 2, 220, 21, 247, 120, 94, 1, 220, 21, 2, 219, 159, 247, 120, 94, 1, 
-    220, 21, 2, 248, 208, 22, 220, 21, 247, 120, 94, 1, 220, 21, 2, 248, 208, 
-    22, 219, 159, 247, 120, 94, 1, 112, 2, 225, 239, 94, 1, 112, 2, 224, 76, 
-    94, 1, 112, 2, 231, 171, 94, 1, 252, 29, 2, 248, 207, 94, 1, 242, 202, 2, 
-    248, 207, 94, 1, 248, 190, 2, 248, 207, 94, 1, 241, 239, 2, 231, 171, 94, 
-    1, 214, 4, 2, 248, 207, 94, 1, 210, 98, 2, 248, 207, 94, 1, 216, 231, 2, 
-    248, 207, 94, 1, 210, 234, 2, 248, 207, 94, 1, 40, 234, 251, 2, 248, 207, 
-    94, 1, 234, 251, 2, 248, 207, 94, 1, 233, 95, 2, 248, 207, 94, 1, 231, 
-    66, 2, 248, 207, 94, 1, 227, 195, 2, 248, 207, 94, 1, 221, 250, 2, 248, 
-    207, 94, 1, 40, 225, 222, 2, 248, 207, 94, 1, 225, 222, 2, 248, 207, 94, 
-    1, 215, 180, 2, 248, 207, 94, 1, 224, 40, 2, 248, 207, 94, 1, 223, 68, 2, 
-    248, 207, 94, 1, 220, 21, 2, 248, 207, 94, 1, 217, 39, 2, 248, 207, 94, 
-    1, 214, 4, 2, 241, 61, 94, 1, 252, 29, 2, 223, 169, 94, 1, 234, 251, 2, 
-    223, 169, 94, 1, 225, 222, 2, 223, 169, 94, 27, 112, 233, 94, 10, 1, 112, 
-    212, 47, 53, 17, 10, 1, 112, 212, 47, 40, 17, 10, 1, 252, 65, 53, 17, 10, 
-    1, 252, 65, 40, 17, 10, 1, 252, 65, 65, 17, 10, 1, 252, 65, 147, 17, 10, 
-    1, 225, 206, 53, 17, 10, 1, 225, 206, 40, 17, 10, 1, 225, 206, 65, 17, 
-    10, 1, 225, 206, 147, 17, 10, 1, 252, 53, 53, 17, 10, 1, 252, 53, 40, 17, 
-    10, 1, 252, 53, 65, 17, 10, 1, 252, 53, 147, 17, 10, 1, 215, 147, 53, 17, 
-    10, 1, 215, 147, 40, 17, 10, 1, 215, 147, 65, 17, 10, 1, 215, 147, 147, 
-    17, 10, 1, 217, 6, 53, 17, 10, 1, 217, 6, 40, 17, 10, 1, 217, 6, 65, 17, 
-    10, 1, 217, 6, 147, 17, 10, 1, 215, 149, 53, 17, 10, 1, 215, 149, 40, 17, 
-    10, 1, 215, 149, 65, 17, 10, 1, 215, 149, 147, 17, 10, 1, 213, 249, 53, 
-    17, 10, 1, 213, 249, 40, 17, 10, 1, 213, 249, 65, 17, 10, 1, 213, 249, 
-    147, 17, 10, 1, 225, 204, 53, 17, 10, 1, 225, 204, 40, 17, 10, 1, 225, 
-    204, 65, 17, 10, 1, 225, 204, 147, 17, 10, 1, 246, 44, 53, 17, 10, 1, 
-    246, 44, 40, 17, 10, 1, 246, 44, 65, 17, 10, 1, 246, 44, 147, 17, 10, 1, 
-    227, 154, 53, 17, 10, 1, 227, 154, 40, 17, 10, 1, 227, 154, 65, 17, 10, 
-    1, 227, 154, 147, 17, 10, 1, 217, 27, 53, 17, 10, 1, 217, 27, 40, 17, 10, 
-    1, 217, 27, 65, 17, 10, 1, 217, 27, 147, 17, 10, 1, 217, 25, 53, 17, 10, 
-    1, 217, 25, 40, 17, 10, 1, 217, 25, 65, 17, 10, 1, 217, 25, 147, 17, 10, 
-    1, 248, 133, 53, 17, 10, 1, 248, 133, 40, 17, 10, 1, 248, 202, 53, 17, 
-    10, 1, 248, 202, 40, 17, 10, 1, 246, 71, 53, 17, 10, 1, 246, 71, 40, 17, 
-    10, 1, 248, 131, 53, 17, 10, 1, 248, 131, 40, 17, 10, 1, 235, 121, 53, 
-    17, 10, 1, 235, 121, 40, 17, 10, 1, 222, 172, 53, 17, 10, 1, 222, 172, 
-    40, 17, 10, 1, 234, 175, 53, 17, 10, 1, 234, 175, 40, 17, 10, 1, 234, 
-    175, 65, 17, 10, 1, 234, 175, 147, 17, 10, 1, 243, 123, 53, 17, 10, 1, 
-    243, 123, 40, 17, 10, 1, 243, 123, 65, 17, 10, 1, 243, 123, 147, 17, 10, 
-    1, 242, 102, 53, 17, 10, 1, 242, 102, 40, 17, 10, 1, 242, 102, 65, 17, 
-    10, 1, 242, 102, 147, 17, 10, 1, 229, 3, 53, 17, 10, 1, 229, 3, 40, 17, 
-    10, 1, 229, 3, 65, 17, 10, 1, 229, 3, 147, 17, 10, 1, 228, 63, 242, 219, 
-    53, 17, 10, 1, 228, 63, 242, 219, 40, 17, 10, 1, 222, 215, 53, 17, 10, 1, 
-    222, 215, 40, 17, 10, 1, 222, 215, 65, 17, 10, 1, 222, 215, 147, 17, 10, 
-    1, 241, 219, 2, 79, 77, 53, 17, 10, 1, 241, 219, 2, 79, 77, 40, 17, 10, 
-    1, 241, 219, 242, 172, 53, 17, 10, 1, 241, 219, 242, 172, 40, 17, 10, 1, 
-    241, 219, 242, 172, 65, 17, 10, 1, 241, 219, 242, 172, 147, 17, 10, 1, 
-    241, 219, 247, 142, 53, 17, 10, 1, 241, 219, 247, 142, 40, 17, 10, 1, 
-    241, 219, 247, 142, 65, 17, 10, 1, 241, 219, 247, 142, 147, 17, 10, 1, 
-    79, 252, 133, 53, 17, 10, 1, 79, 252, 133, 40, 17, 10, 1, 79, 252, 133, 
-    2, 202, 77, 53, 17, 10, 1, 79, 252, 133, 2, 202, 77, 40, 17, 10, 16, 59, 
-    48, 10, 16, 59, 51, 10, 16, 113, 170, 48, 10, 16, 113, 170, 51, 10, 16, 
-    134, 170, 48, 10, 16, 134, 170, 51, 10, 16, 134, 170, 225, 7, 246, 104, 
-    48, 10, 16, 134, 170, 225, 7, 246, 104, 51, 10, 16, 244, 11, 170, 48, 10, 
-    16, 244, 11, 170, 51, 10, 16, 52, 67, 252, 141, 51, 10, 16, 113, 170, 
-    213, 189, 48, 10, 16, 113, 170, 213, 189, 51, 10, 16, 222, 233, 10, 16, 
-    4, 217, 81, 48, 10, 16, 4, 217, 81, 51, 10, 1, 229, 80, 53, 17, 10, 1, 
-    229, 80, 40, 17, 10, 1, 229, 80, 65, 17, 10, 1, 229, 80, 147, 17, 10, 1, 
-    104, 53, 17, 10, 1, 104, 40, 17, 10, 1, 226, 235, 53, 17, 10, 1, 226, 
-    235, 40, 17, 10, 1, 210, 213, 53, 17, 10, 1, 210, 213, 40, 17, 10, 1, 
-    104, 2, 202, 77, 53, 17, 10, 1, 214, 0, 53, 17, 10, 1, 214, 0, 40, 17, 
-    10, 1, 234, 73, 226, 235, 53, 17, 10, 1, 234, 73, 226, 235, 40, 17, 10, 
-    1, 234, 73, 210, 213, 53, 17, 10, 1, 234, 73, 210, 213, 40, 17, 10, 1, 
-    160, 53, 17, 10, 1, 160, 40, 17, 10, 1, 160, 65, 17, 10, 1, 160, 147, 17, 
-    10, 1, 214, 207, 234, 186, 234, 73, 112, 231, 193, 65, 17, 10, 1, 214, 
-    207, 234, 186, 234, 73, 112, 231, 193, 147, 17, 10, 27, 79, 2, 202, 77, 
-    2, 112, 53, 17, 10, 27, 79, 2, 202, 77, 2, 112, 40, 17, 10, 27, 79, 2, 
-    202, 77, 2, 254, 244, 53, 17, 10, 27, 79, 2, 202, 77, 2, 254, 244, 40, 
-    17, 10, 27, 79, 2, 202, 77, 2, 212, 31, 53, 17, 10, 27, 79, 2, 202, 77, 
-    2, 212, 31, 40, 17, 10, 27, 79, 2, 202, 77, 2, 104, 53, 17, 10, 27, 79, 
-    2, 202, 77, 2, 104, 40, 17, 10, 27, 79, 2, 202, 77, 2, 226, 235, 53, 17, 
-    10, 27, 79, 2, 202, 77, 2, 226, 235, 40, 17, 10, 27, 79, 2, 202, 77, 2, 
-    210, 213, 53, 17, 10, 27, 79, 2, 202, 77, 2, 210, 213, 40, 17, 10, 27, 
-    79, 2, 202, 77, 2, 160, 53, 17, 10, 27, 79, 2, 202, 77, 2, 160, 40, 17, 
-    10, 27, 79, 2, 202, 77, 2, 160, 65, 17, 10, 27, 214, 207, 234, 73, 79, 2, 
-    202, 77, 2, 112, 231, 193, 53, 17, 10, 27, 214, 207, 234, 73, 79, 2, 202, 
-    77, 2, 112, 231, 193, 40, 17, 10, 27, 214, 207, 234, 73, 79, 2, 202, 77, 
-    2, 112, 231, 193, 65, 17, 10, 1, 244, 168, 79, 53, 17, 10, 1, 244, 168, 
-    79, 40, 17, 10, 1, 244, 168, 79, 65, 17, 10, 1, 244, 168, 79, 147, 17, 
-    10, 27, 79, 2, 202, 77, 2, 151, 53, 17, 10, 27, 79, 2, 202, 77, 2, 122, 
-    53, 17, 10, 27, 79, 2, 202, 77, 2, 66, 53, 17, 10, 27, 79, 2, 202, 77, 2, 
-    112, 231, 193, 53, 17, 10, 27, 79, 2, 202, 77, 2, 79, 53, 17, 10, 27, 
-    252, 55, 2, 151, 53, 17, 10, 27, 252, 55, 2, 122, 53, 17, 10, 27, 252, 
-    55, 2, 234, 130, 53, 17, 10, 27, 252, 55, 2, 66, 53, 17, 10, 27, 252, 55, 
-    2, 112, 231, 193, 53, 17, 10, 27, 252, 55, 2, 79, 53, 17, 10, 27, 217, 8, 
-    2, 151, 53, 17, 10, 27, 217, 8, 2, 122, 53, 17, 10, 27, 217, 8, 2, 234, 
-    130, 53, 17, 10, 27, 217, 8, 2, 66, 53, 17, 10, 27, 217, 8, 2, 112, 231, 
-    193, 53, 17, 10, 27, 217, 8, 2, 79, 53, 17, 10, 27, 216, 193, 2, 151, 53, 
-    17, 10, 27, 216, 193, 2, 66, 53, 17, 10, 27, 216, 193, 2, 112, 231, 193, 
-    53, 17, 10, 27, 216, 193, 2, 79, 53, 17, 10, 27, 151, 2, 122, 53, 17, 10, 
-    27, 151, 2, 66, 53, 17, 10, 27, 122, 2, 151, 53, 17, 10, 27, 122, 2, 66, 
-    53, 17, 10, 27, 234, 130, 2, 151, 53, 17, 10, 27, 234, 130, 2, 122, 53, 
-    17, 10, 27, 234, 130, 2, 66, 53, 17, 10, 27, 221, 167, 2, 151, 53, 17, 
-    10, 27, 221, 167, 2, 122, 53, 17, 10, 27, 221, 167, 2, 234, 130, 53, 17, 
-    10, 27, 221, 167, 2, 66, 53, 17, 10, 27, 222, 27, 2, 122, 53, 17, 10, 27, 
-    222, 27, 2, 66, 53, 17, 10, 27, 248, 217, 2, 151, 53, 17, 10, 27, 248, 
-    217, 2, 122, 53, 17, 10, 27, 248, 217, 2, 234, 130, 53, 17, 10, 27, 248, 
-    217, 2, 66, 53, 17, 10, 27, 217, 81, 2, 122, 53, 17, 10, 27, 217, 81, 2, 
-    66, 53, 17, 10, 27, 210, 112, 2, 66, 53, 17, 10, 27, 254, 197, 2, 151, 
-    53, 17, 10, 27, 254, 197, 2, 66, 53, 17, 10, 27, 242, 245, 2, 151, 53, 
-    17, 10, 27, 242, 245, 2, 66, 53, 17, 10, 27, 244, 143, 2, 151, 53, 17, 
-    10, 27, 244, 143, 2, 122, 53, 17, 10, 27, 244, 143, 2, 234, 130, 53, 17, 
-    10, 27, 244, 143, 2, 66, 53, 17, 10, 27, 244, 143, 2, 112, 231, 193, 53, 
-    17, 10, 27, 244, 143, 2, 79, 53, 17, 10, 27, 224, 82, 2, 122, 53, 17, 10, 
-    27, 224, 82, 2, 66, 53, 17, 10, 27, 224, 82, 2, 112, 231, 193, 53, 17, 
-    10, 27, 224, 82, 2, 79, 53, 17, 10, 27, 234, 251, 2, 112, 53, 17, 10, 27, 
-    234, 251, 2, 151, 53, 17, 10, 27, 234, 251, 2, 122, 53, 17, 10, 27, 234, 
-    251, 2, 234, 130, 53, 17, 10, 27, 234, 251, 2, 233, 103, 53, 17, 10, 27, 
-    234, 251, 2, 66, 53, 17, 10, 27, 234, 251, 2, 112, 231, 193, 53, 17, 10, 
-    27, 234, 251, 2, 79, 53, 17, 10, 27, 233, 103, 2, 151, 53, 17, 10, 27, 
-    233, 103, 2, 122, 53, 17, 10, 27, 233, 103, 2, 234, 130, 53, 17, 10, 27, 
-    233, 103, 2, 66, 53, 17, 10, 27, 233, 103, 2, 112, 231, 193, 53, 17, 10, 
-    27, 233, 103, 2, 79, 53, 17, 10, 27, 66, 2, 151, 53, 17, 10, 27, 66, 2, 
-    122, 53, 17, 10, 27, 66, 2, 234, 130, 53, 17, 10, 27, 66, 2, 66, 53, 17, 
-    10, 27, 66, 2, 112, 231, 193, 53, 17, 10, 27, 66, 2, 79, 53, 17, 10, 27, 
-    228, 63, 2, 151, 53, 17, 10, 27, 228, 63, 2, 122, 53, 17, 10, 27, 228, 
-    63, 2, 234, 130, 53, 17, 10, 27, 228, 63, 2, 66, 53, 17, 10, 27, 228, 63, 
-    2, 112, 231, 193, 53, 17, 10, 27, 228, 63, 2, 79, 53, 17, 10, 27, 241, 
-    219, 2, 151, 53, 17, 10, 27, 241, 219, 2, 66, 53, 17, 10, 27, 241, 219, 
-    2, 112, 231, 193, 53, 17, 10, 27, 241, 219, 2, 79, 53, 17, 10, 27, 79, 2, 
-    151, 53, 17, 10, 27, 79, 2, 122, 53, 17, 10, 27, 79, 2, 234, 130, 53, 17, 
-    10, 27, 79, 2, 66, 53, 17, 10, 27, 79, 2, 112, 231, 193, 53, 17, 10, 27, 
-    79, 2, 79, 53, 17, 10, 27, 216, 203, 2, 218, 23, 112, 53, 17, 10, 27, 
-    223, 96, 2, 218, 23, 112, 53, 17, 10, 27, 112, 231, 193, 2, 218, 23, 112, 
-    53, 17, 10, 27, 220, 94, 2, 248, 183, 53, 17, 10, 27, 220, 94, 2, 234, 
-    204, 53, 17, 10, 27, 220, 94, 2, 244, 166, 53, 17, 10, 27, 220, 94, 2, 
-    248, 185, 53, 17, 10, 27, 220, 94, 2, 234, 206, 53, 17, 10, 27, 220, 94, 
-    2, 218, 23, 112, 53, 17, 10, 27, 79, 2, 202, 77, 2, 223, 96, 40, 17, 10, 
-    27, 79, 2, 202, 77, 2, 210, 109, 40, 17, 10, 27, 79, 2, 202, 77, 2, 66, 
-    40, 17, 10, 27, 79, 2, 202, 77, 2, 228, 63, 40, 17, 10, 27, 79, 2, 202, 
-    77, 2, 112, 231, 193, 40, 17, 10, 27, 79, 2, 202, 77, 2, 79, 40, 17, 10, 
-    27, 252, 55, 2, 223, 96, 40, 17, 10, 27, 252, 55, 2, 210, 109, 40, 17, 
-    10, 27, 252, 55, 2, 66, 40, 17, 10, 27, 252, 55, 2, 228, 63, 40, 17, 10, 
-    27, 252, 55, 2, 112, 231, 193, 40, 17, 10, 27, 252, 55, 2, 79, 40, 17, 
-    10, 27, 217, 8, 2, 223, 96, 40, 17, 10, 27, 217, 8, 2, 210, 109, 40, 17, 
-    10, 27, 217, 8, 2, 66, 40, 17, 10, 27, 217, 8, 2, 228, 63, 40, 17, 10, 
-    27, 217, 8, 2, 112, 231, 193, 40, 17, 10, 27, 217, 8, 2, 79, 40, 17, 10, 
-    27, 216, 193, 2, 223, 96, 40, 17, 10, 27, 216, 193, 2, 210, 109, 40, 17, 
-    10, 27, 216, 193, 2, 66, 40, 17, 10, 27, 216, 193, 2, 228, 63, 40, 17, 
-    10, 27, 216, 193, 2, 112, 231, 193, 40, 17, 10, 27, 216, 193, 2, 79, 40, 
-    17, 10, 27, 244, 143, 2, 112, 231, 193, 40, 17, 10, 27, 244, 143, 2, 79, 
-    40, 17, 10, 27, 224, 82, 2, 112, 231, 193, 40, 17, 10, 27, 224, 82, 2, 
-    79, 40, 17, 10, 27, 234, 251, 2, 112, 40, 17, 10, 27, 234, 251, 2, 233, 
-    103, 40, 17, 10, 27, 234, 251, 2, 66, 40, 17, 10, 27, 234, 251, 2, 112, 
-    231, 193, 40, 17, 10, 27, 234, 251, 2, 79, 40, 17, 10, 27, 233, 103, 2, 
-    66, 40, 17, 10, 27, 233, 103, 2, 112, 231, 193, 40, 17, 10, 27, 233, 103, 
-    2, 79, 40, 17, 10, 27, 66, 2, 112, 40, 17, 10, 27, 66, 2, 66, 40, 17, 10, 
-    27, 228, 63, 2, 223, 96, 40, 17, 10, 27, 228, 63, 2, 210, 109, 40, 17, 
-    10, 27, 228, 63, 2, 66, 40, 17, 10, 27, 228, 63, 2, 228, 63, 40, 17, 10, 
-    27, 228, 63, 2, 112, 231, 193, 40, 17, 10, 27, 228, 63, 2, 79, 40, 17, 
-    10, 27, 112, 231, 193, 2, 218, 23, 112, 40, 17, 10, 27, 79, 2, 223, 96, 
-    40, 17, 10, 27, 79, 2, 210, 109, 40, 17, 10, 27, 79, 2, 66, 40, 17, 10, 
-    27, 79, 2, 228, 63, 40, 17, 10, 27, 79, 2, 112, 231, 193, 40, 17, 10, 27, 
-    79, 2, 79, 40, 17, 10, 27, 79, 2, 202, 77, 2, 151, 65, 17, 10, 27, 79, 2, 
-    202, 77, 2, 122, 65, 17, 10, 27, 79, 2, 202, 77, 2, 234, 130, 65, 17, 10, 
-    27, 79, 2, 202, 77, 2, 66, 65, 17, 10, 27, 79, 2, 202, 77, 2, 241, 219, 
-    65, 17, 10, 27, 252, 55, 2, 151, 65, 17, 10, 27, 252, 55, 2, 122, 65, 17, 
-    10, 27, 252, 55, 2, 234, 130, 65, 17, 10, 27, 252, 55, 2, 66, 65, 17, 10, 
-    27, 252, 55, 2, 241, 219, 65, 17, 10, 27, 217, 8, 2, 151, 65, 17, 10, 27, 
-    217, 8, 2, 122, 65, 17, 10, 27, 217, 8, 2, 234, 130, 65, 17, 10, 27, 217, 
-    8, 2, 66, 65, 17, 10, 27, 217, 8, 2, 241, 219, 65, 17, 10, 27, 216, 193, 
-    2, 66, 65, 17, 10, 27, 151, 2, 122, 65, 17, 10, 27, 151, 2, 66, 65, 17, 
-    10, 27, 122, 2, 151, 65, 17, 10, 27, 122, 2, 66, 65, 17, 10, 27, 234, 
-    130, 2, 151, 65, 17, 10, 27, 234, 130, 2, 66, 65, 17, 10, 27, 221, 167, 
-    2, 151, 65, 17, 10, 27, 221, 167, 2, 122, 65, 17, 10, 27, 221, 167, 2, 
-    234, 130, 65, 17, 10, 27, 221, 167, 2, 66, 65, 17, 10, 27, 222, 27, 2, 
-    122, 65, 17, 10, 27, 222, 27, 2, 234, 130, 65, 17, 10, 27, 222, 27, 2, 
-    66, 65, 17, 10, 27, 248, 217, 2, 151, 65, 17, 10, 27, 248, 217, 2, 122, 
-    65, 17, 10, 27, 248, 217, 2, 234, 130, 65, 17, 10, 27, 248, 217, 2, 66, 
-    65, 17, 10, 27, 217, 81, 2, 122, 65, 17, 10, 27, 210, 112, 2, 66, 65, 17, 
-    10, 27, 254, 197, 2, 151, 65, 17, 10, 27, 254, 197, 2, 66, 65, 17, 10, 
-    27, 242, 245, 2, 151, 65, 17, 10, 27, 242, 245, 2, 66, 65, 17, 10, 27, 
-    244, 143, 2, 151, 65, 17, 10, 27, 244, 143, 2, 122, 65, 17, 10, 27, 244, 
-    143, 2, 234, 130, 65, 17, 10, 27, 244, 143, 2, 66, 65, 17, 10, 27, 224, 
-    82, 2, 122, 65, 17, 10, 27, 224, 82, 2, 66, 65, 17, 10, 27, 234, 251, 2, 
-    151, 65, 17, 10, 27, 234, 251, 2, 122, 65, 17, 10, 27, 234, 251, 2, 234, 
-    130, 65, 17, 10, 27, 234, 251, 2, 233, 103, 65, 17, 10, 27, 234, 251, 2, 
-    66, 65, 17, 10, 27, 233, 103, 2, 151, 65, 17, 10, 27, 233, 103, 2, 122, 
-    65, 17, 10, 27, 233, 103, 2, 234, 130, 65, 17, 10, 27, 233, 103, 2, 66, 
-    65, 17, 10, 27, 233, 103, 2, 241, 219, 65, 17, 10, 27, 66, 2, 151, 65, 
-    17, 10, 27, 66, 2, 122, 65, 17, 10, 27, 66, 2, 234, 130, 65, 17, 10, 27, 
-    66, 2, 66, 65, 17, 10, 27, 228, 63, 2, 151, 65, 17, 10, 27, 228, 63, 2, 
-    122, 65, 17, 10, 27, 228, 63, 2, 234, 130, 65, 17, 10, 27, 228, 63, 2, 
-    66, 65, 17, 10, 27, 228, 63, 2, 241, 219, 65, 17, 10, 27, 241, 219, 2, 
-    151, 65, 17, 10, 27, 241, 219, 2, 66, 65, 17, 10, 27, 241, 219, 2, 218, 
-    23, 112, 65, 17, 10, 27, 79, 2, 151, 65, 17, 10, 27, 79, 2, 122, 65, 17, 
-    10, 27, 79, 2, 234, 130, 65, 17, 10, 27, 79, 2, 66, 65, 17, 10, 27, 79, 
-    2, 241, 219, 65, 17, 10, 27, 79, 2, 202, 77, 2, 66, 147, 17, 10, 27, 79, 
-    2, 202, 77, 2, 241, 219, 147, 17, 10, 27, 252, 55, 2, 66, 147, 17, 10, 
-    27, 252, 55, 2, 241, 219, 147, 17, 10, 27, 217, 8, 2, 66, 147, 17, 10, 
-    27, 217, 8, 2, 241, 219, 147, 17, 10, 27, 216, 193, 2, 66, 147, 17, 10, 
-    27, 216, 193, 2, 241, 219, 147, 17, 10, 27, 221, 167, 2, 66, 147, 17, 10, 
-    27, 221, 167, 2, 241, 219, 147, 17, 10, 27, 220, 60, 2, 66, 147, 17, 10, 
-    27, 220, 60, 2, 241, 219, 147, 17, 10, 27, 234, 251, 2, 233, 103, 147, 
-    17, 10, 27, 234, 251, 2, 66, 147, 17, 10, 27, 233, 103, 2, 66, 147, 17, 
-    10, 27, 228, 63, 2, 66, 147, 17, 10, 27, 228, 63, 2, 241, 219, 147, 17, 
-    10, 27, 79, 2, 66, 147, 17, 10, 27, 79, 2, 241, 219, 147, 17, 10, 27, 
-    220, 94, 2, 244, 166, 147, 17, 10, 27, 220, 94, 2, 248, 185, 147, 17, 10, 
-    27, 220, 94, 2, 234, 206, 147, 17, 10, 27, 217, 81, 2, 112, 231, 193, 53, 
-    17, 10, 27, 217, 81, 2, 79, 53, 17, 10, 27, 254, 197, 2, 112, 231, 193, 
-    53, 17, 10, 27, 254, 197, 2, 79, 53, 17, 10, 27, 242, 245, 2, 112, 231, 
-    193, 53, 17, 10, 27, 242, 245, 2, 79, 53, 17, 10, 27, 221, 167, 2, 112, 
-    231, 193, 53, 17, 10, 27, 221, 167, 2, 79, 53, 17, 10, 27, 220, 60, 2, 
-    112, 231, 193, 53, 17, 10, 27, 220, 60, 2, 79, 53, 17, 10, 27, 122, 2, 
-    112, 231, 193, 53, 17, 10, 27, 122, 2, 79, 53, 17, 10, 27, 151, 2, 112, 
-    231, 193, 53, 17, 10, 27, 151, 2, 79, 53, 17, 10, 27, 234, 130, 2, 112, 
-    231, 193, 53, 17, 10, 27, 234, 130, 2, 79, 53, 17, 10, 27, 222, 27, 2, 
-    112, 231, 193, 53, 17, 10, 27, 222, 27, 2, 79, 53, 17, 10, 27, 248, 217, 
-    2, 112, 231, 193, 53, 17, 10, 27, 248, 217, 2, 79, 53, 17, 10, 27, 220, 
-    60, 2, 151, 53, 17, 10, 27, 220, 60, 2, 122, 53, 17, 10, 27, 220, 60, 2, 
-    234, 130, 53, 17, 10, 27, 220, 60, 2, 66, 53, 17, 10, 27, 220, 60, 2, 
-    223, 96, 53, 17, 10, 27, 221, 167, 2, 223, 96, 53, 17, 10, 27, 222, 27, 
-    2, 223, 96, 53, 17, 10, 27, 248, 217, 2, 223, 96, 53, 17, 10, 27, 217, 
-    81, 2, 112, 231, 193, 40, 17, 10, 27, 217, 81, 2, 79, 40, 17, 10, 27, 
-    254, 197, 2, 112, 231, 193, 40, 17, 10, 27, 254, 197, 2, 79, 40, 17, 10, 
-    27, 242, 245, 2, 112, 231, 193, 40, 17, 10, 27, 242, 245, 2, 79, 40, 17, 
-    10, 27, 221, 167, 2, 112, 231, 193, 40, 17, 10, 27, 221, 167, 2, 79, 40, 
-    17, 10, 27, 220, 60, 2, 112, 231, 193, 40, 17, 10, 27, 220, 60, 2, 79, 
-    40, 17, 10, 27, 122, 2, 112, 231, 193, 40, 17, 10, 27, 122, 2, 79, 40, 
-    17, 10, 27, 151, 2, 112, 231, 193, 40, 17, 10, 27, 151, 2, 79, 40, 17, 
-    10, 27, 234, 130, 2, 112, 231, 193, 40, 17, 10, 27, 234, 130, 2, 79, 40, 
-    17, 10, 27, 222, 27, 2, 112, 231, 193, 40, 17, 10, 27, 222, 27, 2, 79, 
-    40, 17, 10, 27, 248, 217, 2, 112, 231, 193, 40, 17, 10, 27, 248, 217, 2, 
-    79, 40, 17, 10, 27, 220, 60, 2, 151, 40, 17, 10, 27, 220, 60, 2, 122, 40, 
-    17, 10, 27, 220, 60, 2, 234, 130, 40, 17, 10, 27, 220, 60, 2, 66, 40, 17, 
-    10, 27, 220, 60, 2, 223, 96, 40, 17, 10, 27, 221, 167, 2, 223, 96, 40, 
-    17, 10, 27, 222, 27, 2, 223, 96, 40, 17, 10, 27, 248, 217, 2, 223, 96, 
-    40, 17, 10, 27, 220, 60, 2, 151, 65, 17, 10, 27, 220, 60, 2, 122, 65, 17, 
-    10, 27, 220, 60, 2, 234, 130, 65, 17, 10, 27, 220, 60, 2, 66, 65, 17, 10, 
-    27, 221, 167, 2, 241, 219, 65, 17, 10, 27, 220, 60, 2, 241, 219, 65, 17, 
-    10, 27, 217, 81, 2, 66, 65, 17, 10, 27, 221, 167, 2, 151, 147, 17, 10, 
-    27, 221, 167, 2, 122, 147, 17, 10, 27, 221, 167, 2, 234, 130, 147, 17, 
-    10, 27, 220, 60, 2, 151, 147, 17, 10, 27, 220, 60, 2, 122, 147, 17, 10, 
-    27, 220, 60, 2, 234, 130, 147, 17, 10, 27, 217, 81, 2, 66, 147, 17, 10, 
-    27, 210, 112, 2, 66, 147, 17, 10, 27, 112, 2, 244, 164, 40, 17, 10, 27, 
-    112, 2, 244, 164, 53, 17, 226, 146, 43, 226, 3, 226, 146, 44, 226, 3, 10, 
-    27, 217, 8, 2, 151, 2, 66, 65, 17, 10, 27, 217, 8, 2, 122, 2, 151, 40, 
-    17, 10, 27, 217, 8, 2, 122, 2, 151, 65, 17, 10, 27, 217, 8, 2, 122, 2, 
-    66, 65, 17, 10, 27, 217, 8, 2, 234, 130, 2, 66, 65, 17, 10, 27, 217, 8, 
-    2, 66, 2, 151, 65, 17, 10, 27, 217, 8, 2, 66, 2, 122, 65, 17, 10, 27, 
-    217, 8, 2, 66, 2, 234, 130, 65, 17, 10, 27, 151, 2, 66, 2, 122, 40, 17, 
-    10, 27, 151, 2, 66, 2, 122, 65, 17, 10, 27, 122, 2, 66, 2, 79, 40, 17, 
-    10, 27, 122, 2, 66, 2, 112, 231, 193, 40, 17, 10, 27, 221, 167, 2, 122, 
-    2, 151, 65, 17, 10, 27, 221, 167, 2, 151, 2, 122, 65, 17, 10, 27, 221, 
-    167, 2, 151, 2, 112, 231, 193, 40, 17, 10, 27, 221, 167, 2, 66, 2, 122, 
-    40, 17, 10, 27, 221, 167, 2, 66, 2, 122, 65, 17, 10, 27, 221, 167, 2, 66, 
-    2, 151, 65, 17, 10, 27, 221, 167, 2, 66, 2, 66, 40, 17, 10, 27, 221, 167, 
-    2, 66, 2, 66, 65, 17, 10, 27, 222, 27, 2, 122, 2, 122, 40, 17, 10, 27, 
-    222, 27, 2, 122, 2, 122, 65, 17, 10, 27, 222, 27, 2, 66, 2, 66, 40, 17, 
-    10, 27, 220, 60, 2, 122, 2, 66, 40, 17, 10, 27, 220, 60, 2, 122, 2, 66, 
-    65, 17, 10, 27, 220, 60, 2, 151, 2, 79, 40, 17, 10, 27, 220, 60, 2, 66, 
-    2, 234, 130, 40, 17, 10, 27, 220, 60, 2, 66, 2, 234, 130, 65, 17, 10, 27, 
-    220, 60, 2, 66, 2, 66, 40, 17, 10, 27, 220, 60, 2, 66, 2, 66, 65, 17, 10, 
-    27, 248, 217, 2, 122, 2, 112, 231, 193, 40, 17, 10, 27, 248, 217, 2, 234, 
-    130, 2, 66, 40, 17, 10, 27, 248, 217, 2, 234, 130, 2, 66, 65, 17, 10, 27, 
-    217, 81, 2, 66, 2, 122, 40, 17, 10, 27, 217, 81, 2, 66, 2, 122, 65, 17, 
-    10, 27, 217, 81, 2, 66, 2, 66, 65, 17, 10, 27, 217, 81, 2, 66, 2, 79, 40, 
-    17, 10, 27, 254, 197, 2, 151, 2, 66, 40, 17, 10, 27, 254, 197, 2, 66, 2, 
-    66, 40, 17, 10, 27, 254, 197, 2, 66, 2, 66, 65, 17, 10, 27, 254, 197, 2, 
-    66, 2, 112, 231, 193, 40, 17, 10, 27, 242, 245, 2, 66, 2, 66, 40, 17, 10, 
-    27, 242, 245, 2, 66, 2, 79, 40, 17, 10, 27, 242, 245, 2, 66, 2, 112, 231, 
-    193, 40, 17, 10, 27, 244, 143, 2, 234, 130, 2, 66, 40, 17, 10, 27, 244, 
-    143, 2, 234, 130, 2, 66, 65, 17, 10, 27, 224, 82, 2, 66, 2, 122, 40, 17, 
-    10, 27, 224, 82, 2, 66, 2, 66, 40, 17, 10, 27, 233, 103, 2, 122, 2, 66, 
-    40, 17, 10, 27, 233, 103, 2, 122, 2, 79, 40, 17, 10, 27, 233, 103, 2, 
-    122, 2, 112, 231, 193, 40, 17, 10, 27, 233, 103, 2, 151, 2, 151, 65, 17, 
-    10, 27, 233, 103, 2, 151, 2, 151, 40, 17, 10, 27, 233, 103, 2, 234, 130, 
-    2, 66, 40, 17, 10, 27, 233, 103, 2, 234, 130, 2, 66, 65, 17, 10, 27, 233, 
-    103, 2, 66, 2, 122, 40, 17, 10, 27, 233, 103, 2, 66, 2, 122, 65, 17, 10, 
-    27, 66, 2, 122, 2, 151, 65, 17, 10, 27, 66, 2, 122, 2, 66, 65, 17, 10, 
-    27, 66, 2, 122, 2, 79, 40, 17, 10, 27, 66, 2, 151, 2, 122, 65, 17, 10, 
-    27, 66, 2, 151, 2, 66, 65, 17, 10, 27, 66, 2, 234, 130, 2, 151, 65, 17, 
-    10, 27, 66, 2, 234, 130, 2, 66, 65, 17, 10, 27, 66, 2, 151, 2, 234, 130, 
-    65, 17, 10, 27, 241, 219, 2, 66, 2, 151, 65, 17, 10, 27, 241, 219, 2, 66, 
-    2, 66, 65, 17, 10, 27, 228, 63, 2, 122, 2, 66, 65, 17, 10, 27, 228, 63, 
-    2, 122, 2, 112, 231, 193, 40, 17, 10, 27, 228, 63, 2, 151, 2, 66, 40, 17, 
-    10, 27, 228, 63, 2, 151, 2, 66, 65, 17, 10, 27, 228, 63, 2, 151, 2, 112, 
-    231, 193, 40, 17, 10, 27, 228, 63, 2, 66, 2, 79, 40, 17, 10, 27, 228, 63, 
-    2, 66, 2, 112, 231, 193, 40, 17, 10, 27, 79, 2, 66, 2, 66, 40, 17, 10, 
-    27, 79, 2, 66, 2, 66, 65, 17, 10, 27, 252, 55, 2, 234, 130, 2, 79, 40, 
-    17, 10, 27, 217, 8, 2, 151, 2, 79, 40, 17, 10, 27, 217, 8, 2, 151, 2, 
-    112, 231, 193, 40, 17, 10, 27, 217, 8, 2, 234, 130, 2, 79, 40, 17, 10, 
-    27, 217, 8, 2, 234, 130, 2, 112, 231, 193, 40, 17, 10, 27, 217, 8, 2, 66, 
-    2, 79, 40, 17, 10, 27, 217, 8, 2, 66, 2, 112, 231, 193, 40, 17, 10, 27, 
-    151, 2, 66, 2, 79, 40, 17, 10, 27, 151, 2, 122, 2, 112, 231, 193, 40, 17, 
-    10, 27, 151, 2, 66, 2, 112, 231, 193, 40, 17, 10, 27, 221, 167, 2, 234, 
-    130, 2, 112, 231, 193, 40, 17, 10, 27, 222, 27, 2, 122, 2, 79, 40, 17, 
-    10, 27, 220, 60, 2, 122, 2, 79, 40, 17, 10, 27, 248, 217, 2, 122, 2, 79, 
-    40, 17, 10, 27, 233, 103, 2, 151, 2, 79, 40, 17, 10, 27, 233, 103, 2, 66, 
-    2, 79, 40, 17, 10, 27, 79, 2, 122, 2, 79, 40, 17, 10, 27, 79, 2, 151, 2, 
-    79, 40, 17, 10, 27, 79, 2, 66, 2, 79, 40, 17, 10, 27, 66, 2, 66, 2, 79, 
-    40, 17, 10, 27, 224, 82, 2, 66, 2, 79, 40, 17, 10, 27, 228, 63, 2, 122, 
-    2, 79, 40, 17, 10, 27, 224, 82, 2, 66, 2, 122, 65, 17, 10, 27, 233, 103, 
-    2, 122, 2, 66, 65, 17, 10, 27, 254, 197, 2, 66, 2, 79, 40, 17, 10, 27, 
-    234, 251, 2, 66, 2, 79, 40, 17, 10, 27, 228, 63, 2, 151, 2, 122, 65, 17, 
-    10, 27, 66, 2, 234, 130, 2, 79, 40, 17, 10, 27, 233, 103, 2, 151, 2, 66, 
-    65, 17, 10, 27, 234, 251, 2, 66, 2, 66, 40, 17, 10, 27, 233, 103, 2, 151, 
-    2, 66, 40, 17, 10, 27, 228, 63, 2, 151, 2, 122, 40, 17, 10, 27, 151, 2, 
-    122, 2, 79, 40, 17, 10, 27, 122, 2, 151, 2, 79, 40, 17, 10, 27, 66, 2, 
-    151, 2, 79, 40, 17, 10, 27, 244, 143, 2, 66, 2, 79, 40, 17, 10, 27, 252, 
-    55, 2, 122, 2, 79, 40, 17, 10, 27, 234, 251, 2, 66, 2, 66, 65, 17, 10, 
-    27, 254, 197, 2, 151, 2, 66, 65, 17, 10, 27, 222, 27, 2, 66, 2, 66, 65, 
-    17, 10, 27, 221, 167, 2, 234, 130, 2, 79, 40, 17, 10, 27, 228, 63, 2, 
-    151, 2, 79, 40, 17, 10, 27, 222, 4, 214, 128, 253, 238, 234, 4, 218, 130, 
-    5, 53, 17, 10, 27, 224, 78, 214, 128, 253, 238, 234, 4, 218, 130, 5, 53, 
-    17, 10, 27, 254, 153, 53, 17, 10, 27, 254, 183, 53, 17, 10, 27, 230, 153, 
-    53, 17, 10, 27, 222, 5, 53, 17, 10, 27, 223, 143, 53, 17, 10, 27, 254, 
-    172, 53, 17, 10, 27, 212, 49, 53, 17, 10, 27, 222, 4, 53, 17, 10, 27, 
-    222, 3, 254, 172, 212, 48, 10, 27, 235, 134, 223, 34, 50, 10, 27, 251, 
-    230, 254, 39, 254, 40, 45, 221, 156, 45, 221, 45, 45, 220, 233, 45, 220, 
-    222, 45, 220, 211, 45, 220, 200, 45, 220, 189, 45, 220, 178, 45, 220, 
-    167, 45, 221, 155, 45, 221, 144, 45, 221, 133, 45, 221, 122, 45, 221, 
-    111, 45, 221, 100, 45, 221, 89, 224, 194, 244, 20, 31, 67, 249, 219, 224, 
-    194, 244, 20, 31, 67, 109, 249, 219, 224, 194, 244, 20, 31, 67, 109, 243, 
-    229, 218, 129, 224, 194, 244, 20, 31, 67, 249, 226, 224, 194, 244, 20, 
-    31, 67, 220, 150, 224, 194, 244, 20, 31, 67, 245, 31, 78, 224, 194, 244, 
-    20, 31, 67, 224, 13, 78, 224, 194, 244, 20, 31, 67, 43, 71, 233, 20, 127, 
-    224, 194, 244, 20, 31, 67, 44, 71, 233, 20, 251, 156, 224, 194, 244, 20, 
-    31, 67, 203, 245, 163, 38, 27, 43, 242, 27, 38, 27, 44, 242, 27, 38, 52, 
-    216, 89, 43, 242, 27, 38, 52, 216, 89, 44, 242, 27, 38, 231, 233, 43, 
-    242, 27, 38, 231, 233, 44, 242, 27, 38, 249, 197, 231, 232, 224, 194, 
-    244, 20, 31, 67, 113, 59, 233, 56, 224, 194, 244, 20, 31, 67, 245, 160, 
-    248, 156, 224, 194, 244, 20, 31, 67, 245, 151, 248, 156, 224, 194, 244, 
-    20, 31, 67, 121, 232, 213, 224, 194, 244, 20, 31, 67, 212, 32, 121, 232, 
-    213, 224, 194, 244, 20, 31, 67, 43, 226, 3, 224, 194, 244, 20, 31, 67, 
-    44, 226, 3, 224, 194, 244, 20, 31, 67, 43, 249, 99, 127, 224, 194, 244, 
-    20, 31, 67, 44, 249, 99, 127, 224, 194, 244, 20, 31, 67, 43, 216, 6, 220, 
-    53, 127, 224, 194, 244, 20, 31, 67, 44, 216, 6, 220, 53, 127, 224, 194, 
-    244, 20, 31, 67, 43, 85, 233, 20, 127, 224, 194, 244, 20, 31, 67, 44, 85, 
-    233, 20, 127, 224, 194, 244, 20, 31, 67, 43, 52, 254, 110, 127, 224, 194, 
-    244, 20, 31, 67, 44, 52, 254, 110, 127, 224, 194, 244, 20, 31, 67, 43, 
-    254, 110, 127, 224, 194, 244, 20, 31, 67, 44, 254, 110, 127, 224, 194, 
-    244, 20, 31, 67, 43, 249, 161, 127, 224, 194, 244, 20, 31, 67, 44, 249, 
-    161, 127, 224, 194, 244, 20, 31, 67, 43, 71, 249, 161, 127, 224, 194, 
-    244, 20, 31, 67, 44, 71, 249, 161, 127, 220, 131, 247, 120, 71, 220, 131, 
-    247, 120, 224, 194, 244, 20, 31, 67, 43, 42, 127, 224, 194, 244, 20, 31, 
-    67, 44, 42, 127, 248, 155, 226, 119, 250, 172, 226, 119, 212, 32, 226, 
-    119, 52, 212, 32, 226, 119, 248, 155, 121, 232, 213, 250, 172, 121, 232, 
-    213, 212, 32, 121, 232, 213, 4, 249, 219, 4, 109, 249, 219, 4, 243, 229, 
-    218, 129, 4, 220, 150, 4, 249, 226, 4, 224, 13, 78, 4, 245, 31, 78, 4, 
-    245, 160, 248, 156, 4, 43, 226, 3, 4, 44, 226, 3, 4, 43, 249, 99, 127, 4, 
-    44, 249, 99, 127, 4, 43, 216, 6, 220, 53, 127, 4, 44, 216, 6, 220, 53, 
-    127, 4, 54, 50, 4, 254, 126, 4, 253, 216, 4, 96, 50, 4, 240, 167, 4, 233, 
-    15, 50, 4, 242, 130, 50, 4, 245, 98, 50, 4, 223, 50, 219, 46, 4, 247, 
-    132, 50, 4, 225, 182, 50, 4, 249, 217, 253, 206, 10, 244, 164, 53, 17, 
-    10, 217, 44, 2, 244, 164, 48, 10, 248, 183, 53, 17, 10, 217, 78, 244, 1, 
-    10, 234, 204, 53, 17, 10, 244, 166, 53, 17, 10, 244, 166, 147, 17, 10, 
-    248, 185, 53, 17, 10, 248, 185, 147, 17, 10, 234, 206, 53, 17, 10, 234, 
-    206, 147, 17, 10, 220, 94, 53, 17, 10, 220, 94, 147, 17, 10, 218, 46, 53, 
-    17, 10, 218, 46, 147, 17, 10, 1, 202, 53, 17, 10, 1, 112, 2, 231, 228, 
-    77, 53, 17, 10, 1, 112, 2, 231, 228, 77, 40, 17, 10, 1, 112, 2, 202, 77, 
-    53, 17, 10, 1, 112, 2, 202, 77, 40, 17, 10, 1, 212, 31, 2, 202, 77, 53, 
-    17, 10, 1, 212, 31, 2, 202, 77, 40, 17, 10, 1, 112, 2, 202, 252, 43, 53, 
-    17, 10, 1, 112, 2, 202, 252, 43, 40, 17, 10, 1, 79, 2, 202, 77, 53, 17, 
-    10, 1, 79, 2, 202, 77, 40, 17, 10, 1, 79, 2, 202, 77, 65, 17, 10, 1, 79, 
-    2, 202, 77, 147, 17, 10, 1, 112, 53, 17, 10, 1, 112, 40, 17, 10, 1, 252, 
-    55, 53, 17, 10, 1, 252, 55, 40, 17, 10, 1, 252, 55, 65, 17, 10, 1, 252, 
-    55, 147, 17, 10, 1, 217, 8, 231, 165, 53, 17, 10, 1, 217, 8, 231, 165, 
-    40, 17, 10, 1, 217, 8, 53, 17, 10, 1, 217, 8, 40, 17, 10, 1, 217, 8, 65, 
-    17, 10, 1, 217, 8, 147, 17, 10, 1, 216, 193, 53, 17, 10, 1, 216, 193, 40, 
-    17, 10, 1, 216, 193, 65, 17, 10, 1, 216, 193, 147, 17, 10, 1, 151, 53, 
-    17, 10, 1, 151, 40, 17, 10, 1, 151, 65, 17, 10, 1, 151, 147, 17, 10, 1, 
-    122, 53, 17, 10, 1, 122, 40, 17, 10, 1, 122, 65, 17, 10, 1, 122, 147, 17, 
-    10, 1, 234, 130, 53, 17, 10, 1, 234, 130, 40, 17, 10, 1, 234, 130, 65, 
-    17, 10, 1, 234, 130, 147, 17, 10, 1, 248, 196, 53, 17, 10, 1, 248, 196, 
-    40, 17, 10, 1, 216, 203, 53, 17, 10, 1, 216, 203, 40, 17, 10, 1, 223, 96, 
-    53, 17, 10, 1, 223, 96, 40, 17, 10, 1, 210, 109, 53, 17, 10, 1, 210, 109, 
-    40, 17, 10, 1, 221, 167, 53, 17, 10, 1, 221, 167, 40, 17, 10, 1, 221, 
-    167, 65, 17, 10, 1, 221, 167, 147, 17, 10, 1, 220, 60, 53, 17, 10, 1, 
-    220, 60, 40, 17, 10, 1, 220, 60, 65, 17, 10, 1, 220, 60, 147, 17, 10, 1, 
-    222, 27, 53, 17, 10, 1, 222, 27, 40, 17, 10, 1, 222, 27, 65, 17, 10, 1, 
-    222, 27, 147, 17, 10, 1, 248, 217, 53, 17, 10, 1, 248, 217, 40, 17, 10, 
-    1, 248, 217, 65, 17, 10, 1, 248, 217, 147, 17, 10, 1, 217, 81, 53, 17, 
-    10, 1, 217, 81, 40, 17, 10, 1, 217, 81, 65, 17, 10, 1, 217, 81, 147, 17, 
-    10, 1, 210, 112, 53, 17, 10, 1, 210, 112, 40, 17, 10, 1, 210, 112, 65, 
-    17, 10, 1, 210, 112, 147, 17, 10, 1, 254, 197, 53, 17, 10, 1, 254, 197, 
-    40, 17, 10, 1, 254, 197, 65, 17, 10, 1, 254, 197, 147, 17, 10, 1, 242, 
-    245, 53, 17, 10, 1, 242, 245, 40, 17, 10, 1, 242, 245, 65, 17, 10, 1, 
-    242, 245, 147, 17, 10, 1, 244, 143, 53, 17, 10, 1, 244, 143, 40, 17, 10, 
-    1, 244, 143, 65, 17, 10, 1, 244, 143, 147, 17, 10, 1, 224, 82, 53, 17, 
-    10, 1, 224, 82, 40, 17, 10, 1, 224, 82, 65, 17, 10, 1, 224, 82, 147, 17, 
-    10, 1, 234, 251, 53, 17, 10, 1, 234, 251, 40, 17, 10, 1, 234, 251, 65, 
-    17, 10, 1, 234, 251, 147, 17, 10, 1, 233, 103, 53, 17, 10, 1, 233, 103, 
-    40, 17, 10, 1, 233, 103, 65, 17, 10, 1, 233, 103, 147, 17, 10, 1, 66, 53, 
-    17, 10, 1, 66, 40, 17, 10, 1, 66, 65, 17, 10, 1, 66, 147, 17, 10, 1, 228, 
-    63, 53, 17, 10, 1, 228, 63, 40, 17, 10, 1, 228, 63, 65, 17, 10, 1, 228, 
-    63, 147, 17, 10, 1, 241, 219, 53, 17, 10, 1, 241, 219, 40, 17, 10, 1, 
-    241, 219, 65, 17, 10, 1, 241, 219, 147, 17, 10, 1, 212, 31, 53, 17, 10, 
-    1, 212, 31, 40, 17, 10, 1, 112, 231, 193, 53, 17, 10, 1, 112, 231, 193, 
-    40, 17, 10, 1, 79, 53, 17, 10, 1, 79, 40, 17, 10, 1, 79, 65, 17, 10, 1, 
-    79, 147, 17, 10, 27, 233, 103, 2, 112, 2, 231, 228, 77, 53, 17, 10, 27, 
-    233, 103, 2, 112, 2, 231, 228, 77, 40, 17, 10, 27, 233, 103, 2, 112, 2, 
-    202, 77, 53, 17, 10, 27, 233, 103, 2, 112, 2, 202, 77, 40, 17, 10, 27, 
-    233, 103, 2, 112, 2, 202, 252, 43, 53, 17, 10, 27, 233, 103, 2, 112, 2, 
-    202, 252, 43, 40, 17, 10, 27, 233, 103, 2, 112, 53, 17, 10, 27, 233, 103, 
-    2, 112, 40, 17, 210, 87, 211, 245, 228, 73, 219, 18, 126, 245, 31, 78, 
-    126, 223, 254, 78, 126, 54, 50, 126, 247, 132, 50, 126, 225, 182, 50, 
-    126, 254, 126, 126, 254, 57, 126, 43, 226, 3, 126, 44, 226, 3, 126, 253, 
-    216, 126, 96, 50, 126, 249, 219, 126, 240, 167, 126, 243, 229, 218, 129, 
-    126, 219, 46, 126, 21, 210, 86, 126, 21, 110, 126, 21, 105, 126, 21, 158, 
-    126, 21, 161, 126, 21, 189, 126, 21, 194, 126, 21, 198, 126, 21, 195, 
-    126, 21, 200, 126, 249, 226, 126, 220, 150, 126, 233, 15, 50, 126, 245, 
-    98, 50, 126, 242, 130, 50, 126, 224, 13, 78, 126, 249, 217, 253, 206, 
-    126, 7, 6, 1, 61, 126, 7, 6, 1, 253, 158, 126, 7, 6, 1, 251, 66, 126, 7, 
-    6, 1, 249, 60, 126, 7, 6, 1, 75, 126, 7, 6, 1, 245, 6, 126, 7, 6, 1, 243, 
-    202, 126, 7, 6, 1, 242, 60, 126, 7, 6, 1, 73, 126, 7, 6, 1, 235, 144, 
-    126, 7, 6, 1, 235, 23, 126, 7, 6, 1, 156, 126, 7, 6, 1, 193, 126, 7, 6, 
-    1, 230, 25, 126, 7, 6, 1, 76, 126, 7, 6, 1, 226, 105, 126, 7, 6, 1, 224, 
-    96, 126, 7, 6, 1, 153, 126, 7, 6, 1, 222, 91, 126, 7, 6, 1, 217, 152, 
-    126, 7, 6, 1, 70, 126, 7, 6, 1, 214, 105, 126, 7, 6, 1, 212, 98, 126, 7, 
-    6, 1, 211, 178, 126, 7, 6, 1, 211, 117, 126, 7, 6, 1, 210, 159, 126, 43, 
-    42, 127, 126, 223, 50, 219, 46, 126, 44, 42, 127, 126, 250, 31, 255, 14, 
-    126, 121, 232, 213, 126, 242, 137, 255, 14, 126, 7, 4, 1, 61, 126, 7, 4, 
-    1, 253, 158, 126, 7, 4, 1, 251, 66, 126, 7, 4, 1, 249, 60, 126, 7, 4, 1, 
-    75, 126, 7, 4, 1, 245, 6, 126, 7, 4, 1, 243, 202, 126, 7, 4, 1, 242, 60, 
-    126, 7, 4, 1, 73, 126, 7, 4, 1, 235, 144, 126, 7, 4, 1, 235, 23, 126, 7, 
-    4, 1, 156, 126, 7, 4, 1, 193, 126, 7, 4, 1, 230, 25, 126, 7, 4, 1, 76, 
-    126, 7, 4, 1, 226, 105, 126, 7, 4, 1, 224, 96, 126, 7, 4, 1, 153, 126, 7, 
-    4, 1, 222, 91, 126, 7, 4, 1, 217, 152, 126, 7, 4, 1, 70, 126, 7, 4, 1, 
-    214, 105, 126, 7, 4, 1, 212, 98, 126, 7, 4, 1, 211, 178, 126, 7, 4, 1, 
-    211, 117, 126, 7, 4, 1, 210, 159, 126, 43, 249, 99, 127, 126, 67, 232, 
-    213, 126, 44, 249, 99, 127, 126, 182, 126, 43, 71, 226, 3, 126, 44, 71, 
-    226, 3, 101, 109, 243, 229, 218, 129, 101, 43, 249, 161, 127, 101, 44, 
-    249, 161, 127, 101, 109, 249, 219, 101, 56, 230, 224, 247, 120, 101, 56, 
-    1, 211, 227, 101, 56, 1, 4, 61, 101, 56, 1, 4, 73, 101, 56, 1, 4, 70, 
-    101, 56, 1, 4, 75, 101, 56, 1, 4, 76, 101, 56, 1, 4, 191, 101, 56, 1, 4, 
-    210, 212, 101, 56, 1, 4, 210, 244, 101, 56, 1, 4, 215, 118, 101, 234, 
-    201, 224, 173, 219, 31, 78, 101, 56, 1, 61, 101, 56, 1, 73, 101, 56, 1, 
-    70, 101, 56, 1, 75, 101, 56, 1, 76, 101, 56, 1, 176, 101, 56, 1, 234, 92, 
-    101, 56, 1, 233, 217, 101, 56, 1, 234, 182, 101, 56, 1, 234, 28, 101, 56, 
-    1, 206, 101, 56, 1, 219, 191, 101, 56, 1, 218, 83, 101, 56, 1, 221, 181, 
-    101, 56, 1, 219, 58, 101, 56, 1, 217, 105, 101, 56, 1, 216, 117, 101, 56, 
-    1, 215, 118, 101, 56, 1, 217, 22, 101, 56, 1, 111, 101, 56, 1, 197, 101, 
-    56, 1, 228, 233, 101, 56, 1, 227, 237, 101, 56, 1, 229, 107, 101, 56, 1, 
-    228, 74, 101, 56, 1, 162, 101, 56, 1, 241, 180, 101, 56, 1, 240, 222, 
-    101, 56, 1, 241, 238, 101, 56, 1, 241, 68, 101, 56, 1, 184, 101, 56, 1, 
-    230, 230, 101, 56, 1, 230, 102, 101, 56, 1, 231, 91, 101, 56, 1, 230, 
-    161, 101, 56, 1, 191, 101, 56, 1, 210, 212, 101, 56, 1, 210, 244, 101, 
-    56, 1, 205, 101, 56, 1, 223, 35, 101, 56, 1, 222, 140, 101, 56, 1, 223, 
-    128, 101, 56, 1, 222, 211, 101, 56, 1, 212, 65, 101, 56, 1, 230, 25, 101, 
-    56, 213, 135, 219, 31, 78, 101, 56, 220, 155, 219, 31, 78, 101, 24, 244, 
-    103, 101, 24, 1, 234, 58, 101, 24, 1, 218, 215, 101, 24, 1, 234, 51, 101, 
-    24, 1, 228, 226, 101, 24, 1, 228, 224, 101, 24, 1, 228, 223, 101, 24, 1, 
-    216, 101, 101, 24, 1, 218, 204, 101, 24, 1, 223, 26, 101, 24, 1, 223, 21, 
-    101, 24, 1, 223, 18, 101, 24, 1, 223, 11, 101, 24, 1, 223, 6, 101, 24, 1, 
-    223, 1, 101, 24, 1, 223, 12, 101, 24, 1, 223, 24, 101, 24, 1, 230, 217, 
-    101, 24, 1, 225, 95, 101, 24, 1, 218, 212, 101, 24, 1, 225, 84, 101, 24, 
-    1, 219, 148, 101, 24, 1, 218, 209, 101, 24, 1, 236, 56, 101, 24, 1, 250, 
-    46, 101, 24, 1, 218, 219, 101, 24, 1, 250, 106, 101, 24, 1, 234, 110, 
-    101, 24, 1, 216, 173, 101, 24, 1, 225, 131, 101, 24, 1, 241, 172, 101, 
-    24, 1, 61, 101, 24, 1, 254, 243, 101, 24, 1, 191, 101, 24, 1, 211, 92, 
-    101, 24, 1, 245, 117, 101, 24, 1, 75, 101, 24, 1, 211, 36, 101, 24, 1, 
-    211, 47, 101, 24, 1, 76, 101, 24, 1, 212, 65, 101, 24, 1, 212, 62, 101, 
-    24, 1, 226, 234, 101, 24, 1, 210, 244, 101, 24, 1, 70, 101, 24, 1, 212, 
-    11, 101, 24, 1, 212, 22, 101, 24, 1, 211, 250, 101, 24, 1, 210, 212, 101, 
-    24, 1, 245, 55, 101, 24, 1, 211, 8, 101, 24, 1, 73, 126, 250, 176, 50, 
-    126, 224, 228, 50, 126, 228, 52, 50, 126, 231, 232, 126, 251, 135, 130, 
-    126, 211, 40, 50, 126, 211, 217, 50, 101, 244, 18, 192, 213, 239, 101, 
-    140, 74, 101, 214, 153, 74, 101, 97, 74, 101, 246, 104, 74, 101, 85, 218, 
-    234, 101, 71, 250, 35, 235, 204, 254, 99, 254, 120, 235, 204, 254, 99, 
-    220, 137, 235, 204, 254, 99, 216, 236, 226, 249, 223, 72, 250, 142, 223, 
-    72, 250, 142, 62, 57, 3, 253, 142, 61, 62, 57, 3, 253, 111, 75, 62, 57, 
-    3, 253, 120, 73, 62, 57, 3, 253, 88, 76, 62, 57, 3, 253, 138, 70, 62, 57, 
-    3, 253, 157, 248, 221, 62, 57, 3, 253, 104, 248, 90, 62, 57, 3, 253, 144, 
-    248, 3, 62, 57, 3, 253, 134, 247, 145, 62, 57, 3, 253, 98, 246, 78, 62, 
-    57, 3, 253, 92, 235, 141, 62, 57, 3, 253, 103, 235, 126, 62, 57, 3, 253, 
-    113, 235, 68, 62, 57, 3, 253, 84, 235, 51, 62, 57, 3, 253, 72, 176, 62, 
-    57, 3, 253, 105, 234, 182, 62, 57, 3, 253, 82, 234, 92, 62, 57, 3, 253, 
-    79, 234, 28, 62, 57, 3, 253, 68, 233, 217, 62, 57, 3, 253, 69, 184, 62, 
-    57, 3, 253, 135, 231, 91, 62, 57, 3, 253, 76, 230, 230, 62, 57, 3, 253, 
-    133, 230, 161, 62, 57, 3, 253, 125, 230, 102, 62, 57, 3, 253, 146, 197, 
-    62, 57, 3, 253, 124, 229, 107, 62, 57, 3, 253, 118, 228, 233, 62, 57, 3, 
-    253, 97, 228, 74, 62, 57, 3, 253, 94, 227, 237, 62, 57, 3, 253, 153, 190, 
-    62, 57, 3, 253, 77, 225, 221, 62, 57, 3, 253, 110, 225, 108, 62, 57, 3, 
-    253, 137, 225, 16, 62, 57, 3, 253, 99, 224, 150, 62, 57, 3, 253, 132, 
-    224, 88, 62, 57, 3, 253, 71, 224, 69, 62, 57, 3, 253, 127, 224, 53, 62, 
-    57, 3, 253, 116, 224, 42, 62, 57, 3, 253, 89, 205, 62, 57, 3, 253, 121, 
-    223, 128, 62, 57, 3, 253, 96, 223, 35, 62, 57, 3, 253, 155, 222, 211, 62, 
-    57, 3, 253, 122, 222, 140, 62, 57, 3, 253, 117, 206, 62, 57, 3, 253, 140, 
-    221, 181, 62, 57, 3, 253, 108, 219, 191, 62, 57, 3, 253, 136, 219, 58, 
-    62, 57, 3, 253, 91, 218, 83, 62, 57, 3, 253, 90, 217, 105, 62, 57, 3, 
-    253, 151, 217, 22, 62, 57, 3, 253, 112, 216, 117, 62, 57, 3, 253, 149, 
-    111, 62, 57, 3, 253, 80, 215, 118, 62, 57, 3, 253, 95, 212, 65, 62, 57, 
-    3, 253, 74, 212, 22, 62, 57, 3, 253, 109, 211, 250, 62, 57, 3, 253, 107, 
-    211, 227, 62, 57, 3, 253, 131, 210, 116, 62, 57, 3, 253, 75, 210, 94, 62, 
-    57, 3, 253, 128, 210, 23, 62, 57, 3, 253, 123, 255, 75, 62, 57, 3, 253, 
-    106, 255, 74, 62, 57, 3, 253, 65, 253, 192, 62, 57, 3, 253, 78, 246, 46, 
-    62, 57, 3, 253, 61, 246, 45, 62, 57, 3, 253, 101, 227, 174, 62, 57, 3, 
-    253, 119, 224, 148, 62, 57, 3, 253, 87, 224, 152, 62, 57, 3, 253, 73, 
-    223, 186, 62, 57, 3, 253, 115, 223, 185, 62, 57, 3, 253, 81, 222, 210, 
-    62, 57, 3, 253, 83, 217, 102, 62, 57, 3, 253, 63, 215, 78, 62, 57, 3, 
-    253, 60, 105, 62, 57, 16, 253, 130, 62, 57, 16, 253, 129, 62, 57, 16, 
-    253, 126, 62, 57, 16, 253, 114, 62, 57, 16, 253, 102, 62, 57, 16, 253, 
-    100, 62, 57, 16, 253, 93, 62, 57, 16, 253, 86, 62, 57, 16, 253, 85, 62, 
-    57, 16, 253, 70, 62, 57, 16, 253, 67, 62, 57, 16, 253, 66, 62, 57, 16, 
-    253, 64, 62, 57, 16, 253, 62, 62, 57, 106, 253, 59, 231, 185, 62, 57, 
-    106, 253, 58, 211, 221, 62, 57, 106, 253, 57, 248, 74, 62, 57, 106, 253, 
-    56, 245, 95, 62, 57, 106, 253, 55, 231, 159, 62, 57, 106, 253, 54, 218, 
-    162, 62, 57, 106, 253, 53, 245, 37, 62, 57, 106, 253, 52, 223, 153, 62, 
-    57, 106, 253, 51, 220, 62, 62, 57, 106, 253, 50, 241, 237, 62, 57, 106, 
-    253, 49, 219, 25, 62, 57, 106, 253, 48, 251, 203, 62, 57, 106, 253, 47, 
-    249, 145, 62, 57, 106, 253, 46, 251, 115, 62, 57, 106, 253, 45, 212, 2, 
-    62, 57, 106, 253, 44, 252, 136, 62, 57, 106, 253, 43, 226, 205, 62, 57, 
-    106, 253, 42, 218, 254, 62, 57, 106, 253, 41, 249, 68, 62, 57, 230, 142, 
-    253, 40, 234, 224, 62, 57, 230, 142, 253, 39, 234, 232, 62, 57, 106, 253, 
-    38, 226, 218, 62, 57, 106, 253, 37, 211, 236, 62, 57, 106, 253, 36, 62, 
-    57, 230, 142, 253, 35, 254, 17, 62, 57, 230, 142, 253, 34, 231, 52, 62, 
-    57, 106, 253, 33, 251, 134, 62, 57, 106, 253, 32, 242, 166, 62, 57, 106, 
-    253, 31, 62, 57, 106, 253, 30, 211, 212, 62, 57, 106, 253, 29, 62, 57, 
-    106, 253, 28, 62, 57, 106, 253, 27, 240, 248, 62, 57, 106, 253, 26, 62, 
-    57, 106, 253, 25, 62, 57, 106, 253, 24, 62, 57, 230, 142, 253, 22, 215, 
-    92, 62, 57, 106, 253, 21, 62, 57, 106, 253, 20, 62, 57, 106, 253, 19, 
-    249, 250, 62, 57, 106, 253, 18, 62, 57, 106, 253, 17, 62, 57, 106, 253, 
-    16, 243, 93, 62, 57, 106, 253, 15, 254, 4, 62, 57, 106, 253, 14, 62, 57, 
-    106, 253, 13, 62, 57, 106, 253, 12, 62, 57, 106, 253, 11, 62, 57, 106, 
-    253, 10, 62, 57, 106, 253, 9, 62, 57, 106, 253, 8, 62, 57, 106, 253, 7, 
-    62, 57, 106, 253, 6, 62, 57, 106, 253, 5, 230, 134, 62, 57, 106, 253, 4, 
-    62, 57, 106, 253, 3, 215, 235, 62, 57, 106, 253, 2, 62, 57, 106, 253, 1, 
-    62, 57, 106, 253, 0, 62, 57, 106, 252, 255, 62, 57, 106, 252, 254, 62, 
-    57, 106, 252, 253, 62, 57, 106, 252, 252, 62, 57, 106, 252, 251, 62, 57, 
-    106, 252, 250, 62, 57, 106, 252, 249, 62, 57, 106, 252, 248, 62, 57, 106, 
-    252, 247, 241, 211, 62, 57, 106, 252, 226, 244, 28, 62, 57, 106, 252, 
-    223, 252, 116, 62, 57, 106, 252, 218, 219, 5, 62, 57, 106, 252, 217, 74, 
-    62, 57, 106, 252, 216, 62, 57, 106, 252, 215, 217, 236, 62, 57, 106, 252, 
-    214, 62, 57, 106, 252, 213, 62, 57, 106, 252, 212, 211, 254, 250, 139, 
-    62, 57, 106, 252, 211, 250, 139, 62, 57, 106, 252, 210, 250, 140, 243, 
-    255, 62, 57, 106, 252, 209, 212, 0, 62, 57, 106, 252, 208, 62, 57, 106, 
-    252, 207, 62, 57, 230, 142, 252, 206, 247, 198, 62, 57, 106, 252, 205, 
-    62, 57, 106, 252, 204, 62, 57, 106, 252, 202, 62, 57, 106, 252, 201, 62, 
-    57, 106, 252, 200, 62, 57, 106, 252, 199, 248, 159, 62, 57, 106, 252, 
-    198, 62, 57, 106, 252, 197, 62, 57, 106, 252, 196, 62, 57, 106, 252, 195, 
-    62, 57, 106, 252, 194, 62, 57, 106, 213, 186, 253, 23, 62, 57, 106, 213, 
-    186, 252, 246, 62, 57, 106, 213, 186, 252, 245, 62, 57, 106, 213, 186, 
-    252, 244, 62, 57, 106, 213, 186, 252, 243, 62, 57, 106, 213, 186, 252, 
-    242, 62, 57, 106, 213, 186, 252, 241, 62, 57, 106, 213, 186, 252, 240, 
-    62, 57, 106, 213, 186, 252, 239, 62, 57, 106, 213, 186, 252, 238, 62, 57, 
-    106, 213, 186, 252, 237, 62, 57, 106, 213, 186, 252, 236, 62, 57, 106, 
-    213, 186, 252, 235, 62, 57, 106, 213, 186, 252, 234, 62, 57, 106, 213, 
-    186, 252, 233, 62, 57, 106, 213, 186, 252, 232, 62, 57, 106, 213, 186, 
-    252, 231, 62, 57, 106, 213, 186, 252, 230, 62, 57, 106, 213, 186, 252, 
-    229, 62, 57, 106, 213, 186, 252, 228, 62, 57, 106, 213, 186, 252, 227, 
-    62, 57, 106, 213, 186, 252, 225, 62, 57, 106, 213, 186, 252, 224, 62, 57, 
-    106, 213, 186, 252, 222, 62, 57, 106, 213, 186, 252, 221, 62, 57, 106, 
-    213, 186, 252, 220, 62, 57, 106, 213, 186, 252, 219, 62, 57, 106, 213, 
-    186, 252, 203, 62, 57, 106, 213, 186, 252, 193, 254, 236, 211, 209, 220, 
-    138, 232, 213, 254, 236, 211, 209, 220, 138, 247, 120, 254, 236, 250, 
-    130, 78, 254, 236, 54, 110, 254, 236, 54, 105, 254, 236, 54, 158, 254, 
-    236, 54, 161, 254, 236, 54, 189, 254, 236, 54, 194, 254, 236, 54, 198, 
-    254, 236, 54, 195, 254, 236, 54, 200, 254, 236, 54, 216, 247, 254, 236, 
-    54, 215, 73, 254, 236, 54, 216, 162, 254, 236, 54, 244, 15, 254, 236, 54, 
-    244, 114, 254, 236, 54, 219, 111, 254, 236, 54, 220, 116, 254, 236, 54, 
-    245, 184, 254, 236, 54, 228, 195, 254, 236, 54, 123, 240, 210, 254, 236, 
-    54, 113, 240, 210, 254, 236, 54, 134, 240, 210, 254, 236, 54, 244, 11, 
-    240, 210, 254, 236, 54, 244, 81, 240, 210, 254, 236, 54, 219, 125, 240, 
-    210, 254, 236, 54, 220, 122, 240, 210, 254, 236, 54, 245, 193, 240, 210, 
-    254, 236, 54, 228, 200, 240, 210, 254, 236, 54, 123, 216, 147, 254, 236, 
-    54, 113, 216, 147, 254, 236, 54, 134, 216, 147, 254, 236, 54, 244, 11, 
-    216, 147, 254, 236, 54, 244, 81, 216, 147, 254, 236, 54, 219, 125, 216, 
-    147, 254, 236, 54, 220, 122, 216, 147, 254, 236, 54, 245, 193, 216, 147, 
-    254, 236, 54, 228, 200, 216, 147, 254, 236, 54, 216, 248, 216, 147, 254, 
-    236, 54, 215, 74, 216, 147, 254, 236, 54, 216, 163, 216, 147, 254, 236, 
-    54, 244, 16, 216, 147, 254, 236, 54, 244, 115, 216, 147, 254, 236, 54, 
-    219, 112, 216, 147, 254, 236, 54, 220, 117, 216, 147, 254, 236, 54, 245, 
-    185, 216, 147, 254, 236, 54, 228, 196, 216, 147, 254, 236, 212, 14, 252, 
-    128, 214, 173, 254, 236, 212, 14, 244, 92, 218, 59, 254, 236, 212, 14, 
-    221, 176, 218, 59, 254, 236, 212, 14, 216, 169, 218, 59, 254, 236, 212, 
-    14, 244, 4, 218, 59, 254, 236, 246, 81, 231, 90, 244, 92, 218, 59, 254, 
-    236, 232, 199, 231, 90, 244, 92, 218, 59, 254, 236, 231, 90, 221, 176, 
-    218, 59, 254, 236, 231, 90, 216, 169, 218, 59, 26, 255, 6, 253, 194, 123, 
-    224, 21, 26, 255, 6, 253, 194, 123, 242, 27, 26, 255, 6, 253, 194, 123, 
-    246, 100, 26, 255, 6, 253, 194, 189, 26, 255, 6, 253, 194, 244, 114, 26, 
-    255, 6, 253, 194, 244, 81, 240, 210, 26, 255, 6, 253, 194, 244, 81, 216, 
-    147, 26, 255, 6, 253, 194, 244, 115, 216, 147, 26, 255, 6, 253, 194, 244, 
-    81, 217, 67, 26, 255, 6, 253, 194, 216, 248, 217, 67, 26, 255, 6, 253, 
-    194, 244, 115, 217, 67, 26, 255, 6, 253, 194, 123, 240, 211, 217, 67, 26, 
-    255, 6, 253, 194, 244, 81, 240, 211, 217, 67, 26, 255, 6, 253, 194, 123, 
-    216, 148, 217, 67, 26, 255, 6, 253, 194, 244, 81, 216, 148, 217, 67, 26, 
-    255, 6, 253, 194, 244, 81, 218, 150, 26, 255, 6, 253, 194, 216, 248, 218, 
-    150, 26, 255, 6, 253, 194, 244, 115, 218, 150, 26, 255, 6, 253, 194, 123, 
-    240, 211, 218, 150, 26, 255, 6, 253, 194, 244, 81, 240, 211, 218, 150, 
-    26, 255, 6, 253, 194, 123, 216, 148, 218, 150, 26, 255, 6, 253, 194, 216, 
-    248, 216, 148, 218, 150, 26, 255, 6, 253, 194, 244, 115, 216, 148, 218, 
-    150, 26, 255, 6, 253, 194, 216, 248, 230, 164, 26, 255, 6, 241, 205, 123, 
-    225, 31, 26, 255, 6, 216, 181, 110, 26, 255, 6, 241, 201, 110, 26, 255, 
-    6, 245, 104, 105, 26, 255, 6, 216, 181, 105, 26, 255, 6, 249, 65, 113, 
-    246, 99, 26, 255, 6, 245, 104, 113, 246, 99, 26, 255, 6, 215, 203, 189, 
-    26, 255, 6, 215, 203, 216, 247, 26, 255, 6, 215, 203, 216, 248, 254, 141, 
-    17, 26, 255, 6, 241, 201, 216, 247, 26, 255, 6, 231, 41, 216, 247, 26, 
-    255, 6, 216, 181, 216, 247, 26, 255, 6, 216, 181, 216, 162, 26, 255, 6, 
-    215, 203, 244, 114, 26, 255, 6, 215, 203, 244, 115, 254, 141, 17, 26, 
-    255, 6, 241, 201, 244, 114, 26, 255, 6, 216, 181, 244, 114, 26, 255, 6, 
-    216, 181, 123, 240, 210, 26, 255, 6, 216, 181, 134, 240, 210, 26, 255, 6, 
-    245, 104, 244, 81, 240, 210, 26, 255, 6, 215, 203, 244, 81, 240, 210, 26, 
-    255, 6, 216, 181, 244, 81, 240, 210, 26, 255, 6, 250, 227, 244, 81, 240, 
-    210, 26, 255, 6, 229, 182, 244, 81, 240, 210, 26, 255, 6, 216, 181, 123, 
-    216, 147, 26, 255, 6, 216, 181, 244, 81, 216, 147, 26, 255, 6, 248, 57, 
-    244, 81, 230, 164, 26, 255, 6, 218, 118, 244, 115, 230, 164, 26, 123, 
-    163, 50, 26, 123, 163, 5, 254, 141, 17, 26, 113, 216, 167, 50, 26, 134, 
-    224, 20, 50, 26, 211, 45, 50, 26, 217, 68, 50, 26, 246, 101, 50, 26, 226, 
-    246, 50, 26, 113, 226, 245, 50, 26, 134, 226, 245, 50, 26, 244, 11, 226, 
-    245, 50, 26, 244, 81, 226, 245, 50, 26, 231, 35, 50, 26, 233, 157, 252, 
-    128, 50, 26, 232, 194, 50, 26, 226, 131, 50, 26, 211, 159, 50, 26, 253, 
-    243, 50, 26, 254, 0, 50, 26, 242, 144, 50, 26, 215, 186, 252, 128, 50, 
-    26, 210, 87, 50, 222, 198, 220, 113, 50, 222, 198, 214, 185, 50, 222, 
-    198, 220, 142, 50, 222, 198, 220, 111, 50, 222, 198, 247, 213, 220, 111, 
-    50, 222, 198, 219, 168, 50, 222, 198, 248, 53, 50, 222, 198, 224, 6, 50, 
-    222, 198, 220, 129, 50, 222, 198, 246, 60, 50, 222, 198, 253, 238, 50, 
-    222, 198, 250, 171, 50, 225, 143, 247, 191, 5, 225, 213, 225, 143, 247, 
-    191, 5, 225, 24, 241, 235, 225, 143, 247, 191, 5, 217, 45, 241, 235, 225, 
-    143, 247, 191, 5, 250, 247, 225, 143, 247, 191, 5, 250, 101, 225, 143, 
-    247, 191, 5, 211, 221, 225, 143, 247, 191, 5, 241, 211, 225, 143, 247, 
-    191, 5, 243, 85, 225, 143, 247, 191, 5, 216, 116, 225, 143, 247, 191, 5, 
-    74, 225, 143, 247, 191, 5, 251, 169, 225, 143, 247, 191, 5, 220, 29, 225, 
-    143, 247, 191, 5, 249, 244, 225, 143, 247, 191, 5, 231, 184, 225, 143, 
-    247, 191, 5, 231, 136, 225, 143, 247, 191, 5, 221, 216, 225, 143, 247, 
-    191, 5, 232, 237, 225, 143, 247, 191, 5, 251, 188, 225, 143, 247, 191, 5, 
-    250, 231, 225, 35, 225, 143, 247, 191, 5, 247, 133, 225, 143, 247, 191, 
-    5, 249, 223, 225, 143, 247, 191, 5, 219, 87, 225, 143, 247, 191, 5, 249, 
-    224, 225, 143, 247, 191, 5, 252, 63, 225, 143, 247, 191, 5, 220, 16, 225, 
-    143, 247, 191, 5, 240, 248, 225, 143, 247, 191, 5, 241, 178, 225, 143, 
-    247, 191, 5, 251, 112, 233, 36, 225, 143, 247, 191, 5, 250, 224, 225, 
-    143, 247, 191, 5, 223, 153, 225, 143, 247, 191, 5, 245, 230, 225, 143, 
-    247, 191, 5, 246, 107, 225, 143, 247, 191, 5, 215, 105, 225, 143, 247, 
-    191, 5, 252, 66, 225, 143, 247, 191, 5, 225, 36, 215, 235, 225, 143, 247, 
-    191, 5, 213, 159, 225, 143, 247, 191, 5, 226, 18, 225, 143, 247, 191, 5, 
-    222, 190, 225, 143, 247, 191, 5, 232, 224, 225, 143, 247, 191, 5, 226, 
-    115, 252, 184, 225, 143, 247, 191, 5, 244, 48, 225, 143, 247, 191, 5, 
-    242, 138, 225, 143, 247, 191, 5, 218, 119, 225, 143, 247, 191, 5, 4, 253, 
-    168, 225, 143, 247, 191, 5, 212, 32, 252, 148, 225, 143, 247, 191, 5, 38, 
-    226, 248, 91, 232, 60, 1, 61, 232, 60, 1, 75, 232, 60, 1, 253, 158, 232, 
-    60, 1, 252, 19, 232, 60, 1, 243, 202, 232, 60, 1, 249, 60, 232, 60, 1, 
-    73, 232, 60, 1, 212, 98, 232, 60, 1, 210, 159, 232, 60, 1, 216, 210, 232, 
-    60, 1, 235, 144, 232, 60, 1, 235, 23, 232, 60, 1, 224, 96, 232, 60, 1, 
-    156, 232, 60, 1, 193, 232, 60, 1, 230, 25, 232, 60, 1, 230, 166, 232, 60, 
-    1, 228, 111, 232, 60, 1, 70, 232, 60, 1, 226, 105, 232, 60, 1, 234, 47, 
-    232, 60, 1, 153, 232, 60, 1, 222, 91, 232, 60, 1, 217, 152, 232, 60, 1, 
-    215, 159, 232, 60, 1, 254, 123, 232, 60, 1, 245, 150, 232, 60, 1, 242, 
-    60, 232, 60, 1, 211, 178, 250, 237, 1, 61, 250, 237, 1, 226, 91, 250, 
-    237, 1, 249, 60, 250, 237, 1, 156, 250, 237, 1, 214, 116, 250, 237, 1, 
-    153, 250, 237, 1, 233, 62, 250, 237, 1, 255, 75, 250, 237, 1, 224, 96, 
-    250, 237, 1, 253, 158, 250, 237, 1, 193, 250, 237, 1, 76, 250, 237, 1, 
-    248, 223, 250, 237, 1, 217, 152, 250, 237, 1, 220, 104, 250, 237, 1, 220, 
-    103, 250, 237, 1, 222, 91, 250, 237, 1, 251, 65, 250, 237, 1, 70, 250, 
-    237, 1, 228, 111, 250, 237, 1, 211, 178, 250, 237, 1, 230, 25, 250, 237, 
-    1, 215, 158, 250, 237, 1, 226, 105, 250, 237, 1, 218, 226, 250, 237, 1, 
-    73, 250, 237, 1, 75, 250, 237, 1, 214, 113, 250, 237, 1, 235, 23, 250, 
-    237, 1, 235, 14, 250, 237, 1, 229, 150, 250, 237, 1, 214, 118, 250, 237, 
-    1, 243, 202, 250, 237, 1, 243, 137, 250, 237, 1, 218, 168, 250, 237, 1, 
-    218, 167, 250, 237, 1, 229, 79, 250, 237, 1, 236, 33, 250, 237, 1, 251, 
-    64, 250, 237, 1, 215, 159, 250, 237, 1, 214, 115, 250, 237, 1, 222, 180, 
-    250, 237, 1, 231, 129, 250, 237, 1, 231, 128, 250, 237, 1, 231, 127, 250, 
-    237, 1, 231, 126, 250, 237, 1, 233, 61, 250, 237, 1, 245, 234, 250, 237, 
-    1, 214, 114, 55, 32, 1, 61, 55, 32, 1, 252, 75, 55, 32, 1, 234, 182, 55, 
-    32, 1, 248, 90, 55, 32, 1, 75, 55, 32, 1, 213, 255, 55, 32, 1, 210, 94, 
-    55, 32, 1, 241, 238, 55, 32, 1, 216, 195, 55, 32, 1, 73, 55, 32, 1, 176, 
-    55, 32, 1, 245, 174, 55, 32, 1, 245, 159, 55, 32, 1, 245, 150, 55, 32, 1, 
-    245, 75, 55, 32, 1, 76, 55, 32, 1, 225, 221, 55, 32, 1, 220, 63, 55, 32, 
-    1, 233, 217, 55, 32, 1, 245, 92, 55, 32, 1, 245, 82, 55, 32, 1, 217, 22, 
-    55, 32, 1, 70, 55, 32, 1, 245, 177, 55, 32, 1, 225, 136, 55, 32, 1, 234, 
-    119, 55, 32, 1, 245, 202, 55, 32, 1, 245, 84, 55, 32, 1, 250, 131, 55, 
-    32, 1, 236, 33, 55, 32, 1, 214, 118, 55, 32, 227, 198, 110, 55, 32, 227, 
-    198, 189, 55, 32, 227, 198, 216, 247, 55, 32, 227, 198, 244, 114, 242, 
-    153, 1, 254, 204, 242, 153, 1, 252, 163, 242, 153, 1, 242, 211, 242, 153, 
-    1, 248, 204, 242, 153, 1, 254, 200, 242, 153, 1, 224, 79, 242, 153, 1, 
-    235, 155, 242, 153, 1, 242, 39, 242, 153, 1, 216, 158, 242, 153, 1, 245, 
-    183, 242, 153, 1, 233, 190, 242, 153, 1, 233, 113, 242, 153, 1, 231, 179, 
-    242, 153, 1, 229, 184, 242, 153, 1, 235, 119, 242, 153, 1, 214, 136, 242, 
-    153, 1, 226, 69, 242, 153, 1, 228, 195, 242, 153, 1, 223, 165, 242, 153, 
-    1, 221, 218, 242, 153, 1, 217, 4, 242, 153, 1, 211, 234, 242, 153, 1, 
-    244, 178, 242, 153, 1, 236, 37, 242, 153, 1, 240, 199, 242, 153, 1, 226, 
-    139, 242, 153, 1, 228, 200, 240, 210, 214, 209, 1, 254, 147, 214, 209, 1, 
-    252, 26, 214, 209, 1, 243, 108, 214, 209, 1, 234, 132, 214, 209, 1, 248, 
-    54, 214, 209, 1, 241, 68, 214, 209, 1, 211, 227, 214, 209, 1, 210, 85, 
-    214, 209, 1, 240, 241, 214, 209, 1, 216, 230, 214, 209, 1, 210, 233, 214, 
-    209, 1, 234, 250, 214, 209, 1, 220, 20, 214, 209, 1, 233, 98, 214, 209, 
-    1, 231, 65, 214, 209, 1, 248, 21, 214, 209, 1, 227, 194, 214, 209, 1, 
-    210, 13, 214, 209, 1, 221, 248, 214, 209, 1, 254, 196, 214, 209, 1, 224, 
-    150, 214, 209, 1, 222, 25, 214, 209, 1, 224, 35, 214, 209, 1, 223, 144, 
-    214, 209, 1, 216, 199, 214, 209, 1, 242, 244, 214, 209, 1, 111, 214, 209, 
-    1, 73, 214, 209, 1, 70, 214, 209, 1, 218, 179, 214, 209, 211, 209, 247, 
-    172, 55, 225, 169, 5, 61, 55, 225, 169, 5, 73, 55, 225, 169, 5, 70, 55, 
-    225, 169, 5, 176, 55, 225, 169, 5, 233, 217, 55, 225, 169, 5, 243, 135, 
-    55, 225, 169, 5, 242, 113, 55, 225, 169, 5, 211, 165, 55, 225, 169, 5, 
-    251, 33, 55, 225, 169, 5, 235, 141, 55, 225, 169, 5, 235, 108, 55, 225, 
-    169, 5, 217, 105, 55, 225, 169, 5, 215, 118, 55, 225, 169, 5, 248, 221, 
-    55, 225, 169, 5, 248, 3, 55, 225, 169, 5, 246, 78, 55, 225, 169, 5, 216, 
-    208, 55, 225, 169, 5, 190, 55, 225, 169, 5, 252, 191, 55, 225, 169, 5, 
-    244, 196, 55, 225, 169, 5, 197, 55, 225, 169, 5, 227, 237, 55, 225, 169, 
-    5, 184, 55, 225, 169, 5, 230, 230, 55, 225, 169, 5, 230, 102, 55, 225, 
-    169, 5, 191, 55, 225, 169, 5, 214, 27, 55, 225, 169, 5, 213, 176, 55, 
-    225, 169, 5, 205, 55, 225, 169, 5, 222, 140, 55, 225, 169, 5, 233, 135, 
-    55, 225, 169, 5, 206, 55, 225, 169, 5, 210, 116, 55, 225, 169, 5, 220, 
-    102, 55, 225, 169, 5, 218, 223, 55, 225, 169, 5, 162, 55, 225, 169, 5, 
-    253, 186, 55, 225, 169, 5, 253, 185, 55, 225, 169, 5, 253, 184, 55, 225, 
-    169, 5, 211, 142, 55, 225, 169, 5, 248, 200, 55, 225, 169, 5, 248, 199, 
-    55, 225, 169, 5, 252, 170, 55, 225, 169, 5, 251, 85, 55, 225, 169, 211, 
-    209, 247, 172, 55, 225, 169, 54, 110, 55, 225, 169, 54, 105, 55, 225, 
-    169, 54, 216, 247, 55, 225, 169, 54, 215, 73, 55, 225, 169, 54, 240, 210, 
-    181, 6, 1, 199, 73, 181, 6, 1, 199, 75, 181, 6, 1, 199, 61, 181, 6, 1, 
-    199, 254, 209, 181, 6, 1, 199, 76, 181, 6, 1, 199, 226, 183, 181, 6, 1, 
-    219, 251, 73, 181, 6, 1, 219, 251, 75, 181, 6, 1, 219, 251, 61, 181, 6, 
-    1, 219, 251, 254, 209, 181, 6, 1, 219, 251, 76, 181, 6, 1, 219, 251, 226, 
-    183, 181, 6, 1, 253, 167, 181, 6, 1, 226, 116, 181, 6, 1, 211, 195, 181, 
-    6, 1, 211, 44, 181, 6, 1, 242, 60, 181, 6, 1, 225, 211, 181, 6, 1, 252, 
-    66, 181, 6, 1, 217, 11, 181, 6, 1, 248, 77, 181, 6, 1, 250, 128, 181, 6, 
-    1, 235, 124, 181, 6, 1, 234, 189, 181, 6, 1, 243, 83, 181, 6, 1, 245, 
-    202, 181, 6, 1, 213, 250, 181, 6, 1, 245, 59, 181, 6, 1, 216, 194, 181, 
-    6, 1, 245, 82, 181, 6, 1, 210, 92, 181, 6, 1, 245, 75, 181, 6, 1, 210, 
-    73, 181, 6, 1, 245, 92, 181, 6, 1, 245, 174, 181, 6, 1, 245, 159, 181, 6, 
-    1, 245, 150, 181, 6, 1, 245, 138, 181, 6, 1, 226, 219, 181, 6, 1, 245, 
-    38, 181, 4, 1, 199, 73, 181, 4, 1, 199, 75, 181, 4, 1, 199, 61, 181, 4, 
-    1, 199, 254, 209, 181, 4, 1, 199, 76, 181, 4, 1, 199, 226, 183, 181, 4, 
-    1, 219, 251, 73, 181, 4, 1, 219, 251, 75, 181, 4, 1, 219, 251, 61, 181, 
-    4, 1, 219, 251, 254, 209, 181, 4, 1, 219, 251, 76, 181, 4, 1, 219, 251, 
-    226, 183, 181, 4, 1, 253, 167, 181, 4, 1, 226, 116, 181, 4, 1, 211, 195, 
-    181, 4, 1, 211, 44, 181, 4, 1, 242, 60, 181, 4, 1, 225, 211, 181, 4, 1, 
-    252, 66, 181, 4, 1, 217, 11, 181, 4, 1, 248, 77, 181, 4, 1, 250, 128, 
-    181, 4, 1, 235, 124, 181, 4, 1, 234, 189, 181, 4, 1, 243, 83, 181, 4, 1, 
-    245, 202, 181, 4, 1, 213, 250, 181, 4, 1, 245, 59, 181, 4, 1, 216, 194, 
-    181, 4, 1, 245, 82, 181, 4, 1, 210, 92, 181, 4, 1, 245, 75, 181, 4, 1, 
-    210, 73, 181, 4, 1, 245, 92, 181, 4, 1, 245, 174, 181, 4, 1, 245, 159, 
-    181, 4, 1, 245, 150, 181, 4, 1, 245, 138, 181, 4, 1, 226, 219, 181, 4, 1, 
-    245, 38, 220, 69, 1, 225, 209, 220, 69, 1, 216, 5, 220, 69, 1, 234, 91, 
-    220, 69, 1, 244, 147, 220, 69, 1, 216, 172, 220, 69, 1, 219, 58, 220, 69, 
-    1, 218, 14, 220, 69, 1, 250, 61, 220, 69, 1, 211, 46, 220, 69, 1, 240, 
-    209, 220, 69, 1, 252, 5, 220, 69, 1, 248, 89, 220, 69, 1, 243, 121, 220, 
-    69, 1, 213, 123, 220, 69, 1, 216, 176, 220, 69, 1, 210, 21, 220, 69, 1, 
-    231, 89, 220, 69, 1, 235, 49, 220, 69, 1, 211, 225, 220, 69, 1, 242, 48, 
-    220, 69, 1, 232, 142, 220, 69, 1, 230, 189, 220, 69, 1, 236, 40, 220, 69, 
-    1, 245, 201, 220, 69, 1, 253, 231, 220, 69, 1, 254, 247, 220, 69, 1, 226, 
-    196, 220, 69, 1, 211, 212, 220, 69, 1, 226, 130, 220, 69, 1, 254, 209, 
-    220, 69, 1, 222, 208, 220, 69, 1, 227, 194, 220, 69, 1, 245, 217, 220, 
-    69, 1, 254, 214, 220, 69, 1, 240, 111, 220, 69, 1, 214, 163, 220, 69, 1, 
-    226, 254, 220, 69, 1, 226, 176, 220, 69, 1, 226, 218, 220, 69, 1, 253, 
-    170, 220, 69, 1, 254, 19, 220, 69, 1, 226, 158, 220, 69, 1, 254, 192, 
-    220, 69, 1, 245, 86, 220, 69, 1, 253, 253, 220, 69, 1, 245, 227, 220, 69, 
-    1, 240, 118, 220, 69, 1, 211, 13, 226, 141, 1, 254, 170, 226, 141, 1, 
-    252, 191, 226, 141, 1, 217, 105, 226, 141, 1, 235, 141, 226, 141, 1, 211, 
-    165, 226, 141, 1, 234, 132, 226, 141, 1, 248, 76, 226, 141, 1, 205, 226, 
-    141, 1, 206, 226, 141, 1, 220, 26, 226, 141, 1, 248, 25, 226, 141, 1, 
-    250, 215, 226, 141, 1, 243, 135, 226, 141, 1, 244, 196, 226, 141, 1, 224, 
-    86, 226, 141, 1, 235, 9, 226, 141, 1, 233, 130, 226, 141, 1, 230, 200, 
-    226, 141, 1, 227, 178, 226, 141, 1, 212, 30, 226, 141, 1, 162, 226, 141, 
-    1, 191, 226, 141, 1, 61, 226, 141, 1, 75, 226, 141, 1, 73, 226, 141, 1, 
-    76, 226, 141, 1, 70, 226, 141, 1, 255, 73, 226, 141, 1, 245, 209, 226, 
-    141, 1, 226, 183, 226, 141, 21, 210, 86, 226, 141, 21, 110, 226, 141, 21, 
-    105, 226, 141, 21, 158, 226, 141, 21, 161, 226, 141, 21, 189, 226, 141, 
-    21, 194, 226, 141, 21, 198, 226, 141, 21, 195, 226, 141, 21, 200, 249, 
-    67, 3, 61, 249, 67, 3, 75, 249, 67, 3, 73, 249, 67, 3, 76, 249, 67, 3, 
-    70, 249, 67, 3, 235, 141, 249, 67, 3, 235, 68, 249, 67, 3, 176, 249, 67, 
-    3, 234, 182, 249, 67, 3, 234, 92, 249, 67, 3, 234, 28, 249, 67, 3, 233, 
-    217, 249, 67, 3, 233, 135, 249, 67, 3, 233, 58, 249, 67, 3, 232, 241, 
-    249, 67, 3, 232, 156, 249, 67, 3, 232, 98, 249, 67, 3, 184, 249, 67, 3, 
-    231, 91, 249, 67, 3, 230, 230, 249, 67, 3, 230, 161, 249, 67, 3, 230, 
-    102, 249, 67, 3, 197, 249, 67, 3, 229, 107, 249, 67, 3, 228, 233, 249, 
-    67, 3, 228, 74, 249, 67, 3, 227, 237, 249, 67, 3, 190, 249, 67, 3, 225, 
-    221, 249, 67, 3, 225, 108, 249, 67, 3, 225, 16, 249, 67, 3, 224, 150, 
-    249, 67, 3, 205, 249, 67, 3, 223, 128, 249, 67, 3, 223, 35, 249, 67, 3, 
-    222, 211, 249, 67, 3, 222, 140, 249, 67, 3, 206, 249, 67, 3, 221, 181, 
-    249, 67, 3, 219, 191, 249, 67, 3, 219, 58, 249, 67, 3, 218, 83, 249, 67, 
-    3, 217, 105, 249, 67, 3, 217, 22, 249, 67, 3, 216, 117, 249, 67, 3, 111, 
-    249, 67, 3, 215, 118, 249, 67, 3, 212, 65, 249, 67, 3, 212, 22, 249, 67, 
-    3, 211, 250, 249, 67, 3, 211, 227, 249, 67, 3, 211, 165, 249, 67, 3, 211, 
-    162, 249, 67, 3, 210, 116, 249, 67, 3, 210, 23, 236, 1, 254, 27, 1, 254, 
-    168, 236, 1, 254, 27, 1, 252, 25, 236, 1, 254, 27, 1, 242, 201, 236, 1, 
-    254, 27, 1, 248, 188, 236, 1, 254, 27, 1, 241, 238, 236, 1, 254, 27, 1, 
-    212, 30, 236, 1, 254, 27, 1, 210, 97, 236, 1, 254, 27, 1, 241, 195, 236, 
-    1, 254, 27, 1, 216, 226, 236, 1, 254, 27, 1, 210, 232, 236, 1, 254, 27, 
-    1, 234, 225, 236, 1, 254, 27, 1, 233, 93, 236, 1, 254, 27, 1, 231, 65, 
-    236, 1, 254, 27, 1, 227, 194, 236, 1, 254, 27, 1, 221, 249, 236, 1, 254, 
-    27, 1, 253, 162, 236, 1, 254, 27, 1, 225, 221, 236, 1, 254, 27, 1, 222, 
-    24, 236, 1, 254, 27, 1, 224, 34, 236, 1, 254, 27, 1, 223, 67, 236, 1, 
-    254, 27, 1, 220, 20, 236, 1, 254, 27, 1, 217, 36, 236, 1, 254, 27, 221, 
-    173, 50, 236, 1, 254, 27, 54, 110, 236, 1, 254, 27, 54, 105, 236, 1, 254, 
-    27, 54, 158, 236, 1, 254, 27, 54, 216, 247, 236, 1, 254, 27, 54, 215, 73, 
-    236, 1, 254, 27, 54, 123, 240, 210, 236, 1, 254, 27, 54, 123, 216, 147, 
-    236, 1, 254, 27, 54, 216, 248, 216, 147, 225, 119, 1, 254, 165, 225, 119, 
-    1, 252, 28, 225, 119, 1, 243, 109, 225, 119, 1, 248, 56, 225, 119, 1, 
-    241, 238, 225, 119, 1, 212, 37, 225, 119, 1, 210, 110, 225, 119, 1, 241, 
-    197, 225, 119, 1, 216, 230, 225, 119, 1, 210, 233, 225, 119, 1, 234, 250, 
-    225, 119, 1, 233, 99, 225, 119, 1, 231, 65, 225, 119, 1, 227, 194, 225, 
-    119, 1, 220, 144, 225, 119, 1, 254, 196, 225, 119, 1, 225, 221, 225, 119, 
-    1, 222, 25, 225, 119, 1, 224, 39, 225, 119, 1, 222, 189, 225, 119, 1, 
-    220, 20, 225, 119, 1, 217, 41, 225, 119, 54, 110, 225, 119, 54, 216, 247, 
-    225, 119, 54, 215, 73, 225, 119, 54, 123, 240, 210, 225, 119, 54, 105, 
-    225, 119, 54, 158, 225, 119, 211, 209, 220, 137, 232, 59, 1, 61, 232, 59, 
-    1, 253, 158, 232, 59, 1, 243, 202, 232, 59, 1, 249, 60, 232, 59, 1, 75, 
-    232, 59, 1, 214, 105, 232, 59, 1, 73, 232, 59, 1, 211, 117, 232, 59, 1, 
-    235, 23, 232, 59, 1, 156, 232, 59, 1, 193, 232, 59, 1, 230, 25, 232, 59, 
-    1, 76, 232, 59, 1, 153, 232, 59, 1, 218, 226, 232, 59, 1, 217, 152, 232, 
-    59, 1, 70, 232, 59, 1, 245, 6, 232, 59, 1, 224, 96, 232, 59, 1, 222, 91, 
-    232, 59, 1, 215, 159, 232, 59, 1, 254, 123, 232, 59, 1, 245, 150, 232, 
-    59, 1, 232, 62, 232, 59, 1, 228, 111, 232, 59, 1, 251, 66, 232, 59, 215, 
-    222, 78, 231, 48, 241, 174, 1, 61, 231, 48, 241, 174, 1, 75, 231, 48, 
-    241, 174, 1, 73, 231, 48, 241, 174, 1, 76, 231, 48, 241, 174, 1, 191, 
-    231, 48, 241, 174, 1, 212, 65, 231, 48, 241, 174, 1, 252, 191, 231, 48, 
-    241, 174, 1, 252, 190, 231, 48, 241, 174, 1, 190, 231, 48, 241, 174, 1, 
-    184, 231, 48, 241, 174, 1, 197, 231, 48, 241, 174, 1, 229, 228, 231, 48, 
-    241, 174, 1, 229, 107, 231, 48, 241, 174, 1, 229, 106, 231, 48, 241, 174, 
-    1, 205, 231, 48, 241, 174, 1, 223, 187, 231, 48, 241, 174, 1, 233, 135, 
-    231, 48, 241, 174, 1, 234, 132, 231, 48, 241, 174, 1, 241, 189, 231, 48, 
-    241, 174, 1, 206, 231, 48, 241, 174, 1, 222, 33, 231, 48, 241, 174, 1, 
-    221, 181, 231, 48, 241, 174, 1, 176, 231, 48, 241, 174, 1, 224, 88, 231, 
-    48, 241, 174, 1, 217, 105, 231, 48, 241, 174, 1, 217, 104, 231, 48, 241, 
-    174, 1, 217, 22, 231, 48, 241, 174, 1, 217, 21, 231, 48, 241, 174, 1, 
-    111, 231, 48, 241, 174, 1, 248, 221, 231, 48, 241, 174, 16, 213, 170, 
-    231, 48, 241, 174, 16, 213, 169, 231, 48, 249, 94, 1, 61, 231, 48, 249, 
-    94, 1, 75, 231, 48, 249, 94, 1, 73, 231, 48, 249, 94, 1, 76, 231, 48, 
-    249, 94, 1, 191, 231, 48, 249, 94, 1, 212, 65, 231, 48, 249, 94, 1, 252, 
-    191, 231, 48, 249, 94, 1, 190, 231, 48, 249, 94, 1, 184, 231, 48, 249, 
-    94, 1, 197, 231, 48, 249, 94, 1, 229, 107, 231, 48, 249, 94, 1, 205, 231, 
-    48, 249, 94, 1, 233, 135, 231, 48, 249, 94, 1, 234, 132, 231, 48, 249, 
-    94, 1, 241, 189, 231, 48, 249, 94, 1, 206, 231, 48, 249, 94, 1, 254, 23, 
-    206, 231, 48, 249, 94, 1, 221, 181, 231, 48, 249, 94, 1, 176, 231, 48, 
-    249, 94, 1, 224, 88, 231, 48, 249, 94, 1, 217, 105, 231, 48, 249, 94, 1, 
-    217, 22, 231, 48, 249, 94, 1, 111, 231, 48, 249, 94, 1, 248, 221, 231, 
-    48, 249, 94, 232, 145, 222, 217, 231, 48, 249, 94, 232, 145, 236, 6, 234, 
-    120, 1, 61, 234, 120, 25, 5, 73, 234, 120, 25, 5, 70, 234, 120, 25, 5, 
-    149, 153, 234, 120, 25, 5, 75, 234, 120, 25, 5, 76, 234, 120, 25, 233, 
-    23, 78, 234, 120, 5, 52, 222, 234, 51, 234, 120, 5, 254, 75, 234, 120, 5, 
-    213, 147, 234, 120, 1, 176, 234, 120, 1, 234, 132, 234, 120, 1, 243, 135, 
-    234, 120, 1, 242, 249, 234, 120, 1, 251, 33, 234, 120, 1, 250, 157, 234, 
-    120, 1, 235, 141, 234, 120, 1, 227, 165, 234, 120, 1, 215, 156, 234, 120, 
-    1, 215, 144, 234, 120, 1, 248, 135, 234, 120, 1, 248, 119, 234, 120, 1, 
-    228, 110, 234, 120, 1, 217, 105, 234, 120, 1, 216, 208, 234, 120, 1, 248, 
-    221, 234, 120, 1, 248, 25, 234, 120, 1, 197, 234, 120, 1, 190, 234, 120, 
-    1, 225, 147, 234, 120, 1, 252, 191, 234, 120, 1, 252, 18, 234, 120, 1, 
-    184, 234, 120, 1, 191, 234, 120, 1, 205, 234, 120, 1, 233, 135, 234, 120, 
-    1, 214, 27, 234, 120, 1, 220, 102, 234, 120, 1, 218, 223, 234, 120, 1, 
-    206, 234, 120, 1, 210, 116, 234, 120, 1, 162, 234, 120, 1, 234, 46, 234, 
-    120, 1, 215, 124, 234, 120, 5, 252, 141, 48, 234, 120, 5, 250, 221, 234, 
-    120, 5, 59, 51, 234, 120, 213, 152, 234, 120, 21, 110, 234, 120, 21, 105, 
-    234, 120, 21, 158, 234, 120, 21, 161, 234, 120, 54, 216, 247, 234, 120, 
-    54, 215, 73, 234, 120, 54, 123, 240, 210, 234, 120, 54, 123, 216, 147, 
-    234, 120, 224, 141, 247, 120, 234, 120, 224, 141, 4, 250, 35, 234, 120, 
-    224, 141, 250, 35, 234, 120, 224, 141, 249, 137, 130, 234, 120, 224, 141, 
-    231, 180, 234, 120, 224, 141, 232, 115, 234, 120, 224, 141, 248, 178, 
-    234, 120, 224, 141, 52, 248, 178, 234, 120, 224, 141, 232, 207, 55, 219, 
-    28, 254, 38, 1, 241, 238, 55, 219, 28, 254, 38, 1, 233, 93, 55, 219, 28, 
-    254, 38, 1, 241, 195, 55, 219, 28, 254, 38, 1, 231, 65, 55, 219, 28, 254, 
-    38, 1, 224, 34, 55, 219, 28, 254, 38, 1, 212, 30, 55, 219, 28, 254, 38, 
-    1, 220, 20, 55, 219, 28, 254, 38, 1, 223, 67, 55, 219, 28, 254, 38, 1, 
-    252, 25, 55, 219, 28, 254, 38, 1, 217, 36, 55, 219, 28, 254, 38, 1, 221, 
-    226, 55, 219, 28, 254, 38, 1, 234, 225, 55, 219, 28, 254, 38, 1, 227, 
-    194, 55, 219, 28, 254, 38, 1, 234, 116, 55, 219, 28, 254, 38, 1, 222, 24, 
-    55, 219, 28, 254, 38, 1, 221, 249, 55, 219, 28, 254, 38, 1, 244, 154, 55, 
-    219, 28, 254, 38, 1, 254, 170, 55, 219, 28, 254, 38, 1, 253, 161, 55, 
-    219, 28, 254, 38, 1, 248, 22, 55, 219, 28, 254, 38, 1, 242, 201, 55, 219, 
-    28, 254, 38, 1, 248, 188, 55, 219, 28, 254, 38, 1, 242, 238, 55, 219, 28, 
-    254, 38, 1, 216, 226, 55, 219, 28, 254, 38, 1, 210, 96, 55, 219, 28, 254, 
-    38, 1, 248, 19, 55, 219, 28, 254, 38, 1, 210, 232, 55, 219, 28, 254, 38, 
-    1, 216, 197, 55, 219, 28, 254, 38, 1, 216, 178, 55, 219, 28, 254, 38, 54, 
-    110, 55, 219, 28, 254, 38, 54, 244, 114, 55, 219, 28, 254, 38, 132, 235, 
-    238, 253, 172, 1, 61, 253, 172, 1, 255, 73, 253, 172, 1, 254, 73, 253, 
-    172, 1, 255, 32, 253, 172, 1, 254, 123, 253, 172, 1, 255, 33, 253, 172, 
-    1, 254, 243, 253, 172, 1, 254, 239, 253, 172, 1, 75, 253, 172, 1, 245, 
-    209, 253, 172, 1, 76, 253, 172, 1, 226, 183, 253, 172, 1, 73, 253, 172, 
-    1, 236, 33, 253, 172, 1, 70, 253, 172, 1, 214, 118, 253, 172, 1, 234, 
-    182, 253, 172, 1, 211, 162, 253, 172, 1, 211, 128, 253, 172, 1, 211, 137, 
-    253, 172, 1, 243, 62, 253, 172, 1, 243, 24, 253, 172, 1, 242, 236, 253, 
-    172, 1, 250, 190, 253, 172, 1, 235, 126, 253, 172, 1, 217, 22, 253, 172, 
-    1, 216, 195, 253, 172, 1, 248, 90, 253, 172, 1, 248, 17, 253, 172, 1, 
-    215, 151, 253, 172, 1, 225, 221, 253, 172, 1, 244, 154, 253, 172, 1, 252, 
-    75, 253, 172, 1, 252, 14, 253, 172, 1, 229, 64, 253, 172, 1, 228, 239, 
-    253, 172, 1, 228, 240, 253, 172, 1, 229, 107, 253, 172, 1, 227, 156, 253, 
-    172, 1, 228, 105, 253, 172, 1, 231, 91, 253, 172, 1, 241, 116, 253, 172, 
-    1, 210, 166, 253, 172, 1, 211, 47, 253, 172, 1, 213, 255, 253, 172, 1, 
-    223, 128, 253, 172, 1, 233, 58, 253, 172, 1, 221, 181, 253, 172, 1, 210, 
-    94, 253, 172, 1, 220, 63, 253, 172, 1, 210, 74, 253, 172, 1, 219, 198, 
-    253, 172, 1, 218, 193, 253, 172, 1, 241, 238, 253, 172, 255, 21, 78, 216, 
-    79, 113, 170, 117, 123, 59, 224, 140, 4, 113, 170, 117, 123, 59, 224, 
-    140, 233, 85, 113, 170, 117, 123, 59, 224, 140, 233, 85, 123, 59, 117, 
-    113, 170, 224, 140, 233, 85, 113, 222, 232, 117, 123, 222, 234, 224, 140, 
-    233, 85, 123, 222, 234, 117, 113, 222, 232, 224, 140, 235, 218, 225, 254, 
-    1, 254, 168, 235, 218, 225, 254, 1, 252, 25, 235, 218, 225, 254, 1, 242, 
-    201, 235, 218, 225, 254, 1, 248, 188, 235, 218, 225, 254, 1, 241, 238, 
-    235, 218, 225, 254, 1, 212, 30, 235, 218, 225, 254, 1, 210, 97, 235, 218, 
-    225, 254, 1, 241, 195, 235, 218, 225, 254, 1, 216, 226, 235, 218, 225, 
-    254, 1, 210, 232, 235, 218, 225, 254, 1, 234, 225, 235, 218, 225, 254, 1, 
-    233, 93, 235, 218, 225, 254, 1, 231, 65, 235, 218, 225, 254, 1, 227, 194, 
-    235, 218, 225, 254, 1, 221, 249, 235, 218, 225, 254, 1, 253, 162, 235, 
-    218, 225, 254, 1, 225, 221, 235, 218, 225, 254, 1, 222, 24, 235, 218, 
-    225, 254, 1, 224, 34, 235, 218, 225, 254, 1, 223, 67, 235, 218, 225, 254, 
-    1, 220, 20, 235, 218, 225, 254, 1, 217, 36, 235, 218, 225, 254, 54, 110, 
-    235, 218, 225, 254, 54, 105, 235, 218, 225, 254, 54, 158, 235, 218, 225, 
-    254, 54, 161, 235, 218, 225, 254, 54, 216, 247, 235, 218, 225, 254, 54, 
-    215, 73, 235, 218, 225, 254, 54, 123, 240, 210, 235, 218, 225, 254, 54, 
-    123, 216, 147, 235, 218, 226, 72, 1, 254, 168, 235, 218, 226, 72, 1, 252, 
-    25, 235, 218, 226, 72, 1, 242, 201, 235, 218, 226, 72, 1, 248, 188, 235, 
-    218, 226, 72, 1, 241, 238, 235, 218, 226, 72, 1, 212, 29, 235, 218, 226, 
-    72, 1, 210, 97, 235, 218, 226, 72, 1, 241, 195, 235, 218, 226, 72, 1, 
-    216, 226, 235, 218, 226, 72, 1, 210, 232, 235, 218, 226, 72, 1, 234, 225, 
-    235, 218, 226, 72, 1, 233, 93, 235, 218, 226, 72, 1, 231, 64, 235, 218, 
-    226, 72, 1, 227, 194, 235, 218, 226, 72, 1, 221, 249, 235, 218, 226, 72, 
-    1, 225, 221, 235, 218, 226, 72, 1, 222, 24, 235, 218, 226, 72, 1, 220, 
-    20, 235, 218, 226, 72, 1, 217, 36, 235, 218, 226, 72, 54, 110, 235, 218, 
-    226, 72, 54, 105, 235, 218, 226, 72, 54, 158, 235, 218, 226, 72, 54, 161, 
-    235, 218, 226, 72, 54, 216, 247, 235, 218, 226, 72, 54, 215, 73, 235, 
-    218, 226, 72, 54, 123, 240, 210, 235, 218, 226, 72, 54, 123, 216, 147, 
-    55, 201, 1, 226, 149, 61, 55, 201, 1, 211, 37, 61, 55, 201, 1, 211, 37, 
-    254, 243, 55, 201, 1, 226, 149, 73, 55, 201, 1, 211, 37, 73, 55, 201, 1, 
-    211, 37, 75, 55, 201, 1, 226, 149, 76, 55, 201, 1, 226, 149, 226, 234, 
-    55, 201, 1, 211, 37, 226, 234, 55, 201, 1, 226, 149, 255, 25, 55, 201, 1, 
-    211, 37, 255, 25, 55, 201, 1, 226, 149, 254, 242, 55, 201, 1, 211, 37, 
-    254, 242, 55, 201, 1, 226, 149, 254, 216, 55, 201, 1, 211, 37, 254, 216, 
-    55, 201, 1, 226, 149, 254, 237, 55, 201, 1, 211, 37, 254, 237, 55, 201, 
-    1, 226, 149, 254, 255, 55, 201, 1, 211, 37, 254, 255, 55, 201, 1, 226, 
-    149, 254, 241, 55, 201, 1, 226, 149, 245, 12, 55, 201, 1, 211, 37, 245, 
-    12, 55, 201, 1, 226, 149, 253, 167, 55, 201, 1, 211, 37, 253, 167, 55, 
-    201, 1, 226, 149, 254, 224, 55, 201, 1, 211, 37, 254, 224, 55, 201, 1, 
-    226, 149, 254, 235, 55, 201, 1, 211, 37, 254, 235, 55, 201, 1, 226, 149, 
-    226, 233, 55, 201, 1, 211, 37, 226, 233, 55, 201, 1, 226, 149, 254, 178, 
-    55, 201, 1, 211, 37, 254, 178, 55, 201, 1, 226, 149, 254, 234, 55, 201, 
-    1, 226, 149, 245, 161, 55, 201, 1, 226, 149, 245, 159, 55, 201, 1, 226, 
-    149, 254, 123, 55, 201, 1, 226, 149, 254, 232, 55, 201, 1, 211, 37, 254, 
-    232, 55, 201, 1, 226, 149, 245, 131, 55, 201, 1, 211, 37, 245, 131, 55, 
-    201, 1, 226, 149, 245, 147, 55, 201, 1, 211, 37, 245, 147, 55, 201, 1, 
-    226, 149, 245, 118, 55, 201, 1, 211, 37, 245, 118, 55, 201, 1, 211, 37, 
-    254, 115, 55, 201, 1, 226, 149, 245, 138, 55, 201, 1, 211, 37, 254, 231, 
-    55, 201, 1, 226, 149, 245, 108, 55, 201, 1, 226, 149, 226, 175, 55, 201, 
-    1, 226, 149, 240, 113, 55, 201, 1, 226, 149, 245, 215, 55, 201, 1, 211, 
-    37, 245, 215, 55, 201, 1, 226, 149, 254, 45, 55, 201, 1, 211, 37, 254, 
-    45, 55, 201, 1, 226, 149, 235, 181, 55, 201, 1, 211, 37, 235, 181, 55, 
-    201, 1, 226, 149, 226, 159, 55, 201, 1, 211, 37, 226, 159, 55, 201, 1, 
-    226, 149, 254, 41, 55, 201, 1, 211, 37, 254, 41, 55, 201, 1, 226, 149, 
-    254, 230, 55, 201, 1, 226, 149, 253, 237, 55, 201, 1, 226, 149, 254, 228, 
-    55, 201, 1, 226, 149, 253, 231, 55, 201, 1, 211, 37, 253, 231, 55, 201, 
-    1, 226, 149, 245, 75, 55, 201, 1, 211, 37, 245, 75, 55, 201, 1, 226, 149, 
-    253, 206, 55, 201, 1, 211, 37, 253, 206, 55, 201, 1, 226, 149, 254, 225, 
-    55, 201, 1, 211, 37, 254, 225, 55, 201, 1, 226, 149, 226, 140, 55, 201, 
-    1, 226, 149, 252, 125, 222, 127, 21, 110, 222, 127, 21, 105, 222, 127, 
-    21, 158, 222, 127, 21, 161, 222, 127, 21, 189, 222, 127, 21, 194, 222, 
-    127, 21, 198, 222, 127, 21, 195, 222, 127, 21, 200, 222, 127, 54, 216, 
-    247, 222, 127, 54, 215, 73, 222, 127, 54, 216, 162, 222, 127, 54, 244, 
-    15, 222, 127, 54, 244, 114, 222, 127, 54, 219, 111, 222, 127, 54, 220, 
-    116, 222, 127, 54, 245, 184, 222, 127, 54, 228, 195, 222, 127, 54, 123, 
-    240, 210, 222, 127, 54, 113, 240, 210, 222, 127, 54, 134, 240, 210, 222, 
-    127, 54, 244, 11, 240, 210, 222, 127, 54, 244, 81, 240, 210, 222, 127, 
-    54, 219, 125, 240, 210, 222, 127, 54, 220, 122, 240, 210, 222, 127, 54, 
-    245, 193, 240, 210, 222, 127, 54, 228, 200, 240, 210, 222, 127, 244, 2, 
-    123, 242, 27, 222, 127, 244, 2, 123, 224, 21, 222, 127, 244, 2, 123, 216, 
-    168, 222, 127, 244, 2, 113, 216, 166, 118, 5, 250, 255, 118, 5, 254, 75, 
-    118, 5, 213, 147, 118, 5, 235, 102, 118, 5, 214, 161, 118, 1, 61, 118, 1, 
-    255, 73, 118, 1, 73, 118, 1, 236, 33, 118, 1, 70, 118, 1, 214, 118, 118, 
-    1, 149, 153, 118, 1, 149, 222, 180, 118, 1, 149, 156, 118, 1, 149, 232, 
-    185, 118, 1, 75, 118, 1, 254, 201, 118, 1, 76, 118, 1, 253, 192, 118, 1, 
-    176, 118, 1, 234, 132, 118, 1, 243, 135, 118, 1, 242, 249, 118, 1, 229, 
-    77, 118, 1, 251, 33, 118, 1, 250, 157, 118, 1, 235, 141, 118, 1, 235, 
-    114, 118, 1, 227, 165, 118, 1, 215, 156, 118, 1, 215, 144, 118, 1, 248, 
-    135, 118, 1, 248, 119, 118, 1, 228, 110, 118, 1, 217, 105, 118, 1, 216, 
-    208, 118, 1, 248, 221, 118, 1, 248, 25, 118, 1, 197, 118, 1, 190, 118, 1, 
-    225, 147, 118, 1, 252, 191, 118, 1, 252, 18, 118, 1, 184, 118, 1, 191, 
-    118, 1, 205, 118, 1, 233, 135, 118, 1, 214, 27, 118, 1, 220, 102, 118, 1, 
-    218, 223, 118, 1, 206, 118, 1, 162, 118, 1, 232, 184, 118, 1, 55, 36, 
-    232, 175, 118, 1, 55, 36, 222, 179, 118, 1, 55, 36, 228, 92, 118, 25, 5, 
-    255, 73, 118, 25, 5, 252, 15, 255, 73, 118, 25, 5, 73, 118, 25, 5, 236, 
-    33, 118, 25, 5, 70, 118, 25, 5, 214, 118, 118, 25, 5, 149, 153, 118, 25, 
-    5, 149, 222, 180, 118, 25, 5, 149, 156, 118, 25, 5, 149, 232, 185, 118, 
-    25, 5, 75, 118, 25, 5, 254, 201, 118, 25, 5, 76, 118, 25, 5, 253, 192, 
-    118, 213, 152, 118, 248, 178, 118, 52, 248, 178, 118, 224, 141, 247, 120, 
-    118, 224, 141, 52, 247, 120, 118, 224, 141, 232, 213, 118, 224, 141, 249, 
-    137, 130, 118, 224, 141, 232, 115, 118, 54, 110, 118, 54, 105, 118, 54, 
-    158, 118, 54, 161, 118, 54, 189, 118, 54, 194, 118, 54, 198, 118, 54, 
-    195, 118, 54, 200, 118, 54, 216, 247, 118, 54, 215, 73, 118, 54, 216, 
-    162, 118, 54, 244, 15, 118, 54, 244, 114, 118, 54, 219, 111, 118, 54, 
-    220, 116, 118, 54, 245, 184, 118, 54, 228, 195, 118, 54, 123, 240, 210, 
-    118, 54, 123, 216, 147, 118, 21, 210, 86, 118, 21, 110, 118, 21, 105, 
-    118, 21, 158, 118, 21, 161, 118, 21, 189, 118, 21, 194, 118, 21, 198, 
-    118, 21, 195, 118, 21, 200, 234, 244, 5, 250, 255, 234, 244, 5, 254, 75, 
-    234, 244, 5, 213, 147, 234, 244, 1, 61, 234, 244, 1, 255, 73, 234, 244, 
-    1, 73, 234, 244, 1, 236, 33, 234, 244, 1, 70, 234, 244, 1, 214, 118, 234, 
-    244, 1, 75, 234, 244, 1, 254, 201, 234, 244, 1, 76, 234, 244, 1, 253, 
-    192, 234, 244, 1, 176, 234, 244, 1, 234, 132, 234, 244, 1, 243, 135, 234, 
-    244, 1, 242, 249, 234, 244, 1, 229, 77, 234, 244, 1, 251, 33, 234, 244, 
-    1, 250, 157, 234, 244, 1, 235, 141, 234, 244, 1, 235, 114, 234, 244, 1, 
-    227, 165, 234, 244, 1, 215, 156, 234, 244, 1, 215, 144, 234, 244, 1, 248, 
-    135, 234, 244, 1, 248, 124, 234, 244, 1, 248, 119, 234, 244, 1, 223, 39, 
-    234, 244, 1, 228, 110, 234, 244, 1, 217, 105, 234, 244, 1, 216, 208, 234, 
-    244, 1, 248, 221, 234, 244, 1, 248, 25, 234, 244, 1, 197, 234, 244, 1, 
-    190, 234, 244, 1, 225, 147, 234, 244, 1, 252, 191, 234, 244, 1, 252, 18, 
-    234, 244, 1, 184, 234, 244, 1, 191, 234, 244, 1, 205, 234, 244, 1, 233, 
-    135, 234, 244, 1, 214, 27, 234, 244, 1, 220, 102, 234, 244, 1, 218, 223, 
-    234, 244, 1, 206, 234, 244, 1, 162, 234, 244, 25, 5, 255, 73, 234, 244, 
-    25, 5, 73, 234, 244, 25, 5, 236, 33, 234, 244, 25, 5, 70, 234, 244, 25, 
-    5, 214, 118, 234, 244, 25, 5, 75, 234, 244, 25, 5, 254, 201, 234, 244, 
-    25, 5, 76, 234, 244, 25, 5, 253, 192, 234, 244, 5, 213, 152, 234, 244, 5, 
-    227, 205, 234, 244, 255, 21, 50, 234, 244, 245, 121, 50, 234, 244, 54, 
-    50, 234, 244, 221, 173, 78, 234, 244, 52, 221, 173, 78, 234, 244, 248, 
-    178, 234, 244, 52, 248, 178, 219, 36, 219, 44, 1, 222, 18, 219, 36, 219, 
-    44, 1, 217, 80, 219, 36, 219, 44, 1, 252, 168, 219, 36, 219, 44, 1, 251, 
-    23, 219, 36, 219, 44, 1, 248, 203, 219, 36, 219, 44, 1, 243, 120, 219, 
-    36, 219, 44, 1, 231, 210, 219, 36, 219, 44, 1, 229, 74, 219, 36, 219, 44, 
-    1, 233, 112, 219, 36, 219, 44, 1, 229, 213, 219, 36, 219, 44, 1, 214, 24, 
-    219, 36, 219, 44, 1, 226, 73, 219, 36, 219, 44, 1, 211, 84, 219, 36, 219, 
-    44, 1, 223, 168, 219, 36, 219, 44, 1, 242, 37, 219, 36, 219, 44, 1, 234, 
-    248, 219, 36, 219, 44, 1, 235, 136, 219, 36, 219, 44, 1, 227, 162, 219, 
-    36, 219, 44, 1, 254, 209, 219, 36, 219, 44, 1, 245, 207, 219, 36, 219, 
-    44, 1, 236, 34, 219, 36, 219, 44, 1, 214, 208, 219, 36, 219, 44, 1, 226, 
-    222, 219, 36, 219, 44, 1, 245, 197, 219, 36, 219, 44, 1, 231, 223, 219, 
-    36, 219, 44, 21, 210, 86, 219, 36, 219, 44, 21, 110, 219, 36, 219, 44, 
-    21, 105, 219, 36, 219, 44, 21, 158, 219, 36, 219, 44, 21, 161, 219, 36, 
-    219, 44, 21, 189, 219, 36, 219, 44, 21, 194, 219, 36, 219, 44, 21, 198, 
-    219, 36, 219, 44, 21, 195, 219, 36, 219, 44, 21, 200, 250, 151, 5, 250, 
-    255, 250, 151, 5, 254, 75, 250, 151, 5, 213, 147, 250, 151, 1, 255, 73, 
-    250, 151, 1, 73, 250, 151, 1, 70, 250, 151, 1, 75, 250, 151, 1, 235, 10, 
-    250, 151, 1, 234, 131, 250, 151, 1, 243, 132, 250, 151, 1, 242, 248, 250, 
-    151, 1, 229, 76, 250, 151, 1, 251, 32, 250, 151, 1, 250, 156, 250, 151, 
-    1, 235, 140, 250, 151, 1, 235, 113, 250, 151, 1, 227, 164, 250, 151, 1, 
-    215, 155, 250, 151, 1, 215, 143, 250, 151, 1, 248, 134, 250, 151, 1, 248, 
-    118, 250, 151, 1, 228, 109, 250, 151, 1, 217, 101, 250, 151, 1, 216, 207, 
-    250, 151, 1, 248, 220, 250, 151, 1, 248, 24, 250, 151, 1, 229, 225, 250, 
-    151, 1, 226, 89, 250, 151, 1, 225, 146, 250, 151, 1, 252, 189, 250, 151, 
-    1, 252, 17, 250, 151, 1, 231, 237, 250, 151, 1, 210, 167, 250, 151, 1, 
-    211, 103, 250, 151, 1, 223, 184, 250, 151, 1, 233, 134, 250, 151, 1, 212, 
-    64, 250, 151, 1, 222, 31, 250, 151, 1, 242, 46, 250, 151, 25, 5, 61, 250, 
-    151, 25, 5, 73, 250, 151, 25, 5, 236, 33, 250, 151, 25, 5, 70, 250, 151, 
-    25, 5, 214, 118, 250, 151, 25, 5, 75, 250, 151, 25, 5, 254, 201, 250, 
-    151, 25, 5, 76, 250, 151, 25, 5, 253, 192, 250, 151, 25, 5, 226, 219, 
-    250, 151, 144, 78, 250, 151, 253, 193, 78, 250, 151, 213, 152, 250, 151, 
-    231, 235, 250, 151, 21, 210, 86, 250, 151, 21, 110, 250, 151, 21, 105, 
-    250, 151, 21, 158, 250, 151, 21, 161, 250, 151, 21, 189, 250, 151, 21, 
-    194, 250, 151, 21, 198, 250, 151, 21, 195, 250, 151, 21, 200, 250, 151, 
-    221, 173, 78, 250, 151, 248, 178, 250, 151, 52, 248, 178, 250, 151, 224, 
-    13, 78, 174, 5, 250, 255, 174, 5, 254, 75, 174, 5, 213, 147, 174, 1, 61, 
-    174, 1, 255, 73, 174, 1, 73, 174, 1, 236, 33, 174, 1, 70, 174, 1, 214, 
-    118, 174, 1, 149, 153, 174, 1, 149, 222, 180, 174, 1, 149, 156, 174, 1, 
-    149, 232, 185, 174, 1, 75, 174, 1, 254, 201, 174, 1, 76, 174, 1, 253, 
-    192, 174, 1, 176, 174, 1, 234, 132, 174, 1, 243, 135, 174, 1, 242, 249, 
-    174, 1, 229, 77, 174, 1, 251, 33, 174, 1, 250, 157, 174, 1, 235, 141, 
-    174, 1, 235, 114, 174, 1, 227, 165, 174, 1, 215, 156, 174, 1, 215, 144, 
-    174, 1, 248, 135, 174, 1, 248, 119, 174, 1, 228, 110, 174, 1, 217, 105, 
-    174, 1, 216, 208, 174, 1, 248, 221, 174, 1, 248, 25, 174, 1, 197, 174, 1, 
-    190, 174, 1, 225, 147, 174, 1, 252, 191, 174, 1, 252, 18, 174, 1, 184, 
-    174, 1, 191, 174, 1, 205, 174, 1, 233, 135, 174, 1, 232, 184, 174, 1, 
-    214, 27, 174, 1, 220, 102, 174, 1, 218, 223, 174, 1, 206, 174, 1, 162, 
-    174, 25, 5, 255, 73, 174, 25, 5, 73, 174, 25, 5, 236, 33, 174, 25, 5, 70, 
-    174, 25, 5, 214, 118, 174, 25, 5, 149, 153, 174, 25, 5, 149, 222, 180, 
-    174, 25, 5, 149, 156, 174, 25, 5, 149, 232, 185, 174, 25, 5, 75, 174, 25, 
-    5, 254, 201, 174, 25, 5, 76, 174, 25, 5, 253, 192, 174, 5, 213, 152, 174, 
-    5, 253, 175, 174, 5, 235, 102, 174, 5, 214, 161, 174, 226, 204, 174, 248, 
-    178, 174, 52, 248, 178, 174, 255, 21, 50, 174, 220, 137, 174, 21, 210, 
-    86, 174, 21, 110, 174, 21, 105, 174, 21, 158, 174, 21, 161, 174, 21, 189, 
-    174, 21, 194, 174, 21, 198, 174, 21, 195, 174, 21, 200, 217, 69, 1, 61, 
-    217, 69, 1, 255, 73, 217, 69, 1, 73, 217, 69, 1, 236, 33, 217, 69, 1, 70, 
-    217, 69, 1, 214, 118, 217, 69, 1, 75, 217, 69, 1, 254, 201, 217, 69, 1, 
-    76, 217, 69, 1, 253, 192, 217, 69, 1, 176, 217, 69, 1, 234, 132, 217, 69, 
-    1, 243, 135, 217, 69, 1, 242, 249, 217, 69, 1, 229, 77, 217, 69, 1, 251, 
-    33, 217, 69, 1, 250, 157, 217, 69, 1, 235, 141, 217, 69, 1, 235, 114, 
-    217, 69, 1, 227, 165, 217, 69, 1, 215, 156, 217, 69, 1, 215, 144, 217, 
-    69, 1, 248, 135, 217, 69, 1, 248, 119, 217, 69, 1, 228, 110, 217, 69, 1, 
-    217, 105, 217, 69, 1, 216, 208, 217, 69, 1, 248, 221, 217, 69, 1, 248, 
-    25, 217, 69, 1, 197, 217, 69, 1, 190, 217, 69, 1, 225, 147, 217, 69, 1, 
-    252, 191, 217, 69, 1, 252, 18, 217, 69, 1, 184, 217, 69, 1, 191, 217, 69, 
-    1, 205, 217, 69, 1, 233, 135, 217, 69, 1, 214, 27, 217, 69, 1, 220, 102, 
-    217, 69, 1, 206, 217, 69, 1, 162, 217, 69, 1, 222, 179, 217, 69, 5, 254, 
-    75, 217, 69, 5, 213, 147, 217, 69, 25, 5, 255, 73, 217, 69, 25, 5, 73, 
-    217, 69, 25, 5, 236, 33, 217, 69, 25, 5, 70, 217, 69, 25, 5, 214, 118, 
-    217, 69, 25, 5, 75, 217, 69, 25, 5, 254, 201, 217, 69, 25, 5, 76, 217, 
-    69, 25, 5, 253, 192, 217, 69, 5, 213, 152, 217, 69, 5, 227, 205, 217, 69, 
-    21, 210, 86, 217, 69, 21, 110, 217, 69, 21, 105, 217, 69, 21, 158, 217, 
-    69, 21, 161, 217, 69, 21, 189, 217, 69, 21, 194, 217, 69, 21, 198, 217, 
-    69, 21, 195, 217, 69, 21, 200, 15, 5, 61, 15, 5, 115, 30, 61, 15, 5, 115, 
-    30, 252, 176, 15, 5, 115, 30, 243, 105, 216, 239, 15, 5, 115, 30, 162, 
-    15, 5, 115, 30, 236, 35, 15, 5, 115, 30, 233, 116, 242, 94, 15, 5, 115, 
-    30, 230, 61, 15, 5, 115, 30, 222, 21, 15, 5, 255, 75, 15, 5, 255, 25, 15, 
-    5, 255, 26, 30, 253, 229, 15, 5, 255, 26, 30, 246, 67, 242, 94, 15, 5, 
-    255, 26, 30, 243, 118, 15, 5, 255, 26, 30, 243, 105, 216, 239, 15, 5, 
-    255, 26, 30, 162, 15, 5, 255, 26, 30, 236, 36, 242, 94, 15, 5, 255, 26, 
-    30, 236, 9, 15, 5, 255, 26, 30, 233, 117, 15, 5, 255, 26, 30, 220, 48, 
-    15, 5, 255, 26, 30, 104, 96, 104, 96, 70, 15, 5, 255, 26, 242, 94, 15, 5, 
-    255, 23, 15, 5, 255, 24, 30, 252, 160, 15, 5, 255, 24, 30, 243, 105, 216, 
-    239, 15, 5, 255, 24, 30, 231, 92, 96, 245, 150, 15, 5, 255, 24, 30, 220, 
-    100, 15, 5, 255, 24, 30, 217, 72, 15, 5, 254, 255, 15, 5, 254, 186, 15, 
-    5, 254, 187, 30, 245, 87, 15, 5, 254, 187, 30, 220, 10, 96, 242, 190, 15, 
-    5, 254, 178, 15, 5, 254, 179, 30, 254, 178, 15, 5, 254, 179, 30, 247, 
-    216, 15, 5, 254, 179, 30, 242, 190, 15, 5, 254, 179, 30, 162, 15, 5, 254, 
-    179, 30, 234, 255, 15, 5, 254, 179, 30, 234, 92, 15, 5, 254, 179, 30, 
-    220, 63, 15, 5, 254, 179, 30, 214, 126, 15, 5, 254, 175, 15, 5, 254, 168, 
-    15, 5, 254, 132, 15, 5, 254, 133, 30, 220, 63, 15, 5, 254, 123, 15, 5, 
-    254, 124, 117, 254, 123, 15, 5, 254, 124, 134, 216, 85, 15, 5, 254, 124, 
-    96, 229, 217, 226, 164, 254, 124, 96, 229, 216, 15, 5, 254, 124, 96, 229, 
-    217, 218, 233, 15, 5, 254, 94, 15, 5, 254, 67, 15, 5, 254, 35, 15, 5, 
-    254, 36, 30, 233, 196, 15, 5, 254, 8, 15, 5, 253, 236, 15, 5, 253, 231, 
-    15, 5, 253, 232, 210, 40, 216, 239, 15, 5, 253, 232, 235, 3, 216, 239, 
-    15, 5, 253, 232, 117, 253, 232, 215, 114, 117, 215, 114, 215, 114, 117, 
-    215, 114, 226, 21, 15, 5, 253, 232, 117, 253, 232, 117, 253, 231, 15, 5, 
-    253, 232, 117, 253, 232, 117, 253, 232, 249, 125, 253, 232, 117, 253, 
-    232, 117, 253, 231, 15, 5, 253, 229, 15, 5, 253, 226, 15, 5, 252, 191, 
-    15, 5, 252, 176, 15, 5, 252, 171, 15, 5, 252, 167, 15, 5, 252, 161, 15, 
-    5, 252, 162, 117, 252, 161, 15, 5, 252, 160, 15, 5, 130, 15, 5, 252, 140, 
-    15, 5, 252, 6, 15, 5, 252, 7, 30, 61, 15, 5, 252, 7, 30, 243, 96, 15, 5, 
-    252, 7, 30, 236, 36, 242, 94, 15, 5, 251, 125, 15, 5, 251, 126, 117, 251, 
-    126, 255, 25, 15, 5, 251, 126, 117, 251, 126, 214, 190, 15, 5, 251, 126, 
-    249, 125, 251, 125, 15, 5, 251, 109, 15, 5, 251, 110, 117, 251, 109, 15, 
-    5, 251, 98, 15, 5, 251, 97, 15, 5, 248, 221, 15, 5, 248, 212, 15, 5, 248, 
-    213, 234, 66, 30, 115, 96, 231, 147, 15, 5, 248, 213, 234, 66, 30, 254, 
-    132, 15, 5, 248, 213, 234, 66, 30, 252, 160, 15, 5, 248, 213, 234, 66, 
-    30, 252, 6, 15, 5, 248, 213, 234, 66, 30, 243, 135, 15, 5, 248, 213, 234, 
-    66, 30, 243, 136, 96, 231, 147, 15, 5, 248, 213, 234, 66, 30, 242, 214, 
-    15, 5, 248, 213, 234, 66, 30, 242, 197, 15, 5, 248, 213, 234, 66, 30, 
-    242, 103, 15, 5, 248, 213, 234, 66, 30, 162, 15, 5, 248, 213, 234, 66, 
-    30, 235, 179, 15, 5, 248, 213, 234, 66, 30, 235, 180, 96, 232, 98, 15, 5, 
-    248, 213, 234, 66, 30, 234, 242, 15, 5, 248, 213, 234, 66, 30, 233, 135, 
-    15, 5, 248, 213, 234, 66, 30, 232, 98, 15, 5, 248, 213, 234, 66, 30, 232, 
-    99, 96, 231, 146, 15, 5, 248, 213, 234, 66, 30, 232, 84, 15, 5, 248, 213, 
-    234, 66, 30, 229, 107, 15, 5, 248, 213, 234, 66, 30, 226, 22, 96, 226, 
-    21, 15, 5, 248, 213, 234, 66, 30, 219, 191, 15, 5, 248, 213, 234, 66, 30, 
-    217, 72, 15, 5, 248, 213, 234, 66, 30, 214, 231, 96, 242, 197, 15, 5, 
-    248, 213, 234, 66, 30, 214, 126, 15, 5, 248, 187, 15, 5, 248, 166, 15, 5, 
-    248, 165, 15, 5, 248, 164, 15, 5, 248, 3, 15, 5, 247, 242, 15, 5, 247, 
-    217, 15, 5, 247, 218, 30, 220, 63, 15, 5, 247, 216, 15, 5, 247, 206, 15, 
-    5, 247, 207, 234, 208, 104, 242, 95, 247, 187, 15, 5, 247, 187, 15, 5, 
-    246, 78, 15, 5, 246, 79, 117, 246, 78, 15, 5, 246, 79, 242, 94, 15, 5, 
-    246, 79, 220, 45, 15, 5, 246, 76, 15, 5, 246, 77, 30, 245, 72, 15, 5, 
-    246, 75, 15, 5, 246, 74, 15, 5, 246, 73, 15, 5, 246, 72, 15, 5, 246, 68, 
-    15, 5, 246, 66, 15, 5, 246, 67, 242, 94, 15, 5, 246, 67, 242, 95, 242, 
-    94, 15, 5, 246, 65, 15, 5, 246, 58, 15, 5, 75, 15, 5, 160, 30, 226, 21, 
-    15, 5, 160, 117, 160, 227, 195, 117, 227, 194, 15, 5, 245, 234, 15, 5, 
-    245, 235, 30, 115, 96, 242, 49, 96, 248, 221, 15, 5, 245, 235, 30, 243, 
-    96, 15, 5, 245, 235, 30, 230, 230, 15, 5, 245, 235, 30, 222, 8, 15, 5, 
-    245, 235, 30, 220, 63, 15, 5, 245, 235, 30, 70, 15, 5, 245, 211, 15, 5, 
-    245, 200, 15, 5, 245, 174, 15, 5, 245, 150, 15, 5, 245, 151, 30, 243, 
-    104, 15, 5, 245, 151, 30, 243, 105, 216, 239, 15, 5, 245, 151, 30, 231, 
-    91, 15, 5, 245, 151, 249, 125, 245, 150, 15, 5, 245, 151, 226, 164, 245, 
-    150, 15, 5, 245, 151, 218, 233, 15, 5, 245, 89, 15, 5, 245, 87, 15, 5, 
-    245, 72, 15, 5, 245, 10, 15, 5, 245, 11, 30, 61, 15, 5, 245, 11, 30, 115, 
-    96, 233, 104, 15, 5, 245, 11, 30, 115, 96, 233, 105, 30, 233, 104, 15, 5, 
-    245, 11, 30, 254, 123, 15, 5, 245, 11, 30, 252, 176, 15, 5, 245, 11, 30, 
-    246, 67, 242, 94, 15, 5, 245, 11, 30, 246, 67, 242, 95, 242, 94, 15, 5, 
-    245, 11, 30, 162, 15, 5, 245, 11, 30, 242, 49, 242, 94, 15, 5, 245, 11, 
-    30, 236, 36, 242, 94, 15, 5, 245, 11, 30, 234, 207, 15, 5, 245, 11, 30, 
-    234, 208, 218, 233, 15, 5, 245, 11, 30, 233, 215, 15, 5, 245, 11, 30, 
-    233, 135, 15, 5, 245, 11, 30, 233, 105, 30, 233, 104, 15, 5, 245, 11, 30, 
-    232, 241, 15, 5, 245, 11, 30, 232, 98, 15, 5, 245, 11, 30, 214, 230, 15, 
-    5, 245, 11, 30, 214, 219, 15, 5, 243, 135, 15, 5, 243, 136, 242, 94, 15, 
-    5, 243, 133, 15, 5, 243, 134, 30, 115, 96, 248, 222, 96, 162, 15, 5, 243, 
-    134, 30, 115, 96, 162, 15, 5, 243, 134, 30, 115, 96, 236, 35, 15, 5, 243, 
-    134, 30, 255, 24, 216, 240, 96, 217, 93, 15, 5, 243, 134, 30, 254, 123, 
-    15, 5, 243, 134, 30, 253, 231, 15, 5, 243, 134, 30, 253, 230, 96, 243, 
-    118, 15, 5, 243, 134, 30, 252, 176, 15, 5, 243, 134, 30, 252, 141, 96, 
-    205, 15, 5, 243, 134, 30, 251, 98, 15, 5, 243, 134, 30, 251, 99, 96, 205, 
-    15, 5, 243, 134, 30, 248, 221, 15, 5, 243, 134, 30, 248, 3, 15, 5, 243, 
-    134, 30, 247, 218, 30, 220, 63, 15, 5, 243, 134, 30, 246, 76, 15, 5, 243, 
-    134, 30, 245, 174, 15, 5, 243, 134, 30, 245, 175, 96, 233, 135, 15, 5, 
-    243, 134, 30, 245, 150, 15, 5, 243, 134, 30, 245, 151, 30, 243, 105, 216, 
-    239, 15, 5, 243, 134, 30, 243, 105, 216, 239, 15, 5, 243, 134, 30, 243, 
-    96, 15, 5, 243, 134, 30, 242, 214, 15, 5, 243, 134, 30, 242, 212, 15, 5, 
-    243, 134, 30, 242, 213, 96, 61, 15, 5, 243, 134, 30, 242, 198, 96, 218, 
-    83, 15, 5, 243, 134, 30, 242, 49, 96, 232, 99, 96, 245, 72, 15, 5, 243, 
-    134, 30, 242, 30, 15, 5, 243, 134, 30, 242, 31, 96, 233, 135, 15, 5, 243, 
-    134, 30, 241, 181, 96, 232, 241, 15, 5, 243, 134, 30, 240, 218, 15, 5, 
-    243, 134, 30, 236, 36, 242, 94, 15, 5, 243, 134, 30, 235, 166, 96, 240, 
-    223, 96, 253, 231, 15, 5, 243, 134, 30, 234, 242, 15, 5, 243, 134, 30, 
-    234, 207, 15, 5, 243, 134, 30, 234, 89, 15, 5, 243, 134, 30, 234, 90, 96, 
-    233, 104, 15, 5, 243, 134, 30, 233, 216, 96, 254, 123, 15, 5, 243, 134, 
-    30, 233, 135, 15, 5, 243, 134, 30, 231, 92, 96, 245, 150, 15, 5, 243, 
-    134, 30, 230, 230, 15, 5, 243, 134, 30, 227, 194, 15, 5, 243, 134, 30, 
-    227, 195, 117, 227, 194, 15, 5, 243, 134, 30, 190, 15, 5, 243, 134, 30, 
-    222, 8, 15, 5, 243, 134, 30, 221, 231, 15, 5, 243, 134, 30, 220, 63, 15, 
-    5, 243, 134, 30, 220, 64, 96, 215, 98, 15, 5, 243, 134, 30, 220, 30, 15, 
-    5, 243, 134, 30, 218, 43, 15, 5, 243, 134, 30, 217, 72, 15, 5, 243, 134, 
-    30, 70, 15, 5, 243, 134, 30, 214, 219, 15, 5, 243, 134, 30, 214, 220, 96, 
-    246, 78, 15, 5, 243, 134, 117, 243, 133, 15, 5, 243, 128, 15, 5, 243, 
-    129, 249, 125, 243, 128, 15, 5, 243, 126, 15, 5, 243, 127, 117, 243, 127, 
-    243, 97, 117, 243, 96, 15, 5, 243, 118, 15, 5, 243, 119, 243, 127, 117, 
-    243, 127, 243, 97, 117, 243, 96, 15, 5, 243, 117, 15, 5, 243, 115, 15, 5, 
-    243, 106, 15, 5, 243, 104, 15, 5, 243, 105, 216, 239, 15, 5, 243, 105, 
-    117, 243, 104, 15, 5, 243, 105, 249, 125, 243, 104, 15, 5, 243, 96, 15, 
-    5, 243, 95, 15, 5, 243, 90, 15, 5, 243, 36, 15, 5, 243, 37, 30, 233, 196, 
-    15, 5, 242, 214, 15, 5, 242, 215, 30, 75, 15, 5, 242, 215, 30, 70, 15, 5, 
-    242, 215, 249, 125, 242, 214, 15, 5, 242, 212, 15, 5, 242, 213, 117, 242, 
-    212, 15, 5, 242, 213, 249, 125, 242, 212, 15, 5, 242, 209, 15, 5, 242, 
-    197, 15, 5, 242, 198, 242, 94, 15, 5, 242, 195, 15, 5, 242, 196, 30, 115, 
-    96, 236, 35, 15, 5, 242, 196, 30, 243, 105, 216, 239, 15, 5, 242, 196, 
-    30, 236, 35, 15, 5, 242, 196, 30, 232, 99, 96, 236, 35, 15, 5, 242, 196, 
-    30, 190, 15, 5, 242, 192, 15, 5, 242, 190, 15, 5, 242, 191, 249, 125, 
-    242, 190, 15, 5, 242, 191, 30, 252, 176, 15, 5, 242, 191, 30, 217, 72, 
-    15, 5, 242, 191, 216, 239, 15, 5, 242, 113, 15, 5, 242, 114, 249, 125, 
-    242, 113, 15, 5, 242, 111, 15, 5, 242, 112, 30, 234, 242, 15, 5, 242, 
-    112, 30, 234, 243, 30, 236, 36, 242, 94, 15, 5, 242, 112, 30, 227, 194, 
-    15, 5, 242, 112, 30, 222, 9, 96, 215, 113, 15, 5, 242, 112, 242, 94, 15, 
-    5, 242, 103, 15, 5, 242, 104, 30, 115, 96, 233, 196, 15, 5, 242, 104, 30, 
-    233, 196, 15, 5, 242, 104, 117, 242, 104, 232, 91, 15, 5, 242, 98, 15, 5, 
-    242, 96, 15, 5, 242, 97, 30, 220, 63, 15, 5, 242, 88, 15, 5, 242, 87, 15, 
-    5, 242, 84, 15, 5, 242, 83, 15, 5, 162, 15, 5, 242, 49, 216, 239, 15, 5, 
-    242, 49, 242, 94, 15, 5, 242, 30, 15, 5, 241, 180, 15, 5, 241, 181, 30, 
-    253, 231, 15, 5, 241, 181, 30, 253, 229, 15, 5, 241, 181, 30, 252, 176, 
-    15, 5, 241, 181, 30, 247, 187, 15, 5, 241, 181, 30, 243, 126, 15, 5, 241, 
-    181, 30, 234, 81, 15, 5, 241, 181, 30, 227, 194, 15, 5, 241, 181, 30, 
-    220, 63, 15, 5, 241, 181, 30, 70, 15, 5, 240, 222, 15, 5, 240, 218, 15, 
-    5, 240, 219, 30, 254, 123, 15, 5, 240, 219, 30, 242, 30, 15, 5, 240, 219, 
-    30, 234, 207, 15, 5, 240, 219, 30, 232, 197, 15, 5, 240, 219, 30, 214, 
-    219, 15, 5, 240, 215, 15, 5, 73, 15, 5, 240, 154, 61, 15, 5, 240, 115, 
-    15, 5, 236, 63, 15, 5, 236, 64, 117, 236, 64, 251, 98, 15, 5, 236, 64, 
-    117, 236, 64, 218, 233, 15, 5, 236, 38, 15, 5, 236, 35, 15, 5, 236, 36, 
-    247, 242, 15, 5, 236, 36, 223, 35, 15, 5, 236, 36, 117, 236, 36, 220, 14, 
-    117, 220, 14, 214, 220, 117, 214, 219, 15, 5, 236, 36, 242, 94, 15, 5, 
-    236, 27, 15, 5, 236, 28, 30, 243, 105, 216, 239, 15, 5, 236, 26, 15, 5, 
-    236, 16, 15, 5, 236, 17, 30, 217, 72, 15, 5, 236, 17, 249, 125, 236, 16, 
-    15, 5, 236, 17, 226, 164, 236, 16, 15, 5, 236, 17, 218, 233, 15, 5, 236, 
-    9, 15, 5, 235, 255, 15, 5, 235, 179, 15, 5, 235, 165, 15, 5, 176, 15, 5, 
-    235, 13, 30, 61, 15, 5, 235, 13, 30, 254, 255, 15, 5, 235, 13, 30, 255, 
-    0, 96, 233, 215, 15, 5, 235, 13, 30, 253, 229, 15, 5, 235, 13, 30, 252, 
-    176, 15, 5, 235, 13, 30, 252, 160, 15, 5, 235, 13, 30, 130, 15, 5, 235, 
-    13, 30, 252, 6, 15, 5, 235, 13, 30, 245, 87, 15, 5, 235, 13, 30, 245, 72, 
-    15, 5, 235, 13, 30, 243, 135, 15, 5, 235, 13, 30, 243, 118, 15, 5, 235, 
-    13, 30, 243, 105, 216, 239, 15, 5, 235, 13, 30, 243, 96, 15, 5, 235, 13, 
-    30, 243, 97, 96, 220, 101, 96, 61, 15, 5, 235, 13, 30, 242, 214, 15, 5, 
-    235, 13, 30, 242, 197, 15, 5, 235, 13, 30, 242, 191, 96, 221, 231, 15, 5, 
-    235, 13, 30, 242, 191, 249, 125, 242, 190, 15, 5, 235, 13, 30, 242, 113, 
-    15, 5, 235, 13, 30, 242, 87, 15, 5, 235, 13, 30, 236, 35, 15, 5, 235, 13, 
-    30, 236, 16, 15, 5, 235, 13, 30, 234, 242, 15, 5, 235, 13, 30, 234, 92, 
-    15, 5, 235, 13, 30, 234, 89, 15, 5, 235, 13, 30, 232, 241, 15, 5, 235, 
-    13, 30, 232, 98, 15, 5, 235, 13, 30, 231, 91, 15, 5, 235, 13, 30, 231, 
-    92, 96, 246, 78, 15, 5, 235, 13, 30, 231, 92, 96, 242, 214, 15, 5, 235, 
-    13, 30, 231, 92, 96, 217, 22, 15, 5, 235, 13, 30, 230, 230, 15, 5, 235, 
-    13, 30, 230, 231, 96, 227, 189, 15, 5, 235, 13, 30, 229, 107, 15, 5, 235, 
-    13, 30, 227, 194, 15, 5, 235, 13, 30, 225, 108, 15, 5, 235, 13, 30, 222, 
-    140, 15, 5, 235, 13, 30, 206, 15, 5, 235, 13, 30, 221, 231, 15, 5, 235, 
-    13, 30, 220, 102, 15, 5, 235, 13, 30, 220, 63, 15, 5, 235, 13, 30, 220, 
-    30, 15, 5, 235, 13, 30, 219, 225, 15, 5, 235, 13, 30, 219, 182, 15, 5, 
-    235, 13, 30, 218, 51, 15, 5, 235, 13, 30, 217, 50, 15, 5, 235, 13, 30, 
-    70, 15, 5, 235, 13, 30, 214, 230, 15, 5, 235, 13, 30, 214, 219, 15, 5, 
-    235, 13, 30, 214, 193, 30, 190, 15, 5, 235, 13, 30, 214, 126, 15, 5, 235, 
-    13, 30, 210, 44, 15, 5, 235, 11, 15, 5, 235, 12, 249, 125, 235, 11, 15, 
-    5, 235, 4, 15, 5, 235, 1, 15, 5, 234, 255, 15, 5, 234, 254, 15, 5, 234, 
-    252, 15, 5, 234, 253, 117, 234, 252, 15, 5, 234, 242, 15, 5, 234, 243, 
-    30, 236, 36, 242, 94, 15, 5, 234, 238, 15, 5, 234, 239, 30, 252, 176, 15, 
-    5, 234, 239, 249, 125, 234, 238, 15, 5, 234, 236, 15, 5, 234, 235, 15, 5, 
-    234, 207, 15, 5, 234, 208, 233, 118, 30, 104, 117, 233, 118, 30, 70, 15, 
-    5, 234, 208, 117, 234, 208, 233, 118, 30, 104, 117, 233, 118, 30, 70, 15, 
-    5, 234, 157, 15, 5, 234, 92, 15, 5, 234, 93, 30, 252, 176, 15, 5, 234, 
-    93, 30, 70, 15, 5, 234, 93, 30, 214, 219, 15, 5, 234, 89, 15, 5, 234, 81, 
-    15, 5, 234, 68, 15, 5, 234, 67, 15, 5, 234, 65, 15, 5, 234, 66, 117, 234, 
-    65, 15, 5, 233, 217, 15, 5, 233, 218, 117, 241, 181, 30, 253, 230, 233, 
-    218, 117, 241, 181, 30, 253, 229, 15, 5, 233, 215, 15, 5, 233, 213, 15, 
-    5, 233, 214, 214, 12, 17, 15, 5, 233, 212, 15, 5, 233, 209, 15, 5, 233, 
-    210, 242, 94, 15, 5, 233, 208, 15, 5, 233, 196, 15, 5, 233, 197, 226, 
-    164, 233, 196, 15, 5, 233, 191, 15, 5, 233, 172, 15, 5, 233, 135, 15, 5, 
-    233, 117, 15, 5, 233, 118, 30, 61, 15, 5, 233, 118, 30, 115, 96, 248, 
-    222, 96, 162, 15, 5, 233, 118, 30, 115, 96, 243, 96, 15, 5, 233, 118, 30, 
-    115, 96, 233, 104, 15, 5, 233, 118, 30, 254, 178, 15, 5, 233, 118, 30, 
-    254, 123, 15, 5, 233, 118, 30, 253, 232, 210, 40, 216, 239, 15, 5, 233, 
-    118, 30, 252, 176, 15, 5, 233, 118, 30, 252, 6, 15, 5, 233, 118, 30, 248, 
-    166, 15, 5, 233, 118, 30, 245, 150, 15, 5, 233, 118, 30, 243, 135, 15, 5, 
-    233, 118, 30, 243, 96, 15, 5, 233, 118, 30, 242, 103, 15, 5, 233, 118, 
-    30, 242, 104, 96, 242, 103, 15, 5, 233, 118, 30, 162, 15, 5, 233, 118, 
-    30, 242, 30, 15, 5, 233, 118, 30, 241, 181, 30, 227, 194, 15, 5, 233, 
-    118, 30, 236, 36, 242, 94, 15, 5, 233, 118, 30, 236, 16, 15, 5, 233, 118, 
-    30, 236, 17, 96, 162, 15, 5, 233, 118, 30, 236, 17, 96, 232, 98, 15, 5, 
-    233, 118, 30, 234, 92, 15, 5, 233, 118, 30, 234, 81, 15, 5, 233, 118, 30, 
-    233, 215, 15, 5, 233, 118, 30, 233, 209, 15, 5, 233, 118, 30, 233, 210, 
-    96, 241, 181, 96, 61, 15, 5, 233, 118, 30, 233, 117, 15, 5, 233, 118, 30, 
-    232, 197, 15, 5, 233, 118, 30, 232, 98, 15, 5, 233, 118, 30, 232, 86, 15, 
-    5, 233, 118, 30, 231, 91, 15, 5, 233, 118, 30, 231, 92, 96, 245, 150, 15, 
-    5, 233, 118, 30, 230, 61, 15, 5, 233, 118, 30, 229, 107, 15, 5, 233, 118, 
-    30, 220, 64, 96, 218, 43, 15, 5, 233, 118, 30, 220, 10, 96, 242, 191, 96, 
-    245, 87, 15, 5, 233, 118, 30, 220, 10, 96, 242, 191, 216, 239, 15, 5, 
-    233, 118, 30, 219, 223, 15, 5, 233, 118, 30, 219, 224, 96, 219, 223, 15, 
-    5, 233, 118, 30, 218, 43, 15, 5, 233, 118, 30, 217, 84, 15, 5, 233, 118, 
-    30, 217, 72, 15, 5, 233, 118, 30, 217, 23, 96, 115, 96, 218, 84, 96, 197, 
-    15, 5, 233, 118, 30, 70, 15, 5, 233, 118, 30, 104, 96, 61, 15, 5, 233, 
-    118, 30, 104, 96, 104, 96, 70, 15, 5, 233, 118, 30, 214, 231, 96, 253, 
-    231, 15, 5, 233, 118, 30, 214, 219, 15, 5, 233, 118, 30, 214, 126, 15, 5, 
-    233, 118, 218, 233, 15, 5, 233, 115, 15, 5, 233, 116, 30, 220, 63, 15, 5, 
-    233, 116, 30, 220, 64, 96, 218, 43, 15, 5, 233, 116, 242, 94, 15, 5, 233, 
-    116, 242, 95, 117, 233, 116, 242, 95, 220, 63, 15, 5, 233, 111, 15, 5, 
-    233, 104, 15, 5, 233, 105, 30, 233, 104, 15, 5, 233, 102, 15, 5, 233, 
-    103, 30, 233, 196, 15, 5, 233, 103, 30, 233, 197, 96, 222, 140, 15, 5, 
-    232, 241, 15, 5, 232, 226, 15, 5, 232, 216, 15, 5, 232, 197, 15, 5, 232, 
-    98, 15, 5, 232, 99, 30, 252, 176, 15, 5, 232, 96, 15, 5, 232, 97, 30, 
-    254, 178, 15, 5, 232, 97, 30, 252, 176, 15, 5, 232, 97, 30, 245, 72, 15, 
-    5, 232, 97, 30, 245, 73, 216, 239, 15, 5, 232, 97, 30, 243, 105, 216, 
-    239, 15, 5, 232, 97, 30, 241, 181, 30, 252, 176, 15, 5, 232, 97, 30, 236, 
-    16, 15, 5, 232, 97, 30, 235, 1, 15, 5, 232, 97, 30, 234, 255, 15, 5, 232, 
-    97, 30, 235, 0, 96, 253, 231, 15, 5, 232, 97, 30, 234, 92, 15, 5, 232, 
-    97, 30, 233, 136, 96, 253, 231, 15, 5, 232, 97, 30, 233, 117, 15, 5, 232, 
-    97, 30, 231, 92, 96, 245, 150, 15, 5, 232, 97, 30, 229, 107, 15, 5, 232, 
-    97, 30, 227, 237, 15, 5, 232, 97, 30, 219, 192, 96, 253, 231, 15, 5, 232, 
-    97, 30, 219, 174, 96, 251, 125, 15, 5, 232, 97, 30, 215, 113, 15, 5, 232, 
-    97, 216, 239, 15, 5, 232, 97, 249, 125, 232, 96, 15, 5, 232, 97, 226, 
-    164, 232, 96, 15, 5, 232, 97, 218, 233, 15, 5, 232, 97, 220, 45, 15, 5, 
-    232, 95, 15, 5, 232, 91, 15, 5, 232, 92, 117, 232, 91, 15, 5, 232, 92, 
-    226, 164, 232, 91, 15, 5, 232, 92, 220, 45, 15, 5, 232, 89, 15, 5, 232, 
-    86, 15, 5, 232, 84, 15, 5, 232, 85, 117, 232, 84, 15, 5, 232, 85, 117, 
-    232, 85, 243, 97, 117, 243, 96, 15, 5, 184, 15, 5, 231, 239, 30, 217, 72, 
-    15, 5, 231, 239, 242, 94, 15, 5, 231, 238, 15, 5, 231, 210, 15, 5, 231, 
-    166, 15, 5, 231, 147, 15, 5, 231, 146, 15, 5, 231, 91, 15, 5, 231, 47, 
-    15, 5, 230, 230, 15, 5, 230, 188, 15, 5, 230, 102, 15, 5, 230, 103, 117, 
-    230, 102, 15, 5, 230, 93, 15, 5, 230, 94, 242, 94, 15, 5, 230, 78, 15, 5, 
-    230, 64, 15, 5, 230, 61, 15, 5, 230, 62, 30, 61, 15, 5, 230, 62, 30, 233, 
-    196, 15, 5, 230, 62, 30, 210, 116, 15, 5, 230, 62, 117, 230, 61, 15, 5, 
-    230, 62, 117, 230, 62, 30, 115, 96, 197, 15, 5, 230, 62, 249, 125, 230, 
-    61, 15, 5, 230, 59, 15, 5, 230, 60, 30, 61, 15, 5, 230, 60, 30, 115, 96, 
-    248, 3, 15, 5, 230, 60, 30, 248, 3, 15, 5, 230, 60, 242, 94, 15, 5, 197, 
-    15, 5, 229, 227, 15, 5, 229, 216, 15, 5, 229, 217, 235, 192, 15, 5, 229, 
-    217, 30, 219, 226, 216, 239, 15, 5, 229, 217, 226, 164, 229, 216, 15, 5, 
-    229, 215, 15, 5, 229, 208, 227, 180, 15, 5, 229, 207, 15, 5, 229, 206, 
-    15, 5, 229, 107, 15, 5, 229, 108, 30, 61, 15, 5, 229, 108, 30, 214, 219, 
-    15, 5, 229, 108, 220, 45, 15, 5, 228, 233, 15, 5, 228, 234, 30, 75, 15, 
-    5, 228, 232, 15, 5, 228, 203, 15, 5, 228, 204, 30, 243, 105, 216, 239, 
-    15, 5, 228, 204, 30, 243, 97, 96, 243, 105, 216, 239, 15, 5, 228, 201, 
-    15, 5, 228, 202, 30, 254, 123, 15, 5, 228, 202, 30, 253, 231, 15, 5, 228, 
-    202, 30, 253, 232, 96, 253, 231, 15, 5, 228, 202, 30, 242, 103, 15, 5, 
-    228, 202, 30, 231, 92, 96, 243, 105, 216, 239, 15, 5, 228, 202, 30, 229, 
-    107, 15, 5, 228, 202, 30, 227, 194, 15, 5, 228, 202, 30, 220, 63, 15, 5, 
-    228, 202, 30, 220, 64, 96, 115, 254, 123, 15, 5, 228, 202, 30, 220, 64, 
-    96, 253, 231, 15, 5, 228, 202, 30, 220, 64, 96, 253, 232, 96, 253, 231, 
-    15, 5, 228, 202, 30, 214, 231, 96, 253, 231, 15, 5, 228, 202, 30, 214, 
-    126, 15, 5, 228, 190, 15, 5, 227, 237, 15, 5, 227, 210, 15, 5, 227, 194, 
-    15, 5, 227, 195, 233, 116, 30, 243, 96, 15, 5, 227, 195, 233, 116, 30, 
-    231, 147, 15, 5, 227, 195, 233, 116, 30, 222, 8, 15, 5, 227, 195, 233, 
-    116, 30, 222, 9, 117, 227, 195, 233, 116, 30, 222, 8, 15, 5, 227, 195, 
-    233, 116, 30, 214, 126, 15, 5, 227, 195, 216, 239, 15, 5, 227, 195, 117, 
-    227, 194, 15, 5, 227, 195, 249, 125, 227, 194, 15, 5, 227, 195, 249, 125, 
-    227, 195, 233, 116, 117, 233, 115, 15, 5, 227, 189, 15, 5, 227, 190, 255, 
-    24, 30, 253, 226, 15, 5, 227, 190, 255, 24, 30, 252, 6, 15, 5, 227, 190, 
-    255, 24, 30, 246, 74, 15, 5, 227, 190, 255, 24, 30, 242, 103, 15, 5, 227, 
-    190, 255, 24, 30, 236, 36, 242, 94, 15, 5, 227, 190, 255, 24, 30, 234, 
-    255, 15, 5, 227, 190, 255, 24, 30, 233, 135, 15, 5, 227, 190, 255, 24, 
-    30, 229, 107, 15, 5, 227, 190, 255, 24, 30, 219, 171, 15, 5, 227, 190, 
-    255, 24, 30, 214, 230, 15, 5, 227, 190, 234, 66, 30, 252, 6, 15, 5, 227, 
-    190, 234, 66, 30, 252, 7, 70, 15, 5, 190, 15, 5, 226, 80, 15, 5, 226, 47, 
-    15, 5, 226, 21, 15, 5, 225, 161, 15, 5, 225, 108, 15, 5, 225, 109, 30, 
-    61, 15, 5, 225, 109, 30, 255, 25, 15, 5, 225, 109, 30, 252, 6, 15, 5, 
-    225, 109, 30, 251, 125, 15, 5, 225, 109, 30, 75, 15, 5, 225, 109, 30, 73, 
-    15, 5, 225, 109, 30, 240, 115, 15, 5, 225, 109, 30, 70, 15, 5, 225, 109, 
-    30, 214, 230, 15, 5, 225, 109, 249, 125, 225, 108, 15, 5, 225, 53, 15, 5, 
-    225, 54, 30, 234, 238, 15, 5, 225, 54, 30, 214, 219, 15, 5, 225, 54, 30, 
-    210, 116, 15, 5, 225, 54, 226, 164, 225, 53, 15, 5, 205, 15, 5, 223, 182, 
-    15, 5, 223, 35, 15, 5, 222, 140, 15, 5, 206, 15, 5, 222, 22, 227, 180, 
-    15, 5, 222, 21, 15, 5, 222, 22, 30, 61, 15, 5, 222, 22, 30, 246, 78, 15, 
-    5, 222, 22, 30, 246, 76, 15, 5, 222, 22, 30, 162, 15, 5, 222, 22, 30, 
-    234, 242, 15, 5, 222, 22, 30, 233, 196, 15, 5, 222, 22, 30, 232, 84, 15, 
-    5, 222, 22, 30, 230, 230, 15, 5, 222, 22, 30, 227, 194, 15, 5, 222, 22, 
-    30, 222, 8, 15, 5, 222, 22, 30, 220, 30, 15, 5, 222, 22, 30, 217, 93, 15, 
-    5, 222, 22, 30, 214, 230, 15, 5, 222, 22, 30, 214, 225, 15, 5, 222, 22, 
-    30, 214, 197, 15, 5, 222, 22, 30, 214, 150, 15, 5, 222, 22, 30, 214, 126, 
-    15, 5, 222, 22, 117, 222, 21, 15, 5, 222, 22, 242, 94, 15, 5, 222, 8, 15, 
-    5, 222, 9, 233, 118, 30, 253, 229, 15, 5, 221, 239, 15, 5, 221, 231, 15, 
-    5, 220, 102, 15, 5, 220, 100, 15, 5, 220, 101, 30, 61, 15, 5, 220, 101, 
-    30, 252, 176, 15, 5, 220, 101, 30, 242, 190, 15, 5, 220, 101, 30, 229, 
-    107, 15, 5, 220, 101, 30, 219, 223, 15, 5, 220, 101, 30, 215, 98, 15, 5, 
-    220, 101, 30, 70, 15, 5, 220, 101, 30, 104, 96, 61, 15, 5, 220, 99, 15, 
-    5, 220, 97, 15, 5, 220, 78, 15, 5, 220, 63, 15, 5, 220, 64, 240, 222, 15, 
-    5, 220, 64, 117, 220, 64, 243, 127, 117, 243, 127, 243, 97, 117, 243, 96, 
-    15, 5, 220, 64, 117, 220, 64, 217, 94, 117, 217, 94, 243, 97, 117, 243, 
-    96, 15, 5, 220, 56, 15, 5, 220, 51, 15, 5, 220, 48, 15, 5, 220, 47, 15, 
-    5, 220, 44, 15, 5, 220, 30, 15, 5, 220, 31, 30, 61, 15, 5, 220, 31, 30, 
-    236, 16, 15, 5, 220, 24, 15, 5, 220, 25, 30, 61, 15, 5, 220, 25, 30, 252, 
-    161, 15, 5, 220, 25, 30, 251, 109, 15, 5, 220, 25, 30, 247, 206, 15, 5, 
-    220, 25, 30, 243, 96, 15, 5, 220, 25, 30, 236, 35, 15, 5, 220, 25, 30, 
-    236, 36, 242, 94, 15, 5, 220, 25, 30, 233, 191, 15, 5, 220, 25, 30, 232, 
-    86, 15, 5, 220, 25, 30, 230, 93, 15, 5, 220, 25, 30, 222, 8, 15, 5, 220, 
-    18, 15, 5, 220, 13, 15, 5, 220, 14, 216, 239, 15, 5, 220, 14, 117, 220, 
-    14, 251, 99, 117, 251, 98, 15, 5, 220, 9, 15, 5, 219, 225, 15, 5, 219, 
-    226, 117, 235, 193, 219, 225, 15, 5, 219, 223, 15, 5, 219, 222, 15, 5, 
-    219, 191, 15, 5, 219, 192, 242, 94, 15, 5, 219, 182, 15, 5, 219, 180, 15, 
-    5, 219, 181, 117, 219, 181, 219, 223, 15, 5, 219, 173, 15, 5, 219, 171, 
-    15, 5, 218, 83, 15, 5, 218, 84, 117, 218, 83, 15, 5, 218, 54, 15, 5, 218, 
-    53, 15, 5, 218, 51, 15, 5, 218, 43, 15, 5, 218, 42, 15, 5, 218, 17, 15, 
-    5, 218, 16, 15, 5, 217, 105, 15, 5, 217, 106, 253, 216, 15, 5, 217, 106, 
-    30, 241, 180, 15, 5, 217, 106, 30, 230, 230, 15, 5, 217, 106, 242, 94, 
-    15, 5, 217, 93, 15, 5, 217, 94, 117, 217, 94, 228, 234, 117, 228, 234, 
-    247, 188, 117, 247, 187, 15, 5, 217, 94, 218, 233, 15, 5, 217, 84, 15, 5, 
-    129, 30, 252, 6, 15, 5, 129, 30, 242, 103, 15, 5, 129, 30, 220, 63, 15, 
-    5, 129, 30, 219, 225, 15, 5, 129, 30, 215, 113, 15, 5, 129, 30, 214, 219, 
-    15, 5, 217, 72, 15, 5, 217, 50, 15, 5, 217, 22, 15, 5, 217, 23, 242, 94, 
-    15, 5, 216, 117, 15, 5, 216, 118, 216, 239, 15, 5, 216, 90, 15, 5, 216, 
-    72, 15, 5, 216, 73, 30, 217, 72, 15, 5, 216, 73, 117, 216, 72, 15, 5, 
-    216, 73, 117, 216, 73, 243, 127, 117, 243, 127, 243, 97, 117, 243, 96, 
-    15, 5, 215, 118, 15, 5, 215, 113, 15, 5, 215, 111, 15, 5, 215, 108, 15, 
-    5, 215, 98, 15, 5, 215, 99, 117, 215, 99, 210, 117, 117, 210, 116, 15, 5, 
-    70, 15, 5, 104, 242, 103, 15, 5, 104, 104, 70, 15, 5, 104, 117, 104, 226, 
-    90, 117, 226, 90, 243, 97, 117, 243, 96, 15, 5, 104, 117, 104, 218, 18, 
-    117, 218, 17, 15, 5, 104, 117, 104, 104, 223, 49, 117, 104, 223, 48, 15, 
-    5, 214, 230, 15, 5, 214, 225, 15, 5, 214, 219, 15, 5, 214, 220, 233, 191, 
-    15, 5, 214, 220, 30, 252, 176, 15, 5, 214, 220, 30, 230, 230, 15, 5, 214, 
-    220, 30, 104, 96, 104, 96, 70, 15, 5, 214, 220, 30, 104, 96, 104, 96, 
-    104, 242, 94, 15, 5, 214, 220, 242, 94, 15, 5, 214, 220, 220, 45, 15, 5, 
-    214, 220, 220, 46, 30, 252, 176, 15, 5, 214, 215, 15, 5, 214, 197, 15, 5, 
-    214, 198, 30, 233, 117, 15, 5, 214, 198, 30, 231, 92, 96, 248, 221, 15, 
-    5, 214, 198, 30, 220, 100, 15, 5, 214, 198, 30, 70, 15, 5, 214, 196, 15, 
-    5, 214, 192, 15, 5, 214, 193, 30, 234, 207, 15, 5, 214, 193, 30, 190, 15, 
-    5, 214, 190, 15, 5, 214, 191, 242, 94, 15, 5, 214, 150, 15, 5, 214, 151, 
-    249, 125, 214, 150, 15, 5, 214, 151, 220, 45, 15, 5, 214, 148, 15, 5, 
-    214, 149, 30, 115, 96, 162, 15, 5, 214, 149, 30, 115, 96, 197, 15, 5, 
-    214, 149, 30, 254, 178, 15, 5, 214, 149, 30, 162, 15, 5, 214, 149, 30, 
-    227, 194, 15, 5, 214, 149, 30, 214, 230, 15, 5, 214, 149, 30, 214, 231, 
-    96, 253, 231, 15, 5, 214, 149, 30, 214, 231, 96, 252, 6, 15, 5, 214, 147, 
-    15, 5, 214, 144, 15, 5, 214, 143, 15, 5, 214, 139, 15, 5, 214, 140, 30, 
-    61, 15, 5, 214, 140, 30, 253, 226, 15, 5, 214, 140, 30, 130, 15, 5, 214, 
-    140, 30, 246, 68, 15, 5, 214, 140, 30, 243, 135, 15, 5, 214, 140, 30, 
-    243, 118, 15, 5, 214, 140, 30, 243, 105, 216, 239, 15, 5, 214, 140, 30, 
-    243, 96, 15, 5, 214, 140, 30, 242, 113, 15, 5, 214, 140, 30, 162, 15, 5, 
-    214, 140, 30, 236, 35, 15, 5, 214, 140, 30, 236, 16, 15, 5, 214, 140, 30, 
-    235, 165, 15, 5, 214, 140, 30, 234, 92, 15, 5, 214, 140, 30, 232, 84, 15, 
-    5, 214, 140, 30, 230, 188, 15, 5, 214, 140, 30, 190, 15, 5, 214, 140, 30, 
-    220, 63, 15, 5, 214, 140, 30, 219, 180, 15, 5, 214, 140, 30, 215, 118, 
-    15, 5, 214, 140, 30, 104, 96, 242, 103, 15, 5, 214, 140, 30, 214, 219, 
-    15, 5, 214, 140, 30, 214, 137, 15, 5, 214, 137, 15, 5, 214, 138, 30, 70, 
-    15, 5, 214, 126, 15, 5, 214, 127, 30, 61, 15, 5, 214, 127, 30, 233, 217, 
-    15, 5, 214, 127, 30, 233, 196, 15, 5, 214, 127, 30, 217, 72, 15, 5, 214, 
-    122, 15, 5, 214, 125, 15, 5, 214, 123, 15, 5, 214, 119, 15, 5, 214, 108, 
-    15, 5, 214, 109, 30, 234, 207, 15, 5, 214, 107, 15, 5, 210, 116, 15, 5, 
-    210, 117, 216, 239, 15, 5, 210, 117, 92, 30, 233, 196, 15, 5, 210, 113, 
-    15, 5, 210, 106, 15, 5, 210, 93, 15, 5, 210, 44, 15, 5, 210, 45, 117, 
-    210, 44, 15, 5, 210, 43, 15, 5, 210, 41, 15, 5, 210, 42, 235, 3, 216, 
-    239, 15, 5, 210, 36, 15, 5, 210, 28, 15, 5, 210, 13, 15, 5, 210, 11, 15, 
-    5, 210, 12, 30, 61, 15, 5, 210, 10, 15, 5, 210, 9, 15, 132, 5, 113, 253, 
-    231, 15, 132, 5, 134, 253, 231, 15, 132, 5, 244, 11, 253, 231, 15, 132, 
-    5, 244, 81, 253, 231, 15, 132, 5, 219, 125, 253, 231, 15, 132, 5, 220, 
-    122, 253, 231, 15, 132, 5, 245, 193, 253, 231, 15, 132, 5, 228, 200, 253, 
-    231, 15, 132, 5, 134, 247, 187, 15, 132, 5, 244, 11, 247, 187, 15, 132, 
-    5, 244, 81, 247, 187, 15, 132, 5, 219, 125, 247, 187, 15, 132, 5, 220, 
-    122, 247, 187, 15, 132, 5, 245, 193, 247, 187, 15, 132, 5, 228, 200, 247, 
-    187, 15, 132, 5, 244, 11, 70, 15, 132, 5, 244, 81, 70, 15, 132, 5, 219, 
-    125, 70, 15, 132, 5, 220, 122, 70, 15, 132, 5, 245, 193, 70, 15, 132, 5, 
-    228, 200, 70, 15, 132, 5, 123, 243, 38, 15, 132, 5, 113, 243, 38, 15, 
-    132, 5, 134, 243, 38, 15, 132, 5, 244, 11, 243, 38, 15, 132, 5, 244, 81, 
-    243, 38, 15, 132, 5, 219, 125, 243, 38, 15, 132, 5, 220, 122, 243, 38, 
-    15, 132, 5, 245, 193, 243, 38, 15, 132, 5, 228, 200, 243, 38, 15, 132, 5, 
-    123, 243, 35, 15, 132, 5, 113, 243, 35, 15, 132, 5, 134, 243, 35, 15, 
-    132, 5, 244, 11, 243, 35, 15, 132, 5, 244, 81, 243, 35, 15, 132, 5, 113, 
-    220, 78, 15, 132, 5, 134, 220, 78, 15, 132, 5, 134, 220, 79, 214, 12, 17, 
-    15, 132, 5, 244, 11, 220, 78, 15, 132, 5, 244, 81, 220, 78, 15, 132, 5, 
-    219, 125, 220, 78, 15, 132, 5, 220, 122, 220, 78, 15, 132, 5, 245, 193, 
-    220, 78, 15, 132, 5, 228, 200, 220, 78, 15, 132, 5, 123, 220, 73, 15, 
-    132, 5, 113, 220, 73, 15, 132, 5, 134, 220, 73, 15, 132, 5, 134, 220, 74, 
-    214, 12, 17, 15, 132, 5, 244, 11, 220, 73, 15, 132, 5, 244, 81, 220, 73, 
-    15, 132, 5, 220, 79, 30, 243, 119, 96, 247, 187, 15, 132, 5, 220, 79, 30, 
-    243, 119, 96, 230, 188, 15, 132, 5, 123, 251, 95, 15, 132, 5, 113, 251, 
-    95, 15, 132, 5, 134, 251, 95, 15, 132, 5, 134, 251, 96, 214, 12, 17, 15, 
-    132, 5, 244, 11, 251, 95, 15, 132, 5, 244, 81, 251, 95, 15, 132, 5, 134, 
-    214, 12, 244, 20, 245, 74, 15, 132, 5, 134, 214, 12, 244, 20, 245, 71, 
-    15, 132, 5, 244, 11, 214, 12, 244, 20, 232, 217, 15, 132, 5, 244, 11, 
-    214, 12, 244, 20, 232, 215, 15, 132, 5, 244, 11, 214, 12, 244, 20, 232, 
-    218, 61, 15, 132, 5, 244, 11, 214, 12, 244, 20, 232, 218, 253, 158, 15, 
-    132, 5, 219, 125, 214, 12, 244, 20, 253, 228, 15, 132, 5, 220, 122, 214, 
-    12, 244, 20, 236, 8, 15, 132, 5, 220, 122, 214, 12, 244, 20, 236, 10, 61, 
-    15, 132, 5, 220, 122, 214, 12, 244, 20, 236, 10, 253, 158, 15, 132, 5, 
-    245, 193, 214, 12, 244, 20, 214, 121, 15, 132, 5, 245, 193, 214, 12, 244, 
-    20, 214, 120, 15, 132, 5, 228, 200, 214, 12, 244, 20, 236, 24, 15, 132, 
-    5, 228, 200, 214, 12, 244, 20, 236, 23, 15, 132, 5, 228, 200, 214, 12, 
-    244, 20, 236, 22, 15, 132, 5, 228, 200, 214, 12, 244, 20, 236, 25, 61, 
-    15, 132, 5, 113, 253, 232, 216, 239, 15, 132, 5, 134, 253, 232, 216, 239, 
-    15, 132, 5, 244, 11, 253, 232, 216, 239, 15, 132, 5, 244, 81, 253, 232, 
-    216, 239, 15, 132, 5, 219, 125, 253, 232, 216, 239, 15, 132, 5, 123, 252, 
-    150, 15, 132, 5, 113, 252, 150, 15, 132, 5, 134, 252, 150, 15, 132, 5, 
-    244, 11, 252, 150, 15, 132, 5, 244, 11, 252, 151, 214, 12, 17, 15, 132, 
-    5, 244, 81, 252, 150, 15, 132, 5, 244, 81, 252, 151, 214, 12, 17, 15, 
-    132, 5, 228, 210, 15, 132, 5, 228, 211, 15, 132, 5, 123, 245, 70, 15, 
-    132, 5, 113, 245, 70, 15, 132, 5, 123, 216, 169, 247, 187, 15, 132, 5, 
-    113, 216, 167, 247, 187, 15, 132, 5, 244, 81, 219, 114, 247, 187, 15, 
-    132, 5, 123, 216, 169, 214, 12, 244, 20, 61, 15, 132, 5, 113, 216, 167, 
-    214, 12, 244, 20, 61, 15, 132, 5, 123, 245, 189, 253, 231, 15, 132, 5, 
-    123, 224, 22, 253, 231, 15, 132, 5, 55, 253, 219, 123, 219, 115, 15, 132, 
-    5, 55, 253, 219, 123, 224, 21, 15, 224, 141, 5, 55, 253, 219, 211, 209, 
-    247, 172, 15, 224, 141, 5, 67, 249, 226, 15, 224, 141, 5, 247, 255, 249, 
-    226, 15, 224, 141, 5, 247, 255, 215, 221, 12, 13, 255, 155, 12, 13, 255, 
-    154, 12, 13, 255, 153, 12, 13, 255, 152, 12, 13, 255, 151, 12, 13, 255, 
-    150, 12, 13, 255, 149, 12, 13, 255, 148, 12, 13, 255, 147, 12, 13, 255, 
-    146, 12, 13, 255, 145, 12, 13, 255, 144, 12, 13, 255, 143, 12, 13, 255, 
-    142, 12, 13, 255, 141, 12, 13, 255, 140, 12, 13, 255, 139, 12, 13, 255, 
-    138, 12, 13, 255, 137, 12, 13, 255, 136, 12, 13, 255, 135, 12, 13, 255, 
-    134, 12, 13, 255, 133, 12, 13, 255, 132, 12, 13, 255, 131, 12, 13, 255, 
-    130, 12, 13, 255, 129, 12, 13, 255, 128, 12, 13, 255, 127, 12, 13, 255, 
-    126, 12, 13, 255, 125, 12, 13, 255, 124, 12, 13, 255, 123, 12, 13, 255, 
-    122, 12, 13, 255, 121, 12, 13, 255, 120, 12, 13, 255, 119, 12, 13, 255, 
-    118, 12, 13, 255, 117, 12, 13, 255, 116, 12, 13, 255, 115, 12, 13, 255, 
-    114, 12, 13, 255, 113, 12, 13, 255, 112, 12, 13, 255, 111, 12, 13, 255, 
-    110, 12, 13, 255, 109, 12, 13, 255, 108, 12, 13, 255, 107, 12, 13, 255, 
-    106, 12, 13, 255, 105, 12, 13, 255, 104, 12, 13, 255, 103, 12, 13, 255, 
-    102, 12, 13, 255, 101, 12, 13, 255, 100, 12, 13, 255, 99, 12, 13, 255, 
-    98, 12, 13, 255, 97, 12, 13, 255, 96, 12, 13, 255, 95, 12, 13, 255, 94, 
-    12, 13, 255, 93, 12, 13, 255, 92, 12, 13, 255, 91, 12, 13, 255, 90, 12, 
-    13, 255, 89, 12, 13, 255, 88, 12, 13, 255, 87, 12, 13, 255, 86, 12, 13, 
-    255, 85, 12, 13, 255, 84, 12, 13, 255, 83, 12, 13, 255, 82, 12, 13, 255, 
-    81, 12, 13, 255, 80, 12, 13, 255, 79, 12, 13, 255, 78, 12, 13, 255, 77, 
-    12, 13, 255, 76, 12, 13, 253, 156, 12, 13, 253, 154, 12, 13, 253, 152, 
-    12, 13, 253, 150, 12, 13, 253, 148, 12, 13, 253, 147, 12, 13, 253, 145, 
-    12, 13, 253, 143, 12, 13, 253, 141, 12, 13, 253, 139, 12, 13, 251, 62, 
-    12, 13, 251, 61, 12, 13, 251, 60, 12, 13, 251, 59, 12, 13, 251, 58, 12, 
-    13, 251, 57, 12, 13, 251, 56, 12, 13, 251, 55, 12, 13, 251, 54, 12, 13, 
-    251, 53, 12, 13, 251, 52, 12, 13, 251, 51, 12, 13, 251, 50, 12, 13, 251, 
-    49, 12, 13, 251, 48, 12, 13, 251, 47, 12, 13, 251, 46, 12, 13, 251, 45, 
-    12, 13, 251, 44, 12, 13, 251, 43, 12, 13, 251, 42, 12, 13, 251, 41, 12, 
-    13, 251, 40, 12, 13, 251, 39, 12, 13, 251, 38, 12, 13, 251, 37, 12, 13, 
-    251, 36, 12, 13, 251, 35, 12, 13, 249, 59, 12, 13, 249, 58, 12, 13, 249, 
-    57, 12, 13, 249, 56, 12, 13, 249, 55, 12, 13, 249, 54, 12, 13, 249, 53, 
-    12, 13, 249, 52, 12, 13, 249, 51, 12, 13, 249, 50, 12, 13, 249, 49, 12, 
-    13, 249, 48, 12, 13, 249, 47, 12, 13, 249, 46, 12, 13, 249, 45, 12, 13, 
-    249, 44, 12, 13, 249, 43, 12, 13, 249, 42, 12, 13, 249, 41, 12, 13, 249, 
-    40, 12, 13, 249, 39, 12, 13, 249, 38, 12, 13, 249, 37, 12, 13, 249, 36, 
-    12, 13, 249, 35, 12, 13, 249, 34, 12, 13, 249, 33, 12, 13, 249, 32, 12, 
-    13, 249, 31, 12, 13, 249, 30, 12, 13, 249, 29, 12, 13, 249, 28, 12, 13, 
-    249, 27, 12, 13, 249, 26, 12, 13, 249, 25, 12, 13, 249, 24, 12, 13, 249, 
-    23, 12, 13, 249, 22, 12, 13, 249, 21, 12, 13, 249, 20, 12, 13, 249, 19, 
-    12, 13, 249, 18, 12, 13, 249, 17, 12, 13, 249, 16, 12, 13, 249, 15, 12, 
-    13, 249, 14, 12, 13, 249, 13, 12, 13, 249, 12, 12, 13, 249, 11, 12, 13, 
-    249, 10, 12, 13, 249, 9, 12, 13, 249, 8, 12, 13, 249, 7, 12, 13, 249, 6, 
-    12, 13, 249, 5, 12, 13, 249, 4, 12, 13, 249, 3, 12, 13, 249, 2, 12, 13, 
-    249, 1, 12, 13, 249, 0, 12, 13, 248, 255, 12, 13, 248, 254, 12, 13, 248, 
-    253, 12, 13, 248, 252, 12, 13, 248, 251, 12, 13, 248, 250, 12, 13, 248, 
-    249, 12, 13, 248, 248, 12, 13, 248, 247, 12, 13, 248, 246, 12, 13, 248, 
-    245, 12, 13, 248, 244, 12, 13, 248, 243, 12, 13, 248, 242, 12, 13, 248, 
-    241, 12, 13, 248, 240, 12, 13, 248, 239, 12, 13, 248, 238, 12, 13, 248, 
-    237, 12, 13, 248, 236, 12, 13, 248, 235, 12, 13, 248, 234, 12, 13, 248, 
-    233, 12, 13, 248, 232, 12, 13, 248, 231, 12, 13, 248, 230, 12, 13, 248, 
-    229, 12, 13, 248, 228, 12, 13, 248, 227, 12, 13, 248, 226, 12, 13, 248, 
-    225, 12, 13, 248, 224, 12, 13, 246, 23, 12, 13, 246, 22, 12, 13, 246, 21, 
-    12, 13, 246, 20, 12, 13, 246, 19, 12, 13, 246, 18, 12, 13, 246, 17, 12, 
-    13, 246, 16, 12, 13, 246, 15, 12, 13, 246, 14, 12, 13, 246, 13, 12, 13, 
-    246, 12, 12, 13, 246, 11, 12, 13, 246, 10, 12, 13, 246, 9, 12, 13, 246, 
-    8, 12, 13, 246, 7, 12, 13, 246, 6, 12, 13, 246, 5, 12, 13, 246, 4, 12, 
-    13, 246, 3, 12, 13, 246, 2, 12, 13, 246, 1, 12, 13, 246, 0, 12, 13, 245, 
-    255, 12, 13, 245, 254, 12, 13, 245, 253, 12, 13, 245, 252, 12, 13, 245, 
-    251, 12, 13, 245, 250, 12, 13, 245, 249, 12, 13, 245, 248, 12, 13, 245, 
-    247, 12, 13, 245, 246, 12, 13, 245, 245, 12, 13, 245, 244, 12, 13, 245, 
-    243, 12, 13, 245, 242, 12, 13, 245, 241, 12, 13, 245, 240, 12, 13, 245, 
-    239, 12, 13, 245, 238, 12, 13, 245, 237, 12, 13, 245, 236, 12, 13, 245, 
-    5, 12, 13, 245, 4, 12, 13, 245, 3, 12, 13, 245, 2, 12, 13, 245, 1, 12, 
-    13, 245, 0, 12, 13, 244, 255, 12, 13, 244, 254, 12, 13, 244, 253, 12, 13, 
-    244, 252, 12, 13, 244, 251, 12, 13, 244, 250, 12, 13, 244, 249, 12, 13, 
-    244, 248, 12, 13, 244, 247, 12, 13, 244, 246, 12, 13, 244, 245, 12, 13, 
-    244, 244, 12, 13, 244, 243, 12, 13, 244, 242, 12, 13, 244, 241, 12, 13, 
-    244, 240, 12, 13, 244, 239, 12, 13, 244, 238, 12, 13, 244, 237, 12, 13, 
-    244, 236, 12, 13, 244, 235, 12, 13, 244, 234, 12, 13, 244, 233, 12, 13, 
-    244, 232, 12, 13, 244, 231, 12, 13, 244, 230, 12, 13, 244, 229, 12, 13, 
-    244, 228, 12, 13, 244, 227, 12, 13, 244, 226, 12, 13, 244, 225, 12, 13, 
-    244, 224, 12, 13, 244, 223, 12, 13, 244, 222, 12, 13, 244, 221, 12, 13, 
-    244, 220, 12, 13, 244, 219, 12, 13, 244, 218, 12, 13, 244, 217, 12, 13, 
-    244, 216, 12, 13, 244, 215, 12, 13, 244, 214, 12, 13, 244, 213, 12, 13, 
-    244, 212, 12, 13, 244, 211, 12, 13, 244, 210, 12, 13, 244, 209, 12, 13, 
-    244, 208, 12, 13, 244, 207, 12, 13, 244, 206, 12, 13, 244, 205, 12, 13, 
-    244, 204, 12, 13, 244, 203, 12, 13, 244, 202, 12, 13, 244, 201, 12, 13, 
-    244, 200, 12, 13, 244, 199, 12, 13, 244, 198, 12, 13, 244, 197, 12, 13, 
+    241, 59, 48, 7, 4, 1, 160, 2, 241, 59, 48, 7, 6, 1, 160, 2, 184, 7, 4, 1, 
+    160, 2, 184, 7, 6, 1, 160, 2, 250, 39, 22, 142, 7, 4, 1, 160, 2, 250, 39, 
+    22, 142, 7, 6, 1, 160, 2, 250, 39, 22, 242, 143, 7, 4, 1, 160, 2, 250, 
+    39, 22, 242, 143, 7, 6, 1, 160, 2, 250, 39, 22, 241, 59, 48, 7, 4, 1, 
+    160, 2, 250, 39, 22, 241, 59, 48, 7, 6, 1, 160, 2, 250, 39, 22, 184, 7, 
+    4, 1, 160, 2, 250, 39, 22, 184, 7, 6, 1, 160, 2, 250, 39, 22, 59, 51, 7, 
+    4, 1, 160, 2, 250, 39, 22, 59, 51, 7, 6, 1, 240, 161, 2, 241, 59, 48, 7, 
+    4, 1, 240, 161, 2, 241, 59, 48, 7, 6, 1, 240, 161, 2, 59, 51, 7, 4, 1, 
+    240, 161, 2, 59, 51, 7, 6, 1, 144, 2, 59, 51, 7, 4, 1, 144, 2, 59, 51, 7, 
+    6, 1, 144, 2, 241, 59, 48, 7, 4, 1, 144, 2, 241, 59, 48, 7, 6, 1, 144, 2, 
+    250, 39, 22, 142, 7, 4, 1, 144, 2, 250, 39, 22, 142, 7, 6, 1, 144, 2, 
+    250, 39, 22, 242, 143, 7, 4, 1, 144, 2, 250, 39, 22, 242, 143, 7, 6, 1, 
+    144, 2, 250, 39, 22, 241, 59, 48, 7, 4, 1, 144, 2, 250, 39, 22, 241, 59, 
+    48, 7, 6, 1, 144, 2, 250, 39, 22, 184, 7, 4, 1, 144, 2, 250, 39, 22, 184, 
+    7, 6, 1, 144, 2, 250, 39, 22, 59, 51, 7, 4, 1, 144, 2, 250, 39, 22, 59, 
+    51, 7, 6, 1, 144, 2, 241, 0, 22, 142, 7, 4, 1, 144, 2, 241, 0, 22, 142, 
+    7, 6, 1, 144, 2, 241, 0, 22, 242, 143, 7, 4, 1, 144, 2, 241, 0, 22, 242, 
+    143, 7, 6, 1, 144, 2, 241, 0, 22, 241, 59, 48, 7, 4, 1, 144, 2, 241, 0, 
+    22, 241, 59, 48, 7, 6, 1, 144, 2, 241, 0, 22, 184, 7, 4, 1, 144, 2, 241, 
+    0, 22, 184, 7, 6, 1, 144, 2, 241, 0, 22, 59, 51, 7, 4, 1, 144, 2, 241, 0, 
+    22, 59, 51, 7, 6, 1, 104, 2, 59, 51, 7, 4, 1, 104, 2, 59, 51, 7, 6, 1, 
+    104, 2, 241, 59, 48, 7, 4, 1, 104, 2, 241, 59, 48, 7, 6, 1, 104, 2, 241, 
+    0, 22, 142, 7, 4, 1, 104, 2, 241, 0, 22, 142, 7, 6, 1, 104, 2, 241, 0, 
+    22, 242, 143, 7, 4, 1, 104, 2, 241, 0, 22, 242, 143, 7, 6, 1, 104, 2, 
+    241, 0, 22, 241, 59, 48, 7, 4, 1, 104, 2, 241, 0, 22, 241, 59, 48, 7, 6, 
+    1, 104, 2, 241, 0, 22, 184, 7, 4, 1, 104, 2, 241, 0, 22, 184, 7, 6, 1, 
+    104, 2, 241, 0, 22, 59, 51, 7, 4, 1, 104, 2, 241, 0, 22, 59, 51, 7, 6, 1, 
+    211, 118, 2, 242, 143, 7, 4, 1, 211, 118, 2, 242, 143, 7, 6, 1, 211, 118, 
+    2, 59, 51, 7, 4, 1, 211, 118, 2, 59, 51, 7, 6, 1, 211, 118, 2, 241, 59, 
+    48, 7, 4, 1, 211, 118, 2, 241, 59, 48, 7, 6, 1, 211, 118, 2, 184, 7, 4, 
+    1, 211, 118, 2, 184, 7, 6, 1, 230, 228, 232, 191, 7, 4, 1, 230, 228, 232, 
+    191, 7, 6, 1, 230, 228, 214, 105, 7, 4, 1, 230, 228, 214, 105, 7, 6, 1, 
+    211, 118, 2, 232, 129, 7, 4, 1, 211, 118, 2, 232, 129, 26, 4, 1, 254, 
+    152, 2, 224, 157, 26, 4, 1, 254, 152, 2, 248, 161, 26, 4, 1, 254, 152, 2, 
+    224, 158, 22, 214, 13, 26, 4, 1, 254, 152, 2, 248, 162, 22, 214, 13, 26, 
+    4, 1, 254, 152, 2, 224, 158, 22, 226, 114, 26, 4, 1, 254, 152, 2, 248, 
+    162, 22, 226, 114, 26, 4, 1, 254, 152, 2, 224, 158, 22, 225, 178, 26, 4, 
+    1, 254, 152, 2, 248, 162, 22, 225, 178, 26, 6, 1, 254, 152, 2, 224, 157, 
+    26, 6, 1, 254, 152, 2, 248, 161, 26, 6, 1, 254, 152, 2, 224, 158, 22, 
+    214, 13, 26, 6, 1, 254, 152, 2, 248, 162, 22, 214, 13, 26, 6, 1, 254, 
+    152, 2, 224, 158, 22, 226, 114, 26, 6, 1, 254, 152, 2, 248, 162, 22, 226, 
+    114, 26, 6, 1, 254, 152, 2, 224, 158, 22, 225, 178, 26, 6, 1, 254, 152, 
+    2, 248, 162, 22, 225, 178, 26, 4, 1, 245, 109, 2, 224, 157, 26, 4, 1, 
+    245, 109, 2, 248, 161, 26, 4, 1, 245, 109, 2, 224, 158, 22, 214, 13, 26, 
+    4, 1, 245, 109, 2, 248, 162, 22, 214, 13, 26, 4, 1, 245, 109, 2, 224, 
+    158, 22, 226, 114, 26, 4, 1, 245, 109, 2, 248, 162, 22, 226, 114, 26, 6, 
+    1, 245, 109, 2, 224, 157, 26, 6, 1, 245, 109, 2, 248, 161, 26, 6, 1, 245, 
+    109, 2, 224, 158, 22, 214, 13, 26, 6, 1, 245, 109, 2, 248, 162, 22, 214, 
+    13, 26, 6, 1, 245, 109, 2, 224, 158, 22, 226, 114, 26, 6, 1, 245, 109, 2, 
+    248, 162, 22, 226, 114, 26, 4, 1, 245, 72, 2, 224, 157, 26, 4, 1, 245, 
+    72, 2, 248, 161, 26, 4, 1, 245, 72, 2, 224, 158, 22, 214, 13, 26, 4, 1, 
+    245, 72, 2, 248, 162, 22, 214, 13, 26, 4, 1, 245, 72, 2, 224, 158, 22, 
+    226, 114, 26, 4, 1, 245, 72, 2, 248, 162, 22, 226, 114, 26, 4, 1, 245, 
+    72, 2, 224, 158, 22, 225, 178, 26, 4, 1, 245, 72, 2, 248, 162, 22, 225, 
+    178, 26, 6, 1, 245, 72, 2, 224, 157, 26, 6, 1, 245, 72, 2, 248, 161, 26, 
+    6, 1, 245, 72, 2, 224, 158, 22, 214, 13, 26, 6, 1, 245, 72, 2, 248, 162, 
+    22, 214, 13, 26, 6, 1, 245, 72, 2, 224, 158, 22, 226, 114, 26, 6, 1, 245, 
+    72, 2, 248, 162, 22, 226, 114, 26, 6, 1, 245, 72, 2, 224, 158, 22, 225, 
+    178, 26, 6, 1, 245, 72, 2, 248, 162, 22, 225, 178, 26, 4, 1, 235, 193, 2, 
+    224, 157, 26, 4, 1, 235, 193, 2, 248, 161, 26, 4, 1, 235, 193, 2, 224, 
+    158, 22, 214, 13, 26, 4, 1, 235, 193, 2, 248, 162, 22, 214, 13, 26, 4, 1, 
+    235, 193, 2, 224, 158, 22, 226, 114, 26, 4, 1, 235, 193, 2, 248, 162, 22, 
+    226, 114, 26, 4, 1, 235, 193, 2, 224, 158, 22, 225, 178, 26, 4, 1, 235, 
+    193, 2, 248, 162, 22, 225, 178, 26, 6, 1, 235, 193, 2, 224, 157, 26, 6, 
+    1, 235, 193, 2, 248, 161, 26, 6, 1, 235, 193, 2, 224, 158, 22, 214, 13, 
+    26, 6, 1, 235, 193, 2, 248, 162, 22, 214, 13, 26, 6, 1, 235, 193, 2, 224, 
+    158, 22, 226, 114, 26, 6, 1, 235, 193, 2, 248, 162, 22, 226, 114, 26, 6, 
+    1, 235, 193, 2, 224, 158, 22, 225, 178, 26, 6, 1, 235, 193, 2, 248, 162, 
+    22, 225, 178, 26, 4, 1, 226, 204, 2, 224, 157, 26, 4, 1, 226, 204, 2, 
+    248, 161, 26, 4, 1, 226, 204, 2, 224, 158, 22, 214, 13, 26, 4, 1, 226, 
+    204, 2, 248, 162, 22, 214, 13, 26, 4, 1, 226, 204, 2, 224, 158, 22, 226, 
+    114, 26, 4, 1, 226, 204, 2, 248, 162, 22, 226, 114, 26, 6, 1, 226, 204, 
+    2, 224, 157, 26, 6, 1, 226, 204, 2, 248, 161, 26, 6, 1, 226, 204, 2, 224, 
+    158, 22, 214, 13, 26, 6, 1, 226, 204, 2, 248, 162, 22, 214, 13, 26, 6, 1, 
+    226, 204, 2, 224, 158, 22, 226, 114, 26, 6, 1, 226, 204, 2, 248, 162, 22, 
+    226, 114, 26, 4, 1, 214, 158, 2, 224, 157, 26, 4, 1, 214, 158, 2, 248, 
+    161, 26, 4, 1, 214, 158, 2, 224, 158, 22, 214, 13, 26, 4, 1, 214, 158, 2, 
+    248, 162, 22, 214, 13, 26, 4, 1, 214, 158, 2, 224, 158, 22, 226, 114, 26, 
+    4, 1, 214, 158, 2, 248, 162, 22, 226, 114, 26, 4, 1, 214, 158, 2, 224, 
+    158, 22, 225, 178, 26, 4, 1, 214, 158, 2, 248, 162, 22, 225, 178, 26, 6, 
+    1, 214, 158, 2, 248, 161, 26, 6, 1, 214, 158, 2, 248, 162, 22, 214, 13, 
+    26, 6, 1, 214, 158, 2, 248, 162, 22, 226, 114, 26, 6, 1, 214, 158, 2, 
+    248, 162, 22, 225, 178, 26, 4, 1, 226, 206, 2, 224, 157, 26, 4, 1, 226, 
+    206, 2, 248, 161, 26, 4, 1, 226, 206, 2, 224, 158, 22, 214, 13, 26, 4, 1, 
+    226, 206, 2, 248, 162, 22, 214, 13, 26, 4, 1, 226, 206, 2, 224, 158, 22, 
+    226, 114, 26, 4, 1, 226, 206, 2, 248, 162, 22, 226, 114, 26, 4, 1, 226, 
+    206, 2, 224, 158, 22, 225, 178, 26, 4, 1, 226, 206, 2, 248, 162, 22, 225, 
+    178, 26, 6, 1, 226, 206, 2, 224, 157, 26, 6, 1, 226, 206, 2, 248, 161, 
+    26, 6, 1, 226, 206, 2, 224, 158, 22, 214, 13, 26, 6, 1, 226, 206, 2, 248, 
+    162, 22, 214, 13, 26, 6, 1, 226, 206, 2, 224, 158, 22, 226, 114, 26, 6, 
+    1, 226, 206, 2, 248, 162, 22, 226, 114, 26, 6, 1, 226, 206, 2, 224, 158, 
+    22, 225, 178, 26, 6, 1, 226, 206, 2, 248, 162, 22, 225, 178, 26, 4, 1, 
+    254, 152, 2, 214, 13, 26, 4, 1, 254, 152, 2, 226, 114, 26, 4, 1, 245, 
+    109, 2, 214, 13, 26, 4, 1, 245, 109, 2, 226, 114, 26, 4, 1, 245, 72, 2, 
+    214, 13, 26, 4, 1, 245, 72, 2, 226, 114, 26, 4, 1, 235, 193, 2, 214, 13, 
+    26, 4, 1, 235, 193, 2, 226, 114, 26, 4, 1, 226, 204, 2, 214, 13, 26, 4, 
+    1, 226, 204, 2, 226, 114, 26, 4, 1, 214, 158, 2, 214, 13, 26, 4, 1, 214, 
+    158, 2, 226, 114, 26, 4, 1, 226, 206, 2, 214, 13, 26, 4, 1, 226, 206, 2, 
+    226, 114, 26, 4, 1, 254, 152, 2, 224, 158, 22, 210, 219, 26, 4, 1, 254, 
+    152, 2, 248, 162, 22, 210, 219, 26, 4, 1, 254, 152, 2, 224, 158, 22, 214, 
+    14, 22, 210, 219, 26, 4, 1, 254, 152, 2, 248, 162, 22, 214, 14, 22, 210, 
+    219, 26, 4, 1, 254, 152, 2, 224, 158, 22, 226, 115, 22, 210, 219, 26, 4, 
+    1, 254, 152, 2, 248, 162, 22, 226, 115, 22, 210, 219, 26, 4, 1, 254, 152, 
+    2, 224, 158, 22, 225, 179, 22, 210, 219, 26, 4, 1, 254, 152, 2, 248, 162, 
+    22, 225, 179, 22, 210, 219, 26, 6, 1, 254, 152, 2, 224, 158, 22, 224, 
+    170, 26, 6, 1, 254, 152, 2, 248, 162, 22, 224, 170, 26, 6, 1, 254, 152, 
+    2, 224, 158, 22, 214, 14, 22, 224, 170, 26, 6, 1, 254, 152, 2, 248, 162, 
+    22, 214, 14, 22, 224, 170, 26, 6, 1, 254, 152, 2, 224, 158, 22, 226, 115, 
+    22, 224, 170, 26, 6, 1, 254, 152, 2, 248, 162, 22, 226, 115, 22, 224, 
+    170, 26, 6, 1, 254, 152, 2, 224, 158, 22, 225, 179, 22, 224, 170, 26, 6, 
+    1, 254, 152, 2, 248, 162, 22, 225, 179, 22, 224, 170, 26, 4, 1, 245, 72, 
+    2, 224, 158, 22, 210, 219, 26, 4, 1, 245, 72, 2, 248, 162, 22, 210, 219, 
+    26, 4, 1, 245, 72, 2, 224, 158, 22, 214, 14, 22, 210, 219, 26, 4, 1, 245, 
+    72, 2, 248, 162, 22, 214, 14, 22, 210, 219, 26, 4, 1, 245, 72, 2, 224, 
+    158, 22, 226, 115, 22, 210, 219, 26, 4, 1, 245, 72, 2, 248, 162, 22, 226, 
+    115, 22, 210, 219, 26, 4, 1, 245, 72, 2, 224, 158, 22, 225, 179, 22, 210, 
+    219, 26, 4, 1, 245, 72, 2, 248, 162, 22, 225, 179, 22, 210, 219, 26, 6, 
+    1, 245, 72, 2, 224, 158, 22, 224, 170, 26, 6, 1, 245, 72, 2, 248, 162, 
+    22, 224, 170, 26, 6, 1, 245, 72, 2, 224, 158, 22, 214, 14, 22, 224, 170, 
+    26, 6, 1, 245, 72, 2, 248, 162, 22, 214, 14, 22, 224, 170, 26, 6, 1, 245, 
+    72, 2, 224, 158, 22, 226, 115, 22, 224, 170, 26, 6, 1, 245, 72, 2, 248, 
+    162, 22, 226, 115, 22, 224, 170, 26, 6, 1, 245, 72, 2, 224, 158, 22, 225, 
+    179, 22, 224, 170, 26, 6, 1, 245, 72, 2, 248, 162, 22, 225, 179, 22, 224, 
+    170, 26, 4, 1, 226, 206, 2, 224, 158, 22, 210, 219, 26, 4, 1, 226, 206, 
+    2, 248, 162, 22, 210, 219, 26, 4, 1, 226, 206, 2, 224, 158, 22, 214, 14, 
+    22, 210, 219, 26, 4, 1, 226, 206, 2, 248, 162, 22, 214, 14, 22, 210, 219, 
+    26, 4, 1, 226, 206, 2, 224, 158, 22, 226, 115, 22, 210, 219, 26, 4, 1, 
+    226, 206, 2, 248, 162, 22, 226, 115, 22, 210, 219, 26, 4, 1, 226, 206, 2, 
+    224, 158, 22, 225, 179, 22, 210, 219, 26, 4, 1, 226, 206, 2, 248, 162, 
+    22, 225, 179, 22, 210, 219, 26, 6, 1, 226, 206, 2, 224, 158, 22, 224, 
+    170, 26, 6, 1, 226, 206, 2, 248, 162, 22, 224, 170, 26, 6, 1, 226, 206, 
+    2, 224, 158, 22, 214, 14, 22, 224, 170, 26, 6, 1, 226, 206, 2, 248, 162, 
+    22, 214, 14, 22, 224, 170, 26, 6, 1, 226, 206, 2, 224, 158, 22, 226, 115, 
+    22, 224, 170, 26, 6, 1, 226, 206, 2, 248, 162, 22, 226, 115, 22, 224, 
+    170, 26, 6, 1, 226, 206, 2, 224, 158, 22, 225, 179, 22, 224, 170, 26, 6, 
+    1, 226, 206, 2, 248, 162, 22, 225, 179, 22, 224, 170, 26, 4, 1, 254, 152, 
+    2, 213, 120, 26, 4, 1, 254, 152, 2, 231, 237, 26, 4, 1, 254, 152, 2, 214, 
+    14, 22, 210, 219, 26, 4, 1, 254, 152, 2, 210, 219, 26, 4, 1, 254, 152, 2, 
+    226, 115, 22, 210, 219, 26, 4, 1, 254, 152, 2, 225, 178, 26, 4, 1, 254, 
+    152, 2, 225, 179, 22, 210, 219, 26, 6, 1, 254, 152, 2, 213, 120, 26, 6, 
+    1, 254, 152, 2, 231, 237, 26, 6, 1, 254, 152, 2, 214, 13, 26, 6, 1, 254, 
+    152, 2, 226, 114, 26, 6, 1, 254, 152, 2, 224, 170, 26, 234, 8, 26, 224, 
+    170, 26, 224, 157, 26, 225, 178, 26, 248, 4, 22, 225, 178, 26, 4, 1, 245, 
+    72, 2, 214, 14, 22, 210, 219, 26, 4, 1, 245, 72, 2, 210, 219, 26, 4, 1, 
+    245, 72, 2, 226, 115, 22, 210, 219, 26, 4, 1, 245, 72, 2, 225, 178, 26, 
+    4, 1, 245, 72, 2, 225, 179, 22, 210, 219, 26, 6, 1, 245, 109, 2, 214, 13, 
+    26, 6, 1, 245, 109, 2, 226, 114, 26, 6, 1, 245, 72, 2, 214, 13, 26, 6, 1, 
+    245, 72, 2, 226, 114, 26, 6, 1, 245, 72, 2, 224, 170, 26, 224, 158, 22, 
+    214, 13, 26, 224, 158, 22, 226, 114, 26, 224, 158, 22, 225, 178, 26, 4, 
+    1, 235, 193, 2, 213, 120, 26, 4, 1, 235, 193, 2, 231, 237, 26, 4, 1, 235, 
+    193, 2, 248, 4, 22, 214, 13, 26, 4, 1, 235, 193, 2, 248, 4, 22, 226, 114, 
+    26, 4, 1, 235, 193, 2, 225, 178, 26, 4, 1, 235, 193, 2, 248, 4, 22, 225, 
+    178, 26, 6, 1, 235, 193, 2, 213, 120, 26, 6, 1, 235, 193, 2, 231, 237, 
+    26, 6, 1, 235, 193, 2, 214, 13, 26, 6, 1, 235, 193, 2, 226, 114, 26, 248, 
+    162, 22, 214, 13, 26, 248, 162, 22, 226, 114, 26, 248, 162, 22, 225, 178, 
+    26, 4, 1, 214, 158, 2, 213, 120, 26, 4, 1, 214, 158, 2, 231, 237, 26, 4, 
+    1, 214, 158, 2, 248, 4, 22, 214, 13, 26, 4, 1, 214, 158, 2, 248, 4, 22, 
+    226, 114, 26, 4, 1, 223, 41, 2, 224, 157, 26, 4, 1, 223, 41, 2, 248, 161, 
+    26, 4, 1, 214, 158, 2, 225, 178, 26, 4, 1, 214, 158, 2, 248, 4, 22, 225, 
+    178, 26, 6, 1, 214, 158, 2, 213, 120, 26, 6, 1, 214, 158, 2, 231, 237, 
+    26, 6, 1, 214, 158, 2, 214, 13, 26, 6, 1, 214, 158, 2, 226, 114, 26, 6, 
+    1, 223, 41, 2, 248, 161, 26, 248, 4, 22, 214, 13, 26, 248, 4, 22, 226, 
+    114, 26, 214, 13, 26, 4, 1, 226, 206, 2, 214, 14, 22, 210, 219, 26, 4, 1, 
+    226, 206, 2, 210, 219, 26, 4, 1, 226, 206, 2, 226, 115, 22, 210, 219, 26, 
+    4, 1, 226, 206, 2, 225, 178, 26, 4, 1, 226, 206, 2, 225, 179, 22, 210, 
+    219, 26, 6, 1, 226, 204, 2, 214, 13, 26, 6, 1, 226, 204, 2, 226, 114, 26, 
+    6, 1, 226, 206, 2, 214, 13, 26, 6, 1, 226, 206, 2, 226, 114, 26, 6, 1, 
+    226, 206, 2, 224, 170, 26, 226, 114, 26, 248, 161, 245, 159, 224, 30, 
+    245, 168, 224, 30, 245, 159, 219, 20, 245, 168, 219, 20, 216, 142, 219, 
+    20, 244, 17, 219, 20, 219, 125, 219, 20, 244, 120, 219, 20, 224, 144, 
+    219, 20, 216, 171, 219, 20, 242, 42, 219, 20, 210, 87, 211, 245, 219, 20, 
+    210, 87, 211, 245, 228, 72, 210, 87, 211, 245, 235, 69, 233, 44, 79, 222, 
+    246, 79, 240, 175, 228, 73, 240, 175, 244, 120, 248, 164, 245, 159, 248, 
+    164, 245, 168, 248, 164, 203, 130, 52, 67, 232, 219, 52, 121, 232, 219, 
+    43, 219, 157, 224, 1, 79, 44, 219, 157, 224, 1, 79, 219, 157, 232, 115, 
+    224, 1, 79, 219, 157, 241, 170, 224, 1, 79, 43, 52, 224, 1, 79, 44, 52, 
+    224, 1, 79, 52, 232, 115, 224, 1, 79, 52, 241, 170, 224, 1, 79, 248, 213, 
+    52, 248, 213, 251, 121, 215, 223, 251, 121, 123, 59, 233, 62, 113, 59, 
+    233, 62, 203, 245, 171, 240, 173, 225, 13, 232, 220, 220, 139, 226, 19, 
+    220, 139, 233, 44, 245, 166, 222, 246, 245, 166, 224, 249, 247, 204, 244, 
+    27, 233, 44, 226, 121, 222, 246, 226, 121, 229, 199, 228, 78, 219, 20, 
+    225, 186, 230, 198, 50, 225, 186, 216, 249, 216, 149, 50, 224, 193, 52, 
+    224, 193, 215, 212, 224, 193, 223, 52, 224, 193, 223, 52, 52, 224, 193, 
+    223, 52, 215, 212, 224, 193, 250, 246, 219, 157, 233, 48, 254, 118, 224, 
+    1, 79, 219, 157, 222, 250, 254, 118, 224, 1, 79, 223, 110, 79, 52, 245, 
+    39, 79, 235, 208, 226, 123, 214, 180, 135, 216, 112, 250, 247, 235, 223, 
+    225, 13, 253, 222, 240, 176, 251, 121, 244, 10, 219, 97, 43, 42, 251, 
+    166, 2, 224, 10, 44, 42, 251, 166, 2, 224, 10, 52, 224, 16, 79, 224, 16, 
+    245, 39, 79, 245, 39, 224, 16, 79, 216, 71, 5, 245, 73, 223, 52, 225, 71, 
+    50, 85, 140, 251, 121, 85, 97, 251, 121, 121, 253, 224, 223, 52, 220, 
+    152, 250, 9, 214, 163, 113, 253, 223, 254, 167, 213, 188, 249, 225, 230, 
+    187, 50, 217, 235, 248, 164, 235, 200, 214, 180, 244, 60, 224, 144, 79, 
+    134, 59, 224, 143, 224, 27, 224, 193, 244, 19, 59, 224, 143, 244, 89, 59, 
+    224, 143, 113, 59, 224, 143, 244, 19, 59, 79, 246, 126, 249, 138, 215, 
+    222, 67, 244, 19, 247, 126, 231, 87, 11, 219, 20, 211, 209, 235, 69, 243, 
+    234, 254, 60, 235, 198, 216, 86, 235, 198, 220, 139, 235, 198, 225, 25, 
+    233, 44, 235, 171, 222, 246, 235, 171, 244, 100, 218, 91, 235, 171, 224, 
+    249, 247, 204, 235, 171, 235, 235, 217, 183, 217, 252, 255, 14, 217, 183, 
+    217, 252, 235, 235, 9, 244, 28, 220, 82, 255, 14, 9, 244, 28, 220, 82, 
+    229, 194, 21, 220, 83, 228, 74, 21, 220, 83, 218, 24, 210, 86, 218, 24, 
+    7, 4, 1, 74, 218, 24, 161, 218, 24, 190, 218, 24, 195, 218, 24, 199, 218, 
+    24, 196, 218, 24, 201, 218, 24, 96, 50, 218, 24, 230, 186, 218, 24, 245, 
+    106, 50, 218, 24, 43, 226, 7, 218, 24, 44, 226, 7, 218, 24, 7, 4, 1, 230, 
+    30, 218, 66, 210, 86, 218, 66, 111, 218, 66, 105, 218, 66, 158, 218, 66, 
+    161, 218, 66, 190, 218, 66, 195, 218, 66, 199, 218, 66, 196, 218, 66, 
+    201, 218, 66, 96, 50, 218, 66, 230, 186, 218, 66, 245, 106, 50, 218, 66, 
+    43, 226, 7, 218, 66, 44, 226, 7, 7, 218, 66, 4, 1, 61, 7, 218, 66, 4, 1, 
+    76, 7, 218, 66, 4, 1, 78, 7, 218, 66, 4, 1, 211, 178, 7, 218, 66, 4, 1, 
+    221, 197, 7, 218, 66, 4, 1, 242, 67, 7, 218, 66, 4, 1, 235, 29, 7, 218, 
+    66, 4, 1, 156, 7, 218, 66, 4, 1, 194, 7, 218, 66, 4, 1, 230, 30, 7, 218, 
+    66, 4, 1, 226, 109, 7, 218, 66, 4, 1, 222, 93, 7, 218, 66, 4, 1, 217, 
+    153, 245, 54, 50, 249, 235, 50, 249, 125, 50, 244, 3, 244, 6, 50, 232, 
+    204, 50, 230, 199, 50, 229, 215, 50, 225, 165, 50, 222, 120, 50, 211, 
+    217, 50, 166, 220, 51, 50, 247, 135, 50, 245, 55, 50, 234, 82, 50, 215, 
+    113, 50, 246, 109, 50, 243, 47, 225, 196, 50, 225, 163, 50, 242, 116, 50, 
+    253, 190, 50, 240, 235, 50, 250, 193, 50, 232, 197, 216, 4, 50, 219, 2, 
+    50, 216, 246, 50, 235, 248, 222, 120, 50, 215, 97, 232, 204, 50, 38, 43, 
+    242, 6, 48, 38, 44, 242, 6, 48, 38, 200, 67, 232, 220, 226, 124, 38, 219, 
+    253, 67, 232, 220, 226, 124, 38, 254, 96, 80, 48, 38, 250, 10, 80, 48, 
+    38, 43, 80, 48, 38, 44, 80, 48, 38, 222, 237, 226, 124, 38, 250, 10, 222, 
+    237, 226, 124, 38, 254, 96, 222, 237, 226, 124, 38, 134, 170, 48, 38, 
+    244, 19, 170, 48, 38, 245, 154, 250, 43, 38, 245, 154, 218, 236, 38, 245, 
+    154, 248, 0, 38, 245, 154, 250, 44, 252, 188, 38, 43, 44, 80, 48, 38, 
+    245, 154, 221, 190, 38, 245, 154, 234, 141, 38, 245, 154, 214, 155, 225, 
+    10, 215, 226, 38, 223, 53, 219, 49, 226, 124, 38, 52, 67, 218, 105, 226, 
+    124, 38, 254, 106, 87, 38, 215, 212, 214, 182, 38, 211, 247, 251, 148, 
+    48, 38, 140, 80, 226, 124, 38, 200, 52, 219, 49, 226, 124, 38, 97, 242, 
+    6, 2, 252, 147, 246, 111, 38, 140, 242, 6, 2, 252, 147, 246, 111, 38, 43, 
+    80, 51, 38, 44, 80, 51, 38, 253, 225, 48, 255, 20, 226, 235, 255, 4, 216, 
+    43, 216, 197, 218, 75, 139, 6, 251, 74, 248, 79, 250, 186, 250, 183, 232, 
+    220, 87, 250, 248, 226, 235, 251, 34, 214, 189, 245, 56, 249, 199, 221, 
+    187, 248, 79, 244, 187, 119, 4, 243, 209, 119, 6, 242, 67, 251, 227, 6, 
+    242, 67, 139, 6, 242, 67, 225, 40, 249, 199, 225, 40, 249, 200, 115, 113, 
+    225, 111, 119, 6, 74, 251, 227, 6, 74, 119, 6, 156, 119, 4, 156, 233, 
+    155, 57, 252, 149, 87, 139, 6, 230, 30, 227, 200, 50, 219, 33, 223, 122, 
+    249, 170, 119, 6, 226, 109, 139, 6, 226, 109, 139, 6, 224, 99, 119, 6, 
+    153, 251, 227, 6, 153, 139, 6, 153, 224, 199, 217, 72, 223, 65, 220, 134, 
+    79, 217, 2, 50, 215, 254, 164, 50, 213, 240, 139, 6, 210, 159, 226, 137, 
+    50, 226, 225, 50, 235, 200, 226, 225, 50, 251, 227, 6, 210, 159, 215, 94, 
+    26, 4, 1, 235, 192, 234, 179, 50, 254, 115, 50, 119, 6, 253, 166, 251, 
+    227, 6, 251, 74, 245, 76, 87, 119, 4, 76, 119, 6, 76, 119, 6, 245, 14, 
+    215, 94, 6, 245, 14, 119, 6, 194, 119, 4, 78, 109, 87, 252, 37, 87, 242, 
+    209, 87, 248, 198, 87, 235, 239, 219, 31, 222, 189, 6, 224, 99, 244, 190, 
+    50, 139, 4, 225, 111, 139, 4, 243, 114, 139, 6, 243, 114, 139, 6, 225, 
+    111, 139, 230, 29, 218, 41, 215, 94, 35, 6, 243, 209, 215, 94, 35, 6, 
+    156, 223, 52, 35, 6, 156, 215, 94, 35, 6, 211, 117, 139, 32, 6, 249, 68, 
+    139, 32, 4, 249, 68, 139, 32, 4, 76, 139, 32, 4, 74, 139, 32, 4, 235, 
+    150, 224, 173, 232, 219, 215, 94, 254, 134, 225, 186, 50, 254, 189, 215, 
+    94, 4, 245, 14, 16, 31, 221, 254, 219, 31, 212, 114, 244, 10, 123, 220, 
+    120, 212, 114, 244, 10, 123, 228, 199, 212, 114, 244, 10, 123, 216, 242, 
+    212, 114, 244, 10, 123, 216, 169, 212, 114, 244, 10, 113, 216, 167, 212, 
+    114, 244, 10, 123, 244, 125, 212, 114, 244, 10, 113, 244, 124, 212, 114, 
+    244, 10, 134, 244, 124, 212, 114, 244, 10, 244, 19, 244, 124, 212, 114, 
+    244, 10, 123, 219, 117, 212, 114, 244, 10, 244, 89, 219, 115, 212, 114, 
+    244, 10, 123, 245, 196, 212, 114, 244, 10, 134, 245, 194, 212, 114, 244, 
+    10, 244, 89, 245, 194, 212, 114, 244, 10, 220, 124, 245, 194, 244, 10, 
+    227, 201, 111, 222, 200, 227, 202, 111, 222, 200, 227, 202, 105, 222, 
+    200, 227, 202, 158, 222, 200, 227, 202, 161, 222, 200, 227, 202, 190, 
+    222, 200, 227, 202, 195, 222, 200, 227, 202, 199, 222, 200, 227, 202, 
+    196, 222, 200, 227, 202, 201, 222, 200, 227, 202, 216, 248, 222, 200, 
+    227, 202, 245, 175, 222, 200, 227, 202, 215, 76, 222, 200, 227, 202, 244, 
+    122, 222, 200, 227, 202, 123, 240, 217, 222, 200, 227, 202, 244, 89, 240, 
+    217, 222, 200, 227, 202, 123, 216, 148, 4, 222, 200, 227, 202, 111, 4, 
+    222, 200, 227, 202, 105, 4, 222, 200, 227, 202, 158, 4, 222, 200, 227, 
+    202, 161, 4, 222, 200, 227, 202, 190, 4, 222, 200, 227, 202, 195, 4, 222, 
+    200, 227, 202, 199, 4, 222, 200, 227, 202, 196, 4, 222, 200, 227, 202, 
+    201, 4, 222, 200, 227, 202, 216, 248, 4, 222, 200, 227, 202, 245, 175, 4, 
+    222, 200, 227, 202, 215, 76, 4, 222, 200, 227, 202, 244, 122, 4, 222, 
+    200, 227, 202, 123, 240, 217, 4, 222, 200, 227, 202, 244, 89, 240, 217, 
+    4, 222, 200, 227, 202, 123, 216, 148, 222, 200, 227, 202, 123, 216, 149, 
+    251, 75, 249, 68, 222, 200, 227, 202, 244, 89, 216, 148, 222, 200, 227, 
+    202, 216, 249, 216, 148, 222, 200, 227, 202, 223, 52, 123, 240, 217, 7, 
+    4, 1, 223, 52, 251, 74, 222, 200, 227, 202, 219, 127, 233, 84, 17, 222, 
+    200, 227, 202, 244, 123, 245, 234, 17, 222, 200, 227, 202, 244, 123, 216, 
+    148, 222, 200, 227, 202, 123, 240, 218, 216, 148, 212, 114, 244, 10, 210, 
+    87, 216, 167, 140, 75, 214, 153, 75, 97, 75, 246, 112, 75, 43, 44, 75, 
+    120, 124, 75, 228, 61, 212, 9, 75, 228, 61, 245, 228, 75, 219, 30, 245, 
+    228, 75, 219, 30, 212, 9, 75, 140, 80, 2, 91, 97, 80, 2, 91, 140, 212, 
+    36, 75, 97, 212, 36, 75, 140, 113, 241, 241, 75, 214, 153, 113, 241, 241, 
+    75, 97, 113, 241, 241, 75, 246, 112, 113, 241, 241, 75, 140, 80, 2, 217, 
+    78, 97, 80, 2, 217, 78, 140, 80, 243, 251, 130, 214, 153, 80, 243, 251, 
+    130, 97, 80, 243, 251, 130, 246, 112, 80, 243, 251, 130, 120, 124, 80, 2, 
+    252, 135, 140, 80, 2, 103, 97, 80, 2, 103, 140, 80, 2, 232, 129, 97, 80, 
+    2, 232, 129, 43, 44, 212, 36, 75, 43, 44, 80, 2, 91, 246, 112, 210, 35, 
+    75, 214, 153, 80, 2, 216, 78, 233, 43, 214, 153, 80, 2, 216, 78, 222, 
+    244, 246, 112, 80, 2, 216, 78, 233, 43, 246, 112, 80, 2, 216, 78, 222, 
+    244, 97, 80, 2, 249, 169, 246, 111, 246, 112, 80, 2, 249, 169, 233, 43, 
+    254, 96, 216, 15, 220, 155, 75, 250, 10, 216, 15, 220, 155, 75, 228, 61, 
+    212, 9, 80, 216, 43, 200, 130, 140, 80, 216, 43, 252, 149, 115, 97, 80, 
+    216, 43, 130, 254, 96, 204, 250, 44, 75, 250, 10, 204, 250, 44, 75, 140, 
+    242, 6, 2, 252, 147, 214, 152, 140, 242, 6, 2, 252, 147, 246, 111, 214, 
+    153, 242, 6, 2, 252, 147, 222, 244, 214, 153, 242, 6, 2, 252, 147, 233, 
+    43, 97, 242, 6, 2, 252, 147, 214, 152, 97, 242, 6, 2, 252, 147, 246, 111, 
+    246, 112, 242, 6, 2, 252, 147, 222, 244, 246, 112, 242, 6, 2, 252, 147, 
+    233, 43, 97, 80, 115, 140, 75, 214, 153, 80, 140, 64, 246, 112, 75, 140, 
+    80, 115, 97, 75, 140, 226, 74, 253, 255, 214, 153, 226, 74, 253, 255, 97, 
+    226, 74, 253, 255, 246, 112, 226, 74, 253, 255, 140, 242, 6, 115, 97, 
+    242, 5, 97, 242, 6, 115, 140, 242, 5, 140, 52, 80, 2, 91, 43, 44, 52, 80, 
+    2, 91, 97, 52, 80, 2, 91, 140, 52, 75, 214, 153, 52, 75, 97, 52, 75, 246, 
+    112, 52, 75, 43, 44, 52, 75, 120, 124, 52, 75, 228, 61, 212, 9, 52, 75, 
+    228, 61, 245, 228, 52, 75, 219, 30, 245, 228, 52, 75, 219, 30, 212, 9, 
+    52, 75, 140, 215, 212, 75, 97, 215, 212, 75, 140, 218, 232, 75, 97, 218, 
+    232, 75, 214, 153, 80, 2, 52, 91, 246, 112, 80, 2, 52, 91, 140, 248, 163, 
+    75, 214, 153, 248, 163, 75, 97, 248, 163, 75, 246, 112, 248, 163, 75, 
+    140, 80, 216, 43, 130, 97, 80, 216, 43, 130, 140, 71, 75, 214, 153, 71, 
+    75, 97, 71, 75, 246, 112, 71, 75, 214, 153, 71, 80, 243, 251, 130, 214, 
+    153, 71, 80, 226, 201, 225, 217, 214, 153, 71, 80, 226, 201, 225, 218, 2, 
+    203, 130, 214, 153, 71, 80, 226, 201, 225, 218, 2, 67, 130, 214, 153, 71, 
+    52, 75, 214, 153, 71, 52, 80, 226, 201, 225, 217, 97, 71, 80, 243, 251, 
+    212, 56, 228, 61, 212, 9, 80, 216, 43, 249, 168, 219, 30, 245, 228, 80, 
+    216, 43, 249, 168, 120, 124, 71, 75, 44, 80, 2, 4, 250, 43, 246, 112, 80, 
+    140, 64, 214, 153, 75, 134, 97, 253, 255, 140, 80, 2, 67, 91, 97, 80, 2, 
+    67, 91, 43, 44, 80, 2, 67, 91, 140, 80, 2, 52, 67, 91, 97, 80, 2, 52, 67, 
+    91, 43, 44, 80, 2, 52, 67, 91, 140, 226, 177, 75, 97, 226, 177, 75, 43, 
+    44, 226, 177, 75, 31, 254, 163, 249, 222, 226, 1, 247, 241, 216, 188, 
+    245, 35, 216, 188, 247, 146, 228, 57, 245, 36, 245, 160, 220, 129, 235, 
+    252, 229, 226, 245, 178, 226, 235, 228, 57, 254, 132, 245, 178, 226, 235, 
+    4, 245, 178, 226, 235, 249, 194, 253, 246, 231, 67, 247, 146, 228, 57, 
+    249, 196, 253, 246, 231, 67, 4, 249, 194, 253, 246, 231, 67, 245, 151, 
+    64, 224, 175, 230, 29, 224, 183, 230, 29, 249, 173, 230, 29, 218, 41, 
+    230, 187, 50, 230, 185, 50, 59, 225, 25, 247, 177, 219, 97, 220, 130, 
+    230, 186, 253, 225, 226, 171, 222, 237, 226, 171, 251, 122, 226, 171, 42, 
+    222, 195, 249, 117, 222, 195, 244, 12, 222, 195, 224, 171, 112, 235, 241, 
+    44, 254, 117, 254, 117, 231, 93, 254, 117, 219, 1, 254, 117, 247, 179, 
+    247, 146, 228, 57, 247, 182, 226, 12, 112, 228, 57, 226, 12, 112, 232, 
+    152, 254, 126, 232, 152, 226, 162, 235, 205, 214, 175, 235, 218, 52, 235, 
+    218, 215, 212, 235, 218, 249, 190, 235, 218, 218, 14, 235, 218, 213, 129, 
+    235, 218, 250, 10, 235, 218, 250, 10, 249, 190, 235, 218, 254, 96, 249, 
+    190, 235, 218, 216, 187, 252, 75, 223, 140, 224, 172, 59, 230, 186, 245, 
+    41, 243, 53, 224, 172, 241, 64, 216, 90, 226, 171, 223, 52, 184, 235, 
+    200, 233, 71, 222, 93, 219, 159, 212, 35, 211, 200, 224, 183, 228, 57, 
+    184, 230, 187, 184, 253, 218, 128, 112, 228, 57, 253, 218, 128, 112, 254, 
+    56, 128, 112, 254, 56, 251, 96, 228, 57, 255, 13, 128, 112, 229, 105, 
+    254, 56, 228, 64, 255, 13, 128, 112, 254, 156, 128, 112, 228, 57, 254, 
+    156, 128, 112, 254, 156, 128, 177, 128, 112, 215, 212, 184, 254, 164, 
+    128, 112, 245, 102, 112, 243, 52, 245, 102, 112, 247, 242, 252, 31, 254, 
+    58, 216, 197, 232, 227, 243, 52, 128, 112, 254, 56, 128, 216, 43, 177, 
+    216, 197, 236, 22, 226, 235, 236, 22, 64, 177, 254, 56, 128, 112, 249, 
+    235, 245, 105, 245, 106, 249, 234, 222, 237, 236, 7, 128, 112, 222, 237, 
+    128, 112, 249, 162, 112, 245, 75, 245, 104, 112, 218, 159, 245, 105, 248, 
+    63, 128, 112, 128, 216, 43, 251, 86, 248, 80, 231, 93, 251, 85, 224, 14, 
+    128, 112, 228, 57, 128, 112, 240, 111, 112, 228, 57, 240, 111, 112, 218, 
+    111, 245, 102, 112, 233, 21, 177, 128, 112, 242, 137, 177, 128, 112, 233, 
+    21, 115, 128, 112, 242, 137, 115, 128, 112, 233, 21, 251, 96, 228, 57, 
+    128, 112, 242, 137, 251, 96, 228, 57, 128, 112, 230, 102, 233, 20, 230, 
+    102, 242, 136, 252, 31, 228, 57, 245, 102, 112, 228, 57, 233, 20, 228, 
+    57, 242, 136, 229, 105, 233, 21, 228, 64, 128, 112, 229, 105, 242, 137, 
+    228, 64, 128, 112, 233, 21, 177, 245, 102, 112, 242, 137, 177, 245, 102, 
+    112, 229, 105, 233, 21, 228, 64, 245, 102, 112, 229, 105, 242, 137, 228, 
+    64, 245, 102, 112, 233, 21, 177, 242, 136, 242, 137, 177, 233, 20, 229, 
+    105, 233, 21, 228, 64, 242, 136, 229, 105, 242, 137, 228, 64, 233, 20, 
+    224, 205, 218, 56, 224, 206, 177, 128, 112, 218, 57, 177, 128, 112, 224, 
+    206, 177, 245, 102, 112, 218, 57, 177, 245, 102, 112, 247, 146, 228, 57, 
+    224, 208, 247, 146, 228, 57, 218, 58, 218, 65, 226, 235, 218, 23, 226, 
+    235, 228, 57, 116, 218, 65, 226, 235, 228, 57, 116, 218, 23, 226, 235, 
+    218, 65, 64, 177, 128, 112, 218, 23, 64, 177, 128, 112, 229, 105, 116, 
+    218, 65, 64, 228, 64, 128, 112, 229, 105, 116, 218, 23, 64, 228, 64, 128, 
+    112, 218, 65, 64, 2, 228, 57, 128, 112, 218, 23, 64, 2, 228, 57, 128, 
+    112, 230, 86, 230, 87, 230, 88, 230, 87, 214, 175, 42, 236, 22, 226, 235, 
+    42, 226, 154, 226, 235, 42, 236, 22, 64, 177, 128, 112, 42, 226, 154, 64, 
+    177, 128, 112, 42, 251, 3, 42, 249, 110, 37, 225, 25, 37, 230, 186, 37, 
+    216, 86, 37, 247, 177, 219, 97, 37, 59, 226, 171, 37, 222, 237, 226, 171, 
+    37, 253, 225, 226, 171, 37, 245, 105, 37, 248, 164, 92, 225, 25, 92, 230, 
+    186, 92, 216, 86, 92, 59, 226, 171, 44, 217, 88, 43, 217, 88, 124, 217, 
+    88, 120, 217, 88, 253, 228, 230, 161, 215, 192, 244, 33, 215, 212, 67, 
+    252, 149, 44, 215, 93, 52, 67, 252, 149, 52, 44, 215, 93, 247, 146, 228, 
+    57, 224, 166, 228, 57, 215, 192, 247, 146, 228, 57, 244, 34, 229, 107, 
+    52, 67, 252, 149, 52, 44, 215, 93, 224, 206, 214, 184, 223, 94, 218, 57, 
+    214, 184, 223, 94, 228, 62, 218, 78, 226, 235, 249, 194, 253, 246, 228, 
+    62, 218, 77, 228, 62, 218, 78, 64, 177, 128, 112, 249, 194, 253, 246, 
+    228, 62, 218, 78, 177, 128, 112, 226, 154, 226, 235, 236, 22, 226, 235, 
+    230, 92, 241, 207, 249, 204, 231, 142, 235, 215, 211, 145, 229, 207, 228, 
+    63, 44, 254, 118, 2, 254, 33, 44, 215, 226, 230, 29, 232, 152, 254, 126, 
+    230, 29, 232, 152, 226, 162, 230, 29, 235, 205, 230, 29, 214, 175, 248, 
+    1, 226, 171, 59, 226, 171, 218, 159, 226, 171, 247, 177, 216, 86, 251, 
+    172, 43, 228, 62, 244, 189, 220, 151, 224, 183, 44, 228, 62, 244, 189, 
+    220, 151, 224, 183, 43, 220, 151, 224, 183, 44, 220, 151, 224, 183, 223, 
+    52, 216, 90, 245, 105, 249, 107, 232, 152, 226, 162, 249, 107, 232, 152, 
+    254, 126, 52, 218, 64, 52, 218, 22, 52, 235, 205, 52, 214, 175, 225, 50, 
+    128, 22, 226, 12, 112, 233, 21, 2, 247, 128, 242, 137, 2, 247, 128, 213, 
+    187, 230, 102, 233, 20, 213, 187, 230, 102, 242, 136, 233, 21, 128, 216, 
+    43, 177, 242, 136, 242, 137, 128, 216, 43, 177, 233, 20, 128, 216, 43, 
+    177, 233, 20, 128, 216, 43, 177, 242, 136, 128, 216, 43, 177, 224, 205, 
+    128, 216, 43, 177, 218, 56, 247, 146, 228, 57, 224, 209, 177, 245, 107, 
+    247, 146, 228, 57, 218, 59, 177, 245, 107, 228, 57, 42, 236, 22, 64, 177, 
+    128, 112, 228, 57, 42, 226, 154, 64, 177, 128, 112, 42, 236, 22, 64, 177, 
+    228, 57, 128, 112, 42, 226, 154, 64, 177, 228, 57, 128, 112, 233, 21, 
+    251, 96, 228, 57, 245, 102, 112, 242, 137, 251, 96, 228, 57, 245, 102, 
+    112, 224, 206, 251, 96, 228, 57, 245, 102, 112, 218, 57, 251, 96, 228, 
+    57, 245, 102, 112, 228, 57, 228, 62, 218, 78, 226, 235, 247, 146, 228, 
+    57, 249, 196, 253, 246, 228, 62, 218, 77, 228, 57, 228, 62, 218, 78, 64, 
+    177, 128, 112, 247, 146, 228, 57, 249, 196, 253, 246, 228, 62, 218, 78, 
+    177, 245, 107, 67, 245, 171, 230, 227, 203, 245, 171, 120, 44, 248, 7, 
+    245, 171, 124, 44, 248, 7, 245, 171, 245, 178, 64, 2, 200, 203, 91, 245, 
+    178, 64, 2, 67, 252, 149, 253, 215, 245, 151, 64, 203, 91, 4, 245, 178, 
+    64, 2, 67, 252, 149, 253, 215, 245, 151, 64, 203, 91, 245, 178, 64, 2, 
+    59, 48, 245, 178, 64, 2, 226, 127, 4, 245, 178, 64, 2, 226, 127, 245, 
+    178, 64, 2, 214, 183, 245, 178, 64, 2, 113, 203, 218, 92, 249, 194, 2, 
+    200, 203, 91, 249, 194, 2, 67, 252, 149, 253, 215, 245, 151, 64, 203, 91, 
+    4, 249, 194, 2, 67, 252, 149, 253, 215, 245, 151, 64, 203, 91, 249, 194, 
+    2, 226, 127, 4, 249, 194, 2, 226, 127, 210, 160, 189, 252, 181, 231, 66, 
+    248, 2, 50, 245, 180, 75, 240, 241, 120, 254, 1, 124, 254, 1, 224, 178, 
+    225, 168, 212, 32, 232, 219, 43, 250, 189, 44, 250, 189, 43, 244, 65, 44, 
+    244, 65, 251, 183, 44, 249, 140, 251, 183, 43, 249, 140, 216, 15, 44, 
+    249, 140, 216, 15, 43, 249, 140, 223, 52, 228, 57, 50, 42, 232, 110, 254, 
+    33, 221, 166, 221, 173, 217, 2, 223, 123, 224, 244, 235, 245, 213, 165, 
+    218, 236, 225, 44, 64, 235, 214, 50, 215, 94, 228, 57, 50, 212, 42, 240, 
+    243, 216, 15, 43, 249, 168, 216, 15, 44, 249, 168, 251, 183, 43, 249, 
+    168, 251, 183, 44, 249, 168, 216, 15, 163, 235, 218, 251, 183, 163, 235, 
+    218, 243, 248, 219, 77, 120, 254, 2, 252, 32, 113, 203, 252, 137, 226, 
+    164, 234, 144, 245, 98, 216, 43, 216, 197, 222, 254, 211, 179, 236, 7, 
+    116, 223, 120, 251, 171, 234, 143, 233, 48, 254, 118, 127, 222, 250, 254, 
+    118, 127, 245, 98, 216, 43, 216, 197, 233, 52, 252, 43, 222, 236, 249, 
+    78, 254, 164, 254, 9, 217, 182, 216, 5, 222, 125, 247, 223, 226, 155, 
+    249, 206, 217, 53, 219, 88, 249, 159, 249, 158, 254, 74, 243, 232, 16, 
+    240, 158, 254, 74, 243, 232, 16, 218, 230, 224, 30, 254, 74, 243, 232, 
+    16, 224, 31, 245, 107, 254, 74, 243, 232, 16, 224, 31, 247, 182, 254, 74, 
+    243, 232, 16, 224, 31, 248, 0, 254, 74, 243, 232, 16, 224, 31, 235, 62, 
+    254, 74, 243, 232, 16, 224, 31, 250, 43, 254, 74, 243, 232, 16, 250, 44, 
+    218, 137, 254, 74, 243, 232, 16, 250, 44, 235, 62, 254, 74, 243, 232, 16, 
+    219, 98, 130, 254, 74, 243, 232, 16, 252, 189, 130, 254, 74, 243, 232, 
+    16, 224, 31, 219, 97, 254, 74, 243, 232, 16, 224, 31, 252, 188, 254, 74, 
+    243, 232, 16, 224, 31, 233, 20, 254, 74, 243, 232, 16, 224, 31, 242, 136, 
+    254, 74, 243, 232, 16, 140, 214, 19, 254, 74, 243, 232, 16, 97, 214, 19, 
+    254, 74, 243, 232, 16, 224, 31, 140, 75, 254, 74, 243, 232, 16, 224, 31, 
+    97, 75, 254, 74, 243, 232, 16, 250, 44, 252, 188, 254, 74, 243, 232, 16, 
+    124, 217, 89, 214, 183, 254, 74, 243, 232, 16, 248, 63, 218, 137, 254, 
+    74, 243, 232, 16, 224, 31, 124, 250, 246, 254, 74, 243, 232, 16, 224, 31, 
+    248, 62, 254, 74, 243, 232, 16, 124, 217, 89, 235, 62, 254, 74, 243, 232, 
+    16, 214, 153, 214, 19, 254, 74, 243, 232, 16, 224, 31, 214, 153, 75, 254, 
+    74, 243, 232, 16, 120, 217, 89, 226, 127, 254, 74, 243, 232, 16, 248, 74, 
+    218, 137, 254, 74, 243, 232, 16, 224, 31, 120, 250, 246, 254, 74, 243, 
+    232, 16, 224, 31, 248, 73, 254, 74, 243, 232, 16, 120, 217, 89, 235, 62, 
+    254, 74, 243, 232, 16, 246, 112, 214, 19, 254, 74, 243, 232, 16, 224, 31, 
+    246, 112, 75, 254, 74, 243, 232, 16, 224, 0, 214, 183, 254, 74, 243, 232, 
+    16, 248, 63, 214, 183, 254, 74, 243, 232, 16, 248, 1, 214, 183, 254, 74, 
+    243, 232, 16, 235, 63, 214, 183, 254, 74, 243, 232, 16, 250, 44, 214, 
+    183, 254, 74, 243, 232, 16, 120, 220, 7, 235, 62, 254, 74, 243, 232, 16, 
+    224, 0, 224, 30, 254, 74, 243, 232, 16, 250, 44, 218, 158, 254, 74, 243, 
+    232, 16, 224, 31, 249, 234, 254, 74, 243, 232, 16, 120, 217, 89, 248, 9, 
+    254, 74, 243, 232, 16, 248, 74, 248, 9, 254, 74, 243, 232, 16, 218, 159, 
+    248, 9, 254, 74, 243, 232, 16, 235, 63, 248, 9, 254, 74, 243, 232, 16, 
+    250, 44, 248, 9, 254, 74, 243, 232, 16, 124, 220, 7, 218, 137, 254, 74, 
+    243, 232, 16, 43, 220, 7, 218, 137, 254, 74, 243, 232, 16, 216, 90, 248, 
+    9, 254, 74, 243, 232, 16, 242, 137, 248, 9, 254, 74, 243, 232, 16, 249, 
+    228, 130, 254, 74, 243, 232, 16, 248, 74, 184, 254, 74, 243, 232, 16, 
+    210, 34, 254, 74, 243, 232, 16, 218, 138, 184, 254, 74, 243, 232, 16, 
+    220, 153, 214, 183, 254, 74, 243, 232, 16, 224, 31, 228, 57, 245, 107, 
+    254, 74, 243, 232, 16, 224, 31, 224, 15, 254, 74, 243, 232, 16, 124, 250, 
+    247, 184, 254, 74, 243, 232, 16, 120, 250, 247, 184, 254, 74, 243, 232, 
+    16, 235, 192, 254, 74, 243, 232, 16, 223, 40, 254, 74, 243, 232, 16, 226, 
+    205, 254, 74, 243, 232, 16, 254, 152, 214, 183, 254, 74, 243, 232, 16, 
+    245, 109, 214, 183, 254, 74, 243, 232, 16, 235, 193, 214, 183, 254, 74, 
+    243, 232, 16, 226, 206, 214, 183, 254, 74, 243, 232, 16, 254, 151, 228, 
+    57, 250, 138, 79, 44, 254, 118, 2, 246, 112, 210, 35, 75, 219, 237, 204, 
+    251, 171, 252, 53, 87, 67, 232, 220, 2, 230, 229, 247, 128, 235, 223, 87, 
+    249, 191, 214, 181, 87, 247, 197, 214, 181, 87, 245, 162, 87, 249, 218, 
+    87, 71, 42, 2, 250, 183, 67, 232, 219, 245, 138, 87, 254, 147, 234, 145, 
+    87, 241, 220, 87, 37, 203, 252, 149, 2, 228, 55, 37, 215, 227, 246, 114, 
+    251, 143, 250, 44, 2, 228, 59, 75, 214, 179, 87, 230, 142, 87, 240, 171, 
+    87, 226, 178, 242, 66, 87, 226, 178, 233, 153, 87, 225, 248, 87, 225, 
+    247, 87, 247, 205, 249, 105, 16, 244, 28, 105, 219, 52, 87, 254, 74, 243, 
+    232, 16, 224, 30, 248, 91, 220, 140, 234, 145, 87, 224, 195, 226, 79, 
+    229, 87, 226, 79, 224, 191, 221, 191, 87, 250, 25, 221, 191, 87, 43, 226, 
+    8, 214, 160, 103, 43, 226, 8, 245, 29, 43, 226, 8, 232, 114, 103, 44, 
+    226, 8, 214, 160, 103, 44, 226, 8, 245, 29, 44, 226, 8, 232, 114, 103, 
+    43, 42, 251, 166, 214, 160, 249, 168, 43, 42, 251, 166, 245, 29, 43, 42, 
+    251, 166, 232, 114, 249, 168, 44, 42, 251, 166, 214, 160, 249, 168, 44, 
+    42, 251, 166, 245, 29, 44, 42, 251, 166, 232, 114, 249, 168, 43, 249, 
+    107, 251, 166, 214, 160, 103, 43, 249, 107, 251, 166, 230, 229, 225, 104, 
+    43, 249, 107, 251, 166, 232, 114, 103, 249, 107, 251, 166, 245, 29, 44, 
+    249, 107, 251, 166, 214, 160, 103, 44, 249, 107, 251, 166, 230, 229, 225, 
+    104, 44, 249, 107, 251, 166, 232, 114, 103, 235, 219, 245, 29, 203, 232, 
+    220, 245, 29, 214, 160, 43, 177, 232, 114, 44, 249, 107, 251, 166, 221, 
+    174, 214, 160, 44, 177, 232, 114, 43, 249, 107, 251, 166, 221, 174, 218, 
+    42, 216, 14, 218, 42, 251, 182, 216, 15, 42, 127, 251, 183, 42, 127, 251, 
+    183, 42, 251, 166, 115, 216, 15, 42, 127, 34, 16, 251, 182, 43, 67, 93, 
+    232, 219, 44, 67, 93, 232, 219, 203, 221, 207, 232, 218, 203, 221, 207, 
+    232, 217, 203, 221, 207, 232, 216, 203, 221, 207, 232, 215, 248, 54, 16, 
+    193, 67, 22, 216, 15, 222, 254, 248, 54, 16, 193, 67, 22, 251, 183, 222, 
+    254, 248, 54, 16, 193, 67, 2, 250, 43, 248, 54, 16, 193, 124, 22, 203, 2, 
+    250, 43, 248, 54, 16, 193, 120, 22, 203, 2, 250, 43, 248, 54, 16, 193, 
+    67, 2, 215, 226, 248, 54, 16, 193, 124, 22, 203, 2, 215, 226, 248, 54, 
+    16, 193, 120, 22, 203, 2, 215, 226, 248, 54, 16, 193, 67, 22, 212, 35, 
+    248, 54, 16, 193, 124, 22, 203, 2, 212, 35, 248, 54, 16, 193, 120, 22, 
+    203, 2, 212, 35, 248, 54, 16, 193, 124, 22, 241, 51, 248, 54, 16, 193, 
+    120, 22, 241, 51, 248, 54, 16, 193, 67, 22, 216, 15, 233, 52, 248, 54, 
+    16, 193, 67, 22, 251, 183, 233, 52, 42, 244, 40, 223, 57, 87, 245, 190, 
+    87, 67, 232, 220, 245, 29, 231, 38, 251, 154, 231, 38, 200, 115, 219, 
+    252, 231, 38, 219, 253, 115, 232, 143, 231, 38, 200, 115, 113, 219, 239, 
+    231, 38, 113, 219, 240, 115, 232, 143, 231, 38, 113, 219, 240, 235, 70, 
+    231, 38, 215, 209, 231, 38, 216, 224, 231, 38, 225, 191, 245, 232, 242, 
+    129, 243, 226, 216, 15, 226, 7, 251, 183, 226, 7, 216, 15, 249, 107, 127, 
+    251, 183, 249, 107, 127, 216, 15, 216, 7, 220, 55, 127, 251, 183, 216, 7, 
+    220, 55, 127, 71, 215, 240, 252, 43, 222, 237, 2, 250, 43, 218, 122, 244, 
+    72, 255, 26, 249, 104, 245, 179, 235, 205, 248, 91, 245, 32, 87, 85, 222, 
+    250, 52, 215, 226, 85, 233, 48, 52, 215, 226, 85, 214, 162, 52, 215, 226, 
+    85, 246, 113, 52, 215, 226, 85, 222, 250, 52, 215, 227, 2, 67, 130, 85, 
+    233, 48, 52, 215, 227, 2, 67, 130, 85, 222, 250, 215, 227, 2, 52, 67, 
+    130, 254, 182, 250, 11, 218, 128, 216, 87, 250, 11, 240, 244, 2, 244, 58, 
+    221, 243, 16, 31, 227, 206, 16, 31, 218, 154, 64, 241, 240, 16, 31, 218, 
+    154, 64, 216, 213, 16, 31, 245, 151, 64, 216, 213, 16, 31, 245, 151, 64, 
+    215, 244, 16, 31, 245, 140, 16, 31, 255, 16, 16, 31, 252, 52, 16, 31, 
+    252, 187, 16, 31, 203, 217, 90, 16, 31, 232, 220, 244, 153, 16, 31, 67, 
+    217, 90, 16, 31, 244, 28, 244, 153, 16, 31, 250, 238, 223, 56, 16, 31, 
+    220, 30, 226, 134, 16, 31, 220, 30, 236, 6, 16, 31, 248, 159, 232, 210, 
+    245, 85, 16, 31, 248, 39, 249, 186, 111, 16, 31, 248, 39, 249, 186, 105, 
+    16, 31, 248, 39, 249, 186, 158, 16, 31, 248, 39, 249, 186, 161, 16, 31, 
+    152, 255, 16, 16, 31, 217, 178, 236, 69, 16, 31, 245, 151, 64, 215, 245, 
+    251, 221, 16, 31, 251, 13, 16, 31, 245, 151, 64, 231, 86, 16, 31, 218, 
+    62, 16, 31, 245, 85, 16, 31, 244, 115, 220, 139, 16, 31, 242, 128, 220, 
+    139, 16, 31, 223, 124, 220, 139, 16, 31, 214, 174, 220, 139, 16, 31, 219, 
+    20, 16, 31, 248, 71, 251, 224, 87, 204, 251, 171, 16, 31, 229, 90, 16, 
+    31, 248, 72, 244, 28, 105, 16, 31, 218, 63, 244, 28, 105, 226, 245, 103, 
+    226, 245, 250, 160, 226, 245, 244, 31, 226, 245, 235, 200, 244, 31, 226, 
+    245, 252, 50, 251, 132, 226, 245, 251, 178, 216, 112, 226, 245, 251, 163, 
+    252, 154, 240, 110, 226, 245, 254, 135, 64, 250, 137, 226, 245, 248, 164, 
+    226, 245, 249, 95, 255, 20, 227, 204, 226, 245, 52, 252, 188, 37, 21, 
+    111, 37, 21, 105, 37, 21, 158, 37, 21, 161, 37, 21, 190, 37, 21, 195, 37, 
+    21, 199, 37, 21, 196, 37, 21, 201, 37, 54, 216, 248, 37, 54, 245, 175, 
+    37, 54, 215, 76, 37, 54, 216, 165, 37, 54, 244, 13, 37, 54, 244, 126, 37, 
+    54, 219, 121, 37, 54, 220, 121, 37, 54, 245, 198, 37, 54, 228, 202, 37, 
+    54, 215, 73, 88, 21, 111, 88, 21, 105, 88, 21, 158, 88, 21, 161, 88, 21, 
+    190, 88, 21, 195, 88, 21, 199, 88, 21, 196, 88, 21, 201, 88, 54, 216, 
+    248, 88, 54, 245, 175, 88, 54, 215, 76, 88, 54, 216, 165, 88, 54, 244, 
+    13, 88, 54, 244, 126, 88, 54, 219, 121, 88, 54, 220, 121, 88, 54, 245, 
+    198, 88, 54, 228, 202, 88, 54, 215, 73, 21, 123, 243, 236, 218, 131, 21, 
+    113, 243, 236, 218, 131, 21, 134, 243, 236, 218, 131, 21, 244, 19, 243, 
+    236, 218, 131, 21, 244, 89, 243, 236, 218, 131, 21, 219, 127, 243, 236, 
+    218, 131, 21, 220, 124, 243, 236, 218, 131, 21, 245, 201, 243, 236, 218, 
+    131, 21, 228, 205, 243, 236, 218, 131, 54, 216, 249, 243, 236, 218, 131, 
+    54, 245, 176, 243, 236, 218, 131, 54, 215, 77, 243, 236, 218, 131, 54, 
+    216, 166, 243, 236, 218, 131, 54, 244, 14, 243, 236, 218, 131, 54, 244, 
+    127, 243, 236, 218, 131, 54, 219, 122, 243, 236, 218, 131, 54, 220, 122, 
+    243, 236, 218, 131, 54, 245, 199, 243, 236, 218, 131, 54, 228, 203, 243, 
+    236, 218, 131, 54, 215, 74, 243, 236, 218, 131, 88, 7, 4, 1, 61, 88, 7, 
+    4, 1, 253, 166, 88, 7, 4, 1, 251, 74, 88, 7, 4, 1, 249, 68, 88, 7, 4, 1, 
+    76, 88, 7, 4, 1, 245, 14, 88, 7, 4, 1, 243, 209, 88, 7, 4, 1, 242, 67, 
+    88, 7, 4, 1, 74, 88, 7, 4, 1, 235, 150, 88, 7, 4, 1, 235, 29, 88, 7, 4, 
+    1, 156, 88, 7, 4, 1, 194, 88, 7, 4, 1, 230, 30, 88, 7, 4, 1, 78, 88, 7, 
+    4, 1, 226, 109, 88, 7, 4, 1, 224, 99, 88, 7, 4, 1, 153, 88, 7, 4, 1, 222, 
+    93, 88, 7, 4, 1, 217, 153, 88, 7, 4, 1, 69, 88, 7, 4, 1, 214, 105, 88, 7, 
+    4, 1, 212, 98, 88, 7, 4, 1, 211, 178, 88, 7, 4, 1, 211, 117, 88, 7, 4, 1, 
+    210, 159, 37, 7, 6, 1, 61, 37, 7, 6, 1, 253, 166, 37, 7, 6, 1, 251, 74, 
+    37, 7, 6, 1, 249, 68, 37, 7, 6, 1, 76, 37, 7, 6, 1, 245, 14, 37, 7, 6, 1, 
+    243, 209, 37, 7, 6, 1, 242, 67, 37, 7, 6, 1, 74, 37, 7, 6, 1, 235, 150, 
+    37, 7, 6, 1, 235, 29, 37, 7, 6, 1, 156, 37, 7, 6, 1, 194, 37, 7, 6, 1, 
+    230, 30, 37, 7, 6, 1, 78, 37, 7, 6, 1, 226, 109, 37, 7, 6, 1, 224, 99, 
+    37, 7, 6, 1, 153, 37, 7, 6, 1, 222, 93, 37, 7, 6, 1, 217, 153, 37, 7, 6, 
+    1, 69, 37, 7, 6, 1, 214, 105, 37, 7, 6, 1, 212, 98, 37, 7, 6, 1, 211, 
+    178, 37, 7, 6, 1, 211, 117, 37, 7, 6, 1, 210, 159, 37, 7, 4, 1, 61, 37, 
+    7, 4, 1, 253, 166, 37, 7, 4, 1, 251, 74, 37, 7, 4, 1, 249, 68, 37, 7, 4, 
+    1, 76, 37, 7, 4, 1, 245, 14, 37, 7, 4, 1, 243, 209, 37, 7, 4, 1, 242, 67, 
+    37, 7, 4, 1, 74, 37, 7, 4, 1, 235, 150, 37, 7, 4, 1, 235, 29, 37, 7, 4, 
+    1, 156, 37, 7, 4, 1, 194, 37, 7, 4, 1, 230, 30, 37, 7, 4, 1, 78, 37, 7, 
+    4, 1, 226, 109, 37, 7, 4, 1, 224, 99, 37, 7, 4, 1, 153, 37, 7, 4, 1, 222, 
+    93, 37, 7, 4, 1, 217, 153, 37, 7, 4, 1, 69, 37, 7, 4, 1, 214, 105, 37, 7, 
+    4, 1, 212, 98, 37, 7, 4, 1, 211, 178, 37, 7, 4, 1, 211, 117, 37, 7, 4, 1, 
+    210, 159, 37, 21, 210, 86, 152, 37, 54, 245, 175, 152, 37, 54, 215, 76, 
+    152, 37, 54, 216, 165, 152, 37, 54, 244, 13, 152, 37, 54, 244, 126, 152, 
+    37, 54, 219, 121, 152, 37, 54, 220, 121, 152, 37, 54, 245, 198, 152, 37, 
+    54, 228, 202, 152, 37, 54, 215, 73, 52, 37, 21, 111, 52, 37, 21, 105, 52, 
+    37, 21, 158, 52, 37, 21, 161, 52, 37, 21, 190, 52, 37, 21, 195, 52, 37, 
+    21, 199, 52, 37, 21, 196, 52, 37, 21, 201, 52, 37, 54, 216, 248, 152, 37, 
+    21, 210, 86, 93, 99, 193, 241, 51, 93, 99, 114, 241, 51, 93, 99, 193, 
+    213, 239, 93, 99, 114, 213, 239, 93, 99, 193, 215, 212, 248, 165, 241, 
+    51, 93, 99, 114, 215, 212, 248, 165, 241, 51, 93, 99, 193, 215, 212, 248, 
+    165, 213, 239, 93, 99, 114, 215, 212, 248, 165, 213, 239, 93, 99, 193, 
+    224, 27, 248, 165, 241, 51, 93, 99, 114, 224, 27, 248, 165, 241, 51, 93, 
+    99, 193, 224, 27, 248, 165, 213, 239, 93, 99, 114, 224, 27, 248, 165, 
+    213, 239, 93, 99, 193, 124, 22, 222, 254, 93, 99, 124, 193, 22, 44, 241, 
+    228, 93, 99, 124, 114, 22, 44, 232, 236, 93, 99, 114, 124, 22, 222, 254, 
+    93, 99, 193, 124, 22, 233, 52, 93, 99, 124, 193, 22, 43, 241, 228, 93, 
+    99, 124, 114, 22, 43, 232, 236, 93, 99, 114, 124, 22, 233, 52, 93, 99, 
+    193, 120, 22, 222, 254, 93, 99, 120, 193, 22, 44, 241, 228, 93, 99, 120, 
+    114, 22, 44, 232, 236, 93, 99, 114, 120, 22, 222, 254, 93, 99, 193, 120, 
+    22, 233, 52, 93, 99, 120, 193, 22, 43, 241, 228, 93, 99, 120, 114, 22, 
+    43, 232, 236, 93, 99, 114, 120, 22, 233, 52, 93, 99, 193, 67, 22, 222, 
+    254, 93, 99, 67, 193, 22, 44, 241, 228, 93, 99, 120, 114, 22, 44, 124, 
+    232, 236, 93, 99, 124, 114, 22, 44, 120, 232, 236, 93, 99, 67, 114, 22, 
+    44, 232, 236, 93, 99, 124, 193, 22, 44, 120, 241, 228, 93, 99, 120, 193, 
+    22, 44, 124, 241, 228, 93, 99, 114, 67, 22, 222, 254, 93, 99, 193, 67, 
+    22, 233, 52, 93, 99, 67, 193, 22, 43, 241, 228, 93, 99, 120, 114, 22, 43, 
+    124, 232, 236, 93, 99, 124, 114, 22, 43, 120, 232, 236, 93, 99, 67, 114, 
+    22, 43, 232, 236, 93, 99, 124, 193, 22, 43, 120, 241, 228, 93, 99, 120, 
+    193, 22, 43, 124, 241, 228, 93, 99, 114, 67, 22, 233, 52, 93, 99, 193, 
+    124, 22, 241, 51, 93, 99, 43, 114, 22, 44, 124, 232, 236, 93, 99, 44, 
+    114, 22, 43, 124, 232, 236, 93, 99, 124, 193, 22, 203, 241, 228, 93, 99, 
+    124, 114, 22, 203, 232, 236, 93, 99, 44, 193, 22, 43, 124, 241, 228, 93, 
+    99, 43, 193, 22, 44, 124, 241, 228, 93, 99, 114, 124, 22, 241, 51, 93, 
+    99, 193, 120, 22, 241, 51, 93, 99, 43, 114, 22, 44, 120, 232, 236, 93, 
+    99, 44, 114, 22, 43, 120, 232, 236, 93, 99, 120, 193, 22, 203, 241, 228, 
+    93, 99, 120, 114, 22, 203, 232, 236, 93, 99, 44, 193, 22, 43, 120, 241, 
+    228, 93, 99, 43, 193, 22, 44, 120, 241, 228, 93, 99, 114, 120, 22, 241, 
+    51, 93, 99, 193, 67, 22, 241, 51, 93, 99, 43, 114, 22, 44, 67, 232, 236, 
+    93, 99, 44, 114, 22, 43, 67, 232, 236, 93, 99, 67, 193, 22, 203, 241, 
+    228, 93, 99, 120, 114, 22, 124, 203, 232, 236, 93, 99, 124, 114, 22, 120, 
+    203, 232, 236, 93, 99, 67, 114, 22, 203, 232, 236, 93, 99, 43, 120, 114, 
+    22, 44, 124, 232, 236, 93, 99, 44, 120, 114, 22, 43, 124, 232, 236, 93, 
+    99, 43, 124, 114, 22, 44, 120, 232, 236, 93, 99, 44, 124, 114, 22, 43, 
+    120, 232, 236, 93, 99, 124, 193, 22, 120, 203, 241, 228, 93, 99, 120, 
+    193, 22, 124, 203, 241, 228, 93, 99, 44, 193, 22, 43, 67, 241, 228, 93, 
+    99, 43, 193, 22, 44, 67, 241, 228, 93, 99, 114, 67, 22, 241, 51, 93, 99, 
+    193, 52, 248, 165, 241, 51, 93, 99, 114, 52, 248, 165, 241, 51, 93, 99, 
+    193, 52, 248, 165, 213, 239, 93, 99, 114, 52, 248, 165, 213, 239, 93, 99, 
+    52, 241, 51, 93, 99, 52, 213, 239, 93, 99, 124, 219, 157, 22, 44, 246, 
+    121, 93, 99, 124, 52, 22, 44, 219, 156, 93, 99, 52, 124, 22, 222, 254, 
+    93, 99, 124, 219, 157, 22, 43, 246, 121, 93, 99, 124, 52, 22, 43, 219, 
+    156, 93, 99, 52, 124, 22, 233, 52, 93, 99, 120, 219, 157, 22, 44, 246, 
+    121, 93, 99, 120, 52, 22, 44, 219, 156, 93, 99, 52, 120, 22, 222, 254, 
+    93, 99, 120, 219, 157, 22, 43, 246, 121, 93, 99, 120, 52, 22, 43, 219, 
+    156, 93, 99, 52, 120, 22, 233, 52, 93, 99, 67, 219, 157, 22, 44, 246, 
+    121, 93, 99, 67, 52, 22, 44, 219, 156, 93, 99, 52, 67, 22, 222, 254, 93, 
+    99, 67, 219, 157, 22, 43, 246, 121, 93, 99, 67, 52, 22, 43, 219, 156, 93, 
+    99, 52, 67, 22, 233, 52, 93, 99, 124, 219, 157, 22, 203, 246, 121, 93, 
+    99, 124, 52, 22, 203, 219, 156, 93, 99, 52, 124, 22, 241, 51, 93, 99, 
+    120, 219, 157, 22, 203, 246, 121, 93, 99, 120, 52, 22, 203, 219, 156, 93, 
+    99, 52, 120, 22, 241, 51, 93, 99, 67, 219, 157, 22, 203, 246, 121, 93, 
+    99, 67, 52, 22, 203, 219, 156, 93, 99, 52, 67, 22, 241, 51, 93, 99, 193, 
+    254, 34, 124, 22, 222, 254, 93, 99, 193, 254, 34, 124, 22, 233, 52, 93, 
+    99, 193, 254, 34, 120, 22, 233, 52, 93, 99, 193, 254, 34, 120, 22, 222, 
+    254, 93, 99, 193, 248, 7, 214, 160, 44, 216, 43, 232, 114, 233, 52, 93, 
+    99, 193, 248, 7, 214, 160, 43, 216, 43, 232, 114, 222, 254, 93, 99, 193, 
+    248, 7, 249, 138, 93, 99, 193, 233, 52, 93, 99, 193, 214, 163, 93, 99, 
+    193, 222, 254, 93, 99, 193, 246, 114, 93, 99, 114, 233, 52, 93, 99, 114, 
+    214, 163, 93, 99, 114, 222, 254, 93, 99, 114, 246, 114, 93, 99, 193, 43, 
+    22, 114, 222, 254, 93, 99, 193, 120, 22, 114, 246, 114, 93, 99, 114, 43, 
+    22, 193, 222, 254, 93, 99, 114, 120, 22, 193, 246, 114, 214, 160, 163, 
+    251, 221, 232, 114, 123, 245, 197, 251, 221, 232, 114, 123, 224, 25, 251, 
+    221, 232, 114, 134, 245, 195, 251, 221, 232, 114, 163, 251, 221, 232, 
+    114, 244, 89, 245, 195, 251, 221, 232, 114, 134, 224, 23, 251, 221, 232, 
+    114, 220, 124, 245, 195, 251, 221, 243, 236, 251, 221, 43, 220, 124, 245, 
+    195, 251, 221, 43, 134, 224, 23, 251, 221, 43, 244, 89, 245, 195, 251, 
+    221, 43, 163, 251, 221, 43, 134, 245, 195, 251, 221, 43, 123, 224, 25, 
+    251, 221, 43, 123, 245, 197, 251, 221, 44, 163, 251, 221, 193, 220, 94, 
+    231, 87, 220, 94, 248, 170, 220, 94, 214, 160, 123, 245, 197, 251, 221, 
+    44, 123, 245, 197, 251, 221, 224, 29, 232, 114, 233, 52, 224, 29, 232, 
+    114, 222, 254, 224, 29, 214, 160, 233, 52, 224, 29, 214, 160, 43, 22, 
+    232, 114, 43, 22, 232, 114, 222, 254, 224, 29, 214, 160, 43, 22, 232, 
+    114, 222, 254, 224, 29, 214, 160, 43, 22, 214, 160, 44, 22, 232, 114, 
+    233, 52, 224, 29, 214, 160, 43, 22, 214, 160, 44, 22, 232, 114, 222, 254, 
+    224, 29, 214, 160, 222, 254, 224, 29, 214, 160, 44, 22, 232, 114, 233, 
+    52, 224, 29, 214, 160, 44, 22, 232, 114, 43, 22, 232, 114, 222, 254, 85, 
+    218, 236, 71, 218, 236, 71, 42, 2, 222, 185, 249, 167, 71, 42, 249, 195, 
+    85, 4, 218, 236, 42, 2, 203, 244, 113, 42, 2, 67, 244, 113, 42, 2, 226, 
+    148, 249, 134, 244, 113, 42, 2, 214, 160, 43, 216, 43, 232, 114, 44, 244, 
+    113, 42, 2, 214, 160, 44, 216, 43, 232, 114, 43, 244, 113, 42, 2, 248, 7, 
+    249, 134, 244, 113, 85, 4, 218, 236, 71, 4, 218, 236, 85, 223, 119, 71, 
+    223, 119, 85, 67, 223, 119, 71, 67, 223, 119, 85, 226, 10, 71, 226, 10, 
+    85, 214, 162, 215, 226, 71, 214, 162, 215, 226, 85, 214, 162, 4, 215, 
+    226, 71, 214, 162, 4, 215, 226, 85, 222, 250, 215, 226, 71, 222, 250, 
+    215, 226, 85, 222, 250, 4, 215, 226, 71, 222, 250, 4, 215, 226, 85, 222, 
+    250, 225, 11, 71, 222, 250, 225, 11, 85, 246, 113, 215, 226, 71, 246, 
+    113, 215, 226, 85, 246, 113, 4, 215, 226, 71, 246, 113, 4, 215, 226, 85, 
+    233, 48, 215, 226, 71, 233, 48, 215, 226, 85, 233, 48, 4, 215, 226, 71, 
+    233, 48, 4, 215, 226, 85, 233, 48, 225, 11, 71, 233, 48, 225, 11, 85, 
+    248, 0, 71, 248, 0, 71, 248, 1, 249, 195, 85, 4, 248, 0, 244, 97, 232, 
+    110, 71, 250, 43, 246, 126, 250, 43, 250, 44, 2, 67, 244, 113, 251, 119, 
+    85, 250, 43, 250, 44, 2, 43, 163, 251, 229, 250, 44, 2, 44, 163, 251, 
+    229, 250, 44, 2, 232, 114, 163, 251, 229, 250, 44, 2, 214, 160, 163, 251, 
+    229, 250, 44, 2, 214, 160, 44, 224, 29, 251, 229, 250, 44, 2, 254, 164, 
+    251, 96, 214, 160, 43, 224, 29, 251, 229, 43, 163, 85, 250, 43, 44, 163, 
+    85, 250, 43, 235, 201, 251, 121, 235, 201, 71, 250, 43, 214, 160, 163, 
+    235, 201, 71, 250, 43, 232, 114, 163, 235, 201, 71, 250, 43, 214, 160, 
+    43, 224, 29, 250, 41, 254, 33, 214, 160, 44, 224, 29, 250, 41, 254, 33, 
+    232, 114, 44, 224, 29, 250, 41, 254, 33, 232, 114, 43, 224, 29, 250, 41, 
+    254, 33, 214, 160, 163, 250, 43, 232, 114, 163, 250, 43, 85, 232, 114, 
+    44, 215, 226, 85, 232, 114, 43, 215, 226, 85, 214, 160, 43, 215, 226, 85, 
+    214, 160, 44, 215, 226, 71, 251, 121, 42, 2, 43, 163, 251, 229, 42, 2, 
+    44, 163, 251, 229, 42, 2, 214, 160, 43, 248, 7, 163, 251, 229, 42, 2, 
+    232, 114, 44, 248, 7, 163, 251, 229, 71, 42, 2, 67, 251, 240, 232, 219, 
+    71, 214, 162, 215, 227, 2, 247, 128, 214, 162, 215, 227, 2, 43, 163, 251, 
+    229, 214, 162, 215, 227, 2, 44, 163, 251, 229, 233, 91, 250, 43, 71, 42, 
+    2, 214, 160, 43, 224, 28, 71, 42, 2, 232, 114, 43, 224, 28, 71, 42, 2, 
+    232, 114, 44, 224, 28, 71, 42, 2, 214, 160, 44, 224, 28, 71, 250, 44, 2, 
+    214, 160, 43, 224, 28, 71, 250, 44, 2, 232, 114, 43, 224, 28, 71, 250, 
+    44, 2, 232, 114, 44, 224, 28, 71, 250, 44, 2, 214, 160, 44, 224, 28, 214, 
+    160, 43, 215, 226, 214, 160, 44, 215, 226, 232, 114, 43, 215, 226, 71, 
+    231, 87, 218, 236, 85, 231, 87, 218, 236, 71, 231, 87, 4, 218, 236, 85, 
+    231, 87, 4, 218, 236, 232, 114, 44, 215, 226, 85, 218, 39, 2, 223, 135, 
+    249, 255, 214, 194, 219, 62, 249, 230, 85, 218, 158, 71, 218, 158, 232, 
+    234, 216, 133, 218, 38, 253, 242, 228, 76, 248, 46, 228, 76, 249, 203, 
+    226, 167, 85, 217, 1, 71, 217, 1, 252, 164, 251, 171, 252, 164, 93, 2, 
+    250, 137, 252, 164, 93, 2, 211, 178, 222, 0, 214, 195, 2, 223, 163, 246, 
+    92, 240, 250, 252, 30, 71, 220, 4, 225, 104, 85, 220, 4, 225, 104, 220, 
+    89, 223, 52, 222, 189, 244, 63, 241, 235, 251, 121, 85, 43, 225, 10, 235, 
+    249, 85, 44, 225, 10, 235, 249, 71, 43, 225, 10, 235, 249, 71, 120, 225, 
+    10, 235, 249, 71, 44, 225, 10, 235, 249, 71, 124, 225, 10, 235, 249, 219, 
+    103, 22, 249, 137, 250, 227, 50, 223, 175, 50, 251, 247, 50, 251, 33, 
+    254, 110, 226, 149, 249, 138, 250, 119, 223, 40, 249, 139, 64, 232, 124, 
+    249, 139, 64, 235, 122, 218, 159, 22, 249, 144, 244, 176, 87, 255, 1, 
+    220, 91, 242, 29, 22, 219, 191, 225, 223, 87, 210, 254, 211, 69, 215, 
+    216, 31, 241, 230, 215, 216, 31, 233, 113, 215, 216, 31, 244, 104, 215, 
+    216, 31, 216, 134, 215, 216, 31, 211, 239, 215, 216, 31, 212, 40, 215, 
+    216, 31, 230, 120, 215, 216, 31, 245, 231, 212, 1, 64, 248, 26, 71, 243, 
+    247, 244, 198, 71, 219, 76, 244, 198, 85, 219, 76, 244, 198, 71, 218, 39, 
+    2, 223, 135, 244, 100, 224, 25, 230, 133, 233, 86, 224, 25, 230, 133, 
+    231, 59, 244, 146, 50, 245, 231, 231, 195, 50, 235, 44, 221, 222, 214, 
+    145, 229, 98, 225, 23, 254, 20, 217, 41, 243, 59, 251, 11, 233, 25, 213, 
+    150, 232, 244, 221, 193, 222, 21, 251, 0, 254, 50, 225, 55, 71, 250, 125, 
+    234, 84, 71, 250, 125, 224, 17, 71, 250, 125, 222, 197, 71, 250, 125, 
+    251, 239, 71, 250, 125, 234, 36, 71, 250, 125, 225, 235, 85, 250, 125, 
+    234, 84, 85, 250, 125, 224, 17, 85, 250, 125, 222, 197, 85, 250, 125, 
+    251, 239, 85, 250, 125, 234, 36, 85, 250, 125, 225, 235, 85, 219, 18, 
+    218, 51, 71, 241, 235, 218, 51, 71, 248, 1, 218, 51, 85, 249, 253, 218, 
+    51, 71, 219, 18, 218, 51, 85, 241, 235, 218, 51, 85, 248, 1, 218, 51, 71, 
+    249, 253, 218, 51, 240, 250, 218, 240, 224, 25, 228, 52, 245, 197, 228, 
+    52, 252, 81, 245, 197, 228, 47, 252, 81, 219, 120, 228, 47, 230, 62, 244, 
+    74, 50, 230, 62, 229, 193, 50, 230, 62, 220, 78, 50, 212, 9, 183, 249, 
+    138, 245, 228, 183, 249, 138, 214, 171, 223, 115, 87, 223, 115, 16, 31, 
+    215, 48, 225, 37, 223, 115, 16, 31, 215, 47, 225, 37, 223, 115, 16, 31, 
+    215, 46, 225, 37, 223, 115, 16, 31, 215, 45, 225, 37, 223, 115, 16, 31, 
+    215, 44, 225, 37, 223, 115, 16, 31, 215, 43, 225, 37, 223, 115, 16, 31, 
+    215, 42, 225, 37, 223, 115, 16, 31, 243, 57, 231, 143, 85, 214, 171, 223, 
+    115, 87, 223, 116, 226, 24, 87, 226, 0, 226, 24, 87, 225, 177, 226, 24, 
+    50, 211, 255, 87, 247, 249, 244, 197, 247, 249, 244, 196, 247, 249, 244, 
+    195, 247, 249, 244, 194, 247, 249, 244, 193, 247, 249, 244, 192, 71, 250, 
+    44, 2, 59, 222, 254, 71, 250, 44, 2, 113, 247, 126, 85, 250, 44, 2, 71, 
+    59, 222, 254, 85, 250, 44, 2, 113, 71, 247, 126, 230, 147, 31, 211, 69, 
+    230, 147, 31, 210, 253, 247, 232, 31, 242, 138, 211, 69, 247, 232, 31, 
+    233, 19, 210, 253, 247, 232, 31, 233, 19, 211, 69, 247, 232, 31, 242, 
+    138, 210, 253, 71, 244, 81, 85, 244, 81, 242, 29, 22, 225, 107, 254, 128, 
+    249, 136, 217, 236, 218, 166, 64, 254, 235, 221, 208, 254, 178, 244, 59, 
+    243, 67, 218, 166, 64, 241, 209, 253, 207, 87, 244, 70, 226, 130, 71, 
+    218, 158, 134, 232, 214, 249, 183, 222, 254, 134, 232, 214, 249, 183, 
+    233, 52, 212, 50, 50, 125, 213, 130, 50, 246, 118, 244, 146, 50, 246, 
+    118, 231, 195, 50, 235, 210, 244, 146, 22, 231, 195, 50, 231, 195, 22, 
+    244, 146, 50, 231, 195, 2, 218, 105, 50, 231, 195, 2, 218, 105, 22, 231, 
+    195, 22, 244, 146, 50, 67, 231, 195, 2, 218, 105, 50, 203, 231, 195, 2, 
+    218, 105, 50, 231, 87, 71, 250, 43, 231, 87, 85, 250, 43, 231, 87, 4, 71, 
+    250, 43, 231, 158, 87, 247, 175, 87, 214, 169, 225, 255, 87, 249, 239, 
+    243, 231, 214, 141, 229, 93, 250, 169, 226, 65, 235, 50, 213, 185, 250, 
+    101, 85, 230, 134, 232, 231, 220, 114, 220, 149, 224, 8, 220, 132, 219, 
+    57, 252, 167, 252, 134, 92, 234, 144, 71, 246, 101, 231, 190, 71, 246, 
+    101, 234, 84, 85, 246, 101, 231, 190, 85, 246, 101, 234, 84, 219, 63, 
+    211, 230, 219, 66, 218, 39, 252, 59, 249, 255, 223, 162, 85, 219, 62, 
+    216, 135, 250, 0, 22, 223, 162, 215, 94, 71, 220, 4, 225, 104, 215, 94, 
+    85, 220, 4, 225, 104, 71, 248, 1, 236, 7, 218, 236, 249, 133, 233, 97, 
+    247, 201, 250, 252, 226, 170, 225, 107, 250, 253, 219, 90, 241, 219, 2, 
+    71, 249, 138, 37, 249, 133, 233, 97, 250, 161, 228, 80, 245, 132, 254, 
+    149, 226, 195, 43, 212, 26, 215, 252, 85, 215, 55, 43, 212, 26, 215, 252, 
+    71, 215, 55, 43, 212, 26, 215, 252, 85, 43, 233, 98, 231, 58, 71, 43, 
+    233, 98, 231, 58, 246, 97, 219, 84, 50, 114, 71, 246, 113, 215, 226, 43, 
+    250, 8, 245, 132, 92, 222, 0, 244, 183, 248, 7, 236, 7, 71, 250, 44, 236, 
+    7, 85, 218, 236, 85, 215, 193, 223, 63, 43, 245, 131, 223, 63, 43, 245, 
+    130, 253, 219, 16, 31, 214, 145, 114, 250, 44, 2, 218, 105, 22, 113, 170, 
+    48, 225, 192, 222, 251, 235, 212, 225, 192, 233, 49, 235, 212, 225, 192, 
+    235, 200, 225, 192, 85, 249, 139, 226, 201, 220, 31, 220, 19, 219, 231, 
+    250, 69, 250, 234, 241, 164, 219, 128, 243, 68, 211, 230, 240, 227, 243, 
+    68, 2, 242, 19, 231, 178, 16, 31, 232, 235, 230, 120, 214, 195, 226, 201, 
+    242, 129, 244, 20, 244, 82, 236, 7, 241, 66, 244, 137, 222, 16, 42, 244, 
+    19, 249, 167, 219, 106, 240, 119, 219, 109, 225, 171, 2, 252, 167, 216, 
+    243, 235, 137, 252, 154, 87, 241, 238, 242, 140, 87, 243, 239, 224, 145, 
+    249, 111, 226, 201, 85, 218, 236, 71, 244, 82, 2, 203, 230, 229, 85, 218, 
+    106, 214, 160, 251, 225, 221, 195, 85, 221, 195, 232, 114, 251, 225, 221, 
+    195, 71, 221, 195, 71, 114, 250, 138, 79, 217, 2, 232, 160, 50, 217, 54, 
+    246, 96, 254, 200, 245, 127, 223, 160, 244, 93, 223, 160, 242, 22, 213, 
+    174, 242, 22, 211, 198, 242, 22, 232, 114, 44, 225, 201, 225, 201, 214, 
+    160, 44, 225, 201, 71, 228, 235, 85, 228, 235, 250, 138, 79, 114, 250, 
+    138, 79, 230, 89, 211, 178, 114, 230, 89, 211, 178, 252, 164, 211, 178, 
+    114, 252, 164, 211, 178, 226, 130, 26, 249, 138, 114, 26, 249, 138, 204, 
+    250, 183, 249, 138, 114, 204, 250, 183, 249, 138, 7, 249, 138, 220, 93, 
+    71, 7, 249, 138, 226, 130, 7, 249, 138, 231, 192, 249, 138, 218, 159, 64, 
+    248, 157, 244, 19, 217, 16, 253, 224, 244, 19, 252, 165, 253, 224, 114, 
+    244, 19, 252, 165, 253, 224, 244, 19, 249, 251, 253, 224, 85, 244, 19, 
+    225, 12, 218, 158, 71, 244, 19, 225, 12, 218, 158, 219, 13, 218, 113, 
+    226, 130, 71, 218, 158, 37, 71, 218, 158, 204, 250, 183, 85, 218, 158, 
+    85, 250, 183, 71, 218, 158, 226, 130, 85, 218, 158, 114, 226, 130, 85, 
+    218, 158, 225, 63, 218, 158, 220, 93, 71, 218, 158, 114, 253, 224, 204, 
+    250, 183, 253, 224, 245, 201, 218, 246, 253, 224, 245, 201, 225, 12, 85, 
+    218, 158, 245, 201, 225, 12, 225, 63, 218, 158, 219, 127, 225, 12, 85, 
+    218, 158, 245, 201, 225, 12, 223, 117, 85, 218, 158, 114, 245, 201, 225, 
+    12, 223, 117, 85, 218, 158, 215, 77, 225, 12, 85, 218, 158, 219, 122, 
+    225, 12, 253, 224, 217, 16, 253, 224, 204, 250, 183, 217, 16, 253, 224, 
+    114, 217, 16, 253, 224, 219, 127, 225, 160, 85, 22, 71, 244, 62, 85, 244, 
+    62, 71, 244, 62, 245, 201, 225, 160, 226, 130, 85, 244, 62, 37, 204, 250, 
+    183, 245, 201, 225, 12, 218, 158, 114, 217, 16, 225, 63, 253, 224, 219, 
+    64, 216, 106, 215, 219, 219, 64, 114, 250, 122, 219, 64, 219, 15, 114, 
+    219, 15, 252, 165, 253, 224, 245, 201, 217, 16, 224, 174, 253, 224, 114, 
+    245, 201, 217, 16, 224, 174, 253, 224, 249, 139, 79, 220, 93, 71, 250, 
+    43, 152, 92, 249, 139, 79, 232, 114, 44, 246, 94, 71, 218, 236, 214, 160, 
+    44, 246, 94, 71, 218, 236, 232, 114, 44, 220, 93, 71, 218, 236, 214, 160, 
+    44, 220, 93, 71, 218, 236, 85, 224, 16, 164, 226, 151, 71, 224, 16, 164, 
+    226, 151, 71, 245, 39, 164, 226, 151, 85, 248, 1, 230, 187, 71, 211, 178, 
+    114, 245, 39, 164, 87, 193, 67, 130, 231, 87, 67, 130, 114, 67, 130, 114, 
+    219, 157, 215, 94, 249, 228, 224, 1, 164, 226, 151, 114, 219, 157, 249, 
+    228, 224, 1, 164, 226, 151, 114, 52, 215, 94, 249, 228, 224, 1, 164, 226, 
+    151, 114, 52, 249, 228, 224, 1, 164, 226, 151, 114, 121, 219, 157, 249, 
+    228, 224, 1, 164, 226, 151, 114, 121, 52, 249, 228, 224, 1, 164, 226, 
+    151, 249, 99, 218, 142, 226, 19, 5, 226, 151, 114, 245, 39, 164, 226, 
+    151, 114, 241, 235, 245, 39, 164, 226, 151, 114, 85, 241, 234, 222, 189, 
+    114, 85, 241, 235, 251, 121, 244, 63, 241, 234, 222, 189, 244, 63, 241, 
+    235, 251, 121, 231, 87, 43, 226, 8, 226, 151, 231, 87, 44, 226, 8, 226, 
+    151, 231, 87, 244, 71, 43, 226, 8, 226, 151, 231, 87, 244, 71, 44, 226, 
+    8, 226, 151, 231, 87, 233, 48, 254, 118, 251, 166, 226, 151, 231, 87, 
+    222, 250, 254, 118, 251, 166, 226, 151, 114, 233, 48, 254, 118, 224, 1, 
+    164, 226, 151, 114, 222, 250, 254, 118, 224, 1, 164, 226, 151, 114, 233, 
+    48, 254, 118, 251, 166, 226, 151, 114, 222, 250, 254, 118, 251, 166, 226, 
+    151, 193, 43, 216, 7, 220, 55, 251, 166, 226, 151, 193, 44, 216, 7, 220, 
+    55, 251, 166, 226, 151, 231, 87, 43, 249, 107, 251, 166, 226, 151, 231, 
+    87, 44, 249, 107, 251, 166, 226, 151, 247, 212, 152, 37, 21, 111, 247, 
+    212, 152, 37, 21, 105, 247, 212, 152, 37, 21, 158, 247, 212, 152, 37, 21, 
+    161, 247, 212, 152, 37, 21, 190, 247, 212, 152, 37, 21, 195, 247, 212, 
+    152, 37, 21, 199, 247, 212, 152, 37, 21, 196, 247, 212, 152, 37, 21, 201, 
+    247, 212, 152, 37, 54, 216, 248, 247, 212, 37, 35, 21, 111, 247, 212, 37, 
+    35, 21, 105, 247, 212, 37, 35, 21, 158, 247, 212, 37, 35, 21, 161, 247, 
+    212, 37, 35, 21, 190, 247, 212, 37, 35, 21, 195, 247, 212, 37, 35, 21, 
+    199, 247, 212, 37, 35, 21, 196, 247, 212, 37, 35, 21, 201, 247, 212, 37, 
+    35, 54, 216, 248, 247, 212, 152, 37, 35, 21, 111, 247, 212, 152, 37, 35, 
+    21, 105, 247, 212, 152, 37, 35, 21, 158, 247, 212, 152, 37, 35, 21, 161, 
+    247, 212, 152, 37, 35, 21, 190, 247, 212, 152, 37, 35, 21, 195, 247, 212, 
+    152, 37, 35, 21, 199, 247, 212, 152, 37, 35, 21, 196, 247, 212, 152, 37, 
+    35, 21, 201, 247, 212, 152, 37, 35, 54, 216, 248, 114, 211, 246, 97, 75, 
+    114, 96, 50, 114, 230, 187, 50, 114, 247, 177, 50, 114, 219, 30, 245, 
+    228, 75, 114, 97, 75, 114, 228, 61, 245, 228, 75, 246, 106, 225, 14, 97, 
+    75, 114, 222, 186, 97, 75, 215, 225, 97, 75, 114, 215, 225, 97, 75, 248, 
+    163, 215, 225, 97, 75, 114, 248, 163, 215, 225, 97, 75, 85, 97, 75, 216, 
+    145, 216, 13, 97, 254, 1, 216, 145, 251, 181, 97, 254, 1, 85, 97, 254, 1, 
+    114, 85, 249, 99, 246, 112, 22, 97, 75, 114, 85, 249, 99, 214, 153, 22, 
+    97, 75, 218, 233, 85, 97, 75, 114, 249, 214, 85, 97, 75, 222, 249, 71, 
+    97, 75, 233, 47, 71, 97, 75, 252, 191, 220, 93, 71, 97, 75, 243, 249, 
+    220, 93, 71, 97, 75, 114, 232, 114, 222, 248, 71, 97, 75, 114, 214, 160, 
+    222, 248, 71, 97, 75, 228, 54, 232, 114, 222, 248, 71, 97, 75, 249, 107, 
+    232, 129, 228, 54, 214, 160, 222, 248, 71, 97, 75, 37, 114, 71, 97, 75, 
+    211, 252, 97, 75, 251, 228, 219, 30, 245, 228, 75, 251, 228, 97, 75, 251, 
+    228, 228, 61, 245, 228, 75, 114, 251, 228, 219, 30, 245, 228, 75, 114, 
+    251, 228, 97, 75, 114, 251, 228, 228, 61, 245, 228, 75, 217, 18, 97, 75, 
+    114, 217, 17, 97, 75, 212, 18, 97, 75, 114, 212, 18, 97, 75, 226, 176, 
+    97, 75, 52, 249, 107, 232, 129, 134, 247, 222, 254, 117, 71, 215, 227, 
+    249, 195, 4, 71, 215, 226, 225, 174, 204, 218, 64, 204, 218, 22, 43, 222, 
+    92, 252, 181, 248, 68, 44, 222, 92, 252, 181, 248, 68, 177, 2, 59, 235, 
+    222, 223, 53, 219, 49, 224, 204, 218, 64, 218, 23, 224, 204, 219, 48, 67, 
+    252, 149, 2, 203, 91, 11, 222, 231, 248, 6, 200, 247, 176, 11, 244, 183, 
+    248, 6, 92, 232, 152, 254, 126, 92, 232, 152, 226, 162, 71, 248, 1, 2, 
+    250, 181, 247, 128, 22, 2, 247, 128, 245, 178, 64, 226, 174, 214, 152, 
+    232, 114, 44, 249, 169, 2, 247, 128, 214, 160, 43, 249, 169, 2, 247, 128, 
+    43, 226, 132, 235, 72, 44, 226, 132, 235, 72, 243, 236, 226, 132, 235, 
+    72, 233, 91, 120, 217, 88, 233, 91, 124, 217, 88, 43, 22, 44, 52, 215, 
+    93, 43, 22, 44, 217, 88, 43, 230, 92, 200, 44, 217, 88, 200, 43, 217, 88, 
+    120, 217, 89, 2, 250, 44, 48, 232, 111, 247, 181, 251, 86, 203, 222, 135, 
+    71, 249, 213, 248, 0, 71, 249, 213, 248, 1, 2, 140, 216, 115, 71, 249, 
+    213, 248, 1, 2, 97, 216, 115, 71, 42, 2, 140, 216, 115, 71, 42, 2, 97, 
+    216, 115, 11, 43, 71, 42, 127, 11, 44, 71, 42, 127, 11, 43, 254, 118, 
+    127, 11, 44, 254, 118, 127, 11, 43, 52, 254, 118, 127, 11, 44, 52, 254, 
+    118, 127, 11, 43, 71, 216, 7, 220, 55, 127, 11, 44, 71, 216, 7, 220, 55, 
+    127, 11, 43, 244, 71, 226, 7, 11, 44, 244, 71, 226, 7, 214, 153, 224, 27, 
+    75, 246, 112, 224, 27, 75, 254, 96, 243, 105, 250, 44, 75, 250, 10, 243, 
+    105, 250, 44, 75, 44, 80, 2, 37, 225, 25, 200, 140, 75, 200, 97, 75, 200, 
+    43, 44, 75, 200, 140, 52, 75, 200, 97, 52, 75, 200, 43, 44, 52, 75, 200, 
+    140, 80, 243, 251, 130, 200, 97, 80, 243, 251, 130, 200, 140, 52, 80, 
+    243, 251, 130, 200, 97, 52, 80, 243, 251, 130, 200, 97, 218, 232, 75, 46, 
+    47, 251, 223, 46, 47, 247, 125, 46, 47, 246, 253, 46, 47, 247, 124, 46, 
+    47, 246, 189, 46, 47, 247, 60, 46, 47, 246, 252, 46, 47, 247, 123, 46, 
+    47, 246, 157, 46, 47, 247, 28, 46, 47, 246, 220, 46, 47, 247, 91, 46, 47, 
+    246, 188, 46, 47, 247, 59, 46, 47, 246, 251, 46, 47, 247, 122, 46, 47, 
+    246, 141, 46, 47, 247, 12, 46, 47, 246, 204, 46, 47, 247, 75, 46, 47, 
+    246, 172, 46, 47, 247, 43, 46, 47, 246, 235, 46, 47, 247, 106, 46, 47, 
+    246, 156, 46, 47, 247, 27, 46, 47, 246, 219, 46, 47, 247, 90, 46, 47, 
+    246, 187, 46, 47, 247, 58, 46, 47, 246, 250, 46, 47, 247, 121, 46, 47, 
+    246, 133, 46, 47, 247, 4, 46, 47, 246, 196, 46, 47, 247, 67, 46, 47, 246, 
+    164, 46, 47, 247, 35, 46, 47, 246, 227, 46, 47, 247, 98, 46, 47, 246, 
+    148, 46, 47, 247, 19, 46, 47, 246, 211, 46, 47, 247, 82, 46, 47, 246, 
+    179, 46, 47, 247, 50, 46, 47, 246, 242, 46, 47, 247, 113, 46, 47, 246, 
+    140, 46, 47, 247, 11, 46, 47, 246, 203, 46, 47, 247, 74, 46, 47, 246, 
+    171, 46, 47, 247, 42, 46, 47, 246, 234, 46, 47, 247, 105, 46, 47, 246, 
+    155, 46, 47, 247, 26, 46, 47, 246, 218, 46, 47, 247, 89, 46, 47, 246, 
+    186, 46, 47, 247, 57, 46, 47, 246, 249, 46, 47, 247, 120, 46, 47, 246, 
+    129, 46, 47, 247, 0, 46, 47, 246, 192, 46, 47, 247, 63, 46, 47, 246, 160, 
+    46, 47, 247, 31, 46, 47, 246, 223, 46, 47, 247, 94, 46, 47, 246, 144, 46, 
+    47, 247, 15, 46, 47, 246, 207, 46, 47, 247, 78, 46, 47, 246, 175, 46, 47, 
+    247, 46, 46, 47, 246, 238, 46, 47, 247, 109, 46, 47, 246, 136, 46, 47, 
+    247, 7, 46, 47, 246, 199, 46, 47, 247, 70, 46, 47, 246, 167, 46, 47, 247, 
+    38, 46, 47, 246, 230, 46, 47, 247, 101, 46, 47, 246, 151, 46, 47, 247, 
+    22, 46, 47, 246, 214, 46, 47, 247, 85, 46, 47, 246, 182, 46, 47, 247, 53, 
+    46, 47, 246, 245, 46, 47, 247, 116, 46, 47, 246, 132, 46, 47, 247, 3, 46, 
+    47, 246, 195, 46, 47, 247, 66, 46, 47, 246, 163, 46, 47, 247, 34, 46, 47, 
+    246, 226, 46, 47, 247, 97, 46, 47, 246, 147, 46, 47, 247, 18, 46, 47, 
+    246, 210, 46, 47, 247, 81, 46, 47, 246, 178, 46, 47, 247, 49, 46, 47, 
+    246, 241, 46, 47, 247, 112, 46, 47, 246, 139, 46, 47, 247, 10, 46, 47, 
+    246, 202, 46, 47, 247, 73, 46, 47, 246, 170, 46, 47, 247, 41, 46, 47, 
+    246, 233, 46, 47, 247, 104, 46, 47, 246, 154, 46, 47, 247, 25, 46, 47, 
+    246, 217, 46, 47, 247, 88, 46, 47, 246, 185, 46, 47, 247, 56, 46, 47, 
+    246, 248, 46, 47, 247, 119, 46, 47, 246, 127, 46, 47, 246, 254, 46, 47, 
+    246, 190, 46, 47, 247, 61, 46, 47, 246, 158, 46, 47, 247, 29, 46, 47, 
+    246, 221, 46, 47, 247, 92, 46, 47, 246, 142, 46, 47, 247, 13, 46, 47, 
+    246, 205, 46, 47, 247, 76, 46, 47, 246, 173, 46, 47, 247, 44, 46, 47, 
+    246, 236, 46, 47, 247, 107, 46, 47, 246, 134, 46, 47, 247, 5, 46, 47, 
+    246, 197, 46, 47, 247, 68, 46, 47, 246, 165, 46, 47, 247, 36, 46, 47, 
+    246, 228, 46, 47, 247, 99, 46, 47, 246, 149, 46, 47, 247, 20, 46, 47, 
+    246, 212, 46, 47, 247, 83, 46, 47, 246, 180, 46, 47, 247, 51, 46, 47, 
+    246, 243, 46, 47, 247, 114, 46, 47, 246, 130, 46, 47, 247, 1, 46, 47, 
+    246, 193, 46, 47, 247, 64, 46, 47, 246, 161, 46, 47, 247, 32, 46, 47, 
+    246, 224, 46, 47, 247, 95, 46, 47, 246, 145, 46, 47, 247, 16, 46, 47, 
+    246, 208, 46, 47, 247, 79, 46, 47, 246, 176, 46, 47, 247, 47, 46, 47, 
+    246, 239, 46, 47, 247, 110, 46, 47, 246, 137, 46, 47, 247, 8, 46, 47, 
+    246, 200, 46, 47, 247, 71, 46, 47, 246, 168, 46, 47, 247, 39, 46, 47, 
+    246, 231, 46, 47, 247, 102, 46, 47, 246, 152, 46, 47, 247, 23, 46, 47, 
+    246, 215, 46, 47, 247, 86, 46, 47, 246, 183, 46, 47, 247, 54, 46, 47, 
+    246, 246, 46, 47, 247, 117, 46, 47, 246, 128, 46, 47, 246, 255, 46, 47, 
+    246, 191, 46, 47, 247, 62, 46, 47, 246, 159, 46, 47, 247, 30, 46, 47, 
+    246, 222, 46, 47, 247, 93, 46, 47, 246, 143, 46, 47, 247, 14, 46, 47, 
+    246, 206, 46, 47, 247, 77, 46, 47, 246, 174, 46, 47, 247, 45, 46, 47, 
+    246, 237, 46, 47, 247, 108, 46, 47, 246, 135, 46, 47, 247, 6, 46, 47, 
+    246, 198, 46, 47, 247, 69, 46, 47, 246, 166, 46, 47, 247, 37, 46, 47, 
+    246, 229, 46, 47, 247, 100, 46, 47, 246, 150, 46, 47, 247, 21, 46, 47, 
+    246, 213, 46, 47, 247, 84, 46, 47, 246, 181, 46, 47, 247, 52, 46, 47, 
+    246, 244, 46, 47, 247, 115, 46, 47, 246, 131, 46, 47, 247, 2, 46, 47, 
+    246, 194, 46, 47, 247, 65, 46, 47, 246, 162, 46, 47, 247, 33, 46, 47, 
+    246, 225, 46, 47, 247, 96, 46, 47, 246, 146, 46, 47, 247, 17, 46, 47, 
+    246, 209, 46, 47, 247, 80, 46, 47, 246, 177, 46, 47, 247, 48, 46, 47, 
+    246, 240, 46, 47, 247, 111, 46, 47, 246, 138, 46, 47, 247, 9, 46, 47, 
+    246, 201, 46, 47, 247, 72, 46, 47, 246, 169, 46, 47, 247, 40, 46, 47, 
+    246, 232, 46, 47, 247, 103, 46, 47, 246, 153, 46, 47, 247, 24, 46, 47, 
+    246, 216, 46, 47, 247, 87, 46, 47, 246, 184, 46, 47, 247, 55, 46, 47, 
+    246, 247, 46, 47, 247, 118, 97, 215, 58, 80, 2, 67, 91, 97, 215, 58, 80, 
+    2, 52, 67, 91, 140, 52, 80, 2, 67, 91, 97, 52, 80, 2, 67, 91, 43, 44, 52, 
+    80, 2, 67, 91, 97, 215, 58, 80, 243, 251, 130, 140, 52, 80, 243, 251, 
+    130, 97, 52, 80, 243, 251, 130, 246, 112, 80, 2, 203, 91, 214, 153, 80, 
+    2, 203, 91, 214, 153, 215, 212, 75, 246, 112, 215, 212, 75, 140, 52, 248, 
+    165, 75, 97, 52, 248, 165, 75, 140, 215, 212, 248, 165, 75, 97, 215, 212, 
+    248, 165, 75, 97, 215, 58, 215, 212, 248, 165, 75, 97, 80, 2, 246, 126, 
+    218, 141, 214, 153, 80, 216, 43, 130, 246, 112, 80, 216, 43, 130, 97, 80, 
+    2, 217, 79, 2, 67, 91, 97, 80, 2, 217, 79, 2, 52, 67, 91, 97, 215, 58, 
+    80, 2, 217, 78, 97, 215, 58, 80, 2, 217, 79, 2, 67, 91, 97, 215, 58, 80, 
+    2, 217, 79, 2, 52, 67, 91, 140, 254, 3, 97, 254, 3, 140, 52, 254, 3, 97, 
+    52, 254, 3, 140, 80, 216, 43, 85, 248, 0, 97, 80, 216, 43, 85, 248, 0, 
+    140, 80, 243, 251, 252, 149, 216, 43, 85, 248, 0, 97, 80, 243, 251, 252, 
+    149, 216, 43, 85, 248, 0, 228, 61, 212, 9, 22, 219, 30, 245, 228, 75, 
+    228, 61, 245, 228, 22, 219, 30, 212, 9, 75, 228, 61, 212, 9, 80, 2, 103, 
+    228, 61, 245, 228, 80, 2, 103, 219, 30, 245, 228, 80, 2, 103, 219, 30, 
+    212, 9, 80, 2, 103, 228, 61, 212, 9, 80, 22, 228, 61, 245, 228, 75, 228, 
+    61, 245, 228, 80, 22, 219, 30, 245, 228, 75, 219, 30, 245, 228, 80, 22, 
+    219, 30, 212, 9, 75, 219, 30, 212, 9, 80, 22, 228, 61, 212, 9, 75, 222, 
+    231, 248, 7, 249, 133, 244, 183, 248, 6, 244, 183, 248, 7, 249, 133, 222, 
+    231, 248, 6, 219, 30, 245, 228, 80, 249, 133, 228, 61, 245, 228, 75, 228, 
+    61, 245, 228, 80, 249, 133, 219, 30, 245, 228, 75, 244, 183, 248, 7, 249, 
+    133, 228, 61, 245, 228, 75, 222, 231, 248, 7, 249, 133, 219, 30, 245, 
+    228, 75, 228, 61, 245, 228, 80, 249, 133, 228, 61, 212, 9, 75, 228, 61, 
+    212, 9, 80, 249, 133, 228, 61, 245, 228, 75, 212, 36, 80, 225, 10, 247, 
+    203, 222, 254, 80, 225, 10, 97, 216, 189, 249, 98, 214, 152, 80, 225, 10, 
+    97, 216, 189, 249, 98, 246, 111, 80, 225, 10, 246, 112, 216, 189, 249, 
+    98, 233, 43, 80, 225, 10, 246, 112, 216, 189, 249, 98, 222, 244, 222, 
+    247, 254, 34, 250, 10, 75, 233, 46, 254, 34, 254, 96, 75, 216, 15, 254, 
+    34, 254, 96, 75, 251, 183, 254, 34, 254, 96, 75, 216, 15, 254, 34, 250, 
+    10, 80, 2, 230, 186, 216, 15, 254, 34, 254, 96, 80, 2, 225, 25, 232, 114, 
+    44, 220, 154, 250, 10, 75, 232, 114, 43, 220, 154, 254, 96, 75, 254, 96, 
+    250, 8, 250, 44, 75, 250, 10, 250, 8, 250, 44, 75, 97, 80, 72, 219, 253, 
+    140, 75, 140, 80, 72, 219, 253, 97, 75, 219, 253, 97, 80, 72, 140, 75, 
+    97, 80, 2, 96, 51, 140, 80, 2, 96, 51, 97, 80, 216, 140, 211, 178, 43, 
+    44, 80, 216, 140, 4, 250, 43, 214, 153, 215, 58, 80, 243, 251, 4, 250, 
+    43, 43, 252, 147, 120, 44, 252, 147, 124, 242, 5, 43, 252, 147, 124, 44, 
+    252, 147, 120, 242, 5, 120, 252, 147, 44, 124, 252, 147, 43, 242, 5, 120, 
+    252, 147, 43, 124, 252, 147, 44, 242, 5, 43, 252, 147, 120, 44, 252, 147, 
+    120, 242, 5, 120, 252, 147, 44, 124, 252, 147, 44, 242, 5, 43, 252, 147, 
+    124, 44, 252, 147, 124, 242, 5, 120, 252, 147, 43, 124, 252, 147, 43, 
+    242, 5, 140, 242, 6, 2, 252, 147, 120, 216, 43, 130, 97, 242, 6, 2, 252, 
+    147, 120, 216, 43, 130, 214, 153, 242, 6, 2, 252, 147, 44, 216, 43, 130, 
+    246, 112, 242, 6, 2, 252, 147, 44, 216, 43, 130, 140, 242, 6, 2, 252, 
+    147, 124, 216, 43, 130, 97, 242, 6, 2, 252, 147, 124, 216, 43, 130, 214, 
+    153, 242, 6, 2, 252, 147, 43, 216, 43, 130, 246, 112, 242, 6, 2, 252, 
+    147, 43, 216, 43, 130, 140, 242, 6, 2, 252, 147, 120, 243, 251, 130, 97, 
+    242, 6, 2, 252, 147, 120, 243, 251, 130, 214, 153, 242, 6, 2, 252, 147, 
+    44, 243, 251, 130, 246, 112, 242, 6, 2, 252, 147, 44, 243, 251, 130, 140, 
+    242, 6, 2, 252, 147, 124, 243, 251, 130, 97, 242, 6, 2, 252, 147, 124, 
+    243, 251, 130, 214, 153, 242, 6, 2, 252, 147, 43, 243, 251, 130, 246, 
+    112, 242, 6, 2, 252, 147, 43, 243, 251, 130, 140, 242, 6, 2, 252, 147, 
+    120, 72, 140, 242, 6, 2, 252, 147, 246, 114, 214, 153, 242, 6, 2, 252, 
+    147, 43, 252, 38, 214, 153, 242, 6, 2, 252, 147, 222, 254, 97, 242, 6, 2, 
+    252, 147, 120, 72, 97, 242, 6, 2, 252, 147, 246, 114, 246, 112, 242, 6, 
+    2, 252, 147, 43, 252, 38, 246, 112, 242, 6, 2, 252, 147, 222, 254, 140, 
+    242, 6, 2, 252, 147, 120, 72, 97, 242, 6, 2, 252, 147, 214, 163, 140, 
+    242, 6, 2, 252, 147, 124, 72, 97, 242, 6, 2, 252, 147, 246, 114, 97, 242, 
+    6, 2, 252, 147, 120, 72, 140, 242, 6, 2, 252, 147, 214, 163, 97, 242, 6, 
+    2, 252, 147, 124, 72, 140, 242, 6, 2, 252, 147, 246, 114, 140, 242, 6, 2, 
+    252, 147, 120, 72, 200, 248, 164, 140, 242, 6, 2, 252, 147, 124, 252, 51, 
+    200, 248, 164, 97, 242, 6, 2, 252, 147, 120, 72, 200, 248, 164, 97, 242, 
+    6, 2, 252, 147, 124, 252, 51, 200, 248, 164, 214, 153, 242, 6, 2, 252, 
+    147, 43, 252, 38, 246, 112, 242, 6, 2, 252, 147, 222, 254, 246, 112, 242, 
+    6, 2, 252, 147, 43, 252, 38, 214, 153, 242, 6, 2, 252, 147, 222, 254, 44, 
+    52, 80, 2, 222, 185, 241, 242, 245, 106, 5, 72, 97, 75, 216, 90, 226, 
+    172, 72, 97, 75, 140, 80, 72, 216, 90, 226, 171, 97, 80, 72, 216, 90, 
+    226, 171, 97, 80, 72, 254, 156, 128, 112, 233, 21, 72, 140, 75, 140, 80, 
+    216, 140, 233, 20, 242, 137, 72, 97, 75, 218, 65, 72, 97, 75, 140, 80, 
+    216, 140, 218, 64, 218, 23, 72, 140, 75, 43, 244, 99, 217, 78, 44, 244, 
+    99, 217, 78, 120, 244, 99, 217, 78, 124, 244, 99, 217, 78, 215, 212, 67, 
+    252, 149, 248, 68, 210, 160, 189, 218, 244, 210, 160, 189, 215, 49, 249, 
+    234, 43, 71, 249, 107, 127, 44, 71, 249, 107, 127, 43, 71, 226, 7, 44, 
+    71, 226, 7, 210, 160, 189, 43, 236, 22, 127, 210, 160, 189, 44, 236, 22, 
+    127, 210, 160, 189, 43, 251, 250, 127, 210, 160, 189, 44, 251, 250, 127, 
+    43, 42, 251, 166, 2, 214, 183, 44, 42, 251, 166, 2, 214, 183, 43, 42, 
+    251, 166, 2, 216, 116, 236, 7, 216, 15, 249, 168, 44, 42, 251, 166, 2, 
+    216, 116, 236, 7, 251, 183, 249, 168, 43, 42, 251, 166, 2, 216, 116, 236, 
+    7, 251, 183, 249, 168, 44, 42, 251, 166, 2, 216, 116, 236, 7, 216, 15, 
+    249, 168, 43, 254, 118, 251, 166, 2, 247, 128, 44, 254, 118, 251, 166, 2, 
+    247, 128, 43, 254, 34, 233, 21, 127, 44, 254, 34, 242, 137, 127, 52, 43, 
+    254, 34, 242, 137, 127, 52, 44, 254, 34, 233, 21, 127, 43, 85, 216, 7, 
+    220, 55, 127, 44, 85, 216, 7, 220, 55, 127, 246, 126, 244, 143, 67, 210, 
+    35, 232, 219, 231, 93, 254, 118, 226, 174, 233, 52, 44, 254, 118, 214, 
+    12, 2, 218, 236, 231, 93, 44, 254, 118, 2, 247, 128, 254, 118, 2, 222, 
+    94, 235, 222, 255, 12, 254, 117, 219, 1, 254, 118, 226, 174, 233, 52, 
+    219, 1, 254, 118, 226, 174, 214, 163, 215, 94, 254, 117, 223, 52, 254, 
+    117, 254, 118, 2, 214, 183, 223, 52, 254, 118, 2, 214, 183, 226, 252, 
+    254, 118, 226, 174, 214, 163, 226, 252, 254, 118, 226, 174, 246, 114, 
+    231, 93, 254, 118, 2, 204, 254, 13, 245, 148, 236, 7, 80, 225, 10, 120, 
+    22, 222, 254, 231, 93, 254, 118, 2, 204, 254, 13, 245, 148, 236, 7, 80, 
+    225, 10, 120, 22, 233, 52, 231, 93, 254, 118, 2, 204, 254, 13, 245, 148, 
+    236, 7, 80, 225, 10, 124, 22, 222, 254, 231, 93, 254, 118, 2, 204, 254, 
+    13, 245, 148, 236, 7, 80, 225, 10, 124, 22, 233, 52, 231, 93, 254, 118, 
+    2, 204, 254, 13, 245, 148, 236, 7, 80, 225, 10, 44, 22, 214, 163, 231, 
+    93, 254, 118, 2, 204, 254, 13, 245, 148, 236, 7, 80, 225, 10, 43, 22, 
+    214, 163, 231, 93, 254, 118, 2, 204, 254, 13, 245, 148, 236, 7, 80, 225, 
+    10, 44, 22, 246, 114, 231, 93, 254, 118, 2, 204, 254, 13, 245, 148, 236, 
+    7, 80, 225, 10, 43, 22, 246, 114, 223, 52, 245, 160, 220, 129, 245, 160, 
+    220, 130, 2, 226, 127, 245, 160, 220, 130, 2, 4, 250, 44, 48, 245, 160, 
+    220, 130, 2, 44, 80, 48, 245, 160, 220, 130, 2, 43, 80, 48, 250, 44, 2, 
+    203, 130, 37, 67, 130, 37, 226, 11, 37, 223, 53, 219, 48, 37, 225, 174, 
+    250, 44, 247, 181, 251, 86, 203, 252, 149, 22, 216, 15, 163, 247, 181, 
+    251, 86, 67, 130, 250, 44, 2, 218, 25, 211, 178, 37, 254, 95, 247, 177, 
+    50, 120, 80, 216, 140, 250, 43, 37, 71, 251, 121, 37, 251, 121, 37, 233, 
+    20, 37, 242, 136, 250, 44, 2, 4, 250, 44, 216, 43, 216, 197, 222, 254, 
+    250, 44, 2, 113, 203, 218, 93, 216, 43, 216, 197, 222, 254, 92, 222, 231, 
+    248, 7, 219, 97, 92, 244, 183, 248, 7, 219, 97, 92, 253, 224, 92, 4, 250, 
+    43, 92, 218, 236, 113, 235, 71, 218, 234, 215, 227, 2, 59, 48, 215, 227, 
+    2, 214, 183, 222, 94, 236, 7, 215, 226, 215, 227, 2, 220, 136, 253, 215, 
+    251, 182, 44, 215, 227, 72, 43, 215, 226, 43, 215, 227, 252, 38, 67, 130, 
+    67, 252, 149, 252, 38, 44, 215, 226, 251, 173, 2, 43, 163, 251, 229, 251, 
+    173, 2, 44, 163, 251, 229, 85, 251, 172, 30, 2, 43, 163, 251, 229, 30, 2, 
+    44, 163, 251, 229, 71, 240, 243, 85, 240, 243, 43, 211, 244, 244, 143, 
+    44, 211, 244, 244, 143, 43, 52, 211, 244, 244, 143, 44, 52, 211, 244, 
+    244, 143, 235, 255, 235, 241, 216, 113, 115, 235, 241, 235, 242, 229, 
+    107, 2, 67, 130, 246, 120, 230, 92, 42, 2, 249, 189, 226, 131, 235, 253, 
+    253, 245, 219, 221, 224, 183, 245, 106, 5, 22, 219, 99, 226, 11, 245, 
+    106, 5, 22, 219, 99, 226, 12, 2, 216, 90, 48, 240, 111, 216, 43, 22, 219, 
+    99, 226, 11, 242, 190, 218, 157, 216, 186, 246, 113, 215, 227, 2, 43, 
+    163, 251, 229, 246, 113, 215, 227, 2, 44, 163, 251, 229, 85, 248, 1, 2, 
+    124, 75, 85, 232, 110, 71, 250, 44, 2, 124, 75, 85, 250, 44, 2, 124, 75, 
+    245, 93, 71, 218, 236, 245, 93, 85, 218, 236, 245, 93, 71, 248, 0, 245, 
+    93, 85, 248, 0, 245, 93, 71, 250, 43, 245, 93, 85, 250, 43, 222, 134, 
+    223, 53, 219, 49, 226, 171, 219, 49, 2, 226, 127, 223, 53, 219, 49, 2, 
+    203, 91, 252, 1, 219, 48, 252, 1, 223, 53, 219, 48, 52, 225, 25, 215, 
+    212, 225, 25, 233, 48, 249, 99, 254, 118, 127, 222, 250, 249, 99, 254, 
+    118, 127, 216, 79, 230, 184, 230, 29, 37, 59, 226, 171, 230, 29, 37, 96, 
+    226, 171, 230, 29, 37, 30, 226, 171, 230, 29, 214, 176, 226, 172, 2, 247, 
+    128, 230, 29, 214, 176, 226, 172, 2, 225, 25, 230, 29, 42, 235, 206, 226, 
+    171, 230, 29, 42, 214, 176, 226, 171, 113, 232, 152, 22, 226, 171, 113, 
+    232, 152, 177, 226, 171, 230, 29, 30, 226, 171, 230, 159, 113, 218, 44, 
+    218, 42, 2, 235, 218, 224, 27, 235, 219, 226, 171, 244, 107, 226, 3, 235, 
+    218, 235, 219, 2, 52, 91, 235, 219, 253, 181, 2, 219, 97, 250, 40, 243, 
+    233, 254, 96, 235, 216, 232, 220, 235, 217, 2, 223, 118, 225, 241, 254, 
+    10, 225, 4, 232, 220, 235, 217, 2, 220, 154, 225, 241, 254, 10, 225, 4, 
+    232, 220, 235, 217, 228, 57, 236, 1, 216, 197, 225, 4, 235, 219, 254, 10, 
+    116, 225, 14, 226, 171, 224, 21, 235, 219, 226, 171, 235, 219, 2, 140, 
+    80, 2, 103, 235, 219, 2, 30, 50, 235, 219, 2, 235, 205, 235, 219, 2, 214, 
+    175, 235, 219, 2, 226, 127, 235, 219, 2, 214, 183, 235, 72, 233, 91, 43, 
+    215, 227, 226, 171, 210, 160, 189, 221, 203, 249, 217, 210, 160, 189, 
+    221, 203, 225, 59, 210, 160, 189, 221, 203, 224, 179, 96, 5, 2, 4, 250, 
+    44, 48, 96, 5, 2, 250, 39, 255, 24, 48, 96, 5, 2, 216, 90, 48, 96, 5, 2, 
+    59, 51, 96, 5, 2, 216, 90, 51, 96, 5, 2, 218, 66, 105, 96, 5, 2, 85, 215, 
+    226, 230, 187, 5, 2, 249, 228, 48, 230, 187, 5, 2, 59, 51, 230, 187, 5, 
+    2, 244, 183, 247, 126, 230, 187, 5, 2, 222, 231, 247, 126, 96, 5, 236, 7, 
+    43, 163, 250, 43, 96, 5, 236, 7, 44, 163, 250, 43, 213, 254, 177, 249, 
+    139, 224, 183, 230, 89, 5, 2, 59, 48, 230, 89, 5, 2, 214, 183, 220, 151, 
+    224, 184, 2, 251, 183, 250, 7, 219, 79, 224, 183, 230, 89, 5, 236, 7, 43, 
+    163, 250, 43, 230, 89, 5, 236, 7, 44, 163, 250, 43, 37, 230, 89, 5, 2, 
+    250, 39, 255, 23, 230, 89, 5, 236, 7, 52, 250, 43, 37, 247, 177, 50, 96, 
+    5, 236, 7, 215, 226, 230, 187, 5, 236, 7, 215, 226, 230, 89, 5, 236, 7, 
+    215, 226, 235, 213, 224, 183, 222, 245, 235, 213, 224, 183, 210, 160, 
+    189, 223, 93, 249, 217, 254, 142, 177, 249, 173, 235, 206, 2, 247, 128, 
+    214, 176, 2, 230, 187, 50, 214, 176, 2, 226, 127, 235, 206, 2, 226, 127, 
+    235, 206, 2, 232, 152, 254, 126, 214, 176, 2, 232, 152, 226, 162, 214, 
+    176, 72, 235, 205, 235, 206, 72, 214, 175, 214, 176, 72, 252, 149, 72, 
+    235, 205, 235, 206, 72, 252, 149, 72, 214, 175, 214, 176, 252, 38, 22, 
+    235, 71, 2, 214, 175, 235, 206, 252, 38, 22, 235, 71, 2, 235, 205, 250, 
+    8, 214, 176, 2, 220, 135, 250, 8, 235, 206, 2, 220, 135, 52, 42, 235, 
+    205, 52, 42, 214, 175, 250, 8, 214, 176, 2, 220, 136, 22, 219, 79, 224, 
+    183, 232, 152, 22, 2, 59, 48, 232, 152, 177, 2, 59, 48, 52, 232, 152, 
+    254, 126, 52, 232, 152, 226, 162, 113, 235, 207, 232, 152, 254, 126, 113, 
+    235, 207, 232, 152, 226, 162, 219, 87, 233, 91, 226, 162, 219, 87, 233, 
+    91, 254, 126, 232, 152, 177, 226, 125, 232, 152, 254, 126, 232, 152, 22, 
+    2, 230, 229, 218, 141, 232, 152, 177, 2, 230, 229, 218, 141, 232, 152, 
+    22, 2, 203, 248, 164, 232, 152, 177, 2, 203, 248, 164, 232, 152, 22, 2, 
+    52, 226, 127, 232, 152, 22, 2, 214, 183, 232, 152, 22, 2, 52, 214, 183, 
+    4, 213, 251, 2, 214, 183, 232, 152, 177, 2, 52, 226, 127, 232, 152, 177, 
+    2, 52, 214, 183, 210, 160, 189, 247, 137, 254, 87, 210, 160, 189, 223, 
+    151, 254, 87, 245, 106, 5, 2, 59, 51, 240, 111, 2, 59, 48, 215, 212, 203, 
+    252, 149, 2, 52, 67, 91, 215, 212, 203, 252, 149, 2, 215, 212, 67, 91, 
+    216, 90, 226, 172, 2, 59, 48, 216, 90, 226, 172, 2, 222, 231, 247, 126, 
+    219, 164, 230, 187, 219, 163, 249, 207, 2, 59, 48, 245, 106, 2, 253, 224, 
+    254, 156, 128, 216, 43, 2, 250, 39, 255, 23, 254, 56, 128, 177, 128, 112, 
+    245, 106, 5, 72, 96, 50, 96, 5, 72, 245, 106, 50, 245, 106, 5, 72, 216, 
+    90, 226, 171, 52, 249, 235, 245, 107, 113, 249, 202, 245, 106, 219, 178, 
+    134, 249, 202, 245, 106, 219, 178, 245, 106, 5, 2, 113, 170, 72, 22, 113, 
+    170, 51, 245, 102, 2, 244, 19, 170, 48, 233, 21, 2, 250, 44, 235, 222, 
+    242, 137, 2, 250, 44, 235, 222, 233, 21, 2, 224, 16, 164, 48, 242, 137, 
+    2, 224, 16, 164, 48, 233, 21, 177, 219, 99, 128, 112, 242, 137, 177, 219, 
+    99, 128, 112, 233, 21, 177, 219, 99, 128, 216, 43, 2, 59, 235, 222, 242, 
+    137, 177, 219, 99, 128, 216, 43, 2, 59, 235, 222, 233, 21, 177, 219, 99, 
+    128, 216, 43, 2, 59, 48, 242, 137, 177, 219, 99, 128, 216, 43, 2, 59, 48, 
+    233, 21, 177, 219, 99, 128, 216, 43, 2, 59, 72, 222, 254, 242, 137, 177, 
+    219, 99, 128, 216, 43, 2, 59, 72, 233, 52, 233, 21, 177, 254, 57, 242, 
+    137, 177, 254, 57, 233, 21, 22, 219, 155, 228, 57, 128, 112, 242, 137, 
+    22, 219, 155, 228, 57, 128, 112, 233, 21, 22, 228, 57, 254, 57, 242, 137, 
+    22, 228, 57, 254, 57, 233, 21, 72, 246, 119, 128, 72, 242, 136, 242, 137, 
+    72, 246, 119, 128, 72, 233, 20, 233, 21, 72, 219, 164, 177, 245, 107, 
+    242, 137, 72, 219, 164, 177, 245, 107, 233, 21, 72, 219, 164, 72, 242, 
+    136, 242, 137, 72, 219, 164, 72, 233, 20, 233, 21, 72, 242, 137, 72, 246, 
+    119, 245, 107, 242, 137, 72, 233, 21, 72, 246, 119, 245, 107, 233, 21, 
+    72, 219, 99, 128, 72, 242, 137, 72, 219, 99, 245, 107, 242, 137, 72, 219, 
+    99, 128, 72, 233, 21, 72, 219, 99, 245, 107, 219, 99, 128, 216, 43, 177, 
+    233, 20, 219, 99, 128, 216, 43, 177, 242, 136, 219, 99, 128, 216, 43, 
+    177, 233, 21, 2, 59, 235, 222, 219, 99, 128, 216, 43, 177, 242, 137, 2, 
+    59, 235, 222, 246, 119, 128, 216, 43, 177, 233, 20, 246, 119, 128, 216, 
+    43, 177, 242, 136, 246, 119, 219, 99, 128, 216, 43, 177, 233, 20, 246, 
+    119, 219, 99, 128, 216, 43, 177, 242, 136, 219, 164, 177, 233, 20, 219, 
+    164, 177, 242, 136, 219, 164, 72, 233, 21, 72, 245, 106, 50, 219, 164, 
+    72, 242, 137, 72, 245, 106, 50, 52, 229, 96, 233, 20, 52, 229, 96, 242, 
+    136, 52, 229, 96, 233, 21, 2, 214, 183, 242, 137, 226, 125, 233, 20, 242, 
+    137, 252, 38, 233, 20, 233, 21, 250, 8, 251, 86, 249, 100, 242, 137, 250, 
+    8, 251, 86, 249, 100, 233, 21, 250, 8, 251, 86, 249, 101, 72, 219, 99, 
+    245, 107, 242, 137, 250, 8, 251, 86, 249, 101, 72, 219, 99, 245, 107, 
+    219, 80, 216, 201, 233, 89, 216, 201, 219, 80, 216, 202, 177, 128, 112, 
+    233, 89, 216, 202, 177, 128, 112, 245, 106, 5, 2, 251, 116, 48, 224, 206, 
+    72, 219, 155, 245, 106, 50, 218, 57, 72, 219, 155, 245, 106, 50, 224, 
+    206, 72, 219, 155, 228, 57, 128, 112, 218, 57, 72, 219, 155, 228, 57, 
+    128, 112, 224, 206, 72, 245, 106, 50, 218, 57, 72, 245, 106, 50, 224, 
+    206, 72, 228, 57, 128, 112, 218, 57, 72, 228, 57, 128, 112, 224, 206, 72, 
+    254, 156, 128, 112, 218, 57, 72, 254, 156, 128, 112, 224, 206, 72, 228, 
+    57, 254, 156, 128, 112, 218, 57, 72, 228, 57, 254, 156, 128, 112, 52, 
+    224, 205, 52, 218, 56, 218, 65, 2, 247, 128, 218, 23, 2, 247, 128, 218, 
+    65, 2, 96, 5, 51, 218, 23, 2, 96, 5, 51, 218, 65, 2, 230, 89, 5, 51, 218, 
+    23, 2, 230, 89, 5, 51, 218, 65, 64, 177, 128, 216, 43, 2, 59, 48, 218, 
+    23, 64, 177, 128, 216, 43, 2, 59, 48, 218, 65, 64, 72, 245, 106, 50, 218, 
+    23, 64, 72, 245, 106, 50, 218, 65, 64, 72, 216, 90, 226, 171, 218, 23, 
+    64, 72, 216, 90, 226, 171, 218, 65, 64, 72, 254, 156, 128, 112, 218, 23, 
+    64, 72, 254, 156, 128, 112, 218, 65, 64, 72, 228, 57, 128, 112, 218, 23, 
+    64, 72, 228, 57, 128, 112, 42, 43, 204, 93, 226, 171, 42, 44, 204, 93, 
+    226, 171, 250, 8, 218, 64, 250, 8, 218, 22, 250, 8, 218, 65, 177, 128, 
+    112, 250, 8, 218, 23, 177, 128, 112, 218, 65, 72, 218, 22, 218, 23, 72, 
+    218, 64, 218, 65, 72, 218, 64, 218, 23, 72, 218, 22, 218, 23, 252, 38, 
+    218, 64, 218, 23, 252, 38, 22, 235, 71, 251, 86, 248, 165, 2, 218, 64, 
+    245, 178, 64, 226, 174, 246, 111, 225, 51, 2, 217, 13, 216, 14, 215, 241, 
+    235, 205, 244, 29, 228, 70, 219, 253, 43, 217, 88, 219, 253, 124, 217, 
+    88, 219, 253, 120, 217, 88, 225, 175, 2, 222, 93, 67, 252, 149, 215, 212, 
+    44, 215, 93, 52, 67, 252, 149, 43, 215, 93, 67, 252, 149, 52, 43, 215, 
+    93, 52, 67, 252, 149, 52, 43, 215, 93, 200, 248, 165, 243, 251, 43, 231, 
+    68, 64, 52, 213, 239, 219, 253, 124, 217, 89, 2, 226, 127, 219, 253, 120, 
+    217, 89, 2, 214, 183, 219, 253, 120, 217, 89, 72, 219, 253, 124, 217, 88, 
+    52, 124, 217, 88, 52, 120, 217, 88, 52, 218, 105, 228, 57, 50, 223, 52, 
+    52, 218, 105, 228, 57, 50, 247, 146, 228, 57, 247, 183, 2, 223, 52, 229, 
+    106, 219, 97, 67, 232, 220, 2, 250, 44, 48, 67, 232, 220, 2, 250, 44, 51, 
+    124, 217, 89, 2, 250, 44, 51, 226, 12, 2, 203, 91, 226, 12, 2, 216, 90, 
+    226, 171, 215, 212, 67, 252, 149, 251, 252, 223, 94, 215, 212, 67, 252, 
+    149, 2, 203, 91, 215, 212, 249, 235, 226, 171, 215, 212, 229, 96, 233, 
+    20, 215, 212, 229, 96, 242, 136, 246, 119, 219, 99, 233, 21, 177, 128, 
+    112, 246, 119, 219, 99, 242, 137, 177, 128, 112, 215, 212, 219, 49, 251, 
+    252, 223, 94, 233, 91, 215, 212, 67, 252, 149, 226, 171, 52, 219, 49, 
+    226, 171, 71, 67, 130, 230, 29, 71, 67, 130, 228, 61, 245, 228, 71, 75, 
+    228, 61, 212, 9, 71, 75, 219, 30, 245, 228, 71, 75, 219, 30, 212, 9, 71, 
+    75, 43, 44, 71, 75, 140, 85, 75, 214, 153, 85, 75, 246, 112, 85, 75, 228, 
+    61, 245, 228, 85, 75, 228, 61, 212, 9, 85, 75, 219, 30, 245, 228, 85, 75, 
+    219, 30, 212, 9, 85, 75, 43, 44, 85, 75, 120, 124, 85, 75, 97, 80, 2, 
+    216, 78, 246, 111, 97, 80, 2, 216, 78, 214, 152, 140, 80, 2, 216, 78, 
+    246, 111, 140, 80, 2, 216, 78, 214, 152, 42, 2, 216, 15, 163, 251, 229, 
+    42, 2, 251, 183, 163, 251, 229, 42, 2, 214, 160, 44, 248, 7, 163, 251, 
+    229, 42, 2, 232, 114, 43, 248, 7, 163, 251, 229, 248, 1, 2, 43, 163, 251, 
+    229, 248, 1, 2, 44, 163, 251, 229, 248, 1, 2, 216, 15, 163, 251, 229, 
+    248, 1, 2, 251, 183, 163, 251, 229, 246, 126, 218, 236, 85, 233, 91, 218, 
+    236, 71, 233, 91, 218, 236, 85, 213, 187, 4, 218, 236, 71, 213, 187, 4, 
+    218, 236, 85, 225, 193, 71, 225, 193, 71, 241, 200, 85, 241, 200, 203, 
+    85, 241, 200, 85, 233, 91, 250, 43, 85, 231, 87, 248, 0, 71, 231, 87, 
+    248, 0, 85, 231, 87, 232, 110, 71, 231, 87, 232, 110, 85, 4, 248, 0, 85, 
+    4, 232, 110, 71, 4, 232, 110, 85, 203, 245, 172, 71, 203, 245, 172, 85, 
+    67, 245, 172, 71, 67, 245, 172, 43, 80, 2, 4, 250, 43, 134, 140, 253, 
+    255, 43, 80, 2, 37, 225, 25, 200, 140, 218, 232, 75, 140, 215, 58, 80, 2, 
+    67, 91, 140, 215, 58, 80, 2, 52, 67, 91, 140, 215, 58, 80, 243, 251, 130, 
+    140, 215, 58, 215, 212, 248, 165, 75, 140, 80, 2, 246, 126, 218, 141, 
+    140, 80, 2, 217, 79, 2, 67, 91, 140, 80, 2, 217, 79, 2, 52, 67, 91, 140, 
+    215, 58, 80, 2, 217, 78, 140, 215, 58, 80, 2, 217, 79, 2, 67, 91, 140, 
+    215, 58, 80, 2, 217, 79, 2, 52, 67, 91, 140, 80, 216, 140, 211, 178, 212, 
+    36, 80, 225, 10, 247, 203, 233, 52, 245, 106, 5, 72, 140, 75, 223, 53, 
+    216, 90, 226, 172, 72, 140, 75, 140, 80, 72, 223, 53, 254, 156, 128, 112, 
+    97, 80, 216, 140, 242, 136, 97, 80, 216, 140, 218, 22, 140, 224, 27, 75, 
+    97, 224, 27, 75, 223, 53, 216, 90, 226, 172, 72, 97, 75, 97, 80, 72, 223, 
+    53, 254, 156, 128, 112, 216, 90, 226, 172, 72, 140, 75, 140, 80, 72, 254, 
+    156, 128, 112, 140, 80, 72, 223, 53, 216, 90, 226, 171, 97, 80, 72, 223, 
+    53, 216, 90, 226, 171, 71, 231, 87, 218, 158, 85, 4, 218, 158, 71, 4, 
+    218, 158, 85, 222, 250, 225, 193, 71, 222, 250, 225, 193, 114, 233, 91, 
+    250, 43, 114, 226, 128, 2, 226, 128, 235, 222, 114, 250, 44, 2, 250, 44, 
+    235, 222, 114, 250, 43, 114, 37, 222, 0, 145, 6, 1, 253, 167, 145, 6, 1, 
+    251, 125, 145, 6, 1, 213, 253, 145, 6, 1, 242, 192, 145, 6, 1, 247, 148, 
+    145, 6, 1, 211, 21, 145, 6, 1, 210, 68, 145, 6, 1, 246, 42, 145, 6, 1, 
+    210, 91, 145, 6, 1, 235, 154, 145, 6, 1, 65, 235, 154, 145, 6, 1, 74, 
+    145, 6, 1, 247, 168, 145, 6, 1, 234, 246, 145, 6, 1, 232, 192, 145, 6, 1, 
+    230, 34, 145, 6, 1, 229, 196, 145, 6, 1, 226, 189, 145, 6, 1, 225, 7, 
+    145, 6, 1, 222, 230, 145, 6, 1, 219, 85, 145, 6, 1, 215, 81, 145, 6, 1, 
+    214, 201, 145, 6, 1, 243, 254, 145, 6, 1, 241, 206, 145, 6, 1, 226, 139, 
+    145, 6, 1, 225, 224, 145, 6, 1, 219, 230, 145, 6, 1, 215, 168, 145, 6, 1, 
+    250, 83, 145, 6, 1, 220, 104, 145, 6, 1, 211, 27, 145, 6, 1, 211, 29, 
+    145, 6, 1, 211, 57, 145, 6, 1, 218, 255, 162, 145, 6, 1, 210, 212, 145, 
+    6, 1, 4, 210, 183, 145, 6, 1, 4, 210, 184, 2, 217, 78, 145, 6, 1, 210, 
+    244, 145, 6, 1, 235, 191, 4, 210, 183, 145, 6, 1, 252, 1, 210, 183, 145, 
+    6, 1, 235, 191, 252, 1, 210, 183, 145, 6, 1, 244, 90, 145, 6, 1, 235, 
+    152, 145, 6, 1, 219, 229, 145, 6, 1, 215, 203, 61, 145, 6, 1, 233, 81, 
+    230, 34, 145, 4, 1, 253, 167, 145, 4, 1, 251, 125, 145, 4, 1, 213, 253, 
+    145, 4, 1, 242, 192, 145, 4, 1, 247, 148, 145, 4, 1, 211, 21, 145, 4, 1, 
+    210, 68, 145, 4, 1, 246, 42, 145, 4, 1, 210, 91, 145, 4, 1, 235, 154, 
+    145, 4, 1, 65, 235, 154, 145, 4, 1, 74, 145, 4, 1, 247, 168, 145, 4, 1, 
+    234, 246, 145, 4, 1, 232, 192, 145, 4, 1, 230, 34, 145, 4, 1, 229, 196, 
+    145, 4, 1, 226, 189, 145, 4, 1, 225, 7, 145, 4, 1, 222, 230, 145, 4, 1, 
+    219, 85, 145, 4, 1, 215, 81, 145, 4, 1, 214, 201, 145, 4, 1, 243, 254, 
+    145, 4, 1, 241, 206, 145, 4, 1, 226, 139, 145, 4, 1, 225, 224, 145, 4, 1, 
+    219, 230, 145, 4, 1, 215, 168, 145, 4, 1, 250, 83, 145, 4, 1, 220, 104, 
+    145, 4, 1, 211, 27, 145, 4, 1, 211, 29, 145, 4, 1, 211, 57, 145, 4, 1, 
+    218, 255, 162, 145, 4, 1, 210, 212, 145, 4, 1, 4, 210, 183, 145, 4, 1, 4, 
+    210, 184, 2, 217, 78, 145, 4, 1, 210, 244, 145, 4, 1, 235, 191, 4, 210, 
+    183, 145, 4, 1, 252, 1, 210, 183, 145, 4, 1, 235, 191, 252, 1, 210, 183, 
+    145, 4, 1, 244, 90, 145, 4, 1, 235, 152, 145, 4, 1, 219, 229, 145, 4, 1, 
+    215, 203, 61, 145, 4, 1, 233, 81, 230, 34, 7, 6, 1, 233, 155, 2, 52, 130, 
+    7, 4, 1, 233, 155, 2, 52, 130, 7, 6, 1, 233, 155, 2, 230, 229, 184, 7, 6, 
+    1, 226, 110, 2, 91, 7, 6, 1, 223, 227, 2, 217, 78, 7, 4, 1, 116, 2, 91, 
+    7, 4, 1, 217, 154, 2, 248, 7, 91, 7, 6, 1, 242, 68, 2, 248, 47, 7, 4, 1, 
+    242, 68, 2, 248, 47, 7, 6, 1, 235, 30, 2, 248, 47, 7, 4, 1, 235, 30, 2, 
+    248, 47, 7, 6, 1, 210, 160, 2, 248, 47, 7, 4, 1, 210, 160, 2, 248, 47, 7, 
+    6, 1, 254, 151, 7, 6, 1, 232, 55, 2, 103, 7, 6, 1, 215, 94, 61, 7, 6, 1, 
+    215, 94, 254, 151, 7, 4, 1, 214, 106, 2, 44, 103, 7, 6, 1, 212, 99, 2, 
+    103, 7, 4, 1, 212, 99, 2, 103, 7, 4, 1, 214, 106, 2, 249, 108, 7, 6, 1, 
+    163, 242, 67, 7, 4, 1, 163, 242, 67, 7, 4, 1, 217, 76, 225, 136, 7, 4, 1, 
+    160, 2, 228, 55, 7, 4, 1, 215, 94, 223, 227, 2, 217, 78, 7, 4, 1, 144, 2, 
+    121, 222, 237, 235, 222, 7, 1, 4, 6, 215, 94, 76, 7, 218, 66, 4, 1, 235, 
+    150, 58, 1, 6, 214, 105, 7, 6, 1, 222, 94, 2, 217, 251, 217, 78, 7, 6, 1, 
+    210, 160, 2, 217, 251, 217, 78, 81, 6, 1, 254, 173, 81, 4, 1, 254, 173, 
+    81, 6, 1, 213, 173, 81, 4, 1, 213, 173, 81, 6, 1, 243, 114, 81, 4, 1, 
+    243, 114, 81, 6, 1, 248, 199, 81, 4, 1, 248, 199, 81, 6, 1, 245, 202, 81, 
+    4, 1, 245, 202, 81, 6, 1, 219, 35, 81, 4, 1, 219, 35, 81, 6, 1, 210, 101, 
+    81, 4, 1, 210, 101, 81, 6, 1, 241, 255, 81, 4, 1, 241, 255, 81, 6, 1, 
+    216, 178, 81, 4, 1, 216, 178, 81, 6, 1, 240, 123, 81, 4, 1, 240, 123, 81, 
+    6, 1, 234, 233, 81, 4, 1, 234, 233, 81, 6, 1, 233, 78, 81, 4, 1, 233, 78, 
+    81, 6, 1, 230, 235, 81, 4, 1, 230, 235, 81, 6, 1, 228, 238, 81, 4, 1, 
+    228, 238, 81, 6, 1, 233, 239, 81, 4, 1, 233, 239, 81, 6, 1, 78, 81, 4, 1, 
+    78, 81, 6, 1, 225, 111, 81, 4, 1, 225, 111, 81, 6, 1, 222, 213, 81, 4, 1, 
+    222, 213, 81, 6, 1, 219, 167, 81, 4, 1, 219, 167, 81, 6, 1, 217, 42, 81, 
+    4, 1, 217, 42, 81, 6, 1, 214, 229, 81, 4, 1, 214, 229, 81, 6, 1, 244, 
+    129, 81, 4, 1, 244, 129, 81, 6, 1, 234, 118, 81, 4, 1, 234, 118, 81, 6, 
+    1, 224, 164, 81, 4, 1, 224, 164, 81, 6, 1, 226, 182, 81, 4, 1, 226, 182, 
+    81, 6, 1, 248, 5, 254, 179, 81, 4, 1, 248, 5, 254, 179, 81, 6, 1, 55, 81, 
+    254, 205, 81, 4, 1, 55, 81, 254, 205, 81, 6, 1, 249, 123, 245, 202, 81, 
+    4, 1, 249, 123, 245, 202, 81, 6, 1, 248, 5, 234, 233, 81, 4, 1, 248, 5, 
+    234, 233, 81, 6, 1, 248, 5, 228, 238, 81, 4, 1, 248, 5, 228, 238, 81, 6, 
+    1, 249, 123, 228, 238, 81, 4, 1, 249, 123, 228, 238, 81, 6, 1, 55, 81, 
+    226, 182, 81, 4, 1, 55, 81, 226, 182, 81, 6, 1, 221, 248, 81, 4, 1, 221, 
+    248, 81, 6, 1, 249, 136, 220, 57, 81, 4, 1, 249, 136, 220, 57, 81, 6, 1, 
+    55, 81, 220, 57, 81, 4, 1, 55, 81, 220, 57, 81, 6, 1, 55, 81, 245, 83, 
+    81, 4, 1, 55, 81, 245, 83, 81, 6, 1, 254, 191, 234, 123, 81, 4, 1, 254, 
+    191, 234, 123, 81, 6, 1, 248, 5, 241, 52, 81, 4, 1, 248, 5, 241, 52, 81, 
+    6, 1, 55, 81, 241, 52, 81, 4, 1, 55, 81, 241, 52, 81, 6, 1, 55, 81, 162, 
+    81, 4, 1, 55, 81, 162, 81, 6, 1, 233, 154, 162, 81, 4, 1, 233, 154, 162, 
+    81, 6, 1, 55, 81, 241, 224, 81, 4, 1, 55, 81, 241, 224, 81, 6, 1, 55, 81, 
+    242, 2, 81, 4, 1, 55, 81, 242, 2, 81, 6, 1, 55, 81, 243, 109, 81, 4, 1, 
+    55, 81, 243, 109, 81, 6, 1, 55, 81, 247, 171, 81, 4, 1, 55, 81, 247, 171, 
+    81, 6, 1, 55, 81, 220, 24, 81, 4, 1, 55, 81, 220, 24, 81, 6, 1, 55, 227, 
+    212, 220, 24, 81, 4, 1, 55, 227, 212, 220, 24, 81, 6, 1, 55, 227, 212, 
+    229, 32, 81, 4, 1, 55, 227, 212, 229, 32, 81, 6, 1, 55, 227, 212, 227, 
+    152, 81, 4, 1, 55, 227, 212, 227, 152, 81, 6, 1, 55, 227, 212, 212, 37, 
+    81, 4, 1, 55, 227, 212, 212, 37, 81, 16, 234, 252, 81, 16, 230, 236, 222, 
+    213, 81, 16, 225, 112, 222, 213, 81, 16, 218, 149, 81, 16, 217, 43, 222, 
+    213, 81, 16, 234, 119, 222, 213, 81, 16, 220, 25, 219, 167, 81, 6, 1, 
+    249, 123, 220, 57, 81, 4, 1, 249, 123, 220, 57, 81, 6, 1, 249, 123, 243, 
+    109, 81, 4, 1, 249, 123, 243, 109, 81, 38, 228, 239, 48, 81, 38, 218, 
+    249, 253, 232, 81, 38, 218, 249, 233, 27, 81, 6, 1, 251, 207, 234, 123, 
+    81, 4, 1, 251, 207, 234, 123, 81, 55, 227, 212, 243, 236, 218, 131, 81, 
+    55, 227, 212, 247, 205, 224, 16, 79, 81, 55, 227, 212, 235, 244, 224, 16, 
+    79, 81, 55, 227, 212, 213, 241, 247, 180, 81, 244, 10, 123, 242, 34, 81, 
+    243, 236, 218, 131, 81, 230, 129, 247, 180, 98, 4, 1, 254, 131, 98, 4, 1, 
+    252, 160, 98, 4, 1, 243, 113, 98, 4, 1, 247, 136, 98, 4, 1, 245, 158, 98, 
+    4, 1, 213, 160, 98, 4, 1, 210, 89, 98, 4, 1, 217, 61, 98, 4, 1, 236, 6, 
+    98, 4, 1, 234, 240, 98, 4, 1, 233, 87, 98, 4, 1, 231, 190, 98, 4, 1, 229, 
+    200, 98, 4, 1, 226, 200, 98, 4, 1, 226, 21, 98, 4, 1, 210, 78, 98, 4, 1, 
+    223, 174, 98, 4, 1, 221, 245, 98, 4, 1, 217, 51, 98, 4, 1, 214, 190, 98, 
+    4, 1, 225, 143, 98, 4, 1, 234, 127, 98, 4, 1, 242, 248, 98, 4, 1, 224, 
+    76, 98, 4, 1, 220, 22, 98, 4, 1, 250, 105, 98, 4, 1, 251, 15, 98, 4, 1, 
+    235, 106, 98, 4, 1, 250, 48, 98, 4, 1, 250, 151, 98, 4, 1, 211, 163, 98, 
+    4, 1, 235, 117, 98, 4, 1, 242, 50, 98, 4, 1, 241, 245, 98, 4, 1, 241, 
+    182, 98, 4, 1, 212, 22, 98, 4, 1, 242, 11, 98, 4, 1, 241, 72, 98, 4, 1, 
+    210, 246, 98, 4, 1, 254, 241, 216, 109, 1, 192, 216, 109, 1, 211, 99, 
+    216, 109, 1, 211, 98, 216, 109, 1, 211, 88, 216, 109, 1, 211, 86, 216, 
+    109, 1, 252, 40, 255, 25, 211, 81, 216, 109, 1, 211, 81, 216, 109, 1, 
+    211, 96, 216, 109, 1, 211, 93, 216, 109, 1, 211, 95, 216, 109, 1, 211, 
+    94, 216, 109, 1, 211, 12, 216, 109, 1, 211, 90, 216, 109, 1, 211, 79, 
+    216, 109, 1, 215, 116, 211, 79, 216, 109, 1, 211, 76, 216, 109, 1, 211, 
+    84, 216, 109, 1, 252, 40, 255, 25, 211, 84, 216, 109, 1, 215, 116, 211, 
+    84, 216, 109, 1, 211, 83, 216, 109, 1, 211, 103, 216, 109, 1, 211, 77, 
+    216, 109, 1, 215, 116, 211, 77, 216, 109, 1, 211, 66, 216, 109, 1, 215, 
+    116, 211, 66, 216, 109, 1, 211, 8, 216, 109, 1, 211, 49, 216, 109, 1, 
+    254, 216, 211, 49, 216, 109, 1, 215, 116, 211, 49, 216, 109, 1, 211, 75, 
+    216, 109, 1, 211, 74, 216, 109, 1, 211, 71, 216, 109, 1, 215, 116, 211, 
+    85, 216, 109, 1, 215, 116, 211, 69, 216, 109, 1, 211, 67, 216, 109, 1, 
+    210, 212, 216, 109, 1, 211, 64, 216, 109, 1, 211, 63, 216, 109, 1, 211, 
+    87, 216, 109, 1, 215, 116, 211, 87, 216, 109, 1, 253, 171, 211, 87, 216, 
+    109, 1, 211, 62, 216, 109, 1, 211, 60, 216, 109, 1, 211, 61, 216, 109, 1, 
+    211, 59, 216, 109, 1, 211, 58, 216, 109, 1, 211, 97, 216, 109, 1, 211, 
+    56, 216, 109, 1, 211, 54, 216, 109, 1, 211, 53, 216, 109, 1, 211, 52, 
+    216, 109, 1, 211, 50, 216, 109, 1, 217, 35, 211, 50, 216, 109, 1, 211, 
+    48, 216, 109, 1, 211, 47, 216, 109, 1, 210, 244, 216, 109, 58, 1, 233, 
+    132, 79, 216, 109, 220, 140, 79, 216, 109, 117, 235, 69, 29, 3, 232, 161, 
+    29, 3, 230, 165, 29, 3, 222, 211, 29, 3, 219, 59, 29, 3, 220, 8, 29, 3, 
+    251, 212, 29, 3, 216, 42, 29, 3, 249, 245, 29, 3, 228, 77, 29, 3, 227, 
+    137, 29, 3, 242, 187, 227, 4, 29, 3, 210, 22, 29, 3, 247, 151, 29, 3, 
+    248, 112, 29, 3, 235, 73, 29, 3, 216, 156, 29, 3, 250, 93, 29, 3, 225, 
+    123, 29, 3, 225, 18, 29, 3, 243, 6, 29, 3, 243, 2, 29, 3, 243, 3, 29, 3, 
+    243, 4, 29, 3, 218, 225, 29, 3, 218, 181, 29, 3, 218, 194, 29, 3, 218, 
+    224, 29, 3, 218, 198, 29, 3, 218, 199, 29, 3, 218, 186, 29, 3, 250, 221, 
+    29, 3, 250, 200, 29, 3, 250, 202, 29, 3, 250, 220, 29, 3, 250, 218, 29, 
+    3, 250, 219, 29, 3, 250, 201, 29, 3, 209, 243, 29, 3, 209, 221, 29, 3, 
+    209, 234, 29, 3, 209, 242, 29, 3, 209, 237, 29, 3, 209, 238, 29, 3, 209, 
+    226, 29, 3, 250, 216, 29, 3, 250, 203, 29, 3, 250, 205, 29, 3, 250, 215, 
+    29, 3, 250, 213, 29, 3, 250, 214, 29, 3, 250, 204, 29, 3, 223, 239, 29, 
+    3, 223, 229, 29, 3, 223, 235, 29, 3, 223, 238, 29, 3, 223, 236, 29, 3, 
+    223, 237, 29, 3, 223, 234, 29, 3, 233, 165, 29, 3, 233, 157, 29, 3, 233, 
+    160, 29, 3, 233, 164, 29, 3, 233, 161, 29, 3, 233, 162, 29, 3, 233, 158, 
+    29, 3, 211, 130, 29, 3, 211, 120, 29, 3, 211, 126, 29, 3, 211, 129, 29, 
+    3, 211, 127, 29, 3, 211, 128, 29, 3, 211, 125, 29, 3, 242, 78, 29, 3, 
+    242, 69, 29, 3, 242, 72, 29, 3, 242, 77, 29, 3, 242, 74, 29, 3, 242, 75, 
+    29, 3, 242, 71, 38, 33, 1, 252, 83, 38, 33, 1, 213, 255, 38, 33, 1, 242, 
+    243, 38, 33, 1, 248, 98, 38, 33, 1, 210, 74, 38, 33, 1, 210, 94, 38, 33, 
+    1, 176, 38, 33, 1, 245, 182, 38, 33, 1, 245, 167, 38, 33, 1, 245, 158, 
+    38, 33, 1, 78, 38, 33, 1, 225, 224, 38, 33, 1, 245, 100, 38, 33, 1, 245, 
+    90, 38, 33, 1, 217, 23, 38, 33, 1, 162, 38, 33, 1, 215, 179, 38, 33, 1, 
+    250, 139, 38, 33, 1, 220, 104, 38, 33, 1, 220, 67, 38, 33, 1, 244, 90, 
+    38, 33, 1, 245, 89, 38, 33, 1, 61, 38, 33, 1, 236, 67, 38, 33, 1, 247, 
+    169, 38, 33, 1, 230, 145, 214, 205, 38, 33, 1, 211, 59, 38, 33, 1, 210, 
+    212, 38, 33, 1, 235, 190, 61, 38, 33, 1, 232, 198, 210, 183, 38, 33, 1, 
+    252, 1, 210, 183, 38, 33, 1, 235, 190, 252, 1, 210, 183, 44, 254, 118, 
+    218, 61, 231, 159, 44, 254, 118, 246, 126, 218, 61, 231, 159, 43, 218, 
+    61, 127, 44, 218, 61, 127, 43, 246, 126, 218, 61, 127, 44, 246, 126, 218, 
+    61, 127, 223, 160, 235, 209, 231, 159, 223, 160, 246, 126, 235, 209, 231, 
+    159, 246, 126, 215, 242, 231, 159, 43, 215, 242, 127, 44, 215, 242, 127, 
+    223, 160, 218, 236, 43, 223, 160, 226, 202, 127, 44, 223, 160, 226, 202, 
+    127, 245, 218, 249, 166, 226, 17, 244, 30, 226, 17, 223, 52, 244, 30, 
+    226, 17, 240, 172, 246, 126, 226, 255, 246, 112, 254, 127, 214, 153, 254, 
+    127, 246, 126, 222, 250, 254, 117, 52, 226, 252, 240, 175, 235, 200, 235, 
+    208, 226, 63, 251, 162, 240, 176, 2, 248, 9, 216, 90, 2, 222, 237, 48, 
+    43, 121, 226, 9, 127, 44, 121, 226, 9, 127, 216, 90, 2, 59, 48, 216, 90, 
+    2, 59, 51, 43, 67, 252, 149, 2, 224, 10, 44, 67, 252, 149, 2, 224, 10, 
+    216, 15, 43, 163, 127, 216, 15, 44, 163, 127, 251, 183, 43, 163, 127, 
+    251, 183, 44, 163, 127, 43, 219, 189, 104, 127, 44, 219, 189, 104, 127, 
+    43, 52, 226, 7, 44, 52, 226, 7, 113, 170, 115, 123, 59, 224, 143, 123, 
+    59, 115, 113, 170, 224, 143, 92, 244, 19, 59, 224, 143, 244, 89, 59, 79, 
+    223, 52, 224, 16, 79, 67, 184, 222, 237, 225, 13, 211, 209, 220, 140, 
+    230, 229, 247, 128, 215, 94, 249, 227, 223, 160, 247, 128, 223, 160, 249, 
+    227, 215, 94, 220, 152, 248, 214, 2, 43, 242, 115, 248, 214, 2, 44, 242, 
+    115, 215, 94, 248, 213, 216, 15, 163, 221, 175, 50, 215, 59, 248, 164, 
+    216, 144, 248, 164, 10, 34, 223, 79, 10, 34, 250, 18, 10, 34, 221, 178, 
+    111, 10, 34, 221, 178, 105, 10, 34, 221, 178, 158, 10, 34, 225, 170, 10, 
+    34, 251, 171, 10, 34, 217, 93, 10, 34, 234, 39, 111, 10, 34, 234, 39, 
+    105, 10, 34, 247, 178, 10, 34, 221, 181, 10, 34, 4, 111, 10, 34, 4, 105, 
+    10, 34, 233, 103, 111, 10, 34, 233, 103, 105, 10, 34, 233, 103, 158, 10, 
+    34, 233, 103, 161, 10, 34, 219, 70, 10, 34, 216, 146, 10, 34, 219, 68, 
+    111, 10, 34, 219, 68, 105, 10, 34, 241, 235, 111, 10, 34, 241, 235, 105, 
+    10, 34, 242, 22, 10, 34, 223, 150, 10, 34, 250, 90, 10, 34, 218, 38, 10, 
+    34, 230, 133, 10, 34, 248, 96, 10, 34, 230, 125, 10, 34, 250, 33, 10, 34, 
+    212, 41, 111, 10, 34, 212, 41, 105, 10, 34, 244, 104, 10, 34, 225, 236, 
+    111, 10, 34, 225, 236, 105, 10, 34, 219, 162, 163, 215, 237, 215, 189, 
+    10, 34, 249, 153, 10, 34, 247, 144, 10, 34, 235, 143, 10, 34, 251, 206, 
+    64, 250, 2, 10, 34, 245, 23, 10, 34, 218, 251, 111, 10, 34, 218, 251, 
+    105, 10, 34, 252, 162, 10, 34, 219, 169, 10, 34, 251, 71, 219, 169, 10, 
+    34, 229, 95, 111, 10, 34, 229, 95, 105, 10, 34, 229, 95, 158, 10, 34, 
+    229, 95, 161, 10, 34, 231, 51, 10, 34, 220, 59, 10, 34, 223, 156, 10, 34, 
+    245, 45, 10, 34, 226, 213, 10, 34, 251, 141, 111, 10, 34, 251, 141, 105, 
+    10, 34, 231, 91, 10, 34, 230, 128, 10, 34, 242, 147, 111, 10, 34, 242, 
+    147, 105, 10, 34, 242, 147, 158, 10, 34, 216, 107, 10, 34, 250, 1, 10, 
+    34, 212, 9, 111, 10, 34, 212, 9, 105, 10, 34, 251, 71, 221, 172, 10, 34, 
+    219, 162, 240, 255, 10, 34, 240, 255, 10, 34, 251, 71, 219, 4, 10, 34, 
+    251, 71, 220, 54, 10, 34, 244, 40, 10, 34, 251, 71, 250, 236, 10, 34, 
+    219, 162, 212, 57, 10, 34, 212, 58, 111, 10, 34, 212, 58, 105, 10, 34, 
+    250, 35, 10, 34, 251, 71, 242, 173, 10, 34, 200, 111, 10, 34, 200, 105, 
+    10, 34, 251, 71, 232, 143, 10, 34, 251, 71, 243, 95, 10, 34, 230, 124, 
+    111, 10, 34, 230, 124, 105, 10, 34, 223, 162, 10, 34, 251, 215, 10, 34, 
+    251, 71, 217, 57, 233, 58, 10, 34, 251, 71, 233, 59, 10, 34, 251, 71, 
+    211, 239, 10, 34, 251, 71, 244, 54, 10, 34, 245, 226, 111, 10, 34, 245, 
+    226, 105, 10, 34, 245, 226, 158, 10, 34, 251, 71, 245, 225, 10, 34, 241, 
+    242, 10, 34, 251, 71, 240, 252, 10, 34, 251, 202, 10, 34, 242, 229, 10, 
+    34, 251, 71, 244, 98, 10, 34, 251, 71, 251, 245, 10, 34, 251, 71, 222, 3, 
+    10, 34, 219, 162, 212, 2, 10, 34, 219, 162, 211, 41, 10, 34, 251, 71, 
+    243, 252, 10, 34, 235, 149, 245, 49, 10, 34, 251, 71, 245, 49, 10, 34, 
+    235, 149, 216, 16, 10, 34, 251, 71, 216, 16, 10, 34, 235, 149, 246, 104, 
+    10, 34, 251, 71, 246, 104, 10, 34, 215, 91, 10, 34, 235, 149, 215, 91, 
+    10, 34, 251, 71, 215, 91, 60, 34, 111, 60, 34, 232, 219, 60, 34, 247, 
+    128, 60, 34, 219, 97, 60, 34, 221, 177, 60, 34, 103, 60, 34, 105, 60, 34, 
+    232, 243, 60, 34, 231, 190, 60, 34, 233, 39, 60, 34, 245, 137, 60, 34, 
+    196, 60, 34, 124, 251, 171, 60, 34, 249, 155, 60, 34, 240, 118, 60, 34, 
+    217, 93, 60, 34, 204, 251, 171, 60, 34, 234, 38, 60, 34, 224, 227, 60, 
+    34, 211, 202, 60, 34, 218, 245, 60, 34, 44, 204, 251, 171, 60, 34, 241, 
+    183, 245, 153, 60, 34, 216, 248, 60, 34, 247, 178, 60, 34, 221, 181, 60, 
+    34, 250, 18, 60, 34, 224, 185, 60, 34, 254, 224, 60, 34, 230, 115, 60, 
+    34, 245, 153, 60, 34, 245, 231, 60, 34, 221, 202, 60, 34, 242, 181, 60, 
+    34, 242, 182, 219, 83, 60, 34, 245, 48, 60, 34, 252, 0, 60, 34, 211, 221, 
+    60, 34, 250, 109, 60, 34, 222, 198, 60, 34, 236, 2, 60, 34, 219, 81, 60, 
+    34, 233, 102, 60, 34, 249, 164, 60, 34, 218, 239, 60, 34, 230, 120, 60, 
+    34, 222, 227, 60, 34, 211, 206, 60, 34, 226, 194, 60, 34, 215, 98, 60, 
+    34, 246, 88, 60, 34, 219, 253, 216, 146, 60, 34, 246, 126, 250, 18, 60, 
+    34, 200, 218, 110, 60, 34, 113, 242, 17, 60, 34, 220, 2, 60, 34, 251, 
+    177, 60, 34, 219, 67, 60, 34, 251, 145, 60, 34, 218, 140, 60, 34, 241, 
+    234, 60, 34, 242, 35, 60, 34, 247, 131, 60, 34, 242, 22, 60, 34, 251, 
+    162, 60, 34, 223, 150, 60, 34, 221, 189, 60, 34, 247, 207, 60, 34, 253, 
+    176, 60, 34, 218, 236, 60, 34, 228, 56, 60, 34, 218, 38, 60, 34, 221, 
+    213, 60, 34, 230, 133, 60, 34, 215, 236, 60, 34, 233, 128, 60, 34, 218, 
+    131, 60, 34, 248, 96, 60, 34, 212, 21, 60, 34, 247, 154, 228, 56, 60, 34, 
+    249, 223, 60, 34, 243, 229, 60, 34, 250, 29, 60, 34, 218, 144, 60, 34, 
+    212, 40, 60, 34, 244, 104, 60, 34, 250, 26, 60, 34, 244, 169, 60, 34, 52, 
+    211, 178, 60, 34, 163, 215, 237, 215, 189, 60, 34, 219, 91, 60, 34, 244, 
+    179, 60, 34, 249, 153, 60, 34, 247, 144, 60, 34, 224, 182, 60, 34, 235, 
+    143, 60, 34, 231, 72, 60, 34, 216, 89, 60, 34, 217, 246, 60, 34, 232, 
+    237, 60, 34, 214, 131, 60, 34, 244, 128, 60, 34, 251, 206, 64, 250, 2, 
+    60, 34, 219, 190, 60, 34, 246, 126, 216, 243, 60, 34, 211, 253, 60, 34, 
+    219, 105, 60, 34, 247, 195, 60, 34, 245, 23, 60, 34, 219, 7, 60, 34, 75, 
+    60, 34, 218, 133, 60, 34, 218, 250, 60, 34, 216, 0, 60, 34, 242, 154, 60, 
+    34, 250, 226, 60, 34, 218, 162, 60, 34, 252, 162, 60, 34, 223, 34, 60, 
+    34, 219, 169, 60, 34, 235, 136, 60, 34, 229, 94, 60, 34, 220, 59, 60, 34, 
+    244, 157, 60, 34, 226, 213, 60, 34, 254, 126, 60, 34, 225, 32, 60, 34, 
+    245, 235, 60, 34, 251, 140, 60, 34, 231, 91, 60, 34, 230, 188, 60, 34, 
+    220, 158, 60, 34, 254, 4, 60, 34, 230, 128, 60, 34, 216, 20, 60, 34, 226, 
+    169, 60, 34, 251, 209, 60, 34, 218, 129, 60, 34, 249, 233, 60, 34, 242, 
+    146, 60, 34, 216, 107, 60, 34, 235, 224, 60, 34, 251, 219, 60, 34, 212, 
+    58, 245, 153, 60, 34, 250, 1, 60, 34, 212, 8, 60, 34, 221, 172, 60, 34, 
+    240, 255, 60, 34, 219, 4, 60, 34, 214, 22, 60, 34, 252, 80, 60, 34, 225, 
+    76, 60, 34, 252, 182, 60, 34, 220, 54, 60, 34, 223, 113, 60, 34, 222, 
+    128, 60, 34, 244, 40, 60, 34, 251, 208, 60, 34, 250, 236, 60, 34, 251, 
+    234, 60, 34, 230, 130, 60, 34, 212, 57, 60, 34, 250, 35, 60, 34, 211, 
+    236, 60, 34, 247, 188, 60, 34, 213, 161, 60, 34, 242, 173, 60, 34, 232, 
+    143, 60, 34, 243, 95, 60, 34, 230, 123, 60, 34, 219, 96, 60, 34, 219, 
+    253, 217, 77, 251, 245, 60, 34, 223, 162, 60, 34, 251, 215, 60, 34, 211, 
+    197, 60, 34, 244, 198, 60, 34, 233, 58, 60, 34, 217, 57, 233, 58, 60, 34, 
+    233, 54, 60, 34, 219, 32, 60, 34, 233, 59, 60, 34, 211, 239, 60, 34, 244, 
+    54, 60, 34, 245, 225, 60, 34, 241, 242, 60, 34, 244, 8, 60, 34, 240, 252, 
+    60, 34, 251, 202, 60, 34, 217, 64, 60, 34, 242, 41, 60, 34, 244, 121, 60, 
+    34, 222, 30, 211, 236, 60, 34, 250, 228, 60, 34, 242, 229, 60, 34, 244, 
+    98, 60, 34, 251, 245, 60, 34, 222, 3, 60, 34, 248, 82, 60, 34, 212, 2, 
+    60, 34, 241, 217, 60, 34, 211, 41, 60, 34, 230, 197, 60, 34, 251, 229, 
+    60, 34, 245, 163, 60, 34, 243, 252, 60, 34, 215, 210, 60, 34, 246, 90, 
+    60, 34, 223, 144, 60, 34, 228, 58, 60, 34, 245, 49, 60, 34, 216, 16, 60, 
+    34, 246, 104, 60, 34, 215, 91, 60, 34, 244, 56, 110, 248, 45, 135, 43, 
+    216, 43, 222, 254, 110, 248, 45, 135, 72, 216, 43, 51, 110, 248, 45, 135, 
+    43, 216, 43, 230, 229, 22, 222, 254, 110, 248, 45, 135, 72, 216, 43, 230, 
+    229, 22, 51, 110, 248, 45, 135, 243, 236, 218, 11, 110, 248, 45, 135, 
+    218, 12, 243, 251, 48, 110, 248, 45, 135, 218, 12, 243, 251, 51, 110, 
+    248, 45, 135, 218, 12, 243, 251, 233, 52, 110, 248, 45, 135, 218, 12, 
+    243, 251, 214, 160, 233, 52, 110, 248, 45, 135, 218, 12, 243, 251, 214, 
+    160, 222, 254, 110, 248, 45, 135, 218, 12, 243, 251, 232, 114, 233, 52, 
+    110, 248, 45, 135, 226, 126, 110, 219, 20, 110, 249, 227, 110, 243, 236, 
+    218, 131, 247, 185, 79, 235, 137, 235, 243, 218, 161, 87, 110, 235, 164, 
+    79, 110, 250, 4, 79, 110, 54, 210, 86, 43, 254, 118, 127, 44, 254, 118, 
+    127, 43, 52, 254, 118, 127, 44, 52, 254, 118, 127, 43, 249, 169, 127, 44, 
+    249, 169, 127, 43, 71, 249, 169, 127, 44, 71, 249, 169, 127, 43, 85, 233, 
+    26, 127, 44, 85, 233, 26, 127, 224, 240, 79, 243, 39, 79, 43, 216, 7, 
+    220, 55, 127, 44, 216, 7, 220, 55, 127, 43, 71, 233, 26, 127, 44, 71, 
+    233, 26, 127, 43, 71, 216, 7, 220, 55, 127, 44, 71, 216, 7, 220, 55, 127, 
+    43, 71, 42, 127, 44, 71, 42, 127, 212, 36, 248, 164, 223, 52, 52, 224, 
+    194, 224, 1, 79, 52, 224, 194, 224, 1, 79, 121, 52, 224, 194, 224, 1, 79, 
+    224, 240, 164, 244, 198, 242, 15, 227, 202, 111, 242, 15, 227, 202, 105, 
+    242, 15, 227, 202, 158, 242, 15, 227, 202, 161, 242, 15, 227, 202, 190, 
+    242, 15, 227, 202, 195, 242, 15, 227, 202, 199, 242, 15, 227, 202, 196, 
+    242, 15, 227, 202, 201, 110, 233, 9, 138, 79, 110, 222, 231, 138, 79, 
+    110, 248, 52, 138, 79, 110, 245, 136, 138, 79, 24, 219, 157, 59, 138, 79, 
+    24, 52, 59, 138, 79, 212, 32, 248, 164, 67, 234, 239, 223, 80, 79, 67, 
+    234, 239, 223, 80, 2, 213, 135, 219, 33, 79, 67, 234, 239, 223, 80, 164, 
+    214, 160, 242, 34, 67, 234, 239, 223, 80, 2, 213, 135, 219, 33, 164, 214, 
+    160, 242, 34, 67, 234, 239, 223, 80, 164, 232, 114, 242, 34, 37, 224, 
+    240, 79, 110, 217, 4, 232, 220, 244, 154, 220, 140, 87, 242, 15, 227, 
+    202, 216, 248, 242, 15, 227, 202, 215, 73, 242, 15, 227, 202, 216, 163, 
+    67, 110, 235, 164, 79, 231, 145, 79, 226, 3, 254, 148, 79, 110, 45, 235, 
+    245, 110, 163, 244, 114, 219, 20, 141, 1, 4, 61, 141, 1, 61, 141, 1, 4, 
+    74, 141, 1, 74, 141, 1, 4, 69, 141, 1, 69, 141, 1, 4, 76, 141, 1, 76, 
+    141, 1, 4, 78, 141, 1, 78, 141, 1, 176, 141, 1, 243, 142, 141, 1, 234, 
+    98, 141, 1, 242, 221, 141, 1, 233, 223, 141, 1, 242, 120, 141, 1, 234, 
+    188, 141, 1, 243, 69, 141, 1, 234, 34, 141, 1, 242, 181, 141, 1, 206, 
+    141, 1, 210, 116, 141, 1, 219, 193, 141, 1, 210, 44, 141, 1, 218, 84, 
+    141, 1, 210, 13, 141, 1, 221, 183, 141, 1, 210, 94, 141, 1, 219, 60, 141, 
+    1, 210, 23, 141, 1, 217, 106, 141, 1, 248, 229, 141, 1, 216, 118, 141, 1, 
+    248, 11, 141, 1, 4, 215, 119, 141, 1, 215, 119, 141, 1, 246, 86, 141, 1, 
+    217, 23, 141, 1, 248, 98, 141, 1, 112, 141, 1, 247, 153, 141, 1, 198, 
+    141, 1, 228, 238, 141, 1, 227, 242, 141, 1, 229, 112, 141, 1, 228, 79, 
+    141, 1, 162, 141, 1, 252, 199, 141, 1, 191, 141, 1, 241, 187, 141, 1, 
+    252, 14, 141, 1, 225, 111, 141, 1, 240, 229, 141, 1, 251, 133, 141, 1, 
+    224, 153, 141, 1, 241, 245, 141, 1, 252, 83, 141, 1, 225, 224, 141, 1, 
+    241, 75, 141, 1, 251, 213, 141, 1, 225, 19, 141, 1, 186, 141, 1, 230, 
+    235, 141, 1, 230, 107, 141, 1, 231, 96, 141, 1, 230, 166, 141, 1, 4, 192, 
+    141, 1, 192, 141, 1, 4, 210, 212, 141, 1, 210, 212, 141, 1, 4, 210, 244, 
+    141, 1, 210, 244, 141, 1, 205, 141, 1, 223, 38, 141, 1, 222, 142, 141, 1, 
+    223, 131, 141, 1, 222, 213, 141, 1, 4, 212, 65, 141, 1, 212, 65, 141, 1, 
+    211, 250, 141, 1, 212, 22, 141, 1, 211, 227, 141, 1, 230, 30, 141, 1, 
+    212, 116, 141, 1, 4, 176, 141, 1, 4, 234, 188, 38, 234, 207, 213, 135, 
+    219, 33, 79, 38, 234, 207, 220, 157, 219, 33, 79, 234, 207, 213, 135, 
+    219, 33, 79, 234, 207, 220, 157, 219, 33, 79, 141, 235, 164, 79, 141, 
+    213, 135, 235, 164, 79, 141, 247, 229, 210, 225, 234, 207, 52, 240, 175, 
+    56, 1, 4, 61, 56, 1, 61, 56, 1, 4, 74, 56, 1, 74, 56, 1, 4, 69, 56, 1, 
+    69, 56, 1, 4, 76, 56, 1, 76, 56, 1, 4, 78, 56, 1, 78, 56, 1, 176, 56, 1, 
+    243, 142, 56, 1, 234, 98, 56, 1, 242, 221, 56, 1, 233, 223, 56, 1, 242, 
+    120, 56, 1, 234, 188, 56, 1, 243, 69, 56, 1, 234, 34, 56, 1, 242, 181, 
+    56, 1, 206, 56, 1, 210, 116, 56, 1, 219, 193, 56, 1, 210, 44, 56, 1, 218, 
+    84, 56, 1, 210, 13, 56, 1, 221, 183, 56, 1, 210, 94, 56, 1, 219, 60, 56, 
+    1, 210, 23, 56, 1, 217, 106, 56, 1, 248, 229, 56, 1, 216, 118, 56, 1, 
+    248, 11, 56, 1, 4, 215, 119, 56, 1, 215, 119, 56, 1, 246, 86, 56, 1, 217, 
+    23, 56, 1, 248, 98, 56, 1, 112, 56, 1, 247, 153, 56, 1, 198, 56, 1, 228, 
+    238, 56, 1, 227, 242, 56, 1, 229, 112, 56, 1, 228, 79, 56, 1, 162, 56, 1, 
+    252, 199, 56, 1, 191, 56, 1, 241, 187, 56, 1, 252, 14, 56, 1, 225, 111, 
+    56, 1, 240, 229, 56, 1, 251, 133, 56, 1, 224, 153, 56, 1, 241, 245, 56, 
+    1, 252, 83, 56, 1, 225, 224, 56, 1, 241, 75, 56, 1, 251, 213, 56, 1, 225, 
+    19, 56, 1, 186, 56, 1, 230, 235, 56, 1, 230, 107, 56, 1, 231, 96, 56, 1, 
+    230, 166, 56, 1, 4, 192, 56, 1, 192, 56, 1, 4, 210, 212, 56, 1, 210, 212, 
+    56, 1, 4, 210, 244, 56, 1, 210, 244, 56, 1, 205, 56, 1, 223, 38, 56, 1, 
+    222, 142, 56, 1, 223, 131, 56, 1, 222, 213, 56, 1, 4, 212, 65, 56, 1, 
+    212, 65, 56, 1, 211, 250, 56, 1, 212, 22, 56, 1, 211, 227, 56, 1, 230, 
+    30, 56, 1, 212, 116, 56, 1, 4, 176, 56, 1, 4, 234, 188, 56, 1, 214, 27, 
+    56, 1, 213, 176, 56, 1, 213, 255, 56, 1, 213, 138, 56, 230, 229, 247, 
+    128, 234, 207, 224, 176, 219, 33, 79, 56, 235, 164, 79, 56, 213, 135, 
+    235, 164, 79, 56, 247, 229, 234, 5, 251, 192, 1, 253, 166, 251, 192, 1, 
+    226, 109, 251, 192, 1, 194, 251, 192, 1, 245, 14, 251, 192, 1, 249, 68, 
+    251, 192, 1, 217, 153, 251, 192, 1, 230, 30, 251, 192, 1, 156, 251, 192, 
+    1, 243, 209, 251, 192, 1, 235, 29, 251, 192, 1, 242, 67, 251, 192, 1, 
+    235, 150, 251, 192, 1, 224, 99, 251, 192, 1, 211, 178, 251, 192, 1, 210, 
+    83, 251, 192, 1, 250, 166, 251, 192, 1, 220, 106, 251, 192, 1, 153, 251, 
+    192, 1, 210, 159, 251, 192, 1, 251, 74, 251, 192, 1, 222, 93, 251, 192, 
+    1, 61, 251, 192, 1, 78, 251, 192, 1, 76, 251, 192, 1, 245, 205, 251, 192, 
+    1, 254, 210, 251, 192, 1, 245, 203, 251, 192, 1, 253, 200, 251, 192, 1, 
+    226, 138, 251, 192, 1, 254, 131, 251, 192, 1, 245, 158, 251, 192, 1, 254, 
+    123, 251, 192, 1, 245, 146, 251, 192, 1, 245, 100, 251, 192, 1, 74, 251, 
+    192, 1, 69, 251, 192, 1, 235, 162, 251, 192, 1, 214, 105, 251, 192, 1, 
+    229, 84, 251, 192, 1, 242, 185, 251, 192, 1, 236, 41, 24, 1, 234, 64, 24, 
+    1, 218, 217, 24, 1, 234, 57, 24, 1, 228, 231, 24, 1, 228, 229, 24, 1, 
+    228, 228, 24, 1, 216, 102, 24, 1, 218, 206, 24, 1, 223, 29, 24, 1, 223, 
+    24, 24, 1, 223, 21, 24, 1, 223, 14, 24, 1, 223, 9, 24, 1, 223, 4, 24, 1, 
+    223, 15, 24, 1, 223, 27, 24, 1, 230, 222, 24, 1, 225, 98, 24, 1, 218, 
+    214, 24, 1, 225, 87, 24, 1, 219, 150, 24, 1, 218, 211, 24, 1, 236, 63, 
+    24, 1, 250, 54, 24, 1, 218, 221, 24, 1, 250, 114, 24, 1, 234, 116, 24, 1, 
+    216, 174, 24, 1, 225, 134, 24, 1, 241, 179, 24, 1, 61, 24, 1, 254, 252, 
+    24, 1, 192, 24, 1, 211, 92, 24, 1, 245, 125, 24, 1, 76, 24, 1, 211, 36, 
+    24, 1, 211, 47, 24, 1, 78, 24, 1, 212, 65, 24, 1, 212, 62, 24, 1, 226, 
+    238, 24, 1, 210, 244, 24, 1, 69, 24, 1, 212, 11, 24, 1, 212, 22, 24, 1, 
+    211, 250, 24, 1, 210, 212, 24, 1, 245, 63, 24, 1, 211, 8, 24, 1, 74, 24, 
+    244, 111, 24, 1, 218, 215, 24, 1, 228, 221, 24, 1, 228, 223, 24, 1, 228, 
+    226, 24, 1, 223, 22, 24, 1, 223, 3, 24, 1, 223, 11, 24, 1, 223, 16, 24, 
+    1, 223, 1, 24, 1, 230, 215, 24, 1, 230, 212, 24, 1, 230, 216, 24, 1, 234, 
+    227, 24, 1, 225, 93, 24, 1, 225, 79, 24, 1, 225, 85, 24, 1, 225, 82, 24, 
+    1, 225, 96, 24, 1, 225, 80, 24, 1, 234, 225, 24, 1, 234, 223, 24, 1, 219, 
+    143, 24, 1, 219, 141, 24, 1, 219, 133, 24, 1, 219, 138, 24, 1, 219, 148, 
+    24, 1, 226, 36, 24, 1, 218, 218, 24, 1, 211, 26, 24, 1, 211, 22, 24, 1, 
+    211, 23, 24, 1, 234, 226, 24, 1, 218, 219, 24, 1, 211, 32, 24, 1, 210, 
+    238, 24, 1, 210, 237, 24, 1, 210, 240, 24, 1, 210, 203, 24, 1, 210, 204, 
+    24, 1, 210, 207, 24, 1, 254, 42, 24, 1, 254, 36, 110, 254, 107, 232, 209, 
+    79, 110, 254, 107, 223, 53, 79, 110, 254, 107, 123, 79, 110, 254, 107, 
+    113, 79, 110, 254, 107, 134, 79, 110, 254, 107, 244, 19, 79, 110, 254, 
+    107, 216, 15, 79, 110, 254, 107, 230, 229, 79, 110, 254, 107, 251, 183, 
+    79, 110, 254, 107, 244, 100, 79, 110, 254, 107, 221, 178, 79, 110, 254, 
+    107, 216, 170, 79, 110, 254, 107, 244, 12, 79, 110, 254, 107, 241, 231, 
+    79, 110, 254, 107, 245, 232, 79, 110, 254, 107, 231, 191, 79, 251, 192, 
+    1, 251, 133, 251, 192, 1, 210, 44, 251, 192, 1, 235, 114, 251, 192, 1, 
+    242, 120, 251, 192, 1, 245, 217, 251, 192, 1, 245, 143, 251, 192, 1, 226, 
+    187, 251, 192, 1, 226, 191, 251, 192, 1, 235, 186, 251, 192, 1, 254, 109, 
+    251, 192, 1, 235, 231, 251, 192, 1, 214, 168, 251, 192, 1, 236, 23, 251, 
+    192, 1, 229, 62, 251, 192, 1, 254, 204, 251, 192, 1, 253, 195, 251, 192, 
+    1, 254, 144, 251, 192, 1, 226, 208, 251, 192, 1, 226, 193, 251, 192, 1, 
+    235, 228, 251, 192, 40, 1, 226, 109, 251, 192, 40, 1, 217, 153, 251, 192, 
+    40, 1, 235, 29, 251, 192, 40, 1, 242, 67, 251, 192, 1, 243, 1, 251, 192, 
+    1, 233, 5, 251, 192, 1, 209, 250, 10, 218, 105, 217, 153, 10, 218, 105, 
+    212, 4, 10, 218, 105, 211, 158, 10, 218, 105, 251, 87, 10, 218, 105, 217, 
+    255, 10, 218, 105, 240, 165, 10, 218, 105, 240, 169, 10, 218, 105, 240, 
+    238, 10, 218, 105, 240, 166, 10, 218, 105, 217, 156, 10, 218, 105, 240, 
+    168, 10, 218, 105, 240, 164, 10, 218, 105, 240, 236, 10, 218, 105, 240, 
+    167, 10, 218, 105, 240, 163, 10, 218, 105, 230, 30, 10, 218, 105, 242, 
+    67, 10, 218, 105, 222, 93, 10, 218, 105, 226, 109, 10, 218, 105, 219, 23, 
+    10, 218, 105, 249, 68, 10, 218, 105, 240, 170, 10, 218, 105, 241, 197, 
+    10, 218, 105, 217, 165, 10, 218, 105, 217, 234, 10, 218, 105, 218, 170, 
+    10, 218, 105, 220, 112, 10, 218, 105, 225, 228, 10, 218, 105, 224, 101, 
+    10, 218, 105, 216, 44, 10, 218, 105, 217, 155, 10, 218, 105, 217, 245, 
+    10, 218, 105, 240, 177, 10, 218, 105, 240, 162, 10, 218, 105, 225, 152, 
+    10, 218, 105, 224, 99, 56, 1, 4, 233, 223, 56, 1, 4, 219, 193, 56, 1, 4, 
+    218, 84, 56, 1, 4, 112, 56, 1, 4, 227, 242, 56, 1, 4, 162, 56, 1, 4, 241, 
+    187, 56, 1, 4, 240, 229, 56, 1, 4, 241, 245, 56, 1, 4, 241, 75, 56, 1, 4, 
+    230, 107, 56, 1, 4, 205, 56, 1, 4, 223, 38, 56, 1, 4, 222, 142, 56, 1, 4, 
+    223, 131, 56, 1, 4, 222, 213, 88, 24, 234, 64, 88, 24, 228, 231, 88, 24, 
+    216, 102, 88, 24, 223, 29, 88, 24, 230, 222, 88, 24, 225, 98, 88, 24, 
+    219, 150, 88, 24, 236, 63, 88, 24, 250, 54, 88, 24, 250, 114, 88, 24, 
+    234, 116, 88, 24, 216, 174, 88, 24, 225, 134, 88, 24, 241, 179, 88, 24, 
+    234, 65, 61, 88, 24, 228, 232, 61, 88, 24, 216, 103, 61, 88, 24, 223, 30, 
+    61, 88, 24, 230, 223, 61, 88, 24, 225, 99, 61, 88, 24, 219, 151, 61, 88, 
+    24, 236, 64, 61, 88, 24, 250, 55, 61, 88, 24, 250, 115, 61, 88, 24, 234, 
+    117, 61, 88, 24, 216, 175, 61, 88, 24, 225, 135, 61, 88, 24, 241, 180, 
+    61, 88, 24, 250, 55, 69, 88, 234, 9, 135, 226, 221, 88, 234, 9, 135, 144, 
+    240, 229, 88, 154, 111, 88, 154, 105, 88, 154, 158, 88, 154, 161, 88, 
+    154, 190, 88, 154, 195, 88, 154, 199, 88, 154, 196, 88, 154, 201, 88, 
+    154, 216, 248, 88, 154, 230, 133, 88, 154, 244, 104, 88, 154, 212, 40, 
+    88, 154, 211, 214, 88, 154, 231, 44, 88, 154, 245, 231, 88, 154, 218, 38, 
+    88, 154, 218, 134, 88, 154, 241, 251, 88, 154, 219, 56, 88, 154, 229, 
+    209, 88, 154, 219, 6, 88, 154, 244, 110, 88, 154, 249, 208, 88, 154, 233, 
+    131, 88, 154, 223, 74, 88, 154, 251, 23, 88, 154, 218, 88, 88, 154, 218, 
+    21, 88, 154, 245, 135, 88, 154, 223, 66, 88, 154, 254, 159, 88, 154, 244, 
+    136, 88, 154, 223, 64, 88, 154, 220, 158, 88, 154, 223, 130, 37, 154, 
+    224, 15, 37, 154, 234, 86, 37, 154, 221, 200, 37, 154, 234, 5, 37, 54, 
+    216, 249, 226, 201, 85, 218, 236, 37, 54, 215, 74, 226, 201, 85, 218, 
+    236, 37, 54, 216, 164, 226, 201, 85, 218, 236, 37, 54, 244, 24, 226, 201, 
+    85, 218, 236, 37, 54, 244, 123, 226, 201, 85, 218, 236, 37, 54, 219, 114, 
+    226, 201, 85, 218, 236, 37, 54, 220, 119, 226, 201, 85, 218, 236, 37, 54, 
+    245, 193, 226, 201, 85, 218, 236, 225, 255, 50, 37, 54, 215, 74, 111, 37, 
+    54, 215, 74, 105, 37, 54, 215, 74, 158, 37, 54, 215, 74, 161, 37, 54, 
+    215, 74, 190, 37, 54, 215, 74, 195, 37, 54, 215, 74, 199, 37, 54, 215, 
+    74, 196, 37, 54, 215, 74, 201, 37, 54, 216, 163, 37, 54, 216, 164, 111, 
+    37, 54, 216, 164, 105, 37, 54, 216, 164, 158, 37, 54, 216, 164, 161, 37, 
+    54, 216, 164, 190, 37, 24, 234, 64, 37, 24, 228, 231, 37, 24, 216, 102, 
+    37, 24, 223, 29, 37, 24, 230, 222, 37, 24, 225, 98, 37, 24, 219, 150, 37, 
+    24, 236, 63, 37, 24, 250, 54, 37, 24, 250, 114, 37, 24, 234, 116, 37, 24, 
+    216, 174, 37, 24, 225, 134, 37, 24, 241, 179, 37, 24, 234, 65, 61, 37, 
+    24, 228, 232, 61, 37, 24, 216, 103, 61, 37, 24, 223, 30, 61, 37, 24, 230, 
+    223, 61, 37, 24, 225, 99, 61, 37, 24, 219, 151, 61, 37, 24, 236, 64, 61, 
+    37, 24, 250, 55, 61, 37, 24, 250, 115, 61, 37, 24, 234, 117, 61, 37, 24, 
+    216, 175, 61, 37, 24, 225, 135, 61, 37, 24, 241, 180, 61, 37, 234, 9, 
+    135, 250, 156, 37, 234, 9, 135, 235, 53, 37, 24, 236, 64, 69, 234, 9, 
+    218, 161, 87, 37, 154, 111, 37, 154, 105, 37, 154, 158, 37, 154, 161, 37, 
+    154, 190, 37, 154, 195, 37, 154, 199, 37, 154, 196, 37, 154, 201, 37, 
+    154, 216, 248, 37, 154, 230, 133, 37, 154, 244, 104, 37, 154, 212, 40, 
+    37, 154, 211, 214, 37, 154, 231, 44, 37, 154, 245, 231, 37, 154, 218, 38, 
+    37, 154, 218, 134, 37, 154, 241, 251, 37, 154, 219, 56, 37, 154, 229, 
+    209, 37, 154, 219, 6, 37, 154, 244, 110, 37, 154, 249, 208, 37, 154, 233, 
+    131, 37, 154, 221, 176, 37, 154, 231, 194, 37, 154, 244, 145, 37, 154, 
+    218, 50, 37, 154, 245, 42, 37, 154, 224, 190, 37, 154, 253, 204, 37, 154, 
+    235, 165, 37, 154, 223, 64, 37, 154, 249, 172, 37, 154, 249, 163, 37, 
+    154, 241, 172, 37, 154, 250, 182, 37, 154, 232, 116, 37, 154, 233, 52, 
+    37, 154, 222, 254, 37, 154, 231, 88, 37, 154, 223, 90, 37, 154, 218, 88, 
+    37, 154, 218, 21, 37, 154, 245, 135, 37, 154, 223, 66, 37, 154, 254, 159, 
+    37, 154, 228, 217, 37, 54, 216, 164, 195, 37, 54, 216, 164, 199, 37, 54, 
+    216, 164, 196, 37, 54, 216, 164, 201, 37, 54, 244, 23, 37, 54, 244, 24, 
+    111, 37, 54, 244, 24, 105, 37, 54, 244, 24, 158, 37, 54, 244, 24, 161, 
+    37, 54, 244, 24, 190, 37, 54, 244, 24, 195, 37, 54, 244, 24, 199, 37, 54, 
+    244, 24, 196, 37, 54, 244, 24, 201, 37, 54, 244, 122, 110, 217, 4, 16, 
+    31, 235, 139, 110, 217, 4, 16, 31, 244, 156, 110, 217, 4, 16, 31, 231, 
+    165, 110, 217, 4, 16, 31, 254, 55, 110, 217, 4, 16, 31, 231, 137, 110, 
+    217, 4, 16, 31, 235, 51, 110, 217, 4, 16, 31, 235, 52, 110, 217, 4, 16, 
+    31, 253, 196, 110, 217, 4, 16, 31, 220, 138, 110, 217, 4, 16, 31, 226, 
+    243, 110, 217, 4, 16, 31, 228, 45, 110, 217, 4, 16, 31, 248, 93, 42, 241, 
+    197, 42, 245, 96, 42, 245, 51, 232, 225, 232, 246, 50, 37, 56, 61, 37, 
+    56, 74, 37, 56, 69, 37, 56, 76, 37, 56, 78, 37, 56, 176, 37, 56, 234, 98, 
+    37, 56, 233, 223, 37, 56, 234, 188, 37, 56, 234, 34, 37, 56, 206, 37, 56, 
+    219, 193, 37, 56, 218, 84, 37, 56, 221, 183, 37, 56, 219, 60, 37, 56, 
+    217, 106, 37, 56, 216, 118, 37, 56, 215, 119, 37, 56, 217, 23, 37, 56, 
+    112, 37, 56, 198, 37, 56, 228, 238, 37, 56, 227, 242, 37, 56, 229, 112, 
+    37, 56, 228, 79, 37, 56, 162, 37, 56, 241, 187, 37, 56, 240, 229, 37, 56, 
+    241, 245, 37, 56, 241, 75, 37, 56, 186, 37, 56, 230, 235, 37, 56, 230, 
+    107, 37, 56, 231, 96, 37, 56, 230, 166, 37, 56, 192, 37, 56, 210, 212, 
+    37, 56, 210, 244, 37, 56, 205, 37, 56, 223, 38, 37, 56, 222, 142, 37, 56, 
+    223, 131, 37, 56, 222, 213, 37, 56, 212, 65, 37, 56, 211, 250, 37, 56, 
+    212, 22, 37, 56, 211, 227, 42, 254, 79, 42, 253, 247, 42, 254, 103, 42, 
+    255, 40, 42, 235, 233, 42, 235, 203, 42, 214, 166, 42, 245, 74, 42, 245, 
+    214, 42, 226, 190, 42, 226, 184, 42, 234, 251, 42, 234, 220, 42, 234, 
+    217, 42, 243, 99, 42, 243, 108, 42, 242, 211, 42, 242, 207, 42, 233, 156, 
+    42, 242, 200, 42, 234, 78, 42, 234, 77, 42, 234, 76, 42, 234, 75, 42, 
+    242, 93, 42, 242, 92, 42, 233, 199, 42, 233, 201, 42, 234, 184, 42, 234, 
+    7, 42, 234, 14, 42, 222, 18, 42, 221, 239, 42, 219, 131, 42, 220, 143, 
+    42, 220, 142, 42, 248, 226, 42, 248, 44, 42, 247, 129, 42, 216, 33, 42, 
+    229, 205, 42, 228, 46, 42, 242, 39, 42, 226, 88, 42, 226, 87, 42, 252, 
+    196, 42, 225, 108, 42, 225, 72, 42, 225, 73, 42, 251, 242, 42, 240, 228, 
+    42, 240, 224, 42, 251, 99, 42, 240, 211, 42, 241, 222, 42, 225, 162, 42, 
+    225, 197, 42, 241, 205, 42, 225, 194, 42, 225, 210, 42, 252, 69, 42, 225, 
+    9, 42, 251, 188, 42, 241, 63, 42, 224, 253, 42, 241, 55, 42, 241, 57, 42, 
+    231, 206, 42, 231, 202, 42, 231, 211, 42, 231, 155, 42, 231, 180, 42, 
+    230, 202, 42, 230, 181, 42, 230, 180, 42, 231, 79, 42, 231, 76, 42, 231, 
+    80, 42, 211, 102, 42, 211, 100, 42, 210, 201, 42, 222, 229, 42, 222, 233, 
+    42, 222, 119, 42, 222, 113, 42, 223, 88, 42, 223, 85, 42, 212, 38, 110, 
+    217, 4, 16, 31, 240, 246, 210, 86, 110, 217, 4, 16, 31, 240, 246, 111, 
+    110, 217, 4, 16, 31, 240, 246, 105, 110, 217, 4, 16, 31, 240, 246, 158, 
+    110, 217, 4, 16, 31, 240, 246, 161, 110, 217, 4, 16, 31, 240, 246, 190, 
+    110, 217, 4, 16, 31, 240, 246, 195, 110, 217, 4, 16, 31, 240, 246, 199, 
+    110, 217, 4, 16, 31, 240, 246, 196, 110, 217, 4, 16, 31, 240, 246, 201, 
+    110, 217, 4, 16, 31, 240, 246, 216, 248, 110, 217, 4, 16, 31, 240, 246, 
+    245, 175, 110, 217, 4, 16, 31, 240, 246, 215, 76, 110, 217, 4, 16, 31, 
+    240, 246, 216, 165, 110, 217, 4, 16, 31, 240, 246, 244, 13, 110, 217, 4, 
+    16, 31, 240, 246, 244, 126, 110, 217, 4, 16, 31, 240, 246, 219, 121, 110, 
+    217, 4, 16, 31, 240, 246, 220, 121, 110, 217, 4, 16, 31, 240, 246, 245, 
+    198, 110, 217, 4, 16, 31, 240, 246, 228, 202, 110, 217, 4, 16, 31, 240, 
+    246, 215, 73, 110, 217, 4, 16, 31, 240, 246, 215, 67, 110, 217, 4, 16, 
+    31, 240, 246, 215, 63, 110, 217, 4, 16, 31, 240, 246, 215, 64, 110, 217, 
+    4, 16, 31, 240, 246, 215, 69, 42, 240, 237, 42, 248, 229, 42, 253, 200, 
+    42, 130, 42, 226, 129, 42, 225, 229, 42, 247, 155, 42, 247, 156, 218, 
+    235, 42, 247, 156, 249, 116, 42, 235, 162, 42, 245, 99, 229, 210, 241, 
+    223, 42, 245, 99, 229, 210, 217, 175, 42, 245, 99, 229, 210, 217, 75, 42, 
+    245, 99, 229, 210, 231, 75, 42, 249, 165, 42, 226, 94, 254, 133, 42, 198, 
+    42, 230, 108, 61, 42, 186, 42, 176, 42, 234, 191, 42, 231, 134, 42, 243, 
+    87, 42, 251, 26, 42, 234, 190, 42, 225, 153, 42, 229, 86, 42, 230, 108, 
+    245, 14, 42, 230, 108, 243, 209, 42, 231, 20, 42, 234, 140, 42, 240, 170, 
+    42, 234, 100, 42, 230, 237, 42, 242, 223, 42, 216, 120, 42, 230, 108, 
+    156, 42, 230, 174, 42, 247, 165, 42, 234, 46, 42, 244, 53, 42, 228, 117, 
+    42, 230, 108, 194, 42, 230, 171, 42, 249, 247, 42, 234, 40, 42, 230, 172, 
+    218, 235, 42, 249, 248, 218, 235, 42, 232, 55, 218, 235, 42, 234, 41, 
+    218, 235, 42, 230, 172, 249, 116, 42, 249, 248, 249, 116, 42, 232, 55, 
+    249, 116, 42, 234, 41, 249, 116, 42, 232, 55, 115, 222, 93, 42, 232, 55, 
+    115, 222, 94, 218, 235, 42, 191, 42, 234, 1, 42, 230, 110, 42, 242, 158, 
+    42, 223, 179, 42, 223, 180, 115, 222, 93, 42, 223, 180, 115, 222, 94, 
+    218, 235, 42, 224, 165, 42, 228, 18, 42, 230, 108, 222, 93, 42, 230, 109, 
+    42, 224, 119, 42, 227, 180, 42, 230, 108, 214, 105, 42, 230, 54, 42, 233, 
+    191, 42, 230, 55, 231, 79, 42, 224, 118, 42, 227, 179, 42, 230, 108, 212, 
+    98, 42, 230, 48, 42, 233, 189, 42, 230, 49, 231, 79, 42, 235, 30, 226, 
+    224, 42, 232, 55, 226, 224, 42, 254, 144, 42, 251, 168, 42, 250, 222, 42, 
+    250, 199, 42, 251, 75, 115, 234, 140, 42, 249, 246, 42, 248, 150, 42, 
+    242, 79, 42, 162, 42, 240, 238, 42, 236, 6, 42, 234, 53, 42, 234, 41, 
+    251, 2, 42, 233, 225, 42, 232, 165, 42, 232, 164, 42, 232, 153, 42, 232, 
+    68, 42, 231, 135, 219, 81, 42, 230, 201, 42, 230, 157, 42, 225, 151, 42, 
+    225, 22, 42, 224, 222, 42, 224, 220, 42, 218, 229, 42, 218, 3, 42, 212, 
+    24, 42, 214, 106, 115, 194, 42, 116, 115, 194, 110, 217, 4, 16, 31, 248, 
+    154, 111, 110, 217, 4, 16, 31, 248, 154, 105, 110, 217, 4, 16, 31, 248, 
+    154, 158, 110, 217, 4, 16, 31, 248, 154, 161, 110, 217, 4, 16, 31, 248, 
+    154, 190, 110, 217, 4, 16, 31, 248, 154, 195, 110, 217, 4, 16, 31, 248, 
+    154, 199, 110, 217, 4, 16, 31, 248, 154, 196, 110, 217, 4, 16, 31, 248, 
+    154, 201, 110, 217, 4, 16, 31, 248, 154, 216, 248, 110, 217, 4, 16, 31, 
+    248, 154, 245, 175, 110, 217, 4, 16, 31, 248, 154, 215, 76, 110, 217, 4, 
+    16, 31, 248, 154, 216, 165, 110, 217, 4, 16, 31, 248, 154, 244, 13, 110, 
+    217, 4, 16, 31, 248, 154, 244, 126, 110, 217, 4, 16, 31, 248, 154, 219, 
+    121, 110, 217, 4, 16, 31, 248, 154, 220, 121, 110, 217, 4, 16, 31, 248, 
+    154, 245, 198, 110, 217, 4, 16, 31, 248, 154, 228, 202, 110, 217, 4, 16, 
+    31, 248, 154, 215, 73, 110, 217, 4, 16, 31, 248, 154, 215, 67, 110, 217, 
+    4, 16, 31, 248, 154, 215, 63, 110, 217, 4, 16, 31, 248, 154, 215, 64, 
+    110, 217, 4, 16, 31, 248, 154, 215, 69, 110, 217, 4, 16, 31, 248, 154, 
+    215, 70, 110, 217, 4, 16, 31, 248, 154, 215, 65, 110, 217, 4, 16, 31, 
+    248, 154, 215, 66, 110, 217, 4, 16, 31, 248, 154, 215, 72, 110, 217, 4, 
+    16, 31, 248, 154, 215, 68, 110, 217, 4, 16, 31, 248, 154, 216, 163, 110, 
+    217, 4, 16, 31, 248, 154, 216, 162, 42, 243, 125, 241, 199, 31, 216, 197, 
+    249, 148, 241, 230, 241, 199, 31, 216, 197, 223, 125, 245, 231, 241, 199, 
+    31, 247, 239, 253, 215, 216, 197, 252, 64, 241, 199, 31, 210, 223, 244, 
+    46, 241, 199, 31, 212, 59, 241, 199, 31, 249, 211, 241, 199, 31, 216, 
+    197, 254, 11, 241, 199, 31, 241, 67, 216, 39, 241, 199, 31, 4, 217, 62, 
+    241, 199, 31, 215, 238, 241, 199, 31, 225, 222, 241, 199, 31, 218, 160, 
+    241, 199, 31, 244, 147, 241, 199, 31, 242, 139, 224, 243, 241, 199, 31, 
+    230, 160, 241, 199, 31, 245, 134, 241, 199, 31, 244, 47, 241, 199, 31, 
+    211, 207, 226, 201, 216, 197, 248, 94, 241, 199, 31, 254, 59, 241, 199, 
+    31, 249, 193, 241, 199, 31, 251, 235, 216, 139, 241, 199, 31, 242, 156, 
+    241, 199, 31, 218, 247, 254, 78, 241, 199, 31, 223, 56, 241, 199, 31, 
+    235, 227, 241, 199, 31, 242, 139, 217, 62, 241, 199, 31, 230, 116, 249, 
+    167, 241, 199, 31, 242, 139, 224, 200, 241, 199, 31, 216, 197, 255, 27, 
+    212, 40, 241, 199, 31, 216, 197, 250, 16, 244, 104, 241, 199, 31, 235, 
+    240, 241, 199, 31, 246, 65, 241, 199, 31, 223, 59, 241, 199, 31, 242, 
+    139, 224, 227, 241, 199, 31, 224, 180, 241, 199, 31, 248, 169, 64, 216, 
+    197, 232, 236, 241, 199, 31, 216, 197, 244, 182, 241, 199, 31, 226, 167, 
+    241, 199, 31, 226, 248, 241, 199, 31, 248, 67, 241, 199, 31, 248, 87, 
+    241, 199, 31, 235, 254, 241, 199, 31, 251, 157, 241, 199, 31, 249, 229, 
+    216, 43, 231, 81, 241, 199, 31, 243, 94, 216, 39, 241, 199, 31, 224, 128, 
+    214, 154, 241, 199, 31, 226, 166, 241, 199, 31, 216, 197, 212, 13, 241, 
+    199, 31, 223, 48, 241, 199, 31, 216, 197, 250, 228, 241, 199, 31, 216, 
+    197, 254, 7, 216, 134, 241, 199, 31, 216, 197, 234, 185, 218, 136, 230, 
+    120, 241, 199, 31, 248, 40, 241, 199, 31, 216, 197, 231, 157, 231, 207, 
+    241, 199, 31, 255, 28, 241, 199, 31, 216, 197, 212, 54, 241, 199, 31, 
+    216, 197, 243, 54, 211, 239, 241, 199, 31, 216, 197, 235, 58, 233, 113, 
+    241, 199, 31, 247, 192, 241, 199, 31, 232, 226, 241, 199, 31, 235, 230, 
+    215, 188, 241, 199, 31, 4, 224, 200, 241, 199, 31, 254, 226, 249, 220, 
+    241, 199, 31, 252, 67, 249, 220, 8, 3, 235, 166, 8, 3, 235, 159, 8, 3, 
+    74, 8, 3, 235, 189, 8, 3, 236, 65, 8, 3, 236, 48, 8, 3, 236, 67, 8, 3, 
+    236, 66, 8, 3, 253, 214, 8, 3, 253, 177, 8, 3, 61, 8, 3, 254, 80, 8, 3, 
+    214, 164, 8, 3, 214, 167, 8, 3, 214, 165, 8, 3, 226, 144, 8, 3, 226, 118, 
+    8, 3, 78, 8, 3, 226, 179, 8, 3, 245, 43, 8, 3, 76, 8, 3, 211, 195, 8, 3, 
+    251, 236, 8, 3, 251, 233, 8, 3, 252, 14, 8, 3, 251, 246, 8, 3, 252, 3, 8, 
+    3, 252, 2, 8, 3, 252, 5, 8, 3, 252, 4, 8, 3, 252, 129, 8, 3, 252, 121, 8, 
+    3, 252, 199, 8, 3, 252, 150, 8, 3, 251, 109, 8, 3, 251, 113, 8, 3, 251, 
+    110, 8, 3, 251, 187, 8, 3, 251, 171, 8, 3, 251, 213, 8, 3, 251, 193, 8, 
+    3, 252, 29, 8, 3, 252, 83, 8, 3, 252, 41, 8, 3, 251, 95, 8, 3, 251, 92, 
+    8, 3, 251, 133, 8, 3, 251, 108, 8, 3, 251, 102, 8, 3, 251, 106, 8, 3, 
+    251, 80, 8, 3, 251, 78, 8, 3, 251, 85, 8, 3, 251, 83, 8, 3, 251, 81, 8, 
+    3, 251, 82, 8, 3, 225, 52, 8, 3, 225, 48, 8, 3, 225, 111, 8, 3, 225, 62, 
+    8, 3, 225, 78, 8, 3, 225, 105, 8, 3, 225, 101, 8, 3, 225, 244, 8, 3, 225, 
+    234, 8, 3, 191, 8, 3, 226, 25, 8, 3, 224, 138, 8, 3, 224, 140, 8, 3, 224, 
+    139, 8, 3, 224, 236, 8, 3, 224, 225, 8, 3, 225, 19, 8, 3, 224, 248, 8, 3, 
+    224, 124, 8, 3, 224, 120, 8, 3, 224, 153, 8, 3, 224, 137, 8, 3, 224, 129, 
+    8, 3, 224, 135, 8, 3, 224, 103, 8, 3, 224, 102, 8, 3, 224, 107, 8, 3, 
+    224, 106, 8, 3, 224, 104, 8, 3, 224, 105, 8, 3, 252, 104, 8, 3, 252, 103, 
+    8, 3, 252, 110, 8, 3, 252, 105, 8, 3, 252, 107, 8, 3, 252, 106, 8, 3, 
+    252, 109, 8, 3, 252, 108, 8, 3, 252, 116, 8, 3, 252, 115, 8, 3, 252, 119, 
+    8, 3, 252, 117, 8, 3, 252, 95, 8, 3, 252, 97, 8, 3, 252, 96, 8, 3, 252, 
+    100, 8, 3, 252, 99, 8, 3, 252, 102, 8, 3, 252, 101, 8, 3, 252, 111, 8, 3, 
+    252, 114, 8, 3, 252, 112, 8, 3, 252, 91, 8, 3, 252, 90, 8, 3, 252, 98, 8, 
+    3, 252, 94, 8, 3, 252, 92, 8, 3, 252, 93, 8, 3, 252, 87, 8, 3, 252, 86, 
+    8, 3, 252, 89, 8, 3, 252, 88, 8, 3, 229, 174, 8, 3, 229, 173, 8, 3, 229, 
+    179, 8, 3, 229, 175, 8, 3, 229, 176, 8, 3, 229, 178, 8, 3, 229, 177, 8, 
+    3, 229, 182, 8, 3, 229, 181, 8, 3, 229, 184, 8, 3, 229, 183, 8, 3, 229, 
+    170, 8, 3, 229, 169, 8, 3, 229, 172, 8, 3, 229, 171, 8, 3, 229, 163, 8, 
+    3, 229, 162, 8, 3, 229, 167, 8, 3, 229, 166, 8, 3, 229, 164, 8, 3, 229, 
+    165, 8, 3, 229, 157, 8, 3, 229, 156, 8, 3, 229, 161, 8, 3, 229, 160, 8, 
+    3, 229, 158, 8, 3, 229, 159, 8, 3, 241, 117, 8, 3, 241, 116, 8, 3, 241, 
+    122, 8, 3, 241, 118, 8, 3, 241, 119, 8, 3, 241, 121, 8, 3, 241, 120, 8, 
+    3, 241, 125, 8, 3, 241, 124, 8, 3, 241, 127, 8, 3, 241, 126, 8, 3, 241, 
+    108, 8, 3, 241, 110, 8, 3, 241, 109, 8, 3, 241, 113, 8, 3, 241, 112, 8, 
+    3, 241, 115, 8, 3, 241, 114, 8, 3, 241, 104, 8, 3, 241, 103, 8, 3, 241, 
+    111, 8, 3, 241, 107, 8, 3, 241, 105, 8, 3, 241, 106, 8, 3, 241, 98, 8, 3, 
+    241, 102, 8, 3, 241, 101, 8, 3, 241, 99, 8, 3, 241, 100, 8, 3, 230, 177, 
+    8, 3, 230, 176, 8, 3, 230, 235, 8, 3, 230, 183, 8, 3, 230, 208, 8, 3, 
+    230, 226, 8, 3, 230, 224, 8, 3, 231, 144, 8, 3, 231, 139, 8, 3, 186, 8, 
+    3, 231, 177, 8, 3, 230, 79, 8, 3, 230, 78, 8, 3, 230, 82, 8, 3, 230, 80, 
+    8, 3, 230, 126, 8, 3, 230, 112, 8, 3, 230, 166, 8, 3, 230, 131, 8, 3, 
+    231, 31, 8, 3, 231, 96, 8, 3, 230, 60, 8, 3, 230, 56, 8, 3, 230, 107, 8, 
+    3, 230, 75, 8, 3, 230, 68, 8, 3, 230, 73, 8, 3, 230, 33, 8, 3, 230, 32, 
+    8, 3, 230, 38, 8, 3, 230, 35, 8, 3, 244, 91, 8, 3, 244, 86, 8, 3, 244, 
+    129, 8, 3, 244, 106, 8, 3, 244, 175, 8, 3, 244, 166, 8, 3, 244, 204, 8, 
+    3, 244, 178, 8, 3, 244, 11, 8, 3, 244, 51, 8, 3, 244, 35, 8, 3, 243, 225, 
+    8, 3, 243, 224, 8, 3, 243, 241, 8, 3, 243, 230, 8, 3, 243, 228, 8, 3, 
+    243, 229, 8, 3, 243, 212, 8, 3, 243, 211, 8, 3, 243, 215, 8, 3, 243, 213, 
+    8, 3, 213, 144, 8, 3, 213, 139, 8, 3, 213, 176, 8, 3, 213, 153, 8, 3, 
+    213, 166, 8, 3, 213, 163, 8, 3, 213, 168, 8, 3, 213, 167, 8, 3, 214, 7, 
+    8, 3, 214, 2, 8, 3, 214, 27, 8, 3, 214, 18, 8, 3, 213, 125, 8, 3, 213, 
+    121, 8, 3, 213, 138, 8, 3, 213, 126, 8, 3, 213, 178, 8, 3, 213, 244, 8, 
+    3, 212, 110, 8, 3, 212, 108, 8, 3, 212, 116, 8, 3, 212, 113, 8, 3, 212, 
+    111, 8, 3, 212, 112, 8, 3, 212, 102, 8, 3, 212, 101, 8, 3, 212, 106, 8, 
+    3, 212, 105, 8, 3, 212, 103, 8, 3, 212, 104, 8, 3, 247, 186, 8, 3, 247, 
+    174, 8, 3, 248, 11, 8, 3, 247, 211, 8, 3, 247, 244, 8, 3, 247, 248, 8, 3, 
+    247, 247, 8, 3, 248, 160, 8, 3, 248, 155, 8, 3, 248, 229, 8, 3, 248, 180, 
+    8, 3, 246, 70, 8, 3, 246, 71, 8, 3, 247, 128, 8, 3, 246, 110, 8, 3, 247, 
+    153, 8, 3, 247, 130, 8, 3, 248, 38, 8, 3, 248, 98, 8, 3, 248, 53, 8, 3, 
+    246, 61, 8, 3, 246, 59, 8, 3, 246, 86, 8, 3, 246, 69, 8, 3, 246, 64, 8, 
+    3, 246, 67, 8, 3, 216, 68, 8, 3, 216, 62, 8, 3, 216, 118, 8, 3, 216, 77, 
+    8, 3, 216, 110, 8, 3, 216, 112, 8, 3, 216, 111, 8, 3, 217, 47, 8, 3, 217, 
+    34, 8, 3, 217, 106, 8, 3, 217, 55, 8, 3, 215, 103, 8, 3, 215, 102, 8, 3, 
+    215, 105, 8, 3, 215, 104, 8, 3, 216, 6, 8, 3, 216, 2, 8, 3, 112, 8, 3, 
+    216, 14, 8, 3, 216, 214, 8, 3, 217, 23, 8, 3, 216, 238, 8, 3, 215, 88, 8, 
+    3, 215, 83, 8, 3, 215, 119, 8, 3, 215, 101, 8, 3, 215, 89, 8, 3, 215, 99, 
+    8, 3, 248, 115, 8, 3, 248, 114, 8, 3, 248, 120, 8, 3, 248, 116, 8, 3, 
+    248, 117, 8, 3, 248, 119, 8, 3, 248, 118, 8, 3, 248, 136, 8, 3, 248, 135, 
+    8, 3, 248, 143, 8, 3, 248, 137, 8, 3, 248, 105, 8, 3, 248, 107, 8, 3, 
+    248, 106, 8, 3, 248, 110, 8, 3, 248, 109, 8, 3, 248, 113, 8, 3, 248, 111, 
+    8, 3, 248, 128, 8, 3, 248, 131, 8, 3, 248, 129, 8, 3, 248, 101, 8, 3, 
+    248, 100, 8, 3, 248, 108, 8, 3, 248, 104, 8, 3, 248, 102, 8, 3, 248, 103, 
+    8, 3, 229, 131, 8, 3, 229, 130, 8, 3, 229, 138, 8, 3, 229, 133, 8, 3, 
+    229, 134, 8, 3, 229, 135, 8, 3, 229, 147, 8, 3, 229, 146, 8, 3, 229, 153, 
+    8, 3, 229, 148, 8, 3, 229, 123, 8, 3, 229, 122, 8, 3, 229, 129, 8, 3, 
+    229, 124, 8, 3, 229, 139, 8, 3, 229, 145, 8, 3, 229, 143, 8, 3, 229, 115, 
+    8, 3, 229, 114, 8, 3, 229, 120, 8, 3, 229, 118, 8, 3, 229, 116, 8, 3, 
+    229, 117, 8, 3, 241, 84, 8, 3, 241, 83, 8, 3, 241, 90, 8, 3, 241, 85, 8, 
+    3, 241, 87, 8, 3, 241, 86, 8, 3, 241, 89, 8, 3, 241, 88, 8, 3, 241, 95, 
+    8, 3, 241, 94, 8, 3, 241, 97, 8, 3, 241, 96, 8, 3, 241, 78, 8, 3, 241, 
+    79, 8, 3, 241, 81, 8, 3, 241, 80, 8, 3, 241, 82, 8, 3, 241, 91, 8, 3, 
+    241, 93, 8, 3, 241, 92, 8, 3, 241, 77, 8, 3, 228, 194, 8, 3, 228, 192, 8, 
+    3, 228, 238, 8, 3, 228, 197, 8, 3, 228, 220, 8, 3, 228, 234, 8, 3, 228, 
+    233, 8, 3, 229, 188, 8, 3, 198, 8, 3, 229, 202, 8, 3, 227, 190, 8, 3, 
+    227, 192, 8, 3, 227, 191, 8, 3, 228, 56, 8, 3, 228, 43, 8, 3, 228, 79, 8, 
+    3, 228, 65, 8, 3, 229, 88, 8, 3, 229, 112, 8, 3, 229, 99, 8, 3, 227, 185, 
+    8, 3, 227, 181, 8, 3, 227, 242, 8, 3, 227, 189, 8, 3, 227, 187, 8, 3, 
+    227, 188, 8, 3, 241, 148, 8, 3, 241, 147, 8, 3, 241, 153, 8, 3, 241, 149, 
+    8, 3, 241, 150, 8, 3, 241, 152, 8, 3, 241, 151, 8, 3, 241, 158, 8, 3, 
+    241, 157, 8, 3, 241, 160, 8, 3, 241, 159, 8, 3, 241, 140, 8, 3, 241, 142, 
+    8, 3, 241, 141, 8, 3, 241, 144, 8, 3, 241, 146, 8, 3, 241, 145, 8, 3, 
+    241, 154, 8, 3, 241, 156, 8, 3, 241, 155, 8, 3, 241, 136, 8, 3, 241, 135, 
+    8, 3, 241, 143, 8, 3, 241, 139, 8, 3, 241, 137, 8, 3, 241, 138, 8, 3, 
+    241, 130, 8, 3, 241, 129, 8, 3, 241, 134, 8, 3, 241, 133, 8, 3, 241, 131, 
+    8, 3, 241, 132, 8, 3, 232, 201, 8, 3, 232, 195, 8, 3, 232, 247, 8, 3, 
+    232, 208, 8, 3, 232, 239, 8, 3, 232, 238, 8, 3, 232, 242, 8, 3, 232, 240, 
+    8, 3, 233, 85, 8, 3, 233, 75, 8, 3, 233, 141, 8, 3, 233, 94, 8, 3, 232, 
+    84, 8, 3, 232, 83, 8, 3, 232, 86, 8, 3, 232, 85, 8, 3, 232, 122, 8, 3, 
+    232, 112, 8, 3, 232, 162, 8, 3, 232, 126, 8, 3, 233, 8, 8, 3, 233, 64, 8, 
+    3, 233, 23, 8, 3, 232, 79, 8, 3, 232, 77, 8, 3, 232, 103, 8, 3, 232, 82, 
+    8, 3, 232, 80, 8, 3, 232, 81, 8, 3, 232, 59, 8, 3, 232, 58, 8, 3, 232, 
+    67, 8, 3, 232, 62, 8, 3, 232, 60, 8, 3, 232, 61, 8, 3, 242, 196, 8, 3, 
+    242, 195, 8, 3, 242, 221, 8, 3, 242, 206, 8, 3, 242, 213, 8, 3, 242, 212, 
+    8, 3, 242, 215, 8, 3, 242, 214, 8, 3, 243, 96, 8, 3, 243, 91, 8, 3, 243, 
+    142, 8, 3, 243, 106, 8, 3, 242, 98, 8, 3, 242, 97, 8, 3, 242, 100, 8, 3, 
+    242, 99, 8, 3, 242, 161, 8, 3, 242, 159, 8, 3, 242, 181, 8, 3, 242, 169, 
+    8, 3, 243, 40, 8, 3, 243, 38, 8, 3, 243, 69, 8, 3, 243, 51, 8, 3, 242, 
+    88, 8, 3, 242, 87, 8, 3, 242, 120, 8, 3, 242, 96, 8, 3, 242, 89, 8, 3, 
+    242, 95, 8, 3, 234, 67, 8, 3, 234, 66, 8, 3, 234, 98, 8, 3, 234, 81, 8, 
+    3, 234, 91, 8, 3, 234, 94, 8, 3, 234, 92, 8, 3, 234, 208, 8, 3, 234, 196, 
+    8, 3, 176, 8, 3, 234, 234, 8, 3, 233, 206, 8, 3, 233, 211, 8, 3, 233, 
+    208, 8, 3, 234, 6, 8, 3, 234, 2, 8, 3, 234, 34, 8, 3, 234, 13, 8, 3, 234, 
+    162, 8, 3, 234, 146, 8, 3, 234, 188, 8, 3, 234, 165, 8, 3, 233, 195, 8, 
+    3, 233, 192, 8, 3, 233, 223, 8, 3, 233, 205, 8, 3, 233, 198, 8, 3, 233, 
+    202, 8, 3, 243, 22, 8, 3, 243, 21, 8, 3, 243, 26, 8, 3, 243, 23, 8, 3, 
+    243, 25, 8, 3, 243, 24, 8, 3, 243, 33, 8, 3, 243, 32, 8, 3, 243, 36, 8, 
+    3, 243, 34, 8, 3, 243, 13, 8, 3, 243, 12, 8, 3, 243, 15, 8, 3, 243, 14, 
+    8, 3, 243, 18, 8, 3, 243, 17, 8, 3, 243, 20, 8, 3, 243, 19, 8, 3, 243, 
+    28, 8, 3, 243, 27, 8, 3, 243, 31, 8, 3, 243, 29, 8, 3, 243, 8, 8, 3, 243, 
+    7, 8, 3, 243, 16, 8, 3, 243, 11, 8, 3, 243, 9, 8, 3, 243, 10, 8, 3, 230, 
+    254, 8, 3, 230, 255, 8, 3, 231, 17, 8, 3, 231, 16, 8, 3, 231, 19, 8, 3, 
+    231, 18, 8, 3, 230, 245, 8, 3, 230, 247, 8, 3, 230, 246, 8, 3, 230, 250, 
+    8, 3, 230, 249, 8, 3, 230, 252, 8, 3, 230, 251, 8, 3, 231, 0, 8, 3, 231, 
+    2, 8, 3, 231, 1, 8, 3, 230, 241, 8, 3, 230, 240, 8, 3, 230, 248, 8, 3, 
+    230, 244, 8, 3, 230, 242, 8, 3, 230, 243, 8, 3, 240, 187, 8, 3, 240, 186, 
+    8, 3, 240, 193, 8, 3, 240, 188, 8, 3, 240, 190, 8, 3, 240, 189, 8, 3, 
+    240, 192, 8, 3, 240, 191, 8, 3, 240, 198, 8, 3, 240, 197, 8, 3, 240, 200, 
+    8, 3, 240, 199, 8, 3, 240, 179, 8, 3, 240, 178, 8, 3, 240, 181, 8, 3, 
+    240, 180, 8, 3, 240, 183, 8, 3, 240, 182, 8, 3, 240, 185, 8, 3, 240, 184, 
+    8, 3, 240, 194, 8, 3, 240, 196, 8, 3, 240, 195, 8, 3, 229, 29, 8, 3, 229, 
+    31, 8, 3, 229, 30, 8, 3, 229, 72, 8, 3, 229, 70, 8, 3, 229, 82, 8, 3, 
+    229, 75, 8, 3, 228, 248, 8, 3, 228, 247, 8, 3, 228, 249, 8, 3, 229, 1, 8, 
+    3, 228, 254, 8, 3, 229, 9, 8, 3, 229, 3, 8, 3, 229, 63, 8, 3, 229, 69, 8, 
+    3, 229, 65, 8, 3, 241, 163, 8, 3, 241, 173, 8, 3, 241, 182, 8, 3, 242, 2, 
+    8, 3, 241, 250, 8, 3, 162, 8, 3, 242, 13, 8, 3, 240, 213, 8, 3, 240, 212, 
+    8, 3, 240, 215, 8, 3, 240, 214, 8, 3, 240, 249, 8, 3, 240, 240, 8, 3, 
+    241, 75, 8, 3, 241, 54, 8, 3, 241, 201, 8, 3, 241, 245, 8, 3, 241, 213, 
+    8, 3, 212, 43, 8, 3, 212, 28, 8, 3, 212, 65, 8, 3, 212, 51, 8, 3, 211, 
+    185, 8, 3, 211, 187, 8, 3, 211, 186, 8, 3, 211, 203, 8, 3, 211, 227, 8, 
+    3, 211, 210, 8, 3, 212, 5, 8, 3, 212, 22, 8, 3, 212, 10, 8, 3, 210, 30, 
+    8, 3, 210, 29, 8, 3, 210, 44, 8, 3, 210, 32, 8, 3, 210, 37, 8, 3, 210, 
+    39, 8, 3, 210, 38, 8, 3, 210, 102, 8, 3, 210, 99, 8, 3, 210, 116, 8, 3, 
+    210, 105, 8, 3, 210, 6, 8, 3, 210, 8, 8, 3, 210, 7, 8, 3, 210, 19, 8, 3, 
+    210, 18, 8, 3, 210, 23, 8, 3, 210, 20, 8, 3, 210, 84, 8, 3, 210, 94, 8, 
+    3, 210, 88, 8, 3, 210, 2, 8, 3, 210, 1, 8, 3, 210, 13, 8, 3, 210, 5, 8, 
+    3, 210, 3, 8, 3, 210, 4, 8, 3, 209, 245, 8, 3, 209, 244, 8, 3, 209, 250, 
+    8, 3, 209, 248, 8, 3, 209, 246, 8, 3, 209, 247, 8, 3, 250, 36, 8, 3, 250, 
+    32, 8, 3, 250, 59, 8, 3, 250, 45, 8, 3, 250, 56, 8, 3, 250, 50, 8, 3, 
+    250, 58, 8, 3, 250, 57, 8, 3, 250, 232, 8, 3, 250, 225, 8, 3, 251, 41, 8, 
+    3, 251, 3, 8, 3, 249, 112, 8, 3, 249, 114, 8, 3, 249, 113, 8, 3, 249, 
+    161, 8, 3, 249, 152, 8, 3, 249, 246, 8, 3, 249, 177, 8, 3, 250, 168, 8, 
+    3, 250, 198, 8, 3, 250, 173, 8, 3, 249, 92, 8, 3, 249, 90, 8, 3, 249, 
+    120, 8, 3, 249, 110, 8, 3, 249, 97, 8, 3, 249, 109, 8, 3, 249, 71, 8, 3, 
+    249, 70, 8, 3, 249, 81, 8, 3, 249, 77, 8, 3, 249, 72, 8, 3, 249, 74, 8, 
+    3, 209, 228, 8, 3, 209, 227, 8, 3, 209, 234, 8, 3, 209, 229, 8, 3, 209, 
+    231, 8, 3, 209, 230, 8, 3, 209, 233, 8, 3, 209, 232, 8, 3, 209, 240, 8, 
+    3, 209, 239, 8, 3, 209, 243, 8, 3, 209, 241, 8, 3, 209, 224, 8, 3, 209, 
+    226, 8, 3, 209, 225, 8, 3, 209, 235, 8, 3, 209, 238, 8, 3, 209, 236, 8, 
+    3, 209, 217, 8, 3, 209, 221, 8, 3, 209, 220, 8, 3, 209, 218, 8, 3, 209, 
+    219, 8, 3, 209, 211, 8, 3, 209, 210, 8, 3, 209, 216, 8, 3, 209, 214, 8, 
+    3, 209, 212, 8, 3, 209, 213, 8, 3, 227, 108, 8, 3, 227, 107, 8, 3, 227, 
+    113, 8, 3, 227, 109, 8, 3, 227, 110, 8, 3, 227, 112, 8, 3, 227, 111, 8, 
+    3, 227, 118, 8, 3, 227, 117, 8, 3, 227, 121, 8, 3, 227, 120, 8, 3, 227, 
+    101, 8, 3, 227, 102, 8, 3, 227, 105, 8, 3, 227, 106, 8, 3, 227, 114, 8, 
+    3, 227, 116, 8, 3, 227, 96, 8, 3, 227, 104, 8, 3, 227, 100, 8, 3, 227, 
+    97, 8, 3, 227, 98, 8, 3, 227, 91, 8, 3, 227, 90, 8, 3, 227, 95, 8, 3, 
+    227, 94, 8, 3, 227, 92, 8, 3, 227, 93, 8, 3, 219, 129, 8, 3, 195, 8, 3, 
+    219, 193, 8, 3, 219, 132, 8, 3, 219, 185, 8, 3, 219, 188, 8, 3, 219, 186, 
+    8, 3, 221, 228, 8, 3, 221, 216, 8, 3, 206, 8, 3, 221, 236, 8, 3, 218, 29, 
+    8, 3, 218, 31, 8, 3, 218, 30, 8, 3, 219, 36, 8, 3, 219, 25, 8, 3, 219, 
+    60, 8, 3, 219, 40, 8, 3, 220, 116, 8, 3, 221, 183, 8, 3, 220, 141, 8, 3, 
+    218, 6, 8, 3, 218, 4, 8, 3, 218, 84, 8, 3, 218, 28, 8, 3, 218, 10, 8, 3, 
+    218, 18, 8, 3, 217, 167, 8, 3, 217, 166, 8, 3, 217, 233, 8, 3, 217, 174, 
+    8, 3, 217, 169, 8, 3, 217, 173, 8, 3, 218, 188, 8, 3, 218, 187, 8, 3, 
+    218, 194, 8, 3, 218, 189, 8, 3, 218, 191, 8, 3, 218, 193, 8, 3, 218, 192, 
+    8, 3, 218, 202, 8, 3, 218, 200, 8, 3, 218, 225, 8, 3, 218, 203, 8, 3, 
+    218, 183, 8, 3, 218, 182, 8, 3, 218, 186, 8, 3, 218, 184, 8, 3, 218, 196, 
+    8, 3, 218, 199, 8, 3, 218, 197, 8, 3, 218, 179, 8, 3, 218, 177, 8, 3, 
+    218, 181, 8, 3, 218, 180, 8, 3, 218, 172, 8, 3, 218, 171, 8, 3, 218, 176, 
+    8, 3, 218, 175, 8, 3, 218, 173, 8, 3, 218, 174, 8, 3, 210, 77, 8, 3, 210, 
+    76, 8, 3, 210, 82, 8, 3, 210, 79, 8, 3, 210, 59, 8, 3, 210, 61, 8, 3, 
+    210, 60, 8, 3, 210, 64, 8, 3, 210, 63, 8, 3, 210, 67, 8, 3, 210, 65, 8, 
+    3, 210, 71, 8, 3, 210, 70, 8, 3, 210, 74, 8, 3, 210, 72, 8, 3, 210, 55, 
+    8, 3, 210, 54, 8, 3, 210, 62, 8, 3, 210, 58, 8, 3, 210, 56, 8, 3, 210, 
+    57, 8, 3, 210, 47, 8, 3, 210, 46, 8, 3, 210, 51, 8, 3, 210, 50, 8, 3, 
+    210, 48, 8, 3, 210, 49, 8, 3, 250, 144, 8, 3, 250, 141, 8, 3, 250, 165, 
+    8, 3, 250, 152, 8, 3, 250, 73, 8, 3, 250, 72, 8, 3, 250, 75, 8, 3, 250, 
+    74, 8, 3, 250, 87, 8, 3, 250, 86, 8, 3, 250, 94, 8, 3, 250, 89, 8, 3, 
+    250, 123, 8, 3, 250, 121, 8, 3, 250, 139, 8, 3, 250, 129, 8, 3, 250, 67, 
+    8, 3, 250, 77, 8, 3, 250, 71, 8, 3, 250, 68, 8, 3, 250, 70, 8, 3, 250, 
+    61, 8, 3, 250, 60, 8, 3, 250, 65, 8, 3, 250, 64, 8, 3, 250, 62, 8, 3, 
+    250, 63, 8, 3, 222, 177, 8, 3, 222, 181, 8, 3, 222, 160, 8, 3, 222, 161, 
+    8, 3, 222, 164, 8, 3, 222, 163, 8, 3, 222, 167, 8, 3, 222, 165, 8, 3, 
+    222, 171, 8, 3, 222, 170, 8, 3, 222, 176, 8, 3, 222, 172, 8, 3, 222, 156, 
+    8, 3, 222, 154, 8, 3, 222, 162, 8, 3, 222, 159, 8, 3, 222, 157, 8, 3, 
+    222, 158, 8, 3, 222, 149, 8, 3, 222, 148, 8, 3, 222, 153, 8, 3, 222, 152, 
+    8, 3, 222, 150, 8, 3, 222, 151, 8, 3, 228, 39, 8, 3, 228, 38, 8, 3, 228, 
+    41, 8, 3, 228, 40, 8, 3, 228, 31, 8, 3, 228, 33, 8, 3, 228, 32, 8, 3, 
+    228, 35, 8, 3, 228, 34, 8, 3, 228, 37, 8, 3, 228, 36, 8, 3, 228, 26, 8, 
+    3, 228, 25, 8, 3, 228, 30, 8, 3, 228, 29, 8, 3, 228, 27, 8, 3, 228, 28, 
+    8, 3, 228, 20, 8, 3, 228, 19, 8, 3, 228, 24, 8, 3, 228, 23, 8, 3, 228, 
+    21, 8, 3, 228, 22, 8, 3, 220, 74, 8, 3, 220, 69, 8, 3, 220, 104, 8, 3, 
+    220, 85, 8, 3, 219, 217, 8, 3, 219, 219, 8, 3, 219, 218, 8, 3, 219, 238, 
+    8, 3, 219, 235, 8, 3, 220, 9, 8, 3, 220, 0, 8, 3, 220, 44, 8, 3, 220, 37, 
+    8, 3, 220, 65, 8, 3, 220, 52, 8, 3, 219, 213, 8, 3, 219, 211, 8, 3, 219, 
+    227, 8, 3, 219, 216, 8, 3, 219, 214, 8, 3, 219, 215, 8, 3, 219, 196, 8, 
+    3, 219, 195, 8, 3, 219, 202, 8, 3, 219, 199, 8, 3, 219, 197, 8, 3, 219, 
+    198, 8, 3, 223, 144, 8, 3, 223, 138, 8, 3, 205, 8, 3, 223, 150, 8, 3, 
+    222, 122, 8, 3, 222, 124, 8, 3, 222, 123, 8, 3, 222, 190, 8, 3, 222, 183, 
+    8, 3, 222, 213, 8, 3, 222, 194, 8, 3, 223, 46, 8, 3, 223, 131, 8, 3, 223, 
+    84, 8, 3, 222, 115, 8, 3, 222, 112, 8, 3, 222, 142, 8, 3, 222, 121, 8, 3, 
+    222, 117, 8, 3, 222, 118, 8, 3, 222, 97, 8, 3, 222, 96, 8, 3, 222, 102, 
+    8, 3, 222, 100, 8, 3, 222, 98, 8, 3, 222, 99, 8, 3, 235, 104, 8, 3, 235, 
+    103, 8, 3, 235, 114, 8, 3, 235, 105, 8, 3, 235, 110, 8, 3, 235, 109, 8, 
+    3, 235, 112, 8, 3, 235, 111, 8, 3, 235, 47, 8, 3, 235, 46, 8, 3, 235, 49, 
+    8, 3, 235, 48, 8, 3, 235, 62, 8, 3, 235, 60, 8, 3, 235, 74, 8, 3, 235, 
+    64, 8, 3, 235, 40, 8, 3, 235, 38, 8, 3, 235, 57, 8, 3, 235, 45, 8, 3, 
+    235, 42, 8, 3, 235, 43, 8, 3, 235, 32, 8, 3, 235, 31, 8, 3, 235, 36, 8, 
+    3, 235, 35, 8, 3, 235, 33, 8, 3, 235, 34, 8, 3, 224, 49, 8, 3, 224, 47, 
+    8, 3, 224, 56, 8, 3, 224, 50, 8, 3, 224, 53, 8, 3, 224, 52, 8, 3, 224, 
+    55, 8, 3, 224, 54, 8, 3, 224, 2, 8, 3, 223, 255, 8, 3, 224, 4, 8, 3, 224, 
+    3, 8, 3, 224, 36, 8, 3, 224, 35, 8, 3, 224, 45, 8, 3, 224, 39, 8, 3, 223, 
+    250, 8, 3, 223, 246, 8, 3, 224, 33, 8, 3, 223, 254, 8, 3, 223, 252, 8, 3, 
+    223, 253, 8, 3, 223, 230, 8, 3, 223, 228, 8, 3, 223, 240, 8, 3, 223, 233, 
+    8, 3, 223, 231, 8, 3, 223, 232, 8, 3, 235, 93, 8, 3, 235, 92, 8, 3, 235, 
+    99, 8, 3, 235, 94, 8, 3, 235, 96, 8, 3, 235, 95, 8, 3, 235, 98, 8, 3, 
+    235, 97, 8, 3, 235, 84, 8, 3, 235, 86, 8, 3, 235, 85, 8, 3, 235, 89, 8, 
+    3, 235, 88, 8, 3, 235, 91, 8, 3, 235, 90, 8, 3, 235, 80, 8, 3, 235, 79, 
+    8, 3, 235, 87, 8, 3, 235, 83, 8, 3, 235, 81, 8, 3, 235, 82, 8, 3, 235, 
+    76, 8, 3, 235, 75, 8, 3, 235, 78, 8, 3, 235, 77, 8, 3, 228, 167, 8, 3, 
+    228, 166, 8, 3, 228, 174, 8, 3, 228, 168, 8, 3, 228, 170, 8, 3, 228, 169, 
+    8, 3, 228, 173, 8, 3, 228, 171, 8, 3, 228, 156, 8, 3, 228, 157, 8, 3, 
+    228, 162, 8, 3, 228, 161, 8, 3, 228, 165, 8, 3, 228, 163, 8, 3, 228, 151, 
+    8, 3, 228, 160, 8, 3, 228, 155, 8, 3, 228, 152, 8, 3, 228, 153, 8, 3, 
+    228, 146, 8, 3, 228, 145, 8, 3, 228, 150, 8, 3, 228, 149, 8, 3, 228, 147, 
+    8, 3, 228, 148, 8, 3, 227, 141, 8, 3, 227, 140, 8, 3, 227, 152, 8, 3, 
+    227, 145, 8, 3, 227, 149, 8, 3, 227, 148, 8, 3, 227, 151, 8, 3, 227, 150, 
+    8, 3, 227, 128, 8, 3, 227, 130, 8, 3, 227, 129, 8, 3, 227, 134, 8, 3, 
+    227, 133, 8, 3, 227, 138, 8, 3, 227, 135, 8, 3, 227, 126, 8, 3, 227, 124, 
+    8, 3, 227, 132, 8, 3, 227, 127, 8, 3, 211, 150, 8, 3, 211, 149, 8, 3, 
+    211, 157, 8, 3, 211, 152, 8, 3, 211, 154, 8, 3, 211, 153, 8, 3, 211, 156, 
+    8, 3, 211, 155, 8, 3, 211, 139, 8, 3, 211, 140, 8, 3, 211, 144, 8, 3, 
+    211, 143, 8, 3, 211, 148, 8, 3, 211, 146, 8, 3, 211, 121, 8, 3, 211, 119, 
+    8, 3, 211, 131, 8, 3, 211, 124, 8, 3, 211, 122, 8, 3, 211, 123, 8, 3, 
+    210, 250, 8, 3, 210, 248, 8, 3, 211, 8, 8, 3, 210, 251, 8, 3, 211, 2, 8, 
+    3, 211, 1, 8, 3, 211, 5, 8, 3, 211, 3, 8, 3, 210, 191, 8, 3, 210, 190, 8, 
+    3, 210, 194, 8, 3, 210, 192, 8, 3, 210, 224, 8, 3, 210, 221, 8, 3, 210, 
+    244, 8, 3, 210, 228, 8, 3, 210, 182, 8, 3, 210, 178, 8, 3, 210, 212, 8, 
+    3, 210, 189, 8, 3, 210, 185, 8, 3, 210, 186, 8, 3, 210, 162, 8, 3, 210, 
+    161, 8, 3, 210, 169, 8, 3, 210, 165, 8, 3, 210, 163, 8, 3, 210, 164, 8, 
+    34, 224, 36, 8, 34, 232, 247, 8, 34, 234, 67, 8, 34, 227, 145, 8, 34, 
+    249, 77, 8, 34, 218, 194, 8, 34, 243, 19, 8, 34, 243, 51, 8, 34, 230, 
+    235, 8, 34, 240, 187, 8, 34, 232, 61, 8, 34, 252, 91, 8, 34, 230, 131, 8, 
+    34, 210, 244, 8, 34, 224, 124, 8, 34, 240, 181, 8, 34, 217, 47, 8, 34, 
+    243, 142, 8, 34, 210, 5, 8, 34, 249, 71, 8, 34, 248, 103, 8, 34, 251, 
+    106, 8, 34, 243, 15, 8, 34, 227, 135, 8, 34, 215, 119, 8, 34, 226, 179, 
+    8, 34, 235, 80, 8, 34, 210, 19, 8, 34, 224, 103, 8, 34, 241, 115, 8, 34, 
+    210, 250, 8, 34, 212, 112, 8, 34, 219, 202, 8, 34, 213, 244, 8, 34, 210, 
+    116, 8, 34, 235, 74, 8, 34, 227, 100, 8, 34, 235, 78, 8, 34, 242, 161, 8, 
+    34, 235, 98, 8, 34, 211, 227, 8, 34, 246, 86, 8, 34, 219, 215, 8, 34, 
+    232, 242, 8, 34, 249, 81, 8, 34, 249, 113, 8, 34, 250, 45, 8, 34, 240, 
+    184, 8, 34, 220, 74, 8, 34, 210, 4, 8, 34, 220, 0, 8, 34, 250, 139, 8, 
+    34, 209, 231, 8, 34, 229, 178, 8, 34, 234, 188, 232, 202, 1, 252, 199, 
+    232, 202, 1, 191, 232, 202, 1, 225, 150, 232, 202, 1, 248, 229, 232, 202, 
+    1, 217, 106, 232, 202, 1, 216, 209, 232, 202, 1, 243, 142, 232, 202, 1, 
+    176, 232, 202, 1, 234, 138, 232, 202, 1, 235, 147, 232, 202, 1, 251, 41, 
+    232, 202, 1, 250, 165, 232, 202, 1, 246, 46, 232, 202, 1, 215, 184, 232, 
+    202, 1, 215, 176, 232, 202, 1, 186, 232, 202, 1, 198, 232, 202, 1, 233, 
+    141, 232, 202, 1, 206, 232, 202, 1, 210, 82, 232, 202, 1, 210, 116, 232, 
+    202, 1, 229, 82, 232, 202, 1, 162, 232, 202, 1, 211, 165, 232, 202, 1, 
+    241, 196, 232, 202, 1, 244, 204, 232, 202, 1, 212, 65, 232, 202, 1, 220, 
+    104, 232, 202, 1, 192, 232, 202, 1, 243, 0, 232, 202, 1, 61, 232, 202, 1, 
+    254, 252, 232, 202, 1, 76, 232, 202, 1, 245, 63, 232, 202, 1, 74, 232, 
+    202, 1, 78, 232, 202, 1, 69, 232, 202, 1, 214, 214, 232, 202, 1, 214, 
+    208, 232, 202, 1, 226, 238, 232, 202, 1, 138, 230, 37, 216, 118, 232, 
+    202, 1, 138, 229, 234, 225, 19, 232, 202, 1, 138, 230, 37, 249, 80, 232, 
+    202, 1, 138, 230, 37, 251, 213, 232, 202, 1, 138, 230, 37, 198, 232, 202, 
+    1, 138, 230, 37, 235, 121, 232, 202, 224, 144, 249, 227, 232, 202, 224, 
+    144, 243, 236, 218, 131, 41, 3, 245, 217, 41, 3, 245, 213, 41, 3, 241, 
+    227, 41, 3, 212, 17, 41, 3, 212, 16, 41, 3, 225, 214, 41, 3, 252, 21, 41, 
+    3, 252, 74, 41, 3, 231, 121, 41, 3, 233, 253, 41, 3, 231, 11, 41, 3, 243, 
+    82, 41, 3, 244, 155, 41, 3, 213, 250, 41, 3, 217, 12, 41, 3, 216, 195, 
+    41, 3, 248, 24, 41, 3, 248, 21, 41, 3, 233, 56, 41, 3, 223, 111, 41, 3, 
+    248, 85, 41, 3, 229, 144, 41, 3, 221, 172, 41, 3, 220, 63, 41, 3, 210, 
+    92, 41, 3, 210, 73, 41, 3, 250, 190, 41, 3, 235, 130, 41, 3, 228, 181, 
+    41, 3, 211, 44, 41, 3, 234, 187, 41, 3, 229, 56, 41, 3, 243, 62, 41, 3, 
+    231, 85, 41, 3, 229, 108, 41, 3, 227, 159, 41, 3, 74, 41, 3, 236, 6, 41, 
+    3, 241, 187, 41, 3, 241, 167, 41, 3, 211, 250, 41, 3, 211, 241, 41, 3, 
+    225, 111, 41, 3, 252, 19, 41, 3, 252, 14, 41, 3, 231, 114, 41, 3, 233, 
+    250, 41, 3, 231, 8, 41, 3, 243, 78, 41, 3, 244, 129, 41, 3, 213, 176, 41, 
+    3, 216, 118, 41, 3, 216, 176, 41, 3, 248, 16, 41, 3, 248, 20, 41, 3, 232, 
+    247, 41, 3, 223, 38, 41, 3, 248, 11, 41, 3, 229, 138, 41, 3, 219, 193, 
+    41, 3, 220, 34, 41, 3, 210, 44, 41, 3, 210, 69, 41, 3, 250, 59, 41, 3, 
+    235, 114, 41, 3, 228, 174, 41, 3, 211, 8, 41, 3, 234, 98, 41, 3, 229, 48, 
+    41, 3, 242, 221, 41, 3, 230, 235, 41, 3, 228, 238, 41, 3, 227, 152, 41, 
+    3, 61, 41, 3, 254, 131, 41, 3, 229, 77, 41, 3, 162, 41, 3, 242, 25, 41, 
+    3, 212, 65, 41, 3, 212, 55, 41, 3, 191, 41, 3, 252, 26, 41, 3, 252, 199, 
+    41, 3, 231, 129, 41, 3, 234, 1, 41, 3, 234, 0, 41, 3, 231, 15, 41, 3, 
+    243, 86, 41, 3, 244, 204, 41, 3, 214, 27, 41, 3, 217, 106, 41, 3, 216, 
+    209, 41, 3, 248, 33, 41, 3, 248, 23, 41, 3, 233, 141, 41, 3, 205, 41, 3, 
+    248, 229, 41, 3, 229, 153, 41, 3, 206, 41, 3, 220, 104, 41, 3, 210, 116, 
+    41, 3, 210, 82, 41, 3, 251, 41, 41, 3, 235, 147, 41, 3, 228, 190, 41, 3, 
+    192, 41, 3, 176, 41, 3, 234, 240, 41, 3, 229, 61, 41, 3, 243, 142, 41, 3, 
+    186, 41, 3, 198, 41, 3, 227, 169, 41, 3, 226, 187, 41, 3, 226, 183, 41, 
+    3, 241, 60, 41, 3, 211, 215, 41, 3, 211, 211, 41, 3, 224, 252, 41, 3, 
+    252, 17, 41, 3, 251, 201, 41, 3, 231, 109, 41, 3, 233, 248, 41, 3, 231, 
+    4, 41, 3, 243, 74, 41, 3, 244, 42, 41, 3, 213, 127, 41, 3, 216, 18, 41, 
+    3, 216, 154, 41, 3, 248, 14, 41, 3, 248, 18, 41, 3, 232, 133, 41, 3, 222, 
+    199, 41, 3, 247, 133, 41, 3, 229, 125, 41, 3, 219, 42, 41, 3, 220, 3, 41, 
+    3, 210, 21, 41, 3, 210, 66, 41, 3, 249, 182, 41, 3, 235, 65, 41, 3, 228, 
+    164, 41, 3, 210, 229, 41, 3, 234, 16, 41, 3, 229, 46, 41, 3, 242, 171, 
+    41, 3, 230, 137, 41, 3, 228, 69, 41, 3, 227, 136, 41, 3, 69, 41, 3, 214, 
+    190, 41, 3, 240, 229, 41, 3, 240, 219, 41, 3, 211, 195, 41, 3, 211, 189, 
+    41, 3, 224, 153, 41, 3, 252, 16, 41, 3, 251, 133, 41, 3, 231, 108, 41, 3, 
+    233, 246, 41, 3, 231, 3, 41, 3, 243, 73, 41, 3, 243, 241, 41, 3, 212, 
+    116, 41, 3, 215, 119, 41, 3, 216, 137, 41, 3, 248, 12, 41, 3, 248, 17, 
+    41, 3, 232, 103, 41, 3, 222, 142, 41, 3, 246, 86, 41, 3, 229, 120, 41, 3, 
+    218, 84, 41, 3, 219, 227, 41, 3, 210, 13, 41, 3, 210, 62, 41, 3, 249, 
+    120, 41, 3, 235, 57, 41, 3, 228, 160, 41, 3, 210, 212, 41, 3, 233, 223, 
+    41, 3, 229, 45, 41, 3, 242, 120, 41, 3, 230, 107, 41, 3, 227, 242, 41, 3, 
+    227, 132, 41, 3, 78, 41, 3, 226, 200, 41, 3, 229, 5, 41, 3, 241, 75, 41, 
+    3, 241, 63, 41, 3, 211, 227, 41, 3, 211, 216, 41, 3, 225, 19, 41, 3, 252, 
+    18, 41, 3, 251, 213, 41, 3, 231, 110, 41, 3, 233, 249, 41, 3, 231, 6, 41, 
+    3, 243, 76, 41, 3, 243, 75, 41, 3, 244, 51, 41, 3, 213, 138, 41, 3, 112, 
+    41, 3, 216, 157, 41, 3, 248, 15, 41, 3, 248, 19, 41, 3, 232, 162, 41, 3, 
+    222, 213, 41, 3, 247, 153, 41, 3, 229, 129, 41, 3, 219, 60, 41, 3, 220, 
+    9, 41, 3, 210, 23, 41, 3, 210, 67, 41, 3, 249, 246, 41, 3, 235, 74, 41, 
+    3, 228, 165, 41, 3, 210, 244, 41, 3, 234, 34, 41, 3, 229, 47, 41, 3, 242, 
+    181, 41, 3, 230, 166, 41, 3, 228, 79, 41, 3, 227, 138, 41, 3, 76, 41, 3, 
+    245, 158, 41, 3, 229, 66, 41, 3, 241, 245, 41, 3, 241, 216, 41, 3, 212, 
+    22, 41, 3, 212, 12, 41, 3, 225, 224, 41, 3, 252, 22, 41, 3, 252, 83, 41, 
+    3, 231, 122, 41, 3, 233, 254, 41, 3, 233, 252, 41, 3, 231, 12, 41, 3, 
+    243, 83, 41, 3, 243, 81, 41, 3, 244, 162, 41, 3, 213, 255, 41, 3, 217, 
+    23, 41, 3, 216, 196, 41, 3, 248, 25, 41, 3, 248, 22, 41, 3, 233, 64, 41, 
+    3, 223, 131, 41, 3, 248, 98, 41, 3, 229, 145, 41, 3, 221, 183, 41, 3, 
+    220, 65, 41, 3, 210, 94, 41, 3, 210, 74, 41, 3, 250, 198, 41, 3, 235, 
+    132, 41, 3, 228, 183, 41, 3, 211, 47, 41, 3, 234, 188, 41, 3, 229, 57, 
+    41, 3, 229, 53, 41, 3, 243, 69, 41, 3, 243, 58, 41, 3, 231, 96, 41, 3, 
+    229, 112, 41, 3, 227, 160, 41, 3, 229, 84, 41, 3, 233, 28, 41, 249, 227, 
+    41, 243, 236, 218, 131, 41, 224, 16, 79, 41, 3, 229, 128, 244, 204, 41, 
+    3, 229, 128, 176, 41, 3, 229, 128, 219, 42, 41, 16, 244, 152, 41, 16, 
+    234, 186, 41, 16, 216, 82, 41, 16, 228, 213, 41, 16, 252, 155, 41, 16, 
+    244, 203, 41, 16, 217, 102, 41, 16, 248, 184, 41, 16, 247, 132, 41, 16, 
+    233, 212, 41, 16, 216, 22, 41, 16, 247, 152, 41, 16, 235, 66, 41, 21, 
+    210, 86, 41, 21, 111, 41, 21, 105, 41, 21, 158, 41, 21, 161, 41, 21, 190, 
+    41, 21, 195, 41, 21, 199, 41, 21, 196, 41, 21, 201, 41, 3, 229, 128, 186, 
+    41, 3, 229, 128, 247, 153, 33, 6, 1, 210, 90, 33, 4, 1, 210, 90, 33, 6, 
+    1, 246, 42, 33, 4, 1, 246, 42, 33, 6, 1, 223, 52, 246, 44, 33, 4, 1, 223, 
+    52, 246, 44, 33, 6, 1, 235, 192, 33, 4, 1, 235, 192, 33, 6, 1, 247, 169, 
+    33, 4, 1, 247, 169, 33, 6, 1, 230, 145, 214, 205, 33, 4, 1, 230, 145, 
+    214, 205, 33, 6, 1, 251, 144, 226, 205, 33, 4, 1, 251, 144, 226, 205, 33, 
+    6, 1, 229, 92, 211, 31, 33, 4, 1, 229, 92, 211, 31, 33, 6, 1, 211, 28, 2, 
+    252, 193, 211, 31, 33, 4, 1, 211, 28, 2, 252, 193, 211, 31, 33, 6, 1, 
+    235, 190, 211, 59, 33, 4, 1, 235, 190, 211, 59, 33, 6, 1, 223, 52, 210, 
+    212, 33, 4, 1, 223, 52, 210, 212, 33, 6, 1, 235, 190, 61, 33, 4, 1, 235, 
+    190, 61, 33, 6, 1, 250, 8, 232, 198, 210, 183, 33, 4, 1, 250, 8, 232, 
+    198, 210, 183, 33, 6, 1, 251, 222, 210, 183, 33, 4, 1, 251, 222, 210, 
+    183, 33, 6, 1, 235, 190, 250, 8, 232, 198, 210, 183, 33, 4, 1, 235, 190, 
+    250, 8, 232, 198, 210, 183, 33, 6, 1, 210, 246, 33, 4, 1, 210, 246, 33, 
+    6, 1, 223, 52, 215, 179, 33, 4, 1, 223, 52, 215, 179, 33, 6, 1, 219, 54, 
+    248, 98, 33, 4, 1, 219, 54, 248, 98, 33, 6, 1, 219, 54, 245, 182, 33, 4, 
+    1, 219, 54, 245, 182, 33, 6, 1, 219, 54, 245, 167, 33, 4, 1, 219, 54, 
+    245, 167, 33, 6, 1, 230, 149, 78, 33, 4, 1, 230, 149, 78, 33, 6, 1, 251, 
+    248, 78, 33, 4, 1, 251, 248, 78, 33, 6, 1, 52, 230, 149, 78, 33, 4, 1, 
+    52, 230, 149, 78, 33, 1, 230, 91, 78, 38, 33, 212, 100, 38, 33, 216, 249, 
+    230, 196, 50, 38, 33, 240, 218, 230, 196, 50, 38, 33, 216, 149, 230, 196, 
+    50, 219, 95, 253, 224, 38, 33, 1, 214, 202, 236, 67, 38, 33, 1, 74, 38, 
+    33, 1, 211, 8, 38, 33, 1, 69, 38, 33, 1, 242, 10, 50, 38, 33, 1, 211, 27, 
+    38, 33, 1, 219, 54, 50, 38, 33, 1, 226, 205, 38, 33, 234, 198, 38, 33, 
+    225, 231, 33, 234, 198, 33, 225, 231, 33, 6, 1, 246, 54, 33, 4, 1, 246, 
+    54, 33, 6, 1, 246, 35, 33, 4, 1, 246, 35, 33, 6, 1, 210, 52, 33, 4, 1, 
+    210, 52, 33, 6, 1, 250, 214, 33, 4, 1, 250, 214, 33, 6, 1, 246, 33, 33, 
+    4, 1, 246, 33, 33, 6, 1, 217, 24, 2, 230, 229, 103, 33, 4, 1, 217, 24, 2, 
+    230, 229, 103, 33, 6, 1, 215, 78, 33, 4, 1, 215, 78, 33, 6, 1, 215, 161, 
+    33, 4, 1, 215, 161, 33, 6, 1, 215, 165, 33, 4, 1, 215, 165, 33, 6, 1, 
+    217, 29, 33, 4, 1, 217, 29, 33, 6, 1, 240, 205, 33, 4, 1, 240, 205, 33, 
+    6, 1, 219, 208, 33, 4, 1, 219, 208, 38, 33, 1, 235, 190, 76, 20, 1, 61, 
+    20, 1, 176, 20, 1, 69, 20, 1, 233, 223, 20, 1, 245, 217, 20, 1, 223, 111, 
+    20, 1, 217, 87, 20, 1, 78, 20, 1, 227, 152, 20, 1, 74, 20, 1, 233, 141, 
+    20, 1, 191, 20, 1, 222, 242, 20, 1, 223, 32, 20, 1, 233, 55, 20, 1, 231, 
+    84, 20, 1, 217, 102, 20, 1, 229, 151, 20, 1, 228, 188, 20, 1, 194, 20, 1, 
+    218, 5, 20, 1, 230, 107, 20, 1, 220, 29, 20, 1, 219, 193, 20, 1, 220, 39, 
+    20, 1, 220, 125, 20, 1, 233, 161, 20, 1, 234, 162, 20, 1, 227, 213, 20, 
+    1, 227, 242, 20, 1, 228, 159, 20, 1, 210, 226, 20, 1, 219, 227, 20, 1, 
+    210, 187, 20, 1, 192, 20, 1, 228, 14, 20, 1, 234, 148, 20, 1, 225, 154, 
+    20, 1, 228, 181, 20, 1, 227, 251, 20, 1, 224, 147, 20, 1, 211, 192, 20, 
+    1, 225, 214, 20, 1, 244, 155, 20, 1, 222, 142, 20, 1, 232, 103, 20, 1, 
+    230, 235, 20, 1, 228, 238, 20, 1, 223, 54, 20, 1, 223, 174, 20, 1, 234, 
+    171, 20, 1, 229, 12, 20, 1, 229, 61, 20, 1, 229, 82, 20, 1, 220, 9, 20, 
+    1, 224, 150, 20, 1, 243, 241, 20, 1, 244, 45, 20, 1, 212, 65, 20, 1, 198, 
+    20, 1, 232, 247, 20, 1, 225, 111, 20, 1, 232, 125, 20, 1, 234, 34, 20, 1, 
+    231, 119, 20, 1, 223, 86, 20, 1, 231, 63, 20, 1, 186, 20, 1, 216, 118, 
+    20, 1, 234, 98, 20, 1, 230, 166, 20, 1, 231, 127, 20, 1, 216, 231, 20, 1, 
+    234, 1, 20, 1, 216, 248, 20, 1, 227, 243, 20, 1, 221, 253, 20, 1, 244, 
+    200, 20, 1, 234, 3, 20, 1, 234, 30, 20, 38, 164, 234, 11, 20, 38, 164, 
+    215, 111, 20, 228, 187, 20, 243, 236, 218, 131, 20, 249, 234, 20, 249, 
+    227, 20, 220, 152, 20, 224, 16, 79, 58, 1, 250, 104, 138, 210, 254, 225, 
+    64, 58, 1, 250, 104, 138, 211, 70, 225, 64, 58, 1, 250, 104, 138, 210, 
+    254, 220, 86, 58, 1, 250, 104, 138, 211, 70, 220, 86, 58, 1, 250, 104, 
+    138, 210, 254, 224, 33, 58, 1, 250, 104, 138, 211, 70, 224, 33, 58, 1, 
+    250, 104, 138, 210, 254, 222, 142, 58, 1, 250, 104, 138, 211, 70, 222, 
+    142, 58, 1, 245, 28, 246, 126, 138, 130, 58, 1, 125, 246, 126, 138, 130, 
+    58, 1, 230, 230, 246, 126, 138, 130, 58, 1, 121, 246, 126, 138, 130, 58, 
+    1, 245, 27, 246, 126, 138, 130, 58, 1, 245, 28, 246, 126, 233, 45, 138, 
+    130, 58, 1, 125, 246, 126, 233, 45, 138, 130, 58, 1, 230, 230, 246, 126, 
+    233, 45, 138, 130, 58, 1, 121, 246, 126, 233, 45, 138, 130, 58, 1, 245, 
+    27, 246, 126, 233, 45, 138, 130, 58, 1, 245, 28, 233, 45, 138, 130, 58, 
+    1, 125, 233, 45, 138, 130, 58, 1, 230, 230, 233, 45, 138, 130, 58, 1, 
+    121, 233, 45, 138, 130, 58, 1, 245, 27, 233, 45, 138, 130, 58, 1, 59, 67, 
+    130, 58, 1, 59, 219, 97, 58, 1, 59, 203, 130, 58, 1, 232, 114, 44, 249, 
+    169, 254, 117, 58, 1, 223, 160, 120, 75, 58, 1, 223, 160, 124, 75, 58, 1, 
+    223, 160, 245, 39, 79, 58, 1, 223, 160, 235, 200, 245, 39, 79, 58, 1, 
+    121, 235, 200, 245, 39, 79, 58, 1, 218, 113, 22, 125, 216, 31, 58, 1, 
+    218, 113, 22, 121, 216, 31, 7, 6, 1, 245, 207, 254, 179, 7, 4, 1, 245, 
+    207, 254, 179, 7, 6, 1, 245, 207, 254, 205, 7, 4, 1, 245, 207, 254, 205, 
+    7, 6, 1, 241, 214, 7, 4, 1, 241, 214, 7, 6, 1, 215, 40, 7, 4, 1, 215, 40, 
+    7, 6, 1, 215, 230, 7, 4, 1, 215, 230, 7, 6, 1, 249, 118, 7, 4, 1, 249, 
+    118, 7, 6, 1, 249, 119, 2, 249, 227, 7, 4, 1, 249, 119, 2, 249, 227, 7, 
+    1, 4, 6, 245, 14, 7, 1, 4, 6, 222, 93, 7, 6, 1, 255, 82, 7, 4, 1, 255, 
+    82, 7, 6, 1, 254, 81, 7, 4, 1, 254, 81, 7, 6, 1, 253, 200, 7, 4, 1, 253, 
+    200, 7, 6, 1, 253, 184, 7, 4, 1, 253, 184, 7, 6, 1, 253, 185, 2, 203, 
+    130, 7, 4, 1, 253, 185, 2, 203, 130, 7, 6, 1, 253, 175, 7, 4, 1, 253, 
+    175, 7, 6, 1, 223, 52, 251, 75, 2, 247, 128, 7, 4, 1, 223, 52, 251, 75, 
+    2, 247, 128, 7, 6, 1, 235, 30, 2, 91, 7, 4, 1, 235, 30, 2, 91, 7, 6, 1, 
+    235, 30, 2, 248, 7, 91, 7, 4, 1, 235, 30, 2, 248, 7, 91, 7, 6, 1, 235, 
+    30, 2, 218, 105, 22, 248, 7, 91, 7, 4, 1, 235, 30, 2, 218, 105, 22, 248, 
+    7, 91, 7, 6, 1, 251, 143, 156, 7, 4, 1, 251, 143, 156, 7, 6, 1, 233, 155, 
+    2, 125, 91, 7, 4, 1, 233, 155, 2, 125, 91, 7, 6, 1, 144, 2, 200, 218, 
+    105, 226, 124, 7, 4, 1, 144, 2, 200, 218, 105, 226, 124, 7, 6, 1, 144, 2, 
+    232, 129, 7, 4, 1, 144, 2, 232, 129, 7, 6, 1, 226, 187, 7, 4, 1, 226, 
+    187, 7, 6, 1, 226, 110, 2, 218, 105, 216, 140, 248, 47, 7, 4, 1, 226, 
+    110, 2, 218, 105, 216, 140, 248, 47, 7, 6, 1, 226, 110, 2, 244, 61, 7, 4, 
+    1, 226, 110, 2, 244, 61, 7, 6, 1, 226, 110, 2, 218, 231, 217, 78, 7, 4, 
+    1, 226, 110, 2, 218, 231, 217, 78, 7, 6, 1, 224, 100, 2, 218, 105, 216, 
+    140, 248, 47, 7, 4, 1, 224, 100, 2, 218, 105, 216, 140, 248, 47, 7, 6, 1, 
+    224, 100, 2, 248, 7, 91, 7, 4, 1, 224, 100, 2, 248, 7, 91, 7, 6, 1, 223, 
+    227, 222, 188, 7, 4, 1, 223, 227, 222, 188, 7, 6, 1, 222, 132, 222, 188, 
+    7, 4, 1, 222, 132, 222, 188, 7, 6, 1, 214, 106, 2, 248, 7, 91, 7, 4, 1, 
+    214, 106, 2, 248, 7, 91, 7, 6, 1, 212, 106, 7, 4, 1, 212, 106, 7, 6, 1, 
+    213, 145, 210, 159, 7, 4, 1, 213, 145, 210, 159, 7, 6, 1, 216, 153, 2, 
+    91, 7, 4, 1, 216, 153, 2, 91, 7, 6, 1, 216, 153, 2, 218, 105, 216, 140, 
+    248, 47, 7, 4, 1, 216, 153, 2, 218, 105, 216, 140, 248, 47, 7, 6, 1, 213, 
+    245, 7, 4, 1, 213, 245, 7, 6, 1, 245, 73, 7, 4, 1, 245, 73, 7, 6, 1, 235, 
+    178, 7, 4, 1, 235, 178, 7, 6, 1, 249, 215, 7, 4, 1, 249, 215, 58, 1, 214, 
+    133, 7, 4, 1, 246, 77, 7, 4, 1, 232, 89, 7, 4, 1, 230, 85, 7, 4, 1, 227, 
+    205, 7, 4, 1, 222, 131, 7, 1, 4, 6, 222, 131, 7, 4, 1, 215, 109, 7, 4, 1, 
+    214, 197, 7, 6, 1, 235, 220, 249, 68, 7, 4, 1, 235, 220, 249, 68, 7, 6, 
+    1, 235, 220, 245, 14, 7, 4, 1, 235, 220, 245, 14, 7, 6, 1, 235, 220, 243, 
+    209, 7, 6, 1, 215, 94, 235, 220, 243, 209, 7, 4, 1, 215, 94, 235, 220, 
+    243, 209, 7, 6, 1, 215, 94, 156, 7, 4, 1, 215, 94, 156, 7, 6, 1, 235, 
+    220, 153, 7, 4, 1, 235, 220, 153, 7, 6, 1, 235, 220, 222, 93, 7, 4, 1, 
+    235, 220, 222, 93, 7, 6, 1, 235, 220, 217, 153, 7, 4, 1, 235, 220, 217, 
+    153, 58, 1, 121, 250, 39, 255, 23, 58, 1, 249, 234, 58, 1, 219, 253, 245, 
+    106, 50, 7, 6, 1, 222, 1, 7, 4, 1, 222, 1, 7, 6, 1, 215, 94, 242, 67, 7, 
+    4, 1, 233, 155, 2, 223, 58, 241, 59, 22, 252, 49, 7, 6, 1, 230, 31, 2, 
+    248, 47, 7, 4, 1, 230, 31, 2, 248, 47, 7, 6, 1, 251, 75, 2, 130, 7, 4, 1, 
+    251, 75, 2, 130, 7, 6, 1, 243, 210, 2, 226, 252, 91, 7, 4, 1, 243, 210, 
+    2, 226, 252, 91, 7, 6, 1, 235, 30, 2, 226, 252, 91, 7, 4, 1, 235, 30, 2, 
+    226, 252, 91, 7, 6, 1, 230, 31, 2, 226, 252, 91, 7, 4, 1, 230, 31, 2, 
+    226, 252, 91, 7, 6, 1, 223, 227, 2, 226, 252, 91, 7, 4, 1, 223, 227, 2, 
+    226, 252, 91, 7, 6, 1, 222, 94, 2, 226, 252, 91, 7, 4, 1, 222, 94, 2, 
+    226, 252, 91, 7, 6, 1, 242, 68, 2, 103, 58, 1, 6, 242, 68, 2, 91, 58, 1, 
+    4, 27, 226, 238, 7, 1, 4, 6, 215, 94, 194, 7, 245, 111, 1, 223, 52, 245, 
+    14, 7, 245, 111, 1, 223, 52, 226, 109, 7, 245, 111, 1, 235, 200, 194, 7, 
+    245, 111, 1, 240, 161, 232, 135, 7, 245, 111, 1, 254, 31, 194, 217, 231, 
+    229, 219, 1, 61, 217, 231, 229, 219, 1, 74, 217, 231, 229, 219, 5, 246, 
+    56, 217, 231, 229, 219, 1, 69, 217, 231, 229, 219, 1, 76, 217, 231, 229, 
+    219, 1, 78, 217, 231, 229, 219, 5, 242, 4, 217, 231, 229, 219, 1, 234, 
+    34, 217, 231, 229, 219, 1, 234, 111, 217, 231, 229, 219, 1, 242, 181, 
+    217, 231, 229, 219, 1, 242, 231, 217, 231, 229, 219, 5, 254, 83, 217, 
+    231, 229, 219, 1, 249, 246, 217, 231, 229, 219, 1, 250, 94, 217, 231, 
+    229, 219, 1, 235, 74, 217, 231, 229, 219, 1, 235, 115, 217, 231, 229, 
+    219, 1, 215, 134, 217, 231, 229, 219, 1, 215, 140, 217, 231, 229, 219, 1, 
+    248, 113, 217, 231, 229, 219, 1, 248, 122, 217, 231, 229, 219, 1, 112, 
+    217, 231, 229, 219, 1, 216, 157, 217, 231, 229, 219, 1, 247, 153, 217, 
+    231, 229, 219, 1, 248, 15, 217, 231, 229, 219, 1, 228, 79, 217, 231, 229, 
+    219, 1, 225, 19, 217, 231, 229, 219, 1, 225, 124, 217, 231, 229, 219, 1, 
+    251, 213, 217, 231, 229, 219, 1, 252, 18, 217, 231, 229, 219, 1, 230, 
+    166, 217, 231, 229, 219, 1, 222, 213, 217, 231, 229, 219, 1, 232, 162, 
+    217, 231, 229, 219, 1, 222, 167, 217, 231, 229, 219, 1, 219, 60, 217, 
+    231, 229, 219, 1, 241, 75, 217, 231, 229, 219, 25, 5, 61, 217, 231, 229, 
+    219, 25, 5, 74, 217, 231, 229, 219, 25, 5, 69, 217, 231, 229, 219, 25, 5, 
+    76, 217, 231, 229, 219, 25, 5, 226, 187, 217, 231, 229, 219, 225, 15, 
+    231, 163, 217, 231, 229, 219, 225, 15, 231, 162, 217, 231, 229, 219, 225, 
+    15, 231, 161, 217, 231, 229, 219, 225, 15, 231, 160, 228, 61, 235, 247, 
+    244, 10, 123, 224, 24, 228, 61, 235, 247, 244, 10, 123, 242, 34, 228, 61, 
+    235, 247, 244, 10, 134, 224, 22, 228, 61, 235, 247, 244, 10, 123, 219, 
+    119, 228, 61, 235, 247, 244, 10, 123, 245, 196, 228, 61, 235, 247, 244, 
+    10, 134, 219, 118, 228, 61, 235, 247, 224, 25, 79, 228, 61, 235, 247, 
+    225, 43, 79, 228, 61, 235, 247, 222, 120, 79, 228, 61, 235, 247, 224, 26, 
+    79, 225, 147, 1, 176, 225, 147, 1, 234, 138, 225, 147, 1, 243, 142, 225, 
+    147, 1, 229, 82, 225, 147, 1, 251, 41, 225, 147, 1, 250, 165, 225, 147, 
+    1, 235, 147, 225, 147, 1, 227, 169, 225, 147, 1, 217, 106, 225, 147, 1, 
+    216, 209, 225, 147, 1, 248, 229, 225, 147, 1, 198, 225, 147, 1, 191, 225, 
+    147, 1, 225, 150, 225, 147, 1, 252, 199, 225, 147, 1, 186, 225, 147, 1, 
+    215, 184, 225, 147, 1, 215, 176, 225, 147, 1, 246, 46, 225, 147, 1, 212, 
+    65, 225, 147, 1, 210, 82, 225, 147, 1, 210, 116, 225, 147, 1, 4, 61, 225, 
+    147, 1, 192, 225, 147, 1, 205, 225, 147, 1, 233, 141, 225, 147, 1, 220, 
+    104, 225, 147, 1, 206, 225, 147, 1, 162, 225, 147, 1, 61, 225, 147, 1, 
+    74, 225, 147, 1, 69, 225, 147, 1, 76, 225, 147, 1, 78, 225, 147, 1, 224, 
+    91, 225, 147, 1, 211, 165, 225, 147, 1, 244, 204, 225, 147, 1, 243, 36, 
+    225, 147, 1, 245, 217, 225, 147, 218, 74, 1, 212, 65, 225, 147, 218, 74, 
+    1, 192, 225, 147, 1, 215, 157, 225, 147, 1, 215, 145, 225, 147, 1, 248, 
+    143, 225, 147, 1, 228, 115, 225, 147, 1, 254, 149, 192, 225, 147, 1, 213, 
+    134, 220, 104, 225, 147, 1, 213, 135, 162, 225, 147, 1, 253, 231, 244, 
+    204, 225, 147, 218, 74, 1, 205, 225, 147, 218, 26, 1, 205, 225, 147, 1, 
+    251, 7, 225, 147, 219, 157, 241, 243, 79, 225, 147, 52, 241, 243, 79, 
+    225, 147, 164, 220, 97, 225, 147, 164, 52, 220, 97, 179, 5, 254, 83, 179, 
+    5, 213, 147, 179, 1, 61, 179, 1, 255, 82, 179, 1, 74, 179, 1, 236, 40, 
+    179, 1, 69, 179, 1, 214, 118, 179, 1, 149, 153, 179, 1, 149, 222, 182, 
+    179, 1, 149, 156, 179, 1, 149, 232, 191, 179, 1, 76, 179, 1, 245, 217, 
+    179, 1, 254, 210, 179, 1, 78, 179, 1, 226, 187, 179, 1, 253, 200, 179, 1, 
+    176, 179, 1, 234, 138, 179, 1, 243, 142, 179, 1, 243, 0, 179, 1, 229, 82, 
+    179, 1, 251, 41, 179, 1, 250, 165, 179, 1, 235, 147, 179, 1, 235, 120, 
+    179, 1, 227, 169, 179, 1, 215, 157, 179, 1, 215, 145, 179, 1, 248, 143, 
+    179, 1, 248, 127, 179, 1, 228, 115, 179, 1, 217, 106, 179, 1, 216, 209, 
+    179, 1, 248, 229, 179, 1, 248, 33, 179, 1, 198, 179, 1, 191, 179, 1, 225, 
+    150, 179, 1, 252, 199, 179, 1, 252, 26, 179, 1, 186, 179, 1, 192, 179, 1, 
+    205, 179, 1, 233, 141, 179, 1, 214, 27, 179, 1, 220, 104, 179, 1, 218, 
+    225, 179, 1, 206, 179, 1, 162, 179, 1, 232, 190, 179, 117, 5, 242, 51, 
+    179, 25, 5, 255, 82, 179, 25, 5, 74, 179, 25, 5, 236, 40, 179, 25, 5, 69, 
+    179, 25, 5, 214, 118, 179, 25, 5, 149, 153, 179, 25, 5, 149, 222, 182, 
+    179, 25, 5, 149, 156, 179, 25, 5, 149, 232, 191, 179, 25, 5, 76, 179, 25, 
+    5, 245, 217, 179, 25, 5, 254, 210, 179, 25, 5, 78, 179, 25, 5, 226, 187, 
+    179, 25, 5, 253, 200, 179, 5, 213, 152, 179, 248, 186, 179, 52, 248, 186, 
+    179, 21, 210, 86, 179, 21, 111, 179, 21, 105, 179, 21, 158, 179, 21, 161, 
+    179, 21, 190, 179, 21, 195, 179, 21, 199, 179, 21, 196, 179, 21, 201, 38, 
+    84, 21, 210, 86, 38, 84, 21, 111, 38, 84, 21, 105, 38, 84, 21, 158, 38, 
+    84, 21, 161, 38, 84, 21, 190, 38, 84, 21, 195, 38, 84, 21, 199, 38, 84, 
+    21, 196, 38, 84, 21, 201, 38, 84, 1, 61, 38, 84, 1, 69, 38, 84, 1, 176, 
+    38, 84, 1, 198, 38, 84, 1, 191, 38, 84, 1, 205, 38, 84, 1, 213, 176, 38, 
+    84, 5, 253, 183, 84, 5, 219, 19, 251, 7, 84, 5, 251, 8, 213, 152, 84, 5, 
+    52, 251, 8, 213, 152, 84, 5, 251, 8, 105, 84, 5, 251, 8, 158, 84, 5, 251, 
+    8, 253, 183, 84, 5, 224, 127, 84, 243, 107, 244, 111, 84, 250, 246, 84, 
+    241, 237, 234, 194, 232, 248, 21, 210, 86, 234, 194, 232, 248, 21, 111, 
+    234, 194, 232, 248, 21, 105, 234, 194, 232, 248, 21, 158, 234, 194, 232, 
+    248, 21, 161, 234, 194, 232, 248, 21, 190, 234, 194, 232, 248, 21, 195, 
+    234, 194, 232, 248, 21, 199, 234, 194, 232, 248, 21, 196, 234, 194, 232, 
+    248, 21, 201, 234, 194, 232, 248, 1, 176, 234, 194, 232, 248, 1, 234, 
+    138, 234, 194, 232, 248, 1, 243, 142, 234, 194, 232, 248, 1, 229, 82, 
+    234, 194, 232, 248, 1, 206, 234, 194, 232, 248, 1, 220, 104, 234, 194, 
+    232, 248, 1, 210, 116, 234, 194, 232, 248, 1, 227, 169, 234, 194, 232, 
+    248, 1, 217, 106, 234, 194, 232, 248, 1, 240, 233, 234, 194, 232, 248, 1, 
+    198, 234, 194, 232, 248, 1, 191, 234, 194, 232, 248, 1, 225, 150, 234, 
+    194, 232, 248, 1, 186, 234, 194, 232, 248, 1, 248, 229, 234, 194, 232, 
+    248, 1, 252, 199, 234, 194, 232, 248, 1, 205, 234, 194, 232, 248, 1, 192, 
+    234, 194, 232, 248, 1, 233, 141, 234, 194, 232, 248, 1, 212, 65, 234, 
+    194, 232, 248, 1, 216, 209, 234, 194, 232, 248, 1, 162, 234, 194, 232, 
+    248, 1, 214, 27, 234, 194, 232, 248, 1, 251, 41, 234, 194, 232, 248, 1, 
+    61, 234, 194, 232, 248, 1, 226, 238, 234, 194, 232, 248, 1, 74, 234, 194, 
+    232, 248, 1, 226, 187, 234, 194, 232, 248, 25, 214, 214, 234, 194, 232, 
+    248, 25, 76, 234, 194, 232, 248, 25, 69, 234, 194, 232, 248, 25, 245, 
+    217, 234, 194, 232, 248, 25, 78, 234, 194, 232, 248, 138, 225, 33, 234, 
+    194, 232, 248, 138, 251, 20, 234, 194, 232, 248, 138, 251, 21, 225, 33, 
+    234, 194, 232, 248, 5, 249, 85, 234, 194, 232, 248, 5, 219, 201, 223, 96, 
+    1, 176, 223, 96, 1, 243, 142, 223, 96, 1, 229, 82, 223, 96, 1, 217, 106, 
+    223, 96, 1, 248, 229, 223, 96, 1, 198, 223, 96, 1, 191, 223, 96, 1, 252, 
+    199, 223, 96, 1, 186, 223, 96, 1, 251, 41, 223, 96, 1, 235, 147, 223, 96, 
+    1, 227, 169, 223, 96, 1, 206, 223, 96, 1, 205, 223, 96, 1, 233, 141, 223, 
+    96, 1, 192, 223, 96, 1, 212, 65, 223, 96, 1, 162, 223, 96, 1, 231, 129, 
+    223, 96, 1, 229, 61, 223, 96, 1, 229, 153, 223, 96, 1, 227, 139, 223, 96, 
+    1, 61, 223, 96, 25, 5, 74, 223, 96, 25, 5, 69, 223, 96, 25, 5, 76, 223, 
+    96, 25, 5, 254, 210, 223, 96, 25, 5, 78, 223, 96, 25, 5, 253, 200, 223, 
+    96, 25, 5, 245, 63, 223, 96, 25, 5, 245, 241, 223, 96, 117, 5, 229, 84, 
+    223, 96, 117, 5, 230, 30, 223, 96, 117, 5, 153, 223, 96, 117, 5, 242, 67, 
+    223, 96, 213, 152, 223, 96, 221, 175, 79, 24, 100, 216, 98, 24, 100, 216, 
+    97, 24, 100, 216, 95, 24, 100, 216, 100, 24, 100, 223, 24, 24, 100, 223, 
+    8, 24, 100, 223, 3, 24, 100, 223, 5, 24, 100, 223, 21, 24, 100, 223, 14, 
+    24, 100, 223, 7, 24, 100, 223, 26, 24, 100, 223, 9, 24, 100, 223, 28, 24, 
+    100, 223, 25, 24, 100, 230, 218, 24, 100, 230, 209, 24, 100, 230, 212, 
+    24, 100, 225, 83, 24, 100, 225, 94, 24, 100, 225, 95, 24, 100, 218, 209, 
+    24, 100, 236, 53, 24, 100, 236, 60, 24, 100, 218, 220, 24, 100, 218, 207, 
+    24, 100, 225, 133, 24, 100, 241, 174, 24, 100, 218, 204, 155, 5, 226, 31, 
+    155, 5, 250, 195, 155, 5, 233, 72, 155, 5, 211, 243, 155, 1, 61, 155, 1, 
+    240, 161, 234, 197, 155, 1, 74, 155, 1, 236, 40, 155, 1, 69, 155, 1, 226, 
+    94, 250, 171, 155, 1, 229, 83, 233, 34, 155, 1, 229, 83, 233, 35, 223, 
+    145, 155, 1, 76, 155, 1, 254, 210, 155, 1, 78, 155, 1, 176, 155, 1, 235, 
+    19, 221, 230, 155, 1, 235, 19, 230, 71, 155, 1, 243, 142, 155, 1, 243, 
+    143, 230, 71, 155, 1, 229, 82, 155, 1, 251, 41, 155, 1, 251, 42, 230, 71, 
+    155, 1, 235, 147, 155, 1, 227, 170, 230, 71, 155, 1, 235, 148, 231, 212, 
+    155, 1, 227, 169, 155, 1, 215, 157, 155, 1, 215, 158, 231, 212, 155, 1, 
+    248, 143, 155, 1, 248, 144, 231, 212, 155, 1, 229, 234, 230, 71, 155, 1, 
+    217, 106, 155, 1, 217, 107, 230, 71, 155, 1, 248, 229, 155, 1, 248, 230, 
+    231, 212, 155, 1, 198, 155, 1, 191, 155, 1, 226, 94, 230, 71, 155, 1, 
+    252, 199, 155, 1, 252, 200, 230, 71, 155, 1, 186, 155, 1, 192, 155, 1, 
+    205, 155, 1, 223, 191, 254, 219, 155, 1, 233, 141, 155, 1, 212, 65, 155, 
+    1, 222, 36, 230, 71, 155, 1, 222, 36, 231, 212, 155, 1, 206, 155, 1, 162, 
+    155, 5, 250, 196, 216, 251, 155, 25, 5, 217, 48, 155, 25, 5, 216, 36, 
+    155, 25, 5, 211, 190, 155, 25, 5, 211, 191, 231, 74, 155, 25, 5, 218, 48, 
+    155, 25, 5, 218, 49, 231, 62, 155, 25, 5, 217, 66, 155, 25, 5, 247, 202, 
+    230, 70, 155, 25, 5, 225, 187, 155, 117, 5, 234, 164, 155, 117, 5, 225, 
+    199, 155, 117, 5, 251, 27, 155, 226, 44, 155, 43, 223, 72, 155, 44, 223, 
+    72, 155, 226, 83, 254, 125, 155, 226, 83, 231, 229, 155, 226, 83, 232, 
+    93, 155, 226, 83, 211, 238, 155, 226, 83, 226, 45, 155, 226, 83, 232, 
+    211, 155, 226, 83, 232, 87, 155, 226, 83, 255, 2, 155, 226, 83, 255, 3, 
+    255, 2, 155, 226, 83, 225, 54, 155, 215, 94, 226, 83, 225, 54, 155, 226, 
+    40, 155, 21, 210, 86, 155, 21, 111, 155, 21, 105, 155, 21, 158, 155, 21, 
+    161, 155, 21, 190, 155, 21, 195, 155, 21, 199, 155, 21, 196, 155, 21, 
+    201, 155, 226, 83, 216, 70, 215, 107, 155, 226, 83, 235, 174, 172, 1, 61, 
+    172, 1, 74, 172, 1, 69, 172, 1, 76, 172, 1, 254, 210, 172, 1, 78, 172, 1, 
+    176, 172, 1, 234, 138, 172, 1, 243, 142, 172, 1, 243, 0, 172, 1, 228, 
+    250, 172, 1, 229, 82, 172, 1, 250, 165, 172, 1, 250, 120, 172, 1, 235, 
+    147, 172, 1, 235, 120, 172, 1, 228, 240, 172, 1, 228, 242, 172, 1, 228, 
+    241, 172, 1, 217, 106, 172, 1, 216, 209, 172, 1, 248, 229, 172, 1, 248, 
+    33, 172, 1, 227, 211, 172, 1, 198, 172, 1, 248, 143, 172, 1, 191, 172, 1, 
+    224, 223, 172, 1, 225, 150, 172, 1, 252, 199, 172, 1, 252, 26, 172, 1, 
+    230, 100, 172, 1, 186, 172, 1, 252, 119, 172, 1, 192, 172, 1, 205, 172, 
+    1, 233, 141, 172, 1, 214, 27, 172, 1, 218, 225, 172, 1, 206, 172, 1, 162, 
+    172, 25, 5, 255, 82, 172, 25, 5, 74, 172, 25, 5, 236, 40, 172, 25, 5, 
+    245, 203, 172, 25, 5, 69, 172, 25, 5, 226, 238, 172, 25, 5, 78, 172, 25, 
+    5, 254, 210, 172, 25, 5, 253, 200, 172, 25, 5, 214, 214, 172, 117, 5, 
+    192, 172, 117, 5, 205, 172, 117, 5, 233, 141, 172, 117, 5, 212, 65, 172, 
+    1, 40, 235, 29, 172, 1, 40, 243, 209, 172, 1, 40, 229, 84, 172, 117, 5, 
+    40, 229, 84, 172, 1, 40, 250, 166, 172, 1, 40, 217, 153, 172, 1, 40, 230, 
+    30, 172, 1, 40, 226, 109, 172, 1, 40, 211, 117, 172, 1, 40, 153, 172, 1, 
+    40, 156, 172, 1, 40, 218, 228, 172, 117, 5, 40, 194, 172, 117, 5, 40, 
+    242, 67, 172, 21, 210, 86, 172, 21, 111, 172, 21, 105, 172, 21, 158, 172, 
+    21, 161, 172, 21, 190, 172, 21, 195, 172, 21, 199, 172, 21, 196, 172, 21, 
+    201, 172, 224, 144, 218, 253, 172, 224, 144, 248, 186, 172, 224, 144, 52, 
+    248, 186, 172, 224, 144, 215, 212, 248, 186, 68, 1, 234, 132, 243, 142, 
+    68, 1, 234, 132, 251, 41, 68, 1, 234, 132, 250, 165, 68, 1, 234, 132, 
+    235, 147, 68, 1, 234, 132, 235, 120, 68, 1, 234, 132, 227, 169, 68, 1, 
+    234, 132, 215, 157, 68, 1, 234, 132, 215, 145, 68, 1, 234, 132, 248, 143, 
+    68, 1, 234, 132, 248, 127, 68, 1, 234, 132, 248, 33, 68, 1, 234, 132, 
+    198, 68, 1, 234, 132, 206, 68, 1, 234, 132, 162, 68, 1, 234, 132, 241, 
+    196, 68, 1, 234, 132, 244, 204, 68, 58, 1, 234, 132, 223, 112, 68, 1, 
+    234, 132, 211, 165, 68, 1, 234, 132, 210, 116, 68, 1, 234, 132, 205, 68, 
+    232, 151, 234, 132, 227, 1, 68, 232, 151, 234, 132, 224, 46, 68, 232, 
+    151, 234, 132, 241, 128, 68, 16, 254, 199, 245, 38, 68, 16, 254, 199, 
+    111, 68, 16, 254, 199, 105, 68, 1, 254, 199, 205, 68, 5, 226, 27, 234, 
+    219, 216, 31, 39, 208, 1, 121, 234, 34, 39, 208, 1, 125, 234, 34, 39, 
+    208, 1, 121, 234, 111, 39, 208, 1, 125, 234, 111, 39, 208, 1, 121, 234, 
+    120, 39, 208, 1, 125, 234, 120, 39, 208, 1, 121, 242, 181, 39, 208, 1, 
+    125, 242, 181, 39, 208, 1, 121, 229, 9, 39, 208, 1, 125, 229, 9, 39, 208, 
+    1, 121, 249, 246, 39, 208, 1, 125, 249, 246, 39, 208, 1, 121, 250, 94, 
+    39, 208, 1, 125, 250, 94, 39, 208, 1, 121, 219, 60, 39, 208, 1, 125, 219, 
+    60, 39, 208, 1, 121, 227, 138, 39, 208, 1, 125, 227, 138, 39, 208, 1, 
+    121, 247, 153, 39, 208, 1, 125, 247, 153, 39, 208, 1, 121, 112, 39, 208, 
+    1, 125, 112, 39, 208, 1, 121, 216, 157, 39, 208, 1, 125, 216, 157, 39, 
+    208, 1, 121, 228, 79, 39, 208, 1, 125, 228, 79, 39, 208, 1, 121, 251, 
+    213, 39, 208, 1, 125, 251, 213, 39, 208, 1, 121, 225, 19, 39, 208, 1, 
+    125, 225, 19, 39, 208, 1, 121, 225, 124, 39, 208, 1, 125, 225, 124, 39, 
+    208, 1, 121, 244, 51, 39, 208, 1, 125, 244, 51, 39, 208, 1, 121, 230, 
+    166, 39, 208, 1, 125, 230, 166, 39, 208, 1, 121, 210, 244, 39, 208, 1, 
+    125, 210, 244, 39, 208, 1, 121, 222, 213, 39, 208, 1, 125, 222, 213, 39, 
+    208, 1, 121, 232, 162, 39, 208, 1, 125, 232, 162, 39, 208, 1, 121, 213, 
+    138, 39, 208, 1, 125, 213, 138, 39, 208, 1, 121, 241, 75, 39, 208, 1, 
+    125, 241, 75, 39, 208, 1, 121, 78, 39, 208, 1, 125, 78, 39, 208, 231, 
+    209, 234, 236, 39, 208, 25, 255, 82, 39, 208, 25, 74, 39, 208, 25, 214, 
+    214, 39, 208, 25, 69, 39, 208, 25, 76, 39, 208, 25, 78, 39, 208, 231, 
+    209, 234, 114, 39, 208, 25, 240, 126, 39, 208, 25, 214, 213, 39, 208, 25, 
+    214, 229, 39, 208, 25, 253, 198, 39, 208, 25, 253, 175, 39, 208, 25, 254, 
+    131, 39, 208, 25, 254, 144, 39, 208, 138, 231, 209, 245, 188, 39, 208, 
+    138, 231, 209, 227, 210, 39, 208, 138, 231, 209, 216, 157, 39, 208, 138, 
+    231, 209, 219, 44, 39, 208, 16, 234, 19, 39, 208, 16, 227, 210, 39, 208, 
+    16, 221, 255, 39, 208, 16, 241, 76, 241, 71, 39, 208, 16, 234, 28, 234, 
+    27, 188, 187, 1, 76, 188, 187, 1, 78, 188, 187, 1, 250, 165, 188, 187, 1, 
+    227, 169, 188, 187, 1, 215, 157, 188, 187, 1, 215, 145, 188, 187, 1, 248, 
+    143, 188, 187, 1, 248, 127, 188, 187, 1, 228, 115, 188, 187, 1, 220, 104, 
+    188, 187, 1, 218, 225, 188, 187, 25, 5, 236, 40, 188, 187, 25, 5, 214, 
+    118, 188, 187, 25, 5, 255, 46, 188, 187, 25, 5, 253, 200, 188, 187, 25, 
+    5, 255, 39, 188, 187, 250, 133, 188, 187, 254, 215, 234, 104, 188, 187, 
+    254, 111, 188, 187, 3, 223, 77, 79, 188, 187, 211, 209, 223, 77, 79, 188, 
+    187, 25, 5, 213, 147, 188, 187, 213, 152, 29, 3, 215, 138, 29, 3, 215, 
+    141, 29, 3, 215, 144, 29, 3, 215, 142, 29, 3, 215, 143, 29, 3, 215, 140, 
+    29, 3, 248, 121, 29, 3, 248, 123, 29, 3, 248, 126, 29, 3, 248, 124, 29, 
+    3, 248, 125, 29, 3, 248, 122, 29, 3, 246, 36, 29, 3, 246, 39, 29, 3, 246, 
+    45, 29, 3, 246, 43, 29, 3, 246, 44, 29, 3, 246, 37, 29, 3, 250, 212, 29, 
+    3, 250, 206, 29, 3, 250, 208, 29, 3, 250, 211, 29, 3, 250, 209, 29, 3, 
+    250, 210, 29, 3, 250, 207, 29, 3, 252, 119, 29, 3, 252, 98, 29, 3, 252, 
+    110, 29, 3, 252, 118, 29, 3, 252, 113, 29, 3, 252, 114, 29, 3, 252, 102, 
+    188, 187, 1, 234, 25, 188, 187, 1, 221, 255, 188, 187, 1, 233, 115, 188, 
+    187, 1, 230, 177, 188, 187, 1, 191, 188, 187, 1, 198, 188, 187, 1, 250, 
+    110, 188, 187, 1, 216, 91, 188, 187, 1, 234, 107, 188, 187, 1, 228, 255, 
+    188, 187, 1, 216, 151, 188, 187, 1, 212, 60, 188, 187, 1, 211, 69, 188, 
+    187, 1, 240, 223, 188, 187, 1, 214, 190, 188, 187, 1, 74, 188, 187, 1, 
+    225, 145, 188, 187, 1, 253, 210, 188, 187, 1, 242, 174, 188, 187, 1, 235, 
+    118, 188, 187, 1, 223, 169, 188, 187, 1, 252, 199, 188, 187, 1, 235, 106, 
+    188, 187, 1, 247, 227, 188, 187, 1, 242, 228, 188, 187, 1, 248, 13, 188, 
+    187, 1, 252, 24, 188, 187, 1, 234, 26, 232, 134, 188, 187, 1, 233, 116, 
+    232, 134, 188, 187, 1, 230, 178, 232, 134, 188, 187, 1, 226, 94, 232, 
+    134, 188, 187, 1, 229, 234, 232, 134, 188, 187, 1, 216, 92, 232, 134, 
+    188, 187, 1, 229, 0, 232, 134, 188, 187, 1, 240, 161, 232, 134, 188, 187, 
+    25, 5, 226, 199, 188, 187, 25, 5, 236, 4, 188, 187, 25, 5, 254, 130, 188, 
+    187, 25, 5, 211, 38, 188, 187, 25, 5, 219, 34, 188, 187, 25, 5, 214, 187, 
+    188, 187, 25, 5, 250, 131, 188, 187, 25, 5, 227, 195, 188, 187, 250, 132, 
+    188, 187, 232, 90, 235, 156, 188, 187, 254, 54, 235, 156, 188, 187, 21, 
+    210, 86, 188, 187, 21, 111, 188, 187, 21, 105, 188, 187, 21, 158, 188, 
+    187, 21, 161, 188, 187, 21, 190, 188, 187, 21, 195, 188, 187, 21, 199, 
+    188, 187, 21, 196, 188, 187, 21, 201, 24, 143, 227, 81, 24, 143, 227, 86, 
+    24, 143, 210, 243, 24, 143, 210, 242, 24, 143, 210, 241, 24, 143, 215, 
+    23, 24, 143, 215, 26, 24, 143, 210, 210, 24, 143, 210, 206, 24, 143, 245, 
+    62, 24, 143, 245, 60, 24, 143, 245, 61, 24, 143, 245, 58, 24, 143, 240, 
+    151, 24, 143, 240, 150, 24, 143, 240, 148, 24, 143, 240, 149, 24, 143, 
+    240, 154, 24, 143, 240, 147, 24, 143, 240, 146, 24, 143, 240, 156, 24, 
+    143, 254, 41, 24, 143, 254, 40, 24, 90, 228, 224, 24, 90, 228, 230, 24, 
+    90, 218, 206, 24, 90, 218, 205, 24, 90, 216, 97, 24, 90, 216, 95, 24, 90, 
+    216, 94, 24, 90, 216, 100, 24, 90, 216, 101, 24, 90, 216, 93, 24, 90, 
+    223, 8, 24, 90, 223, 23, 24, 90, 218, 212, 24, 90, 223, 20, 24, 90, 223, 
+    10, 24, 90, 223, 12, 24, 90, 222, 255, 24, 90, 223, 0, 24, 90, 234, 224, 
+    24, 90, 230, 217, 24, 90, 230, 211, 24, 90, 218, 216, 24, 90, 230, 214, 
+    24, 90, 230, 220, 24, 90, 225, 79, 24, 90, 225, 88, 24, 90, 225, 92, 24, 
+    90, 218, 214, 24, 90, 225, 82, 24, 90, 225, 96, 24, 90, 225, 97, 24, 90, 
+    219, 142, 24, 90, 219, 145, 24, 90, 218, 210, 24, 90, 218, 208, 24, 90, 
+    219, 140, 24, 90, 219, 148, 24, 90, 219, 149, 24, 90, 219, 134, 24, 90, 
+    219, 147, 24, 90, 226, 34, 24, 90, 226, 35, 24, 90, 211, 24, 24, 90, 211, 
+    25, 24, 90, 250, 52, 24, 90, 250, 51, 24, 90, 218, 221, 24, 90, 225, 131, 
+    24, 90, 225, 130, 10, 14, 238, 31, 10, 14, 238, 30, 10, 14, 238, 29, 10, 
+    14, 238, 28, 10, 14, 238, 27, 10, 14, 238, 26, 10, 14, 238, 25, 10, 14, 
+    238, 24, 10, 14, 238, 23, 10, 14, 238, 22, 10, 14, 238, 21, 10, 14, 238, 
+    20, 10, 14, 238, 19, 10, 14, 238, 18, 10, 14, 238, 17, 10, 14, 238, 16, 
+    10, 14, 238, 15, 10, 14, 238, 14, 10, 14, 238, 13, 10, 14, 238, 12, 10, 
+    14, 238, 11, 10, 14, 238, 10, 10, 14, 238, 9, 10, 14, 238, 8, 10, 14, 
+    238, 7, 10, 14, 238, 6, 10, 14, 238, 5, 10, 14, 238, 4, 10, 14, 238, 3, 
+    10, 14, 238, 2, 10, 14, 238, 1, 10, 14, 238, 0, 10, 14, 237, 255, 10, 14, 
+    237, 254, 10, 14, 237, 253, 10, 14, 237, 252, 10, 14, 237, 251, 10, 14, 
+    237, 250, 10, 14, 237, 249, 10, 14, 237, 248, 10, 14, 237, 247, 10, 14, 
+    237, 246, 10, 14, 237, 245, 10, 14, 237, 244, 10, 14, 237, 243, 10, 14, 
+    237, 242, 10, 14, 237, 241, 10, 14, 237, 240, 10, 14, 237, 239, 10, 14, 
+    237, 238, 10, 14, 237, 237, 10, 14, 237, 236, 10, 14, 237, 235, 10, 14, 
+    237, 234, 10, 14, 237, 233, 10, 14, 237, 232, 10, 14, 237, 231, 10, 14, 
+    237, 230, 10, 14, 237, 229, 10, 14, 237, 228, 10, 14, 237, 227, 10, 14, 
+    237, 226, 10, 14, 237, 225, 10, 14, 237, 224, 10, 14, 237, 223, 10, 14, 
+    237, 222, 10, 14, 237, 221, 10, 14, 237, 220, 10, 14, 237, 219, 10, 14, 
+    237, 218, 10, 14, 237, 217, 10, 14, 237, 216, 10, 14, 237, 215, 10, 14, 
+    237, 214, 10, 14, 237, 213, 10, 14, 237, 212, 10, 14, 237, 211, 10, 14, 
+    237, 210, 10, 14, 237, 209, 10, 14, 237, 208, 10, 14, 237, 207, 10, 14, 
+    237, 206, 10, 14, 237, 205, 10, 14, 237, 204, 10, 14, 237, 203, 10, 14, 
+    237, 202, 10, 14, 237, 201, 10, 14, 237, 200, 10, 14, 237, 199, 10, 14, 
+    237, 198, 10, 14, 237, 197, 10, 14, 237, 196, 10, 14, 237, 195, 10, 14, 
+    237, 194, 10, 14, 237, 193, 10, 14, 237, 192, 10, 14, 237, 191, 10, 14, 
+    237, 190, 10, 14, 237, 189, 10, 14, 237, 188, 10, 14, 237, 187, 10, 14, 
+    237, 186, 10, 14, 237, 185, 10, 14, 237, 184, 10, 14, 237, 183, 10, 14, 
+    237, 182, 10, 14, 237, 181, 10, 14, 237, 180, 10, 14, 237, 179, 10, 14, 
+    237, 178, 10, 14, 237, 177, 10, 14, 237, 176, 10, 14, 237, 175, 10, 14, 
+    237, 174, 10, 14, 237, 173, 10, 14, 237, 172, 10, 14, 237, 171, 10, 14, 
+    237, 170, 10, 14, 237, 169, 10, 14, 237, 168, 10, 14, 237, 167, 10, 14, 
+    237, 166, 10, 14, 237, 165, 10, 14, 237, 164, 10, 14, 237, 163, 10, 14, 
+    237, 162, 10, 14, 237, 161, 10, 14, 237, 160, 10, 14, 237, 159, 10, 14, 
+    237, 158, 10, 14, 237, 157, 10, 14, 237, 156, 10, 14, 237, 155, 10, 14, 
+    237, 154, 10, 14, 237, 153, 10, 14, 237, 152, 10, 14, 237, 151, 10, 14, 
+    237, 150, 10, 14, 237, 149, 10, 14, 237, 148, 10, 14, 237, 147, 10, 14, 
+    237, 146, 10, 14, 237, 145, 10, 14, 237, 144, 10, 14, 237, 143, 10, 14, 
+    237, 142, 10, 14, 237, 141, 10, 14, 237, 140, 10, 14, 237, 139, 10, 14, 
+    237, 138, 10, 14, 237, 137, 10, 14, 237, 136, 10, 14, 237, 135, 10, 14, 
+    237, 134, 10, 14, 237, 133, 10, 14, 237, 132, 10, 14, 237, 131, 10, 14, 
+    237, 130, 10, 14, 237, 129, 10, 14, 237, 128, 10, 14, 237, 127, 10, 14, 
+    237, 126, 10, 14, 237, 125, 10, 14, 237, 124, 10, 14, 237, 123, 10, 14, 
+    237, 122, 10, 14, 237, 121, 10, 14, 237, 120, 10, 14, 237, 119, 10, 14, 
+    237, 118, 10, 14, 237, 117, 10, 14, 237, 116, 10, 14, 237, 115, 10, 14, 
+    237, 114, 10, 14, 237, 113, 10, 14, 237, 112, 10, 14, 237, 111, 10, 14, 
+    237, 110, 10, 14, 237, 109, 10, 14, 237, 108, 10, 14, 237, 107, 10, 14, 
+    237, 106, 10, 14, 237, 105, 10, 14, 237, 104, 10, 14, 237, 103, 10, 14, 
+    237, 102, 10, 14, 237, 101, 10, 14, 237, 100, 10, 14, 237, 99, 10, 14, 
+    237, 98, 10, 14, 237, 97, 10, 14, 237, 96, 10, 14, 237, 95, 10, 14, 237, 
+    94, 10, 14, 237, 93, 10, 14, 237, 92, 10, 14, 237, 91, 10, 14, 237, 90, 
+    10, 14, 237, 89, 10, 14, 237, 88, 10, 14, 237, 87, 10, 14, 237, 86, 10, 
+    14, 237, 85, 10, 14, 237, 84, 10, 14, 237, 83, 10, 14, 237, 82, 10, 14, 
+    237, 81, 10, 14, 237, 80, 10, 14, 237, 79, 10, 14, 237, 78, 10, 14, 237, 
+    77, 10, 14, 237, 76, 10, 14, 237, 75, 10, 14, 237, 74, 10, 14, 237, 73, 
+    10, 14, 237, 72, 10, 14, 237, 71, 10, 14, 237, 70, 10, 14, 237, 69, 10, 
+    14, 237, 68, 10, 14, 237, 67, 10, 14, 237, 66, 10, 14, 237, 65, 10, 14, 
+    237, 64, 10, 14, 237, 63, 10, 14, 237, 62, 10, 14, 237, 61, 10, 14, 237, 
+    60, 10, 14, 237, 59, 10, 14, 237, 58, 10, 14, 237, 57, 10, 14, 237, 56, 
+    10, 14, 237, 55, 10, 14, 237, 54, 10, 14, 237, 53, 10, 14, 237, 52, 10, 
+    14, 237, 51, 10, 14, 237, 50, 10, 14, 237, 49, 10, 14, 237, 48, 10, 14, 
+    237, 47, 10, 14, 237, 46, 10, 14, 237, 45, 10, 14, 237, 44, 10, 14, 237, 
+    43, 10, 14, 237, 42, 10, 14, 237, 41, 10, 14, 237, 40, 10, 14, 237, 39, 
+    10, 14, 237, 38, 10, 14, 237, 37, 10, 14, 237, 36, 10, 14, 237, 35, 10, 
+    14, 237, 34, 10, 14, 237, 33, 10, 14, 237, 32, 10, 14, 237, 31, 10, 14, 
+    237, 30, 10, 14, 237, 29, 10, 14, 237, 28, 10, 14, 237, 27, 10, 14, 237, 
+    26, 10, 14, 237, 25, 10, 14, 237, 24, 10, 14, 237, 23, 10, 14, 237, 22, 
+    10, 14, 237, 21, 10, 14, 237, 20, 10, 14, 237, 19, 10, 14, 237, 18, 10, 
+    14, 237, 17, 10, 14, 237, 16, 10, 14, 237, 15, 10, 14, 237, 14, 10, 14, 
+    237, 13, 10, 14, 237, 12, 10, 14, 237, 11, 10, 14, 237, 10, 10, 14, 237, 
+    9, 10, 14, 237, 8, 10, 14, 237, 7, 10, 14, 237, 6, 10, 14, 237, 5, 10, 
+    14, 237, 4, 10, 14, 237, 3, 10, 14, 237, 2, 10, 14, 237, 1, 10, 14, 237, 
+    0, 10, 14, 236, 255, 10, 14, 236, 254, 10, 14, 236, 253, 10, 14, 236, 
+    252, 10, 14, 236, 251, 10, 14, 236, 250, 10, 14, 236, 249, 10, 14, 236, 
+    248, 10, 14, 236, 247, 10, 14, 236, 246, 10, 14, 236, 245, 10, 14, 236, 
+    244, 10, 14, 236, 243, 10, 14, 236, 242, 10, 14, 236, 241, 10, 14, 236, 
+    240, 10, 14, 236, 239, 10, 14, 236, 238, 10, 14, 236, 237, 10, 14, 236, 
+    236, 10, 14, 236, 235, 10, 14, 236, 234, 10, 14, 236, 233, 10, 14, 236, 
+    232, 10, 14, 236, 231, 10, 14, 236, 230, 10, 14, 236, 229, 10, 14, 236, 
+    228, 10, 14, 236, 227, 10, 14, 236, 226, 10, 14, 236, 225, 10, 14, 236, 
+    224, 10, 14, 236, 223, 10, 14, 236, 222, 10, 14, 236, 221, 10, 14, 236, 
+    220, 10, 14, 236, 219, 10, 14, 236, 218, 10, 14, 236, 217, 10, 14, 236, 
+    216, 10, 14, 236, 215, 10, 14, 236, 214, 10, 14, 236, 213, 10, 14, 236, 
+    212, 10, 14, 236, 211, 10, 14, 236, 210, 10, 14, 236, 209, 10, 14, 236, 
+    208, 10, 14, 236, 207, 10, 14, 236, 206, 10, 14, 236, 205, 10, 14, 236, 
+    204, 10, 14, 236, 203, 10, 14, 236, 202, 10, 14, 236, 201, 10, 14, 236, 
+    200, 10, 14, 236, 199, 10, 14, 236, 198, 10, 14, 236, 197, 10, 14, 236, 
+    196, 10, 14, 236, 195, 10, 14, 236, 194, 10, 14, 236, 193, 10, 14, 236, 
+    192, 10, 14, 236, 191, 10, 14, 236, 190, 10, 14, 236, 189, 10, 14, 236, 
+    188, 10, 14, 236, 187, 10, 14, 236, 186, 10, 14, 236, 185, 10, 14, 236, 
+    184, 10, 14, 236, 183, 10, 14, 236, 182, 10, 14, 236, 181, 10, 14, 236, 
+    180, 10, 14, 236, 179, 10, 14, 236, 178, 10, 14, 236, 177, 10, 14, 236, 
+    176, 10, 14, 236, 175, 10, 14, 236, 174, 10, 14, 236, 173, 10, 14, 236, 
+    172, 10, 14, 236, 171, 10, 14, 236, 170, 10, 14, 236, 169, 10, 14, 236, 
+    168, 10, 14, 236, 167, 10, 14, 236, 166, 10, 14, 236, 165, 10, 14, 236, 
+    164, 10, 14, 236, 163, 10, 14, 236, 162, 10, 14, 236, 161, 10, 14, 236, 
+    160, 10, 14, 236, 159, 10, 14, 236, 158, 10, 14, 236, 157, 10, 14, 236, 
+    156, 10, 14, 236, 155, 10, 14, 236, 154, 10, 14, 236, 153, 10, 14, 236, 
+    152, 10, 14, 236, 151, 10, 14, 236, 150, 10, 14, 236, 149, 10, 14, 236, 
+    148, 10, 14, 236, 147, 10, 14, 236, 146, 10, 14, 236, 145, 10, 14, 236, 
+    144, 10, 14, 236, 143, 10, 14, 236, 142, 10, 14, 236, 141, 10, 14, 236, 
+    140, 10, 14, 236, 139, 10, 14, 236, 138, 10, 14, 236, 137, 10, 14, 236, 
+    136, 10, 14, 236, 135, 10, 14, 236, 134, 10, 14, 236, 133, 10, 14, 236, 
+    132, 10, 14, 236, 131, 10, 14, 236, 130, 10, 14, 236, 129, 10, 14, 236, 
+    128, 10, 14, 236, 127, 10, 14, 236, 126, 10, 14, 236, 125, 10, 14, 236, 
+    124, 10, 14, 236, 123, 10, 14, 236, 122, 10, 14, 236, 121, 10, 14, 236, 
+    120, 10, 14, 236, 119, 10, 14, 236, 118, 10, 14, 236, 117, 10, 14, 236, 
+    116, 10, 14, 236, 115, 10, 14, 236, 114, 10, 14, 236, 113, 10, 14, 236, 
+    112, 10, 14, 236, 111, 10, 14, 236, 110, 10, 14, 236, 109, 10, 14, 236, 
+    108, 10, 14, 236, 107, 10, 14, 236, 106, 10, 14, 236, 105, 10, 14, 236, 
+    104, 10, 14, 236, 103, 10, 14, 236, 102, 10, 14, 236, 101, 10, 14, 236, 
+    100, 10, 14, 236, 99, 10, 14, 236, 98, 10, 14, 236, 97, 10, 14, 236, 96, 
+    10, 14, 236, 95, 10, 14, 236, 94, 10, 14, 236, 93, 10, 14, 236, 92, 10, 
+    14, 236, 91, 10, 14, 236, 90, 10, 14, 236, 89, 10, 14, 236, 88, 10, 14, 
+    236, 87, 10, 14, 236, 86, 10, 14, 236, 85, 10, 14, 236, 84, 10, 14, 236, 
+    83, 10, 14, 236, 82, 10, 14, 236, 81, 10, 14, 236, 80, 10, 14, 236, 79, 
+    10, 14, 236, 78, 10, 14, 236, 77, 10, 14, 236, 76, 10, 14, 236, 75, 10, 
+    14, 236, 74, 10, 14, 236, 73, 10, 14, 236, 72, 7, 4, 27, 244, 133, 7, 4, 
+    27, 244, 129, 7, 4, 27, 244, 84, 7, 4, 27, 244, 132, 7, 4, 27, 244, 131, 
+    7, 4, 27, 200, 222, 94, 217, 153, 7, 4, 27, 218, 170, 150, 4, 27, 231, 
+    64, 228, 44, 150, 4, 27, 231, 64, 245, 221, 150, 4, 27, 231, 64, 235, 
+    234, 150, 4, 27, 213, 180, 228, 44, 150, 4, 27, 231, 64, 211, 160, 94, 1, 
+    210, 234, 2, 241, 165, 94, 225, 14, 235, 56, 214, 11, 94, 27, 211, 6, 
+    210, 234, 210, 234, 225, 243, 94, 1, 254, 147, 253, 170, 94, 1, 211, 247, 
+    254, 179, 94, 1, 211, 247, 248, 197, 94, 1, 211, 247, 241, 245, 94, 1, 
+    211, 247, 235, 0, 94, 1, 211, 247, 233, 100, 94, 1, 211, 247, 40, 231, 
+    70, 94, 1, 211, 247, 223, 70, 94, 1, 211, 247, 217, 39, 94, 1, 254, 147, 
+    96, 50, 94, 1, 220, 23, 2, 220, 23, 247, 128, 94, 1, 220, 23, 2, 219, 
+    161, 247, 128, 94, 1, 220, 23, 2, 248, 216, 22, 220, 23, 247, 128, 94, 1, 
+    220, 23, 2, 248, 216, 22, 219, 161, 247, 128, 94, 1, 109, 2, 225, 243, 
+    94, 1, 109, 2, 224, 79, 94, 1, 109, 2, 231, 176, 94, 1, 252, 37, 2, 248, 
+    215, 94, 1, 242, 209, 2, 248, 215, 94, 1, 248, 198, 2, 248, 215, 94, 1, 
+    241, 246, 2, 231, 176, 94, 1, 214, 4, 2, 248, 215, 94, 1, 210, 98, 2, 
+    248, 215, 94, 1, 216, 232, 2, 248, 215, 94, 1, 210, 234, 2, 248, 215, 94, 
+    1, 40, 235, 1, 2, 248, 215, 94, 1, 235, 1, 2, 248, 215, 94, 1, 233, 101, 
+    2, 248, 215, 94, 1, 231, 71, 2, 248, 215, 94, 1, 227, 199, 2, 248, 215, 
+    94, 1, 221, 252, 2, 248, 215, 94, 1, 40, 225, 225, 2, 248, 215, 94, 1, 
+    225, 225, 2, 248, 215, 94, 1, 215, 181, 2, 248, 215, 94, 1, 224, 43, 2, 
+    248, 215, 94, 1, 223, 71, 2, 248, 215, 94, 1, 220, 23, 2, 248, 215, 94, 
+    1, 217, 40, 2, 248, 215, 94, 1, 214, 4, 2, 241, 68, 94, 1, 252, 37, 2, 
+    223, 172, 94, 1, 235, 1, 2, 223, 172, 94, 1, 225, 225, 2, 223, 172, 94, 
+    27, 109, 233, 100, 9, 1, 109, 212, 47, 53, 17, 9, 1, 109, 212, 47, 40, 
+    17, 9, 1, 252, 73, 53, 17, 9, 1, 252, 73, 40, 17, 9, 1, 252, 73, 65, 17, 
+    9, 1, 252, 73, 147, 17, 9, 1, 225, 209, 53, 17, 9, 1, 225, 209, 40, 17, 
+    9, 1, 225, 209, 65, 17, 9, 1, 225, 209, 147, 17, 9, 1, 252, 61, 53, 17, 
+    9, 1, 252, 61, 40, 17, 9, 1, 252, 61, 65, 17, 9, 1, 252, 61, 147, 17, 9, 
+    1, 215, 148, 53, 17, 9, 1, 215, 148, 40, 17, 9, 1, 215, 148, 65, 17, 9, 
+    1, 215, 148, 147, 17, 9, 1, 217, 7, 53, 17, 9, 1, 217, 7, 40, 17, 9, 1, 
+    217, 7, 65, 17, 9, 1, 217, 7, 147, 17, 9, 1, 215, 150, 53, 17, 9, 1, 215, 
+    150, 40, 17, 9, 1, 215, 150, 65, 17, 9, 1, 215, 150, 147, 17, 9, 1, 213, 
+    249, 53, 17, 9, 1, 213, 249, 40, 17, 9, 1, 213, 249, 65, 17, 9, 1, 213, 
+    249, 147, 17, 9, 1, 225, 207, 53, 17, 9, 1, 225, 207, 40, 17, 9, 1, 225, 
+    207, 65, 17, 9, 1, 225, 207, 147, 17, 9, 1, 246, 52, 53, 17, 9, 1, 246, 
+    52, 40, 17, 9, 1, 246, 52, 65, 17, 9, 1, 246, 52, 147, 17, 9, 1, 227, 
+    158, 53, 17, 9, 1, 227, 158, 40, 17, 9, 1, 227, 158, 65, 17, 9, 1, 227, 
+    158, 147, 17, 9, 1, 217, 28, 53, 17, 9, 1, 217, 28, 40, 17, 9, 1, 217, 
+    28, 65, 17, 9, 1, 217, 28, 147, 17, 9, 1, 217, 26, 53, 17, 9, 1, 217, 26, 
+    40, 17, 9, 1, 217, 26, 65, 17, 9, 1, 217, 26, 147, 17, 9, 1, 248, 141, 
+    53, 17, 9, 1, 248, 141, 40, 17, 9, 1, 248, 210, 53, 17, 9, 1, 248, 210, 
+    40, 17, 9, 1, 246, 79, 53, 17, 9, 1, 246, 79, 40, 17, 9, 1, 248, 139, 53, 
+    17, 9, 1, 248, 139, 40, 17, 9, 1, 235, 127, 53, 17, 9, 1, 235, 127, 40, 
+    17, 9, 1, 222, 174, 53, 17, 9, 1, 222, 174, 40, 17, 9, 1, 234, 181, 53, 
+    17, 9, 1, 234, 181, 40, 17, 9, 1, 234, 181, 65, 17, 9, 1, 234, 181, 147, 
+    17, 9, 1, 243, 130, 53, 17, 9, 1, 243, 130, 40, 17, 9, 1, 243, 130, 65, 
+    17, 9, 1, 243, 130, 147, 17, 9, 1, 242, 109, 53, 17, 9, 1, 242, 109, 40, 
+    17, 9, 1, 242, 109, 65, 17, 9, 1, 242, 109, 147, 17, 9, 1, 229, 8, 53, 
+    17, 9, 1, 229, 8, 40, 17, 9, 1, 229, 8, 65, 17, 9, 1, 229, 8, 147, 17, 9, 
+    1, 228, 68, 242, 226, 53, 17, 9, 1, 228, 68, 242, 226, 40, 17, 9, 1, 222, 
+    217, 53, 17, 9, 1, 222, 217, 40, 17, 9, 1, 222, 217, 65, 17, 9, 1, 222, 
+    217, 147, 17, 9, 1, 241, 226, 2, 77, 72, 53, 17, 9, 1, 241, 226, 2, 77, 
+    72, 40, 17, 9, 1, 241, 226, 242, 179, 53, 17, 9, 1, 241, 226, 242, 179, 
+    40, 17, 9, 1, 241, 226, 242, 179, 65, 17, 9, 1, 241, 226, 242, 179, 147, 
+    17, 9, 1, 241, 226, 247, 150, 53, 17, 9, 1, 241, 226, 247, 150, 40, 17, 
+    9, 1, 241, 226, 247, 150, 65, 17, 9, 1, 241, 226, 247, 150, 147, 17, 9, 
+    1, 77, 252, 141, 53, 17, 9, 1, 77, 252, 141, 40, 17, 9, 1, 77, 252, 141, 
+    2, 182, 72, 53, 17, 9, 1, 77, 252, 141, 2, 182, 72, 40, 17, 9, 16, 59, 
+    48, 9, 16, 59, 51, 9, 16, 113, 170, 48, 9, 16, 113, 170, 51, 9, 16, 134, 
+    170, 48, 9, 16, 134, 170, 51, 9, 16, 134, 170, 225, 10, 246, 112, 48, 9, 
+    16, 134, 170, 225, 10, 246, 112, 51, 9, 16, 244, 19, 170, 48, 9, 16, 244, 
+    19, 170, 51, 9, 16, 52, 67, 252, 149, 51, 9, 16, 113, 170, 213, 189, 48, 
+    9, 16, 113, 170, 213, 189, 51, 9, 16, 222, 236, 9, 16, 4, 217, 82, 48, 9, 
+    16, 4, 217, 82, 51, 9, 1, 229, 85, 53, 17, 9, 1, 229, 85, 40, 17, 9, 1, 
+    229, 85, 65, 17, 9, 1, 229, 85, 147, 17, 9, 1, 104, 53, 17, 9, 1, 104, 
+    40, 17, 9, 1, 226, 239, 53, 17, 9, 1, 226, 239, 40, 17, 9, 1, 210, 213, 
+    53, 17, 9, 1, 210, 213, 40, 17, 9, 1, 104, 2, 182, 72, 53, 17, 9, 1, 214, 
+    0, 53, 17, 9, 1, 214, 0, 40, 17, 9, 1, 234, 79, 226, 239, 53, 17, 9, 1, 
+    234, 79, 226, 239, 40, 17, 9, 1, 234, 79, 210, 213, 53, 17, 9, 1, 234, 
+    79, 210, 213, 40, 17, 9, 1, 160, 53, 17, 9, 1, 160, 40, 17, 9, 1, 160, 
+    65, 17, 9, 1, 160, 147, 17, 9, 1, 214, 207, 234, 192, 234, 79, 109, 231, 
+    198, 65, 17, 9, 1, 214, 207, 234, 192, 234, 79, 109, 231, 198, 147, 17, 
+    9, 27, 77, 2, 182, 72, 2, 109, 53, 17, 9, 27, 77, 2, 182, 72, 2, 109, 40, 
+    17, 9, 27, 77, 2, 182, 72, 2, 254, 253, 53, 17, 9, 27, 77, 2, 182, 72, 2, 
+    254, 253, 40, 17, 9, 27, 77, 2, 182, 72, 2, 212, 31, 53, 17, 9, 27, 77, 
+    2, 182, 72, 2, 212, 31, 40, 17, 9, 27, 77, 2, 182, 72, 2, 104, 53, 17, 9, 
+    27, 77, 2, 182, 72, 2, 104, 40, 17, 9, 27, 77, 2, 182, 72, 2, 226, 239, 
+    53, 17, 9, 27, 77, 2, 182, 72, 2, 226, 239, 40, 17, 9, 27, 77, 2, 182, 
+    72, 2, 210, 213, 53, 17, 9, 27, 77, 2, 182, 72, 2, 210, 213, 40, 17, 9, 
+    27, 77, 2, 182, 72, 2, 160, 53, 17, 9, 27, 77, 2, 182, 72, 2, 160, 40, 
+    17, 9, 27, 77, 2, 182, 72, 2, 160, 65, 17, 9, 27, 214, 207, 234, 79, 77, 
+    2, 182, 72, 2, 109, 231, 198, 53, 17, 9, 27, 214, 207, 234, 79, 77, 2, 
+    182, 72, 2, 109, 231, 198, 40, 17, 9, 27, 214, 207, 234, 79, 77, 2, 182, 
+    72, 2, 109, 231, 198, 65, 17, 9, 1, 244, 176, 77, 53, 17, 9, 1, 244, 176, 
+    77, 40, 17, 9, 1, 244, 176, 77, 65, 17, 9, 1, 244, 176, 77, 147, 17, 9, 
+    27, 77, 2, 182, 72, 2, 151, 53, 17, 9, 27, 77, 2, 182, 72, 2, 122, 53, 
+    17, 9, 27, 77, 2, 182, 72, 2, 66, 53, 17, 9, 27, 77, 2, 182, 72, 2, 109, 
+    231, 198, 53, 17, 9, 27, 77, 2, 182, 72, 2, 77, 53, 17, 9, 27, 252, 63, 
+    2, 151, 53, 17, 9, 27, 252, 63, 2, 122, 53, 17, 9, 27, 252, 63, 2, 234, 
+    136, 53, 17, 9, 27, 252, 63, 2, 66, 53, 17, 9, 27, 252, 63, 2, 109, 231, 
+    198, 53, 17, 9, 27, 252, 63, 2, 77, 53, 17, 9, 27, 217, 9, 2, 151, 53, 
+    17, 9, 27, 217, 9, 2, 122, 53, 17, 9, 27, 217, 9, 2, 234, 136, 53, 17, 9, 
+    27, 217, 9, 2, 66, 53, 17, 9, 27, 217, 9, 2, 109, 231, 198, 53, 17, 9, 
+    27, 217, 9, 2, 77, 53, 17, 9, 27, 216, 194, 2, 151, 53, 17, 9, 27, 216, 
+    194, 2, 66, 53, 17, 9, 27, 216, 194, 2, 109, 231, 198, 53, 17, 9, 27, 
+    216, 194, 2, 77, 53, 17, 9, 27, 151, 2, 122, 53, 17, 9, 27, 151, 2, 66, 
+    53, 17, 9, 27, 122, 2, 151, 53, 17, 9, 27, 122, 2, 66, 53, 17, 9, 27, 
+    234, 136, 2, 151, 53, 17, 9, 27, 234, 136, 2, 122, 53, 17, 9, 27, 234, 
+    136, 2, 66, 53, 17, 9, 27, 221, 169, 2, 151, 53, 17, 9, 27, 221, 169, 2, 
+    122, 53, 17, 9, 27, 221, 169, 2, 234, 136, 53, 17, 9, 27, 221, 169, 2, 
+    66, 53, 17, 9, 27, 222, 29, 2, 122, 53, 17, 9, 27, 222, 29, 2, 66, 53, 
+    17, 9, 27, 248, 225, 2, 151, 53, 17, 9, 27, 248, 225, 2, 122, 53, 17, 9, 
+    27, 248, 225, 2, 234, 136, 53, 17, 9, 27, 248, 225, 2, 66, 53, 17, 9, 27, 
+    217, 82, 2, 122, 53, 17, 9, 27, 217, 82, 2, 66, 53, 17, 9, 27, 210, 112, 
+    2, 66, 53, 17, 9, 27, 254, 206, 2, 151, 53, 17, 9, 27, 254, 206, 2, 66, 
+    53, 17, 9, 27, 242, 252, 2, 151, 53, 17, 9, 27, 242, 252, 2, 66, 53, 17, 
+    9, 27, 244, 151, 2, 151, 53, 17, 9, 27, 244, 151, 2, 122, 53, 17, 9, 27, 
+    244, 151, 2, 234, 136, 53, 17, 9, 27, 244, 151, 2, 66, 53, 17, 9, 27, 
+    244, 151, 2, 109, 231, 198, 53, 17, 9, 27, 244, 151, 2, 77, 53, 17, 9, 
+    27, 224, 85, 2, 122, 53, 17, 9, 27, 224, 85, 2, 66, 53, 17, 9, 27, 224, 
+    85, 2, 109, 231, 198, 53, 17, 9, 27, 224, 85, 2, 77, 53, 17, 9, 27, 235, 
+    1, 2, 109, 53, 17, 9, 27, 235, 1, 2, 151, 53, 17, 9, 27, 235, 1, 2, 122, 
+    53, 17, 9, 27, 235, 1, 2, 234, 136, 53, 17, 9, 27, 235, 1, 2, 233, 109, 
+    53, 17, 9, 27, 235, 1, 2, 66, 53, 17, 9, 27, 235, 1, 2, 109, 231, 198, 
+    53, 17, 9, 27, 235, 1, 2, 77, 53, 17, 9, 27, 233, 109, 2, 151, 53, 17, 9, 
+    27, 233, 109, 2, 122, 53, 17, 9, 27, 233, 109, 2, 234, 136, 53, 17, 9, 
+    27, 233, 109, 2, 66, 53, 17, 9, 27, 233, 109, 2, 109, 231, 198, 53, 17, 
+    9, 27, 233, 109, 2, 77, 53, 17, 9, 27, 66, 2, 151, 53, 17, 9, 27, 66, 2, 
+    122, 53, 17, 9, 27, 66, 2, 234, 136, 53, 17, 9, 27, 66, 2, 66, 53, 17, 9, 
+    27, 66, 2, 109, 231, 198, 53, 17, 9, 27, 66, 2, 77, 53, 17, 9, 27, 228, 
+    68, 2, 151, 53, 17, 9, 27, 228, 68, 2, 122, 53, 17, 9, 27, 228, 68, 2, 
+    234, 136, 53, 17, 9, 27, 228, 68, 2, 66, 53, 17, 9, 27, 228, 68, 2, 109, 
+    231, 198, 53, 17, 9, 27, 228, 68, 2, 77, 53, 17, 9, 27, 241, 226, 2, 151, 
+    53, 17, 9, 27, 241, 226, 2, 66, 53, 17, 9, 27, 241, 226, 2, 109, 231, 
+    198, 53, 17, 9, 27, 241, 226, 2, 77, 53, 17, 9, 27, 77, 2, 151, 53, 17, 
+    9, 27, 77, 2, 122, 53, 17, 9, 27, 77, 2, 234, 136, 53, 17, 9, 27, 77, 2, 
+    66, 53, 17, 9, 27, 77, 2, 109, 231, 198, 53, 17, 9, 27, 77, 2, 77, 53, 
+    17, 9, 27, 216, 204, 2, 218, 24, 109, 53, 17, 9, 27, 223, 99, 2, 218, 24, 
+    109, 53, 17, 9, 27, 109, 231, 198, 2, 218, 24, 109, 53, 17, 9, 27, 220, 
+    96, 2, 248, 191, 53, 17, 9, 27, 220, 96, 2, 234, 210, 53, 17, 9, 27, 220, 
+    96, 2, 244, 174, 53, 17, 9, 27, 220, 96, 2, 248, 193, 53, 17, 9, 27, 220, 
+    96, 2, 234, 212, 53, 17, 9, 27, 220, 96, 2, 218, 24, 109, 53, 17, 9, 27, 
+    77, 2, 182, 72, 2, 223, 99, 40, 17, 9, 27, 77, 2, 182, 72, 2, 210, 109, 
+    40, 17, 9, 27, 77, 2, 182, 72, 2, 66, 40, 17, 9, 27, 77, 2, 182, 72, 2, 
+    228, 68, 40, 17, 9, 27, 77, 2, 182, 72, 2, 109, 231, 198, 40, 17, 9, 27, 
+    77, 2, 182, 72, 2, 77, 40, 17, 9, 27, 252, 63, 2, 223, 99, 40, 17, 9, 27, 
+    252, 63, 2, 210, 109, 40, 17, 9, 27, 252, 63, 2, 66, 40, 17, 9, 27, 252, 
+    63, 2, 228, 68, 40, 17, 9, 27, 252, 63, 2, 109, 231, 198, 40, 17, 9, 27, 
+    252, 63, 2, 77, 40, 17, 9, 27, 217, 9, 2, 223, 99, 40, 17, 9, 27, 217, 9, 
+    2, 210, 109, 40, 17, 9, 27, 217, 9, 2, 66, 40, 17, 9, 27, 217, 9, 2, 228, 
+    68, 40, 17, 9, 27, 217, 9, 2, 109, 231, 198, 40, 17, 9, 27, 217, 9, 2, 
+    77, 40, 17, 9, 27, 216, 194, 2, 223, 99, 40, 17, 9, 27, 216, 194, 2, 210, 
+    109, 40, 17, 9, 27, 216, 194, 2, 66, 40, 17, 9, 27, 216, 194, 2, 228, 68, 
+    40, 17, 9, 27, 216, 194, 2, 109, 231, 198, 40, 17, 9, 27, 216, 194, 2, 
+    77, 40, 17, 9, 27, 244, 151, 2, 109, 231, 198, 40, 17, 9, 27, 244, 151, 
+    2, 77, 40, 17, 9, 27, 224, 85, 2, 109, 231, 198, 40, 17, 9, 27, 224, 85, 
+    2, 77, 40, 17, 9, 27, 235, 1, 2, 109, 40, 17, 9, 27, 235, 1, 2, 233, 109, 
+    40, 17, 9, 27, 235, 1, 2, 66, 40, 17, 9, 27, 235, 1, 2, 109, 231, 198, 
+    40, 17, 9, 27, 235, 1, 2, 77, 40, 17, 9, 27, 233, 109, 2, 66, 40, 17, 9, 
+    27, 233, 109, 2, 109, 231, 198, 40, 17, 9, 27, 233, 109, 2, 77, 40, 17, 
+    9, 27, 66, 2, 109, 40, 17, 9, 27, 66, 2, 66, 40, 17, 9, 27, 228, 68, 2, 
+    223, 99, 40, 17, 9, 27, 228, 68, 2, 210, 109, 40, 17, 9, 27, 228, 68, 2, 
+    66, 40, 17, 9, 27, 228, 68, 2, 228, 68, 40, 17, 9, 27, 228, 68, 2, 109, 
+    231, 198, 40, 17, 9, 27, 228, 68, 2, 77, 40, 17, 9, 27, 109, 231, 198, 2, 
+    218, 24, 109, 40, 17, 9, 27, 77, 2, 223, 99, 40, 17, 9, 27, 77, 2, 210, 
+    109, 40, 17, 9, 27, 77, 2, 66, 40, 17, 9, 27, 77, 2, 228, 68, 40, 17, 9, 
+    27, 77, 2, 109, 231, 198, 40, 17, 9, 27, 77, 2, 77, 40, 17, 9, 27, 77, 2, 
+    182, 72, 2, 151, 65, 17, 9, 27, 77, 2, 182, 72, 2, 122, 65, 17, 9, 27, 
+    77, 2, 182, 72, 2, 234, 136, 65, 17, 9, 27, 77, 2, 182, 72, 2, 66, 65, 
+    17, 9, 27, 77, 2, 182, 72, 2, 241, 226, 65, 17, 9, 27, 252, 63, 2, 151, 
+    65, 17, 9, 27, 252, 63, 2, 122, 65, 17, 9, 27, 252, 63, 2, 234, 136, 65, 
+    17, 9, 27, 252, 63, 2, 66, 65, 17, 9, 27, 252, 63, 2, 241, 226, 65, 17, 
+    9, 27, 217, 9, 2, 151, 65, 17, 9, 27, 217, 9, 2, 122, 65, 17, 9, 27, 217, 
+    9, 2, 234, 136, 65, 17, 9, 27, 217, 9, 2, 66, 65, 17, 9, 27, 217, 9, 2, 
+    241, 226, 65, 17, 9, 27, 216, 194, 2, 66, 65, 17, 9, 27, 151, 2, 122, 65, 
+    17, 9, 27, 151, 2, 66, 65, 17, 9, 27, 122, 2, 151, 65, 17, 9, 27, 122, 2, 
+    66, 65, 17, 9, 27, 234, 136, 2, 151, 65, 17, 9, 27, 234, 136, 2, 66, 65, 
+    17, 9, 27, 221, 169, 2, 151, 65, 17, 9, 27, 221, 169, 2, 122, 65, 17, 9, 
+    27, 221, 169, 2, 234, 136, 65, 17, 9, 27, 221, 169, 2, 66, 65, 17, 9, 27, 
+    222, 29, 2, 122, 65, 17, 9, 27, 222, 29, 2, 234, 136, 65, 17, 9, 27, 222, 
+    29, 2, 66, 65, 17, 9, 27, 248, 225, 2, 151, 65, 17, 9, 27, 248, 225, 2, 
+    122, 65, 17, 9, 27, 248, 225, 2, 234, 136, 65, 17, 9, 27, 248, 225, 2, 
+    66, 65, 17, 9, 27, 217, 82, 2, 122, 65, 17, 9, 27, 210, 112, 2, 66, 65, 
+    17, 9, 27, 254, 206, 2, 151, 65, 17, 9, 27, 254, 206, 2, 66, 65, 17, 9, 
+    27, 242, 252, 2, 151, 65, 17, 9, 27, 242, 252, 2, 66, 65, 17, 9, 27, 244, 
+    151, 2, 151, 65, 17, 9, 27, 244, 151, 2, 122, 65, 17, 9, 27, 244, 151, 2, 
+    234, 136, 65, 17, 9, 27, 244, 151, 2, 66, 65, 17, 9, 27, 224, 85, 2, 122, 
+    65, 17, 9, 27, 224, 85, 2, 66, 65, 17, 9, 27, 235, 1, 2, 151, 65, 17, 9, 
+    27, 235, 1, 2, 122, 65, 17, 9, 27, 235, 1, 2, 234, 136, 65, 17, 9, 27, 
+    235, 1, 2, 233, 109, 65, 17, 9, 27, 235, 1, 2, 66, 65, 17, 9, 27, 233, 
+    109, 2, 151, 65, 17, 9, 27, 233, 109, 2, 122, 65, 17, 9, 27, 233, 109, 2, 
+    234, 136, 65, 17, 9, 27, 233, 109, 2, 66, 65, 17, 9, 27, 233, 109, 2, 
+    241, 226, 65, 17, 9, 27, 66, 2, 151, 65, 17, 9, 27, 66, 2, 122, 65, 17, 
+    9, 27, 66, 2, 234, 136, 65, 17, 9, 27, 66, 2, 66, 65, 17, 9, 27, 228, 68, 
+    2, 151, 65, 17, 9, 27, 228, 68, 2, 122, 65, 17, 9, 27, 228, 68, 2, 234, 
+    136, 65, 17, 9, 27, 228, 68, 2, 66, 65, 17, 9, 27, 228, 68, 2, 241, 226, 
+    65, 17, 9, 27, 241, 226, 2, 151, 65, 17, 9, 27, 241, 226, 2, 66, 65, 17, 
+    9, 27, 241, 226, 2, 218, 24, 109, 65, 17, 9, 27, 77, 2, 151, 65, 17, 9, 
+    27, 77, 2, 122, 65, 17, 9, 27, 77, 2, 234, 136, 65, 17, 9, 27, 77, 2, 66, 
+    65, 17, 9, 27, 77, 2, 241, 226, 65, 17, 9, 27, 77, 2, 182, 72, 2, 66, 
+    147, 17, 9, 27, 77, 2, 182, 72, 2, 241, 226, 147, 17, 9, 27, 252, 63, 2, 
+    66, 147, 17, 9, 27, 252, 63, 2, 241, 226, 147, 17, 9, 27, 217, 9, 2, 66, 
+    147, 17, 9, 27, 217, 9, 2, 241, 226, 147, 17, 9, 27, 216, 194, 2, 66, 
+    147, 17, 9, 27, 216, 194, 2, 241, 226, 147, 17, 9, 27, 221, 169, 2, 66, 
+    147, 17, 9, 27, 221, 169, 2, 241, 226, 147, 17, 9, 27, 220, 62, 2, 66, 
+    147, 17, 9, 27, 220, 62, 2, 241, 226, 147, 17, 9, 27, 235, 1, 2, 233, 
+    109, 147, 17, 9, 27, 235, 1, 2, 66, 147, 17, 9, 27, 233, 109, 2, 66, 147, 
+    17, 9, 27, 228, 68, 2, 66, 147, 17, 9, 27, 228, 68, 2, 241, 226, 147, 17, 
+    9, 27, 77, 2, 66, 147, 17, 9, 27, 77, 2, 241, 226, 147, 17, 9, 27, 220, 
+    96, 2, 244, 174, 147, 17, 9, 27, 220, 96, 2, 248, 193, 147, 17, 9, 27, 
+    220, 96, 2, 234, 212, 147, 17, 9, 27, 217, 82, 2, 109, 231, 198, 53, 17, 
+    9, 27, 217, 82, 2, 77, 53, 17, 9, 27, 254, 206, 2, 109, 231, 198, 53, 17, 
+    9, 27, 254, 206, 2, 77, 53, 17, 9, 27, 242, 252, 2, 109, 231, 198, 53, 
+    17, 9, 27, 242, 252, 2, 77, 53, 17, 9, 27, 221, 169, 2, 109, 231, 198, 
+    53, 17, 9, 27, 221, 169, 2, 77, 53, 17, 9, 27, 220, 62, 2, 109, 231, 198, 
+    53, 17, 9, 27, 220, 62, 2, 77, 53, 17, 9, 27, 122, 2, 109, 231, 198, 53, 
+    17, 9, 27, 122, 2, 77, 53, 17, 9, 27, 151, 2, 109, 231, 198, 53, 17, 9, 
+    27, 151, 2, 77, 53, 17, 9, 27, 234, 136, 2, 109, 231, 198, 53, 17, 9, 27, 
+    234, 136, 2, 77, 53, 17, 9, 27, 222, 29, 2, 109, 231, 198, 53, 17, 9, 27, 
+    222, 29, 2, 77, 53, 17, 9, 27, 248, 225, 2, 109, 231, 198, 53, 17, 9, 27, 
+    248, 225, 2, 77, 53, 17, 9, 27, 220, 62, 2, 151, 53, 17, 9, 27, 220, 62, 
+    2, 122, 53, 17, 9, 27, 220, 62, 2, 234, 136, 53, 17, 9, 27, 220, 62, 2, 
+    66, 53, 17, 9, 27, 220, 62, 2, 223, 99, 53, 17, 9, 27, 221, 169, 2, 223, 
+    99, 53, 17, 9, 27, 222, 29, 2, 223, 99, 53, 17, 9, 27, 248, 225, 2, 223, 
+    99, 53, 17, 9, 27, 217, 82, 2, 109, 231, 198, 40, 17, 9, 27, 217, 82, 2, 
+    77, 40, 17, 9, 27, 254, 206, 2, 109, 231, 198, 40, 17, 9, 27, 254, 206, 
+    2, 77, 40, 17, 9, 27, 242, 252, 2, 109, 231, 198, 40, 17, 9, 27, 242, 
+    252, 2, 77, 40, 17, 9, 27, 221, 169, 2, 109, 231, 198, 40, 17, 9, 27, 
+    221, 169, 2, 77, 40, 17, 9, 27, 220, 62, 2, 109, 231, 198, 40, 17, 9, 27, 
+    220, 62, 2, 77, 40, 17, 9, 27, 122, 2, 109, 231, 198, 40, 17, 9, 27, 122, 
+    2, 77, 40, 17, 9, 27, 151, 2, 109, 231, 198, 40, 17, 9, 27, 151, 2, 77, 
+    40, 17, 9, 27, 234, 136, 2, 109, 231, 198, 40, 17, 9, 27, 234, 136, 2, 
+    77, 40, 17, 9, 27, 222, 29, 2, 109, 231, 198, 40, 17, 9, 27, 222, 29, 2, 
+    77, 40, 17, 9, 27, 248, 225, 2, 109, 231, 198, 40, 17, 9, 27, 248, 225, 
+    2, 77, 40, 17, 9, 27, 220, 62, 2, 151, 40, 17, 9, 27, 220, 62, 2, 122, 
+    40, 17, 9, 27, 220, 62, 2, 234, 136, 40, 17, 9, 27, 220, 62, 2, 66, 40, 
+    17, 9, 27, 220, 62, 2, 223, 99, 40, 17, 9, 27, 221, 169, 2, 223, 99, 40, 
+    17, 9, 27, 222, 29, 2, 223, 99, 40, 17, 9, 27, 248, 225, 2, 223, 99, 40, 
+    17, 9, 27, 220, 62, 2, 151, 65, 17, 9, 27, 220, 62, 2, 122, 65, 17, 9, 
+    27, 220, 62, 2, 234, 136, 65, 17, 9, 27, 220, 62, 2, 66, 65, 17, 9, 27, 
+    221, 169, 2, 241, 226, 65, 17, 9, 27, 220, 62, 2, 241, 226, 65, 17, 9, 
+    27, 217, 82, 2, 66, 65, 17, 9, 27, 221, 169, 2, 151, 147, 17, 9, 27, 221, 
+    169, 2, 122, 147, 17, 9, 27, 221, 169, 2, 234, 136, 147, 17, 9, 27, 220, 
+    62, 2, 151, 147, 17, 9, 27, 220, 62, 2, 122, 147, 17, 9, 27, 220, 62, 2, 
+    234, 136, 147, 17, 9, 27, 217, 82, 2, 66, 147, 17, 9, 27, 210, 112, 2, 
+    66, 147, 17, 9, 27, 109, 2, 244, 172, 40, 17, 9, 27, 109, 2, 244, 172, 
+    53, 17, 226, 150, 43, 226, 7, 226, 150, 44, 226, 7, 9, 27, 217, 9, 2, 
+    151, 2, 66, 65, 17, 9, 27, 217, 9, 2, 122, 2, 151, 40, 17, 9, 27, 217, 9, 
+    2, 122, 2, 151, 65, 17, 9, 27, 217, 9, 2, 122, 2, 66, 65, 17, 9, 27, 217, 
+    9, 2, 234, 136, 2, 66, 65, 17, 9, 27, 217, 9, 2, 66, 2, 151, 65, 17, 9, 
+    27, 217, 9, 2, 66, 2, 122, 65, 17, 9, 27, 217, 9, 2, 66, 2, 234, 136, 65, 
+    17, 9, 27, 151, 2, 66, 2, 122, 40, 17, 9, 27, 151, 2, 66, 2, 122, 65, 17, 
+    9, 27, 122, 2, 66, 2, 77, 40, 17, 9, 27, 122, 2, 66, 2, 109, 231, 198, 
+    40, 17, 9, 27, 221, 169, 2, 122, 2, 151, 65, 17, 9, 27, 221, 169, 2, 151, 
+    2, 122, 65, 17, 9, 27, 221, 169, 2, 151, 2, 109, 231, 198, 40, 17, 9, 27, 
+    221, 169, 2, 66, 2, 122, 40, 17, 9, 27, 221, 169, 2, 66, 2, 122, 65, 17, 
+    9, 27, 221, 169, 2, 66, 2, 151, 65, 17, 9, 27, 221, 169, 2, 66, 2, 66, 
+    40, 17, 9, 27, 221, 169, 2, 66, 2, 66, 65, 17, 9, 27, 222, 29, 2, 122, 2, 
+    122, 40, 17, 9, 27, 222, 29, 2, 122, 2, 122, 65, 17, 9, 27, 222, 29, 2, 
+    66, 2, 66, 40, 17, 9, 27, 220, 62, 2, 122, 2, 66, 40, 17, 9, 27, 220, 62, 
+    2, 122, 2, 66, 65, 17, 9, 27, 220, 62, 2, 151, 2, 77, 40, 17, 9, 27, 220, 
+    62, 2, 66, 2, 234, 136, 40, 17, 9, 27, 220, 62, 2, 66, 2, 234, 136, 65, 
+    17, 9, 27, 220, 62, 2, 66, 2, 66, 40, 17, 9, 27, 220, 62, 2, 66, 2, 66, 
+    65, 17, 9, 27, 248, 225, 2, 122, 2, 109, 231, 198, 40, 17, 9, 27, 248, 
+    225, 2, 234, 136, 2, 66, 40, 17, 9, 27, 248, 225, 2, 234, 136, 2, 66, 65, 
+    17, 9, 27, 217, 82, 2, 66, 2, 122, 40, 17, 9, 27, 217, 82, 2, 66, 2, 122, 
+    65, 17, 9, 27, 217, 82, 2, 66, 2, 66, 65, 17, 9, 27, 217, 82, 2, 66, 2, 
+    77, 40, 17, 9, 27, 254, 206, 2, 151, 2, 66, 40, 17, 9, 27, 254, 206, 2, 
+    66, 2, 66, 40, 17, 9, 27, 254, 206, 2, 66, 2, 66, 65, 17, 9, 27, 254, 
+    206, 2, 66, 2, 109, 231, 198, 40, 17, 9, 27, 242, 252, 2, 66, 2, 66, 40, 
+    17, 9, 27, 242, 252, 2, 66, 2, 77, 40, 17, 9, 27, 242, 252, 2, 66, 2, 
+    109, 231, 198, 40, 17, 9, 27, 244, 151, 2, 234, 136, 2, 66, 40, 17, 9, 
+    27, 244, 151, 2, 234, 136, 2, 66, 65, 17, 9, 27, 224, 85, 2, 66, 2, 122, 
+    40, 17, 9, 27, 224, 85, 2, 66, 2, 66, 40, 17, 9, 27, 233, 109, 2, 122, 2, 
+    66, 40, 17, 9, 27, 233, 109, 2, 122, 2, 77, 40, 17, 9, 27, 233, 109, 2, 
+    122, 2, 109, 231, 198, 40, 17, 9, 27, 233, 109, 2, 151, 2, 151, 65, 17, 
+    9, 27, 233, 109, 2, 151, 2, 151, 40, 17, 9, 27, 233, 109, 2, 234, 136, 2, 
+    66, 40, 17, 9, 27, 233, 109, 2, 234, 136, 2, 66, 65, 17, 9, 27, 233, 109, 
+    2, 66, 2, 122, 40, 17, 9, 27, 233, 109, 2, 66, 2, 122, 65, 17, 9, 27, 66, 
+    2, 122, 2, 151, 65, 17, 9, 27, 66, 2, 122, 2, 66, 65, 17, 9, 27, 66, 2, 
+    122, 2, 77, 40, 17, 9, 27, 66, 2, 151, 2, 122, 65, 17, 9, 27, 66, 2, 151, 
+    2, 66, 65, 17, 9, 27, 66, 2, 234, 136, 2, 151, 65, 17, 9, 27, 66, 2, 234, 
+    136, 2, 66, 65, 17, 9, 27, 66, 2, 151, 2, 234, 136, 65, 17, 9, 27, 241, 
+    226, 2, 66, 2, 151, 65, 17, 9, 27, 241, 226, 2, 66, 2, 66, 65, 17, 9, 27, 
+    228, 68, 2, 122, 2, 66, 65, 17, 9, 27, 228, 68, 2, 122, 2, 109, 231, 198, 
+    40, 17, 9, 27, 228, 68, 2, 151, 2, 66, 40, 17, 9, 27, 228, 68, 2, 151, 2, 
+    66, 65, 17, 9, 27, 228, 68, 2, 151, 2, 109, 231, 198, 40, 17, 9, 27, 228, 
+    68, 2, 66, 2, 77, 40, 17, 9, 27, 228, 68, 2, 66, 2, 109, 231, 198, 40, 
+    17, 9, 27, 77, 2, 66, 2, 66, 40, 17, 9, 27, 77, 2, 66, 2, 66, 65, 17, 9, 
+    27, 252, 63, 2, 234, 136, 2, 77, 40, 17, 9, 27, 217, 9, 2, 151, 2, 77, 
+    40, 17, 9, 27, 217, 9, 2, 151, 2, 109, 231, 198, 40, 17, 9, 27, 217, 9, 
+    2, 234, 136, 2, 77, 40, 17, 9, 27, 217, 9, 2, 234, 136, 2, 109, 231, 198, 
+    40, 17, 9, 27, 217, 9, 2, 66, 2, 77, 40, 17, 9, 27, 217, 9, 2, 66, 2, 
+    109, 231, 198, 40, 17, 9, 27, 151, 2, 66, 2, 77, 40, 17, 9, 27, 151, 2, 
+    122, 2, 109, 231, 198, 40, 17, 9, 27, 151, 2, 66, 2, 109, 231, 198, 40, 
+    17, 9, 27, 221, 169, 2, 234, 136, 2, 109, 231, 198, 40, 17, 9, 27, 222, 
+    29, 2, 122, 2, 77, 40, 17, 9, 27, 220, 62, 2, 122, 2, 77, 40, 17, 9, 27, 
+    248, 225, 2, 122, 2, 77, 40, 17, 9, 27, 233, 109, 2, 151, 2, 77, 40, 17, 
+    9, 27, 233, 109, 2, 66, 2, 77, 40, 17, 9, 27, 77, 2, 122, 2, 77, 40, 17, 
+    9, 27, 77, 2, 151, 2, 77, 40, 17, 9, 27, 77, 2, 66, 2, 77, 40, 17, 9, 27, 
+    66, 2, 66, 2, 77, 40, 17, 9, 27, 224, 85, 2, 66, 2, 77, 40, 17, 9, 27, 
+    228, 68, 2, 122, 2, 77, 40, 17, 9, 27, 224, 85, 2, 66, 2, 122, 65, 17, 9, 
+    27, 233, 109, 2, 122, 2, 66, 65, 17, 9, 27, 254, 206, 2, 66, 2, 77, 40, 
+    17, 9, 27, 235, 1, 2, 66, 2, 77, 40, 17, 9, 27, 228, 68, 2, 151, 2, 122, 
+    65, 17, 9, 27, 66, 2, 234, 136, 2, 77, 40, 17, 9, 27, 233, 109, 2, 151, 
+    2, 66, 65, 17, 9, 27, 235, 1, 2, 66, 2, 66, 40, 17, 9, 27, 233, 109, 2, 
+    151, 2, 66, 40, 17, 9, 27, 228, 68, 2, 151, 2, 122, 40, 17, 9, 27, 151, 
+    2, 122, 2, 77, 40, 17, 9, 27, 122, 2, 151, 2, 77, 40, 17, 9, 27, 66, 2, 
+    151, 2, 77, 40, 17, 9, 27, 244, 151, 2, 66, 2, 77, 40, 17, 9, 27, 252, 
+    63, 2, 122, 2, 77, 40, 17, 9, 27, 235, 1, 2, 66, 2, 66, 65, 17, 9, 27, 
+    254, 206, 2, 151, 2, 66, 65, 17, 9, 27, 222, 29, 2, 66, 2, 66, 65, 17, 9, 
+    27, 221, 169, 2, 234, 136, 2, 77, 40, 17, 9, 27, 228, 68, 2, 151, 2, 77, 
+    40, 17, 9, 27, 222, 6, 214, 128, 253, 246, 234, 10, 218, 132, 5, 53, 17, 
+    9, 27, 224, 81, 214, 128, 253, 246, 234, 10, 218, 132, 5, 53, 17, 9, 27, 
+    254, 162, 53, 17, 9, 27, 254, 192, 53, 17, 9, 27, 230, 158, 53, 17, 9, 
+    27, 222, 7, 53, 17, 9, 27, 223, 146, 53, 17, 9, 27, 254, 181, 53, 17, 9, 
+    27, 212, 49, 53, 17, 9, 27, 222, 6, 53, 17, 9, 27, 222, 5, 254, 181, 212, 
+    48, 9, 27, 235, 140, 223, 37, 50, 9, 27, 251, 238, 254, 47, 254, 48, 45, 
+    221, 158, 45, 221, 47, 45, 220, 235, 45, 220, 224, 45, 220, 213, 45, 220, 
+    202, 45, 220, 191, 45, 220, 180, 45, 220, 169, 45, 221, 157, 45, 221, 
+    146, 45, 221, 135, 45, 221, 124, 45, 221, 113, 45, 221, 102, 45, 221, 91, 
+    224, 197, 244, 28, 31, 67, 249, 227, 224, 197, 244, 28, 31, 67, 110, 249, 
+    227, 224, 197, 244, 28, 31, 67, 110, 243, 236, 218, 131, 224, 197, 244, 
+    28, 31, 67, 249, 234, 224, 197, 244, 28, 31, 67, 220, 152, 224, 197, 244, 
+    28, 31, 67, 245, 39, 79, 224, 197, 244, 28, 31, 67, 224, 16, 79, 224, 
+    197, 244, 28, 31, 67, 43, 71, 233, 26, 127, 224, 197, 244, 28, 31, 67, 
+    44, 71, 233, 26, 251, 164, 224, 197, 244, 28, 31, 67, 203, 245, 171, 38, 
+    27, 43, 242, 34, 38, 27, 44, 242, 34, 38, 52, 216, 90, 43, 242, 34, 38, 
+    52, 216, 90, 44, 242, 34, 38, 231, 238, 43, 242, 34, 38, 231, 238, 44, 
+    242, 34, 38, 249, 205, 231, 237, 224, 197, 244, 28, 31, 67, 113, 59, 233, 
+    62, 224, 197, 244, 28, 31, 67, 245, 168, 248, 164, 224, 197, 244, 28, 31, 
+    67, 245, 159, 248, 164, 224, 197, 244, 28, 31, 67, 121, 232, 219, 224, 
+    197, 244, 28, 31, 67, 212, 32, 121, 232, 219, 224, 197, 244, 28, 31, 67, 
+    43, 226, 7, 224, 197, 244, 28, 31, 67, 44, 226, 7, 224, 197, 244, 28, 31, 
+    67, 43, 249, 107, 127, 224, 197, 244, 28, 31, 67, 44, 249, 107, 127, 224, 
+    197, 244, 28, 31, 67, 43, 216, 7, 220, 55, 127, 224, 197, 244, 28, 31, 
+    67, 44, 216, 7, 220, 55, 127, 224, 197, 244, 28, 31, 67, 43, 85, 233, 26, 
+    127, 224, 197, 244, 28, 31, 67, 44, 85, 233, 26, 127, 224, 197, 244, 28, 
+    31, 67, 43, 52, 254, 118, 127, 224, 197, 244, 28, 31, 67, 44, 52, 254, 
+    118, 127, 224, 197, 244, 28, 31, 67, 43, 254, 118, 127, 224, 197, 244, 
+    28, 31, 67, 44, 254, 118, 127, 224, 197, 244, 28, 31, 67, 43, 249, 169, 
+    127, 224, 197, 244, 28, 31, 67, 44, 249, 169, 127, 224, 197, 244, 28, 31, 
+    67, 43, 71, 249, 169, 127, 224, 197, 244, 28, 31, 67, 44, 71, 249, 169, 
+    127, 220, 133, 247, 128, 71, 220, 133, 247, 128, 224, 197, 244, 28, 31, 
+    67, 43, 42, 127, 224, 197, 244, 28, 31, 67, 44, 42, 127, 248, 163, 226, 
+    123, 250, 180, 226, 123, 212, 32, 226, 123, 52, 212, 32, 226, 123, 248, 
+    163, 121, 232, 219, 250, 180, 121, 232, 219, 212, 32, 121, 232, 219, 4, 
+    249, 227, 4, 110, 249, 227, 4, 243, 236, 218, 131, 4, 220, 152, 4, 249, 
+    234, 4, 224, 16, 79, 4, 245, 39, 79, 4, 245, 168, 248, 164, 4, 43, 226, 
+    7, 4, 44, 226, 7, 4, 43, 249, 107, 127, 4, 44, 249, 107, 127, 4, 43, 216, 
+    7, 220, 55, 127, 4, 44, 216, 7, 220, 55, 127, 4, 54, 50, 4, 254, 134, 4, 
+    253, 224, 4, 96, 50, 4, 240, 174, 4, 233, 21, 50, 4, 242, 137, 50, 4, 
+    245, 106, 50, 4, 223, 53, 219, 48, 4, 247, 140, 50, 4, 225, 185, 50, 4, 
+    249, 225, 253, 214, 9, 244, 172, 53, 17, 9, 217, 45, 2, 244, 172, 48, 9, 
+    248, 191, 53, 17, 9, 217, 79, 244, 9, 9, 234, 210, 53, 17, 9, 244, 174, 
+    53, 17, 9, 244, 174, 147, 17, 9, 248, 193, 53, 17, 9, 248, 193, 147, 17, 
+    9, 234, 212, 53, 17, 9, 234, 212, 147, 17, 9, 220, 96, 53, 17, 9, 220, 
+    96, 147, 17, 9, 218, 47, 53, 17, 9, 218, 47, 147, 17, 9, 1, 182, 53, 17, 
+    9, 1, 109, 2, 231, 233, 72, 53, 17, 9, 1, 109, 2, 231, 233, 72, 40, 17, 
+    9, 1, 109, 2, 182, 72, 53, 17, 9, 1, 109, 2, 182, 72, 40, 17, 9, 1, 212, 
+    31, 2, 182, 72, 53, 17, 9, 1, 212, 31, 2, 182, 72, 40, 17, 9, 1, 109, 2, 
+    182, 252, 51, 53, 17, 9, 1, 109, 2, 182, 252, 51, 40, 17, 9, 1, 77, 2, 
+    182, 72, 53, 17, 9, 1, 77, 2, 182, 72, 40, 17, 9, 1, 77, 2, 182, 72, 65, 
+    17, 9, 1, 77, 2, 182, 72, 147, 17, 9, 1, 109, 53, 17, 9, 1, 109, 40, 17, 
+    9, 1, 252, 63, 53, 17, 9, 1, 252, 63, 40, 17, 9, 1, 252, 63, 65, 17, 9, 
+    1, 252, 63, 147, 17, 9, 1, 217, 9, 231, 170, 53, 17, 9, 1, 217, 9, 231, 
+    170, 40, 17, 9, 1, 217, 9, 53, 17, 9, 1, 217, 9, 40, 17, 9, 1, 217, 9, 
+    65, 17, 9, 1, 217, 9, 147, 17, 9, 1, 216, 194, 53, 17, 9, 1, 216, 194, 
+    40, 17, 9, 1, 216, 194, 65, 17, 9, 1, 216, 194, 147, 17, 9, 1, 151, 53, 
+    17, 9, 1, 151, 40, 17, 9, 1, 151, 65, 17, 9, 1, 151, 147, 17, 9, 1, 122, 
+    53, 17, 9, 1, 122, 40, 17, 9, 1, 122, 65, 17, 9, 1, 122, 147, 17, 9, 1, 
+    234, 136, 53, 17, 9, 1, 234, 136, 40, 17, 9, 1, 234, 136, 65, 17, 9, 1, 
+    234, 136, 147, 17, 9, 1, 248, 204, 53, 17, 9, 1, 248, 204, 40, 17, 9, 1, 
+    216, 204, 53, 17, 9, 1, 216, 204, 40, 17, 9, 1, 223, 99, 53, 17, 9, 1, 
+    223, 99, 40, 17, 9, 1, 210, 109, 53, 17, 9, 1, 210, 109, 40, 17, 9, 1, 
+    221, 169, 53, 17, 9, 1, 221, 169, 40, 17, 9, 1, 221, 169, 65, 17, 9, 1, 
+    221, 169, 147, 17, 9, 1, 220, 62, 53, 17, 9, 1, 220, 62, 40, 17, 9, 1, 
+    220, 62, 65, 17, 9, 1, 220, 62, 147, 17, 9, 1, 222, 29, 53, 17, 9, 1, 
+    222, 29, 40, 17, 9, 1, 222, 29, 65, 17, 9, 1, 222, 29, 147, 17, 9, 1, 
+    248, 225, 53, 17, 9, 1, 248, 225, 40, 17, 9, 1, 248, 225, 65, 17, 9, 1, 
+    248, 225, 147, 17, 9, 1, 217, 82, 53, 17, 9, 1, 217, 82, 40, 17, 9, 1, 
+    217, 82, 65, 17, 9, 1, 217, 82, 147, 17, 9, 1, 210, 112, 53, 17, 9, 1, 
+    210, 112, 40, 17, 9, 1, 210, 112, 65, 17, 9, 1, 210, 112, 147, 17, 9, 1, 
+    254, 206, 53, 17, 9, 1, 254, 206, 40, 17, 9, 1, 254, 206, 65, 17, 9, 1, 
+    254, 206, 147, 17, 9, 1, 242, 252, 53, 17, 9, 1, 242, 252, 40, 17, 9, 1, 
+    242, 252, 65, 17, 9, 1, 242, 252, 147, 17, 9, 1, 244, 151, 53, 17, 9, 1, 
+    244, 151, 40, 17, 9, 1, 244, 151, 65, 17, 9, 1, 244, 151, 147, 17, 9, 1, 
+    224, 85, 53, 17, 9, 1, 224, 85, 40, 17, 9, 1, 224, 85, 65, 17, 9, 1, 224, 
+    85, 147, 17, 9, 1, 235, 1, 53, 17, 9, 1, 235, 1, 40, 17, 9, 1, 235, 1, 
+    65, 17, 9, 1, 235, 1, 147, 17, 9, 1, 233, 109, 53, 17, 9, 1, 233, 109, 
+    40, 17, 9, 1, 233, 109, 65, 17, 9, 1, 233, 109, 147, 17, 9, 1, 66, 53, 
+    17, 9, 1, 66, 40, 17, 9, 1, 66, 65, 17, 9, 1, 66, 147, 17, 9, 1, 228, 68, 
+    53, 17, 9, 1, 228, 68, 40, 17, 9, 1, 228, 68, 65, 17, 9, 1, 228, 68, 147, 
+    17, 9, 1, 241, 226, 53, 17, 9, 1, 241, 226, 40, 17, 9, 1, 241, 226, 65, 
+    17, 9, 1, 241, 226, 147, 17, 9, 1, 212, 31, 53, 17, 9, 1, 212, 31, 40, 
+    17, 9, 1, 109, 231, 198, 53, 17, 9, 1, 109, 231, 198, 40, 17, 9, 1, 77, 
+    53, 17, 9, 1, 77, 40, 17, 9, 1, 77, 65, 17, 9, 1, 77, 147, 17, 9, 27, 
+    233, 109, 2, 109, 2, 231, 233, 72, 53, 17, 9, 27, 233, 109, 2, 109, 2, 
+    231, 233, 72, 40, 17, 9, 27, 233, 109, 2, 109, 2, 182, 72, 53, 17, 9, 27, 
+    233, 109, 2, 109, 2, 182, 72, 40, 17, 9, 27, 233, 109, 2, 109, 2, 182, 
+    252, 51, 53, 17, 9, 27, 233, 109, 2, 109, 2, 182, 252, 51, 40, 17, 9, 27, 
+    233, 109, 2, 109, 53, 17, 9, 27, 233, 109, 2, 109, 40, 17, 210, 87, 211, 
+    245, 228, 78, 219, 20, 126, 245, 39, 79, 126, 224, 1, 79, 126, 54, 50, 
+    126, 247, 140, 50, 126, 225, 185, 50, 126, 254, 134, 126, 254, 65, 126, 
+    43, 226, 7, 126, 44, 226, 7, 126, 253, 224, 126, 96, 50, 126, 249, 227, 
+    126, 240, 174, 126, 243, 236, 218, 131, 126, 219, 48, 126, 21, 210, 86, 
+    126, 21, 111, 126, 21, 105, 126, 21, 158, 126, 21, 161, 126, 21, 190, 
+    126, 21, 195, 126, 21, 199, 126, 21, 196, 126, 21, 201, 126, 249, 234, 
+    126, 220, 152, 126, 233, 21, 50, 126, 245, 106, 50, 126, 242, 137, 50, 
+    126, 224, 16, 79, 126, 249, 225, 253, 214, 126, 7, 6, 1, 61, 126, 7, 6, 
+    1, 253, 166, 126, 7, 6, 1, 251, 74, 126, 7, 6, 1, 249, 68, 126, 7, 6, 1, 
+    76, 126, 7, 6, 1, 245, 14, 126, 7, 6, 1, 243, 209, 126, 7, 6, 1, 242, 67, 
+    126, 7, 6, 1, 74, 126, 7, 6, 1, 235, 150, 126, 7, 6, 1, 235, 29, 126, 7, 
+    6, 1, 156, 126, 7, 6, 1, 194, 126, 7, 6, 1, 230, 30, 126, 7, 6, 1, 78, 
+    126, 7, 6, 1, 226, 109, 126, 7, 6, 1, 224, 99, 126, 7, 6, 1, 153, 126, 7, 
+    6, 1, 222, 93, 126, 7, 6, 1, 217, 153, 126, 7, 6, 1, 69, 126, 7, 6, 1, 
+    214, 105, 126, 7, 6, 1, 212, 98, 126, 7, 6, 1, 211, 178, 126, 7, 6, 1, 
+    211, 117, 126, 7, 6, 1, 210, 159, 126, 43, 42, 127, 126, 223, 53, 219, 
+    48, 126, 44, 42, 127, 126, 250, 39, 255, 23, 126, 121, 232, 219, 126, 
+    242, 144, 255, 23, 126, 7, 4, 1, 61, 126, 7, 4, 1, 253, 166, 126, 7, 4, 
+    1, 251, 74, 126, 7, 4, 1, 249, 68, 126, 7, 4, 1, 76, 126, 7, 4, 1, 245, 
+    14, 126, 7, 4, 1, 243, 209, 126, 7, 4, 1, 242, 67, 126, 7, 4, 1, 74, 126, 
+    7, 4, 1, 235, 150, 126, 7, 4, 1, 235, 29, 126, 7, 4, 1, 156, 126, 7, 4, 
+    1, 194, 126, 7, 4, 1, 230, 30, 126, 7, 4, 1, 78, 126, 7, 4, 1, 226, 109, 
+    126, 7, 4, 1, 224, 99, 126, 7, 4, 1, 153, 126, 7, 4, 1, 222, 93, 126, 7, 
+    4, 1, 217, 153, 126, 7, 4, 1, 69, 126, 7, 4, 1, 214, 105, 126, 7, 4, 1, 
+    212, 98, 126, 7, 4, 1, 211, 178, 126, 7, 4, 1, 211, 117, 126, 7, 4, 1, 
+    210, 159, 126, 43, 249, 107, 127, 126, 67, 232, 219, 126, 44, 249, 107, 
+    127, 126, 184, 126, 43, 71, 226, 7, 126, 44, 71, 226, 7, 101, 110, 243, 
+    236, 218, 131, 101, 43, 249, 169, 127, 101, 44, 249, 169, 127, 101, 110, 
+    249, 227, 101, 56, 230, 229, 247, 128, 101, 56, 1, 211, 227, 101, 56, 1, 
+    4, 61, 101, 56, 1, 4, 74, 101, 56, 1, 4, 69, 101, 56, 1, 4, 76, 101, 56, 
+    1, 4, 78, 101, 56, 1, 4, 192, 101, 56, 1, 4, 210, 212, 101, 56, 1, 4, 
+    210, 244, 101, 56, 1, 4, 215, 119, 101, 234, 207, 224, 176, 219, 33, 79, 
+    101, 56, 1, 61, 101, 56, 1, 74, 101, 56, 1, 69, 101, 56, 1, 76, 101, 56, 
+    1, 78, 101, 56, 1, 176, 101, 56, 1, 234, 98, 101, 56, 1, 233, 223, 101, 
+    56, 1, 234, 188, 101, 56, 1, 234, 34, 101, 56, 1, 206, 101, 56, 1, 219, 
+    193, 101, 56, 1, 218, 84, 101, 56, 1, 221, 183, 101, 56, 1, 219, 60, 101, 
+    56, 1, 217, 106, 101, 56, 1, 216, 118, 101, 56, 1, 215, 119, 101, 56, 1, 
+    217, 23, 101, 56, 1, 112, 101, 56, 1, 198, 101, 56, 1, 228, 238, 101, 56, 
+    1, 227, 242, 101, 56, 1, 229, 112, 101, 56, 1, 228, 79, 101, 56, 1, 162, 
+    101, 56, 1, 241, 187, 101, 56, 1, 240, 229, 101, 56, 1, 241, 245, 101, 
+    56, 1, 241, 75, 101, 56, 1, 186, 101, 56, 1, 230, 235, 101, 56, 1, 230, 
+    107, 101, 56, 1, 231, 96, 101, 56, 1, 230, 166, 101, 56, 1, 192, 101, 56, 
+    1, 210, 212, 101, 56, 1, 210, 244, 101, 56, 1, 205, 101, 56, 1, 223, 38, 
+    101, 56, 1, 222, 142, 101, 56, 1, 223, 131, 101, 56, 1, 222, 213, 101, 
+    56, 1, 212, 65, 101, 56, 1, 230, 30, 101, 56, 213, 135, 219, 33, 79, 101, 
+    56, 220, 157, 219, 33, 79, 101, 24, 244, 111, 101, 24, 1, 234, 64, 101, 
+    24, 1, 218, 217, 101, 24, 1, 234, 57, 101, 24, 1, 228, 231, 101, 24, 1, 
+    228, 229, 101, 24, 1, 228, 228, 101, 24, 1, 216, 102, 101, 24, 1, 218, 
+    206, 101, 24, 1, 223, 29, 101, 24, 1, 223, 24, 101, 24, 1, 223, 21, 101, 
+    24, 1, 223, 14, 101, 24, 1, 223, 9, 101, 24, 1, 223, 4, 101, 24, 1, 223, 
+    15, 101, 24, 1, 223, 27, 101, 24, 1, 230, 222, 101, 24, 1, 225, 98, 101, 
+    24, 1, 218, 214, 101, 24, 1, 225, 87, 101, 24, 1, 219, 150, 101, 24, 1, 
+    218, 211, 101, 24, 1, 236, 63, 101, 24, 1, 250, 54, 101, 24, 1, 218, 221, 
+    101, 24, 1, 250, 114, 101, 24, 1, 234, 116, 101, 24, 1, 216, 174, 101, 
+    24, 1, 225, 134, 101, 24, 1, 241, 179, 101, 24, 1, 61, 101, 24, 1, 254, 
+    252, 101, 24, 1, 192, 101, 24, 1, 211, 92, 101, 24, 1, 245, 125, 101, 24, 
+    1, 76, 101, 24, 1, 211, 36, 101, 24, 1, 211, 47, 101, 24, 1, 78, 101, 24, 
+    1, 212, 65, 101, 24, 1, 212, 62, 101, 24, 1, 226, 238, 101, 24, 1, 210, 
+    244, 101, 24, 1, 69, 101, 24, 1, 212, 11, 101, 24, 1, 212, 22, 101, 24, 
+    1, 211, 250, 101, 24, 1, 210, 212, 101, 24, 1, 245, 63, 101, 24, 1, 211, 
+    8, 101, 24, 1, 74, 126, 250, 184, 50, 126, 224, 231, 50, 126, 228, 57, 
+    50, 126, 231, 237, 126, 251, 143, 130, 126, 211, 40, 50, 126, 211, 217, 
+    50, 101, 244, 26, 193, 213, 239, 101, 140, 75, 101, 214, 153, 75, 101, 
+    97, 75, 101, 246, 112, 75, 101, 85, 218, 236, 101, 71, 250, 43, 235, 211, 
+    254, 107, 254, 128, 235, 211, 254, 107, 220, 139, 235, 211, 254, 107, 
+    216, 237, 226, 253, 223, 75, 250, 150, 223, 75, 250, 150, 62, 57, 3, 253, 
+    150, 61, 62, 57, 3, 253, 119, 76, 62, 57, 3, 253, 128, 74, 62, 57, 3, 
+    253, 96, 78, 62, 57, 3, 253, 146, 69, 62, 57, 3, 253, 165, 248, 229, 62, 
+    57, 3, 253, 112, 248, 98, 62, 57, 3, 253, 152, 248, 11, 62, 57, 3, 253, 
+    142, 247, 153, 62, 57, 3, 253, 106, 246, 86, 62, 57, 3, 253, 100, 235, 
+    147, 62, 57, 3, 253, 111, 235, 132, 62, 57, 3, 253, 121, 235, 74, 62, 57, 
+    3, 253, 92, 235, 57, 62, 57, 3, 253, 80, 176, 62, 57, 3, 253, 113, 234, 
+    188, 62, 57, 3, 253, 90, 234, 98, 62, 57, 3, 253, 87, 234, 34, 62, 57, 3, 
+    253, 76, 233, 223, 62, 57, 3, 253, 77, 186, 62, 57, 3, 253, 143, 231, 96, 
+    62, 57, 3, 253, 84, 230, 235, 62, 57, 3, 253, 141, 230, 166, 62, 57, 3, 
+    253, 133, 230, 107, 62, 57, 3, 253, 154, 198, 62, 57, 3, 253, 132, 229, 
+    112, 62, 57, 3, 253, 126, 228, 238, 62, 57, 3, 253, 105, 228, 79, 62, 57, 
+    3, 253, 102, 227, 242, 62, 57, 3, 253, 161, 191, 62, 57, 3, 253, 85, 225, 
+    224, 62, 57, 3, 253, 118, 225, 111, 62, 57, 3, 253, 145, 225, 19, 62, 57, 
+    3, 253, 107, 224, 153, 62, 57, 3, 253, 140, 224, 91, 62, 57, 3, 253, 79, 
+    224, 72, 62, 57, 3, 253, 135, 224, 56, 62, 57, 3, 253, 124, 224, 45, 62, 
+    57, 3, 253, 97, 205, 62, 57, 3, 253, 129, 223, 131, 62, 57, 3, 253, 104, 
+    223, 38, 62, 57, 3, 253, 163, 222, 213, 62, 57, 3, 253, 130, 222, 142, 
+    62, 57, 3, 253, 125, 206, 62, 57, 3, 253, 148, 221, 183, 62, 57, 3, 253, 
+    116, 219, 193, 62, 57, 3, 253, 144, 219, 60, 62, 57, 3, 253, 99, 218, 84, 
+    62, 57, 3, 253, 98, 217, 106, 62, 57, 3, 253, 159, 217, 23, 62, 57, 3, 
+    253, 120, 216, 118, 62, 57, 3, 253, 157, 112, 62, 57, 3, 253, 88, 215, 
+    119, 62, 57, 3, 253, 103, 212, 65, 62, 57, 3, 253, 82, 212, 22, 62, 57, 
+    3, 253, 117, 211, 250, 62, 57, 3, 253, 115, 211, 227, 62, 57, 3, 253, 
+    139, 210, 116, 62, 57, 3, 253, 83, 210, 94, 62, 57, 3, 253, 136, 210, 23, 
+    62, 57, 3, 253, 131, 255, 84, 62, 57, 3, 253, 114, 255, 83, 62, 57, 3, 
+    253, 73, 253, 200, 62, 57, 3, 253, 86, 246, 54, 62, 57, 3, 253, 69, 246, 
+    53, 62, 57, 3, 253, 109, 227, 178, 62, 57, 3, 253, 127, 224, 151, 62, 57, 
+    3, 253, 95, 224, 155, 62, 57, 3, 253, 81, 223, 189, 62, 57, 3, 253, 123, 
+    223, 188, 62, 57, 3, 253, 89, 222, 212, 62, 57, 3, 253, 91, 217, 103, 62, 
+    57, 3, 253, 71, 215, 78, 62, 57, 3, 253, 68, 105, 62, 57, 16, 253, 138, 
+    62, 57, 16, 253, 137, 62, 57, 16, 253, 134, 62, 57, 16, 253, 122, 62, 57, 
+    16, 253, 110, 62, 57, 16, 253, 108, 62, 57, 16, 253, 101, 62, 57, 16, 
+    253, 94, 62, 57, 16, 253, 93, 62, 57, 16, 253, 78, 62, 57, 16, 253, 75, 
+    62, 57, 16, 253, 74, 62, 57, 16, 253, 72, 62, 57, 16, 253, 70, 62, 57, 
+    106, 253, 67, 231, 190, 62, 57, 106, 253, 66, 211, 221, 62, 57, 106, 253, 
+    65, 248, 82, 62, 57, 106, 253, 64, 245, 103, 62, 57, 106, 253, 63, 231, 
+    164, 62, 57, 106, 253, 62, 218, 164, 62, 57, 106, 253, 61, 245, 45, 62, 
+    57, 106, 253, 60, 223, 156, 62, 57, 106, 253, 59, 220, 64, 62, 57, 106, 
+    253, 58, 241, 244, 62, 57, 106, 253, 57, 219, 27, 62, 57, 106, 253, 56, 
+    251, 211, 62, 57, 106, 253, 55, 249, 153, 62, 57, 106, 253, 54, 251, 123, 
+    62, 57, 106, 253, 53, 212, 2, 62, 57, 106, 253, 52, 252, 144, 62, 57, 
+    106, 253, 51, 226, 209, 62, 57, 106, 253, 50, 219, 0, 62, 57, 106, 253, 
+    49, 249, 76, 62, 57, 230, 147, 253, 48, 234, 230, 62, 57, 230, 147, 253, 
+    47, 234, 238, 62, 57, 106, 253, 46, 226, 222, 62, 57, 106, 253, 45, 211, 
+    236, 62, 57, 106, 253, 44, 62, 57, 230, 147, 253, 43, 254, 25, 62, 57, 
+    230, 147, 253, 42, 231, 57, 62, 57, 106, 253, 41, 251, 142, 62, 57, 106, 
+    253, 40, 242, 173, 62, 57, 106, 253, 39, 62, 57, 106, 253, 38, 211, 212, 
+    62, 57, 106, 253, 37, 62, 57, 106, 253, 36, 62, 57, 106, 253, 35, 240, 
+    255, 62, 57, 106, 253, 34, 62, 57, 106, 253, 33, 62, 57, 106, 253, 32, 
+    62, 57, 230, 147, 253, 30, 215, 92, 62, 57, 106, 253, 29, 62, 57, 106, 
+    253, 28, 62, 57, 106, 253, 27, 250, 2, 62, 57, 106, 253, 26, 62, 57, 106, 
+    253, 25, 62, 57, 106, 253, 24, 243, 100, 62, 57, 106, 253, 23, 254, 12, 
+    62, 57, 106, 253, 22, 62, 57, 106, 253, 21, 62, 57, 106, 253, 20, 62, 57, 
+    106, 253, 19, 62, 57, 106, 253, 18, 62, 57, 106, 253, 17, 62, 57, 106, 
+    253, 16, 62, 57, 106, 253, 15, 62, 57, 106, 253, 14, 62, 57, 106, 253, 
+    13, 230, 139, 62, 57, 106, 253, 12, 62, 57, 106, 253, 11, 215, 236, 62, 
+    57, 106, 253, 10, 62, 57, 106, 253, 9, 62, 57, 106, 253, 8, 62, 57, 106, 
+    253, 7, 62, 57, 106, 253, 6, 62, 57, 106, 253, 5, 62, 57, 106, 253, 4, 
+    62, 57, 106, 253, 3, 62, 57, 106, 253, 2, 62, 57, 106, 253, 1, 62, 57, 
+    106, 253, 0, 62, 57, 106, 252, 255, 241, 218, 62, 57, 106, 252, 234, 244, 
+    36, 62, 57, 106, 252, 231, 252, 124, 62, 57, 106, 252, 226, 219, 7, 62, 
+    57, 106, 252, 225, 75, 62, 57, 106, 252, 224, 62, 57, 106, 252, 223, 217, 
+    237, 62, 57, 106, 252, 222, 62, 57, 106, 252, 221, 62, 57, 106, 252, 220, 
+    211, 254, 250, 147, 62, 57, 106, 252, 219, 250, 147, 62, 57, 106, 252, 
+    218, 250, 148, 244, 7, 62, 57, 106, 252, 217, 212, 0, 62, 57, 106, 252, 
+    216, 62, 57, 106, 252, 215, 62, 57, 230, 147, 252, 214, 247, 206, 62, 57, 
+    106, 252, 213, 62, 57, 106, 252, 212, 62, 57, 106, 252, 210, 62, 57, 106, 
+    252, 209, 62, 57, 106, 252, 208, 62, 57, 106, 252, 207, 248, 167, 62, 57, 
+    106, 252, 206, 62, 57, 106, 252, 205, 62, 57, 106, 252, 204, 62, 57, 106, 
+    252, 203, 62, 57, 106, 252, 202, 62, 57, 106, 213, 186, 253, 31, 62, 57, 
+    106, 213, 186, 252, 254, 62, 57, 106, 213, 186, 252, 253, 62, 57, 106, 
+    213, 186, 252, 252, 62, 57, 106, 213, 186, 252, 251, 62, 57, 106, 213, 
+    186, 252, 250, 62, 57, 106, 213, 186, 252, 249, 62, 57, 106, 213, 186, 
+    252, 248, 62, 57, 106, 213, 186, 252, 247, 62, 57, 106, 213, 186, 252, 
+    246, 62, 57, 106, 213, 186, 252, 245, 62, 57, 106, 213, 186, 252, 244, 
+    62, 57, 106, 213, 186, 252, 243, 62, 57, 106, 213, 186, 252, 242, 62, 57, 
+    106, 213, 186, 252, 241, 62, 57, 106, 213, 186, 252, 240, 62, 57, 106, 
+    213, 186, 252, 239, 62, 57, 106, 213, 186, 252, 238, 62, 57, 106, 213, 
+    186, 252, 237, 62, 57, 106, 213, 186, 252, 236, 62, 57, 106, 213, 186, 
+    252, 235, 62, 57, 106, 213, 186, 252, 233, 62, 57, 106, 213, 186, 252, 
+    232, 62, 57, 106, 213, 186, 252, 230, 62, 57, 106, 213, 186, 252, 229, 
+    62, 57, 106, 213, 186, 252, 228, 62, 57, 106, 213, 186, 252, 227, 62, 57, 
+    106, 213, 186, 252, 211, 62, 57, 106, 213, 186, 252, 201, 254, 245, 211, 
+    209, 220, 140, 232, 219, 254, 245, 211, 209, 220, 140, 247, 128, 254, 
+    245, 250, 138, 79, 254, 245, 54, 111, 254, 245, 54, 105, 254, 245, 54, 
+    158, 254, 245, 54, 161, 254, 245, 54, 190, 254, 245, 54, 195, 254, 245, 
+    54, 199, 254, 245, 54, 196, 254, 245, 54, 201, 254, 245, 54, 216, 248, 
+    254, 245, 54, 215, 73, 254, 245, 54, 216, 163, 254, 245, 54, 244, 23, 
+    254, 245, 54, 244, 122, 254, 245, 54, 219, 113, 254, 245, 54, 220, 118, 
+    254, 245, 54, 245, 192, 254, 245, 54, 228, 200, 254, 245, 54, 123, 240, 
+    217, 254, 245, 54, 113, 240, 217, 254, 245, 54, 134, 240, 217, 254, 245, 
+    54, 244, 19, 240, 217, 254, 245, 54, 244, 89, 240, 217, 254, 245, 54, 
+    219, 127, 240, 217, 254, 245, 54, 220, 124, 240, 217, 254, 245, 54, 245, 
+    201, 240, 217, 254, 245, 54, 228, 205, 240, 217, 254, 245, 54, 123, 216, 
+    148, 254, 245, 54, 113, 216, 148, 254, 245, 54, 134, 216, 148, 254, 245, 
+    54, 244, 19, 216, 148, 254, 245, 54, 244, 89, 216, 148, 254, 245, 54, 
+    219, 127, 216, 148, 254, 245, 54, 220, 124, 216, 148, 254, 245, 54, 245, 
+    201, 216, 148, 254, 245, 54, 228, 205, 216, 148, 254, 245, 54, 216, 249, 
+    216, 148, 254, 245, 54, 215, 74, 216, 148, 254, 245, 54, 216, 164, 216, 
+    148, 254, 245, 54, 244, 24, 216, 148, 254, 245, 54, 244, 123, 216, 148, 
+    254, 245, 54, 219, 114, 216, 148, 254, 245, 54, 220, 119, 216, 148, 254, 
+    245, 54, 245, 193, 216, 148, 254, 245, 54, 228, 201, 216, 148, 254, 245, 
+    212, 14, 252, 136, 214, 173, 254, 245, 212, 14, 244, 100, 218, 60, 254, 
+    245, 212, 14, 221, 178, 218, 60, 254, 245, 212, 14, 216, 170, 218, 60, 
+    254, 245, 212, 14, 244, 12, 218, 60, 254, 245, 246, 89, 231, 95, 244, 
+    100, 218, 60, 254, 245, 232, 205, 231, 95, 244, 100, 218, 60, 254, 245, 
+    231, 95, 221, 178, 218, 60, 254, 245, 231, 95, 216, 170, 218, 60, 26, 
+    255, 15, 253, 202, 123, 224, 24, 26, 255, 15, 253, 202, 123, 242, 34, 26, 
+    255, 15, 253, 202, 123, 246, 108, 26, 255, 15, 253, 202, 190, 26, 255, 
+    15, 253, 202, 244, 122, 26, 255, 15, 253, 202, 244, 89, 240, 217, 26, 
+    255, 15, 253, 202, 244, 89, 216, 148, 26, 255, 15, 253, 202, 244, 123, 
+    216, 148, 26, 255, 15, 253, 202, 244, 89, 217, 68, 26, 255, 15, 253, 202, 
+    216, 249, 217, 68, 26, 255, 15, 253, 202, 244, 123, 217, 68, 26, 255, 15, 
+    253, 202, 123, 240, 218, 217, 68, 26, 255, 15, 253, 202, 244, 89, 240, 
+    218, 217, 68, 26, 255, 15, 253, 202, 123, 216, 149, 217, 68, 26, 255, 15, 
+    253, 202, 244, 89, 216, 149, 217, 68, 26, 255, 15, 253, 202, 244, 89, 
+    218, 152, 26, 255, 15, 253, 202, 216, 249, 218, 152, 26, 255, 15, 253, 
+    202, 244, 123, 218, 152, 26, 255, 15, 253, 202, 123, 240, 218, 218, 152, 
+    26, 255, 15, 253, 202, 244, 89, 240, 218, 218, 152, 26, 255, 15, 253, 
+    202, 123, 216, 149, 218, 152, 26, 255, 15, 253, 202, 216, 249, 216, 149, 
+    218, 152, 26, 255, 15, 253, 202, 244, 123, 216, 149, 218, 152, 26, 255, 
+    15, 253, 202, 216, 249, 230, 169, 26, 255, 15, 241, 212, 123, 225, 34, 
+    26, 255, 15, 216, 182, 111, 26, 255, 15, 241, 208, 111, 26, 255, 15, 245, 
+    112, 105, 26, 255, 15, 216, 182, 105, 26, 255, 15, 249, 73, 113, 246, 
+    107, 26, 255, 15, 245, 112, 113, 246, 107, 26, 255, 15, 215, 204, 190, 
+    26, 255, 15, 215, 204, 216, 248, 26, 255, 15, 215, 204, 216, 249, 254, 
+    149, 17, 26, 255, 15, 241, 208, 216, 248, 26, 255, 15, 231, 46, 216, 248, 
+    26, 255, 15, 216, 182, 216, 248, 26, 255, 15, 216, 182, 216, 163, 26, 
+    255, 15, 215, 204, 244, 122, 26, 255, 15, 215, 204, 244, 123, 254, 149, 
+    17, 26, 255, 15, 241, 208, 244, 122, 26, 255, 15, 216, 182, 244, 122, 26, 
+    255, 15, 216, 182, 123, 240, 217, 26, 255, 15, 216, 182, 134, 240, 217, 
+    26, 255, 15, 245, 112, 244, 89, 240, 217, 26, 255, 15, 215, 204, 244, 89, 
+    240, 217, 26, 255, 15, 216, 182, 244, 89, 240, 217, 26, 255, 15, 250, 
+    235, 244, 89, 240, 217, 26, 255, 15, 229, 187, 244, 89, 240, 217, 26, 
+    255, 15, 216, 182, 123, 216, 148, 26, 255, 15, 216, 182, 244, 89, 216, 
+    148, 26, 255, 15, 248, 65, 244, 89, 230, 169, 26, 255, 15, 218, 120, 244, 
+    123, 230, 169, 26, 123, 163, 50, 26, 123, 163, 5, 254, 149, 17, 26, 113, 
+    216, 168, 50, 26, 134, 224, 23, 50, 26, 211, 45, 50, 26, 217, 69, 50, 26, 
+    246, 109, 50, 26, 226, 250, 50, 26, 113, 226, 249, 50, 26, 134, 226, 249, 
+    50, 26, 244, 19, 226, 249, 50, 26, 244, 89, 226, 249, 50, 26, 231, 40, 
+    50, 26, 233, 163, 252, 136, 50, 26, 232, 200, 50, 26, 226, 135, 50, 26, 
+    211, 159, 50, 26, 253, 251, 50, 26, 254, 8, 50, 26, 242, 151, 50, 26, 
+    215, 187, 252, 136, 50, 26, 210, 87, 50, 222, 200, 220, 115, 50, 222, 
+    200, 214, 185, 50, 222, 200, 220, 144, 50, 222, 200, 220, 113, 50, 222, 
+    200, 247, 221, 220, 113, 50, 222, 200, 219, 170, 50, 222, 200, 248, 61, 
+    50, 222, 200, 224, 9, 50, 222, 200, 220, 131, 50, 222, 200, 246, 68, 50, 
+    222, 200, 253, 246, 50, 222, 200, 250, 179, 50, 225, 146, 247, 199, 5, 
+    225, 216, 225, 146, 247, 199, 5, 225, 27, 241, 242, 225, 146, 247, 199, 
+    5, 217, 46, 241, 242, 225, 146, 247, 199, 5, 250, 255, 225, 146, 247, 
+    199, 5, 250, 109, 225, 146, 247, 199, 5, 211, 221, 225, 146, 247, 199, 5, 
+    241, 218, 225, 146, 247, 199, 5, 243, 92, 225, 146, 247, 199, 5, 216, 
+    117, 225, 146, 247, 199, 5, 75, 225, 146, 247, 199, 5, 251, 177, 225, 
+    146, 247, 199, 5, 220, 31, 225, 146, 247, 199, 5, 249, 252, 225, 146, 
+    247, 199, 5, 231, 189, 225, 146, 247, 199, 5, 231, 141, 225, 146, 247, 
+    199, 5, 221, 218, 225, 146, 247, 199, 5, 232, 243, 225, 146, 247, 199, 5, 
+    251, 196, 225, 146, 247, 199, 5, 250, 239, 225, 38, 225, 146, 247, 199, 
+    5, 247, 141, 225, 146, 247, 199, 5, 249, 231, 225, 146, 247, 199, 5, 219, 
+    89, 225, 146, 247, 199, 5, 249, 232, 225, 146, 247, 199, 5, 252, 71, 225, 
+    146, 247, 199, 5, 220, 18, 225, 146, 247, 199, 5, 240, 255, 225, 146, 
+    247, 199, 5, 241, 185, 225, 146, 247, 199, 5, 251, 120, 233, 42, 225, 
+    146, 247, 199, 5, 250, 232, 225, 146, 247, 199, 5, 223, 156, 225, 146, 
+    247, 199, 5, 245, 238, 225, 146, 247, 199, 5, 246, 115, 225, 146, 247, 
+    199, 5, 215, 106, 225, 146, 247, 199, 5, 252, 74, 225, 146, 247, 199, 5, 
+    225, 39, 215, 236, 225, 146, 247, 199, 5, 213, 159, 225, 146, 247, 199, 
+    5, 226, 22, 225, 146, 247, 199, 5, 222, 192, 225, 146, 247, 199, 5, 232, 
+    230, 225, 146, 247, 199, 5, 226, 119, 252, 192, 225, 146, 247, 199, 5, 
+    244, 56, 225, 146, 247, 199, 5, 242, 145, 225, 146, 247, 199, 5, 218, 
+    121, 225, 146, 247, 199, 5, 4, 253, 176, 225, 146, 247, 199, 5, 212, 32, 
+    252, 156, 225, 146, 247, 199, 5, 38, 226, 252, 91, 232, 65, 1, 61, 232, 
+    65, 1, 76, 232, 65, 1, 253, 166, 232, 65, 1, 252, 27, 232, 65, 1, 243, 
+    209, 232, 65, 1, 249, 68, 232, 65, 1, 74, 232, 65, 1, 212, 98, 232, 65, 
+    1, 210, 159, 232, 65, 1, 216, 211, 232, 65, 1, 235, 150, 232, 65, 1, 235, 
+    29, 232, 65, 1, 224, 99, 232, 65, 1, 156, 232, 65, 1, 194, 232, 65, 1, 
+    230, 30, 232, 65, 1, 230, 171, 232, 65, 1, 228, 116, 232, 65, 1, 69, 232, 
+    65, 1, 226, 109, 232, 65, 1, 234, 53, 232, 65, 1, 153, 232, 65, 1, 222, 
+    93, 232, 65, 1, 217, 153, 232, 65, 1, 215, 160, 232, 65, 1, 254, 131, 
+    232, 65, 1, 245, 158, 232, 65, 1, 242, 67, 232, 65, 1, 211, 178, 250, 
+    245, 1, 61, 250, 245, 1, 226, 95, 250, 245, 1, 249, 68, 250, 245, 1, 156, 
+    250, 245, 1, 214, 116, 250, 245, 1, 153, 250, 245, 1, 233, 68, 250, 245, 
+    1, 255, 84, 250, 245, 1, 224, 99, 250, 245, 1, 253, 166, 250, 245, 1, 
+    194, 250, 245, 1, 78, 250, 245, 1, 248, 231, 250, 245, 1, 217, 153, 250, 
+    245, 1, 220, 106, 250, 245, 1, 220, 105, 250, 245, 1, 222, 93, 250, 245, 
+    1, 251, 73, 250, 245, 1, 69, 250, 245, 1, 228, 116, 250, 245, 1, 211, 
+    178, 250, 245, 1, 230, 30, 250, 245, 1, 215, 159, 250, 245, 1, 226, 109, 
+    250, 245, 1, 218, 228, 250, 245, 1, 74, 250, 245, 1, 76, 250, 245, 1, 
+    214, 113, 250, 245, 1, 235, 29, 250, 245, 1, 235, 20, 250, 245, 1, 229, 
+    155, 250, 245, 1, 214, 118, 250, 245, 1, 243, 209, 250, 245, 1, 243, 144, 
+    250, 245, 1, 218, 170, 250, 245, 1, 218, 169, 250, 245, 1, 229, 84, 250, 
+    245, 1, 236, 40, 250, 245, 1, 251, 72, 250, 245, 1, 215, 160, 250, 245, 
+    1, 214, 115, 250, 245, 1, 222, 182, 250, 245, 1, 231, 134, 250, 245, 1, 
+    231, 133, 250, 245, 1, 231, 132, 250, 245, 1, 231, 131, 250, 245, 1, 233, 
+    67, 250, 245, 1, 245, 242, 250, 245, 1, 214, 114, 55, 32, 1, 61, 55, 32, 
+    1, 252, 83, 55, 32, 1, 234, 188, 55, 32, 1, 248, 98, 55, 32, 1, 76, 55, 
+    32, 1, 213, 255, 55, 32, 1, 210, 94, 55, 32, 1, 241, 245, 55, 32, 1, 216, 
+    196, 55, 32, 1, 74, 55, 32, 1, 176, 55, 32, 1, 245, 182, 55, 32, 1, 245, 
+    167, 55, 32, 1, 245, 158, 55, 32, 1, 245, 83, 55, 32, 1, 78, 55, 32, 1, 
+    225, 224, 55, 32, 1, 220, 65, 55, 32, 1, 233, 223, 55, 32, 1, 245, 100, 
+    55, 32, 1, 245, 90, 55, 32, 1, 217, 23, 55, 32, 1, 69, 55, 32, 1, 245, 
+    185, 55, 32, 1, 225, 139, 55, 32, 1, 234, 125, 55, 32, 1, 245, 210, 55, 
+    32, 1, 245, 92, 55, 32, 1, 250, 139, 55, 32, 1, 236, 40, 55, 32, 1, 214, 
+    118, 55, 32, 227, 202, 111, 55, 32, 227, 202, 190, 55, 32, 227, 202, 216, 
+    248, 55, 32, 227, 202, 244, 122, 242, 160, 1, 254, 213, 242, 160, 1, 252, 
+    171, 242, 160, 1, 242, 218, 242, 160, 1, 248, 212, 242, 160, 1, 254, 209, 
+    242, 160, 1, 224, 82, 242, 160, 1, 235, 161, 242, 160, 1, 242, 46, 242, 
+    160, 1, 216, 159, 242, 160, 1, 245, 191, 242, 160, 1, 233, 196, 242, 160, 
+    1, 233, 119, 242, 160, 1, 231, 184, 242, 160, 1, 229, 189, 242, 160, 1, 
+    235, 125, 242, 160, 1, 214, 136, 242, 160, 1, 226, 73, 242, 160, 1, 228, 
+    200, 242, 160, 1, 223, 168, 242, 160, 1, 221, 220, 242, 160, 1, 217, 5, 
+    242, 160, 1, 211, 234, 242, 160, 1, 244, 186, 242, 160, 1, 236, 44, 242, 
+    160, 1, 240, 206, 242, 160, 1, 226, 143, 242, 160, 1, 228, 205, 240, 217, 
+    214, 209, 1, 254, 155, 214, 209, 1, 252, 34, 214, 209, 1, 243, 115, 214, 
+    209, 1, 234, 138, 214, 209, 1, 248, 62, 214, 209, 1, 241, 75, 214, 209, 
+    1, 211, 227, 214, 209, 1, 210, 85, 214, 209, 1, 240, 248, 214, 209, 1, 
+    216, 231, 214, 209, 1, 210, 233, 214, 209, 1, 235, 0, 214, 209, 1, 220, 
+    22, 214, 209, 1, 233, 104, 214, 209, 1, 231, 70, 214, 209, 1, 248, 29, 
+    214, 209, 1, 227, 198, 214, 209, 1, 210, 13, 214, 209, 1, 221, 250, 214, 
+    209, 1, 254, 205, 214, 209, 1, 224, 153, 214, 209, 1, 222, 27, 214, 209, 
+    1, 224, 38, 214, 209, 1, 223, 147, 214, 209, 1, 216, 200, 214, 209, 1, 
+    242, 251, 214, 209, 1, 112, 214, 209, 1, 74, 214, 209, 1, 69, 214, 209, 
+    1, 218, 181, 214, 209, 211, 209, 247, 180, 55, 225, 172, 5, 61, 55, 225, 
+    172, 5, 74, 55, 225, 172, 5, 69, 55, 225, 172, 5, 176, 55, 225, 172, 5, 
+    233, 223, 55, 225, 172, 5, 243, 142, 55, 225, 172, 5, 242, 120, 55, 225, 
+    172, 5, 211, 165, 55, 225, 172, 5, 251, 41, 55, 225, 172, 5, 235, 147, 
+    55, 225, 172, 5, 235, 114, 55, 225, 172, 5, 217, 106, 55, 225, 172, 5, 
+    215, 119, 55, 225, 172, 5, 248, 229, 55, 225, 172, 5, 248, 11, 55, 225, 
+    172, 5, 246, 86, 55, 225, 172, 5, 216, 209, 55, 225, 172, 5, 191, 55, 
+    225, 172, 5, 252, 199, 55, 225, 172, 5, 244, 204, 55, 225, 172, 5, 198, 
+    55, 225, 172, 5, 227, 242, 55, 225, 172, 5, 186, 55, 225, 172, 5, 230, 
+    235, 55, 225, 172, 5, 230, 107, 55, 225, 172, 5, 192, 55, 225, 172, 5, 
+    214, 27, 55, 225, 172, 5, 213, 176, 55, 225, 172, 5, 205, 55, 225, 172, 
+    5, 222, 142, 55, 225, 172, 5, 233, 141, 55, 225, 172, 5, 206, 55, 225, 
+    172, 5, 210, 116, 55, 225, 172, 5, 220, 104, 55, 225, 172, 5, 218, 225, 
+    55, 225, 172, 5, 162, 55, 225, 172, 5, 253, 194, 55, 225, 172, 5, 253, 
+    193, 55, 225, 172, 5, 253, 192, 55, 225, 172, 5, 211, 142, 55, 225, 172, 
+    5, 248, 208, 55, 225, 172, 5, 248, 207, 55, 225, 172, 5, 252, 178, 55, 
+    225, 172, 5, 251, 93, 55, 225, 172, 211, 209, 247, 180, 55, 225, 172, 54, 
+    111, 55, 225, 172, 54, 105, 55, 225, 172, 54, 216, 248, 55, 225, 172, 54, 
+    215, 73, 55, 225, 172, 54, 240, 217, 181, 6, 1, 200, 74, 181, 6, 1, 200, 
+    76, 181, 6, 1, 200, 61, 181, 6, 1, 200, 254, 218, 181, 6, 1, 200, 78, 
+    181, 6, 1, 200, 226, 187, 181, 6, 1, 219, 253, 74, 181, 6, 1, 219, 253, 
+    76, 181, 6, 1, 219, 253, 61, 181, 6, 1, 219, 253, 254, 218, 181, 6, 1, 
+    219, 253, 78, 181, 6, 1, 219, 253, 226, 187, 181, 6, 1, 253, 175, 181, 6, 
+    1, 226, 120, 181, 6, 1, 211, 195, 181, 6, 1, 211, 44, 181, 6, 1, 242, 67, 
+    181, 6, 1, 225, 214, 181, 6, 1, 252, 74, 181, 6, 1, 217, 12, 181, 6, 1, 
+    248, 85, 181, 6, 1, 250, 136, 181, 6, 1, 235, 130, 181, 6, 1, 234, 195, 
+    181, 6, 1, 243, 90, 181, 6, 1, 245, 210, 181, 6, 1, 213, 250, 181, 6, 1, 
+    245, 67, 181, 6, 1, 216, 195, 181, 6, 1, 245, 90, 181, 6, 1, 210, 92, 
+    181, 6, 1, 245, 83, 181, 6, 1, 210, 73, 181, 6, 1, 245, 100, 181, 6, 1, 
+    245, 182, 181, 6, 1, 245, 167, 181, 6, 1, 245, 158, 181, 6, 1, 245, 146, 
+    181, 6, 1, 226, 223, 181, 6, 1, 245, 46, 181, 4, 1, 200, 74, 181, 4, 1, 
+    200, 76, 181, 4, 1, 200, 61, 181, 4, 1, 200, 254, 218, 181, 4, 1, 200, 
+    78, 181, 4, 1, 200, 226, 187, 181, 4, 1, 219, 253, 74, 181, 4, 1, 219, 
+    253, 76, 181, 4, 1, 219, 253, 61, 181, 4, 1, 219, 253, 254, 218, 181, 4, 
+    1, 219, 253, 78, 181, 4, 1, 219, 253, 226, 187, 181, 4, 1, 253, 175, 181, 
+    4, 1, 226, 120, 181, 4, 1, 211, 195, 181, 4, 1, 211, 44, 181, 4, 1, 242, 
+    67, 181, 4, 1, 225, 214, 181, 4, 1, 252, 74, 181, 4, 1, 217, 12, 181, 4, 
+    1, 248, 85, 181, 4, 1, 250, 136, 181, 4, 1, 235, 130, 181, 4, 1, 234, 
+    195, 181, 4, 1, 243, 90, 181, 4, 1, 245, 210, 181, 4, 1, 213, 250, 181, 
+    4, 1, 245, 67, 181, 4, 1, 216, 195, 181, 4, 1, 245, 90, 181, 4, 1, 210, 
+    92, 181, 4, 1, 245, 83, 181, 4, 1, 210, 73, 181, 4, 1, 245, 100, 181, 4, 
+    1, 245, 182, 181, 4, 1, 245, 167, 181, 4, 1, 245, 158, 181, 4, 1, 245, 
+    146, 181, 4, 1, 226, 223, 181, 4, 1, 245, 46, 220, 71, 1, 225, 212, 220, 
+    71, 1, 216, 6, 220, 71, 1, 234, 97, 220, 71, 1, 244, 155, 220, 71, 1, 
+    216, 173, 220, 71, 1, 219, 60, 220, 71, 1, 218, 15, 220, 71, 1, 250, 69, 
+    220, 71, 1, 211, 46, 220, 71, 1, 240, 216, 220, 71, 1, 252, 13, 220, 71, 
+    1, 248, 97, 220, 71, 1, 243, 128, 220, 71, 1, 213, 123, 220, 71, 1, 216, 
+    177, 220, 71, 1, 210, 21, 220, 71, 1, 231, 94, 220, 71, 1, 235, 55, 220, 
+    71, 1, 211, 225, 220, 71, 1, 242, 55, 220, 71, 1, 232, 148, 220, 71, 1, 
+    230, 194, 220, 71, 1, 236, 47, 220, 71, 1, 245, 209, 220, 71, 1, 253, 
+    239, 220, 71, 1, 255, 0, 220, 71, 1, 226, 200, 220, 71, 1, 211, 212, 220, 
+    71, 1, 226, 134, 220, 71, 1, 254, 218, 220, 71, 1, 222, 210, 220, 71, 1, 
+    227, 198, 220, 71, 1, 245, 225, 220, 71, 1, 254, 223, 220, 71, 1, 240, 
+    118, 220, 71, 1, 214, 163, 220, 71, 1, 227, 2, 220, 71, 1, 226, 180, 220, 
+    71, 1, 226, 222, 220, 71, 1, 253, 178, 220, 71, 1, 254, 27, 220, 71, 1, 
+    226, 162, 220, 71, 1, 254, 201, 220, 71, 1, 245, 94, 220, 71, 1, 254, 5, 
+    220, 71, 1, 245, 235, 220, 71, 1, 240, 125, 220, 71, 1, 211, 13, 226, 
+    145, 1, 254, 179, 226, 145, 1, 252, 199, 226, 145, 1, 217, 106, 226, 145, 
+    1, 235, 147, 226, 145, 1, 211, 165, 226, 145, 1, 234, 138, 226, 145, 1, 
+    248, 84, 226, 145, 1, 205, 226, 145, 1, 206, 226, 145, 1, 220, 28, 226, 
+    145, 1, 248, 33, 226, 145, 1, 250, 223, 226, 145, 1, 243, 142, 226, 145, 
+    1, 244, 204, 226, 145, 1, 224, 89, 226, 145, 1, 235, 15, 226, 145, 1, 
+    233, 136, 226, 145, 1, 230, 205, 226, 145, 1, 227, 182, 226, 145, 1, 212, 
+    30, 226, 145, 1, 162, 226, 145, 1, 192, 226, 145, 1, 61, 226, 145, 1, 76, 
+    226, 145, 1, 74, 226, 145, 1, 78, 226, 145, 1, 69, 226, 145, 1, 255, 82, 
+    226, 145, 1, 245, 217, 226, 145, 1, 226, 187, 226, 145, 21, 210, 86, 226, 
+    145, 21, 111, 226, 145, 21, 105, 226, 145, 21, 158, 226, 145, 21, 161, 
+    226, 145, 21, 190, 226, 145, 21, 195, 226, 145, 21, 199, 226, 145, 21, 
+    196, 226, 145, 21, 201, 249, 75, 3, 61, 249, 75, 3, 76, 249, 75, 3, 74, 
+    249, 75, 3, 78, 249, 75, 3, 69, 249, 75, 3, 235, 147, 249, 75, 3, 235, 
+    74, 249, 75, 3, 176, 249, 75, 3, 234, 188, 249, 75, 3, 234, 98, 249, 75, 
+    3, 234, 34, 249, 75, 3, 233, 223, 249, 75, 3, 233, 141, 249, 75, 3, 233, 
+    64, 249, 75, 3, 232, 247, 249, 75, 3, 232, 162, 249, 75, 3, 232, 103, 
+    249, 75, 3, 186, 249, 75, 3, 231, 96, 249, 75, 3, 230, 235, 249, 75, 3, 
+    230, 166, 249, 75, 3, 230, 107, 249, 75, 3, 198, 249, 75, 3, 229, 112, 
+    249, 75, 3, 228, 238, 249, 75, 3, 228, 79, 249, 75, 3, 227, 242, 249, 75, 
+    3, 191, 249, 75, 3, 225, 224, 249, 75, 3, 225, 111, 249, 75, 3, 225, 19, 
+    249, 75, 3, 224, 153, 249, 75, 3, 205, 249, 75, 3, 223, 131, 249, 75, 3, 
+    223, 38, 249, 75, 3, 222, 213, 249, 75, 3, 222, 142, 249, 75, 3, 206, 
+    249, 75, 3, 221, 183, 249, 75, 3, 219, 193, 249, 75, 3, 219, 60, 249, 75, 
+    3, 218, 84, 249, 75, 3, 217, 106, 249, 75, 3, 217, 23, 249, 75, 3, 216, 
+    118, 249, 75, 3, 112, 249, 75, 3, 215, 119, 249, 75, 3, 212, 65, 249, 75, 
+    3, 212, 22, 249, 75, 3, 211, 250, 249, 75, 3, 211, 227, 249, 75, 3, 211, 
+    165, 249, 75, 3, 211, 162, 249, 75, 3, 210, 116, 249, 75, 3, 210, 23, 
+    236, 8, 254, 35, 1, 254, 177, 236, 8, 254, 35, 1, 252, 33, 236, 8, 254, 
+    35, 1, 242, 208, 236, 8, 254, 35, 1, 248, 196, 236, 8, 254, 35, 1, 241, 
+    245, 236, 8, 254, 35, 1, 212, 30, 236, 8, 254, 35, 1, 210, 97, 236, 8, 
+    254, 35, 1, 241, 202, 236, 8, 254, 35, 1, 216, 227, 236, 8, 254, 35, 1, 
+    210, 232, 236, 8, 254, 35, 1, 234, 231, 236, 8, 254, 35, 1, 233, 99, 236, 
+    8, 254, 35, 1, 231, 70, 236, 8, 254, 35, 1, 227, 198, 236, 8, 254, 35, 1, 
+    221, 251, 236, 8, 254, 35, 1, 253, 170, 236, 8, 254, 35, 1, 225, 224, 
+    236, 8, 254, 35, 1, 222, 26, 236, 8, 254, 35, 1, 224, 37, 236, 8, 254, 
+    35, 1, 223, 70, 236, 8, 254, 35, 1, 220, 22, 236, 8, 254, 35, 1, 217, 37, 
+    236, 8, 254, 35, 221, 175, 50, 236, 8, 254, 35, 54, 111, 236, 8, 254, 35, 
+    54, 105, 236, 8, 254, 35, 54, 158, 236, 8, 254, 35, 54, 216, 248, 236, 8, 
+    254, 35, 54, 215, 73, 236, 8, 254, 35, 54, 123, 240, 217, 236, 8, 254, 
+    35, 54, 123, 216, 148, 236, 8, 254, 35, 54, 216, 249, 216, 148, 225, 122, 
+    1, 254, 174, 225, 122, 1, 252, 36, 225, 122, 1, 243, 116, 225, 122, 1, 
+    248, 64, 225, 122, 1, 241, 245, 225, 122, 1, 212, 37, 225, 122, 1, 210, 
+    110, 225, 122, 1, 241, 204, 225, 122, 1, 216, 231, 225, 122, 1, 210, 233, 
+    225, 122, 1, 235, 0, 225, 122, 1, 233, 105, 225, 122, 1, 231, 70, 225, 
+    122, 1, 227, 198, 225, 122, 1, 220, 146, 225, 122, 1, 254, 205, 225, 122, 
+    1, 225, 224, 225, 122, 1, 222, 27, 225, 122, 1, 224, 42, 225, 122, 1, 
+    222, 191, 225, 122, 1, 220, 22, 225, 122, 1, 217, 42, 225, 122, 54, 111, 
+    225, 122, 54, 216, 248, 225, 122, 54, 215, 73, 225, 122, 54, 123, 240, 
+    217, 225, 122, 54, 105, 225, 122, 54, 158, 225, 122, 211, 209, 220, 139, 
+    232, 64, 1, 61, 232, 64, 1, 253, 166, 232, 64, 1, 243, 209, 232, 64, 1, 
+    249, 68, 232, 64, 1, 76, 232, 64, 1, 214, 105, 232, 64, 1, 74, 232, 64, 
+    1, 211, 117, 232, 64, 1, 235, 29, 232, 64, 1, 156, 232, 64, 1, 194, 232, 
+    64, 1, 230, 30, 232, 64, 1, 78, 232, 64, 1, 153, 232, 64, 1, 218, 228, 
+    232, 64, 1, 217, 153, 232, 64, 1, 69, 232, 64, 1, 245, 14, 232, 64, 1, 
+    224, 99, 232, 64, 1, 222, 93, 232, 64, 1, 215, 160, 232, 64, 1, 254, 131, 
+    232, 64, 1, 245, 158, 232, 64, 1, 232, 67, 232, 64, 1, 228, 116, 232, 64, 
+    1, 251, 74, 232, 64, 215, 223, 79, 231, 53, 241, 181, 1, 61, 231, 53, 
+    241, 181, 1, 76, 231, 53, 241, 181, 1, 74, 231, 53, 241, 181, 1, 78, 231, 
+    53, 241, 181, 1, 192, 231, 53, 241, 181, 1, 212, 65, 231, 53, 241, 181, 
+    1, 252, 199, 231, 53, 241, 181, 1, 252, 198, 231, 53, 241, 181, 1, 191, 
+    231, 53, 241, 181, 1, 186, 231, 53, 241, 181, 1, 198, 231, 53, 241, 181, 
+    1, 229, 233, 231, 53, 241, 181, 1, 229, 112, 231, 53, 241, 181, 1, 229, 
+    111, 231, 53, 241, 181, 1, 205, 231, 53, 241, 181, 1, 223, 190, 231, 53, 
+    241, 181, 1, 233, 141, 231, 53, 241, 181, 1, 234, 138, 231, 53, 241, 181, 
+    1, 241, 196, 231, 53, 241, 181, 1, 206, 231, 53, 241, 181, 1, 222, 35, 
+    231, 53, 241, 181, 1, 221, 183, 231, 53, 241, 181, 1, 176, 231, 53, 241, 
+    181, 1, 224, 91, 231, 53, 241, 181, 1, 217, 106, 231, 53, 241, 181, 1, 
+    217, 105, 231, 53, 241, 181, 1, 217, 23, 231, 53, 241, 181, 1, 217, 22, 
+    231, 53, 241, 181, 1, 112, 231, 53, 241, 181, 1, 248, 229, 231, 53, 241, 
+    181, 16, 213, 170, 231, 53, 241, 181, 16, 213, 169, 231, 53, 249, 102, 1, 
+    61, 231, 53, 249, 102, 1, 76, 231, 53, 249, 102, 1, 74, 231, 53, 249, 
+    102, 1, 78, 231, 53, 249, 102, 1, 192, 231, 53, 249, 102, 1, 212, 65, 
+    231, 53, 249, 102, 1, 252, 199, 231, 53, 249, 102, 1, 191, 231, 53, 249, 
+    102, 1, 186, 231, 53, 249, 102, 1, 198, 231, 53, 249, 102, 1, 229, 112, 
+    231, 53, 249, 102, 1, 205, 231, 53, 249, 102, 1, 233, 141, 231, 53, 249, 
+    102, 1, 234, 138, 231, 53, 249, 102, 1, 241, 196, 231, 53, 249, 102, 1, 
+    206, 231, 53, 249, 102, 1, 254, 31, 206, 231, 53, 249, 102, 1, 221, 183, 
+    231, 53, 249, 102, 1, 176, 231, 53, 249, 102, 1, 224, 91, 231, 53, 249, 
+    102, 1, 217, 106, 231, 53, 249, 102, 1, 217, 23, 231, 53, 249, 102, 1, 
+    112, 231, 53, 249, 102, 1, 248, 229, 231, 53, 249, 102, 232, 151, 222, 
+    219, 231, 53, 249, 102, 232, 151, 236, 13, 234, 126, 1, 61, 234, 126, 25, 
+    5, 74, 234, 126, 25, 5, 69, 234, 126, 25, 5, 149, 153, 234, 126, 25, 5, 
+    76, 234, 126, 25, 5, 78, 234, 126, 25, 233, 29, 79, 234, 126, 5, 52, 222, 
+    237, 51, 234, 126, 5, 254, 83, 234, 126, 5, 213, 147, 234, 126, 1, 176, 
+    234, 126, 1, 234, 138, 234, 126, 1, 243, 142, 234, 126, 1, 243, 0, 234, 
+    126, 1, 251, 41, 234, 126, 1, 250, 165, 234, 126, 1, 235, 147, 234, 126, 
+    1, 227, 169, 234, 126, 1, 215, 157, 234, 126, 1, 215, 145, 234, 126, 1, 
+    248, 143, 234, 126, 1, 248, 127, 234, 126, 1, 228, 115, 234, 126, 1, 217, 
+    106, 234, 126, 1, 216, 209, 234, 126, 1, 248, 229, 234, 126, 1, 248, 33, 
+    234, 126, 1, 198, 234, 126, 1, 191, 234, 126, 1, 225, 150, 234, 126, 1, 
+    252, 199, 234, 126, 1, 252, 26, 234, 126, 1, 186, 234, 126, 1, 192, 234, 
+    126, 1, 205, 234, 126, 1, 233, 141, 234, 126, 1, 214, 27, 234, 126, 1, 
+    220, 104, 234, 126, 1, 218, 225, 234, 126, 1, 206, 234, 126, 1, 210, 116, 
+    234, 126, 1, 162, 234, 126, 1, 234, 52, 234, 126, 1, 215, 125, 234, 126, 
+    5, 252, 149, 48, 234, 126, 5, 250, 229, 234, 126, 5, 59, 51, 234, 126, 
+    213, 152, 234, 126, 21, 111, 234, 126, 21, 105, 234, 126, 21, 158, 234, 
+    126, 21, 161, 234, 126, 54, 216, 248, 234, 126, 54, 215, 73, 234, 126, 
+    54, 123, 240, 217, 234, 126, 54, 123, 216, 148, 234, 126, 224, 144, 247, 
+    128, 234, 126, 224, 144, 4, 250, 43, 234, 126, 224, 144, 250, 43, 234, 
+    126, 224, 144, 249, 145, 130, 234, 126, 224, 144, 231, 185, 234, 126, 
+    224, 144, 232, 121, 234, 126, 224, 144, 248, 186, 234, 126, 224, 144, 52, 
+    248, 186, 234, 126, 224, 144, 232, 213, 55, 219, 30, 254, 46, 1, 241, 
+    245, 55, 219, 30, 254, 46, 1, 233, 99, 55, 219, 30, 254, 46, 1, 241, 202, 
+    55, 219, 30, 254, 46, 1, 231, 70, 55, 219, 30, 254, 46, 1, 224, 37, 55, 
+    219, 30, 254, 46, 1, 212, 30, 55, 219, 30, 254, 46, 1, 220, 22, 55, 219, 
+    30, 254, 46, 1, 223, 70, 55, 219, 30, 254, 46, 1, 252, 33, 55, 219, 30, 
+    254, 46, 1, 217, 37, 55, 219, 30, 254, 46, 1, 221, 228, 55, 219, 30, 254, 
+    46, 1, 234, 231, 55, 219, 30, 254, 46, 1, 227, 198, 55, 219, 30, 254, 46, 
+    1, 234, 122, 55, 219, 30, 254, 46, 1, 222, 26, 55, 219, 30, 254, 46, 1, 
+    221, 251, 55, 219, 30, 254, 46, 1, 244, 162, 55, 219, 30, 254, 46, 1, 
+    254, 179, 55, 219, 30, 254, 46, 1, 253, 169, 55, 219, 30, 254, 46, 1, 
+    248, 30, 55, 219, 30, 254, 46, 1, 242, 208, 55, 219, 30, 254, 46, 1, 248, 
+    196, 55, 219, 30, 254, 46, 1, 242, 245, 55, 219, 30, 254, 46, 1, 216, 
+    227, 55, 219, 30, 254, 46, 1, 210, 96, 55, 219, 30, 254, 46, 1, 248, 27, 
+    55, 219, 30, 254, 46, 1, 210, 232, 55, 219, 30, 254, 46, 1, 216, 198, 55, 
+    219, 30, 254, 46, 1, 216, 179, 55, 219, 30, 254, 46, 54, 111, 55, 219, 
+    30, 254, 46, 54, 244, 122, 55, 219, 30, 254, 46, 132, 235, 245, 253, 180, 
+    1, 61, 253, 180, 1, 255, 82, 253, 180, 1, 254, 81, 253, 180, 1, 255, 41, 
+    253, 180, 1, 254, 131, 253, 180, 1, 255, 42, 253, 180, 1, 254, 252, 253, 
+    180, 1, 254, 248, 253, 180, 1, 76, 253, 180, 1, 245, 217, 253, 180, 1, 
+    78, 253, 180, 1, 226, 187, 253, 180, 1, 74, 253, 180, 1, 236, 40, 253, 
+    180, 1, 69, 253, 180, 1, 214, 118, 253, 180, 1, 234, 188, 253, 180, 1, 
+    211, 162, 253, 180, 1, 211, 128, 253, 180, 1, 211, 137, 253, 180, 1, 243, 
+    69, 253, 180, 1, 243, 31, 253, 180, 1, 242, 243, 253, 180, 1, 250, 198, 
+    253, 180, 1, 235, 132, 253, 180, 1, 217, 23, 253, 180, 1, 216, 196, 253, 
+    180, 1, 248, 98, 253, 180, 1, 248, 25, 253, 180, 1, 215, 152, 253, 180, 
+    1, 225, 224, 253, 180, 1, 244, 162, 253, 180, 1, 252, 83, 253, 180, 1, 
+    252, 22, 253, 180, 1, 229, 69, 253, 180, 1, 228, 244, 253, 180, 1, 228, 
+    245, 253, 180, 1, 229, 112, 253, 180, 1, 227, 160, 253, 180, 1, 228, 110, 
+    253, 180, 1, 231, 96, 253, 180, 1, 241, 123, 253, 180, 1, 210, 166, 253, 
+    180, 1, 211, 47, 253, 180, 1, 213, 255, 253, 180, 1, 223, 131, 253, 180, 
+    1, 233, 64, 253, 180, 1, 221, 183, 253, 180, 1, 210, 94, 253, 180, 1, 
+    220, 65, 253, 180, 1, 210, 74, 253, 180, 1, 219, 200, 253, 180, 1, 218, 
+    195, 253, 180, 1, 241, 245, 253, 180, 255, 30, 79, 216, 80, 113, 170, 
+    115, 123, 59, 224, 143, 4, 113, 170, 115, 123, 59, 224, 143, 233, 91, 
+    113, 170, 115, 123, 59, 224, 143, 233, 91, 123, 59, 115, 113, 170, 224, 
+    143, 233, 91, 113, 222, 235, 115, 123, 222, 237, 224, 143, 233, 91, 123, 
+    222, 237, 115, 113, 222, 235, 224, 143, 235, 225, 226, 2, 1, 254, 177, 
+    235, 225, 226, 2, 1, 252, 33, 235, 225, 226, 2, 1, 242, 208, 235, 225, 
+    226, 2, 1, 248, 196, 235, 225, 226, 2, 1, 241, 245, 235, 225, 226, 2, 1, 
+    212, 30, 235, 225, 226, 2, 1, 210, 97, 235, 225, 226, 2, 1, 241, 202, 
+    235, 225, 226, 2, 1, 216, 227, 235, 225, 226, 2, 1, 210, 232, 235, 225, 
+    226, 2, 1, 234, 231, 235, 225, 226, 2, 1, 233, 99, 235, 225, 226, 2, 1, 
+    231, 70, 235, 225, 226, 2, 1, 227, 198, 235, 225, 226, 2, 1, 221, 251, 
+    235, 225, 226, 2, 1, 253, 170, 235, 225, 226, 2, 1, 225, 224, 235, 225, 
+    226, 2, 1, 222, 26, 235, 225, 226, 2, 1, 224, 37, 235, 225, 226, 2, 1, 
+    223, 70, 235, 225, 226, 2, 1, 220, 22, 235, 225, 226, 2, 1, 217, 37, 235, 
+    225, 226, 2, 54, 111, 235, 225, 226, 2, 54, 105, 235, 225, 226, 2, 54, 
+    158, 235, 225, 226, 2, 54, 161, 235, 225, 226, 2, 54, 216, 248, 235, 225, 
+    226, 2, 54, 215, 73, 235, 225, 226, 2, 54, 123, 240, 217, 235, 225, 226, 
+    2, 54, 123, 216, 148, 235, 225, 226, 76, 1, 254, 177, 235, 225, 226, 76, 
+    1, 252, 33, 235, 225, 226, 76, 1, 242, 208, 235, 225, 226, 76, 1, 248, 
+    196, 235, 225, 226, 76, 1, 241, 245, 235, 225, 226, 76, 1, 212, 29, 235, 
+    225, 226, 76, 1, 210, 97, 235, 225, 226, 76, 1, 241, 202, 235, 225, 226, 
+    76, 1, 216, 227, 235, 225, 226, 76, 1, 210, 232, 235, 225, 226, 76, 1, 
+    234, 231, 235, 225, 226, 76, 1, 233, 99, 235, 225, 226, 76, 1, 231, 69, 
+    235, 225, 226, 76, 1, 227, 198, 235, 225, 226, 76, 1, 221, 251, 235, 225, 
+    226, 76, 1, 225, 224, 235, 225, 226, 76, 1, 222, 26, 235, 225, 226, 76, 
+    1, 220, 22, 235, 225, 226, 76, 1, 217, 37, 235, 225, 226, 76, 54, 111, 
+    235, 225, 226, 76, 54, 105, 235, 225, 226, 76, 54, 158, 235, 225, 226, 
+    76, 54, 161, 235, 225, 226, 76, 54, 216, 248, 235, 225, 226, 76, 54, 215, 
+    73, 235, 225, 226, 76, 54, 123, 240, 217, 235, 225, 226, 76, 54, 123, 
+    216, 148, 55, 202, 1, 226, 153, 61, 55, 202, 1, 211, 37, 61, 55, 202, 1, 
+    211, 37, 254, 252, 55, 202, 1, 226, 153, 74, 55, 202, 1, 211, 37, 74, 55, 
+    202, 1, 211, 37, 76, 55, 202, 1, 226, 153, 78, 55, 202, 1, 226, 153, 226, 
+    238, 55, 202, 1, 211, 37, 226, 238, 55, 202, 1, 226, 153, 255, 34, 55, 
+    202, 1, 211, 37, 255, 34, 55, 202, 1, 226, 153, 254, 251, 55, 202, 1, 
+    211, 37, 254, 251, 55, 202, 1, 226, 153, 254, 225, 55, 202, 1, 211, 37, 
+    254, 225, 55, 202, 1, 226, 153, 254, 246, 55, 202, 1, 211, 37, 254, 246, 
+    55, 202, 1, 226, 153, 255, 8, 55, 202, 1, 211, 37, 255, 8, 55, 202, 1, 
+    226, 153, 254, 250, 55, 202, 1, 226, 153, 245, 20, 55, 202, 1, 211, 37, 
+    245, 20, 55, 202, 1, 226, 153, 253, 175, 55, 202, 1, 211, 37, 253, 175, 
+    55, 202, 1, 226, 153, 254, 233, 55, 202, 1, 211, 37, 254, 233, 55, 202, 
+    1, 226, 153, 254, 244, 55, 202, 1, 211, 37, 254, 244, 55, 202, 1, 226, 
+    153, 226, 237, 55, 202, 1, 211, 37, 226, 237, 55, 202, 1, 226, 153, 254, 
+    187, 55, 202, 1, 211, 37, 254, 187, 55, 202, 1, 226, 153, 254, 243, 55, 
+    202, 1, 226, 153, 245, 169, 55, 202, 1, 226, 153, 245, 167, 55, 202, 1, 
+    226, 153, 254, 131, 55, 202, 1, 226, 153, 254, 241, 55, 202, 1, 211, 37, 
+    254, 241, 55, 202, 1, 226, 153, 245, 139, 55, 202, 1, 211, 37, 245, 139, 
+    55, 202, 1, 226, 153, 245, 155, 55, 202, 1, 211, 37, 245, 155, 55, 202, 
+    1, 226, 153, 245, 126, 55, 202, 1, 211, 37, 245, 126, 55, 202, 1, 211, 
+    37, 254, 123, 55, 202, 1, 226, 153, 245, 146, 55, 202, 1, 211, 37, 254, 
+    240, 55, 202, 1, 226, 153, 245, 116, 55, 202, 1, 226, 153, 226, 179, 55, 
+    202, 1, 226, 153, 240, 120, 55, 202, 1, 226, 153, 245, 223, 55, 202, 1, 
+    211, 37, 245, 223, 55, 202, 1, 226, 153, 254, 53, 55, 202, 1, 211, 37, 
+    254, 53, 55, 202, 1, 226, 153, 235, 188, 55, 202, 1, 211, 37, 235, 188, 
+    55, 202, 1, 226, 153, 226, 163, 55, 202, 1, 211, 37, 226, 163, 55, 202, 
+    1, 226, 153, 254, 49, 55, 202, 1, 211, 37, 254, 49, 55, 202, 1, 226, 153, 
+    254, 239, 55, 202, 1, 226, 153, 253, 245, 55, 202, 1, 226, 153, 254, 237, 
+    55, 202, 1, 226, 153, 253, 239, 55, 202, 1, 211, 37, 253, 239, 55, 202, 
+    1, 226, 153, 245, 83, 55, 202, 1, 211, 37, 245, 83, 55, 202, 1, 226, 153, 
+    253, 214, 55, 202, 1, 211, 37, 253, 214, 55, 202, 1, 226, 153, 254, 234, 
+    55, 202, 1, 211, 37, 254, 234, 55, 202, 1, 226, 153, 226, 144, 55, 202, 
+    1, 226, 153, 252, 133, 222, 129, 21, 111, 222, 129, 21, 105, 222, 129, 
+    21, 158, 222, 129, 21, 161, 222, 129, 21, 190, 222, 129, 21, 195, 222, 
+    129, 21, 199, 222, 129, 21, 196, 222, 129, 21, 201, 222, 129, 54, 216, 
+    248, 222, 129, 54, 215, 73, 222, 129, 54, 216, 163, 222, 129, 54, 244, 
+    23, 222, 129, 54, 244, 122, 222, 129, 54, 219, 113, 222, 129, 54, 220, 
+    118, 222, 129, 54, 245, 192, 222, 129, 54, 228, 200, 222, 129, 54, 123, 
+    240, 217, 222, 129, 54, 113, 240, 217, 222, 129, 54, 134, 240, 217, 222, 
+    129, 54, 244, 19, 240, 217, 222, 129, 54, 244, 89, 240, 217, 222, 129, 
+    54, 219, 127, 240, 217, 222, 129, 54, 220, 124, 240, 217, 222, 129, 54, 
+    245, 201, 240, 217, 222, 129, 54, 228, 205, 240, 217, 222, 129, 244, 10, 
+    123, 242, 34, 222, 129, 244, 10, 123, 224, 24, 222, 129, 244, 10, 123, 
+    216, 169, 222, 129, 244, 10, 113, 216, 167, 118, 5, 251, 7, 118, 5, 254, 
+    83, 118, 5, 213, 147, 118, 5, 235, 108, 118, 5, 214, 161, 118, 1, 61, 
+    118, 1, 255, 82, 118, 1, 74, 118, 1, 236, 40, 118, 1, 69, 118, 1, 214, 
+    118, 118, 1, 149, 153, 118, 1, 149, 222, 182, 118, 1, 149, 156, 118, 1, 
+    149, 232, 191, 118, 1, 76, 118, 1, 254, 210, 118, 1, 78, 118, 1, 253, 
+    200, 118, 1, 176, 118, 1, 234, 138, 118, 1, 243, 142, 118, 1, 243, 0, 
+    118, 1, 229, 82, 118, 1, 251, 41, 118, 1, 250, 165, 118, 1, 235, 147, 
+    118, 1, 235, 120, 118, 1, 227, 169, 118, 1, 215, 157, 118, 1, 215, 145, 
+    118, 1, 248, 143, 118, 1, 248, 127, 118, 1, 228, 115, 118, 1, 217, 106, 
+    118, 1, 216, 209, 118, 1, 248, 229, 118, 1, 248, 33, 118, 1, 198, 118, 1, 
+    191, 118, 1, 225, 150, 118, 1, 252, 199, 118, 1, 252, 26, 118, 1, 186, 
+    118, 1, 192, 118, 1, 205, 118, 1, 233, 141, 118, 1, 214, 27, 118, 1, 220, 
+    104, 118, 1, 218, 225, 118, 1, 206, 118, 1, 162, 118, 1, 232, 190, 118, 
+    1, 55, 36, 232, 181, 118, 1, 55, 36, 222, 181, 118, 1, 55, 36, 228, 97, 
+    118, 25, 5, 255, 82, 118, 25, 5, 252, 23, 255, 82, 118, 25, 5, 74, 118, 
+    25, 5, 236, 40, 118, 25, 5, 69, 118, 25, 5, 214, 118, 118, 25, 5, 149, 
+    153, 118, 25, 5, 149, 222, 182, 118, 25, 5, 149, 156, 118, 25, 5, 149, 
+    232, 191, 118, 25, 5, 76, 118, 25, 5, 254, 210, 118, 25, 5, 78, 118, 25, 
+    5, 253, 200, 118, 213, 152, 118, 248, 186, 118, 52, 248, 186, 118, 224, 
+    144, 247, 128, 118, 224, 144, 52, 247, 128, 118, 224, 144, 232, 219, 118, 
+    224, 144, 249, 145, 130, 118, 224, 144, 232, 121, 118, 54, 111, 118, 54, 
+    105, 118, 54, 158, 118, 54, 161, 118, 54, 190, 118, 54, 195, 118, 54, 
+    199, 118, 54, 196, 118, 54, 201, 118, 54, 216, 248, 118, 54, 215, 73, 
+    118, 54, 216, 163, 118, 54, 244, 23, 118, 54, 244, 122, 118, 54, 219, 
+    113, 118, 54, 220, 118, 118, 54, 245, 192, 118, 54, 228, 200, 118, 54, 
+    123, 240, 217, 118, 54, 123, 216, 148, 118, 21, 210, 86, 118, 21, 111, 
+    118, 21, 105, 118, 21, 158, 118, 21, 161, 118, 21, 190, 118, 21, 195, 
+    118, 21, 199, 118, 21, 196, 118, 21, 201, 234, 250, 5, 251, 7, 234, 250, 
+    5, 254, 83, 234, 250, 5, 213, 147, 234, 250, 1, 61, 234, 250, 1, 255, 82, 
+    234, 250, 1, 74, 234, 250, 1, 236, 40, 234, 250, 1, 69, 234, 250, 1, 214, 
+    118, 234, 250, 1, 76, 234, 250, 1, 254, 210, 234, 250, 1, 78, 234, 250, 
+    1, 253, 200, 234, 250, 1, 176, 234, 250, 1, 234, 138, 234, 250, 1, 243, 
+    142, 234, 250, 1, 243, 0, 234, 250, 1, 229, 82, 234, 250, 1, 251, 41, 
+    234, 250, 1, 250, 165, 234, 250, 1, 235, 147, 234, 250, 1, 235, 120, 234, 
+    250, 1, 227, 169, 234, 250, 1, 215, 157, 234, 250, 1, 215, 145, 234, 250, 
+    1, 248, 143, 234, 250, 1, 248, 132, 234, 250, 1, 248, 127, 234, 250, 1, 
+    223, 42, 234, 250, 1, 228, 115, 234, 250, 1, 217, 106, 234, 250, 1, 216, 
+    209, 234, 250, 1, 248, 229, 234, 250, 1, 248, 33, 234, 250, 1, 198, 234, 
+    250, 1, 191, 234, 250, 1, 225, 150, 234, 250, 1, 252, 199, 234, 250, 1, 
+    252, 26, 234, 250, 1, 186, 234, 250, 1, 192, 234, 250, 1, 205, 234, 250, 
+    1, 233, 141, 234, 250, 1, 214, 27, 234, 250, 1, 220, 104, 234, 250, 1, 
+    218, 225, 234, 250, 1, 206, 234, 250, 1, 162, 234, 250, 25, 5, 255, 82, 
+    234, 250, 25, 5, 74, 234, 250, 25, 5, 236, 40, 234, 250, 25, 5, 69, 234, 
+    250, 25, 5, 214, 118, 234, 250, 25, 5, 76, 234, 250, 25, 5, 254, 210, 
+    234, 250, 25, 5, 78, 234, 250, 25, 5, 253, 200, 234, 250, 5, 213, 152, 
+    234, 250, 5, 227, 209, 234, 250, 255, 30, 50, 234, 250, 245, 129, 50, 
+    234, 250, 54, 50, 234, 250, 221, 175, 79, 234, 250, 52, 221, 175, 79, 
+    234, 250, 248, 186, 234, 250, 52, 248, 186, 219, 38, 219, 46, 1, 222, 20, 
+    219, 38, 219, 46, 1, 217, 81, 219, 38, 219, 46, 1, 252, 176, 219, 38, 
+    219, 46, 1, 251, 31, 219, 38, 219, 46, 1, 248, 211, 219, 38, 219, 46, 1, 
+    243, 127, 219, 38, 219, 46, 1, 231, 215, 219, 38, 219, 46, 1, 229, 79, 
+    219, 38, 219, 46, 1, 233, 118, 219, 38, 219, 46, 1, 229, 218, 219, 38, 
+    219, 46, 1, 214, 24, 219, 38, 219, 46, 1, 226, 77, 219, 38, 219, 46, 1, 
+    211, 84, 219, 38, 219, 46, 1, 223, 171, 219, 38, 219, 46, 1, 242, 44, 
+    219, 38, 219, 46, 1, 234, 254, 219, 38, 219, 46, 1, 235, 142, 219, 38, 
+    219, 46, 1, 227, 166, 219, 38, 219, 46, 1, 254, 218, 219, 38, 219, 46, 1, 
+    245, 215, 219, 38, 219, 46, 1, 236, 41, 219, 38, 219, 46, 1, 214, 208, 
+    219, 38, 219, 46, 1, 226, 226, 219, 38, 219, 46, 1, 245, 205, 219, 38, 
+    219, 46, 1, 231, 228, 219, 38, 219, 46, 21, 210, 86, 219, 38, 219, 46, 
+    21, 111, 219, 38, 219, 46, 21, 105, 219, 38, 219, 46, 21, 158, 219, 38, 
+    219, 46, 21, 161, 219, 38, 219, 46, 21, 190, 219, 38, 219, 46, 21, 195, 
+    219, 38, 219, 46, 21, 199, 219, 38, 219, 46, 21, 196, 219, 38, 219, 46, 
+    21, 201, 250, 159, 5, 251, 7, 250, 159, 5, 254, 83, 250, 159, 5, 213, 
+    147, 250, 159, 1, 255, 82, 250, 159, 1, 74, 250, 159, 1, 69, 250, 159, 1, 
+    76, 250, 159, 1, 235, 16, 250, 159, 1, 234, 137, 250, 159, 1, 243, 139, 
+    250, 159, 1, 242, 255, 250, 159, 1, 229, 81, 250, 159, 1, 251, 40, 250, 
+    159, 1, 250, 164, 250, 159, 1, 235, 146, 250, 159, 1, 235, 119, 250, 159, 
+    1, 227, 168, 250, 159, 1, 215, 156, 250, 159, 1, 215, 144, 250, 159, 1, 
+    248, 142, 250, 159, 1, 248, 126, 250, 159, 1, 228, 114, 250, 159, 1, 217, 
+    102, 250, 159, 1, 216, 208, 250, 159, 1, 248, 228, 250, 159, 1, 248, 32, 
+    250, 159, 1, 229, 230, 250, 159, 1, 226, 93, 250, 159, 1, 225, 149, 250, 
+    159, 1, 252, 197, 250, 159, 1, 252, 25, 250, 159, 1, 231, 242, 250, 159, 
+    1, 210, 167, 250, 159, 1, 211, 103, 250, 159, 1, 223, 187, 250, 159, 1, 
+    233, 140, 250, 159, 1, 212, 64, 250, 159, 1, 222, 33, 250, 159, 1, 242, 
+    53, 250, 159, 25, 5, 61, 250, 159, 25, 5, 74, 250, 159, 25, 5, 236, 40, 
+    250, 159, 25, 5, 69, 250, 159, 25, 5, 214, 118, 250, 159, 25, 5, 76, 250, 
+    159, 25, 5, 254, 210, 250, 159, 25, 5, 78, 250, 159, 25, 5, 253, 200, 
+    250, 159, 25, 5, 226, 223, 250, 159, 144, 79, 250, 159, 253, 201, 79, 
+    250, 159, 213, 152, 250, 159, 231, 240, 250, 159, 21, 210, 86, 250, 159, 
+    21, 111, 250, 159, 21, 105, 250, 159, 21, 158, 250, 159, 21, 161, 250, 
+    159, 21, 190, 250, 159, 21, 195, 250, 159, 21, 199, 250, 159, 21, 196, 
+    250, 159, 21, 201, 250, 159, 221, 175, 79, 250, 159, 248, 186, 250, 159, 
+    52, 248, 186, 250, 159, 224, 16, 79, 174, 5, 251, 7, 174, 5, 254, 83, 
+    174, 5, 213, 147, 174, 1, 61, 174, 1, 255, 82, 174, 1, 74, 174, 1, 236, 
+    40, 174, 1, 69, 174, 1, 214, 118, 174, 1, 149, 153, 174, 1, 149, 222, 
+    182, 174, 1, 149, 156, 174, 1, 149, 232, 191, 174, 1, 76, 174, 1, 254, 
+    210, 174, 1, 78, 174, 1, 253, 200, 174, 1, 176, 174, 1, 234, 138, 174, 1, 
+    243, 142, 174, 1, 243, 0, 174, 1, 229, 82, 174, 1, 251, 41, 174, 1, 250, 
+    165, 174, 1, 235, 147, 174, 1, 235, 120, 174, 1, 227, 169, 174, 1, 215, 
+    157, 174, 1, 215, 145, 174, 1, 248, 143, 174, 1, 248, 127, 174, 1, 228, 
+    115, 174, 1, 217, 106, 174, 1, 216, 209, 174, 1, 248, 229, 174, 1, 248, 
+    33, 174, 1, 198, 174, 1, 191, 174, 1, 225, 150, 174, 1, 252, 199, 174, 1, 
+    252, 26, 174, 1, 186, 174, 1, 192, 174, 1, 205, 174, 1, 233, 141, 174, 1, 
+    232, 190, 174, 1, 214, 27, 174, 1, 220, 104, 174, 1, 218, 225, 174, 1, 
+    206, 174, 1, 162, 174, 25, 5, 255, 82, 174, 25, 5, 74, 174, 25, 5, 236, 
+    40, 174, 25, 5, 69, 174, 25, 5, 214, 118, 174, 25, 5, 149, 153, 174, 25, 
+    5, 149, 222, 182, 174, 25, 5, 149, 156, 174, 25, 5, 149, 232, 191, 174, 
+    25, 5, 76, 174, 25, 5, 254, 210, 174, 25, 5, 78, 174, 25, 5, 253, 200, 
+    174, 5, 213, 152, 174, 5, 253, 183, 174, 5, 235, 108, 174, 5, 214, 161, 
+    174, 226, 208, 174, 248, 186, 174, 52, 248, 186, 174, 255, 30, 50, 174, 
+    220, 139, 174, 21, 210, 86, 174, 21, 111, 174, 21, 105, 174, 21, 158, 
+    174, 21, 161, 174, 21, 190, 174, 21, 195, 174, 21, 199, 174, 21, 196, 
+    174, 21, 201, 217, 70, 1, 61, 217, 70, 1, 255, 82, 217, 70, 1, 74, 217, 
+    70, 1, 236, 40, 217, 70, 1, 69, 217, 70, 1, 214, 118, 217, 70, 1, 76, 
+    217, 70, 1, 254, 210, 217, 70, 1, 78, 217, 70, 1, 253, 200, 217, 70, 1, 
+    176, 217, 70, 1, 234, 138, 217, 70, 1, 243, 142, 217, 70, 1, 243, 0, 217, 
+    70, 1, 229, 82, 217, 70, 1, 251, 41, 217, 70, 1, 250, 165, 217, 70, 1, 
+    235, 147, 217, 70, 1, 235, 120, 217, 70, 1, 227, 169, 217, 70, 1, 215, 
+    157, 217, 70, 1, 215, 145, 217, 70, 1, 248, 143, 217, 70, 1, 248, 127, 
+    217, 70, 1, 228, 115, 217, 70, 1, 217, 106, 217, 70, 1, 216, 209, 217, 
+    70, 1, 248, 229, 217, 70, 1, 248, 33, 217, 70, 1, 198, 217, 70, 1, 191, 
+    217, 70, 1, 225, 150, 217, 70, 1, 252, 199, 217, 70, 1, 252, 26, 217, 70, 
+    1, 186, 217, 70, 1, 192, 217, 70, 1, 205, 217, 70, 1, 233, 141, 217, 70, 
+    1, 214, 27, 217, 70, 1, 220, 104, 217, 70, 1, 206, 217, 70, 1, 162, 217, 
+    70, 1, 222, 181, 217, 70, 5, 254, 83, 217, 70, 5, 213, 147, 217, 70, 25, 
+    5, 255, 82, 217, 70, 25, 5, 74, 217, 70, 25, 5, 236, 40, 217, 70, 25, 5, 
+    69, 217, 70, 25, 5, 214, 118, 217, 70, 25, 5, 76, 217, 70, 25, 5, 254, 
+    210, 217, 70, 25, 5, 78, 217, 70, 25, 5, 253, 200, 217, 70, 5, 213, 152, 
+    217, 70, 5, 227, 209, 217, 70, 21, 210, 86, 217, 70, 21, 111, 217, 70, 
+    21, 105, 217, 70, 21, 158, 217, 70, 21, 161, 217, 70, 21, 190, 217, 70, 
+    21, 195, 217, 70, 21, 199, 217, 70, 21, 196, 217, 70, 21, 201, 15, 5, 61, 
+    15, 5, 116, 30, 61, 15, 5, 116, 30, 252, 184, 15, 5, 116, 30, 243, 112, 
+    216, 240, 15, 5, 116, 30, 162, 15, 5, 116, 30, 236, 42, 15, 5, 116, 30, 
+    233, 122, 242, 101, 15, 5, 116, 30, 230, 66, 15, 5, 116, 30, 222, 23, 15, 
+    5, 255, 84, 15, 5, 255, 34, 15, 5, 255, 35, 30, 253, 237, 15, 5, 255, 35, 
+    30, 246, 75, 242, 101, 15, 5, 255, 35, 30, 243, 125, 15, 5, 255, 35, 30, 
+    243, 112, 216, 240, 15, 5, 255, 35, 30, 162, 15, 5, 255, 35, 30, 236, 43, 
+    242, 101, 15, 5, 255, 35, 30, 236, 16, 15, 5, 255, 35, 30, 233, 123, 15, 
+    5, 255, 35, 30, 220, 50, 15, 5, 255, 35, 30, 104, 96, 104, 96, 69, 15, 5, 
+    255, 35, 242, 101, 15, 5, 255, 32, 15, 5, 255, 33, 30, 252, 168, 15, 5, 
+    255, 33, 30, 243, 112, 216, 240, 15, 5, 255, 33, 30, 231, 97, 96, 245, 
+    158, 15, 5, 255, 33, 30, 220, 102, 15, 5, 255, 33, 30, 217, 73, 15, 5, 
+    255, 8, 15, 5, 254, 195, 15, 5, 254, 196, 30, 245, 95, 15, 5, 254, 196, 
+    30, 220, 12, 96, 242, 197, 15, 5, 254, 187, 15, 5, 254, 188, 30, 254, 
+    187, 15, 5, 254, 188, 30, 247, 224, 15, 5, 254, 188, 30, 242, 197, 15, 5, 
+    254, 188, 30, 162, 15, 5, 254, 188, 30, 235, 5, 15, 5, 254, 188, 30, 234, 
+    98, 15, 5, 254, 188, 30, 220, 65, 15, 5, 254, 188, 30, 214, 126, 15, 5, 
+    254, 184, 15, 5, 254, 177, 15, 5, 254, 140, 15, 5, 254, 141, 30, 220, 65, 
+    15, 5, 254, 131, 15, 5, 254, 132, 115, 254, 131, 15, 5, 254, 132, 134, 
+    216, 86, 15, 5, 254, 132, 96, 229, 222, 226, 168, 254, 132, 96, 229, 221, 
+    15, 5, 254, 132, 96, 229, 222, 218, 235, 15, 5, 254, 102, 15, 5, 254, 75, 
+    15, 5, 254, 43, 15, 5, 254, 44, 30, 233, 202, 15, 5, 254, 16, 15, 5, 253, 
+    244, 15, 5, 253, 239, 15, 5, 253, 240, 210, 40, 216, 240, 15, 5, 253, 
+    240, 235, 9, 216, 240, 15, 5, 253, 240, 115, 253, 240, 215, 115, 115, 
+    215, 115, 215, 115, 115, 215, 115, 226, 25, 15, 5, 253, 240, 115, 253, 
+    240, 115, 253, 239, 15, 5, 253, 240, 115, 253, 240, 115, 253, 240, 249, 
+    133, 253, 240, 115, 253, 240, 115, 253, 239, 15, 5, 253, 237, 15, 5, 253, 
+    234, 15, 5, 252, 199, 15, 5, 252, 184, 15, 5, 252, 179, 15, 5, 252, 175, 
+    15, 5, 252, 169, 15, 5, 252, 170, 115, 252, 169, 15, 5, 252, 168, 15, 5, 
+    130, 15, 5, 252, 148, 15, 5, 252, 14, 15, 5, 252, 15, 30, 61, 15, 5, 252, 
+    15, 30, 243, 103, 15, 5, 252, 15, 30, 236, 43, 242, 101, 15, 5, 251, 133, 
+    15, 5, 251, 134, 115, 251, 134, 255, 34, 15, 5, 251, 134, 115, 251, 134, 
+    214, 190, 15, 5, 251, 134, 249, 133, 251, 133, 15, 5, 251, 117, 15, 5, 
+    251, 118, 115, 251, 117, 15, 5, 251, 106, 15, 5, 251, 105, 15, 5, 248, 
+    229, 15, 5, 248, 220, 15, 5, 248, 221, 234, 72, 30, 116, 96, 231, 152, 
+    15, 5, 248, 221, 234, 72, 30, 254, 140, 15, 5, 248, 221, 234, 72, 30, 
+    252, 168, 15, 5, 248, 221, 234, 72, 30, 252, 14, 15, 5, 248, 221, 234, 
+    72, 30, 243, 142, 15, 5, 248, 221, 234, 72, 30, 243, 143, 96, 231, 152, 
+    15, 5, 248, 221, 234, 72, 30, 242, 221, 15, 5, 248, 221, 234, 72, 30, 
+    242, 204, 15, 5, 248, 221, 234, 72, 30, 242, 110, 15, 5, 248, 221, 234, 
+    72, 30, 162, 15, 5, 248, 221, 234, 72, 30, 235, 186, 15, 5, 248, 221, 
+    234, 72, 30, 235, 187, 96, 232, 103, 15, 5, 248, 221, 234, 72, 30, 234, 
+    248, 15, 5, 248, 221, 234, 72, 30, 233, 141, 15, 5, 248, 221, 234, 72, 
+    30, 232, 103, 15, 5, 248, 221, 234, 72, 30, 232, 104, 96, 231, 151, 15, 
+    5, 248, 221, 234, 72, 30, 232, 89, 15, 5, 248, 221, 234, 72, 30, 229, 
+    112, 15, 5, 248, 221, 234, 72, 30, 226, 26, 96, 226, 25, 15, 5, 248, 221, 
+    234, 72, 30, 219, 193, 15, 5, 248, 221, 234, 72, 30, 217, 73, 15, 5, 248, 
+    221, 234, 72, 30, 214, 231, 96, 242, 204, 15, 5, 248, 221, 234, 72, 30, 
+    214, 126, 15, 5, 248, 195, 15, 5, 248, 174, 15, 5, 248, 173, 15, 5, 248, 
+    172, 15, 5, 248, 11, 15, 5, 247, 250, 15, 5, 247, 225, 15, 5, 247, 226, 
+    30, 220, 65, 15, 5, 247, 224, 15, 5, 247, 214, 15, 5, 247, 215, 234, 214, 
+    104, 242, 102, 247, 195, 15, 5, 247, 195, 15, 5, 246, 86, 15, 5, 246, 87, 
+    115, 246, 86, 15, 5, 246, 87, 242, 101, 15, 5, 246, 87, 220, 47, 15, 5, 
+    246, 84, 15, 5, 246, 85, 30, 245, 80, 15, 5, 246, 83, 15, 5, 246, 82, 15, 
+    5, 246, 81, 15, 5, 246, 80, 15, 5, 246, 76, 15, 5, 246, 74, 15, 5, 246, 
+    75, 242, 101, 15, 5, 246, 75, 242, 102, 242, 101, 15, 5, 246, 73, 15, 5, 
+    246, 66, 15, 5, 76, 15, 5, 160, 30, 226, 25, 15, 5, 160, 115, 160, 227, 
+    199, 115, 227, 198, 15, 5, 245, 242, 15, 5, 245, 243, 30, 116, 96, 242, 
+    56, 96, 248, 229, 15, 5, 245, 243, 30, 243, 103, 15, 5, 245, 243, 30, 
+    230, 235, 15, 5, 245, 243, 30, 222, 10, 15, 5, 245, 243, 30, 220, 65, 15, 
+    5, 245, 243, 30, 69, 15, 5, 245, 219, 15, 5, 245, 208, 15, 5, 245, 182, 
+    15, 5, 245, 158, 15, 5, 245, 159, 30, 243, 111, 15, 5, 245, 159, 30, 243, 
+    112, 216, 240, 15, 5, 245, 159, 30, 231, 96, 15, 5, 245, 159, 249, 133, 
+    245, 158, 15, 5, 245, 159, 226, 168, 245, 158, 15, 5, 245, 159, 218, 235, 
+    15, 5, 245, 97, 15, 5, 245, 95, 15, 5, 245, 80, 15, 5, 245, 18, 15, 5, 
+    245, 19, 30, 61, 15, 5, 245, 19, 30, 116, 96, 233, 110, 15, 5, 245, 19, 
+    30, 116, 96, 233, 111, 30, 233, 110, 15, 5, 245, 19, 30, 254, 131, 15, 5, 
+    245, 19, 30, 252, 184, 15, 5, 245, 19, 30, 246, 75, 242, 101, 15, 5, 245, 
+    19, 30, 246, 75, 242, 102, 242, 101, 15, 5, 245, 19, 30, 162, 15, 5, 245, 
+    19, 30, 242, 56, 242, 101, 15, 5, 245, 19, 30, 236, 43, 242, 101, 15, 5, 
+    245, 19, 30, 234, 213, 15, 5, 245, 19, 30, 234, 214, 218, 235, 15, 5, 
+    245, 19, 30, 233, 221, 15, 5, 245, 19, 30, 233, 141, 15, 5, 245, 19, 30, 
+    233, 111, 30, 233, 110, 15, 5, 245, 19, 30, 232, 247, 15, 5, 245, 19, 30, 
+    232, 103, 15, 5, 245, 19, 30, 214, 230, 15, 5, 245, 19, 30, 214, 219, 15, 
+    5, 243, 142, 15, 5, 243, 143, 242, 101, 15, 5, 243, 140, 15, 5, 243, 141, 
+    30, 116, 96, 248, 230, 96, 162, 15, 5, 243, 141, 30, 116, 96, 162, 15, 5, 
+    243, 141, 30, 116, 96, 236, 42, 15, 5, 243, 141, 30, 255, 33, 216, 241, 
+    96, 217, 94, 15, 5, 243, 141, 30, 254, 131, 15, 5, 243, 141, 30, 253, 
+    239, 15, 5, 243, 141, 30, 253, 238, 96, 243, 125, 15, 5, 243, 141, 30, 
+    252, 184, 15, 5, 243, 141, 30, 252, 149, 96, 205, 15, 5, 243, 141, 30, 
+    251, 106, 15, 5, 243, 141, 30, 251, 107, 96, 205, 15, 5, 243, 141, 30, 
+    248, 229, 15, 5, 243, 141, 30, 248, 11, 15, 5, 243, 141, 30, 247, 226, 
+    30, 220, 65, 15, 5, 243, 141, 30, 246, 84, 15, 5, 243, 141, 30, 245, 182, 
+    15, 5, 243, 141, 30, 245, 183, 96, 233, 141, 15, 5, 243, 141, 30, 245, 
+    158, 15, 5, 243, 141, 30, 245, 159, 30, 243, 112, 216, 240, 15, 5, 243, 
+    141, 30, 243, 112, 216, 240, 15, 5, 243, 141, 30, 243, 103, 15, 5, 243, 
+    141, 30, 242, 221, 15, 5, 243, 141, 30, 242, 219, 15, 5, 243, 141, 30, 
+    242, 220, 96, 61, 15, 5, 243, 141, 30, 242, 205, 96, 218, 84, 15, 5, 243, 
+    141, 30, 242, 56, 96, 232, 104, 96, 245, 80, 15, 5, 243, 141, 30, 242, 
+    37, 15, 5, 243, 141, 30, 242, 38, 96, 233, 141, 15, 5, 243, 141, 30, 241, 
+    188, 96, 232, 247, 15, 5, 243, 141, 30, 240, 225, 15, 5, 243, 141, 30, 
+    236, 43, 242, 101, 15, 5, 243, 141, 30, 235, 173, 96, 240, 230, 96, 253, 
+    239, 15, 5, 243, 141, 30, 234, 248, 15, 5, 243, 141, 30, 234, 213, 15, 5, 
+    243, 141, 30, 234, 95, 15, 5, 243, 141, 30, 234, 96, 96, 233, 110, 15, 5, 
+    243, 141, 30, 233, 222, 96, 254, 131, 15, 5, 243, 141, 30, 233, 141, 15, 
+    5, 243, 141, 30, 231, 97, 96, 245, 158, 15, 5, 243, 141, 30, 230, 235, 
+    15, 5, 243, 141, 30, 227, 198, 15, 5, 243, 141, 30, 227, 199, 115, 227, 
+    198, 15, 5, 243, 141, 30, 191, 15, 5, 243, 141, 30, 222, 10, 15, 5, 243, 
+    141, 30, 221, 233, 15, 5, 243, 141, 30, 220, 65, 15, 5, 243, 141, 30, 
+    220, 66, 96, 215, 99, 15, 5, 243, 141, 30, 220, 32, 15, 5, 243, 141, 30, 
+    218, 44, 15, 5, 243, 141, 30, 217, 73, 15, 5, 243, 141, 30, 69, 15, 5, 
+    243, 141, 30, 214, 219, 15, 5, 243, 141, 30, 214, 220, 96, 246, 86, 15, 
+    5, 243, 141, 115, 243, 140, 15, 5, 243, 135, 15, 5, 243, 136, 249, 133, 
+    243, 135, 15, 5, 243, 133, 15, 5, 243, 134, 115, 243, 134, 243, 104, 115, 
+    243, 103, 15, 5, 243, 125, 15, 5, 243, 126, 243, 134, 115, 243, 134, 243, 
+    104, 115, 243, 103, 15, 5, 243, 124, 15, 5, 243, 122, 15, 5, 243, 113, 
+    15, 5, 243, 111, 15, 5, 243, 112, 216, 240, 15, 5, 243, 112, 115, 243, 
+    111, 15, 5, 243, 112, 249, 133, 243, 111, 15, 5, 243, 103, 15, 5, 243, 
+    102, 15, 5, 243, 97, 15, 5, 243, 43, 15, 5, 243, 44, 30, 233, 202, 15, 5, 
+    242, 221, 15, 5, 242, 222, 30, 76, 15, 5, 242, 222, 30, 69, 15, 5, 242, 
+    222, 249, 133, 242, 221, 15, 5, 242, 219, 15, 5, 242, 220, 115, 242, 219, 
+    15, 5, 242, 220, 249, 133, 242, 219, 15, 5, 242, 216, 15, 5, 242, 204, 
+    15, 5, 242, 205, 242, 101, 15, 5, 242, 202, 15, 5, 242, 203, 30, 116, 96, 
+    236, 42, 15, 5, 242, 203, 30, 243, 112, 216, 240, 15, 5, 242, 203, 30, 
+    236, 42, 15, 5, 242, 203, 30, 232, 104, 96, 236, 42, 15, 5, 242, 203, 30, 
+    191, 15, 5, 242, 199, 15, 5, 242, 197, 15, 5, 242, 198, 249, 133, 242, 
+    197, 15, 5, 242, 198, 30, 252, 184, 15, 5, 242, 198, 30, 217, 73, 15, 5, 
+    242, 198, 216, 240, 15, 5, 242, 120, 15, 5, 242, 121, 249, 133, 242, 120, 
+    15, 5, 242, 118, 15, 5, 242, 119, 30, 234, 248, 15, 5, 242, 119, 30, 234, 
+    249, 30, 236, 43, 242, 101, 15, 5, 242, 119, 30, 227, 198, 15, 5, 242, 
+    119, 30, 222, 11, 96, 215, 114, 15, 5, 242, 119, 242, 101, 15, 5, 242, 
+    110, 15, 5, 242, 111, 30, 116, 96, 233, 202, 15, 5, 242, 111, 30, 233, 
+    202, 15, 5, 242, 111, 115, 242, 111, 232, 96, 15, 5, 242, 105, 15, 5, 
+    242, 103, 15, 5, 242, 104, 30, 220, 65, 15, 5, 242, 95, 15, 5, 242, 94, 
+    15, 5, 242, 91, 15, 5, 242, 90, 15, 5, 162, 15, 5, 242, 56, 216, 240, 15, 
+    5, 242, 56, 242, 101, 15, 5, 242, 37, 15, 5, 241, 187, 15, 5, 241, 188, 
+    30, 253, 239, 15, 5, 241, 188, 30, 253, 237, 15, 5, 241, 188, 30, 252, 
+    184, 15, 5, 241, 188, 30, 247, 195, 15, 5, 241, 188, 30, 243, 133, 15, 5, 
+    241, 188, 30, 234, 87, 15, 5, 241, 188, 30, 227, 198, 15, 5, 241, 188, 
+    30, 220, 65, 15, 5, 241, 188, 30, 69, 15, 5, 240, 229, 15, 5, 240, 225, 
+    15, 5, 240, 226, 30, 254, 131, 15, 5, 240, 226, 30, 242, 37, 15, 5, 240, 
+    226, 30, 234, 213, 15, 5, 240, 226, 30, 232, 203, 15, 5, 240, 226, 30, 
+    214, 219, 15, 5, 240, 222, 15, 5, 74, 15, 5, 240, 161, 61, 15, 5, 240, 
+    122, 15, 5, 236, 70, 15, 5, 236, 71, 115, 236, 71, 251, 106, 15, 5, 236, 
+    71, 115, 236, 71, 218, 235, 15, 5, 236, 45, 15, 5, 236, 42, 15, 5, 236, 
+    43, 247, 250, 15, 5, 236, 43, 223, 38, 15, 5, 236, 43, 115, 236, 43, 220, 
+    16, 115, 220, 16, 214, 220, 115, 214, 219, 15, 5, 236, 43, 242, 101, 15, 
+    5, 236, 34, 15, 5, 236, 35, 30, 243, 112, 216, 240, 15, 5, 236, 33, 15, 
+    5, 236, 23, 15, 5, 236, 24, 30, 217, 73, 15, 5, 236, 24, 249, 133, 236, 
+    23, 15, 5, 236, 24, 226, 168, 236, 23, 15, 5, 236, 24, 218, 235, 15, 5, 
+    236, 16, 15, 5, 236, 6, 15, 5, 235, 186, 15, 5, 235, 172, 15, 5, 176, 15, 
+    5, 235, 19, 30, 61, 15, 5, 235, 19, 30, 255, 8, 15, 5, 235, 19, 30, 255, 
+    9, 96, 233, 221, 15, 5, 235, 19, 30, 253, 237, 15, 5, 235, 19, 30, 252, 
+    184, 15, 5, 235, 19, 30, 252, 168, 15, 5, 235, 19, 30, 130, 15, 5, 235, 
+    19, 30, 252, 14, 15, 5, 235, 19, 30, 245, 95, 15, 5, 235, 19, 30, 245, 
+    80, 15, 5, 235, 19, 30, 243, 142, 15, 5, 235, 19, 30, 243, 125, 15, 5, 
+    235, 19, 30, 243, 112, 216, 240, 15, 5, 235, 19, 30, 243, 103, 15, 5, 
+    235, 19, 30, 243, 104, 96, 220, 103, 96, 61, 15, 5, 235, 19, 30, 242, 
+    221, 15, 5, 235, 19, 30, 242, 204, 15, 5, 235, 19, 30, 242, 198, 96, 221, 
+    233, 15, 5, 235, 19, 30, 242, 198, 249, 133, 242, 197, 15, 5, 235, 19, 
+    30, 242, 120, 15, 5, 235, 19, 30, 242, 94, 15, 5, 235, 19, 30, 236, 42, 
+    15, 5, 235, 19, 30, 236, 23, 15, 5, 235, 19, 30, 234, 248, 15, 5, 235, 
+    19, 30, 234, 98, 15, 5, 235, 19, 30, 234, 95, 15, 5, 235, 19, 30, 232, 
+    247, 15, 5, 235, 19, 30, 232, 103, 15, 5, 235, 19, 30, 231, 96, 15, 5, 
+    235, 19, 30, 231, 97, 96, 246, 86, 15, 5, 235, 19, 30, 231, 97, 96, 242, 
+    221, 15, 5, 235, 19, 30, 231, 97, 96, 217, 23, 15, 5, 235, 19, 30, 230, 
+    235, 15, 5, 235, 19, 30, 230, 236, 96, 227, 193, 15, 5, 235, 19, 30, 229, 
+    112, 15, 5, 235, 19, 30, 227, 198, 15, 5, 235, 19, 30, 225, 111, 15, 5, 
+    235, 19, 30, 222, 142, 15, 5, 235, 19, 30, 206, 15, 5, 235, 19, 30, 221, 
+    233, 15, 5, 235, 19, 30, 220, 104, 15, 5, 235, 19, 30, 220, 65, 15, 5, 
+    235, 19, 30, 220, 32, 15, 5, 235, 19, 30, 219, 227, 15, 5, 235, 19, 30, 
+    219, 184, 15, 5, 235, 19, 30, 218, 52, 15, 5, 235, 19, 30, 217, 51, 15, 
+    5, 235, 19, 30, 69, 15, 5, 235, 19, 30, 214, 230, 15, 5, 235, 19, 30, 
+    214, 219, 15, 5, 235, 19, 30, 214, 193, 30, 191, 15, 5, 235, 19, 30, 214, 
+    126, 15, 5, 235, 19, 30, 210, 44, 15, 5, 235, 17, 15, 5, 235, 18, 249, 
+    133, 235, 17, 15, 5, 235, 10, 15, 5, 235, 7, 15, 5, 235, 5, 15, 5, 235, 
+    4, 15, 5, 235, 2, 15, 5, 235, 3, 115, 235, 2, 15, 5, 234, 248, 15, 5, 
+    234, 249, 30, 236, 43, 242, 101, 15, 5, 234, 244, 15, 5, 234, 245, 30, 
+    252, 184, 15, 5, 234, 245, 249, 133, 234, 244, 15, 5, 234, 242, 15, 5, 
+    234, 241, 15, 5, 234, 213, 15, 5, 234, 214, 233, 124, 30, 104, 115, 233, 
+    124, 30, 69, 15, 5, 234, 214, 115, 234, 214, 233, 124, 30, 104, 115, 233, 
+    124, 30, 69, 15, 5, 234, 163, 15, 5, 234, 98, 15, 5, 234, 99, 30, 252, 
+    184, 15, 5, 234, 99, 30, 69, 15, 5, 234, 99, 30, 214, 219, 15, 5, 234, 
+    95, 15, 5, 234, 87, 15, 5, 234, 74, 15, 5, 234, 73, 15, 5, 234, 71, 15, 
+    5, 234, 72, 115, 234, 71, 15, 5, 233, 223, 15, 5, 233, 224, 115, 241, 
+    188, 30, 253, 238, 233, 224, 115, 241, 188, 30, 253, 237, 15, 5, 233, 
+    221, 15, 5, 233, 219, 15, 5, 233, 220, 214, 12, 17, 15, 5, 233, 218, 15, 
+    5, 233, 215, 15, 5, 233, 216, 242, 101, 15, 5, 233, 214, 15, 5, 233, 202, 
+    15, 5, 233, 203, 226, 168, 233, 202, 15, 5, 233, 197, 15, 5, 233, 178, 
+    15, 5, 233, 141, 15, 5, 233, 123, 15, 5, 233, 124, 30, 61, 15, 5, 233, 
+    124, 30, 116, 96, 248, 230, 96, 162, 15, 5, 233, 124, 30, 116, 96, 243, 
+    103, 15, 5, 233, 124, 30, 116, 96, 233, 110, 15, 5, 233, 124, 30, 254, 
+    187, 15, 5, 233, 124, 30, 254, 131, 15, 5, 233, 124, 30, 253, 240, 210, 
+    40, 216, 240, 15, 5, 233, 124, 30, 252, 184, 15, 5, 233, 124, 30, 252, 
+    14, 15, 5, 233, 124, 30, 248, 174, 15, 5, 233, 124, 30, 245, 158, 15, 5, 
+    233, 124, 30, 243, 142, 15, 5, 233, 124, 30, 243, 103, 15, 5, 233, 124, 
+    30, 242, 110, 15, 5, 233, 124, 30, 242, 111, 96, 242, 110, 15, 5, 233, 
+    124, 30, 162, 15, 5, 233, 124, 30, 242, 37, 15, 5, 233, 124, 30, 241, 
+    188, 30, 227, 198, 15, 5, 233, 124, 30, 236, 43, 242, 101, 15, 5, 233, 
+    124, 30, 236, 23, 15, 5, 233, 124, 30, 236, 24, 96, 162, 15, 5, 233, 124, 
+    30, 236, 24, 96, 232, 103, 15, 5, 233, 124, 30, 234, 98, 15, 5, 233, 124, 
+    30, 234, 87, 15, 5, 233, 124, 30, 233, 221, 15, 5, 233, 124, 30, 233, 
+    215, 15, 5, 233, 124, 30, 233, 216, 96, 241, 188, 96, 61, 15, 5, 233, 
+    124, 30, 233, 123, 15, 5, 233, 124, 30, 232, 203, 15, 5, 233, 124, 30, 
+    232, 103, 15, 5, 233, 124, 30, 232, 91, 15, 5, 233, 124, 30, 231, 96, 15, 
+    5, 233, 124, 30, 231, 97, 96, 245, 158, 15, 5, 233, 124, 30, 230, 66, 15, 
+    5, 233, 124, 30, 229, 112, 15, 5, 233, 124, 30, 220, 66, 96, 218, 44, 15, 
+    5, 233, 124, 30, 220, 12, 96, 242, 198, 96, 245, 95, 15, 5, 233, 124, 30, 
+    220, 12, 96, 242, 198, 216, 240, 15, 5, 233, 124, 30, 219, 225, 15, 5, 
+    233, 124, 30, 219, 226, 96, 219, 225, 15, 5, 233, 124, 30, 218, 44, 15, 
+    5, 233, 124, 30, 217, 85, 15, 5, 233, 124, 30, 217, 73, 15, 5, 233, 124, 
+    30, 217, 24, 96, 116, 96, 218, 85, 96, 198, 15, 5, 233, 124, 30, 69, 15, 
+    5, 233, 124, 30, 104, 96, 61, 15, 5, 233, 124, 30, 104, 96, 104, 96, 69, 
+    15, 5, 233, 124, 30, 214, 231, 96, 253, 239, 15, 5, 233, 124, 30, 214, 
+    219, 15, 5, 233, 124, 30, 214, 126, 15, 5, 233, 124, 218, 235, 15, 5, 
+    233, 121, 15, 5, 233, 122, 30, 220, 65, 15, 5, 233, 122, 30, 220, 66, 96, 
+    218, 44, 15, 5, 233, 122, 242, 101, 15, 5, 233, 122, 242, 102, 115, 233, 
+    122, 242, 102, 220, 65, 15, 5, 233, 117, 15, 5, 233, 110, 15, 5, 233, 
+    111, 30, 233, 110, 15, 5, 233, 108, 15, 5, 233, 109, 30, 233, 202, 15, 5, 
+    233, 109, 30, 233, 203, 96, 222, 142, 15, 5, 232, 247, 15, 5, 232, 232, 
+    15, 5, 232, 222, 15, 5, 232, 203, 15, 5, 232, 103, 15, 5, 232, 104, 30, 
+    252, 184, 15, 5, 232, 101, 15, 5, 232, 102, 30, 254, 187, 15, 5, 232, 
+    102, 30, 252, 184, 15, 5, 232, 102, 30, 245, 80, 15, 5, 232, 102, 30, 
+    245, 81, 216, 240, 15, 5, 232, 102, 30, 243, 112, 216, 240, 15, 5, 232, 
+    102, 30, 241, 188, 30, 252, 184, 15, 5, 232, 102, 30, 236, 23, 15, 5, 
+    232, 102, 30, 235, 7, 15, 5, 232, 102, 30, 235, 5, 15, 5, 232, 102, 30, 
+    235, 6, 96, 253, 239, 15, 5, 232, 102, 30, 234, 98, 15, 5, 232, 102, 30, 
+    233, 142, 96, 253, 239, 15, 5, 232, 102, 30, 233, 123, 15, 5, 232, 102, 
+    30, 231, 97, 96, 245, 158, 15, 5, 232, 102, 30, 229, 112, 15, 5, 232, 
+    102, 30, 227, 242, 15, 5, 232, 102, 30, 219, 194, 96, 253, 239, 15, 5, 
+    232, 102, 30, 219, 176, 96, 251, 133, 15, 5, 232, 102, 30, 215, 114, 15, 
+    5, 232, 102, 216, 240, 15, 5, 232, 102, 249, 133, 232, 101, 15, 5, 232, 
+    102, 226, 168, 232, 101, 15, 5, 232, 102, 218, 235, 15, 5, 232, 102, 220, 
+    47, 15, 5, 232, 100, 15, 5, 232, 96, 15, 5, 232, 97, 115, 232, 96, 15, 5, 
+    232, 97, 226, 168, 232, 96, 15, 5, 232, 97, 220, 47, 15, 5, 232, 94, 15, 
+    5, 232, 91, 15, 5, 232, 89, 15, 5, 232, 90, 115, 232, 89, 15, 5, 232, 90, 
+    115, 232, 90, 243, 104, 115, 243, 103, 15, 5, 186, 15, 5, 231, 244, 30, 
+    217, 73, 15, 5, 231, 244, 242, 101, 15, 5, 231, 243, 15, 5, 231, 215, 15, 
+    5, 231, 171, 15, 5, 231, 152, 15, 5, 231, 151, 15, 5, 231, 96, 15, 5, 
+    231, 52, 15, 5, 230, 235, 15, 5, 230, 193, 15, 5, 230, 107, 15, 5, 230, 
+    108, 115, 230, 107, 15, 5, 230, 98, 15, 5, 230, 99, 242, 101, 15, 5, 230, 
+    83, 15, 5, 230, 69, 15, 5, 230, 66, 15, 5, 230, 67, 30, 61, 15, 5, 230, 
+    67, 30, 233, 202, 15, 5, 230, 67, 30, 210, 116, 15, 5, 230, 67, 115, 230, 
+    66, 15, 5, 230, 67, 115, 230, 67, 30, 116, 96, 198, 15, 5, 230, 67, 249, 
+    133, 230, 66, 15, 5, 230, 64, 15, 5, 230, 65, 30, 61, 15, 5, 230, 65, 30, 
+    116, 96, 248, 11, 15, 5, 230, 65, 30, 248, 11, 15, 5, 230, 65, 242, 101, 
+    15, 5, 198, 15, 5, 229, 232, 15, 5, 229, 221, 15, 5, 229, 222, 235, 199, 
+    15, 5, 229, 222, 30, 219, 228, 216, 240, 15, 5, 229, 222, 226, 168, 229, 
+    221, 15, 5, 229, 220, 15, 5, 229, 213, 227, 184, 15, 5, 229, 212, 15, 5, 
+    229, 211, 15, 5, 229, 112, 15, 5, 229, 113, 30, 61, 15, 5, 229, 113, 30, 
+    214, 219, 15, 5, 229, 113, 220, 47, 15, 5, 228, 238, 15, 5, 228, 239, 30, 
+    76, 15, 5, 228, 237, 15, 5, 228, 208, 15, 5, 228, 209, 30, 243, 112, 216, 
+    240, 15, 5, 228, 209, 30, 243, 104, 96, 243, 112, 216, 240, 15, 5, 228, 
+    206, 15, 5, 228, 207, 30, 254, 131, 15, 5, 228, 207, 30, 253, 239, 15, 5, 
+    228, 207, 30, 253, 240, 96, 253, 239, 15, 5, 228, 207, 30, 242, 110, 15, 
+    5, 228, 207, 30, 231, 97, 96, 243, 112, 216, 240, 15, 5, 228, 207, 30, 
+    229, 112, 15, 5, 228, 207, 30, 227, 198, 15, 5, 228, 207, 30, 220, 65, 
+    15, 5, 228, 207, 30, 220, 66, 96, 116, 254, 131, 15, 5, 228, 207, 30, 
+    220, 66, 96, 253, 239, 15, 5, 228, 207, 30, 220, 66, 96, 253, 240, 96, 
+    253, 239, 15, 5, 228, 207, 30, 214, 231, 96, 253, 239, 15, 5, 228, 207, 
+    30, 214, 126, 15, 5, 228, 195, 15, 5, 227, 242, 15, 5, 227, 214, 15, 5, 
+    227, 198, 15, 5, 227, 199, 233, 122, 30, 243, 103, 15, 5, 227, 199, 233, 
+    122, 30, 231, 152, 15, 5, 227, 199, 233, 122, 30, 222, 10, 15, 5, 227, 
+    199, 233, 122, 30, 222, 11, 115, 227, 199, 233, 122, 30, 222, 10, 15, 5, 
+    227, 199, 233, 122, 30, 214, 126, 15, 5, 227, 199, 216, 240, 15, 5, 227, 
+    199, 115, 227, 198, 15, 5, 227, 199, 249, 133, 227, 198, 15, 5, 227, 199, 
+    249, 133, 227, 199, 233, 122, 115, 233, 121, 15, 5, 227, 193, 15, 5, 227, 
+    194, 255, 33, 30, 253, 234, 15, 5, 227, 194, 255, 33, 30, 252, 14, 15, 5, 
+    227, 194, 255, 33, 30, 246, 82, 15, 5, 227, 194, 255, 33, 30, 242, 110, 
+    15, 5, 227, 194, 255, 33, 30, 236, 43, 242, 101, 15, 5, 227, 194, 255, 
+    33, 30, 235, 5, 15, 5, 227, 194, 255, 33, 30, 233, 141, 15, 5, 227, 194, 
+    255, 33, 30, 229, 112, 15, 5, 227, 194, 255, 33, 30, 219, 173, 15, 5, 
+    227, 194, 255, 33, 30, 214, 230, 15, 5, 227, 194, 234, 72, 30, 252, 14, 
+    15, 5, 227, 194, 234, 72, 30, 252, 15, 69, 15, 5, 191, 15, 5, 226, 84, 
+    15, 5, 226, 51, 15, 5, 226, 25, 15, 5, 225, 164, 15, 5, 225, 111, 15, 5, 
+    225, 112, 30, 61, 15, 5, 225, 112, 30, 255, 34, 15, 5, 225, 112, 30, 252, 
+    14, 15, 5, 225, 112, 30, 251, 133, 15, 5, 225, 112, 30, 76, 15, 5, 225, 
+    112, 30, 74, 15, 5, 225, 112, 30, 240, 122, 15, 5, 225, 112, 30, 69, 15, 
+    5, 225, 112, 30, 214, 230, 15, 5, 225, 112, 249, 133, 225, 111, 15, 5, 
+    225, 56, 15, 5, 225, 57, 30, 234, 244, 15, 5, 225, 57, 30, 214, 219, 15, 
+    5, 225, 57, 30, 210, 116, 15, 5, 225, 57, 226, 168, 225, 56, 15, 5, 205, 
+    15, 5, 223, 185, 15, 5, 223, 38, 15, 5, 222, 142, 15, 5, 206, 15, 5, 222, 
+    24, 227, 184, 15, 5, 222, 23, 15, 5, 222, 24, 30, 61, 15, 5, 222, 24, 30, 
+    246, 86, 15, 5, 222, 24, 30, 246, 84, 15, 5, 222, 24, 30, 162, 15, 5, 
+    222, 24, 30, 234, 248, 15, 5, 222, 24, 30, 233, 202, 15, 5, 222, 24, 30, 
+    232, 89, 15, 5, 222, 24, 30, 230, 235, 15, 5, 222, 24, 30, 227, 198, 15, 
+    5, 222, 24, 30, 222, 10, 15, 5, 222, 24, 30, 220, 32, 15, 5, 222, 24, 30, 
+    217, 94, 15, 5, 222, 24, 30, 214, 230, 15, 5, 222, 24, 30, 214, 225, 15, 
+    5, 222, 24, 30, 214, 197, 15, 5, 222, 24, 30, 214, 150, 15, 5, 222, 24, 
+    30, 214, 126, 15, 5, 222, 24, 115, 222, 23, 15, 5, 222, 24, 242, 101, 15, 
+    5, 222, 10, 15, 5, 222, 11, 233, 124, 30, 253, 237, 15, 5, 221, 241, 15, 
+    5, 221, 233, 15, 5, 220, 104, 15, 5, 220, 102, 15, 5, 220, 103, 30, 61, 
+    15, 5, 220, 103, 30, 252, 184, 15, 5, 220, 103, 30, 242, 197, 15, 5, 220, 
+    103, 30, 229, 112, 15, 5, 220, 103, 30, 219, 225, 15, 5, 220, 103, 30, 
+    215, 99, 15, 5, 220, 103, 30, 69, 15, 5, 220, 103, 30, 104, 96, 61, 15, 
+    5, 220, 101, 15, 5, 220, 99, 15, 5, 220, 80, 15, 5, 220, 65, 15, 5, 220, 
+    66, 240, 229, 15, 5, 220, 66, 115, 220, 66, 243, 134, 115, 243, 134, 243, 
+    104, 115, 243, 103, 15, 5, 220, 66, 115, 220, 66, 217, 95, 115, 217, 95, 
+    243, 104, 115, 243, 103, 15, 5, 220, 58, 15, 5, 220, 53, 15, 5, 220, 50, 
+    15, 5, 220, 49, 15, 5, 220, 46, 15, 5, 220, 32, 15, 5, 220, 33, 30, 61, 
+    15, 5, 220, 33, 30, 236, 23, 15, 5, 220, 26, 15, 5, 220, 27, 30, 61, 15, 
+    5, 220, 27, 30, 252, 169, 15, 5, 220, 27, 30, 251, 117, 15, 5, 220, 27, 
+    30, 247, 214, 15, 5, 220, 27, 30, 243, 103, 15, 5, 220, 27, 30, 236, 42, 
+    15, 5, 220, 27, 30, 236, 43, 242, 101, 15, 5, 220, 27, 30, 233, 197, 15, 
+    5, 220, 27, 30, 232, 91, 15, 5, 220, 27, 30, 230, 98, 15, 5, 220, 27, 30, 
+    222, 10, 15, 5, 220, 20, 15, 5, 220, 15, 15, 5, 220, 16, 216, 240, 15, 5, 
+    220, 16, 115, 220, 16, 251, 107, 115, 251, 106, 15, 5, 220, 11, 15, 5, 
+    219, 227, 15, 5, 219, 228, 115, 235, 200, 219, 227, 15, 5, 219, 225, 15, 
+    5, 219, 224, 15, 5, 219, 193, 15, 5, 219, 194, 242, 101, 15, 5, 219, 184, 
+    15, 5, 219, 182, 15, 5, 219, 183, 115, 219, 183, 219, 225, 15, 5, 219, 
+    175, 15, 5, 219, 173, 15, 5, 218, 84, 15, 5, 218, 85, 115, 218, 84, 15, 
+    5, 218, 55, 15, 5, 218, 54, 15, 5, 218, 52, 15, 5, 218, 44, 15, 5, 218, 
+    43, 15, 5, 218, 18, 15, 5, 218, 17, 15, 5, 217, 106, 15, 5, 217, 107, 
+    253, 224, 15, 5, 217, 107, 30, 241, 187, 15, 5, 217, 107, 30, 230, 235, 
+    15, 5, 217, 107, 242, 101, 15, 5, 217, 94, 15, 5, 217, 95, 115, 217, 95, 
+    228, 239, 115, 228, 239, 247, 196, 115, 247, 195, 15, 5, 217, 95, 218, 
+    235, 15, 5, 217, 85, 15, 5, 129, 30, 252, 14, 15, 5, 129, 30, 242, 110, 
+    15, 5, 129, 30, 220, 65, 15, 5, 129, 30, 219, 227, 15, 5, 129, 30, 215, 
+    114, 15, 5, 129, 30, 214, 219, 15, 5, 217, 73, 15, 5, 217, 51, 15, 5, 
+    217, 23, 15, 5, 217, 24, 242, 101, 15, 5, 216, 118, 15, 5, 216, 119, 216, 
+    240, 15, 5, 216, 91, 15, 5, 216, 73, 15, 5, 216, 74, 30, 217, 73, 15, 5, 
+    216, 74, 115, 216, 73, 15, 5, 216, 74, 115, 216, 74, 243, 134, 115, 243, 
+    134, 243, 104, 115, 243, 103, 15, 5, 215, 119, 15, 5, 215, 114, 15, 5, 
+    215, 112, 15, 5, 215, 109, 15, 5, 215, 99, 15, 5, 215, 100, 115, 215, 
+    100, 210, 117, 115, 210, 116, 15, 5, 69, 15, 5, 104, 242, 110, 15, 5, 
+    104, 104, 69, 15, 5, 104, 115, 104, 226, 94, 115, 226, 94, 243, 104, 115, 
+    243, 103, 15, 5, 104, 115, 104, 218, 19, 115, 218, 18, 15, 5, 104, 115, 
+    104, 104, 223, 52, 115, 104, 223, 51, 15, 5, 214, 230, 15, 5, 214, 225, 
+    15, 5, 214, 219, 15, 5, 214, 220, 233, 197, 15, 5, 214, 220, 30, 252, 
+    184, 15, 5, 214, 220, 30, 230, 235, 15, 5, 214, 220, 30, 104, 96, 104, 
+    96, 69, 15, 5, 214, 220, 30, 104, 96, 104, 96, 104, 242, 101, 15, 5, 214, 
+    220, 242, 101, 15, 5, 214, 220, 220, 47, 15, 5, 214, 220, 220, 48, 30, 
+    252, 184, 15, 5, 214, 215, 15, 5, 214, 197, 15, 5, 214, 198, 30, 233, 
+    123, 15, 5, 214, 198, 30, 231, 97, 96, 248, 229, 15, 5, 214, 198, 30, 
+    220, 102, 15, 5, 214, 198, 30, 69, 15, 5, 214, 196, 15, 5, 214, 192, 15, 
+    5, 214, 193, 30, 234, 213, 15, 5, 214, 193, 30, 191, 15, 5, 214, 190, 15, 
+    5, 214, 191, 242, 101, 15, 5, 214, 150, 15, 5, 214, 151, 249, 133, 214, 
+    150, 15, 5, 214, 151, 220, 47, 15, 5, 214, 148, 15, 5, 214, 149, 30, 116, 
+    96, 162, 15, 5, 214, 149, 30, 116, 96, 198, 15, 5, 214, 149, 30, 254, 
+    187, 15, 5, 214, 149, 30, 162, 15, 5, 214, 149, 30, 227, 198, 15, 5, 214, 
+    149, 30, 214, 230, 15, 5, 214, 149, 30, 214, 231, 96, 253, 239, 15, 5, 
+    214, 149, 30, 214, 231, 96, 252, 14, 15, 5, 214, 147, 15, 5, 214, 144, 
+    15, 5, 214, 143, 15, 5, 214, 139, 15, 5, 214, 140, 30, 61, 15, 5, 214, 
+    140, 30, 253, 234, 15, 5, 214, 140, 30, 130, 15, 5, 214, 140, 30, 246, 
+    76, 15, 5, 214, 140, 30, 243, 142, 15, 5, 214, 140, 30, 243, 125, 15, 5, 
+    214, 140, 30, 243, 112, 216, 240, 15, 5, 214, 140, 30, 243, 103, 15, 5, 
+    214, 140, 30, 242, 120, 15, 5, 214, 140, 30, 162, 15, 5, 214, 140, 30, 
+    236, 42, 15, 5, 214, 140, 30, 236, 23, 15, 5, 214, 140, 30, 235, 172, 15, 
+    5, 214, 140, 30, 234, 98, 15, 5, 214, 140, 30, 232, 89, 15, 5, 214, 140, 
+    30, 230, 193, 15, 5, 214, 140, 30, 191, 15, 5, 214, 140, 30, 220, 65, 15, 
+    5, 214, 140, 30, 219, 182, 15, 5, 214, 140, 30, 215, 119, 15, 5, 214, 
+    140, 30, 104, 96, 242, 110, 15, 5, 214, 140, 30, 214, 219, 15, 5, 214, 
+    140, 30, 214, 137, 15, 5, 214, 137, 15, 5, 214, 138, 30, 69, 15, 5, 214, 
+    126, 15, 5, 214, 127, 30, 61, 15, 5, 214, 127, 30, 233, 223, 15, 5, 214, 
+    127, 30, 233, 202, 15, 5, 214, 127, 30, 217, 73, 15, 5, 214, 122, 15, 5, 
+    214, 125, 15, 5, 214, 123, 15, 5, 214, 119, 15, 5, 214, 108, 15, 5, 214, 
+    109, 30, 234, 213, 15, 5, 214, 107, 15, 5, 210, 116, 15, 5, 210, 117, 
+    216, 240, 15, 5, 210, 117, 92, 30, 233, 202, 15, 5, 210, 113, 15, 5, 210, 
+    106, 15, 5, 210, 93, 15, 5, 210, 44, 15, 5, 210, 45, 115, 210, 44, 15, 5, 
+    210, 43, 15, 5, 210, 41, 15, 5, 210, 42, 235, 9, 216, 240, 15, 5, 210, 
+    36, 15, 5, 210, 28, 15, 5, 210, 13, 15, 5, 210, 11, 15, 5, 210, 12, 30, 
+    61, 15, 5, 210, 10, 15, 5, 210, 9, 15, 132, 5, 113, 253, 239, 15, 132, 5, 
+    134, 253, 239, 15, 132, 5, 244, 19, 253, 239, 15, 132, 5, 244, 89, 253, 
+    239, 15, 132, 5, 219, 127, 253, 239, 15, 132, 5, 220, 124, 253, 239, 15, 
+    132, 5, 245, 201, 253, 239, 15, 132, 5, 228, 205, 253, 239, 15, 132, 5, 
+    134, 247, 195, 15, 132, 5, 244, 19, 247, 195, 15, 132, 5, 244, 89, 247, 
+    195, 15, 132, 5, 219, 127, 247, 195, 15, 132, 5, 220, 124, 247, 195, 15, 
+    132, 5, 245, 201, 247, 195, 15, 132, 5, 228, 205, 247, 195, 15, 132, 5, 
+    244, 19, 69, 15, 132, 5, 244, 89, 69, 15, 132, 5, 219, 127, 69, 15, 132, 
+    5, 220, 124, 69, 15, 132, 5, 245, 201, 69, 15, 132, 5, 228, 205, 69, 15, 
+    132, 5, 123, 243, 45, 15, 132, 5, 113, 243, 45, 15, 132, 5, 134, 243, 45, 
+    15, 132, 5, 244, 19, 243, 45, 15, 132, 5, 244, 89, 243, 45, 15, 132, 5, 
+    219, 127, 243, 45, 15, 132, 5, 220, 124, 243, 45, 15, 132, 5, 245, 201, 
+    243, 45, 15, 132, 5, 228, 205, 243, 45, 15, 132, 5, 123, 243, 42, 15, 
+    132, 5, 113, 243, 42, 15, 132, 5, 134, 243, 42, 15, 132, 5, 244, 19, 243, 
+    42, 15, 132, 5, 244, 89, 243, 42, 15, 132, 5, 113, 220, 80, 15, 132, 5, 
+    134, 220, 80, 15, 132, 5, 134, 220, 81, 214, 12, 17, 15, 132, 5, 244, 19, 
+    220, 80, 15, 132, 5, 244, 89, 220, 80, 15, 132, 5, 219, 127, 220, 80, 15, 
+    132, 5, 220, 124, 220, 80, 15, 132, 5, 245, 201, 220, 80, 15, 132, 5, 
+    228, 205, 220, 80, 15, 132, 5, 123, 220, 75, 15, 132, 5, 113, 220, 75, 
+    15, 132, 5, 134, 220, 75, 15, 132, 5, 134, 220, 76, 214, 12, 17, 15, 132, 
+    5, 244, 19, 220, 75, 15, 132, 5, 244, 89, 220, 75, 15, 132, 5, 220, 81, 
+    30, 243, 126, 96, 247, 195, 15, 132, 5, 220, 81, 30, 243, 126, 96, 230, 
+    193, 15, 132, 5, 123, 251, 103, 15, 132, 5, 113, 251, 103, 15, 132, 5, 
+    134, 251, 103, 15, 132, 5, 134, 251, 104, 214, 12, 17, 15, 132, 5, 244, 
+    19, 251, 103, 15, 132, 5, 244, 89, 251, 103, 15, 132, 5, 134, 214, 12, 
+    244, 28, 245, 82, 15, 132, 5, 134, 214, 12, 244, 28, 245, 79, 15, 132, 5, 
+    244, 19, 214, 12, 244, 28, 232, 223, 15, 132, 5, 244, 19, 214, 12, 244, 
+    28, 232, 221, 15, 132, 5, 244, 19, 214, 12, 244, 28, 232, 224, 61, 15, 
+    132, 5, 244, 19, 214, 12, 244, 28, 232, 224, 253, 166, 15, 132, 5, 219, 
+    127, 214, 12, 244, 28, 253, 236, 15, 132, 5, 220, 124, 214, 12, 244, 28, 
+    236, 15, 15, 132, 5, 220, 124, 214, 12, 244, 28, 236, 17, 61, 15, 132, 5, 
+    220, 124, 214, 12, 244, 28, 236, 17, 253, 166, 15, 132, 5, 245, 201, 214, 
+    12, 244, 28, 214, 121, 15, 132, 5, 245, 201, 214, 12, 244, 28, 214, 120, 
+    15, 132, 5, 228, 205, 214, 12, 244, 28, 236, 31, 15, 132, 5, 228, 205, 
+    214, 12, 244, 28, 236, 30, 15, 132, 5, 228, 205, 214, 12, 244, 28, 236, 
+    29, 15, 132, 5, 228, 205, 214, 12, 244, 28, 236, 32, 61, 15, 132, 5, 113, 
+    253, 240, 216, 240, 15, 132, 5, 134, 253, 240, 216, 240, 15, 132, 5, 244, 
+    19, 253, 240, 216, 240, 15, 132, 5, 244, 89, 253, 240, 216, 240, 15, 132, 
+    5, 219, 127, 253, 240, 216, 240, 15, 132, 5, 123, 252, 158, 15, 132, 5, 
+    113, 252, 158, 15, 132, 5, 134, 252, 158, 15, 132, 5, 244, 19, 252, 158, 
+    15, 132, 5, 244, 19, 252, 159, 214, 12, 17, 15, 132, 5, 244, 89, 252, 
+    158, 15, 132, 5, 244, 89, 252, 159, 214, 12, 17, 15, 132, 5, 228, 215, 
+    15, 132, 5, 228, 216, 15, 132, 5, 123, 245, 78, 15, 132, 5, 113, 245, 78, 
+    15, 132, 5, 123, 216, 170, 247, 195, 15, 132, 5, 113, 216, 168, 247, 195, 
+    15, 132, 5, 244, 89, 219, 116, 247, 195, 15, 132, 5, 123, 216, 170, 214, 
+    12, 244, 28, 61, 15, 132, 5, 113, 216, 168, 214, 12, 244, 28, 61, 15, 
+    132, 5, 123, 245, 197, 253, 239, 15, 132, 5, 123, 224, 25, 253, 239, 15, 
+    132, 5, 55, 253, 227, 123, 219, 117, 15, 132, 5, 55, 253, 227, 123, 224, 
+    24, 15, 224, 144, 5, 55, 253, 227, 211, 209, 247, 180, 15, 224, 144, 5, 
+    67, 249, 234, 15, 224, 144, 5, 248, 7, 249, 234, 15, 224, 144, 5, 248, 7, 
+    215, 222, 12, 13, 255, 164, 12, 13, 255, 163, 12, 13, 255, 162, 12, 13, 
+    255, 161, 12, 13, 255, 160, 12, 13, 255, 159, 12, 13, 255, 158, 12, 13, 
+    255, 157, 12, 13, 255, 156, 12, 13, 255, 155, 12, 13, 255, 154, 12, 13, 
+    255, 153, 12, 13, 255, 152, 12, 13, 255, 151, 12, 13, 255, 150, 12, 13, 
+    255, 149, 12, 13, 255, 148, 12, 13, 255, 147, 12, 13, 255, 146, 12, 13, 
+    255, 145, 12, 13, 255, 144, 12, 13, 255, 143, 12, 13, 255, 142, 12, 13, 
+    255, 141, 12, 13, 255, 140, 12, 13, 255, 139, 12, 13, 255, 138, 12, 13, 
+    255, 137, 12, 13, 255, 136, 12, 13, 255, 135, 12, 13, 255, 134, 12, 13, 
+    255, 133, 12, 13, 255, 132, 12, 13, 255, 131, 12, 13, 255, 130, 12, 13, 
+    255, 129, 12, 13, 255, 128, 12, 13, 255, 127, 12, 13, 255, 126, 12, 13, 
+    255, 125, 12, 13, 255, 124, 12, 13, 255, 123, 12, 13, 255, 122, 12, 13, 
+    255, 121, 12, 13, 255, 120, 12, 13, 255, 119, 12, 13, 255, 118, 12, 13, 
+    255, 117, 12, 13, 255, 116, 12, 13, 255, 115, 12, 13, 255, 114, 12, 13, 
+    255, 113, 12, 13, 255, 112, 12, 13, 255, 111, 12, 13, 255, 110, 12, 13, 
+    255, 109, 12, 13, 255, 108, 12, 13, 255, 107, 12, 13, 255, 106, 12, 13, 
+    255, 105, 12, 13, 255, 104, 12, 13, 255, 103, 12, 13, 255, 102, 12, 13, 
+    255, 101, 12, 13, 255, 100, 12, 13, 255, 99, 12, 13, 255, 98, 12, 13, 
+    255, 97, 12, 13, 255, 96, 12, 13, 255, 95, 12, 13, 255, 94, 12, 13, 255, 
+    93, 12, 13, 255, 92, 12, 13, 255, 91, 12, 13, 255, 90, 12, 13, 255, 89, 
+    12, 13, 255, 88, 12, 13, 255, 87, 12, 13, 255, 86, 12, 13, 255, 85, 12, 
+    13, 253, 164, 12, 13, 253, 162, 12, 13, 253, 160, 12, 13, 253, 158, 12, 
+    13, 253, 156, 12, 13, 253, 155, 12, 13, 253, 153, 12, 13, 253, 151, 12, 
+    13, 253, 149, 12, 13, 253, 147, 12, 13, 251, 70, 12, 13, 251, 69, 12, 13, 
+    251, 68, 12, 13, 251, 67, 12, 13, 251, 66, 12, 13, 251, 65, 12, 13, 251, 
+    64, 12, 13, 251, 63, 12, 13, 251, 62, 12, 13, 251, 61, 12, 13, 251, 60, 
+    12, 13, 251, 59, 12, 13, 251, 58, 12, 13, 251, 57, 12, 13, 251, 56, 12, 
+    13, 251, 55, 12, 13, 251, 54, 12, 13, 251, 53, 12, 13, 251, 52, 12, 13, 
+    251, 51, 12, 13, 251, 50, 12, 13, 251, 49, 12, 13, 251, 48, 12, 13, 251, 
+    47, 12, 13, 251, 46, 12, 13, 251, 45, 12, 13, 251, 44, 12, 13, 251, 43, 
+    12, 13, 249, 67, 12, 13, 249, 66, 12, 13, 249, 65, 12, 13, 249, 64, 12, 
+    13, 249, 63, 12, 13, 249, 62, 12, 13, 249, 61, 12, 13, 249, 60, 12, 13, 
+    249, 59, 12, 13, 249, 58, 12, 13, 249, 57, 12, 13, 249, 56, 12, 13, 249, 
+    55, 12, 13, 249, 54, 12, 13, 249, 53, 12, 13, 249, 52, 12, 13, 249, 51, 
+    12, 13, 249, 50, 12, 13, 249, 49, 12, 13, 249, 48, 12, 13, 249, 47, 12, 
+    13, 249, 46, 12, 13, 249, 45, 12, 13, 249, 44, 12, 13, 249, 43, 12, 13, 
+    249, 42, 12, 13, 249, 41, 12, 13, 249, 40, 12, 13, 249, 39, 12, 13, 249, 
+    38, 12, 13, 249, 37, 12, 13, 249, 36, 12, 13, 249, 35, 12, 13, 249, 34, 
+    12, 13, 249, 33, 12, 13, 249, 32, 12, 13, 249, 31, 12, 13, 249, 30, 12, 
+    13, 249, 29, 12, 13, 249, 28, 12, 13, 249, 27, 12, 13, 249, 26, 12, 13, 
+    249, 25, 12, 13, 249, 24, 12, 13, 249, 23, 12, 13, 249, 22, 12, 13, 249, 
+    21, 12, 13, 249, 20, 12, 13, 249, 19, 12, 13, 249, 18, 12, 13, 249, 17, 
+    12, 13, 249, 16, 12, 13, 249, 15, 12, 13, 249, 14, 12, 13, 249, 13, 12, 
+    13, 249, 12, 12, 13, 249, 11, 12, 13, 249, 10, 12, 13, 249, 9, 12, 13, 
+    249, 8, 12, 13, 249, 7, 12, 13, 249, 6, 12, 13, 249, 5, 12, 13, 249, 4, 
+    12, 13, 249, 3, 12, 13, 249, 2, 12, 13, 249, 1, 12, 13, 249, 0, 12, 13, 
+    248, 255, 12, 13, 248, 254, 12, 13, 248, 253, 12, 13, 248, 252, 12, 13, 
+    248, 251, 12, 13, 248, 250, 12, 13, 248, 249, 12, 13, 248, 248, 12, 13, 
+    248, 247, 12, 13, 248, 246, 12, 13, 248, 245, 12, 13, 248, 244, 12, 13, 
+    248, 243, 12, 13, 248, 242, 12, 13, 248, 241, 12, 13, 248, 240, 12, 13, 
+    248, 239, 12, 13, 248, 238, 12, 13, 248, 237, 12, 13, 248, 236, 12, 13, 
+    248, 235, 12, 13, 248, 234, 12, 13, 248, 233, 12, 13, 248, 232, 12, 13, 
+    246, 31, 12, 13, 246, 30, 12, 13, 246, 29, 12, 13, 246, 28, 12, 13, 246, 
+    27, 12, 13, 246, 26, 12, 13, 246, 25, 12, 13, 246, 24, 12, 13, 246, 23, 
+    12, 13, 246, 22, 12, 13, 246, 21, 12, 13, 246, 20, 12, 13, 246, 19, 12, 
+    13, 246, 18, 12, 13, 246, 17, 12, 13, 246, 16, 12, 13, 246, 15, 12, 13, 
+    246, 14, 12, 13, 246, 13, 12, 13, 246, 12, 12, 13, 246, 11, 12, 13, 246, 
+    10, 12, 13, 246, 9, 12, 13, 246, 8, 12, 13, 246, 7, 12, 13, 246, 6, 12, 
+    13, 246, 5, 12, 13, 246, 4, 12, 13, 246, 3, 12, 13, 246, 2, 12, 13, 246, 
+    1, 12, 13, 246, 0, 12, 13, 245, 255, 12, 13, 245, 254, 12, 13, 245, 253, 
+    12, 13, 245, 252, 12, 13, 245, 251, 12, 13, 245, 250, 12, 13, 245, 249, 
+    12, 13, 245, 248, 12, 13, 245, 247, 12, 13, 245, 246, 12, 13, 245, 245, 
+    12, 13, 245, 244, 12, 13, 245, 13, 12, 13, 245, 12, 12, 13, 245, 11, 12, 
+    13, 245, 10, 12, 13, 245, 9, 12, 13, 245, 8, 12, 13, 245, 7, 12, 13, 245, 
+    6, 12, 13, 245, 5, 12, 13, 245, 4, 12, 13, 245, 3, 12, 13, 245, 2, 12, 
+    13, 245, 1, 12, 13, 245, 0, 12, 13, 244, 255, 12, 13, 244, 254, 12, 13, 
+    244, 253, 12, 13, 244, 252, 12, 13, 244, 251, 12, 13, 244, 250, 12, 13, 
+    244, 249, 12, 13, 244, 248, 12, 13, 244, 247, 12, 13, 244, 246, 12, 13, 
+    244, 245, 12, 13, 244, 244, 12, 13, 244, 243, 12, 13, 244, 242, 12, 13, 
+    244, 241, 12, 13, 244, 240, 12, 13, 244, 239, 12, 13, 244, 238, 12, 13, 
+    244, 237, 12, 13, 244, 236, 12, 13, 244, 235, 12, 13, 244, 234, 12, 13, 
+    244, 233, 12, 13, 244, 232, 12, 13, 244, 231, 12, 13, 244, 230, 12, 13, 
+    244, 229, 12, 13, 244, 228, 12, 13, 244, 227, 12, 13, 244, 226, 12, 13, 
+    244, 225, 12, 13, 244, 224, 12, 13, 244, 223, 12, 13, 244, 222, 12, 13, 
+    244, 221, 12, 13, 244, 220, 12, 13, 244, 219, 12, 13, 244, 218, 12, 13, 
+    244, 217, 12, 13, 244, 216, 12, 13, 244, 215, 12, 13, 244, 214, 12, 13, 
+    244, 213, 12, 13, 244, 212, 12, 13, 244, 211, 12, 13, 244, 210, 12, 13, 
+    244, 209, 12, 13, 244, 208, 12, 13, 244, 207, 12, 13, 244, 206, 12, 13, 
+    244, 205, 12, 13, 243, 208, 12, 13, 243, 207, 12, 13, 243, 206, 12, 13, 
+    243, 205, 12, 13, 243, 204, 12, 13, 243, 203, 12, 13, 243, 202, 12, 13, 
     243, 201, 12, 13, 243, 200, 12, 13, 243, 199, 12, 13, 243, 198, 12, 13, 
     243, 197, 12, 13, 243, 196, 12, 13, 243, 195, 12, 13, 243, 194, 12, 13, 
     243, 193, 12, 13, 243, 192, 12, 13, 243, 191, 12, 13, 243, 190, 12, 13, 
@@ -12015,81 +12016,80 @@
     243, 157, 12, 13, 243, 156, 12, 13, 243, 155, 12, 13, 243, 154, 12, 13, 
     243, 153, 12, 13, 243, 152, 12, 13, 243, 151, 12, 13, 243, 150, 12, 13, 
     243, 149, 12, 13, 243, 148, 12, 13, 243, 147, 12, 13, 243, 146, 12, 13, 
-    243, 145, 12, 13, 243, 144, 12, 13, 243, 143, 12, 13, 243, 142, 12, 13, 
-    243, 141, 12, 13, 243, 140, 12, 13, 243, 139, 12, 13, 243, 138, 12, 13, 
-    242, 58, 12, 13, 242, 57, 12, 13, 242, 56, 12, 13, 242, 55, 12, 13, 242, 
-    54, 12, 13, 242, 53, 12, 13, 242, 52, 12, 13, 242, 51, 12, 13, 242, 50, 
+    243, 145, 12, 13, 242, 65, 12, 13, 242, 64, 12, 13, 242, 63, 12, 13, 242, 
+    62, 12, 13, 242, 61, 12, 13, 242, 60, 12, 13, 242, 59, 12, 13, 242, 58, 
+    12, 13, 242, 57, 12, 13, 240, 145, 12, 13, 240, 144, 12, 13, 240, 143, 
+    12, 13, 240, 142, 12, 13, 240, 141, 12, 13, 240, 140, 12, 13, 240, 139, 
     12, 13, 240, 138, 12, 13, 240, 137, 12, 13, 240, 136, 12, 13, 240, 135, 
     12, 13, 240, 134, 12, 13, 240, 133, 12, 13, 240, 132, 12, 13, 240, 131, 
     12, 13, 240, 130, 12, 13, 240, 129, 12, 13, 240, 128, 12, 13, 240, 127, 
-    12, 13, 240, 126, 12, 13, 240, 125, 12, 13, 240, 124, 12, 13, 240, 123, 
-    12, 13, 240, 122, 12, 13, 240, 121, 12, 13, 240, 120, 12, 13, 235, 22, 
-    12, 13, 235, 21, 12, 13, 235, 20, 12, 13, 235, 19, 12, 13, 235, 18, 12, 
-    13, 235, 17, 12, 13, 235, 16, 12, 13, 235, 15, 12, 13, 233, 146, 12, 13, 
-    233, 145, 12, 13, 233, 144, 12, 13, 233, 143, 12, 13, 233, 142, 12, 13, 
-    233, 141, 12, 13, 233, 140, 12, 13, 233, 139, 12, 13, 233, 138, 12, 13, 
-    233, 137, 12, 13, 232, 49, 12, 13, 232, 48, 12, 13, 232, 47, 12, 13, 232, 
-    46, 12, 13, 232, 45, 12, 13, 232, 44, 12, 13, 232, 43, 12, 13, 232, 42, 
-    12, 13, 232, 41, 12, 13, 232, 40, 12, 13, 232, 39, 12, 13, 232, 38, 12, 
-    13, 232, 37, 12, 13, 232, 36, 12, 13, 232, 35, 12, 13, 232, 34, 12, 13, 
-    232, 33, 12, 13, 232, 32, 12, 13, 232, 31, 12, 13, 232, 30, 12, 13, 232, 
-    29, 12, 13, 232, 28, 12, 13, 232, 27, 12, 13, 232, 26, 12, 13, 232, 25, 
-    12, 13, 232, 24, 12, 13, 232, 23, 12, 13, 232, 22, 12, 13, 232, 21, 12, 
-    13, 232, 20, 12, 13, 232, 19, 12, 13, 232, 18, 12, 13, 232, 17, 12, 13, 
-    232, 16, 12, 13, 232, 15, 12, 13, 232, 14, 12, 13, 232, 13, 12, 13, 232, 
-    12, 12, 13, 232, 11, 12, 13, 232, 10, 12, 13, 232, 9, 12, 13, 232, 8, 12, 
-    13, 232, 7, 12, 13, 232, 6, 12, 13, 232, 5, 12, 13, 232, 4, 12, 13, 232, 
-    3, 12, 13, 232, 2, 12, 13, 232, 1, 12, 13, 232, 0, 12, 13, 231, 255, 12, 
-    13, 231, 254, 12, 13, 231, 253, 12, 13, 231, 252, 12, 13, 231, 251, 12, 
-    13, 231, 250, 12, 13, 231, 249, 12, 13, 231, 248, 12, 13, 231, 247, 12, 
-    13, 231, 246, 12, 13, 231, 245, 12, 13, 231, 244, 12, 13, 231, 243, 12, 
-    13, 231, 242, 12, 13, 231, 241, 12, 13, 231, 240, 12, 13, 230, 22, 12, 
-    13, 230, 21, 12, 13, 230, 20, 12, 13, 230, 19, 12, 13, 230, 18, 12, 13, 
-    230, 17, 12, 13, 230, 16, 12, 13, 230, 15, 12, 13, 230, 14, 12, 13, 230, 
-    13, 12, 13, 230, 12, 12, 13, 230, 11, 12, 13, 230, 10, 12, 13, 230, 9, 
-    12, 13, 230, 8, 12, 13, 230, 7, 12, 13, 230, 6, 12, 13, 230, 5, 12, 13, 
-    230, 4, 12, 13, 230, 3, 12, 13, 230, 2, 12, 13, 230, 1, 12, 13, 230, 0, 
-    12, 13, 229, 255, 12, 13, 229, 254, 12, 13, 229, 253, 12, 13, 229, 252, 
-    12, 13, 229, 251, 12, 13, 229, 250, 12, 13, 229, 249, 12, 13, 229, 248, 
-    12, 13, 229, 247, 12, 13, 229, 246, 12, 13, 229, 245, 12, 13, 229, 244, 
-    12, 13, 229, 243, 12, 13, 229, 242, 12, 13, 229, 241, 12, 13, 229, 240, 
-    12, 13, 229, 239, 12, 13, 229, 238, 12, 13, 229, 237, 12, 13, 229, 236, 
-    12, 13, 229, 235, 12, 13, 229, 234, 12, 13, 229, 233, 12, 13, 229, 232, 
-    12, 13, 229, 231, 12, 13, 229, 230, 12, 13, 228, 134, 12, 13, 228, 133, 
-    12, 13, 228, 132, 12, 13, 228, 131, 12, 13, 228, 130, 12, 13, 228, 129, 
-    12, 13, 228, 128, 12, 13, 228, 127, 12, 13, 228, 126, 12, 13, 228, 125, 
-    12, 13, 228, 124, 12, 13, 228, 123, 12, 13, 228, 122, 12, 13, 228, 121, 
-    12, 13, 228, 120, 12, 13, 228, 119, 12, 13, 228, 118, 12, 13, 228, 117, 
-    12, 13, 228, 116, 12, 13, 228, 115, 12, 13, 228, 114, 12, 13, 228, 113, 
-    12, 13, 227, 236, 12, 13, 227, 235, 12, 13, 227, 234, 12, 13, 227, 233, 
-    12, 13, 227, 232, 12, 13, 227, 231, 12, 13, 227, 230, 12, 13, 227, 229, 
-    12, 13, 227, 228, 12, 13, 227, 227, 12, 13, 227, 226, 12, 13, 227, 225, 
-    12, 13, 227, 224, 12, 13, 227, 223, 12, 13, 227, 222, 12, 13, 227, 221, 
-    12, 13, 227, 220, 12, 13, 227, 219, 12, 13, 227, 218, 12, 13, 227, 217, 
-    12, 13, 227, 216, 12, 13, 227, 215, 12, 13, 227, 214, 12, 13, 227, 213, 
-    12, 13, 227, 212, 12, 13, 227, 211, 12, 13, 227, 76, 12, 13, 227, 75, 12, 
-    13, 227, 74, 12, 13, 227, 73, 12, 13, 227, 72, 12, 13, 227, 71, 12, 13, 
-    227, 70, 12, 13, 227, 69, 12, 13, 227, 68, 12, 13, 227, 67, 12, 13, 227, 
-    66, 12, 13, 227, 65, 12, 13, 227, 64, 12, 13, 227, 63, 12, 13, 227, 62, 
-    12, 13, 227, 61, 12, 13, 227, 60, 12, 13, 227, 59, 12, 13, 227, 58, 12, 
-    13, 227, 57, 12, 13, 227, 56, 12, 13, 227, 55, 12, 13, 227, 54, 12, 13, 
-    227, 53, 12, 13, 227, 52, 12, 13, 227, 51, 12, 13, 227, 50, 12, 13, 227, 
-    49, 12, 13, 227, 48, 12, 13, 227, 47, 12, 13, 227, 46, 12, 13, 227, 45, 
-    12, 13, 227, 44, 12, 13, 227, 43, 12, 13, 227, 42, 12, 13, 227, 41, 12, 
-    13, 227, 40, 12, 13, 227, 39, 12, 13, 227, 38, 12, 13, 227, 37, 12, 13, 
-    227, 36, 12, 13, 227, 35, 12, 13, 227, 34, 12, 13, 227, 33, 12, 13, 227, 
-    32, 12, 13, 227, 31, 12, 13, 227, 30, 12, 13, 227, 29, 12, 13, 227, 28, 
-    12, 13, 227, 27, 12, 13, 227, 26, 12, 13, 227, 25, 12, 13, 227, 24, 12, 
-    13, 227, 23, 12, 13, 227, 22, 12, 13, 227, 21, 12, 13, 227, 20, 12, 13, 
-    227, 19, 12, 13, 227, 18, 12, 13, 227, 17, 12, 13, 227, 16, 12, 13, 227, 
-    15, 12, 13, 227, 14, 12, 13, 227, 13, 12, 13, 227, 12, 12, 13, 227, 11, 
-    12, 13, 227, 10, 12, 13, 227, 9, 12, 13, 227, 8, 12, 13, 227, 7, 12, 13, 
-    227, 6, 12, 13, 227, 5, 12, 13, 227, 4, 12, 13, 227, 3, 12, 13, 227, 2, 
-    12, 13, 226, 104, 12, 13, 226, 103, 12, 13, 226, 102, 12, 13, 226, 101, 
-    12, 13, 226, 100, 12, 13, 226, 99, 12, 13, 226, 98, 12, 13, 226, 97, 12, 
-    13, 226, 96, 12, 13, 226, 95, 12, 13, 226, 94, 12, 13, 226, 93, 12, 13, 
-    226, 92, 12, 13, 224, 95, 12, 13, 224, 94, 12, 13, 224, 93, 12, 13, 224, 
-    92, 12, 13, 224, 91, 12, 13, 224, 90, 12, 13, 224, 89, 12, 13, 223, 222, 
+    12, 13, 235, 28, 12, 13, 235, 27, 12, 13, 235, 26, 12, 13, 235, 25, 12, 
+    13, 235, 24, 12, 13, 235, 23, 12, 13, 235, 22, 12, 13, 235, 21, 12, 13, 
+    233, 152, 12, 13, 233, 151, 12, 13, 233, 150, 12, 13, 233, 149, 12, 13, 
+    233, 148, 12, 13, 233, 147, 12, 13, 233, 146, 12, 13, 233, 145, 12, 13, 
+    233, 144, 12, 13, 233, 143, 12, 13, 232, 54, 12, 13, 232, 53, 12, 13, 
+    232, 52, 12, 13, 232, 51, 12, 13, 232, 50, 12, 13, 232, 49, 12, 13, 232, 
+    48, 12, 13, 232, 47, 12, 13, 232, 46, 12, 13, 232, 45, 12, 13, 232, 44, 
+    12, 13, 232, 43, 12, 13, 232, 42, 12, 13, 232, 41, 12, 13, 232, 40, 12, 
+    13, 232, 39, 12, 13, 232, 38, 12, 13, 232, 37, 12, 13, 232, 36, 12, 13, 
+    232, 35, 12, 13, 232, 34, 12, 13, 232, 33, 12, 13, 232, 32, 12, 13, 232, 
+    31, 12, 13, 232, 30, 12, 13, 232, 29, 12, 13, 232, 28, 12, 13, 232, 27, 
+    12, 13, 232, 26, 12, 13, 232, 25, 12, 13, 232, 24, 12, 13, 232, 23, 12, 
+    13, 232, 22, 12, 13, 232, 21, 12, 13, 232, 20, 12, 13, 232, 19, 12, 13, 
+    232, 18, 12, 13, 232, 17, 12, 13, 232, 16, 12, 13, 232, 15, 12, 13, 232, 
+    14, 12, 13, 232, 13, 12, 13, 232, 12, 12, 13, 232, 11, 12, 13, 232, 10, 
+    12, 13, 232, 9, 12, 13, 232, 8, 12, 13, 232, 7, 12, 13, 232, 6, 12, 13, 
+    232, 5, 12, 13, 232, 4, 12, 13, 232, 3, 12, 13, 232, 2, 12, 13, 232, 1, 
+    12, 13, 232, 0, 12, 13, 231, 255, 12, 13, 231, 254, 12, 13, 231, 253, 12, 
+    13, 231, 252, 12, 13, 231, 251, 12, 13, 231, 250, 12, 13, 231, 249, 12, 
+    13, 231, 248, 12, 13, 231, 247, 12, 13, 231, 246, 12, 13, 231, 245, 12, 
+    13, 230, 27, 12, 13, 230, 26, 12, 13, 230, 25, 12, 13, 230, 24, 12, 13, 
+    230, 23, 12, 13, 230, 22, 12, 13, 230, 21, 12, 13, 230, 20, 12, 13, 230, 
+    19, 12, 13, 230, 18, 12, 13, 230, 17, 12, 13, 230, 16, 12, 13, 230, 15, 
+    12, 13, 230, 14, 12, 13, 230, 13, 12, 13, 230, 12, 12, 13, 230, 11, 12, 
+    13, 230, 10, 12, 13, 230, 9, 12, 13, 230, 8, 12, 13, 230, 7, 12, 13, 230, 
+    6, 12, 13, 230, 5, 12, 13, 230, 4, 12, 13, 230, 3, 12, 13, 230, 2, 12, 
+    13, 230, 1, 12, 13, 230, 0, 12, 13, 229, 255, 12, 13, 229, 254, 12, 13, 
+    229, 253, 12, 13, 229, 252, 12, 13, 229, 251, 12, 13, 229, 250, 12, 13, 
+    229, 249, 12, 13, 229, 248, 12, 13, 229, 247, 12, 13, 229, 246, 12, 13, 
+    229, 245, 12, 13, 229, 244, 12, 13, 229, 243, 12, 13, 229, 242, 12, 13, 
+    229, 241, 12, 13, 229, 240, 12, 13, 229, 239, 12, 13, 229, 238, 12, 13, 
+    229, 237, 12, 13, 229, 236, 12, 13, 229, 235, 12, 13, 228, 139, 12, 13, 
+    228, 138, 12, 13, 228, 137, 12, 13, 228, 136, 12, 13, 228, 135, 12, 13, 
+    228, 134, 12, 13, 228, 133, 12, 13, 228, 132, 12, 13, 228, 131, 12, 13, 
+    228, 130, 12, 13, 228, 129, 12, 13, 228, 128, 12, 13, 228, 127, 12, 13, 
+    228, 126, 12, 13, 228, 125, 12, 13, 228, 124, 12, 13, 228, 123, 12, 13, 
+    228, 122, 12, 13, 228, 121, 12, 13, 228, 120, 12, 13, 228, 119, 12, 13, 
+    228, 118, 12, 13, 227, 241, 12, 13, 227, 240, 12, 13, 227, 239, 12, 13, 
+    227, 238, 12, 13, 227, 237, 12, 13, 227, 236, 12, 13, 227, 235, 12, 13, 
+    227, 234, 12, 13, 227, 233, 12, 13, 227, 232, 12, 13, 227, 231, 12, 13, 
+    227, 230, 12, 13, 227, 229, 12, 13, 227, 228, 12, 13, 227, 227, 12, 13, 
+    227, 226, 12, 13, 227, 225, 12, 13, 227, 224, 12, 13, 227, 223, 12, 13, 
+    227, 222, 12, 13, 227, 221, 12, 13, 227, 220, 12, 13, 227, 219, 12, 13, 
+    227, 218, 12, 13, 227, 217, 12, 13, 227, 216, 12, 13, 227, 80, 12, 13, 
+    227, 79, 12, 13, 227, 78, 12, 13, 227, 77, 12, 13, 227, 76, 12, 13, 227, 
+    75, 12, 13, 227, 74, 12, 13, 227, 73, 12, 13, 227, 72, 12, 13, 227, 71, 
+    12, 13, 227, 70, 12, 13, 227, 69, 12, 13, 227, 68, 12, 13, 227, 67, 12, 
+    13, 227, 66, 12, 13, 227, 65, 12, 13, 227, 64, 12, 13, 227, 63, 12, 13, 
+    227, 62, 12, 13, 227, 61, 12, 13, 227, 60, 12, 13, 227, 59, 12, 13, 227, 
+    58, 12, 13, 227, 57, 12, 13, 227, 56, 12, 13, 227, 55, 12, 13, 227, 54, 
+    12, 13, 227, 53, 12, 13, 227, 52, 12, 13, 227, 51, 12, 13, 227, 50, 12, 
+    13, 227, 49, 12, 13, 227, 48, 12, 13, 227, 47, 12, 13, 227, 46, 12, 13, 
+    227, 45, 12, 13, 227, 44, 12, 13, 227, 43, 12, 13, 227, 42, 12, 13, 227, 
+    41, 12, 13, 227, 40, 12, 13, 227, 39, 12, 13, 227, 38, 12, 13, 227, 37, 
+    12, 13, 227, 36, 12, 13, 227, 35, 12, 13, 227, 34, 12, 13, 227, 33, 12, 
+    13, 227, 32, 12, 13, 227, 31, 12, 13, 227, 30, 12, 13, 227, 29, 12, 13, 
+    227, 28, 12, 13, 227, 27, 12, 13, 227, 26, 12, 13, 227, 25, 12, 13, 227, 
+    24, 12, 13, 227, 23, 12, 13, 227, 22, 12, 13, 227, 21, 12, 13, 227, 20, 
+    12, 13, 227, 19, 12, 13, 227, 18, 12, 13, 227, 17, 12, 13, 227, 16, 12, 
+    13, 227, 15, 12, 13, 227, 14, 12, 13, 227, 13, 12, 13, 227, 12, 12, 13, 
+    227, 11, 12, 13, 227, 10, 12, 13, 227, 9, 12, 13, 227, 8, 12, 13, 227, 7, 
+    12, 13, 227, 6, 12, 13, 226, 108, 12, 13, 226, 107, 12, 13, 226, 106, 12, 
+    13, 226, 105, 12, 13, 226, 104, 12, 13, 226, 103, 12, 13, 226, 102, 12, 
+    13, 226, 101, 12, 13, 226, 100, 12, 13, 226, 99, 12, 13, 226, 98, 12, 13, 
+    226, 97, 12, 13, 226, 96, 12, 13, 224, 98, 12, 13, 224, 97, 12, 13, 224, 
+    96, 12, 13, 224, 95, 12, 13, 224, 94, 12, 13, 224, 93, 12, 13, 224, 92, 
+    12, 13, 223, 225, 12, 13, 223, 224, 12, 13, 223, 223, 12, 13, 223, 222, 
     12, 13, 223, 221, 12, 13, 223, 220, 12, 13, 223, 219, 12, 13, 223, 218, 
     12, 13, 223, 217, 12, 13, 223, 216, 12, 13, 223, 215, 12, 13, 223, 214, 
     12, 13, 223, 213, 12, 13, 223, 212, 12, 13, 223, 211, 12, 13, 223, 210, 
@@ -12097,1726 +12097,1743 @@
     12, 13, 223, 205, 12, 13, 223, 204, 12, 13, 223, 203, 12, 13, 223, 202, 
     12, 13, 223, 201, 12, 13, 223, 200, 12, 13, 223, 199, 12, 13, 223, 198, 
     12, 13, 223, 197, 12, 13, 223, 196, 12, 13, 223, 195, 12, 13, 223, 194, 
-    12, 13, 223, 193, 12, 13, 223, 192, 12, 13, 223, 191, 12, 13, 223, 190, 
-    12, 13, 223, 189, 12, 13, 222, 88, 12, 13, 222, 87, 12, 13, 222, 86, 12, 
-    13, 222, 85, 12, 13, 222, 84, 12, 13, 222, 83, 12, 13, 222, 82, 12, 13, 
-    222, 81, 12, 13, 222, 80, 12, 13, 222, 79, 12, 13, 222, 78, 12, 13, 222, 
-    77, 12, 13, 222, 76, 12, 13, 222, 75, 12, 13, 222, 74, 12, 13, 222, 73, 
-    12, 13, 222, 72, 12, 13, 222, 71, 12, 13, 222, 70, 12, 13, 222, 69, 12, 
-    13, 222, 68, 12, 13, 222, 67, 12, 13, 222, 66, 12, 13, 222, 65, 12, 13, 
-    222, 64, 12, 13, 222, 63, 12, 13, 222, 62, 12, 13, 222, 61, 12, 13, 222, 
-    60, 12, 13, 222, 59, 12, 13, 222, 58, 12, 13, 222, 57, 12, 13, 222, 56, 
-    12, 13, 222, 55, 12, 13, 222, 54, 12, 13, 222, 53, 12, 13, 222, 52, 12, 
-    13, 222, 51, 12, 13, 222, 50, 12, 13, 222, 49, 12, 13, 222, 48, 12, 13, 
-    222, 47, 12, 13, 222, 46, 12, 13, 222, 45, 12, 13, 222, 44, 12, 13, 222, 
-    43, 12, 13, 222, 42, 12, 13, 222, 41, 12, 13, 222, 40, 12, 13, 222, 39, 
-    12, 13, 222, 38, 12, 13, 222, 37, 12, 13, 222, 36, 12, 13, 222, 35, 12, 
-    13, 217, 150, 12, 13, 217, 149, 12, 13, 217, 148, 12, 13, 217, 147, 12, 
-    13, 217, 146, 12, 13, 217, 145, 12, 13, 217, 144, 12, 13, 217, 143, 12, 
-    13, 217, 142, 12, 13, 217, 141, 12, 13, 217, 140, 12, 13, 217, 139, 12, 
-    13, 217, 138, 12, 13, 217, 137, 12, 13, 217, 136, 12, 13, 217, 135, 12, 
-    13, 217, 134, 12, 13, 217, 133, 12, 13, 217, 132, 12, 13, 217, 131, 12, 
-    13, 217, 130, 12, 13, 217, 129, 12, 13, 217, 128, 12, 13, 217, 127, 12, 
-    13, 217, 126, 12, 13, 217, 125, 12, 13, 217, 124, 12, 13, 217, 123, 12, 
-    13, 217, 122, 12, 13, 217, 121, 12, 13, 217, 120, 12, 13, 217, 119, 12, 
-    13, 217, 118, 12, 13, 217, 117, 12, 13, 217, 116, 12, 13, 217, 115, 12, 
-    13, 217, 114, 12, 13, 217, 113, 12, 13, 217, 112, 12, 13, 217, 111, 12, 
-    13, 217, 110, 12, 13, 217, 109, 12, 13, 217, 108, 12, 13, 217, 107, 12, 
-    13, 215, 22, 12, 13, 215, 21, 12, 13, 215, 20, 12, 13, 215, 19, 12, 13, 
-    215, 18, 12, 13, 215, 17, 12, 13, 215, 16, 12, 13, 215, 15, 12, 13, 215, 
-    14, 12, 13, 215, 13, 12, 13, 215, 12, 12, 13, 215, 11, 12, 13, 215, 10, 
-    12, 13, 215, 9, 12, 13, 215, 8, 12, 13, 215, 7, 12, 13, 215, 6, 12, 13, 
-    215, 5, 12, 13, 215, 4, 12, 13, 215, 3, 12, 13, 215, 2, 12, 13, 215, 1, 
-    12, 13, 215, 0, 12, 13, 214, 255, 12, 13, 214, 254, 12, 13, 214, 253, 12, 
-    13, 214, 252, 12, 13, 214, 251, 12, 13, 214, 250, 12, 13, 214, 249, 12, 
-    13, 214, 248, 12, 13, 214, 247, 12, 13, 214, 246, 12, 13, 214, 245, 12, 
-    13, 214, 244, 12, 13, 214, 243, 12, 13, 214, 242, 12, 13, 214, 241, 12, 
-    13, 214, 240, 12, 13, 214, 239, 12, 13, 214, 238, 12, 13, 214, 237, 12, 
-    13, 214, 236, 12, 13, 214, 235, 12, 13, 214, 234, 12, 13, 214, 233, 12, 
-    13, 214, 232, 12, 13, 214, 104, 12, 13, 214, 103, 12, 13, 214, 102, 12, 
-    13, 214, 101, 12, 13, 214, 100, 12, 13, 214, 99, 12, 13, 214, 98, 12, 13, 
-    214, 97, 12, 13, 214, 96, 12, 13, 214, 95, 12, 13, 214, 94, 12, 13, 214, 
-    93, 12, 13, 214, 92, 12, 13, 214, 91, 12, 13, 214, 90, 12, 13, 214, 89, 
-    12, 13, 214, 88, 12, 13, 214, 87, 12, 13, 214, 86, 12, 13, 214, 85, 12, 
-    13, 214, 84, 12, 13, 214, 83, 12, 13, 214, 82, 12, 13, 214, 81, 12, 13, 
-    214, 80, 12, 13, 214, 79, 12, 13, 214, 78, 12, 13, 214, 77, 12, 13, 214, 
-    76, 12, 13, 214, 75, 12, 13, 214, 74, 12, 13, 214, 73, 12, 13, 214, 72, 
-    12, 13, 214, 71, 12, 13, 214, 70, 12, 13, 214, 69, 12, 13, 214, 68, 12, 
-    13, 214, 67, 12, 13, 214, 66, 12, 13, 214, 65, 12, 13, 214, 64, 12, 13, 
-    214, 63, 12, 13, 214, 62, 12, 13, 214, 61, 12, 13, 214, 60, 12, 13, 214, 
-    59, 12, 13, 214, 58, 12, 13, 214, 57, 12, 13, 214, 56, 12, 13, 214, 55, 
-    12, 13, 214, 54, 12, 13, 214, 53, 12, 13, 214, 52, 12, 13, 214, 51, 12, 
-    13, 214, 50, 12, 13, 214, 49, 12, 13, 214, 48, 12, 13, 214, 47, 12, 13, 
-    214, 46, 12, 13, 214, 45, 12, 13, 214, 44, 12, 13, 214, 43, 12, 13, 214, 
-    42, 12, 13, 214, 41, 12, 13, 214, 40, 12, 13, 214, 39, 12, 13, 214, 38, 
-    12, 13, 214, 37, 12, 13, 214, 36, 12, 13, 214, 35, 12, 13, 214, 34, 12, 
-    13, 214, 33, 12, 13, 214, 32, 12, 13, 214, 31, 12, 13, 214, 30, 12, 13, 
-    214, 29, 12, 13, 214, 28, 12, 13, 212, 97, 12, 13, 212, 96, 12, 13, 212, 
-    95, 12, 13, 212, 94, 12, 13, 212, 93, 12, 13, 212, 92, 12, 13, 212, 91, 
-    12, 13, 212, 90, 12, 13, 212, 89, 12, 13, 212, 88, 12, 13, 212, 87, 12, 
-    13, 212, 86, 12, 13, 212, 85, 12, 13, 212, 84, 12, 13, 212, 83, 12, 13, 
-    212, 82, 12, 13, 212, 81, 12, 13, 212, 80, 12, 13, 212, 79, 12, 13, 212, 
-    78, 12, 13, 212, 77, 12, 13, 212, 76, 12, 13, 212, 75, 12, 13, 212, 74, 
-    12, 13, 212, 73, 12, 13, 212, 72, 12, 13, 212, 71, 12, 13, 212, 70, 12, 
-    13, 212, 69, 12, 13, 212, 68, 12, 13, 212, 67, 12, 13, 212, 66, 12, 13, 
-    211, 177, 12, 13, 211, 176, 12, 13, 211, 175, 12, 13, 211, 174, 12, 13, 
-    211, 173, 12, 13, 211, 172, 12, 13, 211, 171, 12, 13, 211, 170, 12, 13, 
-    211, 169, 12, 13, 211, 168, 12, 13, 211, 167, 12, 13, 211, 166, 12, 13, 
-    211, 115, 12, 13, 211, 114, 12, 13, 211, 113, 12, 13, 211, 112, 12, 13, 
-    211, 111, 12, 13, 211, 110, 12, 13, 211, 109, 12, 13, 211, 108, 12, 13, 
-    211, 107, 12, 13, 210, 158, 12, 13, 210, 157, 12, 13, 210, 156, 12, 13, 
-    210, 155, 12, 13, 210, 154, 12, 13, 210, 153, 12, 13, 210, 152, 12, 13, 
-    210, 151, 12, 13, 210, 150, 12, 13, 210, 149, 12, 13, 210, 148, 12, 13, 
-    210, 147, 12, 13, 210, 146, 12, 13, 210, 145, 12, 13, 210, 144, 12, 13, 
-    210, 143, 12, 13, 210, 142, 12, 13, 210, 141, 12, 13, 210, 140, 12, 13, 
-    210, 139, 12, 13, 210, 138, 12, 13, 210, 137, 12, 13, 210, 136, 12, 13, 
-    210, 135, 12, 13, 210, 134, 12, 13, 210, 133, 12, 13, 210, 132, 12, 13, 
-    210, 131, 12, 13, 210, 130, 12, 13, 210, 129, 12, 13, 210, 128, 12, 13, 
-    210, 127, 12, 13, 210, 126, 12, 13, 210, 125, 12, 13, 210, 124, 12, 13, 
-    210, 123, 12, 13, 210, 122, 12, 13, 210, 121, 12, 13, 210, 120, 12, 13, 
-    210, 119, 12, 13, 210, 118, 12, 13, 255, 72, 12, 13, 255, 71, 12, 13, 
-    255, 70, 12, 13, 255, 69, 12, 13, 255, 68, 12, 13, 255, 67, 12, 13, 255, 
-    66, 12, 13, 255, 65, 12, 13, 255, 64, 12, 13, 255, 63, 12, 13, 255, 62, 
-    12, 13, 255, 61, 12, 13, 255, 60, 12, 13, 255, 59, 12, 13, 255, 58, 12, 
-    13, 255, 57, 12, 13, 255, 56, 12, 13, 255, 55, 12, 13, 255, 54, 12, 13, 
-    255, 53, 12, 13, 255, 52, 12, 13, 255, 51, 12, 13, 255, 50, 12, 13, 255, 
-    49, 12, 13, 255, 48, 12, 13, 255, 47, 12, 13, 255, 46, 12, 13, 255, 45, 
-    12, 13, 255, 44, 12, 13, 255, 43, 12, 13, 255, 42, 12, 13, 255, 41, 12, 
-    13, 255, 40, 12, 13, 255, 39, 20, 1, 167, 229, 12, 231, 16, 20, 1, 167, 
-    243, 70, 244, 36, 20, 1, 167, 224, 251, 231, 17, 225, 57, 20, 1, 167, 
-    224, 251, 231, 17, 225, 58, 20, 1, 167, 229, 226, 231, 16, 20, 1, 167, 
-    219, 221, 20, 1, 167, 216, 66, 231, 16, 20, 1, 167, 227, 118, 231, 16, 
-    20, 1, 167, 220, 19, 226, 90, 228, 169, 20, 1, 167, 224, 251, 226, 90, 
-    228, 170, 225, 57, 20, 1, 167, 224, 251, 226, 90, 228, 170, 225, 58, 20, 
-    1, 167, 231, 218, 20, 1, 167, 215, 119, 231, 219, 20, 1, 167, 229, 71, 
-    20, 1, 167, 231, 215, 20, 1, 167, 231, 176, 20, 1, 167, 230, 48, 20, 1, 
-    167, 220, 124, 20, 1, 167, 227, 241, 20, 1, 167, 234, 149, 20, 1, 167, 
-    228, 138, 20, 1, 167, 218, 4, 20, 1, 167, 229, 11, 20, 1, 167, 233, 87, 
-    20, 1, 167, 233, 12, 233, 189, 20, 1, 167, 227, 248, 231, 24, 20, 1, 167, 
-    231, 222, 20, 1, 167, 225, 246, 20, 1, 167, 242, 231, 20, 1, 167, 226, 
-    50, 20, 1, 167, 230, 151, 229, 45, 20, 1, 167, 227, 99, 231, 27, 20, 1, 
-    167, 104, 210, 188, 229, 220, 20, 1, 167, 242, 232, 20, 1, 167, 227, 248, 
-    227, 249, 20, 1, 167, 219, 128, 20, 1, 167, 231, 9, 20, 1, 167, 231, 30, 
-    20, 1, 167, 230, 130, 20, 1, 167, 234, 249, 20, 1, 167, 226, 90, 233, 47, 
-    20, 1, 167, 229, 149, 233, 47, 20, 1, 167, 225, 158, 20, 1, 167, 231, 
-    216, 20, 1, 167, 228, 207, 20, 1, 167, 224, 134, 20, 1, 167, 215, 116, 
-    20, 1, 167, 232, 94, 20, 1, 167, 219, 41, 20, 1, 167, 216, 216, 20, 1, 
-    167, 231, 213, 20, 1, 167, 234, 156, 20, 1, 167, 229, 145, 20, 1, 167, 
-    233, 201, 20, 1, 167, 230, 131, 20, 1, 167, 219, 218, 20, 1, 167, 232, 
-    138, 20, 1, 167, 244, 93, 20, 1, 167, 222, 199, 20, 1, 167, 233, 241, 20, 
-    1, 167, 219, 37, 20, 1, 167, 231, 173, 225, 99, 20, 1, 167, 220, 12, 20, 
-    1, 167, 227, 247, 20, 1, 167, 219, 253, 228, 2, 210, 196, 20, 1, 167, 
-    227, 138, 230, 148, 20, 1, 167, 226, 85, 20, 1, 167, 228, 139, 20, 1, 
-    167, 214, 170, 20, 1, 167, 229, 48, 20, 1, 167, 231, 212, 20, 1, 167, 
-    228, 181, 20, 1, 167, 231, 119, 20, 1, 167, 227, 151, 20, 1, 167, 216, 
-    220, 20, 1, 167, 219, 34, 20, 1, 167, 226, 86, 20, 1, 167, 228, 6, 20, 1, 
-    167, 231, 220, 20, 1, 167, 227, 148, 20, 1, 167, 234, 216, 20, 1, 167, 
-    228, 9, 20, 1, 167, 213, 250, 20, 1, 167, 232, 98, 20, 1, 167, 229, 98, 
-    20, 1, 167, 229, 196, 20, 1, 167, 231, 118, 20, 1, 225, 138, 228, 4, 20, 
-    1, 225, 138, 215, 119, 231, 217, 20, 1, 225, 138, 219, 185, 20, 1, 225, 
-    138, 220, 128, 215, 118, 20, 1, 225, 138, 232, 140, 227, 244, 20, 1, 225, 
-    138, 231, 125, 231, 221, 20, 1, 225, 138, 234, 87, 20, 1, 225, 138, 211, 
-    15, 20, 1, 225, 138, 231, 120, 20, 1, 225, 138, 234, 237, 20, 1, 225, 
-    138, 225, 208, 20, 1, 225, 138, 211, 89, 233, 47, 20, 1, 225, 138, 233, 
-    103, 228, 2, 227, 160, 20, 1, 225, 138, 227, 242, 220, 38, 20, 1, 225, 
-    138, 229, 116, 228, 184, 20, 1, 225, 138, 242, 229, 20, 1, 225, 138, 225, 
-    49, 20, 1, 225, 138, 215, 119, 228, 0, 20, 1, 225, 138, 220, 43, 228, 
-    179, 20, 1, 225, 138, 220, 39, 20, 1, 225, 138, 231, 17, 216, 219, 20, 1, 
-    225, 138, 231, 107, 231, 121, 20, 1, 225, 138, 227, 149, 227, 244, 20, 1, 
-    225, 138, 234, 145, 20, 1, 225, 138, 242, 230, 20, 1, 225, 138, 234, 141, 
-    20, 1, 225, 138, 233, 129, 20, 1, 225, 138, 225, 249, 20, 1, 225, 138, 
-    213, 182, 20, 1, 225, 138, 229, 13, 230, 46, 20, 1, 225, 138, 229, 47, 
-    231, 103, 20, 1, 225, 138, 211, 193, 20, 1, 225, 138, 222, 11, 20, 1, 
-    225, 138, 217, 97, 20, 1, 225, 138, 231, 29, 20, 1, 225, 138, 229, 32, 
-    20, 1, 225, 138, 229, 33, 233, 84, 20, 1, 225, 138, 231, 19, 20, 1, 225, 
-    138, 218, 52, 20, 1, 225, 138, 231, 111, 20, 1, 225, 138, 230, 133, 20, 
-    1, 225, 138, 227, 163, 20, 1, 225, 138, 224, 138, 20, 1, 225, 138, 231, 
-    28, 229, 49, 20, 1, 225, 138, 244, 126, 20, 1, 225, 138, 231, 98, 20, 1, 
-    225, 138, 244, 147, 20, 1, 225, 138, 234, 153, 20, 1, 225, 138, 231, 239, 
-    228, 173, 20, 1, 225, 138, 231, 239, 228, 149, 20, 1, 225, 138, 233, 11, 
-    20, 1, 225, 138, 229, 55, 20, 1, 225, 138, 228, 11, 20, 1, 225, 138, 184, 
-    20, 1, 225, 138, 234, 74, 20, 1, 225, 138, 229, 1, 20, 1, 137, 229, 12, 
-    231, 219, 20, 1, 137, 227, 117, 20, 1, 137, 210, 196, 20, 1, 137, 212, 
-    53, 20, 1, 137, 229, 48, 20, 1, 137, 229, 137, 20, 1, 137, 229, 19, 20, 
-    1, 137, 242, 239, 20, 1, 137, 231, 115, 20, 1, 137, 243, 77, 20, 1, 137, 
-    227, 140, 230, 170, 231, 31, 20, 1, 137, 227, 240, 231, 106, 20, 1, 137, 
-    231, 112, 20, 1, 137, 225, 55, 20, 1, 137, 229, 122, 20, 1, 137, 231, 
-    123, 251, 29, 20, 1, 137, 234, 143, 20, 1, 137, 242, 240, 20, 1, 137, 
-    234, 150, 20, 1, 137, 210, 213, 230, 76, 20, 1, 137, 227, 111, 20, 1, 
-    137, 231, 100, 20, 1, 137, 228, 10, 20, 1, 137, 231, 106, 20, 1, 137, 
-    211, 16, 20, 1, 137, 233, 249, 20, 1, 137, 235, 10, 20, 1, 137, 220, 123, 
-    20, 1, 137, 229, 131, 20, 1, 137, 217, 95, 20, 1, 137, 228, 153, 20, 1, 
-    137, 216, 66, 210, 198, 20, 1, 137, 218, 79, 20, 1, 137, 229, 39, 227, 
-    160, 20, 1, 137, 213, 181, 20, 1, 137, 229, 199, 20, 1, 137, 231, 239, 
-    234, 152, 20, 1, 137, 227, 249, 20, 1, 137, 229, 34, 20, 1, 137, 233, 88, 
-    20, 1, 137, 231, 108, 20, 1, 137, 231, 8, 20, 1, 137, 227, 243, 20, 1, 
-    137, 216, 215, 20, 1, 137, 229, 36, 20, 1, 137, 243, 233, 20, 1, 137, 
-    229, 136, 20, 1, 137, 228, 12, 20, 1, 137, 228, 8, 20, 1, 137, 251, 107, 
-    20, 1, 137, 213, 183, 20, 1, 137, 231, 113, 20, 1, 137, 222, 140, 20, 1, 
-    137, 228, 183, 20, 1, 137, 233, 102, 20, 1, 137, 216, 64, 20, 1, 137, 
-    227, 250, 229, 1, 20, 1, 137, 228, 175, 20, 1, 137, 234, 156, 20, 1, 137, 
-    229, 40, 20, 1, 137, 231, 212, 20, 1, 137, 231, 101, 20, 1, 137, 232, 98, 
-    20, 1, 137, 233, 189, 20, 1, 137, 228, 181, 20, 1, 137, 229, 1, 20, 1, 
-    137, 211, 184, 20, 1, 137, 229, 37, 20, 1, 137, 227, 253, 20, 1, 137, 
-    227, 245, 20, 1, 137, 233, 203, 228, 139, 20, 1, 137, 227, 251, 20, 1, 
-    137, 229, 144, 20, 1, 137, 231, 239, 228, 0, 20, 1, 137, 211, 103, 20, 1, 
-    137, 229, 143, 20, 1, 137, 219, 220, 20, 1, 137, 220, 126, 20, 1, 137, 
-    231, 109, 20, 1, 137, 231, 219, 20, 1, 137, 231, 119, 20, 1, 137, 234, 
-    144, 20, 1, 137, 231, 110, 20, 1, 137, 234, 148, 20, 1, 137, 231, 123, 
-    225, 103, 20, 1, 137, 210, 179, 20, 1, 137, 228, 171, 20, 1, 137, 230, 
-    220, 20, 1, 137, 230, 100, 20, 1, 137, 220, 15, 20, 1, 137, 234, 166, 
-    233, 70, 20, 1, 137, 234, 166, 244, 160, 20, 1, 137, 229, 69, 20, 1, 137, 
-    229, 196, 20, 1, 137, 232, 200, 20, 1, 137, 225, 65, 20, 1, 137, 225, 
-    199, 20, 1, 137, 216, 230, 20, 1, 107, 231, 99, 20, 1, 107, 212, 51, 20, 
-    1, 107, 228, 169, 20, 1, 107, 231, 16, 20, 1, 107, 228, 167, 20, 1, 107, 
-    232, 235, 20, 1, 107, 228, 172, 20, 1, 107, 228, 7, 20, 1, 107, 229, 54, 
-    20, 1, 107, 227, 160, 20, 1, 107, 211, 194, 20, 1, 107, 229, 9, 20, 1, 
-    107, 220, 61, 20, 1, 107, 229, 20, 20, 1, 107, 234, 151, 20, 1, 107, 216, 
-    217, 20, 1, 107, 220, 41, 20, 1, 107, 228, 180, 20, 1, 107, 218, 52, 20, 
-    1, 107, 234, 156, 20, 1, 107, 211, 91, 20, 1, 107, 233, 204, 20, 1, 107, 
-    221, 234, 20, 1, 107, 231, 21, 20, 1, 107, 229, 135, 20, 1, 107, 231, 
-    188, 20, 1, 107, 231, 27, 20, 1, 107, 220, 125, 20, 1, 107, 211, 39, 20, 
-    1, 107, 228, 174, 20, 1, 107, 234, 147, 231, 102, 20, 1, 107, 229, 16, 
-    20, 1, 107, 215, 118, 20, 1, 107, 242, 248, 20, 1, 107, 229, 6, 20, 1, 
-    107, 244, 127, 20, 1, 107, 229, 139, 20, 1, 107, 231, 0, 20, 1, 107, 233, 
-    5, 20, 1, 107, 229, 121, 20, 1, 107, 230, 147, 20, 1, 107, 231, 4, 20, 1, 
-    107, 224, 118, 20, 1, 107, 231, 2, 20, 1, 107, 231, 18, 20, 1, 107, 232, 
-    84, 20, 1, 107, 227, 255, 20, 1, 107, 231, 122, 20, 1, 107, 233, 180, 20, 
-    1, 107, 227, 151, 20, 1, 107, 216, 220, 20, 1, 107, 219, 34, 20, 1, 107, 
-    210, 179, 20, 1, 107, 234, 148, 20, 1, 107, 223, 170, 20, 1, 107, 217, 
-    10, 20, 1, 107, 229, 17, 20, 1, 107, 231, 23, 20, 1, 107, 227, 254, 20, 
-    1, 107, 234, 146, 20, 1, 107, 225, 59, 20, 1, 107, 225, 152, 20, 1, 107, 
-    227, 127, 20, 1, 107, 233, 11, 20, 1, 107, 229, 55, 20, 1, 107, 231, 20, 
-    20, 1, 107, 229, 29, 20, 1, 107, 210, 193, 20, 1, 107, 226, 21, 20, 1, 
-    107, 210, 192, 20, 1, 107, 229, 144, 20, 1, 107, 227, 244, 20, 1, 107, 
-    218, 81, 20, 1, 107, 233, 208, 20, 1, 107, 229, 44, 20, 1, 107, 229, 14, 
-    20, 1, 107, 215, 102, 20, 1, 107, 231, 31, 20, 1, 107, 233, 198, 20, 1, 
-    107, 227, 252, 20, 1, 107, 216, 218, 20, 1, 107, 231, 214, 20, 1, 107, 
-    229, 53, 20, 1, 107, 233, 4, 20, 1, 107, 229, 35, 20, 1, 107, 228, 1, 20, 
-    1, 107, 228, 153, 20, 1, 107, 242, 233, 20, 1, 107, 233, 217, 20, 1, 107, 
-    223, 84, 226, 209, 20, 1, 107, 217, 86, 20, 1, 107, 216, 10, 20, 1, 107, 
-    227, 148, 20, 1, 107, 222, 239, 20, 1, 107, 233, 49, 20, 1, 107, 231, 79, 
-    20, 1, 107, 193, 20, 1, 107, 218, 4, 20, 1, 107, 230, 102, 20, 1, 107, 
-    220, 27, 20, 1, 107, 220, 37, 20, 1, 107, 233, 155, 20, 1, 107, 227, 237, 
-    20, 1, 107, 219, 225, 20, 1, 107, 227, 246, 20, 1, 107, 225, 211, 20, 1, 
-    107, 228, 233, 20, 1, 107, 219, 252, 20, 1, 107, 224, 133, 20, 1, 107, 
-    230, 46, 20, 1, 107, 232, 119, 20, 1, 107, 223, 84, 230, 96, 20, 1, 107, 
-    216, 117, 20, 1, 107, 227, 238, 20, 1, 107, 231, 123, 198, 20, 1, 107, 
-    221, 232, 20, 1, 107, 244, 195, 20, 1, 82, 229, 143, 20, 1, 82, 216, 16, 
-    20, 1, 82, 231, 112, 20, 1, 82, 233, 88, 20, 1, 82, 213, 128, 20, 1, 82, 
-    232, 125, 20, 1, 82, 226, 89, 20, 1, 82, 219, 45, 20, 1, 82, 223, 145, 
-    20, 1, 82, 228, 3, 20, 1, 82, 229, 114, 20, 1, 82, 224, 147, 20, 1, 82, 
-    217, 62, 20, 1, 82, 229, 22, 20, 1, 82, 233, 245, 20, 1, 82, 211, 187, 
-    20, 1, 82, 221, 170, 20, 1, 82, 229, 45, 20, 1, 82, 226, 86, 20, 1, 82, 
-    216, 17, 20, 1, 82, 233, 202, 20, 1, 82, 232, 139, 20, 1, 82, 228, 6, 20, 
-    1, 82, 228, 254, 20, 1, 82, 231, 220, 20, 1, 82, 229, 15, 20, 1, 82, 228, 
-    253, 20, 1, 82, 228, 5, 20, 1, 82, 222, 237, 20, 1, 82, 228, 171, 20, 1, 
-    82, 225, 210, 20, 1, 82, 222, 31, 20, 1, 82, 229, 30, 20, 1, 82, 231, 10, 
-    20, 1, 82, 242, 227, 20, 1, 82, 229, 18, 20, 1, 82, 228, 182, 20, 1, 82, 
-    231, 172, 20, 1, 82, 232, 121, 20, 1, 82, 229, 50, 20, 1, 82, 229, 127, 
-    20, 1, 82, 217, 85, 227, 244, 20, 1, 82, 220, 127, 20, 1, 82, 224, 143, 
-    20, 1, 82, 229, 147, 219, 51, 20, 1, 82, 229, 38, 227, 160, 20, 1, 82, 
-    211, 4, 20, 1, 82, 242, 228, 20, 1, 82, 215, 117, 20, 1, 82, 211, 19, 20, 
-    1, 82, 225, 16, 20, 1, 82, 215, 107, 20, 1, 82, 234, 154, 20, 1, 82, 218, 
-    80, 20, 1, 82, 216, 219, 20, 1, 82, 213, 184, 20, 1, 82, 212, 6, 20, 1, 
-    82, 233, 132, 20, 1, 82, 224, 150, 20, 1, 82, 217, 96, 20, 1, 82, 242, 
-    247, 20, 1, 82, 229, 59, 20, 1, 82, 220, 40, 20, 1, 82, 231, 5, 20, 1, 
-    82, 231, 116, 20, 1, 82, 227, 115, 20, 1, 82, 228, 136, 20, 1, 82, 243, 
-    73, 20, 1, 82, 215, 108, 20, 1, 82, 233, 211, 20, 1, 82, 211, 67, 20, 1, 
-    82, 227, 149, 250, 16, 20, 1, 82, 210, 250, 20, 1, 82, 231, 22, 20, 1, 
-    82, 229, 132, 20, 1, 82, 225, 100, 20, 1, 82, 210, 197, 20, 1, 82, 233, 
-    6, 20, 1, 82, 243, 233, 20, 1, 82, 243, 72, 20, 1, 82, 229, 8, 20, 1, 82, 
-    234, 156, 20, 1, 82, 231, 223, 20, 1, 82, 229, 21, 20, 1, 82, 242, 234, 
-    20, 1, 82, 244, 196, 20, 1, 82, 227, 239, 20, 1, 82, 225, 153, 20, 1, 82, 
-    211, 17, 20, 1, 82, 229, 46, 20, 1, 82, 227, 149, 252, 23, 20, 1, 82, 
-    227, 95, 20, 1, 82, 224, 247, 20, 1, 82, 230, 220, 20, 1, 82, 243, 231, 
-    20, 1, 82, 229, 220, 20, 1, 82, 230, 100, 20, 1, 82, 242, 233, 20, 1, 82, 
-    243, 235, 73, 20, 1, 82, 230, 47, 20, 1, 82, 224, 146, 20, 1, 82, 229, 
-    10, 20, 1, 82, 233, 189, 20, 1, 82, 225, 97, 20, 1, 82, 227, 247, 20, 1, 
-    82, 211, 18, 20, 1, 82, 229, 31, 20, 1, 82, 226, 90, 225, 187, 20, 1, 82, 
-    243, 235, 251, 15, 20, 1, 82, 244, 37, 20, 1, 82, 228, 176, 20, 1, 82, 
-    61, 20, 1, 82, 216, 10, 20, 1, 82, 76, 20, 1, 82, 73, 20, 1, 82, 233, 86, 
-    20, 1, 82, 226, 90, 225, 23, 20, 1, 82, 217, 101, 20, 1, 82, 217, 51, 20, 
-    1, 82, 229, 147, 230, 34, 240, 234, 20, 1, 82, 220, 15, 20, 1, 82, 211, 
-    14, 20, 1, 82, 228, 247, 20, 1, 82, 210, 202, 20, 1, 82, 210, 227, 217, 
-    240, 20, 1, 82, 210, 227, 249, 147, 20, 1, 82, 210, 187, 20, 1, 82, 210, 
-    195, 20, 1, 82, 234, 142, 20, 1, 82, 225, 151, 20, 1, 82, 228, 177, 245, 
-    102, 20, 1, 82, 224, 144, 20, 1, 82, 211, 192, 20, 1, 82, 244, 147, 20, 
-    1, 82, 213, 250, 20, 1, 82, 232, 98, 20, 1, 82, 230, 230, 20, 1, 82, 223, 
-    51, 20, 1, 82, 223, 171, 20, 1, 82, 228, 246, 20, 1, 82, 229, 77, 20, 1, 
-    82, 220, 7, 20, 1, 82, 219, 252, 20, 1, 82, 243, 235, 223, 86, 20, 1, 82, 
-    197, 20, 1, 82, 225, 108, 20, 1, 82, 232, 119, 20, 1, 82, 234, 28, 20, 1, 
-    82, 231, 58, 20, 1, 82, 184, 20, 1, 82, 231, 169, 20, 1, 82, 216, 221, 
-    20, 1, 82, 234, 92, 20, 1, 82, 230, 150, 20, 1, 82, 216, 247, 20, 1, 82, 
-    244, 169, 20, 1, 82, 242, 223, 20, 1, 225, 137, 176, 20, 1, 225, 137, 70, 
-    20, 1, 225, 137, 233, 217, 20, 1, 225, 137, 245, 209, 20, 1, 225, 137, 
-    223, 108, 20, 1, 225, 137, 217, 86, 20, 1, 225, 137, 227, 148, 20, 1, 
-    225, 137, 233, 135, 20, 1, 225, 137, 222, 239, 20, 1, 225, 137, 223, 29, 
-    20, 1, 225, 137, 231, 79, 20, 1, 225, 137, 217, 101, 20, 1, 225, 137, 
-    229, 146, 20, 1, 225, 137, 228, 183, 20, 1, 225, 137, 193, 20, 1, 225, 
-    137, 218, 4, 20, 1, 225, 137, 220, 27, 20, 1, 225, 137, 219, 191, 20, 1, 
-    225, 137, 220, 123, 20, 1, 225, 137, 233, 155, 20, 1, 225, 137, 234, 156, 
-    20, 1, 225, 137, 227, 209, 20, 1, 225, 137, 227, 237, 20, 1, 225, 137, 
-    228, 154, 20, 1, 225, 137, 210, 226, 20, 1, 225, 137, 219, 225, 20, 1, 
-    225, 137, 191, 20, 1, 225, 137, 228, 9, 20, 1, 225, 137, 225, 151, 20, 1, 
-    225, 137, 227, 246, 20, 1, 225, 137, 211, 192, 20, 1, 225, 137, 225, 211, 
-    20, 1, 225, 137, 222, 140, 20, 1, 225, 137, 228, 233, 20, 1, 225, 137, 
-    223, 51, 20, 1, 225, 137, 234, 165, 20, 1, 225, 137, 229, 7, 20, 1, 225, 
-    137, 229, 56, 20, 1, 225, 137, 220, 7, 20, 1, 225, 137, 224, 147, 20, 1, 
-    225, 137, 244, 37, 20, 1, 225, 137, 212, 65, 20, 1, 225, 137, 232, 241, 
-    20, 1, 225, 137, 232, 119, 20, 1, 225, 137, 234, 28, 20, 1, 225, 137, 
-    231, 114, 20, 1, 225, 137, 223, 83, 20, 1, 225, 137, 184, 20, 1, 225, 
-    137, 230, 161, 20, 1, 225, 137, 231, 122, 20, 1, 225, 137, 216, 230, 20, 
-    1, 225, 137, 233, 251, 20, 1, 225, 137, 221, 251, 20, 1, 225, 137, 212, 
-    115, 95, 1, 190, 95, 1, 252, 191, 95, 1, 8, 190, 95, 1, 225, 42, 95, 1, 
-    184, 95, 1, 230, 233, 95, 1, 254, 23, 184, 95, 1, 244, 196, 95, 1, 214, 
-    27, 95, 1, 213, 177, 95, 1, 217, 105, 95, 1, 248, 221, 95, 1, 8, 215, 
-    156, 95, 1, 8, 217, 105, 95, 1, 215, 156, 95, 1, 248, 135, 95, 1, 197, 
-    95, 1, 228, 237, 95, 1, 8, 228, 110, 95, 1, 254, 23, 197, 95, 1, 228, 
-    110, 95, 1, 228, 96, 95, 1, 233, 135, 95, 1, 232, 61, 95, 1, 232, 254, 
-    95, 1, 232, 243, 95, 1, 216, 56, 95, 1, 247, 153, 95, 1, 216, 48, 95, 1, 
-    247, 152, 95, 1, 176, 95, 1, 243, 135, 95, 1, 8, 176, 95, 1, 224, 88, 95, 
-    1, 224, 66, 95, 1, 229, 77, 95, 1, 229, 28, 95, 1, 254, 23, 229, 77, 95, 
-    1, 162, 95, 1, 211, 165, 95, 1, 242, 249, 95, 1, 242, 226, 95, 1, 215, 
-    165, 95, 1, 246, 26, 95, 1, 227, 165, 95, 1, 227, 150, 95, 1, 215, 175, 
-    95, 1, 246, 33, 95, 1, 8, 215, 175, 95, 1, 8, 246, 33, 95, 1, 223, 106, 
-    215, 175, 95, 1, 220, 102, 95, 1, 218, 223, 95, 1, 210, 82, 95, 1, 210, 
-    14, 95, 1, 215, 183, 95, 1, 246, 38, 95, 1, 8, 215, 183, 95, 1, 206, 95, 
-    1, 210, 116, 95, 1, 210, 15, 95, 1, 209, 243, 95, 1, 209, 223, 95, 1, 
-    254, 23, 209, 243, 95, 1, 209, 215, 95, 1, 209, 222, 95, 1, 212, 65, 95, 
-    1, 254, 209, 95, 1, 241, 189, 95, 1, 229, 192, 95, 5, 253, 222, 95, 5, 
-    223, 106, 213, 133, 95, 5, 223, 106, 253, 222, 95, 25, 5, 61, 95, 25, 5, 
-    255, 73, 95, 25, 5, 254, 205, 95, 25, 5, 254, 123, 95, 25, 5, 254, 115, 
-    95, 25, 5, 76, 95, 25, 5, 226, 183, 95, 25, 5, 211, 227, 95, 25, 5, 212, 
-    98, 95, 25, 5, 75, 95, 25, 5, 245, 150, 95, 25, 5, 245, 138, 95, 25, 5, 
-    226, 232, 95, 25, 5, 73, 95, 25, 5, 240, 119, 95, 25, 5, 240, 118, 95, 
-    25, 5, 240, 117, 95, 25, 5, 235, 189, 95, 25, 5, 236, 60, 95, 25, 5, 236, 
-    33, 95, 25, 5, 235, 156, 95, 25, 5, 235, 231, 95, 25, 5, 70, 95, 25, 5, 
-    214, 229, 95, 25, 5, 214, 228, 95, 25, 5, 214, 227, 95, 25, 5, 214, 118, 
-    95, 25, 5, 214, 211, 95, 25, 5, 214, 178, 95, 25, 5, 211, 117, 95, 25, 5, 
-    211, 8, 95, 25, 5, 254, 243, 95, 25, 5, 254, 239, 95, 25, 5, 245, 86, 95, 
-    25, 5, 222, 183, 245, 86, 95, 25, 5, 245, 92, 95, 25, 5, 222, 183, 245, 
-    92, 95, 25, 5, 254, 201, 95, 25, 5, 245, 195, 95, 25, 5, 253, 192, 95, 
-    25, 5, 226, 134, 95, 25, 5, 230, 25, 95, 25, 5, 229, 79, 95, 138, 222, 
-    251, 95, 138, 216, 14, 222, 251, 95, 138, 48, 95, 138, 51, 95, 1, 216, 
-    28, 95, 1, 216, 27, 95, 1, 216, 26, 95, 1, 216, 25, 95, 1, 216, 24, 95, 
-    1, 216, 23, 95, 1, 216, 22, 95, 1, 223, 106, 216, 29, 95, 1, 223, 106, 
-    216, 28, 95, 1, 223, 106, 216, 26, 95, 1, 223, 106, 216, 25, 95, 1, 223, 
-    106, 216, 24, 95, 1, 223, 106, 216, 22, 56, 1, 254, 23, 75, 141, 1, 254, 
-    23, 211, 47, 49, 28, 16, 224, 154, 49, 28, 16, 248, 158, 49, 28, 16, 225, 
-    175, 49, 28, 16, 226, 113, 245, 178, 49, 28, 16, 226, 113, 247, 201, 49, 
-    28, 16, 214, 16, 245, 178, 49, 28, 16, 214, 16, 247, 201, 49, 28, 16, 
-    234, 197, 49, 28, 16, 217, 169, 49, 28, 16, 226, 9, 49, 28, 16, 210, 217, 
-    49, 28, 16, 210, 218, 247, 201, 49, 28, 16, 233, 234, 49, 28, 16, 254, 
-    68, 245, 178, 49, 28, 16, 245, 26, 245, 178, 49, 28, 16, 217, 2, 49, 28, 
-    16, 234, 161, 49, 28, 16, 254, 58, 49, 28, 16, 254, 59, 247, 201, 49, 28, 
-    16, 217, 175, 49, 28, 16, 216, 159, 49, 28, 16, 226, 206, 254, 21, 49, 
-    28, 16, 242, 159, 254, 21, 49, 28, 16, 224, 153, 49, 28, 16, 250, 149, 
-    49, 28, 16, 214, 6, 49, 28, 16, 235, 164, 254, 21, 49, 28, 16, 234, 163, 
-    254, 21, 49, 28, 16, 234, 162, 254, 21, 49, 28, 16, 221, 213, 49, 28, 16, 
-    226, 0, 49, 28, 16, 218, 146, 254, 61, 49, 28, 16, 226, 112, 254, 21, 49, 
-    28, 16, 214, 15, 254, 21, 49, 28, 16, 254, 62, 254, 21, 49, 28, 16, 254, 
-    56, 49, 28, 16, 234, 37, 49, 28, 16, 223, 46, 49, 28, 16, 225, 106, 254, 
-    21, 49, 28, 16, 216, 83, 49, 28, 16, 254, 121, 49, 28, 16, 221, 159, 49, 
-    28, 16, 217, 178, 254, 21, 49, 28, 16, 217, 178, 231, 40, 218, 144, 49, 
-    28, 16, 226, 107, 254, 21, 49, 28, 16, 216, 190, 49, 28, 16, 233, 27, 49, 
-    28, 16, 246, 41, 49, 28, 16, 215, 227, 49, 28, 16, 216, 232, 49, 28, 16, 
-    233, 237, 49, 28, 16, 254, 68, 245, 26, 229, 95, 49, 28, 16, 243, 236, 
-    254, 21, 49, 28, 16, 236, 12, 49, 28, 16, 215, 199, 254, 21, 49, 28, 16, 
-    234, 200, 215, 198, 49, 28, 16, 225, 200, 49, 28, 16, 224, 158, 49, 28, 
-    16, 234, 11, 49, 28, 16, 250, 80, 254, 21, 49, 28, 16, 223, 146, 49, 28, 
-    16, 226, 12, 254, 21, 49, 28, 16, 226, 10, 254, 21, 49, 28, 16, 240, 109, 
-    49, 28, 16, 229, 203, 49, 28, 16, 225, 156, 49, 28, 16, 234, 12, 254, 
-    149, 49, 28, 16, 215, 199, 254, 149, 49, 28, 16, 218, 123, 49, 28, 16, 
-    242, 123, 49, 28, 16, 235, 164, 229, 95, 49, 28, 16, 226, 206, 229, 95, 
-    49, 28, 16, 226, 113, 229, 95, 49, 28, 16, 225, 155, 49, 28, 16, 233, 
-    254, 49, 28, 16, 225, 154, 49, 28, 16, 233, 236, 49, 28, 16, 225, 201, 
-    229, 95, 49, 28, 16, 234, 162, 229, 96, 254, 96, 49, 28, 16, 234, 163, 
-    229, 96, 254, 96, 49, 28, 16, 210, 215, 49, 28, 16, 254, 59, 229, 95, 49, 
-    28, 16, 254, 60, 217, 176, 229, 95, 49, 28, 16, 210, 216, 49, 28, 16, 
-    233, 235, 49, 28, 16, 245, 173, 49, 28, 16, 250, 150, 49, 28, 16, 230, 
-    198, 235, 163, 49, 28, 16, 214, 16, 229, 95, 49, 28, 16, 225, 106, 229, 
-    95, 49, 28, 16, 224, 159, 229, 95, 49, 28, 16, 226, 203, 49, 28, 16, 254, 
-    84, 49, 28, 16, 232, 58, 49, 28, 16, 226, 10, 229, 95, 49, 28, 16, 226, 
-    12, 229, 95, 49, 28, 16, 245, 60, 226, 11, 49, 28, 16, 233, 153, 49, 28, 
-    16, 254, 85, 49, 28, 16, 215, 199, 229, 95, 49, 28, 16, 245, 176, 49, 28, 
-    16, 217, 178, 229, 95, 49, 28, 16, 217, 170, 49, 28, 16, 250, 80, 229, 
-    95, 49, 28, 16, 245, 106, 49, 28, 16, 221, 160, 229, 95, 49, 28, 16, 211, 
-    151, 234, 37, 49, 28, 16, 215, 196, 49, 28, 16, 224, 160, 49, 28, 16, 
-    215, 200, 49, 28, 16, 215, 197, 49, 28, 16, 224, 157, 49, 28, 16, 215, 
-    195, 49, 28, 16, 224, 156, 49, 28, 16, 242, 158, 49, 28, 16, 254, 14, 49, 
-    28, 16, 245, 60, 254, 14, 49, 28, 16, 226, 107, 229, 95, 49, 28, 16, 216, 
-    189, 245, 69, 49, 28, 16, 216, 189, 245, 25, 49, 28, 16, 216, 191, 254, 
-    63, 49, 28, 16, 216, 184, 234, 247, 254, 55, 49, 28, 16, 234, 199, 49, 
-    28, 16, 245, 139, 49, 28, 16, 211, 11, 234, 196, 49, 28, 16, 211, 11, 
-    254, 96, 49, 28, 16, 218, 145, 49, 28, 16, 234, 38, 254, 96, 49, 28, 16, 
-    247, 202, 254, 21, 49, 28, 16, 233, 238, 254, 21, 49, 28, 16, 233, 238, 
-    254, 149, 49, 28, 16, 233, 238, 229, 95, 49, 28, 16, 254, 62, 229, 95, 
-    49, 28, 16, 254, 64, 49, 28, 16, 247, 201, 49, 28, 16, 215, 210, 49, 28, 
-    16, 216, 224, 49, 28, 16, 234, 2, 49, 28, 16, 233, 32, 245, 134, 250, 71, 
-    49, 28, 16, 233, 32, 246, 42, 250, 72, 49, 28, 16, 233, 32, 215, 212, 
-    250, 72, 49, 28, 16, 233, 32, 216, 234, 250, 72, 49, 28, 16, 233, 32, 
-    236, 7, 250, 71, 49, 28, 16, 242, 159, 229, 96, 254, 96, 49, 28, 16, 242, 
-    159, 226, 1, 254, 10, 49, 28, 16, 242, 159, 226, 1, 248, 29, 49, 28, 16, 
-    247, 225, 49, 28, 16, 247, 226, 226, 1, 254, 11, 234, 196, 49, 28, 16, 
-    247, 226, 226, 1, 254, 11, 254, 96, 49, 28, 16, 247, 226, 226, 1, 248, 
-    29, 49, 28, 16, 215, 216, 49, 28, 16, 254, 15, 49, 28, 16, 236, 14, 49, 
-    28, 16, 247, 246, 49, 28, 16, 254, 211, 225, 0, 254, 16, 49, 28, 16, 254, 
-    211, 254, 13, 49, 28, 16, 254, 211, 254, 16, 49, 28, 16, 254, 211, 231, 
-    34, 49, 28, 16, 254, 211, 231, 45, 49, 28, 16, 254, 211, 242, 160, 49, 
-    28, 16, 254, 211, 242, 157, 49, 28, 16, 254, 211, 225, 0, 242, 160, 49, 
-    28, 16, 231, 151, 224, 165, 240, 107, 49, 28, 16, 231, 151, 254, 151, 
-    224, 165, 240, 107, 49, 28, 16, 231, 151, 248, 28, 240, 107, 49, 28, 16, 
-    231, 151, 254, 151, 248, 28, 240, 107, 49, 28, 16, 231, 151, 215, 205, 
-    240, 107, 49, 28, 16, 231, 151, 215, 217, 49, 28, 16, 231, 151, 216, 228, 
-    240, 107, 49, 28, 16, 231, 151, 216, 228, 233, 35, 240, 107, 49, 28, 16, 
-    231, 151, 233, 35, 240, 107, 49, 28, 16, 231, 151, 225, 39, 240, 107, 49, 
-    28, 16, 235, 169, 216, 251, 240, 108, 49, 28, 16, 254, 60, 216, 251, 240, 
-    108, 49, 28, 16, 244, 172, 216, 225, 49, 28, 16, 244, 172, 230, 143, 49, 
-    28, 16, 244, 172, 247, 230, 49, 28, 16, 231, 151, 214, 10, 240, 107, 49, 
-    28, 16, 231, 151, 224, 164, 240, 107, 49, 28, 16, 231, 151, 225, 39, 216, 
-    228, 240, 107, 49, 28, 16, 242, 155, 230, 26, 254, 63, 49, 28, 16, 242, 
-    155, 230, 26, 247, 200, 49, 28, 16, 245, 148, 234, 247, 243, 236, 213, 
-    124, 49, 28, 16, 236, 13, 49, 28, 16, 236, 11, 49, 28, 16, 243, 236, 254, 
-    22, 248, 27, 240, 106, 49, 28, 16, 243, 236, 247, 244, 190, 49, 28, 16, 
-    243, 236, 247, 244, 229, 203, 49, 28, 16, 243, 236, 229, 198, 240, 107, 
-    49, 28, 16, 243, 236, 247, 244, 248, 3, 49, 28, 16, 243, 236, 219, 102, 
-    247, 243, 248, 3, 49, 28, 16, 243, 236, 247, 244, 234, 182, 49, 28, 16, 
-    243, 236, 247, 244, 210, 23, 49, 28, 16, 243, 236, 247, 244, 228, 234, 
-    234, 196, 49, 28, 16, 243, 236, 247, 244, 228, 234, 254, 96, 49, 28, 16, 
-    243, 236, 231, 191, 250, 73, 247, 230, 49, 28, 16, 243, 236, 231, 191, 
-    250, 73, 230, 143, 49, 28, 16, 244, 122, 219, 102, 250, 73, 214, 9, 49, 
-    28, 16, 243, 236, 219, 102, 250, 73, 217, 179, 49, 28, 16, 243, 236, 229, 
-    97, 49, 28, 16, 250, 74, 209, 249, 49, 28, 16, 250, 74, 234, 36, 49, 28, 
-    16, 250, 74, 219, 9, 49, 28, 16, 243, 236, 240, 154, 211, 10, 216, 229, 
-    49, 28, 16, 243, 236, 245, 149, 254, 86, 49, 28, 16, 211, 10, 215, 206, 
-    49, 28, 16, 247, 238, 215, 206, 49, 28, 16, 247, 238, 216, 229, 49, 28, 
-    16, 247, 238, 254, 65, 246, 42, 247, 139, 49, 28, 16, 247, 238, 230, 141, 
-    216, 233, 247, 139, 49, 28, 16, 247, 238, 247, 222, 245, 36, 247, 139, 
-    49, 28, 16, 247, 238, 215, 214, 226, 211, 247, 139, 49, 28, 16, 211, 10, 
-    254, 65, 246, 42, 247, 139, 49, 28, 16, 211, 10, 230, 141, 216, 233, 247, 
-    139, 49, 28, 16, 211, 10, 247, 222, 245, 36, 247, 139, 49, 28, 16, 211, 
-    10, 215, 214, 226, 211, 247, 139, 49, 28, 16, 243, 49, 247, 237, 49, 28, 
-    16, 243, 49, 211, 9, 49, 28, 16, 247, 245, 254, 65, 230, 199, 49, 28, 16, 
-    247, 245, 254, 65, 231, 73, 49, 28, 16, 247, 245, 247, 201, 49, 28, 16, 
-    247, 245, 216, 182, 49, 28, 16, 219, 163, 216, 182, 49, 28, 16, 219, 163, 
-    216, 183, 247, 186, 49, 28, 16, 219, 163, 216, 183, 215, 207, 49, 28, 16, 
-    219, 163, 216, 183, 216, 222, 49, 28, 16, 219, 163, 253, 244, 49, 28, 16, 
-    219, 163, 253, 245, 247, 186, 49, 28, 16, 219, 163, 253, 245, 215, 207, 
-    49, 28, 16, 219, 163, 253, 245, 216, 222, 49, 28, 16, 247, 223, 243, 30, 
-    49, 28, 16, 247, 229, 226, 134, 49, 28, 16, 218, 137, 49, 28, 16, 254, 7, 
-    190, 49, 28, 16, 254, 7, 213, 124, 49, 28, 16, 254, 7, 243, 135, 49, 28, 
-    16, 254, 7, 248, 3, 49, 28, 16, 254, 7, 234, 182, 49, 28, 16, 254, 7, 
-    210, 23, 49, 28, 16, 254, 7, 228, 233, 49, 28, 16, 234, 162, 229, 96, 
-    231, 44, 49, 28, 16, 234, 163, 229, 96, 231, 44, 49, 28, 16, 234, 162, 
-    229, 96, 234, 196, 49, 28, 16, 234, 163, 229, 96, 234, 196, 49, 28, 16, 
-    234, 38, 234, 196, 49, 28, 16, 242, 159, 229, 96, 234, 196, 28, 16, 219, 
-    155, 252, 135, 28, 16, 52, 252, 135, 28, 16, 40, 252, 135, 28, 16, 223, 
-    50, 40, 252, 135, 28, 16, 248, 155, 252, 135, 28, 16, 219, 251, 252, 135, 
-    28, 16, 43, 223, 77, 50, 28, 16, 44, 223, 77, 50, 28, 16, 223, 77, 247, 
-    118, 28, 16, 248, 196, 221, 163, 28, 16, 248, 222, 250, 249, 28, 16, 221, 
-    163, 28, 16, 249, 234, 28, 16, 223, 75, 244, 111, 28, 16, 223, 75, 244, 
-    110, 28, 16, 223, 75, 244, 109, 28, 16, 244, 131, 28, 16, 244, 132, 51, 
-    28, 16, 251, 148, 78, 28, 16, 251, 24, 28, 16, 251, 159, 28, 16, 127, 28, 
-    16, 226, 193, 218, 163, 28, 16, 215, 57, 218, 163, 28, 16, 216, 142, 218, 
-    163, 28, 16, 244, 10, 218, 163, 28, 16, 244, 80, 218, 163, 28, 16, 219, 
-    124, 218, 163, 28, 16, 219, 122, 243, 250, 28, 16, 244, 8, 243, 250, 28, 
-    16, 243, 203, 250, 14, 28, 16, 243, 203, 250, 15, 226, 136, 254, 142, 28, 
-    16, 243, 203, 250, 15, 226, 136, 252, 122, 28, 16, 251, 67, 250, 14, 28, 
-    16, 245, 7, 250, 14, 28, 16, 245, 7, 250, 15, 226, 136, 254, 142, 28, 16, 
-    245, 7, 250, 15, 226, 136, 252, 122, 28, 16, 246, 83, 250, 13, 28, 16, 
-    246, 83, 250, 12, 28, 16, 230, 85, 231, 90, 223, 61, 28, 16, 52, 220, 75, 
-    28, 16, 52, 244, 65, 28, 16, 244, 66, 214, 163, 28, 16, 244, 66, 246, 
-    106, 28, 16, 229, 188, 214, 163, 28, 16, 229, 188, 246, 106, 28, 16, 220, 
-    76, 214, 163, 28, 16, 220, 76, 246, 106, 28, 16, 224, 22, 138, 220, 75, 
-    28, 16, 224, 22, 138, 244, 65, 28, 16, 249, 216, 216, 87, 28, 16, 249, 
-    85, 216, 87, 28, 16, 226, 136, 254, 142, 28, 16, 226, 136, 252, 122, 28, 
-    16, 224, 4, 254, 142, 28, 16, 224, 4, 252, 122, 28, 16, 230, 88, 223, 61, 
-    28, 16, 211, 251, 223, 61, 28, 16, 163, 223, 61, 28, 16, 224, 22, 223, 
-    61, 28, 16, 245, 189, 223, 61, 28, 16, 219, 118, 223, 61, 28, 16, 216, 
-    160, 223, 61, 28, 16, 219, 110, 223, 61, 28, 16, 123, 240, 211, 215, 71, 
-    223, 61, 28, 16, 211, 179, 228, 43, 28, 16, 96, 228, 43, 28, 16, 250, 36, 
-    211, 179, 228, 43, 28, 16, 42, 228, 44, 211, 253, 28, 16, 42, 228, 44, 
-    251, 221, 28, 16, 215, 226, 228, 44, 120, 211, 253, 28, 16, 215, 226, 
-    228, 44, 120, 251, 221, 28, 16, 215, 226, 228, 44, 43, 211, 253, 28, 16, 
-    215, 226, 228, 44, 43, 251, 221, 28, 16, 215, 226, 228, 44, 44, 211, 253, 
-    28, 16, 215, 226, 228, 44, 44, 251, 221, 28, 16, 215, 226, 228, 44, 124, 
-    211, 253, 28, 16, 215, 226, 228, 44, 124, 251, 221, 28, 16, 215, 226, 
-    228, 44, 120, 44, 211, 253, 28, 16, 215, 226, 228, 44, 120, 44, 251, 221, 
-    28, 16, 230, 129, 228, 44, 211, 253, 28, 16, 230, 129, 228, 44, 251, 221, 
-    28, 16, 215, 223, 228, 44, 124, 211, 253, 28, 16, 215, 223, 228, 44, 124, 
-    251, 221, 28, 16, 226, 4, 228, 43, 28, 16, 213, 132, 228, 43, 28, 16, 
-    228, 44, 251, 221, 28, 16, 227, 203, 228, 43, 28, 16, 249, 241, 228, 44, 
-    211, 253, 28, 16, 249, 241, 228, 44, 251, 221, 28, 16, 251, 146, 28, 16, 
-    211, 251, 228, 47, 28, 16, 163, 228, 47, 28, 16, 224, 22, 228, 47, 28, 
-    16, 245, 189, 228, 47, 28, 16, 219, 118, 228, 47, 28, 16, 216, 160, 228, 
-    47, 28, 16, 219, 110, 228, 47, 28, 16, 123, 240, 211, 215, 71, 228, 47, 
-    28, 16, 38, 218, 139, 28, 16, 38, 218, 240, 218, 139, 28, 16, 38, 215, 
-    234, 28, 16, 38, 215, 233, 28, 16, 38, 215, 232, 28, 16, 244, 101, 215, 
-    234, 28, 16, 244, 101, 215, 233, 28, 16, 244, 101, 215, 232, 28, 16, 38, 
-    253, 189, 247, 120, 28, 16, 38, 244, 72, 28, 16, 38, 244, 71, 28, 16, 38, 
-    244, 70, 28, 16, 38, 244, 69, 28, 16, 38, 244, 68, 28, 16, 252, 58, 252, 
-    74, 28, 16, 245, 143, 252, 74, 28, 16, 252, 58, 216, 111, 28, 16, 245, 
-    143, 216, 111, 28, 16, 252, 58, 219, 80, 28, 16, 245, 143, 219, 80, 28, 
-    16, 252, 58, 225, 115, 28, 16, 245, 143, 225, 115, 28, 16, 38, 255, 14, 
-    28, 16, 38, 218, 165, 28, 16, 38, 216, 238, 28, 16, 38, 218, 166, 28, 16, 
-    38, 231, 162, 28, 16, 38, 231, 161, 28, 16, 38, 255, 13, 28, 16, 38, 232, 
-    112, 28, 16, 253, 254, 214, 163, 28, 16, 253, 254, 246, 106, 28, 16, 38, 
-    247, 135, 28, 16, 38, 222, 231, 28, 16, 38, 244, 58, 28, 16, 38, 219, 76, 
-    28, 16, 38, 252, 38, 28, 16, 38, 52, 216, 19, 28, 16, 38, 215, 211, 216, 
-    19, 28, 16, 222, 235, 28, 16, 218, 75, 28, 16, 210, 159, 28, 16, 225, 
-    107, 28, 16, 231, 25, 28, 16, 244, 17, 28, 16, 249, 138, 28, 16, 248, 78, 
-    28, 16, 242, 150, 228, 48, 219, 95, 28, 16, 242, 150, 228, 48, 228, 75, 
-    219, 95, 28, 16, 216, 0, 28, 16, 215, 95, 28, 16, 235, 193, 215, 95, 28, 
-    16, 215, 96, 219, 95, 28, 16, 215, 96, 214, 163, 28, 16, 226, 148, 218, 
-    102, 28, 16, 226, 148, 218, 99, 28, 16, 226, 148, 218, 98, 28, 16, 226, 
-    148, 218, 97, 28, 16, 226, 148, 218, 96, 28, 16, 226, 148, 218, 95, 28, 
-    16, 226, 148, 218, 94, 28, 16, 226, 148, 218, 93, 28, 16, 226, 148, 218, 
-    92, 28, 16, 226, 148, 218, 101, 28, 16, 226, 148, 218, 100, 28, 16, 241, 
-    245, 28, 16, 229, 105, 28, 16, 245, 143, 64, 218, 133, 28, 16, 248, 71, 
-    219, 95, 28, 16, 38, 124, 251, 169, 28, 16, 38, 120, 251, 169, 28, 16, 
-    38, 242, 0, 28, 16, 38, 219, 67, 225, 43, 28, 16, 225, 216, 78, 28, 16, 
-    225, 216, 120, 78, 28, 16, 163, 225, 216, 78, 28, 16, 242, 182, 214, 163, 
-    28, 16, 242, 182, 246, 106, 28, 16, 2, 244, 100, 28, 16, 248, 180, 28, 
-    16, 248, 181, 254, 154, 28, 16, 231, 133, 28, 16, 232, 129, 28, 16, 251, 
-    143, 28, 16, 220, 154, 211, 253, 28, 16, 220, 154, 251, 221, 28, 16, 230, 
-    184, 28, 16, 230, 185, 251, 221, 28, 16, 220, 148, 211, 253, 28, 16, 220, 
-    148, 251, 221, 28, 16, 243, 220, 211, 253, 28, 16, 243, 220, 251, 221, 
-    28, 16, 232, 130, 225, 180, 223, 61, 28, 16, 232, 130, 236, 4, 223, 61, 
-    28, 16, 251, 144, 223, 61, 28, 16, 220, 154, 223, 61, 28, 16, 230, 185, 
-    223, 61, 28, 16, 220, 148, 223, 61, 28, 16, 216, 249, 225, 178, 249, 107, 
-    224, 174, 225, 179, 28, 16, 216, 249, 225, 178, 249, 107, 224, 174, 236, 
-    3, 28, 16, 216, 249, 225, 178, 249, 107, 224, 174, 225, 180, 247, 211, 
-    28, 16, 216, 249, 236, 2, 249, 107, 224, 174, 225, 179, 28, 16, 216, 249, 
-    236, 2, 249, 107, 224, 174, 236, 3, 28, 16, 216, 249, 236, 2, 249, 107, 
-    224, 174, 236, 4, 247, 211, 28, 16, 216, 249, 236, 2, 249, 107, 224, 174, 
-    236, 4, 247, 210, 28, 16, 216, 249, 236, 2, 249, 107, 224, 174, 236, 4, 
-    247, 209, 28, 16, 249, 133, 28, 16, 242, 126, 251, 67, 250, 14, 28, 16, 
-    242, 126, 245, 7, 250, 14, 28, 16, 42, 253, 158, 28, 16, 213, 151, 28, 
-    16, 225, 14, 28, 16, 250, 5, 28, 16, 221, 203, 28, 16, 250, 9, 28, 16, 
-    216, 7, 28, 16, 224, 242, 28, 16, 224, 243, 244, 60, 28, 16, 221, 204, 
-    244, 60, 28, 16, 216, 8, 223, 58, 28, 16, 225, 163, 218, 66, 26, 213, 
-    137, 187, 217, 229, 26, 213, 137, 187, 217, 218, 26, 213, 137, 187, 217, 
-    208, 26, 213, 137, 187, 217, 201, 26, 213, 137, 187, 217, 193, 26, 213, 
-    137, 187, 217, 187, 26, 213, 137, 187, 217, 186, 26, 213, 137, 187, 217, 
-    185, 26, 213, 137, 187, 217, 184, 26, 213, 137, 187, 217, 228, 26, 213, 
-    137, 187, 217, 227, 26, 213, 137, 187, 217, 226, 26, 213, 137, 187, 217, 
-    225, 26, 213, 137, 187, 217, 224, 26, 213, 137, 187, 217, 223, 26, 213, 
-    137, 187, 217, 222, 26, 213, 137, 187, 217, 221, 26, 213, 137, 187, 217, 
-    220, 26, 213, 137, 187, 217, 219, 26, 213, 137, 187, 217, 217, 26, 213, 
-    137, 187, 217, 216, 26, 213, 137, 187, 217, 215, 26, 213, 137, 187, 217, 
-    214, 26, 213, 137, 187, 217, 213, 26, 213, 137, 187, 217, 192, 26, 213, 
-    137, 187, 217, 191, 26, 213, 137, 187, 217, 190, 26, 213, 137, 187, 217, 
-    189, 26, 213, 137, 187, 217, 188, 26, 235, 214, 187, 217, 229, 26, 235, 
-    214, 187, 217, 218, 26, 235, 214, 187, 217, 201, 26, 235, 214, 187, 217, 
-    193, 26, 235, 214, 187, 217, 186, 26, 235, 214, 187, 217, 185, 26, 235, 
-    214, 187, 217, 227, 26, 235, 214, 187, 217, 226, 26, 235, 214, 187, 217, 
-    225, 26, 235, 214, 187, 217, 224, 26, 235, 214, 187, 217, 221, 26, 235, 
-    214, 187, 217, 220, 26, 235, 214, 187, 217, 219, 26, 235, 214, 187, 217, 
-    214, 26, 235, 214, 187, 217, 213, 26, 235, 214, 187, 217, 212, 26, 235, 
-    214, 187, 217, 211, 26, 235, 214, 187, 217, 210, 26, 235, 214, 187, 217, 
-    209, 26, 235, 214, 187, 217, 207, 26, 235, 214, 187, 217, 206, 26, 235, 
-    214, 187, 217, 205, 26, 235, 214, 187, 217, 204, 26, 235, 214, 187, 217, 
-    203, 26, 235, 214, 187, 217, 202, 26, 235, 214, 187, 217, 200, 26, 235, 
-    214, 187, 217, 199, 26, 235, 214, 187, 217, 198, 26, 235, 214, 187, 217, 
-    197, 26, 235, 214, 187, 217, 196, 26, 235, 214, 187, 217, 195, 26, 235, 
-    214, 187, 217, 194, 26, 235, 214, 187, 217, 192, 26, 235, 214, 187, 217, 
-    191, 26, 235, 214, 187, 217, 190, 26, 235, 214, 187, 217, 189, 26, 235, 
-    214, 187, 217, 188, 38, 26, 28, 215, 208, 38, 26, 28, 216, 223, 38, 26, 
-    28, 225, 188, 26, 28, 233, 31, 230, 142, 31, 245, 223, 247, 224, 31, 241, 
-    222, 245, 223, 247, 224, 31, 240, 214, 245, 223, 247, 224, 31, 245, 222, 
-    241, 223, 247, 224, 31, 245, 222, 240, 213, 247, 224, 31, 245, 223, 180, 
-    31, 250, 174, 180, 31, 243, 229, 250, 35, 180, 31, 230, 177, 180, 31, 
-    252, 130, 180, 31, 234, 179, 219, 79, 180, 31, 249, 179, 180, 31, 253, 
-    233, 180, 31, 226, 163, 180, 31, 251, 153, 226, 130, 180, 31, 248, 73, 
-    177, 247, 179, 180, 31, 247, 176, 180, 31, 210, 222, 180, 31, 235, 247, 
-    180, 31, 225, 197, 180, 31, 223, 127, 180, 31, 249, 189, 180, 31, 241, 
-    60, 252, 184, 180, 31, 212, 59, 180, 31, 244, 39, 180, 31, 254, 246, 180, 
-    31, 223, 89, 180, 31, 223, 65, 180, 31, 245, 221, 180, 31, 235, 53, 180, 
-    31, 249, 184, 180, 31, 245, 142, 180, 31, 246, 52, 180, 31, 250, 145, 
-    180, 31, 248, 82, 180, 31, 23, 223, 64, 180, 31, 226, 81, 180, 31, 233, 
-    34, 180, 31, 249, 254, 180, 31, 234, 77, 180, 31, 243, 86, 180, 31, 218, 
-    112, 180, 31, 224, 130, 180, 31, 243, 228, 180, 31, 223, 66, 180, 31, 
-    233, 71, 177, 230, 157, 180, 31, 223, 62, 180, 31, 242, 168, 216, 42, 
-    231, 76, 180, 31, 245, 144, 180, 31, 218, 124, 180, 31, 242, 128, 180, 
-    31, 245, 136, 180, 31, 225, 235, 180, 31, 222, 225, 180, 31, 244, 59, 
-    180, 31, 214, 8, 177, 212, 44, 180, 31, 249, 193, 180, 31, 231, 89, 180, 
-    31, 245, 61, 180, 31, 214, 172, 180, 31, 247, 212, 180, 31, 250, 0, 230, 
-    110, 180, 31, 242, 106, 180, 31, 243, 87, 235, 255, 180, 31, 231, 141, 
-    180, 31, 255, 10, 180, 31, 245, 157, 180, 31, 246, 109, 180, 31, 212, 42, 
-    180, 31, 219, 150, 180, 31, 235, 222, 180, 31, 248, 42, 180, 31, 248, 
-    160, 180, 31, 247, 208, 180, 31, 245, 29, 180, 31, 220, 115, 180, 31, 
-    218, 128, 180, 31, 242, 2, 180, 31, 249, 212, 180, 31, 249, 251, 180, 31, 
-    244, 177, 180, 31, 254, 212, 180, 31, 249, 211, 180, 31, 226, 197, 216, 
-    196, 213, 242, 180, 31, 247, 232, 180, 31, 233, 124, 180, 31, 244, 13, 
-    249, 149, 222, 202, 214, 174, 21, 110, 249, 149, 222, 202, 214, 174, 21, 
-    105, 249, 149, 222, 202, 214, 174, 21, 158, 249, 149, 222, 202, 214, 174, 
-    21, 161, 249, 149, 222, 202, 214, 174, 21, 189, 249, 149, 222, 202, 214, 
-    174, 21, 194, 249, 149, 222, 202, 214, 174, 21, 198, 249, 149, 222, 202, 
-    214, 174, 21, 195, 249, 149, 222, 202, 214, 174, 21, 200, 249, 149, 222, 
-    202, 216, 243, 21, 110, 249, 149, 222, 202, 216, 243, 21, 105, 249, 149, 
-    222, 202, 216, 243, 21, 158, 249, 149, 222, 202, 216, 243, 21, 161, 249, 
-    149, 222, 202, 216, 243, 21, 189, 249, 149, 222, 202, 216, 243, 21, 194, 
-    249, 149, 222, 202, 216, 243, 21, 198, 249, 149, 222, 202, 216, 243, 21, 
-    195, 249, 149, 222, 202, 216, 243, 21, 200, 11, 23, 6, 61, 11, 23, 6, 
-    253, 158, 11, 23, 6, 251, 66, 11, 23, 6, 249, 60, 11, 23, 6, 75, 11, 23, 
-    6, 245, 6, 11, 23, 6, 243, 202, 11, 23, 6, 242, 60, 11, 23, 6, 73, 11, 
-    23, 6, 235, 144, 11, 23, 6, 235, 23, 11, 23, 6, 156, 11, 23, 6, 193, 11, 
-    23, 6, 230, 25, 11, 23, 6, 76, 11, 23, 6, 226, 105, 11, 23, 6, 224, 96, 
-    11, 23, 6, 153, 11, 23, 6, 222, 91, 11, 23, 6, 217, 152, 11, 23, 6, 70, 
-    11, 23, 6, 214, 105, 11, 23, 6, 212, 98, 11, 23, 6, 211, 178, 11, 23, 6, 
-    211, 117, 11, 23, 6, 210, 159, 11, 23, 4, 61, 11, 23, 4, 253, 158, 11, 
-    23, 4, 251, 66, 11, 23, 4, 249, 60, 11, 23, 4, 75, 11, 23, 4, 245, 6, 11, 
-    23, 4, 243, 202, 11, 23, 4, 242, 60, 11, 23, 4, 73, 11, 23, 4, 235, 144, 
-    11, 23, 4, 235, 23, 11, 23, 4, 156, 11, 23, 4, 193, 11, 23, 4, 230, 25, 
-    11, 23, 4, 76, 11, 23, 4, 226, 105, 11, 23, 4, 224, 96, 11, 23, 4, 153, 
-    11, 23, 4, 222, 91, 11, 23, 4, 217, 152, 11, 23, 4, 70, 11, 23, 4, 214, 
-    105, 11, 23, 4, 212, 98, 11, 23, 4, 211, 178, 11, 23, 4, 211, 117, 11, 
-    23, 4, 210, 159, 11, 32, 6, 61, 11, 32, 6, 253, 158, 11, 32, 6, 251, 66, 
-    11, 32, 6, 249, 60, 11, 32, 6, 75, 11, 32, 6, 245, 6, 11, 32, 6, 243, 
-    202, 11, 32, 6, 242, 60, 11, 32, 6, 73, 11, 32, 6, 235, 144, 11, 32, 6, 
-    235, 23, 11, 32, 6, 156, 11, 32, 6, 193, 11, 32, 6, 230, 25, 11, 32, 6, 
-    76, 11, 32, 6, 226, 105, 11, 32, 6, 224, 96, 11, 32, 6, 153, 11, 32, 6, 
-    222, 91, 11, 32, 6, 217, 152, 11, 32, 6, 70, 11, 32, 6, 214, 105, 11, 32, 
-    6, 212, 98, 11, 32, 6, 211, 178, 11, 32, 6, 211, 117, 11, 32, 6, 210, 
-    159, 11, 32, 4, 61, 11, 32, 4, 253, 158, 11, 32, 4, 251, 66, 11, 32, 4, 
-    249, 60, 11, 32, 4, 75, 11, 32, 4, 245, 6, 11, 32, 4, 243, 202, 11, 32, 
-    4, 73, 11, 32, 4, 235, 144, 11, 32, 4, 235, 23, 11, 32, 4, 156, 11, 32, 
-    4, 193, 11, 32, 4, 230, 25, 11, 32, 4, 76, 11, 32, 4, 226, 105, 11, 32, 
-    4, 224, 96, 11, 32, 4, 153, 11, 32, 4, 222, 91, 11, 32, 4, 217, 152, 11, 
-    32, 4, 70, 11, 32, 4, 214, 105, 11, 32, 4, 212, 98, 11, 32, 4, 211, 178, 
-    11, 32, 4, 211, 117, 11, 32, 4, 210, 159, 11, 23, 32, 6, 61, 11, 23, 32, 
-    6, 253, 158, 11, 23, 32, 6, 251, 66, 11, 23, 32, 6, 249, 60, 11, 23, 32, 
-    6, 75, 11, 23, 32, 6, 245, 6, 11, 23, 32, 6, 243, 202, 11, 23, 32, 6, 
-    242, 60, 11, 23, 32, 6, 73, 11, 23, 32, 6, 235, 144, 11, 23, 32, 6, 235, 
-    23, 11, 23, 32, 6, 156, 11, 23, 32, 6, 193, 11, 23, 32, 6, 230, 25, 11, 
-    23, 32, 6, 76, 11, 23, 32, 6, 226, 105, 11, 23, 32, 6, 224, 96, 11, 23, 
-    32, 6, 153, 11, 23, 32, 6, 222, 91, 11, 23, 32, 6, 217, 152, 11, 23, 32, 
-    6, 70, 11, 23, 32, 6, 214, 105, 11, 23, 32, 6, 212, 98, 11, 23, 32, 6, 
-    211, 178, 11, 23, 32, 6, 211, 117, 11, 23, 32, 6, 210, 159, 11, 23, 32, 
-    4, 61, 11, 23, 32, 4, 253, 158, 11, 23, 32, 4, 251, 66, 11, 23, 32, 4, 
-    249, 60, 11, 23, 32, 4, 75, 11, 23, 32, 4, 245, 6, 11, 23, 32, 4, 243, 
-    202, 11, 23, 32, 4, 242, 60, 11, 23, 32, 4, 73, 11, 23, 32, 4, 235, 144, 
-    11, 23, 32, 4, 235, 23, 11, 23, 32, 4, 156, 11, 23, 32, 4, 193, 11, 23, 
-    32, 4, 230, 25, 11, 23, 32, 4, 76, 11, 23, 32, 4, 226, 105, 11, 23, 32, 
-    4, 224, 96, 11, 23, 32, 4, 153, 11, 23, 32, 4, 222, 91, 11, 23, 32, 4, 
-    217, 152, 11, 23, 32, 4, 70, 11, 23, 32, 4, 214, 105, 11, 23, 32, 4, 212, 
-    98, 11, 23, 32, 4, 211, 178, 11, 23, 32, 4, 211, 117, 11, 23, 32, 4, 210, 
-    159, 11, 119, 6, 61, 11, 119, 6, 251, 66, 11, 119, 6, 249, 60, 11, 119, 
-    6, 243, 202, 11, 119, 6, 235, 144, 11, 119, 6, 235, 23, 11, 119, 6, 230, 
-    25, 11, 119, 6, 76, 11, 119, 6, 226, 105, 11, 119, 6, 224, 96, 11, 119, 
-    6, 222, 91, 11, 119, 6, 217, 152, 11, 119, 6, 70, 11, 119, 6, 214, 105, 
-    11, 119, 6, 212, 98, 11, 119, 6, 211, 178, 11, 119, 6, 211, 117, 11, 119, 
-    6, 210, 159, 11, 119, 4, 61, 11, 119, 4, 253, 158, 11, 119, 4, 251, 66, 
-    11, 119, 4, 249, 60, 11, 119, 4, 245, 6, 11, 119, 4, 242, 60, 11, 119, 4, 
-    73, 11, 119, 4, 235, 144, 11, 119, 4, 235, 23, 11, 119, 4, 156, 11, 119, 
-    4, 193, 11, 119, 4, 230, 25, 11, 119, 4, 226, 105, 11, 119, 4, 224, 96, 
-    11, 119, 4, 153, 11, 119, 4, 222, 91, 11, 119, 4, 217, 152, 11, 119, 4, 
-    70, 11, 119, 4, 214, 105, 11, 119, 4, 212, 98, 11, 119, 4, 211, 178, 11, 
-    119, 4, 211, 117, 11, 119, 4, 210, 159, 11, 23, 119, 6, 61, 11, 23, 119, 
-    6, 253, 158, 11, 23, 119, 6, 251, 66, 11, 23, 119, 6, 249, 60, 11, 23, 
-    119, 6, 75, 11, 23, 119, 6, 245, 6, 11, 23, 119, 6, 243, 202, 11, 23, 
-    119, 6, 242, 60, 11, 23, 119, 6, 73, 11, 23, 119, 6, 235, 144, 11, 23, 
-    119, 6, 235, 23, 11, 23, 119, 6, 156, 11, 23, 119, 6, 193, 11, 23, 119, 
-    6, 230, 25, 11, 23, 119, 6, 76, 11, 23, 119, 6, 226, 105, 11, 23, 119, 6, 
-    224, 96, 11, 23, 119, 6, 153, 11, 23, 119, 6, 222, 91, 11, 23, 119, 6, 
-    217, 152, 11, 23, 119, 6, 70, 11, 23, 119, 6, 214, 105, 11, 23, 119, 6, 
-    212, 98, 11, 23, 119, 6, 211, 178, 11, 23, 119, 6, 211, 117, 11, 23, 119, 
-    6, 210, 159, 11, 23, 119, 4, 61, 11, 23, 119, 4, 253, 158, 11, 23, 119, 
-    4, 251, 66, 11, 23, 119, 4, 249, 60, 11, 23, 119, 4, 75, 11, 23, 119, 4, 
-    245, 6, 11, 23, 119, 4, 243, 202, 11, 23, 119, 4, 242, 60, 11, 23, 119, 
-    4, 73, 11, 23, 119, 4, 235, 144, 11, 23, 119, 4, 235, 23, 11, 23, 119, 4, 
-    156, 11, 23, 119, 4, 193, 11, 23, 119, 4, 230, 25, 11, 23, 119, 4, 76, 
-    11, 23, 119, 4, 226, 105, 11, 23, 119, 4, 224, 96, 11, 23, 119, 4, 153, 
-    11, 23, 119, 4, 222, 91, 11, 23, 119, 4, 217, 152, 11, 23, 119, 4, 70, 
+    12, 13, 223, 193, 12, 13, 223, 192, 12, 13, 222, 90, 12, 13, 222, 89, 12, 
+    13, 222, 88, 12, 13, 222, 87, 12, 13, 222, 86, 12, 13, 222, 85, 12, 13, 
+    222, 84, 12, 13, 222, 83, 12, 13, 222, 82, 12, 13, 222, 81, 12, 13, 222, 
+    80, 12, 13, 222, 79, 12, 13, 222, 78, 12, 13, 222, 77, 12, 13, 222, 76, 
+    12, 13, 222, 75, 12, 13, 222, 74, 12, 13, 222, 73, 12, 13, 222, 72, 12, 
+    13, 222, 71, 12, 13, 222, 70, 12, 13, 222, 69, 12, 13, 222, 68, 12, 13, 
+    222, 67, 12, 13, 222, 66, 12, 13, 222, 65, 12, 13, 222, 64, 12, 13, 222, 
+    63, 12, 13, 222, 62, 12, 13, 222, 61, 12, 13, 222, 60, 12, 13, 222, 59, 
+    12, 13, 222, 58, 12, 13, 222, 57, 12, 13, 222, 56, 12, 13, 222, 55, 12, 
+    13, 222, 54, 12, 13, 222, 53, 12, 13, 222, 52, 12, 13, 222, 51, 12, 13, 
+    222, 50, 12, 13, 222, 49, 12, 13, 222, 48, 12, 13, 222, 47, 12, 13, 222, 
+    46, 12, 13, 222, 45, 12, 13, 222, 44, 12, 13, 222, 43, 12, 13, 222, 42, 
+    12, 13, 222, 41, 12, 13, 222, 40, 12, 13, 222, 39, 12, 13, 222, 38, 12, 
+    13, 222, 37, 12, 13, 217, 151, 12, 13, 217, 150, 12, 13, 217, 149, 12, 
+    13, 217, 148, 12, 13, 217, 147, 12, 13, 217, 146, 12, 13, 217, 145, 12, 
+    13, 217, 144, 12, 13, 217, 143, 12, 13, 217, 142, 12, 13, 217, 141, 12, 
+    13, 217, 140, 12, 13, 217, 139, 12, 13, 217, 138, 12, 13, 217, 137, 12, 
+    13, 217, 136, 12, 13, 217, 135, 12, 13, 217, 134, 12, 13, 217, 133, 12, 
+    13, 217, 132, 12, 13, 217, 131, 12, 13, 217, 130, 12, 13, 217, 129, 12, 
+    13, 217, 128, 12, 13, 217, 127, 12, 13, 217, 126, 12, 13, 217, 125, 12, 
+    13, 217, 124, 12, 13, 217, 123, 12, 13, 217, 122, 12, 13, 217, 121, 12, 
+    13, 217, 120, 12, 13, 217, 119, 12, 13, 217, 118, 12, 13, 217, 117, 12, 
+    13, 217, 116, 12, 13, 217, 115, 12, 13, 217, 114, 12, 13, 217, 113, 12, 
+    13, 217, 112, 12, 13, 217, 111, 12, 13, 217, 110, 12, 13, 217, 109, 12, 
+    13, 217, 108, 12, 13, 215, 22, 12, 13, 215, 21, 12, 13, 215, 20, 12, 13, 
+    215, 19, 12, 13, 215, 18, 12, 13, 215, 17, 12, 13, 215, 16, 12, 13, 215, 
+    15, 12, 13, 215, 14, 12, 13, 215, 13, 12, 13, 215, 12, 12, 13, 215, 11, 
+    12, 13, 215, 10, 12, 13, 215, 9, 12, 13, 215, 8, 12, 13, 215, 7, 12, 13, 
+    215, 6, 12, 13, 215, 5, 12, 13, 215, 4, 12, 13, 215, 3, 12, 13, 215, 2, 
+    12, 13, 215, 1, 12, 13, 215, 0, 12, 13, 214, 255, 12, 13, 214, 254, 12, 
+    13, 214, 253, 12, 13, 214, 252, 12, 13, 214, 251, 12, 13, 214, 250, 12, 
+    13, 214, 249, 12, 13, 214, 248, 12, 13, 214, 247, 12, 13, 214, 246, 12, 
+    13, 214, 245, 12, 13, 214, 244, 12, 13, 214, 243, 12, 13, 214, 242, 12, 
+    13, 214, 241, 12, 13, 214, 240, 12, 13, 214, 239, 12, 13, 214, 238, 12, 
+    13, 214, 237, 12, 13, 214, 236, 12, 13, 214, 235, 12, 13, 214, 234, 12, 
+    13, 214, 233, 12, 13, 214, 232, 12, 13, 214, 104, 12, 13, 214, 103, 12, 
+    13, 214, 102, 12, 13, 214, 101, 12, 13, 214, 100, 12, 13, 214, 99, 12, 
+    13, 214, 98, 12, 13, 214, 97, 12, 13, 214, 96, 12, 13, 214, 95, 12, 13, 
+    214, 94, 12, 13, 214, 93, 12, 13, 214, 92, 12, 13, 214, 91, 12, 13, 214, 
+    90, 12, 13, 214, 89, 12, 13, 214, 88, 12, 13, 214, 87, 12, 13, 214, 86, 
+    12, 13, 214, 85, 12, 13, 214, 84, 12, 13, 214, 83, 12, 13, 214, 82, 12, 
+    13, 214, 81, 12, 13, 214, 80, 12, 13, 214, 79, 12, 13, 214, 78, 12, 13, 
+    214, 77, 12, 13, 214, 76, 12, 13, 214, 75, 12, 13, 214, 74, 12, 13, 214, 
+    73, 12, 13, 214, 72, 12, 13, 214, 71, 12, 13, 214, 70, 12, 13, 214, 69, 
+    12, 13, 214, 68, 12, 13, 214, 67, 12, 13, 214, 66, 12, 13, 214, 65, 12, 
+    13, 214, 64, 12, 13, 214, 63, 12, 13, 214, 62, 12, 13, 214, 61, 12, 13, 
+    214, 60, 12, 13, 214, 59, 12, 13, 214, 58, 12, 13, 214, 57, 12, 13, 214, 
+    56, 12, 13, 214, 55, 12, 13, 214, 54, 12, 13, 214, 53, 12, 13, 214, 52, 
+    12, 13, 214, 51, 12, 13, 214, 50, 12, 13, 214, 49, 12, 13, 214, 48, 12, 
+    13, 214, 47, 12, 13, 214, 46, 12, 13, 214, 45, 12, 13, 214, 44, 12, 13, 
+    214, 43, 12, 13, 214, 42, 12, 13, 214, 41, 12, 13, 214, 40, 12, 13, 214, 
+    39, 12, 13, 214, 38, 12, 13, 214, 37, 12, 13, 214, 36, 12, 13, 214, 35, 
+    12, 13, 214, 34, 12, 13, 214, 33, 12, 13, 214, 32, 12, 13, 214, 31, 12, 
+    13, 214, 30, 12, 13, 214, 29, 12, 13, 214, 28, 12, 13, 212, 97, 12, 13, 
+    212, 96, 12, 13, 212, 95, 12, 13, 212, 94, 12, 13, 212, 93, 12, 13, 212, 
+    92, 12, 13, 212, 91, 12, 13, 212, 90, 12, 13, 212, 89, 12, 13, 212, 88, 
+    12, 13, 212, 87, 12, 13, 212, 86, 12, 13, 212, 85, 12, 13, 212, 84, 12, 
+    13, 212, 83, 12, 13, 212, 82, 12, 13, 212, 81, 12, 13, 212, 80, 12, 13, 
+    212, 79, 12, 13, 212, 78, 12, 13, 212, 77, 12, 13, 212, 76, 12, 13, 212, 
+    75, 12, 13, 212, 74, 12, 13, 212, 73, 12, 13, 212, 72, 12, 13, 212, 71, 
+    12, 13, 212, 70, 12, 13, 212, 69, 12, 13, 212, 68, 12, 13, 212, 67, 12, 
+    13, 212, 66, 12, 13, 211, 177, 12, 13, 211, 176, 12, 13, 211, 175, 12, 
+    13, 211, 174, 12, 13, 211, 173, 12, 13, 211, 172, 12, 13, 211, 171, 12, 
+    13, 211, 170, 12, 13, 211, 169, 12, 13, 211, 168, 12, 13, 211, 167, 12, 
+    13, 211, 166, 12, 13, 211, 115, 12, 13, 211, 114, 12, 13, 211, 113, 12, 
+    13, 211, 112, 12, 13, 211, 111, 12, 13, 211, 110, 12, 13, 211, 109, 12, 
+    13, 211, 108, 12, 13, 211, 107, 12, 13, 210, 158, 12, 13, 210, 157, 12, 
+    13, 210, 156, 12, 13, 210, 155, 12, 13, 210, 154, 12, 13, 210, 153, 12, 
+    13, 210, 152, 12, 13, 210, 151, 12, 13, 210, 150, 12, 13, 210, 149, 12, 
+    13, 210, 148, 12, 13, 210, 147, 12, 13, 210, 146, 12, 13, 210, 145, 12, 
+    13, 210, 144, 12, 13, 210, 143, 12, 13, 210, 142, 12, 13, 210, 141, 12, 
+    13, 210, 140, 12, 13, 210, 139, 12, 13, 210, 138, 12, 13, 210, 137, 12, 
+    13, 210, 136, 12, 13, 210, 135, 12, 13, 210, 134, 12, 13, 210, 133, 12, 
+    13, 210, 132, 12, 13, 210, 131, 12, 13, 210, 130, 12, 13, 210, 129, 12, 
+    13, 210, 128, 12, 13, 210, 127, 12, 13, 210, 126, 12, 13, 210, 125, 12, 
+    13, 210, 124, 12, 13, 210, 123, 12, 13, 210, 122, 12, 13, 210, 121, 12, 
+    13, 210, 120, 12, 13, 210, 119, 12, 13, 210, 118, 12, 13, 255, 81, 12, 
+    13, 255, 80, 12, 13, 255, 79, 12, 13, 255, 78, 12, 13, 255, 77, 12, 13, 
+    255, 76, 12, 13, 255, 75, 12, 13, 255, 74, 12, 13, 255, 73, 12, 13, 255, 
+    72, 12, 13, 255, 71, 12, 13, 255, 70, 12, 13, 255, 69, 12, 13, 255, 68, 
+    12, 13, 255, 67, 12, 13, 255, 66, 12, 13, 255, 65, 12, 13, 255, 64, 12, 
+    13, 255, 63, 12, 13, 255, 62, 12, 13, 255, 61, 12, 13, 255, 60, 12, 13, 
+    255, 59, 12, 13, 255, 58, 12, 13, 255, 57, 12, 13, 255, 56, 12, 13, 255, 
+    55, 12, 13, 255, 54, 12, 13, 255, 53, 12, 13, 255, 52, 12, 13, 255, 51, 
+    12, 13, 255, 50, 12, 13, 255, 49, 12, 13, 255, 48, 20, 1, 167, 229, 17, 
+    231, 21, 20, 1, 167, 243, 77, 244, 44, 20, 1, 167, 224, 254, 231, 22, 
+    225, 60, 20, 1, 167, 224, 254, 231, 22, 225, 61, 20, 1, 167, 229, 231, 
+    231, 21, 20, 1, 167, 219, 223, 20, 1, 167, 216, 67, 231, 21, 20, 1, 167, 
+    227, 122, 231, 21, 20, 1, 167, 220, 21, 226, 94, 228, 174, 20, 1, 167, 
+    224, 254, 226, 94, 228, 175, 225, 60, 20, 1, 167, 224, 254, 226, 94, 228, 
+    175, 225, 61, 20, 1, 167, 231, 223, 20, 1, 167, 215, 120, 231, 224, 20, 
+    1, 167, 229, 76, 20, 1, 167, 231, 220, 20, 1, 167, 231, 181, 20, 1, 167, 
+    230, 53, 20, 1, 167, 220, 126, 20, 1, 167, 227, 246, 20, 1, 167, 234, 
+    155, 20, 1, 167, 228, 143, 20, 1, 167, 218, 5, 20, 1, 167, 229, 16, 20, 
+    1, 167, 233, 93, 20, 1, 167, 233, 18, 233, 195, 20, 1, 167, 227, 253, 
+    231, 29, 20, 1, 167, 231, 227, 20, 1, 167, 225, 250, 20, 1, 167, 242, 
+    238, 20, 1, 167, 226, 54, 20, 1, 167, 230, 156, 229, 50, 20, 1, 167, 227, 
+    103, 231, 32, 20, 1, 167, 104, 210, 188, 229, 225, 20, 1, 167, 242, 239, 
+    20, 1, 167, 227, 253, 227, 254, 20, 1, 167, 219, 130, 20, 1, 167, 231, 
+    14, 20, 1, 167, 231, 35, 20, 1, 167, 230, 135, 20, 1, 167, 234, 255, 20, 
+    1, 167, 226, 94, 233, 53, 20, 1, 167, 229, 154, 233, 53, 20, 1, 167, 225, 
+    161, 20, 1, 167, 231, 221, 20, 1, 167, 228, 212, 20, 1, 167, 224, 137, 
+    20, 1, 167, 215, 117, 20, 1, 167, 232, 99, 20, 1, 167, 219, 43, 20, 1, 
+    167, 216, 217, 20, 1, 167, 231, 218, 20, 1, 167, 234, 162, 20, 1, 167, 
+    229, 150, 20, 1, 167, 233, 207, 20, 1, 167, 230, 136, 20, 1, 167, 219, 
+    220, 20, 1, 167, 232, 144, 20, 1, 167, 244, 101, 20, 1, 167, 222, 201, 
+    20, 1, 167, 233, 247, 20, 1, 167, 219, 39, 20, 1, 167, 231, 178, 225, 
+    102, 20, 1, 167, 220, 14, 20, 1, 167, 227, 252, 20, 1, 167, 219, 255, 
+    228, 7, 210, 196, 20, 1, 167, 227, 142, 230, 153, 20, 1, 167, 226, 89, 
+    20, 1, 167, 228, 144, 20, 1, 167, 214, 170, 20, 1, 167, 229, 53, 20, 1, 
+    167, 231, 217, 20, 1, 167, 228, 186, 20, 1, 167, 231, 124, 20, 1, 167, 
+    227, 155, 20, 1, 167, 216, 221, 20, 1, 167, 219, 36, 20, 1, 167, 226, 90, 
+    20, 1, 167, 228, 11, 20, 1, 167, 231, 225, 20, 1, 167, 227, 152, 20, 1, 
+    167, 234, 222, 20, 1, 167, 228, 14, 20, 1, 167, 213, 250, 20, 1, 167, 
+    232, 103, 20, 1, 167, 229, 103, 20, 1, 167, 229, 201, 20, 1, 167, 231, 
+    123, 20, 1, 225, 141, 228, 9, 20, 1, 225, 141, 215, 120, 231, 222, 20, 1, 
+    225, 141, 219, 187, 20, 1, 225, 141, 220, 130, 215, 119, 20, 1, 225, 141, 
+    232, 146, 227, 249, 20, 1, 225, 141, 231, 130, 231, 226, 20, 1, 225, 141, 
+    234, 93, 20, 1, 225, 141, 211, 15, 20, 1, 225, 141, 231, 125, 20, 1, 225, 
+    141, 234, 243, 20, 1, 225, 141, 225, 211, 20, 1, 225, 141, 211, 89, 233, 
+    53, 20, 1, 225, 141, 233, 109, 228, 7, 227, 164, 20, 1, 225, 141, 227, 
+    247, 220, 40, 20, 1, 225, 141, 229, 121, 228, 189, 20, 1, 225, 141, 242, 
+    236, 20, 1, 225, 141, 225, 52, 20, 1, 225, 141, 215, 120, 228, 5, 20, 1, 
+    225, 141, 220, 45, 228, 184, 20, 1, 225, 141, 220, 41, 20, 1, 225, 141, 
+    231, 22, 216, 220, 20, 1, 225, 141, 231, 112, 231, 126, 20, 1, 225, 141, 
+    227, 153, 227, 249, 20, 1, 225, 141, 234, 151, 20, 1, 225, 141, 242, 237, 
+    20, 1, 225, 141, 234, 147, 20, 1, 225, 141, 233, 135, 20, 1, 225, 141, 
+    225, 253, 20, 1, 225, 141, 213, 182, 20, 1, 225, 141, 229, 18, 230, 51, 
+    20, 1, 225, 141, 229, 52, 231, 108, 20, 1, 225, 141, 211, 193, 20, 1, 
+    225, 141, 222, 13, 20, 1, 225, 141, 217, 98, 20, 1, 225, 141, 231, 34, 
+    20, 1, 225, 141, 229, 37, 20, 1, 225, 141, 229, 38, 233, 90, 20, 1, 225, 
+    141, 231, 24, 20, 1, 225, 141, 218, 53, 20, 1, 225, 141, 231, 116, 20, 1, 
+    225, 141, 230, 138, 20, 1, 225, 141, 227, 167, 20, 1, 225, 141, 224, 141, 
+    20, 1, 225, 141, 231, 33, 229, 54, 20, 1, 225, 141, 244, 134, 20, 1, 225, 
+    141, 231, 103, 20, 1, 225, 141, 244, 155, 20, 1, 225, 141, 234, 159, 20, 
+    1, 225, 141, 231, 244, 228, 178, 20, 1, 225, 141, 231, 244, 228, 154, 20, 
+    1, 225, 141, 233, 17, 20, 1, 225, 141, 229, 60, 20, 1, 225, 141, 228, 16, 
+    20, 1, 225, 141, 186, 20, 1, 225, 141, 234, 80, 20, 1, 225, 141, 229, 6, 
+    20, 1, 137, 229, 17, 231, 224, 20, 1, 137, 227, 121, 20, 1, 137, 210, 
+    196, 20, 1, 137, 212, 53, 20, 1, 137, 229, 53, 20, 1, 137, 229, 142, 20, 
+    1, 137, 229, 24, 20, 1, 137, 242, 246, 20, 1, 137, 231, 120, 20, 1, 137, 
+    243, 84, 20, 1, 137, 227, 144, 230, 175, 231, 36, 20, 1, 137, 227, 245, 
+    231, 111, 20, 1, 137, 231, 117, 20, 1, 137, 225, 58, 20, 1, 137, 229, 
+    127, 20, 1, 137, 231, 128, 251, 37, 20, 1, 137, 234, 149, 20, 1, 137, 
+    242, 247, 20, 1, 137, 234, 156, 20, 1, 137, 210, 213, 230, 81, 20, 1, 
+    137, 227, 115, 20, 1, 137, 231, 105, 20, 1, 137, 228, 15, 20, 1, 137, 
+    231, 111, 20, 1, 137, 211, 16, 20, 1, 137, 233, 255, 20, 1, 137, 235, 16, 
+    20, 1, 137, 220, 125, 20, 1, 137, 229, 136, 20, 1, 137, 217, 96, 20, 1, 
+    137, 228, 158, 20, 1, 137, 216, 67, 210, 198, 20, 1, 137, 218, 80, 20, 1, 
+    137, 229, 44, 227, 164, 20, 1, 137, 213, 181, 20, 1, 137, 229, 204, 20, 
+    1, 137, 231, 244, 234, 158, 20, 1, 137, 227, 254, 20, 1, 137, 229, 39, 
+    20, 1, 137, 233, 94, 20, 1, 137, 231, 113, 20, 1, 137, 231, 13, 20, 1, 
+    137, 227, 248, 20, 1, 137, 216, 216, 20, 1, 137, 229, 41, 20, 1, 137, 
+    243, 240, 20, 1, 137, 229, 141, 20, 1, 137, 228, 17, 20, 1, 137, 228, 13, 
+    20, 1, 137, 251, 115, 20, 1, 137, 213, 183, 20, 1, 137, 231, 118, 20, 1, 
+    137, 222, 142, 20, 1, 137, 228, 188, 20, 1, 137, 233, 108, 20, 1, 137, 
+    216, 65, 20, 1, 137, 227, 255, 229, 6, 20, 1, 137, 228, 180, 20, 1, 137, 
+    234, 162, 20, 1, 137, 229, 45, 20, 1, 137, 231, 217, 20, 1, 137, 231, 
+    106, 20, 1, 137, 232, 103, 20, 1, 137, 233, 195, 20, 1, 137, 228, 186, 
+    20, 1, 137, 229, 6, 20, 1, 137, 211, 184, 20, 1, 137, 229, 42, 20, 1, 
+    137, 228, 2, 20, 1, 137, 227, 250, 20, 1, 137, 233, 209, 228, 144, 20, 1, 
+    137, 228, 0, 20, 1, 137, 229, 149, 20, 1, 137, 231, 244, 228, 5, 20, 1, 
+    137, 211, 103, 20, 1, 137, 229, 148, 20, 1, 137, 219, 222, 20, 1, 137, 
+    220, 128, 20, 1, 137, 231, 114, 20, 1, 137, 231, 224, 20, 1, 137, 231, 
+    124, 20, 1, 137, 234, 150, 20, 1, 137, 231, 115, 20, 1, 137, 234, 154, 
+    20, 1, 137, 231, 128, 225, 106, 20, 1, 137, 210, 179, 20, 1, 137, 228, 
+    176, 20, 1, 137, 230, 225, 20, 1, 137, 230, 105, 20, 1, 137, 220, 17, 20, 
+    1, 137, 234, 172, 233, 76, 20, 1, 137, 234, 172, 244, 168, 20, 1, 137, 
+    229, 74, 20, 1, 137, 229, 201, 20, 1, 137, 232, 206, 20, 1, 137, 225, 68, 
+    20, 1, 137, 225, 202, 20, 1, 137, 216, 231, 20, 1, 107, 231, 104, 20, 1, 
+    107, 212, 51, 20, 1, 107, 228, 174, 20, 1, 107, 231, 21, 20, 1, 107, 228, 
+    172, 20, 1, 107, 232, 241, 20, 1, 107, 228, 177, 20, 1, 107, 228, 12, 20, 
+    1, 107, 229, 59, 20, 1, 107, 227, 164, 20, 1, 107, 211, 194, 20, 1, 107, 
+    229, 14, 20, 1, 107, 220, 63, 20, 1, 107, 229, 25, 20, 1, 107, 234, 157, 
+    20, 1, 107, 216, 218, 20, 1, 107, 220, 43, 20, 1, 107, 228, 185, 20, 1, 
+    107, 218, 53, 20, 1, 107, 234, 162, 20, 1, 107, 211, 91, 20, 1, 107, 233, 
+    210, 20, 1, 107, 221, 236, 20, 1, 107, 231, 26, 20, 1, 107, 229, 140, 20, 
+    1, 107, 231, 193, 20, 1, 107, 231, 32, 20, 1, 107, 220, 127, 20, 1, 107, 
+    211, 39, 20, 1, 107, 228, 179, 20, 1, 107, 234, 153, 231, 107, 20, 1, 
+    107, 229, 21, 20, 1, 107, 215, 119, 20, 1, 107, 242, 255, 20, 1, 107, 
+    229, 11, 20, 1, 107, 244, 135, 20, 1, 107, 229, 144, 20, 1, 107, 231, 5, 
+    20, 1, 107, 233, 11, 20, 1, 107, 229, 126, 20, 1, 107, 230, 152, 20, 1, 
+    107, 231, 9, 20, 1, 107, 224, 121, 20, 1, 107, 231, 7, 20, 1, 107, 231, 
+    23, 20, 1, 107, 232, 89, 20, 1, 107, 228, 4, 20, 1, 107, 231, 127, 20, 1, 
+    107, 233, 186, 20, 1, 107, 227, 155, 20, 1, 107, 216, 221, 20, 1, 107, 
+    219, 36, 20, 1, 107, 210, 179, 20, 1, 107, 234, 154, 20, 1, 107, 223, 
+    173, 20, 1, 107, 217, 11, 20, 1, 107, 229, 22, 20, 1, 107, 231, 28, 20, 
+    1, 107, 228, 3, 20, 1, 107, 234, 152, 20, 1, 107, 225, 62, 20, 1, 107, 
+    225, 155, 20, 1, 107, 227, 131, 20, 1, 107, 233, 17, 20, 1, 107, 229, 60, 
+    20, 1, 107, 231, 25, 20, 1, 107, 229, 34, 20, 1, 107, 210, 193, 20, 1, 
+    107, 226, 25, 20, 1, 107, 210, 192, 20, 1, 107, 229, 149, 20, 1, 107, 
+    227, 249, 20, 1, 107, 218, 82, 20, 1, 107, 233, 214, 20, 1, 107, 229, 49, 
+    20, 1, 107, 229, 19, 20, 1, 107, 215, 103, 20, 1, 107, 231, 36, 20, 1, 
+    107, 233, 204, 20, 1, 107, 228, 1, 20, 1, 107, 216, 219, 20, 1, 107, 231, 
+    219, 20, 1, 107, 229, 58, 20, 1, 107, 233, 10, 20, 1, 107, 229, 40, 20, 
+    1, 107, 228, 6, 20, 1, 107, 228, 158, 20, 1, 107, 242, 240, 20, 1, 107, 
+    233, 223, 20, 1, 107, 223, 87, 226, 213, 20, 1, 107, 217, 87, 20, 1, 107, 
+    216, 11, 20, 1, 107, 227, 152, 20, 1, 107, 222, 242, 20, 1, 107, 233, 55, 
+    20, 1, 107, 231, 84, 20, 1, 107, 194, 20, 1, 107, 218, 5, 20, 1, 107, 
+    230, 107, 20, 1, 107, 220, 29, 20, 1, 107, 220, 39, 20, 1, 107, 233, 161, 
+    20, 1, 107, 227, 242, 20, 1, 107, 219, 227, 20, 1, 107, 227, 251, 20, 1, 
+    107, 225, 214, 20, 1, 107, 228, 238, 20, 1, 107, 219, 254, 20, 1, 107, 
+    224, 136, 20, 1, 107, 230, 51, 20, 1, 107, 232, 125, 20, 1, 107, 223, 87, 
+    230, 101, 20, 1, 107, 216, 118, 20, 1, 107, 227, 243, 20, 1, 107, 231, 
+    128, 199, 20, 1, 107, 221, 234, 20, 1, 107, 244, 203, 20, 1, 82, 229, 
+    148, 20, 1, 82, 216, 17, 20, 1, 82, 231, 117, 20, 1, 82, 233, 94, 20, 1, 
+    82, 213, 128, 20, 1, 82, 232, 131, 20, 1, 82, 226, 93, 20, 1, 82, 219, 
+    47, 20, 1, 82, 223, 148, 20, 1, 82, 228, 8, 20, 1, 82, 229, 119, 20, 1, 
+    82, 224, 150, 20, 1, 82, 217, 63, 20, 1, 82, 229, 27, 20, 1, 82, 233, 
+    251, 20, 1, 82, 211, 187, 20, 1, 82, 221, 172, 20, 1, 82, 229, 50, 20, 1, 
+    82, 226, 90, 20, 1, 82, 216, 18, 20, 1, 82, 233, 208, 20, 1, 82, 232, 
+    145, 20, 1, 82, 228, 11, 20, 1, 82, 229, 3, 20, 1, 82, 231, 225, 20, 1, 
+    82, 229, 20, 20, 1, 82, 229, 2, 20, 1, 82, 228, 10, 20, 1, 82, 222, 240, 
+    20, 1, 82, 228, 176, 20, 1, 82, 225, 213, 20, 1, 82, 222, 33, 20, 1, 82, 
+    229, 35, 20, 1, 82, 231, 15, 20, 1, 82, 242, 234, 20, 1, 82, 229, 23, 20, 
+    1, 82, 228, 187, 20, 1, 82, 231, 177, 20, 1, 82, 232, 127, 20, 1, 82, 
+    229, 55, 20, 1, 82, 229, 132, 20, 1, 82, 217, 86, 227, 249, 20, 1, 82, 
+    220, 129, 20, 1, 82, 224, 146, 20, 1, 82, 229, 152, 219, 53, 20, 1, 82, 
+    229, 43, 227, 164, 20, 1, 82, 211, 4, 20, 1, 82, 242, 235, 20, 1, 82, 
+    215, 118, 20, 1, 82, 211, 19, 20, 1, 82, 225, 19, 20, 1, 82, 215, 108, 
+    20, 1, 82, 234, 160, 20, 1, 82, 218, 81, 20, 1, 82, 216, 220, 20, 1, 82, 
+    213, 184, 20, 1, 82, 212, 6, 20, 1, 82, 233, 138, 20, 1, 82, 224, 153, 
+    20, 1, 82, 217, 97, 20, 1, 82, 242, 254, 20, 1, 82, 229, 64, 20, 1, 82, 
+    220, 42, 20, 1, 82, 231, 10, 20, 1, 82, 231, 121, 20, 1, 82, 227, 119, 
+    20, 1, 82, 228, 141, 20, 1, 82, 243, 80, 20, 1, 82, 215, 109, 20, 1, 82, 
+    233, 217, 20, 1, 82, 211, 67, 20, 1, 82, 227, 153, 250, 24, 20, 1, 82, 
+    210, 250, 20, 1, 82, 231, 27, 20, 1, 82, 229, 137, 20, 1, 82, 225, 103, 
+    20, 1, 82, 210, 197, 20, 1, 82, 233, 12, 20, 1, 82, 243, 240, 20, 1, 82, 
+    243, 79, 20, 1, 82, 229, 13, 20, 1, 82, 234, 162, 20, 1, 82, 231, 228, 
+    20, 1, 82, 229, 26, 20, 1, 82, 242, 241, 20, 1, 82, 244, 204, 20, 1, 82, 
+    227, 244, 20, 1, 82, 225, 156, 20, 1, 82, 211, 17, 20, 1, 82, 229, 51, 
+    20, 1, 82, 227, 153, 252, 31, 20, 1, 82, 227, 99, 20, 1, 82, 224, 250, 
+    20, 1, 82, 230, 225, 20, 1, 82, 243, 238, 20, 1, 82, 229, 225, 20, 1, 82, 
+    230, 105, 20, 1, 82, 242, 240, 20, 1, 82, 243, 242, 74, 20, 1, 82, 230, 
+    52, 20, 1, 82, 224, 149, 20, 1, 82, 229, 15, 20, 1, 82, 233, 195, 20, 1, 
+    82, 225, 100, 20, 1, 82, 227, 252, 20, 1, 82, 211, 18, 20, 1, 82, 229, 
+    36, 20, 1, 82, 226, 94, 225, 190, 20, 1, 82, 243, 242, 251, 23, 20, 1, 
+    82, 244, 45, 20, 1, 82, 228, 181, 20, 1, 82, 61, 20, 1, 82, 216, 11, 20, 
+    1, 82, 78, 20, 1, 82, 74, 20, 1, 82, 233, 92, 20, 1, 82, 226, 94, 225, 
+    26, 20, 1, 82, 217, 102, 20, 1, 82, 217, 52, 20, 1, 82, 229, 152, 230, 
+    39, 240, 241, 20, 1, 82, 220, 17, 20, 1, 82, 211, 14, 20, 1, 82, 228, 
+    252, 20, 1, 82, 210, 202, 20, 1, 82, 210, 227, 217, 241, 20, 1, 82, 210, 
+    227, 249, 155, 20, 1, 82, 210, 187, 20, 1, 82, 210, 195, 20, 1, 82, 234, 
+    148, 20, 1, 82, 225, 154, 20, 1, 82, 228, 182, 245, 110, 20, 1, 82, 224, 
+    147, 20, 1, 82, 211, 192, 20, 1, 82, 244, 155, 20, 1, 82, 213, 250, 20, 
+    1, 82, 232, 103, 20, 1, 82, 230, 235, 20, 1, 82, 223, 54, 20, 1, 82, 223, 
+    174, 20, 1, 82, 228, 251, 20, 1, 82, 229, 82, 20, 1, 82, 220, 9, 20, 1, 
+    82, 219, 254, 20, 1, 82, 243, 242, 223, 89, 20, 1, 82, 198, 20, 1, 82, 
+    225, 111, 20, 1, 82, 232, 125, 20, 1, 82, 234, 34, 20, 1, 82, 231, 63, 
+    20, 1, 82, 186, 20, 1, 82, 231, 174, 20, 1, 82, 216, 222, 20, 1, 82, 234, 
+    98, 20, 1, 82, 230, 155, 20, 1, 82, 216, 248, 20, 1, 82, 244, 177, 20, 1, 
+    82, 242, 230, 20, 1, 225, 140, 176, 20, 1, 225, 140, 69, 20, 1, 225, 140, 
+    233, 223, 20, 1, 225, 140, 245, 217, 20, 1, 225, 140, 223, 111, 20, 1, 
+    225, 140, 217, 87, 20, 1, 225, 140, 227, 152, 20, 1, 225, 140, 233, 141, 
+    20, 1, 225, 140, 222, 242, 20, 1, 225, 140, 223, 32, 20, 1, 225, 140, 
+    231, 84, 20, 1, 225, 140, 217, 102, 20, 1, 225, 140, 229, 151, 20, 1, 
+    225, 140, 228, 188, 20, 1, 225, 140, 194, 20, 1, 225, 140, 218, 5, 20, 1, 
+    225, 140, 220, 29, 20, 1, 225, 140, 219, 193, 20, 1, 225, 140, 220, 125, 
+    20, 1, 225, 140, 233, 161, 20, 1, 225, 140, 234, 162, 20, 1, 225, 140, 
+    227, 213, 20, 1, 225, 140, 227, 242, 20, 1, 225, 140, 228, 159, 20, 1, 
+    225, 140, 210, 226, 20, 1, 225, 140, 219, 227, 20, 1, 225, 140, 192, 20, 
+    1, 225, 140, 228, 14, 20, 1, 225, 140, 225, 154, 20, 1, 225, 140, 227, 
+    251, 20, 1, 225, 140, 211, 192, 20, 1, 225, 140, 225, 214, 20, 1, 225, 
+    140, 222, 142, 20, 1, 225, 140, 228, 238, 20, 1, 225, 140, 223, 54, 20, 
+    1, 225, 140, 234, 171, 20, 1, 225, 140, 229, 12, 20, 1, 225, 140, 229, 
+    61, 20, 1, 225, 140, 220, 9, 20, 1, 225, 140, 224, 150, 20, 1, 225, 140, 
+    244, 45, 20, 1, 225, 140, 212, 65, 20, 1, 225, 140, 232, 247, 20, 1, 225, 
+    140, 232, 125, 20, 1, 225, 140, 234, 34, 20, 1, 225, 140, 231, 119, 20, 
+    1, 225, 140, 223, 86, 20, 1, 225, 140, 186, 20, 1, 225, 140, 230, 166, 
+    20, 1, 225, 140, 231, 127, 20, 1, 225, 140, 216, 231, 20, 1, 225, 140, 
+    234, 1, 20, 1, 225, 140, 221, 253, 20, 1, 225, 140, 212, 115, 95, 1, 191, 
+    95, 1, 252, 199, 95, 1, 8, 191, 95, 1, 225, 45, 95, 1, 186, 95, 1, 230, 
+    238, 95, 1, 254, 31, 186, 95, 1, 244, 204, 95, 1, 214, 27, 95, 1, 213, 
+    177, 95, 1, 217, 106, 95, 1, 248, 229, 95, 1, 8, 215, 157, 95, 1, 8, 217, 
+    106, 95, 1, 215, 157, 95, 1, 248, 143, 95, 1, 198, 95, 1, 228, 242, 95, 
+    1, 8, 228, 115, 95, 1, 254, 31, 198, 95, 1, 228, 115, 95, 1, 228, 101, 
+    95, 1, 233, 141, 95, 1, 232, 66, 95, 1, 233, 4, 95, 1, 232, 249, 95, 1, 
+    216, 57, 95, 1, 247, 161, 95, 1, 216, 49, 95, 1, 247, 160, 95, 1, 176, 
+    95, 1, 243, 142, 95, 1, 8, 176, 95, 1, 224, 91, 95, 1, 224, 69, 95, 1, 
+    229, 82, 95, 1, 229, 33, 95, 1, 254, 31, 229, 82, 95, 1, 162, 95, 1, 211, 
+    165, 95, 1, 243, 0, 95, 1, 242, 233, 95, 1, 215, 166, 95, 1, 246, 34, 95, 
+    1, 227, 169, 95, 1, 227, 154, 95, 1, 215, 176, 95, 1, 246, 41, 95, 1, 8, 
+    215, 176, 95, 1, 8, 246, 41, 95, 1, 223, 109, 215, 176, 95, 1, 220, 104, 
+    95, 1, 218, 225, 95, 1, 210, 82, 95, 1, 210, 14, 95, 1, 215, 184, 95, 1, 
+    246, 46, 95, 1, 8, 215, 184, 95, 1, 206, 95, 1, 210, 116, 95, 1, 210, 15, 
+    95, 1, 209, 243, 95, 1, 209, 223, 95, 1, 254, 31, 209, 243, 95, 1, 209, 
+    215, 95, 1, 209, 222, 95, 1, 212, 65, 95, 1, 254, 218, 95, 1, 241, 196, 
+    95, 1, 229, 197, 95, 5, 253, 230, 95, 5, 223, 109, 213, 133, 95, 5, 223, 
+    109, 253, 230, 95, 25, 5, 61, 95, 25, 5, 255, 82, 95, 25, 5, 254, 214, 
+    95, 25, 5, 254, 131, 95, 25, 5, 254, 123, 95, 25, 5, 78, 95, 25, 5, 226, 
+    187, 95, 25, 5, 211, 227, 95, 25, 5, 212, 98, 95, 25, 5, 76, 95, 25, 5, 
+    245, 158, 95, 25, 5, 245, 146, 95, 25, 5, 226, 236, 95, 25, 5, 74, 95, 
+    25, 5, 240, 126, 95, 25, 5, 240, 125, 95, 25, 5, 240, 124, 95, 25, 5, 
+    235, 196, 95, 25, 5, 236, 67, 95, 25, 5, 236, 40, 95, 25, 5, 235, 162, 
+    95, 25, 5, 235, 238, 95, 25, 5, 69, 95, 25, 5, 214, 229, 95, 25, 5, 214, 
+    228, 95, 25, 5, 214, 227, 95, 25, 5, 214, 118, 95, 25, 5, 214, 211, 95, 
+    25, 5, 214, 178, 95, 25, 5, 211, 117, 95, 25, 5, 211, 8, 95, 25, 5, 254, 
+    252, 95, 25, 5, 254, 248, 95, 25, 5, 245, 94, 95, 25, 5, 222, 185, 245, 
+    94, 95, 25, 5, 245, 100, 95, 25, 5, 222, 185, 245, 100, 95, 25, 5, 254, 
+    210, 95, 25, 5, 245, 203, 95, 25, 5, 253, 200, 95, 25, 5, 226, 138, 95, 
+    25, 5, 230, 30, 95, 25, 5, 229, 84, 95, 138, 222, 254, 95, 138, 216, 15, 
+    222, 254, 95, 138, 48, 95, 138, 51, 95, 1, 216, 29, 95, 1, 216, 28, 95, 
+    1, 216, 27, 95, 1, 216, 26, 95, 1, 216, 25, 95, 1, 216, 24, 95, 1, 216, 
+    23, 95, 1, 223, 109, 216, 30, 95, 1, 223, 109, 216, 29, 95, 1, 223, 109, 
+    216, 27, 95, 1, 223, 109, 216, 26, 95, 1, 223, 109, 216, 25, 95, 1, 223, 
+    109, 216, 23, 56, 1, 254, 31, 76, 141, 1, 254, 31, 211, 47, 49, 28, 16, 
+    224, 157, 49, 28, 16, 248, 166, 49, 28, 16, 225, 178, 49, 28, 16, 226, 
+    117, 245, 186, 49, 28, 16, 226, 117, 247, 209, 49, 28, 16, 214, 16, 245, 
+    186, 49, 28, 16, 214, 16, 247, 209, 49, 28, 16, 234, 203, 49, 28, 16, 
+    217, 170, 49, 28, 16, 226, 13, 49, 28, 16, 210, 217, 49, 28, 16, 210, 
+    218, 247, 209, 49, 28, 16, 233, 240, 49, 28, 16, 254, 76, 245, 186, 49, 
+    28, 16, 245, 34, 245, 186, 49, 28, 16, 217, 3, 49, 28, 16, 234, 167, 49, 
+    28, 16, 254, 66, 49, 28, 16, 254, 67, 247, 209, 49, 28, 16, 217, 176, 49, 
+    28, 16, 216, 160, 49, 28, 16, 226, 210, 254, 29, 49, 28, 16, 242, 166, 
+    254, 29, 49, 28, 16, 224, 156, 49, 28, 16, 250, 157, 49, 28, 16, 214, 6, 
+    49, 28, 16, 235, 170, 254, 29, 49, 28, 16, 234, 169, 254, 29, 49, 28, 16, 
+    234, 168, 254, 29, 49, 28, 16, 221, 215, 49, 28, 16, 226, 4, 49, 28, 16, 
+    218, 148, 254, 69, 49, 28, 16, 226, 116, 254, 29, 49, 28, 16, 214, 15, 
+    254, 29, 49, 28, 16, 254, 70, 254, 29, 49, 28, 16, 254, 64, 49, 28, 16, 
+    234, 43, 49, 28, 16, 223, 49, 49, 28, 16, 225, 109, 254, 29, 49, 28, 16, 
+    216, 84, 49, 28, 16, 254, 129, 49, 28, 16, 221, 161, 49, 28, 16, 217, 
+    179, 254, 29, 49, 28, 16, 217, 179, 231, 45, 218, 146, 49, 28, 16, 226, 
+    111, 254, 29, 49, 28, 16, 216, 191, 49, 28, 16, 233, 33, 49, 28, 16, 246, 
+    49, 49, 28, 16, 215, 228, 49, 28, 16, 216, 233, 49, 28, 16, 233, 243, 49, 
+    28, 16, 254, 76, 245, 34, 229, 100, 49, 28, 16, 243, 243, 254, 29, 49, 
+    28, 16, 236, 19, 49, 28, 16, 215, 200, 254, 29, 49, 28, 16, 234, 206, 
+    215, 199, 49, 28, 16, 225, 203, 49, 28, 16, 224, 161, 49, 28, 16, 234, 
+    17, 49, 28, 16, 250, 88, 254, 29, 49, 28, 16, 223, 149, 49, 28, 16, 226, 
+    16, 254, 29, 49, 28, 16, 226, 14, 254, 29, 49, 28, 16, 240, 116, 49, 28, 
+    16, 229, 208, 49, 28, 16, 225, 159, 49, 28, 16, 234, 18, 254, 158, 49, 
+    28, 16, 215, 200, 254, 158, 49, 28, 16, 218, 125, 49, 28, 16, 242, 130, 
+    49, 28, 16, 235, 170, 229, 100, 49, 28, 16, 226, 210, 229, 100, 49, 28, 
+    16, 226, 117, 229, 100, 49, 28, 16, 225, 158, 49, 28, 16, 234, 4, 49, 28, 
+    16, 225, 157, 49, 28, 16, 233, 242, 49, 28, 16, 225, 204, 229, 100, 49, 
+    28, 16, 234, 168, 229, 101, 254, 104, 49, 28, 16, 234, 169, 229, 101, 
+    254, 104, 49, 28, 16, 210, 215, 49, 28, 16, 254, 67, 229, 100, 49, 28, 
+    16, 254, 68, 217, 177, 229, 100, 49, 28, 16, 210, 216, 49, 28, 16, 233, 
+    241, 49, 28, 16, 245, 181, 49, 28, 16, 250, 158, 49, 28, 16, 230, 203, 
+    235, 169, 49, 28, 16, 214, 16, 229, 100, 49, 28, 16, 225, 109, 229, 100, 
+    49, 28, 16, 224, 162, 229, 100, 49, 28, 16, 226, 207, 49, 28, 16, 254, 
+    92, 49, 28, 16, 232, 63, 49, 28, 16, 226, 14, 229, 100, 49, 28, 16, 226, 
+    16, 229, 100, 49, 28, 16, 245, 68, 226, 15, 49, 28, 16, 233, 159, 49, 28, 
+    16, 254, 93, 49, 28, 16, 215, 200, 229, 100, 49, 28, 16, 245, 184, 49, 
+    28, 16, 217, 179, 229, 100, 49, 28, 16, 217, 171, 49, 28, 16, 250, 88, 
+    229, 100, 49, 28, 16, 245, 114, 49, 28, 16, 221, 162, 229, 100, 49, 28, 
+    16, 211, 151, 234, 43, 49, 28, 16, 215, 197, 49, 28, 16, 224, 163, 49, 
+    28, 16, 215, 201, 49, 28, 16, 215, 198, 49, 28, 16, 224, 160, 49, 28, 16, 
+    215, 196, 49, 28, 16, 224, 159, 49, 28, 16, 242, 165, 49, 28, 16, 254, 
+    22, 49, 28, 16, 245, 68, 254, 22, 49, 28, 16, 226, 111, 229, 100, 49, 28, 
+    16, 216, 190, 245, 77, 49, 28, 16, 216, 190, 245, 33, 49, 28, 16, 216, 
+    192, 254, 71, 49, 28, 16, 216, 185, 234, 253, 254, 63, 49, 28, 16, 234, 
+    205, 49, 28, 16, 245, 147, 49, 28, 16, 211, 11, 234, 202, 49, 28, 16, 
+    211, 11, 254, 104, 49, 28, 16, 218, 147, 49, 28, 16, 234, 44, 254, 104, 
+    49, 28, 16, 247, 210, 254, 29, 49, 28, 16, 233, 244, 254, 29, 49, 28, 16, 
+    233, 244, 254, 158, 49, 28, 16, 233, 244, 229, 100, 49, 28, 16, 254, 70, 
+    229, 100, 49, 28, 16, 254, 72, 49, 28, 16, 247, 209, 49, 28, 16, 215, 
+    211, 49, 28, 16, 216, 225, 49, 28, 16, 234, 8, 49, 28, 16, 233, 38, 245, 
+    142, 250, 79, 49, 28, 16, 233, 38, 246, 50, 250, 80, 49, 28, 16, 233, 38, 
+    215, 213, 250, 80, 49, 28, 16, 233, 38, 216, 235, 250, 80, 49, 28, 16, 
+    233, 38, 236, 14, 250, 79, 49, 28, 16, 242, 166, 229, 101, 254, 104, 49, 
+    28, 16, 242, 166, 226, 5, 254, 18, 49, 28, 16, 242, 166, 226, 5, 248, 37, 
+    49, 28, 16, 247, 233, 49, 28, 16, 247, 234, 226, 5, 254, 19, 234, 202, 
+    49, 28, 16, 247, 234, 226, 5, 254, 19, 254, 104, 49, 28, 16, 247, 234, 
+    226, 5, 248, 37, 49, 28, 16, 215, 217, 49, 28, 16, 254, 23, 49, 28, 16, 
+    236, 21, 49, 28, 16, 247, 254, 49, 28, 16, 254, 220, 225, 3, 254, 24, 49, 
+    28, 16, 254, 220, 254, 21, 49, 28, 16, 254, 220, 254, 24, 49, 28, 16, 
+    254, 220, 231, 39, 49, 28, 16, 254, 220, 231, 50, 49, 28, 16, 254, 220, 
+    242, 167, 49, 28, 16, 254, 220, 242, 164, 49, 28, 16, 254, 220, 225, 3, 
+    242, 167, 49, 28, 16, 231, 156, 224, 168, 240, 114, 49, 28, 16, 231, 156, 
+    254, 160, 224, 168, 240, 114, 49, 28, 16, 231, 156, 248, 36, 240, 114, 
+    49, 28, 16, 231, 156, 254, 160, 248, 36, 240, 114, 49, 28, 16, 231, 156, 
+    215, 206, 240, 114, 49, 28, 16, 231, 156, 215, 218, 49, 28, 16, 231, 156, 
+    216, 229, 240, 114, 49, 28, 16, 231, 156, 216, 229, 233, 41, 240, 114, 
+    49, 28, 16, 231, 156, 233, 41, 240, 114, 49, 28, 16, 231, 156, 225, 42, 
+    240, 114, 49, 28, 16, 235, 176, 216, 252, 240, 115, 49, 28, 16, 254, 68, 
+    216, 252, 240, 115, 49, 28, 16, 244, 180, 216, 226, 49, 28, 16, 244, 180, 
+    230, 148, 49, 28, 16, 244, 180, 247, 238, 49, 28, 16, 231, 156, 214, 10, 
+    240, 114, 49, 28, 16, 231, 156, 224, 167, 240, 114, 49, 28, 16, 231, 156, 
+    225, 42, 216, 229, 240, 114, 49, 28, 16, 242, 162, 230, 31, 254, 71, 49, 
+    28, 16, 242, 162, 230, 31, 247, 208, 49, 28, 16, 245, 156, 234, 253, 243, 
+    243, 213, 124, 49, 28, 16, 236, 20, 49, 28, 16, 236, 18, 49, 28, 16, 243, 
+    243, 254, 30, 248, 35, 240, 113, 49, 28, 16, 243, 243, 247, 252, 191, 49, 
+    28, 16, 243, 243, 247, 252, 229, 208, 49, 28, 16, 243, 243, 229, 203, 
+    240, 114, 49, 28, 16, 243, 243, 247, 252, 248, 11, 49, 28, 16, 243, 243, 
+    219, 104, 247, 251, 248, 11, 49, 28, 16, 243, 243, 247, 252, 234, 188, 
+    49, 28, 16, 243, 243, 247, 252, 210, 23, 49, 28, 16, 243, 243, 247, 252, 
+    228, 239, 234, 202, 49, 28, 16, 243, 243, 247, 252, 228, 239, 254, 104, 
+    49, 28, 16, 243, 243, 231, 196, 250, 81, 247, 238, 49, 28, 16, 243, 243, 
+    231, 196, 250, 81, 230, 148, 49, 28, 16, 244, 130, 219, 104, 250, 81, 
+    214, 9, 49, 28, 16, 243, 243, 219, 104, 250, 81, 217, 180, 49, 28, 16, 
+    243, 243, 229, 102, 49, 28, 16, 250, 82, 209, 249, 49, 28, 16, 250, 82, 
+    234, 42, 49, 28, 16, 250, 82, 219, 11, 49, 28, 16, 243, 243, 240, 161, 
+    211, 10, 216, 230, 49, 28, 16, 243, 243, 245, 157, 254, 94, 49, 28, 16, 
+    211, 10, 215, 207, 49, 28, 16, 247, 246, 215, 207, 49, 28, 16, 247, 246, 
+    216, 230, 49, 28, 16, 247, 246, 254, 73, 246, 50, 247, 147, 49, 28, 16, 
+    247, 246, 230, 146, 216, 234, 247, 147, 49, 28, 16, 247, 246, 247, 230, 
+    245, 44, 247, 147, 49, 28, 16, 247, 246, 215, 215, 226, 215, 247, 147, 
+    49, 28, 16, 211, 10, 254, 73, 246, 50, 247, 147, 49, 28, 16, 211, 10, 
+    230, 146, 216, 234, 247, 147, 49, 28, 16, 211, 10, 247, 230, 245, 44, 
+    247, 147, 49, 28, 16, 211, 10, 215, 215, 226, 215, 247, 147, 49, 28, 16, 
+    243, 56, 247, 245, 49, 28, 16, 243, 56, 211, 9, 49, 28, 16, 247, 253, 
+    254, 73, 230, 204, 49, 28, 16, 247, 253, 254, 73, 231, 78, 49, 28, 16, 
+    247, 253, 247, 209, 49, 28, 16, 247, 253, 216, 183, 49, 28, 16, 219, 165, 
+    216, 183, 49, 28, 16, 219, 165, 216, 184, 247, 194, 49, 28, 16, 219, 165, 
+    216, 184, 215, 208, 49, 28, 16, 219, 165, 216, 184, 216, 223, 49, 28, 16, 
+    219, 165, 253, 252, 49, 28, 16, 219, 165, 253, 253, 247, 194, 49, 28, 16, 
+    219, 165, 253, 253, 215, 208, 49, 28, 16, 219, 165, 253, 253, 216, 223, 
+    49, 28, 16, 247, 231, 243, 37, 49, 28, 16, 247, 237, 226, 138, 49, 28, 
+    16, 218, 139, 49, 28, 16, 254, 15, 191, 49, 28, 16, 254, 15, 213, 124, 
+    49, 28, 16, 254, 15, 243, 142, 49, 28, 16, 254, 15, 248, 11, 49, 28, 16, 
+    254, 15, 234, 188, 49, 28, 16, 254, 15, 210, 23, 49, 28, 16, 254, 15, 
+    228, 238, 49, 28, 16, 234, 168, 229, 101, 231, 49, 49, 28, 16, 234, 169, 
+    229, 101, 231, 49, 49, 28, 16, 234, 168, 229, 101, 234, 202, 49, 28, 16, 
+    234, 169, 229, 101, 234, 202, 49, 28, 16, 234, 44, 234, 202, 49, 28, 16, 
+    242, 166, 229, 101, 234, 202, 28, 16, 219, 157, 252, 143, 28, 16, 52, 
+    252, 143, 28, 16, 40, 252, 143, 28, 16, 223, 53, 40, 252, 143, 28, 16, 
+    248, 163, 252, 143, 28, 16, 219, 253, 252, 143, 28, 16, 43, 223, 80, 50, 
+    28, 16, 44, 223, 80, 50, 28, 16, 223, 80, 247, 126, 28, 16, 248, 204, 
+    221, 165, 28, 16, 248, 230, 251, 1, 28, 16, 221, 165, 28, 16, 249, 242, 
+    28, 16, 223, 78, 244, 119, 28, 16, 223, 78, 244, 118, 28, 16, 223, 78, 
+    244, 117, 28, 16, 244, 139, 28, 16, 244, 140, 51, 28, 16, 251, 156, 79, 
+    28, 16, 251, 32, 28, 16, 251, 167, 28, 16, 127, 28, 16, 226, 197, 218, 
+    165, 28, 16, 215, 57, 218, 165, 28, 16, 216, 143, 218, 165, 28, 16, 244, 
+    18, 218, 165, 28, 16, 244, 88, 218, 165, 28, 16, 219, 126, 218, 165, 28, 
+    16, 219, 124, 244, 2, 28, 16, 244, 16, 244, 2, 28, 16, 243, 210, 250, 22, 
+    28, 16, 243, 210, 250, 23, 226, 140, 254, 150, 28, 16, 243, 210, 250, 23, 
+    226, 140, 252, 130, 28, 16, 251, 75, 250, 22, 28, 16, 245, 15, 250, 22, 
+    28, 16, 245, 15, 250, 23, 226, 140, 254, 150, 28, 16, 245, 15, 250, 23, 
+    226, 140, 252, 130, 28, 16, 246, 91, 250, 21, 28, 16, 246, 91, 250, 20, 
+    28, 16, 230, 90, 231, 95, 223, 64, 28, 16, 52, 220, 77, 28, 16, 52, 244, 
+    73, 28, 16, 244, 74, 214, 163, 28, 16, 244, 74, 246, 114, 28, 16, 229, 
+    193, 214, 163, 28, 16, 229, 193, 246, 114, 28, 16, 220, 78, 214, 163, 28, 
+    16, 220, 78, 246, 114, 28, 16, 224, 25, 138, 220, 77, 28, 16, 224, 25, 
+    138, 244, 73, 28, 16, 249, 224, 216, 88, 28, 16, 249, 93, 216, 88, 28, 
+    16, 226, 140, 254, 150, 28, 16, 226, 140, 252, 130, 28, 16, 224, 7, 254, 
+    150, 28, 16, 224, 7, 252, 130, 28, 16, 230, 93, 223, 64, 28, 16, 211, 
+    251, 223, 64, 28, 16, 163, 223, 64, 28, 16, 224, 25, 223, 64, 28, 16, 
+    245, 197, 223, 64, 28, 16, 219, 120, 223, 64, 28, 16, 216, 161, 223, 64, 
+    28, 16, 219, 112, 223, 64, 28, 16, 123, 240, 218, 215, 71, 223, 64, 28, 
+    16, 211, 179, 228, 48, 28, 16, 96, 228, 48, 28, 16, 250, 44, 211, 179, 
+    228, 48, 28, 16, 42, 228, 49, 211, 253, 28, 16, 42, 228, 49, 251, 229, 
+    28, 16, 215, 227, 228, 49, 120, 211, 253, 28, 16, 215, 227, 228, 49, 120, 
+    251, 229, 28, 16, 215, 227, 228, 49, 43, 211, 253, 28, 16, 215, 227, 228, 
+    49, 43, 251, 229, 28, 16, 215, 227, 228, 49, 44, 211, 253, 28, 16, 215, 
+    227, 228, 49, 44, 251, 229, 28, 16, 215, 227, 228, 49, 124, 211, 253, 28, 
+    16, 215, 227, 228, 49, 124, 251, 229, 28, 16, 215, 227, 228, 49, 120, 44, 
+    211, 253, 28, 16, 215, 227, 228, 49, 120, 44, 251, 229, 28, 16, 230, 134, 
+    228, 49, 211, 253, 28, 16, 230, 134, 228, 49, 251, 229, 28, 16, 215, 224, 
+    228, 49, 124, 211, 253, 28, 16, 215, 224, 228, 49, 124, 251, 229, 28, 16, 
+    226, 8, 228, 48, 28, 16, 213, 132, 228, 48, 28, 16, 228, 49, 251, 229, 
+    28, 16, 227, 207, 228, 48, 28, 16, 249, 249, 228, 49, 211, 253, 28, 16, 
+    249, 249, 228, 49, 251, 229, 28, 16, 251, 154, 28, 16, 211, 251, 228, 52, 
+    28, 16, 163, 228, 52, 28, 16, 224, 25, 228, 52, 28, 16, 245, 197, 228, 
+    52, 28, 16, 219, 120, 228, 52, 28, 16, 216, 161, 228, 52, 28, 16, 219, 
+    112, 228, 52, 28, 16, 123, 240, 218, 215, 71, 228, 52, 28, 16, 38, 218, 
+    141, 28, 16, 38, 218, 242, 218, 141, 28, 16, 38, 215, 235, 28, 16, 38, 
+    215, 234, 28, 16, 38, 215, 233, 28, 16, 244, 109, 215, 235, 28, 16, 244, 
+    109, 215, 234, 28, 16, 244, 109, 215, 233, 28, 16, 38, 253, 197, 247, 
+    128, 28, 16, 38, 244, 80, 28, 16, 38, 244, 79, 28, 16, 38, 244, 78, 28, 
+    16, 38, 244, 77, 28, 16, 38, 244, 76, 28, 16, 252, 66, 252, 82, 28, 16, 
+    245, 151, 252, 82, 28, 16, 252, 66, 216, 112, 28, 16, 245, 151, 216, 112, 
+    28, 16, 252, 66, 219, 82, 28, 16, 245, 151, 219, 82, 28, 16, 252, 66, 
+    225, 118, 28, 16, 245, 151, 225, 118, 28, 16, 38, 255, 23, 28, 16, 38, 
+    218, 167, 28, 16, 38, 216, 239, 28, 16, 38, 218, 168, 28, 16, 38, 231, 
+    167, 28, 16, 38, 231, 166, 28, 16, 38, 255, 22, 28, 16, 38, 232, 118, 28, 
+    16, 254, 6, 214, 163, 28, 16, 254, 6, 246, 114, 28, 16, 38, 247, 143, 28, 
+    16, 38, 222, 234, 28, 16, 38, 244, 66, 28, 16, 38, 219, 78, 28, 16, 38, 
+    252, 46, 28, 16, 38, 52, 216, 20, 28, 16, 38, 215, 212, 216, 20, 28, 16, 
+    222, 238, 28, 16, 218, 76, 28, 16, 210, 159, 28, 16, 225, 110, 28, 16, 
+    231, 30, 28, 16, 244, 25, 28, 16, 249, 146, 28, 16, 248, 86, 28, 16, 242, 
+    157, 228, 53, 219, 97, 28, 16, 242, 157, 228, 53, 228, 80, 219, 97, 28, 
+    16, 216, 1, 28, 16, 215, 95, 28, 16, 235, 200, 215, 95, 28, 16, 215, 96, 
+    219, 97, 28, 16, 215, 96, 214, 163, 28, 16, 226, 152, 218, 104, 28, 16, 
+    226, 152, 218, 101, 28, 16, 226, 152, 218, 100, 28, 16, 226, 152, 218, 
+    99, 28, 16, 226, 152, 218, 98, 28, 16, 226, 152, 218, 97, 28, 16, 226, 
+    152, 218, 96, 28, 16, 226, 152, 218, 95, 28, 16, 226, 152, 218, 94, 28, 
+    16, 226, 152, 218, 103, 28, 16, 226, 152, 218, 102, 28, 16, 241, 252, 28, 
+    16, 229, 110, 28, 16, 245, 151, 64, 218, 135, 28, 16, 248, 79, 219, 97, 
+    28, 16, 38, 124, 251, 177, 28, 16, 38, 120, 251, 177, 28, 16, 38, 242, 7, 
+    28, 16, 38, 219, 69, 225, 46, 28, 16, 225, 219, 79, 28, 16, 225, 219, 
+    120, 79, 28, 16, 163, 225, 219, 79, 28, 16, 242, 189, 214, 163, 28, 16, 
+    242, 189, 246, 114, 28, 16, 2, 244, 108, 28, 16, 248, 188, 28, 16, 248, 
+    189, 254, 163, 28, 16, 231, 138, 28, 16, 232, 135, 28, 16, 251, 151, 28, 
+    16, 220, 156, 211, 253, 28, 16, 220, 156, 251, 229, 28, 16, 230, 189, 28, 
+    16, 230, 190, 251, 229, 28, 16, 220, 150, 211, 253, 28, 16, 220, 150, 
+    251, 229, 28, 16, 243, 227, 211, 253, 28, 16, 243, 227, 251, 229, 28, 16, 
+    232, 136, 225, 183, 223, 64, 28, 16, 232, 136, 236, 11, 223, 64, 28, 16, 
+    251, 152, 223, 64, 28, 16, 220, 156, 223, 64, 28, 16, 230, 190, 223, 64, 
+    28, 16, 220, 150, 223, 64, 28, 16, 216, 250, 225, 181, 249, 115, 224, 
+    177, 225, 182, 28, 16, 216, 250, 225, 181, 249, 115, 224, 177, 236, 10, 
+    28, 16, 216, 250, 225, 181, 249, 115, 224, 177, 225, 183, 247, 219, 28, 
+    16, 216, 250, 236, 9, 249, 115, 224, 177, 225, 182, 28, 16, 216, 250, 
+    236, 9, 249, 115, 224, 177, 236, 10, 28, 16, 216, 250, 236, 9, 249, 115, 
+    224, 177, 236, 11, 247, 219, 28, 16, 216, 250, 236, 9, 249, 115, 224, 
+    177, 236, 11, 247, 218, 28, 16, 216, 250, 236, 9, 249, 115, 224, 177, 
+    236, 11, 247, 217, 28, 16, 249, 141, 28, 16, 242, 133, 251, 75, 250, 22, 
+    28, 16, 242, 133, 245, 15, 250, 22, 28, 16, 42, 253, 166, 28, 16, 213, 
+    151, 28, 16, 225, 17, 28, 16, 250, 13, 28, 16, 221, 205, 28, 16, 250, 17, 
+    28, 16, 216, 8, 28, 16, 224, 245, 28, 16, 224, 246, 244, 68, 28, 16, 221, 
+    206, 244, 68, 28, 16, 216, 9, 223, 61, 28, 16, 225, 166, 218, 67, 26, 
+    213, 137, 189, 217, 230, 26, 213, 137, 189, 217, 219, 26, 213, 137, 189, 
+    217, 209, 26, 213, 137, 189, 217, 202, 26, 213, 137, 189, 217, 194, 26, 
+    213, 137, 189, 217, 188, 26, 213, 137, 189, 217, 187, 26, 213, 137, 189, 
+    217, 186, 26, 213, 137, 189, 217, 185, 26, 213, 137, 189, 217, 229, 26, 
+    213, 137, 189, 217, 228, 26, 213, 137, 189, 217, 227, 26, 213, 137, 189, 
+    217, 226, 26, 213, 137, 189, 217, 225, 26, 213, 137, 189, 217, 224, 26, 
+    213, 137, 189, 217, 223, 26, 213, 137, 189, 217, 222, 26, 213, 137, 189, 
+    217, 221, 26, 213, 137, 189, 217, 220, 26, 213, 137, 189, 217, 218, 26, 
+    213, 137, 189, 217, 217, 26, 213, 137, 189, 217, 216, 26, 213, 137, 189, 
+    217, 215, 26, 213, 137, 189, 217, 214, 26, 213, 137, 189, 217, 193, 26, 
+    213, 137, 189, 217, 192, 26, 213, 137, 189, 217, 191, 26, 213, 137, 189, 
+    217, 190, 26, 213, 137, 189, 217, 189, 26, 235, 221, 189, 217, 230, 26, 
+    235, 221, 189, 217, 219, 26, 235, 221, 189, 217, 202, 26, 235, 221, 189, 
+    217, 194, 26, 235, 221, 189, 217, 187, 26, 235, 221, 189, 217, 186, 26, 
+    235, 221, 189, 217, 228, 26, 235, 221, 189, 217, 227, 26, 235, 221, 189, 
+    217, 226, 26, 235, 221, 189, 217, 225, 26, 235, 221, 189, 217, 222, 26, 
+    235, 221, 189, 217, 221, 26, 235, 221, 189, 217, 220, 26, 235, 221, 189, 
+    217, 215, 26, 235, 221, 189, 217, 214, 26, 235, 221, 189, 217, 213, 26, 
+    235, 221, 189, 217, 212, 26, 235, 221, 189, 217, 211, 26, 235, 221, 189, 
+    217, 210, 26, 235, 221, 189, 217, 208, 26, 235, 221, 189, 217, 207, 26, 
+    235, 221, 189, 217, 206, 26, 235, 221, 189, 217, 205, 26, 235, 221, 189, 
+    217, 204, 26, 235, 221, 189, 217, 203, 26, 235, 221, 189, 217, 201, 26, 
+    235, 221, 189, 217, 200, 26, 235, 221, 189, 217, 199, 26, 235, 221, 189, 
+    217, 198, 26, 235, 221, 189, 217, 197, 26, 235, 221, 189, 217, 196, 26, 
+    235, 221, 189, 217, 195, 26, 235, 221, 189, 217, 193, 26, 235, 221, 189, 
+    217, 192, 26, 235, 221, 189, 217, 191, 26, 235, 221, 189, 217, 190, 26, 
+    235, 221, 189, 217, 189, 38, 26, 28, 215, 209, 38, 26, 28, 216, 224, 38, 
+    26, 28, 225, 191, 26, 28, 233, 37, 230, 147, 31, 245, 231, 247, 232, 31, 
+    241, 229, 245, 231, 247, 232, 31, 240, 221, 245, 231, 247, 232, 31, 245, 
+    230, 241, 230, 247, 232, 31, 245, 230, 240, 220, 247, 232, 31, 245, 231, 
+    180, 31, 250, 182, 180, 31, 243, 236, 250, 43, 180, 31, 230, 182, 180, 
+    31, 252, 138, 180, 31, 234, 185, 219, 81, 180, 31, 249, 187, 180, 31, 
+    253, 241, 180, 31, 226, 167, 180, 31, 251, 161, 226, 134, 180, 31, 248, 
+    81, 177, 247, 187, 180, 31, 247, 184, 180, 31, 210, 222, 180, 31, 235, 
+    254, 180, 31, 225, 200, 180, 31, 223, 130, 180, 31, 249, 197, 180, 31, 
+    241, 67, 252, 192, 180, 31, 212, 59, 180, 31, 244, 47, 180, 31, 254, 255, 
+    180, 31, 223, 92, 180, 31, 223, 68, 180, 31, 245, 229, 180, 31, 235, 59, 
+    180, 31, 249, 192, 180, 31, 245, 150, 180, 31, 246, 60, 180, 31, 250, 
+    153, 180, 31, 248, 90, 180, 31, 23, 223, 67, 180, 31, 226, 85, 180, 31, 
+    233, 40, 180, 31, 250, 6, 180, 31, 234, 83, 180, 31, 243, 93, 180, 31, 
+    218, 114, 180, 31, 224, 133, 180, 31, 243, 235, 180, 31, 223, 69, 180, 
+    31, 233, 77, 177, 230, 162, 180, 31, 223, 65, 180, 31, 242, 175, 216, 43, 
+    231, 81, 180, 31, 245, 152, 180, 31, 218, 126, 180, 31, 242, 135, 180, 
+    31, 245, 144, 180, 31, 225, 239, 180, 31, 222, 228, 180, 31, 244, 67, 
+    180, 31, 214, 8, 177, 212, 44, 180, 31, 249, 201, 180, 31, 231, 94, 180, 
+    31, 245, 69, 180, 31, 214, 172, 180, 31, 247, 220, 180, 31, 250, 8, 230, 
+    115, 180, 31, 242, 113, 180, 31, 243, 94, 236, 6, 180, 31, 231, 146, 180, 
+    31, 255, 19, 180, 31, 245, 165, 180, 31, 246, 117, 180, 31, 212, 42, 180, 
+    31, 219, 152, 180, 31, 235, 229, 180, 31, 248, 50, 180, 31, 248, 168, 
+    180, 31, 247, 216, 180, 31, 245, 37, 180, 31, 220, 117, 180, 31, 218, 
+    130, 180, 31, 242, 9, 180, 31, 249, 220, 180, 31, 250, 3, 180, 31, 244, 
+    185, 180, 31, 254, 221, 180, 31, 249, 219, 180, 31, 226, 201, 216, 197, 
+    213, 242, 180, 31, 247, 240, 180, 31, 233, 130, 180, 31, 244, 21, 249, 
+    157, 222, 204, 214, 174, 21, 111, 249, 157, 222, 204, 214, 174, 21, 105, 
+    249, 157, 222, 204, 214, 174, 21, 158, 249, 157, 222, 204, 214, 174, 21, 
+    161, 249, 157, 222, 204, 214, 174, 21, 190, 249, 157, 222, 204, 214, 174, 
+    21, 195, 249, 157, 222, 204, 214, 174, 21, 199, 249, 157, 222, 204, 214, 
+    174, 21, 196, 249, 157, 222, 204, 214, 174, 21, 201, 249, 157, 222, 204, 
+    216, 244, 21, 111, 249, 157, 222, 204, 216, 244, 21, 105, 249, 157, 222, 
+    204, 216, 244, 21, 158, 249, 157, 222, 204, 216, 244, 21, 161, 249, 157, 
+    222, 204, 216, 244, 21, 190, 249, 157, 222, 204, 216, 244, 21, 195, 249, 
+    157, 222, 204, 216, 244, 21, 199, 249, 157, 222, 204, 216, 244, 21, 196, 
+    249, 157, 222, 204, 216, 244, 21, 201, 11, 23, 6, 61, 11, 23, 6, 253, 
+    166, 11, 23, 6, 251, 74, 11, 23, 6, 249, 68, 11, 23, 6, 76, 11, 23, 6, 
+    245, 14, 11, 23, 6, 243, 209, 11, 23, 6, 242, 67, 11, 23, 6, 74, 11, 23, 
+    6, 235, 150, 11, 23, 6, 235, 29, 11, 23, 6, 156, 11, 23, 6, 194, 11, 23, 
+    6, 230, 30, 11, 23, 6, 78, 11, 23, 6, 226, 109, 11, 23, 6, 224, 99, 11, 
+    23, 6, 153, 11, 23, 6, 222, 93, 11, 23, 6, 217, 153, 11, 23, 6, 69, 11, 
+    23, 6, 214, 105, 11, 23, 6, 212, 98, 11, 23, 6, 211, 178, 11, 23, 6, 211, 
+    117, 11, 23, 6, 210, 159, 11, 23, 4, 61, 11, 23, 4, 253, 166, 11, 23, 4, 
+    251, 74, 11, 23, 4, 249, 68, 11, 23, 4, 76, 11, 23, 4, 245, 14, 11, 23, 
+    4, 243, 209, 11, 23, 4, 242, 67, 11, 23, 4, 74, 11, 23, 4, 235, 150, 11, 
+    23, 4, 235, 29, 11, 23, 4, 156, 11, 23, 4, 194, 11, 23, 4, 230, 30, 11, 
+    23, 4, 78, 11, 23, 4, 226, 109, 11, 23, 4, 224, 99, 11, 23, 4, 153, 11, 
+    23, 4, 222, 93, 11, 23, 4, 217, 153, 11, 23, 4, 69, 11, 23, 4, 214, 105, 
+    11, 23, 4, 212, 98, 11, 23, 4, 211, 178, 11, 23, 4, 211, 117, 11, 23, 4, 
+    210, 159, 11, 32, 6, 61, 11, 32, 6, 253, 166, 11, 32, 6, 251, 74, 11, 32, 
+    6, 249, 68, 11, 32, 6, 76, 11, 32, 6, 245, 14, 11, 32, 6, 243, 209, 11, 
+    32, 6, 242, 67, 11, 32, 6, 74, 11, 32, 6, 235, 150, 11, 32, 6, 235, 29, 
+    11, 32, 6, 156, 11, 32, 6, 194, 11, 32, 6, 230, 30, 11, 32, 6, 78, 11, 
+    32, 6, 226, 109, 11, 32, 6, 224, 99, 11, 32, 6, 153, 11, 32, 6, 222, 93, 
+    11, 32, 6, 217, 153, 11, 32, 6, 69, 11, 32, 6, 214, 105, 11, 32, 6, 212, 
+    98, 11, 32, 6, 211, 178, 11, 32, 6, 211, 117, 11, 32, 6, 210, 159, 11, 
+    32, 4, 61, 11, 32, 4, 253, 166, 11, 32, 4, 251, 74, 11, 32, 4, 249, 68, 
+    11, 32, 4, 76, 11, 32, 4, 245, 14, 11, 32, 4, 243, 209, 11, 32, 4, 74, 
+    11, 32, 4, 235, 150, 11, 32, 4, 235, 29, 11, 32, 4, 156, 11, 32, 4, 194, 
+    11, 32, 4, 230, 30, 11, 32, 4, 78, 11, 32, 4, 226, 109, 11, 32, 4, 224, 
+    99, 11, 32, 4, 153, 11, 32, 4, 222, 93, 11, 32, 4, 217, 153, 11, 32, 4, 
+    69, 11, 32, 4, 214, 105, 11, 32, 4, 212, 98, 11, 32, 4, 211, 178, 11, 32, 
+    4, 211, 117, 11, 32, 4, 210, 159, 11, 23, 32, 6, 61, 11, 23, 32, 6, 253, 
+    166, 11, 23, 32, 6, 251, 74, 11, 23, 32, 6, 249, 68, 11, 23, 32, 6, 76, 
+    11, 23, 32, 6, 245, 14, 11, 23, 32, 6, 243, 209, 11, 23, 32, 6, 242, 67, 
+    11, 23, 32, 6, 74, 11, 23, 32, 6, 235, 150, 11, 23, 32, 6, 235, 29, 11, 
+    23, 32, 6, 156, 11, 23, 32, 6, 194, 11, 23, 32, 6, 230, 30, 11, 23, 32, 
+    6, 78, 11, 23, 32, 6, 226, 109, 11, 23, 32, 6, 224, 99, 11, 23, 32, 6, 
+    153, 11, 23, 32, 6, 222, 93, 11, 23, 32, 6, 217, 153, 11, 23, 32, 6, 69, 
+    11, 23, 32, 6, 214, 105, 11, 23, 32, 6, 212, 98, 11, 23, 32, 6, 211, 178, 
+    11, 23, 32, 6, 211, 117, 11, 23, 32, 6, 210, 159, 11, 23, 32, 4, 61, 11, 
+    23, 32, 4, 253, 166, 11, 23, 32, 4, 251, 74, 11, 23, 32, 4, 249, 68, 11, 
+    23, 32, 4, 76, 11, 23, 32, 4, 245, 14, 11, 23, 32, 4, 243, 209, 11, 23, 
+    32, 4, 242, 67, 11, 23, 32, 4, 74, 11, 23, 32, 4, 235, 150, 11, 23, 32, 
+    4, 235, 29, 11, 23, 32, 4, 156, 11, 23, 32, 4, 194, 11, 23, 32, 4, 230, 
+    30, 11, 23, 32, 4, 78, 11, 23, 32, 4, 226, 109, 11, 23, 32, 4, 224, 99, 
+    11, 23, 32, 4, 153, 11, 23, 32, 4, 222, 93, 11, 23, 32, 4, 217, 153, 11, 
+    23, 32, 4, 69, 11, 23, 32, 4, 214, 105, 11, 23, 32, 4, 212, 98, 11, 23, 
+    32, 4, 211, 178, 11, 23, 32, 4, 211, 117, 11, 23, 32, 4, 210, 159, 11, 
+    119, 6, 61, 11, 119, 6, 251, 74, 11, 119, 6, 249, 68, 11, 119, 6, 243, 
+    209, 11, 119, 6, 235, 150, 11, 119, 6, 235, 29, 11, 119, 6, 230, 30, 11, 
+    119, 6, 78, 11, 119, 6, 226, 109, 11, 119, 6, 224, 99, 11, 119, 6, 222, 
+    93, 11, 119, 6, 217, 153, 11, 119, 6, 69, 11, 119, 6, 214, 105, 11, 119, 
+    6, 212, 98, 11, 119, 6, 211, 178, 11, 119, 6, 211, 117, 11, 119, 6, 210, 
+    159, 11, 119, 4, 61, 11, 119, 4, 253, 166, 11, 119, 4, 251, 74, 11, 119, 
+    4, 249, 68, 11, 119, 4, 245, 14, 11, 119, 4, 242, 67, 11, 119, 4, 74, 11, 
+    119, 4, 235, 150, 11, 119, 4, 235, 29, 11, 119, 4, 156, 11, 119, 4, 194, 
+    11, 119, 4, 230, 30, 11, 119, 4, 226, 109, 11, 119, 4, 224, 99, 11, 119, 
+    4, 153, 11, 119, 4, 222, 93, 11, 119, 4, 217, 153, 11, 119, 4, 69, 11, 
+    119, 4, 214, 105, 11, 119, 4, 212, 98, 11, 119, 4, 211, 178, 11, 119, 4, 
+    211, 117, 11, 119, 4, 210, 159, 11, 23, 119, 6, 61, 11, 23, 119, 6, 253, 
+    166, 11, 23, 119, 6, 251, 74, 11, 23, 119, 6, 249, 68, 11, 23, 119, 6, 
+    76, 11, 23, 119, 6, 245, 14, 11, 23, 119, 6, 243, 209, 11, 23, 119, 6, 
+    242, 67, 11, 23, 119, 6, 74, 11, 23, 119, 6, 235, 150, 11, 23, 119, 6, 
+    235, 29, 11, 23, 119, 6, 156, 11, 23, 119, 6, 194, 11, 23, 119, 6, 230, 
+    30, 11, 23, 119, 6, 78, 11, 23, 119, 6, 226, 109, 11, 23, 119, 6, 224, 
+    99, 11, 23, 119, 6, 153, 11, 23, 119, 6, 222, 93, 11, 23, 119, 6, 217, 
+    153, 11, 23, 119, 6, 69, 11, 23, 119, 6, 214, 105, 11, 23, 119, 6, 212, 
+    98, 11, 23, 119, 6, 211, 178, 11, 23, 119, 6, 211, 117, 11, 23, 119, 6, 
+    210, 159, 11, 23, 119, 4, 61, 11, 23, 119, 4, 253, 166, 11, 23, 119, 4, 
+    251, 74, 11, 23, 119, 4, 249, 68, 11, 23, 119, 4, 76, 11, 23, 119, 4, 
+    245, 14, 11, 23, 119, 4, 243, 209, 11, 23, 119, 4, 242, 67, 11, 23, 119, 
+    4, 74, 11, 23, 119, 4, 235, 150, 11, 23, 119, 4, 235, 29, 11, 23, 119, 4, 
+    156, 11, 23, 119, 4, 194, 11, 23, 119, 4, 230, 30, 11, 23, 119, 4, 78, 
+    11, 23, 119, 4, 226, 109, 11, 23, 119, 4, 224, 99, 11, 23, 119, 4, 153, 
+    11, 23, 119, 4, 222, 93, 11, 23, 119, 4, 217, 153, 11, 23, 119, 4, 69, 
     11, 23, 119, 4, 214, 105, 11, 23, 119, 4, 212, 98, 11, 23, 119, 4, 211, 
     178, 11, 23, 119, 4, 211, 117, 11, 23, 119, 4, 210, 159, 11, 133, 6, 61, 
-    11, 133, 6, 253, 158, 11, 133, 6, 249, 60, 11, 133, 6, 75, 11, 133, 6, 
-    245, 6, 11, 133, 6, 243, 202, 11, 133, 6, 235, 144, 11, 133, 6, 235, 23, 
-    11, 133, 6, 156, 11, 133, 6, 193, 11, 133, 6, 230, 25, 11, 133, 6, 76, 
-    11, 133, 6, 226, 105, 11, 133, 6, 224, 96, 11, 133, 6, 222, 91, 11, 133, 
-    6, 217, 152, 11, 133, 6, 70, 11, 133, 6, 214, 105, 11, 133, 6, 212, 98, 
+    11, 133, 6, 253, 166, 11, 133, 6, 249, 68, 11, 133, 6, 76, 11, 133, 6, 
+    245, 14, 11, 133, 6, 243, 209, 11, 133, 6, 235, 150, 11, 133, 6, 235, 29, 
+    11, 133, 6, 156, 11, 133, 6, 194, 11, 133, 6, 230, 30, 11, 133, 6, 78, 
+    11, 133, 6, 226, 109, 11, 133, 6, 224, 99, 11, 133, 6, 222, 93, 11, 133, 
+    6, 217, 153, 11, 133, 6, 69, 11, 133, 6, 214, 105, 11, 133, 6, 212, 98, 
     11, 133, 6, 211, 178, 11, 133, 6, 211, 117, 11, 133, 4, 61, 11, 133, 4, 
-    253, 158, 11, 133, 4, 251, 66, 11, 133, 4, 249, 60, 11, 133, 4, 75, 11, 
-    133, 4, 245, 6, 11, 133, 4, 243, 202, 11, 133, 4, 242, 60, 11, 133, 4, 
-    73, 11, 133, 4, 235, 144, 11, 133, 4, 235, 23, 11, 133, 4, 156, 11, 133, 
-    4, 193, 11, 133, 4, 230, 25, 11, 133, 4, 76, 11, 133, 4, 226, 105, 11, 
-    133, 4, 224, 96, 11, 133, 4, 153, 11, 133, 4, 222, 91, 11, 133, 4, 217, 
-    152, 11, 133, 4, 70, 11, 133, 4, 214, 105, 11, 133, 4, 212, 98, 11, 133, 
+    253, 166, 11, 133, 4, 251, 74, 11, 133, 4, 249, 68, 11, 133, 4, 76, 11, 
+    133, 4, 245, 14, 11, 133, 4, 243, 209, 11, 133, 4, 242, 67, 11, 133, 4, 
+    74, 11, 133, 4, 235, 150, 11, 133, 4, 235, 29, 11, 133, 4, 156, 11, 133, 
+    4, 194, 11, 133, 4, 230, 30, 11, 133, 4, 78, 11, 133, 4, 226, 109, 11, 
+    133, 4, 224, 99, 11, 133, 4, 153, 11, 133, 4, 222, 93, 11, 133, 4, 217, 
+    153, 11, 133, 4, 69, 11, 133, 4, 214, 105, 11, 133, 4, 212, 98, 11, 133, 
     4, 211, 178, 11, 133, 4, 211, 117, 11, 133, 4, 210, 159, 11, 139, 6, 61, 
-    11, 139, 6, 253, 158, 11, 139, 6, 249, 60, 11, 139, 6, 75, 11, 139, 6, 
-    245, 6, 11, 139, 6, 243, 202, 11, 139, 6, 73, 11, 139, 6, 235, 144, 11, 
-    139, 6, 235, 23, 11, 139, 6, 156, 11, 139, 6, 193, 11, 139, 6, 76, 11, 
-    139, 6, 222, 91, 11, 139, 6, 217, 152, 11, 139, 6, 70, 11, 139, 6, 214, 
+    11, 139, 6, 253, 166, 11, 139, 6, 249, 68, 11, 139, 6, 76, 11, 139, 6, 
+    245, 14, 11, 139, 6, 243, 209, 11, 139, 6, 74, 11, 139, 6, 235, 150, 11, 
+    139, 6, 235, 29, 11, 139, 6, 156, 11, 139, 6, 194, 11, 139, 6, 78, 11, 
+    139, 6, 222, 93, 11, 139, 6, 217, 153, 11, 139, 6, 69, 11, 139, 6, 214, 
     105, 11, 139, 6, 212, 98, 11, 139, 6, 211, 178, 11, 139, 6, 211, 117, 11, 
-    139, 4, 61, 11, 139, 4, 253, 158, 11, 139, 4, 251, 66, 11, 139, 4, 249, 
-    60, 11, 139, 4, 75, 11, 139, 4, 245, 6, 11, 139, 4, 243, 202, 11, 139, 4, 
-    242, 60, 11, 139, 4, 73, 11, 139, 4, 235, 144, 11, 139, 4, 235, 23, 11, 
-    139, 4, 156, 11, 139, 4, 193, 11, 139, 4, 230, 25, 11, 139, 4, 76, 11, 
-    139, 4, 226, 105, 11, 139, 4, 224, 96, 11, 139, 4, 153, 11, 139, 4, 222, 
-    91, 11, 139, 4, 217, 152, 11, 139, 4, 70, 11, 139, 4, 214, 105, 11, 139, 
-    4, 212, 98, 11, 139, 4, 211, 178, 11, 139, 4, 211, 117, 11, 139, 4, 210, 
-    159, 11, 23, 133, 6, 61, 11, 23, 133, 6, 253, 158, 11, 23, 133, 6, 251, 
-    66, 11, 23, 133, 6, 249, 60, 11, 23, 133, 6, 75, 11, 23, 133, 6, 245, 6, 
-    11, 23, 133, 6, 243, 202, 11, 23, 133, 6, 242, 60, 11, 23, 133, 6, 73, 
-    11, 23, 133, 6, 235, 144, 11, 23, 133, 6, 235, 23, 11, 23, 133, 6, 156, 
-    11, 23, 133, 6, 193, 11, 23, 133, 6, 230, 25, 11, 23, 133, 6, 76, 11, 23, 
-    133, 6, 226, 105, 11, 23, 133, 6, 224, 96, 11, 23, 133, 6, 153, 11, 23, 
-    133, 6, 222, 91, 11, 23, 133, 6, 217, 152, 11, 23, 133, 6, 70, 11, 23, 
-    133, 6, 214, 105, 11, 23, 133, 6, 212, 98, 11, 23, 133, 6, 211, 178, 11, 
-    23, 133, 6, 211, 117, 11, 23, 133, 6, 210, 159, 11, 23, 133, 4, 61, 11, 
-    23, 133, 4, 253, 158, 11, 23, 133, 4, 251, 66, 11, 23, 133, 4, 249, 60, 
-    11, 23, 133, 4, 75, 11, 23, 133, 4, 245, 6, 11, 23, 133, 4, 243, 202, 11, 
-    23, 133, 4, 242, 60, 11, 23, 133, 4, 73, 11, 23, 133, 4, 235, 144, 11, 
-    23, 133, 4, 235, 23, 11, 23, 133, 4, 156, 11, 23, 133, 4, 193, 11, 23, 
-    133, 4, 230, 25, 11, 23, 133, 4, 76, 11, 23, 133, 4, 226, 105, 11, 23, 
-    133, 4, 224, 96, 11, 23, 133, 4, 153, 11, 23, 133, 4, 222, 91, 11, 23, 
-    133, 4, 217, 152, 11, 23, 133, 4, 70, 11, 23, 133, 4, 214, 105, 11, 23, 
-    133, 4, 212, 98, 11, 23, 133, 4, 211, 178, 11, 23, 133, 4, 211, 117, 11, 
-    23, 133, 4, 210, 159, 11, 35, 6, 61, 11, 35, 6, 253, 158, 11, 35, 6, 251, 
-    66, 11, 35, 6, 249, 60, 11, 35, 6, 75, 11, 35, 6, 245, 6, 11, 35, 6, 243, 
-    202, 11, 35, 6, 242, 60, 11, 35, 6, 73, 11, 35, 6, 235, 144, 11, 35, 6, 
-    235, 23, 11, 35, 6, 156, 11, 35, 6, 193, 11, 35, 6, 230, 25, 11, 35, 6, 
-    76, 11, 35, 6, 226, 105, 11, 35, 6, 224, 96, 11, 35, 6, 153, 11, 35, 6, 
-    222, 91, 11, 35, 6, 217, 152, 11, 35, 6, 70, 11, 35, 6, 214, 105, 11, 35, 
-    6, 212, 98, 11, 35, 6, 211, 178, 11, 35, 6, 211, 117, 11, 35, 6, 210, 
-    159, 11, 35, 4, 61, 11, 35, 4, 253, 158, 11, 35, 4, 251, 66, 11, 35, 4, 
-    249, 60, 11, 35, 4, 75, 11, 35, 4, 245, 6, 11, 35, 4, 243, 202, 11, 35, 
-    4, 242, 60, 11, 35, 4, 73, 11, 35, 4, 235, 144, 11, 35, 4, 235, 23, 11, 
-    35, 4, 156, 11, 35, 4, 193, 11, 35, 4, 230, 25, 11, 35, 4, 76, 11, 35, 4, 
-    226, 105, 11, 35, 4, 224, 96, 11, 35, 4, 153, 11, 35, 4, 222, 91, 11, 35, 
-    4, 217, 152, 11, 35, 4, 70, 11, 35, 4, 214, 105, 11, 35, 4, 212, 98, 11, 
-    35, 4, 211, 178, 11, 35, 4, 211, 117, 11, 35, 4, 210, 159, 11, 35, 23, 6, 
-    61, 11, 35, 23, 6, 253, 158, 11, 35, 23, 6, 251, 66, 11, 35, 23, 6, 249, 
-    60, 11, 35, 23, 6, 75, 11, 35, 23, 6, 245, 6, 11, 35, 23, 6, 243, 202, 
-    11, 35, 23, 6, 242, 60, 11, 35, 23, 6, 73, 11, 35, 23, 6, 235, 144, 11, 
-    35, 23, 6, 235, 23, 11, 35, 23, 6, 156, 11, 35, 23, 6, 193, 11, 35, 23, 
-    6, 230, 25, 11, 35, 23, 6, 76, 11, 35, 23, 6, 226, 105, 11, 35, 23, 6, 
-    224, 96, 11, 35, 23, 6, 153, 11, 35, 23, 6, 222, 91, 11, 35, 23, 6, 217, 
-    152, 11, 35, 23, 6, 70, 11, 35, 23, 6, 214, 105, 11, 35, 23, 6, 212, 98, 
-    11, 35, 23, 6, 211, 178, 11, 35, 23, 6, 211, 117, 11, 35, 23, 6, 210, 
-    159, 11, 35, 23, 4, 61, 11, 35, 23, 4, 253, 158, 11, 35, 23, 4, 251, 66, 
-    11, 35, 23, 4, 249, 60, 11, 35, 23, 4, 75, 11, 35, 23, 4, 245, 6, 11, 35, 
-    23, 4, 243, 202, 11, 35, 23, 4, 242, 60, 11, 35, 23, 4, 73, 11, 35, 23, 
-    4, 235, 144, 11, 35, 23, 4, 235, 23, 11, 35, 23, 4, 156, 11, 35, 23, 4, 
-    193, 11, 35, 23, 4, 230, 25, 11, 35, 23, 4, 76, 11, 35, 23, 4, 226, 105, 
-    11, 35, 23, 4, 224, 96, 11, 35, 23, 4, 153, 11, 35, 23, 4, 222, 91, 11, 
-    35, 23, 4, 217, 152, 11, 35, 23, 4, 70, 11, 35, 23, 4, 214, 105, 11, 35, 
-    23, 4, 212, 98, 11, 35, 23, 4, 211, 178, 11, 35, 23, 4, 211, 117, 11, 35, 
-    23, 4, 210, 159, 11, 35, 32, 6, 61, 11, 35, 32, 6, 253, 158, 11, 35, 32, 
-    6, 251, 66, 11, 35, 32, 6, 249, 60, 11, 35, 32, 6, 75, 11, 35, 32, 6, 
-    245, 6, 11, 35, 32, 6, 243, 202, 11, 35, 32, 6, 242, 60, 11, 35, 32, 6, 
-    73, 11, 35, 32, 6, 235, 144, 11, 35, 32, 6, 235, 23, 11, 35, 32, 6, 156, 
-    11, 35, 32, 6, 193, 11, 35, 32, 6, 230, 25, 11, 35, 32, 6, 76, 11, 35, 
-    32, 6, 226, 105, 11, 35, 32, 6, 224, 96, 11, 35, 32, 6, 153, 11, 35, 32, 
-    6, 222, 91, 11, 35, 32, 6, 217, 152, 11, 35, 32, 6, 70, 11, 35, 32, 6, 
-    214, 105, 11, 35, 32, 6, 212, 98, 11, 35, 32, 6, 211, 178, 11, 35, 32, 6, 
-    211, 117, 11, 35, 32, 6, 210, 159, 11, 35, 32, 4, 61, 11, 35, 32, 4, 253, 
-    158, 11, 35, 32, 4, 251, 66, 11, 35, 32, 4, 249, 60, 11, 35, 32, 4, 75, 
-    11, 35, 32, 4, 245, 6, 11, 35, 32, 4, 243, 202, 11, 35, 32, 4, 242, 60, 
-    11, 35, 32, 4, 73, 11, 35, 32, 4, 235, 144, 11, 35, 32, 4, 235, 23, 11, 
-    35, 32, 4, 156, 11, 35, 32, 4, 193, 11, 35, 32, 4, 230, 25, 11, 35, 32, 
-    4, 76, 11, 35, 32, 4, 226, 105, 11, 35, 32, 4, 224, 96, 11, 35, 32, 4, 
-    153, 11, 35, 32, 4, 222, 91, 11, 35, 32, 4, 217, 152, 11, 35, 32, 4, 70, 
-    11, 35, 32, 4, 214, 105, 11, 35, 32, 4, 212, 98, 11, 35, 32, 4, 211, 178, 
-    11, 35, 32, 4, 211, 117, 11, 35, 32, 4, 210, 159, 11, 35, 23, 32, 6, 61, 
-    11, 35, 23, 32, 6, 253, 158, 11, 35, 23, 32, 6, 251, 66, 11, 35, 23, 32, 
-    6, 249, 60, 11, 35, 23, 32, 6, 75, 11, 35, 23, 32, 6, 245, 6, 11, 35, 23, 
-    32, 6, 243, 202, 11, 35, 23, 32, 6, 242, 60, 11, 35, 23, 32, 6, 73, 11, 
-    35, 23, 32, 6, 235, 144, 11, 35, 23, 32, 6, 235, 23, 11, 35, 23, 32, 6, 
-    156, 11, 35, 23, 32, 6, 193, 11, 35, 23, 32, 6, 230, 25, 11, 35, 23, 32, 
-    6, 76, 11, 35, 23, 32, 6, 226, 105, 11, 35, 23, 32, 6, 224, 96, 11, 35, 
-    23, 32, 6, 153, 11, 35, 23, 32, 6, 222, 91, 11, 35, 23, 32, 6, 217, 152, 
-    11, 35, 23, 32, 6, 70, 11, 35, 23, 32, 6, 214, 105, 11, 35, 23, 32, 6, 
-    212, 98, 11, 35, 23, 32, 6, 211, 178, 11, 35, 23, 32, 6, 211, 117, 11, 
-    35, 23, 32, 6, 210, 159, 11, 35, 23, 32, 4, 61, 11, 35, 23, 32, 4, 253, 
-    158, 11, 35, 23, 32, 4, 251, 66, 11, 35, 23, 32, 4, 249, 60, 11, 35, 23, 
-    32, 4, 75, 11, 35, 23, 32, 4, 245, 6, 11, 35, 23, 32, 4, 243, 202, 11, 
-    35, 23, 32, 4, 242, 60, 11, 35, 23, 32, 4, 73, 11, 35, 23, 32, 4, 235, 
-    144, 11, 35, 23, 32, 4, 235, 23, 11, 35, 23, 32, 4, 156, 11, 35, 23, 32, 
-    4, 193, 11, 35, 23, 32, 4, 230, 25, 11, 35, 23, 32, 4, 76, 11, 35, 23, 
-    32, 4, 226, 105, 11, 35, 23, 32, 4, 224, 96, 11, 35, 23, 32, 4, 153, 11, 
-    35, 23, 32, 4, 222, 91, 11, 35, 23, 32, 4, 217, 152, 11, 35, 23, 32, 4, 
-    70, 11, 35, 23, 32, 4, 214, 105, 11, 35, 23, 32, 4, 212, 98, 11, 35, 23, 
-    32, 4, 211, 178, 11, 35, 23, 32, 4, 211, 117, 11, 35, 23, 32, 4, 210, 
-    159, 11, 230, 138, 6, 61, 11, 230, 138, 6, 253, 158, 11, 230, 138, 6, 
-    251, 66, 11, 230, 138, 6, 249, 60, 11, 230, 138, 6, 75, 11, 230, 138, 6, 
-    245, 6, 11, 230, 138, 6, 243, 202, 11, 230, 138, 6, 242, 60, 11, 230, 
-    138, 6, 73, 11, 230, 138, 6, 235, 144, 11, 230, 138, 6, 235, 23, 11, 230, 
-    138, 6, 156, 11, 230, 138, 6, 193, 11, 230, 138, 6, 230, 25, 11, 230, 
-    138, 6, 76, 11, 230, 138, 6, 226, 105, 11, 230, 138, 6, 224, 96, 11, 230, 
-    138, 6, 153, 11, 230, 138, 6, 222, 91, 11, 230, 138, 6, 217, 152, 11, 
-    230, 138, 6, 70, 11, 230, 138, 6, 214, 105, 11, 230, 138, 6, 212, 98, 11, 
-    230, 138, 6, 211, 178, 11, 230, 138, 6, 211, 117, 11, 230, 138, 6, 210, 
-    159, 11, 230, 138, 4, 61, 11, 230, 138, 4, 253, 158, 11, 230, 138, 4, 
-    251, 66, 11, 230, 138, 4, 249, 60, 11, 230, 138, 4, 75, 11, 230, 138, 4, 
-    245, 6, 11, 230, 138, 4, 243, 202, 11, 230, 138, 4, 242, 60, 11, 230, 
-    138, 4, 73, 11, 230, 138, 4, 235, 144, 11, 230, 138, 4, 235, 23, 11, 230, 
-    138, 4, 156, 11, 230, 138, 4, 193, 11, 230, 138, 4, 230, 25, 11, 230, 
-    138, 4, 76, 11, 230, 138, 4, 226, 105, 11, 230, 138, 4, 224, 96, 11, 230, 
-    138, 4, 153, 11, 230, 138, 4, 222, 91, 11, 230, 138, 4, 217, 152, 11, 
-    230, 138, 4, 70, 11, 230, 138, 4, 214, 105, 11, 230, 138, 4, 212, 98, 11, 
-    230, 138, 4, 211, 178, 11, 230, 138, 4, 211, 117, 11, 230, 138, 4, 210, 
-    159, 11, 32, 4, 247, 119, 73, 11, 32, 4, 247, 119, 235, 144, 11, 23, 6, 
-    254, 143, 11, 23, 6, 252, 26, 11, 23, 6, 243, 107, 11, 23, 6, 248, 54, 
-    11, 23, 6, 245, 100, 11, 23, 6, 210, 85, 11, 23, 6, 245, 63, 11, 23, 6, 
-    216, 179, 11, 23, 6, 235, 185, 11, 23, 6, 234, 222, 11, 23, 6, 233, 98, 
-    11, 23, 6, 230, 102, 11, 23, 6, 227, 237, 11, 23, 6, 211, 157, 11, 23, 6, 
-    226, 199, 11, 23, 6, 225, 108, 11, 23, 6, 223, 37, 11, 23, 6, 216, 180, 
-    87, 11, 23, 6, 219, 177, 11, 23, 6, 217, 41, 11, 23, 6, 214, 157, 11, 23, 
-    6, 225, 133, 11, 23, 6, 250, 110, 11, 23, 6, 224, 161, 11, 23, 6, 226, 
-    201, 11, 23, 229, 221, 11, 23, 4, 254, 143, 11, 23, 4, 252, 26, 11, 23, 
-    4, 243, 107, 11, 23, 4, 248, 54, 11, 23, 4, 245, 100, 11, 23, 4, 210, 85, 
-    11, 23, 4, 245, 63, 11, 23, 4, 216, 179, 11, 23, 4, 235, 185, 11, 23, 4, 
-    234, 222, 11, 23, 4, 233, 98, 11, 23, 4, 230, 102, 11, 23, 4, 227, 237, 
-    11, 23, 4, 211, 157, 11, 23, 4, 226, 199, 11, 23, 4, 225, 108, 11, 23, 4, 
-    223, 37, 11, 23, 4, 40, 219, 177, 11, 23, 4, 219, 177, 11, 23, 4, 217, 
-    41, 11, 23, 4, 214, 157, 11, 23, 4, 225, 133, 11, 23, 4, 250, 110, 11, 
-    23, 4, 224, 161, 11, 23, 4, 226, 201, 11, 23, 225, 253, 247, 233, 11, 23, 
-    245, 101, 87, 11, 23, 216, 180, 87, 11, 23, 234, 223, 87, 11, 23, 225, 
-    134, 87, 11, 23, 223, 38, 87, 11, 23, 225, 109, 87, 11, 32, 6, 254, 143, 
-    11, 32, 6, 252, 26, 11, 32, 6, 243, 107, 11, 32, 6, 248, 54, 11, 32, 6, 
-    245, 100, 11, 32, 6, 210, 85, 11, 32, 6, 245, 63, 11, 32, 6, 216, 179, 
-    11, 32, 6, 235, 185, 11, 32, 6, 234, 222, 11, 32, 6, 233, 98, 11, 32, 6, 
-    230, 102, 11, 32, 6, 227, 237, 11, 32, 6, 211, 157, 11, 32, 6, 226, 199, 
-    11, 32, 6, 225, 108, 11, 32, 6, 223, 37, 11, 32, 6, 216, 180, 87, 11, 32, 
-    6, 219, 177, 11, 32, 6, 217, 41, 11, 32, 6, 214, 157, 11, 32, 6, 225, 
-    133, 11, 32, 6, 250, 110, 11, 32, 6, 224, 161, 11, 32, 6, 226, 201, 11, 
-    32, 229, 221, 11, 32, 4, 254, 143, 11, 32, 4, 252, 26, 11, 32, 4, 243, 
-    107, 11, 32, 4, 248, 54, 11, 32, 4, 245, 100, 11, 32, 4, 210, 85, 11, 32, 
-    4, 245, 63, 11, 32, 4, 216, 179, 11, 32, 4, 235, 185, 11, 32, 4, 234, 
-    222, 11, 32, 4, 233, 98, 11, 32, 4, 230, 102, 11, 32, 4, 227, 237, 11, 
-    32, 4, 211, 157, 11, 32, 4, 226, 199, 11, 32, 4, 225, 108, 11, 32, 4, 
-    223, 37, 11, 32, 4, 40, 219, 177, 11, 32, 4, 219, 177, 11, 32, 4, 217, 
-    41, 11, 32, 4, 214, 157, 11, 32, 4, 225, 133, 11, 32, 4, 250, 110, 11, 
-    32, 4, 224, 161, 11, 32, 4, 226, 201, 11, 32, 225, 253, 247, 233, 11, 32, 
-    245, 101, 87, 11, 32, 216, 180, 87, 11, 32, 234, 223, 87, 11, 32, 225, 
-    134, 87, 11, 32, 223, 38, 87, 11, 32, 225, 109, 87, 11, 23, 32, 6, 254, 
-    143, 11, 23, 32, 6, 252, 26, 11, 23, 32, 6, 243, 107, 11, 23, 32, 6, 248, 
-    54, 11, 23, 32, 6, 245, 100, 11, 23, 32, 6, 210, 85, 11, 23, 32, 6, 245, 
-    63, 11, 23, 32, 6, 216, 179, 11, 23, 32, 6, 235, 185, 11, 23, 32, 6, 234, 
-    222, 11, 23, 32, 6, 233, 98, 11, 23, 32, 6, 230, 102, 11, 23, 32, 6, 227, 
-    237, 11, 23, 32, 6, 211, 157, 11, 23, 32, 6, 226, 199, 11, 23, 32, 6, 
-    225, 108, 11, 23, 32, 6, 223, 37, 11, 23, 32, 6, 216, 180, 87, 11, 23, 
-    32, 6, 219, 177, 11, 23, 32, 6, 217, 41, 11, 23, 32, 6, 214, 157, 11, 23, 
-    32, 6, 225, 133, 11, 23, 32, 6, 250, 110, 11, 23, 32, 6, 224, 161, 11, 
-    23, 32, 6, 226, 201, 11, 23, 32, 229, 221, 11, 23, 32, 4, 254, 143, 11, 
-    23, 32, 4, 252, 26, 11, 23, 32, 4, 243, 107, 11, 23, 32, 4, 248, 54, 11, 
-    23, 32, 4, 245, 100, 11, 23, 32, 4, 210, 85, 11, 23, 32, 4, 245, 63, 11, 
-    23, 32, 4, 216, 179, 11, 23, 32, 4, 235, 185, 11, 23, 32, 4, 234, 222, 
-    11, 23, 32, 4, 233, 98, 11, 23, 32, 4, 230, 102, 11, 23, 32, 4, 227, 237, 
-    11, 23, 32, 4, 211, 157, 11, 23, 32, 4, 226, 199, 11, 23, 32, 4, 225, 
-    108, 11, 23, 32, 4, 223, 37, 11, 23, 32, 4, 40, 219, 177, 11, 23, 32, 4, 
-    219, 177, 11, 23, 32, 4, 217, 41, 11, 23, 32, 4, 214, 157, 11, 23, 32, 4, 
-    225, 133, 11, 23, 32, 4, 250, 110, 11, 23, 32, 4, 224, 161, 11, 23, 32, 
-    4, 226, 201, 11, 23, 32, 225, 253, 247, 233, 11, 23, 32, 245, 101, 87, 
-    11, 23, 32, 216, 180, 87, 11, 23, 32, 234, 223, 87, 11, 23, 32, 225, 134, 
-    87, 11, 23, 32, 223, 38, 87, 11, 23, 32, 225, 109, 87, 11, 35, 23, 6, 
-    254, 143, 11, 35, 23, 6, 252, 26, 11, 35, 23, 6, 243, 107, 11, 35, 23, 6, 
-    248, 54, 11, 35, 23, 6, 245, 100, 11, 35, 23, 6, 210, 85, 11, 35, 23, 6, 
-    245, 63, 11, 35, 23, 6, 216, 179, 11, 35, 23, 6, 235, 185, 11, 35, 23, 6, 
-    234, 222, 11, 35, 23, 6, 233, 98, 11, 35, 23, 6, 230, 102, 11, 35, 23, 6, 
-    227, 237, 11, 35, 23, 6, 211, 157, 11, 35, 23, 6, 226, 199, 11, 35, 23, 
-    6, 225, 108, 11, 35, 23, 6, 223, 37, 11, 35, 23, 6, 216, 180, 87, 11, 35, 
-    23, 6, 219, 177, 11, 35, 23, 6, 217, 41, 11, 35, 23, 6, 214, 157, 11, 35, 
-    23, 6, 225, 133, 11, 35, 23, 6, 250, 110, 11, 35, 23, 6, 224, 161, 11, 
-    35, 23, 6, 226, 201, 11, 35, 23, 229, 221, 11, 35, 23, 4, 254, 143, 11, 
-    35, 23, 4, 252, 26, 11, 35, 23, 4, 243, 107, 11, 35, 23, 4, 248, 54, 11, 
-    35, 23, 4, 245, 100, 11, 35, 23, 4, 210, 85, 11, 35, 23, 4, 245, 63, 11, 
-    35, 23, 4, 216, 179, 11, 35, 23, 4, 235, 185, 11, 35, 23, 4, 234, 222, 
-    11, 35, 23, 4, 233, 98, 11, 35, 23, 4, 230, 102, 11, 35, 23, 4, 227, 237, 
-    11, 35, 23, 4, 211, 157, 11, 35, 23, 4, 226, 199, 11, 35, 23, 4, 225, 
-    108, 11, 35, 23, 4, 223, 37, 11, 35, 23, 4, 40, 219, 177, 11, 35, 23, 4, 
-    219, 177, 11, 35, 23, 4, 217, 41, 11, 35, 23, 4, 214, 157, 11, 35, 23, 4, 
-    225, 133, 11, 35, 23, 4, 250, 110, 11, 35, 23, 4, 224, 161, 11, 35, 23, 
-    4, 226, 201, 11, 35, 23, 225, 253, 247, 233, 11, 35, 23, 245, 101, 87, 
-    11, 35, 23, 216, 180, 87, 11, 35, 23, 234, 223, 87, 11, 35, 23, 225, 134, 
-    87, 11, 35, 23, 223, 38, 87, 11, 35, 23, 225, 109, 87, 11, 35, 23, 32, 6, 
-    254, 143, 11, 35, 23, 32, 6, 252, 26, 11, 35, 23, 32, 6, 243, 107, 11, 
-    35, 23, 32, 6, 248, 54, 11, 35, 23, 32, 6, 245, 100, 11, 35, 23, 32, 6, 
-    210, 85, 11, 35, 23, 32, 6, 245, 63, 11, 35, 23, 32, 6, 216, 179, 11, 35, 
-    23, 32, 6, 235, 185, 11, 35, 23, 32, 6, 234, 222, 11, 35, 23, 32, 6, 233, 
-    98, 11, 35, 23, 32, 6, 230, 102, 11, 35, 23, 32, 6, 227, 237, 11, 35, 23, 
-    32, 6, 211, 157, 11, 35, 23, 32, 6, 226, 199, 11, 35, 23, 32, 6, 225, 
-    108, 11, 35, 23, 32, 6, 223, 37, 11, 35, 23, 32, 6, 216, 180, 87, 11, 35, 
-    23, 32, 6, 219, 177, 11, 35, 23, 32, 6, 217, 41, 11, 35, 23, 32, 6, 214, 
-    157, 11, 35, 23, 32, 6, 225, 133, 11, 35, 23, 32, 6, 250, 110, 11, 35, 
-    23, 32, 6, 224, 161, 11, 35, 23, 32, 6, 226, 201, 11, 35, 23, 32, 229, 
-    221, 11, 35, 23, 32, 4, 254, 143, 11, 35, 23, 32, 4, 252, 26, 11, 35, 23, 
-    32, 4, 243, 107, 11, 35, 23, 32, 4, 248, 54, 11, 35, 23, 32, 4, 245, 100, 
-    11, 35, 23, 32, 4, 210, 85, 11, 35, 23, 32, 4, 245, 63, 11, 35, 23, 32, 
-    4, 216, 179, 11, 35, 23, 32, 4, 235, 185, 11, 35, 23, 32, 4, 234, 222, 
-    11, 35, 23, 32, 4, 233, 98, 11, 35, 23, 32, 4, 230, 102, 11, 35, 23, 32, 
-    4, 227, 237, 11, 35, 23, 32, 4, 211, 157, 11, 35, 23, 32, 4, 226, 199, 
-    11, 35, 23, 32, 4, 225, 108, 11, 35, 23, 32, 4, 223, 37, 11, 35, 23, 32, 
-    4, 40, 219, 177, 11, 35, 23, 32, 4, 219, 177, 11, 35, 23, 32, 4, 217, 41, 
-    11, 35, 23, 32, 4, 214, 157, 11, 35, 23, 32, 4, 225, 133, 11, 35, 23, 32, 
-    4, 250, 110, 11, 35, 23, 32, 4, 224, 161, 11, 35, 23, 32, 4, 226, 201, 
-    11, 35, 23, 32, 225, 253, 247, 233, 11, 35, 23, 32, 245, 101, 87, 11, 35, 
-    23, 32, 216, 180, 87, 11, 35, 23, 32, 234, 223, 87, 11, 35, 23, 32, 225, 
-    134, 87, 11, 35, 23, 32, 223, 38, 87, 11, 35, 23, 32, 225, 109, 87, 11, 
-    23, 6, 247, 227, 11, 23, 4, 247, 227, 11, 23, 21, 210, 86, 11, 23, 21, 
-    110, 11, 23, 21, 105, 11, 23, 21, 158, 11, 23, 21, 161, 11, 23, 21, 189, 
-    11, 23, 21, 194, 11, 23, 21, 198, 11, 23, 21, 195, 11, 23, 21, 200, 11, 
-    139, 21, 210, 86, 11, 139, 21, 110, 11, 139, 21, 105, 11, 139, 21, 158, 
-    11, 139, 21, 161, 11, 139, 21, 189, 11, 139, 21, 194, 11, 139, 21, 198, 
-    11, 139, 21, 195, 11, 139, 21, 200, 11, 35, 21, 210, 86, 11, 35, 21, 110, 
-    11, 35, 21, 105, 11, 35, 21, 158, 11, 35, 21, 161, 11, 35, 21, 189, 11, 
-    35, 21, 194, 11, 35, 21, 198, 11, 35, 21, 195, 11, 35, 21, 200, 11, 35, 
-    23, 21, 210, 86, 11, 35, 23, 21, 110, 11, 35, 23, 21, 105, 11, 35, 23, 
-    21, 158, 11, 35, 23, 21, 161, 11, 35, 23, 21, 189, 11, 35, 23, 21, 194, 
-    11, 35, 23, 21, 198, 11, 35, 23, 21, 195, 11, 35, 23, 21, 200, 11, 230, 
-    138, 21, 210, 86, 11, 230, 138, 21, 110, 11, 230, 138, 21, 105, 11, 230, 
-    138, 21, 158, 11, 230, 138, 21, 161, 11, 230, 138, 21, 189, 11, 230, 138, 
-    21, 194, 11, 230, 138, 21, 198, 11, 230, 138, 21, 195, 11, 230, 138, 21, 
-    200, 10, 11, 254, 170, 10, 11, 252, 54, 10, 11, 235, 123, 10, 11, 248, 
-    195, 10, 11, 212, 30, 10, 11, 210, 108, 10, 11, 242, 37, 10, 11, 217, 80, 
-    10, 11, 211, 43, 10, 11, 234, 250, 10, 11, 233, 102, 10, 11, 231, 78, 10, 
-    11, 228, 62, 10, 11, 221, 166, 10, 11, 254, 196, 10, 11, 244, 142, 10, 
-    11, 222, 26, 10, 11, 224, 81, 10, 11, 223, 95, 10, 11, 220, 59, 10, 11, 
-    217, 7, 10, 11, 216, 192, 10, 11, 234, 129, 10, 11, 216, 202, 10, 11, 
-    248, 216, 10, 11, 210, 111, 10, 11, 242, 244, 10, 11, 247, 119, 252, 54, 
-    10, 11, 247, 119, 228, 62, 10, 11, 247, 119, 244, 142, 10, 11, 247, 119, 
-    224, 81, 10, 11, 65, 252, 54, 10, 11, 65, 235, 123, 10, 11, 65, 241, 218, 
-    10, 11, 65, 242, 37, 10, 11, 65, 211, 43, 10, 11, 65, 234, 250, 10, 11, 
-    65, 233, 102, 10, 11, 65, 231, 78, 10, 11, 65, 228, 62, 10, 11, 65, 221, 
-    166, 10, 11, 65, 254, 196, 10, 11, 65, 244, 142, 10, 11, 65, 222, 26, 10, 
-    11, 65, 224, 81, 10, 11, 65, 220, 59, 10, 11, 65, 217, 7, 10, 11, 65, 
-    216, 192, 10, 11, 65, 234, 129, 10, 11, 65, 248, 216, 10, 11, 65, 242, 
-    244, 10, 11, 217, 76, 235, 123, 10, 11, 217, 76, 242, 37, 10, 11, 217, 
-    76, 211, 43, 10, 11, 217, 76, 233, 102, 10, 11, 217, 76, 228, 62, 10, 11, 
-    217, 76, 221, 166, 10, 11, 217, 76, 254, 196, 10, 11, 217, 76, 222, 26, 
-    10, 11, 217, 76, 224, 81, 10, 11, 217, 76, 220, 59, 10, 11, 217, 76, 234, 
-    129, 10, 11, 217, 76, 248, 216, 10, 11, 217, 76, 242, 244, 10, 11, 217, 
-    76, 247, 119, 228, 62, 10, 11, 217, 76, 247, 119, 224, 81, 10, 11, 218, 
-    110, 252, 54, 10, 11, 218, 110, 235, 123, 10, 11, 218, 110, 241, 218, 10, 
-    11, 218, 110, 242, 37, 10, 11, 218, 110, 217, 80, 10, 11, 218, 110, 211, 
-    43, 10, 11, 218, 110, 234, 250, 10, 11, 218, 110, 231, 78, 10, 11, 218, 
-    110, 228, 62, 10, 11, 218, 110, 221, 166, 10, 11, 218, 110, 254, 196, 10, 
-    11, 218, 110, 244, 142, 10, 11, 218, 110, 222, 26, 10, 11, 218, 110, 224, 
-    81, 10, 11, 218, 110, 220, 59, 10, 11, 218, 110, 217, 7, 10, 11, 218, 
-    110, 216, 192, 10, 11, 218, 110, 234, 129, 10, 11, 218, 110, 248, 216, 
-    10, 11, 218, 110, 210, 111, 10, 11, 218, 110, 242, 244, 10, 11, 218, 110, 
-    247, 119, 252, 54, 10, 11, 218, 110, 247, 119, 244, 142, 10, 11, 232, 
-    122, 254, 170, 10, 11, 232, 122, 252, 54, 10, 11, 232, 122, 235, 123, 10, 
-    11, 232, 122, 248, 195, 10, 11, 232, 122, 241, 218, 10, 11, 232, 122, 
-    212, 30, 10, 11, 232, 122, 210, 108, 10, 11, 232, 122, 242, 37, 10, 11, 
-    232, 122, 217, 80, 10, 11, 232, 122, 211, 43, 10, 11, 232, 122, 233, 102, 
-    10, 11, 232, 122, 231, 78, 10, 11, 232, 122, 228, 62, 10, 11, 232, 122, 
-    221, 166, 10, 11, 232, 122, 254, 196, 10, 11, 232, 122, 244, 142, 10, 11, 
-    232, 122, 222, 26, 10, 11, 232, 122, 224, 81, 10, 11, 232, 122, 223, 95, 
-    10, 11, 232, 122, 220, 59, 10, 11, 232, 122, 217, 7, 10, 11, 232, 122, 
-    216, 192, 10, 11, 232, 122, 234, 129, 10, 11, 232, 122, 216, 202, 10, 11, 
-    232, 122, 248, 216, 10, 11, 232, 122, 210, 111, 10, 11, 232, 122, 242, 
-    244, 10, 11, 139, 252, 54, 10, 11, 139, 235, 123, 10, 11, 139, 248, 195, 
-    10, 11, 139, 212, 30, 10, 11, 139, 210, 108, 10, 11, 139, 242, 37, 10, 
-    11, 139, 217, 80, 10, 11, 139, 211, 43, 10, 11, 139, 233, 102, 10, 11, 
-    139, 231, 78, 10, 11, 139, 228, 62, 10, 11, 139, 221, 166, 10, 11, 139, 
-    254, 196, 10, 11, 139, 244, 142, 10, 11, 139, 222, 26, 10, 11, 139, 224, 
-    81, 10, 11, 139, 223, 95, 10, 11, 139, 220, 59, 10, 11, 139, 217, 7, 10, 
-    11, 139, 216, 192, 10, 11, 139, 234, 129, 10, 11, 139, 216, 202, 10, 11, 
-    139, 248, 216, 10, 11, 139, 210, 111, 10, 11, 139, 242, 244, 10, 11, 226, 
-    168, 66, 2, 122, 2, 217, 43, 10, 11, 226, 168, 122, 2, 248, 195, 231, 
-    205, 86, 245, 220, 211, 239, 231, 205, 86, 219, 28, 211, 239, 231, 205, 
-    86, 212, 9, 211, 239, 231, 205, 86, 228, 56, 211, 239, 231, 205, 86, 223, 
-    111, 246, 96, 231, 205, 86, 242, 127, 246, 96, 231, 205, 86, 71, 246, 96, 
-    231, 205, 86, 123, 64, 250, 141, 231, 205, 86, 113, 64, 250, 141, 231, 
-    205, 86, 134, 64, 250, 141, 231, 205, 86, 244, 11, 64, 250, 141, 231, 
-    205, 86, 244, 81, 64, 250, 141, 231, 205, 86, 219, 125, 64, 250, 141, 
-    231, 205, 86, 220, 122, 64, 250, 141, 231, 205, 86, 245, 193, 64, 250, 
-    141, 231, 205, 86, 228, 200, 64, 250, 141, 231, 205, 86, 123, 64, 252, 
-    153, 231, 205, 86, 113, 64, 252, 153, 231, 205, 86, 134, 64, 252, 153, 
-    231, 205, 86, 244, 11, 64, 252, 153, 231, 205, 86, 244, 81, 64, 252, 153, 
-    231, 205, 86, 219, 125, 64, 252, 153, 231, 205, 86, 220, 122, 64, 252, 
-    153, 231, 205, 86, 245, 193, 64, 252, 153, 231, 205, 86, 228, 200, 64, 
-    252, 153, 231, 205, 86, 123, 64, 250, 34, 231, 205, 86, 113, 64, 250, 34, 
-    231, 205, 86, 134, 64, 250, 34, 231, 205, 86, 244, 11, 64, 250, 34, 231, 
-    205, 86, 244, 81, 64, 250, 34, 231, 205, 86, 219, 125, 64, 250, 34, 231, 
-    205, 86, 220, 122, 64, 250, 34, 231, 205, 86, 245, 193, 64, 250, 34, 231, 
-    205, 86, 228, 200, 64, 250, 34, 231, 205, 86, 225, 25, 231, 205, 86, 226, 
-    156, 231, 205, 86, 252, 154, 231, 205, 86, 250, 70, 231, 205, 86, 218, 
-    239, 231, 205, 86, 218, 39, 231, 205, 86, 253, 179, 231, 205, 86, 211, 
-    232, 231, 205, 86, 235, 62, 231, 205, 86, 252, 184, 131, 86, 203, 252, 
-    184, 131, 86, 241, 43, 131, 86, 241, 42, 131, 86, 241, 41, 131, 86, 241, 
-    40, 131, 86, 241, 39, 131, 86, 241, 38, 131, 86, 241, 37, 131, 86, 241, 
-    36, 131, 86, 241, 35, 131, 86, 241, 34, 131, 86, 241, 33, 131, 86, 241, 
-    32, 131, 86, 241, 31, 131, 86, 241, 30, 131, 86, 241, 29, 131, 86, 241, 
-    28, 131, 86, 241, 27, 131, 86, 241, 26, 131, 86, 241, 25, 131, 86, 241, 
-    24, 131, 86, 241, 23, 131, 86, 241, 22, 131, 86, 241, 21, 131, 86, 241, 
-    20, 131, 86, 241, 19, 131, 86, 241, 18, 131, 86, 241, 17, 131, 86, 241, 
-    16, 131, 86, 241, 15, 131, 86, 241, 14, 131, 86, 241, 13, 131, 86, 241, 
-    12, 131, 86, 241, 11, 131, 86, 241, 10, 131, 86, 241, 9, 131, 86, 241, 8, 
-    131, 86, 241, 7, 131, 86, 241, 6, 131, 86, 241, 5, 131, 86, 241, 4, 131, 
-    86, 241, 3, 131, 86, 241, 2, 131, 86, 241, 1, 131, 86, 241, 0, 131, 86, 
-    240, 255, 131, 86, 240, 254, 131, 86, 240, 253, 131, 86, 240, 252, 131, 
-    86, 240, 251, 131, 86, 67, 252, 184, 131, 86, 213, 238, 131, 86, 213, 
-    237, 131, 86, 213, 236, 131, 86, 213, 235, 131, 86, 213, 234, 131, 86, 
-    213, 233, 131, 86, 213, 232, 131, 86, 213, 231, 131, 86, 213, 230, 131, 
-    86, 213, 229, 131, 86, 213, 228, 131, 86, 213, 227, 131, 86, 213, 226, 
-    131, 86, 213, 225, 131, 86, 213, 224, 131, 86, 213, 223, 131, 86, 213, 
-    222, 131, 86, 213, 221, 131, 86, 213, 220, 131, 86, 213, 219, 131, 86, 
-    213, 218, 131, 86, 213, 217, 131, 86, 213, 216, 131, 86, 213, 215, 131, 
-    86, 213, 214, 131, 86, 213, 213, 131, 86, 213, 212, 131, 86, 213, 211, 
-    131, 86, 213, 210, 131, 86, 213, 209, 131, 86, 213, 208, 131, 86, 213, 
-    207, 131, 86, 213, 206, 131, 86, 213, 205, 131, 86, 213, 204, 131, 86, 
-    213, 203, 131, 86, 213, 202, 131, 86, 213, 201, 131, 86, 213, 200, 131, 
-    86, 213, 199, 131, 86, 213, 198, 131, 86, 213, 197, 131, 86, 213, 196, 
-    131, 86, 213, 195, 131, 86, 213, 194, 131, 86, 213, 193, 131, 86, 213, 
-    192, 131, 86, 213, 191, 131, 86, 213, 190, 225, 33, 250, 243, 252, 184, 
-    225, 33, 250, 243, 255, 9, 64, 219, 15, 225, 33, 250, 243, 113, 64, 219, 
-    15, 225, 33, 250, 243, 134, 64, 219, 15, 225, 33, 250, 243, 244, 11, 64, 
-    219, 15, 225, 33, 250, 243, 244, 81, 64, 219, 15, 225, 33, 250, 243, 219, 
-    125, 64, 219, 15, 225, 33, 250, 243, 220, 122, 64, 219, 15, 225, 33, 250, 
-    243, 245, 193, 64, 219, 15, 225, 33, 250, 243, 228, 200, 64, 219, 15, 
-    225, 33, 250, 243, 216, 248, 64, 219, 15, 225, 33, 250, 243, 235, 139, 
-    64, 219, 15, 225, 33, 250, 243, 234, 31, 64, 219, 15, 225, 33, 250, 243, 
-    224, 15, 64, 219, 15, 225, 33, 250, 243, 234, 79, 64, 219, 15, 225, 33, 
-    250, 243, 255, 9, 64, 241, 225, 225, 33, 250, 243, 113, 64, 241, 225, 
-    225, 33, 250, 243, 134, 64, 241, 225, 225, 33, 250, 243, 244, 11, 64, 
-    241, 225, 225, 33, 250, 243, 244, 81, 64, 241, 225, 225, 33, 250, 243, 
-    219, 125, 64, 241, 225, 225, 33, 250, 243, 220, 122, 64, 241, 225, 225, 
-    33, 250, 243, 245, 193, 64, 241, 225, 225, 33, 250, 243, 228, 200, 64, 
-    241, 225, 225, 33, 250, 243, 216, 248, 64, 241, 225, 225, 33, 250, 243, 
-    235, 139, 64, 241, 225, 225, 33, 250, 243, 234, 31, 64, 241, 225, 225, 
-    33, 250, 243, 224, 15, 64, 241, 225, 225, 33, 250, 243, 234, 79, 64, 241, 
-    225, 225, 33, 250, 243, 255, 9, 64, 247, 247, 225, 33, 250, 243, 113, 64, 
-    247, 247, 225, 33, 250, 243, 134, 64, 247, 247, 225, 33, 250, 243, 244, 
-    11, 64, 247, 247, 225, 33, 250, 243, 244, 81, 64, 247, 247, 225, 33, 250, 
-    243, 219, 125, 64, 247, 247, 225, 33, 250, 243, 220, 122, 64, 247, 247, 
-    225, 33, 250, 243, 245, 193, 64, 247, 247, 225, 33, 250, 243, 228, 200, 
-    64, 247, 247, 225, 33, 250, 243, 216, 248, 64, 247, 247, 225, 33, 250, 
-    243, 235, 139, 64, 247, 247, 225, 33, 250, 243, 234, 31, 64, 247, 247, 
-    225, 33, 250, 243, 224, 15, 64, 247, 247, 225, 33, 250, 243, 234, 79, 64, 
-    247, 247, 225, 33, 250, 243, 85, 235, 62, 225, 33, 250, 243, 255, 9, 64, 
-    249, 242, 225, 33, 250, 243, 113, 64, 249, 242, 225, 33, 250, 243, 134, 
-    64, 249, 242, 225, 33, 250, 243, 244, 11, 64, 249, 242, 225, 33, 250, 
-    243, 244, 81, 64, 249, 242, 225, 33, 250, 243, 219, 125, 64, 249, 242, 
-    225, 33, 250, 243, 220, 122, 64, 249, 242, 225, 33, 250, 243, 245, 193, 
-    64, 249, 242, 225, 33, 250, 243, 228, 200, 64, 249, 242, 225, 33, 250, 
-    243, 216, 248, 64, 249, 242, 225, 33, 250, 243, 235, 139, 64, 249, 242, 
-    225, 33, 250, 243, 234, 31, 64, 249, 242, 225, 33, 250, 243, 224, 15, 64, 
-    249, 242, 225, 33, 250, 243, 234, 79, 64, 249, 242, 225, 33, 250, 243, 
-    71, 235, 62, 21, 210, 87, 243, 229, 218, 129, 21, 210, 87, 249, 219, 21, 
-    123, 249, 219, 21, 113, 249, 219, 21, 134, 249, 219, 21, 244, 11, 249, 
-    219, 21, 244, 81, 249, 219, 21, 219, 125, 249, 219, 21, 220, 122, 249, 
-    219, 21, 245, 193, 249, 219, 21, 228, 200, 249, 219, 88, 7, 6, 1, 61, 88, 
-    7, 6, 1, 253, 158, 88, 7, 6, 1, 251, 66, 88, 7, 6, 1, 249, 60, 88, 7, 6, 
-    1, 75, 88, 7, 6, 1, 245, 6, 88, 7, 6, 1, 243, 202, 88, 7, 6, 1, 242, 60, 
-    88, 7, 6, 1, 73, 88, 7, 6, 1, 235, 144, 88, 7, 6, 1, 235, 23, 88, 7, 6, 
-    1, 156, 88, 7, 6, 1, 193, 88, 7, 6, 1, 230, 25, 88, 7, 6, 1, 76, 88, 7, 
-    6, 1, 226, 105, 88, 7, 6, 1, 224, 96, 88, 7, 6, 1, 153, 88, 7, 6, 1, 222, 
-    91, 88, 7, 6, 1, 217, 152, 88, 7, 6, 1, 70, 88, 7, 6, 1, 214, 105, 88, 7, 
-    6, 1, 212, 98, 88, 7, 6, 1, 211, 178, 88, 7, 6, 1, 211, 117, 88, 7, 6, 1, 
-    210, 159, 216, 6, 220, 53, 251, 157, 7, 6, 1, 222, 91, 37, 32, 7, 6, 1, 
-    251, 66, 37, 32, 7, 6, 1, 153, 37, 250, 191, 37, 211, 180, 92, 7, 6, 1, 
-    61, 92, 7, 6, 1, 253, 158, 92, 7, 6, 1, 251, 66, 92, 7, 6, 1, 249, 60, 
-    92, 7, 6, 1, 75, 92, 7, 6, 1, 245, 6, 92, 7, 6, 1, 243, 202, 92, 7, 6, 1, 
-    242, 60, 92, 7, 6, 1, 73, 92, 7, 6, 1, 235, 144, 92, 7, 6, 1, 235, 23, 
-    92, 7, 6, 1, 156, 92, 7, 6, 1, 193, 92, 7, 6, 1, 230, 25, 92, 7, 6, 1, 
-    76, 92, 7, 6, 1, 226, 105, 92, 7, 6, 1, 224, 96, 92, 7, 6, 1, 153, 92, 7, 
-    6, 1, 222, 91, 92, 7, 6, 1, 217, 152, 92, 7, 6, 1, 70, 92, 7, 6, 1, 214, 
-    105, 92, 7, 6, 1, 212, 98, 92, 7, 6, 1, 211, 178, 92, 7, 6, 1, 211, 117, 
-    92, 7, 6, 1, 210, 159, 92, 240, 201, 92, 230, 49, 92, 221, 183, 92, 218, 
-    226, 92, 224, 218, 92, 212, 23, 152, 37, 7, 6, 1, 61, 152, 37, 7, 6, 1, 
-    253, 158, 152, 37, 7, 6, 1, 251, 66, 152, 37, 7, 6, 1, 249, 60, 152, 37, 
-    7, 6, 1, 75, 152, 37, 7, 6, 1, 245, 6, 152, 37, 7, 6, 1, 243, 202, 152, 
-    37, 7, 6, 1, 242, 60, 152, 37, 7, 6, 1, 73, 152, 37, 7, 6, 1, 235, 144, 
-    152, 37, 7, 6, 1, 235, 23, 152, 37, 7, 6, 1, 156, 152, 37, 7, 6, 1, 193, 
-    152, 37, 7, 6, 1, 230, 25, 152, 37, 7, 6, 1, 76, 152, 37, 7, 6, 1, 226, 
-    105, 152, 37, 7, 6, 1, 224, 96, 152, 37, 7, 6, 1, 153, 152, 37, 7, 6, 1, 
-    222, 91, 152, 37, 7, 6, 1, 217, 152, 152, 37, 7, 6, 1, 70, 152, 37, 7, 6, 
-    1, 214, 105, 152, 37, 7, 6, 1, 212, 98, 152, 37, 7, 6, 1, 211, 178, 152, 
-    37, 7, 6, 1, 211, 117, 152, 37, 7, 6, 1, 210, 159, 223, 157, 231, 97, 50, 
-    223, 157, 231, 94, 50, 152, 92, 7, 6, 1, 61, 152, 92, 7, 6, 1, 253, 158, 
-    152, 92, 7, 6, 1, 251, 66, 152, 92, 7, 6, 1, 249, 60, 152, 92, 7, 6, 1, 
-    75, 152, 92, 7, 6, 1, 245, 6, 152, 92, 7, 6, 1, 243, 202, 152, 92, 7, 6, 
-    1, 242, 60, 152, 92, 7, 6, 1, 73, 152, 92, 7, 6, 1, 235, 144, 152, 92, 7, 
-    6, 1, 235, 23, 152, 92, 7, 6, 1, 156, 152, 92, 7, 6, 1, 193, 152, 92, 7, 
-    6, 1, 230, 25, 152, 92, 7, 6, 1, 76, 152, 92, 7, 6, 1, 226, 105, 152, 92, 
-    7, 6, 1, 224, 96, 152, 92, 7, 6, 1, 153, 152, 92, 7, 6, 1, 222, 91, 152, 
-    92, 7, 6, 1, 217, 152, 152, 92, 7, 6, 1, 70, 152, 92, 7, 6, 1, 214, 105, 
-    152, 92, 7, 6, 1, 212, 98, 152, 92, 7, 6, 1, 211, 178, 152, 92, 7, 6, 1, 
-    211, 117, 152, 92, 7, 6, 1, 210, 159, 249, 128, 152, 92, 7, 6, 1, 226, 
-    105, 152, 92, 240, 113, 152, 92, 190, 152, 92, 206, 152, 92, 255, 25, 
-    152, 92, 212, 23, 42, 247, 164, 92, 250, 23, 92, 249, 170, 92, 243, 252, 
-    92, 240, 105, 92, 229, 86, 92, 229, 79, 92, 226, 214, 92, 219, 35, 92, 
-    120, 2, 245, 31, 78, 92, 213, 119, 223, 103, 235, 239, 16, 1, 61, 223, 
-    103, 235, 239, 16, 1, 253, 158, 223, 103, 235, 239, 16, 1, 251, 66, 223, 
-    103, 235, 239, 16, 1, 249, 60, 223, 103, 235, 239, 16, 1, 75, 223, 103, 
-    235, 239, 16, 1, 245, 6, 223, 103, 235, 239, 16, 1, 243, 202, 223, 103, 
-    235, 239, 16, 1, 242, 60, 223, 103, 235, 239, 16, 1, 73, 223, 103, 235, 
-    239, 16, 1, 235, 144, 223, 103, 235, 239, 16, 1, 235, 23, 223, 103, 235, 
-    239, 16, 1, 156, 223, 103, 235, 239, 16, 1, 193, 223, 103, 235, 239, 16, 
-    1, 230, 25, 223, 103, 235, 239, 16, 1, 76, 223, 103, 235, 239, 16, 1, 
-    226, 105, 223, 103, 235, 239, 16, 1, 224, 96, 223, 103, 235, 239, 16, 1, 
-    153, 223, 103, 235, 239, 16, 1, 222, 91, 223, 103, 235, 239, 16, 1, 217, 
-    152, 223, 103, 235, 239, 16, 1, 70, 223, 103, 235, 239, 16, 1, 214, 105, 
-    223, 103, 235, 239, 16, 1, 212, 98, 223, 103, 235, 239, 16, 1, 211, 178, 
-    223, 103, 235, 239, 16, 1, 211, 117, 223, 103, 235, 239, 16, 1, 210, 159, 
-    42, 141, 241, 63, 92, 56, 234, 18, 92, 56, 206, 92, 9, 214, 177, 238, 50, 
-    92, 9, 214, 177, 238, 54, 92, 9, 214, 177, 238, 62, 92, 56, 248, 90, 92, 
-    9, 214, 177, 238, 69, 92, 9, 214, 177, 238, 56, 92, 9, 214, 177, 238, 28, 
-    92, 9, 214, 177, 238, 55, 92, 9, 214, 177, 238, 68, 92, 9, 214, 177, 238, 
-    42, 92, 9, 214, 177, 238, 35, 92, 9, 214, 177, 238, 44, 92, 9, 214, 177, 
-    238, 65, 92, 9, 214, 177, 238, 51, 92, 9, 214, 177, 238, 67, 92, 9, 214, 
-    177, 238, 43, 92, 9, 214, 177, 238, 66, 92, 9, 214, 177, 238, 29, 92, 9, 
-    214, 177, 238, 34, 92, 9, 214, 177, 238, 27, 92, 9, 214, 177, 238, 57, 
-    92, 9, 214, 177, 238, 59, 92, 9, 214, 177, 238, 37, 92, 9, 214, 177, 238, 
-    48, 92, 9, 214, 177, 238, 46, 92, 9, 214, 177, 238, 72, 92, 9, 214, 177, 
-    238, 71, 92, 9, 214, 177, 238, 25, 92, 9, 214, 177, 238, 52, 92, 9, 214, 
-    177, 238, 70, 92, 9, 214, 177, 238, 61, 92, 9, 214, 177, 238, 47, 92, 9, 
-    214, 177, 238, 26, 92, 9, 214, 177, 238, 49, 92, 9, 214, 177, 238, 31, 
-    92, 9, 214, 177, 238, 30, 92, 9, 214, 177, 238, 60, 92, 9, 214, 177, 238, 
-    38, 92, 9, 214, 177, 238, 40, 92, 9, 214, 177, 238, 41, 92, 9, 214, 177, 
-    238, 33, 92, 9, 214, 177, 238, 64, 92, 9, 214, 177, 238, 58, 216, 6, 220, 
-    53, 251, 157, 9, 214, 177, 238, 39, 216, 6, 220, 53, 251, 157, 9, 214, 
-    177, 238, 71, 216, 6, 220, 53, 251, 157, 9, 214, 177, 238, 69, 216, 6, 
-    220, 53, 251, 157, 9, 214, 177, 238, 53, 216, 6, 220, 53, 251, 157, 9, 
-    214, 177, 238, 36, 216, 6, 220, 53, 251, 157, 9, 214, 177, 238, 49, 216, 
-    6, 220, 53, 251, 157, 9, 214, 177, 238, 32, 216, 6, 220, 53, 251, 157, 9, 
-    214, 177, 238, 63, 216, 6, 220, 53, 251, 157, 9, 214, 177, 238, 45, 37, 
-    154, 254, 245, 37, 154, 255, 12, 249, 71, 244, 42, 250, 0, 214, 194, 228, 
-    213, 2, 218, 153, 218, 33, 117, 230, 114, 218, 32, 250, 26, 253, 207, 
-    246, 54, 218, 31, 117, 251, 118, 223, 158, 251, 140, 253, 207, 228, 212, 
-    212, 41, 212, 35, 213, 131, 230, 195, 212, 25, 245, 224, 242, 181, 245, 
-    45, 245, 224, 242, 181, 254, 128, 245, 224, 242, 181, 253, 225, 242, 181, 
-    2, 231, 51, 166, 230, 129, 87, 212, 27, 249, 137, 230, 129, 87, 244, 92, 
-    224, 22, 230, 129, 87, 212, 27, 242, 210, 230, 129, 87, 243, 229, 230, 
-    129, 87, 212, 52, 242, 210, 230, 129, 87, 233, 80, 224, 22, 230, 129, 87, 
-    212, 52, 249, 137, 230, 129, 87, 249, 137, 230, 128, 166, 230, 129, 2, 
-    244, 190, 244, 92, 224, 22, 230, 129, 2, 244, 190, 233, 80, 224, 22, 230, 
-    129, 2, 244, 190, 243, 229, 230, 129, 2, 244, 190, 218, 38, 2, 244, 190, 
-    242, 179, 218, 156, 219, 255, 218, 156, 250, 116, 221, 168, 245, 39, 215, 
-    235, 248, 84, 215, 235, 226, 59, 215, 235, 251, 27, 215, 109, 250, 118, 
-    251, 210, 222, 191, 241, 179, 218, 36, 251, 210, 245, 228, 64, 231, 194, 
-    245, 228, 64, 223, 31, 241, 204, 244, 11, 233, 54, 249, 246, 231, 170, 
-    233, 53, 244, 176, 233, 53, 233, 54, 244, 47, 236, 0, 211, 239, 230, 58, 
-    216, 34, 253, 191, 242, 143, 231, 67, 212, 39, 217, 57, 233, 26, 252, 
-    149, 225, 62, 223, 111, 254, 54, 242, 127, 254, 54, 225, 217, 225, 218, 
-    250, 119, 218, 114, 242, 23, 219, 90, 64, 225, 44, 231, 87, 226, 197, 
-    251, 194, 224, 229, 233, 36, 223, 32, 249, 142, 223, 32, 252, 159, 249, 
-    173, 223, 31, 249, 95, 22, 223, 31, 218, 141, 251, 167, 219, 14, 251, 
-    151, 243, 251, 243, 247, 222, 207, 217, 246, 224, 231, 248, 175, 226, 
-    236, 218, 7, 243, 248, 219, 230, 244, 91, 251, 21, 2, 217, 239, 248, 35, 
-    219, 52, 240, 112, 249, 141, 220, 70, 240, 111, 240, 112, 249, 141, 246, 
-    108, 249, 172, 250, 84, 130, 250, 254, 232, 141, 249, 88, 241, 55, 224, 
-    233, 219, 240, 252, 36, 251, 163, 224, 234, 64, 244, 33, 249, 171, 244, 
-    24, 22, 234, 32, 217, 19, 211, 230, 242, 13, 222, 12, 251, 177, 22, 249, 
-    102, 211, 237, 242, 184, 249, 235, 242, 184, 215, 193, 246, 90, 252, 62, 
-    230, 93, 250, 7, 252, 62, 230, 92, 252, 187, 251, 176, 223, 33, 211, 201, 
-    224, 195, 251, 235, 251, 20, 235, 138, 250, 77, 215, 235, 244, 162, 250, 
-    76, 244, 94, 244, 95, 219, 12, 252, 158, 225, 250, 224, 244, 249, 204, 
-    252, 159, 217, 59, 215, 235, 249, 128, 244, 67, 225, 63, 248, 81, 235, 
-    131, 247, 131, 250, 232, 218, 113, 211, 240, 250, 98, 230, 129, 213, 164, 
-    250, 162, 221, 199, 221, 224, 242, 148, 250, 251, 250, 233, 240, 245, 
-    244, 130, 212, 0, 222, 200, 249, 236, 244, 86, 225, 2, 22, 244, 90, 230, 
-    227, 230, 108, 251, 10, 250, 39, 241, 232, 253, 241, 226, 62, 216, 14, 
-    241, 251, 250, 29, 216, 242, 216, 113, 250, 20, 251, 202, 225, 177, 253, 
-    240, 213, 172, 243, 110, 247, 197, 241, 156, 219, 84, 231, 234, 251, 245, 
-    243, 111, 247, 240, 251, 166, 244, 52, 225, 33, 250, 241, 28, 228, 47, 
-    230, 85, 28, 228, 42, 221, 212, 242, 99, 28, 234, 137, 215, 190, 213, 
-    154, 28, 221, 192, 222, 124, 220, 11, 2, 221, 227, 216, 244, 223, 178, 
-    22, 252, 159, 219, 105, 22, 219, 105, 251, 187, 252, 123, 22, 241, 49, 
-    250, 120, 244, 73, 219, 63, 222, 125, 218, 12, 215, 194, 240, 246, 223, 
-    179, 254, 129, 244, 31, 222, 136, 244, 31, 217, 241, 240, 235, 251, 119, 
-    240, 235, 2, 243, 94, 226, 229, 251, 119, 235, 131, 224, 239, 226, 228, 
-    245, 44, 224, 239, 226, 228, 240, 244, 252, 145, 253, 181, 216, 252, 231, 
-    234, 240, 240, 232, 111, 240, 240, 249, 176, 218, 125, 221, 198, 248, 43, 
-    218, 125, 244, 180, 235, 149, 233, 89, 235, 131, 250, 226, 245, 44, 250, 
-    226, 223, 141, 230, 112, 226, 114, 212, 41, 251, 123, 249, 145, 216, 106, 
-    233, 18, 223, 180, 250, 224, 246, 96, 249, 135, 212, 3, 219, 70, 219, 68, 
-    240, 245, 223, 153, 242, 170, 220, 57, 230, 145, 222, 194, 250, 108, 247, 
-    136, 225, 73, 251, 203, 245, 169, 226, 238, 218, 252, 220, 52, 251, 122, 
-    254, 92, 241, 54, 233, 121, 252, 60, 244, 90, 215, 193, 244, 90, 251, 
-    209, 215, 91, 241, 249, 250, 109, 252, 187, 250, 109, 243, 242, 252, 187, 
-    250, 109, 251, 237, 225, 195, 234, 26, 224, 248, 246, 87, 251, 11, 252, 
-    177, 251, 11, 247, 130, 230, 113, 244, 190, 249, 146, 244, 190, 216, 107, 
-    244, 190, 223, 181, 244, 190, 250, 225, 244, 190, 246, 97, 244, 190, 218, 
-    241, 212, 3, 240, 246, 244, 190, 230, 146, 244, 190, 247, 137, 244, 190, 
-    225, 74, 244, 190, 243, 245, 244, 190, 242, 20, 244, 190, 211, 224, 244, 
-    190, 252, 71, 244, 190, 226, 45, 244, 190, 225, 74, 228, 53, 225, 232, 
-    224, 186, 245, 13, 245, 227, 228, 53, 230, 110, 216, 19, 71, 120, 225, 7, 
-    252, 182, 235, 242, 71, 124, 225, 7, 252, 182, 235, 242, 71, 43, 225, 7, 
-    252, 182, 235, 242, 71, 44, 225, 7, 252, 182, 235, 242, 244, 84, 242, 16, 
-    50, 212, 33, 242, 16, 50, 226, 215, 242, 16, 50, 216, 135, 120, 50, 216, 
-    135, 124, 50, 250, 19, 242, 11, 50, 204, 242, 11, 50, 249, 123, 211, 220, 
-    241, 251, 245, 14, 229, 104, 217, 151, 235, 125, 246, 92, 234, 82, 251, 
-    247, 211, 220, 249, 249, 224, 127, 242, 14, 224, 230, 231, 177, 220, 4, 
-    253, 203, 220, 4, 241, 164, 220, 4, 211, 220, 221, 240, 211, 220, 251, 
-    186, 244, 29, 251, 90, 236, 0, 219, 169, 251, 89, 236, 0, 219, 169, 251, 
-    162, 242, 194, 231, 185, 211, 221, 244, 174, 231, 186, 22, 211, 222, 241, 
-    60, 242, 10, 113, 231, 59, 241, 60, 242, 10, 113, 211, 219, 241, 60, 242, 
-    10, 224, 255, 226, 227, 211, 222, 2, 251, 106, 245, 225, 251, 141, 2, 
-    213, 246, 225, 168, 2, 251, 212, 242, 34, 231, 186, 2, 242, 110, 225, 
-    109, 231, 174, 231, 186, 2, 215, 97, 226, 208, 231, 185, 226, 208, 211, 
-    221, 252, 186, 249, 190, 211, 205, 224, 189, 235, 131, 226, 223, 235, 
-    131, 242, 169, 242, 222, 252, 187, 254, 113, 245, 18, 254, 160, 254, 161, 
-    230, 136, 236, 5, 219, 100, 235, 232, 248, 34, 225, 167, 242, 105, 248, 
-    179, 232, 201, 229, 211, 224, 254, 244, 191, 231, 142, 242, 33, 252, 138, 
-    225, 1, 217, 171, 225, 66, 234, 64, 78, 232, 111, 233, 10, 222, 233, 243, 
-    54, 218, 131, 234, 63, 251, 171, 249, 148, 2, 241, 227, 212, 19, 252, 69, 
-    241, 227, 251, 135, 241, 227, 113, 241, 225, 219, 10, 241, 227, 242, 120, 
-    241, 227, 241, 228, 2, 74, 251, 208, 241, 227, 242, 127, 241, 227, 211, 
-    42, 241, 227, 224, 128, 241, 227, 241, 228, 2, 223, 33, 223, 44, 241, 
-    225, 241, 228, 248, 81, 247, 249, 220, 82, 2, 115, 59, 235, 215, 245, 
-    172, 192, 251, 116, 254, 112, 87, 251, 195, 219, 92, 87, 249, 228, 87, 
-    218, 246, 217, 248, 87, 246, 85, 248, 157, 87, 225, 67, 64, 224, 249, 
-    244, 61, 252, 3, 247, 165, 87, 219, 3, 252, 158, 216, 149, 252, 158, 71, 
-    244, 51, 240, 211, 225, 5, 87, 230, 149, 252, 172, 249, 98, 245, 32, 114, 
-    247, 132, 50, 249, 139, 250, 242, 252, 144, 2, 211, 40, 50, 252, 144, 2, 
-    247, 132, 50, 252, 144, 2, 245, 47, 50, 252, 144, 2, 224, 228, 50, 230, 
-    149, 2, 211, 235, 250, 138, 2, 214, 153, 215, 231, 22, 211, 40, 50, 221, 
-    178, 225, 166, 249, 208, 251, 139, 230, 186, 244, 56, 247, 185, 226, 161, 
-    247, 190, 246, 49, 244, 107, 244, 40, 204, 244, 107, 244, 40, 226, 76, 2, 
-    249, 100, 226, 76, 244, 183, 214, 163, 251, 16, 217, 18, 251, 16, 250, 
-    243, 235, 242, 250, 138, 2, 214, 153, 215, 230, 250, 138, 2, 246, 104, 
-    215, 230, 252, 141, 250, 137, 250, 6, 224, 123, 222, 185, 224, 123, 226, 
-    19, 218, 121, 222, 131, 215, 222, 222, 131, 251, 191, 217, 91, 233, 51, 
-    228, 45, 228, 46, 2, 248, 80, 249, 147, 250, 0, 251, 192, 204, 251, 192, 
-    242, 127, 251, 192, 251, 208, 251, 192, 226, 157, 251, 192, 251, 189, 
-    229, 205, 252, 175, 221, 186, 231, 60, 217, 1, 223, 123, 226, 74, 244, 
-    159, 231, 234, 221, 223, 254, 89, 224, 145, 254, 252, 232, 113, 250, 127, 
-    231, 72, 226, 129, 215, 238, 235, 252, 215, 238, 226, 82, 246, 24, 87, 
-    235, 249, 245, 119, 245, 120, 2, 246, 104, 80, 48, 250, 0, 231, 200, 2, 
-    232, 107, 244, 73, 250, 0, 231, 200, 2, 223, 157, 244, 73, 204, 231, 200, 
-    2, 223, 157, 244, 73, 204, 231, 200, 2, 232, 107, 244, 73, 224, 236, 224, 
-    237, 240, 248, 229, 84, 230, 159, 225, 117, 230, 159, 225, 118, 2, 97, 
-    80, 253, 207, 233, 46, 213, 175, 230, 158, 230, 159, 225, 118, 226, 230, 
-    228, 75, 230, 159, 225, 116, 254, 90, 2, 252, 129, 251, 10, 213, 172, 
-    251, 10, 216, 254, 223, 173, 213, 171, 215, 60, 97, 253, 247, 250, 2, 97, 
-    22, 140, 204, 250, 36, 253, 247, 250, 2, 97, 22, 140, 204, 250, 36, 253, 
-    248, 2, 37, 123, 226, 120, 250, 2, 246, 104, 22, 214, 153, 204, 250, 36, 
-    253, 247, 254, 88, 246, 104, 22, 214, 153, 204, 250, 36, 253, 247, 121, 
-    251, 138, 87, 125, 251, 138, 87, 219, 7, 2, 251, 4, 91, 219, 6, 219, 7, 
-    2, 123, 219, 31, 212, 35, 219, 7, 2, 134, 219, 31, 212, 34, 252, 115, 
-    245, 172, 225, 27, 233, 42, 231, 211, 242, 184, 222, 247, 231, 211, 242, 
-    184, 232, 152, 2, 235, 225, 225, 199, 250, 0, 232, 152, 2, 234, 138, 234, 
-    138, 232, 151, 204, 232, 151, 252, 44, 252, 45, 2, 251, 4, 91, 251, 190, 
-    232, 204, 87, 223, 174, 251, 86, 252, 185, 2, 140, 80, 48, 245, 143, 2, 
-    140, 80, 48, 226, 197, 2, 245, 31, 164, 2, 43, 44, 80, 48, 219, 39, 2, 
-    97, 80, 48, 216, 14, 2, 214, 153, 80, 48, 228, 75, 123, 214, 184, 245, 
-    191, 87, 234, 136, 216, 247, 235, 219, 16, 31, 7, 6, 233, 9, 235, 219, 
-    16, 31, 7, 4, 233, 9, 235, 219, 16, 31, 227, 199, 235, 219, 16, 31, 217, 
-    183, 235, 219, 16, 31, 7, 233, 9, 244, 96, 245, 172, 216, 9, 211, 199, 
-    242, 21, 227, 182, 22, 251, 197, 241, 66, 225, 50, 230, 226, 216, 255, 
-    249, 114, 252, 159, 219, 125, 225, 9, 218, 157, 2, 230, 224, 247, 120, 
-    235, 131, 16, 31, 252, 57, 215, 220, 245, 156, 85, 42, 251, 86, 71, 42, 
-    251, 86, 233, 85, 223, 111, 250, 35, 233, 85, 251, 208, 250, 35, 233, 85, 
-    226, 157, 247, 248, 233, 85, 251, 208, 247, 248, 4, 226, 157, 247, 248, 
-    4, 251, 208, 247, 248, 214, 162, 223, 111, 215, 225, 246, 105, 223, 111, 
-    215, 225, 214, 162, 4, 223, 111, 215, 225, 246, 105, 4, 223, 111, 215, 
-    225, 37, 249, 131, 224, 252, 249, 131, 224, 253, 2, 242, 26, 51, 249, 
-    131, 224, 252, 228, 49, 43, 220, 153, 2, 134, 247, 118, 250, 4, 244, 191, 
-    123, 226, 242, 250, 4, 244, 191, 113, 226, 242, 250, 4, 244, 191, 134, 
-    226, 242, 250, 4, 244, 191, 244, 11, 226, 242, 250, 4, 244, 191, 244, 81, 
-    226, 242, 250, 4, 244, 191, 219, 125, 226, 242, 250, 4, 244, 191, 220, 
-    122, 226, 242, 250, 4, 244, 191, 245, 193, 226, 242, 250, 4, 244, 191, 
-    228, 200, 226, 242, 250, 4, 244, 191, 216, 248, 226, 242, 250, 4, 244, 
-    191, 245, 168, 226, 242, 250, 4, 244, 191, 215, 77, 226, 242, 250, 4, 
-    244, 191, 226, 192, 250, 4, 244, 191, 215, 56, 250, 4, 244, 191, 216, 
-    140, 250, 4, 244, 191, 244, 7, 250, 4, 244, 191, 244, 79, 250, 4, 244, 
-    191, 219, 121, 250, 4, 244, 191, 220, 121, 250, 4, 244, 191, 245, 192, 
-    250, 4, 244, 191, 228, 199, 250, 4, 244, 191, 216, 246, 250, 4, 244, 191, 
-    245, 166, 250, 4, 244, 191, 215, 75, 230, 117, 243, 230, 216, 36, 216, 2, 
-    218, 148, 64, 232, 239, 219, 170, 64, 235, 132, 230, 106, 242, 124, 244, 
-    190, 242, 124, 244, 191, 2, 219, 74, 245, 13, 244, 191, 2, 217, 14, 64, 
-    235, 53, 219, 74, 244, 191, 2, 204, 230, 110, 219, 74, 244, 191, 2, 204, 
-    230, 111, 22, 219, 74, 245, 13, 219, 74, 244, 191, 2, 204, 230, 111, 22, 
-    249, 230, 217, 247, 219, 74, 244, 191, 2, 204, 230, 111, 22, 216, 104, 
-    245, 13, 219, 74, 244, 191, 2, 242, 25, 219, 74, 244, 191, 2, 240, 247, 
-    211, 233, 244, 190, 219, 74, 244, 191, 2, 219, 74, 245, 13, 244, 191, 
-    221, 217, 248, 62, 244, 33, 223, 88, 244, 190, 219, 74, 244, 191, 2, 241, 
-    226, 245, 13, 219, 74, 244, 191, 2, 218, 34, 219, 73, 244, 190, 229, 87, 
-    244, 190, 245, 23, 244, 190, 214, 188, 244, 190, 244, 191, 2, 249, 230, 
-    217, 247, 225, 192, 244, 190, 249, 201, 244, 190, 249, 202, 244, 190, 
-    234, 62, 244, 190, 244, 191, 216, 137, 115, 234, 63, 234, 62, 244, 191, 
-    2, 219, 74, 245, 13, 234, 62, 244, 191, 2, 250, 0, 245, 13, 244, 191, 2, 
-    218, 88, 216, 19, 244, 191, 2, 218, 88, 216, 20, 22, 211, 233, 245, 15, 
-    244, 191, 2, 218, 88, 216, 20, 22, 216, 104, 245, 13, 247, 192, 244, 190, 
-    211, 204, 244, 190, 254, 108, 244, 190, 224, 227, 244, 190, 249, 116, 
-    244, 190, 225, 170, 244, 190, 244, 191, 2, 232, 126, 64, 215, 204, 247, 
-    192, 251, 88, 223, 88, 244, 190, 243, 239, 244, 191, 2, 204, 230, 110, 
-    254, 106, 244, 190, 244, 152, 244, 190, 212, 20, 244, 190, 219, 91, 244, 
-    190, 216, 71, 244, 190, 242, 125, 244, 190, 232, 114, 249, 116, 244, 190, 
-    244, 191, 2, 204, 230, 110, 240, 203, 244, 190, 244, 191, 2, 204, 230, 
-    111, 22, 249, 230, 217, 247, 244, 191, 221, 190, 236, 0, 244, 153, 253, 
-    213, 244, 190, 244, 49, 244, 190, 219, 92, 244, 190, 247, 165, 244, 190, 
-    244, 191, 211, 230, 230, 110, 244, 191, 2, 231, 84, 231, 144, 242, 124, 
-    250, 225, 244, 191, 2, 219, 74, 245, 13, 250, 225, 244, 191, 2, 217, 14, 
-    64, 235, 53, 219, 74, 250, 225, 244, 191, 2, 204, 230, 110, 219, 74, 250, 
-    225, 244, 191, 2, 241, 226, 245, 13, 250, 225, 244, 191, 2, 211, 196, 
-    219, 75, 234, 62, 250, 225, 244, 191, 2, 250, 0, 245, 13, 224, 227, 250, 
-    225, 244, 190, 249, 116, 250, 225, 244, 190, 212, 20, 250, 225, 244, 190, 
-    244, 191, 2, 228, 75, 242, 163, 243, 34, 244, 191, 2, 226, 215, 243, 34, 
-    225, 168, 251, 168, 248, 75, 221, 169, 230, 145, 241, 229, 230, 145, 219, 
-    8, 230, 145, 242, 5, 225, 168, 223, 156, 123, 242, 15, 225, 168, 223, 
-    156, 251, 178, 242, 11, 236, 0, 250, 179, 225, 168, 243, 238, 225, 168, 
-    2, 224, 227, 244, 190, 225, 168, 2, 244, 41, 242, 10, 222, 203, 241, 214, 
-    218, 143, 232, 149, 223, 162, 250, 244, 241, 162, 215, 248, 241, 162, 
-    215, 249, 2, 251, 114, 228, 53, 215, 248, 231, 32, 192, 223, 163, 218, 
-    149, 215, 246, 215, 247, 250, 244, 251, 92, 226, 194, 251, 92, 215, 201, 
-    251, 93, 218, 129, 230, 187, 254, 130, 244, 97, 245, 137, 224, 255, 250, 
-    244, 226, 194, 224, 255, 250, 244, 217, 32, 226, 194, 217, 32, 253, 180, 
-    226, 194, 253, 180, 223, 118, 213, 247, 248, 58, 215, 192, 253, 242, 232, 
-    117, 215, 254, 230, 139, 230, 116, 223, 161, 218, 6, 223, 161, 230, 116, 
-    251, 28, 254, 229, 215, 245, 220, 16, 222, 182, 219, 1, 203, 215, 252, 
-    232, 230, 67, 215, 252, 232, 230, 249, 190, 50, 224, 255, 250, 229, 223, 
-    44, 232, 230, 215, 222, 244, 74, 226, 197, 224, 238, 247, 123, 228, 75, 
-    245, 125, 50, 219, 72, 87, 228, 75, 219, 72, 87, 224, 122, 232, 193, 236, 
-    0, 235, 157, 225, 41, 87, 247, 146, 228, 52, 232, 193, 87, 224, 232, 212, 
-    41, 87, 228, 66, 212, 41, 87, 252, 2, 228, 75, 252, 1, 252, 0, 230, 116, 
-    252, 0, 225, 213, 228, 75, 225, 212, 250, 100, 249, 124, 231, 56, 87, 
-    211, 218, 87, 223, 59, 252, 187, 87, 216, 37, 212, 41, 249, 253, 219, 
-    234, 252, 118, 252, 116, 225, 242, 249, 177, 249, 86, 252, 169, 250, 22, 
-    43, 232, 90, 108, 16, 31, 224, 3, 108, 16, 31, 254, 192, 108, 16, 31, 
-    244, 96, 108, 16, 31, 245, 223, 108, 16, 31, 212, 40, 108, 16, 31, 254, 
-    43, 108, 16, 31, 254, 44, 223, 105, 108, 16, 31, 254, 44, 223, 104, 108, 
-    16, 31, 254, 44, 213, 143, 108, 16, 31, 254, 44, 213, 142, 108, 16, 31, 
+    139, 4, 61, 11, 139, 4, 253, 166, 11, 139, 4, 251, 74, 11, 139, 4, 249, 
+    68, 11, 139, 4, 76, 11, 139, 4, 245, 14, 11, 139, 4, 243, 209, 11, 139, 
+    4, 242, 67, 11, 139, 4, 74, 11, 139, 4, 235, 150, 11, 139, 4, 235, 29, 
+    11, 139, 4, 156, 11, 139, 4, 194, 11, 139, 4, 230, 30, 11, 139, 4, 78, 
+    11, 139, 4, 226, 109, 11, 139, 4, 224, 99, 11, 139, 4, 153, 11, 139, 4, 
+    222, 93, 11, 139, 4, 217, 153, 11, 139, 4, 69, 11, 139, 4, 214, 105, 11, 
+    139, 4, 212, 98, 11, 139, 4, 211, 178, 11, 139, 4, 211, 117, 11, 139, 4, 
+    210, 159, 11, 23, 133, 6, 61, 11, 23, 133, 6, 253, 166, 11, 23, 133, 6, 
+    251, 74, 11, 23, 133, 6, 249, 68, 11, 23, 133, 6, 76, 11, 23, 133, 6, 
+    245, 14, 11, 23, 133, 6, 243, 209, 11, 23, 133, 6, 242, 67, 11, 23, 133, 
+    6, 74, 11, 23, 133, 6, 235, 150, 11, 23, 133, 6, 235, 29, 11, 23, 133, 6, 
+    156, 11, 23, 133, 6, 194, 11, 23, 133, 6, 230, 30, 11, 23, 133, 6, 78, 
+    11, 23, 133, 6, 226, 109, 11, 23, 133, 6, 224, 99, 11, 23, 133, 6, 153, 
+    11, 23, 133, 6, 222, 93, 11, 23, 133, 6, 217, 153, 11, 23, 133, 6, 69, 
+    11, 23, 133, 6, 214, 105, 11, 23, 133, 6, 212, 98, 11, 23, 133, 6, 211, 
+    178, 11, 23, 133, 6, 211, 117, 11, 23, 133, 6, 210, 159, 11, 23, 133, 4, 
+    61, 11, 23, 133, 4, 253, 166, 11, 23, 133, 4, 251, 74, 11, 23, 133, 4, 
+    249, 68, 11, 23, 133, 4, 76, 11, 23, 133, 4, 245, 14, 11, 23, 133, 4, 
+    243, 209, 11, 23, 133, 4, 242, 67, 11, 23, 133, 4, 74, 11, 23, 133, 4, 
+    235, 150, 11, 23, 133, 4, 235, 29, 11, 23, 133, 4, 156, 11, 23, 133, 4, 
+    194, 11, 23, 133, 4, 230, 30, 11, 23, 133, 4, 78, 11, 23, 133, 4, 226, 
+    109, 11, 23, 133, 4, 224, 99, 11, 23, 133, 4, 153, 11, 23, 133, 4, 222, 
+    93, 11, 23, 133, 4, 217, 153, 11, 23, 133, 4, 69, 11, 23, 133, 4, 214, 
+    105, 11, 23, 133, 4, 212, 98, 11, 23, 133, 4, 211, 178, 11, 23, 133, 4, 
+    211, 117, 11, 23, 133, 4, 210, 159, 11, 35, 6, 61, 11, 35, 6, 253, 166, 
+    11, 35, 6, 251, 74, 11, 35, 6, 249, 68, 11, 35, 6, 76, 11, 35, 6, 245, 
+    14, 11, 35, 6, 243, 209, 11, 35, 6, 242, 67, 11, 35, 6, 74, 11, 35, 6, 
+    235, 150, 11, 35, 6, 235, 29, 11, 35, 6, 156, 11, 35, 6, 194, 11, 35, 6, 
+    230, 30, 11, 35, 6, 78, 11, 35, 6, 226, 109, 11, 35, 6, 224, 99, 11, 35, 
+    6, 153, 11, 35, 6, 222, 93, 11, 35, 6, 217, 153, 11, 35, 6, 69, 11, 35, 
+    6, 214, 105, 11, 35, 6, 212, 98, 11, 35, 6, 211, 178, 11, 35, 6, 211, 
+    117, 11, 35, 6, 210, 159, 11, 35, 4, 61, 11, 35, 4, 253, 166, 11, 35, 4, 
+    251, 74, 11, 35, 4, 249, 68, 11, 35, 4, 76, 11, 35, 4, 245, 14, 11, 35, 
+    4, 243, 209, 11, 35, 4, 242, 67, 11, 35, 4, 74, 11, 35, 4, 235, 150, 11, 
+    35, 4, 235, 29, 11, 35, 4, 156, 11, 35, 4, 194, 11, 35, 4, 230, 30, 11, 
+    35, 4, 78, 11, 35, 4, 226, 109, 11, 35, 4, 224, 99, 11, 35, 4, 153, 11, 
+    35, 4, 222, 93, 11, 35, 4, 217, 153, 11, 35, 4, 69, 11, 35, 4, 214, 105, 
+    11, 35, 4, 212, 98, 11, 35, 4, 211, 178, 11, 35, 4, 211, 117, 11, 35, 4, 
+    210, 159, 11, 35, 23, 6, 61, 11, 35, 23, 6, 253, 166, 11, 35, 23, 6, 251, 
+    74, 11, 35, 23, 6, 249, 68, 11, 35, 23, 6, 76, 11, 35, 23, 6, 245, 14, 
+    11, 35, 23, 6, 243, 209, 11, 35, 23, 6, 242, 67, 11, 35, 23, 6, 74, 11, 
+    35, 23, 6, 235, 150, 11, 35, 23, 6, 235, 29, 11, 35, 23, 6, 156, 11, 35, 
+    23, 6, 194, 11, 35, 23, 6, 230, 30, 11, 35, 23, 6, 78, 11, 35, 23, 6, 
+    226, 109, 11, 35, 23, 6, 224, 99, 11, 35, 23, 6, 153, 11, 35, 23, 6, 222, 
+    93, 11, 35, 23, 6, 217, 153, 11, 35, 23, 6, 69, 11, 35, 23, 6, 214, 105, 
+    11, 35, 23, 6, 212, 98, 11, 35, 23, 6, 211, 178, 11, 35, 23, 6, 211, 117, 
+    11, 35, 23, 6, 210, 159, 11, 35, 23, 4, 61, 11, 35, 23, 4, 253, 166, 11, 
+    35, 23, 4, 251, 74, 11, 35, 23, 4, 249, 68, 11, 35, 23, 4, 76, 11, 35, 
+    23, 4, 245, 14, 11, 35, 23, 4, 243, 209, 11, 35, 23, 4, 242, 67, 11, 35, 
+    23, 4, 74, 11, 35, 23, 4, 235, 150, 11, 35, 23, 4, 235, 29, 11, 35, 23, 
+    4, 156, 11, 35, 23, 4, 194, 11, 35, 23, 4, 230, 30, 11, 35, 23, 4, 78, 
+    11, 35, 23, 4, 226, 109, 11, 35, 23, 4, 224, 99, 11, 35, 23, 4, 153, 11, 
+    35, 23, 4, 222, 93, 11, 35, 23, 4, 217, 153, 11, 35, 23, 4, 69, 11, 35, 
+    23, 4, 214, 105, 11, 35, 23, 4, 212, 98, 11, 35, 23, 4, 211, 178, 11, 35, 
+    23, 4, 211, 117, 11, 35, 23, 4, 210, 159, 11, 35, 32, 6, 61, 11, 35, 32, 
+    6, 253, 166, 11, 35, 32, 6, 251, 74, 11, 35, 32, 6, 249, 68, 11, 35, 32, 
+    6, 76, 11, 35, 32, 6, 245, 14, 11, 35, 32, 6, 243, 209, 11, 35, 32, 6, 
+    242, 67, 11, 35, 32, 6, 74, 11, 35, 32, 6, 235, 150, 11, 35, 32, 6, 235, 
+    29, 11, 35, 32, 6, 156, 11, 35, 32, 6, 194, 11, 35, 32, 6, 230, 30, 11, 
+    35, 32, 6, 78, 11, 35, 32, 6, 226, 109, 11, 35, 32, 6, 224, 99, 11, 35, 
+    32, 6, 153, 11, 35, 32, 6, 222, 93, 11, 35, 32, 6, 217, 153, 11, 35, 32, 
+    6, 69, 11, 35, 32, 6, 214, 105, 11, 35, 32, 6, 212, 98, 11, 35, 32, 6, 
+    211, 178, 11, 35, 32, 6, 211, 117, 11, 35, 32, 6, 210, 159, 11, 35, 32, 
+    4, 61, 11, 35, 32, 4, 253, 166, 11, 35, 32, 4, 251, 74, 11, 35, 32, 4, 
+    249, 68, 11, 35, 32, 4, 76, 11, 35, 32, 4, 245, 14, 11, 35, 32, 4, 243, 
+    209, 11, 35, 32, 4, 242, 67, 11, 35, 32, 4, 74, 11, 35, 32, 4, 235, 150, 
+    11, 35, 32, 4, 235, 29, 11, 35, 32, 4, 156, 11, 35, 32, 4, 194, 11, 35, 
+    32, 4, 230, 30, 11, 35, 32, 4, 78, 11, 35, 32, 4, 226, 109, 11, 35, 32, 
+    4, 224, 99, 11, 35, 32, 4, 153, 11, 35, 32, 4, 222, 93, 11, 35, 32, 4, 
+    217, 153, 11, 35, 32, 4, 69, 11, 35, 32, 4, 214, 105, 11, 35, 32, 4, 212, 
+    98, 11, 35, 32, 4, 211, 178, 11, 35, 32, 4, 211, 117, 11, 35, 32, 4, 210, 
+    159, 11, 35, 23, 32, 6, 61, 11, 35, 23, 32, 6, 253, 166, 11, 35, 23, 32, 
+    6, 251, 74, 11, 35, 23, 32, 6, 249, 68, 11, 35, 23, 32, 6, 76, 11, 35, 
+    23, 32, 6, 245, 14, 11, 35, 23, 32, 6, 243, 209, 11, 35, 23, 32, 6, 242, 
+    67, 11, 35, 23, 32, 6, 74, 11, 35, 23, 32, 6, 235, 150, 11, 35, 23, 32, 
+    6, 235, 29, 11, 35, 23, 32, 6, 156, 11, 35, 23, 32, 6, 194, 11, 35, 23, 
+    32, 6, 230, 30, 11, 35, 23, 32, 6, 78, 11, 35, 23, 32, 6, 226, 109, 11, 
+    35, 23, 32, 6, 224, 99, 11, 35, 23, 32, 6, 153, 11, 35, 23, 32, 6, 222, 
+    93, 11, 35, 23, 32, 6, 217, 153, 11, 35, 23, 32, 6, 69, 11, 35, 23, 32, 
+    6, 214, 105, 11, 35, 23, 32, 6, 212, 98, 11, 35, 23, 32, 6, 211, 178, 11, 
+    35, 23, 32, 6, 211, 117, 11, 35, 23, 32, 6, 210, 159, 11, 35, 23, 32, 4, 
+    61, 11, 35, 23, 32, 4, 253, 166, 11, 35, 23, 32, 4, 251, 74, 11, 35, 23, 
+    32, 4, 249, 68, 11, 35, 23, 32, 4, 76, 11, 35, 23, 32, 4, 245, 14, 11, 
+    35, 23, 32, 4, 243, 209, 11, 35, 23, 32, 4, 242, 67, 11, 35, 23, 32, 4, 
+    74, 11, 35, 23, 32, 4, 235, 150, 11, 35, 23, 32, 4, 235, 29, 11, 35, 23, 
+    32, 4, 156, 11, 35, 23, 32, 4, 194, 11, 35, 23, 32, 4, 230, 30, 11, 35, 
+    23, 32, 4, 78, 11, 35, 23, 32, 4, 226, 109, 11, 35, 23, 32, 4, 224, 99, 
+    11, 35, 23, 32, 4, 153, 11, 35, 23, 32, 4, 222, 93, 11, 35, 23, 32, 4, 
+    217, 153, 11, 35, 23, 32, 4, 69, 11, 35, 23, 32, 4, 214, 105, 11, 35, 23, 
+    32, 4, 212, 98, 11, 35, 23, 32, 4, 211, 178, 11, 35, 23, 32, 4, 211, 117, 
+    11, 35, 23, 32, 4, 210, 159, 11, 230, 143, 6, 61, 11, 230, 143, 6, 253, 
+    166, 11, 230, 143, 6, 251, 74, 11, 230, 143, 6, 249, 68, 11, 230, 143, 6, 
+    76, 11, 230, 143, 6, 245, 14, 11, 230, 143, 6, 243, 209, 11, 230, 143, 6, 
+    242, 67, 11, 230, 143, 6, 74, 11, 230, 143, 6, 235, 150, 11, 230, 143, 6, 
+    235, 29, 11, 230, 143, 6, 156, 11, 230, 143, 6, 194, 11, 230, 143, 6, 
+    230, 30, 11, 230, 143, 6, 78, 11, 230, 143, 6, 226, 109, 11, 230, 143, 6, 
+    224, 99, 11, 230, 143, 6, 153, 11, 230, 143, 6, 222, 93, 11, 230, 143, 6, 
+    217, 153, 11, 230, 143, 6, 69, 11, 230, 143, 6, 214, 105, 11, 230, 143, 
+    6, 212, 98, 11, 230, 143, 6, 211, 178, 11, 230, 143, 6, 211, 117, 11, 
+    230, 143, 6, 210, 159, 11, 230, 143, 4, 61, 11, 230, 143, 4, 253, 166, 
+    11, 230, 143, 4, 251, 74, 11, 230, 143, 4, 249, 68, 11, 230, 143, 4, 76, 
+    11, 230, 143, 4, 245, 14, 11, 230, 143, 4, 243, 209, 11, 230, 143, 4, 
+    242, 67, 11, 230, 143, 4, 74, 11, 230, 143, 4, 235, 150, 11, 230, 143, 4, 
+    235, 29, 11, 230, 143, 4, 156, 11, 230, 143, 4, 194, 11, 230, 143, 4, 
+    230, 30, 11, 230, 143, 4, 78, 11, 230, 143, 4, 226, 109, 11, 230, 143, 4, 
+    224, 99, 11, 230, 143, 4, 153, 11, 230, 143, 4, 222, 93, 11, 230, 143, 4, 
+    217, 153, 11, 230, 143, 4, 69, 11, 230, 143, 4, 214, 105, 11, 230, 143, 
+    4, 212, 98, 11, 230, 143, 4, 211, 178, 11, 230, 143, 4, 211, 117, 11, 
+    230, 143, 4, 210, 159, 11, 32, 4, 247, 127, 74, 11, 32, 4, 247, 127, 235, 
+    150, 11, 23, 6, 254, 151, 11, 23, 6, 252, 34, 11, 23, 6, 243, 114, 11, 
+    23, 6, 248, 62, 11, 23, 6, 245, 108, 11, 23, 6, 210, 85, 11, 23, 6, 245, 
+    71, 11, 23, 6, 216, 180, 11, 23, 6, 235, 192, 11, 23, 6, 234, 228, 11, 
+    23, 6, 233, 104, 11, 23, 6, 230, 107, 11, 23, 6, 227, 242, 11, 23, 6, 
+    211, 157, 11, 23, 6, 226, 203, 11, 23, 6, 225, 111, 11, 23, 6, 223, 40, 
+    11, 23, 6, 216, 181, 87, 11, 23, 6, 219, 179, 11, 23, 6, 217, 42, 11, 23, 
+    6, 214, 157, 11, 23, 6, 225, 136, 11, 23, 6, 250, 118, 11, 23, 6, 224, 
+    164, 11, 23, 6, 226, 205, 11, 23, 229, 226, 11, 23, 4, 254, 151, 11, 23, 
+    4, 252, 34, 11, 23, 4, 243, 114, 11, 23, 4, 248, 62, 11, 23, 4, 245, 108, 
+    11, 23, 4, 210, 85, 11, 23, 4, 245, 71, 11, 23, 4, 216, 180, 11, 23, 4, 
+    235, 192, 11, 23, 4, 234, 228, 11, 23, 4, 233, 104, 11, 23, 4, 230, 107, 
+    11, 23, 4, 227, 242, 11, 23, 4, 211, 157, 11, 23, 4, 226, 203, 11, 23, 4, 
+    225, 111, 11, 23, 4, 223, 40, 11, 23, 4, 40, 219, 179, 11, 23, 4, 219, 
+    179, 11, 23, 4, 217, 42, 11, 23, 4, 214, 157, 11, 23, 4, 225, 136, 11, 
+    23, 4, 250, 118, 11, 23, 4, 224, 164, 11, 23, 4, 226, 205, 11, 23, 226, 
+    1, 247, 241, 11, 23, 245, 109, 87, 11, 23, 216, 181, 87, 11, 23, 234, 
+    229, 87, 11, 23, 225, 137, 87, 11, 23, 223, 41, 87, 11, 23, 225, 112, 87, 
+    11, 32, 6, 254, 151, 11, 32, 6, 252, 34, 11, 32, 6, 243, 114, 11, 32, 6, 
+    248, 62, 11, 32, 6, 245, 108, 11, 32, 6, 210, 85, 11, 32, 6, 245, 71, 11, 
+    32, 6, 216, 180, 11, 32, 6, 235, 192, 11, 32, 6, 234, 228, 11, 32, 6, 
+    233, 104, 11, 32, 6, 230, 107, 11, 32, 6, 227, 242, 11, 32, 6, 211, 157, 
+    11, 32, 6, 226, 203, 11, 32, 6, 225, 111, 11, 32, 6, 223, 40, 11, 32, 6, 
+    216, 181, 87, 11, 32, 6, 219, 179, 11, 32, 6, 217, 42, 11, 32, 6, 214, 
+    157, 11, 32, 6, 225, 136, 11, 32, 6, 250, 118, 11, 32, 6, 224, 164, 11, 
+    32, 6, 226, 205, 11, 32, 229, 226, 11, 32, 4, 254, 151, 11, 32, 4, 252, 
+    34, 11, 32, 4, 243, 114, 11, 32, 4, 248, 62, 11, 32, 4, 245, 108, 11, 32, 
+    4, 210, 85, 11, 32, 4, 245, 71, 11, 32, 4, 216, 180, 11, 32, 4, 235, 192, 
+    11, 32, 4, 234, 228, 11, 32, 4, 233, 104, 11, 32, 4, 230, 107, 11, 32, 4, 
+    227, 242, 11, 32, 4, 211, 157, 11, 32, 4, 226, 203, 11, 32, 4, 225, 111, 
+    11, 32, 4, 223, 40, 11, 32, 4, 40, 219, 179, 11, 32, 4, 219, 179, 11, 32, 
+    4, 217, 42, 11, 32, 4, 214, 157, 11, 32, 4, 225, 136, 11, 32, 4, 250, 
+    118, 11, 32, 4, 224, 164, 11, 32, 4, 226, 205, 11, 32, 226, 1, 247, 241, 
+    11, 32, 245, 109, 87, 11, 32, 216, 181, 87, 11, 32, 234, 229, 87, 11, 32, 
+    225, 137, 87, 11, 32, 223, 41, 87, 11, 32, 225, 112, 87, 11, 23, 32, 6, 
+    254, 151, 11, 23, 32, 6, 252, 34, 11, 23, 32, 6, 243, 114, 11, 23, 32, 6, 
+    248, 62, 11, 23, 32, 6, 245, 108, 11, 23, 32, 6, 210, 85, 11, 23, 32, 6, 
+    245, 71, 11, 23, 32, 6, 216, 180, 11, 23, 32, 6, 235, 192, 11, 23, 32, 6, 
+    234, 228, 11, 23, 32, 6, 233, 104, 11, 23, 32, 6, 230, 107, 11, 23, 32, 
+    6, 227, 242, 11, 23, 32, 6, 211, 157, 11, 23, 32, 6, 226, 203, 11, 23, 
+    32, 6, 225, 111, 11, 23, 32, 6, 223, 40, 11, 23, 32, 6, 216, 181, 87, 11, 
+    23, 32, 6, 219, 179, 11, 23, 32, 6, 217, 42, 11, 23, 32, 6, 214, 157, 11, 
+    23, 32, 6, 225, 136, 11, 23, 32, 6, 250, 118, 11, 23, 32, 6, 224, 164, 
+    11, 23, 32, 6, 226, 205, 11, 23, 32, 229, 226, 11, 23, 32, 4, 254, 151, 
+    11, 23, 32, 4, 252, 34, 11, 23, 32, 4, 243, 114, 11, 23, 32, 4, 248, 62, 
+    11, 23, 32, 4, 245, 108, 11, 23, 32, 4, 210, 85, 11, 23, 32, 4, 245, 71, 
+    11, 23, 32, 4, 216, 180, 11, 23, 32, 4, 235, 192, 11, 23, 32, 4, 234, 
+    228, 11, 23, 32, 4, 233, 104, 11, 23, 32, 4, 230, 107, 11, 23, 32, 4, 
+    227, 242, 11, 23, 32, 4, 211, 157, 11, 23, 32, 4, 226, 203, 11, 23, 32, 
+    4, 225, 111, 11, 23, 32, 4, 223, 40, 11, 23, 32, 4, 40, 219, 179, 11, 23, 
+    32, 4, 219, 179, 11, 23, 32, 4, 217, 42, 11, 23, 32, 4, 214, 157, 11, 23, 
+    32, 4, 225, 136, 11, 23, 32, 4, 250, 118, 11, 23, 32, 4, 224, 164, 11, 
+    23, 32, 4, 226, 205, 11, 23, 32, 226, 1, 247, 241, 11, 23, 32, 245, 109, 
+    87, 11, 23, 32, 216, 181, 87, 11, 23, 32, 234, 229, 87, 11, 23, 32, 225, 
+    137, 87, 11, 23, 32, 223, 41, 87, 11, 23, 32, 225, 112, 87, 11, 35, 23, 
+    6, 254, 151, 11, 35, 23, 6, 252, 34, 11, 35, 23, 6, 243, 114, 11, 35, 23, 
+    6, 248, 62, 11, 35, 23, 6, 245, 108, 11, 35, 23, 6, 210, 85, 11, 35, 23, 
+    6, 245, 71, 11, 35, 23, 6, 216, 180, 11, 35, 23, 6, 235, 192, 11, 35, 23, 
+    6, 234, 228, 11, 35, 23, 6, 233, 104, 11, 35, 23, 6, 230, 107, 11, 35, 
+    23, 6, 227, 242, 11, 35, 23, 6, 211, 157, 11, 35, 23, 6, 226, 203, 11, 
+    35, 23, 6, 225, 111, 11, 35, 23, 6, 223, 40, 11, 35, 23, 6, 216, 181, 87, 
+    11, 35, 23, 6, 219, 179, 11, 35, 23, 6, 217, 42, 11, 35, 23, 6, 214, 157, 
+    11, 35, 23, 6, 225, 136, 11, 35, 23, 6, 250, 118, 11, 35, 23, 6, 224, 
+    164, 11, 35, 23, 6, 226, 205, 11, 35, 23, 229, 226, 11, 35, 23, 4, 254, 
+    151, 11, 35, 23, 4, 252, 34, 11, 35, 23, 4, 243, 114, 11, 35, 23, 4, 248, 
+    62, 11, 35, 23, 4, 245, 108, 11, 35, 23, 4, 210, 85, 11, 35, 23, 4, 245, 
+    71, 11, 35, 23, 4, 216, 180, 11, 35, 23, 4, 235, 192, 11, 35, 23, 4, 234, 
+    228, 11, 35, 23, 4, 233, 104, 11, 35, 23, 4, 230, 107, 11, 35, 23, 4, 
+    227, 242, 11, 35, 23, 4, 211, 157, 11, 35, 23, 4, 226, 203, 11, 35, 23, 
+    4, 225, 111, 11, 35, 23, 4, 223, 40, 11, 35, 23, 4, 40, 219, 179, 11, 35, 
+    23, 4, 219, 179, 11, 35, 23, 4, 217, 42, 11, 35, 23, 4, 214, 157, 11, 35, 
+    23, 4, 225, 136, 11, 35, 23, 4, 250, 118, 11, 35, 23, 4, 224, 164, 11, 
+    35, 23, 4, 226, 205, 11, 35, 23, 226, 1, 247, 241, 11, 35, 23, 245, 109, 
+    87, 11, 35, 23, 216, 181, 87, 11, 35, 23, 234, 229, 87, 11, 35, 23, 225, 
+    137, 87, 11, 35, 23, 223, 41, 87, 11, 35, 23, 225, 112, 87, 11, 35, 23, 
+    32, 6, 254, 151, 11, 35, 23, 32, 6, 252, 34, 11, 35, 23, 32, 6, 243, 114, 
+    11, 35, 23, 32, 6, 248, 62, 11, 35, 23, 32, 6, 245, 108, 11, 35, 23, 32, 
+    6, 210, 85, 11, 35, 23, 32, 6, 245, 71, 11, 35, 23, 32, 6, 216, 180, 11, 
+    35, 23, 32, 6, 235, 192, 11, 35, 23, 32, 6, 234, 228, 11, 35, 23, 32, 6, 
+    233, 104, 11, 35, 23, 32, 6, 230, 107, 11, 35, 23, 32, 6, 227, 242, 11, 
+    35, 23, 32, 6, 211, 157, 11, 35, 23, 32, 6, 226, 203, 11, 35, 23, 32, 6, 
+    225, 111, 11, 35, 23, 32, 6, 223, 40, 11, 35, 23, 32, 6, 216, 181, 87, 
+    11, 35, 23, 32, 6, 219, 179, 11, 35, 23, 32, 6, 217, 42, 11, 35, 23, 32, 
+    6, 214, 157, 11, 35, 23, 32, 6, 225, 136, 11, 35, 23, 32, 6, 250, 118, 
+    11, 35, 23, 32, 6, 224, 164, 11, 35, 23, 32, 6, 226, 205, 11, 35, 23, 32, 
+    229, 226, 11, 35, 23, 32, 4, 254, 151, 11, 35, 23, 32, 4, 252, 34, 11, 
+    35, 23, 32, 4, 243, 114, 11, 35, 23, 32, 4, 248, 62, 11, 35, 23, 32, 4, 
+    245, 108, 11, 35, 23, 32, 4, 210, 85, 11, 35, 23, 32, 4, 245, 71, 11, 35, 
+    23, 32, 4, 216, 180, 11, 35, 23, 32, 4, 235, 192, 11, 35, 23, 32, 4, 234, 
+    228, 11, 35, 23, 32, 4, 233, 104, 11, 35, 23, 32, 4, 230, 107, 11, 35, 
+    23, 32, 4, 227, 242, 11, 35, 23, 32, 4, 211, 157, 11, 35, 23, 32, 4, 226, 
+    203, 11, 35, 23, 32, 4, 225, 111, 11, 35, 23, 32, 4, 223, 40, 11, 35, 23, 
+    32, 4, 40, 219, 179, 11, 35, 23, 32, 4, 219, 179, 11, 35, 23, 32, 4, 217, 
+    42, 11, 35, 23, 32, 4, 214, 157, 11, 35, 23, 32, 4, 225, 136, 11, 35, 23, 
+    32, 4, 250, 118, 11, 35, 23, 32, 4, 224, 164, 11, 35, 23, 32, 4, 226, 
+    205, 11, 35, 23, 32, 226, 1, 247, 241, 11, 35, 23, 32, 245, 109, 87, 11, 
+    35, 23, 32, 216, 181, 87, 11, 35, 23, 32, 234, 229, 87, 11, 35, 23, 32, 
+    225, 137, 87, 11, 35, 23, 32, 223, 41, 87, 11, 35, 23, 32, 225, 112, 87, 
+    11, 23, 6, 247, 235, 11, 23, 4, 247, 235, 11, 23, 21, 210, 86, 11, 23, 
+    21, 111, 11, 23, 21, 105, 11, 23, 21, 158, 11, 23, 21, 161, 11, 23, 21, 
+    190, 11, 23, 21, 195, 11, 23, 21, 199, 11, 23, 21, 196, 11, 23, 21, 201, 
+    11, 139, 21, 210, 86, 11, 139, 21, 111, 11, 139, 21, 105, 11, 139, 21, 
+    158, 11, 139, 21, 161, 11, 139, 21, 190, 11, 139, 21, 195, 11, 139, 21, 
+    199, 11, 139, 21, 196, 11, 139, 21, 201, 11, 35, 21, 210, 86, 11, 35, 21, 
+    111, 11, 35, 21, 105, 11, 35, 21, 158, 11, 35, 21, 161, 11, 35, 21, 190, 
+    11, 35, 21, 195, 11, 35, 21, 199, 11, 35, 21, 196, 11, 35, 21, 201, 11, 
+    35, 23, 21, 210, 86, 11, 35, 23, 21, 111, 11, 35, 23, 21, 105, 11, 35, 
+    23, 21, 158, 11, 35, 23, 21, 161, 11, 35, 23, 21, 190, 11, 35, 23, 21, 
+    195, 11, 35, 23, 21, 199, 11, 35, 23, 21, 196, 11, 35, 23, 21, 201, 11, 
+    230, 143, 21, 210, 86, 11, 230, 143, 21, 111, 11, 230, 143, 21, 105, 11, 
+    230, 143, 21, 158, 11, 230, 143, 21, 161, 11, 230, 143, 21, 190, 11, 230, 
+    143, 21, 195, 11, 230, 143, 21, 199, 11, 230, 143, 21, 196, 11, 230, 143, 
+    21, 201, 9, 11, 254, 179, 9, 11, 252, 62, 9, 11, 235, 129, 9, 11, 248, 
+    203, 9, 11, 212, 30, 9, 11, 210, 108, 9, 11, 242, 44, 9, 11, 217, 81, 9, 
+    11, 211, 43, 9, 11, 235, 0, 9, 11, 233, 108, 9, 11, 231, 83, 9, 11, 228, 
+    67, 9, 11, 221, 168, 9, 11, 254, 205, 9, 11, 244, 150, 9, 11, 222, 28, 9, 
+    11, 224, 84, 9, 11, 223, 98, 9, 11, 220, 61, 9, 11, 217, 8, 9, 11, 216, 
+    193, 9, 11, 234, 135, 9, 11, 216, 203, 9, 11, 248, 224, 9, 11, 210, 111, 
+    9, 11, 242, 251, 9, 11, 247, 127, 252, 62, 9, 11, 247, 127, 228, 67, 9, 
+    11, 247, 127, 244, 150, 9, 11, 247, 127, 224, 84, 9, 11, 65, 252, 62, 9, 
+    11, 65, 235, 129, 9, 11, 65, 241, 225, 9, 11, 65, 242, 44, 9, 11, 65, 
+    211, 43, 9, 11, 65, 235, 0, 9, 11, 65, 233, 108, 9, 11, 65, 231, 83, 9, 
+    11, 65, 228, 67, 9, 11, 65, 221, 168, 9, 11, 65, 254, 205, 9, 11, 65, 
+    244, 150, 9, 11, 65, 222, 28, 9, 11, 65, 224, 84, 9, 11, 65, 220, 61, 9, 
+    11, 65, 217, 8, 9, 11, 65, 216, 193, 9, 11, 65, 234, 135, 9, 11, 65, 248, 
+    224, 9, 11, 65, 242, 251, 9, 11, 217, 77, 235, 129, 9, 11, 217, 77, 242, 
+    44, 9, 11, 217, 77, 211, 43, 9, 11, 217, 77, 233, 108, 9, 11, 217, 77, 
+    228, 67, 9, 11, 217, 77, 221, 168, 9, 11, 217, 77, 254, 205, 9, 11, 217, 
+    77, 222, 28, 9, 11, 217, 77, 224, 84, 9, 11, 217, 77, 220, 61, 9, 11, 
+    217, 77, 234, 135, 9, 11, 217, 77, 248, 224, 9, 11, 217, 77, 242, 251, 9, 
+    11, 217, 77, 247, 127, 228, 67, 9, 11, 217, 77, 247, 127, 224, 84, 9, 11, 
+    218, 112, 252, 62, 9, 11, 218, 112, 235, 129, 9, 11, 218, 112, 241, 225, 
+    9, 11, 218, 112, 242, 44, 9, 11, 218, 112, 217, 81, 9, 11, 218, 112, 211, 
+    43, 9, 11, 218, 112, 235, 0, 9, 11, 218, 112, 231, 83, 9, 11, 218, 112, 
+    228, 67, 9, 11, 218, 112, 221, 168, 9, 11, 218, 112, 254, 205, 9, 11, 
+    218, 112, 244, 150, 9, 11, 218, 112, 222, 28, 9, 11, 218, 112, 224, 84, 
+    9, 11, 218, 112, 220, 61, 9, 11, 218, 112, 217, 8, 9, 11, 218, 112, 216, 
+    193, 9, 11, 218, 112, 234, 135, 9, 11, 218, 112, 248, 224, 9, 11, 218, 
+    112, 210, 111, 9, 11, 218, 112, 242, 251, 9, 11, 218, 112, 247, 127, 252, 
+    62, 9, 11, 218, 112, 247, 127, 244, 150, 9, 11, 232, 128, 254, 179, 9, 
+    11, 232, 128, 252, 62, 9, 11, 232, 128, 235, 129, 9, 11, 232, 128, 248, 
+    203, 9, 11, 232, 128, 241, 225, 9, 11, 232, 128, 212, 30, 9, 11, 232, 
+    128, 210, 108, 9, 11, 232, 128, 242, 44, 9, 11, 232, 128, 217, 81, 9, 11, 
+    232, 128, 211, 43, 9, 11, 232, 128, 233, 108, 9, 11, 232, 128, 231, 83, 
+    9, 11, 232, 128, 228, 67, 9, 11, 232, 128, 221, 168, 9, 11, 232, 128, 
+    254, 205, 9, 11, 232, 128, 244, 150, 9, 11, 232, 128, 222, 28, 9, 11, 
+    232, 128, 224, 84, 9, 11, 232, 128, 223, 98, 9, 11, 232, 128, 220, 61, 9, 
+    11, 232, 128, 217, 8, 9, 11, 232, 128, 216, 193, 9, 11, 232, 128, 234, 
+    135, 9, 11, 232, 128, 216, 203, 9, 11, 232, 128, 248, 224, 9, 11, 232, 
+    128, 210, 111, 9, 11, 232, 128, 242, 251, 9, 11, 139, 252, 62, 9, 11, 
+    139, 235, 129, 9, 11, 139, 248, 203, 9, 11, 139, 212, 30, 9, 11, 139, 
+    210, 108, 9, 11, 139, 242, 44, 9, 11, 139, 217, 81, 9, 11, 139, 211, 43, 
+    9, 11, 139, 233, 108, 9, 11, 139, 231, 83, 9, 11, 139, 228, 67, 9, 11, 
+    139, 221, 168, 9, 11, 139, 254, 205, 9, 11, 139, 244, 150, 9, 11, 139, 
+    222, 28, 9, 11, 139, 224, 84, 9, 11, 139, 223, 98, 9, 11, 139, 220, 61, 
+    9, 11, 139, 217, 8, 9, 11, 139, 216, 193, 9, 11, 139, 234, 135, 9, 11, 
+    139, 216, 203, 9, 11, 139, 248, 224, 9, 11, 139, 210, 111, 9, 11, 139, 
+    242, 251, 9, 11, 226, 172, 66, 2, 122, 2, 217, 44, 9, 11, 226, 172, 122, 
+    2, 248, 203, 231, 210, 86, 245, 228, 211, 239, 231, 210, 86, 219, 30, 
+    211, 239, 231, 210, 86, 212, 9, 211, 239, 231, 210, 86, 228, 61, 211, 
+    239, 231, 210, 86, 223, 114, 246, 104, 231, 210, 86, 242, 134, 246, 104, 
+    231, 210, 86, 71, 246, 104, 231, 210, 86, 123, 64, 250, 149, 231, 210, 
+    86, 113, 64, 250, 149, 231, 210, 86, 134, 64, 250, 149, 231, 210, 86, 
+    244, 19, 64, 250, 149, 231, 210, 86, 244, 89, 64, 250, 149, 231, 210, 86, 
+    219, 127, 64, 250, 149, 231, 210, 86, 220, 124, 64, 250, 149, 231, 210, 
+    86, 245, 201, 64, 250, 149, 231, 210, 86, 228, 205, 64, 250, 149, 231, 
+    210, 86, 123, 64, 252, 161, 231, 210, 86, 113, 64, 252, 161, 231, 210, 
+    86, 134, 64, 252, 161, 231, 210, 86, 244, 19, 64, 252, 161, 231, 210, 86, 
+    244, 89, 64, 252, 161, 231, 210, 86, 219, 127, 64, 252, 161, 231, 210, 
+    86, 220, 124, 64, 252, 161, 231, 210, 86, 245, 201, 64, 252, 161, 231, 
+    210, 86, 228, 205, 64, 252, 161, 231, 210, 86, 123, 64, 250, 42, 231, 
+    210, 86, 113, 64, 250, 42, 231, 210, 86, 134, 64, 250, 42, 231, 210, 86, 
+    244, 19, 64, 250, 42, 231, 210, 86, 244, 89, 64, 250, 42, 231, 210, 86, 
+    219, 127, 64, 250, 42, 231, 210, 86, 220, 124, 64, 250, 42, 231, 210, 86, 
+    245, 201, 64, 250, 42, 231, 210, 86, 228, 205, 64, 250, 42, 231, 210, 86, 
+    225, 28, 231, 210, 86, 226, 160, 231, 210, 86, 252, 162, 231, 210, 86, 
+    250, 78, 231, 210, 86, 218, 241, 231, 210, 86, 218, 40, 231, 210, 86, 
+    253, 187, 231, 210, 86, 211, 232, 231, 210, 86, 235, 68, 231, 210, 86, 
+    252, 192, 131, 86, 203, 252, 192, 131, 86, 241, 50, 131, 86, 241, 49, 
+    131, 86, 241, 48, 131, 86, 241, 47, 131, 86, 241, 46, 131, 86, 241, 45, 
+    131, 86, 241, 44, 131, 86, 241, 43, 131, 86, 241, 42, 131, 86, 241, 41, 
+    131, 86, 241, 40, 131, 86, 241, 39, 131, 86, 241, 38, 131, 86, 241, 37, 
+    131, 86, 241, 36, 131, 86, 241, 35, 131, 86, 241, 34, 131, 86, 241, 33, 
+    131, 86, 241, 32, 131, 86, 241, 31, 131, 86, 241, 30, 131, 86, 241, 29, 
+    131, 86, 241, 28, 131, 86, 241, 27, 131, 86, 241, 26, 131, 86, 241, 25, 
+    131, 86, 241, 24, 131, 86, 241, 23, 131, 86, 241, 22, 131, 86, 241, 21, 
+    131, 86, 241, 20, 131, 86, 241, 19, 131, 86, 241, 18, 131, 86, 241, 17, 
+    131, 86, 241, 16, 131, 86, 241, 15, 131, 86, 241, 14, 131, 86, 241, 13, 
+    131, 86, 241, 12, 131, 86, 241, 11, 131, 86, 241, 10, 131, 86, 241, 9, 
+    131, 86, 241, 8, 131, 86, 241, 7, 131, 86, 241, 6, 131, 86, 241, 5, 131, 
+    86, 241, 4, 131, 86, 241, 3, 131, 86, 241, 2, 131, 86, 67, 252, 192, 131, 
+    86, 213, 238, 131, 86, 213, 237, 131, 86, 213, 236, 131, 86, 213, 235, 
+    131, 86, 213, 234, 131, 86, 213, 233, 131, 86, 213, 232, 131, 86, 213, 
+    231, 131, 86, 213, 230, 131, 86, 213, 229, 131, 86, 213, 228, 131, 86, 
+    213, 227, 131, 86, 213, 226, 131, 86, 213, 225, 131, 86, 213, 224, 131, 
+    86, 213, 223, 131, 86, 213, 222, 131, 86, 213, 221, 131, 86, 213, 220, 
+    131, 86, 213, 219, 131, 86, 213, 218, 131, 86, 213, 217, 131, 86, 213, 
+    216, 131, 86, 213, 215, 131, 86, 213, 214, 131, 86, 213, 213, 131, 86, 
+    213, 212, 131, 86, 213, 211, 131, 86, 213, 210, 131, 86, 213, 209, 131, 
+    86, 213, 208, 131, 86, 213, 207, 131, 86, 213, 206, 131, 86, 213, 205, 
+    131, 86, 213, 204, 131, 86, 213, 203, 131, 86, 213, 202, 131, 86, 213, 
+    201, 131, 86, 213, 200, 131, 86, 213, 199, 131, 86, 213, 198, 131, 86, 
+    213, 197, 131, 86, 213, 196, 131, 86, 213, 195, 131, 86, 213, 194, 131, 
+    86, 213, 193, 131, 86, 213, 192, 131, 86, 213, 191, 131, 86, 213, 190, 
+    225, 36, 250, 251, 252, 192, 225, 36, 250, 251, 255, 18, 64, 219, 17, 
+    225, 36, 250, 251, 113, 64, 219, 17, 225, 36, 250, 251, 134, 64, 219, 17, 
+    225, 36, 250, 251, 244, 19, 64, 219, 17, 225, 36, 250, 251, 244, 89, 64, 
+    219, 17, 225, 36, 250, 251, 219, 127, 64, 219, 17, 225, 36, 250, 251, 
+    220, 124, 64, 219, 17, 225, 36, 250, 251, 245, 201, 64, 219, 17, 225, 36, 
+    250, 251, 228, 205, 64, 219, 17, 225, 36, 250, 251, 216, 249, 64, 219, 
+    17, 225, 36, 250, 251, 235, 145, 64, 219, 17, 225, 36, 250, 251, 234, 37, 
+    64, 219, 17, 225, 36, 250, 251, 224, 18, 64, 219, 17, 225, 36, 250, 251, 
+    234, 85, 64, 219, 17, 225, 36, 250, 251, 255, 18, 64, 241, 232, 225, 36, 
+    250, 251, 113, 64, 241, 232, 225, 36, 250, 251, 134, 64, 241, 232, 225, 
+    36, 250, 251, 244, 19, 64, 241, 232, 225, 36, 250, 251, 244, 89, 64, 241, 
+    232, 225, 36, 250, 251, 219, 127, 64, 241, 232, 225, 36, 250, 251, 220, 
+    124, 64, 241, 232, 225, 36, 250, 251, 245, 201, 64, 241, 232, 225, 36, 
+    250, 251, 228, 205, 64, 241, 232, 225, 36, 250, 251, 216, 249, 64, 241, 
+    232, 225, 36, 250, 251, 235, 145, 64, 241, 232, 225, 36, 250, 251, 234, 
+    37, 64, 241, 232, 225, 36, 250, 251, 224, 18, 64, 241, 232, 225, 36, 250, 
+    251, 234, 85, 64, 241, 232, 225, 36, 250, 251, 255, 18, 64, 247, 255, 
+    225, 36, 250, 251, 113, 64, 247, 255, 225, 36, 250, 251, 134, 64, 247, 
+    255, 225, 36, 250, 251, 244, 19, 64, 247, 255, 225, 36, 250, 251, 244, 
+    89, 64, 247, 255, 225, 36, 250, 251, 219, 127, 64, 247, 255, 225, 36, 
+    250, 251, 220, 124, 64, 247, 255, 225, 36, 250, 251, 245, 201, 64, 247, 
+    255, 225, 36, 250, 251, 228, 205, 64, 247, 255, 225, 36, 250, 251, 216, 
+    249, 64, 247, 255, 225, 36, 250, 251, 235, 145, 64, 247, 255, 225, 36, 
+    250, 251, 234, 37, 64, 247, 255, 225, 36, 250, 251, 224, 18, 64, 247, 
+    255, 225, 36, 250, 251, 234, 85, 64, 247, 255, 225, 36, 250, 251, 85, 
+    235, 68, 225, 36, 250, 251, 255, 18, 64, 249, 250, 225, 36, 250, 251, 
+    113, 64, 249, 250, 225, 36, 250, 251, 134, 64, 249, 250, 225, 36, 250, 
+    251, 244, 19, 64, 249, 250, 225, 36, 250, 251, 244, 89, 64, 249, 250, 
+    225, 36, 250, 251, 219, 127, 64, 249, 250, 225, 36, 250, 251, 220, 124, 
+    64, 249, 250, 225, 36, 250, 251, 245, 201, 64, 249, 250, 225, 36, 250, 
+    251, 228, 205, 64, 249, 250, 225, 36, 250, 251, 216, 249, 64, 249, 250, 
+    225, 36, 250, 251, 235, 145, 64, 249, 250, 225, 36, 250, 251, 234, 37, 
+    64, 249, 250, 225, 36, 250, 251, 224, 18, 64, 249, 250, 225, 36, 250, 
+    251, 234, 85, 64, 249, 250, 225, 36, 250, 251, 71, 235, 68, 21, 210, 87, 
+    243, 236, 218, 131, 21, 210, 87, 249, 227, 21, 123, 249, 227, 21, 113, 
+    249, 227, 21, 134, 249, 227, 21, 244, 19, 249, 227, 21, 244, 89, 249, 
+    227, 21, 219, 127, 249, 227, 21, 220, 124, 249, 227, 21, 245, 201, 249, 
+    227, 21, 228, 205, 249, 227, 88, 7, 6, 1, 61, 88, 7, 6, 1, 253, 166, 88, 
+    7, 6, 1, 251, 74, 88, 7, 6, 1, 249, 68, 88, 7, 6, 1, 76, 88, 7, 6, 1, 
+    245, 14, 88, 7, 6, 1, 243, 209, 88, 7, 6, 1, 242, 67, 88, 7, 6, 1, 74, 
+    88, 7, 6, 1, 235, 150, 88, 7, 6, 1, 235, 29, 88, 7, 6, 1, 156, 88, 7, 6, 
+    1, 194, 88, 7, 6, 1, 230, 30, 88, 7, 6, 1, 78, 88, 7, 6, 1, 226, 109, 88, 
+    7, 6, 1, 224, 99, 88, 7, 6, 1, 153, 88, 7, 6, 1, 222, 93, 88, 7, 6, 1, 
+    217, 153, 88, 7, 6, 1, 69, 88, 7, 6, 1, 214, 105, 88, 7, 6, 1, 212, 98, 
+    88, 7, 6, 1, 211, 178, 88, 7, 6, 1, 211, 117, 88, 7, 6, 1, 210, 159, 216, 
+    7, 220, 55, 251, 165, 7, 6, 1, 222, 93, 37, 32, 7, 6, 1, 251, 74, 37, 32, 
+    7, 6, 1, 153, 37, 250, 199, 37, 211, 180, 92, 7, 6, 1, 61, 92, 7, 6, 1, 
+    253, 166, 92, 7, 6, 1, 251, 74, 92, 7, 6, 1, 249, 68, 92, 7, 6, 1, 76, 
+    92, 7, 6, 1, 245, 14, 92, 7, 6, 1, 243, 209, 92, 7, 6, 1, 242, 67, 92, 7, 
+    6, 1, 74, 92, 7, 6, 1, 235, 150, 92, 7, 6, 1, 235, 29, 92, 7, 6, 1, 156, 
+    92, 7, 6, 1, 194, 92, 7, 6, 1, 230, 30, 92, 7, 6, 1, 78, 92, 7, 6, 1, 
+    226, 109, 92, 7, 6, 1, 224, 99, 92, 7, 6, 1, 153, 92, 7, 6, 1, 222, 93, 
+    92, 7, 6, 1, 217, 153, 92, 7, 6, 1, 69, 92, 7, 6, 1, 214, 105, 92, 7, 6, 
+    1, 212, 98, 92, 7, 6, 1, 211, 178, 92, 7, 6, 1, 211, 117, 92, 7, 6, 1, 
+    210, 159, 92, 240, 208, 92, 230, 54, 92, 221, 185, 92, 218, 228, 92, 224, 
+    221, 92, 212, 23, 152, 37, 7, 6, 1, 61, 152, 37, 7, 6, 1, 253, 166, 152, 
+    37, 7, 6, 1, 251, 74, 152, 37, 7, 6, 1, 249, 68, 152, 37, 7, 6, 1, 76, 
+    152, 37, 7, 6, 1, 245, 14, 152, 37, 7, 6, 1, 243, 209, 152, 37, 7, 6, 1, 
+    242, 67, 152, 37, 7, 6, 1, 74, 152, 37, 7, 6, 1, 235, 150, 152, 37, 7, 6, 
+    1, 235, 29, 152, 37, 7, 6, 1, 156, 152, 37, 7, 6, 1, 194, 152, 37, 7, 6, 
+    1, 230, 30, 152, 37, 7, 6, 1, 78, 152, 37, 7, 6, 1, 226, 109, 152, 37, 7, 
+    6, 1, 224, 99, 152, 37, 7, 6, 1, 153, 152, 37, 7, 6, 1, 222, 93, 152, 37, 
+    7, 6, 1, 217, 153, 152, 37, 7, 6, 1, 69, 152, 37, 7, 6, 1, 214, 105, 152, 
+    37, 7, 6, 1, 212, 98, 152, 37, 7, 6, 1, 211, 178, 152, 37, 7, 6, 1, 211, 
+    117, 152, 37, 7, 6, 1, 210, 159, 223, 160, 231, 102, 50, 223, 160, 231, 
+    99, 50, 152, 92, 7, 6, 1, 61, 152, 92, 7, 6, 1, 253, 166, 152, 92, 7, 6, 
+    1, 251, 74, 152, 92, 7, 6, 1, 249, 68, 152, 92, 7, 6, 1, 76, 152, 92, 7, 
+    6, 1, 245, 14, 152, 92, 7, 6, 1, 243, 209, 152, 92, 7, 6, 1, 242, 67, 
+    152, 92, 7, 6, 1, 74, 152, 92, 7, 6, 1, 235, 150, 152, 92, 7, 6, 1, 235, 
+    29, 152, 92, 7, 6, 1, 156, 152, 92, 7, 6, 1, 194, 152, 92, 7, 6, 1, 230, 
+    30, 152, 92, 7, 6, 1, 78, 152, 92, 7, 6, 1, 226, 109, 152, 92, 7, 6, 1, 
+    224, 99, 152, 92, 7, 6, 1, 153, 152, 92, 7, 6, 1, 222, 93, 152, 92, 7, 6, 
+    1, 217, 153, 152, 92, 7, 6, 1, 69, 152, 92, 7, 6, 1, 214, 105, 152, 92, 
+    7, 6, 1, 212, 98, 152, 92, 7, 6, 1, 211, 178, 152, 92, 7, 6, 1, 211, 117, 
+    152, 92, 7, 6, 1, 210, 159, 249, 136, 152, 92, 7, 6, 1, 226, 109, 152, 
+    92, 240, 120, 152, 92, 191, 152, 92, 206, 152, 92, 255, 34, 152, 92, 212, 
+    23, 42, 247, 172, 92, 250, 31, 92, 249, 178, 92, 244, 4, 92, 240, 112, 
+    92, 229, 91, 92, 229, 84, 92, 226, 218, 92, 219, 37, 92, 120, 2, 245, 39, 
+    79, 92, 213, 119, 223, 106, 235, 246, 16, 1, 61, 223, 106, 235, 246, 16, 
+    1, 253, 166, 223, 106, 235, 246, 16, 1, 251, 74, 223, 106, 235, 246, 16, 
+    1, 249, 68, 223, 106, 235, 246, 16, 1, 76, 223, 106, 235, 246, 16, 1, 
+    245, 14, 223, 106, 235, 246, 16, 1, 243, 209, 223, 106, 235, 246, 16, 1, 
+    242, 67, 223, 106, 235, 246, 16, 1, 74, 223, 106, 235, 246, 16, 1, 235, 
+    150, 223, 106, 235, 246, 16, 1, 235, 29, 223, 106, 235, 246, 16, 1, 156, 
+    223, 106, 235, 246, 16, 1, 194, 223, 106, 235, 246, 16, 1, 230, 30, 223, 
+    106, 235, 246, 16, 1, 78, 223, 106, 235, 246, 16, 1, 226, 109, 223, 106, 
+    235, 246, 16, 1, 224, 99, 223, 106, 235, 246, 16, 1, 153, 223, 106, 235, 
+    246, 16, 1, 222, 93, 223, 106, 235, 246, 16, 1, 217, 153, 223, 106, 235, 
+    246, 16, 1, 69, 223, 106, 235, 246, 16, 1, 214, 105, 223, 106, 235, 246, 
+    16, 1, 212, 98, 223, 106, 235, 246, 16, 1, 211, 178, 223, 106, 235, 246, 
+    16, 1, 211, 117, 223, 106, 235, 246, 16, 1, 210, 159, 42, 141, 241, 70, 
+    92, 56, 234, 24, 92, 56, 206, 92, 10, 214, 177, 238, 57, 92, 10, 214, 
+    177, 238, 61, 92, 10, 214, 177, 238, 69, 92, 56, 248, 98, 92, 10, 214, 
+    177, 238, 76, 92, 10, 214, 177, 238, 63, 92, 10, 214, 177, 238, 35, 92, 
+    10, 214, 177, 238, 62, 92, 10, 214, 177, 238, 75, 92, 10, 214, 177, 238, 
+    49, 92, 10, 214, 177, 238, 42, 92, 10, 214, 177, 238, 51, 92, 10, 214, 
+    177, 238, 72, 92, 10, 214, 177, 238, 58, 92, 10, 214, 177, 238, 74, 92, 
+    10, 214, 177, 238, 50, 92, 10, 214, 177, 238, 73, 92, 10, 214, 177, 238, 
+    36, 92, 10, 214, 177, 238, 41, 92, 10, 214, 177, 238, 34, 92, 10, 214, 
+    177, 238, 64, 92, 10, 214, 177, 238, 66, 92, 10, 214, 177, 238, 44, 92, 
+    10, 214, 177, 238, 55, 92, 10, 214, 177, 238, 53, 92, 10, 214, 177, 238, 
+    79, 92, 10, 214, 177, 238, 78, 92, 10, 214, 177, 238, 32, 92, 10, 214, 
+    177, 238, 59, 92, 10, 214, 177, 238, 77, 92, 10, 214, 177, 238, 68, 92, 
+    10, 214, 177, 238, 54, 92, 10, 214, 177, 238, 33, 92, 10, 214, 177, 238, 
+    56, 92, 10, 214, 177, 238, 38, 92, 10, 214, 177, 238, 37, 92, 10, 214, 
+    177, 238, 67, 92, 10, 214, 177, 238, 45, 92, 10, 214, 177, 238, 47, 92, 
+    10, 214, 177, 238, 48, 92, 10, 214, 177, 238, 40, 92, 10, 214, 177, 238, 
+    71, 92, 10, 214, 177, 238, 65, 216, 7, 220, 55, 251, 165, 10, 214, 177, 
+    238, 46, 216, 7, 220, 55, 251, 165, 10, 214, 177, 238, 78, 216, 7, 220, 
+    55, 251, 165, 10, 214, 177, 238, 76, 216, 7, 220, 55, 251, 165, 10, 214, 
+    177, 238, 60, 216, 7, 220, 55, 251, 165, 10, 214, 177, 238, 43, 216, 7, 
+    220, 55, 251, 165, 10, 214, 177, 238, 56, 216, 7, 220, 55, 251, 165, 10, 
+    214, 177, 238, 39, 216, 7, 220, 55, 251, 165, 10, 214, 177, 238, 70, 216, 
+    7, 220, 55, 251, 165, 10, 214, 177, 238, 52, 37, 154, 254, 254, 37, 154, 
+    255, 21, 249, 79, 244, 50, 250, 8, 214, 194, 228, 218, 2, 218, 155, 218, 
+    34, 115, 230, 119, 218, 33, 250, 34, 253, 215, 246, 62, 218, 32, 115, 
+    251, 126, 223, 161, 251, 148, 253, 215, 228, 217, 212, 41, 212, 35, 213, 
+    131, 230, 200, 212, 25, 245, 232, 242, 188, 245, 53, 245, 232, 242, 188, 
+    254, 136, 245, 232, 242, 188, 253, 233, 242, 188, 2, 231, 56, 166, 230, 
+    134, 87, 212, 27, 249, 145, 230, 134, 87, 244, 100, 224, 25, 230, 134, 
+    87, 212, 27, 242, 217, 230, 134, 87, 243, 236, 230, 134, 87, 212, 52, 
+    242, 217, 230, 134, 87, 233, 86, 224, 25, 230, 134, 87, 212, 52, 249, 
+    145, 230, 134, 87, 249, 145, 230, 133, 166, 230, 134, 2, 244, 198, 244, 
+    100, 224, 25, 230, 134, 2, 244, 198, 233, 86, 224, 25, 230, 134, 2, 244, 
+    198, 243, 236, 230, 134, 2, 244, 198, 218, 39, 2, 244, 198, 242, 186, 
+    218, 158, 220, 1, 218, 158, 250, 124, 221, 170, 245, 47, 215, 236, 248, 
+    92, 215, 236, 226, 63, 215, 236, 251, 35, 215, 110, 250, 126, 251, 218, 
+    222, 193, 241, 186, 218, 37, 251, 218, 245, 236, 64, 231, 199, 245, 236, 
+    64, 223, 34, 241, 211, 244, 19, 233, 60, 249, 254, 231, 175, 233, 59, 
+    244, 184, 233, 59, 233, 60, 244, 55, 236, 7, 211, 239, 230, 63, 216, 35, 
+    253, 199, 242, 150, 231, 72, 212, 39, 217, 58, 233, 32, 252, 157, 225, 
+    65, 223, 114, 254, 62, 242, 134, 254, 62, 225, 220, 225, 221, 250, 127, 
+    218, 116, 242, 30, 219, 92, 64, 225, 47, 231, 92, 226, 201, 251, 202, 
+    224, 232, 233, 42, 223, 35, 249, 150, 223, 35, 252, 167, 249, 181, 223, 
+    34, 249, 103, 22, 223, 34, 218, 143, 251, 175, 219, 16, 251, 159, 244, 3, 
+    243, 255, 222, 209, 217, 247, 224, 234, 248, 183, 226, 240, 218, 8, 244, 
+    0, 219, 232, 244, 99, 251, 29, 2, 217, 240, 248, 43, 219, 54, 240, 119, 
+    249, 149, 220, 72, 240, 118, 240, 119, 249, 149, 246, 116, 249, 180, 250, 
+    92, 130, 251, 6, 232, 147, 249, 96, 241, 62, 224, 236, 219, 242, 252, 44, 
+    251, 171, 224, 237, 64, 244, 41, 249, 179, 244, 32, 22, 234, 38, 217, 20, 
+    211, 230, 242, 20, 222, 14, 251, 185, 22, 249, 110, 211, 237, 242, 191, 
+    249, 243, 242, 191, 215, 194, 246, 98, 252, 70, 230, 98, 250, 15, 252, 
+    70, 230, 97, 252, 195, 251, 184, 223, 36, 211, 201, 224, 198, 251, 243, 
+    251, 28, 235, 144, 250, 85, 215, 236, 244, 170, 250, 84, 244, 102, 244, 
+    103, 219, 14, 252, 166, 225, 254, 224, 247, 249, 212, 252, 167, 217, 60, 
+    215, 236, 249, 136, 244, 75, 225, 66, 248, 89, 235, 137, 247, 139, 250, 
+    240, 218, 115, 211, 240, 250, 106, 230, 134, 213, 164, 250, 170, 221, 
+    201, 221, 226, 242, 155, 251, 3, 250, 241, 240, 252, 244, 138, 212, 0, 
+    222, 202, 249, 244, 244, 94, 225, 5, 22, 244, 98, 230, 232, 230, 113, 
+    251, 18, 250, 47, 241, 239, 253, 249, 226, 66, 216, 15, 242, 2, 250, 37, 
+    216, 243, 216, 114, 250, 28, 251, 210, 225, 180, 253, 248, 213, 172, 243, 
+    117, 247, 205, 241, 163, 219, 86, 231, 239, 251, 253, 243, 118, 247, 248, 
+    251, 174, 244, 60, 225, 36, 250, 249, 28, 228, 52, 230, 90, 28, 228, 47, 
+    221, 214, 242, 106, 28, 234, 143, 215, 191, 213, 154, 28, 221, 194, 222, 
+    126, 220, 13, 2, 221, 229, 216, 245, 223, 181, 22, 252, 167, 219, 107, 
+    22, 219, 107, 251, 195, 252, 131, 22, 241, 56, 250, 128, 244, 81, 219, 
+    65, 222, 127, 218, 13, 215, 195, 240, 253, 223, 182, 254, 137, 244, 39, 
+    222, 138, 244, 39, 217, 242, 240, 242, 251, 127, 240, 242, 2, 243, 101, 
+    226, 233, 251, 127, 235, 137, 224, 242, 226, 232, 245, 52, 224, 242, 226, 
+    232, 240, 251, 252, 153, 253, 189, 216, 253, 231, 239, 240, 247, 232, 
+    117, 240, 247, 249, 184, 218, 127, 221, 200, 248, 51, 218, 127, 244, 188, 
+    235, 155, 233, 95, 235, 137, 250, 234, 245, 52, 250, 234, 223, 144, 230, 
+    117, 226, 118, 212, 41, 251, 131, 249, 153, 216, 107, 233, 24, 223, 183, 
+    250, 232, 246, 104, 249, 143, 212, 3, 219, 72, 219, 70, 240, 252, 223, 
+    156, 242, 177, 220, 59, 230, 150, 222, 196, 250, 116, 247, 144, 225, 76, 
+    251, 211, 245, 177, 226, 242, 218, 254, 220, 54, 251, 130, 254, 100, 241, 
+    61, 233, 127, 252, 68, 244, 98, 215, 194, 244, 98, 251, 217, 215, 91, 
+    242, 0, 250, 117, 252, 195, 250, 117, 243, 250, 252, 195, 250, 117, 251, 
+    245, 225, 198, 234, 32, 224, 251, 246, 95, 251, 19, 252, 185, 251, 19, 
+    247, 138, 230, 118, 244, 198, 249, 154, 244, 198, 216, 108, 244, 198, 
+    223, 184, 244, 198, 250, 233, 244, 198, 246, 105, 244, 198, 218, 243, 
+    212, 3, 240, 253, 244, 198, 230, 151, 244, 198, 247, 145, 244, 198, 225, 
+    77, 244, 198, 243, 253, 244, 198, 242, 27, 244, 198, 211, 224, 244, 198, 
+    252, 79, 244, 198, 226, 49, 244, 198, 225, 77, 228, 58, 225, 236, 224, 
+    189, 245, 21, 245, 235, 228, 58, 230, 115, 216, 20, 71, 120, 225, 10, 
+    252, 190, 235, 249, 71, 124, 225, 10, 252, 190, 235, 249, 71, 43, 225, 
+    10, 252, 190, 235, 249, 71, 44, 225, 10, 252, 190, 235, 249, 244, 92, 
+    242, 23, 50, 212, 33, 242, 23, 50, 226, 219, 242, 23, 50, 216, 136, 120, 
+    50, 216, 136, 124, 50, 250, 27, 242, 18, 50, 204, 242, 18, 50, 249, 131, 
+    211, 220, 242, 2, 245, 22, 229, 109, 217, 152, 235, 131, 246, 100, 234, 
+    88, 251, 255, 211, 220, 250, 1, 224, 130, 242, 21, 224, 233, 231, 182, 
+    220, 6, 253, 211, 220, 6, 241, 171, 220, 6, 211, 220, 221, 242, 211, 220, 
+    251, 194, 244, 37, 251, 98, 236, 7, 219, 171, 251, 97, 236, 7, 219, 171, 
+    251, 170, 242, 201, 231, 190, 211, 221, 244, 182, 231, 191, 22, 211, 222, 
+    241, 67, 242, 17, 113, 231, 64, 241, 67, 242, 17, 113, 211, 219, 241, 67, 
+    242, 17, 225, 2, 226, 231, 211, 222, 2, 251, 114, 245, 233, 251, 149, 2, 
+    213, 246, 225, 171, 2, 251, 220, 242, 41, 231, 191, 2, 242, 117, 225, 
+    112, 231, 179, 231, 191, 2, 215, 98, 226, 212, 231, 190, 226, 212, 211, 
+    221, 252, 194, 249, 198, 211, 205, 224, 192, 235, 137, 226, 227, 235, 
+    137, 242, 176, 242, 229, 252, 195, 254, 121, 245, 26, 254, 169, 254, 170, 
+    230, 141, 236, 12, 219, 102, 235, 239, 248, 42, 225, 170, 242, 112, 248, 
+    187, 232, 207, 229, 216, 225, 1, 244, 199, 231, 147, 242, 40, 252, 146, 
+    225, 4, 217, 172, 225, 69, 234, 70, 79, 232, 117, 233, 16, 222, 236, 243, 
+    61, 218, 133, 234, 69, 251, 179, 249, 156, 2, 241, 234, 212, 19, 252, 77, 
+    241, 234, 251, 143, 241, 234, 113, 241, 232, 219, 12, 241, 234, 242, 127, 
+    241, 234, 241, 235, 2, 75, 251, 216, 241, 234, 242, 134, 241, 234, 211, 
+    42, 241, 234, 224, 131, 241, 234, 241, 235, 2, 223, 36, 223, 47, 241, 
+    232, 241, 235, 248, 89, 248, 1, 220, 84, 2, 116, 59, 235, 222, 245, 180, 
+    193, 251, 124, 254, 120, 87, 251, 203, 219, 94, 87, 249, 236, 87, 218, 
+    248, 217, 249, 87, 246, 93, 248, 165, 87, 225, 70, 64, 224, 252, 244, 69, 
+    252, 11, 247, 173, 87, 219, 5, 252, 166, 216, 150, 252, 166, 71, 244, 59, 
+    240, 218, 225, 8, 87, 230, 154, 252, 180, 249, 106, 245, 40, 114, 247, 
+    140, 50, 249, 147, 250, 250, 252, 152, 2, 211, 40, 50, 252, 152, 2, 247, 
+    140, 50, 252, 152, 2, 245, 55, 50, 252, 152, 2, 224, 231, 50, 230, 154, 
+    2, 211, 235, 250, 146, 2, 214, 153, 215, 232, 22, 211, 40, 50, 221, 180, 
+    225, 169, 249, 216, 251, 147, 230, 191, 244, 64, 247, 193, 226, 165, 247, 
+    198, 246, 57, 244, 115, 244, 48, 204, 244, 115, 244, 48, 226, 80, 2, 249, 
+    108, 226, 80, 244, 191, 214, 163, 251, 24, 217, 19, 251, 24, 250, 251, 
+    235, 249, 250, 146, 2, 214, 153, 215, 231, 250, 146, 2, 246, 112, 215, 
+    231, 252, 149, 250, 145, 250, 14, 224, 126, 222, 187, 224, 126, 226, 23, 
+    218, 123, 222, 133, 215, 223, 222, 133, 251, 199, 217, 92, 233, 57, 228, 
+    50, 228, 51, 2, 248, 88, 249, 155, 250, 8, 251, 200, 204, 251, 200, 242, 
+    134, 251, 200, 251, 216, 251, 200, 226, 161, 251, 200, 251, 197, 229, 
+    210, 252, 183, 221, 188, 231, 65, 217, 2, 223, 126, 226, 78, 244, 167, 
+    231, 239, 221, 225, 254, 97, 224, 148, 255, 5, 232, 119, 250, 135, 231, 
+    77, 226, 133, 215, 239, 236, 3, 215, 239, 226, 86, 246, 32, 87, 236, 0, 
+    245, 127, 245, 128, 2, 246, 112, 80, 48, 250, 8, 231, 205, 2, 232, 113, 
+    244, 81, 250, 8, 231, 205, 2, 223, 160, 244, 81, 204, 231, 205, 2, 223, 
+    160, 244, 81, 204, 231, 205, 2, 232, 113, 244, 81, 224, 239, 224, 240, 
+    240, 255, 229, 89, 230, 164, 225, 120, 230, 164, 225, 121, 2, 97, 80, 
+    253, 215, 233, 52, 213, 175, 230, 163, 230, 164, 225, 121, 226, 234, 228, 
+    80, 230, 164, 225, 119, 254, 98, 2, 252, 137, 251, 18, 213, 172, 251, 18, 
+    216, 255, 223, 176, 213, 171, 215, 60, 97, 253, 255, 250, 10, 97, 22, 
+    140, 204, 250, 44, 253, 255, 250, 10, 97, 22, 140, 204, 250, 44, 254, 0, 
+    2, 37, 123, 226, 124, 250, 10, 246, 112, 22, 214, 153, 204, 250, 44, 253, 
+    255, 254, 96, 246, 112, 22, 214, 153, 204, 250, 44, 253, 255, 121, 251, 
+    146, 87, 125, 251, 146, 87, 219, 9, 2, 251, 12, 91, 219, 8, 219, 9, 2, 
+    123, 219, 33, 212, 35, 219, 9, 2, 134, 219, 33, 212, 34, 252, 123, 245, 
+    180, 225, 30, 233, 48, 231, 216, 242, 191, 222, 250, 231, 216, 242, 191, 
+    232, 158, 2, 235, 232, 225, 202, 250, 8, 232, 158, 2, 234, 144, 234, 144, 
+    232, 157, 204, 232, 157, 252, 52, 252, 53, 2, 251, 12, 91, 251, 198, 232, 
+    210, 87, 223, 177, 251, 94, 252, 193, 2, 140, 80, 48, 245, 151, 2, 140, 
+    80, 48, 226, 201, 2, 245, 39, 164, 2, 43, 44, 80, 48, 219, 41, 2, 97, 80, 
+    48, 216, 15, 2, 214, 153, 80, 48, 228, 80, 123, 214, 184, 245, 199, 87, 
+    234, 142, 216, 248, 235, 226, 16, 31, 7, 6, 233, 15, 235, 226, 16, 31, 7, 
+    4, 233, 15, 235, 226, 16, 31, 227, 203, 235, 226, 16, 31, 217, 184, 235, 
+    226, 16, 31, 7, 233, 15, 244, 104, 245, 180, 216, 10, 211, 199, 242, 28, 
+    227, 186, 22, 251, 205, 241, 73, 225, 53, 230, 231, 217, 0, 249, 122, 
+    252, 167, 219, 127, 225, 12, 218, 159, 2, 230, 229, 247, 128, 235, 137, 
+    16, 31, 252, 65, 215, 221, 245, 164, 85, 42, 251, 94, 71, 42, 251, 94, 
+    233, 91, 223, 114, 250, 43, 233, 91, 251, 216, 250, 43, 233, 91, 226, 
+    161, 248, 0, 233, 91, 251, 216, 248, 0, 4, 226, 161, 248, 0, 4, 251, 216, 
+    248, 0, 214, 162, 223, 114, 215, 226, 246, 113, 223, 114, 215, 226, 214, 
+    162, 4, 223, 114, 215, 226, 246, 113, 4, 223, 114, 215, 226, 37, 249, 
+    139, 224, 255, 249, 139, 225, 0, 2, 242, 33, 51, 249, 139, 224, 255, 228, 
+    54, 43, 220, 155, 2, 134, 247, 126, 250, 12, 244, 199, 123, 226, 246, 
+    250, 12, 244, 199, 113, 226, 246, 250, 12, 244, 199, 134, 226, 246, 250, 
+    12, 244, 199, 244, 19, 226, 246, 250, 12, 244, 199, 244, 89, 226, 246, 
+    250, 12, 244, 199, 219, 127, 226, 246, 250, 12, 244, 199, 220, 124, 226, 
+    246, 250, 12, 244, 199, 245, 201, 226, 246, 250, 12, 244, 199, 228, 205, 
+    226, 246, 250, 12, 244, 199, 216, 249, 226, 246, 250, 12, 244, 199, 245, 
+    176, 226, 246, 250, 12, 244, 199, 215, 77, 226, 246, 250, 12, 244, 199, 
+    226, 196, 250, 12, 244, 199, 215, 56, 250, 12, 244, 199, 216, 141, 250, 
+    12, 244, 199, 244, 15, 250, 12, 244, 199, 244, 87, 250, 12, 244, 199, 
+    219, 123, 250, 12, 244, 199, 220, 123, 250, 12, 244, 199, 245, 200, 250, 
+    12, 244, 199, 228, 204, 250, 12, 244, 199, 216, 247, 250, 12, 244, 199, 
+    245, 174, 250, 12, 244, 199, 215, 75, 230, 122, 243, 237, 216, 37, 216, 
+    3, 218, 150, 64, 232, 245, 219, 172, 64, 235, 138, 230, 111, 242, 131, 
+    244, 198, 242, 131, 244, 199, 2, 219, 76, 245, 21, 244, 199, 2, 217, 15, 
+    64, 235, 59, 219, 76, 244, 199, 2, 204, 230, 115, 219, 76, 244, 199, 2, 
+    204, 230, 116, 22, 219, 76, 245, 21, 219, 76, 244, 199, 2, 204, 230, 116, 
+    22, 249, 238, 217, 248, 219, 76, 244, 199, 2, 204, 230, 116, 22, 216, 
+    105, 245, 21, 219, 76, 244, 199, 2, 242, 32, 219, 76, 244, 199, 2, 240, 
+    254, 211, 233, 244, 198, 219, 76, 244, 199, 2, 219, 76, 245, 21, 244, 
+    199, 221, 219, 248, 70, 244, 41, 223, 91, 244, 198, 219, 76, 244, 199, 2, 
+    241, 233, 245, 21, 219, 76, 244, 199, 2, 218, 35, 219, 75, 244, 198, 229, 
+    92, 244, 198, 245, 31, 244, 198, 214, 188, 244, 198, 244, 199, 2, 249, 
+    238, 217, 248, 225, 195, 244, 198, 249, 209, 244, 198, 249, 210, 244, 
+    198, 234, 68, 244, 198, 244, 199, 216, 138, 116, 234, 69, 234, 68, 244, 
+    199, 2, 219, 76, 245, 21, 234, 68, 244, 199, 2, 250, 8, 245, 21, 244, 
+    199, 2, 218, 89, 216, 20, 244, 199, 2, 218, 89, 216, 21, 22, 211, 233, 
+    245, 23, 244, 199, 2, 218, 89, 216, 21, 22, 216, 105, 245, 21, 247, 200, 
+    244, 198, 211, 204, 244, 198, 254, 116, 244, 198, 224, 230, 244, 198, 
+    249, 124, 244, 198, 225, 173, 244, 198, 244, 199, 2, 232, 132, 64, 215, 
+    205, 247, 200, 251, 96, 223, 91, 244, 198, 243, 247, 244, 199, 2, 204, 
+    230, 115, 254, 114, 244, 198, 244, 160, 244, 198, 212, 20, 244, 198, 219, 
+    93, 244, 198, 216, 72, 244, 198, 242, 132, 244, 198, 232, 120, 249, 124, 
+    244, 198, 244, 199, 2, 204, 230, 115, 240, 210, 244, 198, 244, 199, 2, 
+    204, 230, 116, 22, 249, 238, 217, 248, 244, 199, 221, 192, 236, 7, 244, 
+    161, 253, 221, 244, 198, 244, 57, 244, 198, 219, 94, 244, 198, 247, 173, 
+    244, 198, 244, 199, 211, 230, 230, 115, 244, 199, 2, 231, 89, 231, 149, 
+    242, 131, 250, 233, 244, 199, 2, 219, 76, 245, 21, 250, 233, 244, 199, 2, 
+    217, 15, 64, 235, 59, 219, 76, 250, 233, 244, 199, 2, 204, 230, 115, 219, 
+    76, 250, 233, 244, 199, 2, 241, 233, 245, 21, 250, 233, 244, 199, 2, 211, 
+    196, 219, 77, 234, 68, 250, 233, 244, 199, 2, 250, 8, 245, 21, 224, 230, 
+    250, 233, 244, 198, 249, 124, 250, 233, 244, 198, 212, 20, 250, 233, 244, 
+    198, 244, 199, 2, 228, 80, 242, 170, 243, 41, 244, 199, 2, 226, 219, 243, 
+    41, 225, 171, 251, 176, 248, 83, 221, 171, 230, 150, 241, 236, 230, 150, 
+    219, 10, 230, 150, 242, 12, 225, 171, 223, 159, 123, 242, 22, 225, 171, 
+    223, 159, 251, 186, 242, 18, 236, 7, 250, 187, 225, 171, 243, 246, 225, 
+    171, 2, 224, 230, 244, 198, 225, 171, 2, 244, 49, 242, 17, 222, 205, 241, 
+    221, 218, 145, 232, 155, 223, 165, 250, 252, 241, 169, 215, 249, 241, 
+    169, 215, 250, 2, 251, 122, 228, 58, 215, 249, 231, 37, 193, 223, 166, 
+    218, 151, 215, 247, 215, 248, 250, 252, 251, 100, 226, 198, 251, 100, 
+    215, 202, 251, 101, 218, 131, 230, 192, 254, 138, 244, 105, 245, 145, 
+    225, 2, 250, 252, 226, 198, 225, 2, 250, 252, 217, 33, 226, 198, 217, 33, 
+    253, 188, 226, 198, 253, 188, 223, 121, 213, 247, 248, 66, 215, 193, 253, 
+    250, 232, 123, 215, 255, 230, 144, 230, 121, 223, 164, 218, 7, 223, 164, 
+    230, 121, 251, 36, 254, 238, 215, 246, 220, 18, 222, 184, 219, 3, 203, 
+    215, 253, 232, 236, 67, 215, 253, 232, 236, 249, 198, 50, 225, 2, 250, 
+    237, 223, 47, 232, 236, 215, 223, 244, 82, 226, 201, 224, 241, 247, 131, 
+    228, 80, 245, 133, 50, 219, 74, 87, 228, 80, 219, 74, 87, 224, 125, 232, 
+    199, 236, 7, 235, 163, 225, 44, 87, 247, 154, 228, 57, 232, 199, 87, 224, 
+    235, 212, 41, 87, 228, 71, 212, 41, 87, 252, 10, 228, 80, 252, 9, 252, 8, 
+    230, 121, 252, 8, 225, 216, 228, 80, 225, 215, 250, 108, 249, 132, 231, 
+    61, 87, 211, 218, 87, 223, 62, 252, 195, 87, 216, 38, 212, 41, 250, 5, 
+    219, 236, 252, 126, 252, 124, 225, 246, 249, 185, 249, 94, 252, 177, 250, 
+    30, 43, 232, 95, 108, 16, 31, 224, 6, 108, 16, 31, 254, 201, 108, 16, 31, 
+    244, 104, 108, 16, 31, 245, 231, 108, 16, 31, 212, 40, 108, 16, 31, 254, 
+    51, 108, 16, 31, 254, 52, 223, 108, 108, 16, 31, 254, 52, 223, 107, 108, 
+    16, 31, 254, 52, 213, 143, 108, 16, 31, 254, 52, 213, 142, 108, 16, 31, 
     213, 157, 108, 16, 31, 213, 156, 108, 16, 31, 213, 155, 108, 16, 31, 218, 
-    44, 108, 16, 31, 225, 125, 218, 44, 108, 16, 31, 85, 218, 44, 108, 16, 
-    31, 231, 55, 218, 71, 108, 16, 31, 231, 55, 218, 70, 108, 16, 31, 231, 
-    55, 218, 69, 108, 16, 31, 250, 38, 108, 16, 31, 222, 1, 108, 16, 31, 228, 
-    188, 108, 16, 31, 213, 141, 108, 16, 31, 213, 140, 108, 16, 31, 222, 204, 
-    222, 1, 108, 16, 31, 222, 204, 222, 0, 108, 16, 31, 242, 166, 108, 16, 
-    31, 219, 166, 108, 16, 31, 235, 177, 226, 153, 108, 16, 31, 235, 177, 
-    226, 152, 108, 16, 31, 249, 134, 64, 235, 176, 108, 16, 31, 223, 101, 64, 
-    235, 176, 108, 16, 31, 249, 168, 226, 153, 108, 16, 31, 235, 175, 226, 
-    153, 108, 16, 31, 218, 72, 64, 249, 167, 108, 16, 31, 249, 134, 64, 249, 
-    167, 108, 16, 31, 249, 134, 64, 249, 166, 108, 16, 31, 249, 168, 254, 83, 
-    108, 16, 31, 222, 2, 64, 249, 168, 254, 83, 108, 16, 31, 218, 72, 64, 
-    222, 2, 64, 249, 167, 108, 16, 31, 213, 243, 108, 16, 31, 216, 84, 226, 
-    153, 108, 16, 31, 233, 57, 226, 153, 108, 16, 31, 254, 82, 226, 153, 108, 
-    16, 31, 218, 72, 64, 254, 81, 108, 16, 31, 222, 2, 64, 254, 81, 108, 16, 
-    31, 218, 72, 64, 222, 2, 64, 254, 81, 108, 16, 31, 213, 158, 64, 254, 81, 
-    108, 16, 31, 223, 101, 64, 254, 81, 108, 16, 31, 223, 101, 64, 254, 80, 
-    108, 16, 31, 223, 100, 108, 16, 31, 223, 99, 108, 16, 31, 223, 98, 108, 
-    16, 31, 223, 97, 108, 16, 31, 254, 157, 108, 16, 31, 254, 156, 108, 16, 
-    31, 231, 163, 108, 16, 31, 222, 7, 108, 16, 31, 253, 246, 108, 16, 31, 
-    223, 125, 108, 16, 31, 223, 124, 108, 16, 31, 253, 183, 108, 16, 31, 251, 
-    229, 226, 153, 108, 16, 31, 217, 49, 108, 16, 31, 217, 48, 108, 16, 31, 
-    224, 8, 232, 222, 108, 16, 31, 251, 183, 108, 16, 31, 251, 182, 108, 16, 
-    31, 251, 181, 108, 16, 31, 254, 138, 108, 16, 31, 226, 218, 108, 16, 31, 
-    218, 248, 108, 16, 31, 216, 82, 108, 16, 31, 242, 96, 108, 16, 31, 212, 
-    28, 108, 16, 31, 224, 226, 108, 16, 31, 251, 14, 108, 16, 31, 215, 86, 
-    108, 16, 31, 250, 246, 230, 122, 108, 16, 31, 221, 202, 64, 235, 55, 108, 
-    16, 31, 251, 25, 108, 16, 31, 215, 219, 108, 16, 31, 218, 154, 215, 219, 
-    108, 16, 31, 232, 148, 108, 16, 31, 219, 56, 108, 16, 31, 214, 142, 108, 
-    16, 31, 240, 246, 246, 64, 108, 16, 31, 253, 227, 108, 16, 31, 224, 234, 
-    253, 227, 108, 16, 31, 251, 142, 108, 16, 31, 224, 225, 251, 142, 108, 
-    16, 31, 254, 135, 108, 16, 31, 218, 117, 218, 26, 218, 116, 108, 16, 31, 
-    218, 117, 218, 26, 218, 115, 108, 16, 31, 218, 68, 108, 16, 31, 224, 200, 
-    108, 16, 31, 247, 181, 108, 16, 31, 247, 183, 108, 16, 31, 247, 182, 108, 
-    16, 31, 224, 131, 108, 16, 31, 224, 120, 108, 16, 31, 249, 122, 108, 16, 
-    31, 249, 121, 108, 16, 31, 249, 120, 108, 16, 31, 249, 119, 108, 16, 31, 
-    249, 118, 108, 16, 31, 254, 169, 108, 16, 31, 252, 119, 64, 231, 149, 
-    108, 16, 31, 252, 119, 64, 214, 17, 108, 16, 31, 223, 57, 108, 16, 31, 
-    240, 238, 108, 16, 31, 228, 212, 108, 16, 31, 248, 145, 108, 16, 31, 230, 
-    134, 108, 16, 31, 163, 246, 94, 108, 16, 31, 163, 226, 132, 9, 14, 240, 
-    102, 9, 14, 240, 101, 9, 14, 240, 100, 9, 14, 240, 99, 9, 14, 240, 98, 9, 
-    14, 240, 97, 9, 14, 240, 96, 9, 14, 240, 95, 9, 14, 240, 94, 9, 14, 240, 
-    93, 9, 14, 240, 92, 9, 14, 240, 91, 9, 14, 240, 90, 9, 14, 240, 89, 9, 
-    14, 240, 88, 9, 14, 240, 87, 9, 14, 240, 86, 9, 14, 240, 85, 9, 14, 240, 
-    84, 9, 14, 240, 83, 9, 14, 240, 82, 9, 14, 240, 81, 9, 14, 240, 80, 9, 
-    14, 240, 79, 9, 14, 240, 78, 9, 14, 240, 77, 9, 14, 240, 76, 9, 14, 240, 
-    75, 9, 14, 240, 74, 9, 14, 240, 73, 9, 14, 240, 72, 9, 14, 240, 71, 9, 
-    14, 240, 70, 9, 14, 240, 69, 9, 14, 240, 68, 9, 14, 240, 67, 9, 14, 240, 
-    66, 9, 14, 240, 65, 9, 14, 240, 64, 9, 14, 240, 63, 9, 14, 240, 62, 9, 
-    14, 240, 61, 9, 14, 240, 60, 9, 14, 240, 59, 9, 14, 240, 58, 9, 14, 240, 
-    57, 9, 14, 240, 56, 9, 14, 240, 55, 9, 14, 240, 54, 9, 14, 240, 53, 9, 
-    14, 240, 52, 9, 14, 240, 51, 9, 14, 240, 50, 9, 14, 240, 49, 9, 14, 240, 
-    48, 9, 14, 240, 47, 9, 14, 240, 46, 9, 14, 240, 45, 9, 14, 240, 44, 9, 
-    14, 240, 43, 9, 14, 240, 42, 9, 14, 240, 41, 9, 14, 240, 40, 9, 14, 240, 
-    39, 9, 14, 240, 38, 9, 14, 240, 37, 9, 14, 240, 36, 9, 14, 240, 35, 9, 
-    14, 240, 34, 9, 14, 240, 33, 9, 14, 240, 32, 9, 14, 240, 31, 9, 14, 240, 
-    30, 9, 14, 240, 29, 9, 14, 240, 28, 9, 14, 240, 27, 9, 14, 240, 26, 9, 
-    14, 240, 25, 9, 14, 240, 24, 9, 14, 240, 23, 9, 14, 240, 22, 9, 14, 240, 
-    21, 9, 14, 240, 20, 9, 14, 240, 19, 9, 14, 240, 18, 9, 14, 240, 17, 9, 
-    14, 240, 16, 9, 14, 240, 15, 9, 14, 240, 14, 9, 14, 240, 13, 9, 14, 240, 
-    12, 9, 14, 240, 11, 9, 14, 240, 10, 9, 14, 240, 9, 9, 14, 240, 8, 9, 14, 
-    240, 7, 9, 14, 240, 6, 9, 14, 240, 5, 9, 14, 240, 4, 9, 14, 240, 3, 9, 
-    14, 240, 2, 9, 14, 240, 1, 9, 14, 240, 0, 9, 14, 239, 255, 9, 14, 239, 
-    254, 9, 14, 239, 253, 9, 14, 239, 252, 9, 14, 239, 251, 9, 14, 239, 250, 
-    9, 14, 239, 249, 9, 14, 239, 248, 9, 14, 239, 247, 9, 14, 239, 246, 9, 
-    14, 239, 245, 9, 14, 239, 244, 9, 14, 239, 243, 9, 14, 239, 242, 9, 14, 
-    239, 241, 9, 14, 239, 240, 9, 14, 239, 239, 9, 14, 239, 238, 9, 14, 239, 
-    237, 9, 14, 239, 236, 9, 14, 239, 235, 9, 14, 239, 234, 9, 14, 239, 233, 
-    9, 14, 239, 232, 9, 14, 239, 231, 9, 14, 239, 230, 9, 14, 239, 229, 9, 
-    14, 239, 228, 9, 14, 239, 227, 9, 14, 239, 226, 9, 14, 239, 225, 9, 14, 
-    239, 224, 9, 14, 239, 223, 9, 14, 239, 222, 9, 14, 239, 221, 9, 14, 239, 
-    220, 9, 14, 239, 219, 9, 14, 239, 218, 9, 14, 239, 217, 9, 14, 239, 216, 
-    9, 14, 239, 215, 9, 14, 239, 214, 9, 14, 239, 213, 9, 14, 239, 212, 9, 
-    14, 239, 211, 9, 14, 239, 210, 9, 14, 239, 209, 9, 14, 239, 208, 9, 14, 
-    239, 207, 9, 14, 239, 206, 9, 14, 239, 205, 9, 14, 239, 204, 9, 14, 239, 
-    203, 9, 14, 239, 202, 9, 14, 239, 201, 9, 14, 239, 200, 9, 14, 239, 199, 
-    9, 14, 239, 198, 9, 14, 239, 197, 9, 14, 239, 196, 9, 14, 239, 195, 9, 
-    14, 239, 194, 9, 14, 239, 193, 9, 14, 239, 192, 9, 14, 239, 191, 9, 14, 
-    239, 190, 9, 14, 239, 189, 9, 14, 239, 188, 9, 14, 239, 187, 9, 14, 239, 
-    186, 9, 14, 239, 185, 9, 14, 239, 184, 9, 14, 239, 183, 9, 14, 239, 182, 
-    9, 14, 239, 181, 9, 14, 239, 180, 9, 14, 239, 179, 9, 14, 239, 178, 9, 
-    14, 239, 177, 9, 14, 239, 176, 9, 14, 239, 175, 9, 14, 239, 174, 9, 14, 
-    239, 173, 9, 14, 239, 172, 9, 14, 239, 171, 9, 14, 239, 170, 9, 14, 239, 
-    169, 9, 14, 239, 168, 9, 14, 239, 167, 9, 14, 239, 166, 9, 14, 239, 165, 
-    9, 14, 239, 164, 9, 14, 239, 163, 9, 14, 239, 162, 9, 14, 239, 161, 9, 
-    14, 239, 160, 9, 14, 239, 159, 9, 14, 239, 158, 9, 14, 239, 157, 9, 14, 
-    239, 156, 9, 14, 239, 155, 9, 14, 239, 154, 9, 14, 239, 153, 9, 14, 239, 
-    152, 9, 14, 239, 151, 9, 14, 239, 150, 9, 14, 239, 149, 9, 14, 239, 148, 
-    9, 14, 239, 147, 9, 14, 239, 146, 9, 14, 239, 145, 9, 14, 239, 144, 9, 
-    14, 239, 143, 9, 14, 239, 142, 9, 14, 239, 141, 9, 14, 239, 140, 9, 14, 
-    239, 139, 9, 14, 239, 138, 9, 14, 239, 137, 9, 14, 239, 136, 9, 14, 239, 
-    135, 9, 14, 239, 134, 9, 14, 239, 133, 9, 14, 239, 132, 9, 14, 239, 131, 
-    9, 14, 239, 130, 9, 14, 239, 129, 9, 14, 239, 128, 9, 14, 239, 127, 9, 
-    14, 239, 126, 9, 14, 239, 125, 9, 14, 239, 124, 9, 14, 239, 123, 9, 14, 
-    239, 122, 9, 14, 239, 121, 9, 14, 239, 120, 9, 14, 239, 119, 9, 14, 239, 
-    118, 9, 14, 239, 117, 9, 14, 239, 116, 9, 14, 239, 115, 9, 14, 239, 114, 
-    9, 14, 239, 113, 9, 14, 239, 112, 9, 14, 239, 111, 9, 14, 239, 110, 9, 
-    14, 239, 109, 9, 14, 239, 108, 9, 14, 239, 107, 9, 14, 239, 106, 9, 14, 
-    239, 105, 9, 14, 239, 104, 9, 14, 239, 103, 9, 14, 239, 102, 9, 14, 239, 
-    101, 9, 14, 239, 100, 9, 14, 239, 99, 9, 14, 239, 98, 9, 14, 239, 97, 9, 
-    14, 239, 96, 9, 14, 239, 95, 9, 14, 239, 94, 9, 14, 239, 93, 9, 14, 239, 
-    92, 9, 14, 239, 91, 9, 14, 239, 90, 9, 14, 239, 89, 9, 14, 239, 88, 9, 
-    14, 239, 87, 9, 14, 239, 86, 9, 14, 239, 85, 9, 14, 239, 84, 9, 14, 239, 
-    83, 9, 14, 239, 82, 9, 14, 239, 81, 9, 14, 239, 80, 9, 14, 239, 79, 9, 
-    14, 239, 78, 9, 14, 239, 77, 9, 14, 239, 76, 9, 14, 239, 75, 9, 14, 239, 
-    74, 9, 14, 239, 73, 9, 14, 239, 72, 9, 14, 239, 71, 9, 14, 239, 70, 9, 
-    14, 239, 69, 9, 14, 239, 68, 9, 14, 239, 67, 9, 14, 239, 66, 9, 14, 239, 
-    65, 9, 14, 239, 64, 9, 14, 239, 63, 9, 14, 239, 62, 9, 14, 239, 61, 9, 
-    14, 239, 60, 9, 14, 239, 59, 9, 14, 239, 58, 9, 14, 239, 57, 9, 14, 239, 
-    56, 9, 14, 239, 55, 9, 14, 239, 54, 9, 14, 239, 53, 9, 14, 239, 52, 9, 
-    14, 239, 51, 9, 14, 239, 50, 9, 14, 239, 49, 9, 14, 239, 48, 9, 14, 239, 
-    47, 9, 14, 239, 46, 9, 14, 239, 45, 9, 14, 239, 44, 9, 14, 239, 43, 9, 
-    14, 239, 42, 9, 14, 239, 41, 9, 14, 239, 40, 9, 14, 239, 39, 9, 14, 239, 
-    38, 9, 14, 239, 37, 9, 14, 239, 36, 9, 14, 239, 35, 9, 14, 239, 34, 9, 
-    14, 239, 33, 9, 14, 239, 32, 9, 14, 239, 31, 9, 14, 239, 30, 9, 14, 239, 
-    29, 9, 14, 239, 28, 9, 14, 239, 27, 9, 14, 239, 26, 9, 14, 239, 25, 9, 
-    14, 239, 24, 9, 14, 239, 23, 9, 14, 239, 22, 9, 14, 239, 21, 9, 14, 239, 
-    20, 9, 14, 239, 19, 9, 14, 239, 18, 9, 14, 239, 17, 9, 14, 239, 16, 9, 
-    14, 239, 15, 9, 14, 239, 14, 9, 14, 239, 13, 9, 14, 239, 12, 9, 14, 239, 
-    11, 9, 14, 239, 10, 9, 14, 239, 9, 9, 14, 239, 8, 9, 14, 239, 7, 9, 14, 
-    239, 6, 9, 14, 239, 5, 9, 14, 239, 4, 9, 14, 239, 3, 9, 14, 239, 2, 9, 
-    14, 239, 1, 9, 14, 239, 0, 9, 14, 238, 255, 9, 14, 238, 254, 9, 14, 238, 
-    253, 9, 14, 238, 252, 9, 14, 238, 251, 9, 14, 238, 250, 9, 14, 238, 249, 
-    9, 14, 238, 248, 9, 14, 238, 247, 9, 14, 238, 246, 9, 14, 238, 245, 9, 
-    14, 238, 244, 9, 14, 238, 243, 9, 14, 238, 242, 9, 14, 238, 241, 9, 14, 
-    238, 240, 9, 14, 238, 239, 9, 14, 238, 238, 9, 14, 238, 237, 9, 14, 238, 
-    236, 9, 14, 238, 235, 9, 14, 238, 234, 9, 14, 238, 233, 9, 14, 238, 232, 
-    9, 14, 238, 231, 9, 14, 238, 230, 9, 14, 238, 229, 9, 14, 238, 228, 9, 
-    14, 238, 227, 9, 14, 238, 226, 9, 14, 238, 225, 9, 14, 238, 224, 9, 14, 
-    238, 223, 9, 14, 238, 222, 9, 14, 238, 221, 9, 14, 238, 220, 9, 14, 238, 
-    219, 9, 14, 238, 218, 9, 14, 238, 217, 9, 14, 238, 216, 9, 14, 238, 215, 
-    9, 14, 238, 214, 9, 14, 238, 213, 9, 14, 238, 212, 9, 14, 238, 211, 9, 
-    14, 238, 210, 9, 14, 238, 209, 9, 14, 238, 208, 9, 14, 238, 207, 9, 14, 
-    238, 206, 9, 14, 238, 205, 9, 14, 238, 204, 9, 14, 238, 203, 9, 14, 238, 
-    202, 9, 14, 238, 201, 9, 14, 238, 200, 9, 14, 238, 199, 9, 14, 238, 198, 
-    9, 14, 238, 197, 9, 14, 238, 196, 9, 14, 238, 195, 9, 14, 238, 194, 9, 
-    14, 238, 193, 9, 14, 238, 192, 9, 14, 238, 191, 9, 14, 238, 190, 9, 14, 
-    238, 189, 9, 14, 238, 188, 9, 14, 238, 187, 9, 14, 238, 186, 9, 14, 238, 
-    185, 9, 14, 238, 184, 9, 14, 238, 183, 9, 14, 238, 182, 9, 14, 238, 181, 
-    9, 14, 238, 180, 9, 14, 238, 179, 9, 14, 238, 178, 9, 14, 238, 177, 9, 
-    14, 238, 176, 9, 14, 238, 175, 9, 14, 238, 174, 9, 14, 238, 173, 9, 14, 
-    238, 172, 9, 14, 238, 171, 9, 14, 238, 170, 9, 14, 238, 169, 9, 14, 238, 
-    168, 9, 14, 238, 167, 9, 14, 238, 166, 9, 14, 238, 165, 9, 14, 238, 164, 
-    9, 14, 238, 163, 9, 14, 238, 162, 9, 14, 238, 161, 9, 14, 238, 160, 9, 
-    14, 238, 159, 9, 14, 238, 158, 9, 14, 238, 157, 9, 14, 238, 156, 9, 14, 
-    238, 155, 9, 14, 238, 154, 9, 14, 238, 153, 9, 14, 238, 152, 9, 14, 238, 
-    151, 9, 14, 238, 150, 9, 14, 238, 149, 9, 14, 238, 148, 9, 14, 238, 147, 
-    9, 14, 238, 146, 9, 14, 238, 145, 9, 14, 238, 144, 9, 14, 238, 143, 9, 
-    14, 238, 142, 9, 14, 238, 141, 9, 14, 238, 140, 9, 14, 238, 139, 9, 14, 
-    238, 138, 9, 14, 238, 137, 9, 14, 238, 136, 9, 14, 238, 135, 9, 14, 238, 
-    134, 9, 14, 238, 133, 9, 14, 238, 132, 9, 14, 238, 131, 9, 14, 238, 130, 
-    9, 14, 238, 129, 9, 14, 238, 128, 9, 14, 238, 127, 9, 14, 238, 126, 9, 
-    14, 238, 125, 9, 14, 238, 124, 9, 14, 238, 123, 9, 14, 238, 122, 9, 14, 
-    238, 121, 9, 14, 238, 120, 9, 14, 238, 119, 9, 14, 238, 118, 9, 14, 238, 
-    117, 9, 14, 238, 116, 9, 14, 238, 115, 9, 14, 238, 114, 9, 14, 238, 113, 
-    9, 14, 238, 112, 9, 14, 238, 111, 9, 14, 238, 110, 9, 14, 238, 109, 9, 
-    14, 238, 108, 9, 14, 238, 107, 9, 14, 238, 106, 9, 14, 238, 105, 9, 14, 
-    238, 104, 9, 14, 238, 103, 9, 14, 238, 102, 9, 14, 238, 101, 9, 14, 238, 
-    100, 9, 14, 238, 99, 9, 14, 238, 98, 9, 14, 238, 97, 9, 14, 238, 96, 9, 
-    14, 238, 95, 9, 14, 238, 94, 9, 14, 238, 93, 9, 14, 238, 92, 9, 14, 238, 
-    91, 9, 14, 238, 90, 9, 14, 238, 89, 9, 14, 238, 88, 9, 14, 238, 87, 9, 
-    14, 238, 86, 9, 14, 238, 85, 9, 14, 238, 84, 9, 14, 238, 83, 9, 14, 238, 
-    82, 9, 14, 238, 81, 9, 14, 238, 80, 9, 14, 238, 79, 9, 14, 238, 78, 9, 
-    14, 238, 77, 9, 14, 238, 76, 9, 14, 238, 75, 9, 14, 238, 74, 9, 14, 238, 
-    73, 233, 90, 217, 84, 129, 219, 18, 129, 245, 31, 78, 129, 223, 254, 78, 
-    129, 54, 50, 129, 247, 132, 50, 129, 225, 182, 50, 129, 254, 126, 129, 
-    254, 57, 129, 43, 226, 3, 129, 44, 226, 3, 129, 253, 216, 129, 96, 50, 
-    129, 249, 219, 129, 240, 167, 129, 243, 229, 218, 129, 129, 219, 46, 129, 
-    21, 210, 86, 129, 21, 110, 129, 21, 105, 129, 21, 158, 129, 21, 161, 129, 
-    21, 189, 129, 21, 194, 129, 21, 198, 129, 21, 195, 129, 21, 200, 129, 
-    249, 226, 129, 220, 150, 129, 233, 15, 50, 129, 245, 98, 50, 129, 242, 
-    130, 50, 129, 224, 13, 78, 129, 249, 217, 253, 206, 129, 7, 6, 1, 61, 
-    129, 7, 6, 1, 253, 158, 129, 7, 6, 1, 251, 66, 129, 7, 6, 1, 249, 60, 
-    129, 7, 6, 1, 75, 129, 7, 6, 1, 245, 6, 129, 7, 6, 1, 243, 202, 129, 7, 
-    6, 1, 242, 60, 129, 7, 6, 1, 73, 129, 7, 6, 1, 235, 144, 129, 7, 6, 1, 
-    235, 23, 129, 7, 6, 1, 156, 129, 7, 6, 1, 193, 129, 7, 6, 1, 230, 25, 
-    129, 7, 6, 1, 76, 129, 7, 6, 1, 226, 105, 129, 7, 6, 1, 224, 96, 129, 7, 
-    6, 1, 153, 129, 7, 6, 1, 222, 91, 129, 7, 6, 1, 217, 152, 129, 7, 6, 1, 
-    70, 129, 7, 6, 1, 214, 105, 129, 7, 6, 1, 212, 98, 129, 7, 6, 1, 211, 
-    178, 129, 7, 6, 1, 211, 117, 129, 7, 6, 1, 210, 159, 129, 43, 42, 127, 
-    129, 223, 50, 219, 46, 129, 44, 42, 127, 129, 250, 31, 255, 14, 129, 121, 
-    232, 213, 129, 242, 137, 255, 14, 129, 7, 4, 1, 61, 129, 7, 4, 1, 253, 
-    158, 129, 7, 4, 1, 251, 66, 129, 7, 4, 1, 249, 60, 129, 7, 4, 1, 75, 129, 
-    7, 4, 1, 245, 6, 129, 7, 4, 1, 243, 202, 129, 7, 4, 1, 242, 60, 129, 7, 
-    4, 1, 73, 129, 7, 4, 1, 235, 144, 129, 7, 4, 1, 235, 23, 129, 7, 4, 1, 
-    156, 129, 7, 4, 1, 193, 129, 7, 4, 1, 230, 25, 129, 7, 4, 1, 76, 129, 7, 
-    4, 1, 226, 105, 129, 7, 4, 1, 224, 96, 129, 7, 4, 1, 153, 129, 7, 4, 1, 
-    222, 91, 129, 7, 4, 1, 217, 152, 129, 7, 4, 1, 70, 129, 7, 4, 1, 214, 
-    105, 129, 7, 4, 1, 212, 98, 129, 7, 4, 1, 211, 178, 129, 7, 4, 1, 211, 
-    117, 129, 7, 4, 1, 210, 159, 129, 43, 249, 99, 127, 129, 67, 232, 213, 
-    129, 44, 249, 99, 127, 129, 182, 251, 6, 217, 84, 45, 221, 78, 45, 221, 
-    67, 45, 221, 56, 45, 221, 44, 45, 221, 33, 45, 221, 22, 45, 221, 11, 45, 
-    221, 0, 45, 220, 245, 45, 220, 237, 45, 220, 236, 45, 220, 235, 45, 220, 
-    234, 45, 220, 232, 45, 220, 231, 45, 220, 230, 45, 220, 229, 45, 220, 
-    228, 45, 220, 227, 45, 220, 226, 45, 220, 225, 45, 220, 224, 45, 220, 
-    223, 45, 220, 221, 45, 220, 220, 45, 220, 219, 45, 220, 218, 45, 220, 
-    217, 45, 220, 216, 45, 220, 215, 45, 220, 214, 45, 220, 213, 45, 220, 
-    212, 45, 220, 210, 45, 220, 209, 45, 220, 208, 45, 220, 207, 45, 220, 
-    206, 45, 220, 205, 45, 220, 204, 45, 220, 203, 45, 220, 202, 45, 220, 
-    201, 45, 220, 199, 45, 220, 198, 45, 220, 197, 45, 220, 196, 45, 220, 
-    195, 45, 220, 194, 45, 220, 193, 45, 220, 192, 45, 220, 191, 45, 220, 
-    190, 45, 220, 188, 45, 220, 187, 45, 220, 186, 45, 220, 185, 45, 220, 
-    184, 45, 220, 183, 45, 220, 182, 45, 220, 181, 45, 220, 180, 45, 220, 
-    179, 45, 220, 177, 45, 220, 176, 45, 220, 175, 45, 220, 174, 45, 220, 
-    173, 45, 220, 172, 45, 220, 171, 45, 220, 170, 45, 220, 169, 45, 220, 
-    168, 45, 220, 166, 45, 220, 165, 45, 220, 164, 45, 220, 163, 45, 220, 
-    162, 45, 220, 161, 45, 220, 160, 45, 220, 159, 45, 220, 158, 45, 220, 
-    157, 45, 221, 154, 45, 221, 153, 45, 221, 152, 45, 221, 151, 45, 221, 
-    150, 45, 221, 149, 45, 221, 148, 45, 221, 147, 45, 221, 146, 45, 221, 
-    145, 45, 221, 143, 45, 221, 142, 45, 221, 141, 45, 221, 140, 45, 221, 
-    139, 45, 221, 138, 45, 221, 137, 45, 221, 136, 45, 221, 135, 45, 221, 
-    134, 45, 221, 132, 45, 221, 131, 45, 221, 130, 45, 221, 129, 45, 221, 
-    128, 45, 221, 127, 45, 221, 126, 45, 221, 125, 45, 221, 124, 45, 221, 
-    123, 45, 221, 121, 45, 221, 120, 45, 221, 119, 45, 221, 118, 45, 221, 
-    117, 45, 221, 116, 45, 221, 115, 45, 221, 114, 45, 221, 113, 45, 221, 
-    112, 45, 221, 110, 45, 221, 109, 45, 221, 108, 45, 221, 107, 45, 221, 
-    106, 45, 221, 105, 45, 221, 104, 45, 221, 103, 45, 221, 102, 45, 221, 
-    101, 45, 221, 99, 45, 221, 98, 45, 221, 97, 45, 221, 96, 45, 221, 95, 45, 
-    221, 94, 45, 221, 93, 45, 221, 92, 45, 221, 91, 45, 221, 90, 45, 221, 88, 
-    45, 221, 87, 45, 221, 86, 45, 221, 85, 45, 221, 84, 45, 221, 83, 45, 221, 
-    82, 45, 221, 81, 45, 221, 80, 45, 221, 79, 45, 221, 77, 45, 221, 76, 45, 
-    221, 75, 45, 221, 74, 45, 221, 73, 45, 221, 72, 45, 221, 71, 45, 221, 70, 
-    45, 221, 69, 45, 221, 68, 45, 221, 66, 45, 221, 65, 45, 221, 64, 45, 221, 
-    63, 45, 221, 62, 45, 221, 61, 45, 221, 60, 45, 221, 59, 45, 221, 58, 45, 
-    221, 57, 45, 221, 55, 45, 221, 54, 45, 221, 53, 45, 221, 52, 45, 221, 51, 
-    45, 221, 50, 45, 221, 49, 45, 221, 48, 45, 221, 47, 45, 221, 46, 45, 221, 
-    43, 45, 221, 42, 45, 221, 41, 45, 221, 40, 45, 221, 39, 45, 221, 38, 45, 
-    221, 37, 45, 221, 36, 45, 221, 35, 45, 221, 34, 45, 221, 32, 45, 221, 31, 
-    45, 221, 30, 45, 221, 29, 45, 221, 28, 45, 221, 27, 45, 221, 26, 45, 221, 
-    25, 45, 221, 24, 45, 221, 23, 45, 221, 21, 45, 221, 20, 45, 221, 19, 45, 
-    221, 18, 45, 221, 17, 45, 221, 16, 45, 221, 15, 45, 221, 14, 45, 221, 13, 
-    45, 221, 12, 45, 221, 10, 45, 221, 9, 45, 221, 8, 45, 221, 7, 45, 221, 6, 
-    45, 221, 5, 45, 221, 4, 45, 221, 3, 45, 221, 2, 45, 221, 1, 45, 220, 255, 
-    45, 220, 254, 45, 220, 253, 45, 220, 252, 45, 220, 251, 45, 220, 250, 45, 
-    220, 249, 45, 220, 248, 45, 220, 247, 45, 220, 246, 45, 220, 244, 45, 
-    220, 243, 45, 220, 242, 45, 220, 241, 45, 220, 240, 45, 220, 239, 45, 
-    220, 238, 227, 202, 227, 204, 218, 152, 64, 241, 233, 219, 48, 218, 152, 
-    64, 216, 212, 218, 85, 245, 143, 64, 216, 212, 245, 56, 245, 143, 64, 
-    215, 243, 245, 109, 245, 132, 245, 133, 255, 7, 255, 8, 254, 167, 252, 
-    47, 252, 179, 251, 131, 135, 217, 89, 203, 217, 89, 240, 227, 217, 93, 
-    232, 214, 244, 145, 166, 232, 213, 245, 143, 64, 232, 213, 233, 0, 228, 
-    135, 245, 112, 232, 214, 217, 89, 67, 217, 89, 212, 118, 244, 20, 244, 
-    145, 244, 125, 250, 230, 223, 53, 249, 143, 220, 28, 226, 130, 232, 150, 
-    110, 219, 58, 220, 28, 235, 255, 232, 150, 210, 86, 219, 191, 248, 151, 
-    232, 204, 245, 77, 247, 155, 248, 31, 249, 178, 110, 248, 141, 248, 31, 
-    249, 178, 105, 248, 140, 248, 31, 249, 178, 158, 248, 139, 248, 31, 249, 
-    178, 161, 248, 138, 152, 255, 7, 229, 209, 217, 177, 236, 62, 217, 180, 
-    245, 143, 64, 215, 244, 251, 213, 245, 62, 251, 5, 251, 7, 245, 143, 64, 
-    231, 81, 245, 110, 218, 61, 218, 78, 245, 77, 245, 78, 235, 232, 220, 
-    138, 161, 244, 107, 220, 137, 243, 237, 235, 232, 220, 138, 158, 242, 
-    121, 220, 137, 242, 118, 235, 232, 220, 138, 105, 223, 121, 220, 137, 
-    222, 145, 235, 232, 220, 138, 110, 214, 174, 220, 137, 214, 133, 219, 21, 
-    248, 63, 248, 65, 226, 78, 250, 142, 226, 80, 125, 226, 240, 224, 193, 
-    241, 47, 251, 150, 225, 173, 241, 203, 251, 161, 228, 75, 251, 150, 241, 
-    203, 229, 175, 235, 242, 235, 244, 229, 82, 232, 213, 229, 99, 218, 152, 
-    64, 221, 158, 254, 18, 218, 223, 245, 143, 64, 221, 158, 254, 18, 245, 
-    80, 135, 217, 90, 220, 127, 203, 217, 90, 220, 127, 240, 224, 135, 217, 
-    90, 2, 235, 35, 203, 217, 90, 2, 235, 35, 240, 225, 232, 214, 217, 90, 
-    220, 127, 67, 217, 90, 220, 127, 212, 117, 225, 253, 232, 214, 244, 14, 
-    225, 253, 232, 214, 246, 106, 225, 32, 225, 253, 232, 214, 252, 178, 225, 
-    253, 232, 214, 214, 163, 225, 28, 223, 50, 232, 214, 244, 145, 223, 50, 
-    235, 242, 223, 35, 219, 155, 220, 28, 105, 219, 152, 218, 225, 219, 155, 
-    220, 28, 158, 219, 151, 218, 224, 248, 31, 249, 178, 218, 105, 248, 137, 
-    224, 183, 214, 132, 110, 224, 183, 214, 130, 224, 149, 224, 183, 214, 
-    132, 105, 224, 183, 214, 129, 224, 148, 220, 128, 215, 242, 218, 151, 
-    218, 89, 251, 6, 250, 142, 250, 209, 231, 43, 212, 59, 230, 43, 218, 152, 
-    64, 242, 107, 254, 18, 218, 152, 64, 224, 166, 254, 18, 219, 20, 245, 
-    143, 64, 242, 107, 254, 18, 245, 143, 64, 224, 166, 254, 18, 245, 107, 
-    218, 152, 64, 218, 105, 219, 35, 219, 155, 242, 141, 135, 235, 195, 220, 
-    107, 219, 155, 135, 235, 195, 221, 194, 249, 178, 220, 135, 235, 195, 
-    249, 113, 218, 106, 216, 236, 218, 168, 226, 169, 217, 167, 249, 218, 
-    226, 142, 224, 184, 231, 42, 225, 19, 254, 53, 224, 178, 249, 218, 254, 
-    69, 229, 163, 219, 200, 7, 6, 1, 242, 249, 7, 4, 1, 242, 249, 250, 159, 
-    165, 1, 232, 175, 209, 209, 1, 244, 44, 244, 36, 209, 209, 1, 244, 44, 
-    244, 157, 209, 209, 1, 222, 211, 209, 209, 1, 232, 156, 63, 164, 251, 
-    223, 220, 3, 242, 215, 230, 248, 223, 41, 243, 216, 243, 215, 243, 214, 
-    230, 45, 209, 251, 209, 252, 209, 254, 232, 102, 222, 219, 232, 103, 222, 
-    220, 225, 223, 232, 101, 222, 218, 228, 106, 230, 165, 211, 229, 212, 15, 
-    245, 162, 243, 226, 230, 229, 226, 197, 214, 134, 87, 230, 229, 248, 157, 
-    87, 8, 3, 235, 158, 78, 224, 194, 244, 20, 31, 67, 44, 71, 233, 20, 127, 
-    213, 118, 213, 7, 212, 195, 212, 184, 212, 173, 212, 162, 212, 151, 212, 
-    140, 212, 129, 213, 117, 213, 106, 213, 95, 213, 84, 213, 73, 213, 62, 
-    213, 51, 251, 71, 226, 155, 78, 251, 196, 209, 253, 49, 28, 16, 243, 236, 
-    219, 102, 250, 73, 214, 9, 213, 40, 213, 29, 213, 18, 213, 6, 212, 251, 
-    212, 240, 212, 229, 212, 218, 212, 207, 212, 199, 212, 198, 212, 197, 
-    212, 196, 212, 194, 212, 193, 212, 192, 212, 191, 212, 190, 212, 189, 
-    212, 188, 212, 187, 212, 186, 212, 185, 212, 183, 212, 182, 212, 181, 
-    212, 180, 212, 179, 212, 178, 212, 177, 212, 176, 212, 175, 212, 174, 
-    212, 172, 212, 171, 212, 170, 212, 169, 212, 168, 212, 167, 212, 166, 
-    212, 165, 212, 164, 212, 163, 212, 161, 212, 160, 212, 159, 212, 158, 
-    212, 157, 212, 156, 212, 155, 212, 154, 212, 153, 212, 152, 212, 150, 
-    212, 149, 212, 148, 212, 147, 212, 146, 212, 145, 212, 144, 212, 143, 
-    212, 142, 212, 141, 212, 139, 212, 138, 212, 137, 212, 136, 212, 135, 
-    212, 134, 212, 133, 212, 132, 212, 131, 212, 130, 212, 128, 212, 127, 
-    212, 126, 212, 125, 212, 124, 212, 123, 212, 122, 212, 121, 212, 120, 
-    212, 119, 213, 116, 213, 115, 213, 114, 213, 113, 213, 112, 213, 111, 
-    213, 110, 213, 109, 213, 108, 213, 107, 213, 105, 213, 104, 213, 103, 
-    213, 102, 213, 101, 213, 100, 213, 99, 213, 98, 213, 97, 213, 96, 213, 
-    94, 213, 93, 213, 92, 213, 91, 213, 90, 213, 89, 213, 88, 213, 87, 213, 
-    86, 213, 85, 213, 83, 213, 82, 213, 81, 213, 80, 213, 79, 213, 78, 213, 
-    77, 213, 76, 213, 75, 213, 74, 213, 72, 213, 71, 213, 70, 213, 69, 213, 
-    68, 213, 67, 213, 66, 213, 65, 213, 64, 213, 63, 213, 61, 213, 60, 213, 
-    59, 213, 58, 213, 57, 213, 56, 213, 55, 213, 54, 213, 53, 213, 52, 213, 
-    50, 213, 49, 213, 48, 213, 47, 213, 46, 213, 45, 213, 44, 213, 43, 213, 
-    42, 213, 41, 213, 39, 213, 38, 213, 37, 213, 36, 213, 35, 213, 34, 213, 
-    33, 213, 32, 213, 31, 213, 30, 213, 28, 213, 27, 213, 26, 213, 25, 213, 
-    24, 213, 23, 213, 22, 213, 21, 213, 20, 213, 19, 213, 17, 213, 16, 213, 
-    15, 213, 14, 213, 13, 213, 12, 213, 11, 213, 10, 213, 9, 213, 8, 213, 5, 
-    213, 4, 213, 3, 213, 2, 213, 1, 213, 0, 212, 255, 212, 254, 212, 253, 
-    212, 252, 212, 250, 212, 249, 212, 248, 212, 247, 212, 246, 212, 245, 
-    212, 244, 212, 243, 212, 242, 212, 241, 212, 239, 212, 238, 212, 237, 
-    212, 236, 212, 235, 212, 234, 212, 233, 212, 232, 212, 231, 212, 230, 
-    212, 228, 212, 227, 212, 226, 212, 225, 212, 224, 212, 223, 212, 222, 
-    212, 221, 212, 220, 212, 219, 212, 217, 212, 216, 212, 215, 212, 214, 
-    212, 213, 212, 212, 212, 211, 212, 210, 212, 209, 212, 208, 212, 206, 
-    212, 205, 212, 204, 212, 203, 212, 202, 212, 201, 212, 200, 7, 6, 1, 115, 
-    2, 231, 233, 22, 242, 136, 7, 4, 1, 115, 2, 231, 233, 22, 242, 136, 7, 6, 
-    1, 160, 2, 67, 232, 214, 51, 7, 4, 1, 160, 2, 67, 232, 214, 51, 7, 6, 1, 
-    160, 2, 67, 232, 214, 252, 43, 22, 242, 136, 7, 4, 1, 160, 2, 67, 232, 
-    214, 252, 43, 22, 242, 136, 7, 6, 1, 160, 2, 67, 232, 214, 252, 43, 22, 
-    142, 7, 4, 1, 160, 2, 67, 232, 214, 252, 43, 22, 142, 7, 6, 1, 160, 2, 
-    250, 31, 22, 231, 232, 7, 4, 1, 160, 2, 250, 31, 22, 231, 232, 7, 6, 1, 
-    160, 2, 250, 31, 22, 250, 234, 7, 4, 1, 160, 2, 250, 31, 22, 250, 234, 7, 
-    6, 1, 240, 154, 2, 231, 233, 22, 242, 136, 7, 4, 1, 240, 154, 2, 231, 
-    233, 22, 242, 136, 7, 4, 1, 240, 154, 2, 59, 77, 22, 142, 7, 4, 1, 229, 
-    80, 2, 216, 89, 48, 7, 6, 1, 144, 2, 67, 232, 214, 51, 7, 4, 1, 144, 2, 
-    67, 232, 214, 51, 7, 6, 1, 144, 2, 67, 232, 214, 252, 43, 22, 242, 136, 
-    7, 4, 1, 144, 2, 67, 232, 214, 252, 43, 22, 242, 136, 7, 6, 1, 144, 2, 
-    67, 232, 214, 252, 43, 22, 142, 7, 4, 1, 144, 2, 67, 232, 214, 252, 43, 
-    22, 142, 7, 6, 1, 222, 92, 2, 67, 232, 214, 51, 7, 4, 1, 222, 92, 2, 67, 
-    232, 214, 51, 7, 6, 1, 104, 2, 231, 233, 22, 242, 136, 7, 4, 1, 104, 2, 
-    231, 233, 22, 242, 136, 7, 6, 1, 115, 2, 226, 225, 22, 142, 7, 4, 1, 115, 
-    2, 226, 225, 22, 142, 7, 6, 1, 115, 2, 226, 225, 22, 182, 7, 4, 1, 115, 
-    2, 226, 225, 22, 182, 7, 6, 1, 160, 2, 226, 225, 22, 142, 7, 4, 1, 160, 
-    2, 226, 225, 22, 142, 7, 6, 1, 160, 2, 226, 225, 22, 182, 7, 4, 1, 160, 
-    2, 226, 225, 22, 182, 7, 6, 1, 160, 2, 59, 77, 22, 142, 7, 4, 1, 160, 2, 
-    59, 77, 22, 142, 7, 6, 1, 160, 2, 59, 77, 22, 182, 7, 4, 1, 160, 2, 59, 
-    77, 22, 182, 7, 4, 1, 240, 154, 2, 59, 77, 22, 242, 136, 7, 4, 1, 240, 
-    154, 2, 59, 77, 22, 182, 7, 6, 1, 240, 154, 2, 226, 225, 22, 142, 7, 4, 
-    1, 240, 154, 2, 226, 225, 22, 59, 77, 22, 142, 7, 6, 1, 240, 154, 2, 226, 
-    225, 22, 182, 7, 4, 1, 240, 154, 2, 226, 225, 22, 59, 77, 22, 182, 7, 6, 
-    1, 235, 145, 2, 182, 7, 4, 1, 235, 145, 2, 59, 77, 22, 182, 7, 6, 1, 233, 
-    149, 2, 182, 7, 4, 1, 233, 149, 2, 182, 7, 6, 1, 232, 50, 2, 182, 7, 4, 
-    1, 232, 50, 2, 182, 7, 6, 1, 223, 224, 2, 182, 7, 4, 1, 223, 224, 2, 182, 
-    7, 6, 1, 104, 2, 226, 225, 22, 142, 7, 4, 1, 104, 2, 226, 225, 22, 142, 
-    7, 6, 1, 104, 2, 226, 225, 22, 182, 7, 4, 1, 104, 2, 226, 225, 22, 182, 
-    7, 6, 1, 104, 2, 231, 233, 22, 142, 7, 4, 1, 104, 2, 231, 233, 22, 142, 
-    7, 6, 1, 104, 2, 231, 233, 22, 182, 7, 4, 1, 104, 2, 231, 233, 22, 182, 
-    7, 4, 1, 254, 244, 2, 242, 136, 7, 4, 1, 204, 144, 2, 242, 136, 7, 4, 1, 
-    204, 144, 2, 142, 7, 4, 1, 215, 94, 214, 106, 2, 242, 136, 7, 4, 1, 215, 
-    94, 214, 106, 2, 142, 7, 4, 1, 221, 196, 2, 242, 136, 7, 4, 1, 221, 196, 
-    2, 142, 7, 4, 1, 241, 51, 221, 196, 2, 242, 136, 7, 4, 1, 241, 51, 221, 
-    196, 2, 142, 146, 1, 234, 109, 36, 116, 235, 23, 36, 116, 229, 79, 36, 
-    116, 251, 66, 36, 116, 227, 167, 36, 116, 215, 159, 36, 116, 228, 111, 
-    36, 116, 217, 152, 36, 116, 230, 25, 36, 116, 226, 105, 36, 116, 193, 36, 
-    116, 211, 117, 36, 116, 153, 36, 116, 156, 36, 116, 214, 105, 36, 116, 
-    232, 176, 36, 116, 232, 185, 36, 116, 222, 180, 36, 116, 228, 93, 36, 
-    116, 235, 144, 36, 116, 220, 104, 36, 116, 218, 226, 36, 116, 222, 91, 
-    36, 116, 242, 60, 36, 116, 233, 232, 36, 3, 235, 10, 36, 3, 234, 92, 36, 
-    3, 234, 83, 36, 3, 233, 217, 36, 3, 233, 188, 36, 3, 234, 182, 36, 3, 
-    234, 181, 36, 3, 234, 246, 36, 3, 234, 28, 36, 3, 234, 10, 36, 3, 234, 
-    195, 36, 3, 229, 76, 36, 3, 229, 27, 36, 3, 229, 23, 36, 3, 228, 248, 36, 
-    3, 228, 241, 36, 3, 229, 64, 36, 3, 229, 62, 36, 3, 229, 73, 36, 3, 229, 
-    4, 36, 3, 228, 255, 36, 3, 229, 66, 36, 3, 251, 32, 36, 3, 250, 51, 36, 
-    3, 250, 41, 36, 3, 249, 112, 36, 3, 249, 83, 36, 3, 250, 190, 36, 3, 250, 
-    182, 36, 3, 251, 22, 36, 3, 249, 238, 36, 3, 249, 174, 36, 3, 250, 222, 
-    36, 3, 227, 164, 36, 3, 227, 148, 36, 3, 227, 143, 36, 3, 227, 128, 36, 
-    3, 227, 121, 36, 3, 227, 156, 36, 3, 227, 155, 36, 3, 227, 161, 36, 3, 
-    227, 134, 36, 3, 227, 132, 36, 3, 227, 159, 36, 3, 215, 155, 36, 3, 215, 
-    135, 36, 3, 215, 134, 36, 3, 215, 123, 36, 3, 215, 120, 36, 3, 215, 151, 
-    36, 3, 215, 150, 36, 3, 215, 154, 36, 3, 215, 133, 36, 3, 215, 132, 36, 
-    3, 215, 153, 36, 3, 228, 109, 36, 3, 228, 95, 36, 3, 228, 94, 36, 3, 228, 
-    78, 36, 3, 228, 77, 36, 3, 228, 105, 36, 3, 228, 104, 36, 3, 228, 108, 
-    36, 3, 228, 80, 36, 3, 228, 79, 36, 3, 228, 107, 36, 3, 217, 101, 36, 3, 
-    216, 117, 36, 3, 216, 103, 36, 3, 215, 118, 36, 3, 215, 85, 36, 3, 217, 
-    22, 36, 3, 217, 11, 36, 3, 217, 79, 36, 3, 111, 36, 3, 216, 17, 36, 3, 
-    217, 41, 36, 3, 229, 225, 36, 3, 228, 233, 36, 3, 228, 208, 36, 3, 227, 
-    237, 36, 3, 227, 179, 36, 3, 229, 107, 36, 3, 229, 103, 36, 3, 229, 212, 
-    36, 3, 228, 74, 36, 3, 228, 64, 36, 3, 229, 187, 36, 3, 226, 89, 36, 3, 
-    225, 108, 36, 3, 225, 71, 36, 3, 224, 150, 36, 3, 224, 119, 36, 3, 225, 
-    221, 36, 3, 225, 211, 36, 3, 226, 71, 36, 3, 225, 16, 36, 3, 224, 249, 
-    36, 3, 225, 234, 36, 3, 231, 237, 36, 3, 230, 230, 36, 3, 230, 201, 36, 
-    3, 230, 102, 36, 3, 230, 54, 36, 3, 231, 91, 36, 3, 231, 80, 36, 3, 231, 
-    203, 36, 3, 230, 161, 36, 3, 230, 132, 36, 3, 231, 135, 36, 3, 211, 103, 
-    36, 3, 211, 8, 36, 3, 210, 255, 36, 3, 210, 212, 36, 3, 210, 181, 36, 3, 
-    211, 47, 36, 3, 211, 44, 36, 3, 211, 82, 36, 3, 210, 244, 36, 3, 210, 
-    229, 36, 3, 211, 55, 36, 3, 223, 184, 36, 3, 223, 35, 36, 3, 222, 239, 
-    36, 3, 222, 140, 36, 3, 222, 112, 36, 3, 223, 128, 36, 3, 223, 108, 36, 
-    3, 223, 166, 36, 3, 222, 211, 36, 3, 222, 197, 36, 3, 223, 136, 36, 3, 
-    233, 134, 36, 3, 232, 241, 36, 3, 232, 227, 36, 3, 232, 98, 36, 3, 232, 
-    73, 36, 3, 233, 58, 36, 3, 233, 50, 36, 3, 233, 109, 36, 3, 232, 156, 36, 
-    3, 232, 127, 36, 3, 233, 74, 36, 3, 214, 26, 36, 3, 213, 176, 36, 3, 213, 
-    162, 36, 3, 212, 116, 36, 3, 212, 109, 36, 3, 213, 255, 36, 3, 213, 250, 
-    36, 3, 214, 23, 36, 3, 213, 138, 36, 3, 213, 127, 36, 3, 214, 5, 36, 3, 
-    232, 174, 36, 3, 232, 169, 36, 3, 232, 168, 36, 3, 232, 165, 36, 3, 232, 
-    164, 36, 3, 232, 171, 36, 3, 232, 170, 36, 3, 232, 173, 36, 3, 232, 167, 
-    36, 3, 232, 166, 36, 3, 232, 172, 36, 3, 232, 183, 36, 3, 232, 178, 36, 
-    3, 232, 177, 36, 3, 232, 161, 36, 3, 232, 160, 36, 3, 232, 180, 36, 3, 
-    232, 179, 36, 3, 232, 182, 36, 3, 232, 163, 36, 3, 232, 162, 36, 3, 232, 
-    181, 36, 3, 222, 178, 36, 3, 222, 167, 36, 3, 222, 166, 36, 3, 222, 160, 
-    36, 3, 222, 153, 36, 3, 222, 174, 36, 3, 222, 173, 36, 3, 222, 177, 36, 
-    3, 222, 165, 36, 3, 222, 164, 36, 3, 222, 176, 36, 3, 228, 91, 36, 3, 
-    228, 86, 36, 3, 228, 85, 36, 3, 228, 82, 36, 3, 228, 81, 36, 3, 228, 88, 
-    36, 3, 228, 87, 36, 3, 228, 90, 36, 3, 228, 84, 36, 3, 228, 83, 36, 3, 
-    228, 89, 36, 3, 235, 140, 36, 3, 235, 108, 36, 3, 235, 101, 36, 3, 235, 
-    51, 36, 3, 235, 33, 36, 3, 235, 126, 36, 3, 235, 124, 36, 3, 235, 135, 
-    36, 3, 235, 68, 36, 3, 235, 59, 36, 3, 235, 129, 36, 3, 220, 98, 36, 3, 
-    220, 32, 36, 3, 220, 27, 36, 3, 219, 225, 36, 3, 219, 210, 36, 3, 220, 
-    63, 36, 3, 220, 61, 36, 3, 220, 90, 36, 3, 220, 7, 36, 3, 220, 1, 36, 3, 
-    220, 71, 36, 3, 218, 222, 36, 3, 218, 192, 36, 3, 218, 188, 36, 3, 218, 
-    179, 36, 3, 218, 176, 36, 3, 218, 197, 36, 3, 218, 196, 36, 3, 218, 221, 
-    36, 3, 218, 184, 36, 3, 218, 183, 36, 3, 218, 199, 36, 3, 222, 31, 36, 3, 
-    219, 191, 36, 3, 219, 175, 36, 3, 218, 83, 36, 3, 218, 4, 36, 3, 221, 
-    181, 36, 3, 221, 170, 36, 3, 222, 17, 36, 3, 219, 58, 36, 3, 219, 40, 36, 
-    3, 221, 219, 36, 3, 242, 46, 36, 3, 241, 180, 36, 3, 241, 161, 36, 3, 
-    240, 222, 36, 3, 240, 202, 36, 3, 241, 238, 36, 3, 241, 220, 36, 3, 242, 
-    36, 36, 3, 241, 68, 36, 3, 241, 53, 36, 3, 241, 246, 36, 3, 233, 231, 36, 
-    3, 233, 230, 36, 3, 233, 225, 36, 3, 233, 224, 36, 3, 233, 221, 36, 3, 
-    233, 220, 36, 3, 233, 227, 36, 3, 233, 226, 36, 3, 233, 229, 36, 3, 233, 
-    223, 36, 3, 233, 222, 36, 3, 233, 228, 36, 3, 219, 231, 175, 116, 5, 211, 
-    68, 175, 116, 5, 223, 155, 175, 116, 5, 223, 78, 98, 1, 215, 28, 69, 116, 
-    5, 249, 233, 176, 69, 116, 5, 249, 233, 234, 132, 69, 116, 5, 249, 233, 
-    234, 28, 69, 116, 5, 249, 233, 234, 105, 69, 116, 5, 249, 233, 229, 4, 
-    69, 116, 5, 249, 233, 251, 33, 69, 116, 5, 249, 233, 250, 157, 69, 116, 
-    5, 249, 233, 249, 238, 69, 116, 5, 249, 233, 250, 86, 69, 116, 5, 249, 
-    233, 227, 134, 69, 116, 5, 249, 233, 248, 221, 69, 116, 5, 249, 233, 215, 
-    144, 69, 116, 5, 249, 233, 247, 145, 69, 116, 5, 249, 233, 215, 139, 69, 
-    116, 5, 249, 233, 197, 69, 116, 5, 249, 233, 217, 105, 69, 116, 5, 249, 
-    233, 216, 208, 69, 116, 5, 249, 233, 111, 69, 116, 5, 249, 233, 216, 156, 
-    69, 116, 5, 249, 233, 228, 74, 69, 116, 5, 249, 233, 252, 191, 69, 116, 
-    5, 249, 233, 225, 147, 69, 116, 5, 249, 233, 225, 16, 69, 116, 5, 249, 
-    233, 225, 121, 69, 116, 5, 249, 233, 230, 161, 69, 116, 5, 249, 233, 210, 
-    244, 69, 116, 5, 249, 233, 222, 211, 69, 116, 5, 249, 233, 232, 156, 69, 
-    116, 5, 249, 233, 213, 138, 69, 116, 5, 249, 233, 220, 102, 69, 116, 5, 
-    249, 233, 218, 223, 69, 116, 5, 249, 233, 206, 69, 116, 5, 249, 233, 162, 
-    69, 116, 5, 249, 233, 233, 135, 69, 25, 5, 249, 233, 224, 88, 69, 235, 
-    243, 25, 5, 249, 233, 224, 30, 69, 235, 243, 25, 5, 249, 233, 222, 100, 
-    69, 235, 243, 25, 5, 249, 233, 222, 93, 69, 235, 243, 25, 5, 249, 233, 
-    224, 69, 69, 25, 5, 226, 204, 69, 25, 5, 255, 34, 141, 1, 251, 255, 229, 
-    77, 141, 1, 251, 255, 229, 27, 141, 1, 251, 255, 228, 248, 141, 1, 251, 
-    255, 229, 64, 141, 1, 251, 255, 229, 4, 56, 1, 251, 255, 229, 77, 56, 1, 
-    251, 255, 229, 27, 56, 1, 251, 255, 228, 248, 56, 1, 251, 255, 229, 64, 
-    56, 1, 251, 255, 229, 4, 56, 1, 254, 194, 250, 190, 56, 1, 254, 194, 215, 
-    118, 56, 1, 254, 194, 111, 56, 1, 254, 194, 226, 105, 58, 1, 245, 20, 
-    245, 19, 249, 182, 138, 130, 58, 1, 245, 19, 245, 20, 249, 182, 138, 130, 
+    45, 108, 16, 31, 225, 128, 218, 45, 108, 16, 31, 85, 218, 45, 108, 16, 
+    31, 231, 60, 218, 72, 108, 16, 31, 231, 60, 218, 71, 108, 16, 31, 231, 
+    60, 218, 70, 108, 16, 31, 250, 46, 108, 16, 31, 222, 3, 108, 16, 31, 228, 
+    193, 108, 16, 31, 213, 141, 108, 16, 31, 213, 140, 108, 16, 31, 222, 206, 
+    222, 3, 108, 16, 31, 222, 206, 222, 2, 108, 16, 31, 242, 173, 108, 16, 
+    31, 219, 168, 108, 16, 31, 235, 184, 226, 157, 108, 16, 31, 235, 184, 
+    226, 156, 108, 16, 31, 249, 142, 64, 235, 183, 108, 16, 31, 223, 104, 64, 
+    235, 183, 108, 16, 31, 249, 176, 226, 157, 108, 16, 31, 235, 182, 226, 
+    157, 108, 16, 31, 218, 73, 64, 249, 175, 108, 16, 31, 249, 142, 64, 249, 
+    175, 108, 16, 31, 249, 142, 64, 249, 174, 108, 16, 31, 249, 176, 254, 91, 
+    108, 16, 31, 222, 4, 64, 249, 176, 254, 91, 108, 16, 31, 218, 73, 64, 
+    222, 4, 64, 249, 175, 108, 16, 31, 213, 243, 108, 16, 31, 216, 85, 226, 
+    157, 108, 16, 31, 233, 63, 226, 157, 108, 16, 31, 254, 90, 226, 157, 108, 
+    16, 31, 218, 73, 64, 254, 89, 108, 16, 31, 222, 4, 64, 254, 89, 108, 16, 
+    31, 218, 73, 64, 222, 4, 64, 254, 89, 108, 16, 31, 213, 158, 64, 254, 89, 
+    108, 16, 31, 223, 104, 64, 254, 89, 108, 16, 31, 223, 104, 64, 254, 88, 
+    108, 16, 31, 223, 103, 108, 16, 31, 223, 102, 108, 16, 31, 223, 101, 108, 
+    16, 31, 223, 100, 108, 16, 31, 254, 166, 108, 16, 31, 254, 165, 108, 16, 
+    31, 231, 168, 108, 16, 31, 222, 9, 108, 16, 31, 253, 254, 108, 16, 31, 
+    223, 128, 108, 16, 31, 223, 127, 108, 16, 31, 253, 191, 108, 16, 31, 251, 
+    237, 226, 157, 108, 16, 31, 217, 50, 108, 16, 31, 217, 49, 108, 16, 31, 
+    224, 11, 232, 228, 108, 16, 31, 251, 191, 108, 16, 31, 251, 190, 108, 16, 
+    31, 251, 189, 108, 16, 31, 254, 146, 108, 16, 31, 226, 222, 108, 16, 31, 
+    218, 250, 108, 16, 31, 216, 83, 108, 16, 31, 242, 103, 108, 16, 31, 212, 
+    28, 108, 16, 31, 224, 229, 108, 16, 31, 251, 22, 108, 16, 31, 215, 86, 
+    108, 16, 31, 250, 254, 230, 127, 108, 16, 31, 221, 204, 64, 235, 61, 108, 
+    16, 31, 251, 33, 108, 16, 31, 215, 220, 108, 16, 31, 218, 156, 215, 220, 
+    108, 16, 31, 232, 154, 108, 16, 31, 219, 58, 108, 16, 31, 214, 142, 108, 
+    16, 31, 240, 253, 246, 72, 108, 16, 31, 253, 235, 108, 16, 31, 224, 237, 
+    253, 235, 108, 16, 31, 251, 150, 108, 16, 31, 224, 228, 251, 150, 108, 
+    16, 31, 254, 143, 108, 16, 31, 218, 119, 218, 27, 218, 118, 108, 16, 31, 
+    218, 119, 218, 27, 218, 117, 108, 16, 31, 218, 69, 108, 16, 31, 224, 203, 
+    108, 16, 31, 247, 189, 108, 16, 31, 247, 191, 108, 16, 31, 247, 190, 108, 
+    16, 31, 224, 134, 108, 16, 31, 224, 123, 108, 16, 31, 249, 130, 108, 16, 
+    31, 249, 129, 108, 16, 31, 249, 128, 108, 16, 31, 249, 127, 108, 16, 31, 
+    249, 126, 108, 16, 31, 254, 178, 108, 16, 31, 252, 127, 64, 231, 154, 
+    108, 16, 31, 252, 127, 64, 214, 17, 108, 16, 31, 223, 60, 108, 16, 31, 
+    240, 245, 108, 16, 31, 228, 217, 108, 16, 31, 248, 153, 108, 16, 31, 230, 
+    139, 108, 16, 31, 163, 246, 102, 108, 16, 31, 163, 226, 136, 10, 14, 240, 
+    109, 10, 14, 240, 108, 10, 14, 240, 107, 10, 14, 240, 106, 10, 14, 240, 
+    105, 10, 14, 240, 104, 10, 14, 240, 103, 10, 14, 240, 102, 10, 14, 240, 
+    101, 10, 14, 240, 100, 10, 14, 240, 99, 10, 14, 240, 98, 10, 14, 240, 97, 
+    10, 14, 240, 96, 10, 14, 240, 95, 10, 14, 240, 94, 10, 14, 240, 93, 10, 
+    14, 240, 92, 10, 14, 240, 91, 10, 14, 240, 90, 10, 14, 240, 89, 10, 14, 
+    240, 88, 10, 14, 240, 87, 10, 14, 240, 86, 10, 14, 240, 85, 10, 14, 240, 
+    84, 10, 14, 240, 83, 10, 14, 240, 82, 10, 14, 240, 81, 10, 14, 240, 80, 
+    10, 14, 240, 79, 10, 14, 240, 78, 10, 14, 240, 77, 10, 14, 240, 76, 10, 
+    14, 240, 75, 10, 14, 240, 74, 10, 14, 240, 73, 10, 14, 240, 72, 10, 14, 
+    240, 71, 10, 14, 240, 70, 10, 14, 240, 69, 10, 14, 240, 68, 10, 14, 240, 
+    67, 10, 14, 240, 66, 10, 14, 240, 65, 10, 14, 240, 64, 10, 14, 240, 63, 
+    10, 14, 240, 62, 10, 14, 240, 61, 10, 14, 240, 60, 10, 14, 240, 59, 10, 
+    14, 240, 58, 10, 14, 240, 57, 10, 14, 240, 56, 10, 14, 240, 55, 10, 14, 
+    240, 54, 10, 14, 240, 53, 10, 14, 240, 52, 10, 14, 240, 51, 10, 14, 240, 
+    50, 10, 14, 240, 49, 10, 14, 240, 48, 10, 14, 240, 47, 10, 14, 240, 46, 
+    10, 14, 240, 45, 10, 14, 240, 44, 10, 14, 240, 43, 10, 14, 240, 42, 10, 
+    14, 240, 41, 10, 14, 240, 40, 10, 14, 240, 39, 10, 14, 240, 38, 10, 14, 
+    240, 37, 10, 14, 240, 36, 10, 14, 240, 35, 10, 14, 240, 34, 10, 14, 240, 
+    33, 10, 14, 240, 32, 10, 14, 240, 31, 10, 14, 240, 30, 10, 14, 240, 29, 
+    10, 14, 240, 28, 10, 14, 240, 27, 10, 14, 240, 26, 10, 14, 240, 25, 10, 
+    14, 240, 24, 10, 14, 240, 23, 10, 14, 240, 22, 10, 14, 240, 21, 10, 14, 
+    240, 20, 10, 14, 240, 19, 10, 14, 240, 18, 10, 14, 240, 17, 10, 14, 240, 
+    16, 10, 14, 240, 15, 10, 14, 240, 14, 10, 14, 240, 13, 10, 14, 240, 12, 
+    10, 14, 240, 11, 10, 14, 240, 10, 10, 14, 240, 9, 10, 14, 240, 8, 10, 14, 
+    240, 7, 10, 14, 240, 6, 10, 14, 240, 5, 10, 14, 240, 4, 10, 14, 240, 3, 
+    10, 14, 240, 2, 10, 14, 240, 1, 10, 14, 240, 0, 10, 14, 239, 255, 10, 14, 
+    239, 254, 10, 14, 239, 253, 10, 14, 239, 252, 10, 14, 239, 251, 10, 14, 
+    239, 250, 10, 14, 239, 249, 10, 14, 239, 248, 10, 14, 239, 247, 10, 14, 
+    239, 246, 10, 14, 239, 245, 10, 14, 239, 244, 10, 14, 239, 243, 10, 14, 
+    239, 242, 10, 14, 239, 241, 10, 14, 239, 240, 10, 14, 239, 239, 10, 14, 
+    239, 238, 10, 14, 239, 237, 10, 14, 239, 236, 10, 14, 239, 235, 10, 14, 
+    239, 234, 10, 14, 239, 233, 10, 14, 239, 232, 10, 14, 239, 231, 10, 14, 
+    239, 230, 10, 14, 239, 229, 10, 14, 239, 228, 10, 14, 239, 227, 10, 14, 
+    239, 226, 10, 14, 239, 225, 10, 14, 239, 224, 10, 14, 239, 223, 10, 14, 
+    239, 222, 10, 14, 239, 221, 10, 14, 239, 220, 10, 14, 239, 219, 10, 14, 
+    239, 218, 10, 14, 239, 217, 10, 14, 239, 216, 10, 14, 239, 215, 10, 14, 
+    239, 214, 10, 14, 239, 213, 10, 14, 239, 212, 10, 14, 239, 211, 10, 14, 
+    239, 210, 10, 14, 239, 209, 10, 14, 239, 208, 10, 14, 239, 207, 10, 14, 
+    239, 206, 10, 14, 239, 205, 10, 14, 239, 204, 10, 14, 239, 203, 10, 14, 
+    239, 202, 10, 14, 239, 201, 10, 14, 239, 200, 10, 14, 239, 199, 10, 14, 
+    239, 198, 10, 14, 239, 197, 10, 14, 239, 196, 10, 14, 239, 195, 10, 14, 
+    239, 194, 10, 14, 239, 193, 10, 14, 239, 192, 10, 14, 239, 191, 10, 14, 
+    239, 190, 10, 14, 239, 189, 10, 14, 239, 188, 10, 14, 239, 187, 10, 14, 
+    239, 186, 10, 14, 239, 185, 10, 14, 239, 184, 10, 14, 239, 183, 10, 14, 
+    239, 182, 10, 14, 239, 181, 10, 14, 239, 180, 10, 14, 239, 179, 10, 14, 
+    239, 178, 10, 14, 239, 177, 10, 14, 239, 176, 10, 14, 239, 175, 10, 14, 
+    239, 174, 10, 14, 239, 173, 10, 14, 239, 172, 10, 14, 239, 171, 10, 14, 
+    239, 170, 10, 14, 239, 169, 10, 14, 239, 168, 10, 14, 239, 167, 10, 14, 
+    239, 166, 10, 14, 239, 165, 10, 14, 239, 164, 10, 14, 239, 163, 10, 14, 
+    239, 162, 10, 14, 239, 161, 10, 14, 239, 160, 10, 14, 239, 159, 10, 14, 
+    239, 158, 10, 14, 239, 157, 10, 14, 239, 156, 10, 14, 239, 155, 10, 14, 
+    239, 154, 10, 14, 239, 153, 10, 14, 239, 152, 10, 14, 239, 151, 10, 14, 
+    239, 150, 10, 14, 239, 149, 10, 14, 239, 148, 10, 14, 239, 147, 10, 14, 
+    239, 146, 10, 14, 239, 145, 10, 14, 239, 144, 10, 14, 239, 143, 10, 14, 
+    239, 142, 10, 14, 239, 141, 10, 14, 239, 140, 10, 14, 239, 139, 10, 14, 
+    239, 138, 10, 14, 239, 137, 10, 14, 239, 136, 10, 14, 239, 135, 10, 14, 
+    239, 134, 10, 14, 239, 133, 10, 14, 239, 132, 10, 14, 239, 131, 10, 14, 
+    239, 130, 10, 14, 239, 129, 10, 14, 239, 128, 10, 14, 239, 127, 10, 14, 
+    239, 126, 10, 14, 239, 125, 10, 14, 239, 124, 10, 14, 239, 123, 10, 14, 
+    239, 122, 10, 14, 239, 121, 10, 14, 239, 120, 10, 14, 239, 119, 10, 14, 
+    239, 118, 10, 14, 239, 117, 10, 14, 239, 116, 10, 14, 239, 115, 10, 14, 
+    239, 114, 10, 14, 239, 113, 10, 14, 239, 112, 10, 14, 239, 111, 10, 14, 
+    239, 110, 10, 14, 239, 109, 10, 14, 239, 108, 10, 14, 239, 107, 10, 14, 
+    239, 106, 10, 14, 239, 105, 10, 14, 239, 104, 10, 14, 239, 103, 10, 14, 
+    239, 102, 10, 14, 239, 101, 10, 14, 239, 100, 10, 14, 239, 99, 10, 14, 
+    239, 98, 10, 14, 239, 97, 10, 14, 239, 96, 10, 14, 239, 95, 10, 14, 239, 
+    94, 10, 14, 239, 93, 10, 14, 239, 92, 10, 14, 239, 91, 10, 14, 239, 90, 
+    10, 14, 239, 89, 10, 14, 239, 88, 10, 14, 239, 87, 10, 14, 239, 86, 10, 
+    14, 239, 85, 10, 14, 239, 84, 10, 14, 239, 83, 10, 14, 239, 82, 10, 14, 
+    239, 81, 10, 14, 239, 80, 10, 14, 239, 79, 10, 14, 239, 78, 10, 14, 239, 
+    77, 10, 14, 239, 76, 10, 14, 239, 75, 10, 14, 239, 74, 10, 14, 239, 73, 
+    10, 14, 239, 72, 10, 14, 239, 71, 10, 14, 239, 70, 10, 14, 239, 69, 10, 
+    14, 239, 68, 10, 14, 239, 67, 10, 14, 239, 66, 10, 14, 239, 65, 10, 14, 
+    239, 64, 10, 14, 239, 63, 10, 14, 239, 62, 10, 14, 239, 61, 10, 14, 239, 
+    60, 10, 14, 239, 59, 10, 14, 239, 58, 10, 14, 239, 57, 10, 14, 239, 56, 
+    10, 14, 239, 55, 10, 14, 239, 54, 10, 14, 239, 53, 10, 14, 239, 52, 10, 
+    14, 239, 51, 10, 14, 239, 50, 10, 14, 239, 49, 10, 14, 239, 48, 10, 14, 
+    239, 47, 10, 14, 239, 46, 10, 14, 239, 45, 10, 14, 239, 44, 10, 14, 239, 
+    43, 10, 14, 239, 42, 10, 14, 239, 41, 10, 14, 239, 40, 10, 14, 239, 39, 
+    10, 14, 239, 38, 10, 14, 239, 37, 10, 14, 239, 36, 10, 14, 239, 35, 10, 
+    14, 239, 34, 10, 14, 239, 33, 10, 14, 239, 32, 10, 14, 239, 31, 10, 14, 
+    239, 30, 10, 14, 239, 29, 10, 14, 239, 28, 10, 14, 239, 27, 10, 14, 239, 
+    26, 10, 14, 239, 25, 10, 14, 239, 24, 10, 14, 239, 23, 10, 14, 239, 22, 
+    10, 14, 239, 21, 10, 14, 239, 20, 10, 14, 239, 19, 10, 14, 239, 18, 10, 
+    14, 239, 17, 10, 14, 239, 16, 10, 14, 239, 15, 10, 14, 239, 14, 10, 14, 
+    239, 13, 10, 14, 239, 12, 10, 14, 239, 11, 10, 14, 239, 10, 10, 14, 239, 
+    9, 10, 14, 239, 8, 10, 14, 239, 7, 10, 14, 239, 6, 10, 14, 239, 5, 10, 
+    14, 239, 4, 10, 14, 239, 3, 10, 14, 239, 2, 10, 14, 239, 1, 10, 14, 239, 
+    0, 10, 14, 238, 255, 10, 14, 238, 254, 10, 14, 238, 253, 10, 14, 238, 
+    252, 10, 14, 238, 251, 10, 14, 238, 250, 10, 14, 238, 249, 10, 14, 238, 
+    248, 10, 14, 238, 247, 10, 14, 238, 246, 10, 14, 238, 245, 10, 14, 238, 
+    244, 10, 14, 238, 243, 10, 14, 238, 242, 10, 14, 238, 241, 10, 14, 238, 
+    240, 10, 14, 238, 239, 10, 14, 238, 238, 10, 14, 238, 237, 10, 14, 238, 
+    236, 10, 14, 238, 235, 10, 14, 238, 234, 10, 14, 238, 233, 10, 14, 238, 
+    232, 10, 14, 238, 231, 10, 14, 238, 230, 10, 14, 238, 229, 10, 14, 238, 
+    228, 10, 14, 238, 227, 10, 14, 238, 226, 10, 14, 238, 225, 10, 14, 238, 
+    224, 10, 14, 238, 223, 10, 14, 238, 222, 10, 14, 238, 221, 10, 14, 238, 
+    220, 10, 14, 238, 219, 10, 14, 238, 218, 10, 14, 238, 217, 10, 14, 238, 
+    216, 10, 14, 238, 215, 10, 14, 238, 214, 10, 14, 238, 213, 10, 14, 238, 
+    212, 10, 14, 238, 211, 10, 14, 238, 210, 10, 14, 238, 209, 10, 14, 238, 
+    208, 10, 14, 238, 207, 10, 14, 238, 206, 10, 14, 238, 205, 10, 14, 238, 
+    204, 10, 14, 238, 203, 10, 14, 238, 202, 10, 14, 238, 201, 10, 14, 238, 
+    200, 10, 14, 238, 199, 10, 14, 238, 198, 10, 14, 238, 197, 10, 14, 238, 
+    196, 10, 14, 238, 195, 10, 14, 238, 194, 10, 14, 238, 193, 10, 14, 238, 
+    192, 10, 14, 238, 191, 10, 14, 238, 190, 10, 14, 238, 189, 10, 14, 238, 
+    188, 10, 14, 238, 187, 10, 14, 238, 186, 10, 14, 238, 185, 10, 14, 238, 
+    184, 10, 14, 238, 183, 10, 14, 238, 182, 10, 14, 238, 181, 10, 14, 238, 
+    180, 10, 14, 238, 179, 10, 14, 238, 178, 10, 14, 238, 177, 10, 14, 238, 
+    176, 10, 14, 238, 175, 10, 14, 238, 174, 10, 14, 238, 173, 10, 14, 238, 
+    172, 10, 14, 238, 171, 10, 14, 238, 170, 10, 14, 238, 169, 10, 14, 238, 
+    168, 10, 14, 238, 167, 10, 14, 238, 166, 10, 14, 238, 165, 10, 14, 238, 
+    164, 10, 14, 238, 163, 10, 14, 238, 162, 10, 14, 238, 161, 10, 14, 238, 
+    160, 10, 14, 238, 159, 10, 14, 238, 158, 10, 14, 238, 157, 10, 14, 238, 
+    156, 10, 14, 238, 155, 10, 14, 238, 154, 10, 14, 238, 153, 10, 14, 238, 
+    152, 10, 14, 238, 151, 10, 14, 238, 150, 10, 14, 238, 149, 10, 14, 238, 
+    148, 10, 14, 238, 147, 10, 14, 238, 146, 10, 14, 238, 145, 10, 14, 238, 
+    144, 10, 14, 238, 143, 10, 14, 238, 142, 10, 14, 238, 141, 10, 14, 238, 
+    140, 10, 14, 238, 139, 10, 14, 238, 138, 10, 14, 238, 137, 10, 14, 238, 
+    136, 10, 14, 238, 135, 10, 14, 238, 134, 10, 14, 238, 133, 10, 14, 238, 
+    132, 10, 14, 238, 131, 10, 14, 238, 130, 10, 14, 238, 129, 10, 14, 238, 
+    128, 10, 14, 238, 127, 10, 14, 238, 126, 10, 14, 238, 125, 10, 14, 238, 
+    124, 10, 14, 238, 123, 10, 14, 238, 122, 10, 14, 238, 121, 10, 14, 238, 
+    120, 10, 14, 238, 119, 10, 14, 238, 118, 10, 14, 238, 117, 10, 14, 238, 
+    116, 10, 14, 238, 115, 10, 14, 238, 114, 10, 14, 238, 113, 10, 14, 238, 
+    112, 10, 14, 238, 111, 10, 14, 238, 110, 10, 14, 238, 109, 10, 14, 238, 
+    108, 10, 14, 238, 107, 10, 14, 238, 106, 10, 14, 238, 105, 10, 14, 238, 
+    104, 10, 14, 238, 103, 10, 14, 238, 102, 10, 14, 238, 101, 10, 14, 238, 
+    100, 10, 14, 238, 99, 10, 14, 238, 98, 10, 14, 238, 97, 10, 14, 238, 96, 
+    10, 14, 238, 95, 10, 14, 238, 94, 10, 14, 238, 93, 10, 14, 238, 92, 10, 
+    14, 238, 91, 10, 14, 238, 90, 10, 14, 238, 89, 10, 14, 238, 88, 10, 14, 
+    238, 87, 10, 14, 238, 86, 10, 14, 238, 85, 10, 14, 238, 84, 10, 14, 238, 
+    83, 10, 14, 238, 82, 10, 14, 238, 81, 10, 14, 238, 80, 233, 96, 217, 85, 
+    129, 219, 20, 129, 245, 39, 79, 129, 224, 1, 79, 129, 54, 50, 129, 247, 
+    140, 50, 129, 225, 185, 50, 129, 254, 134, 129, 254, 65, 129, 43, 226, 7, 
+    129, 44, 226, 7, 129, 253, 224, 129, 96, 50, 129, 249, 227, 129, 240, 
+    174, 129, 243, 236, 218, 131, 129, 219, 48, 129, 21, 210, 86, 129, 21, 
+    111, 129, 21, 105, 129, 21, 158, 129, 21, 161, 129, 21, 190, 129, 21, 
+    195, 129, 21, 199, 129, 21, 196, 129, 21, 201, 129, 249, 234, 129, 220, 
+    152, 129, 233, 21, 50, 129, 245, 106, 50, 129, 242, 137, 50, 129, 224, 
+    16, 79, 129, 249, 225, 253, 214, 129, 7, 6, 1, 61, 129, 7, 6, 1, 253, 
+    166, 129, 7, 6, 1, 251, 74, 129, 7, 6, 1, 249, 68, 129, 7, 6, 1, 76, 129, 
+    7, 6, 1, 245, 14, 129, 7, 6, 1, 243, 209, 129, 7, 6, 1, 242, 67, 129, 7, 
+    6, 1, 74, 129, 7, 6, 1, 235, 150, 129, 7, 6, 1, 235, 29, 129, 7, 6, 1, 
+    156, 129, 7, 6, 1, 194, 129, 7, 6, 1, 230, 30, 129, 7, 6, 1, 78, 129, 7, 
+    6, 1, 226, 109, 129, 7, 6, 1, 224, 99, 129, 7, 6, 1, 153, 129, 7, 6, 1, 
+    222, 93, 129, 7, 6, 1, 217, 153, 129, 7, 6, 1, 69, 129, 7, 6, 1, 214, 
+    105, 129, 7, 6, 1, 212, 98, 129, 7, 6, 1, 211, 178, 129, 7, 6, 1, 211, 
+    117, 129, 7, 6, 1, 210, 159, 129, 43, 42, 127, 129, 223, 53, 219, 48, 
+    129, 44, 42, 127, 129, 250, 39, 255, 23, 129, 121, 232, 219, 129, 242, 
+    144, 255, 23, 129, 7, 4, 1, 61, 129, 7, 4, 1, 253, 166, 129, 7, 4, 1, 
+    251, 74, 129, 7, 4, 1, 249, 68, 129, 7, 4, 1, 76, 129, 7, 4, 1, 245, 14, 
+    129, 7, 4, 1, 243, 209, 129, 7, 4, 1, 242, 67, 129, 7, 4, 1, 74, 129, 7, 
+    4, 1, 235, 150, 129, 7, 4, 1, 235, 29, 129, 7, 4, 1, 156, 129, 7, 4, 1, 
+    194, 129, 7, 4, 1, 230, 30, 129, 7, 4, 1, 78, 129, 7, 4, 1, 226, 109, 
+    129, 7, 4, 1, 224, 99, 129, 7, 4, 1, 153, 129, 7, 4, 1, 222, 93, 129, 7, 
+    4, 1, 217, 153, 129, 7, 4, 1, 69, 129, 7, 4, 1, 214, 105, 129, 7, 4, 1, 
+    212, 98, 129, 7, 4, 1, 211, 178, 129, 7, 4, 1, 211, 117, 129, 7, 4, 1, 
+    210, 159, 129, 43, 249, 107, 127, 129, 67, 232, 219, 129, 44, 249, 107, 
+    127, 129, 184, 251, 14, 217, 85, 45, 221, 80, 45, 221, 69, 45, 221, 58, 
+    45, 221, 46, 45, 221, 35, 45, 221, 24, 45, 221, 13, 45, 221, 2, 45, 220, 
+    247, 45, 220, 239, 45, 220, 238, 45, 220, 237, 45, 220, 236, 45, 220, 
+    234, 45, 220, 233, 45, 220, 232, 45, 220, 231, 45, 220, 230, 45, 220, 
+    229, 45, 220, 228, 45, 220, 227, 45, 220, 226, 45, 220, 225, 45, 220, 
+    223, 45, 220, 222, 45, 220, 221, 45, 220, 220, 45, 220, 219, 45, 220, 
+    218, 45, 220, 217, 45, 220, 216, 45, 220, 215, 45, 220, 214, 45, 220, 
+    212, 45, 220, 211, 45, 220, 210, 45, 220, 209, 45, 220, 208, 45, 220, 
+    207, 45, 220, 206, 45, 220, 205, 45, 220, 204, 45, 220, 203, 45, 220, 
+    201, 45, 220, 200, 45, 220, 199, 45, 220, 198, 45, 220, 197, 45, 220, 
+    196, 45, 220, 195, 45, 220, 194, 45, 220, 193, 45, 220, 192, 45, 220, 
+    190, 45, 220, 189, 45, 220, 188, 45, 220, 187, 45, 220, 186, 45, 220, 
+    185, 45, 220, 184, 45, 220, 183, 45, 220, 182, 45, 220, 181, 45, 220, 
+    179, 45, 220, 178, 45, 220, 177, 45, 220, 176, 45, 220, 175, 45, 220, 
+    174, 45, 220, 173, 45, 220, 172, 45, 220, 171, 45, 220, 170, 45, 220, 
+    168, 45, 220, 167, 45, 220, 166, 45, 220, 165, 45, 220, 164, 45, 220, 
+    163, 45, 220, 162, 45, 220, 161, 45, 220, 160, 45, 220, 159, 45, 221, 
+    156, 45, 221, 155, 45, 221, 154, 45, 221, 153, 45, 221, 152, 45, 221, 
+    151, 45, 221, 150, 45, 221, 149, 45, 221, 148, 45, 221, 147, 45, 221, 
+    145, 45, 221, 144, 45, 221, 143, 45, 221, 142, 45, 221, 141, 45, 221, 
+    140, 45, 221, 139, 45, 221, 138, 45, 221, 137, 45, 221, 136, 45, 221, 
+    134, 45, 221, 133, 45, 221, 132, 45, 221, 131, 45, 221, 130, 45, 221, 
+    129, 45, 221, 128, 45, 221, 127, 45, 221, 126, 45, 221, 125, 45, 221, 
+    123, 45, 221, 122, 45, 221, 121, 45, 221, 120, 45, 221, 119, 45, 221, 
+    118, 45, 221, 117, 45, 221, 116, 45, 221, 115, 45, 221, 114, 45, 221, 
+    112, 45, 221, 111, 45, 221, 110, 45, 221, 109, 45, 221, 108, 45, 221, 
+    107, 45, 221, 106, 45, 221, 105, 45, 221, 104, 45, 221, 103, 45, 221, 
+    101, 45, 221, 100, 45, 221, 99, 45, 221, 98, 45, 221, 97, 45, 221, 96, 
+    45, 221, 95, 45, 221, 94, 45, 221, 93, 45, 221, 92, 45, 221, 90, 45, 221, 
+    89, 45, 221, 88, 45, 221, 87, 45, 221, 86, 45, 221, 85, 45, 221, 84, 45, 
+    221, 83, 45, 221, 82, 45, 221, 81, 45, 221, 79, 45, 221, 78, 45, 221, 77, 
+    45, 221, 76, 45, 221, 75, 45, 221, 74, 45, 221, 73, 45, 221, 72, 45, 221, 
+    71, 45, 221, 70, 45, 221, 68, 45, 221, 67, 45, 221, 66, 45, 221, 65, 45, 
+    221, 64, 45, 221, 63, 45, 221, 62, 45, 221, 61, 45, 221, 60, 45, 221, 59, 
+    45, 221, 57, 45, 221, 56, 45, 221, 55, 45, 221, 54, 45, 221, 53, 45, 221, 
+    52, 45, 221, 51, 45, 221, 50, 45, 221, 49, 45, 221, 48, 45, 221, 45, 45, 
+    221, 44, 45, 221, 43, 45, 221, 42, 45, 221, 41, 45, 221, 40, 45, 221, 39, 
+    45, 221, 38, 45, 221, 37, 45, 221, 36, 45, 221, 34, 45, 221, 33, 45, 221, 
+    32, 45, 221, 31, 45, 221, 30, 45, 221, 29, 45, 221, 28, 45, 221, 27, 45, 
+    221, 26, 45, 221, 25, 45, 221, 23, 45, 221, 22, 45, 221, 21, 45, 221, 20, 
+    45, 221, 19, 45, 221, 18, 45, 221, 17, 45, 221, 16, 45, 221, 15, 45, 221, 
+    14, 45, 221, 12, 45, 221, 11, 45, 221, 10, 45, 221, 9, 45, 221, 8, 45, 
+    221, 7, 45, 221, 6, 45, 221, 5, 45, 221, 4, 45, 221, 3, 45, 221, 1, 45, 
+    221, 0, 45, 220, 255, 45, 220, 254, 45, 220, 253, 45, 220, 252, 45, 220, 
+    251, 45, 220, 250, 45, 220, 249, 45, 220, 248, 45, 220, 246, 45, 220, 
+    245, 45, 220, 244, 45, 220, 243, 45, 220, 242, 45, 220, 241, 45, 220, 
+    240, 227, 206, 227, 208, 218, 154, 64, 241, 240, 219, 50, 218, 154, 64, 
+    216, 213, 218, 86, 245, 151, 64, 216, 213, 245, 64, 245, 151, 64, 215, 
+    244, 245, 117, 245, 140, 245, 141, 255, 16, 255, 17, 254, 176, 252, 55, 
+    252, 187, 251, 139, 135, 217, 90, 203, 217, 90, 240, 234, 217, 94, 232, 
+    220, 244, 153, 166, 232, 219, 245, 151, 64, 232, 219, 233, 6, 228, 140, 
+    245, 120, 232, 220, 217, 90, 67, 217, 90, 212, 118, 244, 28, 244, 153, 
+    244, 133, 250, 238, 223, 56, 249, 151, 220, 30, 226, 134, 232, 156, 111, 
+    219, 60, 220, 30, 236, 6, 232, 156, 210, 86, 219, 193, 248, 159, 232, 
+    210, 245, 85, 247, 163, 248, 39, 249, 186, 111, 248, 149, 248, 39, 249, 
+    186, 105, 248, 148, 248, 39, 249, 186, 158, 248, 147, 248, 39, 249, 186, 
+    161, 248, 146, 152, 255, 16, 229, 214, 217, 178, 236, 69, 217, 181, 245, 
+    151, 64, 215, 245, 251, 221, 245, 70, 251, 13, 251, 15, 245, 151, 64, 
+    231, 86, 245, 118, 218, 62, 218, 79, 245, 85, 245, 86, 235, 239, 220, 
+    140, 161, 244, 115, 220, 139, 243, 245, 235, 239, 220, 140, 158, 242, 
+    128, 220, 139, 242, 125, 235, 239, 220, 140, 105, 223, 124, 220, 139, 
+    222, 147, 235, 239, 220, 140, 111, 214, 174, 220, 139, 214, 133, 219, 23, 
+    248, 71, 248, 73, 226, 82, 250, 150, 226, 84, 125, 226, 244, 224, 196, 
+    241, 54, 251, 158, 225, 176, 241, 210, 251, 169, 228, 80, 251, 158, 241, 
+    210, 229, 180, 235, 249, 235, 251, 229, 87, 232, 219, 229, 104, 218, 154, 
+    64, 221, 160, 254, 26, 218, 225, 245, 151, 64, 221, 160, 254, 26, 245, 
+    88, 135, 217, 91, 220, 129, 203, 217, 91, 220, 129, 240, 231, 135, 217, 
+    91, 2, 235, 41, 203, 217, 91, 2, 235, 41, 240, 232, 232, 220, 217, 91, 
+    220, 129, 67, 217, 91, 220, 129, 212, 117, 226, 1, 232, 220, 244, 22, 
+    226, 1, 232, 220, 246, 114, 225, 35, 226, 1, 232, 220, 252, 186, 226, 1, 
+    232, 220, 214, 163, 225, 31, 223, 53, 232, 220, 244, 153, 223, 53, 235, 
+    249, 223, 38, 219, 157, 220, 30, 105, 219, 154, 218, 227, 219, 157, 220, 
+    30, 158, 219, 153, 218, 226, 248, 39, 249, 186, 218, 107, 248, 145, 224, 
+    186, 214, 132, 111, 224, 186, 214, 130, 224, 152, 224, 186, 214, 132, 
+    105, 224, 186, 214, 129, 224, 151, 220, 130, 215, 243, 218, 153, 218, 90, 
+    251, 14, 250, 150, 250, 217, 231, 48, 212, 59, 230, 48, 218, 154, 64, 
+    242, 114, 254, 26, 218, 154, 64, 224, 169, 254, 26, 219, 22, 245, 151, 
+    64, 242, 114, 254, 26, 245, 151, 64, 224, 169, 254, 26, 245, 115, 218, 
+    154, 64, 218, 107, 219, 37, 219, 157, 242, 148, 135, 235, 202, 220, 109, 
+    219, 157, 135, 235, 202, 221, 196, 249, 186, 220, 137, 235, 202, 249, 
+    121, 218, 108, 216, 237, 218, 170, 226, 173, 217, 168, 249, 226, 226, 
+    146, 224, 187, 231, 47, 225, 22, 254, 61, 224, 181, 249, 226, 254, 77, 
+    229, 168, 219, 202, 7, 6, 1, 243, 0, 7, 4, 1, 243, 0, 250, 167, 254, 157, 
+    183, 218, 68, 249, 235, 219, 108, 233, 52, 165, 1, 232, 181, 209, 209, 1, 
+    244, 52, 244, 44, 209, 209, 1, 244, 52, 244, 165, 209, 209, 1, 222, 213, 
+    209, 209, 1, 232, 162, 63, 164, 251, 231, 220, 5, 242, 222, 230, 253, 
+    223, 44, 243, 223, 243, 222, 243, 221, 230, 50, 209, 251, 209, 252, 209, 
+    254, 232, 107, 222, 221, 232, 109, 222, 223, 225, 227, 232, 106, 222, 
+    220, 228, 111, 230, 170, 211, 229, 232, 108, 222, 222, 243, 244, 225, 
+    226, 212, 15, 245, 170, 243, 233, 230, 234, 226, 201, 214, 134, 87, 230, 
+    234, 248, 165, 87, 8, 3, 235, 164, 79, 224, 197, 244, 28, 31, 67, 44, 71, 
+    233, 26, 127, 213, 118, 213, 7, 212, 195, 212, 184, 212, 173, 212, 162, 
+    212, 151, 212, 140, 212, 129, 213, 117, 213, 106, 213, 95, 213, 84, 213, 
+    73, 213, 62, 213, 51, 251, 79, 226, 159, 79, 251, 204, 209, 253, 15, 5, 
+    227, 215, 216, 240, 15, 5, 227, 215, 115, 227, 215, 251, 107, 115, 251, 
+    106, 49, 28, 16, 243, 243, 219, 104, 250, 81, 214, 9, 213, 40, 213, 29, 
+    213, 18, 213, 6, 212, 251, 212, 240, 212, 229, 212, 218, 212, 207, 212, 
+    199, 212, 198, 212, 197, 212, 196, 212, 194, 212, 193, 212, 192, 212, 
+    191, 212, 190, 212, 189, 212, 188, 212, 187, 212, 186, 212, 185, 212, 
+    183, 212, 182, 212, 181, 212, 180, 212, 179, 212, 178, 212, 177, 212, 
+    176, 212, 175, 212, 174, 212, 172, 212, 171, 212, 170, 212, 169, 212, 
+    168, 212, 167, 212, 166, 212, 165, 212, 164, 212, 163, 212, 161, 212, 
+    160, 212, 159, 212, 158, 212, 157, 212, 156, 212, 155, 212, 154, 212, 
+    153, 212, 152, 212, 150, 212, 149, 212, 148, 212, 147, 212, 146, 212, 
+    145, 212, 144, 212, 143, 212, 142, 212, 141, 212, 139, 212, 138, 212, 
+    137, 212, 136, 212, 135, 212, 134, 212, 133, 212, 132, 212, 131, 212, 
+    130, 212, 128, 212, 127, 212, 126, 212, 125, 212, 124, 212, 123, 212, 
+    122, 212, 121, 212, 120, 212, 119, 213, 116, 213, 115, 213, 114, 213, 
+    113, 213, 112, 213, 111, 213, 110, 213, 109, 213, 108, 213, 107, 213, 
+    105, 213, 104, 213, 103, 213, 102, 213, 101, 213, 100, 213, 99, 213, 98, 
+    213, 97, 213, 96, 213, 94, 213, 93, 213, 92, 213, 91, 213, 90, 213, 89, 
+    213, 88, 213, 87, 213, 86, 213, 85, 213, 83, 213, 82, 213, 81, 213, 80, 
+    213, 79, 213, 78, 213, 77, 213, 76, 213, 75, 213, 74, 213, 72, 213, 71, 
+    213, 70, 213, 69, 213, 68, 213, 67, 213, 66, 213, 65, 213, 64, 213, 63, 
+    213, 61, 213, 60, 213, 59, 213, 58, 213, 57, 213, 56, 213, 55, 213, 54, 
+    213, 53, 213, 52, 213, 50, 213, 49, 213, 48, 213, 47, 213, 46, 213, 45, 
+    213, 44, 213, 43, 213, 42, 213, 41, 213, 39, 213, 38, 213, 37, 213, 36, 
+    213, 35, 213, 34, 213, 33, 213, 32, 213, 31, 213, 30, 213, 28, 213, 27, 
+    213, 26, 213, 25, 213, 24, 213, 23, 213, 22, 213, 21, 213, 20, 213, 19, 
+    213, 17, 213, 16, 213, 15, 213, 14, 213, 13, 213, 12, 213, 11, 213, 10, 
+    213, 9, 213, 8, 213, 5, 213, 4, 213, 3, 213, 2, 213, 1, 213, 0, 212, 255, 
+    212, 254, 212, 253, 212, 252, 212, 250, 212, 249, 212, 248, 212, 247, 
+    212, 246, 212, 245, 212, 244, 212, 243, 212, 242, 212, 241, 212, 239, 
+    212, 238, 212, 237, 212, 236, 212, 235, 212, 234, 212, 233, 212, 232, 
+    212, 231, 212, 230, 212, 228, 212, 227, 212, 226, 212, 225, 212, 224, 
+    212, 223, 212, 222, 212, 221, 212, 220, 212, 219, 212, 217, 212, 216, 
+    212, 215, 212, 214, 212, 213, 212, 212, 212, 211, 212, 210, 212, 209, 
+    212, 208, 212, 206, 212, 205, 212, 204, 212, 203, 212, 202, 212, 201, 
+    212, 200, 7, 6, 1, 116, 2, 231, 238, 22, 242, 143, 7, 4, 1, 116, 2, 231, 
+    238, 22, 242, 143, 7, 6, 1, 160, 2, 67, 232, 220, 51, 7, 4, 1, 160, 2, 
+    67, 232, 220, 51, 7, 6, 1, 160, 2, 67, 232, 220, 252, 51, 22, 242, 143, 
+    7, 4, 1, 160, 2, 67, 232, 220, 252, 51, 22, 242, 143, 7, 6, 1, 160, 2, 
+    67, 232, 220, 252, 51, 22, 142, 7, 4, 1, 160, 2, 67, 232, 220, 252, 51, 
+    22, 142, 7, 6, 1, 160, 2, 250, 39, 22, 231, 237, 7, 4, 1, 160, 2, 250, 
+    39, 22, 231, 237, 7, 6, 1, 160, 2, 250, 39, 22, 250, 242, 7, 4, 1, 160, 
+    2, 250, 39, 22, 250, 242, 7, 6, 1, 240, 161, 2, 231, 238, 22, 242, 143, 
+    7, 4, 1, 240, 161, 2, 231, 238, 22, 242, 143, 7, 4, 1, 240, 161, 2, 59, 
+    72, 22, 142, 7, 4, 1, 229, 85, 2, 216, 90, 48, 7, 6, 1, 144, 2, 67, 232, 
+    220, 51, 7, 4, 1, 144, 2, 67, 232, 220, 51, 7, 6, 1, 144, 2, 67, 232, 
+    220, 252, 51, 22, 242, 143, 7, 4, 1, 144, 2, 67, 232, 220, 252, 51, 22, 
+    242, 143, 7, 6, 1, 144, 2, 67, 232, 220, 252, 51, 22, 142, 7, 4, 1, 144, 
+    2, 67, 232, 220, 252, 51, 22, 142, 7, 6, 1, 222, 94, 2, 67, 232, 220, 51, 
+    7, 4, 1, 222, 94, 2, 67, 232, 220, 51, 7, 6, 1, 104, 2, 231, 238, 22, 
+    242, 143, 7, 4, 1, 104, 2, 231, 238, 22, 242, 143, 7, 6, 1, 116, 2, 226, 
+    229, 22, 142, 7, 4, 1, 116, 2, 226, 229, 22, 142, 7, 6, 1, 116, 2, 226, 
+    229, 22, 184, 7, 4, 1, 116, 2, 226, 229, 22, 184, 7, 6, 1, 160, 2, 226, 
+    229, 22, 142, 7, 4, 1, 160, 2, 226, 229, 22, 142, 7, 6, 1, 160, 2, 226, 
+    229, 22, 184, 7, 4, 1, 160, 2, 226, 229, 22, 184, 7, 6, 1, 160, 2, 59, 
+    72, 22, 142, 7, 4, 1, 160, 2, 59, 72, 22, 142, 7, 6, 1, 160, 2, 59, 72, 
+    22, 184, 7, 4, 1, 160, 2, 59, 72, 22, 184, 7, 4, 1, 240, 161, 2, 59, 72, 
+    22, 242, 143, 7, 4, 1, 240, 161, 2, 59, 72, 22, 184, 7, 6, 1, 240, 161, 
+    2, 226, 229, 22, 142, 7, 4, 1, 240, 161, 2, 226, 229, 22, 59, 72, 22, 
+    142, 7, 6, 1, 240, 161, 2, 226, 229, 22, 184, 7, 4, 1, 240, 161, 2, 226, 
+    229, 22, 59, 72, 22, 184, 7, 6, 1, 235, 151, 2, 184, 7, 4, 1, 235, 151, 
+    2, 59, 72, 22, 184, 7, 6, 1, 233, 155, 2, 184, 7, 4, 1, 233, 155, 2, 184, 
+    7, 6, 1, 232, 55, 2, 184, 7, 4, 1, 232, 55, 2, 184, 7, 6, 1, 223, 227, 2, 
+    184, 7, 4, 1, 223, 227, 2, 184, 7, 6, 1, 104, 2, 226, 229, 22, 142, 7, 4, 
+    1, 104, 2, 226, 229, 22, 142, 7, 6, 1, 104, 2, 226, 229, 22, 184, 7, 4, 
+    1, 104, 2, 226, 229, 22, 184, 7, 6, 1, 104, 2, 231, 238, 22, 142, 7, 4, 
+    1, 104, 2, 231, 238, 22, 142, 7, 6, 1, 104, 2, 231, 238, 22, 184, 7, 4, 
+    1, 104, 2, 231, 238, 22, 184, 7, 4, 1, 254, 253, 2, 242, 143, 7, 4, 1, 
+    204, 144, 2, 242, 143, 7, 4, 1, 204, 144, 2, 142, 7, 4, 1, 215, 94, 214, 
+    106, 2, 242, 143, 7, 4, 1, 215, 94, 214, 106, 2, 142, 7, 4, 1, 221, 198, 
+    2, 242, 143, 7, 4, 1, 221, 198, 2, 142, 7, 4, 1, 241, 58, 221, 198, 2, 
+    242, 143, 7, 4, 1, 241, 58, 221, 198, 2, 142, 9, 220, 137, 77, 2, 182, 
+    72, 2, 254, 179, 9, 220, 137, 77, 2, 182, 72, 2, 212, 30, 9, 220, 137, 
+    77, 2, 182, 72, 2, 109, 231, 197, 9, 220, 137, 77, 2, 182, 72, 2, 226, 
+    238, 9, 220, 137, 77, 2, 182, 72, 2, 69, 9, 220, 137, 77, 2, 182, 72, 2, 
+    210, 212, 9, 220, 137, 77, 2, 182, 72, 2, 76, 9, 220, 137, 77, 2, 182, 
+    72, 2, 254, 252, 9, 220, 137, 228, 68, 2, 234, 180, 146, 1, 234, 115, 36, 
+    117, 235, 29, 36, 117, 229, 84, 36, 117, 251, 74, 36, 117, 227, 171, 36, 
+    117, 215, 160, 36, 117, 228, 116, 36, 117, 217, 153, 36, 117, 230, 30, 
+    36, 117, 226, 109, 36, 117, 194, 36, 117, 211, 117, 36, 117, 153, 36, 
+    117, 156, 36, 117, 214, 105, 36, 117, 232, 182, 36, 117, 232, 191, 36, 
+    117, 222, 182, 36, 117, 228, 98, 36, 117, 235, 150, 36, 117, 220, 106, 
+    36, 117, 218, 228, 36, 117, 222, 93, 36, 117, 242, 67, 36, 117, 233, 238, 
+    36, 3, 235, 16, 36, 3, 234, 98, 36, 3, 234, 89, 36, 3, 233, 223, 36, 3, 
+    233, 194, 36, 3, 234, 188, 36, 3, 234, 187, 36, 3, 234, 252, 36, 3, 234, 
+    34, 36, 3, 234, 16, 36, 3, 234, 201, 36, 3, 229, 81, 36, 3, 229, 32, 36, 
+    3, 229, 28, 36, 3, 228, 253, 36, 3, 228, 246, 36, 3, 229, 69, 36, 3, 229, 
+    67, 36, 3, 229, 78, 36, 3, 229, 9, 36, 3, 229, 4, 36, 3, 229, 71, 36, 3, 
+    251, 40, 36, 3, 250, 59, 36, 3, 250, 49, 36, 3, 249, 120, 36, 3, 249, 91, 
+    36, 3, 250, 198, 36, 3, 250, 190, 36, 3, 251, 30, 36, 3, 249, 246, 36, 3, 
+    249, 182, 36, 3, 250, 230, 36, 3, 227, 168, 36, 3, 227, 152, 36, 3, 227, 
+    147, 36, 3, 227, 132, 36, 3, 227, 125, 36, 3, 227, 160, 36, 3, 227, 159, 
+    36, 3, 227, 165, 36, 3, 227, 138, 36, 3, 227, 136, 36, 3, 227, 163, 36, 
+    3, 215, 156, 36, 3, 215, 136, 36, 3, 215, 135, 36, 3, 215, 124, 36, 3, 
+    215, 121, 36, 3, 215, 152, 36, 3, 215, 151, 36, 3, 215, 155, 36, 3, 215, 
+    134, 36, 3, 215, 133, 36, 3, 215, 154, 36, 3, 228, 114, 36, 3, 228, 100, 
+    36, 3, 228, 99, 36, 3, 228, 83, 36, 3, 228, 82, 36, 3, 228, 110, 36, 3, 
+    228, 109, 36, 3, 228, 113, 36, 3, 228, 85, 36, 3, 228, 84, 36, 3, 228, 
+    112, 36, 3, 217, 102, 36, 3, 216, 118, 36, 3, 216, 104, 36, 3, 215, 119, 
+    36, 3, 215, 85, 36, 3, 217, 23, 36, 3, 217, 12, 36, 3, 217, 80, 36, 3, 
+    112, 36, 3, 216, 18, 36, 3, 217, 42, 36, 3, 229, 230, 36, 3, 228, 238, 
+    36, 3, 228, 213, 36, 3, 227, 242, 36, 3, 227, 183, 36, 3, 229, 112, 36, 
+    3, 229, 108, 36, 3, 229, 217, 36, 3, 228, 79, 36, 3, 228, 69, 36, 3, 229, 
+    192, 36, 3, 226, 93, 36, 3, 225, 111, 36, 3, 225, 74, 36, 3, 224, 153, 
+    36, 3, 224, 122, 36, 3, 225, 224, 36, 3, 225, 214, 36, 3, 226, 75, 36, 3, 
+    225, 19, 36, 3, 224, 252, 36, 3, 225, 238, 36, 3, 231, 242, 36, 3, 230, 
+    235, 36, 3, 230, 206, 36, 3, 230, 107, 36, 3, 230, 59, 36, 3, 231, 96, 
+    36, 3, 231, 85, 36, 3, 231, 208, 36, 3, 230, 166, 36, 3, 230, 137, 36, 3, 
+    231, 140, 36, 3, 211, 103, 36, 3, 211, 8, 36, 3, 210, 255, 36, 3, 210, 
+    212, 36, 3, 210, 181, 36, 3, 211, 47, 36, 3, 211, 44, 36, 3, 211, 82, 36, 
+    3, 210, 244, 36, 3, 210, 229, 36, 3, 211, 55, 36, 3, 223, 187, 36, 3, 
+    223, 38, 36, 3, 222, 242, 36, 3, 222, 142, 36, 3, 222, 114, 36, 3, 223, 
+    131, 36, 3, 223, 111, 36, 3, 223, 169, 36, 3, 222, 213, 36, 3, 222, 199, 
+    36, 3, 223, 139, 36, 3, 233, 140, 36, 3, 232, 247, 36, 3, 232, 233, 36, 
+    3, 232, 103, 36, 3, 232, 78, 36, 3, 233, 64, 36, 3, 233, 56, 36, 3, 233, 
+    115, 36, 3, 232, 162, 36, 3, 232, 133, 36, 3, 233, 80, 36, 3, 214, 26, 
+    36, 3, 213, 176, 36, 3, 213, 162, 36, 3, 212, 116, 36, 3, 212, 109, 36, 
+    3, 213, 255, 36, 3, 213, 250, 36, 3, 214, 23, 36, 3, 213, 138, 36, 3, 
+    213, 127, 36, 3, 214, 5, 36, 3, 232, 180, 36, 3, 232, 175, 36, 3, 232, 
+    174, 36, 3, 232, 171, 36, 3, 232, 170, 36, 3, 232, 177, 36, 3, 232, 176, 
+    36, 3, 232, 179, 36, 3, 232, 173, 36, 3, 232, 172, 36, 3, 232, 178, 36, 
+    3, 232, 189, 36, 3, 232, 184, 36, 3, 232, 183, 36, 3, 232, 167, 36, 3, 
+    232, 166, 36, 3, 232, 186, 36, 3, 232, 185, 36, 3, 232, 188, 36, 3, 232, 
+    169, 36, 3, 232, 168, 36, 3, 232, 187, 36, 3, 222, 180, 36, 3, 222, 169, 
+    36, 3, 222, 168, 36, 3, 222, 162, 36, 3, 222, 155, 36, 3, 222, 176, 36, 
+    3, 222, 175, 36, 3, 222, 179, 36, 3, 222, 167, 36, 3, 222, 166, 36, 3, 
+    222, 178, 36, 3, 228, 96, 36, 3, 228, 91, 36, 3, 228, 90, 36, 3, 228, 87, 
+    36, 3, 228, 86, 36, 3, 228, 93, 36, 3, 228, 92, 36, 3, 228, 95, 36, 3, 
+    228, 89, 36, 3, 228, 88, 36, 3, 228, 94, 36, 3, 235, 146, 36, 3, 235, 
+    114, 36, 3, 235, 107, 36, 3, 235, 57, 36, 3, 235, 39, 36, 3, 235, 132, 
+    36, 3, 235, 130, 36, 3, 235, 141, 36, 3, 235, 74, 36, 3, 235, 65, 36, 3, 
+    235, 135, 36, 3, 220, 100, 36, 3, 220, 34, 36, 3, 220, 29, 36, 3, 219, 
+    227, 36, 3, 219, 212, 36, 3, 220, 65, 36, 3, 220, 63, 36, 3, 220, 92, 36, 
+    3, 220, 9, 36, 3, 220, 3, 36, 3, 220, 73, 36, 3, 218, 224, 36, 3, 218, 
+    194, 36, 3, 218, 190, 36, 3, 218, 181, 36, 3, 218, 178, 36, 3, 218, 199, 
+    36, 3, 218, 198, 36, 3, 218, 223, 36, 3, 218, 186, 36, 3, 218, 185, 36, 
+    3, 218, 201, 36, 3, 222, 33, 36, 3, 219, 193, 36, 3, 219, 177, 36, 3, 
+    218, 84, 36, 3, 218, 5, 36, 3, 221, 183, 36, 3, 221, 172, 36, 3, 222, 19, 
+    36, 3, 219, 60, 36, 3, 219, 42, 36, 3, 221, 221, 36, 3, 242, 53, 36, 3, 
+    241, 187, 36, 3, 241, 168, 36, 3, 240, 229, 36, 3, 240, 209, 36, 3, 241, 
+    245, 36, 3, 241, 227, 36, 3, 242, 43, 36, 3, 241, 75, 36, 3, 241, 60, 36, 
+    3, 241, 253, 36, 3, 233, 237, 36, 3, 233, 236, 36, 3, 233, 231, 36, 3, 
+    233, 230, 36, 3, 233, 227, 36, 3, 233, 226, 36, 3, 233, 233, 36, 3, 233, 
+    232, 36, 3, 233, 235, 36, 3, 233, 229, 36, 3, 233, 228, 36, 3, 233, 234, 
+    36, 3, 219, 233, 175, 117, 5, 211, 68, 175, 117, 5, 223, 158, 175, 117, 
+    5, 223, 81, 98, 1, 215, 28, 70, 117, 5, 249, 241, 176, 70, 117, 5, 249, 
+    241, 234, 138, 70, 117, 5, 249, 241, 234, 34, 70, 117, 5, 249, 241, 234, 
+    111, 70, 117, 5, 249, 241, 229, 9, 70, 117, 5, 249, 241, 251, 41, 70, 
+    117, 5, 249, 241, 250, 165, 70, 117, 5, 249, 241, 249, 246, 70, 117, 5, 
+    249, 241, 250, 94, 70, 117, 5, 249, 241, 227, 138, 70, 117, 5, 249, 241, 
+    248, 229, 70, 117, 5, 249, 241, 215, 145, 70, 117, 5, 249, 241, 247, 153, 
+    70, 117, 5, 249, 241, 215, 140, 70, 117, 5, 249, 241, 198, 70, 117, 5, 
+    249, 241, 217, 106, 70, 117, 5, 249, 241, 216, 209, 70, 117, 5, 249, 241, 
+    112, 70, 117, 5, 249, 241, 216, 157, 70, 117, 5, 249, 241, 228, 79, 70, 
+    117, 5, 249, 241, 252, 199, 70, 117, 5, 249, 241, 225, 150, 70, 117, 5, 
+    249, 241, 225, 19, 70, 117, 5, 249, 241, 225, 124, 70, 117, 5, 249, 241, 
+    230, 166, 70, 117, 5, 249, 241, 210, 244, 70, 117, 5, 249, 241, 222, 213, 
+    70, 117, 5, 249, 241, 232, 162, 70, 117, 5, 249, 241, 213, 138, 70, 117, 
+    5, 249, 241, 220, 104, 70, 117, 5, 249, 241, 218, 225, 70, 117, 5, 249, 
+    241, 206, 70, 117, 5, 249, 241, 162, 70, 117, 5, 249, 241, 233, 141, 70, 
+    25, 5, 249, 241, 224, 91, 70, 235, 250, 25, 5, 249, 241, 224, 33, 70, 
+    235, 250, 25, 5, 249, 241, 222, 102, 70, 235, 250, 25, 5, 249, 241, 222, 
+    95, 70, 235, 250, 25, 5, 249, 241, 224, 72, 70, 25, 5, 226, 208, 70, 25, 
+    5, 255, 43, 141, 1, 252, 7, 229, 82, 141, 1, 252, 7, 229, 32, 141, 1, 
+    252, 7, 228, 253, 141, 1, 252, 7, 229, 69, 141, 1, 252, 7, 229, 9, 56, 1, 
+    252, 7, 229, 82, 56, 1, 252, 7, 229, 32, 56, 1, 252, 7, 228, 253, 56, 1, 
+    252, 7, 229, 69, 56, 1, 252, 7, 229, 9, 56, 1, 254, 203, 250, 198, 56, 1, 
+    254, 203, 215, 119, 56, 1, 254, 203, 112, 56, 1, 254, 203, 226, 109, 58, 
+    1, 245, 28, 245, 27, 249, 190, 138, 130, 58, 1, 245, 27, 245, 28, 249, 
+    190, 138, 130, 
 };
 
 static unsigned char phrasebook_offset1[] = {
@@ -14431,2451 +14448,2451 @@
     8647, 0, 0, 0, 0, 0, 8651, 8658, 8666, 8673, 8678, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 8683, 8686, 8690, 8695, 8699, 0, 8703, 8709, 8715, 8718, 
     8725, 8734, 8737, 8740, 8745, 8751, 8755, 8763, 8769, 8775, 8783, 8787, 
-    8792, 8803, 8808, 8812, 8816, 8820, 0, 0, 8823, 8830, 8834, 8840, 8844, 
-    8851, 8857, 8864, 8870, 8876, 8880, 8884, 8890, 8894, 8898, 8902, 8906, 
-    8910, 8914, 8918, 8922, 8926, 8930, 8934, 8938, 8942, 8946, 8950, 8954, 
-    8958, 8966, 8974, 8984, 8993, 9002, 9005, 9009, 9013, 9017, 9021, 9025, 
-    9029, 9033, 9037, 9042, 9046, 9049, 9052, 9055, 9058, 9061, 9064, 9067, 
-    9070, 9074, 9077, 9080, 9085, 9090, 9096, 9099, 9106, 9115, 9120, 9125, 
-    9132, 9137, 9142, 9146, 9150, 9154, 9158, 9162, 9166, 9170, 9174, 9178, 
-    9182, 9187, 9192, 9199, 9205, 9211, 9217, 9222, 9230, 9238, 9243, 9249, 
-    9255, 9261, 9267, 9271, 9275, 9279, 9286, 9296, 9300, 9304, 9308, 9314, 
-    9322, 9326, 9330, 9337, 9341, 9345, 9349, 9356, 9363, 9375, 9379, 9383, 
-    9387, 9397, 9406, 9410, 9418, 9425, 9432, 9441, 9452, 9460, 9464, 9473, 
-    9484, 9492, 9505, 9513, 9521, 9529, 9537, 9543, 9552, 9559, 9563, 9571, 
-    9575, 9582, 9590, 9594, 9600, 9607, 9614, 9618, 9626, 9630, 9637, 9641, 
-    9649, 9653, 9661, 9669, 9676, 9684, 9692, 9699, 9705, 9709, 9716, 9724, 
-    9730, 9737, 9744, 9750, 9759, 9767, 9774, 9780, 9784, 9787, 9791, 9797, 
-    9805, 9809, 9815, 9821, 9828, 9835, 9838, 9845, 9850, 9858, 9863, 9867, 
-    9880, 9893, 9899, 9906, 9911, 9917, 9922, 9928, 9938, 9945, 9954, 9964, 
-    9970, 9975, 9980, 9984, 9988, 9993, 9998, 10004, 10012, 10020, 10031, 
-    10036, 10045, 10054, 10061, 10067, 10073, 10079, 10085, 10091, 10097, 
-    10103, 10109, 10115, 10122, 10129, 10136, 10142, 10150, 10159, 10165, 
-    10172, 10179, 10184, 10189, 10193, 10200, 10207, 10216, 10225, 10228, 
-    10233, 10238, 0, 10243, 10247, 10251, 10257, 10261, 10265, 10271, 10275, 
-    10283, 10287, 10291, 10295, 10299, 10303, 10309, 10313, 10319, 10323, 
-    10327, 10331, 10335, 10339, 10344, 10347, 10351, 10357, 10361, 10365, 
-    10369, 10373, 10377, 10383, 10389, 10395, 10399, 10403, 10408, 10412, 
-    10416, 10421, 10425, 10429, 10436, 10443, 10447, 10451, 10456, 10460, 
-    10464, 10467, 10472, 10475, 10478, 10483, 10488, 10492, 10496, 10502, 
-    10508, 10511, 0, 0, 10514, 10520, 10526, 10532, 10542, 10554, 10566, 
-    10583, 10595, 10606, 10614, 10621, 10632, 10647, 10658, 10664, 10673, 
-    10681, 10693, 10703, 10711, 10723, 10730, 10738, 10750, 10756, 10762, 
-    10770, 10778, 10786, 10792, 10802, 10809, 10819, 10829, 10842, 10856, 
-    10870, 10880, 10891, 10902, 10915, 10928, 10942, 10954, 10966, 10979, 
-    10992, 11004, 11017, 11026, 11034, 11039, 11044, 11049, 11054, 11059, 
-    11064, 11069, 11074, 11079, 11084, 11089, 11094, 11099, 11104, 11109, 
-    11114, 11119, 11124, 11129, 11134, 11139, 11144, 11149, 11154, 11159, 
-    11164, 11169, 11174, 11179, 11184, 11189, 11194, 11198, 11203, 11208, 
-    11213, 11218, 11223, 11227, 11231, 11235, 11239, 11243, 11247, 11251, 
-    11255, 11259, 11263, 11267, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    11272, 11277, 11281, 11285, 11289, 11293, 11297, 11301, 11305, 11309, 
-    11313, 11317, 11322, 11326, 11330, 11334, 11339, 11343, 11348, 11353, 
-    11358, 11362, 11367, 11372, 11377, 11382, 11386, 11391, 11395, 11400, 
-    11405, 11409, 11414, 11421, 11425, 11430, 11434, 11438, 11443, 11447, 
-    11454, 11461, 11468, 11474, 11482, 11490, 11499, 11507, 11514, 11521, 
-    11529, 11535, 11541, 11547, 11553, 11560, 11565, 11569, 11574, 0, 0, 0, 
-    0, 0, 11578, 11583, 11588, 11593, 11598, 11603, 11608, 11613, 11618, 
-    11623, 11628, 11633, 11638, 11643, 11648, 11653, 11658, 11663, 11668, 
-    11673, 11678, 11683, 11688, 11693, 11698, 11703, 11708, 11716, 11723, 
-    11729, 11734, 11742, 11749, 11755, 11762, 11768, 11773, 11780, 11787, 
-    11793, 11798, 11803, 11809, 11814, 11819, 11825, 0, 0, 11830, 11836, 
-    11842, 11848, 11854, 11860, 11866, 11871, 11879, 11885, 11891, 11897, 
-    11903, 11909, 11917, 0, 11923, 11928, 11933, 11938, 11943, 11948, 11953, 
-    11958, 11963, 11968, 11973, 11978, 11983, 11988, 11993, 11998, 12003, 
-    12008, 12013, 12018, 12023, 12028, 12033, 12038, 12043, 12048, 12053, 
-    12058, 0, 0, 12063, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    8792, 8803, 8808, 8812, 8816, 8820, 8823, 0, 8826, 8833, 8837, 8843, 
+    8847, 8854, 8860, 8867, 8873, 8879, 8883, 8887, 8893, 8897, 8901, 8905, 
+    8909, 8913, 8917, 8921, 8925, 8929, 8933, 8937, 8941, 8945, 8949, 8953, 
+    8957, 8961, 8969, 8977, 8987, 8996, 9005, 9008, 9012, 9016, 9020, 9024, 
+    9028, 9032, 9036, 9040, 9045, 9049, 9052, 9055, 9058, 9061, 9064, 9067, 
+    9070, 9073, 9077, 9080, 9083, 9088, 9093, 9099, 9102, 9109, 9118, 9123, 
+    9128, 9135, 9140, 9145, 9149, 9153, 9157, 9161, 9165, 9169, 9173, 9177, 
+    9181, 9185, 9190, 9195, 9202, 9208, 9214, 9220, 9225, 9233, 9241, 9246, 
+    9252, 9258, 9264, 9270, 9274, 9278, 9282, 9289, 9299, 9303, 9307, 9311, 
+    9317, 9325, 9329, 9333, 9340, 9344, 9348, 9352, 9359, 9366, 9378, 9382, 
+    9386, 9390, 9400, 9409, 9413, 9421, 9428, 9435, 9444, 9455, 9463, 9467, 
+    9476, 9487, 9495, 9508, 9516, 9524, 9532, 9540, 9546, 9555, 9562, 9566, 
+    9574, 9578, 9585, 9593, 9597, 9603, 9610, 9617, 9621, 9629, 9633, 9640, 
+    9644, 9652, 9656, 9664, 9672, 9679, 9687, 9695, 9702, 9708, 9712, 9719, 
+    9727, 9733, 9740, 9747, 9753, 9762, 9770, 9777, 9783, 9787, 9790, 9794, 
+    9800, 9808, 9812, 9818, 9824, 9831, 9838, 9841, 9848, 9853, 9861, 9866, 
+    9870, 9883, 9896, 9902, 9909, 9914, 9920, 9925, 9931, 9941, 9948, 9957, 
+    9967, 9973, 9978, 9983, 9987, 9991, 9996, 10001, 10007, 10015, 10023, 
+    10034, 10039, 10048, 10057, 10064, 10070, 10076, 10082, 10088, 10094, 
+    10100, 10106, 10112, 10118, 10125, 10132, 10139, 10145, 10153, 10162, 
+    10168, 10175, 10182, 10187, 10192, 10196, 10203, 10210, 10219, 10228, 
+    10231, 10236, 10241, 0, 10246, 10250, 10254, 10260, 10264, 10268, 10274, 
+    10278, 10286, 10290, 10294, 10298, 10302, 10306, 10312, 10316, 10322, 
+    10326, 10330, 10334, 10338, 10342, 10347, 10350, 10354, 10360, 10364, 
+    10368, 10372, 10376, 10380, 10386, 10392, 10398, 10402, 10406, 10411, 
+    10415, 10419, 10424, 10428, 10432, 10439, 10446, 10450, 10454, 10459, 
+    10463, 10467, 10470, 10475, 10478, 10481, 10486, 10491, 10495, 10499, 
+    10505, 10511, 10514, 0, 0, 10517, 10523, 10529, 10535, 10545, 10557, 
+    10569, 10586, 10598, 10609, 10617, 10624, 10635, 10650, 10661, 10667, 
+    10676, 10684, 10696, 10706, 10714, 10726, 10733, 10741, 10753, 10759, 
+    10765, 10773, 10781, 10789, 10795, 10805, 10812, 10822, 10832, 10845, 
+    10859, 10873, 10883, 10894, 10905, 10918, 10931, 10945, 10957, 10969, 
+    10982, 10995, 11007, 11020, 11029, 11037, 11042, 11047, 11052, 11057, 
+    11062, 11067, 11072, 11077, 11082, 11087, 11092, 11097, 11102, 11107, 
+    11112, 11117, 11122, 11127, 11132, 11137, 11142, 11147, 11152, 11157, 
+    11162, 11167, 11172, 11177, 11182, 11187, 11192, 11197, 11201, 11206, 
+    11211, 11216, 11221, 11226, 11230, 11234, 11238, 11242, 11246, 11250, 
+    11254, 11258, 11262, 11266, 11270, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 11275, 11280, 11284, 11288, 11292, 11296, 11300, 11304, 11308, 11312, 
+    11316, 11320, 11325, 11329, 11333, 11337, 11342, 11346, 11351, 11356, 
+    11361, 11365, 11370, 11375, 11380, 11385, 11389, 11394, 11398, 11403, 
+    11408, 11412, 11417, 11424, 11428, 11433, 11437, 11441, 11446, 11450, 
+    11457, 11464, 11471, 11477, 11485, 11493, 11502, 11510, 11517, 11524, 
+    11532, 11538, 11544, 11550, 11556, 11563, 11568, 11572, 11577, 0, 0, 0, 
+    0, 0, 11581, 11586, 11591, 11596, 11601, 11606, 11611, 11616, 11621, 
+    11626, 11631, 11636, 11641, 11646, 11651, 11656, 11661, 11666, 11671, 
+    11676, 11681, 11686, 11691, 11696, 11701, 11706, 11711, 11719, 11726, 
+    11732, 11737, 11745, 11752, 11758, 11765, 11771, 11776, 11783, 11790, 
+    11796, 11801, 11806, 11812, 11817, 11822, 11828, 0, 0, 11833, 11839, 
+    11845, 11851, 11857, 11863, 11869, 11874, 11882, 11888, 11894, 11900, 
+    11906, 11912, 11920, 0, 11926, 11931, 11936, 11941, 11946, 11951, 11956, 
+    11961, 11966, 11971, 11976, 11981, 11986, 11991, 11996, 12001, 12006, 
+    12011, 12016, 12021, 12026, 12031, 12036, 12041, 12046, 12051, 12056, 
+    12061, 0, 0, 12066, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    12067, 0, 12076, 12083, 12091, 12103, 12110, 12117, 12124, 12135, 12146, 
-    12153, 12161, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    12070, 0, 12079, 12086, 12094, 12106, 12113, 12120, 12127, 12138, 12149, 
+    12156, 12164, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12167, 12172, 12177, 12182, 12187, 
-    12192, 12197, 12202, 12207, 12212, 12217, 12222, 12227, 12231, 12235, 
-    12239, 12244, 12250, 12256, 12262, 12267, 12272, 12277, 12282, 12288, 
-    12297, 12305, 0, 12311, 12317, 12321, 12325, 12329, 12334, 12337, 12341, 
-    12344, 12348, 12351, 12355, 12359, 12363, 12368, 12373, 12376, 12380, 
-    12385, 12390, 12393, 12397, 12400, 12404, 12408, 12412, 12416, 12420, 
-    12424, 12428, 12432, 12436, 12440, 12444, 12448, 12452, 12456, 12460, 
-    12464, 12468, 12472, 12475, 12479, 12482, 12486, 12490, 12494, 12497, 
-    12500, 12503, 12507, 12511, 12515, 12519, 12523, 12527, 12531, 12534, 
-    12537, 12542, 12547, 12551, 12555, 12560, 12564, 12569, 12573, 12578, 
-    12583, 12589, 12595, 12601, 12605, 12610, 12616, 12622, 12626, 12631, 
-    12635, 12641, 12646, 12649, 12655, 12661, 12666, 12671, 12678, 12683, 
-    12688, 12692, 12696, 12700, 12704, 12708, 12712, 12716, 12720, 12725, 
-    12730, 12735, 12741, 12744, 12748, 12752, 12755, 12758, 12761, 12764, 
-    12767, 12770, 12773, 12776, 12779, 12783, 12790, 12795, 12799, 12803, 
-    12807, 12811, 0, 12815, 12819, 12823, 12827, 12831, 12837, 12841, 0, 
-    12845, 12849, 12853, 0, 12857, 12860, 12864, 12867, 12871, 12874, 12878, 
-    12882, 0, 0, 12886, 12889, 0, 0, 12893, 12896, 12900, 12903, 12907, 
-    12911, 12915, 12919, 12923, 12927, 12931, 12935, 12939, 12943, 12947, 
-    12951, 12955, 12959, 12963, 12967, 12971, 12975, 0, 12978, 12981, 12985, 
-    12989, 12993, 12996, 12999, 0, 13002, 0, 0, 0, 13006, 13010, 13014, 
-    13017, 0, 0, 13020, 13024, 13028, 13033, 13037, 13042, 13046, 13051, 
-    13056, 0, 0, 13062, 13066, 0, 0, 13071, 13075, 13080, 13084, 0, 0, 0, 0, 
-    0, 0, 0, 0, 13090, 0, 0, 0, 0, 13096, 13100, 0, 13104, 13108, 13113, 
-    13118, 13123, 0, 0, 13129, 13133, 13136, 13139, 13142, 13145, 13148, 
-    13151, 13154, 13157, 13160, 13169, 13178, 13182, 13186, 13192, 13198, 
-    13204, 13210, 13224, 13231, 13234, 0, 0, 0, 0, 0, 13238, 13244, 13248, 0, 
-    13252, 13255, 13259, 13262, 13266, 13269, 0, 0, 0, 0, 13273, 13277, 0, 0, 
-    13281, 13285, 13289, 13292, 13296, 13300, 13304, 13308, 13312, 13316, 
-    13320, 13324, 13328, 13332, 13336, 13340, 13344, 13348, 13352, 13356, 
-    13360, 13364, 0, 13367, 13370, 13374, 13378, 13382, 13385, 13388, 0, 
-    13391, 13395, 0, 13399, 13403, 0, 13407, 13410, 0, 0, 13413, 0, 13417, 
-    13422, 13426, 13431, 13435, 0, 0, 0, 0, 13440, 13445, 0, 0, 13450, 13455, 
-    13460, 0, 0, 0, 13464, 0, 0, 0, 0, 0, 0, 0, 13468, 13472, 13476, 13480, 
-    0, 13484, 0, 0, 0, 0, 0, 0, 0, 13488, 13492, 13495, 13498, 13501, 13504, 
-    13507, 13510, 13513, 13516, 13519, 13522, 13525, 13528, 13531, 13536, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13540, 13544, 13548, 0, 13552, 13555, 
-    13559, 13562, 13566, 13569, 13573, 13577, 13581, 0, 13586, 13589, 13593, 
-    0, 13598, 13601, 13605, 13608, 13612, 13616, 13620, 13624, 13628, 13632, 
-    13636, 13640, 13644, 13648, 13652, 13656, 13660, 13664, 13668, 13672, 
-    13676, 13680, 0, 13683, 13686, 13690, 13694, 13698, 13701, 13704, 0, 
-    13707, 13711, 0, 13715, 13719, 13723, 13727, 13730, 0, 0, 13733, 13737, 
-    13741, 13746, 13750, 13755, 13759, 13764, 13769, 13775, 0, 13781, 13785, 
-    13790, 0, 13796, 13800, 13805, 0, 0, 13809, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 13812, 13817, 13822, 13827, 0, 0, 13833, 13837, 13840, 
-    13843, 13846, 13849, 13852, 13855, 13858, 13861, 13864, 13868, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13872, 13876, 13880, 0, 13884, 13887, 
-    13891, 13894, 13898, 13901, 13905, 13909, 0, 0, 13913, 13916, 0, 0, 
-    13920, 13923, 13927, 13930, 13934, 13938, 13942, 13946, 13950, 13954, 
-    13958, 13962, 13966, 13970, 13974, 13978, 13982, 13986, 13990, 13994, 
-    13998, 14002, 0, 14005, 14008, 14012, 14016, 14020, 14023, 14026, 0, 
-    14029, 14033, 0, 14037, 14041, 14045, 14049, 14052, 0, 0, 14055, 14059, 
-    14063, 14068, 14072, 14077, 14081, 14086, 14091, 0, 0, 14097, 14101, 0, 
-    0, 14106, 14110, 14115, 0, 0, 0, 0, 0, 0, 0, 0, 14119, 14125, 0, 0, 0, 0, 
-    14131, 14135, 0, 14139, 14143, 14148, 14153, 14158, 0, 0, 14164, 14168, 
-    14171, 14174, 14177, 14180, 14183, 14186, 14189, 14192, 14195, 14198, 
-    14202, 14208, 14214, 14220, 14226, 14232, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    14238, 14242, 0, 14246, 14249, 14253, 14256, 14260, 14263, 0, 0, 0, 
-    14267, 14270, 14274, 0, 14278, 14281, 14285, 14289, 0, 0, 0, 14292, 
-    14296, 0, 14300, 0, 14304, 14308, 0, 0, 0, 14312, 14316, 0, 0, 0, 14320, 
-    14323, 14327, 0, 0, 0, 14330, 14333, 14336, 14339, 14343, 14347, 14351, 
-    14355, 14359, 14363, 14367, 14370, 0, 0, 0, 0, 14373, 14378, 14382, 
-    14387, 14391, 0, 0, 0, 14396, 14400, 14405, 0, 14410, 14414, 14419, 
-    14424, 0, 0, 14428, 0, 0, 0, 0, 0, 0, 14431, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 14437, 14441, 14444, 14447, 14450, 14453, 14456, 14459, 
-    14462, 14465, 14468, 14472, 14477, 14482, 14486, 14490, 14494, 14498, 
-    14502, 14507, 14511, 0, 0, 0, 0, 0, 0, 14514, 14518, 14522, 0, 14526, 
-    14529, 14533, 14536, 14540, 14543, 14547, 14551, 0, 14555, 14558, 14562, 
-    0, 14566, 14569, 14573, 14577, 14580, 14584, 14588, 14592, 14596, 14600, 
-    14604, 14608, 14612, 14616, 14620, 14624, 14628, 14632, 14636, 14640, 
-    14644, 14648, 14652, 0, 14655, 14658, 14662, 14666, 14670, 14673, 14676, 
-    14679, 14683, 14687, 0, 14691, 14695, 14699, 14703, 14706, 0, 0, 0, 
-    14709, 14713, 14718, 14722, 14727, 14731, 14736, 14741, 0, 14747, 14751, 
-    14756, 0, 14761, 14765, 14770, 14775, 0, 0, 0, 0, 0, 0, 0, 14779, 14783, 
-    0, 14789, 14793, 0, 0, 0, 0, 0, 0, 14797, 14802, 14807, 14812, 0, 0, 
-    14818, 14822, 14825, 14828, 14831, 14834, 14837, 14840, 14843, 14846, 0, 
-    0, 0, 0, 0, 0, 0, 0, 14849, 14862, 14874, 14886, 14898, 14910, 14922, 
-    14934, 0, 0, 14938, 14942, 0, 14946, 14949, 14953, 14956, 14960, 14963, 
-    14967, 14971, 0, 14975, 14978, 14982, 0, 14986, 14989, 14993, 14997, 
-    15000, 15004, 15008, 15012, 15016, 15020, 15024, 15028, 15032, 15036, 
-    15040, 15044, 15048, 15052, 15056, 15060, 15064, 15068, 15072, 0, 15075, 
-    15078, 15082, 15086, 15090, 15093, 15096, 15099, 15103, 15107, 0, 15111, 
-    15115, 15119, 15123, 15126, 0, 0, 15129, 15133, 15137, 15142, 15146, 
-    15151, 15155, 15160, 15165, 0, 15171, 15175, 15180, 0, 15185, 15189, 
-    15194, 15199, 0, 0, 0, 0, 0, 0, 0, 15203, 15207, 0, 0, 0, 0, 0, 0, 0, 
-    15213, 0, 15217, 15222, 15227, 15232, 0, 0, 15238, 15242, 15245, 15248, 
-    15251, 15254, 15257, 15260, 15263, 15266, 0, 15269, 15273, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15277, 15281, 0, 15285, 15288, 15292, 
-    15295, 15299, 15302, 15306, 15310, 0, 15314, 15317, 15321, 0, 15325, 
-    15328, 15332, 15336, 15339, 15343, 15347, 15351, 15355, 15359, 15363, 
-    15367, 15371, 15375, 15379, 15383, 15387, 15391, 15395, 15399, 15403, 
-    15407, 15411, 15414, 15418, 15421, 15425, 15429, 15433, 15436, 15439, 
-    15442, 15446, 15450, 15454, 15458, 15462, 15466, 15470, 15473, 15476, 0, 
-    0, 15480, 15484, 15489, 15493, 15498, 15502, 15507, 15512, 0, 15518, 
-    15522, 15527, 0, 15532, 15536, 15541, 15546, 15550, 0, 0, 0, 0, 0, 0, 0, 
-    0, 15555, 0, 0, 0, 0, 0, 0, 0, 0, 15561, 15566, 15571, 15576, 0, 0, 
-    15582, 15586, 15589, 15592, 15595, 15598, 15601, 15604, 15607, 15610, 
-    15613, 15617, 15622, 15627, 15633, 15639, 0, 0, 0, 15645, 15649, 15655, 
-    15661, 15667, 15672, 15678, 0, 0, 15684, 15688, 0, 15692, 15696, 15700, 
-    15704, 15708, 15712, 15716, 15720, 15724, 15728, 15732, 15736, 15740, 
-    15744, 15748, 15752, 15756, 15760, 0, 0, 0, 15764, 15770, 15776, 15782, 
-    15788, 15794, 15800, 15806, 15812, 15818, 15824, 15830, 15838, 15844, 
-    15850, 15856, 15862, 15868, 15874, 15880, 15886, 15892, 15898, 15904, 0, 
-    15910, 15916, 15922, 15928, 15934, 15940, 15944, 15950, 15954, 0, 15958, 
-    0, 0, 15964, 15968, 15974, 15980, 15986, 15990, 15996, 0, 0, 0, 16000, 0, 
-    0, 0, 0, 16004, 16009, 16016, 16023, 16030, 16037, 0, 16044, 0, 16051, 
-    16056, 16061, 16068, 16075, 16084, 16095, 16104, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16109, 16116, 16123, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 16128, 16134, 16140, 16146, 16152, 16158, 16164, 16170, 
-    16176, 16182, 16188, 16194, 16200, 16206, 16212, 16218, 16224, 16230, 
-    16236, 16242, 16248, 16254, 16260, 16266, 16272, 16278, 16284, 16290, 
-    16296, 16302, 16308, 16314, 16320, 16325, 16331, 16337, 16341, 16347, 
-    16351, 16357, 16363, 16369, 16375, 16381, 16387, 16392, 16398, 16402, 
-    16407, 16413, 16419, 16425, 16430, 16436, 16442, 16448, 16453, 16459, 0, 
-    0, 0, 0, 16463, 16469, 16474, 16480, 16485, 16493, 16501, 16505, 16509, 
-    16513, 16519, 16525, 16531, 16537, 16541, 16545, 16549, 16553, 16557, 
-    16560, 16563, 16566, 16569, 16572, 16575, 16578, 16581, 16584, 16588, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12170, 12175, 12180, 12185, 12190, 
+    12195, 12200, 12205, 12210, 12215, 12220, 12225, 12230, 12234, 12238, 
+    12242, 12247, 12253, 12259, 12265, 12270, 12275, 12280, 12285, 12291, 
+    12300, 12308, 0, 12314, 12320, 12324, 12328, 12332, 12337, 12340, 12344, 
+    12347, 12351, 12354, 12358, 12362, 12366, 12371, 12376, 12379, 12383, 
+    12388, 12393, 12396, 12400, 12403, 12407, 12411, 12415, 12419, 12423, 
+    12427, 12431, 12435, 12439, 12443, 12447, 12451, 12455, 12459, 12463, 
+    12467, 12471, 12475, 12478, 12482, 12485, 12489, 12493, 12497, 12500, 
+    12503, 12506, 12510, 12514, 12518, 12522, 12526, 12530, 12534, 12537, 
+    12540, 12545, 12550, 12554, 12558, 12563, 12567, 12572, 12576, 12581, 
+    12586, 12592, 12598, 12604, 12608, 12613, 12619, 12625, 12629, 12634, 
+    12638, 12644, 12649, 12652, 12658, 12664, 12669, 12674, 12681, 12686, 
+    12691, 12695, 12699, 12703, 12707, 12711, 12715, 12719, 12723, 12728, 
+    12733, 12738, 12744, 12747, 12751, 12755, 12758, 12761, 12764, 12767, 
+    12770, 12773, 12776, 12779, 12782, 12786, 12793, 12798, 12802, 12806, 
+    12810, 12814, 0, 12818, 12822, 12826, 12830, 12834, 12840, 12844, 0, 
+    12848, 12852, 12856, 0, 12860, 12863, 12867, 12870, 12874, 12877, 12881, 
+    12885, 0, 0, 12889, 12892, 0, 0, 12896, 12899, 12903, 12906, 12910, 
+    12914, 12918, 12922, 12926, 12930, 12934, 12938, 12942, 12946, 12950, 
+    12954, 12958, 12962, 12966, 12970, 12974, 12978, 0, 12981, 12984, 12988, 
+    12992, 12996, 12999, 13002, 0, 13005, 0, 0, 0, 13009, 13013, 13017, 
+    13020, 0, 0, 13023, 13027, 13031, 13036, 13040, 13045, 13049, 13054, 
+    13059, 0, 0, 13065, 13069, 0, 0, 13074, 13078, 13083, 13087, 0, 0, 0, 0, 
+    0, 0, 0, 0, 13093, 0, 0, 0, 0, 13099, 13103, 0, 13107, 13111, 13116, 
+    13121, 13126, 0, 0, 13132, 13136, 13139, 13142, 13145, 13148, 13151, 
+    13154, 13157, 13160, 13163, 13172, 13181, 13185, 13189, 13195, 13201, 
+    13207, 13213, 13227, 13234, 13237, 0, 0, 0, 0, 0, 13241, 13247, 13251, 0, 
+    13255, 13258, 13262, 13265, 13269, 13272, 0, 0, 0, 0, 13276, 13280, 0, 0, 
+    13284, 13288, 13292, 13295, 13299, 13303, 13307, 13311, 13315, 13319, 
+    13323, 13327, 13331, 13335, 13339, 13343, 13347, 13351, 13355, 13359, 
+    13363, 13367, 0, 13370, 13373, 13377, 13381, 13385, 13388, 13391, 0, 
+    13394, 13398, 0, 13402, 13406, 0, 13410, 13413, 0, 0, 13416, 0, 13420, 
+    13425, 13429, 13434, 13438, 0, 0, 0, 0, 13443, 13448, 0, 0, 13453, 13458, 
+    13463, 0, 0, 0, 13467, 0, 0, 0, 0, 0, 0, 0, 13471, 13475, 13479, 13483, 
+    0, 13487, 0, 0, 0, 0, 0, 0, 0, 13491, 13495, 13498, 13501, 13504, 13507, 
+    13510, 13513, 13516, 13519, 13522, 13525, 13528, 13531, 13534, 13539, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13543, 13547, 13551, 0, 13555, 13558, 
+    13562, 13565, 13569, 13572, 13576, 13580, 13584, 0, 13589, 13592, 13596, 
+    0, 13601, 13604, 13608, 13611, 13615, 13619, 13623, 13627, 13631, 13635, 
+    13639, 13643, 13647, 13651, 13655, 13659, 13663, 13667, 13671, 13675, 
+    13679, 13683, 0, 13686, 13689, 13693, 13697, 13701, 13704, 13707, 0, 
+    13710, 13714, 0, 13718, 13722, 13726, 13730, 13733, 0, 0, 13736, 13740, 
+    13744, 13749, 13753, 13758, 13762, 13767, 13772, 13778, 0, 13784, 13788, 
+    13793, 0, 13799, 13803, 13808, 0, 0, 13812, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 13815, 13820, 13825, 13830, 0, 0, 13836, 13840, 13843, 
+    13846, 13849, 13852, 13855, 13858, 13861, 13864, 13867, 13871, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13875, 13879, 13883, 0, 13887, 13890, 
+    13894, 13897, 13901, 13904, 13908, 13912, 0, 0, 13916, 13919, 0, 0, 
+    13923, 13926, 13930, 13933, 13937, 13941, 13945, 13949, 13953, 13957, 
+    13961, 13965, 13969, 13973, 13977, 13981, 13985, 13989, 13993, 13997, 
+    14001, 14005, 0, 14008, 14011, 14015, 14019, 14023, 14026, 14029, 0, 
+    14032, 14036, 0, 14040, 14044, 14048, 14052, 14055, 0, 0, 14058, 14062, 
+    14066, 14071, 14075, 14080, 14084, 14089, 14094, 0, 0, 14100, 14104, 0, 
+    0, 14109, 14113, 14118, 0, 0, 0, 0, 0, 0, 0, 0, 14122, 14128, 0, 0, 0, 0, 
+    14134, 14138, 0, 14142, 14146, 14151, 14156, 14161, 0, 0, 14167, 14171, 
+    14174, 14177, 14180, 14183, 14186, 14189, 14192, 14195, 14198, 14201, 
+    14205, 14211, 14217, 14223, 14229, 14235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    14241, 14245, 0, 14249, 14252, 14256, 14259, 14263, 14266, 0, 0, 0, 
+    14270, 14273, 14277, 0, 14281, 14284, 14288, 14292, 0, 0, 0, 14295, 
+    14299, 0, 14303, 0, 14307, 14311, 0, 0, 0, 14315, 14319, 0, 0, 0, 14323, 
+    14326, 14330, 0, 0, 0, 14333, 14336, 14339, 14342, 14346, 14350, 14354, 
+    14358, 14362, 14366, 14370, 14373, 0, 0, 0, 0, 14376, 14381, 14385, 
+    14390, 14394, 0, 0, 0, 14399, 14403, 14408, 0, 14413, 14417, 14422, 
+    14427, 0, 0, 14431, 0, 0, 0, 0, 0, 0, 14434, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 14440, 14444, 14447, 14450, 14453, 14456, 14459, 14462, 
+    14465, 14468, 14471, 14475, 14480, 14485, 14489, 14493, 14497, 14501, 
+    14505, 14510, 14514, 0, 0, 0, 0, 0, 0, 14517, 14521, 14525, 0, 14529, 
+    14532, 14536, 14539, 14543, 14546, 14550, 14554, 0, 14558, 14561, 14565, 
+    0, 14569, 14572, 14576, 14580, 14583, 14587, 14591, 14595, 14599, 14603, 
+    14607, 14611, 14615, 14619, 14623, 14627, 14631, 14635, 14639, 14643, 
+    14647, 14651, 14655, 0, 14658, 14661, 14665, 14669, 14673, 14676, 14679, 
+    14682, 14686, 14690, 0, 14694, 14698, 14702, 14706, 14709, 0, 0, 0, 
+    14712, 14716, 14721, 14725, 14730, 14734, 14739, 14744, 0, 14750, 14754, 
+    14759, 0, 14764, 14768, 14773, 14778, 0, 0, 0, 0, 0, 0, 0, 14782, 14786, 
+    0, 14792, 14796, 0, 0, 0, 0, 0, 0, 14800, 14805, 14810, 14815, 0, 0, 
+    14821, 14825, 14828, 14831, 14834, 14837, 14840, 14843, 14846, 14849, 0, 
+    0, 0, 0, 0, 0, 0, 0, 14852, 14865, 14877, 14889, 14901, 14913, 14925, 
+    14937, 0, 0, 14941, 14945, 0, 14949, 14952, 14956, 14959, 14963, 14966, 
+    14970, 14974, 0, 14978, 14981, 14985, 0, 14989, 14992, 14996, 15000, 
+    15003, 15007, 15011, 15015, 15019, 15023, 15027, 15031, 15035, 15039, 
+    15043, 15047, 15051, 15055, 15059, 15063, 15067, 15071, 15075, 0, 15078, 
+    15081, 15085, 15089, 15093, 15096, 15099, 15102, 15106, 15110, 0, 15114, 
+    15118, 15122, 15126, 15129, 0, 0, 15132, 15136, 15140, 15145, 15149, 
+    15154, 15158, 15163, 15168, 0, 15174, 15178, 15183, 0, 15188, 15192, 
+    15197, 15202, 0, 0, 0, 0, 0, 0, 0, 15206, 15210, 0, 0, 0, 0, 0, 0, 0, 
+    15216, 0, 15220, 15225, 15230, 15235, 0, 0, 15241, 15245, 15248, 15251, 
+    15254, 15257, 15260, 15263, 15266, 15269, 0, 15272, 15276, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15280, 15284, 0, 15288, 15291, 15295, 
+    15298, 15302, 15305, 15309, 15313, 0, 15317, 15320, 15324, 0, 15328, 
+    15331, 15335, 15339, 15342, 15346, 15350, 15354, 15358, 15362, 15366, 
+    15370, 15374, 15378, 15382, 15386, 15390, 15394, 15398, 15402, 15406, 
+    15410, 15414, 15417, 15421, 15424, 15428, 15432, 15436, 15439, 15442, 
+    15445, 15449, 15453, 15457, 15461, 15465, 15469, 15473, 15476, 15479, 0, 
+    0, 15483, 15487, 15492, 15496, 15501, 15505, 15510, 15515, 0, 15521, 
+    15525, 15530, 0, 15535, 15539, 15544, 15549, 15553, 0, 0, 0, 0, 0, 0, 0, 
+    0, 15558, 0, 0, 0, 0, 0, 0, 0, 0, 15564, 15569, 15574, 15579, 0, 0, 
+    15585, 15589, 15592, 15595, 15598, 15601, 15604, 15607, 15610, 15613, 
+    15616, 15620, 15625, 15630, 15636, 15642, 0, 0, 0, 15648, 15652, 15658, 
+    15664, 15670, 15675, 15681, 0, 0, 15687, 15691, 0, 15695, 15699, 15703, 
+    15707, 15711, 15715, 15719, 15723, 15727, 15731, 15735, 15739, 15743, 
+    15747, 15751, 15755, 15759, 15763, 0, 0, 0, 15767, 15773, 15779, 15785, 
+    15791, 15797, 15803, 15809, 15815, 15821, 15827, 15833, 15841, 15847, 
+    15853, 15859, 15865, 15871, 15877, 15883, 15889, 15895, 15901, 15907, 0, 
+    15913, 15919, 15925, 15931, 15937, 15943, 15947, 15953, 15957, 0, 15961, 
+    0, 0, 15967, 15971, 15977, 15983, 15989, 15993, 15999, 0, 0, 0, 16003, 0, 
+    0, 0, 0, 16007, 16012, 16019, 16026, 16033, 16040, 0, 16047, 0, 16054, 
+    16059, 16064, 16071, 16078, 16087, 16098, 16107, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16112, 16119, 16126, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 16131, 16137, 16143, 16149, 16155, 16161, 16167, 16173, 
+    16179, 16185, 16191, 16197, 16203, 16209, 16215, 16221, 16227, 16233, 
+    16239, 16245, 16251, 16257, 16263, 16269, 16275, 16281, 16287, 16293, 
+    16299, 16305, 16311, 16317, 16323, 16328, 16334, 16340, 16344, 16350, 
+    16354, 16360, 16366, 16372, 16378, 16384, 16390, 16395, 16401, 16405, 
+    16410, 16416, 16422, 16428, 16433, 16439, 16445, 16451, 16456, 16462, 0, 
+    0, 0, 0, 16466, 16472, 16477, 16483, 16488, 16496, 16504, 16508, 16512, 
+    16516, 16522, 16528, 16534, 16540, 16544, 16548, 16552, 16556, 16560, 
+    16563, 16566, 16569, 16572, 16575, 16578, 16581, 16584, 16587, 16591, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16592, 16597, 0, 16604, 0, 0, 16611, 
-    16616, 0, 16621, 0, 0, 16628, 0, 0, 0, 0, 0, 0, 16633, 16638, 16642, 
-    16649, 0, 16656, 16661, 16666, 16671, 16678, 16685, 16692, 0, 16699, 
-    16704, 16709, 0, 16716, 0, 16723, 0, 0, 16728, 16735, 0, 16742, 16746, 
-    16753, 16757, 16762, 16770, 16776, 16782, 16787, 16793, 16799, 16805, 
-    16810, 0, 16816, 16824, 16831, 0, 0, 16838, 16843, 16849, 16854, 16860, 
-    0, 16866, 0, 16872, 16879, 16886, 16893, 16900, 16905, 0, 0, 16909, 
-    16914, 16918, 16922, 16926, 16930, 16934, 16938, 16942, 16946, 0, 0, 
-    16950, 16956, 16962, 16969, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16976, 16980, 16991, 
-    17006, 17021, 17031, 17042, 17055, 17066, 17072, 17080, 17090, 17096, 
-    17104, 17108, 17114, 17120, 17128, 17138, 17146, 17159, 17165, 17173, 
-    17181, 17193, 17200, 17208, 17216, 17224, 17232, 17240, 17248, 17258, 
-    17262, 17265, 17268, 17271, 17274, 17277, 17280, 17283, 17286, 17289, 
-    17293, 17297, 17301, 17305, 17309, 17313, 17317, 17321, 17325, 17330, 
-    17336, 17346, 17360, 17370, 17376, 17382, 17390, 17398, 17406, 17414, 
-    17420, 17426, 17429, 17433, 17437, 17441, 17445, 17449, 17453, 0, 17457, 
-    17461, 17465, 17469, 17473, 17477, 17481, 17485, 17489, 17493, 17497, 
-    17500, 17503, 17507, 17511, 17515, 17518, 17522, 17526, 17530, 17534, 
-    17538, 17542, 17546, 17550, 17553, 17556, 17560, 17564, 17568, 17571, 
-    17574, 17577, 17581, 17586, 17590, 0, 0, 0, 0, 17594, 17599, 17603, 
-    17608, 17612, 17617, 17622, 17628, 17633, 17639, 17643, 17648, 17652, 
-    17657, 17667, 17673, 17679, 17686, 17696, 17702, 17706, 17710, 17716, 
-    17722, 17730, 17736, 17744, 17752, 17760, 17770, 17778, 17788, 17793, 
-    17799, 17805, 17811, 17817, 17823, 17829, 0, 17835, 17841, 17847, 17853, 
-    17859, 17865, 17871, 17877, 17883, 17889, 17895, 17900, 17905, 17911, 
-    17917, 17923, 17928, 17934, 17940, 17946, 17952, 17958, 17964, 17970, 
-    17976, 17981, 17986, 17992, 17998, 18004, 18009, 18014, 18019, 18025, 
-    18033, 18040, 0, 18047, 18054, 18067, 18074, 18081, 18089, 18097, 18103, 
-    18109, 18115, 18125, 18130, 18136, 18146, 18156, 0, 18166, 18176, 18184, 
-    18196, 18208, 18214, 18228, 18243, 18248, 18253, 18261, 18269, 18277, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16595, 16600, 0, 16607, 0, 0, 16614, 
+    16619, 0, 16624, 0, 0, 16631, 0, 0, 0, 0, 0, 0, 16636, 16641, 16645, 
+    16652, 0, 16659, 16664, 16669, 16674, 16681, 16688, 16695, 0, 16702, 
+    16707, 16712, 0, 16719, 0, 16726, 0, 0, 16731, 16738, 0, 16745, 16749, 
+    16756, 16760, 16765, 16773, 16779, 16785, 16790, 16796, 16802, 16808, 
+    16813, 0, 16819, 16827, 16834, 0, 0, 16841, 16846, 16852, 16857, 16863, 
+    0, 16869, 0, 16875, 16882, 16889, 16896, 16903, 16908, 0, 0, 16912, 
+    16917, 16921, 16925, 16929, 16933, 16937, 16941, 16945, 16949, 0, 0, 
+    16953, 16959, 16965, 16972, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16979, 16983, 16994, 
+    17009, 17024, 17034, 17045, 17058, 17069, 17075, 17083, 17093, 17099, 
+    17107, 17111, 17117, 17123, 17131, 17141, 17149, 17162, 17168, 17176, 
+    17184, 17196, 17203, 17211, 17219, 17227, 17235, 17243, 17251, 17261, 
+    17265, 17268, 17271, 17274, 17277, 17280, 17283, 17286, 17289, 17292, 
+    17296, 17300, 17304, 17308, 17312, 17316, 17320, 17324, 17328, 17333, 
+    17339, 17349, 17363, 17373, 17379, 17385, 17393, 17401, 17409, 17417, 
+    17423, 17429, 17432, 17436, 17440, 17444, 17448, 17452, 17456, 0, 17460, 
+    17464, 17468, 17472, 17476, 17480, 17484, 17488, 17492, 17496, 17500, 
+    17503, 17506, 17510, 17514, 17518, 17521, 17525, 17529, 17533, 17537, 
+    17541, 17545, 17549, 17553, 17556, 17559, 17563, 17567, 17571, 17574, 
+    17577, 17580, 17584, 17589, 17593, 0, 0, 0, 0, 17597, 17602, 17606, 
+    17611, 17615, 17620, 17625, 17631, 17636, 17642, 17646, 17651, 17655, 
+    17660, 17670, 17676, 17682, 17689, 17699, 17705, 17709, 17713, 17719, 
+    17725, 17733, 17739, 17747, 17755, 17763, 17773, 17781, 17791, 17796, 
+    17802, 17808, 17814, 17820, 17826, 17832, 0, 17838, 17844, 17850, 17856, 
+    17862, 17868, 17874, 17880, 17886, 17892, 17898, 17903, 17908, 17914, 
+    17920, 17926, 17931, 17937, 17943, 17949, 17955, 17961, 17967, 17973, 
+    17979, 17984, 17989, 17995, 18001, 18007, 18012, 18017, 18022, 18028, 
+    18036, 18043, 0, 18050, 18057, 18070, 18077, 18084, 18092, 18100, 18106, 
+    18112, 18118, 18128, 18133, 18139, 18149, 18159, 0, 18169, 18179, 18187, 
+    18199, 18211, 18217, 18231, 18246, 18251, 18256, 18264, 18272, 18280, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18285, 18288, 18292, 18296, 18300, 
-    18304, 18308, 18312, 18316, 18320, 18324, 18328, 18332, 18336, 18340, 
-    18344, 18348, 18352, 18356, 18360, 18364, 18367, 18370, 18374, 18378, 
-    18382, 18385, 18388, 18391, 18395, 18399, 18402, 18405, 18409, 18412, 
-    18417, 18420, 18424, 18427, 18431, 18434, 18439, 18442, 18446, 18453, 
-    18458, 18462, 18467, 18471, 18476, 18480, 18485, 18492, 18498, 18503, 
-    18507, 18511, 18515, 18519, 18523, 18528, 18533, 18539, 18544, 18549, 
-    18553, 18556, 18559, 18562, 18565, 18568, 18571, 18574, 18577, 18580, 
-    18586, 18590, 18594, 18598, 18602, 18606, 18610, 18614, 18618, 18623, 
-    18627, 18632, 18637, 18643, 18648, 18654, 18660, 18666, 18672, 18678, 
-    18685, 18692, 18700, 18708, 18717, 18726, 18737, 18747, 18757, 18768, 
-    18779, 18789, 18799, 18809, 18819, 18829, 18839, 18849, 18859, 18867, 
-    18874, 18880, 18887, 18892, 18898, 18904, 18910, 18916, 18922, 18928, 
-    18933, 18939, 18945, 18951, 18957, 18962, 18970, 18977, 18983, 18990, 
-    18998, 19004, 19010, 19016, 19022, 19030, 19038, 19048, 19056, 19064, 
-    19070, 19075, 19080, 19085, 19090, 19095, 19100, 19105, 19110, 19115, 
-    19121, 19127, 19133, 19140, 19145, 19151, 19156, 19161, 19166, 19171, 
-    19176, 19181, 19186, 19191, 19196, 19201, 19206, 19211, 19216, 19221, 
-    19226, 19231, 19236, 19241, 19246, 19251, 19256, 19261, 19266, 19271, 
-    19276, 19281, 19286, 19291, 19296, 19301, 19306, 19311, 19316, 19321, 
-    19326, 19331, 19336, 0, 19341, 0, 0, 0, 0, 0, 19346, 0, 0, 19351, 19355, 
-    19359, 19363, 19367, 19371, 19375, 19379, 19383, 19387, 19391, 19395, 
-    19399, 19403, 19407, 19411, 19415, 19419, 19423, 19427, 19431, 19435, 
-    19439, 19443, 19447, 19451, 19455, 19459, 19463, 19467, 19471, 19475, 
-    19479, 19483, 19487, 19491, 19495, 19499, 19503, 19507, 19511, 19515, 
-    19521, 19525, 19530, 19535, 19539, 19544, 19549, 19553, 19557, 19561, 
-    19565, 19569, 19573, 19577, 19581, 19585, 19589, 19593, 19597, 19601, 
-    19605, 19609, 19613, 19617, 19621, 19625, 19629, 19633, 19637, 19641, 
-    19645, 19649, 19653, 19657, 19661, 19665, 19669, 19673, 19677, 19681, 
-    19685, 19689, 19693, 19697, 19701, 19705, 19709, 19713, 19717, 19721, 
-    19725, 19729, 19733, 19737, 19741, 19745, 19749, 19753, 19757, 19761, 
-    19765, 19769, 19773, 19777, 19781, 19785, 19789, 19793, 19797, 19801, 
-    19805, 19809, 19813, 19817, 19821, 19825, 19829, 19833, 19837, 19841, 
-    19845, 19849, 19853, 19857, 19861, 19865, 19869, 19873, 19877, 19881, 
-    19885, 19889, 19893, 19897, 19901, 19905, 19909, 19913, 19917, 19921, 
-    19925, 19929, 19933, 19937, 19940, 19944, 19947, 19951, 19955, 19958, 
-    19962, 19966, 19969, 19973, 19977, 19981, 19985, 19988, 19992, 19996, 
-    20000, 20004, 20008, 20012, 20015, 20019, 20023, 20027, 20031, 20035, 
-    20039, 20043, 20047, 20051, 20055, 20059, 20063, 20067, 20071, 20075, 
-    20079, 20083, 20087, 20091, 20095, 20099, 20103, 20107, 20111, 20115, 
-    20119, 20123, 20127, 20131, 20135, 20139, 20143, 20147, 20151, 20155, 
-    20159, 20163, 20167, 20171, 20175, 20179, 20183, 20187, 20191, 20195, 
-    20199, 20203, 20207, 20211, 20215, 20219, 20223, 20227, 20231, 20235, 
-    20239, 20243, 20247, 20251, 20255, 20259, 20263, 20267, 20271, 20275, 
-    20279, 20283, 20287, 20291, 20295, 20299, 20303, 20307, 20311, 20315, 
-    20319, 20323, 20327, 20331, 20335, 20339, 20343, 20347, 20351, 20355, 
-    20359, 20363, 20367, 20371, 20375, 20379, 20383, 20387, 20391, 20395, 
-    20399, 20403, 20407, 20411, 20415, 20419, 20423, 20427, 20431, 20435, 
-    20439, 20443, 20447, 20451, 20455, 20459, 20463, 20467, 20471, 20475, 
-    20479, 20483, 20487, 20491, 20495, 20499, 20503, 20507, 20511, 20515, 
-    20519, 20523, 20527, 20531, 20535, 20539, 20543, 20547, 20551, 20555, 
-    20559, 20563, 20567, 20570, 20574, 20578, 20582, 20586, 20590, 20594, 
-    20598, 20602, 20606, 20610, 20614, 20618, 20622, 20626, 20630, 20634, 
-    20638, 20642, 20646, 20650, 20654, 20658, 20662, 20665, 20669, 20673, 
-    20677, 20681, 20685, 20689, 20693, 20697, 20701, 20705, 20709, 20713, 
-    20717, 20721, 20725, 20728, 20732, 20736, 20740, 20744, 20748, 20752, 
-    20756, 20759, 20763, 20767, 20771, 20775, 20779, 20783, 20787, 20791, 
-    20795, 20799, 20803, 20807, 20811, 20815, 20819, 20823, 20827, 20831, 
-    20835, 20839, 20843, 20847, 20851, 0, 20855, 20859, 20863, 20867, 0, 0, 
-    20871, 20875, 20879, 20883, 20887, 20891, 20895, 0, 20899, 0, 20903, 
-    20907, 20911, 20915, 0, 0, 20919, 20923, 20927, 20931, 20935, 20939, 
-    20943, 20947, 20951, 20955, 20959, 20963, 20967, 20971, 20975, 20979, 
-    20983, 20987, 20991, 20995, 20999, 21003, 21007, 21010, 21014, 21018, 
-    21022, 21026, 21030, 21034, 21038, 21042, 21046, 21050, 21054, 21058, 
-    21062, 21066, 21070, 21074, 21078, 0, 21082, 21086, 21090, 21094, 0, 0, 
-    21098, 21101, 21105, 21109, 21113, 21117, 21121, 21125, 21129, 21133, 
-    21137, 21141, 21145, 21149, 21153, 21157, 21161, 21166, 21171, 21176, 
-    21182, 21188, 21193, 21198, 21204, 21207, 21211, 21215, 21219, 21223, 
-    21227, 21231, 21235, 0, 21239, 21243, 21247, 21251, 0, 0, 21255, 21259, 
-    21263, 21267, 21271, 21275, 21279, 0, 21283, 0, 21287, 21291, 21295, 
-    21299, 0, 0, 21303, 21307, 21311, 21315, 21319, 21323, 21327, 21331, 
-    21335, 21340, 21345, 21350, 21356, 21362, 21367, 0, 21372, 21376, 21380, 
-    21384, 21388, 21392, 21396, 21400, 21404, 21408, 21412, 21416, 21420, 
-    21424, 21428, 21432, 21436, 21439, 21443, 21447, 21451, 21455, 21459, 
-    21463, 21467, 21471, 21475, 21479, 21483, 21487, 21491, 21495, 21499, 
-    21503, 21507, 21511, 21515, 21519, 21523, 21527, 21531, 21535, 21539, 
-    21543, 21547, 21551, 21555, 21559, 21563, 21567, 21571, 21575, 21579, 
-    21583, 21587, 21591, 21595, 0, 21599, 21603, 21607, 21611, 0, 0, 21615, 
-    21619, 21623, 21627, 21631, 21635, 21639, 21643, 21647, 21651, 21655, 
-    21659, 21663, 21667, 21671, 21675, 21679, 21683, 21687, 21691, 21695, 
-    21699, 21703, 21707, 21711, 21715, 21719, 21723, 21727, 21731, 21735, 
-    21739, 21743, 21747, 21751, 21755, 21759, 21763, 21767, 21771, 21775, 
-    21779, 21783, 21787, 21791, 21795, 21799, 21803, 21807, 21811, 21815, 
-    21819, 21823, 21827, 21831, 21835, 21839, 21842, 21846, 21850, 21854, 
-    21858, 21862, 21866, 21870, 21874, 21878, 0, 0, 21882, 21891, 21897, 
-    21902, 21906, 21909, 21914, 21917, 21920, 21923, 21928, 21932, 21937, 
-    21940, 21943, 21946, 21949, 21952, 21955, 21958, 21961, 21964, 21968, 
-    21972, 21976, 21980, 21984, 21988, 21992, 21996, 22000, 22004, 0, 0, 0, 
-    22010, 22016, 22020, 22024, 22028, 22034, 22038, 22042, 22046, 22052, 
-    22056, 22060, 22064, 22070, 22074, 22078, 22082, 22088, 22094, 22100, 
-    22108, 22114, 22120, 22126, 22132, 22138, 0, 0, 0, 0, 0, 0, 22144, 22147, 
-    22150, 22153, 22156, 22159, 22163, 22167, 22170, 22174, 22178, 22182, 
-    22186, 22190, 22193, 22197, 22201, 22205, 22209, 22213, 22217, 22221, 
-    22225, 22229, 22233, 22237, 22240, 22244, 22248, 22252, 22256, 22259, 
-    22263, 22267, 22271, 22275, 22279, 22283, 22287, 22291, 22295, 22299, 
-    22303, 22307, 22311, 22314, 22318, 22322, 22326, 22330, 22334, 22338, 
-    22342, 22346, 22350, 22354, 22358, 22362, 22366, 22370, 22374, 22378, 
-    22382, 22386, 22390, 22394, 22398, 22402, 22406, 22410, 22414, 22418, 
-    22422, 22426, 22430, 22434, 22438, 22442, 22446, 22450, 22453, 22457, 
-    22461, 22465, 22469, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22473, 22477, 
-    22480, 22484, 22487, 22491, 22494, 22498, 22504, 22509, 22513, 22516, 
-    22520, 22524, 22529, 22533, 22538, 22542, 22547, 22551, 22556, 22560, 
-    22565, 22571, 22575, 22580, 22584, 22589, 22595, 22599, 22605, 22611, 
-    22615, 22620, 22628, 22636, 22643, 22648, 22653, 22662, 22669, 22676, 
-    22681, 22687, 22691, 22695, 22699, 22703, 22707, 22711, 22715, 22719, 
-    22723, 22727, 22733, 22738, 22743, 22746, 22750, 22754, 22759, 22763, 
-    22768, 22772, 22777, 22781, 22786, 22790, 22795, 22799, 22804, 22808, 
-    22813, 22819, 22823, 22828, 22833, 22837, 22841, 22845, 22849, 22852, 
-    22856, 22862, 22867, 22872, 22876, 22880, 22884, 22889, 22893, 22898, 
-    22902, 22907, 22910, 22914, 22918, 22923, 22927, 22932, 22936, 22941, 
-    22947, 22951, 22955, 22959, 22963, 22967, 22971, 22975, 22979, 22983, 
-    22987, 22991, 22997, 23000, 23004, 23008, 23013, 23017, 23022, 23026, 
-    23031, 23035, 23040, 23044, 23049, 23053, 23058, 23062, 23067, 23073, 
-    23077, 23081, 23087, 23093, 23099, 23105, 23109, 23113, 23117, 23121, 
-    23125, 23129, 23135, 23139, 23143, 23147, 23152, 23156, 23161, 23165, 
-    23170, 23174, 23179, 23183, 23188, 23192, 23197, 23201, 23206, 23212, 
-    23216, 23222, 23226, 23230, 23234, 23238, 23242, 23246, 23252, 23255, 
-    23259, 23263, 23268, 23272, 23277, 23281, 23286, 23290, 23295, 23299, 
-    23304, 23308, 23313, 23317, 23322, 23328, 23331, 23335, 23339, 23344, 
-    23349, 23353, 23357, 23361, 23365, 23369, 23373, 23379, 23382, 23386, 
-    23390, 23395, 23399, 23404, 23408, 23413, 23419, 23423, 23428, 23432, 
-    23436, 23440, 23444, 23448, 23452, 23456, 23462, 23466, 23470, 23474, 
-    23479, 23483, 23488, 23492, 23497, 23501, 23506, 23510, 23515, 23519, 
-    23524, 23528, 23533, 23536, 23540, 23544, 23548, 23552, 23556, 23560, 
-    23564, 23568, 23574, 23577, 23581, 23585, 23590, 23594, 23599, 23603, 
-    23608, 23612, 23617, 23621, 23626, 23630, 23635, 23639, 23644, 23650, 
-    23654, 23660, 23664, 23670, 23676, 23682, 23688, 23694, 23700, 23706, 
-    23712, 23716, 23720, 23724, 23728, 23732, 23736, 23740, 23744, 23749, 
-    23753, 23758, 23762, 23767, 23771, 23776, 23780, 23785, 23789, 23794, 
-    23798, 23803, 23807, 23811, 23815, 23819, 23823, 23827, 23831, 23837, 
-    23840, 23844, 23848, 23853, 23857, 23862, 23866, 23871, 23875, 23880, 
-    23884, 23889, 23893, 23898, 23902, 23907, 23913, 23917, 23923, 23928, 
-    23934, 23938, 23944, 23949, 23953, 23957, 23961, 23965, 23969, 23974, 
-    23977, 23981, 23986, 23990, 23995, 23998, 24002, 24006, 24010, 24014, 
-    24018, 24022, 24026, 24030, 24034, 24038, 24042, 24047, 24051, 24055, 
-    24061, 24065, 24071, 24075, 24081, 24085, 24089, 24093, 24097, 24101, 
-    24106, 24110, 24114, 24118, 24122, 24126, 24130, 24134, 24138, 24142, 
-    24146, 24152, 24158, 24164, 24170, 24176, 24181, 24187, 24193, 24199, 
-    24203, 24207, 24211, 24215, 24219, 24223, 24227, 24231, 24235, 24239, 
-    24243, 24247, 24251, 24256, 24261, 24266, 24270, 24274, 24278, 24282, 
-    24286, 24290, 24294, 24298, 24302, 24306, 24312, 24318, 24324, 24330, 
-    24336, 24342, 24348, 24354, 24360, 24364, 24368, 24372, 24376, 24380, 
-    24384, 24388, 24394, 24400, 24406, 24412, 24418, 24424, 24430, 24436, 
-    24442, 24447, 24452, 24457, 24462, 24468, 24474, 24480, 24486, 24492, 
-    24498, 24504, 24509, 24515, 24521, 24527, 24532, 24538, 24544, 24550, 
-    24555, 24560, 24565, 24570, 24575, 24580, 24585, 24590, 24595, 24600, 
-    24605, 24610, 24614, 24619, 24624, 24629, 24634, 24639, 24644, 24649, 
-    24654, 24659, 24664, 24669, 24674, 24679, 24684, 24689, 24694, 24699, 
-    24704, 24709, 24714, 24719, 24724, 24729, 24734, 24739, 24744, 24749, 
-    24754, 24759, 24763, 24768, 24773, 24778, 24783, 24788, 24793, 24798, 
-    24803, 24808, 24813, 24818, 24823, 24828, 24833, 24838, 24843, 24848, 
-    24853, 24858, 24863, 24868, 24873, 24878, 24883, 24888, 24892, 24897, 
-    24902, 24907, 24912, 24917, 24921, 24926, 24931, 24936, 24941, 24946, 
-    24950, 24955, 24961, 24966, 24971, 24976, 24981, 24987, 24992, 24997, 
-    25002, 25007, 25012, 25017, 25022, 25027, 25032, 25037, 25042, 25047, 
-    25052, 25057, 25062, 25067, 25072, 25077, 25082, 25087, 25092, 25097, 
-    25102, 25107, 25112, 25117, 25122, 25127, 25132, 25137, 25142, 25147, 
-    25152, 25157, 25162, 25167, 25172, 25177, 25182, 25187, 25192, 25197, 
-    25202, 25207, 25213, 25218, 25223, 25228, 25233, 25238, 25243, 25248, 
-    25253, 25258, 25263, 25268, 25272, 25277, 25282, 25287, 25292, 25297, 
-    25302, 25307, 25312, 25317, 25322, 25327, 25332, 25337, 25342, 25347, 
-    25352, 25357, 25362, 25367, 25372, 25377, 25382, 25387, 25392, 25397, 
-    25402, 25408, 25412, 25416, 25420, 25424, 25428, 25432, 25436, 25440, 
-    25446, 25452, 25458, 25464, 25470, 25476, 25482, 25489, 25495, 25500, 
-    25505, 25510, 25515, 25520, 25525, 25530, 25535, 25540, 25545, 25550, 
-    25555, 25560, 25565, 25570, 25575, 25580, 25585, 25590, 25595, 25600, 
-    25605, 25610, 25615, 25620, 25625, 25630, 25635, 0, 0, 0, 25642, 25652, 
-    25656, 25663, 25667, 25671, 25675, 25683, 25687, 25692, 25697, 25702, 
-    25706, 25711, 25716, 25719, 25723, 25727, 25736, 25740, 25744, 25750, 
-    25754, 25758, 25766, 25770, 25778, 25784, 25790, 25796, 25802, 25812, 
-    25818, 25822, 25831, 25834, 25840, 25844, 25850, 25855, 25861, 25869, 
-    25875, 25881, 25889, 25895, 25899, 25903, 25913, 25919, 25923, 25933, 
-    25939, 25943, 25947, 25954, 25961, 25966, 25971, 25980, 25984, 25988, 
-    25992, 26000, 26007, 26011, 26015, 26019, 26023, 26027, 26031, 26035, 
-    26039, 26043, 26047, 26051, 26056, 26061, 26066, 26070, 26074, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26078, 26082, 26086, 26090, 26094, 
-    26099, 26104, 26109, 26114, 26118, 26122, 26127, 26131, 0, 26135, 26140, 
-    26145, 26149, 26153, 26158, 26163, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    26168, 26172, 26176, 26180, 26184, 26189, 26194, 26199, 26204, 26208, 
-    26212, 26217, 26221, 26225, 26229, 26234, 26239, 26243, 26247, 26252, 
-    26257, 26262, 26268, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26273, 26277, 26281, 
-    26285, 26289, 26294, 26299, 26304, 26309, 26313, 26317, 26322, 26326, 
-    26330, 26334, 26339, 26344, 26348, 26352, 26357, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 26362, 26366, 26370, 26374, 26378, 26383, 26388, 26393, 
-    26398, 26402, 26406, 26411, 26415, 0, 26419, 26424, 26429, 0, 26433, 
-    26438, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26443, 26446, 26450, 26454, 
-    26458, 26462, 26466, 26470, 26474, 26478, 26482, 26486, 26490, 26494, 
-    26498, 26502, 26506, 26510, 26513, 26517, 26521, 26525, 26529, 26533, 
-    26537, 26541, 26545, 26549, 26553, 26557, 26561, 26565, 26568, 26571, 
-    26575, 26579, 26585, 26591, 26597, 26603, 26609, 26615, 26621, 26627, 
-    26633, 26639, 26645, 26651, 26657, 26663, 26672, 26681, 26687, 26693, 
-    26699, 26704, 26708, 26713, 26718, 26723, 26727, 26732, 26737, 26742, 
-    26746, 26751, 26755, 26760, 26765, 26770, 26775, 26779, 26783, 26787, 
-    26791, 26795, 26799, 26803, 26807, 26811, 26815, 26821, 26825, 26829, 
-    26833, 26837, 26841, 26849, 26855, 26859, 26865, 26869, 26875, 26879, 0, 
-    0, 26883, 26887, 26890, 26893, 26896, 26899, 26902, 26905, 26908, 26911, 
-    0, 0, 0, 0, 0, 0, 26914, 26922, 26930, 26938, 26946, 26954, 26962, 26970, 
-    26978, 26986, 0, 0, 0, 0, 0, 0, 26994, 26997, 27000, 27003, 27008, 27011, 
-    27016, 27023, 27031, 27036, 27043, 27046, 27053, 27060, 27067, 0, 27071, 
-    27075, 27078, 27081, 27084, 27087, 27090, 27093, 27096, 27099, 0, 0, 0, 
-    0, 0, 0, 27102, 27105, 27108, 27111, 27114, 27117, 27121, 27125, 27129, 
-    27132, 27136, 27140, 27143, 27147, 27151, 27154, 27158, 27161, 27165, 
-    27169, 27173, 27177, 27181, 27184, 27187, 27191, 27195, 27198, 27202, 
-    27206, 27210, 27214, 27218, 27222, 27226, 27230, 27237, 27242, 27247, 
-    27252, 27257, 27263, 27269, 27275, 27281, 27286, 27292, 27298, 27303, 
-    27309, 27315, 27321, 27327, 27333, 27338, 27344, 27349, 27355, 27361, 
-    27367, 27373, 27379, 27384, 27389, 27395, 27401, 27406, 27412, 27417, 
-    27423, 27428, 27433, 27439, 27445, 27451, 27457, 27463, 27469, 27475, 
-    27481, 27487, 27493, 27499, 27505, 27510, 27515, 27520, 27526, 0, 0, 0, 
-    0, 0, 0, 0, 0, 27532, 27541, 27550, 27558, 27566, 27576, 27584, 27593, 
-    27600, 27607, 27614, 27622, 27630, 27638, 27646, 27654, 27662, 27670, 
-    27678, 27685, 27693, 27701, 27709, 27717, 27725, 27735, 27745, 27755, 
-    27765, 27775, 27785, 27795, 27805, 27815, 27825, 27835, 27845, 27855, 
-    27865, 27873, 27881, 27891, 27899, 0, 0, 0, 0, 0, 27909, 27913, 27917, 
-    27921, 27925, 27929, 27933, 27937, 27941, 27945, 27949, 27953, 27957, 
-    27961, 27965, 27969, 27973, 27977, 27981, 27985, 27989, 27993, 27997, 
-    28001, 28007, 28011, 28017, 28021, 28027, 28031, 28037, 28041, 28045, 
-    28049, 28053, 28057, 28061, 28067, 28073, 28079, 28085, 28090, 28096, 
-    28102, 28108, 28114, 28120, 28126, 28133, 28139, 28144, 28149, 28153, 
-    28157, 28161, 28165, 28169, 28173, 28177, 28183, 28189, 28195, 28200, 
-    28207, 28212, 28217, 28223, 28228, 28235, 28242, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 28249, 28255, 28259, 28264, 28269, 28274, 28279, 28284, 28289, 
-    28294, 28299, 28304, 28309, 28314, 28319, 28324, 28328, 28332, 28337, 
-    28342, 28347, 28351, 28355, 28359, 28364, 28369, 28374, 28379, 28383, 0, 
-    0, 0, 28387, 28392, 28397, 28402, 28408, 28414, 28420, 28426, 28431, 
-    28436, 28442, 28448, 0, 0, 0, 0, 28455, 28460, 28466, 28472, 28478, 
-    28483, 28488, 28493, 28498, 28504, 28509, 28514, 0, 0, 0, 0, 28519, 0, 0, 
-    0, 28524, 28529, 28534, 28539, 28543, 28547, 28551, 28555, 28559, 28563, 
-    28567, 28571, 28575, 28580, 28586, 28592, 28598, 28603, 28608, 28614, 
-    28620, 28626, 28631, 28637, 28642, 28648, 28654, 28659, 28665, 28671, 
-    28677, 28682, 28687, 28692, 28698, 28704, 28709, 28715, 28720, 28726, 
-    28731, 28737, 0, 0, 28743, 28749, 28755, 28761, 28767, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 28773, 28780, 28787, 28793, 28800, 28807, 28813, 28820, 
-    28827, 28834, 28840, 28846, 28853, 28859, 28865, 28872, 28879, 28885, 
-    28892, 28899, 28905, 28911, 28918, 28924, 28930, 28937, 28943, 28950, 
-    28957, 28964, 28971, 28978, 28985, 28991, 28998, 29005, 29011, 29018, 
-    29025, 29032, 29039, 29046, 29053, 29060, 0, 0, 0, 0, 29067, 29075, 
-    29082, 29089, 29095, 29102, 29108, 29115, 29121, 29128, 29135, 29142, 
-    29149, 29156, 29163, 29170, 29177, 29184, 29191, 29198, 29205, 29211, 
-    29218, 29225, 29232, 29238, 0, 0, 0, 0, 0, 0, 29244, 29250, 29255, 29260, 
-    29265, 29270, 29275, 29280, 29285, 29290, 29295, 0, 0, 0, 29301, 29307, 
-    29313, 29317, 29323, 29329, 29335, 29341, 29347, 29353, 29359, 29365, 
-    29371, 29377, 29383, 29389, 29395, 29401, 29407, 29411, 29417, 29423, 
-    29429, 29435, 29441, 29447, 29453, 29459, 29465, 29471, 29477, 29483, 
-    29489, 29495, 29501, 29505, 29510, 29515, 29520, 29524, 29529, 29533, 
-    29538, 29543, 29548, 29552, 29557, 29562, 29567, 29572, 29577, 29581, 
-    29585, 29590, 29595, 29599, 29603, 29607, 29612, 29617, 29622, 29627, 0, 
-    0, 29633, 29637, 29644, 29649, 29655, 29661, 29666, 29672, 29678, 29683, 
-    29689, 29695, 29701, 29706, 29712, 29717, 29722, 29728, 29733, 29739, 
-    29744, 29750, 29756, 29762, 29768, 29772, 29777, 29782, 29788, 29794, 
-    29799, 29805, 29811, 29815, 29820, 29825, 29829, 29834, 29839, 29844, 
-    29849, 29855, 29861, 29866, 29871, 29876, 29880, 29885, 29889, 29894, 
-    29898, 29903, 29908, 29913, 29918, 29924, 29930, 29937, 29947, 29956, 
-    29963, 29969, 29979, 29984, 29990, 0, 29995, 30000, 30005, 30013, 30019, 
-    30027, 30032, 30038, 30044, 30050, 30055, 30061, 30066, 30073, 30079, 
-    30084, 30090, 30096, 30102, 30109, 30116, 30123, 30128, 30133, 30140, 
-    30147, 30154, 30161, 30168, 0, 0, 30175, 30182, 30189, 30195, 30201, 
-    30207, 30213, 30219, 30225, 30231, 30237, 0, 0, 0, 0, 0, 0, 30243, 30249, 
-    30254, 30259, 30264, 30269, 30274, 30279, 30284, 30289, 0, 0, 0, 0, 0, 0, 
-    30294, 30299, 30304, 30309, 30314, 30319, 30324, 30333, 30340, 30345, 
-    30350, 30355, 30360, 30365, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18288, 18291, 18295, 18299, 18303, 
+    18307, 18311, 18315, 18319, 18323, 18327, 18331, 18335, 18339, 18343, 
+    18347, 18351, 18355, 18359, 18363, 18367, 18370, 18373, 18377, 18381, 
+    18385, 18388, 18391, 18394, 18398, 18402, 18405, 18408, 18412, 18415, 
+    18420, 18423, 18427, 18430, 18434, 18437, 18442, 18445, 18449, 18456, 
+    18461, 18465, 18470, 18474, 18479, 18483, 18488, 18495, 18501, 18506, 
+    18510, 18514, 18518, 18522, 18526, 18531, 18536, 18542, 18547, 18552, 
+    18556, 18559, 18562, 18565, 18568, 18571, 18574, 18577, 18580, 18583, 
+    18589, 18593, 18597, 18601, 18605, 18609, 18613, 18617, 18621, 18626, 
+    18630, 18635, 18640, 18646, 18651, 18657, 18663, 18669, 18675, 18681, 
+    18688, 18695, 18703, 18711, 18720, 18729, 18740, 18750, 18760, 18771, 
+    18782, 18792, 18802, 18812, 18822, 18832, 18842, 18852, 18862, 18870, 
+    18877, 18883, 18890, 18895, 18901, 18907, 18913, 18919, 18925, 18931, 
+    18936, 18942, 18948, 18954, 18960, 18965, 18973, 18980, 18986, 18993, 
+    19001, 19007, 19013, 19019, 19025, 19033, 19041, 19051, 19059, 19067, 
+    19073, 19078, 19083, 19088, 19093, 19098, 19103, 19108, 19113, 19118, 
+    19124, 19130, 19136, 19143, 19148, 19154, 19159, 19164, 19169, 19174, 
+    19179, 19184, 19189, 19194, 19199, 19204, 19209, 19214, 19219, 19224, 
+    19229, 19234, 19239, 19244, 19249, 19254, 19259, 19264, 19269, 19274, 
+    19279, 19284, 19289, 19294, 19299, 19304, 19309, 19314, 19319, 19324, 
+    19329, 19334, 19339, 0, 19344, 0, 0, 0, 0, 0, 19349, 0, 0, 19354, 19358, 
+    19362, 19366, 19370, 19374, 19378, 19382, 19386, 19390, 19394, 19398, 
+    19402, 19406, 19410, 19414, 19418, 19422, 19426, 19430, 19434, 19438, 
+    19442, 19446, 19450, 19454, 19458, 19462, 19466, 19470, 19474, 19478, 
+    19482, 19486, 19490, 19494, 19498, 19502, 19506, 19510, 19514, 19518, 
+    19524, 19528, 19533, 19538, 19542, 19547, 19552, 19556, 19560, 19564, 
+    19568, 19572, 19576, 19580, 19584, 19588, 19592, 19596, 19600, 19604, 
+    19608, 19612, 19616, 19620, 19624, 19628, 19632, 19636, 19640, 19644, 
+    19648, 19652, 19656, 19660, 19664, 19668, 19672, 19676, 19680, 19684, 
+    19688, 19692, 19696, 19700, 19704, 19708, 19712, 19716, 19720, 19724, 
+    19728, 19732, 19736, 19740, 19744, 19748, 19752, 19756, 19760, 19764, 
+    19768, 19772, 19776, 19780, 19784, 19788, 19792, 19796, 19800, 19804, 
+    19808, 19812, 19816, 19820, 19824, 19828, 19832, 19836, 19840, 19844, 
+    19848, 19852, 19856, 19860, 19864, 19868, 19872, 19876, 19880, 19884, 
+    19888, 19892, 19896, 19900, 19904, 19908, 19912, 19916, 19920, 19924, 
+    19928, 19932, 19936, 19940, 19943, 19947, 19950, 19954, 19958, 19961, 
+    19965, 19969, 19972, 19976, 19980, 19984, 19988, 19991, 19995, 19999, 
+    20003, 20007, 20011, 20015, 20018, 20022, 20026, 20030, 20034, 20038, 
+    20042, 20046, 20050, 20054, 20058, 20062, 20066, 20070, 20074, 20078, 
+    20082, 20086, 20090, 20094, 20098, 20102, 20106, 20110, 20114, 20118, 
+    20122, 20126, 20130, 20134, 20138, 20142, 20146, 20150, 20154, 20158, 
+    20162, 20166, 20170, 20174, 20178, 20182, 20186, 20190, 20194, 20198, 
+    20202, 20206, 20210, 20214, 20218, 20222, 20226, 20230, 20234, 20238, 
+    20242, 20246, 20250, 20254, 20258, 20262, 20266, 20270, 20274, 20278, 
+    20282, 20286, 20290, 20294, 20298, 20302, 20306, 20310, 20314, 20318, 
+    20322, 20326, 20330, 20334, 20338, 20342, 20346, 20350, 20354, 20358, 
+    20362, 20366, 20370, 20374, 20378, 20382, 20386, 20390, 20394, 20398, 
+    20402, 20406, 20410, 20414, 20418, 20422, 20426, 20430, 20434, 20438, 
+    20442, 20446, 20450, 20454, 20458, 20462, 20466, 20470, 20474, 20478, 
+    20482, 20486, 20490, 20494, 20498, 20502, 20506, 20510, 20514, 20518, 
+    20522, 20526, 20530, 20534, 20538, 20542, 20546, 20550, 20554, 20558, 
+    20562, 20566, 20570, 20573, 20577, 20581, 20585, 20589, 20593, 20597, 
+    20601, 20605, 20609, 20613, 20617, 20621, 20625, 20629, 20633, 20637, 
+    20641, 20645, 20649, 20653, 20657, 20661, 20665, 20668, 20672, 20676, 
+    20680, 20684, 20688, 20692, 20696, 20700, 20704, 20708, 20712, 20716, 
+    20720, 20724, 20728, 20731, 20735, 20739, 20743, 20747, 20751, 20755, 
+    20759, 20762, 20766, 20770, 20774, 20778, 20782, 20786, 20790, 20794, 
+    20798, 20802, 20806, 20810, 20814, 20818, 20822, 20826, 20830, 20834, 
+    20838, 20842, 20846, 20850, 20854, 0, 20858, 20862, 20866, 20870, 0, 0, 
+    20874, 20878, 20882, 20886, 20890, 20894, 20898, 0, 20902, 0, 20906, 
+    20910, 20914, 20918, 0, 0, 20922, 20926, 20930, 20934, 20938, 20942, 
+    20946, 20950, 20954, 20958, 20962, 20966, 20970, 20974, 20978, 20982, 
+    20986, 20990, 20994, 20998, 21002, 21006, 21010, 21013, 21017, 21021, 
+    21025, 21029, 21033, 21037, 21041, 21045, 21049, 21053, 21057, 21061, 
+    21065, 21069, 21073, 21077, 21081, 0, 21085, 21089, 21093, 21097, 0, 0, 
+    21101, 21104, 21108, 21112, 21116, 21120, 21124, 21128, 21132, 21136, 
+    21140, 21144, 21148, 21152, 21156, 21160, 21164, 21169, 21174, 21179, 
+    21185, 21191, 21196, 21201, 21207, 21210, 21214, 21218, 21222, 21226, 
+    21230, 21234, 21238, 0, 21242, 21246, 21250, 21254, 0, 0, 21258, 21262, 
+    21266, 21270, 21274, 21278, 21282, 0, 21286, 0, 21290, 21294, 21298, 
+    21302, 0, 0, 21306, 21310, 21314, 21318, 21322, 21326, 21330, 21334, 
+    21338, 21343, 21348, 21353, 21359, 21365, 21370, 0, 21375, 21379, 21383, 
+    21387, 21391, 21395, 21399, 21403, 21407, 21411, 21415, 21419, 21423, 
+    21427, 21431, 21435, 21439, 21442, 21446, 21450, 21454, 21458, 21462, 
+    21466, 21470, 21474, 21478, 21482, 21486, 21490, 21494, 21498, 21502, 
+    21506, 21510, 21514, 21518, 21522, 21526, 21530, 21534, 21538, 21542, 
+    21546, 21550, 21554, 21558, 21562, 21566, 21570, 21574, 21578, 21582, 
+    21586, 21590, 21594, 21598, 0, 21602, 21606, 21610, 21614, 0, 0, 21618, 
+    21622, 21626, 21630, 21634, 21638, 21642, 21646, 21650, 21654, 21658, 
+    21662, 21666, 21670, 21674, 21678, 21682, 21686, 21690, 21694, 21698, 
+    21702, 21706, 21710, 21714, 21718, 21722, 21726, 21730, 21734, 21738, 
+    21742, 21746, 21750, 21754, 21758, 21762, 21766, 21770, 21774, 21778, 
+    21782, 21786, 21790, 21794, 21798, 21802, 21806, 21810, 21814, 21818, 
+    21822, 21826, 21830, 21834, 21838, 21842, 21845, 21849, 21853, 21857, 
+    21861, 21865, 21869, 21873, 21877, 21881, 0, 0, 21885, 21894, 21900, 
+    21905, 21909, 21912, 21917, 21920, 21923, 21926, 21931, 21935, 21940, 
+    21943, 21946, 21949, 21952, 21955, 21958, 21961, 21964, 21967, 21971, 
+    21975, 21979, 21983, 21987, 21991, 21995, 21999, 22003, 22007, 0, 0, 0, 
+    22013, 22019, 22023, 22027, 22031, 22037, 22041, 22045, 22049, 22055, 
+    22059, 22063, 22067, 22073, 22077, 22081, 22085, 22091, 22097, 22103, 
+    22111, 22117, 22123, 22129, 22135, 22141, 0, 0, 0, 0, 0, 0, 22147, 22150, 
+    22153, 22156, 22159, 22162, 22166, 22170, 22173, 22177, 22181, 22185, 
+    22189, 22193, 22196, 22200, 22204, 22208, 22212, 22216, 22220, 22224, 
+    22228, 22232, 22236, 22240, 22243, 22247, 22251, 22255, 22259, 22262, 
+    22266, 22270, 22274, 22278, 22282, 22286, 22290, 22294, 22298, 22302, 
+    22306, 22310, 22314, 22317, 22321, 22325, 22329, 22333, 22337, 22341, 
+    22345, 22349, 22353, 22357, 22361, 22365, 22369, 22373, 22377, 22381, 
+    22385, 22389, 22393, 22397, 22401, 22405, 22409, 22413, 22417, 22421, 
+    22425, 22429, 22433, 22437, 22441, 22445, 22449, 22453, 22456, 22460, 
+    22464, 22468, 22472, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22476, 22480, 
+    22483, 22487, 22490, 22494, 22497, 22501, 22507, 22512, 22516, 22519, 
+    22523, 22527, 22532, 22536, 22541, 22545, 22550, 22554, 22559, 22563, 
+    22568, 22574, 22578, 22583, 22587, 22592, 22598, 22602, 22608, 22614, 
+    22618, 22623, 22631, 22639, 22646, 22651, 22656, 22665, 22672, 22679, 
+    22684, 22690, 22694, 22698, 22702, 22706, 22710, 22714, 22718, 22722, 
+    22726, 22730, 22736, 22741, 22746, 22749, 22753, 22757, 22762, 22766, 
+    22771, 22775, 22780, 22784, 22789, 22793, 22798, 22802, 22807, 22811, 
+    22816, 22822, 22826, 22831, 22836, 22840, 22844, 22848, 22852, 22855, 
+    22859, 22865, 22870, 22875, 22879, 22883, 22887, 22892, 22896, 22901, 
+    22905, 22910, 22913, 22917, 22921, 22926, 22930, 22935, 22939, 22944, 
+    22950, 22954, 22958, 22962, 22966, 22970, 22974, 22978, 22982, 22986, 
+    22990, 22994, 23000, 23003, 23007, 23011, 23016, 23020, 23025, 23029, 
+    23034, 23038, 23043, 23047, 23052, 23056, 23061, 23065, 23070, 23076, 
+    23080, 23084, 23090, 23096, 23102, 23108, 23112, 23116, 23120, 23124, 
+    23128, 23132, 23138, 23142, 23146, 23150, 23155, 23159, 23164, 23168, 
+    23173, 23177, 23182, 23186, 23191, 23195, 23200, 23204, 23209, 23215, 
+    23219, 23225, 23229, 23233, 23237, 23241, 23245, 23249, 23255, 23258, 
+    23262, 23266, 23271, 23275, 23280, 23284, 23289, 23293, 23298, 23302, 
+    23307, 23311, 23316, 23320, 23325, 23331, 23334, 23338, 23342, 23347, 
+    23352, 23356, 23360, 23364, 23368, 23372, 23376, 23382, 23385, 23389, 
+    23393, 23398, 23402, 23407, 23411, 23416, 23422, 23426, 23431, 23435, 
+    23439, 23443, 23447, 23451, 23455, 23459, 23465, 23469, 23473, 23477, 
+    23482, 23486, 23491, 23495, 23500, 23504, 23509, 23513, 23518, 23522, 
+    23527, 23531, 23536, 23539, 23543, 23547, 23551, 23555, 23559, 23563, 
+    23567, 23571, 23577, 23580, 23584, 23588, 23593, 23597, 23602, 23606, 
+    23611, 23615, 23620, 23624, 23629, 23633, 23638, 23642, 23647, 23653, 
+    23657, 23663, 23667, 23673, 23679, 23685, 23691, 23697, 23703, 23709, 
+    23715, 23719, 23723, 23727, 23731, 23735, 23739, 23743, 23747, 23752, 
+    23756, 23761, 23765, 23770, 23774, 23779, 23783, 23788, 23792, 23797, 
+    23801, 23806, 23810, 23814, 23818, 23822, 23826, 23830, 23834, 23840, 
+    23843, 23847, 23851, 23856, 23860, 23865, 23869, 23874, 23878, 23883, 
+    23887, 23892, 23896, 23901, 23905, 23910, 23916, 23920, 23926, 23931, 
+    23937, 23941, 23947, 23952, 23956, 23960, 23964, 23968, 23972, 23977, 
+    23980, 23984, 23989, 23993, 23998, 24001, 24005, 24009, 24013, 24017, 
+    24021, 24025, 24029, 24033, 24037, 24041, 24045, 24050, 24054, 24058, 
+    24064, 24068, 24074, 24078, 24084, 24088, 24092, 24096, 24100, 24104, 
+    24109, 24113, 24117, 24121, 24125, 24129, 24133, 24137, 24141, 24145, 
+    24149, 24155, 24161, 24167, 24173, 24179, 24184, 24190, 24196, 24202, 
+    24206, 24210, 24214, 24218, 24222, 24226, 24230, 24234, 24238, 24242, 
+    24246, 24250, 24254, 24259, 24264, 24269, 24273, 24277, 24281, 24285, 
+    24289, 24293, 24297, 24301, 24305, 24309, 24315, 24321, 24327, 24333, 
+    24339, 24345, 24351, 24357, 24363, 24367, 24371, 24375, 24379, 24383, 
+    24387, 24391, 24397, 24403, 24409, 24415, 24421, 24427, 24433, 24439, 
+    24445, 24450, 24455, 24460, 24465, 24471, 24477, 24483, 24489, 24495, 
+    24501, 24507, 24512, 24518, 24524, 24530, 24535, 24541, 24547, 24553, 
+    24558, 24563, 24568, 24573, 24578, 24583, 24588, 24593, 24598, 24603, 
+    24608, 24613, 24617, 24622, 24627, 24632, 24637, 24642, 24647, 24652, 
+    24657, 24662, 24667, 24672, 24677, 24682, 24687, 24692, 24697, 24702, 
+    24707, 24712, 24717, 24722, 24727, 24732, 24737, 24742, 24747, 24752, 
+    24757, 24762, 24766, 24771, 24776, 24781, 24786, 24791, 24796, 24801, 
+    24806, 24811, 24816, 24821, 24826, 24831, 24836, 24841, 24846, 24851, 
+    24856, 24861, 24866, 24871, 24876, 24881, 24886, 24891, 24895, 24900, 
+    24905, 24910, 24915, 24920, 24924, 24929, 24934, 24939, 24944, 24949, 
+    24953, 24958, 24964, 24969, 24974, 24979, 24984, 24990, 24995, 25000, 
+    25005, 25010, 25015, 25020, 25025, 25030, 25035, 25040, 25045, 25050, 
+    25055, 25060, 25065, 25070, 25075, 25080, 25085, 25090, 25095, 25100, 
+    25105, 25110, 25115, 25120, 25125, 25130, 25135, 25140, 25145, 25150, 
+    25155, 25160, 25165, 25170, 25175, 25180, 25185, 25190, 25195, 25200, 
+    25205, 25210, 25216, 25221, 25226, 25231, 25236, 25241, 25246, 25251, 
+    25256, 25261, 25266, 25271, 25275, 25280, 25285, 25290, 25295, 25300, 
+    25305, 25310, 25315, 25320, 25325, 25330, 25335, 25340, 25345, 25350, 
+    25355, 25360, 25365, 25370, 25375, 25380, 25385, 25390, 25395, 25400, 
+    25405, 25411, 25415, 25419, 25423, 25427, 25431, 25435, 25439, 25443, 
+    25449, 25455, 25461, 25467, 25473, 25479, 25485, 25492, 25498, 25503, 
+    25508, 25513, 25518, 25523, 25528, 25533, 25538, 25543, 25548, 25553, 
+    25558, 25563, 25568, 25573, 25578, 25583, 25588, 25593, 25598, 25603, 
+    25608, 25613, 25618, 25623, 25628, 25633, 25638, 0, 0, 0, 25645, 25655, 
+    25659, 25666, 25670, 25674, 25678, 25686, 25690, 25695, 25700, 25705, 
+    25709, 25714, 25719, 25722, 25726, 25730, 25739, 25743, 25747, 25753, 
+    25757, 25761, 25769, 25773, 25781, 25787, 25793, 25799, 25805, 25815, 
+    25821, 25825, 25834, 25837, 25843, 25847, 25853, 25858, 25864, 25872, 
+    25878, 25884, 25892, 25898, 25902, 25906, 25916, 25922, 25926, 25936, 
+    25942, 25946, 25950, 25957, 25964, 25969, 25974, 25983, 25987, 25991, 
+    25995, 26003, 26010, 26014, 26018, 26022, 26026, 26030, 26034, 26038, 
+    26042, 26046, 26050, 26054, 26059, 26064, 26069, 26073, 26077, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26081, 26085, 26089, 26093, 26097, 
+    26102, 26107, 26112, 26117, 26121, 26125, 26130, 26134, 0, 26138, 26143, 
+    26148, 26152, 26156, 26161, 26166, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    26171, 26175, 26179, 26183, 26187, 26192, 26197, 26202, 26207, 26211, 
+    26215, 26220, 26224, 26228, 26232, 26237, 26242, 26246, 26250, 26255, 
+    26260, 26265, 26271, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26276, 26280, 26284, 
+    26288, 26292, 26297, 26302, 26307, 26312, 26316, 26320, 26325, 26329, 
+    26333, 26337, 26342, 26347, 26351, 26355, 26360, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 26365, 26369, 26373, 26377, 26381, 26386, 26391, 26396, 
+    26401, 26405, 26409, 26414, 26418, 0, 26422, 26427, 26432, 0, 26436, 
+    26441, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26446, 26449, 26453, 26457, 
+    26461, 26465, 26469, 26473, 26477, 26481, 26485, 26489, 26493, 26497, 
+    26501, 26505, 26509, 26513, 26516, 26520, 26524, 26528, 26532, 26536, 
+    26540, 26544, 26548, 26552, 26556, 26560, 26564, 26568, 26571, 26574, 
+    26578, 26582, 26588, 26594, 26600, 26606, 26612, 26618, 26624, 26630, 
+    26636, 26642, 26648, 26654, 26660, 26666, 26675, 26684, 26690, 26696, 
+    26702, 26707, 26711, 26716, 26721, 26726, 26730, 26735, 26740, 26745, 
+    26749, 26754, 26758, 26763, 26768, 26773, 26778, 26782, 26786, 26790, 
+    26794, 26798, 26802, 26806, 26810, 26814, 26818, 26824, 26828, 26832, 
+    26836, 26840, 26844, 26852, 26858, 26862, 26868, 26872, 26878, 26882, 0, 
+    0, 26886, 26890, 26893, 26896, 26899, 26902, 26905, 26908, 26911, 26914, 
+    0, 0, 0, 0, 0, 0, 26917, 26925, 26933, 26941, 26949, 26957, 26965, 26973, 
+    26981, 26989, 0, 0, 0, 0, 0, 0, 26997, 27000, 27003, 27006, 27011, 27014, 
+    27019, 27026, 27034, 27039, 27046, 27049, 27056, 27063, 27070, 0, 27074, 
+    27078, 27081, 27084, 27087, 27090, 27093, 27096, 27099, 27102, 0, 0, 0, 
+    0, 0, 0, 27105, 27108, 27111, 27114, 27117, 27120, 27124, 27128, 27132, 
+    27135, 27139, 27143, 27146, 27150, 27154, 27157, 27161, 27164, 27168, 
+    27172, 27176, 27180, 27184, 27187, 27190, 27194, 27198, 27201, 27205, 
+    27209, 27213, 27217, 27221, 27225, 27229, 27233, 27240, 27245, 27250, 
+    27255, 27260, 27266, 27272, 27278, 27284, 27289, 27295, 27301, 27306, 
+    27312, 27318, 27324, 27330, 27336, 27341, 27347, 27352, 27358, 27364, 
+    27370, 27376, 27382, 27387, 27392, 27398, 27404, 27409, 27415, 27420, 
+    27426, 27431, 27436, 27442, 27448, 27454, 27460, 27466, 27472, 27478, 
+    27484, 27490, 27496, 27502, 27508, 27513, 27518, 27523, 27529, 0, 0, 0, 
+    0, 0, 0, 0, 0, 27535, 27544, 27553, 27561, 27569, 27579, 27587, 27596, 
+    27603, 27610, 27617, 27625, 27633, 27641, 27649, 27657, 27665, 27673, 
+    27681, 27688, 27696, 27704, 27712, 27720, 27728, 27738, 27748, 27758, 
+    27768, 27778, 27788, 27798, 27808, 27818, 27828, 27838, 27848, 27858, 
+    27868, 27876, 27884, 27894, 27902, 0, 0, 0, 0, 0, 27912, 27916, 27920, 
+    27924, 27928, 27932, 27936, 27940, 27944, 27948, 27952, 27956, 27960, 
+    27964, 27968, 27972, 27976, 27980, 27984, 27988, 27992, 27996, 28000, 
+    28004, 28010, 28014, 28020, 28024, 28030, 28034, 28040, 28044, 28048, 
+    28052, 28056, 28060, 28064, 28070, 28076, 28082, 28088, 28093, 28099, 
+    28105, 28111, 28117, 28123, 28129, 28136, 28142, 28147, 28152, 28156, 
+    28160, 28164, 28168, 28172, 28176, 28180, 28186, 28192, 28198, 28203, 
+    28210, 28215, 28220, 28226, 28231, 28238, 28245, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 28252, 28258, 28262, 28267, 28272, 28277, 28282, 28287, 28292, 
+    28297, 28302, 28307, 28312, 28317, 28322, 28327, 28331, 28335, 28340, 
+    28345, 28350, 28354, 28358, 28362, 28367, 28372, 28377, 28382, 28386, 0, 
+    0, 0, 28390, 28395, 28400, 28405, 28411, 28417, 28423, 28429, 28434, 
+    28439, 28445, 28451, 0, 0, 0, 0, 28458, 28463, 28469, 28475, 28481, 
+    28486, 28491, 28496, 28501, 28507, 28512, 28517, 0, 0, 0, 0, 28522, 0, 0, 
+    0, 28527, 28532, 28537, 28542, 28546, 28550, 28554, 28558, 28562, 28566, 
+    28570, 28574, 28578, 28583, 28589, 28595, 28601, 28606, 28611, 28617, 
+    28623, 28629, 28634, 28640, 28645, 28651, 28657, 28662, 28668, 28674, 
+    28680, 28685, 28690, 28695, 28701, 28707, 28712, 28718, 28723, 28729, 
+    28734, 28740, 0, 0, 28746, 28752, 28758, 28764, 28770, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 28776, 28783, 28790, 28796, 28803, 28810, 28816, 28823, 
+    28830, 28837, 28843, 28849, 28856, 28862, 28868, 28875, 28882, 28888, 
+    28895, 28902, 28908, 28914, 28921, 28927, 28933, 28940, 28946, 28953, 
+    28960, 28967, 28974, 28981, 28988, 28994, 29001, 29008, 29014, 29021, 
+    29028, 29035, 29042, 29049, 29056, 29063, 0, 0, 0, 0, 29070, 29078, 
+    29085, 29092, 29098, 29105, 29111, 29118, 29124, 29131, 29138, 29145, 
+    29152, 29159, 29166, 29173, 29180, 29187, 29194, 29201, 29208, 29214, 
+    29221, 29228, 29235, 29241, 0, 0, 0, 0, 0, 0, 29247, 29253, 29258, 29263, 
+    29268, 29273, 29278, 29283, 29288, 29293, 29298, 0, 0, 0, 29304, 29310, 
+    29316, 29320, 29326, 29332, 29338, 29344, 29350, 29356, 29362, 29368, 
+    29374, 29380, 29386, 29392, 29398, 29404, 29410, 29414, 29420, 29426, 
+    29432, 29438, 29444, 29450, 29456, 29462, 29468, 29474, 29480, 29486, 
+    29492, 29498, 29504, 29508, 29513, 29518, 29523, 29527, 29532, 29536, 
+    29541, 29546, 29551, 29555, 29560, 29565, 29570, 29575, 29580, 29584, 
+    29588, 29593, 29598, 29602, 29606, 29610, 29615, 29620, 29625, 29630, 0, 
+    0, 29636, 29640, 29647, 29652, 29658, 29664, 29669, 29675, 29681, 29686, 
+    29692, 29698, 29704, 29709, 29715, 29720, 29725, 29731, 29736, 29742, 
+    29747, 29753, 29759, 29765, 29771, 29775, 29780, 29785, 29791, 29797, 
+    29802, 29808, 29814, 29818, 29823, 29828, 29832, 29837, 29842, 29847, 
+    29852, 29858, 29864, 29869, 29874, 29879, 29883, 29888, 29892, 29897, 
+    29901, 29906, 29911, 29916, 29921, 29927, 29933, 29940, 29950, 29959, 
+    29966, 29972, 29982, 29987, 29993, 0, 29998, 30003, 30008, 30016, 30022, 
+    30030, 30035, 30041, 30047, 30053, 30058, 30064, 30069, 30076, 30082, 
+    30087, 30093, 30099, 30105, 30112, 30119, 30126, 30131, 30136, 30143, 
+    30150, 30157, 30164, 30171, 0, 0, 30178, 30185, 30192, 30198, 30204, 
+    30210, 30216, 30222, 30228, 30234, 30240, 0, 0, 0, 0, 0, 0, 30246, 30252, 
+    30257, 30262, 30267, 30272, 30277, 30282, 30287, 30292, 0, 0, 0, 0, 0, 0, 
+    30297, 30302, 30307, 30312, 30317, 30322, 30327, 30336, 30343, 30348, 
+    30353, 30358, 30363, 30368, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30370, 30376, 
-    30382, 30386, 30390, 30394, 30398, 30404, 30408, 30414, 30418, 30424, 
-    30430, 30438, 30444, 30452, 30456, 30460, 30464, 30470, 30473, 30479, 
-    30483, 30489, 30493, 30497, 30503, 30507, 30513, 30517, 30523, 30531, 
-    30539, 30547, 30553, 30557, 30563, 30567, 30573, 30576, 30579, 30585, 
-    30589, 30595, 30598, 30601, 30604, 30608, 30612, 30618, 30624, 30627, 
-    30630, 30634, 30639, 30644, 30651, 30656, 30663, 30670, 30679, 30686, 
-    30695, 30700, 30707, 30714, 30723, 30728, 30735, 30740, 30746, 30752, 
-    30758, 30764, 30770, 30776, 0, 0, 0, 0, 30782, 30786, 30789, 30792, 
-    30795, 30798, 30801, 30804, 30807, 30810, 30813, 30816, 30819, 30822, 
-    30827, 30832, 30837, 30840, 30845, 30850, 30855, 30860, 30867, 30872, 
-    30877, 30882, 30887, 30894, 30900, 30906, 30912, 30918, 30924, 30933, 
-    30942, 30948, 30954, 30962, 30970, 30979, 30988, 30996, 31004, 31013, 
-    31022, 0, 0, 0, 31030, 31034, 31038, 31042, 31045, 31048, 31051, 31055, 
-    31058, 31061, 31065, 31068, 31072, 31076, 31080, 31084, 31088, 31092, 
-    31096, 31100, 31104, 31107, 31110, 31114, 31118, 31122, 31125, 31128, 
-    31131, 31135, 31139, 31142, 31146, 31149, 31154, 31159, 31164, 31169, 
-    31174, 31179, 31184, 31189, 31194, 31198, 31202, 31208, 31215, 31219, 
-    31223, 31227, 31230, 31233, 31236, 31239, 31242, 31245, 31248, 31251, 
-    31254, 31257, 31261, 31265, 31269, 31274, 31278, 31282, 31288, 31292, 
-    31298, 31304, 31309, 31316, 31320, 31326, 31330, 31336, 31341, 31348, 
-    31355, 31360, 31367, 31372, 31377, 31381, 31387, 31391, 31397, 31404, 
-    31411, 31415, 31421, 31427, 31431, 31437, 31442, 31447, 31454, 31459, 
-    31464, 31469, 31474, 31478, 31482, 31487, 31492, 31499, 31505, 31510, 
-    31517, 31522, 31529, 31534, 31543, 31549, 31555, 31559, 0, 0, 0, 0, 0, 0, 
-    0, 0, 31563, 31572, 31579, 31586, 31593, 31596, 31600, 31604, 31608, 
-    31612, 31616, 31620, 31624, 31628, 31632, 31636, 31640, 31644, 31647, 
-    31650, 31654, 31658, 31662, 31666, 31670, 31674, 31677, 31681, 31685, 
-    31689, 31693, 31696, 31699, 31703, 31706, 31710, 31714, 31717, 31721, 
-    31725, 31728, 31733, 31738, 31743, 31747, 31751, 31756, 31760, 31765, 
-    31769, 31774, 31778, 31782, 31787, 31792, 31796, 31801, 31806, 31811, 
-    31815, 0, 0, 0, 31819, 31824, 31833, 31838, 31845, 31850, 31854, 31857, 
-    31860, 31863, 31866, 31869, 31872, 31875, 31878, 0, 0, 0, 31881, 31885, 
-    31889, 31893, 31900, 31906, 31912, 31918, 31924, 31930, 31936, 31942, 
-    31948, 31954, 31961, 31968, 31975, 31982, 31989, 31996, 32003, 32010, 
-    32017, 32024, 32031, 32038, 32045, 32052, 32059, 32066, 32073, 32080, 
-    32087, 32094, 32101, 32108, 32115, 32122, 32129, 32136, 32143, 32150, 
-    32157, 32164, 32172, 32180, 32188, 32194, 32200, 32206, 32214, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30373, 30379, 
+    30385, 30389, 30393, 30397, 30401, 30407, 30411, 30417, 30421, 30427, 
+    30433, 30441, 30447, 30455, 30459, 30463, 30467, 30473, 30476, 30482, 
+    30486, 30492, 30496, 30500, 30506, 30510, 30516, 30520, 30526, 30534, 
+    30542, 30550, 30556, 30560, 30566, 30570, 30576, 30579, 30582, 30588, 
+    30592, 30598, 30601, 30604, 30607, 30611, 30615, 30621, 30627, 30630, 
+    30633, 30637, 30642, 30647, 30654, 30659, 30666, 30673, 30682, 30689, 
+    30698, 30703, 30710, 30717, 30726, 30731, 30738, 30743, 30749, 30755, 
+    30761, 30767, 30773, 30779, 0, 0, 0, 0, 30785, 30789, 30792, 30795, 
+    30798, 30801, 30804, 30807, 30810, 30813, 30816, 30819, 30822, 30825, 
+    30830, 30835, 30840, 30843, 30848, 30853, 30858, 30863, 30870, 30875, 
+    30880, 30885, 30890, 30897, 30903, 30909, 30915, 30921, 30927, 30936, 
+    30945, 30951, 30957, 30965, 30973, 30982, 30991, 30999, 31007, 31016, 
+    31025, 0, 0, 0, 31033, 31037, 31041, 31045, 31048, 31051, 31054, 31058, 
+    31061, 31064, 31068, 31071, 31075, 31079, 31083, 31087, 31091, 31095, 
+    31099, 31103, 31107, 31110, 31113, 31117, 31121, 31125, 31128, 31131, 
+    31134, 31138, 31142, 31145, 31149, 31152, 31157, 31162, 31167, 31172, 
+    31177, 31182, 31187, 31192, 31197, 31201, 31205, 31211, 31218, 31222, 
+    31226, 31230, 31233, 31236, 31239, 31242, 31245, 31248, 31251, 31254, 
+    31257, 31260, 31264, 31268, 31272, 31277, 31281, 31285, 31291, 31295, 
+    31301, 31307, 31312, 31319, 31323, 31329, 31333, 31339, 31344, 31351, 
+    31358, 31363, 31370, 31375, 31380, 31384, 31390, 31394, 31400, 31407, 
+    31414, 31418, 31424, 31430, 31434, 31440, 31445, 31450, 31457, 31462, 
+    31467, 31472, 31477, 31481, 31485, 31490, 31495, 31502, 31508, 31513, 
+    31520, 31525, 31532, 31537, 31546, 31552, 31558, 31562, 0, 0, 0, 0, 0, 0, 
+    0, 0, 31566, 31575, 31582, 31589, 31596, 31599, 31603, 31607, 31611, 
+    31615, 31619, 31623, 31627, 31631, 31635, 31639, 31643, 31647, 31650, 
+    31653, 31657, 31661, 31665, 31669, 31673, 31677, 31680, 31684, 31688, 
+    31692, 31696, 31699, 31702, 31706, 31709, 31713, 31717, 31720, 31724, 
+    31728, 31731, 31736, 31741, 31746, 31750, 31754, 31759, 31763, 31768, 
+    31772, 31777, 31781, 31785, 31790, 31795, 31799, 31804, 31809, 31814, 
+    31818, 0, 0, 0, 31822, 31827, 31836, 31841, 31848, 31853, 31857, 31860, 
+    31863, 31866, 31869, 31872, 31875, 31878, 31881, 0, 0, 0, 31884, 31888, 
+    31892, 31896, 31903, 31909, 31915, 31921, 31927, 31933, 31939, 31945, 
+    31951, 31957, 31964, 31971, 31978, 31985, 31992, 31999, 32006, 32013, 
+    32020, 32027, 32034, 32041, 32048, 32055, 32062, 32069, 32076, 32083, 
+    32090, 32097, 32104, 32111, 32118, 32125, 32132, 32139, 32146, 32153, 
+    32160, 32167, 32175, 32183, 32191, 32197, 32203, 32209, 32217, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32223, 32230, 32237, 32244, 32251, 
-    32260, 32269, 32278, 0, 0, 0, 0, 0, 0, 0, 0, 32287, 32292, 32297, 32302, 
-    32307, 32316, 32327, 32336, 32347, 32353, 32366, 32372, 32379, 32386, 
-    32391, 32397, 32403, 32414, 32423, 32430, 32437, 32446, 32453, 32462, 
-    32472, 32482, 32489, 32496, 32503, 32513, 32518, 32526, 32532, 32540, 
-    32549, 32554, 32561, 32567, 32572, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32577, 
-    32582, 32588, 32595, 32603, 32609, 32615, 32621, 32626, 32633, 32639, 
-    32645, 32651, 32659, 32664, 32672, 32677, 32683, 32689, 32696, 32704, 
-    32711, 32717, 32724, 32731, 32737, 32744, 32751, 32757, 32762, 32768, 
-    32776, 32784, 32790, 32796, 32802, 32808, 32816, 32820, 32826, 32832, 
-    32838, 32844, 32850, 32856, 32860, 32865, 32870, 32877, 32882, 32886, 
-    32892, 32897, 32902, 32906, 32911, 32916, 32920, 32924, 32929, 32936, 
-    32940, 32945, 32950, 32954, 32959, 32963, 32968, 32972, 32978, 32983, 
-    32990, 32995, 33000, 33004, 33009, 33014, 33021, 33026, 33032, 33037, 
-    33041, 33046, 33050, 33055, 33062, 33069, 33074, 33079, 33083, 33089, 
-    33095, 33100, 33105, 33110, 33116, 33121, 33127, 33132, 33138, 33144, 
-    33150, 33157, 33164, 33171, 33178, 33185, 33192, 33197, 33205, 33214, 
-    33223, 33232, 33241, 33250, 33259, 33271, 33280, 33289, 33298, 33305, 
-    33310, 33317, 33325, 33333, 33340, 33347, 33354, 33361, 33369, 33378, 
-    33387, 33396, 33405, 33414, 33423, 33432, 33441, 33450, 33459, 33468, 
-    33477, 33486, 33495, 33503, 33512, 33523, 33531, 33540, 33551, 33560, 
-    33569, 33578, 33587, 33595, 33604, 33611, 33616, 33624, 33629, 33636, 
-    33641, 33650, 33656, 33663, 33670, 33675, 33680, 33688, 33696, 33705, 
-    33714, 33719, 33726, 33737, 33745, 33754, 33760, 33766, 33771, 33778, 
-    33783, 33792, 33797, 33802, 33807, 33814, 33821, 33826, 33835, 33843, 
-    33848, 33853, 33860, 33867, 33871, 33875, 33878, 33881, 33884, 33887, 
-    33890, 33893, 33900, 33903, 33906, 33911, 33915, 33919, 33923, 33927, 
-    33931, 33940, 33946, 33952, 33958, 33966, 33974, 33980, 33986, 33993, 
-    33999, 34004, 34010, 34016, 34022, 34029, 34035, 34043, 34049, 34056, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34062, 34069, 
-    34076, 34081, 34090, 34098, 34106, 34113, 34120, 34127, 34134, 34142, 
-    34150, 34160, 34170, 34178, 34186, 34194, 34202, 34211, 34220, 34228, 
-    34236, 34245, 34254, 34264, 34274, 34283, 34292, 34300, 34308, 34316, 
-    34324, 34334, 34344, 34352, 34360, 34368, 34376, 34384, 34392, 34400, 
-    34408, 34416, 34424, 34432, 34440, 34449, 34458, 34467, 34476, 34486, 
-    34496, 34503, 34510, 34518, 34526, 34535, 34544, 34552, 34560, 34572, 
-    34584, 34593, 34602, 34611, 34620, 34627, 34634, 34642, 34650, 34658, 
-    34666, 34674, 34682, 34690, 34698, 34707, 34716, 34725, 34734, 34743, 
-    34752, 34762, 34772, 34782, 34792, 34801, 34810, 34817, 34824, 34832, 
-    34840, 34848, 34856, 34864, 34872, 34884, 34896, 34905, 34914, 34922, 
-    34930, 34938, 34946, 34957, 34968, 34979, 34990, 35002, 35014, 35022, 
-    35030, 35038, 35046, 35055, 35064, 35073, 35082, 35090, 35098, 35106, 
-    35114, 35122, 35130, 35139, 35148, 35158, 35168, 35175, 35182, 35190, 
-    35198, 35206, 35214, 35221, 35228, 35236, 35244, 35252, 35260, 35268, 
-    35276, 35284, 35292, 35300, 35308, 35316, 35324, 35332, 35340, 35348, 
-    35356, 35365, 35374, 35383, 35391, 35400, 35409, 35418, 35427, 35437, 
-    35446, 35453, 35458, 35465, 35472, 35480, 35488, 35497, 35506, 35516, 
-    35526, 35537, 35548, 35557, 35566, 35576, 35586, 35595, 35604, 35614, 
-    35624, 35635, 35646, 35655, 35664, 35674, 35684, 35691, 35698, 35706, 
-    35714, 35720, 35726, 35735, 35744, 35754, 35764, 35775, 35786, 35795, 
-    35804, 35814, 35824, 35833, 35842, 35850, 35858, 35865, 35872, 35880, 
-    35888, 35897, 35906, 35916, 35926, 35937, 35948, 35957, 35966, 35976, 
-    35986, 35995, 36004, 36014, 36024, 36035, 36046, 36055, 36064, 36074, 
-    36084, 36091, 36098, 36106, 36114, 36123, 36132, 36142, 36152, 36163, 
-    36174, 36183, 36192, 36202, 36212, 36220, 36228, 36236, 36244, 36253, 
-    36262, 36269, 36276, 36283, 36290, 36297, 36304, 36312, 36320, 36328, 
-    36336, 36347, 36358, 36369, 36380, 36391, 36402, 36410, 36418, 36429, 
-    36440, 36451, 36462, 36473, 36484, 36492, 36500, 36511, 36522, 36533, 0, 
-    0, 36544, 36552, 36560, 36571, 36582, 36593, 0, 0, 36604, 36612, 36620, 
-    36631, 36642, 36653, 36664, 36675, 36686, 36694, 36702, 36713, 36724, 
-    36735, 36746, 36757, 36768, 36776, 36784, 36795, 36806, 36817, 36828, 
-    36839, 36850, 36858, 36866, 36877, 36888, 36899, 36910, 36921, 36932, 
-    36940, 36948, 36959, 36970, 36981, 0, 0, 36992, 37000, 37008, 37019, 
-    37030, 37041, 0, 0, 37052, 37060, 37068, 37079, 37090, 37101, 37112, 
-    37123, 0, 37134, 0, 37142, 0, 37153, 0, 37164, 37175, 37183, 37191, 
-    37202, 37213, 37224, 37235, 37246, 37257, 37265, 37273, 37284, 37295, 
-    37306, 37317, 37328, 37339, 37347, 37355, 37363, 37371, 37379, 37387, 
-    37395, 37403, 37411, 37419, 37427, 37435, 37443, 0, 0, 37451, 37462, 
-    37473, 37487, 37501, 37515, 37529, 37543, 37557, 37568, 37579, 37593, 
-    37607, 37621, 37635, 37649, 37663, 37674, 37685, 37699, 37713, 37727, 
-    37741, 37755, 37769, 37780, 37791, 37805, 37819, 37833, 37847, 37861, 
-    37875, 37886, 37897, 37911, 37925, 37939, 37953, 37967, 37981, 37992, 
-    38003, 38017, 38031, 38045, 38059, 38073, 38087, 38095, 38103, 38114, 
-    38122, 0, 38133, 38141, 38152, 38160, 38168, 38176, 38184, 38192, 38195, 
-    38198, 38201, 38204, 38210, 38221, 38229, 0, 38240, 38248, 38259, 38267, 
-    38275, 38283, 38291, 38299, 38305, 38311, 38317, 38325, 38333, 38344, 0, 
-    0, 38355, 38363, 38374, 38382, 38390, 38398, 0, 38406, 38412, 38418, 
-    38424, 38432, 38440, 38451, 38462, 38470, 38478, 38486, 38497, 38505, 
-    38513, 38521, 38529, 38537, 38543, 38549, 0, 0, 38552, 38563, 38571, 0, 
-    38582, 38590, 38601, 38609, 38617, 38625, 38633, 38641, 38644, 0, 38647, 
-    38651, 38655, 38659, 38663, 38667, 38671, 38675, 38679, 38683, 38687, 
-    38691, 38697, 38703, 38709, 38712, 38715, 38717, 38721, 38725, 38729, 
-    38733, 38735, 38739, 38743, 38749, 38755, 38762, 38769, 38774, 38779, 
-    38785, 38791, 38793, 38796, 38798, 38802, 38806, 38810, 38813, 38817, 
-    38821, 38825, 38829, 38833, 38839, 38843, 38847, 38853, 38858, 38865, 
-    38867, 38870, 38874, 38878, 38883, 38889, 38891, 38900, 38909, 38912, 
-    38916, 38918, 38920, 38922, 38925, 38931, 38933, 38937, 38941, 38948, 
-    38955, 38959, 38964, 38969, 38974, 38979, 38983, 38987, 38990, 38994, 
-    38998, 39005, 39010, 39014, 39018, 39023, 39027, 39031, 39036, 39041, 
-    39045, 39049, 39053, 39055, 39060, 39065, 39069, 39073, 39077, 39081, 0, 
-    0, 0, 0, 0, 39085, 39091, 39097, 39104, 39111, 39116, 39121, 39125, 0, 0, 
-    39131, 39134, 39137, 39140, 39143, 39146, 39149, 39153, 39157, 39162, 
-    39167, 39172, 39179, 39183, 39186, 39189, 39192, 39195, 39198, 39201, 
-    39204, 39207, 39210, 39214, 39218, 39223, 39228, 0, 39233, 39239, 39245, 
-    39251, 39258, 39265, 39272, 39279, 39285, 39291, 39298, 39305, 39312, 0, 
-    0, 0, 39319, 39322, 39325, 39328, 39333, 39336, 39339, 39342, 39345, 
-    39348, 39351, 39355, 39358, 39361, 39364, 39367, 39370, 39375, 39378, 
-    39381, 39384, 39387, 39390, 39395, 39398, 39401, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 39406, 39411, 39416, 39423, 
-    39431, 39436, 39441, 39445, 39449, 39454, 39461, 39468, 39472, 39477, 
-    39482, 39487, 39492, 39499, 39504, 39509, 39514, 39523, 39530, 39537, 
-    39541, 39546, 39552, 39557, 39564, 39573, 39582, 39586, 39590, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 39594, 39598, 39606, 39610, 39614, 
-    39619, 39623, 39627, 39631, 39633, 39637, 39641, 39645, 39650, 39654, 
-    39658, 39666, 39669, 39673, 39676, 39679, 39685, 39689, 39692, 39698, 
-    39702, 39706, 39710, 39713, 39717, 39720, 39724, 39726, 39729, 39732, 
-    39736, 39738, 39742, 39745, 39748, 39753, 39758, 39765, 39768, 39771, 
-    39775, 39780, 39783, 39786, 39789, 39793, 39798, 39801, 39804, 39806, 
-    39809, 39812, 39815, 39819, 39824, 39827, 39831, 39835, 39839, 39843, 
-    39848, 39854, 39859, 39864, 39870, 39875, 39880, 39884, 39888, 39893, 
-    39897, 39901, 39904, 39906, 39911, 39917, 39924, 39931, 39938, 39945, 
-    39952, 39959, 39966, 39973, 39981, 39988, 39996, 40003, 40010, 40018, 
-    40026, 40031, 40036, 40041, 40046, 40051, 40056, 40061, 40066, 40071, 
-    40076, 40082, 40088, 40094, 40100, 40107, 40115, 40122, 40128, 40134, 
-    40140, 40146, 40152, 40158, 40164, 40170, 40176, 40183, 40190, 40197, 
-    40204, 40212, 40221, 40229, 40240, 40248, 40256, 40265, 40272, 40281, 
-    40290, 40298, 40307, 0, 0, 0, 0, 0, 0, 40315, 40317, 40320, 40322, 40325, 
-    40328, 40331, 40336, 40341, 40346, 40351, 40355, 40359, 40363, 40367, 
-    40372, 40378, 40383, 40389, 40394, 40399, 40404, 40410, 40415, 40421, 
-    40427, 40431, 40435, 40440, 40445, 40450, 40455, 40460, 40468, 40476, 
-    40484, 40492, 40499, 40507, 40514, 40521, 40530, 40542, 40548, 40554, 
-    40562, 40570, 40579, 40588, 40596, 40604, 40613, 40622, 40627, 40635, 
-    40640, 40645, 40651, 40656, 40662, 40669, 40676, 40681, 40687, 40692, 
-    40695, 40699, 40702, 40706, 40710, 40714, 40720, 40726, 40732, 40738, 
-    40742, 40746, 40750, 40754, 40760, 40766, 40770, 40775, 40779, 40784, 
-    40789, 40794, 40797, 40801, 40804, 40808, 40815, 40823, 40834, 40845, 
-    40850, 40859, 40866, 40875, 40884, 40888, 40894, 40902, 40906, 40911, 
-    40916, 40922, 40928, 40934, 40941, 40945, 40949, 40954, 40957, 40959, 
-    40963, 40967, 40975, 40979, 40981, 40983, 40987, 40995, 41000, 41006, 
-    41016, 41023, 41028, 41032, 41036, 41040, 41043, 41046, 41049, 41053, 
-    41057, 41061, 41065, 41069, 41072, 41076, 41080, 41083, 41085, 41088, 
-    41090, 41094, 41098, 41100, 41106, 41109, 41114, 41118, 41122, 41124, 
-    41126, 41128, 41131, 41135, 41139, 41143, 41147, 41151, 41157, 41163, 
-    41165, 41167, 41169, 41171, 41174, 41176, 41180, 41182, 41186, 41189, 
-    41195, 41199, 41203, 41206, 41209, 41213, 41219, 41223, 41233, 41243, 
-    41247, 41253, 41259, 41262, 41266, 41269, 41274, 41278, 41284, 41288, 
-    41300, 41308, 41312, 41316, 41322, 41326, 41329, 41331, 41334, 41338, 
-    41342, 41349, 41353, 41357, 41361, 41364, 41369, 41374, 41379, 41384, 
-    41389, 41394, 41402, 41410, 41414, 41418, 41420, 41425, 41429, 41433, 
-    41441, 41449, 41455, 41461, 41470, 41479, 41484, 41489, 41497, 41505, 
-    41507, 41509, 41514, 41519, 41525, 41531, 41537, 41543, 41547, 41551, 
-    41558, 41565, 41571, 41577, 41587, 41597, 41605, 41613, 41615, 41619, 
-    41623, 41628, 41633, 41640, 41647, 41650, 41653, 41656, 41659, 41662, 
-    41667, 41671, 41676, 41681, 41684, 41687, 41690, 41693, 41696, 41700, 
-    41703, 41706, 41709, 41712, 41714, 41716, 41718, 41720, 41728, 41736, 
-    41742, 41746, 41752, 41762, 41768, 41774, 41780, 41788, 41796, 41807, 
-    41811, 41815, 41817, 41823, 41825, 41827, 41829, 41831, 41837, 41840, 
-    41846, 41852, 41856, 41860, 41864, 41867, 41871, 41875, 41877, 41886, 
-    41895, 41900, 41905, 41911, 41917, 41923, 41926, 41929, 41932, 41935, 
-    41937, 41942, 41947, 41952, 41958, 41964, 41972, 41980, 41986, 41992, 
-    41998, 42004, 42013, 42022, 42031, 42040, 42049, 42058, 42067, 42076, 
-    42085, 42094, 42102, 42114, 42124, 42139, 42142, 42147, 42153, 42159, 
-    42166, 42180, 42195, 42201, 42207, 42214, 42220, 42228, 42234, 42247, 
-    42261, 42266, 42272, 42279, 42282, 42285, 42287, 42290, 42293, 42295, 
-    42297, 42301, 42304, 42307, 42310, 42313, 42318, 42323, 42328, 42333, 
-    42338, 42341, 42343, 42345, 42347, 42351, 42355, 42359, 42365, 42370, 
-    42372, 42374, 42379, 42384, 42389, 42394, 42399, 42404, 42406, 42408, 
-    42417, 42421, 42429, 42438, 42440, 42445, 42450, 42458, 42462, 42464, 
-    42468, 42470, 42474, 42478, 42482, 42484, 42486, 42488, 42495, 42504, 
-    42513, 42522, 42531, 42540, 42549, 42558, 42567, 42575, 42583, 42592, 
-    42601, 42610, 42619, 42627, 42635, 42644, 42653, 42662, 42672, 42681, 
-    42691, 42700, 42710, 42719, 42729, 42739, 42748, 42758, 42767, 42777, 
-    42786, 42796, 42805, 42814, 42823, 42832, 42841, 42851, 42860, 42869, 
-    42878, 42888, 42897, 42906, 42915, 42924, 42934, 42944, 42953, 42962, 
-    42970, 42978, 42985, 42993, 43002, 43013, 43022, 43031, 43040, 43047, 
-    43054, 43061, 43070, 43079, 43088, 43097, 43104, 43109, 43118, 43123, 
-    43126, 43134, 43137, 43142, 43147, 43150, 43153, 43161, 43164, 43169, 
-    43172, 43179, 43184, 43192, 43195, 43198, 43201, 43206, 43211, 43214, 
-    43217, 43225, 43228, 43235, 43242, 43246, 43250, 43255, 43260, 43266, 
-    43271, 43277, 43283, 43288, 43294, 43302, 43308, 43316, 43324, 43330, 
-    43338, 43346, 43355, 43363, 43369, 43377, 43386, 43394, 43398, 43403, 
-    43416, 43429, 43433, 43437, 43441, 43445, 43455, 43459, 43464, 43469, 
-    43474, 43479, 43484, 43489, 43499, 43509, 43517, 43527, 43537, 43545, 
-    43555, 43565, 43573, 43583, 43593, 43601, 43609, 43619, 43629, 43632, 
-    43635, 43638, 43643, 43647, 43653, 43660, 43667, 43675, 43682, 43686, 
-    43690, 43694, 43698, 43700, 43704, 43708, 43713, 43718, 43725, 43732, 
-    43735, 43742, 43744, 43746, 43750, 43754, 43759, 43765, 43771, 43777, 
-    43783, 43792, 43801, 43810, 43814, 43816, 43820, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 43827, 43831, 43838, 43845, 43852, 43859, 43863, 43867, 
-    43871, 43875, 43880, 43886, 43891, 43897, 43903, 43909, 43915, 43923, 
-    43930, 43937, 43944, 43951, 43956, 43962, 43971, 43975, 43982, 43986, 
-    43990, 43996, 44002, 44008, 44014, 44018, 44022, 44025, 44028, 44032, 
-    44039, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 44046, 44049, 44053, 44057, 44063, 44069, 44075, 44083, 44090, 
-    44094, 44102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 44107, 44110, 44113, 44116, 44119, 44122, 44125, 44128, 44131, 44134, 
-    44138, 44142, 44146, 44150, 44154, 44158, 44162, 44166, 44170, 44174, 
-    44178, 44181, 44184, 44187, 44190, 44193, 44196, 44199, 44202, 44205, 
-    44209, 44213, 44217, 44221, 44225, 44229, 44233, 44237, 44241, 44245, 
-    44249, 44255, 44261, 44267, 44274, 44281, 44288, 44295, 44302, 44309, 
-    44316, 44323, 44330, 44337, 44344, 44351, 44358, 44365, 44372, 44379, 
-    44386, 44391, 44397, 44403, 44409, 44414, 44420, 44426, 44432, 44437, 
-    44443, 44449, 44454, 44459, 44465, 44470, 44476, 44482, 44487, 44493, 
-    44499, 44504, 44510, 44516, 44522, 44528, 44534, 44539, 44545, 44551, 
-    44557, 44562, 44568, 44574, 44580, 44585, 44591, 44597, 44602, 44607, 
-    44613, 44618, 44624, 44630, 44635, 44641, 44647, 44652, 44658, 44664, 
-    44670, 44676, 44682, 44687, 44693, 44699, 44705, 44710, 44716, 44722, 
-    44728, 44733, 44739, 44745, 44750, 44755, 44761, 44766, 44772, 44778, 
-    44783, 44789, 44795, 44800, 44806, 44812, 44818, 44824, 44830, 44834, 
-    44839, 44844, 44849, 44854, 44859, 44864, 44869, 44874, 44879, 44884, 
-    44888, 44892, 44896, 44900, 44904, 44908, 44912, 44916, 44920, 44925, 
-    44930, 44935, 44940, 44945, 44950, 44959, 44968, 44977, 44986, 44995, 
-    45004, 45013, 45022, 45029, 45037, 45045, 45052, 45059, 45067, 45075, 
-    45082, 45089, 45097, 45105, 45112, 45119, 45127, 45135, 45142, 45149, 
-    45157, 45166, 45175, 45183, 45192, 45201, 45208, 45215, 45223, 45232, 
-    45241, 45249, 45258, 45267, 45274, 45281, 45290, 45299, 45307, 45315, 
-    45324, 45333, 45340, 45347, 45356, 45365, 45373, 45381, 45390, 45399, 
-    45406, 45413, 45422, 45431, 45439, 45448, 45457, 45465, 45475, 45485, 
-    45495, 45505, 45514, 45523, 45532, 45541, 45548, 45556, 45564, 45572, 
-    45580, 45585, 45590, 45599, 45607, 45614, 45623, 45631, 45638, 45647, 
-    45655, 45662, 45671, 45679, 45686, 45695, 45703, 45710, 45719, 45727, 
-    45734, 45743, 45751, 45758, 45767, 45775, 45782, 45791, 45799, 45806, 
-    45815, 45824, 45833, 45842, 45856, 45870, 45877, 45882, 45887, 45892, 
-    45897, 45902, 45907, 45912, 45917, 45925, 45933, 45941, 45949, 45954, 
-    45961, 45968, 45975, 45980, 45988, 45995, 46003, 46007, 46014, 46020, 
-    46027, 46031, 46037, 46043, 46049, 46053, 46056, 46060, 46064, 46071, 
-    46077, 46083, 46089, 46095, 46109, 46119, 46133, 46147, 46153, 46163, 
-    46177, 46180, 46183, 46190, 46198, 46203, 46208, 46216, 46228, 46240, 
-    46248, 46252, 46256, 46259, 46262, 46266, 46270, 46273, 46276, 46281, 
-    46286, 46292, 46298, 46303, 46308, 46314, 46320, 46325, 46330, 46335, 
-    46340, 46346, 46352, 46357, 46362, 46368, 46374, 46379, 46384, 46387, 
-    46390, 46399, 46401, 46403, 46406, 46410, 46416, 46418, 46421, 46428, 
-    46435, 46443, 46451, 46461, 46475, 46480, 46485, 46489, 46494, 46502, 
-    46510, 46519, 46528, 46537, 46546, 46551, 46556, 46562, 46568, 46574, 
-    46580, 46583, 46589, 46595, 46605, 46615, 46623, 46631, 46640, 46649, 
-    46653, 46661, 46669, 46677, 46685, 46694, 46703, 46712, 46721, 46726, 
-    46731, 46736, 46741, 46746, 46752, 46758, 46763, 46769, 46771, 46773, 
-    46775, 46777, 46780, 46783, 46785, 46787, 46789, 46793, 46797, 46799, 
-    46801, 46804, 46807, 46811, 46817, 46823, 46825, 46832, 46836, 46841, 
-    46846, 46848, 46858, 46864, 46870, 46876, 46882, 46888, 46894, 46899, 
-    46902, 46905, 46908, 46910, 46912, 46916, 46920, 46925, 46930, 46935, 
-    46938, 46942, 46947, 46950, 46954, 46959, 46964, 46969, 46974, 46979, 
-    46984, 46989, 46994, 46999, 47004, 47009, 47014, 47020, 47026, 47032, 
-    47034, 47037, 47039, 47042, 47044, 47046, 47048, 47050, 47052, 47054, 
-    47056, 47058, 47060, 47062, 47064, 47066, 47068, 47070, 47072, 47074, 
-    47076, 47081, 47086, 47091, 47096, 47101, 47106, 47111, 47116, 47121, 
-    47126, 47131, 47136, 47141, 47146, 47151, 47156, 47161, 47166, 47171, 
-    47176, 47180, 47184, 47188, 47194, 47200, 47205, 47210, 47215, 47220, 
-    47225, 47230, 47238, 47246, 47254, 47262, 47270, 47278, 47286, 47294, 
-    47300, 47305, 47310, 47315, 47318, 47322, 47326, 47330, 47334, 47338, 
-    47342, 47349, 47356, 47364, 47372, 47377, 47382, 47389, 47396, 47403, 
-    47410, 47413, 47416, 47421, 47423, 47427, 47432, 47434, 47436, 47438, 
-    47440, 47445, 47448, 47450, 47455, 47462, 47469, 47472, 47476, 47481, 
-    47486, 47494, 47500, 47506, 47518, 47525, 47532, 47537, 47542, 47548, 
-    47551, 47554, 47559, 47561, 47565, 47567, 47569, 47571, 47573, 47575, 
-    47577, 47582, 47584, 47586, 47588, 47590, 47594, 47596, 47599, 47604, 
-    47609, 47614, 47619, 47625, 47631, 47633, 47636, 47643, 47650, 47657, 
-    47664, 47668, 47672, 47674, 47676, 47680, 47686, 47691, 47693, 47697, 
-    47706, 47714, 47722, 47728, 47734, 47739, 47745, 47750, 47753, 47767, 
-    47770, 47775, 47780, 47786, 47796, 47798, 47804, 47810, 47814, 47821, 
-    47825, 47827, 47829, 47833, 47839, 47844, 47850, 47852, 47858, 47860, 
-    47866, 47868, 47870, 47875, 47877, 47881, 47886, 47888, 47893, 47898, 
-    47902, 47909, 0, 47919, 47925, 47928, 47934, 47937, 47942, 47947, 47951, 
-    47953, 47955, 47959, 47963, 47967, 47971, 47976, 47978, 47983, 47986, 
-    47989, 47992, 47996, 48000, 48005, 48009, 48014, 48019, 48023, 48028, 
-    48034, 48037, 48043, 48048, 48052, 48057, 48063, 48069, 48076, 48082, 
-    48089, 48096, 48098, 48105, 48109, 48115, 48121, 48126, 48132, 48136, 
-    48141, 48144, 48149, 48155, 48162, 48170, 48177, 48186, 48196, 48203, 
-    48209, 48213, 48220, 48225, 48234, 48237, 48240, 48249, 48259, 48266, 
-    48268, 48274, 48279, 48281, 48284, 48288, 48296, 48305, 48308, 48313, 
-    48318, 48326, 48334, 48342, 48350, 48356, 48362, 48368, 48376, 48381, 
-    48384, 48388, 48391, 48403, 48413, 48424, 48433, 48444, 48454, 48463, 
-    48469, 48477, 48481, 48489, 48493, 48501, 48508, 48515, 48524, 48533, 
-    48543, 48553, 48563, 48573, 48582, 48591, 48601, 48611, 48620, 48629, 
-    48635, 48641, 48647, 48653, 48659, 48665, 48671, 48677, 48683, 48690, 
-    48696, 48702, 48708, 48714, 48720, 48726, 48732, 48738, 48744, 48751, 
-    48758, 48765, 48772, 48779, 48786, 48793, 48800, 48807, 48814, 48822, 
-    48827, 48830, 48834, 48838, 48844, 48847, 48853, 48859, 48864, 48868, 
-    48873, 48879, 48886, 48889, 48896, 48903, 48907, 48916, 48925, 48930, 
-    48936, 48941, 48946, 48953, 48960, 48968, 48976, 48985, 48989, 48998, 
-    49003, 49007, 49014, 49018, 49025, 49033, 49038, 49046, 49050, 49055, 
-    49059, 49064, 49068, 49073, 49078, 49087, 49089, 49092, 49095, 49102, 
-    49109, 49114, 49122, 49128, 49134, 49139, 49142, 49147, 49152, 49157, 
-    49165, 49169, 49176, 49184, 49192, 49197, 49202, 49208, 49213, 49218, 
-    49224, 49229, 49232, 49236, 49240, 49247, 49256, 49261, 49270, 49279, 
-    49285, 49291, 49296, 49301, 49306, 49311, 49317, 49323, 49331, 49339, 
-    49345, 49351, 49356, 49361, 49368, 49375, 49381, 49384, 49387, 49391, 
-    49395, 49399, 49404, 49410, 49416, 49423, 49430, 49435, 49439, 49443, 
-    49447, 49451, 49455, 49459, 49463, 49467, 49471, 49475, 49479, 49483, 
-    49487, 49491, 49495, 49499, 49503, 49507, 49511, 49515, 49519, 49523, 
-    49527, 49531, 49535, 49539, 49543, 49547, 49551, 49555, 49559, 49563, 
-    49567, 49571, 49575, 49579, 49583, 49587, 49591, 49595, 49599, 49603, 
-    49607, 49611, 49615, 49619, 49623, 49627, 49631, 49635, 49639, 49643, 
-    49647, 49651, 49655, 49659, 49663, 49667, 49671, 49675, 49679, 49683, 
-    49687, 49691, 49695, 49699, 49703, 49707, 49711, 49715, 49719, 49723, 
-    49727, 49731, 49735, 49739, 49743, 49747, 49751, 49755, 49759, 49763, 
-    49767, 49771, 49775, 49779, 49783, 49787, 49791, 49795, 49799, 49803, 
-    49807, 49811, 49815, 49819, 49823, 49827, 49831, 49835, 49839, 49843, 
-    49847, 49851, 49855, 49859, 49863, 49867, 49871, 49875, 49879, 49883, 
-    49887, 49891, 49895, 49899, 49903, 49907, 49911, 49915, 49919, 49923, 
-    49927, 49931, 49935, 49939, 49943, 49947, 49951, 49955, 49959, 49963, 
-    49967, 49971, 49975, 49979, 49983, 49987, 49991, 49995, 49999, 50003, 
-    50007, 50011, 50015, 50019, 50023, 50027, 50031, 50035, 50039, 50043, 
-    50047, 50051, 50055, 50059, 50063, 50067, 50071, 50075, 50079, 50083, 
-    50087, 50091, 50095, 50099, 50103, 50107, 50111, 50115, 50119, 50123, 
-    50127, 50131, 50135, 50139, 50143, 50147, 50151, 50155, 50159, 50163, 
-    50167, 50171, 50175, 50179, 50183, 50187, 50191, 50195, 50199, 50203, 
-    50207, 50211, 50215, 50219, 50223, 50227, 50231, 50235, 50239, 50243, 
-    50247, 50251, 50255, 50259, 50263, 50267, 50271, 50275, 50279, 50283, 
-    50287, 50291, 50295, 50299, 50303, 50307, 50311, 50315, 50319, 50323, 
-    50327, 50331, 50335, 50339, 50343, 50347, 50351, 50355, 50359, 50363, 
-    50367, 50371, 50375, 50379, 50383, 50387, 50391, 50395, 50399, 50403, 
-    50407, 50411, 50415, 50419, 50423, 50427, 50431, 50435, 50439, 50443, 
-    50447, 50451, 50455, 50459, 50466, 50474, 50480, 50486, 50493, 50500, 
-    50506, 50512, 50518, 50524, 50529, 50534, 50539, 50544, 50550, 50556, 
-    50564, 50571, 50577, 50583, 50591, 50600, 50607, 50617, 50628, 50631, 
-    50634, 50638, 50642, 50649, 50656, 50667, 50678, 50688, 50698, 50705, 
-    50712, 50719, 50726, 50737, 50748, 50759, 50770, 50780, 50790, 50802, 
-    50814, 50825, 50836, 50848, 50860, 50869, 50879, 50889, 50900, 50911, 
-    50918, 50925, 50932, 50939, 50949, 50959, 50967, 50975, 50982, 50989, 
-    50996, 51003, 51010, 51015, 51020, 51026, 51034, 51044, 51054, 51064, 
-    51074, 51084, 51094, 51104, 51114, 51124, 51134, 51144, 51155, 51166, 
-    51176, 51186, 51197, 51208, 51218, 51228, 51239, 51250, 51260, 51270, 
-    51281, 51292, 51308, 51327, 51343, 51362, 51378, 51394, 51410, 51426, 
-    51437, 51449, 51460, 51472, 51491, 51510, 51518, 51524, 51531, 51538, 
-    51545, 51552, 51557, 51563, 51568, 51573, 51579, 51584, 51589, 51594, 
-    51599, 51604, 51611, 51616, 51623, 51628, 51633, 51637, 51641, 51648, 
-    51655, 51662, 51669, 51676, 51683, 51696, 51709, 51722, 51735, 51743, 
-    51751, 51757, 51763, 51770, 51777, 51784, 51791, 51795, 51800, 51808, 
-    51816, 51824, 51831, 51835, 51843, 51851, 51855, 51859, 51864, 51871, 
-    51879, 51887, 51906, 51925, 51944, 51963, 51982, 52001, 52020, 52039, 
-    52045, 52052, 52061, 52069, 52077, 52082, 52085, 52088, 52093, 52096, 
-    52115, 52122, 52128, 52134, 52138, 52141, 52144, 52147, 52159, 52172, 
-    52179, 52186, 52189, 52193, 52196, 52201, 52206, 52211, 52217, 52226, 
-    52233, 52240, 52248, 52255, 52262, 52265, 52271, 52277, 52280, 52283, 
-    52288, 52293, 52299, 52305, 52309, 52314, 52321, 52325, 52331, 52335, 
-    52339, 52347, 52359, 52368, 52372, 52374, 52383, 52392, 52398, 52401, 
-    52407, 52413, 52418, 52423, 52428, 52433, 52438, 52443, 52445, 52451, 
-    52456, 52463, 52467, 52473, 52476, 52480, 52487, 52494, 52496, 52498, 
-    52504, 52510, 52516, 52525, 52534, 52541, 52548, 52554, 52560, 52565, 
-    52570, 52575, 52581, 52587, 52592, 52599, 52603, 52607, 52620, 52633, 
-    52645, 52654, 52660, 52667, 52672, 52677, 52682, 52687, 52692, 52694, 
-    52701, 52708, 52715, 52722, 52729, 52737, 52743, 52748, 52754, 52760, 
-    52766, 52773, 52779, 52787, 52795, 52803, 52811, 52818, 52824, 52830, 
-    52839, 52843, 52852, 52861, 52870, 52878, 52882, 52888, 52895, 52902, 
-    52906, 52912, 52919, 52924, 52929, 52935, 52940, 52945, 52952, 52959, 
-    52964, 52969, 52977, 52985, 52995, 53005, 53012, 53019, 53023, 53027, 
-    53039, 53045, 53051, 53056, 53061, 53068, 53075, 53081, 53087, 53096, 
-    53104, 53112, 53119, 53126, 53133, 53139, 53146, 53152, 53159, 53166, 
-    53173, 53180, 53186, 53191, 53200, 53210, 53217, 53226, 53232, 53237, 
-    53242, 53252, 53258, 53264, 53270, 53278, 53283, 53290, 53297, 53308, 
-    53315, 53322, 53329, 53336, 53343, 53350, 53357, 53369, 53381, 53392, 
-    53403, 53416, 53429, 53434, 53439, 53448, 53457, 53464, 53471, 53480, 
-    53489, 53497, 53505, 53513, 53521, 53531, 53541, 53555, 53569, 53577, 
-    53585, 53597, 53609, 53617, 53625, 53635, 53645, 53650, 53655, 53664, 
-    53673, 53678, 53683, 53691, 53697, 53703, 53711, 53719, 53732, 53745, 
-    53749, 53753, 53760, 53767, 53774, 53782, 53790, 53799, 53808, 53814, 
-    53820, 53827, 53834, 53841, 53848, 53857, 53866, 53869, 53872, 53877, 
-    53882, 53888, 53894, 53901, 53908, 53918, 53928, 53935, 53942, 53950, 
-    53958, 53966, 53974, 53982, 53990, 53996, 54002, 54006, 54010, 54017, 
-    54024, 54029, 54034, 54039, 54044, 54050, 54064, 54071, 54078, 54082, 
-    54084, 54086, 54091, 54096, 54101, 54106, 54114, 54121, 54128, 54136, 
-    54148, 54156, 54164, 54175, 54179, 54183, 54189, 54197, 54210, 54217, 
-    54224, 54231, 54236, 54243, 54252, 54260, 54266, 54272, 54278, 54287, 
-    54296, 54304, 54313, 54318, 54321, 54326, 54332, 54338, 54344, 54350, 
-    54354, 54357, 54361, 54365, 54371, 54377, 54383, 54389, 54393, 54397, 
-    54404, 54411, 54418, 54425, 54432, 54439, 54449, 54459, 54466, 54473, 
-    54481, 54489, 54493, 54498, 54503, 54509, 54515, 54518, 54521, 54524, 
-    54527, 54531, 54536, 54541, 54546, 54551, 54556, 54560, 54564, 54568, 
-    54572, 54576, 54580, 54584, 54590, 54594, 54600, 54605, 54612, 54620, 
-    54627, 54635, 54642, 54650, 54659, 54666, 54676, 54687, 54693, 54702, 
-    54708, 54717, 54726, 54732, 54738, 54742, 54746, 54755, 54764, 54771, 
-    54778, 54787, 0, 0, 0, 54796, 54801, 54805, 54809, 54814, 54819, 54824, 
-    54832, 54840, 54843, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32226, 32233, 32240, 32247, 32254, 
+    32263, 32272, 32281, 0, 0, 0, 0, 0, 0, 0, 0, 32290, 32295, 32300, 32305, 
+    32310, 32319, 32330, 32339, 32350, 32356, 32369, 32375, 32382, 32389, 
+    32394, 32400, 32406, 32417, 32426, 32433, 32440, 32449, 32456, 32465, 
+    32475, 32485, 32492, 32499, 32506, 32516, 32521, 32529, 32535, 32543, 
+    32552, 32557, 32564, 32570, 32575, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32580, 
+    32585, 32591, 32598, 32606, 32612, 32618, 32624, 32629, 32636, 32642, 
+    32648, 32654, 32662, 32667, 32675, 32680, 32686, 32692, 32699, 32707, 
+    32714, 32720, 32727, 32734, 32740, 32747, 32754, 32760, 32765, 32771, 
+    32779, 32787, 32793, 32799, 32805, 32811, 32819, 32823, 32829, 32835, 
+    32841, 32847, 32853, 32859, 32863, 32868, 32873, 32880, 32885, 32889, 
+    32895, 32900, 32905, 32909, 32914, 32919, 32923, 32927, 32932, 32939, 
+    32943, 32948, 32953, 32957, 32962, 32966, 32971, 32975, 32981, 32986, 
+    32993, 32998, 33003, 33007, 33012, 33017, 33024, 33029, 33035, 33040, 
+    33044, 33049, 33053, 33058, 33065, 33072, 33077, 33082, 33086, 33092, 
+    33098, 33103, 33108, 33113, 33119, 33124, 33130, 33135, 33141, 33147, 
+    33153, 33160, 33167, 33174, 33181, 33188, 33195, 33200, 33208, 33217, 
+    33226, 33235, 33244, 33253, 33262, 33274, 33283, 33292, 33301, 33308, 
+    33313, 33320, 33328, 33336, 33343, 33350, 33357, 33364, 33372, 33381, 
+    33390, 33399, 33408, 33417, 33426, 33435, 33444, 33453, 33462, 33471, 
+    33480, 33489, 33498, 33506, 33515, 33526, 33534, 33543, 33554, 33563, 
+    33572, 33581, 33590, 33598, 33607, 33614, 33619, 33627, 33632, 33639, 
+    33644, 33653, 33659, 33666, 33673, 33678, 33683, 33691, 33699, 33708, 
+    33717, 33722, 33729, 33740, 33748, 33757, 33763, 33769, 33774, 33781, 
+    33786, 33795, 33800, 33805, 33810, 33817, 33824, 33829, 33838, 33846, 
+    33851, 33856, 33863, 33870, 33874, 33878, 33881, 33884, 33887, 33890, 
+    33893, 33896, 33903, 33906, 33909, 33914, 33918, 33922, 33926, 33930, 
+    33934, 33943, 33949, 33955, 33961, 33969, 33977, 33983, 33989, 33996, 
+    34002, 34007, 34013, 34019, 34025, 34032, 34038, 34046, 34052, 34059, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34065, 34072, 
+    34079, 34084, 34093, 34101, 34109, 34116, 34123, 34130, 34137, 34145, 
+    34153, 34163, 34173, 34181, 34189, 34197, 34205, 34214, 34223, 34231, 
+    34239, 34248, 34257, 34267, 34277, 34286, 34295, 34303, 34311, 34319, 
+    34327, 34337, 34347, 34355, 34363, 34371, 34379, 34387, 34395, 34403, 
+    34411, 34419, 34427, 34435, 34443, 34452, 34461, 34470, 34479, 34489, 
+    34499, 34506, 34513, 34521, 34529, 34538, 34547, 34555, 34563, 34575, 
+    34587, 34596, 34605, 34614, 34623, 34630, 34637, 34645, 34653, 34661, 
+    34669, 34677, 34685, 34693, 34701, 34710, 34719, 34728, 34737, 34746, 
+    34755, 34765, 34775, 34785, 34795, 34804, 34813, 34820, 34827, 34835, 
+    34843, 34851, 34859, 34867, 34875, 34887, 34899, 34908, 34917, 34925, 
+    34933, 34941, 34949, 34960, 34971, 34982, 34993, 35005, 35017, 35025, 
+    35033, 35041, 35049, 35058, 35067, 35076, 35085, 35093, 35101, 35109, 
+    35117, 35125, 35133, 35142, 35151, 35161, 35171, 35178, 35185, 35193, 
+    35201, 35209, 35217, 35224, 35231, 35239, 35247, 35255, 35263, 35271, 
+    35279, 35287, 35295, 35303, 35311, 35319, 35327, 35335, 35343, 35351, 
+    35359, 35368, 35377, 35386, 35394, 35403, 35412, 35421, 35430, 35440, 
+    35449, 35456, 35461, 35468, 35475, 35483, 35491, 35500, 35509, 35519, 
+    35529, 35540, 35551, 35560, 35569, 35579, 35589, 35598, 35607, 35617, 
+    35627, 35638, 35649, 35658, 35667, 35677, 35687, 35694, 35701, 35709, 
+    35717, 35723, 35729, 35738, 35747, 35757, 35767, 35778, 35789, 35798, 
+    35807, 35817, 35827, 35836, 35845, 35853, 35861, 35868, 35875, 35883, 
+    35891, 35900, 35909, 35919, 35929, 35940, 35951, 35960, 35969, 35979, 
+    35989, 35998, 36007, 36017, 36027, 36038, 36049, 36058, 36067, 36077, 
+    36087, 36094, 36101, 36109, 36117, 36126, 36135, 36145, 36155, 36166, 
+    36177, 36186, 36195, 36205, 36215, 36223, 36231, 36239, 36247, 36256, 
+    36265, 36272, 36279, 36286, 36293, 36300, 36307, 36315, 36323, 36331, 
+    36339, 36350, 36361, 36372, 36383, 36394, 36405, 36413, 36421, 36432, 
+    36443, 36454, 36465, 36476, 36487, 36495, 36503, 36514, 36525, 36536, 0, 
+    0, 36547, 36555, 36563, 36574, 36585, 36596, 0, 0, 36607, 36615, 36623, 
+    36634, 36645, 36656, 36667, 36678, 36689, 36697, 36705, 36716, 36727, 
+    36738, 36749, 36760, 36771, 36779, 36787, 36798, 36809, 36820, 36831, 
+    36842, 36853, 36861, 36869, 36880, 36891, 36902, 36913, 36924, 36935, 
+    36943, 36951, 36962, 36973, 36984, 0, 0, 36995, 37003, 37011, 37022, 
+    37033, 37044, 0, 0, 37055, 37063, 37071, 37082, 37093, 37104, 37115, 
+    37126, 0, 37137, 0, 37145, 0, 37156, 0, 37167, 37178, 37186, 37194, 
+    37205, 37216, 37227, 37238, 37249, 37260, 37268, 37276, 37287, 37298, 
+    37309, 37320, 37331, 37342, 37350, 37358, 37366, 37374, 37382, 37390, 
+    37398, 37406, 37414, 37422, 37430, 37438, 37446, 0, 0, 37454, 37465, 
+    37476, 37490, 37504, 37518, 37532, 37546, 37560, 37571, 37582, 37596, 
+    37610, 37624, 37638, 37652, 37666, 37677, 37688, 37702, 37716, 37730, 
+    37744, 37758, 37772, 37783, 37794, 37808, 37822, 37836, 37850, 37864, 
+    37878, 37889, 37900, 37914, 37928, 37942, 37956, 37970, 37984, 37995, 
+    38006, 38020, 38034, 38048, 38062, 38076, 38090, 38098, 38106, 38117, 
+    38125, 0, 38136, 38144, 38155, 38163, 38171, 38179, 38187, 38195, 38198, 
+    38201, 38204, 38207, 38213, 38224, 38232, 0, 38243, 38251, 38262, 38270, 
+    38278, 38286, 38294, 38302, 38308, 38314, 38320, 38328, 38336, 38347, 0, 
+    0, 38358, 38366, 38377, 38385, 38393, 38401, 0, 38409, 38415, 38421, 
+    38427, 38435, 38443, 38454, 38465, 38473, 38481, 38489, 38500, 38508, 
+    38516, 38524, 38532, 38540, 38546, 38552, 0, 0, 38555, 38566, 38574, 0, 
+    38585, 38593, 38604, 38612, 38620, 38628, 38636, 38644, 38647, 0, 38650, 
+    38654, 38658, 38662, 38666, 38670, 38674, 38678, 38682, 38686, 38690, 
+    38694, 38700, 38706, 38712, 38715, 38718, 38720, 38724, 38728, 38732, 
+    38736, 38738, 38742, 38746, 38752, 38758, 38765, 38772, 38777, 38782, 
+    38788, 38794, 38796, 38799, 38801, 38805, 38809, 38813, 38816, 38820, 
+    38824, 38828, 38832, 38836, 38842, 38846, 38850, 38856, 38861, 38868, 
+    38870, 38873, 38877, 38881, 38886, 38892, 38894, 38903, 38912, 38915, 
+    38919, 38921, 38923, 38925, 38928, 38934, 38936, 38940, 38944, 38951, 
+    38958, 38962, 38967, 38972, 38977, 38982, 38986, 38990, 38993, 38997, 
+    39001, 39008, 39013, 39017, 39021, 39026, 39030, 39034, 39039, 39044, 
+    39048, 39052, 39056, 39058, 39063, 39068, 39072, 39076, 39080, 39084, 0, 
+    39088, 39092, 39096, 39102, 39108, 39114, 39120, 39127, 39134, 39139, 
+    39144, 39148, 0, 0, 39154, 39157, 39160, 39163, 39166, 39169, 39172, 
+    39176, 39180, 39185, 39190, 39195, 39202, 39206, 39209, 39212, 39215, 
+    39218, 39221, 39224, 39227, 39230, 39233, 39237, 39241, 39246, 39251, 0, 
+    39256, 39262, 39268, 39274, 39281, 39288, 39295, 39302, 39308, 39314, 
+    39321, 39328, 39335, 0, 0, 0, 39342, 39345, 39348, 39351, 39356, 39359, 
+    39362, 39365, 39368, 39371, 39374, 39378, 39381, 39384, 39387, 39390, 
+    39393, 39398, 39401, 39404, 39407, 39410, 39413, 39418, 39421, 39424, 
+    39429, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    39434, 39439, 39444, 39451, 39459, 39464, 39469, 39473, 39477, 39482, 
+    39489, 39496, 39500, 39505, 39510, 39515, 39520, 39527, 39532, 39537, 
+    39542, 39551, 39558, 39565, 39569, 39574, 39580, 39585, 39592, 39601, 
+    39610, 39614, 39618, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 39622, 
+    39626, 39634, 39638, 39642, 39647, 39651, 39655, 39659, 39661, 39665, 
+    39669, 39673, 39678, 39682, 39686, 39694, 39697, 39701, 39704, 39707, 
+    39713, 39717, 39720, 39726, 39730, 39734, 39738, 39741, 39745, 39748, 
+    39752, 39754, 39757, 39760, 39764, 39766, 39770, 39773, 39776, 39781, 
+    39786, 39793, 39796, 39799, 39803, 39808, 39811, 39814, 39817, 39821, 
+    39826, 39829, 39832, 39834, 39837, 39840, 39843, 39847, 39852, 39855, 
+    39859, 39863, 39867, 39871, 39876, 39882, 39887, 39892, 39898, 39903, 
+    39908, 39912, 39916, 39921, 39925, 39929, 39932, 39934, 39939, 39945, 
+    39952, 39959, 39966, 39973, 39980, 39987, 39994, 40001, 40009, 40016, 
+    40024, 40031, 40038, 40046, 40054, 40059, 40064, 40069, 40074, 40079, 
+    40084, 40089, 40094, 40099, 40104, 40110, 40116, 40122, 40128, 40135, 
+    40143, 40150, 40156, 40162, 40168, 40174, 40180, 40186, 40192, 40198, 
+    40204, 40211, 40218, 40225, 40232, 40240, 40249, 40257, 40268, 40276, 
+    40284, 40293, 40300, 40309, 40318, 40326, 40335, 0, 0, 0, 0, 0, 0, 40343, 
+    40345, 40348, 40350, 40353, 40356, 40359, 40364, 40369, 40374, 40379, 
+    40383, 40387, 40391, 40395, 40400, 40406, 40411, 40417, 40422, 40427, 
+    40432, 40438, 40443, 40449, 40455, 40459, 40463, 40468, 40473, 40478, 
+    40483, 40488, 40496, 40504, 40512, 40520, 40527, 40535, 40542, 40549, 
+    40558, 40570, 40576, 40582, 40590, 40598, 40607, 40616, 40624, 40632, 
+    40641, 40650, 40655, 40663, 40668, 40673, 40679, 40684, 40690, 40697, 
+    40704, 40709, 40715, 40720, 40723, 40727, 40730, 40734, 40738, 40742, 
+    40748, 40754, 40760, 40766, 40770, 40774, 40778, 40782, 40788, 40794, 
+    40798, 40803, 40807, 40812, 40817, 40822, 40825, 40829, 40832, 40836, 
+    40843, 40851, 40862, 40873, 40878, 40887, 40894, 40903, 40912, 40916, 
+    40922, 40930, 40934, 40939, 40944, 40950, 40956, 40962, 40969, 40973, 
+    40977, 40982, 40985, 40987, 40991, 40995, 41003, 41007, 41009, 41011, 
+    41015, 41023, 41028, 41034, 41044, 41051, 41056, 41060, 41064, 41068, 
+    41071, 41074, 41077, 41081, 41085, 41089, 41093, 41097, 41100, 41104, 
+    41108, 41111, 41113, 41116, 41118, 41122, 41126, 41128, 41134, 41137, 
+    41142, 41146, 41150, 41152, 41154, 41156, 41159, 41163, 41167, 41171, 
+    41175, 41179, 41185, 41191, 41193, 41195, 41197, 41199, 41202, 41204, 
+    41208, 41210, 41214, 41217, 41223, 41227, 41231, 41234, 41237, 41241, 
+    41247, 41251, 41261, 41271, 41275, 41281, 41287, 41290, 41294, 41297, 
+    41302, 41306, 41312, 41316, 41328, 41336, 41340, 41344, 41350, 41354, 
+    41357, 41359, 41362, 41366, 41370, 41377, 41381, 41385, 41389, 41392, 
+    41397, 41402, 41407, 41412, 41417, 41422, 41430, 41438, 41442, 41446, 
+    41448, 41453, 41457, 41461, 41469, 41477, 41483, 41489, 41498, 41507, 
+    41512, 41517, 41525, 41533, 41535, 41537, 41542, 41547, 41553, 41559, 
+    41565, 41571, 41575, 41579, 41586, 41593, 41599, 41605, 41615, 41625, 
+    41633, 41641, 41643, 41647, 41651, 41656, 41661, 41668, 41675, 41678, 
+    41681, 41684, 41687, 41690, 41695, 41699, 41704, 41709, 41712, 41715, 
+    41718, 41721, 41724, 41728, 41731, 41734, 41737, 41740, 41742, 41744, 
+    41746, 41748, 41756, 41764, 41770, 41774, 41780, 41790, 41796, 41802, 
+    41808, 41816, 41824, 41835, 41839, 41843, 41845, 41851, 41853, 41855, 
+    41857, 41859, 41865, 41868, 41874, 41880, 41884, 41888, 41892, 41895, 
+    41899, 41903, 41905, 41914, 41923, 41928, 41933, 41939, 41945, 41951, 
+    41954, 41957, 41960, 41963, 41965, 41970, 41975, 41980, 41986, 41992, 
+    42000, 42008, 42014, 42020, 42026, 42032, 42041, 42050, 42059, 42068, 
+    42077, 42086, 42095, 42104, 42113, 42122, 42130, 42142, 42152, 42167, 
+    42170, 42175, 42181, 42187, 42194, 42208, 42223, 42229, 42235, 42242, 
+    42248, 42256, 42262, 42275, 42289, 42294, 42300, 42307, 42310, 42313, 
+    42315, 42318, 42321, 42323, 42325, 42329, 42332, 42335, 42338, 42341, 
+    42346, 42351, 42356, 42361, 42366, 42369, 42371, 42373, 42375, 42379, 
+    42383, 42387, 42393, 42398, 42400, 42402, 42407, 42412, 42417, 42422, 
+    42427, 42432, 42434, 42436, 42445, 42449, 42457, 42466, 42468, 42473, 
+    42478, 42486, 42490, 42492, 42496, 42498, 42502, 42506, 42510, 42512, 
+    42514, 42516, 42523, 42532, 42541, 42550, 42559, 42568, 42577, 42586, 
+    42595, 42603, 42611, 42620, 42629, 42638, 42647, 42655, 42663, 42672, 
+    42681, 42690, 42700, 42709, 42719, 42728, 42738, 42747, 42757, 42767, 
+    42776, 42786, 42795, 42805, 42814, 42824, 42833, 42842, 42851, 42860, 
+    42869, 42879, 42888, 42897, 42906, 42916, 42925, 42934, 42943, 42952, 
+    42962, 42972, 42981, 42990, 42998, 43006, 43013, 43021, 43030, 43041, 
+    43050, 43059, 43068, 43075, 43082, 43089, 43098, 43107, 43116, 43125, 
+    43132, 43137, 43146, 43151, 43154, 43162, 43165, 43170, 43175, 43178, 
+    43181, 43189, 43192, 43197, 43200, 43207, 43212, 43220, 43223, 43226, 
+    43229, 43234, 43239, 43242, 43245, 43253, 43256, 43263, 43270, 43274, 
+    43278, 43283, 43288, 43294, 43299, 43305, 43311, 43316, 43322, 43330, 
+    43336, 43344, 43352, 43358, 43366, 43374, 43383, 43391, 43397, 43405, 
+    43414, 43422, 43426, 43431, 43444, 43457, 43461, 43465, 43469, 43473, 
+    43483, 43487, 43492, 43497, 43502, 43507, 43512, 43517, 43527, 43537, 
+    43545, 43555, 43565, 43573, 43583, 43593, 43601, 43611, 43621, 43629, 
+    43637, 43647, 43657, 43660, 43663, 43666, 43671, 43675, 43681, 43688, 
+    43695, 43703, 43710, 43714, 43718, 43722, 43726, 43728, 43732, 43736, 
+    43741, 43746, 43753, 43760, 43763, 43770, 43772, 43774, 43778, 43782, 
+    43787, 43793, 43799, 43805, 43811, 43820, 43829, 43838, 43842, 43844, 
+    43848, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43855, 43859, 43866, 43873, 
+    43880, 43887, 43891, 43895, 43899, 43903, 43908, 43914, 43919, 43925, 
+    43931, 43937, 43943, 43951, 43958, 43965, 43972, 43979, 43984, 43990, 
+    43999, 44003, 44010, 44014, 44018, 44024, 44030, 44036, 44042, 44046, 
+    44050, 44053, 44056, 44060, 44067, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44074, 44077, 44081, 44085, 44091, 
+    44097, 44103, 44111, 44118, 44122, 44130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44135, 44138, 44141, 44144, 44147, 
+    44150, 44153, 44156, 44159, 44162, 44166, 44170, 44174, 44178, 44182, 
+    44186, 44190, 44194, 44198, 44202, 44206, 44209, 44212, 44215, 44218, 
+    44221, 44224, 44227, 44230, 44233, 44237, 44241, 44245, 44249, 44253, 
+    44257, 44261, 44265, 44269, 44273, 44277, 44283, 44289, 44295, 44302, 
+    44309, 44316, 44323, 44330, 44337, 44344, 44351, 44358, 44365, 44372, 
+    44379, 44386, 44393, 44400, 44407, 44414, 44419, 44425, 44431, 44437, 
+    44442, 44448, 44454, 44460, 44465, 44471, 44477, 44482, 44487, 44493, 
+    44498, 44504, 44510, 44515, 44521, 44527, 44532, 44538, 44544, 44550, 
+    44556, 44562, 44567, 44573, 44579, 44585, 44590, 44596, 44602, 44608, 
+    44613, 44619, 44625, 44630, 44635, 44641, 44646, 44652, 44658, 44663, 
+    44669, 44675, 44680, 44686, 44692, 44698, 44704, 44710, 44715, 44721, 
+    44727, 44733, 44738, 44744, 44750, 44756, 44761, 44767, 44773, 44778, 
+    44783, 44789, 44794, 44800, 44806, 44811, 44817, 44823, 44828, 44834, 
+    44840, 44846, 44852, 44858, 44862, 44867, 44872, 44877, 44882, 44887, 
+    44892, 44897, 44902, 44907, 44912, 44916, 44920, 44924, 44928, 44932, 
+    44936, 44940, 44944, 44948, 44953, 44958, 44963, 44968, 44973, 44978, 
+    44987, 44996, 45005, 45014, 45023, 45032, 45041, 45050, 45057, 45065, 
+    45073, 45080, 45087, 45095, 45103, 45110, 45117, 45125, 45133, 45140, 
+    45147, 45155, 45163, 45170, 45177, 45185, 45194, 45203, 45211, 45220, 
+    45229, 45236, 45243, 45251, 45260, 45269, 45277, 45286, 45295, 45302, 
+    45309, 45318, 45327, 45335, 45343, 45352, 45361, 45368, 45375, 45384, 
+    45393, 45401, 45409, 45418, 45427, 45434, 45441, 45450, 45459, 45467, 
+    45476, 45485, 45493, 45503, 45513, 45523, 45533, 45542, 45551, 45560, 
+    45569, 45576, 45584, 45592, 45600, 45608, 45613, 45618, 45627, 45635, 
+    45642, 45651, 45659, 45666, 45675, 45683, 45690, 45699, 45707, 45714, 
+    45723, 45731, 45738, 45747, 45755, 45762, 45771, 45779, 45786, 45795, 
+    45803, 45810, 45819, 45827, 45834, 45843, 45852, 45861, 45870, 45884, 
+    45898, 45905, 45910, 45915, 45920, 45925, 45930, 45935, 45940, 45945, 
+    45953, 45961, 45969, 45977, 45982, 45989, 45996, 46003, 46008, 46016, 
+    46023, 46031, 46035, 46042, 46048, 46055, 46059, 46065, 46071, 46077, 
+    46081, 46084, 46088, 46092, 46099, 46105, 46111, 46117, 46123, 46137, 
+    46147, 46161, 46175, 46181, 46191, 46205, 46208, 46211, 46218, 46226, 
+    46231, 46236, 46244, 46256, 46268, 46276, 46280, 46284, 46287, 46290, 
+    46294, 46298, 46301, 46304, 46309, 46314, 46320, 46326, 46331, 46336, 
+    46342, 46348, 46353, 46358, 46363, 46368, 46374, 46380, 46385, 46390, 
+    46396, 46402, 46407, 46412, 46415, 46418, 46427, 46429, 46431, 46434, 
+    46438, 46444, 46446, 46449, 46456, 46463, 46471, 46479, 46489, 46503, 
+    46508, 46513, 46517, 46522, 46530, 46538, 46547, 46556, 46565, 46574, 
+    46579, 46584, 46590, 46596, 46602, 46608, 46611, 46617, 46623, 46633, 
+    46643, 46651, 46659, 46668, 46677, 46681, 46689, 46697, 46705, 46713, 
+    46722, 46731, 46740, 46749, 46754, 46759, 46764, 46769, 46774, 46780, 
+    46786, 46791, 46797, 46799, 46801, 46803, 46805, 46808, 46811, 46813, 
+    46815, 46817, 46821, 46825, 46827, 46829, 46832, 46835, 46839, 46845, 
+    46851, 46853, 46860, 46864, 46869, 46874, 46876, 46886, 46892, 46898, 
+    46904, 46910, 46916, 46922, 46927, 46930, 46933, 46936, 46938, 46940, 
+    46944, 46948, 46953, 46958, 46963, 46966, 46970, 46975, 46978, 46982, 
+    46987, 46992, 46997, 47002, 47007, 47012, 47017, 47022, 47027, 47032, 
+    47037, 47042, 47048, 47054, 47060, 47062, 47065, 47067, 47070, 47072, 
+    47074, 47076, 47078, 47080, 47082, 47084, 47086, 47088, 47090, 47092, 
+    47094, 47096, 47098, 47100, 47102, 47104, 47109, 47114, 47119, 47124, 
+    47129, 47134, 47139, 47144, 47149, 47154, 47159, 47164, 47169, 47174, 
+    47179, 47184, 47189, 47194, 47199, 47204, 47208, 47212, 47216, 47222, 
+    47228, 47233, 47238, 47243, 47248, 47253, 47258, 47266, 47274, 47282, 
+    47290, 47298, 47306, 47314, 47322, 47328, 47333, 47338, 47343, 47346, 
+    47350, 47354, 47358, 47362, 47366, 47370, 47377, 47384, 47392, 47400, 
+    47405, 47410, 47417, 47424, 47431, 47438, 47441, 47444, 47449, 47451, 
+    47455, 47460, 47462, 47464, 47466, 47468, 47473, 47476, 47478, 47483, 
+    47490, 47497, 47500, 47504, 47509, 47514, 47522, 47528, 47534, 47546, 
+    47553, 47560, 47565, 47570, 47576, 47579, 47582, 47587, 47589, 47593, 
+    47595, 47597, 47599, 47601, 47603, 47605, 47610, 47612, 47614, 47616, 
+    47618, 47622, 47624, 47627, 47632, 47637, 47642, 47647, 47653, 47659, 
+    47661, 47664, 47671, 47678, 47685, 47692, 47696, 47700, 47702, 47704, 
+    47708, 47714, 47719, 47721, 47725, 47734, 47742, 47750, 47756, 47762, 
+    47767, 47773, 47778, 47781, 47795, 47798, 47803, 47808, 47814, 47824, 
+    47826, 47832, 47838, 47842, 47849, 47853, 47855, 47857, 47861, 47867, 
+    47872, 47878, 47880, 47886, 47888, 47894, 47896, 47898, 47903, 47905, 
+    47909, 47914, 47916, 47921, 47926, 47930, 47937, 0, 47947, 47953, 47956, 
+    47962, 47965, 47970, 47975, 47979, 47981, 47983, 47987, 47991, 47995, 
+    47999, 48004, 48006, 48011, 48014, 48017, 48020, 48024, 48028, 48033, 
+    48037, 48042, 48047, 48051, 48056, 48062, 48065, 48071, 48076, 48080, 
+    48085, 48091, 48097, 48104, 48110, 48117, 48124, 48126, 48133, 48137, 
+    48143, 48149, 48154, 48160, 48164, 48169, 48172, 48177, 48183, 48190, 
+    48198, 48205, 48214, 48224, 48231, 48237, 48241, 48248, 48253, 48262, 
+    48265, 48268, 48277, 48287, 48294, 48296, 48302, 48307, 48309, 48312, 
+    48316, 48324, 48333, 48336, 48341, 48346, 48354, 48362, 48370, 48378, 
+    48384, 48390, 48396, 48404, 48409, 48412, 48416, 48419, 48431, 48441, 
+    48452, 48461, 48472, 48482, 48491, 48497, 48505, 48509, 48517, 48521, 
+    48529, 48536, 48543, 48552, 48561, 48571, 48581, 48591, 48601, 48610, 
+    48619, 48629, 48639, 48648, 48657, 48663, 48669, 48675, 48681, 48687, 
+    48693, 48699, 48705, 48711, 48718, 48724, 48730, 48736, 48742, 48748, 
+    48754, 48760, 48766, 48772, 48779, 48786, 48793, 48800, 48807, 48814, 
+    48821, 48828, 48835, 48842, 48850, 48855, 48858, 48862, 48866, 48872, 
+    48875, 48881, 48887, 48892, 48896, 48901, 48907, 48914, 48917, 48924, 
+    48931, 48935, 48944, 48953, 48958, 48964, 48969, 48974, 48981, 48988, 
+    48996, 49004, 49013, 49017, 49026, 49031, 49035, 49042, 49046, 49053, 
+    49061, 49066, 49074, 49078, 49083, 49087, 49092, 49096, 49101, 49106, 
+    49115, 49117, 49120, 49123, 49130, 49137, 49142, 49150, 49156, 49162, 
+    49167, 49170, 49175, 49180, 49185, 49193, 49197, 49204, 49212, 49220, 
+    49225, 49230, 49236, 49241, 49246, 49252, 49257, 49260, 49264, 49268, 
+    49275, 49284, 49289, 49298, 49307, 49313, 49319, 49324, 49329, 49334, 
+    49339, 49345, 49351, 49359, 49367, 49373, 49379, 49384, 49389, 49396, 
+    49403, 49409, 49412, 49415, 49419, 49423, 49427, 49432, 49438, 49444, 
+    49451, 49458, 49463, 49467, 49471, 49475, 49479, 49483, 49487, 49491, 
+    49495, 49499, 49503, 49507, 49511, 49515, 49519, 49523, 49527, 49531, 
+    49535, 49539, 49543, 49547, 49551, 49555, 49559, 49563, 49567, 49571, 
+    49575, 49579, 49583, 49587, 49591, 49595, 49599, 49603, 49607, 49611, 
+    49615, 49619, 49623, 49627, 49631, 49635, 49639, 49643, 49647, 49651, 
+    49655, 49659, 49663, 49667, 49671, 49675, 49679, 49683, 49687, 49691, 
+    49695, 49699, 49703, 49707, 49711, 49715, 49719, 49723, 49727, 49731, 
+    49735, 49739, 49743, 49747, 49751, 49755, 49759, 49763, 49767, 49771, 
+    49775, 49779, 49783, 49787, 49791, 49795, 49799, 49803, 49807, 49811, 
+    49815, 49819, 49823, 49827, 49831, 49835, 49839, 49843, 49847, 49851, 
+    49855, 49859, 49863, 49867, 49871, 49875, 49879, 49883, 49887, 49891, 
+    49895, 49899, 49903, 49907, 49911, 49915, 49919, 49923, 49927, 49931, 
+    49935, 49939, 49943, 49947, 49951, 49955, 49959, 49963, 49967, 49971, 
+    49975, 49979, 49983, 49987, 49991, 49995, 49999, 50003, 50007, 50011, 
+    50015, 50019, 50023, 50027, 50031, 50035, 50039, 50043, 50047, 50051, 
+    50055, 50059, 50063, 50067, 50071, 50075, 50079, 50083, 50087, 50091, 
+    50095, 50099, 50103, 50107, 50111, 50115, 50119, 50123, 50127, 50131, 
+    50135, 50139, 50143, 50147, 50151, 50155, 50159, 50163, 50167, 50171, 
+    50175, 50179, 50183, 50187, 50191, 50195, 50199, 50203, 50207, 50211, 
+    50215, 50219, 50223, 50227, 50231, 50235, 50239, 50243, 50247, 50251, 
+    50255, 50259, 50263, 50267, 50271, 50275, 50279, 50283, 50287, 50291, 
+    50295, 50299, 50303, 50307, 50311, 50315, 50319, 50323, 50327, 50331, 
+    50335, 50339, 50343, 50347, 50351, 50355, 50359, 50363, 50367, 50371, 
+    50375, 50379, 50383, 50387, 50391, 50395, 50399, 50403, 50407, 50411, 
+    50415, 50419, 50423, 50427, 50431, 50435, 50439, 50443, 50447, 50451, 
+    50455, 50459, 50463, 50467, 50471, 50475, 50479, 50483, 50487, 50494, 
+    50502, 50508, 50514, 50521, 50528, 50534, 50540, 50546, 50552, 50557, 
+    50562, 50567, 50572, 50578, 50584, 50592, 50599, 50605, 50611, 50619, 
+    50628, 50635, 50645, 50656, 50659, 50662, 50666, 50670, 50677, 50684, 
+    50695, 50706, 50716, 50726, 50733, 50740, 50747, 50754, 50765, 50776, 
+    50787, 50798, 50808, 50818, 50830, 50842, 50853, 50864, 50876, 50888, 
+    50897, 50907, 50917, 50928, 50939, 50946, 50953, 50960, 50967, 50977, 
+    50987, 50995, 51003, 51010, 51017, 51024, 51031, 51038, 51043, 51048, 
+    51054, 51062, 51072, 51082, 51092, 51102, 51112, 51122, 51132, 51142, 
+    51152, 51162, 51172, 51183, 51194, 51204, 51214, 51225, 51236, 51246, 
+    51256, 51267, 51278, 51288, 51298, 51309, 51320, 51336, 51355, 51371, 
+    51390, 51406, 51422, 51438, 51454, 51465, 51477, 51488, 51500, 51519, 
+    51538, 51546, 51552, 51559, 51566, 51573, 51580, 51585, 51591, 51596, 
+    51601, 51607, 51612, 51617, 51622, 51627, 51632, 51639, 51644, 51651, 
+    51656, 51661, 51665, 51669, 51676, 51683, 51690, 51697, 51704, 51711, 
+    51724, 51737, 51750, 51763, 51771, 51779, 51785, 51791, 51798, 51805, 
+    51812, 51819, 51823, 51828, 51836, 51844, 51852, 51859, 51863, 51871, 
+    51879, 51883, 51887, 51892, 51899, 51907, 51915, 51934, 51953, 51972, 
+    51991, 52010, 52029, 52048, 52067, 52073, 52080, 52089, 52097, 52105, 
+    52110, 52113, 52116, 52121, 52124, 52143, 52150, 52156, 52162, 52166, 
+    52169, 52172, 52175, 52187, 52200, 52207, 52214, 52217, 52221, 52224, 
+    52229, 52234, 52239, 52245, 52254, 52261, 52268, 52276, 52283, 52290, 
+    52293, 52299, 52305, 52308, 52311, 52316, 52321, 52327, 52333, 52337, 
+    52342, 52349, 52353, 52359, 52363, 52367, 52375, 52387, 52396, 52400, 
+    52402, 52411, 52420, 52426, 52429, 52435, 52441, 52446, 52451, 52456, 
+    52461, 52466, 52471, 52473, 52479, 52484, 52491, 52495, 52501, 52504, 
+    52508, 52515, 52522, 52524, 52526, 52532, 52538, 52544, 52553, 52562, 
+    52569, 52576, 52582, 52588, 52593, 52598, 52603, 52609, 52615, 52620, 
+    52627, 52631, 52635, 52648, 52661, 52673, 52682, 52688, 52695, 52700, 
+    52705, 52710, 52715, 52720, 52722, 52729, 52736, 52743, 52750, 52757, 
+    52765, 52771, 52776, 52782, 52788, 52794, 52801, 52807, 52815, 52823, 
+    52831, 52839, 52846, 52852, 52858, 52867, 52871, 52880, 52889, 52898, 
+    52906, 52910, 52916, 52923, 52930, 52934, 52940, 52947, 52952, 52957, 
+    52963, 52968, 52973, 52980, 52987, 52992, 52997, 53005, 53013, 53023, 
+    53033, 53040, 53047, 53051, 53055, 53067, 53073, 53079, 53084, 53089, 
+    53096, 53103, 53109, 53115, 53124, 53132, 53140, 53147, 53154, 53161, 
+    53167, 53174, 53180, 53187, 53194, 53201, 53208, 53214, 53219, 53228, 
+    53238, 53245, 53254, 53260, 53265, 53270, 53280, 53286, 53292, 53298, 
+    53306, 53311, 53318, 53325, 53336, 53343, 53350, 53357, 53364, 53371, 
+    53378, 53385, 53397, 53409, 53420, 53431, 53444, 53457, 53462, 53467, 
+    53476, 53485, 53492, 53499, 53508, 53517, 53525, 53533, 53541, 53549, 
+    53559, 53569, 53583, 53597, 53605, 53613, 53625, 53637, 53645, 53653, 
+    53663, 53673, 53678, 53683, 53692, 53701, 53706, 53711, 53719, 53725, 
+    53731, 53739, 53747, 53760, 53773, 53777, 53781, 53788, 53795, 53802, 
+    53810, 53818, 53827, 53836, 53842, 53848, 53855, 53862, 53869, 53876, 
+    53885, 53894, 53897, 53900, 53905, 53910, 53916, 53922, 53929, 53936, 
+    53946, 53956, 53963, 53970, 53978, 53986, 53994, 54002, 54010, 54018, 
+    54024, 54030, 54034, 54038, 54045, 54052, 54057, 54062, 54067, 54072, 
+    54078, 54092, 54099, 54106, 54110, 54112, 54114, 54119, 54124, 54129, 
+    54134, 54142, 54149, 54156, 54164, 54176, 54184, 54192, 54203, 54207, 
+    54211, 54217, 54225, 54238, 54245, 54252, 54259, 54264, 54271, 54280, 
+    54288, 54294, 54300, 54306, 54315, 54324, 54332, 54341, 54346, 54349, 
+    54354, 54360, 54366, 54372, 54378, 54382, 54385, 54389, 54393, 54399, 
+    54405, 54411, 54417, 54421, 54425, 54432, 54439, 54446, 54453, 54460, 
+    54467, 54477, 54487, 54494, 54501, 54509, 54517, 54521, 54526, 54531, 
+    54537, 54543, 54546, 54549, 54552, 54555, 54559, 54564, 54569, 54574, 
+    54579, 54584, 54588, 54592, 54596, 54600, 54604, 54608, 54612, 54618, 
+    54622, 54628, 54633, 54640, 54648, 54655, 54663, 54670, 54678, 54687, 
+    54694, 54704, 54715, 54721, 54730, 54736, 54745, 54754, 54760, 54766, 
+    54770, 54774, 54783, 54792, 54799, 54806, 54815, 0, 0, 0, 54824, 54829, 
+    54833, 54837, 54842, 54847, 54852, 54860, 54868, 54871, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 54847, 54852, 54857, 54862, 54867, 54872, 54877, 54882, 
-    54887, 54892, 54897, 54903, 54907, 54912, 54917, 54922, 54927, 54932, 
-    54937, 54942, 54947, 54952, 54957, 54962, 54967, 54972, 54977, 54982, 
-    54987, 54992, 54997, 55002, 55007, 55012, 55017, 55023, 55028, 55034, 
-    55043, 55048, 55056, 55063, 55072, 55077, 55082, 55087, 55093, 0, 55100, 
-    55105, 55110, 55115, 55120, 55125, 55130, 55135, 55140, 55145, 55150, 
-    55156, 55160, 55165, 55170, 55175, 55180, 55185, 55190, 55195, 55200, 
-    55205, 55210, 55215, 55220, 55225, 55230, 55235, 55240, 55245, 55250, 
-    55255, 55260, 55265, 55270, 55276, 55281, 55287, 55296, 55301, 55309, 
-    55316, 55325, 55330, 55335, 55340, 55346, 0, 55353, 55361, 55369, 55378, 
-    55385, 55393, 55399, 55408, 55416, 55424, 55432, 55440, 55448, 55456, 
-    55461, 55468, 55474, 55481, 55489, 55496, 55503, 55511, 55517, 55523, 
-    55530, 55537, 55547, 55557, 55564, 55571, 55576, 55586, 55596, 55601, 
-    55606, 55611, 55616, 55621, 55626, 55631, 55636, 55641, 55646, 55651, 
-    55656, 55661, 55666, 55671, 55676, 55681, 55686, 55691, 55696, 55701, 
-    55706, 55711, 55716, 55721, 55726, 55731, 55736, 55741, 55746, 55750, 
-    55754, 55759, 55764, 55769, 55774, 55779, 55784, 55789, 55794, 55799, 
-    55804, 55809, 55814, 55819, 55824, 55829, 55834, 55839, 55844, 55851, 
-    55858, 55865, 55872, 55879, 55886, 55893, 55900, 55907, 55914, 55921, 
-    55928, 55935, 55942, 55947, 55952, 55959, 55966, 55973, 55980, 55987, 
-    55994, 56001, 56008, 56015, 56022, 56029, 56036, 56042, 56048, 56054, 
-    56060, 56067, 56074, 56081, 56088, 56095, 56102, 56109, 56116, 56123, 
-    56130, 56138, 56146, 56154, 56162, 56170, 56178, 56186, 56194, 56198, 
-    56204, 56210, 56214, 56220, 56226, 56232, 56239, 56246, 56253, 56260, 
-    56265, 56271, 56277, 56284, 0, 0, 0, 0, 0, 56291, 56299, 56308, 56317, 
-    56325, 56331, 56336, 56341, 56346, 56351, 56356, 56361, 56366, 56371, 
-    56376, 56381, 56386, 56391, 56396, 56401, 56406, 56411, 56416, 56421, 
-    56426, 56431, 56436, 56441, 56446, 56451, 56456, 56461, 56466, 56471, 
-    56476, 56481, 56486, 56491, 56496, 56501, 56506, 56511, 56516, 56521, 
-    56526, 0, 56531, 0, 0, 0, 0, 0, 56536, 0, 0, 56541, 56545, 56550, 56555, 
-    56560, 56565, 56574, 56579, 56584, 56589, 56594, 56599, 56604, 56609, 
-    56614, 56621, 56626, 56631, 56640, 56647, 56652, 56657, 56662, 56669, 
-    56674, 56681, 56686, 56691, 56698, 56705, 56710, 56715, 56720, 56727, 
-    56734, 56739, 56744, 56749, 56754, 56759, 56766, 56773, 56778, 56783, 
-    56788, 56793, 56798, 56803, 56808, 56813, 56818, 56823, 56828, 56835, 
-    56840, 56845, 0, 0, 0, 0, 0, 0, 0, 56850, 56857, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 56862, 56867, 56871, 56875, 56879, 56883, 56887, 56891, 
-    56895, 56899, 56903, 56907, 56913, 56917, 56921, 56925, 56929, 56933, 
-    56937, 56941, 56945, 56949, 56953, 56957, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    56961, 56965, 56969, 56973, 56977, 56981, 56985, 0, 56989, 56993, 56997, 
-    57001, 57005, 57009, 57013, 0, 57017, 57021, 57025, 57029, 57033, 57037, 
-    57041, 0, 57045, 57049, 57053, 57057, 57061, 57065, 57069, 0, 57073, 
-    57077, 57081, 57085, 57089, 57093, 57097, 0, 57101, 57105, 57109, 57113, 
-    57117, 57121, 57125, 0, 57129, 57133, 57137, 57141, 57145, 57149, 57153, 
-    0, 57157, 57161, 57165, 57169, 57173, 57177, 57181, 0, 57185, 57190, 
-    57195, 57200, 57205, 57210, 57215, 57219, 57224, 57229, 57234, 57238, 
-    57243, 57248, 57253, 57258, 57262, 57267, 57272, 57277, 57282, 57287, 
-    57292, 57296, 57301, 57306, 57313, 57318, 57323, 57329, 57336, 57343, 
-    57352, 57359, 57368, 57372, 57376, 57382, 57388, 57394, 57402, 57408, 
-    57412, 57416, 57420, 57426, 57432, 57436, 57438, 57442, 57448, 57450, 
-    57454, 57458, 57462, 57468, 57473, 57477, 57481, 57486, 57492, 57497, 
-    57502, 57507, 57512, 57519, 57526, 57531, 57536, 57541, 57546, 57551, 
-    57556, 57560, 57564, 57571, 57578, 57584, 57588, 57593, 57595, 57599, 
-    57607, 57611, 57615, 57619, 57623, 57629, 57635, 57639, 57645, 57649, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54875, 54880, 54885, 
+    54890, 54895, 54900, 54905, 54910, 54915, 54920, 54925, 54931, 54935, 
+    54940, 54945, 54950, 54955, 54960, 54965, 54970, 54975, 54980, 54985, 
+    54990, 54995, 55000, 55005, 55010, 55015, 55020, 55025, 55030, 55035, 
+    55040, 55045, 55051, 55056, 55062, 55071, 55076, 55084, 55091, 55100, 
+    55105, 55110, 55115, 55121, 0, 55128, 55133, 55138, 55143, 55148, 55153, 
+    55158, 55163, 55168, 55173, 55178, 55184, 55188, 55193, 55198, 55203, 
+    55208, 55213, 55218, 55223, 55228, 55233, 55238, 55243, 55248, 55253, 
+    55258, 55263, 55268, 55273, 55278, 55283, 55288, 55293, 55298, 55304, 
+    55309, 55315, 55324, 55329, 55337, 55344, 55353, 55358, 55363, 55368, 
+    55374, 0, 55381, 55389, 55397, 55406, 55413, 55421, 55427, 55436, 55444, 
+    55452, 55460, 55468, 55476, 55484, 55489, 55496, 55502, 55509, 55517, 
+    55524, 55531, 55539, 55545, 55551, 55558, 55565, 55575, 55585, 55592, 
+    55599, 55604, 55614, 55624, 55629, 55634, 55639, 55644, 55649, 55654, 
+    55659, 55664, 55669, 55674, 55679, 55684, 55689, 55694, 55699, 55704, 
+    55709, 55714, 55719, 55724, 55729, 55734, 55739, 55744, 55749, 55754, 
+    55759, 55764, 55769, 55774, 55778, 55782, 55787, 55792, 55797, 55802, 
+    55807, 55812, 55817, 55822, 55827, 55832, 55837, 55842, 55847, 55852, 
+    55857, 55862, 55867, 55872, 55879, 55886, 55893, 55900, 55907, 55914, 
+    55921, 55928, 55935, 55942, 55949, 55956, 55963, 55970, 55975, 55980, 
+    55987, 55994, 56001, 56008, 56015, 56022, 56029, 56036, 56043, 56050, 
+    56057, 56064, 56070, 56076, 56082, 56088, 56095, 56102, 56109, 56116, 
+    56123, 56130, 56137, 56144, 56151, 56158, 56166, 56174, 56182, 56190, 
+    56198, 56206, 56214, 56222, 56226, 56232, 56238, 56242, 56248, 56254, 
+    56260, 56267, 56274, 56281, 56288, 56293, 56299, 56305, 56312, 0, 0, 0, 
+    0, 0, 56319, 56327, 56336, 56345, 56353, 56359, 56364, 56369, 56374, 
+    56379, 56384, 56389, 56394, 56399, 56404, 56409, 56414, 56419, 56424, 
+    56429, 56434, 56439, 56444, 56449, 56454, 56459, 56464, 56469, 56474, 
+    56479, 56484, 56489, 56494, 56499, 56504, 56509, 56514, 56519, 56524, 
+    56529, 56534, 56539, 56544, 56549, 56554, 0, 56559, 0, 0, 0, 0, 0, 56564, 
+    0, 0, 56569, 56573, 56578, 56583, 56588, 56593, 56602, 56607, 56612, 
+    56617, 56622, 56627, 56632, 56637, 56642, 56649, 56654, 56659, 56668, 
+    56675, 56680, 56685, 56690, 56697, 56702, 56709, 56714, 56719, 56726, 
+    56733, 56738, 56743, 56748, 56755, 56762, 56767, 56772, 56777, 56782, 
+    56787, 56794, 56801, 56806, 56811, 56816, 56821, 56826, 56831, 56836, 
+    56841, 56846, 56851, 56856, 56863, 56868, 56873, 0, 0, 0, 0, 0, 0, 0, 
+    56878, 56885, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56890, 56895, 
+    56899, 56903, 56907, 56911, 56915, 56919, 56923, 56927, 56931, 56935, 
+    56941, 56945, 56949, 56953, 56957, 56961, 56965, 56969, 56973, 56977, 
+    56981, 56985, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56989, 56993, 56997, 57001, 
+    57005, 57009, 57013, 0, 57017, 57021, 57025, 57029, 57033, 57037, 57041, 
+    0, 57045, 57049, 57053, 57057, 57061, 57065, 57069, 0, 57073, 57077, 
+    57081, 57085, 57089, 57093, 57097, 0, 57101, 57105, 57109, 57113, 57117, 
+    57121, 57125, 0, 57129, 57133, 57137, 57141, 57145, 57149, 57153, 0, 
+    57157, 57161, 57165, 57169, 57173, 57177, 57181, 0, 57185, 57189, 57193, 
+    57197, 57201, 57205, 57209, 0, 57213, 57218, 57223, 57228, 57233, 57238, 
+    57243, 57247, 57252, 57257, 57262, 57266, 57271, 57276, 57281, 57286, 
+    57290, 57295, 57300, 57305, 57310, 57315, 57320, 57324, 57329, 57334, 
+    57341, 57346, 57351, 57357, 57364, 57371, 57380, 57387, 57396, 57400, 
+    57404, 57410, 57416, 57422, 57430, 57436, 57440, 57444, 57448, 57454, 
+    57460, 57464, 57466, 57470, 57476, 57478, 57482, 57486, 57490, 57496, 
+    57501, 57505, 57509, 57514, 57520, 57525, 57530, 57535, 57540, 57547, 
+    57554, 57559, 57564, 57569, 57574, 57579, 57584, 57588, 57592, 57599, 
+    57606, 57612, 57616, 57621, 57623, 57627, 57635, 57639, 57643, 57647, 
+    57651, 57657, 57663, 57667, 57673, 57677, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57653, 57657, 
-    57661, 57666, 57671, 57676, 57680, 57684, 57688, 57693, 57698, 57702, 
-    57706, 57710, 57714, 57719, 57724, 57729, 57734, 57738, 57742, 57747, 
-    57752, 57757, 57762, 57766, 0, 57770, 57774, 57778, 57782, 57786, 57790, 
-    57794, 57799, 57804, 57808, 57813, 57818, 57827, 57831, 57835, 57839, 
-    57846, 57850, 57855, 57860, 57864, 57868, 57874, 57879, 57884, 57889, 
-    57894, 57898, 57902, 57906, 57910, 57914, 57919, 57924, 57928, 57932, 
-    57937, 57942, 57947, 57951, 57955, 57960, 57965, 57971, 57977, 57981, 
-    57987, 57993, 57997, 58003, 58009, 58014, 58019, 58023, 58029, 58033, 
-    58037, 58043, 58049, 58054, 58059, 58063, 58067, 58075, 58081, 58087, 
-    58093, 58098, 58103, 58108, 58114, 58118, 58124, 58128, 58132, 58138, 
-    58144, 58150, 58156, 58162, 58168, 58174, 58180, 58186, 58192, 58198, 
-    58204, 58208, 58214, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 58220, 58223, 
-    58227, 58231, 58235, 58239, 58242, 58245, 58249, 58253, 58257, 58261, 
-    58264, 58269, 58273, 58277, 58281, 58286, 58290, 58294, 58298, 58302, 
-    58308, 58314, 58318, 58322, 58326, 58330, 58334, 58338, 58342, 58346, 
-    58350, 58354, 58358, 58364, 58368, 58372, 58376, 58380, 58384, 58388, 
-    58392, 58396, 58400, 58404, 58408, 58412, 58416, 58420, 58424, 58428, 
-    58434, 58440, 58445, 58450, 58454, 58458, 58462, 58466, 58470, 58474, 
-    58478, 58482, 58486, 58490, 58494, 58498, 58502, 58506, 58510, 58514, 
-    58518, 58522, 58526, 58530, 58534, 58538, 58542, 58546, 58552, 58556, 
-    58560, 58564, 58568, 58572, 58576, 58580, 58584, 58589, 58596, 58600, 
-    58604, 58608, 58612, 58616, 58620, 58624, 58628, 58632, 58636, 58640, 
-    58644, 58651, 58655, 58661, 58665, 58669, 58673, 58677, 58681, 58684, 
-    58688, 58692, 58696, 58700, 58704, 58708, 58712, 58716, 58720, 58724, 
-    58728, 58732, 58736, 58740, 58744, 58748, 58752, 58756, 58760, 58764, 
-    58768, 58772, 58776, 58780, 58784, 58788, 58792, 58796, 58800, 58804, 
-    58808, 58812, 58818, 58822, 58826, 58830, 58834, 58838, 58842, 58846, 
-    58850, 58854, 58858, 58862, 58866, 58870, 58874, 58878, 58882, 58886, 
-    58890, 58894, 58898, 58902, 58906, 58910, 58914, 58918, 58922, 58926, 
-    58934, 58938, 58942, 58946, 58950, 58954, 58960, 58964, 58968, 58972, 
-    58976, 58980, 58984, 58988, 58992, 58996, 59000, 59004, 59008, 59012, 
-    59018, 59022, 59026, 59030, 59034, 59038, 59042, 59046, 59050, 59054, 
-    59058, 59062, 59066, 59070, 59074, 59078, 59082, 59086, 59090, 59094, 
-    59098, 59102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 59106, 59115, 59123, 59135, 59146, 59154, 59163, 59172, 
-    59182, 59194, 59206, 59218, 0, 0, 0, 0, 59224, 59227, 59230, 59235, 
-    59238, 59245, 59249, 59253, 59257, 59261, 59265, 59270, 59275, 59279, 
-    59283, 59288, 59293, 59298, 59303, 59306, 59309, 59315, 59321, 59326, 
-    59331, 59338, 59345, 59349, 59353, 59357, 59365, 59371, 59378, 59383, 
-    59388, 59393, 59398, 59403, 59408, 59413, 59418, 59423, 59428, 59433, 
-    59438, 59443, 59448, 59454, 59459, 59463, 59469, 59480, 59490, 59505, 
-    59515, 59519, 59529, 59535, 59541, 59547, 59552, 59555, 59560, 59564, 0, 
-    59570, 59574, 59577, 59581, 59584, 59588, 59591, 59595, 59598, 59602, 
-    59605, 59608, 59612, 59616, 59620, 59624, 59628, 59632, 59636, 59640, 
-    59644, 59647, 59651, 59655, 59659, 59663, 59667, 59671, 59675, 59679, 
-    59683, 59687, 59691, 59695, 59699, 59704, 59708, 59712, 59716, 59720, 
-    59723, 59727, 59730, 59734, 59738, 59742, 59746, 59749, 59753, 59756, 
-    59760, 59764, 59768, 59772, 59776, 59780, 59784, 59788, 59792, 59796, 
-    59800, 59804, 59807, 59811, 59815, 59819, 59823, 59827, 59830, 59835, 
-    59839, 59844, 59848, 59851, 59855, 59859, 59863, 59867, 59872, 59876, 
-    59880, 59884, 59888, 59892, 59896, 59900, 0, 0, 59905, 59913, 59921, 
-    59928, 59935, 59939, 59945, 59950, 59955, 59959, 59962, 59966, 59969, 
-    59973, 59976, 59980, 59983, 59987, 59990, 59993, 59997, 60001, 60005, 
-    60009, 60013, 60017, 60021, 60025, 60029, 60032, 60036, 60040, 60044, 
-    60048, 60052, 60056, 60060, 60064, 60068, 60072, 60076, 60080, 60084, 
-    60089, 60093, 60097, 60101, 60105, 60108, 60112, 60115, 60119, 60123, 
-    60127, 60131, 60134, 60138, 60141, 60145, 60149, 60153, 60157, 60161, 
-    60165, 60169, 60173, 60177, 60181, 60185, 60189, 60192, 60196, 60200, 
-    60204, 60208, 60212, 60215, 60220, 60224, 60229, 60233, 60236, 60240, 
-    60244, 60248, 60252, 60257, 60261, 60265, 60269, 60273, 60277, 60281, 
-    60285, 60290, 60294, 60298, 60302, 60306, 60311, 60318, 60322, 60328, 0, 
-    0, 0, 0, 0, 60333, 60338, 60343, 60347, 60352, 60357, 60362, 60367, 
-    60371, 60376, 60381, 60386, 60391, 60396, 60401, 60406, 60411, 60416, 
-    60420, 60425, 60430, 60435, 60439, 60443, 60447, 60452, 60457, 60462, 
-    60467, 60472, 60477, 60482, 60487, 60492, 60497, 60501, 60505, 60510, 
-    60515, 60520, 60525, 0, 0, 0, 60530, 60534, 60538, 60542, 60546, 60550, 
-    60554, 60558, 60562, 60566, 60570, 60574, 60578, 60582, 60586, 60590, 
-    60594, 60598, 60602, 60606, 60610, 60614, 60618, 60622, 60626, 60630, 
-    60634, 60638, 60642, 60646, 60650, 60653, 60657, 60660, 60664, 60668, 
-    60671, 60675, 60679, 60682, 60686, 60690, 60694, 60698, 60701, 60705, 
-    60709, 60713, 60717, 60721, 60725, 60728, 60731, 60735, 60739, 60743, 
-    60747, 60751, 60755, 60759, 60763, 60767, 60771, 60775, 60779, 60783, 
-    60787, 60791, 60795, 60799, 60803, 60807, 60811, 60815, 60819, 60823, 
-    60827, 60831, 60835, 60839, 60843, 60847, 60851, 60855, 60859, 60863, 
-    60867, 60871, 60875, 60879, 60883, 60887, 60891, 60895, 0, 60899, 60905, 
-    60911, 60916, 60921, 60926, 60932, 60938, 60944, 60950, 60956, 60962, 
-    60968, 60974, 60980, 60986, 60992, 60997, 61002, 61007, 61012, 61017, 
-    61022, 61027, 61032, 61037, 61042, 61047, 61052, 61057, 61062, 61067, 
-    61072, 61077, 61082, 61087, 61092, 61098, 61104, 61110, 61116, 61121, 
-    61126, 0, 0, 0, 0, 0, 61131, 61136, 61141, 61146, 61151, 61156, 61161, 
-    61166, 61171, 61176, 61181, 61186, 61191, 61196, 61201, 61206, 61211, 
-    61216, 61221, 61226, 61231, 61236, 61241, 61246, 61251, 61256, 61261, 
-    61266, 61271, 61276, 61281, 61286, 61291, 61296, 61301, 61306, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 61311, 61316, 61321, 61326, 61330, 61335, 
-    61339, 61344, 61349, 61354, 61359, 61364, 61368, 61373, 61378, 61383, 
-    61388, 61392, 61396, 61400, 61404, 61408, 61412, 61416, 61420, 61424, 
-    61428, 61432, 61436, 61440, 61444, 61449, 61454, 61459, 61464, 61469, 
-    61474, 61479, 61484, 61489, 61494, 61499, 61504, 61509, 61514, 61519, 
-    61525, 0, 61532, 61535, 61538, 61541, 61544, 61547, 61550, 61553, 61556, 
-    61559, 61563, 61567, 61571, 61575, 61579, 61583, 61587, 61591, 61595, 
-    61599, 61603, 61607, 61611, 61615, 61619, 61623, 61627, 61631, 61635, 
-    61639, 61643, 61647, 61651, 61655, 61659, 61663, 61667, 61671, 61675, 
-    61679, 61683, 61692, 61701, 61710, 61719, 61728, 61737, 61746, 61755, 
-    61758, 61763, 61768, 61773, 61778, 61783, 61788, 61793, 61798, 61803, 
-    61807, 61812, 61817, 61822, 61827, 61832, 61836, 61840, 61844, 61848, 
-    61852, 61856, 61860, 61864, 61868, 61872, 61876, 61880, 61884, 61888, 
-    61893, 61898, 61903, 61908, 61913, 61918, 61923, 61928, 61933, 61938, 
-    61943, 61948, 61953, 61958, 61964, 61970, 61975, 61980, 61983, 61986, 
-    61989, 61992, 61995, 61998, 62001, 62004, 62007, 62011, 62015, 62019, 
-    62023, 62027, 62031, 62035, 62039, 62043, 62047, 62051, 62055, 62059, 
-    62063, 62067, 62071, 62075, 62079, 62083, 62087, 62091, 62095, 62099, 
-    62103, 62107, 62111, 62115, 62119, 62123, 62127, 62131, 62135, 62139, 
-    62143, 62147, 62151, 62155, 62159, 62163, 62167, 62172, 62177, 62182, 
-    62187, 62191, 62196, 62201, 62206, 62211, 62216, 62221, 62226, 62231, 
-    62236, 62240, 62247, 62254, 62261, 62268, 62275, 62282, 62289, 62296, 
-    62303, 62310, 62317, 62324, 62327, 62330, 62333, 62338, 62341, 62344, 
-    62347, 62350, 62353, 62356, 62360, 62364, 62368, 62372, 62375, 62379, 
-    62383, 62387, 62391, 62395, 62399, 62403, 62407, 62410, 62413, 62417, 
-    62421, 62425, 62429, 62432, 62436, 62440, 62444, 62448, 62451, 62455, 
-    62459, 62463, 62467, 62470, 62474, 62478, 62481, 62485, 62489, 62493, 
-    62497, 62501, 62505, 62509, 0, 62513, 62516, 62519, 62522, 62525, 62528, 
-    62531, 62534, 62537, 62540, 62543, 62546, 62549, 62552, 62555, 62558, 
-    62561, 62564, 62567, 62570, 62573, 62576, 62579, 62582, 62585, 62588, 
-    62591, 62594, 62597, 62600, 62603, 62606, 62609, 62612, 62615, 62618, 
-    62621, 62624, 62627, 62630, 62633, 62636, 62639, 62642, 62645, 62648, 
-    62651, 62654, 62657, 62660, 62663, 62666, 62669, 62672, 62675, 62678, 
-    62681, 62684, 62687, 62690, 62693, 62696, 62699, 62702, 62705, 62708, 
-    62711, 62714, 62717, 62720, 62723, 62726, 62729, 62732, 62735, 62738, 
-    62741, 62744, 62747, 62750, 62753, 62756, 62759, 62762, 62765, 62768, 
-    62771, 62774, 62777, 62786, 62794, 62802, 62810, 62818, 62826, 62834, 
-    62842, 62850, 62858, 62867, 62876, 62885, 62894, 62903, 62912, 62921, 
-    62930, 62939, 62948, 62957, 62966, 62975, 62984, 62993, 62996, 62999, 
-    63002, 63004, 63007, 63010, 63013, 63018, 63023, 63026, 63033, 63040, 
-    63047, 63054, 63057, 63062, 63064, 63068, 63070, 63072, 63075, 63078, 
-    63081, 63084, 63087, 63090, 63093, 63098, 63103, 63106, 63109, 63112, 
-    63115, 63118, 63121, 63124, 63128, 63131, 63134, 63137, 63140, 63143, 
-    63147, 63150, 63153, 63156, 63161, 63166, 63171, 63176, 63181, 63186, 
-    63191, 63196, 63202, 63210, 63212, 63215, 63218, 63221, 63224, 63230, 
-    63238, 63241, 63244, 63249, 63252, 63255, 63258, 63263, 63266, 63269, 
-    63274, 63277, 63280, 63285, 63288, 63291, 63296, 63301, 63306, 63309, 
-    63312, 63315, 63318, 63324, 63327, 63330, 63333, 63335, 63338, 63341, 
-    63344, 63349, 63352, 63355, 63358, 63361, 63364, 63369, 63372, 63375, 
-    63378, 63381, 63384, 63387, 63390, 63393, 63396, 63401, 63405, 63413, 
-    63421, 63429, 63437, 63445, 63453, 63461, 63469, 63477, 63486, 63495, 
-    63504, 63513, 63522, 63531, 63540, 63549, 63558, 63567, 63576, 63585, 
-    63594, 63603, 63612, 63621, 63630, 63639, 63648, 63657, 63666, 63675, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57681, 57685, 57689, 57694, 57699, 57704, 
+    57708, 57712, 57716, 57721, 57726, 57730, 57734, 57738, 57742, 57747, 
+    57752, 57757, 57762, 57766, 57770, 57775, 57780, 57785, 57790, 57794, 0, 
+    57798, 57802, 57806, 57810, 57814, 57818, 57822, 57827, 57832, 57836, 
+    57841, 57846, 57855, 57859, 57863, 57867, 57874, 57878, 57883, 57888, 
+    57892, 57896, 57902, 57907, 57912, 57917, 57922, 57926, 57930, 57934, 
+    57938, 57942, 57947, 57952, 57956, 57960, 57965, 57970, 57975, 57979, 
+    57983, 57988, 57993, 57999, 58005, 58009, 58015, 58021, 58025, 58031, 
+    58037, 58042, 58047, 58051, 58057, 58061, 58065, 58071, 58077, 58082, 
+    58087, 58091, 58095, 58103, 58109, 58115, 58121, 58126, 58131, 58136, 
+    58142, 58146, 58152, 58156, 58160, 58166, 58172, 58178, 58184, 58190, 
+    58196, 58202, 58208, 58214, 58220, 58226, 58232, 58236, 58242, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 58248, 58251, 58255, 58259, 58263, 58267, 
+    58270, 58273, 58277, 58281, 58285, 58289, 58292, 58297, 58301, 58305, 
+    58309, 58314, 58318, 58322, 58326, 58330, 58336, 58342, 58346, 58350, 
+    58354, 58358, 58362, 58366, 58370, 58374, 58378, 58382, 58386, 58392, 
+    58396, 58400, 58404, 58408, 58412, 58416, 58420, 58424, 58428, 58432, 
+    58436, 58440, 58444, 58448, 58452, 58456, 58462, 58468, 58473, 58478, 
+    58482, 58486, 58490, 58494, 58498, 58502, 58506, 58510, 58514, 58518, 
+    58522, 58526, 58530, 58534, 58538, 58542, 58546, 58550, 58554, 58558, 
+    58562, 58566, 58570, 58574, 58580, 58584, 58588, 58592, 58596, 58600, 
+    58604, 58608, 58612, 58617, 58624, 58628, 58632, 58636, 58640, 58644, 
+    58648, 58652, 58656, 58660, 58664, 58668, 58672, 58679, 58683, 58689, 
+    58693, 58697, 58701, 58705, 58709, 58712, 58716, 58720, 58724, 58728, 
+    58732, 58736, 58740, 58744, 58748, 58752, 58756, 58760, 58764, 58768, 
+    58772, 58776, 58780, 58784, 58788, 58792, 58796, 58800, 58804, 58808, 
+    58812, 58816, 58820, 58824, 58828, 58832, 58836, 58840, 58846, 58850, 
+    58854, 58858, 58862, 58866, 58870, 58874, 58878, 58882, 58886, 58890, 
+    58894, 58898, 58902, 58906, 58910, 58914, 58918, 58922, 58926, 58930, 
+    58934, 58938, 58942, 58946, 58950, 58954, 58962, 58966, 58970, 58974, 
+    58978, 58982, 58988, 58992, 58996, 59000, 59004, 59008, 59012, 59016, 
+    59020, 59024, 59028, 59032, 59036, 59040, 59046, 59050, 59054, 59058, 
+    59062, 59066, 59070, 59074, 59078, 59082, 59086, 59090, 59094, 59098, 
+    59102, 59106, 59110, 59114, 59118, 59122, 59126, 59130, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 59134, 59143, 
+    59151, 59163, 59174, 59182, 59191, 59200, 59210, 59222, 59234, 59246, 0, 
+    0, 0, 0, 59252, 59255, 59258, 59263, 59266, 59273, 59277, 59281, 59285, 
+    59289, 59293, 59298, 59303, 59307, 59311, 59316, 59321, 59326, 59331, 
+    59334, 59337, 59343, 59349, 59354, 59359, 59366, 59373, 59377, 59381, 
+    59385, 59393, 59399, 59406, 59411, 59416, 59421, 59426, 59431, 59436, 
+    59441, 59446, 59451, 59456, 59461, 59466, 59471, 59476, 59482, 59487, 
+    59491, 59497, 59508, 59518, 59533, 59543, 59547, 59557, 59563, 59569, 
+    59575, 59580, 59583, 59588, 59592, 0, 59598, 59602, 59605, 59609, 59612, 
+    59616, 59619, 59623, 59626, 59630, 59633, 59636, 59640, 59644, 59648, 
+    59652, 59656, 59660, 59664, 59668, 59672, 59675, 59679, 59683, 59687, 
+    59691, 59695, 59699, 59703, 59707, 59711, 59715, 59719, 59723, 59727, 
+    59732, 59736, 59740, 59744, 59748, 59751, 59755, 59758, 59762, 59766, 
+    59770, 59774, 59777, 59781, 59784, 59788, 59792, 59796, 59800, 59804, 
+    59808, 59812, 59816, 59820, 59824, 59828, 59832, 59835, 59839, 59843, 
+    59847, 59851, 59855, 59858, 59863, 59867, 59872, 59876, 59879, 59883, 
+    59887, 59891, 59895, 59900, 59904, 59908, 59912, 59916, 59920, 59924, 
+    59928, 0, 0, 59933, 59941, 59949, 59956, 59963, 59967, 59973, 59978, 
+    59983, 59987, 59990, 59994, 59997, 60001, 60004, 60008, 60011, 60015, 
+    60018, 60021, 60025, 60029, 60033, 60037, 60041, 60045, 60049, 60053, 
+    60057, 60060, 60064, 60068, 60072, 60076, 60080, 60084, 60088, 60092, 
+    60096, 60100, 60104, 60108, 60112, 60117, 60121, 60125, 60129, 60133, 
+    60136, 60140, 60143, 60147, 60151, 60155, 60159, 60162, 60166, 60169, 
+    60173, 60177, 60181, 60185, 60189, 60193, 60197, 60201, 60205, 60209, 
+    60213, 60217, 60220, 60224, 60228, 60232, 60236, 60240, 60243, 60248, 
+    60252, 60257, 60261, 60264, 60268, 60272, 60276, 60280, 60285, 60289, 
+    60293, 60297, 60301, 60305, 60309, 60313, 60318, 60322, 60326, 60330, 
+    60334, 60339, 60346, 60350, 60356, 0, 0, 0, 0, 0, 60361, 60366, 60371, 
+    60375, 60380, 60385, 60390, 60395, 60399, 60404, 60409, 60414, 60419, 
+    60424, 60429, 60434, 60439, 60444, 60448, 60453, 60458, 60463, 60467, 
+    60471, 60475, 60480, 60485, 60490, 60495, 60500, 60505, 60510, 60515, 
+    60520, 60525, 60529, 60533, 60538, 60543, 60548, 60553, 0, 0, 0, 60558, 
+    60562, 60566, 60570, 60574, 60578, 60582, 60586, 60590, 60594, 60598, 
+    60602, 60606, 60610, 60614, 60618, 60622, 60626, 60630, 60634, 60638, 
+    60642, 60646, 60650, 60654, 60658, 60662, 60666, 60670, 60674, 60678, 
+    60681, 60685, 60688, 60692, 60696, 60699, 60703, 60707, 60710, 60714, 
+    60718, 60722, 60726, 60729, 60733, 60737, 60741, 60745, 60749, 60753, 
+    60756, 60759, 60763, 60767, 60771, 60775, 60779, 60783, 60787, 60791, 
+    60795, 60799, 60803, 60807, 60811, 60815, 60819, 60823, 60827, 60831, 
+    60835, 60839, 60843, 60847, 60851, 60855, 60859, 60863, 60867, 60871, 
+    60875, 60879, 60883, 60887, 60891, 60895, 60899, 60903, 60907, 60911, 
+    60915, 60919, 60923, 0, 60927, 60933, 60939, 60944, 60949, 60954, 60960, 
+    60966, 60972, 60978, 60984, 60990, 60996, 61002, 61008, 61014, 61020, 
+    61025, 61030, 61035, 61040, 61045, 61050, 61055, 61060, 61065, 61070, 
+    61075, 61080, 61085, 61090, 61095, 61100, 61105, 61110, 61115, 61120, 
+    61126, 61132, 61138, 61144, 61149, 61154, 0, 0, 0, 0, 0, 61159, 61164, 
+    61169, 61174, 61179, 61184, 61189, 61194, 61199, 61204, 61209, 61214, 
+    61219, 61224, 61229, 61234, 61239, 61244, 61249, 61254, 61259, 61264, 
+    61269, 61274, 61279, 61284, 61289, 61294, 61299, 61304, 61309, 61314, 
+    61319, 61324, 61329, 61334, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61339, 
+    61344, 61349, 61354, 61358, 61363, 61367, 61372, 61377, 61382, 61387, 
+    61392, 61396, 61401, 61406, 61411, 61416, 61420, 61424, 61428, 61432, 
+    61436, 61440, 61444, 61448, 61452, 61456, 61460, 61464, 61468, 61472, 
+    61477, 61482, 61487, 61492, 61497, 61502, 61507, 61512, 61517, 61522, 
+    61527, 61532, 61537, 61542, 61547, 61553, 0, 61560, 61563, 61566, 61569, 
+    61572, 61575, 61578, 61581, 61584, 61587, 61591, 61595, 61599, 61603, 
+    61607, 61611, 61615, 61619, 61623, 61627, 61631, 61635, 61639, 61643, 
+    61647, 61651, 61655, 61659, 61663, 61667, 61671, 61675, 61679, 61683, 
+    61687, 61691, 61695, 61699, 61703, 61707, 61711, 61720, 61729, 61738, 
+    61747, 61756, 61765, 61774, 61783, 61786, 61791, 61796, 61801, 61806, 
+    61811, 61816, 61821, 61826, 61831, 61835, 61840, 61845, 61850, 61855, 
+    61860, 61864, 61868, 61872, 61876, 61880, 61884, 61888, 61892, 61896, 
+    61900, 61904, 61908, 61912, 61916, 61921, 61926, 61931, 61936, 61941, 
+    61946, 61951, 61956, 61961, 61966, 61971, 61976, 61981, 61986, 61992, 
+    61998, 62003, 62008, 62011, 62014, 62017, 62020, 62023, 62026, 62029, 
+    62032, 62035, 62039, 62043, 62047, 62051, 62055, 62059, 62063, 62067, 
+    62071, 62075, 62079, 62083, 62087, 62091, 62095, 62099, 62103, 62107, 
+    62111, 62115, 62119, 62123, 62127, 62131, 62135, 62139, 62143, 62147, 
+    62151, 62155, 62159, 62163, 62167, 62171, 62175, 62179, 62183, 62187, 
+    62191, 62195, 62200, 62205, 62210, 62215, 62219, 62224, 62229, 62234, 
+    62239, 62244, 62249, 62254, 62259, 62264, 62268, 62275, 62282, 62289, 
+    62296, 62303, 62310, 62317, 62324, 62331, 62338, 62345, 62352, 62355, 
+    62358, 62361, 62366, 62369, 62372, 62375, 62378, 62381, 62384, 62388, 
+    62392, 62396, 62400, 62403, 62407, 62411, 62415, 62419, 62423, 62427, 
+    62431, 62435, 62438, 62441, 62445, 62449, 62453, 62457, 62460, 62464, 
+    62468, 62472, 62476, 62479, 62483, 62487, 62491, 62495, 62498, 62502, 
+    62506, 62509, 62513, 62517, 62521, 62525, 62529, 62533, 62537, 0, 62541, 
+    62544, 62547, 62550, 62553, 62556, 62559, 62562, 62565, 62568, 62571, 
+    62574, 62577, 62580, 62583, 62586, 62589, 62592, 62595, 62598, 62601, 
+    62604, 62607, 62610, 62613, 62616, 62619, 62622, 62625, 62628, 62631, 
+    62634, 62637, 62640, 62643, 62646, 62649, 62652, 62655, 62658, 62661, 
+    62664, 62667, 62670, 62673, 62676, 62679, 62682, 62685, 62688, 62691, 
+    62694, 62697, 62700, 62703, 62706, 62709, 62712, 62715, 62718, 62721, 
+    62724, 62727, 62730, 62733, 62736, 62739, 62742, 62745, 62748, 62751, 
+    62754, 62757, 62760, 62763, 62766, 62769, 62772, 62775, 62778, 62781, 
+    62784, 62787, 62790, 62793, 62796, 62799, 62802, 62805, 62814, 62822, 
+    62830, 62838, 62846, 62854, 62862, 62870, 62878, 62886, 62895, 62904, 
+    62913, 62922, 62931, 62940, 62949, 62958, 62967, 62976, 62985, 62994, 
+    63003, 63012, 63021, 63024, 63027, 63030, 63032, 63035, 63038, 63041, 
+    63046, 63051, 63054, 63061, 63068, 63075, 63082, 63085, 63090, 63092, 
+    63096, 63098, 63100, 63103, 63106, 63109, 63112, 63115, 63118, 63121, 
+    63126, 63131, 63134, 63137, 63140, 63143, 63146, 63149, 63152, 63156, 
+    63159, 63162, 63165, 63168, 63171, 63175, 63178, 63181, 63184, 63189, 
+    63194, 63199, 63204, 63209, 63214, 63219, 63224, 63230, 63238, 63240, 
+    63243, 63246, 63249, 63252, 63258, 63266, 63269, 63272, 63277, 63280, 
+    63283, 63286, 63291, 63294, 63297, 63302, 63305, 63308, 63313, 63316, 
+    63319, 63324, 63329, 63334, 63337, 63340, 63343, 63346, 63352, 63355, 
+    63358, 63361, 63363, 63366, 63369, 63372, 63377, 63380, 63383, 63386, 
+    63389, 63392, 63397, 63400, 63403, 63406, 63409, 63412, 63415, 63418, 
+    63421, 63424, 63429, 63433, 63441, 63449, 63457, 63465, 63473, 63481, 
+    63489, 63497, 63505, 63514, 63523, 63532, 63541, 63550, 63559, 63568, 
+    63577, 63586, 63595, 63604, 63613, 63622, 63631, 63640, 63649, 63658, 
+    63667, 63676, 63685, 63694, 63703, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63678, 63687, 63696, 63707, 
-    63714, 63719, 63724, 63731, 63738, 63744, 63749, 63754, 63759, 63764, 
-    63771, 63776, 63781, 63786, 63797, 63802, 63807, 63814, 63819, 63826, 
-    63831, 63836, 63843, 63850, 63857, 63866, 63875, 63880, 63885, 63890, 
-    63897, 63902, 63912, 63919, 63924, 63929, 63934, 63939, 63944, 63949, 
-    63958, 63965, 63972, 63977, 63984, 63989, 63996, 64005, 64016, 64021, 
-    64030, 64035, 64042, 64051, 64060, 64065, 64070, 64077, 64083, 64090, 
-    64097, 64101, 64105, 64108, 64112, 64116, 64120, 64124, 64128, 64132, 
-    64136, 64139, 64143, 64147, 64151, 64155, 64159, 64163, 64166, 64170, 
-    64174, 64177, 64181, 64185, 64189, 64193, 64197, 64201, 64205, 64209, 
-    64213, 64217, 64221, 64225, 64229, 64233, 64237, 64241, 64245, 64249, 
-    64253, 64257, 64261, 64265, 64269, 64273, 64277, 64281, 64285, 64289, 
-    64293, 64297, 64301, 64305, 64309, 64313, 64317, 64321, 64325, 64329, 
-    64333, 64337, 64341, 64345, 64349, 64353, 64356, 64360, 64364, 64368, 
-    64372, 64376, 64380, 64384, 64388, 64392, 64396, 64400, 64404, 64408, 
-    64412, 64416, 64420, 64424, 64428, 64432, 64436, 64440, 64444, 64448, 
-    64452, 64456, 64460, 64464, 64468, 64472, 64476, 64480, 64484, 64488, 
-    64492, 64496, 64500, 64504, 64508, 64512, 64516, 64520, 64524, 64528, 
-    64532, 64536, 64540, 64544, 64548, 64552, 64556, 64560, 64564, 64568, 
-    64572, 64576, 64580, 64584, 64588, 64592, 64596, 64600, 64604, 64608, 
-    64612, 64616, 64620, 64624, 64628, 64632, 64636, 64640, 64644, 64648, 
-    64652, 64656, 64660, 64664, 64668, 64672, 64676, 64680, 64684, 64688, 
-    64692, 64696, 64700, 64704, 64708, 64712, 64716, 64720, 64724, 64728, 
-    64732, 64736, 64740, 64744, 64748, 64752, 64756, 64760, 64764, 64768, 
-    64772, 64776, 64780, 64784, 64788, 64792, 64796, 64800, 64804, 64808, 
-    64812, 64816, 64820, 64824, 64827, 64831, 64835, 64839, 64843, 64847, 
-    64851, 64855, 64859, 64863, 64867, 64871, 64875, 64879, 64883, 64887, 
-    64891, 64895, 64899, 64903, 64907, 64911, 64915, 64919, 64923, 64927, 
-    64931, 64935, 64939, 64943, 64947, 64951, 64955, 64959, 64963, 64967, 
-    64971, 64975, 64979, 64983, 64987, 64991, 64995, 64999, 65003, 65007, 
-    65011, 65015, 65019, 65023, 65027, 65031, 65035, 65039, 65043, 65047, 
-    65051, 65055, 65059, 65063, 65067, 65071, 65075, 65079, 65083, 65087, 
-    65091, 65095, 65099, 65103, 65107, 65111, 65115, 65119, 65123, 65127, 
-    65131, 65135, 65139, 65143, 65147, 65151, 65155, 65159, 65163, 65167, 
-    65171, 65175, 65179, 65183, 65187, 65191, 65195, 65199, 65203, 65207, 
-    65211, 65215, 65219, 65223, 65227, 65231, 65235, 65239, 65243, 65247, 
-    65251, 65255, 65259, 65263, 65267, 65271, 65275, 65279, 65283, 65287, 
-    65290, 65294, 65298, 65302, 65306, 65310, 65314, 65318, 65322, 65326, 
-    65330, 65334, 65338, 65342, 65346, 65350, 65354, 65358, 65362, 65366, 
-    65370, 65374, 65378, 65382, 65386, 65390, 65394, 65398, 65402, 65406, 
-    65410, 65414, 65418, 65422, 65426, 65430, 65434, 65438, 65442, 65446, 
-    65450, 65454, 65458, 65462, 65466, 65470, 65474, 65478, 65482, 65486, 
-    65490, 65494, 65498, 65502, 65506, 65510, 65514, 65518, 65522, 65526, 
-    65530, 65534, 65538, 65542, 65546, 65550, 65554, 65558, 65562, 65566, 
-    65570, 65574, 65578, 65582, 65586, 65590, 65594, 65598, 65602, 65606, 
-    65610, 65614, 65618, 65622, 65626, 65630, 65634, 65638, 65642, 65646, 
-    65649, 65653, 65657, 65661, 65665, 65669, 65673, 65677, 65681, 65685, 
-    65689, 65693, 65697, 65701, 65705, 65709, 65713, 65717, 65721, 65725, 
-    65729, 65733, 65737, 65741, 65745, 65749, 65753, 65757, 65761, 65765, 
-    65769, 65773, 65777, 65781, 65785, 65789, 65793, 65797, 65801, 65805, 
-    65809, 65813, 65817, 65821, 65825, 65829, 65833, 65837, 65841, 65845, 
-    65849, 65853, 65857, 65861, 65865, 65869, 65873, 65877, 65881, 65885, 
-    65889, 65893, 65897, 65901, 65905, 65909, 65913, 65917, 65921, 65925, 
-    65929, 65933, 65937, 65941, 65945, 65949, 65953, 65957, 65961, 65965, 
-    65969, 65973, 65977, 65981, 65985, 65989, 65993, 65997, 66001, 66005, 
-    66009, 66013, 66017, 66021, 66025, 66029, 66033, 66037, 66041, 66045, 
-    66049, 66053, 66057, 66061, 66065, 66069, 66073, 66077, 66081, 66085, 
-    66089, 66093, 66097, 66101, 66105, 66109, 66113, 66117, 66121, 66125, 
-    66129, 66133, 66137, 66141, 66144, 66148, 66152, 66156, 66160, 66164, 
-    66168, 66172, 66176, 66180, 66184, 66188, 66192, 66196, 66200, 66204, 
-    66208, 66212, 66216, 66220, 66224, 66228, 66232, 66236, 66240, 66244, 
-    66248, 66252, 66256, 66260, 66264, 66268, 66272, 66276, 66280, 66284, 
-    66288, 66292, 66296, 66300, 66304, 66308, 66312, 66316, 66320, 66324, 
-    66328, 66332, 66336, 66340, 66344, 66348, 66352, 66356, 66360, 66364, 
-    66368, 66372, 66376, 66380, 66384, 66388, 66392, 66396, 66400, 66404, 
-    66408, 66412, 66416, 66420, 66424, 66428, 66432, 66436, 66440, 66444, 
-    66448, 66452, 66456, 66460, 66464, 66468, 66472, 66476, 66480, 66484, 
-    66488, 66492, 66496, 66500, 66504, 66508, 66512, 66516, 66520, 66524, 
-    66528, 66532, 66536, 66540, 66544, 66548, 66552, 66556, 66560, 66564, 
-    66568, 66572, 66576, 66580, 66584, 66588, 66592, 66596, 66599, 66603, 
-    66607, 66611, 66615, 66619, 66623, 66627, 66631, 66635, 66639, 66643, 
-    66647, 66651, 66655, 66659, 66663, 66667, 66671, 66675, 66679, 66683, 
-    66687, 66691, 66695, 66699, 66703, 66707, 66711, 66715, 66719, 66723, 
-    66727, 66731, 66735, 66739, 66743, 66747, 66751, 66755, 66759, 66763, 
-    66767, 66771, 66775, 66779, 66783, 66787, 66791, 66795, 66799, 66803, 
-    66807, 66811, 66815, 66819, 66823, 66827, 66831, 66835, 66839, 66843, 
-    66847, 66851, 66855, 66859, 66863, 66867, 66871, 66875, 66879, 66883, 
-    66887, 66891, 66895, 66899, 66903, 66907, 66911, 66915, 66919, 66923, 
-    66927, 66931, 66935, 66939, 66943, 66947, 66951, 66955, 66959, 66963, 
-    66967, 66971, 66975, 66979, 66983, 66987, 66991, 66995, 66999, 67003, 
-    67007, 67011, 67015, 67019, 67023, 67027, 67031, 67035, 67039, 67043, 
-    67047, 67051, 67055, 67059, 67063, 67067, 67071, 67075, 67079, 67083, 
-    67087, 67091, 67095, 67099, 67103, 67107, 67111, 67115, 67119, 67123, 
-    67127, 67131, 67135, 67139, 67143, 67147, 67151, 67155, 67159, 67163, 
-    67167, 67171, 67175, 67179, 67183, 67187, 67191, 67195, 67199, 67202, 
-    67206, 67210, 67214, 67218, 67222, 67226, 67230, 67233, 67237, 67241, 
-    67245, 67249, 67253, 67257, 67261, 67265, 67269, 67273, 67277, 67281, 
-    67285, 67289, 67293, 67297, 67301, 67305, 67309, 67313, 67317, 67321, 
-    67325, 67329, 67333, 67337, 67341, 67345, 67349, 67353, 67357, 67361, 
-    67365, 67369, 67373, 67377, 67381, 67385, 67389, 67393, 67397, 67401, 
-    67405, 67409, 67413, 67417, 67421, 67425, 67429, 67433, 67437, 67441, 
-    67445, 67449, 67453, 67457, 67461, 67465, 67469, 67473, 67477, 67481, 
-    67485, 67489, 67493, 67497, 67501, 67505, 67509, 67513, 67517, 67521, 
-    67525, 67529, 67533, 67537, 67541, 67545, 67549, 67553, 67557, 67561, 
-    67565, 67569, 67573, 67577, 67581, 67585, 67589, 67593, 67597, 67601, 
-    67605, 67609, 67613, 67617, 67621, 67625, 67629, 67633, 67637, 67641, 
-    67645, 67649, 67653, 67657, 67661, 67665, 67669, 67673, 67677, 67681, 
-    67685, 67689, 67693, 67697, 67701, 67705, 67709, 67713, 67717, 67721, 
-    67725, 67729, 67733, 67737, 67741, 67745, 67749, 67753, 67757, 67761, 
-    67765, 67769, 67773, 67777, 67781, 67785, 67789, 67793, 67797, 67801, 
-    67805, 67809, 67813, 67817, 67821, 67825, 67829, 67833, 67837, 67841, 
-    67845, 67849, 67853, 67857, 67861, 67865, 67869, 67873, 67877, 67881, 
-    67885, 67889, 67893, 67897, 67901, 67905, 67909, 67913, 67917, 67921, 
-    67925, 67929, 67933, 67937, 67941, 67945, 67949, 67953, 67957, 67960, 
-    67964, 67968, 67972, 67976, 67980, 67984, 67988, 67992, 67996, 68000, 
-    68004, 68008, 68012, 68016, 68020, 68024, 68028, 68032, 68036, 68040, 
-    68044, 68048, 68052, 68056, 68060, 68064, 68068, 68072, 68076, 68080, 
-    68084, 68088, 68092, 68096, 68100, 68104, 68108, 68112, 68116, 68120, 
-    68124, 68128, 68132, 68136, 68140, 68144, 68148, 68152, 68156, 68160, 
-    68164, 68168, 68172, 68176, 68180, 68184, 68188, 68192, 68196, 68200, 
-    68204, 68208, 68212, 68216, 68220, 68224, 68228, 68232, 68236, 68240, 
-    68244, 68248, 68252, 68256, 68260, 68264, 68268, 68272, 68276, 68280, 
-    68284, 68288, 68292, 68296, 68300, 68304, 68308, 68312, 68316, 68320, 
-    68324, 68328, 68332, 68336, 68340, 68344, 68348, 68352, 68356, 68360, 
-    68364, 68368, 68372, 68376, 68380, 68384, 68388, 68392, 68396, 68400, 
-    68404, 68408, 68412, 68416, 68420, 68424, 68428, 68432, 68436, 68440, 
-    68444, 68448, 68452, 68456, 68460, 68464, 68468, 68472, 68476, 68480, 
-    68484, 68488, 68492, 68496, 68500, 68504, 68508, 68512, 68516, 68520, 
-    68524, 68528, 68532, 68536, 68540, 68544, 68548, 68552, 68556, 68560, 
-    68564, 68568, 68572, 68576, 68580, 68584, 68588, 68592, 68596, 68600, 
-    68604, 68608, 68612, 68616, 68620, 68624, 68628, 68632, 68636, 68640, 
-    68644, 68648, 68652, 68656, 68660, 68664, 68668, 68672, 68676, 68680, 
-    68684, 68688, 68692, 68696, 68700, 68704, 68708, 68712, 68716, 68720, 
-    68724, 68728, 68732, 68736, 68740, 0, 0, 0, 68744, 68748, 68752, 68756, 
-    68760, 68764, 68768, 68772, 68776, 68780, 68784, 68788, 68792, 68796, 
-    68800, 68804, 68808, 68812, 68816, 68820, 68824, 68828, 68832, 68836, 
-    68840, 68844, 68848, 68852, 68856, 68860, 68864, 68868, 68872, 68876, 
-    68880, 68884, 68888, 68892, 68896, 68900, 68904, 68908, 68912, 68916, 
-    68920, 68924, 68928, 68932, 68936, 68940, 68944, 68948, 68952, 68956, 
-    68960, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68964, 68969, 68973, 68978, 68983, 
-    68988, 68993, 68998, 69002, 69007, 69012, 69017, 69022, 69027, 69032, 
-    69037, 69041, 69045, 69050, 69054, 69059, 69064, 69069, 69073, 69078, 
-    69083, 69088, 69093, 69098, 69102, 69107, 69111, 69116, 69120, 69125, 
-    69129, 69133, 69137, 69142, 69147, 69152, 69160, 69168, 69176, 69184, 
-    69191, 69199, 69205, 69213, 69217, 69221, 69225, 69229, 69233, 69237, 
-    69241, 69245, 69249, 69253, 69257, 69261, 69265, 69269, 69273, 69277, 
-    69281, 69285, 69289, 69293, 69297, 69301, 69305, 69309, 69313, 69317, 
-    69321, 69325, 69329, 69333, 69337, 69341, 69345, 69349, 69353, 69357, 
-    69360, 69364, 69368, 69372, 69376, 69380, 69384, 69388, 69392, 69396, 
-    69400, 69404, 69408, 69412, 69416, 69420, 69424, 69428, 69432, 69436, 
-    69440, 69444, 69448, 69452, 69456, 69460, 69464, 69468, 69472, 69476, 
-    69480, 69484, 69488, 69492, 69496, 69500, 69504, 69507, 69511, 69515, 
-    69518, 69522, 69526, 69530, 69533, 69537, 69541, 69545, 69549, 69553, 
-    69557, 69561, 69565, 69569, 69573, 69577, 69581, 69585, 69589, 69592, 
-    69596, 69600, 69603, 69607, 69611, 69615, 69619, 69623, 69627, 69630, 
-    69633, 69637, 69641, 69645, 69648, 69651, 69655, 69659, 69663, 69667, 
-    69671, 69675, 69679, 69683, 69687, 69691, 69695, 69699, 69703, 69707, 
-    69711, 69715, 69719, 69723, 69727, 69731, 69735, 69739, 69743, 69747, 
-    69751, 69755, 69759, 69763, 69767, 69771, 69775, 69779, 69783, 69787, 
-    69791, 69795, 69799, 69802, 69806, 69810, 69814, 69818, 69822, 69826, 
-    69830, 69834, 69838, 69842, 69846, 69850, 69854, 69858, 69862, 69866, 
-    69870, 69874, 69878, 69882, 69886, 69890, 69894, 69898, 69902, 69906, 
-    69910, 69914, 69918, 69922, 69926, 69930, 69934, 69938, 69942, 69946, 
-    69949, 69953, 69957, 69961, 69965, 69969, 69973, 69977, 69981, 69985, 
-    69989, 69993, 69997, 70001, 70005, 70009, 70013, 70016, 70020, 70024, 
-    70028, 70032, 70036, 70040, 70044, 70048, 70052, 70056, 70060, 70064, 
-    70068, 70072, 70076, 70080, 70084, 70088, 70092, 70096, 70100, 70103, 
-    70107, 70111, 70115, 70119, 70123, 70127, 70131, 70135, 70139, 70143, 
-    70147, 70151, 70155, 70159, 70163, 70167, 70171, 70175, 70179, 70183, 
-    70187, 70191, 70195, 70199, 70203, 70207, 70211, 70215, 70219, 70223, 
-    70227, 70231, 70235, 70239, 70243, 70247, 70251, 70255, 70259, 70263, 
-    70267, 70271, 70275, 70278, 70283, 70287, 70293, 70298, 70304, 70308, 
-    70312, 70316, 70320, 70324, 70328, 70332, 70336, 70340, 70344, 70348, 
-    70352, 70356, 70360, 70363, 70366, 70369, 70372, 70375, 70378, 70381, 
-    70384, 70387, 70392, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 70398, 70403, 70408, 70413, 70418, 70425, 70432, 70437, 70442, 
-    70447, 70452, 70459, 70466, 70473, 70480, 70487, 70494, 70504, 70514, 
-    70521, 70528, 70535, 70542, 70548, 70554, 70563, 70572, 70579, 70586, 
-    70597, 70608, 70613, 70618, 70625, 70632, 70639, 70646, 70653, 70660, 
-    70667, 70674, 70680, 70686, 70692, 70698, 70705, 70712, 70717, 70721, 
-    70728, 70735, 70742, 70746, 70753, 70757, 70762, 70766, 70772, 70777, 
-    70783, 70788, 70792, 70796, 70799, 70802, 70807, 70812, 70817, 70822, 
-    70827, 70832, 70837, 70842, 70847, 70852, 70861, 70870, 70875, 70880, 
-    70885, 70890, 70895, 70900, 70905, 70910, 70915, 70920, 70925, 0, 0, 0, 
-    0, 0, 0, 0, 70930, 70936, 70939, 70942, 70945, 70949, 70953, 70957, 
-    70961, 70964, 70968, 70971, 70975, 70978, 70982, 70986, 70990, 70994, 
-    70998, 71002, 71006, 71009, 71013, 71017, 71021, 71025, 71029, 71033, 
-    71037, 71041, 71045, 71049, 71053, 71057, 71061, 71065, 71068, 71072, 
-    71076, 71080, 71084, 71088, 71092, 71096, 71100, 71104, 71108, 71112, 
-    71116, 71120, 71124, 71128, 71132, 71136, 71140, 71144, 71148, 71152, 
-    71156, 71160, 71164, 71167, 71171, 71175, 71179, 71183, 71187, 71191, 
-    71195, 71198, 71202, 71206, 71210, 71214, 71218, 71222, 71226, 71230, 
-    71234, 71238, 71242, 71246, 71251, 71256, 71259, 71264, 71267, 71270, 
-    71273, 0, 0, 0, 0, 0, 0, 0, 0, 71277, 71286, 71295, 71304, 71313, 71322, 
-    71331, 71340, 71349, 71357, 71364, 71372, 71379, 71387, 71397, 71406, 
-    71416, 71425, 71435, 71443, 71450, 71458, 71465, 71473, 71478, 71483, 
-    71488, 71497, 71503, 71509, 71516, 71525, 71533, 71541, 71549, 71556, 
-    71563, 71570, 71577, 71582, 71587, 71592, 71597, 71602, 71607, 71612, 
-    71617, 71625, 71633, 71639, 71645, 71650, 71655, 71660, 71665, 71670, 
-    71675, 71680, 71685, 71693, 71701, 71706, 71711, 71721, 71731, 71738, 
-    71745, 71754, 71763, 71775, 71787, 71793, 71799, 71807, 71815, 71825, 
-    71835, 71842, 71849, 71854, 71859, 71871, 71883, 71891, 71899, 71909, 
-    71919, 71931, 71943, 71952, 71961, 71968, 71975, 71982, 71989, 71998, 
-    72007, 72012, 72017, 72024, 72031, 72038, 72045, 72057, 72069, 72074, 
-    72079, 72084, 72089, 72094, 72099, 72104, 72109, 72113, 72118, 72123, 
-    72128, 72133, 72138, 72144, 72149, 72154, 72161, 72168, 72175, 72182, 
-    72189, 72198, 72207, 72213, 72219, 72225, 72231, 72238, 72245, 72252, 
-    72259, 72266, 72270, 72277, 72282, 72287, 72294, 0, 72307, 72315, 72323, 
-    72330, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72337, 72346, 72355, 72364, 
-    72373, 72382, 72391, 72400, 72409, 72418, 72427, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 63706, 63715, 63724, 63735, 63742, 63747, 63752, 63759, 63766, 
+    63772, 63777, 63782, 63787, 63792, 63799, 63804, 63809, 63814, 63825, 
+    63830, 63835, 63842, 63847, 63854, 63859, 63864, 63871, 63878, 63885, 
+    63894, 63903, 63908, 63913, 63918, 63925, 63930, 63940, 63947, 63952, 
+    63957, 63962, 63967, 63972, 63977, 63986, 63993, 64000, 64005, 64012, 
+    64017, 64024, 64033, 64044, 64049, 64058, 64063, 64070, 64079, 64088, 
+    64093, 64098, 64105, 64111, 64118, 64125, 64129, 64133, 64136, 64140, 
+    64144, 64148, 64152, 64156, 64160, 64164, 64167, 64171, 64175, 64179, 
+    64183, 64187, 64191, 64194, 64198, 64202, 64205, 64209, 64213, 64217, 
+    64221, 64225, 64229, 64233, 64237, 64241, 64245, 64249, 64253, 64257, 
+    64261, 64265, 64269, 64273, 64277, 64281, 64285, 64289, 64293, 64297, 
+    64301, 64305, 64309, 64313, 64317, 64321, 64325, 64329, 64333, 64337, 
+    64341, 64345, 64349, 64353, 64357, 64361, 64365, 64369, 64373, 64377, 
+    64381, 64384, 64388, 64392, 64396, 64400, 64404, 64408, 64412, 64416, 
+    64420, 64424, 64428, 64432, 64436, 64440, 64444, 64448, 64452, 64456, 
+    64460, 64464, 64468, 64472, 64476, 64480, 64484, 64488, 64492, 64496, 
+    64500, 64504, 64508, 64512, 64516, 64520, 64524, 64528, 64532, 64536, 
+    64540, 64544, 64548, 64552, 64556, 64560, 64564, 64568, 64572, 64576, 
+    64580, 64584, 64588, 64592, 64596, 64600, 64604, 64608, 64612, 64616, 
+    64620, 64624, 64628, 64632, 64636, 64640, 64644, 64648, 64652, 64656, 
+    64660, 64664, 64668, 64672, 64676, 64680, 64684, 64688, 64692, 64696, 
+    64700, 64704, 64708, 64712, 64716, 64720, 64724, 64728, 64732, 64736, 
+    64740, 64744, 64748, 64752, 64756, 64760, 64764, 64768, 64772, 64776, 
+    64780, 64784, 64788, 64792, 64796, 64800, 64804, 64808, 64812, 64816, 
+    64820, 64824, 64828, 64832, 64836, 64840, 64844, 64848, 64852, 64855, 
+    64859, 64863, 64867, 64871, 64875, 64879, 64883, 64887, 64891, 64895, 
+    64899, 64903, 64907, 64911, 64915, 64919, 64923, 64927, 64931, 64935, 
+    64939, 64943, 64947, 64951, 64955, 64959, 64963, 64967, 64971, 64975, 
+    64979, 64983, 64987, 64991, 64995, 64999, 65003, 65007, 65011, 65015, 
+    65019, 65023, 65027, 65031, 65035, 65039, 65043, 65047, 65051, 65055, 
+    65059, 65063, 65067, 65071, 65075, 65079, 65083, 65087, 65091, 65095, 
+    65099, 65103, 65107, 65111, 65115, 65119, 65123, 65127, 65131, 65135, 
+    65139, 65143, 65147, 65151, 65155, 65159, 65163, 65167, 65171, 65175, 
+    65179, 65183, 65187, 65191, 65195, 65199, 65203, 65207, 65211, 65215, 
+    65219, 65223, 65227, 65231, 65235, 65239, 65243, 65247, 65251, 65255, 
+    65259, 65263, 65267, 65271, 65275, 65279, 65283, 65287, 65291, 65295, 
+    65299, 65303, 65307, 65311, 65315, 65318, 65322, 65326, 65330, 65334, 
+    65338, 65342, 65346, 65350, 65354, 65358, 65362, 65366, 65370, 65374, 
+    65378, 65382, 65386, 65390, 65394, 65398, 65402, 65406, 65410, 65414, 
+    65418, 65422, 65426, 65430, 65434, 65438, 65442, 65446, 65450, 65454, 
+    65458, 65462, 65466, 65470, 65474, 65478, 65482, 65486, 65490, 65494, 
+    65498, 65502, 65506, 65510, 65514, 65518, 65522, 65526, 65530, 65534, 
+    65538, 65542, 65546, 65550, 65554, 65558, 65562, 65566, 65570, 65574, 
+    65578, 65582, 65586, 65590, 65594, 65598, 65602, 65606, 65610, 65614, 
+    65618, 65622, 65626, 65630, 65634, 65638, 65642, 65646, 65650, 65654, 
+    65658, 65662, 65666, 65670, 65674, 65677, 65681, 65685, 65689, 65693, 
+    65697, 65701, 65705, 65709, 65713, 65717, 65721, 65725, 65729, 65733, 
+    65737, 65741, 65745, 65749, 65753, 65757, 65761, 65765, 65769, 65773, 
+    65777, 65781, 65785, 65789, 65793, 65797, 65801, 65805, 65809, 65813, 
+    65817, 65821, 65825, 65829, 65833, 65837, 65841, 65845, 65849, 65853, 
+    65857, 65861, 65865, 65869, 65873, 65877, 65881, 65885, 65889, 65893, 
+    65897, 65901, 65905, 65909, 65913, 65917, 65921, 65925, 65929, 65933, 
+    65937, 65941, 65945, 65949, 65953, 65957, 65961, 65965, 65969, 65973, 
+    65977, 65981, 65985, 65989, 65993, 65997, 66001, 66005, 66009, 66013, 
+    66017, 66021, 66025, 66029, 66033, 66037, 66041, 66045, 66049, 66053, 
+    66057, 66061, 66065, 66069, 66073, 66077, 66081, 66085, 66089, 66093, 
+    66097, 66101, 66105, 66109, 66113, 66117, 66121, 66125, 66129, 66133, 
+    66137, 66141, 66145, 66149, 66153, 66157, 66161, 66165, 66169, 66172, 
+    66176, 66180, 66184, 66188, 66192, 66196, 66200, 66204, 66208, 66212, 
+    66216, 66220, 66224, 66228, 66232, 66236, 66240, 66244, 66248, 66252, 
+    66256, 66260, 66264, 66268, 66272, 66276, 66280, 66284, 66288, 66292, 
+    66296, 66300, 66304, 66308, 66312, 66316, 66320, 66324, 66328, 66332, 
+    66336, 66340, 66344, 66348, 66352, 66356, 66360, 66364, 66368, 66372, 
+    66376, 66380, 66384, 66388, 66392, 66396, 66400, 66404, 66408, 66412, 
+    66416, 66420, 66424, 66428, 66432, 66436, 66440, 66444, 66448, 66452, 
+    66456, 66460, 66464, 66468, 66472, 66476, 66480, 66484, 66488, 66492, 
+    66496, 66500, 66504, 66508, 66512, 66516, 66520, 66524, 66528, 66532, 
+    66536, 66540, 66544, 66548, 66552, 66556, 66560, 66564, 66568, 66572, 
+    66576, 66580, 66584, 66588, 66592, 66596, 66600, 66604, 66608, 66612, 
+    66616, 66620, 66624, 66627, 66631, 66635, 66639, 66643, 66647, 66651, 
+    66655, 66659, 66663, 66667, 66671, 66675, 66679, 66683, 66687, 66691, 
+    66695, 66699, 66703, 66707, 66711, 66715, 66719, 66723, 66727, 66731, 
+    66735, 66739, 66743, 66747, 66751, 66755, 66759, 66763, 66767, 66771, 
+    66775, 66779, 66783, 66787, 66791, 66795, 66799, 66803, 66807, 66811, 
+    66815, 66819, 66823, 66827, 66831, 66835, 66839, 66843, 66847, 66851, 
+    66855, 66859, 66863, 66867, 66871, 66875, 66879, 66883, 66887, 66891, 
+    66895, 66899, 66903, 66907, 66911, 66915, 66919, 66923, 66927, 66931, 
+    66935, 66939, 66943, 66947, 66951, 66955, 66959, 66963, 66967, 66971, 
+    66975, 66979, 66983, 66987, 66991, 66995, 66999, 67003, 67007, 67011, 
+    67015, 67019, 67023, 67027, 67031, 67035, 67039, 67043, 67047, 67051, 
+    67055, 67059, 67063, 67067, 67071, 67075, 67079, 67083, 67087, 67091, 
+    67095, 67099, 67103, 67107, 67111, 67115, 67119, 67123, 67127, 67131, 
+    67135, 67139, 67143, 67147, 67151, 67155, 67159, 67163, 67167, 67171, 
+    67175, 67179, 67183, 67187, 67191, 67195, 67199, 67203, 67207, 67211, 
+    67215, 67219, 67223, 67227, 67230, 67234, 67238, 67242, 67246, 67250, 
+    67254, 67258, 67261, 67265, 67269, 67273, 67277, 67281, 67285, 67289, 
+    67293, 67297, 67301, 67305, 67309, 67313, 67317, 67321, 67325, 67329, 
+    67333, 67337, 67341, 67345, 67349, 67353, 67357, 67361, 67365, 67369, 
+    67373, 67377, 67381, 67385, 67389, 67393, 67397, 67401, 67405, 67409, 
+    67413, 67417, 67421, 67425, 67429, 67433, 67437, 67441, 67445, 67449, 
+    67453, 67457, 67461, 67465, 67469, 67473, 67477, 67481, 67485, 67489, 
+    67493, 67497, 67501, 67505, 67509, 67513, 67517, 67521, 67525, 67529, 
+    67533, 67537, 67541, 67545, 67549, 67553, 67557, 67561, 67565, 67569, 
+    67573, 67577, 67581, 67585, 67589, 67593, 67597, 67601, 67605, 67609, 
+    67613, 67617, 67621, 67625, 67629, 67633, 67637, 67641, 67645, 67649, 
+    67653, 67657, 67661, 67665, 67669, 67673, 67677, 67681, 67685, 67689, 
+    67693, 67697, 67701, 67705, 67709, 67713, 67717, 67721, 67725, 67729, 
+    67733, 67737, 67741, 67745, 67749, 67753, 67757, 67761, 67765, 67769, 
+    67773, 67777, 67781, 67785, 67789, 67793, 67797, 67801, 67805, 67809, 
+    67813, 67817, 67821, 67825, 67829, 67833, 67837, 67841, 67845, 67849, 
+    67853, 67857, 67861, 67865, 67869, 67873, 67877, 67881, 67885, 67889, 
+    67893, 67897, 67901, 67905, 67909, 67913, 67917, 67921, 67925, 67929, 
+    67933, 67937, 67941, 67945, 67949, 67953, 67957, 67961, 67965, 67969, 
+    67973, 67977, 67981, 67985, 67988, 67992, 67996, 68000, 68004, 68008, 
+    68012, 68016, 68020, 68024, 68028, 68032, 68036, 68040, 68044, 68048, 
+    68052, 68056, 68060, 68064, 68068, 68072, 68076, 68080, 68084, 68088, 
+    68092, 68096, 68100, 68104, 68108, 68112, 68116, 68120, 68124, 68128, 
+    68132, 68136, 68140, 68144, 68148, 68152, 68156, 68160, 68164, 68168, 
+    68172, 68176, 68180, 68184, 68188, 68192, 68196, 68200, 68204, 68208, 
+    68212, 68216, 68220, 68224, 68228, 68232, 68236, 68240, 68244, 68248, 
+    68252, 68256, 68260, 68264, 68268, 68272, 68276, 68280, 68284, 68288, 
+    68292, 68296, 68300, 68304, 68308, 68312, 68316, 68320, 68324, 68328, 
+    68332, 68336, 68340, 68344, 68348, 68352, 68356, 68360, 68364, 68368, 
+    68372, 68376, 68380, 68384, 68388, 68392, 68396, 68400, 68404, 68408, 
+    68412, 68416, 68420, 68424, 68428, 68432, 68436, 68440, 68444, 68448, 
+    68452, 68456, 68460, 68464, 68468, 68472, 68476, 68480, 68484, 68488, 
+    68492, 68496, 68500, 68504, 68508, 68512, 68516, 68520, 68524, 68528, 
+    68532, 68536, 68540, 68544, 68548, 68552, 68556, 68560, 68564, 68568, 
+    68572, 68576, 68580, 68584, 68588, 68592, 68596, 68600, 68604, 68608, 
+    68612, 68616, 68620, 68624, 68628, 68632, 68636, 68640, 68644, 68648, 
+    68652, 68656, 68660, 68664, 68668, 68672, 68676, 68680, 68684, 68688, 
+    68692, 68696, 68700, 68704, 68708, 68712, 68716, 68720, 68724, 68728, 
+    68732, 68736, 68740, 68744, 68748, 68752, 68756, 68760, 68764, 68768, 0, 
+    0, 0, 68772, 68776, 68780, 68784, 68788, 68792, 68796, 68800, 68804, 
+    68808, 68812, 68816, 68820, 68824, 68828, 68832, 68836, 68840, 68844, 
+    68848, 68852, 68856, 68860, 68864, 68868, 68872, 68876, 68880, 68884, 
+    68888, 68892, 68896, 68900, 68904, 68908, 68912, 68916, 68920, 68924, 
+    68928, 68932, 68936, 68940, 68944, 68948, 68952, 68956, 68960, 68964, 
+    68968, 68972, 68976, 68980, 68984, 68988, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    68992, 68997, 69001, 69006, 69011, 69016, 69021, 69026, 69030, 69035, 
+    69040, 69045, 69050, 69055, 69060, 69065, 69069, 69073, 69078, 69082, 
+    69087, 69092, 69097, 69101, 69106, 69111, 69116, 69121, 69126, 69130, 
+    69135, 69139, 69144, 69148, 69153, 69157, 69161, 69165, 69170, 69175, 
+    69180, 69188, 69196, 69204, 69212, 69219, 69227, 69233, 69241, 69245, 
+    69249, 69253, 69257, 69261, 69265, 69269, 69273, 69277, 69281, 69285, 
+    69289, 69293, 69297, 69301, 69305, 69309, 69313, 69317, 69321, 69325, 
+    69329, 69333, 69337, 69341, 69345, 69349, 69353, 69357, 69361, 69365, 
+    69369, 69373, 69377, 69381, 69385, 69388, 69392, 69396, 69400, 69404, 
+    69408, 69412, 69416, 69420, 69424, 69428, 69432, 69436, 69440, 69444, 
+    69448, 69452, 69456, 69460, 69464, 69468, 69472, 69476, 69480, 69484, 
+    69488, 69492, 69496, 69500, 69504, 69508, 69512, 69516, 69520, 69524, 
+    69528, 69532, 69535, 69539, 69543, 69546, 69550, 69554, 69558, 69561, 
+    69565, 69569, 69573, 69577, 69581, 69585, 69589, 69593, 69597, 69601, 
+    69605, 69609, 69613, 69617, 69620, 69624, 69628, 69631, 69635, 69639, 
+    69643, 69647, 69651, 69655, 69658, 69661, 69665, 69669, 69673, 69676, 
+    69679, 69683, 69687, 69691, 69695, 69699, 69703, 69707, 69711, 69715, 
+    69719, 69723, 69727, 69731, 69735, 69739, 69743, 69747, 69751, 69755, 
+    69759, 69763, 69767, 69771, 69775, 69779, 69783, 69787, 69791, 69795, 
+    69799, 69803, 69807, 69811, 69815, 69819, 69823, 69827, 69830, 69834, 
+    69838, 69842, 69846, 69850, 69854, 69858, 69862, 69866, 69870, 69874, 
+    69878, 69882, 69886, 69890, 69894, 69898, 69902, 69906, 69910, 69914, 
+    69918, 69922, 69926, 69930, 69934, 69938, 69942, 69946, 69950, 69954, 
+    69958, 69962, 69966, 69970, 69974, 69977, 69981, 69985, 69989, 69993, 
+    69997, 70001, 70005, 70009, 70013, 70017, 70021, 70025, 70029, 70033, 
+    70037, 70041, 70044, 70048, 70052, 70056, 70060, 70064, 70068, 70072, 
+    70076, 70080, 70084, 70088, 70092, 70096, 70100, 70104, 70108, 70112, 
+    70116, 70120, 70124, 70128, 70131, 70135, 70139, 70143, 70147, 70151, 
+    70155, 70159, 70163, 70167, 70171, 70175, 70179, 70183, 70187, 70191, 
+    70195, 70199, 70203, 70207, 70211, 70215, 70219, 70223, 70227, 70231, 
+    70235, 70239, 70243, 70247, 70251, 70255, 70259, 70263, 70267, 70271, 
+    70275, 70279, 70283, 70287, 70291, 70295, 70299, 70303, 70306, 70311, 
+    70315, 70321, 70326, 70332, 70336, 70340, 70344, 70348, 70352, 70356, 
+    70360, 70364, 70368, 70372, 70376, 70380, 70384, 70388, 70391, 70394, 
+    70397, 70400, 70403, 70406, 70409, 70412, 70415, 70420, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70426, 70431, 70436, 70441, 
+    70446, 70453, 70460, 70465, 70470, 70475, 70480, 70487, 70494, 70501, 
+    70508, 70515, 70522, 70532, 70542, 70549, 70556, 70563, 70570, 70576, 
+    70582, 70591, 70600, 70607, 70614, 70625, 70636, 70641, 70646, 70653, 
+    70660, 70667, 70674, 70681, 70688, 70695, 70702, 70708, 70714, 70720, 
+    70726, 70733, 70740, 70745, 70749, 70756, 70763, 70770, 70774, 70781, 
+    70785, 70790, 70794, 70800, 70805, 70811, 70816, 70820, 70824, 70827, 
+    70830, 70835, 70840, 70845, 70850, 70855, 70860, 70865, 70870, 70875, 
+    70880, 70889, 70898, 70903, 70908, 70913, 70918, 70923, 70928, 70933, 
+    70938, 70943, 70948, 70953, 0, 0, 0, 0, 0, 0, 0, 70958, 70964, 70967, 
+    70970, 70973, 70977, 70981, 70985, 70989, 70992, 70996, 70999, 71003, 
+    71006, 71010, 71014, 71018, 71022, 71026, 71030, 71034, 71037, 71041, 
+    71045, 71049, 71053, 71057, 71061, 71065, 71069, 71073, 71077, 71081, 
+    71085, 71089, 71093, 71096, 71100, 71104, 71108, 71112, 71116, 71120, 
+    71124, 71128, 71132, 71136, 71140, 71144, 71148, 71152, 71156, 71160, 
+    71164, 71168, 71172, 71176, 71180, 71184, 71188, 71192, 71195, 71199, 
+    71203, 71207, 71211, 71215, 71219, 71223, 71226, 71230, 71234, 71238, 
+    71242, 71246, 71250, 71254, 71258, 71262, 71266, 71270, 71274, 71279, 
+    71284, 71287, 71292, 71295, 71298, 71301, 0, 0, 0, 0, 0, 0, 0, 0, 71305, 
+    71314, 71323, 71332, 71341, 71350, 71359, 71368, 71377, 71385, 71392, 
+    71400, 71407, 71415, 71425, 71434, 71444, 71453, 71463, 71471, 71478, 
+    71486, 71493, 71501, 71506, 71511, 71516, 71525, 71531, 71537, 71544, 
+    71553, 71561, 71569, 71577, 71584, 71591, 71598, 71605, 71610, 71615, 
+    71620, 71625, 71630, 71635, 71640, 71645, 71653, 71661, 71667, 71673, 
+    71678, 71683, 71688, 71693, 71698, 71703, 71708, 71713, 71721, 71729, 
+    71734, 71739, 71749, 71759, 71766, 71773, 71782, 71791, 71803, 71815, 
+    71821, 71827, 71835, 71843, 71853, 71863, 71870, 71877, 71882, 71887, 
+    71899, 71911, 71919, 71927, 71937, 71947, 71959, 71971, 71980, 71989, 
+    71996, 72003, 72010, 72017, 72026, 72035, 72040, 72045, 72052, 72059, 
+    72066, 72073, 72085, 72097, 72102, 72107, 72112, 72117, 72122, 72127, 
+    72132, 72137, 72141, 72146, 72151, 72156, 72161, 72166, 72172, 72177, 
+    72182, 72189, 72196, 72203, 72210, 72217, 72226, 72235, 72241, 72247, 
+    72253, 72259, 72266, 72273, 72280, 72287, 72294, 72298, 72305, 72310, 
+    72315, 72322, 0, 72335, 72343, 72351, 72358, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 72365, 72374, 72383, 72392, 72401, 72410, 72419, 72428, 72437, 
+    72446, 72455, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72434, 
-    72441, 72447, 72454, 72462, 72470, 72477, 72485, 72492, 72498, 72504, 
-    72511, 72517, 72523, 72529, 72536, 72543, 72550, 72557, 72564, 72571, 
-    72578, 72585, 72592, 72599, 72606, 72613, 72620, 72627, 72633, 72640, 
-    72647, 72654, 72661, 72668, 72675, 72682, 72689, 72696, 72703, 72710, 
-    72717, 72724, 72731, 72738, 72745, 72752, 72759, 72767, 72775, 72783, 
-    72791, 0, 0, 0, 0, 72799, 72808, 72817, 72826, 72835, 72844, 72853, 
-    72860, 72867, 72874, 0, 0, 0, 0, 0, 0, 72881, 72885, 72890, 72895, 72900, 
-    72905, 72910, 72915, 72920, 72925, 72930, 72935, 72939, 72943, 72948, 
-    72953, 72957, 72962, 72967, 72972, 72977, 72982, 72987, 72992, 72996, 
-    73000, 73005, 73010, 73014, 73018, 73022, 73026, 73030, 73034, 73038, 
-    73043, 73048, 73053, 73058, 73063, 73070, 73076, 73081, 73086, 73091, 
-    73096, 73102, 73109, 73115, 73122, 73128, 73134, 73139, 73146, 73152, 
-    73157, 0, 0, 0, 0, 0, 0, 0, 0, 73163, 73167, 73171, 73174, 73178, 73181, 
-    73185, 73188, 73192, 73196, 73201, 73205, 73210, 73213, 73217, 73221, 
-    73224, 73228, 73232, 73235, 73239, 73243, 73247, 73251, 73255, 73259, 
-    73263, 73267, 73271, 73275, 73279, 73283, 73287, 73291, 73295, 73299, 
-    73303, 73307, 73310, 73313, 73317, 73321, 73325, 73328, 73331, 73334, 
-    73338, 73342, 73346, 73350, 73353, 73356, 73360, 73365, 73370, 73374, 
-    73379, 73383, 73388, 73393, 73399, 73404, 73410, 73414, 73419, 73424, 
-    73428, 73433, 73438, 0, 0, 0, 0, 0, 0, 0, 0, 0, 73442, 73445, 73449, 
-    73453, 73456, 73459, 73462, 73465, 73468, 73471, 73474, 73477, 0, 0, 0, 
-    0, 0, 0, 73480, 73485, 73489, 73493, 73497, 73501, 73505, 73509, 73513, 
-    73517, 73521, 73525, 73529, 73533, 73537, 73541, 73545, 73550, 73555, 
-    73561, 73567, 73574, 73579, 73584, 73590, 73594, 73599, 73602, 0, 0, 0, 
-    0, 73605, 73612, 73618, 73624, 73630, 73636, 73642, 73648, 73654, 73660, 
-    73666, 73672, 73679, 73686, 73693, 73699, 73706, 73713, 73720, 73727, 
-    73734, 73740, 73746, 73753, 73759, 73766, 73773, 73779, 73785, 73792, 
-    73799, 73806, 73812, 73819, 73826, 73832, 73839, 73845, 73852, 73859, 
-    73865, 73871, 73878, 73884, 73891, 73898, 73907, 73914, 73921, 73925, 
-    73930, 73935, 73940, 73945, 73949, 73953, 73958, 73962, 73967, 73972, 
-    73977, 73981, 73985, 73990, 73994, 73999, 74003, 74008, 74013, 74018, 
-    74023, 74027, 74032, 74037, 74042, 74048, 74053, 74059, 74065, 74071, 
-    74077, 74083, 74088, 74094, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 74098, 
-    74103, 74107, 74111, 74115, 74119, 74123, 74127, 74131, 74135, 74139, 
-    74143, 74147, 74151, 74155, 74159, 74163, 74167, 74171, 74175, 74179, 
-    74183, 74187, 74191, 74195, 74199, 74203, 74207, 74211, 74215, 0, 0, 0, 
-    74219, 74223, 74227, 74231, 74235, 74238, 74244, 74247, 74251, 74254, 
-    74260, 74266, 74274, 74277, 74281, 74284, 74287, 74293, 74299, 74303, 
-    74309, 74313, 74317, 74323, 74327, 74333, 74339, 74343, 74347, 74353, 
-    74357, 74363, 74369, 74373, 74379, 74383, 74389, 74392, 74395, 74401, 
-    74405, 74411, 74414, 74417, 74420, 74426, 74430, 74434, 74440, 74446, 
-    74449, 74452, 74458, 74463, 74468, 74473, 74480, 74485, 74492, 74497, 
-    74504, 74509, 74514, 74519, 74524, 74527, 74531, 74535, 74540, 74545, 
-    74550, 74555, 74560, 74565, 74570, 74575, 74582, 74587, 0, 74594, 74597, 
-    74601, 74604, 74607, 74610, 74613, 74616, 74619, 74622, 74625, 0, 0, 0, 
-    0, 74628, 74635, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 74640, 74643, 74646, 74649, 74652, 
-    74656, 74659, 74662, 74666, 74670, 74674, 74678, 74682, 74686, 74690, 
-    74694, 74698, 74702, 74706, 74710, 74714, 74718, 74722, 74726, 74730, 
-    74733, 74737, 74740, 74744, 74748, 74752, 74756, 74760, 74763, 74767, 
-    74770, 74773, 74777, 74781, 74785, 74788, 74791, 74796, 74800, 74805, 
-    74810, 74814, 74819, 74823, 74828, 74833, 74838, 74842, 74846, 74851, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 74856, 74861, 74866, 74871, 74877, 74882, 74887, 
-    74892, 74897, 74902, 74906, 74910, 74915, 74920, 0, 0, 74926, 74930, 
-    74933, 74936, 74939, 74942, 74945, 74948, 74951, 74954, 0, 0, 74957, 
-    74962, 74967, 74973, 74980, 74986, 74992, 74998, 75004, 75010, 75016, 
-    75022, 75028, 75034, 75040, 75046, 75051, 75056, 75061, 75067, 75073, 
-    75080, 75086, 75092, 75097, 75104, 75111, 75118, 75124, 75129, 75134, 
-    75139, 0, 0, 0, 0, 75147, 75153, 75159, 75165, 75171, 75177, 75183, 
-    75189, 75195, 75201, 75207, 75213, 75219, 75225, 75231, 75237, 75243, 
-    75249, 75255, 75261, 75267, 75272, 75277, 75283, 75289, 75295, 75301, 
-    75307, 75313, 75319, 75325, 75331, 75337, 75343, 75349, 75355, 75361, 
-    75367, 75373, 75379, 75385, 75391, 75397, 75403, 75409, 75415, 75421, 
-    75426, 75431, 75437, 75442, 75446, 75451, 75455, 75459, 75463, 75469, 
-    75474, 75479, 75484, 75489, 75494, 75499, 75504, 75511, 75518, 75525, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 72462, 72469, 72475, 72482, 72490, 72498, 
+    72505, 72513, 72520, 72526, 72532, 72539, 72545, 72551, 72557, 72564, 
+    72571, 72578, 72585, 72592, 72599, 72606, 72613, 72620, 72627, 72634, 
+    72641, 72648, 72655, 72661, 72668, 72675, 72682, 72689, 72696, 72703, 
+    72710, 72717, 72724, 72731, 72738, 72745, 72752, 72759, 72766, 72773, 
+    72780, 72787, 72795, 72803, 72811, 72819, 0, 0, 0, 0, 72827, 72836, 
+    72845, 72854, 72863, 72872, 72881, 72888, 72895, 72902, 0, 0, 0, 0, 0, 0, 
+    72909, 72913, 72918, 72923, 72928, 72933, 72938, 72943, 72948, 72953, 
+    72958, 72963, 72967, 72971, 72976, 72981, 72985, 72990, 72995, 73000, 
+    73005, 73010, 73015, 73020, 73024, 73028, 73033, 73038, 73042, 73046, 
+    73050, 73054, 73058, 73062, 73066, 73071, 73076, 73081, 73086, 73091, 
+    73098, 73104, 73109, 73114, 73119, 73124, 73130, 73137, 73143, 73150, 
+    73156, 73162, 73167, 73174, 73180, 73185, 0, 0, 0, 0, 0, 0, 0, 0, 73191, 
+    73195, 73199, 73202, 73206, 73209, 73213, 73216, 73220, 73224, 73229, 
+    73233, 73238, 73241, 73245, 73249, 73252, 73256, 73260, 73263, 73267, 
+    73271, 73275, 73279, 73283, 73287, 73291, 73295, 73299, 73303, 73307, 
+    73311, 73315, 73319, 73323, 73327, 73331, 73335, 73338, 73341, 73345, 
+    73349, 73353, 73356, 73359, 73362, 73366, 73370, 73374, 73378, 73381, 
+    73384, 73388, 73393, 73398, 73402, 73407, 73411, 73416, 73421, 73427, 
+    73432, 73438, 73442, 73447, 73452, 73456, 73461, 73466, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 73470, 73473, 73477, 73481, 73484, 73487, 73490, 73493, 73496, 
+    73499, 73502, 73505, 0, 0, 0, 0, 0, 0, 73508, 73513, 73517, 73521, 73525, 
+    73529, 73533, 73537, 73541, 73545, 73549, 73553, 73557, 73561, 73565, 
+    73569, 73573, 73578, 73583, 73589, 73595, 73602, 73607, 73612, 73618, 
+    73622, 73627, 73630, 0, 0, 0, 0, 73633, 73640, 73646, 73652, 73658, 
+    73664, 73670, 73676, 73682, 73688, 73694, 73700, 73707, 73714, 73721, 
+    73727, 73734, 73741, 73748, 73755, 73762, 73768, 73774, 73781, 73787, 
+    73794, 73801, 73807, 73813, 73820, 73827, 73834, 73840, 73847, 73854, 
+    73860, 73867, 73873, 73880, 73887, 73893, 73899, 73906, 73912, 73919, 
+    73926, 73935, 73942, 73949, 73953, 73958, 73963, 73968, 73973, 73977, 
+    73981, 73986, 73990, 73995, 74000, 74005, 74009, 74013, 74018, 74022, 
+    74027, 74031, 74036, 74041, 74046, 74051, 74055, 74060, 74065, 74070, 
+    74076, 74081, 74087, 74093, 74099, 74105, 74111, 74116, 74122, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 74126, 74131, 74135, 74139, 74143, 74147, 74151, 
+    74155, 74159, 74163, 74167, 74171, 74175, 74179, 74183, 74187, 74191, 
+    74195, 74199, 74203, 74207, 74211, 74215, 74219, 74223, 74227, 74231, 
+    74235, 74239, 74243, 0, 0, 0, 74247, 74251, 74255, 74259, 74263, 74266, 
+    74272, 74275, 74279, 74282, 74288, 74294, 74302, 74305, 74309, 74312, 
+    74315, 74321, 74327, 74331, 74337, 74341, 74345, 74351, 74355, 74361, 
+    74367, 74371, 74375, 74381, 74385, 74391, 74397, 74401, 74407, 74411, 
+    74417, 74420, 74423, 74429, 74433, 74439, 74442, 74445, 74448, 74454, 
+    74458, 74462, 74468, 74474, 74477, 74480, 74486, 74491, 74496, 74501, 
+    74508, 74513, 74520, 74525, 74532, 74537, 74542, 74547, 74552, 74555, 
+    74559, 74563, 74568, 74573, 74578, 74583, 74588, 74593, 74598, 74603, 
+    74610, 74615, 0, 74622, 74625, 74629, 74632, 74635, 74638, 74641, 74644, 
+    74647, 74650, 74653, 0, 0, 0, 0, 74656, 74663, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    75532, 75537, 75542, 75547, 75554, 75561, 75565, 75569, 75574, 75579, 
-    75584, 75589, 75594, 75599, 75604, 75609, 75614, 75620, 75626, 75632, 
-    75638, 75644, 75648, 75654, 75658, 75664, 75671, 75677, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 75681, 75685, 75689, 75693, 75697, 75701, 0, 0, 75705, 75709, 
-    75713, 75717, 75721, 75725, 0, 0, 75729, 75733, 75737, 75741, 75745, 
-    75749, 0, 0, 0, 0, 0, 0, 0, 0, 0, 75753, 75757, 75761, 75765, 75769, 
-    75773, 75777, 0, 75781, 75785, 75789, 75793, 75797, 75801, 75805, 0, 0, 
+    74668, 74671, 74674, 74677, 74680, 74684, 74687, 74690, 74694, 74698, 
+    74702, 74706, 74710, 74714, 74718, 74722, 74726, 74730, 74734, 74738, 
+    74742, 74746, 74750, 74754, 74758, 74761, 74765, 74768, 74772, 74776, 
+    74780, 74784, 74788, 74791, 74795, 74798, 74801, 74805, 74809, 74813, 
+    74816, 74819, 74824, 74828, 74833, 74838, 74842, 74847, 74851, 74856, 
+    74861, 74866, 74870, 74874, 74879, 0, 0, 0, 0, 0, 0, 0, 0, 0, 74884, 
+    74889, 74894, 74899, 74905, 74910, 74915, 74920, 74925, 74930, 74934, 
+    74938, 74943, 74948, 0, 0, 74954, 74958, 74961, 74964, 74967, 74970, 
+    74973, 74976, 74979, 74982, 0, 0, 74985, 74990, 74995, 75001, 75008, 
+    75014, 75020, 75026, 75032, 75038, 75044, 75050, 75056, 75062, 75068, 
+    75074, 75079, 75084, 75089, 75095, 75101, 75108, 75114, 75120, 75125, 
+    75132, 75139, 75146, 75152, 75157, 75162, 75167, 0, 0, 0, 0, 75175, 
+    75181, 75187, 75193, 75199, 75205, 75211, 75217, 75223, 75229, 75235, 
+    75241, 75247, 75253, 75259, 75265, 75271, 75277, 75283, 75289, 75295, 
+    75300, 75305, 75311, 75317, 75323, 75329, 75335, 75341, 75347, 75353, 
+    75359, 75365, 75371, 75377, 75383, 75389, 75395, 75401, 75407, 75413, 
+    75419, 75425, 75431, 75437, 75443, 75449, 75454, 75459, 75465, 75470, 
+    75474, 75479, 75483, 75487, 75491, 75497, 75502, 75507, 75512, 75517, 
+    75522, 75527, 75532, 75539, 75546, 75553, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 75560, 75565, 75570, 75575, 
+    75582, 75589, 75593, 75597, 75602, 75607, 75612, 75617, 75622, 75627, 
+    75632, 75637, 75642, 75648, 75654, 75660, 75666, 75672, 75676, 75682, 
+    75686, 75692, 75699, 75705, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 75709, 75713, 
+    75717, 75721, 75725, 75729, 0, 0, 75733, 75737, 75741, 75745, 75749, 
+    75753, 0, 0, 75757, 75761, 75765, 75769, 75773, 75777, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 75781, 75785, 75789, 75793, 75797, 75801, 75805, 0, 75809, 
+    75813, 75817, 75821, 75825, 75829, 75833, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    75809, 75814, 75819, 75824, 75829, 75833, 75837, 75842, 75847, 75852, 
-    75857, 75862, 75867, 75872, 75877, 75882, 75886, 75891, 75896, 75901, 
-    75906, 75911, 75916, 75921, 75926, 75931, 75936, 75941, 75948, 75955, 
-    75962, 75969, 75976, 75983, 75990, 75997, 76003, 76009, 76015, 76021, 
-    76027, 76033, 76039, 76045, 76049, 76055, 0, 0, 76061, 76066, 76070, 
-    76074, 76078, 76082, 76086, 76090, 76094, 76098, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 75837, 75842, 75847, 75852, 
+    75857, 75861, 75865, 75870, 75875, 75880, 75885, 75890, 75895, 75900, 
+    75905, 75910, 75914, 75919, 75924, 75929, 75934, 75939, 75944, 75949, 
+    75954, 75959, 75964, 75969, 75976, 75983, 75990, 75997, 76004, 76011, 
+    76018, 76025, 76031, 76037, 76043, 76049, 76055, 76061, 76067, 76073, 
+    76077, 76083, 0, 0, 76089, 76094, 76098, 76102, 76106, 76110, 76114, 
+    76118, 76122, 76126, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76102, 
-    76106, 76110, 76114, 76118, 76122, 76126, 76130, 76134, 76138, 76142, 
-    76146, 76150, 76154, 76158, 76162, 76166, 76170, 76174, 76178, 76182, 
-    76186, 76190, 0, 0, 0, 0, 76194, 76198, 76202, 76206, 76210, 76214, 
-    76218, 76222, 76226, 76230, 76234, 76238, 76242, 76246, 76250, 76254, 
-    76258, 76262, 76266, 76270, 76274, 76278, 76282, 76286, 76290, 76294, 
-    76298, 76302, 76306, 76310, 76314, 76318, 76322, 76326, 76330, 76334, 
-    76338, 76342, 76346, 76350, 76354, 76358, 76362, 76366, 76370, 76374, 
-    76378, 76382, 76386, 0, 0, 0, 0, 76390, 76394, 76398, 76402, 76406, 
-    76410, 76414, 76418, 76422, 76426, 76430, 76434, 76438, 76442, 76446, 
-    76450, 76454, 76458, 76462, 76466, 76470, 76474, 76478, 76482, 76486, 
-    76490, 76494, 76498, 76502, 76506, 76510, 76514, 76518, 76522, 76526, 
-    76530, 76534, 76538, 76542, 76546, 76550, 76554, 76558, 76562, 76566, 
-    76570, 76574, 76578, 76582, 76586, 76590, 76594, 76598, 76602, 76606, 
-    76610, 76614, 76618, 76622, 76626, 76630, 76634, 76638, 76642, 76646, 
-    76650, 76654, 76658, 76662, 76666, 76670, 76674, 76678, 76682, 76686, 
-    76690, 76694, 76698, 76702, 76706, 76710, 76714, 76718, 76722, 76726, 
-    76730, 76734, 76738, 76742, 76746, 76750, 76754, 76758, 76762, 76766, 
-    76770, 76774, 76778, 76782, 76786, 76790, 76794, 76798, 76802, 76806, 
-    76810, 76814, 76818, 76822, 76826, 76830, 76834, 76838, 76842, 76846, 
-    76850, 76854, 76858, 76862, 76866, 76870, 76874, 76878, 76882, 76886, 
-    76890, 76894, 76898, 76902, 76906, 76910, 76914, 76918, 76922, 76926, 
-    76930, 76934, 76938, 76942, 76946, 76950, 76954, 76958, 76962, 76966, 
-    76970, 76974, 76978, 76982, 76986, 76990, 76994, 76998, 77002, 77006, 
-    77010, 77014, 77018, 77022, 77026, 77030, 77034, 77038, 77042, 77046, 
-    77050, 77054, 77058, 77062, 77066, 77070, 77074, 77078, 77082, 77086, 
-    77090, 77094, 77098, 77102, 77106, 77110, 77114, 77118, 77122, 77126, 
-    77130, 77134, 77138, 77142, 77146, 77150, 77154, 77158, 77162, 77166, 
-    77170, 77174, 77178, 77182, 77186, 77190, 77194, 77198, 77202, 77206, 
-    77210, 77214, 77218, 77222, 77226, 77230, 77234, 77238, 77242, 77246, 
-    77250, 77254, 77258, 77262, 77266, 77270, 77274, 77278, 77282, 77286, 
-    77290, 77294, 77298, 77302, 77306, 77310, 77314, 77318, 77322, 77326, 
-    77330, 77334, 77338, 77342, 77346, 77350, 77354, 77358, 77362, 77366, 
-    77370, 77374, 77378, 77382, 77386, 77390, 77394, 77398, 77402, 77406, 
-    77410, 77414, 77418, 77422, 77426, 77430, 77434, 77438, 77442, 77446, 
-    77450, 77454, 77458, 77462, 77466, 77470, 77474, 77478, 77482, 77486, 
-    77490, 77494, 77498, 77502, 77506, 77510, 77514, 77518, 77522, 77526, 
-    77530, 77534, 77538, 77542, 77546, 77550, 77554, 77558, 77562, 77566, 
-    77570, 77574, 77578, 77582, 77586, 77590, 77594, 77598, 77602, 77606, 
-    77610, 77614, 77618, 77622, 77626, 77630, 77634, 77638, 77642, 77646, 
-    77650, 77654, 77658, 77662, 77666, 77670, 77674, 77678, 77682, 77686, 
-    77690, 77694, 77698, 77702, 77706, 77710, 77714, 77718, 77722, 77726, 
-    77730, 77734, 77738, 77742, 77746, 77750, 77754, 77758, 77762, 77766, 
-    77770, 77774, 77778, 77782, 77786, 77790, 77794, 77798, 77802, 77806, 
-    77810, 77814, 77818, 77822, 77826, 77830, 77834, 77838, 77842, 77846, 
-    77850, 0, 0, 77854, 77858, 77862, 77866, 77870, 77874, 77878, 77882, 
-    77886, 77890, 77894, 77898, 77902, 77906, 77910, 77914, 77918, 77922, 
-    77926, 77930, 77934, 77938, 77942, 77946, 77950, 77954, 77958, 77962, 
-    77966, 77970, 77974, 77978, 77982, 77986, 77990, 77994, 77998, 78002, 
-    78006, 78010, 78014, 78018, 78022, 78026, 78030, 78034, 78038, 78042, 
-    78046, 78050, 78054, 78058, 78062, 78066, 78070, 78074, 78078, 78082, 
-    78086, 78090, 78094, 78098, 78102, 78106, 78110, 78114, 78118, 78122, 
-    78126, 78130, 78134, 78138, 78142, 78146, 78150, 78154, 78158, 78162, 
-    78166, 78170, 78174, 78178, 78182, 78186, 78190, 78194, 78198, 78202, 
-    78206, 78210, 78214, 78218, 78222, 78226, 78230, 78234, 78238, 78242, 
-    78246, 78250, 78254, 78258, 78262, 78266, 78270, 78274, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76130, 76134, 76138, 76142, 76146, 
+    76150, 76154, 76158, 76162, 76166, 76170, 76174, 76178, 76182, 76186, 
+    76190, 76194, 76198, 76202, 76206, 76210, 76214, 76218, 0, 0, 0, 0, 
+    76222, 76226, 76230, 76234, 76238, 76242, 76246, 76250, 76254, 76258, 
+    76262, 76266, 76270, 76274, 76278, 76282, 76286, 76290, 76294, 76298, 
+    76302, 76306, 76310, 76314, 76318, 76322, 76326, 76330, 76334, 76338, 
+    76342, 76346, 76350, 76354, 76358, 76362, 76366, 76370, 76374, 76378, 
+    76382, 76386, 76390, 76394, 76398, 76402, 76406, 76410, 76414, 0, 0, 0, 
+    0, 76418, 76422, 76426, 76430, 76434, 76438, 76442, 76446, 76450, 76454, 
+    76458, 76462, 76466, 76470, 76474, 76478, 76482, 76486, 76490, 76494, 
+    76498, 76502, 76506, 76510, 76514, 76518, 76522, 76526, 76530, 76534, 
+    76538, 76542, 76546, 76550, 76554, 76558, 76562, 76566, 76570, 76574, 
+    76578, 76582, 76586, 76590, 76594, 76598, 76602, 76606, 76610, 76614, 
+    76618, 76622, 76626, 76630, 76634, 76638, 76642, 76646, 76650, 76654, 
+    76658, 76662, 76666, 76670, 76674, 76678, 76682, 76686, 76690, 76694, 
+    76698, 76702, 76706, 76710, 76714, 76718, 76722, 76726, 76730, 76734, 
+    76738, 76742, 76746, 76750, 76754, 76758, 76762, 76766, 76770, 76774, 
+    76778, 76782, 76786, 76790, 76794, 76798, 76802, 76806, 76810, 76814, 
+    76818, 76822, 76826, 76830, 76834, 76838, 76842, 76846, 76850, 76854, 
+    76858, 76862, 76866, 76870, 76874, 76878, 76882, 76886, 76890, 76894, 
+    76898, 76902, 76906, 76910, 76914, 76918, 76922, 76926, 76930, 76934, 
+    76938, 76942, 76946, 76950, 76954, 76958, 76962, 76966, 76970, 76974, 
+    76978, 76982, 76986, 76990, 76994, 76998, 77002, 77006, 77010, 77014, 
+    77018, 77022, 77026, 77030, 77034, 77038, 77042, 77046, 77050, 77054, 
+    77058, 77062, 77066, 77070, 77074, 77078, 77082, 77086, 77090, 77094, 
+    77098, 77102, 77106, 77110, 77114, 77118, 77122, 77126, 77130, 77134, 
+    77138, 77142, 77146, 77150, 77154, 77158, 77162, 77166, 77170, 77174, 
+    77178, 77182, 77186, 77190, 77194, 77198, 77202, 77206, 77210, 77214, 
+    77218, 77222, 77226, 77230, 77234, 77238, 77242, 77246, 77250, 77254, 
+    77258, 77262, 77266, 77270, 77274, 77278, 77282, 77286, 77290, 77294, 
+    77298, 77302, 77306, 77310, 77314, 77318, 77322, 77326, 77330, 77334, 
+    77338, 77342, 77346, 77350, 77354, 77358, 77362, 77366, 77370, 77374, 
+    77378, 77382, 77386, 77390, 77394, 77398, 77402, 77406, 77410, 77414, 
+    77418, 77422, 77426, 77430, 77434, 77438, 77442, 77446, 77450, 77454, 
+    77458, 77462, 77466, 77470, 77474, 77478, 77482, 77486, 77490, 77494, 
+    77498, 77502, 77506, 77510, 77514, 77518, 77522, 77526, 77530, 77534, 
+    77538, 77542, 77546, 77550, 77554, 77558, 77562, 77566, 77570, 77574, 
+    77578, 77582, 77586, 77590, 77594, 77598, 77602, 77606, 77610, 77614, 
+    77618, 77622, 77626, 77630, 77634, 77638, 77642, 77646, 77650, 77654, 
+    77658, 77662, 77666, 77670, 77674, 77678, 77682, 77686, 77690, 77694, 
+    77698, 77702, 77706, 77710, 77714, 77718, 77722, 77726, 77730, 77734, 
+    77738, 77742, 77746, 77750, 77754, 77758, 77762, 77766, 77770, 77774, 
+    77778, 77782, 77786, 77790, 77794, 77798, 77802, 77806, 77810, 77814, 
+    77818, 77822, 77826, 77830, 77834, 77838, 77842, 77846, 77850, 77854, 
+    77858, 77862, 77866, 77870, 77874, 77878, 0, 0, 77882, 77886, 77890, 
+    77894, 77898, 77902, 77906, 77910, 77914, 77918, 77922, 77926, 77930, 
+    77934, 77938, 77942, 77946, 77950, 77954, 77958, 77962, 77966, 77970, 
+    77974, 77978, 77982, 77986, 77990, 77994, 77998, 78002, 78006, 78010, 
+    78014, 78018, 78022, 78026, 78030, 78034, 78038, 78042, 78046, 78050, 
+    78054, 78058, 78062, 78066, 78070, 78074, 78078, 78082, 78086, 78090, 
+    78094, 78098, 78102, 78106, 78110, 78114, 78118, 78122, 78126, 78130, 
+    78134, 78138, 78142, 78146, 78150, 78154, 78158, 78162, 78166, 78170, 
+    78174, 78178, 78182, 78186, 78190, 78194, 78198, 78202, 78206, 78210, 
+    78214, 78218, 78222, 78226, 78230, 78234, 78238, 78242, 78246, 78250, 
+    78254, 78258, 78262, 78266, 78270, 78274, 78278, 78282, 78286, 78290, 
+    78294, 78298, 78302, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 78306, 
+    78311, 78316, 78321, 78326, 78331, 78339, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 78344, 78351, 78358, 78365, 78372, 0, 0, 0, 0, 0, 78379, 78386, 
+    78393, 78403, 78409, 78415, 78421, 78427, 78433, 78439, 78446, 78452, 
+    78458, 78464, 78473, 78482, 78494, 78506, 78512, 78518, 78524, 78531, 
+    78538, 78545, 78552, 78559, 0, 78566, 78573, 78580, 78588, 78595, 0, 
+    78602, 0, 78609, 78616, 0, 78623, 78631, 0, 78638, 78645, 78652, 78659, 
+    78666, 78673, 78680, 78687, 78694, 78701, 78706, 78713, 78720, 78726, 
+    78732, 78738, 78744, 78750, 78756, 78762, 78768, 78774, 78780, 78786, 
+    78792, 78798, 78804, 78810, 78816, 78822, 78828, 78834, 78840, 78846, 
+    78852, 78858, 78864, 78870, 78876, 78882, 78888, 78894, 78900, 78906, 
+    78912, 78918, 78924, 78930, 78936, 78942, 78948, 78954, 78960, 78966, 
+    78972, 78978, 78984, 78990, 78996, 79002, 79008, 79014, 79020, 79026, 
+    79032, 79038, 79044, 79050, 79056, 79062, 79068, 79074, 79080, 79086, 
+    79092, 79098, 79104, 79110, 79116, 79122, 79128, 79134, 79140, 79146, 
+    79152, 79158, 79164, 79170, 79176, 79184, 79192, 79198, 79204, 79210, 
+    79216, 79225, 79234, 79242, 79250, 79258, 79266, 79274, 79282, 79290, 
+    79298, 79305, 79312, 79322, 79332, 79336, 79340, 79345, 79350, 79355, 
+    79360, 79369, 79378, 79384, 79390, 79397, 79404, 79411, 79415, 79421, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79427, 79433, 79439, 
+    79445, 79451, 79456, 79461, 79467, 79473, 79479, 79485, 79493, 79499, 
+    79505, 79513, 79521, 79529, 79537, 79542, 79547, 79552, 79557, 79570, 
+    79583, 79593, 79603, 79614, 79625, 79636, 79647, 79657, 79667, 79678, 
+    79689, 79700, 79711, 79721, 79731, 79741, 79757, 79773, 79789, 79796, 
+    79803, 79810, 79817, 79827, 79837, 79847, 79859, 79869, 79877, 79885, 
+    79894, 79902, 79912, 79920, 79928, 79936, 79945, 79953, 79963, 79971, 
+    79979, 79987, 79997, 80005, 80012, 80019, 80026, 80033, 80041, 80049, 
+    80057, 80065, 80073, 80082, 80090, 80098, 80106, 80114, 80122, 80131, 
+    80139, 80147, 80155, 80163, 80171, 80179, 80187, 80195, 80203, 80211, 
+    80220, 80228, 80238, 80246, 80254, 80262, 80272, 80280, 80288, 80296, 
+    80304, 80313, 80322, 80330, 80340, 80348, 80356, 80364, 80373, 80381, 
+    80391, 80399, 80406, 80413, 80421, 80428, 80437, 80444, 80452, 80460, 
+    80469, 80477, 80487, 80495, 80503, 80511, 80521, 80529, 80536, 80543, 
+    80551, 80558, 80567, 80574, 80584, 80594, 80605, 80614, 80623, 80632, 
+    80641, 80650, 80660, 80671, 80682, 80692, 80703, 80715, 80725, 80734, 
+    80743, 80751, 80760, 80770, 80778, 80787, 80796, 80804, 80813, 80823, 
+    80831, 80840, 80849, 80857, 80866, 80876, 80884, 80894, 80902, 80912, 
+    80920, 80928, 80937, 80945, 80955, 80963, 80971, 80981, 80989, 80996, 
+    81003, 81012, 81021, 81029, 81038, 81048, 81056, 81067, 81075, 81083, 
+    81090, 81098, 81107, 81114, 81124, 81134, 81145, 81155, 81166, 81174, 
+    81182, 81191, 81199, 81208, 81216, 81224, 81233, 81241, 81250, 81258, 
+    81265, 81272, 81279, 81286, 81294, 81302, 81310, 81318, 81327, 81335, 
+    81343, 81352, 81360, 81368, 81376, 81385, 81393, 81401, 81409, 81417, 
+    81425, 81433, 81441, 81449, 81457, 81466, 81474, 81482, 81490, 81498, 
+    81506, 81515, 81524, 81532, 81540, 81548, 81557, 81565, 81574, 81581, 
+    81588, 81596, 81603, 81611, 81619, 81628, 81636, 81645, 81653, 81661, 
+    81671, 81678, 81685, 81693, 81700, 81708, 81718, 81729, 81737, 81746, 
+    81754, 81763, 81771, 81780, 81788, 81797, 81805, 81814, 81823, 81831, 
+    81839, 81847, 81856, 81863, 81871, 81880, 81889, 81898, 81908, 81916, 
+    81926, 81934, 81944, 81952, 81962, 81970, 81980, 81988, 81997, 82004, 
+    82013, 82020, 82030, 82038, 82048, 82056, 82066, 82074, 82082, 82090, 
+    82099, 82107, 82116, 82125, 82134, 82143, 82153, 82161, 82171, 82179, 
+    82189, 82197, 82207, 82215, 82225, 82233, 82242, 82249, 82258, 82265, 
+    82275, 82283, 82293, 82301, 82311, 82319, 82327, 82335, 82344, 82352, 
+    82361, 82370, 82379, 82388, 82396, 82404, 82413, 82421, 82430, 82439, 
+    82447, 82455, 82463, 82472, 82480, 82488, 82497, 82505, 82513, 82521, 
+    82529, 82534, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82539, 
+    82549, 82559, 82569, 82579, 82590, 82600, 82610, 82621, 82630, 82639, 
+    82648, 82659, 82669, 82679, 82691, 82701, 82711, 82721, 82731, 82741, 
+    82751, 82761, 82771, 82781, 82791, 82801, 82812, 82823, 82833, 82843, 
+    82855, 82866, 82877, 82887, 82897, 82907, 82917, 82927, 82937, 82947, 
+    82959, 82969, 82979, 82991, 83002, 83013, 83023, 83033, 83043, 83053, 
+    83065, 83075, 83085, 83096, 83107, 83117, 83127, 83136, 83145, 83154, 
+    83163, 83172, 83182, 0, 0, 83192, 83202, 83212, 83222, 83232, 83244, 
+    83254, 83264, 83276, 83286, 83298, 83307, 83316, 83327, 83337, 83349, 
+    83360, 83373, 83383, 83395, 83404, 83415, 83426, 83439, 83449, 83459, 
+    83469, 83479, 83489, 83498, 83507, 83516, 83525, 83535, 83545, 83555, 
+    83565, 83575, 83585, 83595, 83605, 83615, 83625, 83635, 83645, 83654, 
+    83663, 83672, 83682, 83692, 83702, 83712, 83722, 83733, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 78278, 78283, 78288, 78293, 78298, 78303, 78311, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 78316, 78323, 78330, 78337, 78344, 0, 
-    0, 0, 0, 0, 78351, 78358, 78365, 78375, 78381, 78387, 78393, 78399, 
-    78405, 78411, 78418, 78424, 78430, 78436, 78445, 78454, 78466, 78478, 
-    78484, 78490, 78496, 78503, 78510, 78517, 78524, 78531, 0, 78538, 78545, 
-    78552, 78560, 78567, 0, 78574, 0, 78581, 78588, 0, 78595, 78603, 0, 
-    78610, 78617, 78624, 78631, 78638, 78645, 78652, 78659, 78666, 78673, 
-    78678, 78685, 78692, 78698, 78704, 78710, 78716, 78722, 78728, 78734, 
-    78740, 78746, 78752, 78758, 78764, 78770, 78776, 78782, 78788, 78794, 
-    78800, 78806, 78812, 78818, 78824, 78830, 78836, 78842, 78848, 78854, 
-    78860, 78866, 78872, 78878, 78884, 78890, 78896, 78902, 78908, 78914, 
-    78920, 78926, 78932, 78938, 78944, 78950, 78956, 78962, 78968, 78974, 
-    78980, 78986, 78992, 78998, 79004, 79010, 79016, 79022, 79028, 79034, 
-    79040, 79046, 79052, 79058, 79064, 79070, 79076, 79082, 79088, 79094, 
-    79100, 79106, 79112, 79118, 79124, 79130, 79136, 79142, 79148, 79156, 
-    79164, 79170, 79176, 79182, 79188, 79197, 79206, 79214, 79222, 79230, 
-    79238, 79246, 79254, 79262, 79270, 79277, 79284, 79294, 79304, 79308, 
-    79312, 79317, 79322, 79327, 79332, 79341, 79350, 79356, 79362, 79369, 
-    79376, 79383, 79387, 79393, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 79399, 79405, 79411, 79417, 79423, 79428, 79433, 79439, 79445, 
-    79451, 79457, 79465, 79471, 79477, 79485, 79493, 79501, 79509, 79514, 
-    79519, 79524, 79529, 79542, 79555, 79565, 79575, 79586, 79597, 79608, 
-    79619, 79629, 79639, 79650, 79661, 79672, 79683, 79693, 79703, 79713, 
-    79729, 79745, 79761, 79768, 79775, 79782, 79789, 79799, 79809, 79819, 
-    79831, 79841, 79849, 79857, 79866, 79874, 79884, 79892, 79900, 79908, 
-    79917, 79925, 79935, 79943, 79951, 79959, 79969, 79977, 79984, 79991, 
-    79998, 80005, 80013, 80021, 80029, 80037, 80045, 80054, 80062, 80070, 
-    80078, 80086, 80094, 80103, 80111, 80119, 80127, 80135, 80143, 80151, 
-    80159, 80167, 80175, 80183, 80192, 80200, 80210, 80218, 80226, 80234, 
-    80244, 80252, 80260, 80268, 80276, 80285, 80294, 80302, 80312, 80320, 
-    80328, 80336, 80345, 80353, 80363, 80371, 80378, 80385, 80393, 80400, 
-    80409, 80416, 80424, 80432, 80441, 80449, 80459, 80467, 80475, 80483, 
-    80493, 80501, 80508, 80515, 80523, 80530, 80539, 80546, 80556, 80566, 
-    80577, 80586, 80595, 80604, 80613, 80622, 80632, 80643, 80654, 80664, 
-    80675, 80687, 80697, 80706, 80715, 80723, 80732, 80742, 80750, 80759, 
-    80768, 80776, 80785, 80795, 80803, 80812, 80821, 80829, 80838, 80848, 
-    80856, 80866, 80874, 80884, 80892, 80900, 80909, 80917, 80927, 80935, 
-    80943, 80953, 80961, 80968, 80975, 80984, 80993, 81001, 81010, 81020, 
-    81028, 81039, 81047, 81055, 81062, 81070, 81079, 81086, 81096, 81106, 
-    81117, 81127, 81138, 81146, 81154, 81163, 81171, 81180, 81188, 81196, 
-    81205, 81213, 81222, 81230, 81237, 81244, 81251, 81258, 81266, 81274, 
-    81282, 81290, 81299, 81307, 81315, 81324, 81332, 81340, 81348, 81357, 
-    81365, 81373, 81381, 81389, 81397, 81405, 81413, 81421, 81429, 81438, 
-    81446, 81454, 81462, 81470, 81478, 81487, 81496, 81504, 81512, 81520, 
-    81529, 81537, 81546, 81553, 81560, 81568, 81575, 81583, 81591, 81600, 
-    81608, 81617, 81625, 81633, 81643, 81650, 81657, 81665, 81672, 81680, 
-    81690, 81701, 81709, 81718, 81726, 81735, 81743, 81752, 81760, 81769, 
-    81777, 81786, 81795, 81803, 81811, 81819, 81828, 81835, 81843, 81852, 
-    81861, 81870, 81880, 81888, 81898, 81906, 81916, 81924, 81934, 81942, 
-    81952, 81960, 81969, 81976, 81985, 81992, 82002, 82010, 82020, 82028, 
-    82038, 82046, 82054, 82062, 82071, 82079, 82088, 82097, 82106, 82115, 
-    82125, 82133, 82143, 82151, 82161, 82169, 82179, 82187, 82197, 82205, 
-    82214, 82221, 82230, 82237, 82247, 82255, 82265, 82273, 82283, 82291, 
-    82299, 82307, 82316, 82324, 82333, 82342, 82351, 82360, 82368, 82376, 
-    82385, 82393, 82402, 82411, 82419, 82427, 82435, 82444, 82452, 82460, 
-    82469, 82477, 82485, 82493, 82501, 82506, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 82511, 82521, 82531, 82541, 82551, 82562, 82572, 82582, 
-    82593, 82602, 82611, 82620, 82631, 82641, 82651, 82663, 82673, 82683, 
-    82693, 82703, 82713, 82723, 82733, 82743, 82753, 82763, 82773, 82784, 
-    82795, 82805, 82815, 82827, 82838, 82849, 82859, 82869, 82879, 82889, 
-    82899, 82909, 82919, 82931, 82941, 82951, 82963, 82974, 82985, 82995, 
-    83005, 83015, 83025, 83037, 83047, 83057, 83068, 83079, 83089, 83099, 
-    83108, 83117, 83126, 83135, 83144, 83154, 0, 0, 83164, 83174, 83184, 
-    83194, 83204, 83216, 83226, 83236, 83248, 83258, 83270, 83279, 83288, 
-    83299, 83309, 83321, 83332, 83345, 83355, 83367, 83376, 83387, 83398, 
-    83411, 83421, 83431, 83441, 83451, 83461, 83470, 83479, 83488, 83497, 
-    83507, 83517, 83527, 83537, 83547, 83557, 83567, 83577, 83587, 83597, 
-    83607, 83617, 83626, 83635, 83644, 83654, 83664, 83674, 83684, 83694, 
-    83705, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83715, 83730, 
-    83745, 83751, 83757, 83763, 83769, 83775, 83781, 83787, 83793, 83801, 
-    83805, 83808, 0, 0, 83816, 83819, 83822, 83825, 83828, 83831, 83834, 
-    83837, 83840, 83843, 83846, 83849, 83852, 83855, 83858, 83861, 83864, 
-    83872, 83881, 83892, 83900, 83908, 83917, 83926, 83937, 83949, 0, 0, 0, 
-    0, 0, 0, 83958, 83963, 83968, 83975, 83982, 83988, 83994, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 83999, 84009, 84019, 84029, 84038, 84049, 84058, 84067, 
-    84077, 84087, 84099, 84111, 84122, 84133, 84144, 84155, 84165, 84175, 
-    84185, 84195, 84206, 84217, 84221, 84226, 84235, 84244, 84248, 84252, 
-    84256, 84261, 84266, 84271, 84276, 84279, 84283, 0, 84288, 84291, 84294, 
-    84298, 84302, 84307, 84311, 84315, 84320, 84325, 84332, 84339, 84342, 
-    84345, 84348, 84351, 84354, 84358, 84362, 0, 84366, 84371, 84375, 84379, 
-    0, 0, 0, 0, 84384, 84389, 84396, 84401, 84406, 0, 84411, 84416, 84421, 
-    84426, 84431, 84436, 84441, 84446, 84451, 84456, 84461, 84466, 84475, 
-    84484, 84492, 84500, 84509, 84518, 84527, 84536, 84544, 84552, 84560, 
-    84568, 84573, 84578, 84584, 84590, 84596, 84602, 84610, 84618, 84624, 
-    84630, 84636, 84642, 84648, 84654, 84660, 84666, 84671, 84676, 84681, 
-    84686, 84691, 84696, 84701, 84706, 84712, 84718, 84724, 84730, 84736, 
-    84742, 84748, 84754, 84760, 84766, 84772, 84778, 84784, 84790, 84796, 
-    84802, 84808, 84814, 84820, 84826, 84832, 84838, 84844, 84850, 84856, 
-    84862, 84868, 84874, 84880, 84886, 84892, 84898, 84904, 84910, 84916, 
-    84922, 84928, 84934, 84940, 84946, 84952, 84958, 84964, 84970, 84976, 
-    84982, 84988, 84994, 85000, 85006, 85012, 85018, 85024, 85030, 85036, 
-    85042, 85048, 85054, 85060, 85066, 85071, 85076, 85081, 85086, 85092, 
-    85098, 85104, 85110, 85116, 85122, 85128, 85134, 85140, 85146, 85153, 
-    85160, 85165, 85170, 85175, 85180, 85192, 85204, 85215, 85226, 85238, 
-    85250, 85258, 0, 0, 85266, 0, 85274, 85278, 85282, 85285, 85289, 85293, 
-    85296, 85299, 85303, 85307, 85310, 85313, 85316, 85319, 85324, 85327, 
-    85331, 85334, 85337, 85340, 85343, 85346, 85349, 85352, 85355, 85358, 
-    85361, 85364, 85368, 85372, 85376, 85380, 85385, 85390, 85396, 85402, 
-    85408, 85413, 85419, 85425, 85431, 85436, 85442, 85448, 85453, 85458, 
-    85464, 85469, 85475, 85481, 85486, 85492, 85498, 85503, 85509, 85515, 
-    85521, 85527, 85533, 85537, 85542, 85546, 85551, 85555, 85560, 85565, 
-    85571, 85577, 85583, 85588, 85594, 85600, 85606, 85611, 85617, 85623, 
-    85628, 85633, 85639, 85644, 85650, 85656, 85661, 85667, 85673, 85678, 
-    85684, 85690, 85696, 85702, 85708, 85713, 85717, 85722, 85724, 85729, 
-    85734, 85740, 85745, 85750, 85754, 85760, 85765, 85770, 85775, 85780, 
-    85785, 85790, 85795, 85801, 85807, 85813, 85821, 85825, 85829, 85833, 
-    85837, 85841, 85845, 85850, 85855, 85860, 85865, 85869, 85874, 85879, 
-    85884, 85889, 85894, 85899, 85904, 85909, 85913, 85917, 85922, 85927, 
-    85932, 85937, 85941, 85946, 85951, 85956, 85961, 85965, 85970, 85975, 
-    85980, 85985, 85989, 85994, 85999, 86003, 86008, 86013, 86018, 86023, 
-    86028, 86033, 86040, 86047, 86051, 86056, 86061, 86066, 86071, 86076, 
-    86081, 86086, 86091, 86096, 86101, 86106, 86111, 86116, 86121, 86126, 
-    86131, 86136, 86141, 86146, 86151, 86156, 86161, 86166, 86171, 86176, 
-    86181, 86186, 86191, 86196, 0, 0, 0, 86201, 86205, 86210, 86214, 86219, 
-    86224, 0, 0, 86228, 86233, 86238, 86242, 86247, 86252, 0, 0, 86257, 
-    86262, 86266, 86271, 86276, 86281, 0, 0, 86286, 86291, 86296, 0, 0, 0, 
-    86300, 86304, 86308, 86312, 86315, 86319, 86323, 0, 86327, 86333, 86336, 
-    86340, 86343, 86347, 86351, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86355, 86361, 
-    86367, 86373, 86379, 0, 0, 86383, 86389, 86395, 86401, 86407, 86413, 
-    86420, 86427, 86434, 86441, 86448, 86455, 0, 86462, 86469, 86476, 86482, 
-    86489, 86496, 86503, 86510, 86516, 86523, 86530, 86537, 86544, 86550, 
-    86557, 86564, 86571, 86578, 86584, 86591, 86598, 86605, 86612, 86619, 
-    86626, 86633, 0, 86640, 86646, 86653, 86660, 86667, 86674, 86680, 86687, 
-    86694, 86701, 86708, 86715, 86722, 86729, 86735, 86742, 86749, 86756, 
-    86763, 0, 86770, 86777, 0, 86784, 86791, 86798, 86805, 86812, 86819, 
-    86826, 86833, 86840, 86847, 86854, 86861, 86868, 86875, 86882, 0, 0, 
-    86888, 86893, 86898, 86903, 86908, 86913, 86918, 86923, 86928, 86933, 
-    86938, 86943, 86948, 86953, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86958, 86965, 
-    86972, 86979, 86986, 86993, 87000, 87007, 87014, 87021, 87028, 87035, 
-    87042, 87049, 87056, 87063, 87070, 87077, 87084, 87091, 87099, 87107, 
-    87114, 87121, 87126, 87134, 87142, 87149, 87156, 87161, 87168, 87173, 
-    87178, 87185, 87190, 87195, 87200, 87208, 87213, 87218, 87225, 87230, 
-    87235, 87242, 87249, 87254, 87259, 87264, 87269, 87274, 87279, 87284, 
-    87289, 87294, 87301, 87306, 87313, 87318, 87323, 87328, 87333, 87338, 
-    87343, 87348, 87353, 87358, 87363, 87368, 87375, 87382, 87389, 87396, 
-    87402, 87407, 87414, 87419, 87424, 87433, 87440, 87449, 87456, 87461, 
-    87466, 87474, 87479, 87484, 87489, 87494, 87499, 87506, 87511, 87516, 
-    87521, 87526, 87531, 87538, 87545, 87552, 87559, 87566, 87573, 87580, 
-    87587, 87594, 87601, 87608, 87615, 87622, 87629, 87636, 87643, 87650, 
-    87657, 87664, 87671, 87678, 87685, 87692, 87699, 87706, 87713, 87720, 
-    87727, 0, 0, 0, 0, 0, 87734, 87742, 87750, 0, 0, 0, 0, 87755, 87759, 
-    87763, 87767, 87771, 87775, 87779, 87783, 87787, 87791, 87796, 87801, 
-    87806, 87811, 87816, 87821, 87826, 87831, 87836, 87842, 87848, 87854, 
-    87861, 87868, 87875, 87882, 87889, 87896, 87902, 87908, 87914, 87921, 
-    87928, 87935, 87942, 87949, 87956, 87963, 87970, 87977, 87984, 87991, 
-    87998, 88005, 88012, 0, 0, 0, 88019, 88027, 88035, 88043, 88051, 88059, 
-    88069, 88079, 88087, 88095, 88103, 88111, 88119, 88125, 88132, 88141, 
-    88150, 88159, 88168, 88177, 88186, 88196, 88207, 88217, 88228, 88237, 
-    88246, 88255, 88265, 88276, 88286, 88297, 88308, 88317, 88325, 88331, 
-    88337, 88343, 88349, 88357, 88365, 88371, 88378, 88388, 88395, 88402, 
-    88409, 88416, 88423, 88433, 88440, 88447, 88455, 88463, 88472, 88481, 
-    88490, 88499, 88508, 88516, 88525, 88534, 88543, 88547, 88554, 88559, 
-    88564, 88568, 88572, 88576, 88580, 88585, 88590, 88596, 88602, 88606, 
-    88612, 88616, 88620, 88624, 88628, 88632, 88636, 88642, 0, 0, 0, 0, 0, 
-    88646, 88651, 88656, 88661, 88666, 88673, 88678, 88683, 88688, 88693, 
-    88698, 88703, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83743, 83758, 83773, 83779, 83785, 83791, 
+    83797, 83803, 83809, 83815, 83821, 83829, 83833, 83836, 0, 0, 83844, 
+    83847, 83850, 83853, 83856, 83859, 83862, 83865, 83868, 83871, 83874, 
+    83877, 83880, 83883, 83886, 83889, 83892, 83900, 83909, 83920, 83928, 
+    83936, 83945, 83954, 83965, 83977, 0, 0, 0, 0, 0, 0, 83986, 83991, 83996, 
+    84003, 84010, 84016, 84022, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84027, 84037, 
+    84047, 84057, 84066, 84077, 84086, 84095, 84105, 84115, 84127, 84139, 
+    84150, 84161, 84172, 84183, 84193, 84203, 84213, 84223, 84234, 84245, 
+    84249, 84254, 84263, 84272, 84276, 84280, 84284, 84289, 84294, 84299, 
+    84304, 84307, 84311, 0, 84316, 84319, 84322, 84326, 84330, 84335, 84339, 
+    84343, 84348, 84353, 84360, 84367, 84370, 84373, 84376, 84379, 84382, 
+    84386, 84390, 0, 84394, 84399, 84403, 84407, 0, 0, 0, 0, 84412, 84417, 
+    84424, 84429, 84434, 0, 84439, 84444, 84449, 84454, 84459, 84464, 84469, 
+    84474, 84479, 84484, 84489, 84494, 84503, 84512, 84520, 84528, 84537, 
+    84546, 84555, 84564, 84572, 84580, 84588, 84596, 84601, 84606, 84612, 
+    84618, 84624, 84630, 84638, 84646, 84652, 84658, 84664, 84670, 84676, 
+    84682, 84688, 84694, 84699, 84704, 84709, 84714, 84719, 84724, 84729, 
+    84734, 84740, 84746, 84752, 84758, 84764, 84770, 84776, 84782, 84788, 
+    84794, 84800, 84806, 84812, 84818, 84824, 84830, 84836, 84842, 84848, 
+    84854, 84860, 84866, 84872, 84878, 84884, 84890, 84896, 84902, 84908, 
+    84914, 84920, 84926, 84932, 84938, 84944, 84950, 84956, 84962, 84968, 
+    84974, 84980, 84986, 84992, 84998, 85004, 85010, 85016, 85022, 85028, 
+    85034, 85040, 85046, 85052, 85058, 85064, 85070, 85076, 85082, 85088, 
+    85094, 85099, 85104, 85109, 85114, 85120, 85126, 85132, 85138, 85144, 
+    85150, 85156, 85162, 85168, 85174, 85181, 85188, 85193, 85198, 85203, 
+    85208, 85220, 85232, 85243, 85254, 85266, 85278, 85286, 0, 0, 85294, 0, 
+    85302, 85306, 85310, 85313, 85317, 85321, 85324, 85327, 85331, 85335, 
+    85338, 85341, 85344, 85347, 85352, 85355, 85359, 85362, 85365, 85368, 
+    85371, 85374, 85377, 85380, 85383, 85386, 85389, 85392, 85396, 85400, 
+    85404, 85408, 85413, 85418, 85424, 85430, 85436, 85441, 85447, 85453, 
+    85459, 85464, 85470, 85476, 85481, 85486, 85492, 85497, 85503, 85509, 
+    85514, 85520, 85526, 85531, 85537, 85543, 85549, 85555, 85561, 85565, 
+    85570, 85574, 85579, 85583, 85588, 85593, 85599, 85605, 85611, 85616, 
+    85622, 85628, 85634, 85639, 85645, 85651, 85656, 85661, 85667, 85672, 
+    85678, 85684, 85689, 85695, 85701, 85706, 85712, 85718, 85724, 85730, 
+    85736, 85741, 85745, 85750, 85752, 85757, 85762, 85768, 85773, 85778, 
+    85782, 85788, 85793, 85798, 85803, 85808, 85813, 85818, 85823, 85829, 
+    85835, 85841, 85849, 85853, 85857, 85861, 85865, 85869, 85873, 85878, 
+    85883, 85888, 85893, 85897, 85902, 85907, 85912, 85917, 85922, 85927, 
+    85932, 85937, 85941, 85945, 85950, 85955, 85960, 85965, 85969, 85974, 
+    85979, 85984, 85989, 85993, 85998, 86003, 86008, 86013, 86017, 86022, 
+    86027, 86031, 86036, 86041, 86046, 86051, 86056, 86061, 86068, 86075, 
+    86079, 86084, 86089, 86094, 86099, 86104, 86109, 86114, 86119, 86124, 
+    86129, 86134, 86139, 86144, 86149, 86154, 86159, 86164, 86169, 86174, 
+    86179, 86184, 86189, 86194, 86199, 86204, 86209, 86214, 86219, 86224, 0, 
+    0, 0, 86229, 86233, 86238, 86242, 86247, 86252, 0, 0, 86256, 86261, 
+    86266, 86270, 86275, 86280, 0, 0, 86285, 86290, 86294, 86299, 86304, 
+    86309, 0, 0, 86314, 86319, 86324, 0, 0, 0, 86328, 86332, 86336, 86340, 
+    86343, 86347, 86351, 0, 86355, 86361, 86364, 86368, 86371, 86375, 86379, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86383, 86389, 86395, 86401, 86407, 0, 0, 
+    86411, 86417, 86423, 86429, 86435, 86441, 86448, 86455, 86462, 86469, 
+    86476, 86483, 0, 86490, 86497, 86504, 86510, 86517, 86524, 86531, 86538, 
+    86544, 86551, 86558, 86565, 86572, 86578, 86585, 86592, 86599, 86606, 
+    86612, 86619, 86626, 86633, 86640, 86647, 86654, 86661, 0, 86668, 86674, 
+    86681, 86688, 86695, 86702, 86708, 86715, 86722, 86729, 86736, 86743, 
+    86750, 86757, 86763, 86770, 86777, 86784, 86791, 0, 86798, 86805, 0, 
+    86812, 86819, 86826, 86833, 86840, 86847, 86854, 86861, 86868, 86875, 
+    86882, 86889, 86896, 86903, 86910, 0, 0, 86916, 86921, 86926, 86931, 
+    86936, 86941, 86946, 86951, 86956, 86961, 86966, 86971, 86976, 86981, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 88708, 88715, 88724, 88733, 88740, 88747, 88754, 
-    88761, 88768, 88775, 88781, 88788, 88795, 88802, 88809, 88816, 88823, 
-    88830, 88837, 88846, 88853, 88860, 88867, 88874, 88881, 88888, 88895, 
-    88902, 88911, 88918, 88925, 88932, 88939, 88946, 88953, 88962, 88969, 
-    88976, 88983, 88990, 88999, 89006, 89013, 89020, 89028, 89037, 0, 0, 
-    89046, 89050, 89054, 89059, 89064, 89069, 89074, 89078, 89083, 89088, 
-    89093, 89098, 89103, 89108, 89112, 89116, 89121, 89126, 89131, 89135, 
-    89140, 89145, 89149, 89154, 89159, 89164, 89169, 89174, 89179, 0, 0, 0, 
-    89184, 89188, 89193, 89198, 89202, 89207, 89211, 89216, 89221, 89226, 
-    89231, 89235, 89239, 89244, 89249, 89254, 89259, 89264, 89269, 89273, 
-    89278, 89283, 89288, 89293, 89298, 89303, 89307, 89311, 89316, 89321, 
-    89326, 89331, 89336, 89341, 89346, 89351, 89356, 89361, 89366, 89371, 
-    89376, 89381, 89386, 89391, 89396, 89401, 89406, 89411, 89416, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 86986, 86993, 87000, 87007, 87014, 87021, 
+    87028, 87035, 87042, 87049, 87056, 87063, 87070, 87077, 87084, 87091, 
+    87098, 87105, 87112, 87119, 87127, 87135, 87142, 87149, 87154, 87162, 
+    87170, 87177, 87184, 87189, 87196, 87201, 87206, 87213, 87218, 87223, 
+    87228, 87236, 87241, 87246, 87253, 87258, 87263, 87270, 87277, 87282, 
+    87287, 87292, 87297, 87302, 87307, 87312, 87317, 87322, 87329, 87334, 
+    87341, 87346, 87351, 87356, 87361, 87366, 87371, 87376, 87381, 87386, 
+    87391, 87396, 87403, 87410, 87417, 87424, 87430, 87435, 87442, 87447, 
+    87452, 87461, 87468, 87477, 87484, 87489, 87494, 87502, 87507, 87512, 
+    87517, 87522, 87527, 87534, 87539, 87544, 87549, 87554, 87559, 87566, 
+    87573, 87580, 87587, 87594, 87601, 87608, 87615, 87622, 87629, 87636, 
+    87643, 87650, 87657, 87664, 87671, 87678, 87685, 87692, 87699, 87706, 
+    87713, 87720, 87727, 87734, 87741, 87748, 87755, 0, 0, 0, 0, 0, 87762, 
+    87770, 87778, 0, 0, 0, 0, 87783, 87787, 87791, 87795, 87799, 87803, 
+    87807, 87811, 87815, 87819, 87824, 87829, 87834, 87839, 87844, 87849, 
+    87854, 87859, 87864, 87870, 87876, 87882, 87889, 87896, 87903, 87910, 
+    87917, 87924, 87930, 87936, 87942, 87949, 87956, 87963, 87970, 87977, 
+    87984, 87991, 87998, 88005, 88012, 88019, 88026, 88033, 88040, 0, 0, 0, 
+    88047, 88055, 88063, 88071, 88079, 88087, 88097, 88107, 88115, 88123, 
+    88131, 88139, 88147, 88153, 88160, 88169, 88178, 88187, 88196, 88205, 
+    88214, 88224, 88235, 88245, 88256, 88265, 88274, 88283, 88293, 88304, 
+    88314, 88325, 88336, 88345, 88353, 88359, 88365, 88371, 88377, 88385, 
+    88393, 88399, 88406, 88416, 88423, 88430, 88437, 88444, 88451, 88461, 
+    88468, 88475, 88483, 88491, 88500, 88509, 88518, 88527, 88536, 88544, 
+    88553, 88562, 88571, 88575, 88582, 88587, 88592, 88596, 88600, 88604, 
+    88608, 88613, 88618, 88624, 88630, 88634, 88640, 88644, 88648, 88652, 
+    88656, 88660, 88664, 88670, 0, 0, 0, 0, 0, 88674, 88679, 88684, 88689, 
+    88694, 88701, 88706, 88711, 88716, 88721, 88726, 88731, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 89421, 89425, 
-    89430, 89435, 89440, 89444, 89449, 89454, 89459, 89464, 89468, 89472, 
-    89477, 89482, 89487, 89492, 89496, 89501, 89506, 89511, 89516, 89521, 
-    89526, 89530, 89535, 89540, 89545, 89550, 89555, 89560, 89565, 0, 89570, 
-    89575, 89580, 89586, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 89592, 89597, 
-    89602, 89607, 89612, 89617, 89622, 89627, 89632, 89637, 89642, 89647, 
-    89652, 89657, 89662, 89667, 89672, 89677, 89682, 89687, 89692, 89697, 
-    89702, 89707, 89712, 89717, 89722, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88736, 
+    88743, 88752, 88761, 88768, 88775, 88782, 88789, 88796, 88803, 88809, 
+    88816, 88823, 88830, 88837, 88844, 88851, 88858, 88865, 88874, 88881, 
+    88888, 88895, 88902, 88909, 88916, 88923, 88930, 88939, 88946, 88953, 
+    88960, 88967, 88974, 88981, 88990, 88997, 89004, 89011, 89018, 89027, 
+    89034, 89041, 89048, 89056, 89065, 0, 0, 89074, 89078, 89082, 89087, 
+    89092, 89097, 89102, 89106, 89111, 89116, 89121, 89126, 89131, 89136, 
+    89140, 89144, 89149, 89154, 89159, 89163, 89168, 89173, 89177, 89182, 
+    89187, 89192, 89197, 89202, 89207, 0, 0, 0, 89212, 89216, 89221, 89226, 
+    89230, 89235, 89239, 89244, 89249, 89254, 89259, 89263, 89267, 89272, 
+    89277, 89282, 89287, 89292, 89297, 89301, 89306, 89311, 89316, 89321, 
+    89326, 89331, 89335, 89339, 89344, 89349, 89354, 89359, 89364, 89369, 
+    89374, 89379, 89384, 89389, 89394, 89399, 89404, 89409, 89414, 89419, 
+    89424, 89429, 89434, 89439, 89444, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 89729, 89734, 89739, 
-    89744, 89749, 89754, 89759, 89764, 89769, 89774, 89779, 89784, 89789, 
-    89794, 89799, 89804, 89809, 89814, 89819, 89824, 89829, 89834, 89839, 
-    89844, 89849, 89854, 89859, 89863, 89867, 89871, 0, 89876, 89882, 89887, 
-    89892, 89897, 89902, 89908, 89914, 89920, 89926, 89932, 89938, 89944, 
-    89950, 89956, 89962, 89968, 89974, 89980, 89985, 89991, 89997, 90002, 
-    90008, 90013, 90019, 90025, 90030, 90036, 90042, 90047, 90053, 90059, 
-    90064, 90070, 90076, 90082, 0, 0, 0, 0, 90087, 90093, 90099, 90105, 
-    90111, 90117, 90123, 90129, 90135, 90142, 90147, 90152, 90158, 90164, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 89449, 89453, 89458, 89463, 89468, 89472, 
+    89477, 89482, 89487, 89492, 89496, 89500, 89505, 89510, 89515, 89520, 
+    89524, 89529, 89534, 89539, 89544, 89549, 89554, 89558, 89563, 89568, 
+    89573, 89578, 89583, 89588, 89593, 0, 89598, 89603, 89608, 89614, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 89620, 89625, 89630, 89635, 89640, 89645, 
+    89650, 89655, 89660, 89665, 89670, 89675, 89680, 89685, 89690, 89695, 
+    89700, 89705, 89710, 89715, 89720, 89725, 89730, 89735, 89740, 89745, 
+    89750, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90170, 90175, 90180, 
-    90185, 90191, 90196, 90202, 90208, 90214, 90220, 90227, 90233, 90240, 
-    90245, 90250, 90255, 90260, 90265, 90270, 90275, 90280, 90285, 90290, 
-    90295, 90300, 90305, 90310, 90315, 90320, 90325, 90330, 90335, 90340, 
-    90345, 90350, 90355, 90360, 90365, 90370, 90375, 90380, 90385, 90390, 
-    90395, 90401, 90406, 90412, 90418, 90424, 90430, 90437, 90443, 90450, 
-    90455, 90460, 90465, 90470, 90475, 90480, 90485, 90490, 90495, 90500, 
-    90505, 90510, 90515, 90520, 90525, 90530, 90535, 90540, 90545, 90550, 
-    90555, 90560, 90565, 90570, 90575, 90580, 90585, 90590, 90595, 90600, 
-    90605, 90610, 90615, 90620, 90625, 90630, 90635, 90640, 90645, 90650, 
-    90655, 90660, 90665, 90670, 90675, 90680, 90685, 90690, 90695, 90700, 
-    90705, 90710, 90715, 90720, 90725, 90730, 90735, 90740, 90745, 90750, 
-    90755, 90760, 90765, 90770, 90775, 90780, 90785, 90790, 90795, 90800, 
-    90805, 90810, 90815, 90820, 90825, 90830, 90835, 90840, 90845, 90850, 
-    90855, 90860, 90865, 90869, 90873, 90878, 90883, 90888, 90893, 90898, 
-    90903, 90908, 90913, 90918, 90923, 90928, 90932, 90936, 90940, 90944, 
-    90948, 90952, 90956, 90961, 90966, 0, 0, 90971, 90976, 90980, 90984, 
-    90988, 90992, 90996, 91000, 91004, 91008, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 89757, 89762, 89767, 89772, 89777, 89782, 89787, 
+    89792, 89797, 89802, 89807, 89812, 89817, 89822, 89827, 89832, 89837, 
+    89842, 89847, 89852, 89857, 89862, 89867, 89872, 89877, 89882, 89887, 
+    89891, 89895, 89899, 0, 89904, 89910, 89915, 89920, 89925, 89930, 89936, 
+    89942, 89948, 89954, 89960, 89966, 89972, 89978, 89984, 89990, 89996, 
+    90002, 90008, 90013, 90019, 90025, 90030, 90036, 90041, 90047, 90053, 
+    90058, 90064, 90070, 90075, 90081, 90087, 90092, 90098, 90104, 90110, 0, 
+    0, 0, 0, 90115, 90121, 90127, 90133, 90139, 90145, 90151, 90157, 90163, 
+    90170, 90175, 90180, 90186, 90192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 90198, 90203, 90208, 90213, 90219, 90224, 90230, 90236, 
+    90242, 90248, 90255, 90261, 90268, 90273, 90278, 90283, 90288, 90293, 
+    90298, 90303, 90308, 90313, 90318, 90323, 90328, 90333, 90338, 90343, 
+    90348, 90353, 90358, 90363, 90368, 90373, 90378, 90383, 90388, 90393, 
+    90398, 90403, 90408, 90413, 90418, 90423, 90429, 90434, 90440, 90446, 
+    90452, 90458, 90465, 90471, 90478, 90483, 90488, 90493, 90498, 90503, 
+    90508, 90513, 90518, 90523, 90528, 90533, 90538, 90543, 90548, 90553, 
+    90558, 90563, 90568, 90573, 90578, 90583, 90588, 90593, 90598, 90603, 
+    90608, 90613, 90618, 90623, 90628, 90633, 90638, 90643, 90648, 90653, 
+    90658, 90663, 90668, 90673, 90678, 90683, 90688, 90693, 90698, 90703, 
+    90708, 90713, 90718, 90723, 90728, 90733, 90738, 90743, 90748, 90753, 
+    90758, 90763, 90768, 90773, 90778, 90783, 90788, 90793, 90798, 90803, 
+    90808, 90813, 90818, 90823, 90828, 90833, 90838, 90843, 90848, 90853, 
+    90858, 90863, 90868, 90873, 90878, 90883, 90888, 90893, 90897, 90901, 
+    90906, 90911, 90916, 90921, 90926, 90931, 90936, 90941, 90946, 90951, 
+    90956, 90960, 90964, 90968, 90972, 90976, 90980, 90984, 90989, 90994, 0, 
+    0, 90999, 91004, 91008, 91012, 91016, 91020, 91024, 91028, 91032, 91036, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 91012, 91016, 91020, 91024, 91028, 91032, 0, 0, 91037, 0, 
-    91042, 91046, 91051, 91056, 91061, 91066, 91071, 91076, 91081, 91086, 
-    91091, 91095, 91100, 91105, 91110, 91115, 91119, 91124, 91129, 91134, 
-    91139, 91143, 91148, 91153, 91158, 91163, 91167, 91172, 91177, 91182, 
-    91187, 91191, 91196, 91201, 91206, 91211, 91216, 91221, 91226, 91230, 
-    91235, 91240, 91245, 91250, 0, 91255, 91260, 0, 0, 0, 91265, 0, 0, 91270, 
-    91275, 91282, 91289, 91296, 91303, 91310, 91317, 91324, 91331, 91338, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 91040, 91044, 91048, 91052, 
+    91056, 91060, 0, 0, 91065, 0, 91070, 91074, 91079, 91084, 91089, 91094, 
+    91099, 91104, 91109, 91114, 91119, 91123, 91128, 91133, 91138, 91143, 
+    91147, 91152, 91157, 91162, 91167, 91171, 91176, 91181, 91186, 91191, 
+    91195, 91200, 91205, 91210, 91215, 91219, 91224, 91229, 91234, 91239, 
+    91244, 91249, 91254, 91258, 91263, 91268, 91273, 91278, 0, 91283, 91288, 
+    0, 0, 0, 91293, 0, 0, 91298, 91303, 91310, 91317, 91324, 91331, 91338, 
     91345, 91352, 91359, 91366, 91373, 91380, 91387, 91394, 91401, 91408, 
-    91415, 91422, 0, 91429, 91436, 91442, 91448, 91454, 91461, 91468, 91476, 
-    91484, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 91493, 91498, 91503, 91508, 91513, 91518, 
-    91523, 91528, 91533, 91538, 91543, 91548, 91553, 91558, 91563, 91568, 
-    91573, 91578, 91583, 91588, 91593, 91598, 91603, 91607, 91612, 91617, 
-    91623, 91627, 0, 0, 0, 91631, 91637, 91641, 91646, 91651, 91656, 91660, 
-    91665, 91669, 91674, 91679, 91683, 91687, 91692, 91696, 91700, 91705, 
-    91710, 91714, 91719, 91724, 91729, 91734, 91739, 91744, 91749, 91754, 0, 
-    0, 0, 0, 0, 91759, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 91764, 
-    91770, 91776, 91782, 91788, 91794, 91801, 91808, 91815, 91821, 91827, 
-    91833, 91840, 91847, 91854, 91860, 91867, 91874, 91881, 91888, 91894, 
-    91901, 91908, 91914, 91921, 91928, 91935, 91942, 91949, 91955, 91962, 
-    91969, 91976, 91982, 91988, 91994, 92000, 92006, 92013, 92020, 92026, 
-    92032, 92038, 92045, 92051, 92058, 92065, 92072, 92078, 92086, 92093, 
-    92099, 92106, 92113, 92120, 92126, 0, 0, 0, 0, 0, 0, 92133, 92141, 0, 0, 
+    91415, 91422, 91429, 91436, 91443, 91450, 0, 91457, 91464, 91470, 91476, 
+    91482, 91489, 91496, 91504, 91512, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 91521, 91526, 
+    91531, 91536, 91541, 91546, 91551, 91556, 91561, 91566, 91571, 91576, 
+    91581, 91586, 91591, 91596, 91601, 91606, 91611, 91616, 91621, 91626, 
+    91631, 91635, 91640, 91645, 91651, 91655, 0, 0, 0, 91659, 91665, 91669, 
+    91674, 91679, 91684, 91688, 91693, 91697, 91702, 91707, 91711, 91715, 
+    91720, 91724, 91728, 91733, 91738, 91742, 91747, 91752, 91757, 91762, 
+    91767, 91772, 91777, 91782, 0, 0, 0, 0, 0, 91787, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92149, 92153, 92158, 92163, 0, 
-    92169, 92174, 0, 0, 0, 0, 0, 92179, 92185, 92192, 92197, 92202, 92206, 
-    92211, 92216, 0, 92221, 92226, 92231, 0, 92236, 92241, 92246, 92251, 
-    92256, 92261, 92266, 92271, 92276, 92281, 92286, 92290, 92294, 92299, 
-    92304, 92309, 92313, 92317, 92321, 92326, 92331, 92336, 92341, 92345, 
-    92350, 92354, 92359, 0, 0, 0, 0, 92364, 92370, 92375, 0, 0, 0, 0, 92380, 
-    92384, 92388, 92392, 92396, 92400, 92405, 92410, 92416, 0, 0, 0, 0, 0, 0, 
-    0, 0, 92422, 92428, 92435, 92441, 92448, 92454, 92460, 92466, 92473, 0, 
-    0, 0, 0, 0, 0, 0, 92479, 92487, 92495, 92503, 92511, 92519, 92527, 92535, 
-    92543, 92551, 92559, 92567, 92575, 92583, 92591, 92599, 92607, 92615, 
-    92623, 92631, 92639, 92647, 92655, 92663, 92671, 92679, 92687, 92695, 
-    92703, 92711, 92718, 92726, 92734, 92738, 92743, 92748, 92753, 92758, 
-    92763, 92768, 92773, 92777, 92782, 92786, 92791, 92795, 92800, 92804, 
-    92809, 92814, 92819, 92824, 92829, 92834, 92839, 92844, 92849, 92854, 
-    92859, 92864, 92869, 92874, 92879, 92884, 92889, 92894, 92899, 92904, 
-    92909, 92914, 92919, 92924, 92929, 92934, 92939, 92944, 92949, 92954, 
-    92959, 92964, 92969, 92974, 92979, 92984, 92989, 92994, 0, 0, 0, 92999, 
-    93004, 93013, 93021, 93030, 93039, 93050, 93061, 93068, 93075, 93082, 
-    93089, 93096, 93103, 93110, 93117, 93124, 93131, 93138, 93145, 93152, 
-    93159, 93166, 93173, 93180, 93187, 93194, 93201, 93208, 0, 0, 93215, 
-    93221, 93227, 93233, 93239, 93246, 93253, 93261, 93269, 93276, 93283, 
-    93290, 93297, 93304, 93311, 93318, 93325, 93332, 93339, 93346, 93353, 
-    93360, 93367, 93374, 93381, 93388, 93395, 0, 0, 0, 0, 0, 93402, 93408, 
-    93414, 93420, 93426, 93433, 93440, 93448, 93456, 93462, 93468, 93475, 
-    93481, 93487, 93493, 93499, 93506, 93513, 93520, 93527, 93534, 93541, 
-    93548, 93555, 93562, 93569, 93576, 93583, 93590, 93597, 93604, 93611, 
-    93618, 93625, 93632, 93639, 93646, 93653, 93660, 93667, 93674, 93681, 
-    93688, 93695, 93702, 93709, 93716, 93723, 93730, 93737, 93744, 93751, 
-    93758, 93765, 93772, 93779, 93786, 93793, 93800, 93807, 93814, 93821, 
-    93828, 93835, 93842, 93849, 93856, 93863, 93870, 93877, 93884, 93891, 
-    93898, 93905, 93912, 93919, 93926, 93933, 93940, 93947, 93954, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 93961, 93965, 93969, 93973, 93977, 93981, 93985, 93989, 
-    93993, 93997, 94002, 94007, 94012, 94017, 94022, 94027, 94032, 94037, 
-    94042, 94048, 94054, 94060, 94067, 94074, 94081, 94088, 94095, 94102, 
-    94109, 94116, 94123, 0, 94130, 94134, 94138, 94142, 94146, 94150, 94153, 
-    94157, 94160, 94164, 94167, 94171, 94175, 94180, 94184, 94189, 94192, 
-    94196, 94199, 94203, 94206, 94210, 94214, 94218, 94222, 94226, 94230, 
-    94234, 94238, 94242, 94246, 94250, 94254, 94258, 94262, 94266, 94270, 
-    94274, 94278, 94281, 94284, 94288, 94292, 94296, 94299, 94302, 94305, 
-    94309, 94313, 94317, 94321, 94324, 94327, 94331, 94337, 94343, 94349, 
-    94354, 94361, 94365, 94370, 94374, 94379, 94384, 94390, 94395, 94401, 
-    94405, 94410, 94414, 94419, 94422, 94425, 94429, 94434, 94440, 94445, 
-    94451, 0, 0, 0, 0, 94456, 94459, 94462, 94465, 94468, 94471, 94474, 
-    94477, 94480, 94483, 94487, 94491, 94495, 94499, 94503, 94507, 94511, 
-    94515, 94519, 94524, 94529, 94533, 94536, 94539, 94542, 94545, 94548, 
-    94551, 94554, 94557, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    94560, 94565, 94570, 94575, 94579, 94584, 94588, 94593, 94597, 94602, 
-    94606, 94611, 94615, 94620, 94624, 94629, 94634, 94639, 94644, 94649, 
-    94654, 94659, 94664, 94669, 94674, 94679, 94684, 94689, 94694, 94699, 
-    94704, 94709, 94714, 94719, 94724, 94728, 94732, 94737, 94742, 94747, 
-    94751, 94755, 94759, 94764, 94769, 94774, 94779, 94783, 94787, 94793, 
-    94798, 94804, 94809, 94815, 94820, 94826, 94831, 94837, 94842, 94847, 
-    94852, 94857, 94861, 94866, 94872, 94876, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 94881, 94888, 94895, 94902, 94909, 94916, 94923, 94930, 
-    94937, 94944, 94951, 94958, 94965, 94972, 94979, 94986, 94993, 95000, 
-    95007, 95014, 95021, 95028, 95035, 95042, 95049, 0, 0, 0, 0, 0, 0, 0, 
-    95056, 95063, 95069, 95075, 95081, 95087, 95093, 95099, 95105, 95111, 0, 
-    0, 0, 0, 0, 0, 95117, 95122, 95127, 95132, 95137, 95141, 95145, 95149, 
-    95154, 95159, 95164, 95169, 95174, 95179, 95184, 95189, 95194, 95199, 
-    95204, 95209, 95214, 95219, 95224, 95229, 95234, 95239, 95244, 95249, 
-    95254, 95259, 95264, 95269, 95274, 95279, 95284, 95289, 95294, 95299, 
-    95304, 95309, 95314, 95319, 95325, 95330, 95336, 95341, 95347, 95352, 
-    95358, 95364, 95368, 95373, 95377, 0, 95381, 95386, 95390, 95394, 95398, 
-    95402, 95406, 95410, 95414, 95418, 95422, 95427, 95431, 95436, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 95441, 95445, 95449, 95453, 95456, 95460, 
-    95463, 95467, 95470, 95474, 95478, 95483, 95487, 95492, 95495, 95499, 
-    95502, 95506, 95509, 95513, 95517, 95521, 95525, 95529, 95533, 95537, 
-    95541, 95545, 95549, 95553, 95557, 95561, 95565, 95569, 95573, 95577, 
-    95581, 95584, 95587, 95591, 95595, 95599, 95602, 95605, 95608, 95612, 
-    95616, 95620, 95624, 95628, 95631, 95634, 95639, 95643, 95648, 95652, 
-    95657, 95662, 95668, 95673, 95679, 95683, 95688, 95692, 95697, 95701, 
-    95705, 95709, 95713, 95716, 95719, 95723, 95727, 0, 0, 0, 0, 0, 0, 0, 
-    95730, 95734, 95737, 95740, 95743, 95746, 95749, 95752, 95755, 95758, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 95761, 95765, 95770, 95774, 95779, 
-    95783, 95788, 95792, 95797, 95801, 95806, 95810, 95815, 95820, 95825, 
-    95830, 95835, 95840, 95845, 95850, 95855, 95860, 95865, 95870, 95875, 
-    95880, 95885, 95890, 95895, 95900, 95904, 95908, 95913, 95918, 95923, 
-    95927, 95931, 95935, 95940, 95945, 95950, 95954, 95958, 95963, 95968, 
-    95973, 95979, 95984, 95990, 95995, 96001, 96006, 96012, 96017, 96023, 
-    96028, 0, 0, 0, 0, 0, 0, 0, 0, 96033, 96038, 96042, 96046, 96050, 96054, 
-    96058, 96062, 96066, 96070, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96074, 96077, 96082, 96088, 
-    96096, 96101, 96107, 96115, 96121, 96127, 96131, 96135, 96142, 96151, 
-    96158, 96167, 96173, 96182, 96189, 96196, 96203, 96213, 96219, 96223, 
-    96230, 96239, 96249, 96256, 96263, 96267, 96271, 96278, 96288, 96292, 
-    96299, 96306, 96313, 96319, 96326, 96333, 96340, 96347, 96351, 96355, 
-    96359, 96366, 96370, 96377, 96384, 96398, 96407, 96411, 96415, 96419, 
-    96426, 96430, 96434, 96438, 96446, 96454, 96473, 96483, 96503, 96507, 
-    96511, 96515, 96519, 96523, 96527, 96531, 96538, 96542, 96545, 96549, 
-    96553, 96559, 96566, 96575, 96579, 96588, 96597, 96605, 96609, 96616, 
-    96620, 96624, 96628, 96632, 96643, 96652, 96661, 96670, 96679, 96691, 
-    96700, 96709, 96718, 96726, 96735, 96747, 96756, 96765, 96774, 96786, 
-    96795, 96804, 96816, 96825, 96834, 96846, 96855, 96859, 96863, 96867, 
-    96871, 96875, 96879, 96883, 96890, 96894, 96898, 96909, 96913, 96917, 
-    96924, 96930, 96936, 96940, 96947, 96951, 96955, 96959, 96963, 96967, 
-    96971, 96977, 96985, 96989, 96993, 96996, 97002, 97012, 97016, 97028, 
-    97035, 97042, 97049, 97056, 97062, 97066, 97070, 97074, 97078, 97085, 
-    97094, 97101, 97109, 97117, 97123, 97127, 97131, 97135, 97139, 97145, 
-    97154, 97166, 97173, 97180, 97189, 97200, 97206, 97215, 97224, 97231, 
-    97240, 97247, 97254, 97264, 97271, 97278, 97285, 97292, 97296, 97302, 
-    97306, 97317, 97325, 97334, 97346, 97353, 97360, 97370, 97377, 97386, 
-    97393, 97402, 97409, 97416, 97426, 97433, 97440, 97450, 97457, 97469, 
-    97478, 97485, 97492, 97499, 97508, 97518, 97531, 97538, 97548, 97558, 
-    97565, 97574, 97587, 97594, 97601, 97608, 97618, 97628, 97635, 97645, 
-    97652, 97659, 97669, 97675, 97682, 97689, 97696, 97706, 97713, 97720, 
-    97727, 97733, 97740, 97750, 97757, 97761, 97769, 97773, 97785, 97789, 
-    97803, 97807, 97811, 97815, 97819, 97825, 97832, 97840, 97844, 97848, 
-    97852, 97856, 97863, 97867, 97873, 97879, 97887, 97891, 97898, 97906, 
-    97910, 97914, 97920, 97924, 97933, 97942, 97949, 97959, 97965, 97969, 
-    97973, 97981, 97988, 97995, 98001, 98005, 98013, 98017, 98024, 98036, 
-    98043, 98053, 98059, 98063, 98072, 98079, 98088, 98092, 98096, 98103, 
-    98107, 98111, 98115, 98119, 98122, 98128, 98134, 98138, 98142, 98149, 
-    98156, 98163, 98170, 98177, 98184, 98191, 98198, 98204, 98208, 98212, 
-    98219, 98226, 98233, 98240, 98247, 98251, 98254, 98259, 98263, 98267, 
-    98276, 98285, 98289, 98293, 98299, 98305, 98322, 98328, 98332, 98341, 
-    98345, 98349, 98356, 98364, 98372, 98378, 98382, 98386, 98390, 98394, 
-    98397, 98403, 98410, 98420, 98427, 98434, 98441, 98447, 98454, 98461, 
-    98468, 98475, 98482, 98491, 98498, 98510, 98517, 98524, 98534, 98545, 
-    98552, 98559, 98566, 98573, 98580, 98587, 98594, 98601, 98608, 98615, 
-    98625, 98635, 98645, 98652, 98662, 98669, 98676, 98683, 98690, 98696, 
-    98703, 98710, 98717, 98724, 98731, 98738, 98745, 98752, 98758, 98765, 
-    98772, 98781, 98788, 98795, 98799, 98807, 98811, 98815, 98819, 98823, 
-    98827, 98834, 98838, 98847, 98851, 98858, 98866, 98870, 98874, 98878, 
-    98891, 98907, 98911, 98915, 98922, 98928, 98935, 98939, 98943, 98947, 
-    98951, 98955, 98962, 98966, 98984, 98988, 98992, 98999, 99003, 99007, 
-    99013, 99017, 99021, 99029, 99033, 99037, 99041, 99045, 99051, 99062, 
-    99071, 99080, 99087, 99094, 99105, 99112, 99119, 99126, 99133, 99140, 
-    99147, 99154, 99164, 99170, 99177, 99187, 99196, 99203, 99212, 99222, 
-    99229, 99236, 99243, 99250, 99262, 99269, 99276, 99283, 99290, 99297, 
-    99307, 99314, 99321, 99331, 99344, 99356, 99363, 99373, 99380, 99387, 
-    99394, 99408, 99414, 99422, 99432, 99442, 99449, 99456, 99462, 99466, 
-    99473, 99483, 99489, 99502, 99506, 99510, 99517, 99521, 99528, 99538, 
-    99542, 99546, 99550, 99554, 99558, 99565, 99569, 99576, 99583, 99590, 
-    99599, 99608, 99618, 99625, 99632, 99639, 99649, 99656, 99666, 99673, 
-    99683, 99690, 99697, 99707, 99717, 99724, 99730, 99738, 99746, 99752, 
-    99758, 99762, 99766, 99773, 99781, 99787, 99791, 99795, 99799, 99806, 
-    99818, 99821, 99828, 99834, 99838, 99842, 99846, 99850, 99854, 99858, 
-    99862, 99866, 99870, 99874, 99881, 99885, 99891, 99895, 99899, 99903, 
-    99909, 99916, 99923, 99930, 99941, 99949, 99953, 99959, 99968, 99975, 
-    99981, 99984, 99988, 99992, 99998, 100007, 100015, 100019, 100025, 
-    100029, 100033, 100037, 100043, 100050, 100056, 100060, 100066, 100070, 
-    100074, 100083, 100095, 100099, 100106, 100113, 100123, 100130, 100142, 
-    100149, 100156, 100163, 100174, 100184, 100197, 100207, 100214, 100218, 
-    100222, 100226, 100230, 100239, 100248, 100257, 100274, 100283, 100289, 
-    100296, 100304, 100317, 100321, 100330, 100339, 100348, 100357, 100368, 
-    100377, 100386, 100395, 100404, 100413, 100422, 100432, 100435, 100439, 
-    100443, 100447, 100451, 100455, 100461, 100468, 100475, 100482, 100488, 
-    100494, 100501, 100507, 100514, 100522, 100526, 100533, 100540, 100547, 
-    100555, 100558, 100562, 100566, 100570, 100573, 100579, 100583, 100589, 
-    100596, 100603, 100609, 100616, 100623, 100630, 100637, 100644, 100651, 
-    100658, 100665, 100672, 100679, 100686, 100693, 100700, 100707, 100713, 
-    100717, 100726, 100730, 100734, 100738, 100742, 100748, 100755, 100762, 
-    100769, 100776, 100783, 100789, 100797, 100801, 100805, 100809, 100813, 
-    100819, 100836, 100853, 100857, 100861, 100865, 100869, 100873, 100877, 
-    100883, 100890, 100894, 100900, 100907, 100914, 100921, 100928, 100935, 
-    100944, 100951, 100958, 100965, 100972, 100976, 100980, 100986, 100998, 
-    101002, 101006, 101015, 101019, 101023, 101027, 101033, 101037, 101041, 
-    101050, 101054, 101058, 101062, 101069, 101073, 101077, 101081, 101085, 
-    101089, 101093, 101097, 101101, 101107, 101114, 101121, 101127, 101131, 
-    101148, 101154, 101158, 101164, 101170, 101176, 101182, 101188, 101194, 
-    101198, 101202, 101206, 101212, 101216, 101222, 101226, 101230, 101237, 
-    101244, 101261, 101265, 101269, 101273, 101277, 101281, 101293, 101296, 
-    101301, 101306, 101321, 101331, 101343, 101347, 101351, 101355, 101361, 
-    101368, 101375, 101385, 101397, 101403, 101409, 101418, 101422, 101426, 
-    101433, 101443, 101450, 101456, 101460, 101464, 101471, 101477, 101481, 
-    101487, 101491, 101499, 101505, 101509, 101517, 101525, 101532, 101538, 
-    101545, 101552, 101562, 101572, 101576, 101580, 101584, 101588, 101594, 
-    101601, 101607, 101614, 101621, 101628, 101637, 101644, 101651, 101657, 
-    101664, 101671, 101678, 101685, 101692, 101699, 101705, 101712, 101719, 
-    101726, 101735, 101742, 101749, 101753, 101759, 101763, 101769, 101776, 
-    101783, 101790, 101794, 101798, 101802, 101806, 101810, 101817, 101821, 
-    101825, 101831, 101839, 101843, 101847, 101851, 101855, 101862, 101866, 
-    101870, 101878, 101882, 101886, 101890, 101894, 101900, 101904, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 101908, 101914, 101920, 101927, 
-    101934, 101941, 101948, 101955, 101962, 101968, 101975, 101982, 101989, 
-    101996, 102003, 102010, 102016, 102022, 102028, 102034, 102040, 102046, 
-    102052, 102058, 102064, 102071, 102078, 102085, 102092, 102099, 102106, 
-    102112, 102118, 102124, 102131, 102138, 102144, 102150, 102159, 102166, 
-    102173, 102180, 102187, 102194, 102201, 102207, 102213, 102219, 102228, 
-    102235, 102242, 102253, 102264, 102270, 102276, 102282, 102291, 102298, 
-    102305, 102315, 102325, 102336, 102347, 102359, 102372, 102383, 102394, 
-    102406, 102419, 102430, 102441, 102452, 102463, 102474, 102486, 102494, 
-    102502, 102511, 102520, 102529, 102535, 102541, 102547, 102554, 102564, 
-    102571, 102581, 102586, 102591, 102597, 102603, 102611, 102619, 102628, 
-    102639, 102650, 102658, 102666, 102675, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 102684, 102695, 102702, 102710, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    102718, 102722, 102726, 102730, 102734, 102738, 102742, 102746, 102750, 
-    102754, 102758, 102762, 102766, 102770, 102774, 102778, 102782, 102786, 
-    102790, 102794, 102798, 102802, 102806, 102810, 102814, 102818, 102822, 
-    102826, 102830, 102834, 102838, 102842, 102846, 102850, 102854, 102858, 
-    102862, 102866, 102870, 102874, 102878, 102882, 102886, 102890, 102894, 
-    102898, 102902, 102906, 102910, 102914, 102918, 102922, 102926, 102930, 
-    102934, 102938, 102942, 102946, 102950, 102954, 102958, 102962, 102966, 
-    102970, 102974, 102978, 102982, 102986, 102990, 102994, 102998, 103002, 
-    103006, 103010, 103014, 103018, 103022, 103026, 103030, 103034, 103038, 
-    103042, 103046, 103050, 103054, 103058, 103062, 103066, 103070, 103074, 
-    103078, 103082, 103086, 103090, 103094, 103098, 103102, 103106, 103110, 
-    103114, 103118, 103122, 103126, 103130, 103134, 103138, 103142, 103146, 
-    103150, 103154, 103158, 103162, 103166, 103170, 103174, 103178, 103182, 
-    103186, 103190, 103194, 103198, 103202, 103206, 103210, 103214, 103218, 
-    103222, 103226, 103230, 103234, 103238, 103242, 103246, 103250, 103254, 
-    103258, 103262, 103266, 103270, 103274, 103278, 103282, 103286, 103290, 
-    103294, 103298, 103302, 103306, 103310, 103314, 103318, 103322, 103326, 
-    103330, 103334, 103338, 103342, 103346, 103350, 103354, 103358, 103362, 
-    103366, 103370, 103374, 103378, 103382, 103386, 103390, 103394, 103398, 
-    103402, 103406, 103410, 103414, 103418, 103422, 103426, 103430, 103434, 
-    103438, 103442, 103446, 103450, 103454, 103458, 103462, 103466, 103470, 
-    103474, 103478, 103482, 103486, 103490, 103494, 103498, 103502, 103506, 
-    103510, 103514, 103518, 103522, 103526, 103530, 103534, 103538, 103542, 
-    103546, 103550, 103554, 103558, 103562, 103566, 103570, 103574, 103578, 
-    103582, 103586, 103590, 103594, 103598, 103602, 103606, 103610, 103614, 
-    103618, 103622, 103626, 103630, 103634, 103638, 103642, 103646, 103650, 
-    103654, 103658, 103662, 103666, 103670, 103674, 103678, 103682, 103686, 
-    103690, 103694, 103698, 103702, 103706, 103710, 103714, 103718, 103722, 
-    103726, 103730, 103734, 103738, 103742, 103746, 103750, 103754, 103758, 
-    103762, 103766, 103770, 103774, 103778, 103782, 103786, 103790, 103794, 
-    103798, 103802, 103806, 103810, 103814, 103818, 103822, 103826, 103830, 
-    103834, 103838, 103842, 103846, 103850, 103854, 103858, 103862, 103866, 
-    103870, 103874, 103878, 103882, 103886, 103890, 103894, 103898, 103902, 
-    103906, 103910, 103914, 103918, 103922, 103926, 103930, 103934, 103938, 
-    103942, 103946, 103950, 103954, 103958, 103962, 103966, 103970, 103974, 
-    103978, 103982, 103986, 103990, 103994, 103998, 104002, 104006, 104010, 
-    104014, 104018, 104022, 104026, 104030, 104034, 104038, 104042, 104046, 
-    104050, 104054, 104058, 104062, 104066, 104070, 104074, 104078, 104082, 
-    104086, 104090, 104094, 104098, 104102, 104106, 104110, 104114, 104118, 
-    104122, 104126, 104130, 104134, 104138, 104142, 104146, 104150, 104154, 
-    104158, 104162, 104166, 104170, 104174, 104178, 104182, 104186, 104190, 
-    104194, 104198, 104202, 104206, 104210, 104214, 104218, 104222, 104226, 
-    104230, 104234, 104238, 104242, 104246, 104250, 104254, 104258, 104262, 
-    104266, 104270, 104274, 104278, 104282, 104286, 104290, 104294, 104298, 
-    104302, 104306, 104310, 104314, 104318, 104322, 104326, 104330, 104334, 
-    104338, 104342, 104346, 104350, 104354, 104358, 104362, 104366, 104370, 
-    104374, 104378, 104382, 104386, 104390, 104394, 104398, 104402, 104406, 
-    104410, 104414, 104418, 104422, 104426, 104430, 104434, 104438, 104442, 
-    104446, 104450, 104454, 104458, 104462, 104466, 104470, 104474, 104478, 
-    104482, 104486, 104490, 104494, 104498, 104502, 104506, 104510, 104514, 
-    104518, 104522, 104526, 104530, 104534, 104538, 104542, 104546, 104550, 
-    104554, 104558, 104562, 104566, 104570, 104574, 104578, 104582, 104586, 
-    104590, 104594, 104598, 104602, 104606, 104610, 104614, 104618, 104622, 
-    104626, 104630, 104634, 104638, 104642, 104646, 104650, 104654, 104658, 
-    104662, 104666, 104670, 104674, 104678, 104682, 104686, 104690, 104694, 
-    104698, 104702, 104706, 104710, 104714, 104718, 104722, 104726, 104730, 
-    104734, 104738, 104742, 104746, 104750, 104754, 104758, 104762, 104766, 
-    104770, 104774, 104778, 104782, 104786, 104790, 104794, 104798, 104802, 
-    104806, 104810, 104814, 104818, 104822, 104826, 104830, 104834, 104838, 
-    104842, 104846, 104850, 104854, 104858, 104862, 104866, 104870, 104874, 
-    104878, 104882, 104886, 104890, 104894, 104898, 104902, 104906, 104910, 
-    104914, 104918, 104922, 104926, 104930, 104934, 104938, 104942, 104946, 
-    104950, 104954, 104958, 104962, 104966, 104970, 104974, 104978, 104982, 
-    104986, 104990, 104994, 104998, 105002, 105006, 105010, 105014, 105018, 
-    105022, 105026, 105030, 105034, 105038, 105042, 105046, 105050, 105054, 
-    105058, 105062, 105066, 105070, 105074, 105078, 105082, 105086, 105090, 
-    105094, 105098, 105102, 105106, 105110, 105114, 105118, 105122, 105126, 
-    105130, 105134, 105138, 105142, 105146, 105150, 105154, 105158, 105162, 
-    105166, 105170, 105174, 105178, 105182, 105186, 105190, 105194, 105198, 
-    105202, 105206, 105210, 105214, 105218, 105222, 105226, 105230, 105234, 
-    105238, 105242, 105246, 105250, 105254, 105258, 105262, 105266, 105270, 
-    105274, 105278, 105282, 105286, 105290, 105294, 105298, 105302, 105306, 
-    105310, 105314, 105318, 105322, 105326, 105330, 105334, 105338, 105342, 
-    105346, 105350, 105354, 105358, 105362, 105366, 105370, 105374, 105378, 
-    105382, 105386, 105390, 105394, 105398, 105402, 105406, 105410, 105414, 
-    105418, 105422, 105426, 105430, 105434, 105438, 105442, 105446, 105450, 
-    105454, 105458, 105462, 105466, 105470, 105474, 105478, 105482, 105486, 
-    105490, 105494, 105498, 105502, 105506, 105510, 105514, 105518, 105522, 
-    105526, 105530, 105534, 105538, 105542, 105546, 105550, 105554, 105558, 
-    105562, 105566, 105570, 105574, 105578, 105582, 105586, 105590, 105594, 
-    105598, 105602, 105606, 105610, 105614, 105618, 105622, 105626, 105630, 
-    105634, 105638, 105642, 105646, 105650, 105654, 105658, 105662, 105666, 
-    105670, 105674, 105678, 105682, 105686, 105690, 105694, 105698, 105702, 
-    105706, 105710, 105714, 105718, 105722, 105726, 105730, 105734, 105738, 
-    105742, 105746, 105750, 105754, 105758, 105762, 105766, 105770, 105774, 
-    105778, 105782, 105786, 105790, 105794, 105798, 105802, 105806, 105810, 
-    105814, 105818, 105822, 105826, 105830, 105834, 105838, 105842, 105846, 
-    105850, 105854, 105858, 105862, 105866, 105870, 105874, 105878, 105882, 
-    105886, 105890, 105894, 105898, 105902, 105906, 105910, 105914, 105918, 
-    105922, 105926, 105930, 105934, 105938, 105942, 105946, 105950, 105954, 
-    105958, 105962, 105966, 105970, 105974, 105978, 105982, 105986, 105990, 
-    105994, 105998, 106002, 106006, 106010, 106014, 106018, 106022, 106026, 
-    106030, 106034, 106038, 106042, 106046, 106050, 106054, 106058, 106062, 
-    106066, 106070, 106074, 106078, 106082, 106086, 106090, 106094, 106098, 
-    106102, 106106, 106110, 106114, 106118, 106122, 106126, 106130, 106134, 
-    106138, 106142, 106146, 106150, 106154, 106158, 106162, 106166, 106170, 
-    106174, 106178, 106182, 106186, 106190, 106194, 106198, 106202, 106206, 
-    106210, 106214, 106218, 106222, 106226, 106230, 106234, 106238, 106242, 
-    106246, 106250, 106254, 106258, 106262, 106266, 106270, 106274, 106278, 
-    106282, 106286, 106290, 106294, 106298, 106302, 106306, 106310, 106314, 
-    106318, 106322, 106326, 106330, 106334, 106338, 106342, 106346, 106350, 
-    106354, 106358, 106362, 106366, 106370, 106374, 106378, 106382, 106386, 
-    106390, 106394, 106398, 106402, 106406, 106410, 106414, 106418, 106422, 
-    106426, 106430, 106434, 106438, 106442, 106446, 106450, 106454, 106458, 
-    106462, 106466, 106470, 106474, 106478, 106482, 106486, 106490, 106494, 
-    106498, 106502, 106506, 106510, 106514, 106518, 106522, 106526, 106530, 
-    106534, 106538, 106542, 106546, 106550, 106554, 106558, 106562, 106566, 
-    106570, 106574, 106578, 106582, 106586, 106590, 106594, 106598, 106602, 
-    106606, 106610, 106614, 106618, 106622, 106626, 106630, 106634, 106638, 
-    106642, 106646, 106650, 106654, 106658, 106662, 106666, 106670, 106674, 
-    106678, 106682, 106686, 106690, 106694, 106698, 106702, 106706, 106710, 
-    106714, 106718, 106722, 106726, 106730, 106734, 106738, 106742, 106746, 
-    106750, 106754, 106758, 106762, 106766, 106770, 106774, 106778, 106782, 
-    106786, 106790, 106794, 106798, 106802, 106806, 106810, 106814, 106818, 
-    106822, 106826, 106830, 106834, 106838, 106842, 106846, 106850, 106854, 
-    106858, 106862, 106866, 106870, 106874, 106878, 106882, 106886, 106890, 
-    106894, 106898, 106902, 106906, 106910, 106914, 106918, 106922, 106926, 
-    106930, 106934, 106938, 106942, 106946, 106950, 106954, 106958, 106962, 
-    106966, 106970, 106974, 106978, 106982, 106986, 106990, 106994, 106998, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 107002, 107009, 107016, 107025, 107034, 
-    107041, 107046, 107053, 107060, 107069, 107080, 107091, 107096, 107103, 
-    107108, 107113, 107118, 107123, 107128, 107133, 107138, 107143, 107148, 
-    107153, 107158, 107165, 107172, 107177, 107182, 107187, 107192, 107199, 
-    107206, 107214, 107219, 107226, 107231, 107236, 107241, 107246, 107251, 
-    107258, 107265, 107270, 107275, 107280, 107285, 107290, 107295, 107300, 
-    107305, 107310, 107315, 107320, 107325, 107330, 107335, 107340, 107345, 
-    107350, 107355, 107360, 107367, 107372, 107377, 107386, 107393, 107398, 
-    107403, 107408, 107413, 107418, 107423, 107428, 107433, 107438, 107443, 
-    107448, 107453, 107458, 107463, 107468, 107473, 107478, 107483, 107488, 
-    107493, 107498, 107504, 107512, 107518, 107526, 107534, 107542, 107548, 
-    107554, 107560, 107566, 107572, 107580, 107590, 107598, 107606, 107612, 
-    107618, 107626, 107634, 107640, 107648, 107656, 107664, 107670, 107676, 
-    107682, 107688, 107694, 107700, 107708, 107716, 107722, 107728, 107734, 
-    107740, 107746, 107754, 107760, 107766, 107772, 107778, 107784, 107790, 
-    107798, 107804, 107810, 107816, 107822, 107830, 107838, 107844, 107850, 
-    107856, 107861, 107867, 107873, 107880, 107885, 107890, 107895, 107900, 
-    107905, 107910, 107915, 107920, 107925, 107934, 107941, 107946, 107951, 
-    107956, 107963, 107968, 107973, 107978, 107985, 107990, 107995, 108000, 
-    108005, 108010, 108015, 108020, 108025, 108030, 108035, 108040, 108047, 
-    108052, 108059, 108064, 108069, 108076, 108081, 108086, 108091, 108096, 
-    108101, 108106, 108111, 108116, 108121, 108126, 108131, 108136, 108141, 
-    108146, 108151, 108156, 108161, 108166, 108171, 108178, 108183, 108188, 
-    108193, 108198, 108203, 108208, 108213, 108218, 108223, 108228, 108233, 
-    108238, 108243, 108250, 108255, 108260, 108267, 108272, 108277, 108282, 
-    108287, 108292, 108297, 108302, 108307, 108312, 108317, 108324, 108329, 
-    108334, 108339, 108344, 108349, 108356, 108363, 108368, 108373, 108378, 
-    108383, 108388, 108393, 108398, 108403, 108408, 108413, 108418, 108423, 
-    108428, 108433, 108438, 108443, 108448, 108453, 108458, 108463, 108468, 
-    108473, 108478, 108483, 108488, 108493, 108498, 108503, 108508, 108513, 
-    108518, 108523, 108528, 108533, 108538, 108543, 108550, 108555, 108560, 
-    108565, 108570, 108575, 108580, 108585, 108590, 108595, 108600, 108605, 
-    108610, 108615, 108620, 108625, 108630, 108635, 108640, 108645, 108650, 
-    108655, 108660, 108665, 108670, 108675, 108680, 108685, 108690, 108695, 
-    108700, 108705, 108710, 108715, 108720, 108725, 108730, 108735, 108740, 
-    108745, 108750, 108755, 108760, 108765, 108770, 108775, 108780, 108785, 
-    108790, 108795, 108800, 108805, 108810, 108815, 108820, 108825, 108830, 
-    108835, 108840, 108847, 108852, 108857, 108862, 108867, 108872, 108877, 
-    108881, 108886, 108891, 108896, 108901, 108906, 108911, 108916, 108921, 
-    108926, 108931, 108936, 108941, 108946, 108951, 108958, 108963, 108968, 
-    108974, 108979, 108984, 108989, 108994, 108999, 109004, 109009, 109014, 
-    109019, 109024, 109029, 109034, 109039, 109044, 109049, 109054, 109059, 
-    109064, 109069, 109074, 109079, 109084, 109089, 109094, 109099, 109104, 
-    109109, 109114, 109119, 109124, 109129, 109134, 109139, 109144, 109149, 
-    109154, 109159, 109164, 109169, 109174, 109179, 109184, 109189, 109196, 
-    109201, 109206, 109213, 109220, 109225, 109230, 109235, 109240, 109245, 
-    109250, 109255, 109260, 109265, 109270, 109275, 109280, 109285, 109290, 
-    109295, 109300, 109305, 109310, 109315, 109320, 109325, 109330, 109335, 
-    109340, 109345, 109352, 109357, 109362, 109367, 109372, 109377, 109382, 
-    109387, 109392, 109397, 109402, 109407, 109412, 109417, 109422, 109427, 
-    109432, 109437, 109442, 109449, 109454, 109459, 109464, 109469, 109474, 
-    109479, 109484, 109490, 109495, 109500, 109505, 109510, 109515, 109520, 
-    109525, 109530, 109537, 109544, 109549, 109554, 109558, 109563, 109567, 
-    109571, 109576, 109583, 109588, 109593, 109602, 109607, 109612, 109617, 
-    109622, 109629, 109636, 109641, 109646, 109651, 109656, 109663, 109668, 
-    109673, 109678, 109683, 109688, 109693, 109698, 109703, 109708, 109713, 
-    109718, 109723, 109730, 109734, 109739, 109744, 109749, 109754, 109758, 
-    109763, 109768, 109773, 109778, 109783, 109788, 109793, 109798, 109803, 
-    109809, 109815, 109821, 109827, 109833, 109839, 109845, 109851, 109857, 
-    109863, 109869, 109875, 109880, 109886, 109892, 109898, 109904, 109910, 
-    109916, 109922, 109928, 109934, 109940, 109946, 109951, 109957, 109963, 
-    109969, 109975, 109981, 109987, 109993, 109999, 110005, 110011, 110017, 
-    110023, 110029, 110035, 110041, 110047, 110053, 110059, 110065, 110071, 
-    110076, 110082, 110088, 110094, 110100, 110106, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 110112, 110115, 110119, 
-    110123, 110127, 110130, 110134, 110139, 110143, 110147, 110151, 110155, 
-    110159, 110164, 110169, 110173, 110177, 110180, 110184, 110189, 110194, 
-    110198, 110202, 110206, 110210, 110214, 110218, 110222, 110226, 110230, 
-    110234, 110237, 110241, 110245, 110249, 110253, 110257, 110261, 110267, 
-    110270, 110274, 110278, 110282, 110286, 110290, 110294, 110298, 110302, 
-    110306, 110311, 110316, 110322, 110326, 110330, 110334, 110338, 110342, 
-    110346, 110351, 110354, 110358, 110362, 110366, 110370, 110376, 110380, 
-    110384, 110388, 110392, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 110396, 110400, 
-    110404, 110410, 110416, 110420, 110425, 110430, 110435, 110440, 110444, 
-    110449, 110454, 110459, 110463, 110468, 110473, 110478, 110482, 110487, 
-    110492, 110497, 110502, 110507, 110512, 110517, 110522, 110526, 110531, 
-    110536, 110541, 110546, 110551, 110556, 110561, 110566, 110571, 110576, 
-    110581, 110588, 110593, 110600, 110605, 110610, 110615, 110620, 110625, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 110630, 110634, 110640, 
-    110643, 110646, 110650, 110654, 110658, 110662, 110666, 110670, 110674, 
-    110680, 110686, 110692, 110698, 110704, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 110710, 110715, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    110721, 110726, 110731, 110736, 110743, 110750, 110757, 110764, 110769, 
-    110774, 110779, 110784, 110791, 110796, 110803, 110810, 110815, 110820, 
-    110825, 110832, 110837, 110842, 110849, 110856, 110861, 110866, 110871, 
-    110878, 110885, 110892, 110897, 110902, 110909, 110916, 110923, 110930, 
-    110935, 110940, 110945, 110952, 110957, 110962, 110967, 110974, 110983, 
-    110990, 110995, 111000, 111005, 111010, 111015, 111020, 111029, 111036, 
-    111041, 111048, 111055, 111060, 111065, 111070, 111077, 111082, 111089, 
-    111096, 111101, 111106, 111111, 111118, 111125, 111130, 111135, 111142, 
-    111149, 111156, 111161, 111166, 111171, 111176, 111183, 111192, 111201, 
-    111206, 111213, 111222, 111227, 111232, 111237, 111242, 111249, 111256, 
-    111263, 111270, 111275, 111280, 111285, 111292, 111299, 111306, 111311, 
-    111316, 111323, 111328, 111335, 111340, 111347, 111352, 111359, 111366, 
-    111371, 111376, 111381, 111386, 111391, 111396, 111401, 111406, 111411, 
-    111418, 111425, 111432, 111439, 111446, 111455, 111460, 111465, 111472, 
-    111479, 111484, 111491, 111498, 111505, 111512, 111519, 111526, 111531, 
-    111536, 111541, 111546, 111551, 111560, 111569, 111578, 111587, 111596, 
-    111605, 111614, 111623, 111628, 111639, 111650, 111659, 111664, 111669, 
-    111674, 111679, 111688, 111695, 111702, 111709, 111716, 111723, 111730, 
-    111739, 111748, 111759, 111768, 111779, 111788, 111795, 111804, 111815, 
-    111824, 111833, 111842, 111851, 111858, 111865, 111872, 111881, 111890, 
-    111901, 111910, 111919, 111930, 111935, 111940, 111951, 111959, 111968, 
-    111977, 111986, 111997, 112006, 112015, 112026, 112037, 112048, 112059, 
-    112070, 112081, 112088, 112095, 112102, 112109, 112120, 112129, 112136, 
-    112143, 112150, 112161, 112172, 112183, 112194, 112205, 112216, 112227, 
-    112238, 112245, 112252, 112261, 112270, 112277, 112284, 112291, 112300, 
-    112309, 112318, 112325, 112334, 112343, 112352, 112359, 112366, 112371, 
-    112377, 112384, 112391, 112398, 112405, 112412, 112419, 112428, 112437, 
-    112446, 112455, 112462, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 112471, 112477, 
-    112482, 112487, 112494, 112500, 112506, 112512, 112518, 112524, 112530, 
-    112536, 112540, 112544, 112550, 112556, 112562, 112566, 112571, 112576, 
-    112580, 112584, 112587, 112593, 112599, 112605, 112611, 112617, 112623, 
-    112629, 112635, 112641, 112651, 112661, 112667, 112673, 112683, 112693, 
-    112699, 0, 0, 112705, 112713, 112718, 112723, 112729, 112735, 112741, 
-    112747, 112753, 112759, 112766, 112773, 112779, 112785, 112791, 112797, 
-    112803, 112809, 112815, 112821, 112826, 112832, 112838, 112844, 112850, 
-    112856, 112865, 112871, 112876, 112884, 112891, 112898, 112907, 112916, 
-    112925, 112934, 112943, 112952, 112961, 112970, 112980, 112990, 112998, 
-    113006, 113015, 113024, 113030, 113036, 113042, 113048, 113056, 113064, 
-    113068, 113074, 113079, 113085, 113091, 113097, 113103, 113109, 113118, 
-    113123, 113130, 113135, 113140, 113145, 113151, 113157, 113163, 113170, 
-    113175, 113180, 113185, 113190, 113195, 113201, 113207, 113213, 113219, 
-    113225, 113231, 113237, 113243, 113248, 113253, 113258, 113263, 113268, 
-    113273, 113278, 113283, 113289, 113295, 113300, 113305, 113310, 113315, 
-    113320, 113326, 113333, 113337, 113341, 113345, 113349, 113353, 113357, 
-    113361, 113365, 113373, 113383, 113387, 113391, 113397, 113403, 113409, 
-    113415, 113421, 113427, 113433, 113439, 113445, 113451, 113457, 113463, 
-    113469, 113475, 113479, 113483, 113490, 113496, 113502, 113508, 113513, 
-    113520, 113525, 113531, 113537, 113543, 113549, 113554, 113558, 113564, 
-    113568, 113572, 113576, 113582, 113588, 113592, 113598, 113604, 113610, 
-    113616, 113622, 113630, 113638, 113644, 113650, 113656, 113662, 113674, 
-    113686, 113700, 113712, 113724, 113738, 113752, 113766, 113770, 113778, 
-    113786, 113791, 113795, 113799, 113803, 113807, 113811, 113815, 113819, 
-    113825, 113831, 113837, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 113843, 113849, 
-    113855, 113861, 113867, 113873, 113879, 113885, 113891, 113897, 113903, 
-    113909, 113915, 113921, 113927, 113933, 113939, 113945, 113951, 113957, 
-    113963, 113969, 113975, 113981, 113987, 113993, 113999, 114005, 114011, 
-    114017, 114023, 114029, 114035, 114041, 114047, 114053, 114059, 114065, 
-    114071, 114077, 114083, 114089, 114095, 114101, 114107, 114113, 114119, 
-    114125, 114131, 114137, 114143, 114149, 114155, 114161, 114167, 114173, 
-    114179, 114185, 114191, 114197, 114203, 114209, 114215, 114221, 114227, 
-    114233, 114239, 114244, 114249, 114254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 91792, 91798, 91804, 91810, 91816, 91822, 91829, 
+    91836, 91843, 91849, 91855, 91861, 91868, 91875, 91882, 91888, 91895, 
+    91902, 91909, 91916, 91922, 91929, 91936, 91942, 91949, 91956, 91963, 
+    91970, 91977, 91983, 91990, 91997, 92004, 92010, 92016, 92022, 92028, 
+    92034, 92041, 92048, 92054, 92060, 92066, 92073, 92079, 92086, 92093, 
+    92100, 92106, 92114, 92121, 92127, 92134, 92141, 92148, 92154, 0, 0, 0, 
+    0, 0, 0, 92161, 92169, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    114258, 114263, 114270, 114277, 114284, 114291, 114296, 114300, 114306, 
-    114310, 114314, 114320, 114324, 114328, 114332, 114338, 114345, 114349, 
-    114353, 114357, 114361, 114365, 114369, 114375, 114379, 114383, 114387, 
-    114391, 114395, 114399, 114403, 114407, 114411, 114415, 114419, 114423, 
-    114428, 114432, 114436, 114440, 114444, 114448, 114452, 114456, 114460, 
-    114464, 114471, 114475, 114483, 114487, 114491, 114495, 114499, 114503, 
-    114507, 114511, 114518, 114522, 114526, 114530, 114534, 114538, 114544, 
-    114548, 114554, 114558, 114562, 114566, 114570, 114574, 114578, 114582, 
-    114586, 114590, 114594, 114598, 114602, 114606, 114610, 114614, 114618, 
-    114622, 114626, 114630, 114638, 114642, 114646, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 114650, 114658, 114666, 114674, 114682, 114690, 114698, 114706, 
-    114714, 114722, 114730, 114738, 114746, 114754, 114762, 114770, 114778, 
-    114786, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 114794, 114798, 114803, 
-    114808, 114813, 114817, 114822, 114827, 114832, 114836, 114841, 114846, 
-    114850, 114854, 114859, 114863, 114868, 114873, 114877, 114882, 114887, 
-    114891, 114896, 114901, 114906, 114911, 114916, 114920, 114925, 114930, 
-    114935, 114939, 114944, 114949, 114954, 114958, 114963, 114968, 114972, 
-    114976, 114981, 114985, 114990, 114995, 114999, 115004, 115009, 115013, 
-    115018, 115023, 115028, 115033, 115038, 115042, 115047, 115052, 115057, 
-    115061, 115066, 115071, 115076, 115080, 115085, 115090, 115094, 115098, 
-    115103, 115107, 115112, 115117, 115121, 115126, 115131, 115135, 115140, 
-    115145, 115150, 115155, 115160, 115164, 115169, 115174, 115179, 115183, 
-    115188, 0, 115193, 115197, 115202, 115207, 115211, 115215, 115220, 
-    115224, 115229, 115234, 115238, 115243, 115248, 115252, 115257, 115262, 
-    115267, 115272, 115277, 115282, 115288, 115294, 115300, 115305, 115311, 
-    115317, 115323, 115328, 115334, 115340, 115345, 115350, 115356, 115361, 
-    115367, 115373, 115378, 115384, 115390, 115395, 115401, 115407, 115413, 
-    115419, 115425, 115430, 115436, 115442, 115448, 115453, 115459, 115465, 
-    115471, 115476, 115482, 115488, 115493, 115498, 115504, 115509, 115515, 
-    115521, 115526, 115532, 115538, 115543, 115549, 115555, 115561, 115567, 
-    115573, 0, 115577, 115582, 0, 0, 115587, 0, 0, 115592, 115597, 0, 0, 
-    115602, 115607, 115611, 115616, 0, 115621, 115626, 115631, 115635, 
-    115640, 115645, 115650, 115655, 115660, 115664, 115669, 115674, 0, 
-    115679, 0, 115684, 115689, 115693, 115698, 115703, 115707, 115711, 0, 
-    115716, 115721, 115726, 115730, 115735, 115740, 115744, 115749, 115754, 
-    115759, 115764, 115769, 115774, 115780, 115786, 115792, 115797, 115803, 
-    115809, 115815, 115820, 115826, 115832, 115837, 115842, 115848, 115853, 
-    115859, 115865, 115870, 115876, 115882, 115887, 115893, 115899, 115905, 
-    115911, 115917, 115922, 115928, 115934, 115940, 115945, 115951, 115957, 
-    115963, 115968, 115974, 115980, 115985, 115990, 115996, 116001, 116007, 
-    116013, 116018, 116024, 116030, 116035, 116041, 116047, 116053, 116059, 
-    116065, 116069, 0, 116074, 116079, 116083, 116088, 0, 0, 116093, 116098, 
-    116103, 116107, 116111, 116116, 116120, 116125, 0, 116130, 116135, 
-    116140, 116144, 116149, 116154, 116159, 0, 116164, 116168, 116173, 
-    116178, 116183, 116187, 116192, 116197, 116202, 116206, 116211, 116216, 
-    116220, 116224, 116229, 116233, 116238, 116243, 116247, 116252, 116257, 
-    116261, 116266, 116271, 116276, 116281, 116286, 116290, 0, 116295, 
-    116300, 116304, 116309, 0, 116314, 116318, 116323, 116328, 116332, 0, 
-    116336, 0, 0, 0, 116340, 116345, 116350, 116354, 116359, 116364, 116369, 
-    0, 116374, 116378, 116383, 116388, 116393, 116397, 116402, 116407, 
-    116412, 116416, 116421, 116426, 116430, 116434, 116439, 116443, 116448, 
-    116453, 116457, 116462, 116467, 116471, 116476, 116481, 116486, 116491, 
-    116496, 116501, 116507, 116513, 116519, 116524, 116530, 116536, 116542, 
-    116547, 116553, 116559, 116564, 116569, 116575, 116580, 116586, 116592, 
-    116597, 116603, 116609, 116614, 116620, 116626, 116632, 116638, 116644, 
-    116649, 116655, 116661, 116667, 116672, 116678, 116684, 116690, 116695, 
-    116701, 116707, 116712, 116717, 116723, 116728, 116734, 116740, 116745, 
-    116751, 116757, 116762, 116768, 116774, 116780, 116786, 116792, 116796, 
-    116801, 116806, 116811, 116815, 116820, 116825, 116830, 116834, 116839, 
-    116844, 116848, 116852, 116857, 116861, 116866, 116871, 116875, 116880, 
-    116885, 116889, 116894, 116899, 116904, 116909, 116914, 116918, 116923, 
-    116928, 116933, 116937, 116942, 116947, 116952, 116956, 116961, 116966, 
-    116970, 116974, 116979, 116983, 116988, 116993, 116997, 117002, 117007, 
-    117011, 117016, 117021, 117026, 117031, 117036, 117041, 117047, 117053, 
-    117059, 117064, 117070, 117076, 117082, 117087, 117093, 117099, 117104, 
-    117109, 117115, 117120, 117126, 117132, 117137, 117143, 117149, 117154, 
-    117160, 117166, 117172, 117178, 117184, 117189, 117195, 117201, 117207, 
-    117212, 117218, 117224, 117230, 117235, 117241, 117247, 117252, 117257, 
-    117263, 117268, 117274, 117280, 117285, 117291, 117297, 117302, 117308, 
-    117314, 117320, 117326, 117332, 117337, 117343, 117349, 117355, 117360, 
-    117366, 117372, 117378, 117383, 117389, 117395, 117400, 117405, 117411, 
-    117416, 117422, 117428, 117433, 117439, 117445, 117450, 117456, 117462, 
-    117468, 117474, 117480, 117485, 117491, 117497, 117503, 117508, 117514, 
-    117520, 117526, 117531, 117537, 117543, 117548, 117553, 117559, 117564, 
-    117570, 117576, 117581, 117587, 117593, 117598, 117604, 117610, 117616, 
-    117622, 117628, 117634, 117641, 117648, 117655, 117661, 117668, 117675, 
-    117682, 117688, 117695, 117702, 117708, 117714, 117721, 117727, 117734, 
-    117741, 117747, 117754, 117761, 117767, 117774, 117781, 117788, 117795, 
-    117802, 117808, 117815, 117822, 117829, 117835, 117842, 117849, 117856, 
-    117862, 117869, 117876, 117882, 117888, 117895, 117901, 117908, 117915, 
-    117921, 117928, 117935, 117941, 117948, 117955, 117962, 117969, 117976, 
-    117981, 117987, 117993, 117999, 118004, 118010, 118016, 118022, 118027, 
-    118033, 118039, 118044, 118049, 118055, 118060, 118066, 118072, 118077, 
-    118083, 118089, 118094, 118100, 118106, 118112, 118118, 118124, 118129, 
-    118135, 118141, 118147, 118152, 118158, 118164, 118170, 118175, 118181, 
-    118187, 118192, 118197, 118203, 118208, 118214, 118220, 118225, 118231, 
-    118237, 118242, 118248, 118254, 118260, 118266, 118272, 118278, 0, 0, 
-    118285, 118290, 118295, 118300, 118305, 118310, 118315, 118320, 118325, 
-    118330, 118335, 118340, 118345, 118350, 118355, 118360, 118365, 118370, 
-    118376, 118381, 118386, 118391, 118396, 118401, 118406, 118411, 118415, 
-    118420, 118425, 118430, 118435, 118440, 118445, 118450, 118455, 118460, 
-    118465, 118470, 118475, 118480, 118485, 118490, 118495, 118500, 118506, 
-    118511, 118516, 118521, 118526, 118531, 118536, 118541, 118547, 118552, 
-    118557, 118562, 118567, 118572, 118577, 118582, 118587, 118592, 118597, 
-    118602, 118607, 118612, 118617, 118622, 118627, 118632, 118637, 118642, 
-    118647, 118652, 118657, 118662, 118668, 118673, 118678, 118683, 118688, 
-    118693, 118698, 118703, 118707, 118712, 118717, 118722, 118727, 118732, 
-    118737, 118742, 118747, 118752, 118757, 118762, 118767, 118772, 118777, 
-    118782, 118787, 118792, 118798, 118803, 118808, 118813, 118818, 118823, 
-    118828, 118833, 118839, 118844, 118849, 118854, 118859, 118864, 118869, 
-    118875, 118881, 118887, 118893, 118899, 118905, 118911, 118917, 118923, 
-    118929, 118935, 118941, 118947, 118953, 118959, 118965, 118971, 118978, 
-    118984, 118990, 118996, 119002, 119008, 119014, 119020, 119025, 119031, 
-    119037, 119043, 119049, 119055, 119061, 119067, 119073, 119079, 119085, 
-    119091, 119097, 119103, 119109, 119115, 119121, 119127, 119134, 119140, 
-    119146, 119152, 119158, 119164, 119170, 119176, 119183, 119189, 119195, 
-    119201, 119207, 119213, 119219, 119225, 119231, 119237, 119243, 119249, 
-    119255, 119261, 119267, 119273, 119279, 119285, 119291, 119297, 119303, 
-    119309, 119315, 119321, 119328, 119334, 119340, 119346, 119352, 119358, 
-    119364, 119370, 119375, 119381, 119387, 119393, 119399, 119405, 119411, 
-    119417, 119423, 119429, 119435, 119441, 119447, 119453, 119459, 119465, 
-    119471, 119477, 119484, 119490, 119496, 119502, 119508, 119514, 119520, 
-    119526, 119533, 119539, 119545, 119551, 119557, 119563, 119569, 119576, 
-    119583, 119590, 119597, 119604, 119611, 119618, 119625, 119632, 119639, 
-    119646, 119653, 119660, 119667, 119674, 119681, 119688, 119696, 119703, 
-    119710, 119717, 119724, 119731, 119738, 119745, 119751, 119758, 119765, 
-    119772, 119779, 119786, 119793, 119800, 119807, 119814, 119821, 119828, 
-    119835, 119842, 119849, 119856, 119863, 119870, 119878, 119885, 119892, 
-    119899, 119906, 119913, 119920, 119927, 119935, 119942, 119949, 119956, 
-    119963, 119970, 119977, 119982, 0, 0, 119987, 119992, 119996, 120000, 
-    120004, 120008, 120012, 120016, 120020, 120024, 120028, 120033, 120037, 
-    120041, 120045, 120049, 120053, 120057, 120061, 120065, 120069, 120074, 
-    120078, 120082, 120086, 120090, 120094, 120098, 120102, 120106, 120110, 
-    120116, 120121, 120126, 120131, 120136, 120141, 120146, 120151, 120156, 
-    120161, 120167, 120172, 120177, 120182, 120187, 120192, 120197, 120202, 
-    120207, 120212, 120216, 120220, 120224, 0, 120228, 120232, 120236, 
-    120240, 120244, 120248, 120252, 120256, 120260, 120264, 120268, 120272, 
+    92177, 92181, 92186, 92191, 0, 92197, 92202, 0, 0, 0, 0, 0, 92207, 92213, 
+    92220, 92225, 92230, 92234, 92239, 92244, 0, 92249, 92254, 92259, 0, 
+    92264, 92269, 92274, 92279, 92284, 92289, 92294, 92299, 92304, 92309, 
+    92314, 92318, 92322, 92327, 92332, 92337, 92341, 92345, 92349, 92354, 
+    92359, 92364, 92369, 92373, 92378, 92382, 92387, 0, 0, 0, 0, 92392, 
+    92398, 92403, 0, 0, 0, 0, 92408, 92412, 92416, 92420, 92424, 92428, 
+    92433, 92438, 92444, 0, 0, 0, 0, 0, 0, 0, 0, 92450, 92456, 92463, 92469, 
+    92476, 92482, 92488, 92494, 92501, 0, 0, 0, 0, 0, 0, 0, 92507, 92515, 
+    92523, 92531, 92539, 92547, 92555, 92563, 92571, 92579, 92587, 92595, 
+    92603, 92611, 92619, 92627, 92635, 92643, 92651, 92659, 92667, 92675, 
+    92683, 92691, 92699, 92707, 92715, 92723, 92731, 92739, 92746, 92754, 
+    92762, 92766, 92771, 92776, 92781, 92786, 92791, 92796, 92801, 92805, 
+    92810, 92814, 92819, 92823, 92828, 92832, 92837, 92842, 92847, 92852, 
+    92857, 92862, 92867, 92872, 92877, 92882, 92887, 92892, 92897, 92902, 
+    92907, 92912, 92917, 92922, 92927, 92932, 92937, 92942, 92947, 92952, 
+    92957, 92962, 92967, 92972, 92977, 92982, 92987, 92992, 92997, 93002, 
+    93007, 93012, 93017, 93022, 0, 0, 0, 93027, 93032, 93041, 93049, 93058, 
+    93067, 93078, 93089, 93096, 93103, 93110, 93117, 93124, 93131, 93138, 
+    93145, 93152, 93159, 93166, 93173, 93180, 93187, 93194, 93201, 93208, 
+    93215, 93222, 93229, 93236, 0, 0, 93243, 93249, 93255, 93261, 93267, 
+    93274, 93281, 93289, 93297, 93304, 93311, 93318, 93325, 93332, 93339, 
+    93346, 93353, 93360, 93367, 93374, 93381, 93388, 93395, 93402, 93409, 
+    93416, 93423, 0, 0, 0, 0, 0, 93430, 93436, 93442, 93448, 93454, 93461, 
+    93468, 93476, 93484, 93490, 93496, 93503, 93509, 93515, 93521, 93527, 
+    93534, 93541, 93548, 93555, 93562, 93569, 93576, 93583, 93590, 93597, 
+    93604, 93611, 93618, 93625, 93632, 93639, 93646, 93653, 93660, 93667, 
+    93674, 93681, 93688, 93695, 93702, 93709, 93716, 93723, 93730, 93737, 
+    93744, 93751, 93758, 93765, 93772, 93779, 93786, 93793, 93800, 93807, 
+    93814, 93821, 93828, 93835, 93842, 93849, 93856, 93863, 93870, 93877, 
+    93884, 93891, 93898, 93905, 93912, 93919, 93926, 93933, 93940, 93947, 
+    93954, 93961, 93968, 93975, 93982, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 93989, 93993, 
+    93997, 94001, 94005, 94009, 94013, 94017, 94021, 94025, 94030, 94035, 
+    94040, 94045, 94050, 94055, 94060, 94065, 94070, 94076, 94082, 94088, 
+    94095, 94102, 94109, 94116, 94123, 94130, 94137, 94144, 94151, 0, 94158, 
+    94162, 94166, 94170, 94174, 94178, 94181, 94185, 94188, 94192, 94195, 
+    94199, 94203, 94208, 94212, 94217, 94220, 94224, 94227, 94231, 94234, 
+    94238, 94242, 94246, 94250, 94254, 94258, 94262, 94266, 94270, 94274, 
+    94278, 94282, 94286, 94290, 94294, 94298, 94302, 94306, 94309, 94312, 
+    94316, 94320, 94324, 94327, 94330, 94333, 94337, 94341, 94345, 94349, 
+    94352, 94355, 94359, 94365, 94371, 94377, 94382, 94389, 94393, 94398, 
+    94402, 94407, 94412, 94418, 94423, 94429, 94433, 94438, 94442, 94447, 
+    94450, 94453, 94457, 94462, 94468, 94473, 94479, 0, 0, 0, 0, 94484, 
+    94487, 94490, 94493, 94496, 94499, 94502, 94505, 94508, 94511, 94515, 
+    94519, 94523, 94527, 94531, 94535, 94539, 94543, 94547, 94552, 94557, 
+    94561, 94564, 94567, 94570, 94573, 94576, 94579, 94582, 94585, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 94588, 94593, 94598, 94603, 94607, 
+    94612, 94616, 94621, 94625, 94630, 94634, 94639, 94643, 94648, 94652, 
+    94657, 94662, 94667, 94672, 94677, 94682, 94687, 94692, 94697, 94702, 
+    94707, 94712, 94717, 94722, 94727, 94732, 94737, 94742, 94747, 94752, 
+    94756, 94760, 94765, 94770, 94775, 94779, 94783, 94787, 94792, 94797, 
+    94802, 94807, 94811, 94815, 94821, 94826, 94832, 94837, 94843, 94848, 
+    94854, 94859, 94865, 94870, 94875, 94880, 94885, 94889, 94894, 94900, 
+    94904, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 94909, 94916, 94923, 
+    94930, 94937, 94944, 94951, 94958, 94965, 94972, 94979, 94986, 94993, 
+    95000, 95007, 95014, 95021, 95028, 95035, 95042, 95049, 95056, 95063, 
+    95070, 95077, 0, 0, 0, 0, 0, 0, 0, 95084, 95091, 95097, 95103, 95109, 
+    95115, 95121, 95127, 95133, 95139, 0, 0, 0, 0, 0, 0, 95145, 95150, 95155, 
+    95160, 95165, 95169, 95173, 95177, 95182, 95187, 95192, 95197, 95202, 
+    95207, 95212, 95217, 95222, 95227, 95232, 95237, 95242, 95247, 95252, 
+    95257, 95262, 95267, 95272, 95277, 95282, 95287, 95292, 95297, 95302, 
+    95307, 95312, 95317, 95322, 95327, 95332, 95337, 95342, 95347, 95353, 
+    95358, 95364, 95369, 95375, 95380, 95386, 95392, 95396, 95401, 95405, 0, 
+    95409, 95414, 95418, 95422, 95426, 95430, 95434, 95438, 95442, 95446, 
+    95450, 95455, 95459, 95464, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 95469, 
+    95473, 95477, 95481, 95484, 95488, 95491, 95495, 95498, 95502, 95506, 
+    95511, 95515, 95520, 95523, 95527, 95530, 95534, 95537, 95541, 95545, 
+    95549, 95553, 95557, 95561, 95565, 95569, 95573, 95577, 95581, 95585, 
+    95589, 95593, 95597, 95601, 95605, 95609, 95612, 95615, 95619, 95623, 
+    95627, 95630, 95633, 95636, 95640, 95644, 95648, 95652, 95656, 95659, 
+    95662, 95667, 95671, 95676, 95680, 95685, 95690, 95696, 95701, 95707, 
+    95711, 95716, 95720, 95725, 95729, 95733, 95737, 95741, 95744, 95747, 
+    95751, 95755, 0, 0, 0, 0, 0, 0, 0, 95758, 95762, 95765, 95768, 95771, 
+    95774, 95777, 95780, 95783, 95786, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 95789, 95793, 95798, 95802, 95807, 95811, 95816, 95820, 95825, 95829, 
+    95834, 95838, 95843, 95848, 95853, 95858, 95863, 95868, 95873, 95878, 
+    95883, 95888, 95893, 95898, 95903, 95908, 95913, 95918, 95923, 95928, 
+    95932, 95936, 95941, 95946, 95951, 95955, 95959, 95963, 95968, 95973, 
+    95978, 95982, 95986, 95991, 95996, 96001, 96007, 96012, 96018, 96023, 
+    96029, 96034, 96040, 96045, 96051, 96056, 0, 0, 0, 0, 0, 0, 0, 0, 96061, 
+    96066, 96070, 96074, 96078, 96082, 96086, 96090, 96094, 96098, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 96102, 96105, 96110, 96116, 96124, 96129, 96135, 96143, 96149, 
+    96155, 96159, 96163, 96170, 96179, 96186, 96195, 96201, 96210, 96217, 
+    96224, 96231, 96241, 96247, 96251, 96258, 96267, 96277, 96284, 96291, 
+    96295, 96299, 96306, 96316, 96320, 96327, 96334, 96341, 96347, 96354, 
+    96361, 96368, 96375, 96379, 96383, 96387, 96394, 96398, 96405, 96412, 
+    96426, 96435, 96439, 96443, 96447, 96454, 96458, 96462, 96466, 96474, 
+    96482, 96501, 96511, 96531, 96535, 96539, 96543, 96547, 96551, 96555, 
+    96559, 96566, 96570, 96573, 96577, 96581, 96587, 96594, 96603, 96607, 
+    96616, 96625, 96633, 96637, 96644, 96648, 96652, 96656, 96660, 96671, 
+    96680, 96689, 96698, 96707, 96719, 96728, 96737, 96746, 96754, 96763, 
+    96775, 96784, 96793, 96802, 96814, 96823, 96832, 96844, 96853, 96862, 
+    96874, 96883, 96887, 96891, 96895, 96899, 96903, 96907, 96911, 96918, 
+    96922, 96926, 96937, 96941, 96945, 96952, 96958, 96964, 96968, 96975, 
+    96979, 96983, 96987, 96991, 96995, 96999, 97005, 97013, 97017, 97021, 
+    97024, 97030, 97040, 97044, 97056, 97063, 97070, 97077, 97084, 97090, 
+    97094, 97098, 97102, 97106, 97113, 97122, 97129, 97137, 97145, 97151, 
+    97155, 97159, 97163, 97167, 97173, 97182, 97194, 97201, 97208, 97217, 
+    97228, 97234, 97243, 97252, 97259, 97268, 97275, 97282, 97292, 97299, 
+    97306, 97313, 97320, 97324, 97330, 97334, 97345, 97353, 97362, 97374, 
+    97381, 97388, 97398, 97405, 97414, 97421, 97430, 97437, 97444, 97454, 
+    97461, 97468, 97478, 97485, 97497, 97506, 97513, 97520, 97527, 97536, 
+    97546, 97559, 97566, 97576, 97586, 97593, 97602, 97615, 97622, 97629, 
+    97636, 97646, 97656, 97663, 97673, 97680, 97687, 97697, 97703, 97710, 
+    97717, 97724, 97734, 97741, 97748, 97755, 97761, 97768, 97778, 97785, 
+    97789, 97797, 97801, 97813, 97817, 97831, 97835, 97839, 97843, 97847, 
+    97853, 97860, 97868, 97872, 97876, 97880, 97884, 97891, 97895, 97901, 
+    97907, 97915, 97919, 97926, 97934, 97938, 97942, 97948, 97952, 97961, 
+    97970, 97977, 97987, 97993, 97997, 98001, 98009, 98016, 98023, 98029, 
+    98033, 98041, 98045, 98052, 98064, 98071, 98081, 98087, 98091, 98100, 
+    98107, 98116, 98120, 98124, 98131, 98135, 98139, 98143, 98147, 98150, 
+    98156, 98162, 98166, 98170, 98177, 98184, 98191, 98198, 98205, 98212, 
+    98219, 98226, 98232, 98236, 98240, 98247, 98254, 98261, 98268, 98275, 
+    98279, 98282, 98287, 98291, 98295, 98304, 98313, 98317, 98321, 98327, 
+    98333, 98350, 98356, 98360, 98369, 98373, 98377, 98384, 98392, 98400, 
+    98406, 98410, 98414, 98418, 98422, 98425, 98431, 98438, 98448, 98455, 
+    98462, 98469, 98475, 98482, 98489, 98496, 98503, 98510, 98519, 98526, 
+    98538, 98545, 98552, 98562, 98573, 98580, 98587, 98594, 98601, 98608, 
+    98615, 98622, 98629, 98636, 98643, 98653, 98663, 98673, 98680, 98690, 
+    98697, 98704, 98711, 98718, 98724, 98731, 98738, 98745, 98752, 98759, 
+    98766, 98773, 98780, 98786, 98793, 98800, 98809, 98816, 98823, 98827, 
+    98835, 98839, 98843, 98847, 98851, 98855, 98862, 98866, 98875, 98879, 
+    98886, 98894, 98898, 98902, 98906, 98919, 98935, 98939, 98943, 98950, 
+    98956, 98963, 98967, 98971, 98975, 98979, 98983, 98990, 98994, 99012, 
+    99016, 99020, 99027, 99031, 99035, 99041, 99045, 99049, 99057, 99061, 
+    99065, 99069, 99073, 99079, 99090, 99099, 99108, 99115, 99122, 99133, 
+    99140, 99147, 99154, 99161, 99168, 99175, 99182, 99192, 99198, 99205, 
+    99215, 99224, 99231, 99240, 99250, 99257, 99264, 99271, 99278, 99290, 
+    99297, 99304, 99311, 99318, 99325, 99335, 99342, 99349, 99359, 99372, 
+    99384, 99391, 99401, 99408, 99415, 99422, 99436, 99442, 99450, 99460, 
+    99470, 99477, 99484, 99490, 99494, 99501, 99511, 99517, 99530, 99534, 
+    99538, 99545, 99549, 99556, 99566, 99570, 99574, 99578, 99582, 99586, 
+    99593, 99597, 99604, 99611, 99618, 99627, 99636, 99646, 99653, 99660, 
+    99667, 99677, 99684, 99694, 99701, 99711, 99718, 99725, 99735, 99745, 
+    99752, 99758, 99766, 99774, 99780, 99786, 99790, 99794, 99801, 99809, 
+    99815, 99819, 99823, 99827, 99834, 99846, 99849, 99856, 99862, 99866, 
+    99870, 99874, 99878, 99882, 99886, 99890, 99894, 99898, 99902, 99909, 
+    99913, 99919, 99923, 99927, 99931, 99937, 99944, 99951, 99958, 99969, 
+    99977, 99981, 99987, 99996, 100003, 100009, 100012, 100016, 100020, 
+    100026, 100035, 100043, 100047, 100053, 100057, 100061, 100065, 100071, 
+    100078, 100084, 100088, 100094, 100098, 100102, 100111, 100123, 100127, 
+    100134, 100141, 100151, 100158, 100170, 100177, 100184, 100191, 100202, 
+    100212, 100225, 100235, 100242, 100246, 100250, 100254, 100258, 100267, 
+    100276, 100285, 100302, 100311, 100317, 100324, 100332, 100345, 100349, 
+    100358, 100367, 100376, 100385, 100396, 100405, 100414, 100423, 100432, 
+    100441, 100450, 100460, 100463, 100467, 100471, 100475, 100479, 100483, 
+    100489, 100496, 100503, 100510, 100516, 100522, 100529, 100535, 100542, 
+    100550, 100554, 100561, 100568, 100575, 100583, 100586, 100590, 100594, 
+    100598, 100601, 100607, 100611, 100617, 100624, 100631, 100637, 100644, 
+    100651, 100658, 100665, 100672, 100679, 100686, 100693, 100700, 100707, 
+    100714, 100721, 100728, 100735, 100741, 100745, 100754, 100758, 100762, 
+    100766, 100770, 100776, 100783, 100790, 100797, 100804, 100811, 100817, 
+    100825, 100829, 100833, 100837, 100841, 100847, 100864, 100881, 100885, 
+    100889, 100893, 100897, 100901, 100905, 100911, 100918, 100922, 100928, 
+    100935, 100942, 100949, 100956, 100963, 100972, 100979, 100986, 100993, 
+    101000, 101004, 101008, 101014, 101026, 101030, 101034, 101043, 101047, 
+    101051, 101055, 101061, 101065, 101069, 101078, 101082, 101086, 101090, 
+    101097, 101101, 101105, 101109, 101113, 101117, 101121, 101125, 101129, 
+    101135, 101142, 101149, 101155, 101159, 101176, 101182, 101186, 101192, 
+    101198, 101204, 101210, 101216, 101222, 101226, 101230, 101234, 101240, 
+    101244, 101250, 101254, 101258, 101265, 101272, 101289, 101293, 101297, 
+    101301, 101305, 101309, 101321, 101324, 101329, 101334, 101349, 101359, 
+    101371, 101375, 101379, 101383, 101389, 101396, 101403, 101413, 101425, 
+    101431, 101437, 101446, 101450, 101454, 101461, 101471, 101478, 101484, 
+    101488, 101492, 101499, 101505, 101509, 101515, 101519, 101527, 101533, 
+    101537, 101545, 101553, 101560, 101566, 101573, 101580, 101590, 101600, 
+    101604, 101608, 101612, 101616, 101622, 101629, 101635, 101642, 101649, 
+    101656, 101665, 101672, 101679, 101685, 101692, 101699, 101706, 101713, 
+    101720, 101727, 101733, 101740, 101747, 101754, 101763, 101770, 101777, 
+    101781, 101787, 101791, 101797, 101804, 101811, 101818, 101822, 101826, 
+    101830, 101834, 101838, 101845, 101849, 101853, 101859, 101867, 101871, 
+    101875, 101879, 101883, 101890, 101894, 101898, 101906, 101910, 101914, 
+    101918, 101922, 101928, 101932, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 101936, 101942, 101948, 101955, 101962, 101969, 101976, 101983, 
+    101990, 101996, 102003, 102010, 102017, 102024, 102031, 102038, 102044, 
+    102050, 102056, 102062, 102068, 102074, 102080, 102086, 102092, 102099, 
+    102106, 102113, 102120, 102127, 102134, 102140, 102146, 102152, 102159, 
+    102166, 102172, 102178, 102187, 102194, 102201, 102208, 102215, 102222, 
+    102229, 102235, 102241, 102247, 102256, 102263, 102270, 102281, 102292, 
+    102298, 102304, 102310, 102319, 102326, 102333, 102343, 102353, 102364, 
+    102375, 102387, 102400, 102411, 102422, 102434, 102447, 102458, 102469, 
+    102480, 102491, 102502, 102514, 102522, 102530, 102539, 102548, 102557, 
+    102563, 102569, 102575, 102582, 102592, 102599, 102609, 102614, 102619, 
+    102625, 102631, 102639, 102647, 102656, 102667, 102678, 102686, 102694, 
+    102703, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 102712, 102723, 102730, 
+    102738, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 102746, 102750, 102754, 
+    102758, 102762, 102766, 102770, 102774, 102778, 102782, 102786, 102790, 
+    102794, 102798, 102802, 102806, 102810, 102814, 102818, 102822, 102826, 
+    102830, 102834, 102838, 102842, 102846, 102850, 102854, 102858, 102862, 
+    102866, 102870, 102874, 102878, 102882, 102886, 102890, 102894, 102898, 
+    102902, 102906, 102910, 102914, 102918, 102922, 102926, 102930, 102934, 
+    102938, 102942, 102946, 102950, 102954, 102958, 102962, 102966, 102970, 
+    102974, 102978, 102982, 102986, 102990, 102994, 102998, 103002, 103006, 
+    103010, 103014, 103018, 103022, 103026, 103030, 103034, 103038, 103042, 
+    103046, 103050, 103054, 103058, 103062, 103066, 103070, 103074, 103078, 
+    103082, 103086, 103090, 103094, 103098, 103102, 103106, 103110, 103114, 
+    103118, 103122, 103126, 103130, 103134, 103138, 103142, 103146, 103150, 
+    103154, 103158, 103162, 103166, 103170, 103174, 103178, 103182, 103186, 
+    103190, 103194, 103198, 103202, 103206, 103210, 103214, 103218, 103222, 
+    103226, 103230, 103234, 103238, 103242, 103246, 103250, 103254, 103258, 
+    103262, 103266, 103270, 103274, 103278, 103282, 103286, 103290, 103294, 
+    103298, 103302, 103306, 103310, 103314, 103318, 103322, 103326, 103330, 
+    103334, 103338, 103342, 103346, 103350, 103354, 103358, 103362, 103366, 
+    103370, 103374, 103378, 103382, 103386, 103390, 103394, 103398, 103402, 
+    103406, 103410, 103414, 103418, 103422, 103426, 103430, 103434, 103438, 
+    103442, 103446, 103450, 103454, 103458, 103462, 103466, 103470, 103474, 
+    103478, 103482, 103486, 103490, 103494, 103498, 103502, 103506, 103510, 
+    103514, 103518, 103522, 103526, 103530, 103534, 103538, 103542, 103546, 
+    103550, 103554, 103558, 103562, 103566, 103570, 103574, 103578, 103582, 
+    103586, 103590, 103594, 103598, 103602, 103606, 103610, 103614, 103618, 
+    103622, 103626, 103630, 103634, 103638, 103642, 103646, 103650, 103654, 
+    103658, 103662, 103666, 103670, 103674, 103678, 103682, 103686, 103690, 
+    103694, 103698, 103702, 103706, 103710, 103714, 103718, 103722, 103726, 
+    103730, 103734, 103738, 103742, 103746, 103750, 103754, 103758, 103762, 
+    103766, 103770, 103774, 103778, 103782, 103786, 103790, 103794, 103798, 
+    103802, 103806, 103810, 103814, 103818, 103822, 103826, 103830, 103834, 
+    103838, 103842, 103846, 103850, 103854, 103858, 103862, 103866, 103870, 
+    103874, 103878, 103882, 103886, 103890, 103894, 103898, 103902, 103906, 
+    103910, 103914, 103918, 103922, 103926, 103930, 103934, 103938, 103942, 
+    103946, 103950, 103954, 103958, 103962, 103966, 103970, 103974, 103978, 
+    103982, 103986, 103990, 103994, 103998, 104002, 104006, 104010, 104014, 
+    104018, 104022, 104026, 104030, 104034, 104038, 104042, 104046, 104050, 
+    104054, 104058, 104062, 104066, 104070, 104074, 104078, 104082, 104086, 
+    104090, 104094, 104098, 104102, 104106, 104110, 104114, 104118, 104122, 
+    104126, 104130, 104134, 104138, 104142, 104146, 104150, 104154, 104158, 
+    104162, 104166, 104170, 104174, 104178, 104182, 104186, 104190, 104194, 
+    104198, 104202, 104206, 104210, 104214, 104218, 104222, 104226, 104230, 
+    104234, 104238, 104242, 104246, 104250, 104254, 104258, 104262, 104266, 
+    104270, 104274, 104278, 104282, 104286, 104290, 104294, 104298, 104302, 
+    104306, 104310, 104314, 104318, 104322, 104326, 104330, 104334, 104338, 
+    104342, 104346, 104350, 104354, 104358, 104362, 104366, 104370, 104374, 
+    104378, 104382, 104386, 104390, 104394, 104398, 104402, 104406, 104410, 
+    104414, 104418, 104422, 104426, 104430, 104434, 104438, 104442, 104446, 
+    104450, 104454, 104458, 104462, 104466, 104470, 104474, 104478, 104482, 
+    104486, 104490, 104494, 104498, 104502, 104506, 104510, 104514, 104518, 
+    104522, 104526, 104530, 104534, 104538, 104542, 104546, 104550, 104554, 
+    104558, 104562, 104566, 104570, 104574, 104578, 104582, 104586, 104590, 
+    104594, 104598, 104602, 104606, 104610, 104614, 104618, 104622, 104626, 
+    104630, 104634, 104638, 104642, 104646, 104650, 104654, 104658, 104662, 
+    104666, 104670, 104674, 104678, 104682, 104686, 104690, 104694, 104698, 
+    104702, 104706, 104710, 104714, 104718, 104722, 104726, 104730, 104734, 
+    104738, 104742, 104746, 104750, 104754, 104758, 104762, 104766, 104770, 
+    104774, 104778, 104782, 104786, 104790, 104794, 104798, 104802, 104806, 
+    104810, 104814, 104818, 104822, 104826, 104830, 104834, 104838, 104842, 
+    104846, 104850, 104854, 104858, 104862, 104866, 104870, 104874, 104878, 
+    104882, 104886, 104890, 104894, 104898, 104902, 104906, 104910, 104914, 
+    104918, 104922, 104926, 104930, 104934, 104938, 104942, 104946, 104950, 
+    104954, 104958, 104962, 104966, 104970, 104974, 104978, 104982, 104986, 
+    104990, 104994, 104998, 105002, 105006, 105010, 105014, 105018, 105022, 
+    105026, 105030, 105034, 105038, 105042, 105046, 105050, 105054, 105058, 
+    105062, 105066, 105070, 105074, 105078, 105082, 105086, 105090, 105094, 
+    105098, 105102, 105106, 105110, 105114, 105118, 105122, 105126, 105130, 
+    105134, 105138, 105142, 105146, 105150, 105154, 105158, 105162, 105166, 
+    105170, 105174, 105178, 105182, 105186, 105190, 105194, 105198, 105202, 
+    105206, 105210, 105214, 105218, 105222, 105226, 105230, 105234, 105238, 
+    105242, 105246, 105250, 105254, 105258, 105262, 105266, 105270, 105274, 
+    105278, 105282, 105286, 105290, 105294, 105298, 105302, 105306, 105310, 
+    105314, 105318, 105322, 105326, 105330, 105334, 105338, 105342, 105346, 
+    105350, 105354, 105358, 105362, 105366, 105370, 105374, 105378, 105382, 
+    105386, 105390, 105394, 105398, 105402, 105406, 105410, 105414, 105418, 
+    105422, 105426, 105430, 105434, 105438, 105442, 105446, 105450, 105454, 
+    105458, 105462, 105466, 105470, 105474, 105478, 105482, 105486, 105490, 
+    105494, 105498, 105502, 105506, 105510, 105514, 105518, 105522, 105526, 
+    105530, 105534, 105538, 105542, 105546, 105550, 105554, 105558, 105562, 
+    105566, 105570, 105574, 105578, 105582, 105586, 105590, 105594, 105598, 
+    105602, 105606, 105610, 105614, 105618, 105622, 105626, 105630, 105634, 
+    105638, 105642, 105646, 105650, 105654, 105658, 105662, 105666, 105670, 
+    105674, 105678, 105682, 105686, 105690, 105694, 105698, 105702, 105706, 
+    105710, 105714, 105718, 105722, 105726, 105730, 105734, 105738, 105742, 
+    105746, 105750, 105754, 105758, 105762, 105766, 105770, 105774, 105778, 
+    105782, 105786, 105790, 105794, 105798, 105802, 105806, 105810, 105814, 
+    105818, 105822, 105826, 105830, 105834, 105838, 105842, 105846, 105850, 
+    105854, 105858, 105862, 105866, 105870, 105874, 105878, 105882, 105886, 
+    105890, 105894, 105898, 105902, 105906, 105910, 105914, 105918, 105922, 
+    105926, 105930, 105934, 105938, 105942, 105946, 105950, 105954, 105958, 
+    105962, 105966, 105970, 105974, 105978, 105982, 105986, 105990, 105994, 
+    105998, 106002, 106006, 106010, 106014, 106018, 106022, 106026, 106030, 
+    106034, 106038, 106042, 106046, 106050, 106054, 106058, 106062, 106066, 
+    106070, 106074, 106078, 106082, 106086, 106090, 106094, 106098, 106102, 
+    106106, 106110, 106114, 106118, 106122, 106126, 106130, 106134, 106138, 
+    106142, 106146, 106150, 106154, 106158, 106162, 106166, 106170, 106174, 
+    106178, 106182, 106186, 106190, 106194, 106198, 106202, 106206, 106210, 
+    106214, 106218, 106222, 106226, 106230, 106234, 106238, 106242, 106246, 
+    106250, 106254, 106258, 106262, 106266, 106270, 106274, 106278, 106282, 
+    106286, 106290, 106294, 106298, 106302, 106306, 106310, 106314, 106318, 
+    106322, 106326, 106330, 106334, 106338, 106342, 106346, 106350, 106354, 
+    106358, 106362, 106366, 106370, 106374, 106378, 106382, 106386, 106390, 
+    106394, 106398, 106402, 106406, 106410, 106414, 106418, 106422, 106426, 
+    106430, 106434, 106438, 106442, 106446, 106450, 106454, 106458, 106462, 
+    106466, 106470, 106474, 106478, 106482, 106486, 106490, 106494, 106498, 
+    106502, 106506, 106510, 106514, 106518, 106522, 106526, 106530, 106534, 
+    106538, 106542, 106546, 106550, 106554, 106558, 106562, 106566, 106570, 
+    106574, 106578, 106582, 106586, 106590, 106594, 106598, 106602, 106606, 
+    106610, 106614, 106618, 106622, 106626, 106630, 106634, 106638, 106642, 
+    106646, 106650, 106654, 106658, 106662, 106666, 106670, 106674, 106678, 
+    106682, 106686, 106690, 106694, 106698, 106702, 106706, 106710, 106714, 
+    106718, 106722, 106726, 106730, 106734, 106738, 106742, 106746, 106750, 
+    106754, 106758, 106762, 106766, 106770, 106774, 106778, 106782, 106786, 
+    106790, 106794, 106798, 106802, 106806, 106810, 106814, 106818, 106822, 
+    106826, 106830, 106834, 106838, 106842, 106846, 106850, 106854, 106858, 
+    106862, 106866, 106870, 106874, 106878, 106882, 106886, 106890, 106894, 
+    106898, 106902, 106906, 106910, 106914, 106918, 106922, 106926, 106930, 
+    106934, 106938, 106942, 106946, 106950, 106954, 106958, 106962, 106966, 
+    106970, 106974, 106978, 106982, 106986, 106990, 106994, 106998, 107002, 
+    107006, 107010, 107014, 107018, 107022, 107026, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 107030, 107037, 107044, 107053, 107062, 107069, 107074, 107081, 
+    107088, 107097, 107108, 107119, 107124, 107131, 107136, 107141, 107146, 
+    107151, 107156, 107161, 107166, 107171, 107176, 107181, 107186, 107193, 
+    107200, 107205, 107210, 107215, 107220, 107227, 107234, 107242, 107247, 
+    107254, 107259, 107264, 107269, 107274, 107279, 107286, 107293, 107298, 
+    107303, 107308, 107313, 107318, 107323, 107328, 107333, 107338, 107343, 
+    107348, 107353, 107358, 107363, 107368, 107373, 107378, 107383, 107388, 
+    107395, 107400, 107405, 107414, 107421, 107426, 107431, 107436, 107441, 
+    107446, 107451, 107456, 107461, 107466, 107471, 107476, 107481, 107486, 
+    107491, 107496, 107501, 107506, 107511, 107516, 107521, 107526, 107532, 
+    107540, 107546, 107554, 107562, 107570, 107576, 107582, 107588, 107594, 
+    107600, 107608, 107618, 107626, 107634, 107640, 107646, 107654, 107662, 
+    107668, 107676, 107684, 107692, 107698, 107704, 107710, 107716, 107722, 
+    107728, 107736, 107744, 107750, 107756, 107762, 107768, 107774, 107782, 
+    107788, 107794, 107800, 107806, 107812, 107818, 107826, 107832, 107838, 
+    107844, 107850, 107858, 107866, 107872, 107878, 107884, 107889, 107895, 
+    107901, 107908, 107913, 107918, 107923, 107928, 107933, 107938, 107943, 
+    107948, 107953, 107962, 107969, 107974, 107979, 107984, 107991, 107996, 
+    108001, 108006, 108013, 108018, 108023, 108028, 108033, 108038, 108043, 
+    108048, 108053, 108058, 108063, 108068, 108075, 108080, 108087, 108092, 
+    108097, 108104, 108109, 108114, 108119, 108124, 108129, 108134, 108139, 
+    108144, 108149, 108154, 108159, 108164, 108169, 108174, 108179, 108184, 
+    108189, 108194, 108199, 108206, 108211, 108216, 108221, 108226, 108231, 
+    108236, 108241, 108246, 108251, 108256, 108261, 108266, 108271, 108278, 
+    108283, 108288, 108295, 108300, 108305, 108310, 108315, 108320, 108325, 
+    108330, 108335, 108340, 108345, 108352, 108357, 108362, 108367, 108372, 
+    108377, 108384, 108391, 108396, 108401, 108406, 108411, 108416, 108421, 
+    108426, 108431, 108436, 108441, 108446, 108451, 108456, 108461, 108466, 
+    108471, 108476, 108481, 108486, 108491, 108496, 108501, 108506, 108511, 
+    108516, 108521, 108526, 108531, 108536, 108541, 108546, 108551, 108556, 
+    108561, 108566, 108571, 108578, 108583, 108588, 108593, 108598, 108603, 
+    108608, 108613, 108618, 108623, 108628, 108633, 108638, 108643, 108648, 
+    108653, 108658, 108663, 108668, 108673, 108678, 108683, 108688, 108693, 
+    108698, 108703, 108708, 108713, 108718, 108723, 108728, 108733, 108738, 
+    108743, 108748, 108753, 108758, 108763, 108768, 108773, 108778, 108783, 
+    108788, 108793, 108798, 108803, 108808, 108813, 108818, 108823, 108828, 
+    108833, 108838, 108843, 108848, 108853, 108858, 108863, 108868, 108875, 
+    108880, 108885, 108890, 108895, 108900, 108905, 108909, 108914, 108919, 
+    108924, 108929, 108934, 108939, 108944, 108949, 108954, 108959, 108964, 
+    108969, 108974, 108979, 108986, 108991, 108996, 109002, 109007, 109012, 
+    109017, 109022, 109027, 109032, 109037, 109042, 109047, 109052, 109057, 
+    109062, 109067, 109072, 109077, 109082, 109087, 109092, 109097, 109102, 
+    109107, 109112, 109117, 109122, 109127, 109132, 109137, 109142, 109147, 
+    109152, 109157, 109162, 109167, 109172, 109177, 109182, 109187, 109192, 
+    109197, 109202, 109207, 109212, 109217, 109224, 109229, 109234, 109241, 
+    109248, 109253, 109258, 109263, 109268, 109273, 109278, 109283, 109288, 
+    109293, 109298, 109303, 109308, 109313, 109318, 109323, 109328, 109333, 
+    109338, 109343, 109348, 109353, 109358, 109363, 109368, 109373, 109380, 
+    109385, 109390, 109395, 109400, 109405, 109410, 109415, 109420, 109425, 
+    109430, 109435, 109440, 109445, 109450, 109455, 109460, 109465, 109470, 
+    109477, 109482, 109487, 109492, 109497, 109502, 109507, 109512, 109518, 
+    109523, 109528, 109533, 109538, 109543, 109548, 109553, 109558, 109565, 
+    109572, 109577, 109582, 109586, 109591, 109595, 109599, 109604, 109611, 
+    109616, 109621, 109630, 109635, 109640, 109645, 109650, 109657, 109664, 
+    109669, 109674, 109679, 109684, 109691, 109696, 109701, 109706, 109711, 
+    109716, 109721, 109726, 109731, 109736, 109741, 109746, 109751, 109758, 
+    109762, 109767, 109772, 109777, 109782, 109786, 109791, 109796, 109801, 
+    109806, 109811, 109816, 109821, 109826, 109831, 109837, 109843, 109849, 
+    109855, 109861, 109867, 109873, 109879, 109885, 109891, 109897, 109903, 
+    109908, 109914, 109920, 109926, 109932, 109938, 109944, 109950, 109956, 
+    109962, 109968, 109974, 109979, 109985, 109991, 109997, 110003, 110009, 
+    110015, 110021, 110027, 110033, 110039, 110045, 110051, 110057, 110063, 
+    110069, 110075, 110081, 110087, 110093, 110099, 110104, 110110, 110116, 
+    110122, 110128, 110134, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 110140, 110143, 110147, 110151, 110155, 110158, 
+    110162, 110167, 110171, 110175, 110179, 110183, 110187, 110192, 110197, 
+    110201, 110205, 110208, 110212, 110217, 110222, 110226, 110230, 110234, 
+    110238, 110242, 110246, 110250, 110254, 110258, 110262, 110265, 110269, 
+    110273, 110277, 110281, 110285, 110289, 110295, 110298, 110302, 110306, 
+    110310, 110314, 110318, 110322, 110326, 110330, 110334, 110339, 110344, 
+    110350, 110354, 110358, 110362, 110366, 110370, 110374, 110379, 110382, 
+    110386, 110390, 110394, 110398, 110404, 110408, 110412, 110416, 110420, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 110424, 110428, 110432, 110438, 110444, 
+    110448, 110453, 110458, 110463, 110468, 110472, 110477, 110482, 110487, 
+    110491, 110496, 110501, 110506, 110510, 110515, 110520, 110525, 110530, 
+    110535, 110540, 110545, 110550, 110554, 110559, 110564, 110569, 110574, 
+    110579, 110584, 110589, 110594, 110599, 110604, 110609, 110616, 110621, 
+    110628, 110633, 110638, 110643, 110648, 110653, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 110658, 110662, 110668, 110671, 110674, 110678, 
+    110682, 110686, 110690, 110694, 110698, 110702, 110708, 110714, 110720, 
+    110726, 110732, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 110738, 110743, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 110749, 110754, 110759, 
+    110764, 110771, 110778, 110785, 110792, 110797, 110802, 110807, 110812, 
+    110819, 110824, 110831, 110838, 110843, 110848, 110853, 110860, 110865, 
+    110870, 110877, 110884, 110889, 110894, 110899, 110906, 110913, 110920, 
+    110925, 110930, 110937, 110944, 110951, 110958, 110963, 110968, 110973, 
+    110980, 110985, 110990, 110995, 111002, 111011, 111018, 111023, 111028, 
+    111033, 111038, 111043, 111048, 111057, 111064, 111069, 111076, 111083, 
+    111088, 111093, 111098, 111105, 111110, 111117, 111124, 111129, 111134, 
+    111139, 111146, 111153, 111158, 111163, 111170, 111177, 111184, 111189, 
+    111194, 111199, 111204, 111211, 111220, 111229, 111234, 111241, 111250, 
+    111255, 111260, 111265, 111270, 111277, 111284, 111291, 111298, 111303, 
+    111308, 111313, 111320, 111327, 111334, 111339, 111344, 111351, 111356, 
+    111363, 111368, 111375, 111380, 111387, 111394, 111399, 111404, 111409, 
+    111414, 111419, 111424, 111429, 111434, 111439, 111446, 111453, 111460, 
+    111467, 111474, 111483, 111488, 111493, 111500, 111507, 111512, 111519, 
+    111526, 111533, 111540, 111547, 111554, 111559, 111564, 111569, 111574, 
+    111579, 111588, 111597, 111606, 111615, 111624, 111633, 111642, 111651, 
+    111656, 111667, 111678, 111687, 111692, 111697, 111702, 111707, 111716, 
+    111723, 111730, 111737, 111744, 111751, 111758, 111767, 111776, 111787, 
+    111796, 111807, 111816, 111823, 111832, 111843, 111852, 111861, 111870, 
+    111879, 111886, 111893, 111900, 111909, 111918, 111929, 111938, 111947, 
+    111958, 111963, 111968, 111979, 111987, 111996, 112005, 112014, 112025, 
+    112034, 112043, 112054, 112065, 112076, 112087, 112098, 112109, 112116, 
+    112123, 112130, 112137, 112148, 112157, 112164, 112171, 112178, 112189, 
+    112200, 112211, 112222, 112233, 112244, 112255, 112266, 112273, 112280, 
+    112289, 112298, 112305, 112312, 112319, 112328, 112337, 112346, 112353, 
+    112362, 112371, 112380, 112387, 112394, 112399, 112405, 112412, 112419, 
+    112426, 112433, 112440, 112447, 112456, 112465, 112474, 112483, 112490, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 112499, 112505, 112510, 112515, 112522, 
+    112528, 112534, 112540, 112546, 112552, 112558, 112564, 112568, 112572, 
+    112578, 112584, 112590, 112594, 112599, 112604, 112608, 112612, 112615, 
+    112621, 112627, 112633, 112639, 112645, 112651, 112657, 112663, 112669, 
+    112679, 112689, 112695, 112701, 112711, 112721, 112727, 0, 0, 112733, 
+    112741, 112746, 112751, 112757, 112763, 112769, 112775, 112781, 112787, 
+    112794, 112801, 112807, 112813, 112819, 112825, 112831, 112837, 112843, 
+    112849, 112854, 112860, 112866, 112872, 112878, 112884, 112893, 112899, 
+    112904, 112912, 112919, 112926, 112935, 112944, 112953, 112962, 112971, 
+    112980, 112989, 112998, 113008, 113018, 113026, 113034, 113043, 113052, 
+    113058, 113064, 113070, 113076, 113084, 113092, 113096, 113102, 113107, 
+    113113, 113119, 113125, 113131, 113137, 113146, 113151, 113158, 113163, 
+    113168, 113173, 113179, 113185, 113191, 113198, 113203, 113208, 113213, 
+    113218, 113223, 113229, 113235, 113241, 113247, 113253, 113259, 113265, 
+    113271, 113276, 113281, 113286, 113291, 113296, 113301, 113306, 113311, 
+    113317, 113323, 113328, 113333, 113338, 113343, 113348, 113354, 113361, 
+    113365, 113369, 113373, 113377, 113381, 113385, 113389, 113393, 113401, 
+    113411, 113415, 113419, 113425, 113431, 113437, 113443, 113449, 113455, 
+    113461, 113467, 113473, 113479, 113485, 113491, 113497, 113503, 113507, 
+    113511, 113518, 113524, 113530, 113536, 113541, 113548, 113553, 113559, 
+    113565, 113571, 113577, 113582, 113586, 113592, 113596, 113600, 113604, 
+    113610, 113616, 113620, 113626, 113632, 113638, 113644, 113650, 113658, 
+    113666, 113672, 113678, 113684, 113690, 113702, 113714, 113728, 113740, 
+    113752, 113766, 113780, 113794, 113798, 113806, 113814, 113819, 113823, 
+    113827, 113831, 113835, 113839, 113843, 113847, 113853, 113859, 113865, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 113871, 113877, 113883, 113889, 113895, 
+    113901, 113907, 113913, 113919, 113925, 113931, 113937, 113943, 113949, 
+    113955, 113961, 113967, 113973, 113979, 113985, 113991, 113997, 114003, 
+    114009, 114015, 114021, 114027, 114033, 114039, 114045, 114051, 114057, 
+    114063, 114069, 114075, 114081, 114087, 114093, 114099, 114105, 114111, 
+    114117, 114123, 114129, 114135, 114141, 114147, 114153, 114159, 114165, 
+    114171, 114177, 114183, 114189, 114195, 114201, 114207, 114213, 114219, 
+    114225, 114231, 114237, 114243, 114249, 114255, 114261, 114267, 114272, 
+    114277, 114282, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 114286, 114291, 114298, 
+    114305, 114312, 114319, 114324, 114328, 114334, 114338, 114342, 114348, 
+    114352, 114356, 114360, 114366, 114373, 114377, 114381, 114385, 114389, 
+    114393, 114397, 114403, 114407, 114411, 114415, 114419, 114423, 114427, 
+    114431, 114435, 114439, 114443, 114447, 114451, 114456, 114460, 114464, 
+    114468, 114472, 114476, 114480, 114484, 114488, 114492, 114499, 114503, 
+    114511, 114515, 114519, 114523, 114527, 114531, 114535, 114539, 114546, 
+    114550, 114554, 114558, 114562, 114566, 114572, 114576, 114582, 114586, 
+    114590, 114594, 114598, 114602, 114606, 114610, 114614, 114618, 114622, 
+    114626, 114630, 114634, 114638, 114642, 114646, 114650, 114654, 114658, 
+    114666, 114670, 114674, 0, 0, 0, 0, 0, 0, 0, 0, 0, 114678, 114686, 
+    114694, 114702, 114710, 114718, 114726, 114734, 114742, 114750, 114758, 
+    114766, 114774, 114782, 114790, 114798, 114806, 114814, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 114822, 114826, 114831, 114836, 114841, 114845, 
+    114850, 114855, 114860, 114864, 114869, 114874, 114878, 114882, 114887, 
+    114891, 114896, 114901, 114905, 114910, 114915, 114919, 114924, 114929, 
+    114934, 114939, 114944, 114948, 114953, 114958, 114963, 114967, 114972, 
+    114977, 114982, 114986, 114991, 114996, 115000, 115004, 115009, 115013, 
+    115018, 115023, 115027, 115032, 115037, 115041, 115046, 115051, 115056, 
+    115061, 115066, 115070, 115075, 115080, 115085, 115089, 115094, 115099, 
+    115104, 115108, 115113, 115118, 115122, 115126, 115131, 115135, 115140, 
+    115145, 115149, 115154, 115159, 115163, 115168, 115173, 115178, 115183, 
+    115188, 115192, 115197, 115202, 115207, 115211, 115216, 0, 115221, 
+    115225, 115230, 115235, 115239, 115243, 115248, 115252, 115257, 115262, 
+    115266, 115271, 115276, 115280, 115285, 115290, 115295, 115300, 115305, 
+    115310, 115316, 115322, 115328, 115333, 115339, 115345, 115351, 115356, 
+    115362, 115368, 115373, 115378, 115384, 115389, 115395, 115401, 115406, 
+    115412, 115418, 115423, 115429, 115435, 115441, 115447, 115453, 115458, 
+    115464, 115470, 115476, 115481, 115487, 115493, 115499, 115504, 115510, 
+    115516, 115521, 115526, 115532, 115537, 115543, 115549, 115554, 115560, 
+    115566, 115571, 115577, 115583, 115589, 115595, 115601, 0, 115605, 
+    115610, 0, 0, 115615, 0, 0, 115620, 115625, 0, 0, 115630, 115635, 115639, 
+    115644, 0, 115649, 115654, 115659, 115663, 115668, 115673, 115678, 
+    115683, 115688, 115692, 115697, 115702, 0, 115707, 0, 115712, 115717, 
+    115721, 115726, 115731, 115735, 115739, 0, 115744, 115749, 115754, 
+    115758, 115763, 115768, 115772, 115777, 115782, 115787, 115792, 115797, 
+    115802, 115808, 115814, 115820, 115825, 115831, 115837, 115843, 115848, 
+    115854, 115860, 115865, 115870, 115876, 115881, 115887, 115893, 115898, 
+    115904, 115910, 115915, 115921, 115927, 115933, 115939, 115945, 115950, 
+    115956, 115962, 115968, 115973, 115979, 115985, 115991, 115996, 116002, 
+    116008, 116013, 116018, 116024, 116029, 116035, 116041, 116046, 116052, 
+    116058, 116063, 116069, 116075, 116081, 116087, 116093, 116097, 0, 
+    116102, 116107, 116111, 116116, 0, 0, 116121, 116126, 116131, 116135, 
+    116139, 116144, 116148, 116153, 0, 116158, 116163, 116168, 116172, 
+    116177, 116182, 116187, 0, 116192, 116196, 116201, 116206, 116211, 
+    116215, 116220, 116225, 116230, 116234, 116239, 116244, 116248, 116252, 
+    116257, 116261, 116266, 116271, 116275, 116280, 116285, 116289, 116294, 
+    116299, 116304, 116309, 116314, 116318, 0, 116323, 116328, 116332, 
+    116337, 0, 116342, 116346, 116351, 116356, 116360, 0, 116364, 0, 0, 0, 
+    116368, 116373, 116378, 116382, 116387, 116392, 116397, 0, 116402, 
+    116406, 116411, 116416, 116421, 116425, 116430, 116435, 116440, 116444, 
+    116449, 116454, 116458, 116462, 116467, 116471, 116476, 116481, 116485, 
+    116490, 116495, 116499, 116504, 116509, 116514, 116519, 116524, 116529, 
+    116535, 116541, 116547, 116552, 116558, 116564, 116570, 116575, 116581, 
+    116587, 116592, 116597, 116603, 116608, 116614, 116620, 116625, 116631, 
+    116637, 116642, 116648, 116654, 116660, 116666, 116672, 116677, 116683, 
+    116689, 116695, 116700, 116706, 116712, 116718, 116723, 116729, 116735, 
+    116740, 116745, 116751, 116756, 116762, 116768, 116773, 116779, 116785, 
+    116790, 116796, 116802, 116808, 116814, 116820, 116824, 116829, 116834, 
+    116839, 116843, 116848, 116853, 116858, 116862, 116867, 116872, 116876, 
+    116880, 116885, 116889, 116894, 116899, 116903, 116908, 116913, 116917, 
+    116922, 116927, 116932, 116937, 116942, 116946, 116951, 116956, 116961, 
+    116965, 116970, 116975, 116980, 116984, 116989, 116994, 116998, 117002, 
+    117007, 117011, 117016, 117021, 117025, 117030, 117035, 117039, 117044, 
+    117049, 117054, 117059, 117064, 117069, 117075, 117081, 117087, 117092, 
+    117098, 117104, 117110, 117115, 117121, 117127, 117132, 117137, 117143, 
+    117148, 117154, 117160, 117165, 117171, 117177, 117182, 117188, 117194, 
+    117200, 117206, 117212, 117217, 117223, 117229, 117235, 117240, 117246, 
+    117252, 117258, 117263, 117269, 117275, 117280, 117285, 117291, 117296, 
+    117302, 117308, 117313, 117319, 117325, 117330, 117336, 117342, 117348, 
+    117354, 117360, 117365, 117371, 117377, 117383, 117388, 117394, 117400, 
+    117406, 117411, 117417, 117423, 117428, 117433, 117439, 117444, 117450, 
+    117456, 117461, 117467, 117473, 117478, 117484, 117490, 117496, 117502, 
+    117508, 117513, 117519, 117525, 117531, 117536, 117542, 117548, 117554, 
+    117559, 117565, 117571, 117576, 117581, 117587, 117592, 117598, 117604, 
+    117609, 117615, 117621, 117626, 117632, 117638, 117644, 117650, 117656, 
+    117662, 117669, 117676, 117683, 117689, 117696, 117703, 117710, 117716, 
+    117723, 117730, 117736, 117742, 117749, 117755, 117762, 117769, 117775, 
+    117782, 117789, 117795, 117802, 117809, 117816, 117823, 117830, 117836, 
+    117843, 117850, 117857, 117863, 117870, 117877, 117884, 117890, 117897, 
+    117904, 117910, 117916, 117923, 117929, 117936, 117943, 117949, 117956, 
+    117963, 117969, 117976, 117983, 117990, 117997, 118004, 118009, 118015, 
+    118021, 118027, 118032, 118038, 118044, 118050, 118055, 118061, 118067, 
+    118072, 118077, 118083, 118088, 118094, 118100, 118105, 118111, 118117, 
+    118122, 118128, 118134, 118140, 118146, 118152, 118157, 118163, 118169, 
+    118175, 118180, 118186, 118192, 118198, 118203, 118209, 118215, 118220, 
+    118225, 118231, 118236, 118242, 118248, 118253, 118259, 118265, 118270, 
+    118276, 118282, 118288, 118294, 118300, 118306, 0, 0, 118313, 118318, 
+    118323, 118328, 118333, 118338, 118343, 118348, 118353, 118358, 118363, 
+    118368, 118373, 118378, 118383, 118388, 118393, 118398, 118404, 118409, 
+    118414, 118419, 118424, 118429, 118434, 118439, 118443, 118448, 118453, 
+    118458, 118463, 118468, 118473, 118478, 118483, 118488, 118493, 118498, 
+    118503, 118508, 118513, 118518, 118523, 118528, 118534, 118539, 118544, 
+    118549, 118554, 118559, 118564, 118569, 118575, 118580, 118585, 118590, 
+    118595, 118600, 118605, 118610, 118615, 118620, 118625, 118630, 118635, 
+    118640, 118645, 118650, 118655, 118660, 118665, 118670, 118675, 118680, 
+    118685, 118690, 118696, 118701, 118706, 118711, 118716, 118721, 118726, 
+    118731, 118735, 118740, 118745, 118750, 118755, 118760, 118765, 118770, 
+    118775, 118780, 118785, 118790, 118795, 118800, 118805, 118810, 118815, 
+    118820, 118826, 118831, 118836, 118841, 118846, 118851, 118856, 118861, 
+    118867, 118872, 118877, 118882, 118887, 118892, 118897, 118903, 118909, 
+    118915, 118921, 118927, 118933, 118939, 118945, 118951, 118957, 118963, 
+    118969, 118975, 118981, 118987, 118993, 118999, 119006, 119012, 119018, 
+    119024, 119030, 119036, 119042, 119048, 119053, 119059, 119065, 119071, 
+    119077, 119083, 119089, 119095, 119101, 119107, 119113, 119119, 119125, 
+    119131, 119137, 119143, 119149, 119155, 119162, 119168, 119174, 119180, 
+    119186, 119192, 119198, 119204, 119211, 119217, 119223, 119229, 119235, 
+    119241, 119247, 119253, 119259, 119265, 119271, 119277, 119283, 119289, 
+    119295, 119301, 119307, 119313, 119319, 119325, 119331, 119337, 119343, 
+    119349, 119356, 119362, 119368, 119374, 119380, 119386, 119392, 119398, 
+    119403, 119409, 119415, 119421, 119427, 119433, 119439, 119445, 119451, 
+    119457, 119463, 119469, 119475, 119481, 119487, 119493, 119499, 119505, 
+    119512, 119518, 119524, 119530, 119536, 119542, 119548, 119554, 119561, 
+    119567, 119573, 119579, 119585, 119591, 119597, 119604, 119611, 119618, 
+    119625, 119632, 119639, 119646, 119653, 119660, 119667, 119674, 119681, 
+    119688, 119695, 119702, 119709, 119716, 119724, 119731, 119738, 119745, 
+    119752, 119759, 119766, 119773, 119779, 119786, 119793, 119800, 119807, 
+    119814, 119821, 119828, 119835, 119842, 119849, 119856, 119863, 119870, 
+    119877, 119884, 119891, 119898, 119906, 119913, 119920, 119927, 119934, 
+    119941, 119948, 119955, 119963, 119970, 119977, 119984, 119991, 119998, 
+    120005, 120010, 0, 0, 120015, 120020, 120024, 120028, 120032, 120036, 
+    120040, 120044, 120048, 120052, 120056, 120061, 120065, 120069, 120073, 
+    120077, 120081, 120085, 120089, 120093, 120097, 120102, 120106, 120110, 
+    120114, 120118, 120122, 120126, 120130, 120134, 120138, 120144, 120149, 
+    120154, 120159, 120164, 120169, 120174, 120179, 120184, 120189, 120195, 
+    120200, 120205, 120210, 120215, 120220, 120225, 120230, 120235, 120240, 
+    120244, 120248, 120252, 0, 120256, 120260, 120264, 120268, 120272, 
     120276, 120280, 120284, 120288, 120292, 120296, 120300, 120304, 120308, 
-    120312, 120316, 120320, 120326, 120332, 120338, 0, 120344, 120349, 0, 
-    120354, 0, 0, 120359, 0, 120364, 120369, 120374, 120379, 120384, 120389, 
-    120394, 120399, 120404, 120409, 0, 120414, 120419, 120424, 120429, 0, 
-    120434, 0, 120439, 0, 0, 0, 0, 0, 0, 120444, 0, 0, 0, 0, 120450, 0, 
-    120456, 0, 120462, 0, 120468, 120474, 120480, 0, 120486, 120492, 0, 
-    120498, 0, 0, 120504, 0, 120510, 0, 120516, 0, 120522, 0, 120530, 0, 
-    120538, 120544, 0, 120550, 0, 0, 120556, 120562, 120568, 120574, 0, 
-    120580, 120586, 120592, 120598, 120604, 120610, 120616, 0, 120622, 
-    120628, 120634, 120640, 0, 120646, 120652, 120658, 120664, 0, 120672, 0, 
-    120680, 120686, 120692, 120698, 120704, 120710, 120716, 120722, 120728, 
-    120734, 0, 120740, 120746, 120752, 120758, 120764, 120770, 120776, 
-    120782, 120788, 120794, 120800, 120806, 120812, 120818, 120824, 120830, 
-    120836, 0, 0, 0, 0, 0, 120842, 120847, 120852, 0, 120857, 120862, 120867, 
-    120872, 120877, 0, 120882, 120887, 120892, 120897, 120902, 120907, 
-    120912, 120917, 120922, 120927, 120932, 120937, 120942, 120947, 120952, 
-    120957, 120962, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 120967, 120977, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 120985, 120992, 120999, 121006, 121013, 121020, 121027, 
-    121033, 121040, 121047, 121054, 121062, 121070, 121078, 121086, 121094, 
-    121102, 121109, 121116, 121123, 121131, 121139, 121147, 121155, 121163, 
-    121171, 121178, 121185, 121192, 121200, 121208, 121216, 121224, 121232, 
-    121240, 121245, 121250, 121255, 121260, 121265, 121270, 121275, 121280, 
-    121285, 0, 0, 0, 0, 121290, 121295, 121299, 121303, 121307, 121311, 
-    121315, 121319, 121323, 121327, 121331, 121335, 121339, 121343, 121347, 
-    121351, 121355, 121359, 121363, 121367, 121371, 121375, 121379, 121383, 
-    121387, 121391, 121395, 121399, 121403, 121407, 121411, 121415, 121419, 
-    121423, 121427, 121431, 121435, 121439, 121443, 121447, 121451, 121455, 
-    121459, 121463, 121467, 121471, 121475, 121479, 121483, 121487, 121491, 
-    121496, 121500, 121504, 121508, 121512, 121516, 121520, 121524, 121528, 
-    121532, 121536, 121540, 121544, 121548, 121552, 121556, 121560, 121564, 
-    121568, 121572, 121576, 121580, 121584, 121588, 121592, 121596, 121600, 
-    121604, 121608, 121612, 121616, 121620, 121624, 121628, 121632, 121636, 
-    121640, 121644, 121648, 121652, 121656, 121660, 121664, 121668, 121672, 
-    121676, 121680, 121684, 121688, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    121692, 121698, 121707, 121715, 121723, 121732, 121741, 121750, 121759, 
-    121768, 121777, 121786, 121795, 121804, 121813, 0, 0, 121822, 121831, 
-    121839, 121847, 121856, 121865, 121874, 121883, 121892, 121901, 121910, 
-    121919, 121928, 121937, 0, 0, 121946, 121955, 121963, 121971, 121980, 
-    121989, 121998, 122007, 122016, 122025, 122034, 122043, 122052, 122061, 
-    122070, 0, 122077, 122086, 122094, 122102, 122111, 122120, 122129, 
-    122138, 122147, 122156, 122165, 122174, 122183, 122192, 122201, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 122208, 122215, 122220, 122224, 122228, 122232, 122237, 
-    122242, 122247, 122252, 122257, 0, 0, 0, 0, 0, 122262, 122267, 122273, 
-    122279, 122285, 122290, 122296, 122302, 122308, 122313, 122319, 122325, 
-    122330, 122335, 122341, 122346, 122352, 122358, 122363, 122369, 122375, 
-    122380, 122386, 122392, 122398, 122404, 122410, 122421, 122428, 122434, 
-    122437, 0, 122440, 122445, 122451, 122457, 122463, 122468, 122474, 
-    122480, 122486, 122491, 122497, 122503, 122508, 122513, 122519, 122524, 
-    122530, 122536, 122541, 122547, 122553, 122558, 122564, 122570, 122576, 
-    122582, 122588, 122591, 122594, 122597, 122600, 122603, 122606, 122612, 
-    122619, 122626, 122633, 122639, 122646, 122653, 122660, 122666, 122673, 
-    122680, 122686, 122692, 122699, 122705, 122712, 122719, 122725, 122732, 
-    122739, 122745, 122752, 122759, 122766, 122773, 122780, 122785, 0, 0, 0, 
-    0, 122790, 122796, 122803, 122810, 122817, 122823, 122830, 122837, 
-    122844, 122850, 122857, 122864, 122870, 122876, 122883, 122889, 122896, 
-    122903, 122909, 122916, 122923, 122929, 122936, 122943, 122950, 122957, 
-    122964, 122973, 122977, 122980, 122983, 122987, 122991, 122994, 122997, 
-    123000, 123003, 123006, 123009, 123012, 123015, 123018, 123024, 0, 0, 0, 
+    120312, 120316, 120320, 120324, 120328, 120332, 120336, 120340, 120344, 
+    120348, 120354, 120360, 120366, 0, 120372, 120377, 0, 120382, 0, 0, 
+    120387, 0, 120392, 120397, 120402, 120407, 120412, 120417, 120422, 
+    120427, 120432, 120437, 0, 120442, 120447, 120452, 120457, 0, 120462, 0, 
+    120467, 0, 0, 0, 0, 0, 0, 120472, 0, 0, 0, 0, 120478, 0, 120484, 0, 
+    120490, 0, 120496, 120502, 120508, 0, 120514, 120520, 0, 120526, 0, 0, 
+    120532, 0, 120538, 0, 120544, 0, 120550, 0, 120558, 0, 120566, 120572, 0, 
+    120578, 0, 0, 120584, 120590, 120596, 120602, 0, 120608, 120614, 120620, 
+    120626, 120632, 120638, 120644, 0, 120650, 120656, 120662, 120668, 0, 
+    120674, 120680, 120686, 120692, 0, 120700, 0, 120708, 120714, 120720, 
+    120726, 120732, 120738, 120744, 120750, 120756, 120762, 0, 120768, 
+    120774, 120780, 120786, 120792, 120798, 120804, 120810, 120816, 120822, 
+    120828, 120834, 120840, 120846, 120852, 120858, 120864, 0, 0, 0, 0, 0, 
+    120870, 120875, 120880, 0, 120885, 120890, 120895, 120900, 120905, 0, 
+    120910, 120915, 120920, 120925, 120930, 120935, 120940, 120945, 120950, 
+    120955, 120960, 120965, 120970, 120975, 120980, 120985, 120990, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 120995, 121005, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 121013, 
+    121020, 121027, 121034, 121041, 121048, 121055, 121061, 121068, 121075, 
+    121082, 121090, 121098, 121106, 121114, 121122, 121130, 121137, 121144, 
+    121151, 121159, 121167, 121175, 121183, 121191, 121199, 121206, 121213, 
+    121220, 121228, 121236, 121244, 121252, 121260, 121268, 121273, 121278, 
+    121283, 121288, 121293, 121298, 121303, 121308, 121313, 0, 0, 0, 0, 
+    121318, 121323, 121327, 121331, 121335, 121339, 121343, 121347, 121351, 
+    121355, 121359, 121363, 121367, 121371, 121375, 121379, 121383, 121387, 
+    121391, 121395, 121399, 121403, 121407, 121411, 121415, 121419, 121423, 
+    121427, 121431, 121435, 121439, 121443, 121447, 121451, 121455, 121459, 
+    121463, 121467, 121471, 121475, 121479, 121483, 121487, 121491, 121495, 
+    121499, 121503, 121507, 121511, 121515, 121519, 121524, 121528, 121532, 
+    121536, 121540, 121544, 121548, 121552, 121556, 121560, 121564, 121568, 
+    121572, 121576, 121580, 121584, 121588, 121592, 121596, 121600, 121604, 
+    121608, 121612, 121616, 121620, 121624, 121628, 121632, 121636, 121640, 
+    121644, 121648, 121652, 121656, 121660, 121664, 121668, 121672, 121676, 
+    121680, 121684, 121688, 121692, 121696, 121700, 121704, 121708, 121712, 
+    121716, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 121720, 121726, 121735, 
+    121743, 121751, 121760, 121769, 121778, 121787, 121796, 121805, 121814, 
+    121823, 121832, 121841, 0, 0, 121850, 121859, 121867, 121875, 121884, 
+    121893, 121902, 121911, 121920, 121929, 121938, 121947, 121956, 121965, 
+    0, 0, 121974, 121983, 121991, 121999, 122008, 122017, 122026, 122035, 
+    122044, 122053, 122062, 122071, 122080, 122089, 122098, 0, 122105, 
+    122114, 122122, 122130, 122139, 122148, 122157, 122166, 122175, 122184, 
+    122193, 122202, 122211, 122220, 122229, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 122236, 
+    122243, 122248, 122252, 122256, 122260, 122265, 122270, 122275, 122280, 
+    122285, 0, 0, 0, 0, 0, 122290, 122295, 122301, 122307, 122313, 122318, 
+    122324, 122330, 122336, 122341, 122347, 122353, 122358, 122363, 122369, 
+    122374, 122380, 122386, 122391, 122397, 122403, 122408, 122414, 122420, 
+    122426, 122432, 122438, 122449, 122456, 122462, 122465, 0, 122468, 
+    122473, 122479, 122485, 122491, 122496, 122502, 122508, 122514, 122519, 
+    122525, 122531, 122536, 122541, 122547, 122552, 122558, 122564, 122569, 
+    122575, 122581, 122586, 122592, 122598, 122604, 122610, 122616, 122619, 
+    122622, 122625, 122628, 122631, 122634, 122640, 122647, 122654, 122661, 
+    122667, 122674, 122681, 122688, 122694, 122701, 122708, 122714, 122720, 
+    122727, 122733, 122740, 122747, 122753, 122760, 122767, 122773, 122780, 
+    122787, 122794, 122801, 122808, 122813, 0, 0, 0, 0, 122818, 122824, 
+    122831, 122838, 122845, 122851, 122858, 122865, 122872, 122878, 122885, 
+    122892, 122898, 122904, 122911, 122917, 122924, 122931, 122937, 122944, 
+    122951, 122957, 122964, 122971, 122978, 122985, 122992, 123001, 123005, 
+    123008, 123011, 123015, 123019, 123022, 123025, 123028, 123031, 123034, 
+    123037, 123040, 123043, 123046, 123052, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    123027, 123034, 123042, 123050, 123058, 123065, 123073, 123081, 123089, 
-    123096, 123104, 123112, 123119, 123126, 123134, 123141, 123149, 123157, 
-    123164, 123172, 123180, 123187, 123195, 123203, 123211, 123219, 123227, 
-    123231, 123235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 123238, 123244, 
-    123250, 123256, 123260, 123266, 123272, 123278, 123284, 123290, 123296, 
-    123302, 123308, 123314, 123320, 123326, 123332, 123338, 123344, 123350, 
-    123356, 123362, 123368, 123374, 123380, 123386, 123392, 123398, 123404, 
-    123410, 123416, 123422, 123428, 123434, 123440, 123446, 123452, 123458, 
-    123464, 123470, 123476, 123482, 123488, 0, 0, 0, 0, 0, 123494, 123505, 
-    123516, 123527, 123538, 123549, 123560, 123571, 123582, 0, 0, 0, 0, 0, 0, 
-    0, 123593, 123597, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 123601, 123603, 123605, 123609, 123614, 123619, 123621, 
-    123627, 123632, 123634, 123640, 123644, 123646, 123650, 123656, 123662, 
-    123668, 123673, 123677, 123684, 123691, 123698, 123703, 123710, 123717, 
-    123724, 123728, 123734, 123743, 123752, 123759, 123764, 123768, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 123772, 123774, 123776, 123780, 
-    123784, 123788, 0, 123790, 123792, 123796, 123798, 123800, 123802, 
-    123804, 123809, 123814, 123816, 123822, 123826, 123830, 123838, 123840, 
-    123842, 123844, 123846, 123848, 123850, 123852, 123854, 123856, 123858, 
-    123862, 123866, 123868, 123870, 123872, 123874, 123876, 123881, 123887, 
-    123891, 123895, 123899, 123903, 123908, 123912, 123914, 123916, 123920, 
-    123926, 123928, 123930, 123932, 123936, 123945, 123951, 123955, 123959, 
-    123961, 123963, 123966, 123968, 123970, 123972, 123976, 123978, 123982, 
-    123987, 123989, 123994, 124000, 124007, 124011, 124015, 124019, 124023, 
-    124029, 0, 0, 0, 124033, 124035, 124039, 124043, 124045, 124049, 124053, 
-    124055, 124059, 124061, 124065, 124069, 124073, 124077, 124081, 124085, 
-    124089, 124093, 124099, 124103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    124107, 124111, 124115, 124119, 124126, 124128, 124132, 124134, 124136, 
-    124140, 124144, 124148, 124150, 124154, 124158, 124162, 124166, 124170, 
-    124172, 124176, 124178, 124184, 124187, 124192, 124194, 124196, 124199, 
-    124201, 124203, 124206, 124213, 124220, 124227, 124232, 124236, 124238, 
-    124240, 0, 124242, 124244, 124248, 124252, 124256, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124258, 124262, 124267, 124271, 
-    124277, 124283, 124285, 124287, 124293, 124295, 124299, 124303, 124305, 
-    124309, 124311, 124315, 124319, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 124323, 124325, 124327, 124329, 124333, 124335, 124337, 124339, 
-    124341, 124343, 124345, 124347, 124349, 124351, 124353, 124355, 124357, 
-    124359, 124361, 124363, 124365, 124367, 124369, 124371, 124373, 124375, 
-    124377, 124381, 124383, 124385, 124387, 124391, 124393, 124397, 124399, 
-    124401, 124405, 124409, 124415, 124417, 124419, 124421, 124423, 124427, 
-    124431, 124433, 124437, 124441, 124445, 124449, 124453, 124457, 124461, 
-    124465, 124469, 124473, 124477, 124481, 124485, 124489, 124493, 124497, 
-    124501, 0, 124505, 0, 124507, 124509, 124511, 124513, 124515, 124523, 
-    124531, 124539, 124547, 124552, 124557, 124562, 124566, 124570, 124575, 
-    124579, 124581, 124585, 124587, 124589, 124591, 124593, 124595, 124597, 
-    124599, 124603, 124605, 124607, 124609, 124613, 124617, 124621, 124625, 
-    124629, 124631, 124637, 124643, 124645, 124647, 124649, 124651, 124653, 
-    124662, 124669, 124676, 124680, 124687, 124692, 124699, 124708, 124713, 
-    124717, 124721, 124723, 124727, 124729, 124733, 124737, 124739, 124743, 
-    124747, 124751, 124753, 124755, 124761, 124763, 124765, 124767, 124771, 
-    124775, 124777, 124781, 124783, 124785, 124788, 124792, 124794, 124798, 
-    124800, 124802, 124807, 124809, 124813, 124817, 124820, 124824, 124828, 
-    124832, 124836, 124840, 124844, 124848, 124853, 124857, 124861, 124870, 
-    124875, 124878, 124880, 124883, 124886, 124891, 124893, 124896, 124901, 
-    124905, 124908, 124912, 124916, 124919, 124924, 124928, 124932, 124936, 
-    124940, 124946, 124952, 124958, 124964, 124969, 124980, 124982, 124986, 
-    124988, 124990, 124994, 124998, 125000, 125004, 125009, 125014, 125020, 
-    125022, 125026, 125030, 125037, 125044, 125048, 125050, 125052, 125056, 
-    125058, 125062, 125066, 125070, 125072, 125074, 125081, 125085, 125088, 
-    125092, 125096, 125100, 125102, 125106, 125108, 125110, 125114, 125116, 
-    125120, 125124, 125130, 125134, 125138, 125142, 125144, 125147, 125151, 
-    125158, 125167, 125176, 125184, 125192, 125194, 125198, 125200, 125204, 
-    125215, 125219, 125225, 125231, 125236, 0, 125238, 125242, 125244, 
-    125246, 0, 0, 0, 125248, 125253, 125263, 125278, 125290, 125302, 125306, 
-    125310, 125316, 125318, 125326, 125334, 125336, 125340, 125346, 125352, 
-    125359, 125366, 125368, 125370, 125373, 125375, 125381, 125383, 125386, 
-    125390, 125396, 125402, 125413, 125419, 125426, 125434, 125438, 125446, 
-    125454, 125460, 125466, 125473, 125475, 125479, 125481, 125483, 125488, 
-    125490, 125492, 125494, 125496, 125500, 125511, 125517, 125521, 125525, 
-    125529, 125535, 125541, 125547, 125553, 125558, 125563, 125569, 125575, 
-    125582, 0, 0, 125589, 125594, 125602, 125606, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 125615, 125622, 125629, 125636, 125644, 125652, 125660, 125668, 
-    125676, 125684, 125692, 125700, 125708, 125714, 125720, 125726, 125732, 
-    125738, 125744, 125750, 125756, 125762, 125768, 125774, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 123055, 123062, 123070, 
+    123078, 123086, 123093, 123101, 123109, 123117, 123124, 123132, 123140, 
+    123147, 123154, 123162, 123169, 123177, 123185, 123192, 123200, 123208, 
+    123215, 123223, 123231, 123239, 123247, 123255, 123259, 123263, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 123266, 123272, 123278, 123284, 123288, 
+    123294, 123300, 123306, 123312, 123318, 123324, 123330, 123336, 123342, 
+    123348, 123354, 123360, 123366, 123372, 123378, 123384, 123390, 123396, 
+    123402, 123408, 123414, 123420, 123426, 123432, 123438, 123444, 123450, 
+    123456, 123462, 123468, 123474, 123480, 123486, 123492, 123498, 123504, 
+    123510, 123516, 0, 0, 0, 0, 0, 123522, 123533, 123544, 123555, 123566, 
+    123577, 123588, 123599, 123610, 0, 0, 0, 0, 0, 0, 0, 123621, 123625, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 123629, 
+    123631, 123633, 123637, 123642, 123647, 123649, 123655, 123660, 123662, 
+    123668, 123672, 123674, 123678, 123684, 123690, 123696, 123701, 123705, 
+    123712, 123719, 123726, 123731, 123738, 123745, 123752, 123756, 123762, 
+    123771, 123780, 123787, 123792, 123796, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 123800, 123802, 123804, 123808, 123812, 123816, 0, 123818, 
+    123820, 123824, 123826, 123828, 123830, 123832, 123837, 123842, 123844, 
+    123850, 123854, 123858, 123866, 123868, 123870, 123872, 123874, 123876, 
+    123878, 123880, 123882, 123884, 123886, 123890, 123894, 123896, 123898, 
+    123900, 123902, 123904, 123909, 123915, 123919, 123923, 123927, 123931, 
+    123936, 123940, 123942, 123944, 123948, 123954, 123956, 123958, 123960, 
+    123964, 123973, 123979, 123983, 123987, 123989, 123991, 123994, 123996, 
+    123998, 124000, 124004, 124006, 124010, 124015, 124017, 124022, 124028, 
+    124035, 124039, 124043, 124047, 124051, 124057, 0, 0, 0, 124061, 124063, 
+    124067, 124071, 124073, 124077, 124081, 124083, 124087, 124089, 124093, 
+    124097, 124101, 124105, 124109, 124113, 124117, 124121, 124127, 124131, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124135, 124139, 124143, 124147, 
+    124154, 124156, 124160, 124162, 124164, 124168, 124172, 124176, 124178, 
+    124182, 124186, 124190, 124194, 124198, 124200, 124204, 124206, 124212, 
+    124215, 124220, 124222, 124224, 124227, 124229, 124231, 124234, 124241, 
+    124248, 124255, 124260, 124264, 124266, 124268, 0, 124270, 124272, 
+    124276, 124280, 124284, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 124286, 124290, 124295, 124299, 124305, 124311, 124313, 
+    124315, 124321, 124323, 124327, 124331, 124333, 124337, 124339, 124343, 
+    124347, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124351, 124353, 
+    124355, 124357, 124361, 124363, 124365, 124367, 124369, 124371, 124373, 
+    124375, 124377, 124379, 124381, 124383, 124385, 124387, 124389, 124391, 
+    124393, 124395, 124397, 124399, 124401, 124403, 124405, 124409, 124411, 
+    124413, 124415, 124419, 124421, 124425, 124427, 124429, 124433, 124437, 
+    124443, 124445, 124447, 124449, 124451, 124455, 124459, 124461, 124465, 
+    124469, 124473, 124477, 124481, 124485, 124489, 124493, 124497, 124501, 
+    124505, 124509, 124513, 124517, 124521, 124525, 124529, 0, 124533, 0, 
+    124535, 124537, 124539, 124541, 124543, 124551, 124559, 124567, 124575, 
+    124580, 124585, 124590, 124594, 124598, 124603, 124607, 124609, 124613, 
+    124615, 124617, 124619, 124621, 124623, 124625, 124627, 124631, 124633, 
+    124635, 124637, 124641, 124645, 124649, 124653, 124657, 124659, 124665, 
+    124671, 124673, 124675, 124677, 124679, 124681, 124690, 124697, 124704, 
+    124708, 124715, 124720, 124727, 124736, 124741, 124745, 124749, 124751, 
+    124755, 124757, 124761, 124765, 124767, 124771, 124775, 124779, 124781, 
+    124783, 124789, 124791, 124793, 124795, 124799, 124803, 124805, 124809, 
+    124811, 124813, 124816, 124820, 124822, 124826, 124828, 124830, 124835, 
+    124837, 124841, 124845, 124848, 124852, 124856, 124860, 124864, 124868, 
+    124872, 124876, 124881, 124885, 124889, 124898, 124903, 124906, 124908, 
+    124911, 124914, 124919, 124921, 124924, 124929, 124933, 124936, 124940, 
+    124944, 124947, 124952, 124956, 124960, 124964, 124968, 124974, 124980, 
+    124986, 124992, 124997, 125008, 125010, 125014, 125016, 125018, 125022, 
+    125026, 125028, 125032, 125037, 125042, 125048, 125050, 125054, 125058, 
+    125065, 125072, 125076, 125078, 125080, 125084, 125086, 125090, 125094, 
+    125098, 125100, 125102, 125109, 125113, 125116, 125120, 125124, 125128, 
+    125130, 125134, 125136, 125138, 125142, 125144, 125148, 125152, 125158, 
+    125162, 125166, 125170, 125172, 125175, 125179, 125186, 125195, 125204, 
+    125212, 125220, 125222, 125226, 125228, 125232, 125243, 125247, 125253, 
+    125259, 125264, 0, 125266, 125270, 125272, 125274, 0, 0, 0, 125276, 
+    125281, 125291, 125306, 125318, 125330, 125334, 125338, 125344, 125346, 
+    125354, 125362, 125364, 125368, 125374, 125380, 125387, 125394, 125396, 
+    125398, 125401, 125403, 125409, 125411, 125414, 125418, 125424, 125430, 
+    125441, 125447, 125454, 125462, 125466, 125474, 125482, 125488, 125494, 
+    125501, 125503, 125507, 125509, 125511, 125516, 125518, 125520, 125522, 
+    125524, 125528, 125539, 125545, 125549, 125553, 125557, 125563, 125569, 
+    125575, 125581, 125586, 125591, 125597, 125603, 125610, 0, 0, 125617, 
+    125622, 125630, 125634, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 125643, 
+    125650, 125657, 125664, 125672, 125680, 125688, 125696, 125704, 125712, 
+    125720, 125728, 125736, 125742, 125748, 125754, 125760, 125766, 125772, 
+    125778, 125784, 125790, 125796, 125802, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 125780, 
-    125784, 125788, 125793, 125798, 125800, 125804, 125813, 125821, 125829, 
-    125842, 125855, 125868, 125875, 125882, 125886, 125895, 125903, 125907, 
-    125916, 125923, 125927, 125931, 125935, 125939, 125946, 125950, 125954, 
-    125958, 125962, 125969, 125978, 125987, 125994, 126006, 126018, 126022, 
-    126026, 126030, 126034, 126038, 126042, 126050, 126058, 126066, 126070, 
-    126074, 126078, 126082, 126086, 126090, 126096, 126102, 126106, 126117, 
-    126125, 126129, 126133, 126137, 126141, 126147, 126154, 126165, 126175, 
-    126185, 126196, 126205, 126216, 126222, 126228, 0, 0, 0, 0, 126234, 
-    126243, 126250, 126256, 126260, 126264, 126268, 126277, 126289, 126293, 
-    126300, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 125808, 125812, 125816, 
+    125821, 125826, 125828, 125832, 125841, 125849, 125857, 125870, 125883, 
+    125896, 125903, 125910, 125914, 125923, 125931, 125935, 125944, 125951, 
+    125955, 125959, 125963, 125967, 125974, 125978, 125982, 125986, 125990, 
+    125997, 126006, 126015, 126022, 126034, 126046, 126050, 126054, 126058, 
+    126062, 126066, 126070, 126078, 126086, 126094, 126098, 126102, 126106, 
+    126110, 126114, 126118, 126124, 126130, 126134, 126145, 126153, 126157, 
+    126161, 126165, 126169, 126175, 126182, 126193, 126203, 126213, 126224, 
+    126233, 126244, 126250, 126256, 0, 0, 0, 0, 126262, 126271, 126278, 
+    126284, 126288, 126292, 126296, 126305, 126317, 126321, 126328, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 126307, 126309, 126311, 126315, 126319, 126323, 126332, 126334, 
-    126336, 126339, 126341, 126343, 126347, 126349, 126353, 126355, 126359, 
-    126361, 126363, 126367, 126371, 126377, 126379, 126383, 126385, 126389, 
-    126393, 126397, 126401, 126403, 126405, 126409, 126413, 126417, 126421, 
-    126423, 126425, 126427, 126432, 126437, 126440, 126448, 126456, 126458, 
-    126463, 126466, 126471, 126482, 126489, 126494, 126499, 126501, 126505, 
-    126507, 126511, 126513, 126517, 126521, 126524, 126527, 126529, 126532, 
-    126534, 126538, 126540, 126542, 126544, 126548, 126550, 126554, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 126335, 
+    126337, 126339, 126343, 126347, 126351, 126360, 126362, 126364, 126367, 
+    126369, 126371, 126375, 126377, 126381, 126383, 126387, 126389, 126391, 
+    126395, 126399, 126405, 126407, 126411, 126413, 126417, 126421, 126425, 
+    126429, 126431, 126433, 126437, 126441, 126445, 126449, 126451, 126453, 
+    126455, 126460, 126465, 126468, 126476, 126484, 126486, 126491, 126494, 
+    126499, 126510, 126517, 126522, 126527, 126529, 126533, 126535, 126539, 
+    126541, 126545, 126549, 126552, 126555, 126557, 126560, 126562, 126566, 
+    126568, 126570, 126572, 126576, 126578, 126582, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 126557, 126562, 126567, 126572, 126577, 126582, 
-    126587, 126594, 126601, 126608, 126615, 126620, 126625, 126630, 126635, 
-    126642, 126648, 126655, 126662, 126669, 126674, 126679, 126684, 126689, 
-    126694, 126701, 126708, 126713, 126718, 126725, 126732, 126740, 126748, 
-    126755, 126762, 126770, 126778, 126786, 126793, 126803, 126814, 126819, 
-    126826, 126833, 126840, 126848, 126856, 126867, 126875, 126883, 126891, 
-    126896, 126901, 126906, 126911, 126916, 126921, 126926, 126931, 126936, 
-    126941, 126946, 126951, 126958, 126963, 126968, 126975, 126980, 126985, 
-    126990, 126995, 127000, 127005, 127010, 127015, 127020, 127025, 127030, 
-    127035, 127042, 127050, 127055, 127060, 127067, 127072, 127077, 127082, 
-    127089, 127094, 127101, 127106, 127113, 127118, 127127, 127136, 127141, 
-    127146, 127151, 127156, 127161, 127166, 127171, 127176, 127181, 127186, 
-    127191, 127196, 127201, 127209, 127217, 127222, 127227, 127232, 127237, 
-    127242, 127248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127254, 127258, 
-    127262, 127266, 127270, 127274, 127278, 127282, 127286, 127290, 127294, 
+    0, 0, 126585, 126590, 126595, 126600, 126605, 126610, 126615, 126622, 
+    126629, 126636, 126643, 126648, 126653, 126658, 126663, 126670, 126676, 
+    126683, 126690, 126697, 126702, 126707, 126712, 126717, 126722, 126729, 
+    126736, 126741, 126746, 126753, 126760, 126768, 126776, 126783, 126790, 
+    126798, 126806, 126814, 126821, 126831, 126842, 126847, 126854, 126861, 
+    126868, 126876, 126884, 126895, 126903, 126911, 126919, 126924, 126929, 
+    126934, 126939, 126944, 126949, 126954, 126959, 126964, 126969, 126974, 
+    126979, 126986, 126991, 126996, 127003, 127008, 127013, 127018, 127023, 
+    127028, 127033, 127038, 127043, 127048, 127053, 127058, 127063, 127070, 
+    127078, 127083, 127088, 127095, 127100, 127105, 127110, 127117, 127122, 
+    127129, 127134, 127141, 127146, 127155, 127164, 127169, 127174, 127179, 
+    127184, 127189, 127194, 127199, 127204, 127209, 127214, 127219, 127224, 
+    127229, 127237, 127245, 127250, 127255, 127260, 127265, 127270, 127276, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127282, 127286, 127290, 127294, 
     127298, 127302, 127306, 127310, 127314, 127318, 127322, 127326, 127330, 
     127334, 127338, 127342, 127346, 127350, 127354, 127358, 127362, 127366, 
     127370, 127374, 127378, 127382, 127386, 127390, 127394, 127398, 127402, 
@@ -16935,177 +16952,179 @@
     129314, 129318, 129322, 129326, 129330, 129334, 129338, 129342, 129346, 
     129350, 129354, 129358, 129362, 129366, 129370, 129374, 129378, 129382, 
     129386, 129390, 129394, 129398, 129402, 129406, 129410, 129414, 129418, 
+    129422, 129426, 129430, 129434, 129438, 129442, 129446, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 129450, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 129422, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 129426, 129429, 129433, 129437, 129440, 
-    129444, 129448, 129451, 129454, 129458, 129462, 129465, 129468, 129471, 
-    129474, 129479, 129482, 129486, 129489, 129492, 129495, 129498, 129501, 
-    129504, 129507, 129510, 129513, 129516, 129519, 129523, 129527, 129531, 
-    129535, 129540, 129545, 129551, 129557, 129563, 129568, 129574, 129580, 
-    129586, 129591, 129597, 129603, 129608, 129613, 129619, 129624, 129630, 
-    129636, 129641, 129647, 129653, 129658, 129664, 129670, 129676, 129682, 
-    129688, 129692, 129697, 129701, 129706, 129710, 129715, 129720, 129726, 
-    129732, 129738, 129743, 129749, 129755, 129761, 129766, 129772, 129778, 
-    129783, 129788, 129794, 129799, 129805, 129811, 129816, 129822, 129828, 
-    129833, 129839, 129845, 129851, 129857, 129863, 129868, 129872, 129877, 
-    129879, 129883, 129886, 129889, 129892, 129895, 129898, 129901, 129904, 
-    129907, 129910, 129913, 129916, 129919, 129922, 129925, 129928, 129931, 
-    129934, 129937, 129940, 129943, 129946, 129949, 129952, 129955, 129958, 
-    129961, 129964, 129967, 129970, 129973, 129976, 129979, 129982, 129985, 
-    129988, 129991, 129994, 129997, 130000, 130003, 130006, 130009, 130012, 
-    130015, 130018, 130021, 130024, 130027, 130030, 130033, 130036, 130039, 
-    130042, 130045, 130048, 130051, 130054, 130057, 130060, 130063, 130066, 
-    130069, 130072, 130075, 130078, 130081, 130084, 130087, 130090, 130093, 
-    130096, 130099, 130102, 130105, 130108, 130111, 130114, 130117, 130120, 
-    130123, 130126, 130129, 130132, 130135, 130138, 130141, 130144, 130147, 
-    130150, 130153, 130156, 130159, 130162, 130165, 130168, 130171, 130174, 
-    130177, 130180, 130183, 130186, 130189, 130192, 130195, 130198, 130201, 
-    130204, 130207, 130210, 130213, 130216, 130219, 130222, 130225, 130228, 
-    130231, 130234, 130237, 130240, 130243, 130246, 130249, 130252, 130255, 
-    130258, 130261, 130264, 130267, 130270, 130273, 130276, 130279, 130282, 
-    130285, 130288, 130291, 130294, 130297, 130300, 130303, 130306, 130309, 
-    130312, 130315, 130318, 130321, 130324, 130327, 130330, 130333, 130336, 
-    130339, 130342, 130345, 130348, 130351, 130354, 130357, 130360, 130363, 
-    130366, 130369, 130372, 130375, 130378, 130381, 130384, 130387, 130390, 
-    130393, 130396, 130399, 130402, 130405, 130408, 130411, 130414, 130417, 
-    130420, 130423, 130426, 130429, 130432, 130435, 130438, 130441, 130444, 
-    130447, 130450, 130453, 130456, 130459, 130462, 130465, 130468, 130471, 
-    130474, 130477, 130480, 130483, 130486, 130489, 130492, 130495, 130498, 
-    130501, 130504, 130507, 130510, 130513, 130516, 130519, 130522, 130525, 
-    130528, 130531, 130534, 130537, 130540, 130543, 130546, 130549, 130552, 
-    130555, 130558, 130561, 130564, 130567, 130570, 130573, 130576, 130579, 
-    130582, 130585, 130588, 130591, 130594, 130597, 130600, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 130603, 130605, 130607, 130612, 130614, 
-    130619, 130621, 130626, 130628, 130633, 130635, 130637, 130639, 130641, 
-    130643, 130645, 130647, 130649, 130651, 130654, 130657, 130659, 130661, 
-    130665, 130668, 130673, 130675, 130677, 130679, 130683, 130686, 130688, 
-    130692, 130694, 130698, 130700, 130704, 130707, 130709, 130713, 130717, 
-    130719, 130725, 130727, 130732, 130734, 130739, 130741, 130746, 130748, 
-    130753, 130755, 130758, 130760, 130764, 130766, 130773, 130775, 130777, 
-    130779, 130784, 130786, 130788, 130790, 130792, 130794, 130799, 130803, 
-    130805, 130810, 130814, 130816, 130821, 130825, 130827, 130832, 130836, 
-    130838, 130840, 130842, 130844, 130848, 130850, 130855, 130857, 130863, 
-    130865, 130871, 130873, 130875, 130877, 130881, 130883, 130890, 130892, 
-    130899, 130901, 130906, 130911, 130913, 130919, 130925, 130927, 130933, 
-    130938, 130940, 130946, 130952, 130954, 130960, 130966, 130968, 130974, 
-    130978, 130980, 130985, 130987, 130989, 130994, 130996, 130998, 131004, 
-    131006, 131011, 131015, 131017, 131022, 131026, 131028, 131034, 131036, 
-    131040, 131042, 131046, 131048, 131055, 131062, 131064, 131071, 131078, 
-    131080, 131085, 131087, 131094, 131096, 131101, 131103, 131109, 131111, 
-    131115, 131117, 131123, 131125, 131129, 131131, 131137, 131139, 131141, 
-    131143, 131148, 131153, 131155, 131159, 131166, 131173, 131178, 131183, 
-    131195, 131197, 131199, 131201, 131203, 131205, 131207, 131209, 131211, 
-    131213, 131215, 131217, 131219, 131221, 131223, 131225, 131227, 131229, 
-    131235, 131242, 131247, 131252, 131263, 131265, 131267, 131269, 131271, 
-    131273, 131275, 131277, 131279, 131281, 131283, 131285, 131287, 131289, 
-    131291, 131293, 131295, 131300, 131302, 131304, 131315, 131317, 131319, 
-    131321, 131323, 131325, 131327, 131329, 131331, 131333, 131335, 131337, 
-    131339, 131341, 131343, 131345, 131347, 131349, 131351, 131353, 131355, 
-    131357, 131359, 131361, 131363, 131365, 131367, 131369, 131371, 131373, 
-    131375, 131377, 131379, 131381, 131383, 131385, 131387, 131389, 131391, 
-    131393, 131395, 131397, 131399, 131401, 131403, 131405, 131407, 131409, 
-    131411, 131413, 131415, 131417, 131419, 131421, 131423, 131425, 131427, 
-    131429, 131431, 131433, 131435, 131437, 131439, 131441, 131443, 131445, 
-    131447, 131449, 131451, 131453, 131455, 131457, 131459, 131461, 131463, 
-    131465, 131467, 131469, 131471, 131473, 131475, 131477, 131479, 131481, 
-    131483, 131485, 131487, 131489, 131491, 131493, 131495, 131497, 131499, 
-    131501, 131503, 131505, 131507, 131509, 131511, 131513, 131515, 131517, 
-    131519, 131521, 131523, 131525, 131527, 131529, 131531, 131533, 131535, 
-    131537, 131539, 131541, 131543, 131545, 131547, 131549, 131551, 131553, 
-    131555, 131557, 131559, 131561, 131563, 131565, 131567, 131569, 131571, 
-    131573, 131575, 131577, 131579, 131581, 131583, 131585, 131587, 131589, 
-    131591, 131593, 131595, 131597, 131599, 131601, 131603, 131605, 131607, 
-    131609, 131611, 131613, 131615, 131617, 131619, 131621, 131623, 131625, 
-    131627, 131629, 131631, 131633, 131635, 131637, 131639, 131641, 131643, 
-    131645, 131647, 131649, 131651, 131653, 131655, 131657, 131659, 131661, 
-    131663, 131665, 131667, 131669, 131671, 131673, 131675, 131677, 131679, 
-    131681, 131683, 131685, 131687, 131689, 131691, 131693, 131695, 131697, 
-    131699, 131701, 131703, 131705, 131707, 131709, 131711, 131713, 131715, 
-    131717, 131719, 131721, 131723, 131725, 131727, 131729, 131731, 131733, 
-    131735, 131737, 131739, 131741, 131743, 131745, 131747, 131749, 131751, 
-    131753, 131755, 131757, 131759, 131761, 131763, 131765, 131767, 131769, 
-    131771, 131773, 131775, 131777, 131779, 131781, 131783, 131785, 131787, 
-    131789, 131791, 131793, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    131795, 131805, 131815, 131824, 131833, 131846, 131859, 131871, 131883, 
-    131893, 131903, 131913, 131923, 131934, 131945, 131955, 131964, 131973, 
-    131982, 131995, 132008, 132020, 132032, 132042, 132052, 132062, 132072, 
-    132081, 132090, 132099, 132108, 132117, 132126, 132135, 132144, 132153, 
-    132162, 132171, 132180, 132191, 132201, 132211, 132224, 132234, 132247, 
-    132254, 132264, 132271, 132278, 132285, 132292, 132299, 132306, 132315, 
-    132324, 132333, 132342, 132351, 132360, 132369, 132378, 132386, 132394, 
-    132401, 132411, 132420, 132428, 132435, 132445, 132454, 132458, 132462, 
-    132466, 132470, 132474, 132478, 132482, 132486, 132490, 132494, 132497, 
-    132501, 132504, 132507, 132511, 132515, 132519, 132523, 132527, 132531, 
-    132535, 132539, 132543, 132547, 132551, 132555, 132559, 132563, 132567, 
-    132571, 132575, 132579, 132583, 132587, 132591, 132595, 132599, 132603, 
-    132607, 132611, 132615, 132619, 132623, 132627, 132631, 132635, 132639, 
-    132643, 132647, 132651, 132655, 132659, 132663, 132667, 132671, 132675, 
-    132679, 132683, 132687, 132691, 132695, 132699, 132703, 132707, 132711, 
-    132715, 132719, 132723, 132727, 132731, 132735, 132739, 132743, 132747, 
-    132751, 132755, 132759, 132763, 132767, 132771, 132775, 132779, 132783, 
-    132787, 132791, 132795, 132799, 132803, 132807, 132811, 132815, 132819, 
-    132823, 132827, 132831, 132835, 132839, 132843, 132847, 132850, 132854, 
-    132858, 132862, 132866, 132870, 132874, 132878, 132882, 132886, 132890, 
-    132894, 132898, 132902, 132906, 132910, 132914, 132918, 132922, 132926, 
-    132930, 132934, 132938, 132942, 132946, 132950, 132954, 132958, 132962, 
-    132966, 132970, 132974, 132978, 132982, 132986, 132990, 132994, 132998, 
-    133002, 133006, 133010, 133014, 133018, 133022, 133026, 133030, 133034, 
-    133038, 133042, 133046, 133050, 133054, 133058, 133062, 133066, 133070, 
-    133074, 133078, 133082, 133086, 133090, 133094, 133098, 133102, 133106, 
-    133110, 133114, 133118, 133122, 133126, 133130, 133134, 133138, 133142, 
-    133146, 133150, 133154, 133158, 133162, 133166, 133170, 133174, 133178, 
-    133182, 133186, 133190, 133194, 133198, 133202, 133206, 133210, 133214, 
-    133218, 133222, 133226, 133230, 133234, 133238, 133242, 133246, 133250, 
-    133254, 133258, 133262, 133266, 133270, 133274, 133278, 133282, 133286, 
-    133290, 133294, 133298, 133302, 133306, 133310, 133314, 133318, 133322, 
-    133326, 133330, 133334, 133338, 133342, 133346, 133350, 133354, 133358, 
-    133362, 133366, 133370, 133374, 133378, 133382, 133386, 133390, 133394, 
-    133398, 133402, 133406, 133410, 133414, 133418, 133422, 133426, 133430, 
-    133434, 133438, 133442, 133446, 133450, 133454, 133458, 133462, 133466, 
-    133470, 133474, 133478, 133482, 133486, 133490, 133494, 133498, 133502, 
-    133506, 133510, 133514, 133518, 133522, 133526, 133530, 133534, 133538, 
-    133542, 133546, 133550, 133554, 133558, 133562, 133566, 133570, 133574, 
-    133578, 133582, 133586, 133590, 133594, 133598, 133602, 133606, 133610, 
-    133614, 133619, 133624, 133629, 133633, 133639, 133646, 133653, 133660, 
-    133667, 133674, 133681, 133688, 133695, 133702, 133709, 133716, 133723, 
-    133730, 133736, 133743, 133750, 133756, 133763, 133770, 133777, 133784, 
-    133791, 133798, 133805, 133812, 133819, 133826, 133833, 133840, 133847, 
-    133853, 133859, 133866, 133873, 133882, 133891, 133900, 133909, 133914, 
-    133919, 133925, 133931, 133937, 133943, 133949, 133955, 133961, 133967, 
-    133973, 133979, 133985, 133991, 133996, 134002, 134012, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 129454, 129457, 129461, 129465, 129468, 129472, 129476, 
+    129479, 129482, 129486, 129490, 129493, 129496, 129499, 129502, 129507, 
+    129510, 129514, 129517, 129520, 129523, 129526, 129529, 129532, 129535, 
+    129538, 129541, 129544, 129547, 129551, 129555, 129559, 129563, 129568, 
+    129573, 129579, 129585, 129591, 129596, 129602, 129608, 129614, 129619, 
+    129625, 129631, 129636, 129641, 129647, 129652, 129658, 129664, 129669, 
+    129675, 129681, 129686, 129692, 129698, 129704, 129710, 129716, 129720, 
+    129725, 129729, 129734, 129738, 129743, 129748, 129754, 129760, 129766, 
+    129771, 129777, 129783, 129789, 129794, 129800, 129806, 129811, 129816, 
+    129822, 129827, 129833, 129839, 129844, 129850, 129856, 129861, 129867, 
+    129873, 129879, 129885, 129891, 129896, 129900, 129905, 129907, 129911, 
+    129914, 129917, 129920, 129923, 129926, 129929, 129932, 129935, 129938, 
+    129941, 129944, 129947, 129950, 129953, 129956, 129959, 129962, 129965, 
+    129968, 129971, 129974, 129977, 129980, 129983, 129986, 129989, 129992, 
+    129995, 129998, 130001, 130004, 130007, 130010, 130013, 130016, 130019, 
+    130022, 130025, 130028, 130031, 130034, 130037, 130040, 130043, 130046, 
+    130049, 130052, 130055, 130058, 130061, 130064, 130067, 130070, 130073, 
+    130076, 130079, 130082, 130085, 130088, 130091, 130094, 130097, 130100, 
+    130103, 130106, 130109, 130112, 130115, 130118, 130121, 130124, 130127, 
+    130130, 130133, 130136, 130139, 130142, 130145, 130148, 130151, 130154, 
+    130157, 130160, 130163, 130166, 130169, 130172, 130175, 130178, 130181, 
+    130184, 130187, 130190, 130193, 130196, 130199, 130202, 130205, 130208, 
+    130211, 130214, 130217, 130220, 130223, 130226, 130229, 130232, 130235, 
+    130238, 130241, 130244, 130247, 130250, 130253, 130256, 130259, 130262, 
+    130265, 130268, 130271, 130274, 130277, 130280, 130283, 130286, 130289, 
+    130292, 130295, 130298, 130301, 130304, 130307, 130310, 130313, 130316, 
+    130319, 130322, 130325, 130328, 130331, 130334, 130337, 130340, 130343, 
+    130346, 130349, 130352, 130355, 130358, 130361, 130364, 130367, 130370, 
+    130373, 130376, 130379, 130382, 130385, 130388, 130391, 130394, 130397, 
+    130400, 130403, 130406, 130409, 130412, 130415, 130418, 130421, 130424, 
+    130427, 130430, 130433, 130436, 130439, 130442, 130445, 130448, 130451, 
+    130454, 130457, 130460, 130463, 130466, 130469, 130472, 130475, 130478, 
+    130481, 130484, 130487, 130490, 130493, 130496, 130499, 130502, 130505, 
+    130508, 130511, 130514, 130517, 130520, 130523, 130526, 130529, 130532, 
+    130535, 130538, 130541, 130544, 130547, 130550, 130553, 130556, 130559, 
+    130562, 130565, 130568, 130571, 130574, 130577, 130580, 130583, 130586, 
+    130589, 130592, 130595, 130598, 130601, 130604, 130607, 130610, 130613, 
+    130616, 130619, 130622, 130625, 130628, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 130631, 130633, 130635, 130640, 130642, 130647, 130649, 
+    130654, 130656, 130661, 130663, 130665, 130667, 130669, 130671, 130673, 
+    130675, 130677, 130679, 130682, 130685, 130687, 130689, 130693, 130696, 
+    130701, 130703, 130705, 130707, 130711, 130714, 130716, 130720, 130722, 
+    130726, 130728, 130732, 130735, 130737, 130741, 130745, 130747, 130753, 
+    130755, 130760, 130762, 130767, 130769, 130774, 130776, 130781, 130783, 
+    130786, 130788, 130792, 130794, 130801, 130803, 130805, 130807, 130812, 
+    130814, 130816, 130818, 130820, 130822, 130827, 130831, 130833, 130838, 
+    130842, 130844, 130849, 130853, 130855, 130860, 130864, 130866, 130868, 
+    130870, 130872, 130876, 130878, 130883, 130885, 130891, 130893, 130899, 
+    130901, 130903, 130905, 130909, 130911, 130918, 130920, 130927, 130929, 
+    130934, 130939, 130941, 130947, 130953, 130955, 130961, 130966, 130968, 
+    130974, 130980, 130982, 130988, 130994, 130996, 131002, 131006, 131008, 
+    131013, 131015, 131017, 131022, 131024, 131026, 131032, 131034, 131039, 
+    131043, 131045, 131050, 131054, 131056, 131062, 131064, 131068, 131070, 
+    131074, 131076, 131083, 131090, 131092, 131099, 131106, 131108, 131113, 
+    131115, 131122, 131124, 131129, 131131, 131137, 131139, 131143, 131145, 
+    131151, 131153, 131157, 131159, 131165, 131167, 131169, 131171, 131176, 
+    131181, 131183, 131185, 131194, 131198, 131205, 131212, 131217, 131222, 
+    131234, 131236, 131238, 131240, 131242, 131244, 131246, 131248, 131250, 
+    131252, 131254, 131256, 131258, 131260, 131262, 131264, 131266, 131268, 
+    131270, 131272, 131274, 131276, 131282, 131289, 131294, 131299, 131310, 
+    131312, 131314, 131316, 131318, 131320, 131322, 131324, 131326, 131328, 
+    131330, 131332, 131334, 131336, 131338, 131340, 131342, 131347, 131349, 
+    131351, 131357, 131369, 131380, 131382, 131384, 131386, 131388, 131390, 
+    131392, 131394, 131396, 131398, 131400, 131402, 131404, 131406, 131408, 
+    131410, 131412, 131414, 131416, 131418, 131420, 131422, 131424, 131426, 
+    131428, 131430, 131432, 131434, 131436, 131438, 131440, 131442, 131444, 
+    131446, 131448, 131450, 131452, 131454, 131456, 131458, 131460, 131462, 
+    131464, 131466, 131468, 131470, 131472, 131474, 131476, 131478, 131480, 
+    131482, 131484, 131486, 131488, 131490, 131492, 131494, 131496, 131498, 
+    131500, 131502, 131504, 131506, 131508, 131510, 131512, 131514, 131516, 
+    131518, 131520, 131522, 131524, 131526, 131528, 131530, 131532, 131534, 
+    131536, 131538, 131540, 131542, 131544, 131546, 131548, 131550, 131552, 
+    131554, 131556, 131558, 131560, 131562, 131564, 131566, 131568, 131570, 
+    131572, 131574, 131576, 131578, 131580, 131582, 131584, 131586, 131588, 
+    131590, 131592, 131594, 131596, 131598, 131600, 131602, 131604, 131606, 
+    131608, 131610, 131612, 131614, 131616, 131618, 131620, 131622, 131624, 
+    131626, 131628, 131630, 131632, 131634, 131636, 131638, 131640, 131642, 
+    131644, 131646, 131648, 131650, 131652, 131654, 131656, 131658, 131660, 
+    131662, 131664, 131666, 131668, 131670, 131672, 131674, 131676, 131678, 
+    131680, 131682, 131684, 131686, 131688, 131690, 131692, 131694, 131696, 
+    131698, 131700, 131702, 131704, 131706, 131708, 131710, 131712, 131714, 
+    131716, 131718, 131720, 131722, 131724, 131726, 131728, 131730, 131732, 
+    131734, 131736, 131738, 131740, 131742, 131744, 131746, 131748, 131750, 
+    131752, 131754, 131756, 131758, 131760, 131762, 131764, 131766, 131768, 
+    131770, 131772, 131774, 131776, 131778, 131780, 131782, 131784, 131786, 
+    131788, 131790, 131792, 131794, 131796, 131798, 131800, 131802, 131804, 
+    131806, 131808, 131810, 131812, 131814, 131816, 131818, 131820, 131822, 
+    131824, 131826, 131828, 131830, 131832, 131834, 131836, 131838, 131840, 
+    131842, 131844, 131846, 131848, 131850, 131852, 131854, 131856, 131858, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 131860, 131870, 131880, 131889, 131898, 131911, 
+    131924, 131936, 131948, 131958, 131968, 131978, 131988, 131999, 132010, 
+    132020, 132029, 132038, 132047, 132060, 132073, 132085, 132097, 132107, 
+    132117, 132127, 132137, 132146, 132155, 132164, 132173, 132182, 132191, 
+    132200, 132209, 132218, 132227, 132236, 132245, 132256, 132266, 132276, 
+    132289, 132299, 132312, 132319, 132329, 132336, 132343, 132350, 132357, 
+    132364, 132371, 132380, 132389, 132398, 132407, 132416, 132425, 132434, 
+    132443, 132451, 132459, 132466, 132476, 132485, 132493, 132500, 132510, 
+    132519, 132529, 132539, 132550, 132560, 132569, 132579, 132588, 132598, 
+    132606, 132610, 132614, 132618, 132622, 132626, 132630, 132634, 132638, 
+    132642, 132646, 132649, 132653, 132656, 132659, 132663, 132667, 132671, 
+    132675, 132679, 132683, 132687, 132691, 132695, 132699, 132703, 132707, 
+    132711, 132715, 132719, 132723, 132727, 132731, 132735, 132739, 132743, 
+    132747, 132751, 132755, 132759, 132763, 132767, 132771, 132775, 132779, 
+    132783, 132787, 132791, 132795, 132799, 132803, 132807, 132811, 132815, 
+    132819, 132823, 132827, 132831, 132835, 132839, 132843, 132847, 132851, 
+    132855, 132859, 132863, 132867, 132871, 132875, 132879, 132883, 132887, 
+    132891, 132895, 132899, 132903, 132907, 132911, 132915, 132919, 132923, 
+    132927, 132931, 132935, 132939, 132943, 132947, 132951, 132955, 132959, 
+    132963, 132967, 132971, 132975, 132979, 132983, 132987, 132991, 132995, 
+    132999, 133002, 133006, 133010, 133014, 133018, 133022, 133026, 133030, 
+    133034, 133038, 133042, 133046, 133050, 133054, 133058, 133062, 133066, 
+    133070, 133074, 133078, 133082, 133086, 133090, 133094, 133098, 133102, 
+    133106, 133110, 133114, 133118, 133122, 133126, 133130, 133134, 133138, 
+    133142, 133146, 133150, 133154, 133158, 133162, 133166, 133170, 133174, 
+    133178, 133182, 133186, 133190, 133194, 133198, 133202, 133206, 133210, 
+    133214, 133218, 133222, 133226, 133230, 133234, 133238, 133242, 133246, 
+    133250, 133254, 133258, 133262, 133266, 133270, 133274, 133278, 133282, 
+    133286, 133290, 133294, 133298, 133302, 133306, 133310, 133314, 133318, 
+    133322, 133326, 133330, 133334, 133338, 133342, 133346, 133350, 133354, 
+    133358, 133362, 133366, 133370, 133374, 133378, 133382, 133386, 133390, 
+    133394, 133398, 133402, 133406, 133410, 133414, 133418, 133422, 133426, 
+    133430, 133434, 133438, 133442, 133446, 133450, 133454, 133458, 133462, 
+    133466, 133470, 133474, 133478, 133482, 133486, 133490, 133494, 133498, 
+    133502, 133506, 133510, 133514, 133518, 133522, 133526, 133530, 133534, 
+    133538, 133542, 133546, 133550, 133554, 133558, 133562, 133566, 133570, 
+    133574, 133578, 133582, 133586, 133590, 133594, 133598, 133602, 133606, 
+    133610, 133614, 133618, 133622, 133626, 133630, 133634, 133638, 133642, 
+    133646, 133650, 133654, 133658, 133662, 133666, 133670, 133674, 133678, 
+    133682, 133686, 133690, 133694, 133698, 133702, 133706, 133710, 133714, 
+    133718, 133722, 133726, 133730, 133734, 133738, 133742, 133746, 133750, 
+    133754, 133758, 133762, 133766, 133771, 133776, 133781, 133785, 133791, 
+    133798, 133805, 133812, 133819, 133826, 133833, 133840, 133847, 133854, 
+    133861, 133868, 133875, 133882, 133888, 133895, 133902, 133908, 133915, 
+    133922, 133929, 133936, 133943, 133950, 133957, 133964, 133971, 133978, 
+    133985, 133992, 133999, 134005, 134011, 134018, 134025, 134034, 134043, 
+    134052, 134061, 134066, 134071, 134077, 134083, 134089, 134095, 134101, 
+    134107, 134113, 134119, 134125, 134131, 134137, 134143, 134148, 134154, 
+    134164, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
 };
 
 /* name->code dictionary */
 static unsigned int code_hash[] = {
     74224, 4851, 0, 78156, 78499, 128685, 7929, 0, 194682, 127766, 78500, 
-    66480, 0, 42833, 74529, 12064, 0, 596, 983812, 69850, 13192, 8651, 0, 0, 
+    66480, 0, 42833, 74529, 12064, 0, 596, 983821, 69850, 13192, 8651, 0, 0, 
     120218, 12995, 64865, 1373, 0, 0, 5816, 119067, 64810, 4231, 6825, 42897, 
     4233, 4234, 4232, 917836, 74415, 120210, 6384, 917840, 78108, 8851, 0, 
-    128553, 0, 41601, 8874, 983774, 7748, 0, 0, 0, 127939, 41603, 9784, 0, 
+    128553, 0, 41601, 8874, 983783, 7748, 0, 0, 0, 127939, 41603, 9784, 0, 
     9188, 41600, 0, 120618, 128343, 1457, 3535, 0, 0, 0, 0, 65240, 11951, 0, 
     3404, 0, 0, 0, 1759, 0, 41076, 68383, 120572, 119205, 66577, 94014, 
-    127764, 65859, 0, 7404, 0, 0, 0, 0, 65908, 9834, 3055, 9852, 983851, 
+    127764, 65859, 0, 7404, 0, 0, 0, 0, 65908, 9834, 3055, 9852, 983860, 
     65288, 0, 11398, 0, 92417, 119255, 0, 0, 603, 74398, 43548, 0, 0, 917824, 
     3350, 120817, 64318, 917828, 127089, 3390, 74483, 43265, 120599, 917830, 
     78573, 0, 1919, 3400, 120651, 127944, 11647, 917540, 66446, 64141, 8562, 
-    2121, 64138, 4043, 8712, 64134, 64133, 11297, 983679, 983152, 11966, 
-    64128, 128587, 0, 0, 64132, 10867, 64130, 64129, 983835, 43374, 9779, 
+    2121, 64138, 4043, 8712, 64134, 64133, 11297, 983688, 983152, 11966, 
+    64128, 128587, 0, 0, 64132, 10867, 64130, 64129, 983844, 43374, 9779, 
     2764, 66002, 10167, 9471, 0, 66021, 0, 0, 5457, 5440, 8857, 93981, 65282, 
-    2843, 5355, 127928, 983956, 0, 5194, 11657, 43984, 128292, 0, 983620, 0, 
+    2843, 5355, 127928, 983965, 0, 5194, 11657, 43984, 128292, 0, 983620, 0, 
     0, 127027, 10717, 64570, 5630, 5396, 64143, 10682, 0, 10602, 800, 42499, 
     66186, 0, 0, 64930, 11631, 64146, 64145, 64144, 762, 13172, 118859, 
     194661, 64468, 10906, 1353, 6960, 0, 0, 5828, 8724, 917806, 8933, 1601, 
     42244, 858, 7080, 64109, 64108, 8090, 0, 74401, 917811, 587, 0, 128131, 
-    0, 0, 0, 78214, 2750, 74218, 556, 64158, 64157, 983940, 12213, 194678, 
+    0, 0, 0, 78214, 2750, 74218, 556, 64158, 64157, 983949, 12213, 194678, 
     2760, 0, 0, 0, 194794, 64156, 64155, 42496, 0, 64151, 64150, 12679, 
     10053, 10421, 11093, 64153, 64152, 0, 0, 4839, 0, 0, 1874, 119016, 0, 
     6577, 64125, 64124, 64123, 0, 127531, 92534, 7007, 7590, 65443, 9036, 
@@ -17114,12 +17133,12 @@
     64102, 7859, 1945, 64099, 0, 10453, 64104, 7188, 7997, 0, 7389, 983161, 
     8705, 64097, 64096, 9571, 528, 128671, 44017, 11429, 71347, 0, 983077, 
     917990, 73841, 0, 0, 9056, 64313, 6188, 120019, 6155, 64068, 1823, 64066, 
-    64065, 64072, 64071, 63, 7233, 92212, 0, 41904, 6639, 64064, 983766, 
-    128344, 0, 1176, 118959, 127930, 8162, 128667, 983822, 0, 120519, 66376, 
+    64065, 64072, 64071, 63, 7233, 92212, 0, 41904, 6639, 64064, 983775, 
+    128344, 0, 1176, 118959, 127930, 8162, 128667, 983831, 0, 120519, 66376, 
     66242, 11415, 4333, 9855, 64112, 64642, 0, 5388, 0, 0, 0, 7714, 66222, 
-    69902, 7768, 0, 4199, 64708, 983413, 0, 0, 8708, 9560, 64077, 64076, 
+    69902, 7768, 0, 4199, 64708, 983421, 0, 0, 8708, 9560, 64077, 64076, 
     8996, 4992, 4471, 42622, 64079, 64078, 92179, 0, 126570, 0, 64615, 41915, 
-    0, 12075, 70062, 0, 5174, 983215, 0, 127557, 3123, 0, 12685, 127904, 
+    0, 12075, 70062, 0, 5174, 983217, 0, 127557, 3123, 0, 12685, 127904, 
     8408, 64704, 0, 0, 9223, 0, 41616, 67999, 73797, 0, 1116, 128204, 43049, 
     7136, 43050, 8548, 120485, 0, 119061, 917999, 0, 13115, 43675, 64091, 
     9322, 0, 120595, 64095, 64094, 8111, 66247, 42332, 64089, 64088, 6199, 0, 
@@ -17127,10 +17146,10 @@
     9927, 41335, 4118, 1797, 0, 41334, 0, 46, 43448, 127881, 298, 0, 128114, 
     0, 42627, 0, 32, 6187, 119052, 11495, 11459, 3665, 983600, 42871, 0, 
     19923, 74335, 0, 127192, 66239, 42264, 64403, 4412, 7240, 92495, 0, 
-    983458, 65758, 12750, 4181, 8544, 0, 120199, 917897, 120198, 69809, 6181, 
+    983466, 65758, 12750, 4181, 8544, 0, 120199, 917897, 120198, 69809, 6181, 
     65014, 0, 0, 983196, 3639, 119588, 0, 0, 118904, 10073, 120206, 128862, 
     127186, 68409, 42844, 7498, 1098, 92565, 120205, 0, 983118, 10207, 8789, 
-    983223, 0, 0, 983464, 9234, 0, 6182, 983466, 65058, 0, 983470, 983467, 0, 
+    983225, 0, 0, 983472, 9234, 0, 6182, 983474, 65058, 0, 983478, 983475, 0, 
     5471, 9461, 5573, 118936, 5473, 44, 0, 66244, 94072, 0, 66238, 12844, 0, 
     1622, 7767, 1900, 41339, 11458, 0, 0, 6581, 5576, 0, 64405, 41337, 0, 
     41631, 8947, 68390, 127844, 41694, 0, 0, 7908, 0, 10408, 6579, 0, 64618, 
@@ -17138,10 +17157,10 @@
     9992, 128299, 5057, 0, 0, 74538, 5054, 118951, 194971, 78606, 0, 1437, 
     41617, 658, 3497, 128509, 7486, 5061, 5060, 4235, 127878, 0, 128529, 
     12113, 4236, 4727, 0, 0, 7693, 10749, 0, 7488, 5773, 978, 128134, 0, 
-    41619, 10239, 68611, 0, 66209, 0, 128700, 9748, 983947, 127524, 0, 0, 0, 
-    0, 195083, 0, 983834, 0, 0, 0, 0, 0, 9341, 119596, 2379, 11325, 0, 64668, 
-    67854, 8125, 120545, 6743, 119175, 917940, 2369, 0, 983963, 983964, 
-    119235, 74092, 73936, 7008, 43660, 0, 0, 0, 2367, 127827, 983848, 264, 
+    41619, 10239, 68611, 0, 66209, 0, 128700, 9748, 983956, 127524, 0, 0, 0, 
+    0, 195083, 0, 983843, 0, 0, 0, 0, 0, 9341, 119596, 2379, 11325, 0, 64668, 
+    67854, 8125, 120545, 6743, 119175, 917940, 2369, 0, 983972, 983973, 
+    119235, 74092, 73936, 7008, 43660, 0, 0, 0, 2367, 127827, 983857, 264, 
     2375, 8060, 6194, 119858, 1844, 119084, 0, 6019, 0, 0, 6961, 0, 118839, 
     0, 8800, 0, 42862, 4463, 65581, 6192, 194676, 42771, 0, 92333, 725, 
     65042, 118797, 120800, 983040, 12892, 0, 0, 0, 0, 0, 0, 127261, 120707, 
@@ -17159,634 +17178,634 @@
     126503, 41607, 120115, 1679, 120116, 120180, 120113, 127462, 7005, 41609, 
     9580, 0, 401, 69949, 43779, 6968, 5761, 342, 8553, 0, 8143, 127115, 
     11983, 92249, 624, 74508, 4057, 43788, 5078, 74258, 12478, 0, 5076, 0, 
-    194609, 0, 120097, 685, 9025, 1524, 12618, 0, 5539, 0, 92523, 120102, 
-    7138, 120552, 0, 194611, 78752, 0, 12520, 8058, 9732, 0, 5080, 64775, 
-    5036, 5035, 120590, 42604, 983647, 0, 8074, 275, 13291, 1907, 78838, 
-    4432, 127271, 5033, 127273, 127272, 4836, 3888, 73792, 10729, 64546, 
-    127262, 43704, 127264, 127251, 67588, 119000, 127252, 127255, 8858, 6409, 
-    127256, 120252, 128100, 0, 0, 66321, 0, 12814, 127248, 3432, 10218, 0, 
-    6094, 7641, 42445, 0, 92487, 42406, 1676, 74320, 194607, 983177, 5030, 0, 
-    0, 0, 73869, 9622, 0, 69944, 6787, 0, 0, 0, 983583, 10544, 12919, 0, 
-    92218, 0, 0, 69906, 120789, 0, 947, 119835, 194586, 194585, 10969, 
-    119935, 7613, 92562, 119936, 4795, 119930, 7018, 7376, 120181, 120192, 
-    120268, 0, 43567, 74056, 917910, 11833, 119919, 7216, 65232, 7217, 251, 
-    7218, 7895, 4395, 43538, 119926, 119929, 119928, 7213, 119922, 7214, 
-    7215, 983827, 74141, 8880, 7685, 66459, 120173, 65540, 119618, 625, 8187, 
-    42861, 1113, 7236, 7915, 3630, 120176, 8179, 74264, 67886, 9316, 10980, 
-    2489, 65624, 8150, 1359, 67652, 127329, 127330, 73756, 5042, 5041, 42769, 
-    12084, 127324, 127321, 92279, 127319, 127320, 127317, 127318, 127315, 
-    12283, 1616, 3795, 0, 8795, 66245, 0, 0, 0, 1138, 73905, 12677, 0, 0, 
-    3239, 127311, 0, 0, 8431, 0, 42164, 0, 11778, 12620, 6826, 73773, 119073, 
-    5040, 0, 0, 983435, 78420, 0, 5039, 0, 78418, 0, 5038, 0, 0, 13184, 
-    74293, 0, 64648, 0, 9359, 78416, 0, 128770, 65157, 6662, 0, 0, 3863, 
-    73909, 4835, 55266, 43432, 127822, 4309, 7127, 194569, 0, 194568, 1301, 
-    0, 42589, 569, 0, 73813, 711, 4389, 7133, 0, 73880, 11610, 11368, 0, 
-    194570, 41331, 1006, 74240, 0, 1550, 8201, 73737, 7627, 5499, 5031, 
-    77908, 42738, 65784, 77907, 65267, 3758, 0, 65781, 64734, 70073, 2440, 
-    65780, 77913, 8449, 0, 5008, 983572, 2118, 0, 12121, 8255, 5512, 73875, 
-    2128, 2130, 2131, 2126, 2133, 1119, 127068, 2114, 2116, 2455, 0, 2122, 
-    2123, 2124, 2125, 127486, 8714, 983811, 2113, 0, 2115, 128177, 127907, 
-    43713, 5052, 66220, 5821, 6186, 65778, 65775, 5051, 65773, 1429, 42647, 
-    5050, 302, 388, 41115, 735, 6637, 5907, 65088, 0, 12726, 74594, 9117, 
-    983181, 12003, 5513, 6666, 5053, 74230, 5510, 78451, 0, 78447, 2470, 
-    78437, 0, 1925, 0, 92237, 74807, 0, 5048, 5047, 0, 0, 0, 92313, 0, 74497, 
-    92395, 8089, 6929, 639, 983563, 68179, 64442, 0, 92348, 4599, 41402, 
-    6674, 43397, 43294, 1476, 648, 0, 65819, 3233, 0, 41782, 6951, 94017, 
-    983967, 3530, 9750, 128317, 0, 6656, 42618, 0, 5046, 8512, 65856, 74261, 
-    8967, 0, 5045, 42026, 1916, 7986, 5044, 120556, 9006, 13128, 5043, 0, 
-    7853, 74068, 74004, 9669, 12341, 12703, 8402, 0, 119070, 917600, 41750, 
-    3586, 64508, 43148, 0, 0, 119606, 67983, 13296, 517, 0, 128534, 194946, 
-    41528, 123, 65454, 0, 0, 74478, 10531, 7784, 41526, 10829, 73991, 8057, 
-    1126, 73895, 0, 194591, 0, 3925, 4251, 8069, 10517, 120439, 489, 0, 4250, 
-    120441, 120452, 43151, 983178, 194851, 66200, 0, 0, 0, 78423, 0, 0, 8711, 
-    6183, 0, 0, 0, 120448, 7623, 118925, 118889, 9235, 12760, 74176, 69662, 
-    66445, 43540, 10062, 3743, 11514, 11078, 0, 12136, 0, 126597, 120435, 0, 
-    7726, 0, 19922, 267, 3393, 42198, 1371, 194849, 69233, 2458, 0, 6201, 0, 
-    41074, 4266, 10652, 41612, 41077, 3402, 9050, 3398, 0, 983340, 0, 3391, 
-    41075, 2476, 0, 128017, 0, 10625, 0, 12767, 13017, 78743, 64261, 64934, 
-    127537, 13014, 13013, 0, 6673, 0, 0, 0, 12438, 0, 983334, 0, 983871, 
-    126638, 9053, 13015, 74523, 0, 704, 66215, 6195, 983819, 6660, 78758, 
-    917760, 917793, 42212, 12629, 11435, 0, 55256, 65538, 0, 127940, 983333, 
-    74547, 126585, 65448, 78100, 12948, 119001, 195002, 119238, 195004, 
-    78099, 127085, 0, 128320, 4287, 8276, 4902, 1131, 0, 78458, 66728, 1816, 
-    0, 42533, 168, 42845, 4898, 64298, 983141, 0, 4901, 1821, 0, 578, 3653, 
-    0, 791, 9162, 6977, 0, 78889, 74561, 0, 73731, 8354, 43590, 119303, 
-    983441, 7557, 119339, 119301, 8234, 7241, 0, 120671, 119167, 194996, 
-    12811, 65925, 3946, 78078, 10998, 78080, 673, 194867, 64397, 128276, 
-    74599, 78449, 8890, 194977, 194976, 2448, 78085, 10267, 8424, 2452, 
-    78083, 128824, 8729, 78456, 0, 7845, 917917, 71302, 4408, 4122, 6772, 
-    11039, 8723, 194990, 71310, 119302, 731, 119304, 92286, 2438, 64855, 
-    119300, 119299, 1175, 0, 42135, 373, 119172, 2119, 11457, 11521, 7723, 0, 
-    0, 0, 41952, 0, 5273, 2127, 5269, 6337, 5202, 2404, 5267, 42823, 11291, 
-    19915, 5277, 12963, 127864, 6189, 4125, 1314, 12133, 120340, 118873, 
-    1271, 983631, 0, 66024, 41482, 3864, 74539, 0, 3879, 0, 12978, 4166, 
-    4574, 0, 7567, 7459, 983160, 41390, 5384, 41882, 67647, 92548, 5759, 
-    983903, 0, 41388, 64446, 41392, 64288, 41387, 0, 8706, 5552, 983187, 700, 
-    0, 5553, 0, 7088, 5356, 7499, 68007, 66596, 74066, 0, 10263, 5554, 0, 
-    12344, 10311, 78113, 6665, 92626, 0, 7618, 8517, 11455, 78440, 64632, 
-    64447, 5555, 78088, 78093, 78091, 0, 42803, 65033, 9143, 6668, 195067, 
-    67995, 195069, 656, 195071, 65037, 4577, 64624, 0, 0, 0, 983640, 4269, 
-    73885, 917775, 42846, 69644, 950, 0, 92273, 66580, 118895, 66683, 10554, 
-    917778, 119121, 0, 5098, 917770, 0, 119099, 5097, 4935, 9848, 10381, 0, 
-    128870, 983692, 3651, 0, 120730, 127556, 5102, 5101, 10269, 12983, 8138, 
-    4517, 1932, 5100, 1439, 12093, 1247, 10034, 195064, 5099, 78373, 1441, 
-    42087, 3063, 650, 0, 7838, 0, 195041, 195040, 119142, 9031, 120790, 
-    128582, 9078, 8545, 66356, 128799, 0, 9154, 9118, 126543, 0, 2676, 2277, 
-    0, 73812, 6190, 8599, 195053, 69918, 10795, 9857, 7014, 9856, 195033, 
-    92620, 12129, 0, 8481, 0, 6202, 195035, 10920, 128237, 5203, 195039, 
-    195038, 5108, 5107, 65818, 66019, 9762, 0, 5541, 74772, 0, 12613, 5284, 
-    6657, 207, 128806, 4275, 74819, 854, 68147, 74381, 0, 78786, 5103, 
-    127861, 64348, 41368, 43974, 488, 69811, 0, 71339, 10157, 0, 43034, 
-    11438, 64674, 0, 92694, 68431, 41771, 5106, 6669, 8504, 65154, 69813, 
-    41367, 5105, 127509, 69720, 6476, 5104, 983740, 304, 3176, 119010, 0, 
-    932, 120633, 6567, 238, 69656, 195011, 194595, 19905, 120577, 195015, 
-    78870, 41044, 67640, 194902, 42055, 9912, 65939, 10670, 74093, 13273, 0, 
-    12552, 195019, 8803, 309, 6622, 8151, 10858, 78706, 67636, 0, 12568, 0, 
-    12553, 10814, 43275, 6950, 9712, 68680, 43970, 983198, 65165, 92725, 0, 
-    66466, 0, 0, 0, 66725, 6191, 11351, 10437, 11316, 67634, 43763, 0, 41754, 
-    67635, 9370, 2720, 194975, 68462, 8232, 118817, 0, 3222, 0, 0, 0, 66663, 
-    0, 0, 10834, 0, 0, 65732, 94095, 917547, 92682, 67679, 195020, 0, 7781, 
-    41383, 64568, 0, 120738, 12077, 0, 64586, 917620, 42396, 55255, 3475, 
-    128035, 2479, 0, 3632, 120728, 10698, 8376, 3648, 194960, 74844, 67639, 
-    3636, 67894, 3650, 8837, 65229, 1843, 42283, 43250, 41562, 9100, 74548, 
-    917630, 3640, 127190, 42321, 7284, 194974, 194973, 194950, 194949, 
-    194952, 194951, 126649, 194953, 42080, 2529, 0, 0, 0, 42083, 120678, 
-    68398, 194957, 67619, 66367, 194958, 9634, 92380, 9988, 0, 41068, 0, 
-    4295, 65264, 68006, 0, 92545, 0, 785, 8236, 128647, 9027, 68160, 67623, 
-    64383, 120265, 925, 127156, 0, 41985, 41071, 9586, 0, 41984, 9217, 0, 0, 
-    0, 9186, 2067, 4016, 983794, 0, 381, 12936, 0, 42077, 0, 69880, 5184, 
-    42078, 194947, 10810, 128531, 4585, 19943, 5860, 67633, 0, 0, 812, 3615, 
-    0, 5178, 44000, 120548, 78807, 5188, 74287, 67629, 3605, 10692, 1166, 
-    64429, 42639, 924, 0, 67631, 42616, 120670, 2442, 10703, 78789, 67632, 
-    917924, 12771, 12736, 12753, 66708, 73933, 67626, 42401, 0, 69872, 
-    127373, 42288, 12751, 0, 8542, 13145, 194963, 2468, 66706, 41294, 3626, 
-    3883, 64388, 42479, 0, 41117, 0, 92580, 0, 0, 67624, 0, 1290, 0, 65585, 
-    2715, 806, 65208, 41884, 917883, 1318, 64731, 126578, 0, 0, 66325, 3465, 
-    2405, 9240, 0, 12756, 65259, 0, 983772, 12752, 5833, 1432, 0, 41883, 
-    73912, 9799, 0, 41886, 2480, 0, 2062, 127293, 6494, 5537, 78656, 0, 
-    194587, 0, 1211, 0, 0, 0, 118832, 12318, 0, 0, 68005, 10622, 983770, 0, 
-    78654, 6566, 78659, 0, 73780, 119196, 64864, 0, 78660, 0, 8284, 13081, 0, 
-    3589, 42051, 4035, 6492, 92236, 4265, 6642, 3977, 74186, 41778, 836, 
-    119216, 2488, 0, 4582, 0, 0, 41777, 12926, 983369, 7528, 10550, 0, 92706, 
-    0, 10961, 0, 1374, 64878, 119014, 0, 42389, 41374, 2286, 0, 78492, 41377, 
-    127909, 0, 400, 12597, 120586, 0, 0, 6661, 983145, 64827, 0, 73817, 390, 
-    0, 71301, 983853, 3473, 7718, 0, 0, 0, 55285, 0, 0, 0, 11969, 983382, 
-    127841, 6365, 1887, 6763, 983362, 8080, 7006, 0, 983363, 6757, 64351, 
-    1544, 0, 6766, 64677, 120716, 983364, 6146, 0, 771, 983365, 0, 12812, 
-    13168, 42272, 12200, 917927, 7904, 0, 953, 12917, 119560, 12300, 0, 
-    11491, 9724, 10341, 983764, 9524, 7490, 11389, 7489, 3379, 0, 7487, 0, 
-    471, 7484, 7482, 6753, 7480, 5764, 7478, 7477, 6501, 7475, 6918, 7473, 
-    7472, 2474, 7470, 7468, 10232, 10615, 10213, 127288, 92357, 10049, 11834, 
-    3544, 0, 6017, 65311, 127481, 120216, 13306, 10533, 7870, 73949, 7625, 0, 
-    120544, 0, 0, 92660, 0, 0, 0, 19961, 2472, 42665, 92341, 0, 2139, 4256, 
-    120776, 74380, 0, 42675, 42658, 12845, 0, 0, 65138, 119355, 67862, 0, 
-    65671, 7083, 120008, 8066, 7678, 74865, 0, 0, 0, 0, 7186, 0, 120555, 0, 
-    445, 120566, 128308, 0, 0, 8330, 0, 0, 42797, 983150, 120215, 0, 3902, 0, 
-    1770, 0, 128866, 1560, 120209, 194972, 4584, 73843, 0, 11712, 10866, 
-    118928, 1118, 71334, 0, 0, 1081, 7436, 68420, 7252, 0, 5996, 69921, 4903, 
-    0, 41386, 5162, 119189, 1330, 0, 7139, 0, 12047, 41384, 0, 0, 1848, 4334, 
-    6324, 41975, 64777, 10674, 12308, 12186, 0, 0, 983732, 12715, 68002, 
-    983471, 126630, 2018, 66672, 41979, 66685, 119157, 68000, 92464, 0, 
-    126984, 68001, 9334, 92705, 92315, 70101, 7975, 0, 77957, 0, 66621, 4884, 
-    66597, 69732, 0, 0, 6313, 65513, 69857, 0, 0, 0, 2345, 43697, 463, 0, 0, 
-    119607, 3117, 5460, 0, 0, 983379, 0, 42279, 194577, 0, 78415, 0, 195008, 
-    983376, 13248, 0, 0, 0, 0, 0, 0, 5663, 0, 0, 0, 0, 2482, 1471, 0, 0, 
-    42247, 12378, 73925, 69664, 0, 12374, 0, 0, 0, 983685, 2460, 0, 11944, 
-    12376, 127868, 64679, 0, 12380, 10557, 64473, 5870, 0, 2024, 127180, 0, 
-    0, 539, 0, 127765, 94052, 3853, 65180, 127923, 120796, 120245, 92324, 0, 
-    8659, 0, 12474, 92579, 9503, 194969, 2478, 0, 4162, 0, 4260, 12953, 
-    69633, 120089, 12470, 0, 74189, 2742, 12476, 11798, 10946, 127310, 5000, 
-    0, 983579, 0, 69672, 8213, 74017, 7771, 6161, 68018, 6709, 0, 78885, 
-    983699, 127971, 120582, 78547, 0, 10301, 10333, 10397, 0, 0, 73791, 0, 0, 
-    0, 0, 119123, 4014, 12842, 73952, 12015, 127290, 8275, 3893, 983256, 0, 
-    12210, 7221, 42147, 0, 74550, 74465, 64747, 118841, 0, 12516, 4444, 0, 
-    92271, 74537, 10892, 8231, 0, 6473, 41968, 78388, 41973, 3591, 41969, 0, 
-    2453, 128549, 92666, 64705, 0, 0, 10349, 10413, 43591, 41962, 3202, 
-    74353, 0, 8316, 0, 0, 94060, 687, 0, 0, 0, 1840, 0, 68671, 119809, 4883, 
-    285, 4723, 70099, 92692, 4459, 74577, 42921, 41720, 11089, 240, 19906, 0, 
-    42323, 0, 9743, 120232, 13134, 126535, 0, 0, 0, 0, 42634, 983335, 43437, 
-    3081, 11463, 120154, 0, 0, 10445, 0, 0, 66717, 2614, 9125, 119023, 1729, 
-    0, 120236, 65221, 63883, 43334, 64852, 0, 65194, 66201, 0, 66578, 5001, 
-    41879, 74427, 4121, 5003, 884, 66700, 63879, 4943, 5150, 73889, 74182, 
-    127915, 643, 3086, 0, 42448, 42299, 58, 0, 917952, 120083, 63873, 8491, 
-    0, 0, 0, 4530, 42409, 7126, 194575, 2721, 120074, 119096, 19929, 0, 
-    194574, 0, 4242, 4264, 120077, 120530, 66179, 42412, 65941, 13114, 64522, 
-    10740, 3094, 0, 9754, 119102, 4437, 73948, 127074, 983232, 55280, 42174, 
-    194925, 42430, 0, 0, 42355, 66026, 4306, 41380, 68432, 92586, 0, 66667, 
-    127309, 0, 126521, 42200, 42566, 0, 0, 5088, 6948, 0, 8524, 0, 0, 12385, 
-    0, 0, 69646, 1386, 64580, 11480, 6116, 65039, 65038, 12392, 65036, 8064, 
-    0, 12101, 5822, 119004, 2080, 710, 77999, 11663, 1666, 42091, 119657, 
-    12383, 43671, 42092, 68418, 4289, 0, 63896, 12061, 42096, 43621, 3362, 
-    12377, 983823, 983825, 68449, 7461, 73901, 1244, 331, 73786, 12683, 
-    10662, 0, 8112, 0, 65852, 0, 12379, 194877, 120818, 41964, 42208, 63843, 
-    2084, 41965, 0, 65866, 4327, 0, 63840, 78549, 41220, 13032, 0, 584, 
-    12933, 43177, 12373, 69855, 13000, 1351, 2935, 8698, 12665, 0, 1930, 0, 
-    78229, 12427, 66514, 69859, 13031, 0, 63901, 0, 3657, 128572, 65202, 
-    6000, 119206, 12426, 127181, 0, 41740, 12428, 41283, 41916, 119210, 0, 0, 
-    12429, 6727, 0, 7562, 0, 5170, 0, 41755, 676, 0, 66704, 66664, 9978, 
-    66491, 3536, 0, 9752, 92397, 6162, 0, 69228, 10113, 41829, 65886, 5159, 
-    12422, 41832, 439, 43077, 0, 42207, 74549, 11796, 40970, 41830, 0, 
-    917799, 8308, 917797, 917796, 0, 67864, 917801, 917800, 12336, 4135, 
-    69805, 341, 2727, 4129, 3539, 0, 63861, 0, 7913, 0, 63859, 4131, 63868, 
-    0, 63867, 4133, 11371, 210, 4600, 0, 74560, 4137, 8082, 78506, 119062, 
-    78504, 6704, 4591, 128029, 0, 0, 9680, 0, 120623, 561, 12159, 195, 78508, 
-    41501, 0, 42031, 5719, 7172, 42687, 8368, 0, 41499, 0, 0, 42242, 41498, 
-    917794, 42025, 78565, 65805, 42463, 0, 2924, 0, 120510, 0, 0, 119213, 
-    73941, 0, 42330, 917784, 3969, 0, 0, 7169, 1992, 9652, 73977, 7246, 
-    42086, 126615, 2219, 0, 0, 128801, 194837, 0, 327, 0, 9042, 917777, 
-    917776, 65148, 12433, 917781, 127276, 917779, 12431, 8668, 12434, 983826, 
-    917782, 5999, 0, 7712, 12432, 128243, 43653, 1726, 1015, 0, 8212, 0, 
-    128014, 42423, 119066, 0, 128108, 66709, 0, 8811, 927, 0, 0, 12436, 
-    983239, 42021, 0, 0, 1299, 12240, 42350, 65143, 0, 195016, 0, 78197, 
-    11348, 0, 78037, 9194, 983184, 0, 19914, 12179, 983803, 2296, 194923, 
-    63836, 63832, 917773, 10967, 63816, 2594, 3444, 63817, 64651, 0, 41503, 
-    127478, 11265, 0, 120756, 194922, 0, 5664, 3972, 0, 0, 0, 128508, 12416, 
-    917764, 119608, 10816, 917769, 917768, 12418, 74111, 3882, 8532, 917771, 
-    1573, 128648, 119847, 4596, 66339, 12417, 66001, 65343, 126491, 12414, 
-    8287, 68219, 195017, 68108, 1143, 119169, 119846, 12415, 6626, 42763, 0, 
-    118884, 9021, 120783, 0, 11724, 0, 0, 127104, 126619, 0, 0, 8027, 10997, 
-    9171, 12741, 11400, 71305, 194799, 0, 128239, 0, 128881, 119604, 127523, 
-    120190, 194773, 67608, 128214, 42368, 0, 7715, 3881, 41487, 12118, 42514, 
-    68651, 0, 983886, 3009, 41476, 41489, 69825, 3007, 1448, 3018, 194809, 
-    3889, 8521, 5083, 5082, 119859, 120184, 8519, 983235, 3014, 5081, 65853, 
-    120715, 0, 68014, 69951, 5079, 64802, 42210, 4597, 65532, 11828, 120185, 
-    12371, 0, 8407, 0, 10805, 8518, 10779, 120188, 71303, 983924, 12367, 
-    42170, 0, 92557, 629, 1924, 0, 12037, 74366, 5987, 8462, 8005, 12365, 
-    63933, 69735, 120815, 12369, 10649, 67981, 5077, 120174, 10880, 63927, 
-    5075, 917881, 0, 65075, 0, 11007, 983696, 66659, 92607, 0, 66684, 0, 
-    3434, 4954, 1904, 0, 5266, 126980, 5272, 10499, 4507, 9578, 63923, 
-    120177, 7979, 0, 9831, 0, 194926, 461, 9803, 0, 4504, 1505, 0, 6325, 
-    5276, 43021, 120488, 0, 55236, 0, 66461, 5177, 41324, 12055, 8722, 0, 
-    41327, 0, 66695, 4114, 409, 4383, 8900, 8948, 41325, 0, 721, 10182, 9108, 
-    71311, 0, 119185, 42229, 194912, 0, 5998, 0, 42353, 74825, 0, 12587, 
-    94104, 78571, 0, 71328, 194562, 41576, 42215, 78570, 119207, 0, 8578, 
-    5995, 7573, 41575, 74789, 74752, 63944, 63949, 64767, 2670, 4167, 194796, 
-    11723, 0, 74120, 0, 65076, 938, 43414, 73854, 11737, 9721, 0, 0, 0, 
-    11742, 2419, 0, 11493, 12334, 194913, 4153, 12302, 10793, 5250, 12407, 
-    11978, 4404, 9189, 12401, 42007, 5775, 6759, 65806, 43997, 0, 42002, 
-    12404, 983553, 0, 4940, 12410, 7683, 1167, 73729, 4983, 120507, 861, 0, 
-    0, 0, 0, 43757, 43370, 0, 0, 11956, 0, 0, 0, 9616, 6631, 0, 12816, 43759, 
-    42218, 12710, 68674, 12721, 4101, 66185, 0, 5992, 7616, 195044, 0, 12577, 
-    0, 983875, 853, 42693, 195014, 0, 983638, 5016, 43535, 63893, 42835, 
-    9491, 917913, 0, 917914, 0, 12712, 7105, 127807, 65060, 120797, 9900, 
-    7750, 0, 194919, 0, 127830, 0, 64778, 12585, 10565, 128151, 12177, 0, 0, 
-    0, 77824, 0, 4900, 127874, 12878, 92630, 8984, 4119, 74768, 8971, 78593, 
-    43113, 9702, 78594, 11025, 9245, 13048, 4927, 4138, 74185, 92481, 92710, 
-    12397, 77827, 0, 13054, 12394, 0, 0, 0, 13053, 0, 3948, 10781, 1546, 0, 
-    5010, 1680, 10507, 78590, 78583, 0, 0, 0, 194915, 7267, 0, 74833, 128181, 
-    5993, 2819, 0, 12706, 77840, 1893, 7266, 63915, 7264, 7265, 0, 1363, 0, 
-    63997, 63910, 63996, 3077, 0, 0, 1512, 69929, 12589, 41479, 128313, 0, 
-    43339, 0, 9836, 120727, 0, 41481, 43335, 7832, 42343, 3090, 43337, 817, 
-    1664, 1850, 128841, 3079, 11340, 42408, 42447, 127140, 120020, 42307, 
-    12386, 42304, 917555, 0, 12389, 0, 92366, 41996, 11526, 63985, 5864, 
-    1147, 63992, 42887, 1987, 92718, 5480, 7858, 11653, 4116, 12391, 66193, 
-    0, 4939, 12384, 0, 0, 41686, 63905, 119601, 194688, 983190, 0, 12649, 0, 
-    0, 8247, 507, 91, 2042, 120775, 43643, 194689, 66028, 10036, 41844, 
-    119813, 774, 119829, 0, 119815, 5994, 12539, 0, 78375, 120597, 119833, 
-    983105, 119600, 0, 0, 7719, 6026, 2486, 128312, 119808, 162, 0, 65219, 
-    41073, 9687, 41681, 6304, 119812, 66196, 194881, 5262, 0, 55233, 12681, 
-    42379, 0, 7534, 12219, 0, 127528, 42810, 10492, 0, 983652, 0, 43119, 0, 
-    120753, 12403, 2500, 195013, 0, 4899, 12729, 0, 0, 74113, 2343, 4103, 
-    19946, 74112, 77851, 13112, 0, 195012, 12859, 70087, 120148, 66369, 5861, 
-    127758, 11999, 12400, 0, 983830, 12645, 5146, 11320, 68410, 6748, 65040, 
-    0, 64184, 12974, 64183, 67613, 120645, 5147, 0, 0, 74524, 0, 1928, 0, 
-    67649, 5991, 3445, 67609, 4976, 64176, 0, 67610, 8241, 0, 77868, 4206, 0, 
-    0, 0, 128298, 0, 10138, 0, 0, 8897, 120234, 0, 8357, 4124, 77862, 65836, 
-    120641, 127926, 77859, 0, 0, 1123, 963, 41553, 10120, 12405, 120150, 
-    92664, 398, 13278, 9723, 6366, 120311, 7945, 0, 4402, 9970, 12402, 
-    983136, 42392, 1305, 12408, 0, 44007, 0, 0, 41464, 12411, 12969, 120824, 
-    41465, 983565, 8528, 1575, 0, 63955, 165, 3024, 41467, 119163, 0, 9093, 
-    0, 9147, 128787, 63958, 0, 9148, 9692, 4096, 53, 73776, 6750, 195018, 0, 
-    9594, 0, 0, 43527, 0, 727, 194703, 195023, 5805, 0, 6726, 0, 42176, 
-    12370, 11655, 119095, 10591, 2280, 0, 12372, 120642, 120307, 0, 92343, 0, 
-    12366, 10963, 6066, 1329, 0, 3052, 9220, 0, 64478, 194701, 10803, 4132, 
-    120306, 68474, 92473, 0, 983305, 74837, 120155, 1499, 0, 8055, 42740, 
-    63965, 0, 63962, 74042, 8924, 43123, 5988, 3660, 63969, 11781, 42718, 
-    8788, 1357, 64851, 65743, 0, 8774, 0, 127086, 9941, 120172, 0, 1933, 
-    69655, 9564, 0, 92435, 73866, 0, 0, 2487, 67614, 3121, 1804, 3311, 67615, 
-    70081, 78302, 12220, 67616, 120598, 127475, 0, 68200, 6675, 128144, 0, 
-    67592, 120685, 0, 64771, 1198, 9132, 0, 64619, 510, 64663, 0, 0, 4561, 
-    2101, 1398, 0, 92554, 74034, 41569, 92684, 11406, 8167, 12127, 0, 840, 0, 
-    126518, 7101, 6967, 0, 194898, 9796, 0, 333, 69891, 0, 8144, 2117, 0, 
-    983595, 12406, 0, 19931, 119089, 6678, 7769, 0, 12621, 0, 127366, 10227, 
-    4764, 43101, 9981, 0, 40986, 4127, 66487, 0, 42202, 12754, 195022, 0, 0, 
-    94097, 67594, 2048, 12944, 4050, 67595, 917967, 43102, 10581, 12985, 
-    4533, 195021, 74003, 6490, 0, 12038, 0, 0, 120704, 65461, 9798, 69704, 0, 
-    1948, 69841, 0, 952, 128235, 0, 0, 120802, 6449, 9494, 120313, 0, 43098, 
-    4843, 8142, 64160, 4098, 64170, 0, 0, 3436, 119973, 0, 12817, 67597, 
-    6676, 3930, 42615, 0, 0, 67598, 0, 0, 0, 65591, 41581, 65916, 1453, 0, 0, 
-    0, 8500, 42222, 120142, 73743, 120400, 4317, 11543, 67676, 64676, 0, 0, 
-    67606, 119083, 0, 42217, 13102, 0, 66003, 6672, 0, 0, 0, 983738, 63841, 
-    9613, 9001, 4526, 11274, 67601, 64520, 64210, 6664, 78704, 42056, 10228, 
-    64957, 11281, 0, 3807, 1469, 66640, 65381, 42197, 4988, 42372, 0, 9598, 
-    904, 352, 42225, 1451, 8061, 8453, 4134, 0, 74847, 66576, 127916, 0, 
-    10520, 8575, 9960, 1201, 127289, 12846, 127291, 127292, 11919, 64962, 
-    127287, 43739, 127281, 8511, 9460, 823, 11587, 12305, 0, 64695, 127305, 
-    12387, 1253, 13183, 65766, 500, 42783, 65765, 64208, 64369, 65760, 65761, 
-    119585, 11606, 64784, 11702, 66498, 9821, 64304, 0, 5152, 11048, 7533, 
-    68366, 64410, 92305, 0, 4323, 120062, 92669, 71332, 127052, 42587, 42214, 
-    41394, 0, 4763, 4112, 118935, 0, 5260, 43143, 94038, 326, 120131, 68423, 
-    0, 10771, 2876, 74074, 92530, 194924, 41398, 7382, 9802, 127077, 127076, 
-    453, 41396, 120524, 42720, 12140, 9572, 0, 7003, 194883, 42334, 7704, 
-    126490, 194885, 43144, 4123, 8494, 43146, 9977, 0, 0, 65759, 10765, 
-    64061, 4465, 9808, 64056, 65582, 4126, 0, 9521, 9589, 64755, 0, 64020, 
-    126604, 10464, 0, 0, 194869, 64514, 11528, 64024, 128072, 679, 64013, 0, 
-    5850, 758, 7536, 0, 92234, 41441, 10693, 64006, 983567, 64005, 4058, 
-    119019, 126487, 64660, 0, 119050, 0, 983069, 1139, 43298, 64027, 64029, 
-    8970, 0, 9934, 983094, 10774, 128020, 42201, 12421, 128216, 0, 1852, 
-    3057, 64046, 73744, 64034, 64039, 0, 0, 0, 194899, 92322, 7645, 12854, 
-    74338, 3496, 0, 0, 0, 9102, 627, 127795, 6158, 8327, 74553, 66632, 12419, 
-    13309, 11570, 127811, 19960, 11696, 0, 1018, 118970, 194909, 194897, 
-    1682, 194896, 194911, 42756, 6765, 194906, 0, 0, 73814, 11412, 6768, 
-    10728, 194830, 71316, 118863, 43311, 64966, 11577, 0, 43040, 1833, 11576, 
-    0, 74779, 0, 185, 65085, 74533, 64754, 194848, 7535, 8085, 42525, 120387, 
-    9749, 41701, 6131, 1949, 4117, 7847, 120489, 194711, 64483, 65693, 0, 0, 
-    0, 69695, 42240, 0, 126651, 42864, 126498, 64667, 41868, 1184, 0, 815, 
-    11484, 127535, 67840, 983642, 0, 66197, 0, 10986, 64683, 983776, 0, 3455, 
-    0, 0, 9879, 0, 0, 4158, 128050, 68166, 0, 0, 0, 0, 69645, 332, 118808, 0, 
-    5142, 2407, 69643, 42199, 0, 92404, 74373, 0, 55217, 0, 63870, 43163, 0, 
-    0, 92390, 42867, 1834, 0, 92461, 69817, 10940, 65249, 119040, 8662, 0, 0, 
-    2652, 120527, 7164, 10784, 195093, 67674, 0, 92233, 92482, 194749, 74562, 
-    917505, 1828, 74474, 120327, 78620, 8531, 12499, 6280, 12324, 118854, 
-    65238, 68374, 4832, 65573, 0, 6279, 12508, 12904, 12502, 9161, 0, 1620, 
-    64436, 3601, 195094, 128073, 983562, 609, 11555, 983099, 12496, 127839, 
-    74181, 4343, 12505, 0, 127863, 0, 11377, 239, 0, 637, 0, 0, 42671, 0, 0, 
-    0, 43565, 71306, 126493, 12696, 128256, 0, 94062, 12929, 0, 712, 0, 4197, 
-    983204, 42818, 126632, 0, 120490, 0, 119137, 1506, 43562, 0, 92491, 0, 
-    12651, 0, 64628, 74517, 12058, 74084, 917838, 7494, 0, 4924, 65592, 
-    118844, 0, 127088, 355, 9719, 127087, 13066, 64796, 0, 0, 12033, 42178, 
-    0, 69760, 42571, 92635, 0, 0, 0, 0, 0, 127176, 3178, 0, 0, 92704, 0, 
-    9080, 127000, 120352, 0, 68209, 0, 11082, 0, 5699, 195100, 66000, 9488, 
-    65166, 119112, 0, 0, 0, 0, 71313, 0, 5265, 69235, 0, 11487, 67858, 12464, 
-    0, 43045, 0, 0, 43345, 0, 10770, 118994, 6807, 465, 9829, 0, 74348, 0, 
-    43346, 8116, 795, 0, 0, 12462, 10930, 10831, 0, 118952, 64362, 74334, 
-    983602, 120811, 0, 12468, 8607, 1008, 0, 10092, 195078, 917842, 67855, 
-    55257, 73771, 1766, 11282, 11996, 1820, 4547, 0, 0, 0, 0, 13223, 128665, 
-    64595, 127294, 0, 92311, 4345, 12616, 0, 0, 0, 74467, 0, 0, 0, 5382, 0, 
-    0, 0, 119060, 64953, 5406, 19920, 69897, 66510, 3590, 194864, 1130, 0, 0, 
-    42016, 11823, 43023, 0, 118896, 7742, 0, 13280, 71323, 9326, 73826, 5310, 
-    74812, 78584, 92229, 8959, 43589, 6747, 66723, 0, 8568, 0, 120496, 73816, 
-    120803, 983839, 42670, 0, 11621, 12460, 0, 120631, 0, 43063, 74519, 
-    127182, 0, 73917, 7843, 69783, 11689, 5410, 5783, 10468, 8403, 5400, 
-    11594, 128247, 0, 118990, 10491, 69842, 64412, 0, 0, 5587, 42865, 64404, 
-    8268, 4923, 65086, 8981, 12382, 42133, 120755, 9706, 69738, 0, 66610, 
-    10461, 12103, 0, 8642, 0, 42766, 983857, 2210, 9983, 0, 94009, 0, 0, 0, 
-    7398, 41515, 0, 11802, 8041, 1461, 910, 119133, 0, 6749, 3658, 93964, 
-    120525, 0, 7617, 194841, 12888, 127983, 67668, 13143, 0, 9193, 11097, 
-    5703, 0, 41517, 41504, 41519, 10016, 64305, 0, 65864, 623, 781, 670, 
-    10660, 5769, 613, 7543, 120279, 477, 41083, 92521, 0, 592, 1578, 12459, 
-    43449, 0, 0, 8225, 0, 654, 11345, 653, 652, 0, 647, 0, 633, 120744, 0, 
-    126472, 12480, 43243, 0, 39, 12487, 0, 120529, 74199, 12482, 0, 12489, 0, 
-    3195, 5550, 983554, 7897, 0, 1203, 74396, 1813, 64544, 41311, 12090, 0, 
-    2877, 0, 0, 1675, 69840, 0, 0, 0, 10070, 10595, 0, 119077, 194777, 
-    983611, 0, 0, 0, 43244, 0, 0, 983907, 119561, 983078, 0, 194921, 128160, 
-    9939, 0, 983151, 77860, 0, 0, 270, 0, 10714, 0, 0, 0, 0, 0, 65372, 0, 
-    74038, 119558, 6273, 66679, 364, 9595, 194908, 0, 0, 707, 0, 0, 9282, 
-    66489, 224, 0, 68670, 9332, 4966, 68677, 0, 68644, 0, 3841, 68634, 0, 
-    10732, 68640, 850, 4972, 0, 12890, 2909, 68619, 44008, 68627, 983709, 
-    11544, 10203, 9608, 0, 0, 11962, 194694, 12507, 1196, 128687, 128311, 
-    777, 120187, 4375, 65271, 67678, 0, 12198, 0, 64824, 119343, 983230, 
-    9454, 63778, 8658, 42528, 78000, 2705, 917975, 41520, 0, 0, 11986, 7765, 
-    42502, 8280, 74520, 2701, 0, 127002, 5767, 0, 0, 9809, 8353, 63747, 
-    66701, 63772, 983805, 63745, 1748, 63770, 0, 0, 0, 65542, 63766, 55244, 
-    3061, 0, 63764, 63787, 9067, 6096, 0, 7694, 0, 7257, 63768, 3485, 12987, 
-    0, 127522, 120628, 63807, 1591, 0, 6386, 63783, 0, 0, 92535, 0, 0, 0, 
-    74575, 0, 65719, 13083, 64574, 65012, 0, 1640, 12495, 66691, 7624, 3138, 
-    10996, 92247, 1922, 0, 12498, 10987, 69936, 69939, 3894, 65543, 0, 
-    194842, 983588, 493, 0, 43197, 1717, 4228, 479, 10303, 74020, 0, 917935, 
-    10335, 3520, 917932, 12490, 64315, 0, 127039, 12493, 6233, 42681, 1002, 
-    12491, 0, 64911, 92615, 2096, 65120, 0, 78219, 983081, 11611, 11632, 
-    127041, 66213, 63864, 66221, 66226, 66229, 13218, 66231, 66216, 8507, 
-    66236, 66211, 66218, 92672, 66240, 78041, 66233, 8928, 983552, 7909, 
-    66234, 11605, 63759, 983645, 66208, 73999, 63799, 63803, 244, 11542, 
-    12898, 12494, 73761, 12492, 12669, 0, 0, 74153, 0, 128278, 120680, 4882, 
-    13040, 0, 8612, 4885, 74053, 0, 13042, 4880, 64662, 2429, 1360, 248, 0, 
-    63797, 92394, 42358, 0, 7292, 0, 63756, 42786, 66693, 0, 1870, 78040, 
-    470, 78038, 78035, 78036, 70028, 78034, 4579, 128090, 0, 12511, 74453, 
-    12514, 0, 74579, 7239, 7001, 8623, 94011, 128052, 128048, 7378, 12512, 
-    11615, 6104, 0, 0, 659, 6098, 0, 12234, 127307, 127067, 8311, 12510, 
-    41803, 13039, 127072, 12513, 10202, 12471, 0, 8747, 983911, 0, 0, 2323, 
-    0, 2319, 77917, 12477, 77916, 2311, 0, 4415, 237, 6281, 127280, 0, 0, 
-    2309, 1312, 8173, 128871, 12469, 0, 78505, 64335, 10609, 0, 128111, 9397, 
-    11524, 9395, 9396, 9393, 9394, 9391, 9392, 9389, 6209, 9387, 9388, 4932, 
-    9386, 9383, 9384, 6740, 0, 65451, 8185, 0, 917832, 43024, 43336, 67659, 
-    2313, 128167, 7948, 9236, 92571, 0, 0, 10570, 43473, 6289, 10484, 0, 0, 
-    11998, 12082, 10924, 3147, 0, 120684, 12524, 119081, 2310, 11818, 9381, 
-    9382, 9379, 9380, 9377, 9378, 9375, 9376, 1683, 9374, 983769, 9372, 
-    12444, 0, 0, 13016, 8210, 983949, 42029, 11079, 12331, 43451, 42032, 
-    8744, 726, 0, 983828, 4155, 0, 0, 42030, 5007, 12522, 43088, 0, 4951, 
-    127805, 127240, 0, 9922, 43309, 983832, 12525, 983463, 12016, 65770, 
-    9548, 67665, 403, 78230, 12503, 0, 0, 11030, 0, 92567, 65691, 63998, 
-    1819, 10496, 0, 0, 119920, 0, 194668, 0, 12506, 0, 12231, 0, 12500, 
-    44023, 12509, 64393, 78830, 3389, 10589, 6608, 41047, 120321, 78395, 
-    78394, 74069, 77995, 78391, 3608, 8281, 120320, 1107, 0, 9076, 8862, 
-    69743, 41052, 13084, 64766, 43217, 7803, 13222, 74165, 74782, 126514, 
-    8546, 11553, 63995, 13177, 9043, 6303, 983938, 498, 64471, 120324, 
-    128567, 12529, 8042, 0, 2344, 12528, 8031, 2414, 0, 69719, 3231, 0, 6422, 
-    66512, 69653, 12530, 2537, 78405, 41429, 12658, 13036, 65772, 0, 78738, 
-    41433, 4719, 469, 0, 4363, 3313, 41428, 78407, 2023, 1772, 78224, 78225, 
-    65706, 10051, 64812, 78220, 0, 9920, 12215, 0, 4931, 1951, 12497, 119363, 
-    9607, 0, 9663, 0, 119634, 6503, 41110, 0, 1491, 0, 0, 127304, 41061, 0, 
-    194838, 127187, 65026, 41993, 41509, 11045, 65028, 78602, 66476, 41108, 
-    9738, 41995, 1075, 1958, 12535, 41992, 41506, 0, 41687, 0, 120717, 
-    127776, 9940, 127299, 7692, 983824, 8008, 41131, 330, 8566, 65083, 41133, 
-    9816, 126517, 12532, 78550, 78546, 3508, 127058, 43235, 0, 127298, 64139, 
-    78231, 6411, 12910, 78554, 66644, 13028, 6737, 12537, 0, 0, 64136, 12536, 
-    2350, 13029, 78233, 0, 983103, 13030, 6702, 4527, 0, 12538, 128810, 
-    983636, 65599, 65717, 9966, 0, 4948, 12484, 4032, 128149, 12623, 0, 6207, 
-    0, 6117, 65930, 8412, 0, 7438, 1296, 2325, 41511, 126625, 10149, 74118, 
-    0, 127286, 12481, 0, 12488, 66713, 0, 41556, 64414, 118802, 2354, 42619, 
-    73766, 0, 6295, 901, 41510, 7953, 0, 65032, 41513, 983166, 11927, 66584, 
-    78559, 78560, 78557, 78558, 0, 78556, 848, 9868, 0, 6424, 78568, 119338, 
-    69922, 74031, 78563, 78564, 2352, 78572, 893, 64576, 11289, 1407, 67973, 
-    0, 13026, 6762, 78579, 78580, 13023, 8903, 9777, 66715, 1871, 8099, 0, 0, 
-    1343, 983814, 0, 9325, 6818, 6283, 11738, 0, 983925, 0, 11741, 0, 0, 
-    9216, 8263, 11279, 194752, 983816, 194754, 13021, 64494, 3136, 194758, 
-    194757, 194760, 13022, 42737, 9956, 0, 0, 74552, 10014, 0, 41260, 119340, 
-    13020, 10024, 194764, 74583, 74340, 69681, 0, 43001, 8029, 0, 0, 983771, 
-    3335, 0, 0, 9776, 120526, 194748, 5215, 42644, 3333, 1632, 194751, 64849, 
-    3342, 78582, 5363, 12957, 78581, 4156, 0, 0, 6421, 78591, 1611, 78589, 
-    13018, 74257, 78588, 74542, 3337, 4537, 67895, 11736, 0, 68608, 6482, 
-    4214, 73790, 11945, 0, 13046, 8838, 425, 4025, 10709, 78595, 2108, 2392, 
-    13047, 0, 0, 6819, 13049, 6499, 92243, 12424, 68614, 73944, 13050, 9924, 
-    194745, 6507, 127919, 94073, 128069, 3277, 8929, 4947, 41055, 0, 194722, 
-    194721, 194724, 13045, 64626, 66034, 7751, 194727, 8371, 194729, 3997, 
-    12806, 8768, 13044, 0, 12420, 4024, 194730, 41054, 1078, 9757, 69736, 
-    41057, 0, 0, 0, 0, 983782, 92210, 92411, 0, 41496, 0, 9165, 1572, 11911, 
-    0, 118842, 2346, 13270, 8958, 0, 9646, 3773, 43183, 6401, 5831, 0, 0, 
-    13043, 8056, 92494, 65681, 208, 127382, 41514, 0, 0, 0, 10699, 6408, 
-    92227, 7825, 5661, 0, 120630, 3603, 41109, 2398, 3548, 126596, 0, 119933, 
-    0, 3115, 9918, 0, 11321, 42912, 0, 0, 194726, 4876, 65804, 0, 0, 43468, 
-    983266, 41558, 41471, 73950, 8158, 9944, 41472, 120298, 13051, 78689, 
-    3143, 194674, 6701, 41559, 1896, 66256, 13052, 194680, 5665, 0, 119071, 
-    7025, 63974, 0, 74352, 74161, 4154, 9863, 43550, 12310, 5662, 42382, 
-    194686, 73924, 1121, 78319, 63959, 0, 9942, 13231, 0, 64752, 4732, 
-    194666, 11596, 119931, 65187, 1626, 63983, 10110, 64772, 42024, 6420, 
-    42028, 0, 10509, 2795, 4910, 194728, 69231, 64753, 6275, 93957, 118830, 
-    63978, 11044, 3229, 6423, 42774, 0, 0, 0, 12823, 2331, 917810, 7085, 
-    6137, 0, 7524, 0, 917809, 8346, 0, 8338, 128315, 65043, 0, 822, 127984, 
-    9903, 64721, 42722, 69877, 194659, 78655, 78661, 194660, 78662, 41265, 
-    5311, 1795, 965, 118791, 10587, 78055, 11278, 78632, 194640, 0, 12946, 
-    194641, 119341, 120349, 6294, 3144, 194648, 194647, 65019, 194649, 73990, 
-    0, 983951, 748, 41067, 2330, 535, 3148, 12375, 78799, 194629, 10556, 
-    2475, 12388, 4889, 8968, 67863, 3593, 0, 0, 2342, 0, 194634, 65206, 4894, 
-    194635, 4890, 194637, 917804, 581, 4893, 983616, 6571, 65545, 4888, 4157, 
-    78048, 78049, 78046, 78047, 0, 10119, 6415, 42893, 0, 69702, 0, 0, 11375, 
-    64746, 2332, 78063, 412, 78061, 64932, 42880, 43587, 0, 0, 0, 0, 65197, 
-    78066, 12203, 78064, 78065, 8913, 65854, 4875, 65811, 120381, 120389, 
-    118888, 9344, 8826, 120386, 120395, 13104, 74781, 11997, 120393, 78075, 
-    0, 3134, 0, 65696, 92331, 0, 66217, 0, 8334, 119344, 0, 3449, 0, 0, 
-    78414, 78413, 118950, 74011, 0, 0, 0, 0, 1908, 120167, 4328, 10734, 
-    127014, 0, 127914, 7804, 78272, 10811, 6250, 11339, 4914, 11367, 0, 
-    78054, 4917, 74516, 74208, 64285, 4912, 5464, 127836, 118893, 2361, 7971, 
-    78072, 78073, 55243, 78071, 0, 8086, 74317, 6707, 8319, 2312, 40977, 
-    10960, 40962, 8305, 12573, 983608, 40980, 983955, 13202, 0, 12582, 78282, 
-    983048, 69856, 42438, 55221, 6288, 78280, 127946, 5653, 42400, 10891, 
-    7698, 5658, 74045, 70039, 0, 0, 4913, 0, 983950, 71333, 42326, 128194, 
-    12728, 92685, 42478, 2327, 0, 12563, 42287, 12705, 0, 0, 12588, 8821, 
-    6153, 2867, 194708, 66312, 698, 128007, 194606, 10356, 70017, 194713, 
-    651, 12641, 0, 0, 0, 0, 41552, 65115, 78465, 78467, 78463, 78464, 128851, 
-    78461, 194697, 74356, 64945, 4716, 43277, 0, 78474, 12340, 120568, 0, 
-    194700, 55264, 41211, 120676, 8703, 5462, 917629, 983487, 10101, 0, 
-    70049, 8479, 4151, 41933, 0, 0, 66254, 120821, 0, 0, 128654, 0, 119194, 
-    74050, 92701, 0, 0, 0, 0, 0, 12278, 0, 0, 0, 2700, 12576, 7842, 12899, 0, 
-    0, 2699, 0, 73845, 2985, 92568, 126475, 917845, 12192, 119314, 0, 119312, 
-    9827, 119310, 119311, 119308, 119309, 119306, 11481, 41210, 119305, 0, 
-    35, 78481, 78482, 66694, 68479, 78477, 78478, 43596, 6090, 64257, 7812, 
-    10534, 0, 78485, 73848, 67975, 4272, 0, 40967, 40964, 917825, 12704, 
-    78487, 43306, 0, 64497, 12138, 7930, 0, 2292, 68216, 0, 917826, 5244, 
-    4189, 94108, 67596, 127504, 4188, 1879, 0, 968, 0, 43743, 0, 8873, 2279, 
-    0, 917827, 65555, 12574, 0, 0, 0, 74490, 127099, 43657, 0, 0, 0, 42682, 
-    12578, 12720, 0, 41227, 0, 12346, 127101, 64848, 0, 0, 7251, 0, 0, 
-    118850, 119141, 128546, 66015, 0, 959, 8885, 12564, 66457, 78808, 9469, 
-    9632, 92323, 74761, 64323, 127335, 0, 0, 0, 310, 0, 41281, 10976, 0, 
-    71325, 0, 74266, 10054, 6497, 8574, 0, 9012, 19958, 74420, 65089, 13215, 
-    12730, 65163, 74044, 374, 43195, 816, 120161, 0, 0, 41934, 7465, 0, 
-    128168, 983260, 4715, 6101, 94106, 41936, 0, 4879, 0, 65446, 0, 307, 
-    127147, 9585, 5374, 983259, 128059, 0, 0, 126618, 120390, 0, 65567, 
-    120614, 1929, 0, 12142, 0, 12236, 41419, 194618, 120610, 12982, 194623, 
-    5378, 78791, 128679, 41421, 0, 4462, 0, 126599, 128092, 821, 0, 2498, 
-    5800, 120157, 983115, 1760, 2421, 4469, 2324, 828, 3611, 78400, 757, 
-    1185, 0, 78770, 43597, 10628, 74808, 194572, 7999, 43971, 0, 0, 10634, 
-    10942, 7713, 2348, 0, 64374, 4380, 194608, 119044, 9982, 64324, 41240, 
-    862, 65626, 78462, 1810, 3673, 5137, 194617, 0, 7277, 65622, 0, 7566, 
-    64688, 194593, 194592, 78092, 74357, 194597, 4748, 92228, 194598, 194601, 
-    42260, 5871, 119075, 0, 74576, 44019, 0, 128189, 3967, 194604, 13137, 
-    8775, 127945, 0, 2963, 0, 8410, 4454, 723, 127882, 966, 4449, 92330, 
-    92238, 0, 7819, 2320, 194589, 339, 4968, 194590, 120399, 8075, 55276, 0, 
-    8047, 0, 78827, 12634, 41542, 78780, 7466, 6705, 12174, 42610, 0, 74452, 
-    983754, 1584, 66645, 6045, 6729, 120640, 65218, 11559, 0, 78062, 7537, 0, 
-    11370, 0, 10330, 0, 10394, 0, 74194, 0, 127929, 9780, 0, 13092, 194576, 
-    77950, 194578, 7074, 92648, 194579, 194582, 11414, 128868, 2531, 13034, 
-    0, 0, 4211, 1259, 7517, 0, 0, 194561, 40996, 13037, 7092, 641, 5219, 
-    94034, 194566, 11064, 41129, 0, 42850, 13035, 9075, 92387, 5466, 128153, 
-    0, 64098, 65793, 4535, 194573, 4271, 78417, 128357, 6769, 41410, 983444, 
-    64262, 6767, 41407, 0, 0, 6755, 118864, 9046, 127934, 126608, 0, 0, 0, 0, 
-    67675, 0, 0, 0, 64338, 2563, 13033, 247, 118915, 0, 12338, 4651, 69895, 
-    11270, 0, 0, 11933, 0, 0, 41903, 43447, 11001, 0, 42255, 0, 92661, 69821, 
-    41905, 0, 0, 10775, 9793, 5009, 0, 42269, 64587, 983063, 42535, 69812, 
-    64529, 41408, 42853, 3877, 120795, 42674, 8147, 43566, 119021, 983767, 
-    10236, 65918, 43782, 0, 0, 64506, 69652, 118921, 4747, 128058, 69844, 
-    43200, 5832, 0, 0, 5141, 42600, 0, 43203, 0, 983790, 43286, 0, 128211, 
-    43778, 0, 41305, 78776, 43781, 11303, 65547, 0, 7031, 859, 0, 0, 0, 6059, 
-    126985, 55235, 0, 8535, 0, 65196, 194787, 66032, 11488, 120481, 120786, 
-    42233, 64140, 9946, 63885, 194792, 11822, 0, 43189, 983889, 0, 1788, 
-    1579, 120482, 71298, 0, 0, 0, 9028, 119571, 69234, 94055, 0, 1285, 64882, 
-    41242, 70086, 0, 12640, 0, 7401, 0, 12625, 68198, 0, 70082, 3940, 41597, 
-    43754, 3396, 12642, 8665, 0, 0, 12630, 1653, 917815, 10153, 0, 6166, 
-    120516, 118989, 0, 8815, 66673, 65046, 9285, 913, 42259, 119317, 119318, 
-    2142, 68454, 42485, 94012, 7878, 8211, 42293, 64377, 0, 92643, 0, 194673, 
-    12032, 0, 9725, 0, 78431, 5263, 12818, 78430, 41939, 10022, 65387, 78419, 
-    42777, 10139, 980, 43698, 65386, 2208, 0, 43701, 43198, 7184, 120673, 
-    194797, 917819, 10085, 119992, 0, 119993, 6634, 92373, 0, 119323, 8072, 
-    119321, 43700, 0, 8872, 7783, 917992, 12398, 8237, 0, 0, 12395, 0, 
-    126977, 120565, 9914, 2217, 917854, 73975, 6367, 6351, 66688, 0, 78107, 
-    0, 64735, 41243, 92199, 7808, 1829, 0, 41937, 4358, 43272, 6353, 0, 0, 
-    120422, 0, 1710, 0, 0, 65607, 0, 49, 6627, 0, 6258, 10683, 78672, 9741, 
-    78329, 5649, 78441, 43443, 64418, 1643, 65213, 8405, 3470, 128225, 13213, 
-    42452, 78331, 120664, 78445, 0, 1072, 78457, 78452, 78454, 6576, 41988, 
-    41132, 65675, 1080, 120002, 9886, 55225, 1101, 68404, 12309, 55227, 0, 
-    12632, 1086, 1869, 78685, 7680, 0, 65458, 120714, 12639, 3380, 8123, 
-    1091, 12638, 7977, 4501, 41099, 0, 66309, 0, 0, 1494, 983146, 126613, 0, 
-    11693, 126513, 10494, 92655, 65872, 12363, 11386, 0, 0, 0, 0, 64582, 0, 
-    73794, 0, 8022, 0, 120462, 74106, 12413, 94069, 917994, 917993, 917995, 
-    5570, 1881, 7210, 0, 1012, 43752, 0, 120709, 7208, 66442, 5569, 983236, 
-    42339, 0, 6063, 0, 78383, 119594, 6053, 65602, 0, 92201, 64727, 9160, 
-    194827, 0, 0, 92180, 10503, 118810, 6055, 3870, 4279, 8490, 120114, 4319, 
-    64786, 8602, 120110, 11326, 92204, 983116, 0, 120119, 78333, 120117, 
-    120118, 120099, 120100, 65087, 5571, 3674, 9740, 9121, 5568, 120107, 
-    120108, 42085, 10107, 42159, 42870, 120101, 589, 7050, 983791, 43281, 
-    10233, 41263, 66251, 65729, 66253, 126497, 74099, 42645, 0, 194815, 8583, 
-    0, 5847, 6928, 128074, 0, 0, 0, 0, 66592, 12204, 917962, 19966, 77856, 
-    42561, 120626, 983245, 0, 8120, 120701, 0, 0, 128012, 41063, 0, 10664, 0, 
-    8369, 0, 4551, 194964, 3369, 0, 0, 9673, 66334, 65580, 10478, 118960, 
-    12517, 557, 9457, 12034, 983662, 6355, 12519, 41004, 0, 195025, 74094, 0, 
-    0, 77970, 983560, 0, 128175, 12111, 3927, 0, 12515, 1474, 67893, 5492, 
-    6923, 92281, 10441, 73836, 0, 43990, 5493, 0, 74319, 0, 66635, 12019, 0, 
-    1618, 0, 120474, 9645, 10430, 917959, 5853, 13063, 10363, 0, 12956, 
-    128169, 120729, 11314, 917582, 12060, 0, 78392, 12826, 6329, 0, 10514, 
-    65517, 74395, 2707, 8309, 0, 127054, 78398, 43570, 2697, 43420, 78396, 
-    127057, 2695, 42171, 0, 0, 0, 67617, 118971, 0, 2693, 12125, 12766, 0, 
-    1164, 128817, 0, 41918, 983168, 127542, 8687, 66009, 12178, 7053, 128001, 
-    7469, 0, 5248, 12218, 120538, 6427, 42884, 41123, 0, 0, 42873, 41126, 
-    9991, 41128, 74371, 127031, 0, 9873, 0, 42877, 7994, 64762, 2053, 42843, 
-    6591, 9340, 0, 1589, 0, 296, 74438, 78852, 0, 67841, 74370, 0, 8922, 
-    128068, 74600, 12700, 74836, 0, 12579, 0, 12575, 6416, 5656, 2891, 13262, 
-    65590, 5299, 0, 11473, 5449, 1252, 0, 78404, 41431, 74369, 65373, 5295, 
-    917569, 74114, 1223, 1642, 174, 78399, 883, 4161, 12691, 42603, 41413, 
-    3212, 41459, 3211, 74810, 41425, 127029, 78412, 74450, 9728, 3846, 8070, 
-    6150, 6636, 4370, 0, 0, 74178, 74587, 74117, 0, 0, 0, 4986, 12189, 0, 
-    67648, 120499, 94001, 4257, 12104, 77942, 6220, 9004, 65561, 0, 77949, 0, 
-    68135, 917576, 77946, 0, 69679, 69684, 9890, 78561, 12971, 78453, 92556, 
-    73898, 11979, 70051, 118900, 917894, 0, 9635, 12600, 8871, 0, 0, 0, 6469, 
-    74227, 0, 65304, 4679, 10230, 64300, 64867, 3427, 4240, 0, 0, 0, 0, 
-    42916, 0, 0, 0, 7282, 78728, 65733, 4445, 127138, 128082, 3494, 74606, 
-    6555, 0, 77976, 0, 0, 78566, 0, 983189, 65898, 983238, 65312, 5447, 0, 
-    12895, 65593, 4010, 0, 41106, 0, 64448, 0, 41105, 0, 65820, 6232, 0, 
-    128280, 0, 43608, 119091, 0, 6538, 4335, 78364, 3941, 41122, 11061, 
-    78363, 64892, 9113, 1954, 12155, 983665, 42878, 11500, 0, 0, 74578, 0, 
-    65832, 0, 0, 0, 77975, 119230, 4586, 0, 350, 10951, 0, 509, 0, 0, 92307, 
-    0, 0, 5133, 0, 0, 9500, 0, 4957, 64741, 2422, 2212, 983080, 0, 0, 2496, 
-    11516, 944, 118851, 3890, 12168, 1438, 0, 983117, 0, 41947, 1220, 120828, 
-    128555, 0, 0, 1571, 42630, 41949, 42805, 8270, 943, 564, 0, 312, 41980, 
-    983935, 0, 78120, 8877, 269, 4429, 6272, 9617, 1460, 6954, 78657, 41120, 
-    65121, 10862, 6060, 41119, 41416, 74355, 4173, 0, 0, 0, 1906, 917986, 
-    11532, 74073, 127338, 0, 1985, 6296, 9582, 917895, 64287, 0, 78115, 
-    11428, 1730, 2457, 917808, 19918, 10469, 0, 0, 7703, 8840, 8035, 0, 0, 
-    92230, 0, 6129, 0, 128528, 128268, 0, 7874, 8681, 119092, 0, 13136, 0, 0, 
-    70102, 63886, 118881, 9605, 71308, 13220, 128776, 120274, 5514, 0, 9228, 
-    0, 0, 0, 5240, 9811, 10012, 3096, 0, 0, 983343, 66676, 65873, 0, 0, 0, 
-    9501, 0, 1272, 64536, 65465, 64654, 7467, 0, 1467, 10158, 10040, 0, 9519, 
-    0, 917812, 0, 118899, 12193, 0, 0, 0, 0, 983345, 19935, 0, 92162, 69676, 
-    0, 0, 0, 5275, 0, 0, 8637, 0, 0, 3789, 63880, 11471, 43554, 65862, 11474, 
-    66332, 66603, 128138, 2426, 12042, 92194, 983902, 9537, 3961, 12115, 
-    77953, 2605, 4500, 64561, 55224, 4981, 0, 0, 63876, 11667, 42686, 77973, 
-    42362, 64686, 4499, 41649, 7589, 0, 0, 3237, 0, 68215, 917904, 8541, 
-    78298, 70034, 41866, 0, 0, 0, 0, 69924, 43555, 2823, 9559, 10060, 41940, 
-    8299, 41945, 7132, 41941, 3308, 7190, 64880, 8614, 65220, 41493, 0, 
-    41699, 10762, 43780, 12999, 0, 0, 8106, 4128, 0, 6274, 4494, 0, 4012, 
-    10395, 983591, 43633, 65447, 126511, 0, 11004, 695, 739, 696, 7611, 0, 
-    42755, 74802, 9227, 7506, 7510, 69937, 691, 738, 7511, 7512, 7515, 3868, 
-    688, 41847, 690, 2548, 737, 974, 8003, 7406, 917911, 0, 128688, 3985, 
-    917912, 65860, 63921, 7051, 69777, 4682, 917805, 12809, 6406, 4685, 
-    92505, 10879, 10347, 4680, 6341, 0, 3851, 8132, 74325, 0, 917907, 0, 
-    41958, 119176, 917908, 0, 0, 42657, 92468, 7643, 42373, 11714, 67587, 
-    43568, 983175, 11717, 7650, 10594, 64951, 7647, 7649, 128155, 7646, 0, 
-    78082, 9651, 0, 3891, 0, 0, 2337, 1735, 74324, 67860, 2363, 983135, 0, 
-    43561, 0, 0, 74146, 1860, 7495, 7580, 5812, 7497, 7584, 119140, 127853, 
-    0, 120347, 7727, 0, 8498, 69818, 8949, 3065, 42719, 7135, 1569, 92375, 
-    12534, 12124, 7690, 0, 12533, 983870, 6418, 4543, 78086, 6969, 0, 74800, 
-    0, 67974, 11980, 128650, 983792, 63894, 120760, 12282, 66192, 0, 74592, 
-    8850, 74275, 9238, 10617, 917545, 0, 92625, 0, 12791, 0, 0, 127843, 4447, 
-    73732, 12793, 12900, 92377, 10950, 0, 78087, 12790, 41400, 119128, 66607, 
-    12792, 42232, 194938, 1744, 12789, 10366, 12317, 41310, 983860, 41399, 0, 
-    0, 55258, 0, 12690, 0, 0, 43672, 127840, 41652, 2974, 9010, 11315, 0, 
-    278, 0, 41405, 119254, 0, 10077, 63853, 74557, 42586, 0, 0, 6002, 0, 
-    43553, 0, 67903, 0, 12787, 41308, 7934, 65306, 0, 0, 0, 8646, 983186, 
-    77829, 71360, 0, 6413, 6550, 0, 1940, 0, 43637, 220, 65193, 43551, 10678, 
-    10044, 128322, 0, 0, 68659, 6403, 5707, 10393, 127532, 0, 66614, 0, 0, 0, 
-    10297, 0, 3742, 0, 3959, 0, 0, 0, 2467, 0, 6003, 63844, 6663, 8040, 0, 
-    43758, 4182, 78171, 4676, 120501, 0, 0, 2510, 0, 10208, 78168, 92361, 
-    11540, 43546, 6692, 0, 41060, 0, 4668, 9083, 0, 0, 78144, 1559, 63831, 
-    9677, 120260, 0, 65256, 0, 74070, 0, 0, 365, 12056, 43027, 120423, 41716, 
-    128236, 0, 120472, 5516, 2845, 7717, 8036, 41717, 73827, 544, 12045, 
-    6278, 0, 5515, 0, 0, 983051, 65339, 43221, 2211, 0, 5517, 0, 0, 74841, 
-    67884, 0, 67890, 67885, 67880, 67881, 67882, 67883, 0, 0, 67879, 127188, 
-    1902, 67887, 9638, 12976, 126546, 12483, 12368, 41769, 42726, 41765, 
-    7361, 6667, 67874, 7556, 67878, 74351, 11264, 989, 42677, 67889, 0, 1311, 
-    917966, 4326, 11000, 63824, 13068, 10932, 128880, 6917, 78155, 0, 949, 
-    78162, 0, 6148, 8605, 42253, 78177, 0, 0, 42715, 0, 0, 0, 63871, 0, 
-    41796, 1269, 6530, 0, 65057, 0, 5144, 12221, 42716, 0, 4431, 4331, 
-    983720, 128675, 41834, 5279, 0, 10336, 8312, 0, 42701, 128825, 0, 78165, 
-    66036, 0, 0, 6428, 42270, 0, 983596, 43059, 42666, 5256, 1067, 255, 
-    12131, 983713, 9493, 983959, 41014, 11793, 194920, 0, 74394, 43460, 
-    10653, 42723, 983845, 119632, 0, 6560, 7016, 74274, 983615, 43556, 3929, 
-    67977, 6614, 2768, 92504, 9746, 5135, 11811, 12796, 11953, 0, 69761, 
-    5139, 346, 74303, 6305, 12795, 4675, 5168, 78552, 127753, 74315, 74361, 
-    8253, 8817, 1136, 0, 43563, 92232, 0, 194750, 7392, 8230, 9365, 0, 0, 
-    983607, 0, 0, 4041, 0, 2357, 43240, 12786, 229, 119885, 119884, 44004, 
-    7142, 119881, 12350, 65554, 119882, 119877, 119876, 12785, 63863, 43795, 
-    7770, 10712, 64853, 12686, 118916, 42375, 0, 127238, 66352, 10470, 0, 
-    11059, 10791, 917944, 450, 119328, 0, 10432, 12097, 5450, 64691, 1233, 0, 
-    44009, 78284, 66338, 0, 0, 1839, 118799, 983217, 10927, 1701, 983655, 
-    2388, 41749, 41761, 5453, 8361, 119865, 41758, 5444, 41763, 64889, 7143, 
-    92493, 78677, 0, 92429, 78174, 66432, 8801, 3053, 4340, 983044, 0, 65812, 
-    917831, 0, 41824, 67985, 120203, 194800, 194803, 42700, 194805, 127980, 
-    194807, 78676, 92356, 194808, 0, 0, 4493, 4336, 0, 2314, 43602, 78826, 
-    119325, 194811, 42439, 64638, 42327, 43528, 4489, 71331, 0, 194793, 1912, 
-    42385, 10306, 10370, 0, 0, 8867, 10250, 10258, 2712, 1635, 78821, 1410, 
-    92671, 983244, 118878, 0, 0, 9919, 120528, 559, 128157, 41825, 127975, 
-    78188, 4892, 74016, 194781, 6542, 41957, 128865, 5777, 0, 759, 65749, 
-    2079, 65248, 12788, 64487, 64552, 0, 10223, 42062, 0, 0, 126573, 3668, 
-    65754, 43560, 12226, 67991, 65149, 2340, 41959, 194786, 194785, 194788, 
-    43618, 65747, 10937, 2962, 0, 2321, 3587, 65745, 92436, 8921, 9952, 0, 0, 
-    42714, 9951, 43409, 194770, 2949, 66012, 194775, 194774, 2958, 68359, 
-    41820, 2300, 2395, 128563, 9976, 120043, 120050, 120058, 68220, 128143, 
-    42809, 42807, 0, 120046, 10198, 4150, 64371, 8318, 41790, 67976, 41898, 
-    2360, 41794, 917942, 71314, 127818, 0, 0, 2418, 983098, 2411, 11336, 799, 
-    63823, 10276, 10308, 10372, 917541, 41772, 42813, 2317, 10260, 118980, 
-    55284, 92203, 0, 10384, 983218, 0, 0, 7753, 2351, 6655, 64489, 69931, 0, 
-    77872, 4443, 42779, 230, 0, 0, 43549, 4855, 42150, 65739, 5441, 41896, 
-    10288, 10320, 0, 855, 7046, 6109, 65045, 63839, 78198, 2049, 10098, 0, 
-    74145, 127943, 10264, 10280, 9184, 10376, 7013, 4467, 0, 0, 0, 41887, 0, 
-    4862, 9735, 6537, 120591, 74286, 3914, 92178, 93976, 9065, 12961, 0, 0, 
-    92253, 0, 289, 0, 4694, 11420, 4690, 0, 120514, 917978, 4693, 73893, 
-    42724, 0, 4688, 120454, 0, 0, 67994, 8238, 3110, 120162, 983899, 120163, 
-    6528, 127553, 43035, 69898, 218, 0, 1520, 0, 4786, 0, 43225, 4602, 0, 
-    78167, 10088, 6548, 0, 120156, 43978, 8988, 8888, 0, 0, 0, 0, 10666, 0, 
-    73902, 69740, 0, 0, 9975, 128039, 119902, 4689, 8932, 0, 65560, 119209, 
-    74441, 78810, 0, 0, 67987, 0, 0, 0, 67989, 0, 10065, 8207, 0, 92613, 
-    128011, 0, 662, 0, 9244, 194863, 0, 119261, 983420, 0, 0, 0, 41929, 0, 0, 
-    66674, 41926, 120408, 120443, 10513, 64637, 194862, 68013, 52, 13118, 
-    6475, 0, 120341, 12095, 10225, 4812, 92578, 0, 67992, 74085, 0, 3978, 0, 
-    917945, 127823, 11582, 120761, 12281, 0, 6544, 13241, 93961, 69782, 
-    128557, 194860, 11765, 65258, 10369, 0, 1585, 7192, 10249, 422, 1500, 
-    2036, 986, 194859, 64394, 5781, 5599, 64294, 2494, 120450, 4861, 74021, 
-    64334, 78203, 127808, 0, 92266, 65102, 8961, 65842, 10243, 10245, 74191, 
-    120410, 0, 120453, 64821, 9478, 2508, 92683, 0, 202, 128246, 74131, 1242, 
-    65514, 0, 63940, 128706, 64533, 120129, 0, 67842, 11990, 92430, 63939, 
-    43375, 65440, 2504, 0, 78671, 64829, 983901, 6943, 917934, 5859, 0, 2858, 
-    983353, 74294, 983905, 69239, 0, 119027, 12992, 2753, 1936, 70078, 92574, 
+    194609, 0, 8295, 685, 9025, 1524, 12618, 0, 5539, 0, 92523, 120102, 7138, 
+    120552, 0, 194611, 78752, 0, 12520, 8058, 9732, 0, 5080, 64775, 5036, 
+    5035, 120590, 42604, 983656, 0, 8074, 275, 13291, 1907, 78838, 4432, 
+    127271, 5033, 127273, 127272, 4836, 3888, 73792, 10729, 64546, 127262, 
+    43704, 127264, 127251, 67588, 119000, 127252, 127255, 8858, 6409, 127256, 
+    120252, 128100, 0, 0, 66321, 0, 12814, 127248, 3432, 10218, 0, 6094, 
+    7641, 42445, 0, 92487, 42406, 1676, 74320, 194607, 983177, 5030, 0, 0, 0, 
+    73869, 9622, 0, 69944, 6787, 0, 0, 0, 983583, 10544, 12919, 0, 92218, 0, 
+    0, 69906, 120789, 0, 947, 119835, 194586, 194585, 10969, 119935, 7613, 
+    92562, 119936, 4795, 119930, 7018, 7376, 120181, 120192, 120268, 0, 
+    43567, 74056, 917910, 11833, 119919, 7216, 65232, 7217, 251, 7218, 7895, 
+    4395, 43538, 119926, 119929, 119928, 7213, 119922, 7214, 7215, 983836, 
+    74141, 8880, 7685, 66459, 120173, 65540, 119618, 625, 8187, 42861, 1113, 
+    7236, 7915, 3630, 120176, 8179, 74264, 67886, 9316, 10980, 2489, 65624, 
+    8150, 1359, 67652, 127329, 127330, 73756, 5042, 5041, 42769, 12084, 
+    127324, 127321, 92279, 127319, 127320, 127317, 127318, 127315, 12283, 
+    1616, 3795, 0, 8795, 66245, 0, 0, 0, 1138, 73905, 12677, 0, 0, 3239, 
+    127311, 0, 0, 8431, 0, 42164, 0, 11778, 12620, 6826, 73773, 119073, 5040, 
+    0, 0, 983443, 78420, 0, 5039, 0, 78418, 0, 5038, 0, 0, 13184, 74293, 0, 
+    64648, 0, 9359, 78416, 0, 128770, 65157, 6662, 0, 0, 3863, 73909, 4835, 
+    55266, 43432, 127822, 4309, 7127, 194569, 0, 194568, 1301, 0, 42589, 569, 
+    0, 73813, 711, 4389, 7133, 0, 73880, 11610, 11368, 0, 194570, 41331, 
+    1006, 74240, 0, 1550, 8201, 73737, 7627, 5499, 5031, 77908, 42738, 65784, 
+    77907, 65267, 3758, 0, 65781, 64734, 70073, 2440, 65780, 77913, 8449, 0, 
+    5008, 983572, 2118, 0, 12121, 8255, 5512, 73875, 2128, 2130, 2131, 2126, 
+    2133, 1119, 127068, 2114, 2116, 2455, 0, 2122, 2123, 2124, 2125, 127486, 
+    8714, 983820, 2113, 0, 2115, 128177, 127907, 43713, 5052, 66220, 5821, 
+    6186, 65778, 65775, 5051, 65773, 1429, 42647, 5050, 302, 388, 41115, 735, 
+    6637, 5907, 65088, 0, 12726, 74594, 9117, 983181, 12003, 5513, 6666, 
+    5053, 74230, 5510, 78451, 0, 78447, 2470, 78437, 0, 1925, 0, 92237, 
+    74807, 0, 5048, 5047, 0, 0, 0, 92313, 0, 74497, 92395, 8089, 6929, 639, 
+    983563, 68179, 64442, 0, 92348, 4599, 41402, 6674, 43397, 43294, 1476, 
+    648, 0, 65819, 3233, 0, 41782, 6951, 94017, 983976, 3530, 9750, 128317, 
+    0, 6656, 42618, 0, 5046, 8512, 65856, 74261, 8967, 0, 5045, 42026, 1916, 
+    7986, 5044, 120556, 9006, 13128, 5043, 0, 7853, 74068, 74004, 9669, 
+    12341, 12703, 8402, 0, 119070, 917600, 41750, 3586, 64508, 43148, 0, 0, 
+    119606, 67983, 13296, 517, 0, 128534, 194946, 41528, 123, 65454, 0, 0, 
+    74478, 10531, 7784, 41526, 10829, 73991, 8057, 1126, 73895, 0, 194591, 0, 
+    3925, 4251, 8069, 10517, 120439, 489, 0, 4250, 120441, 120452, 43151, 
+    983178, 194851, 66200, 0, 0, 0, 78423, 0, 0, 8711, 6183, 0, 0, 0, 120448, 
+    7623, 118925, 118889, 9235, 12760, 74176, 69662, 66445, 43540, 10062, 
+    3743, 11514, 11078, 0, 12136, 0, 126597, 120435, 0, 7726, 0, 19922, 267, 
+    3393, 42198, 1371, 194849, 69233, 2458, 0, 6201, 0, 41074, 4266, 10652, 
+    41612, 41077, 3402, 9050, 3398, 0, 983348, 0, 3391, 41075, 2476, 0, 
+    128017, 0, 10625, 0, 12767, 13017, 78743, 64261, 64934, 127537, 13014, 
+    13013, 0, 6673, 0, 0, 0, 12438, 0, 983342, 0, 983880, 126638, 9053, 
+    13015, 74523, 0, 704, 66215, 6195, 983828, 6660, 78758, 917760, 917793, 
+    42212, 12629, 11435, 0, 55256, 65538, 0, 127940, 983341, 74547, 126585, 
+    65448, 78100, 12948, 119001, 195002, 119238, 195004, 78099, 127085, 0, 
+    128320, 4287, 8276, 4902, 1131, 0, 78458, 66728, 1816, 0, 42533, 168, 
+    42845, 4898, 64298, 983141, 0, 4901, 1821, 0, 578, 3653, 0, 791, 9162, 
+    6977, 0, 78889, 74561, 0, 73731, 8354, 43590, 119303, 983449, 7557, 
+    119339, 119301, 8234, 7241, 0, 120671, 119167, 194996, 12811, 65925, 
+    3946, 78078, 10998, 78080, 673, 194867, 64397, 128276, 74599, 78449, 
+    8890, 194977, 194976, 2448, 78085, 10267, 8424, 2452, 78083, 128824, 
+    8729, 78456, 0, 7845, 917917, 71302, 4408, 4122, 6772, 11039, 8723, 
+    194990, 71310, 119302, 731, 119304, 92286, 2438, 64855, 119300, 119299, 
+    1175, 0, 42135, 373, 119172, 2119, 11457, 11521, 7723, 0, 0, 0, 41952, 0, 
+    5273, 2127, 5269, 6337, 5202, 2404, 5267, 42823, 11291, 19915, 5277, 
+    12963, 127864, 6189, 4125, 1314, 12133, 120340, 118873, 1271, 983640, 0, 
+    66024, 41482, 3864, 74539, 0, 3879, 0, 12978, 4166, 4574, 0, 7567, 7459, 
+    983160, 41390, 5384, 41882, 67647, 92548, 5759, 983912, 0, 41388, 64446, 
+    41392, 64288, 41387, 0, 8706, 5552, 983187, 700, 0, 5553, 0, 7088, 5356, 
+    7499, 68007, 66596, 74066, 0, 10263, 5554, 0, 12344, 10311, 78113, 6665, 
+    92626, 0, 7618, 8517, 11455, 78440, 64632, 64447, 5555, 78088, 78093, 
+    78091, 0, 42803, 65033, 9143, 6668, 195067, 67995, 195069, 656, 195071, 
+    65037, 4577, 64624, 0, 0, 0, 983649, 4269, 73885, 917775, 42846, 69644, 
+    950, 0, 92273, 66580, 118895, 66683, 10554, 917778, 119121, 0, 5098, 
+    917770, 0, 119099, 5097, 4935, 9848, 10381, 0, 128870, 983701, 3651, 0, 
+    120730, 127556, 5102, 5101, 10269, 12983, 8138, 4517, 1932, 5100, 1439, 
+    12093, 1247, 10034, 195064, 5099, 78373, 1441, 42087, 3063, 650, 0, 7838, 
+    0, 195041, 195040, 119142, 9031, 120790, 128582, 9078, 8545, 66356, 
+    128799, 0, 9154, 9118, 126543, 0, 2676, 2277, 0, 73812, 6190, 8599, 
+    195053, 69918, 10795, 9857, 7014, 9856, 195033, 92620, 12129, 0, 8481, 0, 
+    6202, 195035, 10920, 128237, 5203, 195039, 195038, 5108, 5107, 65818, 
+    66019, 9762, 0, 5541, 74772, 0, 12613, 5284, 6657, 207, 128806, 4275, 
+    74819, 854, 68147, 74381, 0, 78786, 5103, 127861, 64348, 41368, 43974, 
+    488, 69811, 0, 71339, 10157, 0, 43034, 11438, 64674, 0, 92694, 68431, 
+    41771, 5106, 6669, 8504, 65154, 69813, 41367, 5105, 127509, 69720, 6476, 
+    5104, 983749, 304, 3176, 119010, 0, 932, 120633, 6567, 238, 69656, 
+    195011, 194595, 19905, 120577, 195015, 78870, 41044, 67640, 194902, 
+    42055, 9912, 65939, 10670, 74093, 13273, 0, 12552, 195019, 8803, 309, 
+    6622, 8151, 10858, 78706, 67636, 0, 12568, 0, 12553, 10814, 43275, 6950, 
+    9712, 68680, 43970, 983198, 65165, 92725, 0, 66466, 0, 0, 0, 66725, 6191, 
+    11351, 10437, 11316, 67634, 43763, 0, 41754, 67635, 9370, 2720, 194975, 
+    68462, 8232, 118817, 0, 3222, 0, 0, 0, 66663, 0, 0, 10834, 0, 0, 65732, 
+    94095, 917547, 92682, 67679, 195020, 0, 7781, 41383, 64568, 0, 120738, 
+    12077, 0, 64586, 917620, 42396, 55255, 3475, 128035, 2479, 0, 3632, 
+    120728, 10698, 8376, 3648, 194960, 74844, 67639, 3636, 67894, 3650, 8837, 
+    65229, 1843, 42283, 43250, 41562, 9100, 74548, 917630, 3640, 127190, 
+    42321, 7284, 194974, 194973, 194950, 194949, 194952, 194951, 126649, 
+    194953, 42080, 2529, 0, 0, 0, 42083, 120678, 68398, 194957, 67619, 66367, 
+    194958, 9634, 92380, 9988, 0, 41068, 0, 4295, 65264, 68006, 0, 92545, 0, 
+    785, 8236, 128647, 9027, 68160, 67623, 64383, 120265, 925, 127156, 0, 
+    41985, 41071, 9586, 0, 41984, 9217, 0, 0, 0, 9186, 2067, 4016, 983803, 0, 
+    381, 12936, 0, 42077, 0, 69880, 5184, 42078, 194947, 10810, 128531, 4585, 
+    19943, 5860, 67633, 0, 0, 812, 3615, 0, 5178, 44000, 120548, 78807, 5188, 
+    74287, 67629, 3605, 10692, 1166, 64429, 42639, 924, 0, 67631, 42616, 
+    120670, 2442, 10703, 78789, 67632, 917924, 12771, 12736, 12753, 66708, 
+    73933, 67626, 42401, 0, 69872, 127373, 42288, 12751, 0, 8542, 13145, 
+    194963, 2468, 66706, 41294, 3626, 3883, 64388, 42479, 0, 41117, 0, 92580, 
+    0, 0, 67624, 0, 1290, 0, 65585, 2715, 806, 65208, 41884, 917883, 1318, 
+    64731, 126578, 0, 0, 66325, 3465, 2405, 9240, 0, 12756, 65259, 0, 983781, 
+    12752, 5833, 1432, 0, 41883, 73912, 9799, 0, 41886, 2480, 0, 2062, 
+    127293, 6494, 5537, 78656, 0, 194587, 0, 1211, 0, 0, 0, 118832, 12318, 0, 
+    0, 68005, 10622, 983779, 0, 78654, 6566, 78659, 0, 73780, 119196, 64864, 
+    0, 78660, 0, 8284, 13081, 0, 3589, 42051, 4035, 6492, 92236, 4265, 6642, 
+    3977, 74186, 41778, 836, 119216, 2488, 0, 4582, 0, 0, 41777, 12926, 
+    983377, 7528, 10550, 0, 92706, 0, 10961, 0, 1374, 64878, 119014, 0, 
+    42389, 41374, 2286, 0, 78492, 41377, 127909, 0, 400, 12597, 120586, 0, 0, 
+    6661, 983145, 64827, 0, 73817, 390, 0, 71301, 983862, 3473, 7718, 0, 0, 
+    0, 55285, 0, 0, 0, 11969, 983390, 127841, 6365, 1887, 6763, 983370, 8080, 
+    7006, 0, 983371, 6757, 64351, 1544, 0, 6766, 64677, 120716, 983372, 6146, 
+    0, 771, 983373, 0, 12812, 13168, 42272, 12200, 917927, 7904, 0, 953, 
+    12917, 119560, 12300, 0, 11491, 9724, 10341, 983773, 9524, 7490, 11389, 
+    7489, 3379, 0, 7487, 0, 471, 7484, 7482, 6753, 7480, 5764, 7478, 7477, 
+    6501, 7475, 6918, 7473, 7472, 2474, 7470, 7468, 10232, 10615, 10213, 
+    127288, 92357, 10049, 11834, 3544, 0, 6017, 65311, 127481, 120216, 13306, 
+    10533, 7870, 73949, 7625, 0, 120544, 0, 0, 92660, 0, 0, 0, 19961, 2472, 
+    42665, 92341, 0, 2139, 4256, 120776, 74380, 0, 42675, 42658, 12845, 0, 0, 
+    65138, 119355, 67862, 0, 65671, 7083, 120008, 8066, 7678, 74865, 0, 0, 0, 
+    0, 7186, 0, 120555, 0, 445, 120566, 128308, 0, 0, 8330, 0, 0, 42797, 
+    983150, 120215, 0, 3902, 0, 1770, 0, 128866, 1560, 120209, 194972, 4584, 
+    73843, 0, 11712, 10866, 118928, 1118, 71334, 0, 0, 1081, 7436, 68420, 
+    7252, 0, 5996, 69921, 4903, 0, 41386, 5162, 119189, 1330, 0, 7139, 0, 
+    12047, 41384, 0, 0, 1848, 4334, 6324, 41975, 64777, 10674, 12308, 12186, 
+    0, 0, 983741, 12715, 68002, 983479, 126630, 2018, 66672, 41979, 66685, 
+    119157, 68000, 92464, 0, 126984, 68001, 9334, 92705, 92315, 70101, 7975, 
+    0, 77957, 0, 66621, 4884, 66597, 69732, 0, 0, 6313, 65513, 69857, 0, 0, 
+    0, 2345, 43697, 463, 0, 0, 119607, 3117, 5460, 0, 0, 983387, 0, 42279, 
+    194577, 0, 78415, 0, 195008, 983384, 13248, 0, 0, 0, 0, 0, 0, 5663, 0, 0, 
+    0, 0, 2482, 1471, 0, 0, 42247, 12378, 73925, 69664, 0, 12374, 0, 0, 0, 
+    983694, 2460, 0, 11944, 12376, 127868, 64679, 0, 12380, 10557, 64473, 
+    5870, 0, 2024, 127180, 0, 0, 539, 0, 127765, 94052, 3853, 65180, 127923, 
+    120796, 120245, 92324, 0, 8659, 0, 12474, 92579, 9503, 194969, 2478, 0, 
+    4162, 0, 4260, 12953, 69633, 120089, 12470, 0, 74189, 2742, 12476, 11798, 
+    10946, 127310, 5000, 0, 983579, 0, 69672, 8213, 74017, 7771, 6161, 68018, 
+    6709, 0, 78885, 983708, 127971, 120582, 78547, 0, 10301, 10333, 10397, 0, 
+    0, 73791, 0, 0, 0, 0, 119123, 4014, 12842, 73952, 12015, 127290, 8275, 
+    3893, 983264, 0, 12210, 7221, 42147, 0, 74550, 74465, 64747, 118841, 0, 
+    12516, 4444, 0, 92271, 74537, 10892, 8231, 0, 6473, 41968, 78388, 41973, 
+    3591, 41969, 0, 2453, 128549, 92666, 64705, 0, 0, 10349, 10413, 43591, 
+    41962, 3202, 74353, 0, 8316, 0, 0, 94060, 687, 0, 0, 0, 1840, 0, 68671, 
+    119809, 4883, 285, 4723, 70099, 92692, 4459, 74577, 42921, 41720, 11089, 
+    240, 19906, 0, 42323, 0, 9743, 120232, 13134, 126535, 0, 0, 0, 0, 42634, 
+    983343, 43437, 3081, 11463, 120154, 0, 0, 10445, 0, 0, 66717, 2614, 9125, 
+    119023, 1729, 0, 120236, 65221, 63883, 43334, 64852, 0, 65194, 66201, 0, 
+    66578, 5001, 41879, 74427, 4121, 5003, 884, 66700, 63879, 4943, 5150, 
+    73889, 74182, 127915, 643, 3086, 0, 42448, 42299, 58, 0, 917952, 120083, 
+    63873, 8491, 0, 0, 983623, 4530, 42409, 7126, 194575, 2721, 120074, 
+    119096, 19929, 0, 194574, 0, 4242, 4264, 120077, 120530, 66179, 42412, 
+    65941, 13114, 64522, 10740, 3094, 0, 9754, 119102, 4437, 73948, 127074, 
+    983238, 55280, 42174, 194925, 42430, 0, 0, 42355, 66026, 4306, 41380, 
+    68432, 92586, 0, 66667, 127309, 0, 126521, 42200, 42566, 0, 0, 5088, 
+    6948, 0, 8524, 0, 0, 12385, 0, 0, 69646, 1386, 64580, 11480, 6116, 65039, 
+    65038, 12392, 65036, 8064, 0, 12101, 5822, 119004, 2080, 710, 77999, 
+    11663, 1666, 42091, 119657, 12383, 43671, 42092, 68418, 4289, 0, 63896, 
+    12061, 42096, 43621, 3362, 12377, 983832, 983834, 68449, 7461, 73901, 
+    1244, 331, 73786, 12683, 10662, 0, 8112, 0, 65852, 0, 12379, 194877, 
+    120818, 41964, 42208, 63843, 2084, 41965, 0, 65866, 4327, 0, 63840, 
+    78549, 41220, 13032, 0, 584, 12933, 43177, 12373, 69855, 13000, 1351, 
+    2935, 8698, 12665, 0, 1930, 0, 78229, 12427, 66514, 69859, 13031, 0, 
+    63901, 0, 3657, 128572, 65202, 6000, 119206, 12426, 127181, 0, 41740, 
+    12428, 41283, 41916, 119210, 0, 0, 12429, 6727, 0, 7562, 0, 5170, 0, 
+    41755, 676, 0, 66704, 66664, 9978, 66491, 3536, 0, 9752, 92397, 6162, 0, 
+    69228, 10113, 41829, 65886, 5159, 12422, 41832, 439, 43077, 0, 42207, 
+    74549, 11796, 40970, 41830, 0, 917799, 8308, 917797, 917796, 0, 67864, 
+    917801, 917800, 12336, 4135, 69805, 341, 2727, 4129, 3539, 0, 63861, 0, 
+    7913, 0, 63859, 4131, 63868, 0, 63867, 4133, 11371, 210, 4600, 0, 74560, 
+    4137, 8082, 78506, 119062, 78504, 6704, 4591, 128029, 0, 0, 9680, 0, 
+    120623, 561, 12159, 195, 78508, 41501, 0, 42031, 5719, 7172, 42687, 8368, 
+    0, 41499, 0, 0, 42242, 41498, 917794, 42025, 78565, 65805, 42463, 0, 
+    2924, 0, 120510, 0, 0, 119213, 73941, 0, 42330, 917784, 3969, 0, 0, 7169, 
+    1992, 9652, 73977, 7246, 42086, 126615, 2219, 0, 0, 128801, 194837, 0, 
+    327, 0, 9042, 917777, 917776, 65148, 12433, 917781, 127276, 917779, 
+    12431, 8668, 12434, 983835, 917782, 5999, 0, 7712, 12432, 128243, 43653, 
+    1726, 1015, 0, 8212, 0, 128014, 42423, 119066, 0, 128108, 66709, 0, 8811, 
+    927, 0, 0, 12436, 983245, 42021, 0, 0, 1299, 12240, 42350, 65143, 0, 
+    195016, 0, 78197, 11348, 0, 78037, 9194, 983184, 0, 19914, 12179, 983812, 
+    2296, 194923, 63836, 63832, 917773, 10967, 63816, 2594, 3444, 63817, 
+    64651, 0, 41503, 127478, 11265, 0, 120756, 194922, 0, 5664, 3972, 0, 0, 
+    0, 128508, 12416, 917764, 119608, 10816, 917769, 917768, 12418, 74111, 
+    3882, 8532, 917771, 1573, 128648, 119847, 4596, 66339, 12417, 66001, 
+    65343, 126491, 12414, 8287, 68219, 195017, 68108, 1143, 119169, 119846, 
+    12415, 6626, 42763, 0, 118884, 9021, 120783, 0, 11724, 0, 0, 127104, 
+    126619, 0, 0, 8027, 10997, 9171, 12741, 11400, 71305, 194799, 0, 128239, 
+    0, 128881, 119604, 127523, 120190, 194773, 67608, 128214, 42368, 0, 7715, 
+    3881, 41487, 12118, 42514, 68651, 0, 983895, 3009, 41476, 41489, 69825, 
+    3007, 1448, 3018, 194809, 3889, 8521, 5083, 5082, 119859, 120184, 8519, 
+    983241, 3014, 5081, 65853, 120715, 0, 68014, 69951, 5079, 64802, 42210, 
+    4597, 65532, 11828, 120185, 12371, 0, 8407, 0, 10805, 8518, 10779, 
+    120188, 71303, 983933, 12367, 42170, 0, 92557, 629, 1924, 0, 12037, 
+    74366, 5987, 8462, 8005, 12365, 63933, 69735, 120815, 12369, 10649, 
+    67981, 5077, 120174, 10880, 63927, 5075, 917881, 0, 65075, 0, 11007, 
+    983705, 66659, 92607, 0, 66684, 0, 3434, 4954, 1904, 0, 5266, 126980, 
+    5272, 10499, 4507, 9578, 63923, 120177, 7979, 0, 9831, 0, 194926, 461, 
+    9803, 0, 4504, 1505, 0, 6325, 5276, 43021, 120488, 0, 55236, 0, 66461, 
+    5177, 41324, 12055, 8722, 0, 41327, 0, 66695, 4114, 409, 4383, 8900, 
+    8948, 41325, 0, 721, 10182, 9108, 71311, 0, 119185, 42229, 194912, 0, 
+    5998, 0, 42353, 74825, 0, 12587, 94104, 78571, 0, 71328, 194562, 41576, 
+    42215, 78570, 119207, 0, 8578, 5995, 7573, 41575, 74789, 74752, 63944, 
+    63949, 64767, 2670, 4167, 194796, 11723, 0, 74120, 0, 65076, 938, 43414, 
+    73854, 11737, 9721, 0, 0, 0, 11742, 2419, 0, 11493, 12334, 194913, 4153, 
+    12302, 10793, 5250, 12407, 11978, 4404, 9189, 12401, 42007, 5775, 6759, 
+    65806, 43997, 0, 42002, 12404, 983553, 0, 4940, 12410, 7683, 1167, 73729, 
+    4983, 120507, 861, 0, 0, 0, 0, 43757, 43370, 0, 0, 11956, 0, 0, 0, 9616, 
+    6631, 0, 12816, 43759, 42218, 12710, 68674, 12721, 4101, 66185, 0, 5992, 
+    7616, 195044, 0, 12577, 0, 983884, 853, 42693, 195014, 0, 983647, 5016, 
+    43535, 63893, 42835, 9491, 917913, 0, 917914, 0, 12712, 7105, 127807, 
+    65060, 120797, 9900, 7750, 0, 194919, 0, 127830, 0, 64778, 12585, 10565, 
+    128151, 12177, 0, 0, 0, 77824, 0, 4900, 127874, 12878, 92630, 8984, 4119, 
+    74768, 8971, 78593, 43113, 9702, 78594, 11025, 9245, 13048, 4927, 4138, 
+    74185, 92481, 92710, 12397, 77827, 0, 13054, 12394, 0, 0, 0, 13053, 0, 
+    3948, 10781, 1546, 0, 5010, 1680, 10507, 78590, 78583, 0, 0, 0, 194915, 
+    7267, 0, 74833, 128181, 5993, 2819, 0, 12706, 77840, 1893, 7266, 63915, 
+    7264, 7265, 0, 1363, 0, 63997, 63910, 63996, 3077, 0, 0, 1512, 69929, 
+    12589, 41479, 128313, 0, 43339, 73776, 9836, 120727, 0, 41481, 43335, 
+    7832, 42343, 3090, 43337, 817, 1664, 1850, 128841, 3079, 11340, 42408, 
+    42447, 127140, 120020, 42307, 12386, 42304, 917555, 0, 12389, 0, 92366, 
+    41996, 11526, 63985, 5864, 1147, 63992, 42887, 1987, 92718, 5480, 7858, 
+    11653, 4116, 12391, 66193, 0, 4939, 12384, 0, 0, 41686, 63905, 119601, 
+    194688, 983190, 0, 12649, 0, 0, 8247, 507, 91, 2042, 120775, 43643, 
+    194689, 66028, 10036, 41844, 119813, 774, 119829, 0, 119815, 5994, 12539, 
+    0, 78375, 120597, 119833, 983105, 119600, 0, 0, 7719, 6026, 2486, 128312, 
+    119808, 162, 0, 65219, 41073, 9687, 41681, 6304, 119812, 66196, 194881, 
+    5262, 0, 55233, 12681, 42379, 0, 7534, 12219, 0, 127528, 42810, 10492, 0, 
+    983661, 0, 43119, 0, 120753, 12403, 2500, 195013, 0, 4899, 12729, 0, 0, 
+    74113, 2343, 4103, 19946, 74112, 77851, 13112, 0, 195012, 12859, 70087, 
+    120148, 66369, 5861, 127758, 11999, 12400, 0, 983839, 12645, 5146, 11320, 
+    68410, 6748, 65040, 0, 64184, 12974, 64183, 67613, 120645, 5147, 0, 0, 
+    74524, 0, 1928, 0, 67649, 5991, 3445, 67609, 4976, 64176, 0, 67610, 8241, 
+    0, 77868, 4206, 0, 0, 0, 128298, 0, 10138, 0, 0, 8897, 120234, 0, 8357, 
+    4124, 77862, 65836, 120641, 127926, 77859, 0, 0, 1123, 963, 41553, 10120, 
+    12405, 120150, 92664, 398, 13278, 9723, 6366, 120311, 7945, 0, 4402, 
+    9970, 12402, 983136, 42392, 1305, 12408, 0, 44007, 0, 0, 41464, 12411, 
+    12969, 120824, 41465, 983565, 8528, 1575, 0, 63955, 165, 3024, 41467, 
+    119163, 0, 9093, 0, 9147, 128787, 63958, 0, 9148, 9692, 4096, 53, 8296, 
+    6750, 195018, 0, 9594, 0, 0, 43527, 0, 727, 194703, 195023, 5805, 0, 
+    6726, 0, 42176, 12370, 11655, 119095, 10591, 2280, 0, 12372, 120642, 
+    120307, 0, 92343, 0, 12366, 10963, 6066, 1329, 0, 3052, 9220, 0, 64478, 
+    194701, 10803, 4132, 120306, 68474, 92473, 0, 983313, 74837, 120155, 
+    1499, 0, 8055, 42740, 63965, 0, 63962, 74042, 8924, 43123, 5988, 3660, 
+    63969, 11781, 42718, 8788, 1357, 64851, 65743, 0, 8774, 0, 127086, 9941, 
+    120172, 0, 1933, 69655, 9564, 0, 92435, 73866, 0, 0, 2487, 67614, 3121, 
+    1804, 3311, 67615, 70081, 78302, 12220, 67616, 120598, 127475, 0, 68200, 
+    6675, 128144, 0, 67592, 120685, 0, 64771, 1198, 9132, 0, 64619, 510, 
+    64663, 0, 0, 4561, 2101, 1398, 0, 92554, 74034, 41569, 92684, 11406, 
+    8167, 12127, 0, 840, 0, 126518, 7101, 6967, 0, 194898, 9796, 0, 333, 
+    69891, 0, 8144, 2117, 0, 983595, 12406, 0, 19931, 119089, 6678, 7769, 0, 
+    12621, 0, 127366, 10227, 4764, 43101, 9981, 0, 40986, 4127, 66487, 0, 
+    42202, 12754, 195022, 0, 0, 94097, 67594, 2048, 12944, 4050, 67595, 
+    917967, 43102, 10581, 12985, 4533, 195021, 74003, 6490, 0, 12038, 0, 0, 
+    120704, 65461, 9798, 69704, 0, 1948, 69841, 0, 952, 128235, 0, 0, 120802, 
+    6449, 9494, 120313, 0, 43098, 4843, 8142, 64160, 4098, 64170, 0, 0, 3436, 
+    119973, 0, 12817, 67597, 6676, 3930, 42615, 0, 0, 67598, 0, 0, 0, 65591, 
+    41581, 65916, 1453, 0, 0, 0, 8500, 42222, 120142, 73743, 120400, 4317, 
+    11543, 67676, 64676, 0, 0, 67606, 119083, 0, 42217, 13102, 0, 66003, 
+    6672, 0, 0, 0, 983747, 63841, 9613, 9001, 4526, 11274, 67601, 64520, 
+    64210, 6664, 78704, 42056, 10228, 64957, 11281, 0, 3807, 1469, 66640, 
+    65381, 42197, 4988, 42372, 0, 9598, 904, 352, 42225, 1451, 8061, 8453, 
+    4134, 0, 74847, 66576, 127916, 0, 10520, 8575, 9960, 1201, 127289, 12846, 
+    127291, 127292, 11919, 64962, 127287, 43739, 127281, 8511, 9460, 823, 
+    11587, 12305, 0, 64695, 127305, 12387, 1253, 13183, 65766, 500, 42783, 
+    65765, 64208, 64369, 65760, 65761, 119585, 11606, 64784, 11702, 66498, 
+    9821, 64304, 0, 5152, 11048, 7533, 68366, 64410, 92305, 0, 4323, 120062, 
+    92669, 71332, 127052, 42587, 42214, 41394, 0, 4763, 4112, 118935, 0, 
+    5260, 43143, 94038, 326, 120131, 68423, 0, 10771, 2876, 74074, 92530, 
+    194924, 41398, 7382, 9802, 127077, 127076, 453, 41396, 120524, 42720, 
+    12140, 9572, 0, 7003, 194883, 42334, 7704, 126490, 194885, 43144, 4123, 
+    8494, 43146, 9977, 0, 0, 65759, 10765, 64061, 4465, 9808, 64056, 65582, 
+    4126, 0, 9521, 9589, 64755, 0, 64020, 126604, 10464, 0, 0, 194869, 64514, 
+    11528, 64024, 128072, 679, 64013, 0, 5850, 758, 7536, 0, 92234, 41441, 
+    10693, 64006, 983567, 64005, 4058, 119019, 126487, 64660, 0, 119050, 0, 
+    983069, 1139, 43298, 64027, 64029, 8970, 0, 9934, 983094, 10774, 128020, 
+    42201, 12421, 128216, 0, 1852, 3057, 64046, 73744, 64034, 64039, 0, 0, 0, 
+    194899, 92322, 7645, 12854, 74338, 3496, 0, 0, 0, 9102, 627, 127795, 
+    6158, 8327, 74553, 66632, 12419, 13309, 11570, 127811, 19960, 11696, 0, 
+    1018, 118970, 194909, 194897, 1682, 194896, 194911, 42756, 6765, 194906, 
+    0, 0, 73814, 11412, 6768, 10728, 194830, 71316, 118863, 43311, 64966, 
+    11577, 0, 43040, 1833, 11576, 0, 74779, 0, 185, 65085, 74533, 64754, 
+    194848, 7535, 8085, 42525, 120387, 9749, 41701, 6131, 1949, 4117, 7847, 
+    120489, 194711, 64483, 65693, 0, 0, 0, 69695, 42240, 0, 126651, 42864, 
+    126498, 64667, 41868, 1184, 0, 815, 11484, 127535, 67840, 983651, 0, 
+    66197, 0, 10986, 64683, 983785, 0, 3455, 0, 0, 9879, 0, 0, 4158, 128050, 
+    68166, 0, 0, 0, 0, 69645, 332, 118808, 0, 5142, 2407, 69643, 42199, 0, 
+    92404, 74373, 0, 55217, 0, 63870, 43163, 0, 0, 92390, 42867, 1834, 0, 
+    92461, 69817, 10940, 65249, 119040, 8662, 0, 0, 2652, 120527, 7164, 
+    10784, 195093, 67674, 0, 92233, 92482, 194749, 74562, 917505, 1828, 
+    74474, 120327, 78620, 8531, 12499, 6280, 12324, 118854, 65238, 68374, 
+    4832, 65573, 0, 6279, 12508, 12904, 12502, 9161, 0, 1620, 64436, 3601, 
+    195094, 128073, 983562, 609, 11555, 983099, 12496, 127839, 74181, 4343, 
+    12505, 0, 127863, 0, 11377, 239, 0, 637, 0, 0, 42671, 0, 0, 0, 43565, 
+    71306, 126493, 12696, 128256, 0, 94062, 12929, 0, 712, 0, 4197, 983206, 
+    42818, 126632, 0, 120490, 0, 119137, 1506, 43562, 0, 92491, 0, 12651, 0, 
+    64628, 74517, 12058, 74084, 917838, 7494, 0, 4924, 65592, 118844, 0, 
+    127088, 355, 9719, 127087, 13066, 64796, 0, 0, 12033, 42178, 0, 69760, 
+    42571, 92635, 0, 0, 0, 0, 0, 127176, 3178, 0, 0, 92704, 0, 9080, 127000, 
+    120352, 0, 68209, 0, 11082, 0, 5699, 195100, 66000, 9488, 65166, 119112, 
+    0, 0, 0, 0, 71313, 0, 5265, 69235, 0, 11487, 67858, 12464, 0, 43045, 0, 
+    0, 43345, 0, 10770, 118994, 6807, 465, 9829, 0, 74348, 0, 43346, 8116, 
+    795, 0, 0, 12462, 10930, 10831, 0, 118952, 64362, 74334, 983602, 120811, 
+    0, 12468, 8607, 1008, 0, 10092, 195078, 917842, 67855, 55257, 73771, 
+    1766, 11282, 11996, 1820, 4547, 0, 0, 0, 0, 13223, 128665, 64595, 127294, 
+    0, 92311, 4345, 12616, 0, 0, 0, 74467, 0, 0, 0, 5382, 0, 0, 0, 119060, 
+    64953, 5406, 19920, 69897, 66510, 3590, 194864, 1130, 0, 0, 42016, 11823, 
+    43023, 0, 118896, 7742, 0, 13280, 71323, 9326, 73826, 5310, 74812, 78584, 
+    92229, 8959, 43589, 6747, 66723, 0, 8568, 0, 120496, 73816, 120803, 
+    983848, 42670, 0, 11621, 12460, 0, 120631, 0, 43063, 74519, 127182, 0, 
+    73917, 7843, 69783, 11689, 5410, 5783, 10468, 8403, 5400, 11594, 128247, 
+    0, 118990, 10491, 69842, 64412, 0, 0, 5587, 42865, 64404, 8268, 4923, 
+    65086, 8981, 12382, 42133, 120755, 9706, 69738, 0, 66610, 10461, 12103, 
+    0, 8642, 0, 42766, 983866, 2210, 9983, 0, 94009, 0, 0, 0, 7398, 41515, 0, 
+    11802, 8041, 1461, 910, 119133, 0, 6749, 3658, 93964, 120525, 0, 7617, 
+    194841, 12888, 127983, 67668, 13143, 0, 9193, 11097, 5703, 0, 41517, 
+    41504, 41519, 10016, 64305, 0, 65864, 623, 781, 670, 10660, 5769, 613, 
+    7543, 120279, 477, 41083, 92521, 0, 592, 1578, 12459, 43449, 0, 0, 8225, 
+    0, 654, 11345, 653, 652, 0, 647, 0, 633, 120744, 0, 126472, 12480, 43243, 
+    0, 39, 12487, 0, 120529, 74199, 12482, 0, 12489, 0, 3195, 5550, 983554, 
+    7897, 0, 1203, 74396, 1813, 64544, 41311, 12090, 0, 2877, 0, 0, 1675, 
+    69840, 0, 0, 0, 10070, 10595, 0, 119077, 194777, 983611, 0, 0, 0, 43244, 
+    0, 0, 983916, 119561, 983078, 0, 194921, 128160, 9939, 0, 983151, 77860, 
+    0, 0, 270, 0, 10714, 0, 0, 0, 0, 0, 65372, 0, 74038, 119558, 6273, 66679, 
+    364, 9595, 194908, 0, 0, 707, 0, 0, 9282, 66489, 224, 0, 68670, 9332, 
+    4966, 68677, 0, 68644, 0, 3841, 68634, 0, 10732, 68640, 850, 4972, 0, 
+    12890, 2909, 68619, 44008, 68627, 983718, 11544, 10203, 9608, 0, 0, 
+    11962, 194694, 12507, 1196, 128687, 128311, 777, 120187, 4375, 65271, 
+    67678, 0, 12198, 0, 64824, 119343, 983236, 9454, 63778, 8658, 42528, 
+    78000, 2705, 917975, 41520, 0, 0, 11986, 7765, 42502, 8280, 74520, 2701, 
+    0, 127002, 5767, 0, 0, 9809, 8353, 63747, 66701, 63772, 983814, 63745, 
+    1748, 63770, 0, 0, 0, 65542, 63766, 55244, 3061, 0, 63764, 63787, 9067, 
+    6096, 0, 7694, 0, 7257, 63768, 3485, 12987, 0, 127522, 120628, 63807, 
+    1591, 0, 6386, 63783, 0, 0, 92535, 0, 0, 0, 74575, 0, 65719, 13083, 
+    64574, 65012, 0, 1640, 12495, 66691, 7624, 3138, 10996, 92247, 1922, 0, 
+    12498, 10987, 69936, 69939, 3894, 65543, 0, 194842, 983588, 493, 0, 
+    43197, 1717, 4228, 479, 10303, 74020, 0, 917935, 10335, 3520, 917932, 
+    12490, 64315, 0, 127039, 12493, 6233, 42681, 1002, 12491, 0, 64911, 
+    92615, 2096, 65120, 0, 78219, 983081, 8378, 11632, 127041, 66213, 63864, 
+    66221, 66226, 66229, 13218, 66231, 66216, 8507, 66236, 66211, 66218, 
+    92672, 66240, 78041, 66233, 8928, 983552, 7909, 66234, 11605, 63759, 
+    983654, 66208, 73999, 63799, 63803, 244, 11542, 12898, 12494, 73761, 
+    12492, 12669, 0, 0, 74153, 0, 128278, 120680, 4882, 13040, 0, 8612, 4885, 
+    74053, 0, 13042, 4880, 64662, 2429, 1360, 248, 0, 63797, 92394, 42358, 0, 
+    7292, 0, 63756, 42786, 66693, 0, 1870, 78040, 470, 78038, 78035, 78036, 
+    70028, 78034, 4579, 128090, 0, 12511, 74453, 12514, 0, 74579, 7239, 7001, 
+    8623, 94011, 128052, 128048, 7378, 12512, 11615, 6104, 0, 0, 659, 6098, 
+    0, 12234, 127307, 127067, 8311, 12510, 41803, 13039, 127072, 12513, 
+    10202, 12471, 0, 8747, 983920, 0, 0, 2323, 0, 2319, 77917, 12477, 77916, 
+    2311, 0, 4415, 237, 6281, 127280, 0, 0, 2309, 1312, 8173, 128871, 12469, 
+    0, 78505, 64335, 10609, 0, 128111, 9397, 11524, 9395, 9396, 9393, 9394, 
+    9391, 9392, 9389, 6209, 9387, 9388, 4932, 9386, 9383, 9384, 6740, 0, 
+    65451, 8185, 0, 917832, 43024, 43336, 67659, 2313, 128167, 7948, 9236, 
+    92571, 0, 0, 10570, 43473, 6289, 10484, 0, 0, 11998, 12082, 10924, 3147, 
+    0, 120684, 12524, 119081, 2310, 11818, 9381, 9382, 9379, 9380, 9377, 
+    9378, 9375, 9376, 1683, 9374, 983778, 9372, 12444, 0, 0, 13016, 8210, 
+    983958, 42029, 11079, 12331, 43451, 42032, 8744, 726, 0, 983837, 4155, 0, 
+    0, 42030, 5007, 12522, 43088, 0, 4951, 127805, 127240, 0, 9922, 43309, 
+    983841, 12525, 983471, 12016, 65770, 9548, 67665, 403, 78230, 12503, 0, 
+    0, 11030, 0, 92567, 65691, 63998, 1819, 10496, 0, 0, 119920, 0, 194668, 
+    0, 12506, 0, 12231, 0, 12500, 44023, 12509, 64393, 78830, 3389, 10589, 
+    6608, 41047, 120321, 78395, 78394, 74069, 77995, 78391, 3608, 8281, 
+    120320, 1107, 0, 9076, 8862, 69743, 41052, 13084, 64766, 43217, 7803, 
+    13222, 74165, 74782, 126514, 8546, 11553, 63995, 13177, 9043, 6303, 
+    983947, 498, 64471, 120324, 128567, 12529, 8042, 0, 2344, 12528, 8031, 
+    2414, 0, 69719, 3231, 0, 6422, 66512, 69653, 12530, 2537, 78405, 41429, 
+    12658, 13036, 65772, 0, 78738, 41433, 4719, 469, 0, 4363, 3313, 41428, 
+    78407, 2023, 1772, 78224, 78225, 65706, 10051, 64812, 78220, 0, 9920, 
+    12215, 0, 4931, 1951, 12497, 119363, 9607, 0, 9663, 983228, 119634, 6503, 
+    41110, 0, 1491, 0, 0, 127304, 41061, 0, 194838, 127187, 65026, 41993, 
+    41509, 11045, 65028, 78602, 66476, 41108, 9738, 41995, 1075, 1958, 12535, 
+    41992, 41506, 0, 41687, 0, 120717, 127776, 9940, 127299, 7692, 983833, 
+    8008, 41131, 330, 8566, 65083, 41133, 9816, 126517, 12532, 78550, 78546, 
+    3508, 127058, 43235, 0, 127298, 64139, 78231, 6411, 12910, 78554, 66644, 
+    13028, 6737, 12537, 0, 0, 64136, 12536, 2350, 13029, 78233, 0, 983103, 
+    13030, 6702, 4527, 0, 12538, 128810, 983645, 65599, 65717, 9966, 0, 4948, 
+    12484, 4032, 128149, 12623, 0, 6207, 0, 6117, 65930, 8412, 0, 7438, 1296, 
+    2325, 41511, 126625, 10149, 74118, 0, 127286, 12481, 0, 12488, 66713, 0, 
+    41556, 64414, 118802, 2354, 42619, 73766, 0, 6295, 901, 41510, 7953, 0, 
+    65032, 41513, 983166, 11927, 66584, 78559, 78560, 78557, 78558, 0, 78556, 
+    848, 9868, 0, 6424, 78568, 119338, 69922, 74031, 78563, 78564, 2352, 
+    78572, 893, 64576, 11289, 1407, 67973, 0, 13026, 6762, 78579, 78580, 
+    13023, 8903, 9777, 66715, 1871, 8099, 0, 0, 1343, 983823, 0, 9325, 6818, 
+    6283, 11738, 0, 983934, 0, 11741, 0, 0, 9216, 8263, 11279, 194752, 
+    983825, 194754, 13021, 64494, 3136, 194758, 194757, 194760, 13022, 42737, 
+    9956, 0, 0, 74552, 10014, 0, 41260, 119340, 13020, 10024, 194764, 74583, 
+    74340, 69681, 0, 43001, 8029, 0, 0, 983780, 3335, 0, 0, 9776, 120526, 
+    194748, 5215, 42644, 3333, 1632, 194751, 64849, 3342, 78582, 5363, 12957, 
+    78581, 4156, 0, 0, 6421, 78591, 1611, 78589, 13018, 74257, 78588, 74542, 
+    3337, 4537, 67895, 11736, 0, 68608, 6482, 4214, 73790, 11945, 0, 13046, 
+    8838, 425, 4025, 10709, 78595, 2108, 2392, 13047, 0, 0, 6819, 13049, 
+    6499, 92243, 12424, 68614, 73944, 13050, 9924, 194745, 6507, 127919, 
+    94073, 128069, 3277, 8929, 4947, 41055, 0, 194722, 194721, 194724, 13045, 
+    64626, 66034, 7751, 194727, 8371, 194729, 3997, 12806, 8768, 13044, 0, 
+    12420, 4024, 194730, 41054, 1078, 9757, 69736, 41057, 0, 0, 0, 0, 983791, 
+    92210, 92411, 0, 41496, 0, 9165, 1572, 11911, 0, 118842, 2346, 13270, 
+    8958, 0, 9646, 3773, 43183, 6401, 5831, 0, 0, 13043, 8056, 92494, 65681, 
+    208, 127382, 41514, 0, 0, 0, 10699, 6408, 92227, 7825, 5661, 0, 120630, 
+    3603, 41109, 2398, 3548, 126596, 0, 119933, 0, 3115, 9918, 0, 8294, 
+    42912, 0, 0, 194726, 4876, 65804, 0, 0, 43468, 983274, 41558, 41471, 
+    73950, 8158, 9944, 41472, 120298, 13051, 78689, 3143, 194674, 6701, 
+    41559, 1896, 66256, 13052, 194680, 5665, 0, 119071, 7025, 63974, 0, 
+    74352, 74161, 4154, 9863, 43550, 12310, 5662, 42382, 1564, 73924, 1121, 
+    78319, 63959, 0, 9942, 13231, 0, 64752, 4732, 194666, 11596, 119931, 
+    65187, 1626, 63983, 10110, 64772, 42024, 6420, 42028, 0, 10509, 2795, 
+    4910, 194728, 69231, 64753, 6275, 93957, 118830, 63978, 11044, 3229, 
+    6423, 42774, 0, 0, 0, 12823, 2331, 917810, 7085, 6137, 0, 7524, 0, 
+    917809, 8346, 0, 8338, 128315, 65043, 0, 822, 127984, 9903, 64721, 42722, 
+    69877, 194659, 78655, 78661, 194660, 78662, 41265, 5311, 1795, 965, 
+    118791, 10587, 78055, 11278, 78632, 194640, 0, 12946, 194641, 119341, 
+    120349, 6294, 3144, 194648, 194647, 65019, 194649, 73990, 0, 983960, 748, 
+    41067, 2330, 535, 3148, 12375, 78799, 194629, 10556, 2475, 12388, 4889, 
+    8968, 67863, 3593, 0, 0, 2342, 0, 194634, 65206, 4894, 194635, 4890, 
+    194637, 917804, 581, 4893, 983616, 6571, 65545, 4888, 4157, 78048, 78049, 
+    78046, 78047, 0, 10119, 6415, 42893, 0, 69702, 0, 0, 11375, 64746, 2332, 
+    78063, 412, 78061, 64932, 42880, 43587, 0, 0, 0, 0, 65197, 78066, 12203, 
+    78064, 78065, 8913, 65854, 4875, 65811, 120381, 120389, 118888, 9344, 
+    8826, 120386, 120395, 13104, 74781, 11997, 120393, 78075, 0, 3134, 0, 
+    65696, 92331, 0, 66217, 0, 8334, 119344, 0, 3449, 0, 0, 78414, 78413, 
+    118950, 74011, 0, 0, 0, 0, 1908, 120167, 4328, 10734, 127014, 0, 127914, 
+    7804, 78272, 10811, 6250, 11339, 4914, 11367, 0, 78054, 4917, 74516, 
+    74208, 64285, 4912, 5464, 127836, 118893, 2361, 7971, 78072, 78073, 
+    55243, 78071, 0, 8086, 74317, 6707, 8319, 2312, 40977, 10960, 40962, 
+    8305, 12573, 983608, 40980, 983964, 13202, 0, 12582, 78282, 983048, 
+    69856, 42438, 55221, 6288, 78280, 127946, 5653, 42400, 10891, 7698, 5658, 
+    74045, 70039, 0, 0, 4913, 0, 983959, 71333, 42326, 128194, 12728, 92685, 
+    42478, 2327, 0, 12563, 42287, 12705, 0, 0, 12588, 8821, 6153, 2867, 
+    194708, 66312, 698, 128007, 194606, 10356, 70017, 194713, 651, 12641, 0, 
+    0, 0, 0, 41552, 65115, 78465, 78467, 78463, 78464, 128851, 78461, 194697, 
+    74356, 64945, 4716, 43277, 0, 78474, 12340, 120568, 0, 194700, 55264, 
+    41211, 120676, 8703, 5462, 917629, 983495, 10101, 0, 70049, 8479, 4151, 
+    41933, 0, 0, 66254, 120821, 0, 0, 128654, 0, 119194, 74050, 92701, 0, 0, 
+    0, 0, 0, 12278, 0, 0, 0, 2700, 12576, 7842, 12899, 0, 0, 2699, 0, 73845, 
+    2985, 92568, 126475, 917845, 12192, 119314, 0, 119312, 9827, 119310, 
+    119311, 119308, 119309, 119306, 11481, 41210, 119305, 0, 35, 78481, 
+    78482, 66694, 68479, 78477, 78478, 43596, 6090, 64257, 7812, 10534, 0, 
+    78485, 73848, 67975, 4272, 0, 40967, 40964, 917825, 12704, 78487, 43306, 
+    0, 64497, 12138, 7930, 0, 2292, 68216, 0, 917826, 5244, 4189, 94108, 
+    67596, 127504, 4188, 1879, 0, 968, 0, 43743, 0, 8873, 2279, 0, 917827, 
+    65555, 12574, 0, 0, 0, 74490, 127099, 43657, 0, 0, 0, 42682, 12578, 
+    12720, 0, 41227, 0, 12346, 127101, 64848, 0, 0, 7251, 0, 0, 118850, 
+    119141, 128546, 66015, 0, 959, 8885, 12564, 66457, 78808, 9469, 9632, 
+    92323, 74761, 64323, 127335, 0, 0, 0, 310, 0, 41281, 10976, 0, 71325, 0, 
+    74266, 10054, 6497, 8574, 0, 9012, 19958, 74420, 65089, 13215, 12730, 
+    65163, 74044, 374, 43195, 816, 120161, 0, 0, 41934, 7465, 0, 128168, 
+    983268, 4715, 6101, 94106, 41936, 0, 4879, 0, 65446, 0, 307, 127147, 
+    9585, 5374, 983267, 128059, 0, 0, 126618, 120390, 0, 65567, 120614, 1929, 
+    0, 12142, 0, 12236, 41419, 194618, 120610, 12982, 194623, 5378, 78791, 
+    128679, 41421, 0, 4462, 0, 126599, 128092, 821, 0, 2498, 5800, 120157, 
+    983115, 1760, 2421, 4469, 2324, 828, 3611, 78400, 757, 1185, 0, 78770, 
+    43597, 10628, 74808, 194572, 7999, 43971, 0, 0, 10634, 10942, 7713, 2348, 
+    0, 64374, 4380, 194608, 119044, 9982, 64324, 41240, 862, 65626, 78462, 
+    1810, 3673, 5137, 194617, 0, 7277, 65622, 0, 7566, 64688, 194593, 194592, 
+    78092, 74357, 194597, 4748, 92228, 194598, 194601, 42260, 5871, 119075, 
+    0, 74576, 44019, 0, 128189, 3967, 194604, 13137, 8775, 127945, 0, 2963, 
+    0, 8410, 4454, 723, 127882, 966, 4449, 92330, 92238, 0, 7819, 2320, 
+    194589, 339, 4968, 194590, 120399, 8075, 55276, 0, 8047, 0, 78827, 12634, 
+    41542, 78780, 7466, 6705, 12174, 42610, 0, 74452, 983763, 1584, 66645, 
+    6045, 6729, 120640, 65218, 11559, 0, 78062, 7537, 0, 11370, 0, 10330, 0, 
+    10394, 0, 74194, 0, 127929, 9780, 0, 13092, 194576, 77950, 194578, 7074, 
+    92648, 194579, 194582, 11414, 128868, 2531, 13034, 0, 0, 4211, 1259, 
+    7517, 0, 0, 194561, 40996, 13037, 7092, 641, 5219, 94034, 194566, 11064, 
+    41129, 0, 42850, 13035, 9075, 92387, 5466, 128153, 0, 64098, 65793, 4535, 
+    194573, 4271, 78417, 128357, 6769, 41410, 983452, 64262, 6767, 41407, 0, 
+    0, 6755, 118864, 9046, 127934, 126608, 0, 0, 0, 0, 67675, 0, 0, 0, 64338, 
+    2563, 13033, 247, 118915, 0, 12338, 4651, 69895, 11270, 0, 0, 11933, 0, 
+    0, 41903, 43447, 11001, 0, 42255, 0, 92661, 69821, 41905, 0, 0, 10775, 
+    9793, 5009, 0, 42269, 64587, 983063, 42535, 69812, 64529, 41408, 42853, 
+    3877, 120795, 42674, 8147, 43566, 119021, 983776, 10236, 65918, 43782, 0, 
+    0, 64506, 69652, 118921, 4747, 128058, 69844, 43200, 5832, 0, 0, 5141, 
+    42600, 0, 43203, 0, 983799, 43286, 0, 128211, 43778, 0, 41305, 78776, 
+    43781, 11303, 65547, 0, 7031, 859, 0, 0, 0, 6059, 126985, 55235, 0, 8535, 
+    0, 65196, 194787, 66032, 11488, 120481, 120786, 42233, 64140, 9946, 
+    63885, 194792, 11822, 0, 43189, 983898, 0, 1788, 1579, 120482, 71298, 0, 
+    0, 0, 9028, 119571, 69234, 94055, 0, 1285, 64882, 41242, 70086, 0, 12640, 
+    0, 7401, 0, 12625, 68198, 0, 70082, 3940, 41597, 43754, 3396, 12642, 
+    8665, 0, 0, 12630, 1653, 917815, 10153, 0, 6166, 120516, 118989, 0, 8815, 
+    66673, 65046, 9285, 913, 42259, 119317, 119318, 2142, 68454, 42485, 
+    94012, 7878, 8211, 42293, 64377, 0, 92643, 0, 194673, 12032, 0, 9725, 0, 
+    78431, 5263, 12818, 78430, 41939, 10022, 65387, 78419, 42777, 10139, 980, 
+    43698, 65386, 2208, 0, 43701, 43198, 7184, 120673, 194797, 917819, 10085, 
+    119992, 0, 119993, 6634, 92373, 0, 119323, 8072, 119321, 43700, 0, 8872, 
+    7783, 917992, 12398, 8237, 0, 0, 12395, 0, 126977, 120565, 9914, 2217, 
+    917854, 73975, 6367, 6351, 66688, 0, 78107, 0, 64735, 41243, 92199, 7808, 
+    1829, 0, 41937, 4358, 43272, 6353, 0, 0, 120422, 0, 1710, 0, 0, 65607, 0, 
+    49, 6627, 0, 6258, 10683, 78672, 9741, 78329, 5649, 78441, 43443, 64418, 
+    1643, 65213, 8405, 3470, 128225, 13213, 42452, 78331, 120664, 78445, 0, 
+    1072, 78457, 78452, 78454, 6576, 41988, 41132, 65675, 1080, 120002, 9886, 
+    55225, 1101, 68404, 12309, 55227, 0, 12632, 1086, 1869, 78685, 7680, 0, 
+    65458, 120714, 12639, 3380, 8123, 1091, 12638, 7977, 4501, 41099, 0, 
+    66309, 0, 0, 1494, 983146, 126613, 0, 11693, 126513, 10494, 92655, 65872, 
+    12363, 11386, 0, 0, 0, 0, 64582, 0, 73794, 0, 8022, 0, 120462, 74106, 
+    12413, 94069, 917994, 917993, 917995, 5570, 1881, 7210, 0, 1012, 43752, 
+    0, 120709, 7208, 66442, 5569, 983242, 42339, 0, 6063, 0, 78383, 119594, 
+    6053, 65602, 0, 92201, 64727, 9160, 194827, 0, 0, 92180, 10503, 118810, 
+    6055, 3870, 4279, 8490, 120114, 4319, 64786, 8602, 120110, 11326, 92204, 
+    983116, 0, 120119, 78333, 120117, 120118, 120099, 120100, 65087, 5571, 
+    3674, 9740, 9121, 5568, 120107, 120108, 42085, 10107, 42159, 42870, 
+    120101, 589, 7050, 983800, 43281, 10233, 41263, 66251, 65729, 66253, 
+    126497, 74099, 42645, 0, 194815, 8583, 0, 5847, 6928, 128074, 0, 0, 0, 0, 
+    66592, 12204, 917962, 19966, 77856, 42561, 120626, 983251, 0, 8120, 
+    120701, 0, 0, 128012, 41063, 0, 10664, 0, 8369, 0, 4551, 194964, 3369, 0, 
+    0, 9673, 66334, 65580, 10478, 118960, 12517, 557, 9457, 12034, 983671, 
+    6355, 12519, 41004, 0, 195025, 74094, 0, 0, 77970, 983560, 0, 128175, 
+    12111, 3927, 0, 12515, 1474, 67893, 5492, 6923, 92281, 10441, 73836, 0, 
+    43990, 5493, 0, 74319, 0, 66635, 12019, 0, 1618, 0, 120474, 9645, 10430, 
+    917959, 5853, 13063, 10363, 0, 12956, 128169, 120729, 11314, 917582, 
+    12060, 0, 78392, 12826, 6329, 0, 10514, 65517, 74395, 2707, 8309, 0, 
+    127054, 78398, 43570, 2697, 43420, 78396, 127057, 2695, 42171, 0, 0, 0, 
+    67617, 118971, 0, 2693, 12125, 12766, 0, 1164, 128817, 0, 41918, 983168, 
+    127542, 8687, 66009, 12178, 7053, 128001, 7469, 0, 5248, 12218, 120538, 
+    6427, 42884, 41123, 0, 0, 42873, 41126, 9991, 41128, 74371, 127031, 0, 
+    9873, 0, 42877, 7994, 64762, 2053, 42843, 6591, 9340, 0, 1589, 0, 296, 
+    74438, 78852, 0, 67841, 74370, 0, 8922, 128068, 74600, 12700, 74836, 0, 
+    12579, 0, 12575, 6416, 5656, 2891, 13262, 65590, 5299, 0, 11473, 5449, 
+    1252, 0, 78404, 41431, 74369, 65373, 5295, 917569, 74114, 1223, 1642, 
+    174, 78399, 883, 4161, 12691, 42603, 41413, 3212, 41459, 3211, 74810, 
+    41425, 127029, 78412, 74450, 9728, 3846, 8070, 6150, 6636, 4370, 0, 0, 
+    74178, 74587, 74117, 0, 0, 0, 4986, 12189, 0, 67648, 120499, 94001, 4257, 
+    12104, 77942, 6220, 9004, 65561, 0, 77949, 0, 68135, 917576, 77946, 0, 
+    69679, 69684, 9890, 78561, 12971, 78453, 92556, 73898, 11979, 70051, 
+    118900, 917894, 0, 9635, 12600, 8871, 0, 0, 0, 6469, 74227, 0, 65304, 
+    4679, 10230, 64300, 64867, 3427, 4240, 0, 0, 0, 0, 42916, 0, 0, 0, 7282, 
+    78728, 65733, 4445, 127138, 128082, 3494, 74606, 6555, 0, 77976, 0, 0, 
+    78566, 0, 983189, 65898, 983244, 65312, 5447, 0, 12895, 65593, 4010, 0, 
+    41106, 0, 64448, 0, 41105, 0, 65820, 6232, 0, 128280, 0, 43608, 119091, 
+    0, 6538, 4335, 78364, 3941, 41122, 11061, 78363, 64892, 9113, 1954, 
+    12155, 983674, 42878, 11500, 0, 0, 74578, 0, 65832, 0, 0, 0, 77975, 
+    119230, 4586, 0, 350, 10951, 0, 509, 0, 0, 92307, 0, 0, 5133, 0, 0, 9500, 
+    0, 4957, 64741, 2422, 2212, 983080, 0, 0, 2496, 11516, 944, 118851, 3890, 
+    12168, 1438, 0, 983117, 0, 41947, 1220, 120828, 128555, 0, 0, 1571, 
+    42630, 41949, 42805, 8270, 943, 564, 0, 312, 41980, 983944, 0, 78120, 
+    8877, 269, 4429, 6272, 9617, 1460, 6954, 78657, 41120, 65121, 10862, 
+    6060, 41119, 41416, 74355, 4173, 0, 0, 0, 1906, 917986, 11532, 74073, 
+    127338, 0, 1985, 6296, 9582, 917895, 64287, 0, 78115, 11428, 1730, 2457, 
+    917808, 19918, 10469, 0, 0, 7703, 8840, 8035, 0, 0, 92230, 0, 6129, 0, 
+    128528, 128268, 0, 7874, 8681, 119092, 0, 13136, 0, 0, 70102, 63886, 
+    118881, 9605, 71308, 13220, 128776, 120274, 5514, 0, 9228, 0, 0, 0, 5240, 
+    9811, 10012, 3096, 0, 0, 983351, 66676, 65873, 0, 0, 0, 9501, 0, 1272, 
+    64536, 65465, 64654, 7467, 0, 1467, 10158, 10040, 0, 9519, 0, 917812, 0, 
+    118899, 12193, 0, 0, 0, 0, 983353, 19935, 0, 92162, 69676, 0, 0, 0, 5275, 
+    0, 0, 8637, 0, 0, 3789, 63880, 11471, 43554, 65862, 11474, 66332, 66603, 
+    128138, 2426, 12042, 92194, 983911, 9537, 3961, 12115, 77953, 2605, 4500, 
+    64561, 55224, 4981, 0, 0, 63876, 11667, 42686, 77973, 42362, 64686, 4499, 
+    41649, 7589, 0, 0, 3237, 0, 68215, 917904, 8541, 78298, 70034, 41866, 0, 
+    0, 0, 0, 69924, 43555, 2823, 9559, 10060, 41940, 8299, 41945, 7132, 
+    41941, 3308, 7190, 64880, 8614, 65220, 41493, 0, 41699, 10762, 43780, 
+    12999, 0, 0, 8106, 4128, 0, 6274, 4494, 0, 4012, 10395, 983591, 43633, 
+    65447, 126511, 0, 11004, 695, 739, 696, 7611, 0, 42755, 74802, 9227, 
+    7506, 7510, 69937, 691, 738, 7511, 7512, 7515, 3868, 688, 41847, 690, 
+    2548, 737, 974, 8003, 7406, 917911, 0, 128688, 3985, 917912, 65860, 
+    63921, 7051, 69777, 4682, 917805, 12809, 6406, 4685, 92505, 10879, 10347, 
+    4680, 6341, 0, 3851, 8132, 74325, 0, 917907, 0, 41958, 119176, 917908, 0, 
+    0, 42657, 92468, 7643, 42373, 11714, 67587, 43568, 983175, 11717, 7650, 
+    10594, 64951, 7647, 7649, 128155, 7646, 0, 78082, 9651, 0, 3891, 0, 0, 
+    2337, 1735, 74324, 67860, 2363, 983135, 0, 43561, 0, 0, 74146, 1860, 
+    7495, 7580, 5812, 7497, 7584, 119140, 127853, 0, 120347, 7727, 0, 8498, 
+    69818, 8949, 3065, 42719, 7135, 1569, 92375, 12534, 12124, 7690, 0, 
+    12533, 983879, 6418, 4543, 78086, 6969, 0, 74800, 0, 67974, 11980, 
+    128650, 983801, 63894, 120760, 12282, 66192, 0, 74592, 8850, 74275, 9238, 
+    10617, 917545, 0, 92625, 0, 12791, 0, 0, 127843, 4447, 73732, 12793, 
+    12900, 92377, 10950, 0, 78087, 12790, 41400, 119128, 66607, 12792, 42232, 
+    194938, 1744, 12789, 10366, 12317, 41310, 983869, 41399, 0, 0, 55258, 0, 
+    12690, 0, 0, 43672, 127840, 41652, 2974, 9010, 11315, 0, 278, 0, 41405, 
+    119254, 0, 10077, 63853, 74557, 42586, 0, 0, 6002, 0, 43553, 0, 67903, 0, 
+    12787, 41308, 7934, 65306, 0, 0, 0, 8646, 983186, 77829, 71360, 0, 6413, 
+    6550, 0, 1940, 0, 43637, 220, 65193, 43551, 10678, 10044, 128322, 0, 0, 
+    68659, 6403, 5707, 10393, 127532, 0, 66614, 0, 0, 0, 10297, 0, 3742, 0, 
+    3959, 0, 0, 0, 2467, 0, 6003, 63844, 6663, 8040, 0, 43758, 4182, 78171, 
+    4676, 120501, 0, 0, 2510, 0, 10208, 78168, 92361, 11540, 43546, 6692, 0, 
+    41060, 0, 4668, 9083, 0, 0, 78144, 1559, 63831, 9677, 120260, 0, 65256, 
+    0, 74070, 0, 0, 365, 12056, 43027, 120423, 41716, 128236, 0, 120472, 
+    5516, 2845, 7717, 8036, 41717, 73827, 544, 12045, 6278, 0, 5515, 0, 0, 
+    983051, 65339, 43221, 2211, 0, 5517, 0, 0, 74841, 67884, 0, 67890, 67885, 
+    67880, 67881, 67882, 67883, 0, 0, 67879, 127188, 1902, 67887, 9638, 
+    12976, 126546, 12483, 12368, 41769, 42726, 41765, 7361, 6667, 67874, 
+    7556, 67878, 74351, 11264, 989, 42677, 67889, 0, 1311, 917966, 4326, 
+    11000, 63824, 13068, 10932, 128880, 6917, 78155, 0, 949, 78162, 0, 6148, 
+    8605, 42253, 78177, 0, 0, 42715, 0, 0, 0, 63871, 0, 41796, 1269, 6530, 0, 
+    65057, 0, 5144, 12221, 42716, 0, 4431, 4331, 983729, 128675, 41834, 5279, 
+    0, 10336, 8312, 0, 42701, 128825, 0, 78165, 66036, 0, 0, 6428, 42270, 0, 
+    983596, 43059, 42666, 5256, 1067, 255, 12131, 983722, 9493, 983968, 
+    41014, 11793, 194920, 0, 74394, 43460, 10653, 42723, 983854, 119632, 0, 
+    6560, 7016, 74274, 983615, 43556, 3929, 67977, 6614, 2768, 92504, 9746, 
+    5135, 11811, 12796, 11953, 0, 69761, 5139, 346, 74303, 6305, 12795, 4675, 
+    5168, 78552, 127753, 74315, 74361, 8253, 8817, 1136, 0, 43563, 92232, 0, 
+    194750, 7392, 8230, 9365, 0, 0, 983607, 0, 0, 4041, 0, 2357, 43240, 
+    12786, 229, 119885, 119884, 44004, 7142, 119881, 12350, 65554, 119882, 
+    119877, 119876, 12785, 63863, 43795, 7770, 10712, 64853, 12686, 118916, 
+    42375, 0, 127238, 66352, 10470, 0, 11059, 10791, 917944, 450, 119328, 0, 
+    10432, 12097, 5450, 64691, 1233, 0, 44009, 78284, 66338, 0, 0, 1839, 
+    118799, 983219, 10927, 1701, 983664, 2388, 41749, 41761, 5453, 8361, 
+    119865, 41758, 5444, 41763, 64889, 7143, 92493, 78677, 0, 92429, 78174, 
+    66432, 8801, 3053, 4340, 983044, 0, 65812, 917831, 0, 41824, 67985, 
+    120203, 194800, 194803, 42700, 194805, 127980, 194807, 78676, 92356, 
+    194808, 0, 0, 4493, 4336, 0, 2314, 43602, 78826, 119325, 194811, 42439, 
+    64638, 42327, 43528, 4489, 71331, 0, 194793, 1912, 42385, 10306, 10370, 
+    0, 0, 8867, 10250, 10258, 2712, 1635, 78821, 1410, 92671, 983250, 118878, 
+    0, 0, 9919, 120528, 559, 128157, 41825, 127975, 78188, 4892, 74016, 
+    194781, 6542, 41957, 128865, 5777, 0, 759, 65749, 2079, 65248, 12788, 
+    64487, 64552, 0, 10223, 42062, 0, 0, 126573, 3668, 65754, 43560, 12226, 
+    67991, 65149, 2340, 41959, 194786, 194785, 194788, 43618, 65747, 10937, 
+    2962, 0, 2321, 3587, 65745, 92436, 8921, 9952, 0, 0, 42714, 9951, 43409, 
+    194770, 2949, 66012, 194775, 194774, 2958, 68359, 41820, 2300, 2395, 
+    128563, 9976, 120043, 120050, 120058, 68220, 128143, 42809, 42807, 0, 
+    120046, 10198, 4150, 64371, 8318, 41790, 67976, 41898, 2360, 41794, 
+    917942, 71314, 127818, 0, 0, 2418, 983098, 2411, 11336, 799, 63823, 
+    10276, 10308, 10372, 917541, 41772, 42813, 2317, 10260, 118980, 55284, 
+    92203, 0, 10384, 983220, 0, 0, 7753, 2351, 6655, 64489, 69931, 0, 77872, 
+    4443, 42779, 230, 0, 0, 43549, 4855, 42150, 65739, 5441, 41896, 10288, 
+    10320, 0, 855, 7046, 6109, 65045, 63839, 78198, 2049, 10098, 0, 74145, 
+    127943, 10264, 10280, 9184, 10376, 7013, 4467, 0, 0, 0, 41887, 0, 4862, 
+    9735, 6537, 120591, 74286, 3914, 92178, 93976, 9065, 12961, 0, 0, 92253, 
+    0, 289, 0, 4694, 11420, 4690, 0, 120514, 917978, 4693, 73893, 42724, 0, 
+    4688, 120454, 0, 0, 67994, 8238, 3110, 120162, 983908, 120163, 6528, 
+    127553, 43035, 69898, 218, 0, 1520, 0, 4786, 0, 43225, 4602, 0, 78167, 
+    10088, 6548, 0, 120156, 43978, 8988, 8888, 0, 0, 0, 0, 10666, 0, 73902, 
+    69740, 0, 0, 9975, 128039, 119902, 4689, 8932, 0, 65560, 119209, 74441, 
+    78810, 0, 0, 67987, 0, 0, 0, 67989, 0, 10065, 8207, 0, 92613, 128011, 0, 
+    662, 0, 9244, 194863, 0, 119261, 983428, 0, 0, 0, 41929, 0, 0, 66674, 
+    41926, 120408, 120443, 10513, 64637, 194862, 68013, 52, 13118, 6475, 0, 
+    120341, 12095, 10225, 4812, 92578, 0, 67992, 74085, 0, 3978, 0, 917945, 
+    127823, 11582, 120761, 12281, 0, 6544, 13241, 93961, 69782, 128557, 
+    194860, 11765, 65258, 10369, 0, 1585, 7192, 10249, 422, 1500, 2036, 986, 
+    194859, 64394, 5781, 5599, 64294, 2494, 120450, 4861, 74021, 64334, 
+    78203, 127808, 0, 92266, 65102, 8961, 65842, 10243, 10245, 74191, 120410, 
+    0, 120453, 64821, 9478, 2508, 92683, 0, 202, 128246, 74131, 1242, 65514, 
+    0, 63940, 128706, 64533, 120129, 0, 67842, 11990, 92430, 63939, 43375, 
+    65440, 2504, 0, 78671, 64829, 983910, 6943, 917934, 5859, 0, 2858, 
+    983361, 74294, 983914, 69239, 0, 119027, 12992, 2753, 1936, 70078, 92574, 
     2751, 12662, 2763, 8953, 64701, 10731, 12922, 7052, 917839, 0, 0, 0, 
     63920, 74128, 2856, 119910, 47, 69908, 126986, 65858, 0, 0, 0, 7899, 0, 
     8417, 43798, 7072, 0, 0, 4033, 128164, 43992, 0, 0, 212, 64600, 1903, 
@@ -17797,23 +17816,23 @@
     12624, 0, 1673, 4811, 92383, 5986, 9338, 3046, 74480, 5985, 917928, 
     119598, 9820, 0, 12187, 0, 0, 5984, 0, 43308, 4393, 67650, 0, 0, 0, 0, 
     74826, 64733, 0, 0, 3491, 0, 0, 128219, 3514, 65485, 0, 7492, 0, 74605, 
-    92483, 7514, 983359, 0, 194731, 7502, 7587, 68353, 0, 0, 63925, 0, 7610, 
+    92483, 7514, 983367, 0, 194731, 7502, 7587, 68353, 0, 0, 63925, 0, 7610, 
     219, 0, 0, 692, 43588, 74433, 41635, 43241, 9688, 7147, 9535, 0, 93991, 
     0, 64530, 0, 64610, 11804, 0, 7149, 7453, 0, 8013, 0, 92301, 0, 8895, 
     5253, 70025, 5458, 0, 2866, 0, 127860, 65111, 68433, 6700, 120484, 0, 
-    120583, 0, 8962, 77960, 9641, 43694, 7059, 983668, 0, 9604, 78700, 7441, 
-    63826, 67970, 118941, 64392, 194735, 983678, 2844, 983932, 41974, 0, 
-    12139, 67971, 0, 0, 3358, 65295, 0, 3104, 194734, 0, 194765, 983227, 
+    120583, 0, 8962, 77960, 9641, 43694, 7059, 983677, 0, 9604, 78700, 7441, 
+    63826, 67970, 118941, 64392, 194735, 983687, 2844, 983941, 41974, 0, 
+    12139, 67971, 0, 0, 3358, 65295, 0, 3104, 194734, 0, 194765, 983233, 
     5308, 0, 290, 0, 0, 2862, 2792, 195088, 983070, 0, 3268, 66591, 0, 6552, 
     42367, 7035, 120558, 0, 0, 1814, 0, 10240, 92338, 74305, 0, 74528, 65903, 
     0, 42646, 7606, 2591, 2837, 4341, 77956, 64482, 127337, 8163, 65270, 0, 
     77932, 0, 9112, 74431, 863, 9490, 119898, 128349, 43323, 120513, 119897, 
     9071, 127333, 0, 3654, 7789, 9637, 0, 2535, 65504, 7653, 40993, 119899, 
-    66587, 195098, 0, 92401, 983885, 11006, 12927, 7807, 8073, 0, 10629, 0, 
+    66587, 195098, 0, 92401, 983894, 11006, 12927, 7807, 8073, 0, 10629, 0, 
     74088, 3056, 10823, 128797, 127327, 8762, 10508, 69689, 73770, 43969, 
     43193, 10737, 3463, 983065, 0, 66633, 8695, 4815, 11322, 5811, 12345, 
     7049, 119911, 5195, 195081, 0, 66639, 0, 0, 0, 128041, 0, 92385, 1262, 0, 
-    6561, 19939, 0, 0, 128535, 119906, 0, 0, 983097, 0, 983658, 119907, 
+    6561, 19939, 0, 0, 128535, 119906, 0, 0, 983097, 0, 983667, 119907, 
     64612, 11991, 0, 0, 0, 1502, 917568, 0, 9107, 127316, 5702, 3655, 67661, 
     8430, 0, 74132, 120758, 0, 74057, 9603, 0, 5254, 120742, 7724, 74388, 
     68375, 10796, 5129, 0, 0, 590, 7579, 5614, 5893, 92280, 11720, 92496, 
@@ -17827,17 +17846,17 @@
     0, 65558, 65946, 8113, 7087, 5255, 1786, 661, 0, 0, 0, 74423, 71345, 586, 
     74414, 64359, 1267, 128269, 65468, 0, 65731, 0, 127179, 3621, 120473, 
     66666, 64211, 0, 6562, 12928, 0, 1228, 65490, 11383, 0, 0, 0, 1714, 
-    74406, 127831, 0, 983912, 0, 66225, 0, 0, 42660, 11436, 2070, 64, 120694, 
+    74406, 127831, 0, 983921, 0, 66225, 0, 0, 42660, 11436, 2070, 64, 120694, 
     0, 10291, 10323, 2826, 0, 0, 0, 42008, 9708, 42710, 0, 42011, 41999, 
-    92164, 12206, 5839, 1702, 1240, 74065, 6286, 0, 983960, 65833, 77848, 0, 
+    92164, 12206, 5839, 1702, 1240, 74065, 6286, 0, 983969, 65833, 77848, 0, 
     1765, 0, 0, 65588, 0, 0, 0, 8401, 0, 42014, 0, 7030, 194704, 10479, 
     64959, 2852, 0, 0, 0, 0, 128586, 917951, 6963, 0, 12667, 64540, 74786, 
     10147, 12935, 127568, 126483, 0, 0, 0, 78757, 0, 0, 0, 0, 9994, 12467, 
     2864, 64719, 1148, 10435, 11462, 41675, 7084, 2765, 0, 43382, 0, 120719, 
     128188, 92516, 66662, 0, 78133, 9364, 194685, 74416, 0, 0, 77988, 263, 
-    10449, 41288, 0, 41839, 78387, 983733, 77986, 0, 6931, 69722, 64355, 
+    10449, 41288, 0, 41839, 78387, 983742, 77986, 0, 6931, 69722, 64355, 
     7177, 70105, 0, 0, 0, 4262, 10285, 10722, 42020, 126575, 6806, 6992, 
-    42019, 0, 41290, 983707, 750, 0, 71304, 10163, 63913, 71300, 7032, 5954, 
+    42019, 0, 41290, 983716, 750, 0, 71304, 10163, 63913, 71300, 7032, 5954, 
     64931, 4314, 0, 198, 68453, 730, 120094, 63907, 77993, 78891, 13165, 
     7107, 74171, 42804, 678, 8240, 78015, 128784, 41378, 11008, 6938, 70026, 
     92637, 2097, 66246, 120560, 0, 0, 0, 3892, 68632, 69642, 6712, 66045, 
@@ -17845,31 +17864,31 @@
     69669, 43254, 73831, 0, 10293, 5952, 1281, 43747, 0, 0, 10677, 604, 
     41097, 9182, 1859, 0, 92603, 3425, 127488, 0, 2836, 0, 0, 9707, 0, 43202, 
     0, 0, 65199, 1738, 917818, 128158, 2832, 92702, 9670, 12937, 0, 66374, 
-    917956, 0, 2822, 68122, 4436, 92519, 983714, 73752, 0, 64872, 92340, 
+    917956, 0, 2822, 68122, 4436, 92519, 983723, 73752, 0, 64872, 92340, 
     1331, 0, 0, 0, 12708, 0, 5090, 5089, 127977, 0, 119109, 0, 128681, 319, 
     118847, 43479, 9477, 0, 0, 5087, 92325, 7640, 96, 5086, 0, 92379, 0, 
     5085, 64286, 92665, 0, 41422, 0, 119901, 42356, 3772, 0, 0, 5011, 0, 0, 
     126587, 0, 127165, 127241, 6677, 7601, 0, 591, 64419, 118953, 92262, 0, 
     118923, 70084, 0, 10939, 6106, 6933, 41271, 6760, 71343, 4534, 41270, 
     128876, 0, 65574, 0, 9224, 69853, 3671, 8976, 126474, 0, 41275, 6372, 
-    128084, 55261, 7963, 6371, 0, 568, 0, 41273, 983721, 0, 6728, 0, 9715, 0, 
+    128084, 55261, 7963, 6371, 0, 568, 0, 41273, 983730, 0, 6728, 0, 9715, 0, 
     8258, 11753, 74820, 0, 9602, 118919, 42, 0, 43688, 0, 0, 7458, 0, 0, 
     65385, 119900, 0, 11958, 0, 917822, 0, 6254, 42721, 66336, 8045, 11550, 
     0, 0, 983597, 42858, 11789, 65868, 5557, 10133, 9737, 13109, 0, 9467, 
     5558, 8878, 128136, 195036, 7451, 6706, 10146, 0, 9086, 64566, 0, 64584, 
     7437, 7454, 12594, 128690, 68362, 4546, 7731, 0, 70048, 74243, 0, 3805, 
-    0, 194565, 44001, 41008, 0, 6307, 19949, 983781, 7544, 983045, 43469, 0, 
+    0, 194565, 44001, 41008, 0, 6307, 19949, 983790, 7544, 983045, 43469, 0, 
     0, 10152, 64422, 65091, 119113, 7602, 64729, 0, 43521, 0, 42302, 43711, 
     43523, 41447, 5559, 0, 8704, 2397, 5556, 0, 0, 0, 9011, 9630, 92633, 0, 
     93998, 5506, 0, 1911, 66652, 0, 9961, 8845, 66698, 0, 10792, 8889, 0, 
-    2098, 0, 64751, 0, 66622, 0, 0, 74364, 0, 0, 983796, 74365, 7552, 0, 0, 
+    2098, 0, 64751, 0, 66622, 0, 0, 74364, 0, 0, 983805, 74365, 7552, 0, 0, 
     65384, 7223, 4559, 0, 1956, 43138, 7024, 65728, 64501, 1210, 195077, 
-    65175, 10184, 43140, 43654, 0, 0, 0, 38, 8533, 66669, 119124, 983285, 
-    983783, 0, 4357, 0, 119837, 917863, 74233, 9967, 78884, 42860, 119838, 
+    65175, 10184, 43140, 43654, 0, 0, 0, 38, 8533, 66669, 119124, 983293, 
+    983792, 0, 4357, 0, 119837, 917863, 74233, 9967, 78884, 42860, 119838, 
     10941, 65721, 6962, 0, 0, 119324, 0, 11014, 127972, 8942, 12000, 69224, 
     92267, 128536, 11974, 92213, 42772, 127518, 11650, 5013, 92663, 126583, 
-    66210, 118914, 6613, 92476, 0, 43819, 983761, 0, 64714, 0, 0, 12162, 
-    12120, 43476, 983757, 11024, 74811, 66228, 10563, 0, 127196, 43522, 2462, 
+    66210, 118914, 6613, 92476, 0, 43819, 983770, 0, 64714, 0, 0, 12162, 
+    12120, 43476, 983766, 11024, 74811, 66228, 10563, 0, 127196, 43522, 2462, 
     0, 1837, 0, 63972, 6957, 0, 120559, 4952, 65718, 65827, 5504, 65720, 
     65714, 65715, 65716, 0, 127005, 127119, 3109, 63975, 74028, 0, 8107, 
     119234, 1127, 455, 0, 63968, 127924, 3483, 119593, 1989, 0, 69678, 9104, 
@@ -17882,7 +17901,7 @@
     41869, 12619, 0, 10154, 983043, 74439, 2039, 0, 7446, 1684, 63979, 10974, 
     458, 120620, 0, 69791, 127161, 11916, 65016, 0, 69671, 42115, 983133, 
     12288, 78057, 0, 1493, 42111, 7553, 4097, 128199, 13080, 0, 65808, 6610, 
-    6030, 8059, 7508, 13131, 0, 983423, 0, 8794, 41278, 41629, 12154, 128192, 
+    6030, 8059, 7508, 13131, 0, 983431, 0, 8794, 41278, 41629, 12154, 128192, 
     41277, 64658, 0, 64380, 6625, 74354, 19904, 0, 0, 0, 65371, 7078, 0, 833, 
     0, 6369, 0, 10979, 41953, 0, 41434, 6062, 0, 0, 19916, 6913, 933, 1341, 
     9842, 6720, 65744, 0, 983592, 128295, 0, 7405, 10105, 65810, 0, 41632, 
@@ -17897,23 +17916,23 @@
     6741, 43047, 0, 13180, 128517, 418, 917972, 64495, 10295, 10327, 10391, 
     41752, 74339, 8641, 41449, 0, 74100, 0, 10911, 6942, 0, 1024, 42849, 
     41751, 69776, 8941, 983556, 4554, 0, 9023, 11685, 0, 9928, 78617, 0, 
-    11437, 43741, 92163, 120700, 63967, 983475, 41206, 120724, 9049, 41185, 
+    11437, 43741, 92163, 120700, 63967, 983483, 41206, 120724, 9049, 41185, 
     43166, 0, 11680, 92619, 11686, 78544, 65224, 4565, 4655, 119553, 0, 
     92183, 64523, 10343, 10407, 0, 66671, 11466, 0, 128003, 42890, 74013, 
     12050, 68201, 2860, 0, 0, 0, 42792, 5743, 10424, 12065, 42872, 0, 92342, 
     0, 8875, 0, 0, 917991, 7531, 12847, 2413, 0, 78635, 962, 0, 12855, 41196, 
-    42564, 0, 1582, 983706, 5508, 0, 0, 0, 10801, 69876, 92354, 0, 7173, 496, 
+    42564, 0, 1582, 983715, 5508, 0, 0, 0, 10801, 69876, 92354, 0, 7173, 496, 
     10439, 4313, 64607, 69638, 7860, 0, 906, 42793, 2842, 6405, 64722, 13132, 
     798, 64694, 12801, 8406, 1153, 92173, 64788, 0, 8054, 9174, 128652, 
     917976, 9964, 74409, 41611, 4642, 66574, 11556, 917982, 0, 78857, 42089, 
     78855, 9008, 0, 126592, 195096, 42079, 917981, 77924, 42513, 77927, 
-    42842, 73985, 65285, 118974, 127003, 983693, 0, 0, 0, 11335, 64069, 
-    42093, 3920, 0, 0, 0, 0, 4580, 41967, 983723, 64384, 92167, 93984, 3021, 
+    42842, 73985, 65285, 118974, 127003, 983702, 0, 0, 0, 11335, 64069, 
+    42093, 3920, 0, 0, 0, 0, 4580, 41967, 983732, 64384, 92167, 93984, 3021, 
     42004, 0, 0, 42317, 41998, 0, 6946, 0, 0, 0, 128193, 65204, 0, 68113, 
     42690, 9880, 42010, 74824, 64589, 10111, 64875, 127880, 68399, 43998, 
     11360, 0, 0, 0, 118826, 42149, 0, 0, 0, 64941, 77919, 120421, 128077, 0, 
     55247, 4110, 66005, 6959, 10929, 119110, 0, 66703, 77921, 8617, 41982, 
-    6025, 69242, 983176, 0, 0, 0, 9597, 42099, 43172, 983368, 10117, 983169, 
+    6025, 69242, 983176, 0, 0, 0, 9597, 42099, 43172, 983376, 10117, 983169, 
     92297, 41636, 0, 0, 120681, 8301, 0, 0, 187, 0, 65669, 128339, 4963, 0, 
     127517, 0, 8964, 65676, 7775, 0, 41948, 0, 0, 0, 41942, 65449, 3160, 
     10081, 13226, 42121, 42475, 42663, 128210, 41766, 119114, 65882, 78849, 
@@ -17923,20 +17942,20 @@
     3103, 0, 41753, 128540, 0, 0, 78844, 78845, 41739, 78843, 42515, 10931, 
     41756, 43347, 42560, 5391, 41746, 119147, 92591, 41259, 5561, 69930, 
     2691, 0, 65553, 7933, 5562, 69800, 128265, 41262, 128146, 64421, 74846, 
-    41251, 0, 0, 3979, 0, 0, 74813, 983730, 0, 0, 0, 92524, 41266, 0, 66566, 
+    41251, 0, 0, 3979, 0, 0, 74813, 983739, 0, 0, 0, 92524, 41266, 0, 66566, 
     128836, 10585, 65741, 41737, 9574, 2666, 0, 41738, 831, 419, 13126, 
     10716, 0, 42822, 0, 6434, 0, 6939, 7766, 6432, 128106, 69932, 916, 769, 
     41742, 11968, 74805, 6433, 5563, 547, 1943, 6439, 5560, 4994, 487, 
     126537, 4497, 3754, 127056, 120424, 9039, 0, 41776, 0, 8716, 1595, 41615, 
-    0, 0, 74260, 0, 42854, 43219, 128709, 983452, 12185, 128879, 70072, 
-    68355, 68357, 0, 42856, 8634, 0, 983389, 4209, 120702, 0, 65879, 41538, 
-    65612, 127543, 669, 5679, 0, 69786, 92540, 0, 983456, 5678, 11821, 0, 
-    6711, 460, 0, 0, 983453, 0, 120747, 0, 0, 78050, 119022, 0, 983454, 0, 
+    0, 0, 74260, 0, 42854, 43219, 128709, 983460, 12185, 128879, 70072, 
+    68355, 68357, 0, 42856, 8634, 0, 983397, 4209, 120702, 0, 65879, 41538, 
+    65612, 127543, 669, 5679, 0, 69786, 92540, 0, 983464, 5678, 11821, 0, 
+    6711, 460, 0, 0, 983461, 0, 120747, 0, 0, 78050, 119022, 0, 983462, 0, 
     7782, 9044, 4974, 11760, 78494, 7577, 65711, 41912, 1216, 0, 128079, 
-    5792, 0, 0, 78501, 0, 2933, 12244, 0, 5683, 983384, 0, 78119, 1549, 0, 0, 
+    5792, 0, 0, 78501, 0, 2933, 12244, 0, 5683, 983392, 0, 78119, 1549, 0, 0, 
     120398, 5682, 6206, 8670, 10256, 5680, 69935, 10001, 128512, 69768, 1449, 
     10241, 78290, 128228, 0, 10552, 64342, 41922, 128548, 8584, 68030, 5567, 
-    2717, 0, 0, 5564, 42886, 41908, 42882, 5565, 983248, 128026, 0, 65708, 
+    2717, 0, 0, 5564, 42886, 41908, 42882, 5565, 983256, 128026, 0, 65708, 
     65709, 5566, 69803, 65704, 65705, 11904, 42875, 43373, 42539, 5942, 8468, 
     120561, 10361, 10425, 65697, 65698, 65699, 0, 66598, 0, 64664, 10647, 
     78702, 78703, 78690, 457, 78502, 65701, 1934, 43006, 119903, 8802, 78710, 
@@ -17950,14 +17969,14 @@
     119570, 42239, 8536, 78740, 78324, 78726, 74432, 724, 0, 1455, 78749, 
     7183, 64583, 78747, 68443, 4175, 78741, 43614, 69801, 939, 0, 43520, 
     68613, 74569, 917958, 0, 78763, 78764, 78760, 10788, 6088, 78759, 78755, 
-    190, 0, 12593, 0, 8188, 64408, 0, 4417, 983211, 92261, 6370, 0, 7827, 
+    190, 0, 12593, 0, 8188, 64408, 0, 4417, 983213, 92261, 6370, 0, 7827, 
     68441, 6965, 0, 0, 13201, 128205, 69896, 0, 74382, 73781, 7918, 73988, 0, 
-    0, 917884, 1728, 0, 43764, 178, 12972, 92679, 0, 917887, 92563, 983373, 
+    0, 917884, 1728, 0, 43764, 178, 12972, 92679, 0, 917887, 92563, 983381, 
     0, 78327, 120405, 65690, 0, 0, 119054, 0, 9252, 917889, 4652, 68371, 0, 
     0, 0, 13065, 9923, 10806, 0, 11763, 70016, 120688, 6723, 78187, 0, 6993, 
-    0, 0, 8333, 0, 0, 11390, 0, 74464, 0, 92320, 74080, 983307, 69911, 11910, 
+    0, 0, 8333, 0, 0, 11390, 0, 74464, 0, 92320, 74080, 983315, 69911, 11910, 
     92559, 8278, 8963, 4034, 128560, 0, 65344, 120517, 41747, 0, 0, 8677, 0, 
-    12707, 9350, 66037, 128180, 8836, 12315, 12747, 8300, 983741, 0, 7491, 
+    12707, 9350, 66037, 128180, 8836, 12315, 12747, 8300, 983750, 0, 7491, 
     8856, 71361, 0, 43150, 127768, 120404, 65389, 120402, 120403, 10813, 
     2592, 12853, 43269, 7263, 120244, 6536, 120238, 120239, 65516, 12321, 
     120391, 120388, 55287, 10007, 120246, 9588, 120248, 1596, 120383, 41994, 
@@ -17982,27 +18001,27 @@
     116, 12998, 122, 121, 120, 111, 110, 109, 108, 115, 114, 113, 112, 103, 
     102, 101, 100, 107, 106, 105, 104, 6436, 73974, 534, 41212, 77931, 1536, 
     64093, 73970, 77930, 127157, 0, 6020, 12716, 127112, 12744, 475, 120394, 
-    13266, 127813, 127111, 0, 73926, 0, 10645, 1212, 6543, 983299, 8134, 
-    128028, 2913, 73870, 127113, 1866, 0, 195095, 0, 8923, 1645, 12059, 
+    13266, 127813, 127111, 0, 73926, 0, 10645, 1212, 6543, 983307, 8134, 
+    128028, 2913, 73870, 127113, 1866, 983229, 195095, 0, 8923, 1645, 12059, 
     66585, 71297, 3196, 0, 0, 5935, 1250, 127066, 8174, 9787, 6733, 9859, 
     7916, 9861, 9860, 5258, 1882, 1892, 6731, 10882, 405, 11454, 73911, 0, 
     128781, 41169, 8939, 41245, 0, 41170, 1454, 11369, 6477, 12157, 0, 0, 0, 
-    41172, 7855, 0, 0, 10480, 0, 0, 77936, 8264, 12610, 983300, 645, 126616, 
+    41172, 7855, 0, 0, 10480, 0, 0, 77936, 8264, 12610, 983308, 645, 126616, 
     7609, 40973, 69943, 73833, 69948, 5824, 984, 77918, 10688, 5851, 0, 7729, 
     73982, 120518, 0, 195086, 43369, 0, 128140, 68415, 983093, 4538, 120406, 
-    43141, 0, 983208, 74214, 73886, 0, 0, 118902, 43005, 78448, 9552, 0, 0, 
+    43141, 0, 983210, 74214, 73886, 0, 0, 118902, 43005, 78448, 9552, 0, 0, 
     983159, 12997, 0, 0, 0, 0, 2381, 12883, 10994, 10529, 41906, 0, 0, 0, 
     12425, 10661, 10856, 9614, 2428, 41478, 8582, 10064, 73930, 0, 0, 0, 
-    64896, 119162, 1952, 92181, 8455, 10082, 11575, 983482, 119566, 0, 12808, 
+    64896, 119162, 1952, 92181, 8455, 10082, 11575, 983490, 119566, 0, 12808, 
     12183, 6145, 118955, 64929, 92433, 0, 983193, 43186, 42509, 0, 3922, 
     9187, 983614, 0, 10191, 119057, 11752, 3353, 9358, 0, 71366, 66680, 
-    120090, 8248, 7931, 8558, 9795, 68380, 983289, 0, 120082, 120081, 120084, 
+    120090, 8248, 7931, 8558, 9795, 68380, 983297, 0, 120082, 120081, 120084, 
     41027, 120086, 0, 120088, 7366, 7019, 120073, 0, 11751, 120078, 78294, 
     64657, 8657, 120048, 8594, 120068, 0, 0, 120069, 120072, 120071, 0, 0, 
     43154, 41029, 0, 11332, 65380, 7728, 94077, 11294, 0, 66665, 7851, 0, 
-    8375, 8699, 0, 42524, 0, 9085, 94041, 7504, 9327, 6160, 128095, 983855, 
+    8375, 8699, 0, 42524, 0, 9085, 94041, 7504, 9327, 6160, 128095, 983864, 
     0, 8088, 0, 74012, 92500, 0, 4439, 6926, 983047, 12924, 128227, 42369, 
-    4350, 65491, 65145, 9041, 43559, 64577, 10826, 0, 11296, 983275, 0, 0, 
+    4350, 65491, 65145, 9041, 43559, 64577, 10826, 0, 11296, 983283, 0, 0, 
     65825, 9577, 68199, 0, 64670, 983121, 78056, 6793, 11295, 0, 78053, 
     73872, 0, 0, 10902, 0, 0, 78070, 78068, 10472, 2995, 0, 0, 64682, 2371, 
     78069, 120808, 259, 1009, 92171, 2402, 2333, 6440, 194741, 0, 65125, 
@@ -18010,19 +18029,19 @@
     127070, 41261, 119362, 43640, 8613, 0, 94049, 6736, 195092, 41492, 12005, 
     69927, 0, 1890, 120056, 0, 0, 0, 7293, 7991, 0, 10578, 0, 78076, 194738, 
     78077, 69928, 0, 78800, 92653, 64445, 42668, 6635, 0, 6164, 65170, 0, 0, 
-    7676, 11664, 0, 983649, 69707, 0, 118812, 0, 0, 128045, 9175, 11925, 
+    7676, 11664, 0, 983658, 69707, 0, 118812, 0, 0, 128045, 9175, 11925, 
     78045, 9088, 0, 64545, 1396, 0, 7546, 3847, 127177, 127835, 4985, 13288, 
     672, 8098, 43196, 194746, 983096, 128126, 42655, 74043, 65072, 1577, 
     11772, 13041, 5928, 4525, 10658, 65911, 1266, 10180, 0, 128584, 12622, 0, 
     0, 0, 194714, 127139, 13310, 773, 19933, 1539, 0, 126983, 42731, 67972, 
     0, 0, 0, 3051, 5862, 7823, 92478, 0, 120411, 3250, 43991, 69687, 66649, 
-    9510, 66237, 983294, 0, 41066, 64673, 917963, 917964, 0, 3505, 8707, 
+    9510, 66237, 983302, 0, 41066, 64673, 917963, 917964, 0, 3505, 8707, 
     917968, 6725, 128013, 917971, 92314, 3471, 917970, 5479, 882, 6686, 
-    119584, 11613, 120772, 42754, 0, 983298, 92696, 0, 0, 0, 128523, 3225, 
+    119584, 11613, 120772, 42754, 0, 983306, 92696, 0, 0, 0, 128523, 3225, 
     917996, 4433, 41156, 43973, 43173, 1443, 4381, 0, 0, 10926, 11756, 11757, 
     64879, 917949, 917950, 127848, 13227, 0, 10021, 5160, 1387, 0, 917953, 
     41418, 0, 65914, 6721, 217, 917955, 917960, 917961, 10443, 10789, 41158, 
-    119257, 4274, 983292, 41483, 0, 41250, 0, 42179, 0, 5931, 11744, 69232, 
+    119257, 4274, 983300, 41483, 0, 41250, 0, 42179, 0, 5931, 11744, 69232, 
     0, 41252, 66682, 0, 119637, 41249, 1366, 64635, 65047, 12466, 0, 0, 4397, 
     128037, 128336, 41296, 9545, 41291, 128049, 0, 41485, 3511, 41282, 5923, 
     10400, 0, 128818, 760, 0, 12088, 5786, 0, 42256, 119869, 119860, 417, 
@@ -18032,15 +18051,15 @@
     119576, 0, 0, 1375, 66705, 43573, 65260, 42063, 0, 42811, 10312, 69845, 
     120794, 7840, 0, 43630, 10252, 0, 128104, 43185, 0, 4396, 0, 119880, 
     10769, 9676, 119041, 0, 9753, 0, 8944, 0, 0, 10473, 0, 0, 6072, 43025, 
-    10299, 0, 0, 120608, 66326, 983439, 127794, 0, 43811, 9330, 120596, 7222, 
-    10283, 10315, 10379, 4996, 983773, 13281, 66517, 7865, 10087, 78343, 0, 
+    10299, 0, 0, 120608, 66326, 983447, 127794, 0, 43811, 9330, 120596, 7222, 
+    10283, 10315, 10379, 4996, 983782, 13281, 66517, 7865, 10087, 78343, 0, 
     78347, 0, 0, 7565, 66363, 12952, 64806, 43180, 77928, 7414, 77929, 43982, 
     74288, 622, 74023, 885, 43405, 1602, 0, 0, 852, 0, 12160, 0, 10212, 
     65435, 0, 12071, 9609, 12156, 917983, 917984, 43586, 11035, 10411, 
     917988, 10255, 6710, 10279, 4194, 10375, 73900, 0, 4315, 12644, 127516, 
     77937, 43639, 43343, 78777, 917998, 11501, 41177, 128689, 0, 917792, 0, 
     92413, 8715, 0, 41179, 0, 43313, 0, 41176, 0, 994, 0, 8452, 127103, 
-    73966, 0, 0, 5921, 0, 2597, 0, 5922, 118903, 77943, 4186, 92531, 127106, 
+    73966, 0, 0, 5921, 0, 2597, 0, 5922, 118903, 77943, 4186, 92531, 119967, 
     127105, 6718, 0, 4406, 74601, 8480, 9192, 9747, 126530, 4413, 92196, 
     42268, 3198, 5924, 5920, 92469, 6921, 78081, 74007, 42869, 8418, 11681, 
     43169, 10176, 0, 742, 0, 2893, 10772, 65276, 5937, 1914, 2553, 11682, 
@@ -18063,7 +18082,7 @@
     7830, 11651, 13093, 64002, 0, 65742, 12874, 119597, 11590, 0, 74048, 
     128350, 8595, 0, 917947, 43703, 13097, 0, 64643, 13283, 12697, 0, 12381, 
     3488, 5933, 10033, 73738, 66241, 65570, 0, 12297, 119153, 1955, 0, 5349, 
-    42538, 0, 0, 7411, 9462, 917554, 0, 0, 0, 42736, 0, 5756, 983219, 7638, 
+    42538, 0, 0, 7411, 9462, 917554, 0, 0, 0, 42736, 0, 5756, 983221, 7638, 
     41642, 42764, 0, 43109, 7637, 5752, 74037, 0, 73832, 128827, 120635, 
     128231, 78334, 0, 7636, 65171, 9124, 0, 78892, 120798, 291, 0, 0, 2027, 
     66230, 10080, 78136, 10403, 0, 4640, 64713, 10224, 120429, 42512, 120431, 
@@ -18075,17 +18094,17 @@
     78270, 127982, 983172, 64728, 0, 78673, 78674, 1659, 919, 42784, 1671, 
     195089, 6069, 9219, 128558, 1661, 13120, 63784, 69819, 10140, 9713, 
     119143, 0, 0, 94050, 2306, 10485, 118943, 6068, 10612, 195099, 119567, 
-    195101, 92561, 41462, 120470, 195079, 5422, 128234, 0, 0, 0, 10229, 
+    195101, 92561, 41462, 120470, 195079, 5422, 128234, 983629, 0, 0, 10229, 
     10635, 826, 128081, 195082, 195085, 195084, 195087, 6483, 92211, 1808, 
     7848, 0, 8100, 78227, 78669, 78670, 13301, 78667, 9667, 78665, 78872, 0, 
     11003, 9904, 0, 0, 120690, 9144, 10921, 0, 78680, 9840, 65131, 78678, 
     77841, 10313, 0, 0, 64320, 10265, 78686, 10962, 78684, 43008, 8945, 
     78683, 0, 41, 195072, 1792, 120515, 195073, 8655, 195075, 92544, 77951, 
-    12066, 0, 385, 4152, 2585, 127804, 119068, 3126, 0, 74136, 10957, 983694, 
+    12066, 0, 385, 4152, 2585, 127804, 119068, 3126, 0, 74136, 10957, 983703, 
     43258, 119116, 127873, 13157, 0, 917544, 3570, 0, 7443, 0, 44006, 6997, 
     68004, 126631, 7879, 8739, 11075, 0, 65216, 0, 69795, 2593, 8463, 7810, 
     917862, 7839, 119913, 78806, 119912, 9691, 4411, 78802, 0, 0, 43442, 
-    69851, 65254, 10066, 983880, 0, 0, 0, 13061, 8016, 78687, 19932, 64831, 
+    69851, 65254, 10066, 983889, 0, 0, 0, 13061, 8016, 78687, 19932, 64831, 
     0, 119923, 12390, 119171, 1634, 68115, 0, 11056, 983574, 119925, 0, 
     41165, 11328, 12450, 0, 41166, 0, 12456, 119914, 171, 5941, 12452, 
     194709, 12458, 12531, 78779, 43013, 63800, 74162, 127569, 120483, 9969, 
@@ -18100,7 +18119,7 @@
     13244, 120466, 42167, 7435, 78193, 5380, 119086, 69225, 1155, 11365, 
     43126, 77972, 0, 65684, 0, 5601, 65192, 42765, 63752, 0, 7987, 128543, 
     1172, 69799, 6786, 43601, 120476, 74126, 5603, 0, 4473, 0, 194823, 0, 
-    65347, 65346, 65345, 0, 127384, 5347, 69802, 983623, 73868, 118944, 
+    65347, 65346, 65345, 0, 127384, 5347, 69802, 983632, 73868, 118944, 
     10588, 0, 0, 63755, 0, 5343, 78422, 120661, 4555, 5341, 0, 70071, 128670, 
     5351, 78675, 43104, 65244, 917892, 64541, 42519, 74472, 0, 0, 74765, 
     917888, 127510, 6638, 0, 65113, 271, 74180, 65370, 8835, 65368, 12653, 
@@ -18110,14 +18129,14 @@
     0, 4916, 0, 380, 10958, 66563, 77955, 69773, 9773, 13167, 12918, 41096, 
     73980, 69245, 78254, 917893, 10684, 0, 917896, 0, 7946, 12541, 8182, 
     67586, 69780, 0, 0, 0, 0, 9005, 1225, 6630, 0, 0, 0, 68011, 8847, 0, 
-    65876, 5535, 8329, 74590, 983206, 92609, 0, 0, 3127, 2595, 65713, 42013, 
-    983849, 5607, 41089, 0, 0, 74256, 2665, 11304, 43751, 74200, 4970, 8764, 
+    65876, 5535, 8329, 74590, 983208, 92609, 0, 0, 3127, 2595, 65713, 42013, 
+    983858, 5607, 41089, 0, 0, 74256, 2665, 11304, 43751, 74200, 4970, 8764, 
     120459, 8934, 92726, 41566, 4492, 0, 65011, 41090, 0, 0, 1188, 7254, 
     1100, 0, 128301, 41081, 2912, 11749, 69792, 0, 68019, 3572, 10023, 4959, 
-    13079, 0, 983268, 9729, 0, 0, 0, 43361, 0, 0, 11803, 7996, 9907, 41450, 
-    13304, 128290, 127260, 41451, 0, 11095, 8273, 127533, 3451, 983301, 972, 
-    41453, 983434, 0, 73883, 68022, 73945, 983726, 2288, 19955, 9538, 0, 
-    69807, 0, 0, 0, 0, 11396, 983432, 11019, 0, 0, 0, 68020, 41078, 71365, 
+    13079, 0, 983276, 9729, 0, 0, 0, 43361, 0, 0, 11803, 7996, 9907, 41450, 
+    13304, 128290, 127260, 41451, 0, 11095, 8273, 127533, 3451, 983309, 972, 
+    41453, 983442, 0, 73883, 68022, 73945, 983735, 2288, 19955, 9538, 0, 
+    69807, 0, 0, 0, 0, 11396, 983440, 11019, 0, 0, 0, 68020, 41078, 71365, 
     261, 5927, 7791, 0, 7362, 0, 10696, 0, 6073, 9838, 118920, 0, 6075, 
     93995, 282, 126510, 6437, 74078, 128000, 9801, 0, 74177, 0, 0, 3474, 
     118787, 0, 120655, 6081, 0, 78874, 74076, 78879, 0, 0, 0, 0, 0, 8751, 
@@ -18138,7 +18157,7 @@
     4564, 0, 0, 74271, 73753, 8374, 983156, 0, 6829, 5225, 128807, 127385, 0, 
     0, 119615, 0, 74793, 5626, 73807, 11771, 74075, 127236, 128019, 42614, 
     5353, 5625, 74179, 0, 0, 1010, 64572, 41780, 42623, 64277, 69942, 6952, 
-    983264, 120752, 78762, 2590, 5629, 65552, 7551, 10325, 5632, 10471, 
+    983272, 120752, 78762, 2590, 5629, 65552, 7551, 10325, 5632, 10471, 
     120038, 120027, 120028, 120025, 5628, 120031, 970, 120029, 4772, 2400, 
     5627, 120017, 120018, 120023, 64275, 120021, 8786, 0, 203, 0, 0, 0, 0, 
     78350, 0, 64378, 42054, 0, 0, 554, 119649, 11358, 0, 12182, 42048, 11065, 
@@ -18150,9 +18169,9 @@
     1168, 9251, 9082, 119964, 64055, 42781, 3866, 12323, 41512, 73805, 68121, 
     0, 41494, 92316, 4660, 0, 10405, 0, 78803, 0, 0, 42040, 73918, 119627, 
     7944, 41454, 12605, 0, 42205, 41455, 236, 64051, 78867, 8214, 0, 0, 0, 
-    41457, 983961, 119589, 1969, 2384, 8097, 917864, 7413, 68012, 78029, 
+    41457, 983970, 119589, 1969, 2384, 8097, 917864, 7413, 68012, 78029, 
     8766, 0, 78079, 5854, 127974, 10583, 0, 119989, 0, 10416, 917869, 3872, 
-    917868, 0, 8429, 0, 118806, 2838, 128802, 0, 917866, 0, 0, 0, 983958, 
+    917868, 0, 8429, 0, 118806, 2838, 128802, 0, 917866, 0, 0, 0, 983967, 
     94005, 11096, 120813, 10553, 1662, 8483, 120396, 43605, 5892, 43418, 0, 
     73742, 66, 65, 68, 67, 70, 69, 72, 71, 74, 73, 76, 75, 78, 77, 80, 79, 
     82, 81, 84, 83, 86, 85, 88, 87, 90, 89, 119862, 10357, 7385, 8170, 1704, 
@@ -18167,7 +18186,7 @@
     12472, 0, 69864, 7699, 12393, 0, 0, 0, 74518, 8223, 0, 4261, 0, 0, 0, 0, 
     0, 128302, 0, 128046, 43419, 0, 64554, 10574, 3878, 0, 42352, 1752, 
     73785, 0, 42506, 128541, 10199, 0, 0, 68021, 65919, 0, 6695, 720, 324, 0, 
-    0, 43406, 983727, 1464, 40985, 0, 7974, 0, 43474, 0, 64488, 0, 0, 64041, 
+    0, 43406, 983736, 1464, 40985, 0, 7974, 0, 43474, 0, 64488, 0, 0, 64041, 
     74787, 0, 78865, 92258, 65597, 0, 78863, 0, 1302, 0, 78861, 119134, 0, 0, 
     5204, 74774, 43404, 11835, 0, 3995, 68360, 65608, 3714, 92190, 0, 0, 
     10999, 11750, 0, 43251, 68660, 43301, 0, 120557, 8130, 8672, 10845, 
@@ -18175,22 +18194,22 @@
     612, 0, 64401, 66448, 68376, 0, 1674, 0, 5823, 983163, 12280, 0, 540, 
     74564, 119017, 0, 8432, 0, 11073, 0, 64316, 0, 0, 820, 41741, 0, 120667, 
     0, 64684, 126992, 3359, 7800, 69934, 65177, 6226, 353, 12396, 0, 119612, 
-    64742, 128682, 120282, 0, 983442, 12412, 19941, 0, 120277, 78847, 1884, 
+    64742, 128682, 120282, 0, 983450, 12412, 19941, 0, 120277, 78847, 1884, 
     9481, 42418, 70059, 41157, 0, 1195, 64898, 7924, 0, 41151, 2010, 0, 
     41328, 42344, 0, 12409, 0, 4360, 127009, 9739, 128550, 69933, 73921, 0, 
-    42521, 8539, 983716, 0, 118986, 0, 4788, 0, 68023, 65734, 983447, 43790, 
+    42521, 8539, 983725, 0, 118986, 0, 4788, 0, 68023, 65734, 983455, 43790, 
     0, 13075, 74429, 94063, 64569, 43532, 10837, 2492, 127197, 118901, 68637, 
     41136, 43785, 11813, 9649, 41154, 119617, 5128, 4038, 41143, 65604, 
     64859, 41592, 6771, 1648, 5435, 917837, 6734, 41343, 119848, 65439, 
     12709, 6986, 92364, 68015, 0, 41349, 70021, 12581, 10374, 5175, 0, 73806, 
     10254, 0, 10278, 10262, 69858, 41346, 0, 607, 0, 119852, 128846, 12923, 
     10314, 10282, 65477, 10378, 120297, 40976, 8265, 0, 119834, 40975, 5840, 
-    42838, 0, 40978, 983888, 119840, 0, 983071, 0, 66444, 10538, 0, 2550, 
+    42838, 0, 40978, 983897, 119840, 0, 983071, 0, 66444, 10538, 0, 2550, 
     119836, 6779, 0, 0, 3525, 6824, 118886, 0, 0, 5619, 65822, 126567, 
     194882, 7455, 0, 5616, 11486, 9656, 0, 0, 10727, 5615, 0, 120551, 42380, 
     64895, 43693, 66451, 808, 5455, 11347, 0, 1026, 5620, 194887, 0, 11350, 
     5617, 0, 9225, 64639, 127073, 9145, 128060, 1338, 120581, 983158, 12739, 
-    4603, 3084, 983155, 92484, 9858, 6037, 0, 3974, 78213, 10290, 983695, 
+    4603, 3084, 983155, 92484, 9858, 6037, 0, 3974, 78213, 10290, 983704, 
     3083, 10322, 0, 0, 0, 41036, 0, 0, 43321, 65606, 0, 41032, 42388, 0, 
     64700, 10011, 1445, 40961, 0, 119105, 0, 40960, 0, 194891, 0, 40963, 
     64952, 10402, 0, 0, 92304, 10603, 0, 0, 983113, 0, 6714, 10083, 127069, 
@@ -18202,9 +18221,9 @@
     41976, 9720, 917606, 11767, 41970, 194596, 5836, 12358, 0, 4355, 9048, 
     12180, 65027, 64680, 13038, 43699, 0, 41488, 128087, 8527, 194917, 12362, 
     12435, 12360, 41053, 3266, 0, 12356, 8616, 41466, 0, 92588, 11450, 0, 
-    3638, 12354, 0, 3216, 0, 2358, 92606, 8633, 0, 983736, 119182, 69244, 0, 
+    3638, 12354, 0, 3216, 0, 2358, 92606, 8633, 0, 983745, 119182, 69244, 0, 
     0, 11759, 194903, 6368, 74823, 0, 41423, 8078, 10504, 127558, 41698, 
-    42237, 0, 7002, 983669, 41430, 42267, 41051, 41484, 0, 0, 41050, 41473, 
+    42237, 0, 7002, 983678, 41430, 42267, 41051, 41484, 0, 0, 41050, 41473, 
     10466, 13099, 0, 0, 0, 6435, 0, 11362, 0, 0, 65382, 0, 41420, 0, 3625, 
     78157, 41409, 0, 69639, 2041, 9178, 9672, 41427, 43541, 43317, 0, 0, 0, 
     41424, 917598, 120546, 0, 128212, 0, 41417, 1261, 0, 0, 12102, 119662, 
@@ -18214,9 +18233,9 @@
     41461, 128823, 0, 127912, 0, 8819, 12663, 0, 41184, 74014, 232, 74835, 
     120646, 9168, 65786, 0, 0, 0, 9094, 0, 11758, 68425, 0, 1064, 42467, 
     128044, 10115, 19924, 92711, 0, 7862, 64551, 13224, 8516, 41862, 66650, 
-    7561, 78618, 69793, 1878, 0, 983261, 2911, 0, 41178, 5427, 64823, 0, 0, 
+    7561, 78618, 69793, 1878, 0, 983269, 2911, 0, 41178, 5427, 64823, 0, 0, 
     3787, 41174, 0, 41458, 0, 41463, 42413, 11292, 2406, 775, 0, 65584, 
-    69923, 6074, 9618, 128668, 983943, 43440, 0, 194901, 41436, 3656, 0, 
+    69923, 6074, 9618, 128668, 983952, 43440, 0, 194901, 41436, 3656, 0, 
     120600, 41456, 0, 1599, 11333, 0, 6703, 8513, 0, 1613, 0, 68456, 12598, 
     983191, 120734, 78745, 74500, 41460, 10145, 10542, 9937, 78746, 70029, 
     9905, 0, 65730, 0, 120374, 8427, 120375, 55246, 120376, 0, 11497, 64687, 
@@ -18236,21 +18255,21 @@
     41287, 92610, 0, 0, 42219, 128257, 0, 41987, 41676, 983059, 120823, 
     983144, 41670, 0, 92590, 2796, 55291, 11683, 9902, 74521, 67988, 11451, 
     983111, 128822, 42631, 2359, 0, 67844, 74164, 41238, 548, 11405, 13133, 
-    64368, 983233, 128795, 0, 397, 43622, 42139, 9547, 9590, 128238, 1614, 
+    64368, 983239, 128795, 0, 397, 43622, 42139, 9547, 9590, 128238, 1614, 
     43661, 64356, 66307, 6651, 1358, 0, 428, 9620, 1466, 78112, 10982, 
     118831, 1333, 7104, 407, 6425, 128834, 74253, 0, 0, 0, 5804, 11976, 8554, 
     92721, 0, 0, 9057, 42294, 41218, 0, 0, 78137, 1883, 10952, 8048, 78142, 
-    41225, 92621, 42915, 983667, 128684, 0, 4407, 0, 65809, 119074, 194821, 
+    41225, 92621, 42915, 983676, 128684, 0, 4407, 0, 65809, 119074, 194821, 
     8448, 7141, 74183, 0, 12675, 12659, 0, 42363, 120624, 194824, 55273, 
     10766, 12012, 2386, 64732, 9170, 917821, 9123, 64585, 120500, 119158, 
     7140, 10977, 127378, 4164, 9081, 0, 120569, 42049, 42042, 8709, 128283, 
     126477, 120637, 42419, 64799, 42047, 0, 0, 8470, 11807, 65897, 577, 0, 
-    983751, 74300, 0, 127308, 74840, 0, 0, 128791, 92224, 8736, 1414, 42643, 
+    983760, 74300, 0, 127308, 74840, 0, 0, 128791, 92224, 8736, 1414, 42643, 
     9683, 43486, 74344, 0, 2536, 0, 66330, 0, 0, 0, 0, 0, 0, 0, 66317, 69945, 
     66315, 2106, 120222, 11273, 0, 43004, 7541, 0, 0, 961, 64307, 66324, 
     64906, 128591, 3106, 65917, 41284, 1696, 0, 891, 12105, 0, 42624, 12802, 
     3264, 8824, 13268, 43003, 10936, 0, 0, 0, 194826, 92688, 0, 2322, 120371, 
-    983584, 11449, 128187, 42868, 41285, 3547, 0, 0, 128793, 983390, 43216, 
+    983584, 11449, 128187, 42868, 41285, 3547, 0, 0, 128793, 983398, 43216, 
     6089, 78682, 0, 120578, 4170, 1029, 127761, 127036, 119224, 42374, 0, 
     744, 0, 0, 0, 65823, 127826, 0, 3551, 0, 0, 4623, 55268, 0, 4598, 983162, 
     65136, 127136, 0, 0, 10851, 0, 6179, 92602, 6180, 0, 11952, 120778, 
@@ -18260,10 +18279,10 @@
     2308, 0, 74149, 0, 2318, 983183, 66361, 8198, 0, 64360, 12601, 42536, 
     65266, 120827, 74307, 92462, 6970, 5404, 43332, 3667, 7936, 12925, 
     126989, 6385, 0, 0, 118949, 10874, 65505, 128083, 0, 42053, 2075, 42057, 
-    11083, 42052, 0, 0, 67651, 0, 9665, 92300, 983657, 13181, 0, 0, 0, 70088, 
-    74148, 0, 0, 120225, 120229, 120224, 74172, 41145, 0, 94096, 983937, 
+    11083, 42052, 0, 0, 67651, 0, 9665, 92300, 983666, 13181, 0, 0, 0, 70088, 
+    74148, 0, 0, 120225, 120229, 120224, 74172, 41145, 0, 94096, 983946, 
     41148, 8683, 7594, 127519, 0, 119090, 10869, 43458, 41146, 92407, 11441, 
-    0, 3512, 119633, 983700, 8103, 0, 0, 65184, 11780, 41563, 42796, 0, 
+    0, 3512, 119633, 983709, 8103, 0, 0, 65184, 11780, 41563, 42796, 0, 
     69742, 41544, 65146, 0, 0, 0, 0, 19942, 0, 118908, 7988, 10436, 74273, 
     3271, 73804, 64711, 0, 94064, 0, 0, 3804, 13070, 11557, 42044, 0, 1095, 
     0, 3599, 127774, 0, 128861, 8514, 0, 0, 0, 74346, 66697, 0, 11684, 0, 
@@ -18272,23 +18291,23 @@
     0, 127772, 0, 917542, 0, 0, 6539, 0, 0, 0, 194856, 0, 120492, 41190, 
     3973, 119365, 4575, 41193, 7982, 429, 0, 127194, 0, 194854, 65792, 0, 
     118968, 6417, 118918, 78178, 0, 194850, 0, 0, 4919, 10590, 128556, 7755, 
-    0, 0, 64548, 120506, 1621, 10214, 65126, 0, 127004, 0, 12188, 983659, 
+    0, 0, 64548, 120506, 1621, 10214, 65126, 0, 127004, 0, 12188, 983668, 
     1617, 8050, 0, 5015, 0, 119174, 42590, 194871, 1756, 78181, 0, 65768, 
     6352, 41892, 0, 7555, 13103, 5408, 2817, 1214, 69919, 92335, 983125, 0, 
     0, 0, 127195, 7957, 8689, 64723, 1056, 42896, 74147, 194813, 0, 55286, 
-    7073, 65850, 12327, 983939, 119028, 0, 0, 0, 2341, 8450, 8484, 8474, 
-    983252, 0, 70079, 8461, 128102, 12153, 12799, 0, 43709, 43708, 9451, 
-    7571, 13073, 0, 0, 681, 983246, 703, 0, 3272, 8781, 12894, 70077, 11709, 
+    7073, 65850, 12327, 983948, 119028, 0, 0, 0, 2341, 8450, 8484, 8474, 
+    983260, 0, 70079, 8461, 128102, 12153, 12799, 0, 43709, 43708, 9451, 
+    7571, 13073, 0, 0, 681, 983252, 703, 0, 3272, 8781, 12894, 70077, 11709, 
     92288, 74446, 0, 92532, 0, 11338, 120768, 3276, 0, 0, 65928, 0, 0, 65021, 
     64795, 74574, 0, 10047, 78814, 3262, 78811, 42711, 0, 0, 68478, 163, 576, 
     9895, 1655, 78817, 74591, 78815, 78816, 983122, 0, 0, 0, 10039, 0, 
-    983936, 5623, 5717, 5776, 0, 0, 0, 41591, 11036, 65252, 92382, 0, 0, 0, 
+    983945, 5623, 5717, 5776, 0, 0, 0, 41591, 11036, 65252, 92382, 0, 0, 0, 
     67848, 0, 0, 0, 8887, 127521, 7295, 11031, 0, 43157, 0, 8946, 10348, 
-    10412, 8755, 0, 0, 5718, 13221, 0, 0, 78135, 0, 983702, 8810, 74499, 686, 
+    10412, 8755, 0, 0, 5718, 13221, 0, 0, 78135, 0, 983711, 8810, 74499, 686, 
     0, 71362, 4619, 118954, 6654, 73769, 74426, 0, 12040, 65689, 10128, 
-    65118, 0, 119151, 74205, 92651, 0, 2401, 68144, 8792, 983639, 0, 65455, 
+    65118, 0, 119151, 74205, 92651, 0, 2401, 68144, 8792, 983648, 0, 65455, 
     0, 92246, 0, 119129, 0, 12886, 127920, 66624, 0, 43557, 10300, 10161, 
-    10396, 74135, 983445, 118945, 78118, 73851, 3010, 6441, 78122, 1458, 
+    10396, 74135, 983453, 118945, 78118, 73851, 3010, 6441, 78122, 1458, 
     41475, 128672, 93975, 0, 11479, 0, 120356, 6350, 12864, 69674, 78114, 
     1061, 64780, 2001, 43111, 55230, 128686, 4052, 0, 7626, 0, 0, 1045, 0, 
     5631, 41113, 0, 0, 43707, 74127, 0, 0, 8486, 0, 73758, 2335, 4362, 
@@ -18304,8 +18323,8 @@
     92245, 440, 0, 13085, 9233, 74216, 0, 0, 9957, 128285, 66447, 8046, 
     64963, 65777, 10125, 74212, 42819, 10910, 0, 1521, 9896, 93965, 10487, 
     69878, 12527, 0, 7970, 0, 128660, 0, 65769, 5243, 9849, 5239, 65771, 
-    983229, 0, 5237, 69714, 0, 10103, 5247, 4769, 0, 118977, 12873, 2283, 
-    983231, 0, 3008, 4896, 0, 12087, 0, 55231, 41103, 0, 64565, 4773, 0, 
+    983235, 0, 5237, 69714, 0, 10103, 5247, 4769, 0, 118977, 12873, 2283, 
+    983237, 0, 3008, 4896, 0, 12087, 0, 55231, 41103, 0, 64565, 4773, 0, 
     92717, 70074, 4770, 0, 917567, 8731, 65378, 127362, 120619, 9122, 128033, 
     126600, 4774, 3019, 9997, 12834, 0, 9456, 10215, 120547, 0, 0, 0, 0, 
     74776, 4281, 4768, 0, 41535, 4099, 9017, 0, 0, 78095, 0, 78096, 0, 0, 0, 
@@ -18319,10 +18338,10 @@
     7634, 65167, 9845, 0, 0, 5701, 9722, 41490, 983153, 1426, 68217, 0, 
     68447, 42204, 55270, 8571, 194991, 78067, 0, 78818, 92719, 43182, 12184, 
     0, 42022, 0, 10281, 0, 5650, 43194, 64712, 10744, 0, 990, 5647, 0, 7387, 
-    78734, 41114, 11477, 5646, 12879, 11018, 983921, 3945, 92589, 0, 0, 0, 0, 
+    78734, 41114, 11477, 5646, 12879, 11018, 983930, 3945, 92589, 0, 0, 0, 0, 
     78212, 127746, 1020, 73763, 0, 78731, 5648, 64748, 194910, 78733, 10205, 
-    3545, 983585, 6984, 0, 74051, 983646, 43242, 120458, 2667, 0, 0, 0, 9911, 
-    0, 65020, 10097, 119166, 127145, 983653, 118836, 983739, 78427, 1140, 
+    3545, 983585, 6984, 0, 74051, 983655, 43242, 120458, 2667, 0, 0, 0, 9911, 
+    0, 65020, 10097, 119166, 127145, 983662, 118836, 983748, 78427, 1140, 
     78426, 0, 10159, 0, 0, 8128, 0, 0, 917965, 1815, 19910, 890, 0, 3267, 
     92291, 0, 10123, 0, 4410, 1041, 10576, 6354, 92581, 580, 74232, 0, 
     128347, 0, 0, 0, 19938, 65906, 127819, 0, 0, 3298, 5375, 10142, 0, 8215, 
@@ -18333,16 +18352,16 @@
     41521, 118934, 494, 13250, 0, 65098, 6364, 956, 0, 12830, 10462, 73740, 
     73734, 0, 0, 0, 66449, 13263, 74281, 69217, 13171, 127796, 0, 0, 92294, 
     0, 1044, 41276, 0, 0, 0, 42068, 11795, 0, 0, 0, 0, 42450, 3907, 0, 64526, 
-    11829, 68197, 12295, 0, 11475, 0, 3020, 11537, 0, 66441, 983446, 7098, 0, 
+    11829, 68197, 12295, 0, 11475, 0, 3020, 11537, 0, 66441, 983454, 7098, 0, 
     0, 1057, 566, 42696, 0, 3016, 42274, 43464, 66490, 12921, 66571, 78472, 
     92510, 3006, 4620, 127237, 983578, 0, 0, 64659, 0, 127749, 55253, 6357, 
     6362, 8626, 71337, 2216, 9090, 65377, 41596, 0, 42920, 1698, 0, 64477, 0, 
     43813, 1053, 0, 78269, 0, 126586, 1052, 1051, 459, 1060, 74349, 66479, 0, 
     0, 0, 0, 42490, 689, 6508, 4163, 42298, 8639, 66641, 4246, 0, 0, 12130, 
-    0, 42337, 64596, 64375, 66481, 127850, 0, 0, 6359, 0, 43471, 983759, 0, 
+    0, 42337, 64596, 64375, 66481, 127850, 0, 0, 6359, 0, 43471, 983768, 0, 
     0, 127274, 0, 6358, 6361, 1926, 6356, 92627, 7898, 8110, 10935, 0, 10069, 
-    5830, 0, 43685, 0, 0, 0, 0, 8693, 78611, 119565, 983799, 120413, 0, 
-    127257, 65894, 0, 0, 0, 983914, 0, 0, 119187, 2135, 78868, 0, 0, 78869, 
+    5830, 0, 43685, 0, 0, 0, 0, 8693, 78611, 119565, 983808, 120413, 0, 
+    127257, 65894, 0, 0, 0, 983923, 0, 0, 119187, 2135, 78868, 0, 0, 78869, 
     42313, 5579, 92412, 0, 983082, 94002, 0, 5578, 41774, 128115, 42023, 
     6234, 5669, 92275, 0, 0, 0, 127506, 68202, 5583, 0, 0, 42426, 5580, 
     42276, 2923, 892, 2220, 42465, 41330, 194987, 5795, 65512, 119006, 65702, 
@@ -18352,7 +18371,7 @@
     64900, 7153, 6095, 41865, 0, 3015, 128023, 126465, 5211, 983083, 6400, 0, 
     194983, 70054, 8189, 11276, 0, 0, 372, 128829, 0, 118874, 42102, 41585, 
     128202, 0, 42101, 276, 78402, 0, 33, 74226, 127303, 9007, 118796, 41588, 
-    66033, 427, 10763, 118819, 0, 127884, 0, 1031, 6257, 0, 42104, 0, 983971, 
+    66033, 427, 10763, 118819, 0, 127884, 0, 1031, 6257, 0, 42104, 0, 983980, 
     2328, 92409, 1071, 42899, 0, 74848, 0, 983580, 0, 1047, 0, 0, 64790, 0, 
     69723, 10651, 0, 0, 0, 0, 92206, 119181, 5711, 41633, 12098, 65571, 9166, 
     0, 5710, 0, 6790, 65168, 13216, 0, 69716, 69726, 0, 64611, 41623, 195001, 
@@ -18361,120 +18380,120 @@
     9196, 69670, 0, 0, 0, 0, 118911, 0, 0, 0, 0, 0, 120010, 0, 8701, 68130, 
     119616, 120522, 0, 42477, 194994, 12123, 4495, 43569, 0, 0, 0, 64946, 
     10992, 0, 120009, 0, 0, 9318, 93986, 13249, 65679, 73808, 0, 65457, 
-    42249, 7639, 43995, 67845, 42641, 5454, 0, 0, 194997, 120005, 0, 983957, 
+    42249, 7639, 43995, 67845, 42641, 5454, 0, 0, 194997, 120005, 0, 983966, 
     5084, 0, 0, 118861, 0, 733, 917876, 78014, 78436, 78435, 41677, 0, 9218, 
-    1731, 0, 983737, 0, 67990, 0, 0, 0, 120001, 127018, 92492, 5155, 120000, 
-    5358, 983735, 0, 917767, 64424, 983225, 3840, 64314, 41432, 0, 78315, 
+    1731, 0, 983746, 0, 67990, 0, 0, 0, 120001, 127018, 92492, 5155, 120000, 
+    5358, 983744, 0, 917767, 64424, 983231, 3840, 64314, 41432, 0, 78315, 
     68430, 67980, 43253, 65943, 0, 3371, 10988, 0, 8771, 1479, 0, 0, 1109, 
-    11580, 0, 64601, 12205, 0, 0, 64507, 8868, 399, 67978, 74842, 983276, 
-    983712, 12149, 13088, 551, 0, 10156, 12119, 92572, 0, 2544, 65074, 
+    11580, 0, 64601, 12205, 0, 0, 64507, 8868, 399, 67978, 74842, 983284, 
+    983721, 12149, 13088, 551, 0, 10156, 12119, 92572, 0, 2544, 65074, 
     119211, 0, 0, 78011, 351, 119149, 0, 0, 55229, 0, 74268, 0, 0, 0, 42377, 
-    0, 0, 0, 983915, 0, 9013, 4054, 0, 983570, 0, 0, 73960, 5585, 65881, 
+    0, 0, 0, 983924, 0, 9013, 4054, 0, 983570, 983628, 0, 73960, 5585, 65881, 
     2549, 74469, 0, 0, 5584, 8358, 0, 64215, 92219, 10919, 0, 7980, 126601, 
-    983775, 2218, 41800, 5589, 0, 2664, 41613, 5586, 118890, 0, 11356, 0, 0, 
+    983784, 2218, 41800, 5589, 0, 2664, 41613, 5586, 118890, 0, 11356, 0, 0, 
     43452, 78609, 0, 42573, 67856, 0, 78129, 0, 0, 74392, 8135, 6450, 10055, 
     77996, 0, 0, 119225, 5657, 0, 9626, 0, 77994, 10179, 5654, 12939, 92573, 
     120799, 0, 0, 5652, 10945, 0, 66486, 0, 3661, 7863, 0, 0, 0, 74509, 
-    983843, 5659, 0, 78692, 66729, 5655, 0, 42168, 0, 1055, 917628, 127792, 
-    66310, 74030, 0, 12146, 73955, 73956, 11618, 0, 126990, 0, 10272, 10304, 
-    10368, 42518, 594, 10244, 10248, 7407, 983878, 64870, 0, 3467, 983882, 0, 
-    3331, 946, 10231, 1495, 8131, 74330, 0, 9562, 69222, 65927, 0, 70036, 
-    69696, 69769, 64656, 983717, 0, 94020, 70056, 5666, 65227, 5318, 63994, 
-    0, 9091, 10798, 0, 128166, 10186, 0, 7732, 983715, 64556, 0, 0, 5668, 
-    74445, 0, 128663, 5670, 126610, 127297, 11820, 2992, 7826, 5667, 19952, 
-    120807, 0, 12749, 74551, 0, 0, 66496, 4361, 119260, 1306, 9286, 1497, 
-    128286, 94004, 0, 0, 3571, 13247, 0, 7973, 66353, 68435, 78278, 67896, 
-    43192, 0, 78265, 553, 120653, 0, 128554, 5829, 0, 4587, 78285, 65912, 0, 
-    12746, 0, 0, 119924, 5633, 119927, 94101, 94102, 94099, 64905, 94105, 
-    9512, 94103, 12742, 6443, 983797, 0, 9135, 0, 41564, 0, 55219, 128832, 
-    983842, 0, 12148, 0, 78297, 0, 64256, 0, 11669, 0, 5634, 4524, 0, 127270, 
-    0, 118880, 2425, 65182, 128769, 43636, 5221, 78410, 328, 0, 983800, 
-    69815, 5636, 0, 5329, 0, 5638, 119918, 7940, 64938, 43223, 43760, 5635, 
-    3373, 2986, 78292, 74223, 3437, 78291, 6203, 4247, 0, 11920, 8274, 0, 0, 
-    1657, 41561, 78299, 78295, 5639, 2954, 5660, 5640, 78303, 983676, 78300, 
-    42227, 0, 0, 41637, 67872, 0, 78310, 41625, 43362, 78309, 120713, 11705, 
-    5642, 0, 5486, 0, 4356, 11710, 0, 12051, 69938, 0, 5641, 8259, 0, 1058, 
-    0, 67630, 0, 0, 1144, 78750, 0, 42228, 0, 73890, 118972, 0, 2800, 0, 
-    5645, 64964, 8652, 2547, 66484, 43634, 0, 5608, 65890, 43808, 0, 67621, 
-    119934, 9000, 0, 0, 92673, 1865, 0, 5613, 69950, 0, 0, 5610, 0, 0, 65826, 
-    2069, 0, 10787, 43999, 2997, 0, 5609, 78316, 65319, 78313, 12316, 65376, 
-    2412, 0, 8186, 9807, 74269, 92547, 13130, 65874, 0, 5807, 0, 10030, 5306, 
-    12364, 128064, 0, 11704, 0, 92583, 10211, 0, 0, 0, 0, 11706, 9710, 0, 0, 
-    0, 413, 65623, 7118, 0, 9133, 74262, 0, 1042, 0, 64779, 12171, 119240, 
-    6185, 64776, 4984, 0, 708, 11391, 0, 12241, 92720, 983890, 1308, 0, 2534, 
-    810, 0, 0, 0, 0, 0, 1917, 3000, 0, 0, 120739, 2364, 92443, 74470, 66618, 
-    65680, 120779, 10027, 0, 128154, 12337, 120722, 127368, 983167, 2980, 
-    755, 69774, 931, 13124, 68182, 6363, 2748, 0, 0, 65041, 92276, 44011, 
-    8730, 983067, 127854, 78312, 7274, 119250, 0, 7275, 78304, 935, 0, 65840, 
-    377, 42325, 11649, 127363, 65253, 64301, 128835, 78308, 42341, 65284, 
-    2417, 0, 12884, 19912, 7907, 10768, 0, 194998, 0, 10673, 119217, 7248, 0, 
-    128346, 1781, 5496, 3627, 62, 1649, 0, 964, 0, 127876, 78226, 128775, 
-    127512, 0, 0, 0, 0, 43689, 127911, 13142, 78812, 42415, 66575, 4542, 
-    69909, 43547, 0, 0, 7677, 2991, 4946, 42454, 11565, 7949, 0, 983909, 
-    11341, 42494, 3073, 65625, 9714, 11692, 4657, 0, 92724, 6478, 9898, 
-    43673, 65237, 6241, 7106, 4877, 983786, 6238, 0, 10548, 127049, 4409, 0, 
-    0, 64798, 0, 5346, 0, 94047, 6237, 4874, 0, 9176, 0, 126553, 65231, 
-    65884, 12678, 78748, 118912, 11378, 44018, 42785, 2408, 3251, 0, 0, 5685, 
-    0, 2461, 11052, 7091, 5342, 8317, 0, 68163, 5340, 0, 127820, 43635, 
-    73928, 127529, 0, 0, 0, 128510, 65482, 0, 9142, 0, 126470, 0, 10938, 0, 
-    118790, 1182, 2542, 4826, 0, 0, 128176, 529, 8580, 0, 0, 10586, 10790, 
-    10839, 66023, 41593, 41207, 0, 0, 41594, 225, 42828, 0, 0, 983929, 11376, 
-    74379, 10721, 67664, 3438, 42097, 127267, 11084, 3194, 41870, 266, 78305, 
-    120183, 41873, 120575, 11324, 120531, 0, 8420, 64918, 128844, 41871, 
-    41338, 3734, 7734, 43683, 8750, 66605, 66011, 92514, 40965, 127937, 0, 
-    5161, 10572, 0, 0, 0, 64349, 7287, 42162, 127552, 0, 126605, 11948, 
-    69220, 12359, 43429, 41369, 1697, 12191, 0, 68633, 7286, 0, 68635, 10031, 
-    0, 9870, 68645, 8620, 65824, 0, 11938, 0, 7285, 0, 119577, 42678, 0, 
-    43677, 41583, 0, 65799, 92623, 0, 0, 983927, 78169, 66199, 0, 3609, 
+    983852, 5659, 0, 78692, 66729, 5655, 983626, 42168, 0, 1055, 917628, 
+    127792, 66310, 74030, 0, 12146, 73955, 73956, 11618, 0, 126990, 0, 10272, 
+    10304, 10368, 42518, 594, 10244, 10248, 7407, 983887, 64870, 0, 3467, 
+    983891, 0, 3331, 946, 10231, 1495, 8131, 74330, 0, 9562, 69222, 65927, 0, 
+    70036, 69696, 69769, 64656, 983726, 0, 94020, 70056, 5666, 65227, 5318, 
+    63994, 0, 9091, 10798, 0, 128166, 10186, 0, 7732, 983724, 64556, 0, 0, 
+    5668, 74445, 0, 128663, 5670, 126610, 127297, 11820, 2992, 7826, 5667, 
+    19952, 120807, 0, 12749, 74551, 0, 0, 66496, 4361, 119260, 1306, 9286, 
+    1497, 128286, 94004, 0, 0, 3571, 13247, 0, 7973, 66353, 68435, 78278, 
+    67896, 43192, 0, 78265, 553, 120653, 0, 128554, 5829, 0, 4587, 78285, 
+    65912, 0, 12746, 0, 0, 119924, 5633, 119927, 94101, 94102, 94099, 64905, 
+    94105, 9512, 94103, 12742, 6443, 983806, 0, 9135, 0, 41564, 0, 55219, 
+    128832, 983851, 0, 12148, 0, 78297, 0, 64256, 0, 11669, 0, 5634, 4524, 0, 
+    127270, 0, 118880, 2425, 65182, 128769, 43636, 5221, 78410, 328, 0, 
+    983809, 69815, 5636, 0, 5329, 0, 5638, 119918, 7940, 64938, 43223, 43760, 
+    5635, 3373, 2986, 78292, 74223, 3437, 78291, 6203, 4247, 0, 11920, 8274, 
+    0, 0, 1657, 41561, 78299, 78295, 5639, 2954, 5660, 5640, 78303, 983685, 
+    78300, 42227, 0, 0, 41637, 67872, 0, 78310, 41625, 43362, 78309, 120713, 
+    11705, 5642, 0, 5486, 0, 4356, 11710, 0, 12051, 69938, 0, 5641, 8259, 0, 
+    1058, 0, 67630, 0, 0, 1144, 78750, 0, 42228, 0, 73890, 118972, 0, 2800, 
+    0, 5645, 64964, 8652, 2547, 66484, 43634, 0, 5608, 65890, 43808, 0, 
+    67621, 119934, 9000, 0, 0, 92673, 1865, 0, 5613, 69950, 0, 0, 5610, 0, 0, 
+    65826, 2069, 0, 10787, 43999, 2997, 0, 5609, 78316, 65319, 78313, 12316, 
+    65376, 2412, 0, 8186, 9807, 74269, 92547, 13130, 65874, 0, 5807, 0, 
+    10030, 5306, 12364, 128064, 0, 11704, 0, 92583, 10211, 0, 0, 0, 0, 11706, 
+    9710, 0, 0, 0, 413, 65623, 7118, 0, 9133, 74262, 0, 1042, 0, 64779, 
+    12171, 119240, 6185, 64776, 4984, 0, 708, 11391, 0, 12241, 92720, 983899, 
+    1308, 0, 2534, 810, 0, 0, 0, 0, 0, 1917, 3000, 0, 0, 120739, 2364, 92443, 
+    74470, 66618, 65680, 120779, 10027, 0, 128154, 12337, 120722, 127368, 
+    983167, 2980, 755, 69774, 931, 13124, 68182, 6363, 2748, 0, 0, 65041, 
+    92276, 44011, 8730, 983067, 127854, 78312, 7274, 119250, 0, 7275, 78304, 
+    935, 0, 65840, 377, 42325, 11649, 127363, 65253, 64301, 128835, 78308, 
+    42341, 65284, 2417, 0, 12884, 19912, 7907, 10768, 0, 194998, 0, 10673, 
+    119217, 7248, 0, 128346, 1781, 5496, 3627, 62, 1649, 0, 964, 0, 127876, 
+    78226, 128775, 127512, 0, 0, 0, 0, 43689, 127911, 13142, 78812, 42415, 
+    66575, 4542, 69909, 43547, 0, 0, 7677, 2991, 4946, 42454, 11565, 7949, 0, 
+    983918, 11341, 42494, 3073, 65625, 9714, 11692, 4657, 0, 92724, 6478, 
+    9898, 43673, 65237, 6241, 7106, 4877, 983795, 6238, 0, 10548, 127049, 
+    4409, 0, 0, 64798, 0, 5346, 0, 94047, 6237, 4874, 0, 9176, 0, 126553, 
+    65231, 65884, 12678, 78748, 118912, 11378, 44018, 42785, 2408, 3251, 0, 
+    0, 5685, 0, 2461, 11052, 7091, 5342, 8317, 0, 68163, 5340, 0, 127820, 
+    43635, 73928, 127529, 0, 0, 0, 128510, 65482, 0, 9142, 0, 126470, 0, 
+    10938, 0, 118790, 1182, 2542, 4826, 0, 0, 128176, 529, 8580, 0, 0, 10586, 
+    10790, 10839, 66023, 41593, 41207, 0, 0, 41594, 225, 42828, 0, 0, 983938, 
+    11376, 74379, 10721, 67664, 3438, 42097, 127267, 11084, 3194, 41870, 266, 
+    78305, 120183, 41873, 120575, 11324, 120531, 0, 8420, 64918, 128844, 
+    41871, 41338, 3734, 7734, 43683, 8750, 66605, 66011, 92514, 40965, 
+    127937, 0, 5161, 10572, 0, 0, 0, 64349, 7287, 42162, 127552, 0, 126605, 
+    11948, 69220, 12359, 43429, 41369, 1697, 12191, 0, 68633, 7286, 0, 68635, 
+    10031, 0, 9870, 68645, 8620, 65824, 0, 11938, 0, 7285, 0, 119577, 42678, 
+    0, 43677, 41583, 0, 65799, 92623, 0, 0, 983936, 78169, 66199, 0, 3609, 
     68624, 0, 832, 120693, 120770, 78473, 66007, 78471, 65703, 0, 0, 42732, 
     5180, 92699, 41395, 41530, 11691, 64773, 92214, 74002, 0, 0, 128645, 
-    6348, 243, 13200, 983804, 6024, 92309, 9979, 10037, 41529, 10648, 8538, 
+    6348, 243, 13200, 983813, 6024, 92309, 9979, 10037, 41529, 10648, 8538, 
     43687, 0, 0, 4285, 66195, 0, 4230, 0, 7367, 43256, 92353, 7563, 42376, 0, 
     68442, 120512, 0, 0, 214, 0, 0, 78466, 65893, 12208, 9973, 0, 66311, 
     65589, 128277, 2603, 0, 0, 0, 70047, 0, 6022, 0, 2884, 0, 11620, 0, 43, 
     0, 66453, 1016, 41107, 0, 41121, 3885, 92, 65456, 64608, 0, 74801, 0, 
-    2074, 0, 78283, 0, 12453, 128128, 983817, 74241, 126568, 6791, 12457, 
+    2074, 0, 78283, 0, 12453, 128128, 983826, 74241, 126568, 6791, 12457, 
     78268, 0, 0, 0, 78279, 0, 0, 92358, 66637, 7995, 8759, 43421, 78277, 
     12449, 128552, 0, 0, 8752, 3197, 4720, 10165, 0, 119249, 0, 11595, 64893, 
     0, 43435, 0, 0, 4993, 0, 6168, 10934, 1946, 741, 0, 5494, 4639, 983147, 
     1990, 66589, 4498, 78664, 119183, 0, 0, 69734, 2960, 73779, 0, 8969, 
     128117, 43424, 127059, 0, 2950, 119579, 6210, 65753, 370, 0, 0, 0, 4953, 
-    983673, 0, 0, 0, 69230, 0, 0, 65688, 983240, 5063, 3517, 2964, 43663, 
+    983682, 0, 0, 0, 69230, 0, 0, 65688, 983246, 5063, 3517, 2964, 43663, 
     917762, 6344, 74791, 10566, 10144, 66333, 8252, 729, 66016, 78253, 0, 
     71317, 64923, 128040, 43669, 9032, 78263, 78264, 0, 41215, 0, 65883, 0, 
     917774, 120602, 3761, 0, 0, 70068, 0, 12912, 119012, 3850, 128191, 0, 0, 
     0, 0, 908, 0, 8611, 0, 0, 127555, 43691, 41197, 0, 8978, 120540, 119135, 
     41586, 10527, 0, 917848, 3848, 78739, 194937, 127536, 65241, 5336, 
-    983251, 128786, 663, 0, 10780, 0, 0, 78767, 983249, 127163, 68193, 347, 
+    983259, 128786, 663, 0, 10780, 0, 0, 78767, 983257, 127163, 68193, 347, 
     0, 0, 78775, 64675, 41582, 78774, 78744, 65579, 12980, 78769, 12143, 
     69657, 78512, 0, 43441, 41804, 78523, 0, 78525, 0, 128859, 41584, 10681, 
-    0, 983686, 73938, 0, 128022, 4800, 66661, 0, 66306, 64715, 78534, 9518, 
-    6609, 10434, 0, 11319, 1097, 0, 917850, 41730, 983212, 0, 73847, 78761, 
-    65172, 41728, 41721, 0, 0, 0, 41203, 917612, 13110, 41726, 983846, 0, 
+    0, 983695, 73938, 0, 128022, 4800, 66661, 0, 66306, 64715, 78534, 9518, 
+    6609, 10434, 0, 11319, 1097, 0, 917850, 41730, 983214, 0, 73847, 78761, 
+    65172, 41728, 41721, 0, 0, 0, 41203, 917612, 13110, 41726, 983855, 0, 
     1000, 69651, 0, 41140, 1209, 73978, 0, 73750, 1073, 6321, 77878, 41138, 
     0, 68213, 0, 12167, 1115, 41605, 9794, 127062, 67671, 55248, 12237, 
     78787, 66314, 6587, 9290, 78782, 78783, 9231, 78781, 2959, 7926, 0, 0, 0, 
-    64398, 0, 119970, 12311, 983718, 78796, 78798, 78794, 78795, 68434, 
+    64398, 0, 119970, 12311, 983727, 78796, 78798, 78794, 78795, 68434, 
     78793, 66670, 0, 0, 12290, 120169, 0, 119873, 42142, 9968, 8205, 0, 5131, 
-    0, 9627, 78536, 78542, 78535, 983210, 1944, 1248, 10148, 127755, 119990, 
+    0, 9627, 78536, 78542, 78535, 983212, 1944, 1248, 10148, 127755, 119990, 
     119991, 12701, 78376, 11308, 119995, 0, 119997, 119998, 65305, 65100, 
     4031, 42794, 120003, 7075, 8154, 119985, 120007, 41817, 73934, 42275, 
     120011, 120012, 78526, 120014, 120015, 6041, 0, 41899, 0, 8002, 0, 4364, 
     0, 0, 64332, 0, 7813, 9064, 119986, 10124, 7526, 8601, 7281, 78455, 7279, 
-    12041, 1418, 10885, 12673, 0, 0, 9660, 983272, 13012, 4571, 0, 0, 120164, 
+    12041, 1418, 10885, 12673, 0, 0, 9660, 983280, 13012, 4571, 0, 0, 120164, 
     12078, 2970, 0, 10933, 0, 77870, 0, 127015, 0, 41599, 0, 128831, 0, 
     12950, 92160, 3486, 0, 78311, 4239, 0, 127799, 66511, 0, 2637, 64629, 
-    8460, 127053, 8476, 983966, 0, 0, 0, 65673, 1019, 78495, 4148, 0, 12289, 
-    0, 4316, 0, 13119, 8488, 5412, 66243, 9935, 0, 73864, 983201, 41734, 
+    8460, 127053, 8476, 983975, 0, 0, 0, 65673, 1019, 78495, 4148, 0, 12289, 
+    0, 4316, 0, 13119, 8488, 5412, 66243, 9935, 0, 73864, 983203, 41734, 
     8206, 74081, 9163, 3286, 9072, 5867, 13302, 7622, 7120, 41736, 92546, 
     41731, 0, 7400, 5416, 68663, 118924, 10817, 0, 41539, 127284, 0, 73963, 
     41855, 41867, 65564, 11277, 65892, 11536, 10620, 92272, 7115, 66030, 
     73932, 5498, 73942, 41536, 0, 68204, 92587, 3459, 8997, 0, 0, 0, 0, 
-    92512, 0, 66377, 69781, 0, 983690, 78511, 3161, 295, 120207, 0, 92223, 
+    92512, 0, 66377, 69781, 0, 983699, 78511, 3161, 295, 120207, 0, 92223, 
     127856, 78742, 9016, 43454, 63903, 63902, 43641, 0, 3971, 0, 70063, 2952, 
     78765, 11038, 10901, 63900, 63899, 63898, 94043, 667, 12332, 63887, 6086, 
-    41722, 0, 5172, 0, 0, 4159, 0, 0, 9815, 63884, 19934, 63882, 41198, 8555, 
-    63878, 63877, 42460, 6050, 42708, 63881, 63872, 0, 42421, 0, 41723, 
+    41722, 0, 5172, 0, 983278, 4159, 0, 0, 9815, 63884, 19934, 63882, 41198, 
+    8555, 63878, 63877, 42460, 6050, 42708, 63881, 63872, 0, 42421, 0, 41723, 
     63875, 63874, 11460, 7432, 1913, 41913, 63852, 126636, 0, 42348, 73892, 
     6752, 446, 41911, 127906, 63851, 63850, 41910, 0, 63846, 2972, 12932, 
     7262, 0, 63849, 63848, 63847, 128070, 6570, 8302, 7259, 63842, 4178, 
@@ -18488,8 +18507,8 @@
     7583, 7679, 2903, 0, 3001, 1158, 8745, 43746, 73748, 63866, 78626, 1915, 
     4846, 0, 66371, 118984, 42105, 2990, 120128, 805, 69238, 64438, 12070, 
     8760, 1117, 118987, 12212, 120123, 65174, 42357, 63835, 63834, 0, 78240, 
-    12225, 63838, 63837, 983844, 983795, 63833, 6042, 66360, 8083, 0, 0, 
-    63821, 63820, 63819, 63818, 983895, 5227, 9047, 63822, 127162, 6091, 0, 
+    12225, 63838, 63837, 983853, 983804, 63833, 6042, 66360, 8083, 0, 0, 
+    63821, 63820, 63819, 63818, 983904, 5227, 9047, 63822, 127162, 6091, 0, 
     10691, 560, 5643, 8226, 119578, 63812, 63811, 63810, 63809, 2289, 63815, 
     63814, 63813, 6047, 1597, 120143, 780, 206, 77925, 4936, 65147, 8168, 
     63930, 2076, 1093, 9882, 63934, 2082, 63932, 128150, 63929, 3546, 1605, 
@@ -18507,262 +18526,262 @@
     43659, 12951, 120638, 9906, 2054, 2334, 78515, 63916, 5483, 63914, 69737, 
     63911, 5484, 63909, 63908, 2539, 0, 43980, 5485, 0, 42697, 9061, 5534, 
     10672, 4502, 0, 253, 0, 68208, 0, 9203, 74231, 0, 11530, 92542, 68668, 0, 
-    118907, 0, 10474, 43426, 13257, 42354, 128099, 983689, 70044, 195065, 0, 
-    8413, 983807, 0, 5693, 7272, 0, 13209, 64470, 65831, 74350, 195063, 0, 0, 
-    0, 126639, 0, 0, 94078, 128133, 127767, 66608, 3111, 41863, 8804, 42913, 
-    92187, 7270, 0, 66606, 6628, 1076, 7433, 1436, 73844, 55226, 128353, 
-    63982, 7393, 12807, 43413, 63906, 1598, 63904, 0, 0, 41729, 4423, 1307, 
-    0, 10515, 41589, 128698, 0, 6218, 0, 1430, 0, 0, 120606, 78754, 5413, 
-    7619, 3255, 3493, 74032, 11549, 10735, 41743, 73937, 6801, 983624, 4518, 
-    10990, 65073, 5167, 4481, 3771, 120158, 2710, 0, 69243, 41724, 0, 43073, 
-    41690, 12479, 983626, 0, 0, 983809, 70046, 1628, 127149, 983479, 983722, 
-    65262, 6333, 10783, 42315, 0, 63855, 94056, 0, 0, 5339, 74323, 0, 13004, 
-    0, 4457, 0, 0, 0, 0, 5684, 8678, 10914, 0, 5689, 65807, 0, 68464, 12633, 
-    12870, 69705, 65183, 5688, 11926, 6033, 6310, 5686, 0, 74251, 0, 120647, 
-    0, 50, 10558, 9871, 42612, 43655, 0, 0, 0, 66468, 0, 13259, 4448, 0, 
-    983836, 0, 70043, 67853, 0, 10640, 11539, 1151, 0, 917607, 127544, 
-    127079, 195050, 127852, 0, 0, 0, 12501, 64604, 0, 11527, 118870, 8812, 0, 
-    11538, 8673, 12650, 11020, 0, 66467, 2105, 8087, 78163, 69632, 9894, 0, 
-    0, 0, 4636, 55262, 78513, 4515, 2382, 0, 127055, 0, 120495, 0, 128284, 
-    12277, 194627, 11995, 92553, 0, 12158, 0, 8741, 10197, 0, 92426, 0, 6531, 
-    0, 127846, 473, 43415, 0, 983641, 1873, 1087, 0, 0, 0, 78527, 66439, 
-    43218, 983123, 194716, 7237, 12504, 74282, 0, 983571, 0, 9489, 0, 0, 
-    4384, 74220, 63845, 2058, 128863, 13295, 43191, 128030, 0, 1154, 3857, 
-    1205, 0, 0, 13100, 12958, 120706, 74168, 0, 0, 4421, 10592, 0, 495, 
-    119007, 41712, 7983, 0, 93997, 0, 6347, 120165, 7654, 41710, 4196, 0, 
-    437, 41709, 73772, 0, 0, 9465, 13290, 119180, 4997, 64306, 0, 0, 4999, 
-    194642, 0, 126582, 4711, 120769, 0, 2739, 0, 8044, 74834, 194643, 41789, 
-    128142, 10809, 0, 0, 0, 1779, 6600, 6601, 41543, 5325, 642, 64187, 13058, 
-    120449, 12875, 0, 92186, 13229, 0, 10575, 43399, 0, 0, 41791, 1104, 0, 0, 
-    10655, 0, 0, 0, 0, 1082, 195049, 8428, 6569, 0, 0, 0, 69849, 6783, 0, 
-    12993, 8049, 41548, 44021, 6458, 983798, 128882, 4761, 63828, 4766, 
-    64623, 1273, 43407, 0, 118876, 195045, 6912, 1313, 6322, 10483, 983603, 
-    41545, 0, 92449, 0, 0, 0, 0, 78624, 3484, 74337, 0, 0, 8503, 5122, 41527, 
-    0, 66320, 983802, 0, 0, 0, 41537, 69683, 8303, 8282, 11817, 73857, 10003, 
-    73859, 65904, 7363, 1686, 0, 78406, 11467, 3664, 65921, 64299, 194664, 0, 
-    0, 4324, 126, 42246, 119152, 0, 74378, 65926, 7744, 194636, 74277, 74302, 
-    78052, 43817, 6966, 43822, 8136, 0, 65600, 1633, 0, 0, 4762, 1103, 0, 0, 
-    4765, 983484, 13078, 0, 4760, 63827, 2050, 10871, 43199, 1102, 0, 42236, 
-    128867, 194667, 11546, 74794, 337, 0, 42591, 8627, 12279, 1111, 0, 92161, 
-    4707, 68206, 10143, 7883, 127081, 7880, 4522, 8645, 5704, 13010, 0, 8304, 
-    917561, 0, 119575, 2293, 0, 66654, 0, 92676, 0, 13008, 0, 4385, 0, 13011, 
-    0, 92569, 119161, 13009, 160, 2677, 0, 0, 41793, 65763, 74221, 120141, 
-    41792, 42770, 94054, 65762, 118829, 43821, 5709, 0, 94053, 43816, 0, 0, 
-    1079, 3867, 5708, 0, 0, 43797, 5706, 64768, 5705, 8791, 4005, 0, 10237, 
-    10991, 128816, 43459, 9173, 917581, 917580, 13170, 12540, 917577, 42605, 
-    120765, 126617, 68647, 917572, 10058, 0, 74867, 194654, 127078, 3339, 
-    11448, 1106, 917591, 917590, 917593, 3340, 917587, 917586, 917589, 
-    917588, 120541, 10605, 1309, 63966, 120743, 1754, 92226, 13246, 864, 0, 
-    118926, 8972, 0, 7849, 120092, 92533, 13240, 195068, 5192, 4338, 67982, 
-    10948, 917601, 13199, 92575, 1236, 13208, 13261, 13189, 13188, 93993, 0, 
-    7440, 0, 120153, 9553, 1590, 63777, 63776, 13178, 63782, 63781, 63780, 
-    63779, 1583, 0, 13260, 4550, 0, 64205, 0, 0, 41522, 983906, 92168, 
-    983763, 917858, 11354, 94071, 0, 42795, 0, 119195, 11394, 194646, 13236, 
-    13272, 13194, 1334, 69926, 4479, 1178, 65586, 120663, 66681, 119193, 
-    4601, 0, 0, 983756, 0, 0, 194658, 0, 6809, 63786, 6031, 0, 63791, 63790, 
-    1145, 63788, 7910, 63785, 43153, 754, 10192, 13105, 8183, 120741, 2037, 
-    0, 0, 10747, 125, 0, 64890, 0, 983131, 0, 41719, 63758, 3523, 1074, 
-    13258, 9536, 74077, 0, 4427, 74242, 63757, 43145, 12217, 63754, 41532, 
-    1349, 63750, 63749, 0, 0, 0, 63753, 63802, 41084, 120622, 68133, 41930, 
-    63805, 63804, 43632, 63801, 41082, 8140, 63798, 6260, 0, 0, 94074, 63793, 
-    11988, 3898, 128241, 10201, 12238, 63795, 42194, 10367, 12521, 10431, 
-    42114, 41932, 1068, 0, 12523, 12945, 983321, 42203, 7950, 10804, 63771, 
-    42787, 4386, 12224, 6973, 2793, 12475, 0, 0, 63769, 9530, 983119, 12232, 
-    13135, 8596, 5681, 63762, 4595, 63760, 792, 0, 64803, 0, 8742, 0, 11053, 
-    128796, 63744, 128107, 0, 7588, 63748, 1693, 63746, 43204, 5055, 68426, 
-    917853, 1090, 120679, 128356, 11665, 74133, 4558, 65685, 9523, 0, 0, 
-    78681, 11513, 0, 6157, 63775, 63774, 63773, 13191, 12170, 3500, 3139, 0, 
-    3170, 12485, 0, 10872, 78271, 13006, 64433, 0, 0, 941, 0, 0, 0, 65541, 
-    11063, 0, 8228, 0, 42065, 0, 0, 94039, 0, 92455, 7386, 0, 64444, 0, 
-    119863, 43603, 94075, 65397, 288, 0, 0, 0, 10025, 69915, 2918, 0, 65300, 
-    119871, 9883, 64726, 2790, 65395, 3793, 0, 127829, 65393, 0, 74138, 0, 0, 
-    0, 74139, 92712, 65394, 11548, 5270, 0, 65396, 0, 65813, 13256, 1282, 
-    120771, 0, 0, 10888, 983604, 65242, 0, 3330, 0, 0, 983965, 0, 0, 74259, 
-    3304, 42753, 0, 0, 0, 1627, 0, 0, 0, 5371, 13116, 0, 1826, 118794, 0, 
-    43094, 70023, 43650, 94037, 0, 9035, 0, 0, 128005, 0, 92207, 68125, 0, 
-    164, 0, 94067, 94000, 6958, 0, 43116, 0, 70019, 13245, 0, 0, 127376, 0, 
-    70031, 127756, 12666, 13175, 13207, 120414, 66014, 120428, 7447, 5929, 0, 
-    65509, 0, 7449, 11306, 0, 73920, 3180, 0, 63808, 9054, 971, 13062, 0, 0, 
-    65195, 10164, 92252, 74428, 0, 78146, 92611, 0, 0, 0, 10045, 12882, 
-    13275, 128161, 11057, 0, 13276, 0, 41525, 78150, 7271, 11444, 0, 0, 0, 
-    12229, 41523, 0, 43411, 73751, 0, 64813, 0, 0, 10476, 3858, 0, 3932, 
-    64958, 0, 0, 73989, 68192, 0, 69847, 369, 0, 41784, 0, 64163, 0, 0, 0, 
-    65474, 4796, 12292, 126595, 65479, 0, 41781, 10486, 41480, 43002, 9899, 
-    0, 0, 404, 12821, 3741, 0, 5788, 8092, 68212, 41222, 1831, 66020, 3982, 
-    0, 4388, 0, 746, 120784, 0, 0, 12018, 65294, 0, 0, 0, 0, 4422, 4708, 
-    3799, 74292, 119357, 0, 74430, 0, 11700, 4374, 0, 128179, 1364, 0, 8038, 
-    0, 917597, 12868, 69814, 0, 6735, 73979, 13174, 73968, 13225, 0, 69808, 
-    65835, 0, 2365, 7841, 0, 42855, 118856, 42866, 0, 0, 0, 66438, 41785, 
-    12617, 64172, 13173, 4372, 119354, 0, 983568, 0, 0, 92402, 128062, 12965, 
-    384, 64512, 10404, 10340, 119352, 1556, 5274, 13210, 120125, 10017, 9733, 
-    41787, 983237, 126994, 41373, 78039, 12303, 0, 13232, 13233, 349, 4863, 
-    41371, 11656, 0, 120703, 119883, 12861, 4398, 8543, 65618, 128018, 1096, 
-    0, 0, 42688, 12441, 12355, 119348, 119347, 4318, 10452, 0, 8032, 13243, 
-    13237, 12719, 126646, 119101, 0, 64884, 119872, 119345, 8597, 0, 0, 9864, 
-    0, 120785, 119874, 94107, 13195, 41452, 64961, 7722, 0, 10459, 119878, 0, 
-    119879, 66590, 128123, 41533, 66337, 0, 92184, 0, 4965, 43445, 917536, 
-    73849, 0, 43638, 78537, 128287, 6261, 119342, 43147, 66570, 1957, 10420, 
-    982, 2756, 13292, 13206, 128828, 0, 2925, 73809, 13056, 127559, 13212, 
-    43238, 0, 13190, 13187, 92541, 13198, 118793, 0, 5242, 119179, 64476, 
-    1694, 8216, 71369, 6770, 43331, 0, 65620, 983719, 43544, 126466, 0, 
-    41444, 65621, 69955, 9197, 5246, 119106, 13185, 9709, 120323, 120322, 
-    12314, 65616, 5238, 119333, 0, 119337, 5236, 40979, 0, 74201, 8286, 
-    128537, 3936, 119331, 11699, 41347, 127249, 13235, 8842, 41248, 0, 4379, 
-    13239, 12692, 7969, 127266, 7219, 127250, 128251, 120509, 0, 66224, 734, 
-    2979, 120303, 65619, 9872, 957, 64921, 1846, 66631, 41477, 119256, 
-    120310, 74511, 41770, 1670, 6442, 120317, 42446, 5379, 120318, 41163, 
-    74832, 120315, 120314, 11506, 0, 42841, 13267, 0, 0, 41775, 0, 7130, 
-    41773, 0, 10663, 0, 0, 0, 6151, 12110, 42673, 65572, 65293, 65250, 13265, 
-    13264, 64518, 0, 6100, 0, 92647, 5808, 65922, 0, 12967, 66041, 5612, 
-    4583, 0, 0, 68097, 64575, 126637, 11965, 0, 68358, 0, 69789, 0, 92260, 
-    68102, 9698, 7814, 74476, 119651, 128514, 0, 41921, 118858, 9756, 6985, 
-    119258, 78490, 74219, 0, 0, 118997, 8012, 5674, 12353, 0, 12361, 5677, 
-    5588, 0, 41925, 128124, 41920, 5673, 120534, 5676, 41923, 12694, 118978, 
-    5672, 1294, 0, 78059, 0, 42511, 1727, 120725, 42436, 0, 0, 0, 74222, 
-    8718, 3550, 736, 10268, 4505, 10316, 74090, 5826, 55232, 5813, 0, 120712, 
-    5841, 5837, 55234, 0, 3105, 12829, 5838, 5796, 0, 119592, 5793, 0, 5866, 
-    5797, 41011, 5865, 120091, 7956, 598, 0, 64649, 5806, 42398, 0, 9037, 
-    5671, 120041, 0, 0, 0, 128855, 0, 847, 128242, 9529, 0, 66657, 6980, 
-    78483, 120035, 78484, 983483, 0, 120033, 78486, 0, 0, 120039, 42683, 0, 
-    983055, 7114, 0, 0, 43190, 65463, 1554, 0, 42611, 42563, 0, 5651, 2929, 
-    6792, 43201, 0, 19963, 5698, 0, 0, 0, 0, 5644, 10292, 65546, 69727, 
-    68141, 8372, 0, 65116, 0, 120022, 10175, 10388, 42799, 94100, 41013, 
-    10568, 0, 983618, 2869, 0, 41015, 194692, 2785, 4366, 0, 10954, 41802, 0, 
-    42608, 78469, 9884, 4759, 0, 0, 10266, 41359, 1170, 43365, 69810, 73908, 
-    1609, 902, 0, 63936, 128875, 11661, 8122, 5818, 0, 0, 3861, 9540, 11028, 
-    2554, 5158, 5714, 2213, 0, 0, 807, 43079, 0, 78475, 976, 5511, 64553, 0, 
-    42155, 0, 41356, 74110, 118801, 126614, 0, 8676, 983283, 0, 5582, 451, 
-    63941, 5798, 9349, 42018, 127858, 0, 0, 43609, 5906, 120553, 1440, 0, 
-    128853, 120016, 74283, 11005, 0, 66656, 66044, 0, 194698, 0, 0, 43393, 
-    10094, 0, 11529, 10857, 120643, 66436, 6546, 93, 8102, 0, 68405, 0, 0, 
-    8171, 0, 119097, 127064, 917543, 383, 7154, 41656, 92634, 94040, 0, 5187, 
-    71296, 127277, 11286, 68620, 64217, 0, 5232, 0, 41009, 0, 41005, 0, 0, 
-    983818, 8292, 195074, 4980, 8860, 73947, 10028, 65291, 7076, 13182, 
-    194705, 0, 0, 10631, 66031, 7972, 0, 78785, 0, 7900, 0, 11309, 3806, 
-    4198, 42725, 0, 67656, 9995, 0, 92552, 0, 12931, 0, 42684, 74285, 2088, 
-    64213, 64366, 65156, 8814, 42238, 74771, 0, 0, 12836, 0, 0, 74342, 8593, 
-    0, 0, 68445, 13255, 0, 0, 7464, 0, 65865, 0, 194650, 127144, 0, 9342, 
-    120464, 0, 64516, 0, 78792, 10129, 41007, 74375, 0, 40995, 12209, 41012, 
-    119136, 0, 0, 69724, 40992, 92264, 127153, 68653, 43558, 5522, 0, 61, 0, 
-    74105, 3633, 983891, 65162, 41234, 12089, 78281, 9771, 983896, 13251, 
-    128701, 0, 6262, 2784, 42743, 0, 8126, 66483, 0, 0, 441, 42621, 0, 0, 
-    41002, 40999, 119623, 43266, 7108, 194779, 10890, 74481, 65834, 8324, 
-    119103, 64417, 74817, 127465, 64737, 0, 983650, 8930, 66678, 74249, 1193, 
-    10056, 1800, 13253, 13252, 7829, 0, 0, 7743, 0, 0, 77904, 92640, 77905, 
-    9034, 6039, 0, 10075, 0, 41018, 65683, 10338, 66469, 0, 0, 0, 42815, 0, 
-    41966, 0, 127471, 0, 11792, 43064, 41025, 911, 7539, 0, 0, 120339, 65159, 
-    64390, 0, 0, 5520, 11662, 0, 65330, 42812, 0, 0, 12326, 983847, 0, 42808, 
-    128337, 9348, 64901, 983852, 0, 0, 0, 0, 0, 917584, 43702, 983576, 5857, 
-    65342, 92727, 119120, 120079, 8644, 0, 0, 0, 74296, 41909, 0, 120332, 
-    2791, 69663, 1891, 69824, 0, 41907, 66647, 118939, 8761, 12942, 5748, 0, 
-    10773, 0, 0, 8796, 78149, 6412, 2061, 8520, 13146, 127185, 63931, 0, 
-    65902, 2882, 0, 0, 12843, 4520, 120345, 92459, 0, 983651, 0, 73860, 0, 0, 
-    64345, 0, 9201, 128314, 194940, 0, 0, 43679, 917585, 65117, 92270, 0, 
-    10427, 0, 3844, 120675, 9755, 1110, 6612, 12222, 0, 128789, 0, 0, 783, 
-    194935, 0, 0, 983064, 194720, 65056, 3620, 41180, 68378, 4556, 0, 0, 
-    194933, 74250, 0, 67657, 10510, 4382, 66482, 0, 0, 127527, 9177, 8902, 
-    93958, 9839, 0, 12891, 983746, 983627, 63999, 2016, 41917, 9788, 63928, 
-    0, 1862, 65800, 9155, 66623, 9786, 65082, 41919, 8579, 41914, 7981, 0, 
-    66017, 4508, 64883, 92456, 92522, 127814, 0, 64592, 74276, 120080, 6784, 
-    78788, 68181, 0, 0, 0, 127534, 12147, 9024, 66378, 66472, 983920, 64289, 
-    65289, 78151, 66658, 194929, 64509, 78152, 0, 126505, 11051, 983288, 0, 
-    11355, 65885, 0, 128310, 41214, 0, 12299, 0, 7500, 4506, 7773, 0, 0, 
-    9963, 68649, 126609, 4040, 120570, 6167, 0, 63922, 6594, 983731, 0, 0, 
-    3624, 43036, 0, 6387, 63990, 19947, 63988, 41955, 0, 63993, 10440, 9611, 
-    65605, 6803, 0, 7738, 63986, 11446, 63984, 92641, 3435, 78164, 43814, 
-    43810, 7029, 64258, 41292, 118898, 12748, 42742, 9517, 11518, 0, 78790, 
-    0, 67993, 63956, 42458, 63954, 63953, 63960, 9591, 4516, 10217, 68370, 
-    11469, 69697, 42306, 2723, 118947, 0, 0, 0, 0, 0, 11397, 2880, 0, 0, 
-    2872, 0, 0, 3498, 4378, 917539, 4270, 0, 65551, 68205, 6633, 43387, 0, 
-    5230, 0, 0, 0, 0, 0, 8161, 393, 12013, 0, 0, 126479, 415, 63964, 63963, 
-    42345, 92310, 5183, 1877, 42498, 0, 2927, 0, 63961, 4472, 0, 0, 78159, 
-    69699, 917936, 42340, 4756, 128078, 7081, 10730, 7691, 10331, 63830, 
-    119625, 42922, 42103, 8628, 9813, 0, 42453, 1604, 9565, 10539, 69701, 
-    65764, 41415, 65767, 0, 8457, 42301, 11372, 64873, 11992, 0, 0, 63980, 
-    11801, 3622, 983124, 64336, 12017, 10463, 63981, 4967, 64189, 1966, 
-    43628, 0, 983284, 0, 0, 63971, 4347, 4416, 42098, 11009, 10694, 63973, 
-    402, 0, 13147, 128692, 42100, 64646, 13228, 0, 41875, 3515, 74252, 11805, 
-    0, 11302, 6259, 43395, 0, 0, 194670, 0, 92351, 0, 74425, 11299, 1561, 0, 
-    92359, 64942, 983559, 194733, 983677, 194732, 0, 74301, 0, 11280, 0, 
-    69784, 74060, 0, 0, 119664, 5145, 12486, 65018, 66516, 5409, 127379, 
-    194669, 7402, 5399, 9685, 74089, 7952, 5401, 0, 66616, 68421, 983910, 0, 
-    5405, 127875, 64866, 0, 119583, 128345, 78784, 74248, 11330, 194723, 
-    64690, 3254, 0, 0, 128207, 42390, 43678, 194725, 983900, 65077, 0, 6388, 
-    3355, 9508, 9867, 5723, 11520, 5611, 0, 3377, 0, 0, 0, 0, 78228, 0, 
-    983753, 42691, 917886, 127198, 74767, 0, 127075, 1379, 246, 0, 983752, 
-    3788, 983106, 11041, 92549, 66304, 0, 0, 8917, 42403, 301, 0, 0, 0, 0, 0, 
-    983688, 10656, 0, 65214, 119242, 42567, 92217, 13163, 983202, 120831, 
-    74597, 3182, 0, 0, 0, 65034, 65889, 42169, 4755, 74244, 194621, 11443, 0, 
-    66319, 74598, 608, 600, 0, 1219, 3934, 64206, 11483, 74510, 0, 74485, 
-    42442, 65470, 983898, 64202, 13160, 7759, 42482, 485, 128006, 0, 9828, 0, 
-    0, 42280, 0, 9351, 7778, 64379, 7496, 42431, 6916, 1208, 0, 119631, 
-    11002, 42470, 0, 118946, 0, 0, 74041, 0, 70045, 43539, 5411, 42196, 0, 0, 
-    0, 9150, 0, 42393, 13086, 1310, 194687, 9337, 12052, 10643, 55271, 
-    983179, 12166, 2546, 194683, 213, 118852, 65611, 0, 0, 194756, 74310, 
-    6554, 0, 11914, 5452, 0, 0, 0, 0, 0, 194681, 92560, 2713, 0, 9650, 43330, 
-    0, 194675, 1406, 0, 0, 92659, 0, 68223, 4143, 194677, 0, 65748, 4141, 
-    9682, 65287, 1508, 127013, 8779, 10569, 8725, 13299, 66638, 65750, 42263, 
-    4145, 6380, 65751, 66613, 43994, 65738, 55250, 9185, 9550, 0, 43403, 0, 
-    0, 0, 65736, 41951, 64816, 65756, 983203, 12955, 10596, 2888, 194645, 0, 
-    0, 9657, 9019, 194766, 0, 2878, 5390, 0, 194961, 0, 68679, 43552, 7501, 
-    6328, 0, 10429, 10365, 0, 0, 41946, 7503, 5235, 803, 68381, 0, 0, 8986, 
-    126542, 10632, 11934, 11452, 1332, 0, 0, 126647, 0, 118887, 1791, 5191, 
-    9288, 64822, 2892, 0, 43394, 555, 0, 0, 66646, 0, 119002, 13151, 74512, 
-    7289, 74055, 64161, 8854, 64162, 5858, 41927, 10582, 0, 1784, 1361, 
-    195047, 0, 7905, 0, 64868, 128813, 13158, 92166, 7211, 0, 9371, 73973, 
-    917553, 6828, 1625, 92302, 0, 1342, 68440, 64171, 126704, 10903, 983486, 
-    0, 0, 0, 0, 4482, 41606, 0, 128569, 983112, 0, 64381, 0, 0, 195090, 
-    42245, 126467, 41972, 0, 444, 0, 9127, 66687, 66619, 126489, 78025, 0, 
-    11349, 40991, 917570, 0, 119599, 120830, 0, 1197, 128282, 1149, 194970, 
-    0, 0, 40990, 43765, 0, 3492, 0, 127942, 0, 0, 0, 12838, 983969, 19948, 0, 
-    3099, 0, 0, 41087, 0, 0, 0, 119059, 12036, 41309, 0, 0, 8152, 0, 41550, 
-    12227, 983613, 0, 12828, 127511, 0, 0, 120708, 0, 0, 10386, 119574, 0, 0, 
-    92680, 983780, 68154, 0, 1743, 0, 0, 92239, 65186, 917571, 0, 9606, 0, 0, 
-    64439, 0, 0, 92686, 0, 0, 194967, 0, 0, 3395, 9362, 10878, 0, 0, 78362, 
-    64830, 0, 126557, 41091, 3426, 1344, 8870, 0, 0, 4735, 127017, 6119, 
-    12822, 42699, 0, 983815, 74818, 1423, 0, 42637, 41080, 0, 12039, 10559, 
-    0, 118892, 0, 9472, 0, 11929, 0, 7170, 9596, 6130, 128826, 43629, 11579, 
-    78713, 0, 194740, 128691, 92185, 66699, 64440, 1004, 92584, 194737, 
-    43234, 66008, 12627, 0, 68414, 0, 43619, 43303, 11300, 43304, 9686, 5890, 
-    11776, 7558, 127158, 65627, 0, 10718, 13154, 3461, 9139, 0, 0, 0, 0, 
-    65365, 73877, 65628, 78019, 120319, 0, 41708, 12860, 2641, 12069, 10838, 
-    5403, 10352, 70085, 10061, 43237, 0, 5140, 209, 128847, 41704, 41056, 
-    43078, 128125, 118809, 0, 10899, 65469, 92362, 0, 0, 2410, 993, 0, 
-    120589, 120689, 78693, 0, 0, 7232, 0, 119253, 0, 7110, 74462, 2066, 
-    10489, 42166, 43463, 10659, 3600, 0, 4224, 1336, 41518, 0, 0, 0, 0, 
-    41139, 64820, 92538, 12966, 41134, 0, 0, 0, 0, 272, 4263, 8793, 0, 0, 
-    41502, 0, 983, 12549, 0, 0, 1190, 4109, 1335, 841, 5888, 41358, 64863, 
-    9544, 43481, 0, 194806, 70027, 2099, 5120, 2409, 7799, 0, 74424, 0, 0, 
-    4731, 0, 66629, 0, 0, 1255, 4149, 9247, 0, 9913, 0, 0, 64914, 917787, 
-    65101, 0, 11694, 92475, 11690, 5835, 127164, 66625, 10842, 41354, 42123, 
-    43097, 11688, 66634, 1094, 194, 64692, 0, 8180, 0, 0, 9972, 73865, 4519, 
-    6114, 10898, 43072, 0, 0, 93960, 983314, 126581, 10695, 0, 7540, 0, 881, 
-    7857, 6067, 65164, 0, 0, 0, 13311, 68403, 41857, 64321, 8359, 0, 12689, 
-    0, 194594, 0, 983304, 983872, 68183, 0, 983306, 1287, 5436, 0, 983309, 
-    74142, 92328, 74152, 119078, 6051, 10497, 69668, 8985, 12109, 983315, 0, 
-    127242, 0, 0, 3652, 10537, 0, 1276, 120440, 6549, 279, 73745, 0, 0, 0, 
-    1489, 0, 0, 0, 3899, 1007, 42124, 983557, 42122, 92337, 92367, 0, 11985, 
-    1345, 78600, 0, 0, 8956, 43083, 94057, 42138, 78610, 0, 12151, 78608, 
-    78604, 78605, 6285, 78603, 78612, 78613, 65942, 492, 8685, 0, 983750, 0, 
-    78622, 43712, 2582, 11470, 64538, 7444, 78615, 78616, 2297, 0, 73837, 
-    119823, 2527, 119824, 197, 2799, 92594, 41944, 120276, 9933, 0, 66515, 
-    767, 5524, 7028, 0, 0, 119827, 119817, 119828, 78633, 10896, 0, 1799, 
-    120497, 6971, 74336, 128342, 0, 65340, 118979, 41551, 2434, 94018, 0, 
-    120579, 0, 4631, 0, 0, 6407, 0, 6338, 43214, 0, 7570, 0, 3192, 0, 8414, 
-    0, 93983, 0, 0, 0, 9164, 66612, 93959, 3171, 6623, 4961, 68396, 886, 
-    55216, 8654, 78832, 9993, 74390, 64603, 70066, 69241, 9599, 78629, 43084, 
-    78627, 78628, 78625, 2399, 69693, 8994, 10944, 41208, 983704, 41168, 
-    8178, 0, 3367, 92334, 42510, 78641, 78636, 6804, 78634, 1947, 0, 0, 
-    92681, 42759, 11068, 1705, 9331, 0, 74798, 9181, 65359, 0, 8017, 119831, 
-    65096, 66720, 0, 43475, 0, 4909, 12126, 128673, 120696, 4904, 983325, 
-    69650, 1365, 9253, 42757, 43436, 7462, 0, 0, 0, 0, 119587, 64415, 0, 0, 
-    5398, 0, 127386, 93953, 0, 0, 119015, 0, 0, 9476, 0, 983768, 12763, 
-    126603, 3629, 0, 13005, 0, 3628, 0, 0, 92502, 3469, 42107, 42116, 917578, 
-    64809, 2928, 4905, 9853, 851, 9040, 0, 64665, 43086, 9114, 0, 42583, 
-    9315, 4822, 4906, 3852, 2847, 119821, 3236, 11317, 1251, 7777, 41852, 
-    11410, 10964, 0, 43222, 12646, 120269, 10259, 9865, 65821, 0, 6018, 
-    92290, 0, 12276, 0, 68372, 0, 92259, 119244, 0, 983224, 10467, 0, 2443, 
-    10918, 78217, 119825, 1001, 9241, 1927, 0, 0, 73987, 127885, 0, 0, 
+    118907, 0, 10474, 43426, 13257, 42354, 128099, 983698, 70044, 195065, 0, 
+    8413, 983816, 0, 5693, 7272, 0, 13209, 64470, 65831, 74350, 195063, 0, 0, 
+    0, 126639, 120097, 0, 94078, 128133, 127767, 66608, 3111, 41863, 8804, 
+    42913, 92187, 7270, 0, 66606, 6628, 1076, 7433, 1436, 73844, 55226, 
+    128353, 63982, 7393, 12807, 43413, 63906, 1598, 63904, 0, 0, 41729, 4423, 
+    1307, 0, 10515, 41589, 128698, 0, 6218, 0, 1430, 0, 0, 120606, 78754, 
+    5413, 7619, 3255, 3493, 74032, 11549, 10735, 41743, 73937, 6801, 983633, 
+    4518, 10990, 65073, 5167, 4481, 3771, 120158, 2710, 0, 69243, 41724, 0, 
+    43073, 41690, 12479, 983635, 0, 0, 983818, 70046, 1628, 127149, 983487, 
+    983731, 65262, 6333, 10783, 42315, 0, 63855, 94056, 0, 0, 5339, 74323, 0, 
+    13004, 0, 4457, 0, 0, 194818, 0, 5684, 8678, 10914, 0, 5689, 65807, 0, 
+    68464, 12633, 12870, 69705, 65183, 5688, 11926, 6033, 6310, 5686, 0, 
+    74251, 0, 120647, 0, 50, 10558, 9871, 42612, 43655, 0, 0, 0, 66468, 0, 
+    13259, 4448, 0, 983845, 0, 70043, 67853, 0, 10640, 11539, 1151, 0, 
+    917607, 127544, 127079, 195050, 127852, 0, 0, 0, 12501, 64604, 0, 11527, 
+    118870, 8812, 0, 11538, 8673, 12650, 11020, 0, 66467, 2105, 8087, 78163, 
+    69632, 9894, 0, 0, 0, 4636, 55262, 78513, 4515, 2382, 0, 127055, 0, 
+    120495, 0, 128284, 12277, 194627, 11995, 92553, 0, 12158, 0, 8741, 10197, 
+    0, 92426, 0, 6531, 0, 127846, 473, 43415, 0, 983650, 1873, 1087, 0, 0, 0, 
+    78527, 66439, 43218, 983123, 194716, 7237, 12504, 74282, 0, 983571, 0, 
+    9489, 0, 0, 4384, 74220, 63845, 2058, 128863, 13295, 43191, 128030, 0, 
+    1154, 3857, 1205, 0, 0, 13100, 12958, 120706, 74168, 0, 0, 4421, 10592, 
+    0, 495, 119007, 41712, 7983, 0, 93997, 0, 6347, 120165, 7654, 41710, 
+    4196, 0, 437, 41709, 73772, 0, 0, 9465, 13290, 119180, 4997, 64306, 0, 0, 
+    4999, 194642, 0, 126582, 4711, 120769, 0, 2739, 0, 8044, 74834, 194643, 
+    41789, 128142, 10809, 0, 0, 0, 1779, 6600, 6601, 41543, 5325, 642, 64187, 
+    13058, 120449, 12875, 0, 92186, 13229, 0, 10575, 43399, 0, 0, 41791, 
+    1104, 0, 0, 10655, 0, 0, 0, 0, 1082, 195049, 8428, 6569, 0, 0, 0, 69849, 
+    6783, 0, 12993, 8049, 41548, 44021, 6458, 983807, 128882, 4761, 63828, 
+    4766, 64623, 1273, 43407, 0, 118876, 195045, 6912, 1313, 6322, 10483, 
+    983603, 41545, 0, 92449, 0, 0, 0, 0, 78624, 3484, 74337, 0, 0, 8503, 
+    5122, 41527, 0, 66320, 983811, 0, 0, 0, 41537, 69683, 8303, 8282, 11817, 
+    73857, 10003, 73859, 65904, 7363, 1686, 0, 78406, 11467, 3664, 65921, 
+    64299, 194664, 0, 0, 4324, 126, 42246, 119152, 0, 74378, 65926, 7744, 
+    194636, 74277, 74302, 78052, 43817, 6966, 43822, 8136, 0, 65600, 1633, 0, 
+    0, 4762, 1103, 0, 0, 4765, 983492, 13078, 0, 4760, 63827, 2050, 10871, 
+    43199, 1102, 0, 42236, 128867, 194667, 11546, 74794, 337, 0, 42591, 8627, 
+    12279, 1111, 0, 92161, 4707, 68206, 10143, 7883, 127081, 7880, 4522, 
+    8645, 5704, 13010, 0, 8304, 917561, 0, 119575, 2293, 0, 66654, 0, 92676, 
+    0, 13008, 0, 4385, 0, 13011, 0, 92569, 119161, 13009, 160, 2677, 0, 0, 
+    41793, 65763, 74221, 120141, 41792, 42770, 94054, 65762, 118829, 43821, 
+    5709, 0, 94053, 43816, 0, 0, 1079, 3867, 5708, 0, 0, 43797, 5706, 64768, 
+    5705, 8791, 4005, 0, 10237, 10991, 128816, 43459, 9173, 917581, 917580, 
+    13170, 12540, 917577, 42605, 120765, 126617, 68647, 917572, 10058, 0, 
+    74867, 194654, 127078, 3339, 11448, 1106, 917591, 917590, 917593, 3340, 
+    917587, 917586, 917589, 917588, 120541, 10605, 1309, 63966, 120743, 1754, 
+    92226, 13246, 864, 0, 118926, 8972, 0, 7849, 120092, 92533, 13240, 
+    195068, 5192, 4338, 67982, 10948, 917601, 13199, 92575, 1236, 13208, 
+    13261, 13189, 13188, 93993, 0, 7440, 0, 120153, 9553, 1590, 63777, 63776, 
+    13178, 63782, 63781, 63780, 63779, 1583, 0, 13260, 4550, 0, 64205, 0, 0, 
+    41522, 983915, 92168, 983772, 917858, 11354, 94071, 0, 42795, 0, 119195, 
+    11394, 194646, 13236, 13272, 13194, 1334, 69926, 4479, 1178, 65586, 
+    120663, 66681, 119193, 4601, 0, 0, 983765, 0, 0, 194658, 0, 6809, 63786, 
+    6031, 0, 63791, 63790, 1145, 63788, 7910, 63785, 43153, 754, 10192, 
+    13105, 8183, 120741, 2037, 0, 0, 10747, 125, 0, 64890, 0, 983131, 0, 
+    41719, 63758, 3523, 1074, 13258, 9536, 74077, 0, 4427, 74242, 63757, 
+    43145, 12217, 63754, 41532, 1349, 63750, 63749, 0, 0, 0, 63753, 63802, 
+    41084, 120622, 68133, 41930, 63805, 63804, 43632, 63801, 41082, 8140, 
+    63798, 6260, 0, 0, 94074, 63793, 11988, 3898, 128241, 10201, 12238, 
+    63795, 42194, 10367, 12521, 10431, 42114, 41932, 1068, 0, 12523, 12945, 
+    983329, 42203, 7950, 10804, 63771, 42787, 4386, 12224, 6973, 2793, 12475, 
+    0, 0, 63769, 9530, 983119, 12232, 13135, 8596, 5681, 63762, 4595, 63760, 
+    792, 0, 64803, 0, 8742, 0, 11053, 128796, 63744, 128107, 0, 7588, 63748, 
+    1693, 63746, 43204, 5055, 68426, 917853, 1090, 120679, 128356, 11665, 
+    74133, 4558, 65685, 9523, 0, 0, 78681, 11513, 0, 6157, 63775, 63774, 
+    63773, 13191, 12170, 3500, 3139, 0, 3170, 12485, 0, 10872, 78271, 13006, 
+    64433, 0, 0, 941, 0, 0, 0, 65541, 11063, 0, 8228, 0, 42065, 0, 0, 94039, 
+    0, 92455, 7386, 0, 64444, 0, 119863, 43603, 94075, 65397, 288, 0, 0, 0, 
+    10025, 69915, 2918, 0, 65300, 119871, 9883, 64726, 2790, 65395, 3793, 0, 
+    127829, 65393, 0, 74138, 0, 0, 0, 74139, 92712, 65394, 11548, 5270, 0, 
+    65396, 0, 65813, 13256, 1282, 120771, 0, 0, 10888, 983604, 65242, 0, 
+    3330, 0, 0, 983974, 0, 0, 74259, 3304, 42753, 0, 0, 0, 1627, 0, 0, 0, 
+    5371, 13116, 0, 1826, 118794, 0, 43094, 70023, 43650, 94037, 0, 9035, 0, 
+    0, 128005, 0, 92207, 68125, 0, 164, 0, 94067, 94000, 6958, 0, 43116, 0, 
+    70019, 13245, 0, 0, 127376, 0, 70031, 127756, 12666, 13175, 13207, 
+    120414, 66014, 120428, 7447, 5929, 0, 65509, 0, 7449, 11306, 0, 73920, 
+    3180, 0, 63808, 9054, 971, 13062, 0, 0, 65195, 10164, 92252, 74428, 0, 
+    78146, 92611, 0, 0, 0, 10045, 12882, 13275, 128161, 11057, 0, 13276, 0, 
+    41525, 78150, 7271, 11444, 0, 0, 0, 12229, 41523, 0, 43411, 73751, 0, 
+    64813, 0, 0, 10476, 3858, 0, 3932, 64958, 0, 0, 73989, 68192, 0, 69847, 
+    369, 0, 41784, 0, 64163, 0, 0, 0, 65474, 4796, 12292, 126595, 65479, 0, 
+    41781, 10486, 41480, 43002, 9899, 0, 0, 404, 12821, 3741, 0, 5788, 8092, 
+    68212, 41222, 1831, 66020, 3982, 0, 4388, 0, 746, 120784, 0, 0, 12018, 
+    65294, 0, 0, 0, 0, 4422, 4708, 3799, 74292, 119357, 0, 74430, 0, 11700, 
+    4374, 0, 128179, 1364, 0, 8038, 0, 917597, 12868, 69814, 0, 6735, 73979, 
+    13174, 73968, 13225, 0, 69808, 65835, 0, 2365, 7841, 0, 42855, 118856, 
+    42866, 0, 0, 0, 66438, 41785, 12617, 64172, 13173, 4372, 119354, 0, 
+    983568, 0, 0, 92402, 128062, 12965, 384, 64512, 10404, 10340, 119352, 
+    1556, 5274, 13210, 120125, 10017, 9733, 41787, 983243, 126994, 41373, 
+    78039, 12303, 0, 13232, 13233, 349, 4863, 41371, 11656, 0, 120703, 
+    119883, 12861, 4398, 8543, 65618, 128018, 1096, 0, 0, 42688, 12441, 
+    12355, 119348, 119347, 4318, 10452, 0, 8032, 13243, 13237, 12719, 126646, 
+    119101, 0, 64884, 119872, 119345, 8597, 0, 0, 9864, 0, 120785, 119874, 
+    94107, 13195, 41452, 64961, 7722, 0, 10459, 119878, 0, 119879, 66590, 
+    128123, 41533, 66337, 0, 92184, 0, 4965, 43445, 917536, 73849, 0, 43638, 
+    78537, 128287, 6261, 119342, 43147, 66570, 1957, 10420, 982, 2756, 13292, 
+    13206, 128828, 0, 2925, 73809, 13056, 127559, 13212, 43238, 0, 13190, 
+    13187, 92541, 13198, 118793, 0, 5242, 119179, 64476, 1694, 8216, 71369, 
+    6770, 43331, 0, 65620, 983728, 43544, 126466, 0, 41444, 65621, 69955, 
+    9197, 5246, 119106, 13185, 9709, 120323, 120322, 12314, 65616, 5238, 
+    119333, 0, 119337, 5236, 40979, 0, 74201, 8286, 128537, 3936, 119331, 
+    11699, 41347, 127249, 13235, 8842, 41248, 0, 4379, 13239, 12692, 7969, 
+    127266, 7219, 127250, 128251, 120509, 0, 66224, 734, 2979, 120303, 65619, 
+    9872, 957, 64921, 1846, 66631, 41477, 119256, 120310, 74511, 41770, 1670, 
+    6442, 120317, 42446, 5379, 120318, 41163, 74832, 120315, 120314, 11506, 
+    0, 42841, 13267, 0, 0, 41775, 0, 7130, 41773, 0, 10663, 0, 0, 0, 6151, 
+    12110, 42673, 65572, 65293, 65250, 13265, 13264, 64518, 0, 6100, 0, 
+    92647, 5808, 65922, 0, 12967, 66041, 5612, 4583, 0, 0, 68097, 64575, 
+    126637, 11965, 0, 68358, 0, 69789, 0, 92260, 68102, 9698, 7814, 74476, 
+    119651, 128514, 0, 41921, 118858, 9756, 6985, 119258, 78490, 74219, 0, 0, 
+    118997, 8012, 5674, 12353, 0, 12361, 5677, 5588, 0, 41925, 128124, 41920, 
+    5673, 120534, 5676, 41923, 12694, 118978, 5672, 1294, 0, 78059, 0, 42511, 
+    1727, 120725, 42436, 0, 0, 0, 74222, 8718, 3550, 736, 10268, 4505, 10316, 
+    74090, 5826, 55232, 5813, 0, 120712, 5841, 5837, 55234, 0, 3105, 12829, 
+    5838, 5796, 0, 119592, 5793, 0, 5866, 5797, 41011, 5865, 120091, 7956, 
+    598, 0, 64649, 5806, 42398, 0, 9037, 5671, 120041, 983255, 0, 0, 128855, 
+    0, 847, 128242, 9529, 0, 66657, 6980, 78483, 120035, 78484, 983491, 0, 
+    120033, 78486, 0, 0, 120039, 42683, 0, 983055, 7114, 0, 0, 43190, 65463, 
+    1554, 0, 42611, 42563, 0, 5651, 2929, 6792, 43201, 0, 19963, 5698, 0, 0, 
+    0, 0, 5644, 10292, 65546, 69727, 68141, 8372, 0, 65116, 0, 120022, 10175, 
+    10388, 42799, 94100, 41013, 10568, 0, 983618, 2869, 0, 41015, 194692, 
+    2785, 4366, 0, 10954, 41802, 0, 42608, 78469, 9884, 4759, 0, 0, 10266, 
+    41359, 1170, 43365, 69810, 73908, 1609, 902, 0, 63936, 128875, 11661, 
+    8122, 5818, 0, 0, 3861, 9540, 11028, 2554, 5158, 5714, 2213, 0, 0, 807, 
+    43079, 0, 78475, 976, 5511, 64553, 0, 42155, 0, 41356, 74110, 118801, 
+    126614, 0, 8676, 983291, 0, 5582, 451, 63941, 5798, 9349, 42018, 127858, 
+    0, 0, 43609, 5906, 120553, 1440, 0, 128853, 120016, 74283, 11005, 0, 
+    66656, 66044, 0, 194698, 0, 0, 43393, 10094, 0, 11529, 10857, 120643, 
+    66436, 6546, 93, 8102, 0, 68405, 0, 0, 8171, 0, 119097, 127064, 917543, 
+    383, 7154, 41656, 92634, 94040, 0, 5187, 71296, 127277, 11286, 68620, 
+    64217, 0, 5232, 0, 41009, 0, 41005, 0, 0, 983827, 8292, 195074, 4980, 
+    8860, 73947, 10028, 65291, 7076, 13182, 194705, 0, 0, 10631, 66031, 7972, 
+    0, 78785, 0, 7900, 0, 11309, 3806, 4198, 42725, 0, 67656, 9995, 0, 92552, 
+    0, 12931, 0, 42684, 74285, 2088, 64213, 64366, 65156, 8814, 42238, 74771, 
+    0, 0, 12836, 0, 0, 74342, 8593, 0, 0, 68445, 13255, 0, 0, 7464, 0, 65865, 
+    0, 194650, 127144, 0, 9342, 120464, 0, 64516, 0, 78792, 10129, 41007, 
+    74375, 0, 40995, 12209, 41012, 119136, 0, 0, 69724, 40992, 92264, 127153, 
+    68653, 43558, 5522, 0, 61, 0, 74105, 3633, 983900, 65162, 41234, 12089, 
+    78281, 9771, 983905, 13251, 128701, 0, 6262, 2784, 42743, 0, 8126, 66483, 
+    0, 0, 441, 42621, 0, 0, 41002, 40999, 119623, 43266, 7108, 194779, 10890, 
+    74481, 65834, 8324, 119103, 64417, 74817, 127465, 64737, 0, 983659, 8930, 
+    66678, 74249, 1193, 10056, 1800, 13253, 13252, 7829, 0, 0, 7743, 0, 0, 
+    77904, 92640, 77905, 9034, 6039, 0, 10075, 0, 41018, 65683, 10338, 66469, 
+    0, 0, 0, 42815, 0, 41966, 0, 127471, 0, 11792, 43064, 41025, 911, 7539, 
+    0, 0, 120339, 65159, 64390, 0, 0, 5520, 11662, 0, 65330, 42812, 0, 0, 
+    12326, 983856, 0, 42808, 128337, 9348, 64901, 983861, 0, 0, 0, 0, 0, 
+    917584, 43702, 983576, 5857, 65342, 92727, 119120, 120079, 8644, 0, 0, 0, 
+    74296, 41909, 0, 120332, 2791, 69663, 1891, 69824, 0, 41907, 66647, 
+    118939, 8761, 12942, 5748, 0, 10773, 0, 0, 8796, 78149, 6412, 2061, 8520, 
+    13146, 127185, 63931, 0, 65902, 2882, 0, 0, 12843, 4520, 120345, 92459, 
+    0, 983660, 0, 73860, 0, 0, 64345, 0, 9201, 128314, 194940, 0, 0, 43679, 
+    917585, 65117, 92270, 0, 10427, 0, 3844, 120675, 9755, 1110, 6612, 12222, 
+    0, 128789, 0, 0, 783, 194935, 0, 0, 983064, 194720, 65056, 3620, 41180, 
+    68378, 4556, 0, 0, 194933, 74250, 0, 67657, 10510, 4382, 66482, 0, 0, 
+    127527, 9177, 8902, 93958, 9839, 0, 12891, 983755, 983636, 63999, 2016, 
+    41917, 9788, 63928, 0, 1862, 65800, 9155, 66623, 9786, 65082, 41919, 
+    8579, 41914, 7981, 0, 66017, 4508, 64883, 92456, 92522, 127814, 0, 64592, 
+    74276, 120080, 6784, 78788, 68181, 0, 0, 0, 127534, 12147, 9024, 66378, 
+    66472, 983929, 64289, 65289, 78151, 66658, 194929, 64509, 78152, 0, 
+    126505, 11051, 983296, 0, 11355, 65885, 0, 128310, 41214, 0, 12299, 0, 
+    7500, 4506, 7773, 0, 0, 9963, 68649, 126609, 4040, 120570, 6167, 0, 
+    63922, 6594, 983740, 0, 0, 3624, 43036, 0, 6387, 63990, 19947, 63988, 
+    41955, 0, 63993, 10440, 9611, 65605, 6803, 0, 7738, 63986, 11446, 63984, 
+    92641, 3435, 78164, 43814, 43810, 7029, 64258, 41292, 118898, 12748, 
+    42742, 9517, 11518, 0, 78790, 0, 67993, 63956, 42458, 63954, 63953, 
+    63960, 9591, 4516, 10217, 68370, 11469, 69697, 42306, 2723, 118947, 0, 0, 
+    0, 0, 0, 11397, 2880, 0, 0, 2872, 0, 0, 3498, 4378, 917539, 4270, 0, 
+    65551, 68205, 6633, 43387, 0, 5230, 0, 0, 0, 0, 0, 8161, 393, 12013, 0, 
+    0, 126479, 415, 63964, 63963, 42345, 92310, 5183, 1877, 42498, 0, 2927, 
+    0, 63961, 4472, 0, 0, 78159, 69699, 917936, 42340, 4756, 128078, 7081, 
+    10730, 7691, 10331, 63830, 119625, 42922, 42103, 8628, 9813, 0, 42453, 
+    1604, 9565, 10539, 69701, 65764, 41415, 65767, 0, 8457, 42301, 11372, 
+    64873, 11992, 0, 0, 63980, 11801, 3622, 983124, 64336, 12017, 10463, 
+    63981, 4967, 64189, 1966, 43628, 0, 983292, 0, 0, 63971, 4347, 4416, 
+    42098, 11009, 10694, 63973, 402, 0, 13147, 128692, 42100, 64646, 13228, 
+    0, 41875, 3515, 74252, 11805, 0, 11302, 6259, 43395, 0, 0, 194670, 0, 
+    92351, 0, 74425, 11299, 1561, 0, 92359, 64942, 983559, 194733, 983686, 
+    194732, 0, 74301, 0, 11280, 0, 69784, 74060, 0, 0, 119664, 5145, 12486, 
+    65018, 66516, 5409, 127379, 194669, 7402, 5399, 9685, 74089, 7952, 5401, 
+    0, 66616, 68421, 983919, 0, 5405, 127875, 64866, 0, 119583, 128345, 
+    78784, 74248, 11330, 194723, 64690, 3254, 0, 0, 128207, 42390, 43678, 
+    194725, 983909, 65077, 0, 6388, 3355, 9508, 9867, 5723, 11520, 5611, 0, 
+    3377, 0, 0, 0, 0, 78228, 0, 983762, 42691, 917886, 127198, 74767, 0, 
+    127075, 1379, 246, 0, 983761, 3788, 983106, 11041, 92549, 66304, 0, 0, 
+    8917, 42403, 301, 0, 0, 0, 0, 0, 983697, 10656, 0, 65214, 119242, 42567, 
+    92217, 13163, 983204, 120831, 74597, 3182, 0, 0, 0, 65034, 65889, 42169, 
+    4755, 74244, 194621, 11443, 0, 66319, 74598, 608, 600, 0, 1219, 3934, 
+    64206, 11483, 74510, 0, 74485, 42442, 65470, 983907, 64202, 13160, 7759, 
+    42482, 485, 128006, 0, 9828, 0, 0, 42280, 0, 9351, 7778, 64379, 7496, 
+    42431, 6916, 1208, 0, 119631, 11002, 42470, 0, 118946, 0, 0, 74041, 0, 
+    70045, 43539, 5411, 42196, 0, 0, 0, 9150, 0, 42393, 13086, 1310, 194687, 
+    9337, 12052, 10643, 55271, 983179, 12166, 2546, 194683, 213, 118852, 
+    65611, 0, 0, 194756, 74310, 6554, 0, 11914, 5452, 0, 0, 0, 0, 0, 194681, 
+    92560, 2713, 0, 9650, 43330, 0, 194675, 1406, 0, 0, 92659, 0, 68223, 
+    4143, 194677, 0, 65748, 4141, 9682, 65287, 1508, 127013, 8779, 10569, 
+    8725, 13299, 66638, 65750, 42263, 4145, 6380, 65751, 66613, 43994, 65738, 
+    55250, 9185, 9550, 0, 43403, 0, 0, 0, 65736, 41951, 64816, 65756, 983205, 
+    12955, 10596, 2888, 194645, 0, 0, 9657, 9019, 194766, 0, 2878, 5390, 0, 
+    194961, 0, 68679, 43552, 7501, 6328, 0, 10429, 10365, 0, 0, 41946, 7503, 
+    5235, 803, 68381, 0, 0, 8986, 126542, 10632, 11934, 11452, 1332, 0, 0, 
+    126647, 0, 118887, 1791, 5191, 9288, 64822, 2892, 0, 43394, 555, 0, 0, 
+    66646, 0, 119002, 13151, 74512, 7289, 74055, 64161, 8854, 64162, 5858, 
+    41927, 10582, 0, 1784, 1361, 195047, 0, 7905, 0, 64868, 128813, 13158, 
+    92166, 7211, 0, 9371, 73973, 917553, 6828, 1625, 92302, 0, 1342, 68440, 
+    64171, 126704, 10903, 983494, 0, 0, 0, 0, 4482, 41606, 0, 128569, 983112, 
+    0, 64381, 0, 0, 195090, 42245, 126467, 41972, 0, 444, 0, 9127, 66687, 
+    66619, 126489, 78025, 0, 11349, 40991, 917570, 0, 119599, 120830, 0, 
+    1197, 128282, 1149, 194970, 0, 0, 40990, 43765, 0, 3492, 0, 127942, 0, 0, 
+    0, 12838, 983978, 19948, 0, 3099, 0, 0, 41087, 0, 0, 0, 119059, 12036, 
+    41309, 0, 0, 8152, 0, 41550, 12227, 983613, 0, 12828, 127511, 0, 0, 
+    120708, 0, 0, 10386, 119574, 0, 0, 92680, 983789, 68154, 0, 1743, 0, 0, 
+    92239, 65186, 917571, 0, 9606, 0, 0, 64439, 0, 0, 92686, 0, 0, 194967, 0, 
+    0, 3395, 9362, 10878, 0, 0, 78362, 64830, 0, 126557, 41091, 3426, 1344, 
+    8870, 0, 0, 4735, 127017, 6119, 12822, 42699, 0, 983824, 74818, 1423, 0, 
+    42637, 41080, 0, 12039, 10559, 0, 118892, 0, 9472, 0, 11929, 0, 7170, 
+    9596, 6130, 128826, 43629, 11579, 78713, 0, 194740, 128691, 92185, 66699, 
+    64440, 1004, 92584, 194737, 43234, 66008, 12627, 0, 68414, 0, 43619, 
+    43303, 11300, 43304, 9686, 5890, 11776, 7558, 127158, 65627, 0, 10718, 
+    13154, 3461, 9139, 0, 0, 0, 0, 65365, 73877, 65628, 78019, 120319, 0, 
+    41708, 12860, 2641, 12069, 10838, 5403, 10352, 70085, 10061, 43237, 0, 
+    5140, 209, 128847, 41704, 41056, 43078, 128125, 118809, 0, 10899, 65469, 
+    92362, 0, 0, 2410, 993, 0, 120589, 120689, 78693, 0, 0, 7232, 0, 119253, 
+    0, 7110, 74462, 2066, 10489, 42166, 43463, 10659, 3600, 0, 4224, 1336, 
+    41518, 0, 0, 0, 0, 41139, 64820, 92538, 12966, 41134, 0, 0, 0, 0, 272, 
+    4263, 8793, 0, 0, 41502, 0, 983, 12549, 0, 0, 1190, 4109, 1335, 841, 
+    5888, 41358, 64863, 9544, 43481, 0, 194806, 70027, 2099, 5120, 2409, 
+    7799, 0, 74424, 0, 0, 4731, 0, 66629, 0, 0, 1255, 4149, 9247, 0, 9913, 0, 
+    0, 64914, 917787, 65101, 0, 11694, 92475, 11690, 5835, 127164, 66625, 
+    10842, 41354, 42123, 43097, 11688, 66634, 1094, 194, 64692, 0, 8180, 0, 
+    0, 9972, 73865, 4519, 6114, 10898, 43072, 0, 0, 93960, 983322, 126581, 
+    10695, 0, 7540, 0, 881, 7857, 6067, 65164, 0, 0, 0, 13311, 68403, 41857, 
+    64321, 8359, 0, 12689, 0, 194594, 0, 983312, 983881, 68183, 0, 983314, 
+    1287, 5436, 0, 983317, 74142, 92328, 74152, 119078, 6051, 10497, 69668, 
+    8985, 12109, 983323, 0, 127242, 0, 0, 3652, 10537, 0, 1276, 120440, 6549, 
+    279, 73745, 0, 0, 0, 1489, 0, 0, 0, 3899, 1007, 42124, 983557, 42122, 
+    92337, 92367, 0, 11985, 1345, 78600, 0, 0, 8956, 43083, 94057, 42138, 
+    78610, 0, 12151, 78608, 78604, 78605, 6285, 78603, 78612, 78613, 65942, 
+    492, 8685, 0, 983759, 0, 78622, 43712, 2582, 11470, 64538, 7444, 78615, 
+    78616, 2297, 0, 73837, 119823, 2527, 119824, 197, 2799, 92594, 41944, 
+    120276, 9933, 0, 66515, 767, 5524, 7028, 0, 0, 119827, 119817, 119828, 
+    78633, 10896, 0, 1799, 120497, 6971, 74336, 128342, 0, 65340, 118979, 
+    41551, 2434, 94018, 0, 120579, 0, 4631, 0, 0, 6407, 0, 6338, 43214, 0, 
+    7570, 0, 3192, 0, 8414, 0, 93983, 0, 0, 0, 9164, 66612, 93959, 3171, 
+    6623, 4961, 68396, 886, 55216, 8654, 78832, 9993, 74390, 64603, 70066, 
+    69241, 9599, 78629, 43084, 78627, 78628, 78625, 2399, 69693, 8994, 10944, 
+    41208, 983713, 41168, 8178, 0, 3367, 92334, 42510, 78641, 78636, 6804, 
+    78634, 1947, 0, 0, 92681, 42759, 11068, 1705, 9331, 0, 74798, 9181, 
+    65359, 0, 8017, 119831, 65096, 66720, 0, 43475, 0, 4909, 12126, 128673, 
+    120696, 4904, 983333, 69650, 1365, 9253, 42757, 43436, 7462, 0, 0, 0, 0, 
+    119587, 64415, 0, 0, 5398, 0, 127386, 93953, 0, 0, 119015, 0, 0, 9476, 0, 
+    983777, 12763, 126603, 3629, 0, 13005, 0, 3628, 0, 0, 92502, 3469, 42107, 
+    42116, 917578, 64809, 2928, 4905, 9853, 851, 9040, 0, 64665, 43086, 9114, 
+    0, 42583, 9315, 4822, 4906, 3852, 2847, 119821, 3236, 11317, 1251, 7777, 
+    41852, 11410, 10964, 0, 43222, 12646, 120269, 10259, 9865, 65821, 0, 
+    6018, 92290, 0, 12276, 0, 68372, 0, 92259, 119244, 0, 983230, 10467, 0, 
+    2443, 10918, 78217, 119825, 1001, 9241, 1927, 0, 0, 73987, 127885, 0, 0, 
     118828, 120271, 65678, 12867, 0, 8260, 77945, 7519, 11505, 12274, 8904, 
     518, 65857, 0, 128674, 13204, 4387, 857, 0, 65369, 0, 92336, 43125, 
     120592, 0, 0, 0, 0, 5136, 1968, 983041, 126627, 1337, 64967, 1629, 0, 
@@ -18777,44 +18796,44 @@
     78698, 78697, 78696, 78695, 8710, 42495, 118956, 0, 4051, 10460, 43364, 
     118917, 1356, 12161, 42713, 128857, 127268, 1619, 9703, 43152, 42489, 
     42112, 127978, 1875, 10808, 42109, 120284, 41860, 64862, 13305, 64907, 
-    5289, 13144, 128658, 0, 5575, 9675, 0, 5940, 226, 2649, 6336, 983269, 
+    5289, 13144, 128658, 0, 5575, 9675, 0, 5940, 226, 2649, 6336, 983277, 
     119830, 43236, 3382, 42449, 6498, 1658, 11936, 78232, 0, 11269, 10151, 
     73759, 43100, 69888, 65508, 0, 0, 0, 8935, 917985, 0, 0, 0, 616, 74753, 
     65178, 4684, 78701, 119653, 0, 126551, 0, 6048, 74460, 42110, 73965, 
     10870, 8557, 11054, 68664, 119049, 9681, 4475, 0, 41142, 2100, 0, 120731, 
-    6035, 0, 7651, 10296, 64443, 0, 983287, 917987, 0, 118966, 74144, 40997, 
+    6035, 0, 7651, 10296, 64443, 0, 983295, 917987, 0, 118966, 74144, 40997, 
     0, 10392, 10328, 40998, 43462, 74488, 0, 9800, 8979, 0, 13307, 41000, 0, 
     119239, 6487, 3386, 0, 10344, 0, 65299, 5394, 43246, 78243, 10220, 66505, 
     41200, 128583, 4425, 0, 0, 0, 43074, 73799, 983200, 78147, 0, 12173, 
     78545, 0, 127011, 65338, 0, 0, 119582, 4474, 0, 43093, 128644, 1587, 0, 
-    127372, 64475, 128098, 1369, 983663, 9959, 7927, 0, 4560, 0, 0, 92277, 0, 
-    64948, 4430, 74347, 42601, 4514, 66434, 93955, 8194, 65462, 10626, 10965, 
-    0, 8893, 983293, 12542, 0, 65341, 0, 65829, 7925, 119822, 10475, 0, 0, 
-    1352, 11069, 7707, 127560, 126486, 65279, 127102, 68207, 127100, 7099, 
-    6040, 127097, 10071, 0, 9336, 43750, 0, 8899, 7798, 64474, 64259, 69873, 
-    65188, 7820, 43018, 127082, 0, 7746, 1492, 78551, 10884, 77982, 0, 5127, 
-    11285, 42501, 5495, 4273, 43095, 41426, 10849, 5730, 2999, 6342, 68636, 
-    74304, 371, 64373, 6023, 169, 5497, 11708, 0, 0, 6323, 194684, 8224, 0, 
-    8938, 6043, 12738, 0, 983076, 5321, 0, 194798, 0, 2589, 74332, 1689, 
-    7802, 4683, 74318, 42704, 120296, 11905, 0, 0, 128516, 128163, 74513, 
-    6049, 0, 4027, 834, 118962, 1803, 0, 1503, 0, 0, 71312, 5731, 1381, 2387, 
-    0, 0, 8289, 64525, 65817, 2881, 43142, 0, 9601, 2879, 9668, 9766, 0, 
-    5729, 917833, 74410, 6036, 64881, 4026, 9361, 127091, 2887, 0, 3526, 
-    6298, 0, 77897, 120095, 78519, 0, 8572, 6021, 77896, 128288, 77895, 
-    43155, 0, 119849, 3146, 10959, 9483, 0, 77893, 10981, 166, 917841, 8635, 
-    983606, 10623, 408, 119058, 127507, 13298, 0, 7426, 41641, 12717, 0, 
-    7607, 10639, 43396, 0, 0, 41643, 74134, 983054, 8713, 41640, 10221, 
-    41645, 66712, 6645, 646, 66726, 66711, 42129, 93994, 77901, 3472, 8697, 
-    0, 0, 983806, 0, 0, 0, 5809, 1950, 119356, 92432, 74572, 0, 42136, 0, 0, 
-    0, 0, 3247, 119854, 65017, 983944, 68428, 66668, 0, 0, 10983, 0, 0, 0, 
-    41567, 0, 0, 0, 194624, 119853, 0, 0, 8285, 0, 4509, 0, 66471, 12216, 0, 
-    40988, 92592, 74809, 41727, 0, 42848, 2396, 917766, 0, 74018, 917538, 
+    127372, 64475, 128098, 1369, 983672, 9959, 7927, 0, 4560, 0, 0, 92277, 
+    983621, 64948, 4430, 74347, 42601, 4514, 66434, 93955, 8194, 65462, 
+    10626, 10965, 0, 8893, 983301, 12542, 0, 65341, 0, 65829, 7925, 119822, 
+    10475, 0, 0, 1352, 11069, 7707, 127560, 126486, 65279, 127102, 68207, 
+    127100, 7099, 6040, 127097, 10071, 0, 9336, 43750, 0, 8899, 7798, 64474, 
+    64259, 69873, 65188, 7820, 43018, 127082, 0, 7746, 1492, 78551, 10884, 
+    77982, 0, 5127, 11285, 42501, 5495, 4273, 43095, 41426, 10849, 5730, 
+    2999, 6342, 68636, 74304, 371, 64373, 6023, 169, 5497, 11708, 0, 0, 6323, 
+    194684, 8224, 0, 8938, 6043, 12738, 0, 983076, 5321, 0, 194798, 0, 2589, 
+    74332, 1689, 7802, 4683, 74318, 42704, 120296, 11905, 0, 0, 128516, 
+    128163, 74513, 6049, 0, 4027, 834, 118962, 1803, 0, 1503, 0, 0, 71312, 
+    5731, 1381, 2387, 0, 0, 8289, 64525, 65817, 2881, 43142, 0, 9601, 2879, 
+    9668, 9766, 0, 5729, 917833, 74410, 6036, 64881, 4026, 9361, 127091, 
+    2887, 0, 3526, 6298, 0, 77897, 120095, 78519, 0, 8572, 6021, 77896, 
+    128288, 77895, 43155, 0, 119849, 3146, 10959, 9483, 0, 77893, 10981, 166, 
+    917841, 8635, 983606, 10623, 408, 119058, 127507, 13298, 0, 7426, 41641, 
+    12717, 0, 7607, 10639, 43396, 0, 0, 41643, 74134, 983054, 8713, 41640, 
+    10221, 41645, 66712, 6645, 646, 66726, 66711, 42129, 93994, 77901, 3472, 
+    8697, 0, 0, 983815, 0, 0, 0, 5809, 1950, 119356, 92432, 74572, 0, 42136, 
+    0, 0, 0, 0, 3247, 119854, 65017, 983953, 68428, 66668, 0, 0, 10983, 0, 0, 
+    0, 41567, 0, 0, 0, 194624, 119853, 0, 0, 8285, 0, 4509, 0, 66471, 12216, 
+    0, 40988, 92592, 74809, 41727, 0, 42848, 2396, 917766, 0, 74018, 917538, 
     64940, 7027, 3886, 0, 42457, 119008, 0, 996, 68123, 94058, 4249, 0, 
     917594, 11707, 8222, 0, 7939, 92454, 92460, 127801, 917592, 128359, 8534, 
-    127154, 40983, 0, 983234, 0, 7201, 12561, 0, 42371, 12558, 1540, 917549, 
+    127154, 40983, 0, 983240, 0, 7201, 12561, 0, 42371, 12558, 1540, 917549, 
     10052, 40982, 0, 0, 1488, 0, 0, 0, 917559, 0, 0, 1563, 128034, 9619, 
-    983931, 0, 0, 127872, 71363, 5803, 7797, 6070, 10006, 0, 2922, 6082, 0, 
-    65009, 983933, 12567, 128703, 0, 41412, 0, 0, 3607, 9200, 10046, 9612, 
+    983940, 0, 0, 127872, 71363, 5803, 7797, 6070, 10006, 0, 2922, 6082, 0, 
+    65009, 983942, 12567, 128703, 0, 41412, 0, 0, 3607, 9200, 10046, 9612, 
     42153, 8218, 9485, 0, 2032, 78354, 0, 0, 0, 0, 0, 43085, 6057, 508, 
     93968, 128015, 67968, 0, 92405, 0, 0, 638, 6083, 119072, 0, 0, 2305, 
     78348, 68096, 0, 6056, 6659, 67969, 0, 6085, 0, 0, 3915, 41634, 0, 41639, 
@@ -18822,15 +18841,15 @@
     12328, 501, 93985, 10601, 0, 583, 0, 41977, 0, 66004, 119350, 6505, 
     74010, 0, 13064, 55267, 120810, 6500, 5526, 65049, 0, 73764, 0, 92376, 
     12745, 9678, 0, 120587, 9869, 128815, 1771, 0, 8936, 0, 0, 4208, 78341, 
-    78567, 78342, 0, 983448, 74101, 0, 11762, 0, 92422, 77997, 68010, 66475, 
+    78567, 78342, 0, 983456, 74101, 0, 11762, 0, 92422, 77997, 68010, 66475, 
     0, 5027, 78172, 128878, 0, 5069, 73862, 5028, 9897, 0, 73739, 5026, 
-    983247, 68639, 6331, 10079, 8931, 0, 1415, 8866, 41901, 74790, 78138, 
+    983253, 68639, 6331, 10079, 8931, 0, 1415, 8866, 41901, 74790, 78138, 
     119361, 983564, 43106, 5029, 65309, 1580, 3598, 68424, 41070, 77903, 0, 
-    3440, 78215, 1562, 128656, 127175, 119358, 1716, 983670, 10600, 917867, 
+    3440, 78215, 1562, 128656, 127175, 119358, 1716, 983679, 10600, 917867, 
     620, 41001, 6028, 0, 42892, 0, 74822, 5024, 120829, 41003, 0, 5025, 
-    69892, 983207, 0, 118885, 0, 65557, 0, 74541, 983587, 11599, 128209, 
+    69892, 983209, 0, 118885, 0, 65557, 0, 74541, 983587, 11599, 128209, 
     11602, 6243, 11574, 11581, 11597, 11598, 6253, 6105, 11584, 74195, 11569, 
-    65275, 8906, 127096, 5755, 2636, 0, 10815, 11619, 2301, 41540, 7815, 
+    65275, 8906, 127096, 5755, 2636, 983227, 10815, 11619, 2301, 41540, 7815, 
     11616, 6979, 12080, 7721, 11604, 7869, 1592, 0, 42152, 78498, 41048, 
     917763, 829, 0, 92406, 19950, 0, 126482, 6616, 0, 118875, 10953, 391, 0, 
     69785, 482, 42296, 11588, 0, 43606, 0, 68397, 66370, 74506, 42335, 
@@ -18839,9 +18858,9 @@
     11337, 78209, 917820, 63989, 3958, 12132, 1849, 0, 9921, 42451, 4253, 
     41147, 42064, 11959, 42404, 41160, 0, 3618, 78338, 0, 43300, 5156, 92629, 
     0, 929, 6827, 42035, 42437, 1555, 0, 8691, 66435, 2215, 41662, 94010, 0, 
-    0, 0, 93952, 4578, 64513, 41664, 983725, 42578, 128794, 41661, 78715, 
+    0, 0, 93952, 4578, 64513, 41664, 983734, 42578, 128794, 41661, 78715, 
     43267, 9356, 0, 0, 0, 1286, 10166, 0, 0, 64707, 983127, 42476, 7730, 
-    983850, 128522, 42483, 0, 0, 42324, 42291, 10020, 43359, 0, 6641, 525, 
+    983859, 128522, 42483, 0, 0, 42324, 42291, 10020, 43359, 0, 6641, 525, 
     41627, 917923, 8763, 128304, 41628, 533, 11931, 65225, 8321, 42504, 
     42581, 0, 6915, 42310, 4377, 8559, 0, 74360, 0, 13193, 64350, 11666, 
     8679, 41924, 1576, 7735, 92398, 0, 73840, 983092, 11374, 78043, 10889, 
@@ -18859,24 +18878,24 @@
     8244, 362, 92439, 0, 8037, 43777, 11535, 0, 74845, 5185, 7165, 5521, 
     10334, 2093, 71329, 10302, 128112, 10104, 1027, 5181, 0, 0, 10523, 1446, 
     42320, 41646, 991, 5189, 42472, 41647, 120105, 1722, 5581, 42898, 3405, 
-    0, 194644, 5523, 0, 42620, 92447, 983810, 9549, 0, 10549, 55282, 9661, 
-    43682, 0, 77910, 120026, 78708, 0, 77911, 0, 41991, 983884, 0, 7630, 
+    0, 194644, 5523, 0, 42620, 92447, 983819, 9549, 0, 10549, 55282, 9661, 
+    43682, 0, 77910, 120026, 78708, 0, 77911, 0, 41991, 983893, 0, 7630, 
     9846, 7684, 10350, 0, 1174, 77981, 42733, 77978, 77980, 66485, 77977, 
     42277, 77974, 42456, 65667, 127037, 12330, 128272, 0, 42417, 42383, 
     66630, 41344, 6293, 0, 66252, 77984, 74443, 0, 10209, 8313, 4195, 74435, 
-    1316, 66690, 120032, 6332, 64894, 0, 65871, 78060, 1736, 983675, 3901, 
+    1316, 66690, 120032, 6332, 64894, 0, 65871, 78060, 1736, 983684, 3901, 
     12228, 120151, 65200, 3383, 10446, 78841, 693, 9130, 314, 64149, 42420, 
-    11949, 983660, 120152, 11026, 128788, 5332, 6940, 64154, 12635, 127007, 
+    11949, 983669, 120152, 11026, 128788, 5332, 6940, 64154, 12635, 127007, 
     42706, 1751, 273, 8165, 13166, 120763, 78840, 71368, 12824, 0, 4528, 
     5320, 6301, 43662, 6133, 9339, 9463, 42346, 10922, 64560, 3757, 0, 0, 0, 
-    65869, 73760, 2569, 0, 2326, 65740, 2565, 42459, 7596, 7921, 983859, 
-    74095, 127981, 41848, 2567, 66006, 0, 4044, 92646, 0, 12233, 983862, 
+    65869, 73760, 2569, 0, 2326, 65740, 2565, 42459, 7596, 7921, 983868, 
+    74095, 127981, 41848, 2567, 66006, 0, 4044, 92646, 0, 12233, 983871, 
     1023, 474, 0, 119818, 0, 0, 42487, 65556, 0, 127866, 42295, 0, 0, 71322, 
     92518, 9835, 66499, 0, 5417, 12275, 10895, 0, 274, 0, 1858, 0, 0, 55251, 
     10118, 3133, 128008, 73795, 0, 9610, 8068, 8197, 0, 699, 0, 41665, 5868, 
     0, 92695, 42182, 7581, 19940, 43668, 41667, 128057, 0, 1923, 65583, 
     65802, 93970, 64597, 43444, 119184, 92197, 0, 6464, 7036, 2996, 1937, 
-    983742, 0, 41835, 4047, 41842, 0, 64107, 0, 0, 11017, 120601, 0, 293, 
+    983751, 0, 41835, 4047, 41842, 0, 64107, 0, 0, 11017, 120601, 0, 293, 
     77966, 92169, 64791, 41827, 42466, 43422, 10579, 8560, 71350, 65413, 
     77963, 4803, 12964, 1739, 1941, 3900, 0, 1713, 77969, 0, 73957, 11407, 
     42441, 41971, 6297, 120098, 64105, 128080, 42481, 11716, 66473, 7179, 
@@ -18894,337 +18913,338 @@
     3659, 9533, 184, 1553, 13107, 65484, 69648, 10502, 74457, 0, 0, 41554, 0, 
     8220, 917943, 41557, 0, 0, 11070, 119221, 5157, 4020, 73858, 41555, 9514, 
     64818, 65103, 64641, 64303, 78131, 7520, 0, 74377, 11029, 66651, 983068, 
-    0, 118930, 64527, 0, 7877, 73803, 983789, 127348, 120096, 74602, 9955, 
+    0, 118930, 64527, 0, 7877, 73803, 983798, 127348, 120096, 74602, 9955, 
     119557, 4055, 42817, 0, 65212, 11715, 12190, 12319, 78630, 0, 78631, 
     9502, 65427, 0, 65424, 12607, 0, 9734, 65425, 0, 0, 127357, 78835, 92410, 
     10112, 10827, 0, 9866, 74527, 66675, 0, 8625, 64346, 11290, 10477, 0, 
-    8636, 983918, 8315, 65444, 983784, 0, 74595, 6152, 0, 0, 6629, 127108, 
+    8636, 983927, 8315, 65444, 983793, 0, 74595, 6152, 0, 0, 6629, 127108, 
     120171, 0, 74589, 43993, 0, 69790, 64435, 0, 43690, 11046, 11490, 42730, 
     4485, 127107, 0, 64926, 0, 0, 0, 5869, 12437, 42728, 0, 7040, 3588, 0, 
-    12825, 0, 0, 12725, 0, 0, 78642, 223, 0, 69675, 120166, 42444, 0, 64499, 
-    65245, 0, 1171, 0, 69717, 0, 1805, 8772, 43820, 0, 9930, 65247, 78619, 
-    120111, 2338, 0, 118853, 0, 42676, 0, 64800, 65236, 67644, 68126, 1213, 
-    0, 64075, 797, 64074, 8734, 4212, 127369, 64387, 4115, 0, 5005, 64070, 
-    64073, 10679, 0, 77954, 9402, 64276, 426, 0, 0, 8251, 10136, 65436, 0, 
-    2120, 43302, 1224, 0, 65576, 74192, 10701, 1764, 3101, 127815, 12858, 
-    120159, 0, 11373, 6378, 127859, 120103, 8663, 9312, 41644, 4539, 2129, 0, 
-    9222, 983729, 0, 4259, 9092, 74567, 41961, 0, 12724, 66357, 42331, 64935, 
-    0, 0, 1293, 7947, 2132, 983758, 74593, 120308, 2454, 42717, 3613, 128837, 
-    0, 0, 65888, 8816, 10978, 10840, 0, 10668, 0, 43087, 12595, 120304, 
-    983114, 8822, 0, 1157, 64903, 8638, 0, 0, 0, 0, 69848, 8235, 120316, 
-    4405, 10086, 120247, 0, 69216, 0, 65430, 71321, 6079, 6817, 10764, 
-    127910, 64291, 128051, 998, 120312, 11062, 1317, 64327, 1558, 0, 1991, 
-    7882, 42254, 0, 41700, 530, 0, 10428, 119335, 12002, 119336, 5742, 43076, 
-    4692, 64630, 41823, 4007, 5004, 119334, 7896, 751, 6595, 6596, 120325, 
-    66373, 0, 0, 64908, 92691, 6311, 0, 12004, 119192, 12049, 43108, 120326, 
-    0, 41705, 92188, 6598, 0, 6599, 120334, 0, 42148, 118825, 66027, 0, 6597, 
-    9412, 8340, 11824, 64745, 2281, 69904, 0, 1988, 5407, 67865, 2430, 41678, 
-    0, 120243, 2336, 983894, 0, 78871, 120442, 983760, 1921, 10947, 19927, 0, 
-    65406, 0, 19913, 4284, 13217, 0, 43789, 12841, 9229, 10956, 42285, 41674, 
-    19964, 41679, 65084, 3521, 0, 5774, 8325, 0, 65403, 983089, 1854, 10794, 
-    0, 67660, 69846, 0, 78359, 5280, 0, 4344, 12905, 65433, 6076, 64793, 
-    41610, 768, 12074, 442, 0, 68162, 64081, 12934, 41682, 65432, 41693, 0, 
-    6071, 65434, 127467, 4804, 4053, 0, 127469, 194653, 41696, 467, 69823, 
-    127463, 69797, 194652, 127473, 8421, 127472, 69682, 43705, 502, 0, 65431, 
-    119056, 69954, 12043, 1303, 316, 7364, 2029, 2136, 119246, 11533, 64365, 
-    43480, 92639, 4860, 126648, 127877, 42488, 0, 9583, 128849, 5546, 8019, 
-    73856, 0, 0, 0, 5544, 2355, 12150, 65725, 5543, 77989, 63751, 12137, 
-    5548, 77985, 0, 65727, 68388, 65726, 6077, 128352, 65452, 0, 11301, 
-    78013, 78008, 78010, 9874, 78007, 0, 1319, 3050, 65410, 0, 0, 78016, 
-    78017, 42830, 43996, 66716, 128137, 4691, 92242, 9345, 621, 92709, 
-    128222, 0, 65411, 0, 41182, 73881, 65408, 73899, 78024, 9474, 10545, 
-    119118, 10887, 3786, 65409, 8894, 43179, 119611, 7923, 3716, 92363, 9996, 
-    8508, 0, 7012, 8195, 127834, 9566, 0, 3722, 0, 41707, 8493, 545, 9575, 
-    41379, 10050, 12718, 69854, 8859, 6820, 74345, 65110, 120740, 0, 0, 9119, 
-    2787, 7920, 118823, 4021, 2012, 7985, 0, 119663, 0, 0, 78021, 78022, 410, 
-    78020, 1802, 78018, 74107, 0, 41659, 41671, 1827, 0, 64396, 10126, 12116, 
-    41673, 120370, 11422, 78141, 120373, 3860, 120367, 68412, 41345, 120362, 
-    120363, 11748, 42158, 7941, 11076, 8749, 120361, 2104, 64858, 361, 
-    120357, 845, 0, 41560, 11970, 4562, 917920, 2926, 917919, 4569, 74130, 0, 
-    43487, 194630, 611, 74129, 64871, 118891, 65629, 0, 194858, 0, 0, 127545, 
-    120543, 0, 0, 6291, 0, 78639, 41669, 7094, 917921, 0, 983581, 74054, 
-    127754, 195029, 0, 839, 983311, 7695, 8769, 65246, 4829, 194663, 4859, 
-    64467, 0, 983954, 118998, 7206, 0, 6647, 43986, 0, 69766, 0, 64764, 4210, 
-    983854, 127936, 804, 0, 0, 12298, 0, 66653, 0, 64924, 10091, 73931, 9468, 
-    74245, 0, 0, 74246, 92503, 12839, 64669, 92202, 0, 1279, 1425, 6224, 
-    119229, 11049, 0, 92697, 43239, 8482, 92440, 0, 5032, 69677, 11940, 
-    67888, 664, 120437, 5034, 0, 0, 127525, 42702, 73888, 983149, 13294, 
-    67873, 64869, 6032, 0, 9115, 7430, 120377, 0, 120819, 68387, 120168, 
-    73913, 120170, 41161, 5518, 4174, 10993, 41162, 120160, 64528, 1169, 434, 
-    41437, 1905, 6034, 41164, 64744, 9528, 118867, 128800, 524, 0, 74029, 
-    788, 74027, 0, 194638, 0, 1663, 10419, 74025, 42636, 0, 69725, 0, 120656, 
-    0, 67876, 0, 0, 0, 67897, 74039, 0, 0, 11395, 0, 119107, 43612, 64344, 0, 
-    0, 10855, 5445, 9355, 0, 65198, 7391, 8989, 221, 65686, 0, 0, 8010, 7191, 
-    4962, 69772, 8855, 0, 0, 64469, 120426, 10555, 0, 43333, 92299, 0, 
-    120427, 10451, 0, 67653, 7245, 12443, 74405, 9947, 120149, 78317, 3873, 
-    8367, 0, 120146, 43433, 43649, 11987, 0, 0, 11010, 12723, 74059, 74062, 
-    6217, 5896, 0, 7682, 74049, 1462, 10235, 0, 0, 0, 0, 0, 0, 42595, 0, 
-    74402, 118860, 0, 120419, 92497, 74052, 0, 92378, 120549, 119082, 64295, 
-    120418, 0, 64765, 73923, 120417, 120662, 69920, 194702, 6216, 0, 10755, 
-    9455, 0, 8124, 127042, 9470, 6944, 127540, 0, 69680, 2828, 0, 531, 42638, 
-    0, 0, 0, 43428, 8204, 3614, 2827, 9696, 0, 0, 8728, 4354, 10904, 78562, 
-    19936, 7833, 120691, 0, 42599, 42597, 42709, 120409, 127044, 0, 8537, 0, 
-    0, 9354, 983164, 128833, 41199, 10121, 2028, 0, 983194, 69715, 0, 3062, 
-    0, 74447, 12608, 0, 66440, 7545, 9700, 12580, 92205, 120777, 120502, 
-    41155, 0, 74071, 0, 983449, 12713, 0, 0, 0, 78772, 0, 1734, 0, 0, 127040, 
-    64594, 2456, 231, 0, 74167, 542, 0, 118786, 0, 983970, 1230, 0, 0, 3597, 
-    4446, 10584, 74235, 92215, 4037, 127938, 8352, 0, 5687, 0, 64515, 0, 
-    194801, 55265, 67846, 78434, 9704, 0, 0, 70080, 71338, 0, 8660, 126495, 
-    0, 0, 78773, 74482, 4483, 1709, 69721, 9909, 6080, 0, 120358, 1746, 1315, 
-    8667, 0, 0, 13140, 65899, 10604, 0, 4480, 11266, 128152, 1226, 6930, 
-    67979, 983681, 6360, 10897, 41230, 605, 0, 74785, 69875, 0, 0, 41500, 0, 
-    311, 11453, 6221, 10608, 64943, 74280, 10877, 118868, 64885, 74272, 0, 0, 
-    128559, 120736, 74312, 345, 0, 74456, 64606, 9917, 0, 92231, 5037, 0, 
-    1776, 8422, 0, 118814, 41508, 41201, 323, 43328, 0, 42698, 1295, 194853, 
-    4625, 0, 4630, 13117, 0, 128772, 65123, 11293, 2668, 11288, 0, 42640, 
-    65666, 2519, 92369, 65420, 92479, 0, 4252, 5049, 42659, 119011, 706, 
-    7754, 10854, 8738, 0, 65419, 0, 0, 649, 65421, 0, 66702, 0, 12670, 1013, 
-    0, 64919, 705, 0, 65422, 127803, 1183, 126519, 7017, 42852, 0, 8157, 
-    9736, 64503, 65418, 0, 983869, 74035, 0, 11913, 73874, 6696, 0, 8920, 
-    119298, 0, 7962, 12211, 9837, 2051, 66227, 0, 4184, 0, 0, 10177, 73777, 
-    1857, 194657, 4626, 8464, 8472, 0, 4629, 8499, 78321, 78322, 4624, 7818, 
-    119173, 0, 0, 7805, 0, 94007, 6935, 92292, 78325, 78326, 78323, 43327, 
-    43989, 119046, 8492, 8250, 8459, 0, 8497, 8496, 0, 0, 78336, 78339, 9543, 
-    78335, 78332, 77832, 65849, 77831, 983952, 0, 12451, 0, 8684, 0, 6102, 0, 
-    5298, 0, 5294, 0, 0, 983451, 195062, 9949, 119826, 43617, 119215, 0, 
-    12073, 0, 0, 77863, 13108, 120617, 11439, 41468, 983748, 0, 5292, 55272, 
-    983874, 1939, 5302, 3970, 917879, 12455, 1793, 0, 0, 0, 6643, 92477, 
-    65263, 0, 78330, 41293, 78328, 65923, 0, 13219, 9569, 0, 74383, 0, 74197, 
-    0, 5500, 8813, 0, 0, 74566, 5322, 0, 78340, 43631, 5324, 66443, 3784, 
-    41614, 65269, 6230, 78349, 78345, 43324, 3360, 78344, 11523, 0, 92488, 
-    9926, 7197, 0, 68429, 42894, 41821, 1249, 78360, 78361, 78356, 78358, 
-    78353, 64899, 64763, 41149, 41807, 43162, 41815, 41150, 0, 10571, 10096, 
-    0, 0, 78074, 6947, 41152, 887, 9249, 6565, 78510, 41990, 78509, 41811, 
-    74466, 93966, 6670, 77882, 0, 0, 43092, 43325, 0, 10168, 0, 9781, 128655, 
-    9190, 0, 9666, 8269, 65944, 74005, 13019, 11670, 69860, 315, 12813, 
-    983450, 78432, 78256, 78351, 78352, 0, 983648, 0, 0, 1378, 9509, 0, 0, 
-    74475, 3066, 92220, 67847, 0, 92355, 0, 78365, 8787, 120379, 194616, 
-    41618, 194615, 78261, 194614, 0, 64652, 0, 194612, 0, 78366, 42088, 0, 
-    195061, 7176, 43756, 10137, 6121, 10995, 78259, 74534, 8119, 64874, 
-    917816, 127199, 194939, 0, 74525, 0, 0, 12930, 1394, 74514, 0, 74515, 0, 
-    118804, 2998, 9527, 120659, 65190, 12977, 42090, 119165, 0, 119100, 
-    41236, 92235, 42005, 42003, 41237, 5848, 0, 0, 3670, 128657, 194600, 0, 
-    0, 7890, 0, 11298, 43315, 0, 6229, 1593, 0, 0, 619, 4635, 65080, 0, 
-    128002, 4120, 65337, 65336, 0, 11808, 119214, 74115, 9366, 42790, 42006, 
-    119115, 65327, 65326, 65325, 10757, 1507, 42216, 65321, 65320, 65335, 
-    65334, 65333, 65332, 65331, 42059, 65329, 42689, 92427, 9128, 94045, 
-    42073, 6785, 64590, 983821, 4371, 7196, 65318, 2035, 65316, 4106, 65314, 
-    65313, 42074, 127847, 41228, 0, 65609, 41241, 7903, 41239, 43533, 78459, 
-    7189, 0, 0, 0, 12357, 42802, 78450, 8487, 9131, 0, 4615, 12695, 127752, 
-    0, 12175, 0, 64535, 0, 7809, 0, 0, 562, 12169, 6590, 69762, 66455, 64738, 
-    3219, 68654, 983778, 0, 1037, 0, 2025, 128263, 13098, 78442, 10637, 4568, 
-    549, 1570, 0, 2835, 0, 10624, 43623, 11072, 127191, 0, 0, 12606, 78433, 
-    2825, 0, 10825, 8079, 2821, 41046, 92327, 7365, 983744, 120593, 13071, 0, 
-    452, 41049, 42840, 6346, 2831, 5461, 74596, 11465, 5212, 0, 64703, 
-    119191, 42308, 7181, 0, 41332, 0, 12333, 0, 1668, 0, 0, 0, 1187, 983377, 
-    42628, 78575, 0, 128777, 0, 3240, 128518, 12194, 0, 11591, 41065, 5323, 
-    8166, 0, 0, 0, 74535, 1623, 65297, 128856, 571, 0, 4918, 0, 5288, 127295, 
-    8916, 65048, 1909, 8864, 0, 0, 10736, 92508, 11571, 7615, 127300, 92296, 
-    4237, 92576, 1035, 65815, 0, 7881, 701, 65936, 3489, 0, 0, 120751, 11403, 
-    0, 0, 127146, 3796, 6800, 0, 3994, 11421, 0, 195076, 0, 983913, 0, 0, 
-    64857, 128105, 2855, 127828, 66308, 41621, 68214, 127283, 127817, 10654, 
-    0, 119226, 12164, 3246, 7906, 43972, 65847, 7182, 0, 13024, 194822, 
-    74270, 128289, 0, 0, 0, 1496, 747, 0, 942, 2378, 43136, 127905, 8466, 
-    983575, 9320, 8001, 1232, 8139, 11617, 0, 0, 11409, 68373, 6382, 0, 
-    64634, 128279, 0, 11612, 0, 67600, 2374, 94066, 8475, 11609, 66313, 0, 0, 
-    5286, 119297, 0, 0, 64925, 120283, 194584, 118982, 194583, 7705, 11942, 
-    11305, 194581, 3309, 0, 0, 0, 0, 6802, 0, 41653, 1280, 1241, 7168, 12096, 
-    0, 66615, 42565, 41651, 0, 0, 0, 41650, 66507, 66470, 0, 12914, 41491, 
-    66010, 119552, 6078, 9954, 0, 1475, 119247, 9938, 6084, 917546, 41064, 
-    41062, 0, 0, 3256, 10189, 42076, 43252, 78823, 917906, 8727, 0, 65875, 0, 
-    0, 127762, 10562, 74215, 43065, 0, 0, 3248, 74297, 3261, 9015, 71351, 0, 
-    3635, 64337, 983273, 0, 0, 7195, 0, 2007, 64431, 0, 0, 0, 0, 635, 0, 0, 
-    65613, 77909, 92420, 73997, 0, 0, 119218, 7984, 8600, 74434, 127770, 
-    4176, 70050, 2034, 92551, 120805, 65891, 127038, 0, 318, 2038, 128860, 
-    78596, 0, 3649, 13149, 42145, 42798, 3634, 120291, 118927, 67677, 120124, 
-    7866, 0, 11402, 42146, 94032, 74238, 42664, 2849, 127034, 0, 7938, 12960, 
-    1761, 11812, 65379, 68386, 128185, 1159, 0, 69729, 0, 0, 7178, 194632, 0, 
-    41680, 0, 128203, 11534, 1514, 11668, 67891, 9313, 7015, 0, 67877, 
-    194567, 12989, 66474, 9368, 12848, 1624, 43270, 0, 74278, 10818, 126644, 
-    9953, 0, 78421, 1194, 3242, 9761, 9555, 8598, 120299, 6169, 12871, 1551, 
-    2798, 65176, 4958, 42752, 119025, 0, 67875, 120301, 3495, 66648, 194768, 
-    0, 68364, 983222, 4891, 0, 10641, 0, 73746, 0, 68352, 0, 73787, 194829, 
-    194633, 7199, 64955, 0, 0, 0, 0, 0, 42685, 42679, 193, 0, 0, 0, 42667, 0, 
-    5271, 92318, 92517, 118882, 1362, 13297, 0, 128094, 0, 983323, 73789, 0, 
-    6658, 4426, 0, 92628, 983833, 92319, 7276, 42163, 5220, 0, 0, 983322, 
-    2416, 3310, 42703, 0, 379, 0, 43755, 0, 0, 3223, 65492, 1284, 194771, 
-    4549, 0, 0, 983154, 127763, 10807, 9558, 194613, 0, 8515, 8688, 12866, 
-    65308, 3294, 983324, 8529, 128101, 43385, 7564, 0, 43329, 0, 92458, 
-    73757, 66456, 42359, 0, 2031, 0, 7202, 0, 12676, 42729, 92198, 3215, 0, 
-    7710, 1610, 73801, 0, 0, 65682, 0, 120537, 65924, 9974, 228, 66354, 1501, 
-    0, 64395, 5179, 7200, 6225, 0, 65794, 1725, 65533, 8196, 7476, 74399, 0, 
-    0, 7152, 8502, 5762, 1967, 7483, 0, 0, 8104, 0, 7474, 77979, 0, 126507, 
-    10414, 13001, 8141, 0, 42537, 1557, 43594, 128642, 6330, 6805, 8631, 
-    2545, 70052, 127166, 0, 74190, 0, 0, 983777, 42762, 0, 42914, 1650, 262, 
-    1637, 0, 7901, 3238, 128173, 41861, 0, 128585, 65158, 10860, 94059, 
-    43658, 7527, 0, 43319, 6419, 0, 45, 0, 64588, 93989, 0, 119810, 7194, 
-    5291, 0, 43666, 13129, 0, 9084, 0, 8737, 0, 12881, 0, 12906, 9639, 7912, 
-    2620, 0, 0, 0, 983866, 179, 65896, 0, 64756, 2853, 78443, 118813, 983881, 
-    118996, 119009, 2850, 8084, 983085, 73850, 2801, 92284, 42069, 119839, 
-    74754, 119841, 42072, 119843, 119842, 10398, 983056, 0, 8377, 127116, 
-    8245, 68401, 3158, 92396, 3983, 43656, 923, 119857, 119856, 292, 13002, 
-    119845, 119844, 3221, 1763, 92463, 4612, 119851, 119850, 7253, 127110, 
-    68391, 0, 10782, 3637, 12996, 43542, 0, 64578, 983666, 3228, 69636, 8783, 
-    0, 119614, 2731, 0, 0, 78585, 4102, 7696, 73878, 0, 0, 78586, 43316, 
-    4177, 11283, 9089, 0, 73996, 983173, 64500, 43674, 0, 64947, 1856, 0, 0, 
-    6379, 0, 0, 0, 3208, 12975, 74775, 127380, 983922, 92389, 74072, 55269, 
-    0, 0, 983674, 2033, 78577, 78576, 195026, 55254, 7740, 0, 0, 0, 73964, 0, 
-    93988, 67612, 65674, 128244, 94110, 41689, 0, 74006, 64909, 6646, 11790, 
-    74019, 0, 128066, 128031, 8561, 4573, 0, 5326, 0, 120605, 7230, 8257, 0, 
-    8778, 41688, 0, 65776, 2071, 8314, 6459, 0, 7628, 65092, 73903, 66721, 
-    11342, 128561, 0, 0, 128226, 127001, 0, 11810, 13164, 10723, 967, 983942, 
-    126469, 11946, 0, 3257, 0, 12307, 1845, 983157, 43526, 0, 0, 1886, 42342, 
-    10089, 870, 7648, 3499, 8609, 7652, 876, 871, 877, 0, 878, 42015, 879, 
-    43692, 4563, 0, 0, 7591, 65887, 867, 9520, 872, 126607, 868, 873, 7642, 
-    0, 869, 874, 7644, 120674, 875, 790, 128303, 0, 0, 0, 66182, 983250, 
-    5429, 195055, 66180, 126480, 66181, 68452, 983281, 983242, 42067, 0, 
-    5433, 10657, 7911, 194622, 1547, 66176, 42012, 120576, 5425, 4977, 9999, 
-    5317, 5423, 4611, 0, 67637, 0, 9679, 74122, 0, 0, 0, 66194, 4418, 66184, 
-    4628, 4245, 119648, 0, 0, 1851, 0, 127189, 11908, 0, 9360, 118897, 
-    983270, 42776, 66187, 12837, 8829, 7711, 92714, 0, 92321, 43318, 0, 8809, 
-    69881, 0, 983142, 120604, 983052, 983873, 0, 983262, 0, 0, 7427, 9958, 
-    4588, 43680, 0, 74484, 194968, 2433, 0, 119622, 3352, 74363, 983876, 0, 
-    793, 74404, 0, 305, 567, 67662, 842, 128519, 8208, 0, 41695, 1647, 
-    118877, 0, 7837, 917625, 818, 5337, 194628, 917621, 41376, 119978, 
-    126576, 120594, 74086, 917615, 917614, 917613, 10973, 66359, 1372, 
-    127172, 917608, 4969, 1254, 917605, 917604, 93967, 917602, 65228, 78221, 
-    126612, 0, 2840, 0, 119982, 983930, 0, 3245, 9068, 68194, 64725, 0, 0, 
-    12991, 0, 2651, 68016, 983257, 917611, 127026, 128883, 0, 0, 43648, 
-    120812, 0, 43322, 92662, 0, 0, 64372, 92698, 3226, 655, 752, 7457, 7456, 
-    7452, 3285, 128779, 127821, 119988, 65610, 2391, 0, 92248, 671, 250, 
-    7434, 618, 668, 610, 42800, 7431, 1152, 42801, 640, 120666, 7448, 7439, 
-    628, 3905, 73810, 0, 128266, 64749, 67850, 2107, 0, 0, 4605, 128174, 
-    983192, 43372, 65945, 128838, 0, 119590, 0, 0, 0, 987, 6927, 11572, 
-    42261, 11464, 3365, 9971, 0, 0, 128297, 0, 0, 0, 0, 11334, 43326, 12609, 
-    11519, 11503, 5530, 5210, 0, 4627, 983883, 5208, 0, 128842, 10332, 5218, 
-    7976, 9156, 0, 3244, 5529, 69647, 73894, 128852, 5432, 64965, 5527, 
-    74033, 10516, 7790, 5528, 0, 42140, 120281, 0, 0, 43545, 9887, 0, 4000, 
-    7429, 7428, 665, 7424, 3206, 120278, 7884, 0, 128566, 917989, 128666, 
-    211, 2509, 128858, 120573, 68672, 3220, 42235, 0, 10690, 8951, 5214, 
-    42474, 8118, 0, 7048, 4590, 127258, 5852, 0, 0, 127259, 1708, 0, 983165, 
-    2623, 11943, 0, 69226, 0, 4698, 66509, 1066, 119921, 4701, 983867, 
-    120285, 74225, 94111, 8267, 0, 127265, 0, 7516, 0, 2625, 983968, 8034, 
-    74309, 0, 3631, 10955, 7850, 120293, 8416, 0, 0, 0, 43384, 12660, 0, 0, 
-    0, 74850, 41069, 0, 128156, 12099, 4310, 10032, 6252, 713, 7990, 0, 3990, 
-    0, 983254, 66368, 5017, 64956, 7071, 0, 119144, 1030, 118800, 983120, 
-    9513, 41059, 9357, 0, 1773, 0, 120350, 0, 6339, 7745, 9844, 0, 64650, 94, 
-    1880, 74766, 983829, 8908, 0, 128707, 65913, 78470, 10752, 13003, 0, 
-    126572, 41307, 8732, 120338, 0, 1757, 6964, 4696, 0, 120335, 64785, 7394, 
-    3641, 5419, 128055, 0, 127883, 0, 120344, 43988, 0, 8610, 43062, 7592, 
-    856, 74299, 936, 13289, 69894, 43171, 1459, 0, 65243, 78638, 19953, 0, 
-    1504, 70064, 0, 12913, 74206, 7529, 0, 128699, 983948, 120782, 4113, 0, 
-    2372, 336, 0, 7509, 12152, 0, 682, 66458, 41505, 0, 64743, 10593, 1703, 
-    0, 983946, 8033, 69953, 0, 9810, 127269, 0, 12970, 0, 42351, 10109, 
-    917623, 0, 194693, 0, 92690, 0, 0, 74291, 1965, 7069, 43312, 0, 73887, 0, 
-    2087, 64370, 6314, 41714, 8501, 0, 0, 74239, 41317, 92614, 2091, 74545, 
-    2090, 0, 9353, 7117, 2077, 77886, 0, 10498, 2083, 77888, 0, 0, 119236, 
-    634, 0, 0, 0, 69779, 4165, 8746, 0, 9654, 12856, 6924, 0, 7066, 983710, 
-    0, 128135, 41037, 42692, 7786, 12959, 41039, 127483, 0, 680, 2302, 
-    128200, 1181, 7056, 3174, 126516, 0, 92668, 65665, 127375, 126506, 6920, 
-    0, 92295, 0, 118965, 0, 64644, 126981, 74119, 0, 41028, 0, 6231, 2613, 
-    65302, 40989, 0, 194696, 0, 42760, 0, 983566, 0, 40987, 4667, 0, 983923, 
-    8828, 0, 0, 1246, 4746, 0, 0, 11021, 4749, 92675, 0, 921, 4744, 0, 12702, 
-    242, 0, 1566, 8217, 0, 64653, 78386, 128121, 74036, 74505, 43274, 5313, 
-    951, 0, 0, 983858, 7604, 983282, 4009, 127816, 983701, 120562, 0, 983711, 
-    64860, 119138, 119069, 0, 127370, 4048, 983598, 0, 70024, 1646, 77890, 
-    64534, 73995, 120705, 0, 119890, 2579, 119905, 3177, 11357, 9099, 4107, 
-    3441, 119894, 2975, 74442, 9822, 983926, 55220, 10084, 73943, 118840, 0, 
-    917562, 194610, 3399, 9851, 983708, 11909, 9059, 0, 7687, 0, 6789, 0, 0, 
-    0, 71367, 0, 0, 1777, 9151, 1137, 69767, 749, 42366, 0, 5385, 128574, 
-    128218, 0, 0, 5989, 0, 0, 128091, 0, 41685, 69223, 0, 9769, 41684, 
-    983214, 519, 0, 11740, 5766, 0, 0, 2600, 8848, 120138, 41297, 0, 3666, 
-    74473, 41300, 74468, 65160, 0, 69688, 69771, 74479, 0, 6558, 0, 0, 69765, 
-    120750, 252, 0, 41302, 0, 0, 0, 69763, 0, 11729, 8719, 9060, 0, 120139, 
-    10761, 0, 0, 0, 118792, 11734, 983221, 11730, 0, 9593, 5757, 2403, 64808, 
-    55275, 0, 11728, 43572, 0, 0, 7764, 983705, 11094, 120825, 0, 0, 4282, 
-    8298, 0, 0, 0, 0, 0, 64449, 0, 126650, 63854, 8456, 0, 74783, 65670, 0, 
-    78250, 0, 7774, 10607, 9792, 0, 0, 0, 0, 120764, 0, 10019, 74762, 0, 
-    3458, 4365, 70053, 983703, 3647, 0, 2602, 128341, 0, 194707, 41135, 0, 0, 
-    0, 64631, 172, 4971, 41219, 41137, 1889, 7238, 6545, 126476, 92193, 7597, 
-    10528, 0, 0, 3732, 73910, 194588, 5344, 0, 43366, 43363, 9062, 119252, 0, 
-    0, 0, 64479, 9232, 92596, 0, 0, 194712, 10900, 41531, 1263, 3720, 12048, 
-    0, 64292, 41524, 7227, 119635, 6099, 41534, 0, 127354, 127345, 299, 
-    917957, 8525, 127347, 3524, 917565, 8831, 127349, 92564, 3075, 67867, 
-    127352, 0, 66362, 0, 64353, 0, 0, 5845, 0, 0, 0, 2581, 8200, 65114, 
-    68460, 0, 43283, 5551, 0, 120735, 0, 6340, 118855, 0, 78134, 8680, 7204, 
-    70065, 2588, 2914, 7011, 55281, 0, 2471, 194631, 2883, 2749, 119563, 
-    73774, 10913, 0, 0, 8666, 675, 42493, 0, 43571, 0, 6219, 0, 9980, 41232, 
-    10928, 0, 41153, 41229, 118967, 0, 3738, 94016, 0, 12711, 3181, 66212, 
-    74289, 68472, 42857, 8262, 983371, 0, 983220, 0, 42347, 12092, 9615, 
-    7234, 74047, 983088, 0, 43744, 0, 0, 73846, 2934, 12722, 120762, 922, 
-    43983, 74507, 983126, 74461, 3218, 120471, 74290, 120469, 64562, 120475, 
-    8569, 11404, 11932, 73728, 3214, 120461, 120468, 12128, 3207, 65486, 
-    78729, 1901, 78727, 127326, 120460, 7425, 3205, 68003, 78737, 78736, 
-    78735, 43383, 69940, 65459, 2606, 78730, 73897, 0, 11496, 1173, 0, 41272, 
-    119661, 0, 0, 983313, 120737, 0, 983962, 983312, 378, 2610, 0, 65079, 
-    983317, 65695, 126559, 37, 7068, 0, 120480, 120479, 3209, 120477, 0, 
-    10638, 9768, 69952, 119909, 983391, 0, 0, 0, 0, 65510, 0, 0, 5233, 
-    983327, 64792, 983326, 0, 126633, 0, 7060, 9847, 120144, 1685, 595, 0, 
-    73971, 1292, 8940, 7380, 11088, 0, 10004, 126997, 0, 6541, 0, 0, 0, 3243, 
-    9014, 5606, 0, 538, 64620, 5602, 8467, 74391, 6547, 128132, 8203, 78488, 
-    983090, 8458, 65211, 8495, 119904, 0, 917552, 779, 78314, 64367, 2465, 
-    69901, 8193, 55279, 9730, 9280, 0, 7065, 74155, 4346, 0, 73798, 504, 0, 
-    92414, 8982, 0, 0, 0, 782, 0, 10883, 0, 194852, 732, 3737, 127253, 1548, 
-    68650, 92507, 1832, 5604, 5735, 41141, 119020, 4376, 0, 11787, 3745, 0, 
-    0, 42888, 65712, 983296, 3869, 11937, 5725, 127539, 1783, 68648, 5728, 0, 
-    0, 0, 11918, 66567, 5724, 0, 5727, 78521, 0, 0, 764, 0, 128116, 43531, 0, 
-    9033, 0, 42532, 6223, 11042, 120749, 11423, 0, 119861, 71344, 43465, 0, 
-    128267, 6559, 64557, 71348, 92649, 120648, 43019, 43477, 10238, 74491, 0, 
-    43377, 92282, 71346, 1478, 9783, 11825, 2607, 64740, 0, 7739, 74543, 0, 
-    0, 0, 6132, 0, 63765, 0, 70058, 41144, 0, 92438, 43537, 6761, 10093, 
-    4369, 917791, 0, 983148, 8820, 3947, 0, 0, 11515, 526, 128103, 41295, 
-    194603, 917785, 194932, 0, 7688, 917786, 7686, 8288, 11815, 0, 0, 983374, 
-    1543, 3713, 41221, 12423, 42281, 917788, 74024, 12293, 0, 64357, 11794, 
-    42082, 0, 1737, 8987, 42081, 0, 7205, 0, 9335, 12850, 119870, 6553, 7055, 
-    0, 8277, 0, 0, 5475, 74795, 6780, 0, 0, 12990, 1160, 42084, 119650, 
-    41217, 119660, 10018, 360, 0, 0, 68176, 5863, 3137, 0, 4147, 983170, 
-    41216, 7844, 2616, 119190, 68461, 65234, 983286, 13076, 3135, 983279, 
-    78143, 119139, 3142, 92451, 94068, 10819, 119580, 10183, 0, 2608, 1470, 
-    73967, 94008, 6227, 0, 127173, 69741, 983582, 6163, 983558, 0, 127314, 0, 
-    0, 8603, 0, 119866, 3306, 10876, 43392, 119573, 127931, 5751, 0, 6222, 0, 
-    0, 12086, 7403, 1600, 64309, 64939, 0, 64783, 92658, 11310, 0, 8882, 0, 
-    0, 2570, 7021, 0, 0, 43110, 0, 1234, 6540, 6974, 0, 0, 983209, 5002, 0, 
-    41286, 69946, 127019, 0, 43585, 0, 6551, 983953, 128229, 0, 41289, 0, 
-    194602, 0, 8977, 602, 120814, 0, 128778, 128661, 0, 983367, 41279, 0, 0, 
-    0, 11081, 43615, 0, 0, 0, 983612, 12727, 0, 0, 78397, 9475, 7112, 65105, 
-    0, 9633, 10886, 43592, 7831, 983820, 194571, 0, 73915, 8076, 43048, 8290, 
-    8291, 43051, 92570, 0, 2596, 43584, 0, 13113, 0, 127757, 2393, 7058, 
-    9087, 74067, 68673, 41574, 78337, 0, 74058, 6376, 0, 0, 0, 0, 9854, 
-    127748, 64696, 0, 128220, 0, 6994, 0, 1720, 0, 0, 0, 6529, 7063, 983182, 
-    3751, 9120, 983477, 0, 1798, 709, 0, 1354, 1876, 13152, 6557, 12430, 
-    8137, 94098, 92642, 0, 0, 245, 128097, 11456, 41233, 7070, 0, 94046, 
-    6136, 917609, 65677, 8682, 41235, 92595, 42045, 9804, 118963, 432, 3595, 
-    194945, 65437, 0, 74455, 42399, 0, 0, 128274, 0, 119658, 0, 0, 0, 77894, 
-    8797, 0, 9052, 64888, 7167, 2356, 95, 74784, 10580, 0, 42286, 0, 64640, 
-    0, 94109, 0, 74137, 70035, 10063, 12652, 12199, 92480, 0, 2566, 11971, 
-    983728, 0, 1065, 0, 0, 43400, 2576, 66696, 93999, 0, 43604, 0, 0, 74082, 
-    514, 74502, 70032, 2921, 43215, 64493, 5772, 12968, 70055, 194944, 74580, 
-    43398, 2580, 983801, 41341, 41223, 6564, 1463, 41342, 0, 5293, 70020, 0, 
-    3733, 11346, 0, 12054, 0, 74098, 42827, 0, 13091, 0, 0, 0, 917915, 0, 
-    127025, 0, 74821, 0, 983724, 119042, 0, 127865, 13090, 66643, 0, 1270, 
-    1132, 42360, 0, 74096, 66655, 42569, 127824, 0, 64761, 0, 41021, 8510, 
-    42432, 0, 0, 194782, 0, 64496, 74109, 70030, 9915, 0, 983216, 7061, 
-    41336, 3854, 69700, 13141, 68413, 43401, 42319, 13082, 0, 7067, 68221, 0, 
-    127383, 127171, 0, 0, 127797, 9029, 43543, 119315, 2353, 6308, 0, 74792, 
-    2611, 119186, 0, 0, 0, 43664, 92399, 66627, 0, 4484, 8509, 118976, 11066, 
-    65233, 0, 41224, 41017, 0, 3747, 10522, 0, 0, 1691, 41226, 0, 12107, 
-    7100, 10905, 65010, 194986, 697, 66018, 9284, 4244, 0, 0, 92644, 13121, 
-    120036, 0, 12010, 128573, 128221, 0, 0, 0, 127193, 65816, 68111, 0, 
-    127933, 65668, 92257, 6618, 118784, 66365, 0, 42234, 12648, 78110, 7123, 
-    70038, 5785, 9198, 9764, 41316, 65877, 7383, 13230, 41299, 0, 0, 68365, 
-    128258, 0, 0, 0, 13122, 0, 191, 70060, 8585, 8000, 64411, 120652, 42889, 
-    64850, 41072, 41578, 0, 41577, 0, 10002, 0, 6533, 73802, 41570, 0, 683, 
-    396, 41580, 68146, 0, 12901, 43058, 0, 343, 7129, 42680, 41360, 78154, 0, 
-    4743, 0, 0, 74040, 74108, 8743, 1724, 1433, 119322, 0, 3739, 6263, 71349, 
-    0, 3964, 6592, 0, 128693, 66040, 0, 42568, 69806, 128113, 1778, 3956, 0, 
-    42070, 6563, 43075, 9018, 94006, 983388, 12067, 41312, 0, 5547, 74531, 
-    127969, 0, 8175, 0, 284, 8108, 934, 0, 74001, 173, 66460, 7174, 92703, 
-    118822, 1750, 0, 4394, 68368, 1807, 983879, 92298, 0, 5889, 0, 7180, 0, 
-    119145, 0, 917558, 42471, 6982, 1721, 44022, 7891, 42243, 42160, 2583, 
-    4512, 119360, 65230, 128109, 0, 0, 3855, 0, 0, 0, 0, 74295, 0, 0, 92416, 
-    3975, 0, 74087, 0, 12672, 3798, 2703, 983599, 0, 2109, 9774, 1275, 0, 0, 
-    41095, 3962, 0, 2932, 41101, 3954, 6457, 4513, 0, 0, 73994, 73992, 1468, 
-    0, 0, 41851, 128230, 41846, 0, 55238, 7633, 41849, 68385, 4320, 3224, 0, 
+    12825, 0, 0, 12725, 0, 127106, 78642, 223, 0, 69675, 120166, 42444, 0, 
+    64499, 65245, 0, 1171, 0, 69717, 0, 1805, 8772, 43820, 0, 9930, 65247, 
+    78619, 120111, 2338, 0, 118853, 0, 42676, 0, 64800, 65236, 67644, 68126, 
+    1213, 0, 64075, 797, 64074, 8734, 4212, 127369, 64387, 4115, 0, 5005, 
+    64070, 64073, 10679, 0, 77954, 9402, 64276, 426, 0, 0, 8251, 10136, 
+    65436, 0, 2120, 43302, 1224, 0, 65576, 74192, 10701, 1764, 3101, 127815, 
+    12858, 120159, 0, 11373, 6378, 127859, 120103, 8663, 9312, 41644, 4539, 
+    2129, 0, 9222, 983738, 0, 4259, 9092, 74567, 41961, 0, 12724, 66357, 
+    42331, 64935, 0, 0, 1293, 7947, 2132, 983767, 74593, 120308, 2454, 42717, 
+    3613, 128837, 0, 0, 65888, 8816, 10978, 10840, 0, 10668, 0, 43087, 12595, 
+    120304, 983114, 8822, 0, 1157, 64903, 8638, 0, 0, 0, 0, 69848, 8235, 
+    120316, 4405, 10086, 120247, 0, 69216, 0, 65430, 71321, 6079, 6817, 
+    10764, 127910, 64291, 128051, 998, 120312, 11062, 1317, 64327, 1558, 0, 
+    1991, 7882, 42254, 0, 41700, 530, 0, 10428, 119335, 12002, 119336, 5742, 
+    43076, 4692, 64630, 41823, 4007, 5004, 119334, 7896, 751, 6595, 6596, 
+    120325, 66373, 0, 0, 64908, 92691, 6311, 0, 12004, 119192, 12049, 43108, 
+    120326, 0, 41705, 92188, 6598, 0, 6599, 120334, 0, 42148, 118825, 66027, 
+    0, 6597, 9412, 8340, 11824, 64745, 2281, 69904, 0, 1988, 5407, 67865, 
+    2430, 41678, 0, 120243, 2336, 983903, 0, 78871, 120442, 983769, 1921, 
+    10947, 19927, 0, 65406, 0, 19913, 4284, 13217, 0, 43789, 12841, 9229, 
+    10956, 42285, 41674, 19964, 41679, 65084, 3521, 0, 5774, 8325, 0, 65403, 
+    983089, 1854, 10794, 0, 67660, 69846, 0, 78359, 5280, 0, 4344, 12905, 
+    65433, 6076, 64793, 41610, 768, 12074, 442, 0, 68162, 64081, 12934, 
+    41682, 65432, 41693, 0, 6071, 65434, 127467, 4804, 4053, 0, 127469, 
+    194653, 41696, 467, 69823, 127463, 69797, 194652, 127473, 8421, 127472, 
+    69682, 43705, 502, 0, 65431, 119056, 69954, 12043, 1303, 316, 7364, 2029, 
+    2136, 119246, 11533, 64365, 43480, 92639, 4860, 126648, 127877, 42488, 0, 
+    9583, 128849, 5546, 8019, 73856, 0, 0, 0, 5544, 2355, 12150, 65725, 5543, 
+    77989, 63751, 12137, 5548, 77985, 0, 65727, 68388, 65726, 6077, 128352, 
+    65452, 0, 11301, 78013, 78008, 78010, 9874, 78007, 0, 1319, 3050, 65410, 
+    0, 0, 78016, 78017, 42830, 43996, 66716, 128137, 4691, 92242, 9345, 621, 
+    92709, 128222, 0, 65411, 0, 41182, 73881, 65408, 73899, 78024, 9474, 
+    10545, 119118, 10887, 3786, 65409, 8894, 43179, 119611, 7923, 3716, 
+    92363, 9996, 8508, 0, 7012, 8195, 127834, 9566, 0, 3722, 0, 41707, 8493, 
+    545, 9575, 41379, 10050, 12718, 69854, 8859, 6820, 74345, 65110, 120740, 
+    0, 0, 9119, 2787, 7920, 118823, 4021, 2012, 7985, 0, 119663, 0, 0, 78021, 
+    78022, 410, 78020, 1802, 78018, 74107, 0, 41659, 41671, 1827, 0, 64396, 
+    10126, 12116, 41673, 120370, 11422, 78141, 120373, 3860, 120367, 68412, 
+    41345, 120362, 120363, 11748, 42158, 7941, 11076, 8749, 120361, 2104, 
+    64858, 361, 120357, 845, 0, 41560, 11970, 4562, 917920, 2926, 917919, 
+    4569, 74130, 0, 43487, 194630, 611, 74129, 64871, 118891, 65629, 0, 
+    194858, 0, 0, 127545, 120543, 0, 0, 6291, 0, 78639, 41669, 7094, 917921, 
+    0, 983581, 74054, 127754, 195029, 0, 839, 983319, 7695, 8769, 65246, 
+    4829, 194663, 4859, 64467, 0, 983963, 118998, 7206, 0, 6647, 43986, 0, 
+    69766, 0, 64764, 4210, 983863, 127936, 804, 0, 0, 12298, 0, 66653, 0, 
+    64924, 10091, 73931, 9468, 74245, 0, 0, 74246, 92503, 12839, 64669, 
+    92202, 0, 1279, 1425, 6224, 119229, 11049, 0, 92697, 43239, 8482, 92440, 
+    0, 5032, 69677, 11940, 67888, 664, 120437, 5034, 0, 0, 127525, 42702, 
+    73888, 983149, 13294, 67873, 64869, 6032, 0, 9115, 7430, 120377, 0, 
+    120819, 68387, 120168, 73913, 120170, 41161, 5518, 4174, 10993, 41162, 
+    120160, 64528, 1169, 434, 41437, 1905, 6034, 41164, 64744, 9528, 118867, 
+    128800, 524, 0, 74029, 788, 74027, 0, 194638, 0, 1663, 10419, 74025, 
+    42636, 0, 69725, 0, 120656, 0, 67876, 0, 0, 0, 67897, 74039, 0, 0, 11395, 
+    0, 119107, 43612, 64344, 0, 0, 10855, 5445, 9355, 0, 65198, 7391, 8989, 
+    221, 65686, 0, 0, 8010, 7191, 4962, 69772, 8855, 0, 0, 64469, 120426, 
+    10555, 0, 43333, 92299, 0, 120427, 10451, 0, 67653, 7245, 12443, 74405, 
+    9947, 120149, 78317, 3873, 8367, 0, 120146, 43433, 43649, 11987, 0, 0, 
+    11010, 12723, 74059, 74062, 6217, 5896, 0, 7682, 74049, 1462, 10235, 0, 
+    0, 0, 0, 0, 0, 42595, 0, 74402, 118860, 0, 120419, 92497, 74052, 0, 
+    92378, 120549, 119082, 64295, 120418, 0, 64765, 73923, 120417, 120662, 
+    69920, 194702, 6216, 0, 10755, 9455, 0, 8124, 127042, 9470, 6944, 127540, 
+    0, 69680, 2828, 0, 531, 42638, 0, 0, 0, 43428, 8204, 3614, 2827, 9696, 0, 
+    0, 8728, 4354, 10904, 78562, 19936, 7833, 120691, 0, 42599, 42597, 42709, 
+    120409, 127044, 0, 8537, 0, 0, 9354, 983164, 128833, 41199, 10121, 2028, 
+    0, 983194, 69715, 0, 3062, 0, 74447, 12608, 0, 66440, 7545, 9700, 12580, 
+    92205, 120777, 120502, 41155, 0, 74071, 0, 983457, 12713, 0, 0, 0, 78772, 
+    0, 1734, 0, 0, 127040, 64594, 2456, 231, 0, 74167, 542, 0, 118786, 0, 
+    983979, 1230, 0, 0, 3597, 4446, 10584, 74235, 92215, 4037, 127938, 8352, 
+    0, 5687, 0, 64515, 0, 194801, 55265, 67846, 78434, 9704, 0, 0, 70080, 
+    71338, 0, 8660, 126495, 0, 0, 78773, 74482, 4483, 1709, 69721, 9909, 
+    6080, 0, 120358, 1746, 1315, 8667, 0, 0, 13140, 65899, 10604, 0, 4480, 
+    11266, 128152, 1226, 6930, 67979, 983690, 6360, 10897, 41230, 605, 0, 
+    74785, 69875, 0, 0, 41500, 0, 311, 11453, 6221, 10608, 64943, 74280, 
+    10877, 118868, 64885, 74272, 0, 0, 128559, 120736, 74312, 345, 0, 74456, 
+    64606, 9917, 0, 92231, 5037, 0, 1776, 8422, 0, 118814, 41508, 41201, 323, 
+    43328, 0, 42698, 1295, 194853, 4625, 0, 4630, 13117, 0, 128772, 65123, 
+    11293, 2668, 11288, 0, 42640, 65666, 2519, 92369, 65420, 92479, 0, 4252, 
+    5049, 42659, 119011, 706, 7754, 10854, 8738, 0, 65419, 0, 0, 649, 65421, 
+    0, 66702, 0, 12670, 1013, 0, 64919, 705, 0, 65422, 127803, 1183, 126519, 
+    7017, 42852, 0, 8157, 9736, 64503, 65418, 0, 983878, 74035, 0, 11913, 
+    73874, 6696, 0, 8920, 119298, 0, 7962, 12211, 9837, 2051, 66227, 0, 4184, 
+    0, 0, 10177, 73777, 1857, 194657, 4626, 8464, 8472, 0, 4629, 8499, 78321, 
+    78322, 4624, 7818, 119173, 0, 0, 7805, 0, 94007, 6935, 92292, 78325, 
+    78326, 78323, 43327, 43989, 119046, 8492, 8250, 8459, 0, 8497, 8496, 0, 
+    0, 78336, 78339, 9543, 78335, 78332, 77832, 65849, 77831, 983961, 0, 
+    12451, 0, 8684, 0, 6102, 0, 5298, 0, 5294, 0, 0, 983459, 195062, 9949, 
+    119826, 43617, 119215, 0, 12073, 0, 0, 77863, 13108, 120617, 11439, 
+    41468, 983757, 0, 5292, 55272, 983883, 1939, 5302, 3970, 917879, 12455, 
+    1793, 0, 0, 0, 6643, 92477, 65263, 0, 78330, 41293, 78328, 65923, 0, 
+    13219, 9569, 0, 74383, 0, 74197, 0, 5500, 8813, 0, 0, 74566, 5322, 0, 
+    78340, 43631, 5324, 66443, 3784, 41614, 65269, 6230, 78349, 78345, 43324, 
+    3360, 78344, 11523, 0, 92488, 9926, 7197, 0, 68429, 42894, 41821, 1249, 
+    78360, 78361, 78356, 78358, 78353, 64899, 64763, 41149, 41807, 43162, 
+    41815, 41150, 0, 10571, 10096, 0, 0, 78074, 6947, 41152, 887, 9249, 6565, 
+    78510, 41990, 78509, 41811, 74466, 93966, 6670, 77882, 0, 0, 43092, 
+    43325, 0, 10168, 0, 9781, 128655, 9190, 0, 9666, 8269, 65944, 74005, 
+    13019, 11670, 69860, 315, 12813, 983458, 78432, 78256, 78351, 78352, 0, 
+    983657, 0, 0, 1378, 9509, 0, 0, 74475, 3066, 92220, 67847, 0, 92355, 0, 
+    78365, 8787, 120379, 194616, 41618, 194615, 78261, 194614, 0, 64652, 0, 
+    194612, 0, 78366, 42088, 0, 195061, 7176, 43756, 10137, 6121, 10995, 
+    78259, 74534, 8119, 64874, 917816, 127199, 194939, 0, 74525, 0, 0, 12930, 
+    1394, 74514, 0, 74515, 0, 118804, 2998, 9527, 120659, 65190, 12977, 
+    42090, 119165, 0, 119100, 41236, 92235, 42005, 42003, 41237, 5848, 0, 0, 
+    3670, 128657, 194600, 0, 0, 7890, 0, 11298, 43315, 0, 6229, 1593, 0, 0, 
+    619, 4635, 65080, 0, 128002, 4120, 65337, 65336, 0, 11808, 119214, 74115, 
+    9366, 42790, 42006, 119115, 65327, 65326, 65325, 10757, 1507, 42216, 
+    65321, 65320, 65335, 65334, 65333, 65332, 65331, 42059, 65329, 42689, 
+    92427, 9128, 94045, 42073, 6785, 64590, 983830, 4371, 7196, 65318, 2035, 
+    65316, 4106, 65314, 65313, 42074, 127847, 41228, 0, 65609, 41241, 7903, 
+    41239, 43533, 78459, 7189, 0, 0, 0, 12357, 42802, 78450, 8487, 9131, 0, 
+    4615, 12695, 127752, 0, 12175, 0, 64535, 0, 7809, 0, 0, 562, 12169, 6590, 
+    69762, 66455, 64738, 3219, 68654, 983787, 0, 1037, 0, 2025, 128263, 
+    13098, 78442, 10637, 4568, 549, 1570, 0, 2835, 0, 10624, 43623, 11072, 
+    127191, 0, 0, 12606, 78433, 2825, 0, 10825, 8079, 2821, 41046, 92327, 
+    7365, 983753, 120593, 13071, 0, 452, 41049, 42840, 6346, 2831, 5461, 
+    74596, 11465, 5212, 0, 64703, 119191, 42308, 7181, 0, 41332, 0, 12333, 0, 
+    1668, 0, 0, 0, 1187, 983385, 42628, 78575, 0, 128777, 0, 3240, 128518, 
+    12194, 0, 11591, 41065, 5323, 8166, 0, 0, 0, 74535, 1623, 65297, 128856, 
+    571, 0, 4918, 0, 5288, 127295, 8916, 65048, 1909, 8864, 0, 0, 10736, 
+    92508, 11571, 7615, 127300, 92296, 4237, 92576, 1035, 65815, 0, 7881, 
+    701, 65936, 3489, 0, 0, 120751, 11403, 0, 0, 127146, 3796, 6800, 0, 3994, 
+    11421, 0, 195076, 0, 983922, 0, 0, 64857, 128105, 2855, 127828, 66308, 
+    41621, 68214, 127283, 127817, 10654, 0, 119226, 12164, 3246, 7906, 43972, 
+    65847, 7182, 0, 13024, 194822, 74270, 128289, 0, 0, 0, 1496, 747, 0, 942, 
+    2378, 43136, 127905, 8466, 983575, 9320, 8001, 1232, 8139, 11617, 0, 0, 
+    11409, 68373, 6382, 0, 64634, 128279, 0, 11612, 0, 67600, 2374, 94066, 
+    8475, 11609, 66313, 0, 0, 5286, 119297, 0, 0, 64925, 120283, 194584, 
+    118982, 194583, 7705, 11942, 11305, 194581, 3309, 0, 0, 0, 0, 6802, 0, 
+    41653, 1280, 1241, 7168, 12096, 0, 66615, 42565, 41651, 0, 0, 0, 41650, 
+    66507, 66470, 0, 12914, 41491, 66010, 119552, 6078, 9954, 0, 1475, 
+    119247, 9938, 6084, 917546, 41064, 41062, 0, 0, 3256, 10189, 42076, 
+    43252, 78823, 917906, 8727, 0, 65875, 0, 0, 127762, 10562, 74215, 43065, 
+    0, 0, 3248, 74297, 3261, 9015, 71351, 0, 3635, 64337, 983281, 0, 0, 7195, 
+    0, 2007, 64431, 0, 0, 0, 0, 635, 0, 0, 65613, 77909, 92420, 73997, 0, 0, 
+    119218, 7984, 8600, 74434, 127770, 4176, 70050, 2034, 92551, 120805, 
+    65891, 127038, 0, 318, 2038, 128860, 78596, 0, 3649, 13149, 42145, 42798, 
+    3634, 120291, 118927, 67677, 120124, 7866, 0, 11402, 42146, 94032, 74238, 
+    42664, 2849, 127034, 0, 7938, 12960, 1761, 11812, 65379, 68386, 128185, 
+    1159, 0, 69729, 0, 0, 7178, 194632, 0, 41680, 0, 128203, 11534, 1514, 
+    11668, 67891, 9313, 7015, 0, 67877, 194567, 12989, 66474, 9368, 12848, 
+    1624, 43270, 0, 74278, 10818, 126644, 9953, 0, 78421, 1194, 3242, 9761, 
+    9555, 8598, 120299, 6169, 12871, 1551, 2798, 65176, 4958, 42752, 119025, 
+    0, 67875, 120301, 3495, 66648, 194768, 0, 68364, 983224, 4891, 0, 10641, 
+    0, 73746, 0, 68352, 0, 73787, 194829, 194633, 7199, 64955, 0, 0, 0, 0, 0, 
+    42685, 42679, 193, 0, 0, 0, 42667, 0, 5271, 92318, 92517, 118882, 1362, 
+    13297, 0, 128094, 0, 983331, 73789, 0, 6658, 4426, 0, 92628, 983842, 
+    92319, 7276, 42163, 5220, 0, 0, 983330, 2416, 3310, 42703, 0, 379, 0, 
+    43755, 0, 0, 3223, 65492, 1284, 194771, 4549, 0, 0, 983154, 127763, 
+    10807, 9558, 194613, 0, 8515, 8688, 12866, 65308, 3294, 983332, 8529, 
+    128101, 43385, 7564, 0, 43329, 0, 92458, 73757, 66456, 42359, 0, 2031, 0, 
+    7202, 0, 12676, 42729, 92198, 3215, 0, 7710, 1610, 73801, 0, 0, 65682, 0, 
+    120537, 65924, 9974, 228, 66354, 1501, 0, 64395, 5179, 7200, 6225, 0, 
+    65794, 1725, 65533, 8196, 7476, 74399, 0, 0, 7152, 8502, 5762, 1967, 
+    7483, 0, 0, 8104, 0, 7474, 77979, 0, 126507, 10414, 13001, 8141, 0, 
+    42537, 1557, 43594, 128642, 6330, 6805, 8631, 2545, 70052, 127166, 0, 
+    74190, 0, 0, 983786, 42762, 0, 42914, 1650, 262, 1637, 0, 7901, 3238, 
+    128173, 41861, 0, 128585, 65158, 10860, 94059, 43658, 7527, 0, 43319, 
+    6419, 0, 45, 0, 64588, 93989, 0, 119810, 7194, 5291, 0, 43666, 13129, 0, 
+    9084, 0, 8737, 0, 12881, 0, 12906, 9639, 7912, 2620, 0, 0, 0, 983875, 
+    179, 65896, 0, 64756, 2853, 78443, 118813, 983890, 118996, 119009, 2850, 
+    8084, 983085, 73850, 2801, 92284, 42069, 119839, 74754, 119841, 42072, 
+    119843, 119842, 10398, 983056, 0, 8377, 127116, 8245, 68401, 3158, 92396, 
+    3983, 43656, 923, 119857, 119856, 292, 13002, 119845, 119844, 3221, 1763, 
+    92463, 4612, 119851, 119850, 7253, 127110, 68391, 0, 10782, 3637, 12996, 
+    43542, 0, 64578, 983675, 3228, 69636, 8783, 0, 119614, 2731, 0, 0, 78585, 
+    4102, 7696, 73878, 0, 0, 78586, 43316, 4177, 11283, 9089, 0, 73996, 
+    983173, 64500, 43674, 0, 64947, 1856, 0, 0, 6379, 0, 0, 0, 3208, 12975, 
+    74775, 127380, 983931, 92389, 74072, 55269, 0, 0, 983683, 2033, 78577, 
+    78576, 195026, 55254, 7740, 0, 0, 0, 73964, 0, 93988, 67612, 65674, 
+    128244, 94110, 41689, 0, 74006, 64909, 6646, 11790, 74019, 0, 128066, 
+    128031, 8561, 4573, 0, 5326, 0, 120605, 7230, 8257, 0, 8778, 41688, 0, 
+    65776, 2071, 8314, 6459, 0, 7628, 65092, 73903, 66721, 11342, 128561, 0, 
+    0, 128226, 127001, 0, 11810, 13164, 10723, 967, 983951, 126469, 11946, 0, 
+    3257, 0, 12307, 1845, 983157, 43526, 0, 0, 1886, 42342, 10089, 870, 7648, 
+    3499, 8609, 7652, 876, 871, 877, 0, 878, 42015, 879, 43692, 4563, 0, 0, 
+    7591, 65887, 867, 9520, 872, 126607, 868, 873, 7642, 0, 869, 874, 7644, 
+    120674, 875, 790, 128303, 0, 0, 0, 66182, 983258, 5429, 195055, 66180, 
+    126480, 66181, 68452, 983289, 983248, 42067, 0, 5433, 10657, 7911, 
+    194622, 1547, 66176, 42012, 120576, 5425, 4977, 9999, 5317, 5423, 4611, 
+    0, 67637, 0, 9679, 74122, 0, 0, 0, 66194, 4418, 66184, 4628, 4245, 
+    119648, 0, 0, 1851, 0, 127189, 11908, 0, 9360, 118897, 983202, 42776, 
+    66187, 12837, 8829, 7711, 92714, 0, 92321, 43318, 0, 8809, 69881, 0, 
+    983142, 120604, 983052, 983882, 0, 983270, 0, 0, 7427, 9958, 4588, 43680, 
+    0, 74484, 194968, 2433, 0, 119622, 3352, 74363, 983885, 0, 793, 74404, 0, 
+    305, 567, 67662, 842, 128519, 8208, 0, 41695, 1647, 118877, 0, 7837, 
+    917625, 818, 5337, 194628, 917621, 41376, 119978, 126576, 120594, 74086, 
+    917615, 917614, 917613, 10973, 66359, 1372, 127172, 917608, 4969, 1254, 
+    917605, 917604, 93967, 917602, 65228, 78221, 126612, 0, 2840, 0, 119982, 
+    983939, 0, 3245, 9068, 68194, 64725, 0, 0, 12991, 0, 2651, 68016, 983265, 
+    917611, 127026, 128883, 0, 0, 43648, 120812, 0, 43322, 92662, 0, 0, 
+    64372, 92698, 3226, 655, 752, 7457, 7456, 7452, 3285, 128779, 127821, 
+    119988, 65610, 2391, 0, 92248, 671, 250, 7434, 618, 668, 610, 42800, 
+    7431, 1152, 42801, 640, 120666, 7448, 7439, 628, 3905, 73810, 0, 128266, 
+    64749, 67850, 2107, 0, 0, 4605, 128174, 983192, 43372, 65945, 128838, 0, 
+    119590, 0, 0, 0, 987, 6927, 11572, 42261, 11464, 3365, 9971, 0, 0, 
+    128297, 0, 0, 0, 0, 11334, 43326, 12609, 11519, 11503, 5530, 5210, 0, 
+    4627, 983892, 5208, 0, 128842, 10332, 5218, 7976, 9156, 0, 3244, 5529, 
+    69647, 73894, 128852, 5432, 64965, 5527, 74033, 10516, 7790, 5528, 0, 
+    42140, 120281, 0, 0, 43545, 9887, 0, 4000, 7429, 7428, 665, 7424, 3206, 
+    120278, 7884, 0, 128566, 917989, 128666, 211, 2509, 128858, 120573, 
+    68672, 3220, 42235, 0, 10690, 8951, 5214, 42474, 8118, 0, 7048, 4590, 
+    127258, 5852, 0, 0, 127259, 1708, 0, 983165, 2623, 11943, 0, 69226, 0, 
+    4698, 66509, 1066, 119921, 4701, 983876, 120285, 74225, 94111, 8267, 0, 
+    127265, 0, 7516, 0, 2625, 983977, 8034, 74309, 0, 3631, 10955, 7850, 
+    120293, 8416, 0, 0, 0, 43384, 12660, 0, 0, 0, 74850, 41069, 0, 128156, 
+    12099, 4310, 10032, 6252, 713, 7990, 0, 3990, 0, 983262, 66368, 5017, 
+    64956, 7071, 0, 119144, 1030, 118800, 983120, 9513, 41059, 9357, 0, 1773, 
+    0, 120350, 0, 6339, 7745, 9844, 0, 64650, 94, 1880, 74766, 983838, 8908, 
+    0, 128707, 65913, 78470, 10752, 13003, 0, 126572, 41307, 8732, 120338, 0, 
+    1757, 6964, 4696, 0, 120335, 64785, 7394, 3641, 5419, 128055, 0, 127883, 
+    0, 120344, 43988, 0, 8610, 43062, 7592, 856, 74299, 936, 13289, 69894, 
+    43171, 1459, 0, 65243, 78638, 19953, 0, 1504, 70064, 0, 12913, 74206, 
+    7529, 0, 128699, 983957, 120782, 4113, 0, 2372, 336, 0, 7509, 12152, 0, 
+    682, 66458, 41505, 0, 64743, 10593, 1703, 0, 983955, 8033, 69953, 0, 
+    9810, 127269, 0, 12970, 0, 42351, 10109, 917623, 0, 194693, 0, 92690, 0, 
+    0, 74291, 1965, 7069, 43312, 0, 73887, 0, 2087, 64370, 6314, 41714, 8501, 
+    0, 0, 74239, 41317, 92614, 2091, 74545, 2090, 0, 9353, 7117, 2077, 77886, 
+    0, 10498, 2083, 77888, 0, 0, 119236, 634, 0, 0, 0, 69779, 4165, 8746, 0, 
+    9654, 12856, 6924, 0, 7066, 983719, 0, 128135, 41037, 42692, 7786, 12959, 
+    41039, 127483, 0, 680, 2302, 128200, 1181, 7056, 3174, 126516, 0, 92668, 
+    65665, 127375, 126506, 6920, 0, 92295, 0, 118965, 0, 64644, 126981, 
+    74119, 0, 41028, 0, 6231, 2613, 65302, 40989, 0, 194696, 0, 42760, 0, 
+    983566, 0, 40987, 4667, 0, 983932, 8828, 0, 0, 1246, 4746, 0, 0, 11021, 
+    4749, 92675, 0, 921, 4744, 0, 12702, 242, 0, 1566, 8217, 0, 64653, 78386, 
+    128121, 74036, 74505, 43274, 5313, 951, 0, 0, 983867, 7604, 983290, 4009, 
+    127816, 983710, 120562, 0, 983720, 64860, 119138, 119069, 0, 127370, 
+    4048, 983598, 0, 70024, 1646, 77890, 64534, 73995, 120705, 0, 119890, 
+    2579, 119905, 3177, 11357, 9099, 4107, 3441, 119894, 2975, 74442, 9822, 
+    983935, 55220, 10084, 73943, 118840, 0, 917562, 194610, 3399, 9851, 
+    983717, 11909, 9059, 0, 7687, 0, 6789, 0, 0, 0, 71367, 0, 0, 1777, 9151, 
+    1137, 69767, 749, 42366, 0, 5385, 128574, 128218, 0, 0, 5989, 0, 0, 
+    128091, 0, 41685, 69223, 0, 9769, 41684, 983216, 519, 0, 11740, 5766, 0, 
+    0, 2600, 8848, 120138, 41297, 0, 3666, 74473, 41300, 74468, 65160, 0, 
+    69688, 69771, 74479, 0, 6558, 0, 0, 69765, 120750, 252, 0, 41302, 0, 0, 
+    0, 69763, 0, 11729, 8719, 9060, 0, 120139, 10761, 0, 0, 0, 118792, 11734, 
+    983223, 11730, 0, 9593, 5757, 2403, 64808, 55275, 0, 11728, 43572, 0, 0, 
+    7764, 983714, 11094, 120825, 0, 983226, 4282, 8298, 0, 0, 0, 0, 0, 64449, 
+    0, 126650, 63854, 8456, 0, 74783, 65670, 0, 78250, 0, 7774, 10607, 9792, 
+    0, 0, 0, 0, 120764, 0, 10019, 74762, 0, 3458, 4365, 70053, 983712, 3647, 
+    0, 2602, 128341, 0, 194707, 41135, 0, 0, 0, 64631, 172, 4971, 41219, 
+    41137, 1889, 7238, 6545, 126476, 92193, 7597, 10528, 0, 0, 3732, 73910, 
+    194588, 5344, 0, 43366, 43363, 9062, 119252, 0, 0, 0, 64479, 9232, 92596, 
+    0, 0, 194712, 10900, 41531, 1263, 3720, 12048, 0, 64292, 41524, 7227, 
+    119635, 6099, 41534, 0, 127354, 127345, 299, 917957, 8525, 127347, 3524, 
+    917565, 8831, 127349, 92564, 3075, 67867, 127352, 0, 66362, 0, 64353, 0, 
+    0, 5845, 0, 0, 0, 2581, 8200, 65114, 68460, 0, 43283, 5551, 0, 120735, 
+    983201, 6340, 118855, 0, 78134, 8680, 7204, 70065, 2588, 2914, 7011, 
+    55281, 0, 2471, 194631, 2883, 2749, 119563, 73774, 10913, 0, 0, 8666, 
+    675, 42493, 0, 43571, 0, 6219, 0, 9980, 41232, 10928, 0, 41153, 41229, 
+    118967, 0, 3738, 94016, 0, 12711, 3181, 66212, 74289, 68472, 42857, 8262, 
+    983379, 0, 983222, 0, 42347, 12092, 9615, 7234, 74047, 983088, 0, 43744, 
+    0, 0, 73846, 2934, 12722, 120762, 922, 43983, 74507, 983126, 74461, 3218, 
+    120471, 74290, 120469, 64562, 120475, 8569, 11404, 11932, 73728, 3214, 
+    120461, 120468, 12128, 3207, 65486, 78729, 1901, 78727, 127326, 120460, 
+    7425, 3205, 68003, 78737, 78736, 78735, 43383, 69940, 65459, 2606, 78730, 
+    73897, 0, 11496, 1173, 0, 41272, 119661, 0, 0, 983321, 120737, 0, 983971, 
+    983320, 378, 2610, 0, 65079, 983325, 65695, 126559, 37, 7068, 0, 120480, 
+    120479, 3209, 120477, 0, 10638, 9768, 69952, 119909, 983399, 0, 0, 0, 0, 
+    65510, 0, 0, 5233, 983335, 64792, 983334, 0, 126633, 0, 7060, 9847, 
+    120144, 1685, 595, 0, 73971, 1292, 8940, 7380, 11088, 0, 10004, 126997, 
+    0, 6541, 0, 0, 0, 3243, 9014, 5606, 0, 538, 64620, 5602, 8467, 74391, 
+    6547, 128132, 8203, 78488, 983090, 8458, 65211, 8495, 119904, 0, 917552, 
+    779, 78314, 64367, 2465, 69901, 8193, 55279, 9730, 9280, 0, 7065, 74155, 
+    4346, 0, 73798, 504, 0, 92414, 8982, 0, 0, 0, 782, 0, 10883, 0, 194852, 
+    732, 3737, 127253, 1548, 68650, 92507, 1832, 5604, 5735, 41141, 119020, 
+    4376, 0, 11787, 3745, 0, 0, 42888, 65712, 983304, 3869, 11937, 5725, 
+    127539, 1783, 68648, 5728, 0, 0, 0, 11918, 66567, 5724, 0, 5727, 78521, 
+    0, 0, 764, 0, 128116, 43531, 0, 9033, 0, 42532, 6223, 11042, 120749, 
+    11423, 0, 119861, 71344, 43465, 0, 128267, 6559, 64557, 71348, 92649, 
+    120648, 43019, 43477, 10238, 74491, 0, 43377, 92282, 71346, 1478, 9783, 
+    11825, 2607, 64740, 0, 7739, 74543, 0, 0, 0, 6132, 0, 63765, 0, 70058, 
+    41144, 0, 92438, 43537, 6761, 10093, 4369, 917791, 0, 983148, 8820, 3947, 
+    0, 0, 11515, 526, 128103, 41295, 194603, 917785, 194932, 0, 7688, 917786, 
+    7686, 8288, 11815, 0, 0, 983382, 1543, 3713, 41221, 12423, 42281, 917788, 
+    74024, 12293, 0, 64357, 11794, 42082, 0, 1737, 8987, 42081, 0, 7205, 0, 
+    9335, 12850, 119870, 6553, 7055, 0, 8277, 0, 0, 5475, 74795, 6780, 0, 0, 
+    12990, 1160, 42084, 119650, 41217, 119660, 10018, 360, 0, 0, 68176, 5863, 
+    3137, 0, 4147, 983170, 41216, 7844, 2616, 119190, 68461, 65234, 983294, 
+    13076, 3135, 983287, 78143, 119139, 3142, 92451, 94068, 10819, 119580, 
+    10183, 0, 2608, 1470, 73967, 94008, 6227, 0, 127173, 69741, 983582, 6163, 
+    983558, 0, 127314, 0, 0, 8603, 0, 119866, 3306, 10876, 43392, 119573, 
+    127931, 5751, 0, 6222, 0, 0, 12086, 7403, 1600, 64309, 64939, 0, 64783, 
+    92658, 11310, 0, 8882, 0, 0, 2570, 7021, 0, 0, 43110, 0, 1234, 6540, 
+    6974, 0, 0, 983211, 5002, 0, 41286, 69946, 127019, 0, 43585, 0, 6551, 
+    983962, 128229, 0, 41289, 0, 194602, 0, 8977, 602, 120814, 0, 128778, 
+    128661, 0, 983375, 41279, 0, 0, 0, 11081, 43615, 0, 0, 0, 983612, 12727, 
+    0, 0, 78397, 9475, 7112, 65105, 0, 9633, 10886, 43592, 7831, 983829, 
+    194571, 0, 73915, 8076, 43048, 8290, 8291, 43051, 92570, 0, 2596, 43584, 
+    0, 13113, 0, 127757, 2393, 7058, 9087, 74067, 68673, 41574, 78337, 0, 
+    74058, 6376, 0, 0, 0, 0, 9854, 127748, 64696, 0, 128220, 0, 6994, 0, 
+    1720, 0, 0, 0, 6529, 7063, 983182, 3751, 9120, 983485, 0, 1798, 709, 0, 
+    1354, 1876, 13152, 6557, 12430, 8137, 94098, 92642, 0, 0, 245, 128097, 
+    11456, 41233, 7070, 0, 94046, 6136, 917609, 65677, 8682, 41235, 92595, 
+    42045, 9804, 118963, 432, 3595, 194945, 65437, 0, 74455, 42399, 0, 0, 
+    128274, 0, 119658, 0, 0, 0, 77894, 8797, 0, 9052, 64888, 7167, 2356, 95, 
+    74784, 10580, 0, 42286, 0, 64640, 0, 94109, 0, 74137, 70035, 10063, 
+    12652, 12199, 92480, 0, 2566, 11971, 983737, 0, 1065, 0, 0, 43400, 2576, 
+    66696, 93999, 0, 43604, 0, 0, 74082, 514, 74502, 70032, 2921, 43215, 
+    64493, 5772, 12968, 70055, 194944, 74580, 43398, 2580, 983810, 41341, 
+    41223, 6564, 1463, 41342, 0, 5293, 70020, 0, 3733, 11346, 0, 12054, 0, 
+    74098, 42827, 0, 13091, 0, 0, 0, 917915, 0, 127025, 0, 74821, 0, 983733, 
+    119042, 0, 127865, 13090, 66643, 0, 1270, 1132, 42360, 0, 74096, 66655, 
+    42569, 127824, 0, 64761, 0, 41021, 8510, 42432, 0, 0, 194782, 0, 64496, 
+    74109, 70030, 9915, 0, 983218, 7061, 41336, 3854, 69700, 13141, 68413, 
+    43401, 42319, 13082, 0, 7067, 68221, 0, 127383, 127171, 0, 0, 127797, 
+    9029, 43543, 119315, 2353, 6308, 0, 74792, 2611, 119186, 0, 0, 0, 43664, 
+    92399, 66627, 0, 4484, 8509, 118976, 11066, 65233, 0, 41224, 41017, 0, 
+    3747, 10522, 0, 0, 1691, 41226, 0, 12107, 7100, 10905, 65010, 194986, 
+    697, 66018, 9284, 4244, 0, 0, 92644, 13121, 120036, 0, 12010, 128573, 
+    128221, 0, 0, 0, 127193, 65816, 68111, 0, 127933, 65668, 92257, 6618, 
+    118784, 66365, 0, 42234, 12648, 78110, 7123, 70038, 5785, 9198, 9764, 
+    41316, 65877, 7383, 13230, 41299, 0, 0, 68365, 128258, 0, 0, 0, 13122, 0, 
+    191, 70060, 8585, 8000, 64411, 120652, 42889, 64850, 41072, 41578, 0, 
+    41577, 0, 10002, 0, 6533, 73802, 41570, 0, 683, 396, 41580, 68146, 0, 
+    12901, 43058, 0, 343, 7129, 42680, 41360, 78154, 0, 4743, 0, 0, 74040, 
+    74108, 8743, 1724, 1433, 119322, 0, 3739, 6263, 71349, 0, 3964, 6592, 0, 
+    128693, 66040, 0, 42568, 69806, 128113, 1778, 3956, 0, 42070, 6563, 
+    43075, 9018, 94006, 983396, 12067, 41312, 0, 5547, 74531, 127969, 0, 
+    8175, 0, 284, 8108, 934, 0, 74001, 173, 66460, 7174, 92703, 118822, 1750, 
+    0, 4394, 68368, 1807, 983888, 92298, 0, 5889, 0, 7180, 0, 119145, 0, 
+    917558, 42471, 6982, 1721, 44022, 7891, 42243, 42160, 2583, 4512, 119360, 
+    65230, 128109, 0, 0, 3855, 0, 0, 0, 0, 74295, 0, 0, 92416, 3975, 0, 
+    74087, 0, 12672, 3798, 2703, 983599, 0, 2109, 9774, 1275, 0, 0, 41095, 
+    3962, 0, 2932, 41101, 3954, 6457, 4513, 0, 0, 73994, 73992, 1468, 0, 0, 
+    41851, 128230, 41846, 0, 55238, 7633, 41849, 68385, 4320, 3224, 0, 
     128032, 0, 42531, 119108, 1510, 0, 8256, 0, 11393, 0, 8879, 128075, 
     92474, 8770, 0, 0, 78377, 1910, 8671, 78374, 4283, 0, 127117, 68361, 
     78318, 2654, 7893, 195007, 0, 0, 0, 65106, 42761, 12857, 4581, 8411, 
@@ -19236,28 +19256,28 @@
     917619, 0, 0, 10043, 0, 1186, 41571, 6999, 617, 9464, 126642, 3675, 5207, 
     65062, 5213, 194769, 2617, 41348, 41568, 128803, 3253, 120535, 0, 8630, 
     128544, 0, 5596, 5545, 7288, 2586, 64887, 0, 5217, 71336, 0, 0, 0, 64293, 
-    68098, 2635, 0, 0, 983837, 0, 983632, 7835, 70040, 0, 194988, 92285, 
+    68098, 2635, 0, 0, 983846, 0, 983641, 7835, 70040, 0, 194988, 92285, 
     64558, 127122, 0, 127121, 0, 127913, 0, 5784, 983102, 0, 0, 70033, 4011, 
-    917616, 68101, 0, 7864, 4254, 65095, 983488, 5600, 3903, 127083, 10447, 
+    917616, 68101, 0, 7864, 4254, 65095, 983496, 5600, 3903, 127083, 10447, 
     5598, 1207, 120521, 66689, 3501, 42582, 43600, 194780, 0, 1124, 5597, 
-    194778, 194772, 9321, 983476, 983473, 983474, 0, 1719, 68356, 68354, 
-    9671, 1125, 4399, 127479, 917610, 983480, 7631, 5488, 7128, 120532, 0, 
+    194778, 194772, 9321, 983484, 983481, 983482, 0, 1719, 68356, 68354, 
+    9671, 1125, 4399, 127479, 917610, 983488, 7631, 5488, 7128, 120532, 0, 
     5491, 0, 8937, 43044, 2604, 74187, 5490, 43046, 5489, 7212, 11768, 43043, 
     6300, 0, 7122, 0, 4390, 454, 41397, 0, 9875, 7593, 194791, 92274, 118913, 
     7207, 0, 65901, 2394, 2575, 0, 3746, 11016, 65752, 120037, 0, 43423, 
     128683, 11989, 0, 0, 0, 0, 0, 8249, 128172, 0, 78531, 6640, 74806, 2598, 
-    513, 0, 6586, 8656, 0, 120710, 65008, 0, 194784, 194989, 194795, 983465, 
-    92515, 68475, 93973, 0, 0, 78637, 12647, 0, 128043, 69893, 1036, 983469, 
-    92419, 1723, 128056, 74217, 0, 41579, 2444, 0, 10705, 73876, 983461, 
-    74486, 983459, 740, 119222, 194978, 194984, 0, 4238, 11071, 9459, 68437, 
+    513, 0, 6586, 8656, 0, 120710, 65008, 0, 194784, 194989, 194795, 983473, 
+    92515, 68475, 93973, 0, 0, 78637, 12647, 0, 128043, 69893, 1036, 983477, 
+    92419, 1723, 128056, 74217, 0, 41579, 2444, 0, 10705, 73876, 983469, 
+    74486, 983467, 740, 119222, 194978, 194984, 0, 4238, 11071, 9459, 68437, 
     78140, 78139, 194985, 8121, 10438, 74487, 42574, 13285, 55263, 11907, 
     195000, 5690, 92255, 93992, 0, 43181, 13095, 0, 127857, 64498, 0, 9506, 
     6978, 194993, 77992, 0, 0, 194992, 0, 127845, 1122, 317, 0, 0, 0, 0, 
     1920, 0, 10173, 827, 0, 0, 78378, 120126, 5223, 1304, 0, 119564, 5226, 
     12602, 94044, 0, 9329, 7758, 9239, 41173, 5224, 5487, 1222, 5692, 41725, 
     69229, 9674, 5695, 41711, 64627, 19909, 0, 74604, 5691, 287, 866, 233, 
-    127490, 983433, 42816, 94036, 65140, 74797, 0, 8830, 6568, 42300, 10524, 
-    41175, 983440, 983437, 983438, 5296, 983436, 42492, 43402, 92466, 3302, 
+    127490, 983441, 42816, 94036, 65140, 74797, 0, 8830, 6568, 42300, 10524, 
+    41175, 983448, 983445, 983446, 5296, 983444, 42492, 43402, 92466, 3302, 
     0, 0, 6516, 6515, 6514, 6513, 6512, 0, 7856, 8690, 0, 0, 12122, 119602, 
     43976, 0, 1785, 69925, 68622, 65153, 194810, 5138, 0, 0, 118869, 0, 4540, 
     41181, 0, 6200, 0, 5134, 0, 322, 4643, 5132, 0, 6389, 128533, 5143, 0, 
@@ -19265,7 +19285,7 @@
     127012, 10270, 10286, 10318, 10382, 43529, 66477, 0, 0, 74170, 0, 3234, 
     0, 0, 74376, 43139, 118815, 127084, 120627, 8767, 0, 74489, 9695, 120746, 
     5201, 0, 6215, 12714, 6214, 13101, 0, 194999, 65268, 0, 0, 0, 11027, 0, 
-    10059, 10511, 42075, 9767, 789, 1749, 78890, 127071, 983661, 320, 0, 
+    10059, 10511, 42075, 9767, 789, 1749, 78890, 127071, 983670, 320, 0, 
     8647, 0, 3049, 0, 6471, 42071, 43156, 9925, 127356, 127355, 66478, 4960, 
     5549, 127359, 127346, 8485, 4671, 5418, 127350, 3351, 127006, 127351, 
     10610, 5414, 3064, 6212, 4286, 5421, 127344, 9554, 0, 94048, 127109, 
@@ -19273,16 +19293,16 @@
     12603, 7131, 11430, 4566, 7518, 9317, 3801, 10342, 10406, 0, 119259, 
     42576, 0, 5200, 126611, 917948, 0, 9183, 127361, 74458, 73825, 395, 5482, 
     5198, 4349, 10390, 74202, 5196, 43224, 6113, 42009, 5205, 0, 43307, 0, 
-    118973, 0, 12134, 0, 0, 118843, 9126, 435, 0, 12014, 10377, 8093, 9079, 
-    3203, 192, 65109, 3385, 0, 64430, 5383, 10294, 10326, 128178, 5738, 
-    983213, 3336, 78355, 5361, 3623, 41159, 0, 68112, 7872, 8581, 0, 1260, 
+    118973, 0, 12134, 0, 0, 118843, 9126, 435, 983624, 12014, 10377, 8093, 
+    9079, 3203, 192, 65109, 3385, 0, 64430, 5383, 10294, 10326, 128178, 5738, 
+    983215, 3336, 78355, 5361, 3623, 41159, 0, 68112, 7872, 8581, 0, 1260, 
     3149, 5359, 120134, 0, 7914, 5357, 92170, 128659, 2624, 5364, 0, 11431, 
     120030, 9101, 11058, 78288, 0, 78293, 42271, 78289, 42917, 120793, 0, 
     65566, 6717, 10619, 43360, 78385, 78384, 11832, 78382, 78381, 78380, 
     78379, 9319, 7097, 119055, 77906, 3232, 73824, 74581, 120632, 0, 0, 
     41889, 92453, 0, 1161, 41895, 74103, 9701, 8622, 0, 0, 73819, 120588, 
     5012, 77912, 41362, 69862, 78296, 11921, 0, 11769, 0, 68609, 41364, 0, 
-    74228, 41352, 41361, 0, 41366, 0, 3356, 0, 917, 68422, 119915, 7134, 
+    74228, 41352, 41361, 0, 41366, 0, 3356, 11611, 917, 68422, 119915, 7134, 
     8199, 78389, 119917, 677, 119916, 0, 119932, 127169, 0, 0, 0, 3349, 
     74125, 7022, 8927, 4739, 0, 5802, 0, 8615, 0, 0, 491, 128819, 10190, 
     120698, 65837, 128820, 8426, 11092, 9891, 0, 42497, 7113, 7586, 42305, 
@@ -19310,30 +19330,30 @@
     55252, 73972, 1442, 0, 5894, 70069, 0, 41171, 92511, 74313, 0, 13162, 0, 
     3334, 195010, 118803, 77881, 66022, 0, 0, 1651, 128771, 8861, 0, 0, 1142, 
     0, 8271, 0, 983058, 126645, 12903, 0, 4002, 43626, 10442, 10676, 3344, 0, 
-    0, 12920, 194560, 0, 0, 66642, 1277, 0, 7871, 0, 0, 78853, 0, 78854, 
+    0, 12920, 194560, 0, 0, 66642, 1277, 0, 7871, 0, 194686, 78853, 0, 78854, 
     120360, 0, 11784, 0, 78012, 4700, 66366, 78858, 120359, 11012, 0, 78856, 
     92400, 77879, 4973, 8784, 77877, 74804, 77874, 77869, 77871, 42440, 0, 
     43118, 0, 42364, 6774, 6773, 917560, 120369, 10346, 10410, 78859, 9243, 
     2464, 74263, 6108, 3372, 0, 6247, 43117, 74526, 7121, 74166, 0, 120355, 
     92537, 0, 0, 195034, 0, 0, 0, 70083, 3354, 195037, 4192, 9289, 118999, 
     41191, 3876, 0, 70067, 120660, 43696, 43380, 0, 983091, 0, 0, 11603, 
-    983945, 0, 6589, 128588, 194679, 0, 0, 983691, 0, 0, 42572, 128264, 
+    983954, 0, 6589, 128588, 194679, 0, 0, 983700, 0, 0, 42572, 128264, 
     10630, 74827, 1963, 11622, 127098, 11654, 0, 7550, 10686, 5903, 0, 78009, 
     41329, 9662, 917937, 64698, 3366, 10399, 0, 5542, 11013, 127927, 128300, 
-    0, 78621, 194672, 6925, 0, 0, 917929, 0, 11568, 983664, 43367, 64579, 
+    0, 78621, 194672, 6925, 0, 0, 917929, 0, 11568, 983673, 43367, 64579, 
     917930, 7852, 0, 0, 6754, 6312, 0, 64672, 65296, 0, 118957, 0, 416, 
     12296, 68457, 73834, 68177, 11050, 10984, 92208, 0, 0, 92182, 0, 983605, 
-    9532, 66355, 0, 983228, 917925, 64343, 195032, 128281, 195031, 0, 195030, 
+    9532, 66355, 0, 983234, 917925, 64343, 195032, 128281, 195031, 0, 195030, 
     195057, 11445, 0, 2112, 195056, 128814, 10185, 1021, 128130, 9507, 10210, 
     74544, 8023, 1200, 12243, 78001, 5282, 78003, 9624, 11545, 0, 120493, 
     3343, 4424, 11047, 1885, 43268, 3896, 78444, 66497, 2947, 392, 7894, 
     4391, 68139, 983062, 13059, 74816, 77998, 3381, 7942, 0, 69219, 0, 64757, 
     0, 3913, 0, 0, 78235, 7044, 1265, 0, 6309, 7045, 7175, 7047, 78239, 
-    11791, 0, 0, 8221, 78307, 41864, 0, 0, 0, 0, 167, 983897, 78301, 983644, 
-    74211, 41897, 68477, 0, 917583, 983625, 94065, 2493, 0, 118811, 0, 0, 
+    11791, 0, 0, 8221, 78307, 41864, 0, 0, 0, 0, 167, 983906, 78301, 983653, 
+    74211, 41897, 68477, 0, 917583, 983634, 94065, 2493, 0, 118811, 0, 0, 
     64354, 0, 8777, 0, 406, 8884, 2385, 0, 92450, 0, 917573, 43030, 42027, 
     12114, 0, 917579, 64936, 194695, 0, 120629, 10561, 0, 8365, 120539, 
-    983765, 65841, 120787, 11601, 0, 74121, 0, 917575, 7834, 74159, 0, 
+    983774, 65841, 120787, 11601, 0, 74121, 0, 917575, 7834, 74159, 0, 
     917574, 10298, 6624, 4908, 917596, 1639, 0, 0, 74157, 6327, 6724, 0, 
     128086, 92566, 69910, 4817, 78446, 194759, 92536, 7043, 9600, 11022, 0, 
     0, 0, 0, 0, 0, 7548, 64794, 42050, 12291, 55289, 194761, 12343, 657, 
@@ -19343,14 +19363,14 @@
     41406, 43273, 74160, 119983, 73939, 92638, 119984, 119979, 41404, 1165, 
     119980, 4451, 13087, 0, 11284, 119987, 70097, 65155, 43014, 5439, 9363, 
     70070, 3375, 128869, 5900, 93990, 7889, 2722, 42262, 0, 0, 128774, 0, 
-    2282, 0, 127810, 11401, 983813, 0, 68459, 0, 0, 0, 0, 65438, 0, 7280, 
-    127887, 0, 127381, 4868, 119967, 119966, 118798, 0, 0, 43161, 0, 92360, 
-    0, 5182, 0, 120542, 0, 0, 4226, 119243, 12135, 5732, 4464, 0, 71330, 977, 
+    2282, 0, 127810, 11401, 983822, 0, 68459, 0, 0, 0, 0, 65438, 0, 7280, 
+    127887, 0, 127381, 4868, 8297, 119966, 118798, 0, 0, 43161, 0, 92360, 0, 
+    5182, 0, 120542, 0, 0, 4226, 119243, 12135, 5732, 4464, 0, 71330, 977, 
     4458, 0, 0, 64770, 74838, 0, 344, 0, 194790, 1395, 64279, 0, 92240, 0, 
     786, 0, 43174, 64340, 0, 194767, 120723, 43026, 7612, 10132, 64413, 
     65025, 0, 0, 0, 93956, 0, 68444, 0, 92437, 0, 119160, 10204, 92656, 0, 
-    127809, 983635, 1399, 983643, 65217, 0, 8852, 128571, 241, 128780, 4907, 
-    0, 983630, 7932, 9727, 128873, 74255, 8748, 0, 0, 983634, 0, 42780, 0, 0, 
+    127809, 983644, 1399, 983652, 65217, 0, 8852, 128571, 241, 128780, 4907, 
+    0, 983639, 7932, 9727, 128873, 74255, 8748, 0, 0, 983643, 0, 42780, 0, 0, 
     0, 4217, 0, 8650, 0, 0, 0, 69900, 118872, 43099, 3965, 119119, 6719, 0, 
     13300, 78439, 93971, 43057, 66588, 118991, 0, 0, 73815, 4420, 0, 6410, 
     7760, 0, 0, 0, 0, 0, 7294, 0, 0, 0, 9066, 0, 11993, 43188, 2626, 7762, 0, 
@@ -19358,45 +19378,45 @@
     66454, 9592, 42851, 126993, 1542, 92303, 0, 0, 0, 0, 74311, 78497, 0, 
     10181, 0, 43624, 0, 7779, 0, 10195, 9479, 6029, 0, 92268, 9689, 0, 65577, 
     8993, 66358, 0, 42378, 3368, 606, 127030, 7697, 69237, 69787, 2030, 0, 
-    6027, 8370, 4322, 0, 65207, 0, 983331, 983330, 983329, 983328, 2735, 
+    6027, 8370, 4322, 0, 65207, 0, 983339, 983338, 983337, 983336, 2735, 
     42831, 77935, 127120, 74866, 8881, 119047, 0, 0, 73946, 0, 0, 0, 68140, 
-    983919, 9576, 128872, 3347, 4160, 5154, 55288, 3794, 66564, 8530, 127063, 
-    7709, 41112, 983132, 66560, 42041, 4572, 12876, 66561, 983749, 6758, 
-    983917, 1615, 5855, 809, 0, 92283, 128316, 128004, 5799, 983320, 70100, 
-    983318, 7260, 983316, 43031, 64425, 65128, 78819, 64386, 65257, 0, 68616, 
+    983928, 9576, 128872, 3347, 4160, 5154, 55288, 3794, 66564, 8530, 127063, 
+    7709, 41112, 983132, 66560, 42041, 4572, 12876, 66561, 983758, 6758, 
+    983926, 1615, 5855, 809, 0, 92283, 128316, 128004, 5799, 983328, 70100, 
+    983326, 7260, 983324, 43031, 64425, 65128, 78819, 64386, 65257, 0, 68616, 
     120607, 9347, 128067, 6532, 0, 0, 0, 127060, 65828, 0, 283, 68665, 78813, 
-    532, 78663, 0, 983787, 120609, 0, 3370, 0, 11361, 5443, 78778, 8153, 
-    73767, 0, 10741, 0, 2298, 0, 983908, 65495, 64706, 983310, 43344, 983308, 
-    7144, 9466, 78866, 9824, 983303, 983302, 0, 0, 915, 43425, 0, 0, 0, 0, 
+    532, 78663, 0, 983796, 120609, 0, 3370, 0, 11361, 5443, 78778, 8153, 
+    73767, 0, 10741, 0, 2298, 0, 983917, 65495, 64706, 983318, 43344, 983316, 
+    7144, 9466, 78866, 9824, 983311, 983310, 0, 0, 915, 43425, 0, 0, 0, 0, 
     127178, 43264, 70096, 0, 0, 43038, 78864, 6730, 78862, 68161, 64550, 
     5186, 7360, 127837, 0, 12108, 0, 65124, 43127, 66043, 0, 6326, 43107, 
-    77826, 0, 42562, 0, 128821, 0, 128520, 11485, 6103, 127123, 983297, 
-    11718, 983295, 12889, 92657, 127137, 0, 0, 0, 55245, 0, 1630, 128232, 
+    77826, 0, 42562, 0, 128821, 0, 128520, 11485, 6103, 127123, 983305, 
+    11718, 983303, 12889, 92657, 127137, 0, 0, 0, 55245, 0, 1630, 128232, 
     65483, 0, 12565, 0, 65476, 120013, 0, 119554, 9283, 7700, 917537, 9690, 
     65499, 0, 64593, 512, 3376, 68210, 0, 128677, 77892, 632, 12940, 77891, 
-    42529, 78587, 0, 5957, 110593, 8926, 983291, 983290, 128273, 10745, 
+    42529, 78587, 0, 5957, 110593, 8926, 983299, 983298, 128273, 10745, 
     10174, 7379, 64581, 5386, 120686, 11713, 10633, 69708, 5056, 0, 0, 0, 
     120773, 0, 9812, 0, 4460, 0, 0, 71307, 128038, 0, 0, 127174, 64278, 
     92370, 43466, 0, 0, 64389, 2953, 73879, 1801, 12835, 119029, 0, 73823, 0, 
-    66375, 2085, 702, 42579, 77884, 77885, 13074, 77883, 983278, 983277, 
-    128570, 12106, 983274, 74207, 1755, 10482, 12863, 77898, 1163, 2951, 
+    66375, 2085, 702, 42579, 77884, 77885, 13074, 77883, 983286, 983285, 
+    128570, 12106, 983282, 74207, 1755, 10482, 12863, 77898, 1163, 2951, 
     9522, 74079, 78266, 66604, 0, 3384, 69227, 10702, 830, 77902, 77899, 
     77900, 8451, 0, 0, 0, 69739, 0, 0, 0, 0, 2908, 0, 43386, 64902, 4243, 0, 
-    12239, 0, 0, 4441, 0, 983271, 73940, 64352, 127513, 983267, 411, 983265, 
-    9199, 983263, 4056, 118992, 41890, 0, 2730, 41604, 983928, 5428, 194743, 
+    12239, 0, 0, 4441, 0, 983279, 73940, 64352, 127513, 983275, 411, 983273, 
+    9199, 983271, 4056, 118992, 41890, 0, 2730, 41604, 983937, 5428, 194743, 
     3364, 42265, 64437, 127935, 118816, 194742, 9684, 216, 0, 1401, 128053, 
     44012, 0, 0, 92585, 9158, 77842, 69905, 5768, 0, 0, 0, 484, 194739, 0, 0, 
-    65895, 0, 0, 3338, 73935, 572, 7041, 2736, 67605, 983255, 93962, 2794, 
+    65895, 0, 0, 3338, 73935, 572, 7041, 2736, 67605, 983263, 93962, 2794, 
     8807, 64491, 77847, 5438, 5222, 5381, 43114, 0, 5193, 5125, 5456, 5509, 
     77846, 194747, 9534, 0, 0, 0, 3430, 0, 0, 78717, 0, 981, 0, 4330, 73929, 
     120536, 1824, 10908, 0, 7034, 41683, 64617, 0, 73754, 3957, 64358, 64547, 
-    128259, 674, 63991, 983243, 2946, 5354, 5251, 5328, 5307, 3759, 11411, 
+    128259, 674, 63991, 983249, 2946, 5354, 5251, 5328, 5307, 3759, 11411, 
     8364, 5123, 119628, 5281, 5469, 5121, 119245, 118993, 0, 5130, 0, 0, 
     77990, 0, 120726, 1221, 2733, 11746, 77991, 5216, 0, 0, 0, 0, 3468, 7033, 
     9230, 5939, 195052, 0, 0, 120677, 68400, 7278, 10321, 10289, 64613, 
-    10385, 41706, 0, 0, 983405, 0, 11739, 983418, 41981, 0, 5938, 0, 43766, 
+    10385, 41706, 0, 0, 983413, 0, 11739, 983426, 41981, 0, 5938, 0, 43766, 
     12448, 7576, 10401, 10337, 73852, 0, 13057, 0, 126976, 0, 10009, 0, 
-    41703, 983629, 12165, 0, 0, 9885, 0, 8077, 0, 127908, 0, 0, 0, 92457, 0, 
+    41703, 983638, 12165, 0, 0, 9885, 0, 8077, 0, 127908, 0, 0, 0, 92457, 0, 
     4220, 10725, 10433, 0, 68395, 4987, 64519, 0, 128340, 0, 0, 0, 10970, 
     11733, 0, 120792, 0, 19944, 0, 9009, 8551, 92345, 11468, 64636, 7575, 0, 
     2724, 0, 0, 12313, 110592, 515, 119947, 42791, 63987, 78286, 119943, 
@@ -19406,73 +19426,73 @@
     0, 4477, 118964, 814, 42066, 66183, 66204, 43786, 119961, 66198, 41880, 
     66188, 11623, 78148, 11955, 66190, 66191, 41111, 66189, 73788, 7788, 
     4847, 0, 127759, 0, 0, 0, 1581, 6535, 78161, 12954, 430, 78160, 55259, 
-    78158, 128036, 5278, 4945, 42883, 4950, 983430, 68625, 983428, 7269, 0, 
-    5964, 12908, 983555, 0, 74764, 74477, 119146, 194936, 4949, 983421, 443, 
-    983419, 4944, 5467, 119603, 0, 65137, 6044, 65392, 0, 4213, 0, 41303, 0, 
-    194931, 119962, 41306, 73984, 2698, 127159, 0, 12072, 3193, 0, 41304, 
-    824, 128676, 12091, 78893, 78894, 119816, 4673, 64804, 4678, 119820, 
-    119819, 65059, 0, 6739, 0, 5481, 3490, 1199, 119811, 8356, 69947, 119832, 
-    4677, 12688, 3102, 0, 4672, 78173, 78175, 5531, 68367, 42575, 78170, 
-    78166, 4674, 4548, 44005, 119949, 68658, 119946, 8025, 68630, 127024, 
-    1855, 983404, 68669, 983402, 92445, 127554, 0, 127339, 119652, 2745, 
-    11797, 983410, 128159, 9202, 4654, 983406, 983408, 68638, 73993, 10525, 
-    4649, 65209, 983409, 0, 4648, 43080, 983398, 983399, 983396, 6246, 64950, 
-    7828, 4650, 6777, 6776, 6775, 4653, 7822, 78005, 92384, 43187, 8669, 
-    983407, 6821, 65093, 0, 78881, 2716, 0, 983060, 983411, 0, 68369, 120054, 
-    11060, 8547, 2711, 42165, 78027, 78026, 7992, 0, 0, 4662, 78033, 78032, 
-    9149, 9146, 599, 2081, 78031, 78030, 194962, 4656, 10130, 68450, 7811, 
-    40994, 194965, 6414, 5967, 4658, 3725, 5713, 5814, 4661, 42434, 983403, 
-    0, 0, 64904, 9026, 10833, 74864, 7547, 4867, 0, 10008, 10222, 3054, 
-    194956, 9744, 78860, 7605, 4622, 119656, 983387, 94070, 983385, 983386, 
-    983383, 9045, 78888, 4225, 19926, 78887, 12880, 65307, 4617, 78883, 
-    983378, 41732, 4616, 10518, 10423, 10359, 983372, 5958, 0, 983425, 4215, 
-    9789, 917941, 4321, 4621, 983381, 41313, 522, 5368, 0, 65803, 0, 5366, 
-    12201, 5372, 0, 983401, 0, 7720, 7390, 2696, 983392, 0, 4638, 983397, 
-    1790, 78242, 5965, 64363, 66569, 68646, 127833, 5376, 1835, 5335, 194966, 
-    128089, 4633, 0, 68119, 1180, 4632, 128093, 5387, 5333, 0, 0, 42094, 
-    5331, 4634, 11928, 983594, 5338, 4637, 128170, 5971, 42414, 0, 1268, 
-    65097, 42361, 0, 0, 73853, 1427, 0, 0, 5970, 3431, 0, 10358, 10422, 4758, 
-    983366, 1608, 2738, 0, 10455, 4753, 74026, 11344, 4222, 6240, 5231, 
-    74384, 983370, 68377, 6248, 983354, 983355, 983352, 42318, 92582, 5229, 
+    78158, 128036, 5278, 4945, 42883, 4950, 983438, 68625, 983436, 7269, 0, 
+    5964, 12908, 983555, 0, 74764, 74477, 119146, 194936, 4949, 983429, 443, 
+    983427, 4944, 5467, 119603, 983254, 65137, 6044, 65392, 0, 4213, 0, 
+    41303, 0, 194931, 119962, 41306, 73984, 2698, 127159, 0, 12072, 3193, 0, 
+    41304, 824, 128676, 12091, 78893, 78894, 119816, 4673, 64804, 4678, 
+    119820, 119819, 65059, 0, 6739, 0, 5481, 3490, 1199, 119811, 8356, 69947, 
+    119832, 4677, 12688, 3102, 0, 4672, 78173, 78175, 5531, 68367, 42575, 
+    78170, 78166, 4674, 4548, 44005, 119949, 68658, 119946, 8025, 68630, 
+    127024, 1855, 983412, 68669, 983410, 92445, 127554, 0, 127339, 119652, 
+    2745, 11797, 983418, 128159, 9202, 4654, 983414, 983416, 68638, 73993, 
+    10525, 4649, 65209, 983417, 0, 4648, 43080, 983406, 983407, 983404, 6246, 
+    64950, 7828, 4650, 6777, 6776, 6775, 4653, 7822, 78005, 92384, 43187, 
+    8669, 983415, 6821, 65093, 0, 78881, 2716, 0, 983060, 983419, 0, 68369, 
+    120054, 11060, 8547, 2711, 42165, 78027, 78026, 7992, 0, 0, 4662, 78033, 
+    78032, 9149, 9146, 599, 2081, 78031, 78030, 194962, 4656, 10130, 68450, 
+    7811, 40994, 194965, 6414, 5967, 4658, 3725, 5713, 5814, 4661, 42434, 
+    983411, 0, 0, 64904, 9026, 10833, 74864, 7547, 4867, 0, 10008, 10222, 
+    3054, 194956, 9744, 78860, 7605, 4622, 119656, 983395, 94070, 983393, 
+    983394, 983391, 9045, 78888, 4225, 19926, 78887, 12880, 65307, 4617, 
+    78883, 983386, 41732, 4616, 10518, 10423, 10359, 983380, 5958, 0, 983433, 
+    4215, 9789, 917941, 4321, 4621, 983389, 41313, 522, 5368, 0, 65803, 0, 
+    5366, 12201, 5372, 0, 983409, 0, 7720, 7390, 2696, 983400, 0, 4638, 
+    983405, 1790, 78242, 5965, 64363, 66569, 68646, 127833, 5376, 1835, 5335, 
+    194966, 128089, 4633, 0, 68119, 1180, 4632, 128093, 5387, 5333, 0, 0, 
+    42094, 5331, 4634, 11928, 983594, 5338, 4637, 128170, 5971, 42414, 0, 
+    1268, 65097, 42361, 0, 0, 73853, 1427, 0, 0, 5970, 3431, 0, 10358, 10422, 
+    4758, 983374, 1608, 2738, 0, 10455, 4753, 74026, 11344, 4222, 6240, 5231, 
+    74384, 983378, 68377, 6248, 983362, 983363, 983360, 42318, 92582, 5229, 
     4757, 0, 0, 2728, 4752, 64563, 65235, 5234, 0, 128145, 0, 10713, 7166, 0, 
     2622, 7460, 127302, 0, 0, 8954, 74760, 65189, 2632, 42617, 10108, 1011, 
     5574, 1853, 2709, 65139, 5577, 0, 0, 118871, 68641, 8965, 7635, 42177, 
-    5316, 0, 5314, 6451, 5572, 66464, 5312, 0, 5525, 5330, 5319, 983412, 
-    983863, 194907, 44003, 0, 983472, 983415, 120498, 127851, 195009, 983856, 
-    74022, 983414, 64609, 68643, 120634, 983481, 5721, 983393, 5519, 8632, 
-    66465, 11267, 73961, 92278, 5720, 983344, 1692, 4219, 4610, 8696, 4305, 
-    0, 4609, 43478, 4614, 541, 983347, 5287, 5309, 5285, 68389, 5961, 4647, 
-    56, 4216, 10577, 41381, 601, 4613, 983341, 983338, 77849, 4608, 64260, 
+    5316, 0, 5314, 6451, 5572, 66464, 5312, 0, 5525, 5330, 5319, 983420, 
+    983872, 194907, 44003, 0, 983480, 983423, 120498, 127851, 195009, 983865, 
+    74022, 983422, 64609, 68643, 120634, 983489, 5721, 983401, 5519, 8632, 
+    66465, 11267, 73961, 92278, 5720, 983352, 1692, 4219, 4610, 8696, 4305, 
+    0, 4609, 43478, 4614, 541, 983355, 5287, 5309, 5285, 68389, 5961, 4647, 
+    56, 4216, 10577, 41381, 601, 4613, 983349, 983346, 77849, 4608, 64260, 
     41124, 5190, 67628, 0, 68145, 7086, 0, 67998, 67620, 0, 2734, 11074, 0, 
     67627, 43593, 0, 67625, 5960, 0, 8992, 42593, 128260, 1782, 67622, 68114, 
     119939, 0, 68180, 5501, 119952, 42508, 7442, 43665, 359, 41253, 68392, 
     6239, 119956, 41256, 0, 68134, 0, 74209, 917550, 9346, 69660, 41254, 
     128047, 43291, 3767, 5737, 0, 4865, 0, 5740, 917997, 5736, 4368, 64724, 
-    7193, 68137, 0, 5739, 41024, 4866, 0, 73904, 983831, 4869, 120563, 0, 
-    4223, 128201, 6650, 126509, 0, 983455, 127890, 4870, 120445, 68661, 6716, 
+    7193, 68137, 0, 5739, 41024, 4866, 0, 73904, 983840, 4869, 120563, 0, 
+    4223, 128201, 6650, 126509, 0, 983463, 127890, 4870, 120445, 68661, 6716, 
     78176, 68667, 68382, 68676, 127925, 10122, 4864, 66568, 4144, 7937, 0, 
     6245, 68652, 2732, 42734, 745, 0, 195097, 92195, 4777, 7821, 0, 68631, 
-    42775, 0, 194954, 0, 3097, 0, 5966, 983478, 4778, 0, 10863, 0, 4781, 0, 
+    42775, 0, 194954, 0, 3097, 0, 5966, 983486, 4778, 0, 10863, 0, 4781, 0, 
     64407, 0, 128323, 8577, 128562, 68196, 43285, 10216, 4782, 0, 0, 120757, 
     68618, 12325, 43056, 8717, 0, 0, 4776, 73818, 11492, 8700, 0, 13176, 
     68363, 10426, 0, 917599, 10362, 194706, 1715, 4849, 8242, 9561, 73922, 
     43278, 42635, 0, 0, 5963, 917926, 0, 0, 4850, 0, 1607, 466, 4853, 118995, 
-    4854, 127918, 5164, 983861, 1350, 5124, 64420, 1993, 5362, 8471, 2708, 
+    4854, 127918, 5164, 983870, 1350, 5124, 64420, 1993, 5362, 8471, 2708, 
     92471, 12445, 3785, 234, 3199, 0, 41268, 4848, 2530, 917909, 2068, 1964, 
     0, 73762, 10458, 0, 8576, 78543, 0, 2704, 4794, 0, 68211, 8322, 4797, 
-    5753, 0, 2694, 4792, 0, 2439, 65104, 69804, 983416, 303, 983101, 92622, 
-    983417, 2437, 0, 4221, 4844, 92216, 0, 0, 0, 70042, 0, 43292, 0, 2441, 
+    5753, 0, 2694, 4792, 0, 2439, 65104, 69804, 983424, 303, 983101, 92622, 
+    983425, 2437, 0, 4221, 4844, 92216, 0, 0, 0, 70042, 0, 43292, 0, 2441, 
     10739, 65090, 0, 119327, 126541, 2451, 2714, 119326, 0, 43379, 4937, 
     43376, 753, 5849, 10597, 43089, 11722, 9248, 92555, 42879, 11725, 0, 0, 
     2726, 3107, 73958, 4941, 64937, 119233, 9140, 1408, 5261, 4607, 0, 181, 
-    983422, 4942, 9539, 4938, 0, 65201, 5259, 9369, 64185, 4142, 5257, 
+    983430, 4942, 9539, 4938, 0, 65201, 5259, 9369, 64185, 4142, 5257, 
     983601, 0, 4964, 5264, 64178, 64177, 12979, 41411, 64182, 64181, 64180, 
     64179, 9482, 4873, 41231, 1822, 42526, 128581, 12758, 3865, 0, 0, 10500, 
     0, 119024, 78028, 92408, 9830, 43642, 389, 10893, 7521, 127879, 4872, 
     5463, 0, 3125, 9567, 0, 4878, 5459, 4604, 917931, 9557, 5465, 68617, 0, 
-    11494, 126492, 9563, 10865, 74570, 43279, 64186, 983431, 78714, 64191, 
+    11494, 126492, 9563, 10865, 74570, 43279, 64186, 983439, 78714, 64191, 
     64190, 8898, 64188, 0, 41030, 78836, 0, 917835, 78820, 917834, 0, 78805, 
-    41031, 78801, 11960, 6745, 3082, 983429, 78539, 73919, 10573, 41744, 
+    41031, 78801, 11960, 6745, 3082, 983437, 78539, 73919, 10573, 41744, 
     7079, 5856, 127043, 5163, 78809, 128162, 1817, 66724, 78538, 0, 10564, 
     7763, 13077, 41813, 4400, 41745, 64207, 10275, 8925, 10371, 10307, 41814, 
     4248, 0, 0, 4541, 6299, 64204, 64203, 64201, 64200, 64199, 64198, 126471, 
@@ -19485,33 +19505,33 @@
     65222, 6998, 78180, 0, 3128, 4789, 5067, 5066, 118849, 4784, 0, 8827, 
     1146, 5065, 69890, 78192, 68136, 78190, 43412, 5064, 2431, 0, 9450, 1809, 
     0, 78200, 78201, 5062, 1264, 64817, 13254, 11697, 126598, 9785, 64716, 0, 
-    3933, 74559, 4740, 7954, 0, 0, 42609, 0, 74175, 0, 127016, 0, 983864, 
+    3933, 74559, 4740, 7954, 0, 0, 42609, 0, 74175, 0, 127016, 0, 983873, 
     42130, 0, 5151, 917829, 917823, 0, 93980, 0, 7620, 3800, 65122, 0, 0, 
     8355, 7854, 0, 954, 64927, 4185, 41045, 127141, 41438, 41439, 68666, 
-    10711, 4593, 127745, 120584, 983400, 64774, 8053, 10532, 66727, 0, 0, 0, 
+    10711, 4593, 127745, 120584, 983408, 64774, 8053, 10532, 66727, 0, 0, 0, 
     64759, 6381, 5166, 9888, 127800, 5148, 42834, 0, 78205, 78206, 43787, 
     78204, 64131, 3119, 917814, 0, 3060, 64135, 9986, 0, 77876, 636, 11698, 
-    0, 983443, 9916, 11701, 7836, 42741, 64137, 8320, 78640, 8863, 92431, 
-    119960, 1477, 43289, 0, 74358, 8618, 983394, 9908, 983972, 0, 0, 3937, 
-    12312, 0, 983395, 0, 64781, 912, 6349, 4536, 93954, 74532, 126594, 6244, 
-    92209, 71341, 3935, 120665, 983468, 0, 11950, 5392, 42248, 65129, 68656, 
+    0, 983451, 9916, 11701, 7836, 42741, 64137, 8320, 78640, 8863, 92431, 
+    119960, 1477, 43289, 0, 74358, 8618, 983402, 9908, 983981, 0, 0, 3937, 
+    12312, 0, 983403, 0, 64781, 912, 6349, 4536, 93954, 74532, 126594, 6244, 
+    92209, 71341, 3935, 120665, 983476, 0, 11950, 5392, 42248, 65129, 68656, 
     5397, 0, 12046, 12599, 0, 128261, 5395, 0, 5393, 354, 68615, 119948, 
     78503, 0, 0, 42039, 0, 0, 64142, 626, 0, 5895, 0, 0, 5780, 0, 0, 128874, 
     0, 0, 43297, 983079, 4311, 4644, 8818, 0, 128186, 0, 7145, 3918, 66452, 
     3797, 1644, 92346, 9658, 4140, 11385, 65947, 6455, 9030, 813, 119945, 
     68131, 4146, 119957, 5360, 2466, 0, 67669, 119942, 6249, 42117, 92287, 
-    128224, 0, 0, 74046, 43745, 4911, 988, 917807, 0, 983460, 43061, 7054, 
+    128224, 0, 0, 74046, 43745, 4911, 988, 917807, 0, 983468, 43061, 7054, 
     64147, 0, 64920, 68195, 6698, 118933, 92506, 0, 120006, 11981, 12202, 0, 
     11032, 67654, 6093, 11608, 975, 68662, 65843, 170, 0, 0, 4169, 0, 41859, 
     6058, 120401, 13203, 120657, 0, 0, 68657, 9818, 10178, 10324, 42106, 
     5898, 74540, 4738, 41856, 7062, 917865, 4737, 11779, 4742, 120564, 92391, 
-    73736, 983356, 9825, 6448, 6715, 127008, 4831, 0, 92525, 0, 5300, 4741, 
-    42108, 983346, 64159, 4736, 64148, 0, 849, 92191, 78491, 43288, 0, 66620, 
-    917916, 127331, 65549, 9496, 64598, 118866, 983358, 7876, 68132, 917872, 
+    73736, 983364, 9825, 6448, 6715, 127008, 4831, 0, 92525, 0, 5300, 4741, 
+    42108, 983354, 64159, 4736, 64148, 0, 849, 92191, 78491, 43288, 0, 66620, 
+    917916, 127331, 65549, 9496, 64598, 118866, 983366, 7876, 68132, 917872, 
     3928, 917870, 43378, 10706, 7198, 0, 4842, 12053, 128129, 0, 4841, 0, 
     4171, 12008, 6251, 3923, 1490, 0, 119591, 126512, 40972, 5245, 0, 10114, 
     42001, 41888, 4845, 8332, 40974, 64347, 4840, 9077, 78346, 1747, 917849, 
-    4825, 69240, 917852, 68655, 0, 983380, 0, 0, 68628, 983339, 9850, 118937, 
+    4825, 69240, 917852, 68655, 0, 983388, 0, 0, 68628, 983347, 9850, 118937, 
     367, 1472, 917859, 6687, 1274, 0, 5905, 12339, 8919, 73953, 10907, 65261, 
     11023, 119559, 4830, 9134, 78666, 64126, 43011, 0, 126626, 64101, 0, 0, 
     4824, 10614, 119659, 0, 1888, 1960, 7861, 917856, 78524, 41836, 43012, 
@@ -19520,12 +19540,12 @@
     64118, 126998, 12962, 0, 126580, 4017, 12827, 5241, 120392, 0, 41118, 
     3924, 0, 11366, 917843, 0, 0, 917846, 41116, 917844, 917564, 0, 11363, 
     12057, 11917, 1567, 74000, 4721, 126641, 66202, 8957, 4139, 0, 0, 0, 0, 
-    0, 12740, 128702, 4722, 6816, 127793, 12759, 4725, 983375, 4726, 0, 
-    194892, 0, 128321, 917905, 0, 12755, 12762, 4015, 0, 8052, 476, 0, 0, 
-    128294, 64212, 41020, 1382, 64209, 64216, 44002, 64214, 1656, 41831, 0, 
-    0, 41843, 8720, 3908, 1452, 13111, 0, 64067, 127328, 8552, 64113, 41845, 
-    3849, 78732, 66232, 9778, 120066, 5891, 7064, 55, 9948, 119085, 0, 0, 
-    7935, 2420, 0, 1114, 92599, 67585, 70104, 120053, 92350, 120051, 3938, 
+    0, 12740, 128702, 4722, 6816, 127793, 12759, 4725, 983383, 4726, 0, 
+    194892, 983622, 128321, 917905, 0, 12755, 12762, 4015, 0, 8052, 476, 0, 
+    0, 128294, 64212, 41020, 1382, 64209, 64216, 44002, 64214, 1656, 41831, 
+    0, 0, 41843, 8720, 3908, 1452, 13111, 0, 64067, 127328, 8552, 64113, 
+    41845, 3849, 78732, 66232, 9778, 120066, 5891, 7064, 55, 9948, 119085, 0, 
+    0, 7935, 2420, 0, 1114, 92599, 67585, 70104, 120053, 92350, 120051, 3938, 
     120057, 65417, 64717, 120060, 120061, 65415, 120059, 6292, 65303, 7955, 
     6452, 4713, 128196, 66249, 917885, 917890, 917891, 65152, 719, 120044, 
     78623, 120042, 6713, 4532, 65412, 69822, 10868, 4717, 2349, 5902, 66450, 
@@ -19537,26 +19557,26 @@
     4814, 0, 4810, 0, 0, 64928, 10543, 0, 3522, 71335, 414, 65404, 0, 195027, 
     6456, 73820, 0, 6691, 42193, 92225, 128171, 0, 74495, 0, 0, 0, 118820, 
     9751, 65407, 128085, 11770, 3919, 0, 0, 65061, 0, 0, 0, 12235, 0, 0, 
-    127233, 64092, 983462, 64080, 0, 64090, 0, 69913, 10162, 10310, 0, 8454, 
+    127233, 64092, 983470, 64080, 0, 64090, 0, 69913, 10162, 10310, 0, 8454, 
     127888, 42038, 387, 41363, 12737, 0, 4780, 43368, 0, 64310, 64621, 6732, 
-    78116, 0, 983139, 0, 983074, 8896, 0, 375, 6976, 66582, 119005, 983865, 
-    0, 983426, 119202, 119203, 12526, 43120, 2315, 0, 1938, 119197, 0, 4529, 
-    119200, 119201, 119198, 119199, 69692, 983424, 69698, 13150, 64492, 0, 0, 
+    78116, 0, 983139, 0, 983074, 8896, 0, 375, 6976, 66582, 119005, 983874, 
+    0, 983434, 119202, 119203, 12526, 43120, 2315, 0, 1938, 119197, 0, 4529, 
+    119200, 119201, 119198, 119199, 69692, 983432, 69698, 13150, 64492, 0, 0, 
     2291, 12902, 0, 42891, 66327, 74298, 917857, 10799, 69690, 2587, 66372, 
     0, 4193, 92250, 4241, 983057, 7998, 0, 0, 0, 126640, 2316, 118821, 0, 0, 
-    0, 64297, 74799, 92442, 74140, 0, 5373, 0, 983877, 3762, 10015, 120672, 
+    0, 64297, 74799, 92442, 74140, 0, 5373, 0, 983886, 3762, 10015, 120672, 
     119232, 0, 41590, 0, 70098, 3780, 7485, 5779, 0, 42037, 0, 3906, 12349, 
     0, 8326, 0, 65498, 3763, 6983, 5618, 0, 3779, 0, 43613, 0, 0, 0, 0, 0, 0, 
     280, 74558, 127332, 68138, 13072, 1894, 0, 0, 65478, 43310, 7231, 0, 
-    11773, 0, 0, 0, 0, 2551, 0, 6453, 10200, 6235, 983743, 119237, 0, 128805, 
+    11773, 0, 0, 0, 0, 2551, 0, 6453, 10200, 6235, 983752, 119237, 0, 128805, 
     4470, 11826, 917557, 7780, 5369, 118958, 5249, 0, 5367, 8756, 127143, 0, 
-    5377, 120585, 68143, 1688, 78245, 983348, 69685, 983747, 0, 0, 44020, 
+    5377, 120585, 68143, 1688, 78245, 983356, 69685, 983756, 0, 0, 44020, 
     6808, 41319, 1300, 10650, 41692, 64505, 2290, 0, 119624, 1465, 10850, 
     3943, 0, 41205, 41315, 118961, 0, 0, 5352, 0, 0, 8839, 41314, 7384, 7785, 
     41204, 127322, 41209, 69637, 92241, 43607, 0, 0, 5420, 3897, 10134, 0, 
     74417, 4018, 7150, 68127, 0, 0, 0, 0, 127526, 2561, 68621, 3542, 7148, 
     12076, 7951, 68152, 118857, 5303, 6276, 1706, 0, 78751, 7146, 0, 65150, 
-    41819, 0, 73951, 10847, 41822, 9985, 860, 0, 10506, 983427, 69641, 10753, 
+    41819, 0, 73951, 10847, 41822, 9985, 860, 0, 10506, 983435, 69641, 10753, 
     10830, 0, 615, 64490, 7574, 92617, 77922, 0, 12909, 43016, 64559, 127028, 
     0, 0, 67996, 2020, 0, 4022, 128783, 0, 77923, 126593, 41691, 0, 0, 74329, 
     0, 64622, 9070, 0, 68411, 3911, 42829, 43122, 1033, 74440, 0, 7000, 3904, 
@@ -19571,7 +19591,7 @@
     68675, 128054, 1511, 9324, 78211, 10519, 66331, 3454, 19930, 0, 41019, 0, 
     0, 65292, 6822, 12862, 0, 0, 42143, 41828, 78207, 65531, 78208, 118879, 
     55223, 0, 128071, 41826, 8865, 6402, 0, 13279, 7917, 74755, 0, 7733, 0, 
-    4998, 983887, 92332, 41950, 0, 4268, 0, 0, 70061, 4013, 0, 10881, 0, 0, 
+    4998, 983896, 92332, 41950, 0, 4268, 0, 0, 70061, 4013, 0, 10881, 0, 0, 
     0, 74788, 2014, 0, 0, 9765, 0, 0, 0, 195059, 78357, 65281, 127825, 10949, 
     0, 0, 0, 2015, 0, 0, 0, 66318, 43233, 0, 42517, 0, 0, 0, 12698, 8094, 
     10135, 65909, 6474, 794, 0, 12656, 128122, 119353, 128270, 1665, 0, 4833, 
@@ -19590,9 +19610,9 @@
     9425, 9426, 9427, 9428, 9429, 64758, 2362, 9655, 0, 2004, 9096, 9782, 
     128848, 9172, 128545, 19965, 0, 5955, 67666, 1108, 0, 74773, 0, 0, 64782, 
     3926, 92448, 65210, 8798, 0, 92165, 1392, 0, 0, 127364, 10606, 8065, 
-    118805, 10353, 10417, 0, 0, 64524, 92418, 4019, 0, 983280, 43280, 8219, 
-    68402, 1812, 119963, 983683, 0, 126488, 42410, 74448, 119132, 6054, 
-    10697, 3169, 42297, 42322, 10642, 3909, 9950, 0, 128139, 983253, 68678, 
+    118805, 10353, 10417, 0, 0, 64524, 92418, 4019, 0, 983288, 43280, 8219, 
+    68402, 1812, 119963, 983692, 0, 126488, 42410, 74448, 119132, 6054, 
+    10697, 3169, 42297, 42322, 10642, 3909, 9950, 0, 128139, 983261, 68678, 
     0, 0, 1049, 0, 65707, 2304, 41806, 92326, 42336, 3921, 0, 11775, 64760, 
     11766, 1038, 42303, 9823, 127278, 69236, 4008, 64004, 8773, 10733, 36, 0, 
     5153, 41805, 0, 73735, 763, 41808, 64910, 983130, 2009, 0, 0, 127142, 
@@ -19607,7 +19627,7 @@
     78002, 0, 7513, 1863, 4710, 0, 5956, 7621, 78006, 92624, 4705, 716, 
     78004, 0, 4704, 120040, 120270, 42241, 161, 43977, 74546, 66214, 4706, 0, 
     69914, 42672, 4709, 10680, 119065, 43293, 119944, 0, 119164, 120328, 
-    92467, 10187, 1700, 119223, 0, 0, 128119, 4004, 0, 10968, 43296, 983633, 
+    92467, 10187, 1700, 119223, 0, 0, 128119, 4004, 0, 10968, 43296, 983642, 
     8506, 0, 0, 126996, 1005, 937, 78216, 4734, 2870, 0, 78218, 983109, 7463, 
     4729, 0, 235, 1384, 4728, 0, 120420, 92490, 74449, 8109, 43105, 983174, 
     4730, 447, 13186, 1513, 4733, 120415, 0, 0, 42527, 12911, 43427, 1383, 
@@ -19618,7 +19638,7 @@
     12769, 65905, 41697, 1283, 120302, 4779, 0, 3719, 4006, 983569, 19957, 
     128773, 2021, 119332, 120699, 119150, 43028, 65493, 41838, 3875, 5962, 
     64341, 92616, 9814, 43457, 5827, 3314, 7787, 78234, 65494, 68153, 0, 0, 
-    120636, 64531, 120692, 194626, 0, 0, 66316, 65467, 5771, 41298, 983785, 
+    120636, 64531, 120692, 194626, 0, 0, 66316, 65467, 5771, 41298, 983794, 
     9742, 521, 0, 10800, 92222, 8404, 194625, 483, 7096, 7089, 66323, 928, 0, 
     0, 119018, 10599, 11586, 3989, 10971, 43748, 65782, 9841, 8843, 12145, 
     92470, 10074, 78548, 0, 3769, 0, 0, 0, 983107, 9573, 0, 65290, 8849, 0, 
@@ -19626,17 +19646,17 @@
     73838, 78553, 5825, 13007, 68165, 0, 120457, 12661, 7608, 10354, 10418, 
     42411, 2022, 0, 1409, 12195, 4001, 3112, 10824, 120639, 1390, 0, 0, 421, 
     43536, 5846, 120120, 4130, 127775, 7595, 42588, 7600, 120121, 66035, 
-    983904, 0, 65851, 42607, 128190, 92403, 3168, 0, 42134, 11831, 2370, 
+    983913, 0, 65851, 42607, 128190, 92403, 3168, 0, 42134, 11831, 2370, 
     2846, 92605, 0, 0, 120132, 0, 1836, 0, 0, 92558, 3740, 69843, 6290, 
     65374, 120451, 2390, 3944, 66628, 120434, 0, 6135, 3118, 74265, 119093, 
-    120446, 0, 0, 8127, 8975, 64739, 7943, 983734, 0, 10618, 2584, 0, 0, 0, 
+    120446, 0, 0, 8127, 8975, 64739, 7943, 983743, 0, 10618, 2584, 0, 0, 0, 
     9998, 128564, 0, 0, 0, 0, 6204, 0, 0, 8279, 8776, 64954, 4975, 70075, 
     120130, 4267, 1631, 42206, 77983, 0, 195046, 65700, 66562, 0, 64645, 0, 
-    0, 126588, 12586, 0, 9242, 127922, 0, 4523, 5842, 10495, 3122, 983788, 
+    0, 126588, 12586, 0, 9242, 127922, 0, 4523, 5842, 10495, 3122, 983797, 
     7793, 78275, 9328, 119104, 78393, 12604, 0, 6615, 2285, 92344, 3986, 
-    44025, 0, 8912, 64555, 7409, 0, 983350, 9541, 78276, 0, 11275, 8540, 
-    11498, 0, 983349, 41040, 2459, 0, 13060, 41041, 74413, 983138, 0, 0, 
-    68427, 10450, 12551, 41043, 7020, 120353, 3765, 983342, 0, 1606, 120348, 
+    44025, 0, 8912, 64555, 7409, 0, 983358, 9541, 78276, 0, 11275, 8540, 
+    11498, 0, 983357, 41040, 2459, 0, 13060, 41041, 74413, 983138, 0, 0, 
+    68427, 10450, 12551, 41043, 7020, 120353, 3765, 983350, 0, 1606, 120348, 
     120351, 3093, 68436, 0, 983061, 119613, 0, 0, 4312, 74091, 120337, 
     120336, 11923, 4023, 120333, 5763, 94015, 4827, 10894, 12810, 64406, 
     118785, 4455, 74321, 433, 119620, 66660, 2499, 0, 0, 118837, 11973, 
@@ -19646,25 +19666,25 @@
     7004, 0, 65880, 127886, 119048, 2380, 11380, 0, 93996, 2376, 0, 119320, 
     0, 5197, 127046, 127047, 127048, 2366, 127050, 127051, 120554, 120045, 0, 
     0, 0, 983084, 0, 0, 0, 74188, 71342, 983086, 983573, 120047, 128575, 0, 
-    0, 120049, 0, 1847, 0, 10339, 983357, 42384, 0, 4227, 74158, 0, 92501, 
-    43032, 0, 42365, 0, 12671, 11384, 0, 983457, 0, 64797, 983337, 5820, 
-    983336, 120052, 120065, 0, 120064, 120650, 42137, 9893, 2754, 12664, 
+    0, 120049, 0, 1847, 0, 10339, 983365, 42384, 0, 4227, 74158, 0, 92501, 
+    43032, 0, 42365, 0, 12671, 11384, 0, 983465, 0, 64797, 983345, 5820, 
+    983344, 120052, 120065, 0, 120064, 120650, 42137, 9893, 2754, 12664, 
     120063, 0, 7377, 127867, 41799, 65530, 1711, 12984, 43039, 3114, 6255, 
-    983332, 118938, 0, 10853, 926, 983361, 74184, 983360, 120055, 0, 43175, 
+    983340, 118938, 0, 10853, 926, 983369, 74184, 983368, 120055, 0, 43175, 
     0, 43037, 41798, 41035, 11583, 127769, 41801, 119088, 119605, 520, 4200, 
-    12699, 8331, 0, 3091, 41034, 127353, 983672, 8360, 0, 78044, 321, 4229, 
+    12699, 8331, 0, 3091, 41034, 127353, 983681, 8360, 0, 78044, 321, 4229, 
     64543, 917946, 65563, 0, 917974, 2861, 43793, 10095, 0, 9195, 92386, 
     1861, 0, 73733, 0, 0, 43041, 0, 43794, 128530, 3859, 12181, 41660, 8209, 
     0, 73867, 12973, 0, 74757, 127514, 41658, 0, 0, 5760, 0, 743, 4414, 
     120766, 0, 42632, 917973, 65161, 73896, 128589, 0, 1405, 119063, 43220, 
     43341, 0, 19919, 0, 64532, 65367, 43710, 0, 0, 3513, 0, 118883, 43342, 
     119064, 65529, 65364, 128197, 0, 6485, 1397, 0, 41986, 92678, 0, 0, 
-    74097, 0, 7471, 12079, 67997, 12682, 43287, 92317, 0, 983143, 983698, 0, 
+    74097, 0, 7471, 12079, 67997, 12682, 43287, 92317, 0, 983143, 983707, 0, 
     0, 1099, 10490, 0, 10501, 65181, 74463, 0, 464, 41624, 65283, 67663, 
     78222, 1346, 0, 917631, 64573, 64897, 423, 1818, 65144, 0, 8272, 127812, 
-    19911, 4218, 3087, 64960, 127234, 43564, 0, 0, 9584, 10465, 983893, 
+    19911, 4218, 3087, 64960, 127234, 43564, 0, 0, 9584, 10465, 983902, 
     74359, 12626, 9106, 0, 42642, 120230, 64750, 9390, 0, 41797, 0, 0, 265, 
-    41795, 64666, 126508, 43530, 2752, 0, 0, 983485, 59, 0, 983593, 0, 92371, 
+    41795, 64666, 126508, 43530, 2752, 0, 0, 983493, 59, 0, 983593, 0, 92371, 
     77873, 41810, 0, 7010, 0, 41809, 41495, 119364, 0, 42252, 42213, 8009, 
     3305, 43033, 511, 92700, 66255, 13127, 120067, 0, 74397, 120235, 917977, 
     65915, 1400, 41812, 10685, 194870, 2103, 10387, 4453, 43276, 917783, 
@@ -19675,17 +19695,17 @@
     0, 41841, 43338, 0, 0, 5726, 64915, 42175, 0, 0, 41497, 65044, 120109, 
     2851, 43017, 983589, 0, 4373, 78058, 0, 9587, 1789, 6671, 128840, 3100, 
     0, 65360, 0, 92365, 917789, 64922, 0, 8190, 12083, 0, 0, 6506, 64312, 
-    74374, 2368, 0, 4419, 983838, 119125, 3439, 1825, 1192, 120106, 8891, 
+    74374, 2368, 0, 4419, 983847, 119125, 3439, 1825, 1192, 120106, 8891, 
     3080, 120228, 2347, 5430, 0, 8990, 2848, 0, 128223, 92528, 249, 0, 0, 0, 
     120658, 0, 0, 8883, 917802, 728, 68178, 995, 0, 0, 64826, 0, 917798, 
-    128348, 0, 19945, 8091, 558, 0, 12273, 194814, 983841, 12112, 69912, 0, 
+    128348, 0, 19945, 8091, 558, 0, 12273, 194814, 983850, 12112, 69912, 0, 
     0, 74419, 12335, 120104, 917795, 3443, 3129, 0, 2102, 65445, 78258, 
     64891, 0, 7725, 65108, 78255, 0, 8624, 69246, 12446, 43295, 0, 41894, 0, 
     6277, 41672, 41893, 10010, 128678, 3540, 128649, 835, 71340, 69816, 
     119868, 74408, 0, 73959, 5426, 4258, 0, 0, 5424, 128127, 8283, 0, 5434, 
     983590, 0, 19917, 11408, 0, 11947, 0, 1404, 3095, 11432, 128307, 3464, 
     6486, 4819, 128233, 0, 570, 8095, 3672, 119864, 1498, 67866, 0, 128539, 
-    431, 0, 0, 128182, 128096, 68167, 983654, 13096, 128643, 0, 43408, 9516, 
+    431, 0, 0, 128182, 128096, 68167, 983663, 13096, 128643, 0, 43408, 9516, 
     128538, 5268, 42230, 42220, 0, 4450, 120511, 11547, 43417, 128542, 356, 
     3477, 227, 10488, 68203, 382, 11418, 0, 195066, 0, 0, 0, 0, 6484, 2541, 
     66039, 0, 78718, 92723, 3549, 0, 9110, 119665, 2743, 0, 43290, 194812, 
@@ -19694,7 +19714,7 @@
     12849, 3953, 1897, 0, 65094, 11994, 4339, 74556, 92654, 67843, 0, 0, 0, 
     68473, 74104, 5228, 128804, 7868, 43184, 0, 0, 73986, 43438, 0, 43022, 0, 
     1162, 917847, 2671, 0, 0, 92632, 92631, 118865, 4553, 73811, 0, 195005, 
-    0, 0, 19921, 74331, 11424, 195006, 4567, 41891, 0, 983779, 55249, 4820, 
+    0, 0, 19921, 74331, 11424, 195006, 4567, 41891, 0, 983788, 55249, 4820, 
     65239, 194662, 0, 194665, 43042, 119212, 1377, 12869, 4897, 42821, 9250, 
     0, 4438, 64385, 0, 1753, 11331, 6147, 194941, 43282, 8833, 0, 0, 6504, 
     78408, 126979, 10719, 0, 1898, 1413, 42443, 0, 802, 12141, 0, 194671, 
@@ -19703,7 +19723,7 @@
     78719, 66573, 0, 78724, 78712, 11761, 194655, 0, 41094, 0, 0, 194893, 0, 
     92689, 6196, 6945, 93969, 194890, 128184, 120491, 11816, 194943, 5733, 
     2930, 0, 0, 41098, 0, 41093, 0, 66626, 588, 9760, 0, 194717, 1238, 200, 
-    983205, 1660, 73916, 0, 118905, 74362, 0, 92485, 194651, 0, 983697, 3394, 
+    983207, 1660, 73916, 0, 118905, 74362, 0, 92485, 194651, 0, 983706, 3394, 
     194894, 120668, 0, 0, 127358, 66219, 127183, 43284, 194656, 7817, 1841, 
     11055, 120533, 194979, 194982, 1669, 10776, 194981, 7701, 194980, 0, 
     194995, 1732, 4030, 0, 3963, 66611, 127530, 41768, 6491, 0, 65324, 914, 
@@ -19711,30 +19731,30 @@
     12009, 12399, 0, 67852, 65537, 0, 10841, 43430, 5301, 0, 92618, 5734, 
     8960, 0, 92527, 65317, 77880, 0, 0, 0, 12304, 0, 0, 65315, 92670, 128511, 
     0, 0, 0, 119621, 92529, 74536, 12447, 64486, 127374, 126562, 983129, 0, 
-    0, 983793, 42767, 10915, 0, 12007, 43695, 120520, 11975, 194878, 0, 
+    0, 983802, 42767, 10915, 0, 12007, 43695, 120520, 11975, 194878, 0, 
     92604, 2555, 8629, 128640, 43168, 41872, 43706, 4496, 194879, 128148, 
     120241, 0, 0, 0, 0, 64730, 70041, 66714, 68222, 0, 70076, 65596, 92306, 
     11416, 4280, 67655, 8765, 12784, 7792, 1393, 126473, 67871, 74386, 0, 
     8233, 12820, 0, 6683, 194876, 3442, 12144, 2841, 12543, 0, 1473, 42820, 
     64329, 127832, 0, 68642, 6488, 357, 1048, 41100, 0, 41104, 94003, 3406, 
     1054, 71320, 1040, 65450, 0, 4434, 1069, 0, 118862, 65737, 917765, 
-    128705, 0, 983684, 9693, 41943, 126564, 41931, 41759, 12757, 4353, 0, 
-    1059, 9790, 8995, 119974, 983687, 65937, 0, 41764, 10646, 0, 118833, 
-    92372, 0, 74830, 78569, 12743, 983680, 6480, 917761, 41779, 42580, 66601, 
-    12207, 119619, 6335, 66602, 11312, 64807, 0, 0, 41767, 119629, 983755, 
-    43020, 128271, 3955, 74254, 0, 983745, 917861, 0, 77926, 9770, 9246, 
+    128705, 0, 983693, 9693, 41943, 126564, 41931, 41759, 12757, 4353, 0, 
+    1059, 9790, 8995, 119974, 983696, 65937, 0, 41764, 10646, 0, 118833, 
+    92372, 0, 74830, 78569, 12743, 983689, 6480, 917761, 41779, 42580, 66601, 
+    12207, 119619, 6335, 66602, 11312, 64807, 0, 0, 41767, 119629, 983764, 
+    43020, 128271, 3955, 74254, 0, 983754, 917861, 0, 77926, 9770, 9246, 
     12230, 0, 0, 0, 10448, 41783, 41786, 127093, 12797, 2755, 64571, 78578, 
     194927, 4857, 0, 4428, 12794, 73755, 128061, 78574, 0, 74284, 0, 5747, 
     78825, 0, 7978, 41092, 74571, 0, 11924, 43812, 42144, 65015, 0, 563, 0, 
-    983682, 12798, 11271, 57, 0, 0, 917860, 119043, 0, 94051, 43137, 694, 0, 
+    983691, 12798, 11271, 57, 0, 0, 917860, 119043, 0, 94051, 43137, 694, 0, 
     9876, 0, 119168, 0, 78822, 64537, 0, 277, 74385, 7229, 12761, 0, 0, 
     13025, 64811, 8757, 78824, 126478, 1574, 7381, 0, 2525, 4852, 5749, 
     68465, 13027, 42824, 120574, 1039, 7151, 10155, 5745, 188, 41858, 11592, 
     0, 74015, 9055, 41853, 4858, 917780, 0, 436, 4771, 0, 2786, 0, 4856, 
     8051, 0, 119609, 71327, 9644, 0, 0, 0, 194916, 120732, 66710, 118834, 
-    983351, 73906, 128680, 127114, 0, 10234, 5843, 11939, 0, 42157, 0, 3157, 
+    983359, 73906, 128680, 127114, 0, 10234, 5843, 11939, 0, 42157, 0, 3157, 
     194918, 68393, 0, 3504, 119178, 0, 10822, 5149, 66029, 10226, 65142, 
-    128025, 3594, 42424, 194959, 40, 12657, 983656, 0, 386, 0, 8834, 0, 
+    128025, 3594, 42424, 194959, 40, 12657, 983665, 0, 386, 0, 8834, 0, 
     12815, 43574, 0, 73907, 0, 74196, 7220, 74504, 0, 74316, 0, 65322, 4304, 
     74503, 8160, 78707, 194753, 0, 0, 128526, 1348, 92349, 78597, 126539, 
     13303, 0, 92392, 194755, 7599, 1278, 43616, 13269, 0, 0, 74387, 78179, 
@@ -19746,25 +19766,25 @@
     42507, 1962, 43305, 78476, 42505, 11660, 0, 2072, 92312, 6995, 74173, 
     5437, 74174, 10669, 8702, 7964, 92352, 0, 199, 194843, 4105, 194845, 
     194699, 194847, 194710, 119875, 13148, 7560, 78479, 9226, 78480, 195070, 
-    6472, 65814, 73954, 0, 4724, 0, 0, 9191, 0, 64432, 983808, 983241, 
+    6472, 65814, 73954, 0, 4724, 0, 0, 9191, 0, 64432, 983817, 983247, 
     195024, 10196, 7886, 0, 6585, 0, 6680, 195042, 0, 195051, 6679, 74412, 
-    92251, 194866, 74421, 11382, 983622, 983628, 127891, 127484, 194833, 
+    92251, 194866, 74421, 11382, 983631, 983637, 127891, 127484, 194833, 
     194832, 6681, 127482, 12693, 194836, 42727, 78196, 128252, 78195, 65442, 
-    119610, 69733, 9989, 43248, 66248, 194816, 0, 194818, 128845, 194820, 
+    119610, 69733, 9989, 43248, 66248, 194816, 0, 11321, 128845, 194820, 
     194819, 5297, 7042, 13284, 6112, 7968, 194825, 73927, 92444, 194736, 
     65746, 127476, 69889, 74389, 128696, 4342, 42839, 194831, 1677, 0, 0, 
     126590, 917855, 11091, 11011, 2719, 0, 0, 119595, 10160, 0, 0, 7585, 
     65169, 2052, 4308, 92174, 43000, 7505, 543, 64916, 64736, 0, 0, 64655, 0, 
-    118922, 2064, 0, 43158, 7902, 0, 65265, 194639, 0, 127170, 0, 0, 0, 0, 
-    12994, 92728, 10828, 983934, 6228, 4307, 3482, 128527, 0, 0, 0, 506, 
-    74573, 41194, 65735, 2055, 43255, 41195, 0, 8169, 983671, 8841, 0, 516, 
+    118922, 2064, 0, 43158, 7902, 0, 65265, 194639, 0, 127170, 0, 983625, 0, 
+    0, 12994, 92728, 10828, 983943, 6228, 4307, 3482, 128527, 0, 0, 0, 506, 
+    74573, 41194, 65735, 2055, 43255, 41195, 0, 8169, 983680, 8841, 0, 516, 
     93974, 2063, 119051, 34, 128850, 120186, 11504, 1612, 74333, 120182, 
     11827, 74308, 12001, 120178, 10242, 64564, 120179, 67986, 6584, 7749, 
     11037, 0, 1758, 127092, 10667, 10560, 120197, 92593, 1935, 11517, 120193, 
     120196, 120195, 1931, 120189, 74839, 120191, 1217, 64702, 12643, 825, 
     127838, 194905, 12294, 92428, 78834, 9138, 78831, 78833, 12631, 78829, 
     11080, 74554, 64000, 5591, 1239, 0, 11313, 0, 3403, 0, 0, 64364, 92269, 
-    0, 74582, 8998, 12988, 0, 9152, 983840, 0, 126484, 67589, 41850, 64290, 
+    0, 74582, 8998, 12988, 0, 9152, 983849, 0, 126484, 67589, 41850, 64290, 
     3433, 92393, 12615, 1594, 42192, 6914, 67603, 0, 119569, 74565, 41353, 
     67602, 67611, 4337, 0, 127296, 918, 65035, 41351, 7681, 194900, 42577, 
     41393, 12668, 194904, 2477, 127285, 0, 127301, 0, 67604, 194880, 127235, 
@@ -19776,14 +19796,14 @@
     73796, 0, 119228, 12035, 0, 2818, 0, 74411, 73793, 0, 4172, 0, 0, 8373, 
     10873, 12197, 0, 0, 92265, 69706, 0, 78210, 0, 128110, 194865, 126982, 
     74563, 64828, 11419, 194868, 766, 1257, 0, 118845, 11381, 3265, 66617, 
-    3274, 127365, 126523, 94042, 983941, 74522, 41989, 0, 0, 128798, 3263, 0, 
+    3274, 127365, 126523, 94042, 983950, 74522, 41989, 0, 0, 128798, 3263, 0, 
     65672, 0, 3270, 64539, 11489, 0, 0, 0, 0, 9505, 65518, 194776, 756, 
     194605, 0, 0, 0, 7261, 0, 186, 0, 119156, 5770, 13179, 65830, 12612, 
-    12949, 64856, 12800, 983892, 74203, 64718, 11507, 0, 92434, 118929, 0, 
+    12949, 64856, 12800, 983901, 74203, 64718, 11507, 0, 92434, 118929, 0, 
     11578, 0, 119296, 0, 0, 0, 0, 74568, 9254, 0, 1794, 120217, 64521, 5624, 
     120220, 120221, 119958, 120223, 3617, 66636, 64886, 94061, 120212, 
     120213, 120214, 1872, 66508, 120467, 41079, 10748, 5502, 119330, 4452, 0, 
-    983762, 92526, 4511, 0, 983868, 64678, 11425, 0, 43245, 1231, 194783, 
+    983771, 92526, 4511, 0, 983877, 64678, 11425, 0, 43245, 1231, 194783, 
     69903, 0, 9003, 8192, 0, 5305, 9653, 10616, 8694, 9546, 0, 0, 120478, 
     120200, 65205, 120202, 64063, 9878, 74780, 119626, 78202, 64058, 8799, 
     42131, 0, 64062, 1028, 64060, 64059, 837, 10567, 0, 43103, 0, 120754, 
@@ -19792,26 +19812,26 @@
     64032, 42735, 64038, 64037, 64036, 64035, 4291, 194928, 64015, 64014, 
     64681, 194930, 0, 78145, 0, 43090, 0, 3476, 8973, 64012, 42473, 64010, 
     64008, 64007, 2003, 7706, 64517, 78153, 2538, 64009, 204, 0, 4802, 4111, 
-    8239, 9098, 4805, 64001, 64057, 7885, 7247, 64054, 983258, 0, 4767, 9343, 
+    8239, 9098, 4805, 64001, 64057, 7885, 7247, 64054, 983266, 0, 4767, 9343, 
     64049, 64048, 120034, 1133, 64053, 64052, 43453, 64050, 41340, 118975, 
     194835, 10005, 12329, 41333, 0, 8489, 1942, 0, 194834, 42520, 128249, 0, 
     0, 10760, 64023, 64022, 64021, 6582, 43670, 0, 64025, 9167, 42151, 78244, 
-    983226, 2026, 64019, 64018, 64017, 64016, 12768, 0, 7582, 78252, 78248, 
+    983232, 2026, 64019, 64018, 64017, 64016, 12768, 0, 7582, 78252, 78248, 
     77914, 78246, 78247, 0, 77915, 78766, 6788, 13094, 77920, 7532, 41414, 
     78520, 3179, 78518, 64769, 78514, 78517, 11461, 74454, 10751, 9051, 
-    120720, 6708, 10535, 0, 68218, 55274, 2008, 64031, 64030, 294, 41874, 0, 
-    126991, 65929, 0, 0, 0, 0, 64028, 8146, 64026, 41788, 194844, 0, 4351, 
-    6343, 43247, 119888, 0, 119886, 119891, 119892, 119889, 11433, 119895, 
-    119896, 0, 7801, 65578, 194839, 12915, 43968, 3297, 9699, 194955, 1135, 
-    0, 0, 128525, 1995, 6722, 983916, 0, 2552, 41546, 60, 68394, 8649, 41549, 
-    78496, 983319, 0, 6682, 0, 78679, 64710, 41547, 983621, 2013, 128291, 
-    78530, 78532, 78528, 78529, 12832, 78493, 8081, 8362, 3537, 119908, 9137, 
-    7155, 8999, 0, 78533, 3466, 0, 0, 1996, 0, 3453, 6282, 0, 2002, 2000, 
-    120175, 537, 0, 4179, 65119, 1998, 0, 1842, 0, 92674, 9628, 68446, 12081, 
-    9826, 64502, 1767, 0, 0, 0, 120201, 983637, 0, 0, 3059, 44024, 120204, 
-    119953, 92693, 0, 0, 92452, 4100, 920, 1811, 1355, 0, 0, 3592, 10078, 0, 
-    0, 0, 8592, 65870, 68164, 128792, 10742, 0, 42918, 1994, 9281, 3296, 
-    12865, 1997, 1895, 
+    120720, 6708, 10535, 983627, 68218, 55274, 2008, 64031, 64030, 294, 
+    41874, 0, 126991, 65929, 0, 0, 0, 0, 64028, 8146, 64026, 41788, 194844, 
+    0, 4351, 6343, 43247, 119888, 0, 119886, 119891, 119892, 119889, 11433, 
+    119895, 119896, 0, 7801, 65578, 194839, 12915, 43968, 3297, 9699, 194955, 
+    1135, 0, 0, 128525, 1995, 6722, 983925, 0, 2552, 41546, 60, 68394, 8649, 
+    41549, 78496, 983327, 0, 6682, 0, 78679, 64710, 41547, 983630, 2013, 
+    128291, 78530, 78532, 78528, 78529, 12832, 78493, 8081, 8362, 3537, 
+    119908, 9137, 7155, 8999, 0, 78533, 3466, 0, 0, 1996, 0, 3453, 6282, 0, 
+    2002, 2000, 120175, 537, 0, 4179, 65119, 1998, 0, 1842, 0, 92674, 9628, 
+    68446, 12081, 9826, 64502, 1767, 0, 0, 0, 120201, 983646, 0, 0, 3059, 
+    44024, 120204, 119953, 92693, 0, 0, 92452, 4100, 920, 1811, 1355, 0, 0, 
+    3592, 10078, 0, 0, 0, 8592, 65870, 68164, 128792, 10742, 0, 42918, 1994, 
+    9281, 3296, 12865, 1997, 1895, 
 };
 
 #define code_magic 47
@@ -19819,7 +19839,7 @@
 #define code_poly 32771
 
 static const unsigned int aliases_start = 0xf0000;
-static const unsigned int aliases_end = 0xf01c1;
+static const unsigned int aliases_end = 0xf01c9;
 static const unsigned int name_aliases[] = {
     0x0000,
     0x0000,
@@ -19982,6 +20002,8 @@
     0x01A2,
     0x01A3,
     0x034F,
+    0x061C,
+    0x0709,
     0x0CDE,
     0x0E9D,
     0x0E9F,
@@ -20005,6 +20027,10 @@
     0x202F,
     0x205F,
     0x2060,
+    0x2066,
+    0x2067,
+    0x2068,
+    0x2069,
     0x2118,
     0x2448,
     0x2449,
@@ -20029,6 +20055,8 @@
     0xFEFF,
     0xFEFF,
     0xFEFF,
+    0x122D4,
+    0x122D5,
     0x1D0C5,
     0xE0100,
     0xE0101,
@@ -20278,7 +20306,7 @@
 } named_sequence;
 
 static const unsigned int named_sequences_start = 0xf0200;
-static const unsigned int named_sequences_end = 0xf03a5;
+static const unsigned int named_sequences_end = 0xf03ae;
 static const named_sequence named_sequences[] = {
     {2, {0x0100, 0x0300}},
     {2, {0x0101, 0x0300}},
@@ -20349,6 +20377,15 @@
     {2, {0x0259, 0x0301}},
     {2, {0x025A, 0x0300}},
     {2, {0x025A, 0x0301}},
+    {2, {0x0626, 0x0627}},
+    {2, {0x0626, 0x0648}},
+    {2, {0x0626, 0x0649}},
+    {2, {0x0626, 0x06C6}},
+    {2, {0x0626, 0x06C7}},
+    {2, {0x0626, 0x06C8}},
+    {2, {0x0626, 0x06D0}},
+    {2, {0x0626, 0x06D5}},
+    {2, {0x0646, 0x06A9}},
     {3, {0x0995, 0x09CD, 0x09B7}},
     {2, {0x0B95, 0x0BCD}},
     {2, {0x0B99, 0x0BCD}},
diff --git a/Modules/xxlimited.c b/Modules/xxlimited.c
index 661b6e2..eecdab9 100644
--- a/Modules/xxlimited.c
+++ b/Modules/xxlimited.c
@@ -44,7 +44,7 @@
 Xxo_dealloc(XxoObject *self)
 {
     Py_XDECREF(self->x_attr);
-    PyObject_Del(self);
+    ((freefunc)PyType_GetSlot(Py_TYPE(self), Py_tp_free))(self);
 }
 
 static PyObject *
diff --git a/Modules/zipimport.c b/Modules/zipimport.c
index 2feb2a8..8fe9195 100644
--- a/Modules/zipimport.c
+++ b/Modules/zipimport.c
@@ -14,6 +14,10 @@
     int type;
 };
 
+#ifdef ALTSEP
+_Py_IDENTIFIER(replace);
+#endif
+
 /* zip_searchorder defines how we search for a module in the Zip
    archive: we first search for a package __init__, then for
    non-package .pyc, .pyo and .py entries. The .pyc and .pyo entries
@@ -66,9 +70,6 @@
     PyObject *path, *files, *tmp;
     PyObject *filename = NULL;
     Py_ssize_t len, flen;
-#ifdef ALTSEP
-    _Py_IDENTIFIER(replace);
-#endif
 
     if (!_PyArg_NoKeywords("zipimporter()", kwds))
         return -1;
@@ -117,6 +118,8 @@
         if (flen == -1)
             break;
         filename = PyUnicode_Substring(path, 0, flen);
+        if (filename == NULL)
+            goto error;
     }
     if (filename == NULL) {
         PyErr_SetString(ZipImportError, "not a Zip file");
@@ -469,10 +472,13 @@
     if (ispackage) {
         /* add __path__ to the module *before* the code gets
            executed */
-        PyObject *pkgpath, *fullpath;
-        PyObject *subname = get_subname(fullname);
+        PyObject *pkgpath, *fullpath, *subname;
         int err;
 
+        subname = get_subname(fullname);
+        if (subname == NULL)
+            goto error;
+
         fullpath = PyUnicode_FromFormat("%U%c%U%U",
                                 self->archive, SEP,
                                 self->prefix, subname);
@@ -554,9 +560,6 @@
 {
     ZipImporter *self = (ZipImporter *)obj;
     PyObject *path, *key;
-#ifdef ALTSEP
-    _Py_IDENTIFIER(replace);
-#endif
     PyObject *toc_entry;
     Py_ssize_t path_start, path_len, len;
 
@@ -862,6 +865,7 @@
     long l, count;
     Py_ssize_t i;
     char name[MAXPATHLEN + 5];
+    char dummy[8]; /* Buffer to read unused header values into */
     PyObject *nameobj = NULL;
     char *p, endof_central_dir[22];
     Py_ssize_t arc_offset;  /* Absolute offset to start of the zip-archive. */
@@ -869,7 +873,7 @@
     const char *charset;
     int bootstrap;
 
-    fp = _Py_fopen(archive, "rb");
+    fp = _Py_fopen_obj(archive, "rb");
     if (fp == NULL) {
         if (!PyErr_Occurred())
             PyErr_Format(ZipImportError, "can't open Zip file: %R", archive);
@@ -905,17 +909,25 @@
 
     /* Start of Central Directory */
     count = 0;
+    if (fseek(fp, header_offset, 0) == -1)
+        goto file_error;
     for (;;) {
         PyObject *t;
         int err;
 
-        if (fseek(fp, header_offset, 0) == -1)  /* Start of file header */
-            goto fseek_error;
+        /* Start of file header */
         l = PyMarshal_ReadLongFromFile(fp);
+        if (l == -1 && PyErr_Occurred())
+            goto error;
         if (l != 0x02014B50)
             break;              /* Bad: Central Dir File Header */
-        if (fseek(fp, header_offset + 8, 0) == -1)
-            goto fseek_error;
+
+        /* On Windows, calling fseek to skip over the fields we don't use is
+        slower than reading the data into a dummy buffer because fseek flushes
+        stdio's internal buffers. See issue #8745. */
+        if (fread(dummy, 1, 4, fp) != 4) /* Skip unused fields, avoid fseek */
+            goto file_error;
+
         flags = (unsigned short)PyMarshal_ReadShortFromFile(fp);
         compress = PyMarshal_ReadShortFromFile(fp);
         time = PyMarshal_ReadShortFromFile(fp);
@@ -924,12 +936,15 @@
         data_size = PyMarshal_ReadLongFromFile(fp);
         file_size = PyMarshal_ReadLongFromFile(fp);
         name_size = PyMarshal_ReadShortFromFile(fp);
-        header_size = 46 + name_size +
+        header_size = name_size +
            PyMarshal_ReadShortFromFile(fp) +
            PyMarshal_ReadShortFromFile(fp);
-        if (fseek(fp, header_offset + 42, 0) == -1)
-            goto fseek_error;
+        if (fread(dummy, 1, 8, fp) != 8) /* Skip unused fields, avoid fseek */
+            goto file_error;
         file_offset = PyMarshal_ReadLongFromFile(fp) + arc_offset;
+        if (PyErr_Occurred())
+            goto error;
+
         if (name_size > MAXPATHLEN)
             name_size = MAXPATHLEN;
 
@@ -941,7 +956,9 @@
             p++;
         }
         *p = 0;         /* Add terminating null byte */
-        header_offset += header_size;
+        for (; i < header_size; i++) /* Skip the rest of the header */
+            if(getc(fp) == EOF) /* Avoid fseek */
+                goto file_error;
 
         bootstrap = 0;
         if (flags & 0x0800)
@@ -988,7 +1005,7 @@
         PySys_FormatStderr("# zipimport: found %ld names in %R\n",
                            count, archive);
     return files;
-fseek_error:
+file_error:
     fclose(fp);
     Py_XDECREF(files);
     Py_XDECREF(nameobj);
@@ -1055,7 +1072,7 @@
         return NULL;
     }
 
-    fp = _Py_fopen(archive, "rb");
+    fp = _Py_fopen_obj(archive, "rb");
     if (!fp) {
         if (!PyErr_Occurred())
             PyErr_Format(PyExc_IOError,
@@ -1073,9 +1090,10 @@
     l = PyMarshal_ReadLongFromFile(fp);
     if (l != 0x04034B50) {
         /* Bad: Local File Header */
-        PyErr_Format(ZipImportError,
-                     "bad local file header in %U",
-                     archive);
+        if (!PyErr_Occurred())
+            PyErr_Format(ZipImportError,
+                         "bad local file header in %U",
+                         archive);
         fclose(fp);
         return NULL;
     }
@@ -1087,6 +1105,10 @@
 
     l = 30 + PyMarshal_ReadShortFromFile(fp) +
         PyMarshal_ReadShortFromFile(fp);        /* local header size */
+    if (PyErr_Occurred()) {
+        fclose(fp);
+        return NULL;
+    }
     file_offset += l;           /* Start of file data */
 
     bytes_size = compress == 0 ? data_size : data_size + 1;
@@ -1249,7 +1271,7 @@
 }
 
 /* Given a string buffer containing Python source code, compile it
-   return and return a code object as a new reference. */
+   and return a code object as a new reference. */
 static PyObject *
 compile_source(PyObject *pathname, PyObject *source)
 {
diff --git a/Modules/zlib/ChangeLog b/Modules/zlib/ChangeLog
index f310bb0..f22aaba 100644
--- a/Modules/zlib/ChangeLog
+++ b/Modules/zlib/ChangeLog
@@ -1,12 +1,276 @@
 
                 ChangeLog file for zlib
 
+Changes in 1.2.8 (28 Apr 2013)
+- Update contrib/minizip/iowin32.c for Windows RT [Vollant]
+- Do not force Z_CONST for C++
+- Clean up contrib/vstudio [Ro§]
+- Correct spelling error in zlib.h
+- Fix mixed line endings in contrib/vstudio
+
+Changes in 1.2.7.3 (13 Apr 2013)
+- Fix version numbers and DLL names in contrib/vstudio/*/zlib.rc
+
+Changes in 1.2.7.2 (13 Apr 2013)
+- Change check for a four-byte type back to hexadecimal
+- Fix typo in win32/Makefile.msc
+- Add casts in gzwrite.c for pointer differences
+
+Changes in 1.2.7.1 (24 Mar 2013)
+- Replace use of unsafe string functions with snprintf if available
+- Avoid including stddef.h on Windows for Z_SOLO compile [Niessink]
+- Fix gzgetc undefine when Z_PREFIX set [Turk]
+- Eliminate use of mktemp in Makefile (not always available)
+- Fix bug in 'F' mode for gzopen()
+- Add inflateGetDictionary() function
+- Correct comment in deflate.h
+- Use _snprintf for snprintf in Microsoft C
+- On Darwin, only use /usr/bin/libtool if libtool is not Apple
+- Delete "--version" file if created by "ar --version" [Richard G.]
+- Fix configure check for veracity of compiler error return codes
+- Fix CMake compilation of static lib for MSVC2010 x64
+- Remove unused variable in infback9.c
+- Fix argument checks in gzlog_compress() and gzlog_write()
+- Clean up the usage of z_const and respect const usage within zlib
+- Clean up examples/gzlog.[ch] comparisons of different types
+- Avoid shift equal to bits in type (caused endless loop)
+- Fix unintialized value bug in gzputc() introduced by const patches
+- Fix memory allocation error in examples/zran.c [Nor]
+- Fix bug where gzopen(), gzclose() would write an empty file
+- Fix bug in gzclose() when gzwrite() runs out of memory
+- Check for input buffer malloc failure in examples/gzappend.c
+- Add note to contrib/blast to use binary mode in stdio
+- Fix comparisons of differently signed integers in contrib/blast
+- Check for invalid code length codes in contrib/puff
+- Fix serious but very rare decompression bug in inftrees.c
+- Update inflateBack() comments, since inflate() can be faster
+- Use underscored I/O function names for WINAPI_FAMILY
+- Add _tr_flush_bits to the external symbols prefixed by --zprefix
+- Add contrib/vstudio/vc10 pre-build step for static only
+- Quote --version-script argument in CMakeLists.txt
+- Don't specify --version-script on Apple platforms in CMakeLists.txt
+- Fix casting error in contrib/testzlib/testzlib.c
+- Fix types in contrib/minizip to match result of get_crc_table()
+- Simplify contrib/vstudio/vc10 with 'd' suffix
+- Add TOP support to win32/Makefile.msc
+- Suport i686 and amd64 assembler builds in CMakeLists.txt
+- Fix typos in the use of _LARGEFILE64_SOURCE in zconf.h
+- Add vc11 and vc12 build files to contrib/vstudio
+- Add gzvprintf() as an undocumented function in zlib
+- Fix configure for Sun shell
+- Remove runtime check in configure for four-byte integer type
+- Add casts and consts to ease user conversion to C++
+- Add man pages for minizip and miniunzip
+- In Makefile uninstall, don't rm if preceding cd fails
+- Do not return Z_BUF_ERROR if deflateParam() has nothing to write
+
+Changes in 1.2.7 (2 May 2012)
+- Replace use of memmove() with a simple copy for portability
+- Test for existence of strerror
+- Restore gzgetc_ for backward compatibility with 1.2.6
+- Fix build with non-GNU make on Solaris
+- Require gcc 4.0 or later on Mac OS X to use the hidden attribute
+- Include unistd.h for Watcom C
+- Use __WATCOMC__ instead of __WATCOM__
+- Do not use the visibility attribute if NO_VIZ defined
+- Improve the detection of no hidden visibility attribute
+- Avoid using __int64 for gcc or solo compilation
+- Cast to char * in gzprintf to avoid warnings [Zinser]
+- Fix make_vms.com for VAX [Zinser]
+- Don't use library or built-in byte swaps
+- Simplify test and use of gcc hidden attribute
+- Fix bug in gzclose_w() when gzwrite() fails to allocate memory
+- Add "x" (O_EXCL) and "e" (O_CLOEXEC) modes support to gzopen()
+- Fix bug in test/minigzip.c for configure --solo
+- Fix contrib/vstudio project link errors [Mohanathas]
+- Add ability to choose the builder in make_vms.com [Schweda]
+- Add DESTDIR support to mingw32 win32/Makefile.gcc
+- Fix comments in win32/Makefile.gcc for proper usage
+- Allow overriding the default install locations for cmake
+- Generate and install the pkg-config file with cmake
+- Build both a static and a shared version of zlib with cmake
+- Include version symbols for cmake builds
+- If using cmake with MSVC, add the source directory to the includes
+- Remove unneeded EXTRA_CFLAGS from win32/Makefile.gcc [Truta]
+- Move obsolete emx makefile to old [Truta]
+- Allow the use of -Wundef when compiling or using zlib
+- Avoid the use of the -u option with mktemp
+- Improve inflate() documentation on the use of Z_FINISH
+- Recognize clang as gcc
+- Add gzopen_w() in Windows for wide character path names
+- Rename zconf.h in CMakeLists.txt to move it out of the way
+- Add source directory in CMakeLists.txt for building examples
+- Look in build directory for zlib.pc in CMakeLists.txt
+- Remove gzflags from zlibvc.def in vc9 and vc10
+- Fix contrib/minizip compilation in the MinGW environment
+- Update ./configure for Solaris, support --64 [Mooney]
+- Remove -R. from Solaris shared build (possible security issue)
+- Avoid race condition for parallel make (-j) running example
+- Fix type mismatch between get_crc_table() and crc_table
+- Fix parsing of version with "-" in CMakeLists.txt [Snider, Ziegler]
+- Fix the path to zlib.map in CMakeLists.txt
+- Force the native libtool in Mac OS X to avoid GNU libtool [Beebe]
+- Add instructions to win32/Makefile.gcc for shared install [Torri]
+
+Changes in 1.2.6.1 (12 Feb 2012)
+- Avoid the use of the Objective-C reserved name "id"
+- Include io.h in gzguts.h for Microsoft compilers
+- Fix problem with ./configure --prefix and gzgetc macro
+- Include gz_header definition when compiling zlib solo
+- Put gzflags() functionality back in zutil.c
+- Avoid library header include in crc32.c for Z_SOLO
+- Use name in GCC_CLASSIC as C compiler for coverage testing, if set
+- Minor cleanup in contrib/minizip/zip.c [Vollant]
+- Update make_vms.com [Zinser]
+- Remove unnecessary gzgetc_ function
+- Use optimized byte swap operations for Microsoft and GNU [Snyder]
+- Fix minor typo in zlib.h comments [Rzesniowiecki]
+
+Changes in 1.2.6 (29 Jan 2012)
+- Update the Pascal interface in contrib/pascal
+- Fix function numbers for gzgetc_ in zlibvc.def files
+- Fix configure.ac for contrib/minizip [Schiffer]
+- Fix large-entry detection in minizip on 64-bit systems [Schiffer]
+- Have ./configure use the compiler return code for error indication
+- Fix CMakeLists.txt for cross compilation [McClure]
+- Fix contrib/minizip/zip.c for 64-bit architectures [Dalsnes]
+- Fix compilation of contrib/minizip on FreeBSD [Marquez]
+- Correct suggested usages in win32/Makefile.msc [Shachar, Horvath]
+- Include io.h for Turbo C / Borland C on all platforms [Truta]
+- Make version explicit in contrib/minizip/configure.ac [Bosmans]
+- Avoid warning for no encryption in contrib/minizip/zip.c [Vollant]
+- Minor cleanup up contrib/minizip/unzip.c [Vollant]
+- Fix bug when compiling minizip with C++ [Vollant]
+- Protect for long name and extra fields in contrib/minizip [Vollant]
+- Avoid some warnings in contrib/minizip [Vollant]
+- Add -I../.. -L../.. to CFLAGS for minizip and miniunzip
+- Add missing libs to minizip linker command
+- Add support for VPATH builds in contrib/minizip
+- Add an --enable-demos option to contrib/minizip/configure
+- Add the generation of configure.log by ./configure
+- Exit when required parameters not provided to win32/Makefile.gcc
+- Have gzputc return the character written instead of the argument
+- Use the -m option on ldconfig for BSD systems [Tobias]
+- Correct in zlib.map when deflateResetKeep was added
+
+Changes in 1.2.5.3 (15 Jan 2012)
+- Restore gzgetc function for binary compatibility
+- Do not use _lseeki64 under Borland C++ [Truta]
+- Update win32/Makefile.msc to build test/*.c [Truta]
+- Remove old/visualc6 given CMakefile and other alternatives
+- Update AS400 build files and documentation [Monnerat]
+- Update win32/Makefile.gcc to build test/*.c [Truta]
+- Permit stronger flushes after Z_BLOCK flushes
+- Avoid extraneous empty blocks when doing empty flushes
+- Permit Z_NULL arguments to deflatePending
+- Allow deflatePrime() to insert bits in the middle of a stream
+- Remove second empty static block for Z_PARTIAL_FLUSH
+- Write out all of the available bits when using Z_BLOCK
+- Insert the first two strings in the hash table after a flush
+
+Changes in 1.2.5.2 (17 Dec 2011)
+- fix ld error: unable to find version dependency 'ZLIB_1.2.5'
+- use relative symlinks for shared libs
+- Avoid searching past window for Z_RLE strategy
+- Assure that high-water mark initialization is always applied in deflate
+- Add assertions to fill_window() in deflate.c to match comments
+- Update python link in README
+- Correct spelling error in gzread.c
+- Fix bug in gzgets() for a concatenated empty gzip stream
+- Correct error in comment for gz_make()
+- Change gzread() and related to ignore junk after gzip streams
+- Allow gzread() and related to continue after gzclearerr()
+- Allow gzrewind() and gzseek() after a premature end-of-file
+- Simplify gzseek() now that raw after gzip is ignored
+- Change gzgetc() to a macro for speed (~40% speedup in testing)
+- Fix gzclose() to return the actual error last encountered
+- Always add large file support for windows
+- Include zconf.h for windows large file support
+- Include zconf.h.cmakein for windows large file support
+- Update zconf.h.cmakein on make distclean
+- Merge vestigial vsnprintf determination from zutil.h to gzguts.h
+- Clarify how gzopen() appends in zlib.h comments
+- Correct documentation of gzdirect() since junk at end now ignored
+- Add a transparent write mode to gzopen() when 'T' is in the mode
+- Update python link in zlib man page
+- Get inffixed.h and MAKEFIXED result to match
+- Add a ./config --solo option to make zlib subset with no libary use
+- Add undocumented inflateResetKeep() function for CAB file decoding
+- Add --cover option to ./configure for gcc coverage testing
+- Add #define ZLIB_CONST option to use const in the z_stream interface
+- Add comment to gzdopen() in zlib.h to use dup() when using fileno()
+- Note behavior of uncompress() to provide as much data as it can
+- Add files in contrib/minizip to aid in building libminizip
+- Split off AR options in Makefile.in and configure
+- Change ON macro to Z_ARG to avoid application conflicts
+- Facilitate compilation with Borland C++ for pragmas and vsnprintf
+- Include io.h for Turbo C / Borland C++
+- Move example.c and minigzip.c to test/
+- Simplify incomplete code table filling in inflate_table()
+- Remove code from inflate.c and infback.c that is impossible to execute
+- Test the inflate code with full coverage
+- Allow deflateSetDictionary, inflateSetDictionary at any time (in raw)
+- Add deflateResetKeep and fix inflateResetKeep to retain dictionary
+- Fix gzwrite.c to accommodate reduced memory zlib compilation
+- Have inflate() with Z_FINISH avoid the allocation of a window
+- Do not set strm->adler when doing raw inflate
+- Fix gzeof() to behave just like feof() when read is not past end of file
+- Fix bug in gzread.c when end-of-file is reached
+- Avoid use of Z_BUF_ERROR in gz* functions except for premature EOF
+- Document gzread() capability to read concurrently written files
+- Remove hard-coding of resource compiler in CMakeLists.txt [Blammo]
+
+Changes in 1.2.5.1 (10 Sep 2011)
+- Update FAQ entry on shared builds (#13)
+- Avoid symbolic argument to chmod in Makefile.in
+- Fix bug and add consts in contrib/puff [Oberhumer]
+- Update contrib/puff/zeros.raw test file to have all block types
+- Add full coverage test for puff in contrib/puff/Makefile
+- Fix static-only-build install in Makefile.in
+- Fix bug in unzGetCurrentFileInfo() in contrib/minizip [Kuno]
+- Add libz.a dependency to shared in Makefile.in for parallel builds
+- Spell out "number" (instead of "nb") in zlib.h for total_in, total_out
+- Replace $(...) with `...` in configure for non-bash sh [Bowler]
+- Add darwin* to Darwin* and solaris* to SunOS\ 5* in configure [Groffen]
+- Add solaris* to Linux* in configure to allow gcc use [Groffen]
+- Add *bsd* to Linux* case in configure [Bar-Lev]
+- Add inffast.obj to dependencies in win32/Makefile.msc
+- Correct spelling error in deflate.h [Kohler]
+- Change libzdll.a again to libz.dll.a (!) in win32/Makefile.gcc
+- Add test to configure for GNU C looking for gcc in output of $cc -v
+- Add zlib.pc generation to win32/Makefile.gcc [Weigelt]
+- Fix bug in zlib.h for _FILE_OFFSET_BITS set and _LARGEFILE64_SOURCE not
+- Add comment in zlib.h that adler32_combine with len2 < 0 makes no sense
+- Make NO_DIVIDE option in adler32.c much faster (thanks to John Reiser)
+- Make stronger test in zconf.h to include unistd.h for LFS
+- Apply Darwin patches for 64-bit file offsets to contrib/minizip [Slack]
+- Fix zlib.h LFS support when Z_PREFIX used
+- Add updated as400 support (removed from old) [Monnerat]
+- Avoid deflate sensitivity to volatile input data
+- Avoid division in adler32_combine for NO_DIVIDE
+- Clarify the use of Z_FINISH with deflateBound() amount of space
+- Set binary for output file in puff.c
+- Use u4 type for crc_table to avoid conversion warnings
+- Apply casts in zlib.h to avoid conversion warnings
+- Add OF to prototypes for adler32_combine_ and crc32_combine_ [Miller]
+- Improve inflateSync() documentation to note indeterminancy
+- Add deflatePending() function to return the amount of pending output
+- Correct the spelling of "specification" in FAQ [Randers-Pehrson]
+- Add a check in configure for stdarg.h, use for gzprintf()
+- Check that pointers fit in ints when gzprint() compiled old style
+- Add dummy name before $(SHAREDLIBV) in Makefile [Bar-Lev, Bowler]
+- Delete line in configure that adds -L. libz.a to LDFLAGS [Weigelt]
+- Add debug records in assmebler code [Londer]
+- Update RFC references to use http://tools.ietf.org/html/... [Li]
+- Add --archs option, use of libtool to configure for Mac OS X [Borstel]
+
 Changes in 1.2.5 (19 Apr 2010)
 - Disable visibility attribute in win32/Makefile.gcc [Bar-Lev]
 - Default to libdir as sharedlibdir in configure [Nieder]
 - Update copyright dates on modified source files
 - Update trees.c to be able to generate modified trees.h
 - Exit configure for MinGW, suggesting win32/Makefile.gcc
+- Check for NULL path in gz_open [Homurlu]
 
 Changes in 1.2.4.5 (18 Apr 2010)
 - Set sharedlibdir in configure [Torok]
@@ -261,7 +525,7 @@
 - Clear bytes after deflate lookahead to avoid use of uninitialized data
 - Change a limit in inftrees.c to be more transparent to Coverity Prevent
 - Update win32/zlib.def with exported symbols from zlib.h
-- Correct spelling error in zlib.h [Willem]
+- Correct spelling errors in zlib.h [Willem, Sobrado]
 - Allow Z_BLOCK for deflate() to force a new block
 - Allow negative bits in inflatePrime() to delete existing bit buffer
 - Add Z_TREES flush option to inflate() to return at end of trees
diff --git a/Modules/zlib/FAQ b/Modules/zlib/FAQ
index 1a22750..99b7cf9 100644
--- a/Modules/zlib/FAQ
+++ b/Modules/zlib/FAQ
@@ -44,8 +44,8 @@
 
  6. Where's the zlib documentation (man pages, etc.)?
 
-    It's in zlib.h .  Examples of zlib usage are in the files example.c and
-    minigzip.c, with more in examples/ .
+    It's in zlib.h .  Examples of zlib usage are in the files test/example.c
+    and test/minigzip.c, with more in examples/ .
 
  7. Why don't you use GNU autoconf or libtool or ...?
 
@@ -84,8 +84,10 @@
 
 13. How can I make a Unix shared library?
 
-    make clean
-    ./configure -s
+    By default a shared (and a static) library is built for Unix.  So:
+
+    make distclean
+    ./configure
     make
 
 14. How do I install a shared zlib library on Unix?
@@ -325,7 +327,7 @@
     correctly points to the zlib specification in RFC 1950 for the "deflate"
     transfer encoding, there have been reports of servers and browsers that
     incorrectly produce or expect raw deflate data per the deflate
-    specficiation in RFC 1951, most notably Microsoft.  So even though the
+    specification in RFC 1951, most notably Microsoft.  So even though the
     "deflate" transfer encoding using the zlib format would be the more
     efficient approach (and in fact exactly what the zlib format was designed
     for), using the "gzip" transfer encoding is probably more reliable due to
diff --git a/Modules/zlib/INDEX b/Modules/zlib/INDEX
index f6c51ca..2ba0641 100644
--- a/Modules/zlib/INDEX
+++ b/Modules/zlib/INDEX
@@ -7,6 +7,9 @@
 README          guess what
 configure       configure script for Unix
 make_vms.com    makefile for VMS
+test/example.c  zlib usages examples for build testing
+test/minigzip.c minimal gzip-like functionality for build testing
+test/infcover.c inf*.c code coverage for build coverage testing
 treebuild.xml   XML description of source file dependencies
 zconf.h.cmakein zconf.h template for cmake
 zconf.h.in      zconf.h template for configure
@@ -14,9 +17,11 @@
 zlib.3.pdf      Man page in PDF format
 zlib.map        Linux symbol information
 zlib.pc.in      Template for pkg-config descriptor
+zlib.pc.cmakein zlib.pc template for cmake
 zlib2ansi       perl script to convert source files for C++ compilation
 
 amiga/          makefiles for Amiga SAS C
+as400/          makefiles for AS/400
 doc/            documentation for formats and algorithms
 msdos/          makefiles for MSDOS
 nintendods/     makefile for Nintendo DS
@@ -56,10 +61,8 @@
 zutil.c
 zutil.h
 
-                source files for sample programs:
-example.c
-minigzip.c
-See examples/README.examples for more
+                source files for sample programs
+See examples/README.examples
 
-                unsupported contribution by third parties
+                unsupported contributions by third parties
 See contrib/README.contrib
diff --git a/Modules/zlib/Makefile.in b/Modules/zlib/Makefile.in
index 5b15bd0..c61aa30 100644
--- a/Modules/zlib/Makefile.in
+++ b/Modules/zlib/Makefile.in
@@ -1,5 +1,5 @@
 # Makefile for zlib
-# Copyright (C) 1995-2010 Jean-loup Gailly.
+# Copyright (C) 1995-2013 Jean-loup Gailly, Mark Adler
 # For conditions of distribution and use, see copyright notice in zlib.h
 
 # To compile and test, type:
@@ -32,11 +32,12 @@
 
 STATICLIB=libz.a
 SHAREDLIB=libz.so
-SHAREDLIBV=libz.so.1.2.5
+SHAREDLIBV=libz.so.1.2.8
 SHAREDLIBM=libz.so.1
 LIBS=$(STATICLIB) $(SHAREDLIBV)
 
-AR=ar rc
+AR=ar
+ARFLAGS=rc
 RANLIB=ranlib
 LDCONFIG=ldconfig
 LDSHAREDLIBC=-lc
@@ -53,11 +54,13 @@
 man3dir = ${mandir}/man3
 pkgconfigdir = ${libdir}/pkgconfig
 
-OBJC = adler32.o compress.o crc32.o deflate.o gzclose.o gzlib.o gzread.o \
-	gzwrite.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o
+OBJZ = adler32.o crc32.o deflate.o infback.o inffast.o inflate.o inftrees.o trees.o zutil.o
+OBJG = compress.o uncompr.o gzclose.o gzlib.o gzread.o gzwrite.o
+OBJC = $(OBJZ) $(OBJG)
 
-PIC_OBJC = adler32.lo compress.lo crc32.lo deflate.lo gzclose.lo gzlib.lo gzread.lo \
-	gzwrite.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo uncompr.lo zutil.lo
+PIC_OBJZ = adler32.lo crc32.lo deflate.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo zutil.lo
+PIC_OBJG = compress.lo uncompr.lo gzclose.lo gzlib.lo gzread.lo gzwrite.lo
+PIC_OBJC = $(PIC_OBJZ) $(PIC_OBJG)
 
 # to use the asm code: make OBJA=match.o, PIC_OBJA=match.lo
 OBJA =
@@ -80,35 +83,49 @@
 test: all teststatic testshared
 
 teststatic: static
-	@if echo hello world | ./minigzip | ./minigzip -d && ./example; then \
+	@TMPST=tmpst_$$; \
+	if echo hello world | ./minigzip | ./minigzip -d && ./example $$TMPST ; then \
 	  echo '		*** zlib test OK ***'; \
 	else \
 	  echo '		*** zlib test FAILED ***'; false; \
-	fi
-	-@rm -f foo.gz
+	fi; \
+	rm -f $$TMPST
 
 testshared: shared
 	@LD_LIBRARY_PATH=`pwd`:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
 	LD_LIBRARYN32_PATH=`pwd`:$(LD_LIBRARYN32_PATH) ; export LD_LIBRARYN32_PATH; \
 	DYLD_LIBRARY_PATH=`pwd`:$(DYLD_LIBRARY_PATH) ; export DYLD_LIBRARY_PATH; \
 	SHLIB_PATH=`pwd`:$(SHLIB_PATH) ; export SHLIB_PATH; \
-	if echo hello world | ./minigzipsh | ./minigzipsh -d && ./examplesh; then \
+	TMPSH=tmpsh_$$; \
+	if echo hello world | ./minigzipsh | ./minigzipsh -d && ./examplesh $$TMPSH; then \
 	  echo '		*** zlib shared test OK ***'; \
 	else \
 	  echo '		*** zlib shared test FAILED ***'; false; \
-	fi
-	-@rm -f foo.gz
+	fi; \
+	rm -f $$TMPSH
 
 test64: all64
-	@if echo hello world | ./minigzip64 | ./minigzip64 -d && ./example64; then \
+	@TMP64=tmp64_$$; \
+	if echo hello world | ./minigzip64 | ./minigzip64 -d && ./example64 $$TMP64; then \
 	  echo '		*** zlib 64-bit test OK ***'; \
 	else \
 	  echo '		*** zlib 64-bit test FAILED ***'; false; \
-	fi
-	-@rm -f foo.gz
+	fi; \
+	rm -f $$TMP64
+
+infcover.o: test/infcover.c zlib.h zconf.h
+	$(CC) $(CFLAGS) -I. -c -o $@ test/infcover.c
+
+infcover: infcover.o libz.a
+	$(CC) $(CFLAGS) -o $@ infcover.o libz.a
+
+cover: infcover
+	rm -f *.gcda
+	./infcover
+	gcov inf*.c
 
 libz.a: $(OBJS)
-	$(AR) $@ $(OBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS)
 	-@ ($(RANLIB) $@ || true) >/dev/null 2>&1
 
 match.o: match.S
@@ -123,11 +140,17 @@
 	mv _match.o match.lo
 	rm -f _match.s
 
-example64.o: example.c zlib.h zconf.h
-	$(CC) $(CFLAGS) -D_FILE_OFFSET_BITS=64 -c -o $@ example.c
+example.o: test/example.c zlib.h zconf.h
+	$(CC) $(CFLAGS) -I. -c -o $@ test/example.c
 
-minigzip64.o: minigzip.c zlib.h zconf.h
-	$(CC) $(CFLAGS) -D_FILE_OFFSET_BITS=64 -c -o $@ minigzip.c
+minigzip.o: test/minigzip.c zlib.h zconf.h
+	$(CC) $(CFLAGS) -I. -c -o $@ test/minigzip.c
+
+example64.o: test/example.c zlib.h zconf.h
+	$(CC) $(CFLAGS) -I. -D_FILE_OFFSET_BITS=64 -c -o $@ test/example.c
+
+minigzip64.o: test/minigzip.c zlib.h zconf.h
+	$(CC) $(CFLAGS) -I. -D_FILE_OFFSET_BITS=64 -c -o $@ test/minigzip.c
 
 .SUFFIXES: .lo
 
@@ -136,7 +159,7 @@
 	$(CC) $(SFLAGS) -DPIC -c -o objs/$*.o $<
 	-@mv objs/$*.o $@
 
-$(SHAREDLIBV): $(PIC_OBJS)
+placebo $(SHAREDLIBV): $(PIC_OBJS) libz.a
 	$(LDSHARED) $(SFLAGS) -o $@ $(PIC_OBJS) $(LDSHAREDLIBC) $(LDFLAGS)
 	rm -f $(SHAREDLIB) $(SHAREDLIBM)
 	ln -s $@ $(SHAREDLIB)
@@ -168,14 +191,16 @@
 	-@if [ ! -d $(DESTDIR)$(man3dir)      ]; then mkdir -p $(DESTDIR)$(man3dir); fi
 	-@if [ ! -d $(DESTDIR)$(pkgconfigdir) ]; then mkdir -p $(DESTDIR)$(pkgconfigdir); fi
 	cp $(STATICLIB) $(DESTDIR)$(libdir)
-	cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)
-	cd $(DESTDIR)$(libdir); chmod u=rw,go=r $(STATICLIB)
-	-@(cd $(DESTDIR)$(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1
-	-@cd $(DESTDIR)$(sharedlibdir); if test "$(SHAREDLIBV)" -a -f $(SHAREDLIBV); then \
-	  chmod 755 $(SHAREDLIBV); \
-	  rm -f $(SHAREDLIB) $(SHAREDLIBM); \
-	  ln -s $(SHAREDLIBV) $(SHAREDLIB); \
-	  ln -s $(SHAREDLIBV) $(SHAREDLIBM); \
+	chmod 644 $(DESTDIR)$(libdir)/$(STATICLIB)
+	-@($(RANLIB) $(DESTDIR)$(libdir)/libz.a || true) >/dev/null 2>&1
+	-@if test -n "$(SHAREDLIBV)"; then \
+	  cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir); \
+	  echo "cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)"; \
+	  chmod 755 $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV); \
+	  echo "chmod 755 $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV)"; \
+	  rm -f $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \
+	  ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB); \
+	  ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \
 	  ($(LDCONFIG) || true)  >/dev/null 2>&1; \
 	fi
 	cp zlib.3 $(DESTDIR)$(man3dir)
@@ -191,22 +216,25 @@
 	chmod 644 $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h
 
 uninstall:
-	cd $(DESTDIR)$(includedir); rm -f zlib.h zconf.h
-	cd $(DESTDIR)$(libdir); rm -f libz.a; \
-	if test "$(SHAREDLIBV)" -a -f $(SHAREDLIBV); then \
+	cd $(DESTDIR)$(includedir) && rm -f zlib.h zconf.h
+	cd $(DESTDIR)$(libdir) && rm -f libz.a; \
+	if test -n "$(SHAREDLIBV)" -a -f $(SHAREDLIBV); then \
 	  rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \
 	fi
-	cd $(DESTDIR)$(man3dir); rm -f zlib.3
-	cd $(DESTDIR)$(pkgconfigdir); rm -f zlib.pc
+	cd $(DESTDIR)$(man3dir) && rm -f zlib.3
+	cd $(DESTDIR)$(pkgconfigdir) && rm -f zlib.pc
 
 docs: zlib.3.pdf
 
 zlib.3.pdf: zlib.3
 	groff -mandoc -f H -T ps zlib.3 | ps2pdf - zlib.3.pdf
 
-zconf.h.in: zconf.h.cmakein
-	sed "/^#cmakedefine/D" < zconf.h.cmakein > zconf.h.in
-	touch -r zconf.h.cmakein zconf.h.in
+zconf.h.cmakein: zconf.h.in
+	-@ TEMPFILE=zconfh_$$; \
+	echo "/#define ZCONF_H/ a\\\\\n#cmakedefine Z_PREFIX\\\\\n#cmakedefine Z_HAVE_UNISTD_H\n" >> $$TEMPFILE &&\
+	sed -f $$TEMPFILE zconf.h.in > zconf.h.cmakein &&\
+	touch -r zconf.h.in zconf.h.cmakein &&\
+	rm $$TEMPFILE
 
 zconf: zconf.h.in
 	cp -p zconf.h.in zconf.h
@@ -216,13 +244,16 @@
 	rm -f *.o *.lo *~ \
 	   example$(EXE) minigzip$(EXE) examplesh$(EXE) minigzipsh$(EXE) \
 	   example64$(EXE) minigzip64$(EXE) \
+	   infcover \
 	   libz.* foo.gz so_locations \
 	   _match.s maketree contrib/infback9/*.o
 	rm -rf objs
+	rm -f *.gcda *.gcno *.gcov
+	rm -f contrib/infback9/*.gcda contrib/infback9/*.gcno contrib/infback9/*.gcov
 
 maintainer-clean: distclean
-distclean: clean zconf docs
-	rm -f Makefile zlib.pc
+distclean: clean zconf zconf.h.cmakein docs
+	rm -f Makefile zlib.pc configure.log
 	-@rm -f .DS_Store
 	-@printf 'all:\n\t-@echo "Please use ./configure first.  Thank you."\n' > Makefile
 	-@printf '\ndistclean:\n\tmake -f Makefile.in distclean\n' >> Makefile
diff --git a/Modules/zlib/README b/Modules/zlib/README
index d4219bf..5ca9d12 100644
--- a/Modules/zlib/README
+++ b/Modules/zlib/README
@@ -1,22 +1,22 @@
 ZLIB DATA COMPRESSION LIBRARY
 
-zlib 1.2.5 is a general purpose data compression library.  All the code is
+zlib 1.2.8 is a general purpose data compression library.  All the code is
 thread safe.  The data format used by the zlib library is described by RFCs
 (Request for Comments) 1950 to 1952 in the files
-http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format)
-and rfc1952.txt (gzip format).
+http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and
+rfc1952 (gzip format).
 
 All functions of the compression library are documented in the file zlib.h
 (volunteer to write man pages welcome, contact zlib@gzip.org).  A usage example
-of the library is given in the file example.c which also tests that the library
-is working correctly.  Another example is given in the file minigzip.c.  The
-compression library itself is composed of all source files except example.c and
-minigzip.c.
+of the library is given in the file test/example.c which also tests that
+the library is working correctly.  Another example is given in the file
+test/minigzip.c.  The compression library itself is composed of all source
+files in the root directory.
 
 To compile all files and run the test program, follow the instructions given at
 the top of Makefile.in.  In short "./configure; make test", and if that goes
-well, "make install" should work for most flavors of Unix.  For Windows, use one
-of the special makefiles in win32/ or contrib/vstudio/ .  For VMS, use
+well, "make install" should work for most flavors of Unix.  For Windows, use
+one of the special makefiles in win32/ or contrib/vstudio/ .  For VMS, use
 make_vms.com.
 
 Questions about zlib should be sent to <zlib@gzip.org>, or to Gilles Vollant
@@ -31,7 +31,7 @@
 issue of Dr.  Dobb's Journal; a copy of the article is available at
 http://marknelson.us/1997/01/01/zlib-engine/ .
 
-The changes made in version 1.2.5 are documented in the file ChangeLog.
+The changes made in version 1.2.8 are documented in the file ChangeLog.
 
 Unsupported third party contributions are provided in directory contrib/ .
 
@@ -44,7 +44,7 @@
 
 A Python interface to zlib written by A.M. Kuchling <amk@amk.ca> is
 available in Python 1.5 and later versions, see
-http://www.python.org/doc/lib/module-zlib.html .
+http://docs.python.org/library/zlib.html .
 
 zlib is built into tcl: http://wiki.tcl.tk/4610 .
 
@@ -84,7 +84,7 @@
 
 Copyright notice:
 
- (C) 1995-2010 Jean-loup Gailly and Mark Adler
+ (C) 1995-2013 Jean-loup Gailly and Mark Adler
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
diff --git a/Modules/zlib/adler32.c b/Modules/zlib/adler32.c
index 65ad6a5..a868f07 100644
--- a/Modules/zlib/adler32.c
+++ b/Modules/zlib/adler32.c
@@ -1,5 +1,5 @@
 /* adler32.c -- compute the Adler-32 checksum of a data stream
- * Copyright (C) 1995-2007 Mark Adler
+ * Copyright (C) 1995-2011 Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -9,9 +9,9 @@
 
 #define local static
 
-local uLong adler32_combine_(uLong adler1, uLong adler2, z_off64_t len2);
+local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2));
 
-#define BASE 65521UL    /* largest prime smaller than 65536 */
+#define BASE 65521      /* largest prime smaller than 65536 */
 #define NMAX 5552
 /* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
 
@@ -21,39 +21,44 @@
 #define DO8(buf,i)  DO4(buf,i); DO4(buf,i+4);
 #define DO16(buf)   DO8(buf,0); DO8(buf,8);
 
-/* use NO_DIVIDE if your processor does not do division in hardware */
+/* use NO_DIVIDE if your processor does not do division in hardware --
+   try it both ways to see which is faster */
 #ifdef NO_DIVIDE
-#  define MOD(a) \
+/* note that this assumes BASE is 65521, where 65536 % 65521 == 15
+   (thank you to John Reiser for pointing this out) */
+#  define CHOP(a) \
     do { \
-        if (a >= (BASE << 16)) a -= (BASE << 16); \
-        if (a >= (BASE << 15)) a -= (BASE << 15); \
-        if (a >= (BASE << 14)) a -= (BASE << 14); \
-        if (a >= (BASE << 13)) a -= (BASE << 13); \
-        if (a >= (BASE << 12)) a -= (BASE << 12); \
-        if (a >= (BASE << 11)) a -= (BASE << 11); \
-        if (a >= (BASE << 10)) a -= (BASE << 10); \
-        if (a >= (BASE << 9)) a -= (BASE << 9); \
-        if (a >= (BASE << 8)) a -= (BASE << 8); \
-        if (a >= (BASE << 7)) a -= (BASE << 7); \
-        if (a >= (BASE << 6)) a -= (BASE << 6); \
-        if (a >= (BASE << 5)) a -= (BASE << 5); \
-        if (a >= (BASE << 4)) a -= (BASE << 4); \
-        if (a >= (BASE << 3)) a -= (BASE << 3); \
-        if (a >= (BASE << 2)) a -= (BASE << 2); \
-        if (a >= (BASE << 1)) a -= (BASE << 1); \
+        unsigned long tmp = a >> 16; \
+        a &= 0xffffUL; \
+        a += (tmp << 4) - tmp; \
+    } while (0)
+#  define MOD28(a) \
+    do { \
+        CHOP(a); \
         if (a >= BASE) a -= BASE; \
     } while (0)
-#  define MOD4(a) \
+#  define MOD(a) \
     do { \
-        if (a >= (BASE << 4)) a -= (BASE << 4); \
-        if (a >= (BASE << 3)) a -= (BASE << 3); \
-        if (a >= (BASE << 2)) a -= (BASE << 2); \
-        if (a >= (BASE << 1)) a -= (BASE << 1); \
+        CHOP(a); \
+        MOD28(a); \
+    } while (0)
+#  define MOD63(a) \
+    do { /* this assumes a is not negative */ \
+        z_off64_t tmp = a >> 32; \
+        a &= 0xffffffffL; \
+        a += (tmp << 8) - (tmp << 5) + tmp; \
+        tmp = a >> 16; \
+        a &= 0xffffL; \
+        a += (tmp << 4) - tmp; \
+        tmp = a >> 16; \
+        a &= 0xffffL; \
+        a += (tmp << 4) - tmp; \
         if (a >= BASE) a -= BASE; \
     } while (0)
 #else
 #  define MOD(a) a %= BASE
-#  define MOD4(a) a %= BASE
+#  define MOD28(a) a %= BASE
+#  define MOD63(a) a %= BASE
 #endif
 
 /* ========================================================================= */
@@ -92,7 +97,7 @@
         }
         if (adler >= BASE)
             adler -= BASE;
-        MOD4(sum2);             /* only added so many BASE's */
+        MOD28(sum2);            /* only added so many BASE's */
         return adler | (sum2 << 16);
     }
 
@@ -137,8 +142,13 @@
     unsigned long sum2;
     unsigned rem;
 
+    /* for negative len, return invalid adler32 as a clue for debugging */
+    if (len2 < 0)
+        return 0xffffffffUL;
+
     /* the derivation of this formula is left as an exercise for the reader */
-    rem = (unsigned)(len2 % BASE);
+    MOD63(len2);                /* assumes len2 >= 0 */
+    rem = (unsigned)len2;
     sum1 = adler1 & 0xffff;
     sum2 = rem * sum1;
     MOD(sum2);
diff --git a/Modules/zlib/algorithm.txt b/Modules/zlib/algorithm.txt
index b022dde..c97f495 100644
--- a/Modules/zlib/algorithm.txt
+++ b/Modules/zlib/algorithm.txt
@@ -121,7 +121,7 @@
 kbytes.  You can imagine that filling in a 2^15 entry table for a 15-bit code
 would take too long if you're only decoding several thousand symbols.  At the
 other extreme, you could make a new table for every bit in the code.  In fact,
-that's essentially a Huffman tree.  But then you spend two much time
+that's essentially a Huffman tree.  But then you spend too much time
 traversing the tree while decoding, even for short symbols.
 
 So the number of bits for the first lookup table is a trade of the time to
@@ -206,4 +206,4 @@
 pp. 337-343.
 
 ``DEFLATE Compressed Data Format Specification'' available in
-http://www.ietf.org/rfc/rfc1951.txt
+http://tools.ietf.org/html/rfc1951
diff --git a/Modules/zlib/compress.c b/Modules/zlib/compress.c
index ea4dfbe..6e97626 100644
--- a/Modules/zlib/compress.c
+++ b/Modules/zlib/compress.c
@@ -29,7 +29,7 @@
     z_stream stream;
     int err;
 
-    stream.next_in = (Bytef*)source;
+    stream.next_in = (z_const Bytef *)source;
     stream.avail_in = (uInt)sourceLen;
 #ifdef MAXSEG_64K
     /* Check for source > 64K on 16-bit machine: */
diff --git a/Modules/zlib/configure b/Modules/zlib/configure
index bd9edd2..b77a8a8 100755
--- a/Modules/zlib/configure
+++ b/Modules/zlib/configure
@@ -13,39 +13,52 @@
 # If you have problems, try without defining CC and CFLAGS before reporting
 # an error.
 
+# start off configure.log
+echo -------------------- >> configure.log
+echo $0 $* >> configure.log
+date >> configure.log
+
+# set command prefix for cross-compilation
 if [ -n "${CHOST}" ]; then
-    uname="$(echo "${CHOST}" | sed -e 's/^[^-]*-\([^-]*\)$/\1/' -e 's/^[^-]*-[^-]*-\([^-]*\)$/\1/' -e 's/^[^-]*-[^-]*-\([^-]*\)-.*$/\1/')"
+    uname="`echo "${CHOST}" | sed -e 's/^[^-]*-\([^-]*\)$/\1/' -e 's/^[^-]*-[^-]*-\([^-]*\)$/\1/' -e 's/^[^-]*-[^-]*-\([^-]*\)-.*$/\1/'`"
     CROSS_PREFIX="${CHOST}-"
 fi
 
+# destination name for static library
 STATICLIB=libz.a
-LDFLAGS="${LDFLAGS} -L. ${STATICLIB}"
+
+# extract zlib version numbers from zlib.h
 VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`
 VER3=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\\.[0-9]*\).*/\1/p' < zlib.h`
 VER2=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\)\\..*/\1/p' < zlib.h`
 VER1=`sed -n -e '/VERSION "/s/.*"\([0-9]*\)\\..*/\1/p' < zlib.h`
+
+# establish commands for library building
 if "${CROSS_PREFIX}ar" --version >/dev/null 2>/dev/null || test $? -lt 126; then
     AR=${AR-"${CROSS_PREFIX}ar"}
-    test -n "${CROSS_PREFIX}" && echo Using ${AR}
+    test -n "${CROSS_PREFIX}" && echo Using ${AR} | tee -a configure.log
 else
     AR=${AR-"ar"}
-    test -n "${CROSS_PREFIX}" && echo Using ${AR}
+    test -n "${CROSS_PREFIX}" && echo Using ${AR} | tee -a configure.log
 fi
-AR_RC="${AR} rc"
+ARFLAGS=${ARFLAGS-"rc"}
 if "${CROSS_PREFIX}ranlib" --version >/dev/null 2>/dev/null || test $? -lt 126; then
     RANLIB=${RANLIB-"${CROSS_PREFIX}ranlib"}
-    test -n "${CROSS_PREFIX}" && echo Using ${RANLIB}
+    test -n "${CROSS_PREFIX}" && echo Using ${RANLIB} | tee -a configure.log
 else
     RANLIB=${RANLIB-"ranlib"}
 fi
 if "${CROSS_PREFIX}nm" --version >/dev/null 2>/dev/null || test $? -lt 126; then
     NM=${NM-"${CROSS_PREFIX}nm"}
-    test -n "${CROSS_PREFIX}" && echo Using ${NM}
+    test -n "${CROSS_PREFIX}" && echo Using ${NM} | tee -a configure.log
 else
     NM=${NM-"nm"}
 fi
+
+# set defaults before processing command line options
 LDCONFIG=${LDCONFIG-"ldconfig"}
 LDSHAREDLIBC="${LDSHAREDLIBC--lc}"
+ARCHS=
 prefix=${prefix-/usr/local}
 exec_prefix=${exec_prefix-'${prefix}'}
 libdir=${libdir-'${exec_prefix}/lib'}
@@ -54,20 +67,39 @@
 mandir=${mandir-'${prefix}/share/man'}
 shared_ext='.so'
 shared=1
+solo=0
+cover=0
 zprefix=0
+zconst=0
 build64=0
 gcc=0
 old_cc="$CC"
 old_cflags="$CFLAGS"
+OBJC='$(OBJZ) $(OBJG)'
+PIC_OBJC='$(PIC_OBJZ) $(PIC_OBJG)'
 
+# leave this script, optionally in a bad way
+leave()
+{
+  if test "$*" != "0"; then
+    echo "** $0 aborting." | tee -a configure.log
+  fi
+  rm -f $test.[co] $test $test$shared_ext $test.gcno ./--version
+  echo -------------------- >> configure.log
+  echo >> configure.log
+  echo >> configure.log
+  exit $1
+}
+
+# process command line options
 while test $# -ge 1
 do
 case "$1" in
     -h* | --help)
-      echo 'usage:'
-      echo '  configure [--zprefix] [--prefix=PREFIX]  [--eprefix=EXPREFIX]'
-      echo '    [--static] [--64] [--libdir=LIBDIR] [--sharedlibdir=LIBDIR]'
-      echo '    [--includedir=INCLUDEDIR]'
+      echo 'usage:' | tee -a configure.log
+      echo '  configure [--const] [--zprefix] [--prefix=PREFIX]  [--eprefix=EXPREFIX]' | tee -a configure.log
+      echo '    [--static] [--64] [--libdir=LIBDIR] [--sharedlibdir=LIBDIR]' | tee -a configure.log
+      echo '    [--includedir=INCLUDEDIR] [--archs="-arch i386 -arch x86_64"]' | tee -a configure.log
         exit 0 ;;
     -p*=* | --prefix=*) prefix=`echo $1 | sed 's/.*=//'`; shift ;;
     -e*=* | --eprefix=*) exec_prefix=`echo $1 | sed 's/.*=//'`; shift ;;
@@ -81,51 +113,88 @@
     -i* | --includedir) includedir="$2"; shift; shift ;;
     -s* | --shared | --enable-shared) shared=1; shift ;;
     -t | --static) shared=0; shift ;;
+    --solo) solo=1; shift ;;
+    --cover) cover=1; shift ;;
     -z* | --zprefix) zprefix=1; shift ;;
     -6* | --64) build64=1; shift ;;
-    --sysconfdir=*) echo "ignored option: --sysconfdir"; shift ;;
-    --localstatedir=*) echo "ignored option: --localstatedir"; shift ;;
-    *) echo "unknown option: $1"; echo "$0 --help for help"; exit 1 ;;
+    -a*=* | --archs=*) ARCHS=`echo $1 | sed 's/.*=//'`; shift ;;
+    --sysconfdir=*) echo "ignored option: --sysconfdir" | tee -a configure.log; shift ;;
+    --localstatedir=*) echo "ignored option: --localstatedir" | tee -a configure.log; shift ;;
+    -c* | --const) zconst=1; shift ;;
+    *)
+      echo "unknown option: $1" | tee -a configure.log
+      echo "$0 --help for help" | tee -a configure.log
+      leave 1;;
     esac
 done
 
+# temporary file name
 test=ztest$$
+
+# put arguments in log, also put test file in log if used in arguments
+show()
+{
+  case "$*" in
+    *$test.c*)
+      echo === $test.c === >> configure.log
+      cat $test.c >> configure.log
+      echo === >> configure.log;;
+  esac
+  echo $* >> configure.log
+}
+
+# check for gcc vs. cc and set compile and link flags based on the system identified by uname
 cat > $test.c <<EOF
 extern int getchar();
 int hello() {return getchar();}
 EOF
 
-test -z "$CC" && echo Checking for ${CROSS_PREFIX}gcc...
+test -z "$CC" && echo Checking for ${CROSS_PREFIX}gcc... | tee -a configure.log
 cc=${CC-${CROSS_PREFIX}gcc}
 cflags=${CFLAGS-"-O3"}
 # to force the asm version use: CFLAGS="-O3 -DASMV" ./configure
 case "$cc" in
   *gcc*) gcc=1 ;;
+  *clang*) gcc=1 ;;
+esac
+case `$cc -v 2>&1` in
+  *gcc*) gcc=1 ;;
 esac
 
-if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) 2>/dev/null; then
+show $cc -c $test.c
+if test "$gcc" -eq 1 && ($cc -c $test.c) >> configure.log 2>&1; then
+  echo ... using gcc >> configure.log
   CC="$cc"
+  CFLAGS="${CFLAGS--O3} ${ARCHS}"
   SFLAGS="${CFLAGS--O3} -fPIC"
-  CFLAGS="${CFLAGS--O3}"
+  LDFLAGS="${LDFLAGS} ${ARCHS}"
   if test $build64 -eq 1; then
     CFLAGS="${CFLAGS} -m64"
     SFLAGS="${SFLAGS} -m64"
   fi
   if test "${ZLIBGCCWARN}" = "YES"; then
-    CFLAGS="${CFLAGS} -Wall -Wextra -pedantic"
+    if test "$zconst" -eq 1; then
+      CFLAGS="${CFLAGS} -Wall -Wextra -Wcast-qual -pedantic -DZLIB_CONST"
+    else
+      CFLAGS="${CFLAGS} -Wall -Wextra -pedantic"
+    fi
   fi
   if test -z "$uname"; then
     uname=`(uname -s || echo unknown) 2>/dev/null`
   fi
   case "$uname" in
-  Linux* | linux* | GNU | GNU/* | *BSD | DragonFly) LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map"} ;;
+  Linux* | linux* | GNU | GNU/* | solaris*)
+        LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map"} ;;
+  *BSD | *bsd* | DragonFly)
+        LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map"}
+        LDCONFIG="ldconfig -m" ;;
   CYGWIN* | Cygwin* | cygwin* | OS/2*)
         EXE='.exe' ;;
-  MINGW*|mingw*)
+  MINGW* | mingw*)
 # temporary bypass
         rm -f $test.[co] $test $test$shared_ext
-        echo "Please use win32/Makefile.gcc instead."
-        exit 1
+        echo "Please use win32/Makefile.gcc instead." | tee -a configure.log
+        leave 1
         LDSHARED=${LDSHARED-"$cc -shared"}
         LDSHAREDLIBC=""
         EXE='.exe' ;;
@@ -142,17 +211,25 @@
                  shared_ext='.sl'
                  SHAREDLIB='libz.sl' ;;
          esac ;;
-  Darwin*)   shared_ext='.dylib'
+  Darwin* | darwin*)
+             shared_ext='.dylib'
              SHAREDLIB=libz$shared_ext
              SHAREDLIBV=libz.$VER$shared_ext
              SHAREDLIBM=libz.$VER1$shared_ext
-             LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name $libdir/$SHAREDLIBM -compatibility_version $VER1 -current_version $VER3"} ;;
+             LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name $libdir/$SHAREDLIBM -compatibility_version $VER1 -current_version $VER3"}
+             if libtool -V 2>&1 | grep Apple > /dev/null; then
+                 AR="libtool"
+             else
+                 AR="/usr/bin/libtool"
+             fi
+             ARFLAGS="-o" ;;
   *)             LDSHARED=${LDSHARED-"$cc -shared"} ;;
   esac
 else
   # find system name and corresponding cc options
   CC=${CC-cc}
   gcc=0
+  echo ... using $CC >> configure.log
   if test -z "$uname"; then
     uname=`(uname -sr || echo unknown) 2>/dev/null`
   fi
@@ -183,19 +260,34 @@
              CFLAGS=${CFLAGS-"-4 -O"}
              LDSHARED=${LDSHARED-"cc"}
              RANLIB=${RANLIB-"true"}
-             AR_RC="cc -A" ;;
+             AR="cc"
+             ARFLAGS="-A" ;;
   SCO_SV\ 3.2*) SFLAGS=${CFLAGS-"-O3 -dy -KPIC "}
              CFLAGS=${CFLAGS-"-O3"}
              LDSHARED=${LDSHARED-"cc -dy -KPIC -G"} ;;
-  SunOS\ 5*) LDSHARED=${LDSHARED-"cc -G"}
-         case `(uname -m || echo unknown) 2>/dev/null` in
-         i86*)
-             SFLAGS=${CFLAGS-"-xpentium -fast -KPIC -R."}
-             CFLAGS=${CFLAGS-"-xpentium -fast"} ;;
-         *)
-             SFLAGS=${CFLAGS-"-fast -xcg92 -KPIC -R."}
-             CFLAGS=${CFLAGS-"-fast -xcg92"} ;;
-         esac ;;
+  SunOS\ 5* | solaris*)
+         LDSHARED=${LDSHARED-"cc -G -h libz$shared_ext.$VER1"}
+         SFLAGS=${CFLAGS-"-fast -KPIC"}
+         CFLAGS=${CFLAGS-"-fast"}
+         if test $build64 -eq 1; then
+             # old versions of SunPRO/Workshop/Studio don't support -m64,
+             # but newer ones do.  Check for it.
+             flag64=`$CC -flags | egrep -- '^-m64'`
+             if test x"$flag64" != x"" ; then
+                 CFLAGS="${CFLAGS} -m64"
+                 SFLAGS="${SFLAGS} -m64"
+             else
+                 case `(uname -m || echo unknown) 2>/dev/null` in
+                   i86*)
+                     SFLAGS="$SFLAGS -xarch=amd64"
+                     CFLAGS="$CFLAGS -xarch=amd64" ;;
+                   *)
+                     SFLAGS="$SFLAGS -xarch=v9"
+                     CFLAGS="$CFLAGS -xarch=v9" ;;
+                 esac
+             fi
+         fi
+         ;;
   SunOS\ 4*) SFLAGS=${CFLAGS-"-O2 -PIC"}
              CFLAGS=${CFLAGS-"-O2"}
              LDSHARED=${LDSHARED-"ld"} ;;
@@ -225,25 +317,79 @@
   esac
 fi
 
+# destination names for shared library if not defined above
 SHAREDLIB=${SHAREDLIB-"libz$shared_ext"}
 SHAREDLIBV=${SHAREDLIBV-"libz$shared_ext.$VER"}
 SHAREDLIBM=${SHAREDLIBM-"libz$shared_ext.$VER1"}
 
+echo >> configure.log
+
+# define functions for testing compiler and library characteristics and logging the results
+
+cat > $test.c <<EOF
+#error error
+EOF
+if ($CC -c $CFLAGS $test.c) 2>/dev/null; then
+  try()
+  {
+    show $*
+    test "`( $* ) 2>&1 | tee -a configure.log`" = ""
+  }
+  echo - using any output from compiler to indicate an error >> configure.log
+else
+try()
+{
+  show $*
+  ( $* ) >> configure.log 2>&1
+  ret=$?
+  if test $ret -ne 0; then
+    echo "(exit code "$ret")" >> configure.log
+  fi
+  return $ret
+}
+fi
+
+tryboth()
+{
+  show $*
+  got=`( $* ) 2>&1`
+  ret=$?
+  printf %s "$got" >> configure.log
+  if test $ret -ne 0; then
+    return $ret
+  fi
+  test "$got" = ""
+}
+
+cat > $test.c << EOF
+int foo() { return 0; }
+EOF
+echo "Checking for obsessive-compulsive compiler options..." >> configure.log
+if try $CC -c $CFLAGS $test.c; then
+  :
+else
+  echo "Compiler error reporting is too harsh for $0 (perhaps remove -Werror)." | tee -a configure.log
+  leave 1
+fi
+
+echo >> configure.log
+
+# see if shared library build supported
+cat > $test.c <<EOF
+extern int getchar();
+int hello() {return getchar();}
+EOF
 if test $shared -eq 1; then
-  echo Checking for shared library support...
+  echo Checking for shared library support... | tee -a configure.log
   # we must test in two steps (cc then ld), required at least on SunOS 4.x
-  if test "`($CC -w -c $SFLAGS $test.c) 2>&1`" = "" &&
-     test "`($LDSHARED $SFLAGS -o $test$shared_ext $test.o) 2>&1`" = ""; then
-    echo Building shared library $SHAREDLIBV with $CC.
+  if try $CC -w -c $SFLAGS $test.c &&
+     try $LDSHARED $SFLAGS -o $test$shared_ext $test.o; then
+    echo Building shared library $SHAREDLIBV with $CC. | tee -a configure.log
   elif test -z "$old_cc" -a -z "$old_cflags"; then
-    echo No shared library support.
+    echo No shared library support. | tee -a configure.log
     shared=0;
   else
-    echo Tested $CC -w -c $SFLAGS $test.c
-    $CC -w -c $SFLAGS $test.c
-    echo Tested $LDSHARED $SFLAGS -o $test$shared_ext $test.o
-    $LDSHARED $SFLAGS -o $test$shared_ext $test.o
-    echo 'No shared library support; try without defining CC and CFLAGS'
+    echo 'No shared library support; try without defining CC and CFLAGS' | tee -a configure.log
     shared=0;
   fi
 fi
@@ -254,25 +400,43 @@
   SHAREDLIB=""
   SHAREDLIBV=""
   SHAREDLIBM=""
-  echo Building static library $STATICLIB version $VER with $CC.
+  echo Building static library $STATICLIB version $VER with $CC. | tee -a configure.log
 else
   ALL="static shared"
   TEST="all teststatic testshared"
 fi
 
+# check for underscores in external names for use by assembler code
+CPP=${CPP-"$CC -E"}
+case $CFLAGS in
+  *ASMV*)
+    echo >> configure.log
+    show "$NM $test.o | grep _hello"
+    if test "`$NM $test.o | grep _hello | tee -a configure.log`" = ""; then
+      CPP="$CPP -DNO_UNDERLINE"
+      echo Checking for underline in external names... No. | tee -a configure.log
+    else
+      echo Checking for underline in external names... Yes. | tee -a configure.log
+    fi ;;
+esac
+
+echo >> configure.log
+
+# check for large file support, and if none, check for fseeko()
 cat > $test.c <<EOF
 #include <sys/types.h>
 off64_t dummy = 0;
 EOF
-if test "`($CC -c $CFLAGS -D_LARGEFILE64_SOURCE=1 $test.c) 2>&1`" = ""; then
+if try $CC -c $CFLAGS -D_LARGEFILE64_SOURCE=1 $test.c; then
   CFLAGS="${CFLAGS} -D_LARGEFILE64_SOURCE=1"
   SFLAGS="${SFLAGS} -D_LARGEFILE64_SOURCE=1"
   ALL="${ALL} all64"
   TEST="${TEST} test64"
-  echo "Checking for off64_t... Yes."
-  echo "Checking for fseeko... Yes."
+  echo "Checking for off64_t... Yes." | tee -a configure.log
+  echo "Checking for fseeko... Yes." | tee -a configure.log
 else
-  echo "Checking for off64_t... No."
+  echo "Checking for off64_t... No." | tee -a configure.log
+  echo >> configure.log
   cat > $test.c <<EOF
 #include <stdio.h>
 int main(void) {
@@ -280,272 +444,335 @@
   return 0;
 }
 EOF
-  if test "`($CC $CFLAGS -o $test $test.c) 2>&1`" = ""; then
-    echo "Checking for fseeko... Yes."
+  if try $CC $CFLAGS -o $test $test.c; then
+    echo "Checking for fseeko... Yes." | tee -a configure.log
   else
     CFLAGS="${CFLAGS} -DNO_FSEEKO"
     SFLAGS="${SFLAGS} -DNO_FSEEKO"
-    echo "Checking for fseeko... No."
+    echo "Checking for fseeko... No." | tee -a configure.log
   fi
 fi
 
+echo >> configure.log
+
+# check for strerror() for use by gz* functions
+cat > $test.c <<EOF
+#include <string.h>
+#include <errno.h>
+int main() { return strlen(strerror(errno)); }
+EOF
+if try $CC $CFLAGS -o $test $test.c; then
+  echo "Checking for strerror... Yes." | tee -a configure.log
+else
+  CFLAGS="${CFLAGS} -DNO_STRERROR"
+  SFLAGS="${SFLAGS} -DNO_STRERROR"
+  echo "Checking for strerror... No." | tee -a configure.log
+fi
+
+# copy clean zconf.h for subsequent edits
 cp -p zconf.h.in zconf.h
 
+echo >> configure.log
+
+# check for unistd.h and save result in zconf.h
 cat > $test.c <<EOF
 #include <unistd.h>
 int main() { return 0; }
 EOF
-if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
+if try $CC -c $CFLAGS $test.c; then
   sed < zconf.h "/^#ifdef HAVE_UNISTD_H.* may be/s/def HAVE_UNISTD_H\(.*\) may be/ 1\1 was/" > zconf.temp.h
   mv zconf.temp.h zconf.h
-  echo "Checking for unistd.h... Yes."
+  echo "Checking for unistd.h... Yes." | tee -a configure.log
 else
-  echo "Checking for unistd.h... No."
+  echo "Checking for unistd.h... No." | tee -a configure.log
 fi
 
+echo >> configure.log
+
+# check for stdarg.h and save result in zconf.h
+cat > $test.c <<EOF
+#include <stdarg.h>
+int main() { return 0; }
+EOF
+if try $CC -c $CFLAGS $test.c; then
+  sed < zconf.h "/^#ifdef HAVE_STDARG_H.* may be/s/def HAVE_STDARG_H\(.*\) may be/ 1\1 was/" > zconf.temp.h
+  mv zconf.temp.h zconf.h
+  echo "Checking for stdarg.h... Yes." | tee -a configure.log
+else
+  echo "Checking for stdarg.h... No." | tee -a configure.log
+fi
+
+# if the z_ prefix was requested, save that in zconf.h
 if test $zprefix -eq 1; then
   sed < zconf.h "/#ifdef Z_PREFIX.* may be/s/def Z_PREFIX\(.*\) may be/ 1\1 was/" > zconf.temp.h
   mv zconf.temp.h zconf.h
-  echo "Using z_ prefix on all symbols."
+  echo >> configure.log
+  echo "Using z_ prefix on all symbols." | tee -a configure.log
 fi
 
+# if --solo compilation was requested, save that in zconf.h and remove gz stuff from object lists
+if test $solo -eq 1; then
+  sed '/#define ZCONF_H/a\
+#define Z_SOLO
+
+' < zconf.h > zconf.temp.h
+  mv zconf.temp.h zconf.h
+OBJC='$(OBJZ)'
+PIC_OBJC='$(PIC_OBJZ)'
+fi
+
+# if code coverage testing was requested, use older gcc if defined, e.g. "gcc-4.2" on Mac OS X
+if test $cover -eq 1; then
+  CFLAGS="${CFLAGS} -fprofile-arcs -ftest-coverage"
+  if test -n "$GCC_CLASSIC"; then
+    CC=$GCC_CLASSIC
+  fi
+fi
+
+echo >> configure.log
+
+# conduct a series of tests to resolve eight possible cases of using "vs" or "s" printf functions
+# (using stdarg or not), with or without "n" (proving size of buffer), and with or without a
+# return value.  The most secure result is vsnprintf() with a return value.  snprintf() with a
+# return value is secure as well, but then gzprintf() will be limited to 20 arguments.
 cat > $test.c <<EOF
 #include <stdio.h>
 #include <stdarg.h>
 #include "zconf.h"
-
 int main()
 {
 #ifndef STDC
   choke me
 #endif
-
   return 0;
 }
 EOF
+if try $CC -c $CFLAGS $test.c; then
+  echo "Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()." | tee -a configure.log
 
-if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
-  echo "Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()."
-
+  echo >> configure.log
   cat > $test.c <<EOF
 #include <stdio.h>
 #include <stdarg.h>
-
 int mytest(const char *fmt, ...)
 {
   char buf[20];
   va_list ap;
-
   va_start(ap, fmt);
   vsnprintf(buf, sizeof(buf), fmt, ap);
   va_end(ap);
   return 0;
 }
-
 int main()
 {
   return (mytest("Hello%d\n", 1));
 }
 EOF
+  if try $CC $CFLAGS -o $test $test.c; then
+    echo "Checking for vsnprintf() in stdio.h... Yes." | tee -a configure.log
 
-  if test "`($CC $CFLAGS -o $test $test.c) 2>&1`" = ""; then
-    echo "Checking for vsnprintf() in stdio.h... Yes."
-
+    echo >> configure.log
     cat >$test.c <<EOF
 #include <stdio.h>
 #include <stdarg.h>
-
 int mytest(const char *fmt, ...)
 {
   int n;
   char buf[20];
   va_list ap;
-
   va_start(ap, fmt);
   n = vsnprintf(buf, sizeof(buf), fmt, ap);
   va_end(ap);
   return n;
 }
-
 int main()
 {
   return (mytest("Hello%d\n", 1));
 }
 EOF
 
-    if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
-      echo "Checking for return value of vsnprintf()... Yes."
+    if try $CC -c $CFLAGS $test.c; then
+      echo "Checking for return value of vsnprintf()... Yes." | tee -a configure.log
     else
       CFLAGS="$CFLAGS -DHAS_vsnprintf_void"
       SFLAGS="$SFLAGS -DHAS_vsnprintf_void"
-      echo "Checking for return value of vsnprintf()... No."
-      echo "  WARNING: apparently vsnprintf() does not return a value. zlib"
-      echo "  can build but will be open to possible string-format security"
-      echo "  vulnerabilities."
+      echo "Checking for return value of vsnprintf()... No." | tee -a configure.log
+      echo "  WARNING: apparently vsnprintf() does not return a value. zlib" | tee -a configure.log
+      echo "  can build but will be open to possible string-format security" | tee -a configure.log
+      echo "  vulnerabilities." | tee -a configure.log
     fi
   else
     CFLAGS="$CFLAGS -DNO_vsnprintf"
     SFLAGS="$SFLAGS -DNO_vsnprintf"
-    echo "Checking for vsnprintf() in stdio.h... No."
-    echo "  WARNING: vsnprintf() not found, falling back to vsprintf(). zlib"
-    echo "  can build but will be open to possible buffer-overflow security"
-    echo "  vulnerabilities."
+    echo "Checking for vsnprintf() in stdio.h... No." | tee -a configure.log
+    echo "  WARNING: vsnprintf() not found, falling back to vsprintf(). zlib" | tee -a configure.log
+    echo "  can build but will be open to possible buffer-overflow security" | tee -a configure.log
+    echo "  vulnerabilities." | tee -a configure.log
 
+    echo >> configure.log
     cat >$test.c <<EOF
 #include <stdio.h>
 #include <stdarg.h>
-
 int mytest(const char *fmt, ...)
 {
   int n;
   char buf[20];
   va_list ap;
-
   va_start(ap, fmt);
   n = vsprintf(buf, fmt, ap);
   va_end(ap);
   return n;
 }
-
 int main()
 {
   return (mytest("Hello%d\n", 1));
 }
 EOF
 
-    if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
-      echo "Checking for return value of vsprintf()... Yes."
+    if try $CC -c $CFLAGS $test.c; then
+      echo "Checking for return value of vsprintf()... Yes." | tee -a configure.log
     else
       CFLAGS="$CFLAGS -DHAS_vsprintf_void"
       SFLAGS="$SFLAGS -DHAS_vsprintf_void"
-      echo "Checking for return value of vsprintf()... No."
-      echo "  WARNING: apparently vsprintf() does not return a value. zlib"
-      echo "  can build but will be open to possible string-format security"
-      echo "  vulnerabilities."
+      echo "Checking for return value of vsprintf()... No." | tee -a configure.log
+      echo "  WARNING: apparently vsprintf() does not return a value. zlib" | tee -a configure.log
+      echo "  can build but will be open to possible string-format security" | tee -a configure.log
+      echo "  vulnerabilities." | tee -a configure.log
     fi
   fi
 else
-  echo "Checking whether to use vs[n]printf() or s[n]printf()... using s[n]printf()."
+  echo "Checking whether to use vs[n]printf() or s[n]printf()... using s[n]printf()." | tee -a configure.log
 
+  echo >> configure.log
   cat >$test.c <<EOF
 #include <stdio.h>
-
 int mytest()
 {
   char buf[20];
-
   snprintf(buf, sizeof(buf), "%s", "foo");
   return 0;
 }
-
 int main()
 {
   return (mytest());
 }
 EOF
 
-  if test "`($CC $CFLAGS -o $test $test.c) 2>&1`" = ""; then
-    echo "Checking for snprintf() in stdio.h... Yes."
+  if try $CC $CFLAGS -o $test $test.c; then
+    echo "Checking for snprintf() in stdio.h... Yes." | tee -a configure.log
 
+    echo >> configure.log
     cat >$test.c <<EOF
 #include <stdio.h>
-
 int mytest()
 {
   char buf[20];
-
   return snprintf(buf, sizeof(buf), "%s", "foo");
 }
-
 int main()
 {
   return (mytest());
 }
 EOF
 
-    if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
-      echo "Checking for return value of snprintf()... Yes."
+    if try $CC -c $CFLAGS $test.c; then
+      echo "Checking for return value of snprintf()... Yes." | tee -a configure.log
     else
       CFLAGS="$CFLAGS -DHAS_snprintf_void"
       SFLAGS="$SFLAGS -DHAS_snprintf_void"
-      echo "Checking for return value of snprintf()... No."
-      echo "  WARNING: apparently snprintf() does not return a value. zlib"
-      echo "  can build but will be open to possible string-format security"
-      echo "  vulnerabilities."
+      echo "Checking for return value of snprintf()... No." | tee -a configure.log
+      echo "  WARNING: apparently snprintf() does not return a value. zlib" | tee -a configure.log
+      echo "  can build but will be open to possible string-format security" | tee -a configure.log
+      echo "  vulnerabilities." | tee -a configure.log
     fi
   else
     CFLAGS="$CFLAGS -DNO_snprintf"
     SFLAGS="$SFLAGS -DNO_snprintf"
-    echo "Checking for snprintf() in stdio.h... No."
-    echo "  WARNING: snprintf() not found, falling back to sprintf(). zlib"
-    echo "  can build but will be open to possible buffer-overflow security"
-    echo "  vulnerabilities."
+    echo "Checking for snprintf() in stdio.h... No." | tee -a configure.log
+    echo "  WARNING: snprintf() not found, falling back to sprintf(). zlib" | tee -a configure.log
+    echo "  can build but will be open to possible buffer-overflow security" | tee -a configure.log
+    echo "  vulnerabilities." | tee -a configure.log
 
+    echo >> configure.log
     cat >$test.c <<EOF
 #include <stdio.h>
-
 int mytest()
 {
   char buf[20];
-
   return sprintf(buf, "%s", "foo");
 }
-
 int main()
 {
   return (mytest());
 }
 EOF
 
-    if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
-      echo "Checking for return value of sprintf()... Yes."
+    if try $CC -c $CFLAGS $test.c; then
+      echo "Checking for return value of sprintf()... Yes." | tee -a configure.log
     else
       CFLAGS="$CFLAGS -DHAS_sprintf_void"
       SFLAGS="$SFLAGS -DHAS_sprintf_void"
-      echo "Checking for return value of sprintf()... No."
-      echo "  WARNING: apparently sprintf() does not return a value. zlib"
-      echo "  can build but will be open to possible string-format security"
-      echo "  vulnerabilities."
+      echo "Checking for return value of sprintf()... No." | tee -a configure.log
+      echo "  WARNING: apparently sprintf() does not return a value. zlib" | tee -a configure.log
+      echo "  can build but will be open to possible string-format security" | tee -a configure.log
+      echo "  vulnerabilities." | tee -a configure.log
     fi
   fi
 fi
 
+# see if we can hide zlib internal symbols that are linked between separate source files
 if test "$gcc" -eq 1; then
+  echo >> configure.log
   cat > $test.c <<EOF
-#if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33)
-#  define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
-#else
-#  define ZLIB_INTERNAL
-#endif
+#define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
 int ZLIB_INTERNAL foo;
 int main()
 {
   return 0;
 }
 EOF
-  if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
-    echo "Checking for attribute(visibility) support... Yes."
+  if tryboth $CC -c $CFLAGS $test.c; then
+    CFLAGS="$CFLAGS -DHAVE_HIDDEN"
+    SFLAGS="$SFLAGS -DHAVE_HIDDEN"
+    echo "Checking for attribute(visibility) support... Yes." | tee -a configure.log
   else
-    CFLAGS="$CFLAGS -DNO_VIZ"
-    SFLAGS="$SFLAGS -DNO_VIZ"
-    echo "Checking for attribute(visibility) support... No."
+    echo "Checking for attribute(visibility) support... No." | tee -a configure.log
   fi
 fi
 
-CPP=${CPP-"$CC -E"}
-case $CFLAGS in
-  *ASMV*)
-    if test "`$NM $test.o | grep _hello`" = ""; then
-      CPP="$CPP -DNO_UNDERLINE"
-      echo Checking for underline in external names... No.
-    else
-      echo Checking for underline in external names... Yes.
-    fi ;;
-esac
+# show the results in the log
+echo >> configure.log
+echo ALL = $ALL >> configure.log
+echo AR = $AR >> configure.log
+echo ARFLAGS = $ARFLAGS >> configure.log
+echo CC = $CC >> configure.log
+echo CFLAGS = $CFLAGS >> configure.log
+echo CPP = $CPP >> configure.log
+echo EXE = $EXE >> configure.log
+echo LDCONFIG = $LDCONFIG >> configure.log
+echo LDFLAGS = $LDFLAGS >> configure.log
+echo LDSHARED = $LDSHARED >> configure.log
+echo LDSHAREDLIBC = $LDSHAREDLIBC >> configure.log
+echo OBJC = $OBJC >> configure.log
+echo PIC_OBJC = $PIC_OBJC >> configure.log
+echo RANLIB = $RANLIB >> configure.log
+echo SFLAGS = $SFLAGS >> configure.log
+echo SHAREDLIB = $SHAREDLIB >> configure.log
+echo SHAREDLIBM = $SHAREDLIBM >> configure.log
+echo SHAREDLIBV = $SHAREDLIBV >> configure.log
+echo STATICLIB = $STATICLIB >> configure.log
+echo TEST = $TEST >> configure.log
+echo VER = $VER >> configure.log
+echo Z_U4 = $Z_U4 >> configure.log
+echo exec_prefix = $exec_prefix >> configure.log
+echo includedir = $includedir >> configure.log
+echo libdir = $libdir >> configure.log
+echo mandir = $mandir >> configure.log
+echo prefix = $prefix >> configure.log
+echo sharedlibdir = $sharedlibdir >> configure.log
+echo uname = $uname >> configure.log
 
-rm -f $test.[co] $test $test$shared_ext
-
-# udpate Makefile
+# udpate Makefile with the configure results
 sed < Makefile.in "
 /^CC *=/s#=.*#=$CC#
 /^CFLAGS *=/s#=.*#=$CFLAGS#
@@ -557,7 +784,8 @@
 /^SHAREDLIB *=/s#=.*#=$SHAREDLIB#
 /^SHAREDLIBV *=/s#=.*#=$SHAREDLIBV#
 /^SHAREDLIBM *=/s#=.*#=$SHAREDLIBM#
-/^AR *=/s#=.*#=$AR_RC#
+/^AR *=/s#=.*#=$AR#
+/^ARFLAGS *=/s#=.*#=$ARFLAGS#
 /^RANLIB *=/s#=.*#=$RANLIB#
 /^LDCONFIG *=/s#=.*#=$LDCONFIG#
 /^LDSHAREDLIBC *=/s#=.*#=$LDSHAREDLIBC#
@@ -568,10 +796,13 @@
 /^sharedlibdir *=/s#=.*#=$sharedlibdir#
 /^includedir *=/s#=.*#=$includedir#
 /^mandir *=/s#=.*#=$mandir#
+/^OBJC *=/s#=.*#= $OBJC#
+/^PIC_OBJC *=/s#=.*#= $PIC_OBJC#
 /^all: */s#:.*#: $ALL#
 /^test: */s#:.*#: $TEST#
 " > Makefile
 
+# create zlib.pc with the configure results
 sed < zlib.pc.in "
 /^CC *=/s#=.*#=$CC#
 /^CFLAGS *=/s#=.*#=$CFLAGS#
@@ -581,7 +812,8 @@
 /^SHAREDLIB *=/s#=.*#=$SHAREDLIB#
 /^SHAREDLIBV *=/s#=.*#=$SHAREDLIBV#
 /^SHAREDLIBM *=/s#=.*#=$SHAREDLIBM#
-/^AR *=/s#=.*#=$AR_RC#
+/^AR *=/s#=.*#=$AR#
+/^ARFLAGS *=/s#=.*#=$ARFLAGS#
 /^RANLIB *=/s#=.*#=$RANLIB#
 /^EXE *=/s#=.*#=$EXE#
 /^prefix *=/s#=.*#=$prefix#
@@ -594,3 +826,6 @@
 " | sed -e "
 s/\@VERSION\@/$VER/g;
 " > zlib.pc
+
+# done
+leave 0
diff --git a/Modules/zlib/crc32.c b/Modules/zlib/crc32.c
index 91be372..979a719 100644
--- a/Modules/zlib/crc32.c
+++ b/Modules/zlib/crc32.c
@@ -1,5 +1,5 @@
 /* crc32.c -- compute the CRC-32 of a data stream
- * Copyright (C) 1995-2006, 2010 Mark Adler
+ * Copyright (C) 1995-2006, 2010, 2011, 2012 Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  *
  * Thanks to Rodney Brown <rbrown64@csc.com.au> for his contribution of faster
@@ -17,6 +17,8 @@
   of the crc tables.  Therefore, if you #define DYNAMIC_CRC_TABLE, you should
   first call get_crc_table() to initialize the tables before allowing more than
   one thread to use crc32().
+
+  DYNAMIC_CRC_TABLE and MAKECRCH can be #defined to write out crc32.h.
  */
 
 #ifdef MAKECRCH
@@ -30,31 +32,11 @@
 
 #define local static
 
-/* Find a four-byte integer type for crc32_little() and crc32_big(). */
-#ifndef NOBYFOUR
-#  ifdef STDC           /* need ANSI C limits.h to determine sizes */
-#    include <limits.h>
-#    define BYFOUR
-#    if (UINT_MAX == 0xffffffffUL)
-       typedef unsigned int u4;
-#    else
-#      if (ULONG_MAX == 0xffffffffUL)
-         typedef unsigned long u4;
-#      else
-#        if (USHRT_MAX == 0xffffffffUL)
-           typedef unsigned short u4;
-#        else
-#          undef BYFOUR     /* can't find a four-byte integer type! */
-#        endif
-#      endif
-#    endif
-#  endif /* STDC */
-#endif /* !NOBYFOUR */
-
 /* Definitions for doing the crc four data bytes at a time. */
+#if !defined(NOBYFOUR) && defined(Z_U4)
+#  define BYFOUR
+#endif
 #ifdef BYFOUR
-#  define REV(w) ((((w)>>24)&0xff)+(((w)>>8)&0xff00)+ \
-                (((w)&0xff00)<<8)+(((w)&0xff)<<24))
    local unsigned long crc32_little OF((unsigned long,
                         const unsigned char FAR *, unsigned));
    local unsigned long crc32_big OF((unsigned long,
@@ -68,16 +50,16 @@
 local unsigned long gf2_matrix_times OF((unsigned long *mat,
                                          unsigned long vec));
 local void gf2_matrix_square OF((unsigned long *square, unsigned long *mat));
-local uLong crc32_combine_(uLong crc1, uLong crc2, z_off64_t len2);
+local uLong crc32_combine_ OF((uLong crc1, uLong crc2, z_off64_t len2));
 
 
 #ifdef DYNAMIC_CRC_TABLE
 
 local volatile int crc_table_empty = 1;
-local unsigned long FAR crc_table[TBLS][256];
+local z_crc_t FAR crc_table[TBLS][256];
 local void make_crc_table OF((void));
 #ifdef MAKECRCH
-   local void write_table OF((FILE *, const unsigned long FAR *));
+   local void write_table OF((FILE *, const z_crc_t FAR *));
 #endif /* MAKECRCH */
 /*
   Generate tables for a byte-wise 32-bit CRC calculation on the polynomial:
@@ -107,9 +89,9 @@
 */
 local void make_crc_table()
 {
-    unsigned long c;
+    z_crc_t c;
     int n, k;
-    unsigned long poly;                 /* polynomial exclusive-or pattern */
+    z_crc_t poly;                       /* polynomial exclusive-or pattern */
     /* terms of polynomial defining this crc (except x^32): */
     static volatile int first = 1;      /* flag to limit concurrent making */
     static const unsigned char p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26};
@@ -121,13 +103,13 @@
         first = 0;
 
         /* make exclusive-or pattern from polynomial (0xedb88320UL) */
-        poly = 0UL;
-        for (n = 0; n < sizeof(p)/sizeof(unsigned char); n++)
-            poly |= 1UL << (31 - p[n]);
+        poly = 0;
+        for (n = 0; n < (int)(sizeof(p)/sizeof(unsigned char)); n++)
+            poly |= (z_crc_t)1 << (31 - p[n]);
 
         /* generate a crc for every 8-bit value */
         for (n = 0; n < 256; n++) {
-            c = (unsigned long)n;
+            c = (z_crc_t)n;
             for (k = 0; k < 8; k++)
                 c = c & 1 ? poly ^ (c >> 1) : c >> 1;
             crc_table[0][n] = c;
@@ -138,11 +120,11 @@
            and then the byte reversal of those as well as the first table */
         for (n = 0; n < 256; n++) {
             c = crc_table[0][n];
-            crc_table[4][n] = REV(c);
+            crc_table[4][n] = ZSWAP32(c);
             for (k = 1; k < 4; k++) {
                 c = crc_table[0][c & 0xff] ^ (c >> 8);
                 crc_table[k][n] = c;
-                crc_table[k + 4][n] = REV(c);
+                crc_table[k + 4][n] = ZSWAP32(c);
             }
         }
 #endif /* BYFOUR */
@@ -164,7 +146,7 @@
         if (out == NULL) return;
         fprintf(out, "/* crc32.h -- tables for rapid CRC calculation\n");
         fprintf(out, " * Generated automatically by crc32.c\n */\n\n");
-        fprintf(out, "local const unsigned long FAR ");
+        fprintf(out, "local const z_crc_t FAR ");
         fprintf(out, "crc_table[TBLS][256] =\n{\n  {\n");
         write_table(out, crc_table[0]);
 #  ifdef BYFOUR
@@ -184,12 +166,13 @@
 #ifdef MAKECRCH
 local void write_table(out, table)
     FILE *out;
-    const unsigned long FAR *table;
+    const z_crc_t FAR *table;
 {
     int n;
 
     for (n = 0; n < 256; n++)
-        fprintf(out, "%s0x%08lxUL%s", n % 5 ? "" : "    ", table[n],
+        fprintf(out, "%s0x%08lxUL%s", n % 5 ? "" : "    ",
+                (unsigned long)(table[n]),
                 n == 255 ? "\n" : (n % 5 == 4 ? ",\n" : ", "));
 }
 #endif /* MAKECRCH */
@@ -204,13 +187,13 @@
 /* =========================================================================
  * This function can be used by asm versions of crc32()
  */
-const unsigned long FAR * ZEXPORT get_crc_table()
+const z_crc_t FAR * ZEXPORT get_crc_table()
 {
 #ifdef DYNAMIC_CRC_TABLE
     if (crc_table_empty)
         make_crc_table();
 #endif /* DYNAMIC_CRC_TABLE */
-    return (const unsigned long FAR *)crc_table;
+    return (const z_crc_t FAR *)crc_table;
 }
 
 /* ========================================================================= */
@@ -232,7 +215,7 @@
 
 #ifdef BYFOUR
     if (sizeof(void *) == sizeof(ptrdiff_t)) {
-        u4 endian;
+        z_crc_t endian;
 
         endian = 1;
         if (*((unsigned char *)(&endian)))
@@ -266,17 +249,17 @@
     const unsigned char FAR *buf;
     unsigned len;
 {
-    register u4 c;
-    register const u4 FAR *buf4;
+    register z_crc_t c;
+    register const z_crc_t FAR *buf4;
 
-    c = (u4)crc;
+    c = (z_crc_t)crc;
     c = ~c;
     while (len && ((ptrdiff_t)buf & 3)) {
         c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
         len--;
     }
 
-    buf4 = (const u4 FAR *)(const void FAR *)buf;
+    buf4 = (const z_crc_t FAR *)(const void FAR *)buf;
     while (len >= 32) {
         DOLIT32;
         len -= 32;
@@ -306,17 +289,17 @@
     const unsigned char FAR *buf;
     unsigned len;
 {
-    register u4 c;
-    register const u4 FAR *buf4;
+    register z_crc_t c;
+    register const z_crc_t FAR *buf4;
 
-    c = REV((u4)crc);
+    c = ZSWAP32((z_crc_t)crc);
     c = ~c;
     while (len && ((ptrdiff_t)buf & 3)) {
         c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
         len--;
     }
 
-    buf4 = (const u4 FAR *)(const void FAR *)buf;
+    buf4 = (const z_crc_t FAR *)(const void FAR *)buf;
     buf4--;
     while (len >= 32) {
         DOBIG32;
@@ -333,7 +316,7 @@
         c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
     } while (--len);
     c = ~c;
-    return (unsigned long)(REV(c));
+    return (unsigned long)(ZSWAP32(c));
 }
 
 #endif /* BYFOUR */
diff --git a/Modules/zlib/crc32.h b/Modules/zlib/crc32.h
index 8053b61..9e0c778 100644
--- a/Modules/zlib/crc32.h
+++ b/Modules/zlib/crc32.h
@@ -2,7 +2,7 @@
  * Generated automatically by crc32.c
  */
 
-local const unsigned long FAR crc_table[TBLS][256] =
+local const z_crc_t FAR crc_table[TBLS][256] =
 {
   {
     0x00000000UL, 0x77073096UL, 0xee0e612cUL, 0x990951baUL, 0x076dc419UL,
diff --git a/Modules/zlib/deflate.c b/Modules/zlib/deflate.c
index bcef67c..6969577 100644
--- a/Modules/zlib/deflate.c
+++ b/Modules/zlib/deflate.c
@@ -1,5 +1,5 @@
 /* deflate.c -- compress data using the deflation algorithm
- * Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler
+ * Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -37,7 +37,7 @@
  *  REFERENCES
  *
  *      Deutsch, L.P.,"DEFLATE Compressed Data Format Specification".
- *      Available in http://www.ietf.org/rfc/rfc1951.txt
+ *      Available in http://tools.ietf.org/html/rfc1951
  *
  *      A description of the Rabin and Karp algorithm is given in the book
  *         "Algorithms" by R. Sedgewick, Addison-Wesley, p252.
@@ -52,7 +52,7 @@
 #include "deflate.h"
 
 const char deflate_copyright[] =
-   " deflate 1.2.5 Copyright 1995-2010 Jean-loup Gailly and Mark Adler ";
+   " deflate 1.2.8 Copyright 1995-2013 Jean-loup Gailly and Mark Adler ";
 /*
   If you use the zlib library in a product, an acknowledgment is welcome
   in the documentation of your product. If for some reason you cannot
@@ -155,9 +155,12 @@
 struct static_tree_desc_s {int dummy;}; /* for buggy compilers */
 #endif
 
+/* rank Z_BLOCK between Z_NO_FLUSH and Z_PARTIAL_FLUSH */
+#define RANK(f) (((f) << 1) - ((f) > 4 ? 9 : 0))
+
 /* ===========================================================================
  * Update a hash value with the given input byte
- * IN  assertion: all calls to UPDATE_HASH are made with consecutive
+ * IN  assertion: all calls to to UPDATE_HASH are made with consecutive
  *    input characters, so that a running hash key can be computed from the
  *    previous key instead of complete recalculation each time.
  */
@@ -170,7 +173,7 @@
  * the previous length of the hash chain.
  * If this file is compiled with -DFASTEST, the compression level is forced
  * to 1, and no hash chains are maintained.
- * IN  assertion: all calls to INSERT_STRING are made with consecutive
+ * IN  assertion: all calls to to INSERT_STRING are made with consecutive
  *    input characters and the first MIN_MATCH bytes of str are valid
  *    (except for the last MIN_MATCH-1 bytes of the input file).
  */
@@ -235,10 +238,19 @@
 
     strm->msg = Z_NULL;
     if (strm->zalloc == (alloc_func)0) {
+#ifdef Z_SOLO
+        return Z_STREAM_ERROR;
+#else
         strm->zalloc = zcalloc;
         strm->opaque = (voidpf)0;
+#endif
     }
-    if (strm->zfree == (free_func)0) strm->zfree = zcfree;
+    if (strm->zfree == (free_func)0)
+#ifdef Z_SOLO
+        return Z_STREAM_ERROR;
+#else
+        strm->zfree = zcfree;
+#endif
 
 #ifdef FASTEST
     if (level != 0) level = 1;
@@ -293,7 +305,7 @@
     if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
         s->pending_buf == Z_NULL) {
         s->status = FINISH_STATE;
-        strm->msg = (char*)ERR_MSG(Z_MEM_ERROR);
+        strm->msg = ERR_MSG(Z_MEM_ERROR);
         deflateEnd (strm);
         return Z_MEM_ERROR;
     }
@@ -314,43 +326,70 @@
     uInt  dictLength;
 {
     deflate_state *s;
-    uInt length = dictLength;
-    uInt n;
-    IPos hash_head = 0;
+    uInt str, n;
+    int wrap;
+    unsigned avail;
+    z_const unsigned char *next;
 
-    if (strm == Z_NULL || strm->state == Z_NULL || dictionary == Z_NULL ||
-        strm->state->wrap == 2 ||
-        (strm->state->wrap == 1 && strm->state->status != INIT_STATE))
+    if (strm == Z_NULL || strm->state == Z_NULL || dictionary == Z_NULL)
+        return Z_STREAM_ERROR;
+    s = strm->state;
+    wrap = s->wrap;
+    if (wrap == 2 || (wrap == 1 && s->status != INIT_STATE) || s->lookahead)
         return Z_STREAM_ERROR;
 
-    s = strm->state;
-    if (s->wrap)
+    /* when using zlib wrappers, compute Adler-32 for provided dictionary */
+    if (wrap == 1)
         strm->adler = adler32(strm->adler, dictionary, dictLength);
+    s->wrap = 0;                    /* avoid computing Adler-32 in read_buf */
 
-    if (length < MIN_MATCH) return Z_OK;
-    if (length > s->w_size) {
-        length = s->w_size;
-        dictionary += dictLength - length; /* use the tail of the dictionary */
+    /* if dictionary would fill window, just replace the history */
+    if (dictLength >= s->w_size) {
+        if (wrap == 0) {            /* already empty otherwise */
+            CLEAR_HASH(s);
+            s->strstart = 0;
+            s->block_start = 0L;
+            s->insert = 0;
+        }
+        dictionary += dictLength - s->w_size;  /* use the tail */
+        dictLength = s->w_size;
     }
-    zmemcpy(s->window, dictionary, length);
-    s->strstart = length;
-    s->block_start = (long)length;
 
-    /* Insert all strings in the hash table (except for the last two bytes).
-     * s->lookahead stays null, so s->ins_h will be recomputed at the next
-     * call of fill_window.
-     */
-    s->ins_h = s->window[0];
-    UPDATE_HASH(s, s->ins_h, s->window[1]);
-    for (n = 0; n <= length - MIN_MATCH; n++) {
-        INSERT_STRING(s, n, hash_head);
+    /* insert dictionary into window and hash */
+    avail = strm->avail_in;
+    next = strm->next_in;
+    strm->avail_in = dictLength;
+    strm->next_in = (z_const Bytef *)dictionary;
+    fill_window(s);
+    while (s->lookahead >= MIN_MATCH) {
+        str = s->strstart;
+        n = s->lookahead - (MIN_MATCH-1);
+        do {
+            UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]);
+#ifndef FASTEST
+            s->prev[str & s->w_mask] = s->head[s->ins_h];
+#endif
+            s->head[s->ins_h] = (Pos)str;
+            str++;
+        } while (--n);
+        s->strstart = str;
+        s->lookahead = MIN_MATCH-1;
+        fill_window(s);
     }
-    if (hash_head) hash_head = 0;  /* to make compiler happy */
+    s->strstart += s->lookahead;
+    s->block_start = (long)s->strstart;
+    s->insert = s->lookahead;
+    s->lookahead = 0;
+    s->match_length = s->prev_length = MIN_MATCH-1;
+    s->match_available = 0;
+    strm->next_in = next;
+    strm->avail_in = avail;
+    s->wrap = wrap;
     return Z_OK;
 }
 
 /* ========================================================================= */
-int ZEXPORT deflateReset (strm)
+int ZEXPORT deflateResetKeep (strm)
     z_streamp strm;
 {
     deflate_state *s;
@@ -380,12 +419,23 @@
     s->last_flush = Z_NO_FLUSH;
 
     _tr_init(s);
-    lm_init(s);
 
     return Z_OK;
 }
 
 /* ========================================================================= */
+int ZEXPORT deflateReset (strm)
+    z_streamp strm;
+{
+    int ret;
+
+    ret = deflateResetKeep(strm);
+    if (ret == Z_OK)
+        lm_init(strm->state);
+    return ret;
+}
+
+/* ========================================================================= */
 int ZEXPORT deflateSetHeader (strm, head)
     z_streamp strm;
     gz_headerp head;
@@ -397,14 +447,42 @@
 }
 
 /* ========================================================================= */
+int ZEXPORT deflatePending (strm, pending, bits)
+    unsigned *pending;
+    int *bits;
+    z_streamp strm;
+{
+    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+    if (pending != Z_NULL)
+        *pending = strm->state->pending;
+    if (bits != Z_NULL)
+        *bits = strm->state->bi_valid;
+    return Z_OK;
+}
+
+/* ========================================================================= */
 int ZEXPORT deflatePrime (strm, bits, value)
     z_streamp strm;
     int bits;
     int value;
 {
+    deflate_state *s;
+    int put;
+
     if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
-    strm->state->bi_valid = bits;
-    strm->state->bi_buf = (ush)(value & ((1 << bits) - 1));
+    s = strm->state;
+    if ((Bytef *)(s->d_buf) < s->pending_out + ((Buf_size + 7) >> 3))
+        return Z_BUF_ERROR;
+    do {
+        put = Buf_size - s->bi_valid;
+        if (put > bits)
+            put = bits;
+        s->bi_buf |= (ush)((value & ((1 << put) - 1)) << s->bi_valid);
+        s->bi_valid += put;
+        _tr_flush_bits(s);
+        value >>= put;
+        bits -= put;
+    } while (bits);
     return Z_OK;
 }
 
@@ -435,6 +513,8 @@
         strm->total_in != 0) {
         /* Flush the last buffer: */
         err = deflate(strm, Z_BLOCK);
+        if (err == Z_BUF_ERROR && s->pending == 0)
+            err = Z_OK;
     }
     if (s->level != level) {
         s->level = level;
@@ -562,19 +642,22 @@
 local void flush_pending(strm)
     z_streamp strm;
 {
-    unsigned len = strm->state->pending;
+    unsigned len;
+    deflate_state *s = strm->state;
 
+    _tr_flush_bits(s);
+    len = s->pending;
     if (len > strm->avail_out) len = strm->avail_out;
     if (len == 0) return;
 
-    zmemcpy(strm->next_out, strm->state->pending_out, len);
+    zmemcpy(strm->next_out, s->pending_out, len);
     strm->next_out  += len;
-    strm->state->pending_out  += len;
+    s->pending_out  += len;
     strm->total_out += len;
     strm->avail_out  -= len;
-    strm->state->pending -= len;
-    if (strm->state->pending == 0) {
-        strm->state->pending_out = strm->state->pending_buf;
+    s->pending -= len;
+    if (s->pending == 0) {
+        s->pending_out = s->pending_buf;
     }
 }
 
@@ -801,7 +884,7 @@
      * flushes. For repeated and useless calls with Z_FINISH, we keep
      * returning Z_STREAM_END instead of Z_BUF_ERROR.
      */
-    } else if (strm->avail_in == 0 && flush <= old_flush &&
+    } else if (strm->avail_in == 0 && RANK(flush) <= RANK(old_flush) &&
                flush != Z_FINISH) {
         ERR_RETURN(strm, Z_BUF_ERROR);
     }
@@ -850,6 +933,7 @@
                     if (s->lookahead == 0) {
                         s->strstart = 0;
                         s->block_start = 0L;
+                        s->insert = 0;
                     }
                 }
             }
@@ -945,12 +1029,12 @@
 
     ss = source->state;
 
-    zmemcpy(dest, source, sizeof(z_stream));
+    zmemcpy((voidpf)dest, (voidpf)source, sizeof(z_stream));
 
     ds = (deflate_state *) ZALLOC(dest, 1, sizeof(deflate_state));
     if (ds == Z_NULL) return Z_MEM_ERROR;
     dest->state = (struct internal_state FAR *) ds;
-    zmemcpy(ds, ss, sizeof(deflate_state));
+    zmemcpy((voidpf)ds, (voidpf)ss, sizeof(deflate_state));
     ds->strm = dest;
 
     ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte));
@@ -966,8 +1050,8 @@
     }
     /* following zmemcpy do not work for 16-bit MSDOS */
     zmemcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte));
-    zmemcpy(ds->prev, ss->prev, ds->w_size * sizeof(Pos));
-    zmemcpy(ds->head, ss->head, ds->hash_size * sizeof(Pos));
+    zmemcpy((voidpf)ds->prev, (voidpf)ss->prev, ds->w_size * sizeof(Pos));
+    zmemcpy((voidpf)ds->head, (voidpf)ss->head, ds->hash_size * sizeof(Pos));
     zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size);
 
     ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf);
@@ -1001,15 +1085,15 @@
 
     strm->avail_in  -= len;
 
+    zmemcpy(buf, strm->next_in, len);
     if (strm->state->wrap == 1) {
-        strm->adler = adler32(strm->adler, strm->next_in, len);
+        strm->adler = adler32(strm->adler, buf, len);
     }
 #ifdef GZIP
     else if (strm->state->wrap == 2) {
-        strm->adler = crc32(strm->adler, strm->next_in, len);
+        strm->adler = crc32(strm->adler, buf, len);
     }
 #endif
-    zmemcpy(buf, strm->next_in, len);
     strm->next_in  += len;
     strm->total_in += len;
 
@@ -1036,6 +1120,7 @@
     s->strstart = 0;
     s->block_start = 0L;
     s->lookahead = 0;
+    s->insert = 0;
     s->match_length = s->prev_length = MIN_MATCH-1;
     s->match_available = 0;
     s->ins_h = 0;
@@ -1310,6 +1395,8 @@
     unsigned more;    /* Amount of free space at the end of the window. */
     uInt wsize = s->w_size;
 
+    Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead");
+
     do {
         more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart);
 
@@ -1362,7 +1449,7 @@
 #endif
             more += wsize;
         }
-        if (s->strm->avail_in == 0) return;
+        if (s->strm->avail_in == 0) break;
 
         /* If there was no sliding:
          *    strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&
@@ -1381,12 +1468,24 @@
         s->lookahead += n;
 
         /* Initialize the hash value now that we have some input: */
-        if (s->lookahead >= MIN_MATCH) {
-            s->ins_h = s->window[s->strstart];
-            UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]);
+        if (s->lookahead + s->insert >= MIN_MATCH) {
+            uInt str = s->strstart - s->insert;
+            s->ins_h = s->window[str];
+            UPDATE_HASH(s, s->ins_h, s->window[str + 1]);
 #if MIN_MATCH != 3
             Call UPDATE_HASH() MIN_MATCH-3 more times
 #endif
+            while (s->insert) {
+                UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]);
+#ifndef FASTEST
+                s->prev[str & s->w_mask] = s->head[s->ins_h];
+#endif
+                s->head[s->ins_h] = (Pos)str;
+                str++;
+                s->insert--;
+                if (s->lookahead + s->insert < MIN_MATCH)
+                    break;
+            }
         }
         /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,
          * but this is not important since only literal bytes will be emitted.
@@ -1427,6 +1526,9 @@
             s->high_water += init;
         }
     }
+
+    Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,
+           "not enough room for search");
 }
 
 /* ===========================================================================
@@ -1506,8 +1608,14 @@
             FLUSH_BLOCK(s, 0);
         }
     }
-    FLUSH_BLOCK(s, flush == Z_FINISH);
-    return flush == Z_FINISH ? finish_done : block_done;
+    s->insert = 0;
+    if (flush == Z_FINISH) {
+        FLUSH_BLOCK(s, 1);
+        return finish_done;
+    }
+    if ((long)s->strstart > s->block_start)
+        FLUSH_BLOCK(s, 0);
+    return block_done;
 }
 
 /* ===========================================================================
@@ -1603,8 +1711,14 @@
         }
         if (bflush) FLUSH_BLOCK(s, 0);
     }
-    FLUSH_BLOCK(s, flush == Z_FINISH);
-    return flush == Z_FINISH ? finish_done : block_done;
+    s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1;
+    if (flush == Z_FINISH) {
+        FLUSH_BLOCK(s, 1);
+        return finish_done;
+    }
+    if (s->last_lit)
+        FLUSH_BLOCK(s, 0);
+    return block_done;
 }
 
 #ifndef FASTEST
@@ -1728,8 +1842,14 @@
         _tr_tally_lit(s, s->window[s->strstart-1], bflush);
         s->match_available = 0;
     }
-    FLUSH_BLOCK(s, flush == Z_FINISH);
-    return flush == Z_FINISH ? finish_done : block_done;
+    s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1;
+    if (flush == Z_FINISH) {
+        FLUSH_BLOCK(s, 1);
+        return finish_done;
+    }
+    if (s->last_lit)
+        FLUSH_BLOCK(s, 0);
+    return block_done;
 }
 #endif /* FASTEST */
 
@@ -1749,11 +1869,11 @@
     for (;;) {
         /* Make sure that we always have enough lookahead, except
          * at the end of the input file. We need MAX_MATCH bytes
-         * for the longest encodable run.
+         * for the longest run, plus one for the unrolled loop.
          */
-        if (s->lookahead < MAX_MATCH) {
+        if (s->lookahead <= MAX_MATCH) {
             fill_window(s);
-            if (s->lookahead < MAX_MATCH && flush == Z_NO_FLUSH) {
+            if (s->lookahead <= MAX_MATCH && flush == Z_NO_FLUSH) {
                 return need_more;
             }
             if (s->lookahead == 0) break; /* flush the current block */
@@ -1776,6 +1896,7 @@
                 if (s->match_length > s->lookahead)
                     s->match_length = s->lookahead;
             }
+            Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan");
         }
 
         /* Emit match if have run of MIN_MATCH or longer, else emit literal */
@@ -1796,8 +1917,14 @@
         }
         if (bflush) FLUSH_BLOCK(s, 0);
     }
-    FLUSH_BLOCK(s, flush == Z_FINISH);
-    return flush == Z_FINISH ? finish_done : block_done;
+    s->insert = 0;
+    if (flush == Z_FINISH) {
+        FLUSH_BLOCK(s, 1);
+        return finish_done;
+    }
+    if (s->last_lit)
+        FLUSH_BLOCK(s, 0);
+    return block_done;
 }
 
 /* ===========================================================================
@@ -1829,6 +1956,12 @@
         s->strstart++;
         if (bflush) FLUSH_BLOCK(s, 0);
     }
-    FLUSH_BLOCK(s, flush == Z_FINISH);
-    return flush == Z_FINISH ? finish_done : block_done;
+    s->insert = 0;
+    if (flush == Z_FINISH) {
+        FLUSH_BLOCK(s, 1);
+        return finish_done;
+    }
+    if (s->last_lit)
+        FLUSH_BLOCK(s, 0);
+    return block_done;
 }
diff --git a/Modules/zlib/deflate.h b/Modules/zlib/deflate.h
index cbf0d1e..ce0299e 100644
--- a/Modules/zlib/deflate.h
+++ b/Modules/zlib/deflate.h
@@ -1,5 +1,5 @@
 /* deflate.h -- internal compression state
- * Copyright (C) 1995-2010 Jean-loup Gailly
+ * Copyright (C) 1995-2012 Jean-loup Gailly
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -48,6 +48,9 @@
 #define MAX_BITS 15
 /* All codes must not exceed MAX_BITS bits */
 
+#define Buf_size 16
+/* size of bit buffer in bi_buf */
+
 #define INIT_STATE    42
 #define EXTRA_STATE   69
 #define NAME_STATE    73
@@ -101,7 +104,7 @@
     int   wrap;          /* bit 0 true for zlib, bit 1 true for gzip */
     gz_headerp  gzhead;  /* gzip header information to write */
     uInt   gzindex;      /* where in extra, name, or comment */
-    Byte  method;        /* STORED (for zip only) or DEFLATED */
+    Byte  method;        /* can only be DEFLATED */
     int   last_flush;    /* value of flush param for previous deflate call */
 
                 /* used by deflate.c: */
@@ -188,7 +191,7 @@
     int nice_match; /* Stop searching when current match exceeds this */
 
                 /* used by trees.c: */
-    /* Didn't use ct_data typedef below to supress compiler warning */
+    /* Didn't use ct_data typedef below to suppress compiler warning */
     struct ct_data_s dyn_ltree[HEAP_SIZE];   /* literal and length tree */
     struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */
     struct ct_data_s bl_tree[2*BL_CODES+1];  /* Huffman tree for bit lengths */
@@ -244,7 +247,7 @@
     ulg opt_len;        /* bit length of current block with optimal trees */
     ulg static_len;     /* bit length of current block with static trees */
     uInt matches;       /* number of string matches in current block */
-    int last_eob_len;   /* bit length of EOB code for last block */
+    uInt insert;        /* bytes at end of window left to insert */
 
 #ifdef DEBUG
     ulg compressed_len; /* total bit length of compressed file mod 2^32 */
@@ -294,6 +297,7 @@
 int ZLIB_INTERNAL _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc));
 void ZLIB_INTERNAL _tr_flush_block OF((deflate_state *s, charf *buf,
                         ulg stored_len, int last));
+void ZLIB_INTERNAL _tr_flush_bits OF((deflate_state *s));
 void ZLIB_INTERNAL _tr_align OF((deflate_state *s));
 void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf,
                         ulg stored_len, int last));
diff --git a/Modules/zlib/example.c b/Modules/zlib/example.c
index 604736f..138a699 100644
--- a/Modules/zlib/example.c
+++ b/Modules/zlib/example.c
@@ -1,5 +1,5 @@
 /* example.c -- usage example of the zlib compression library
- * Copyright (C) 1995-2006 Jean-loup Gailly.
+ * Copyright (C) 1995-2006, 2011 Jean-loup Gailly.
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -26,7 +26,7 @@
     } \
 }
 
-const char hello[] = "hello, hello!";
+z_const char hello[] = "hello, hello!";
 /* "hello world" would be more standard, but the repeated "hello"
  * stresses the compression code better, sorry...
  */
@@ -34,10 +34,6 @@
 const char dictionary[] = "hello";
 uLong dictId; /* Adler32 value of the dictionary */
 
-void test_compress      OF((Byte *compr, uLong comprLen,
-                            Byte *uncompr, uLong uncomprLen));
-void test_gzio          OF((const char *fname,
-                            Byte *uncompr, uLong uncomprLen));
 void test_deflate       OF((Byte *compr, uLong comprLen));
 void test_inflate       OF((Byte *compr, uLong comprLen,
                             Byte *uncompr, uLong uncomprLen));
@@ -53,6 +49,39 @@
                             Byte *uncompr, uLong uncomprLen));
 int  main               OF((int argc, char *argv[]));
 
+
+#ifdef Z_SOLO
+
+void *myalloc OF((void *, unsigned, unsigned));
+void myfree OF((void *, void *));
+
+void *myalloc(q, n, m)
+    void *q;
+    unsigned n, m;
+{
+    q = Z_NULL;
+    return calloc(n, m);
+}
+
+void myfree(void *q, void *p)
+{
+    q = Z_NULL;
+    free(p);
+}
+
+static alloc_func zalloc = myalloc;
+static free_func zfree = myfree;
+
+#else /* !Z_SOLO */
+
+static alloc_func zalloc = (alloc_func)0;
+static free_func zfree = (free_func)0;
+
+void test_compress      OF((Byte *compr, uLong comprLen,
+                            Byte *uncompr, uLong uncomprLen));
+void test_gzio          OF((const char *fname,
+                            Byte *uncompr, uLong uncomprLen));
+
 /* ===========================================================================
  * Test compress() and uncompress()
  */
@@ -163,6 +192,8 @@
 #endif
 }
 
+#endif /* Z_SOLO */
+
 /* ===========================================================================
  * Test deflate() with small buffers
  */
@@ -174,14 +205,14 @@
     int err;
     uLong len = (uLong)strlen(hello)+1;
 
-    c_stream.zalloc = (alloc_func)0;
-    c_stream.zfree = (free_func)0;
+    c_stream.zalloc = zalloc;
+    c_stream.zfree = zfree;
     c_stream.opaque = (voidpf)0;
 
     err = deflateInit(&c_stream, Z_DEFAULT_COMPRESSION);
     CHECK_ERR(err, "deflateInit");
 
-    c_stream.next_in  = (Bytef*)hello;
+    c_stream.next_in  = (z_const unsigned char *)hello;
     c_stream.next_out = compr;
 
     while (c_stream.total_in != len && c_stream.total_out < comprLen) {
@@ -213,8 +244,8 @@
 
     strcpy((char*)uncompr, "garbage");
 
-    d_stream.zalloc = (alloc_func)0;
-    d_stream.zfree = (free_func)0;
+    d_stream.zalloc = zalloc;
+    d_stream.zfree = zfree;
     d_stream.opaque = (voidpf)0;
 
     d_stream.next_in  = compr;
@@ -252,8 +283,8 @@
     z_stream c_stream; /* compression stream */
     int err;
 
-    c_stream.zalloc = (alloc_func)0;
-    c_stream.zfree = (free_func)0;
+    c_stream.zalloc = zalloc;
+    c_stream.zfree = zfree;
     c_stream.opaque = (voidpf)0;
 
     err = deflateInit(&c_stream, Z_BEST_SPEED);
@@ -309,8 +340,8 @@
 
     strcpy((char*)uncompr, "garbage");
 
-    d_stream.zalloc = (alloc_func)0;
-    d_stream.zfree = (free_func)0;
+    d_stream.zalloc = zalloc;
+    d_stream.zfree = zfree;
     d_stream.opaque = (voidpf)0;
 
     d_stream.next_in  = compr;
@@ -349,14 +380,14 @@
     int err;
     uInt len = (uInt)strlen(hello)+1;
 
-    c_stream.zalloc = (alloc_func)0;
-    c_stream.zfree = (free_func)0;
+    c_stream.zalloc = zalloc;
+    c_stream.zfree = zfree;
     c_stream.opaque = (voidpf)0;
 
     err = deflateInit(&c_stream, Z_DEFAULT_COMPRESSION);
     CHECK_ERR(err, "deflateInit");
 
-    c_stream.next_in  = (Bytef*)hello;
+    c_stream.next_in  = (z_const unsigned char *)hello;
     c_stream.next_out = compr;
     c_stream.avail_in = 3;
     c_stream.avail_out = (uInt)*comprLen;
@@ -388,8 +419,8 @@
 
     strcpy((char*)uncompr, "garbage");
 
-    d_stream.zalloc = (alloc_func)0;
-    d_stream.zfree = (free_func)0;
+    d_stream.zalloc = zalloc;
+    d_stream.zfree = zfree;
     d_stream.opaque = (voidpf)0;
 
     d_stream.next_in  = compr;
@@ -430,22 +461,22 @@
     z_stream c_stream; /* compression stream */
     int err;
 
-    c_stream.zalloc = (alloc_func)0;
-    c_stream.zfree = (free_func)0;
+    c_stream.zalloc = zalloc;
+    c_stream.zfree = zfree;
     c_stream.opaque = (voidpf)0;
 
     err = deflateInit(&c_stream, Z_BEST_COMPRESSION);
     CHECK_ERR(err, "deflateInit");
 
     err = deflateSetDictionary(&c_stream,
-                               (const Bytef*)dictionary, sizeof(dictionary));
+                (const Bytef*)dictionary, (int)sizeof(dictionary));
     CHECK_ERR(err, "deflateSetDictionary");
 
     dictId = c_stream.adler;
     c_stream.next_out = compr;
     c_stream.avail_out = (uInt)comprLen;
 
-    c_stream.next_in = (Bytef*)hello;
+    c_stream.next_in = (z_const unsigned char *)hello;
     c_stream.avail_in = (uInt)strlen(hello)+1;
 
     err = deflate(&c_stream, Z_FINISH);
@@ -469,8 +500,8 @@
 
     strcpy((char*)uncompr, "garbage");
 
-    d_stream.zalloc = (alloc_func)0;
-    d_stream.zfree = (free_func)0;
+    d_stream.zalloc = zalloc;
+    d_stream.zfree = zfree;
     d_stream.opaque = (voidpf)0;
 
     d_stream.next_in  = compr;
@@ -491,7 +522,7 @@
                 exit(1);
             }
             err = inflateSetDictionary(&d_stream, (const Bytef*)dictionary,
-                                       sizeof(dictionary));
+                                       (int)sizeof(dictionary));
         }
         CHECK_ERR(err, "inflate with dict");
     }
@@ -540,10 +571,15 @@
         printf("out of memory\n");
         exit(1);
     }
+
+#ifdef Z_SOLO
+    argc = strlen(argv[0]);
+#else
     test_compress(compr, comprLen, uncompr, uncomprLen);
 
     test_gzio((argc > 1 ? argv[1] : TESTFILE),
               uncompr, uncomprLen);
+#endif
 
     test_deflate(compr, comprLen);
     test_inflate(compr, comprLen, uncompr, uncomprLen);
diff --git a/Modules/zlib/gzguts.h b/Modules/zlib/gzguts.h
index 0f8fb79..d87659d 100644
--- a/Modules/zlib/gzguts.h
+++ b/Modules/zlib/gzguts.h
@@ -1,5 +1,5 @@
 /* gzguts.h -- zlib internal header definitions for gz* operations
- * Copyright (C) 2004, 2005, 2010 Mark Adler
+ * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013 Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -12,7 +12,7 @@
 #  endif
 #endif
 
-#if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33) && !defined(NO_VIZ)
+#ifdef HAVE_HIDDEN
 #  define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
 #else
 #  define ZLIB_INTERNAL
@@ -27,13 +27,80 @@
 #endif
 #include <fcntl.h>
 
+#ifdef _WIN32
+#  include <stddef.h>
+#endif
+
+#if defined(__TURBOC__) || defined(_MSC_VER) || defined(_WIN32)
+#  include <io.h>
+#endif
+
+#ifdef WINAPI_FAMILY
+#  define open _open
+#  define read _read
+#  define write _write
+#  define close _close
+#endif
+
 #ifdef NO_DEFLATE       /* for compatibility with old definition */
 #  define NO_GZCOMPRESS
 #endif
 
+#if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550)
+#  ifndef HAVE_VSNPRINTF
+#    define HAVE_VSNPRINTF
+#  endif
+#endif
+
+#if defined(__CYGWIN__)
+#  ifndef HAVE_VSNPRINTF
+#    define HAVE_VSNPRINTF
+#  endif
+#endif
+
+#if defined(MSDOS) && defined(__BORLANDC__) && (BORLANDC > 0x410)
+#  ifndef HAVE_VSNPRINTF
+#    define HAVE_VSNPRINTF
+#  endif
+#endif
+
+#ifndef HAVE_VSNPRINTF
+#  ifdef MSDOS
+/* vsnprintf may exist on some MS-DOS compilers (DJGPP?),
+   but for now we just assume it doesn't. */
+#    define NO_vsnprintf
+#  endif
+#  ifdef __TURBOC__
+#    define NO_vsnprintf
+#  endif
+#  ifdef WIN32
+/* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */
+#    if !defined(vsnprintf) && !defined(NO_vsnprintf)
+#      if !defined(_MSC_VER) || ( defined(_MSC_VER) && _MSC_VER < 1500 )
+#         define vsnprintf _vsnprintf
+#      endif
+#    endif
+#  endif
+#  ifdef __SASC
+#    define NO_vsnprintf
+#  endif
+#  ifdef VMS
+#    define NO_vsnprintf
+#  endif
+#  ifdef __OS400__
+#    define NO_vsnprintf
+#  endif
+#  ifdef __MVS__
+#    define NO_vsnprintf
+#  endif
+#endif
+
+/* unlike snprintf (which is required in C99, yet still not supported by
+   Microsoft more than a decade later!), _snprintf does not guarantee null
+   termination of the result -- however this is only used in gzlib.c where
+   the result is assured to fit in the space provided */
 #ifdef _MSC_VER
-#  include <io.h>
-#  define vsnprintf _vsnprintf
+#  define snprintf _snprintf
 #endif
 
 #ifndef local
@@ -52,7 +119,7 @@
 #  include <windows.h>
 #  define zstrerror() gz_strwinerror((DWORD)GetLastError())
 #else
-#  ifdef STDC
+#  ifndef NO_STRERROR
 #    include <errno.h>
 #    define zstrerror() strerror(errno)
 #  else
@@ -68,7 +135,15 @@
     ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
 #endif
 
-/* default i/o buffer size -- double this for output when reading */
+/* default memLevel */
+#if MAX_MEM_LEVEL >= 8
+#  define DEF_MEM_LEVEL 8
+#else
+#  define DEF_MEM_LEVEL  MAX_MEM_LEVEL
+#endif
+
+/* default i/o buffer size -- double this for output when reading (this and
+   twice this must be able to fit in an unsigned type) */
 #define GZBUFSIZE 8192
 
 /* gzip modes, also provide a little integrity check on the passed structure */
@@ -84,23 +159,25 @@
 
 /* internal gzip file state data structure */
 typedef struct {
+        /* exposed contents for gzgetc() macro */
+    struct gzFile_s x;      /* "x" for exposed */
+                            /* x.have: number of bytes available at x.next */
+                            /* x.next: next output data to deliver or write */
+                            /* x.pos: current position in uncompressed data */
         /* used for both reading and writing */
     int mode;               /* see gzip modes above */
     int fd;                 /* file descriptor */
     char *path;             /* path or fd for error messages */
-    z_off64_t pos;          /* current position in uncompressed data */
     unsigned size;          /* buffer size, zero if not allocated yet */
     unsigned want;          /* requested buffer size, default is GZBUFSIZE */
     unsigned char *in;      /* input buffer */
     unsigned char *out;     /* output buffer (double-sized when reading) */
-    unsigned char *next;    /* next output data to deliver or write */
+    int direct;             /* 0 if processing gzip, 1 if transparent */
         /* just for reading */
-    unsigned have;          /* amount of output data unused at next */
-    int eof;                /* true if end of input file reached */
-    z_off64_t start;        /* where the gzip data started, for rewinding */
-    z_off64_t raw;          /* where the raw data started, for seeking */
     int how;                /* 0: get header, 1: copy, 2: decompress */
-    int direct;             /* true if last read direct, false if gzip */
+    z_off64_t start;        /* where the gzip data started, for rewinding */
+    int eof;                /* true if end of input file reached */
+    int past;               /* true if read requested past end */
         /* just for writing */
     int level;              /* compression level */
     int strategy;           /* compression strategy */
diff --git a/Modules/zlib/gzio.c b/Modules/zlib/gzio.c
deleted file mode 100644
index 7e90f49..0000000
--- a/Modules/zlib/gzio.c
+++ /dev/null
@@ -1,1026 +0,0 @@
-/* gzio.c -- IO on .gz files
- * Copyright (C) 1995-2005 Jean-loup Gailly.
- * For conditions of distribution and use, see copyright notice in zlib.h
- *
- * Compile this file with -DNO_GZCOMPRESS to avoid the compression code.
- */
-
-/* @(#) $Id$ */
-
-#include <stdio.h>
-
-#include "zutil.h"
-
-#ifdef NO_DEFLATE       /* for compatibility with old definition */
-#  define NO_GZCOMPRESS
-#endif
-
-#ifndef NO_DUMMY_DECL
-struct internal_state {int dummy;}; /* for buggy compilers */
-#endif
-
-#ifndef Z_BUFSIZE
-#  ifdef MAXSEG_64K
-#    define Z_BUFSIZE 4096 /* minimize memory usage for 16-bit DOS */
-#  else
-#    define Z_BUFSIZE 16384
-#  endif
-#endif
-#ifndef Z_PRINTF_BUFSIZE
-#  define Z_PRINTF_BUFSIZE 4096
-#endif
-
-#ifdef __MVS__
-#  pragma map (fdopen , "\174\174FDOPEN")
-   FILE *fdopen(int, const char *);
-#endif
-
-#ifndef STDC
-extern voidp  malloc OF((uInt size));
-extern void   free   OF((voidpf ptr));
-#endif
-
-#define ALLOC(size) malloc(size)
-#define TRYFREE(p) {if (p) free(p);}
-
-static int const gz_magic[2] = {0x1f, 0x8b}; /* gzip magic header */
-
-/* gzip flag byte */
-#define ASCII_FLAG   0x01 /* bit 0 set: file probably ascii text */
-#define HEAD_CRC     0x02 /* bit 1 set: header CRC present */
-#define EXTRA_FIELD  0x04 /* bit 2 set: extra field present */
-#define ORIG_NAME    0x08 /* bit 3 set: original file name present */
-#define COMMENT      0x10 /* bit 4 set: file comment present */
-#define RESERVED     0xE0 /* bits 5..7: reserved */
-
-typedef struct gz_stream {
-    z_stream stream;
-    int      z_err;   /* error code for last stream operation */
-    int      z_eof;   /* set if end of input file */
-    FILE     *file;   /* .gz file */
-    Byte     *inbuf;  /* input buffer */
-    Byte     *outbuf; /* output buffer */
-    uLong    crc;     /* crc32 of uncompressed data */
-    char     *msg;    /* error message */
-    char     *path;   /* path name for debugging only */
-    int      transparent; /* 1 if input file is not a .gz file */
-    char     mode;    /* 'w' or 'r' */
-    z_off_t  start;   /* start of compressed data in file (header skipped) */
-    z_off_t  in;      /* bytes into deflate or inflate */
-    z_off_t  out;     /* bytes out of deflate or inflate */
-    int      back;    /* one character push-back */
-    int      last;    /* true if push-back is last character */
-} gz_stream;
-
-
-local gzFile gz_open      OF((const char *path, const char *mode, int  fd));
-local int do_flush        OF((gzFile file, int flush));
-local int    get_byte     OF((gz_stream *s));
-local void   check_header OF((gz_stream *s));
-local int    destroy      OF((gz_stream *s));
-local void   putLong      OF((FILE *file, uLong x));
-local uLong  getLong      OF((gz_stream *s));
-
-/* ===========================================================================
-     Opens a gzip (.gz) file for reading or writing. The mode parameter
-   is as in fopen ("rb" or "wb"). The file is given either by file descriptor
-   or path name (if fd == -1).
-     gz_open returns NULL if the file could not be opened or if there was
-   insufficient memory to allocate the (de)compression state; errno
-   can be checked to distinguish the two cases (if errno is zero, the
-   zlib error is Z_MEM_ERROR).
-*/
-local gzFile gz_open (path, mode, fd)
-    const char *path;
-    const char *mode;
-    int  fd;
-{
-    int err;
-    int level = Z_DEFAULT_COMPRESSION; /* compression level */
-    int strategy = Z_DEFAULT_STRATEGY; /* compression strategy */
-    char *p = (char*)mode;
-    gz_stream *s;
-    char fmode[80]; /* copy of mode, without the compression level */
-    char *m = fmode;
-
-    if (!path || !mode) return Z_NULL;
-
-    s = (gz_stream *)ALLOC(sizeof(gz_stream));
-    if (!s) return Z_NULL;
-
-    s->stream.zalloc = (alloc_func)0;
-    s->stream.zfree = (free_func)0;
-    s->stream.opaque = (voidpf)0;
-    s->stream.next_in = s->inbuf = Z_NULL;
-    s->stream.next_out = s->outbuf = Z_NULL;
-    s->stream.avail_in = s->stream.avail_out = 0;
-    s->file = NULL;
-    s->z_err = Z_OK;
-    s->z_eof = 0;
-    s->in = 0;
-    s->out = 0;
-    s->back = EOF;
-    s->crc = crc32(0L, Z_NULL, 0);
-    s->msg = NULL;
-    s->transparent = 0;
-
-    s->path = (char*)ALLOC(strlen(path)+1);
-    if (s->path == NULL) {
-        return destroy(s), (gzFile)Z_NULL;
-    }
-    strcpy(s->path, path); /* do this early for debugging */
-
-    s->mode = '\0';
-    do {
-        if (*p == 'r') s->mode = 'r';
-        if (*p == 'w' || *p == 'a') s->mode = 'w';
-        if (*p >= '0' && *p <= '9') {
-            level = *p - '0';
-        } else if (*p == 'f') {
-          strategy = Z_FILTERED;
-        } else if (*p == 'h') {
-          strategy = Z_HUFFMAN_ONLY;
-        } else if (*p == 'R') {
-          strategy = Z_RLE;
-        } else {
-            *m++ = *p; /* copy the mode */
-        }
-    } while (*p++ && m != fmode + sizeof(fmode));
-    if (s->mode == '\0') return destroy(s), (gzFile)Z_NULL;
-
-    if (s->mode == 'w') {
-#ifdef NO_GZCOMPRESS
-        err = Z_STREAM_ERROR;
-#else
-        err = deflateInit2(&(s->stream), level,
-                           Z_DEFLATED, -MAX_WBITS, DEF_MEM_LEVEL, strategy);
-        /* windowBits is passed < 0 to suppress zlib header */
-
-        s->stream.next_out = s->outbuf = (Byte*)ALLOC(Z_BUFSIZE);
-#endif
-        if (err != Z_OK || s->outbuf == Z_NULL) {
-            return destroy(s), (gzFile)Z_NULL;
-        }
-    } else {
-        s->stream.next_in  = s->inbuf = (Byte*)ALLOC(Z_BUFSIZE);
-
-        err = inflateInit2(&(s->stream), -MAX_WBITS);
-        /* windowBits is passed < 0 to tell that there is no zlib header.
-         * Note that in this case inflate *requires* an extra "dummy" byte
-         * after the compressed stream in order to complete decompression and
-         * return Z_STREAM_END. Here the gzip CRC32 ensures that 4 bytes are
-         * present after the compressed stream.
-         */
-        if (err != Z_OK || s->inbuf == Z_NULL) {
-            return destroy(s), (gzFile)Z_NULL;
-        }
-    }
-    s->stream.avail_out = Z_BUFSIZE;
-
-    errno = 0;
-    s->file = fd < 0 ? F_OPEN(path, fmode) : (FILE*)fdopen(fd, fmode);
-
-    if (s->file == NULL) {
-        return destroy(s), (gzFile)Z_NULL;
-    }
-    if (s->mode == 'w') {
-        /* Write a very simple .gz header:
-         */
-        fprintf(s->file, "%c%c%c%c%c%c%c%c%c%c", gz_magic[0], gz_magic[1],
-             Z_DEFLATED, 0 /*flags*/, 0,0,0,0 /*time*/, 0 /*xflags*/, OS_CODE);
-        s->start = 10L;
-        /* We use 10L instead of ftell(s->file) to because ftell causes an
-         * fflush on some systems. This version of the library doesn't use
-         * start anyway in write mode, so this initialization is not
-         * necessary.
-         */
-    } else {
-        check_header(s); /* skip the .gz header */
-        s->start = ftell(s->file) - s->stream.avail_in;
-    }
-
-    return (gzFile)s;
-}
-
-/* ===========================================================================
-     Opens a gzip (.gz) file for reading or writing.
-*/
-gzFile ZEXPORT gzopen (path, mode)
-    const char *path;
-    const char *mode;
-{
-    return gz_open (path, mode, -1);
-}
-
-/* ===========================================================================
-     Associate a gzFile with the file descriptor fd. fd is not dup'ed here
-   to mimic the behavio(u)r of fdopen.
-*/
-gzFile ZEXPORT gzdopen (fd, mode)
-    int fd;
-    const char *mode;
-{
-    char name[46];      /* allow for up to 128-bit integers */
-
-    if (fd < 0) return (gzFile)Z_NULL;
-    sprintf(name, "<fd:%d>", fd); /* for debugging */
-
-    return gz_open (name, mode, fd);
-}
-
-/* ===========================================================================
- * Update the compression level and strategy
- */
-int ZEXPORT gzsetparams (file, level, strategy)
-    gzFile file;
-    int level;
-    int strategy;
-{
-    gz_stream *s = (gz_stream*)file;
-
-    if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR;
-
-    /* Make room to allow flushing */
-    if (s->stream.avail_out == 0) {
-
-        s->stream.next_out = s->outbuf;
-        if (fwrite(s->outbuf, 1, Z_BUFSIZE, s->file) != Z_BUFSIZE) {
-            s->z_err = Z_ERRNO;
-        }
-        s->stream.avail_out = Z_BUFSIZE;
-    }
-
-    return deflateParams (&(s->stream), level, strategy);
-}
-
-/* ===========================================================================
-     Read a byte from a gz_stream; update next_in and avail_in. Return EOF
-   for end of file.
-   IN assertion: the stream s has been sucessfully opened for reading.
-*/
-local int get_byte(s)
-    gz_stream *s;
-{
-    if (s->z_eof) return EOF;
-    if (s->stream.avail_in == 0) {
-        errno = 0;
-        s->stream.avail_in = (uInt)fread(s->inbuf, 1, Z_BUFSIZE, s->file);
-        if (s->stream.avail_in == 0) {
-            s->z_eof = 1;
-            if (ferror(s->file)) s->z_err = Z_ERRNO;
-            return EOF;
-        }
-        s->stream.next_in = s->inbuf;
-    }
-    s->stream.avail_in--;
-    return *(s->stream.next_in)++;
-}
-
-/* ===========================================================================
-      Check the gzip header of a gz_stream opened for reading. Set the stream
-    mode to transparent if the gzip magic header is not present; set s->err
-    to Z_DATA_ERROR if the magic header is present but the rest of the header
-    is incorrect.
-    IN assertion: the stream s has already been created sucessfully;
-       s->stream.avail_in is zero for the first time, but may be non-zero
-       for concatenated .gz files.
-*/
-local void check_header(s)
-    gz_stream *s;
-{
-    int method; /* method byte */
-    int flags;  /* flags byte */
-    uInt len;
-    int c;
-
-    /* Assure two bytes in the buffer so we can peek ahead -- handle case
-       where first byte of header is at the end of the buffer after the last
-       gzip segment */
-    len = s->stream.avail_in;
-    if (len < 2) {
-        if (len) s->inbuf[0] = s->stream.next_in[0];
-        errno = 0;
-        len = (uInt)fread(s->inbuf + len, 1, Z_BUFSIZE >> len, s->file);
-        if (len == 0 && ferror(s->file)) s->z_err = Z_ERRNO;
-        s->stream.avail_in += len;
-        s->stream.next_in = s->inbuf;
-        if (s->stream.avail_in < 2) {
-            s->transparent = s->stream.avail_in;
-            return;
-        }
-    }
-
-    /* Peek ahead to check the gzip magic header */
-    if (s->stream.next_in[0] != gz_magic[0] ||
-        s->stream.next_in[1] != gz_magic[1]) {
-        s->transparent = 1;
-        return;
-    }
-    s->stream.avail_in -= 2;
-    s->stream.next_in += 2;
-
-    /* Check the rest of the gzip header */
-    method = get_byte(s);
-    flags = get_byte(s);
-    if (method != Z_DEFLATED || (flags & RESERVED) != 0) {
-        s->z_err = Z_DATA_ERROR;
-        return;
-    }
-
-    /* Discard time, xflags and OS code: */
-    for (len = 0; len < 6; len++) (void)get_byte(s);
-
-    if ((flags & EXTRA_FIELD) != 0) { /* skip the extra field */
-        len  =  (uInt)get_byte(s);
-        len += ((uInt)get_byte(s))<<8;
-        /* len is garbage if EOF but the loop below will quit anyway */
-        while (len-- != 0 && get_byte(s) != EOF) ;
-    }
-    if ((flags & ORIG_NAME) != 0) { /* skip the original file name */
-        while ((c = get_byte(s)) != 0 && c != EOF) ;
-    }
-    if ((flags & COMMENT) != 0) {   /* skip the .gz file comment */
-        while ((c = get_byte(s)) != 0 && c != EOF) ;
-    }
-    if ((flags & HEAD_CRC) != 0) {  /* skip the header crc */
-        for (len = 0; len < 2; len++) (void)get_byte(s);
-    }
-    s->z_err = s->z_eof ? Z_DATA_ERROR : Z_OK;
-}
-
- /* ===========================================================================
- * Cleanup then free the given gz_stream. Return a zlib error code.
-   Try freeing in the reverse order of allocations.
- */
-local int destroy (s)
-    gz_stream *s;
-{
-    int err = Z_OK;
-
-    if (!s) return Z_STREAM_ERROR;
-
-    TRYFREE(s->msg);
-
-    if (s->stream.state != NULL) {
-        if (s->mode == 'w') {
-#ifdef NO_GZCOMPRESS
-            err = Z_STREAM_ERROR;
-#else
-            err = deflateEnd(&(s->stream));
-#endif
-        } else if (s->mode == 'r') {
-            err = inflateEnd(&(s->stream));
-        }
-    }
-    if (s->file != NULL && fclose(s->file)) {
-#ifdef ESPIPE
-        if (errno != ESPIPE) /* fclose is broken for pipes in HP/UX */
-#endif
-            err = Z_ERRNO;
-    }
-    if (s->z_err < 0) err = s->z_err;
-
-    TRYFREE(s->inbuf);
-    TRYFREE(s->outbuf);
-    TRYFREE(s->path);
-    TRYFREE(s);
-    return err;
-}
-
-/* ===========================================================================
-     Reads the given number of uncompressed bytes from the compressed file.
-   gzread returns the number of bytes actually read (0 for end of file).
-*/
-int ZEXPORT gzread (file, buf, len)
-    gzFile file;
-    voidp buf;
-    unsigned len;
-{
-    gz_stream *s = (gz_stream*)file;
-    Bytef *start = (Bytef*)buf; /* starting point for crc computation */
-    Byte  *next_out; /* == stream.next_out but not forced far (for MSDOS) */
-
-    if (s == NULL || s->mode != 'r') return Z_STREAM_ERROR;
-
-    if (s->z_err == Z_DATA_ERROR || s->z_err == Z_ERRNO) return -1;
-    if (s->z_err == Z_STREAM_END) return 0;  /* EOF */
-
-    next_out = (Byte*)buf;
-    s->stream.next_out = (Bytef*)buf;
-    s->stream.avail_out = len;
-
-    if (s->stream.avail_out && s->back != EOF) {
-        *next_out++ = s->back;
-        s->stream.next_out++;
-        s->stream.avail_out--;
-        s->back = EOF;
-        s->out++;
-        start++;
-        if (s->last) {
-            s->z_err = Z_STREAM_END;
-            return 1;
-        }
-    }
-
-    while (s->stream.avail_out != 0) {
-
-        if (s->transparent) {
-            /* Copy first the lookahead bytes: */
-            uInt n = s->stream.avail_in;
-            if (n > s->stream.avail_out) n = s->stream.avail_out;
-            if (n > 0) {
-                zmemcpy(s->stream.next_out, s->stream.next_in, n);
-                next_out += n;
-                s->stream.next_out = next_out;
-                s->stream.next_in   += n;
-                s->stream.avail_out -= n;
-                s->stream.avail_in  -= n;
-            }
-            if (s->stream.avail_out > 0) {
-                s->stream.avail_out -=
-                    (uInt)fread(next_out, 1, s->stream.avail_out, s->file);
-            }
-            len -= s->stream.avail_out;
-            s->in  += len;
-            s->out += len;
-            if (len == 0) s->z_eof = 1;
-            return (int)len;
-        }
-        if (s->stream.avail_in == 0 && !s->z_eof) {
-
-            errno = 0;
-            s->stream.avail_in = (uInt)fread(s->inbuf, 1, Z_BUFSIZE, s->file);
-            if (s->stream.avail_in == 0) {
-                s->z_eof = 1;
-                if (ferror(s->file)) {
-                    s->z_err = Z_ERRNO;
-                    break;
-                }
-            }
-            s->stream.next_in = s->inbuf;
-        }
-        s->in += s->stream.avail_in;
-        s->out += s->stream.avail_out;
-        s->z_err = inflate(&(s->stream), Z_NO_FLUSH);
-        s->in -= s->stream.avail_in;
-        s->out -= s->stream.avail_out;
-
-        if (s->z_err == Z_STREAM_END) {
-            /* Check CRC and original size */
-            s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start));
-            start = s->stream.next_out;
-
-            if (getLong(s) != s->crc) {
-                s->z_err = Z_DATA_ERROR;
-            } else {
-                (void)getLong(s);
-                /* The uncompressed length returned by above getlong() may be
-                 * different from s->out in case of concatenated .gz files.
-                 * Check for such files:
-                 */
-                check_header(s);
-                if (s->z_err == Z_OK) {
-                    inflateReset(&(s->stream));
-                    s->crc = crc32(0L, Z_NULL, 0);
-                }
-            }
-        }
-        if (s->z_err != Z_OK || s->z_eof) break;
-    }
-    s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start));
-
-    if (len == s->stream.avail_out &&
-        (s->z_err == Z_DATA_ERROR || s->z_err == Z_ERRNO))
-        return -1;
-    return (int)(len - s->stream.avail_out);
-}
-
-
-/* ===========================================================================
-      Reads one byte from the compressed file. gzgetc returns this byte
-   or -1 in case of end of file or error.
-*/
-int ZEXPORT gzgetc(file)
-    gzFile file;
-{
-    unsigned char c;
-
-    return gzread(file, &c, 1) == 1 ? c : -1;
-}
-
-
-/* ===========================================================================
-      Push one byte back onto the stream.
-*/
-int ZEXPORT gzungetc(c, file)
-    int c;
-    gzFile file;
-{
-    gz_stream *s = (gz_stream*)file;
-
-    if (s == NULL || s->mode != 'r' || c == EOF || s->back != EOF) return EOF;
-    s->back = c;
-    s->out--;
-    s->last = (s->z_err == Z_STREAM_END);
-    if (s->last) s->z_err = Z_OK;
-    s->z_eof = 0;
-    return c;
-}
-
-
-/* ===========================================================================
-      Reads bytes from the compressed file until len-1 characters are
-   read, or a newline character is read and transferred to buf, or an
-   end-of-file condition is encountered.  The string is then terminated
-   with a null character.
-      gzgets returns buf, or Z_NULL in case of error.
-
-      The current implementation is not optimized at all.
-*/
-char * ZEXPORT gzgets(file, buf, len)
-    gzFile file;
-    char *buf;
-    int len;
-{
-    char *b = buf;
-    if (buf == Z_NULL || len <= 0) return Z_NULL;
-
-    while (--len > 0 && gzread(file, buf, 1) == 1 && *buf++ != '\n') ;
-    *buf = '\0';
-    return b == buf && len > 0 ? Z_NULL : b;
-}
-
-
-#ifndef NO_GZCOMPRESS
-/* ===========================================================================
-     Writes the given number of uncompressed bytes into the compressed file.
-   gzwrite returns the number of bytes actually written (0 in case of error).
-*/
-int ZEXPORT gzwrite (file, buf, len)
-    gzFile file;
-    voidpc buf;
-    unsigned len;
-{
-    gz_stream *s = (gz_stream*)file;
-
-    if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR;
-
-    s->stream.next_in = (Bytef*)buf;
-    s->stream.avail_in = len;
-
-    while (s->stream.avail_in != 0) {
-
-        if (s->stream.avail_out == 0) {
-
-            s->stream.next_out = s->outbuf;
-            if (fwrite(s->outbuf, 1, Z_BUFSIZE, s->file) != Z_BUFSIZE) {
-                s->z_err = Z_ERRNO;
-                break;
-            }
-            s->stream.avail_out = Z_BUFSIZE;
-        }
-        s->in += s->stream.avail_in;
-        s->out += s->stream.avail_out;
-        s->z_err = deflate(&(s->stream), Z_NO_FLUSH);
-        s->in -= s->stream.avail_in;
-        s->out -= s->stream.avail_out;
-        if (s->z_err != Z_OK) break;
-    }
-    s->crc = crc32(s->crc, (const Bytef *)buf, len);
-
-    return (int)(len - s->stream.avail_in);
-}
-
-
-/* ===========================================================================
-     Converts, formats, and writes the args to the compressed file under
-   control of the format string, as in fprintf. gzprintf returns the number of
-   uncompressed bytes actually written (0 in case of error).
-*/
-#ifdef STDC
-#include <stdarg.h>
-
-int ZEXPORTVA gzprintf (gzFile file, const char *format, /* args */ ...)
-{
-    char buf[Z_PRINTF_BUFSIZE];
-    va_list va;
-    int len;
-
-    buf[sizeof(buf) - 1] = 0;
-    va_start(va, format);
-#ifdef NO_vsnprintf
-#  ifdef HAS_vsprintf_void
-    (void)vsprintf(buf, format, va);
-    va_end(va);
-    for (len = 0; len < sizeof(buf); len++)
-        if (buf[len] == 0) break;
-#  else
-    len = vsprintf(buf, format, va);
-    va_end(va);
-#  endif
-#else
-#  ifdef HAS_vsnprintf_void
-    (void)vsnprintf(buf, sizeof(buf), format, va);
-    va_end(va);
-    len = strlen(buf);
-#  else
-    len = vsnprintf(buf, sizeof(buf), format, va);
-    va_end(va);
-#  endif
-#endif
-    if (len <= 0 || len >= (int)sizeof(buf) || buf[sizeof(buf) - 1] != 0)
-        return 0;
-    return gzwrite(file, buf, (unsigned)len);
-}
-#else /* not ANSI C */
-
-int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
-                       a11, a12, a13, a14, a15, a16, a17, a18, a19, a20)
-    gzFile file;
-    const char *format;
-    int a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
-        a11, a12, a13, a14, a15, a16, a17, a18, a19, a20;
-{
-    char buf[Z_PRINTF_BUFSIZE];
-    int len;
-
-    buf[sizeof(buf) - 1] = 0;
-#ifdef NO_snprintf
-#  ifdef HAS_sprintf_void
-    sprintf(buf, format, a1, a2, a3, a4, a5, a6, a7, a8,
-            a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
-    for (len = 0; len < sizeof(buf); len++)
-        if (buf[len] == 0) break;
-#  else
-    len = sprintf(buf, format, a1, a2, a3, a4, a5, a6, a7, a8,
-                a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
-#  endif
-#else
-#  ifdef HAS_snprintf_void
-    snprintf(buf, sizeof(buf), format, a1, a2, a3, a4, a5, a6, a7, a8,
-             a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
-    len = strlen(buf);
-#  else
-    len = snprintf(buf, sizeof(buf), format, a1, a2, a3, a4, a5, a6, a7, a8,
-                 a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
-#  endif
-#endif
-    if (len <= 0 || len >= sizeof(buf) || buf[sizeof(buf) - 1] != 0)
-        return 0;
-    return gzwrite(file, buf, len);
-}
-#endif
-
-/* ===========================================================================
-      Writes c, converted to an unsigned char, into the compressed file.
-   gzputc returns the value that was written, or -1 in case of error.
-*/
-int ZEXPORT gzputc(file, c)
-    gzFile file;
-    int c;
-{
-    unsigned char cc = (unsigned char) c; /* required for big endian systems */
-
-    return gzwrite(file, &cc, 1) == 1 ? (int)cc : -1;
-}
-
-
-/* ===========================================================================
-      Writes the given null-terminated string to the compressed file, excluding
-   the terminating null character.
-      gzputs returns the number of characters written, or -1 in case of error.
-*/
-int ZEXPORT gzputs(file, s)
-    gzFile file;
-    const char *s;
-{
-    return gzwrite(file, (char*)s, (unsigned)strlen(s));
-}
-
-
-/* ===========================================================================
-     Flushes all pending output into the compressed file. The parameter
-   flush is as in the deflate() function.
-*/
-local int do_flush (file, flush)
-    gzFile file;
-    int flush;
-{
-    uInt len;
-    int done = 0;
-    gz_stream *s = (gz_stream*)file;
-
-    if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR;
-
-    s->stream.avail_in = 0; /* should be zero already anyway */
-
-    for (;;) {
-        len = Z_BUFSIZE - s->stream.avail_out;
-
-        if (len != 0) {
-            if ((uInt)fwrite(s->outbuf, 1, len, s->file) != len) {
-                s->z_err = Z_ERRNO;
-                return Z_ERRNO;
-            }
-            s->stream.next_out = s->outbuf;
-            s->stream.avail_out = Z_BUFSIZE;
-        }
-        if (done) break;
-        s->out += s->stream.avail_out;
-        s->z_err = deflate(&(s->stream), flush);
-        s->out -= s->stream.avail_out;
-
-        /* Ignore the second of two consecutive flushes: */
-        if (len == 0 && s->z_err == Z_BUF_ERROR) s->z_err = Z_OK;
-
-        /* deflate has finished flushing only when it hasn't used up
-         * all the available space in the output buffer:
-         */
-        done = (s->stream.avail_out != 0 || s->z_err == Z_STREAM_END);
-
-        if (s->z_err != Z_OK && s->z_err != Z_STREAM_END) break;
-    }
-    return  s->z_err == Z_STREAM_END ? Z_OK : s->z_err;
-}
-
-int ZEXPORT gzflush (file, flush)
-     gzFile file;
-     int flush;
-{
-    gz_stream *s = (gz_stream*)file;
-    int err = do_flush (file, flush);
-
-    if (err) return err;
-    fflush(s->file);
-    return  s->z_err == Z_STREAM_END ? Z_OK : s->z_err;
-}
-#endif /* NO_GZCOMPRESS */
-
-/* ===========================================================================
-      Sets the starting position for the next gzread or gzwrite on the given
-   compressed file. The offset represents a number of bytes in the
-      gzseek returns the resulting offset location as measured in bytes from
-   the beginning of the uncompressed stream, or -1 in case of error.
-      SEEK_END is not implemented, returns error.
-      In this version of the library, gzseek can be extremely slow.
-*/
-z_off_t ZEXPORT gzseek (file, offset, whence)
-    gzFile file;
-    z_off_t offset;
-    int whence;
-{
-    gz_stream *s = (gz_stream*)file;
-
-    if (s == NULL || whence == SEEK_END ||
-        s->z_err == Z_ERRNO || s->z_err == Z_DATA_ERROR) {
-        return -1L;
-    }
-
-    if (s->mode == 'w') {
-#ifdef NO_GZCOMPRESS
-        return -1L;
-#else
-        if (whence == SEEK_SET) {
-            offset -= s->in;
-        }
-        if (offset < 0) return -1L;
-
-        /* At this point, offset is the number of zero bytes to write. */
-        if (s->inbuf == Z_NULL) {
-            s->inbuf = (Byte*)ALLOC(Z_BUFSIZE); /* for seeking */
-            if (s->inbuf == Z_NULL) return -1L;
-            zmemzero(s->inbuf, Z_BUFSIZE);
-        }
-        while (offset > 0)  {
-            uInt size = Z_BUFSIZE;
-            if (offset < Z_BUFSIZE) size = (uInt)offset;
-
-            size = gzwrite(file, s->inbuf, size);
-            if (size == 0) return -1L;
-
-            offset -= size;
-        }
-        return s->in;
-#endif
-    }
-    /* Rest of function is for reading only */
-
-    /* compute absolute position */
-    if (whence == SEEK_CUR) {
-        offset += s->out;
-    }
-    if (offset < 0) return -1L;
-
-    if (s->transparent) {
-        /* map to fseek */
-        s->back = EOF;
-        s->stream.avail_in = 0;
-        s->stream.next_in = s->inbuf;
-        if (fseek(s->file, offset, SEEK_SET) < 0) return -1L;
-
-        s->in = s->out = offset;
-        return offset;
-    }
-
-    /* For a negative seek, rewind and use positive seek */
-    if (offset >= s->out) {
-        offset -= s->out;
-    } else if (gzrewind(file) < 0) {
-        return -1L;
-    }
-    /* offset is now the number of bytes to skip. */
-
-    if (offset != 0 && s->outbuf == Z_NULL) {
-        s->outbuf = (Byte*)ALLOC(Z_BUFSIZE);
-        if (s->outbuf == Z_NULL) return -1L;
-    }
-    if (offset && s->back != EOF) {
-        s->back = EOF;
-        s->out++;
-        offset--;
-        if (s->last) s->z_err = Z_STREAM_END;
-    }
-    while (offset > 0)  {
-        int size = Z_BUFSIZE;
-        if (offset < Z_BUFSIZE) size = (int)offset;
-
-        size = gzread(file, s->outbuf, (uInt)size);
-        if (size <= 0) return -1L;
-        offset -= size;
-    }
-    return s->out;
-}
-
-/* ===========================================================================
-     Rewinds input file.
-*/
-int ZEXPORT gzrewind (file)
-    gzFile file;
-{
-    gz_stream *s = (gz_stream*)file;
-
-    if (s == NULL || s->mode != 'r') return -1;
-
-    s->z_err = Z_OK;
-    s->z_eof = 0;
-    s->back = EOF;
-    s->stream.avail_in = 0;
-    s->stream.next_in = s->inbuf;
-    s->crc = crc32(0L, Z_NULL, 0);
-    if (!s->transparent) (void)inflateReset(&s->stream);
-    s->in = 0;
-    s->out = 0;
-    return fseek(s->file, s->start, SEEK_SET);
-}
-
-/* ===========================================================================
-     Returns the starting position for the next gzread or gzwrite on the
-   given compressed file. This position represents a number of bytes in the
-   uncompressed data stream.
-*/
-z_off_t ZEXPORT gztell (file)
-    gzFile file;
-{
-    return gzseek(file, 0L, SEEK_CUR);
-}
-
-/* ===========================================================================
-     Returns 1 when EOF has previously been detected reading the given
-   input stream, otherwise zero.
-*/
-int ZEXPORT gzeof (file)
-    gzFile file;
-{
-    gz_stream *s = (gz_stream*)file;
-
-    /* With concatenated compressed files that can have embedded
-     * crc trailers, z_eof is no longer the only/best indicator of EOF
-     * on a gz_stream. Handle end-of-stream error explicitly here.
-     */
-    if (s == NULL || s->mode != 'r') return 0;
-    if (s->z_eof) return 1;
-    return s->z_err == Z_STREAM_END;
-}
-
-/* ===========================================================================
-     Returns 1 if reading and doing so transparently, otherwise zero.
-*/
-int ZEXPORT gzdirect (file)
-    gzFile file;
-{
-    gz_stream *s = (gz_stream*)file;
-
-    if (s == NULL || s->mode != 'r') return 0;
-    return s->transparent;
-}
-
-/* ===========================================================================
-   Outputs a long in LSB order to the given file
-*/
-local void putLong (file, x)
-    FILE *file;
-    uLong x;
-{
-    int n;
-    for (n = 0; n < 4; n++) {
-        fputc((int)(x & 0xff), file);
-        x >>= 8;
-    }
-}
-
-/* ===========================================================================
-   Reads a long in LSB order from the given gz_stream. Sets z_err in case
-   of error.
-*/
-local uLong getLong (s)
-    gz_stream *s;
-{
-    uLong x = (uLong)get_byte(s);
-    int c;
-
-    x += ((uLong)get_byte(s))<<8;
-    x += ((uLong)get_byte(s))<<16;
-    c = get_byte(s);
-    if (c == EOF) s->z_err = Z_DATA_ERROR;
-    x += ((uLong)c)<<24;
-    return x;
-}
-
-/* ===========================================================================
-     Flushes all pending output if necessary, closes the compressed file
-   and deallocates all the (de)compression state.
-*/
-int ZEXPORT gzclose (file)
-    gzFile file;
-{
-    gz_stream *s = (gz_stream*)file;
-
-    if (s == NULL) return Z_STREAM_ERROR;
-
-    if (s->mode == 'w') {
-#ifdef NO_GZCOMPRESS
-        return Z_STREAM_ERROR;
-#else
-        if (do_flush (file, Z_FINISH) != Z_OK)
-            return destroy((gz_stream*)file);
-
-        putLong (s->file, s->crc);
-        putLong (s->file, (uLong)(s->in & 0xffffffff));
-#endif
-    }
-    return destroy((gz_stream*)file);
-}
-
-#ifdef STDC
-#  define zstrerror(errnum) strerror(errnum)
-#else
-#  define zstrerror(errnum) ""
-#endif
-
-/* ===========================================================================
-     Returns the error message for the last error which occurred on the
-   given compressed file. errnum is set to zlib error number. If an
-   error occurred in the file system and not in the compression library,
-   errnum is set to Z_ERRNO and the application may consult errno
-   to get the exact error code.
-*/
-const char * ZEXPORT gzerror (file, errnum)
-    gzFile file;
-    int *errnum;
-{
-    char *m;
-    gz_stream *s = (gz_stream*)file;
-
-    if (s == NULL) {
-        *errnum = Z_STREAM_ERROR;
-        return (const char*)ERR_MSG(Z_STREAM_ERROR);
-    }
-    *errnum = s->z_err;
-    if (*errnum == Z_OK) return (const char*)"";
-
-    m = (char*)(*errnum == Z_ERRNO ? zstrerror(errno) : s->stream.msg);
-
-    if (m == NULL || *m == '\0') m = (char*)ERR_MSG(s->z_err);
-
-    TRYFREE(s->msg);
-    s->msg = (char*)ALLOC(strlen(s->path) + strlen(m) + 3);
-    if (s->msg == Z_NULL) return (const char*)ERR_MSG(Z_MEM_ERROR);
-    strcpy(s->msg, s->path);
-    strcat(s->msg, ": ");
-    strcat(s->msg, m);
-    return (const char*)s->msg;
-}
-
-/* ===========================================================================
-     Clear the error and end-of-file flags, and do the same for the real file.
-*/
-void ZEXPORT gzclearerr (file)
-    gzFile file;
-{
-    gz_stream *s = (gz_stream*)file;
-
-    if (s == NULL) return;
-    if (s->z_err != Z_STREAM_END) s->z_err = Z_OK;
-    s->z_eof = 0;
-    clearerr(s->file);
-}
diff --git a/Modules/zlib/gzlib.c b/Modules/zlib/gzlib.c
index 603e60e..fae202e 100644
--- a/Modules/zlib/gzlib.c
+++ b/Modules/zlib/gzlib.c
@@ -1,19 +1,23 @@
 /* gzlib.c -- zlib functions common to reading and writing gzip files
- * Copyright (C) 2004, 2010 Mark Adler
+ * Copyright (C) 2004, 2010, 2011, 2012, 2013 Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
 #include "gzguts.h"
 
+#if defined(_WIN32) && !defined(__BORLANDC__)
+#  define LSEEK _lseeki64
+#else
 #if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
 #  define LSEEK lseek64
 #else
 #  define LSEEK lseek
 #endif
+#endif
 
 /* Local functions */
 local void gz_reset OF((gz_statep));
-local gzFile gz_open OF((const char *, int, const char *));
+local gzFile gz_open OF((const void *, int, const char *));
 
 #if defined UNDER_CE
 
@@ -71,28 +75,40 @@
 local void gz_reset(state)
     gz_statep state;
 {
+    state->x.have = 0;              /* no output data available */
     if (state->mode == GZ_READ) {   /* for reading ... */
-        state->have = 0;            /* no output data available */
         state->eof = 0;             /* not at end of file */
+        state->past = 0;            /* have not read past end yet */
         state->how = LOOK;          /* look for gzip header */
-        state->direct = 1;          /* default for empty file */
     }
     state->seek = 0;                /* no seek request pending */
     gz_error(state, Z_OK, NULL);    /* clear error */
-    state->pos = 0;                 /* no uncompressed data yet */
+    state->x.pos = 0;               /* no uncompressed data yet */
     state->strm.avail_in = 0;       /* no input data yet */
 }
 
 /* Open a gzip file either by name or file descriptor. */
 local gzFile gz_open(path, fd, mode)
-    const char *path;
+    const void *path;
     int fd;
     const char *mode;
 {
     gz_statep state;
+    size_t len;
+    int oflag;
+#ifdef O_CLOEXEC
+    int cloexec = 0;
+#endif
+#ifdef O_EXCL
+    int exclusive = 0;
+#endif
+
+    /* check input */
+    if (path == NULL)
+        return NULL;
 
     /* allocate gzFile structure to return */
-    state = malloc(sizeof(gz_state));
+    state = (gz_statep)malloc(sizeof(gz_state));
     if (state == NULL)
         return NULL;
     state->size = 0;            /* no buffers allocated yet */
@@ -103,6 +119,7 @@
     state->mode = GZ_NONE;
     state->level = Z_DEFAULT_COMPRESSION;
     state->strategy = Z_DEFAULT_STRATEGY;
+    state->direct = 0;
     while (*mode) {
         if (*mode >= '0' && *mode <= '9')
             state->level = *mode - '0';
@@ -124,6 +141,16 @@
                 return NULL;
             case 'b':       /* ignore -- will request binary anyway */
                 break;
+#ifdef O_CLOEXEC
+            case 'e':
+                cloexec = 1;
+                break;
+#endif
+#ifdef O_EXCL
+            case 'x':
+                exclusive = 1;
+                break;
+#endif
             case 'f':
                 state->strategy = Z_FILTERED;
                 break;
@@ -135,6 +162,10 @@
                 break;
             case 'F':
                 state->strategy = Z_FIXED;
+                break;
+            case 'T':
+                state->direct = 1;
+                break;
             default:        /* could consider as an error, but just ignore */
                 ;
             }
@@ -147,30 +178,71 @@
         return NULL;
     }
 
+    /* can't force transparent read */
+    if (state->mode == GZ_READ) {
+        if (state->direct) {
+            free(state);
+            return NULL;
+        }
+        state->direct = 1;      /* for empty file */
+    }
+
     /* save the path name for error messages */
-    state->path = malloc(strlen(path) + 1);
+#ifdef _WIN32
+    if (fd == -2) {
+        len = wcstombs(NULL, path, 0);
+        if (len == (size_t)-1)
+            len = 0;
+    }
+    else
+#endif
+        len = strlen((const char *)path);
+    state->path = (char *)malloc(len + 1);
     if (state->path == NULL) {
         free(state);
         return NULL;
     }
-    strcpy(state->path, path);
+#ifdef _WIN32
+    if (fd == -2)
+        if (len)
+            wcstombs(state->path, path, len + 1);
+        else
+            *(state->path) = 0;
+    else
+#endif
+#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
+        snprintf(state->path, len + 1, "%s", (const char *)path);
+#else
+        strcpy(state->path, path);
+#endif
 
-    /* open the file with the appropriate mode (or just use fd) */
-    state->fd = fd != -1 ? fd :
-        open(path,
+    /* compute the flags for open() */
+    oflag =
 #ifdef O_LARGEFILE
-            O_LARGEFILE |
+        O_LARGEFILE |
 #endif
 #ifdef O_BINARY
-            O_BINARY |
+        O_BINARY |
 #endif
-            (state->mode == GZ_READ ?
-                O_RDONLY :
-                (O_WRONLY | O_CREAT | (
-                    state->mode == GZ_WRITE ?
-                        O_TRUNC :
-                        O_APPEND))),
-            0666);
+#ifdef O_CLOEXEC
+        (cloexec ? O_CLOEXEC : 0) |
+#endif
+        (state->mode == GZ_READ ?
+         O_RDONLY :
+         (O_WRONLY | O_CREAT |
+#ifdef O_EXCL
+          (exclusive ? O_EXCL : 0) |
+#endif
+          (state->mode == GZ_WRITE ?
+           O_TRUNC :
+           O_APPEND)));
+
+    /* open the file with the appropriate flags (or just use fd) */
+    state->fd = fd > -1 ? fd : (
+#ifdef _WIN32
+        fd == -2 ? _wopen(path, oflag, 0666) :
+#endif
+        open((const char *)path, oflag, 0666));
     if (state->fd == -1) {
         free(state->path);
         free(state);
@@ -216,15 +288,29 @@
     char *path;         /* identifier for error messages */
     gzFile gz;
 
-    if (fd == -1 || (path = malloc(7 + 3 * sizeof(int))) == NULL)
+    if (fd == -1 || (path = (char *)malloc(7 + 3 * sizeof(int))) == NULL)
         return NULL;
+#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
+    snprintf(path, 7 + 3 * sizeof(int), "<fd:%d>", fd); /* for debugging */
+#else
     sprintf(path, "<fd:%d>", fd);   /* for debugging */
+#endif
     gz = gz_open(path, fd, mode);
     free(path);
     return gz;
 }
 
 /* -- see zlib.h -- */
+#ifdef _WIN32
+gzFile ZEXPORT gzopen_w(path, mode)
+    const wchar_t *path;
+    const char *mode;
+{
+    return gz_open(path, -2, mode);
+}
+#endif
+
+/* -- see zlib.h -- */
 int ZEXPORT gzbuffer(file, size)
     gzFile file;
     unsigned size;
@@ -243,8 +329,8 @@
         return -1;
 
     /* check and set requested size */
-    if (size == 0)
-        return -1;
+    if (size < 2)
+        size = 2;               /* need two bytes to check magic header */
     state->want = size;
     return 0;
 }
@@ -261,7 +347,8 @@
     state = (gz_statep)file;
 
     /* check that we're reading and that there's no error */
-    if (state->mode != GZ_READ || state->err != Z_OK)
+    if (state->mode != GZ_READ ||
+            (state->err != Z_OK && state->err != Z_BUF_ERROR))
         return -1;
 
     /* back up and start over */
@@ -289,7 +376,7 @@
         return -1;
 
     /* check that there's no error */
-    if (state->err != Z_OK)
+    if (state->err != Z_OK && state->err != Z_BUF_ERROR)
         return -1;
 
     /* can only seek from start or relative to current position */
@@ -298,31 +385,32 @@
 
     /* normalize offset to a SEEK_CUR specification */
     if (whence == SEEK_SET)
-        offset -= state->pos;
+        offset -= state->x.pos;
     else if (state->seek)
         offset += state->skip;
     state->seek = 0;
 
     /* if within raw area while reading, just go there */
     if (state->mode == GZ_READ && state->how == COPY &&
-        state->pos + offset >= state->raw) {
-        ret = LSEEK(state->fd, offset - state->have, SEEK_CUR);
+            state->x.pos + offset >= 0) {
+        ret = LSEEK(state->fd, offset - state->x.have, SEEK_CUR);
         if (ret == -1)
             return -1;
-        state->have = 0;
+        state->x.have = 0;
         state->eof = 0;
+        state->past = 0;
         state->seek = 0;
         gz_error(state, Z_OK, NULL);
         state->strm.avail_in = 0;
-        state->pos += offset;
-        return state->pos;
+        state->x.pos += offset;
+        return state->x.pos;
     }
 
     /* calculate skip amount, rewinding if needed for back seek when reading */
     if (offset < 0) {
         if (state->mode != GZ_READ)         /* writing -- can't go backwards */
             return -1;
-        offset += state->pos;
+        offset += state->x.pos;
         if (offset < 0)                     /* before start of file! */
             return -1;
         if (gzrewind(file) == -1)           /* rewind, then skip to offset */
@@ -331,11 +419,11 @@
 
     /* if reading, skip what's in output buffer (one less gzgetc() check) */
     if (state->mode == GZ_READ) {
-        n = GT_OFF(state->have) || (z_off64_t)state->have > offset ?
-            (unsigned)offset : state->have;
-        state->have -= n;
-        state->next += n;
-        state->pos += n;
+        n = GT_OFF(state->x.have) || (z_off64_t)state->x.have > offset ?
+            (unsigned)offset : state->x.have;
+        state->x.have -= n;
+        state->x.next += n;
+        state->x.pos += n;
         offset -= n;
     }
 
@@ -344,7 +432,7 @@
         state->seek = 1;
         state->skip = offset;
     }
-    return state->pos + offset;
+    return state->x.pos + offset;
 }
 
 /* -- see zlib.h -- */
@@ -373,7 +461,7 @@
         return -1;
 
     /* return position */
-    return state->pos + (state->seek ? state->skip : 0);
+    return state->x.pos + (state->seek ? state->skip : 0);
 }
 
 /* -- see zlib.h -- */
@@ -433,8 +521,7 @@
         return 0;
 
     /* return end-of-file state */
-    return state->mode == GZ_READ ?
-        (state->eof && state->strm.avail_in == 0 && state->have == 0) : 0;
+    return state->mode == GZ_READ ? state->past : 0;
 }
 
 /* -- see zlib.h -- */
@@ -454,7 +541,8 @@
     /* return error information */
     if (errnum != NULL)
         *errnum = state->err;
-    return state->msg == NULL ? "" : state->msg;
+    return state->err == Z_MEM_ERROR ? "out of memory" :
+                                       (state->msg == NULL ? "" : state->msg);
 }
 
 /* -- see zlib.h -- */
@@ -471,8 +559,10 @@
         return;
 
     /* clear error and end-of-file */
-    if (state->mode == GZ_READ)
+    if (state->mode == GZ_READ) {
         state->eof = 0;
+        state->past = 0;
+    }
     gz_error(state, Z_OK, NULL);
 }
 
@@ -494,26 +584,33 @@
         state->msg = NULL;
     }
 
+    /* if fatal, set state->x.have to 0 so that the gzgetc() macro fails */
+    if (err != Z_OK && err != Z_BUF_ERROR)
+        state->x.have = 0;
+
     /* set error code, and if no message, then done */
     state->err = err;
     if (msg == NULL)
         return;
 
-    /* for an out of memory error, save as static string */
-    if (err == Z_MEM_ERROR) {
-        state->msg = (char *)msg;
+    /* for an out of memory error, return literal string when requested */
+    if (err == Z_MEM_ERROR)
         return;
-    }
 
     /* construct error message with path */
-    if ((state->msg = malloc(strlen(state->path) + strlen(msg) + 3)) == NULL) {
+    if ((state->msg = (char *)malloc(strlen(state->path) + strlen(msg) + 3)) ==
+            NULL) {
         state->err = Z_MEM_ERROR;
-        state->msg = (char *)"out of memory";
         return;
     }
+#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
+    snprintf(state->msg, strlen(state->path) + strlen(msg) + 3,
+             "%s%s%s", state->path, ": ", msg);
+#else
     strcpy(state->msg, state->path);
     strcat(state->msg, ": ");
     strcat(state->msg, msg);
+#endif
     return;
 }
 
diff --git a/Modules/zlib/gzread.c b/Modules/zlib/gzread.c
index 548201a..bf4538e 100644
--- a/Modules/zlib/gzread.c
+++ b/Modules/zlib/gzread.c
@@ -1,5 +1,5 @@
 /* gzread.c -- zlib functions for reading gzip files
- * Copyright (C) 2004, 2005, 2010 Mark Adler
+ * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013 Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -8,10 +8,9 @@
 /* Local functions */
 local int gz_load OF((gz_statep, unsigned char *, unsigned, unsigned *));
 local int gz_avail OF((gz_statep));
-local int gz_next4 OF((gz_statep, unsigned long *));
-local int gz_head OF((gz_statep));
+local int gz_look OF((gz_statep));
 local int gz_decomp OF((gz_statep));
-local int gz_make OF((gz_statep));
+local int gz_fetch OF((gz_statep));
 local int gz_skip OF((gz_statep, z_off64_t));
 
 /* Use read() to load a buffer -- return -1 on error, otherwise 0.  Read from
@@ -46,73 +45,54 @@
    error, 0 otherwise.  Note that the eof flag is set when the end of the input
    file is reached, even though there may be unused data in the buffer.  Once
    that data has been used, no more attempts will be made to read the file.
-   gz_avail() assumes that strm->avail_in == 0. */
+   If strm->avail_in != 0, then the current data is moved to the beginning of
+   the input buffer, and then the remainder of the buffer is loaded with the
+   available data from the input file. */
 local int gz_avail(state)
     gz_statep state;
 {
+    unsigned got;
     z_streamp strm = &(state->strm);
 
-    if (state->err != Z_OK)
+    if (state->err != Z_OK && state->err != Z_BUF_ERROR)
         return -1;
     if (state->eof == 0) {
-        if (gz_load(state, state->in, state->size,
-                (unsigned *)&(strm->avail_in)) == -1)
+        if (strm->avail_in) {       /* copy what's there to the start */
+            unsigned char *p = state->in;
+            unsigned const char *q = strm->next_in;
+            unsigned n = strm->avail_in;
+            do {
+                *p++ = *q++;
+            } while (--n);
+        }
+        if (gz_load(state, state->in + strm->avail_in,
+                    state->size - strm->avail_in, &got) == -1)
             return -1;
+        strm->avail_in += got;
         strm->next_in = state->in;
     }
     return 0;
 }
 
-/* Get next byte from input, or -1 if end or error. */
-#define NEXT() ((strm->avail_in == 0 && gz_avail(state) == -1) ? -1 : \
-                (strm->avail_in == 0 ? -1 : \
-                 (strm->avail_in--, *(strm->next_in)++)))
-
-/* Get a four-byte little-endian integer and return 0 on success and the value
-   in *ret.  Otherwise -1 is returned and *ret is not modified. */
-local int gz_next4(state, ret)
-    gz_statep state;
-    unsigned long *ret;
-{
-    int ch;
-    unsigned long val;
-    z_streamp strm = &(state->strm);
-
-    val = NEXT();
-    val += (unsigned)NEXT() << 8;
-    val += (unsigned long)NEXT() << 16;
-    ch = NEXT();
-    if (ch == -1)
-        return -1;
-    val += (unsigned long)ch << 24;
-    *ret = val;
-    return 0;
-}
-
-/* Look for gzip header, set up for inflate or copy.  state->have must be zero.
+/* Look for gzip header, set up for inflate or copy.  state->x.have must be 0.
    If this is the first time in, allocate required memory.  state->how will be
    left unchanged if there is no more input data available, will be set to COPY
    if there is no gzip header and direct copying will be performed, or it will
-   be set to GZIP for decompression, and the gzip header will be skipped so
-   that the next available input data is the raw deflate stream.  If direct
-   copying, then leftover input data from the input buffer will be copied to
-   the output buffer.  In that case, all further file reads will be directly to
-   either the output buffer or a user buffer.  If decompressing, the inflate
-   state and the check value will be initialized.  gz_head() will return 0 on
-   success or -1 on failure.  Failures may include read errors or gzip header
-   errors.  */
-local int gz_head(state)
+   be set to GZIP for decompression.  If direct copying, then leftover input
+   data from the input buffer will be copied to the output buffer.  In that
+   case, all further file reads will be directly to either the output buffer or
+   a user buffer.  If decompressing, the inflate state will be initialized.
+   gz_look() will return 0 on success or -1 on failure. */
+local int gz_look(state)
     gz_statep state;
 {
     z_streamp strm = &(state->strm);
-    int flags;
-    unsigned len;
 
     /* allocate read buffers and inflate memory */
     if (state->size == 0) {
         /* allocate buffers */
-        state->in = malloc(state->want);
-        state->out = malloc(state->want << 1);
+        state->in = (unsigned char *)malloc(state->want);
+        state->out = (unsigned char *)malloc(state->want << 1);
         if (state->in == NULL || state->out == NULL) {
             if (state->out != NULL)
                 free(state->out);
@@ -129,7 +109,7 @@
         state->strm.opaque = Z_NULL;
         state->strm.avail_in = 0;
         state->strm.next_in = Z_NULL;
-        if (inflateInit2(&(state->strm), -15) != Z_OK) {    /* raw inflate */
+        if (inflateInit2(&(state->strm), 15 + 16) != Z_OK) {    /* gunzip */
             free(state->out);
             free(state->in);
             state->size = 0;
@@ -138,83 +118,45 @@
         }
     }
 
-    /* get some data in the input buffer */
-    if (strm->avail_in == 0) {
+    /* get at least the magic bytes in the input buffer */
+    if (strm->avail_in < 2) {
         if (gz_avail(state) == -1)
             return -1;
         if (strm->avail_in == 0)
             return 0;
     }
 
-    /* look for the gzip magic header bytes 31 and 139 */
-    if (strm->next_in[0] == 31) {
-        strm->avail_in--;
-        strm->next_in++;
-        if (strm->avail_in == 0 && gz_avail(state) == -1)
-            return -1;
-        if (strm->avail_in && strm->next_in[0] == 139) {
-            /* we have a gzip header, woo hoo! */
-            strm->avail_in--;
-            strm->next_in++;
-
-            /* skip rest of header */
-            if (NEXT() != 8) {      /* compression method */
-                gz_error(state, Z_DATA_ERROR, "unknown compression method");
-                return -1;
-            }
-            flags = NEXT();
-            if (flags & 0xe0) {     /* reserved flag bits */
-                gz_error(state, Z_DATA_ERROR, "unknown header flags set");
-                return -1;
-            }
-            NEXT();                 /* modification time */
-            NEXT();
-            NEXT();
-            NEXT();
-            NEXT();                 /* extra flags */
-            NEXT();                 /* operating system */
-            if (flags & 4) {        /* extra field */
-                len = (unsigned)NEXT();
-                len += (unsigned)NEXT() << 8;
-                while (len--)
-                    if (NEXT() < 0)
-                        break;
-            }
-            if (flags & 8)          /* file name */
-                while (NEXT() > 0)
-                    ;
-            if (flags & 16)         /* comment */
-                while (NEXT() > 0)
-                    ;
-            if (flags & 2) {        /* header crc */
-                NEXT();
-                NEXT();
-            }
-            /* an unexpected end of file is not checked for here -- it will be
-               noticed on the first request for uncompressed data */
-
-            /* set up for decompression */
-            inflateReset(strm);
-            strm->adler = crc32(0L, Z_NULL, 0);
-            state->how = GZIP;
-            state->direct = 0;
-            return 0;
-        }
-        else {
-            /* not a gzip file -- save first byte (31) and fall to raw i/o */
-            state->out[0] = 31;
-            state->have = 1;
-        }
+    /* look for gzip magic bytes -- if there, do gzip decoding (note: there is
+       a logical dilemma here when considering the case of a partially written
+       gzip file, to wit, if a single 31 byte is written, then we cannot tell
+       whether this is a single-byte file, or just a partially written gzip
+       file -- for here we assume that if a gzip file is being written, then
+       the header will be written in a single operation, so that reading a
+       single byte is sufficient indication that it is not a gzip file) */
+    if (strm->avail_in > 1 &&
+            strm->next_in[0] == 31 && strm->next_in[1] == 139) {
+        inflateReset(strm);
+        state->how = GZIP;
+        state->direct = 0;
+        return 0;
     }
 
-    /* doing raw i/o, save start of raw data for seeking, copy any leftover
-       input to output -- this assumes that the output buffer is larger than
-       the input buffer, which also assures space for gzungetc() */
-    state->raw = state->pos;
-    state->next = state->out;
+    /* no gzip header -- if we were decoding gzip before, then this is trailing
+       garbage.  Ignore the trailing garbage and finish. */
+    if (state->direct == 0) {
+        strm->avail_in = 0;
+        state->eof = 1;
+        state->x.have = 0;
+        return 0;
+    }
+
+    /* doing raw i/o, copy any leftover input to output -- this assumes that
+       the output buffer is larger than the input buffer, which also assures
+       space for gzungetc() */
+    state->x.next = state->out;
     if (strm->avail_in) {
-        memcpy(state->next + state->have, strm->next_in, strm->avail_in);
-        state->have += strm->avail_in;
+        memcpy(state->x.next, strm->next_in, strm->avail_in);
+        state->x.have = strm->avail_in;
         strm->avail_in = 0;
     }
     state->how = COPY;
@@ -223,19 +165,15 @@
 }
 
 /* Decompress from input to the provided next_out and avail_out in the state.
-   If the end of the compressed data is reached, then verify the gzip trailer
-   check value and length (modulo 2^32).  state->have and state->next are set
-   to point to the just decompressed data, and the crc is updated.  If the
-   trailer is verified, state->how is reset to LOOK to look for the next gzip
-   stream or raw data, once state->have is depleted.  Returns 0 on success, -1
-   on failure.  Failures may include invalid compressed data or a failed gzip
-   trailer verification. */
+   On return, state->x.have and state->x.next point to the just decompressed
+   data.  If the gzip stream completes, state->how is reset to LOOK to look for
+   the next gzip stream or raw data, once state->x.have is depleted.  Returns 0
+   on success, -1 on failure. */
 local int gz_decomp(state)
     gz_statep state;
 {
-    int ret;
+    int ret = Z_OK;
     unsigned had;
-    unsigned long crc, len;
     z_streamp strm = &(state->strm);
 
     /* fill output buffer up to end of deflate stream */
@@ -245,15 +183,15 @@
         if (strm->avail_in == 0 && gz_avail(state) == -1)
             return -1;
         if (strm->avail_in == 0) {
-            gz_error(state, Z_DATA_ERROR, "unexpected end of file");
-            return -1;
+            gz_error(state, Z_BUF_ERROR, "unexpected end of file");
+            break;
         }
 
         /* decompress and handle errors */
         ret = inflate(strm, Z_NO_FLUSH);
         if (ret == Z_STREAM_ERROR || ret == Z_NEED_DICT) {
             gz_error(state, Z_STREAM_ERROR,
-                      "internal error: inflate stream corrupt");
+                     "internal error: inflate stream corrupt");
             return -1;
         }
         if (ret == Z_MEM_ERROR) {
@@ -262,67 +200,55 @@
         }
         if (ret == Z_DATA_ERROR) {              /* deflate stream invalid */
             gz_error(state, Z_DATA_ERROR,
-                      strm->msg == NULL ? "compressed data error" : strm->msg);
+                     strm->msg == NULL ? "compressed data error" : strm->msg);
             return -1;
         }
     } while (strm->avail_out && ret != Z_STREAM_END);
 
-    /* update available output and crc check value */
-    state->have = had - strm->avail_out;
-    state->next = strm->next_out - state->have;
-    strm->adler = crc32(strm->adler, state->next, state->have);
+    /* update available output */
+    state->x.have = had - strm->avail_out;
+    state->x.next = strm->next_out - state->x.have;
 
-    /* check gzip trailer if at end of deflate stream */
-    if (ret == Z_STREAM_END) {
-        if (gz_next4(state, &crc) == -1 || gz_next4(state, &len) == -1) {
-            gz_error(state, Z_DATA_ERROR, "unexpected end of file");
-            return -1;
-        }
-        if (crc != strm->adler) {
-            gz_error(state, Z_DATA_ERROR, "incorrect data check");
-            return -1;
-        }
-        if (len != (strm->total_out & 0xffffffffL)) {
-            gz_error(state, Z_DATA_ERROR, "incorrect length check");
-            return -1;
-        }
-        state->how = LOOK;      /* ready for next stream, once have is 0 (leave
-                                   state->direct unchanged to remember how) */
-    }
+    /* if the gzip stream completed successfully, look for another */
+    if (ret == Z_STREAM_END)
+        state->how = LOOK;
 
     /* good decompression */
     return 0;
 }
 
-/* Make data and put in the output buffer.  Assumes that state->have == 0.
+/* Fetch data and put it in the output buffer.  Assumes state->x.have is 0.
    Data is either copied from the input file or decompressed from the input
    file depending on state->how.  If state->how is LOOK, then a gzip header is
-   looked for (and skipped if found) to determine wither to copy or decompress.
-   Returns -1 on error, otherwise 0.  gz_make() will leave state->have as COPY
-   or GZIP unless the end of the input file has been reached and all data has
-   been processed.  */
-local int gz_make(state)
+   looked for to determine whether to copy or decompress.  Returns -1 on error,
+   otherwise 0.  gz_fetch() will leave state->how as COPY or GZIP unless the
+   end of the input file has been reached and all data has been processed.  */
+local int gz_fetch(state)
     gz_statep state;
 {
     z_streamp strm = &(state->strm);
 
-    if (state->how == LOOK) {           /* look for gzip header */
-        if (gz_head(state) == -1)
-            return -1;
-        if (state->have)                /* got some data from gz_head() */
+    do {
+        switch(state->how) {
+        case LOOK:      /* -> LOOK, COPY (only if never GZIP), or GZIP */
+            if (gz_look(state) == -1)
+                return -1;
+            if (state->how == LOOK)
+                return 0;
+            break;
+        case COPY:      /* -> COPY */
+            if (gz_load(state, state->out, state->size << 1, &(state->x.have))
+                    == -1)
+                return -1;
+            state->x.next = state->out;
             return 0;
-    }
-    if (state->how == COPY) {           /* straight copy */
-        if (gz_load(state, state->out, state->size << 1, &(state->have)) == -1)
-            return -1;
-        state->next = state->out;
-    }
-    else if (state->how == GZIP) {      /* decompress */
-        strm->avail_out = state->size << 1;
-        strm->next_out = state->out;
-        if (gz_decomp(state) == -1)
-            return -1;
-    }
+        case GZIP:      /* -> GZIP or LOOK (if end of gzip stream) */
+            strm->avail_out = state->size << 1;
+            strm->next_out = state->out;
+            if (gz_decomp(state) == -1)
+                return -1;
+        }
+    } while (state->x.have == 0 && (!state->eof || strm->avail_in));
     return 0;
 }
 
@@ -336,12 +262,12 @@
     /* skip over len bytes or reach end-of-file, whichever comes first */
     while (len)
         /* skip over whatever is in output buffer */
-        if (state->have) {
-            n = GT_OFF(state->have) || (z_off64_t)state->have > len ?
-                (unsigned)len : state->have;
-            state->have -= n;
-            state->next += n;
-            state->pos += n;
+        if (state->x.have) {
+            n = GT_OFF(state->x.have) || (z_off64_t)state->x.have > len ?
+                (unsigned)len : state->x.have;
+            state->x.have -= n;
+            state->x.next += n;
+            state->x.pos += n;
             len -= n;
         }
 
@@ -352,7 +278,7 @@
         /* need more data to skip -- load up output buffer */
         else {
             /* get more output, looking for header if required */
-            if (gz_make(state) == -1)
+            if (gz_fetch(state) == -1)
                 return -1;
         }
     return 0;
@@ -374,14 +300,15 @@
     state = (gz_statep)file;
     strm = &(state->strm);
 
-    /* check that we're reading and that there's no error */
-    if (state->mode != GZ_READ || state->err != Z_OK)
+    /* check that we're reading and that there's no (serious) error */
+    if (state->mode != GZ_READ ||
+            (state->err != Z_OK && state->err != Z_BUF_ERROR))
         return -1;
 
     /* since an int is returned, make sure len fits in one, otherwise return
        with an error (this avoids the flaw in the interface) */
     if ((int)len < 0) {
-        gz_error(state, Z_BUF_ERROR, "requested length does not fit in int");
+        gz_error(state, Z_DATA_ERROR, "requested length does not fit in int");
         return -1;
     }
 
@@ -400,49 +327,51 @@
     got = 0;
     do {
         /* first just try copying data from the output buffer */
-        if (state->have) {
-            n = state->have > len ? len : state->have;
-            memcpy(buf, state->next, n);
-            state->next += n;
-            state->have -= n;
+        if (state->x.have) {
+            n = state->x.have > len ? len : state->x.have;
+            memcpy(buf, state->x.next, n);
+            state->x.next += n;
+            state->x.have -= n;
         }
 
         /* output buffer empty -- return if we're at the end of the input */
-        else if (state->eof && strm->avail_in == 0)
+        else if (state->eof && strm->avail_in == 0) {
+            state->past = 1;        /* tried to read past end */
             break;
+        }
 
         /* need output data -- for small len or new stream load up our output
            buffer */
         else if (state->how == LOOK || len < (state->size << 1)) {
             /* get more output, looking for header if required */
-            if (gz_make(state) == -1)
+            if (gz_fetch(state) == -1)
                 return -1;
-            continue;       /* no progress yet -- go back to memcpy() above */
+            continue;       /* no progress yet -- go back to copy above */
             /* the copy above assures that we will leave with space in the
                output buffer, allowing at least one gzungetc() to succeed */
         }
 
         /* large len -- read directly into user buffer */
         else if (state->how == COPY) {      /* read directly */
-            if (gz_load(state, buf, len, &n) == -1)
+            if (gz_load(state, (unsigned char *)buf, len, &n) == -1)
                 return -1;
         }
 
         /* large len -- decompress directly into user buffer */
         else {  /* state->how == GZIP */
             strm->avail_out = len;
-            strm->next_out = buf;
+            strm->next_out = (unsigned char *)buf;
             if (gz_decomp(state) == -1)
                 return -1;
-            n = state->have;
-            state->have = 0;
+            n = state->x.have;
+            state->x.have = 0;
         }
 
         /* update progress */
         len -= n;
         buf = (char *)buf + n;
         got += n;
-        state->pos += n;
+        state->x.pos += n;
     } while (len);
 
     /* return number of bytes read into user buffer (will fit in int) */
@@ -450,6 +379,11 @@
 }
 
 /* -- see zlib.h -- */
+#ifdef Z_PREFIX_SET
+#  undef z_gzgetc
+#else
+#  undef gzgetc
+#endif
 int ZEXPORT gzgetc(file)
     gzFile file;
 {
@@ -462,15 +396,16 @@
         return -1;
     state = (gz_statep)file;
 
-    /* check that we're reading and that there's no error */
-    if (state->mode != GZ_READ || state->err != Z_OK)
+    /* check that we're reading and that there's no (serious) error */
+    if (state->mode != GZ_READ ||
+        (state->err != Z_OK && state->err != Z_BUF_ERROR))
         return -1;
 
     /* try output buffer (no need to check for skip request) */
-    if (state->have) {
-        state->have--;
-        state->pos++;
-        return *(state->next)++;
+    if (state->x.have) {
+        state->x.have--;
+        state->x.pos++;
+        return *(state->x.next)++;
     }
 
     /* nothing there -- try gzread() */
@@ -478,6 +413,12 @@
     return ret < 1 ? -1 : buf[0];
 }
 
+int ZEXPORT gzgetc_(file)
+gzFile file;
+{
+    return gzgetc(file);
+}
+
 /* -- see zlib.h -- */
 int ZEXPORT gzungetc(c, file)
     int c;
@@ -490,8 +431,9 @@
         return -1;
     state = (gz_statep)file;
 
-    /* check that we're reading and that there's no error */
-    if (state->mode != GZ_READ || state->err != Z_OK)
+    /* check that we're reading and that there's no (serious) error */
+    if (state->mode != GZ_READ ||
+        (state->err != Z_OK && state->err != Z_BUF_ERROR))
         return -1;
 
     /* process a skip request */
@@ -506,32 +448,34 @@
         return -1;
 
     /* if output buffer empty, put byte at end (allows more pushing) */
-    if (state->have == 0) {
-        state->have = 1;
-        state->next = state->out + (state->size << 1) - 1;
-        state->next[0] = c;
-        state->pos--;
+    if (state->x.have == 0) {
+        state->x.have = 1;
+        state->x.next = state->out + (state->size << 1) - 1;
+        state->x.next[0] = c;
+        state->x.pos--;
+        state->past = 0;
         return c;
     }
 
     /* if no room, give up (must have already done a gzungetc()) */
-    if (state->have == (state->size << 1)) {
-        gz_error(state, Z_BUF_ERROR, "out of room to push characters");
+    if (state->x.have == (state->size << 1)) {
+        gz_error(state, Z_DATA_ERROR, "out of room to push characters");
         return -1;
     }
 
     /* slide output data if needed and insert byte before existing data */
-    if (state->next == state->out) {
-        unsigned char *src = state->out + state->have;
+    if (state->x.next == state->out) {
+        unsigned char *src = state->out + state->x.have;
         unsigned char *dest = state->out + (state->size << 1);
         while (src > state->out)
             *--dest = *--src;
-        state->next = dest;
+        state->x.next = dest;
     }
-    state->have++;
-    state->next--;
-    state->next[0] = c;
-    state->pos--;
+    state->x.have++;
+    state->x.next--;
+    state->x.next[0] = c;
+    state->x.pos--;
+    state->past = 0;
     return c;
 }
 
@@ -551,8 +495,9 @@
         return NULL;
     state = (gz_statep)file;
 
-    /* check that we're reading and that there's no error */
-    if (state->mode != GZ_READ || state->err != Z_OK)
+    /* check that we're reading and that there's no (serious) error */
+    if (state->mode != GZ_READ ||
+        (state->err != Z_OK && state->err != Z_BUF_ERROR))
         return NULL;
 
     /* process a skip request */
@@ -569,32 +514,31 @@
     left = (unsigned)len - 1;
     if (left) do {
         /* assure that something is in the output buffer */
-        if (state->have == 0) {
-            if (gz_make(state) == -1)
-                return NULL;            /* error */
-            if (state->have == 0) {     /* end of file */
-                if (buf == str)         /* got bupkus */
-                    return NULL;
-                break;                  /* got something -- return it */
-            }
+        if (state->x.have == 0 && gz_fetch(state) == -1)
+            return NULL;                /* error */
+        if (state->x.have == 0) {       /* end of file */
+            state->past = 1;            /* read past end */
+            break;                      /* return what we have */
         }
 
         /* look for end-of-line in current output buffer */
-        n = state->have > left ? left : state->have;
-        eol = memchr(state->next, '\n', n);
+        n = state->x.have > left ? left : state->x.have;
+        eol = (unsigned char *)memchr(state->x.next, '\n', n);
         if (eol != NULL)
-            n = (unsigned)(eol - state->next) + 1;
+            n = (unsigned)(eol - state->x.next) + 1;
 
         /* copy through end-of-line, or remainder if not found */
-        memcpy(buf, state->next, n);
-        state->have -= n;
-        state->next += n;
-        state->pos += n;
+        memcpy(buf, state->x.next, n);
+        state->x.have -= n;
+        state->x.next += n;
+        state->x.pos += n;
         left -= n;
         buf += n;
     } while (left && eol == NULL);
 
-    /* found end-of-line or out of space -- terminate string and return it */
+    /* return terminated string, or if nothing, end of file */
+    if (buf == str)
+        return NULL;
     buf[0] = 0;
     return str;
 }
@@ -610,16 +554,12 @@
         return 0;
     state = (gz_statep)file;
 
-    /* check that we're reading */
-    if (state->mode != GZ_READ)
-        return 0;
-
     /* if the state is not known, but we can find out, then do so (this is
        mainly for right after a gzopen() or gzdopen()) */
-    if (state->how == LOOK && state->have == 0)
-        (void)gz_head(state);
+    if (state->mode == GZ_READ && state->how == LOOK && state->x.have == 0)
+        (void)gz_look(state);
 
-    /* return 1 if reading direct, 0 if decompressing a gzip stream */
+    /* return 1 if transparent, 0 if processing a gzip stream */
     return state->direct;
 }
 
@@ -627,7 +567,7 @@
 int ZEXPORT gzclose_r(file)
     gzFile file;
 {
-    int ret;
+    int ret, err;
     gz_statep state;
 
     /* get internal structure */
@@ -645,9 +585,10 @@
         free(state->out);
         free(state->in);
     }
+    err = state->err == Z_BUF_ERROR ? Z_BUF_ERROR : Z_OK;
     gz_error(state, Z_OK, NULL);
     free(state->path);
     ret = close(state->fd);
     free(state);
-    return ret ? Z_ERRNO : Z_OK;
+    return ret ? Z_ERRNO : err;
 }
diff --git a/Modules/zlib/gzwrite.c b/Modules/zlib/gzwrite.c
index e8defc6..aa767fb 100644
--- a/Modules/zlib/gzwrite.c
+++ b/Modules/zlib/gzwrite.c
@@ -1,5 +1,5 @@
 /* gzwrite.c -- zlib functions for writing gzip files
- * Copyright (C) 2004, 2005, 2010 Mark Adler
+ * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013 Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -18,44 +18,55 @@
     int ret;
     z_streamp strm = &(state->strm);
 
-    /* allocate input and output buffers */
-    state->in = malloc(state->want);
-    state->out = malloc(state->want);
-    if (state->in == NULL || state->out == NULL) {
-        if (state->out != NULL)
-            free(state->out);
-        if (state->in != NULL)
-            free(state->in);
+    /* allocate input buffer */
+    state->in = (unsigned char *)malloc(state->want);
+    if (state->in == NULL) {
         gz_error(state, Z_MEM_ERROR, "out of memory");
         return -1;
     }
 
-    /* allocate deflate memory, set up for gzip compression */
-    strm->zalloc = Z_NULL;
-    strm->zfree = Z_NULL;
-    strm->opaque = Z_NULL;
-    ret = deflateInit2(strm, state->level, Z_DEFLATED,
-                       15 + 16, 8, state->strategy);
-    if (ret != Z_OK) {
-        free(state->in);
-        gz_error(state, Z_MEM_ERROR, "out of memory");
-        return -1;
+    /* only need output buffer and deflate state if compressing */
+    if (!state->direct) {
+        /* allocate output buffer */
+        state->out = (unsigned char *)malloc(state->want);
+        if (state->out == NULL) {
+            free(state->in);
+            gz_error(state, Z_MEM_ERROR, "out of memory");
+            return -1;
+        }
+
+        /* allocate deflate memory, set up for gzip compression */
+        strm->zalloc = Z_NULL;
+        strm->zfree = Z_NULL;
+        strm->opaque = Z_NULL;
+        ret = deflateInit2(strm, state->level, Z_DEFLATED,
+                           MAX_WBITS + 16, DEF_MEM_LEVEL, state->strategy);
+        if (ret != Z_OK) {
+            free(state->out);
+            free(state->in);
+            gz_error(state, Z_MEM_ERROR, "out of memory");
+            return -1;
+        }
     }
 
     /* mark state as initialized */
     state->size = state->want;
 
-    /* initialize write buffer */
-    strm->avail_out = state->size;
-    strm->next_out = state->out;
-    state->next = strm->next_out;
+    /* initialize write buffer if compressing */
+    if (!state->direct) {
+        strm->avail_out = state->size;
+        strm->next_out = state->out;
+        state->x.next = strm->next_out;
+    }
     return 0;
 }
 
 /* Compress whatever is at avail_in and next_in and write to the output file.
    Return -1 if there is an error writing to the output file, otherwise 0.
    flush is assumed to be a valid deflate() flush value.  If flush is Z_FINISH,
-   then the deflate() state is reset to start a new gzip stream. */
+   then the deflate() state is reset to start a new gzip stream.  If gz->direct
+   is true, then simply write to the output file without compressing, and
+   ignore flush. */
 local int gz_comp(state, flush)
     gz_statep state;
     int flush;
@@ -68,6 +79,17 @@
     if (state->size == 0 && gz_init(state) == -1)
         return -1;
 
+    /* write directly if requested */
+    if (state->direct) {
+        got = write(state->fd, strm->next_in, strm->avail_in);
+        if (got < 0 || (unsigned)got != strm->avail_in) {
+            gz_error(state, Z_ERRNO, zstrerror());
+            return -1;
+        }
+        strm->avail_in = 0;
+        return 0;
+    }
+
     /* run deflate() on provided input until it produces no more output */
     ret = Z_OK;
     do {
@@ -75,8 +97,8 @@
            doing Z_FINISH then don't write until we get to Z_STREAM_END */
         if (strm->avail_out == 0 || (flush != Z_NO_FLUSH &&
             (flush != Z_FINISH || ret == Z_STREAM_END))) {
-            have = (unsigned)(strm->next_out - state->next);
-            if (have && ((got = write(state->fd, state->next, have)) < 0 ||
+            have = (unsigned)(strm->next_out - state->x.next);
+            if (have && ((got = write(state->fd, state->x.next, have)) < 0 ||
                          (unsigned)got != have)) {
                 gz_error(state, Z_ERRNO, zstrerror());
                 return -1;
@@ -85,7 +107,7 @@
                 strm->avail_out = state->size;
                 strm->next_out = state->out;
             }
-            state->next = strm->next_out;
+            state->x.next = strm->next_out;
         }
 
         /* compress */
@@ -131,7 +153,7 @@
         }
         strm->avail_in = n;
         strm->next_in = state->in;
-        state->pos += n;
+        state->x.pos += n;
         if (gz_comp(state, Z_NO_FLUSH) == -1)
             return -1;
         len -= n;
@@ -146,7 +168,6 @@
     unsigned len;
 {
     unsigned put = len;
-    unsigned n;
     gz_statep state;
     z_streamp strm;
 
@@ -163,7 +184,7 @@
     /* since an int is returned, make sure len fits in one, otherwise return
        with an error (this avoids the flaw in the interface) */
     if ((int)len < 0) {
-        gz_error(state, Z_BUF_ERROR, "requested length does not fit in int");
+        gz_error(state, Z_DATA_ERROR, "requested length does not fit in int");
         return 0;
     }
 
@@ -186,16 +207,19 @@
     if (len < state->size) {
         /* copy to input buffer, compress when full */
         do {
+            unsigned have, copy;
+
             if (strm->avail_in == 0)
                 strm->next_in = state->in;
-            n = state->size - strm->avail_in;
-            if (n > len)
-                n = len;
-            memcpy(strm->next_in + strm->avail_in, buf, n);
-            strm->avail_in += n;
-            state->pos += n;
-            buf = (char *)buf + n;
-            len -= n;
+            have = (unsigned)((strm->next_in + strm->avail_in) - state->in);
+            copy = state->size - have;
+            if (copy > len)
+                copy = len;
+            memcpy(state->in + have, buf, copy);
+            strm->avail_in += copy;
+            state->x.pos += copy;
+            buf = (const char *)buf + copy;
+            len -= copy;
             if (len && gz_comp(state, Z_NO_FLUSH) == -1)
                 return 0;
         } while (len);
@@ -207,8 +231,8 @@
 
         /* directly compress user buffer to file */
         strm->avail_in = len;
-        strm->next_in = (voidp)buf;
-        state->pos += len;
+        strm->next_in = (z_const Bytef *)buf;
+        state->x.pos += len;
         if (gz_comp(state, Z_NO_FLUSH) == -1)
             return 0;
     }
@@ -222,6 +246,7 @@
     gzFile file;
     int c;
 {
+    unsigned have;
     unsigned char buf[1];
     gz_statep state;
     z_streamp strm;
@@ -245,19 +270,23 @@
 
     /* try writing to input buffer for speed (state->size == 0 if buffer not
        initialized) */
-    if (strm->avail_in < state->size) {
+    if (state->size) {
         if (strm->avail_in == 0)
             strm->next_in = state->in;
-        strm->next_in[strm->avail_in++] = c;
-        state->pos++;
-        return c;
+        have = (unsigned)((strm->next_in + strm->avail_in) - state->in);
+        if (have < state->size) {
+            state->in[have] = c;
+            strm->avail_in++;
+            state->x.pos++;
+            return c & 0xff;
+        }
     }
 
     /* no room in buffer or not initialized, use gz_write() */
     buf[0] = c;
     if (gzwrite(file, buf, 1) != 1)
         return -1;
-    return c;
+    return c & 0xff;
 }
 
 /* -- see zlib.h -- */
@@ -274,16 +303,15 @@
     return ret == 0 && len != 0 ? -1 : ret;
 }
 
-#ifdef STDC
+#if defined(STDC) || defined(Z_HAVE_STDARG_H)
 #include <stdarg.h>
 
 /* -- see zlib.h -- */
-int ZEXPORTVA gzprintf (gzFile file, const char *format, ...)
+int ZEXPORTVA gzvprintf(gzFile file, const char *format, va_list va)
 {
     int size, len;
     gz_statep state;
     z_streamp strm;
-    va_list va;
 
     /* get internal structure */
     if (file == NULL)
@@ -313,25 +341,20 @@
     /* do the printf() into the input buffer, put length in len */
     size = (int)(state->size);
     state->in[size - 1] = 0;
-    va_start(va, format);
 #ifdef NO_vsnprintf
 #  ifdef HAS_vsprintf_void
-    (void)vsprintf(state->in, format, va);
-    va_end(va);
+    (void)vsprintf((char *)(state->in), format, va);
     for (len = 0; len < size; len++)
         if (state->in[len] == 0) break;
 #  else
-    len = vsprintf(state->in, format, va);
-    va_end(va);
+    len = vsprintf((char *)(state->in), format, va);
 #  endif
 #else
 #  ifdef HAS_vsnprintf_void
-    (void)vsnprintf(state->in, size, format, va);
-    va_end(va);
-    len = strlen(state->in);
+    (void)vsnprintf((char *)(state->in), size, format, va);
+    len = strlen((char *)(state->in));
 #  else
     len = vsnprintf((char *)(state->in), size, format, va);
-    va_end(va);
 #  endif
 #endif
 
@@ -342,11 +365,22 @@
     /* update buffer and position, defer compression until needed */
     strm->avail_in = (unsigned)len;
     strm->next_in = state->in;
-    state->pos += len;
+    state->x.pos += len;
     return len;
 }
 
-#else /* !STDC */
+int ZEXPORTVA gzprintf(gzFile file, const char *format, ...)
+{
+    va_list va;
+    int ret;
+
+    va_start(va, format);
+    ret = gzvprintf(file, format, va);
+    va_end(va);
+    return ret;
+}
+
+#else /* !STDC && !Z_HAVE_STDARG_H */
 
 /* -- see zlib.h -- */
 int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
@@ -366,6 +400,10 @@
     state = (gz_statep)file;
     strm = &(state->strm);
 
+    /* check that can really pass pointer in ints */
+    if (sizeof(int) != sizeof(void *))
+        return 0;
+
     /* check that we're writing and that there's no error */
     if (state->mode != GZ_WRITE || state->err != Z_OK)
         return 0;
@@ -390,22 +428,23 @@
     state->in[size - 1] = 0;
 #ifdef NO_snprintf
 #  ifdef HAS_sprintf_void
-    sprintf(state->in, format, a1, a2, a3, a4, a5, a6, a7, a8,
+    sprintf((char *)(state->in), format, a1, a2, a3, a4, a5, a6, a7, a8,
             a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
     for (len = 0; len < size; len++)
         if (state->in[len] == 0) break;
 #  else
-    len = sprintf(state->in, format, a1, a2, a3, a4, a5, a6, a7, a8,
-                a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
+    len = sprintf((char *)(state->in), format, a1, a2, a3, a4, a5, a6, a7, a8,
+                  a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
 #  endif
 #else
 #  ifdef HAS_snprintf_void
-    snprintf(state->in, size, format, a1, a2, a3, a4, a5, a6, a7, a8,
+    snprintf((char *)(state->in), size, format, a1, a2, a3, a4, a5, a6, a7, a8,
              a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
-    len = strlen(state->in);
+    len = strlen((char *)(state->in));
 #  else
-    len = snprintf(state->in, size, format, a1, a2, a3, a4, a5, a6, a7, a8,
-                 a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
+    len = snprintf((char *)(state->in), size, format, a1, a2, a3, a4, a5, a6,
+                   a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18,
+                   a19, a20);
 #  endif
 #endif
 
@@ -416,7 +455,7 @@
     /* update buffer and position, defer compression until needed */
     strm->avail_in = (unsigned)len;
     strm->next_in = state->in;
-    state->pos += len;
+    state->x.pos += len;
     return len;
 }
 
@@ -500,7 +539,7 @@
 int ZEXPORT gzclose_w(file)
     gzFile file;
 {
-    int ret = 0;
+    int ret = Z_OK;
     gz_statep state;
 
     /* get internal structure */
@@ -515,17 +554,24 @@
     /* check for seek request */
     if (state->seek) {
         state->seek = 0;
-        ret += gz_zero(state, state->skip);
+        if (gz_zero(state, state->skip) == -1)
+            ret = state->err;
     }
 
     /* flush, free memory, and close file */
-    ret += gz_comp(state, Z_FINISH);
-    (void)deflateEnd(&(state->strm));
-    free(state->out);
-    free(state->in);
+    if (gz_comp(state, Z_FINISH) == -1)
+        ret = state->err;
+    if (state->size) {
+        if (!state->direct) {
+            (void)deflateEnd(&(state->strm));
+            free(state->out);
+        }
+        free(state->in);
+    }
     gz_error(state, Z_OK, NULL);
     free(state->path);
-    ret += close(state->fd);
+    if (close(state->fd) == -1)
+        ret = Z_ERRNO;
     free(state);
-    return ret ? Z_ERRNO : Z_OK;
+    return ret;
 }
diff --git a/Modules/zlib/infback.c b/Modules/zlib/infback.c
index af3a8c9..f3833c2 100644
--- a/Modules/zlib/infback.c
+++ b/Modules/zlib/infback.c
@@ -1,5 +1,5 @@
 /* infback.c -- inflate using a call-back interface
- * Copyright (C) 1995-2009 Mark Adler
+ * Copyright (C) 1995-2011 Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -42,10 +42,19 @@
         return Z_STREAM_ERROR;
     strm->msg = Z_NULL;                 /* in case we return an error */
     if (strm->zalloc == (alloc_func)0) {
+#ifdef Z_SOLO
+        return Z_STREAM_ERROR;
+#else
         strm->zalloc = zcalloc;
         strm->opaque = (voidpf)0;
+#endif
     }
-    if (strm->zfree == (free_func)0) strm->zfree = zcfree;
+    if (strm->zfree == (free_func)0)
+#ifdef Z_SOLO
+        return Z_STREAM_ERROR;
+#else
+    strm->zfree = zcfree;
+#endif
     state = (struct inflate_state FAR *)ZALLOC(strm, 1,
                                                sizeof(struct inflate_state));
     if (state == Z_NULL) return Z_MEM_ERROR;
@@ -246,7 +255,7 @@
 void FAR *out_desc;
 {
     struct inflate_state FAR *state;
-    unsigned char FAR *next;    /* next input */
+    z_const unsigned char FAR *next;    /* next input */
     unsigned char FAR *put;     /* next output */
     unsigned have, left;        /* available input and output */
     unsigned long hold;         /* bit buffer */
@@ -394,7 +403,6 @@
                     PULLBYTE();
                 }
                 if (here.val < 16) {
-                    NEEDBITS(here.bits);
                     DROPBITS(here.bits);
                     state->lens[state->have++] = here.val;
                 }
diff --git a/Modules/zlib/inffast.c b/Modules/zlib/inffast.c
index 2f1d60b..bda59ce 100644
--- a/Modules/zlib/inffast.c
+++ b/Modules/zlib/inffast.c
@@ -1,5 +1,5 @@
 /* inffast.c -- fast decoding
- * Copyright (C) 1995-2008, 2010 Mark Adler
+ * Copyright (C) 1995-2008, 2010, 2013 Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -69,8 +69,8 @@
 unsigned start;         /* inflate()'s starting value for strm->avail_out */
 {
     struct inflate_state FAR *state;
-    unsigned char FAR *in;      /* local strm->next_in */
-    unsigned char FAR *last;    /* while in < last, enough input available */
+    z_const unsigned char FAR *in;      /* local strm->next_in */
+    z_const unsigned char FAR *last;    /* have enough input while in < last */
     unsigned char FAR *out;     /* local strm->next_out */
     unsigned char FAR *beg;     /* inflate()'s initial strm->next_out */
     unsigned char FAR *end;     /* while out < end, enough space available */
diff --git a/Modules/zlib/inffixed.h b/Modules/zlib/inffixed.h
index 75ed4b5..d628327 100644
--- a/Modules/zlib/inffixed.h
+++ b/Modules/zlib/inffixed.h
@@ -2,9 +2,9 @@
      * Generated automatically by makefixed().
      */
 
-    /* WARNING: this file should *not* be used by applications. It
-       is part of the implementation of the compression library and
-       is subject to change. Applications should only use zlib.h.
+    /* WARNING: this file should *not* be used by applications.
+       It is part of the implementation of this library and is
+       subject to change. Applications should only use zlib.h.
      */
 
     static const code lenfix[512] = {
diff --git a/Modules/zlib/inflate.c b/Modules/zlib/inflate.c
index a8431ab..870f89b 100644
--- a/Modules/zlib/inflate.c
+++ b/Modules/zlib/inflate.c
@@ -1,5 +1,5 @@
 /* inflate.c -- zlib decompression
- * Copyright (C) 1995-2010 Mark Adler
+ * Copyright (C) 1995-2012 Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -93,14 +93,15 @@
 
 /* function prototypes */
 local void fixedtables OF((struct inflate_state FAR *state));
-local int updatewindow OF((z_streamp strm, unsigned out));
+local int updatewindow OF((z_streamp strm, const unsigned char FAR *end,
+                           unsigned copy));
 #ifdef BUILDFIXED
    void makefixed OF((void));
 #endif
-local unsigned syncsearch OF((unsigned FAR *have, unsigned char FAR *buf,
+local unsigned syncsearch OF((unsigned FAR *have, const unsigned char FAR *buf,
                               unsigned len));
 
-int ZEXPORT inflateReset(strm)
+int ZEXPORT inflateResetKeep(strm)
 z_streamp strm;
 {
     struct inflate_state FAR *state;
@@ -109,15 +110,13 @@
     state = (struct inflate_state FAR *)strm->state;
     strm->total_in = strm->total_out = state->total = 0;
     strm->msg = Z_NULL;
-    strm->adler = 1;        /* to support ill-conceived Java test suite */
+    if (state->wrap)        /* to support ill-conceived Java test suite */
+        strm->adler = state->wrap & 1;
     state->mode = HEAD;
     state->last = 0;
     state->havedict = 0;
     state->dmax = 32768U;
     state->head = Z_NULL;
-    state->wsize = 0;
-    state->whave = 0;
-    state->wnext = 0;
     state->hold = 0;
     state->bits = 0;
     state->lencode = state->distcode = state->next = state->codes;
@@ -127,6 +126,19 @@
     return Z_OK;
 }
 
+int ZEXPORT inflateReset(strm)
+z_streamp strm;
+{
+    struct inflate_state FAR *state;
+
+    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+    state = (struct inflate_state FAR *)strm->state;
+    state->wsize = 0;
+    state->whave = 0;
+    state->wnext = 0;
+    return inflateResetKeep(strm);
+}
+
 int ZEXPORT inflateReset2(strm, windowBits)
 z_streamp strm;
 int windowBits;
@@ -180,10 +192,19 @@
     if (strm == Z_NULL) return Z_STREAM_ERROR;
     strm->msg = Z_NULL;                 /* in case we return an error */
     if (strm->zalloc == (alloc_func)0) {
+#ifdef Z_SOLO
+        return Z_STREAM_ERROR;
+#else
         strm->zalloc = zcalloc;
         strm->opaque = (voidpf)0;
+#endif
     }
-    if (strm->zfree == (free_func)0) strm->zfree = zcfree;
+    if (strm->zfree == (free_func)0)
+#ifdef Z_SOLO
+        return Z_STREAM_ERROR;
+#else
+        strm->zfree = zcfree;
+#endif
     state = (struct inflate_state FAR *)
             ZALLOC(strm, 1, sizeof(struct inflate_state));
     if (state == Z_NULL) return Z_MEM_ERROR;
@@ -321,8 +342,8 @@
     low = 0;
     for (;;) {
         if ((low % 7) == 0) printf("\n        ");
-        printf("{%u,%u,%d}", state.lencode[low].op, state.lencode[low].bits,
-               state.lencode[low].val);
+        printf("{%u,%u,%d}", (low & 127) == 99 ? 64 : state.lencode[low].op,
+               state.lencode[low].bits, state.lencode[low].val);
         if (++low == size) break;
         putchar(',');
     }
@@ -355,12 +376,13 @@
    output will fall in the output data, making match copies simpler and faster.
    The advantage may be dependent on the size of the processor's data caches.
  */
-local int updatewindow(strm, out)
+local int updatewindow(strm, end, copy)
 z_streamp strm;
-unsigned out;
+const Bytef *end;
+unsigned copy;
 {
     struct inflate_state FAR *state;
-    unsigned copy, dist;
+    unsigned dist;
 
     state = (struct inflate_state FAR *)strm->state;
 
@@ -380,19 +402,18 @@
     }
 
     /* copy state->wsize or less output bytes into the circular window */
-    copy = out - strm->avail_out;
     if (copy >= state->wsize) {
-        zmemcpy(state->window, strm->next_out - state->wsize, state->wsize);
+        zmemcpy(state->window, end - state->wsize, state->wsize);
         state->wnext = 0;
         state->whave = state->wsize;
     }
     else {
         dist = state->wsize - state->wnext;
         if (dist > copy) dist = copy;
-        zmemcpy(state->window + state->wnext, strm->next_out - copy, dist);
+        zmemcpy(state->window + state->wnext, end - copy, dist);
         copy -= dist;
         if (copy) {
-            zmemcpy(state->window, strm->next_out - copy, copy);
+            zmemcpy(state->window, end - copy, copy);
             state->wnext = copy;
             state->whave = state->wsize;
         }
@@ -499,11 +520,6 @@
         bits -= bits & 7; \
     } while (0)
 
-/* Reverse the bytes in a 32-bit value */
-#define REVERSE(q) \
-    ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \
-     (((q) & 0xff00) << 8) + (((q) & 0xff) << 24))
-
 /*
    inflate() uses a state machine to process as much input data and generate as
    much output data as possible before returning.  The state machine is
@@ -591,7 +607,7 @@
 int flush;
 {
     struct inflate_state FAR *state;
-    unsigned char FAR *next;    /* next input */
+    z_const unsigned char FAR *next;    /* next input */
     unsigned char FAR *put;     /* next output */
     unsigned have, left;        /* available input and output */
     unsigned long hold;         /* bit buffer */
@@ -797,7 +813,7 @@
 #endif
         case DICTID:
             NEEDBITS(32);
-            strm->adler = state->check = REVERSE(hold);
+            strm->adler = state->check = ZSWAP32(hold);
             INITBITS();
             state->mode = DICT;
         case DICT:
@@ -905,7 +921,7 @@
             while (state->have < 19)
                 state->lens[order[state->have++]] = 0;
             state->next = state->codes;
-            state->lencode = (code const FAR *)(state->next);
+            state->lencode = (const code FAR *)(state->next);
             state->lenbits = 7;
             ret = inflate_table(CODES, state->lens, 19, &(state->next),
                                 &(state->lenbits), state->work);
@@ -925,7 +941,6 @@
                     PULLBYTE();
                 }
                 if (here.val < 16) {
-                    NEEDBITS(here.bits);
                     DROPBITS(here.bits);
                     state->lens[state->have++] = here.val;
                 }
@@ -980,7 +995,7 @@
                values here (9 and 6) without reading the comments in inftrees.h
                concerning the ENOUGH constants, which depend on those values */
             state->next = state->codes;
-            state->lencode = (code const FAR *)(state->next);
+            state->lencode = (const code FAR *)(state->next);
             state->lenbits = 9;
             ret = inflate_table(LENS, state->lens, state->nlen, &(state->next),
                                 &(state->lenbits), state->work);
@@ -989,7 +1004,7 @@
                 state->mode = BAD;
                 break;
             }
-            state->distcode = (code const FAR *)(state->next);
+            state->distcode = (const code FAR *)(state->next);
             state->distbits = 6;
             ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist,
                             &(state->next), &(state->distbits), state->work);
@@ -1170,7 +1185,7 @@
 #ifdef GUNZIP
                      state->flags ? hold :
 #endif
-                     REVERSE(hold)) != state->check) {
+                     ZSWAP32(hold)) != state->check) {
                     strm->msg = (char *)"incorrect data check";
                     state->mode = BAD;
                     break;
@@ -1214,8 +1229,9 @@
      */
   inf_leave:
     RESTORE();
-    if (state->wsize || (state->mode < CHECK && out != strm->avail_out))
-        if (updatewindow(strm, out)) {
+    if (state->wsize || (out != strm->avail_out && state->mode < BAD &&
+            (state->mode < CHECK || flush != Z_FINISH)))
+        if (updatewindow(strm, strm->next_out, out - strm->avail_out)) {
             state->mode = MEM;
             return Z_MEM_ERROR;
         }
@@ -1249,13 +1265,37 @@
     return Z_OK;
 }
 
+int ZEXPORT inflateGetDictionary(strm, dictionary, dictLength)
+z_streamp strm;
+Bytef *dictionary;
+uInt *dictLength;
+{
+    struct inflate_state FAR *state;
+
+    /* check state */
+    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+    state = (struct inflate_state FAR *)strm->state;
+
+    /* copy dictionary */
+    if (state->whave && dictionary != Z_NULL) {
+        zmemcpy(dictionary, state->window + state->wnext,
+                state->whave - state->wnext);
+        zmemcpy(dictionary + state->whave - state->wnext,
+                state->window, state->wnext);
+    }
+    if (dictLength != Z_NULL)
+        *dictLength = state->whave;
+    return Z_OK;
+}
+
 int ZEXPORT inflateSetDictionary(strm, dictionary, dictLength)
 z_streamp strm;
 const Bytef *dictionary;
 uInt dictLength;
 {
     struct inflate_state FAR *state;
-    unsigned long id;
+    unsigned long dictid;
+    int ret;
 
     /* check state */
     if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
@@ -1263,29 +1303,21 @@
     if (state->wrap != 0 && state->mode != DICT)
         return Z_STREAM_ERROR;
 
-    /* check for correct dictionary id */
+    /* check for correct dictionary identifier */
     if (state->mode == DICT) {
-        id = adler32(0L, Z_NULL, 0);
-        id = adler32(id, dictionary, dictLength);
-        if (id != state->check)
+        dictid = adler32(0L, Z_NULL, 0);
+        dictid = adler32(dictid, dictionary, dictLength);
+        if (dictid != state->check)
             return Z_DATA_ERROR;
     }
 
-    /* copy dictionary to window */
-    if (updatewindow(strm, strm->avail_out)) {
+    /* copy dictionary to window using updatewindow(), which will amend the
+       existing dictionary if appropriate */
+    ret = updatewindow(strm, dictionary + dictLength, dictLength);
+    if (ret) {
         state->mode = MEM;
         return Z_MEM_ERROR;
     }
-    if (dictLength > state->wsize) {
-        zmemcpy(state->window, dictionary + dictLength - state->wsize,
-                state->wsize);
-        state->whave = state->wsize;
-    }
-    else {
-        zmemcpy(state->window + state->wsize - dictLength, dictionary,
-                dictLength);
-        state->whave = dictLength;
-    }
     state->havedict = 1;
     Tracev((stderr, "inflate:   dictionary set\n"));
     return Z_OK;
@@ -1321,7 +1353,7 @@
  */
 local unsigned syncsearch(have, buf, len)
 unsigned FAR *have;
-unsigned char FAR *buf;
+const unsigned char FAR *buf;
 unsigned len;
 {
     unsigned got;
@@ -1433,8 +1465,8 @@
     }
 
     /* copy state */
-    zmemcpy(dest, source, sizeof(z_stream));
-    zmemcpy(copy, state, sizeof(struct inflate_state));
+    zmemcpy((voidpf)dest, (voidpf)source, sizeof(z_stream));
+    zmemcpy((voidpf)copy, (voidpf)state, sizeof(struct inflate_state));
     if (state->lencode >= state->codes &&
         state->lencode <= state->codes + ENOUGH - 1) {
         copy->lencode = copy->codes + (state->lencode - state->codes);
diff --git a/Modules/zlib/inftrees.c b/Modules/zlib/inftrees.c
index 11e9c52..44d89cf 100644
--- a/Modules/zlib/inftrees.c
+++ b/Modules/zlib/inftrees.c
@@ -1,5 +1,5 @@
 /* inftrees.c -- generate Huffman trees for efficient decoding
- * Copyright (C) 1995-2010 Mark Adler
+ * Copyright (C) 1995-2013 Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -9,7 +9,7 @@
 #define MAXBITS 15
 
 const char inflate_copyright[] =
-   " inflate 1.2.5 Copyright 1995-2010 Mark Adler ";
+   " inflate 1.2.8 Copyright 1995-2013 Mark Adler ";
 /*
   If you use the zlib library in a product, an acknowledgment is welcome
   in the documentation of your product. If for some reason you cannot
@@ -62,7 +62,7 @@
         35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
     static const unsigned short lext[31] = { /* Length codes 257..285 extra */
         16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
-        19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 73, 195};
+        19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78};
     static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
         1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
         257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
@@ -208,8 +208,8 @@
     mask = used - 1;            /* mask for comparing low */
 
     /* check available table space */
-    if ((type == LENS && used >= ENOUGH_LENS) ||
-        (type == DISTS && used >= ENOUGH_DISTS))
+    if ((type == LENS && used > ENOUGH_LENS) ||
+        (type == DISTS && used > ENOUGH_DISTS))
         return 1;
 
     /* process all codes and make table entries */
@@ -277,8 +277,8 @@
 
             /* check for enough space */
             used += 1U << curr;
-            if ((type == LENS && used >= ENOUGH_LENS) ||
-                (type == DISTS && used >= ENOUGH_DISTS))
+            if ((type == LENS && used > ENOUGH_LENS) ||
+                (type == DISTS && used > ENOUGH_DISTS))
                 return 1;
 
             /* point entry in root table to sub-table */
@@ -289,38 +289,14 @@
         }
     }
 
-    /*
-       Fill in rest of table for incomplete codes.  This loop is similar to the
-       loop above in incrementing huff for table indices.  It is assumed that
-       len is equal to curr + drop, so there is no loop needed to increment
-       through high index bits.  When the current sub-table is filled, the loop
-       drops back to the root table to fill in any remaining entries there.
-     */
-    here.op = (unsigned char)64;                /* invalid code marker */
-    here.bits = (unsigned char)(len - drop);
-    here.val = (unsigned short)0;
-    while (huff != 0) {
-        /* when done with sub-table, drop back to root table */
-        if (drop != 0 && (huff & mask) != low) {
-            drop = 0;
-            len = root;
-            next = *table;
-            here.bits = (unsigned char)len;
-        }
-
-        /* put invalid code marker in table */
-        next[huff >> drop] = here;
-
-        /* backwards increment the len-bit code huff */
-        incr = 1U << (len - 1);
-        while (huff & incr)
-            incr >>= 1;
-        if (incr != 0) {
-            huff &= incr - 1;
-            huff += incr;
-        }
-        else
-            huff = 0;
+    /* fill in remaining table entry if code is incomplete (guaranteed to have
+       at most one remaining entry, since if the code is incomplete, the
+       maximum code length that was allowed to get this far is one bit) */
+    if (huff != 0) {
+        here.op = (unsigned char)64;            /* invalid code marker */
+        here.bits = (unsigned char)(len - drop);
+        here.val = (unsigned short)0;
+        next[huff] = here;
     }
 
     /* set return parameters */
diff --git a/Modules/zlib/inftrees.h b/Modules/zlib/inftrees.h
index 24230c5..baa53a0 100644
--- a/Modules/zlib/inftrees.h
+++ b/Modules/zlib/inftrees.h
@@ -41,7 +41,7 @@
    examples/enough.c found in the zlib distribtution.  The arguments to that
    program are the number of symbols, the initial root table size, and the
    maximum bit length of a code.  "enough 286 9 15" for literal/length codes
-   returns 852, and "enough 30 6 15" for distance codes returns 592.
+   returns returns 852, and "enough 30 6 15" for distance codes returns 592.
    The initial root table size (9 or 6) is found in the fifth argument of the
    inflate_table() calls in inflate.c and infback.c.  If the root table size is
    changed, then these maximum sizes would be need to be recalculated and
diff --git a/Modules/zlib/make_vms.com b/Modules/zlib/make_vms.com
index 6576490..65e9d0c 100644
--- a/Modules/zlib/make_vms.com
+++ b/Modules/zlib/make_vms.com
@@ -3,7 +3,7 @@
 $!
 $! In case of problems with the install you might contact me at
 $! zinser@zinser.no-ip.info(preferred) or
-$! zinser@sysdev.deutsche-boerse.com (work)
+$! martin.zinser@eurexchange.com (work)
 $!
 $! Make procedure history for Zlib
 $!
@@ -14,9 +14,16 @@
 $! 0.03 20091224 Add support for large file check
 $! 0.04 20100110 Add new gzclose, gzlib, gzread, gzwrite
 $! 0.05 20100221 Exchange zlibdefs.h by zconf.h.in
+$! 0.06 20120111 Fix missing amiss_err, update zconf_h.in, fix new exmples
+$!               subdir path, update module search in makefile.in
+$! 0.07 20120115 Triggered by work done by Alexey Chupahin completly redesigned
+$!               shared image creation
+$! 0.08 20120219 Make it work on VAX again, pre-load missing symbols to shared
+$!               image
+$! 0.09 20120305 SMS.  P1 sets builder ("MMK", "MMS", " " (built-in)).
+$!               "" -> automatic, preference: MMK, MMS, built-in.
 $!
 $ on error then goto err_exit
-$ set proc/parse=ext
 $!
 $ true  = 1
 $ false = 0
@@ -32,31 +39,43 @@
 $!
 $! Setup variables holding "config" information
 $!
-$ Make    = ""
+$ Make    = "''p1'"
 $ name     = "Zlib"
 $ version  = "?.?.?"
 $ v_string = "ZLIB_VERSION"
 $ v_file   = "zlib.h"
-$ ccopt   = ""
+$ ccopt   = "/include = []"
 $ lopts   = ""
 $ dnsrl   = ""
-$ aconf_in_file = "zconf.h.in#zconf.h_in"
+$ aconf_in_file = "zconf.h.in#zconf.h_in#zconf_h.in"
 $ conf_check_string = ""
 $ linkonly = false
 $ optfile  = name + ".opt"
+$ mapfile  = name + ".map"
 $ libdefs  = ""
+$ vax      = f$getsyi("HW_MODEL").lt.1024
 $ axp      = f$getsyi("HW_MODEL").ge.1024 .and. f$getsyi("HW_MODEL").lt.4096
+$ ia64     = f$getsyi("HW_MODEL").ge.4096
 $!
-$ whoami = f$parse(f$enviornment("Procedure"),,,,"NO_CONCEAL")
+$! 2012-03-05 SMS.
+$! Why is this needed?  And if it is needed, why not simply ".not. vax"?
+$!
+$!!! if axp .or. ia64 then  set proc/parse=extended
+$!
+$ whoami = f$parse(f$environment("Procedure"),,,,"NO_CONCEAL")
 $ mydef  = F$parse(whoami,,,"DEVICE")
 $ mydir  = f$parse(whoami,,,"DIRECTORY") - "]["
 $ myproc = f$parse(whoami,,,"Name") + f$parse(whoami,,,"type")
 $!
 $! Check for MMK/MMS
 $!
-$ If F$Search ("Sys$System:MMS.EXE") .nes. "" Then Make = "MMS"
-$ If F$Type (MMK) .eqs. "STRING" Then Make = "MMK"
-$!
+$ if (Make .eqs. "")
+$ then
+$   If F$Search ("Sys$System:MMS.EXE") .nes. "" Then Make = "MMS"
+$   If F$Type (MMK) .eqs. "STRING" Then Make = "MMK"
+$ else
+$   Make = f$edit( Make, "trim")
+$ endif
 $!
 $ gosub find_version
 $!
@@ -69,6 +88,7 @@
 $!
 $ gosub check_compiler
 $ close topt
+$ close optf
 $!
 $ if its_decc
 $ then
@@ -83,6 +103,15 @@
 $       define sys decc$library_include:
 $     endif
 $   endif
+$!
+$! 2012-03-05 SMS.
+$! Why /NAMES = AS_IS?  Why not simply ".not. vax"?  And why not on VAX?
+$!
+$   if axp .or. ia64
+$   then
+$       ccopt = ccopt + "/name=as_is/opt=(inline=speed)"
+$       s_case = true
+$   endif
 $ endif
 $ if its_vaxc .or. its_gnuc
 $ then
@@ -122,15 +151,20 @@
 $ endif
 $ goto aconf_loop
 $ACONF_EXIT:
+$ write aconf ""
+$ write aconf "/* VMS specifics added by make_vms.com: */"
 $ write aconf "#define VMS 1"
 $ write aconf "#include <unistd.h>"
 $ write aconf "#include <unixio.h>"
 $ write aconf "#ifdef _LARGEFILE"
-$ write aconf "#define off64_t __off64_t"
-$ write aconf "#define fopen64 fopen"
-$ write aconf "#define fseeko64 fseeko"
-$ write aconf "#define lseek64 lseek"
-$ write aconf "#define ftello64 ftell"
+$ write aconf "# define off64_t __off64_t"
+$ write aconf "# define fopen64 fopen"
+$ write aconf "# define fseeko64 fseeko"
+$ write aconf "# define lseek64 lseek"
+$ write aconf "# define ftello64 ftell"
+$ write aconf "#endif"
+$ write aconf "#if !defined( __VAX) && (__CRTL_VER >= 70312000)"
+$ write aconf "# define HAVE_VSNPRINTF"
 $ write aconf "#endif"
 $ close aconf_in
 $ close aconf
@@ -139,8 +173,9 @@
 $!
 $ write sys$output "Compiling Zlib sources ..."
 $ if make.eqs.""
-$  then
-$   dele example.obj;*,minigzip.obj;*
+$ then
+$   if (f$search( "example.obj;*") .nes. "") then delete example.obj;*
+$   if (f$search( "minigzip.obj;*") .nes. "") then delete minigzip.obj;*
 $   CALL MAKE adler32.OBJ "CC ''CCOPT' adler32" -
                 adler32.c zlib.h zconf.h
 $   CALL MAKE compress.OBJ "CC ''CCOPT' compress" -
@@ -174,41 +209,34 @@
 $   write sys$output "Building Zlib ..."
 $   CALL MAKE libz.OLB "lib/crea libz.olb *.obj" *.OBJ
 $   write sys$output "Building example..."
-$   CALL MAKE example.OBJ "CC ''CCOPT' example" -
-                example.c zlib.h zconf.h
+$   CALL MAKE example.OBJ "CC ''CCOPT' [.test]example" -
+                [.test]example.c zlib.h zconf.h
 $   call make example.exe "LINK example,libz.olb/lib" example.obj libz.olb
-$   if f$search("x11vms:xvmsutils.olb") .nes. ""
-$   then
-$     write sys$output "Building minigzip..."
-$     CALL MAKE minigzip.OBJ "CC ''CCOPT' minigzip" -
-                minigzip.c zlib.h zconf.h
-$     call make minigzip.exe -
-                "LINK minigzip,libz.olb/lib,x11vms:xvmsutils.olb/lib" -
-                minigzip.obj libz.olb
-$   endif
-$  else
+$   write sys$output "Building minigzip..."
+$   CALL MAKE minigzip.OBJ "CC ''CCOPT' [.test]minigzip" -
+              [.test]minigzip.c zlib.h zconf.h
+$   call make minigzip.exe -
+              "LINK minigzip,libz.olb/lib" -
+              minigzip.obj libz.olb
+$ else
 $   gosub crea_mms
 $   write sys$output "Make ''name' ''version' with ''Make' "
 $   'make'
-$  endif
-$!
-$! Alpha gets a shareable image
-$!
-$ If axp
-$ Then
-$   gosub crea_olist
-$   write sys$output "Creating libzshr.exe"
-$   call anal_obj_axp modules.opt _link.opt
-$   if s_case
-$   then
-$      open/append optf modules.opt
-$      write optf "case_sensitive=YES"
-$      close optf
-$   endif
-$   LINK_'lopts'/SHARE=libzshr.exe modules.opt/opt,_link.opt/opt
 $ endif
+$!
+$! Create shareable image
+$!
+$ gosub crea_olist
+$ write sys$output "Creating libzshr.exe"
+$ call map_2_shopt 'mapfile' 'optfile'
+$ LINK_'lopts'/SHARE=libzshr.exe modules.opt/opt,'optfile'/opt
 $ write sys$output "Zlib build completed"
+$ delete/nolog tmp.opt;*
 $ exit
+$AMISS_ERR:
+$ write sys$output "No source for config.hin found."
+$ write sys$output "Tried any of ''aconf_in_file'"
+$ goto err_exit
 $CC_ERR:
 $ write sys$output "C compiler required to build ''name'"
 $ goto err_exit
@@ -216,7 +244,6 @@
 $ set message/facil/ident/sever/text
 $ close/nolog optf
 $ close/nolog topt
-$ close/nolog conf_hin
 $ close/nolog aconf_in
 $ close/nolog aconf
 $ close/nolog out
@@ -397,7 +424,7 @@
 $ deck
 # descrip.mms: MMS description file for building zlib on VMS
 # written by Martin P.J. Zinser
-# <zinser@zinser.no-ip.info or zinser@sysdev.deutsche-boerse.com>
+# <zinser@zinser.no-ip.info or martin.zinser@eurexchange.com>
 
 OBJS = adler32.obj, compress.obj, crc32.obj, gzclose.obj, gzlib.obj\
        gzread.obj, gzwrite.obj, uncompr.obj, infback.obj\
@@ -407,10 +434,9 @@
 $ eod
 $ write out "CFLAGS=", ccopt
 $ write out "LOPTS=", lopts
+$ write out "all : example.exe minigzip.exe libz.olb"
 $ copy sys$input: out
 $ deck
-
-all : example.exe minigzip.exe libz.olb
         @ write sys$output " Example applications available"
 
 libz.olb : libz.olb($(OBJS))
@@ -420,7 +446,7 @@
               link $(LOPTS) example,libz.olb/lib
 
 minigzip.exe : minigzip.obj libz.olb
-              link $(LOPTS) minigzip,libz.olb/lib,x11vms:xvmsutils.olb/lib
+              link $(LOPTS) minigzip,libz.olb/lib
 
 clean :
 	delete *.obj;*,libz.olb;*,*.opt;*,*.exe;*
@@ -431,7 +457,7 @@
 compress.obj : compress.c zlib.h zconf.h
 crc32.obj    : crc32.c zutil.h zlib.h zconf.h
 deflate.obj  : deflate.c deflate.h zutil.h zlib.h zconf.h
-example.obj  : example.c zlib.h zconf.h
+example.obj  : [.test]example.c zlib.h zconf.h
 gzclose.obj  : gzclose.c zutil.h zlib.h zconf.h
 gzlib.obj    : gzlib.c zutil.h zlib.h zconf.h
 gzread.obj   : gzread.c zutil.h zlib.h zconf.h
@@ -439,7 +465,7 @@
 inffast.obj  : inffast.c zutil.h zlib.h zconf.h inftrees.h inffast.h
 inflate.obj  : inflate.c zutil.h zlib.h zconf.h
 inftrees.obj : inftrees.c zutil.h zlib.h zconf.h inftrees.h
-minigzip.obj : minigzip.c zlib.h zconf.h
+minigzip.obj : [.test]minigzip.c zlib.h zconf.h
 trees.obj    : trees.c deflate.h zutil.h zlib.h zconf.h
 uncompr.obj  : uncompr.c zlib.h zconf.h
 zutil.obj    : zutil.c zutil.h zlib.h zconf.h
@@ -455,13 +481,18 @@
 $CREA_OLIST:
 $ open/read min makefile.in
 $ open/write mod modules.opt
-$ src_check = "OBJC ="
+$ src_check_list = "OBJZ =#OBJG ="
 $MRLOOP:
 $ read/end=mrdone min rec
-$ if (f$extract(0,6,rec) .nes. src_check) then goto mrloop
+$ i = 0
+$SRC_CHECK_LOOP:
+$ src_check = f$element(i, "#", src_check_list)
+$ i = i+1
+$ if src_check .eqs. "#" then goto mrloop
+$ if (f$extract(0,6,rec) .nes. src_check) then goto src_check_loop
 $ rec = rec - src_check
 $ gosub extra_filnam
-$ if (f$element(1,"\",rec) .eqs. "\") then goto mrdone
+$ if (f$element(1,"\",rec) .eqs. "\") then goto mrloop
 $MRSLOOP:
 $ read/end=mrdone min rec
 $ gosub extra_filnam
@@ -672,124 +703,6 @@
 $ return
 $!------------------------------------------------------------------------------
 $!
-$! Analyze Object files for OpenVMS AXP to extract Procedure and Data
-$! information to build a symbol vector for a shareable image
-$! All the "brains" of this logic was suggested by Hartmut Becker
-$! (Hartmut.Becker@compaq.com). All the bugs were introduced by me
-$! (zinser@zinser.no-ip.info), so if you do have problem reports please do not
-$! bother Hartmut/HP, but get in touch with me
-$!
-$! Version history
-$! 0.01 20040406 Skip over shareable images in option file
-$! 0.02 20041109 Fix option file for shareable images with case_sensitive=YES
-$! 0.03 20050107 Skip over Identification labels in option file
-$! 0.04 20060117 Add uppercase alias to code compiled with /name=as_is
-$!
-$ ANAL_OBJ_AXP: Subroutine
-$ V = 'F$Verify(0)
-$ SAY := "WRITE_ SYS$OUTPUT"
-$
-$ IF F$SEARCH("''P1'") .EQS. ""
-$ THEN
-$    SAY "ANAL_OBJ_AXP-E-NOSUCHFILE:  Error, inputfile ''p1' not available"
-$    goto exit_aa
-$ ENDIF
-$ IF "''P2'" .EQS. ""
-$ THEN
-$    SAY "ANAL_OBJ_AXP:  Error, no output file provided"
-$    goto exit_aa
-$ ENDIF
-$
-$ open/read in 'p1
-$ create a.tmp
-$ open/append atmp a.tmp
-$ loop:
-$ read/end=end_loop in line
-$ if f$locate("/SHARE",f$edit(line,"upcase")) .lt. f$length(line)
-$ then
-$   write sys$output "ANAL_SKP_SHR-i-skipshare, ''line'"
-$   goto loop
-$ endif
-$ if f$locate("IDENTIFICATION=",f$edit(line,"upcase")) .lt. f$length(line)
-$ then
-$   write sys$output "ANAL_OBJ_AXP-i-ident: Identification ", -
-                     f$element(1,"=",line)
-$   goto loop
-$ endif
-$ f= f$search(line)
-$ if f .eqs. ""
-$ then
-$	write sys$output "ANAL_OBJ_AXP-w-nosuchfile, ''line'"
-$	goto loop
-$ endif
-$ define/user sys$output nl:
-$ define/user sys$error nl:
-$ anal/obj/gsd 'f /out=x.tmp
-$ open/read xtmp x.tmp
-$ XLOOP:
-$ read/end=end_xloop xtmp xline
-$ xline = f$edit(xline,"compress")
-$ write atmp xline
-$ goto xloop
-$ END_XLOOP:
-$ close xtmp
-$ goto loop
-$ end_loop:
-$ close in
-$ close atmp
-$ if f$search("a.tmp") .eqs. "" -
-	then $ exit
-$ ! all global definitions
-$ search a.tmp "symbol:","EGSY$V_DEF 1","EGSY$V_NORM 1"/out=b.tmp
-$ ! all procedures
-$ search b.tmp "EGSY$V_NORM 1"/wind=(0,1) /out=c.tmp
-$ search c.tmp "symbol:"/out=d.tmp
-$ define/user sys$output nl:
-$ edito/edt/command=sys$input d.tmp
-sub/symbol: "/symbol_vector=(/whole
-sub/"/=PROCEDURE)/whole
-exit
-$ ! all data
-$ search b.tmp "EGSY$V_DEF 1"/wind=(0,1) /out=e.tmp
-$ search e.tmp "symbol:"/out=f.tmp
-$ define/user sys$output nl:
-$ edito/edt/command=sys$input f.tmp
-sub/symbol: "/symbol_vector=(/whole
-sub/"/=DATA)/whole
-exit
-$ sort/nodupl d.tmp,f.tmp g.tmp
-$ open/read raw_vector g.tmp
-$ open/write case_vector 'p2'
-$ RAWLOOP:
-$ read/end=end_rawloop raw_vector raw_element
-$ write case_vector raw_element
-$ if f$locate("=PROCEDURE)",raw_element) .lt. f$length(raw_element)
-$ then
-$     name = f$element(1,"=",raw_element) - "("
-$     if f$edit(name,"UPCASE") .nes. name then -
-          write case_vector f$fao(" symbol_vector=(!AS/!AS=PROCEDURE)", -
-	                          f$edit(name,"UPCASE"), name)
-$ endif
-$ if f$locate("=DATA)",raw_element) .lt. f$length(raw_element)
-$ then
-$     name = f$element(1,"=",raw_element) - "("
-$     if f$edit(name,"UPCASE") .nes. name then -
-          write case_vector f$fao(" symbol_vector=(!AS/!AS=DATA)", -
-	                          f$edit(name,"UPCASE"), name)
-$ endif
-$ goto rawloop
-$ END_RAWLOOP:
-$ close raw_vector
-$ close case_vector
-$ delete a.tmp;*,b.tmp;*,c.tmp;*,d.tmp;*,e.tmp;*,f.tmp;*,g.tmp;*
-$ if f$search("x.tmp") .nes. "" -
-	then $ delete x.tmp;*
-$!
-$ EXIT_AA:
-$ if V then set verify
-$ endsubroutine
-$!------------------------------------------------------------------------------
-$!
 $! Write configuration to both permanent and temporary config file
 $!
 $! Version history
@@ -802,3 +715,153 @@
 $  close confh
 $ENDSUBROUTINE
 $!------------------------------------------------------------------------------
+$!
+$! Analyze the project map file and create the symbol vector for a shareable
+$! image from it
+$!
+$! Version history
+$! 0.01 20120128 First version
+$! 0.02 20120226 Add pre-load logic
+$!
+$ MAP_2_SHOPT: Subroutine
+$!
+$ SAY := "WRITE_ SYS$OUTPUT"
+$!
+$ IF F$SEARCH("''P1'") .EQS. ""
+$ THEN
+$    SAY "MAP_2_SHOPT-E-NOSUCHFILE:  Error, inputfile ''p1' not available"
+$    goto exit_m2s
+$ ENDIF
+$ IF "''P2'" .EQS. ""
+$ THEN
+$    SAY "MAP_2_SHOPT:  Error, no output file provided"
+$    goto exit_m2s
+$ ENDIF
+$!
+$ module1 = "deflate#deflateEnd#deflateInit_#deflateParams#deflateSetDictionary"
+$ module2 = "gzclose#gzerror#gzgetc#gzgets#gzopen#gzprintf#gzputc#gzputs#gzread"
+$ module3 = "gzseek#gztell#inflate#inflateEnd#inflateInit_#inflateSetDictionary"
+$ module4 = "inflateSync#uncompress#zlibVersion#compress"
+$ open/read map 'p1
+$ if axp .or. ia64
+$ then
+$     open/write aopt a.opt
+$     open/write bopt b.opt
+$     write aopt " CASE_SENSITIVE=YES"
+$     write bopt "SYMBOL_VECTOR= (-"
+$     mod_sym_num = 1
+$ MOD_SYM_LOOP:
+$     if f$type(module'mod_sym_num') .nes. ""
+$     then
+$         mod_in = 0
+$ MOD_SYM_IN:
+$         shared_proc = f$element(mod_in, "#", module'mod_sym_num')
+$         if shared_proc .nes. "#"
+$         then
+$             write aopt f$fao(" symbol_vector=(!AS/!AS=PROCEDURE)",-
+        		       f$edit(shared_proc,"upcase"),shared_proc)
+$             write bopt f$fao("!AS=PROCEDURE,-",shared_proc)
+$             mod_in = mod_in + 1
+$             goto mod_sym_in
+$         endif
+$         mod_sym_num = mod_sym_num + 1
+$         goto mod_sym_loop
+$     endif
+$MAP_LOOP:
+$     read/end=map_end map line
+$     if (f$locate("{",line).lt. f$length(line)) .or. -
+         (f$locate("global:", line) .lt. f$length(line))
+$     then
+$         proc = true
+$         goto map_loop
+$     endif
+$     if f$locate("}",line).lt. f$length(line) then proc = false
+$     if f$locate("local:", line) .lt. f$length(line) then proc = false
+$     if proc
+$     then
+$         shared_proc = f$edit(line,"collapse")
+$         chop_semi = f$locate(";", shared_proc)
+$         if chop_semi .lt. f$length(shared_proc) then -
+              shared_proc = f$extract(0, chop_semi, shared_proc)
+$         write aopt f$fao(" symbol_vector=(!AS/!AS=PROCEDURE)",-
+        			 f$edit(shared_proc,"upcase"),shared_proc)
+$         write bopt f$fao("!AS=PROCEDURE,-",shared_proc)
+$     endif
+$     goto map_loop
+$MAP_END:
+$     close/nolog aopt
+$     close/nolog bopt
+$     open/append libopt 'p2'
+$     open/read aopt a.opt
+$     open/read bopt b.opt
+$ALOOP:
+$     read/end=aloop_end aopt line
+$     write libopt line
+$     goto aloop
+$ALOOP_END:
+$     close/nolog aopt
+$     sv = ""
+$BLOOP:
+$     read/end=bloop_end bopt svn
+$     if (svn.nes."")
+$     then
+$        if (sv.nes."") then write libopt sv
+$        sv = svn
+$     endif
+$     goto bloop
+$BLOOP_END:
+$     write libopt f$extract(0,f$length(sv)-2,sv), "-"
+$     write libopt ")"
+$     close/nolog bopt
+$     delete/nolog/noconf a.opt;*,b.opt;*
+$ else
+$     if vax
+$     then
+$     open/append libopt 'p2'
+$     mod_sym_num = 1
+$ VMOD_SYM_LOOP:
+$     if f$type(module'mod_sym_num') .nes. ""
+$     then
+$         mod_in = 0
+$ VMOD_SYM_IN:
+$         shared_proc = f$element(mod_in, "#", module'mod_sym_num')
+$         if shared_proc .nes. "#"
+$         then
+$     	      write libopt f$fao("UNIVERSAL=!AS",-
+      	  			     f$edit(shared_proc,"upcase"))
+$             mod_in = mod_in + 1
+$             goto vmod_sym_in
+$         endif
+$         mod_sym_num = mod_sym_num + 1
+$         goto vmod_sym_loop
+$     endif
+$VMAP_LOOP:
+$     	  read/end=vmap_end map line
+$     	  if (f$locate("{",line).lt. f$length(line)) .or. -
+   	      (f$locate("global:", line) .lt. f$length(line))
+$     	  then
+$     	      proc = true
+$     	      goto vmap_loop
+$     	  endif
+$     	  if f$locate("}",line).lt. f$length(line) then proc = false
+$     	  if f$locate("local:", line) .lt. f$length(line) then proc = false
+$     	  if proc
+$     	  then
+$     	      shared_proc = f$edit(line,"collapse")
+$     	      chop_semi = f$locate(";", shared_proc)
+$     	      if chop_semi .lt. f$length(shared_proc) then -
+      	  	  shared_proc = f$extract(0, chop_semi, shared_proc)
+$     	      write libopt f$fao("UNIVERSAL=!AS",-
+      	  			     f$edit(shared_proc,"upcase"))
+$     	  endif
+$     	  goto vmap_loop
+$VMAP_END:
+$     else
+$         write sys$output "Unknown Architecture (Not VAX, AXP, or IA64)"
+$         write sys$output "No options file created"
+$     endif
+$ endif
+$ EXIT_M2S:
+$ close/nolog map
+$ close/nolog libopt
+$ endsubroutine
diff --git a/Modules/zlib/minigzip.c b/Modules/zlib/minigzip.c
index 9825ccc..b3025a4 100644
--- a/Modules/zlib/minigzip.c
+++ b/Modules/zlib/minigzip.c
@@ -1,5 +1,5 @@
 /* minigzip.c -- simulate gzip using the zlib compression library
- * Copyright (C) 1995-2006, 2010 Jean-loup Gailly.
+ * Copyright (C) 1995-2006, 2010, 2011 Jean-loup Gailly.
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -40,6 +40,10 @@
 #  define SET_BINARY_MODE(file)
 #endif
 
+#ifdef _MSC_VER
+#  define snprintf _snprintf
+#endif
+
 #ifdef VMS
 #  define unlink delete
 #  define GZ_SUFFIX "-gz"
@@ -138,6 +142,197 @@
 #  define local
 #endif
 
+#ifdef Z_SOLO
+/* for Z_SOLO, create simplified gz* functions using deflate and inflate */
+
+#if defined(Z_HAVE_UNISTD_H) || defined(Z_LARGE)
+#  include <unistd.h>       /* for unlink() */
+#endif
+
+void *myalloc OF((void *, unsigned, unsigned));
+void myfree OF((void *, void *));
+
+void *myalloc(q, n, m)
+    void *q;
+    unsigned n, m;
+{
+    q = Z_NULL;
+    return calloc(n, m);
+}
+
+void myfree(q, p)
+    void *q, *p;
+{
+    q = Z_NULL;
+    free(p);
+}
+
+typedef struct gzFile_s {
+    FILE *file;
+    int write;
+    int err;
+    char *msg;
+    z_stream strm;
+} *gzFile;
+
+gzFile gzopen OF((const char *, const char *));
+gzFile gzdopen OF((int, const char *));
+gzFile gz_open OF((const char *, int, const char *));
+
+gzFile gzopen(path, mode)
+const char *path;
+const char *mode;
+{
+    return gz_open(path, -1, mode);
+}
+
+gzFile gzdopen(fd, mode)
+int fd;
+const char *mode;
+{
+    return gz_open(NULL, fd, mode);
+}
+
+gzFile gz_open(path, fd, mode)
+    const char *path;
+    int fd;
+    const char *mode;
+{
+    gzFile gz;
+    int ret;
+
+    gz = malloc(sizeof(struct gzFile_s));
+    if (gz == NULL)
+        return NULL;
+    gz->write = strchr(mode, 'w') != NULL;
+    gz->strm.zalloc = myalloc;
+    gz->strm.zfree = myfree;
+    gz->strm.opaque = Z_NULL;
+    if (gz->write)
+        ret = deflateInit2(&(gz->strm), -1, 8, 15 + 16, 8, 0);
+    else {
+        gz->strm.next_in = 0;
+        gz->strm.avail_in = Z_NULL;
+        ret = inflateInit2(&(gz->strm), 15 + 16);
+    }
+    if (ret != Z_OK) {
+        free(gz);
+        return NULL;
+    }
+    gz->file = path == NULL ? fdopen(fd, gz->write ? "wb" : "rb") :
+                              fopen(path, gz->write ? "wb" : "rb");
+    if (gz->file == NULL) {
+        gz->write ? deflateEnd(&(gz->strm)) : inflateEnd(&(gz->strm));
+        free(gz);
+        return NULL;
+    }
+    gz->err = 0;
+    gz->msg = "";
+    return gz;
+}
+
+int gzwrite OF((gzFile, const void *, unsigned));
+
+int gzwrite(gz, buf, len)
+    gzFile gz;
+    const void *buf;
+    unsigned len;
+{
+    z_stream *strm;
+    unsigned char out[BUFLEN];
+
+    if (gz == NULL || !gz->write)
+        return 0;
+    strm = &(gz->strm);
+    strm->next_in = (void *)buf;
+    strm->avail_in = len;
+    do {
+        strm->next_out = out;
+        strm->avail_out = BUFLEN;
+        (void)deflate(strm, Z_NO_FLUSH);
+        fwrite(out, 1, BUFLEN - strm->avail_out, gz->file);
+    } while (strm->avail_out == 0);
+    return len;
+}
+
+int gzread OF((gzFile, void *, unsigned));
+
+int gzread(gz, buf, len)
+    gzFile gz;
+    void *buf;
+    unsigned len;
+{
+    int ret;
+    unsigned got;
+    unsigned char in[1];
+    z_stream *strm;
+
+    if (gz == NULL || gz->write)
+        return 0;
+    if (gz->err)
+        return 0;
+    strm = &(gz->strm);
+    strm->next_out = (void *)buf;
+    strm->avail_out = len;
+    do {
+        got = fread(in, 1, 1, gz->file);
+        if (got == 0)
+            break;
+        strm->next_in = in;
+        strm->avail_in = 1;
+        ret = inflate(strm, Z_NO_FLUSH);
+        if (ret == Z_DATA_ERROR) {
+            gz->err = Z_DATA_ERROR;
+            gz->msg = strm->msg;
+            return 0;
+        }
+        if (ret == Z_STREAM_END)
+            inflateReset(strm);
+    } while (strm->avail_out);
+    return len - strm->avail_out;
+}
+
+int gzclose OF((gzFile));
+
+int gzclose(gz)
+    gzFile gz;
+{
+    z_stream *strm;
+    unsigned char out[BUFLEN];
+
+    if (gz == NULL)
+        return Z_STREAM_ERROR;
+    strm = &(gz->strm);
+    if (gz->write) {
+        strm->next_in = Z_NULL;
+        strm->avail_in = 0;
+        do {
+            strm->next_out = out;
+            strm->avail_out = BUFLEN;
+            (void)deflate(strm, Z_FINISH);
+            fwrite(out, 1, BUFLEN - strm->avail_out, gz->file);
+        } while (strm->avail_out == 0);
+        deflateEnd(strm);
+    }
+    else
+        inflateEnd(strm);
+    fclose(gz->file);
+    free(gz);
+    return Z_OK;
+}
+
+const char *gzerror OF((gzFile, int *));
+
+const char *gzerror(gz, err)
+    gzFile gz;
+    int *err;
+{
+    *err = gz->err;
+    return gz->msg;
+}
+
+#endif
+
 char *prog;
 
 void error            OF((const char *msg));
@@ -272,8 +467,12 @@
         exit(1);
     }
 
+#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
+    snprintf(outfile, sizeof(outfile), "%s%s", file, GZ_SUFFIX);
+#else
     strcpy(outfile, file);
     strcat(outfile, GZ_SUFFIX);
+#endif
 
     in = fopen(file, "rb");
     if (in == NULL) {
@@ -308,7 +507,11 @@
         exit(1);
     }
 
+#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
+    snprintf(buf, sizeof(buf), "%s", file);
+#else
     strcpy(buf, file);
+#endif
 
     if (len > SUFFIX_LEN && strcmp(file+len-SUFFIX_LEN, GZ_SUFFIX) == 0) {
         infile = file;
@@ -317,7 +520,11 @@
     } else {
         outfile = file;
         infile = buf;
+#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
+        snprintf(buf + len, sizeof(buf) - len, "%s", GZ_SUFFIX);
+#else
         strcat(infile, GZ_SUFFIX);
+#endif
     }
     in = gzopen(infile, "rb");
     if (in == NULL) {
@@ -355,7 +562,11 @@
     gzFile file;
     char *bname, outmode[20];
 
+#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
+    snprintf(outmode, sizeof(outmode), "%s", "wb6 ");
+#else
     strcpy(outmode, "wb6 ");
+#endif
 
     prog = argv[0];
     bname = strrchr(argv[0], '/');
diff --git a/Modules/zlib/trees.c b/Modules/zlib/trees.c
index 56e9bb1..1fd7759 100644
--- a/Modules/zlib/trees.c
+++ b/Modules/zlib/trees.c
@@ -1,5 +1,5 @@
 /* trees.c -- output deflated data using Huffman coding
- * Copyright (C) 1995-2010 Jean-loup Gailly
+ * Copyright (C) 1995-2012 Jean-loup Gailly
  * detect_data_type() function provided freely by Cosmin Truta, 2006
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
@@ -74,11 +74,6 @@
  * probability, to avoid transmitting the lengths for unused bit length codes.
  */
 
-#define Buf_size (8 * 2*sizeof(char))
-/* Number of bits used within bi_buf. (bi_buf might be implemented on
- * more than 16 bits on some systems.)
- */
-
 /* ===========================================================================
  * Local data. These are initialized only once.
  */
@@ -151,8 +146,8 @@
 local int  build_bl_tree  OF((deflate_state *s));
 local void send_all_trees OF((deflate_state *s, int lcodes, int dcodes,
                               int blcodes));
-local void compress_block OF((deflate_state *s, ct_data *ltree,
-                              ct_data *dtree));
+local void compress_block OF((deflate_state *s, const ct_data *ltree,
+                              const ct_data *dtree));
 local int  detect_data_type OF((deflate_state *s));
 local unsigned bi_reverse OF((unsigned value, int length));
 local void bi_windup      OF((deflate_state *s));
@@ -399,7 +394,6 @@
 
     s->bi_buf = 0;
     s->bi_valid = 0;
-    s->last_eob_len = 8; /* enough lookahead for inflate */
 #ifdef DEBUG
     s->compressed_len = 0L;
     s->bits_sent = 0L;
@@ -883,15 +877,17 @@
 }
 
 /* ===========================================================================
+ * Flush the bits in the bit buffer to pending output (leaves at most 7 bits)
+ */
+void ZLIB_INTERNAL _tr_flush_bits(s)
+    deflate_state *s;
+{
+    bi_flush(s);
+}
+
+/* ===========================================================================
  * Send one empty static block to give enough lookahead for inflate.
  * This takes 10 bits, of which 7 may remain in the bit buffer.
- * The current inflate code requires 9 bits of lookahead. If the
- * last two codes for the previous block (real code plus EOB) were coded
- * on 5 bits or less, inflate may have only 5+3 bits of lookahead to decode
- * the last real code. In this case we send two empty static blocks instead
- * of one. (There are no problems if the previous block is stored or fixed.)
- * To simplify the code, we assume the worst case of last real code encoded
- * on one bit only.
  */
 void ZLIB_INTERNAL _tr_align(s)
     deflate_state *s;
@@ -902,20 +898,6 @@
     s->compressed_len += 10L; /* 3 for block type, 7 for EOB */
 #endif
     bi_flush(s);
-    /* Of the 10 bits for the empty block, we have already sent
-     * (10 - bi_valid) bits. The lookahead for the last real code (before
-     * the EOB of the previous block) was thus at least one plus the length
-     * of the EOB plus what we have just sent of the empty static block.
-     */
-    if (1 + s->last_eob_len + 10 - s->bi_valid < 9) {
-        send_bits(s, STATIC_TREES<<1, 3);
-        send_code(s, END_BLOCK, static_ltree);
-#ifdef DEBUG
-        s->compressed_len += 10L;
-#endif
-        bi_flush(s);
-    }
-    s->last_eob_len = 7;
 }
 
 /* ===========================================================================
@@ -990,7 +972,8 @@
     } else if (s->strategy == Z_FIXED || static_lenb == opt_lenb) {
 #endif
         send_bits(s, (STATIC_TREES<<1)+last, 3);
-        compress_block(s, (ct_data *)static_ltree, (ct_data *)static_dtree);
+        compress_block(s, (const ct_data *)static_ltree,
+                       (const ct_data *)static_dtree);
 #ifdef DEBUG
         s->compressed_len += 3 + s->static_len;
 #endif
@@ -998,7 +981,8 @@
         send_bits(s, (DYN_TREES<<1)+last, 3);
         send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1,
                        max_blindex+1);
-        compress_block(s, (ct_data *)s->dyn_ltree, (ct_data *)s->dyn_dtree);
+        compress_block(s, (const ct_data *)s->dyn_ltree,
+                       (const ct_data *)s->dyn_dtree);
 #ifdef DEBUG
         s->compressed_len += 3 + s->opt_len;
 #endif
@@ -1075,8 +1059,8 @@
  */
 local void compress_block(s, ltree, dtree)
     deflate_state *s;
-    ct_data *ltree; /* literal tree */
-    ct_data *dtree; /* distance tree */
+    const ct_data *ltree; /* literal tree */
+    const ct_data *dtree; /* distance tree */
 {
     unsigned dist;      /* distance of matched string */
     int lc;             /* match length or unmatched char (if dist == 0) */
@@ -1118,7 +1102,6 @@
     } while (lx < s->last_lit);
 
     send_code(s, END_BLOCK, ltree);
-    s->last_eob_len = ltree[END_BLOCK].Len;
 }
 
 /* ===========================================================================
@@ -1226,7 +1209,6 @@
     int      header;  /* true if block header must be written */
 {
     bi_windup(s);        /* align on byte boundary */
-    s->last_eob_len = 8; /* enough lookahead for inflate */
 
     if (header) {
         put_short(s, (ush)len);
diff --git a/Modules/zlib/uncompr.c b/Modules/zlib/uncompr.c
index ad98be3..242e949 100644
--- a/Modules/zlib/uncompr.c
+++ b/Modules/zlib/uncompr.c
@@ -30,7 +30,7 @@
     z_stream stream;
     int err;
 
-    stream.next_in = (Bytef*)source;
+    stream.next_in = (z_const Bytef *)source;
     stream.avail_in = (uInt)sourceLen;
     /* Check for source > 64K on 16-bit machine: */
     if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
diff --git a/Modules/zlib/zconf.h b/Modules/zlib/zconf.h
index 02ce56c..9987a77 100644
--- a/Modules/zlib/zconf.h
+++ b/Modules/zlib/zconf.h
@@ -1,5 +1,5 @@
 /* zconf.h -- configuration of the zlib compression library
- * Copyright (C) 1995-2010 Jean-loup Gailly.
+ * Copyright (C) 1995-2013 Jean-loup Gailly.
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -15,11 +15,13 @@
  * this permanently in zconf.h using "./configure --zprefix".
  */
 #ifdef Z_PREFIX     /* may be set to #if 1 by ./configure */
+#  define Z_PREFIX_SET
 
 /* all linked symbols */
 #  define _dist_code            z__dist_code
 #  define _length_code          z__length_code
 #  define _tr_align             z__tr_align
+#  define _tr_flush_bits        z__tr_flush_bits
 #  define _tr_flush_block       z__tr_flush_block
 #  define _tr_init              z__tr_init
 #  define _tr_stored_block      z__tr_stored_block
@@ -27,9 +29,11 @@
 #  define adler32               z_adler32
 #  define adler32_combine       z_adler32_combine
 #  define adler32_combine64     z_adler32_combine64
-#  define compress              z_compress
-#  define compress2             z_compress2
-#  define compressBound         z_compressBound
+#  ifndef Z_SOLO
+#    define compress              z_compress
+#    define compress2             z_compress2
+#    define compressBound         z_compressBound
+#  endif
 #  define crc32                 z_crc32
 #  define crc32_combine         z_crc32_combine
 #  define crc32_combine64       z_crc32_combine64
@@ -40,44 +44,53 @@
 #  define deflateInit2_         z_deflateInit2_
 #  define deflateInit_          z_deflateInit_
 #  define deflateParams         z_deflateParams
+#  define deflatePending        z_deflatePending
 #  define deflatePrime          z_deflatePrime
 #  define deflateReset          z_deflateReset
+#  define deflateResetKeep      z_deflateResetKeep
 #  define deflateSetDictionary  z_deflateSetDictionary
 #  define deflateSetHeader      z_deflateSetHeader
 #  define deflateTune           z_deflateTune
 #  define deflate_copyright     z_deflate_copyright
 #  define get_crc_table         z_get_crc_table
-#  define gz_error              z_gz_error
-#  define gz_intmax             z_gz_intmax
-#  define gz_strwinerror        z_gz_strwinerror
-#  define gzbuffer              z_gzbuffer
-#  define gzclearerr            z_gzclearerr
-#  define gzclose               z_gzclose
-#  define gzclose_r             z_gzclose_r
-#  define gzclose_w             z_gzclose_w
-#  define gzdirect              z_gzdirect
-#  define gzdopen               z_gzdopen
-#  define gzeof                 z_gzeof
-#  define gzerror               z_gzerror
-#  define gzflush               z_gzflush
-#  define gzgetc                z_gzgetc
-#  define gzgets                z_gzgets
-#  define gzoffset              z_gzoffset
-#  define gzoffset64            z_gzoffset64
-#  define gzopen                z_gzopen
-#  define gzopen64              z_gzopen64
-#  define gzprintf              z_gzprintf
-#  define gzputc                z_gzputc
-#  define gzputs                z_gzputs
-#  define gzread                z_gzread
-#  define gzrewind              z_gzrewind
-#  define gzseek                z_gzseek
-#  define gzseek64              z_gzseek64
-#  define gzsetparams           z_gzsetparams
-#  define gztell                z_gztell
-#  define gztell64              z_gztell64
-#  define gzungetc              z_gzungetc
-#  define gzwrite               z_gzwrite
+#  ifndef Z_SOLO
+#    define gz_error              z_gz_error
+#    define gz_intmax             z_gz_intmax
+#    define gz_strwinerror        z_gz_strwinerror
+#    define gzbuffer              z_gzbuffer
+#    define gzclearerr            z_gzclearerr
+#    define gzclose               z_gzclose
+#    define gzclose_r             z_gzclose_r
+#    define gzclose_w             z_gzclose_w
+#    define gzdirect              z_gzdirect
+#    define gzdopen               z_gzdopen
+#    define gzeof                 z_gzeof
+#    define gzerror               z_gzerror
+#    define gzflush               z_gzflush
+#    define gzgetc                z_gzgetc
+#    define gzgetc_               z_gzgetc_
+#    define gzgets                z_gzgets
+#    define gzoffset              z_gzoffset
+#    define gzoffset64            z_gzoffset64
+#    define gzopen                z_gzopen
+#    define gzopen64              z_gzopen64
+#    ifdef _WIN32
+#      define gzopen_w              z_gzopen_w
+#    endif
+#    define gzprintf              z_gzprintf
+#    define gzvprintf             z_gzvprintf
+#    define gzputc                z_gzputc
+#    define gzputs                z_gzputs
+#    define gzread                z_gzread
+#    define gzrewind              z_gzrewind
+#    define gzseek                z_gzseek
+#    define gzseek64              z_gzseek64
+#    define gzsetparams           z_gzsetparams
+#    define gztell                z_gztell
+#    define gztell64              z_gztell64
+#    define gzungetc              z_gzungetc
+#    define gzwrite               z_gzwrite
+#  endif
 #  define inflate               z_inflate
 #  define inflateBack           z_inflateBack
 #  define inflateBackEnd        z_inflateBackEnd
@@ -92,16 +105,22 @@
 #  define inflateReset          z_inflateReset
 #  define inflateReset2         z_inflateReset2
 #  define inflateSetDictionary  z_inflateSetDictionary
+#  define inflateGetDictionary  z_inflateGetDictionary
 #  define inflateSync           z_inflateSync
 #  define inflateSyncPoint      z_inflateSyncPoint
 #  define inflateUndermine      z_inflateUndermine
+#  define inflateResetKeep      z_inflateResetKeep
 #  define inflate_copyright     z_inflate_copyright
 #  define inflate_fast          z_inflate_fast
 #  define inflate_table         z_inflate_table
-#  define uncompress            z_uncompress
+#  ifndef Z_SOLO
+#    define uncompress            z_uncompress
+#  endif
 #  define zError                z_zError
-#  define zcalloc               z_zcalloc
-#  define zcfree                z_zcfree
+#  ifndef Z_SOLO
+#    define zcalloc               z_zcalloc
+#    define zcfree                z_zcfree
+#  endif
 #  define zlibCompileFlags      z_zlibCompileFlags
 #  define zlibVersion           z_zlibVersion
 
@@ -111,7 +130,9 @@
 #  define alloc_func            z_alloc_func
 #  define charf                 z_charf
 #  define free_func             z_free_func
-#  define gzFile                z_gzFile
+#  ifndef Z_SOLO
+#    define gzFile                z_gzFile
+#  endif
 #  define gz_header             z_gz_header
 #  define gz_headerp            z_gz_headerp
 #  define in_func               z_in_func
@@ -197,6 +218,12 @@
 #  endif
 #endif
 
+#if defined(ZLIB_CONST) && !defined(z_const)
+#  define z_const const
+#else
+#  define z_const
+#endif
+
 /* Some Mac compilers merge all .h files incorrectly: */
 #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
 #  define NO_DUMMY_DECL
@@ -243,6 +270,14 @@
 #  endif
 #endif
 
+#ifndef Z_ARG /* function prototypes for stdarg */
+#  if defined(STDC) || defined(Z_HAVE_STDARG_H)
+#    define Z_ARG(args)  args
+#  else
+#    define Z_ARG(args)  ()
+#  endif
+#endif
+
 /* The following definitions for FAR are needed only for MSDOS mixed
  * model programming (small or medium model with some far allocations).
  * This was tested only with MSC; for other MSDOS compilers you may have
@@ -356,12 +391,47 @@
    typedef Byte       *voidp;
 #endif
 
+#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
+#  include <limits.h>
+#  if (UINT_MAX == 0xffffffffUL)
+#    define Z_U4 unsigned
+#  elif (ULONG_MAX == 0xffffffffUL)
+#    define Z_U4 unsigned long
+#  elif (USHRT_MAX == 0xffffffffUL)
+#    define Z_U4 unsigned short
+#  endif
+#endif
+
+#ifdef Z_U4
+   typedef Z_U4 z_crc_t;
+#else
+   typedef unsigned long z_crc_t;
+#endif
+
 #ifdef HAVE_UNISTD_H    /* may be set to #if 1 by ./configure */
 #  define Z_HAVE_UNISTD_H
 #endif
 
+#ifdef HAVE_STDARG_H    /* may be set to #if 1 by ./configure */
+#  define Z_HAVE_STDARG_H
+#endif
+
 #ifdef STDC
-#  include <sys/types.h>    /* for off_t */
+#  ifndef Z_SOLO
+#    include <sys/types.h>      /* for off_t */
+#  endif
+#endif
+
+#if defined(STDC) || defined(Z_HAVE_STDARG_H)
+#  ifndef Z_SOLO
+#    include <stdarg.h>         /* for va_list */
+#  endif
+#endif
+
+#ifdef _WIN32
+#  ifndef Z_SOLO
+#    include <stddef.h>         /* for wchar_t */
+#  endif
 #endif
 
 /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
@@ -370,21 +440,38 @@
  * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
  * equivalently requesting no 64-bit operations
  */
-#if -_LARGEFILE64_SOURCE - -1 == 1
+#if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
 #  undef _LARGEFILE64_SOURCE
 #endif
 
-#if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
-#  include <unistd.h>       /* for SEEK_* and off_t */
-#  ifdef VMS
-#    include <unixio.h>     /* for off_t */
-#  endif
-#  ifndef z_off_t
-#    define z_off_t off_t
+#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
+#  define Z_HAVE_UNISTD_H
+#endif
+#ifndef Z_SOLO
+#  if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
+#    include <unistd.h>         /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
+#    ifdef VMS
+#      include <unixio.h>       /* for off_t */
+#    endif
+#    ifndef z_off_t
+#      define z_off_t off_t
+#    endif
 #  endif
 #endif
 
-#ifndef SEEK_SET
+#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
+#  define Z_LFS64
+#endif
+
+#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
+#  define Z_LARGE64
+#endif
+
+#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
+#  define Z_WANT64
+#endif
+
+#if !defined(SEEK_SET) && !defined(Z_SOLO)
 #  define SEEK_SET        0       /* Seek from beginning of file.  */
 #  define SEEK_CUR        1       /* Seek from current position.  */
 #  define SEEK_END        2       /* Set file pointer to EOF plus "offset" */
@@ -394,18 +481,14 @@
 #  define z_off_t long
 #endif
 
-#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
+#if !defined(_WIN32) && defined(Z_LARGE64)
 #  define z_off64_t off64_t
 #else
-#  define z_off64_t z_off_t
-#endif
-
-#if defined(__OS400__)
-#  define NO_vsnprintf
-#endif
-
-#if defined(__MVS__)
-#  define NO_vsnprintf
+#  if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
+#    define z_off64_t __int64
+#  else
+#    define z_off64_t z_off_t
+#  endif
 #endif
 
 /* MVS linker does not support external names larger than 8 bytes */
diff --git a/Modules/zlib/zconf.h.cmakein b/Modules/zlib/zconf.h.cmakein
index a2f71b1..043019c 100644
--- a/Modules/zlib/zconf.h.cmakein
+++ b/Modules/zlib/zconf.h.cmakein
@@ -1,5 +1,5 @@
 /* zconf.h -- configuration of the zlib compression library
- * Copyright (C) 1995-2010 Jean-loup Gailly.
+ * Copyright (C) 1995-2013 Jean-loup Gailly.
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -17,11 +17,13 @@
  * this permanently in zconf.h using "./configure --zprefix".
  */
 #ifdef Z_PREFIX     /* may be set to #if 1 by ./configure */
+#  define Z_PREFIX_SET
 
 /* all linked symbols */
 #  define _dist_code            z__dist_code
 #  define _length_code          z__length_code
 #  define _tr_align             z__tr_align
+#  define _tr_flush_bits        z__tr_flush_bits
 #  define _tr_flush_block       z__tr_flush_block
 #  define _tr_init              z__tr_init
 #  define _tr_stored_block      z__tr_stored_block
@@ -29,9 +31,11 @@
 #  define adler32               z_adler32
 #  define adler32_combine       z_adler32_combine
 #  define adler32_combine64     z_adler32_combine64
-#  define compress              z_compress
-#  define compress2             z_compress2
-#  define compressBound         z_compressBound
+#  ifndef Z_SOLO
+#    define compress              z_compress
+#    define compress2             z_compress2
+#    define compressBound         z_compressBound
+#  endif
 #  define crc32                 z_crc32
 #  define crc32_combine         z_crc32_combine
 #  define crc32_combine64       z_crc32_combine64
@@ -42,44 +46,53 @@
 #  define deflateInit2_         z_deflateInit2_
 #  define deflateInit_          z_deflateInit_
 #  define deflateParams         z_deflateParams
+#  define deflatePending        z_deflatePending
 #  define deflatePrime          z_deflatePrime
 #  define deflateReset          z_deflateReset
+#  define deflateResetKeep      z_deflateResetKeep
 #  define deflateSetDictionary  z_deflateSetDictionary
 #  define deflateSetHeader      z_deflateSetHeader
 #  define deflateTune           z_deflateTune
 #  define deflate_copyright     z_deflate_copyright
 #  define get_crc_table         z_get_crc_table
-#  define gz_error              z_gz_error
-#  define gz_intmax             z_gz_intmax
-#  define gz_strwinerror        z_gz_strwinerror
-#  define gzbuffer              z_gzbuffer
-#  define gzclearerr            z_gzclearerr
-#  define gzclose               z_gzclose
-#  define gzclose_r             z_gzclose_r
-#  define gzclose_w             z_gzclose_w
-#  define gzdirect              z_gzdirect
-#  define gzdopen               z_gzdopen
-#  define gzeof                 z_gzeof
-#  define gzerror               z_gzerror
-#  define gzflush               z_gzflush
-#  define gzgetc                z_gzgetc
-#  define gzgets                z_gzgets
-#  define gzoffset              z_gzoffset
-#  define gzoffset64            z_gzoffset64
-#  define gzopen                z_gzopen
-#  define gzopen64              z_gzopen64
-#  define gzprintf              z_gzprintf
-#  define gzputc                z_gzputc
-#  define gzputs                z_gzputs
-#  define gzread                z_gzread
-#  define gzrewind              z_gzrewind
-#  define gzseek                z_gzseek
-#  define gzseek64              z_gzseek64
-#  define gzsetparams           z_gzsetparams
-#  define gztell                z_gztell
-#  define gztell64              z_gztell64
-#  define gzungetc              z_gzungetc
-#  define gzwrite               z_gzwrite
+#  ifndef Z_SOLO
+#    define gz_error              z_gz_error
+#    define gz_intmax             z_gz_intmax
+#    define gz_strwinerror        z_gz_strwinerror
+#    define gzbuffer              z_gzbuffer
+#    define gzclearerr            z_gzclearerr
+#    define gzclose               z_gzclose
+#    define gzclose_r             z_gzclose_r
+#    define gzclose_w             z_gzclose_w
+#    define gzdirect              z_gzdirect
+#    define gzdopen               z_gzdopen
+#    define gzeof                 z_gzeof
+#    define gzerror               z_gzerror
+#    define gzflush               z_gzflush
+#    define gzgetc                z_gzgetc
+#    define gzgetc_               z_gzgetc_
+#    define gzgets                z_gzgets
+#    define gzoffset              z_gzoffset
+#    define gzoffset64            z_gzoffset64
+#    define gzopen                z_gzopen
+#    define gzopen64              z_gzopen64
+#    ifdef _WIN32
+#      define gzopen_w              z_gzopen_w
+#    endif
+#    define gzprintf              z_gzprintf
+#    define gzvprintf             z_gzvprintf
+#    define gzputc                z_gzputc
+#    define gzputs                z_gzputs
+#    define gzread                z_gzread
+#    define gzrewind              z_gzrewind
+#    define gzseek                z_gzseek
+#    define gzseek64              z_gzseek64
+#    define gzsetparams           z_gzsetparams
+#    define gztell                z_gztell
+#    define gztell64              z_gztell64
+#    define gzungetc              z_gzungetc
+#    define gzwrite               z_gzwrite
+#  endif
 #  define inflate               z_inflate
 #  define inflateBack           z_inflateBack
 #  define inflateBackEnd        z_inflateBackEnd
@@ -94,16 +107,22 @@
 #  define inflateReset          z_inflateReset
 #  define inflateReset2         z_inflateReset2
 #  define inflateSetDictionary  z_inflateSetDictionary
+#  define inflateGetDictionary  z_inflateGetDictionary
 #  define inflateSync           z_inflateSync
 #  define inflateSyncPoint      z_inflateSyncPoint
 #  define inflateUndermine      z_inflateUndermine
+#  define inflateResetKeep      z_inflateResetKeep
 #  define inflate_copyright     z_inflate_copyright
 #  define inflate_fast          z_inflate_fast
 #  define inflate_table         z_inflate_table
-#  define uncompress            z_uncompress
+#  ifndef Z_SOLO
+#    define uncompress            z_uncompress
+#  endif
 #  define zError                z_zError
-#  define zcalloc               z_zcalloc
-#  define zcfree                z_zcfree
+#  ifndef Z_SOLO
+#    define zcalloc               z_zcalloc
+#    define zcfree                z_zcfree
+#  endif
 #  define zlibCompileFlags      z_zlibCompileFlags
 #  define zlibVersion           z_zlibVersion
 
@@ -113,7 +132,9 @@
 #  define alloc_func            z_alloc_func
 #  define charf                 z_charf
 #  define free_func             z_free_func
-#  define gzFile                z_gzFile
+#  ifndef Z_SOLO
+#    define gzFile                z_gzFile
+#  endif
 #  define gz_header             z_gz_header
 #  define gz_headerp            z_gz_headerp
 #  define in_func               z_in_func
@@ -199,6 +220,12 @@
 #  endif
 #endif
 
+#if defined(ZLIB_CONST) && !defined(z_const)
+#  define z_const const
+#else
+#  define z_const
+#endif
+
 /* Some Mac compilers merge all .h files incorrectly: */
 #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
 #  define NO_DUMMY_DECL
@@ -245,6 +272,14 @@
 #  endif
 #endif
 
+#ifndef Z_ARG /* function prototypes for stdarg */
+#  if defined(STDC) || defined(Z_HAVE_STDARG_H)
+#    define Z_ARG(args)  args
+#  else
+#    define Z_ARG(args)  ()
+#  endif
+#endif
+
 /* The following definitions for FAR are needed only for MSDOS mixed
  * model programming (small or medium model with some far allocations).
  * This was tested only with MSC; for other MSDOS compilers you may have
@@ -358,12 +393,47 @@
    typedef Byte       *voidp;
 #endif
 
+#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
+#  include <limits.h>
+#  if (UINT_MAX == 0xffffffffUL)
+#    define Z_U4 unsigned
+#  elif (ULONG_MAX == 0xffffffffUL)
+#    define Z_U4 unsigned long
+#  elif (USHRT_MAX == 0xffffffffUL)
+#    define Z_U4 unsigned short
+#  endif
+#endif
+
+#ifdef Z_U4
+   typedef Z_U4 z_crc_t;
+#else
+   typedef unsigned long z_crc_t;
+#endif
+
 #ifdef HAVE_UNISTD_H    /* may be set to #if 1 by ./configure */
 #  define Z_HAVE_UNISTD_H
 #endif
 
+#ifdef HAVE_STDARG_H    /* may be set to #if 1 by ./configure */
+#  define Z_HAVE_STDARG_H
+#endif
+
 #ifdef STDC
-#  include <sys/types.h>    /* for off_t */
+#  ifndef Z_SOLO
+#    include <sys/types.h>      /* for off_t */
+#  endif
+#endif
+
+#if defined(STDC) || defined(Z_HAVE_STDARG_H)
+#  ifndef Z_SOLO
+#    include <stdarg.h>         /* for va_list */
+#  endif
+#endif
+
+#ifdef _WIN32
+#  ifndef Z_SOLO
+#    include <stddef.h>         /* for wchar_t */
+#  endif
 #endif
 
 /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
@@ -372,21 +442,38 @@
  * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
  * equivalently requesting no 64-bit operations
  */
-#if -_LARGEFILE64_SOURCE - -1 == 1
+#if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
 #  undef _LARGEFILE64_SOURCE
 #endif
 
-#if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
-#  include <unistd.h>       /* for SEEK_* and off_t */
-#  ifdef VMS
-#    include <unixio.h>     /* for off_t */
-#  endif
-#  ifndef z_off_t
-#    define z_off_t off_t
+#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
+#  define Z_HAVE_UNISTD_H
+#endif
+#ifndef Z_SOLO
+#  if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
+#    include <unistd.h>         /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
+#    ifdef VMS
+#      include <unixio.h>       /* for off_t */
+#    endif
+#    ifndef z_off_t
+#      define z_off_t off_t
+#    endif
 #  endif
 #endif
 
-#ifndef SEEK_SET
+#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
+#  define Z_LFS64
+#endif
+
+#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
+#  define Z_LARGE64
+#endif
+
+#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
+#  define Z_WANT64
+#endif
+
+#if !defined(SEEK_SET) && !defined(Z_SOLO)
 #  define SEEK_SET        0       /* Seek from beginning of file.  */
 #  define SEEK_CUR        1       /* Seek from current position.  */
 #  define SEEK_END        2       /* Set file pointer to EOF plus "offset" */
@@ -396,18 +483,14 @@
 #  define z_off_t long
 #endif
 
-#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
+#if !defined(_WIN32) && defined(Z_LARGE64)
 #  define z_off64_t off64_t
 #else
-#  define z_off64_t z_off_t
-#endif
-
-#if defined(__OS400__)
-#  define NO_vsnprintf
-#endif
-
-#if defined(__MVS__)
-#  define NO_vsnprintf
+#  if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
+#    define z_off64_t __int64
+#  else
+#    define z_off64_t z_off_t
+#  endif
 #endif
 
 /* MVS linker does not support external names larger than 8 bytes */
diff --git a/Modules/zlib/zconf.h.in b/Modules/zlib/zconf.h.in
index 02ce56c..9987a77 100644
--- a/Modules/zlib/zconf.h.in
+++ b/Modules/zlib/zconf.h.in
@@ -1,5 +1,5 @@
 /* zconf.h -- configuration of the zlib compression library
- * Copyright (C) 1995-2010 Jean-loup Gailly.
+ * Copyright (C) 1995-2013 Jean-loup Gailly.
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -15,11 +15,13 @@
  * this permanently in zconf.h using "./configure --zprefix".
  */
 #ifdef Z_PREFIX     /* may be set to #if 1 by ./configure */
+#  define Z_PREFIX_SET
 
 /* all linked symbols */
 #  define _dist_code            z__dist_code
 #  define _length_code          z__length_code
 #  define _tr_align             z__tr_align
+#  define _tr_flush_bits        z__tr_flush_bits
 #  define _tr_flush_block       z__tr_flush_block
 #  define _tr_init              z__tr_init
 #  define _tr_stored_block      z__tr_stored_block
@@ -27,9 +29,11 @@
 #  define adler32               z_adler32
 #  define adler32_combine       z_adler32_combine
 #  define adler32_combine64     z_adler32_combine64
-#  define compress              z_compress
-#  define compress2             z_compress2
-#  define compressBound         z_compressBound
+#  ifndef Z_SOLO
+#    define compress              z_compress
+#    define compress2             z_compress2
+#    define compressBound         z_compressBound
+#  endif
 #  define crc32                 z_crc32
 #  define crc32_combine         z_crc32_combine
 #  define crc32_combine64       z_crc32_combine64
@@ -40,44 +44,53 @@
 #  define deflateInit2_         z_deflateInit2_
 #  define deflateInit_          z_deflateInit_
 #  define deflateParams         z_deflateParams
+#  define deflatePending        z_deflatePending
 #  define deflatePrime          z_deflatePrime
 #  define deflateReset          z_deflateReset
+#  define deflateResetKeep      z_deflateResetKeep
 #  define deflateSetDictionary  z_deflateSetDictionary
 #  define deflateSetHeader      z_deflateSetHeader
 #  define deflateTune           z_deflateTune
 #  define deflate_copyright     z_deflate_copyright
 #  define get_crc_table         z_get_crc_table
-#  define gz_error              z_gz_error
-#  define gz_intmax             z_gz_intmax
-#  define gz_strwinerror        z_gz_strwinerror
-#  define gzbuffer              z_gzbuffer
-#  define gzclearerr            z_gzclearerr
-#  define gzclose               z_gzclose
-#  define gzclose_r             z_gzclose_r
-#  define gzclose_w             z_gzclose_w
-#  define gzdirect              z_gzdirect
-#  define gzdopen               z_gzdopen
-#  define gzeof                 z_gzeof
-#  define gzerror               z_gzerror
-#  define gzflush               z_gzflush
-#  define gzgetc                z_gzgetc
-#  define gzgets                z_gzgets
-#  define gzoffset              z_gzoffset
-#  define gzoffset64            z_gzoffset64
-#  define gzopen                z_gzopen
-#  define gzopen64              z_gzopen64
-#  define gzprintf              z_gzprintf
-#  define gzputc                z_gzputc
-#  define gzputs                z_gzputs
-#  define gzread                z_gzread
-#  define gzrewind              z_gzrewind
-#  define gzseek                z_gzseek
-#  define gzseek64              z_gzseek64
-#  define gzsetparams           z_gzsetparams
-#  define gztell                z_gztell
-#  define gztell64              z_gztell64
-#  define gzungetc              z_gzungetc
-#  define gzwrite               z_gzwrite
+#  ifndef Z_SOLO
+#    define gz_error              z_gz_error
+#    define gz_intmax             z_gz_intmax
+#    define gz_strwinerror        z_gz_strwinerror
+#    define gzbuffer              z_gzbuffer
+#    define gzclearerr            z_gzclearerr
+#    define gzclose               z_gzclose
+#    define gzclose_r             z_gzclose_r
+#    define gzclose_w             z_gzclose_w
+#    define gzdirect              z_gzdirect
+#    define gzdopen               z_gzdopen
+#    define gzeof                 z_gzeof
+#    define gzerror               z_gzerror
+#    define gzflush               z_gzflush
+#    define gzgetc                z_gzgetc
+#    define gzgetc_               z_gzgetc_
+#    define gzgets                z_gzgets
+#    define gzoffset              z_gzoffset
+#    define gzoffset64            z_gzoffset64
+#    define gzopen                z_gzopen
+#    define gzopen64              z_gzopen64
+#    ifdef _WIN32
+#      define gzopen_w              z_gzopen_w
+#    endif
+#    define gzprintf              z_gzprintf
+#    define gzvprintf             z_gzvprintf
+#    define gzputc                z_gzputc
+#    define gzputs                z_gzputs
+#    define gzread                z_gzread
+#    define gzrewind              z_gzrewind
+#    define gzseek                z_gzseek
+#    define gzseek64              z_gzseek64
+#    define gzsetparams           z_gzsetparams
+#    define gztell                z_gztell
+#    define gztell64              z_gztell64
+#    define gzungetc              z_gzungetc
+#    define gzwrite               z_gzwrite
+#  endif
 #  define inflate               z_inflate
 #  define inflateBack           z_inflateBack
 #  define inflateBackEnd        z_inflateBackEnd
@@ -92,16 +105,22 @@
 #  define inflateReset          z_inflateReset
 #  define inflateReset2         z_inflateReset2
 #  define inflateSetDictionary  z_inflateSetDictionary
+#  define inflateGetDictionary  z_inflateGetDictionary
 #  define inflateSync           z_inflateSync
 #  define inflateSyncPoint      z_inflateSyncPoint
 #  define inflateUndermine      z_inflateUndermine
+#  define inflateResetKeep      z_inflateResetKeep
 #  define inflate_copyright     z_inflate_copyright
 #  define inflate_fast          z_inflate_fast
 #  define inflate_table         z_inflate_table
-#  define uncompress            z_uncompress
+#  ifndef Z_SOLO
+#    define uncompress            z_uncompress
+#  endif
 #  define zError                z_zError
-#  define zcalloc               z_zcalloc
-#  define zcfree                z_zcfree
+#  ifndef Z_SOLO
+#    define zcalloc               z_zcalloc
+#    define zcfree                z_zcfree
+#  endif
 #  define zlibCompileFlags      z_zlibCompileFlags
 #  define zlibVersion           z_zlibVersion
 
@@ -111,7 +130,9 @@
 #  define alloc_func            z_alloc_func
 #  define charf                 z_charf
 #  define free_func             z_free_func
-#  define gzFile                z_gzFile
+#  ifndef Z_SOLO
+#    define gzFile                z_gzFile
+#  endif
 #  define gz_header             z_gz_header
 #  define gz_headerp            z_gz_headerp
 #  define in_func               z_in_func
@@ -197,6 +218,12 @@
 #  endif
 #endif
 
+#if defined(ZLIB_CONST) && !defined(z_const)
+#  define z_const const
+#else
+#  define z_const
+#endif
+
 /* Some Mac compilers merge all .h files incorrectly: */
 #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
 #  define NO_DUMMY_DECL
@@ -243,6 +270,14 @@
 #  endif
 #endif
 
+#ifndef Z_ARG /* function prototypes for stdarg */
+#  if defined(STDC) || defined(Z_HAVE_STDARG_H)
+#    define Z_ARG(args)  args
+#  else
+#    define Z_ARG(args)  ()
+#  endif
+#endif
+
 /* The following definitions for FAR are needed only for MSDOS mixed
  * model programming (small or medium model with some far allocations).
  * This was tested only with MSC; for other MSDOS compilers you may have
@@ -356,12 +391,47 @@
    typedef Byte       *voidp;
 #endif
 
+#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
+#  include <limits.h>
+#  if (UINT_MAX == 0xffffffffUL)
+#    define Z_U4 unsigned
+#  elif (ULONG_MAX == 0xffffffffUL)
+#    define Z_U4 unsigned long
+#  elif (USHRT_MAX == 0xffffffffUL)
+#    define Z_U4 unsigned short
+#  endif
+#endif
+
+#ifdef Z_U4
+   typedef Z_U4 z_crc_t;
+#else
+   typedef unsigned long z_crc_t;
+#endif
+
 #ifdef HAVE_UNISTD_H    /* may be set to #if 1 by ./configure */
 #  define Z_HAVE_UNISTD_H
 #endif
 
+#ifdef HAVE_STDARG_H    /* may be set to #if 1 by ./configure */
+#  define Z_HAVE_STDARG_H
+#endif
+
 #ifdef STDC
-#  include <sys/types.h>    /* for off_t */
+#  ifndef Z_SOLO
+#    include <sys/types.h>      /* for off_t */
+#  endif
+#endif
+
+#if defined(STDC) || defined(Z_HAVE_STDARG_H)
+#  ifndef Z_SOLO
+#    include <stdarg.h>         /* for va_list */
+#  endif
+#endif
+
+#ifdef _WIN32
+#  ifndef Z_SOLO
+#    include <stddef.h>         /* for wchar_t */
+#  endif
 #endif
 
 /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
@@ -370,21 +440,38 @@
  * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
  * equivalently requesting no 64-bit operations
  */
-#if -_LARGEFILE64_SOURCE - -1 == 1
+#if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
 #  undef _LARGEFILE64_SOURCE
 #endif
 
-#if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
-#  include <unistd.h>       /* for SEEK_* and off_t */
-#  ifdef VMS
-#    include <unixio.h>     /* for off_t */
-#  endif
-#  ifndef z_off_t
-#    define z_off_t off_t
+#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
+#  define Z_HAVE_UNISTD_H
+#endif
+#ifndef Z_SOLO
+#  if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
+#    include <unistd.h>         /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
+#    ifdef VMS
+#      include <unixio.h>       /* for off_t */
+#    endif
+#    ifndef z_off_t
+#      define z_off_t off_t
+#    endif
 #  endif
 #endif
 
-#ifndef SEEK_SET
+#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
+#  define Z_LFS64
+#endif
+
+#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
+#  define Z_LARGE64
+#endif
+
+#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
+#  define Z_WANT64
+#endif
+
+#if !defined(SEEK_SET) && !defined(Z_SOLO)
 #  define SEEK_SET        0       /* Seek from beginning of file.  */
 #  define SEEK_CUR        1       /* Seek from current position.  */
 #  define SEEK_END        2       /* Set file pointer to EOF plus "offset" */
@@ -394,18 +481,14 @@
 #  define z_off_t long
 #endif
 
-#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
+#if !defined(_WIN32) && defined(Z_LARGE64)
 #  define z_off64_t off64_t
 #else
-#  define z_off64_t z_off_t
-#endif
-
-#if defined(__OS400__)
-#  define NO_vsnprintf
-#endif
-
-#if defined(__MVS__)
-#  define NO_vsnprintf
+#  if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
+#    define z_off64_t __int64
+#  else
+#    define z_off64_t z_off_t
+#  endif
 #endif
 
 /* MVS linker does not support external names larger than 8 bytes */
diff --git a/Modules/zlib/zconf.in.h b/Modules/zlib/zconf.in.h
deleted file mode 100644
index 03a9431..0000000
--- a/Modules/zlib/zconf.in.h
+++ /dev/null
@@ -1,332 +0,0 @@
-/* zconf.h -- configuration of the zlib compression library
- * Copyright (C) 1995-2005 Jean-loup Gailly.
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* @(#) $Id$ */
-
-#ifndef ZCONF_H
-#define ZCONF_H
-
-/*
- * If you *really* need a unique prefix for all types and library functions,
- * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
- */
-#ifdef Z_PREFIX
-#  define deflateInit_          z_deflateInit_
-#  define deflate               z_deflate
-#  define deflateEnd            z_deflateEnd
-#  define inflateInit_          z_inflateInit_
-#  define inflate               z_inflate
-#  define inflateEnd            z_inflateEnd
-#  define deflateInit2_         z_deflateInit2_
-#  define deflateSetDictionary  z_deflateSetDictionary
-#  define deflateCopy           z_deflateCopy
-#  define deflateReset          z_deflateReset
-#  define deflateParams         z_deflateParams
-#  define deflateBound          z_deflateBound
-#  define deflatePrime          z_deflatePrime
-#  define inflateInit2_         z_inflateInit2_
-#  define inflateSetDictionary  z_inflateSetDictionary
-#  define inflateSync           z_inflateSync
-#  define inflateSyncPoint      z_inflateSyncPoint
-#  define inflateCopy           z_inflateCopy
-#  define inflateReset          z_inflateReset
-#  define inflateBack           z_inflateBack
-#  define inflateBackEnd        z_inflateBackEnd
-#  define compress              z_compress
-#  define compress2             z_compress2
-#  define compressBound         z_compressBound
-#  define uncompress            z_uncompress
-#  define adler32               z_adler32
-#  define crc32                 z_crc32
-#  define get_crc_table         z_get_crc_table
-#  define zError                z_zError
-
-#  define alloc_func            z_alloc_func
-#  define free_func             z_free_func
-#  define in_func               z_in_func
-#  define out_func              z_out_func
-#  define Byte                  z_Byte
-#  define uInt                  z_uInt
-#  define uLong                 z_uLong
-#  define Bytef                 z_Bytef
-#  define charf                 z_charf
-#  define intf                  z_intf
-#  define uIntf                 z_uIntf
-#  define uLongf                z_uLongf
-#  define voidpf                z_voidpf
-#  define voidp                 z_voidp
-#endif
-
-#if defined(__MSDOS__) && !defined(MSDOS)
-#  define MSDOS
-#endif
-#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
-#  define OS2
-#endif
-#if defined(_WINDOWS) && !defined(WINDOWS)
-#  define WINDOWS
-#endif
-#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
-#  ifndef WIN32
-#    define WIN32
-#  endif
-#endif
-#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
-#  if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
-#    ifndef SYS16BIT
-#      define SYS16BIT
-#    endif
-#  endif
-#endif
-
-/*
- * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
- * than 64k bytes at a time (needed on systems with 16-bit int).
- */
-#ifdef SYS16BIT
-#  define MAXSEG_64K
-#endif
-#ifdef MSDOS
-#  define UNALIGNED_OK
-#endif
-
-#ifdef __STDC_VERSION__
-#  ifndef STDC
-#    define STDC
-#  endif
-#  if __STDC_VERSION__ >= 199901L
-#    ifndef STDC99
-#      define STDC99
-#    endif
-#  endif
-#endif
-#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
-#  define STDC
-#endif
-#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
-#  define STDC
-#endif
-#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
-#  define STDC
-#endif
-#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
-#  define STDC
-#endif
-
-#if defined(__OS400__) && !defined(STDC)    /* iSeries (formerly AS/400). */
-#  define STDC
-#endif
-
-#ifndef STDC
-#  ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
-#    define const       /* note: need a more gentle solution here */
-#  endif
-#endif
-
-/* Some Mac compilers merge all .h files incorrectly: */
-#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
-#  define NO_DUMMY_DECL
-#endif
-
-/* Maximum value for memLevel in deflateInit2 */
-#ifndef MAX_MEM_LEVEL
-#  ifdef MAXSEG_64K
-#    define MAX_MEM_LEVEL 8
-#  else
-#    define MAX_MEM_LEVEL 9
-#  endif
-#endif
-
-/* Maximum value for windowBits in deflateInit2 and inflateInit2.
- * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
- * created by gzip. (Files created by minigzip can still be extracted by
- * gzip.)
- */
-#ifndef MAX_WBITS
-#  define MAX_WBITS   15 /* 32K LZ77 window */
-#endif
-
-/* The memory requirements for deflate are (in bytes):
-            (1 << (windowBits+2)) +  (1 << (memLevel+9))
- that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)
- plus a few kilobytes for small objects. For example, if you want to reduce
- the default memory requirements from 256K to 128K, compile with
-     make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
- Of course this will generally degrade compression (there's no free lunch).
-
-   The memory requirements for inflate are (in bytes) 1 << windowBits
- that is, 32K for windowBits=15 (default value) plus a few kilobytes
- for small objects.
-*/
-
-                        /* Type declarations */
-
-#ifndef OF /* function prototypes */
-#  ifdef STDC
-#    define OF(args)  args
-#  else
-#    define OF(args)  ()
-#  endif
-#endif
-
-/* The following definitions for FAR are needed only for MSDOS mixed
- * model programming (small or medium model with some far allocations).
- * This was tested only with MSC; for other MSDOS compilers you may have
- * to define NO_MEMCPY in zutil.h.  If you don't need the mixed model,
- * just define FAR to be empty.
- */
-#ifdef SYS16BIT
-#  if defined(M_I86SM) || defined(M_I86MM)
-     /* MSC small or medium model */
-#    define SMALL_MEDIUM
-#    ifdef _MSC_VER
-#      define FAR _far
-#    else
-#      define FAR far
-#    endif
-#  endif
-#  if (defined(__SMALL__) || defined(__MEDIUM__))
-     /* Turbo C small or medium model */
-#    define SMALL_MEDIUM
-#    ifdef __BORLANDC__
-#      define FAR _far
-#    else
-#      define FAR far
-#    endif
-#  endif
-#endif
-
-#if defined(WINDOWS) || defined(WIN32)
-   /* If building or using zlib as a DLL, define ZLIB_DLL.
-    * This is not mandatory, but it offers a little performance increase.
-    */
-#  ifdef ZLIB_DLL
-#    if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
-#      ifdef ZLIB_INTERNAL
-#        define ZEXTERN extern __declspec(dllexport)
-#      else
-#        define ZEXTERN extern __declspec(dllimport)
-#      endif
-#    endif
-#  endif  /* ZLIB_DLL */
-   /* If building or using zlib with the WINAPI/WINAPIV calling convention,
-    * define ZLIB_WINAPI.
-    * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
-    */
-#  ifdef ZLIB_WINAPI
-#    ifdef FAR
-#      undef FAR
-#    endif
-#    include <windows.h>
-     /* No need for _export, use ZLIB.DEF instead. */
-     /* For complete Windows compatibility, use WINAPI, not __stdcall. */
-#    define ZEXPORT WINAPI
-#    ifdef WIN32
-#      define ZEXPORTVA WINAPIV
-#    else
-#      define ZEXPORTVA FAR CDECL
-#    endif
-#  endif
-#endif
-
-#if defined (__BEOS__)
-#  ifdef ZLIB_DLL
-#    ifdef ZLIB_INTERNAL
-#      define ZEXPORT   __declspec(dllexport)
-#      define ZEXPORTVA __declspec(dllexport)
-#    else
-#      define ZEXPORT   __declspec(dllimport)
-#      define ZEXPORTVA __declspec(dllimport)
-#    endif
-#  endif
-#endif
-
-#ifndef ZEXTERN
-#  define ZEXTERN extern
-#endif
-#ifndef ZEXPORT
-#  define ZEXPORT
-#endif
-#ifndef ZEXPORTVA
-#  define ZEXPORTVA
-#endif
-
-#ifndef FAR
-#  define FAR
-#endif
-
-#if !defined(__MACTYPES__)
-typedef unsigned char  Byte;  /* 8 bits */
-#endif
-typedef unsigned int   uInt;  /* 16 bits or more */
-typedef unsigned long  uLong; /* 32 bits or more */
-
-#ifdef SMALL_MEDIUM
-   /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
-#  define Bytef Byte FAR
-#else
-   typedef Byte  FAR Bytef;
-#endif
-typedef char  FAR charf;
-typedef int   FAR intf;
-typedef uInt  FAR uIntf;
-typedef uLong FAR uLongf;
-
-#ifdef STDC
-   typedef void const *voidpc;
-   typedef void FAR   *voidpf;
-   typedef void       *voidp;
-#else
-   typedef Byte const *voidpc;
-   typedef Byte FAR   *voidpf;
-   typedef Byte       *voidp;
-#endif
-
-#if 0           /* HAVE_UNISTD_H -- this line is updated by ./configure */
-#  include <sys/types.h> /* for off_t */
-#  include <unistd.h>    /* for SEEK_* and off_t */
-#  ifdef VMS
-#    include <unixio.h>   /* for off_t */
-#  endif
-#  define z_off_t off_t
-#endif
-#ifndef SEEK_SET
-#  define SEEK_SET        0       /* Seek from beginning of file.  */
-#  define SEEK_CUR        1       /* Seek from current position.  */
-#  define SEEK_END        2       /* Set file pointer to EOF plus "offset" */
-#endif
-#ifndef z_off_t
-#  define z_off_t long
-#endif
-
-#if defined(__OS400__)
-#  define NO_vsnprintf
-#endif
-
-#if defined(__MVS__)
-#  define NO_vsnprintf
-#  ifdef FAR
-#    undef FAR
-#  endif
-#endif
-
-/* MVS linker does not support external names larger than 8 bytes */
-#if defined(__MVS__)
-#   pragma map(deflateInit_,"DEIN")
-#   pragma map(deflateInit2_,"DEIN2")
-#   pragma map(deflateEnd,"DEEND")
-#   pragma map(deflateBound,"DEBND")
-#   pragma map(inflateInit_,"ININ")
-#   pragma map(inflateInit2_,"ININ2")
-#   pragma map(inflateEnd,"INEND")
-#   pragma map(inflateSync,"INSY")
-#   pragma map(inflateSetDictionary,"INSEDI")
-#   pragma map(compressBound,"CMBND")
-#   pragma map(inflate_table,"INTABL")
-#   pragma map(inflate_fast,"INFA")
-#   pragma map(inflate_copyright,"INCOPY")
-#endif
-
-#endif /* ZCONF_H */
diff --git a/Modules/zlib/zlib.3 b/Modules/zlib/zlib.3
index 27adc4c..0160e62 100644
--- a/Modules/zlib/zlib.3
+++ b/Modules/zlib/zlib.3
@@ -1,4 +1,4 @@
-.TH ZLIB 3 "19 Apr 2010"
+.TH ZLIB 3 "28 Apr 2013"
 .SH NAME
 zlib \- compression/decompression library
 .SH SYNOPSIS
@@ -36,9 +36,9 @@
 .IR zlib.h .
 The distribution source includes examples of use of the library
 in the files
-.I example.c
+.I test/example.c
 and
-.IR minigzip.c,
+.IR test/minigzip.c,
 as well as other examples in the
 .IR examples/
 directory.
@@ -65,7 +65,7 @@
 written by A.M. Kuchling (amk@magnet.com),
 is available in Python 1.5 and later versions:
 .IP
-http://www.python.org/doc/lib/module-zlib.html
+http://docs.python.org/library/zlib.html
 .LP
 .I zlib
 is built into
@@ -95,11 +95,11 @@
 The data format used by the zlib library is described by RFC
 (Request for Comments) 1950 to 1952 in the files:
 .IP
-http://www.ietf.org/rfc/rfc1950.txt (for the zlib header and trailer format)
+http://tools.ietf.org/html/rfc1950 (for the zlib header and trailer format)
 .br
-http://www.ietf.org/rfc/rfc1951.txt (for the deflate compressed data format)
+http://tools.ietf.org/html/rfc1951 (for the deflate compressed data format)
 .br
-http://www.ietf.org/rfc/rfc1952.txt (for the gzip header and trailer format)
+http://tools.ietf.org/html/rfc1952 (for the gzip header and trailer format)
 .LP
 Mark Nelson wrote an article about
 .I zlib
@@ -125,8 +125,8 @@
 Send questions and/or comments to zlib@gzip.org,
 or (for the Windows DLL version) to Gilles Vollant (info@winimage.com).
 .SH AUTHORS
-Version 1.2.5
-Copyright (C) 1995-2010 Jean-loup Gailly (jloup@gzip.org)
+Version 1.2.8
+Copyright (C) 1995-2013 Jean-loup Gailly (jloup@gzip.org)
 and Mark Adler (madler@alumni.caltech.edu).
 .LP
 This software is provided "as-is,"
diff --git a/Modules/zlib/zlib.h b/Modules/zlib/zlib.h
index 79a187c..3e0c767 100644
--- a/Modules/zlib/zlib.h
+++ b/Modules/zlib/zlib.h
@@ -1,7 +1,7 @@
 /* zlib.h -- interface of the 'zlib' general purpose compression library
-  version 1.2.5, April 19th, 2010
+  version 1.2.8, April 28th, 2013
 
-  Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler
+  Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -24,8 +24,8 @@
 
 
   The data format used by the zlib library is described by RFCs (Request for
-  Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt
-  (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
+  Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950
+  (zlib format), rfc1951 (deflate format) and rfc1952 (gzip format).
 */
 
 #ifndef ZLIB_H
@@ -37,11 +37,11 @@
 extern "C" {
 #endif
 
-#define ZLIB_VERSION "1.2.5"
-#define ZLIB_VERNUM 0x1250
+#define ZLIB_VERSION "1.2.8"
+#define ZLIB_VERNUM 0x1280
 #define ZLIB_VER_MAJOR 1
 #define ZLIB_VER_MINOR 2
-#define ZLIB_VER_REVISION 5
+#define ZLIB_VER_REVISION 8
 #define ZLIB_VER_SUBREVISION 0
 
 /*
@@ -83,15 +83,15 @@
 struct internal_state;
 
 typedef struct z_stream_s {
-    Bytef    *next_in;  /* next input byte */
+    z_const Bytef *next_in;     /* next input byte */
     uInt     avail_in;  /* number of bytes available at next_in */
-    uLong    total_in;  /* total nb of input bytes read so far */
+    uLong    total_in;  /* total number of input bytes read so far */
 
     Bytef    *next_out; /* next output byte should be put there */
     uInt     avail_out; /* remaining free space at next_out */
-    uLong    total_out; /* total nb of bytes output so far */
+    uLong    total_out; /* total number of bytes output so far */
 
-    char     *msg;      /* last error message, NULL if no error */
+    z_const char *msg;  /* last error message, NULL if no error */
     struct internal_state FAR *state; /* not visible by applications */
 
     alloc_func zalloc;  /* used to allocate the internal state */
@@ -327,8 +327,9 @@
 
     Z_FINISH can be used immediately after deflateInit if all the compression
   is to be done in a single step.  In this case, avail_out must be at least the
-  value returned by deflateBound (see below).  If deflate does not return
-  Z_STREAM_END, then it must be called again as described above.
+  value returned by deflateBound (see below).  Then deflate is guaranteed to
+  return Z_STREAM_END.  If not enough output space is provided, deflate will
+  not return Z_STREAM_END, and it must be called again as described above.
 
     deflate() sets strm->adler to the adler32 checksum of all input read
   so far (that is, total_in bytes).
@@ -451,23 +452,29 @@
   error.  However if all decompression is to be performed in a single step (a
   single call of inflate), the parameter flush should be set to Z_FINISH.  In
   this case all pending input is processed and all pending output is flushed;
-  avail_out must be large enough to hold all the uncompressed data.  (The size
-  of the uncompressed data may have been saved by the compressor for this
-  purpose.) The next operation on this stream must be inflateEnd to deallocate
-  the decompression state.  The use of Z_FINISH is never required, but can be
-  used to inform inflate that a faster approach may be used for the single
-  inflate() call.
+  avail_out must be large enough to hold all of the uncompressed data for the
+  operation to complete.  (The size of the uncompressed data may have been
+  saved by the compressor for this purpose.) The use of Z_FINISH is not
+  required to perform an inflation in one step.  However it may be used to
+  inform inflate that a faster approach can be used for the single inflate()
+  call.  Z_FINISH also informs inflate to not maintain a sliding window if the
+  stream completes, which reduces inflate's memory footprint.  If the stream
+  does not complete, either because not all of the stream is provided or not
+  enough output space is provided, then a sliding window will be allocated and
+  inflate() can be called again to continue the operation as if Z_NO_FLUSH had
+  been used.
 
      In this implementation, inflate() always flushes as much output as
   possible to the output buffer, and always uses the faster approach on the
-  first call.  So the only effect of the flush parameter in this implementation
-  is on the return value of inflate(), as noted below, or when it returns early
-  because Z_BLOCK or Z_TREES is used.
+  first call.  So the effects of the flush parameter in this implementation are
+  on the return value of inflate() as noted below, when inflate() returns early
+  when Z_BLOCK or Z_TREES is used, and when inflate() avoids the allocation of
+  memory for a sliding window when Z_FINISH is used.
 
      If a preset dictionary is needed after this call (see inflateSetDictionary
-  below), inflate sets strm->adler to the adler32 checksum of the dictionary
+  below), inflate sets strm->adler to the Adler-32 checksum of the dictionary
   chosen by the compressor and returns Z_NEED_DICT; otherwise it sets
-  strm->adler to the adler32 checksum of all output produced so far (that is,
+  strm->adler to the Adler-32 checksum of all output produced so far (that is,
   total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described
   below.  At the end of the stream, inflate() checks that its computed adler32
   checksum is equal to that saved by the compressor and returns Z_STREAM_END
@@ -478,7 +485,9 @@
   initializing with inflateInit2().  Any information contained in the gzip
   header is not retained, so applications that need that information should
   instead use raw inflate, see inflateInit2() below, or inflateBack() and
-  perform their own processing of the gzip header and trailer.
+  perform their own processing of the gzip header and trailer.  When processing
+  gzip-wrapped deflate data, strm->adler32 is set to the CRC-32 of the output
+  producted so far.  The CRC-32 is checked against the gzip trailer.
 
     inflate() returns Z_OK if some progress has been made (more input processed
   or more output produced), Z_STREAM_END if the end of the compressed data has
@@ -580,10 +589,15 @@
                                              uInt  dictLength));
 /*
      Initializes the compression dictionary from the given byte sequence
-   without producing any compressed output.  This function must be called
-   immediately after deflateInit, deflateInit2 or deflateReset, before any call
-   of deflate.  The compressor and decompressor must use exactly the same
-   dictionary (see inflateSetDictionary).
+   without producing any compressed output.  When using the zlib format, this
+   function must be called immediately after deflateInit, deflateInit2 or
+   deflateReset, and before any call of deflate.  When doing raw deflate, this
+   function must be called either before any call of deflate, or immediately
+   after the completion of a deflate block, i.e. after all input has been
+   consumed and all output has been delivered when using any of the flush
+   options Z_BLOCK, Z_PARTIAL_FLUSH, Z_SYNC_FLUSH, or Z_FULL_FLUSH.  The
+   compressor and decompressor must use exactly the same dictionary (see
+   inflateSetDictionary).
 
      The dictionary should consist of strings (byte sequences) that are likely
    to be encountered later in the data to be compressed, with the most commonly
@@ -610,8 +624,8 @@
      deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
    parameter is invalid (e.g.  dictionary being Z_NULL) or the stream state is
    inconsistent (for example if deflate has already been called for this stream
-   or if the compression method is bsort).  deflateSetDictionary does not
-   perform any compression: this will be done by deflate().
+   or if not at a block boundary for raw deflate).  deflateSetDictionary does
+   not perform any compression: this will be done by deflate().
 */
 
 ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
@@ -688,9 +702,29 @@
    deflation of sourceLen bytes.  It must be called after deflateInit() or
    deflateInit2(), and after deflateSetHeader(), if used.  This would be used
    to allocate an output buffer for deflation in a single pass, and so would be
-   called before deflate().
+   called before deflate().  If that first deflate() call is provided the
+   sourceLen input bytes, an output buffer allocated to the size returned by
+   deflateBound(), and the flush value Z_FINISH, then deflate() is guaranteed
+   to return Z_STREAM_END.  Note that it is possible for the compressed size to
+   be larger than the value returned by deflateBound() if flush options other
+   than Z_FINISH or Z_NO_FLUSH are used.
 */
 
+ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm,
+                                       unsigned *pending,
+                                       int *bits));
+/*
+     deflatePending() returns the number of bytes and bits of output that have
+   been generated, but not yet provided in the available output.  The bytes not
+   provided would be due to the available output space having being consumed.
+   The number of bits of output not provided are between 0 and 7, where they
+   await more bits to join them in order to fill out a full byte.  If pending
+   or bits are Z_NULL, then those values are not set.
+
+     deflatePending returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent.
+ */
+
 ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
                                      int bits,
                                      int value));
@@ -703,8 +737,9 @@
    than or equal to 16, and that many of the least significant bits of value
    will be inserted in the output.
 
-     deflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
-   stream state was inconsistent.
+     deflatePrime returns Z_OK if success, Z_BUF_ERROR if there was not enough
+   room in the internal buffer to insert the bits, or Z_STREAM_ERROR if the
+   source stream state was inconsistent.
 */
 
 ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm,
@@ -790,10 +825,11 @@
    if that call returned Z_NEED_DICT.  The dictionary chosen by the compressor
    can be determined from the adler32 value returned by that call of inflate.
    The compressor and decompressor must use exactly the same dictionary (see
-   deflateSetDictionary).  For raw inflate, this function can be called
-   immediately after inflateInit2() or inflateReset() and before any call of
-   inflate() to set the dictionary.  The application must insure that the
-   dictionary that was used for compression is provided.
+   deflateSetDictionary).  For raw inflate, this function can be called at any
+   time to set the dictionary.  If the provided dictionary is smaller than the
+   window and there is already data in the window, then the provided dictionary
+   will amend what's there.  The application must insure that the dictionary
+   that was used for compression is provided.
 
      inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
    parameter is invalid (e.g.  dictionary being Z_NULL) or the stream state is
@@ -803,19 +839,38 @@
    inflate().
 */
 
+ZEXTERN int ZEXPORT inflateGetDictionary OF((z_streamp strm,
+                                             Bytef *dictionary,
+                                             uInt  *dictLength));
+/*
+     Returns the sliding dictionary being maintained by inflate.  dictLength is
+   set to the number of bytes in the dictionary, and that many bytes are copied
+   to dictionary.  dictionary must have enough space, where 32768 bytes is
+   always enough.  If inflateGetDictionary() is called with dictionary equal to
+   Z_NULL, then only the dictionary length is returned, and nothing is copied.
+   Similary, if dictLength is Z_NULL, then it is not set.
+
+     inflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the
+   stream state is inconsistent.
+*/
+
 ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
 /*
-     Skips invalid compressed data until a full flush point (see above the
-   description of deflate with Z_FULL_FLUSH) can be found, or until all
+     Skips invalid compressed data until a possible full flush point (see above
+   for the description of deflate with Z_FULL_FLUSH) can be found, or until all
    available input is skipped.  No output is provided.
 
-     inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR
-   if no more input was provided, Z_DATA_ERROR if no flush point has been
-   found, or Z_STREAM_ERROR if the stream structure was inconsistent.  In the
-   success case, the application may save the current value of total_in
-   which indicates where valid compressed data was found.  In the error case,
-   the application may repeatedly call inflateSync, providing more input each
-   time, until success or end of the input data.
+     inflateSync searches for a 00 00 FF FF pattern in the compressed data.
+   All full flush points have this pattern, but not all occurrences of this
+   pattern are full flush points.
+
+     inflateSync returns Z_OK if a possible full flush point has been found,
+   Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point
+   has been found, or Z_STREAM_ERROR if the stream structure was inconsistent.
+   In the success case, the application may save the current current value of
+   total_in which indicates where valid compressed data was found.  In the
+   error case, the application may repeatedly call inflateSync, providing more
+   input each time, until success or end of the input data.
 */
 
 ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
@@ -962,12 +1017,13 @@
      See inflateBack() for the usage of these routines.
 
      inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of
-   the paramaters are invalid, Z_MEM_ERROR if the internal state could not be
+   the parameters are invalid, Z_MEM_ERROR if the internal state could not be
    allocated, or Z_VERSION_ERROR if the version of the library does not match
    the version of the header file.
 */
 
-typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *));
+typedef unsigned (*in_func) OF((void FAR *,
+                                z_const unsigned char FAR * FAR *));
 typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));
 
 ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
@@ -975,11 +1031,12 @@
                                     out_func out, void FAR *out_desc));
 /*
      inflateBack() does a raw inflate with a single call using a call-back
-   interface for input and output.  This is more efficient than inflate() for
-   file i/o applications in that it avoids copying between the output and the
-   sliding window by simply making the window itself the output buffer.  This
-   function trusts the application to not change the output buffer passed by
-   the output function, at least until inflateBack() returns.
+   interface for input and output.  This is potentially more efficient than
+   inflate() for file i/o applications, in that it avoids copying between the
+   output and the sliding window by simply making the window itself the output
+   buffer.  inflate() can be faster on modern CPUs when used with large
+   buffers.  inflateBack() trusts the application to not change the output
+   buffer passed by the output function, at least until inflateBack() returns.
 
      inflateBackInit() must be called first to allocate the internal state
    and to initialize the state with the user-provided window buffer.
@@ -1088,6 +1145,7 @@
      27-31: 0 (reserved)
  */
 
+#ifndef Z_SOLO
 
                         /* utility functions */
 
@@ -1149,10 +1207,11 @@
 
      uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
    enough memory, Z_BUF_ERROR if there was not enough room in the output
-   buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete.
+   buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete.  In
+   the case where there is not enough room, uncompress() will fill the output
+   buffer with the uncompressed data up to that point.
 */
 
-
                         /* gzip file access functions */
 
 /*
@@ -1162,7 +1221,7 @@
    wrapper, documented in RFC 1952, wrapped around a deflate stream.
 */
 
-typedef voidp gzFile;       /* opaque gzip file descriptor */
+typedef struct gzFile_s *gzFile;    /* semi-opaque gzip file descriptor */
 
 /*
 ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
@@ -1172,13 +1231,28 @@
    a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only
    compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F'
    for fixed code compression as in "wb9F".  (See the description of
-   deflateInit2 for more information about the strategy parameter.) Also "a"
-   can be used instead of "w" to request that the gzip stream that will be
-   written be appended to the file.  "+" will result in an error, since reading
-   and writing to the same gzip file is not supported.
+   deflateInit2 for more information about the strategy parameter.)  'T' will
+   request transparent writing or appending with no compression and not using
+   the gzip format.
+
+     "a" can be used instead of "w" to request that the gzip stream that will
+   be written be appended to the file.  "+" will result in an error, since
+   reading and writing to the same gzip file is not supported.  The addition of
+   "x" when writing will create the file exclusively, which fails if the file
+   already exists.  On systems that support it, the addition of "e" when
+   reading or writing will set the flag to close the file on an execve() call.
+
+     These functions, as well as gzip, will read and decode a sequence of gzip
+   streams in a file.  The append function of gzopen() can be used to create
+   such a file.  (Also see gzflush() for another way to do this.)  When
+   appending, gzopen does not test whether the file begins with a gzip stream,
+   nor does it look for the end of the gzip streams to begin appending.  gzopen
+   will simply append a gzip stream to the existing file.
 
      gzopen can be used to read a file which is not in gzip format; in this
-   case gzread will directly read from the file without decompression.
+   case gzread will directly read from the file without decompression.  When
+   reading, this will be detected automatically by looking for the magic two-
+   byte gzip header.
 
      gzopen returns NULL if the file could not be opened, if there was
    insufficient memory to allocate the gzFile state, or if an invalid mode was
@@ -1197,7 +1271,11 @@
    descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor
    fd.  If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd,
    mode);.  The duplicated descriptor should be saved to avoid a leak, since
-   gzdopen does not close fd if it fails.
+   gzdopen does not close fd if it fails.  If you are using fileno() to get the
+   file descriptor from a FILE *, then you will have to use dup() to avoid
+   double-close()ing the file descriptor.  Both gzclose() and fclose() will
+   close the associated file descriptor, so they need to have different file
+   descriptors.
 
      gzdopen returns NULL if there was insufficient memory to allocate the
    gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not
@@ -1235,14 +1313,26 @@
 ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
 /*
      Reads the given number of uncompressed bytes from the compressed file.  If
-   the input file was not in gzip format, gzread copies the given number of
-   bytes into the buffer.
+   the input file is not in gzip format, gzread copies the given number of
+   bytes into the buffer directly from the file.
 
      After reaching the end of a gzip stream in the input, gzread will continue
-   to read, looking for another gzip stream, or failing that, reading the rest
-   of the input file directly without decompression.  The entire input file
-   will be read if gzread is called until it returns less than the requested
-   len.
+   to read, looking for another gzip stream.  Any number of gzip streams may be
+   concatenated in the input file, and will all be decompressed by gzread().
+   If something other than a gzip stream is encountered after a gzip stream,
+   that remaining trailing garbage is ignored (and no error is returned).
+
+     gzread can be used to read a gzip file that is being concurrently written.
+   Upon reaching the end of the input, gzread will return with the available
+   data.  If the error code returned by gzerror is Z_OK or Z_BUF_ERROR, then
+   gzclearerr can be used to clear the end of file indicator in order to permit
+   gzread to be tried again.  Z_OK indicates that a gzip stream was completed
+   on the last gzread.  Z_BUF_ERROR indicates that the input file ended in the
+   middle of a gzip stream.  Note that gzread does not return -1 in the event
+   of an incomplete gzip stream.  This error is deferred until gzclose(), which
+   will return Z_BUF_ERROR if the last gzread ended in the middle of a gzip
+   stream.  Alternatively, gzerror can be used before gzclose to detect this
+   case.
 
      gzread returns the number of uncompressed bytes actually read, less than
    len for end of file, or -1 for error.
@@ -1256,7 +1346,7 @@
    error.
 */
 
-ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...));
+ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...));
 /*
      Converts, formats, and writes the arguments to the compressed file under
    control of the format string, as in fprintf.  gzprintf returns the number of
@@ -1301,7 +1391,10 @@
 ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
 /*
      Reads one byte from the compressed file.  gzgetc returns this byte or -1
-   in case of end of file or error.
+   in case of end of file or error.  This is implemented as a macro for speed.
+   As such, it does not do all of the checking the other functions do.  I.e.
+   it does not check to see if file is NULL, nor whether the structure file
+   points to has been clobbered or not.
 */
 
 ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
@@ -1397,9 +1490,7 @@
 ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
 /*
      Returns true (1) if file is being copied directly while reading, or false
-   (0) if file is a gzip stream being decompressed.  This state can change from
-   false to true while reading the input file if the end of a gzip stream is
-   reached, but is followed by data that is not another gzip stream.
+   (0) if file is a gzip stream being decompressed.
 
      If the input file is empty, gzdirect() will return true, since the input
    does not contain a gzip stream.
@@ -1408,6 +1499,13 @@
    cause buffers to be allocated to allow reading the file to determine if it
    is a gzip file.  Therefore if gzbuffer() is used, it should be called before
    gzdirect().
+
+     When writing, gzdirect() returns true (1) if transparent writing was
+   requested ("wT" for the gzopen() mode), or false (0) otherwise.  (Note:
+   gzdirect() is not needed when writing.  Transparent writing must be
+   explicitly requested, so the application already knows the answer.  When
+   linking statically, using gzdirect() will include all of the zlib code for
+   gzip file reading and decompression, which may not be desired.)
 */
 
 ZEXTERN int ZEXPORT    gzclose OF((gzFile file));
@@ -1419,7 +1517,8 @@
    must not be called more than once on the same allocation.
 
      gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a
-   file operation error, or Z_OK on success.
+   file operation error, Z_MEM_ERROR if out of memory, Z_BUF_ERROR if the
+   last read ended in the middle of a gzip stream, or Z_OK on success.
 */
 
 ZEXTERN int ZEXPORT gzclose_r OF((gzFile file));
@@ -1457,6 +1556,7 @@
    file that is being written concurrently.
 */
 
+#endif /* !Z_SOLO */
 
                         /* checksum functions */
 
@@ -1492,16 +1592,17 @@
      Combine two Adler-32 checksums into one.  For two sequences of bytes, seq1
    and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for
    each, adler1 and adler2.  adler32_combine() returns the Adler-32 checksum of
-   seq1 and seq2 concatenated, requiring only adler1, adler2, and len2.
+   seq1 and seq2 concatenated, requiring only adler1, adler2, and len2.  Note
+   that the z_off_t type (like off_t) is a signed integer.  If len2 is
+   negative, the result has no meaning or utility.
 */
 
 ZEXTERN uLong ZEXPORT crc32   OF((uLong crc, const Bytef *buf, uInt len));
 /*
      Update a running CRC-32 with the bytes buf[0..len-1] and return the
    updated CRC-32.  If buf is Z_NULL, this function returns the required
-   initial value for the for the crc.  Pre- and post-conditioning (one's
-   complement) is performed within this function so it shouldn't be done by the
-   application.
+   initial value for the crc.  Pre- and post-conditioning (one's complement) is
+   performed within this function so it shouldn't be done by the application.
 
    Usage example:
 
@@ -1544,17 +1645,42 @@
                                          const char *version,
                                          int stream_size));
 #define deflateInit(strm, level) \
-        deflateInit_((strm), (level),       ZLIB_VERSION, sizeof(z_stream))
+        deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream))
 #define inflateInit(strm) \
-        inflateInit_((strm),                ZLIB_VERSION, sizeof(z_stream))
+        inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream))
 #define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
         deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
-                      (strategy),           ZLIB_VERSION, sizeof(z_stream))
+                      (strategy), ZLIB_VERSION, (int)sizeof(z_stream))
 #define inflateInit2(strm, windowBits) \
-        inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))
+        inflateInit2_((strm), (windowBits), ZLIB_VERSION, \
+                      (int)sizeof(z_stream))
 #define inflateBackInit(strm, windowBits, window) \
         inflateBackInit_((strm), (windowBits), (window), \
-                                            ZLIB_VERSION, sizeof(z_stream))
+                      ZLIB_VERSION, (int)sizeof(z_stream))
+
+#ifndef Z_SOLO
+
+/* gzgetc() macro and its supporting function and exposed data structure.  Note
+ * that the real internal state is much larger than the exposed structure.
+ * This abbreviated structure exposes just enough for the gzgetc() macro.  The
+ * user should not mess with these exposed elements, since their names or
+ * behavior could change in the future, perhaps even capriciously.  They can
+ * only be used by the gzgetc() macro.  You have been warned.
+ */
+struct gzFile_s {
+    unsigned have;
+    unsigned char *next;
+    z_off64_t pos;
+};
+ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file));  /* backward compatibility */
+#ifdef Z_PREFIX_SET
+#  undef z_gzgetc
+#  define z_gzgetc(g) \
+          ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : gzgetc(g))
+#else
+#  define gzgetc(g) \
+          ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : gzgetc(g))
+#endif
 
 /* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or
  * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if
@@ -1562,7 +1688,7 @@
  * functions are changed to 64 bits) -- in case these are set on systems
  * without large file support, _LFS64_LARGEFILE must also be true
  */
-#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
+#ifdef Z_LARGE64
    ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
    ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int));
    ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile));
@@ -1571,14 +1697,23 @@
    ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t));
 #endif
 
-#if !defined(ZLIB_INTERNAL) && _FILE_OFFSET_BITS-0 == 64 && _LFS64_LARGEFILE-0
-#  define gzopen gzopen64
-#  define gzseek gzseek64
-#  define gztell gztell64
-#  define gzoffset gzoffset64
-#  define adler32_combine adler32_combine64
-#  define crc32_combine crc32_combine64
-#  ifdef _LARGEFILE64_SOURCE
+#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64)
+#  ifdef Z_PREFIX_SET
+#    define z_gzopen z_gzopen64
+#    define z_gzseek z_gzseek64
+#    define z_gztell z_gztell64
+#    define z_gzoffset z_gzoffset64
+#    define z_adler32_combine z_adler32_combine64
+#    define z_crc32_combine z_crc32_combine64
+#  else
+#    define gzopen gzopen64
+#    define gzseek gzseek64
+#    define gztell gztell64
+#    define gzoffset gzoffset64
+#    define adler32_combine adler32_combine64
+#    define crc32_combine crc32_combine64
+#  endif
+#  ifndef Z_LARGE64
      ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
      ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int));
      ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile));
@@ -1595,6 +1730,13 @@
    ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
 #endif
 
+#else /* Z_SOLO */
+
+   ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
+   ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
+
+#endif /* !Z_SOLO */
+
 /* hack for buggy compilers */
 #if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL)
     struct internal_state {int dummy;};
@@ -1603,8 +1745,21 @@
 /* undocumented functions */
 ZEXTERN const char   * ZEXPORT zError           OF((int));
 ZEXTERN int            ZEXPORT inflateSyncPoint OF((z_streamp));
-ZEXTERN const uLongf * ZEXPORT get_crc_table    OF((void));
+ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table    OF((void));
 ZEXTERN int            ZEXPORT inflateUndermine OF((z_streamp, int));
+ZEXTERN int            ZEXPORT inflateResetKeep OF((z_streamp));
+ZEXTERN int            ZEXPORT deflateResetKeep OF((z_streamp));
+#if defined(_WIN32) && !defined(Z_SOLO)
+ZEXTERN gzFile         ZEXPORT gzopen_w OF((const wchar_t *path,
+                                            const char *mode));
+#endif
+#if defined(STDC) || defined(Z_HAVE_STDARG_H)
+#  ifndef Z_SOLO
+ZEXTERN int            ZEXPORTVA gzvprintf Z_ARG((gzFile file,
+                                                  const char *format,
+                                                  va_list va));
+#  endif
+#endif
 
 #ifdef __cplusplus
 }
diff --git a/Modules/zlib/zlib.map b/Modules/zlib/zlib.map
index f282d36..55c6647 100644
--- a/Modules/zlib/zlib.map
+++ b/Modules/zlib/zlib.map
@@ -66,3 +66,18 @@
     gzclose_r;
     gzclose_w;
 } ZLIB_1.2.3.4;
+
+ZLIB_1.2.5.1 {
+    deflatePending;
+} ZLIB_1.2.3.5;
+
+ZLIB_1.2.5.2 {
+    deflateResetKeep;
+    gzgetc_;
+    inflateResetKeep;
+} ZLIB_1.2.5.1;
+
+ZLIB_1.2.7.1 {
+    inflateGetDictionary;
+    gzvprintf;
+} ZLIB_1.2.5.2;
diff --git a/Modules/zlib/zutil.c b/Modules/zlib/zutil.c
index 898ed34..23d2ebe 100644
--- a/Modules/zlib/zutil.c
+++ b/Modules/zlib/zutil.c
@@ -1,17 +1,20 @@
 /* zutil.c -- target dependent utility functions for the compression library
- * Copyright (C) 1995-2005, 2010 Jean-loup Gailly.
+ * Copyright (C) 1995-2005, 2010, 2011, 2012 Jean-loup Gailly.
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
 /* @(#) $Id$ */
 
 #include "zutil.h"
+#ifndef Z_SOLO
+#  include "gzguts.h"
+#endif
 
 #ifndef NO_DUMMY_DECL
 struct internal_state      {int dummy;}; /* for buggy compilers */
 #endif
 
-const char * const z_errmsg[10] = {
+z_const char * const z_errmsg[10] = {
 "need dictionary",     /* Z_NEED_DICT       2  */
 "stream end",          /* Z_STREAM_END      1  */
 "",                    /* Z_OK              0  */
@@ -85,27 +88,27 @@
 #ifdef FASTEST
     flags += 1L << 21;
 #endif
-#ifdef STDC
+#if defined(STDC) || defined(Z_HAVE_STDARG_H)
 #  ifdef NO_vsnprintf
-        flags += 1L << 25;
+    flags += 1L << 25;
 #    ifdef HAS_vsprintf_void
-        flags += 1L << 26;
+    flags += 1L << 26;
 #    endif
 #  else
 #    ifdef HAS_vsnprintf_void
-        flags += 1L << 26;
+    flags += 1L << 26;
 #    endif
 #  endif
 #else
-        flags += 1L << 24;
+    flags += 1L << 24;
 #  ifdef NO_snprintf
-        flags += 1L << 25;
+    flags += 1L << 25;
 #    ifdef HAS_sprintf_void
-        flags += 1L << 26;
+    flags += 1L << 26;
 #    endif
 #  else
 #    ifdef HAS_snprintf_void
-        flags += 1L << 26;
+    flags += 1L << 26;
 #    endif
 #  endif
 #endif
@@ -181,6 +184,7 @@
 }
 #endif
 
+#ifndef Z_SOLO
 
 #ifdef SYS16BIT
 
@@ -316,3 +320,5 @@
 }
 
 #endif /* MY_ZCALLOC */
+
+#endif /* !Z_SOLO */
diff --git a/Modules/zlib/zutil.h b/Modules/zlib/zutil.h
index 258fa88..24ab06b 100644
--- a/Modules/zlib/zutil.h
+++ b/Modules/zlib/zutil.h
@@ -1,5 +1,5 @@
 /* zutil.h -- internal interface and configuration of the compression library
- * Copyright (C) 1995-2010 Jean-loup Gailly.
+ * Copyright (C) 1995-2013 Jean-loup Gailly.
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -13,7 +13,7 @@
 #ifndef ZUTIL_H
 #define ZUTIL_H
 
-#if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33) && !defined(NO_VIZ)
+#ifdef HAVE_HIDDEN
 #  define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
 #else
 #  define ZLIB_INTERNAL
@@ -21,7 +21,7 @@
 
 #include "zlib.h"
 
-#ifdef STDC
+#if defined(STDC) && !defined(Z_SOLO)
 #  if !(defined(_WIN32_WCE) && defined(_MSC_VER))
 #    include <stddef.h>
 #  endif
@@ -29,6 +29,10 @@
 #  include <stdlib.h>
 #endif
 
+#ifdef Z_SOLO
+   typedef long ptrdiff_t;  /* guess -- will be caught if guess is wrong */
+#endif
+
 #ifndef local
 #  define local static
 #endif
@@ -40,13 +44,13 @@
 typedef ush FAR ushf;
 typedef unsigned long  ulg;
 
-extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
+extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
 /* (size given to avoid silly warnings with Visual C++) */
 
 #define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
 
 #define ERR_RETURN(strm,err) \
-  return (strm->msg = (char*)ERR_MSG(err), (err))
+  return (strm->msg = ERR_MSG(err), (err))
 /* To be used only when the state is known to be valid */
 
         /* common constants */
@@ -78,16 +82,18 @@
 
 #if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32))
 #  define OS_CODE  0x00
-#  if defined(__TURBOC__) || defined(__BORLANDC__)
-#    if (__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
-       /* Allow compilation with ANSI keywords only enabled */
-       void _Cdecl farfree( void *block );
-       void *_Cdecl farmalloc( unsigned long nbytes );
-#    else
-#      include <alloc.h>
+#  ifndef Z_SOLO
+#    if defined(__TURBOC__) || defined(__BORLANDC__)
+#      if (__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
+         /* Allow compilation with ANSI keywords only enabled */
+         void _Cdecl farfree( void *block );
+         void *_Cdecl farmalloc( unsigned long nbytes );
+#      else
+#        include <alloc.h>
+#      endif
+#    else /* MSC or DJGPP */
+#      include <malloc.h>
 #    endif
-#  else /* MSC or DJGPP */
-#    include <malloc.h>
 #  endif
 #endif
 
@@ -107,18 +113,20 @@
 
 #ifdef OS2
 #  define OS_CODE  0x06
-#  ifdef M_I86
+#  if defined(M_I86) && !defined(Z_SOLO)
 #    include <malloc.h>
 #  endif
 #endif
 
 #if defined(MACOS) || defined(TARGET_OS_MAC)
 #  define OS_CODE  0x07
-#  if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
-#    include <unix.h> /* for fdopen */
-#  else
-#    ifndef fdopen
-#      define fdopen(fd,mode) NULL /* No fdopen() */
+#  ifndef Z_SOLO
+#    if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
+#      include <unix.h> /* for fdopen */
+#    else
+#      ifndef fdopen
+#        define fdopen(fd,mode) NULL /* No fdopen() */
+#      endif
 #    endif
 #  endif
 #endif
@@ -153,14 +161,15 @@
 #  endif
 #endif
 
-#if defined(__BORLANDC__)
+#if defined(__BORLANDC__) && !defined(MSDOS)
   #pragma warn -8004
   #pragma warn -8008
   #pragma warn -8066
 #endif
 
 /* provide prototypes for these when building zlib without LFS */
-#if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0
+#if !defined(_WIN32) && \
+    (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)
     ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
     ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
 #endif
@@ -177,42 +186,7 @@
 
          /* functions */
 
-#if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550)
-#  ifndef HAVE_VSNPRINTF
-#    define HAVE_VSNPRINTF
-#  endif
-#endif
-#if defined(__CYGWIN__)
-#  ifndef HAVE_VSNPRINTF
-#    define HAVE_VSNPRINTF
-#  endif
-#endif
-#ifndef HAVE_VSNPRINTF
-#  ifdef MSDOS
-     /* vsnprintf may exist on some MS-DOS compilers (DJGPP?),
-        but for now we just assume it doesn't. */
-#    define NO_vsnprintf
-#  endif
-#  ifdef __TURBOC__
-#    define NO_vsnprintf
-#  endif
-#  ifdef WIN32
-     /* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */
-#    if !defined(vsnprintf) && !defined(NO_vsnprintf)
-#      if !defined(_MSC_VER) || ( defined(_MSC_VER) && _MSC_VER < 1500 )
-#         define vsnprintf _vsnprintf
-#      endif
-#    endif
-#  endif
-#  ifdef __SASC
-#    define NO_vsnprintf
-#  endif
-#endif
-#ifdef VMS
-#  define NO_vsnprintf
-#endif
-
-#if defined(pyr)
+#if defined(pyr) || defined(Z_SOLO)
 #  define NO_MEMCPY
 #endif
 #if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__)
@@ -261,14 +235,19 @@
 #  define Tracecv(c,x)
 #endif
 
-
-voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items,
-                        unsigned size));
-void ZLIB_INTERNAL zcfree  OF((voidpf opaque, voidpf ptr));
+#ifndef Z_SOLO
+   voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items,
+                                    unsigned size));
+   void ZLIB_INTERNAL zcfree  OF((voidpf opaque, voidpf ptr));
+#endif
 
 #define ZALLOC(strm, items, size) \
            (*((strm)->zalloc))((strm)->opaque, (items), (size))
 #define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
 #define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
 
+/* Reverse the bytes in a 32-bit value */
+#define ZSWAP32(q) ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \
+                    (((q) & 0xff00) << 8) + (((q) & 0xff) << 24))
+
 #endif /* ZUTIL_H */
diff --git a/Modules/zlibmodule.c b/Modules/zlibmodule.c
index 1d1072d..0d2e188 100644
--- a/Modules/zlibmodule.c
+++ b/Modules/zlibmodule.c
@@ -3,11 +3,13 @@
 
 /* Windows users:  read Python's PCbuild\readme.txt */
 
+#define PY_SSIZE_T_CLEAN
 
 #include "Python.h"
 #include "structmember.h"
 #include "zlib.h"
 
+
 #ifdef WITH_THREAD
     #include "pythread.h"
     #define ENTER_ZLIB(obj) \
@@ -27,10 +29,9 @@
 #else
 #  define DEF_MEM_LEVEL  MAX_MEM_LEVEL
 #endif
-#define DEF_WBITS MAX_WBITS
 
-/* The output buffer will be increased in chunks of DEFAULTALLOC bytes. */
-#define DEFAULTALLOC (16*1024)
+/* Initial buffer size. */
+#define DEF_BUF_SIZE (16*1024)
 
 static PyTypeObject Comptype;
 static PyTypeObject Decomptype;
@@ -80,35 +81,13 @@
         PyErr_Format(ZlibError, "Error %d %s: %.200s", err, msg, zmsg);
 }
 
-PyDoc_STRVAR(compressobj__doc__,
-"compressobj(level=-1, method=DEFLATED, wbits=15, memlevel=8,\n"
-"            strategy=Z_DEFAULT_STRATEGY[, zdict])\n"
-" -- Return a compressor object.\n"
-"\n"
-"level is the compression level (an integer in the range 0-9; default is 6).\n"
-"Higher compression levels are slower, but produce smaller results.\n"
-"\n"
-"method is the compression algorithm. If given, this must be DEFLATED.\n"
-"\n"
-"wbits is the base two logarithm of the window size (range: 8..15).\n"
-"\n"
-"memlevel controls the amount of memory used for internal compression state.\n"
-"Valid values range from 1 to 9. Higher values result in higher memory usage,\n"
-"faster compression, and smaller output.\n"
-"\n"
-"strategy is used to tune the compression algorithm. Possible values are\n"
-"Z_DEFAULT_STRATEGY, Z_FILTERED, and Z_HUFFMAN_ONLY.\n"
-"\n"
-"zdict is the predefined compression dictionary - a sequence of bytes\n"
-"containing subsequences that are likely to occur in the input data.");
-
-PyDoc_STRVAR(decompressobj__doc__,
-"decompressobj([wbits[, zdict]]) -- Return a decompressor object.\n"
-"\n"
-"Optional arg wbits is the window buffer size.\n"
-"\n"
-"Optional arg zdict is the predefined compression dictionary. This must be\n"
-"the same dictionary as used by the compressor that produced the input data.");
+/*[clinic input]
+output preset file
+module zlib
+class zlib.Compress "compobject *" "&Comptype"
+class zlib.Decompress "compobject *" "&Decomptype"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=bfd4c340573ba91d]*/
 
 static compobject *
 newcompobject(PyTypeObject *type)
@@ -132,40 +111,63 @@
     }
 #ifdef WITH_THREAD
     self->lock = PyThread_allocate_lock();
+    if (self->lock == NULL) {
+        PyErr_SetString(PyExc_MemoryError, "Unable to allocate lock");
+        return NULL;
+    }
 #endif
     return self;
 }
 
-PyDoc_STRVAR(compress__doc__,
-"compress(string[, level]) -- Returned compressed string.\n"
-"\n"
-"Optional arg level is the compression level, in 0-9.");
+static void*
+PyZlib_Malloc(voidpf ctx, uInt items, uInt size)
+{
+    if (items > (size_t)PY_SSIZE_T_MAX / size)
+        return NULL;
+    /* PyMem_Malloc() cannot be used: the GIL is not held when
+       inflate() and deflate() are called */
+    return PyMem_RawMalloc(items * size);
+}
+
+static void
+PyZlib_Free(voidpf ctx, void *ptr)
+{
+    PyMem_RawFree(ptr);
+}
+
+/*[clinic input]
+zlib.compress
+
+    bytes: Py_buffer
+        Binary data to be compressed.
+    level: int(c_default="Z_DEFAULT_COMPRESSION") = Z_DEFAULT_COMPRESSION
+        Compression level, in 0-9.
+    /
+
+Returns a bytes object containing compressed data.
+[clinic start generated code]*/
 
 static PyObject *
-PyZlib_compress(PyObject *self, PyObject *args)
+zlib_compress_impl(PyModuleDef *module, Py_buffer *bytes, int level)
+/*[clinic end generated code: output=5d7dd4588788efd3 input=be3abe9934bda4b3]*/
 {
     PyObject *ReturnVal = NULL;
-    Py_buffer pinput;
     Byte *input, *output = NULL;
     unsigned int length;
-    int level=Z_DEFAULT_COMPRESSION, err;
+    int err;
     z_stream zst;
 
-    /* require Python string object, optional 'level' arg */
-    if (!PyArg_ParseTuple(args, "y*|i:compress", &pinput, &level))
-        return NULL;
-
-    if (pinput.len > UINT_MAX) {
+    if ((size_t)bytes->len > UINT_MAX) {
         PyErr_SetString(PyExc_OverflowError,
                         "Size does not fit in an unsigned int");
         goto error;
     }
-    input = pinput.buf;
-    length = pinput.len;
+    input = bytes->buf;
+    length = (unsigned int)bytes->len;
 
     zst.avail_out = length + length/1000 + 12 + 1;
 
-    output = (Byte*)malloc(zst.avail_out);
+    output = (Byte*)PyMem_Malloc(zst.avail_out);
     if (output == NULL) {
         PyErr_SetString(PyExc_MemoryError,
                         "Can't allocate memory to compress data");
@@ -175,8 +177,9 @@
     /* Past the point of no return.  From here on out, we need to make sure
        we clean up mallocs & INCREFs. */
 
-    zst.zalloc = (alloc_func)NULL;
-    zst.zfree = (free_func)Z_NULL;
+    zst.opaque = NULL;
+    zst.zalloc = PyZlib_Malloc;
+    zst.zfree = PyZlib_Free;
     zst.next_out = (Byte *)output;
     zst.next_in = (Byte *)input;
     zst.avail_in = length;
@@ -217,56 +220,100 @@
         zlib_error(zst, err, "while finishing compression");
 
  error:
-    PyBuffer_Release(&pinput);
-    free(output);
+    PyMem_Free(output);
 
     return ReturnVal;
 }
 
-PyDoc_STRVAR(decompress__doc__,
-"decompress(string[, wbits[, bufsize]]) -- Return decompressed string.\n"
-"\n"
-"Optional arg wbits is the window buffer size.  Optional arg bufsize is\n"
-"the initial output buffer size.");
+/*[python input]
+
+class uint_converter(CConverter):
+    type = 'unsigned int'
+    converter = 'uint_converter'
+    c_ignored_default = "0"
+
+[python start generated code]*/
+/*[python end generated code: output=da39a3ee5e6b4b0d input=22263855f7a3ebfd]*/
+
+static int
+uint_converter(PyObject *obj, void *ptr)
+{
+    long val;
+    unsigned long uval;
+
+    val = PyLong_AsLong(obj);
+    if (val == -1 && PyErr_Occurred()) {
+        uval = PyLong_AsUnsignedLong(obj);
+        if (uval == (unsigned long)-1 && PyErr_Occurred())
+            return 0;
+    }
+    else {
+        if (val < 0) {
+            PyErr_SetString(PyExc_ValueError,
+                            "value must be positive");
+            return 0;
+        }
+        uval = (unsigned long)val;
+    }
+
+    if (uval > UINT_MAX) {
+        PyErr_SetString(PyExc_OverflowError,
+                        "Python int too large for C unsigned int");
+        return 0;
+    }
+
+    *(unsigned int *)ptr = Py_SAFE_DOWNCAST(uval, unsigned long, unsigned int);
+    return 1;
+}
+
+/*[clinic input]
+zlib.decompress
+
+    data: Py_buffer
+        Compressed data.
+    wbits: int(c_default="MAX_WBITS") = MAX_WBITS
+        The window buffer size.
+    bufsize: uint(c_default="DEF_BUF_SIZE") = DEF_BUF_SIZE
+        The initial output buffer size.
+    /
+
+Returns a bytes object containing the uncompressed data.
+[clinic start generated code]*/
 
 static PyObject *
-PyZlib_decompress(PyObject *self, PyObject *args)
+zlib_decompress_impl(PyModuleDef *module, Py_buffer *data, int wbits, unsigned int bufsize)
+/*[clinic end generated code: output=9e5464e72df9cb5f input=0f4b9abb7103f50e]*/
 {
     PyObject *result_str = NULL;
-    Py_buffer pinput;
     Byte *input;
     unsigned int length;
     int err;
-    int wsize=DEF_WBITS;
-    Py_ssize_t r_strlen=DEFAULTALLOC;
+    unsigned int new_bufsize;
     z_stream zst;
 
-    if (!PyArg_ParseTuple(args, "y*|in:decompress",
-                          &pinput, &wsize, &r_strlen))
-        return NULL;
-
-    if (pinput.len > UINT_MAX) {
+    if ((size_t)data->len > UINT_MAX) {
         PyErr_SetString(PyExc_OverflowError,
                         "Size does not fit in an unsigned int");
         goto error;
     }
-    input = pinput.buf;
-    length = pinput.len;
+    input = data->buf;
+    length = (unsigned int)data->len;
 
-    if (r_strlen <= 0)
-        r_strlen = 1;
+    if (bufsize == 0)
+        bufsize = 1;
 
     zst.avail_in = length;
-    zst.avail_out = r_strlen;
+    zst.avail_out = bufsize;
 
-    if (!(result_str = PyBytes_FromStringAndSize(NULL, r_strlen)))
+    if (!(result_str = PyBytes_FromStringAndSize(NULL, bufsize)))
         goto error;
 
-    zst.zalloc = (alloc_func)NULL;
-    zst.zfree = (free_func)Z_NULL;
+    zst.opaque = NULL;
+    zst.zalloc = PyZlib_Malloc;
+    zst.zfree = PyZlib_Free;
     zst.next_out = (Byte *)PyBytes_AS_STRING(result_str);
     zst.next_in = (Byte *)input;
-    err = inflateInit2(&zst, wsize);
+    err = inflateInit2(&zst, wbits);
 
     switch(err) {
     case(Z_OK):
@@ -303,14 +350,18 @@
             /* fall through */
         case(Z_OK):
             /* need more memory */
-            if (_PyBytes_Resize(&result_str, r_strlen << 1) < 0) {
+            if (bufsize <= (UINT_MAX >> 1))
+                new_bufsize = bufsize << 1;
+            else
+                new_bufsize = UINT_MAX;
+            if (_PyBytes_Resize(&result_str, new_bufsize) < 0) {
                 inflateEnd(&zst);
                 goto error;
             }
             zst.next_out =
-                (unsigned char *)PyBytes_AS_STRING(result_str) + r_strlen;
-            zst.avail_out = r_strlen;
-            r_strlen = r_strlen << 1;
+                (unsigned char *)PyBytes_AS_STRING(result_str) + bufsize;
+            zst.avail_out = bufsize;
+            bufsize = new_bufsize;
             break;
         default:
             inflateEnd(&zst);
@@ -328,46 +379,67 @@
     if (_PyBytes_Resize(&result_str, zst.total_out) < 0)
         goto error;
 
-    PyBuffer_Release(&pinput);
     return result_str;
 
  error:
-    PyBuffer_Release(&pinput);
     Py_XDECREF(result_str);
     return NULL;
 }
 
-static PyObject *
-PyZlib_compressobj(PyObject *selfptr, PyObject *args, PyObject *kwargs)
-{
-    compobject *self;
-    int level=Z_DEFAULT_COMPRESSION, method=DEFLATED;
-    int wbits=MAX_WBITS, memLevel=DEF_MEM_LEVEL, strategy=0, err;
-    Py_buffer zdict;
-    static char *kwlist[] = {"level", "method", "wbits",
-                             "memLevel", "strategy", "zdict", NULL};
+/*[clinic input]
+zlib.compressobj
 
-    zdict.buf = NULL; /* Sentinel, so we can tell whether zdict was supplied. */
-    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|iiiiiy*:compressobj",
-                                     kwlist, &level, &method, &wbits,
-                                     &memLevel, &strategy, &zdict))
-        return NULL;
+    level: int(c_default="Z_DEFAULT_COMPRESSION") = Z_DEFAULT_COMPRESSION
+        The compression level (an integer in the range 0-9; default is 6).
+        Higher compression levels are slower, but produce smaller results.
+    method: int(c_default="DEFLATED") = DEFLATED
+        The compression algorithm.  If given, this must be DEFLATED.
+    wbits: int(c_default="MAX_WBITS") = MAX_WBITS
+        The base two logarithm of the window size (range: 8..15).
+    memLevel: int(c_default="DEF_MEM_LEVEL") = DEF_MEM_LEVEL
+        Controls the amount of memory used for internal compression state.
+        Valid values range from 1 to 9.  Higher values result in higher memory
+        usage, faster compression, and smaller output.
+    strategy: int(c_default="Z_DEFAULT_STRATEGY") = Z_DEFAULT_STRATEGY
+        Used to tune the compression algorithm.  Possible values are
+        Z_DEFAULT_STRATEGY, Z_FILTERED, and Z_HUFFMAN_ONLY.
+    zdict: Py_buffer = None
+        The predefined compression dictionary - a sequence of bytes
+        containing subsequences that are likely to occur in the input data.
+
+Return a compressor object.
+[clinic start generated code]*/
+
+static PyObject *
+zlib_compressobj_impl(PyModuleDef *module, int level, int method, int wbits, int memLevel, int strategy, Py_buffer *zdict)
+/*[clinic end generated code: output=89e5a6c1449caa9e input=b034847f8821f6af]*/
+{
+    compobject *self = NULL;
+    int err;
+
+    if (zdict->buf != NULL && (size_t)zdict->len > UINT_MAX) {
+        PyErr_SetString(PyExc_OverflowError,
+                        "zdict length does not fit in an unsigned int");
+        goto error;
+    }
 
     self = newcompobject(&Comptype);
     if (self==NULL)
         goto error;
-    self->zst.zalloc = (alloc_func)NULL;
-    self->zst.zfree = (free_func)Z_NULL;
+    self->zst.opaque = NULL;
+    self->zst.zalloc = PyZlib_Malloc;
+    self->zst.zfree = PyZlib_Free;
     self->zst.next_in = NULL;
     self->zst.avail_in = 0;
     err = deflateInit2(&self->zst, level, method, wbits, memLevel, strategy);
     switch(err) {
     case (Z_OK):
         self->is_initialised = 1;
-        if (zdict.buf == NULL) {
+        if (zdict->buf == NULL) {
             goto success;
         } else {
-            err = deflateSetDictionary(&self->zst, zdict.buf, zdict.len);
+            err = deflateSetDictionary(&self->zst,
+                                       zdict->buf, (unsigned int)zdict->len);
             switch (err) {
             case (Z_OK):
                 goto success;
@@ -394,22 +466,28 @@
  error:
     Py_CLEAR(self);
  success:
-    if (zdict.buf != NULL)
-        PyBuffer_Release(&zdict);
     return (PyObject*)self;
 }
 
-static PyObject *
-PyZlib_decompressobj(PyObject *selfptr, PyObject *args, PyObject *kwargs)
-{
-    static char *kwlist[] = {"wbits", "zdict", NULL};
-    int wbits=DEF_WBITS, err;
-    compobject *self;
-    PyObject *zdict=NULL;
+/*[clinic input]
+zlib.decompressobj
 
-    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|iO:decompressobj",
-                                     kwlist, &wbits, &zdict))
-        return NULL;
+    wbits: int(c_default="MAX_WBITS") = MAX_WBITS
+        The window buffer size.
+    zdict: object(c_default="NULL") = b''
+        The predefined compression dictionary.  This must be the same
+        dictionary as used by the compressor that produced the input data.
+
+Return a decompressor object.
+[clinic start generated code]*/
+
+static PyObject *
+zlib_decompressobj_impl(PyModuleDef *module, int wbits, PyObject *zdict)
+/*[clinic end generated code: output=8ccd583fbd631798 input=67f05145a6920127]*/
+{
+    int err;
+    compobject *self;
+
     if (zdict != NULL && !PyObject_CheckBuffer(zdict)) {
         PyErr_SetString(PyExc_TypeError,
                         "zdict argument must support the buffer protocol");
@@ -419,8 +497,9 @@
     self = newcompobject(&Decomptype);
     if (self == NULL)
         return(NULL);
-    self->zst.zalloc = (alloc_func)NULL;
-    self->zst.zfree = (free_func)Z_NULL;
+    self->zst.opaque = NULL;
+    self->zst.zalloc = PyZlib_Malloc;
+    self->zst.zfree = PyZlib_Free;
     self->zst.next_in = NULL;
     self->zst.avail_in = 0;
     if (zdict != NULL) {
@@ -476,37 +555,41 @@
     Dealloc(self);
 }
 
-PyDoc_STRVAR(comp_compress__doc__,
-"compress(data) -- Return a string containing data compressed.\n"
-"\n"
-"After calling this function, some of the input data may still\n"
-"be stored in internal buffers for later processing.\n"
-"Call the flush() method to clear these buffers.");
+/*[clinic input]
+zlib.Compress.compress
 
+    data: Py_buffer
+        Binary data to be compressed.
+    /
+
+Returns a bytes object containing compressed data.
+
+After calling this function, some of the input data may still
+be stored in internal buffers for later processing.
+Call the flush() method to clear these buffers.
+[clinic start generated code]*/
 
 static PyObject *
-PyZlib_objcompress(compobject *self, PyObject *args)
+zlib_Compress_compress_impl(compobject *self, Py_buffer *data)
+/*[clinic end generated code: output=5d5cd791cbc6a7f4 input=0d95908d6e64fab8]*/
 {
     int err;
     unsigned int inplen;
-    Py_ssize_t length = DEFAULTALLOC;
-    PyObject *RetVal = NULL;
-    Py_buffer pinput;
+    unsigned int length = DEF_BUF_SIZE, new_length;
+    PyObject *RetVal;
     Byte *input;
     unsigned long start_total_out;
 
-    if (!PyArg_ParseTuple(args, "y*:compress", &pinput))
-        return NULL;
-    if (pinput.len > UINT_MAX) {
+    if ((size_t)data->len > UINT_MAX) {
         PyErr_SetString(PyExc_OverflowError,
                         "Size does not fit in an unsigned int");
-        goto error_outer;
+        return NULL;
     }
-    input = pinput.buf;
-    inplen = pinput.len;
+    input = data->buf;
+    inplen = (unsigned int)data->len;
 
     if (!(RetVal = PyBytes_FromStringAndSize(NULL, length)))
-        goto error_outer;
+        return NULL;
 
     ENTER_ZLIB(self);
 
@@ -523,15 +606,18 @@
     /* while Z_OK and the output buffer is full, there might be more output,
        so extend the output buffer and try again */
     while (err == Z_OK && self->zst.avail_out == 0) {
-        if (_PyBytes_Resize(&RetVal, length << 1) < 0) {
-            Py_DECREF(RetVal);
-            RetVal = NULL;
-            goto error;
+        if (length <= (UINT_MAX >> 1))
+            new_length = length << 1;
+        else
+            new_length = UINT_MAX;
+        if (_PyBytes_Resize(&RetVal, new_length) < 0) {
+            Py_CLEAR(RetVal);
+            goto done;
         }
         self->zst.next_out =
             (unsigned char *)PyBytes_AS_STRING(RetVal) + length;
         self->zst.avail_out = length;
-        length = length << 1;
+        length = new_length;
 
         Py_BEGIN_ALLOW_THREADS
         err = deflate(&(self->zst), Z_NO_FLUSH);
@@ -544,19 +630,15 @@
 
     if (err != Z_OK && err != Z_BUF_ERROR) {
         zlib_error(self->zst, err, "while compressing data");
-        Py_DECREF(RetVal);
-        RetVal = NULL;
-        goto error;
+        Py_CLEAR(RetVal);
+        goto done;
     }
     if (_PyBytes_Resize(&RetVal, self->zst.total_out - start_total_out) < 0) {
-        Py_DECREF(RetVal);
-        RetVal = NULL;
+        Py_CLEAR(RetVal);
     }
 
- error:
+ done:
     LEAVE_ZLIB(self);
- error_outer:
-    PyBuffer_Release(&pinput);
     return RetVal;
 }
 
@@ -572,7 +654,7 @@
             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) {
+            if ((size_t)self->zst.avail_in > (size_t)UINT_MAX - (size_t)old_size) {
                 PyErr_NoMemory();
                 return -1;
             }
@@ -603,55 +685,50 @@
     return 0;
 }
 
-PyDoc_STRVAR(decomp_decompress__doc__,
-"decompress(data, max_length) -- Return a string containing the decompressed\n"
-"version of the data.\n"
-"\n"
-"After calling this function, some of the input data may still be stored in\n"
-"internal buffers for later processing.\n"
-"Call the flush() method to clear these buffers.\n"
-"If the max_length parameter is specified then the return value will be\n"
-"no longer than max_length.  Unconsumed input data will be stored in\n"
-"the unconsumed_tail attribute.");
+/*[clinic input]
+zlib.Decompress.decompress
+
+    data: Py_buffer
+        The binary data to decompress.
+    max_length: uint = 0
+        The maximum allowable length of the decompressed data.
+        Unconsumed input data will be stored in
+        the unconsumed_tail attribute.
+    /
+
+Return a bytes object containing the decompressed version of the data.
+
+After calling this function, some of the input data may still be stored in
+internal buffers for later processing.
+Call the flush() method to clear these buffers.
+[clinic start generated code]*/
 
 static PyObject *
-PyZlib_objdecompress(compobject *self, PyObject *args)
+zlib_Decompress_decompress_impl(compobject *self, Py_buffer *data, unsigned int max_length)
+/*[clinic end generated code: output=755cccc9087bfe55 input=02cfc047377cec86]*/
 {
-    int err, max_length = 0;
-    unsigned int inplen;
-    Py_ssize_t old_length, length = DEFAULTALLOC;
+    int err;
+    unsigned int old_length, length = DEF_BUF_SIZE;
     PyObject *RetVal = NULL;
-    Py_buffer pinput;
-    Byte *input;
     unsigned long start_total_out;
 
-    if (!PyArg_ParseTuple(args, "y*|i:decompress", &pinput,
-                          &max_length))
-        return NULL;
-    if (pinput.len > UINT_MAX) {
+    if ((size_t)data->len > UINT_MAX) {
         PyErr_SetString(PyExc_OverflowError,
                         "Size does not fit in an unsigned int");
-        goto error_outer;
-    }
-    input = pinput.buf;
-    inplen = pinput.len;
-    if (max_length < 0) {
-        PyErr_SetString(PyExc_ValueError,
-                        "max_length must be greater than zero");
-        goto error_outer;
+        return NULL;
     }
 
     /* limit amount of data allocated to max_length */
     if (max_length && length > max_length)
         length = max_length;
     if (!(RetVal = PyBytes_FromStringAndSize(NULL, length)))
-        goto error_outer;
+        return NULL;
 
     ENTER_ZLIB(self);
 
     start_total_out = self->zst.total_out;
-    self->zst.avail_in = inplen;
-    self->zst.next_in = input;
+    self->zst.avail_in = (unsigned int)data->len;
+    self->zst.next_in = data->buf;
     self->zst.avail_out = length;
     self->zst.next_out = (unsigned char *)PyBytes_AS_STRING(RetVal);
 
@@ -666,12 +743,21 @@
             RetVal = NULL;
             goto error;
         }
-        err = inflateSetDictionary(&(self->zst), zdict_buf.buf, zdict_buf.len);
+
+        if ((size_t)zdict_buf.len > UINT_MAX) {
+            PyErr_SetString(PyExc_OverflowError,
+                    "zdict length does not fit in an unsigned int");
+            PyBuffer_Release(&zdict_buf);
+            Py_CLEAR(RetVal);
+            goto error;
+        }
+
+        err = inflateSetDictionary(&(self->zst),
+                                   zdict_buf.buf, (unsigned int)zdict_buf.len);
         PyBuffer_Release(&zdict_buf);
         if (err != Z_OK) {
             zlib_error(self->zst, err, "while decompressing data");
-            Py_DECREF(RetVal);
-            RetVal = NULL;
+            Py_CLEAR(RetVal);
             goto error;
         }
         /* Repeat the call to inflate. */
@@ -697,8 +783,7 @@
             length = max_length;
 
         if (_PyBytes_Resize(&RetVal, length) < 0) {
-            Py_DECREF(RetVal);
-            RetVal = NULL;
+            Py_CLEAR(RetVal);
             goto error;
         }
         self->zst.next_out =
@@ -732,39 +817,39 @@
     }
 
     if (_PyBytes_Resize(&RetVal, self->zst.total_out - start_total_out) < 0) {
-        Py_DECREF(RetVal);
-        RetVal = NULL;
+        Py_CLEAR(RetVal);
     }
 
  error:
     LEAVE_ZLIB(self);
- error_outer:
-    PyBuffer_Release(&pinput);
     return RetVal;
 }
 
-PyDoc_STRVAR(comp_flush__doc__,
-"flush( [mode] ) -- Return a string containing any remaining compressed data.\n"
-"\n"
-"mode can be one of the constants Z_SYNC_FLUSH, Z_FULL_FLUSH, Z_FINISH; the\n"
-"default value used when mode is not specified is Z_FINISH.\n"
-"If mode == Z_FINISH, the compressor object can no longer be used after\n"
-"calling the flush() method.  Otherwise, more data can still be compressed.");
+/*[clinic input]
+zlib.Compress.flush
+
+    mode: int(c_default="Z_FINISH") = zlib.Z_FINISH
+        One of the constants Z_SYNC_FLUSH, Z_FULL_FLUSH, Z_FINISH.
+        If mode == Z_FINISH, the compressor object can no longer be
+        used after calling the flush() method.  Otherwise, more data
+        can still be compressed.
+    /
+
+Return a bytes object containing any remaining compressed data.
+[clinic start generated code]*/
 
 static PyObject *
-PyZlib_flush(compobject *self, PyObject *args)
+zlib_Compress_flush_impl(compobject *self, int mode)
+/*[clinic end generated code: output=a203f4cefc9de727 input=73ed066794bd15bc]*/
 {
-    int err, length = DEFAULTALLOC;
+    int err;
+    unsigned int length = DEF_BUF_SIZE, new_length;
     PyObject *RetVal;
-    int flushmode = Z_FINISH;
     unsigned long start_total_out;
 
-    if (!PyArg_ParseTuple(args, "|i:flush", &flushmode))
-        return NULL;
-
     /* Flushing with Z_NO_FLUSH is a no-op, so there's no point in
        doing any work at all; just return an empty string. */
-    if (flushmode == Z_NO_FLUSH) {
+    if (mode == Z_NO_FLUSH) {
         return PyBytes_FromStringAndSize(NULL, 0);
     }
 
@@ -779,31 +864,34 @@
     self->zst.next_out = (unsigned char *)PyBytes_AS_STRING(RetVal);
 
     Py_BEGIN_ALLOW_THREADS
-    err = deflate(&(self->zst), flushmode);
+    err = deflate(&(self->zst), mode);
     Py_END_ALLOW_THREADS
 
     /* while Z_OK and the output buffer is full, there might be more output,
        so extend the output buffer and try again */
     while (err == Z_OK && self->zst.avail_out == 0) {
-        if (_PyBytes_Resize(&RetVal, length << 1) < 0) {
-            Py_DECREF(RetVal);
-            RetVal = NULL;
+        if (length <= (UINT_MAX >> 1))
+            new_length = length << 1;
+        else
+            new_length = UINT_MAX;
+        if (_PyBytes_Resize(&RetVal, new_length) < 0) {
+            Py_CLEAR(RetVal);
             goto error;
         }
         self->zst.next_out =
             (unsigned char *)PyBytes_AS_STRING(RetVal) + length;
         self->zst.avail_out = length;
-        length = length << 1;
+        length = new_length;
 
         Py_BEGIN_ALLOW_THREADS
-        err = deflate(&(self->zst), flushmode);
+        err = deflate(&(self->zst), mode);
         Py_END_ALLOW_THREADS
     }
 
-    /* If flushmode is Z_FINISH, we also have to call deflateEnd() to free
+    /* If mode is Z_FINISH, we also have to call deflateEnd() to free
        various data structures. Note we should only get Z_STREAM_END when
-       flushmode is Z_FINISH, but checking both for safety*/
-    if (err == Z_STREAM_END && flushmode == Z_FINISH) {
+       mode is Z_FINISH, but checking both for safety*/
+    if (err == Z_STREAM_END && mode == Z_FINISH) {
         err = deflateEnd(&(self->zst));
         if (err != Z_OK) {
             zlib_error(self->zst, err, "while finishing compression");
@@ -826,8 +914,7 @@
     }
 
     if (_PyBytes_Resize(&RetVal, self->zst.total_out - start_total_out) < 0) {
-        Py_DECREF(RetVal);
-        RetVal = NULL;
+        Py_CLEAR(RetVal);
     }
 
  error:
@@ -837,11 +924,16 @@
 }
 
 #ifdef HAVE_ZLIB_COPY
-PyDoc_STRVAR(comp_copy__doc__,
-"copy() -- Return a copy of the compression object.");
+
+/*[clinic input]
+zlib.Compress.copy
+
+Return a copy of the compression object.
+[clinic start generated code]*/
 
 static PyObject *
-PyZlib_copy(compobject *self)
+zlib_Compress_copy_impl(compobject *self)
+/*[clinic end generated code: output=5144aa153c21e805 input=c656351f94b82718]*/
 {
     compobject *retval = NULL;
     int err;
@@ -891,11 +983,15 @@
     return NULL;
 }
 
-PyDoc_STRVAR(decomp_copy__doc__,
-"copy() -- Return a copy of the decompression object.");
+/*[clinic input]
+zlib.Decompress.copy
+
+Return a copy of the decompression object.
+[clinic start generated code]*/
 
 static PyObject *
-PyZlib_uncopy(compobject *self)
+zlib_Decompress_copy_impl(compobject *self)
+/*[clinic end generated code: output=02a883a2a510c8cc input=ba6c3e96712a596b]*/
 {
     compobject *retval = NULL;
     int err;
@@ -947,34 +1043,43 @@
 }
 #endif
 
-PyDoc_STRVAR(decomp_flush__doc__,
-"flush( [length] ) -- Return a string containing any remaining\n"
-"decompressed data. length, if given, is the initial size of the\n"
-"output buffer.\n"
-"\n"
-"The decompressor object can no longer be used after this call.");
+/*[clinic input]
+zlib.Decompress.flush
+
+    length: uint(c_default="DEF_BUF_SIZE") = zlib.DEF_BUF_SIZE
+        the initial size of the output buffer.
+    /
+
+Return a bytes object containing any remaining decompressed data.
+[clinic start generated code]*/
 
 static PyObject *
-PyZlib_unflush(compobject *self, PyObject *args)
+zlib_Decompress_flush_impl(compobject *self, unsigned int length)
+/*[clinic end generated code: output=db6fb753ab698e22 input=1580956505978993]*/
 {
-    int err, length = DEFAULTALLOC;
+    int err;
+    unsigned int new_length;
     PyObject * retval = NULL;
     unsigned long start_total_out;
+    Py_ssize_t size;
 
-    if (!PyArg_ParseTuple(args, "|i:flush", &length))
-        return NULL;
-    if (length <= 0) {
+    if (length == 0) {
         PyErr_SetString(PyExc_ValueError, "length must be greater than zero");
         return NULL;
     }
+
     if (!(retval = PyBytes_FromStringAndSize(NULL, length)))
         return NULL;
 
 
     ENTER_ZLIB(self);
 
+    size = PyBytes_GET_SIZE(self->unconsumed_tail);
+
     start_total_out = self->zst.total_out;
-    self->zst.avail_in = PyBytes_GET_SIZE(self->unconsumed_tail);
+    /* save_unconsumed_input() ensures that unconsumed_tail length is lesser
+       or equal than UINT_MAX */
+    self->zst.avail_in = Py_SAFE_DOWNCAST(size, Py_ssize_t, unsigned int);
     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);
@@ -986,14 +1091,17 @@
     /* while Z_OK and the output buffer is full, there might be more output,
        so extend the output buffer and try again */
     while ((err == Z_OK || err == Z_BUF_ERROR) && self->zst.avail_out == 0) {
-        if (_PyBytes_Resize(&retval, length << 1) < 0) {
-            Py_DECREF(retval);
-            retval = NULL;
+        if (length <= (UINT_MAX >> 1))
+            new_length = length << 1;
+        else
+            new_length = UINT_MAX;
+        if (_PyBytes_Resize(&retval, new_length) < 0) {
+            Py_CLEAR(retval);
             goto error;
         }
         self->zst.next_out = (Byte *)PyBytes_AS_STRING(retval) + length;
         self->zst.avail_out = length;
-        length = length << 1;
+        length = new_length;
 
         Py_BEGIN_ALLOW_THREADS
         err = inflate(&(self->zst), Z_FINISH);
@@ -1020,8 +1128,7 @@
     }
 
     if (_PyBytes_Resize(&retval, self->zst.total_out - start_total_out) < 0) {
-        Py_DECREF(retval);
-        retval = NULL;
+        Py_CLEAR(retval);
     }
 
 error:
@@ -1031,28 +1138,24 @@
     return retval;
 }
 
+#include "clinic/zlibmodule.c.h"
+
 static PyMethodDef comp_methods[] =
 {
-    {"compress", (binaryfunc)PyZlib_objcompress, METH_VARARGS,
-                 comp_compress__doc__},
-    {"flush", (binaryfunc)PyZlib_flush, METH_VARARGS,
-              comp_flush__doc__},
+    ZLIB_COMPRESS_COMPRESS_METHODDEF
+    ZLIB_COMPRESS_FLUSH_METHODDEF
 #ifdef HAVE_ZLIB_COPY
-    {"copy",  (PyCFunction)PyZlib_copy, METH_NOARGS,
-              comp_copy__doc__},
+    ZLIB_COMPRESS_COPY_METHODDEF
 #endif
     {NULL, NULL}
 };
 
 static PyMethodDef Decomp_methods[] =
 {
-    {"decompress", (binaryfunc)PyZlib_objdecompress, METH_VARARGS,
-                   decomp_decompress__doc__},
-    {"flush", (binaryfunc)PyZlib_unflush, METH_VARARGS,
-              decomp_flush__doc__},
+    ZLIB_DECOMPRESS_DECOMPRESS_METHODDEF
+    ZLIB_DECOMPRESS_FLUSH_METHODDEF
 #ifdef HAVE_ZLIB_COPY
-    {"copy",  (PyCFunction)PyZlib_uncopy, METH_NOARGS,
-              decomp_copy__doc__},
+    ZLIB_DECOMPRESS_COPY_METHODDEF
 #endif
     {NULL, NULL}
 };
@@ -1065,96 +1168,95 @@
     {NULL},
 };
 
-PyDoc_STRVAR(adler32__doc__,
-"adler32(string[, start]) -- Compute an Adler-32 checksum of string.\n"
-"\n"
-"An optional starting value can be specified.  The returned checksum is\n"
-"an integer.");
+/*[clinic input]
+zlib.adler32
+
+    data: Py_buffer
+    value: unsigned_int(bitwise=True) = 1
+        Starting value of the checksum.
+    /
+
+Compute an Adler-32 checksum of data.
+
+The returned checksum is an integer.
+[clinic start generated code]*/
 
 static PyObject *
-PyZlib_adler32(PyObject *self, PyObject *args)
+zlib_adler32_impl(PyModuleDef *module, Py_buffer *data, unsigned int value)
+/*[clinic end generated code: output=51d6d75ee655c78a input=6ff4557872160e88]*/
 {
-    unsigned int adler32val = 1;  /* adler32(0L, Z_NULL, 0) */
-    Py_buffer pbuf;
-
-    if (!PyArg_ParseTuple(args, "y*|I:adler32", &pbuf, &adler32val))
-        return NULL;
     /* Releasing the GIL for very small buffers is inefficient
        and may lower performance */
-    if (pbuf.len > 1024*5) {
-        unsigned char *buf = pbuf.buf;
-        Py_ssize_t len = pbuf.len;
+    if (data->len > 1024*5) {
+        unsigned char *buf = data->buf;
+        Py_ssize_t len = data->len;
 
         Py_BEGIN_ALLOW_THREADS
         /* Avoid truncation of length for very large buffers. adler32() takes
            length as an unsigned int, which may be narrower than Py_ssize_t. */
-        while (len > (size_t) UINT_MAX) {
-            adler32val = adler32(adler32val, buf, UINT_MAX);
+        while ((size_t)len > UINT_MAX) {
+            value = adler32(value, buf, UINT_MAX);
             buf += (size_t) UINT_MAX;
             len -= (size_t) UINT_MAX;
         }
-        adler32val = adler32(adler32val, buf, len);
+        value = adler32(value, buf, (unsigned int)len);
         Py_END_ALLOW_THREADS
     } else {
-        adler32val = adler32(adler32val, pbuf.buf, pbuf.len);
+        value = adler32(value, data->buf, (unsigned int)data->len);
     }
-    PyBuffer_Release(&pbuf);
-    return PyLong_FromUnsignedLong(adler32val & 0xffffffffU);
+    return PyLong_FromUnsignedLong(value & 0xffffffffU);
 }
 
-PyDoc_STRVAR(crc32__doc__,
-"crc32(string[, start]) -- Compute a CRC-32 checksum of string.\n"
-"\n"
-"An optional starting value can be specified.  The returned checksum is\n"
-"an integer.");
+/*[clinic input]
+zlib.crc32
+
+    data: Py_buffer
+    value: unsigned_int(bitwise=True) = 0
+        Starting value of the checksum.
+    /
+
+Compute a CRC-32 checksum of data.
+
+The returned checksum is an integer.
+[clinic start generated code]*/
 
 static PyObject *
-PyZlib_crc32(PyObject *self, PyObject *args)
+zlib_crc32_impl(PyModuleDef *module, Py_buffer *data, unsigned int value)
+/*[clinic end generated code: output=c1e986e74fe7b623 input=26c3ed430fa00b4c]*/
 {
-    unsigned int crc32val = 0;  /* crc32(0L, Z_NULL, 0) */
-    Py_buffer pbuf;
     int signed_val;
 
-    if (!PyArg_ParseTuple(args, "y*|I:crc32", &pbuf, &crc32val))
-        return NULL;
     /* Releasing the GIL for very small buffers is inefficient
        and may lower performance */
-    if (pbuf.len > 1024*5) {
-        unsigned char *buf = pbuf.buf;
-        Py_ssize_t len = pbuf.len;
+    if (data->len > 1024*5) {
+        unsigned char *buf = data->buf;
+        Py_ssize_t len = data->len;
 
         Py_BEGIN_ALLOW_THREADS
         /* Avoid truncation of length for very large buffers. crc32() takes
            length as an unsigned int, which may be narrower than Py_ssize_t. */
-        while (len > (size_t) UINT_MAX) {
-            crc32val = crc32(crc32val, buf, UINT_MAX);
+        while ((size_t)len > UINT_MAX) {
+            value = crc32(value, buf, UINT_MAX);
             buf += (size_t) UINT_MAX;
             len -= (size_t) UINT_MAX;
         }
-        signed_val = crc32(crc32val, buf, len);
+        signed_val = crc32(value, buf, (unsigned int)len);
         Py_END_ALLOW_THREADS
     } else {
-        signed_val = crc32(crc32val, pbuf.buf, pbuf.len);
+        signed_val = crc32(value, data->buf, (unsigned int)data->len);
     }
-    PyBuffer_Release(&pbuf);
     return PyLong_FromUnsignedLong(signed_val & 0xffffffffU);
 }
 
 
 static PyMethodDef zlib_methods[] =
 {
-    {"adler32", (PyCFunction)PyZlib_adler32, METH_VARARGS,
-                adler32__doc__},
-    {"compress", (PyCFunction)PyZlib_compress,  METH_VARARGS,
-                 compress__doc__},
-    {"compressobj", (PyCFunction)PyZlib_compressobj, METH_VARARGS|METH_KEYWORDS,
-                    compressobj__doc__},
-    {"crc32", (PyCFunction)PyZlib_crc32, METH_VARARGS,
-              crc32__doc__},
-    {"decompress", (PyCFunction)PyZlib_decompress, METH_VARARGS,
-                   decompress__doc__},
-    {"decompressobj", (PyCFunction)PyZlib_decompressobj, METH_VARARGS|METH_KEYWORDS,
-                   decompressobj__doc__},
+    ZLIB_ADLER32_METHODDEF
+    ZLIB_COMPRESS_METHODDEF
+    ZLIB_COMPRESSOBJ_METHODDEF
+    ZLIB_CRC32_METHODDEF
+    ZLIB_DECOMPRESS_METHODDEF
+    ZLIB_DECOMPRESSOBJ_METHODDEF
     {NULL, NULL}
 };
 
@@ -1265,20 +1367,21 @@
         Py_INCREF(ZlibError);
         PyModule_AddObject(m, "error", ZlibError);
     }
-    PyModule_AddIntConstant(m, "MAX_WBITS", MAX_WBITS);
-    PyModule_AddIntConstant(m, "DEFLATED", DEFLATED);
-    PyModule_AddIntConstant(m, "DEF_MEM_LEVEL", DEF_MEM_LEVEL);
-    PyModule_AddIntConstant(m, "Z_BEST_SPEED", Z_BEST_SPEED);
-    PyModule_AddIntConstant(m, "Z_BEST_COMPRESSION", Z_BEST_COMPRESSION);
-    PyModule_AddIntConstant(m, "Z_DEFAULT_COMPRESSION", Z_DEFAULT_COMPRESSION);
-    PyModule_AddIntConstant(m, "Z_FILTERED", Z_FILTERED);
-    PyModule_AddIntConstant(m, "Z_HUFFMAN_ONLY", Z_HUFFMAN_ONLY);
-    PyModule_AddIntConstant(m, "Z_DEFAULT_STRATEGY", Z_DEFAULT_STRATEGY);
+    PyModule_AddIntMacro(m, MAX_WBITS);
+    PyModule_AddIntMacro(m, DEFLATED);
+    PyModule_AddIntMacro(m, DEF_MEM_LEVEL);
+    PyModule_AddIntMacro(m, DEF_BUF_SIZE);
+    PyModule_AddIntMacro(m, Z_BEST_SPEED);
+    PyModule_AddIntMacro(m, Z_BEST_COMPRESSION);
+    PyModule_AddIntMacro(m, Z_DEFAULT_COMPRESSION);
+    PyModule_AddIntMacro(m, Z_FILTERED);
+    PyModule_AddIntMacro(m, Z_HUFFMAN_ONLY);
+    PyModule_AddIntMacro(m, Z_DEFAULT_STRATEGY);
 
-    PyModule_AddIntConstant(m, "Z_FINISH", Z_FINISH);
-    PyModule_AddIntConstant(m, "Z_NO_FLUSH", Z_NO_FLUSH);
-    PyModule_AddIntConstant(m, "Z_SYNC_FLUSH", Z_SYNC_FLUSH);
-    PyModule_AddIntConstant(m, "Z_FULL_FLUSH", Z_FULL_FLUSH);
+    PyModule_AddIntMacro(m, Z_FINISH);
+    PyModule_AddIntMacro(m, Z_NO_FLUSH);
+    PyModule_AddIntMacro(m, Z_SYNC_FLUSH);
+    PyModule_AddIntMacro(m, Z_FULL_FLUSH);
 
     ver = PyUnicode_FromString(ZLIB_VERSION);
     if (ver != NULL)
diff --git a/Objects/abstract.c b/Objects/abstract.c
index 124e766..7e3121a 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -64,49 +64,72 @@
 }
 #define PyObject_Length PyObject_Size
 
+int
+_PyObject_HasLen(PyObject *o) {
+    return (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_length) ||
+        (Py_TYPE(o)->tp_as_mapping && Py_TYPE(o)->tp_as_mapping->mp_length);
+}
 
 /* The length hint function returns a non-negative value from o.__len__()
-   or o.__length_hint__().  If those methods aren't found or return a negative
-   value, then the defaultvalue is returned.  If one of the calls fails,
+   or o.__length_hint__(). If those methods aren't found the defaultvalue is
+   returned.  If one of the calls fails with an exception other than TypeError
    this function returns -1.
 */
 
 Py_ssize_t
-_PyObject_LengthHint(PyObject *o, Py_ssize_t defaultvalue)
+PyObject_LengthHint(PyObject *o, Py_ssize_t defaultvalue)
 {
+    PyObject *hint, *result;
+    Py_ssize_t res;
     _Py_IDENTIFIER(__length_hint__);
-    PyObject *ro, *hintmeth;
-    Py_ssize_t rv;
-
-    /* try o.__len__() */
-    rv = PyObject_Size(o);
-    if (rv >= 0)
-        return rv;
-    if (PyErr_Occurred()) {
-        if (!PyErr_ExceptionMatches(PyExc_TypeError))
-            return -1;
-        PyErr_Clear();
+    if (_PyObject_HasLen(o)) {
+        res = PyObject_Length(o);
+        if (res < 0 && PyErr_Occurred()) {
+            if (!PyErr_ExceptionMatches(PyExc_TypeError)) {
+                return -1;
+            }
+            PyErr_Clear();
+        }
+        else {
+            return res;
+        }
     }
-
-    /* try o.__length_hint__() */
-    hintmeth = _PyObject_LookupSpecial(o, &PyId___length_hint__);
-    if (hintmeth == NULL) {
-        if (PyErr_Occurred())
+    hint = _PyObject_LookupSpecial(o, &PyId___length_hint__);
+    if (hint == NULL) {
+        if (PyErr_Occurred()) {
             return -1;
-        else
-            return defaultvalue;
-    }
-    ro = PyObject_CallFunctionObjArgs(hintmeth, NULL);
-    Py_DECREF(hintmeth);
-    if (ro == NULL) {
-        if (!PyErr_ExceptionMatches(PyExc_TypeError))
-            return -1;
-        PyErr_Clear();
+        }
         return defaultvalue;
     }
-    rv = PyLong_Check(ro) ? PyLong_AsSsize_t(ro) : defaultvalue;
-    Py_DECREF(ro);
-    return rv;
+    result = PyObject_CallFunctionObjArgs(hint, NULL);
+    Py_DECREF(hint);
+    if (result == NULL) {
+        if (PyErr_ExceptionMatches(PyExc_TypeError)) {
+            PyErr_Clear();
+            return defaultvalue;
+        }
+        return -1;
+    }
+    else if (result == Py_NotImplemented) {
+        Py_DECREF(result);
+        return defaultvalue;
+    }
+    if (!PyLong_Check(result)) {
+        PyErr_Format(PyExc_TypeError, "__length_hint__ must be an integer, not %.100s",
+            Py_TYPE(result)->tp_name);
+        Py_DECREF(result);
+        return -1;
+    }
+    res = PyLong_AsSsize_t(result);
+    Py_DECREF(result);
+    if (res < 0 && PyErr_Occurred()) {
+        return -1;
+    }
+    if (res < 0) {
+        PyErr_Format(PyExc_ValueError, "__length_hint__() should return >= 0");
+        return -1;
+    }
+    return res;
 }
 
 PyObject *
@@ -202,7 +225,7 @@
 }
 
 int
-PyObject_DelItemString(PyObject *o, char *key)
+PyObject_DelItemString(PyObject *o, const char *key)
 {
     PyObject *okey;
     int ret;
@@ -227,28 +250,7 @@
                       const char **buffer,
                       Py_ssize_t *buffer_len)
 {
-    PyBufferProcs *pb;
-    Py_buffer view;
-
-    if (obj == NULL || buffer == NULL || buffer_len == NULL) {
-        null_error();
-        return -1;
-    }
-    pb = obj->ob_type->tp_as_buffer;
-    if (pb == NULL || pb->bf_getbuffer == NULL) {
-        PyErr_SetString(PyExc_TypeError,
-                        "expected bytes, bytearray "
-                        "or buffer compatible object");
-        return -1;
-    }
-    if ((*pb->bf_getbuffer)(obj, &view, PyBUF_SIMPLE)) return -1;
-
-    *buffer = view.buf;
-    *buffer_len = view.len;
-    if (pb->bf_releasebuffer != NULL)
-        (*pb->bf_releasebuffer)(obj, &view);
-    Py_XDECREF(view.obj);
-    return 0;
+    return PyObject_AsReadBuffer(obj, (const void **)buffer, buffer_len);
 }
 
 int
@@ -272,28 +274,18 @@
                           const void **buffer,
                           Py_ssize_t *buffer_len)
 {
-    PyBufferProcs *pb;
     Py_buffer view;
 
     if (obj == NULL || buffer == NULL || buffer_len == NULL) {
         null_error();
         return -1;
     }
-    pb = obj->ob_type->tp_as_buffer;
-    if (pb == NULL ||
-        pb->bf_getbuffer == NULL) {
-        PyErr_SetString(PyExc_TypeError,
-                        "expected an object with a buffer interface");
+    if (PyObject_GetBuffer(obj, &view, PyBUF_SIMPLE) != 0)
         return -1;
-    }
-
-    if ((*pb->bf_getbuffer)(obj, &view, PyBUF_SIMPLE)) return -1;
 
     *buffer = view.buf;
     *buffer_len = view.len;
-    if (pb->bf_releasebuffer != NULL)
-        (*pb->bf_releasebuffer)(obj, &view);
-    Py_XDECREF(view.obj);
+    PyBuffer_Release(&view);
     return 0;
 }
 
@@ -319,9 +311,7 @@
 
     *buffer = view.buf;
     *buffer_len = view.len;
-    if (pb->bf_releasebuffer != NULL)
-        (*pb->bf_releasebuffer)(obj, &view);
-    Py_XDECREF(view.obj);
+    PyBuffer_Release(&view);
     return 0;
 }
 
@@ -330,13 +320,15 @@
 int
 PyObject_GetBuffer(PyObject *obj, Py_buffer *view, int flags)
 {
-    if (!PyObject_CheckBuffer(obj)) {
+    PyBufferProcs *pb = obj->ob_type->tp_as_buffer;
+
+    if (pb == NULL || pb->bf_getbuffer == NULL) {
         PyErr_Format(PyExc_TypeError,
                      "'%.100s' does not support the buffer interface",
                      Py_TYPE(obj)->tp_name);
         return -1;
     }
-    return (*(obj->ob_type->tp_as_buffer->bf_getbuffer))(obj, view, flags);
+    return (*pb->bf_getbuffer)(obj, view, flags);
 }
 
 static int
@@ -465,7 +457,7 @@
 
     /* Otherwise a more elaborate scheme is needed */
 
-    /* XXX(nnorwitz): need to check for overflow! */
+    /* view->ndim <= 64 */
     indices = (Py_ssize_t *)PyMem_Malloc(sizeof(Py_ssize_t)*(view->ndim));
     if (indices == NULL) {
         PyErr_NoMemory();
@@ -487,10 +479,10 @@
      */
     elements = len / view->itemsize;
     while (elements--) {
-        addone(view->ndim, indices, view->shape);
         ptr = PyBuffer_GetPointer(view, indices);
         memcpy(ptr, src, view->itemsize);
         src += view->itemsize;
+        addone(view->ndim, indices, view->shape);
     }
 
     PyMem_Free(indices);
@@ -629,10 +621,14 @@
 PyBuffer_Release(Py_buffer *view)
 {
     PyObject *obj = view->obj;
-    if (obj && Py_TYPE(obj)->tp_as_buffer && Py_TYPE(obj)->tp_as_buffer->bf_releasebuffer)
-        Py_TYPE(obj)->tp_as_buffer->bf_releasebuffer(obj, view);
-    Py_XDECREF(obj);
+    PyBufferProcs *pb;
+    if (obj == NULL)
+        return;
+    pb = Py_TYPE(obj)->tp_as_buffer;
+    if (pb && pb->bf_releasebuffer)
+        pb->bf_releasebuffer(obj, view);
     view->obj = NULL;
+    Py_DECREF(obj);
 }
 
 PyObject *
@@ -1162,6 +1158,15 @@
         Py_DECREF(result);
         return NULL;
     }
+    /* Issue #17576: warn if 'result' not of exact type int. */
+    if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
+            "__index__ returned non-int (type %.200s).  "
+            "The ability to return an instance of a strict subclass of int "
+            "is deprecated, and may be removed in a future version of Python.",
+            result->ob_type->tp_name)) {
+        Py_DECREF(result);
+        return NULL;
+    }
     return result;
 }
 
@@ -1217,8 +1222,7 @@
 {
     PyNumberMethods *m;
     PyObject *trunc_func;
-    const char *buffer;
-    Py_ssize_t buffer_len;
+    Py_buffer view;
     _Py_IDENTIFIER(__trunc__);
 
     if (o == NULL)
@@ -1256,21 +1260,22 @@
     if (PyErr_Occurred())
         return NULL;
 
-    if (PyBytes_Check(o))
+    if (PyUnicode_Check(o))
+        /* The below check is done in PyLong_FromUnicode(). */
+        return PyLong_FromUnicodeObject(o, 10);
+
+    if (PyObject_GetBuffer(o, &view, PyBUF_SIMPLE) == 0) {
         /* need to do extra error checking that PyLong_FromString()
          * doesn't do.  In particular int('9\x005') must raise an
          * exception, not truncate at the null.
          */
-        return _PyLong_FromBytes(PyBytes_AS_STRING(o),
-                                 PyBytes_GET_SIZE(o), 10);
-    if (PyUnicode_Check(o))
-        /* The above check is done in PyLong_FromUnicode(). */
-        return PyLong_FromUnicodeObject(o, 10);
-    if (!PyObject_AsCharBuffer(o, &buffer, &buffer_len))
-        return _PyLong_FromBytes(buffer, buffer_len, 10);
+        PyObject *result = _PyLong_FromBytes(view.buf, view.len, 10);
+        PyBuffer_Release(&view);
+        return result;
+    }
 
-    return type_error("int() argument must be a string or a "
-                      "number, not '%.200s'", o);
+    return type_error("int() argument must be a string, a bytes-like object "
+                      "or a number, not '%.200s'", o);
 }
 
 PyObject *
@@ -1640,7 +1645,7 @@
         return NULL;
 
     /* Guess result size and allocate space. */
-    n = _PyObject_LengthHint(v, 10);
+    n = PyObject_LengthHint(v, 10);
     if (n == -1)
         goto Fail;
     result = PyTuple_New(n);
@@ -1900,7 +1905,7 @@
 #define PyMapping_Length PyMapping_Size
 
 PyObject *
-PyMapping_GetItemString(PyObject *o, char *key)
+PyMapping_GetItemString(PyObject *o, const char *key)
 {
     PyObject *okey, *r;
 
@@ -1916,7 +1921,7 @@
 }
 
 int
-PyMapping_SetItemString(PyObject *o, char *key, PyObject *value)
+PyMapping_SetItemString(PyObject *o, const char *key, PyObject *value)
 {
     PyObject *okey;
     int r;
@@ -1935,7 +1940,7 @@
 }
 
 int
-PyMapping_HasKeyString(PyObject *o, char *key)
+PyMapping_HasKeyString(PyObject *o, const char *key)
 {
     PyObject *v;
 
@@ -2034,10 +2039,16 @@
             return NULL;
         result = (*call)(func, arg, kw);
         Py_LeaveRecursiveCall();
-        if (result == NULL && !PyErr_Occurred())
+#ifdef NDEBUG
+        if (result == NULL && !PyErr_Occurred()) {
             PyErr_SetString(
                 PyExc_SystemError,
                 "NULL result without error in PyObject_Call");
+        }
+#else
+        assert((result != NULL && !PyErr_Occurred())
+                || (result == NULL && PyErr_Occurred()));
+#endif
         return result;
     }
     PyErr_Format(PyExc_TypeError, "'%.200s' object is not callable",
@@ -2072,7 +2083,7 @@
 }
 
 PyObject *
-PyObject_CallFunction(PyObject *callable, char *format, ...)
+PyObject_CallFunction(PyObject *callable, const char *format, ...)
 {
     va_list va;
     PyObject *args;
@@ -2087,12 +2098,14 @@
     }
     else
         args = PyTuple_New(0);
+    if (args == NULL)
+        return NULL;
 
     return call_function_tail(callable, args);
 }
 
 PyObject *
-_PyObject_CallFunction_SizeT(PyObject *callable, char *format, ...)
+_PyObject_CallFunction_SizeT(PyObject *callable, const char *format, ...)
 {
     va_list va;
     PyObject *args;
@@ -2112,7 +2125,7 @@
 }
 
 static PyObject*
-callmethod(PyObject* func, char *format, va_list va, int is_size_t)
+callmethod(PyObject* func, const char *format, va_list va, int is_size_t)
 {
     PyObject *retval = NULL;
     PyObject *args;
@@ -2141,7 +2154,7 @@
 }
 
 PyObject *
-PyObject_CallMethod(PyObject *o, char *name, char *format, ...)
+PyObject_CallMethod(PyObject *o, const char *name, const char *format, ...)
 {
     va_list va;
     PyObject *func = NULL;
@@ -2151,9 +2164,8 @@
         return null_error();
 
     func = PyObject_GetAttrString(o, name);
-    if (func == NULL) {
-        return 0;
-    }
+    if (func == NULL)
+        return NULL;
 
     va_start(va, format);
     retval = callmethod(func, format, va, 0);
@@ -2162,7 +2174,8 @@
 }
 
 PyObject *
-_PyObject_CallMethodId(PyObject *o, _Py_Identifier *name, char *format, ...)
+_PyObject_CallMethodId(PyObject *o, _Py_Identifier *name,
+                       const char *format, ...)
 {
     va_list va;
     PyObject *func = NULL;
@@ -2172,9 +2185,8 @@
         return null_error();
 
     func = _PyObject_GetAttrId(o, name);
-    if (func == NULL) {
-        return 0;
-    }
+    if (func == NULL)
+        return NULL;
 
     va_start(va, format);
     retval = callmethod(func, format, va, 0);
@@ -2183,7 +2195,8 @@
 }
 
 PyObject *
-_PyObject_CallMethod_SizeT(PyObject *o, char *name, char *format, ...)
+_PyObject_CallMethod_SizeT(PyObject *o, const char *name,
+                           const char *format, ...)
 {
     va_list va;
     PyObject *func = NULL;
@@ -2193,9 +2206,8 @@
         return null_error();
 
     func = PyObject_GetAttrString(o, name);
-    if (func == NULL) {
-        return 0;
-    }
+    if (func == NULL)
+        return NULL;
     va_start(va, format);
     retval = callmethod(func, format, va, 1);
     va_end(va);
@@ -2203,7 +2215,8 @@
 }
 
 PyObject *
-_PyObject_CallMethodId_SizeT(PyObject *o, _Py_Identifier *name, char *format, ...)
+_PyObject_CallMethodId_SizeT(PyObject *o, _Py_Identifier *name,
+                             const char *format, ...)
 {
     va_list va;
     PyObject *func = NULL;
@@ -2273,7 +2286,7 @@
 }
 
 PyObject *
-_PyObject_CallMethodObjIdArgs(PyObject *callable,
+_PyObject_CallMethodIdObjArgs(PyObject *callable,
         struct _Py_Identifier *name, ...)
 {
     PyObject *args, *tmp;
@@ -2648,8 +2661,8 @@
  * NULL terminated string pointers with a NULL char* terminating the array.
  * (ie: an argv or env list)
  *
- * Memory allocated for the returned list is allocated using malloc() and MUST
- * be freed by the caller using a free() loop or _Py_FreeCharPArray().
+ * Memory allocated for the returned list is allocated using PyMem_Malloc()
+ * and MUST be freed by _Py_FreeCharPArray().
  */
 char *const *
 _PySequence_BytesToCharpArray(PyObject* self)
@@ -2657,6 +2670,7 @@
     char **array;
     Py_ssize_t i, argc;
     PyObject *item = NULL;
+    Py_ssize_t size;
 
     argc = PySequence_Size(self);
     if (argc == -1)
@@ -2669,7 +2683,7 @@
         return NULL;
     }
 
-    array = malloc((argc + 1) * sizeof(char *));
+    array = PyMem_Malloc((argc + 1) * sizeof(char *));
     if (array == NULL) {
         PyErr_NoMemory();
         return NULL;
@@ -2688,11 +2702,13 @@
             array[i] = NULL;
             goto fail;
         }
-        array[i] = strdup(data);
+        size = PyBytes_GET_SIZE(item) + 1;
+        array[i] = PyMem_Malloc(size);
         if (!array[i]) {
             PyErr_NoMemory();
             goto fail;
         }
+        memcpy(array[i], data, size);
         Py_DECREF(item);
     }
     array[argc] = NULL;
@@ -2712,7 +2728,7 @@
 {
     Py_ssize_t i;
     for (i = 0; array[i] != NULL; ++i) {
-        free(array[i]);
+        PyMem_Free(array[i]);
     }
-    free((void*)array);
+    PyMem_Free((void*)array);
 }
diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c
index 50667a6..f5eb321 100644
--- a/Objects/bytearrayobject.c
+++ b/Objects/bytearrayobject.c
@@ -74,24 +74,6 @@
     obj->ob_exports--;
 }
 
-static Py_ssize_t
-_getbuffer(PyObject *obj, Py_buffer *view)
-{
-    PyBufferProcs *buffer = Py_TYPE(obj)->tp_as_buffer;
-
-    if (buffer == NULL || buffer->bf_getbuffer == NULL)
-    {
-        PyErr_Format(PyExc_TypeError,
-                     "Type %.100s doesn't support the buffer API",
-                     Py_TYPE(obj)->tp_name);
-        return -1;
-    }
-
-    if (buffer->bf_getbuffer(obj, view, PyBUF_SIMPLE) < 0)
-            return -1;
-    return view->len;
-}
-
 static int
 _canresize(PyByteArrayObject *self)
 {
@@ -150,6 +132,7 @@
     }
     Py_SIZE(new) = size;
     new->ob_alloc = alloc;
+    new->ob_start = new->ob_bytes;
     new->ob_exports = 0;
 
     return (PyObject *)new;
@@ -174,51 +157,80 @@
 }
 
 int
-PyByteArray_Resize(PyObject *self, Py_ssize_t size)
+PyByteArray_Resize(PyObject *self, Py_ssize_t requested_size)
 {
     void *sval;
-    Py_ssize_t alloc = ((PyByteArrayObject *)self)->ob_alloc;
+    PyByteArrayObject *obj = ((PyByteArrayObject *)self);
+    /* All computations are done unsigned to avoid integer overflows
+       (see issue #22335). */
+    size_t alloc = (size_t) obj->ob_alloc;
+    size_t logical_offset = (size_t) (obj->ob_start - obj->ob_bytes);
+    size_t size = (size_t) requested_size;
 
     assert(self != NULL);
     assert(PyByteArray_Check(self));
-    assert(size >= 0);
+    assert(logical_offset <= alloc);
+    assert(requested_size >= 0);
 
-    if (size == Py_SIZE(self)) {
+    if (requested_size == Py_SIZE(self)) {
         return 0;
     }
-    if (!_canresize((PyByteArrayObject *)self)) {
+    if (!_canresize(obj)) {
         return -1;
     }
 
-    if (size < alloc / 2) {
-        /* Major downsize; resize down to exact size */
-        alloc = size + 1;
-    }
-    else if (size < alloc) {
-        /* Within allocated size; quick exit */
-        Py_SIZE(self) = size;
-        ((PyByteArrayObject *)self)->ob_bytes[size] = '\0'; /* Trailing null */
-        return 0;
-    }
-    else if (size <= alloc * 1.125) {
-        /* Moderate upsize; overallocate similar to list_resize() */
-        alloc = size + (size >> 3) + (size < 9 ? 3 : 6);
+    if (size + logical_offset + 1 < alloc) {
+        /* Current buffer is large enough to host the requested size,
+           decide on a strategy. */
+        if (size < alloc / 2) {
+            /* Major downsize; resize down to exact size */
+            alloc = size + 1;
+        }
+        else {
+            /* Minor downsize; quick exit */
+            Py_SIZE(self) = size;
+            PyByteArray_AS_STRING(self)[size] = '\0'; /* Trailing null */
+            return 0;
+        }
     }
     else {
-        /* Major upsize; resize up to exact size */
-        alloc = size + 1;
+        /* Need growing, decide on a strategy */
+        if (size <= alloc * 1.125) {
+            /* Moderate upsize; overallocate similar to list_resize() */
+            alloc = size + (size >> 3) + (size < 9 ? 3 : 6);
+        }
+        else {
+            /* Major upsize; resize up to exact size */
+            alloc = size + 1;
+        }
     }
-
-    sval = PyObject_Realloc(((PyByteArrayObject *)self)->ob_bytes, alloc);
-    if (sval == NULL) {
+    if (alloc > PY_SSIZE_T_MAX) {
         PyErr_NoMemory();
         return -1;
     }
 
-    ((PyByteArrayObject *)self)->ob_bytes = sval;
+    if (logical_offset > 0) {
+        sval = PyObject_Malloc(alloc);
+        if (sval == NULL) {
+            PyErr_NoMemory();
+            return -1;
+        }
+        memcpy(sval, PyByteArray_AS_STRING(self),
+               Py_MIN(requested_size, Py_SIZE(self)));
+        PyObject_Free(obj->ob_bytes);
+    }
+    else {
+        sval = PyObject_Realloc(obj->ob_bytes, alloc);
+        if (sval == NULL) {
+            PyErr_NoMemory();
+            return -1;
+        }
+    }
+
+    obj->ob_bytes = obj->ob_start = sval;
     Py_SIZE(self) = size;
-    ((PyByteArrayObject *)self)->ob_alloc = alloc;
-    ((PyByteArrayObject *)self)->ob_bytes[size] = '\0'; /* Trailing null byte */
+    obj->ob_alloc = alloc;
+    obj->ob_bytes[size] = '\0'; /* Trailing null byte */
 
     return 0;
 }
@@ -232,8 +244,8 @@
 
     va.len = -1;
     vb.len = -1;
-    if (_getbuffer(a, &va) < 0  ||
-        _getbuffer(b, &vb) < 0) {
+    if (PyObject_GetBuffer(a, &va, PyBUF_SIMPLE) != 0 ||
+        PyObject_GetBuffer(b, &vb, PyBUF_SIMPLE) != 0) {
             PyErr_Format(PyExc_TypeError, "can't concat %.100s to %.100s",
                          Py_TYPE(a)->tp_name, Py_TYPE(b)->tp_name);
             goto done;
@@ -274,7 +286,7 @@
     Py_ssize_t size;
     Py_buffer vo;
 
-    if (_getbuffer(other, &vo) < 0) {
+    if (PyObject_GetBuffer(other, &vo, PyBUF_SIMPLE) != 0) {
         PyErr_Format(PyExc_TypeError, "can't concat %.100s to %.100s",
                      Py_TYPE(other)->tp_name, Py_TYPE(self)->tp_name);
         return NULL;
@@ -288,13 +300,13 @@
     }
     if (size < self->ob_alloc) {
         Py_SIZE(self) = size;
-        self->ob_bytes[Py_SIZE(self)] = '\0'; /* Trailing null byte */
+        PyByteArray_AS_STRING(self)[Py_SIZE(self)] = '\0'; /* Trailing null byte */
     }
     else if (PyByteArray_Resize((PyObject *)self, size) < 0) {
         PyBuffer_Release(&vo);
         return NULL;
     }
-    memcpy(self->ob_bytes + mysize, vo.buf, vo.len);
+    memcpy(PyByteArray_AS_STRING(self) + mysize, vo.buf, vo.len);
     PyBuffer_Release(&vo);
     Py_INCREF(self);
     return (PyObject *)self;
@@ -331,6 +343,7 @@
 {
     Py_ssize_t mysize;
     Py_ssize_t size;
+    char *buf;
 
     if (count < 0)
         count = 0;
@@ -338,19 +351,16 @@
     if (count > 0 && mysize > PY_SSIZE_T_MAX / count)
         return PyErr_NoMemory();
     size = mysize * count;
-    if (size < self->ob_alloc) {
-        Py_SIZE(self) = size;
-        self->ob_bytes[Py_SIZE(self)] = '\0'; /* Trailing null byte */
-    }
-    else if (PyByteArray_Resize((PyObject *)self, size) < 0)
+    if (PyByteArray_Resize((PyObject *)self, size) < 0)
         return NULL;
 
+    buf = PyByteArray_AS_STRING(self);
     if (mysize == 1)
-        memset(self->ob_bytes, self->ob_bytes[0], size);
+        memset(buf, buf[0], size);
     else {
         Py_ssize_t i;
         for (i = 1; i < count; i++)
-            memcpy(self->ob_bytes + i*mysize, self->ob_bytes, mysize);
+            memcpy(buf + i*mysize, buf, mysize);
     }
 
     Py_INCREF(self);
@@ -366,7 +376,7 @@
         PyErr_SetString(PyExc_IndexError, "bytearray index out of range");
         return NULL;
     }
-    return PyLong_FromLong((unsigned char)(self->ob_bytes[i]));
+    return PyLong_FromLong((unsigned char)(PyByteArray_AS_STRING(self)[i]));
 }
 
 static PyObject *
@@ -385,7 +395,7 @@
             PyErr_SetString(PyExc_IndexError, "bytearray index out of range");
             return NULL;
         }
-        return PyLong_FromLong((unsigned char)(self->ob_bytes[i]));
+        return PyLong_FromLong((unsigned char)(PyByteArray_AS_STRING(self)[i]));
     }
     else if (PySlice_Check(index)) {
         Py_ssize_t start, stop, step, slicelength, cur, i;
@@ -398,8 +408,8 @@
         if (slicelength <= 0)
             return PyByteArray_FromStringAndSize("", 0);
         else if (step == 1) {
-            return PyByteArray_FromStringAndSize(self->ob_bytes + start,
-                                             slicelength);
+            return PyByteArray_FromStringAndSize(
+                PyByteArray_AS_STRING(self) + start, slicelength);
         }
         else {
             char *source_buf = PyByteArray_AS_STRING(self);
@@ -425,10 +435,94 @@
 }
 
 static int
+bytearray_setslice_linear(PyByteArrayObject *self,
+                          Py_ssize_t lo, Py_ssize_t hi,
+                          char *bytes, Py_ssize_t bytes_len)
+{
+    Py_ssize_t avail = hi - lo;
+    char *buf = PyByteArray_AS_STRING(self);
+    Py_ssize_t growth = bytes_len - avail;
+    int res = 0;
+    assert(avail >= 0);
+
+    if (growth < 0) {
+        if (!_canresize(self))
+            return -1;
+
+        if (lo == 0) {
+            /* Shrink the buffer by advancing its logical start */
+            self->ob_start -= growth;
+            /*
+              0   lo               hi             old_size
+              |   |<----avail----->|<-----tail------>|
+              |      |<-bytes_len->|<-----tail------>|
+              0    new_lo         new_hi          new_size
+            */
+        }
+        else {
+            /*
+              0   lo               hi               old_size
+              |   |<----avail----->|<-----tomove------>|
+              |   |<-bytes_len->|<-----tomove------>|
+              0   lo         new_hi              new_size
+            */
+            memmove(buf + lo + bytes_len, buf + hi,
+                    Py_SIZE(self) - hi);
+        }
+        if (PyByteArray_Resize((PyObject *)self,
+                               Py_SIZE(self) + growth) < 0) {
+            /* Issue #19578: Handling the memory allocation failure here is
+               tricky here because the bytearray object has already been
+               modified. Depending on growth and lo, the behaviour is
+               different.
+
+               If growth < 0 and lo != 0, the operation is completed, but a
+               MemoryError is still raised and the memory block is not
+               shrinked. Otherwise, the bytearray is restored in its previous
+               state and a MemoryError is raised. */
+            if (lo == 0) {
+                self->ob_start += growth;
+                return -1;
+            }
+            /* memmove() removed bytes, the bytearray object cannot be
+               restored in its previous state. */
+            Py_SIZE(self) += growth;
+            res = -1;
+        }
+        buf = PyByteArray_AS_STRING(self);
+    }
+    else if (growth > 0) {
+        if (Py_SIZE(self) > (Py_ssize_t)PY_SSIZE_T_MAX - growth) {
+            PyErr_NoMemory();
+            return -1;
+        }
+
+        if (PyByteArray_Resize((PyObject *)self,
+                               Py_SIZE(self) + growth) < 0) {
+            return -1;
+        }
+        buf = PyByteArray_AS_STRING(self);
+        /* Make the place for the additional bytes */
+        /*
+          0   lo        hi               old_size
+          |   |<-avail->|<-----tomove------>|
+          |   |<---bytes_len-->|<-----tomove------>|
+          0   lo            new_hi              new_size
+         */
+        memmove(buf + lo + bytes_len, buf + hi,
+                Py_SIZE(self) - lo - bytes_len);
+    }
+
+    if (bytes_len > 0)
+        memcpy(buf + lo, bytes, bytes_len);
+    return res;
+}
+
+static int
 bytearray_setslice(PyByteArrayObject *self, Py_ssize_t lo, Py_ssize_t hi,
                PyObject *values)
 {
-    Py_ssize_t avail, needed;
+    Py_ssize_t needed;
     void *bytes;
     Py_buffer vbytes;
     int res = 0;
@@ -450,14 +544,14 @@
         needed = 0;
     }
     else {
-            if (_getbuffer(values, &vbytes) < 0) {
-                    PyErr_Format(PyExc_TypeError,
-                                 "can't set bytearray slice from %.100s",
-                                 Py_TYPE(values)->tp_name);
-                    return -1;
-            }
-            needed = vbytes.len;
-            bytes = vbytes.buf;
+        if (PyObject_GetBuffer(values, &vbytes, PyBUF_SIMPLE) != 0) {
+            PyErr_Format(PyExc_TypeError,
+                         "can't set bytearray slice from %.100s",
+                         Py_TYPE(values)->tp_name);
+            return -1;
+        }
+        needed = vbytes.len;
+        bytes = vbytes.buf;
     }
 
     if (lo < 0)
@@ -467,50 +561,9 @@
     if (hi > Py_SIZE(self))
         hi = Py_SIZE(self);
 
-    avail = hi - lo;
-    if (avail < 0)
-        lo = hi = avail = 0;
-
-    if (avail != needed) {
-        if (avail > needed) {
-            if (!_canresize(self)) {
-                res = -1;
-                goto finish;
-            }
-            /*
-              0   lo               hi               old_size
-              |   |<----avail----->|<-----tomove------>|
-              |   |<-needed->|<-----tomove------>|
-              0   lo      new_hi              new_size
-            */
-            memmove(self->ob_bytes + lo + needed, self->ob_bytes + hi,
-                    Py_SIZE(self) - hi);
-        }
-        /* XXX(nnorwitz): need to verify this can't overflow! */
-        if (PyByteArray_Resize((PyObject *)self,
-                           Py_SIZE(self) + needed - avail) < 0) {
-                res = -1;
-                goto finish;
-        }
-        if (avail < needed) {
-            /*
-              0   lo        hi               old_size
-              |   |<-avail->|<-----tomove------>|
-              |   |<----needed---->|<-----tomove------>|
-              0   lo            new_hi              new_size
-             */
-            memmove(self->ob_bytes + lo + needed, self->ob_bytes + hi,
-                    Py_SIZE(self) - lo - needed);
-        }
-    }
-
-    if (needed > 0)
-        memcpy(self->ob_bytes + lo, bytes, needed);
-
-
- finish:
+    res = bytearray_setslice_linear(self, lo, hi, bytes, needed);
     if (vbytes.len != -1)
-            PyBuffer_Release(&vbytes);
+        PyBuffer_Release(&vbytes);
     return res;
 }
 
@@ -533,7 +586,7 @@
     if (!_getbytevalue(value, &ival))
         return -1;
 
-    self->ob_bytes[i] = ival;
+    PyByteArray_AS_STRING(self)[i] = ival;
     return 0;
 }
 
@@ -541,7 +594,8 @@
 bytearray_ass_subscript(PyByteArrayObject *self, PyObject *index, PyObject *values)
 {
     Py_ssize_t start, stop, step, slicelen, needed;
-    char *bytes;
+    char *buf, *bytes;
+    buf = PyByteArray_AS_STRING(self);
 
     if (PyIndex_Check(index)) {
         Py_ssize_t i = PyNumber_AsSsize_t(index, PyExc_IndexError);
@@ -568,7 +622,7 @@
             int ival;
             if (!_getbytevalue(values, &ival))
                 return -1;
-            self->ob_bytes[i] = (char)ival;
+            buf[i] = (char)ival;
             return 0;
         }
     }
@@ -606,7 +660,7 @@
     }
     else {
         assert(PyByteArray_Check(values));
-        bytes = ((PyByteArrayObject *)values)->ob_bytes;
+        bytes = PyByteArray_AS_STRING(values);
         needed = Py_SIZE(values);
     }
     /* Make sure b[5:2] = ... inserts before 5, not before 2. */
@@ -614,38 +668,7 @@
         (step > 0 && start > stop))
         stop = start;
     if (step == 1) {
-        if (slicelen != needed) {
-            if (!_canresize(self))
-                return -1;
-            if (slicelen > needed) {
-                /*
-                  0   start           stop              old_size
-                  |   |<---slicelen--->|<-----tomove------>|
-                  |   |<-needed->|<-----tomove------>|
-                  0   lo      new_hi              new_size
-                */
-                memmove(self->ob_bytes + start + needed, self->ob_bytes + stop,
-                        Py_SIZE(self) - stop);
-            }
-            if (PyByteArray_Resize((PyObject *)self,
-                               Py_SIZE(self) + needed - slicelen) < 0)
-                return -1;
-            if (slicelen < needed) {
-                /*
-                  0   lo        hi               old_size
-                  |   |<-avail->|<-----tomove------>|
-                  |   |<----needed---->|<-----tomove------>|
-                  0   lo            new_hi              new_size
-                 */
-                memmove(self->ob_bytes + start + needed, self->ob_bytes + stop,
-                        Py_SIZE(self) - start - needed);
-            }
-        }
-
-        if (needed > 0)
-            memcpy(self->ob_bytes + start, bytes, needed);
-
-        return 0;
+        return bytearray_setslice_linear(self, start, stop, bytes, needed);
     }
     else {
         if (needed == 0) {
@@ -672,14 +695,14 @@
                 if (cur + step >= (size_t)PyByteArray_GET_SIZE(self))
                     lim = PyByteArray_GET_SIZE(self) - cur - 1;
 
-                memmove(self->ob_bytes + cur - i,
-                        self->ob_bytes + cur + 1, lim);
+                memmove(buf + cur - i,
+                        buf + cur + 1, lim);
             }
             /* Move the tail of the bytes, in one chunk */
             cur = start + (size_t)slicelen*step;
             if (cur < (size_t)PyByteArray_GET_SIZE(self)) {
-                memmove(self->ob_bytes + cur - slicelen,
-                        self->ob_bytes + cur,
+                memmove(buf + cur - slicelen,
+                        buf + cur,
                         PyByteArray_GET_SIZE(self) - cur);
             }
             if (PyByteArray_Resize((PyObject *)self,
@@ -701,7 +724,7 @@
                 return -1;
             }
             for (cur = start, i = 0; i < slicelen; cur += step, i++)
-                self->ob_bytes[cur] = bytes[i];
+                buf[cur] = bytes[i];
             return 0;
         }
     }
@@ -781,7 +804,7 @@
         if (count > 0) {
             if (PyByteArray_Resize((PyObject *)self, count))
                 return -1;
-            memset(self->ob_bytes, 0, count);
+            memset(PyByteArray_AS_STRING(self), 0, count);
         }
         return 0;
     }
@@ -794,7 +817,8 @@
             return -1;
         size = view.len;
         if (PyByteArray_Resize((PyObject *)self, size) < 0) goto fail;
-        if (PyBuffer_ToContiguous(self->ob_bytes, &view, size, 'C') < 0)
+        if (PyBuffer_ToContiguous(PyByteArray_AS_STRING(self),
+            &view, size, 'C') < 0)
             goto fail;
         PyBuffer_Release(&view);
         return 0;
@@ -838,7 +862,7 @@
             Py_SIZE(self)++;
         else if (PyByteArray_Resize((PyObject *)self, Py_SIZE(self)+1) < 0)
             goto error;
-        self->ob_bytes[Py_SIZE(self)-1] = value;
+        PyByteArray_AS_STRING(self)[Py_SIZE(self)-1] = value;
     }
 
     /* Clean up and return success */
@@ -862,9 +886,10 @@
     /* 15 == strlen(quote_prefix) + 2 + strlen(quote_postfix) + 1 */
     size_t newsize;
     PyObject *v;
-    register Py_ssize_t i;
-    register char c;
-    register char *p;
+    Py_ssize_t i;
+    char *bytes;
+    char c;
+    char *p;
     int quote;
     char *test, *start;
     char *buffer;
@@ -899,11 +924,12 @@
         *p++ = *quote_prefix++;
     *p++ = quote;
 
+    bytes = PyByteArray_AS_STRING(self);
     for (i = 0; i < length; i++) {
         /* There's at least enough room for a hex escape
            and a closing quote. */
         assert(newsize - (p - buffer) >= 5);
-        c = self->ob_bytes[i];
+        c = bytes[i];
         if (c == '\'' || c == '\\')
             *p++ = '\\', *p++ = c;
         else if (c == '\t')
@@ -968,18 +994,18 @@
         Py_RETURN_NOTIMPLEMENTED;
     }
 
-    self_size = _getbuffer(self, &self_bytes);
-    if (self_size < 0) {
+    if (PyObject_GetBuffer(self, &self_bytes, PyBUF_SIMPLE) != 0) {
         PyErr_Clear();
         Py_RETURN_NOTIMPLEMENTED;
     }
+    self_size = self_bytes.len;
 
-    other_size = _getbuffer(other, &other_bytes);
-    if (other_size < 0) {
+    if (PyObject_GetBuffer(other, &other_bytes, PyBUF_SIMPLE) != 0) {
         PyErr_Clear();
         PyBuffer_Release(&self_bytes);
         Py_RETURN_NOTIMPLEMENTED;
     }
+    other_size = other_bytes.len;
 
     if (self_size != other_size && (op == Py_EQ || op == Py_NE)) {
         /* Shortcut: if the lengths differ, the objects differ */
@@ -1038,6 +1064,7 @@
 #define FASTSEARCH fastsearch
 #define STRINGLIB(F) stringlib_##F
 #define STRINGLIB_CHAR char
+#define STRINGLIB_SIZEOF_CHAR 1
 #define STRINGLIB_LEN PyByteArray_GET_SIZE
 #define STRINGLIB_STR PyByteArray_AS_STRING
 #define STRINGLIB_NEW PyByteArray_FromStringAndSize
@@ -1049,6 +1076,7 @@
 #include "stringlib/fastsearch.h"
 #include "stringlib/count.h"
 #include "stringlib/find.h"
+#include "stringlib/join.h"
 #include "stringlib/partition.h"
 #include "stringlib/split.h"
 #include "stringlib/ctype.h"
@@ -1089,7 +1117,7 @@
         return -2;
 
     if (subobj) {
-        if (_getbuffer(subobj, &subbuf) < 0)
+        if (PyObject_GetBuffer(subobj, &subbuf, PyBUF_SIMPLE) != 0)
             return -2;
 
         sub = subbuf.buf;
@@ -1157,7 +1185,7 @@
         return NULL;
 
     if (sub_obj) {
-        if (_getbuffer(sub_obj, &vsub) < 0)
+        if (PyObject_GetBuffer(sub_obj, &vsub, PyBUF_SIMPLE) != 0)
             return NULL;
 
         sub = vsub.buf;
@@ -1272,7 +1300,7 @@
         Py_buffer varg;
         Py_ssize_t pos;
         PyErr_Clear();
-        if (_getbuffer(arg, &varg) < 0)
+        if (PyObject_GetBuffer(arg, &varg, PyBUF_SIMPLE) != 0)
             return -1;
         pos = stringlib_find(PyByteArray_AS_STRING(self), Py_SIZE(self),
                              varg.buf, varg.len, 0);
@@ -1303,7 +1331,7 @@
 
     str = PyByteArray_AS_STRING(self);
 
-    if (_getbuffer(substr, &vsubstr) < 0)
+    if (PyObject_GetBuffer(substr, &vsubstr, PyBUF_SIMPLE) != 0)
         return -1;
 
     ADJUST_INDICES(start, end, len);
@@ -1429,9 +1457,9 @@
 static PyObject *
 bytearray_translate(PyByteArrayObject *self, PyObject *args)
 {
-    register char *input, *output;
-    register const char *table;
-    register Py_ssize_t i, c;
+    char *input, *output;
+    const char *table;
+    Py_ssize_t i, c;
     PyObject *input_obj = (PyObject*)self;
     const char *output_start;
     Py_ssize_t inlen;
@@ -1447,7 +1475,7 @@
     if (tableobj == Py_None) {
         table = NULL;
         tableobj = NULL;
-    } else if (_getbuffer(tableobj, &vtable) < 0) {
+    } else if (PyObject_GetBuffer(tableobj, &vtable, PyBUF_SIMPLE) != 0) {
         return NULL;
     } else {
         if (vtable.len != 256) {
@@ -1460,7 +1488,7 @@
     }
 
     if (delobj != NULL) {
-        if (_getbuffer(delobj, &vdel) < 0) {
+        if (PyObject_GetBuffer(delobj, &vdel, PyBUF_SIMPLE) != 0) {
             if (tableobj != NULL)
                 PyBuffer_Release(&vtable);
             return NULL;
@@ -2024,26 +2052,20 @@
 static PyObject *
 bytearray_replace(PyByteArrayObject *self, PyObject *args)
 {
+    PyObject *res;
+    Py_buffer old = {NULL, NULL};
+    Py_buffer new = {NULL, NULL};
     Py_ssize_t count = -1;
-    PyObject *from, *to, *res;
-    Py_buffer vfrom, vto;
 
-    if (!PyArg_ParseTuple(args, "OO|n:replace", &from, &to, &count))
+    if (!PyArg_ParseTuple(args, "y*y*|n:replace", &old, &new, &count))
         return NULL;
 
-    if (_getbuffer(from, &vfrom) < 0)
-        return NULL;
-    if (_getbuffer(to, &vto) < 0) {
-        PyBuffer_Release(&vfrom);
-        return NULL;
-    }
-
     res = (PyObject *)replace((PyByteArrayObject *) self,
-                              vfrom.buf, vfrom.len,
-                              vto.buf, vto.len, count);
+                              (const char *)old.buf, old.len,
+                              (const char *)new.buf, new.len, count);
 
-    PyBuffer_Release(&vfrom);
-    PyBuffer_Release(&vto);
+    PyBuffer_Release(&old);
+    PyBuffer_Release(&new);
     return res;
 }
 
@@ -2074,7 +2096,7 @@
     if (subobj == Py_None)
         return stringlib_split_whitespace((PyObject*) self, s, len, maxsplit);
 
-    if (_getbuffer(subobj, &vsub) < 0)
+    if (PyObject_GetBuffer(subobj, &vsub, PyBUF_SIMPLE) != 0)
         return NULL;
     sub = vsub.buf;
     n = vsub.len;
@@ -2169,7 +2191,7 @@
     if (subobj == Py_None)
         return stringlib_rsplit_whitespace((PyObject*) self, s, len, maxsplit);
 
-    if (_getbuffer(subobj, &vsub) < 0)
+    if (PyObject_GetBuffer(subobj, &vsub, PyBUF_SIMPLE) != 0)
         return NULL;
     sub = vsub.buf;
     n = vsub.len;
@@ -2192,7 +2214,7 @@
     Py_ssize_t i, j, n = Py_SIZE(self);
 
     j = n / 2;
-    head = self->ob_bytes;
+    head = PyByteArray_AS_STRING(self);
     tail = head + n - 1;
     for (i = 0; i < j; i++) {
         swap = *head;
@@ -2213,6 +2235,7 @@
     PyObject *value;
     int ival;
     Py_ssize_t where, n = Py_SIZE(self);
+    char *buf;
 
     if (!PyArg_ParseTuple(args, "nO:insert", &where, &value))
         return NULL;
@@ -2226,6 +2249,7 @@
         return NULL;
     if (PyByteArray_Resize((PyObject *)self, n + 1) < 0)
         return NULL;
+    buf = PyByteArray_AS_STRING(self);
 
     if (where < 0) {
         where += n;
@@ -2234,8 +2258,8 @@
     }
     if (where > n)
         where = n;
-    memmove(self->ob_bytes + where + 1, self->ob_bytes + where, n - where);
-    self->ob_bytes[where] = ival;
+    memmove(buf + where + 1, buf + where, n - where);
+    buf[where] = ival;
 
     Py_RETURN_NONE;
 }
@@ -2260,7 +2284,7 @@
     if (PyByteArray_Resize((PyObject *)self, n + 1) < 0)
         return NULL;
 
-    self->ob_bytes[n] = value;
+    PyByteArray_AS_STRING(self)[n] = value;
 
     Py_RETURN_NONE;
 }
@@ -2291,7 +2315,7 @@
         return NULL;
 
     /* Try to determine the length of the argument. 32 is arbitrary. */
-    buf_size = _PyObject_LengthHint(arg, 32);
+    buf_size = PyObject_LengthHint(arg, 32);
     if (buf_size == -1) {
         Py_DECREF(it);
         return NULL;
@@ -2353,6 +2377,7 @@
 {
     int value;
     Py_ssize_t where = -1, n = Py_SIZE(self);
+    char *buf;
 
     if (!PyArg_ParseTuple(args, "|n:pop", &where))
         return NULL;
@@ -2371,8 +2396,9 @@
     if (!_canresize(self))
         return NULL;
 
-    value = self->ob_bytes[where];
-    memmove(self->ob_bytes + where, self->ob_bytes + where + 1, n - where);
+    buf = PyByteArray_AS_STRING(self);
+    value = buf[where];
+    memmove(buf + where, buf + where + 1, n - where);
     if (PyByteArray_Resize((PyObject *)self, n - 1) < 0)
         return NULL;
 
@@ -2388,12 +2414,13 @@
 {
     int value;
     Py_ssize_t where, n = Py_SIZE(self);
+    char *buf = PyByteArray_AS_STRING(self);
 
     if (! _getbytevalue(arg, &value))
         return NULL;
 
     for (where = 0; where < n; where++) {
-        if (self->ob_bytes[where] == value)
+        if (buf[where] == value)
             break;
     }
     if (where == n) {
@@ -2403,7 +2430,7 @@
     if (!_canresize(self))
         return NULL;
 
-    memmove(self->ob_bytes + where, self->ob_bytes + where + 1, n - where);
+    memmove(buf + where, buf + where + 1, n - where);
     if (PyByteArray_Resize((PyObject *)self, n - 1) < 0)
         return NULL;
 
@@ -2413,21 +2440,21 @@
 /* XXX These two helpers could be optimized if argsize == 1 */
 
 static Py_ssize_t
-lstrip_helper(unsigned char *myptr, Py_ssize_t mysize,
+lstrip_helper(char *myptr, Py_ssize_t mysize,
               void *argptr, Py_ssize_t argsize)
 {
     Py_ssize_t i = 0;
-    while (i < mysize && memchr(argptr, myptr[i], argsize))
+    while (i < mysize && memchr(argptr, (unsigned char) myptr[i], argsize))
         i++;
     return i;
 }
 
 static Py_ssize_t
-rstrip_helper(unsigned char *myptr, Py_ssize_t mysize,
+rstrip_helper(char *myptr, Py_ssize_t mysize,
               void *argptr, Py_ssize_t argsize)
 {
     Py_ssize_t i = mysize - 1;
-    while (i >= 0 && memchr(argptr, myptr[i], argsize))
+    while (i >= 0 && memchr(argptr, (unsigned char) myptr[i], argsize))
         i--;
     return i + 1;
 }
@@ -2442,7 +2469,7 @@
 bytearray_strip(PyByteArrayObject *self, PyObject *args)
 {
     Py_ssize_t left, right, mysize, argsize;
-    void *myptr, *argptr;
+    char *myptr, *argptr;
     PyObject *arg = Py_None;
     Py_buffer varg;
     if (!PyArg_ParseTuple(args, "|O:strip", &arg))
@@ -2452,12 +2479,12 @@
         argsize = 6;
     }
     else {
-        if (_getbuffer(arg, &varg) < 0)
+        if (PyObject_GetBuffer(arg, &varg, PyBUF_SIMPLE) != 0)
             return NULL;
-        argptr = varg.buf;
+        argptr = (char *) varg.buf;
         argsize = varg.len;
     }
-    myptr = self->ob_bytes;
+    myptr = PyByteArray_AS_STRING(self);
     mysize = Py_SIZE(self);
     left = lstrip_helper(myptr, mysize, argptr, argsize);
     if (left == mysize)
@@ -2466,7 +2493,7 @@
         right = rstrip_helper(myptr, mysize, argptr, argsize);
     if (arg != Py_None)
         PyBuffer_Release(&varg);
-    return PyByteArray_FromStringAndSize(self->ob_bytes + left, right - left);
+    return PyByteArray_FromStringAndSize(myptr + left, right - left);
 }
 
 PyDoc_STRVAR(lstrip__doc__,
@@ -2479,7 +2506,7 @@
 bytearray_lstrip(PyByteArrayObject *self, PyObject *args)
 {
     Py_ssize_t left, right, mysize, argsize;
-    void *myptr, *argptr;
+    char *myptr, *argptr;
     PyObject *arg = Py_None;
     Py_buffer varg;
     if (!PyArg_ParseTuple(args, "|O:lstrip", &arg))
@@ -2489,18 +2516,18 @@
         argsize = 6;
     }
     else {
-        if (_getbuffer(arg, &varg) < 0)
+        if (PyObject_GetBuffer(arg, &varg, PyBUF_SIMPLE) != 0)
             return NULL;
-        argptr = varg.buf;
+        argptr = (char *) varg.buf;
         argsize = varg.len;
     }
-    myptr = self->ob_bytes;
+    myptr = PyByteArray_AS_STRING(self);
     mysize = Py_SIZE(self);
     left = lstrip_helper(myptr, mysize, argptr, argsize);
     right = mysize;
     if (arg != Py_None)
         PyBuffer_Release(&varg);
-    return PyByteArray_FromStringAndSize(self->ob_bytes + left, right - left);
+    return PyByteArray_FromStringAndSize(myptr + left, right - left);
 }
 
 PyDoc_STRVAR(rstrip__doc__,
@@ -2513,7 +2540,7 @@
 bytearray_rstrip(PyByteArrayObject *self, PyObject *args)
 {
     Py_ssize_t right, mysize, argsize;
-    void *myptr, *argptr;
+    char *myptr, *argptr;
     PyObject *arg = Py_None;
     Py_buffer varg;
     if (!PyArg_ParseTuple(args, "|O:rstrip", &arg))
@@ -2523,17 +2550,17 @@
         argsize = 6;
     }
     else {
-        if (_getbuffer(arg, &varg) < 0)
+        if (PyObject_GetBuffer(arg, &varg, PyBUF_SIMPLE) != 0)
             return NULL;
-        argptr = varg.buf;
+        argptr = (char *) varg.buf;
         argsize = varg.len;
     }
-    myptr = self->ob_bytes;
+    myptr = PyByteArray_AS_STRING(self);
     mysize = Py_SIZE(self);
     right = rstrip_helper(myptr, mysize, argptr, argsize);
     if (arg != Py_None)
         PyBuffer_Release(&varg);
-    return PyByteArray_FromStringAndSize(self->ob_bytes, right);
+    return PyByteArray_FromStringAndSize(myptr, right);
 }
 
 PyDoc_STRVAR(decode_doc,
@@ -2578,73 +2605,9 @@
 in between each pair, and return the result as a new bytearray.");
 
 static PyObject *
-bytearray_join(PyByteArrayObject *self, PyObject *it)
+bytearray_join(PyObject *self, PyObject *iterable)
 {
-    PyObject *seq;
-    Py_ssize_t mysize = Py_SIZE(self);
-    Py_ssize_t i;
-    Py_ssize_t n;
-    PyObject **items;
-    Py_ssize_t totalsize = 0;
-    PyObject *result;
-    char *dest;
-
-    seq = PySequence_Fast(it, "can only join an iterable");
-    if (seq == NULL)
-        return NULL;
-    n = PySequence_Fast_GET_SIZE(seq);
-    items = PySequence_Fast_ITEMS(seq);
-
-    /* Compute the total size, and check that they are all bytes */
-    /* XXX Shouldn't we use _getbuffer() on these items instead? */
-    for (i = 0; i < n; i++) {
-        PyObject *obj = items[i];
-        if (!PyByteArray_Check(obj) && !PyBytes_Check(obj)) {
-            PyErr_Format(PyExc_TypeError,
-                         "can only join an iterable of bytes "
-                         "(item %ld has type '%.100s')",
-                         /* XXX %ld isn't right on Win64 */
-                         (long)i, Py_TYPE(obj)->tp_name);
-            goto error;
-        }
-        if (i > 0)
-            totalsize += mysize;
-        totalsize += Py_SIZE(obj);
-        if (totalsize < 0) {
-            PyErr_NoMemory();
-            goto error;
-        }
-    }
-
-    /* Allocate the result, and copy the bytes */
-    result = PyByteArray_FromStringAndSize(NULL, totalsize);
-    if (result == NULL)
-        goto error;
-    dest = PyByteArray_AS_STRING(result);
-    for (i = 0; i < n; i++) {
-        PyObject *obj = items[i];
-        Py_ssize_t size = Py_SIZE(obj);
-        char *buf;
-        if (PyByteArray_Check(obj))
-           buf = PyByteArray_AS_STRING(obj);
-        else
-           buf = PyBytes_AS_STRING(obj);
-        if (i) {
-            memcpy(dest, self->ob_bytes, mysize);
-            dest += mysize;
-        }
-        memcpy(dest, buf, size);
-        dest += size;
-    }
-
-    /* Done */
-    Py_DECREF(seq);
-    return result;
-
-    /* Error handling */
-  error:
-    Py_DECREF(seq);
-    return NULL;
+    return stringlib_bytes_join(self, iterable);
 }
 
 PyDoc_STRVAR(splitlines__doc__,
@@ -2748,6 +2711,7 @@
 {
     PyObject *dict;
     _Py_IDENTIFIER(__dict__);
+    char *buf;
 
     dict = _PyObject_GetAttrId((PyObject *)self, &PyId___dict__);
     if (dict == NULL) {
@@ -2756,19 +2720,20 @@
         Py_INCREF(dict);
     }
 
+    buf = PyByteArray_AS_STRING(self);
     if (proto < 3) {
         /* use str based reduction for backwards compatibility with Python 2.x */
         PyObject *latin1;
-        if (self->ob_bytes)
-            latin1 = PyUnicode_DecodeLatin1(self->ob_bytes, Py_SIZE(self), NULL);
+        if (Py_SIZE(self))
+            latin1 = PyUnicode_DecodeLatin1(buf, Py_SIZE(self), NULL);
         else
             latin1 = PyUnicode_FromString("");
         return Py_BuildValue("(O(Ns)N)", Py_TYPE(self), latin1, "latin-1", dict);
     }
     else {
         /* use more efficient byte based reduction */
-        if (self->ob_bytes) {
-            return Py_BuildValue("(O(y#)N)", Py_TYPE(self), self->ob_bytes, Py_SIZE(self), dict);
+        if (Py_SIZE(self)) {
+            return Py_BuildValue("(O(y#)N)", Py_TYPE(self), buf, Py_SIZE(self), dict);
         }
         else {
             return Py_BuildValue("(O()N)", Py_TYPE(self), dict);
@@ -2849,7 +2814,7 @@
     {"count", (PyCFunction)bytearray_count, METH_VARARGS, count__doc__},
     {"decode", (PyCFunction)bytearray_decode, METH_VARARGS | METH_KEYWORDS, decode_doc},
     {"endswith", (PyCFunction)bytearray_endswith, METH_VARARGS, endswith__doc__},
-    {"expandtabs", (PyCFunction)stringlib_expandtabs, METH_VARARGS,
+    {"expandtabs", (PyCFunction)stringlib_expandtabs, METH_VARARGS | METH_KEYWORDS,
      expandtabs__doc__},
     {"extend", (PyCFunction)bytearray_extend, METH_O, extend__doc__},
     {"find", (PyCFunction)bytearray_find, METH_VARARGS, find__doc__},
@@ -3000,7 +2965,7 @@
 
     if (it->it_index < PyByteArray_GET_SIZE(seq)) {
         item = PyLong_FromLong(
-            (unsigned char)seq->ob_bytes[it->it_index]);
+            (unsigned char)PyByteArray_AS_STRING(seq)[it->it_index]);
         if (item != NULL)
             ++it->it_index;
         return item;
diff --git a/Objects/bytes_methods.c b/Objects/bytes_methods.c
index ef3c2f7..9ff7ace 100644
--- a/Objects/bytes_methods.c
+++ b/Objects/bytes_methods.c
@@ -10,9 +10,9 @@
 PyObject*
 _Py_bytes_isspace(const char *cptr, Py_ssize_t len)
 {
-    register const unsigned char *p
+    const unsigned char *p
         = (unsigned char *) cptr;
-    register const unsigned char *e;
+    const unsigned char *e;
 
     /* Shortcut for single character strings */
     if (len == 1 && Py_ISSPACE(*p))
@@ -40,9 +40,9 @@
 PyObject*
 _Py_bytes_isalpha(const char *cptr, Py_ssize_t len)
 {
-    register const unsigned char *p
+    const unsigned char *p
         = (unsigned char *) cptr;
-    register const unsigned char *e;
+    const unsigned char *e;
 
     /* Shortcut for single character strings */
     if (len == 1 && Py_ISALPHA(*p))
@@ -70,9 +70,9 @@
 PyObject*
 _Py_bytes_isalnum(const char *cptr, Py_ssize_t len)
 {
-    register const unsigned char *p
+    const unsigned char *p
         = (unsigned char *) cptr;
-    register const unsigned char *e;
+    const unsigned char *e;
 
     /* Shortcut for single character strings */
     if (len == 1 && Py_ISALNUM(*p))
@@ -100,9 +100,9 @@
 PyObject*
 _Py_bytes_isdigit(const char *cptr, Py_ssize_t len)
 {
-    register const unsigned char *p
+    const unsigned char *p
         = (unsigned char *) cptr;
-    register const unsigned char *e;
+    const unsigned char *e;
 
     /* Shortcut for single character strings */
     if (len == 1 && Py_ISDIGIT(*p))
@@ -130,9 +130,9 @@
 PyObject*
 _Py_bytes_islower(const char *cptr, Py_ssize_t len)
 {
-    register const unsigned char *p
+    const unsigned char *p
         = (unsigned char *) cptr;
-    register const unsigned char *e;
+    const unsigned char *e;
     int cased;
 
     /* Shortcut for single character strings */
@@ -164,9 +164,9 @@
 PyObject*
 _Py_bytes_isupper(const char *cptr, Py_ssize_t len)
 {
-    register const unsigned char *p
+    const unsigned char *p
         = (unsigned char *) cptr;
-    register const unsigned char *e;
+    const unsigned char *e;
     int cased;
 
     /* Shortcut for single character strings */
@@ -200,9 +200,9 @@
 PyObject*
 _Py_bytes_istitle(const char *cptr, Py_ssize_t len)
 {
-    register const unsigned char *p
+    const unsigned char *p
         = (unsigned char *) cptr;
-    register const unsigned char *e;
+    const unsigned char *e;
     int cased, previous_is_cased;
 
     /* Shortcut for single character strings */
@@ -217,7 +217,7 @@
     cased = 0;
     previous_is_cased = 0;
     for (; p < e; p++) {
-        register const unsigned char ch = *p;
+        const unsigned char ch = *p;
 
         if (Py_ISUPPER(ch)) {
             if (previous_is_cased)
@@ -363,41 +363,20 @@
 in frm is mapped to the byte at the same position in to.\n\
 The bytes objects frm and to must be of the same length.");
 
-static Py_ssize_t
-_getbuffer(PyObject *obj, Py_buffer *view)
-{
-    PyBufferProcs *buffer = Py_TYPE(obj)->tp_as_buffer;
-
-    if (buffer == NULL || buffer->bf_getbuffer == NULL)
-    {
-        PyErr_Format(PyExc_TypeError,
-                     "Type %.100s doesn't support the buffer API",
-                     Py_TYPE(obj)->tp_name);
-        return -1;
-    }
-
-    if (buffer->bf_getbuffer(obj, view, PyBUF_SIMPLE) < 0)
-        return -1;
-    return view->len;
-}
-
 PyObject *
 _Py_bytes_maketrans(PyObject *args)
 {
-    PyObject *frm, *to, *res = NULL;
-    Py_buffer bfrm, bto;
+    PyObject *res = NULL;
+    Py_buffer bfrm = {NULL, NULL};
+    Py_buffer bto = {NULL, NULL};
     Py_ssize_t i;
     char *p;
 
     bfrm.len = -1;
     bto.len = -1;
 
-    if (!PyArg_ParseTuple(args, "OO:maketrans", &frm, &to))
+    if (!PyArg_ParseTuple(args, "y*y*:maketrans", &bfrm, &bto))
         return NULL;
-    if (_getbuffer(frm, &bfrm) < 0)
-        return NULL;
-    if (_getbuffer(to, &bto) < 0)
-        goto done;
     if (bfrm.len != bto.len) {
         PyErr_Format(PyExc_ValueError,
                      "maketrans arguments must have same length");
@@ -415,9 +394,9 @@
     }
 
 done:
-    if (bfrm.len != -1)
+    if (bfrm.obj != NULL)
         PyBuffer_Release(&bfrm);
-    if (bto.len != -1)
+    if (bfrm.obj != NULL)
         PyBuffer_Release(&bto);
     return res;
 }
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
index 32c5d71..e56dbed 100644
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -7,24 +7,6 @@
 #include "bytes_methods.h"
 #include <stddef.h>
 
-static Py_ssize_t
-_getbuffer(PyObject *obj, Py_buffer *view)
-{
-    PyBufferProcs *buffer = Py_TYPE(obj)->tp_as_buffer;
-
-    if (buffer == NULL || buffer->bf_getbuffer == NULL)
-    {
-        PyErr_Format(PyExc_TypeError,
-                     "Type %.100s doesn't support the buffer API",
-                     Py_TYPE(obj)->tp_name);
-        return -1;
-    }
-
-    if (buffer->bf_getbuffer(obj, view, PyBUF_SIMPLE) < 0)
-        return -1;
-    return view->len;
-}
-
 #ifdef COUNT_ALLOCS
 Py_ssize_t null_strings, one_strings;
 #endif
@@ -65,7 +47,7 @@
 PyObject *
 PyBytes_FromStringAndSize(const char *str, Py_ssize_t size)
 {
-    register PyBytesObject *op;
+    PyBytesObject *op;
     if (size < 0) {
         PyErr_SetString(PyExc_SystemError,
             "Negative size passed to PyBytes_FromStringAndSize");
@@ -98,7 +80,7 @@
     op = (PyBytesObject *)PyObject_MALLOC(PyBytesObject_SIZE + size);
     if (op == NULL)
         return PyErr_NoMemory();
-    PyObject_INIT_VAR(op, &PyBytes_Type, size);
+    (void)PyObject_INIT_VAR(op, &PyBytes_Type, size);
     op->ob_shash = -1;
     if (str != NULL)
         Py_MEMCPY(op->ob_sval, str, size);
@@ -117,8 +99,8 @@
 PyObject *
 PyBytes_FromString(const char *str)
 {
-    register size_t size;
-    register PyBytesObject *op;
+    size_t size;
+    PyBytesObject *op;
 
     assert(str != NULL);
     size = strlen(str);
@@ -146,7 +128,7 @@
     op = (PyBytesObject *)PyObject_MALLOC(PyBytesObject_SIZE + size);
     if (op == NULL)
         return PyErr_NoMemory();
-    PyObject_INIT_VAR(op, &PyBytes_Type, size);
+    (void)PyObject_INIT_VAR(op, &PyBytes_Type, size);
     op->ob_shash = -1;
     Py_MEMCPY(op->ob_sval, str, size+1);
     /* share short strings */
@@ -517,7 +499,7 @@
 /* object api */
 
 Py_ssize_t
-PyBytes_Size(register PyObject *op)
+PyBytes_Size(PyObject *op)
 {
     if (!PyBytes_Check(op)) {
         PyErr_Format(PyExc_TypeError,
@@ -528,7 +510,7 @@
 }
 
 char *
-PyBytes_AsString(register PyObject *op)
+PyBytes_AsString(PyObject *op)
 {
     if (!PyBytes_Check(op)) {
         PyErr_Format(PyExc_TypeError,
@@ -539,9 +521,9 @@
 }
 
 int
-PyBytes_AsStringAndSize(register PyObject *obj,
-                         register char **s,
-                         register Py_ssize_t *len)
+PyBytes_AsStringAndSize(PyObject *obj,
+                         char **s,
+                         Py_ssize_t *len)
 {
     if (s == NULL) {
         PyErr_BadInternalCall();
@@ -573,6 +555,7 @@
 #include "stringlib/fastsearch.h"
 #include "stringlib/count.h"
 #include "stringlib/find.h"
+#include "stringlib/join.h"
 #include "stringlib/partition.h"
 #include "stringlib/split.h"
 #include "stringlib/ctype.h"
@@ -582,7 +565,7 @@
 PyObject *
 PyBytes_Repr(PyObject *obj, int smartquotes)
 {
-    register PyBytesObject* op = (PyBytesObject*) obj;
+    PyBytesObject* op = (PyBytesObject*) obj;
     Py_ssize_t i, length = Py_SIZE(op);
     Py_ssize_t newsize, squotes, dquotes;
     PyObject *v;
@@ -685,8 +668,8 @@
 
     va.len = -1;
     vb.len = -1;
-    if (_getbuffer(a, &va) < 0  ||
-        _getbuffer(b, &vb) < 0) {
+    if (PyObject_GetBuffer(a, &va, PyBUF_SIMPLE) != 0 ||
+        PyObject_GetBuffer(b, &vb, PyBUF_SIMPLE) != 0) {
         PyErr_Format(PyExc_TypeError, "can't concat %.100s to %.100s",
                      Py_TYPE(a)->tp_name, Py_TYPE(b)->tp_name);
         goto done;
@@ -725,12 +708,12 @@
 }
 
 static PyObject *
-bytes_repeat(register PyBytesObject *a, register Py_ssize_t n)
+bytes_repeat(PyBytesObject *a, Py_ssize_t n)
 {
-    register Py_ssize_t i;
-    register Py_ssize_t j;
-    register Py_ssize_t size;
-    register PyBytesObject *op;
+    Py_ssize_t i;
+    Py_ssize_t j;
+    Py_ssize_t size;
+    PyBytesObject *op;
     size_t nbytes;
     if (n < 0)
         n = 0;
@@ -756,7 +739,7 @@
     op = (PyBytesObject *)PyObject_MALLOC(PyBytesObject_SIZE + nbytes);
     if (op == NULL)
         return PyErr_NoMemory();
-    PyObject_INIT_VAR(op, &PyBytes_Type, size);
+    (void)PyObject_INIT_VAR(op, &PyBytes_Type, size);
     op->ob_shash = -1;
     op->ob_sval[size] = '\0';
     if (Py_SIZE(a) == 1 && n > 0) {
@@ -784,7 +767,7 @@
         Py_buffer varg;
         Py_ssize_t pos;
         PyErr_Clear();
-        if (_getbuffer(arg, &varg) < 0)
+        if (PyObject_GetBuffer(arg, &varg, PyBUF_SIMPLE) != 0)
             return -1;
         pos = stringlib_find(PyBytes_AS_STRING(self), Py_SIZE(self),
                              varg.buf, varg.len, 0);
@@ -800,7 +783,7 @@
 }
 
 static PyObject *
-bytes_item(PyBytesObject *a, register Py_ssize_t i)
+bytes_item(PyBytesObject *a, Py_ssize_t i)
 {
     if (i < 0 || i >= Py_SIZE(a)) {
         PyErr_SetString(PyExc_IndexError, "index out of range");
@@ -809,6 +792,23 @@
     return PyLong_FromLong((unsigned char)a->ob_sval[i]);
 }
 
+Py_LOCAL(int)
+bytes_compare_eq(PyBytesObject *a, PyBytesObject *b)
+{
+    int cmp;
+    Py_ssize_t len;
+
+    len = Py_SIZE(a);
+    if (Py_SIZE(b) != len)
+        return 0;
+
+    if (a->ob_sval[0] != b->ob_sval[0])
+        return 0;
+
+    cmp = memcmp(a->ob_sval, b->ob_sval, len);
+    return (cmp == 0);
+}
+
 static PyObject*
 bytes_richcompare(PyBytesObject *a, PyBytesObject *b, int op)
 {
@@ -829,53 +829,55 @@
                 return NULL;
         }
         result = Py_NotImplemented;
-        goto out;
     }
-    if (a == b) {
+    else if (a == b) {
         switch (op) {
-        case Py_EQ:case Py_LE:case Py_GE:
+        case Py_EQ:
+        case Py_LE:
+        case Py_GE:
+            /* a string is equal to itself */
             result = Py_True;
-            goto out;
-        case Py_NE:case Py_LT:case Py_GT:
+            break;
+        case Py_NE:
+        case Py_LT:
+        case Py_GT:
             result = Py_False;
-            goto out;
+            break;
+        default:
+            PyErr_BadArgument();
+            return NULL;
         }
     }
-    if (op == Py_EQ) {
-        /* Supporting Py_NE here as well does not save
-           much time, since Py_NE is rarely used.  */
-        if (Py_SIZE(a) == Py_SIZE(b)
-            && (a->ob_sval[0] == b->ob_sval[0]
-            && memcmp(a->ob_sval, b->ob_sval, Py_SIZE(a)) == 0)) {
-            result = Py_True;
-        } else {
-            result = Py_False;
+    else if (op == Py_EQ || op == Py_NE) {
+        int eq = bytes_compare_eq(a, b);
+        eq ^= (op == Py_NE);
+        result = eq ? Py_True : Py_False;
+    }
+    else {
+        len_a = Py_SIZE(a);
+        len_b = Py_SIZE(b);
+        min_len = Py_MIN(len_a, len_b);
+        if (min_len > 0) {
+            c = Py_CHARMASK(*a->ob_sval) - Py_CHARMASK(*b->ob_sval);
+            if (c == 0)
+                c = memcmp(a->ob_sval, b->ob_sval, min_len);
         }
-        goto out;
+        else
+            c = 0;
+        if (c == 0)
+            c = (len_a < len_b) ? -1 : (len_a > len_b) ? 1 : 0;
+        switch (op) {
+        case Py_LT: c = c <  0; break;
+        case Py_LE: c = c <= 0; break;
+        case Py_GT: c = c >  0; break;
+        case Py_GE: c = c >= 0; break;
+        default:
+            PyErr_BadArgument();
+            return NULL;
+        }
+        result = c ? Py_True : Py_False;
     }
-    len_a = Py_SIZE(a); len_b = Py_SIZE(b);
-    min_len = (len_a < len_b) ? len_a : len_b;
-    if (min_len > 0) {
-        c = Py_CHARMASK(*a->ob_sval) - Py_CHARMASK(*b->ob_sval);
-        if (c==0)
-            c = memcmp(a->ob_sval, b->ob_sval, min_len);
-    } else
-        c = 0;
-    if (c == 0)
-        c = (len_a < len_b) ? -1 : (len_a > len_b) ? 1 : 0;
-    switch (op) {
-    case Py_LT: c = c <  0; break;
-    case Py_LE: c = c <= 0; break;
-    case Py_EQ: assert(0);  break; /* unreachable */
-    case Py_NE: c = c != 0; break;
-    case Py_GT: c = c >  0; break;
-    case Py_GE: c = c >= 0; break;
-    default:
-        result = Py_NotImplemented;
-        goto out;
-    }
-    result = c ? Py_True : Py_False;
-  out:
+
     Py_INCREF(result);
     return result;
 }
@@ -885,7 +887,7 @@
 {
     if (a->ob_shash == -1) {
         /* Can't fail */
-        a->ob_shash = _Py_HashBytes((unsigned char *) a->ob_sval, Py_SIZE(a));
+        a->ob_shash = _Py_HashBytes(a->ob_sval, Py_SIZE(a));
     }
     return a->ob_shash;
 }
@@ -1019,7 +1021,7 @@
         maxsplit = PY_SSIZE_T_MAX;
     if (subobj == Py_None)
         return stringlib_split_whitespace((PyObject*) self, s, len, maxsplit);
-    if (_getbuffer(subobj, &vsub) < 0)
+    if (PyObject_GetBuffer(subobj, &vsub, PyBUF_SIMPLE) != 0)
         return NULL;
     sub = vsub.buf;
     n = vsub.len;
@@ -1039,21 +1041,19 @@
 static PyObject *
 bytes_partition(PyBytesObject *self, PyObject *sep_obj)
 {
-    const char *sep;
-    Py_ssize_t sep_len;
+    Py_buffer sep = {NULL, NULL};
+    PyObject *res;
 
-    if (PyBytes_Check(sep_obj)) {
-        sep = PyBytes_AS_STRING(sep_obj);
-        sep_len = PyBytes_GET_SIZE(sep_obj);
-    }
-    else if (PyObject_AsCharBuffer(sep_obj, &sep, &sep_len))
+    if (PyObject_GetBuffer(sep_obj, &sep, PyBUF_SIMPLE) != 0)
         return NULL;
 
-    return stringlib_partition(
+    res = stringlib_partition(
         (PyObject*) self,
         PyBytes_AS_STRING(self), PyBytes_GET_SIZE(self),
-        sep_obj, sep, sep_len
+        sep_obj, sep.buf, sep.len
         );
+    PyBuffer_Release(&sep);
+    return res;
 }
 
 PyDoc_STRVAR(rpartition__doc__,
@@ -1067,21 +1067,19 @@
 static PyObject *
 bytes_rpartition(PyBytesObject *self, PyObject *sep_obj)
 {
-    const char *sep;
-    Py_ssize_t sep_len;
+    Py_buffer sep = {NULL, NULL};
+    PyObject *res;
 
-    if (PyBytes_Check(sep_obj)) {
-        sep = PyBytes_AS_STRING(sep_obj);
-        sep_len = PyBytes_GET_SIZE(sep_obj);
-    }
-    else if (PyObject_AsCharBuffer(sep_obj, &sep, &sep_len))
+    if (PyObject_GetBuffer(sep_obj, &sep, PyBUF_SIMPLE) != 0)
         return NULL;
 
-    return stringlib_rpartition(
+    res = stringlib_rpartition(
         (PyObject*) self,
         PyBytes_AS_STRING(self), PyBytes_GET_SIZE(self),
-        sep_obj, sep, sep_len
+        sep_obj, sep.buf, sep.len
         );
+    PyBuffer_Release(&sep);
+    return res;
 }
 
 PyDoc_STRVAR(rsplit__doc__,
@@ -1111,7 +1109,7 @@
         maxsplit = PY_SSIZE_T_MAX;
     if (subobj == Py_None)
         return stringlib_rsplit_whitespace((PyObject*) self, s, len, maxsplit);
-    if (_getbuffer(subobj, &vsub) < 0)
+    if (PyObject_GetBuffer(subobj, &vsub, PyBUF_SIMPLE) != 0)
         return NULL;
     sub = vsub.buf;
     n = vsub.len;
@@ -1129,94 +1127,9 @@
 Example: b'.'.join([b'ab', b'pq', b'rs']) -> b'ab.pq.rs'.");
 
 static PyObject *
-bytes_join(PyObject *self, PyObject *orig)
+bytes_join(PyObject *self, PyObject *iterable)
 {
-    char *sep = PyBytes_AS_STRING(self);
-    const Py_ssize_t seplen = PyBytes_GET_SIZE(self);
-    PyObject *res = NULL;
-    char *p;
-    Py_ssize_t seqlen = 0;
-    size_t sz = 0;
-    Py_ssize_t i;
-    PyObject *seq, *item;
-
-    seq = PySequence_Fast(orig, "");
-    if (seq == NULL) {
-        return NULL;
-    }
-
-    seqlen = PySequence_Size(seq);
-    if (seqlen == 0) {
-        Py_DECREF(seq);
-        return PyBytes_FromString("");
-    }
-    if (seqlen == 1) {
-        item = PySequence_Fast_GET_ITEM(seq, 0);
-        if (PyBytes_CheckExact(item)) {
-            Py_INCREF(item);
-            Py_DECREF(seq);
-            return item;
-        }
-    }
-
-    /* There are at least two things to join, or else we have a subclass
-     * of the builtin types in the sequence.
-     * Do a pre-pass to figure out the total amount of space we'll
-     * need (sz), and see whether all argument are bytes.
-     */
-    /* XXX Shouldn't we use _getbuffer() on these items instead? */
-    for (i = 0; i < seqlen; i++) {
-        const size_t old_sz = sz;
-        item = PySequence_Fast_GET_ITEM(seq, i);
-        if (!PyBytes_Check(item) && !PyByteArray_Check(item)) {
-            PyErr_Format(PyExc_TypeError,
-                         "sequence item %zd: expected bytes,"
-                         " %.80s found",
-                         i, Py_TYPE(item)->tp_name);
-            Py_DECREF(seq);
-            return NULL;
-        }
-        sz += Py_SIZE(item);
-        if (i != 0)
-            sz += seplen;
-        if (sz < old_sz || sz > PY_SSIZE_T_MAX) {
-            PyErr_SetString(PyExc_OverflowError,
-                "join() result is too long for bytes");
-            Py_DECREF(seq);
-            return NULL;
-        }
-    }
-
-    /* Allocate result space. */
-    res = PyBytes_FromStringAndSize((char*)NULL, sz);
-    if (res == NULL) {
-        Py_DECREF(seq);
-        return NULL;
-    }
-
-    /* Catenate everything. */
-    /* I'm not worried about a PyByteArray item growing because there's
-       nowhere in this function where we release the GIL. */
-    p = PyBytes_AS_STRING(res);
-    for (i = 0; i < seqlen; ++i) {
-        size_t n;
-        char *q;
-        if (i) {
-            Py_MEMCPY(p, sep, seplen);
-            p += seplen;
-        }
-        item = PySequence_Fast_GET_ITEM(seq, i);
-        n = Py_SIZE(item);
-        if (PyBytes_Check(item))
-            q = PyBytes_AS_STRING(item);
-        else
-            q = PyByteArray_AS_STRING(item);
-        Py_MEMCPY(p, q, n);
-        p += n;
-    }
-
-    Py_DECREF(seq);
-    return res;
+    return stringlib_bytes_join(self, iterable);
 }
 
 PyObject *
@@ -1258,7 +1171,7 @@
         return -2;
 
     if (subobj) {
-        if (_getbuffer(subobj, &subbuf) < 0)
+        if (PyObject_GetBuffer(subobj, &subbuf, PyBUF_SIMPLE) != 0)
             return -2;
 
         sub = subbuf.buf;
@@ -1373,7 +1286,7 @@
     Py_ssize_t seplen;
     Py_ssize_t i, j;
 
-    if (_getbuffer(sepobj, &vsep) < 0)
+    if (PyObject_GetBuffer(sepobj, &vsep, PyBUF_SIMPLE) != 0)
         return NULL;
     sep = vsep.buf;
     seplen = vsep.len;
@@ -1439,7 +1352,7 @@
 {
     PyObject *sep = NULL;
 
-    if (!PyArg_ParseTuple(args, (char *)stripformat[striptype], &sep))
+    if (!PyArg_ParseTuple(args, stripformat[striptype], &sep))
         return NULL;
 
     if (sep != NULL && sep != Py_None) {
@@ -1518,7 +1431,7 @@
         return NULL;
 
     if (sub_obj) {
-        if (_getbuffer(sub_obj, &vsub) < 0)
+        if (PyObject_GetBuffer(sub_obj, &vsub, PyBUF_SIMPLE) != 0)
             return NULL;
 
         sub = vsub.buf;
@@ -1553,9 +1466,11 @@
 static PyObject *
 bytes_translate(PyBytesObject *self, PyObject *args)
 {
-    register char *input, *output;
+    char *input, *output;
+    Py_buffer table_view = {NULL, NULL};
+    Py_buffer del_table_view = {NULL, NULL};
     const char *table;
-    register Py_ssize_t i, c, changed = 0;
+    Py_ssize_t i, c, changed = 0;
     PyObject *input_obj = (PyObject*)self;
     const char *output_start, *del_table=NULL;
     Py_ssize_t inlen, tablen, dellen = 0;
@@ -1575,12 +1490,17 @@
         table = NULL;
         tablen = 256;
     }
-    else if (PyObject_AsCharBuffer(tableobj, &table, &tablen))
-        return NULL;
+    else {
+        if (PyObject_GetBuffer(tableobj, &table_view, PyBUF_SIMPLE) != 0)
+            return NULL;
+        table = table_view.buf;
+        tablen = table_view.len;
+    }
 
     if (tablen != 256) {
         PyErr_SetString(PyExc_ValueError,
           "translation table must be 256 characters long");
+        PyBuffer_Release(&table_view);
         return NULL;
     }
 
@@ -1589,8 +1509,14 @@
             del_table = PyBytes_AS_STRING(delobj);
             dellen = PyBytes_GET_SIZE(delobj);
         }
-        else if (PyObject_AsCharBuffer(delobj, &del_table, &dellen))
-            return NULL;
+        else {
+            if (PyObject_GetBuffer(delobj, &del_table_view, PyBUF_SIMPLE) != 0) {
+                PyBuffer_Release(&table_view);
+                return NULL;
+            }
+            del_table = del_table_view.buf;
+            dellen = del_table_view.len;
+        }
     }
     else {
         del_table = NULL;
@@ -1599,8 +1525,11 @@
 
     inlen = PyBytes_GET_SIZE(input_obj);
     result = PyBytes_FromStringAndSize((char *)NULL, inlen);
-    if (result == NULL)
+    if (result == NULL) {
+        PyBuffer_Release(&del_table_view);
+        PyBuffer_Release(&table_view);
         return NULL;
+    }
     output_start = output = PyBytes_AsString(result);
     input = PyBytes_AS_STRING(input_obj);
 
@@ -1611,11 +1540,14 @@
             if (Py_CHARMASK((*output++ = table[c])) != c)
                 changed = 1;
         }
-        if (changed || !PyBytes_CheckExact(input_obj))
-            return result;
-        Py_DECREF(result);
-        Py_INCREF(input_obj);
-        return input_obj;
+        if (!changed && PyBytes_CheckExact(input_obj)) {
+            Py_INCREF(input_obj);
+            Py_DECREF(result);
+            result = input_obj;
+        }
+        PyBuffer_Release(&del_table_view);
+        PyBuffer_Release(&table_view);
+        return result;
     }
 
     if (table == NULL) {
@@ -1625,9 +1557,11 @@
         for (i = 0; i < 256; i++)
             trans_table[i] = Py_CHARMASK(table[i]);
     }
+    PyBuffer_Release(&table_view);
 
     for (i = 0; i < dellen; i++)
         trans_table[(int) Py_CHARMASK(del_table[i])] = -1;
+    PyBuffer_Release(&del_table_view);
 
     for (i = inlen; --i >= 0; ) {
         c = Py_CHARMASK(*input++);
@@ -2156,31 +2090,21 @@
 static PyObject *
 bytes_replace(PyBytesObject *self, PyObject *args)
 {
+    PyObject *res;
+    Py_buffer old = {NULL, NULL};
+    Py_buffer new = {NULL, NULL};
     Py_ssize_t count = -1;
-    PyObject *from, *to;
-    const char *from_s, *to_s;
-    Py_ssize_t from_len, to_len;
 
-    if (!PyArg_ParseTuple(args, "OO|n:replace", &from, &to, &count))
+    if (!PyArg_ParseTuple(args, "y*y*|n:replace", &old, &new, &count))
         return NULL;
 
-    if (PyBytes_Check(from)) {
-        from_s = PyBytes_AS_STRING(from);
-        from_len = PyBytes_GET_SIZE(from);
-    }
-    else if (PyObject_AsCharBuffer(from, &from_s, &from_len))
-        return NULL;
+    res = (PyObject *)replace((PyBytesObject *) self,
+                              (const char *)old.buf, old.len,
+                              (const char *)new.buf, new.len, count);
 
-    if (PyBytes_Check(to)) {
-        to_s = PyBytes_AS_STRING(to);
-        to_len = PyBytes_GET_SIZE(to);
-    }
-    else if (PyObject_AsCharBuffer(to, &to_s, &to_len))
-        return NULL;
-
-    return (PyObject *)replace((PyBytesObject *) self,
-                               from_s, from_len,
-                               to_s, to_len, count);
+    PyBuffer_Release(&old);
+    PyBuffer_Release(&new);
+    return res;
 }
 
 /** End DALKE **/
@@ -2195,6 +2119,7 @@
 {
     Py_ssize_t len = PyBytes_GET_SIZE(self);
     Py_ssize_t slen;
+    Py_buffer sub_view = {NULL, NULL};
     const char* sub;
     const char* str;
 
@@ -2202,8 +2127,12 @@
         sub = PyBytes_AS_STRING(substr);
         slen = PyBytes_GET_SIZE(substr);
     }
-    else if (PyObject_AsCharBuffer(substr, &sub, &slen))
-        return -1;
+    else {
+        if (PyObject_GetBuffer(substr, &sub_view, PyBUF_SIMPLE) != 0)
+            return -1;
+        sub = sub_view.buf;
+        slen = sub_view.len;
+    }
     str = PyBytes_AS_STRING(self);
 
     ADJUST_INDICES(start, end, len);
@@ -2211,17 +2140,25 @@
     if (direction < 0) {
         /* startswith */
         if (start+slen > len)
-            return 0;
+            goto notfound;
     } else {
         /* endswith */
         if (end-start < slen || start > len)
-            return 0;
+            goto notfound;
 
         if (end-slen > start)
             start = end - slen;
     }
-    if (end-start >= slen)
-        return ! memcmp(str+start, sub, slen);
+    if (end-start < slen)
+        goto notfound;
+    if (memcmp(str+start, sub, slen) != 0)
+        goto notfound;
+
+    PyBuffer_Release(&sub_view);
+    return 1;
+
+notfound:
+    PyBuffer_Release(&sub_view);
     return 0;
 }
 
@@ -2333,8 +2270,6 @@
 
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|ss:decode", kwlist, &encoding, &errors))
         return NULL;
-    if (encoding == NULL)
-        encoding = PyUnicode_GetDefaultEncoding();
     return PyUnicode_FromEncodedObject(self, encoding, errors);
 }
 
@@ -2464,7 +2399,7 @@
     {"decode", (PyCFunction)bytes_decode, METH_VARARGS | METH_KEYWORDS, decode__doc__},
     {"endswith", (PyCFunction)bytes_endswith, METH_VARARGS,
      endswith__doc__},
-    {"expandtabs", (PyCFunction)stringlib_expandtabs, METH_VARARGS,
+    {"expandtabs", (PyCFunction)stringlib_expandtabs, METH_VARARGS | METH_KEYWORDS,
      expandtabs__doc__},
     {"find", (PyCFunction)bytes_find, METH_VARARGS, find__doc__},
     {"fromhex", (PyCFunction)bytes_fromhex, METH_VARARGS|METH_CLASS,
@@ -2561,6 +2496,13 @@
         return new;
     }
 
+    /* If it's not unicode, there can't be encoding or errors */
+    if (encoding != NULL || errors != NULL) {
+        PyErr_SetString(PyExc_TypeError,
+            "encoding or errors without a string argument");
+        return NULL;
+    }
+
     /* 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. */
@@ -2602,13 +2544,6 @@
         return new;
     }
 
-    /* If it's not unicode, there can't be encoding or errors */
-    if (encoding != NULL || errors != NULL) {
-        PyErr_SetString(PyExc_TypeError,
-            "encoding or errors without a string argument");
-        return NULL;
-    }
-
     return PyBytes_FromObject(x);
 }
 
@@ -2696,7 +2631,7 @@
     }
 
     /* For iterator version, create a string object and resize as needed */
-    size = _PyObject_LengthHint(x, 64);
+    size = PyObject_LengthHint(x, 64);
     if (size == -1 && PyErr_Occurred())
         return NULL;
     /* Allocate an extra byte to prevent PyBytes_FromStringAndSize() from
@@ -2754,9 +2689,8 @@
     return new;
 
   error:
-    /* Error handling when new != NULL */
     Py_XDECREF(it);
-    Py_DECREF(new);
+    Py_XDECREF(new);
     return NULL;
 }
 
@@ -2842,9 +2776,9 @@
 };
 
 void
-PyBytes_Concat(register PyObject **pv, register PyObject *w)
+PyBytes_Concat(PyObject **pv, PyObject *w)
 {
-    register PyObject *v;
+    PyObject *v;
     assert(pv != NULL);
     if (*pv == NULL)
         return;
@@ -2858,7 +2792,7 @@
 }
 
 void
-PyBytes_ConcatAndDel(register PyObject **pv, register PyObject *w)
+PyBytes_ConcatAndDel(PyObject **pv, PyObject *w)
 {
     PyBytes_Concat(pv, w);
     Py_XDECREF(w);
@@ -2882,8 +2816,8 @@
 int
 _PyBytes_Resize(PyObject **pv, Py_ssize_t newsize)
 {
-    register PyObject *v;
-    register PyBytesObject *sv;
+    PyObject *v;
+    PyBytesObject *sv;
     v = *pv;
     if (!PyBytes_Check(v) || Py_REFCNT(v) != 1 || newsize < 0) {
         *pv = 0;
diff --git a/Objects/classobject.c b/Objects/classobject.c
index cdc9b1c..0c0bd47 100644
--- a/Objects/classobject.c
+++ b/Objects/classobject.c
@@ -44,7 +44,7 @@
 PyObject *
 PyMethod_New(PyObject *func, PyObject *self)
 {
-    register PyMethodObject *im;
+    PyMethodObject *im;
     if (self == NULL) {
         PyErr_BadInternalCall();
         return NULL;
@@ -52,7 +52,7 @@
     im = free_list;
     if (im != NULL) {
         free_list = (PyMethodObject *)(im->im_self);
-        PyObject_INIT(im, &PyMethod_Type);
+        (void)PyObject_INIT(im, &PyMethod_Type);
         numfree--;
     }
     else {
@@ -69,6 +69,30 @@
     return (PyObject *)im;
 }
 
+static PyObject *
+method_reduce(PyMethodObject *im)
+{
+    PyObject *self = PyMethod_GET_SELF(im);
+    PyObject *func = PyMethod_GET_FUNCTION(im);
+    PyObject *builtins;
+    PyObject *getattr;
+    PyObject *funcname;
+    _Py_IDENTIFIER(getattr);
+
+    funcname = _PyObject_GetAttrId(func, &PyId___name__);
+    if (funcname == NULL) {
+        return NULL;
+    }
+    builtins = PyEval_GetBuiltins();
+    getattr = _PyDict_GetItemId(builtins, &PyId_getattr);
+    return Py_BuildValue("O(ON)", getattr, self, funcname);
+}
+
+static PyMethodDef method_methods[] = {
+    {"__reduce__", (PyCFunction)method_reduce, METH_NOARGS, NULL},
+    {NULL, NULL}
+};
+
 /* Descriptors for PyMethod attributes */
 
 /* im_func and im_self are stored in the PyMethod object */
@@ -164,7 +188,7 @@
 }
 
 static void
-method_dealloc(register PyMethodObject *im)
+method_dealloc(PyMethodObject *im)
 {
     _PyObject_GC_UNTRACK(im);
     if (im->im_weakreflist != NULL)
@@ -367,7 +391,7 @@
     offsetof(PyMethodObject, im_weakreflist), /* tp_weaklistoffset */
     0,                                          /* tp_iter */
     0,                                          /* tp_iternext */
-    0,                                          /* tp_methods */
+    method_methods,                             /* tp_methods */
     method_memberlist,                          /* tp_members */
     method_getset,                              /* tp_getset */
     0,                                          /* tp_base */
@@ -509,7 +533,7 @@
 
 static PyObject *
 instancemethod_descr_get(PyObject *descr, PyObject *obj, PyObject *type) {
-    register PyObject *func = PyInstanceMethod_GET_FUNCTION(descr);
+    PyObject *func = PyInstanceMethod_GET_FUNCTION(descr);
     if (obj == NULL) {
         Py_INCREF(func);
         return func;
diff --git a/Objects/codeobject.c b/Objects/codeobject.c
index 9713f61..353f414 100644
--- a/Objects/codeobject.c
+++ b/Objects/codeobject.c
@@ -74,6 +74,11 @@
         PyErr_BadInternalCall();
         return NULL;
     }
+
+    /* Ensure that the filename is a ready Unicode string */
+    if (PyUnicode_READY(filename) < 0)
+        return NULL;
+
     n_cellvars = PyTuple_GET_SIZE(cellvars);
     intern_strings(names);
     intern_strings(varnames);
diff --git a/Objects/complexobject.c b/Objects/complexobject.c
index b08aa6f..7f4cdd9 100644
--- a/Objects/complexobject.c
+++ b/Objects/complexobject.c
@@ -78,7 +78,7 @@
      const double abs_breal = b.real < 0 ? -b.real : b.real;
      const double abs_bimag = b.imag < 0 ? -b.imag : b.imag;
 
-     if (abs_breal >= abs_bimag) {
+    if (abs_breal >= abs_bimag) {
         /* divide tops and bottom by b.real */
         if (abs_breal == 0.0) {
             errno = EDOM;
@@ -91,7 +91,7 @@
             r.imag = (a.imag - a.real * ratio) / denom;
         }
     }
-    else {
+    else if (abs_bimag >= abs_breal) {
         /* divide tops and bottom by b.imag */
         const double ratio = b.real / b.imag;
         const double denom = b.real * ratio + b.imag;
@@ -99,6 +99,10 @@
         r.real = (a.real * ratio + a.imag) / denom;
         r.imag = (a.imag * ratio - a.real) / denom;
     }
+    else {
+        /* At least one of b.real or b.imag is a NaN */
+        r.real = r.imag = Py_NAN;
+    }
     return r;
 }
 
@@ -211,13 +215,13 @@
 PyObject *
 PyComplex_FromCComplex(Py_complex cval)
 {
-    register PyComplexObject *op;
+    PyComplexObject *op;
 
     /* Inline PyObject_New */
     op = (PyComplexObject *) PyObject_MALLOC(sizeof(PyComplexObject));
     if (op == NULL)
         return PyErr_NoMemory();
-    PyObject_INIT(op, &PyComplex_Type);
+    (void)PyObject_INIT(op, &PyComplex_Type);
     op->cval = cval;
     return (PyObject *) op;
 }
@@ -271,6 +275,12 @@
     if (f) {
         PyObject *res = PyObject_CallFunctionObjArgs(f, NULL);
         Py_DECREF(f);
+        if (res != NULL && !PyComplex_Check(res)) {
+            PyErr_SetString(PyExc_TypeError,
+                "__complex__ should return a complex object");
+            Py_DECREF(res);
+            return NULL;
+        }
         return res;
     }
     return NULL;
@@ -296,12 +306,6 @@
     newop = try_complex_special_method(op);
 
     if (newop) {
-        if (!PyComplex_Check(newop)) {
-            PyErr_SetString(PyExc_TypeError,
-                "__complex__ should return a complex object");
-            Py_DECREF(newop);
-            return cv;
-        }
         cv = ((PyComplexObject *)newop)->cval;
         Py_DECREF(newop);
         return cv;
@@ -705,7 +709,7 @@
     if (!PyArg_ParseTuple(args, "U:__format__", &format_spec))
         return NULL;
 
-    _PyUnicodeWriter_Init(&writer, 0);
+    _PyUnicodeWriter_Init(&writer);
     ret = _PyComplex_FormatAdvancedWriter(
         &writer,
         self,
@@ -763,6 +767,7 @@
     int got_bracket=0;
     PyObject *s_buffer = NULL;
     Py_ssize_t len;
+    Py_buffer view = {NULL, NULL};
 
     if (PyUnicode_Check(v)) {
         s_buffer = _PyUnicode_TransformDecimalAndSpaceToASCII(v);
@@ -772,9 +777,14 @@
         if (s == NULL)
             goto error;
     }
-    else if (PyObject_AsCharBuffer(v, &s, &len)) {
-        PyErr_SetString(PyExc_TypeError,
-                        "complex() argument must be a string or a number");
+    else if (PyObject_GetBuffer(v, &view, PyBUF_SIMPLE) == 0) {
+        s = (const char *)view.buf;
+        len = view.len;
+    }
+    else {
+        PyErr_Format(PyExc_TypeError,
+            "complex() argument must be a string or a number, not '%.200s'",
+            Py_TYPE(v)->tp_name);
         return NULL;
     }
 
@@ -885,6 +895,7 @@
     if (s-start != len)
         goto parse_error;
 
+    PyBuffer_Release(&view);
     Py_XDECREF(s_buffer);
     return complex_subtype_from_doubles(type, x, y);
 
@@ -892,6 +903,7 @@
     PyErr_SetString(PyExc_ValueError,
                     "complex() arg is a malformed string");
   error:
+    PyBuffer_Release(&view);
     Py_XDECREF(s_buffer);
     return NULL;
 }
@@ -953,8 +965,9 @@
         nbi = i->ob_type->tp_as_number;
     if (nbr == NULL || nbr->nb_float == NULL ||
         ((i != NULL) && (nbi == NULL || nbi->nb_float == NULL))) {
-        PyErr_SetString(PyExc_TypeError,
-                   "complex() argument must be a string or a number");
+        PyErr_Format(PyExc_TypeError,
+            "complex() argument must be a string or a number, not '%.200s'",
+            Py_TYPE(r)->tp_name);
         if (own_r) {
             Py_DECREF(r);
         }
diff --git a/Objects/descrobject.c b/Objects/descrobject.c
index ba98a30..2df5ac5 100644
--- a/Objects/descrobject.c
+++ b/Objects/descrobject.c
@@ -115,7 +115,7 @@
                      ((PyTypeObject *)type)->tp_name);
         return NULL;
     }
-    return PyCFunction_New(descr->d_method, type);
+    return PyCFunction_NewEx(descr->d_method, type, NULL);
 }
 
 static PyObject *
@@ -125,7 +125,7 @@
 
     if (descr_check((PyDescrObject *)descr, obj, &res))
         return res;
-    return PyCFunction_New(descr->d_method, obj);
+    return PyCFunction_NewEx(descr->d_method, obj, NULL);
 }
 
 static PyObject *
@@ -239,7 +239,7 @@
         return NULL;
     }
 
-    func = PyCFunction_New(descr->d_method, self);
+    func = PyCFunction_NewEx(descr->d_method, self, NULL);
     if (func == NULL)
         return NULL;
     args = PyTuple_GetSlice(args, 1, argc);
@@ -292,7 +292,7 @@
         return NULL;
     }
 
-    func = PyCFunction_New(descr->d_method, self);
+    func = PyCFunction_NewEx(descr->d_method, self, NULL);
     if (func == NULL)
         return NULL;
     args = PyTuple_GetSlice(args, 1, argc);
@@ -353,11 +353,13 @@
 static PyObject *
 method_get_doc(PyMethodDescrObject *descr, void *closure)
 {
-    if (descr->d_method->ml_doc == NULL) {
-        Py_INCREF(Py_None);
-        return Py_None;
-    }
-    return PyUnicode_FromString(descr->d_method->ml_doc);
+    return _PyType_GetDocFromInternalDoc(descr->d_method->ml_name, descr->d_method->ml_doc);
+}
+
+static PyObject *
+method_get_text_signature(PyMethodDescrObject *descr, void *closure)
+{
+    return _PyType_GetTextSignatureFromInternalDoc(descr->d_method->ml_name, descr->d_method->ml_doc);
 }
 
 static PyObject *
@@ -398,6 +400,24 @@
     return descr->d_qualname;
 }
 
+static PyObject *
+descr_reduce(PyDescrObject *descr)
+{
+    PyObject *builtins;
+    PyObject *getattr;
+    _Py_IDENTIFIER(getattr);
+
+    builtins = PyEval_GetBuiltins();
+    getattr = _PyDict_GetItemId(builtins, &PyId_getattr);
+    return Py_BuildValue("O(OO)", getattr, PyDescr_TYPE(descr),
+                         PyDescr_NAME(descr));
+}
+
+static PyMethodDef descr_methods[] = {
+    {"__reduce__", (PyCFunction)descr_reduce, METH_NOARGS, NULL},
+    {NULL, NULL}
+};
+
 static PyMemberDef descr_members[] = {
     {"__objclass__", T_OBJECT, offsetof(PyDescrObject, d_type), READONLY},
     {"__name__", T_OBJECT, offsetof(PyDescrObject, d_name), READONLY},
@@ -407,6 +427,7 @@
 static PyGetSetDef method_getset[] = {
     {"__doc__", (getter)method_get_doc},
     {"__qualname__", (getter)descr_get_qualname},
+    {"__text_signature__", (getter)method_get_text_signature},
     {0}
 };
 
@@ -445,16 +466,19 @@
 static PyObject *
 wrapperdescr_get_doc(PyWrapperDescrObject *descr, void *closure)
 {
-    if (descr->d_base->doc == NULL) {
-        Py_INCREF(Py_None);
-        return Py_None;
-    }
-    return PyUnicode_FromString(descr->d_base->doc);
+    return _PyType_GetDocFromInternalDoc(descr->d_base->name, descr->d_base->doc);
+}
+
+static PyObject *
+wrapperdescr_get_text_signature(PyWrapperDescrObject *descr, void *closure)
+{
+    return _PyType_GetTextSignatureFromInternalDoc(descr->d_base->name, descr->d_base->doc);
 }
 
 static PyGetSetDef wrapperdescr_getset[] = {
     {"__doc__", (getter)wrapperdescr_get_doc},
     {"__qualname__", (getter)descr_get_qualname},
+    {"__text_signature__", (getter)wrapperdescr_get_text_signature},
     {0}
 };
 
@@ -494,7 +518,7 @@
     0,                                          /* tp_weaklistoffset */
     0,                                          /* tp_iter */
     0,                                          /* tp_iternext */
-    0,                                          /* tp_methods */
+    descr_methods,                              /* tp_methods */
     descr_members,                              /* tp_members */
     method_getset,                              /* tp_getset */
     0,                                          /* tp_base */
@@ -532,7 +556,7 @@
     0,                                          /* tp_weaklistoffset */
     0,                                          /* tp_iter */
     0,                                          /* tp_iternext */
-    0,                                          /* tp_methods */
+    descr_methods,                              /* tp_methods */
     descr_members,                              /* tp_members */
     method_getset,                              /* tp_getset */
     0,                                          /* tp_base */
@@ -569,7 +593,7 @@
     0,                                          /* tp_weaklistoffset */
     0,                                          /* tp_iter */
     0,                                          /* tp_iternext */
-    0,                                          /* tp_methods */
+    descr_methods,                              /* tp_methods */
     descr_members,                              /* tp_members */
     member_getset,                              /* tp_getset */
     0,                                          /* tp_base */
@@ -643,7 +667,7 @@
     0,                                          /* tp_weaklistoffset */
     0,                                          /* tp_iter */
     0,                                          /* tp_iternext */
-    0,                                          /* tp_methods */
+    descr_methods,                              /* tp_methods */
     descr_members,                              /* tp_members */
     wrapperdescr_getset,                        /* tp_getset */
     0,                                          /* tp_base */
@@ -1009,7 +1033,7 @@
 static PyObject *
 wrapper_richcompare(PyObject *a, PyObject *b, int op)
 {
-    int result;
+    Py_intptr_t result;
     PyObject *v;
     PyWrapperDescrObject *a_descr, *b_descr;
 
@@ -1085,6 +1109,23 @@
                                wp->self);
 }
 
+static PyObject *
+wrapper_reduce(wrapperobject *wp)
+{
+    PyObject *builtins;
+    PyObject *getattr;
+    _Py_IDENTIFIER(getattr);
+
+    builtins = PyEval_GetBuiltins();
+    getattr = _PyDict_GetItemId(builtins, &PyId_getattr);
+    return Py_BuildValue("O(OO)", getattr, wp->self, PyDescr_NAME(wp->descr));
+}
+
+static PyMethodDef wrapper_methods[] = {
+    {"__reduce__", (PyCFunction)wrapper_reduce, METH_NOARGS, NULL},
+    {NULL, NULL}
+};
+
 static PyMemberDef wrapper_members[] = {
     {"__self__", T_OBJECT, offsetof(wrapperobject, self), READONLY},
     {0}
@@ -1108,17 +1149,15 @@
 }
 
 static PyObject *
-wrapper_doc(wrapperobject *wp)
+wrapper_doc(wrapperobject *wp, void *closure)
 {
-    const char *s = wp->descr->d_base->doc;
+    return _PyType_GetDocFromInternalDoc(wp->descr->d_base->name, wp->descr->d_base->doc);
+}
 
-    if (s == NULL) {
-        Py_INCREF(Py_None);
-        return Py_None;
-    }
-    else {
-        return PyUnicode_FromString(s);
-    }
+static PyObject *
+wrapper_text_signature(wrapperobject *wp, void *closure)
+{
+    return _PyType_GetTextSignatureFromInternalDoc(wp->descr->d_base->name, wp->descr->d_base->doc);
 }
 
 static PyObject *
@@ -1132,6 +1171,7 @@
     {"__name__", (getter)wrapper_name},
     {"__qualname__", (getter)wrapper_qualname},
     {"__doc__", (getter)wrapper_doc},
+    {"__text_signature__", (getter)wrapper_text_signature},
     {0}
 };
 
@@ -1193,7 +1233,7 @@
     0,                                          /* tp_weaklistoffset */
     0,                                          /* tp_iter */
     0,                                          /* tp_iternext */
-    0,                                          /* tp_methods */
+    wrapper_methods,                            /* tp_methods */
     wrapper_members,                            /* tp_members */
     wrapper_getsets,                            /* tp_getset */
     0,                                          /* tp_base */
diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index 7aa5ea8..bab6242 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -69,6 +69,11 @@
 #include "Python.h"
 #include "stringlib/eq.h"
 
+/*[clinic input]
+class dict "PyDictObject *" "&PyDict_Type"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=f157a5a0ce9589d6]*/
+
 typedef struct {
     /* Cached hash code of me_key. */
     Py_hash_t me_hash;
@@ -95,20 +100,6 @@
 it's USABLE_FRACTION (currently two-thirds) full.
 */
 
-/* Set a key error with the specified argument, wrapping it in a
- * tuple automatically so that tuple keys are not unpacked as the
- * exception arguments. */
-static void
-set_key_error(PyObject *arg)
-{
-    PyObject *tup;
-    tup = PyTuple_Pack(1, arg);
-    if (!tup)
-        return; /* caller will expect error to be set anyway */
-    PyErr_SetObject(PyExc_KeyError, tup);
-    Py_DECREF(tup);
-}
-
 #define PERTURB_SHIFT 5
 
 /*
@@ -305,9 +296,9 @@
  * #define USABLE_FRACTION(n) (((n) >> 1) + ((n) >> 2) - ((n) >> 3))
 */
 
-/* GROWTH_RATE. Growth rate upon hitting maximum load. 
- * Currently set to used*2 + capacity/2. 
- * This means that dicts double in size when growing without deletions, 
+/* GROWTH_RATE. Growth rate upon hitting maximum load.
+ * Currently set to used*2 + capacity/2.
+ * This means that dicts double in size when growing without deletions,
  * but have more head room when the number of deletions is on a par with the
  * number of insertions.
  * Raising this to used*4 doubles memory consumption depending on the size of
@@ -389,6 +380,7 @@
 new_dict(PyDictKeysObject *keys, PyObject **values)
 {
     PyDictObject *mp;
+    assert(keys != NULL);
     if (numfree) {
         mp = free_list[--numfree];
         assert (mp != NULL);
@@ -431,7 +423,10 @@
 PyObject *
 PyDict_New(void)
 {
-    return new_dict(new_keys_object(PyDict_MINSIZE_COMBINED), NULL);
+    PyDictKeysObject *keys = new_keys_object(PyDict_MINSIZE_COMBINED);
+    if (keys == NULL)
+        return NULL;
+    return new_dict(keys, NULL);
 }
 
 /*
@@ -463,13 +458,13 @@
 lookdict(PyDictObject *mp, PyObject *key,
          Py_hash_t hash, PyObject ***value_addr)
 {
-    register size_t i;
-    register size_t perturb;
-    register PyDictKeyEntry *freeslot;
-    register size_t mask;
+    size_t i;
+    size_t perturb;
+    PyDictKeyEntry *freeslot;
+    size_t mask;
     PyDictKeyEntry *ep0;
-    register PyDictKeyEntry *ep;
-    register int cmp;
+    PyDictKeyEntry *ep;
+    int cmp;
     PyObject *startkey;
 
 top:
@@ -555,12 +550,12 @@
 lookdict_unicode(PyDictObject *mp, PyObject *key,
                  Py_hash_t hash, PyObject ***value_addr)
 {
-    register size_t i;
-    register size_t perturb;
-    register PyDictKeyEntry *freeslot;
-    register size_t mask = DK_MASK(mp->ma_keys);
+    size_t i;
+    size_t perturb;
+    PyDictKeyEntry *freeslot;
+    size_t mask = DK_MASK(mp->ma_keys);
     PyDictKeyEntry *ep0 = &mp->ma_keys->dk_entries[0];
-    register PyDictKeyEntry *ep;
+    PyDictKeyEntry *ep;
 
     /* Make sure this function doesn't have to handle non-unicode keys,
        including subclasses of str; e.g., one reason to subclass
@@ -620,11 +615,11 @@
 lookdict_unicode_nodummy(PyDictObject *mp, PyObject *key,
                          Py_hash_t hash, PyObject ***value_addr)
 {
-    register size_t i;
-    register size_t perturb;
-    register size_t mask = DK_MASK(mp->ma_keys);
+    size_t i;
+    size_t perturb;
+    size_t mask = DK_MASK(mp->ma_keys);
     PyDictKeyEntry *ep0 = &mp->ma_keys->dk_entries[0];
-    register PyDictKeyEntry *ep;
+    PyDictKeyEntry *ep;
 
     /* Make sure this function doesn't have to handle non-unicode keys,
        including subclasses of str; e.g., one reason to subclass
@@ -665,11 +660,11 @@
 lookdict_split(PyDictObject *mp, PyObject *key,
                Py_hash_t hash, PyObject ***value_addr)
 {
-    register size_t i;
-    register size_t perturb;
-    register size_t mask = DK_MASK(mp->ma_keys);
+    size_t i;
+    size_t perturb;
+    size_t mask = DK_MASK(mp->ma_keys);
     PyDictKeyEntry *ep0 = &mp->ma_keys->dk_entries[0];
-    register PyDictKeyEntry *ep;
+    PyDictKeyEntry *ep;
 
     if (!PyUnicode_CheckExact(key)) {
         ep = lookdict(mp, key, hash, value_addr);
@@ -819,13 +814,14 @@
     if (ep == NULL) {
         return -1;
     }
+    assert(PyUnicode_CheckExact(key) || mp->ma_keys->dk_lookup == lookdict);
     Py_INCREF(value);
     MAINTAIN_TRACKING(mp, key, value);
     old_value = *value_addr;
     if (old_value != NULL) {
         assert(ep->me_key != NULL && ep->me_key != dummy);
         *value_addr = value;
-        Py_DECREF(old_value); /* which **CAN** re-enter */
+        Py_DECREF(old_value); /* which **CAN** re-enter (see issue #22653) */
     }
     else {
         if (ep->me_key == NULL) {
@@ -856,9 +852,8 @@
         }
         mp->ma_used++;
         *value_addr = value;
+        assert(ep->me_key != NULL && ep->me_key != dummy);
     }
-    assert(ep->me_key != NULL && ep->me_key != dummy);
-    assert(PyUnicode_CheckExact(key) || mp->ma_keys->dk_lookup == lookdict);
     return 0;
 }
 
@@ -1237,7 +1232,7 @@
     if (ep == NULL)
         return -1;
     if (*value_addr == NULL) {
-        set_key_error(key);
+        _PyErr_SetKeyError(key);
         return -1;
     }
     old_value = *value_addr;
@@ -1391,7 +1386,7 @@
         }
         DK_DECREF(keys);
     }
-    else {
+    else if (keys != NULL) {
         assert(keys->dk_refcnt == 1);
         DK_DECREF(keys);
     }
@@ -1407,9 +1402,9 @@
 dict_repr(PyDictObject *mp)
 {
     Py_ssize_t i;
-    PyObject *s, *temp, *colon = NULL;
-    PyObject *pieces = NULL, *result = NULL;
-    PyObject *key, *value;
+    PyObject *key = NULL, *value = NULL;
+    _PyUnicodeWriter writer;
+    int first;
 
     i = Py_ReprEnter((PyObject *)mp);
     if (i != 0) {
@@ -1417,71 +1412,73 @@
     }
 
     if (mp->ma_used == 0) {
-        result = PyUnicode_FromString("{}");
-        goto Done;
+        Py_ReprLeave((PyObject *)mp);
+        return PyUnicode_FromString("{}");
     }
 
-    pieces = PyList_New(0);
-    if (pieces == NULL)
-        goto Done;
+    _PyUnicodeWriter_Init(&writer);
+    writer.overallocate = 1;
+    /* "{" + "1: 2" + ", 3: 4" * (len - 1) + "}" */
+    writer.min_length = 1 + 4 + (2 + 4) * (mp->ma_used - 1) + 1;
 
-    colon = PyUnicode_FromString(": ");
-    if (colon == NULL)
-        goto Done;
+    if (_PyUnicodeWriter_WriteChar(&writer, '{') < 0)
+        goto error;
 
     /* Do repr() on each key+value pair, and insert ": " between them.
        Note that repr may mutate the dict. */
     i = 0;
+    first = 1;
     while (PyDict_Next((PyObject *)mp, &i, &key, &value)) {
-        int status;
+        PyObject *s;
+        int res;
+
         /* Prevent repr from deleting key or value during key format. */
         Py_INCREF(key);
         Py_INCREF(value);
+
+        if (!first) {
+            if (_PyUnicodeWriter_WriteASCIIString(&writer, ", ", 2) < 0)
+                goto error;
+        }
+        first = 0;
+
         s = PyObject_Repr(key);
-        PyUnicode_Append(&s, colon);
-        PyUnicode_AppendAndDel(&s, PyObject_Repr(value));
-        Py_DECREF(key);
-        Py_DECREF(value);
         if (s == NULL)
-            goto Done;
-        status = PyList_Append(pieces, s);
-        Py_DECREF(s);  /* append created a new ref */
-        if (status < 0)
-            goto Done;
+            goto error;
+        res = _PyUnicodeWriter_WriteStr(&writer, s);
+        Py_DECREF(s);
+        if (res < 0)
+            goto error;
+
+        if (_PyUnicodeWriter_WriteASCIIString(&writer, ": ", 2) < 0)
+            goto error;
+
+        s = PyObject_Repr(value);
+        if (s == NULL)
+            goto error;
+        res = _PyUnicodeWriter_WriteStr(&writer, s);
+        Py_DECREF(s);
+        if (res < 0)
+            goto error;
+
+        Py_CLEAR(key);
+        Py_CLEAR(value);
     }
 
-    /* Add "{}" decorations to the first and last items. */
-    assert(PyList_GET_SIZE(pieces) > 0);
-    s = PyUnicode_FromString("{");
-    if (s == NULL)
-        goto Done;
-    temp = PyList_GET_ITEM(pieces, 0);
-    PyUnicode_AppendAndDel(&s, temp);
-    PyList_SET_ITEM(pieces, 0, s);
-    if (s == NULL)
-        goto Done;
+    writer.overallocate = 0;
+    if (_PyUnicodeWriter_WriteChar(&writer, '}') < 0)
+        goto error;
 
-    s = PyUnicode_FromString("}");
-    if (s == NULL)
-        goto Done;
-    temp = PyList_GET_ITEM(pieces, PyList_GET_SIZE(pieces) - 1);
-    PyUnicode_AppendAndDel(&temp, s);
-    PyList_SET_ITEM(pieces, PyList_GET_SIZE(pieces) - 1, temp);
-    if (temp == NULL)
-        goto Done;
-
-    /* Paste them all together with ", " between. */
-    s = PyUnicode_FromString(", ");
-    if (s == NULL)
-        goto Done;
-    result = PyUnicode_Join(s, pieces);
-    Py_DECREF(s);
-
-Done:
-    Py_XDECREF(pieces);
-    Py_XDECREF(colon);
     Py_ReprLeave((PyObject *)mp);
-    return result;
+
+    return _PyUnicodeWriter_Finish(&writer);
+
+error:
+    Py_ReprLeave((PyObject *)mp);
+    _PyUnicodeWriter_Dealloc(&writer);
+    Py_XDECREF(key);
+    Py_XDECREF(value);
+    return NULL;
 }
 
 static Py_ssize_t
@@ -1491,7 +1488,7 @@
 }
 
 static PyObject *
-dict_subscript(PyDictObject *mp, register PyObject *key)
+dict_subscript(PyDictObject *mp, PyObject *key)
 {
     PyObject *v;
     Py_hash_t hash;
@@ -1523,7 +1520,7 @@
             else if (PyErr_Occurred())
                 return NULL;
         }
-        set_key_error(key);
+        _PyErr_SetKeyError(key);
         return NULL;
     }
     else
@@ -1547,10 +1544,10 @@
 };
 
 static PyObject *
-dict_keys(register PyDictObject *mp)
+dict_keys(PyDictObject *mp)
 {
-    register PyObject *v;
-    register Py_ssize_t i, j;
+    PyObject *v;
+    Py_ssize_t i, j;
     PyDictKeyEntry *ep;
     Py_ssize_t size, n, offset;
     PyObject **value_ptr;
@@ -1591,10 +1588,10 @@
 }
 
 static PyObject *
-dict_values(register PyDictObject *mp)
+dict_values(PyDictObject *mp)
 {
-    register PyObject *v;
-    register Py_ssize_t i, j;
+    PyObject *v;
+    Py_ssize_t i, j;
     Py_ssize_t size, n, offset;
     PyObject **value_ptr;
 
@@ -1633,10 +1630,10 @@
 }
 
 static PyObject *
-dict_items(register PyDictObject *mp)
+dict_items(PyDictObject *mp)
 {
-    register PyObject *v;
-    register Py_ssize_t i, j, n;
+    PyObject *v;
+    Py_ssize_t i, j, n;
     Py_ssize_t size, offset;
     PyObject *item, *key;
     PyDictKeyEntry *ep;
@@ -1694,37 +1691,72 @@
     return v;
 }
 
+/*[clinic input]
+@classmethod
+dict.fromkeys
+    iterable: object
+    value: object=None
+    /
+
+Returns a new dict with keys from iterable and values equal to value.
+[clinic start generated code]*/
+
+PyDoc_STRVAR(dict_fromkeys__doc__,
+"fromkeys($type, iterable, value=None, /)\n"
+"--\n"
+"\n"
+"Returns a new dict with keys from iterable and values equal to value.");
+
+#define DICT_FROMKEYS_METHODDEF    \
+    {"fromkeys", (PyCFunction)dict_fromkeys, METH_VARARGS|METH_CLASS, dict_fromkeys__doc__},
+
 static PyObject *
-dict_fromkeys(PyObject *cls, PyObject *args)
+dict_fromkeys_impl(PyTypeObject *type, PyObject *iterable, PyObject *value);
+
+static PyObject *
+dict_fromkeys(PyTypeObject *type, PyObject *args)
 {
-    PyObject *seq;
+    PyObject *return_value = NULL;
+    PyObject *iterable;
     PyObject *value = Py_None;
+
+    if (!PyArg_UnpackTuple(args, "fromkeys",
+        1, 2,
+        &iterable, &value))
+        goto exit;
+    return_value = dict_fromkeys_impl(type, iterable, value);
+
+exit:
+    return return_value;
+}
+
+static PyObject *
+dict_fromkeys_impl(PyTypeObject *type, PyObject *iterable, PyObject *value)
+/*[clinic end generated code: output=55f8dc0ffa87406f input=b85a667f9bf4669d]*/
+{
     PyObject *it;       /* iter(seq) */
     PyObject *key;
     PyObject *d;
     int status;
 
-    if (!PyArg_UnpackTuple(args, "fromkeys", 1, 2, &seq, &value))
-        return NULL;
-
-    d = PyObject_CallObject(cls, NULL);
+    d = PyObject_CallObject((PyObject *)type, NULL);
     if (d == NULL)
         return NULL;
 
     if (PyDict_CheckExact(d) && ((PyDictObject *)d)->ma_used == 0) {
-        if (PyDict_CheckExact(seq)) {
+        if (PyDict_CheckExact(iterable)) {
             PyDictObject *mp = (PyDictObject *)d;
             PyObject *oldvalue;
             Py_ssize_t pos = 0;
             PyObject *key;
             Py_hash_t hash;
 
-            if (dictresize(mp, Py_SIZE(seq))) {
+            if (dictresize(mp, Py_SIZE(iterable))) {
                 Py_DECREF(d);
                 return NULL;
             }
 
-            while (_PyDict_Next(seq, &pos, &key, &oldvalue, &hash)) {
+            while (_PyDict_Next(iterable, &pos, &key, &oldvalue, &hash)) {
                 if (insertdict(mp, key, hash, value)) {
                     Py_DECREF(d);
                     return NULL;
@@ -1732,18 +1764,18 @@
             }
             return d;
         }
-        if (PyAnySet_CheckExact(seq)) {
+        if (PyAnySet_CheckExact(iterable)) {
             PyDictObject *mp = (PyDictObject *)d;
             Py_ssize_t pos = 0;
             PyObject *key;
             Py_hash_t hash;
 
-            if (dictresize(mp, PySet_GET_SIZE(seq))) {
+            if (dictresize(mp, PySet_GET_SIZE(iterable))) {
                 Py_DECREF(d);
                 return NULL;
             }
 
-            while (_PySet_NextEntry(seq, &pos, &key, &hash)) {
+            while (_PySet_NextEntry(iterable, &pos, &key, &hash)) {
                 if (insertdict(mp, key, hash, value)) {
                     Py_DECREF(d);
                     return NULL;
@@ -1753,7 +1785,7 @@
         }
     }
 
-    it = PyObject_GetIter(seq);
+    it = PyObject_GetIter(iterable);
     if (it == NULL){
         Py_DECREF(d);
         return NULL;
@@ -1908,8 +1940,8 @@
 int
 PyDict_Merge(PyObject *a, PyObject *b, int override)
 {
-    register PyDictObject *mp, *other;
-    register Py_ssize_t i, n;
+    PyDictObject *mp, *other;
+    Py_ssize_t i, n;
     PyDictKeyEntry *entry;
 
     /* We accept for the argument either a concrete dictionary object,
@@ -2006,7 +2038,7 @@
 }
 
 static PyObject *
-dict_copy(register PyDictObject *mp)
+dict_copy(PyDictObject *mp)
 {
     return PyDict_Copy((PyObject*)mp);
 }
@@ -2118,13 +2150,18 @@
         if (aval != NULL) {
             int cmp;
             PyObject *bval;
+            PyObject **vaddr;
             PyObject *key = ep->me_key;
             /* temporarily bump aval's refcount to ensure it stays
                alive until we're done with it */
             Py_INCREF(aval);
             /* ditto for key */
             Py_INCREF(key);
-            bval = PyDict_GetItemWithError((PyObject *)b, key);
+            /* reuse the known hash value */
+            if ((b->ma_keys->dk_lookup)(b, key, ep->me_hash, &vaddr) == NULL)
+                bval = NULL;
+            else
+                bval = *vaddr;
             Py_DECREF(key);
             if (bval == NULL) {
                 Py_DECREF(aval);
@@ -2162,9 +2199,31 @@
     return res;
 }
 
+/*[clinic input]
+
+@coexist
+dict.__contains__
+
+  key: object
+  /
+
+True if D has a key k, else False.
+[clinic start generated code]*/
+
+PyDoc_STRVAR(dict___contains____doc__,
+"__contains__($self, key, /)\n"
+"--\n"
+"\n"
+"True if D has a key k, else False.");
+
+#define DICT___CONTAINS___METHODDEF    \
+    {"__contains__", (PyCFunction)dict___contains__, METH_O|METH_COEXIST, dict___contains____doc__},
+
 static PyObject *
-dict_contains(register PyDictObject *mp, PyObject *key)
+dict___contains__(PyDictObject *self, PyObject *key)
+/*[clinic end generated code: output=3cf3f8aaf2cc5cc3 input=b852b2a19b51ab24]*/
 {
+    register PyDictObject *mp = self;
     Py_hash_t hash;
     PyDictKeyEntry *ep;
     PyObject **value_addr;
@@ -2182,7 +2241,7 @@
 }
 
 static PyObject *
-dict_get(register PyDictObject *mp, PyObject *args)
+dict_get(PyDictObject *mp, PyObject *args)
 {
     PyObject *key;
     PyObject *failobj = Py_None;
@@ -2210,19 +2269,19 @@
     return val;
 }
 
-static PyObject *
-dict_setdefault(register PyDictObject *mp, PyObject *args)
+PyObject *
+PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *defaultobj)
 {
-    PyObject *key;
-    PyObject *failobj = Py_None;
+    PyDictObject *mp = (PyDictObject *)d;
     PyObject *val = NULL;
     Py_hash_t hash;
     PyDictKeyEntry *ep;
     PyObject **value_addr;
 
-    if (!PyArg_UnpackTuple(args, "setdefault", 1, 2, &key, &failobj))
+    if (!PyDict_Check(d)) {
+        PyErr_BadInternalCall();
         return NULL;
-
+    }
     if (!PyUnicode_CheckExact(key) ||
         (hash = ((PyASCIIObject *) key)->hash) == -1) {
         hash = PyObject_Hash(key);
@@ -2240,23 +2299,35 @@
                 return NULL;
             ep = find_empty_slot(mp, key, hash, &value_addr);
         }
-        Py_INCREF(failobj);
+        Py_INCREF(defaultobj);
         Py_INCREF(key);
-        MAINTAIN_TRACKING(mp, key, failobj);
+        MAINTAIN_TRACKING(mp, key, defaultobj);
         ep->me_key = key;
         ep->me_hash = hash;
-        *value_addr = failobj;
-        val = failobj;
+        *value_addr = defaultobj;
+        val = defaultobj;
         mp->ma_keys->dk_usable--;
         mp->ma_used++;
     }
-    Py_INCREF(val);
     return val;
 }
 
+static PyObject *
+dict_setdefault(PyDictObject *mp, PyObject *args)
+{
+    PyObject *key, *val;
+    PyObject *defaultobj = Py_None;
+
+    if (!PyArg_UnpackTuple(args, "setdefault", 1, 2, &key, &defaultobj))
+        return NULL;
+
+    val = PyDict_SetDefault((PyObject *)mp, key, defaultobj);
+    Py_XINCREF(val);
+    return val;
+}
 
 static PyObject *
-dict_clear(register PyDictObject *mp)
+dict_clear(PyDictObject *mp)
 {
     PyDict_Clear((PyObject *)mp);
     Py_RETURN_NONE;
@@ -2278,7 +2349,7 @@
             Py_INCREF(deflt);
             return deflt;
         }
-        set_key_error(key);
+        _PyErr_SetKeyError(key);
         return NULL;
     }
     if (!PyUnicode_CheckExact(key) ||
@@ -2296,7 +2367,7 @@
             Py_INCREF(deflt);
             return deflt;
         }
-        set_key_error(key);
+        _PyErr_SetKeyError(key);
         return NULL;
     }
     *value_addr = NULL;
@@ -2437,9 +2508,6 @@
     return sizeof(PyDictKeysObject) + (DK_SIZE(keys)-1) * sizeof(PyDictKeyEntry);
 }
 
-PyDoc_STRVAR(contains__doc__,
-"D.__contains__(k) -> True if D has a key k, else False");
-
 PyDoc_STRVAR(getitem__doc__, "x.__getitem__(y) <==> x[y]");
 
 PyDoc_STRVAR(sizeof__doc__,
@@ -2460,14 +2528,10 @@
 2-tuple; but raise KeyError if D is empty.");
 
 PyDoc_STRVAR(update__doc__,
-"D.update([E, ]**F) -> None.  Update D from dict/iterable E and F.\n"
-"If E present and has a .keys() method, does:     for k in E: D[k] = E[k]\n\
-If E present and lacks .keys() method, does:     for (k, v) in E: D[k] = v\n\
-In either case, this is followed by: for k in F: D[k] = F[k]");
-
-PyDoc_STRVAR(fromkeys__doc__,
-"dict.fromkeys(S[,v]) -> New dict with keys from S and values equal to v.\n\
-v defaults to None.");
+"D.update([E, ]**F) -> None.  Update D from dict/iterable E and F.\n\
+If E is present and has a .keys() method, then does:  for k in E: D[k] = E[k]\n\
+If E is present and lacks a .keys() method, then does:  for k, v in E: D[k] = v\n\
+In either case, this is followed by: for k in F:  D[k] = F[k]");
 
 PyDoc_STRVAR(clear__doc__,
 "D.clear() -> None.  Remove all items from D.");
@@ -2488,8 +2552,7 @@
              "D.values() -> an object providing a view on D's values");
 
 static PyMethodDef mapp_methods[] = {
-    {"__contains__",(PyCFunction)dict_contains,     METH_O | METH_COEXIST,
-     contains__doc__},
+    DICT___CONTAINS___METHODDEF
     {"__getitem__", (PyCFunction)dict_subscript,        METH_O | METH_COEXIST,
      getitem__doc__},
     {"__sizeof__",      (PyCFunction)dict_sizeof,       METH_NOARGS,
@@ -2510,8 +2573,7 @@
     values__doc__},
     {"update",          (PyCFunction)dict_update,       METH_VARARGS | METH_KEYWORDS,
      update__doc__},
-    {"fromkeys",        (PyCFunction)dict_fromkeys,     METH_VARARGS | METH_CLASS,
-     fromkeys__doc__},
+    DICT_FROMKEYS_METHODDEF
     {"clear",           (PyCFunction)dict_clear,        METH_NOARGS,
      clear__doc__},
     {"copy",            (PyCFunction)dict_copy,         METH_NOARGS,
@@ -2568,22 +2630,23 @@
 dict_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
 {
     PyObject *self;
+    PyDictObject *d;
 
     assert(type != NULL && type->tp_alloc != NULL);
     self = type->tp_alloc(type, 0);
-    if (self != NULL) {
-        PyDictObject *d = (PyDictObject *)self;
-        d->ma_keys = new_keys_object(PyDict_MINSIZE_COMBINED);
-        /* XXX - Should we raise a no-memory error? */
-        if (d->ma_keys == NULL) {
-            DK_INCREF(Py_EMPTY_KEYS);
-            d->ma_keys = Py_EMPTY_KEYS;
-            d->ma_values = empty_values;
-        }
-        d->ma_used = 0;
-        /* The object has been implicitly tracked by tp_alloc */
-        if (type == &PyDict_Type)
-            _PyObject_GC_UNTRACK(d);
+    if (self == NULL)
+        return NULL;
+    d = (PyDictObject *)self;
+
+    /* The object has been implicitly tracked by tp_alloc */
+    if (type == &PyDict_Type)
+        _PyObject_GC_UNTRACK(d);
+
+    d->ma_used = 0;
+    d->ma_keys = new_keys_object(PyDict_MINSIZE_COMBINED);
+    if (d->ma_keys == NULL) {
+        Py_DECREF(self);
+        return NULL;
     }
     return self;
 }
@@ -2659,8 +2722,10 @@
 {
     PyObject *kv;
     kv = _PyUnicode_FromId(key); /* borrowed */
-    if (kv == NULL)
+    if (kv == NULL) {
+        PyErr_Clear();
         return NULL;
+    }
     return PyDict_GetItem(dp, kv);
 }
 
@@ -2671,8 +2736,10 @@
 {
     PyObject *kv, *rv;
     kv = PyUnicode_FromString(key);
-    if (kv == NULL)
+    if (kv == NULL) {
+        PyErr_Clear();
         return NULL;
+    }
     rv = PyDict_GetItem(v, kv);
     Py_DECREF(kv);
     return rv;
@@ -2703,6 +2770,15 @@
 }
 
 int
+_PyDict_DelItemId(PyObject *v, _Py_Identifier *key)
+{
+    PyObject *kv = _PyUnicode_FromId(key); /* borrowed */
+    if (kv == NULL)
+        return -1;
+    return PyDict_DelItem(v, kv);
+}
+
+int
 PyDict_DelItemString(PyObject *v, const char *key)
 {
     PyObject *kv;
@@ -2795,8 +2871,8 @@
 static PyObject *dictiter_iternextkey(dictiterobject *di)
 {
     PyObject *key;
-    register Py_ssize_t i, mask, offset;
-    register PyDictKeysObject *k;
+    Py_ssize_t i, mask, offset;
+    PyDictKeysObject *k;
     PyDictObject *d = di->di_dict;
     PyObject **value_ptr;
 
@@ -2878,7 +2954,7 @@
 static PyObject *dictiter_iternextvalue(dictiterobject *di)
 {
     PyObject *value;
-    register Py_ssize_t i, mask, offset;
+    Py_ssize_t i, mask, offset;
     PyDictObject *d = di->di_dict;
     PyObject **value_ptr;
 
@@ -2959,7 +3035,7 @@
 static PyObject *dictiter_iternextitem(dictiterobject *di)
 {
     PyObject *key, *value, *result = di->di_result;
-    register Py_ssize_t i, mask, offset;
+    Py_ssize_t i, mask, offset;
     PyDictObject *d = di->di_dict;
     PyObject **value_ptr;
 
diff --git a/Objects/exceptions.c b/Objects/exceptions.c
index 6b04700..c76eca8 100644
--- a/Objects/exceptions.c
+++ b/Objects/exceptions.c
@@ -16,9 +16,6 @@
 #ifdef MS_WINDOWS
 PyObject *PyExc_WindowsError = NULL;
 #endif
-#ifdef __VMS
-PyObject *PyExc_VMSError = NULL;
-#endif
 
 /* The dict map from errno codes to OSError subclasses */
 static PyObject *errnomap = NULL;
@@ -121,11 +118,11 @@
 static PyObject *
 BaseException_repr(PyBaseExceptionObject *self)
 {
-    char *name;
-    char *dot;
+    const char *name;
+    const char *dot;
 
-    name = (char *)Py_TYPE(self)->tp_name;
-    dot = strrchr(name, '.');
+    name = Py_TYPE(self)->tp_name;
+    dot = (const char *) strrchr(name, '.');
     if (dot != NULL) name = dot+1;
 
     return PyUnicode_FromFormat("%s%R", name, self->args);
@@ -727,13 +724,17 @@
  * we hack args so that it only contains two items.  This also
  * means we need our own __str__() which prints out the filename
  * when it was supplied.
+ *
+ * (If a function has two filenames, such as rename(), symlink(),
+ * or copy(), PyErr_SetFromErrnoWithFilenameObjects() is called,
+ * which allows passing in a second filename.)
  */
 
 /* This function doesn't cleanup on error, the caller should */
 static int
 oserror_parse_args(PyObject **p_args,
                    PyObject **myerrno, PyObject **strerror,
-                   PyObject **filename
+                   PyObject **filename, PyObject **filename2
 #ifdef MS_WINDOWS
                    , PyObject **winerror
 #endif
@@ -741,14 +742,23 @@
 {
     Py_ssize_t nargs;
     PyObject *args = *p_args;
+#ifndef MS_WINDOWS
+    /*
+     * ignored on non-Windows platforms,
+     * but parsed so OSError has a consistent signature
+     */
+    PyObject *_winerror = NULL;
+    PyObject **winerror = &_winerror;
+#endif /* MS_WINDOWS */
 
     nargs = PyTuple_GET_SIZE(args);
 
-#ifdef MS_WINDOWS
-    if (nargs >= 2 && nargs <= 4) {
-        if (!PyArg_UnpackTuple(args, "OSError", 2, 4,
-                               myerrno, strerror, filename, winerror))
+    if (nargs >= 2 && nargs <= 5) {
+        if (!PyArg_UnpackTuple(args, "OSError", 2, 5,
+                               myerrno, strerror,
+                               filename, winerror, filename2))
             return -1;
+#ifdef MS_WINDOWS
         if (*winerror && PyLong_Check(*winerror)) {
             long errcode, winerrcode;
             PyObject *newargs;
@@ -780,14 +790,8 @@
             Py_DECREF(args);
             args = *p_args = newargs;
         }
+#endif /* MS_WINDOWS */
     }
-#else
-    if (nargs >= 2 && nargs <= 3) {
-        if (!PyArg_UnpackTuple(args, "OSError", 2, 3,
-                               myerrno, strerror, filename))
-            return -1;
-    }
-#endif
 
     return 0;
 }
@@ -795,7 +799,7 @@
 static int
 oserror_init(PyOSErrorObject *self, PyObject **p_args,
              PyObject *myerrno, PyObject *strerror,
-             PyObject *filename
+             PyObject *filename, PyObject *filename2
 #ifdef MS_WINDOWS
              , PyObject *winerror
 #endif
@@ -819,9 +823,14 @@
             Py_INCREF(filename);
             self->filename = filename;
 
-            if (nargs >= 2 && nargs <= 3) {
-                /* filename is removed from the args tuple (for compatibility
-                   purposes, see test_exceptions.py) */
+            if (filename2 && filename2 != Py_None) {
+                Py_INCREF(filename2);
+                self->filename2 = filename2;
+            }
+
+            if (nargs >= 2 && nargs <= 5) {
+                /* filename, filename2, and winerror are removed from the args tuple
+                   (for compatibility purposes, see test_exceptions.py) */
                 PyObject *subslice = PyTuple_GetSlice(args, 0, 2);
                 if (!subslice)
                     return -1;
@@ -845,7 +854,7 @@
     /* Steals the reference to args */
     Py_CLEAR(self->args);
     self->args = args;
-    args = NULL;
+    *p_args = args = NULL;
 
     return 0;
 }
@@ -880,17 +889,20 @@
 OSError_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
 {
     PyOSErrorObject *self = NULL;
-    PyObject *myerrno = NULL, *strerror = NULL, *filename = NULL;
+    PyObject *myerrno = NULL, *strerror = NULL;
+    PyObject *filename = NULL, *filename2 = NULL;
 #ifdef MS_WINDOWS
     PyObject *winerror = NULL;
 #endif
 
+    Py_INCREF(args);
+
     if (!oserror_use_init(type)) {
         if (!_PyArg_NoKeywords(type->tp_name, kwds))
-            return NULL;
+            goto error;
 
-        Py_INCREF(args);
-        if (oserror_parse_args(&args, &myerrno, &strerror, &filename
+        if (oserror_parse_args(&args, &myerrno, &strerror,
+                               &filename, &filename2
 #ifdef MS_WINDOWS
                                , &winerror
 #endif
@@ -919,7 +931,7 @@
     self->written = -1;
 
     if (!oserror_use_init(type)) {
-        if (oserror_init(self, &args, myerrno, strerror, filename
+        if (oserror_init(self, &args, myerrno, strerror, filename, filename2
 #ifdef MS_WINDOWS
                          , winerror
 #endif
@@ -932,6 +944,7 @@
             goto error;
     }
 
+    Py_XDECREF(args);
     return (PyObject *) self;
 
 error:
@@ -943,7 +956,8 @@
 static int
 OSError_init(PyOSErrorObject *self, PyObject *args, PyObject *kwds)
 {
-    PyObject *myerrno = NULL, *strerror = NULL, *filename = NULL;
+    PyObject *myerrno = NULL, *strerror = NULL;
+    PyObject *filename = NULL, *filename2 = NULL;
 #ifdef MS_WINDOWS
     PyObject *winerror = NULL;
 #endif
@@ -956,14 +970,14 @@
         return -1;
 
     Py_INCREF(args);
-    if (oserror_parse_args(&args, &myerrno, &strerror, &filename
+    if (oserror_parse_args(&args, &myerrno, &strerror, &filename, &filename2
 #ifdef MS_WINDOWS
                            , &winerror
 #endif
         ))
         goto error;
 
-    if (oserror_init(self, &args, myerrno, strerror, filename
+    if (oserror_init(self, &args, myerrno, strerror, filename, filename2
 #ifdef MS_WINDOWS
                      , winerror
 #endif
@@ -983,6 +997,7 @@
     Py_CLEAR(self->myerrno);
     Py_CLEAR(self->strerror);
     Py_CLEAR(self->filename);
+    Py_CLEAR(self->filename2);
 #ifdef MS_WINDOWS
     Py_CLEAR(self->winerror);
 #endif
@@ -1004,6 +1019,7 @@
     Py_VISIT(self->myerrno);
     Py_VISIT(self->strerror);
     Py_VISIT(self->filename);
+    Py_VISIT(self->filename2);
 #ifdef MS_WINDOWS
     Py_VISIT(self->winerror);
 #endif
@@ -1013,23 +1029,42 @@
 static PyObject *
 OSError_str(PyOSErrorObject *self)
 {
+#define OR_NONE(x) ((x)?(x):Py_None)
 #ifdef MS_WINDOWS
     /* If available, winerror has the priority over myerrno */
-    if (self->winerror && self->filename)
-        return PyUnicode_FromFormat("[WinError %S] %S: %R",
-                                    self->winerror ? self->winerror: Py_None,
-                                    self->strerror ? self->strerror: Py_None,
-                                    self->filename);
+    if (self->winerror && self->filename) {
+        if (self->filename2) {
+            return PyUnicode_FromFormat("[WinError %S] %S: %R -> %R",
+                                        OR_NONE(self->winerror),
+                                        OR_NONE(self->strerror),
+                                        self->filename,
+                                        self->filename2);
+        } else {
+            return PyUnicode_FromFormat("[WinError %S] %S: %R",
+                                        OR_NONE(self->winerror),
+                                        OR_NONE(self->strerror),
+                                        self->filename);
+        }
+    }
     if (self->winerror && self->strerror)
         return PyUnicode_FromFormat("[WinError %S] %S",
                                     self->winerror ? self->winerror: Py_None,
                                     self->strerror ? self->strerror: Py_None);
 #endif
-    if (self->filename)
-        return PyUnicode_FromFormat("[Errno %S] %S: %R",
-                                    self->myerrno ? self->myerrno: Py_None,
-                                    self->strerror ? self->strerror: Py_None,
-                                    self->filename);
+    if (self->filename) {
+        if (self->filename2) {
+            return PyUnicode_FromFormat("[Errno %S] %S: %R -> %R",
+                                        OR_NONE(self->myerrno),
+                                        OR_NONE(self->strerror),
+                                        self->filename,
+                                        self->filename2);
+        } else {
+            return PyUnicode_FromFormat("[Errno %S] %S: %R",
+                                        OR_NONE(self->myerrno),
+                                        OR_NONE(self->strerror),
+                                        self->filename);
+        }
+    }
     if (self->myerrno && self->strerror)
         return PyUnicode_FromFormat("[Errno %S] %S",
                                     self->myerrno ? self->myerrno: Py_None,
@@ -1046,7 +1081,8 @@
     /* self->args is only the first two real arguments if there was a
      * file name given to OSError. */
     if (PyTuple_GET_SIZE(args) == 2 && self->filename) {
-        args = PyTuple_New(3);
+        Py_ssize_t size = self->filename2 ? 5 : 3;
+        args = PyTuple_New(size);
         if (!args)
             return NULL;
 
@@ -1060,6 +1096,20 @@
 
         Py_INCREF(self->filename);
         PyTuple_SET_ITEM(args, 2, self->filename);
+
+        if (self->filename2) {
+            /*
+             * This tuple is essentially used as OSError(*args).
+             * So, to recreate filename2, we need to pass in
+             * winerror as well.
+             */
+            Py_INCREF(Py_None);
+            PyTuple_SET_ITEM(args, 3, Py_None);
+
+            /* filename2 */
+            Py_INCREF(self->filename2);
+            PyTuple_SET_ITEM(args, 4, self->filename2);
+        }
     } else
         Py_INCREF(args);
 
@@ -1099,6 +1149,8 @@
         PyDoc_STR("exception strerror")},
     {"filename", T_OBJECT, offsetof(PyOSErrorObject, filename), 0,
         PyDoc_STR("exception filename")},
+    {"filename2", T_OBJECT, offsetof(PyOSErrorObject, filename2), 0,
+        PyDoc_STR("second exception filename")},
 #ifdef MS_WINDOWS
     {"winerror", T_OBJECT, offsetof(PyOSErrorObject, winerror), 0,
         PyDoc_STR("Win32 exception code")},
@@ -1202,6 +1254,9 @@
  *    SyntaxError extends Exception
  */
 
+/* Helper function to customise error message for some syntax errors */
+static int _report_missing_parentheses(PySyntaxErrorObject *self);
+
 static int
 SyntaxError_init(PySyntaxErrorObject *self, PyObject *args, PyObject *kwds)
 {
@@ -1246,6 +1301,13 @@
         Py_INCREF(self->text);
 
         Py_DECREF(info);
+
+        /* Issue #21669: Custom error for 'print' & 'exec' as statements */
+        if (self->text && PyUnicode_Check(self->text)) {
+            if (_report_missing_parentheses(self) < 0) {
+                return -1;
+            }
+        }
     }
     return 0;
 }
@@ -1785,6 +1847,10 @@
     PyObject *reason_str = NULL;
     PyObject *encoding_str = NULL;
 
+    if (!uself->object)
+        /* Not properly initialized. */
+        return PyUnicode_FromString("");
+
     /* Get reason and encoding as strings, which they might not be if
        they've been modified after we were contructed. */
     reason_str = PyObject_Str(uself->reason);
@@ -1856,8 +1922,6 @@
 UnicodeDecodeError_init(PyObject *self, PyObject *args, PyObject *kwds)
 {
     PyUnicodeErrorObject *ude;
-    const char *data;
-    Py_ssize_t size;
 
     if (BaseException_init((PyBaseExceptionObject *)self, args, kwds) == -1)
         return -1;
@@ -1878,21 +1942,27 @@
              return -1;
     }
 
-    if (!PyBytes_Check(ude->object)) {
-        if (PyObject_AsReadBuffer(ude->object, (const void **)&data, &size)) {
-            ude->encoding = ude->object = ude->reason = NULL;
-            return -1;
-        }
-        ude->object = PyBytes_FromStringAndSize(data, size);
-    }
-    else {
-        Py_INCREF(ude->object);
-    }
-
     Py_INCREF(ude->encoding);
+    Py_INCREF(ude->object);
     Py_INCREF(ude->reason);
 
+    if (!PyBytes_Check(ude->object)) {
+        Py_buffer view;
+        if (PyObject_GetBuffer(ude->object, &view, PyBUF_SIMPLE) != 0)
+            goto error;
+        Py_CLEAR(ude->object);
+        ude->object = PyBytes_FromStringAndSize(view.buf, view.len);
+        PyBuffer_Release(&view);
+        if (!ude->object)
+            goto error;
+    }
     return 0;
+
+error:
+    Py_CLEAR(ude->encoding);
+    Py_CLEAR(ude->object);
+    Py_CLEAR(ude->reason);
+    return -1;
 }
 
 static PyObject *
@@ -1903,6 +1973,10 @@
     PyObject *reason_str = NULL;
     PyObject *encoding_str = NULL;
 
+    if (!uself->object)
+        /* Not properly initialized. */
+        return PyUnicode_FromString("");
+
     /* Get reason and encoding as strings, which they might not be if
        they've been modified after we were contructed. */
     reason_str = PyObject_Str(uself->reason);
@@ -1997,6 +2071,10 @@
     PyObject *result = NULL;
     PyObject *reason_str = NULL;
 
+    if (!uself->object)
+        /* Not properly initialized. */
+        return PyUnicode_FromString("");
+
     /* Get reason as a string, which it might not be if it's been
        modified after we were contructed. */
     reason_str = PyObject_Str(uself->reason);
@@ -2060,7 +2138,7 @@
     PyObject *object,
     Py_ssize_t start, Py_ssize_t end, const char *reason)
 {
-    return PyObject_CallFunction(PyExc_UnicodeTranslateError, "Ons",
+    return PyObject_CallFunction(PyExc_UnicodeTranslateError, "Onns",
                                  object, start, end, reason);
 }
 
@@ -2327,7 +2405,7 @@
     }
 
 #ifdef MS_WINDOWS
-#include <Winsock2.h>
+#include <winsock2.h>
 /* The following constants were added to errno.h in VS2010 but have
    preferred WSA equivalents. */
 #undef EADDRINUSE
@@ -2471,9 +2549,6 @@
 #ifdef MS_WINDOWS
     INIT_ALIAS(WindowsError, OSError)
 #endif
-#ifdef __VMS
-    INIT_ALIAS(VMSError, OSError)
-#endif
     POST_INIT(EOFError)
     POST_INIT(RuntimeError)
     POST_INIT(NotImplementedError)
@@ -2591,3 +2666,259 @@
     free_preallocated_memerrors();
     Py_CLEAR(errnomap);
 }
+
+/* Helper to do the equivalent of "raise X from Y" in C, but always using
+ * the current exception rather than passing one in.
+ *
+ * We currently limit this to *only* exceptions that use the BaseException
+ * tp_init and tp_new methods, since we can be reasonably sure we can wrap
+ * those correctly without losing data and without losing backwards
+ * compatibility.
+ *
+ * We also aim to rule out *all* exceptions that might be storing additional
+ * state, whether by having a size difference relative to BaseException,
+ * additional arguments passed in during construction or by having a
+ * non-empty instance dict.
+ *
+ * We need to be very careful with what we wrap, since changing types to
+ * a broader exception type would be backwards incompatible for
+ * existing codecs, and with different init or new method implementations
+ * may either not support instantiation with PyErr_Format or lose
+ * information when instantiated that way.
+ *
+ * XXX (ncoghlan): This could be made more comprehensive by exploiting the
+ * fact that exceptions are expected to support pickling. If more builtin
+ * exceptions (e.g. AttributeError) start to be converted to rich
+ * exceptions with additional attributes, that's probably a better approach
+ * to pursue over adding special cases for particular stateful subclasses.
+ *
+ * Returns a borrowed reference to the new exception (if any), NULL if the
+ * existing exception was left in place.
+ */
+PyObject *
+_PyErr_TrySetFromCause(const char *format, ...)
+{
+    PyObject* msg_prefix;
+    PyObject *exc, *val, *tb;
+    PyTypeObject *caught_type;
+    PyObject **dictptr;
+    PyObject *instance_args;
+    Py_ssize_t num_args, caught_type_size, base_exc_size;
+    PyObject *new_exc, *new_val, *new_tb;
+    va_list vargs;
+    int same_basic_size;
+
+    PyErr_Fetch(&exc, &val, &tb);
+    caught_type = (PyTypeObject *)exc;
+    /* Ensure type info indicates no extra state is stored at the C level
+     * and that the type can be reinstantiated using PyErr_Format
+     */
+    caught_type_size = caught_type->tp_basicsize;
+    base_exc_size = _PyExc_BaseException.tp_basicsize;
+    same_basic_size = (
+        caught_type_size == base_exc_size ||
+        (PyType_SUPPORTS_WEAKREFS(caught_type) &&
+            (caught_type_size == base_exc_size + sizeof(PyObject *))
+        )
+    );
+    if (caught_type->tp_init != (initproc)BaseException_init ||
+        caught_type->tp_new != BaseException_new ||
+        !same_basic_size ||
+        caught_type->tp_itemsize != _PyExc_BaseException.tp_itemsize) {
+        /* We can't be sure we can wrap this safely, since it may contain
+         * more state than just the exception type. Accordingly, we just
+         * leave it alone.
+         */
+        PyErr_Restore(exc, val, tb);
+        return NULL;
+    }
+
+    /* Check the args are empty or contain a single string */
+    PyErr_NormalizeException(&exc, &val, &tb);
+    instance_args = ((PyBaseExceptionObject *)val)->args;
+    num_args = PyTuple_GET_SIZE(instance_args);
+    if (num_args > 1 ||
+        (num_args == 1 &&
+         !PyUnicode_CheckExact(PyTuple_GET_ITEM(instance_args, 0)))) {
+        /* More than 1 arg, or the one arg we do have isn't a string
+         */
+        PyErr_Restore(exc, val, tb);
+        return NULL;
+    }
+
+    /* Ensure the instance dict is also empty */
+    dictptr = _PyObject_GetDictPtr(val);
+    if (dictptr != NULL && *dictptr != NULL &&
+        PyObject_Length(*dictptr) > 0) {
+        /* While we could potentially copy a non-empty instance dictionary
+         * to the replacement exception, for now we take the more
+         * conservative path of leaving exceptions with attributes set
+         * alone.
+         */
+        PyErr_Restore(exc, val, tb);
+        return NULL;
+    }
+
+    /* For exceptions that we can wrap safely, we chain the original
+     * exception to a new one of the exact same type with an
+     * error message that mentions the additional details and the
+     * original exception.
+     *
+     * It would be nice to wrap OSError and various other exception
+     * types as well, but that's quite a bit trickier due to the extra
+     * state potentially stored on OSError instances.
+     */
+    /* Ensure the traceback is set correctly on the existing exception */
+    if (tb != NULL) {
+        PyException_SetTraceback(val, tb);
+        Py_DECREF(tb);
+    }
+
+#ifdef HAVE_STDARG_PROTOTYPES
+    va_start(vargs, format);
+#else
+    va_start(vargs);
+#endif
+    msg_prefix = PyUnicode_FromFormatV(format, vargs);
+    va_end(vargs);
+    if (msg_prefix == NULL) {
+        Py_DECREF(exc);
+        Py_DECREF(val);
+        return NULL;
+    }
+
+    PyErr_Format(exc, "%U (%s: %S)",
+                 msg_prefix, Py_TYPE(val)->tp_name, val);
+    Py_DECREF(exc);
+    Py_DECREF(msg_prefix);
+    PyErr_Fetch(&new_exc, &new_val, &new_tb);
+    PyErr_NormalizeException(&new_exc, &new_val, &new_tb);
+    PyException_SetCause(new_val, val);
+    PyErr_Restore(new_exc, new_val, new_tb);
+    return new_val;
+}
+
+
+/* To help with migration from Python 2, SyntaxError.__init__ applies some
+ * heuristics to try to report a more meaningful exception when print and
+ * exec are used like statements.
+ *
+ * The heuristics are currently expected to detect the following cases:
+ *   - top level statement
+ *   - statement in a nested suite
+ *   - trailing section of a one line complex statement
+ *
+ * They're currently known not to trigger:
+ *   - after a semi-colon
+ *
+ * The error message can be a bit odd in cases where the "arguments" are
+ * completely illegal syntactically, but that isn't worth the hassle of
+ * fixing.
+ *
+ * We also can't do anything about cases that are legal Python 3 syntax
+ * but mean something entirely different from what they did in Python 2
+ * (omitting the arguments entirely, printing items preceded by a unary plus
+ * or minus, using the stream redirection syntax).
+ */
+
+static int
+_check_for_legacy_statements(PySyntaxErrorObject *self, Py_ssize_t start)
+{
+    /* Return values:
+     *   -1: an error occurred
+     *    0: nothing happened
+     *    1: the check triggered & the error message was changed
+     */
+    static PyObject *print_prefix = NULL;
+    static PyObject *exec_prefix = NULL;
+    Py_ssize_t text_len = PyUnicode_GET_LENGTH(self->text);
+    int kind = PyUnicode_KIND(self->text);
+    void *data = PyUnicode_DATA(self->text);
+
+    /* Ignore leading whitespace */
+    while (start < text_len) {
+        Py_UCS4 ch = PyUnicode_READ(kind, data, start);
+        if (!Py_UNICODE_ISSPACE(ch))
+            break;
+        start++;
+    }
+    /* Checking against an empty or whitespace-only part of the string */
+    if (start == text_len) {
+        return 0;
+    }
+
+    /* Check for legacy print statements */
+    if (print_prefix == NULL) {
+        print_prefix = PyUnicode_InternFromString("print ");
+        if (print_prefix == NULL) {
+            return -1;
+        }
+    }
+    if (PyUnicode_Tailmatch(self->text, print_prefix,
+                            start, text_len, -1)) {
+        Py_CLEAR(self->msg);
+        self->msg = PyUnicode_FromString(
+                   "Missing parentheses in call to 'print'");
+        return 1;
+    }
+
+    /* Check for legacy exec statements */
+    if (exec_prefix == NULL) {
+        exec_prefix = PyUnicode_InternFromString("exec ");
+        if (exec_prefix == NULL) {
+            return -1;
+        }
+    }
+    if (PyUnicode_Tailmatch(self->text, exec_prefix,
+                            start, text_len, -1)) {
+        Py_CLEAR(self->msg);
+        self->msg = PyUnicode_FromString(
+                    "Missing parentheses in call to 'exec'");
+        return 1;
+    }
+    /* Fall back to the default error message */
+    return 0;
+}
+
+static int
+_report_missing_parentheses(PySyntaxErrorObject *self)
+{
+    Py_UCS4 left_paren = 40;
+    Py_ssize_t left_paren_index;
+    Py_ssize_t text_len = PyUnicode_GET_LENGTH(self->text);
+    int legacy_check_result = 0;
+
+    /* Skip entirely if there is an opening parenthesis */
+    left_paren_index = PyUnicode_FindChar(self->text, left_paren,
+                                          0, text_len, 1);
+    if (left_paren_index < -1) {
+        return -1;
+    }
+    if (left_paren_index != -1) {
+        /* Use default error message for any line with an opening paren */
+        return 0;
+    }
+    /* Handle the simple statement case */
+    legacy_check_result = _check_for_legacy_statements(self, 0);
+    if (legacy_check_result < 0) {
+        return -1;
+
+    }
+    if (legacy_check_result == 0) {
+        /* Handle the one-line complex statement case */
+        Py_UCS4 colon = 58;
+        Py_ssize_t colon_index;
+        colon_index = PyUnicode_FindChar(self->text, colon,
+                                         0, text_len, 1);
+        if (colon_index < -1) {
+            return -1;
+        }
+        if (colon_index >= 0 && colon_index < text_len) {
+            /* Check again, starting from just after the colon */
+            if (_check_for_legacy_statements(self, colon_index+1) < 0) {
+                return -1;
+            }
+        }
+    }
+    return 0;
+}
diff --git a/Objects/fileobject.c b/Objects/fileobject.c
index 98f42a9..596f909 100644
--- a/Objects/fileobject.c
+++ b/Objects/fileobject.c
@@ -26,8 +26,8 @@
 /* External C interface */
 
 PyObject *
-PyFile_FromFd(int fd, char *name, char *mode, int buffering, char *encoding,
-              char *errors, char *newline, int closefd)
+PyFile_FromFd(int fd, const char *name, const char *mode, int buffering, const char *encoding,
+              const char *errors, const char *newline, int closefd)
 {
     PyObject *io, *stream;
     _Py_IDENTIFIER(open);
@@ -390,7 +390,7 @@
 
     Py_BEGIN_ALLOW_THREADS
     errno = 0;
-#if defined(MS_WIN64) || defined(MS_WINDOWS)
+#ifdef MS_WINDOWS
     if (n > INT_MAX)
         n = INT_MAX;
     n = write(self->fd, c, (int)n);
diff --git a/Objects/floatobject.c b/Objects/floatobject.c
index a08a852..33e30ca 100644
--- a/Objects/floatobject.c
+++ b/Objects/floatobject.c
@@ -9,11 +9,6 @@
 #include <ctype.h>
 #include <float.h>
 
-#undef MAX
-#undef MIN
-#define MAX(x, y) ((x) < (y) ? (y) : (x))
-#define MIN(x, y) ((x) < (y) ? (x) : (y))
-
 
 /* Special free list
    free_list is a singly-linked list of available PyFloatObjects, linked
@@ -114,7 +109,7 @@
 PyObject *
 PyFloat_FromDouble(double fval)
 {
-    register PyFloatObject *op = free_list;
+    PyFloatObject *op = free_list;
     if (op != NULL) {
         free_list = (PyFloatObject *) Py_TYPE(op);
         numfree--;
@@ -124,7 +119,7 @@
             return PyErr_NoMemory();
     }
     /* Inline PyObject_New */
-    PyObject_INIT(op, &PyFloat_Type);
+    (void)PyObject_INIT(op, &PyFloat_Type);
     op->ob_fval = fval;
     return (PyObject *) op;
 }
@@ -136,6 +131,7 @@
     double x;
     PyObject *s_buffer = NULL;
     Py_ssize_t len;
+    Py_buffer view = {NULL, NULL};
     PyObject *result = NULL;
 
     if (PyUnicode_Check(v)) {
@@ -148,9 +144,14 @@
             return NULL;
         }
     }
-    else if (PyObject_AsCharBuffer(v, &s, &len)) {
-        PyErr_SetString(PyExc_TypeError,
-            "float() argument must be a string or a number");
+    else if (PyObject_GetBuffer(v, &view, PyBUF_SIMPLE) == 0) {
+        s = (const char *)view.buf;
+        len = view.len;
+    }
+    else {
+        PyErr_Format(PyExc_TypeError,
+            "float() argument must be a string or a number, not '%.200s'",
+            Py_TYPE(v)->tp_name);
         return NULL;
     }
     last = s + len;
@@ -174,6 +175,7 @@
     else
         result = PyFloat_FromDouble(x);
 
+    PyBuffer_Release(&view);
     Py_XDECREF(s_buffer);
     return result;
 }
@@ -246,7 +248,7 @@
 static int
 convert_to_double(PyObject **v, double *dbl)
 {
-    register PyObject *obj = *v;
+    PyObject *obj = *v;
 
     if (PyLong_Check(obj)) {
         *dbl = PyLong_AsDouble(obj);
@@ -1131,7 +1133,7 @@
     }
 
     m = frexp(fabs(x), &e);
-    shift = 1 - MAX(DBL_MIN_EXP - e, 0);
+    shift = 1 - Py_MAX(DBL_MIN_EXP - e, 0);
     m = ldexp(m, shift);
     e -= shift;
 
@@ -1285,8 +1287,8 @@
     fdigits = coeff_end - s_store;
     if (ndigits == 0)
         goto parse_error;
-    if (ndigits > MIN(DBL_MIN_EXP - DBL_MANT_DIG - LONG_MIN/2,
-                      LONG_MAX/2 + 1 - DBL_MAX_EXP)/4)
+    if (ndigits > Py_MIN(DBL_MIN_EXP - DBL_MANT_DIG - LONG_MIN/2,
+                         LONG_MAX/2 + 1 - DBL_MAX_EXP)/4)
         goto insane_length_error;
 
     /* [p <exponent>] */
@@ -1342,7 +1344,7 @@
 
     /* lsb = exponent of least significant bit of the *rounded* value.
        This is top_exp - DBL_MANT_DIG unless result is subnormal. */
-    lsb = MAX(top_exp, (long)DBL_MIN_EXP) - DBL_MANT_DIG;
+    lsb = Py_MAX(top_exp, (long)DBL_MIN_EXP) - DBL_MANT_DIG;
 
     x = 0.0;
     if (exp >= lsb) {
@@ -1421,7 +1423,7 @@
 >>> float.fromhex('0x1.ffffp10')\n\
 2047.984375\n\
 >>> float.fromhex('-0x1p-1074')\n\
--4.9406564584124654e-324");
+-5e-324");
 
 
 static PyObject *
@@ -1711,7 +1713,7 @@
     if (!PyArg_ParseTuple(args, "U:__format__", &format_spec))
         return NULL;
 
-    _PyUnicodeWriter_Init(&writer, 0);
+    _PyUnicodeWriter_Init(&writer);
     ret = _PyFloat_FormatAdvancedWriter(
         &writer,
         self,
@@ -1858,7 +1860,7 @@
     float_new,                                  /* tp_new */
 };
 
-void
+int
 _PyFloat_Init(void)
 {
     /* We attempt to determine if this machine is using IEEE
@@ -1908,8 +1910,11 @@
     float_format = detected_float_format;
 
     /* Init float info */
-    if (FloatInfoType.tp_name == 0)
-        PyStructSequence_InitType(&FloatInfoType, &floatinfo_desc);
+    if (FloatInfoType.tp_name == NULL) {
+        if (PyStructSequence_InitType2(&FloatInfoType, &floatinfo_desc) < 0)
+            return 0;
+    }
+    return 1;
 }
 
 int
diff --git a/Objects/frameobject.c b/Objects/frameobject.c
index b312130..55ee563 100644
--- a/Objects/frameobject.c
+++ b/Objects/frameobject.c
@@ -7,11 +7,6 @@
 #include "opcode.h"
 #include "structmember.h"
 
-#undef MIN
-#undef MAX
-#define MIN(a, b) ((a) < (b) ? (a) : (b))
-#define MAX(a, b) ((a) > (b) ? (a) : (b))
-
 #define OFF(x) offsetof(PyFrameObject, x)
 
 static PyMemberDef frame_memberlist[] = {
@@ -26,7 +21,8 @@
 static PyObject *
 frame_getlocals(PyFrameObject *f, void *closure)
 {
-    PyFrame_FastToLocals(f);
+    if (PyFrame_FastToLocalsWithError(f) < 0)
+        return NULL;
     Py_INCREF(f->f_locals);
     return f->f_locals;
 }
@@ -160,8 +156,8 @@
 
     /* We're now ready to look at the bytecode. */
     PyBytes_AsStringAndSize(f->f_code->co_code, (char **)&code, &code_len);
-    min_addr = MIN(new_lasti, f->f_lasti);
-    max_addr = MAX(new_lasti, f->f_lasti);
+    min_addr = Py_MIN(new_lasti, f->f_lasti);
+    max_addr = Py_MAX(new_lasti, f->f_lasti);
 
     /* You can't jump onto a line with an 'except' statement on it -
      * they expect to have an exception on the top of the stack, which
@@ -293,7 +289,7 @@
             break;
         }
 
-        min_delta_iblock = MIN(min_delta_iblock, delta_iblock);
+        min_delta_iblock = Py_MIN(min_delta_iblock, delta_iblock);
 
         if (op >= HAVE_ARGUMENT) {
             addr += 2;
@@ -466,7 +462,7 @@
 frame_traverse(PyFrameObject *f, visitproc visit, void *arg)
 {
     PyObject **fastlocals, **p;
-    int i, slots;
+    Py_ssize_t i, slots;
 
     Py_VISIT(f->f_back);
     Py_VISIT(f->f_code);
@@ -493,10 +489,10 @@
 }
 
 static void
-frame_clear(PyFrameObject *f)
+frame_tp_clear(PyFrameObject *f)
 {
     PyObject **fastlocals, **p, **oldtop;
-    int i, slots;
+    Py_ssize_t i, slots;
 
     /* Before anything else, make sure that this frame is clearly marked
      * as being defunct!  Else, e.g., a generator reachable from this
@@ -505,6 +501,7 @@
      */
     oldtop = f->f_stacktop;
     f->f_stacktop = NULL;
+    f->f_executing = 0;
 
     Py_CLEAR(f->f_exc_type);
     Py_CLEAR(f->f_exc_value);
@@ -525,6 +522,25 @@
 }
 
 static PyObject *
+frame_clear(PyFrameObject *f)
+{
+    if (f->f_executing) {
+        PyErr_SetString(PyExc_RuntimeError,
+                        "cannot clear an executing frame");
+        return NULL;
+    }
+    if (f->f_gen) {
+        _PyGen_Finalize(f->f_gen);
+        assert(f->f_gen == NULL);
+    }
+    frame_tp_clear(f);
+    Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(clear__doc__,
+"F.clear(): clear most references held by the frame");
+
+static PyObject *
 frame_sizeof(PyFrameObject *f)
 {
     Py_ssize_t res, extras, ncells, nfrees;
@@ -543,6 +559,8 @@
 "F.__sizeof__() -> size of F in memory, in bytes");
 
 static PyMethodDef frame_methods[] = {
+    {"clear",           (PyCFunction)frame_clear,       METH_NOARGS,
+     clear__doc__},
     {"__sizeof__",      (PyCFunction)frame_sizeof,      METH_NOARGS,
      sizeof__doc__},
     {NULL,              NULL}   /* sentinel */
@@ -571,7 +589,7 @@
     Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */
     0,                                          /* tp_doc */
     (traverseproc)frame_traverse,               /* tp_traverse */
-    (inquiry)frame_clear,                       /* tp_clear */
+    (inquiry)frame_tp_clear,                    /* tp_clear */
     0,                                          /* tp_richcompare */
     0,                                          /* tp_weaklistoffset */
     0,                                          /* tp_iter */
@@ -583,13 +601,13 @@
     0,                                          /* tp_dict */
 };
 
-static PyObject *builtin_object;
+_Py_IDENTIFIER(__builtins__);
 
 int _PyFrame_Init()
 {
-    builtin_object = PyUnicode_InternFromString("__builtins__");
-    if (builtin_object == NULL)
-        return 0;
+    /* Before, PyId___builtins__ was a string created explicitly in
+       this function. Now there is nothing to initialize anymore, but
+       the function is kept for backward compatibility. */
     return 1;
 }
 
@@ -610,7 +628,7 @@
     }
 #endif
     if (back == NULL || back->f_globals != globals) {
-        builtins = PyDict_GetItem(globals, builtin_object);
+        builtins = _PyDict_GetItemId(globals, &PyId___builtins__);
         if (builtins) {
             if (PyModule_Check(builtins)) {
                 builtins = PyModule_GetDict(builtins);
@@ -708,11 +726,12 @@
         Py_INCREF(locals);
         f->f_locals = locals;
     }
-    f->f_tstate = tstate;
 
     f->f_lasti = -1;
     f->f_lineno = code->co_firstlineno;
     f->f_iblock = 0;
+    f->f_executing = 0;
+    f->f_gen = NULL;
 
     _PyObject_GC_TRACK(f);
     return f;
@@ -753,12 +772,9 @@
    If deref is true, then the values being copied are cell variables
    and the value is extracted from the cell variable before being put
    in dict.
-
-   Exceptions raised while modifying the dict are silently ignored,
-   because there is no good way to report them.
  */
 
-static void
+static int
 map_to_dict(PyObject *map, Py_ssize_t nmap, PyObject *dict, PyObject **values,
             int deref)
 {
@@ -770,19 +786,24 @@
         PyObject *key = PyTuple_GET_ITEM(map, j);
         PyObject *value = values[j];
         assert(PyUnicode_Check(key));
-        if (deref) {
+        if (deref && value != NULL) {
             assert(PyCell_Check(value));
             value = PyCell_GET(value);
         }
         if (value == NULL) {
-            if (PyObject_DelItem(dict, key) != 0)
-                PyErr_Clear();
+            if (PyObject_DelItem(dict, key) != 0) {
+                if (PyErr_ExceptionMatches(PyExc_KeyError))
+                    PyErr_Clear();
+                else
+                    return -1;
+            }
         }
         else {
             if (PyObject_SetItem(dict, key, value) != 0)
-                PyErr_Clear();
+                return -1;
         }
     }
+    return 0;
 }
 
 /* Copy values from the "locals" dict into the fast locals.
@@ -839,42 +860,49 @@
     }
 }
 
-void
-PyFrame_FastToLocals(PyFrameObject *f)
+int
+PyFrame_FastToLocalsWithError(PyFrameObject *f)
 {
     /* Merge fast locals into f->f_locals */
     PyObject *locals, *map;
     PyObject **fast;
-    PyObject *error_type, *error_value, *error_traceback;
     PyCodeObject *co;
     Py_ssize_t j;
-    int ncells, nfreevars;
-    if (f == NULL)
-        return;
+    Py_ssize_t ncells, nfreevars;
+
+    if (f == NULL) {
+        PyErr_BadInternalCall();
+        return -1;
+    }
     locals = f->f_locals;
     if (locals == NULL) {
         locals = f->f_locals = PyDict_New();
-        if (locals == NULL) {
-            PyErr_Clear(); /* Can't report it :-( */
-            return;
-        }
+        if (locals == NULL)
+            return -1;
     }
     co = f->f_code;
     map = co->co_varnames;
-    if (!PyTuple_Check(map))
-        return;
-    PyErr_Fetch(&error_type, &error_value, &error_traceback);
+    if (!PyTuple_Check(map)) {
+        PyErr_Format(PyExc_SystemError,
+                     "co_varnames must be a tuple, not %s",
+                     Py_TYPE(map)->tp_name);
+        return -1;
+    }
     fast = f->f_localsplus;
     j = PyTuple_GET_SIZE(map);
     if (j > co->co_nlocals)
         j = co->co_nlocals;
-    if (co->co_nlocals)
-        map_to_dict(map, j, locals, fast, 0);
+    if (co->co_nlocals) {
+        if (map_to_dict(map, j, locals, fast, 0) < 0)
+            return -1;
+    }
     ncells = PyTuple_GET_SIZE(co->co_cellvars);
     nfreevars = PyTuple_GET_SIZE(co->co_freevars);
     if (ncells || nfreevars) {
-        map_to_dict(co->co_cellvars, ncells,
-                    locals, fast + co->co_nlocals, 1);
+        if (map_to_dict(co->co_cellvars, ncells,
+                        locals, fast + co->co_nlocals, 1))
+            return -1;
+
         /* If the namespace is unoptimized, then one of the
            following cases applies:
            1. It does not contain free variables, because it
@@ -884,11 +912,24 @@
            into the locals dict used by the class.
         */
         if (co->co_flags & CO_OPTIMIZED) {
-            map_to_dict(co->co_freevars, nfreevars,
-                        locals, fast + co->co_nlocals + ncells, 1);
+            if (map_to_dict(co->co_freevars, nfreevars,
+                            locals, fast + co->co_nlocals + ncells, 1) < 0)
+                return -1;
         }
     }
-    PyErr_Restore(error_type, error_value, error_traceback);
+    return 0;
+}
+
+void
+PyFrame_FastToLocals(PyFrameObject *f)
+{
+    int res;
+
+    assert(!PyErr_Occurred());
+
+    res = PyFrame_FastToLocalsWithError(f);
+    if (res < 0)
+        PyErr_Clear();
 }
 
 void
@@ -900,7 +941,7 @@
     PyObject *error_type, *error_value, *error_traceback;
     PyCodeObject *co;
     Py_ssize_t j;
-    int ncells, nfreevars;
+    Py_ssize_t ncells, nfreevars;
     if (f == NULL)
         return;
     locals = f->f_locals;
@@ -952,7 +993,6 @@
 PyFrame_Fini(void)
 {
     (void)PyFrame_ClearFreeList();
-    Py_CLEAR(builtin_object);
 }
 
 /* Print summary info about the state of the optimized allocator */
diff --git a/Objects/funcobject.c b/Objects/funcobject.c
index 49415b9..b043934 100644
--- a/Objects/funcobject.c
+++ b/Objects/funcobject.c
@@ -8,60 +8,59 @@
 PyObject *
 PyFunction_NewWithQualName(PyObject *code, PyObject *globals, PyObject *qualname)
 {
-    PyFunctionObject *op = PyObject_GC_New(PyFunctionObject,
-                                        &PyFunction_Type);
-    static PyObject *__name__ = 0;
-    if (op != NULL) {
-        PyObject *doc;
-        PyObject *consts;
-        PyObject *module;
-        op->func_weakreflist = NULL;
-        Py_INCREF(code);
-        op->func_code = code;
-        Py_INCREF(globals);
-        op->func_globals = globals;
-        op->func_name = ((PyCodeObject *)code)->co_name;
-        Py_INCREF(op->func_name);
-        op->func_defaults = NULL; /* No default arguments */
-        op->func_kwdefaults = NULL; /* No keyword only defaults */
-        op->func_closure = NULL;
-        consts = ((PyCodeObject *)code)->co_consts;
-        if (PyTuple_Size(consts) >= 1) {
-            doc = PyTuple_GetItem(consts, 0);
-            if (!PyUnicode_Check(doc))
-                doc = Py_None;
-        }
-        else
-            doc = Py_None;
-        Py_INCREF(doc);
-        op->func_doc = doc;
-        op->func_dict = NULL;
-        op->func_module = NULL;
-        op->func_annotations = NULL;
+    PyFunctionObject *op;
+    PyObject *doc, *consts, *module;
+    static PyObject *__name__ = NULL;
 
-        /* __module__: If module name is in globals, use it.
-           Otherwise, use None.
-        */
-        if (!__name__) {
-            __name__ = PyUnicode_InternFromString("__name__");
-            if (!__name__) {
-                Py_DECREF(op);
-                return NULL;
-            }
-        }
-        module = PyDict_GetItem(globals, __name__);
-        if (module) {
-            Py_INCREF(module);
-            op->func_module = module;
-        }
-        if (qualname)
-            op->func_qualname = qualname;
-        else
-            op->func_qualname = op->func_name;
-        Py_INCREF(op->func_qualname);
+    if (__name__ == NULL) {
+        __name__ = PyUnicode_InternFromString("__name__");
+        if (__name__ == NULL)
+            return NULL;
+    }
+
+    op = PyObject_GC_New(PyFunctionObject, &PyFunction_Type);
+    if (op == NULL)
+        return NULL;
+
+    op->func_weakreflist = NULL;
+    Py_INCREF(code);
+    op->func_code = code;
+    Py_INCREF(globals);
+    op->func_globals = globals;
+    op->func_name = ((PyCodeObject *)code)->co_name;
+    Py_INCREF(op->func_name);
+    op->func_defaults = NULL; /* No default arguments */
+    op->func_kwdefaults = NULL; /* No keyword only defaults */
+    op->func_closure = NULL;
+
+    consts = ((PyCodeObject *)code)->co_consts;
+    if (PyTuple_Size(consts) >= 1) {
+        doc = PyTuple_GetItem(consts, 0);
+        if (!PyUnicode_Check(doc))
+            doc = Py_None;
     }
     else
-        return NULL;
+        doc = Py_None;
+    Py_INCREF(doc);
+    op->func_doc = doc;
+
+    op->func_dict = NULL;
+    op->func_module = NULL;
+    op->func_annotations = NULL;
+
+    /* __module__: If module name is in globals, use it.
+       Otherwise, use None. */
+    module = PyDict_GetItem(globals, __name__);
+    if (module) {
+        Py_INCREF(module);
+        op->func_module = module;
+    }
+    if (qualname)
+        op->func_qualname = qualname;
+    else
+        op->func_qualname = op->func_name;
+    Py_INCREF(op->func_qualname);
+
     _PyObject_GC_TRACK(op);
     return (PyObject *)op;
 }
diff --git a/Objects/genobject.c b/Objects/genobject.c
index 2e74b8c..08d30bf 100644
--- a/Objects/genobject.c
+++ b/Objects/genobject.c
@@ -15,6 +15,31 @@
     return 0;
 }
 
+void
+_PyGen_Finalize(PyObject *self)
+{
+    PyGenObject *gen = (PyGenObject *)self;
+    PyObject *res;
+    PyObject *error_type, *error_value, *error_traceback;
+
+    if (gen->gi_frame == NULL || gen->gi_frame->f_stacktop == NULL)
+        /* Generator isn't paused, so no need to close */
+        return;
+
+    /* Save the current exception, if any. */
+    PyErr_Fetch(&error_type, &error_value, &error_traceback);
+
+    res = gen_close(gen, NULL);
+
+    if (res == NULL)
+        PyErr_WriteUnraisable(self);
+    else
+        Py_DECREF(res);
+
+    /* Restore the saved exception. */
+    PyErr_Restore(error_type, error_value, error_traceback);
+}
+
 static void
 gen_dealloc(PyGenObject *gen)
 {
@@ -27,12 +52,8 @@
 
     _PyObject_GC_TRACK(self);
 
-    if (gen->gi_frame != NULL && gen->gi_frame->f_stacktop != NULL) {
-        /* Generator is paused, so we need to close */
-        Py_TYPE(gen)->tp_del(self);
-        if (self->ob_refcnt > 0)
-            return;                     /* resurrected.  :( */
-    }
+    if (PyObject_CallFinalizerFromDealloc(self))
+        return;                     /* resurrected.  :( */
 
     _PyObject_GC_UNTRACK(self);
     Py_CLEAR(gen->gi_frame);
@@ -40,7 +61,6 @@
     PyObject_GC_Del(gen);
 }
 
-
 static PyObject *
 gen_send_ex(PyGenObject *gen, PyObject *arg, int exc)
 {
@@ -76,7 +96,6 @@
 
     /* Generators always return to their most recent caller, not
      * necessarily their creator. */
-    f->f_tstate = tstate;
     Py_XINCREF(tstate->frame);
     assert(f->f_back == NULL);
     f->f_back = tstate->frame;
@@ -90,8 +109,6 @@
      * cycle. */
     assert(f->f_back == tstate->frame);
     Py_CLEAR(f->f_back);
-    /* Clear the borrowed reference to the thread state */
-    f->f_tstate = NULL;
 
     /* If the generator just returned (as opposed to yielding), signal
      * that the generator is exhausted. */
@@ -123,6 +140,7 @@
         Py_XDECREF(t);
         Py_XDECREF(v);
         Py_XDECREF(tb);
+        gen->gi_frame->f_gen = NULL;
         gen->gi_frame = NULL;
         Py_DECREF(f);
     }
@@ -225,68 +243,6 @@
     return NULL;
 }
 
-static void
-gen_del(PyObject *self)
-{
-    PyObject *res;
-    PyObject *error_type, *error_value, *error_traceback;
-    PyGenObject *gen = (PyGenObject *)self;
-
-    if (gen->gi_frame == NULL || gen->gi_frame->f_stacktop == NULL)
-        /* Generator isn't paused, so no need to close */
-        return;
-
-    /* Temporarily resurrect the object. */
-    assert(self->ob_refcnt == 0);
-    self->ob_refcnt = 1;
-
-    /* Save the current exception, if any. */
-    PyErr_Fetch(&error_type, &error_value, &error_traceback);
-
-    res = gen_close(gen, NULL);
-
-    if (res == NULL)
-        PyErr_WriteUnraisable(self);
-    else
-        Py_DECREF(res);
-
-    /* Restore the saved exception. */
-    PyErr_Restore(error_type, error_value, error_traceback);
-
-    /* Undo the temporary resurrection; can't use DECREF here, it would
-     * cause a recursive call.
-     */
-    assert(self->ob_refcnt > 0);
-    if (--self->ob_refcnt == 0)
-        return; /* this is the normal path out */
-
-    /* close() resurrected it!  Make it look like the original Py_DECREF
-     * never happened.
-     */
-    {
-        Py_ssize_t refcnt = self->ob_refcnt;
-        _Py_NewReference(self);
-        self->ob_refcnt = refcnt;
-    }
-    assert(PyType_IS_GC(Py_TYPE(self)) &&
-           _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
-
-    /* If Py_REF_DEBUG, _Py_NewReference bumped _Py_RefTotal, so
-     * we need to undo that. */
-    _Py_DEC_REFTOTAL;
-    /* If Py_TRACE_REFS, _Py_NewReference re-added self to the object
-     * chain, so no more to do there.
-     * If COUNT_ALLOCS, the original decref bumped tp_frees, and
-     * _Py_NewReference bumped tp_allocs:  both of those need to be
-     * undone.
-     */
-#ifdef COUNT_ALLOCS
-    --(Py_TYPE(self)->tp_frees);
-    --(Py_TYPE(self)->tp_allocs);
-#endif
-}
-
-
 
 PyDoc_STRVAR(throw_doc,
 "throw(typ[,val[,tb]]) -> raise exception in generator,\n\
@@ -520,7 +476,8 @@
     PyObject_GenericGetAttr,                    /* tp_getattro */
     0,                                          /* tp_setattro */
     0,                                          /* tp_as_buffer */
-    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
+        Py_TPFLAGS_HAVE_FINALIZE,               /* tp_flags */
     0,                                          /* tp_doc */
     (traverseproc)gen_traverse,                 /* tp_traverse */
     0,                                          /* tp_clear */
@@ -547,7 +504,9 @@
     0,                                          /* tp_cache */
     0,                                          /* tp_subclasses */
     0,                                          /* tp_weaklist */
-    gen_del,                                    /* tp_del */
+    0,                                          /* tp_del */
+    0,                                          /* tp_version_tag */
+    _PyGen_Finalize,                            /* tp_finalize */
 };
 
 PyObject *
@@ -559,6 +518,7 @@
         return NULL;
     }
     gen->gi_frame = f;
+    f->f_gen = (PyObject *) gen;
     Py_INCREF(f->f_code);
     gen->gi_code = (PyObject *)(f->f_code);
     gen->gi_running = 0;
diff --git a/Objects/iterobject.c b/Objects/iterobject.c
index 3cfbeaf..77ff810 100644
--- a/Objects/iterobject.c
+++ b/Objects/iterobject.c
@@ -4,7 +4,7 @@
 
 typedef struct {
     PyObject_HEAD
-    long      it_index;
+    Py_ssize_t it_index;
     PyObject *it_seq; /* Set to NULL when iterator is exhausted */
 } seqiterobject;
 
@@ -76,9 +76,14 @@
     Py_ssize_t seqsize, len;
 
     if (it->it_seq) {
-        seqsize = PySequence_Size(it->it_seq);
-        if (seqsize == -1)
-            return NULL;
+        if (_PyObject_HasLen(it->it_seq)) {
+            seqsize = PySequence_Size(it->it_seq);
+            if (seqsize == -1)
+                return NULL;
+        }
+        else {
+            Py_RETURN_NOTIMPLEMENTED;
+        }
         len = seqsize - it->it_index;
         if (len >= 0)
             return PyLong_FromSsize_t(len);
diff --git a/Objects/listobject.c b/Objects/listobject.c
index ae36577..fd5a72a 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -213,11 +213,11 @@
 }
 
 int
-PyList_SetItem(register PyObject *op, register Py_ssize_t i,
-               register PyObject *newitem)
+PyList_SetItem(PyObject *op, Py_ssize_t i,
+               PyObject *newitem)
 {
-    register PyObject *olditem;
-    register PyObject **p;
+    PyObject *olditem;
+    PyObject **p;
     if (!PyList_Check(op)) {
         Py_XDECREF(newitem);
         PyErr_BadInternalCall();
@@ -338,57 +338,57 @@
 list_repr(PyListObject *v)
 {
     Py_ssize_t i;
-    PyObject *s = NULL;
-    _PyAccu acc;
-    static PyObject *sep = NULL;
+    PyObject *s;
+    _PyUnicodeWriter writer;
 
     if (Py_SIZE(v) == 0) {
         return PyUnicode_FromString("[]");
     }
 
-    if (sep == NULL) {
-        sep = PyUnicode_FromString(", ");
-        if (sep == NULL)
-            return NULL;
-    }
-
     i = Py_ReprEnter((PyObject*)v);
     if (i != 0) {
         return i > 0 ? PyUnicode_FromString("[...]") : NULL;
     }
 
-    if (_PyAccu_Init(&acc))
-        goto error;
+    _PyUnicodeWriter_Init(&writer);
+    writer.overallocate = 1;
+    /* "[" + "1" + ", 2" * (len - 1) + "]" */
+    writer.min_length = 1 + 1 + (2 + 1) * (Py_SIZE(v) - 1) + 1;
 
-    s = PyUnicode_FromString("[");
-    if (s == NULL || _PyAccu_Accumulate(&acc, s))
+    if (_PyUnicodeWriter_WriteChar(&writer, '[') < 0)
         goto error;
-    Py_CLEAR(s);
 
     /* Do repr() on each element.  Note that this may mutate the list,
        so must refetch the list size on each iteration. */
     for (i = 0; i < Py_SIZE(v); ++i) {
+        if (i > 0) {
+            if (_PyUnicodeWriter_WriteASCIIString(&writer, ", ", 2) < 0)
+                goto error;
+        }
+
         if (Py_EnterRecursiveCall(" while getting the repr of a list"))
             goto error;
         s = PyObject_Repr(v->ob_item[i]);
         Py_LeaveRecursiveCall();
-        if (i > 0 && _PyAccu_Accumulate(&acc, sep))
+        if (s == NULL)
             goto error;
-        if (s == NULL || _PyAccu_Accumulate(&acc, s))
+
+        if (_PyUnicodeWriter_WriteStr(&writer, s) < 0) {
+            Py_DECREF(s);
             goto error;
-        Py_CLEAR(s);
+        }
+        Py_DECREF(s);
     }
-    s = PyUnicode_FromString("]");
-    if (s == NULL || _PyAccu_Accumulate(&acc, s))
+
+    writer.overallocate = 0;
+    if (_PyUnicodeWriter_WriteChar(&writer, ']') < 0)
         goto error;
-    Py_CLEAR(s);
 
     Py_ReprLeave((PyObject *)v);
-    return _PyAccu_Finish(&acc);
+    return _PyUnicodeWriter_Finish(&writer);
 
 error:
-    _PyAccu_Destroy(&acc);
-    Py_XDECREF(s);
+    _PyUnicodeWriter_Dealloc(&writer);
     Py_ReprLeave((PyObject *)v);
     return NULL;
 }
@@ -644,9 +644,14 @@
     memcpy(recycle, &item[ilow], s);
 
     if (d < 0) { /* Delete -d items */
-        memmove(&item[ihigh+d], &item[ihigh],
-            (Py_SIZE(a) - ihigh)*sizeof(PyObject *));
-        list_resize(a, Py_SIZE(a) + d);
+        Py_ssize_t tail;
+        tail = (Py_SIZE(a) - ihigh) * sizeof(PyObject *);
+        memmove(&item[ihigh+d], &item[ihigh], tail);
+        if (list_resize(a, Py_SIZE(a) + d) < 0) {
+            memmove(&item[ihigh], &item[ihigh+d], tail);
+            memcpy(&item[ilow], recycle, s);
+            goto Error;
+        }
         item = a->ob_item;
     }
     else if (d > 0) { /* Insert d items */
@@ -826,7 +831,7 @@
     iternext = *it->ob_type->tp_iternext;
 
     /* Guess a result list size. */
-    n = _PyObject_LengthHint(b, 8);
+    n = PyObject_LengthHint(b, 8);
     if (n == -1) {
         Py_DECREF(it);
         return NULL;
@@ -871,8 +876,10 @@
     }
 
     /* Cut back result list if initial guess was too large. */
-    if (Py_SIZE(self) < self->allocated)
-        list_resize(self, Py_SIZE(self));  /* shrinking can't fail */
+    if (Py_SIZE(self) < self->allocated) {
+        if (list_resize(self, Py_SIZE(self)) < 0)
+            goto error;
+    }
 
     Py_DECREF(it);
     Py_RETURN_NONE;
@@ -925,17 +932,17 @@
     v = self->ob_item[i];
     if (i == Py_SIZE(self) - 1) {
         status = list_resize(self, Py_SIZE(self) - 1);
-        assert(status >= 0);
-        return v; /* and v now owns the reference the list had */
+        if (status >= 0)
+            return v; /* and v now owns the reference the list had */
+        else
+            return NULL;
     }
     Py_INCREF(v);
     status = list_ass_slice(self, i, i+1, (PyObject *)NULL);
-    assert(status >= 0);
-    /* Use status, so that in a release build compilers don't
-     * complain about the unused name.
-     */
-    (void) status;
-
+    if (status < 0) {
+        Py_DECREF(v);
+        return NULL;
+    }
     return v;
 }
 
@@ -1051,9 +1058,9 @@
 static int
 binarysort(sortslice lo, PyObject **hi, PyObject **start)
 {
-    register Py_ssize_t k;
-    register PyObject **l, **p, **r;
-    register PyObject *pivot;
+    Py_ssize_t k;
+    PyObject **l, **p, **r;
+    PyObject *pivot;
 
     assert(lo.keys <= start && start <= hi);
     /* assert [lo, start) is sorted */
@@ -2476,6 +2483,7 @@
             PyObject **garbage;
             size_t cur;
             Py_ssize_t i;
+            int res;
 
             if (slicelength <= 0)
                 return 0;
@@ -2526,14 +2534,14 @@
             }
 
             Py_SIZE(self) -= slicelength;
-            list_resize(self, Py_SIZE(self));
+            res = list_resize(self, Py_SIZE(self));
 
             for (i = 0; i < slicelength; i++) {
                 Py_DECREF(garbage[i]);
             }
             PyMem_FREE(garbage);
 
-            return 0;
+            return res;
         }
         else {
             /* assign slice */
@@ -2660,7 +2668,7 @@
 
 typedef struct {
     PyObject_HEAD
-    long it_index;
+    Py_ssize_t it_index;
     PyListObject *it_seq; /* Set to NULL when iterator is exhausted */
 } listiterobject;
 
@@ -2797,7 +2805,7 @@
 static PyObject *
 listiter_setstate(listiterobject *it, PyObject *state)
 {
-    long index = PyLong_AsLong(state);
+    Py_ssize_t index = PyLong_AsSsize_t(state);
     if (index == -1 && PyErr_Occurred())
         return NULL;
     if (it->it_seq != NULL) {
@@ -2960,7 +2968,7 @@
     if (forward) {
         listiterobject *it = (listiterobject *)_it;
         if (it->it_seq)
-            return Py_BuildValue("N(O)l", _PyObject_GetBuiltin("iter"),
+            return Py_BuildValue("N(O)n", _PyObject_GetBuiltin("iter"),
                                  it->it_seq, it->it_index);
     } else {
         listreviterobject *it = (listreviterobject *)_it;
diff --git a/Objects/longobject.c b/Objects/longobject.c
index 2245ece..7036c0e 100644
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -17,7 +17,8 @@
 #endif
 
 /* convert a PyLong of size 1, 0 or -1 to an sdigit */
-#define MEDIUM_VALUE(x) (Py_SIZE(x) < 0 ? -(sdigit)(x)->ob_digit[0] :   \
+#define MEDIUM_VALUE(x) (assert(-1 <= Py_SIZE(x) && Py_SIZE(x) <= 1),   \
+         Py_SIZE(x) < 0 ? -(sdigit)(x)->ob_digit[0] :   \
              (Py_SIZE(x) == 0 ? (sdigit)0 :                             \
               (sdigit)(x)->ob_digit[0]))
 #define ABS(x) ((x) < 0 ? -(x) : (x))
@@ -72,11 +73,21 @@
 
 /* If a freshly-allocated int is already shared, it must
    be a small integer, so negating it must go to PyLong_FromLong */
-#define NEGATE(x) \
-    do if (Py_REFCNT(x) == 1) Py_SIZE(x) = -Py_SIZE(x);  \
-       else { PyObject* tmp=PyLong_FromLong(-MEDIUM_VALUE(x));  \
-           Py_DECREF(x); (x) = (PyLongObject*)tmp; }               \
-    while(0)
+Py_LOCAL_INLINE(void)
+_PyLong_Negate(PyLongObject **x_p)
+{
+    PyLongObject *x;
+
+    x = (PyLongObject *)*x_p;
+    if (Py_REFCNT(x) == 1) {
+        Py_SIZE(x) = -Py_SIZE(x);
+        return;
+    }
+
+    *x_p = (PyLongObject *)PyLong_FromLong(-MEDIUM_VALUE(x));
+    Py_DECREF(x);
+}
+
 /* For int multiplication, use the O(N**2) school algorithm unless
  * both operands contain more than KARATSUBA_CUTOFF digits (this
  * being an internal Python int digit, in base BASE).
@@ -91,11 +102,6 @@
  */
 #define FIVEARY_CUTOFF 8
 
-#undef MIN
-#undef MAX
-#define MAX(x, y) ((x) < (y) ? (y) : (x))
-#define MIN(x, y) ((x) > (y) ? (y) : (x))
-
 #define SIGCHECK(PyTryBlock)                    \
     do {                                        \
         if (PyErr_CheckSignals()) PyTryBlock    \
@@ -106,7 +112,7 @@
    of the algorithms used, this could save at most be one word anyway. */
 
 static PyLongObject *
-long_normalize(register PyLongObject *v)
+long_normalize(PyLongObject *v)
 {
     Py_ssize_t j = ABS(Py_SIZE(v));
     Py_ssize_t i = j;
@@ -155,6 +161,15 @@
         Py_DECREF(result);
         return NULL;
     }
+    /* Issue #17576: warn if 'result' not of exact type int. */
+    if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
+            "__int__ returned non-int (type %.200s).  "
+            "The ability to return an instance of a strict subclass of int "
+            "is deprecated, and may be removed in a future version of Python.",
+            result->ob_type->tp_name)) {
+        Py_DECREF(result);
+        return NULL;
+    }
     return (PyLongObject *)result;
 }
 
@@ -377,7 +392,7 @@
 PyLong_AsLongAndOverflow(PyObject *vv, int *overflow)
 {
     /* This version by Tim Peters */
-    register PyLongObject *v;
+    PyLongObject *v;
     unsigned long x, prev;
     long res;
     Py_ssize_t i;
@@ -489,7 +504,7 @@
 
 Py_ssize_t
 PyLong_AsSsize_t(PyObject *vv) {
-    register PyLongObject *v;
+    PyLongObject *v;
     size_t x, prev;
     Py_ssize_t i;
     int sign;
@@ -545,7 +560,7 @@
 unsigned long
 PyLong_AsUnsignedLong(PyObject *vv)
 {
-    register PyLongObject *v;
+    PyLongObject *v;
     unsigned long x, prev;
     Py_ssize_t i;
 
@@ -575,7 +590,7 @@
         x = (x << PyLong_SHIFT) | v->ob_digit[i];
         if ((x >> PyLong_SHIFT) != prev) {
             PyErr_SetString(PyExc_OverflowError,
-                            "python int too large to convert "
+                            "Python int too large to convert "
                             "to C unsigned long");
             return (unsigned long) -1;
         }
@@ -589,7 +604,7 @@
 size_t
 PyLong_AsSize_t(PyObject *vv)
 {
-    register PyLongObject *v;
+    PyLongObject *v;
     size_t x, prev;
     Py_ssize_t i;
 
@@ -632,7 +647,7 @@
 static unsigned long
 _PyLong_AsUnsignedLongMask(PyObject *vv)
 {
-    register PyLongObject *v;
+    PyLongObject *v;
     unsigned long x;
     Py_ssize_t i;
     int sign;
@@ -660,7 +675,7 @@
 }
 
 unsigned long
-PyLong_AsUnsignedLongMask(register PyObject *op)
+PyLong_AsUnsignedLongMask(PyObject *op)
 {
     PyLongObject *lo;
     unsigned long val;
@@ -975,9 +990,6 @@
 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
 
@@ -987,9 +999,6 @@
 #if SIZEOF_LONG_LONG < SIZEOF_VOID_P
 #   error "PyLong_FromVoidPtr: sizeof(PY_LONG_LONG) < sizeof(void*)"
 #endif
-    /* special-case null pointer */
-    if (!p)
-        return PyLong_FromLong(0);
     return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)(Py_uintptr_t)p);
 #endif /* SIZEOF_VOID_P <= SIZEOF_LONG */
 
@@ -1035,7 +1044,6 @@
  * rewritten to use the newer PyLong_{As,From}ByteArray API.
  */
 
-#define IS_LITTLE_ENDIAN (int)*(unsigned char*)&one
 #define PY_ABS_LLONG_MIN (0-(unsigned PY_LONG_LONG)PY_LLONG_MIN)
 
 /* Create a new int object from a C PY_LONG_LONG int. */
@@ -1188,7 +1196,6 @@
 {
     PyLongObject *v;
     PY_LONG_LONG bytes;
-    int one = 1;
     int res;
     int do_decref = 0; /* if nb_int was called */
 
@@ -1220,7 +1227,7 @@
         break;
     default:
         res = _PyLong_AsByteArray((PyLongObject *)v, (unsigned char *)&bytes,
-                                  SIZEOF_LONG_LONG, IS_LITTLE_ENDIAN, 1);
+                                  SIZEOF_LONG_LONG, PY_LITTLE_ENDIAN, 1);
     }
     if (do_decref) {
         Py_DECREF(v);
@@ -1241,7 +1248,6 @@
 {
     PyLongObject *v;
     unsigned PY_LONG_LONG bytes;
-    int one = 1;
     int res;
 
     if (vv == NULL) {
@@ -1260,7 +1266,7 @@
     }
 
     res = _PyLong_AsByteArray((PyLongObject *)vv, (unsigned char *)&bytes,
-                              SIZEOF_LONG_LONG, IS_LITTLE_ENDIAN, 0);
+                              SIZEOF_LONG_LONG, PY_LITTLE_ENDIAN, 0);
 
     /* Plan 9 can't handle PY_LONG_LONG in ? : expressions */
     if (res < 0)
@@ -1275,7 +1281,7 @@
 static unsigned PY_LONG_LONG
 _PyLong_AsUnsignedLongLongMask(PyObject *vv)
 {
-    register PyLongObject *v;
+    PyLongObject *v;
     unsigned PY_LONG_LONG x;
     Py_ssize_t i;
     int sign;
@@ -1303,7 +1309,7 @@
 }
 
 unsigned PY_LONG_LONG
-PyLong_AsUnsignedLongLongMask(register PyObject *op)
+PyLong_AsUnsignedLongLongMask(PyObject *op)
 {
     PyLongObject *lo;
     unsigned PY_LONG_LONG val;
@@ -1325,7 +1331,6 @@
     Py_DECREF(lo);
     return val;
 }
-#undef IS_LITTLE_ENDIAN
 
 /* Get a C long long int from an int object or any object that has an
    __int__ method.
@@ -1341,7 +1346,7 @@
 PyLong_AsLongLongAndOverflow(PyObject *vv, int *overflow)
 {
     /* This version by Tim Peters */
-    register PyLongObject *v;
+    PyLongObject *v;
     unsigned PY_LONG_LONG x, prev;
     PY_LONG_LONG res;
     Py_ssize_t i;
@@ -1606,7 +1611,7 @@
     */
     if (size_a > PY_SSIZE_T_MAX / PyLong_SHIFT) {
         PyErr_SetString(PyExc_OverflowError,
-                        "long is too large to format");
+                        "int too large to format");
         return -1;
     }
     /* the expression size_a * PyLong_SHIFT is now safe from overflow */
@@ -1676,7 +1681,6 @@
         else                                                          \
             p = (TYPE*)PyUnicode_DATA(str) + strlen;                  \
                                                                       \
-        *p = '\0';                                                    \
         /* pout[0] through pout[size-2] contribute exactly            \
            _PyLong_DECIMAL_SHIFT digits each */                       \
         for (i=0; i < size - 1; i++) {                                \
@@ -1749,7 +1753,7 @@
 long_format_binary(PyObject *aa, int base, int alternate,
                    PyObject **p_output, _PyUnicodeWriter *writer)
 {
-    register PyLongObject *a = (PyLongObject *)aa;
+    PyLongObject *a = (PyLongObject *)aa;
     PyObject *v;
     Py_ssize_t sz;
     Py_ssize_t size_a;
@@ -1790,7 +1794,7 @@
         /* Ensure overflow doesn't occur during computation of sz. */
         if (size_a > (PY_SSIZE_T_MAX - 3) / PyLong_SHIFT) {
             PyErr_SetString(PyExc_OverflowError,
-                            "int is too large to format");
+                            "int too large to format");
             return -1;
         }
         size_a_in_bits = (size_a - 1) * PyLong_SHIFT +
@@ -1946,10 +1950,10 @@
  * string characters.
  */
 static PyLongObject *
-long_from_binary_base(char **str, int base)
+long_from_binary_base(const char **str, int base)
 {
-    char *p = *str;
-    char *start = p;
+    const char *p = *str;
+    const char *start = p;
     int bits_per_char;
     Py_ssize_t n;
     PyLongObject *z;
@@ -2014,10 +2018,10 @@
  * If unsuccessful, NULL will be returned.
  */
 PyObject *
-PyLong_FromString(char *str, char **pend, int base)
+PyLong_FromString(const char *str, char **pend, int base)
 {
     int sign = 1, error_if_nonzero = 0;
-    char *start, *orig_str = str;
+    const char *start, *orig_str = str;
     PyLongObject *z = NULL;
     PyObject *strobj;
     Py_ssize_t slen;
@@ -2146,13 +2150,13 @@
 just 1 digit at the start, so that the copying code was exercised for every
 digit beyond the first.
 ***/
-        register twodigits c;           /* current input character */
+        twodigits c;           /* current input character */
         Py_ssize_t size_z;
         int i;
         int convwidth;
         twodigits convmultmax, convmult;
         digit *pz, *pzstop;
-        char* scan;
+        const char* scan;
 
         static double log_base_BASE[37] = {0.0e0,};
         static int convwidth_base[37] = {0,};
@@ -2280,19 +2284,19 @@
     if (z == NULL)
         return NULL;
     if (pend != NULL)
-        *pend = str;
+        *pend = (char *)str;
     return (PyObject *) z;
 
   onError:
     if (pend != NULL)
-        *pend = str;
+        *pend = (char *)str;
     Py_XDECREF(z);
     slen = strlen(orig_str) < 200 ? strlen(orig_str) : 200;
     strobj = PyUnicode_FromStringAndSize(orig_str, slen);
     if (strobj == NULL)
         return NULL;
     PyErr_Format(PyExc_ValueError,
-                 "invalid literal for int() with base %d: %R",
+                 "invalid literal for int() with base %d: %.200R",
                  base, strobj);
     Py_DECREF(strobj);
     return NULL;
@@ -2316,7 +2320,7 @@
     strobj = PyBytes_FromStringAndSize(s, Py_MIN(len, 200));
     if (strobj != NULL) {
         PyErr_Format(PyExc_ValueError,
-                     "invalid literal for int() with base %d: %R",
+                     "invalid literal for int() with base %d: %.200R",
                      base, strobj);
         Py_DECREF(strobj);
     }
@@ -2337,7 +2341,7 @@
 PyObject *
 PyLong_FromUnicodeObject(PyObject *u, int base)
 {
-    PyObject *result, *asciidig, *strobj;
+    PyObject *result, *asciidig;
     char *buffer, *end = NULL;
     Py_ssize_t buflen;
 
@@ -2359,13 +2363,9 @@
         Py_DECREF(asciidig);
         Py_XDECREF(result);
     }
-    strobj = PySequence_GetSlice(u, 0, 200);
-    if (strobj != NULL) {
-        PyErr_Format(PyExc_ValueError,
-                     "invalid literal for int() with base %d: %R",
-                     base, strobj);
-        Py_DECREF(strobj);
-    }
+    PyErr_Format(PyExc_ValueError,
+                 "invalid literal for int() with base %d: %.200R",
+                 base, u);
     return NULL;
 }
 
@@ -2419,10 +2419,21 @@
        The quotient z has the sign of a*b;
        the remainder r has the sign of a,
        so a = b*z + r. */
-    if ((Py_SIZE(a) < 0) != (Py_SIZE(b) < 0))
-        NEGATE(z);
-    if (Py_SIZE(a) < 0 && Py_SIZE(*prem) != 0)
-        NEGATE(*prem);
+    if ((Py_SIZE(a) < 0) != (Py_SIZE(b) < 0)) {
+        _PyLong_Negate(&z);
+        if (z == NULL) {
+            Py_CLEAR(*prem);
+            return -1;
+        }
+    }
+    if (Py_SIZE(a) < 0 && Py_SIZE(*prem) != 0) {
+        _PyLong_Negate(prem);
+        if (*prem == NULL) {
+            Py_DECREF(z);
+            Py_CLEAR(*prem);
+            return -1;
+        }
+    }
     *pdiv = maybe_small_long(z);
     return 0;
 }
@@ -2698,7 +2709,7 @@
     x = _PyLong_Frexp((PyLongObject *)v, &exponent);
     if ((x == -1.0 && PyErr_Occurred()) || exponent > DBL_MAX_EXP) {
         PyErr_SetString(PyExc_OverflowError,
-                        "long int too large to convert to float");
+                        "int too large to convert to float");
         return -1.0;
     }
     return ldexp(x, (int)exponent);
@@ -2918,8 +2929,11 @@
         borrow &= 1; /* Keep only one sign bit */
     }
     assert(borrow == 0);
-    if (sign < 0)
-        NEGATE(z);
+    if (sign < 0) {
+        _PyLong_Negate(&z);
+        if (z == NULL)
+            return NULL;
+    }
     return long_normalize(z);
 }
 
@@ -3086,7 +3100,7 @@
     Py_ssize_t size_lo, size_hi;
     const Py_ssize_t size_n = ABS(Py_SIZE(n));
 
-    size_lo = MIN(size_n, size);
+    size_lo = Py_MIN(size_n, size);
     size_hi = size_n - size_lo;
 
     if ((hi = _PyLong_New(size_hi)) == NULL)
@@ -3357,7 +3371,7 @@
     nbdone = 0;
     while (bsize > 0) {
         PyLongObject *product;
-        const Py_ssize_t nbtouse = MIN(bsize, asize);
+        const Py_ssize_t nbtouse = Py_MIN(bsize, asize);
 
         /* Multiply the next slice of b by a. */
         memcpy(bslice->ob_digit, b->ob_digit + nbdone,
@@ -3410,8 +3424,11 @@
 
     z = k_mul(a, b);
     /* Negate if exactly one of the inputs is negative. */
-    if (((Py_SIZE(a) ^ Py_SIZE(b)) < 0) && z)
-        NEGATE(z);
+    if (((Py_SIZE(a) ^ Py_SIZE(b)) < 0) && z) {
+        _PyLong_Negate(&z);
+        if (z == NULL)
+            return NULL;
+    }
     return (PyObject *)z;
 }
 
@@ -3648,7 +3665,7 @@
         goto underflow_or_zero;
 
     /* Choose value for shift; see comments for step 1 above. */
-    shift = MAX(diff, DBL_MIN_EXP) - DBL_MANT_DIG - 2;
+    shift = Py_MAX(diff, DBL_MIN_EXP) - DBL_MANT_DIG - 2;
 
     inexact = 0;
 
@@ -3719,7 +3736,7 @@
     x_bits = (x_size-1)*PyLong_SHIFT+bits_in_digit(x->ob_digit[x_size-1]);
 
     /* The number of extra bits that have to be rounded away. */
-    extra_bits = MAX(x_bits, DBL_MIN_EXP - shift) - DBL_MANT_DIG;
+    extra_bits = Py_MAX(x_bits, DBL_MIN_EXP - shift) - DBL_MANT_DIG;
     assert(extra_bits == 2 || extra_bits == 3);
 
     /* Round by directly modifying the low digit of x. */
@@ -3858,7 +3875,9 @@
             Py_DECREF(c);
             c = temp;
             temp = NULL;
-            NEGATE(c);
+            _PyLong_Negate(&c);
+            if (c == NULL)
+                goto Error;
         }
 
         /* if modulus == 1:
@@ -3964,10 +3983,7 @@
     goto Done;
 
   Error:
-    if (z != NULL) {
-        Py_DECREF(z);
-        z = NULL;
-    }
+    Py_CLEAR(z);
     /* fall through */
   Done:
     if (Py_SIZE(b) > FIVEARY_CUTOFF) {
@@ -4097,10 +4113,10 @@
 
     shiftby = PyLong_AsSsize_t((PyObject *)b);
     if (shiftby == -1L && PyErr_Occurred())
-        goto lshift_error;
+        return NULL;
     if (shiftby < 0) {
         PyErr_SetString(PyExc_ValueError, "negative shift count");
-        goto lshift_error;
+        return NULL;
     }
     /* wordshift, remshift = divmod(shiftby, PyLong_SHIFT) */
     wordshift = shiftby / PyLong_SHIFT;
@@ -4112,9 +4128,11 @@
         ++newsize;
     z = _PyLong_New(newsize);
     if (z == NULL)
-        goto lshift_error;
-    if (Py_SIZE(a) < 0)
-        NEGATE(z);
+        return NULL;
+    if (Py_SIZE(a) < 0) {
+        assert(Py_REFCNT(z) == 1);
+        Py_SIZE(z) = -Py_SIZE(z);
+    }
     for (i = 0; i < wordshift; i++)
         z->ob_digit[i] = 0;
     accum = 0;
@@ -4128,7 +4146,6 @@
     else
         assert(!accum);
     z = long_normalize(z);
-  lshift_error:
     return (PyObject *) maybe_small_long(z);
 }
 
@@ -4153,7 +4170,7 @@
 
 static PyObject *
 long_bitwise(PyLongObject *a,
-             int op,  /* '&', '|', '^' */
+             char op,  /* '&', '|', '^' */
              PyLongObject *b)
 {
     int nega, negb, negz;
@@ -4328,8 +4345,7 @@
 long_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
 {
     PyObject *obase = NULL, *x = NULL;
-    long base;
-    int overflow;
+    Py_ssize_t base;
     static char *kwlist[] = {"x", "base", 0};
 
     if (type != &PyLong_Type)
@@ -4348,10 +4364,10 @@
     if (obase == NULL)
         return PyNumber_Long(x);
 
-    base = PyLong_AsLongAndOverflow(obase, &overflow);
+    base = PyNumber_AsSsize_t(obase, NULL);
     if (base == -1 && PyErr_Occurred())
         return NULL;
-    if (overflow || (base != 0 && base < 2) || base > 36) {
+    if ((base != 0 && base < 2) || base > 36) {
         PyErr_SetString(PyExc_ValueError,
                         "int() base must be >= 2 and <= 36");
         return NULL;
@@ -4432,7 +4448,7 @@
     if (!PyArg_ParseTuple(args, "U:__format__", &format_spec))
         return NULL;
 
-    _PyUnicodeWriter_Init(&writer, 0);
+    _PyUnicodeWriter_Init(&writer);
     ret = _PyLong_FormatAdvancedWriter(
         &writer,
         self,
@@ -5082,15 +5098,17 @@
             assert(v->ob_digit[0] == abs(ival));
         }
         else {
-            PyObject_INIT(v, &PyLong_Type);
+            (void)PyObject_INIT(v, &PyLong_Type);
         }
         Py_SIZE(v) = size;
         v->ob_digit[0] = abs(ival);
     }
 #endif
     /* initialize int_info */
-    if (Int_InfoType.tp_name == 0)
-        PyStructSequence_InitType(&Int_InfoType, &int_info_desc);
+    if (Int_InfoType.tp_name == NULL) {
+        if (PyStructSequence_InitType2(&Int_InfoType, &int_info_desc) < 0)
+            return 0;
+    }
 
     return 1;
 }
diff --git a/Objects/memoryobject.c b/Objects/memoryobject.c
index 189af88..0be8493 100644
--- a/Objects/memoryobject.c
+++ b/Objects/memoryobject.c
@@ -1135,6 +1135,51 @@
     return -1;
 }
 
+Py_LOCAL_INLINE(char *)
+get_native_fmtstr(const char *fmt)
+{
+    int at = 0;
+
+    if (fmt[0] == '@') {
+        at = 1;
+        fmt++;
+    }
+    if (fmt[0] == '\0' || fmt[1] != '\0') {
+        return NULL;
+    }
+
+#define RETURN(s) do { return at ? "@" s : s; } while (0)
+
+    switch (fmt[0]) {
+    case 'c': RETURN("c");
+    case 'b': RETURN("b");
+    case 'B': RETURN("B");
+    case 'h': RETURN("h");
+    case 'H': RETURN("H");
+    case 'i': RETURN("i");
+    case 'I': RETURN("I");
+    case 'l': RETURN("l");
+    case 'L': RETURN("L");
+    #ifdef HAVE_LONG_LONG
+    case 'q': RETURN("q");
+    case 'Q': RETURN("Q");
+    #endif
+    case 'n': RETURN("n");
+    case 'N': RETURN("N");
+    case 'f': RETURN("f");
+    case 'd': RETURN("d");
+    #ifdef HAVE_C99_BOOL
+    case '?': RETURN("?");
+    #else
+    case '?': RETURN("?");
+    #endif
+    case 'P': RETURN("P");
+    }
+
+    return NULL;
+}
+
+
 /* Cast a memoryview's data type to 'format'. The input array must be
    C-contiguous. At least one of input-format, output-format must have
    byte size. The output array is 1-D, with the same byte length as the
@@ -1184,10 +1229,13 @@
         goto out;
     }
 
-    strncpy(mv->format, PyBytes_AS_STRING(asciifmt),
-            _Py_MEMORYVIEW_MAX_FORMAT);
-    mv->format[_Py_MEMORYVIEW_MAX_FORMAT-1] = '\0';
-    view->format = mv->format;
+    view->format = get_native_fmtstr(PyBytes_AS_STRING(asciifmt));
+    if (view->format == NULL) {
+        /* NOT_REACHED: get_native_fmtchar() already validates the format. */
+        PyErr_SetString(PyExc_RuntimeError,
+            "memoryview: internal error");
+        goto out;
+    }
     view->itemsize = itemsize;
 
     view->ndim = 1;
@@ -2402,7 +2450,7 @@
 
 /* As sequence */
 static PySequenceMethods memory_as_sequence = {
-        0,                                /* sq_length */
+        (lenfunc)memory_length,           /* sq_length */
         0,                                /* sq_concat */
         0,                                /* sq_repeat */
         (ssizeargfunc)memory_item,        /* sq_item */
@@ -2742,7 +2790,7 @@
         }
 
         /* Can't fail */
-        self->hash = _Py_HashBytes((unsigned char *)mem, view->len);
+        self->hash = _Py_HashBytes(mem, view->len);
 
         if (mem != view->buf)
             PyMem_Free(mem);
diff --git a/Objects/methodobject.c b/Objects/methodobject.c
index f0685dd..f2616d4 100644
--- a/Objects/methodobject.c
+++ b/Objects/methodobject.c
@@ -13,6 +13,15 @@
 #define PyCFunction_MAXFREELIST 256
 #endif
 
+/* undefine macro trampoline to PyCFunction_NewEx */
+#undef PyCFunction_New
+
+PyObject *
+PyCFunction_New(PyMethodDef *ml, PyObject *self)
+{
+    return PyCFunction_NewEx(ml, self, NULL);
+}
+
 PyObject *
 PyCFunction_NewEx(PyMethodDef *ml, PyObject *self, PyObject *module)
 {
@@ -20,7 +29,7 @@
     op = free_list;
     if (op != NULL) {
         free_list = (PyCFunctionObject *)(op->m_self);
-        PyObject_INIT(op, &PyCFunction_Type);
+        (void)PyObject_INIT(op, &PyCFunction_Type);
         numfree--;
     }
     else {
@@ -70,23 +79,34 @@
 PyObject *
 PyCFunction_Call(PyObject *func, PyObject *arg, PyObject *kw)
 {
+#define CHECK_RESULT(res) assert(res != NULL || PyErr_Occurred())
+
     PyCFunctionObject* f = (PyCFunctionObject*)func;
     PyCFunction meth = PyCFunction_GET_FUNCTION(func);
     PyObject *self = PyCFunction_GET_SELF(func);
+    PyObject *res;
     Py_ssize_t size;
 
     switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) {
     case METH_VARARGS:
-        if (kw == NULL || PyDict_Size(kw) == 0)
-            return (*meth)(self, arg);
+        if (kw == NULL || PyDict_Size(kw) == 0) {
+            res = (*meth)(self, arg);
+            CHECK_RESULT(res);
+            return res;
+        }
         break;
     case METH_VARARGS | METH_KEYWORDS:
-        return (*(PyCFunctionWithKeywords)meth)(self, arg, kw);
+        res = (*(PyCFunctionWithKeywords)meth)(self, arg, kw);
+        CHECK_RESULT(res);
+        return res;
     case METH_NOARGS:
         if (kw == NULL || PyDict_Size(kw) == 0) {
             size = PyTuple_GET_SIZE(arg);
-            if (size == 0)
-                return (*meth)(self, NULL);
+            if (size == 0) {
+                res = (*meth)(self, NULL);
+                CHECK_RESULT(res);
+                return res;
+            }
             PyErr_Format(PyExc_TypeError,
                 "%.200s() takes no arguments (%zd given)",
                 f->m_ml->ml_name, size);
@@ -96,8 +116,11 @@
     case METH_O:
         if (kw == NULL || PyDict_Size(kw) == 0) {
             size = PyTuple_GET_SIZE(arg);
-            if (size == 1)
-                return (*meth)(self, PyTuple_GET_ITEM(arg, 0));
+            if (size == 1) {
+                res = (*meth)(self, PyTuple_GET_ITEM(arg, 0));
+                CHECK_RESULT(res);
+                return res;
+            }
             PyErr_Format(PyExc_TypeError,
                 "%.200s() takes exactly one argument (%zd given)",
                 f->m_ml->ml_name, size);
@@ -114,6 +137,8 @@
     PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
                  f->m_ml->ml_name);
     return NULL;
+
+#undef CHECK_RESULT
 }
 
 /* Methods (the standard built-in methods, that is) */
@@ -135,14 +160,35 @@
 }
 
 static PyObject *
+meth_reduce(PyCFunctionObject *m)
+{
+    PyObject *builtins;
+    PyObject *getattr;
+    _Py_IDENTIFIER(getattr);
+
+    if (m->m_self == NULL || PyModule_Check(m->m_self))
+        return PyUnicode_FromString(m->m_ml->ml_name);
+
+    builtins = PyEval_GetBuiltins();
+    getattr = _PyDict_GetItemId(builtins, &PyId_getattr);
+    return Py_BuildValue("O(Os)", getattr, m->m_self, m->m_ml->ml_name);
+}
+
+static PyMethodDef meth_methods[] = {
+    {"__reduce__", (PyCFunction)meth_reduce, METH_NOARGS, NULL},
+    {NULL, NULL}
+};
+
+static PyObject *
+meth_get__text_signature__(PyCFunctionObject *m, void *closure)
+{
+    return _PyType_GetTextSignatureFromInternalDoc(m->m_ml->ml_name, m->m_ml->ml_doc);
+}
+
+static PyObject *
 meth_get__doc__(PyCFunctionObject *m, void *closure)
 {
-    const char *doc = m->m_ml->ml_doc;
-
-    if (doc != NULL)
-        return PyUnicode_FromString(doc);
-    Py_INCREF(Py_None);
-    return Py_None;
+    return _PyType_GetDocFromInternalDoc(m->m_ml->ml_name, m->m_ml->ml_doc);
 }
 
 static PyObject *
@@ -211,6 +257,7 @@
     {"__name__", (getter)meth_get__name__, NULL, NULL},
     {"__qualname__", (getter)meth_get__qualname__, NULL, NULL},
     {"__self__", (getter)meth_get__self__, NULL, NULL},
+    {"__text_signature__", (getter)meth_get__text_signature__, NULL, NULL},
     {0}
 };
 
@@ -308,7 +355,7 @@
     0,                                          /* tp_weaklistoffset */
     0,                                          /* tp_iter */
     0,                                          /* tp_iternext */
-    0,                                          /* tp_methods */
+    meth_methods,                               /* tp_methods */
     meth_members,                               /* tp_members */
     meth_getsets,                               /* tp_getset */
     0,                                          /* tp_base */
@@ -346,17 +393,3 @@
                            "free PyCFunctionObject",
                            numfree, sizeof(PyCFunctionObject));
 }
-
-/* PyCFunction_New() is now just a macro that calls PyCFunction_NewEx(),
-   but it's part of the API so we need to keep a function around that
-   existing C extensions can call.
-*/
-
-#undef PyCFunction_New
-PyAPI_FUNC(PyObject *) PyCFunction_New(PyMethodDef *, PyObject *);
-
-PyObject *
-PyCFunction_New(PyMethodDef *ml, PyObject *self)
-{
-    return PyCFunction_NewEx(ml, self, NULL);
-}
diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c
index 72978ae..f509932 100644
--- a/Objects/moduleobject.c
+++ b/Objects/moduleobject.c
@@ -11,6 +11,8 @@
     PyObject *md_dict;
     struct PyModuleDef *md_def;
     void *md_state;
+    PyObject *md_weaklist;
+    PyObject *md_name;  /* for logging purposes after md_dict is cleared */
 } PyModuleObject;
 
 static PyMemberDef module_members[] = {
@@ -26,6 +28,35 @@
 };
 
 
+static int
+module_init_dict(PyModuleObject *mod, PyObject *md_dict,
+                 PyObject *name, PyObject *doc)
+{
+    if (md_dict == NULL)
+        return -1;
+    if (doc == NULL)
+        doc = Py_None;
+
+    if (PyDict_SetItemString(md_dict, "__name__", name) != 0)
+        return -1;
+    if (PyDict_SetItemString(md_dict, "__doc__", doc) != 0)
+        return -1;
+    if (PyDict_SetItemString(md_dict, "__package__", Py_None) != 0)
+        return -1;
+    if (PyDict_SetItemString(md_dict, "__loader__", Py_None) != 0)
+        return -1;
+    if (PyDict_SetItemString(md_dict, "__spec__", Py_None) != 0)
+        return -1;
+    if (PyUnicode_CheckExact(name)) {
+        Py_INCREF(name);
+        Py_XDECREF(mod->md_name);
+        mod->md_name = name;
+    }
+
+    return 0;
+}
+
+
 PyObject *
 PyModule_NewObject(PyObject *name)
 {
@@ -35,14 +66,10 @@
         return NULL;
     m->md_def = NULL;
     m->md_state = NULL;
+    m->md_weaklist = NULL;
+    m->md_name = NULL;
     m->md_dict = PyDict_New();
-    if (m->md_dict == NULL)
-        goto fail;
-    if (PyDict_SetItemString(m->md_dict, "__name__", name) != 0)
-        goto fail;
-    if (PyDict_SetItemString(m->md_dict, "__doc__", Py_None) != 0)
-        goto fail;
-    if (PyDict_SetItemString(m->md_dict, "__package__", Py_None) != 0)
+    if (module_init_dict(m, m->md_dict, name, NULL) != 0)
         goto fail;
     PyObject_GC_Track(m);
     return (PyObject *)m;
@@ -272,6 +299,14 @@
 void
 _PyModule_Clear(PyObject *m)
 {
+    PyObject *d = ((PyModuleObject *)m)->md_dict;
+    if (d != NULL)
+        _PyModule_ClearDict(d);
+}
+
+void
+_PyModule_ClearDict(PyObject *d)
+{
     /* To make the execution order of destructors for global
        objects a bit more predictable, we first zap all objects
        whose name starts with a single underscore, before we clear
@@ -281,11 +316,6 @@
 
     Py_ssize_t pos;
     PyObject *key, *value;
-    PyObject *d;
-
-    d = ((PyModuleObject *)m)->md_dict;
-    if (d == NULL)
-        return;
 
     /* First, clear only names starting with a single underscore */
     pos = 0;
@@ -349,9 +379,7 @@
             return -1;
         m->md_dict = dict;
     }
-    if (PyDict_SetItemString(dict, "__name__", name) < 0)
-        return -1;
-    if (PyDict_SetItemString(dict, "__doc__", doc) < 0)
+    if (module_init_dict(m, dict, name, doc) < 0)
         return -1;
     return 0;
 }
@@ -360,12 +388,15 @@
 module_dealloc(PyModuleObject *m)
 {
     PyObject_GC_UnTrack(m);
+    if (Py_VerboseFlag && m->md_name) {
+        PySys_FormatStderr("# destroy %S\n", m->md_name);
+    }
+    if (m->md_weaklist != NULL)
+        PyObject_ClearWeakRefs((PyObject *) m);
     if (m->md_def && m->md_def->m_free)
         m->md_def->m_free(m);
-    if (m->md_dict != NULL) {
-        _PyModule_Clear((PyObject *)m);
-        Py_DECREF(m->md_dict);
-    }
+    Py_XDECREF(m->md_dict);
+    Py_XDECREF(m->md_name);
     if (m->md_state != NULL)
         PyMem_FREE(m->md_state);
     Py_TYPE(m)->tp_free((PyObject *)m);
@@ -374,55 +405,10 @@
 static PyObject *
 module_repr(PyModuleObject *m)
 {
-    PyObject *name, *filename, *repr, *loader = NULL;
+    PyThreadState *tstate = PyThreadState_GET();
+    PyInterpreterState *interp = tstate->interp;
 
-    /* See if the module has an __loader__.  If it does, give the loader the
-     * first shot at producing a repr for the module.
-     */
-    if (m->md_dict != NULL) {
-        loader = PyDict_GetItemString(m->md_dict, "__loader__");
-    }
-    if (loader != NULL) {
-        repr = PyObject_CallMethod(loader, "module_repr", "(O)",
-                                   (PyObject *)m, NULL);
-        if (repr == NULL) {
-            PyErr_Clear();
-        }
-        else {
-            return repr;
-        }
-    }
-    /* __loader__.module_repr(m) did not provide us with a repr.  Next, see if
-     * the module has an __file__.  If it doesn't then use repr(__loader__) if
-     * it exists, otherwise, just use module.__name__.
-     */
-    name = PyModule_GetNameObject((PyObject *)m);
-    if (name == NULL) {
-        PyErr_Clear();
-        name = PyUnicode_FromStringAndSize("?", 1);
-        if (name == NULL)
-            return NULL;
-    }
-    filename = PyModule_GetFilenameObject((PyObject *)m);
-    if (filename == NULL) {
-        PyErr_Clear();
-        /* There's no m.__file__, so if there was an __loader__, use that in
-         * the repr, otherwise, the only thing you can use is m.__name__
-         */
-        if (loader == NULL) {
-            repr = PyUnicode_FromFormat("<module %R>", name);
-        }
-        else {
-            repr = PyUnicode_FromFormat("<module %R (%R)>", name, loader);
-        }
-    }
-    /* Finally, use m.__file__ */
-    else {
-        repr = PyUnicode_FromFormat("<module %R from %R>", name, filename);
-        Py_DECREF(filename);
-    }
-    Py_DECREF(name);
-    return repr;
+    return PyObject_CallMethod(interp->importlib, "_module_repr", "O", m);
 }
 
 static int
@@ -511,7 +497,7 @@
     (traverseproc)module_traverse,              /* tp_traverse */
     (inquiry)module_clear,                      /* tp_clear */
     0,                                          /* tp_richcompare */
-    0,                                          /* tp_weaklistoffset */
+    offsetof(PyModuleObject, md_weaklist),      /* tp_weaklistoffset */
     0,                                          /* tp_iter */
     0,                                          /* tp_iternext */
     module_methods,                             /* tp_methods */
diff --git a/Objects/namespaceobject.c b/Objects/namespaceobject.c
index ff278d3..720ac0d 100644
--- a/Objects/namespaceobject.c
+++ b/Objects/namespaceobject.c
@@ -44,7 +44,7 @@
     if (args != NULL) {
         Py_ssize_t argcount = PyObject_Size(args);
         if (argcount < 0)
-            return argcount;
+            return -1;
         else if (argcount > 0) {
             PyErr_Format(PyExc_TypeError, "no positional arguments expected");
             return -1;
@@ -66,16 +66,20 @@
 
 
 static PyObject *
-namespace_repr(_PyNamespaceObject *ns)
+namespace_repr(PyObject *ns)
 {
     int i, loop_error = 0;
     PyObject *pairs = NULL, *d = NULL, *keys = NULL, *keys_iter = NULL;
     PyObject *key;
     PyObject *separator, *pairsrepr, *repr = NULL;
+    const char * name;
 
-    i = Py_ReprEnter((PyObject *)ns);
+    name = (Py_TYPE(ns) == &_PyNamespace_Type) ? "namespace"
+                                               : ns->ob_type->tp_name;
+
+    i = Py_ReprEnter(ns);
     if (i != 0) {
-        return i > 0 ? PyUnicode_FromString("namespace(...)") : NULL;
+        return i > 0 ? PyUnicode_FromFormat("%s(...)", name) : NULL;
     }
 
     pairs = PyList_New(0);
@@ -97,7 +101,7 @@
         goto error;
 
     while ((key = PyIter_Next(keys_iter)) != NULL) {
-        if (PyUnicode_Check(key) && PyUnicode_GET_SIZE(key) > 0) {
+        if (PyUnicode_Check(key) && PyUnicode_GET_LENGTH(key) > 0) {
             PyObject *value, *item;
 
             value = PyDict_GetItem(d, key);
@@ -127,8 +131,7 @@
     if (pairsrepr == NULL)
         goto error;
 
-    repr = PyUnicode_FromFormat("%s(%S)",
-                                ((PyObject *)ns)->ob_type->tp_name, pairsrepr);
+    repr = PyUnicode_FromFormat("%s(%S)", name, pairsrepr);
     Py_DECREF(pairsrepr);
 
 error:
@@ -136,7 +139,7 @@
     Py_XDECREF(d);
     Py_XDECREF(keys);
     Py_XDECREF(keys_iter);
-    Py_ReprLeave((PyObject *)ns);
+    Py_ReprLeave(ns);
 
     return repr;
 }
@@ -158,14 +161,49 @@
 }
 
 
+static PyObject *
+namespace_richcompare(PyObject *self, PyObject *other, int op)
+{
+    if (PyObject_IsInstance(self, (PyObject *)&_PyNamespace_Type) &&
+            PyObject_IsInstance(other, (PyObject *)&_PyNamespace_Type))
+        return PyObject_RichCompare(((_PyNamespaceObject *)self)->ns_dict,
+                                   ((_PyNamespaceObject *)other)->ns_dict, op);
+    Py_INCREF(Py_NotImplemented);
+    return Py_NotImplemented;
+}
+
+
+PyDoc_STRVAR(namespace_reduce__doc__, "Return state information for pickling");
+
+static PyObject *
+namespace_reduce(_PyNamespaceObject *ns)
+{
+    PyObject *result, *args = PyTuple_New(0);
+
+    if (!args)
+        return NULL;
+
+    result = PyTuple_Pack(3, (PyObject *)Py_TYPE(ns), args, ns->ns_dict);
+    Py_DECREF(args);
+    return result;
+}
+
+
+static PyMethodDef namespace_methods[] = {
+    {"__reduce__", (PyCFunction)namespace_reduce, METH_NOARGS,
+     namespace_reduce__doc__},
+    {NULL,         NULL}  /* sentinel */
+};
+
+
 PyDoc_STRVAR(namespace_doc,
 "A simple attribute-based namespace.\n\
 \n\
-namespace(**kwargs)");
+SimpleNamespace(**kwargs)");
 
 PyTypeObject _PyNamespace_Type = {
     PyVarObject_HEAD_INIT(&PyType_Type, 0)
-    "namespace",                                /* tp_name */
+    "types.SimpleNamespace",                    /* tp_name */
     sizeof(_PyNamespaceObject),                 /* tp_size */
     0,                                          /* tp_itemsize */
     (destructor)namespace_dealloc,              /* tp_dealloc */
@@ -188,11 +226,11 @@
     namespace_doc,                              /* tp_doc */
     (traverseproc)namespace_traverse,           /* tp_traverse */
     (inquiry)namespace_clear,                   /* tp_clear */
-    0,                                          /* tp_richcompare */
+    namespace_richcompare,                      /* tp_richcompare */
     0,                                          /* tp_weaklistoffset */
     0,                                          /* tp_iter */
     0,                                          /* tp_iternext */
-    0,                                          /* tp_methods */
+    namespace_methods,                          /* tp_methods */
     namespace_members,                          /* tp_members */
     0,                                          /* tp_getset */
     0,                                          /* tp_base */
diff --git a/Objects/object.c b/Objects/object.c
index e079d51..a1a69fa 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -8,6 +8,12 @@
 extern "C" {
 #endif
 
+_Py_IDENTIFIER(Py_Repr);
+_Py_IDENTIFIER(__bytes__);
+_Py_IDENTIFIER(__dir__);
+_Py_IDENTIFIER(__isabstractmethod__);
+_Py_IDENTIFIER(builtins);
+
 #ifdef Py_REF_DEBUG
 Py_ssize_t _Py_RefTotal;
 
@@ -22,7 +28,7 @@
     o = _PyDict_Dummy();
     if (o != NULL)
         total -= o->ob_refcnt;
-    o = _PySet_Dummy();
+    o = _PySet_Dummy;
     if (o != NULL)
         total -= o->ob_refcnt;
     return total;
@@ -255,6 +261,72 @@
     return PyObject_INIT_VAR(op, tp, nitems);
 }
 
+void
+PyObject_CallFinalizer(PyObject *self)
+{
+    PyTypeObject *tp = Py_TYPE(self);
+
+    /* The former could happen on heaptypes created from the C API, e.g.
+       PyType_FromSpec(). */
+    if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_FINALIZE) ||
+        tp->tp_finalize == NULL)
+        return;
+    /* tp_finalize should only be called once. */
+    if (PyType_IS_GC(tp) && _PyGC_FINALIZED(self))
+        return;
+
+    tp->tp_finalize(self);
+    if (PyType_IS_GC(tp))
+        _PyGC_SET_FINALIZED(self, 1);
+}
+
+int
+PyObject_CallFinalizerFromDealloc(PyObject *self)
+{
+    Py_ssize_t refcnt;
+
+    /* Temporarily resurrect the object. */
+    if (self->ob_refcnt != 0) {
+        Py_FatalError("PyObject_CallFinalizerFromDealloc called on "
+                      "object with a non-zero refcount");
+    }
+    self->ob_refcnt = 1;
+
+    PyObject_CallFinalizer(self);
+
+    /* Undo the temporary resurrection; can't use DECREF here, it would
+     * cause a recursive call.
+     */
+    assert(self->ob_refcnt > 0);
+    if (--self->ob_refcnt == 0)
+        return 0;         /* this is the normal path out */
+
+    /* tp_finalize resurrected it!  Make it look like the original Py_DECREF
+     * never happened.
+     */
+    refcnt = self->ob_refcnt;
+    _Py_NewReference(self);
+    self->ob_refcnt = refcnt;
+
+    if (PyType_IS_GC(Py_TYPE(self))) {
+        assert(_PyGC_REFS(self) != _PyGC_REFS_UNTRACKED);
+    }
+    /* If Py_REF_DEBUG, _Py_NewReference bumped _Py_RefTotal, so
+     * we need to undo that. */
+    _Py_DEC_REFTOTAL;
+    /* If Py_TRACE_REFS, _Py_NewReference re-added self to the object
+     * chain, so no more to do there.
+     * If COUNT_ALLOCS, the original decref bumped tp_frees, and
+     * _Py_NewReference bumped tp_allocs:  both of those need to be
+     * undone.
+     */
+#ifdef COUNT_ALLOCS
+    --Py_TYPE(self)->tp_frees;
+    --Py_TYPE(self)->tp_allocs;
+#endif
+    return -1;
+}
+
 int
 PyObject_Print(PyObject *op, FILE *fp, int flags)
 {
@@ -340,11 +412,17 @@
 #ifdef WITH_THREAD
         PyGILState_STATE gil;
 #endif
+        PyObject *error_type, *error_value, *error_traceback;
+
         fprintf(stderr, "object  : ");
 #ifdef WITH_THREAD
         gil = PyGILState_Ensure();
 #endif
+
+        PyErr_Fetch(&error_type, &error_value, &error_traceback);
         (void)PyObject_Print(op, stderr, 0);
+        PyErr_Restore(error_type, error_value, error_traceback);
+
 #ifdef WITH_THREAD
         PyGILState_Release(gil);
 #endif
@@ -377,6 +455,14 @@
     if (Py_TYPE(v)->tp_repr == NULL)
         return PyUnicode_FromFormat("<%s object at %p>",
                                     v->ob_type->tp_name, v);
+
+#ifdef Py_DEBUG
+    /* PyObject_Repr() must not be called with an exception set,
+       because it may clear it (directly or indirectly) and so the
+       caller looses its exception */
+    assert(!PyErr_Occurred());
+#endif
+
     res = (*v->ob_type->tp_repr)(v);
     if (res == NULL)
         return NULL;
@@ -419,6 +505,13 @@
     if (Py_TYPE(v)->tp_str == NULL)
         return PyObject_Repr(v);
 
+#ifdef Py_DEBUG
+    /* PyObject_Str() must not be called with an exception set,
+       because it may clear it (directly or indirectly) and so the
+       caller loses its exception */
+    assert(!PyErr_Occurred());
+#endif
+
     /* It is possible for a type to have a tp_str representation that loops
        infinitely. */
     if (Py_EnterRecursiveCall(" while getting the str of an object"))
@@ -451,6 +544,9 @@
     if (repr == NULL)
         return NULL;
 
+    if (PyUnicode_IS_ASCII(repr))
+        return repr;
+
     /* repr is guaranteed to be a PyUnicode object by PyObject_Repr */
     ascii = _PyUnicode_AsASCIIString(repr, "backslashreplace");
     Py_DECREF(repr);
@@ -470,7 +566,6 @@
 PyObject_Bytes(PyObject *v)
 {
     PyObject *result, *func;
-    _Py_IDENTIFIER(__bytes__);
 
     if (v == NULL)
         return PyBytes_FromString("<NULL>");
@@ -636,150 +731,6 @@
     return ok;
 }
 
-/* Set of hash utility functions to help maintaining the invariant that
-    if a==b then hash(a)==hash(b)
-
-   All the utility functions (_Py_Hash*()) return "-1" to signify an error.
-*/
-
-/* For numeric types, the hash of a number x is based on the reduction
-   of x modulo the prime P = 2**_PyHASH_BITS - 1.  It's designed so that
-   hash(x) == hash(y) whenever x and y are numerically equal, even if
-   x and y have different types.
-
-   A quick summary of the hashing strategy:
-
-   (1) First define the 'reduction of x modulo P' for any rational
-   number x; this is a standard extension of the usual notion of
-   reduction modulo P for integers.  If x == p/q (written in lowest
-   terms), the reduction is interpreted as the reduction of p times
-   the inverse of the reduction of q, all modulo P; if q is exactly
-   divisible by P then define the reduction to be infinity.  So we've
-   got a well-defined map
-
-      reduce : { rational numbers } -> { 0, 1, 2, ..., P-1, infinity }.
-
-   (2) Now for a rational number x, define hash(x) by:
-
-      reduce(x)   if x >= 0
-      -reduce(-x) if x < 0
-
-   If the result of the reduction is infinity (this is impossible for
-   integers, floats and Decimals) then use the predefined hash value
-   _PyHASH_INF for x >= 0, or -_PyHASH_INF for x < 0, instead.
-   _PyHASH_INF, -_PyHASH_INF and _PyHASH_NAN are also used for the
-   hashes of float and Decimal infinities and nans.
-
-   A selling point for the above strategy is that it makes it possible
-   to compute hashes of decimal and binary floating-point numbers
-   efficiently, even if the exponent of the binary or decimal number
-   is large.  The key point is that
-
-      reduce(x * y) == reduce(x) * reduce(y) (modulo _PyHASH_MODULUS)
-
-   provided that {reduce(x), reduce(y)} != {0, infinity}.  The reduction of a
-   binary or decimal float is never infinity, since the denominator is a power
-   of 2 (for binary) or a divisor of a power of 10 (for decimal).  So we have,
-   for nonnegative x,
-
-      reduce(x * 2**e) == reduce(x) * reduce(2**e) % _PyHASH_MODULUS
-
-      reduce(x * 10**e) == reduce(x) * reduce(10**e) % _PyHASH_MODULUS
-
-   and reduce(10**e) can be computed efficiently by the usual modular
-   exponentiation algorithm.  For reduce(2**e) it's even better: since
-   P is of the form 2**n-1, reduce(2**e) is 2**(e mod n), and multiplication
-   by 2**(e mod n) modulo 2**n-1 just amounts to a rotation of bits.
-
-   */
-
-Py_hash_t
-_Py_HashDouble(double v)
-{
-    int e, sign;
-    double m;
-    Py_uhash_t x, y;
-
-    if (!Py_IS_FINITE(v)) {
-        if (Py_IS_INFINITY(v))
-            return v > 0 ? _PyHASH_INF : -_PyHASH_INF;
-        else
-            return _PyHASH_NAN;
-    }
-
-    m = frexp(v, &e);
-
-    sign = 1;
-    if (m < 0) {
-        sign = -1;
-        m = -m;
-    }
-
-    /* process 28 bits at a time;  this should work well both for binary
-       and hexadecimal floating point. */
-    x = 0;
-    while (m) {
-        x = ((x << 28) & _PyHASH_MODULUS) | x >> (_PyHASH_BITS - 28);
-        m *= 268435456.0;  /* 2**28 */
-        e -= 28;
-        y = (Py_uhash_t)m;  /* pull out integer part */
-        m -= y;
-        x += y;
-        if (x >= _PyHASH_MODULUS)
-            x -= _PyHASH_MODULUS;
-    }
-
-    /* adjust for the exponent;  first reduce it modulo _PyHASH_BITS */
-    e = e >= 0 ? e % _PyHASH_BITS : _PyHASH_BITS-1-((-1-e) % _PyHASH_BITS);
-    x = ((x << e) & _PyHASH_MODULUS) | x >> (_PyHASH_BITS - e);
-
-    x = x * sign;
-    if (x == (Py_uhash_t)-1)
-        x = (Py_uhash_t)-2;
-    return (Py_hash_t)x;
-}
-
-Py_hash_t
-_Py_HashPointer(void *p)
-{
-    Py_hash_t x;
-    size_t y = (size_t)p;
-    /* bottom 3 or 4 bits are likely to be 0; rotate y by 4 to avoid
-       excessive hash collisions for dicts and sets */
-    y = (y >> 4) | (y << (8 * SIZEOF_VOID_P - 4));
-    x = (Py_hash_t)y;
-    if (x == -1)
-        x = -2;
-    return x;
-}
-
-Py_hash_t
-_Py_HashBytes(unsigned char *p, Py_ssize_t len)
-{
-    Py_uhash_t x;
-    Py_ssize_t i;
-
-    /*
-      We make the hash of the empty string be 0, rather than using
-      (prefix ^ suffix), since this slightly obfuscates the hash secret
-    */
-#ifdef Py_DEBUG
-    assert(_Py_HashSecret_Initialized);
-#endif
-    if (len == 0) {
-        return 0;
-    }
-    x = (Py_uhash_t) _Py_HashSecret.prefix;
-    x ^= (Py_uhash_t) *p << 7;
-    for (i = 0; i < len; i++)
-        x = (_PyHASH_MULTIPLIER * x) ^ (Py_uhash_t) *p++;
-    x ^= (Py_uhash_t) len;
-    x ^= (Py_uhash_t) _Py_HashSecret.suffix;
-    if (x == -1)
-        x = -2;
-    return x;
-}
-
 Py_hash_t
 PyObject_HashNotImplemented(PyObject *v)
 {
@@ -788,8 +739,6 @@
     return -1;
 }
 
-_Py_HashSecret_t _Py_HashSecret;
-
 Py_hash_t
 PyObject_Hash(PyObject *v)
 {
@@ -859,7 +808,6 @@
 {
     int res;
     PyObject* isabstract;
-    _Py_IDENTIFIER(__isabstractmethod__);
 
     if (obj == NULL)
         return 0;
@@ -1032,8 +980,12 @@
 PyObject *
 _PyObject_GetBuiltin(const char *name)
 {
-    PyObject *mod, *attr;
-    mod = PyImport_ImportModule("builtins");
+    PyObject *mod_name, *mod, *attr;
+
+    mod_name = _PyUnicode_FromId(&PyId_builtins);   /* borrowed */
+    if (mod_name == NULL)
+        return NULL;
+    mod = PyImport_Import(mod_name);
     if (mod == NULL)
         return NULL;
     attr = PyObject_GetAttrString(mod, name);
@@ -1317,12 +1269,11 @@
 _dir_locals(void)
 {
     PyObject *names;
-    PyObject *locals = PyEval_GetLocals();
+    PyObject *locals;
 
-    if (locals == NULL) {
-        PyErr_SetString(PyExc_SystemError, "frame does not exist");
+    locals = PyEval_GetLocals();
+    if (locals == NULL)
         return NULL;
-    }
 
     names = PyMapping_Keys(locals);
     if (!names)
@@ -1347,7 +1298,6 @@
 _dir_object(PyObject *obj)
 {
     PyObject *result, *sorted;
-    _Py_IDENTIFIER(__dir__);
     PyObject *dirfunc = _PyObject_LookupSpecial(obj, &PyId___dir__);
 
     assert(obj);
@@ -1515,6 +1465,17 @@
 }
 
 static PyObject *
+NotImplemented_reduce(PyObject *op)
+{
+    return PyUnicode_FromString("NotImplemented");
+}
+
+static PyMethodDef notimplemented_methods[] = {
+    {"__reduce__", (PyCFunction)NotImplemented_reduce, METH_NOARGS, NULL},
+    {NULL, NULL}
+};
+
+static PyObject *
 notimplemented_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
 {
     if (PyTuple_GET_SIZE(args) || (kwargs && PyDict_Size(kwargs))) {
@@ -1524,12 +1485,21 @@
     Py_RETURN_NOTIMPLEMENTED;
 }
 
+static void
+notimplemented_dealloc(PyObject* ignore)
+{
+    /* This should never get called, but we also don't want to SEGV if
+     * we accidentally decref NotImplemented out of existence.
+     */
+    Py_FatalError("deallocating NotImplemented");
+}
+
 PyTypeObject _PyNotImplemented_Type = {
     PyVarObject_HEAD_INIT(&PyType_Type, 0)
     "NotImplementedType",
     0,
     0,
-    none_dealloc,       /*tp_dealloc*/ /*never called*/
+    notimplemented_dealloc,       /*tp_dealloc*/ /*never called*/
     0,                  /*tp_print*/
     0,                  /*tp_getattr*/
     0,                  /*tp_setattr*/
@@ -1552,7 +1522,7 @@
     0,                  /*tp_weaklistoffset */
     0,                  /*tp_iter */
     0,                  /*tp_iternext */
-    0,                  /*tp_methods */
+    notimplemented_methods, /*tp_methods */
     0,                  /*tp_members */
     0,                  /*tp_getset */
     0,                  /*tp_base */
@@ -1699,15 +1669,6 @@
     if (PyType_Ready(&PyMemberDescr_Type) < 0)
         Py_FatalError("Can't initialize member descriptor type");
 
-    if (PyType_Ready(&PyFilter_Type) < 0)
-        Py_FatalError("Can't initialize filter type");
-
-    if (PyType_Ready(&PyMap_Type) < 0)
-        Py_FatalError("Can't initialize map type");
-
-    if (PyType_Ready(&PyZip_Type) < 0)
-        Py_FatalError("Can't initialize zip type");
-
     if (PyType_Ready(&_PyNamespace_Type) < 0)
         Py_FatalError("Can't initialize namespace type");
 
@@ -1749,10 +1710,10 @@
 }
 
 void
-_Py_ForgetReference(register PyObject *op)
+_Py_ForgetReference(PyObject *op)
 {
 #ifdef SLOW_UNREF_CHECK
-    register PyObject *p;
+    PyObject *p;
 #endif
     if (op->ob_refcnt < 0)
         Py_FatalError("UNREF negative refcnt");
@@ -1856,26 +1817,6 @@
 Py_ssize_t (*_Py_abstract_hack)(PyObject *) = PyObject_Size;
 
 
-/* Python's malloc wrappers (see pymem.h) */
-
-void *
-PyMem_Malloc(size_t nbytes)
-{
-    return PyMem_MALLOC(nbytes);
-}
-
-void *
-PyMem_Realloc(void *p, size_t nbytes)
-{
-    return PyMem_REALLOC(p, nbytes);
-}
-
-void
-PyMem_Free(void *p)
-{
-    PyMem_FREE(p);
-}
-
 void
 _PyObject_DebugTypeStats(FILE *out)
 {
@@ -1885,7 +1826,6 @@
     _PyFrame_DebugMallocStats(out);
     _PyList_DebugMallocStats(out);
     _PyMethod_DebugMallocStats(out);
-    _PySet_DebugMallocStats(out);
     _PyTuple_DebugMallocStats(out);
 }
 
@@ -1901,8 +1841,6 @@
    See dictobject.c and listobject.c for examples of use.
 */
 
-#define KEY "Py_Repr"
-
 int
 Py_ReprEnter(PyObject *obj)
 {
@@ -1911,14 +1849,16 @@
     Py_ssize_t i;
 
     dict = PyThreadState_GetDict();
+    /* Ignore a missing thread-state, so that this function can be called
+       early on startup. */
     if (dict == NULL)
         return 0;
-    list = PyDict_GetItemString(dict, KEY);
+    list = _PyDict_GetItemId(dict, &PyId_Py_Repr);
     if (list == NULL) {
         list = PyList_New(0);
         if (list == NULL)
             return -1;
-        if (PyDict_SetItemString(dict, KEY, list) < 0)
+        if (_PyDict_SetItemId(dict, &PyId_Py_Repr, list) < 0)
             return -1;
         Py_DECREF(list);
     }
@@ -1927,7 +1867,8 @@
         if (PyList_GET_ITEM(list, i) == obj)
             return 1;
     }
-    PyList_Append(list, obj);
+    if (PyList_Append(list, obj) < 0)
+        return -1;
     return 0;
 }
 
@@ -1937,13 +1878,18 @@
     PyObject *dict;
     PyObject *list;
     Py_ssize_t i;
+    PyObject *error_type, *error_value, *error_traceback;
+
+    PyErr_Fetch(&error_type, &error_value, &error_traceback);
 
     dict = PyThreadState_GetDict();
     if (dict == NULL)
-        return;
-    list = PyDict_GetItemString(dict, KEY);
+        goto finally;
+
+    list = _PyDict_GetItemId(dict, &PyId_Py_Repr);
     if (list == NULL || !PyList_Check(list))
-        return;
+        goto finally;
+
     i = PyList_GET_SIZE(list);
     /* Count backwards because we always expect obj to be list[-1] */
     while (--i >= 0) {
@@ -1952,6 +1898,10 @@
             break;
         }
     }
+
+finally:
+    /* ignore exceptions because there is no way to report them. */
+    PyErr_Restore(error_type, error_value, error_traceback);
 }
 
 /* Trashcan support. */
@@ -1972,7 +1922,7 @@
 _PyTrash_deposit_object(PyObject *op)
 {
     assert(PyObject_IS_GC(op));
-    assert(_Py_AS_GC(op)->gc.gc_refs == _PyGC_REFS_UNTRACKED);
+    assert(_PyGC_REFS(op) == _PyGC_REFS_UNTRACKED);
     assert(op->ob_refcnt == 0);
     _Py_AS_GC(op)->gc.gc_prev = (PyGC_Head *)_PyTrash_delete_later;
     _PyTrash_delete_later = op;
@@ -1984,7 +1934,7 @@
 {
     PyThreadState *tstate = PyThreadState_GET();
     assert(PyObject_IS_GC(op));
-    assert(_Py_AS_GC(op)->gc.gc_refs == _PyGC_REFS_UNTRACKED);
+    assert(_PyGC_REFS(op) == _PyGC_REFS_UNTRACKED);
     assert(op->ob_refcnt == 0);
     _Py_AS_GC(op)->gc.gc_prev = (PyGC_Head *) tstate->trash_delete_later;
     tstate->trash_delete_later = op;
diff --git a/Objects/obmalloc.c b/Objects/obmalloc.c
index c261b68..3c33255 100644
--- a/Objects/obmalloc.c
+++ b/Objects/obmalloc.c
@@ -1,14 +1,374 @@
 #include "Python.h"
 
-#ifdef WITH_PYMALLOC
+/* Python's malloc wrappers (see pymem.h) */
 
-#ifdef HAVE_MMAP
- #include <sys/mman.h>
- #ifdef MAP_ANONYMOUS
-  #define ARENAS_USE_MMAP
+#ifdef PYMALLOC_DEBUG   /* WITH_PYMALLOC && PYMALLOC_DEBUG */
+/* Forward declaration */
+static void* _PyMem_DebugMalloc(void *ctx, size_t size);
+static void _PyMem_DebugFree(void *ctx, void *p);
+static void* _PyMem_DebugRealloc(void *ctx, void *ptr, size_t size);
+
+static void _PyObject_DebugDumpAddress(const void *p);
+static void _PyMem_DebugCheckAddress(char api_id, const void *p);
+#endif
+
+#if defined(__has_feature)  /* Clang */
+ #if __has_feature(address_sanitizer)  /* is ASAN enabled? */
+  #define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS \
+        __attribute__((no_address_safety_analysis)) \
+        __attribute__ ((noinline))
+ #else
+  #define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS
+ #endif
+#else
+ #if defined(__SANITIZE_ADDRESS__)  /* GCC 4.8.x, is ASAN enabled? */
+  #define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS \
+        __attribute__((no_address_safety_analysis)) \
+        __attribute__ ((noinline))
+ #else
+  #define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS
  #endif
 #endif
 
+#ifdef WITH_PYMALLOC
+
+#ifdef MS_WINDOWS
+#  include <windows.h>
+#elif defined(HAVE_MMAP)
+#  include <sys/mman.h>
+#  ifdef MAP_ANONYMOUS
+#    define ARENAS_USE_MMAP
+#  endif
+#endif
+
+/* Forward declaration */
+static void* _PyObject_Malloc(void *ctx, size_t size);
+static void _PyObject_Free(void *ctx, void *p);
+static void* _PyObject_Realloc(void *ctx, void *ptr, size_t size);
+#endif
+
+
+static void *
+_PyMem_RawMalloc(void *ctx, size_t size)
+{
+    /* PyMem_Malloc(0) means malloc(1). Some systems would return NULL
+       for malloc(0), which would be treated as an error. Some platforms would
+       return a pointer with no memory behind it, which would break pymalloc.
+       To solve these problems, allocate an extra byte. */
+    if (size == 0)
+        size = 1;
+    return malloc(size);
+}
+
+static void *
+_PyMem_RawRealloc(void *ctx, void *ptr, size_t size)
+{
+    if (size == 0)
+        size = 1;
+    return realloc(ptr, size);
+}
+
+static void
+_PyMem_RawFree(void *ctx, void *ptr)
+{
+    free(ptr);
+}
+
+
+#ifdef MS_WINDOWS
+static void *
+_PyObject_ArenaVirtualAlloc(void *ctx, size_t size)
+{
+    return VirtualAlloc(NULL, size,
+                        MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
+}
+
+static void
+_PyObject_ArenaVirtualFree(void *ctx, void *ptr, size_t size)
+{
+    VirtualFree(ptr, 0, MEM_RELEASE);
+}
+
+#elif defined(ARENAS_USE_MMAP)
+static void *
+_PyObject_ArenaMmap(void *ctx, size_t size)
+{
+    void *ptr;
+    ptr = mmap(NULL, size, PROT_READ|PROT_WRITE,
+               MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
+    if (ptr == MAP_FAILED)
+        return NULL;
+    assert(ptr != NULL);
+    return ptr;
+}
+
+static void
+_PyObject_ArenaMunmap(void *ctx, void *ptr, size_t size)
+{
+    munmap(ptr, size);
+}
+
+#else
+static void *
+_PyObject_ArenaMalloc(void *ctx, size_t size)
+{
+    return malloc(size);
+}
+
+static void
+_PyObject_ArenaFree(void *ctx, void *ptr, size_t size)
+{
+    free(ptr);
+}
+#endif
+
+
+#define PYRAW_FUNCS _PyMem_RawMalloc, _PyMem_RawRealloc, _PyMem_RawFree
+#ifdef WITH_PYMALLOC
+#  define PYOBJ_FUNCS _PyObject_Malloc, _PyObject_Realloc, _PyObject_Free
+#else
+#  define PYOBJ_FUNCS PYRAW_FUNCS
+#endif
+#define PYMEM_FUNCS PYRAW_FUNCS
+
+#ifdef PYMALLOC_DEBUG
+typedef struct {
+    /* We tag each block with an API ID in order to tag API violations */
+    char api_id;
+    PyMemAllocator alloc;
+} debug_alloc_api_t;
+static struct {
+    debug_alloc_api_t raw;
+    debug_alloc_api_t mem;
+    debug_alloc_api_t obj;
+} _PyMem_Debug = {
+    {'r', {NULL, PYRAW_FUNCS}},
+    {'m', {NULL, PYMEM_FUNCS}},
+    {'o', {NULL, PYOBJ_FUNCS}}
+    };
+
+#define PYDBG_FUNCS _PyMem_DebugMalloc, _PyMem_DebugRealloc, _PyMem_DebugFree
+#endif
+
+static PyMemAllocator _PyMem_Raw = {
+#ifdef PYMALLOC_DEBUG
+    &_PyMem_Debug.raw, PYDBG_FUNCS
+#else
+    NULL, PYRAW_FUNCS
+#endif
+    };
+
+static PyMemAllocator _PyMem = {
+#ifdef PYMALLOC_DEBUG
+    &_PyMem_Debug.mem, PYDBG_FUNCS
+#else
+    NULL, PYMEM_FUNCS
+#endif
+    };
+
+static PyMemAllocator _PyObject = {
+#ifdef PYMALLOC_DEBUG
+    &_PyMem_Debug.obj, PYDBG_FUNCS
+#else
+    NULL, PYOBJ_FUNCS
+#endif
+    };
+
+#undef PYRAW_FUNCS
+#undef PYMEM_FUNCS
+#undef PYOBJ_FUNCS
+#undef PYDBG_FUNCS
+
+static PyObjectArenaAllocator _PyObject_Arena = {NULL,
+#ifdef MS_WINDOWS
+    _PyObject_ArenaVirtualAlloc, _PyObject_ArenaVirtualFree
+#elif defined(ARENAS_USE_MMAP)
+    _PyObject_ArenaMmap, _PyObject_ArenaMunmap
+#else
+    _PyObject_ArenaMalloc, _PyObject_ArenaFree
+#endif
+    };
+
+void
+PyMem_SetupDebugHooks(void)
+{
+#ifdef PYMALLOC_DEBUG
+    PyMemAllocator alloc;
+
+    alloc.malloc = _PyMem_DebugMalloc;
+    alloc.realloc = _PyMem_DebugRealloc;
+    alloc.free = _PyMem_DebugFree;
+
+    if (_PyMem_Raw.malloc != _PyMem_DebugMalloc) {
+        alloc.ctx = &_PyMem_Debug.raw;
+        PyMem_GetAllocator(PYMEM_DOMAIN_RAW, &_PyMem_Debug.raw.alloc);
+        PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &alloc);
+    }
+
+    if (_PyMem.malloc != _PyMem_DebugMalloc) {
+        alloc.ctx = &_PyMem_Debug.mem;
+        PyMem_GetAllocator(PYMEM_DOMAIN_MEM, &_PyMem_Debug.mem.alloc);
+        PyMem_SetAllocator(PYMEM_DOMAIN_MEM, &alloc);
+    }
+
+    if (_PyObject.malloc != _PyMem_DebugMalloc) {
+        alloc.ctx = &_PyMem_Debug.obj;
+        PyMem_GetAllocator(PYMEM_DOMAIN_OBJ, &_PyMem_Debug.obj.alloc);
+        PyMem_SetAllocator(PYMEM_DOMAIN_OBJ, &alloc);
+    }
+#endif
+}
+
+void
+PyMem_GetAllocator(PyMemAllocatorDomain domain, PyMemAllocator *allocator)
+{
+    switch(domain)
+    {
+    case PYMEM_DOMAIN_RAW: *allocator = _PyMem_Raw; break;
+    case PYMEM_DOMAIN_MEM: *allocator = _PyMem; break;
+    case PYMEM_DOMAIN_OBJ: *allocator = _PyObject; break;
+    default:
+        /* unknown domain */
+        allocator->ctx = NULL;
+        allocator->malloc = NULL;
+        allocator->realloc = NULL;
+        allocator->free = NULL;
+    }
+}
+
+void
+PyMem_SetAllocator(PyMemAllocatorDomain domain, PyMemAllocator *allocator)
+{
+    switch(domain)
+    {
+    case PYMEM_DOMAIN_RAW: _PyMem_Raw = *allocator; break;
+    case PYMEM_DOMAIN_MEM: _PyMem = *allocator; break;
+    case PYMEM_DOMAIN_OBJ: _PyObject = *allocator; break;
+    /* ignore unknown domain */
+    }
+
+}
+
+void
+PyObject_GetArenaAllocator(PyObjectArenaAllocator *allocator)
+{
+    *allocator = _PyObject_Arena;
+}
+
+void
+PyObject_SetArenaAllocator(PyObjectArenaAllocator *allocator)
+{
+    _PyObject_Arena = *allocator;
+}
+
+void *
+PyMem_RawMalloc(size_t size)
+{
+    /*
+     * Limit ourselves to PY_SSIZE_T_MAX bytes to prevent security holes.
+     * Most python internals blindly use a signed Py_ssize_t to track
+     * things without checking for overflows or negatives.
+     * As size_t is unsigned, checking for size < 0 is not required.
+     */
+    if (size > (size_t)PY_SSIZE_T_MAX)
+        return NULL;
+
+    return _PyMem_Raw.malloc(_PyMem_Raw.ctx, size);
+}
+
+void*
+PyMem_RawRealloc(void *ptr, size_t new_size)
+{
+    /* see PyMem_RawMalloc() */
+    if (new_size > (size_t)PY_SSIZE_T_MAX)
+        return NULL;
+    return _PyMem_Raw.realloc(_PyMem_Raw.ctx, ptr, new_size);
+}
+
+void PyMem_RawFree(void *ptr)
+{
+    _PyMem_Raw.free(_PyMem_Raw.ctx, ptr);
+}
+
+void *
+PyMem_Malloc(size_t size)
+{
+    /* see PyMem_RawMalloc() */
+    if (size > (size_t)PY_SSIZE_T_MAX)
+        return NULL;
+    return _PyMem.malloc(_PyMem.ctx, size);
+}
+
+void *
+PyMem_Realloc(void *ptr, size_t new_size)
+{
+    /* see PyMem_RawMalloc() */
+    if (new_size > (size_t)PY_SSIZE_T_MAX)
+        return NULL;
+    return _PyMem.realloc(_PyMem.ctx, ptr, new_size);
+}
+
+void
+PyMem_Free(void *ptr)
+{
+    _PyMem.free(_PyMem.ctx, ptr);
+}
+
+char *
+_PyMem_RawStrdup(const char *str)
+{
+    size_t size;
+    char *copy;
+
+    size = strlen(str) + 1;
+    copy = PyMem_RawMalloc(size);
+    if (copy == NULL)
+        return NULL;
+    memcpy(copy, str, size);
+    return copy;
+}
+
+char *
+_PyMem_Strdup(const char *str)
+{
+    size_t size;
+    char *copy;
+
+    size = strlen(str) + 1;
+    copy = PyMem_Malloc(size);
+    if (copy == NULL)
+        return NULL;
+    memcpy(copy, str, size);
+    return copy;
+}
+
+void *
+PyObject_Malloc(size_t size)
+{
+    /* see PyMem_RawMalloc() */
+    if (size > (size_t)PY_SSIZE_T_MAX)
+        return NULL;
+    return _PyObject.malloc(_PyObject.ctx, size);
+}
+
+void *
+PyObject_Realloc(void *ptr, size_t new_size)
+{
+    /* see PyMem_RawMalloc() */
+    if (new_size > (size_t)PY_SSIZE_T_MAX)
+        return NULL;
+    return _PyObject.realloc(_PyObject.ctx, ptr, new_size);
+}
+
+void
+PyObject_Free(void *ptr)
+{
+    _PyObject.free(_PyObject.ctx, ptr);
+}
+
+
+#ifdef WITH_PYMALLOC
+
 #ifdef WITH_VALGRIND
 #include <valgrind/valgrind.h>
 
@@ -525,6 +885,15 @@
 /* High water mark (max value ever seen) for narenas_currently_allocated. */
 static size_t narenas_highwater = 0;
 
+static Py_ssize_t _Py_AllocatedBlocks = 0;
+
+Py_ssize_t
+_Py_GetAllocatedBlocks(void)
+{
+    return _Py_AllocatedBlocks;
+}
+
+
 /* Allocate a new arena.  If we run out of memory, return NULL.  Else
  * allocate a new arena, and return the address of an arena_object
  * describing the new arena.  It's expected that the caller will set
@@ -536,7 +905,6 @@
     struct arena_object* arenaobj;
     uint excess;        /* number of bytes above pool alignment */
     void *address;
-    int err;
 
 #ifdef PYMALLOC_DEBUG
     if (Py_GETENV("PYTHONMALLOCSTATS"))
@@ -558,7 +926,7 @@
             return NULL;                /* overflow */
 #endif
         nbytes = numarenas * sizeof(*arenas);
-        arenaobj = (struct arena_object *)realloc(arenas, nbytes);
+        arenaobj = (struct arena_object *)PyMem_RawRealloc(arenas, nbytes);
         if (arenaobj == NULL)
             return NULL;
         arenas = arenaobj;
@@ -589,15 +957,8 @@
     arenaobj = unused_arena_objects;
     unused_arena_objects = arenaobj->nextarena;
     assert(arenaobj->address == 0);
-#ifdef ARENAS_USE_MMAP
-    address = mmap(NULL, ARENA_SIZE, PROT_READ|PROT_WRITE,
-                                   MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
-    err = (address == MAP_FAILED);
-#else
-    address = malloc(ARENA_SIZE);
-    err = (address == 0);
-#endif
-    if (err) {
+    address = _PyObject_Arena.alloc(_PyObject_Arena.ctx, ARENA_SIZE);
+    if (address == NULL) {
         /* The allocation failed: return NULL after putting the
          * arenaobj back.
          */
@@ -760,15 +1121,16 @@
  * Unless the optimizer reorders everything, being too smart...
  */
 
-#undef PyObject_Malloc
-void *
-PyObject_Malloc(size_t nbytes)
+static void *
+_PyObject_Malloc(void *ctx, size_t nbytes)
 {
     block *bp;
     poolp pool;
     poolp next;
     uint size;
 
+    _Py_AllocatedBlocks++;
+
 #ifdef WITH_VALGRIND
     if (UNLIKELY(running_on_valgrind == -1))
         running_on_valgrind = RUNNING_ON_VALGRIND;
@@ -777,15 +1139,6 @@
 #endif
 
     /*
-     * Limit ourselves to PY_SSIZE_T_MAX bytes to prevent security holes.
-     * Most python internals blindly use a signed Py_ssize_t to track
-     * things without checking for overflows or negatives.
-     * As size_t is unsigned, checking for nbytes < 0 is not required.
-     */
-    if (nbytes > PY_SSIZE_T_MAX)
-        return NULL;
-
-    /*
      * This implicitly redirects malloc(0).
      */
     if ((nbytes - 1) < SMALL_REQUEST_THRESHOLD) {
@@ -901,6 +1254,7 @@
                  * and free list are already initialized.
                  */
                 bp = pool->freeblock;
+                assert(bp != NULL);
                 pool->freeblock = *(block **)bp;
                 UNLOCK();
                 return (void *)bp;
@@ -956,16 +1310,19 @@
      * last chance to serve the request) or when the max memory limit
      * has been reached.
      */
-    if (nbytes == 0)
-        nbytes = 1;
-    return (void *)malloc(nbytes);
+    {
+        void *result = PyMem_RawMalloc(nbytes);
+        if (!result)
+            _Py_AllocatedBlocks--;
+        return result;
+    }
 }
 
 /* free */
 
-#undef PyObject_Free
-void
-PyObject_Free(void *p)
+ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS
+static void
+_PyObject_Free(void *ctx, void *p)
 {
     poolp pool;
     block *lastfree;
@@ -978,6 +1335,8 @@
     if (p == NULL)      /* free(NULL) has no effect */
         return;
 
+    _Py_AllocatedBlocks--;
+
 #ifdef WITH_VALGRIND
     if (UNLIKELY(running_on_valgrind > 0))
         goto redirect;
@@ -1072,11 +1431,8 @@
                 unused_arena_objects = ao;
 
                 /* Free the entire arena. */
-#ifdef ARENAS_USE_MMAP
-                munmap((void *)ao->address, ARENA_SIZE);
-#else
-                free((void *)ao->address);
-#endif
+                _PyObject_Arena.free(_PyObject_Arena.ctx,
+                                     (void *)ao->address, ARENA_SIZE);
                 ao->address = 0;                        /* mark unassociated */
                 --narenas_currently_allocated;
 
@@ -1185,7 +1541,7 @@
 redirect:
 #endif
     /* We didn't allocate this address. */
-    free(p);
+    PyMem_RawFree(p);
 }
 
 /* realloc.  If p is NULL, this acts like malloc(nbytes).  Else if nbytes==0,
@@ -1193,9 +1549,9 @@
  * return a non-NULL result.
  */
 
-#undef PyObject_Realloc
-void *
-PyObject_Realloc(void *p, size_t nbytes)
+ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS
+static void *
+_PyObject_Realloc(void *ctx, void *p, size_t nbytes)
 {
     void *bp;
     poolp pool;
@@ -1205,16 +1561,7 @@
 #endif
 
     if (p == NULL)
-        return PyObject_Malloc(nbytes);
-
-    /*
-     * Limit ourselves to PY_SSIZE_T_MAX bytes to prevent security holes.
-     * Most python internals blindly use a signed Py_ssize_t to track
-     * things without checking for overflows or negatives.
-     * As size_t is unsigned, checking for nbytes < 0 is not required.
-     */
-    if (nbytes > PY_SSIZE_T_MAX)
-        return NULL;
+        return _PyObject_Malloc(ctx, nbytes);
 
 #ifdef WITH_VALGRIND
     /* Treat running_on_valgrind == -1 the same as 0 */
@@ -1242,10 +1589,10 @@
             }
             size = nbytes;
         }
-        bp = PyObject_Malloc(nbytes);
+        bp = _PyObject_Malloc(ctx, nbytes);
         if (bp != NULL) {
             memcpy(bp, p, size);
-            PyObject_Free(p);
+            _PyObject_Free(ctx, p);
         }
         return bp;
     }
@@ -1263,14 +1610,14 @@
      * at p.  Instead we punt:  let C continue to manage this block.
      */
     if (nbytes)
-        return realloc(p, nbytes);
+        return PyMem_RawRealloc(p, nbytes);
     /* C doesn't define the result of realloc(p, 0) (it may or may not
      * return NULL then), but Python's docs promise that nbytes==0 never
      * returns NULL.  We don't pass 0 to realloc(), to avoid that endcase
      * to begin with.  Even then, we can't be sure that realloc() won't
      * return NULL.
      */
-    bp = realloc(p, 1);
+    bp = PyMem_RawRealloc(p, 1);
     return bp ? bp : p;
 }
 
@@ -1280,23 +1627,12 @@
 /* pymalloc not enabled:  Redirect the entry points to malloc.  These will
  * only be used by extensions that are compiled with pymalloc enabled. */
 
-void *
-PyObject_Malloc(size_t n)
+Py_ssize_t
+_Py_GetAllocatedBlocks(void)
 {
-    return PyMem_MALLOC(n);
+    return 0;
 }
 
-void *
-PyObject_Realloc(void *p, size_t n)
-{
-    return PyMem_REALLOC(p, n);
-}
-
-void
-PyObject_Free(void *p)
-{
-    PyMem_FREE(p);
-}
 #endif /* WITH_PYMALLOC */
 
 #ifdef PYMALLOC_DEBUG
@@ -1316,10 +1652,6 @@
 #define DEADBYTE       0xDB    /* dead (newly freed) memory */
 #define FORBIDDENBYTE  0xFB    /* untouchable bytes at each end of a block */
 
-/* We tag each block with an API ID in order to tag API violations */
-#define _PYMALLOC_MEM_ID 'm'   /* the PyMem_Malloc() API */
-#define _PYMALLOC_OBJ_ID 'o'   /* The PyObject_Malloc() API */
-
 static size_t serialno = 0;     /* incremented on each debug {m,re}alloc */
 
 /* serialno is always incremented via calling this routine.  The point is
@@ -1392,7 +1724,9 @@
 p[0: S]
     Number of bytes originally asked for.  This is a size_t, big-endian (easier
     to read in a memory dump).
-p[S: 2*S]
+p[S]
+    API ID.  See PEP 445.  This is a character, but seems undocumented.
+p[S+1: 2*S]
     Copies of FORBIDDENBYTE.  Used to catch under- writes and reads.
 p[2*S: 2*S+n]
     The requested memory, filled with copies of CLEANBYTE.
@@ -1402,76 +1736,36 @@
 p[2*S+n: 2*S+n+S]
     Copies of FORBIDDENBYTE.  Used to catch over- writes and reads.
 p[2*S+n+S: 2*S+n+2*S]
-    A serial number, incremented by 1 on each call to _PyObject_DebugMalloc
-    and _PyObject_DebugRealloc.
+    A serial number, incremented by 1 on each call to _PyMem_DebugMalloc
+    and _PyMem_DebugRealloc.
     This is a big-endian size_t.
     If "bad memory" is detected later, the serial number gives an
     excellent way to set a breakpoint on the next run, to capture the
     instant at which this block was passed out.
 */
 
-/* debug replacements for the PyMem_* memory API */
-void *
-_PyMem_DebugMalloc(size_t nbytes)
+static void *
+_PyMem_DebugMalloc(void *ctx, size_t nbytes)
 {
-    return _PyObject_DebugMallocApi(_PYMALLOC_MEM_ID, nbytes);
-}
-void *
-_PyMem_DebugRealloc(void *p, size_t nbytes)
-{
-    return _PyObject_DebugReallocApi(_PYMALLOC_MEM_ID, p, nbytes);
-}
-void
-_PyMem_DebugFree(void *p)
-{
-    _PyObject_DebugFreeApi(_PYMALLOC_MEM_ID, p);
-}
-
-/* debug replacements for the PyObject_* memory API */
-void *
-_PyObject_DebugMalloc(size_t nbytes)
-{
-    return _PyObject_DebugMallocApi(_PYMALLOC_OBJ_ID, nbytes);
-}
-void *
-_PyObject_DebugRealloc(void *p, size_t nbytes)
-{
-    return _PyObject_DebugReallocApi(_PYMALLOC_OBJ_ID, p, nbytes);
-}
-void
-_PyObject_DebugFree(void *p)
-{
-    _PyObject_DebugFreeApi(_PYMALLOC_OBJ_ID, p);
-}
-void
-_PyObject_DebugCheckAddress(const void *p)
-{
-    _PyObject_DebugCheckAddressApi(_PYMALLOC_OBJ_ID, p);
-}
-
-
-/* generic debug memory api, with an "id" to identify the API in use */
-void *
-_PyObject_DebugMallocApi(char id, size_t nbytes)
-{
+    debug_alloc_api_t *api = (debug_alloc_api_t *)ctx;
     uchar *p;           /* base address of malloc'ed block */
     uchar *tail;        /* p + 2*SST + nbytes == pointer to tail pad bytes */
     size_t total;       /* nbytes + 4*SST */
 
     bumpserialno();
     total = nbytes + 4*SST;
-    if (total < nbytes)
-        /* overflow:  can't represent total as a size_t */
+    if (nbytes > PY_SSIZE_T_MAX - 4*SST)
+        /* overflow:  can't represent total as a Py_ssize_t */
         return NULL;
 
-    p = (uchar *)PyObject_Malloc(total);
+    p = (uchar *)api->alloc.malloc(api->alloc.ctx, total);
     if (p == NULL)
         return NULL;
 
     /* at p, write size (SST bytes), id (1 byte), pad (SST-1 bytes) */
     write_size_t(p, nbytes);
-    p[SST] = (uchar)id;
-    memset(p + SST + 1 , FORBIDDENBYTE, SST-1);
+    p[SST] = (uchar)api->api_id;
+    memset(p + SST + 1, FORBIDDENBYTE, SST-1);
 
     if (nbytes > 0)
         memset(p + 2*SST, CLEANBYTE, nbytes);
@@ -1489,60 +1783,64 @@
    Then fills the original bytes with DEADBYTE.
    Then calls the underlying free.
 */
-void
-_PyObject_DebugFreeApi(char api, void *p)
+static void
+_PyMem_DebugFree(void *ctx, void *p)
 {
+    debug_alloc_api_t *api = (debug_alloc_api_t *)ctx;
     uchar *q = (uchar *)p - 2*SST;  /* address returned from malloc */
     size_t nbytes;
 
     if (p == NULL)
         return;
-    _PyObject_DebugCheckAddressApi(api, p);
+    _PyMem_DebugCheckAddress(api->api_id, p);
     nbytes = read_size_t(q);
     nbytes += 4*SST;
     if (nbytes > 0)
         memset(q, DEADBYTE, nbytes);
-    PyObject_Free(q);
+    api->alloc.free(api->alloc.ctx, q);
 }
 
-void *
-_PyObject_DebugReallocApi(char api, void *p, size_t nbytes)
+static void *
+_PyMem_DebugRealloc(void *ctx, void *p, size_t nbytes)
 {
-    uchar *q = (uchar *)p;
+    debug_alloc_api_t *api = (debug_alloc_api_t *)ctx;
+    uchar *q = (uchar *)p, *oldq;
     uchar *tail;
     size_t total;       /* nbytes + 4*SST */
     size_t original_nbytes;
     int i;
 
     if (p == NULL)
-        return _PyObject_DebugMallocApi(api, nbytes);
+        return _PyMem_DebugMalloc(ctx, nbytes);
 
-    _PyObject_DebugCheckAddressApi(api, p);
+    _PyMem_DebugCheckAddress(api->api_id, p);
     bumpserialno();
     original_nbytes = read_size_t(q - 2*SST);
     total = nbytes + 4*SST;
-    if (total < nbytes)
-        /* overflow:  can't represent total as a size_t */
+    if (nbytes > PY_SSIZE_T_MAX - 4*SST)
+        /* overflow:  can't represent total as a Py_ssize_t */
         return NULL;
 
-    if (nbytes < original_nbytes) {
-        /* shrinking:  mark old extra memory dead */
-        memset(q + nbytes, DEADBYTE, original_nbytes - nbytes + 2*SST);
-    }
-
     /* Resize and add decorations. We may get a new pointer here, in which
      * case we didn't get the chance to mark the old memory with DEADBYTE,
      * but we live with that.
      */
-    q = (uchar *)PyObject_Realloc(q - 2*SST, total);
+    oldq = q;
+    q = (uchar *)api->alloc.realloc(api->alloc.ctx, q - 2*SST, total);
     if (q == NULL)
         return NULL;
 
+    if (q == oldq && nbytes < original_nbytes) {
+        /* shrinking:  mark old extra memory dead */
+        memset(q + nbytes, DEADBYTE, original_nbytes - nbytes);
+    }
+
     write_size_t(q, nbytes);
-    assert(q[SST] == (uchar)api);
+    assert(q[SST] == (uchar)api->api_id);
     for (i = 1; i < SST; ++i)
         assert(q[SST + i] == FORBIDDENBYTE);
     q += 2*SST;
+
     tail = q + nbytes;
     memset(tail, FORBIDDENBYTE, SST);
     write_size_t(tail + SST, serialno);
@@ -1561,8 +1859,8 @@
  * and call Py_FatalError to kill the program.
  * The API id, is also checked.
  */
- void
-_PyObject_DebugCheckAddressApi(char api, const void *p)
+static void
+_PyMem_DebugCheckAddress(char api, const void *p)
 {
     const uchar *q = (const uchar *)p;
     char msgbuf[64];
@@ -1614,7 +1912,7 @@
 }
 
 /* Display info to stderr about the memory block at p. */
-void
+static void
 _PyObject_DebugDumpAddress(const void *p)
 {
     const uchar *q = (const uchar *)p;
diff --git a/Objects/rangeobject.c b/Objects/rangeobject.c
index f2030c3..7e6c733 100644
--- a/Objects/rangeobject.c
+++ b/Objects/rangeobject.c
@@ -139,7 +139,7 @@
 "range(stop) -> range object\n\
 range(start, stop[, step]) -> range object\n\
 \n\
-Return a virtual sequence of numbers from start to stop by step.");
+Return a sequence of numbers from start to stop by step.");
 
 static void
 range_dealloc(rangeobject *r)
@@ -318,195 +318,6 @@
     return res;
 }
 
-/* Additional helpers, since the standard slice helpers
- * all clip to PY_SSIZE_T_MAX
- */
-
-/* Replace _PyEval_SliceIndex */
-static PyObject *
-compute_slice_element(PyObject *obj)
-{
-    PyObject *result = NULL;
-    if (obj != NULL) {
-        if (PyIndex_Check(obj)) {
-            result = PyNumber_Index(obj);
-        }
-        else {
-            PyErr_SetString(PyExc_TypeError,
-                            "slice indices must be integers or "
-                            "None or have an __index__ method");
-        }
-    }
-    return result;
-}
-
-/* Replace PySlice_GetIndicesEx
- *   Result indicates whether or not the slice is empty
- *    (-1 = error, 0 = empty slice, 1 = slice contains elements)
- */
-static int
-compute_slice_indices(rangeobject *r, PySliceObject *slice,
-                      PyObject **start, PyObject **stop, PyObject **step)
-{
-    int cmp_result, has_elements;
-    Py_ssize_t clamped_step = 0;
-    PyObject *zero = NULL, *one = NULL, *neg_one = NULL, *candidate = NULL;
-    PyObject *tmp_start = NULL, *tmp_stop = NULL, *tmp_step = NULL;
-    zero = PyLong_FromLong(0);
-    if (zero == NULL) goto Fail;
-    one = PyLong_FromLong(1);
-    if (one == NULL) goto Fail;
-    neg_one = PyLong_FromLong(-1);
-    if (neg_one == NULL) goto Fail;
-
-    /* Calculate step value */
-    if (slice->step == Py_None) {
-        clamped_step = 1;
-        tmp_step = one;
-        Py_INCREF(tmp_step);
-    } else {
-        if (!_PyEval_SliceIndex(slice->step, &clamped_step)) goto Fail;
-        if (clamped_step == 0) {
-            PyErr_SetString(PyExc_ValueError,
-                            "slice step cannot be zero");
-            goto Fail;
-        }
-        tmp_step = compute_slice_element(slice->step);
-        if (tmp_step == NULL) goto Fail;
-    }
-
-    /* Calculate start value */
-    if (slice->start == Py_None) {
-        if (clamped_step < 0) {
-            tmp_start = PyNumber_Subtract(r->length, one);
-            if (tmp_start == NULL) goto Fail;
-        } else {
-            tmp_start = zero;
-            Py_INCREF(tmp_start);
-        }
-    } else {
-        candidate = compute_slice_element(slice->start);
-        if (candidate == NULL) goto Fail;
-        cmp_result = PyObject_RichCompareBool(candidate, zero, Py_LT);
-        if (cmp_result == -1) goto Fail;
-        if (cmp_result) {
-            /* candidate < 0 */
-            tmp_start = PyNumber_Add(r->length, candidate);
-            if (tmp_start == NULL) goto Fail;
-            Py_CLEAR(candidate);
-        } else {
-            /* candidate >= 0 */
-            tmp_start = candidate;
-            candidate = NULL;
-        }
-        cmp_result = PyObject_RichCompareBool(tmp_start, zero, Py_LT);
-        if (cmp_result == -1) goto Fail;
-        if (cmp_result) {
-            /* tmp_start < 0 */
-            Py_CLEAR(tmp_start);
-            if (clamped_step < 0) {
-                tmp_start = neg_one;
-            } else {
-                tmp_start = zero;
-            }
-            Py_INCREF(tmp_start);
-        } else {
-            /* tmp_start >= 0 */
-            cmp_result = PyObject_RichCompareBool(tmp_start, r->length, Py_GE);
-            if (cmp_result == -1) goto Fail;
-            if (cmp_result) {
-                /* tmp_start >= r->length */
-                Py_CLEAR(tmp_start);
-                if (clamped_step < 0) {
-                    tmp_start = PyNumber_Subtract(r->length, one);
-                    if (tmp_start == NULL) goto Fail;
-                } else {
-                    tmp_start = r->length;
-                    Py_INCREF(tmp_start);
-                }
-            }
-        }
-    }
-
-    /* Calculate stop value */
-    if (slice->stop == Py_None) {
-        if (clamped_step < 0) {
-            tmp_stop = neg_one;
-        } else {
-            tmp_stop = r->length;
-        }
-        Py_INCREF(tmp_stop);
-    } else {
-        candidate = compute_slice_element(slice->stop);
-        if (candidate == NULL) goto Fail;
-        cmp_result = PyObject_RichCompareBool(candidate, zero, Py_LT);
-        if (cmp_result == -1) goto Fail;
-        if (cmp_result) {
-            /* candidate < 0 */
-            tmp_stop = PyNumber_Add(r->length, candidate);
-            if (tmp_stop == NULL) goto Fail;
-            Py_CLEAR(candidate);
-        } else {
-            /* candidate >= 0 */
-            tmp_stop = candidate;
-            candidate = NULL;
-        }
-        cmp_result = PyObject_RichCompareBool(tmp_stop, zero, Py_LT);
-        if (cmp_result == -1) goto Fail;
-        if (cmp_result) {
-            /* tmp_stop < 0 */
-            Py_CLEAR(tmp_stop);
-            if (clamped_step < 0) {
-                tmp_stop = neg_one;
-            } else {
-                tmp_stop = zero;
-            }
-            Py_INCREF(tmp_stop);
-        } else {
-            /* tmp_stop >= 0 */
-            cmp_result = PyObject_RichCompareBool(tmp_stop, r->length, Py_GE);
-            if (cmp_result == -1) goto Fail;
-            if (cmp_result) {
-                /* tmp_stop >= r->length */
-                Py_CLEAR(tmp_stop);
-                if (clamped_step < 0) {
-                    tmp_stop = PyNumber_Subtract(r->length, one);
-                    if (tmp_stop == NULL) goto Fail;
-                } else {
-                    tmp_stop = r->length;
-                    Py_INCREF(tmp_stop);
-                }
-            }
-        }
-    }
-
-    /* Check if the slice is empty or not */
-    if (clamped_step < 0) {
-        has_elements = PyObject_RichCompareBool(tmp_start, tmp_stop, Py_GT);
-    } else {
-        has_elements = PyObject_RichCompareBool(tmp_start, tmp_stop, Py_LT);
-    }
-    if (has_elements == -1) goto Fail;
-
-    *start = tmp_start;
-    *stop = tmp_stop;
-    *step = tmp_step;
-    Py_DECREF(neg_one);
-    Py_DECREF(one);
-    Py_DECREF(zero);
-    return has_elements;
-
-  Fail:
-    Py_XDECREF(tmp_start);
-    Py_XDECREF(tmp_stop);
-    Py_XDECREF(tmp_step);
-    Py_XDECREF(candidate);
-    Py_XDECREF(neg_one);
-    Py_XDECREF(one);
-    Py_XDECREF(zero);
-    return -1;
-}
-
 static PyObject *
 compute_slice(rangeobject *r, PyObject *_slice)
 {
@@ -514,10 +325,11 @@
     rangeobject *result;
     PyObject *start = NULL, *stop = NULL, *step = NULL;
     PyObject *substart = NULL, *substop = NULL, *substep = NULL;
-    int has_elements;
+    int error;
 
-    has_elements = compute_slice_indices(r, slice, &start, &stop, &step);
-    if (has_elements == -1) return NULL;
+    error = _PySlice_GetLongIndices(slice, r->length, &start, &stop, &step);
+    if (error == -1)
+        return NULL;
 
     substep = PyNumber_Multiply(r->step, step);
     if (substep == NULL) goto fail;
@@ -527,13 +339,8 @@
     if (substart == NULL) goto fail;
     Py_CLEAR(start);
 
-    if (has_elements) {
-        substop = compute_item(r, stop);
-        if (substop == NULL) goto fail;
-    } else {
-        substop = substart;
-        Py_INCREF(substop);
-    }
+    substop = compute_item(r, stop);
+    if (substop == NULL) goto fail;
     Py_CLEAR(stop);
 
     result = make_range_object(Py_TYPE(r), substart, substop, substep);
diff --git a/Objects/setobject.c b/Objects/setobject.c
index ea5a24c..34e43b9 100644
--- a/Objects/setobject.c
+++ b/Objects/setobject.c
@@ -1,154 +1,118 @@
 
 /* set object implementation
+
    Written and maintained by Raymond D. Hettinger <python@rcn.com>
    Derived from Lib/sets.py and Objects/dictobject.c.
 
-   Copyright (c) 2003-2008 Python Software Foundation.
+   Copyright (c) 2003-2013 Python Software Foundation.
    All rights reserved.
+
+   The basic lookup function used by all operations.
+   This is based on Algorithm D from Knuth Vol. 3, Sec. 6.4.
+
+   The initial probe index is computed as hash mod the table size.
+   Subsequent probe indices are computed as explained in Objects/dictobject.c.
+
+   To improve cache locality, each probe inspects a series of consecutive
+   nearby entries before moving on to probes elsewhere in memory.  This leaves
+   us with a hybrid of linear probing and open addressing.  The linear probing
+   reduces the cost of hash collisions because consecutive memory accesses
+   tend to be much cheaper than scattered probes.  After LINEAR_PROBES steps,
+   we then use open addressing with the upper bits from the hash value.  This
+   helps break-up long chains of collisions.
+
+   All arithmetic on hash should ignore overflow.
+
+   Unlike the dictionary implementation, the lookkey functions can return
+   NULL if the rich comparison returns an error.
 */
 
 #include "Python.h"
 #include "structmember.h"
 #include "stringlib/eq.h"
 
-/* Set a key error with the specified argument, wrapping it in a
- * tuple automatically so that tuple keys are not unpacked as the
- * exception arguments. */
-static void
-set_key_error(PyObject *arg)
-{
-    PyObject *tup;
-    tup = PyTuple_Pack(1, arg);
-    if (!tup)
-        return; /* caller will expect error to be set anyway */
-    PyErr_SetObject(PyExc_KeyError, tup);
-    Py_DECREF(tup);
-}
+/* Object used as dummy key to fill deleted entries */
+static PyObject _dummy_struct;
 
-/* This must be >= 1. */
+#define dummy (&_dummy_struct)
+
+
+/* ======================================================================== */
+/* ======= Begin logic for probing the hash table ========================= */
+
+/* Set this to zero to turn-off linear probing */
+#ifndef LINEAR_PROBES
+#define LINEAR_PROBES 9
+#endif
+
+/* This must be >= 1 */
 #define PERTURB_SHIFT 5
 
-/* Object used as dummy key to fill deleted entries */
-static PyObject *dummy = NULL; /* Initialized by first call to make_new_set() */
-
-#ifdef Py_REF_DEBUG
-PyObject *
-_PySet_Dummy(void)
-{
-    return dummy;
-}
-#endif
-
-#define INIT_NONZERO_SET_SLOTS(so) do {                         \
-    (so)->table = (so)->smalltable;                             \
-    (so)->mask = PySet_MINSIZE - 1;                             \
-    (so)->hash = -1;                                            \
-    } while(0)
-
-#define EMPTY_TO_MINSIZE(so) do {                               \
-    memset((so)->smalltable, 0, sizeof((so)->smalltable));      \
-    (so)->used = (so)->fill = 0;                                \
-    INIT_NONZERO_SET_SLOTS(so);                                 \
-    } while(0)
-
-/* Reuse scheme to save calls to malloc, free, and memset */
-#ifndef PySet_MAXFREELIST
-#define PySet_MAXFREELIST 80
-#endif
-static PySetObject *free_list[PySet_MAXFREELIST];
-static int numfree = 0;
-
-
-/*
-The basic lookup function used by all operations.
-This is based on Algorithm D from Knuth Vol. 3, Sec. 6.4.
-Open addressing is preferred over chaining since the link overhead for
-chaining would be substantial (100% with typical malloc overhead).
-
-The initial probe index is computed as hash mod the table size. Subsequent
-probe indices are computed as explained in Objects/dictobject.c.
-
-All arithmetic on hash should ignore overflow.
-
-Unlike the dictionary implementation, the lookkey functions can return
-NULL if the rich comparison returns an error.
-*/
-
 static setentry *
-set_lookkey(PySetObject *so, PyObject *key, register Py_hash_t hash)
+set_lookkey(PySetObject *so, PyObject *key, Py_hash_t hash)
 {
-    register size_t i;  /* Unsigned for defined overflow behavior. */
-    register size_t perturb;
-    register setentry *freeslot;
-    register size_t mask = so->mask;
     setentry *table = so->table;
-    register setentry *entry;
-    register int cmp;
-    PyObject *startkey;
+    setentry *freeslot = NULL;
+    setentry *entry;
+    size_t perturb = hash;
+    size_t mask = so->mask;
+    size_t i = (size_t)hash; /* Unsigned for defined overflow behavior. */
+    size_t j;
+    int cmp;
 
-    i = (size_t)hash & mask;
-    entry = &table[i];
-    if (entry->key == NULL || entry->key == key)
+    entry = &table[i & mask];
+    if (entry->key == NULL)
         return entry;
 
-    if (entry->key == dummy)
-        freeslot = entry;
-    else {
-        if (entry->hash == hash) {
-            startkey = entry->key;
+    while (1) {
+        if (entry->key == key)
+            return entry;
+        if (entry->hash == hash && entry->key != dummy) {
+            PyObject *startkey = entry->key;
             Py_INCREF(startkey);
             cmp = PyObject_RichCompareBool(startkey, key, Py_EQ);
             Py_DECREF(startkey);
             if (cmp < 0)
                 return NULL;
-            if (table == so->table && entry->key == startkey) {
+            if (table != so->table || entry->key != startkey)
+                return set_lookkey(so, key, hash);
+            if (cmp > 0)
+                return entry;
+        }
+        if (entry->key == dummy && freeslot == NULL)
+            freeslot = entry;
+
+        for (j = 1 ; j <= LINEAR_PROBES ; j++) {
+            entry = &table[(i + j) & mask];
+            if (entry->key == NULL)
+                goto found_null;
+            if (entry->key == key)
+                return entry;
+            if (entry->hash == hash && entry->key != dummy) {
+                PyObject *startkey = entry->key;
+                Py_INCREF(startkey);
+                cmp = PyObject_RichCompareBool(startkey, key, Py_EQ);
+                Py_DECREF(startkey);
+                if (cmp < 0)
+                    return NULL;
+                if (table != so->table || entry->key != startkey)
+                    return set_lookkey(so, key, hash);
                 if (cmp > 0)
                     return entry;
             }
-            else {
-                /* The compare did major nasty stuff to the
-                 * set:  start over.
-                 */
-                return set_lookkey(so, key, hash);
-            }
+            if (entry->key == dummy && freeslot == NULL)
+                freeslot = entry;
         }
-        freeslot = NULL;
-    }
 
-    /* In the loop, key == dummy is by far (factor of 100s) the
-       least likely outcome, so test for that last. */
-    for (perturb = hash; ; perturb >>= PERTURB_SHIFT) {
-        i = (i << 2) + i + perturb + 1;
+        perturb >>= PERTURB_SHIFT;
+        i = i * 5 + 1 + perturb;
+
         entry = &table[i & mask];
-        if (entry->key == NULL) {
-            if (freeslot != NULL)
-                entry = freeslot;
-            break;
-        }
-        if (entry->key == key)
-            break;
-        if (entry->hash == hash && entry->key != dummy) {
-            startkey = entry->key;
-            Py_INCREF(startkey);
-            cmp = PyObject_RichCompareBool(startkey, key, Py_EQ);
-            Py_DECREF(startkey);
-            if (cmp < 0)
-                return NULL;
-            if (table == so->table && entry->key == startkey) {
-                if (cmp > 0)
-                    break;
-            }
-            else {
-                /* The compare did major nasty stuff to the
-                 * set:  start over.
-                 */
-                return set_lookkey(so, key, hash);
-            }
-        }
-        else if (entry->key == dummy && freeslot == NULL)
-            freeslot = entry;
+        if (entry->key == NULL)
+            goto found_null;
     }
-    return entry;
+  found_null:
+    return freeslot == NULL ? entry : freeslot;
 }
 
 /*
@@ -157,14 +121,15 @@
  * see if the comparison altered the table.
  */
 static setentry *
-set_lookkey_unicode(PySetObject *so, PyObject *key, register Py_hash_t hash)
+set_lookkey_unicode(PySetObject *so, PyObject *key, Py_hash_t hash)
 {
-    register size_t i;  /* Unsigned for defined overflow behavior. */
-    register size_t perturb;
-    register setentry *freeslot;
-    register size_t mask = so->mask;
     setentry *table = so->table;
-    register setentry *entry;
+    setentry *freeslot = NULL;
+    setentry *entry;
+    size_t perturb = hash;
+    size_t mask = so->mask;
+    size_t i = (size_t)hash;
+    size_t j;
 
     /* Make sure this function doesn't have to handle non-unicode keys,
        including subclasses of str; e.g., one reason to subclass
@@ -174,46 +139,94 @@
         so->lookup = set_lookkey;
         return set_lookkey(so, key, hash);
     }
-    i = (size_t)hash & mask;
-    entry = &table[i];
-    if (entry->key == NULL || entry->key == key)
-        return entry;
-    if (entry->key == dummy)
-        freeslot = entry;
-    else {
-        if (entry->hash == hash && unicode_eq(entry->key, key))
-            return entry;
-        freeslot = NULL;
-    }
 
-    /* In the loop, key == dummy is by far (factor of 100s) the
-       least likely outcome, so test for that last. */
-    for (perturb = hash; ; perturb >>= PERTURB_SHIFT) {
-        i = (i << 2) + i + perturb + 1;
-        entry = &table[i & mask];
-        if (entry->key == NULL)
-            return freeslot == NULL ? entry : freeslot;
+    entry = &table[i & mask];
+    if (entry->key == NULL)
+        return entry;
+
+    while (1) {
         if (entry->key == key
             || (entry->hash == hash
-            && entry->key != dummy
-            && unicode_eq(entry->key, key)))
+                && entry->key != dummy
+                && unicode_eq(entry->key, key)))
             return entry;
         if (entry->key == dummy && freeslot == NULL)
             freeslot = entry;
+
+        for (j = 1 ; j <= LINEAR_PROBES ; j++) {
+            entry = &table[(i + j) & mask];
+            if (entry->key == NULL)
+                goto found_null;
+            if (entry->key == key
+                || (entry->hash == hash
+                    && entry->key != dummy
+                    && unicode_eq(entry->key, key)))
+                return entry;
+            if (entry->key == dummy && freeslot == NULL)
+                freeslot = entry;
+        }
+
+        perturb >>= PERTURB_SHIFT;
+        i = i * 5 + 1 + perturb;
+
+        entry = &table[i & mask];
+        if (entry->key == NULL)
+            goto found_null;
     }
-    assert(0);          /* NOT REACHED */
-    return 0;
+  found_null:
+    return freeslot == NULL ? entry : freeslot;
 }
 
 /*
+Internal routine used by set_table_resize() to insert an item which is
+known to be absent from the set.  This routine also assumes that
+the set contains no deleted entries.  Besides the performance benefit,
+using set_insert_clean() in set_table_resize() is dangerous (SF bug #1456209).
+Note that no refcounts are changed by this routine; if needed, the caller
+is responsible for incref'ing `key`.
+*/
+static void
+set_insert_clean(PySetObject *so, PyObject *key, Py_hash_t hash)
+{
+    setentry *table = so->table;
+    setentry *entry;
+    size_t perturb = hash;
+    size_t mask = (size_t)so->mask;
+    size_t i = (size_t)hash;
+    size_t j;
+
+    while (1) {
+        entry = &table[i & mask];
+        if (entry->key == NULL)
+            goto found_null;
+        for (j = 1 ; j <= LINEAR_PROBES ; j++) {
+            entry = &table[(i + j) & mask];
+            if (entry->key == NULL)
+                goto found_null;
+        }
+        perturb >>= PERTURB_SHIFT;
+        i = i * 5 + 1 + perturb;
+    }
+  found_null:
+    entry->key = key;
+    entry->hash = hash;
+    so->fill++;
+    so->used++;
+}
+
+/* ======== End logic for probing the hash table ========================== */
+/* ======================================================================== */
+
+
+/*
 Internal routine to insert a new key into the table.
 Used by the public insert routine.
 Eats a reference to key.
 */
 static int
-set_insert_key(register PySetObject *so, PyObject *key, Py_hash_t hash)
+set_insert_key(PySetObject *so, PyObject *key, Py_hash_t hash)
 {
-    register setentry *entry;
+    setentry *entry;
 
     assert(so->lookup != NULL);
     entry = so->lookup(so, key, hash);
@@ -230,7 +243,6 @@
         entry->key = key;
         entry->hash = hash;
         so->used++;
-        Py_DECREF(dummy);
     } else {
         /* ACTIVE */
         Py_DECREF(key);
@@ -239,35 +251,6 @@
 }
 
 /*
-Internal routine used by set_table_resize() to insert an item which is
-known to be absent from the set.  This routine also assumes that
-the set contains no deleted entries.  Besides the performance benefit,
-using set_insert_clean() in set_table_resize() is dangerous (SF bug #1456209).
-Note that no refcounts are changed by this routine; if needed, the caller
-is responsible for incref'ing `key`.
-*/
-static void
-set_insert_clean(register PySetObject *so, PyObject *key, Py_hash_t hash)
-{
-    register size_t i;
-    register size_t perturb;
-    register size_t mask = (size_t)so->mask;
-    setentry *table = so->table;
-    register setentry *entry;
-
-    i = (size_t)hash & mask;
-    entry = &table[i];
-    for (perturb = hash; entry->key != NULL; perturb >>= PERTURB_SHIFT) {
-        i = (i << 2) + i + perturb + 1;
-        entry = &table[i & mask];
-    }
-    so->fill++;
-    entry->key = key;
-    entry->hash = hash;
-    so->used++;
-}
-
-/*
 Restructure the table by allocating a new table and reinserting all
 keys again.  When entries have been deleted, the new table may
 actually be smaller than the old one.
@@ -330,23 +313,14 @@
     so->table = newtable;
     so->mask = newsize - 1;
     memset(newtable, 0, sizeof(setentry) * newsize);
+    i = so->used;
     so->used = 0;
-    i = so->fill;
     so->fill = 0;
 
     /* Copy the data over; this is refcount-neutral for active entries;
        dummy entries aren't copied over, of course */
     for (entry = oldtable; i > 0; entry++) {
-        if (entry->key == NULL) {
-            /* UNUSED */
-            ;
-        } else if (entry->key == dummy) {
-            /* DUMMY */
-            --i;
-            assert(entry->key == dummy);
-            Py_DECREF(entry->key);
-        } else {
-            /* ACTIVE */
+        if (entry->key != NULL && entry->key != dummy) {
             --i;
             set_insert_clean(so, entry->key, entry->hash);
         }
@@ -360,9 +334,9 @@
 /* CAUTION: set_add_key/entry() must guarantee it won't resize the table */
 
 static int
-set_add_entry(register PySetObject *so, setentry *entry)
+set_add_entry(PySetObject *so, setentry *entry)
 {
-    register Py_ssize_t n_used;
+    Py_ssize_t n_used;
     PyObject *key = entry->key;
     Py_hash_t hash = entry->hash;
 
@@ -379,10 +353,10 @@
 }
 
 static int
-set_add_key(register PySetObject *so, PyObject *key)
+set_add_key(PySetObject *so, PyObject *key)
 {
-    register Py_hash_t hash;
-    register Py_ssize_t n_used;
+    Py_hash_t hash;
+    Py_ssize_t n_used;
 
     if (!PyUnicode_CheckExact(key) ||
         (hash = ((PyASCIIObject *) key)->hash) == -1) {
@@ -407,7 +381,7 @@
 
 static int
 set_discard_entry(PySetObject *so, setentry *oldentry)
-{       register setentry *entry;
+{       setentry *entry;
     PyObject *old_key;
 
     entry = (so->lookup)(so, oldentry->key, oldentry->hash);
@@ -416,7 +390,6 @@
     if (entry->key == NULL  ||  entry->key == dummy)
         return DISCARD_NOTFOUND;
     old_key = entry->key;
-    Py_INCREF(dummy);
     entry->key = dummy;
     so->used--;
     Py_DECREF(old_key);
@@ -426,8 +399,8 @@
 static int
 set_discard_key(PySetObject *so, PyObject *key)
 {
-    register Py_hash_t hash;
-    register setentry *entry;
+    Py_hash_t hash;
+    setentry *entry;
     PyObject *old_key;
 
     assert (PyAnySet_Check(so));
@@ -444,13 +417,23 @@
     if (entry->key == NULL  ||  entry->key == dummy)
         return DISCARD_NOTFOUND;
     old_key = entry->key;
-    Py_INCREF(dummy);
     entry->key = dummy;
     so->used--;
     Py_DECREF(old_key);
     return DISCARD_FOUND;
 }
 
+static void
+set_empty_to_minsize(PySetObject *so)
+{
+    memset(so->smalltable, 0, sizeof(so->smalltable));
+    so->fill = 0;
+    so->used = 0;
+    so->mask = PySet_MINSIZE - 1;
+    so->table = so->smalltable;
+    so->hash = -1;
+}
+
 static int
 set_clear_internal(PySetObject *so)
 {
@@ -458,14 +441,13 @@
     int table_is_malloced;
     Py_ssize_t fill;
     setentry small_copy[PySet_MINSIZE];
-#ifdef Py_DEBUG
-    Py_ssize_t i, n;
-    assert (PyAnySet_Check(so));
 
-    n = so->mask + 1;
-    i = 0;
+#ifdef Py_DEBUG
+    Py_ssize_t i = 0;
+    Py_ssize_t n = so->mask + 1;
 #endif
 
+    assert (PyAnySet_Check(so));
     table = so->table;
     assert(table != NULL);
     table_is_malloced = table != so->smalltable;
@@ -478,7 +460,7 @@
      */
     fill = so->fill;
     if (table_is_malloced)
-        EMPTY_TO_MINSIZE(so);
+        set_empty_to_minsize(so);
 
     else if (fill > 0) {
         /* It's a small table with something that needs to be cleared.
@@ -487,7 +469,7 @@
          */
         memcpy(small_copy, table, sizeof(small_copy));
         table = small_copy;
-        EMPTY_TO_MINSIZE(so);
+        set_empty_to_minsize(so);
     }
     /* else it's a small table that's already empty */
 
@@ -502,7 +484,8 @@
 #endif
         if (entry->key) {
             --fill;
-            Py_DECREF(entry->key);
+            if (entry->key != dummy)
+                Py_DECREF(entry->key);
         }
 #ifdef Py_DEBUG
         else
@@ -533,7 +516,7 @@
 {
     Py_ssize_t i;
     Py_ssize_t mask;
-    register setentry *table;
+    setentry *table;
 
     assert (PyAnySet_Check(so));
     i = *pos_ptr;
@@ -553,7 +536,7 @@
 static void
 set_dealloc(PySetObject *so)
 {
-    register setentry *entry;
+    setentry *entry;
     Py_ssize_t fill = so->fill;
     PyObject_GC_UnTrack(so);
     Py_TRASHCAN_SAFE_BEGIN(so)
@@ -563,15 +546,13 @@
     for (entry = so->table; fill > 0; entry++) {
         if (entry->key) {
             --fill;
-            Py_DECREF(entry->key);
+            if (entry->key != dummy)
+                Py_DECREF(entry->key);
         }
     }
     if (so->table != so->smalltable)
         PyMem_DEL(so->table);
-    if (numfree < PySet_MAXFREELIST && PyAnySet_CheckExact(so))
-        free_list[numfree++] = so;
-    else
-        Py_TYPE(so)->tp_free(so);
+    Py_TYPE(so)->tp_free(so);
     Py_TRASHCAN_SAFE_END(so)
 }
 
@@ -632,8 +613,8 @@
     PySetObject *other;
     PyObject *key;
     Py_hash_t hash;
-    register Py_ssize_t i;
-    register setentry *entry;
+    Py_ssize_t i;
+    setentry *entry;
 
     assert (PyAnySet_Check(so));
     assert (PyAnySet_Check(otherset));
@@ -701,8 +682,8 @@
 static PyObject *
 set_pop(PySetObject *so)
 {
-    register Py_ssize_t i = 0;
-    register setentry *entry;
+    Py_ssize_t i = 0;
+    setentry *entry;
     PyObject *key;
 
     assert (PyAnySet_Check(so));
@@ -734,7 +715,6 @@
         }
     }
     key = entry->key;
-    Py_INCREF(dummy);
     entry->key = dummy;
     so->used--;
     so->table[0].hash = i + 1;  /* next place to start */
@@ -758,6 +738,17 @@
 static Py_hash_t
 frozenset_hash(PyObject *self)
 {
+    /* Most of the constants in this hash algorithm are randomly choosen
+       large primes with "interesting bit patterns" and that passed
+       tests for good collision statistics on a variety of problematic
+       datasets such as:
+
+          ps = []
+          for r in range(21):
+              ps += itertools.combinations(range(20), r)
+          num_distinct_hashes = len({hash(frozenset(s)) for s in ps})
+
+    */
     PySetObject *so = (PySetObject *)self;
     Py_uhash_t h, hash = 1927868237UL;
     setentry *entry;
@@ -774,8 +765,10 @@
            hashes so that many distinct combinations collapse to only
            a handful of distinct hash values. */
         h = entry->hash;
-        hash ^= (h ^ (h << 16) ^ 89869747UL)  * 3644798167UL;
+        hash ^= ((h ^ 89869747UL) ^ (h << 16)) * 3644798167UL;
     }
+    /* Make the final result spread-out in a different pattern
+       than the algorithm for tuples or other python objects. */
     hash = hash * 69069U + 907133923UL;
     if (hash == -1)
         hash = 590923713UL;
@@ -869,8 +862,8 @@
 static PyObject *setiter_iternext(setiterobject *si)
 {
     PyObject *key;
-    register Py_ssize_t i, mask;
-    register setentry *entry;
+    Py_ssize_t i, mask;
+    setentry *entry;
     PySetObject *so = si->si_set;
 
     if (so == NULL)
@@ -1024,33 +1017,19 @@
 static PyObject *
 make_new_set(PyTypeObject *type, PyObject *iterable)
 {
-    register PySetObject *so = NULL;
-
-    if (dummy == NULL) { /* Auto-initialize dummy */
-        dummy = PyUnicode_FromString("<dummy key>");
-        if (dummy == NULL)
-            return NULL;
-    }
+    PySetObject *so = NULL;
 
     /* create PySetObject structure */
-    if (numfree &&
-        (type == &PySet_Type  ||  type == &PyFrozenSet_Type)) {
-        so = free_list[--numfree];
-        assert (so != NULL && PyAnySet_CheckExact(so));
-        Py_TYPE(so) = type;
-        _Py_NewReference((PyObject *)so);
-        EMPTY_TO_MINSIZE(so);
-        PyObject_GC_Track(so);
-    } else {
-        so = (PySetObject *)type->tp_alloc(type, 0);
-        if (so == NULL)
-            return NULL;
-        /* tp_alloc has already zeroed the structure */
-        assert(so->table == NULL && so->fill == 0 && so->used == 0);
-        INIT_NONZERO_SET_SLOTS(so);
-    }
+    so = (PySetObject *)type->tp_alloc(type, 0);
+    if (so == NULL)
+        return NULL;
 
+    so->fill = 0;
+    so->used = 0;
+    so->mask = PySet_MINSIZE - 1;
+    so->table = so->smalltable;
     so->lookup = set_lookkey_unicode;
+    so->hash = -1;
     so->weakreflist = NULL;
 
     if (iterable != NULL) {
@@ -1113,35 +1092,15 @@
 int
 PySet_ClearFreeList(void)
 {
-    int freelist_size = numfree;
-    PySetObject *so;
-
-    while (numfree) {
-        numfree--;
-        so = free_list[numfree];
-        PyObject_GC_Del(so);
-    }
-    return freelist_size;
+    return 0;
 }
 
 void
 PySet_Fini(void)
 {
-    PySet_ClearFreeList();
-    Py_CLEAR(dummy);
     Py_CLEAR(emptyfrozenset);
 }
 
-/* Print summary info about the state of the optimized allocator */
-void
-_PySet_DebugMallocStats(FILE *out)
-{
-    _PyDebugAllocatorStats(out,
-                           "free PySetObject",
-                           numfree, sizeof(PySetObject));
-}
-
-
 static PyObject *
 set_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
 {
@@ -1952,7 +1911,7 @@
     }
 
     if (rv == DISCARD_NOTFOUND) {
-        set_key_error(key);
+        _PyErr_SetKeyError(key);
         return NULL;
     }
     Py_RETURN_NONE;
@@ -2396,6 +2355,9 @@
     return set_update_internal((PySetObject *)set, iterable);
 }
 
+/* Exported for the gdb plugin's benefit. */
+PyObject *_PySet_Dummy = dummy;
+
 #ifdef Py_DEBUG
 
 /* Test code to be called with any three element set.
@@ -2414,7 +2376,7 @@
     Py_ssize_t count;
     char *s;
     Py_ssize_t i;
-    PyObject *elem=NULL, *dup=NULL, *t, *f, *dup2, *x;
+    PyObject *elem=NULL, *dup=NULL, *t, *f, *dup2, *x=NULL;
     PyObject *ob = (PyObject *)so;
     Py_hash_t hash;
     PyObject *str;
@@ -2537,3 +2499,46 @@
 #undef assertRaises
 
 #endif
+
+/***** Dummy Struct  *************************************************/
+
+static PyObject *
+dummy_repr(PyObject *op)
+{
+    return PyUnicode_FromString("<dummy key>");
+}
+
+static void
+dummy_dealloc(PyObject* ignore)
+{
+    Py_FatalError("deallocating <dummy key>");
+}
+
+static PyTypeObject _PySetDummy_Type = {
+    PyVarObject_HEAD_INIT(&PyType_Type, 0)
+    "<dummy key> type",
+    0,
+    0,
+    dummy_dealloc,      /*tp_dealloc*/ /*never called*/
+    0,                  /*tp_print*/
+    0,                  /*tp_getattr*/
+    0,                  /*tp_setattr*/
+    0,                  /*tp_reserved*/
+    dummy_repr,         /*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_getattro */
+    0,                  /*tp_setattro */
+    0,                  /*tp_as_buffer */
+    Py_TPFLAGS_DEFAULT, /*tp_flags */
+};
+
+static PyObject _dummy_struct = {
+  _PyObject_EXTRA_INIT
+  2, &_PySetDummy_Type
+};
+
diff --git a/Objects/sliceobject.c b/Objects/sliceobject.c
index 1593335..1049523 100644
--- a/Objects/sliceobject.c
+++ b/Objects/sliceobject.c
@@ -33,6 +33,17 @@
     return PyUnicode_FromString("Ellipsis");
 }
 
+static PyObject *
+ellipsis_reduce(PyObject *op)
+{
+    return PyUnicode_FromString("Ellipsis");
+}
+
+static PyMethodDef ellipsis_methods[] = {
+    {"__reduce__", (PyCFunction)ellipsis_reduce, METH_NOARGS, NULL},
+    {NULL, NULL}
+};
+
 PyTypeObject PyEllipsis_Type = {
     PyVarObject_HEAD_INIT(&PyType_Type, 0)
     "ellipsis",                         /* tp_name */
@@ -61,7 +72,7 @@
     0,                                  /* tp_weaklistoffset */
     0,                                  /* tp_iter */
     0,                                  /* tp_iternext */
-    0,                                  /* tp_methods */
+    ellipsis_methods,                   /* tp_methods */
     0,                                  /* tp_members */
     0,                                  /* tp_getset */
     0,                                  /* tp_base */
@@ -299,23 +310,198 @@
     {0}
 };
 
+/* Helper function to convert a slice argument to a PyLong, and raise TypeError
+   with a suitable message on failure. */
+
+static PyObject*
+evaluate_slice_index(PyObject *v)
+{
+    if (PyIndex_Check(v)) {
+        return PyNumber_Index(v);
+    }
+    else {
+        PyErr_SetString(PyExc_TypeError,
+                        "slice indices must be integers or "
+                        "None or have an __index__ method");
+        return NULL;
+    }
+}
+
+/* Compute slice indices given a slice and length.  Return -1 on failure.  Used
+   by slice.indices and rangeobject slicing.  Assumes that `len` is a
+   nonnegative instance of PyLong. */
+
+int
+_PySlice_GetLongIndices(PySliceObject *self, PyObject *length,
+                        PyObject **start_ptr, PyObject **stop_ptr,
+                        PyObject **step_ptr)
+{
+    PyObject *start=NULL, *stop=NULL, *step=NULL;
+    PyObject *upper=NULL, *lower=NULL;
+    int step_is_negative, cmp_result;
+
+    /* Convert step to an integer; raise for zero step. */
+    if (self->step == Py_None) {
+        step = PyLong_FromLong(1L);
+        if (step == NULL)
+            goto error;
+        step_is_negative = 0;
+    }
+    else {
+        int step_sign;
+        step = evaluate_slice_index(self->step);
+        if (step == NULL)
+            goto error;
+        step_sign = _PyLong_Sign(step);
+        if (step_sign == 0) {
+            PyErr_SetString(PyExc_ValueError,
+                            "slice step cannot be zero");
+            goto error;
+        }
+        step_is_negative = step_sign < 0;
+    }
+
+    /* Find lower and upper bounds for start and stop. */
+    if (step_is_negative) {
+        lower = PyLong_FromLong(-1L);
+        if (lower == NULL)
+            goto error;
+
+        upper = PyNumber_Add(length, lower);
+        if (upper == NULL)
+            goto error;
+    }
+    else {
+        lower = PyLong_FromLong(0L);
+        if (lower == NULL)
+            goto error;
+
+        upper = length;
+        Py_INCREF(upper);
+    }
+
+    /* Compute start. */
+    if (self->start == Py_None) {
+        start = step_is_negative ? upper : lower;
+        Py_INCREF(start);
+    }
+    else {
+        start = evaluate_slice_index(self->start);
+        if (start == NULL)
+            goto error;
+
+        if (_PyLong_Sign(start) < 0) {
+            /* start += length */
+            PyObject *tmp = PyNumber_Add(start, length);
+            Py_DECREF(start);
+            start = tmp;
+            if (start == NULL)
+                goto error;
+
+            cmp_result = PyObject_RichCompareBool(start, lower, Py_LT);
+            if (cmp_result < 0)
+                goto error;
+            if (cmp_result) {
+                Py_INCREF(lower);
+                Py_DECREF(start);
+                start = lower;
+            }
+        }
+        else {
+            cmp_result = PyObject_RichCompareBool(start, upper, Py_GT);
+            if (cmp_result < 0)
+                goto error;
+            if (cmp_result) {
+                Py_INCREF(upper);
+                Py_DECREF(start);
+                start = upper;
+            }
+        }
+    }
+
+    /* Compute stop. */
+    if (self->stop == Py_None) {
+        stop = step_is_negative ? lower : upper;
+        Py_INCREF(stop);
+    }
+    else {
+        stop = evaluate_slice_index(self->stop);
+        if (stop == NULL)
+            goto error;
+
+        if (_PyLong_Sign(stop) < 0) {
+            /* stop += length */
+            PyObject *tmp = PyNumber_Add(stop, length);
+            Py_DECREF(stop);
+            stop = tmp;
+            if (stop == NULL)
+                goto error;
+
+            cmp_result = PyObject_RichCompareBool(stop, lower, Py_LT);
+            if (cmp_result < 0)
+                goto error;
+            if (cmp_result) {
+                Py_INCREF(lower);
+                Py_DECREF(stop);
+                stop = lower;
+            }
+        }
+        else {
+            cmp_result = PyObject_RichCompareBool(stop, upper, Py_GT);
+            if (cmp_result < 0)
+                goto error;
+            if (cmp_result) {
+                Py_INCREF(upper);
+                Py_DECREF(stop);
+                stop = upper;
+            }
+        }
+    }
+
+    *start_ptr = start;
+    *stop_ptr = stop;
+    *step_ptr = step;
+    Py_DECREF(upper);
+    Py_DECREF(lower);
+    return 0;
+
+  error:
+    *start_ptr = *stop_ptr = *step_ptr = NULL;
+    Py_XDECREF(start);
+    Py_XDECREF(stop);
+    Py_XDECREF(step);
+    Py_XDECREF(upper);
+    Py_XDECREF(lower);
+    return -1;
+}
+
+/* Implementation of slice.indices. */
+
 static PyObject*
 slice_indices(PySliceObject* self, PyObject* len)
 {
-    Py_ssize_t ilen, start, stop, step, slicelength;
+    PyObject *start, *stop, *step;
+    PyObject *length;
+    int error;
 
-    ilen = PyNumber_AsSsize_t(len, PyExc_OverflowError);
+    /* Convert length to an integer if necessary; raise for negative length. */
+    length = PyNumber_Index(len);
+    if (length == NULL)
+        return NULL;
 
-    if (ilen == -1 && PyErr_Occurred()) {
+    if (_PyLong_Sign(length) < 0) {
+        PyErr_SetString(PyExc_ValueError,
+                        "length should not be negative");
+        Py_DECREF(length);
         return NULL;
     }
 
-    if (PySlice_GetIndicesEx((PyObject*)self, ilen, &start, &stop,
-                             &step, &slicelength) < 0) {
+    error = _PySlice_GetLongIndices(self, length, &start, &stop, &step);
+    Py_DECREF(length);
+    if (error == -1)
         return NULL;
-    }
-
-    return Py_BuildValue("(nnn)", start, stop, step);
+    else
+        return Py_BuildValue("(NNN)", start, stop, step);
 }
 
 PyDoc_STRVAR(slice_indices_doc,
diff --git a/Objects/stringlib/README.txt b/Objects/stringlib/README.txt
index ab506d6..8ff6ad8 100644
--- a/Objects/stringlib/README.txt
+++ b/Objects/stringlib/README.txt
@@ -1,4 +1,4 @@
-bits shared by the stringobject and unicodeobject implementations (and
+bits shared by the bytesobject and unicodeobject implementations (and
 possibly other modules, in a not too distant future).
 
 the stuff in here is included into relevant places; see the individual
diff --git a/Objects/stringlib/asciilib.h b/Objects/stringlib/asciilib.h
index f62813d..d0fc18d 100644
--- a/Objects/stringlib/asciilib.h
+++ b/Objects/stringlib/asciilib.h
@@ -19,7 +19,6 @@
 #define STRINGLIB_STR            PyUnicode_1BYTE_DATA
 #define STRINGLIB_LEN            PyUnicode_GET_LENGTH
 #define STRINGLIB_NEW(STR,LEN)   _PyUnicode_FromASCII((char*)(STR),(LEN))
-#define STRINGLIB_RESIZE         not_supported
 #define STRINGLIB_CHECK          PyUnicode_Check
 #define STRINGLIB_CHECK_EXACT    PyUnicode_CheckExact
 
diff --git a/Objects/stringlib/codecs.h b/Objects/stringlib/codecs.h
index f353367..2eb2d14 100644
--- a/Objects/stringlib/codecs.h
+++ b/Objects/stringlib/codecs.h
@@ -38,8 +38,8 @@
             */
             if (_Py_IS_ALIGNED(s, SIZEOF_LONG)) {
                 /* Help register allocation */
-                register const char *_s = s;
-                register STRINGLIB_CHAR *_p = p;
+                const char *_s = s;
+                STRINGLIB_CHAR *_p = p;
                 while (_s < aligned_end) {
                     /* Read a whole long at a time (either 4 or 8 bytes),
                        and do a fast unrolled copy if it only contains ASCII
@@ -47,7 +47,7 @@
                     unsigned long value = *(unsigned long *) _s;
                     if (value & ASCII_CHAR_MASK)
                         break;
-#ifdef BYTEORDER_IS_LITTLE_ENDIAN
+#if PY_LITTLE_ENDIAN
                     _p[0] = (STRINGLIB_CHAR)(value & 0xFFu);
                     _p[1] = (STRINGLIB_CHAR)((value >> 8) & 0xFFu);
                     _p[2] = (STRINGLIB_CHAR)((value >> 16) & 0xFFu);
@@ -486,7 +486,7 @@
     const unsigned char *q = *inptr;
     STRINGLIB_CHAR *p = dest + *outpos;
     /* Offsets from q for retrieving byte pairs in the right order. */
-#ifdef BYTEORDER_IS_LITTLE_ENDIAN
+#if PY_LITTLE_ENDIAN
     int ihi = !!native_ordering, ilo = !native_ordering;
 #else
     int ihi = !native_ordering, ilo = !!native_ordering;
@@ -499,7 +499,7 @@
            reads are more expensive, better to defer to another iteration. */
         if (_Py_IS_ALIGNED(q, SIZEOF_LONG)) {
             /* Fast path for runs of in-range non-surrogate chars. */
-            register const unsigned char *_q = q;
+            const unsigned char *_q = q;
             while (_q < aligned_end) {
                 unsigned long block = * (unsigned long *) _q;
                 if (native_ordering) {
@@ -517,7 +517,7 @@
                     block = SWAB(block);
 #endif
                 }
-#ifdef BYTEORDER_IS_LITTLE_ENDIAN
+#if PY_LITTLE_ENDIAN
 # if SIZEOF_LONG == 4
                 p[0] = (STRINGLIB_CHAR)(block & 0xFFFFu);
                 p[1] = (STRINGLIB_CHAR)(block >> 16);
@@ -596,26 +596,30 @@
 #undef SWAB
 
 
-Py_LOCAL_INLINE(void)
-STRINGLIB(utf16_encode)(unsigned short *out,
-                        const STRINGLIB_CHAR *in,
+#if STRINGLIB_MAX_CHAR >= 0x80
+Py_LOCAL_INLINE(Py_ssize_t)
+STRINGLIB(utf16_encode)(const STRINGLIB_CHAR *in,
                         Py_ssize_t len,
+                        unsigned short **outptr,
                         int native_ordering)
 {
+    unsigned short *out = *outptr;
     const STRINGLIB_CHAR *end = in + len;
 #if STRINGLIB_SIZEOF_CHAR == 1
-# define SWAB2(CH)  ((CH) << 8)
-#else
-# define SWAB2(CH)  (((CH) << 8) | ((CH) >> 8))
-#endif
-#if STRINGLIB_MAX_CHAR < 0x10000
     if (native_ordering) {
-# if STRINGLIB_SIZEOF_CHAR == 2
-        Py_MEMCPY(out, in, 2 * len);
-# else
-        _PyUnicode_CONVERT_BYTES(STRINGLIB_CHAR, unsigned short, in, end, out);
-# endif
+        const STRINGLIB_CHAR *unrolled_end = in + _Py_SIZE_ROUND_DOWN(len, 4);
+        while (in < unrolled_end) {
+            out[0] = in[0];
+            out[1] = in[1];
+            out[2] = in[2];
+            out[3] = in[3];
+            in += 4; out += 4;
+        }
+        while (in < end) {
+            *out++ = *in++;
+        }
     } else {
+# define SWAB2(CH)  ((CH) << 8) /* high byte is zero */
         const STRINGLIB_CHAR *unrolled_end = in + _Py_SIZE_ROUND_DOWN(len, 4);
         while (in < unrolled_end) {
             out[0] = SWAB2(in[0]);
@@ -625,37 +629,95 @@
             in += 4; out += 4;
         }
         while (in < end) {
-            *out++ = SWAB2(*in);
-            ++in;
+            Py_UCS4 ch = *in++;
+            *out++ = SWAB2((Py_UCS2)ch);
         }
+#undef SWAB2
     }
+    *outptr = out;
+    return len;
 #else
     if (native_ordering) {
+#if STRINGLIB_MAX_CHAR < 0x10000
+        const STRINGLIB_CHAR *unrolled_end = in + _Py_SIZE_ROUND_DOWN(len, 4);
+        while (in < unrolled_end) {
+            /* check if any character is a surrogate character */
+            if (((in[0] ^ 0xd800) &
+                 (in[1] ^ 0xd800) &
+                 (in[2] ^ 0xd800) &
+                 (in[3] ^ 0xd800) & 0xf800) == 0)
+                break;
+            out[0] = in[0];
+            out[1] = in[1];
+            out[2] = in[2];
+            out[3] = in[3];
+            in += 4; out += 4;
+        }
+#endif
         while (in < end) {
-            Py_UCS4 ch = *in++;
-            if (ch < 0x10000)
+            Py_UCS4 ch;
+            ch = *in++;
+            if (ch < 0xd800)
                 *out++ = ch;
-            else {
+            else if (ch < 0xe000)
+                /* reject surrogate characters (U+DC800-U+DFFF) */
+                goto fail;
+#if STRINGLIB_MAX_CHAR >= 0x10000
+            else if (ch >= 0x10000) {
                 out[0] = Py_UNICODE_HIGH_SURROGATE(ch);
                 out[1] = Py_UNICODE_LOW_SURROGATE(ch);
                 out += 2;
             }
+#endif
+            else
+                *out++ = ch;
         }
     } else {
+#define SWAB2(CH)  (((CH) << 8) | ((CH) >> 8))
+#if STRINGLIB_MAX_CHAR < 0x10000
+        const STRINGLIB_CHAR *unrolled_end = in + _Py_SIZE_ROUND_DOWN(len, 4);
+        while (in < unrolled_end) {
+            /* check if any character is a surrogate character */
+            if (((in[0] ^ 0xd800) &
+                 (in[1] ^ 0xd800) &
+                 (in[2] ^ 0xd800) &
+                 (in[3] ^ 0xd800) & 0xf800) == 0)
+                break;
+            out[0] = SWAB2(in[0]);
+            out[1] = SWAB2(in[1]);
+            out[2] = SWAB2(in[2]);
+            out[3] = SWAB2(in[3]);
+            in += 4; out += 4;
+        }
+#endif
         while (in < end) {
             Py_UCS4 ch = *in++;
-            if (ch < 0x10000)
+            if (ch < 0xd800)
                 *out++ = SWAB2((Py_UCS2)ch);
-            else {
+            else if (ch < 0xe000)
+                /* reject surrogate characters (U+DC800-U+DFFF) */
+                goto fail;
+#if STRINGLIB_MAX_CHAR >= 0x10000
+            else if (ch >= 0x10000) {
                 Py_UCS2 ch1 = Py_UNICODE_HIGH_SURROGATE(ch);
                 Py_UCS2 ch2 = Py_UNICODE_LOW_SURROGATE(ch);
                 out[0] = SWAB2(ch1);
                 out[1] = SWAB2(ch2);
                 out += 2;
             }
-        }
-    }
 #endif
+            else
+                *out++ = SWAB2((Py_UCS2)ch);
+        }
 #undef SWAB2
+    }
+    *outptr = out;
+    return len;
+  fail:
+    *outptr = out;
+    return len - (end - in + 1);
+#endif
 }
+#endif
+
 #endif /* STRINGLIB_IS_UNICODE */
diff --git a/Objects/stringlib/eq.h b/Objects/stringlib/eq.h
index 3e5f510..f8fd384 100644
--- a/Objects/stringlib/eq.h
+++ b/Objects/stringlib/eq.h
@@ -6,8 +6,8 @@
 Py_LOCAL_INLINE(int)
 unicode_eq(PyObject *aa, PyObject *bb)
 {
-    register PyUnicodeObject *a = (PyUnicodeObject *)aa;
-    register PyUnicodeObject *b = (PyUnicodeObject *)bb;
+    PyUnicodeObject *a = (PyUnicodeObject *)aa;
+    PyUnicodeObject *b = (PyUnicodeObject *)bb;
 
     if (PyUnicode_READY(a) == -1 || PyUnicode_READY(b) == -1) {
         assert(0 && "unicode_eq ready fail");
diff --git a/Objects/stringlib/fastsearch.h b/Objects/stringlib/fastsearch.h
index 55ac77d..cd7cac4 100644
--- a/Objects/stringlib/fastsearch.h
+++ b/Objects/stringlib/fastsearch.h
@@ -142,6 +142,8 @@
     mask = 0;
 
     if (mode != FAST_RSEARCH) {
+        const STRINGLIB_CHAR *ss = s + m - 1;
+        const STRINGLIB_CHAR *pp = p + m - 1;
 
         /* create compressed boyer-moore delta 1 table */
 
@@ -156,7 +158,7 @@
 
         for (i = 0; i <= w; i++) {
             /* note: using mlast in the skip path slows things down on x86 */
-            if (s[i+m-1] == p[m-1]) {
+            if (ss[i] == pp[0]) {
                 /* candidate match */
                 for (j = 0; j < mlast; j++)
                     if (s[i+j] != p[j])
@@ -172,13 +174,13 @@
                     continue;
                 }
                 /* miss: check if next character is part of pattern */
-                if (!STRINGLIB_BLOOM(mask, s[i+m]))
+                if (!STRINGLIB_BLOOM(mask, ss[i+1]))
                     i = i + m;
                 else
                     i = i + skip;
             } else {
                 /* skip: check if next character is part of pattern */
-                if (!STRINGLIB_BLOOM(mask, s[i+m]))
+                if (!STRINGLIB_BLOOM(mask, ss[i+1]))
                     i = i + m;
             }
         }
diff --git a/Objects/stringlib/find_max_char.h b/Objects/stringlib/find_max_char.h
index 06559c8..eb3fe88 100644
--- a/Objects/stringlib/find_max_char.h
+++ b/Objects/stringlib/find_max_char.h
@@ -24,7 +24,7 @@
     while (p < end) {
         if (_Py_IS_ALIGNED(p, SIZEOF_LONG)) {
             /* Help register allocation */
-            register const unsigned char *_p = p;
+            const unsigned char *_p = p;
             while (_p < aligned_end) {
                 unsigned long value = *(unsigned long *) _p;
                 if (value & UCS1_ASCII_CHAR_MASK)
@@ -66,7 +66,7 @@
 #else
 #error Invalid STRINGLIB_SIZEOF_CHAR (must be 1, 2 or 4)
 #endif
-    register Py_UCS4 mask;
+    Py_UCS4 mask;
     Py_ssize_t n = end - begin;
     const STRINGLIB_CHAR *p = begin;
     const STRINGLIB_CHAR *unrolled_end = begin + _Py_SIZE_ROUND_DOWN(n, 4);
diff --git a/Objects/stringlib/join.h b/Objects/stringlib/join.h
new file mode 100644
index 0000000..cbf81be
--- /dev/null
+++ b/Objects/stringlib/join.h
@@ -0,0 +1,140 @@
+/* stringlib: bytes joining implementation */
+
+#if STRINGLIB_SIZEOF_CHAR != 1
+#error join.h only compatible with byte-wise strings
+#endif
+
+Py_LOCAL_INLINE(PyObject *)
+STRINGLIB(bytes_join)(PyObject *sep, PyObject *iterable)
+{
+    char *sepstr = STRINGLIB_STR(sep);
+    const Py_ssize_t seplen = STRINGLIB_LEN(sep);
+    PyObject *res = NULL;
+    char *p;
+    Py_ssize_t seqlen = 0;
+    Py_ssize_t sz = 0;
+    Py_ssize_t i, nbufs;
+    PyObject *seq, *item;
+    Py_buffer *buffers = NULL;
+#define NB_STATIC_BUFFERS 10
+    Py_buffer static_buffers[NB_STATIC_BUFFERS];
+
+    seq = PySequence_Fast(iterable, "can only join an iterable");
+    if (seq == NULL) {
+        return NULL;
+    }
+
+    seqlen = PySequence_Fast_GET_SIZE(seq);
+    if (seqlen == 0) {
+        Py_DECREF(seq);
+        return STRINGLIB_NEW(NULL, 0);
+    }
+#ifndef STRINGLIB_MUTABLE
+    if (seqlen == 1) {
+        item = PySequence_Fast_GET_ITEM(seq, 0);
+        if (STRINGLIB_CHECK_EXACT(item)) {
+            Py_INCREF(item);
+            Py_DECREF(seq);
+            return item;
+        }
+    }
+#endif
+    if (seqlen > NB_STATIC_BUFFERS) {
+        buffers = PyMem_NEW(Py_buffer, seqlen);
+        if (buffers == NULL) {
+            Py_DECREF(seq);
+            PyErr_NoMemory();
+            return NULL;
+        }
+    }
+    else {
+        buffers = static_buffers;
+    }
+
+    /* Here is the general case.  Do a pre-pass to figure out the total
+     * amount of space we'll need (sz), and see whether all arguments are
+     * bytes-like.
+     */
+    for (i = 0, nbufs = 0; i < seqlen; i++) {
+        Py_ssize_t itemlen;
+        item = PySequence_Fast_GET_ITEM(seq, i);
+        if (PyBytes_CheckExact(item)) {
+            /* Fast path. */
+            Py_INCREF(item);
+            buffers[i].obj = item;
+            buffers[i].buf = PyBytes_AS_STRING(item);
+            buffers[i].len = PyBytes_GET_SIZE(item);
+        }
+        else if (PyObject_GetBuffer(item, &buffers[i], PyBUF_SIMPLE) != 0) {
+            PyErr_Format(PyExc_TypeError,
+                         "sequence item %zd: expected a bytes-like object, "
+                         "%.80s found",
+                         i, Py_TYPE(item)->tp_name);
+            goto error;
+        }
+        nbufs = i + 1;  /* for error cleanup */
+        itemlen = buffers[i].len;
+        if (itemlen > PY_SSIZE_T_MAX - sz) {
+            PyErr_SetString(PyExc_OverflowError,
+                            "join() result is too long");
+            goto error;
+        }
+        sz += itemlen;
+        if (i != 0) {
+            if (seplen > PY_SSIZE_T_MAX - sz) {
+                PyErr_SetString(PyExc_OverflowError,
+                                "join() result is too long");
+                goto error;
+            }
+            sz += seplen;
+        }
+        if (seqlen != PySequence_Fast_GET_SIZE(seq)) {
+            PyErr_SetString(PyExc_RuntimeError,
+                            "sequence changed size during iteration");
+            goto error;
+        }
+    }
+
+    /* Allocate result space. */
+    res = STRINGLIB_NEW(NULL, sz);
+    if (res == NULL)
+        goto error;
+
+    /* Catenate everything. */
+    p = STRINGLIB_STR(res);
+    if (!seplen) {
+        /* fast path */
+        for (i = 0; i < nbufs; i++) {
+            Py_ssize_t n = buffers[i].len;
+            char *q = buffers[i].buf;
+            Py_MEMCPY(p, q, n);
+            p += n;
+        }
+        goto done;
+    }
+    for (i = 0; i < nbufs; i++) {
+        Py_ssize_t n;
+        char *q;
+        if (i) {
+            Py_MEMCPY(p, sepstr, seplen);
+            p += seplen;
+        }
+        n = buffers[i].len;
+        q = buffers[i].buf;
+        Py_MEMCPY(p, q, n);
+        p += n;
+    }
+    goto done;
+
+error:
+    res = NULL;
+done:
+    Py_DECREF(seq);
+    for (i = 0; i < nbufs; i++)
+        PyBuffer_Release(&buffers[i]);
+    if (buffers != static_buffers)
+        PyMem_FREE(buffers);
+    return res;
+}
+
+#undef NB_STATIC_BUFFERS
diff --git a/Objects/stringlib/partition.h b/Objects/stringlib/partition.h
index 40cb512..ed32a6f 100644
--- a/Objects/stringlib/partition.h
+++ b/Objects/stringlib/partition.h
@@ -29,6 +29,11 @@
         PyTuple_SET_ITEM(out, 0, STRINGLIB_NEW(str, str_len));
         PyTuple_SET_ITEM(out, 1, STRINGLIB_NEW(NULL, 0));
         PyTuple_SET_ITEM(out, 2, STRINGLIB_NEW(NULL, 0));
+
+        if (PyErr_Occurred()) {
+            Py_DECREF(out);
+            return NULL;
+        }
 #else
         Py_INCREF(str_obj);
         PyTuple_SET_ITEM(out, 0, (PyObject*) str_obj);
@@ -79,6 +84,11 @@
         PyTuple_SET_ITEM(out, 0, STRINGLIB_NEW(NULL, 0));
         PyTuple_SET_ITEM(out, 1, STRINGLIB_NEW(NULL, 0));
         PyTuple_SET_ITEM(out, 2, STRINGLIB_NEW(str, str_len));
+
+        if (PyErr_Occurred()) {
+            Py_DECREF(out);
+            return NULL;
+        }
 #else
         Py_INCREF(STRINGLIB_EMPTY);
         PyTuple_SET_ITEM(out, 0, (PyObject*) STRINGLIB_EMPTY);
diff --git a/Objects/stringlib/replace.h b/Objects/stringlib/replace.h
new file mode 100644
index 0000000..ef318ed
--- /dev/null
+++ b/Objects/stringlib/replace.h
@@ -0,0 +1,53 @@
+/* stringlib: replace implementation */
+
+#ifndef STRINGLIB_FASTSEARCH_H
+#error must include "stringlib/fastsearch.h" before including this module
+#endif
+
+Py_LOCAL_INLINE(void)
+STRINGLIB(replace_1char_inplace)(STRINGLIB_CHAR* s, STRINGLIB_CHAR* end,
+                                 Py_UCS4 u1, Py_UCS4 u2, Py_ssize_t maxcount)
+{
+    *s = u2;
+    while (--maxcount && ++s != end) {
+        /* Find the next character to be replaced.
+
+           If it occurs often, it is faster to scan for it using an inline
+           loop.  If it occurs seldom, it is faster to scan for it using a
+           function call; the overhead of the function call is amortized
+           across the many characters that call covers.  We start with an
+           inline loop and use a heuristic to determine whether to fall back
+           to a function call. */
+        if (*s != u1) {
+            int attempts = 10;
+            /* search u1 in a dummy loop */
+            while (1) {
+                if (++s == end)
+                    return;
+                if (*s == u1)
+                    break;
+                if (!--attempts) {
+                    /* if u1 was not found for attempts iterations,
+                       use FASTSEARCH() or memchr() */
+#if STRINGLIB_SIZEOF_CHAR == 1
+                    s++;
+                    s = memchr(s, u1, end - s);
+                    if (s == NULL)
+                        return;
+#else
+                    Py_ssize_t i;
+                    STRINGLIB_CHAR ch1 = (STRINGLIB_CHAR) u1;
+                    s++;
+                    i = FASTSEARCH(s, end - s, &ch1, 1, 0, FAST_SEARCH);
+                    if (i < 0)
+                        return;
+                    s += i;
+#endif
+                    /* restart the dummy loop */
+                    break;
+                }
+            }
+        }
+        *s = u2;
+    }
+}
diff --git a/Objects/stringlib/split.h b/Objects/stringlib/split.h
index 947dd28..31f77a7 100644
--- a/Objects/stringlib/split.h
+++ b/Objects/stringlib/split.h
@@ -345,8 +345,8 @@
        and the appends only done when the prealloc buffer is full.
        That's too much work for little gain.*/
 
-    register Py_ssize_t i;
-    register Py_ssize_t j;
+    Py_ssize_t i;
+    Py_ssize_t j;
     PyObject *list = PyList_New(0);
     PyObject *sub;
 
diff --git a/Objects/stringlib/stringdefs.h b/Objects/stringlib/stringdefs.h
index 7bb91a7..ce27f3e 100644
--- a/Objects/stringlib/stringdefs.h
+++ b/Objects/stringlib/stringdefs.h
@@ -21,7 +21,6 @@
 #define STRINGLIB_STR            PyBytes_AS_STRING
 #define STRINGLIB_LEN            PyBytes_GET_SIZE
 #define STRINGLIB_NEW            PyBytes_FromStringAndSize
-#define STRINGLIB_RESIZE         _PyBytes_Resize
 #define STRINGLIB_CHECK          PyBytes_Check
 #define STRINGLIB_CHECK_EXACT    PyBytes_CheckExact
 #define STRINGLIB_TOSTR          PyObject_Str
diff --git a/Objects/stringlib/transmogrify.h b/Objects/stringlib/transmogrify.h
index cbd7144..cae6ea1 100644
--- a/Objects/stringlib/transmogrify.h
+++ b/Objects/stringlib/transmogrify.h
@@ -5,21 +5,23 @@
    shared code in bytes_methods.c to cut down on duplicate code bloat.  */
 
 PyDoc_STRVAR(expandtabs__doc__,
-"B.expandtabs([tabsize]) -> copy of B\n\
+"B.expandtabs(tabsize=8) -> copy of B\n\
 \n\
 Return a copy of B where all tab characters are expanded using spaces.\n\
 If tabsize is not given, a tab size of 8 characters is assumed.");
 
 static PyObject*
-stringlib_expandtabs(PyObject *self, PyObject *args)
+stringlib_expandtabs(PyObject *self, PyObject *args, PyObject *kwds)
 {
     const char *e, *p;
     char *q;
     Py_ssize_t i, j;
     PyObject *u;
+    static char *kwlist[] = {"tabsize", 0};
     int tabsize = 8;
 
-    if (!PyArg_ParseTuple(args, "|i:expandtabs", &tabsize))
+    if (!PyArg_ParseTupleAndKeywords(args, kwds, "|i:expandtabs",
+                                     kwlist, &tabsize))
         return NULL;
 
     /* First pass: determine size of output string */
diff --git a/Objects/stringlib/ucs1lib.h b/Objects/stringlib/ucs1lib.h
index e8c6fcb..ce1eb57 100644
--- a/Objects/stringlib/ucs1lib.h
+++ b/Objects/stringlib/ucs1lib.h
@@ -19,7 +19,6 @@
 #define STRINGLIB_STR            PyUnicode_1BYTE_DATA
 #define STRINGLIB_LEN            PyUnicode_GET_LENGTH
 #define STRINGLIB_NEW            _PyUnicode_FromUCS1
-#define STRINGLIB_RESIZE         not_supported
 #define STRINGLIB_CHECK          PyUnicode_Check
 #define STRINGLIB_CHECK_EXACT    PyUnicode_CheckExact
 
diff --git a/Objects/stringlib/ucs2lib.h b/Objects/stringlib/ucs2lib.h
index 45e5729..f900cb6 100644
--- a/Objects/stringlib/ucs2lib.h
+++ b/Objects/stringlib/ucs2lib.h
@@ -19,7 +19,6 @@
 #define STRINGLIB_STR            PyUnicode_2BYTE_DATA
 #define STRINGLIB_LEN            PyUnicode_GET_LENGTH
 #define STRINGLIB_NEW            _PyUnicode_FromUCS2
-#define STRINGLIB_RESIZE         not_supported
 #define STRINGLIB_CHECK          PyUnicode_Check
 #define STRINGLIB_CHECK_EXACT    PyUnicode_CheckExact
 
diff --git a/Objects/stringlib/ucs4lib.h b/Objects/stringlib/ucs4lib.h
index 647a27e..86a480f 100644
--- a/Objects/stringlib/ucs4lib.h
+++ b/Objects/stringlib/ucs4lib.h
@@ -19,7 +19,6 @@
 #define STRINGLIB_STR            PyUnicode_4BYTE_DATA
 #define STRINGLIB_LEN            PyUnicode_GET_LENGTH
 #define STRINGLIB_NEW            _PyUnicode_FromUCS4
-#define STRINGLIB_RESIZE         not_supported
 #define STRINGLIB_CHECK          PyUnicode_Check
 #define STRINGLIB_CHECK_EXACT    PyUnicode_CheckExact
 
diff --git a/Objects/stringlib/undef.h b/Objects/stringlib/undef.h
index 03117ec..f9d3f1d 100644
--- a/Objects/stringlib/undef.h
+++ b/Objects/stringlib/undef.h
@@ -6,7 +6,6 @@
 #undef  STRINGLIB_STR
 #undef  STRINGLIB_LEN
 #undef  STRINGLIB_NEW
-#undef  STRINGLIB_RESIZE
 #undef  _Py_InsertThousandsGrouping
 #undef STRINGLIB_IS_UNICODE
 
diff --git a/Objects/stringlib/unicode_format.h b/Objects/stringlib/unicode_format.h
index d4719a5..aec221a 100644
--- a/Objects/stringlib/unicode_format.h
+++ b/Objects/stringlib/unicode_format.h
@@ -543,7 +543,7 @@
 
 static int
 parse_field(SubString *str, SubString *field_name, SubString *format_spec,
-            Py_UCS4 *conversion)
+            int *format_spec_needs_expanding, Py_UCS4 *conversion)
 {
     /* Note this function works if the field name is zero length,
        which is good.  Zero length field names are handled later, in
@@ -561,6 +561,15 @@
     field_name->start = str->start;
     while (str->start < str->end) {
         switch ((c = PyUnicode_READ_CHAR(str->str, str->start++))) {
+        case '{':
+            PyErr_SetString(PyExc_ValueError, "unexpected '{' in field name");
+            return 0;
+        case '[':
+            for (; str->start < str->end; str->start++)
+                if (PyUnicode_READ_CHAR(str->str, str->start) == ']')
+                    break;
+            continue;
+        case '}':
         case ':':
         case '!':
             break;
@@ -570,41 +579,62 @@
         break;
     }
 
+    field_name->end = str->start - 1;
     if (c == '!' || c == ':') {
+        Py_ssize_t count;
         /* we have a format specifier and/or a conversion */
         /* don't include the last character */
-        field_name->end = str->start-1;
-
-        /* the format specifier is the rest of the string */
-        format_spec->str = str->str;
-        format_spec->start = str->start;
-        format_spec->end = str->end;
 
         /* see if there's a conversion specifier */
         if (c == '!') {
             /* there must be another character present */
-            if (format_spec->start >= format_spec->end) {
+            if (str->start >= str->end) {
                 PyErr_SetString(PyExc_ValueError,
-                                "end of format while looking for conversion "
+                                "end of string while looking for conversion "
                                 "specifier");
                 return 0;
             }
-            *conversion = PyUnicode_READ_CHAR(format_spec->str, format_spec->start++);
+            *conversion = PyUnicode_READ_CHAR(str->str, str->start++);
 
-            /* if there is another character, it must be a colon */
-            if (format_spec->start < format_spec->end) {
-                c = PyUnicode_READ_CHAR(format_spec->str, format_spec->start++);
+            if (str->start < str->end) {
+                c = PyUnicode_READ_CHAR(str->str, str->start++);
+                if (c == '}')
+                    return 1;
                 if (c != ':') {
                     PyErr_SetString(PyExc_ValueError,
-                                    "expected ':' after format specifier");
+                                    "expected ':' after conversion specifier");
                     return 0;
                 }
             }
         }
+        format_spec->str = str->str;
+        format_spec->start = str->start;
+        count = 1;
+        while (str->start < str->end) {
+            switch ((c = PyUnicode_READ_CHAR(str->str, str->start++))) {
+            case '{':
+                *format_spec_needs_expanding = 1;
+                count++;
+                break;
+            case '}':
+                count--;
+                if (count == 0) {
+                    format_spec->end = str->start - 1;
+                    return 1;
+                }
+                break;
+            default:
+                break;
+            }
+        }
+
+        PyErr_SetString(PyExc_ValueError, "unmatched '{' in format spec");
+        return 0;
     }
-    else
-        /* end of string, there's no format_spec or conversion */
-        field_name->end = str->start;
+    else if (c != '}') {
+        PyErr_SetString(PyExc_ValueError, "expected '}' before end of string");
+        return 0;
+    }
 
     return 1;
 }
@@ -638,10 +668,9 @@
                     SubString *format_spec, Py_UCS4 *conversion,
                     int *format_spec_needs_expanding)
 {
-    int at_end, hit_format_spec;
+    int at_end;
     Py_UCS4 c = 0;
     Py_ssize_t start;
-    int count;
     Py_ssize_t len;
     int markup_follows = 0;
 
@@ -713,52 +742,12 @@
     if (!markup_follows)
         return 2;
 
-    /* this is markup, find the end of the string by counting nested
-       braces.  note that this prohibits escaped braces, so that
-       format_specs cannot have braces in them. */
+    /* this is markup; parse the field */
     *field_present = 1;
-    count = 1;
-
-    start = self->str.start;
-
-    /* we know we can't have a zero length string, so don't worry
-       about that case */
-    hit_format_spec = 0;
-    while (self->str.start < self->str.end) {
-        switch (c = PyUnicode_READ_CHAR(self->str.str, self->str.start++)) {
-        case ':':
-            if (!hit_format_spec) {
-                count = 1;
-                hit_format_spec = 1;
-            }
-            break;
-        case '{':
-            /* the format spec needs to be recursively expanded.
-               this is an optimization, and not strictly needed */
-            if (hit_format_spec)
-                *format_spec_needs_expanding = 1;
-            count++;
-            break;
-        case '}':
-            count--;
-            if (count <= 0) {
-                /* we're done.  parse and get out */
-                SubString s;
-
-                SubString_init(&s, self->str.str, start, self->str.start - 1);
-                if (parse_field(&s, field_name, format_spec, conversion) == 0)
-                    return 0;
-
-                /* success */
-                return 2;
-            }
-            break;
-        }
-    }
-
-    /* end of string while searching for matching '}' */
-    PyErr_SetString(PyExc_ValueError, "unmatched '{' in format");
-    return 0;
+    if (!parse_field(&self->str, field_name, format_spec,
+                     format_spec_needs_expanding, conversion))
+        return 0;
+    return 2;
 }
 
 
@@ -877,25 +866,19 @@
     SubString literal;
     SubString field_name;
     SubString format_spec;
-    Py_UCS4 conversion, maxchar;
-    Py_ssize_t sublen;
-    int err;
+    Py_UCS4 conversion;
 
     MarkupIterator_init(&iter, input->str, input->start, input->end);
     while ((result = MarkupIterator_next(&iter, &literal, &field_present,
                                          &field_name, &format_spec,
                                          &conversion,
                                          &format_spec_needs_expanding)) == 2) {
-        sublen = literal.end - literal.start;
-        if (sublen) {
-            maxchar = _PyUnicode_FindMaxChar(literal.str,
-                                             literal.start, literal.end);
-            err = _PyUnicodeWriter_Prepare(writer, sublen, maxchar);
-            if (err == -1)
+        if (literal.end != literal.start) {
+            if (!field_present && iter.str.start == iter.str.end)
+                writer->overallocate = 0;
+            if (_PyUnicodeWriter_WriteSubstring(writer, literal.str,
+                                                literal.start, literal.end) < 0)
                 return 0;
-            _PyUnicode_FastCopyCharacters(writer->buffer, writer->pos,
-                                          literal.str, literal.start, sublen);
-            writer->pos += sublen;
         }
 
         if (field_present) {
@@ -920,7 +903,6 @@
              int recursion_depth, AutoNumber *auto_number)
 {
     _PyUnicodeWriter writer;
-    Py_ssize_t minlen;
 
     /* check the recursion level */
     if (recursion_depth <= 0) {
@@ -929,8 +911,9 @@
         return NULL;
     }
 
-    minlen = PyUnicode_GET_LENGTH(input->str) + 100;
-    _PyUnicodeWriter_Init(&writer, minlen);
+    _PyUnicodeWriter_Init(&writer);
+    writer.overallocate = 1;
+    writer.min_length = PyUnicode_GET_LENGTH(input->str) + 100;
 
     if (!do_markup(input, args, kwargs, &writer, recursion_depth,
                    auto_number)) {
diff --git a/Objects/stringlib/unicodedefs.h b/Objects/stringlib/unicodedefs.h
index f16f21e..3db5629 100644
--- a/Objects/stringlib/unicodedefs.h
+++ b/Objects/stringlib/unicodedefs.h
@@ -21,17 +21,11 @@
 #define STRINGLIB_STR            PyUnicode_AS_UNICODE
 #define STRINGLIB_LEN            PyUnicode_GET_SIZE
 #define STRINGLIB_NEW            PyUnicode_FromUnicode
-#define STRINGLIB_RESIZE         PyUnicode_Resize
 #define STRINGLIB_CHECK          PyUnicode_Check
 #define STRINGLIB_CHECK_EXACT    PyUnicode_CheckExact
 
-#if PY_VERSION_HEX < 0x03000000
-#define STRINGLIB_TOSTR          PyObject_Unicode
-#define STRINGLIB_TOASCII        PyObject_Repr
-#else
 #define STRINGLIB_TOSTR          PyObject_Str
 #define STRINGLIB_TOASCII        PyObject_ASCII
-#endif
 
 #define STRINGLIB_WANT_CONTAINS_OBJ 1
 
diff --git a/Objects/structseq.c b/Objects/structseq.c
index c3b9a72..664344b 100644
--- a/Objects/structseq.c
+++ b/Objects/structseq.c
@@ -11,17 +11,20 @@
 /* Fields with this name have only a field index, not a field name.
    They are only allowed for indices < n_visible_fields. */
 char *PyStructSequence_UnnamedField = "unnamed field";
+_Py_IDENTIFIER(n_sequence_fields);
+_Py_IDENTIFIER(n_fields);
+_Py_IDENTIFIER(n_unnamed_fields);
 
 #define VISIBLE_SIZE(op) Py_SIZE(op)
 #define VISIBLE_SIZE_TP(tp) PyLong_AsLong( \
-                      PyDict_GetItemString((tp)->tp_dict, visible_length_key))
+                      _PyDict_GetItemId((tp)->tp_dict, &PyId_n_sequence_fields))
 
 #define REAL_SIZE_TP(tp) PyLong_AsLong( \
-                      PyDict_GetItemString((tp)->tp_dict, real_length_key))
+                      _PyDict_GetItemId((tp)->tp_dict, &PyId_n_fields))
 #define REAL_SIZE(op) REAL_SIZE_TP(Py_TYPE(op))
 
 #define UNNAMED_FIELDS_TP(tp) PyLong_AsLong( \
-                      PyDict_GetItemString((tp)->tp_dict, unnamed_fields_key))
+                      _PyDict_GetItemId((tp)->tp_dict, &PyId_n_unnamed_fields))
 #define UNNAMED_FIELDS(op) UNNAMED_FIELDS_TP(Py_TYPE(op))
 
 
@@ -59,7 +62,7 @@
 structseq_dealloc(PyStructSequence *obj)
 {
     Py_ssize_t i, size;
-    
+
     size = REAL_SIZE(obj);
     for (i = 0; i < size; ++i) {
         Py_XDECREF(obj->ob_item[i]);
@@ -230,8 +233,8 @@
 static PyObject *
 structseq_reduce(PyStructSequence* self)
 {
-    PyObject* tup;
-    PyObject* dict;
+    PyObject* tup = NULL;
+    PyObject* dict = NULL;
     PyObject* result;
     Py_ssize_t n_fields, n_visible_fields, n_unnamed_fields;
     int i;
@@ -240,15 +243,12 @@
     n_visible_fields = VISIBLE_SIZE(self);
     n_unnamed_fields = UNNAMED_FIELDS(self);
     tup = PyTuple_New(n_visible_fields);
-    if (!tup) {
-        return NULL;
-    }
+    if (!tup)
+        goto error;
 
     dict = PyDict_New();
-    if (!dict) {
-        Py_DECREF(tup);
-        return NULL;
-    }
+    if (!dict)
+        goto error;
 
     for (i = 0; i < n_visible_fields; i++) {
         Py_INCREF(self->ob_item[i]);
@@ -257,8 +257,8 @@
 
     for (; i < n_fields; i++) {
         char *n = Py_TYPE(self)->tp_members[i-n_unnamed_fields].name;
-        PyDict_SetItemString(dict, n,
-                             self->ob_item[i]);
+        if (PyDict_SetItemString(dict, n, self->ob_item[i]) < 0)
+            goto error;
     }
 
     result = Py_BuildValue("(O(OO))", Py_TYPE(self), tup, dict);
@@ -267,6 +267,11 @@
     Py_DECREF(dict);
 
     return result;
+
+error:
+    Py_XDECREF(tup);
+    Py_XDECREF(dict);
+    return NULL;
 }
 
 static PyMethodDef structseq_methods[] = {
@@ -315,12 +320,13 @@
     structseq_new,                              /* tp_new */
 };
 
-void
-PyStructSequence_InitType(PyTypeObject *type, PyStructSequence_Desc *desc)
+int
+PyStructSequence_InitType2(PyTypeObject *type, PyStructSequence_Desc *desc)
 {
     PyObject *dict;
     PyMemberDef* members;
     int n_members, n_unnamed_members, i, k;
+    PyObject *v;
 
 #ifdef Py_TRACE_REFS
     /* if the type object was chained, unchain it first
@@ -342,8 +348,10 @@
     type->tp_doc = desc->doc;
 
     members = PyMem_NEW(PyMemberDef, n_members-n_unnamed_members+1);
-    if (members == NULL)
-        return;
+    if (members == NULL) {
+        PyErr_NoMemory();
+        return -1;
+    }
 
     for (i = k = 0; i < n_members; ++i) {
         if (desc->fields[i].name == PyStructSequence_UnnamedField)
@@ -361,30 +369,56 @@
     type->tp_members = members;
 
     if (PyType_Ready(type) < 0)
-        return;
+        return -1;
     Py_INCREF(type);
 
     dict = type->tp_dict;
 #define SET_DICT_FROM_INT(key, value)                           \
     do {                                                        \
-        PyObject *v = PyLong_FromLong((long) value);            \
-        if (v != NULL) {                                        \
-            PyDict_SetItemString(dict, key, v);                 \
+        v = PyLong_FromLong((long) value);                      \
+        if (v == NULL)                                          \
+            return -1;                                          \
+        if (PyDict_SetItemString(dict, key, v) < 0) {           \
             Py_DECREF(v);                                       \
+            return -1;                                          \
         }                                                       \
+        Py_DECREF(v);                                           \
     } while (0)
 
     SET_DICT_FROM_INT(visible_length_key, desc->n_in_sequence);
     SET_DICT_FROM_INT(real_length_key, n_members);
     SET_DICT_FROM_INT(unnamed_fields_key, n_unnamed_members);
+
+    return 0;
+}
+
+void
+PyStructSequence_InitType(PyTypeObject *type, PyStructSequence_Desc *desc)
+{
+    (void)PyStructSequence_InitType2(type, desc);
 }
 
 PyTypeObject*
 PyStructSequence_NewType(PyStructSequence_Desc *desc)
 {
-    PyTypeObject *result = (PyTypeObject*)PyType_GenericAlloc(&PyType_Type, 0);
-    if (result != NULL) {
-        PyStructSequence_InitType(result, desc);
+    PyTypeObject *result;
+
+    result = (PyTypeObject*)PyType_GenericAlloc(&PyType_Type, 0);
+    if (result == NULL)
+        return NULL;
+    if (PyStructSequence_InitType2(result, desc) < 0) {
+        Py_DECREF(result);
+        return NULL;
     }
     return result;
 }
+
+int _PyStructSequence_Init(void)
+{
+    if (_PyUnicode_FromId(&PyId_n_sequence_fields) == NULL
+        || _PyUnicode_FromId(&PyId_n_fields) == NULL
+        || _PyUnicode_FromId(&PyId_n_unnamed_fields) == NULL)
+        return -1;
+
+    return 0;
+}
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c
index f815595..6fd4db3 100644
--- a/Objects/tupleobject.c
+++ b/Objects/tupleobject.c
@@ -63,9 +63,9 @@
 }
 
 PyObject *
-PyTuple_New(register Py_ssize_t size)
+PyTuple_New(Py_ssize_t size)
 {
-    register PyTupleObject *op;
+    PyTupleObject *op;
     Py_ssize_t i;
     if (size < 0) {
         PyErr_BadInternalCall();
@@ -122,7 +122,7 @@
 }
 
 Py_ssize_t
-PyTuple_Size(register PyObject *op)
+PyTuple_Size(PyObject *op)
 {
     if (!PyTuple_Check(op)) {
         PyErr_BadInternalCall();
@@ -133,7 +133,7 @@
 }
 
 PyObject *
-PyTuple_GetItem(register PyObject *op, register Py_ssize_t i)
+PyTuple_GetItem(PyObject *op, Py_ssize_t i)
 {
     if (!PyTuple_Check(op)) {
         PyErr_BadInternalCall();
@@ -147,10 +147,10 @@
 }
 
 int
-PyTuple_SetItem(register PyObject *op, register Py_ssize_t i, PyObject *newitem)
+PyTuple_SetItem(PyObject *op, Py_ssize_t i, PyObject *newitem)
 {
-    register PyObject *olditem;
-    register PyObject **p;
+    PyObject *olditem;
+    PyObject **p;
     if (!PyTuple_Check(op) || op->ob_refcnt != 1) {
         Py_XDECREF(newitem);
         PyErr_BadInternalCall();
@@ -224,10 +224,10 @@
 /* Methods */
 
 static void
-tupledealloc(register PyTupleObject *op)
+tupledealloc(PyTupleObject *op)
 {
-    register Py_ssize_t i;
-    register Py_ssize_t len =  Py_SIZE(op);
+    Py_ssize_t i;
+    Py_ssize_t len =  Py_SIZE(op);
     PyObject_GC_UnTrack(op);
     Py_TRASHCAN_SAFE_BEGIN(op)
     if (len > 0) {
@@ -255,20 +255,12 @@
 tuplerepr(PyTupleObject *v)
 {
     Py_ssize_t i, n;
-    PyObject *s = NULL;
-    _PyAccu acc;
-    static PyObject *sep = NULL;
+    _PyUnicodeWriter writer;
 
     n = Py_SIZE(v);
     if (n == 0)
         return PyUnicode_FromString("()");
 
-    if (sep == NULL) {
-        sep = PyUnicode_FromString(", ");
-        if (sep == NULL)
-            return NULL;
-    }
-
     /* While not mutable, it is still possible to end up with a cycle in a
        tuple through an object that stores itself within a tuple (and thus
        infinitely asks for the repr of itself). This should only be
@@ -278,40 +270,58 @@
         return i > 0 ? PyUnicode_FromString("(...)") : NULL;
     }
 
-    if (_PyAccu_Init(&acc))
-        goto error;
+    _PyUnicodeWriter_Init(&writer);
+    writer.overallocate = 1;
+    if (Py_SIZE(v) > 1) {
+        /* "(" + "1" + ", 2" * (len - 1) + ")" */
+        writer.min_length = 1 + 1 + (2 + 1) * (Py_SIZE(v) - 1) + 1;
+    }
+    else {
+        /* "(1,)" */
+        writer.min_length = 4;
+    }
 
-    s = PyUnicode_FromString("(");
-    if (s == NULL || _PyAccu_Accumulate(&acc, s))
+    if (_PyUnicodeWriter_WriteChar(&writer, '(') < 0)
         goto error;
-    Py_CLEAR(s);
 
     /* Do repr() on each element. */
     for (i = 0; i < n; ++i) {
+        PyObject *s;
+
+        if (i > 0) {
+            if (_PyUnicodeWriter_WriteASCIIString(&writer, ", ", 2) < 0)
+                goto error;
+        }
+
         if (Py_EnterRecursiveCall(" while getting the repr of a tuple"))
             goto error;
         s = PyObject_Repr(v->ob_item[i]);
         Py_LeaveRecursiveCall();
-        if (i > 0 && _PyAccu_Accumulate(&acc, sep))
+        if (s == NULL)
             goto error;
-        if (s == NULL || _PyAccu_Accumulate(&acc, s))
+
+        if (_PyUnicodeWriter_WriteStr(&writer, s) < 0) {
+            Py_DECREF(s);
             goto error;
-        Py_CLEAR(s);
+        }
+        Py_DECREF(s);
     }
-    if (n > 1)
-        s = PyUnicode_FromString(")");
-    else
-        s = PyUnicode_FromString(",)");
-    if (s == NULL || _PyAccu_Accumulate(&acc, s))
-        goto error;
-    Py_CLEAR(s);
+
+    writer.overallocate = 0;
+    if (n > 1) {
+        if (_PyUnicodeWriter_WriteChar(&writer, ')') < 0)
+            goto error;
+    }
+    else {
+        if (_PyUnicodeWriter_WriteASCIIString(&writer, ",)", 2) < 0)
+            goto error;
+    }
 
     Py_ReprLeave((PyObject *)v);
-    return _PyAccu_Finish(&acc);
+    return _PyUnicodeWriter_Finish(&writer);
 
 error:
-    _PyAccu_Destroy(&acc);
-    Py_XDECREF(s);
+    _PyUnicodeWriter_Dealloc(&writer);
     Py_ReprLeave((PyObject *)v);
     return NULL;
 }
@@ -322,15 +332,18 @@
 
      1082527, 1165049, 1082531, 1165057, 1247581, 1330103, 1082533,
      1330111, 1412633, 1165069, 1247599, 1495177, 1577699
+
+   Tests have shown that it's not worth to cache the hash value, see
+   issue #9685.
 */
 
 static Py_hash_t
 tuplehash(PyTupleObject *v)
 {
-    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 x;  /* Unsigned for defined overflow behavior. */
+    Py_hash_t y;
+    Py_ssize_t len = Py_SIZE(v);
+    PyObject **p;
     Py_uhash_t mult = _PyHASH_MULTIPLIER;
     x = 0x345678UL;
     p = v->ob_item;
@@ -367,7 +380,7 @@
 }
 
 static PyObject *
-tupleitem(register PyTupleObject *a, register Py_ssize_t i)
+tupleitem(PyTupleObject *a, Py_ssize_t i)
 {
     if (i < 0 || i >= Py_SIZE(a)) {
         PyErr_SetString(PyExc_IndexError, "tuple index out of range");
@@ -378,12 +391,12 @@
 }
 
 static PyObject *
-tupleslice(register PyTupleObject *a, register Py_ssize_t ilow,
-           register Py_ssize_t ihigh)
+tupleslice(PyTupleObject *a, Py_ssize_t ilow,
+           Py_ssize_t ihigh)
 {
-    register PyTupleObject *np;
+    PyTupleObject *np;
     PyObject **src, **dest;
-    register Py_ssize_t i;
+    Py_ssize_t i;
     Py_ssize_t len;
     if (ilow < 0)
         ilow = 0;
@@ -420,10 +433,10 @@
 }
 
 static PyObject *
-tupleconcat(register PyTupleObject *a, register PyObject *bb)
+tupleconcat(PyTupleObject *a, PyObject *bb)
 {
-    register Py_ssize_t size;
-    register Py_ssize_t i;
+    Py_ssize_t size;
+    Py_ssize_t i;
     PyObject **src, **dest;
     PyTupleObject *np;
     if (!PyTuple_Check(bb)) {
@@ -833,8 +846,8 @@
 int
 _PyTuple_Resize(PyObject **pv, Py_ssize_t newsize)
 {
-    register PyTupleObject *v;
-    register PyTupleObject *sv;
+    PyTupleObject *v;
+    PyTupleObject *sv;
     Py_ssize_t i;
     Py_ssize_t oldsize;
 
@@ -925,7 +938,7 @@
 
 typedef struct {
     PyObject_HEAD
-    long it_index;
+    Py_ssize_t it_index;
     PyTupleObject *it_seq; /* Set to NULL when iterator is exhausted */
 } tupleiterobject;
 
@@ -983,7 +996,7 @@
 tupleiter_reduce(tupleiterobject *it)
 {
     if (it->it_seq)
-        return Py_BuildValue("N(O)l", _PyObject_GetBuiltin("iter"),
+        return Py_BuildValue("N(O)n", _PyObject_GetBuiltin("iter"),
                              it->it_seq, it->it_index);
     else
         return Py_BuildValue("N(())", _PyObject_GetBuiltin("iter"));
@@ -992,7 +1005,7 @@
 static PyObject *
 tupleiter_setstate(tupleiterobject *it, PyObject *state)
 {
-    long index = PyLong_AsLong(state);
+    Py_ssize_t index = PyLong_AsSsize_t(state);
     if (index == -1 && PyErr_Occurred())
         return NULL;
     if (it->it_seq != NULL) {
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 8851fae..453bb50 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -35,19 +35,127 @@
 static struct method_cache_entry method_cache[1 << MCACHE_SIZE_EXP];
 static unsigned int next_version_tag = 0;
 
+/* alphabetical order */
+_Py_IDENTIFIER(__abstractmethods__);
 _Py_IDENTIFIER(__class__);
+_Py_IDENTIFIER(__delitem__);
 _Py_IDENTIFIER(__dict__);
 _Py_IDENTIFIER(__doc__);
-_Py_IDENTIFIER(__getitem__);
 _Py_IDENTIFIER(__getattribute__);
+_Py_IDENTIFIER(__getitem__);
 _Py_IDENTIFIER(__hash__);
+_Py_IDENTIFIER(__len__);
 _Py_IDENTIFIER(__module__);
 _Py_IDENTIFIER(__name__);
 _Py_IDENTIFIER(__new__);
+_Py_IDENTIFIER(__setitem__);
+_Py_IDENTIFIER(builtins);
 
 static PyObject *
 slot_tp_new(PyTypeObject *type, PyObject *args, PyObject *kwds);
 
+/*
+ * finds the beginning of the docstring's introspection signature.
+ * if present, returns a pointer pointing to the first '('.
+ * otherwise returns NULL.
+ *
+ * doesn't guarantee that the signature is valid, only that it
+ * has a valid prefix.  (the signature must also pass skip_signature.)
+ */
+static const char *
+find_signature(const char *name, const char *doc)
+{
+    const char *dot;
+    size_t length;
+
+    if (!doc)
+        return NULL;
+
+    assert(name != NULL);
+
+    /* for dotted names like classes, only use the last component */
+    dot = strrchr(name, '.');
+    if (dot)
+        name = dot + 1;
+
+    length = strlen(name);
+    if (strncmp(doc, name, length))
+        return NULL;
+    doc += length;
+    if (*doc != '(')
+        return NULL;
+    return doc;
+}
+
+#define SIGNATURE_END_MARKER         ")\n--\n\n"
+#define SIGNATURE_END_MARKER_LENGTH  6
+/*
+ * skips past the end of the docstring's instrospection signature.
+ * (assumes doc starts with a valid signature prefix.)
+ */
+static const char *
+skip_signature(const char *doc)
+{
+    while (*doc) {
+        if ((*doc == *SIGNATURE_END_MARKER) &&
+            !strncmp(doc, SIGNATURE_END_MARKER, SIGNATURE_END_MARKER_LENGTH))
+            return doc + SIGNATURE_END_MARKER_LENGTH;
+        if ((*doc == '\n') && (doc[1] == '\n'))
+            return NULL;
+        doc++;
+    }
+    return NULL;
+}
+
+static const char *
+_PyType_DocWithoutSignature(const char *name, const char *internal_doc)
+{
+    const char *doc = find_signature(name, internal_doc);
+
+    if (doc) {
+        doc = skip_signature(doc);
+        if (doc)
+            return doc;
+        }
+    return internal_doc;
+}
+
+PyObject *
+_PyType_GetDocFromInternalDoc(const char *name, const char *internal_doc)
+{
+    const char *doc = _PyType_DocWithoutSignature(name, internal_doc);
+
+    if (!doc) {
+        Py_INCREF(Py_None);
+        return Py_None;
+    }
+
+    return PyUnicode_FromString(doc);
+}
+
+PyObject *
+_PyType_GetTextSignatureFromInternalDoc(const char *name, const char *internal_doc)
+{
+    const char *start = find_signature(name, internal_doc);
+    const char *end;
+
+    if (start)
+        end = skip_signature(start);
+    else
+        end = NULL;
+    if (!end) {
+        Py_INCREF(Py_None);
+        return Py_None;
+    }
+
+    /* back "end" up until it points just past the final ')' */
+    end -= SIGNATURE_END_MARKER_LENGTH - 1;
+    assert((end - start) >= 2); /* should be "()" at least */
+    assert(end[-1] == ')');
+    assert(end[0] == '\n');
+    return PyUnicode_FromStringAndSize(start, end - start);
+}
+
 unsigned int
 PyType_ClearCache(void)
 {
@@ -94,16 +202,17 @@
        needed.
      */
     PyObject *raw, *ref;
-    Py_ssize_t i, n;
+    Py_ssize_t i;
 
     if (!PyType_HasFeature(type, Py_TPFLAGS_VALID_VERSION_TAG))
         return;
 
     raw = type->tp_subclasses;
     if (raw != NULL) {
-        n = PyList_GET_SIZE(raw);
-        for (i = 0; i < n; i++) {
-            ref = PyList_GET_ITEM(raw, i);
+        assert(PyDict_CheckExact(raw));
+        i = 0;
+        while (PyDict_Next(raw, &i, NULL, &ref)) {
+            assert(PyWeakref_CheckRef(ref));
             ref = PyWeakref_GET_OBJECT(ref);
             if (ref != Py_None) {
                 PyType_Modified((PyTypeObject *)ref);
@@ -336,11 +445,10 @@
 static PyObject *
 type_module(PyTypeObject *type, void *context)
 {
-    PyObject *mod;
     char *s;
 
     if (type->tp_flags & Py_TPFLAGS_HEAPTYPE) {
-        mod = _PyDict_GetItemId(type->tp_dict, &PyId___module__);
+        PyObject *mod = _PyDict_GetItemId(type->tp_dict, &PyId___module__);
         if (!mod) {
             PyErr_Format(PyExc_AttributeError, "__module__");
             return 0;
@@ -349,11 +457,14 @@
         return mod;
     }
     else {
+        PyObject *name;
         s = strrchr(type->tp_name, '.');
         if (s != NULL)
             return PyUnicode_FromStringAndSize(
                 type->tp_name, (Py_ssize_t)(s - type->tp_name));
-        return PyUnicode_FromString("builtins");
+        name = _PyUnicode_FromId(&PyId_builtins);
+        Py_XINCREF(name);
+        return name;
     }
 }
 
@@ -375,9 +486,11 @@
     /* type itself has an __abstractmethods__ descriptor (this). Don't return
        that. */
     if (type != &PyType_Type)
-        mod = PyDict_GetItemString(type->tp_dict, "__abstractmethods__");
+        mod = _PyDict_GetItemId(type->tp_dict, &PyId___abstractmethods__);
     if (!mod) {
-        PyErr_SetString(PyExc_AttributeError, "__abstractmethods__");
+        PyObject *message = _PyUnicode_FromId(&PyId___abstractmethods__);
+        if (message)
+            PyErr_SetObject(PyExc_AttributeError, message);
         return NULL;
     }
     Py_XINCREF(mod);
@@ -396,13 +509,15 @@
         abstract = PyObject_IsTrue(value);
         if (abstract < 0)
             return -1;
-        res = PyDict_SetItemString(type->tp_dict, "__abstractmethods__", value);
+        res = _PyDict_SetItemId(type->tp_dict, &PyId___abstractmethods__, value);
     }
     else {
         abstract = 0;
-        res = PyDict_DelItemString(type->tp_dict, "__abstractmethods__");
+        res = _PyDict_DelItemId(type->tp_dict, &PyId___abstractmethods__);
         if (res && PyErr_ExceptionMatches(PyExc_KeyError)) {
-            PyErr_SetString(PyExc_AttributeError, "__abstractmethods__");
+            PyObject *message = _PyUnicode_FromId(&PyId___abstractmethods__);
+            if (message)
+                PyErr_SetObject(PyExc_AttributeError, message);
             return -1;
         }
     }
@@ -428,6 +543,7 @@
 static int compatible_for_assignment(PyTypeObject *, PyTypeObject *, char *);
 static int add_subclass(PyTypeObject*, PyTypeObject*);
 static void remove_subclass(PyTypeObject *, PyTypeObject *);
+static void remove_all_subclasses(PyTypeObject *type, PyObject *bases);
 static void update_all_slots(PyTypeObject *);
 
 typedef int (*update_callback)(PyTypeObject *, void *);
@@ -441,15 +557,15 @@
 {
     PyTypeObject *subclass;
     PyObject *ref, *subclasses, *old_mro;
-    Py_ssize_t i, n;
+    Py_ssize_t i;
 
     subclasses = type->tp_subclasses;
     if (subclasses == NULL)
         return 0;
-    assert(PyList_Check(subclasses));
-    n = PyList_GET_SIZE(subclasses);
-    for (i = 0; i < n; i++) {
-        ref = PyList_GET_ITEM(subclasses, i);
+    assert(PyDict_CheckExact(subclasses));
+    i = 0;
+
+    while (PyDict_Next(subclasses, &i, NULL, &ref)) {
         assert(PyWeakref_CheckRef(ref));
         subclass = (PyTypeObject *)PyWeakref_GET_OBJECT(ref);
         assert(subclass != NULL);
@@ -568,13 +684,7 @@
     /* for now, sod that: just remove from all old_bases,
        add to all new_bases */
 
-    for (i = PyTuple_GET_SIZE(old_bases) - 1; i >= 0; i--) {
-        ob = PyTuple_GET_ITEM(old_bases, i);
-        if (PyType_Check(ob)) {
-            remove_subclass(
-                (PyTypeObject*)ob, type);
-        }
-    }
+    remove_all_subclasses(type, old_bases);
 
     for (i = PyTuple_GET_SIZE(value) - 1; i >= 0; i--) {
         ob = PyTuple_GET_ITEM(value, i);
@@ -620,8 +730,9 @@
 type_get_doc(PyTypeObject *type, void *context)
 {
     PyObject *result;
-    if (!(type->tp_flags & Py_TPFLAGS_HEAPTYPE) && type->tp_doc != NULL)
-        return PyUnicode_FromString(type->tp_doc);
+    if (!(type->tp_flags & Py_TPFLAGS_HEAPTYPE) && type->tp_doc != NULL) {
+        return _PyType_GetDocFromInternalDoc(type->tp_name, type->tp_doc);
+    }
     result = _PyDict_GetItemId(type->tp_dict, &PyId___doc__);
     if (result == NULL) {
         result = Py_None;
@@ -637,6 +748,12 @@
     return result;
 }
 
+static PyObject *
+type_get_text_signature(PyTypeObject *type, void *context)
+{
+    return _PyType_GetTextSignatureFromInternalDoc(type->tp_name, type->tp_doc);
+}
+
 static int
 type_set_doc(PyTypeObject *type, PyObject *value, void *context)
 {
@@ -683,6 +800,7 @@
      (setter)type_set_abstractmethods, NULL},
     {"__dict__",  (getter)type_dict,  NULL, NULL},
     {"__doc__", (getter)type_get_doc, (setter)type_set_doc, NULL},
+    {"__text_signature__", (getter)type_get_text_signature, NULL, NULL},
     {0}
 };
 
@@ -704,7 +822,7 @@
         return NULL;
     }
 
-    if (mod != NULL && PyUnicode_CompareWithASCIIString(mod, "builtins"))
+    if (mod != NULL && _PyUnicode_CompareWithId(mod, &PyId_builtins))
         rtn = PyUnicode_FromFormat("<class '%U.%U'>", mod, name);
     else
         rtn = PyUnicode_FromFormat("<class '%s'>", type->tp_name);
@@ -726,6 +844,13 @@
         return NULL;
     }
 
+#ifdef Py_DEBUG
+    /* type_call() must not be called with an exception set,
+       because it may clear it (directly or indirectly) and so the
+       caller looses its exception */
+    assert(!PyErr_Occurred());
+#endif
+
     obj = type->tp_new(type, args, kwds);
     if (obj != NULL) {
         /* Ugly exception: when the call was type(something),
@@ -740,10 +865,12 @@
         if (!PyType_IsSubtype(Py_TYPE(obj), type))
             return obj;
         type = Py_TYPE(obj);
-        if (type->tp_init != NULL &&
-            type->tp_init(obj, args, kwds) < 0) {
-            Py_DECREF(obj);
-            obj = NULL;
+        if (type->tp_init != NULL) {
+            int res = type->tp_init(obj, args, kwds);
+            if (res < 0) {
+                Py_DECREF(obj);
+                obj = NULL;
+            }
         }
     }
     return obj;
@@ -770,7 +897,7 @@
         Py_INCREF(type);
 
     if (type->tp_itemsize == 0)
-        PyObject_INIT(obj, type);
+        (void)PyObject_INIT(obj, type);
     else
         (void) PyObject_INIT_VAR((PyVarObject *)obj, type, nitems);
 
@@ -902,6 +1029,7 @@
     PyTypeObject *type, *base;
     destructor basedealloc;
     PyThreadState *tstate = PyThreadState_GET();
+    int has_finalizer;
 
     /* Extract the type; we expect it to be a heap type */
     type = Py_TYPE(self);
@@ -917,6 +1045,10 @@
            clear_slots(), or DECREF the dict, or clear weakrefs. */
 
         /* Maybe call finalizer; exit early if resurrected */
+        if (type->tp_finalize) {
+            if (PyObject_CallFinalizerFromDealloc(self) < 0)
+                return;
+        }
         if (type->tp_del) {
             type->tp_del(self);
             if (self->ob_refcnt > 0)
@@ -968,25 +1100,36 @@
         assert(base);
     }
 
-    /* If we added a weaklist, we clear it.      Do this *before* calling
-       the finalizer (__del__), clearing slots, or clearing the instance
-       dict. */
+    has_finalizer = type->tp_finalize || type->tp_del;
 
+    /* Maybe call finalizer; exit early if resurrected */
+    if (has_finalizer)
+        _PyObject_GC_TRACK(self);
+
+    if (type->tp_finalize) {
+        if (PyObject_CallFinalizerFromDealloc(self) < 0) {
+            /* Resurrected */
+            goto endlabel;
+        }
+    }
+    /* If we added a weaklist, we clear it.      Do this *before* calling
+       tp_del, clearing slots, or clearing the instance dict. */
     if (type->tp_weaklistoffset && !base->tp_weaklistoffset)
         PyObject_ClearWeakRefs(self);
 
-    /* Maybe call finalizer; exit early if resurrected */
     if (type->tp_del) {
-        _PyObject_GC_TRACK(self);
         type->tp_del(self);
-        if (self->ob_refcnt > 0)
-            goto endlabel;              /* resurrected */
-        else
-            _PyObject_GC_UNTRACK(self);
+        if (self->ob_refcnt > 0) {
+            /* Resurrected */
+            goto endlabel;
+        }
+    }
+    if (has_finalizer) {
+        _PyObject_GC_UNTRACK(self);
         /* New weakrefs could be created during the finalizer call.
-            If this occurs, clear them out without calling their
-            finalizers since they might rely on part of the object
-            being finalized that has already been destroyed. */
+           If this occurs, clear them out without calling their
+           finalizers since they might rely on part of the object
+           being finalized that has already been destroyed. */
         if (type->tp_weaklistoffset && !base->tp_weaklistoffset) {
             /* Modeled after GET_WEAKREFS_LISTPTR() */
             PyWeakReference **list = (PyWeakReference **) \
@@ -1446,8 +1589,10 @@
        that is not included in acc.
     */
     remain = (int *)PyMem_MALLOC(SIZEOF_INT*to_merge_size);
-    if (remain == NULL)
+    if (remain == NULL) {
+        PyErr_NoMemory();
         return -1;
+    }
     for (i = 0; i < to_merge_size; i++)
         remain[i] = 0;
 
@@ -1479,7 +1624,7 @@
         }
         ok = PyList_Append(acc, candidate);
         if (ok < 0) {
-            PyMem_Free(remain);
+            PyMem_FREE(remain);
             return -1;
         }
         for (j = 0; j < to_merge_size; j++) {
@@ -1939,7 +2084,7 @@
     return res;
 }
 
-long
+unsigned long
 PyType_GetFlags(PyTypeObject *type)
 {
     return type->tp_flags;
@@ -2108,7 +2253,7 @@
             if (!valid_identifier(tmp))
                 goto error;
             assert(PyUnicode_Check(tmp));
-            if (PyUnicode_CompareWithASCIIString(tmp, "__dict__") == 0) {
+            if (_PyUnicode_CompareWithId(tmp, &PyId___dict__) == 0) {
                 if (!may_add_dict || add_dict) {
                     PyErr_SetString(PyExc_TypeError,
                         "__dict__ slot disallowed: "
@@ -2139,7 +2284,7 @@
         for (i = j = 0; i < nslots; i++) {
             tmp = PyTuple_GET_ITEM(slots, i);
             if ((add_dict &&
-                 PyUnicode_CompareWithASCIIString(tmp, "__dict__") == 0) ||
+                 _PyUnicode_CompareWithId(tmp, &PyId___dict__) == 0) ||
                 (add_weak &&
                  PyUnicode_CompareWithASCIIString(tmp, "__weakref__") == 0))
                 continue;
@@ -2210,7 +2355,7 @@
 
     /* Initialize tp_flags */
     type->tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HEAPTYPE |
-        Py_TPFLAGS_BASETYPE;
+        Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_FINALIZE;
     if (base->tp_flags & Py_TPFLAGS_HAVE_GC)
         type->tp_flags |= Py_TPFLAGS_HAVE_GC;
 
@@ -2280,8 +2425,10 @@
             /* Silently truncate the docstring if it contains null bytes. */
             len = strlen(doc_str);
             tp_doc = (char *)PyObject_MALLOC(len + 1);
-            if (tp_doc == NULL)
+            if (tp_doc == NULL) {
+                PyErr_NoMemory();
                 goto error;
+            }
             memcpy(tp_doc, doc_str, len + 1);
             type->tp_doc = tp_doc;
         }
@@ -2325,9 +2472,6 @@
             type->tp_dictoffset = slotoffset;
         slotoffset += sizeof(PyObject *);
     }
-    if (type->tp_dictoffset) {
-        et->ht_cached_keys = _PyDict_NewKeysForClass();
-    }
     if (add_weak) {
         assert(!base->tp_itemsize);
         type->tp_weaklistoffset = slotoffset;
@@ -2377,6 +2521,10 @@
     /* Put the proper slots in place */
     fixup_slot_dispatchers(type);
 
+    if (type->tp_dictoffset) {
+        et->ht_cached_keys = _PyDict_NewKeysForClass();
+    }
+
     Py_DECREF(dict);
     return (PyObject *)type;
 
@@ -2401,7 +2549,7 @@
     char *s;
     char *res_start = (char*)res;
     PyType_Slot *slot;
-    
+
     /* Set the type name and qualname */
     s = strrchr(spec->name, '.');
     if (s == NULL)
@@ -2422,7 +2570,7 @@
     type->tp_name = spec->name;
     if (!type->tp_name)
         goto fail;
-    
+
     /* Adjust for empty tuple bases */
     if (!bases) {
         base = &PyBaseObject_Type;
@@ -2482,17 +2630,17 @@
         /* need to make a copy of the docstring slot, which usually
            points to a static string literal */
         if (slot->slot == Py_tp_doc) {
-            size_t len = strlen(slot->pfunc)+1;
+            const char *old_doc = _PyType_DocWithoutSignature(type->tp_name, slot->pfunc);
+            size_t len = strlen(old_doc)+1;
             char *tp_doc = PyObject_MALLOC(len);
-            if (tp_doc == NULL)
+            if (tp_doc == NULL) {
+                PyErr_NoMemory();
                 goto fail;
-            memcpy(tp_doc, slot->pfunc, len);
+            }
+            memcpy(tp_doc, old_doc, len);
             type->tp_doc = tp_doc;
         }
     }
-    if (type->tp_dictoffset) {
-        res->ht_cached_keys = _PyDict_NewKeysForClass();
-    }
     if (type->tp_dealloc == NULL) {
         /* It's a heap type, so needs the heap types' dealloc.
            subtype_dealloc will call the base type's tp_dealloc, if
@@ -2503,10 +2651,14 @@
     if (PyType_Ready(type) < 0)
         goto fail;
 
+    if (type->tp_dictoffset) {
+        res->ht_cached_keys = _PyDict_NewKeysForClass();
+    }
+
     /* Set type.__module__ */
     s = strrchr(spec->name, '.');
     if (s != NULL)
-        _PyDict_SetItemId(type->tp_dict, &PyId___module__, 
+        _PyDict_SetItemId(type->tp_dict, &PyId___module__,
             PyUnicode_FromStringAndSize(
                 spec->name, (Py_ssize_t)(s - spec->name)));
 
@@ -2523,6 +2675,19 @@
     return PyType_FromSpecWithBases(spec, NULL);
 }
 
+void *
+PyType_GetSlot(PyTypeObject *type, int slot)
+{
+    if (!PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE)) {
+        PyErr_BadInternalCall();
+        return NULL;
+    }
+    if (slot >= Py_ARRAY_LENGTH(slotoffsets)) {
+        /* Extension module requesting slot from a future version */
+        return NULL;
+    }
+    return  *(void**)(((char*)type) + slotoffsets[slot]);
+}
 
 /* Internal API to look for a name through the MRO.
    This returns a borrowed reference, and doesn't set an exception! */
@@ -2695,10 +2860,14 @@
 type_dealloc(PyTypeObject *type)
 {
     PyHeapTypeObject *et;
+    PyObject *tp, *val, *tb;
 
     /* Assert this is a heap-allocated type object */
     assert(type->tp_flags & Py_TPFLAGS_HEAPTYPE);
     _PyObject_GC_UNTRACK(type);
+    PyErr_Fetch(&tp, &val, &tb);
+    remove_all_subclasses(type, type->tp_bases);
+    PyErr_Restore(tp, val, tb);
     PyObject_ClearWeakRefs((PyObject *)type);
     et = (PyHeapTypeObject *)type;
     Py_XDECREF(type->tp_base);
@@ -2723,7 +2892,7 @@
 type_subclasses(PyTypeObject *type, PyObject *args_ignored)
 {
     PyObject *list, *raw, *ref;
-    Py_ssize_t i, n;
+    Py_ssize_t i;
 
     list = PyList_New(0);
     if (list == NULL)
@@ -2731,10 +2900,9 @@
     raw = type->tp_subclasses;
     if (raw == NULL)
         return list;
-    assert(PyList_Check(raw));
-    n = PyList_GET_SIZE(raw);
-    for (i = 0; i < n; i++) {
-        ref = PyList_GET_ITEM(raw, i);
+    assert(PyDict_CheckExact(raw));
+    i = 0;
+    while (PyDict_Next(raw, &i, NULL, &ref)) {
         assert(PyWeakref_CheckRef(ref));
         ref = PyWeakref_GET_OBJECT(ref);
         if (ref != Py_None) {
@@ -2867,6 +3035,8 @@
 };
 
 PyDoc_STRVAR(type_doc,
+/* this text signature cannot be accurate yet.  will fix.  --larry */
+"type(object_or_name, bases, dict)\n"
 "type(object) -> the object's type\n"
 "type(name, bases, dict) -> a new type");
 
@@ -2923,8 +3093,8 @@
            class's dict; the cycle will be broken that way.
 
        tp_subclasses:
-           A list of weak references can't be part of a cycle; and
-           lists have their own tp_clear.
+           A dict of weak references can't be part of a cycle; and
+           dicts have their own tp_clear.
 
        slots (in PyHeapTypeObject):
            A tuple of strings can't be part of a cycle.
@@ -3141,7 +3311,7 @@
         Py_XDECREF(mod);
         return NULL;
     }
-    if (mod != NULL && PyUnicode_CompareWithASCIIString(mod, "builtins"))
+    if (mod != NULL && _PyUnicode_CompareWithId(mod, &PyId_builtins))
         rtn = PyUnicode_FromFormat("<%U.%U object at %p>", mod, name, self);
     else
         rtn = PyUnicode_FromFormat("<%s object at %p>",
@@ -3178,9 +3348,14 @@
         break;
 
     case Py_NE:
-        /* By default, != returns the opposite of ==,
+        /* By default, __ne__() delegates to __eq__() and inverts the result,
            unless the latter returns NotImplemented. */
-        res = PyObject_RichCompare(self, other, Py_EQ);
+        if (self->ob_type->tp_richcompare == NULL) {
+            res = Py_NotImplemented;
+            Py_INCREF(res);
+            break;
+        }
+        res = (*self->ob_type->tp_richcompare)(self, other, Py_EQ);
         if (res != NULL && res != Py_NotImplemented) {
             int ok = PyObject_IsTrue(res);
             Py_DECREF(res);
@@ -3313,7 +3488,7 @@
                      "__class__ assignment: only for heap types");
         return -1;
     }
-    if (compatible_for_assignment(newto, oldto, "__class__")) {
+    if (compatible_for_assignment(oldto, newto, "__class__")) {
         Py_INCREF(newto);
         Py_TYPE(self) = newto;
         Py_DECREF(oldto);
@@ -3366,150 +3541,423 @@
     return PyImport_Import(copyreg_str);
 }
 
-static PyObject *
-slotnames(PyObject *cls)
+Py_LOCAL(PyObject *)
+_PyType_GetSlotNames(PyTypeObject *cls)
 {
-    PyObject *clsdict;
     PyObject *copyreg;
     PyObject *slotnames;
     _Py_IDENTIFIER(__slotnames__);
     _Py_IDENTIFIER(_slotnames);
 
-    clsdict = ((PyTypeObject *)cls)->tp_dict;
-    slotnames = _PyDict_GetItemId(clsdict, &PyId___slotnames__);
-    if (slotnames != NULL && PyList_Check(slotnames)) {
+    assert(PyType_Check(cls));
+
+    /* Get the slot names from the cache in the class if possible. */
+    slotnames = _PyDict_GetItemIdWithError(cls->tp_dict, &PyId___slotnames__);
+    if (slotnames != NULL) {
+        if (slotnames != Py_None && !PyList_Check(slotnames)) {
+            PyErr_Format(PyExc_TypeError,
+                         "%.200s.__slotnames__ should be a list or None, "
+                         "not %.200s",
+                         cls->tp_name, Py_TYPE(slotnames)->tp_name);
+            return NULL;
+        }
         Py_INCREF(slotnames);
         return slotnames;
     }
+    else {
+        if (PyErr_Occurred()) {
+            return NULL;
+        }
+        /* The class does not have the slot names cached yet. */
+    }
 
     copyreg = import_copyreg();
     if (copyreg == NULL)
         return NULL;
 
-    slotnames = _PyObject_CallMethodId(copyreg, &PyId__slotnames, "O", cls);
+    /* Use _slotnames function from the copyreg module to find the slots
+       by this class and its bases. This function will cache the result
+       in __slotnames__. */
+    slotnames = _PyObject_CallMethodIdObjArgs(copyreg, &PyId__slotnames,
+                                              cls, NULL);
     Py_DECREF(copyreg);
-    if (slotnames != NULL &&
-        slotnames != Py_None &&
-        !PyList_Check(slotnames))
-    {
+    if (slotnames == NULL)
+        return NULL;
+
+    if (slotnames != Py_None && !PyList_Check(slotnames)) {
         PyErr_SetString(PyExc_TypeError,
-            "copyreg._slotnames didn't return a list or None");
+                        "copyreg._slotnames didn't return a list or None");
         Py_DECREF(slotnames);
-        slotnames = NULL;
+        return NULL;
     }
 
     return slotnames;
 }
 
-static PyObject *
-reduce_2(PyObject *obj)
+Py_LOCAL(PyObject *)
+_PyObject_GetState(PyObject *obj)
 {
-    PyObject *cls, *getnewargs;
-    PyObject *args = NULL, *args2 = NULL;
-    PyObject *getstate = NULL, *state = NULL, *names = NULL;
-    PyObject *slots = NULL, *listitems = NULL, *dictitems = NULL;
-    PyObject *copyreg = NULL, *newobj = NULL, *res = NULL;
-    Py_ssize_t i, n;
-    _Py_IDENTIFIER(__getnewargs__);
+    PyObject *state;
+    PyObject *getstate;
     _Py_IDENTIFIER(__getstate__);
-    _Py_IDENTIFIER(__newobj__);
-
-    cls = (PyObject *) Py_TYPE(obj);
-
-    getnewargs = _PyObject_GetAttrId(obj, &PyId___getnewargs__);
-    if (getnewargs != NULL) {
-        args = PyObject_CallObject(getnewargs, NULL);
-        Py_DECREF(getnewargs);
-        if (args != NULL && !PyTuple_Check(args)) {
-            PyErr_Format(PyExc_TypeError,
-                "__getnewargs__ should return a tuple, "
-                "not '%.200s'", Py_TYPE(args)->tp_name);
-            goto end;
-        }
-    }
-    else {
-        PyErr_Clear();
-        args = PyTuple_New(0);
-    }
-    if (args == NULL)
-        goto end;
 
     getstate = _PyObject_GetAttrId(obj, &PyId___getstate__);
-    if (getstate != NULL) {
+    if (getstate == NULL) {
+        PyObject *slotnames;
+
+        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
+            return NULL;
+        }
+        PyErr_Clear();
+
+        {
+            PyObject **dict;
+            dict = _PyObject_GetDictPtr(obj);
+            /* It is possible that the object's dict is not initialized
+               yet. In this case, we will return None for the state.
+               We also return None if the dict is empty to make the behavior
+               consistent regardless whether the dict was initialized or not.
+               This make unit testing easier. */
+            if (dict != NULL && *dict != NULL && PyDict_Size(*dict) > 0) {
+                state = *dict;
+            }
+            else {
+                state = Py_None;
+            }
+            Py_INCREF(state);
+        }
+
+        slotnames = _PyType_GetSlotNames(Py_TYPE(obj));
+        if (slotnames == NULL) {
+            Py_DECREF(state);
+            return NULL;
+        }
+
+        assert(slotnames == Py_None || PyList_Check(slotnames));
+        if (slotnames != Py_None && Py_SIZE(slotnames) > 0) {
+            PyObject *slots;
+            Py_ssize_t slotnames_size, i;
+
+            slots = PyDict_New();
+            if (slots == NULL) {
+                Py_DECREF(slotnames);
+                Py_DECREF(state);
+                return NULL;
+            }
+
+            slotnames_size = Py_SIZE(slotnames);
+            for (i = 0; i < slotnames_size; i++) {
+                PyObject *name, *value;
+
+                name = PyList_GET_ITEM(slotnames, i);
+                value = PyObject_GetAttr(obj, name);
+                if (value == NULL) {
+                    if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
+                        goto error;
+                    }
+                    /* It is not an error if the attribute is not present. */
+                    PyErr_Clear();
+                }
+                else {
+                    int err = PyDict_SetItem(slots, name, value);
+                    Py_DECREF(value);
+                    if (err) {
+                        goto error;
+                    }
+                }
+
+                /* The list is stored on the class so it may mutates while we
+                   iterate over it */
+                if (slotnames_size != Py_SIZE(slotnames)) {
+                    PyErr_Format(PyExc_RuntimeError,
+                                 "__slotsname__ changed size during iteration");
+                    goto error;
+                }
+
+                /* We handle errors within the loop here. */
+                if (0) {
+                  error:
+                    Py_DECREF(slotnames);
+                    Py_DECREF(slots);
+                    Py_DECREF(state);
+                    return NULL;
+                }
+            }
+
+            /* If we found some slot attributes, pack them in a tuple along
+               the orginal attribute dictionary. */
+            if (PyDict_Size(slots) > 0) {
+                PyObject *state2;
+
+                state2 = PyTuple_Pack(2, state, slots);
+                Py_DECREF(state);
+                if (state2 == NULL) {
+                    Py_DECREF(slotnames);
+                    Py_DECREF(slots);
+                    return NULL;
+                }
+                state = state2;
+            }
+            Py_DECREF(slots);
+        }
+        Py_DECREF(slotnames);
+    }
+    else { /* getstate != NULL */
         state = PyObject_CallObject(getstate, NULL);
         Py_DECREF(getstate);
         if (state == NULL)
-            goto end;
+            return NULL;
     }
-    else {
-        PyObject **dict;
-        PyErr_Clear();
-        dict = _PyObject_GetDictPtr(obj);
-        if (dict && *dict)
-            state = *dict;
-        else
-            state = Py_None;
-        Py_INCREF(state);
-        names = slotnames(cls);
-        if (names == NULL)
-            goto end;
-        if (names != Py_None && PyList_GET_SIZE(names) > 0) {
-            assert(PyList_Check(names));
-            slots = PyDict_New();
-            if (slots == NULL)
-                goto end;
-            n = 0;
-            /* Can't pre-compute the list size; the list
-               is stored on the class so accessible to other
-               threads, which may be run by DECREF */
-            for (i = 0; i < PyList_GET_SIZE(names); i++) {
-                PyObject *name, *value;
-                name = PyList_GET_ITEM(names, i);
-                value = PyObject_GetAttr(obj, name);
-                if (value == NULL)
-                    PyErr_Clear();
-                else {
-                    int err = PyDict_SetItem(slots, name,
-                                             value);
-                    Py_DECREF(value);
-                    if (err)
-                        goto end;
-                    n++;
-                }
-            }
-            if (n) {
-                state = Py_BuildValue("(NO)", state, slots);
-                if (state == NULL)
-                    goto end;
-            }
+
+    return state;
+}
+
+Py_LOCAL(int)
+_PyObject_GetNewArguments(PyObject *obj, PyObject **args, PyObject **kwargs)
+{
+    PyObject *getnewargs, *getnewargs_ex;
+    _Py_IDENTIFIER(__getnewargs_ex__);
+    _Py_IDENTIFIER(__getnewargs__);
+
+    if (args == NULL || kwargs == NULL) {
+        PyErr_BadInternalCall();
+        return -1;
+    }
+
+    /* We first attempt to fetch the arguments for __new__ by calling
+       __getnewargs_ex__ on the object. */
+    getnewargs_ex = _PyObject_LookupSpecial(obj, &PyId___getnewargs_ex__);
+    if (getnewargs_ex != NULL) {
+        PyObject *newargs = PyObject_CallObject(getnewargs_ex, NULL);
+        Py_DECREF(getnewargs_ex);
+        if (newargs == NULL) {
+            return -1;
         }
+        if (!PyTuple_Check(newargs)) {
+            PyErr_Format(PyExc_TypeError,
+                         "__getnewargs_ex__ should return a tuple, "
+                         "not '%.200s'", Py_TYPE(newargs)->tp_name);
+            Py_DECREF(newargs);
+            return -1;
+        }
+        if (Py_SIZE(newargs) != 2) {
+            PyErr_Format(PyExc_ValueError,
+                         "__getnewargs_ex__ should return a tuple of "
+                         "length 2, not %zd", Py_SIZE(newargs));
+            Py_DECREF(newargs);
+            return -1;
+        }
+        *args = PyTuple_GET_ITEM(newargs, 0);
+        Py_INCREF(*args);
+        *kwargs = PyTuple_GET_ITEM(newargs, 1);
+        Py_INCREF(*kwargs);
+        Py_DECREF(newargs);
+
+        /* XXX We should perhaps allow None to be passed here. */
+        if (!PyTuple_Check(*args)) {
+            PyErr_Format(PyExc_TypeError,
+                         "first item of the tuple returned by "
+                         "__getnewargs_ex__ must be a tuple, not '%.200s'",
+                         Py_TYPE(*args)->tp_name);
+            Py_CLEAR(*args);
+            Py_CLEAR(*kwargs);
+            return -1;
+        }
+        if (!PyDict_Check(*kwargs)) {
+            PyErr_Format(PyExc_TypeError,
+                         "second item of the tuple returned by "
+                         "__getnewargs_ex__ must be a dict, not '%.200s'",
+                         Py_TYPE(*kwargs)->tp_name);
+            Py_CLEAR(*args);
+            Py_CLEAR(*kwargs);
+            return -1;
+        }
+        return 0;
+    } else if (PyErr_Occurred()) {
+        return -1;
+    }
+
+    /* The object does not have __getnewargs_ex__ so we fallback on using
+       __getnewargs__ instead. */
+    getnewargs = _PyObject_LookupSpecial(obj, &PyId___getnewargs__);
+    if (getnewargs != NULL) {
+        *args = PyObject_CallObject(getnewargs, NULL);
+        Py_DECREF(getnewargs);
+        if (*args == NULL) {
+            return -1;
+        }
+        if (!PyTuple_Check(*args)) {
+            PyErr_Format(PyExc_TypeError,
+                         "__getnewargs__ should return a tuple, "
+                         "not '%.200s'", Py_TYPE(*args)->tp_name);
+            Py_CLEAR(*args);
+            return -1;
+        }
+        *kwargs = NULL;
+        return 0;
+    } else if (PyErr_Occurred()) {
+        return -1;
+    }
+
+    /* The object does not have __getnewargs_ex__ and __getnewargs__. This may
+       means __new__ does not takes any arguments on this object, or that the
+       object does not implement the reduce protocol for pickling or
+       copying. */
+    *args = NULL;
+    *kwargs = NULL;
+    return 0;
+}
+
+Py_LOCAL(int)
+_PyObject_GetItemsIter(PyObject *obj, PyObject **listitems,
+                       PyObject **dictitems)
+{
+    if (listitems == NULL || dictitems == NULL) {
+        PyErr_BadInternalCall();
+        return -1;
     }
 
     if (!PyList_Check(obj)) {
-        listitems = Py_None;
-        Py_INCREF(listitems);
+        *listitems = Py_None;
+        Py_INCREF(*listitems);
     }
     else {
-        listitems = PyObject_GetIter(obj);
-        if (listitems == NULL)
-            goto end;
+        *listitems = PyObject_GetIter(obj);
+        if (*listitems == NULL)
+            return -1;
     }
 
     if (!PyDict_Check(obj)) {
-        dictitems = Py_None;
-        Py_INCREF(dictitems);
+        *dictitems = Py_None;
+        Py_INCREF(*dictitems);
     }
     else {
+        PyObject *items;
         _Py_IDENTIFIER(items);
-        PyObject *items = _PyObject_CallMethodId(obj, &PyId_items, "");
-        if (items == NULL)
-            goto end;
-        dictitems = PyObject_GetIter(items);
+
+        items = _PyObject_CallMethodIdObjArgs(obj, &PyId_items, NULL);
+        if (items == NULL) {
+            Py_CLEAR(*listitems);
+            return -1;
+        }
+        *dictitems = PyObject_GetIter(items);
         Py_DECREF(items);
-        if (dictitems == NULL)
-            goto end;
+        if (*dictitems == NULL) {
+            Py_CLEAR(*listitems);
+            return -1;
+        }
     }
 
+    assert(*listitems != NULL && *dictitems != NULL);
+
+    return 0;
+}
+
+static PyObject *
+reduce_4(PyObject *obj)
+{
+    PyObject *args = NULL, *kwargs = NULL;
+    PyObject *copyreg;
+    PyObject *newobj, *newargs, *state, *listitems, *dictitems;
+    PyObject *result;
+    _Py_IDENTIFIER(__newobj_ex__);
+
+    if (_PyObject_GetNewArguments(obj, &args, &kwargs) < 0) {
+        return NULL;
+    }
+    if (args == NULL) {
+        args = PyTuple_New(0);
+        if (args == NULL)
+            return NULL;
+    }
+    if (kwargs == NULL) {
+        kwargs = PyDict_New();
+        if (kwargs == NULL)
+            return NULL;
+    }
+
+    copyreg = import_copyreg();
+    if (copyreg == NULL) {
+        Py_DECREF(args);
+        Py_DECREF(kwargs);
+        return NULL;
+    }
+    newobj = _PyObject_GetAttrId(copyreg, &PyId___newobj_ex__);
+    Py_DECREF(copyreg);
+    if (newobj == NULL) {
+        Py_DECREF(args);
+        Py_DECREF(kwargs);
+        return NULL;
+    }
+    newargs = PyTuple_Pack(3, Py_TYPE(obj), args, kwargs);
+    Py_DECREF(args);
+    Py_DECREF(kwargs);
+    if (newargs == NULL) {
+        Py_DECREF(newobj);
+        return NULL;
+    }
+    state = _PyObject_GetState(obj);
+    if (state == NULL) {
+        Py_DECREF(newobj);
+        Py_DECREF(newargs);
+        return NULL;
+    }
+    if (_PyObject_GetItemsIter(obj, &listitems, &dictitems) < 0) {
+        Py_DECREF(newobj);
+        Py_DECREF(newargs);
+        Py_DECREF(state);
+        return NULL;
+    }
+
+    result = PyTuple_Pack(5, newobj, newargs, state, listitems, dictitems);
+    Py_DECREF(newobj);
+    Py_DECREF(newargs);
+    Py_DECREF(state);
+    Py_DECREF(listitems);
+    Py_DECREF(dictitems);
+    return result;
+}
+
+static PyObject *
+reduce_2(PyObject *obj)
+{
+    PyObject *cls;
+    PyObject *args = NULL, *args2 = NULL, *kwargs = NULL;
+    PyObject *state = NULL, *listitems = NULL, *dictitems = NULL;
+    PyObject *copyreg = NULL, *newobj = NULL, *res = NULL;
+    Py_ssize_t i, n;
+    _Py_IDENTIFIER(__newobj__);
+
+    if (_PyObject_GetNewArguments(obj, &args, &kwargs) < 0) {
+        return NULL;
+    }
+    if (args == NULL) {
+        assert(kwargs == NULL);
+        args = PyTuple_New(0);
+        if (args == NULL) {
+            return NULL;
+        }
+    }
+    else if (kwargs != NULL) {
+        if (PyDict_Size(kwargs) > 0) {
+            PyErr_SetString(PyExc_ValueError,
+                            "must use protocol 4 or greater to copy this "
+                            "object; since __getnewargs_ex__ returned "
+                            "keyword arguments.");
+            Py_DECREF(args);
+            Py_DECREF(kwargs);
+            return NULL;
+        }
+        Py_CLEAR(kwargs);
+    }
+
+    state = _PyObject_GetState(obj);
+    if (state == NULL)
+        goto end;
+
+    if (_PyObject_GetItemsIter(obj, &listitems, &dictitems) < 0)
+        goto end;
+
     copyreg = import_copyreg();
     if (copyreg == NULL)
         goto end;
@@ -3521,6 +3969,7 @@
     args2 = PyTuple_New(n+1);
     if (args2 == NULL)
         goto end;
+    cls = (PyObject *) Py_TYPE(obj);
     Py_INCREF(cls);
     PyTuple_SET_ITEM(args2, 0, cls);
     for (i = 0; i < n; i++) {
@@ -3534,9 +3983,7 @@
   end:
     Py_XDECREF(args);
     Py_XDECREF(args2);
-    Py_XDECREF(slots);
     Py_XDECREF(state);
-    Py_XDECREF(names);
     Py_XDECREF(listitems);
     Py_XDECREF(dictitems);
     Py_XDECREF(copyreg);
@@ -3564,7 +4011,9 @@
 {
     PyObject *copyreg, *res;
 
-    if (proto >= 2)
+    if (proto >= 4)
+        return reduce_4(self);
+    else if (proto >= 2)
         return reduce_2(self);
 
     copyreg = import_copyreg();
@@ -3669,16 +4118,9 @@
         /* Issue 7994: If we're converting to a string, we
            should reject format specifications */
         if (PyUnicode_GET_LENGTH(format_spec) > 0) {
-            if (PyErr_WarnEx(PyExc_DeprecationWarning,
-                             "object.__format__ with a non-empty format "
-                             "string is deprecated", 1) < 0) {
-              goto done;
-            }
-            /* Eventually this will become an error:
-               PyErr_Format(PyExc_TypeError,
+            PyErr_SetString(PyExc_TypeError,
                "non-empty format string passed to object.__format__");
-               goto done;
-            */
+            goto done;
         }
 
         result = PyObject_Format(self_as_str, format_spec);
@@ -3788,8 +4230,8 @@
     PyObject_GenericGetAttr,                    /* tp_getattro */
     PyObject_GenericSetAttr,                    /* tp_setattro */
     0,                                          /* tp_as_buffer */
-    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
-    PyDoc_STR("The most base type"),            /* tp_doc */
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,   /* tp_flags */
+    PyDoc_STR("object()\n--\n\nThe most base type"),  /* tp_doc */
     0,                                          /* tp_traverse */
     0,                                          /* tp_clear */
     object_richcompare,                         /* tp_richcompare */
@@ -3833,7 +4275,7 @@
             descr = PyDescr_NewClassMethod(type, meth);
         }
         else if (meth->ml_flags & METH_STATIC) {
-            PyObject *cfunc = PyCFunction_New(meth, (PyObject*)type);
+          PyObject *cfunc = PyCFunction_NewEx(meth, (PyObject*)type, NULL);
             if (cfunc == NULL)
                 return -1;
             descr = PyStaticMethod_New(cfunc);
@@ -4103,6 +4545,10 @@
         COPYSLOT(tp_init);
         COPYSLOT(tp_alloc);
         COPYSLOT(tp_is_gc);
+        if ((type->tp_flags & Py_TPFLAGS_HAVE_FINALIZE) &&
+            (base->tp_flags & Py_TPFLAGS_HAVE_FINALIZE)) {
+            COPYSLOT(tp_finalize);
+        }
         if ((type->tp_flags & Py_TPFLAGS_HAVE_GC) ==
             (base->tp_flags & Py_TPFLAGS_HAVE_GC)) {
             /* They agree about gc. */
@@ -4234,6 +4680,20 @@
             inherit_slots(type, (PyTypeObject *)b);
     }
 
+    /* All bases of statically allocated type should be statically allocated */
+    if (!(type->tp_flags & Py_TPFLAGS_HEAPTYPE))
+        for (i = 0; i < n; i++) {
+            PyObject *b = PyTuple_GET_ITEM(bases, i);
+            if (PyType_Check(b) &&
+                (((PyTypeObject *)b)->tp_flags & Py_TPFLAGS_HEAPTYPE)) {
+                PyErr_Format(PyExc_TypeError,
+                             "type '%.100s' is not dynamically allocated but "
+                             "its base type '%.100s' is dynamically allocated",
+                             type->tp_name, ((PyTypeObject *)b)->tp_name);
+                goto error;
+            }
+        }
+
     /* Sanity check for tp_free. */
     if (PyType_IS_GC(type) && (type->tp_flags & Py_TPFLAGS_BASETYPE) &&
         (type->tp_free == NULL || type->tp_free == PyObject_Del)) {
@@ -4252,14 +4712,20 @@
      */
     if (_PyDict_GetItemId(type->tp_dict, &PyId___doc__) == NULL) {
         if (type->tp_doc != NULL) {
-            PyObject *doc = PyUnicode_FromString(type->tp_doc);
+            const char *old_doc = _PyType_DocWithoutSignature(type->tp_name,
+                type->tp_doc);
+            PyObject *doc = PyUnicode_FromString(old_doc);
             if (doc == NULL)
                 goto error;
-            _PyDict_SetItemId(type->tp_dict, &PyId___doc__, doc);
+            if (_PyDict_SetItemId(type->tp_dict, &PyId___doc__, doc) < 0) {
+                Py_DECREF(doc);
+                goto error;
+            }
             Py_DECREF(doc);
         } else {
-            _PyDict_SetItemId(type->tp_dict,
-                              &PyId___doc__, Py_None);
+            if (_PyDict_SetItemId(type->tp_dict,
+                                  &PyId___doc__, Py_None) < 0)
+                goto error;
         }
     }
 
@@ -4303,13 +4769,11 @@
     /* Warn for a type that implements tp_compare (now known as
        tp_reserved) but not tp_richcompare. */
     if (type->tp_reserved && !type->tp_richcompare) {
-        int error;
-        error = PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
+        PyErr_Format(PyExc_TypeError,
             "Type %.100s defines tp_reserved (formerly tp_compare) "
             "but not tp_richcompare. Comparisons may not behave as intended.",
             type->tp_name);
-        if (error == -1)
-            goto error;
+        goto error;
     }
 
     /* All done -- set the ready flag */
@@ -4326,49 +4790,57 @@
 static int
 add_subclass(PyTypeObject *base, PyTypeObject *type)
 {
-    Py_ssize_t i;
-    int result;
-    PyObject *list, *ref, *newobj;
+    int result = -1;
+    PyObject *dict, *key, *newobj;
 
-    list = base->tp_subclasses;
-    if (list == NULL) {
-        base->tp_subclasses = list = PyList_New(0);
-        if (list == NULL)
+    dict = base->tp_subclasses;
+    if (dict == NULL) {
+        base->tp_subclasses = dict = PyDict_New();
+        if (dict == NULL)
             return -1;
     }
-    assert(PyList_Check(list));
+    assert(PyDict_CheckExact(dict));
+    key = PyLong_FromVoidPtr((void *) type);
+    if (key == NULL)
+        return -1;
     newobj = PyWeakref_NewRef((PyObject *)type, NULL);
-    i = PyList_GET_SIZE(list);
-    while (--i >= 0) {
-        ref = PyList_GET_ITEM(list, i);
-        assert(PyWeakref_CheckRef(ref));
-        if (PyWeakref_GET_OBJECT(ref) == Py_None)
-            return PyList_SetItem(list, i, newobj);
+    if (newobj != NULL) {
+        result = PyDict_SetItem(dict, key, newobj);
+        Py_DECREF(newobj);
     }
-    result = PyList_Append(list, newobj);
-    Py_DECREF(newobj);
+    Py_DECREF(key);
     return result;
 }
 
 static void
 remove_subclass(PyTypeObject *base, PyTypeObject *type)
 {
-    Py_ssize_t i;
-    PyObject *list, *ref;
+    PyObject *dict, *key;
 
-    list = base->tp_subclasses;
-    if (list == NULL) {
+    dict = base->tp_subclasses;
+    if (dict == NULL) {
         return;
     }
-    assert(PyList_Check(list));
-    i = PyList_GET_SIZE(list);
-    while (--i >= 0) {
-        ref = PyList_GET_ITEM(list, i);
-        assert(PyWeakref_CheckRef(ref));
-        if (PyWeakref_GET_OBJECT(ref) == (PyObject*)type) {
-            /* this can't fail, right? */
-            PySequence_DelItem(list, i);
-            return;
+    assert(PyDict_CheckExact(dict));
+    key = PyLong_FromVoidPtr((void *) type);
+    if (key == NULL || PyDict_DelItem(dict, key)) {
+        /* This can happen if the type initialization errored out before
+           the base subclasses were updated (e.g. a non-str __qualname__
+           was passed in the type dict). */
+        PyErr_Clear();
+    }
+    Py_XDECREF(key);
+}
+
+static void
+remove_all_subclasses(PyTypeObject *type, PyObject *bases)
+{
+    if (bases) {
+        Py_ssize_t i;
+        for (i = 0; i < PyTuple_GET_SIZE(bases); i++) {
+            PyObject *base = PyTuple_GET_ITEM(bases, i);
+            if (PyType_Check(base))
+                remove_subclass((PyTypeObject*) base, type);
         }
     }
 }
@@ -4725,6 +5197,18 @@
 }
 
 static PyObject *
+wrap_del(PyObject *self, PyObject *args, void *wrapped)
+{
+    destructor func = (destructor)wrapped;
+
+    if (!check_num_args(args, 0))
+        return NULL;
+
+    (*func)(self);
+    Py_RETURN_NONE;
+}
+
+static PyObject *
 wrap_richcmpfunc(PyObject *self, PyObject *args, void *wrapped, int op)
 {
     richcmpfunc func = (richcmpfunc)wrapped;
@@ -4877,7 +5361,7 @@
                      "%s.__new__(%s) is not safe, use %s.__new__()",
                      type->tp_name,
                      subtype->tp_name,
-                     staticbase == NULL ? "?" : staticbase->tp_name);
+                     staticbase->tp_name);
         return NULL;
     }
 
@@ -4891,8 +5375,9 @@
 
 static struct PyMethodDef tp_new_methoddef[] = {
     {"__new__", (PyCFunction)tp_new_wrapper, METH_VARARGS|METH_KEYWORDS,
-     PyDoc_STR("T.__new__(S, ...) -> "
-               "a new object with type S, a subtype of T")},
+     PyDoc_STR("__new__($type, *args, **kwargs)\n--\n\n"
+               "Create and return a new object.  "
+               "See help(type) for accurate signature.")},
     {0}
 };
 
@@ -4903,7 +5388,7 @@
 
     if (_PyDict_GetItemId(type->tp_dict, &PyId___new__) != NULL)
         return 0;
-    func = PyCFunction_New(tp_new_methoddef, (PyObject *)type);
+    func = PyCFunction_NewEx(tp_new_methoddef, (PyObject *)type, NULL);
     if (func == NULL)
         return -1;
     if (_PyDict_SetItemId(type->tp_dict, &PyId___new__, func)) {
@@ -5015,7 +5500,6 @@
 static Py_ssize_t
 slot_sq_length(PyObject *self)
 {
-    _Py_IDENTIFIER(__len__);
     PyObject *res = call_method(self, &PyId___len__, "()");
     Py_ssize_t len;
 
@@ -5076,8 +5560,6 @@
 slot_sq_ass_item(PyObject *self, Py_ssize_t index, PyObject *value)
 {
     PyObject *res;
-    _Py_IDENTIFIER(__delitem__);
-    _Py_IDENTIFIER(__setitem__);
 
     if (value == NULL)
         res = call_method(self, &PyId___delitem__, "(n)", index);
@@ -5127,8 +5609,6 @@
 slot_mp_ass_subscript(PyObject *self, PyObject *key, PyObject *value)
 {
     PyObject *res;
-    _Py_IDENTIFIER(__delitem__);
-    _Py_IDENTIFIER(__setitem__);
 
     if (value == NULL)
         res = call_method(self, &PyId___delitem__, "(O)", key);
@@ -5179,7 +5659,6 @@
     PyObject *func, *args;
     int result = -1;
     int using_len = 0;
-    _Py_IDENTIFIER(__len__);
     _Py_IDENTIFIER(__bool__);
 
     func = lookup_maybe(self, &PyId___bool__);
@@ -5281,28 +5760,11 @@
     _Py_IDENTIFIER(__str__);
 
     func = lookup_method(self, &PyId___str__);
-    if (func != NULL) {
-        res = PyEval_CallObject(func, NULL);
-        Py_DECREF(func);
-        return res;
-    }
-    else {
-        /* PyObject *ress; */
-        PyErr_Clear();
-        res = slot_tp_repr(self);
-        if (!res)
-            return NULL;
-        /* XXX this is non-sensical. Why should we return
-           a bytes object from __str__. Is this code even
-           used? - mvl */
-        assert(0);
-        return res;
-        /*
-        ress = _PyUnicode_AsDefaultEncodedString(res);
-        Py_DECREF(res);
-        return ress;
-        */
-    }
+    if (func == NULL)
+        return NULL;
+    res = PyEval_CallObject(func, NULL);
+    Py_DECREF(func);
+    return res;
 }
 
 static Py_hash_t
@@ -5598,7 +6060,6 @@
     PyObject *func;
     PyObject *newargs, *x;
     Py_ssize_t i, n;
-    _Py_IDENTIFIER(__new__);
 
     func = _PyObject_GetAttrId((PyObject *)type, &PyId___new__);
     if (func == NULL)
@@ -5622,16 +6083,12 @@
 }
 
 static void
-slot_tp_del(PyObject *self)
+slot_tp_finalize(PyObject *self)
 {
     _Py_IDENTIFIER(__del__);
     PyObject *del, *res;
     PyObject *error_type, *error_value, *error_traceback;
 
-    /* Temporarily resurrect the object. */
-    assert(self->ob_refcnt == 0);
-    self->ob_refcnt = 1;
-
     /* Save the current exception, if any. */
     PyErr_Fetch(&error_type, &error_value, &error_traceback);
 
@@ -5648,37 +6105,6 @@
 
     /* Restore the saved exception. */
     PyErr_Restore(error_type, error_value, error_traceback);
-
-    /* Undo the temporary resurrection; can't use DECREF here, it would
-     * cause a recursive call.
-     */
-    assert(self->ob_refcnt > 0);
-    if (--self->ob_refcnt == 0)
-        return;         /* this is the normal path out */
-
-    /* __del__ resurrected it!  Make it look like the original Py_DECREF
-     * never happened.
-     */
-    {
-        Py_ssize_t refcnt = self->ob_refcnt;
-        _Py_NewReference(self);
-        self->ob_refcnt = refcnt;
-    }
-    assert(!PyType_IS_GC(Py_TYPE(self)) ||
-           _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
-    /* If Py_REF_DEBUG, _Py_NewReference bumped _Py_RefTotal, so
-     * we need to undo that. */
-    _Py_DEC_REFTOTAL;
-    /* If Py_TRACE_REFS, _Py_NewReference re-added self to the object
-     * chain, so no more to do there.
-     * If COUNT_ALLOCS, the original decref bumped tp_frees, and
-     * _Py_NewReference bumped tp_allocs:  both of those need to be
-     * undone.
-     */
-#ifdef COUNT_ALLOCS
-    --Py_TYPE(self)->tp_frees;
-    --Py_TYPE(self)->tp_allocs;
-#endif
 }
 
 
@@ -5723,22 +6149,22 @@
     ETSLOT(NAME, as_number.SLOT, FUNCTION, WRAPPER, DOC)
 #define UNSLOT(NAME, SLOT, FUNCTION, WRAPPER, DOC) \
     ETSLOT(NAME, as_number.SLOT, FUNCTION, WRAPPER, \
-           "x." NAME "() <==> " DOC)
+           NAME "($self, /)\n--\n\n" DOC)
 #define IBSLOT(NAME, SLOT, FUNCTION, WRAPPER, DOC) \
     ETSLOT(NAME, as_number.SLOT, FUNCTION, WRAPPER, \
-           "x." NAME "(y) <==> x" DOC "y")
+           NAME "($self, value, /)\n--\n\nReturn self" DOC "value.")
 #define BINSLOT(NAME, SLOT, FUNCTION, DOC) \
     ETSLOT(NAME, as_number.SLOT, FUNCTION, wrap_binaryfunc_l, \
-           "x." NAME "(y) <==> x" DOC "y")
+           NAME "($self, value, /)\n--\n\nReturn self" DOC "value.")
 #define RBINSLOT(NAME, SLOT, FUNCTION, DOC) \
     ETSLOT(NAME, as_number.SLOT, FUNCTION, wrap_binaryfunc_r, \
-           "x." NAME "(y) <==> y" DOC "x")
+           NAME "($self, value, /)\n--\n\nReturn value" DOC "self.")
 #define BINSLOTNOTINFIX(NAME, SLOT, FUNCTION, DOC) \
     ETSLOT(NAME, as_number.SLOT, FUNCTION, wrap_binaryfunc_l, \
-           "x." NAME "(y) <==> " DOC)
+           NAME "($self, value, /)\n--\n\n" DOC)
 #define RBINSLOTNOTINFIX(NAME, SLOT, FUNCTION, DOC) \
     ETSLOT(NAME, as_number.SLOT, FUNCTION, wrap_binaryfunc_r, \
-           "x." NAME "(y) <==> " DOC)
+           NAME "($self, value, /)\n--\n\n" DOC)
 
 static slotdef slotdefs[] = {
     TPSLOT("__getattribute__", tp_getattr, NULL, NULL, ""),
@@ -5746,80 +6172,85 @@
     TPSLOT("__setattr__", tp_setattr, NULL, NULL, ""),
     TPSLOT("__delattr__", tp_setattr, NULL, NULL, ""),
     TPSLOT("__repr__", tp_repr, slot_tp_repr, wrap_unaryfunc,
-           "x.__repr__() <==> repr(x)"),
+           "__repr__($self, /)\n--\n\nReturn repr(self)."),
     TPSLOT("__hash__", tp_hash, slot_tp_hash, wrap_hashfunc,
-           "x.__hash__() <==> hash(x)"),
+           "__hash__($self, /)\n--\n\nReturn hash(self)."),
     FLSLOT("__call__", tp_call, slot_tp_call, (wrapperfunc)wrap_call,
-           "x.__call__(...) <==> x(...)", PyWrapperFlag_KEYWORDS),
+           "__call__($self, /, *args, **kwargs)\n--\n\nCall self as a function.",
+           PyWrapperFlag_KEYWORDS),
     TPSLOT("__str__", tp_str, slot_tp_str, wrap_unaryfunc,
-           "x.__str__() <==> str(x)"),
+           "__str__($self, /)\n--\n\nReturn str(self)."),
     TPSLOT("__getattribute__", tp_getattro, slot_tp_getattr_hook,
-           wrap_binaryfunc, "x.__getattribute__('name') <==> x.name"),
+           wrap_binaryfunc,
+           "__getattribute__($self, name, /)\n--\n\nReturn getattr(self, name)."),
     TPSLOT("__getattr__", tp_getattro, slot_tp_getattr_hook, NULL, ""),
     TPSLOT("__setattr__", tp_setattro, slot_tp_setattro, wrap_setattr,
-           "x.__setattr__('name', value) <==> x.name = value"),
+           "__setattr__($self, name, value, /)\n--\n\nImplement setattr(self, name, value)."),
     TPSLOT("__delattr__", tp_setattro, slot_tp_setattro, wrap_delattr,
-           "x.__delattr__('name') <==> del x.name"),
+           "__delattr__($self, name, /)\n--\n\nImplement delattr(self, name)."),
     TPSLOT("__lt__", tp_richcompare, slot_tp_richcompare, richcmp_lt,
-           "x.__lt__(y) <==> x<y"),
+           "__lt__($self, value, /)\n--\n\nReturn self<value."),
     TPSLOT("__le__", tp_richcompare, slot_tp_richcompare, richcmp_le,
-           "x.__le__(y) <==> x<=y"),
+           "__le__($self, value, /)\n--\n\nReturn self<=value."),
     TPSLOT("__eq__", tp_richcompare, slot_tp_richcompare, richcmp_eq,
-           "x.__eq__(y) <==> x==y"),
+           "__eq__($self, value, /)\n--\n\nReturn self==value."),
     TPSLOT("__ne__", tp_richcompare, slot_tp_richcompare, richcmp_ne,
-           "x.__ne__(y) <==> x!=y"),
+           "__ne__($self, value, /)\n--\n\nReturn self!=value."),
     TPSLOT("__gt__", tp_richcompare, slot_tp_richcompare, richcmp_gt,
-           "x.__gt__(y) <==> x>y"),
+           "__gt__($self, value, /)\n--\n\nReturn self>value."),
     TPSLOT("__ge__", tp_richcompare, slot_tp_richcompare, richcmp_ge,
-           "x.__ge__(y) <==> x>=y"),
+           "__ge__($self, value, /)\n--\n\nReturn self>=value."),
     TPSLOT("__iter__", tp_iter, slot_tp_iter, wrap_unaryfunc,
-           "x.__iter__() <==> iter(x)"),
+           "__iter__($self, /)\n--\n\nImplement iter(self)."),
     TPSLOT("__next__", tp_iternext, slot_tp_iternext, wrap_next,
-           "x.__next__() <==> next(x)"),
+           "__next__($self, /)\n--\n\nImplement next(self)."),
     TPSLOT("__get__", tp_descr_get, slot_tp_descr_get, wrap_descr_get,
-           "descr.__get__(obj[, type]) -> value"),
+           "__get__($self, instance, owner, /)\n--\n\nReturn an attribute of instance, which is of type owner."),
     TPSLOT("__set__", tp_descr_set, slot_tp_descr_set, wrap_descr_set,
-           "descr.__set__(obj, value)"),
+           "__set__($self, instance, value, /)\n--\n\nSet an attribute of instance to value."),
     TPSLOT("__delete__", tp_descr_set, slot_tp_descr_set,
-           wrap_descr_delete, "descr.__delete__(obj)"),
+           wrap_descr_delete,
+           "__delete__($self, instance, /)\n--\n\nDelete an attribute of instance."),
     FLSLOT("__init__", tp_init, slot_tp_init, (wrapperfunc)wrap_init,
-           "x.__init__(...) initializes x; "
-           "see help(type(x)) for signature",
+           "__init__($self, /, *args, **kwargs)\n--\n\n"
+           "Initialize self.  See help(type(self)) for accurate signature.",
            PyWrapperFlag_KEYWORDS),
-    TPSLOT("__new__", tp_new, slot_tp_new, NULL, ""),
-    TPSLOT("__del__", tp_del, slot_tp_del, NULL, ""),
+    TPSLOT("__new__", tp_new, slot_tp_new, NULL,
+           "__new__(type, /, *args, **kwargs)\n--\n\n"
+           "Create and return new object.  See help(type) for accurate signature."),
+    TPSLOT("__del__", tp_finalize, slot_tp_finalize, (wrapperfunc)wrap_del, ""),
 
     BINSLOT("__add__", nb_add, slot_nb_add,
-        "+"),
+           "+"),
     RBINSLOT("__radd__", nb_add, slot_nb_add,
-             "+"),
+           "+"),
     BINSLOT("__sub__", nb_subtract, slot_nb_subtract,
-        "-"),
+           "-"),
     RBINSLOT("__rsub__", nb_subtract, slot_nb_subtract,
-             "-"),
+           "-"),
     BINSLOT("__mul__", nb_multiply, slot_nb_multiply,
-        "*"),
+           "*"),
     RBINSLOT("__rmul__", nb_multiply, slot_nb_multiply,
-             "*"),
+           "*"),
     BINSLOT("__mod__", nb_remainder, slot_nb_remainder,
-        "%"),
+           "%"),
     RBINSLOT("__rmod__", nb_remainder, slot_nb_remainder,
-             "%"),
+           "%"),
     BINSLOTNOTINFIX("__divmod__", nb_divmod, slot_nb_divmod,
-        "divmod(x, y)"),
+           "Return divmod(self, value)."),
     RBINSLOTNOTINFIX("__rdivmod__", nb_divmod, slot_nb_divmod,
-             "divmod(y, x)"),
+           "Return divmod(value, self)."),
     NBSLOT("__pow__", nb_power, slot_nb_power, wrap_ternaryfunc,
-           "x.__pow__(y[, z]) <==> pow(x, y[, z])"),
+           "__pow__($self, value, mod=None, /)\n--\n\nReturn pow(self, value, mod)."),
     NBSLOT("__rpow__", nb_power, slot_nb_power, wrap_ternaryfunc_r,
-           "y.__rpow__(x[, z]) <==> pow(x, y[, z])"),
-    UNSLOT("__neg__", nb_negative, slot_nb_negative, wrap_unaryfunc, "-x"),
-    UNSLOT("__pos__", nb_positive, slot_nb_positive, wrap_unaryfunc, "+x"),
+           "__rpow__($self, value, mod=None, /)\n--\n\nReturn pow(value, self, mod)."),
+    UNSLOT("__neg__", nb_negative, slot_nb_negative, wrap_unaryfunc, "-self"),
+    UNSLOT("__pos__", nb_positive, slot_nb_positive, wrap_unaryfunc, "+self"),
     UNSLOT("__abs__", nb_absolute, slot_nb_absolute, wrap_unaryfunc,
-           "abs(x)"),
+           "abs(self)"),
     UNSLOT("__bool__", nb_bool, slot_nb_bool, wrap_inquirypred,
-           "x != 0"),
-    UNSLOT("__invert__", nb_invert, slot_nb_invert, wrap_unaryfunc, "~x"),
+           "self != 0"),
+    UNSLOT("__invert__", nb_invert, slot_nb_invert, wrap_unaryfunc, "~self"),
     BINSLOT("__lshift__", nb_lshift, slot_nb_lshift, "<<"),
     RBINSLOT("__rlshift__", nb_lshift, slot_nb_lshift, "<<"),
     BINSLOT("__rshift__", nb_rshift, slot_nb_rshift, ">>"),
@@ -5831,9 +6262,9 @@
     BINSLOT("__or__", nb_or, slot_nb_or, "|"),
     RBINSLOT("__ror__", nb_or, slot_nb_or, "|"),
     UNSLOT("__int__", nb_int, slot_nb_int, wrap_unaryfunc,
-           "int(x)"),
+           "int(self)"),
     UNSLOT("__float__", nb_float, slot_nb_float, wrap_unaryfunc,
-           "float(x)"),
+           "float(self)"),
     IBSLOT("__iadd__", nb_inplace_add, slot_nb_inplace_add,
            wrap_binaryfunc, "+="),
     IBSLOT("__isub__", nb_inplace_subtract, slot_nb_inplace_subtract,
@@ -5859,49 +6290,52 @@
     BINSLOT("__truediv__", nb_true_divide, slot_nb_true_divide, "/"),
     RBINSLOT("__rtruediv__", nb_true_divide, slot_nb_true_divide, "/"),
     IBSLOT("__ifloordiv__", nb_inplace_floor_divide,
-           slot_nb_inplace_floor_divide, wrap_binaryfunc, "//"),
+           slot_nb_inplace_floor_divide, wrap_binaryfunc, "//="),
     IBSLOT("__itruediv__", nb_inplace_true_divide,
-           slot_nb_inplace_true_divide, wrap_binaryfunc, "/"),
+           slot_nb_inplace_true_divide, wrap_binaryfunc, "/="),
     NBSLOT("__index__", nb_index, slot_nb_index, wrap_unaryfunc,
-           "x[y:z] <==> x[y.__index__():z.__index__()]"),
-
+           "__index__($self, /)\n--\n\n"
+           "Return self converted to an integer, if self is suitable "
+           "for use as an index into a list."),
     MPSLOT("__len__", mp_length, slot_mp_length, wrap_lenfunc,
-           "x.__len__() <==> len(x)"),
+           "__len__($self, /)\n--\n\nReturn len(self)."),
     MPSLOT("__getitem__", mp_subscript, slot_mp_subscript,
            wrap_binaryfunc,
-           "x.__getitem__(y) <==> x[y]"),
+           "__getitem__($self, key, /)\n--\n\nReturn self[key]."),
     MPSLOT("__setitem__", mp_ass_subscript, slot_mp_ass_subscript,
            wrap_objobjargproc,
-           "x.__setitem__(i, y) <==> x[i]=y"),
+           "__setitem__($self, key, value, /)\n--\n\nSet self[key] to value."),
     MPSLOT("__delitem__", mp_ass_subscript, slot_mp_ass_subscript,
            wrap_delitem,
-           "x.__delitem__(y) <==> del x[y]"),
+           "__delitem__($self, key, /)\n--\n\nDelete self[key]."),
 
     SQSLOT("__len__", sq_length, slot_sq_length, wrap_lenfunc,
-           "x.__len__() <==> len(x)"),
+           "__len__($self, /)\n--\n\nReturn len(self)."),
     /* Heap types defining __add__/__mul__ have sq_concat/sq_repeat == NULL.
        The logic in abstract.c always falls back to nb_add/nb_multiply in
        this case.  Defining both the nb_* and the sq_* slots to call the
        user-defined methods has unexpected side-effects, as shown by
        test_descr.notimplemented() */
     SQSLOT("__add__", sq_concat, NULL, wrap_binaryfunc,
-      "x.__add__(y) <==> x+y"),
+           "__add__($self, value, /)\n--\n\nReturn self+value."),
     SQSLOT("__mul__", sq_repeat, NULL, wrap_indexargfunc,
-      "x.__mul__(n) <==> x*n"),
+           "__mul__($self, value, /)\n--\n\nReturn self*value.n"),
     SQSLOT("__rmul__", sq_repeat, NULL, wrap_indexargfunc,
-      "x.__rmul__(n) <==> n*x"),
+           "__rmul__($self, value, /)\n--\n\nReturn self*value."),
     SQSLOT("__getitem__", sq_item, slot_sq_item, wrap_sq_item,
-           "x.__getitem__(y) <==> x[y]"),
+           "__getitem__($self, key, /)\n--\n\nReturn self[key]."),
     SQSLOT("__setitem__", sq_ass_item, slot_sq_ass_item, wrap_sq_setitem,
-           "x.__setitem__(i, y) <==> x[i]=y"),
+           "__setitem__($self, key, value, /)\n--\n\nSet self[key] to value."),
     SQSLOT("__delitem__", sq_ass_item, slot_sq_ass_item, wrap_sq_delitem,
-           "x.__delitem__(y) <==> del x[y]"),
+           "__delitem__($self, key, /)\n--\n\nDelete self[key]."),
     SQSLOT("__contains__", sq_contains, slot_sq_contains, wrap_objobjproc,
-           "x.__contains__(y) <==> y in x"),
+           "__contains__($self, key, /)\n--\n\nReturn key in self."),
     SQSLOT("__iadd__", sq_inplace_concat, NULL,
-      wrap_binaryfunc, "x.__iadd__(y) <==> x+=y"),
+           wrap_binaryfunc,
+           "__iadd__($self, value, /)\n--\n\nImplement self+=value."),
     SQSLOT("__imul__", sq_inplace_repeat, NULL,
-      wrap_indexargfunc, "x.__imul__(y) <==> x*=y"),
+           wrap_indexargfunc,
+           "__imul__($self, value, /)\n--\n\nImplement self*=value."),
 
     {NULL}
 };
@@ -6184,15 +6618,14 @@
 {
     PyTypeObject *subclass;
     PyObject *ref, *subclasses, *dict;
-    Py_ssize_t i, n;
+    Py_ssize_t i;
 
     subclasses = type->tp_subclasses;
     if (subclasses == NULL)
         return 0;
-    assert(PyList_Check(subclasses));
-    n = PyList_GET_SIZE(subclasses);
-    for (i = 0; i < n; i++) {
-        ref = PyList_GET_ITEM(subclasses, i);
+    assert(PyDict_CheckExact(subclasses));
+    i = 0;
+    while (PyDict_Next(subclasses, &i, NULL, &ref)) {
         assert(PyWeakref_CheckRef(ref));
         subclass = (PyTypeObject *)PyWeakref_GET_OBJECT(ref);
         assert(subclass != NULL);
@@ -6338,8 +6771,8 @@
         /* We want __class__ to return the class of the super object
            (i.e. super, or a subclass), not the class of su->obj. */
         skip = (PyUnicode_Check(name) &&
-            PyUnicode_GET_LENGTH(name) == 9 &&
-            PyUnicode_CompareWithASCIIString(name, "__class__") == 0);
+                PyUnicode_GET_LENGTH(name) == 9 &&
+                _PyUnicode_CompareWithId(name, &PyId___class__) == 0);
     }
 
     if (!skip) {
@@ -6505,9 +6938,16 @@
     if (type == NULL) {
         /* Call super(), without args -- fill in from __class__
            and first local variable on the stack. */
-        PyFrameObject *f = PyThreadState_GET()->frame;
-        PyCodeObject *co = f->f_code;
+        PyFrameObject *f;
+        PyCodeObject *co;
         Py_ssize_t i, n;
+        f = PyThreadState_GET()->frame;
+        if (f == NULL) {
+            PyErr_SetString(PyExc_RuntimeError,
+                            "super(): no current frame");
+            return -1;
+        }
+        co = f->f_code;
         if (co == NULL) {
             PyErr_SetString(PyExc_RuntimeError,
                             "super(): no code object");
@@ -6545,8 +6985,7 @@
         for (i = 0; i < n; i++) {
             PyObject *name = PyTuple_GET_ITEM(co->co_freevars, i);
             assert(PyUnicode_Check(name));
-            if (!PyUnicode_CompareWithASCIIString(name,
-                                                  "__class__")) {
+            if (!_PyUnicode_CompareWithId(name, &PyId___class__)) {
                 Py_ssize_t index = co->co_nlocals +
                     PyTuple_GET_SIZE(co->co_cellvars) + i;
                 PyObject *cell = f->f_localsplus[index];
diff --git a/Objects/unicodectype.c b/Objects/unicodectype.c
index a572c12..ea540d6 100644
--- a/Objects/unicodectype.c
+++ b/Objects/unicodectype.c
@@ -61,7 +61,7 @@
 /* Returns the titlecase Unicode characters corresponding to ch or just
    ch if no titlecase mapping is known. */
 
-Py_UCS4 _PyUnicode_ToTitlecase(register Py_UCS4 ch)
+Py_UCS4 _PyUnicode_ToTitlecase(Py_UCS4 ch)
 {
     const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);
 
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 156316b..84ab6a1 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -47,13 +47,10 @@
 #include <windows.h>
 #endif
 
-/* Endianness switches; defaults to little endian */
-
-#ifdef WORDS_BIGENDIAN
-# define BYTEORDER_IS_BIG_ENDIAN
-#else
-# define BYTEORDER_IS_LITTLE_ENDIAN
-#endif
+/*[clinic input]
+class str "PyUnicodeObject *" "&PyUnicode_Type"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=604e916854800fa8]*/
 
 /* --- Globals ------------------------------------------------------------
 
@@ -130,16 +127,14 @@
 /* true if the Unicode object has an allocated UTF-8 memory block
    (not shared with other data) */
 #define _PyUnicode_HAS_UTF8_MEMORY(op)                  \
-    (assert(_PyUnicode_CHECK(op)),                      \
-     (!PyUnicode_IS_COMPACT_ASCII(op)                   \
+    ((!PyUnicode_IS_COMPACT_ASCII(op)                   \
       && _PyUnicode_UTF8(op)                            \
       && _PyUnicode_UTF8(op) != PyUnicode_DATA(op)))
 
 /* true if the Unicode object has an allocated wstr memory block
    (not shared with other data) */
 #define _PyUnicode_HAS_WSTR_MEMORY(op)                  \
-    (assert(_PyUnicode_CHECK(op)),                      \
-     (_PyUnicode_WSTR(op) &&                            \
+    ((_PyUnicode_WSTR(op) &&                            \
       (!PyUnicode_IS_READY(op) ||                       \
        _PyUnicode_WSTR(op) != PyUnicode_DATA(op))))
 
@@ -150,9 +145,9 @@
    buffer where the result characters are written to. */
 #define _PyUnicode_CONVERT_BYTES(from_type, to_type, begin, end, to) \
     do {                                                \
-        to_type *_to = (to_type *) to;                  \
-        const from_type *_iter = (begin);               \
-        const from_type *_end = (end);                  \
+        to_type *_to = (to_type *)(to);                \
+        const from_type *_iter = (from_type *)(begin);  \
+        const from_type *_end = (from_type *)(end);     \
         Py_ssize_t n = (_end) - (_iter);                \
         const from_type *_unrolled_end =                \
             _iter + _Py_SIZE_ROUND_DOWN(n, 4);          \
@@ -199,6 +194,10 @@
         return unicode_empty;                           \
     } while (0)
 
+/* Forward declaration */
+Py_LOCAL_INLINE(int)
+_PyUnicodeWriter_WriteCharInline(_PyUnicodeWriter *writer, Py_UCS4 ch);
+
 /* List of static strings. */
 static _Py_Identifier *static_strings = NULL;
 
@@ -427,8 +426,6 @@
 #ifndef Py_DEBUG
     Py_ssize_t len;
 
-    assert(Py_REFCNT(unicode) == 1);
-
     len = _PyUnicode_WSTR_LENGTH(unicode);
     if (len == 0) {
         Py_DECREF(unicode);
@@ -445,10 +442,12 @@
     }
 
     if (_PyUnicode_Ready(unicode) < 0) {
-        Py_XDECREF(unicode);
+        Py_DECREF(unicode);
         return NULL;
     }
 #else
+    assert(Py_REFCNT(unicode) == 1);
+
     /* don't make the result ready in debug mode to ensure that the caller
        makes the string ready before using it */
     assert(_PyUnicode_CheckConsistency(unicode, 1));
@@ -471,7 +470,9 @@
     }
 
     if (length == 1) {
-        Py_UCS4 ch = PyUnicode_READ_CHAR(unicode, 0);
+        void *data = PyUnicode_DATA(unicode);
+        int kind = PyUnicode_KIND(unicode);
+        Py_UCS4 ch = PyUnicode_READ(kind, data, 0);
         if (ch < 256) {
             PyObject *latin1_char = unicode_latin1[ch];
             if (latin1_char != NULL) {
@@ -544,7 +545,6 @@
 
 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)))))
 
 #define BLOOM_LINEBREAK(ch)                                             \
@@ -554,21 +554,40 @@
 Py_LOCAL_INLINE(BLOOM_MASK)
 make_bloom_mask(int kind, void* ptr, Py_ssize_t len)
 {
+#define BLOOM_UPDATE(TYPE, MASK, PTR, LEN)             \
+    do {                                               \
+        TYPE *data = (TYPE *)PTR;                      \
+        TYPE *end = data + LEN;                        \
+        Py_UCS4 ch;                                    \
+        for (; data != end; data++) {                  \
+            ch = *data;                                \
+            MASK |= (1UL << (ch & (BLOOM_WIDTH - 1))); \
+        }                                              \
+        break;                                         \
+    } while (0)
+
     /* calculate simple bloom-style bitmask for a given unicode string */
 
     BLOOM_MASK mask;
-    Py_ssize_t i;
 
     mask = 0;
-    for (i = 0; i < len; i++)
-        BLOOM_ADD(mask, PyUnicode_READ(kind, ptr, i));
-
+    switch (kind) {
+    case PyUnicode_1BYTE_KIND:
+        BLOOM_UPDATE(Py_UCS1, mask, ptr, len);
+        break;
+    case PyUnicode_2BYTE_KIND:
+        BLOOM_UPDATE(Py_UCS2, mask, ptr, len);
+        break;
+    case PyUnicode_4BYTE_KIND:
+        BLOOM_UPDATE(Py_UCS4, mask, ptr, len);
+        break;
+    default:
+        assert(0);
+    }
     return mask;
-}
 
-#define BLOOM_MEMBER(mask, chr, str) \
-    (BLOOM(mask, chr) \
-     && (PyUnicode_FindChar(str, chr, 0, PyUnicode_GET_LENGTH(str), 1) >= 0))
+#undef BLOOM_UPDATE
+}
 
 /* Compilation of templated routines */
 
@@ -588,6 +607,7 @@
 #include "stringlib/split.h"
 #include "stringlib/count.h"
 #include "stringlib/find.h"
+#include "stringlib/replace.h"
 #include "stringlib/find_max_char.h"
 #include "stringlib/localeutil.h"
 #include "stringlib/undef.h"
@@ -598,6 +618,7 @@
 #include "stringlib/split.h"
 #include "stringlib/count.h"
 #include "stringlib/find.h"
+#include "stringlib/replace.h"
 #include "stringlib/find_max_char.h"
 #include "stringlib/localeutil.h"
 #include "stringlib/undef.h"
@@ -608,6 +629,7 @@
 #include "stringlib/split.h"
 #include "stringlib/count.h"
 #include "stringlib/find.h"
+#include "stringlib/replace.h"
 #include "stringlib/find_max_char.h"
 #include "stringlib/localeutil.h"
 #include "stringlib/undef.h"
@@ -654,6 +676,25 @@
     }
 }
 
+#ifdef Py_DEBUG
+/* Fill the data of an Unicode string with invalid characters to detect bugs
+   earlier.
+
+   _PyUnicode_CheckConsistency(str, 1) detects invalid characters, at least for
+   ASCII and UCS-4 strings. U+00FF is invalid in ASCII and U+FFFFFFFF is an
+   invalid character in Unicode 6.0. */
+static void
+unicode_fill_invalid(PyObject *unicode, Py_ssize_t old_length)
+{
+    int kind = PyUnicode_KIND(unicode);
+    Py_UCS1 *data = PyUnicode_1BYTE_DATA(unicode);
+    Py_ssize_t length = _PyUnicode_LENGTH(unicode);
+    if (length <= old_length)
+        return;
+    memset(data + old_length * kind, 0xff, (length - old_length) * kind);
+}
+#endif
+
 static PyObject*
 resize_compact(PyObject *unicode, Py_ssize_t length)
 {
@@ -662,6 +703,10 @@
     Py_ssize_t new_size;
     int share_wstr;
     PyObject *new_unicode;
+#ifdef Py_DEBUG
+    Py_ssize_t old_length = _PyUnicode_LENGTH(unicode);
+#endif
+
     assert(unicode_modifiable(unicode));
     assert(PyUnicode_IS_READY(unicode));
     assert(PyUnicode_IS_COMPACT(unicode));
@@ -701,6 +746,9 @@
         PyObject_DEL(_PyUnicode_WSTR(unicode));
         _PyUnicode_WSTR(unicode) = NULL;
     }
+#ifdef Py_DEBUG
+    unicode_fill_invalid(unicode, old_length);
+#endif
     PyUnicode_WRITE(PyUnicode_KIND(unicode), PyUnicode_DATA(unicode),
                     length, 0);
     assert(_PyUnicode_CheckConsistency(unicode, 0));
@@ -719,6 +767,9 @@
         Py_ssize_t char_size;
         int share_wstr, share_utf8;
         void *data;
+#ifdef Py_DEBUG
+        Py_ssize_t old_length = _PyUnicode_LENGTH(unicode);
+#endif
 
         data = _PyUnicode_DATA_ANY(unicode);
         char_size = PyUnicode_KIND(unicode);
@@ -754,6 +805,9 @@
         }
         _PyUnicode_LENGTH(unicode) = length;
         PyUnicode_WRITE(PyUnicode_KIND(unicode), data, length, 0);
+#ifdef Py_DEBUG
+        unicode_fill_invalid(unicode, old_length);
+#endif
         if (share_wstr || _PyUnicode_WSTR(unicode) == NULL) {
             assert(_PyUnicode_CheckConsistency(unicode, 0));
             return 0;
@@ -806,8 +860,8 @@
             return NULL;
         copy_length = _PyUnicode_WSTR_LENGTH(unicode);
         copy_length = Py_MIN(copy_length, length);
-        Py_UNICODE_COPY(_PyUnicode_WSTR(w), _PyUnicode_WSTR(unicode),
-                        copy_length);
+        Py_MEMCPY(_PyUnicode_WSTR(w), _PyUnicode_WSTR(unicode),
+                  copy_length * sizeof(wchar_t));
         return w;
     }
 }
@@ -824,7 +878,7 @@
 static PyUnicodeObject *
 _PyUnicode_New(Py_ssize_t length)
 {
-    register PyUnicodeObject *unicode;
+    PyUnicodeObject *unicode;
     size_t new_size;
 
     /* Optimization for empty strings */
@@ -847,6 +901,19 @@
     if (unicode == NULL)
         return NULL;
     new_size = sizeof(Py_UNICODE) * ((size_t)length + 1);
+
+    _PyUnicode_WSTR_LENGTH(unicode) = length;
+    _PyUnicode_HASH(unicode) = -1;
+    _PyUnicode_STATE(unicode).interned = 0;
+    _PyUnicode_STATE(unicode).kind = 0;
+    _PyUnicode_STATE(unicode).compact = 0;
+    _PyUnicode_STATE(unicode).ready = 0;
+    _PyUnicode_STATE(unicode).ascii = 0;
+    _PyUnicode_DATA_ANY(unicode) = NULL;
+    _PyUnicode_LENGTH(unicode) = 0;
+    _PyUnicode_UTF8(unicode) = NULL;
+    _PyUnicode_UTF8_LENGTH(unicode) = 0;
+
     _PyUnicode_WSTR(unicode) = (Py_UNICODE*) PyObject_MALLOC(new_size);
     if (!_PyUnicode_WSTR(unicode)) {
         Py_DECREF(unicode);
@@ -863,17 +930,7 @@
      */
     _PyUnicode_WSTR(unicode)[0] = 0;
     _PyUnicode_WSTR(unicode)[length] = 0;
-    _PyUnicode_WSTR_LENGTH(unicode) = length;
-    _PyUnicode_HASH(unicode) = -1;
-    _PyUnicode_STATE(unicode).interned = 0;
-    _PyUnicode_STATE(unicode).kind = 0;
-    _PyUnicode_STATE(unicode).compact = 0;
-    _PyUnicode_STATE(unicode).ready = 0;
-    _PyUnicode_STATE(unicode).ascii = 0;
-    _PyUnicode_DATA_ANY(unicode) = NULL;
-    _PyUnicode_LENGTH(unicode) = 0;
-    _PyUnicode_UTF8(unicode) = NULL;
-    _PyUnicode_UTF8_LENGTH(unicode) = 0;
+
     assert(_PyUnicode_CheckConsistency((PyObject *)unicode, 0));
     return unicode;
 }
@@ -954,17 +1011,19 @@
     }
     else
         data = unicode->data.any;
-    printf("%s: len=%zu, ",unicode_kind_name(op), ascii->length);
+    printf("%s: len=%" PY_FORMAT_SIZE_T "u, ",
+           unicode_kind_name(op), ascii->length);
 
     if (ascii->wstr == data)
         printf("shared ");
     printf("wstr=%p", ascii->wstr);
 
     if (!(ascii->state.ascii == 1 && ascii->state.compact == 1)) {
-        printf(" (%zu), ", compact->wstr_length);
+        printf(" (%" PY_FORMAT_SIZE_T "u), ", compact->wstr_length);
         if (!ascii->state.compact && compact->utf8 == unicode->data.any)
             printf("shared ");
-        printf("utf8=%p (%zu)", compact->utf8, compact->utf8_length);
+        printf("utf8=%p (%" PY_FORMAT_SIZE_T "u)",
+               compact->utf8, compact->utf8_length);
     }
     printf(", data=%p\n", data);
 }
@@ -1078,11 +1137,7 @@
         }
     }
 #ifdef Py_DEBUG
-    /* Fill the data with invalid characters to detect bugs earlier.
-       _PyUnicode_CheckConsistency(str, 1) detects invalid characters,
-       at least for ASCII and UCS-4 strings. U+00FF is invalid in ASCII
-       and U+FFFFFFFF is an invalid character in Unicode 6.0. */
-    memset(data, 0xff, size * kind);
+    unicode_fill_invalid((PyObject*)unicode, 0);
 #endif
     assert(_PyUnicode_CheckConsistency((PyObject*)unicode, 0));
     return obj;
@@ -1512,7 +1567,7 @@
 }
 
 static void
-unicode_dealloc(register PyObject *unicode)
+unicode_dealloc(PyObject *unicode)
 {
     switch (PyUnicode_CHECK_INTERNED(unicode)) {
     case SSTATE_NOT_INTERNED:
@@ -1644,38 +1699,6 @@
     return unicode_resize(p_unicode, length);
 }
 
-static int
-unicode_widen(PyObject **p_unicode, Py_ssize_t length,
-              unsigned int maxchar)
-{
-    PyObject *result;
-    assert(PyUnicode_IS_READY(*p_unicode));
-    assert(length <= PyUnicode_GET_LENGTH(*p_unicode));
-    if (maxchar <= PyUnicode_MAX_CHAR_VALUE(*p_unicode))
-        return 0;
-    result = PyUnicode_New(PyUnicode_GET_LENGTH(*p_unicode),
-                           maxchar);
-    if (result == NULL)
-        return -1;
-    _PyUnicode_FastCopyCharacters(result, 0, *p_unicode, 0, length);
-    Py_DECREF(*p_unicode);
-    *p_unicode = result;
-    return 0;
-}
-
-static int
-unicode_putchar(PyObject **p_unicode, Py_ssize_t *pos,
-                Py_UCS4 ch)
-{
-    assert(ch <= MAX_UNICODE);
-    if (unicode_widen(p_unicode, *pos, ch) < 0)
-        return -1;
-    PyUnicode_WRITE(PyUnicode_KIND(*p_unicode),
-                    PyUnicode_DATA(*p_unicode),
-                    (*pos)++, ch);
-    return 0;
-}
-
 /* Copy a ASCII or latin1 char* string into a Python Unicode string.
 
    WARNING: The function doesn't copy the terminating null character and
@@ -1692,6 +1715,14 @@
     switch (kind) {
     case PyUnicode_1BYTE_KIND: {
         assert(index + len <= PyUnicode_GET_LENGTH(unicode));
+#ifdef Py_DEBUG
+        if (PyUnicode_IS_ASCII(unicode)) {
+            Py_UCS4 maxchar = ucs1lib_find_max_char(
+                (const Py_UCS1*)str,
+                (const Py_UCS1*)str + len);
+            assert(maxchar < 128);
+        }
+#endif
         memcpy((char *) data + index, str, len);
         break;
     }
@@ -1720,7 +1751,6 @@
     }
 }
 
-
 static PyObject*
 get_latin1_char(unsigned char ch)
 {
@@ -1737,6 +1767,34 @@
     return unicode;
 }
 
+static PyObject*
+unicode_char(Py_UCS4 ch)
+{
+    PyObject *unicode;
+
+    assert(ch <= MAX_UNICODE);
+
+    if (ch < 256)
+        return get_latin1_char(ch);
+
+    unicode = PyUnicode_New(1, ch);
+    if (unicode == NULL)
+        return NULL;
+    switch (PyUnicode_KIND(unicode)) {
+    case PyUnicode_1BYTE_KIND:
+        PyUnicode_1BYTE_DATA(unicode)[0] = (Py_UCS1)ch;
+        break;
+    case PyUnicode_2BYTE_KIND:
+        PyUnicode_2BYTE_DATA(unicode)[0] = (Py_UCS2)ch;
+        break;
+    default:
+        assert(PyUnicode_KIND(unicode) == PyUnicode_4BYTE_KIND);
+        PyUnicode_4BYTE_DATA(unicode)[0] = ch;
+    }
+    assert(_PyUnicode_CheckConsistency(unicode, 1));
+    return unicode;
+}
+
 PyObject *
 PyUnicode_FromUnicode(const Py_UNICODE *u, Py_ssize_t size)
 {
@@ -1934,18 +1992,8 @@
     if (size == 0)
         _Py_RETURN_UNICODE_EMPTY();
     assert(size > 0);
-    if (size == 1) {
-        Py_UCS4 ch = u[0];
-        if (ch < 256)
-            return get_latin1_char((unsigned char)ch);
-
-        res = PyUnicode_New(1, ch);
-        if (res == NULL)
-            return NULL;
-        PyUnicode_WRITE(PyUnicode_KIND(res), PyUnicode_DATA(res), 0, ch);
-        assert(_PyUnicode_CheckConsistency(res, 1));
-        return res;
-    }
+    if (size == 1)
+        return unicode_char(u[0]);
 
     max_char = ucs2lib_find_max_char(u, u + size);
     res = PyUnicode_New(size, max_char);
@@ -1970,18 +2018,8 @@
     if (size == 0)
         _Py_RETURN_UNICODE_EMPTY();
     assert(size > 0);
-    if (size == 1) {
-        Py_UCS4 ch = u[0];
-        if (ch < 256)
-            return get_latin1_char((unsigned char)ch);
-
-        res = PyUnicode_New(1, ch);
-        if (res == NULL)
-            return NULL;
-        PyUnicode_WRITE(PyUnicode_KIND(res), PyUnicode_DATA(res), 0, ch);
-        assert(_PyUnicode_CheckConsistency(res, 1));
-        return res;
-    }
+    if (size == 1)
+        return unicode_char(u[0]);
 
     max_char = ucs4lib_find_max_char(u, u + size);
     res = PyUnicode_New(size, max_char);
@@ -2257,7 +2295,7 @@
 #ifdef HAVE_WCHAR_H
 
 PyObject *
-PyUnicode_FromWideChar(register const wchar_t *w, Py_ssize_t size)
+PyUnicode_FromWideChar(const wchar_t *w, Py_ssize_t size)
 {
     if (w == NULL) {
         if (size == 0)
@@ -2277,16 +2315,9 @@
 
 static void
 makefmt(char *fmt, int longflag, int longlongflag, int size_tflag,
-        int zeropad, int width, int precision, char c)
+        char c)
 {
     *fmt++ = '%';
-    if (width) {
-        if (zeropad)
-            *fmt++ = '0';
-        fmt += sprintf(fmt, "%d", width);
-    }
-    if (precision)
-        fmt += sprintf(fmt, ".%d", precision);
     if (longflag)
         *fmt++ = 'l';
     else if (longlongflag) {
@@ -2311,46 +2342,139 @@
     *fmt = '\0';
 }
 
-/* helper for PyUnicode_FromFormatV() */
+/* maximum number of characters required for output of %lld or %p.
+   We need at most ceil(log10(256)*SIZEOF_LONG_LONG) digits,
+   plus 1 for the sign.  53/22 is an upper bound for log10(256). */
+#define MAX_LONG_LONG_CHARS (2 + (SIZEOF_LONG_LONG*53-1) / 22)
+
+static int
+unicode_fromformat_write_str(_PyUnicodeWriter *writer, PyObject *str,
+                             Py_ssize_t width, Py_ssize_t precision)
+{
+    Py_ssize_t length, fill, arglen;
+    Py_UCS4 maxchar;
+
+    if (PyUnicode_READY(str) == -1)
+        return -1;
+
+    length = PyUnicode_GET_LENGTH(str);
+    if ((precision == -1 || precision >= length)
+        && width <= length)
+        return _PyUnicodeWriter_WriteStr(writer, str);
+
+    if (precision != -1)
+        length = Py_MIN(precision, length);
+
+    arglen = Py_MAX(length, width);
+    if (PyUnicode_MAX_CHAR_VALUE(str) > writer->maxchar)
+        maxchar = _PyUnicode_FindMaxChar(str, 0, length);
+    else
+        maxchar = writer->maxchar;
+
+    if (_PyUnicodeWriter_Prepare(writer, arglen, maxchar) == -1)
+        return -1;
+
+    if (width > length) {
+        fill = width - length;
+        if (PyUnicode_Fill(writer->buffer, writer->pos, fill, ' ') == -1)
+            return -1;
+        writer->pos += fill;
+    }
+
+    _PyUnicode_FastCopyCharacters(writer->buffer, writer->pos,
+                                  str, 0, length);
+    writer->pos += length;
+    return 0;
+}
+
+static int
+unicode_fromformat_write_cstr(_PyUnicodeWriter *writer, const char *str,
+                              Py_ssize_t width, Py_ssize_t precision)
+{
+    /* UTF-8 */
+    Py_ssize_t length;
+    PyObject *unicode;
+    int res;
+
+    length = strlen(str);
+    if (precision != -1)
+        length = Py_MIN(length, precision);
+    unicode = PyUnicode_DecodeUTF8Stateful(str, length, "replace", NULL);
+    if (unicode == NULL)
+        return -1;
+
+    res = unicode_fromformat_write_str(writer, unicode, width, -1);
+    Py_DECREF(unicode);
+    return res;
+}
 
 static const char*
-parse_format_flags(const char *f,
-                   int *p_width, int *p_precision,
-                   int *p_longflag, int *p_longlongflag, int *p_size_tflag)
+unicode_fromformat_arg(_PyUnicodeWriter *writer,
+                       const char *f, va_list *vargs)
 {
-    int width, precision, longflag, longlongflag, size_tflag;
+    const char *p;
+    Py_ssize_t len;
+    int zeropad;
+    Py_ssize_t width;
+    Py_ssize_t precision;
+    int longflag;
+    int longlongflag;
+    int size_tflag;
+    Py_ssize_t fill;
+
+    p = f;
+    f++;
+    zeropad = 0;
+    if (*f == '0') {
+        zeropad = 1;
+        f++;
+    }
 
     /* parse the width.precision part, e.g. "%2.5s" => width=2, precision=5 */
-    f++;
-    width = 0;
-    while (Py_ISDIGIT((unsigned)*f))
-        width = (width*10) + *f++ - '0';
-    precision = 0;
+    width = -1;
+    if (Py_ISDIGIT((unsigned)*f)) {
+        width = *f - '0';
+        f++;
+        while (Py_ISDIGIT((unsigned)*f)) {
+            if (width > (PY_SSIZE_T_MAX - ((int)*f - '0')) / 10) {
+                PyErr_SetString(PyExc_ValueError,
+                                "width too big");
+                return NULL;
+            }
+            width = (width * 10) + (*f - '0');
+            f++;
+        }
+    }
+    precision = -1;
     if (*f == '.') {
         f++;
-        while (Py_ISDIGIT((unsigned)*f))
-            precision = (precision*10) + *f++ - '0';
+        if (Py_ISDIGIT((unsigned)*f)) {
+            precision = (*f - '0');
+            f++;
+            while (Py_ISDIGIT((unsigned)*f)) {
+                if (precision > (PY_SSIZE_T_MAX - ((int)*f - '0')) / 10) {
+                    PyErr_SetString(PyExc_ValueError,
+                                    "precision too big");
+                    return NULL;
+                }
+                precision = (precision * 10) + (*f - '0');
+                f++;
+            }
+        }
         if (*f == '%') {
             /* "%.3%s" => f points to "3" */
             f--;
         }
     }
-    if (width < precision)
-        width = precision;
     if (*f == '\0') {
-        /* bogus format "%.1" => go backward, f points to "1" */
+        /* bogus format "%.123" => go backward, f points to "3" */
         f--;
     }
-    if (p_width != NULL)
-        *p_width = width;
-    if (p_precision != NULL)
-        *p_precision = precision;
 
     /* Handle %ld, %lu, %lld and %llu. */
     longflag = 0;
     longlongflag = 0;
     size_tflag = 0;
-
     if (*f == 'l') {
         if (f[1] == 'd' || f[1] == 'u' || f[1] == 'i') {
             longflag = 1;
@@ -2369,499 +2493,284 @@
         size_tflag = 1;
         ++f;
     }
-    if (p_longflag != NULL)
-        *p_longflag = longflag;
-    if (p_longlongflag != NULL)
-        *p_longlongflag = longlongflag;
-    if (p_size_tflag != NULL)
-        *p_size_tflag = size_tflag;
+
+    if (f[1] == '\0')
+        writer->overallocate = 0;
+
+    switch (*f) {
+    case 'c':
+    {
+        int ordinal = va_arg(*vargs, int);
+        if (ordinal < 0 || ordinal > MAX_UNICODE) {
+            PyErr_SetString(PyExc_OverflowError,
+                            "character argument not in range(0x110000)");
+            return NULL;
+        }
+        if (_PyUnicodeWriter_WriteCharInline(writer, ordinal) < 0)
+            return NULL;
+        break;
+    }
+
+    case 'i':
+    case 'd':
+    case 'u':
+    case 'x':
+    {
+        /* used by sprintf */
+        char fmt[10]; /* should be enough for "%0lld\0" */
+        char buffer[MAX_LONG_LONG_CHARS];
+        Py_ssize_t arglen;
+
+        if (*f == 'u') {
+            makefmt(fmt, longflag, longlongflag, size_tflag, *f);
+
+            if (longflag)
+                len = sprintf(buffer, fmt,
+                        va_arg(*vargs, unsigned long));
+#ifdef HAVE_LONG_LONG
+            else if (longlongflag)
+                len = sprintf(buffer, fmt,
+                        va_arg(*vargs, unsigned PY_LONG_LONG));
+#endif
+            else if (size_tflag)
+                len = sprintf(buffer, fmt,
+                        va_arg(*vargs, size_t));
+            else
+                len = sprintf(buffer, fmt,
+                        va_arg(*vargs, unsigned int));
+        }
+        else if (*f == 'x') {
+            makefmt(fmt, 0, 0, 0, 'x');
+            len = sprintf(buffer, fmt, va_arg(*vargs, int));
+        }
+        else {
+            makefmt(fmt, longflag, longlongflag, size_tflag, *f);
+
+            if (longflag)
+                len = sprintf(buffer, fmt,
+                        va_arg(*vargs, long));
+#ifdef HAVE_LONG_LONG
+            else if (longlongflag)
+                len = sprintf(buffer, fmt,
+                        va_arg(*vargs, PY_LONG_LONG));
+#endif
+            else if (size_tflag)
+                len = sprintf(buffer, fmt,
+                        va_arg(*vargs, Py_ssize_t));
+            else
+                len = sprintf(buffer, fmt,
+                        va_arg(*vargs, int));
+        }
+        assert(len >= 0);
+
+        if (precision < len)
+            precision = len;
+
+        arglen = Py_MAX(precision, width);
+        if (_PyUnicodeWriter_Prepare(writer, arglen, 127) == -1)
+            return NULL;
+
+        if (width > precision) {
+            Py_UCS4 fillchar;
+            fill = width - precision;
+            fillchar = zeropad?'0':' ';
+            if (PyUnicode_Fill(writer->buffer, writer->pos, fill, fillchar) == -1)
+                return NULL;
+            writer->pos += fill;
+        }
+        if (precision > len) {
+            fill = precision - len;
+            if (PyUnicode_Fill(writer->buffer, writer->pos, fill, '0') == -1)
+                return NULL;
+            writer->pos += fill;
+        }
+
+        if (_PyUnicodeWriter_WriteASCIIString(writer, buffer, len) < 0)
+            return NULL;
+        break;
+    }
+
+    case 'p':
+    {
+        char number[MAX_LONG_LONG_CHARS];
+
+        len = sprintf(number, "%p", va_arg(*vargs, void*));
+        assert(len >= 0);
+
+        /* %p is ill-defined:  ensure leading 0x. */
+        if (number[1] == 'X')
+            number[1] = 'x';
+        else if (number[1] != 'x') {
+            memmove(number + 2, number,
+                    strlen(number) + 1);
+            number[0] = '0';
+            number[1] = 'x';
+            len += 2;
+        }
+
+        if (_PyUnicodeWriter_WriteASCIIString(writer, number, len) < 0)
+            return NULL;
+        break;
+    }
+
+    case 's':
+    {
+        /* UTF-8 */
+        const char *s = va_arg(*vargs, const char*);
+        if (unicode_fromformat_write_cstr(writer, s, width, precision) < 0)
+            return NULL;
+        break;
+    }
+
+    case 'U':
+    {
+        PyObject *obj = va_arg(*vargs, PyObject *);
+        assert(obj && _PyUnicode_CHECK(obj));
+
+        if (unicode_fromformat_write_str(writer, obj, width, precision) == -1)
+            return NULL;
+        break;
+    }
+
+    case 'V':
+    {
+        PyObject *obj = va_arg(*vargs, PyObject *);
+        const char *str = va_arg(*vargs, const char *);
+        if (obj) {
+            assert(_PyUnicode_CHECK(obj));
+            if (unicode_fromformat_write_str(writer, obj, width, precision) == -1)
+                return NULL;
+        }
+        else {
+            assert(str != NULL);
+            if (unicode_fromformat_write_cstr(writer, str, width, precision) < 0)
+                return NULL;
+        }
+        break;
+    }
+
+    case 'S':
+    {
+        PyObject *obj = va_arg(*vargs, PyObject *);
+        PyObject *str;
+        assert(obj);
+        str = PyObject_Str(obj);
+        if (!str)
+            return NULL;
+        if (unicode_fromformat_write_str(writer, str, width, precision) == -1) {
+            Py_DECREF(str);
+            return NULL;
+        }
+        Py_DECREF(str);
+        break;
+    }
+
+    case 'R':
+    {
+        PyObject *obj = va_arg(*vargs, PyObject *);
+        PyObject *repr;
+        assert(obj);
+        repr = PyObject_Repr(obj);
+        if (!repr)
+            return NULL;
+        if (unicode_fromformat_write_str(writer, repr, width, precision) == -1) {
+            Py_DECREF(repr);
+            return NULL;
+        }
+        Py_DECREF(repr);
+        break;
+    }
+
+    case 'A':
+    {
+        PyObject *obj = va_arg(*vargs, PyObject *);
+        PyObject *ascii;
+        assert(obj);
+        ascii = PyObject_ASCII(obj);
+        if (!ascii)
+            return NULL;
+        if (unicode_fromformat_write_str(writer, ascii, width, precision) == -1) {
+            Py_DECREF(ascii);
+            return NULL;
+        }
+        Py_DECREF(ascii);
+        break;
+    }
+
+    case '%':
+        if (_PyUnicodeWriter_WriteCharInline(writer, '%') < 0)
+            return NULL;
+        break;
+
+    default:
+        /* if we stumble upon an unknown formatting code, copy the rest
+           of the format string to the output string. (we cannot just
+           skip the code, since there's no way to know what's in the
+           argument list) */
+        len = strlen(p);
+        if (_PyUnicodeWriter_WriteLatin1String(writer, p, len) == -1)
+            return NULL;
+        f = p+len;
+        return f;
+    }
+
+    f++;
     return f;
 }
 
-/* maximum number of characters required for output of %ld.  21 characters
-   allows for 64-bit integers (in decimal) and an optional sign. */
-#define MAX_LONG_CHARS 21
-/* maximum number of characters required for output of %lld.
-   We need at most ceil(log10(256)*SIZEOF_LONG_LONG) digits,
-   plus 1 for the sign.  53/22 is an upper bound for log10(256). */
-#define MAX_LONG_LONG_CHARS (2 + (SIZEOF_LONG_LONG*53-1) / 22)
-
 PyObject *
 PyUnicode_FromFormatV(const char *format, va_list vargs)
 {
-    va_list count;
-    Py_ssize_t callcount = 0;
-    PyObject **callresults = NULL;
-    PyObject **callresult = NULL;
-    Py_ssize_t n = 0;
-    int width = 0;
-    int precision = 0;
-    int zeropad;
-    const char* f;
-    PyObject *string;
-    /* used by sprintf */
-    char fmt[61]; /* should be enough for %0width.precisionlld */
-    Py_UCS4 maxchar = 127; /* result is ASCII by default */
-    Py_UCS4 argmaxchar;
-    Py_ssize_t numbersize = 0;
-    char *numberresults = NULL;
-    char *numberresult = NULL;
-    Py_ssize_t i;
-    int kind;
-    void *data;
+    va_list vargs2;
+    const char *f;
+    _PyUnicodeWriter writer;
 
-    Py_VA_COPY(count, vargs);
-    /* step 1: count the number of %S/%R/%A/%s format specifications
-     * (we call PyObject_Str()/PyObject_Repr()/PyObject_ASCII()/
-     * PyUnicode_DecodeUTF8() for these objects once during step 3 and put the
-     * result in an array)
-     * also estimate a upper bound for all the number formats in the string,
-     * numbers will be formatted in step 3 and be kept in a '\0'-separated
-     * buffer before putting everything together. */
-    for (f = format; *f; f++) {
+    _PyUnicodeWriter_Init(&writer);
+    writer.min_length = strlen(format) + 100;
+    writer.overallocate = 1;
+
+    /* va_list may be an array (of 1 item) on some platforms (ex: AMD64).
+       Copy it to be able to pass a reference to a subfunction. */
+    Py_VA_COPY(vargs2, vargs);
+
+    for (f = format; *f; ) {
         if (*f == '%') {
-            int longlongflag;
-            /* skip width or width.precision (eg. "1.2" of "%1.2f") */
-            f = parse_format_flags(f, &width, NULL, NULL, &longlongflag, NULL);
-            if (*f == 's' || *f=='S' || *f=='R' || *f=='A' || *f=='V')
-                ++callcount;
-
-            else if (*f == 'd' || *f=='u' || *f=='i' || *f=='x' || *f=='p') {
-#ifdef HAVE_LONG_LONG
-                if (longlongflag) {
-                    if (width < MAX_LONG_LONG_CHARS)
-                        width = MAX_LONG_LONG_CHARS;
-                }
-                else
-#endif
-                    /* MAX_LONG_CHARS is enough to hold a 64-bit integer,
-                       including sign.  Decimal takes the most space.  This
-                       isn't enough for octal.  If a width is specified we
-                       need more (which we allocate later). */
-                    if (width < MAX_LONG_CHARS)
-                        width = MAX_LONG_CHARS;
-
-                /* account for the size + '\0' to separate numbers
-                   inside of the numberresults buffer */
-                numbersize += (width + 1);
-            }
-        }
-        else if ((unsigned char)*f > 127) {
-            PyErr_Format(PyExc_ValueError,
-                "PyUnicode_FromFormatV() expects an ASCII-encoded format "
-                "string, got a non-ASCII byte: 0x%02x",
-                (unsigned char)*f);
-            return NULL;
-        }
-    }
-    /* step 2: allocate memory for the results of
-     * PyObject_Str()/PyObject_Repr()/PyUnicode_DecodeUTF8() calls */
-    if (callcount) {
-        callresults = PyObject_Malloc(sizeof(PyObject *) * callcount);
-        if (!callresults) {
-            PyErr_NoMemory();
-            return NULL;
-        }
-        callresult = callresults;
-    }
-    /* step 2.5: allocate memory for the results of formating numbers */
-    if (numbersize) {
-        numberresults = PyObject_Malloc(numbersize);
-        if (!numberresults) {
-            PyErr_NoMemory();
-            goto fail;
-        }
-        numberresult = numberresults;
-    }
-
-    /* step 3: format numbers and figure out how large a buffer we need */
-    for (f = format; *f; f++) {
-        if (*f == '%') {
-            const char* p;
-            int longflag;
-            int longlongflag;
-            int size_tflag;
-            int numprinted;
-
-            p = f;
-            zeropad = (f[1] == '0');
-            f = parse_format_flags(f, &width, &precision,
-                                   &longflag, &longlongflag, &size_tflag);
-            switch (*f) {
-            case 'c':
-            {
-                int ordinal = va_arg(count, int);
-                if (ordinal < 0 || ordinal > MAX_UNICODE) {
-                    PyErr_SetString(PyExc_OverflowError,
-                                    "%c arg not in range(0x110000)");
-                    goto fail;
-                }
-                maxchar = Py_MAX(maxchar, (Py_UCS4)ordinal);
-                n++;
-                break;
-            }
-            case '%':
-                n++;
-                break;
-            case 'i':
-            case 'd':
-                makefmt(fmt, longflag, longlongflag, size_tflag, zeropad,
-                        width, precision, *f);
-                if (longflag)
-                    numprinted = sprintf(numberresult, fmt,
-                                         va_arg(count, long));
-#ifdef HAVE_LONG_LONG
-                else if (longlongflag)
-                    numprinted = sprintf(numberresult, fmt,
-                                         va_arg(count, PY_LONG_LONG));
-#endif
-                else if (size_tflag)
-                    numprinted = sprintf(numberresult, fmt,
-                                         va_arg(count, Py_ssize_t));
-                else
-                    numprinted = sprintf(numberresult, fmt,
-                                         va_arg(count, int));
-                n += numprinted;
-                /* advance by +1 to skip over the '\0' */
-                numberresult += (numprinted + 1);
-                assert(*(numberresult - 1) == '\0');
-                assert(*(numberresult - 2) != '\0');
-                assert(numprinted >= 0);
-                assert(numberresult <= numberresults + numbersize);
-                break;
-            case 'u':
-                makefmt(fmt, longflag, longlongflag, size_tflag, zeropad,
-                        width, precision, 'u');
-                if (longflag)
-                    numprinted = sprintf(numberresult, fmt,
-                                         va_arg(count, unsigned long));
-#ifdef HAVE_LONG_LONG
-                else if (longlongflag)
-                    numprinted = sprintf(numberresult, fmt,
-                                         va_arg(count, unsigned PY_LONG_LONG));
-#endif
-                else if (size_tflag)
-                    numprinted = sprintf(numberresult, fmt,
-                                         va_arg(count, size_t));
-                else
-                    numprinted = sprintf(numberresult, fmt,
-                                         va_arg(count, unsigned int));
-                n += numprinted;
-                numberresult += (numprinted + 1);
-                assert(*(numberresult - 1) == '\0');
-                assert(*(numberresult - 2) != '\0');
-                assert(numprinted >= 0);
-                assert(numberresult <= numberresults + numbersize);
-                break;
-            case 'x':
-                makefmt(fmt, 0, 0, 0, zeropad, width, precision, 'x');
-                numprinted = sprintf(numberresult, fmt, va_arg(count, int));
-                n += numprinted;
-                numberresult += (numprinted + 1);
-                assert(*(numberresult - 1) == '\0');
-                assert(*(numberresult - 2) != '\0');
-                assert(numprinted >= 0);
-                assert(numberresult <= numberresults + numbersize);
-                break;
-            case 'p':
-                numprinted = sprintf(numberresult, "%p", va_arg(count, void*));
-                /* %p is ill-defined:  ensure leading 0x. */
-                if (numberresult[1] == 'X')
-                    numberresult[1] = 'x';
-                else if (numberresult[1] != 'x') {
-                    memmove(numberresult + 2, numberresult,
-                            strlen(numberresult) + 1);
-                    numberresult[0] = '0';
-                    numberresult[1] = 'x';
-                    numprinted += 2;
-                }
-                n += numprinted;
-                numberresult += (numprinted + 1);
-                assert(*(numberresult - 1) == '\0');
-                assert(*(numberresult - 2) != '\0');
-                assert(numprinted >= 0);
-                assert(numberresult <= numberresults + numbersize);
-                break;
-            case 's':
-            {
-                /* UTF-8 */
-                const char *s = va_arg(count, const char*);
-                PyObject *str = PyUnicode_DecodeUTF8Stateful(s, strlen(s), "replace", NULL);
-                if (!str)
-                    goto fail;
-                /* since PyUnicode_DecodeUTF8 returns already flexible
-                   unicode objects, there is no need to call ready on them */
-                argmaxchar = PyUnicode_MAX_CHAR_VALUE(str);
-                maxchar = Py_MAX(maxchar, argmaxchar);
-                n += PyUnicode_GET_LENGTH(str);
-                /* Remember the str and switch to the next slot */
-                *callresult++ = str;
-                break;
-            }
-            case 'U':
-            {
-                PyObject *obj = va_arg(count, PyObject *);
-                assert(obj && _PyUnicode_CHECK(obj));
-                if (PyUnicode_READY(obj) == -1)
-                    goto fail;
-                argmaxchar = PyUnicode_MAX_CHAR_VALUE(obj);
-                maxchar = Py_MAX(maxchar, argmaxchar);
-                n += PyUnicode_GET_LENGTH(obj);
-                break;
-            }
-            case 'V':
-            {
-                PyObject *obj = va_arg(count, PyObject *);
-                const char *str = va_arg(count, const char *);
-                PyObject *str_obj;
-                assert(obj || str);
-                assert(!obj || _PyUnicode_CHECK(obj));
-                if (obj) {
-                    if (PyUnicode_READY(obj) == -1)
-                        goto fail;
-                    argmaxchar = PyUnicode_MAX_CHAR_VALUE(obj);
-                    maxchar = Py_MAX(maxchar, argmaxchar);
-                    n += PyUnicode_GET_LENGTH(obj);
-                    *callresult++ = NULL;
-                }
-                else {
-                    str_obj = PyUnicode_DecodeUTF8Stateful(str, strlen(str), "replace", NULL);
-                    if (!str_obj)
-                        goto fail;
-                    if (PyUnicode_READY(str_obj) == -1) {
-                        Py_DECREF(str_obj);
-                        goto fail;
-                    }
-                    argmaxchar = PyUnicode_MAX_CHAR_VALUE(str_obj);
-                    maxchar = Py_MAX(maxchar, argmaxchar);
-                    n += PyUnicode_GET_LENGTH(str_obj);
-                    *callresult++ = str_obj;
-                }
-                break;
-            }
-            case 'S':
-            {
-                PyObject *obj = va_arg(count, PyObject *);
-                PyObject *str;
-                assert(obj);
-                str = PyObject_Str(obj);
-                if (!str)
-                    goto fail;
-                if (PyUnicode_READY(str) == -1) {
-                    Py_DECREF(str);
-                    goto fail;
-                }
-                argmaxchar = PyUnicode_MAX_CHAR_VALUE(str);
-                maxchar = Py_MAX(maxchar, argmaxchar);
-                n += PyUnicode_GET_LENGTH(str);
-                /* Remember the str and switch to the next slot */
-                *callresult++ = str;
-                break;
-            }
-            case 'R':
-            {
-                PyObject *obj = va_arg(count, PyObject *);
-                PyObject *repr;
-                assert(obj);
-                repr = PyObject_Repr(obj);
-                if (!repr)
-                    goto fail;
-                if (PyUnicode_READY(repr) == -1) {
-                    Py_DECREF(repr);
-                    goto fail;
-                }
-                argmaxchar = PyUnicode_MAX_CHAR_VALUE(repr);
-                maxchar = Py_MAX(maxchar, argmaxchar);
-                n += PyUnicode_GET_LENGTH(repr);
-                /* Remember the repr and switch to the next slot */
-                *callresult++ = repr;
-                break;
-            }
-            case 'A':
-            {
-                PyObject *obj = va_arg(count, PyObject *);
-                PyObject *ascii;
-                assert(obj);
-                ascii = PyObject_ASCII(obj);
-                if (!ascii)
-                    goto fail;
-                if (PyUnicode_READY(ascii) == -1) {
-                    Py_DECREF(ascii);
-                    goto fail;
-                }
-                argmaxchar = PyUnicode_MAX_CHAR_VALUE(ascii);
-                maxchar = Py_MAX(maxchar, argmaxchar);
-                n += PyUnicode_GET_LENGTH(ascii);
-                /* Remember the repr and switch to the next slot */
-                *callresult++ = ascii;
-                break;
-            }
-            default:
-                /* if we stumble upon an unknown
-                   formatting code, copy the rest of
-                   the format string to the output
-                   string. (we cannot just skip the
-                   code, since there's no way to know
-                   what's in the argument list) */
-                n += strlen(p);
-                goto expand;
-            }
-        } else
-            n++;
-    }
-  expand:
-    /* step 4: fill the buffer */
-    /* Since we've analyzed how much space we need,
-       we don't have to resize the string.
-       There can be no errors beyond this point. */
-    string = PyUnicode_New(n, maxchar);
-    if (!string)
-        goto fail;
-    kind = PyUnicode_KIND(string);
-    data = PyUnicode_DATA(string);
-    callresult = callresults;
-    numberresult = numberresults;
-
-    for (i = 0, f = format; *f; f++) {
-        if (*f == '%') {
-            const char* p;
-
-            p = f;
-            f = parse_format_flags(f, NULL, NULL, NULL, NULL, NULL);
-            /* checking for == because the last argument could be a empty
-               string, which causes i to point to end, the assert at the end of
-               the loop */
-            assert(i <= PyUnicode_GET_LENGTH(string));
-
-            switch (*f) {
-            case 'c':
-            {
-                const int ordinal = va_arg(vargs, int);
-                PyUnicode_WRITE(kind, data, i++, ordinal);
-                break;
-            }
-            case 'i':
-            case 'd':
-            case 'u':
-            case 'x':
-            case 'p':
-            {
-                Py_ssize_t len;
-                /* unused, since we already have the result */
-                if (*f == 'p')
-                    (void) va_arg(vargs, void *);
-                else
-                    (void) va_arg(vargs, int);
-                /* extract the result from numberresults and append. */
-                len = strlen(numberresult);
-                unicode_write_cstr(string, i, numberresult, len);
-                /* skip over the separating '\0' */
-                i += len;
-                numberresult += len;
-                assert(*numberresult == '\0');
-                numberresult++;
-                assert(numberresult <= numberresults + numbersize);
-                break;
-            }
-            case 's':
-            {
-                /* unused, since we already have the result */
-                Py_ssize_t size;
-                (void) va_arg(vargs, char *);
-                size = PyUnicode_GET_LENGTH(*callresult);
-                assert(PyUnicode_KIND(*callresult) <= PyUnicode_KIND(string));
-                _PyUnicode_FastCopyCharacters(string, i, *callresult, 0, size);
-                i += size;
-                /* We're done with the unicode()/repr() => forget it */
-                Py_DECREF(*callresult);
-                /* switch to next unicode()/repr() result */
-                ++callresult;
-                break;
-            }
-            case 'U':
-            {
-                PyObject *obj = va_arg(vargs, PyObject *);
-                Py_ssize_t size;
-                assert(PyUnicode_KIND(obj) <= PyUnicode_KIND(string));
-                size = PyUnicode_GET_LENGTH(obj);
-                _PyUnicode_FastCopyCharacters(string, i, obj, 0, size);
-                i += size;
-                break;
-            }
-            case 'V':
-            {
-                Py_ssize_t size;
-                PyObject *obj = va_arg(vargs, PyObject *);
-                va_arg(vargs, const char *);
-                if (obj) {
-                    size = PyUnicode_GET_LENGTH(obj);
-                    assert(PyUnicode_KIND(obj) <= PyUnicode_KIND(string));
-                    _PyUnicode_FastCopyCharacters(string, i, obj, 0, size);
-                    i += size;
-                } else {
-                    size = PyUnicode_GET_LENGTH(*callresult);
-                    assert(PyUnicode_KIND(*callresult) <=
-                           PyUnicode_KIND(string));
-                    _PyUnicode_FastCopyCharacters(string, i, *callresult, 0, size);
-                    i += size;
-                    Py_DECREF(*callresult);
-                }
-                ++callresult;
-                break;
-            }
-            case 'S':
-            case 'R':
-            case 'A':
-            {
-                Py_ssize_t size = PyUnicode_GET_LENGTH(*callresult);
-                /* unused, since we already have the result */
-                (void) va_arg(vargs, PyObject *);
-                assert(PyUnicode_KIND(*callresult) <= PyUnicode_KIND(string));
-                _PyUnicode_FastCopyCharacters(string, i, *callresult, 0,  size);
-                i += size;
-                /* We're done with the unicode()/repr() => forget it */
-                Py_DECREF(*callresult);
-                /* switch to next unicode()/repr() result */
-                ++callresult;
-                break;
-            }
-            case '%':
-                PyUnicode_WRITE(kind, data, i++, '%');
-                break;
-            default:
-            {
-                Py_ssize_t len = strlen(p);
-                unicode_write_cstr(string, i, p, len);
-                i += len;
-                assert(i == PyUnicode_GET_LENGTH(string));
-                goto end;
-            }
-            }
+            f = unicode_fromformat_arg(&writer, f, &vargs2);
+            if (f == NULL)
+                goto fail;
         }
         else {
-            assert(i < PyUnicode_GET_LENGTH(string));
-            PyUnicode_WRITE(kind, data, i++, *f);
-        }
-    }
-    assert(i == PyUnicode_GET_LENGTH(string));
+            const char *p;
+            Py_ssize_t len;
 
-  end:
-    if (callresults)
-        PyObject_Free(callresults);
-    if (numberresults)
-        PyObject_Free(numberresults);
-    return unicode_result(string);
-  fail:
-    if (callresults) {
-        PyObject **callresult2 = callresults;
-        while (callresult2 < callresult) {
-            Py_XDECREF(*callresult2);
-            ++callresult2;
+            p = f;
+            do
+            {
+                if ((unsigned char)*p > 127) {
+                    PyErr_Format(PyExc_ValueError,
+                        "PyUnicode_FromFormatV() expects an ASCII-encoded format "
+                        "string, got a non-ASCII byte: 0x%02x",
+                        (unsigned char)*p);
+                    return NULL;
+                }
+                p++;
+            }
+            while (*p != '\0' && *p != '%');
+            len = p - f;
+
+            if (*p == '\0')
+                writer.overallocate = 0;
+
+            if (_PyUnicodeWriter_WriteASCIIString(&writer, f, len) < 0)
+                goto fail;
+
+            f = p;
         }
-        PyObject_Free(callresults);
     }
-    if (numberresults)
-        PyObject_Free(numberresults);
+    return _PyUnicodeWriter_Finish(&writer);
+
+  fail:
+    _PyUnicodeWriter_Dealloc(&writer);
     return NULL;
 }
 
@@ -2968,26 +2877,17 @@
 PyObject *
 PyUnicode_FromOrdinal(int ordinal)
 {
-    PyObject *v;
     if (ordinal < 0 || ordinal > MAX_UNICODE) {
         PyErr_SetString(PyExc_ValueError,
                         "chr() arg not in range(0x110000)");
         return NULL;
     }
 
-    if ((Py_UCS4)ordinal < 256)
-        return get_latin1_char((unsigned char)ordinal);
-
-    v = PyUnicode_New(1, ordinal);
-    if (v == NULL)
-        return NULL;
-    PyUnicode_WRITE(PyUnicode_KIND(v), PyUnicode_DATA(v), 0, ordinal);
-    assert(_PyUnicode_CheckConsistency(v, 1));
-    return v;
+    return unicode_char((Py_UCS4)ordinal);
 }
 
 PyObject *
-PyUnicode_FromObject(register PyObject *obj)
+PyUnicode_FromObject(PyObject *obj)
 {
     /* XXX Perhaps we should make this API an alias of
        PyObject_Str() instead ?! */
@@ -3009,7 +2909,7 @@
 }
 
 PyObject *
-PyUnicode_FromEncodedObject(register PyObject *obj,
+PyUnicode_FromEncodedObject(PyObject *obj,
                             const char *encoding,
                             const char *errors)
 {
@@ -3040,8 +2940,7 @@
     /* Retrieve a bytes buffer view through the PEP 3118 buffer interface */
     if (PyObject_GetBuffer(obj, &buffer, PyBUF_SIMPLE) < 0) {
         PyErr_Format(PyExc_TypeError,
-                     "coercing to str: need bytes, bytearray "
-                     "or buffer-like object, %.80s found",
+                     "coercing to str: need a bytes-like object, %.80s found",
                      Py_TYPE(obj)->tp_name);
         return NULL;
     }
@@ -3061,14 +2960,17 @@
    1 on success. */
 int
 _Py_normalize_encoding(const char *encoding,
-                   char *lower,
-                   size_t lower_len)
+                       char *lower,
+                       size_t lower_len)
 {
     const char *e;
     char *l;
     char *l_end;
 
     if (encoding == NULL) {
+        /* 6 == strlen("utf-8") + 1 */
+        if (lower_len < 6)
+            return 0;
         strcpy(lower, "utf-8");
         return 1;
     }
@@ -3110,7 +3012,8 @@
             return PyUnicode_DecodeUTF8Stateful(s, size, errors, NULL);
         else if ((strcmp(lower, "latin-1") == 0) ||
                  (strcmp(lower, "latin1") == 0) ||
-                 (strcmp(lower, "iso-8859-1") == 0))
+                 (strcmp(lower, "iso-8859-1") == 0) ||
+                 (strcmp(lower, "iso8859-1") == 0))
             return PyUnicode_DecodeLatin1(s, size, errors);
 #ifdef HAVE_MBCS
         else if (strcmp(lower, "mbcs") == 0)
@@ -3136,8 +3039,10 @@
         goto onError;
     if (!PyUnicode_Check(unicode)) {
         PyErr_Format(PyExc_TypeError,
-                     "decoder did not return a str object (type=%.400s)",
-                     Py_TYPE(unicode)->tp_name);
+                     "'%.400s' decoder returned '%.400s' instead of 'str'; "
+                     "use codecs.decode() to decode to arbitrary types",
+                     encoding,
+                     Py_TYPE(unicode)->tp_name, Py_TYPE(unicode)->tp_name);
         Py_DECREF(unicode);
         goto onError;
     }
@@ -3195,8 +3100,10 @@
         goto onError;
     if (!PyUnicode_Check(v)) {
         PyErr_Format(PyExc_TypeError,
-                     "decoder did not return a str object (type=%.400s)",
-                     Py_TYPE(v)->tp_name);
+                     "'%.400s' decoder returned '%.400s' instead of 'str'; "
+                     "use codecs.decode() to decode to arbitrary types",
+                     encoding,
+                     Py_TYPE(unicode)->tp_name, Py_TYPE(unicode)->tp_name);
         Py_DECREF(v);
         goto onError;
     }
@@ -3344,7 +3251,7 @@
     }
 
     if (surrogateescape) {
-        /* locale encoding with surrogateescape */
+        /* "surrogateescape" error handler */
         char *str;
 
         str = _Py_wchar2char(wstr, &error_pos);
@@ -3364,6 +3271,7 @@
         PyMem_Free(str);
     }
     else {
+        /* strict mode */
         size_t len, len2;
 
         len = wcstombs(NULL, wstr, 0);
@@ -3402,7 +3310,7 @@
         wstr = _Py_char2wchar(errmsg, &errlen);
         if (wstr != NULL) {
             reason = PyUnicode_FromWideChar(wstr, errlen);
-            PyMem_Free(wstr);
+            PyMem_RawFree(wstr);
         } else
             errmsg = NULL;
     }
@@ -3480,7 +3388,8 @@
         }
         else if ((strcmp(lower, "latin-1") == 0) ||
                  (strcmp(lower, "latin1") == 0) ||
-                 (strcmp(lower, "iso-8859-1") == 0))
+                 (strcmp(lower, "iso-8859-1") == 0) ||
+                 (strcmp(lower, "iso8859-1") == 0))
             return _PyUnicode_AsLatin1String(unicode, errors);
 #ifdef HAVE_MBCS
         else if (strcmp(lower, "mbcs") == 0)
@@ -3505,7 +3414,8 @@
         PyObject *b;
 
         error = PyErr_WarnFormat(PyExc_RuntimeWarning, 1,
-            "encoder %s returned bytearray instead of bytes",
+            "encoder %s returned bytearray instead of bytes; "
+            "use codecs.encode() to encode to arbitrary types",
             encoding);
         if (error) {
             Py_DECREF(v);
@@ -3518,8 +3428,10 @@
     }
 
     PyErr_Format(PyExc_TypeError,
-                 "encoder did not return a bytes object (type=%.400s)",
-                 Py_TYPE(v)->tp_name);
+                 "'%.400s' encoder returned '%.400s' instead of 'bytes'; "
+                 "use codecs.encode() to encode to arbitrary types",
+                 encoding,
+                 Py_TYPE(v)->tp_name, Py_TYPE(v)->tp_name);
     Py_DECREF(v);
     return NULL;
 }
@@ -3545,8 +3457,10 @@
         goto onError;
     if (!PyUnicode_Check(v)) {
         PyErr_Format(PyExc_TypeError,
-                     "encoder did not return an str object (type=%.400s)",
-                     Py_TYPE(v)->tp_name);
+                     "'%.400s' encoder returned '%.400s' instead of 'str'; "
+                     "use codecs.encode() to encode to arbitrary types",
+                     encoding,
+                     Py_TYPE(v)->tp_name, Py_TYPE(v)->tp_name);
         Py_DECREF(v);
         goto onError;
     }
@@ -3609,8 +3523,8 @@
         return NULL;
     }
 
-    if (surrogateescape)
-    {
+    if (surrogateescape) {
+        /* "surrogateescape" error handler */
         wstr = _Py_char2wchar(str, &wlen);
         if (wstr == NULL) {
             if (wlen == (size_t)-1)
@@ -3621,9 +3535,10 @@
         }
 
         unicode = PyUnicode_FromWideChar(wstr, wlen);
-        PyMem_Free(wstr);
+        PyMem_RawFree(wstr);
     }
     else {
+        /* strict mode */
 #ifndef HAVE_BROKEN_MBSTOWCS
         wlen = mbstowcs(NULL, str, 0);
 #else
@@ -3643,7 +3558,6 @@
                 return PyErr_NoMemory();
         }
 
-        /* This shouldn't fail now */
         wlen2 = mbstowcs(wstr, str, wlen+1);
         if (wlen2 == (size_t)-1) {
             if (wstr != smallbuf)
@@ -3669,7 +3583,7 @@
         wstr = _Py_char2wchar(errmsg, &errlen);
         if (wstr != NULL) {
             reason = PyUnicode_FromWideChar(wstr, errlen);
-            PyMem_Free(wstr);
+            PyMem_RawFree(wstr);
         } else
             errmsg = NULL;
     }
@@ -3737,18 +3651,20 @@
 
 
 int
-_PyUnicode_HasNULChars(PyObject* s)
+_PyUnicode_HasNULChars(PyObject* str)
 {
-    static PyObject *nul = NULL;
+    Py_ssize_t pos;
 
-    if (nul == NULL)
-        nul = PyUnicode_FromStringAndSize("\0", 1);
-    if (nul == NULL)
+    if (PyUnicode_READY(str) == -1)
         return -1;
-    return PyUnicode_Contains(s, nul);
+    pos = findchar(PyUnicode_DATA(str), PyUnicode_KIND(str),
+                   PyUnicode_GET_LENGTH(str), '\0', 1);
+    if (pos == -1)
+        return 0;
+    else
+        return 1;
 }
 
-
 int
 PyUnicode_FSConverter(PyObject* arg, void* addr)
 {
@@ -3852,6 +3768,7 @@
             return NULL;
         _PyUnicode_UTF8(unicode) = PyObject_MALLOC(PyBytes_GET_SIZE(bytes) + 1);
         if (_PyUnicode_UTF8(unicode) == NULL) {
+            PyErr_NoMemory();
             Py_DECREF(bytes);
             return NULL;
         }
@@ -4020,6 +3937,9 @@
 Py_UCS4
 PyUnicode_ReadChar(PyObject *unicode, Py_ssize_t index)
 {
+    void *data;
+    int kind;
+
     if (!PyUnicode_Check(unicode) || PyUnicode_READY(unicode) == -1) {
         PyErr_BadArgument();
         return (Py_UCS4)-1;
@@ -4028,7 +3948,9 @@
         PyErr_SetString(PyExc_IndexError, "string index out of range");
         return (Py_UCS4)-1;
     }
-    return PyUnicode_READ_CHAR(unicode, index);
+    data = PyUnicode_DATA(unicode);
+    kind = PyUnicode_KIND(unicode);
+    return PyUnicode_READ(kind, data, index);
 }
 
 int
@@ -4086,6 +4008,7 @@
     Py_CLEAR(*exceptionObject);
 }
 
+#ifdef HAVE_MBCS
 /* error handling callback helper:
    build arguments, call the callback and check the arguments,
    if no exception occurred, copy the replacement to the output
@@ -4094,11 +4017,12 @@
 */
 
 static int
-unicode_decode_call_errorhandler(const char *errors, PyObject **errorHandler,
-                                 const char *encoding, const char *reason,
-                                 const char **input, const char **inend, Py_ssize_t *startinpos,
-                                 Py_ssize_t *endinpos, PyObject **exceptionObject, const char **inptr,
-                                 PyObject **output, Py_ssize_t *outpos)
+unicode_decode_call_errorhandler_wchar(
+    const char *errors, PyObject **errorHandler,
+    const char *encoding, const char *reason,
+    const char **input, const char **inend, Py_ssize_t *startinpos,
+    Py_ssize_t *endinpos, PyObject **exceptionObject, const char **inptr,
+    PyObject **output, Py_ssize_t *outpos)
 {
     static char *argparse = "O!n;decoding error handler must return (str, int) tuple";
 
@@ -4109,12 +4033,11 @@
     Py_ssize_t requiredsize;
     Py_ssize_t newpos;
     PyObject *inputobj = NULL;
-    int res = -1;
+    wchar_t *repwstr;
+    Py_ssize_t repwlen;
 
-    if (_PyUnicode_KIND(*output) != PyUnicode_WCHAR_KIND)
-        outsize = PyUnicode_GET_LENGTH(*output);
-    else
-        outsize = _PyUnicode_WSTR_LENGTH(*output);
+    assert (_PyUnicode_KIND(*output) == PyUnicode_WCHAR_KIND);
+    outsize = _PyUnicode_WSTR_LENGTH(*output);
 
     if (*errorHandler == NULL) {
         *errorHandler = PyCodec_LookupError(errors);
@@ -4139,7 +4062,107 @@
     }
     if (!PyArg_ParseTuple(restuple, argparse, &PyUnicode_Type, &repunicode, &newpos))
         goto onError;
-    if (PyUnicode_READY(repunicode) == -1)
+
+    /* Copy back the bytes variables, which might have been modified by the
+       callback */
+    inputobj = PyUnicodeDecodeError_GetObject(*exceptionObject);
+    if (!inputobj)
+        goto onError;
+    if (!PyBytes_Check(inputobj)) {
+        PyErr_Format(PyExc_TypeError, "exception attribute object must be bytes");
+    }
+    *input = PyBytes_AS_STRING(inputobj);
+    insize = PyBytes_GET_SIZE(inputobj);
+    *inend = *input + insize;
+    /* we can DECREF safely, as the exception has another reference,
+       so the object won't go away. */
+    Py_DECREF(inputobj);
+
+    if (newpos<0)
+        newpos = insize+newpos;
+    if (newpos<0 || newpos>insize) {
+        PyErr_Format(PyExc_IndexError, "position %zd from error handler out of bounds", newpos);
+        goto onError;
+    }
+
+    repwstr = PyUnicode_AsUnicodeAndSize(repunicode, &repwlen);
+    if (repwstr == NULL)
+        goto onError;
+    /* need more space? (at least enough for what we
+       have+the replacement+the rest of the string (starting
+       at the new input position), so we won't have to check space
+       when there are no errors in the rest of the string) */
+    requiredsize = *outpos;
+    if (requiredsize > PY_SSIZE_T_MAX - repwlen)
+        goto overflow;
+    requiredsize += repwlen;
+    if (requiredsize > PY_SSIZE_T_MAX - (insize - newpos))
+        goto overflow;
+    requiredsize += insize - newpos;
+    if (requiredsize > outsize) {
+        if (outsize <= PY_SSIZE_T_MAX/2 && requiredsize < 2*outsize)
+            requiredsize = 2*outsize;
+        if (unicode_resize(output, requiredsize) < 0)
+            goto onError;
+    }
+    wcsncpy(_PyUnicode_WSTR(*output) + *outpos, repwstr, repwlen);
+    *outpos += repwlen;
+    *endinpos = newpos;
+    *inptr = *input + newpos;
+
+    /* we made it! */
+    Py_XDECREF(restuple);
+    return 0;
+
+  overflow:
+    PyErr_SetString(PyExc_OverflowError,
+                    "decoded result is too long for a Python string");
+
+  onError:
+    Py_XDECREF(restuple);
+    return -1;
+}
+#endif   /* HAVE_MBCS */
+
+static int
+unicode_decode_call_errorhandler_writer(
+    const char *errors, PyObject **errorHandler,
+    const char *encoding, const char *reason,
+    const char **input, const char **inend, Py_ssize_t *startinpos,
+    Py_ssize_t *endinpos, PyObject **exceptionObject, const char **inptr,
+    _PyUnicodeWriter *writer /* PyObject **output, Py_ssize_t *outpos */)
+{
+    static char *argparse = "O!n;decoding error handler must return (str, int) tuple";
+
+    PyObject *restuple = NULL;
+    PyObject *repunicode = NULL;
+    Py_ssize_t insize;
+    Py_ssize_t newpos;
+    Py_ssize_t replen;
+    PyObject *inputobj = NULL;
+
+    if (*errorHandler == NULL) {
+        *errorHandler = PyCodec_LookupError(errors);
+        if (*errorHandler == NULL)
+            goto onError;
+    }
+
+    make_decode_exception(exceptionObject,
+        encoding,
+        *input, *inend - *input,
+        *startinpos, *endinpos,
+        reason);
+    if (*exceptionObject == NULL)
+        goto onError;
+
+    restuple = PyObject_CallFunctionObjArgs(*errorHandler, *exceptionObject, NULL);
+    if (restuple == NULL)
+        goto onError;
+    if (!PyTuple_Check(restuple)) {
+        PyErr_SetString(PyExc_TypeError, &argparse[4]);
+        goto onError;
+    }
+    if (!PyArg_ParseTuple(restuple, argparse, &PyUnicode_Type, &repunicode, &newpos))
         goto onError;
 
     /* Copy back the bytes variables, which might have been modified by the
@@ -4164,71 +4187,29 @@
         goto onError;
     }
 
-    if (_PyUnicode_KIND(*output) != PyUnicode_WCHAR_KIND) {
-        /* need more space? (at least enough for what we
-           have+the replacement+the rest of the string (starting
-           at the new input position), so we won't have to check space
-           when there are no errors in the rest of the string) */
-        Py_ssize_t replen = PyUnicode_GET_LENGTH(repunicode);
-        requiredsize = *outpos;
-        if (requiredsize > PY_SSIZE_T_MAX - replen)
-            goto overflow;
-        requiredsize += replen;
-        if (requiredsize > PY_SSIZE_T_MAX - (insize - newpos))
-            goto overflow;
-        requiredsize += insize - newpos;
-        if (requiredsize > outsize) {
-            if (outsize <= PY_SSIZE_T_MAX/2 && requiredsize < 2*outsize)
-                requiredsize = 2*outsize;
-            if (unicode_resize(output, requiredsize) < 0)
-                goto onError;
-        }
-        if (unicode_widen(output, *outpos,
-                          PyUnicode_MAX_CHAR_VALUE(repunicode)) < 0)
+    if (PyUnicode_READY(repunicode) < 0)
+        goto onError;
+    replen = PyUnicode_GET_LENGTH(repunicode);
+    if (replen > 1) {
+        writer->min_length += replen - 1;
+        writer->overallocate = 1;
+        if (_PyUnicodeWriter_Prepare(writer, writer->min_length,
+                            PyUnicode_MAX_CHAR_VALUE(repunicode)) == -1)
             goto onError;
-        _PyUnicode_FastCopyCharacters(*output, *outpos, repunicode, 0, replen);
-        *outpos += replen;
     }
-    else {
-        wchar_t *repwstr;
-        Py_ssize_t repwlen;
-        repwstr = PyUnicode_AsUnicodeAndSize(repunicode, &repwlen);
-        if (repwstr == NULL)
-            goto onError;
-        /* need more space? (at least enough for what we
-           have+the replacement+the rest of the string (starting
-           at the new input position), so we won't have to check space
-           when there are no errors in the rest of the string) */
-        requiredsize = *outpos;
-        if (requiredsize > PY_SSIZE_T_MAX - repwlen)
-            goto overflow;
-        requiredsize += repwlen;
-        if (requiredsize > PY_SSIZE_T_MAX - (insize - newpos))
-            goto overflow;
-        requiredsize += insize - newpos;
-        if (requiredsize > outsize) {
-            if (outsize <= PY_SSIZE_T_MAX/2 && requiredsize < 2*outsize)
-                requiredsize = 2*outsize;
-            if (unicode_resize(output, requiredsize) < 0)
-                goto onError;
-        }
-        wcsncpy(_PyUnicode_WSTR(*output) + *outpos, repwstr, repwlen);
-        *outpos += repwlen;
-    }
+    if (_PyUnicodeWriter_WriteStr(writer, repunicode) == -1)
+        goto onError;
+
     *endinpos = newpos;
     *inptr = *input + newpos;
 
     /* we made it! */
-    res = 0;
+    Py_XDECREF(restuple);
+    return 0;
 
   onError:
     Py_XDECREF(restuple);
-    return res;
-
-  overflow:
-    PyErr_SetString(PyExc_OverflowError,
-                    "decoded result is too long for a Python string");
-    goto onError;
+    return -1;
 }
 
 /* --- UTF-7 Codec -------------------------------------------------------- */
@@ -4336,9 +4317,8 @@
     const char *starts = s;
     Py_ssize_t startinpos;
     Py_ssize_t endinpos;
-    Py_ssize_t outpos;
     const char *e;
-    PyObject *unicode;
+    _PyUnicodeWriter writer;
     const char *errmsg = "";
     int inShift = 0;
     Py_ssize_t shiftOutStart;
@@ -4348,17 +4328,17 @@
     PyObject *errorHandler = NULL;
     PyObject *exc = NULL;
 
-    /* Start off assuming it's all ASCII. Widen later as necessary. */
-    unicode = PyUnicode_New(size, 127);
-    if (!unicode)
-        return NULL;
     if (size == 0) {
         if (consumed)
             *consumed = 0;
-        return unicode;
+        _Py_RETURN_UNICODE_EMPTY();
     }
 
-    shiftOutStart = outpos = 0;
+    /* Start off assuming it's all ASCII. Widen later as necessary. */
+    _PyUnicodeWriter_Init(&writer);
+    writer.min_length = size;
+
+    shiftOutStart = 0;
     e = s + size;
 
     while (s < e) {
@@ -4381,13 +4361,13 @@
                         /* expecting a second surrogate */
                         if (Py_UNICODE_IS_LOW_SURROGATE(outCh)) {
                             Py_UCS4 ch2 = Py_UNICODE_JOIN_SURROGATES(surrogate, outCh);
-                            if (unicode_putchar(&unicode, &outpos, ch2) < 0)
+                            if (_PyUnicodeWriter_WriteCharInline(&writer, ch2) < 0)
                                 goto onError;
                             surrogate = 0;
                             continue;
                         }
                         else {
-                            if (unicode_putchar(&unicode, &outpos, surrogate) < 0)
+                            if (_PyUnicodeWriter_WriteCharInline(&writer, surrogate) < 0)
                                 goto onError;
                             surrogate = 0;
                         }
@@ -4397,7 +4377,7 @@
                         surrogate = outCh;
                     }
                     else {
-                        if (unicode_putchar(&unicode, &outpos, outCh) < 0)
+                        if (_PyUnicodeWriter_WriteCharInline(&writer, outCh) < 0)
                             goto onError;
                     }
                 }
@@ -4406,7 +4386,7 @@
                 inShift = 0;
                 s++;
                 if (surrogate) {
-                    if (unicode_putchar(&unicode, &outpos, surrogate) < 0)
+                    if (_PyUnicodeWriter_WriteCharInline(&writer, surrogate) < 0)
                         goto onError;
                     surrogate = 0;
                 }
@@ -4427,7 +4407,7 @@
                 if (ch != '-') {
                     /* '-' is absorbed; other terminating
                        characters are preserved */
-                    if (unicode_putchar(&unicode, &outpos, ch) < 0)
+                    if (_PyUnicodeWriter_WriteCharInline(&writer, ch) < 0)
                         goto onError;
                 }
             }
@@ -4437,20 +4417,20 @@
             s++; /* consume '+' */
             if (s < e && *s == '-') { /* '+-' encodes '+' */
                 s++;
-                if (unicode_putchar(&unicode, &outpos, '+') < 0)
+                if (_PyUnicodeWriter_WriteCharInline(&writer, '+') < 0)
                     goto onError;
             }
             else { /* begin base64-encoded section */
                 inShift = 1;
-                shiftOutStart = outpos;
+                shiftOutStart = writer.pos;
                 base64bits = 0;
                 base64buffer = 0;
             }
         }
         else if (DECODE_DIRECT(ch)) { /* character decodes as itself */
-            if (unicode_putchar(&unicode, &outpos, ch) < 0)
-                goto onError;
             s++;
+            if (_PyUnicodeWriter_WriteCharInline(&writer, ch) < 0)
+                goto onError;
         }
         else {
             startinpos = s-starts;
@@ -4461,11 +4441,11 @@
         continue;
 utf7Error:
         endinpos = s-starts;
-        if (unicode_decode_call_errorhandler(
+        if (unicode_decode_call_errorhandler_writer(
                 errors, &errorHandler,
                 "utf7", errmsg,
                 &starts, &e, &startinpos, &endinpos, &exc, &s,
-                &unicode, &outpos))
+                &writer))
             goto onError;
     }
 
@@ -4477,11 +4457,11 @@
                 (base64bits >= 6) ||
                 (base64bits > 0 && base64buffer != 0)) {
             endinpos = size;
-            if (unicode_decode_call_errorhandler(
+            if (unicode_decode_call_errorhandler_writer(
                     errors, &errorHandler,
                     "utf7", "unterminated shift sequence",
                     &starts, &e, &startinpos, &endinpos, &exc, &s,
-                    &unicode, &outpos))
+                    &writer))
                 goto onError;
             if (s < e)
                 goto restart;
@@ -4492,32 +4472,29 @@
     if (consumed) {
         if (inShift) {
             *consumed = startinpos;
-            if (outpos != shiftOutStart &&
-                PyUnicode_MAX_CHAR_VALUE(unicode) > 127) {
+            if (writer.pos != shiftOutStart && writer.maxchar > 127) {
                 PyObject *result = PyUnicode_FromKindAndData(
-                        PyUnicode_KIND(unicode), PyUnicode_DATA(unicode),
-                        shiftOutStart);
-                Py_DECREF(unicode);
-                unicode = result;
+                        writer.kind, writer.data, shiftOutStart);
+                Py_XDECREF(errorHandler);
+                Py_XDECREF(exc);
+                _PyUnicodeWriter_Dealloc(&writer);
+                return result;
             }
-            outpos = shiftOutStart; /* back off output */
+            writer.pos = shiftOutStart; /* back off output */
         }
         else {
             *consumed = s-starts;
         }
     }
 
-    if (unicode_resize(&unicode, outpos) < 0)
-        goto onError;
-
     Py_XDECREF(errorHandler);
     Py_XDECREF(exc);
-    return unicode_result(unicode);
+    return _PyUnicodeWriter_Finish(&writer);
 
   onError:
     Py_XDECREF(errorHandler);
     Py_XDECREF(exc);
-    Py_DECREF(unicode);
+    _PyUnicodeWriter_Dealloc(&writer);
     return NULL;
 }
 
@@ -4600,7 +4577,7 @@
 
             /* code first surrogate */
             base64bits += 16;
-            base64buffer = (base64buffer << 16) | 0xd800 | ((ch-0x10000) >> 10);
+            base64buffer = (base64buffer << 16) | Py_UNICODE_HIGH_SURROGATE(ch);
             while (base64bits >= 6) {
                 *out++ = TO_BASE64(base64buffer >> (base64bits-6));
                 base64bits -= 6;
@@ -4701,9 +4678,9 @@
     if (_Py_IS_ALIGNED(p, SIZEOF_LONG)) {
         /* Fast path, see in STRINGLIB(utf8_decode) for
            an explanation. */
-        /* Help register allocation */
-        register const char *_p = p;
-        register Py_UCS1 * q = dest;
+        /* Help allocation */
+        const char *_p = p;
+        Py_UCS1 * q = dest;
         while (_p < aligned_end) {
             unsigned long value = *(const unsigned long *) _p;
             if (value & ASCII_CHAR_MASK)
@@ -4726,8 +4703,8 @@
         /* Fast path, see in STRINGLIB(utf8_decode) in stringlib/codecs.h
            for an explanation. */
         if (_Py_IS_ALIGNED(p, SIZEOF_LONG)) {
-            /* Help register allocation */
-            register const char *_p = p;
+            /* Help allocation */
+            const char *_p = p;
             while (_p < aligned_end) {
                 unsigned long value = *(unsigned long *) _p;
                 if (value & ASCII_CHAR_MASK)
@@ -4752,10 +4729,9 @@
                              const char *errors,
                              Py_ssize_t *consumed)
 {
-    PyObject *unicode;
+    _PyUnicodeWriter writer;
     const char *starts = s;
     const char *end = s + size;
-    Py_ssize_t outpos;
 
     Py_ssize_t startinpos;
     Py_ssize_t endinpos;
@@ -4776,29 +4752,26 @@
         return get_latin1_char((unsigned char)s[0]);
     }
 
-    unicode = PyUnicode_New(size, 127);
-    if (!unicode)
-        return NULL;
+    _PyUnicodeWriter_Init(&writer);
+    writer.min_length = size;
+    if (_PyUnicodeWriter_Prepare(&writer, writer.min_length, 127) == -1)
+        goto onError;
 
-    outpos = ascii_decode(s, end, PyUnicode_1BYTE_DATA(unicode));
-    s += outpos;
+    writer.pos = ascii_decode(s, end, writer.data);
+    s += writer.pos;
     while (s < end) {
         Py_UCS4 ch;
-        int kind = PyUnicode_KIND(unicode);
+        int kind = writer.kind;
         if (kind == PyUnicode_1BYTE_KIND) {
-            if (PyUnicode_IS_ASCII(unicode))
-                ch = asciilib_utf8_decode(&s, end,
-                        PyUnicode_1BYTE_DATA(unicode), &outpos);
+            if (PyUnicode_IS_ASCII(writer.buffer))
+                ch = asciilib_utf8_decode(&s, end, writer.data, &writer.pos);
             else
-                ch = ucs1lib_utf8_decode(&s, end,
-                        PyUnicode_1BYTE_DATA(unicode), &outpos);
+                ch = ucs1lib_utf8_decode(&s, end, writer.data, &writer.pos);
         } else if (kind == PyUnicode_2BYTE_KIND) {
-            ch = ucs2lib_utf8_decode(&s, end,
-                    PyUnicode_2BYTE_DATA(unicode), &outpos);
+            ch = ucs2lib_utf8_decode(&s, end, writer.data, &writer.pos);
         } else {
             assert(kind == PyUnicode_4BYTE_KIND);
-            ch = ucs4lib_utf8_decode(&s, end,
-                    PyUnicode_4BYTE_DATA(unicode), &outpos);
+            ch = ucs4lib_utf8_decode(&s, end, writer.data, &writer.pos);
         }
 
         switch (ch) {
@@ -4822,35 +4795,31 @@
             endinpos = startinpos + ch - 1;
             break;
         default:
-            if (unicode_putchar(&unicode, &outpos, ch) < 0)
+            if (_PyUnicodeWriter_WriteCharInline(&writer, ch) < 0)
                 goto onError;
             continue;
         }
 
-        if (unicode_decode_call_errorhandler(
+        if (unicode_decode_call_errorhandler_writer(
                 errors, &errorHandler,
                 "utf-8", errmsg,
                 &starts, &end, &startinpos, &endinpos, &exc, &s,
-                &unicode, &outpos))
+                &writer))
             goto onError;
     }
 
 End:
-    if (unicode_resize(&unicode, outpos) < 0)
-        goto onError;
-
     if (consumed)
         *consumed = s - starts;
 
     Py_XDECREF(errorHandler);
     Py_XDECREF(exc);
-    assert(_PyUnicode_CheckConsistency(unicode, 1));
-    return unicode;
+    return _PyUnicodeWriter_Finish(&writer);
 
 onError:
     Py_XDECREF(errorHandler);
     Py_XDECREF(exc);
-    Py_XDECREF(unicode);
+    _PyUnicodeWriter_Dealloc(&writer);
     return NULL;
 }
 
@@ -4860,7 +4829,7 @@
    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. */
+   PyMem_RawFree() to free the memory), or NULL on memory allocation error. */
 
 wchar_t*
 _Py_DecodeUTF8_surrogateescape(const char *s, Py_ssize_t size)
@@ -4873,7 +4842,7 @@
        character count */
     if (PY_SSIZE_T_MAX / sizeof(wchar_t) < (size + 1))
         return NULL;
-    unicode = PyMem_Malloc((size + 1) * sizeof(wchar_t));
+    unicode = PyMem_RawMalloc((size + 1) * sizeof(wchar_t));
     if (!unicode)
         return NULL;
 
@@ -4996,17 +4965,11 @@
     const char *starts = s;
     Py_ssize_t startinpos;
     Py_ssize_t endinpos;
-    Py_ssize_t outpos;
-    PyObject *unicode;
+    _PyUnicodeWriter writer;
     const unsigned char *q, *e;
-    int bo = 0;       /* assume native ordering by default */
+    int le, bo = 0;       /* assume native ordering by default */
+    const char *encoding;
     const char *errmsg = "";
-    /* Offsets from q for retrieving bytes in the right order. */
-#ifdef BYTEORDER_IS_LITTLE_ENDIAN
-    int iorder[] = {0, 1, 2, 3};
-#else
-    int iorder[] = {3, 2, 1, 0};
-#endif
     PyObject *errorHandler = NULL;
     PyObject *exc = NULL;
 
@@ -5020,107 +4983,118 @@
        byte order setting accordingly. In native mode, the leading BOM
        mark is skipped, in all other modes, it is copied to the output
        stream as-is (giving a ZWNBSP character). */
-    if (bo == 0) {
-        if (size >= 4) {
-            const Py_UCS4 bom = (q[iorder[3]] << 24) | (q[iorder[2]] << 16) |
-                (q[iorder[1]] << 8) | q[iorder[0]];
-#ifdef BYTEORDER_IS_LITTLE_ENDIAN
-            if (bom == 0x0000FEFF) {
-                q += 4;
-                bo = -1;
-            }
-            else if (bom == 0xFFFE0000) {
-                q += 4;
-                bo = 1;
-            }
+    if (bo == 0 && size >= 4) {
+        Py_UCS4 bom = (q[3] << 24) | (q[2] << 16) | (q[1] << 8) | q[0];
+        if (bom == 0x0000FEFF) {
+            bo = -1;
+            q += 4;
+        }
+        else if (bom == 0xFFFE0000) {
+            bo = 1;
+            q += 4;
+        }
+        if (byteorder)
+            *byteorder = bo;
+    }
+
+    if (q == e) {
+        if (consumed)
+            *consumed = size;
+        _Py_RETURN_UNICODE_EMPTY();
+    }
+
+#ifdef WORDS_BIGENDIAN
+    le = bo < 0;
 #else
-            if (bom == 0x0000FEFF) {
-                q += 4;
-                bo = 1;
-            }
-            else if (bom == 0xFFFE0000) {
-                q += 4;
-                bo = -1;
-            }
+    le = bo <= 0;
 #endif
+    encoding = le ? "utf-32-le" : "utf-32-be";
+
+    _PyUnicodeWriter_Init(&writer);
+    writer.min_length = (e - q + 3) / 4;
+    if (_PyUnicodeWriter_Prepare(&writer, writer.min_length, 127) == -1)
+        goto onError;
+
+    while (1) {
+        Py_UCS4 ch = 0;
+        Py_UCS4 maxch = PyUnicode_MAX_CHAR_VALUE(writer.buffer);
+
+        if (e - q >= 4) {
+            enum PyUnicode_Kind kind = writer.kind;
+            void *data = writer.data;
+            const unsigned char *last = e - 4;
+            Py_ssize_t pos = writer.pos;
+            if (le) {
+                do {
+                    ch = (q[3] << 24) | (q[2] << 16) | (q[1] << 8) | q[0];
+                    if (ch > maxch)
+                        break;
+                    if (kind != PyUnicode_1BYTE_KIND &&
+                        Py_UNICODE_IS_SURROGATE(ch))
+                        break;
+                    PyUnicode_WRITE(kind, data, pos++, ch);
+                    q += 4;
+                } while (q <= last);
+            }
+            else {
+                do {
+                    ch = (q[0] << 24) | (q[1] << 16) | (q[2] << 8) | q[3];
+                    if (ch > maxch)
+                        break;
+                    if (kind != PyUnicode_1BYTE_KIND &&
+                        Py_UNICODE_IS_SURROGATE(ch))
+                        break;
+                    PyUnicode_WRITE(kind, data, pos++, ch);
+                    q += 4;
+                } while (q <= last);
+            }
+            writer.pos = pos;
         }
-    }
 
-    if (bo == -1) {
-        /* force LE */
-        iorder[0] = 0;
-        iorder[1] = 1;
-        iorder[2] = 2;
-        iorder[3] = 3;
-    }
-    else if (bo == 1) {
-        /* force BE */
-        iorder[0] = 3;
-        iorder[1] = 2;
-        iorder[2] = 1;
-        iorder[3] = 0;
-    }
-
-    /* This might be one to much, because of a BOM */
-    unicode = PyUnicode_New((size+3)/4, 127);
-    if (!unicode)
-        return NULL;
-    if (size == 0)
-        return unicode;
-    outpos = 0;
-
-    while (q < e) {
-        Py_UCS4 ch;
-        /* remaining bytes at the end? (size should be divisible by 4) */
-        if (e-q<4) {
-            if (consumed)
+        if (Py_UNICODE_IS_SURROGATE(ch)) {
+            errmsg = "code point in surrogate code point range(0xd800, 0xe000)";
+            startinpos = ((const char *)q) - starts;
+            endinpos = startinpos + 4;
+        }
+        else if (ch <= maxch) {
+            if (q == e || consumed)
                 break;
+            /* remaining bytes at the end? (size should be divisible by 4) */
             errmsg = "truncated data";
-            startinpos = ((const char *)q)-starts;
-            endinpos = ((const char *)e)-starts;
-            goto utf32Error;
-            /* The remaining input chars are ignored if the callback
-               chooses to skip the input */
+            startinpos = ((const char *)q) - starts;
+            endinpos = ((const char *)e) - starts;
         }
-        ch = (q[iorder[3]] << 24) | (q[iorder[2]] << 16) |
-            (q[iorder[1]] << 8) | q[iorder[0]];
+        else {
+            if (ch < 0x110000) {
+                if (_PyUnicodeWriter_WriteCharInline(&writer, ch) < 0)
+                    goto onError;
+                q += 4;
+                continue;
+            }
+            errmsg = "code point not in range(0x110000)";
+            startinpos = ((const char *)q) - starts;
+            endinpos = startinpos + 4;
+        }
 
-        if (ch >= 0x110000)
-        {
-            errmsg = "codepoint not in range(0x110000)";
-            startinpos = ((const char *)q)-starts;
-            endinpos = startinpos+4;
-            goto utf32Error;
-        }
-        if (unicode_putchar(&unicode, &outpos, ch) < 0)
-            goto onError;
-        q += 4;
-        continue;
-      utf32Error:
-        if (unicode_decode_call_errorhandler(
+        /* The remaining input chars are ignored if the callback
+           chooses to skip the input */
+        if (unicode_decode_call_errorhandler_writer(
                 errors, &errorHandler,
-                "utf32", errmsg,
+                encoding, errmsg,
                 &starts, (const char **)&e, &startinpos, &endinpos, &exc, (const char **)&q,
-                &unicode, &outpos))
+                &writer))
             goto onError;
     }
 
-    if (byteorder)
-        *byteorder = bo;
-
     if (consumed)
         *consumed = (const char *)q-starts;
 
-    /* Adjust length */
-    if (unicode_resize(&unicode, outpos) < 0)
-        goto onError;
-
     Py_XDECREF(errorHandler);
     Py_XDECREF(exc);
-    return unicode_result(unicode);
+    return _PyUnicodeWriter_Finish(&writer);
 
   onError:
-    Py_DECREF(unicode);
+    _PyUnicodeWriter_Dealloc(&writer);
     Py_XDECREF(errorHandler);
     Py_XDECREF(exc);
     return NULL;
@@ -5138,11 +5112,15 @@
     unsigned char *p;
     Py_ssize_t nsize, i;
     /* Offsets from p for storing byte pairs in the right order. */
-#ifdef BYTEORDER_IS_LITTLE_ENDIAN
+#if PY_LITTLE_ENDIAN
     int iorder[] = {0, 1, 2, 3};
 #else
     int iorder[] = {3, 2, 1, 0};
 #endif
+    const char *encoding;
+    PyObject *errorHandler = NULL;
+    PyObject *exc = NULL;
+    PyObject *rep = NULL;
 
 #define STORECHAR(CH)                           \
     do {                                        \
@@ -5174,7 +5152,7 @@
     if (byteorder == 0)
         STORECHAR(0xFEFF);
     if (len == 0)
-        goto done;
+        return v;
 
     if (byteorder == -1) {
         /* force LE */
@@ -5182,6 +5160,7 @@
         iorder[1] = 1;
         iorder[2] = 2;
         iorder[3] = 3;
+        encoding = "utf-32-le";
     }
     else if (byteorder == 1) {
         /* force BE */
@@ -5189,13 +5168,103 @@
         iorder[1] = 2;
         iorder[2] = 1;
         iorder[3] = 0;
+        encoding = "utf-32-be";
+    }
+    else
+        encoding = "utf-32";
+
+    if (kind == PyUnicode_1BYTE_KIND) {
+        for (i = 0; i < len; i++)
+            STORECHAR(PyUnicode_READ(kind, data, i));
+        return v;
     }
 
-    for (i = 0; i < len; i++)
-        STORECHAR(PyUnicode_READ(kind, data, i));
+    for (i = 0; i < len;) {
+        Py_ssize_t repsize, moreunits;
+        Py_UCS4 ch = PyUnicode_READ(kind, data, i);
+        i++;
+        assert(ch <= MAX_UNICODE);
+        if (!Py_UNICODE_IS_SURROGATE(ch)) {
+            STORECHAR(ch);
+            continue;
+        }
 
-  done:
+        rep = unicode_encode_call_errorhandler(
+                errors, &errorHandler,
+                encoding, "surrogates not allowed",
+                str, &exc, i-1, i, &i);
+
+        if (!rep)
+            goto error;
+
+        if (PyBytes_Check(rep)) {
+            repsize = PyBytes_GET_SIZE(rep);
+            if (repsize & 3) {
+                raise_encode_exception(&exc, encoding,
+                                       str, i - 1, i,
+                                       "surrogates not allowed");
+                goto error;
+            }
+            moreunits = repsize / 4;
+        }
+        else {
+            assert(PyUnicode_Check(rep));
+            if (PyUnicode_READY(rep) < 0)
+                goto error;
+            moreunits = repsize = PyUnicode_GET_LENGTH(rep);
+            if (!PyUnicode_IS_ASCII(rep)) {
+                raise_encode_exception(&exc, encoding,
+                                       str, i - 1, i,
+                                       "surrogates not allowed");
+                goto error;
+            }
+        }
+
+        /* four bytes are reserved for each surrogate */
+        if (moreunits > 1) {
+            Py_ssize_t outpos = p - (unsigned char*) PyBytes_AS_STRING(v);
+            Py_ssize_t morebytes = 4 * (moreunits - 1);
+            if (PyBytes_GET_SIZE(v) > PY_SSIZE_T_MAX - morebytes) {
+                /* integer overflow */
+                PyErr_NoMemory();
+                goto error;
+            }
+            if (_PyBytes_Resize(&v, PyBytes_GET_SIZE(v) + morebytes) < 0)
+                goto error;
+            p = (unsigned char*) PyBytes_AS_STRING(v) + outpos;
+        }
+
+        if (PyBytes_Check(rep)) {
+            Py_MEMCPY(p, PyBytes_AS_STRING(rep), repsize);
+            p += repsize;
+        } else /* rep is unicode */ {
+            const Py_UCS1 *repdata;
+            assert(PyUnicode_KIND(rep) == PyUnicode_1BYTE_KIND);
+            repdata = PyUnicode_1BYTE_DATA(rep);
+            while (repsize--) {
+                Py_UCS4 ch = *repdata++;
+                STORECHAR(ch);
+            }
+        }
+
+        Py_CLEAR(rep);
+    }
+
+    /* Cut back to size actually needed. This is necessary for, for example,
+       encoding of a string containing isolated surrogates and the 'ignore'
+       handler is used. */
+    nsize = p - (unsigned char*) PyBytes_AS_STRING(v);
+    if (nsize != PyBytes_GET_SIZE(v))
+      _PyBytes_Resize(&v, nsize);
+    Py_XDECREF(errorHandler);
+    Py_XDECREF(exc);
     return v;
+  error:
+    Py_XDECREF(rep);
+    Py_XDECREF(errorHandler);
+    Py_XDECREF(exc);
+    Py_XDECREF(v);
+    return NULL;
 #undef STORECHAR
 }
 
@@ -5241,14 +5310,14 @@
     const char *starts = s;
     Py_ssize_t startinpos;
     Py_ssize_t endinpos;
-    Py_ssize_t outpos;
-    PyObject *unicode;
+    _PyUnicodeWriter writer;
     const unsigned char *q, *e;
     int bo = 0;       /* assume native ordering by default */
     int native_ordering;
     const char *errmsg = "";
     PyObject *errorHandler = NULL;
     PyObject *exc = NULL;
+    const char *encoding;
 
     q = (unsigned char *)s;
     e = q + size;
@@ -5280,40 +5349,42 @@
         _Py_RETURN_UNICODE_EMPTY();
     }
 
-#ifdef BYTEORDER_IS_LITTLE_ENDIAN
+#if PY_LITTLE_ENDIAN
     native_ordering = bo <= 0;
+    encoding = bo <= 0 ? "utf-16-le" : "utf-16-be";
 #else
     native_ordering = bo >= 0;
+    encoding = bo >= 0 ? "utf-16-be" : "utf-16-le";
 #endif
 
     /* Note: size will always be longer than the resulting Unicode
        character count */
-    unicode = PyUnicode_New((e - q + 1) / 2, 127);
-    if (!unicode)
-        return NULL;
+    _PyUnicodeWriter_Init(&writer);
+    writer.min_length = (e - q + 1) / 2;
+    if (_PyUnicodeWriter_Prepare(&writer, writer.min_length, 127) == -1)
+        goto onError;
 
-    outpos = 0;
     while (1) {
         Py_UCS4 ch = 0;
         if (e - q >= 2) {
-            int kind = PyUnicode_KIND(unicode);
+            int kind = writer.kind;
             if (kind == PyUnicode_1BYTE_KIND) {
-                if (PyUnicode_IS_ASCII(unicode))
+                if (PyUnicode_IS_ASCII(writer.buffer))
                     ch = asciilib_utf16_decode(&q, e,
-                            PyUnicode_1BYTE_DATA(unicode), &outpos,
+                            (Py_UCS1*)writer.data, &writer.pos,
                             native_ordering);
                 else
                     ch = ucs1lib_utf16_decode(&q, e,
-                            PyUnicode_1BYTE_DATA(unicode), &outpos,
+                            (Py_UCS1*)writer.data, &writer.pos,
                             native_ordering);
             } else if (kind == PyUnicode_2BYTE_KIND) {
                 ch = ucs2lib_utf16_decode(&q, e,
-                        PyUnicode_2BYTE_DATA(unicode), &outpos,
+                        (Py_UCS2*)writer.data, &writer.pos,
                         native_ordering);
             } else {
                 assert(kind == PyUnicode_4BYTE_KIND);
                 ch = ucs4lib_utf16_decode(&q, e,
-                        PyUnicode_4BYTE_DATA(unicode), &outpos,
+                        (Py_UCS4*)writer.data, &writer.pos,
                         native_ordering);
             }
         }
@@ -5349,23 +5420,22 @@
             endinpos = startinpos + 2;
             break;
         default:
-            if (unicode_putchar(&unicode, &outpos, ch) < 0)
+            if (_PyUnicodeWriter_WriteCharInline(&writer, ch) < 0)
                 goto onError;
             continue;
         }
 
-        if (unicode_decode_call_errorhandler(
+        if (unicode_decode_call_errorhandler_writer(
                 errors,
                 &errorHandler,
-                "utf16", errmsg,
+                encoding, errmsg,
                 &starts,
                 (const char **)&e,
                 &startinpos,
                 &endinpos,
                 &exc,
                 (const char **)&q,
-                &unicode,
-                &outpos))
+                &writer))
             goto onError;
     }
 
@@ -5373,16 +5443,12 @@
     if (consumed)
         *consumed = (const char *)q-starts;
 
-    /* Adjust length */
-    if (unicode_resize(&unicode, outpos) < 0)
-        goto onError;
-
     Py_XDECREF(errorHandler);
     Py_XDECREF(exc);
-    return unicode_result(unicode);
+    return _PyUnicodeWriter_Finish(&writer);
 
   onError:
-    Py_DECREF(unicode);
+    _PyUnicodeWriter_Dealloc(&writer);
     Py_XDECREF(errorHandler);
     Py_XDECREF(exc);
     return NULL;
@@ -5398,13 +5464,17 @@
     Py_ssize_t len;
     PyObject *v;
     unsigned short *out;
-    Py_ssize_t bytesize;
     Py_ssize_t pairs;
-#ifdef WORDS_BIGENDIAN
+#if PY_BIG_ENDIAN
     int native_ordering = byteorder >= 0;
 #else
     int native_ordering = byteorder <= 0;
 #endif
+    const char *encoding;
+    Py_ssize_t nsize, pos;
+    PyObject *errorHandler = NULL;
+    PyObject *exc = NULL;
+    PyObject *rep = NULL;
 
     if (!PyUnicode_Check(str)) {
         PyErr_BadArgument();
@@ -5426,8 +5496,8 @@
     }
     if (len > PY_SSIZE_T_MAX / 2 - pairs - (byteorder == 0))
         return PyErr_NoMemory();
-    bytesize = (len + pairs + (byteorder == 0)) * 2;
-    v = PyBytes_FromStringAndSize(NULL, bytesize);
+    nsize = len + pairs + (byteorder == 0);
+    v = PyBytes_FromStringAndSize(NULL, nsize * 2);
     if (v == NULL)
         return NULL;
 
@@ -5439,25 +5509,107 @@
     if (len == 0)
         goto done;
 
-    switch (kind) {
-    case PyUnicode_1BYTE_KIND: {
-        ucs1lib_utf16_encode(out, (const Py_UCS1 *)data, len, native_ordering);
-        break;
-    }
-    case PyUnicode_2BYTE_KIND: {
-        ucs2lib_utf16_encode(out, (const Py_UCS2 *)data, len, native_ordering);
-        break;
-    }
-    case PyUnicode_4BYTE_KIND: {
-        ucs4lib_utf16_encode(out, (const Py_UCS4 *)data, len, native_ordering);
-        break;
-    }
-    default:
-        assert(0);
+    if (kind == PyUnicode_1BYTE_KIND) {
+        ucs1lib_utf16_encode((const Py_UCS1 *)data, len, &out, native_ordering);
+        goto done;
     }
 
+    if (byteorder < 0)
+        encoding = "utf-16-le";
+    else if (byteorder > 0)
+        encoding = "utf-16-be";
+    else
+        encoding = "utf-16";
+
+    pos = 0;
+    while (pos < len) {
+        Py_ssize_t repsize, moreunits;
+
+        if (kind == PyUnicode_2BYTE_KIND) {
+            pos += ucs2lib_utf16_encode((const Py_UCS2 *)data + pos, len - pos,
+                                        &out, native_ordering);
+        }
+        else {
+            assert(kind == PyUnicode_4BYTE_KIND);
+            pos += ucs4lib_utf16_encode((const Py_UCS4 *)data + pos, len - pos,
+                                        &out, native_ordering);
+        }
+        if (pos == len)
+            break;
+
+        rep = unicode_encode_call_errorhandler(
+                errors, &errorHandler,
+                encoding, "surrogates not allowed",
+                str, &exc, pos, pos + 1, &pos);
+        if (!rep)
+            goto error;
+
+        if (PyBytes_Check(rep)) {
+            repsize = PyBytes_GET_SIZE(rep);
+            if (repsize & 1) {
+                raise_encode_exception(&exc, encoding,
+                                       str, pos - 1, pos,
+                                       "surrogates not allowed");
+                goto error;
+            }
+            moreunits = repsize / 2;
+        }
+        else {
+            assert(PyUnicode_Check(rep));
+            if (PyUnicode_READY(rep) < 0)
+                goto error;
+            moreunits = repsize = PyUnicode_GET_LENGTH(rep);
+            if (!PyUnicode_IS_ASCII(rep)) {
+                raise_encode_exception(&exc, encoding,
+                                       str, pos - 1, pos,
+                                       "surrogates not allowed");
+                goto error;
+            }
+        }
+
+        /* two bytes are reserved for each surrogate */
+        if (moreunits > 1) {
+            Py_ssize_t outpos = out - (unsigned short*) PyBytes_AS_STRING(v);
+            Py_ssize_t morebytes = 2 * (moreunits - 1);
+            if (PyBytes_GET_SIZE(v) > PY_SSIZE_T_MAX - morebytes) {
+                /* integer overflow */
+                PyErr_NoMemory();
+                goto error;
+            }
+            if (_PyBytes_Resize(&v, PyBytes_GET_SIZE(v) + morebytes) < 0)
+                goto error;
+            out = (unsigned short*) PyBytes_AS_STRING(v) + outpos;
+        }
+
+        if (PyBytes_Check(rep)) {
+            Py_MEMCPY(out, PyBytes_AS_STRING(rep), repsize);
+            out += moreunits;
+        } else /* rep is unicode */ {
+            assert(PyUnicode_KIND(rep) == PyUnicode_1BYTE_KIND);
+            ucs1lib_utf16_encode(PyUnicode_1BYTE_DATA(rep), repsize,
+                                 &out, native_ordering);
+        }
+
+        Py_CLEAR(rep);
+    }
+
+    /* Cut back to size actually needed. This is necessary for, for example,
+    encoding of a string containing isolated surrogates and the 'ignore' handler
+    is used. */
+    nsize = (unsigned char*) out - (unsigned char*) PyBytes_AS_STRING(v);
+    if (nsize != PyBytes_GET_SIZE(v))
+      _PyBytes_Resize(&v, nsize);
+    Py_XDECREF(errorHandler);
+    Py_XDECREF(exc);
   done:
     return v;
+  error:
+    Py_XDECREF(rep);
+    Py_XDECREF(errorHandler);
+    Py_XDECREF(exc);
+    Py_XDECREF(v);
+    return NULL;
+#undef STORECHAR
 }
 
 PyObject *
@@ -5548,27 +5700,26 @@
     const char *starts = s;
     Py_ssize_t startinpos;
     Py_ssize_t endinpos;
-    PyObject *v;
+    _PyUnicodeWriter writer;
     const char *end;
     char* message;
     Py_UCS4 chr = 0xffffffff; /* in case 'getcode' messes up */
     PyObject *errorHandler = NULL;
     PyObject *exc = NULL;
     Py_ssize_t len;
-    Py_ssize_t i;
 
     len = length_of_escaped_ascii_string(s, size);
+    if (len == 0)
+        _Py_RETURN_UNICODE_EMPTY();
 
     /* After length_of_escaped_ascii_string() there are two alternatives,
        either the string is pure ASCII with named escapes like \n, etc.
        and we determined it's exact size (common case)
        or it contains \x, \u, ... escape sequences.  then we create a
        legacy wchar string and resize it at the end of this function. */
-    if (len >= 0) {
-        v = PyUnicode_New(len, 127);
-        if (!v)
-            goto onError;
-        assert(PyUnicode_KIND(v) == PyUnicode_1BYTE_KIND);
+    _PyUnicodeWriter_Init(&writer);
+    if (len > 0) {
+        writer.min_length = len;
     }
     else {
         /* Escaped strings will always be longer than the resulting
@@ -5576,15 +5727,11 @@
            length after conversion to the true value.
            (but if the error callback returns a long replacement string
            we'll have to allocate more space) */
-        v = PyUnicode_New(size, 127);
-        if (!v)
-            goto onError;
-        len = size;
+        writer.min_length = size;
     }
 
     if (size == 0)
-        return v;
-    i = 0;
+        return _PyUnicodeWriter_Finish(&writer);
     end = s + size;
 
     while (s < end) {
@@ -5592,13 +5739,11 @@
         Py_UCS4 x;
         int digits;
 
-        /* The only case in which i == ascii_length is a backslash
-           followed by a newline. */
-        assert(i <= len);
-
         /* Non-escape characters are interpreted as Unicode ordinals */
         if (*s != '\\') {
-            if (unicode_putchar(&v, &i, (unsigned char) *s++) < 0)
+            x = (unsigned char)*s;
+            s++;
+            if (_PyUnicodeWriter_WriteCharInline(&writer, x) < 0)
                 goto onError;
             continue;
         }
@@ -5610,18 +5755,14 @@
         if (s > end)
             c = '\0'; /* Invalid after \ */
 
-        /* The only case in which i == ascii_length is a backslash
-           followed by a newline. */
-        assert(i < len || (i == len && c == '\n'));
-
         switch (c) {
 
             /* \x escapes */
-#define WRITECHAR(ch)                                   \
-            do {                                        \
-                if (unicode_putchar(&v, &i, ch) < 0)    \
-                    goto onError;                       \
-            }while(0)
+#define WRITECHAR(ch)                                                      \
+            do {                                                           \
+                if (_PyUnicodeWriter_WriteCharInline(&writer, (ch)) < 0)    \
+                    goto onError;                                          \
+            } while(0)
 
         case '\n': break;
         case '\\': WRITECHAR('\\'); break;
@@ -5745,35 +5886,32 @@
 
       error:
         endinpos = s-starts;
-        if (unicode_decode_call_errorhandler(
+        if (unicode_decode_call_errorhandler_writer(
                 errors, &errorHandler,
                 "unicodeescape", message,
                 &starts, &end, &startinpos, &endinpos, &exc, &s,
-                &v, &i))
+                &writer))
             goto onError;
-        len = PyUnicode_GET_LENGTH(v);
         continue;
     }
 #undef WRITECHAR
 
-    if (unicode_resize(&v, i) < 0)
-        goto onError;
     Py_XDECREF(errorHandler);
     Py_XDECREF(exc);
-    return unicode_result(v);
+    return _PyUnicodeWriter_Finish(&writer);
 
   ucnhashError:
     PyErr_SetString(
         PyExc_UnicodeError,
         "\\N escapes not supported (can't load unicodedata module)"
         );
-    Py_XDECREF(v);
+    _PyUnicodeWriter_Dealloc(&writer);
     Py_XDECREF(errorHandler);
     Py_XDECREF(exc);
     return NULL;
 
   onError:
-    Py_XDECREF(v);
+    _PyUnicodeWriter_Dealloc(&writer);
     Py_XDECREF(errorHandler);
     Py_XDECREF(exc);
     return NULL;
@@ -5926,23 +6064,22 @@
     const char *starts = s;
     Py_ssize_t startinpos;
     Py_ssize_t endinpos;
-    Py_ssize_t outpos;
-    PyObject *v;
+    _PyUnicodeWriter writer;
     const char *end;
     const char *bs;
     PyObject *errorHandler = NULL;
     PyObject *exc = NULL;
 
+    if (size == 0)
+        _Py_RETURN_UNICODE_EMPTY();
+
     /* Escaped strings will always be longer than the resulting
        Unicode string, so we start with size here and then reduce the
        length after conversion to the true value. (But decoding error
        handler might have to resize the string) */
-    v = PyUnicode_New(size, 127);
-    if (v == NULL)
-        goto onError;
-    if (size == 0)
-        return v;
-    outpos = 0;
+    _PyUnicodeWriter_Init(&writer);
+    writer.min_length = size;
+
     end = s + size;
     while (s < end) {
         unsigned char c;
@@ -5952,7 +6089,8 @@
 
         /* Non-escape characters are interpreted as Unicode ordinals */
         if (*s != '\\') {
-            if (unicode_putchar(&v, &outpos, (unsigned char)*s++) < 0)
+            x = (unsigned char)*s++;
+            if (_PyUnicodeWriter_WriteCharInline(&writer, x) < 0)
                 goto onError;
             continue;
         }
@@ -5964,7 +6102,8 @@
         for (;s < end;) {
             if (*s != '\\')
                 break;
-            if (unicode_putchar(&v, &outpos, (unsigned char)*s++) < 0)
+            x = (unsigned char)*s++;
+            if (_PyUnicodeWriter_WriteCharInline(&writer, x) < 0)
                 goto onError;
         }
         if (((s - bs) & 1) == 0 ||
@@ -5972,7 +6111,7 @@
             (*s != 'u' && *s != 'U')) {
             continue;
         }
-        outpos--;
+        writer.pos--;
         count = *s=='u' ? 4 : 8;
         s++;
 
@@ -5981,11 +6120,11 @@
             c = (unsigned char)*s;
             if (!Py_ISXDIGIT(c)) {
                 endinpos = s-starts;
-                if (unicode_decode_call_errorhandler(
+                if (unicode_decode_call_errorhandler_writer(
                         errors, &errorHandler,
                         "rawunicodeescape", "truncated \\uXXXX",
                         &starts, &end, &startinpos, &endinpos, &exc, &s,
-                        &v, &outpos))
+                        &writer))
                     goto onError;
                 goto nextByte;
             }
@@ -5998,28 +6137,27 @@
                 x += 10 + c - 'A';
         }
         if (x <= MAX_UNICODE) {
-            if (unicode_putchar(&v, &outpos, x) < 0)
+            if (_PyUnicodeWriter_WriteCharInline(&writer, x) < 0)
                 goto onError;
-        } else {
+        }
+        else {
             endinpos = s-starts;
-            if (unicode_decode_call_errorhandler(
+            if (unicode_decode_call_errorhandler_writer(
                     errors, &errorHandler,
                     "rawunicodeescape", "\\Uxxxxxxxx out of range",
                     &starts, &end, &startinpos, &endinpos, &exc, &s,
-                    &v, &outpos))
+                    &writer))
                 goto onError;
         }
       nextByte:
         ;
     }
-    if (unicode_resize(&v, outpos) < 0)
-        goto onError;
     Py_XDECREF(errorHandler);
     Py_XDECREF(exc);
-    return unicode_result(v);
+    return _PyUnicodeWriter_Finish(&writer);
 
   onError:
-    Py_XDECREF(v);
+    _PyUnicodeWriter_Dealloc(&writer);
     Py_XDECREF(errorHandler);
     Py_XDECREF(exc);
     return NULL;
@@ -6119,8 +6257,7 @@
     const char *starts = s;
     Py_ssize_t startinpos;
     Py_ssize_t endinpos;
-    Py_ssize_t outpos;
-    PyObject *v;
+    _PyUnicodeWriter writer;
     const char *end;
     const char *reason;
     PyObject *errorHandler = NULL;
@@ -6131,15 +6268,17 @@
                      1))
         return NULL;
 
-    /* XXX overflow detection missing */
-    v = PyUnicode_New((size+Py_UNICODE_SIZE-1)/ Py_UNICODE_SIZE, 127);
-    if (v == NULL)
-        goto onError;
-    if (PyUnicode_GET_LENGTH(v) == 0)
-        return v;
-    outpos = 0;
-    end = s + size;
+    if (size == 0)
+        _Py_RETURN_UNICODE_EMPTY();
 
+    _PyUnicodeWriter_Init(&writer);
+    if (size / Py_UNICODE_SIZE > PY_SSIZE_T_MAX - 1) {
+        PyErr_NoMemory();
+        goto onError;
+    }
+    writer.min_length = (size + (Py_UNICODE_SIZE - 1)) / Py_UNICODE_SIZE;
+
+    end = s + size;
     while (s < end) {
         Py_UNICODE uch;
         Py_UCS4 ch;
@@ -6181,28 +6320,26 @@
         }
 #endif
 
-        if (unicode_putchar(&v, &outpos, ch) < 0)
+        if (_PyUnicodeWriter_WriteCharInline(&writer, ch) < 0)
             goto onError;
         continue;
 
   error:
         startinpos = s - starts;
-        if (unicode_decode_call_errorhandler(
+        if (unicode_decode_call_errorhandler_writer(
                 errors, &errorHandler,
                 "unicode_internal", reason,
                 &starts, &end, &startinpos, &endinpos, &exc, &s,
-                &v, &outpos))
+                &writer))
             goto onError;
     }
 
-    if (unicode_resize(&v, outpos) < 0)
-        goto onError;
     Py_XDECREF(errorHandler);
     Py_XDECREF(exc);
-    return unicode_result(v);
+    return _PyUnicodeWriter_Finish(&writer);
 
   onError:
-    Py_XDECREF(v);
+    _PyUnicodeWriter_Dealloc(&writer);
     Py_XDECREF(errorHandler);
     Py_XDECREF(exc);
     return NULL;
@@ -6586,7 +6723,7 @@
                       const char *errors)
 {
     const char *starts = s;
-    PyObject *unicode;
+    _PyUnicodeWriter writer;
     int kind;
     void *data;
     Py_ssize_t startinpos;
@@ -6603,46 +6740,46 @@
     if (size == 1 && (unsigned char)s[0] < 128)
         return get_latin1_char((unsigned char)s[0]);
 
-    unicode = PyUnicode_New(size, 127);
-    if (unicode == NULL)
-        goto onError;
+    _PyUnicodeWriter_Init(&writer);
+    writer.min_length = size;
+    if (_PyUnicodeWriter_Prepare(&writer, writer.min_length, 127) < 0)
+        return NULL;
 
     e = s + size;
-    data = PyUnicode_1BYTE_DATA(unicode);
+    data = writer.data;
     outpos = ascii_decode(s, e, (Py_UCS1 *)data);
-    if (outpos == size)
-        return unicode;
+    writer.pos = outpos;
+    if (writer.pos == size)
+        return _PyUnicodeWriter_Finish(&writer);
 
-    s += outpos;
-    kind = PyUnicode_1BYTE_KIND;
+    s += writer.pos;
+    kind = writer.kind;
     while (s < e) {
-        register unsigned char c = (unsigned char)*s;
+        unsigned char c = (unsigned char)*s;
         if (c < 128) {
-            PyUnicode_WRITE(kind, data, outpos++, c);
+            PyUnicode_WRITE(kind, data, writer.pos, c);
+            writer.pos++;
             ++s;
         }
         else {
             startinpos = s-starts;
             endinpos = startinpos + 1;
-            if (unicode_decode_call_errorhandler(
+            if (unicode_decode_call_errorhandler_writer(
                     errors, &errorHandler,
                     "ascii", "ordinal not in range(128)",
                     &starts, &e, &startinpos, &endinpos, &exc, &s,
-                    &unicode, &outpos))
+                    &writer))
                 goto onError;
-            kind = PyUnicode_KIND(unicode);
-            data = PyUnicode_DATA(unicode);
+            kind = writer.kind;
+            data = writer.data;
         }
     }
-    if (unicode_resize(&unicode, outpos) < 0)
-        goto onError;
     Py_XDECREF(errorHandler);
     Py_XDECREF(exc);
-    assert(_PyUnicode_CheckConsistency(unicode, 1));
-    return unicode;
+    return _PyUnicodeWriter_Finish(&writer);
 
   onError:
-    Py_XDECREF(unicode);
+    _PyUnicodeWriter_Dealloc(&writer);
     Py_XDECREF(errorHandler);
     Py_XDECREF(exc);
     return NULL;
@@ -6674,7 +6811,7 @@
         return NULL;
     /* Fast path: if it is an ASCII-only string, construct bytes object
        directly. Else defer to above function to raise the exception. */
-    if (PyUnicode_MAX_CHAR_VALUE(unicode) < 128)
+    if (PyUnicode_IS_ASCII(unicode))
         return PyBytes_FromStringAndSize(PyUnicode_DATA(unicode),
                                          PyUnicode_GET_LENGTH(unicode));
     return unicode_encode_ucs1(unicode, errors, 128);
@@ -6752,8 +6889,8 @@
  * Decode a byte string from a Windows code page into unicode object in strict
  * mode.
  *
- * Returns consumed size if succeed, returns -2 on decode error, or raise a
- * WindowsError and returns -1 on other error.
+ * Returns consumed size if succeed, returns -2 on decode error, or raise an
+ * OSError and returns -1 on other error.
  */
 static int
 decode_code_page_strict(UINT code_page,
@@ -6804,7 +6941,7 @@
  * Decode a byte string from a code page into unicode object with an error
  * handler.
  *
- * Returns consumed size if succeed, or raise a WindowsError or
+ * Returns consumed size if succeed, or raise an OSError or
  * UnicodeDecodeError exception and returns -1 on error.
  */
 static int
@@ -6823,7 +6960,8 @@
     /* each step cannot decode more than 1 character, but a character can be
        represented as a surrogate pair */
     wchar_t buffer[2], *startout, *out;
-    int insize, outsize;
+    int insize;
+    Py_ssize_t outsize;
     PyObject *errorHandler = NULL;
     PyObject *exc = NULL;
     PyObject *encoding_obj = NULL;
@@ -6903,7 +7041,7 @@
             startinpos = in - startin;
             endinpos = startinpos + 1;
             outpos = out - PyUnicode_AS_UNICODE(*v);
-            if (unicode_decode_call_errorhandler(
+            if (unicode_decode_call_errorhandler_wchar(
                     errors, &errorHandler,
                     encoding, reason,
                     &startin, &endin, &startinpos, &endinpos, &exc, &in,
@@ -7059,7 +7197,7 @@
  * mode.
  *
  * Returns consumed characters if succeed, returns -2 on encode error, or raise
- * a WindowsError and returns -1 on other error.
+ * an OSError and returns -1 on other error.
  */
 static int
 encode_code_page_strict(UINT code_page, PyObject **outbytes,
@@ -7093,10 +7231,11 @@
         Py_DECREF(substring);
         return -1;
     }
+    assert(size <= INT_MAX);
 
     /* First get the size of the result */
     outsize = WideCharToMultiByte(code_page, flags,
-                                  p, size,
+                                  p, (int)size,
                                   NULL, 0,
                                   NULL, pusedDefaultChar);
     if (outsize <= 0)
@@ -7133,7 +7272,7 @@
 
     /* Do the conversion */
     outsize = WideCharToMultiByte(code_page, flags,
-                                  p, size,
+                                  p, (int)size,
                                   out, outsize,
                                   NULL, pusedDefaultChar);
     Py_CLEAR(substring);
@@ -7155,7 +7294,7 @@
  * Encode a Unicode string to a Windows code page into a byte string using a
  * error handler.
  *
- * Returns consumed characters if succeed, or raise a WindowsError and returns
+ * Returns consumed characters if succeed, or raise an OSError and returns
  * -1 on other error.
  */
 static int
@@ -7241,9 +7380,8 @@
             charsize = 1;
         }
         else {
-            ch -= 0x10000;
-            chars[0] = 0xd800 + (ch >> 10);
-            chars[1] = 0xdc00 + (ch & 0x3ff);
+            chars[0] = Py_UNICODE_HIGH_SURROGATE(ch);
+            chars[1] = Py_UNICODE_LOW_SURROGATE(ch);
             charsize = 2;
         }
 
@@ -7436,220 +7574,258 @@
 
 /* --- Character Mapping Codec -------------------------------------------- */
 
+static int
+charmap_decode_string(const char *s,
+                      Py_ssize_t size,
+                      PyObject *mapping,
+                      const char *errors,
+                      _PyUnicodeWriter *writer)
+{
+    const char *starts = s;
+    const char *e;
+    Py_ssize_t startinpos, endinpos;
+    PyObject *errorHandler = NULL, *exc = NULL;
+    Py_ssize_t maplen;
+    enum PyUnicode_Kind mapkind;
+    void *mapdata;
+    Py_UCS4 x;
+    unsigned char ch;
+
+    if (PyUnicode_READY(mapping) == -1)
+        return -1;
+
+    maplen = PyUnicode_GET_LENGTH(mapping);
+    mapdata = PyUnicode_DATA(mapping);
+    mapkind = PyUnicode_KIND(mapping);
+
+    e = s + size;
+
+    if (mapkind == PyUnicode_1BYTE_KIND && maplen >= 256) {
+        /* fast-path for cp037, cp500 and iso8859_1 encodings. iso8859_1
+         * is disabled in encoding aliases, latin1 is preferred because
+         * its implementation is faster. */
+        Py_UCS1 *mapdata_ucs1 = (Py_UCS1 *)mapdata;
+        Py_UCS1 *outdata = (Py_UCS1 *)writer->data;
+        Py_UCS4 maxchar = writer->maxchar;
+
+        assert (writer->kind == PyUnicode_1BYTE_KIND);
+        while (s < e) {
+            ch = *s;
+            x = mapdata_ucs1[ch];
+            if (x > maxchar) {
+                if (_PyUnicodeWriter_Prepare(writer, 1, 0xff) == -1)
+                    goto onError;
+                maxchar = writer->maxchar;
+                outdata = (Py_UCS1 *)writer->data;
+            }
+            outdata[writer->pos] = x;
+            writer->pos++;
+            ++s;
+        }
+        return 0;
+    }
+
+    while (s < e) {
+        if (mapkind == PyUnicode_2BYTE_KIND && maplen >= 256) {
+            enum PyUnicode_Kind outkind = writer->kind;
+            Py_UCS2 *mapdata_ucs2 = (Py_UCS2 *)mapdata;
+            if (outkind == PyUnicode_1BYTE_KIND) {
+                Py_UCS1 *outdata = (Py_UCS1 *)writer->data;
+                Py_UCS4 maxchar = writer->maxchar;
+                while (s < e) {
+                    ch = *s;
+                    x = mapdata_ucs2[ch];
+                    if (x > maxchar)
+                        goto Error;
+                    outdata[writer->pos] = x;
+                    writer->pos++;
+                    ++s;
+                }
+                break;
+            }
+            else if (outkind == PyUnicode_2BYTE_KIND) {
+                Py_UCS2 *outdata = (Py_UCS2 *)writer->data;
+                while (s < e) {
+                    ch = *s;
+                    x = mapdata_ucs2[ch];
+                    if (x == 0xFFFE)
+                        goto Error;
+                    outdata[writer->pos] = x;
+                    writer->pos++;
+                    ++s;
+                }
+                break;
+            }
+        }
+        ch = *s;
+
+        if (ch < maplen)
+            x = PyUnicode_READ(mapkind, mapdata, ch);
+        else
+            x = 0xfffe; /* invalid value */
+Error:
+        if (x == 0xfffe)
+        {
+            /* undefined mapping */
+            startinpos = s-starts;
+            endinpos = startinpos+1;
+            if (unicode_decode_call_errorhandler_writer(
+                    errors, &errorHandler,
+                    "charmap", "character maps to <undefined>",
+                    &starts, &e, &startinpos, &endinpos, &exc, &s,
+                    writer)) {
+                goto onError;
+            }
+            continue;
+        }
+
+        if (_PyUnicodeWriter_WriteCharInline(writer, x) < 0)
+            goto onError;
+        ++s;
+    }
+    Py_XDECREF(errorHandler);
+    Py_XDECREF(exc);
+    return 0;
+
+onError:
+    Py_XDECREF(errorHandler);
+    Py_XDECREF(exc);
+    return -1;
+}
+
+static int
+charmap_decode_mapping(const char *s,
+                       Py_ssize_t size,
+                       PyObject *mapping,
+                       const char *errors,
+                       _PyUnicodeWriter *writer)
+{
+    const char *starts = s;
+    const char *e;
+    Py_ssize_t startinpos, endinpos;
+    PyObject *errorHandler = NULL, *exc = NULL;
+    unsigned char ch;
+    PyObject *key, *item = NULL;
+
+    e = s + size;
+
+    while (s < e) {
+        ch = *s;
+
+        /* Get mapping (char ordinal -> integer, Unicode char or None) */
+        key = PyLong_FromLong((long)ch);
+        if (key == NULL)
+            goto onError;
+
+        item = PyObject_GetItem(mapping, key);
+        Py_DECREF(key);
+        if (item == NULL) {
+            if (PyErr_ExceptionMatches(PyExc_LookupError)) {
+                /* No mapping found means: mapping is undefined. */
+                PyErr_Clear();
+                goto Undefined;
+            } else
+                goto onError;
+        }
+
+        /* Apply mapping */
+        if (item == Py_None)
+            goto Undefined;
+        if (PyLong_Check(item)) {
+            long value = PyLong_AS_LONG(item);
+            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);
+                goto onError;
+            }
+
+            if (_PyUnicodeWriter_WriteCharInline(writer, value) < 0)
+                goto onError;
+        }
+        else if (PyUnicode_Check(item)) {
+            if (PyUnicode_READY(item) == -1)
+                goto onError;
+            if (PyUnicode_GET_LENGTH(item) == 1) {
+                Py_UCS4 value = PyUnicode_READ_CHAR(item, 0);
+                if (value == 0xFFFE)
+                    goto Undefined;
+                if (_PyUnicodeWriter_WriteCharInline(writer, value) < 0)
+                    goto onError;
+            }
+            else {
+                writer->overallocate = 1;
+                if (_PyUnicodeWriter_WriteStr(writer, item) == -1)
+                    goto onError;
+            }
+        }
+        else {
+            /* wrong return value */
+            PyErr_SetString(PyExc_TypeError,
+                            "character mapping must return integer, None or str");
+            goto onError;
+        }
+        Py_CLEAR(item);
+        ++s;
+        continue;
+
+Undefined:
+        /* undefined mapping */
+        Py_CLEAR(item);
+        startinpos = s-starts;
+        endinpos = startinpos+1;
+        if (unicode_decode_call_errorhandler_writer(
+                errors, &errorHandler,
+                "charmap", "character maps to <undefined>",
+                &starts, &e, &startinpos, &endinpos, &exc, &s,
+                writer)) {
+            goto onError;
+        }
+    }
+    Py_XDECREF(errorHandler);
+    Py_XDECREF(exc);
+    return 0;
+
+onError:
+    Py_XDECREF(item);
+    Py_XDECREF(errorHandler);
+    Py_XDECREF(exc);
+    return -1;
+}
+
 PyObject *
 PyUnicode_DecodeCharmap(const char *s,
                         Py_ssize_t size,
                         PyObject *mapping,
                         const char *errors)
 {
-    const char *starts = s;
-    Py_ssize_t startinpos;
-    Py_ssize_t endinpos;
-    Py_ssize_t outpos;
-    const char *e;
-    PyObject *v;
-    Py_ssize_t extrachars = 0;
-    PyObject *errorHandler = NULL;
-    PyObject *exc = NULL;
+    _PyUnicodeWriter writer;
 
     /* Default to Latin-1 */
     if (mapping == NULL)
         return PyUnicode_DecodeLatin1(s, size, errors);
 
-    v = PyUnicode_New(size, 127);
-    if (v == NULL)
-        goto onError;
     if (size == 0)
-        return v;
-    outpos = 0;
-    e = s + size;
+        _Py_RETURN_UNICODE_EMPTY();
+    _PyUnicodeWriter_Init(&writer);
+    writer.min_length = size;
+    if (_PyUnicodeWriter_Prepare(&writer, writer.min_length, 127) == -1)
+        goto onError;
+
     if (PyUnicode_CheckExact(mapping)) {
-        Py_ssize_t maplen;
-        enum PyUnicode_Kind mapkind;
-        void *mapdata;
-        Py_UCS4 x;
-
-        if (PyUnicode_READY(mapping) == -1)
-            return NULL;
-
-        maplen = PyUnicode_GET_LENGTH(mapping);
-        mapdata = PyUnicode_DATA(mapping);
-        mapkind = PyUnicode_KIND(mapping);
-        while (s < e) {
-            unsigned char ch;
-            if (mapkind == PyUnicode_2BYTE_KIND && maplen >= 256) {
-                enum PyUnicode_Kind outkind = PyUnicode_KIND(v);
-                if (outkind == PyUnicode_1BYTE_KIND) {
-                    void *outdata = PyUnicode_DATA(v);
-                    Py_UCS4 maxchar = PyUnicode_MAX_CHAR_VALUE(v);
-                    while (s < e) {
-                        unsigned char ch = *s;
-                        x = PyUnicode_READ(PyUnicode_2BYTE_KIND, mapdata, ch);
-                        if (x > maxchar)
-                            goto Error;
-                        PyUnicode_WRITE(PyUnicode_1BYTE_KIND, outdata, outpos++, x);
-                        ++s;
-                    }
-                    break;
-                }
-                else if (outkind == PyUnicode_2BYTE_KIND) {
-                    void *outdata = PyUnicode_DATA(v);
-                    while (s < e) {
-                        unsigned char ch = *s;
-                        x = PyUnicode_READ(PyUnicode_2BYTE_KIND, mapdata, ch);
-                        if (x == 0xFFFE)
-                            goto Error;
-                        PyUnicode_WRITE(PyUnicode_2BYTE_KIND, outdata, outpos++, x);
-                        ++s;
-                    }
-                    break;
-                }
-            }
-            ch = *s;
-
-            if (ch < maplen)
-                x = PyUnicode_READ(mapkind, mapdata, ch);
-            else
-                x = 0xfffe; /* invalid value */
-Error:
-            if (x == 0xfffe)
-            {
-                /* 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)) {
-                    goto onError;
-                }
-                continue;
-            }
-
-            if (unicode_putchar(&v, &outpos, x) < 0)
-                goto onError;
-            ++s;
-        }
+        if (charmap_decode_string(s, size, mapping, errors, &writer) < 0)
+            goto onError;
     }
     else {
-        while (s < e) {
-            unsigned char ch = *s;
-            PyObject *w, *x;
-
-            /* Get mapping (char ordinal -> integer, Unicode char or None) */
-            w = PyLong_FromLong((long)ch);
-            if (w == NULL)
-                goto onError;
-            x = PyObject_GetItem(mapping, w);
-            Py_DECREF(w);
-            if (x == NULL) {
-                if (PyErr_ExceptionMatches(PyExc_LookupError)) {
-                    /* No mapping found means: mapping is undefined. */
-                    PyErr_Clear();
-                    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 == 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) {
-                    Py_DECREF(x);
-                    goto onError;
-                }
-            }
-            else if (PyUnicode_Check(x)) {
-                Py_ssize_t targetsize;
-
-                if (PyUnicode_READY(x) == -1) {
-                    Py_DECREF(x);
-                    goto onError;
-                }
-                targetsize = PyUnicode_GET_LENGTH(x);
-
-                if (targetsize == 1) {
-                    /* 1-1 mapping */
-                    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 */
-                    if (targetsize > extrachars) {
-                        /* resize first */
-                        Py_ssize_t needed = (targetsize - extrachars) + \
-                            (targetsize << 2);
-                        extrachars += needed;
-                        /* XXX overflow detection missing */
-                        if (unicode_resize(&v,
-                                           PyUnicode_GET_LENGTH(v) + needed) < 0)
-                        {
-                            Py_DECREF(x);
-                            goto onError;
-                        }
-                    }
-                    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;
-                }
-                /* 1-0 mapping: skip the character */
-            }
-            else {
-                /* wrong return value */
-                PyErr_SetString(PyExc_TypeError,
-                                "character mapping must return integer, None or str");
-                Py_DECREF(x);
-                goto onError;
-            }
-            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 (charmap_decode_mapping(s, size, mapping, errors, &writer) < 0)
+            goto onError;
     }
-    if (unicode_resize(&v, outpos) < 0)
-        goto onError;
-    Py_XDECREF(errorHandler);
-    Py_XDECREF(exc);
-    return unicode_result(v);
+    return _PyUnicodeWriter_Finish(&writer);
 
   onError:
-    Py_XDECREF(errorHandler);
-    Py_XDECREF(exc);
-    Py_XDECREF(v);
+    _PyUnicodeWriter_Dealloc(&writer);
     return NULL;
 }
 
@@ -8163,10 +8339,14 @@
      * -1=not initialized, 0=unknown, 1=strict, 2=replace,
      * 3=ignore, 4=xmlcharrefreplace */
     int known_errorHandler = -1;
+    void *data;
+    int kind;
 
     if (PyUnicode_READY(unicode) == -1)
         return NULL;
     size = PyUnicode_GET_LENGTH(unicode);
+    data = PyUnicode_DATA(unicode);
+    kind = PyUnicode_KIND(unicode);
 
     /* Default to Latin-1 */
     if (mapping == NULL)
@@ -8181,7 +8361,7 @@
         return res;
 
     while (inpos<size) {
-        Py_UCS4 ch = PyUnicode_READ_CHAR(unicode, inpos);
+        Py_UCS4 ch = PyUnicode_READ(kind, data, inpos);
         /* try to encode it */
         charmapencode_result x = charmapencode_output(ch, mapping, &res, &respos);
         if (x==enc_EXCEPTION) /* error */
@@ -8266,19 +8446,6 @@
     }
 }
 
-/* raises a UnicodeTranslateError */
-static void
-raise_translate_exception(PyObject **exceptionObject,
-                          PyObject *unicode,
-                          Py_ssize_t startpos, Py_ssize_t endpos,
-                          const char *reason)
-{
-    make_translate_exception(exceptionObject,
-                             unicode, startpos, endpos, reason);
-    if (*exceptionObject != NULL)
-        PyCodec_StrictErrors(*exceptionObject);
-}
-
 /* error handling callback helper:
    build arguments, call the callback and check the arguments,
    put the result into newpos and return the replacement string, which
@@ -8554,8 +8721,10 @@
             }
             switch (known_errorHandler) {
             case 1: /* strict */
-                raise_translate_exception(&exc, input, collstart,
-                                          collend, reason);
+                make_translate_exception(&exc,
+                                         input, collstart, collend, reason);
+                if (exc != NULL)
+                    PyCodec_StrictErrors(exc);
                 goto onError;
             case 2: /* replace */
                 /* No need to check for space, this is a 1:1 replacement */
@@ -9147,7 +9316,7 @@
 
     if (PyUnicode_READY(self) == -1 ||
         PyUnicode_READY(substring) == -1)
-        return 0;
+        return -1;
 
     if (PyUnicode_GET_LENGTH(substring) == 0)
         return 1;
@@ -9185,7 +9354,6 @@
             /* 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 */
             for (i = 1; i < end_sub; ++i) {
                 if (PyUnicode_READ(kind_self, data_self, offset + i) !=
                     PyUnicode_READ(kind_sub, data_sub, i))
@@ -9651,41 +9819,49 @@
             sep_data = PyUnicode_1BYTE_DATA(sep);
     }
 #endif
-    for (i = 0, res_offset = 0; i < seqlen; ++i) {
-        Py_ssize_t itemlen;
-        item = items[i];
-        /* Copy item, and maybe the separator. */
-        if (i && seplen != 0) {
-            if (use_memcpy) {
+    if (use_memcpy) {
+        for (i = 0; i < seqlen; ++i) {
+            Py_ssize_t itemlen;
+            item = items[i];
+
+            /* Copy item, and maybe the separator. */
+            if (i && seplen != 0) {
                 Py_MEMCPY(res_data,
                           sep_data,
                           kind * seplen);
                 res_data += kind * seplen;
             }
-            else {
-                _PyUnicode_FastCopyCharacters(res, res_offset, sep, 0, seplen);
-                res_offset += seplen;
-            }
-        }
-        itemlen = PyUnicode_GET_LENGTH(item);
-        if (itemlen != 0) {
-            if (use_memcpy) {
+
+            itemlen = PyUnicode_GET_LENGTH(item);
+            if (itemlen != 0) {
                 Py_MEMCPY(res_data,
                           PyUnicode_DATA(item),
                           kind * itemlen);
                 res_data += kind * itemlen;
             }
-            else {
+        }
+        assert(res_data == PyUnicode_1BYTE_DATA(res)
+                           + kind * PyUnicode_GET_LENGTH(res));
+    }
+    else {
+        for (i = 0, res_offset = 0; i < seqlen; ++i) {
+            Py_ssize_t itemlen;
+            item = items[i];
+
+            /* Copy item, and maybe the separator. */
+            if (i && seplen != 0) {
+                _PyUnicode_FastCopyCharacters(res, res_offset, sep, 0, seplen);
+                res_offset += seplen;
+            }
+
+            itemlen = PyUnicode_GET_LENGTH(item);
+            if (itemlen != 0) {
                 _PyUnicode_FastCopyCharacters(res, res_offset, item, 0, itemlen);
                 res_offset += itemlen;
             }
         }
-    }
-    if (use_memcpy)
-        assert(res_data == PyUnicode_1BYTE_DATA(res)
-                           + kind * PyUnicode_GET_LENGTH(res));
-    else
         assert(res_offset == PyUnicode_GET_LENGTH(res));
+    }
 
     Py_DECREF(fseq);
     Py_XDECREF(sep);
@@ -9718,8 +9894,8 @@
             Py_UCS4 * to_ = (Py_UCS4 *)((data)) + (start); \
             for (; i_ < (length); ++i_, ++to_) *to_ = (value); \
             break; \
-        default: assert(0); \
         } \
+        default: assert(0); \
         } \
     } while (0)
 
@@ -10077,6 +10253,31 @@
     return 0;
 }
 
+static void
+replace_1char_inplace(PyObject *u, Py_ssize_t pos,
+                      Py_UCS4 u1, Py_UCS4 u2, Py_ssize_t maxcount)
+{
+    int kind = PyUnicode_KIND(u);
+    void *data = PyUnicode_DATA(u);
+    Py_ssize_t len = PyUnicode_GET_LENGTH(u);
+    if (kind == PyUnicode_1BYTE_KIND) {
+        ucs1lib_replace_1char_inplace((Py_UCS1 *)data + pos,
+                                      (Py_UCS1 *)data + len,
+                                      u1, u2, maxcount);
+    }
+    else if (kind == PyUnicode_2BYTE_KIND) {
+        ucs2lib_replace_1char_inplace((Py_UCS2 *)data + pos,
+                                      (Py_UCS2 *)data + len,
+                                      u1, u2, maxcount);
+    }
+    else {
+        assert(kind == PyUnicode_4BYTE_KIND);
+        ucs4lib_replace_1char_inplace((Py_UCS4 *)data + pos,
+                                      (Py_UCS4 *)data + len,
+                                      u1, u2, maxcount);
+    }
+}
+
 static PyObject *
 replace(PyObject *self, PyObject *str1,
         PyObject *str2, Py_ssize_t maxcount)
@@ -10093,7 +10294,7 @@
     Py_ssize_t len1 = PyUnicode_GET_LENGTH(str1);
     Py_ssize_t len2 = PyUnicode_GET_LENGTH(str2);
     int mayshrink;
-    Py_UCS4 maxchar, maxchar_str2;
+    Py_UCS4 maxchar, maxchar_str1, maxchar_str2;
 
     if (maxcount < 0)
         maxcount = PY_SSIZE_T_MAX;
@@ -10102,15 +10303,16 @@
 
     if (str1 == str2)
         goto nothing;
-    if (skind < kind1)
-        /* substring too wide to be present */
-        goto nothing;
 
     maxchar = PyUnicode_MAX_CHAR_VALUE(self);
+    maxchar_str1 = PyUnicode_MAX_CHAR_VALUE(str1);
+    if (maxchar < maxchar_str1)
+        /* substring too wide to be present */
+        goto nothing;
     maxchar_str2 = PyUnicode_MAX_CHAR_VALUE(str2);
     /* Replacing str1 with str2 may cause a maxchar reduction in the
        result string. */
-    mayshrink = (maxchar_str2 < maxchar);
+    mayshrink = (maxchar_str2 < maxchar_str1) && (maxchar == maxchar_str1);
     maxchar = Py_MAX(maxchar, maxchar_str2);
 
     if (len1 == len2) {
@@ -10120,35 +10322,19 @@
         if (len1 == 1) {
             /* replace characters */
             Py_UCS4 u1, u2;
-            int rkind;
-            Py_ssize_t index, pos;
-            char *src;
+            Py_ssize_t pos;
 
-            u1 = PyUnicode_READ_CHAR(str1, 0);
-            pos = findchar(sbuf, PyUnicode_KIND(self), slen, u1, 1);
+            u1 = PyUnicode_READ(kind1, buf1, 0);
+            pos = findchar(sbuf, skind, slen, u1, 1);
             if (pos < 0)
                 goto nothing;
-            u2 = PyUnicode_READ_CHAR(str2, 0);
+            u2 = PyUnicode_READ(kind2, buf2, 0);
             u = PyUnicode_New(slen, maxchar);
             if (!u)
                 goto error;
-            _PyUnicode_FastCopyCharacters(u, 0, self, 0, slen);
-            rkind = PyUnicode_KIND(u);
 
-            PyUnicode_WRITE(rkind, PyUnicode_DATA(u), pos, u2);
-            index = 0;
-            src = sbuf;
-            while (--maxcount)
-            {
-                pos++;
-                src += pos * PyUnicode_KIND(self);
-                slen -= pos;
-                index += pos;
-                pos = findchar(src, PyUnicode_KIND(self), slen, u1, 1);
-                if (pos < 0)
-                    break;
-                PyUnicode_WRITE(rkind, PyUnicode_DATA(u), index + pos, u2);
-            }
+            _PyUnicode_FastCopyCharacters(u, 0, self, 0, slen);
+            replace_1char_inplace(u, pos, u1, u2, maxcount);
         }
         else {
             int rkind = skind;
@@ -10460,9 +10646,24 @@
 static int
 unicode_compare(PyObject *str1, PyObject *str2)
 {
+#define COMPARE(TYPE1, TYPE2) \
+    do { \
+        TYPE1* p1 = (TYPE1 *)data1; \
+        TYPE2* p2 = (TYPE2 *)data2; \
+        TYPE1* end = p1 + len; \
+        Py_UCS4 c1, c2; \
+        for (; p1 != end; p1++, p2++) { \
+            c1 = *p1; \
+            c2 = *p2; \
+            if (c1 != c2) \
+                return (c1 < c2) ? -1 : 1; \
+        } \
+    } \
+    while (0)
+
     int kind1, kind2;
     void *data1, *data2;
-    Py_ssize_t len1, len2, i;
+    Py_ssize_t len1, len2, len;
 
     kind1 = PyUnicode_KIND(str1);
     kind2 = PyUnicode_KIND(str2);
@@ -10470,19 +10671,116 @@
     data2 = PyUnicode_DATA(str2);
     len1 = PyUnicode_GET_LENGTH(str1);
     len2 = PyUnicode_GET_LENGTH(str2);
+    len = Py_MIN(len1, len2);
 
-    for (i = 0; i < len1 && i < len2; ++i) {
-        Py_UCS4 c1, c2;
-        c1 = PyUnicode_READ(kind1, data1, i);
-        c2 = PyUnicode_READ(kind2, data2, i);
-
-        if (c1 != c2)
-            return (c1 < c2) ? -1 : 1;
+    switch(kind1) {
+    case PyUnicode_1BYTE_KIND:
+    {
+        switch(kind2) {
+        case PyUnicode_1BYTE_KIND:
+        {
+            int cmp = memcmp(data1, data2, len);
+            /* normalize result of memcmp() into the range [-1; 1] */
+            if (cmp < 0)
+                return -1;
+            if (cmp > 0)
+                return 1;
+            break;
+        }
+        case PyUnicode_2BYTE_KIND:
+            COMPARE(Py_UCS1, Py_UCS2);
+            break;
+        case PyUnicode_4BYTE_KIND:
+            COMPARE(Py_UCS1, Py_UCS4);
+            break;
+        default:
+            assert(0);
+        }
+        break;
+    }
+    case PyUnicode_2BYTE_KIND:
+    {
+        switch(kind2) {
+        case PyUnicode_1BYTE_KIND:
+            COMPARE(Py_UCS2, Py_UCS1);
+            break;
+        case PyUnicode_2BYTE_KIND:
+        {
+            COMPARE(Py_UCS2, Py_UCS2);
+            break;
+        }
+        case PyUnicode_4BYTE_KIND:
+            COMPARE(Py_UCS2, Py_UCS4);
+            break;
+        default:
+            assert(0);
+        }
+        break;
+    }
+    case PyUnicode_4BYTE_KIND:
+    {
+        switch(kind2) {
+        case PyUnicode_1BYTE_KIND:
+            COMPARE(Py_UCS4, Py_UCS1);
+            break;
+        case PyUnicode_2BYTE_KIND:
+            COMPARE(Py_UCS4, Py_UCS2);
+            break;
+        case PyUnicode_4BYTE_KIND:
+        {
+#if defined(HAVE_WMEMCMP) && SIZEOF_WCHAR_T == 4
+            int cmp = wmemcmp((wchar_t *)data1, (wchar_t *)data2, len);
+            /* normalize result of wmemcmp() into the range [-1; 1] */
+            if (cmp < 0)
+                return -1;
+            if (cmp > 0)
+                return 1;
+#else
+            COMPARE(Py_UCS4, Py_UCS4);
+#endif
+            break;
+        }
+        default:
+            assert(0);
+        }
+        break;
+    }
+    default:
+        assert(0);
     }
 
-    return (len1 < len2) ? -1 : (len1 != len2);
+    if (len1 == len2)
+        return 0;
+    if (len1 < len2)
+        return -1;
+    else
+        return 1;
+
+#undef COMPARE
 }
 
+Py_LOCAL(int)
+unicode_compare_eq(PyObject *str1, PyObject *str2)
+{
+    int kind;
+    void *data1, *data2;
+    Py_ssize_t len;
+    int cmp;
+
+    len = PyUnicode_GET_LENGTH(str1);
+    if (PyUnicode_GET_LENGTH(str2) != len)
+        return 0;
+    kind = PyUnicode_KIND(str1);
+    if (PyUnicode_KIND(str2) != kind)
+        return 0;
+    data1 = PyUnicode_DATA(str1);
+    data2 = PyUnicode_DATA(str2);
+
+    cmp = memcmp(data1, data2, len * kind);
+    return (cmp == 0);
+}
+
+
 int
 PyUnicode_Compare(PyObject *left, PyObject *right)
 {
@@ -10490,6 +10788,11 @@
         if (PyUnicode_READY(left) == -1 ||
             PyUnicode_READY(right) == -1)
             return -1;
+
+        /* a string is equal to itself */
+        if (left == right)
+            return 0;
+
         return unicode_compare(left, right);
     }
     PyErr_Format(PyExc_TypeError,
@@ -10500,29 +10803,59 @@
 }
 
 int
+_PyUnicode_CompareWithId(PyObject *left, _Py_Identifier *right)
+{
+    PyObject *right_str = _PyUnicode_FromId(right);   /* borrowed */
+    if (right_str == NULL)
+        return -1;
+    return PyUnicode_Compare(left, right_str);
+}
+
+int
 PyUnicode_CompareWithASCIIString(PyObject* uni, const char* str)
 {
     Py_ssize_t i;
     int kind;
-    void *data;
     Py_UCS4 chr;
 
     assert(_PyUnicode_CHECK(uni));
     if (PyUnicode_READY(uni) == -1)
         return -1;
     kind = PyUnicode_KIND(uni);
-    data = PyUnicode_DATA(uni);
-    /* Compare Unicode string and source character set string */
-    for (i = 0; (chr = PyUnicode_READ(kind, data, i)) && str[i]; i++)
-        if (chr != str[i])
-            return (chr < (unsigned char)(str[i])) ? -1 : 1;
-    /* This check keeps Python strings that end in '\0' from comparing equal
-     to C strings identical up to that point. */
-    if (PyUnicode_GET_LENGTH(uni) != i || chr)
-        return 1; /* uni is longer */
-    if (str[i])
-        return -1; /* str is longer */
-    return 0;
+    if (kind == PyUnicode_1BYTE_KIND) {
+        const void *data = PyUnicode_1BYTE_DATA(uni);
+        size_t len1 = (size_t)PyUnicode_GET_LENGTH(uni);
+        size_t len, len2 = strlen(str);
+        int cmp;
+
+        len = Py_MIN(len1, len2);
+        cmp = memcmp(data, str, len);
+        if (cmp != 0) {
+            if (cmp < 0)
+                return -1;
+            else
+                return 1;
+        }
+        if (len1 > len2)
+            return 1; /* uni is longer */
+        if (len2 > len1)
+            return -1; /* str is longer */
+        return 0;
+    }
+    else {
+        void *data = PyUnicode_DATA(uni);
+        /* Compare Unicode string and source character set string */
+        for (i = 0; (chr = PyUnicode_READ(kind, data, i)) && str[i]; i++)
+            if (chr != str[i])
+                return (chr < (unsigned char)(str[i])) ? -1 : 1;
+        /* This check keeps Python strings that end in '\0' from comparing equal
+         to C strings identical up to that point. */
+        if (PyUnicode_GET_LENGTH(uni) != i || chr)
+            return 1; /* uni is longer */
+        if (str[i])
+            return -1; /* str is longer */
+        return 0;
+    }
 }
 
 
@@ -10533,36 +10866,43 @@
 PyUnicode_RichCompare(PyObject *left, PyObject *right, int op)
 {
     int result;
+    PyObject *v;
 
-    if (PyUnicode_Check(left) && PyUnicode_Check(right)) {
-        PyObject *v;
-        if (PyUnicode_READY(left) == -1 ||
-            PyUnicode_READY(right) == -1)
+    if (!PyUnicode_Check(left) || !PyUnicode_Check(right))
+        Py_RETURN_NOTIMPLEMENTED;
+
+    if (PyUnicode_READY(left) == -1 ||
+        PyUnicode_READY(right) == -1)
+        return NULL;
+
+    if (left == right) {
+        switch (op) {
+        case Py_EQ:
+        case Py_LE:
+        case Py_GE:
+            /* a string is equal to itself */
+            v = Py_True;
+            break;
+        case Py_NE:
+        case Py_LT:
+        case Py_GT:
+            v = Py_False;
+            break;
+        default:
+            PyErr_BadArgument();
             return NULL;
-        if (PyUnicode_GET_LENGTH(left) != PyUnicode_GET_LENGTH(right) ||
-            PyUnicode_KIND(left) != PyUnicode_KIND(right)) {
-            if (op == Py_EQ) {
-                Py_INCREF(Py_False);
-                return Py_False;
-            }
-            if (op == Py_NE) {
-                Py_INCREF(Py_True);
-                return Py_True;
-            }
         }
-        if (left == right)
-            result = 0;
-        else
-            result = unicode_compare(left, right);
+    }
+    else if (op == Py_EQ || op == Py_NE) {
+        result = unicode_compare_eq(left, right);
+        result ^= (op == Py_NE);
+        v = TEST_COND(result);
+    }
+    else {
+        result = unicode_compare(left, right);
 
         /* Convert the return value to a Boolean */
         switch (op) {
-        case Py_EQ:
-            v = TEST_COND(result == 0);
-            break;
-        case Py_NE:
-            v = TEST_COND(result != 0);
-            break;
         case Py_LE:
             v = TEST_COND(result <= 0);
             break;
@@ -10579,18 +10919,16 @@
             PyErr_BadArgument();
             return NULL;
         }
-        Py_INCREF(v);
-        return v;
     }
-
-    Py_RETURN_NOTIMPLEMENTED;
+    Py_INCREF(v);
+    return v;
 }
 
 int
 PyUnicode_Contains(PyObject *container, PyObject *element)
 {
     PyObject *str, *sub;
-    int kind1, kind2, kind;
+    int kind1, kind2;
     void *buf1, *buf2;
     Py_ssize_t len1, len2;
     int result;
@@ -10609,23 +10947,18 @@
         Py_DECREF(sub);
         return -1;
     }
-    if (PyUnicode_READY(sub) == -1 || PyUnicode_READY(str) == -1) {
-        Py_DECREF(sub);
-        Py_DECREF(str);
-    }
 
     kind1 = PyUnicode_KIND(str);
     kind2 = PyUnicode_KIND(sub);
-    kind = kind1;
     buf1 = PyUnicode_DATA(str);
     buf2 = PyUnicode_DATA(sub);
-    if (kind2 != kind) {
-        if (kind2 > kind) {
+    if (kind2 != kind1) {
+        if (kind2 > kind1) {
             Py_DECREF(sub);
             Py_DECREF(str);
             return 0;
         }
-        buf2 = _PyUnicode_AsKind(sub, kind);
+        buf2 = _PyUnicode_AsKind(sub, kind1);
     }
     if (!buf2) {
         Py_DECREF(sub);
@@ -10635,7 +10968,7 @@
     len1 = PyUnicode_GET_LENGTH(str);
     len2 = PyUnicode_GET_LENGTH(sub);
 
-    switch (kind) {
+    switch (kind1) {
     case PyUnicode_1BYTE_KIND:
         result = ucs1lib_find(buf1, len1, buf2, len2, 0) != -1;
         break;
@@ -10653,7 +10986,7 @@
     Py_DECREF(str);
     Py_DECREF(sub);
 
-    if (kind2 != kind)
+    if (kind2 != kind1)
         PyMem_Free(buf2);
 
     return result;
@@ -10729,7 +11062,8 @@
         return;
     }
     left = *p_left;
-    if (right == NULL || left == NULL || !PyUnicode_Check(left)) {
+    if (right == NULL || left == NULL
+        || !PyUnicode_Check(left) || !PyUnicode_Check(right)) {
         if (!PyErr_Occurred())
             PyErr_BadInternalCall();
         goto error;
@@ -10769,15 +11103,9 @@
         && !(PyUnicode_IS_ASCII(left) && !PyUnicode_IS_ASCII(right)))
     {
         /* append inplace */
-        if (unicode_resize(p_left, new_len) != 0) {
-            /* XXX if _PyUnicode_Resize() fails, 'left' has been
-             * deallocated so it cannot be put back into
-             * 'variable'.  The MemoryError is raised when there
-             * is no value in 'variable', which might (very
-             * remotely) be a cause of incompatibilities.
-             */
+        if (unicode_resize(p_left, new_len) != 0)
             goto error;
-        }
+
         /* copy 'right' into the newly allocated area of 'left' */
         _PyUnicode_FastCopyCharacters(*p_left, left_len, right, 0, right_len);
     }
@@ -10833,8 +11161,10 @@
 
     kind1 = PyUnicode_KIND(self);
     kind2 = PyUnicode_KIND(substring);
-    if (kind2 > kind1)
+    if (kind2 > kind1) {
+        Py_DECREF(substring);
         return PyLong_FromLong(0);
+    }
     kind = kind1;
     buf1 = PyUnicode_DATA(self);
     buf2 = PyUnicode_DATA(substring);
@@ -10905,23 +11235,25 @@
 }
 
 PyDoc_STRVAR(expandtabs__doc__,
-             "S.expandtabs([tabsize]) -> str\n\
+             "S.expandtabs(tabsize=8) -> str\n\
 \n\
 Return a copy of S where all tab characters are expanded using spaces.\n\
 If tabsize is not given, a tab size of 8 characters is assumed.");
 
 static PyObject*
-unicode_expandtabs(PyObject *self, PyObject *args)
+unicode_expandtabs(PyObject *self, PyObject *args, PyObject *kwds)
 {
     Py_ssize_t i, j, line_pos, src_len, incr;
     Py_UCS4 ch;
     PyObject *u;
     void *src_data, *dest_data;
+    static char *kwlist[] = {"tabsize", 0};
     int tabsize = 8;
     int kind;
     int found;
 
-    if (!PyArg_ParseTuple(args, "|i:expandtabs", &tabsize))
+    if (!PyArg_ParseTupleAndKeywords(args, kwds, "|i:expandtabs",
+                                     kwlist, &tabsize))
         return NULL;
 
     if (PyUnicode_READY(self) == -1)
@@ -11012,10 +11344,14 @@
                                             &start, &end))
         return NULL;
 
-    if (PyUnicode_READY(self) == -1)
+    if (PyUnicode_READY(self) == -1) {
+        Py_DECREF(substring);
         return NULL;
-    if (PyUnicode_READY(substring) == -1)
+    }
+    if (PyUnicode_READY(substring) == -1) {
+        Py_DECREF(substring);
         return NULL;
+    }
 
     result = any_find_slice(1, self, substring, start, end);
 
@@ -11033,7 +11369,6 @@
     void *data;
     enum PyUnicode_Kind kind;
     Py_UCS4 ch;
-    PyObject *res;
 
     if (!PyUnicode_Check(self) || PyUnicode_READY(self) == -1) {
         PyErr_BadArgument();
@@ -11046,17 +11381,7 @@
     kind = PyUnicode_KIND(self);
     data = PyUnicode_DATA(self);
     ch = PyUnicode_READ(kind, data, index);
-    if (ch < 256)
-        return get_latin1_char(ch);
-
-    res = PyUnicode_New(1, ch);
-    if (res == NULL)
-        return NULL;
-    kind = PyUnicode_KIND(res);
-    data = PyUnicode_DATA(res);
-    PyUnicode_WRITE(kind, data, 0, ch);
-    assert(_PyUnicode_CheckConsistency(res, 1));
-    return res;
+    return unicode_char(ch);
 }
 
 /* Believe it or not, this produces the same value for ASCII strings
@@ -11083,43 +11408,11 @@
         _PyUnicode_HASH(self) = 0;
         return 0;
     }
-
-    /* The hash function as a macro, gets expanded three times below. */
-#define HASH(P)                                            \
-    x ^= (Py_uhash_t) *P << 7;                             \
-    while (--len >= 0)                                     \
-        x = (_PyHASH_MULTIPLIER * x) ^ (Py_uhash_t) *P++;  \
-
-    x = (Py_uhash_t) _Py_HashSecret.prefix;
-    switch (PyUnicode_KIND(self)) {
-    case PyUnicode_1BYTE_KIND: {
-        const unsigned char *c = PyUnicode_1BYTE_DATA(self);
-        HASH(c);
-        break;
-    }
-    case PyUnicode_2BYTE_KIND: {
-        const Py_UCS2 *s = PyUnicode_2BYTE_DATA(self);
-        HASH(s);
-        break;
-    }
-    default: {
-        Py_UCS4 *l;
-        assert(PyUnicode_KIND(self) == PyUnicode_4BYTE_KIND &&
-               "Impossible switch case in unicode_hash");
-        l = PyUnicode_4BYTE_DATA(self);
-        HASH(l);
-        break;
-    }
-    }
-    x ^= (Py_uhash_t) PyUnicode_GET_LENGTH(self);
-    x ^= (Py_uhash_t) _Py_HashSecret.suffix;
-
-    if (x == -1)
-        x = -2;
+    x = _Py_HashBytes(PyUnicode_DATA(self),
+                      PyUnicode_GET_LENGTH(self) * PyUnicode_KIND(self));
     _PyUnicode_HASH(self) = x;
     return x;
 }
-#undef HASH
 
 PyDoc_STRVAR(index__doc__,
              "S.index(sub[, start[, end]]) -> int\n\
@@ -11138,10 +11431,14 @@
                                             &start, &end))
         return NULL;
 
-    if (PyUnicode_READY(self) == -1)
+    if (PyUnicode_READY(self) == -1) {
+        Py_DECREF(substring);
         return NULL;
-    if (PyUnicode_READY(substring) == -1)
+    }
+    if (PyUnicode_READY(substring) == -1) {
+        Py_DECREF(substring);
         return NULL;
+    }
 
     result = any_find_slice(1, self, substring, start, end);
 
@@ -11671,6 +11968,7 @@
     int kind;
     Py_ssize_t i, j, len;
     BLOOM_MASK sepmask;
+    Py_ssize_t seplen;
 
     if (PyUnicode_READY(self) == -1 || PyUnicode_READY(sepobj) == -1)
         return NULL;
@@ -11678,24 +11976,35 @@
     kind = PyUnicode_KIND(self);
     data = PyUnicode_DATA(self);
     len = PyUnicode_GET_LENGTH(self);
+    seplen = PyUnicode_GET_LENGTH(sepobj);
     sepmask = make_bloom_mask(PyUnicode_KIND(sepobj),
                               PyUnicode_DATA(sepobj),
-                              PyUnicode_GET_LENGTH(sepobj));
+                              seplen);
 
     i = 0;
     if (striptype != RIGHTSTRIP) {
-        while (i < len &&
-               BLOOM_MEMBER(sepmask, PyUnicode_READ(kind, data, i), sepobj)) {
+        while (i < len) {
+            Py_UCS4 ch = PyUnicode_READ(kind, data, i);
+            if (!BLOOM(sepmask, ch))
+                break;
+            if (PyUnicode_FindChar(sepobj, ch, 0, seplen, 1) < 0)
+                break;
             i++;
         }
     }
 
     j = len;
     if (striptype != LEFTSTRIP) {
-        do {
+        j--;
+        while (j >= i) {
+            Py_UCS4 ch = PyUnicode_READ(kind, data, j);
+            if (!BLOOM(sepmask, ch))
+                break;
+            if (PyUnicode_FindChar(sepobj, ch, 0, seplen, 1) < 0)
+                break;
             j--;
-        } while (j >= i &&
-                 BLOOM_MEMBER(sepmask, PyUnicode_READ(kind, data, j), sepobj));
+        }
+
         j++;
     }
 
@@ -11742,30 +12051,63 @@
 static PyObject *
 do_strip(PyObject *self, int striptype)
 {
-    int kind;
-    void *data;
     Py_ssize_t len, i, j;
 
     if (PyUnicode_READY(self) == -1)
         return NULL;
 
-    kind = PyUnicode_KIND(self);
-    data = PyUnicode_DATA(self);
     len = PyUnicode_GET_LENGTH(self);
 
-    i = 0;
-    if (striptype != RIGHTSTRIP) {
-        while (i < len && Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, i))) {
-            i++;
+    if (PyUnicode_IS_ASCII(self)) {
+        Py_UCS1 *data = PyUnicode_1BYTE_DATA(self);
+
+        i = 0;
+        if (striptype != RIGHTSTRIP) {
+            while (i < len) {
+                Py_UCS1 ch = data[i];
+                if (!_Py_ascii_whitespace[ch])
+                    break;
+                i++;
+            }
+        }
+
+        j = len;
+        if (striptype != LEFTSTRIP) {
+            j--;
+            while (j >= i) {
+                Py_UCS1 ch = data[j];
+                if (!_Py_ascii_whitespace[ch])
+                    break;
+                j--;
+            }
+            j++;
         }
     }
+    else {
+        int kind = PyUnicode_KIND(self);
+        void *data = PyUnicode_DATA(self);
 
-    j = len;
-    if (striptype != LEFTSTRIP) {
-        do {
+        i = 0;
+        if (striptype != RIGHTSTRIP) {
+            while (i < len) {
+                Py_UCS4 ch = PyUnicode_READ(kind, data, i);
+                if (!Py_UNICODE_ISSPACE(ch))
+                    break;
+                i++;
+            }
+        }
+
+        j = len;
+        if (striptype != LEFTSTRIP) {
             j--;
-        } while (j >= i && Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, j)));
-        j++;
+            while (j >= i) {
+                Py_UCS4 ch = PyUnicode_READ(kind, data, j);
+                if (!Py_UNICODE_ISSPACE(ch))
+                    break;
+                j--;
+            }
+            j++;
+        }
     }
 
     return PyUnicode_Substring(self, i, j);
@@ -11777,7 +12119,7 @@
 {
     PyObject *sep = NULL;
 
-    if (!PyArg_ParseTuple(args, (char *)stripformat[striptype], &sep))
+    if (!PyArg_ParseTuple(args, stripformat[striptype], &sep))
         return NULL;
 
     if (sep != NULL && sep != Py_None) {
@@ -11989,7 +12331,7 @@
     Py_ssize_t isize;
     Py_ssize_t osize, squote, dquote, i, o;
     Py_UCS4 max, quote;
-    int ikind, okind;
+    int ikind, okind, unchanged;
     void *idata, *odata;
 
     if (PyUnicode_READY(unicode) == -1)
@@ -12000,7 +12342,7 @@
 
     /* Compute length of output, quote characters, and
        maximum character */
-    osize = 2; /* quotes */
+    osize = 0;
     max = 127;
     squote = dquote = 0;
     ikind = PyUnicode_KIND(unicode);
@@ -12037,7 +12379,9 @@
     }
 
     quote = '\'';
+    unchanged = (osize == isize);
     if (squote) {
+        unchanged = 0;
         if (dquote)
             /* Both squote and dquote present. Use squote,
                and escape them */
@@ -12045,6 +12389,7 @@
         else
             quote = '"';
     }
+    osize += 2;   /* quotes */
 
     repr = PyUnicode_New(osize, max);
     if (repr == NULL)
@@ -12054,81 +12399,87 @@
 
     PyUnicode_WRITE(okind, odata, 0, quote);
     PyUnicode_WRITE(okind, odata, osize-1, quote);
+    if (unchanged) {
+        _PyUnicode_FastCopyCharacters(repr, 1,
+                                      unicode, 0,
+                                      isize);
+    }
+    else {
+        for (i = 0, o = 1; i < isize; i++) {
+            Py_UCS4 ch = PyUnicode_READ(ikind, idata, i);
 
-    for (i = 0, o = 1; i < isize; i++) {
-        Py_UCS4 ch = PyUnicode_READ(ikind, idata, i);
-
-        /* Escape quotes and backslashes */
-        if ((ch == quote) || (ch == '\\')) {
-            PyUnicode_WRITE(okind, odata, o++, '\\');
-            PyUnicode_WRITE(okind, odata, o++, ch);
-            continue;
-        }
-
-        /* Map special whitespace to '\t', \n', '\r' */
-        if (ch == '\t') {
-            PyUnicode_WRITE(okind, odata, o++, '\\');
-            PyUnicode_WRITE(okind, odata, o++, 't');
-        }
-        else if (ch == '\n') {
-            PyUnicode_WRITE(okind, odata, o++, '\\');
-            PyUnicode_WRITE(okind, odata, o++, 'n');
-        }
-        else if (ch == '\r') {
-            PyUnicode_WRITE(okind, odata, o++, '\\');
-            PyUnicode_WRITE(okind, odata, o++, 'r');
-        }
-
-        /* Map non-printable US ASCII to '\xhh' */
-        else if (ch < ' ' || ch == 0x7F) {
-            PyUnicode_WRITE(okind, odata, o++, '\\');
-            PyUnicode_WRITE(okind, odata, o++, 'x');
-            PyUnicode_WRITE(okind, odata, o++, Py_hexdigits[(ch >> 4) & 0x000F]);
-            PyUnicode_WRITE(okind, odata, o++, Py_hexdigits[ch & 0x000F]);
-        }
-
-        /* Copy ASCII characters as-is */
-        else if (ch < 0x7F) {
-            PyUnicode_WRITE(okind, odata, o++, ch);
-        }
-
-        /* Non-ASCII characters */
-        else {
-            /* Map Unicode whitespace and control characters
-               (categories Z* and C* except ASCII space)
-            */
-            if (!Py_UNICODE_ISPRINTABLE(ch)) {
+            /* Escape quotes and backslashes */
+            if ((ch == quote) || (ch == '\\')) {
                 PyUnicode_WRITE(okind, odata, o++, '\\');
-                /* Map 8-bit characters to '\xhh' */
-                if (ch <= 0xff) {
-                    PyUnicode_WRITE(okind, odata, o++, 'x');
-                    PyUnicode_WRITE(okind, odata, o++, Py_hexdigits[(ch >> 4) & 0x000F]);
-                    PyUnicode_WRITE(okind, odata, o++, Py_hexdigits[ch & 0x000F]);
-                }
-                /* Map 16-bit characters to '\uxxxx' */
-                else if (ch <= 0xffff) {
-                    PyUnicode_WRITE(okind, odata, o++, 'u');
-                    PyUnicode_WRITE(okind, odata, o++, Py_hexdigits[(ch >> 12) & 0xF]);
-                    PyUnicode_WRITE(okind, odata, o++, Py_hexdigits[(ch >> 8) & 0xF]);
-                    PyUnicode_WRITE(okind, odata, o++, Py_hexdigits[(ch >> 4) & 0xF]);
-                    PyUnicode_WRITE(okind, odata, o++, Py_hexdigits[ch & 0xF]);
-                }
-                /* Map 21-bit characters to '\U00xxxxxx' */
-                else {
-                    PyUnicode_WRITE(okind, odata, o++, 'U');
-                    PyUnicode_WRITE(okind, odata, o++, Py_hexdigits[(ch >> 28) & 0xF]);
-                    PyUnicode_WRITE(okind, odata, o++, Py_hexdigits[(ch >> 24) & 0xF]);
-                    PyUnicode_WRITE(okind, odata, o++, Py_hexdigits[(ch >> 20) & 0xF]);
-                    PyUnicode_WRITE(okind, odata, o++, Py_hexdigits[(ch >> 16) & 0xF]);
-                    PyUnicode_WRITE(okind, odata, o++, Py_hexdigits[(ch >> 12) & 0xF]);
-                    PyUnicode_WRITE(okind, odata, o++, Py_hexdigits[(ch >> 8) & 0xF]);
-                    PyUnicode_WRITE(okind, odata, o++, Py_hexdigits[(ch >> 4) & 0xF]);
-                    PyUnicode_WRITE(okind, odata, o++, Py_hexdigits[ch & 0xF]);
-                }
-            }
-            /* Copy characters as-is */
-            else {
                 PyUnicode_WRITE(okind, odata, o++, ch);
+                continue;
+            }
+
+            /* Map special whitespace to '\t', \n', '\r' */
+            if (ch == '\t') {
+                PyUnicode_WRITE(okind, odata, o++, '\\');
+                PyUnicode_WRITE(okind, odata, o++, 't');
+            }
+            else if (ch == '\n') {
+                PyUnicode_WRITE(okind, odata, o++, '\\');
+                PyUnicode_WRITE(okind, odata, o++, 'n');
+            }
+            else if (ch == '\r') {
+                PyUnicode_WRITE(okind, odata, o++, '\\');
+                PyUnicode_WRITE(okind, odata, o++, 'r');
+            }
+
+            /* Map non-printable US ASCII to '\xhh' */
+            else if (ch < ' ' || ch == 0x7F) {
+                PyUnicode_WRITE(okind, odata, o++, '\\');
+                PyUnicode_WRITE(okind, odata, o++, 'x');
+                PyUnicode_WRITE(okind, odata, o++, Py_hexdigits[(ch >> 4) & 0x000F]);
+                PyUnicode_WRITE(okind, odata, o++, Py_hexdigits[ch & 0x000F]);
+            }
+
+            /* Copy ASCII characters as-is */
+            else if (ch < 0x7F) {
+                PyUnicode_WRITE(okind, odata, o++, ch);
+            }
+
+            /* Non-ASCII characters */
+            else {
+                /* Map Unicode whitespace and control characters
+                   (categories Z* and C* except ASCII space)
+                */
+                if (!Py_UNICODE_ISPRINTABLE(ch)) {
+                    PyUnicode_WRITE(okind, odata, o++, '\\');
+                    /* Map 8-bit characters to '\xhh' */
+                    if (ch <= 0xff) {
+                        PyUnicode_WRITE(okind, odata, o++, 'x');
+                        PyUnicode_WRITE(okind, odata, o++, Py_hexdigits[(ch >> 4) & 0x000F]);
+                        PyUnicode_WRITE(okind, odata, o++, Py_hexdigits[ch & 0x000F]);
+                    }
+                    /* Map 16-bit characters to '\uxxxx' */
+                    else if (ch <= 0xffff) {
+                        PyUnicode_WRITE(okind, odata, o++, 'u');
+                        PyUnicode_WRITE(okind, odata, o++, Py_hexdigits[(ch >> 12) & 0xF]);
+                        PyUnicode_WRITE(okind, odata, o++, Py_hexdigits[(ch >> 8) & 0xF]);
+                        PyUnicode_WRITE(okind, odata, o++, Py_hexdigits[(ch >> 4) & 0xF]);
+                        PyUnicode_WRITE(okind, odata, o++, Py_hexdigits[ch & 0xF]);
+                    }
+                    /* Map 21-bit characters to '\U00xxxxxx' */
+                    else {
+                        PyUnicode_WRITE(okind, odata, o++, 'U');
+                        PyUnicode_WRITE(okind, odata, o++, Py_hexdigits[(ch >> 28) & 0xF]);
+                        PyUnicode_WRITE(okind, odata, o++, Py_hexdigits[(ch >> 24) & 0xF]);
+                        PyUnicode_WRITE(okind, odata, o++, Py_hexdigits[(ch >> 20) & 0xF]);
+                        PyUnicode_WRITE(okind, odata, o++, Py_hexdigits[(ch >> 16) & 0xF]);
+                        PyUnicode_WRITE(okind, odata, o++, Py_hexdigits[(ch >> 12) & 0xF]);
+                        PyUnicode_WRITE(okind, odata, o++, Py_hexdigits[(ch >> 8) & 0xF]);
+                        PyUnicode_WRITE(okind, odata, o++, Py_hexdigits[(ch >> 4) & 0xF]);
+                        PyUnicode_WRITE(okind, odata, o++, Py_hexdigits[ch & 0xF]);
+                    }
+                }
+                /* Copy characters as-is */
+                else {
+                    PyUnicode_WRITE(okind, odata, o++, ch);
+                }
             }
         }
     }
@@ -12158,10 +12509,14 @@
                                             &start, &end))
         return NULL;
 
-    if (PyUnicode_READY(self) == -1)
+    if (PyUnicode_READY(self) == -1) {
+        Py_DECREF(substring);
         return NULL;
-    if (PyUnicode_READY(substring) == -1)
+    }
+    if (PyUnicode_READY(substring) == -1) {
+        Py_DECREF(substring);
         return NULL;
+    }
 
     result = any_find_slice(-1, self, substring, start, end);
 
@@ -12190,10 +12545,14 @@
                                             &start, &end))
         return NULL;
 
-    if (PyUnicode_READY(self) == -1)
+    if (PyUnicode_READY(self) == -1) {
+        Py_DECREF(substring);
         return NULL;
-    if (PyUnicode_READY(substring) == -1)
+    }
+    if (PyUnicode_READY(substring) == -1) {
+        Py_DECREF(substring);
         return NULL;
+    }
 
     result = any_find_slice(-1, self, substring, start, end);
 
@@ -12550,28 +12909,76 @@
     return case_operation(self, do_swapcase);
 }
 
-PyDoc_STRVAR(maketrans__doc__,
-             "str.maketrans(x[, y[, z]]) -> dict (static method)\n\
-\n\
-Return a translation table usable for str.translate().\n\
-If there is only one argument, it must be a dictionary mapping Unicode\n\
-ordinals (integers) or characters to Unicode ordinals, strings or None.\n\
-Character keys will be then converted to ordinals.\n\
-If there are two arguments, they must be strings of equal length, and\n\
-in the resulting dictionary, each character in x will be mapped to the\n\
-character at the same position in y. If there is a third argument, it\n\
-must be a string, whose characters will be mapped to None in the result.");
+/*[clinic input]
 
-static PyObject*
-unicode_maketrans(PyObject *null, PyObject *args)
+@staticmethod
+str.maketrans as unicode_maketrans
+
+  x: object
+
+  y: unicode=NULL
+
+  z: unicode=NULL
+
+  /
+
+Return a translation table usable for str.translate().
+
+If there is only one argument, it must be a dictionary mapping Unicode
+ordinals (integers) or characters to Unicode ordinals, strings or None.
+Character keys will be then converted to ordinals.
+If there are two arguments, they must be strings of equal length, and
+in the resulting dictionary, each character in x will be mapped to the
+character at the same position in y. If there is a third argument, it
+must be a string, whose characters will be mapped to None in the result.
+[clinic start generated code]*/
+
+PyDoc_STRVAR(unicode_maketrans__doc__,
+"maketrans(x, y=None, z=None, /)\n"
+"--\n"
+"\n"
+"Return a translation table usable for str.translate().\n"
+"\n"
+"If there is only one argument, it must be a dictionary mapping Unicode\n"
+"ordinals (integers) or characters to Unicode ordinals, strings or None.\n"
+"Character keys will be then converted to ordinals.\n"
+"If there are two arguments, they must be strings of equal length, and\n"
+"in the resulting dictionary, each character in x will be mapped to the\n"
+"character at the same position in y. If there is a third argument, it\n"
+"must be a string, whose characters will be mapped to None in the result.");
+
+#define UNICODE_MAKETRANS_METHODDEF    \
+    {"maketrans", (PyCFunction)unicode_maketrans, METH_VARARGS|METH_STATIC, unicode_maketrans__doc__},
+
+static PyObject *
+unicode_maketrans_impl(PyObject *x, PyObject *y, PyObject *z);
+
+static PyObject *
+unicode_maketrans(void *null, PyObject *args)
 {
-    PyObject *x, *y = NULL, *z = NULL;
+    PyObject *return_value = NULL;
+    PyObject *x;
+    PyObject *y = NULL;
+    PyObject *z = NULL;
+
+    if (!PyArg_ParseTuple(args,
+        "O|UU:maketrans",
+        &x, &y, &z))
+        goto exit;
+    return_value = unicode_maketrans_impl(x, y, z);
+
+exit:
+    return return_value;
+}
+
+static PyObject *
+unicode_maketrans_impl(PyObject *x, PyObject *y, PyObject *z)
+/*[clinic end generated code: output=566edf630f77436a input=7bfbf529a293c6c5]*/
+{
     PyObject *new = NULL, *key, *value;
     Py_ssize_t i = 0;
     int res;
 
-    if (!PyArg_ParseTuple(args, "O|UU:maketrans", &x, &y, &z))
-        return NULL;
     new = PyDict_New();
     if (!new)
         return NULL;
@@ -12782,6 +13189,8 @@
                 return NULL;
             result = tailmatch(self, substring, start, end, -1);
             Py_DECREF(substring);
+            if (result == -1)
+                return NULL;
             if (result) {
                 Py_RETURN_TRUE;
             }
@@ -12798,6 +13207,8 @@
     }
     result = tailmatch(self, substring, start, end, -1);
     Py_DECREF(substring);
+    if (result == -1)
+        return NULL;
     return PyBool_FromLong(result);
 }
 
@@ -12831,6 +13242,8 @@
                 return NULL;
             result = tailmatch(self, substring, start, end, +1);
             Py_DECREF(substring);
+            if (result == -1)
+                return NULL;
             if (result) {
                 Py_RETURN_TRUE;
             }
@@ -12846,33 +13259,48 @@
     }
     result = tailmatch(self, substring, start, end, +1);
     Py_DECREF(substring);
+    if (result == -1)
+        return NULL;
     return PyBool_FromLong(result);
 }
 
 Py_LOCAL_INLINE(void)
 _PyUnicodeWriter_Update(_PyUnicodeWriter *writer)
 {
-    writer->size = PyUnicode_GET_LENGTH(writer->buffer);
+    if (!writer->readonly)
+        writer->size = PyUnicode_GET_LENGTH(writer->buffer);
+    else {
+        /* Copy-on-write mode: set buffer size to 0 so
+         * _PyUnicodeWriter_Prepare() will copy (and enlarge) the buffer on
+         * next write. */
+        writer->size = 0;
+    }
     writer->maxchar = PyUnicode_MAX_CHAR_VALUE(writer->buffer);
     writer->data = PyUnicode_DATA(writer->buffer);
     writer->kind = PyUnicode_KIND(writer->buffer);
 }
 
 void
-_PyUnicodeWriter_Init(_PyUnicodeWriter *writer, Py_ssize_t min_length)
+_PyUnicodeWriter_Init(_PyUnicodeWriter *writer)
 {
     memset(writer, 0, sizeof(*writer));
 #ifdef Py_DEBUG
     writer->kind = 5;    /* invalid kind */
 #endif
-    writer->min_length = Py_MAX(min_length, 100);
-    writer->overallocate = (min_length > 0);
+    writer->min_char = 127;
 }
 
 int
 _PyUnicodeWriter_PrepareInternal(_PyUnicodeWriter *writer,
                                  Py_ssize_t length, Py_UCS4 maxchar)
 {
+#ifdef MS_WINDOWS
+   /* On Windows, overallocate by 50% is the best factor */
+#  define OVERALLOCATE_FACTOR 2
+#else
+   /* On Linux, overallocate by 25% is the best factor */
+#  define OVERALLOCATE_FACTOR 4
+#endif
     Py_ssize_t newlen;
     PyObject *newbuffer;
 
@@ -12884,29 +13312,30 @@
     }
     newlen = writer->pos + length;
 
+    maxchar = Py_MAX(maxchar, writer->min_char);
+
     if (writer->buffer == NULL) {
-        if (writer->overallocate) {
-            /* overallocate 25% to limit the number of resize */
-            if (newlen <= (PY_SSIZE_T_MAX - newlen / 4))
-                newlen += newlen / 4;
-            if (newlen < writer->min_length)
-                newlen = writer->min_length;
+        assert(!writer->readonly);
+        if (writer->overallocate
+            && newlen <= (PY_SSIZE_T_MAX - newlen / OVERALLOCATE_FACTOR)) {
+            /* overallocate to limit the number of realloc() */
+            newlen += newlen / OVERALLOCATE_FACTOR;
         }
+        if (newlen < writer->min_length)
+            newlen = writer->min_length;
+
         writer->buffer = PyUnicode_New(newlen, maxchar);
         if (writer->buffer == NULL)
             return -1;
-        _PyUnicodeWriter_Update(writer);
-        return 0;
     }
-
-    if (newlen > writer->size) {
-        if (writer->overallocate) {
-            /* overallocate 25% to limit the number of resize */
-            if (newlen <= (PY_SSIZE_T_MAX - newlen / 4))
-                newlen += newlen / 4;
-            if (newlen < writer->min_length)
-                newlen = writer->min_length;
+    else if (newlen > writer->size) {
+        if (writer->overallocate
+            && newlen <= (PY_SSIZE_T_MAX - newlen / OVERALLOCATE_FACTOR)) {
+            /* overallocate to limit the number of realloc() */
+            newlen += newlen / OVERALLOCATE_FACTOR;
         }
+        if (newlen < writer->min_length)
+            newlen = writer->min_length;
 
         if (maxchar > writer->maxchar || writer->readonly) {
             /* resize + widen */
@@ -12924,7 +13353,6 @@
                 return -1;
         }
         writer->buffer = newbuffer;
-        _PyUnicodeWriter_Update(writer);
     }
     else if (maxchar > writer->maxchar) {
         assert(!writer->readonly);
@@ -12935,9 +13363,27 @@
                                       writer->buffer, 0, writer->pos);
         Py_DECREF(writer->buffer);
         writer->buffer = newbuffer;
-        _PyUnicodeWriter_Update(writer);
     }
+    _PyUnicodeWriter_Update(writer);
     return 0;
+
+#undef OVERALLOCATE_FACTOR
+}
+
+Py_LOCAL_INLINE(int)
+_PyUnicodeWriter_WriteCharInline(_PyUnicodeWriter *writer, Py_UCS4 ch)
+{
+    if (_PyUnicodeWriter_Prepare(writer, 1, ch) < 0)
+        return -1;
+    PyUnicode_WRITE(writer->kind, writer->data, writer->pos, ch);
+    writer->pos++;
+    return 0;
+}
+
+int
+_PyUnicodeWriter_WriteChar(_PyUnicodeWriter *writer, Py_UCS4 ch)
+{
+    return _PyUnicodeWriter_WriteCharInline(writer, ch);
 }
 
 int
@@ -12954,11 +13400,10 @@
     maxchar = PyUnicode_MAX_CHAR_VALUE(str);
     if (maxchar > writer->maxchar || len > writer->size - writer->pos) {
         if (writer->buffer == NULL && !writer->overallocate) {
+            writer->readonly = 1;
             Py_INCREF(str);
             writer->buffer = str;
             _PyUnicodeWriter_Update(writer);
-            writer->readonly = 1;
-            writer->size = 0;
             writer->pos += len;
             return 0;
         }
@@ -12971,28 +13416,142 @@
     return 0;
 }
 
+int
+_PyUnicodeWriter_WriteSubstring(_PyUnicodeWriter *writer, PyObject *str,
+                                Py_ssize_t start, Py_ssize_t end)
+{
+    Py_UCS4 maxchar;
+    Py_ssize_t len;
+
+    if (PyUnicode_READY(str) == -1)
+        return -1;
+
+    assert(0 <= start);
+    assert(end <= PyUnicode_GET_LENGTH(str));
+    assert(start <= end);
+
+    if (end == 0)
+        return 0;
+
+    if (start == 0 && end == PyUnicode_GET_LENGTH(str))
+        return _PyUnicodeWriter_WriteStr(writer, str);
+
+    if (PyUnicode_MAX_CHAR_VALUE(str) > writer->maxchar)
+        maxchar = _PyUnicode_FindMaxChar(str, start, end);
+    else
+        maxchar = writer->maxchar;
+    len = end - start;
+
+    if (_PyUnicodeWriter_Prepare(writer, len, maxchar) < 0)
+        return -1;
+
+    _PyUnicode_FastCopyCharacters(writer->buffer, writer->pos,
+                                  str, start, len);
+    writer->pos += len;
+    return 0;
+}
+
+int
+_PyUnicodeWriter_WriteASCIIString(_PyUnicodeWriter *writer,
+                                  const char *ascii, Py_ssize_t len)
+{
+    if (len == -1)
+        len = strlen(ascii);
+
+    assert(ucs1lib_find_max_char((Py_UCS1*)ascii, (Py_UCS1*)ascii + len) < 128);
+
+    if (writer->buffer == NULL && !writer->overallocate) {
+        PyObject *str;
+
+        str = _PyUnicode_FromASCII(ascii, len);
+        if (str == NULL)
+            return -1;
+
+        writer->readonly = 1;
+        writer->buffer = str;
+        _PyUnicodeWriter_Update(writer);
+        writer->pos += len;
+        return 0;
+    }
+
+    if (_PyUnicodeWriter_Prepare(writer, len, 127) == -1)
+        return -1;
+
+    switch (writer->kind)
+    {
+    case PyUnicode_1BYTE_KIND:
+    {
+        const Py_UCS1 *str = (const Py_UCS1 *)ascii;
+        Py_UCS1 *data = writer->data;
+
+        Py_MEMCPY(data + writer->pos, str, len);
+        break;
+    }
+    case PyUnicode_2BYTE_KIND:
+    {
+        _PyUnicode_CONVERT_BYTES(
+            Py_UCS1, Py_UCS2,
+            ascii, ascii + len,
+            (Py_UCS2 *)writer->data + writer->pos);
+        break;
+    }
+    case PyUnicode_4BYTE_KIND:
+    {
+        _PyUnicode_CONVERT_BYTES(
+            Py_UCS1, Py_UCS4,
+            ascii, ascii + len,
+            (Py_UCS4 *)writer->data + writer->pos);
+        break;
+    }
+    default:
+        assert(0);
+    }
+
+    writer->pos += len;
+    return 0;
+}
+
+int
+_PyUnicodeWriter_WriteLatin1String(_PyUnicodeWriter *writer,
+                                   const char *str, Py_ssize_t len)
+{
+    Py_UCS4 maxchar;
+
+    maxchar = ucs1lib_find_max_char((Py_UCS1*)str, (Py_UCS1*)str + len);
+    if (_PyUnicodeWriter_Prepare(writer, len, maxchar) == -1)
+        return -1;
+    unicode_write_cstr(writer->buffer, writer->pos, str, len);
+    writer->pos += len;
+    return 0;
+}
+
 PyObject *
 _PyUnicodeWriter_Finish(_PyUnicodeWriter *writer)
 {
+    PyObject *str;
     if (writer->pos == 0) {
-        Py_XDECREF(writer->buffer);
+        Py_CLEAR(writer->buffer);
         _Py_RETURN_UNICODE_EMPTY();
     }
     if (writer->readonly) {
-        assert(PyUnicode_GET_LENGTH(writer->buffer) == writer->pos);
-        return writer->buffer;
+        str = writer->buffer;
+        writer->buffer = NULL;
+        assert(PyUnicode_GET_LENGTH(str) == writer->pos);
+        return str;
     }
     if (PyUnicode_GET_LENGTH(writer->buffer) != writer->pos) {
         PyObject *newbuffer;
         newbuffer = resize_compact(writer->buffer, writer->pos);
         if (newbuffer == NULL) {
-            Py_DECREF(writer->buffer);
+            Py_CLEAR(writer->buffer);
             return NULL;
         }
         writer->buffer = newbuffer;
     }
-    assert(_PyUnicode_CheckConsistency(writer->buffer, 1));
-    return unicode_result_ready(writer->buffer);
+    str = writer->buffer;
+    writer->buffer = NULL;
+    assert(_PyUnicode_CheckConsistency(str, 1));
+    return unicode_result_ready(str);
 }
 
 void
@@ -13027,7 +13586,7 @@
 
     if (PyUnicode_READY(self) == -1)
         return NULL;
-    _PyUnicodeWriter_Init(&writer, 0);
+    _PyUnicodeWriter_Init(&writer);
     ret = _PyUnicode_FormatAdvancedWriter(&writer,
                                           self, format_spec, 0,
                                           PyUnicode_GET_LENGTH(format_spec));
@@ -13096,7 +13655,8 @@
     {"title", (PyCFunction) unicode_title, METH_NOARGS, title__doc__},
     {"center", (PyCFunction) unicode_center, METH_VARARGS, center__doc__},
     {"count", (PyCFunction) unicode_count, METH_VARARGS, count__doc__},
-    {"expandtabs", (PyCFunction) unicode_expandtabs, METH_VARARGS, expandtabs__doc__},
+    {"expandtabs", (PyCFunction) unicode_expandtabs,
+     METH_VARARGS | METH_KEYWORDS, expandtabs__doc__},
     {"find", (PyCFunction) unicode_find, METH_VARARGS, find__doc__},
     {"partition", (PyCFunction) unicode_partition, METH_O, partition__doc__},
     {"index", (PyCFunction) unicode_index, METH_VARARGS, index__doc__},
@@ -13108,7 +13668,8 @@
     {"rjust", (PyCFunction) unicode_rjust, METH_VARARGS, rjust__doc__},
     {"rstrip", (PyCFunction) unicode_rstrip, METH_VARARGS, rstrip__doc__},
     {"rpartition", (PyCFunction) unicode_rpartition, METH_O, rpartition__doc__},
-    {"splitlines", (PyCFunction) unicode_splitlines, METH_VARARGS | METH_KEYWORDS, splitlines__doc__},
+    {"splitlines", (PyCFunction) unicode_splitlines,
+     METH_VARARGS | METH_KEYWORDS, splitlines__doc__},
     {"strip", (PyCFunction) unicode_strip, METH_VARARGS, strip__doc__},
     {"swapcase", (PyCFunction) unicode_swapcase, METH_NOARGS, swapcase__doc__},
     {"translate", (PyCFunction) unicode_translate, METH_O, translate__doc__},
@@ -13130,8 +13691,7 @@
     {"format", (PyCFunction) do_string_format, METH_VARARGS | METH_KEYWORDS, format__doc__},
     {"format_map", (PyCFunction) do_string_format_map, METH_O, format_map__doc__},
     {"__format__", (PyCFunction) unicode__format__, METH_VARARGS, p_format__doc__},
-    {"maketrans", (PyCFunction) unicode_maketrans,
-     METH_VARARGS | METH_STATIC, maketrans__doc__},
+    UNICODE_MAKETRANS_METHODDEF
     {"__sizeof__", (PyCFunction) unicode__sizeof__, METH_NOARGS, sizeof__doc__},
 #if 0
     /* These methods are just used for debugging the implementation. */
@@ -13246,16 +13806,39 @@
 
 /* Helpers for PyUnicode_Format() */
 
+struct unicode_formatter_t {
+    PyObject *args;
+    int args_owned;
+    Py_ssize_t arglen, argidx;
+    PyObject *dict;
+
+    enum PyUnicode_Kind fmtkind;
+    Py_ssize_t fmtcnt, fmtpos;
+    void *fmtdata;
+    PyObject *fmtstr;
+
+    _PyUnicodeWriter writer;
+};
+
+struct unicode_format_arg_t {
+    Py_UCS4 ch;
+    int flags;
+    Py_ssize_t width;
+    int prec;
+    int sign;
+};
+
 static PyObject *
-getnextarg(PyObject *args, Py_ssize_t arglen, Py_ssize_t *p_argidx)
+unicode_format_getnextarg(struct unicode_formatter_t *ctx)
 {
-    Py_ssize_t argidx = *p_argidx;
-    if (argidx < arglen) {
-        (*p_argidx)++;
-        if (arglen < 0)
-            return args;
+    Py_ssize_t argidx = ctx->argidx;
+
+    if (argidx < ctx->arglen) {
+        ctx->argidx++;
+        if (ctx->arglen < 0)
+            return ctx->args;
         else
-            return PyTuple_GetItem(args, argidx);
+            return PyTuple_GetItem(ctx->args, argidx);
     }
     PyErr_SetString(PyExc_TypeError,
                     "not enough arguments for format string");
@@ -13264,33 +13847,42 @@
 
 /* Returns a new reference to a PyUnicode object, or NULL on failure. */
 
+/* Format a float into the writer if the writer is not NULL, or into *p_output
+   otherwise.
+
+   Return 0 on success, raise an exception and return -1 on error. */
 static int
-formatfloat(PyObject *v, int flags, int prec, int type,
-            PyObject **p_output, _PyUnicodeWriter *writer)
+formatfloat(PyObject *v, struct unicode_format_arg_t *arg,
+            PyObject **p_output,
+            _PyUnicodeWriter *writer)
 {
     char *p;
     double x;
     Py_ssize_t len;
+    int prec;
+    int dtoa_flags;
 
     x = PyFloat_AsDouble(v);
     if (x == -1.0 && PyErr_Occurred())
         return -1;
 
+    prec = arg->prec;
     if (prec < 0)
         prec = 6;
 
-    p = PyOS_double_to_string(x, type, prec,
-                              (flags & F_ALT) ? Py_DTSF_ALT : 0, NULL);
+    if (arg->flags & F_ALT)
+        dtoa_flags = Py_DTSF_ALT;
+    else
+        dtoa_flags = 0;
+    p = PyOS_double_to_string(x, arg->ch, prec, dtoa_flags, NULL);
     if (p == NULL)
         return -1;
     len = strlen(p);
     if (writer) {
-        if (_PyUnicodeWriter_Prepare(writer, len, 127) == -1) {
+        if (_PyUnicodeWriter_WriteASCIIString(writer, p, len) < 0) {
             PyMem_Free(p);
             return -1;
         }
-        unicode_write_cstr(writer->buffer, writer->pos, p, len);
-        writer->pos += len;
     }
     else
         *p_output = _PyUnicode_FromASCII(p, len);
@@ -13317,7 +13909,7 @@
  * produce a '-' sign, but can for Python's unbounded ints.
  */
 static PyObject*
-formatlong(PyObject *val, int flags, int prec, int type)
+formatlong(PyObject *val, struct unicode_format_arg_t *arg)
 {
     PyObject *result = NULL;
     char *buf;
@@ -13327,6 +13919,8 @@
     Py_ssize_t llen;
     int numdigits;      /* len == numnondigits + numdigits */
     int numnondigits = 0;
+    int prec = arg->prec;
+    int type = arg->ch;
 
     /* Avoid exceeding SSIZE_T_MAX */
     if (prec > INT_MAX-3) {
@@ -13338,13 +13932,14 @@
     assert(PyLong_Check(val));
 
     switch (type) {
+    default:
+        assert(!"'type' not in [diuoxX]");
     case 'd':
+    case 'i':
     case 'u':
-        /* Special-case boolean: we want 0/1 */
-        if (PyBool_Check(val))
-            result = PyNumber_ToBase(val, 10);
-        else
-            result = Py_TYPE(val)->tp_str(val);
+        /* int and int subclasses should print numerically when a numeric */
+        /* format code is used (see issue18780) */
+        result = PyNumber_ToBase(val, 10);
         break;
     case 'o':
         numnondigits = 2;
@@ -13355,8 +13950,6 @@
         numnondigits = 2;
         result = PyNumber_ToBase(val, 16);
         break;
-    default:
-        assert(!"'type' not in [duoxX]");
     }
     if (!result)
         return NULL;
@@ -13367,12 +13960,14 @@
 
     /* To modify the string in-place, there can only be one reference. */
     if (Py_REFCNT(result) != 1) {
+        Py_DECREF(result);
         PyErr_BadInternalCall();
         return NULL;
     }
     buf = PyUnicode_DATA(result);
     llen = PyUnicode_GET_LENGTH(result);
     if (llen > INT_MAX) {
+        Py_DECREF(result);
         PyErr_SetString(PyExc_ValueError,
                         "string too large in _PyBytes_FormatLong");
         return NULL;
@@ -13384,7 +13979,7 @@
     assert(numdigits > 0);
 
     /* Get rid of base marker unless F_ALT */
-    if (((flags & F_ALT) == 0 &&
+    if (((arg->flags & F_ALT) == 0 &&
         (type == 'o' || type == 'x' || type == 'X'))) {
         assert(buf[sign] == '0');
         assert(buf[sign+1] == 'x' || buf[sign+1] == 'X' ||
@@ -13429,15 +14024,121 @@
             if (buf[i] >= 'a' && buf[i] <= 'x')
                 buf[i] -= 'a'-'A';
     }
-    if (!PyUnicode_Check(result) || len != PyUnicode_GET_LENGTH(result)) {
+    if (!PyUnicode_Check(result)
+        || buf != PyUnicode_DATA(result)) {
         PyObject *unicode;
         unicode = _PyUnicode_FromASCII(buf, len);
         Py_DECREF(result);
         result = unicode;
     }
+    else if (len != PyUnicode_GET_LENGTH(result)) {
+        if (PyUnicode_Resize(&result, len) < 0)
+            Py_CLEAR(result);
+    }
     return result;
 }
 
+/* Format an integer or a float as an integer.
+ * Return 1 if the number has been formatted into the writer,
+ *        0 if the number has been formatted into *p_output
+ *       -1 and raise an exception on error */
+static int
+mainformatlong(PyObject *v,
+               struct unicode_format_arg_t *arg,
+               PyObject **p_output,
+               _PyUnicodeWriter *writer)
+{
+    PyObject *iobj, *res;
+    char type = (char)arg->ch;
+
+    if (!PyNumber_Check(v))
+        goto wrongtype;
+
+    /* make sure number is a type of integer */
+    /* if not, issue deprecation warning for now */
+    if (!PyLong_Check(v)) {
+        if (type == 'o' || type == 'x' || type == 'X') {
+            iobj = PyNumber_Index(v);
+            if (iobj == NULL) {
+                PyErr_Clear();
+                if (PyErr_WarnEx(PyExc_DeprecationWarning,
+                                 "automatic int conversions have been deprecated",
+                                 1)) {
+                    return -1;
+                }
+                iobj = PyNumber_Long(v);
+                if (iobj == NULL ) {
+                    if (PyErr_ExceptionMatches(PyExc_TypeError))
+                        goto wrongtype;
+                    return -1;
+                }
+            }
+        }
+        else {
+            iobj = PyNumber_Long(v);
+            if (iobj == NULL ) {
+                if (PyErr_ExceptionMatches(PyExc_TypeError))
+                    goto wrongtype;
+                return -1;
+            }
+        }
+        assert(PyLong_Check(iobj));
+    }
+    else {
+        iobj = v;
+        Py_INCREF(iobj);
+    }
+
+    if (PyLong_CheckExact(v)
+        && arg->width == -1 && arg->prec == -1
+        && !(arg->flags & (F_SIGN | F_BLANK))
+        && type != 'X')
+    {
+        /* Fast path */
+        int alternate = arg->flags & F_ALT;
+        int base;
+
+        switch(type)
+        {
+            default:
+                assert(0 && "'type' not in [diuoxX]");
+            case 'd':
+            case 'i':
+            case 'u':
+                base = 10;
+                break;
+            case 'o':
+                base = 8;
+                break;
+            case 'x':
+            case 'X':
+                base = 16;
+                break;
+        }
+
+        if (_PyLong_FormatWriter(writer, v, base, alternate) == -1) {
+            Py_DECREF(iobj);
+            return -1;
+        }
+        Py_DECREF(iobj);
+        return 1;
+    }
+
+    res = formatlong(iobj, arg);
+    Py_DECREF(iobj);
+    if (res == NULL)
+        return -1;
+    *p_output = res;
+    return 0;
+
+wrongtype:
+    PyErr_Format(PyExc_TypeError,
+            "%%%c format: a number is required, "
+            "not %.200s",
+            type, Py_TYPE(v)->tp_name);
+    return -1;
+}
+
 static Py_UCS4
 formatchar(PyObject *v)
 {
@@ -13449,8 +14150,30 @@
         goto onError;
     }
     else {
-        /* Integer input truncated to a character */
+        PyObject *iobj;
         long x;
+        /* make sure number is a type of integer */
+        /* if not, issue deprecation warning for now */
+        if (!PyLong_Check(v)) {
+            iobj = PyNumber_Index(v);
+            if (iobj == NULL) {
+                PyErr_Clear();
+                if (PyErr_WarnEx(PyExc_DeprecationWarning,
+                                 "automatic int conversions have been deprecated",
+                                 1)) {
+                    return -1;
+                }
+                iobj = PyNumber_Long(v);
+                if (iobj == NULL ) {
+                    if (PyErr_ExceptionMatches(PyExc_TypeError))
+                        goto onError;
+                    return -1;
+                }
+            }
+            v = iobj;
+            Py_DECREF(iobj);
+        }
+        /* Integer input truncated to a character */
         x = PyLong_AsLong(v);
         if (x == -1 && PyErr_Occurred())
             goto onError;
@@ -13470,540 +14193,588 @@
     return (Py_UCS4) -1;
 }
 
+/* Parse options of an argument: flags, width, precision.
+   Handle also "%(name)" syntax.
+
+   Return 0 if the argument has been formatted into arg->str.
+   Return 1 if the argument has been written into ctx->writer,
+   Raise an exception and return -1 on error. */
+static int
+unicode_format_arg_parse(struct unicode_formatter_t *ctx,
+                         struct unicode_format_arg_t *arg)
+{
+#define FORMAT_READ(ctx) \
+        PyUnicode_READ((ctx)->fmtkind, (ctx)->fmtdata, (ctx)->fmtpos)
+
+    PyObject *v;
+
+    if (arg->ch == '(') {
+        /* Get argument value from a dictionary. Example: "%(name)s". */
+        Py_ssize_t keystart;
+        Py_ssize_t keylen;
+        PyObject *key;
+        int pcount = 1;
+
+        if (ctx->dict == NULL) {
+            PyErr_SetString(PyExc_TypeError,
+                            "format requires a mapping");
+            return -1;
+        }
+        ++ctx->fmtpos;
+        --ctx->fmtcnt;
+        keystart = ctx->fmtpos;
+        /* Skip over balanced parentheses */
+        while (pcount > 0 && --ctx->fmtcnt >= 0) {
+            arg->ch = FORMAT_READ(ctx);
+            if (arg->ch == ')')
+                --pcount;
+            else if (arg->ch == '(')
+                ++pcount;
+            ctx->fmtpos++;
+        }
+        keylen = ctx->fmtpos - keystart - 1;
+        if (ctx->fmtcnt < 0 || pcount > 0) {
+            PyErr_SetString(PyExc_ValueError,
+                            "incomplete format key");
+            return -1;
+        }
+        key = PyUnicode_Substring(ctx->fmtstr,
+                                  keystart, keystart + keylen);
+        if (key == NULL)
+            return -1;
+        if (ctx->args_owned) {
+            Py_DECREF(ctx->args);
+            ctx->args_owned = 0;
+        }
+        ctx->args = PyObject_GetItem(ctx->dict, key);
+        Py_DECREF(key);
+        if (ctx->args == NULL)
+            return -1;
+        ctx->args_owned = 1;
+        ctx->arglen = -1;
+        ctx->argidx = -2;
+    }
+
+    /* Parse flags. Example: "%+i" => flags=F_SIGN. */
+    while (--ctx->fmtcnt >= 0) {
+        arg->ch = FORMAT_READ(ctx);
+        ctx->fmtpos++;
+        switch (arg->ch) {
+        case '-': arg->flags |= F_LJUST; continue;
+        case '+': arg->flags |= F_SIGN; continue;
+        case ' ': arg->flags |= F_BLANK; continue;
+        case '#': arg->flags |= F_ALT; continue;
+        case '0': arg->flags |= F_ZERO; continue;
+        }
+        break;
+    }
+
+    /* Parse width. Example: "%10s" => width=10 */
+    if (arg->ch == '*') {
+        v = unicode_format_getnextarg(ctx);
+        if (v == NULL)
+            return -1;
+        if (!PyLong_Check(v)) {
+            PyErr_SetString(PyExc_TypeError,
+                            "* wants int");
+            return -1;
+        }
+        arg->width = PyLong_AsSsize_t(v);
+        if (arg->width == -1 && PyErr_Occurred())
+            return -1;
+        if (arg->width < 0) {
+            arg->flags |= F_LJUST;
+            arg->width = -arg->width;
+        }
+        if (--ctx->fmtcnt >= 0) {
+            arg->ch = FORMAT_READ(ctx);
+            ctx->fmtpos++;
+        }
+    }
+    else if (arg->ch >= '0' && arg->ch <= '9') {
+        arg->width = arg->ch - '0';
+        while (--ctx->fmtcnt >= 0) {
+            arg->ch = FORMAT_READ(ctx);
+            ctx->fmtpos++;
+            if (arg->ch < '0' || arg->ch > '9')
+                break;
+            /* Since arg->ch is unsigned, the RHS would end up as unsigned,
+               mixing signed and unsigned comparison. Since arg->ch is between
+               '0' and '9', casting to int is safe. */
+            if (arg->width > (PY_SSIZE_T_MAX - ((int)arg->ch - '0')) / 10) {
+                PyErr_SetString(PyExc_ValueError,
+                                "width too big");
+                return -1;
+            }
+            arg->width = arg->width*10 + (arg->ch - '0');
+        }
+    }
+
+    /* Parse precision. Example: "%.3f" => prec=3 */
+    if (arg->ch == '.') {
+        arg->prec = 0;
+        if (--ctx->fmtcnt >= 0) {
+            arg->ch = FORMAT_READ(ctx);
+            ctx->fmtpos++;
+        }
+        if (arg->ch == '*') {
+            v = unicode_format_getnextarg(ctx);
+            if (v == NULL)
+                return -1;
+            if (!PyLong_Check(v)) {
+                PyErr_SetString(PyExc_TypeError,
+                                "* wants int");
+                return -1;
+            }
+            arg->prec = _PyLong_AsInt(v);
+            if (arg->prec == -1 && PyErr_Occurred())
+                return -1;
+            if (arg->prec < 0)
+                arg->prec = 0;
+            if (--ctx->fmtcnt >= 0) {
+                arg->ch = FORMAT_READ(ctx);
+                ctx->fmtpos++;
+            }
+        }
+        else if (arg->ch >= '0' && arg->ch <= '9') {
+            arg->prec = arg->ch - '0';
+            while (--ctx->fmtcnt >= 0) {
+                arg->ch = FORMAT_READ(ctx);
+                ctx->fmtpos++;
+                if (arg->ch < '0' || arg->ch > '9')
+                    break;
+                if (arg->prec > (INT_MAX - ((int)arg->ch - '0')) / 10) {
+                    PyErr_SetString(PyExc_ValueError,
+                                    "precision too big");
+                    return -1;
+                }
+                arg->prec = arg->prec*10 + (arg->ch - '0');
+            }
+        }
+    }
+
+    /* Ignore "h", "l" and "L" format prefix (ex: "%hi" or "%ls") */
+    if (ctx->fmtcnt >= 0) {
+        if (arg->ch == 'h' || arg->ch == 'l' || arg->ch == 'L') {
+            if (--ctx->fmtcnt >= 0) {
+                arg->ch = FORMAT_READ(ctx);
+                ctx->fmtpos++;
+            }
+        }
+    }
+    if (ctx->fmtcnt < 0) {
+        PyErr_SetString(PyExc_ValueError,
+                        "incomplete format");
+        return -1;
+    }
+    return 0;
+
+#undef FORMAT_READ
+}
+
+/* Format one argument. Supported conversion specifiers:
+
+   - "s", "r", "a": any type
+   - "i", "d", "u": int or float
+   - "o", "x", "X": int
+   - "e", "E", "f", "F", "g", "G": float
+   - "c": int or str (1 character)
+
+   When possible, the output is written directly into the Unicode writer
+   (ctx->writer). A string is created when padding is required.
+
+   Return 0 if the argument has been formatted into *p_str,
+          1 if the argument has been written into ctx->writer,
+         -1 on error. */
+static int
+unicode_format_arg_format(struct unicode_formatter_t *ctx,
+                          struct unicode_format_arg_t *arg,
+                          PyObject **p_str)
+{
+    PyObject *v;
+    _PyUnicodeWriter *writer = &ctx->writer;
+
+    if (ctx->fmtcnt == 0)
+        ctx->writer.overallocate = 0;
+
+    if (arg->ch == '%') {
+        if (_PyUnicodeWriter_WriteCharInline(writer, '%') < 0)
+            return -1;
+        return 1;
+    }
+
+    v = unicode_format_getnextarg(ctx);
+    if (v == NULL)
+        return -1;
+
+
+    switch (arg->ch) {
+    case 's':
+    case 'r':
+    case 'a':
+        if (PyLong_CheckExact(v) && arg->width == -1 && arg->prec == -1) {
+            /* Fast path */
+            if (_PyLong_FormatWriter(writer, v, 10, arg->flags & F_ALT) == -1)
+                return -1;
+            return 1;
+        }
+
+        if (PyUnicode_CheckExact(v) && arg->ch == 's') {
+            *p_str = v;
+            Py_INCREF(*p_str);
+        }
+        else {
+            if (arg->ch == 's')
+                *p_str = PyObject_Str(v);
+            else if (arg->ch == 'r')
+                *p_str = PyObject_Repr(v);
+            else
+                *p_str = PyObject_ASCII(v);
+        }
+        break;
+
+    case 'i':
+    case 'd':
+    case 'u':
+    case 'o':
+    case 'x':
+    case 'X':
+    {
+        int ret = mainformatlong(v, arg, p_str, writer);
+        if (ret != 0)
+            return ret;
+        arg->sign = 1;
+        break;
+    }
+
+    case 'e':
+    case 'E':
+    case 'f':
+    case 'F':
+    case 'g':
+    case 'G':
+        if (arg->width == -1 && arg->prec == -1
+            && !(arg->flags & (F_SIGN | F_BLANK)))
+        {
+            /* Fast path */
+            if (formatfloat(v, arg, NULL, writer) == -1)
+                return -1;
+            return 1;
+        }
+
+        arg->sign = 1;
+        if (formatfloat(v, arg, p_str, NULL) == -1)
+            return -1;
+        break;
+
+    case 'c':
+    {
+        Py_UCS4 ch = formatchar(v);
+        if (ch == (Py_UCS4) -1)
+            return -1;
+        if (arg->width == -1 && arg->prec == -1) {
+            /* Fast path */
+            if (_PyUnicodeWriter_WriteCharInline(writer, ch) < 0)
+                return -1;
+            return 1;
+        }
+        *p_str = PyUnicode_FromOrdinal(ch);
+        break;
+    }
+
+    default:
+        PyErr_Format(PyExc_ValueError,
+                     "unsupported format character '%c' (0x%x) "
+                     "at index %zd",
+                     (31<=arg->ch && arg->ch<=126) ? (char)arg->ch : '?',
+                     (int)arg->ch,
+                     ctx->fmtpos - 1);
+        return -1;
+    }
+    if (*p_str == NULL)
+        return -1;
+    assert (PyUnicode_Check(*p_str));
+    return 0;
+}
+
+static int
+unicode_format_arg_output(struct unicode_formatter_t *ctx,
+                          struct unicode_format_arg_t *arg,
+                          PyObject *str)
+{
+    Py_ssize_t len;
+    enum PyUnicode_Kind kind;
+    void *pbuf;
+    Py_ssize_t pindex;
+    Py_UCS4 signchar;
+    Py_ssize_t buflen;
+    Py_UCS4 maxchar;
+    Py_ssize_t sublen;
+    _PyUnicodeWriter *writer = &ctx->writer;
+    Py_UCS4 fill;
+
+    fill = ' ';
+    if (arg->sign && arg->flags & F_ZERO)
+        fill = '0';
+
+    if (PyUnicode_READY(str) == -1)
+        return -1;
+
+    len = PyUnicode_GET_LENGTH(str);
+    if ((arg->width == -1 || arg->width <= len)
+        && (arg->prec == -1 || arg->prec >= len)
+        && !(arg->flags & (F_SIGN | F_BLANK)))
+    {
+        /* Fast path */
+        if (_PyUnicodeWriter_WriteStr(writer, str) == -1)
+            return -1;
+        return 0;
+    }
+
+    /* Truncate the string for "s", "r" and "a" formats
+       if the precision is set */
+    if (arg->ch == 's' || arg->ch == 'r' || arg->ch == 'a') {
+        if (arg->prec >= 0 && len > arg->prec)
+            len = arg->prec;
+    }
+
+    /* Adjust sign and width */
+    kind = PyUnicode_KIND(str);
+    pbuf = PyUnicode_DATA(str);
+    pindex = 0;
+    signchar = '\0';
+    if (arg->sign) {
+        Py_UCS4 ch = PyUnicode_READ(kind, pbuf, pindex);
+        if (ch == '-' || ch == '+') {
+            signchar = ch;
+            len--;
+            pindex++;
+        }
+        else if (arg->flags & F_SIGN)
+            signchar = '+';
+        else if (arg->flags & F_BLANK)
+            signchar = ' ';
+        else
+            arg->sign = 0;
+    }
+    if (arg->width < len)
+        arg->width = len;
+
+    /* Prepare the writer */
+    maxchar = writer->maxchar;
+    if (!(arg->flags & F_LJUST)) {
+        if (arg->sign) {
+            if ((arg->width-1) > len)
+                maxchar = Py_MAX(maxchar, fill);
+        }
+        else {
+            if (arg->width > len)
+                maxchar = Py_MAX(maxchar, fill);
+        }
+    }
+    if (PyUnicode_MAX_CHAR_VALUE(str) > maxchar) {
+        Py_UCS4 strmaxchar = _PyUnicode_FindMaxChar(str, 0, pindex+len);
+        maxchar = Py_MAX(maxchar, strmaxchar);
+    }
+
+    buflen = arg->width;
+    if (arg->sign && len == arg->width)
+        buflen++;
+    if (_PyUnicodeWriter_Prepare(writer, buflen, maxchar) == -1)
+        return -1;
+
+    /* Write the sign if needed */
+    if (arg->sign) {
+        if (fill != ' ') {
+            PyUnicode_WRITE(writer->kind, writer->data, writer->pos, signchar);
+            writer->pos += 1;
+        }
+        if (arg->width > len)
+            arg->width--;
+    }
+
+    /* Write the numeric prefix for "x", "X" and "o" formats
+       if the alternate form is used.
+       For example, write "0x" for the "%#x" format. */
+    if ((arg->flags & F_ALT) && (arg->ch == 'x' || arg->ch == 'X' || arg->ch == 'o')) {
+        assert(PyUnicode_READ(kind, pbuf, pindex) == '0');
+        assert(PyUnicode_READ(kind, pbuf, pindex + 1) == arg->ch);
+        if (fill != ' ') {
+            PyUnicode_WRITE(writer->kind, writer->data, writer->pos, '0');
+            PyUnicode_WRITE(writer->kind, writer->data, writer->pos+1, arg->ch);
+            writer->pos += 2;
+            pindex += 2;
+        }
+        arg->width -= 2;
+        if (arg->width < 0)
+            arg->width = 0;
+        len -= 2;
+    }
+
+    /* Pad left with the fill character if needed */
+    if (arg->width > len && !(arg->flags & F_LJUST)) {
+        sublen = arg->width - len;
+        FILL(writer->kind, writer->data, fill, writer->pos, sublen);
+        writer->pos += sublen;
+        arg->width = len;
+    }
+
+    /* If padding with spaces: write sign if needed and/or numeric prefix if
+       the alternate form is used */
+    if (fill == ' ') {
+        if (arg->sign) {
+            PyUnicode_WRITE(writer->kind, writer->data, writer->pos, signchar);
+            writer->pos += 1;
+        }
+        if ((arg->flags & F_ALT) && (arg->ch == 'x' || arg->ch == 'X' || arg->ch == 'o')) {
+            assert(PyUnicode_READ(kind, pbuf, pindex) == '0');
+            assert(PyUnicode_READ(kind, pbuf, pindex+1) == arg->ch);
+            PyUnicode_WRITE(writer->kind, writer->data, writer->pos, '0');
+            PyUnicode_WRITE(writer->kind, writer->data, writer->pos+1, arg->ch);
+            writer->pos += 2;
+            pindex += 2;
+        }
+    }
+
+    /* Write characters */
+    if (len) {
+        _PyUnicode_FastCopyCharacters(writer->buffer, writer->pos,
+                                      str, pindex, len);
+        writer->pos += len;
+    }
+
+    /* Pad right with the fill character if needed */
+    if (arg->width > len) {
+        sublen = arg->width - len;
+        FILL(writer->kind, writer->data, ' ', writer->pos, sublen);
+        writer->pos += sublen;
+    }
+    return 0;
+}
+
+/* Helper of PyUnicode_Format(): format one arg.
+   Return 0 on success, raise an exception and return -1 on error. */
+static int
+unicode_format_arg(struct unicode_formatter_t *ctx)
+{
+    struct unicode_format_arg_t arg;
+    PyObject *str;
+    int ret;
+
+    arg.ch = PyUnicode_READ(ctx->fmtkind, ctx->fmtdata, ctx->fmtpos);
+    arg.flags = 0;
+    arg.width = -1;
+    arg.prec = -1;
+    arg.sign = 0;
+    str = NULL;
+
+    ret = unicode_format_arg_parse(ctx, &arg);
+    if (ret == -1)
+        return -1;
+
+    ret = unicode_format_arg_format(ctx, &arg, &str);
+    if (ret == -1)
+        return -1;
+
+    if (ret != 1) {
+        ret = unicode_format_arg_output(ctx, &arg, str);
+        Py_DECREF(str);
+        if (ret == -1)
+            return -1;
+    }
+
+    if (ctx->dict && (ctx->argidx < ctx->arglen) && arg.ch != '%') {
+        PyErr_SetString(PyExc_TypeError,
+                        "not all arguments converted during string formatting");
+        return -1;
+    }
+    return 0;
+}
+
 PyObject *
 PyUnicode_Format(PyObject *format, PyObject *args)
 {
-    Py_ssize_t fmtcnt, fmtpos, arglen, argidx;
-    int args_owned = 0;
-    PyObject *dict = NULL;
-    PyObject *temp = NULL;
-    PyObject *second = NULL;
-    PyObject *uformat;
-    void *fmt;
-    enum PyUnicode_Kind kind, fmtkind;
-    _PyUnicodeWriter writer;
-    Py_ssize_t sublen;
-    Py_UCS4 maxchar;
+    struct unicode_formatter_t ctx;
 
     if (format == NULL || args == NULL) {
         PyErr_BadInternalCall();
         return NULL;
     }
-    uformat = PyUnicode_FromObject(format);
-    if (uformat == NULL)
+
+    ctx.fmtstr = PyUnicode_FromObject(format);
+    if (ctx.fmtstr == NULL)
         return NULL;
-    if (PyUnicode_READY(uformat) == -1) {
-        Py_DECREF(uformat);
+    if (PyUnicode_READY(ctx.fmtstr) == -1) {
+        Py_DECREF(ctx.fmtstr);
         return NULL;
     }
+    ctx.fmtdata = PyUnicode_DATA(ctx.fmtstr);
+    ctx.fmtkind = PyUnicode_KIND(ctx.fmtstr);
+    ctx.fmtcnt = PyUnicode_GET_LENGTH(ctx.fmtstr);
+    ctx.fmtpos = 0;
 
-    fmt = PyUnicode_DATA(uformat);
-    fmtkind = PyUnicode_KIND(uformat);
-    fmtcnt = PyUnicode_GET_LENGTH(uformat);
-    fmtpos = 0;
-
-    _PyUnicodeWriter_Init(&writer, fmtcnt + 100);
+    _PyUnicodeWriter_Init(&ctx.writer);
+    ctx.writer.min_length = ctx.fmtcnt + 100;
+    ctx.writer.overallocate = 1;
 
     if (PyTuple_Check(args)) {
-        arglen = PyTuple_Size(args);
-        argidx = 0;
+        ctx.arglen = PyTuple_Size(args);
+        ctx.argidx = 0;
     }
     else {
-        arglen = -1;
-        argidx = -2;
+        ctx.arglen = -1;
+        ctx.argidx = -2;
     }
+    ctx.args_owned = 0;
     if (PyMapping_Check(args) && !PyTuple_Check(args) && !PyUnicode_Check(args))
-        dict = args;
+        ctx.dict = args;
+    else
+        ctx.dict = NULL;
+    ctx.args = args;
 
-    while (--fmtcnt >= 0) {
-        if (PyUnicode_READ(fmtkind, fmt, fmtpos) != '%') {
+    while (--ctx.fmtcnt >= 0) {
+        if (PyUnicode_READ(ctx.fmtkind, ctx.fmtdata, ctx.fmtpos) != '%') {
             Py_ssize_t nonfmtpos;
-            nonfmtpos = fmtpos++;
-            while (fmtcnt >= 0 &&
-                   PyUnicode_READ(fmtkind, fmt, fmtpos) != '%') {
-                fmtpos++;
-                fmtcnt--;
-            }
-            if (fmtcnt < 0)
-                fmtpos--;
-            sublen = fmtpos - nonfmtpos;
-            maxchar = _PyUnicode_FindMaxChar(uformat,
-                                             nonfmtpos, nonfmtpos + sublen);
-            if (_PyUnicodeWriter_Prepare(&writer, sublen, maxchar) == -1)
-                goto onError;
 
-            _PyUnicode_FastCopyCharacters(writer.buffer, writer.pos,
-                                          uformat, nonfmtpos, sublen);
-            writer.pos += sublen;
+            nonfmtpos = ctx.fmtpos++;
+            while (ctx.fmtcnt >= 0 &&
+                   PyUnicode_READ(ctx.fmtkind, ctx.fmtdata, ctx.fmtpos) != '%') {
+                ctx.fmtpos++;
+                ctx.fmtcnt--;
+            }
+            if (ctx.fmtcnt < 0) {
+                ctx.fmtpos--;
+                ctx.writer.overallocate = 0;
+            }
+
+            if (_PyUnicodeWriter_WriteSubstring(&ctx.writer, ctx.fmtstr,
+                                                nonfmtpos, ctx.fmtpos) < 0)
+                goto onError;
         }
         else {
-            /* Got a format specifier */
-            int flags = 0;
-            Py_ssize_t width = -1;
-            int prec = -1;
-            Py_UCS4 c = '\0';
-            Py_UCS4 fill;
-            int sign;
-            Py_UCS4 signchar;
-            int isnumok;
-            PyObject *v = NULL;
-            void *pbuf = NULL;
-            Py_ssize_t pindex, len;
-            Py_UCS4 bufmaxchar;
-            Py_ssize_t buflen;
-
-            fmtpos++;
-            c = PyUnicode_READ(fmtkind, fmt, fmtpos);
-            if (c == '(') {
-                Py_ssize_t keystart;
-                Py_ssize_t keylen;
-                PyObject *key;
-                int pcount = 1;
-
-                if (dict == NULL) {
-                    PyErr_SetString(PyExc_TypeError,
-                                    "format requires a mapping");
-                    goto onError;
-                }
-                ++fmtpos;
-                --fmtcnt;
-                keystart = fmtpos;
-                /* Skip over balanced parentheses */
-                while (pcount > 0 && --fmtcnt >= 0) {
-                    c = PyUnicode_READ(fmtkind, fmt, fmtpos);
-                    if (c == ')')
-                        --pcount;
-                    else if (c == '(')
-                        ++pcount;
-                    fmtpos++;
-                }
-                keylen = fmtpos - keystart - 1;
-                if (fmtcnt < 0 || pcount > 0) {
-                    PyErr_SetString(PyExc_ValueError,
-                                    "incomplete format key");
-                    goto onError;
-                }
-                key = PyUnicode_Substring(uformat,
-                                          keystart, keystart + keylen);
-                if (key == NULL)
-                    goto onError;
-                if (args_owned) {
-                    Py_DECREF(args);
-                    args_owned = 0;
-                }
-                args = PyObject_GetItem(dict, key);
-                Py_DECREF(key);
-                if (args == NULL) {
-                    goto onError;
-                }
-                args_owned = 1;
-                arglen = -1;
-                argidx = -2;
-            }
-            while (--fmtcnt >= 0) {
-                c = PyUnicode_READ(fmtkind, fmt, fmtpos++);
-                switch (c) {
-                case '-': flags |= F_LJUST; continue;
-                case '+': flags |= F_SIGN; continue;
-                case ' ': flags |= F_BLANK; continue;
-                case '#': flags |= F_ALT; continue;
-                case '0': flags |= F_ZERO; continue;
-                }
-                break;
-            }
-            if (c == '*') {
-                v = getnextarg(args, arglen, &argidx);
-                if (v == NULL)
-                    goto onError;
-                if (!PyLong_Check(v)) {
-                    PyErr_SetString(PyExc_TypeError,
-                                    "* wants int");
-                    goto onError;
-                }
-                width = PyLong_AsSsize_t(v);
-                if (width == -1 && PyErr_Occurred())
-                    goto onError;
-                if (width < 0) {
-                    flags |= F_LJUST;
-                    width = -width;
-                }
-                if (--fmtcnt >= 0)
-                    c = PyUnicode_READ(fmtkind, fmt, fmtpos++);
-            }
-            else if (c >= '0' && c <= '9') {
-                width = c - '0';
-                while (--fmtcnt >= 0) {
-                    c = PyUnicode_READ(fmtkind, fmt, fmtpos++);
-                    if (c < '0' || c > '9')
-                        break;
-                    /* Since c is unsigned, the RHS would end up as unsigned,
-                       mixing signed and unsigned comparison. Since c is between
-                       '0' and '9', casting to int is safe. */
-                    if (width > (PY_SSIZE_T_MAX - ((int)c - '0')) / 10) {
-                        PyErr_SetString(PyExc_ValueError,
-                                        "width too big");
-                        goto onError;
-                    }
-                    width = width*10 + (c - '0');
-                }
-            }
-            if (c == '.') {
-                prec = 0;
-                if (--fmtcnt >= 0)
-                    c = PyUnicode_READ(fmtkind, fmt, fmtpos++);
-                if (c == '*') {
-                    v = getnextarg(args, arglen, &argidx);
-                    if (v == NULL)
-                        goto onError;
-                    if (!PyLong_Check(v)) {
-                        PyErr_SetString(PyExc_TypeError,
-                                        "* wants int");
-                        goto onError;
-                    }
-                    prec = _PyLong_AsInt(v);
-                    if (prec == -1 && PyErr_Occurred())
-                        goto onError;
-                    if (prec < 0)
-                        prec = 0;
-                    if (--fmtcnt >= 0)
-                        c = PyUnicode_READ(fmtkind, fmt, fmtpos++);
-                }
-                else if (c >= '0' && c <= '9') {
-                    prec = c - '0';
-                    while (--fmtcnt >= 0) {
-                        c = PyUnicode_READ(fmtkind, fmt, fmtpos++);
-                        if (c < '0' || c > '9')
-                            break;
-                        if (prec > (INT_MAX - ((int)c - '0')) / 10) {
-                            PyErr_SetString(PyExc_ValueError,
-                                            "prec too big");
-                            goto onError;
-                        }
-                        prec = prec*10 + (c - '0');
-                    }
-                }
-            } /* prec */
-            if (fmtcnt >= 0) {
-                if (c == 'h' || c == 'l' || c == 'L') {
-                    if (--fmtcnt >= 0)
-                        c = PyUnicode_READ(fmtkind, fmt, fmtpos++);
-                }
-            }
-            if (fmtcnt < 0) {
-                PyErr_SetString(PyExc_ValueError,
-                                "incomplete format");
+            ctx.fmtpos++;
+            if (unicode_format_arg(&ctx) == -1)
                 goto onError;
-            }
-            if (fmtcnt == 0)
-                writer.overallocate = 0;
+        }
+    }
 
-            if (c == '%') {
-                if (_PyUnicodeWriter_Prepare(&writer, 1, '%') == -1)
-                    goto onError;
-                PyUnicode_WRITE(writer.kind, writer.data, writer.pos, '%');
-                writer.pos += 1;
-                continue;
-            }
-
-            v = getnextarg(args, arglen, &argidx);
-            if (v == NULL)
-                goto onError;
-
-            sign = 0;
-            signchar = '\0';
-            fill = ' ';
-            switch (c) {
-
-            case 's':
-            case 'r':
-            case 'a':
-                if (PyLong_CheckExact(v) && width == -1 && prec == -1) {
-                    /* Fast path */
-                    if (_PyLong_FormatWriter(&writer, v, 10, flags & F_ALT) == -1)
-                        goto onError;
-                    goto nextarg;
-                }
-
-                if (PyUnicode_CheckExact(v) && c == 's') {
-                    temp = v;
-                    Py_INCREF(temp);
-                }
-                else {
-                    if (c == 's')
-                        temp = PyObject_Str(v);
-                    else if (c == 'r')
-                        temp = PyObject_Repr(v);
-                    else
-                        temp = PyObject_ASCII(v);
-                }
-                break;
-
-            case 'i':
-            case 'd':
-            case 'u':
-            case 'o':
-            case 'x':
-            case 'X':
-                if (PyLong_CheckExact(v)
-                    && width == -1 && prec == -1
-                    && !(flags & (F_SIGN | F_BLANK)))
-                {
-                    /* Fast path */
-                    switch(c)
-                    {
-                    case 'd':
-                    case 'i':
-                    case 'u':
-                        if (_PyLong_FormatWriter(&writer, v, 10, flags & F_ALT) == -1)
-                            goto onError;
-                        goto nextarg;
-                    case 'x':
-                        if (_PyLong_FormatWriter(&writer, v, 16, flags & F_ALT) == -1)
-                            goto onError;
-                        goto nextarg;
-                    case 'o':
-                        if (_PyLong_FormatWriter(&writer, v, 8, flags & F_ALT) == -1)
-                            goto onError;
-                        goto nextarg;
-                    default:
-                        break;
-                    }
-                }
-
-                isnumok = 0;
-                if (PyNumber_Check(v)) {
-                    PyObject *iobj=NULL;
-
-                    if (PyLong_Check(v)) {
-                        iobj = v;
-                        Py_INCREF(iobj);
-                    }
-                    else {
-                        iobj = PyNumber_Long(v);
-                    }
-                    if (iobj!=NULL) {
-                        if (PyLong_Check(iobj)) {
-                            isnumok = 1;
-                            sign = 1;
-                            temp = formatlong(iobj, flags, prec, (c == 'i'? 'd': c));
-                            Py_DECREF(iobj);
-                        }
-                        else {
-                            Py_DECREF(iobj);
-                        }
-                    }
-                }
-                if (!isnumok) {
-                    PyErr_Format(PyExc_TypeError,
-                                 "%%%c format: a number is required, "
-                                 "not %.200s", (char)c, Py_TYPE(v)->tp_name);
-                    goto onError;
-                }
-                if (flags & F_ZERO)
-                    fill = '0';
-                break;
-
-            case 'e':
-            case 'E':
-            case 'f':
-            case 'F':
-            case 'g':
-            case 'G':
-                if (width == -1 && prec == -1
-                    && !(flags & (F_SIGN | F_BLANK)))
-                {
-                    /* Fast path */
-                    if (formatfloat(v, flags, prec, c, NULL, &writer) == -1)
-                        goto onError;
-                    goto nextarg;
-                }
-
-                sign = 1;
-                if (flags & F_ZERO)
-                    fill = '0';
-                if (formatfloat(v, flags, prec, c, &temp, NULL) == -1)
-                    temp = NULL;
-                break;
-
-            case 'c':
-            {
-                Py_UCS4 ch = formatchar(v);
-                if (ch == (Py_UCS4) -1)
-                    goto onError;
-                if (width == -1 && prec == -1) {
-                    /* Fast path */
-                    if (_PyUnicodeWriter_Prepare(&writer, 1, ch) == -1)
-                        goto onError;
-                    PyUnicode_WRITE(writer.kind, writer.data, writer.pos, ch);
-                    writer.pos += 1;
-                    goto nextarg;
-                }
-                temp = PyUnicode_FromOrdinal(ch);
-                break;
-            }
-
-            default:
-                PyErr_Format(PyExc_ValueError,
-                             "unsupported format character '%c' (0x%x) "
-                             "at index %zd",
-                             (31<=c && c<=126) ? (char)c : '?',
-                             (int)c,
-                             fmtpos - 1);
-                goto onError;
-            }
-            if (temp == NULL)
-                goto onError;
-            assert (PyUnicode_Check(temp));
-
-            if (width == -1 && prec == -1
-                && !(flags & (F_SIGN | F_BLANK)))
-            {
-                /* Fast path */
-                if (_PyUnicodeWriter_WriteStr(&writer, temp) == -1)
-                    goto onError;
-                goto nextarg;
-            }
-
-            if (PyUnicode_READY(temp) == -1) {
-                Py_CLEAR(temp);
-                goto onError;
-            }
-            kind = PyUnicode_KIND(temp);
-            pbuf = PyUnicode_DATA(temp);
-            len = PyUnicode_GET_LENGTH(temp);
-
-            if (c == 's' || c == 'r' || c == 'a') {
-                if (prec >= 0 && len > prec)
-                    len = prec;
-            }
-
-            /* pbuf is initialized here. */
-            pindex = 0;
-            if (sign) {
-                Py_UCS4 ch = PyUnicode_READ(kind, pbuf, pindex);
-                if (ch == '-' || ch == '+') {
-                    signchar = ch;
-                    len--;
-                    pindex++;
-                }
-                else if (flags & F_SIGN)
-                    signchar = '+';
-                else if (flags & F_BLANK)
-                    signchar = ' ';
-                else
-                    sign = 0;
-            }
-            if (width < len)
-                width = len;
-
-            /* Compute the length and maximum character of the
-               written characters */
-            bufmaxchar = 127;
-            if (!(flags & F_LJUST)) {
-                if (sign) {
-                    if ((width-1) > len)
-                        bufmaxchar = Py_MAX(bufmaxchar, fill);
-                }
-                else {
-                    if (width > len)
-                        bufmaxchar = Py_MAX(bufmaxchar, fill);
-                }
-            }
-            maxchar = _PyUnicode_FindMaxChar(temp, 0, pindex+len);
-            bufmaxchar = Py_MAX(bufmaxchar, maxchar);
-
-            buflen = width;
-            if (sign && len == width)
-                buflen++;
-
-            if (_PyUnicodeWriter_Prepare(&writer, buflen, bufmaxchar) == -1)
-                goto onError;
-
-            /* Write characters */
-            if (sign) {
-                if (fill != ' ') {
-                    PyUnicode_WRITE(writer.kind, writer.data, writer.pos, signchar);
-                    writer.pos += 1;
-                }
-                if (width > len)
-                    width--;
-            }
-            if ((flags & F_ALT) && (c == 'x' || c == 'X' || c == 'o')) {
-                assert(PyUnicode_READ(kind, pbuf, pindex) == '0');
-                assert(PyUnicode_READ(kind, pbuf, pindex + 1) == c);
-                if (fill != ' ') {
-                    PyUnicode_WRITE(writer.kind, writer.data, writer.pos, '0');
-                    PyUnicode_WRITE(writer.kind, writer.data, writer.pos+1, c);
-                    writer.pos += 2;
-                    pindex += 2;
-                }
-                width -= 2;
-                if (width < 0)
-                    width = 0;
-                len -= 2;
-            }
-            if (width > len && !(flags & F_LJUST)) {
-                sublen = width - len;
-                FILL(writer.kind, writer.data, fill, writer.pos, sublen);
-                writer.pos += sublen;
-                width = len;
-            }
-            if (fill == ' ') {
-                if (sign) {
-                    PyUnicode_WRITE(writer.kind, writer.data, writer.pos, signchar);
-                    writer.pos += 1;
-                }
-                if ((flags & F_ALT) && (c == 'x' || c == 'X' || c == 'o')) {
-                    assert(PyUnicode_READ(kind, pbuf, pindex) == '0');
-                    assert(PyUnicode_READ(kind, pbuf, pindex+1) == c);
-                    PyUnicode_WRITE(writer.kind, writer.data, writer.pos, '0');
-                    PyUnicode_WRITE(writer.kind, writer.data, writer.pos+1, c);
-                    writer.pos += 2;
-                    pindex += 2;
-                }
-            }
-
-            if (len) {
-                _PyUnicode_FastCopyCharacters(writer.buffer, writer.pos,
-                                              temp, pindex, len);
-                writer.pos += len;
-            }
-            if (width > len) {
-                sublen = width - len;
-                FILL(writer.kind, writer.data, ' ', writer.pos, sublen);
-                writer.pos += sublen;
-            }
-
-nextarg:
-            if (dict && (argidx < arglen) && c != '%') {
-                PyErr_SetString(PyExc_TypeError,
-                                "not all arguments converted during string formatting");
-                goto onError;
-            }
-            Py_CLEAR(temp);
-        } /* '%' */
-    } /* until end */
-    if (argidx < arglen && !dict) {
+    if (ctx.argidx < ctx.arglen && !ctx.dict) {
         PyErr_SetString(PyExc_TypeError,
                         "not all arguments converted during string formatting");
         goto onError;
     }
 
-    if (args_owned) {
-        Py_DECREF(args);
+    if (ctx.args_owned) {
+        Py_DECREF(ctx.args);
     }
-    Py_DECREF(uformat);
-    Py_XDECREF(temp);
-    Py_XDECREF(second);
-    return _PyUnicodeWriter_Finish(&writer);
+    Py_DECREF(ctx.fmtstr);
+    return _PyUnicodeWriter_Finish(&ctx.writer);
 
   onError:
-    Py_DECREF(uformat);
-    Py_XDECREF(temp);
-    Py_XDECREF(second);
-    _PyUnicodeWriter_Dealloc(&writer);
-    if (args_owned) {
-        Py_DECREF(args);
+    Py_DECREF(ctx.fmtstr);
+    _PyUnicodeWriter_Dealloc(&ctx.writer);
+    if (ctx.args_owned) {
+        Py_DECREF(ctx.args);
     }
     return NULL;
 }
@@ -14263,7 +15034,7 @@
 void
 PyUnicode_InternInPlace(PyObject **p)
 {
-    register PyObject *s = *p;
+    PyObject *s = *p;
     PyObject *t;
 #ifdef Py_DEBUG
     assert(s != NULL);
@@ -14292,12 +15063,12 @@
     t = PyDict_GetItem(interned, s);
     Py_END_ALLOW_RECURSION
 
-        if (t) {
-            Py_INCREF(t);
-            Py_DECREF(*p);
-            *p = t;
-            return;
-        }
+    if (t) {
+        Py_INCREF(t);
+        Py_DECREF(*p);
+        *p = t;
+        return;
+    }
 
     PyThreadState_GET()->recursion_critical = 1;
     if (PyDict_SetItem(interned, s, s) < 0) {
@@ -14600,7 +15371,7 @@
 int
 Py_UNICODE_strncmp(const Py_UNICODE *s1, const Py_UNICODE *s2, size_t n)
 {
-    register Py_UNICODE u1, u2;
+    Py_UNICODE u1, u2;
     for (; n != 0; n--) {
         u1 = *s1;
         u2 = *s2;
diff --git a/Objects/unicodetype_db.h b/Objects/unicodetype_db.h
index 46a92bb..1fdc092 100644
--- a/Objects/unicodetype_db.h
+++ b/Objects/unicodetype_db.h
@@ -1589,7 +1589,7 @@
     55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 0, 0, 
     0, 0, 0, 55, 55, 55, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 21, 21, 
     21, 21, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 25, 25, 25, 25, 25, 25, 25, 25, 
-    25, 25, 25, 5, 0, 0, 5, 5, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 
+    25, 25, 25, 5, 21, 0, 5, 5, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 
     55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 
     55, 55, 55, 96, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 25, 25, 25, 25, 
     25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 7, 8, 
@@ -1801,7 +1801,7 @@
     25, 25, 25, 25, 25, 25, 25, 25, 5, 5, 5, 96, 5, 5, 5, 5, 55, 25, 0, 0, 7, 
     8, 9, 10, 11, 12, 13, 14, 15, 16, 0, 0, 0, 0, 0, 0, 27, 27, 27, 27, 27, 
     27, 27, 27, 27, 27, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 
-    25, 25, 25, 2, 0, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 0, 0, 0, 0, 0, 0, 
+    25, 25, 25, 21, 0, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 0, 0, 0, 0, 0, 0, 
     55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 
     55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 96, 
     55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 
@@ -1828,7 +1828,7 @@
     7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 132, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 
     5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 
     5, 5, 5, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 
-    55, 55, 55, 55, 55, 55, 55, 25, 25, 18, 18, 18, 0, 0, 5, 5, 55, 55, 55, 
+    55, 55, 55, 55, 55, 55, 55, 25, 25, 18, 18, 25, 0, 0, 5, 5, 55, 55, 55, 
     55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 
     55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 
     55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 18, 25, 18, 25, 
@@ -1915,11 +1915,11 @@
     5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 5, 5, 6, 3, 3, 21, 21, 21, 21, 21, 2, 5, 5, 
     5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 18, 18, 5, 5, 5, 5, 5, 5, 5, 5, 5, 
     5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 18, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 2, 21, 
-    21, 21, 21, 21, 0, 0, 0, 0, 0, 21, 21, 21, 21, 21, 21, 245, 95, 0, 0, 
+    21, 21, 21, 21, 0, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 245, 95, 0, 0, 
     246, 247, 248, 249, 250, 251, 5, 5, 5, 5, 5, 95, 245, 26, 22, 23, 246, 
     247, 248, 249, 250, 251, 5, 5, 5, 5, 5, 0, 95, 95, 95, 95, 95, 95, 95, 
     95, 95, 95, 95, 95, 95, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 
     25, 25, 25, 6, 6, 6, 6, 25, 6, 6, 6, 25, 25, 25, 25, 25, 25, 25, 25, 25, 
     25, 25, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 113, 5, 5, 
@@ -2593,10 +2593,10 @@
     0, 0, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 
     141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 
     141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 
-    141, 141, 141, 141, 141, 141, 141, 141, 141, 252, 252, 141, 141, 141, 
     141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 
     141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 
-    141, 141, 141, 252, 252, 141, 141, 141, 141, 141, 141, 141, 141, 141, 
+    141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 
+    141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 
     141, 141, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 
     55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 
@@ -3380,6 +3380,7 @@
     case 0x12435:
     case 0x1244A:
     case 0x12450:
+    case 0x12456:
     case 0x12459:
     case 0x1D361:
     case 0x1D7D0:
@@ -3427,6 +3428,8 @@
         return (double) 20000.0;
     case 0x3251:
         return (double) 21.0;
+    case 0x12432:
+        return (double) 216000.0;
     case 0x3252:
         return (double) 22.0;
     case 0x3253:
@@ -3534,6 +3537,7 @@
     case 0x1243B:
     case 0x1244B:
     case 0x12451:
+    case 0x12457:
     case 0x1D362:
     case 0x1D7D1:
     case 0x1D7DB:
@@ -3721,6 +3725,8 @@
         return (double) 42.0;
     case 0x32B8:
         return (double) 43.0;
+    case 0x12433:
+        return (double) 432000.0;
     case 0x32B9:
         return (double) 44.0;
     case 0x32BA:
@@ -4271,7 +4277,7 @@
 /* Returns 1 for Unicode characters having the bidirectional
  * type 'WS', 'B' or 'S' or the category 'Zs', 0 otherwise.
  */
-int _PyUnicode_IsWhitespace(register const Py_UCS4 ch)
+int _PyUnicode_IsWhitespace(const Py_UCS4 ch)
 {
     switch (ch) {
     case 0x0009:
@@ -4287,7 +4293,6 @@
     case 0x0085:
     case 0x00A0:
     case 0x1680:
-    case 0x180E:
     case 0x2000:
     case 0x2001:
     case 0x2002:
@@ -4313,7 +4318,7 @@
  * property 'BK', 'CR', 'LF' or 'NL' or having bidirectional
  * type 'B', 0 otherwise.
  */
-int _PyUnicode_IsLinebreak(register const Py_UCS4 ch)
+int _PyUnicode_IsLinebreak(const Py_UCS4 ch)
 {
     switch (ch) {
     case 0x000A:
diff --git a/Objects/weakrefobject.c b/Objects/weakrefobject.c
index b49dcee..c083f8f 100644
--- a/Objects/weakrefobject.c
+++ b/Objects/weakrefobject.c
@@ -338,6 +338,11 @@
 }
 
 
+static PyMemberDef weakref_members[] = {
+    {"__callback__", T_OBJECT, offsetof(PyWeakReference, wr_callback), READONLY},
+    {NULL} /* Sentinel */
+};
+
 PyTypeObject
 _PyWeakref_RefType = {
     PyVarObject_HEAD_INIT(&PyType_Type, 0)
@@ -369,7 +374,7 @@
     0,                          /*tp_iter*/
     0,                          /*tp_iternext*/
     0,                          /*tp_methods*/
-    0,                          /*tp_members*/
+    weakref_members,            /*tp_members*/
     0,                          /*tp_getset*/
     0,                          /*tp_base*/
     0,                          /*tp_dict*/
diff --git a/PC/VC6/_ctypes.dsp b/PC/VC6/_ctypes.dsp
deleted file mode 100644
index 1c98eac..0000000
--- a/PC/VC6/_ctypes.dsp
+++ /dev/null
@@ -1,131 +0,0 @@
-# Microsoft Developer Studio Project File - Name="_ctypes" - Package Owner=<4>

-# Microsoft Developer Studio Generated Build File, Format Version 6.00

-# ** DO NOT EDIT **

-

-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102

-

-CFG=_ctypes - Win32 Debug

-!MESSAGE This is not a valid makefile. To build this project using NMAKE,

-!MESSAGE use the Export Makefile command and run

-!MESSAGE 

-!MESSAGE NMAKE /f "_ctypes.mak".

-!MESSAGE 

-!MESSAGE You can specify a configuration when running NMAKE

-!MESSAGE by defining the macro CFG on the command line. For example:

-!MESSAGE 

-!MESSAGE NMAKE /f "_ctypes.mak" CFG="_ctypes - Win32 Debug"

-!MESSAGE 

-!MESSAGE Possible choices for configuration are:

-!MESSAGE 

-!MESSAGE "_ctypes - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")

-!MESSAGE "_ctypes - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")

-!MESSAGE 

-

-# Begin Project

-# PROP AllowPerConfigDependencies 0

-# PROP Scc_ProjName "_ctypes"

-# PROP Scc_LocalPath ".."

-CPP=cl.exe

-MTL=midl.exe

-RSC=rc.exe

-

-!IF  "$(CFG)" == "_ctypes - Win32 Release"

-

-# PROP BASE Use_MFC 0

-# PROP BASE Use_Debug_Libraries 0

-# PROP BASE Output_Dir "Release"

-# PROP BASE Intermediate_Dir "Release"

-# PROP BASE Target_Dir ""

-# PROP Use_MFC 0

-# PROP Use_Debug_Libraries 0

-# PROP Output_Dir "."

-# PROP Intermediate_Dir "x86-temp-release\_ctypes"

-# PROP Ignore_Export_Lib 0

-# PROP Target_Dir ""

-F90=df.exe

-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c

-# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\..\Include" /I ".." /I "..\..\Modules\_ctypes\libffi_msvc" /D "Py_BUILD_CORE_MODULE" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c

-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32

-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32

-# ADD BASE RSC /l 0x409 /d "NDEBUG"

-# ADD RSC /l 0x409 /d "NDEBUG"

-BSC32=bscmake.exe

-# ADD BASE BSC32 /nologo

-# ADD BSC32 /nologo

-LINK32=link.exe

-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386

-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x1d1a0000" /subsystem:windows /dll /debug /machine:I386 /out:"./_ctypes.pyd"

-# SUBTRACT LINK32 /pdb:none

-

-!ELSEIF  "$(CFG)" == "_ctypes - Win32 Debug"

-

-# PROP BASE Use_MFC 0

-# PROP BASE Use_Debug_Libraries 1

-# PROP BASE Output_Dir "Debug"

-# PROP BASE Intermediate_Dir "Debug"

-# PROP BASE Target_Dir ""

-# PROP Use_MFC 0

-# PROP Use_Debug_Libraries 1

-# PROP Output_Dir "."

-# PROP Intermediate_Dir "x86-temp-debug\_ctypes"

-# PROP Ignore_Export_Lib 0

-# PROP Target_Dir ""

-F90=df.exe

-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c

-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /I "..\..\Modules\_ctypes\libffi_msvc" /D "Py_BUILD_CORE_MODULE" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c

-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32

-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32

-# ADD BASE RSC /l 0x409 /d "_DEBUG"

-# ADD RSC /l 0x409 /d "_DEBUG"

-BSC32=bscmake.exe

-# ADD BASE BSC32 /nologo

-# ADD BSC32 /nologo

-LINK32=link.exe

-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept

-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x1d1a0000" /subsystem:windows /dll /debug /machine:I386 /out:"./_ctypes_d.pyd" /pdbtype:sept

-# SUBTRACT LINK32 /pdb:none

-

-!ENDIF 

-

-# Begin Target

-

-# Name "_ctypes - Win32 Release"

-# Name "_ctypes - Win32 Debug"

-# Begin Source File

-

-SOURCE=..\..\Modules\_ctypes\_ctypes.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\_ctypes\callbacks.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\_ctypes\callproc.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\_ctypes\cfield.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\_ctypes\libffi_msvc\ffi.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\_ctypes\malloc_closure.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\_ctypes\libffi_msvc\prep_cif.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\_ctypes\stgdict.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\_ctypes\libffi_msvc\win32.c

-# End Source File

-# End Target

-# End Project

diff --git a/PC/VC6/_ctypes_test.dsp b/PC/VC6/_ctypes_test.dsp
deleted file mode 100644
index d1eb217..0000000
--- a/PC/VC6/_ctypes_test.dsp
+++ /dev/null
@@ -1,99 +0,0 @@
-# Microsoft Developer Studio Project File - Name="_ctypes_test" - Package Owner=<4>

-# Microsoft Developer Studio Generated Build File, Format Version 6.00

-# ** DO NOT EDIT **

-

-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102

-

-CFG=_ctypes_test - Win32 Debug

-!MESSAGE This is not a valid makefile. To build this project using NMAKE,

-!MESSAGE use the Export Makefile command and run

-!MESSAGE 

-!MESSAGE NMAKE /f "_ctypes_test.mak".

-!MESSAGE 

-!MESSAGE You can specify a configuration when running NMAKE

-!MESSAGE by defining the macro CFG on the command line. For example:

-!MESSAGE 

-!MESSAGE NMAKE /f "_ctypes_test.mak" CFG="_ctypes_test - Win32 Debug"

-!MESSAGE 

-!MESSAGE Possible choices for configuration are:

-!MESSAGE 

-!MESSAGE "_ctypes_test - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")

-!MESSAGE "_ctypes_test - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")

-!MESSAGE 

-

-# Begin Project

-# PROP AllowPerConfigDependencies 0

-# PROP Scc_ProjName "_ctypes_test"

-# PROP Scc_LocalPath ".."

-CPP=cl.exe

-MTL=midl.exe

-RSC=rc.exe

-

-!IF  "$(CFG)" == "_ctypes_test - Win32 Release"

-

-# PROP BASE Use_MFC 0

-# PROP BASE Use_Debug_Libraries 0

-# PROP BASE Output_Dir "Release"

-# PROP BASE Intermediate_Dir "Release"

-# PROP BASE Target_Dir ""

-# PROP Use_MFC 0

-# PROP Use_Debug_Libraries 0

-# PROP Output_Dir "."

-# PROP Intermediate_Dir "x86-temp-release\_ctypes_test"

-# PROP Ignore_Export_Lib 0

-# PROP Target_Dir ""

-F90=df.exe

-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c

-# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\..\Include" /I ".." /D "Py_BUILD_CORE_MODULE" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c

-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32

-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32

-# ADD BASE RSC /l 0x409 /d "NDEBUG"

-# ADD RSC /l 0x409 /d "NDEBUG"

-BSC32=bscmake.exe

-# ADD BASE BSC32 /nologo

-# ADD BSC32 /nologo

-LINK32=link.exe

-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386

-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"./_ctypes_test.pyd"

-# SUBTRACT LINK32 /pdb:none

-

-!ELSEIF  "$(CFG)" == "_ctypes_test - Win32 Debug"

-

-# PROP BASE Use_MFC 0

-# PROP BASE Use_Debug_Libraries 1

-# PROP BASE Output_Dir "Debug"

-# PROP BASE Intermediate_Dir "Debug"

-# PROP BASE Target_Dir ""

-# PROP Use_MFC 0

-# PROP Use_Debug_Libraries 1

-# PROP Output_Dir "."

-# PROP Intermediate_Dir "x86-temp-debug\_ctypes_test"

-# PROP Ignore_Export_Lib 0

-# PROP Target_Dir ""

-F90=df.exe

-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c

-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /D "Py_BUILD_CORE_MODULE" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c

-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32

-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32

-# ADD BASE RSC /l 0x409 /d "_DEBUG"

-# ADD RSC /l 0x409 /d "_DEBUG"

-BSC32=bscmake.exe

-# ADD BASE BSC32 /nologo

-# ADD BSC32 /nologo

-LINK32=link.exe

-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept

-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"./_ctypes_test_d.pyd" /pdbtype:sept

-# SUBTRACT LINK32 /pdb:none

-

-!ENDIF 

-

-# Begin Target

-

-# Name "_ctypes_test - Win32 Release"

-# Name "_ctypes_test - Win32 Debug"

-# Begin Source File

-

-SOURCE=..\..\Modules\_ctypes\_ctypes_test.c

-# End Source File

-# End Target

-# End Project

diff --git a/PC/VC6/_elementtree.dsp b/PC/VC6/_elementtree.dsp
deleted file mode 100644
index 8dc0cdd..0000000
--- a/PC/VC6/_elementtree.dsp
+++ /dev/null
@@ -1,111 +0,0 @@
-# Microsoft Developer Studio Project File - Name="_elementtree" - Package Owner=<4>

-# Microsoft Developer Studio Generated Build File, Format Version 6.00

-# ** DO NOT EDIT **

-

-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102

-

-CFG=_elementtree - Win32 Debug

-!MESSAGE This is not a valid makefile. To build this project using NMAKE,

-!MESSAGE use the Export Makefile command and run

-!MESSAGE 

-!MESSAGE NMAKE /f "_elementtree.mak".

-!MESSAGE 

-!MESSAGE You can specify a configuration when running NMAKE

-!MESSAGE by defining the macro CFG on the command line. For example:

-!MESSAGE 

-!MESSAGE NMAKE /f "_elementtree.mak" CFG="_elementtree - Win32 Debug"

-!MESSAGE 

-!MESSAGE Possible choices for configuration are:

-!MESSAGE 

-!MESSAGE "_elementtree - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")

-!MESSAGE "_elementtree - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")

-!MESSAGE 

-

-# Begin Project

-# PROP AllowPerConfigDependencies 0

-# PROP Scc_ProjName "_elementtree"

-# PROP Scc_LocalPath ".."

-CPP=cl.exe

-MTL=midl.exe

-RSC=rc.exe

-

-!IF  "$(CFG)" == "_elementtree - Win32 Release"

-

-# PROP BASE Use_MFC 0

-# PROP BASE Use_Debug_Libraries 0

-# PROP BASE Output_Dir "Release"

-# PROP BASE Intermediate_Dir "Release"

-# PROP BASE Target_Dir ""

-# PROP Use_MFC 0

-# PROP Use_Debug_Libraries 0

-# PROP Output_Dir "."

-# PROP Intermediate_Dir "x86-temp-release\_elementtree"

-# PROP Ignore_Export_Lib 0

-# PROP Target_Dir ""

-F90=df.exe

-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c

-# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\..\Include" /I ".." /I "..\..\Modules\expat" /D "Py_BUILD_CORE_MODULE" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "XML_NS" /D "XML_DTD" /D "BYTEORDER=1234" /D "XML_CONTEXT_BYTES=1024" /D "USE_PYEXPAT_CAPI" /D "XML_STATIC" /D "HAVE_MEMMOVE" /YX /FD /c

-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32

-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32

-# ADD BASE RSC /l 0x409 /d "NDEBUG"

-# ADD RSC /l 0x409 /d "NDEBUG"

-BSC32=bscmake.exe

-# ADD BASE BSC32 /nologo

-# ADD BSC32 /nologo

-LINK32=link.exe

-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386

-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x1d100000" /subsystem:windows /dll /debug /machine:I386 /out:"./_elementtree.pyd"

-# SUBTRACT LINK32 /pdb:none

-

-!ELSEIF  "$(CFG)" == "_elementtree - Win32 Debug"

-

-# PROP BASE Use_MFC 0

-# PROP BASE Use_Debug_Libraries 1

-# PROP BASE Output_Dir "Debug"

-# PROP BASE Intermediate_Dir "Debug"

-# PROP BASE Target_Dir ""

-# PROP Use_MFC 0

-# PROP Use_Debug_Libraries 1

-# PROP Output_Dir "."

-# PROP Intermediate_Dir "x86-temp-debug\_elementtree"

-# PROP Ignore_Export_Lib 0

-# PROP Target_Dir ""

-F90=df.exe

-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c

-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /I "..\..\Modules\expat" /D "Py_BUILD_CORE_MODULE" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "XML_NS" /D "XML_DTD" /D "BYTEORDER=1234" /D "XML_CONTEXT_BYTES=1024" /D "USE_PYEXPAT_CAPI" /D "XML_STATIC" /D "HAVE_MEMMOVE" /YX /FD /c

-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32

-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32

-# ADD BASE RSC /l 0x409 /d "_DEBUG"

-# ADD RSC /l 0x409 /d "_DEBUG"

-BSC32=bscmake.exe

-# ADD BASE BSC32 /nologo

-# ADD BSC32 /nologo

-LINK32=link.exe

-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept

-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x1d100000" /subsystem:windows /dll /debug /machine:I386 /out:"./_elementtree_d.pyd" /pdbtype:sept

-# SUBTRACT LINK32 /pdb:none

-

-!ENDIF 

-

-# Begin Target

-

-# Name "_elementtree - Win32 Release"

-# Name "_elementtree - Win32 Debug"

-# Begin Source File

-

-SOURCE=..\..\Modules\_elementtree.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\expat\xmlparse.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\expat\xmlrole.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\expat\xmltok.c

-# End Source File

-# End Target

-# End Project

diff --git a/PC/VC6/_msi.dsp b/PC/VC6/_msi.dsp
deleted file mode 100644
index 76a61bc..0000000
--- a/PC/VC6/_msi.dsp
+++ /dev/null
@@ -1,99 +0,0 @@
-# Microsoft Developer Studio Project File - Name="_msi" - Package Owner=<4>

-# Microsoft Developer Studio Generated Build File, Format Version 6.00

-# ** DO NOT EDIT **

-

-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102

-

-CFG=_msi - Win32 Debug

-!MESSAGE This is not a valid makefile. To build this project using NMAKE,

-!MESSAGE use the Export Makefile command and run

-!MESSAGE 

-!MESSAGE NMAKE /f "_msi.mak".

-!MESSAGE 

-!MESSAGE You can specify a configuration when running NMAKE

-!MESSAGE by defining the macro CFG on the command line. For example:

-!MESSAGE 

-!MESSAGE NMAKE /f "_msi.mak" CFG="_msi - Win32 Debug"

-!MESSAGE 

-!MESSAGE Possible choices for configuration are:

-!MESSAGE 

-!MESSAGE "_msi - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")

-!MESSAGE "_msi - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")

-!MESSAGE 

-

-# Begin Project

-# PROP AllowPerConfigDependencies 0

-# PROP Scc_ProjName "_msi"

-# PROP Scc_LocalPath ".."

-CPP=cl.exe

-MTL=midl.exe

-RSC=rc.exe

-

-!IF  "$(CFG)" == "_msi - Win32 Release"

-

-# PROP BASE Use_MFC 0

-# PROP BASE Use_Debug_Libraries 0

-# PROP BASE Output_Dir "Release"

-# PROP BASE Intermediate_Dir "Release"

-# PROP BASE Target_Dir ""

-# PROP Use_MFC 0

-# PROP Use_Debug_Libraries 0

-# PROP Output_Dir "."

-# PROP Intermediate_Dir "x86-temp-release\_msi"

-# PROP Ignore_Export_Lib 0

-# PROP Target_Dir ""

-F90=df.exe

-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c

-# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\..\Include" /I ".." /D "Py_BUILD_CORE_MODULE" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c

-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32

-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32

-# ADD BASE RSC /l 0x409 /d "NDEBUG"

-# ADD RSC /l 0x409 /d "NDEBUG"

-BSC32=bscmake.exe

-# ADD BASE BSC32 /nologo

-# ADD BSC32 /nologo

-LINK32=link.exe

-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib fci.lib msi.lib rpcrt4.lib /nologo /subsystem:windows /dll /machine:I386

-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib fci.lib msi.lib rpcrt4.lib /nologo /base:"0x1d1a0000" /subsystem:windows /dll /debug /machine:I386 /out:"./_msi.pyd"

-# SUBTRACT LINK32 /pdb:none

-

-!ELSEIF  "$(CFG)" == "_msi - Win32 Debug"

-

-# PROP BASE Use_MFC 0

-# PROP BASE Use_Debug_Libraries 1

-# PROP BASE Output_Dir "Debug"

-# PROP BASE Intermediate_Dir "Debug"

-# PROP BASE Target_Dir ""

-# PROP Use_MFC 0

-# PROP Use_Debug_Libraries 1

-# PROP Output_Dir "."

-# PROP Intermediate_Dir "x86-temp-debug\_msi"

-# PROP Ignore_Export_Lib 0

-# PROP Target_Dir ""

-F90=df.exe

-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c

-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /D "Py_BUILD_CORE_MODULE" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c

-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32

-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32

-# ADD BASE RSC /l 0x409 /d "_DEBUG"

-# ADD RSC /l 0x409 /d "_DEBUG"

-BSC32=bscmake.exe

-# ADD BASE BSC32 /nologo

-# ADD BSC32 /nologo

-LINK32=link.exe

-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib fci.lib msi.lib rpcrt4.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept

-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib fci.lib msi.lib rpcrt4.lib /nologo /base:"0x1d1a0000" /subsystem:windows /dll /debug /machine:I386 /out:"./_msi_d.pyd" /pdbtype:sept

-# SUBTRACT LINK32 /pdb:none

-

-!ENDIF 

-

-# Begin Target

-

-# Name "_msi - Win32 Release"

-# Name "_msi - Win32 Debug"

-# Begin Source File

-

-SOURCE=..\..\PC\_msi.c

-# End Source File

-# End Target

-# End Project

diff --git a/PC/VC6/_multiprocessing.dsp b/PC/VC6/_multiprocessing.dsp
deleted file mode 100644
index e1b8470..0000000
--- a/PC/VC6/_multiprocessing.dsp
+++ /dev/null
@@ -1,107 +0,0 @@
-# Microsoft Developer Studio Project File - Name="_multiprocessing" - Package Owner=<4>

-# Microsoft Developer Studio Generated Build File, Format Version 6.00

-# ** DO NOT EDIT **

-

-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102

-

-CFG=_multiprocessing - Win32 Debug

-!MESSAGE This is not a valid makefile. To build this project using NMAKE,

-!MESSAGE use the Export Makefile command and run

-!MESSAGE 

-!MESSAGE NMAKE /f "_multiprocessing.mak".

-!MESSAGE 

-!MESSAGE You can specify a configuration when running NMAKE

-!MESSAGE by defining the macro CFG on the command line. For example:

-!MESSAGE 

-!MESSAGE NMAKE /f "_multiprocessing.mak" CFG="_multiprocessing - Win32 Debug"

-!MESSAGE 

-!MESSAGE Possible choices for configuration are:

-!MESSAGE 

-!MESSAGE "_multiprocessing - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")

-!MESSAGE "_multiprocessing - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")

-!MESSAGE 

-

-# Begin Project

-# PROP AllowPerConfigDependencies 0

-# PROP Scc_ProjName "_multiprocessing"

-# PROP Scc_LocalPath ".."

-CPP=cl.exe

-MTL=midl.exe

-RSC=rc.exe

-

-!IF  "$(CFG)" == "_multiprocessing - Win32 Release"

-

-# PROP BASE Use_MFC 0

-# PROP BASE Use_Debug_Libraries 0

-# PROP BASE Output_Dir "Release"

-# PROP BASE Intermediate_Dir "Release"

-# PROP BASE Target_Dir ""

-# PROP Use_MFC 0

-# PROP Use_Debug_Libraries 0

-# PROP Output_Dir "."

-# PROP Intermediate_Dir "x86-temp-release\_multiprocessing"

-# PROP Ignore_Export_Lib 0

-# PROP Target_Dir ""

-F90=df.exe

-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c

-# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\..\Include" /I ".." /D "Py_BUILD_CORE_MODULE" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c

-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32

-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32

-# ADD BASE RSC /l 0x409 /d "NDEBUG"

-# ADD RSC /l 0x409 /d "NDEBUG"

-BSC32=bscmake.exe

-# ADD BASE BSC32 /nologo

-# ADD BSC32 /nologo

-LINK32=link.exe

-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386

-# ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /base:"0x1e1D0000" /subsystem:windows /dll /debug /machine:I386 /out:"./_multiprocessing.pyd"

-# SUBTRACT LINK32 /pdb:none

-

-!ELSEIF  "$(CFG)" == "_multiprocessing - Win32 Debug"

-

-# PROP BASE Use_MFC 0

-# PROP BASE Use_Debug_Libraries 1

-# PROP BASE Output_Dir "Debug"

-# PROP BASE Intermediate_Dir "Debug"

-# PROP BASE Target_Dir ""

-# PROP Use_MFC 0

-# PROP Use_Debug_Libraries 1

-# PROP Output_Dir "."

-# PROP Intermediate_Dir "x86-temp-debug\_multiprocessing"

-# PROP Ignore_Export_Lib 0

-# PROP Target_Dir ""

-F90=df.exe

-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c

-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /D "Py_BUILD_CORE_MODULE" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c

-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32

-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32

-# ADD BASE RSC /l 0x409 /d "_DEBUG"

-# ADD RSC /l 0x409 /d "_DEBUG"

-BSC32=bscmake.exe

-# ADD BASE BSC32 /nologo

-# ADD BSC32 /nologo

-LINK32=link.exe

-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept

-# ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /base:"0x1e1d0000" /subsystem:windows /dll /debug /machine:I386 /out:"./_multiprocessing_d.pyd" /pdbtype:sept

-# SUBTRACT LINK32 /pdb:none

-

-!ENDIF 

-

-# Begin Target

-

-# Name "_multiprocessing - Win32 Release"

-# Name "_multiprocessing - Win32 Debug"

-# Begin Source File

-

-SOURCE=..\..\Modules\_multiprocessing\multiprocessing.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\_multiprocessing\semaphore.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\_multiprocessing\win32_functions.c

-# End Source File

-# End Target

-# End Project

diff --git a/PC/VC6/_socket.dsp b/PC/VC6/_socket.dsp
deleted file mode 100644
index 55ee8f2..0000000
--- a/PC/VC6/_socket.dsp
+++ /dev/null
@@ -1,99 +0,0 @@
-# Microsoft Developer Studio Project File - Name="_socket" - Package Owner=<4>

-# Microsoft Developer Studio Generated Build File, Format Version 6.00

-# ** DO NOT EDIT **

-

-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102

-

-CFG=_socket - Win32 Debug

-!MESSAGE This is not a valid makefile. To build this project using NMAKE,

-!MESSAGE use the Export Makefile command and run

-!MESSAGE 

-!MESSAGE NMAKE /f "_socket.mak".

-!MESSAGE 

-!MESSAGE You can specify a configuration when running NMAKE

-!MESSAGE by defining the macro CFG on the command line. For example:

-!MESSAGE 

-!MESSAGE NMAKE /f "_socket.mak" CFG="_socket - Win32 Debug"

-!MESSAGE 

-!MESSAGE Possible choices for configuration are:

-!MESSAGE 

-!MESSAGE "_socket - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")

-!MESSAGE "_socket - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")

-!MESSAGE 

-

-# Begin Project

-# PROP AllowPerConfigDependencies 0

-# PROP Scc_ProjName "_socket"

-# PROP Scc_LocalPath ".."

-CPP=cl.exe

-MTL=midl.exe

-RSC=rc.exe

-

-!IF  "$(CFG)" == "_socket - Win32 Release"

-

-# PROP BASE Use_MFC 0

-# PROP BASE Use_Debug_Libraries 0

-# PROP BASE Output_Dir "Release"

-# PROP BASE Intermediate_Dir "Release"

-# PROP BASE Target_Dir ""

-# PROP Use_MFC 0

-# PROP Use_Debug_Libraries 0

-# PROP Output_Dir "."

-# PROP Intermediate_Dir "x86-temp-release\_socket"

-# PROP Ignore_Export_Lib 0

-# PROP Target_Dir ""

-F90=df.exe

-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c

-# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\..\Include" /I ".." /D "Py_BUILD_CORE_MODULE" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c

-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32

-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32

-# ADD BASE RSC /l 0x409 /d "NDEBUG"

-# ADD RSC /l 0x409 /d "NDEBUG"

-BSC32=bscmake.exe

-# ADD BASE BSC32 /nologo

-# ADD BSC32 /nologo

-LINK32=link.exe

-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386

-# ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /base:"0x1e1D0000" /subsystem:windows /dll /debug /machine:I386 /out:"./_socket.pyd"

-# SUBTRACT LINK32 /pdb:none

-

-!ELSEIF  "$(CFG)" == "_socket - Win32 Debug"

-

-# PROP BASE Use_MFC 0

-# PROP BASE Use_Debug_Libraries 1

-# PROP BASE Output_Dir "Debug"

-# PROP BASE Intermediate_Dir "Debug"

-# PROP BASE Target_Dir ""

-# PROP Use_MFC 0

-# PROP Use_Debug_Libraries 1

-# PROP Output_Dir "."

-# PROP Intermediate_Dir "x86-temp-debug\_socket"

-# PROP Ignore_Export_Lib 0

-# PROP Target_Dir ""

-F90=df.exe

-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c

-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /D "Py_BUILD_CORE_MODULE" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c

-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32

-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32

-# ADD BASE RSC /l 0x409 /d "_DEBUG"

-# ADD RSC /l 0x409 /d "_DEBUG"

-BSC32=bscmake.exe

-# ADD BASE BSC32 /nologo

-# ADD BSC32 /nologo

-LINK32=link.exe

-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept

-# ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /base:"0x1e1D0000" /subsystem:windows /dll /debug /machine:I386 /out:"./_socket_d.pyd" /pdbtype:sept

-# SUBTRACT LINK32 /pdb:none

-

-!ENDIF 

-

-# Begin Target

-

-# Name "_socket - Win32 Release"

-# Name "_socket - Win32 Debug"

-# Begin Source File

-

-SOURCE=..\..\Modules\socketmodule.c

-# End Source File

-# End Target

-# End Project

diff --git a/PC/VC6/_sqlite3.dsp b/PC/VC6/_sqlite3.dsp
deleted file mode 100644
index 3869938..0000000
--- a/PC/VC6/_sqlite3.dsp
+++ /dev/null
@@ -1,131 +0,0 @@
-# Microsoft Developer Studio Project File - Name="_sqlite3" - Package Owner=<4>

-# Microsoft Developer Studio Generated Build File, Format Version 6.00

-# ** DO NOT EDIT **

-

-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102

-

-CFG=_sqlite3 - Win32 Debug

-!MESSAGE This is not a valid makefile. To build this project using NMAKE,

-!MESSAGE use the Export Makefile command and run

-!MESSAGE 

-!MESSAGE NMAKE /f "_sqlite3.mak".

-!MESSAGE 

-!MESSAGE You can specify a configuration when running NMAKE

-!MESSAGE by defining the macro CFG on the command line. For example:

-!MESSAGE 

-!MESSAGE NMAKE /f "_sqlite3.mak" CFG="_sqlite3 - Win32 Debug"

-!MESSAGE 

-!MESSAGE Possible choices for configuration are:

-!MESSAGE 

-!MESSAGE "_sqlite3 - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")

-!MESSAGE "_sqlite3 - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")

-!MESSAGE 

-

-# Begin Project

-# PROP AllowPerConfigDependencies 0

-# PROP Scc_ProjName "_sqlite3"

-# PROP Scc_LocalPath ".."

-CPP=cl.exe

-MTL=midl.exe

-RSC=rc.exe

-

-!IF  "$(CFG)" == "_sqlite3 - Win32 Release"

-

-# PROP BASE Use_MFC 0

-# PROP BASE Use_Debug_Libraries 0

-# PROP BASE Output_Dir "Release"

-# PROP BASE Intermediate_Dir "Release"

-# PROP BASE Target_Dir ""

-# PROP Use_MFC 0

-# PROP Use_Debug_Libraries 0

-# PROP Output_Dir "."

-# PROP Intermediate_Dir "x86-temp-release\_sqlite3"

-# PROP Ignore_Export_Lib 0

-# PROP Target_Dir ""

-F90=df.exe

-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c

-# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\..\Include" /I ".." /I "..\..\..\sqlite-source-3.3.4" /D "Py_BUILD_CORE_MODULE" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D MODULE_NAME=\"sqlite3\" /YX /FD /c

-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32

-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32

-# ADD BASE RSC /l 0x409 /d "NDEBUG"

-# ADD RSC /l 0x409 /d "NDEBUG"

-BSC32=bscmake.exe

-# ADD BASE BSC32 /nologo

-# ADD BSC32 /nologo

-LINK32=link.exe

-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386

-# ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\..\sqlite-source-3.3.4\sqlite3.lib /nologo /base:"0x1e180000" /subsystem:windows /dll /debug /machine:I386 /out:"./_sqlite3.pyd"

-# SUBTRACT LINK32 /pdb:none

-

-!ELSEIF  "$(CFG)" == "_sqlite3 - Win32 Debug"

-

-# PROP BASE Use_MFC 0

-# PROP BASE Use_Debug_Libraries 1

-# PROP BASE Output_Dir "Debug"

-# PROP BASE Intermediate_Dir "Debug"

-# PROP BASE Target_Dir ""

-# PROP Use_MFC 0

-# PROP Use_Debug_Libraries 1

-# PROP Output_Dir "."

-# PROP Intermediate_Dir "x86-temp-debug\_sqlite3"

-# PROP Ignore_Export_Lib 0

-# PROP Target_Dir ""

-F90=df.exe

-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c

-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /I "..\..\..\sqlite-source-3.3.4" /D "Py_BUILD_CORE_MODULE" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D MODULE_NAME=\"sqlite3\" /YX /FD /c

-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32

-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32

-# ADD BASE RSC /l 0x409 /d "_DEBUG"

-# ADD RSC /l 0x409 /d "_DEBUG"

-BSC32=bscmake.exe

-# ADD BASE BSC32 /nologo

-# ADD BSC32 /nologo

-LINK32=link.exe

-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept

-# ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\..\sqlite-source-3.3.4\sqlite3.lib /nologo /base:"0x1e180000" /subsystem:windows /dll /debug /machine:I386 /out:"./_sqlite3_d.pyd" /pdbtype:sept

-# SUBTRACT LINK32 /pdb:none

-

-!ENDIF 

-

-# Begin Target

-

-# Name "_sqlite3 - Win32 Release"

-# Name "_sqlite3 - Win32 Debug"

-# Begin Source File

-

-SOURCE=..\..\Modules\_sqlite\cache.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\_sqlite\connection.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\_sqlite\cursor.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\_sqlite\microprotocols.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\_sqlite\module.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\_sqlite\prepare_protocol.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\_sqlite\row.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\_sqlite\statement.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\_sqlite\util.c

-# End Source File

-# End Target

-# End Project

diff --git a/PC/VC6/_ssl.dsp b/PC/VC6/_ssl.dsp
deleted file mode 100644
index e8bb993..0000000
--- a/PC/VC6/_ssl.dsp
+++ /dev/null
@@ -1,89 +0,0 @@
-# Microsoft Developer Studio Project File - Name="_ssl" - Package Owner=<4>

-# Microsoft Developer Studio Generated Build File, Format Version 6.00

-# ** DO NOT EDIT **

-

-# TARGTYPE "Win32 (x86) External Target" 0x0106

-

-CFG=_ssl - Win32 Debug

-!MESSAGE This is not a valid makefile. To build this project using NMAKE,

-!MESSAGE use the Export Makefile command and run

-!MESSAGE 

-!MESSAGE NMAKE /f "_ssl.mak".

-!MESSAGE 

-!MESSAGE You can specify a configuration when running NMAKE

-!MESSAGE by defining the macro CFG on the command line. For example:

-!MESSAGE 

-!MESSAGE NMAKE /f "_ssl.mak" CFG="_ssl - Win32 Debug"

-!MESSAGE 

-!MESSAGE Possible choices for configuration are:

-!MESSAGE 

-!MESSAGE "_ssl - Win32 Release" (based on "Win32 (x86) External Target")

-!MESSAGE "_ssl - Win32 Debug" (based on "Win32 (x86) External Target")

-!MESSAGE 

-

-# Begin Project

-# PROP AllowPerConfigDependencies 0

-# PROP Scc_ProjName ""

-# PROP Scc_LocalPath ""

-

-!IF  "$(CFG)" == "_ssl - Win32 Release"

-

-# PROP BASE Use_MFC 0

-# PROP BASE Use_Debug_Libraries 0

-# PROP BASE Output_Dir "Release"

-# PROP BASE Intermediate_Dir "Release"

-# PROP BASE Cmd_Line "NMAKE /f _ssl.mak"

-# PROP BASE Rebuild_Opt "/a"

-# PROP BASE Target_File "_ssl.exe"

-# PROP BASE Bsc_Name "_ssl.bsc"

-# PROP BASE Target_Dir ""

-# PROP Use_MFC 0

-# PROP Use_Debug_Libraries 0

-# PROP Output_Dir "."

-# PROP Intermediate_Dir "x86-temp-release\_ssl"

-# PROP Cmd_Line "python build_ssl.py"

-# PROP Rebuild_Opt "-a"

-# PROP Target_File "_ssl.pyd"

-# PROP Bsc_Name ""

-# PROP Target_Dir ""

-

-!ELSEIF  "$(CFG)" == "_ssl - Win32 Debug"

-

-# PROP BASE Use_MFC 0

-# PROP BASE Use_Debug_Libraries 1

-# PROP BASE Output_Dir "x86-temp-debug\_ssl"

-# PROP BASE Intermediate_Dir "x86-temp-debug\_ssl"

-# PROP BASE Cmd_Line "NMAKE /f _ssl.mak"

-# PROP BASE Rebuild_Opt "/a"

-# PROP BASE Target_File "_ssl_d.pyd"

-# PROP BASE Bsc_Name "_ssl_d.bsc"

-# PROP BASE Target_Dir ""

-# PROP Use_MFC 0

-# PROP Use_Debug_Libraries 1

-# PROP Output_Dir "."

-# PROP Intermediate_Dir "x86-temp-debug\_ssl"

-# PROP Cmd_Line "python_d -u build_ssl.py -d"

-# PROP Rebuild_Opt "-a"

-# PROP Target_File "_ssl_d.pyd"

-# PROP Bsc_Name ""

-# PROP Target_Dir ""

-

-!ENDIF 

-

-# Begin Target

-

-# Name "_ssl - Win32 Release"

-# Name "_ssl - Win32 Debug"

-

-!IF  "$(CFG)" == "_ssl - Win32 Release"

-

-!ELSEIF  "$(CFG)" == "_ssl - Win32 Debug"

-

-!ENDIF 

-

-# Begin Source File

-

-SOURCE=..\..\Modules\_ssl.c

-# End Source File

-# End Target

-# End Project

diff --git a/PC/VC6/_ssl.mak b/PC/VC6/_ssl.mak
deleted file mode 100644
index 877a614..0000000
--- a/PC/VC6/_ssl.mak
+++ /dev/null
@@ -1,22 +0,0 @@
-
-!IFDEF DEBUG
-MODULE=_ssl_d.pyd
-TEMP_DIR=x86-temp-debug/_ssl
-CFLAGS=/Od /Zi /MDd /LDd /DDEBUG /D_DEBUG /DWIN32
-LFLAGS=/nodefaultlib:"msvcrt"
-!ELSE
-MODULE=_ssl.pyd
-TEMP_DIR=x86-temp-release/_ssl
-CFLAGS=/Ox /MD /LD /DWIN32
-LFLAGS=
-!ENDIF
-
-INCLUDES=-I ../../Include -I .. -I $(SSL_DIR)/inc32
-SSL_LIB_DIR=$(SSL_DIR)/out32
-LIBS=gdi32.lib wsock32.lib user32.lib advapi32.lib /libpath:$(SSL_LIB_DIR) libeay32.lib ssleay32.lib
-
-SOURCE=../../Modules/_ssl.c $(SSL_LIB_DIR)/libeay32.lib $(SSL_LIB_DIR)/ssleay32.lib
-
-$(MODULE): $(SOURCE) ../*.h ../../Include/*.h
-    @if not exist "$(TEMP_DIR)/." mkdir "$(TEMP_DIR)"
-    cl /nologo $(SOURCE) $(CFLAGS) /Fo$(TEMP_DIR)\$*.obj $(INCLUDES) /link /out:$(MODULE) $(LIBS) $(LFLAGS)
diff --git a/PC/VC6/_testcapi.dsp b/PC/VC6/_testcapi.dsp
deleted file mode 100644
index 0eaa25a..0000000
--- a/PC/VC6/_testcapi.dsp
+++ /dev/null
@@ -1,99 +0,0 @@
-# Microsoft Developer Studio Project File - Name="_testcapi" - Package Owner=<4>

-# Microsoft Developer Studio Generated Build File, Format Version 6.00

-# ** DO NOT EDIT **

-

-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102

-

-CFG=_testcapi - Win32 Debug

-!MESSAGE This is not a valid makefile. To build this project using NMAKE,

-!MESSAGE use the Export Makefile command and run

-!MESSAGE 

-!MESSAGE NMAKE /f "_testcapi.mak".

-!MESSAGE 

-!MESSAGE You can specify a configuration when running NMAKE

-!MESSAGE by defining the macro CFG on the command line. For example:

-!MESSAGE 

-!MESSAGE NMAKE /f "_testcapi.mak" CFG="_testcapi - Win32 Debug"

-!MESSAGE 

-!MESSAGE Possible choices for configuration are:

-!MESSAGE 

-!MESSAGE "_testcapi - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")

-!MESSAGE "_testcapi - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")

-!MESSAGE 

-

-# Begin Project

-# PROP AllowPerConfigDependencies 0

-# PROP Scc_ProjName "_testcapi"

-# PROP Scc_LocalPath ".."

-CPP=cl.exe

-MTL=midl.exe

-RSC=rc.exe

-

-!IF  "$(CFG)" == "_testcapi - Win32 Release"

-

-# PROP BASE Use_MFC 0

-# PROP BASE Use_Debug_Libraries 0

-# PROP BASE Output_Dir "Release"

-# PROP BASE Intermediate_Dir "Release"

-# PROP BASE Target_Dir ""

-# PROP Use_MFC 0

-# PROP Use_Debug_Libraries 0

-# PROP Output_Dir "."

-# PROP Intermediate_Dir "x86-temp-release\_testcapi"

-# PROP Ignore_Export_Lib 0

-# PROP Target_Dir ""

-F90=df.exe

-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /c

-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\Include" /I ".." /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /c

-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32

-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32

-# ADD BASE RSC /l 0xc09 /d "NDEBUG"

-# ADD RSC /l 0xc09 /d "NDEBUG"

-BSC32=bscmake.exe

-# ADD BASE BSC32 /nologo

-# ADD BSC32 /nologo

-LINK32=link.exe

-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386

-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x1e1F0000" /dll /machine:I386 /out:"./_testcapi.pyd"

-# SUBTRACT LINK32 /pdb:none

-

-!ELSEIF  "$(CFG)" == "_testcapi - Win32 Debug"

-

-# PROP BASE Use_MFC 0

-# PROP BASE Use_Debug_Libraries 1

-# PROP BASE Output_Dir "Debug"

-# PROP BASE Intermediate_Dir "Debug"

-# PROP BASE Target_Dir ""

-# PROP Use_MFC 0

-# PROP Use_Debug_Libraries 1

-# PROP Output_Dir "."

-# PROP Intermediate_Dir "x86-temp-debug\_testcapi"

-# PROP Ignore_Export_Lib 0

-# PROP Target_Dir ""

-F90=df.exe

-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /GZ /c

-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /GZ /c

-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32

-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32

-# ADD BASE RSC /l 0xc09 /d "_DEBUG"

-# ADD RSC /l 0xc09 /d "_DEBUG"

-BSC32=bscmake.exe

-# ADD BASE BSC32 /nologo

-# ADD BSC32 /nologo

-LINK32=link.exe

-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept

-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x1e1F0000" /dll /debug /machine:I386 /out:"./_testcapi_d.pyd" /pdbtype:sept

-# SUBTRACT LINK32 /pdb:none

-

-!ENDIF 

-

-# Begin Target

-

-# Name "_testcapi - Win32 Release"

-# Name "_testcapi - Win32 Debug"

-# Begin Source File

-

-SOURCE=..\..\Modules\_testcapimodule.c

-# End Source File

-# End Target

-# End Project

diff --git a/PC/VC6/_tkinter.dsp b/PC/VC6/_tkinter.dsp
deleted file mode 100644
index 5d69f59..0000000
--- a/PC/VC6/_tkinter.dsp
+++ /dev/null
@@ -1,103 +0,0 @@
-# Microsoft Developer Studio Project File - Name="_tkinter" - Package Owner=<4>

-# Microsoft Developer Studio Generated Build File, Format Version 6.00

-# ** DO NOT EDIT **

-

-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102

-

-CFG=_tkinter - Win32 Release

-!MESSAGE This is not a valid makefile. To build this project using NMAKE,

-!MESSAGE use the Export Makefile command and run

-!MESSAGE 

-!MESSAGE NMAKE /f "_tkinter.mak".

-!MESSAGE 

-!MESSAGE You can specify a configuration when running NMAKE

-!MESSAGE by defining the macro CFG on the command line. For example:

-!MESSAGE 

-!MESSAGE NMAKE /f "_tkinter.mak" CFG="_tkinter - Win32 Release"

-!MESSAGE 

-!MESSAGE Possible choices for configuration are:

-!MESSAGE 

-!MESSAGE "_tkinter - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")

-!MESSAGE "_tkinter - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")

-!MESSAGE 

-

-# Begin Project

-# PROP AllowPerConfigDependencies 0

-# PROP Scc_ProjName "_tkinter"

-# PROP Scc_LocalPath "..\..\.."

-CPP=cl.exe

-MTL=midl.exe

-RSC=rc.exe

-

-!IF  "$(CFG)" == "_tkinter - Win32 Debug"

-

-# PROP BASE Use_MFC 0

-# PROP BASE Use_Debug_Libraries 1

-# PROP BASE Output_Dir "Debug"

-# PROP BASE Intermediate_Dir "Debug"

-# PROP BASE Target_Dir ""

-# PROP Use_MFC 0

-# PROP Use_Debug_Libraries 1

-# PROP Output_Dir "."

-# PROP Intermediate_Dir "x86-temp-debug\_tkinter"

-# PROP Ignore_Export_Lib 0

-# PROP Target_Dir ""

-F90=df.exe

-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c

-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\..\tcltk\include" /I "..\..\Include" /I ".." /D "Py_BUILD_CORE_MODULE" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "WITH_APPINIT" /YX /FD /c

-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32

-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32

-# ADD BASE RSC /l 0x409 /d "_DEBUG"

-# ADD RSC /l 0x409 /d "_DEBUG"

-BSC32=bscmake.exe

-# ADD BASE BSC32 /nologo

-# ADD BSC32 /nologo

-LINK32=link.exe

-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept

-# ADD LINK32 ..\..\..\tcltk\lib\tk85g.lib ..\..\..\tcltk\lib\tcl85g.lib odbc32.lib odbccp32.lib user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1e190000" /subsystem:windows /dll /debug /machine:I386 /out:"./_tkinter_d.pyd" /pdbtype:sept

-# SUBTRACT LINK32 /pdb:none

-

-!ELSEIF  "$(CFG)" == "_tkinter - Win32 Release"

-

-# PROP BASE Use_MFC 0

-# PROP BASE Use_Debug_Libraries 0

-# PROP BASE Output_Dir "Release"

-# PROP BASE Intermediate_Dir "Release"

-# PROP BASE Target_Dir ""

-# PROP Use_MFC 0

-# PROP Use_Debug_Libraries 0

-# PROP Output_Dir "."

-# PROP Intermediate_Dir "x86-temp-release\_tkinter"

-# PROP Ignore_Export_Lib 0

-# PROP Target_Dir ""

-F90=df.exe

-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c

-# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\..\..\tcltk\include" /I "..\..\Include" /I ".." /D "Py_BUILD_CORE_MODULE" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "WITH_APPINIT" /YX /FD /c

-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32

-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32

-# ADD BASE RSC /l 0x409 /d "NDEBUG"

-# ADD RSC /l 0x409 /d "NDEBUG"

-BSC32=bscmake.exe

-# ADD BASE BSC32 /nologo

-# ADD BSC32 /nologo

-LINK32=link.exe

-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386

-# ADD LINK32 ..\..\..\tcltk\lib\tk85.lib ..\..\..\tcltk\lib\tcl85.lib odbc32.lib odbccp32.lib user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1e190000" /subsystem:windows /dll /debug /machine:I386 /out:"./_tkinter.pyd"

-# SUBTRACT LINK32 /pdb:none

-

-!ENDIF 

-

-# Begin Target

-

-# Name "_tkinter - Win32 Release"

-# Name "_tkinter - Win32 Debug"

-# Begin Source File

-

-SOURCE=..\..\Modules\_tkinter.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\tkappinit.c

-# End Source File

-# End Target

-# End Project

diff --git a/PC/VC6/build_ssl.py b/PC/VC6/build_ssl.py
deleted file mode 100644
index 95af084..0000000
--- a/PC/VC6/build_ssl.py
+++ /dev/null
@@ -1,228 +0,0 @@
-# Script for building the _ssl module for Windows.
-# Uses Perl to setup the OpenSSL environment correctly
-# and build OpenSSL, then invokes a simple nmake session
-# for _ssl.pyd itself.
-
-# THEORETICALLY, you can:
-# * Unpack the latest SSL release one level above your main Python source
-#   directory.  It is likely you will already find the zlib library and
-#   any other external packages there.
-# * Install ActivePerl and ensure it is somewhere on your path.
-# * Run this script from the PC/VC6 directory.
-#
-# it should configure and build SSL, then build the ssl Python extension
-# without intervention.
-
-# Modified by Christian Heimes
-# Now this script supports pre-generated makefiles and assembly files.
-# Developers don't need an installation of Perl anymore to build Python. A svn
-# checkout from our svn repository is enough.
-
-import os, sys, re, shutil
-
-# Find all "foo.exe" files on the PATH.
-def find_all_on_path(filename, extras = None):
-    entries = os.environ["PATH"].split(os.pathsep)
-    ret = []
-    for p in entries:
-        fname = os.path.abspath(os.path.join(p, filename))
-        if os.path.isfile(fname) and fname not in ret:
-            ret.append(fname)
-    if extras:
-        for p in extras:
-            fname = os.path.abspath(os.path.join(p, filename))
-            if os.path.isfile(fname) and fname not in ret:
-                ret.append(fname)
-    return ret
-
-# Find a suitable Perl installation for OpenSSL.
-# cygwin perl does *not* work.  ActivePerl does.
-# Being a Perl dummy, the simplest way I can check is if the "Win32" package
-# is available.
-def find_working_perl(perls):
-    for perl in perls:
-        fh = os.popen('"%s" -e "use Win32;"' % perl)
-        fh.read()
-        rc = fh.close()
-        if rc:
-            continue
-        return perl
-    print("Can not find a suitable PERL:")
-    if perls:
-        print(" the following perl interpreters were found:")
-        for p in perls:
-            print(" ", p)
-        print(" None of these versions appear suitable for building OpenSSL")
-    else:
-        print(" NO perl interpreters were found on this machine at all!")
-    print(" Please install ActivePerl and ensure it appears on your path")
-    return None
-
-# Locate the best SSL directory given a few roots to look into.
-def find_best_ssl_dir(sources):
-    candidates = []
-    for s in sources:
-        try:
-            # note: do not abspath s; the build will fail if any
-            # higher up directory name has spaces in it.
-            fnames = os.listdir(s)
-        except os.error:
-            fnames = []
-        for fname in fnames:
-            fqn = os.path.join(s, fname)
-            if os.path.isdir(fqn) and fname.startswith("openssl-"):
-                candidates.append(fqn)
-    # Now we have all the candidates, locate the best.
-    best_parts = []
-    best_name = None
-    for c in candidates:
-        parts = re.split("[.-]", os.path.basename(c))[1:]
-        # eg - openssl-0.9.7-beta1 - ignore all "beta" or any other qualifiers
-        if len(parts) >= 4:
-            continue
-        if parts > best_parts:
-            best_parts = parts
-            best_name = c
-    if best_name is not None:
-        print("Found an SSL directory at '%s'" % (best_name,))
-    else:
-        print("Could not find an SSL directory in '%s'" % (sources,))
-    sys.stdout.flush()
-    return best_name
-
-def fix_makefile(makefile):
-    """Fix some stuff in all makefiles
-    """
-    if not os.path.isfile(makefile):
-        return
-    with open(makefile) as fin:
-        lines = fin.readlines()
-    with open(makefile, 'w') as fout:
-        for line in lines:
-            if line.startswith("PERL="):
-                continue
-            if line.startswith("CP="):
-                line = "CP=copy\n"
-            if line.startswith("MKDIR="):
-                line = "MKDIR=mkdir\n"
-            if line.startswith("CFLAG="):
-                line = line.strip()
-                for algo in ("RC5", "MDC2", "IDEA"):
-                    noalgo = " -DOPENSSL_NO_%s" % algo
-                    if noalgo not in line:
-                        line = line + noalgo
-                line = line + '\n'
-            fout.write(line)
-
-def run_configure(configure, do_script):
-    print("perl Configure "+configure)
-    os.system("perl Configure "+configure)
-    print(do_script)
-    os.system(do_script)
-
-def cmp(f1, f2):
-    bufsize = 1024 * 8
-    with open(f1, 'rb') as fp1, open(f2, 'rb') as fp2:
-        while True:
-            b1 = fp1.read(bufsize)
-            b2 = fp2.read(bufsize)
-            if b1 != b2:
-                return False
-            if not b1:
-                return True
-
-def copy(src, dst):
-    if os.path.isfile(dst) and cmp(src, dst):
-        return
-    shutil.copy(src, dst)
-
-def main():
-    debug = "-d" in sys.argv
-    build_all = "-a" in sys.argv
-    if 1: # Win32
-        arch = "x86"
-        configure = "VC-WIN32"
-        do_script = "ms\\do_nasm"
-        makefile="ms\\nt.mak"
-        m32 = makefile
-        dirsuffix = "32"
-    configure += " no-idea no-rc5 no-mdc2"
-    make_flags = ""
-    if build_all:
-        make_flags = "-a"
-    # perl should be on the path, but we also look in "\perl" and "c:\\perl"
-    # as "well known" locations
-    perls = find_all_on_path("perl.exe", ["\\perl\\bin", "C:\\perl\\bin"])
-    perl = find_working_perl(perls)
-    if perl:
-        print("Found a working perl at '%s'" % (perl,))
-    else:
-        print("No Perl installation was found. Existing Makefiles are used.")
-    sys.stdout.flush()
-    # Look for SSL 3 levels up from PC/VC6 - ie, same place zlib etc all live.
-    ssl_dir = find_best_ssl_dir(("..\\..\\..",))
-    if ssl_dir is None:
-        sys.exit(1)
-
-    old_cd = os.getcwd()
-    try:
-        os.chdir(ssl_dir)
-        # If the ssl makefiles do not exist, we invoke Perl to generate them.
-        # Due to a bug in this script, the makefile sometimes ended up empty
-        # Force a regeneration if it is.
-        if not os.path.isfile(makefile) or os.path.getsize(makefile)==0:
-            if perl is None:
-                print("Perl is required to build the makefiles!")
-                sys.exit(1)
-
-            print("Creating the makefiles...")
-            sys.stdout.flush()
-            # Put our working Perl at the front of our path
-            os.environ["PATH"] = os.path.dirname(perl) + \
-                                          os.pathsep + \
-                                          os.environ["PATH"]
-            run_configure(configure, do_script)
-            if debug:
-                print("OpenSSL debug builds aren't supported.")
-            #if arch=="x86" and debug:
-            #    # the do_masm script in openssl doesn't generate a debug
-            #    # build makefile so we generate it here:
-            #    os.system("perl util\mk1mf.pl debug "+configure+" >"+makefile)
-
-            fix_makefile(makefile)
-            copy(r"crypto\buildinf.h", r"crypto\buildinf_%s.h" % arch)
-            copy(r"crypto\opensslconf.h", r"crypto\opensslconf_%s.h" % arch)
-
-        # If the assembler files don't exist in tmpXX, copy them there
-        if perl is None and os.path.exists("asm"+dirsuffix):
-            if not os.path.exists("tmp"+dirsuffix):
-                os.mkdir("tmp"+dirsuffix)
-            for f in os.listdir("asm"+dirsuffix):
-                if not f.endswith(".asm"): continue
-                if os.path.isfile(r"tmp%s\%s" % (dirsuffix, f)): continue
-                shutil.copy(r"asm%s\%s" % (dirsuffix, f), "tmp"+dirsuffix)
-
-        # Now run make.
-        copy(r"crypto\buildinf_%s.h" % arch, r"crypto\buildinf.h")
-        copy(r"crypto\opensslconf_%s.h" % arch, r"crypto\opensslconf.h")
-
-        #makeCommand = "nmake /nologo PERL=\"%s\" -f \"%s\"" %(perl, makefile)
-        makeCommand = "nmake /nologo -f \"%s\"" % makefile
-        print("Executing ssl makefiles:", makeCommand)
-        sys.stdout.flush()
-        rc = os.system(makeCommand)
-        if rc:
-            print("Executing "+makefile+" failed")
-            print(rc)
-            sys.exit(rc)
-    finally:
-        os.chdir(old_cd)
-    # And finally, we can build the _ssl module itself for Python.
-    defs = "SSL_DIR=%s" % (ssl_dir,)
-    if debug:
-        defs = defs + " " + "DEBUG=1"
-    rc = os.system('nmake /nologo -f _ssl.mak ' + defs + " " + make_flags)
-    sys.exit(rc)
-
-if __name__=='__main__':
-    main()
diff --git a/PC/VC6/build_tkinter.py b/PC/VC6/build_tkinter.py
deleted file mode 100644
index e5ca92c..0000000
--- a/PC/VC6/build_tkinter.py
+++ /dev/null
@@ -1,81 +0,0 @@
-import os
-import sys
-import subprocess
-
-TCL_MAJOR = 8
-TCL_MINOR = 5
-TCL_PATCH = 2
-
-TIX_MAJOR = 8
-TIX_MINOR = 4
-TIX_PATCH = 3
-
-def abspath(name):
-    par = os.path.pardir
-    return os.path.abspath(os.path.join(__file__, par, par, par, par, name))
-
-TCL_DIR = abspath("tcl%d.%d.%d" % (TCL_MAJOR, TCL_MINOR, TCL_PATCH))
-TK_DIR  = abspath("tk%d.%d.%d"  % (TCL_MAJOR, TCL_MINOR, TCL_PATCH))
-TIX_DIR = abspath("tix%d.%d.%d" % (TIX_MAJOR, TIX_MINOR, TIX_PATCH))
-OUT_DIR = abspath("tcltk")
-
-def have_args(*a):
-    return any(s in sys.argv[1:] for s in a)
-
-def enter(dir):
-    os.chdir(os.path.join(dir, "win"))
-
-def main():
-    debug = have_args("-d", "--debug")
-    clean = have_args("clean")
-    install = have_args("install")
-    tcl = have_args("tcl")
-    tk = have_args("tk")
-    tix = have_args("tix")
-    if not(tcl) and not(tk) and not(tix):
-        tcl = tk = tix = True
-
-    def nmake(makefile, *a):
-        args = ["nmake", "/nologo", "/f", makefile, "DEBUG=%d" % debug]
-        args.extend(a)
-        subprocess.check_call(args)
-
-    if tcl:
-        enter(TCL_DIR)
-        def nmake_tcl(*a):
-            nmake("makefile.vc", *a)
-        if clean:
-            nmake_tcl("clean")
-        elif install:
-            nmake_tcl("install", "INSTALLDIR=" + OUT_DIR)
-        else:
-            nmake_tcl()
-
-    if tk:
-        enter(TK_DIR)
-        def nmake_tk(*a):
-            nmake("makefile.vc", "TCLDIR=" + TCL_DIR, *a)
-        if clean:
-            nmake_tk("clean")
-        elif install:
-            nmake_tk("install", "INSTALLDIR=" + OUT_DIR)
-        else:
-            nmake_tk()
-
-    if tix:
-        enter(TIX_DIR)
-        def nmake_tix(*a):
-            nmake("python.mak",
-                  "TCL_MAJOR=%d" % TCL_MAJOR,
-                  "TCL_MINOR=%d" % TCL_MINOR,
-                  "TCL_PATCH=%d" % TCL_PATCH,
-                  "MACHINE=IX86", *a)
-        if clean:
-            nmake_tix("clean")
-        elif install:
-            nmake_tix("install", "INSTALL_DIR=" + OUT_DIR)
-        else:
-            nmake_tix()
-
-if __name__ == '__main__':
-    main()
diff --git a/PC/VC6/bz2.dsp b/PC/VC6/bz2.dsp
deleted file mode 100644
index 352cbad..0000000
--- a/PC/VC6/bz2.dsp
+++ /dev/null
@@ -1,99 +0,0 @@
-# Microsoft Developer Studio Project File - Name="bz2" - Package Owner=<4>

-# Microsoft Developer Studio Generated Build File, Format Version 6.00

-# ** DO NOT EDIT **

-

-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102

-

-CFG=bz2 - Win32 Debug

-!MESSAGE This is not a valid makefile. To build this project using NMAKE,

-!MESSAGE use the Export Makefile command and run

-!MESSAGE 

-!MESSAGE NMAKE /f "bz2.mak".

-!MESSAGE 

-!MESSAGE You can specify a configuration when running NMAKE

-!MESSAGE by defining the macro CFG on the command line. For example:

-!MESSAGE 

-!MESSAGE NMAKE /f "bz2.mak" CFG="bz2 - Win32 Debug"

-!MESSAGE 

-!MESSAGE Possible choices for configuration are:

-!MESSAGE 

-!MESSAGE "bz2 - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")

-!MESSAGE "bz2 - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")

-!MESSAGE 

-

-# Begin Project

-# PROP AllowPerConfigDependencies 0

-# PROP Scc_ProjName "bz2"

-# PROP Scc_LocalPath ".."

-CPP=cl.exe

-MTL=midl.exe

-RSC=rc.exe

-

-!IF  "$(CFG)" == "bz2 - Win32 Release"

-

-# PROP BASE Use_MFC 0

-# PROP BASE Use_Debug_Libraries 0

-# PROP BASE Output_Dir "Release"

-# PROP BASE Intermediate_Dir "Release"

-# PROP BASE Target_Dir ""

-# PROP Use_MFC 0

-# PROP Use_Debug_Libraries 0

-# PROP Output_Dir "."

-# PROP Intermediate_Dir "x86-temp-release\bz2"

-# PROP Ignore_Export_Lib 0

-# PROP Target_Dir ""

-F90=df.exe

-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c

-# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\..\Include" /I ".." /I "..\..\..\bzip2-1.0.6" /D "Py_BUILD_CORE_MODULE" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c

-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32

-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32

-# ADD BASE RSC /l 0x409 /d "NDEBUG"

-# ADD RSC /l 0x409 /d "NDEBUG"

-BSC32=bscmake.exe

-# ADD BASE BSC32 /nologo

-# ADD BSC32 /nologo

-LINK32=link.exe

-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386

-# ADD LINK32 ..\..\..\bzip2-1.0.6\libbz2.lib /nologo /base:"0x1D170000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"./bz2.pyd"

-# SUBTRACT LINK32 /pdb:none /nodefaultlib

-

-!ELSEIF  "$(CFG)" == "bz2 - Win32 Debug"

-

-# PROP BASE Use_MFC 0

-# PROP BASE Use_Debug_Libraries 1

-# PROP BASE Output_Dir "Debug"

-# PROP BASE Intermediate_Dir "Debug"

-# PROP BASE Target_Dir ""

-# PROP Use_MFC 0

-# PROP Use_Debug_Libraries 1

-# PROP Output_Dir "."

-# PROP Intermediate_Dir "x86-temp-debug\bz2"

-# PROP Ignore_Export_Lib 0

-# PROP Target_Dir ""

-F90=df.exe

-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c

-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /I "..\..\..\bzip2-1.0.6" /D "Py_BUILD_CORE_MODULE" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c

-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32

-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32

-# ADD BASE RSC /l 0x409 /d "_DEBUG"

-# ADD RSC /l 0x409 /d "_DEBUG"

-BSC32=bscmake.exe

-# ADD BASE BSC32 /nologo

-# ADD BSC32 /nologo

-LINK32=link.exe

-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept

-# ADD LINK32 ..\..\..\bzip2-1.0.6\libbz2.lib /nologo /base:"0x1D170000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /nodefaultlib:"libc" /out:"./bz2_d.pyd" /pdbtype:sept

-# SUBTRACT LINK32 /pdb:none

-

-!ENDIF 

-

-# Begin Target

-

-# Name "bz2 - Win32 Release"

-# Name "bz2 - Win32 Debug"

-# Begin Source File

-

-SOURCE=..\..\Modules\bz2module.c

-# End Source File

-# End Target

-# End Project

diff --git a/PC/VC6/make_versioninfo.dsp b/PC/VC6/make_versioninfo.dsp
deleted file mode 100644
index a735e12..0000000
--- a/PC/VC6/make_versioninfo.dsp
+++ /dev/null
@@ -1,108 +0,0 @@
-# Microsoft Developer Studio Project File - Name="make_versioninfo" - Package Owner=<4>

-# Microsoft Developer Studio Generated Build File, Format Version 6.00

-# ** DO NOT EDIT **

-

-# TARGTYPE "Win32 (x86) Console Application" 0x0103

-

-CFG=make_versioninfo - Win32 Release

-!MESSAGE This is not a valid makefile. To build this project using NMAKE,

-!MESSAGE use the Export Makefile command and run

-!MESSAGE 

-!MESSAGE NMAKE /f "make_versioninfo.mak".

-!MESSAGE 

-!MESSAGE You can specify a configuration when running NMAKE

-!MESSAGE by defining the macro CFG on the command line. For example:

-!MESSAGE 

-!MESSAGE NMAKE /f "make_versioninfo.mak" CFG="make_versioninfo - Win32 Release"

-!MESSAGE 

-!MESSAGE Possible choices for configuration are:

-!MESSAGE 

-!MESSAGE "make_versioninfo - Win32 Release" (based on "Win32 (x86) Console Application")

-!MESSAGE "make_versioninfo - Win32 Debug" (based on "Win32 (x86) Console Application")

-!MESSAGE 

-

-# Begin Project

-# PROP AllowPerConfigDependencies 0

-# PROP Scc_ProjName "make_versioninfo"

-# PROP Scc_LocalPath ".."

-CPP=cl.exe

-RSC=rc.exe

-

-!IF  "$(CFG)" == "make_versioninfo - Win32 Release"

-

-# PROP BASE Use_MFC 0

-# PROP BASE Use_Debug_Libraries 0

-# PROP BASE Output_Dir "Release"

-# PROP BASE Intermediate_Dir "Release"

-# PROP BASE Target_Dir ""

-# PROP Use_MFC 0

-# PROP Use_Debug_Libraries 0

-# PROP Output_Dir "."

-# PROP Intermediate_Dir "x86-temp-release\make_versioninfo"

-# PROP Ignore_Export_Lib 0

-# PROP Target_Dir ""

-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c

-# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\..\Include" /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c

-# ADD BASE RSC /l 0x409 /d "NDEBUG"

-# ADD RSC /l 0x409 /d "NDEBUG"

-BSC32=bscmake.exe

-# ADD BASE BSC32 /nologo

-# ADD BSC32 /nologo

-LINK32=link.exe

-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386

-# ADD LINK32 odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1d000000" /subsystem:console /debug /machine:I386

-# SUBTRACT LINK32 /pdb:none

-# Begin Custom Build

-InputPath=.\make_versioninfo.exe

-SOURCE="$(InputPath)"

-

-"..\pythonnt_rc.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"

-	.\make_versioninfo.exe >..\pythonnt_rc.h

-

-# End Custom Build

-

-!ELSEIF  "$(CFG)" == "make_versioninfo - Win32 Debug"

-

-# PROP BASE Use_MFC 0

-# PROP BASE Use_Debug_Libraries 1

-# PROP BASE Output_Dir "Debug"

-# PROP BASE Intermediate_Dir "Debug"

-# PROP BASE Target_Dir ""

-# PROP Use_MFC 0

-# PROP Use_Debug_Libraries 1

-# PROP Output_Dir "."

-# PROP Intermediate_Dir "x86-temp-debug\make_versioninfo"

-# PROP Ignore_Export_Lib 0

-# PROP Target_Dir ""

-# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c

-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /c

-# ADD BASE RSC /l 0x409 /d "_DEBUG"

-# ADD RSC /l 0x409 /i "..\..\Include" /d "_DEBUG"

-BSC32=bscmake.exe

-# ADD BASE BSC32 /nologo

-# ADD BSC32 /nologo

-LINK32=link.exe

-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept

-# ADD LINK32 odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1d000000" /subsystem:console /debug /machine:I386 /out:"./make_versioninfo_d.exe" /pdbtype:sept

-# SUBTRACT LINK32 /pdb:none

-# Begin Custom Build

-InputPath=.\make_versioninfo_d.exe

-SOURCE="$(InputPath)"

-

-"..\pythonnt_rc_d.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"

-	.\make_versioninfo_d.exe >..\pythonnt_rc_d.h

-

-# End Custom Build

-

-!ENDIF 

-

-# Begin Target

-

-# Name "make_versioninfo - Win32 Release"

-# Name "make_versioninfo - Win32 Debug"

-# Begin Source File

-

-SOURCE=..\make_versioninfo.c

-# End Source File

-# End Target

-# End Project

diff --git a/PC/VC6/pcbuild.dsw b/PC/VC6/pcbuild.dsw
deleted file mode 100644
index 87b2ebc..0000000
--- a/PC/VC6/pcbuild.dsw
+++ /dev/null
@@ -1,306 +0,0 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00

-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!

-

-###############################################################################

-

-Project: "_ctypes"=".\_ctypes.dsp" - Package Owner=<4>

-

-Package=<5>

-{{{

-}}}

-

-Package=<4>

-{{{

-    Begin Project Dependency

-    Project_Dep_Name pythoncore

-    End Project Dependency

-}}}

-

-###############################################################################

-

-Project: "_ctypes_test"=".\_ctypes_test.dsp" - Package Owner=<4>

-

-Package=<5>

-{{{

-}}}

-

-Package=<4>

-{{{

-}}}

-

-###############################################################################

-

-Project: "_elementtree"=".\_elementtree.dsp" - Package Owner=<4>

-

-Package=<5>

-{{{

-}}}

-

-Package=<4>

-{{{

-}}}

-

-###############################################################################

-

-Project: "_msi"=".\_msi.dsp" - Package Owner=<4>

-

-Package=<5>

-{{{

-}}}

-

-Package=<4>

-{{{

-    Begin Project Dependency

-    Project_Dep_Name pythoncore

-    End Project Dependency

-}}}

-

-###############################################################################

-

-Project: "_multiprocessing"=".\_multiprocessing.dsp" - Package Owner=<4>

-

-Package=<5>

-{{{

-}}}

-

-Package=<4>

-{{{

-    Begin Project Dependency

-    Project_Dep_Name pythoncore

-    End Project Dependency

-}}}

-

-###############################################################################

-

-Project: "_socket"=".\_socket.dsp" - Package Owner=<4>

-

-Package=<5>

-{{{

-}}}

-

-Package=<4>

-{{{

-    Begin Project Dependency

-    Project_Dep_Name pythoncore

-    End Project Dependency

-}}}

-

-###############################################################################

-

-Project: "_sqlite3"=".\_sqlite3.dsp" - Package Owner=<4>

-

-Package=<5>

-{{{

-}}}

-

-Package=<4>

-{{{

-}}}

-

-###############################################################################

-

-Project: "_ssl"=".\_ssl.dsp" - Package Owner=<4>

-

-Package=<5>

-{{{

-}}}

-

-Package=<4>

-{{{

-    Begin Project Dependency

-    Project_Dep_Name pythoncore

-    End Project Dependency

-    Begin Project Dependency

-    Project_Dep_Name python

-    End Project Dependency

-    Begin Project Dependency

-    Project_Dep_Name w9xpopen

-    End Project Dependency

-}}}

-

-###############################################################################

-

-Project: "_testcapi"=".\_testcapi.dsp" - Package Owner=<4>

-

-Package=<5>

-{{{

-}}}

-

-Package=<4>

-{{{

-    Begin Project Dependency

-    Project_Dep_Name pythoncore

-    End Project Dependency

-}}}

-

-###############################################################################

-

-Project: "_tkinter"=".\_tkinter.dsp" - Package Owner=<4>

-

-Package=<5>

-{{{

-}}}

-

-Package=<4>

-{{{

-    Begin Project Dependency

-    Project_Dep_Name pythoncore

-    End Project Dependency

-}}}

-

-###############################################################################

-

-Project: "bz2"=".\bz2.dsp" - Package Owner=<4>

-

-Package=<5>

-{{{

-}}}

-

-Package=<4>

-{{{

-}}}

-

-###############################################################################

-

-Project: "make_versioninfo"=".\make_versioninfo.dsp" - Package Owner=<4>

-

-Package=<5>

-{{{

-}}}

-

-Package=<4>

-{{{

-}}}

-

-###############################################################################

-

-Project: "pyexpat"=".\pyexpat.dsp" - Package Owner=<4>

-

-Package=<5>

-{{{

-}}}

-

-Package=<4>

-{{{

-    Begin Project Dependency

-    Project_Dep_Name pythoncore

-    End Project Dependency

-}}}

-

-###############################################################################

-

-Project: "python"=".\python.dsp" - Package Owner=<4>

-

-Package=<5>

-{{{

-}}}

-

-Package=<4>

-{{{

-    Begin Project Dependency

-    Project_Dep_Name pythoncore

-    End Project Dependency

-}}}

-

-###############################################################################

-

-Project: "pythoncore"=".\pythoncore.dsp" - Package Owner=<4>

-

-Package=<5>

-{{{

-}}}

-

-Package=<4>

-{{{

-    Begin Project Dependency

-    Project_Dep_Name make_versioninfo

-    End Project Dependency

-}}}

-

-###############################################################################

-

-Project: "pythonw"=".\pythonw.dsp" - Package Owner=<4>

-

-Package=<5>

-{{{

-}}}

-

-Package=<4>

-{{{

-    Begin Project Dependency

-    Project_Dep_Name pythoncore

-    End Project Dependency

-}}}

-

-###############################################################################

-

-Project: "select"=".\select.dsp" - Package Owner=<4>

-

-Package=<5>

-{{{

-}}}

-

-Package=<4>

-{{{

-    Begin Project Dependency

-    Project_Dep_Name pythoncore

-    End Project Dependency

-}}}

-

-###############################################################################

-

-Project: "unicodedata"=".\unicodedata.dsp" - Package Owner=<4>

-

-Package=<5>

-{{{

-}}}

-

-Package=<4>

-{{{

-    Begin Project Dependency

-    Project_Dep_Name pythoncore

-    End Project Dependency

-}}}

-

-###############################################################################

-

-Project: "w9xpopen"=".\w9xpopen.dsp" - Package Owner=<4>

-

-Package=<5>

-{{{

-}}}

-

-Package=<4>

-{{{

-}}}

-

-###############################################################################

-

-Project: "winsound"=".\winsound.dsp" - Package Owner=<4>

-

-Package=<5>

-{{{

-}}}

-

-Package=<4>

-{{{

-    Begin Project Dependency

-    Project_Dep_Name pythoncore

-    End Project Dependency

-}}}

-

-###############################################################################

-

-Global:

-

-Package=<5>

-{{{

-}}}

-

-Package=<3>

-{{{

-}}}

-

-###############################################################################

-

-

diff --git a/PC/VC6/pyexpat.dsp b/PC/VC6/pyexpat.dsp
deleted file mode 100644
index 561c9ef..0000000
--- a/PC/VC6/pyexpat.dsp
+++ /dev/null
@@ -1,111 +0,0 @@
-# Microsoft Developer Studio Project File - Name="pyexpat" - Package Owner=<4>

-# Microsoft Developer Studio Generated Build File, Format Version 6.00

-# ** DO NOT EDIT **

-

-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102

-

-CFG=pyexpat - Win32 Release

-!MESSAGE This is not a valid makefile. To build this project using NMAKE,

-!MESSAGE use the Export Makefile command and run

-!MESSAGE 

-!MESSAGE NMAKE /f "pyexpat.mak".

-!MESSAGE 

-!MESSAGE You can specify a configuration when running NMAKE

-!MESSAGE by defining the macro CFG on the command line. For example:

-!MESSAGE 

-!MESSAGE NMAKE /f "pyexpat.mak" CFG="pyexpat - Win32 Release"

-!MESSAGE 

-!MESSAGE Possible choices for configuration are:

-!MESSAGE 

-!MESSAGE "pyexpat - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")

-!MESSAGE "pyexpat - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")

-!MESSAGE 

-

-# Begin Project

-# PROP AllowPerConfigDependencies 0

-# PROP Scc_ProjName "pyexpat"

-# PROP Scc_LocalPath ".."

-CPP=cl.exe

-MTL=midl.exe

-RSC=rc.exe

-

-!IF  "$(CFG)" == "pyexpat - Win32 Release"

-

-# PROP BASE Use_MFC 0

-# PROP BASE Use_Debug_Libraries 0

-# PROP BASE Output_Dir "Release"

-# PROP BASE Intermediate_Dir "Release"

-# PROP BASE Target_Dir ""

-# PROP Use_MFC 0

-# PROP Use_Debug_Libraries 0

-# PROP Output_Dir "."

-# PROP Intermediate_Dir "x86-temp-release\pyexpat"

-# PROP Ignore_Export_Lib 0

-# PROP Target_Dir ""

-F90=df.exe

-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c

-# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\..\Include" /I ".." /I "..\..\Modules\expat" /D "Py_BUILD_CORE_MODULE" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "XML_NS" /D "XML_DTD" /D BYTEORDER=1234 /D XML_CONTEXT_BYTES=1024 /D "XML_STATIC" /D "HAVE_MEMMOVE" /YX /FD /c

-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32

-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32

-# ADD BASE RSC /l 0x409 /d "NDEBUG"

-# ADD RSC /l 0x409 /d "NDEBUG"

-BSC32=bscmake.exe

-# ADD BASE BSC32 /nologo

-# ADD BSC32 /nologo

-LINK32=link.exe

-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386

-# ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x1D100000" /subsystem:windows /dll /debug /machine:I386 /out:"./pyexpat.pyd"

-# SUBTRACT LINK32 /pdb:none

-

-!ELSEIF  "$(CFG)" == "pyexpat - Win32 Debug"

-

-# PROP BASE Use_MFC 0

-# PROP BASE Use_Debug_Libraries 1

-# PROP BASE Output_Dir "Debug"

-# PROP BASE Intermediate_Dir "Debug"

-# PROP BASE Target_Dir ""

-# PROP Use_MFC 0

-# PROP Use_Debug_Libraries 1

-# PROP Output_Dir "."

-# PROP Intermediate_Dir "x86-temp-debug\pyexpat"

-# PROP Ignore_Export_Lib 0

-# PROP Target_Dir ""

-F90=df.exe

-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c

-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /I "..\..\Modules\expat" /D "Py_BUILD_CORE_MODULE" /D "_DEBUG" /D "HAVE_EXPAT_H" /D "WIN32" /D "_WINDOWS" /D "XML_NS" /D "XML_DTD" /D BYTEORDER=1234 /D XML_CONTEXT_BYTES=1024 /D "XML_STATIC" /D "HAVE_MEMMOVE" /YX /FD /c

-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32

-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32

-# ADD BASE RSC /l 0x409 /d "_DEBUG"

-# ADD RSC /l 0x409 /d "_DEBUG"

-BSC32=bscmake.exe

-# ADD BASE BSC32 /nologo

-# ADD BSC32 /nologo

-LINK32=link.exe

-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept

-# ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x1D100000" /subsystem:windows /dll /debug /machine:I386 /out:"./pyexpat_d.pyd" /pdbtype:sept

-# SUBTRACT LINK32 /pdb:none

-

-!ENDIF 

-

-# Begin Target

-

-# Name "pyexpat - Win32 Release"

-# Name "pyexpat - Win32 Debug"

-# Begin Source File

-

-SOURCE=..\..\Modules\pyexpat.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\expat\xmlparse.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\expat\xmlrole.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\expat\xmltok.c

-# End Source File

-# End Target

-# End Project

diff --git a/PC/VC6/python.dsp b/PC/VC6/python.dsp
deleted file mode 100644
index fa8b772..0000000
--- a/PC/VC6/python.dsp
+++ /dev/null
@@ -1,100 +0,0 @@
-# Microsoft Developer Studio Project File - Name="python" - Package Owner=<4>

-# Microsoft Developer Studio Generated Build File, Format Version 6.00

-# ** DO NOT EDIT **

-

-# TARGTYPE "Win32 (x86) Console Application" 0x0103

-

-CFG=python - Win32 Release

-!MESSAGE This is not a valid makefile. To build this project using NMAKE,

-!MESSAGE use the Export Makefile command and run

-!MESSAGE 

-!MESSAGE NMAKE /f "python.mak".

-!MESSAGE 

-!MESSAGE You can specify a configuration when running NMAKE

-!MESSAGE by defining the macro CFG on the command line. For example:

-!MESSAGE 

-!MESSAGE NMAKE /f "python.mak" CFG="python - Win32 Release"

-!MESSAGE 

-!MESSAGE Possible choices for configuration are:

-!MESSAGE 

-!MESSAGE "python - Win32 Release" (based on "Win32 (x86) Console Application")

-!MESSAGE "python - Win32 Debug" (based on "Win32 (x86) Console Application")

-!MESSAGE 

-

-# Begin Project

-# PROP AllowPerConfigDependencies 0

-# PROP Scc_ProjName "python"

-# PROP Scc_LocalPath ".."

-CPP=cl.exe

-RSC=rc.exe

-

-!IF  "$(CFG)" == "python - Win32 Release"

-

-# PROP BASE Use_MFC 0

-# PROP BASE Use_Debug_Libraries 0

-# PROP BASE Output_Dir "Release"

-# PROP BASE Intermediate_Dir "Release"

-# PROP BASE Target_Dir ""

-# PROP Use_MFC 0

-# PROP Use_Debug_Libraries 0

-# PROP Output_Dir "."

-# PROP Intermediate_Dir "x86-temp-release\python"

-# PROP Ignore_Export_Lib 0

-# PROP Target_Dir ""

-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c

-# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\..\Include" /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c

-# ADD BASE RSC /l 0x409 /d "NDEBUG"

-# ADD RSC /l 0x409 /d "NDEBUG"

-BSC32=bscmake.exe

-# ADD BASE BSC32 /nologo

-# ADD BSC32 /nologo

-LINK32=link.exe

-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386

-# ADD LINK32 odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1d000000" /subsystem:console /debug /machine:I386

-# SUBTRACT LINK32 /pdb:none

-

-!ELSEIF  "$(CFG)" == "python - Win32 Debug"

-

-# PROP BASE Use_MFC 0

-# PROP BASE Use_Debug_Libraries 1

-# PROP BASE Output_Dir "Debug"

-# PROP BASE Intermediate_Dir "Debug"

-# PROP BASE Target_Dir ""

-# PROP Use_MFC 0

-# PROP Use_Debug_Libraries 1

-# PROP Output_Dir "."

-# PROP Intermediate_Dir "x86-temp-debug\python"

-# PROP Ignore_Export_Lib 0

-# PROP Target_Dir ""

-# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c

-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /c

-# ADD BASE RSC /l 0x409 /d "_DEBUG"

-# ADD RSC /l 0x409 /i "....\\Include" /d "_DEBUG"

-BSC32=bscmake.exe

-# ADD BASE BSC32 /nologo

-# ADD BSC32 /nologo

-LINK32=link.exe

-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept

-# ADD LINK32 odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1d000000" /stack:0x200000 /subsystem:console /debug /machine:I386 /out:"./python_d.exe" /pdbtype:sept

-# SUBTRACT LINK32 /pdb:none

-

-!ENDIF 

-

-# Begin Target

-

-# Name "python - Win32 Release"

-# Name "python - Win32 Debug"

-# Begin Source File

-

-SOURCE=..\pycon.ico

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\python.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\python_exe.rc

-# End Source File

-# End Target

-# End Project

diff --git a/PC/VC6/pythoncore.dsp b/PC/VC6/pythoncore.dsp
deleted file mode 100644
index 0ce98d1..0000000
--- a/PC/VC6/pythoncore.dsp
+++ /dev/null
@@ -1,780 +0,0 @@
-# Microsoft Developer Studio Project File - Name="pythoncore" - Package Owner=<4>

-# Microsoft Developer Studio Generated Build File, Format Version 6.00

-# ** DO NOT EDIT **

-

-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102

-

-CFG=pythoncore - Win32 Release

-!MESSAGE This is not a valid makefile. To build this project using NMAKE,

-!MESSAGE use the Export Makefile command and run

-!MESSAGE 

-!MESSAGE NMAKE /f "pythoncore.mak".

-!MESSAGE 

-!MESSAGE You can specify a configuration when running NMAKE

-!MESSAGE by defining the macro CFG on the command line. For example:

-!MESSAGE 

-!MESSAGE NMAKE /f "pythoncore.mak" CFG="pythoncore - Win32 Release"

-!MESSAGE 

-!MESSAGE Possible choices for configuration are:

-!MESSAGE 

-!MESSAGE "pythoncore - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")

-!MESSAGE "pythoncore - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")

-!MESSAGE 

-

-# Begin Project

-# PROP AllowPerConfigDependencies 0

-# PROP Scc_ProjName "pythoncore"

-# PROP Scc_LocalPath ".."

-CPP=cl.exe

-MTL=midl.exe

-RSC=rc.exe

-

-!IF  "$(CFG)" == "pythoncore - Win32 Release"

-

-# PROP BASE Use_MFC 0

-# PROP BASE Use_Debug_Libraries 0

-# PROP BASE Output_Dir "Release"

-# PROP BASE Intermediate_Dir "Release"

-# PROP BASE Target_Dir ""

-# PROP Use_MFC 0

-# PROP Use_Debug_Libraries 0

-# PROP Output_Dir "."

-# PROP Intermediate_Dir "x86-temp-release\pythoncore"

-# PROP Ignore_Export_Lib 0

-# PROP Target_Dir ""

-F90=df.exe

-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c

-# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\..\Include" /I ".." /I "..\..\modules\zlib" /D "Py_BUILD_CORE_MODULE" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "USE_DL_EXPORT" /YX /FD /Zm200 /c

-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL"

-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL"

-# ADD BASE RSC /l 0x409 /d "NDEBUG"

-# ADD RSC /l 0x409 /i "..\..\Include" /d "NDEBUG"

-BSC32=bscmake.exe

-# ADD BASE BSC32 /nologo

-# ADD BSC32 /nologo

-LINK32=link.exe

-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386

-# ADD LINK32 largeint.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x1e000000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"./python33.dll"

-# SUBTRACT LINK32 /pdb:none

-

-!ELSEIF  "$(CFG)" == "pythoncore - Win32 Debug"

-

-# PROP BASE Use_MFC 0

-# PROP BASE Use_Debug_Libraries 1

-# PROP BASE Output_Dir "Debug"

-# PROP BASE Intermediate_Dir "Debug"

-# PROP BASE Target_Dir ""

-# PROP Use_MFC 0

-# PROP Use_Debug_Libraries 1

-# PROP Output_Dir "."

-# PROP Intermediate_Dir "x86-temp-debug\pythoncore"

-# PROP Ignore_Export_Lib 0

-# PROP Target_Dir ""

-F90=df.exe

-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c

-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /I "..\..\modules\zlib" /D "Py_BUILD_CORE_MODULE" /D "_DEBUG" /D "USE_DL_EXPORT" /D "WIN32" /D "_WINDOWS" /YX /FD /Zm200 /c

-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL"

-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL"

-# ADD BASE RSC /l 0x409 /d "_DEBUG"

-# ADD RSC /l 0x409 /i "..\..\Include" /d "_DEBUG"

-BSC32=bscmake.exe

-# ADD BASE BSC32 /nologo

-# ADD BSC32 /nologo

-LINK32=link.exe

-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept

-# ADD LINK32 largeint.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x1e000000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"./python33_d.dll" /pdbtype:sept

-# SUBTRACT LINK32 /pdb:none

-

-!ENDIF 

-

-# Begin Target

-

-# Name "pythoncore - Win32 Release"

-# Name "pythoncore - Win32 Debug"

-# Begin Source File

-

-SOURCE=..\..\Modules\_bisectmodule.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\cjkcodecs\_codecs_cn.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\cjkcodecs\_codecs_hk.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\cjkcodecs\_codecs_iso2022.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\cjkcodecs\_codecs_jp.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\cjkcodecs\_codecs_kr.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\cjkcodecs\_codecs_tw.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\_codecsmodule.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\_collectionsmodule.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\_csv.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\_datetimemodule.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\_functoolsmodule.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\_heapqmodule.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\_io\_iomodule.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\_json.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\_localemodule.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\_lsprof.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\_math.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\_pickle.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\_randommodule.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\_sre.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\_struct.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\PC\_subprocess.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\_threadmodule.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\_time.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\_warnings.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\_weakref.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Objects\abstract.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Objects\accu.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Parser\acceler.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\zlib\adler32.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\arraymodule.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\asdl.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\ast.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\atexitmodule.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\audioop.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\binascii.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Parser\bitset.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\bltinmodule.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Objects\boolobject.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\_io\bufferedio.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Objects\bytearrayobject.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Objects\bytes_methods.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\_io\bytesio.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Objects\bytesobject.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Objects\capsule.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Objects\cellobject.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\ceval.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Objects\classobject.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\cmathmodule.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\codecs.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Objects\codeobject.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\compile.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Objects\complexobject.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\zlib\compress.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\config.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\zlib\crc32.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\dynamic_annotations.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\zlib\deflate.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Objects\descrobject.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Objects\dictobject.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\dl_nt.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\dtoa.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\dynload_win.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Objects\enumobject.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\errnomodule.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\errors.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Objects\exceptions.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\_io\fileio.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Objects\fileobject.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\fileutils.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Parser\firstsets.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Objects\floatobject.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\formatter_unicode.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Objects\frameobject.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\frozen.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Objects\funcobject.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\future.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\gcmodule.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Objects\genobject.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\getargs.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\getbuildinfo.c

-# ADD CPP /D BUILD=46

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\getcompiler.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\getcopyright.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\getopt.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\getpathp.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\getplatform.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\getversion.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\graminit.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Parser\grammar.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Parser\grammar1.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\zlib\gzio.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\import.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\importdl.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\zlib\infback.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\zlib\inffast.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\zlib\inflate.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\zlib\inftrees.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\_io\iobase.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Objects\iterobject.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\itertoolsmodule.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Parser\listnode.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Objects\listobject.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Objects\longobject.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\main.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\marshal.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\mathmodule.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\md5module.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Objects\memoryobject.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Parser\metagrammar.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Objects\methodobject.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\mmapmodule.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\modsupport.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Objects\moduleobject.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\msvcrtmodule.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\cjkcodecs\multibytecodec.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Parser\myreadline.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\mysnprintf.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\mystrtoul.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Parser\node.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Objects\object.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Objects\obmalloc.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\operator.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Parser\parser.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\parsermodule.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Parser\parsetok.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\peephole.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\posixmodule.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\pyarena.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\pyctype.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\pyfpe.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\pymath.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\pystate.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\pystrcmp.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\pystrtod.c

-# End Source File

-# Begin Source File

-

-SOURCE="..\..\Python\Python-ast.c"

-# End Source File

-# Begin Source File

-

-SOURCE=..\python_nt.rc

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\pythonrun.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\pytime.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\random.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Objects\rangeobject.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\rotatingtree.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Objects\setobject.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\sha1module.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\sha256module.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\sha512module.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\signalmodule.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Objects\sliceobject.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\_io\stringio.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\structmember.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Objects\structseq.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\symtable.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\symtablemodule.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\sysmodule.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\_io\textio.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\thread.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\timemodule.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Parser\tokenizer.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Python\traceback.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\zlib\trees.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Objects\tupleobject.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Objects\typeobject.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\zlib\uncompr.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Objects\unicodectype.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Objects\unicodeobject.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Objects\weakrefobject.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\winreg.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\xxsubtype.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\zipimport.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\zlibmodule.c

-# End Source File

-# Begin Source File

-

-SOURCE=..\..\Modules\zlib\zutil.c

-# End Source File

-# End Target

-# End Project

diff --git a/PC/VC6/pythonw.dsp b/PC/VC6/pythonw.dsp
deleted file mode 100644
index e9c325c..0000000
--- a/PC/VC6/pythonw.dsp
+++ /dev/null
@@ -1,101 +0,0 @@
-# Microsoft Developer Studio Project File - Name="pythonw" - Package Owner=<4>

-# Microsoft Developer Studio Generated Build File, Format Version 6.00

-# ** DO NOT EDIT **

-

-# TARGTYPE "Win32 (x86) Application" 0x0101

-

-CFG=pythonw - Win32 Alpha Release

-!MESSAGE This is not a valid makefile. To build this project using NMAKE,

-!MESSAGE use the Export Makefile command and run

-!MESSAGE 

-!MESSAGE NMAKE /f "pythonw.mak".

-!MESSAGE 

-!MESSAGE You can specify a configuration when running NMAKE

-!MESSAGE by defining the macro CFG on the command line. For example:

-!MESSAGE 

-!MESSAGE NMAKE /f "pythonw.mak" CFG="pythonw - Win32 Alpha Release"

-!MESSAGE 

-!MESSAGE Possible choices for configuration are:

-!MESSAGE 

-!MESSAGE "pythonw - Win32 Release" (based on "Win32 (x86) Application")

-!MESSAGE "pythonw - Win32 Debug" (based on "Win32 (x86) Application")

-!MESSAGE 

-

-# Begin Project

-# PROP AllowPerConfigDependencies 0

-# PROP Scc_ProjName "pythonw"

-# PROP Scc_LocalPath "..\pc"

-CPP=cl.exe

-MTL=midl.exe

-RSC=rc.exe

-

-!IF  "$(CFG)" == "pythonw - Win32 Release"

-

-# PROP BASE Use_MFC 0

-# PROP BASE Use_Debug_Libraries 0

-# PROP BASE Output_Dir "Release"

-# PROP BASE Intermediate_Dir "Release"

-# PROP BASE Target_Dir ""

-# PROP Use_MFC 0

-# PROP Use_Debug_Libraries 0

-# PROP Output_Dir "."

-# PROP Intermediate_Dir "x86-temp-release\pythonw"

-# PROP Ignore_Export_Lib 0

-# PROP Target_Dir ""

-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c

-# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\..\Include" /I ".." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c

-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32

-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32

-# ADD BASE RSC /l 0x409 /d "NDEBUG"

-# ADD RSC /l 0x409 /d "NDEBUG"

-BSC32=bscmake.exe

-# ADD BASE BSC32 /nologo

-# ADD BSC32 /nologo

-LINK32=link.exe

-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386

-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x1d000000" /subsystem:windows /debug /machine:I386

-# SUBTRACT LINK32 /pdb:none

-

-!ELSEIF  "$(CFG)" == "pythonw - Win32 Debug"

-

-# PROP BASE Use_MFC 0

-# PROP BASE Use_Debug_Libraries 1

-# PROP BASE Output_Dir "Debug"

-# PROP BASE Intermediate_Dir "Debug"

-# PROP BASE Target_Dir ""

-# PROP Use_MFC 0

-# PROP Use_Debug_Libraries 1

-# PROP Output_Dir "."

-# PROP Intermediate_Dir "x86-temp-debug\pythonw"

-# PROP Ignore_Export_Lib 0

-# PROP Target_Dir ""

-# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c

-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c

-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32

-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32

-# ADD BASE RSC /l 0x409 /d "_DEBUG"

-# ADD RSC /l 0x409 /d "_DEBUG"

-BSC32=bscmake.exe

-# ADD BASE BSC32 /nologo

-# ADD BSC32 /nologo

-LINK32=link.exe

-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept

-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x1d000000" /subsystem:windows /debug /machine:I386 /out:"./pythonw_d.exe" /pdbtype:sept

-# SUBTRACT LINK32 /pdb:none

-

-!ENDIF 

-

-# Begin Target

-

-# Name "pythonw - Win32 Release"

-# Name "pythonw - Win32 Debug"

-# Begin Source File

-

-SOURCE=..\python_exe.rc

-# End Source File

-# Begin Source File

-

-SOURCE=..\WinMain.c

-# End Source File

-# End Target

-# End Project

diff --git a/PC/VC6/readme.txt b/PC/VC6/readme.txt
deleted file mode 100644
index f978f85..0000000
--- a/PC/VC6/readme.txt
+++ /dev/null
@@ -1,192 +0,0 @@
-Building Python using VC++ 6.0 or 5.0
--------------------------------------
-This directory is used to build Python for Win32 platforms, e.g. Windows
-2000 and XP.  It requires Microsoft Visual C++ 6.x or 5.x and Platform
-SDK February 2003 Edition (Core SDK).
-(For other Windows platforms and compilers, see ../readme.txt.)
-
-All you need to do is open the workspace "pcbuild.dsw" in MSVC++, select
-the Debug or Release setting (using Build -> Set Active Configuration...),
-and build the projects.
-
-The proper order to build subprojects:
-
-1) pythoncore (this builds the main Python DLL and library files,
-               python33.{dll, lib} in Release mode)
-
-2) python (this builds the main Python executable,
-           python.exe in Release mode)
-
-3) the other subprojects, as desired or needed (note:  you probably don't
-   want to build most of the other subprojects, unless you're building an
-   entire Python distribution from scratch, or specifically making changes
-   to the subsystems they implement; see SUBPROJECTS below)
-
-When using the Debug setting, the output files have a _d added to
-their name:  python33_d.dll, python_d.exe, pyexpat_d.pyd, and so on.
-
-SUBPROJECTS
------------
-These subprojects should build out of the box.  Subprojects other than the
-main ones (pythoncore, python, pythonw) generally build a DLL (renamed to
-.pyd) from a specific module so that users don't have to load the code
-supporting that module unless they import the module.
-
-pythoncore
-    .dll and .lib
-python
-    .exe
-pythonw
-    pythonw.exe, a variant of python.exe that doesn't pop up a DOS box
-_msi
-    _msi.c. You need to install Windows Installer SDK to build this module.
-_socket
-    socketmodule.c
-_testcapi
-    tests of the Python C API, run via Lib/test/test_capi.py, and
-    implemented by module Modules/_testcapimodule.c
-pyexpat
-    Python wrapper for accelerated XML parsing, which incorporates stable
-    code from the Expat project:  http://sourceforge.net/projects/expat/
-select
-    selectmodule.c
-unicodedata
-    large tables of Unicode data
-winsound
-    play sounds (typically .wav files) under Windows
-
-The following subprojects will generally NOT build out of the box.  They
-wrap code Python doesn't control, and you'll need to download the base
-packages first and unpack them into siblings of PCbuilds's parent
-directory; for example, if your PCbuild is  .......\dist\src\PCbuild\,
-unpack into new subdirectories of dist\.
-
-_tkinter
-    Python wrapper for the Tk windowing system.  Requires building
-    Tcl/Tk first.  Following are instructions for Tcl/Tk 8.5.2.
-
-    Get source
-    ----------
-    In the dist directory, run
-    svn export http://svn.python.org/projects/external/tcl-8.5.2.1 tcl8.5.2
-    svn export http://svn.python.org/projects/external/tk-8.5.2.0 tk8.5.2
-    svn export http://svn.python.org/projects/external/tix-8.4.3.1 tix8.4.3
-
-    Debug Build
-    -----------
-    To build debug version, add DEBUG=1 to all nmake call bellow.
-
-    Build Tcl first (done here w/ MSVC 6 on Win2K)
-    ---------------
-    If your environment doesn't have struct _stat64, you need to apply
-    tcl852.patch in this directory to dist\tcl8.5.2\generic\tcl.h.
-
-    cd dist\tcl8.5.2\win
-    run vcvars32.bat
-    nmake -f makefile.vc
-    nmake -f makefile.vc INSTALLDIR=..\..\tcltk install
-
-    XXX Should we compile with OPTS=threads?
-
-    Optional:  run tests, via
-        nmake -f makefile.vc test
-
-        all.tcl:        Total   24242   Passed  23358   Skipped 877     Failed  7
-        Sourced 137 Test Files.
-        Files with failing tests: exec.test http.test io.test main.test string.test stri
-        ngObj.test
-
-    Build Tk
-    --------
-    cd dist\tk8.5.2\win
-    nmake -f makefile.vc TCLDIR=..\..\tcl8.5.2
-    nmake -f makefile.vc TCLDIR=..\..\tcl8.5.2 INSTALLDIR=..\..\tcltk install
-
-    XXX Should we compile with OPTS=threads?
-
-    XXX I have no idea whether "nmake -f makefile.vc test" passed or
-    XXX failed.  It popped up tons of little windows, and did lots of
-    XXX stuff, and nothing blew up.
-
-    Build Tix
-    ---------
-    cd dist\tix8.4.3\win
-    nmake -f python.mak TCL_MAJOR=8 TCL_MINOR=5 TCL_PATCH=2 MACHINE=IX86 DEBUG=0
-    nmake -f python.mak TCL_MAJOR=8 TCL_MINOR=5 TCL_PATCH=2 MACHINE=IX86 DEBUG=0 INSTALL_DIR=..\..\tcltk install
-
-bz2
-    Python wrapper for the libbz2 compression library.  Homepage
-        http://www.bzip.org/
-    Download the source from the python.org copy into the dist
-    directory:
-
-    svn export http://svn.python.org/projects/external/bzip2-1.0.6
-
-    And requires building bz2 first.
-
-    cd dist\bzip2-1.0.6
-    nmake -f makefile.msc
-
-    All of this managed to build bzip2-1.0.6\libbz2.lib, which the Python
-    project links in.
-
-
-_sqlite3
-    Python wrapper for SQLite library.
-    
-    Get the source code through
-    
-    svn export http://svn.python.org/projects/external/sqlite-source-3.3.4
-    
-    To use the extension module in a Python build tree, copy sqlite3.dll into
-    the PC/VC6 folder.
-
-
-_ssl
-    Python wrapper for the secure sockets library.
-
-    Get the latest source code for OpenSSL from
-        http://www.openssl.org
-
-    You (probably) don't want the "engine" code.  For example, don't get
-        openssl-engine-0.9.6g.tar.gz
-
-    Unpack into the "dist" directory, retaining the folder name from
-    the archive - for example, the latest stable OpenSSL will install as
-        dist/openssl-1.0.1e
-
-    You need to use version 1.0.1e of OpenSSL.
-
-    You can install the NASM assembler from
-        http://www.nasm.us/
-    for x86 builds.  Put nasmw.exe anywhere in your PATH.
-    Note: recent releases of nasm only have nasm.exe. Just rename it to 
-    nasmw.exe.
-
-    You can also install ActivePerl from
-        http://www.activestate.com/activeperl/
-    if you like to use the official sources instead of the files from 
-    python's subversion repository. The svn version contains pre-build
-    makefiles and assembly files.
-
-    The MSVC project simply invokes PC/VC6/build_ssl.py to perform
-    the build.  This Python script locates and builds your OpenSSL
-    installation, then invokes a simple makefile to build the final .pyd.
-
-    build_ssl.py attempts to catch the most common errors (such as not
-    being able to find OpenSSL sources, or not being able to find a Perl
-    that works with OpenSSL) and give a reasonable error message.
-    If you have a problem that doesn't seem to be handled correctly
-    (eg, you know you have ActivePerl but we can't find it), please take
-    a peek at build_ssl.py and suggest patches.  Note that build_ssl.py
-    should be able to be run directly from the command-line.
-
-    build_ssl.py/MSVC isn't clever enough to clean OpenSSL - you must do
-    this by hand.
-
-
-YOUR OWN EXTENSION DLLs
------------------------
-If you want to create your own extension module DLL, there's an example
-with easy-to-follow instructions in ../PC/example/; read the file
-readme.txt there first.
diff --git a/PC/VC6/rmpyc.py b/PC/VC6/rmpyc.py
deleted file mode 100644
index b8d6823..0000000
--- a/PC/VC6/rmpyc.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# Remove all the .pyc and .pyo files under ../Lib.
-
-
-def deltree(root):
-    import os
-    from os.path import join
-
-    npyc = npyo = 0
-    for root, dirs, files in os.walk(root):
-        for name in files:
-            delete = False
-            if name.endswith('.pyc'):
-                delete = True
-                npyc += 1
-            elif name.endswith('.pyo'):
-                delete = True
-                npyo += 1
-
-            if delete:
-                os.remove(join(root, name))
-
-    return npyc, npyo
-
-npyc, npyo = deltree("../../Lib")
-print npyc, ".pyc deleted,", npyo, ".pyo deleted"
diff --git a/PC/VC6/rt.bat b/PC/VC6/rt.bat
deleted file mode 100755
index a9eadd7..0000000
--- a/PC/VC6/rt.bat
+++ /dev/null
@@ -1,41 +0,0 @@
-@rem Run Tests.  Run the regression test suite.
-@rem Usage:  rt [-d] [-O] [-q] regrtest_args
-@rem -d   Run Debug build (python_d.exe).  Else release build.
-@rem -O   Run python.exe or python_d.exe (see -d) with -O.
-@rem -q   "quick" -- normally the tests are run twice, the first time
-@rem      after deleting all the .py[co] files reachable from Lib/.
-@rem      -q runs the tests just once, and without deleting .py[co] files.
-@rem All leading instances of these switches are shifted off, and
-@rem whatever remains is passed to regrtest.py.  For example,
-@rem     rt -O -d -x test_thread
-@rem runs
-@rem     python_d -O ../../lib/test/regrtest.py -x test_thread
-@rem twice, and
-@rem     rt -q -g test_binascii
-@rem runs
-@rem     python_d ../../lib/test/regrtest.py -g test_binascii
-@rem to generate the expected-output file for binascii quickly.
-@set _exe=python
-@set _qmode=no
-@set _dashO=
-@goto CheckOpts
-:Again
-@shift
-:CheckOpts
-@if "%1"=="-O" set _dashO=-O
-@if "%1"=="-O" goto Again
-@if "%1"=="-q" set _qmode=yes
-@if "%1"=="-q" goto Again
-@if "%1"=="-d" set _exe=python_d
-@if "%1"=="-d" goto Again
-@if "%_qmode%"=="yes" goto Qmode
-@echo Deleting .pyc/.pyo files ...
-@%_exe% rmpyc.py
-%_exe% %_dashO% -E ../../lib/test/regrtest.py %1 %2 %3 %4 %5 %6 %7 %8 %9
-@echo About to run again without deleting .pyc/.pyo first:
-@pause
-:Qmode
-%_exe% %_dashO% -E ../../lib/test/regrtest.py %1 %2 %3 %4 %5 %6 %7 %8 %9
-@set _exe=
-@set _qmode=
-@set _dashO=
diff --git a/PC/VC6/select.dsp b/PC/VC6/select.dsp
deleted file mode 100644
index d0e528c..0000000
--- a/PC/VC6/select.dsp
+++ /dev/null
@@ -1,99 +0,0 @@
-# Microsoft Developer Studio Project File - Name="select" - Package Owner=<4>

-# Microsoft Developer Studio Generated Build File, Format Version 6.00

-# ** DO NOT EDIT **

-

-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102

-

-CFG=select - Win32 Debug

-!MESSAGE This is not a valid makefile. To build this project using NMAKE,

-!MESSAGE use the Export Makefile command and run

-!MESSAGE 

-!MESSAGE NMAKE /f "select.mak".

-!MESSAGE 

-!MESSAGE You can specify a configuration when running NMAKE

-!MESSAGE by defining the macro CFG on the command line. For example:

-!MESSAGE 

-!MESSAGE NMAKE /f "select.mak" CFG="select - Win32 Debug"

-!MESSAGE 

-!MESSAGE Possible choices for configuration are:

-!MESSAGE 

-!MESSAGE "select - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")

-!MESSAGE "select - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")

-!MESSAGE 

-

-# Begin Project

-# PROP AllowPerConfigDependencies 0

-# PROP Scc_ProjName "select"

-# PROP Scc_LocalPath ".."

-CPP=cl.exe

-MTL=midl.exe

-RSC=rc.exe

-

-!IF  "$(CFG)" == "select - Win32 Release"

-

-# PROP BASE Use_MFC 0

-# PROP BASE Use_Debug_Libraries 0

-# PROP BASE Output_Dir "Release"

-# PROP BASE Intermediate_Dir "Release"

-# PROP BASE Target_Dir ""

-# PROP Use_MFC 0

-# PROP Use_Debug_Libraries 0

-# PROP Output_Dir "."

-# PROP Intermediate_Dir "x86-temp-release\select"

-# PROP Ignore_Export_Lib 0

-# PROP Target_Dir ""

-F90=df.exe

-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c

-# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\..\Include" /I ".." /D "Py_BUILD_CORE_MODULE" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c

-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32

-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32

-# ADD BASE RSC /l 0x409 /d "NDEBUG"

-# ADD RSC /l 0x409 /d "NDEBUG"

-BSC32=bscmake.exe

-# ADD BASE BSC32 /nologo

-# ADD BSC32 /nologo

-LINK32=link.exe

-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386

-# ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /base:"0x1D110000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"./select.pyd"

-# SUBTRACT LINK32 /pdb:none

-

-!ELSEIF  "$(CFG)" == "select - Win32 Debug"

-

-# PROP BASE Use_MFC 0

-# PROP BASE Use_Debug_Libraries 1

-# PROP BASE Output_Dir "Debug"

-# PROP BASE Intermediate_Dir "Debug"

-# PROP BASE Target_Dir ""

-# PROP Use_MFC 0

-# PROP Use_Debug_Libraries 1

-# PROP Output_Dir "."

-# PROP Intermediate_Dir "x86-temp-debug\select"

-# PROP Ignore_Export_Lib 0

-# PROP Target_Dir ""

-F90=df.exe

-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c

-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /D "Py_BUILD_CORE_MODULE" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c

-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32

-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32

-# ADD BASE RSC /l 0x409 /d "_DEBUG"

-# ADD RSC /l 0x409 /d "_DEBUG"

-BSC32=bscmake.exe

-# ADD BASE BSC32 /nologo

-# ADD BSC32 /nologo

-LINK32=link.exe

-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept

-# ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /base:"0x1D110000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /nodefaultlib:"msvcrt" /out:"./select_d.pyd" /pdbtype:sept

-# SUBTRACT LINK32 /pdb:none

-

-!ENDIF 

-

-# Begin Target

-

-# Name "select - Win32 Release"

-# Name "select - Win32 Debug"

-# Begin Source File

-

-SOURCE=..\..\Modules\selectmodule.c

-# End Source File

-# End Target

-# End Project

diff --git a/PC/VC6/tcl852.patch b/PC/VC6/tcl852.patch
deleted file mode 100644
index ed6780a..0000000
--- a/PC/VC6/tcl852.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- tcl8.5.2\generic\tcl.h	Fri Jun 13 03:35:39 2008
-+++ tcl8.5.2\generic\tcl.h	Sun Jan  4 16:52:30 2009
-@@ -367,7 +367,7 @@
- typedef struct stati64 Tcl_StatBuf;
- #         define TCL_LL_MODIFIER	"L"
- #      else /* __BORLANDC__ */
--#         if _MSC_VER < 1400 && !defined(_M_IX86)
-+#         if _MSC_VER < 1400 /*&& !defined(_M_IX86)*/
- typedef struct _stati64	Tcl_StatBuf;
- #         else
- typedef struct _stat64	Tcl_StatBuf;
diff --git a/PC/VC6/unicodedata.dsp b/PC/VC6/unicodedata.dsp
deleted file mode 100644
index a04db67..0000000
--- a/PC/VC6/unicodedata.dsp
+++ /dev/null
@@ -1,99 +0,0 @@
-# Microsoft Developer Studio Project File - Name="unicodedata" - Package Owner=<4>

-# Microsoft Developer Studio Generated Build File, Format Version 6.00

-# ** DO NOT EDIT **

-

-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102

-

-CFG=unicodedata - Win32 Debug

-!MESSAGE This is not a valid makefile. To build this project using NMAKE,

-!MESSAGE use the Export Makefile command and run

-!MESSAGE 

-!MESSAGE NMAKE /f "unicodedata.mak".

-!MESSAGE 

-!MESSAGE You can specify a configuration when running NMAKE

-!MESSAGE by defining the macro CFG on the command line. For example:

-!MESSAGE 

-!MESSAGE NMAKE /f "unicodedata.mak" CFG="unicodedata - Win32 Debug"

-!MESSAGE 

-!MESSAGE Possible choices for configuration are:

-!MESSAGE 

-!MESSAGE "unicodedata - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")

-!MESSAGE "unicodedata - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")

-!MESSAGE 

-

-# Begin Project

-# PROP AllowPerConfigDependencies 0

-# PROP Scc_ProjName "unicodedata"

-# PROP Scc_LocalPath ".."

-CPP=cl.exe

-MTL=midl.exe

-RSC=rc.exe

-

-!IF  "$(CFG)" == "unicodedata - Win32 Release"

-

-# PROP BASE Use_MFC 0

-# PROP BASE Use_Debug_Libraries 0

-# PROP BASE Output_Dir "Release"

-# PROP BASE Intermediate_Dir "Release"

-# PROP BASE Target_Dir ""

-# PROP Use_MFC 0

-# PROP Use_Debug_Libraries 0

-# PROP Output_Dir "."

-# PROP Intermediate_Dir "x86-temp-release\unicodedata"

-# PROP Ignore_Export_Lib 0

-# PROP Target_Dir ""

-F90=df.exe

-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /c

-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\Include" /I ".." /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /c

-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32

-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32

-# ADD BASE RSC /l 0xc09 /d "NDEBUG"

-# ADD RSC /l 0xc09 /d "NDEBUG"

-BSC32=bscmake.exe

-# ADD BASE BSC32 /nologo

-# ADD BSC32 /nologo

-LINK32=link.exe

-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386

-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x1D120000" /dll /machine:I386 /out:"./unicodedata.pyd"

-# SUBTRACT LINK32 /pdb:none

-

-!ELSEIF  "$(CFG)" == "unicodedata - Win32 Debug"

-

-# PROP BASE Use_MFC 0

-# PROP BASE Use_Debug_Libraries 1

-# PROP BASE Output_Dir "Debug"

-# PROP BASE Intermediate_Dir "Debug"

-# PROP BASE Target_Dir ""

-# PROP Use_MFC 0

-# PROP Use_Debug_Libraries 1

-# PROP Output_Dir "."

-# PROP Intermediate_Dir "x86-temp-debug\unicodedata"

-# PROP Ignore_Export_Lib 0

-# PROP Target_Dir ""

-F90=df.exe

-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /GZ /c

-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /GZ /c

-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32

-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32

-# ADD BASE RSC /l 0xc09 /d "_DEBUG"

-# ADD RSC /l 0xc09 /d "_DEBUG"

-BSC32=bscmake.exe

-# ADD BASE BSC32 /nologo

-# ADD BSC32 /nologo

-LINK32=link.exe

-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept

-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x1D120000" /dll /debug /machine:I386 /out:"./unicodedata_d.pyd" /pdbtype:sept

-# SUBTRACT LINK32 /pdb:none

-

-!ENDIF 

-

-# Begin Target

-

-# Name "unicodedata - Win32 Release"

-# Name "unicodedata - Win32 Debug"

-# Begin Source File

-

-SOURCE=..\..\Modules\unicodedata.c

-# End Source File

-# End Target

-# End Project

diff --git a/PC/VC6/w9xpopen.dsp b/PC/VC6/w9xpopen.dsp
deleted file mode 100644
index 6a6403c..0000000
--- a/PC/VC6/w9xpopen.dsp
+++ /dev/null
@@ -1,97 +0,0 @@
-# Microsoft Developer Studio Project File - Name="w9xpopen" - Package Owner=<4>

-# Microsoft Developer Studio Generated Build File, Format Version 6.00

-# ** DO NOT EDIT **

-

-# TARGTYPE "Win32 (x86) Application" 0x0101

-

-CFG=w9xpopen - Win32 Debug

-!MESSAGE This is not a valid makefile. To build this project using NMAKE,

-!MESSAGE use the Export Makefile command and run

-!MESSAGE 

-!MESSAGE NMAKE /f "w9xpopen.mak".

-!MESSAGE 

-!MESSAGE You can specify a configuration when running NMAKE

-!MESSAGE by defining the macro CFG on the command line. For example:

-!MESSAGE 

-!MESSAGE NMAKE /f "w9xpopen.mak" CFG="w9xpopen - Win32 Debug"

-!MESSAGE 

-!MESSAGE Possible choices for configuration are:

-!MESSAGE 

-!MESSAGE "w9xpopen - Win32 Release" (based on "Win32 (x86) Application")

-!MESSAGE "w9xpopen - Win32 Debug" (based on "Win32 (x86) Application")

-!MESSAGE 

-

-# Begin Project

-# PROP AllowPerConfigDependencies 0

-# PROP Scc_ProjName ""

-# PROP Scc_LocalPath ""

-CPP=cl.exe

-MTL=midl.exe

-RSC=rc.exe

-

-!IF  "$(CFG)" == "w9xpopen - Win32 Release"

-

-# PROP BASE Use_MFC 0

-# PROP BASE Use_Debug_Libraries 0

-# PROP BASE Output_Dir "Release"

-# PROP BASE Intermediate_Dir "Release"

-# PROP BASE Target_Dir ""

-# PROP Use_MFC 0

-# PROP Use_Debug_Libraries 0

-# PROP Output_Dir "."

-# PROP Intermediate_Dir "x86-temp-release\w9xpopen"

-# PROP Ignore_Export_Lib 0

-# PROP Target_Dir ""

-# ADD BASE CPP /nologo /W3 /GX /O2 /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c

-# ADD CPP /nologo /MD /W3 /GX /O2 /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c

-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32

-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32

-# ADD BASE RSC /l 0xc09 /d "NDEBUG"

-# ADD RSC /l 0xc09 /d "NDEBUG"

-BSC32=bscmake.exe

-# ADD BASE BSC32 /nologo

-# ADD BSC32 /nologo

-LINK32=link.exe

-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386

-# ADD LINK32 user32.lib /nologo /machine:I386

-# SUBTRACT LINK32 /pdb:none

-

-!ELSEIF  "$(CFG)" == "w9xpopen - Win32 Debug"

-

-# PROP BASE Use_MFC 0

-# PROP BASE Use_Debug_Libraries 1

-# PROP BASE Output_Dir "Debug"

-# PROP BASE Intermediate_Dir "Debug"

-# PROP BASE Target_Dir ""

-# PROP Use_MFC 0

-# PROP Use_Debug_Libraries 1

-# PROP Output_Dir "."

-# PROP Intermediate_Dir "x86-temp-debug\w9xpopen"

-# PROP Ignore_Export_Lib 0

-# PROP Target_Dir ""

-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c

-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c

-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32

-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32

-# ADD BASE RSC /l 0xc09 /d "_DEBUG"

-# ADD RSC /l 0xc09 /d "_DEBUG"

-BSC32=bscmake.exe

-# ADD BASE BSC32 /nologo

-# ADD BSC32 /nologo

-LINK32=link.exe

-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept

-# ADD LINK32 user32.lib /nologo /debug /machine:I386 /out:"./w9xpopen_d.exe" /pdbtype:sept

-# SUBTRACT LINK32 /pdb:none

-

-!ENDIF 

-

-# Begin Target

-

-# Name "w9xpopen - Win32 Release"

-# Name "w9xpopen - Win32 Debug"

-# Begin Source File

-

-SOURCE=..\w9xpopen.c

-# End Source File

-# End Target

-# End Project

diff --git a/PC/VC6/winsound.dsp b/PC/VC6/winsound.dsp
deleted file mode 100644
index 6e09b9b..0000000
--- a/PC/VC6/winsound.dsp
+++ /dev/null
@@ -1,99 +0,0 @@
-# Microsoft Developer Studio Project File - Name="winsound" - Package Owner=<4>

-# Microsoft Developer Studio Generated Build File, Format Version 6.00

-# ** DO NOT EDIT **

-

-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102

-

-CFG=winsound - Win32 Debug

-!MESSAGE This is not a valid makefile. To build this project using NMAKE,

-!MESSAGE use the Export Makefile command and run

-!MESSAGE 

-!MESSAGE NMAKE /f "winsound.mak".

-!MESSAGE 

-!MESSAGE You can specify a configuration when running NMAKE

-!MESSAGE by defining the macro CFG on the command line. For example:

-!MESSAGE 

-!MESSAGE NMAKE /f "winsound.mak" CFG="winsound - Win32 Debug"

-!MESSAGE 

-!MESSAGE Possible choices for configuration are:

-!MESSAGE 

-!MESSAGE "winsound - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")

-!MESSAGE "winsound - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")

-!MESSAGE 

-

-# Begin Project

-# PROP AllowPerConfigDependencies 0

-# PROP Scc_ProjName "winsound"

-# PROP Scc_LocalPath "..\pc"

-CPP=cl.exe

-MTL=midl.exe

-RSC=rc.exe

-

-!IF  "$(CFG)" == "winsound - Win32 Release"

-

-# PROP BASE Use_MFC 0

-# PROP BASE Use_Debug_Libraries 0

-# PROP BASE Output_Dir "Release"

-# PROP BASE Intermediate_Dir "Release"

-# PROP BASE Target_Dir ""

-# PROP Use_MFC 0

-# PROP Use_Debug_Libraries 0

-# PROP Output_Dir "."

-# PROP Intermediate_Dir "x86-temp-release\winsound"

-# PROP Ignore_Export_Lib 0

-# PROP Target_Dir ""

-F90=df.exe

-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "WINSOUND_EXPORTS" /YX /FD /c

-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\Include" /I ".." /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "WINSOUND_EXPORTS" /YX /FD /c

-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32

-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32

-# ADD BASE RSC /l 0xc09 /d "NDEBUG"

-# ADD RSC /l 0xc09 /d "NDEBUG"

-BSC32=bscmake.exe

-# ADD BASE BSC32 /nologo

-# ADD BSC32 /nologo

-LINK32=link.exe

-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386

-# ADD LINK32 kernel32.lib winmm.lib user32.lib /nologo /base:"0x1D160000" /dll /machine:I386 /out:"./winsound.pyd"

-# SUBTRACT LINK32 /pdb:none

-

-!ELSEIF  "$(CFG)" == "winsound - Win32 Debug"

-

-# PROP BASE Use_MFC 0

-# PROP BASE Use_Debug_Libraries 1

-# PROP BASE Output_Dir "Debug"

-# PROP BASE Intermediate_Dir "Debug"

-# PROP BASE Target_Dir ""

-# PROP Use_MFC 0

-# PROP Use_Debug_Libraries 1

-# PROP Output_Dir "."

-# PROP Intermediate_Dir "x86-temp-debug\winsound"

-# PROP Ignore_Export_Lib 0

-# PROP Target_Dir ""

-F90=df.exe

-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "WINSOUND_EXPORTS" /YX /FD /GZ /c

-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /D "Py_BUILD_CORE_MODULE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "WINSOUND_EXPORTS" /YX /FD /GZ /c

-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32

-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32

-# ADD BASE RSC /l 0xc09 /d "_DEBUG"

-# ADD RSC /l 0xc09 /d "_DEBUG"

-BSC32=bscmake.exe

-# ADD BASE BSC32 /nologo

-# ADD BSC32 /nologo

-LINK32=link.exe

-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept

-# ADD LINK32 user32.lib kernel32.lib winmm.lib /nologo /base:"0x1D160000" /dll /debug /machine:I386 /out:"./winsound_d.pyd" /pdbtype:sept

-# SUBTRACT LINK32 /pdb:none

-

-!ENDIF 

-

-# Begin Target

-

-# Name "winsound - Win32 Release"

-# Name "winsound - Win32 Debug"

-# Begin Source File

-

-SOURCE=..\winsound.c

-# End Source File

-# End Target

-# End Project

diff --git a/PC/VS7.1/Uninstal.wse b/PC/VS7.1/Uninstal.wse
deleted file mode 100644
index 216dd30..0000000
--- a/PC/VS7.1/Uninstal.wse
+++ /dev/null
@@ -1,514 +0,0 @@
-Document Type: WSE
-item: Global
-  Version=8.14
-  Flags=00000100
-  Split=1420
-  Languages=65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
-  Copy Default=1
-  Japanese Font Name=MS Gothic
-  Japanese Font Size=10
-  Start Gradient=0 0 255
-  End Gradient=0 0 0
-  Windows Flags=00000000000000000000101000001000
-  Message Font=MS Sans Serif
-  Font Size=8
-  Disk Label=GLBS
-  Disk Filename=INSTALL
-  Patch Flags=0000000000000001
-  Patch Threshold=200
-  Patch Memory=4096
-  Per-User Version ID=1
-  Crystal Format=10111100101100000010001001001001
-  Step View=&Properties
-end
-item: Remark
-  Text=Note from Tim:  This is a verbatim copy of Wise's Uninstal.wse, altered at the end to write
-end
-item: Remark
-  Text=uninstall info under HKCU instead of HKLM if our DOADMIN var is false.
-end
-item: Remark
-end
-item: Remark
-  Text=     Install Support for uninstalling the application.
-end
-item: Remark
-end
-item: Set Variable
-  Variable=UNINSTALL_PATH
-  Value=%_LOGFILE_PATH_%
-  Flags=00000010
-end
-item: Set Variable
-  Variable=UNINSTALL_PATH
-  Value=%UNINSTALL_PATH%\UNWISE.EXE
-end
-item: Compiler Variable If
-  Variable=_EXE_OS_TYPE_
-  Value=WIN32
-end
-item: Install File
-  Source=%_WISE_%\UNWISE32.EXE
-  Destination=%UNINSTALL_PATH%
-  Flags=0000000000000010
-end
-item: Compiler Variable Else
-end
-item: Install File
-  Source=%_WISE_%\UNWISE.EXE
-  Destination=%UNINSTALL_PATH%
-  Flags=0000000000000010
-end
-item: Compiler Variable End
-end
-item: Remark
-end
-item: Remark
-  Text=     Install Support for multiple languages
-end
-item: Remark
-end
-item: Set Variable
-  Variable=UNINSTALL_LANG
-  Value=%UNINSTALL_PATH%
-  Flags=00000010
-end
-item: Set Variable
-  Variable=UNINSTALL_LANG
-  Value=%UNINSTALL_LANG%\UNWISE.INI
-end
-item: Compiler Variable If
-  Variable=_LANG_LIST_
-  Value=C
-  Flags=00000010
-end
-item: Compiler Variable If
-  Value=%_WISE_%\LANGUAGE\UNWISE.FRA
-  Flags=00000011
-end
-item: If/While Statement
-  Variable=LANG
-  Value=%_LANG_C_NAME_%
-end
-item: Install File
-  Source=%_WISE_%\LANGUAGE\UNWISE.FRA
-  Destination=%UNINSTALL_LANG%
-  Flags=0000000000000010
-end
-item: End Block
-end
-item: Compiler Variable End
-end
-item: Compiler Variable End
-end
-item: Compiler Variable If
-  Variable=_LANG_LIST_
-  Value=D
-  Flags=00000010
-end
-item: Compiler Variable If
-  Value=%_WISE_%\LANGUAGE\UNWISE.FRA
-  Flags=00000011
-end
-item: If/While Statement
-  Variable=LANG
-  Value=%_LANG_D_NAME_%
-end
-item: Install File
-  Source=%_WISE_%\LANGUAGE\UNWISE.FRA
-  Destination=%UNINSTALL_LANG%
-  Flags=0000000000000010
-end
-item: End Block
-end
-item: Compiler Variable End
-end
-item: Compiler Variable End
-end
-item: Compiler Variable If
-  Variable=_LANG_LIST_
-  Value=E
-  Flags=00000010
-end
-item: Compiler Variable If
-  Value=%_WISE_%\LANGUAGE\UNWISE.DEU
-  Flags=00000011
-end
-item: If/While Statement
-  Variable=LANG
-  Value=%_LANG_E_NAME_%
-end
-item: Install File
-  Source=%_WISE_%\LANGUAGE\UNWISE.DEU
-  Destination=%UNINSTALL_LANG%
-  Flags=0000000000000010
-end
-item: End Block
-end
-item: Compiler Variable End
-end
-item: Compiler Variable End
-end
-item: Compiler Variable If
-  Variable=_LANG_LIST_
-  Value=F
-  Flags=00000010
-end
-item: Compiler Variable If
-  Value=%_WISE_%\LANGUAGE\UNWISE.PTG
-  Flags=00000011
-end
-item: If/While Statement
-  Variable=LANG
-  Value=%_LANG_F_NAME_%
-end
-item: Install File
-  Source=%_WISE_%\LANGUAGE\UNWISE.PTG
-  Destination=%UNINSTALL_LANG%
-  Flags=0000000000000010
-end
-item: End Block
-end
-item: Compiler Variable End
-end
-item: Compiler Variable End
-end
-item: Compiler Variable If
-  Variable=_LANG_LIST_
-  Value=G
-  Flags=00000010
-end
-item: Compiler Variable If
-  Value=%_WISE_%\LANGUAGE\UNWISE.ESP
-  Flags=00000011
-end
-item: If/While Statement
-  Variable=LANG
-  Value=%_LANG_G_NAME_%
-end
-item: Install File
-  Source=%_WISE_%\LANGUAGE\UNWISE.ESP
-  Destination=%UNINSTALL_LANG%
-  Flags=0000000000000010
-end
-item: End Block
-end
-item: Compiler Variable End
-end
-item: Compiler Variable End
-end
-item: Compiler Variable If
-  Variable=_LANG_LIST_
-  Value=H
-  Flags=00000010
-end
-item: Compiler Variable If
-  Value=%_WISE_%\LANGUAGE\UNWISE.ESP
-  Flags=00000011
-end
-item: If/While Statement
-  Variable=LANG
-  Value=%_LANG_H_NAME_%
-end
-item: Install File
-  Source=%_WISE_%\LANGUAGE\UNWISE.ESP
-  Destination=%UNINSTALL_LANG%
-  Flags=0000000000000010
-end
-item: End Block
-end
-item: Compiler Variable End
-end
-item: Compiler Variable End
-end
-item: Compiler Variable If
-  Variable=_LANG_LIST_
-  Value=I
-  Flags=00000010
-end
-item: Compiler Variable If
-  Value=%_WISE_%\LANGUAGE\UNWISE.ITA
-  Flags=00000011
-end
-item: If/While Statement
-  Variable=LANG
-  Value=%_LANG_I_NAME_%
-end
-item: Install File
-  Source=%_WISE_%\LANGUAGE\UNWISE.ITA
-  Destination=%UNINSTALL_LANG%
-  Flags=0000000000000010
-end
-item: End Block
-end
-item: Compiler Variable End
-end
-item: Compiler Variable End
-end
-item: Compiler Variable If
-  Variable=_LANG_LIST_
-  Value=J
-  Flags=00000010
-end
-item: Compiler Variable If
-  Value=%_WISE_%\LANGUAGE\UNWISE.DAN
-  Flags=00000011
-end
-item: If/While Statement
-  Variable=LANG
-  Value=%_LANG_J_NAME_%
-end
-item: Install File
-  Source=%_WISE_%\LANGUAGE\UNWISE.DAN
-  Destination=%UNINSTALL_LANG%
-  Flags=0000000000000010
-end
-item: End Block
-end
-item: Compiler Variable End
-end
-item: Compiler Variable End
-end
-item: Compiler Variable If
-  Variable=_LANG_LIST_
-  Value=K
-  Flags=00000010
-end
-item: Compiler Variable If
-  Value=%_WISE_%\LANGUAGE\UNWISE.FIN
-  Flags=00000011
-end
-item: If/While Statement
-  Variable=LANG
-  Value=%_LANG_K_NAME_%
-end
-item: Install File
-  Source=%_WISE_%\LANGUAGE\UNWISE.FIN
-  Destination=%UNINSTALL_LANG%
-  Flags=0000000000000010
-end
-item: End Block
-end
-item: Compiler Variable End
-end
-item: Compiler Variable End
-end
-item: Compiler Variable If
-  Variable=_LANG_LIST_
-  Value=L
-  Flags=00000010
-end
-item: Compiler Variable If
-  Value=%_WISE_%\LANGUAGE\UNWISE.ISL
-  Flags=00000011
-end
-item: If/While Statement
-  Variable=LANG
-  Value=%_LANG_L_NAME_%
-end
-item: Install File
-  Source=%_WISE_%\LANGUAGE\UNWISE.ISL
-  Destination=%UNINSTALL_LANG%
-  Flags=0000000000000010
-end
-item: End Block
-end
-item: Compiler Variable End
-end
-item: Compiler Variable End
-end
-item: Compiler Variable If
-  Variable=_LANG_LIST_
-  Value=M
-  Flags=00000010
-end
-item: Compiler Variable If
-  Value=%_WISE_%\LANGUAGE\UNWISE.NLD
-  Flags=00000011
-end
-item: If/While Statement
-  Variable=LANG
-  Value=%_LANG_M_NAME_%
-end
-item: Install File
-  Source=%_WISE_%\LANGUAGE\UNWISE.NLD
-  Destination=%UNINSTALL_LANG%
-  Flags=0000000000000010
-end
-item: End Block
-end
-item: Compiler Variable End
-end
-item: Compiler Variable End
-end
-item: Compiler Variable If
-  Variable=_LANG_LIST_
-  Value=N
-  Flags=00000010
-end
-item: Compiler Variable If
-  Value=%_WISE_%\LANGUAGE\UNWISE.NOR
-  Flags=00000011
-end
-item: If/While Statement
-  Variable=LANG
-  Value=%_LANG_N_NAME_%
-end
-item: Install File
-  Source=%_WISE_%\LANGUAGE\UNWISE.NOR
-  Destination=%UNINSTALL_LANG%
-  Flags=0000000000000010
-end
-item: End Block
-end
-item: Compiler Variable End
-end
-item: Compiler Variable End
-end
-item: Compiler Variable If
-  Variable=_LANG_LIST_
-  Value=O
-  Flags=00000010
-end
-item: Compiler Variable If
-  Value=%_WISE_%\LANGUAGE\UNWISE.SVE
-  Flags=00000011
-end
-item: If/While Statement
-  Variable=LANG
-  Value=%_LANG_O_NAME_%
-end
-item: Install File
-  Source=%_WISE_%\LANGUAGE\UNWISE.SVE
-  Destination=%UNINSTALL_LANG%
-  Flags=0000000000000010
-end
-item: End Block
-end
-item: Compiler Variable End
-end
-item: Compiler Variable End
-end
-item: Compiler Variable If
-  Variable=_LANG_LIST_
-  Value=P
-  Flags=00000010
-end
-item: Compiler Variable If
-  Value=%_WISE_%\LANGUAGE\UNWISE.JPN
-  Flags=00000011
-end
-item: If/While Statement
-  Variable=LANG
-  Value=%_LANG_P_NAME_%
-end
-item: Install File
-  Source=%_WISE_%\LANGUAGE\UNWISE.JPN
-  Destination=%UNINSTALL_LANG%
-  Flags=0000000000000010
-end
-item: End Block
-end
-item: Compiler Variable End
-end
-item: Compiler Variable End
-end
-item: Remark
-end
-item: Remark
-  Text=     Install the add/remove or uninstall icon
-end
-item: Remark
-end
-item: Set Variable
-  Variable=UNINSTALL_PATH
-  Value=%UNINSTALL_PATH%
-  Flags=00010100
-end
-item: Set Variable
-  Variable=INST_LOG_PATH
-  Value=%_LOGFILE_PATH_%
-  Flags=00010100
-end
-item: Check Configuration
-  Flags=10111011
-end
-item: If/While Statement
-  Variable=DOADMIN
-  Value=1
-end
-item: Remark
-  Text=Write uninstall info under HKLM.  This if/else/end block added by Tim.
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\%APPTITLE%
-  New Value=%APPTITLE%
-  Value Name=DisplayName
-  Root=2
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\%APPTITLE%
-  New Value=%UNINSTALL_PATH% %INST_LOG_PATH%
-  New Value=
-  Value Name=UninstallString
-  Root=2
-end
-item: Else Statement
-end
-item: Remark
-  Text=The same, but write under HKCU instead.
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\%APPTITLE%
-  New Value=%APPTITLE%
-  Value Name=DisplayName
-  Root=1
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\%APPTITLE%
-  New Value=%UNINSTALL_PATH% %INST_LOG_PATH%
-  New Value=
-  Value Name=UninstallString
-  Root=1
-end
-item: End Block
-end
-item: Else Statement
-end
-item: Add ProgMan Icon
-  Group=%GROUP%
-  Icon Name=Uninstall %APPTITLE%
-  Command Line=%UNINSTALL_PATH% %INST_LOG_PATH%
-end
-item: End Block
-end
-item: Check Configuration
-  Flags=11110010
-end
-item: If/While Statement
-  Variable=DOBRAND
-  Value=1
-end
-item: Edit Registry
-  Total Keys=2
-  item: Key
-    Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\%APPTITLE%
-    New Value=%COMPANY%
-    Value Name=RegCompany
-    Root=2
-  end
-  item: Key
-    Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\%APPTITLE%
-    New Value=%NAME%
-    Value Name=RegOwner
-    Root=2
-  end
-end
-item: End Block
-end
-item: End Block
-end
diff --git a/PC/VS7.1/_ctypes.vcproj b/PC/VS7.1/_ctypes.vcproj
deleted file mode 100644
index c359d88..0000000
--- a/PC/VS7.1/_ctypes.vcproj
+++ /dev/null
@@ -1,311 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="7.10"

-	Name="_ctypes"

-	ProjectGUID="{F22F40F4-D318-40DC-96B3-88DC81CE0894}"

-	RootNamespace="_ctypes"

-	Keyword="Win32Proj">

-	<Platforms>

-		<Platform

-			Name="Win32"/>

-	</Platforms>

-	<Configurations>

-		<Configuration

-			Name="Debug|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\x86-temp-debug\_ctypes"

-			ConfigurationType="2"

-			CharacterSet="2">

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="0"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC,..\..\Modules\_ctypes\libffi_msvc"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;WIN32;_DEBUG;_WINDOWS"

-				MinimalRebuild="FALSE"

-				BasicRuntimeChecks="3"

-				RuntimeLibrary="3"

-				UsePrecompiledHeader="0"

-				WarningLevel="3"

-				Detect64BitPortabilityProblems="FALSE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalOptions="/EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE"

-				OutputFile="./_ctypes_d.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./_ctypes_d.pdb"

-				SubSystem="0"

-				BaseAddress="0x1D1A0000"

-				ImportLibrary=".\./_ctypes_d.lib"

-				TargetMachine="1"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="Release|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\x86-temp-release\_ctypes"

-			ConfigurationType="2"

-			CharacterSet="2">

-			<Tool

-				Name="VCCLCompilerTool"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC,..\..\Modules\_ctypes\libffi_msvc"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;WIN32;NDEBUG;_WINDOWS"

-				StringPooling="TRUE"

-				RuntimeLibrary="2"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="0"

-				WarningLevel="3"

-				Detect64BitPortabilityProblems="FALSE"

-				DebugInformationFormat="0"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalOptions="/EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE"

-				OutputFile="./_ctypes.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				GenerateDebugInformation="FALSE"

-				ProgramDatabaseFile=".\./_ctypes.pdb"

-				SubSystem="0"

-				OptimizeReferences="0"

-				EnableCOMDATFolding="0"

-				BaseAddress="0x1D1A0000"

-				ImportLibrary=".\./_ctypes.lib"

-				TargetMachine="1"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="ReleaseAMD64|Win32"

-			OutputDirectory="."

-			IntermediateDirectory="amd64-temp-release\_ctypes"

-			ConfigurationType="2"

-			CharacterSet="2">

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalOptions=" /USECL:MS_OPTERON /GS-"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC,..\..\Modules\_ctypes\libffi_msvc"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;WIN32;NDEBUG;_WINDOWS"

-				StringPooling="TRUE"

-				BasicRuntimeChecks="0"

-				RuntimeLibrary="2"

-				BufferSecurityCheck="FALSE"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="0"

-				WarningLevel="3"

-				Detect64BitPortabilityProblems="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalOptions=" /MACHINE:AMD64 /USELINK:MS_SDK /EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE"

-				OutputFile="./_ctypes.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				GenerateDebugInformation="FALSE"

-				ProgramDatabaseFile=".\./_ctypes.pdb"

-				SubSystem="0"

-				OptimizeReferences="0"

-				EnableCOMDATFolding="0"

-				BaseAddress="0x1D1A0000"

-				ImportLibrary=".\./_ctypes.lib"

-				TargetMachine="0"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="ReleaseItanium|Win32"

-			OutputDirectory="."

-			IntermediateDirectory="ia64-temp-release\_ctypes"

-			ConfigurationType="2"

-			CharacterSet="2">

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalOptions=" /USECL:MS_ITANIUM"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC,..\..\Modules\_ctypes\libffi_msvc"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;WIN32;NDEBUG;_WINDOWS"

-				StringPooling="TRUE"

-				BasicRuntimeChecks="0"

-				RuntimeLibrary="2"

-				BufferSecurityCheck="FALSE"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="0"

-				WarningLevel="3"

-				Detect64BitPortabilityProblems="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalOptions=" /MACHINE:IA64 /USELINK:MS_SDK /EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE"

-				OutputFile="./_ctypes.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				GenerateDebugInformation="FALSE"

-				ProgramDatabaseFile=".\./_ctypes.pdb"

-				SubSystem="0"

-				OptimizeReferences="0"

-				EnableCOMDATFolding="0"

-				BaseAddress="0x1D1A0000"

-				ImportLibrary=".\./_ctypes.lib"

-				TargetMachine="0"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<File

-			RelativePath="..\..\Modules\_ctypes\_ctypes.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\_ctypes\callbacks.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\_ctypes\callproc.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\_ctypes\cfield.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\_ctypes\libffi_msvc\ffi.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\_ctypes\malloc_closure.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\_ctypes\libffi_msvc\prep_cif.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\_ctypes\stgdict.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\_ctypes\libffi_msvc\win32.c">

-			<FileConfiguration

-				Name="ReleaseAMD64|Win32"

-				ExcludedFromBuild="TRUE">

-				<Tool

-					Name="VCCLCompilerTool"/>

-			</FileConfiguration>

-		</File>

-		<File

-			RelativePath="..\..\Modules\_ctypes\libffi_msvc\win64.asm">

-			<FileConfiguration

-				Name="Debug|Win32"

-				ExcludedFromBuild="TRUE">

-				<Tool

-					Name="VCCustomBuildTool"/>

-			</FileConfiguration>

-			<FileConfiguration

-				Name="Release|Win32"

-				ExcludedFromBuild="TRUE">

-				<Tool

-					Name="VCCustomBuildTool"/>

-			</FileConfiguration>

-			<FileConfiguration

-				Name="ReleaseAMD64|Win32">

-				<Tool

-					Name="VCCustomBuildTool"

-					CommandLine="amd64_ml64 /nologo /c /Fo &quot;$(IntDir)\win64.obj&quot; &quot;$(InputPath)&quot;

-"

-					Outputs="&quot;$(IntDir)\win64.obj&quot;"/>

-			</FileConfiguration>

-			<FileConfiguration

-				Name="ReleaseItanium|Win32"

-				ExcludedFromBuild="TRUE">

-				<Tool

-					Name="VCCustomBuildTool"/>

-			</FileConfiguration>

-		</File>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS7.1/_ctypes_test.vcproj b/PC/VS7.1/_ctypes_test.vcproj
deleted file mode 100644
index e8e8a2c..0000000
--- a/PC/VS7.1/_ctypes_test.vcproj
+++ /dev/null
@@ -1,242 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="7.10"

-	Name="_ctypes_test"

-	ProjectGUID="{8CF334D9-4F82-42EB-97AF-83592C5AFD2F}"

-	Keyword="Win32Proj">

-	<Platforms>

-		<Platform

-			Name="Win32"/>

-	</Platforms>

-	<Configurations>

-		<Configuration

-			Name="Debug|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\x86-temp-debug\_ctypes_test"

-			ConfigurationType="2"

-			CharacterSet="2">

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="0"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;WIN32;_DEBUG;_WINDOWS"

-				MinimalRebuild="FALSE"

-				BasicRuntimeChecks="3"

-				RuntimeLibrary="3"

-				UsePrecompiledHeader="0"

-				WarningLevel="3"

-				Detect64BitPortabilityProblems="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				OutputFile="./_ctypes_test_d.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./_ctypes_test_d.pdb"

-				SubSystem="0"

-				ImportLibrary=".\./_ctypes_test_d.lib"

-				TargetMachine="1"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="Release|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\x86-temp-release\_ctypes_test"

-			ConfigurationType="2"

-			CharacterSet="2">

-			<Tool

-				Name="VCCLCompilerTool"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;WIN32;NDEBUG;_WINDOWS"

-				StringPooling="TRUE"

-				RuntimeLibrary="2"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="0"

-				WarningLevel="3"

-				Detect64BitPortabilityProblems="TRUE"

-				DebugInformationFormat="0"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				OutputFile="./_ctypes_test.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				GenerateDebugInformation="FALSE"

-				ProgramDatabaseFile=".\./_ctypes_test.pdb"

-				SubSystem="0"

-				OptimizeReferences="0"

-				EnableCOMDATFolding="0"

-				ImportLibrary=".\./_ctypes_test.lib"

-				TargetMachine="1"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="ReleaseItanium|Win32"

-			OutputDirectory="."

-			IntermediateDirectory="ia64-temp-release\_ctypes_test"

-			ConfigurationType="2"

-			CharacterSet="2">

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalOptions=" /USECL:MS_ITANIUM"

-				Optimization="0"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;WIN32;_DEBUG;_WINDOWS"

-				MinimalRebuild="FALSE"

-				BasicRuntimeChecks="0"

-				RuntimeLibrary="3"

-				BufferSecurityCheck="FALSE"

-				UsePrecompiledHeader="0"

-				WarningLevel="3"

-				Detect64BitPortabilityProblems="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalOptions=" /MACHINE:IA64 /USELINK:MS_SDK"

-				OutputFile="./_ctypes_test_d.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./_ctypes_test_d.pdb"

-				SubSystem="0"

-				ImportLibrary=".\./_ctypes_test_d.lib"

-				TargetMachine="0"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="ReleaseAMD64|Win32"

-			OutputDirectory="."

-			IntermediateDirectory="amd64-temp-release\_ctypes_test"

-			ConfigurationType="2"

-			CharacterSet="2">

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalOptions=" /USECL:MS_OPTERON"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;WIN32;NDEBUG;_WINDOWS"

-				StringPooling="TRUE"

-				BasicRuntimeChecks="0"

-				RuntimeLibrary="2"

-				BufferSecurityCheck="FALSE"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="0"

-				WarningLevel="3"

-				Detect64BitPortabilityProblems="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalOptions=" /MACHINE:AMD64 /USELINK:MS_SDK"

-				OutputFile="./_ctypes_test.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				GenerateDebugInformation="FALSE"

-				ProgramDatabaseFile=".\./_ctypes_test.pdb"

-				SubSystem="0"

-				OptimizeReferences="0"

-				EnableCOMDATFolding="0"

-				ImportLibrary=".\./_ctypes_test.lib"

-				TargetMachine="0"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<File

-			RelativePath="..\..\Modules\_ctypes\_ctypes_test.c">

-		</File>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS7.1/_elementtree.vcproj b/PC/VS7.1/_elementtree.vcproj
deleted file mode 100644
index ba2b9d9..0000000
--- a/PC/VS7.1/_elementtree.vcproj
+++ /dev/null
@@ -1,264 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="7.10"

-	Name="_elementtree"

-	ProjectGUID="{1966DDE2-4AB7-4E4E-ACC9-C121E4D37F8E}"

-	SccProjectName="_elementtree"

-	SccLocalPath="..">

-	<Platforms>

-		<Platform

-			Name="Win32"/>

-	</Platforms>

-	<Configurations>

-		<Configuration

-			Name="Debug|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\x86-temp-debug\_elementtree"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE">

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="0"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC,..\..\Modules\expat"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;_DEBUG;HAVE_EXPAT_H;WIN32;_WINDOWS;XML_NS;XML_DTD;BYTEORDER=1234;XML_CONTEXT_BYTES=1024;USE_PYEXPAT_CAPI;XML_STATIC;HAVE_MEMMOVE"

-				RuntimeLibrary="3"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="odbccp32.lib"

-				OutputFile="./_elementtree_d.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./_elementtree_d.pdb"

-				SubSystem="2"

-				BaseAddress="0x1D100000"

-				ImportLibrary=".\./_elementtree_d.lib"

-				TargetMachine="1"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="Release|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\x86-temp-release\_elementtree"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE">

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC,..\..\Modules\expat"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;NDEBUG;WIN32;_WINDOWS;XML_NS;XML_DTD;BYTEORDER=1234;XML_CONTEXT_BYTES=1024;USE_PYEXPAT_CAPI;XML_STATIC;HAVE_MEMMOVE"

-				StringPooling="TRUE"

-				RuntimeLibrary="2"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="odbccp32.lib"

-				OutputFile="./_elementtree.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./_elementtree.pdb"

-				SubSystem="2"

-				BaseAddress="0x1D100000"

-				ImportLibrary=".\./_elementtree.lib"

-				TargetMachine="1"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="ReleaseItanium|Win32"

-			OutputDirectory="./."

-			IntermediateDirectory=".\ia64-temp-release\_elementtree"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE">

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalOptions=" /USECL:MS_ITANIUM /GS-"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC,..\..\Modules\expat"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;NDEBUG;WIN32;_WINDOWS;XML_NS;XML_DTD;BYTEORDER=1234;XML_CONTEXT_BYTES=1024;USE_PYEXPAT_CAPI;XML_STATIC;HAVE_MEMMOVE"

-				StringPooling="TRUE"

-				BasicRuntimeChecks="0"

-				RuntimeLibrary="2"

-				BufferSecurityCheck="FALSE"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				Detect64BitPortabilityProblems="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalOptions=" /MACHINE:IA64 /USELINK:MS_SDK"

-				AdditionalDependencies="odbccp32.lib"

-				OutputFile="./_elementtree.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./_elementtree.pdb"

-				SubSystem="2"

-				BaseAddress="0x1D100000"

-				ImportLibrary=".\./_elementtree.lib"

-				TargetMachine="0"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="ReleaseAMD64|Win32"

-			OutputDirectory="."

-			IntermediateDirectory="amd64-temp-release\_elementtree"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE">

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalOptions=" /USECL:MS_OPTERON /GS-"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC,..\..\Modules\expat"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;NDEBUG;WIN32;_WINDOWS;XML_NS;XML_DTD;BYTEORDER=1234;XML_CONTEXT_BYTES=1024;USE_PYEXPAT_CAPI;XML_STATIC;HAVE_MEMMOVE"

-				StringPooling="TRUE"

-				BasicRuntimeChecks="0"

-				RuntimeLibrary="2"

-				BufferSecurityCheck="FALSE"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				Detect64BitPortabilityProblems="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalOptions=" /MACHINE:AMD64 /USELINK:MS_SDK"

-				AdditionalDependencies="odbccp32.lib"

-				OutputFile="./_elementtree.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./_elementtree.pdb"

-				SubSystem="2"

-				BaseAddress="0x1D100000"

-				ImportLibrary=".\./_elementtree.lib"

-				TargetMachine="0"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<File

-			RelativePath="..\..\Modules\_elementtree.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\expat\xmlparse.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\expat\xmlrole.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\expat\xmltok.c">

-		</File>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS7.1/_msi.vcproj b/PC/VS7.1/_msi.vcproj
deleted file mode 100644
index d4fd447..0000000
--- a/PC/VS7.1/_msi.vcproj
+++ /dev/null
@@ -1,252 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="7.10"

-	Name="_msi"

-	ProjectGUID="{2C0BEFB9-70E2-4F80-AC5B-4AB8EE023574}"

-	SccProjectName="_msi"

-	SccLocalPath="..\..\pc">

-	<Platforms>

-		<Platform

-			Name="Win32"/>

-	</Platforms>

-	<Configurations>

-		<Configuration

-			Name="Debug|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\x86-temp-debug\_msi"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE"

-			CharacterSet="2">

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="0"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;WIN32;_DEBUG;_WINDOWS;_USRDLL"

-				BasicRuntimeChecks="3"

-				RuntimeLibrary="3"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="fci.lib msi.lib rpcrt4.lib"

-				OutputFile="./_msi_d.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./_msi_d.pdb"

-				BaseAddress="0x1D160000"

-				ImportLibrary=".\./_msi_d.lib"

-				TargetMachine="1"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="Release|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\x86-temp-release\_msi"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE"

-			CharacterSet="2">

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;WIN32;NDEBUG;_WINDOWS;_USRDLL"

-				StringPooling="TRUE"

-				RuntimeLibrary="2"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="fci.lib msi.lib rpcrt4.lib"

-				OutputFile="./_msi.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				ProgramDatabaseFile=".\./_msi.pdb"

-				BaseAddress="0x1D160000"

-				ImportLibrary=".\./_msi.lib"

-				TargetMachine="1"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="ReleaseItanium|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\ia64-temp-release\_msi"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE"

-			CharacterSet="2">

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalOptions=" /USECL:MS_ITANIUM /GS-"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;WIN32;NDEBUG;_WINDOWS;_USRDLL"

-				StringPooling="TRUE"

-				BasicRuntimeChecks="0"

-				RuntimeLibrary="2"

-				BufferSecurityCheck="FALSE"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				Detect64BitPortabilityProblems="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalOptions=" /MACHINE:IA64 /USELINK:MS_SDK"

-				AdditionalDependencies="fci.lib msi.lib rpcrt4.lib bufferoverflowU.lib"

-				OutputFile="./_msi.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				ProgramDatabaseFile=".\./_msi.pdb"

-				BaseAddress="0x1D160000"

-				ImportLibrary=".\./_msi.lib"

-				TargetMachine="0"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="ReleaseAMD64|Win32"

-			OutputDirectory="."

-			IntermediateDirectory="amd64-temp-release\_msi"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE"

-			CharacterSet="2">

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalOptions=" /USECL:MS_OPTERON /GS-"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;WIN32;NDEBUG;_WINDOWS;_USRDLL"

-				StringPooling="TRUE"

-				BasicRuntimeChecks="0"

-				RuntimeLibrary="2"

-				BufferSecurityCheck="FALSE"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				Detect64BitPortabilityProblems="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalOptions=" /MACHINE:AMD64 /USELINK:MS_SDK"

-				AdditionalDependencies="fci.lib msi.lib rpcrt4.lib bufferoverflowU.lib"

-				OutputFile="./_msi.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				ProgramDatabaseFile=".\./_msi.pdb"

-				BaseAddress="0x1D160000"

-				ImportLibrary=".\./_msi.lib"

-				TargetMachine="0"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<File

-			RelativePath="..\..\PC\_msi.c">

-		</File>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS7.1/_socket.vcproj b/PC/VS7.1/_socket.vcproj
deleted file mode 100644
index ffed8e4..0000000
--- a/PC/VS7.1/_socket.vcproj
+++ /dev/null
@@ -1,254 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="7.10"

-	Name="_socket"

-	SccProjectName="_socket"

-	SccLocalPath="..">

-	<Platforms>

-		<Platform

-			Name="Win32"/>

-	</Platforms>

-	<Configurations>

-		<Configuration

-			Name="Debug|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\x86-temp-debug\_socket"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE">

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="0"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;_DEBUG;WIN32;_WINDOWS"

-				RuntimeLibrary="3"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib"

-				OutputFile="./_socket_d.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./_socket_d.pdb"

-				SubSystem="2"

-				BaseAddress="0x1e1D0000"

-				ImportLibrary=".\./_socket_d.lib"

-				TargetMachine="1"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="Release|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\x86-temp-release\_socket"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE">

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;NDEBUG;WIN32;_WINDOWS"

-				StringPooling="TRUE"

-				RuntimeLibrary="2"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib"

-				OutputFile="./_socket.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./_socket.pdb"

-				SubSystem="2"

-				BaseAddress="0x1e1D0000"

-				ImportLibrary=".\./_socket.lib"

-				TargetMachine="1"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="ReleaseItanium|Win32"

-			OutputDirectory="./."

-			IntermediateDirectory=".\ia64-temp-release\_socket"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE">

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalOptions=" /USECL:MS_ITANIUM /GS-"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;NDEBUG;WIN32;_WINDOWS"

-				StringPooling="TRUE"

-				BasicRuntimeChecks="0"

-				RuntimeLibrary="2"

-				BufferSecurityCheck="FALSE"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				Detect64BitPortabilityProblems="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalOptions=" /MACHINE:IA64 /USELINK:MS_SDK"

-				AdditionalDependencies="ws2_32.lib"

-				OutputFile="./_socket.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./_socket.pdb"

-				SubSystem="2"

-				BaseAddress="0x1e1D0000"

-				ImportLibrary=".\./_socket.lib"

-				TargetMachine="0"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="ReleaseAMD64|Win32"

-			OutputDirectory="."

-			IntermediateDirectory="amd64-temp-release\_socket"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE">

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalOptions=" /USECL:MS_OPTERON /GS-"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;NDEBUG;WIN32;_WINDOWS"

-				StringPooling="TRUE"

-				BasicRuntimeChecks="0"

-				RuntimeLibrary="2"

-				BufferSecurityCheck="FALSE"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				Detect64BitPortabilityProblems="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalOptions=" /MACHINE:AMD64 /USELINK:MS_SDK"

-				AdditionalDependencies="ws2_32.lib"

-				OutputFile="./_socket.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./_socket.pdb"

-				SubSystem="2"

-				BaseAddress="0x1e1D0000"

-				ImportLibrary=".\./_socket.lib"

-				TargetMachine="0"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<File

-			RelativePath="..\..\Modules\socketmodule.c">

-		</File>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS7.1/_sqlite3.vcproj b/PC/VS7.1/_sqlite3.vcproj
deleted file mode 100644
index 9f7d991..0000000
--- a/PC/VS7.1/_sqlite3.vcproj
+++ /dev/null
@@ -1,283 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="7.10"

-	Name="_sqlite3"

-	ProjectGUID="{2FF0A312-22F9-4C34-B070-842916DE27A9}"

-	SccProjectName="_sqlite3"

-	SccLocalPath="..">

-	<Platforms>

-		<Platform

-			Name="Win32"/>

-	</Platforms>

-	<Configurations>

-		<Configuration

-			Name="Debug|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\x86-temp-debug\_sqlite3"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE">

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="0"

-				AdditionalIncludeDirectories="..\..\Include;..\..\PC;..\..\..\sqlite-source-3.3.4"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;_DEBUG;WIN32;_WINDOWS;MODULE_NAME=\&quot;sqlite3\&quot;"

-				RuntimeLibrary="3"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="..\..\..\sqlite-source-3.3.4\sqlite3.lib"

-				OutputFile="./_sqlite3_d.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				IgnoreDefaultLibraryNames=""

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./_sqlite3_d.pdb"

-				SubSystem="2"

-				BaseAddress="0x1e180000"

-				ImportLibrary=".\./_sqlite3_d.lib"

-				TargetMachine="1"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="Release|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\x86-temp-release\_sqlite3"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE">

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include;..\..\PC;..\..\..\sqlite-source-3.3.4"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;NDEBUG;WIN32;_WINDOWS;MODULE_NAME=\&quot;sqlite3\&quot;"

-				StringPooling="TRUE"

-				RuntimeLibrary="2"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="..\..\..\sqlite-source-3.3.4\sqlite3.lib"

-				OutputFile="./_sqlite3.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				IgnoreDefaultLibraryNames=""

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./_sqlite3.pdb"

-				SubSystem="2"

-				BaseAddress="0x1e180000"

-				ImportLibrary=".\./_sqlite3.lib"

-				TargetMachine="1"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="ReleaseItanium|Win32"

-			OutputDirectory="./."

-			IntermediateDirectory=".\ia64-temp-release\_sqlite3"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE">

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalOptions=" /USECL:MS_ITANIUM /GS-"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include;..\..\PC;..\..\..\sqlite-source-3.3.4"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;NDEBUG;WIN32;_WINDOWS;MODULE_NAME=\&quot;sqlite3\&quot;"

-				StringPooling="TRUE"

-				BasicRuntimeChecks="0"

-				RuntimeLibrary="2"

-				BufferSecurityCheck="FALSE"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				Detect64BitPortabilityProblems="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalOptions=" /MACHINE:IA64 /USELINK:MS_SDK"

-				AdditionalDependencies="..\..\..\sqlite-source-3.3.4\ia64\sqlite3.lib"

-				OutputFile="./_sqlite3.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				IgnoreDefaultLibraryNames=""

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./_sqlite3.pdb"

-				SubSystem="2"

-				BaseAddress="0x1e180000"

-				ImportLibrary=".\./_sqlite3.lib"

-				TargetMachine="0"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="ReleaseAMD64|Win32"

-			OutputDirectory="."

-			IntermediateDirectory="amd64-temp-release\_sqlite3"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE">

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalOptions=" /USECL:MS_OPTERON /GS-"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include;..\..\PC;..\..\..\sqlite-source-3.3.4"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;NDEBUG;WIN32;_WINDOWS;MODULE_NAME=\&quot;sqlite3\&quot;"

-				StringPooling="TRUE"

-				BasicRuntimeChecks="0"

-				RuntimeLibrary="2"

-				BufferSecurityCheck="FALSE"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				Detect64BitPortabilityProblems="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalOptions=" /MACHINE:AMD64 /USELINK:MS_SDK"

-				AdditionalDependencies="..\..\..\sqlite-source-3.3.4\amd64\sqlite3.lib"

-				OutputFile="./_sqlite3.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				IgnoreDefaultLibraryNames=""

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./_sqlite3.pdb"

-				SubSystem="2"

-				BaseAddress="0x1e180000"

-				ImportLibrary=".\./_sqlite3.lib"

-				TargetMachine="0"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<File

-			RelativePath="..\..\Modules\_sqlite\cache.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\_sqlite\connection.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\_sqlite\cursor.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\_sqlite\microprotocols.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\_sqlite\module.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\_sqlite\prepare_protocol.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\_sqlite\row.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\_sqlite\statement.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\_sqlite\util.c">

-		</File>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS7.1/_ssl.mak b/PC/VS7.1/_ssl.mak
deleted file mode 100644
index 8476a63..0000000
--- a/PC/VS7.1/_ssl.mak
+++ /dev/null
@@ -1,38 +0,0 @@
-EXTRA_LIBS=
-
-!IFDEF DEBUG
-SUFFIX=_d.pyd
-TEMP=x86-temp-debug/
-CFLAGS=/Od /Zi /MDd /LDd /DDEBUG /D_DEBUG /DWIN32
-SSL_LIB_DIR=$(SSL_DIR)/out32.dbg
-!ELSE
-SUFFIX=.pyd
-TEMP=x86-temp-release/
-CFLAGS=/Ox /MD /LD /DWIN32
-SSL_LIB_DIR=$(SSL_DIR)/out32
-!ENDIF
-
-INCLUDES=-I ../../Include -I ../../PC -I $(SSL_DIR)/inc32
-
-SSL_LIBS=gdi32.lib wsock32.lib user32.lib advapi32.lib /LIBPATH:$(SSL_LIB_DIR) libeay32.lib ssleay32.lib
-SSL_SOURCE=../../Modules/_ssl.c 
-
-HASH_LIBS=gdi32.lib user32.lib advapi32.lib /libpath:$(SSL_LIB_DIR) libeay32.lib
-HASH_SOURCE=../../Modules/_hashopenssl.c 
-
-all: _ssl$(SUFFIX) _hashlib$(SUFFIX)
-
-# Split compile/link into two steps to better support VSExtComp
-_ssl$(SUFFIX): $(SSL_SOURCE) $(SSL_LIB_DIR)/libeay32.lib $(SSL_LIB_DIR)/ssleay32.lib ../../PC/*.h ../../Include/*.h
-	@if not exist "$(TEMP)/_ssl/." mkdir "$(TEMP)/_ssl"
-	cl /nologo /c $(SSL_SOURCE) $(CFLAGS) /Fo$(TEMP)\_ssl\$*.obj $(INCLUDES)
-	link /nologo @<<
-             /dll /out:_ssl$(SUFFIX) $(TEMP)\_ssl\$*.obj $(SSL_LIBS) $(EXTRA_LIBS)
-<<
-
-_hashlib$(SUFFIX): $(HASH_SOURCE) $(SSL_LIB_DIR)/libeay32.lib ../../PC/*.h ../../Include/*.h
-    @if not exist "$(TEMP)/_hashlib/." mkdir "$(TEMP)/_hashlib"
-    cl /nologo /c $(HASH_SOURCE) $(CFLAGS) $(EXTRA_CFLAGS) /Fo$(TEMP)\_hashlib\$*.obj $(INCLUDES) 
-    link /nologo @<<
-	/dll /out:_hashlib$(SUFFIX) $(HASH_LIBS) $(EXTRA_LIBS) $(TEMP)\_hashlib\$*.obj
-<<
diff --git a/PC/VS7.1/_ssl.vcproj b/PC/VS7.1/_ssl.vcproj
deleted file mode 100644
index 56d65fe..0000000
--- a/PC/VS7.1/_ssl.vcproj
+++ /dev/null
@@ -1,84 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="7.10"

-	Name="_ssl"

-	RootNamespace="_ssl"

-	SccProjectName=""

-	SccLocalPath=""

-	Keyword="MakeFileProj">

-	<Platforms>

-		<Platform

-			Name="Win32"/>

-	</Platforms>

-	<Configurations>

-		<Configuration

-			Name="Release|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\x86-temp-release\_ssl"

-			ConfigurationType="0"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE">

-			<Tool

-				Name="VCNMakeTool"

-				BuildCommandLine="build_ssl.bat $(ConfigurationName)"

-				ReBuildCommandLine="build_ssl.bat $(ConfigurationName) -a"

-				CleanCommandLine="echo Nothing to do"

-				Output="_ssl.pyd"/>

-		</Configuration>

-		<Configuration

-			Name="Debug|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\x86-temp-debug\_ssl"

-			ConfigurationType="0"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE">

-			<Tool

-				Name="VCNMakeTool"

-				BuildCommandLine="build_ssl.bat $(ConfigurationName)"

-				ReBuildCommandLine="build_ssl.bat $(ConfigurationName) -a"

-				CleanCommandLine="echo Nothing to do"

-				Output="_ssl_d.pyd"/>

-		</Configuration>

-		<Configuration

-			Name="ReleaseItanium|Win32"

-			OutputDirectory="./."

-			IntermediateDirectory=".\ia64-temp-release\_ssl"

-			ConfigurationType="0"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE">

-			<Tool

-				Name="VCNMakeTool"

-				BuildCommandLine="build_ssl.bat $(ConfigurationName)"

-				ReBuildCommandLine="build_ssl.bat $(ConfigurationName) -a"

-				CleanCommandLine="echo Nothing to do"

-				Output="_ssl.pyd"/>

-		</Configuration>

-		<Configuration

-			Name="ReleaseAMD64|Win32"

-			OutputDirectory="."

-			IntermediateDirectory="amd64-temp-release\_ssl"

-			ConfigurationType="0"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE">

-			<Tool

-				Name="VCNMakeTool"

-				BuildCommandLine="build_ssl.bat $(ConfigurationName)"

-				ReBuildCommandLine="build_ssl.bat $(ConfigurationName) -a"

-				CleanCommandLine="echo Nothing to do"

-				Output="_ssl.pyd"/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<File

-			RelativePath="..\..\Modules\_ssl.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\_hashopenssl.c">

-		</File>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS7.1/_testcapi.vcproj b/PC/VS7.1/_testcapi.vcproj
deleted file mode 100644
index 0197842..0000000
--- a/PC/VS7.1/_testcapi.vcproj
+++ /dev/null
@@ -1,247 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="7.10"

-	Name="_testcapi"

-	SccProjectName="_testcapi"

-	SccLocalPath="..">

-	<Platforms>

-		<Platform

-			Name="Win32"/>

-	</Platforms>

-	<Configurations>

-		<Configuration

-			Name="Release|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\x86-temp-release\_testcapi"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE"

-			CharacterSet="2">

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;WIN32;NDEBUG;_WINDOWS;_USRDLL;MMAP_EXPORTS"

-				StringPooling="TRUE"

-				RuntimeLibrary="2"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				OutputFile="./_testcapi.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				ProgramDatabaseFile=".\./_testcapi.pdb"

-				BaseAddress="0x1e1F0000"

-				ImportLibrary=".\./_testcapi.lib"

-				TargetMachine="1"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="Debug|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\x86-temp-debug\_testcapi"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE"

-			CharacterSet="2">

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="0"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;WIN32;_DEBUG;_WINDOWS;_USRDLL;MMAP_EXPORTS"

-				BasicRuntimeChecks="3"

-				RuntimeLibrary="3"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				OutputFile="./_testcapi_d.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./_testcapi_d.pdb"

-				BaseAddress="0x1e1F0000"

-				ImportLibrary=".\./_testcapi_d.lib"

-				TargetMachine="1"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="ReleaseItanium|Win32"

-			OutputDirectory="./."

-			IntermediateDirectory=".\ia64-temp-release\_testcapi"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE"

-			CharacterSet="2">

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalOptions=" /USECL:MS_ITANIUM /GS-"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;WIN32;NDEBUG;_WINDOWS;_USRDLL;MMAP_EXPORTS"

-				StringPooling="TRUE"

-				BasicRuntimeChecks="0"

-				RuntimeLibrary="2"

-				BufferSecurityCheck="FALSE"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				Detect64BitPortabilityProblems="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalOptions=" /MACHINE:IA64 /USELINK:MS_SDK"

-				OutputFile="./_testcapi.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				ProgramDatabaseFile=".\./_testcapi.pdb"

-				BaseAddress="0x1e1F0000"

-				ImportLibrary=".\./_testcapi.lib"

-				TargetMachine="0"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="ReleaseAMD64|Win32"

-			OutputDirectory="."

-			IntermediateDirectory="amd64-temp-release\_testcapi"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE"

-			CharacterSet="2">

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalOptions=" /USECL:MS_OPTERON /GS-"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;WIN32;NDEBUG;_WINDOWS;_USRDLL;MMAP_EXPORTS"

-				StringPooling="TRUE"

-				BasicRuntimeChecks="0"

-				RuntimeLibrary="2"

-				BufferSecurityCheck="FALSE"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				Detect64BitPortabilityProblems="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalOptions=" /MACHINE:AMD64 /USELINK:MS_SDK"

-				OutputFile="./_testcapi.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				ProgramDatabaseFile=".\./_testcapi.pdb"

-				BaseAddress="0x1e1F0000"

-				ImportLibrary=".\./_testcapi.lib"

-				TargetMachine="0"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<File

-			RelativePath="..\..\Modules\_testcapimodule.c">

-		</File>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS7.1/_tkinter.vcproj b/PC/VS7.1/_tkinter.vcproj
deleted file mode 100644
index 5f73416..0000000
--- a/PC/VS7.1/_tkinter.vcproj
+++ /dev/null
@@ -1,261 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="7.10"

-	Name="_tkinter"

-	SccProjectName="_tkinter"

-	SccLocalPath="..\..\..\..">

-	<Platforms>

-		<Platform

-			Name="Win32"/>

-	</Platforms>

-	<Configurations>

-		<Configuration

-			Name="Release|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\x86-temp-release\_tkinter"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE">

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\..\tcltk\include,..\..\Include,..\..\PC"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;NDEBUG;WIN32;_WINDOWS;WITH_APPINIT"

-				StringPooling="TRUE"

-				RuntimeLibrary="2"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="..\..\..\tcltk\lib\tk84.lib ..\..\..\tcltk\lib\tcl84.lib odbccp32.lib"

-				OutputFile="./_tkinter.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				AdditionalLibraryDirectories=""

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./_tkinter.pdb"

-				SubSystem="2"

-				BaseAddress="0x1e190000"

-				ImportLibrary=".\./_tkinter.lib"

-				TargetMachine="1"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="Debug|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\x86-temp-debug\_tkinter"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE">

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="0"

-				AdditionalIncludeDirectories="..\..\..\tcltk\include,..\..\Include,..\..\PC"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;_DEBUG;WIN32;_WINDOWS;WITH_APPINIT"

-				RuntimeLibrary="3"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="..\..\..\tcltk\lib\tk84.lib ..\..\..\tcltk\lib\tcl84.lib odbccp32.lib"

-				OutputFile="./_tkinter_d.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				AdditionalLibraryDirectories=""

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./_tkinter_d.pdb"

-				SubSystem="2"

-				BaseAddress="0x1e190000"

-				ImportLibrary=".\./_tkinter_d.lib"

-				TargetMachine="1"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="ReleaseItanium|Win32"

-			OutputDirectory="./."

-			IntermediateDirectory=".\ia64-temp-release\_tkinter"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE">

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalOptions=" /USECL:MS_ITANIUM /GS-"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\..\tcltk\include,..\..\Include,..\..\PC"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;NDEBUG;WIN32;_WINDOWS;WITH_APPINIT"

-				StringPooling="TRUE"

-				BasicRuntimeChecks="0"

-				RuntimeLibrary="2"

-				BufferSecurityCheck="FALSE"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				Detect64BitPortabilityProblems="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalOptions=" /MACHINE:IA64 /USELINK:MS_SDK"

-				AdditionalDependencies="..\..\..\tcltk\lib\tk84.lib ..\..\..\tcltk\lib\tcl84.lib odbccp32.lib"

-				OutputFile="./_tkinter.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				AdditionalLibraryDirectories=""

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./_tkinter.pdb"

-				SubSystem="2"

-				BaseAddress="0x1e190000"

-				ImportLibrary=".\./_tkinter.lib"

-				TargetMachine="0"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="ReleaseAMD64|Win32"

-			OutputDirectory="."

-			IntermediateDirectory="amd64-temp-release\_tkinter"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE">

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalOptions=" /USECL:MS_OPTERON /GS-"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\..\tcltk\include,..\..\Include,..\..\PC"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;NDEBUG;WIN32;_WINDOWS;WITH_APPINIT"

-				StringPooling="TRUE"

-				BasicRuntimeChecks="0"

-				RuntimeLibrary="2"

-				BufferSecurityCheck="FALSE"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				Detect64BitPortabilityProblems="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalOptions=" /MACHINE:AMD64 /USELINK:MS_SDK"

-				AdditionalDependencies="..\..\..\tcltk\lib\tk84.lib ..\..\..\tcltk\lib\tcl84.lib odbccp32.lib"

-				OutputFile="./_tkinter.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				AdditionalLibraryDirectories=""

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./_tkinter.pdb"

-				SubSystem="2"

-				BaseAddress="0x1e190000"

-				ImportLibrary=".\./_tkinter.lib"

-				TargetMachine="0"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<File

-			RelativePath="..\..\Modules\_tkinter.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\tkappinit.c">

-		</File>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS7.1/amd64_ml64.bat b/PC/VS7.1/amd64_ml64.bat
deleted file mode 100644
index fa9acf1..0000000
--- a/PC/VS7.1/amd64_ml64.bat
+++ /dev/null
@@ -1,17 +0,0 @@
-@echo off
-rem Try to find the AMD64 assembler and call it with the supplied arguments.
-
-set MLEXE=Microsoft Platform SDK\Bin\Win64\x86\AMD64\ml64.EXE
-
-rem For the environment variables see also
-rem http://msdn.microsoft.com/library/en-us/win64/win64/wow64_implementation_details.asp
-
-if exist "%ProgramFiles%\%MLEXE%" (
-  set ML64="%ProgramFiles%\%MLEXE%"
-) else if exist "%ProgramW6432%\%MLEXE%" (
-  set ML64="%ProgramW6432%\%MLEXE%"
-) else (
-  set ML64=ml64.exe
-)
-
-%ML64% %*
diff --git a/PC/VS7.1/build_ssl.bat b/PC/VS7.1/build_ssl.bat
deleted file mode 100644
index f6be3c0..0000000
--- a/PC/VS7.1/build_ssl.bat
+++ /dev/null
@@ -1,12 +0,0 @@
-if "%1" == "ReleaseAMD64" call "%MSSdk%\SetEnv" /XP64 /RETAIL
-
-@echo off
-if not defined HOST_PYTHON (
-  if %1 EQU Debug (
-    set HOST_PYTHON=python_d.exe
-  ) ELSE (
-    set HOST_PYTHON=python.exe
-  )
-)
-%HOST_PYTHON% build_ssl.py %1 %2
-
diff --git a/PC/VS7.1/build_ssl.py b/PC/VS7.1/build_ssl.py
deleted file mode 100644
index 2e9f4e3..0000000
--- a/PC/VS7.1/build_ssl.py
+++ /dev/null
@@ -1,181 +0,0 @@
-# Script for building the _ssl and _hashlib modules for Windows.
-# Uses Perl to setup the OpenSSL environment correctly
-# and build OpenSSL, then invokes a simple nmake session
-# for the actual _ssl.pyd and _hashlib.pyd DLLs.
-
-# THEORETICALLY, you can:
-# * Unpack the latest SSL release one level above your main Python source
-#   directory.  It is likely you will already find the zlib library and
-#   any other external packages there.
-# * Install ActivePerl and ensure it is somewhere on your path.
-# * Run this script from the PCBuild directory.
-#
-# it should configure and build SSL, then build the _ssl and _hashlib
-# Python extensions without intervention.
-
-import os, sys, re
-
-# Find all "foo.exe" files on the PATH.
-def find_all_on_path(filename, extras = None):
-    entries = os.environ["PATH"].split(os.pathsep)
-    ret = []
-    for p in entries:
-        fname = os.path.abspath(os.path.join(p, filename))
-        if os.path.isfile(fname) and fname not in ret:
-            ret.append(fname)
-    if extras:
-        for p in extras:
-            fname = os.path.abspath(os.path.join(p, filename))
-            if os.path.isfile(fname) and fname not in ret:
-                ret.append(fname)
-    return ret
-
-# Find a suitable Perl installation for OpenSSL.
-# cygwin perl does *not* work.  ActivePerl does.
-# Being a Perl dummy, the simplest way I can check is if the "Win32" package
-# is available.
-def find_working_perl(perls):
-    for perl in perls:
-        fh = os.popen(perl + ' -e "use Win32;"')
-        fh.read()
-        rc = fh.close()
-        if rc:
-            continue
-        return perl
-    print "Can not find a suitable PERL:"
-    if perls:
-        print " the following perl interpreters were found:"
-        for p in perls:
-            print " ", p
-        print " None of these versions appear suitable for building OpenSSL"
-    else:
-        print " NO perl interpreters were found on this machine at all!"
-    print " Please install ActivePerl and ensure it appears on your path"
-    print "The Python SSL module was not built"
-    return None
-
-# Locate the best SSL directory given a few roots to look into.
-def find_best_ssl_dir(sources):
-    candidates = []
-    for s in sources:
-        try:
-            # note: do not abspath s; the build will fail if any
-            # higher up directory name has spaces in it.
-            fnames = os.listdir(s)
-        except os.error:
-            fnames = []
-        for fname in fnames:
-            fqn = os.path.join(s, fname)
-            if os.path.isdir(fqn) and fname.startswith("openssl-"):
-                candidates.append(fqn)
-    # Now we have all the candidates, locate the best.
-    best_parts = []
-    best_name = None
-    for c in candidates:
-        parts = re.split("[.-]", os.path.basename(c))[1:]
-        # eg - openssl-0.9.7-beta1 - ignore all "beta" or any other qualifiers
-        if len(parts) >= 4:
-            continue
-        if parts > best_parts:
-            best_parts = parts
-            best_name = c
-    if best_name is not None:
-        print "Found an SSL directory at '%s'" % (best_name,)
-    else:
-        print "Could not find an SSL directory in '%s'" % (sources,)
-    sys.stdout.flush()
-    return best_name
-
-def run_configure(configure, do_script):
-    os.system("perl Configure "+configure)
-    os.system(do_script)
-
-def main():
-    build_all = "-a" in sys.argv
-    if sys.argv[1] == "Release":
-        arch = "x86"
-        debug = False
-        configure = "VC-WIN32"
-        do_script = "ms\\do_masm"
-        makefile = "ms\\nt.mak"
-    elif sys.argv[1] == "Debug":
-        arch = "x86"
-        debug = True
-        configure = "VC-WIN32"
-        do_script = "ms\\do_masm"
-        makefile="ms\\d32.mak"
-    elif sys.argv[1] == "ReleaseItanium":
-        arch = "ia64"
-        debug = False
-        configure = "VC-WIN64I"
-        do_script = "ms\\do_win64i"
-        makefile = "ms\\nt.mak"
-        os.environ["VSEXTCOMP_USECL"] = "MS_ITANIUM"
-    elif sys.argv[1] == "ReleaseAMD64":
-        arch="amd64"
-        debug=False
-        configure = "VC-WIN64A"
-        do_script = "ms\\do_win64a"
-        makefile = "ms\\nt.mak"
-        os.environ["VSEXTCOMP_USECL"] = "MS_OPTERON"
-    make_flags = ""
-    if build_all:
-        make_flags = "-a"
-    # perl should be on the path, but we also look in "\perl" and "c:\\perl"
-    # as "well known" locations
-    perls = find_all_on_path("perl.exe", ["\\perl\\bin", "C:\\perl\\bin"])
-    perl = find_working_perl(perls)
-    if perl is None:
-        sys.exit(1)
-
-    print "Found a working perl at '%s'" % (perl,)
-    sys.stdout.flush()
-    # Look for SSL 2 levels up from pcbuild - ie, same place zlib etc all live.
-    ssl_dir = find_best_ssl_dir(("..\\..\\..",))
-    if ssl_dir is None:
-        sys.exit(1)
-
-    old_cd = os.getcwd()
-    try:
-        os.chdir(ssl_dir)
-        # If the ssl makefiles do not exist, we invoke Perl to generate them.
-        # Due to a bug in this script, the makefile sometimes ended up empty
-        # Force a regeneration if it is.
-        if not os.path.isfile(makefile) or os.path.getsize(makefile)==0:
-            print "Creating the makefiles..."
-            sys.stdout.flush()
-            # Put our working Perl at the front of our path
-            os.environ["PATH"] = os.path.dirname(perl) + \
-                                          os.pathsep + \
-                                          os.environ["PATH"]
-            run_configure(configure, do_script)
-            if arch=="x86" and debug:
-                # the do_masm script in openssl doesn't generate a debug
-                # build makefile so we generate it here:
-                os.system("perl util\mk1mf.pl debug "+configure+" >"+makefile)
-
-        # Now run make.
-        makeCommand = "nmake /nologo PERL=\"%s\" -f \"%s\"" %(perl, makefile)
-        print "Executing ssl makefiles:", makeCommand
-        sys.stdout.flush()
-        rc = os.system(makeCommand)
-        if rc:
-            print "Executing "+makefile+" failed"
-            print rc
-            sys.exit(rc)
-    finally:
-        os.chdir(old_cd)
-    # And finally, we can build the _ssl module itself for Python.
-    defs = "SSL_DIR=\"%s\"" % (ssl_dir,)
-    if debug:
-        defs = defs + " " + "DEBUG=1"
-    if arch in ('amd64', 'ia64'):
-        defs = defs + " EXTRA_CFLAGS=/GS- EXTRA_LIBS=bufferoverflowU.lib"
-    makeCommand = 'nmake /nologo -f _ssl.mak ' + defs + " " + make_flags
-    print "Executing:", makeCommand
-    sys.stdout.flush()
-    rc = os.system(makeCommand)
-    sys.exit(rc)
-
-if __name__=='__main__':
-    main()
diff --git a/PC/VS7.1/bz2.vcproj b/PC/VS7.1/bz2.vcproj
deleted file mode 100644
index 0b005a1..0000000
--- a/PC/VS7.1/bz2.vcproj
+++ /dev/null
@@ -1,271 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="7.10"

-	Name="bz2"

-	RootNamespace="bz2"

-	SccProjectName="bz2"

-	SccLocalPath="..">

-	<Platforms>

-		<Platform

-			Name="Win32"/>

-	</Platforms>

-	<Configurations>

-		<Configuration

-			Name="Debug|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\x86-temp-debug\bz2"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE">

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="0"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC,..\..\..\bzip2-1.0.3"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;_DEBUG;WIN32;_WINDOWS"

-				RuntimeLibrary="3"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="..\..\..\bzip2-1.0.3\libbz2.lib"

-				OutputFile="./bz2_d.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				IgnoreDefaultLibraryNames="msvcrt,libc"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./bz2_d.pdb"

-				SubSystem="2"

-				BaseAddress="0x1D170000"

-				ImportLibrary=".\./bz2_d.lib"

-				TargetMachine="1"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"

-				CommandLine="cd ..\..\..\bzip2-1.0.3

-nmake /nologo /f makefile.msc

-"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="Release|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\x86-temp-release\bz2"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE">

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC,..\..\..\bzip2-1.0.3"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;NDEBUG;WIN32;_WINDOWS"

-				StringPooling="TRUE"

-				RuntimeLibrary="2"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="..\..\..\bzip2-1.0.3\libbz2.lib"

-				OutputFile="./bz2.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				IgnoreDefaultLibraryNames="libc"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./bz2.pdb"

-				SubSystem="2"

-				BaseAddress="0x1D170000"

-				ImportLibrary=".\./bz2.lib"

-				TargetMachine="1"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"

-				CommandLine="cd ..\..\..\bzip2-1.0.3

-nmake /nologo /f makefile.msc lib

-"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="ReleaseItanium|Win32"

-			OutputDirectory="./."

-			IntermediateDirectory=".\ia64-temp-release\bz2"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE">

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalOptions=" /USECL:MS_ITANIUM /GS-"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC,..\..\..\bzip2-1.0.3"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;NDEBUG;WIN32;_WINDOWS"

-				StringPooling="TRUE"

-				BasicRuntimeChecks="0"

-				RuntimeLibrary="2"

-				BufferSecurityCheck="FALSE"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				Detect64BitPortabilityProblems="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalOptions=" /MACHINE:IA64 /USELINK:MS_SDK"

-				AdditionalDependencies="..\..\..\bzip2-1.0.3\libbz2.lib"

-				OutputFile="./bz2.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				IgnoreDefaultLibraryNames="libc"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./bz2.pdb"

-				SubSystem="2"

-				BaseAddress="0x1D170000"

-				ImportLibrary=".\./bz2.lib"

-				TargetMachine="0"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"

-				CommandLine="cd ..\..\..\bzip2-1.0.3

-nmake /nologo /f makefile.msc lib

-"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="ReleaseAMD64|Win32"

-			OutputDirectory="."

-			IntermediateDirectory="amd64-temp-release\bz2"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE">

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalOptions=" /USECL:MS_OPTERON /GS-"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC,..\..\..\bzip2-1.0.3"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;NDEBUG;WIN32;_WINDOWS"

-				StringPooling="TRUE"

-				BasicRuntimeChecks="0"

-				RuntimeLibrary="2"

-				BufferSecurityCheck="FALSE"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				Detect64BitPortabilityProblems="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalOptions=" /MACHINE:AMD64 /USELINK:MS_SDK"

-				AdditionalDependencies="..\..\..\bzip2-1.0.3\libbz2.lib"

-				OutputFile="./bz2.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				IgnoreDefaultLibraryNames="libc"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./bz2.pdb"

-				SubSystem="2"

-				BaseAddress="0x1D170000"

-				ImportLibrary=".\./bz2.lib"

-				TargetMachine="0"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"

-				CommandLine="cd ..\..\..\bzip2-1.0.3

-nmake /nologo /f makefile.msc lib

-"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<File

-			RelativePath="..\..\Modules\bz2module.c">

-		</File>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS7.1/db.build b/PC/VS7.1/db.build
deleted file mode 100644
index 6a87f74..0000000
--- a/PC/VS7.1/db.build
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0"?>
-<project>
- <target name="all" description="Build all targets.">
-   <solution configuration="release">
-     <projects>
-       <include name="db_static.vcproj" />
-     </projects>
-   </solution>
- </target>
-</project>
diff --git a/PC/VS7.1/field3.py b/PC/VS7.1/field3.py
deleted file mode 100644
index 47f24ca..0000000
--- a/PC/VS7.1/field3.py
+++ /dev/null
@@ -1,35 +0,0 @@
-# An absurd workaround for the lack of arithmetic in MS's resource compiler.
-# After building Python, run this, then paste the output into the appropriate
-# part of PC\python_nt.rc.
-# Example output:
-#
-# * For 2.3a0,
-# * PY_MICRO_VERSION = 0
-# * PY_RELEASE_LEVEL = 'alpha' = 0xA
-# * PY_RELEASE_SERIAL = 1
-# *
-# * and 0*1000 + 10*10 + 1 = 101.
-# */
-# #define FIELD3 101
-
-import sys
-
-major, minor, micro, level, serial = sys.version_info
-levelnum = {'alpha': 0xA,
-            'beta': 0xB,
-            'candidate': 0xC,
-            'final': 0xF,
-           }[level]
-string = sys.version.split()[0] # like '2.3a0'
-
-print " * For %s," % string
-print " * PY_MICRO_VERSION = %d" % micro
-print " * PY_RELEASE_LEVEL = %r = %s" % (level, hex(levelnum))
-print " * PY_RELEASE_SERIAL = %d" % serial
-print " *"
-
-field3 = micro * 1000 + levelnum * 10 + serial
-
-print " * and %d*1000 + %d*10 + %d = %d" % (micro, levelnum, serial, field3)
-print " */"
-print "#define FIELD3", field3
diff --git a/PC/VS7.1/installer.bmp b/PC/VS7.1/installer.bmp
deleted file mode 100644
index 1875e19..0000000
--- a/PC/VS7.1/installer.bmp
+++ /dev/null
Binary files differ
diff --git a/PC/VS7.1/make_buildinfo.c b/PC/VS7.1/make_buildinfo.c
deleted file mode 100644
index 2aa2b66..0000000
--- a/PC/VS7.1/make_buildinfo.c
+++ /dev/null
@@ -1,92 +0,0 @@
-#include <windows.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <stdio.h>
-
-/* This file creates the getbuildinfo.o object, by first
-   invoking subwcrev.exe (if found), and then invoking cl.exe.
-   As a side effect, it might generate PC\VS7.1\getbuildinfo2.c
-   also. If this isn't a subversion checkout, or subwcrev isn't
-   found, it compiles ..\\..\\Modules\\getbuildinfo.c instead.
-
-   Currently, subwcrev.exe is found from the registry entries
-   of TortoiseSVN.
-
-   No attempt is made to place getbuildinfo.o into the proper
-   binary directory. This isn't necessary, as this tool is
-   invoked as a pre-link step for pythoncore, so that overwrites
-   any previous getbuildinfo.o.
-
-*/
-
-int make_buildinfo2()
-{
-    struct _stat st;
-    HKEY hTortoise;
-    char command[500];
-    DWORD type, size;
-    if (_stat(".svn", &st) < 0)
-        return 0;
-    /* Allow suppression of subwcrev.exe invocation if a no_subwcrev file is present. */
-    if (_stat("no_subwcrev", &st) == 0)
-        return 0;
-    if (RegOpenKey(HKEY_LOCAL_MACHINE, "Software\\TortoiseSVN", &hTortoise) != ERROR_SUCCESS &&
-        RegOpenKey(HKEY_CURRENT_USER, "Software\\TortoiseSVN", &hTortoise) != ERROR_SUCCESS)
-        /* Tortoise not installed */
-        return 0;
-    command[0] = '"';  /* quote the path to the executable */
-    size = sizeof(command) - 1;
-    if (RegQueryValueEx(hTortoise, "Directory", 0, &type, command+1, &size) != ERROR_SUCCESS ||
-        type != REG_SZ)
-        /* Registry corrupted */
-        return 0;
-    strcat(command, "bin\\subwcrev.exe");
-    if (_stat(command+1, &st) < 0)
-        /* subwcrev.exe not part of the release */
-        return 0;
-    strcat(command, "\" ..\\.. ..\\..\\Modules\\getbuildinfo.c getbuildinfo2.c");
-    puts(command); fflush(stdout);
-    if (system(command) < 0)
-        return 0;
-    return 1;
-}
-
-int main(int argc, char*argv[])
-{
-    char command[500] = "cl.exe -c -D_WIN32 -DUSE_DL_EXPORT -D_WINDOWS -DWIN32 -D_WINDLL ";
-    int do_unlink, result;
-    if (argc != 2) {
-        fprintf(stderr, "make_buildinfo $(ConfigurationName)\n");
-        return EXIT_FAILURE;
-    }
-    if (strcmp(argv[1], "Release") == 0) {
-        strcat(command, "-MD ");
-    }
-    else if (strcmp(argv[1], "Debug") == 0) {
-        strcat(command, "-D_DEBUG -MDd ");
-    }
-    else if (strcmp(argv[1], "ReleaseItanium") == 0) {
-        strcat(command, "-MD /USECL:MS_ITANIUM ");
-    }
-    else if (strcmp(argv[1], "ReleaseAMD64") == 0) {
-        strcat(command, "-MD ");
-        strcat(command, "-MD /USECL:MS_OPTERON ");
-    }
-    else {
-        fprintf(stderr, "unsupported configuration %s\n", argv[1]);
-        return EXIT_FAILURE;
-    }
-
-    if ((do_unlink = make_buildinfo2()))
-        strcat(command, "getbuildinfo2.c -DSUBWCREV ");
-    else
-        strcat(command, "..\\..\\Modules\\getbuildinfo.c");
-    strcat(command, " -Fogetbuildinfo.o -I..\\..\\Include -I..\\..\\PC");
-    puts(command); fflush(stdout);
-    result = system(command);
-    if (do_unlink)
-        unlink("getbuildinfo2.c");
-    if (result < 0)
-        return EXIT_FAILURE;
-    return 0;
-}
diff --git a/PC/VS7.1/make_buildinfo.vcproj b/PC/VS7.1/make_buildinfo.vcproj
deleted file mode 100644
index d0c8a5d..0000000
--- a/PC/VS7.1/make_buildinfo.vcproj
+++ /dev/null
@@ -1,122 +0,0 @@
-<?xml version="1.0" encoding="windows-1250"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="7.10"

-	Name="make_buildinfo"

-	ProjectGUID="{C73F0EC1-358B-4177-940F-0846AC8B04CD}"

-	Keyword="Win32Proj">

-	<Platforms>

-		<Platform

-			Name="Win32"/>

-	</Platforms>

-	<Configurations>

-		<Configuration

-			Name="Debug|Win32"

-			OutputDirectory="."

-			IntermediateDirectory=".\x86-temp-release\make_buildinfo"

-			ConfigurationType="1"

-			CharacterSet="2">

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="0"

-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"

-				MinimalRebuild="TRUE"

-				BasicRuntimeChecks="3"

-				RuntimeLibrary="5"

-				UsePrecompiledHeader="0"

-				WarningLevel="3"

-				Detect64BitPortabilityProblems="TRUE"

-				DebugInformationFormat="4"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				OutputFile="$(OutDir)/make_buildinfo.exe"

-				LinkIncremental="2"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile="$(OutDir)/make_buildinfo.pdb"

-				SubSystem="1"

-				TargetMachine="1"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="Release|Win32"

-			OutputDirectory="."

-			IntermediateDirectory=".\x86-temp-release\make_buildinfo"

-			ConfigurationType="1"

-			CharacterSet="2">

-			<Tool

-				Name="VCCLCompilerTool"

-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"

-				RuntimeLibrary="4"

-				UsePrecompiledHeader="0"

-				WarningLevel="3"

-				Detect64BitPortabilityProblems="TRUE"

-				DebugInformationFormat="3"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				OutputFile="$(OutDir)/make_buildinfo.exe"

-				LinkIncremental="1"

-				GenerateDebugInformation="TRUE"

-				SubSystem="1"

-				OptimizeReferences="2"

-				EnableCOMDATFolding="2"

-				TargetMachine="1"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<Filter

-			Name="Source Files"

-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"

-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">

-			<File

-				RelativePath=".\make_buildinfo.c">

-			</File>

-		</Filter>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS7.1/make_versioninfo.vcproj b/PC/VS7.1/make_versioninfo.vcproj
deleted file mode 100644
index fffa4eb..0000000
--- a/PC/VS7.1/make_versioninfo.vcproj
+++ /dev/null
@@ -1,142 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="7.10"

-	Name="make_versioninfo"

-	RootNamespace="make_versioninfo"

-	SccProjectName="make_versioninfo"

-	SccLocalPath="..">

-	<Platforms>

-		<Platform

-			Name="Win32"/>

-	</Platforms>

-	<Configurations>

-		<Configuration

-			Name="Release|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\x86-temp-release\make_versioninfo"

-			ConfigurationType="1"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE"

-			CharacterSet="2">

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC"

-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"

-				StringPooling="TRUE"

-				RuntimeLibrary="2"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"

-				CommandLine=".\make_versioninfo.exe &gt;..\..\PC\pythonnt_rc.h

-"

-				Outputs="..\..\PC\pythonnt_rc.h"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="odbccp32.lib"

-				OutputFile=".\./make_versioninfo.exe"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./make_versioninfo.pdb"

-				SubSystem="1"

-				BaseAddress="0x1d000000"

-				TargetMachine="1"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"

-				CommandLine="$(TargetFileName) &gt; ..\..\PC\python_nt.h"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="Debug|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\x86-temp-debug\make_versioninfo"

-			ConfigurationType="1"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE"

-			CharacterSet="2">

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="0"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC"

-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"

-				RuntimeLibrary="3"

-				UsePrecompiledHeader="2"

-				BrowseInformation="1"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"

-				CommandLine=".\make_versioninfo_d.exe &gt;..\..\PC\pythonnt_rc_d.h

-"

-				Outputs="..\..\PC\pythonnt_rc_d.h"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="odbccp32.lib"

-				OutputFile="./make_versioninfo_d.exe"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./make_versioninfo_d.pdb"

-				SubSystem="1"

-				BaseAddress="0x1d000000"

-				TargetMachine="1"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"

-				CommandLine="$(TargetFileName) &gt; ..\..\PC\python_nt_d.h"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<File

-			RelativePath="..\..\PC\make_versioninfo.c">

-		</File>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS7.1/pcbuild.sln b/PC/VS7.1/pcbuild.sln
deleted file mode 100644
index 720f19c..0000000
--- a/PC/VS7.1/pcbuild.sln
+++ /dev/null
@@ -1,275 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 8.00

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_socket", "_socket.vcproj", "{324F66C2-44D0-4D50-B979-F9DAE7FD36DB}"

-	ProjectSection(ProjectDependencies) = postProject

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}

-	EndProjectSection

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_ssl", "_ssl.vcproj", "{8E85BA54-8A47-4C8B-B72E-8E17579CC6D7}"

-	ProjectSection(ProjectDependencies) = postProject

-		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9} = {B11D750F-CD1F-4A96-85CE-E69A5C5259F9}

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}

-		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058} = {E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}

-	EndProjectSection

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_testcapi", "_testcapi.vcproj", "{59CBF474-9E06-4C50-9142-C44A118BB447}"

-	ProjectSection(ProjectDependencies) = postProject

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}

-	EndProjectSection

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_tkinter", "_tkinter.vcproj", "{5B51DFF7-5DC0-41F8-8791-A4AB7114A151}"

-	ProjectSection(ProjectDependencies) = postProject

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}

-	EndProjectSection

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bz2", "bz2.vcproj", "{AC557788-6354-43F7-BE05-C9C8C59A344A}"

-	ProjectSection(ProjectDependencies) = postProject

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}

-	EndProjectSection

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_versioninfo", "make_versioninfo.vcproj", "{F0E0541E-F17D-430B-97C4-93ADF0DD284E}"

-	ProjectSection(ProjectDependencies) = postProject

-	EndProjectSection

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pyexpat", "pyexpat.vcproj", "{7E551393-3C43-47F8-9F3F-5BC368A6C487}"

-	ProjectSection(ProjectDependencies) = postProject

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}

-	EndProjectSection

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "python", "python.vcproj", "{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}"

-	ProjectSection(ProjectDependencies) = postProject

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}

-	EndProjectSection

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythoncore", "pythoncore.vcproj", "{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}"

-	ProjectSection(ProjectDependencies) = postProject

-		{F0E0541E-F17D-430B-97C4-93ADF0DD284E} = {F0E0541E-F17D-430B-97C4-93ADF0DD284E}

-		{C73F0EC1-358B-4177-940F-0846AC8B04CD} = {C73F0EC1-358B-4177-940F-0846AC8B04CD}

-	EndProjectSection

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythonw", "pythonw.vcproj", "{F4229CC3-873C-49AE-9729-DD308ED4CD4A}"

-	ProjectSection(ProjectDependencies) = postProject

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}

-	EndProjectSection

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "select", "select.vcproj", "{97239A56-DBC0-41D2-BC14-C87D9B97D63B}"

-	ProjectSection(ProjectDependencies) = postProject

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}

-	EndProjectSection

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unicodedata", "unicodedata.vcproj", "{FA5FC7EB-C72F-415F-AE42-91DD605ABDDA}"

-	ProjectSection(ProjectDependencies) = postProject

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}

-	EndProjectSection

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "w9xpopen", "w9xpopen.vcproj", "{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}"

-	ProjectSection(ProjectDependencies) = postProject

-	EndProjectSection

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winsound", "winsound.vcproj", "{51F35FAE-FB92-4B2C-9187-1542C065AD77}"

-	ProjectSection(ProjectDependencies) = postProject

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}

-	EndProjectSection

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_elementtree", "_elementtree.vcproj", "{1966DDE2-4AB7-4E4E-ACC9-C121E4D37F8E}"

-	ProjectSection(ProjectDependencies) = postProject

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}

-	EndProjectSection

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_buildinfo", "make_buildinfo.vcproj", "{C73F0EC1-358B-4177-940F-0846AC8B04CD}"

-	ProjectSection(ProjectDependencies) = postProject

-	EndProjectSection

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_msi", "_msi.vcproj", "{2C0BEFB9-70E2-4F80-AC5B-4AB8EE023574}"

-	ProjectSection(ProjectDependencies) = postProject

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}

-	EndProjectSection

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_ctypes", "_ctypes.vcproj", "{F22F40F4-D318-40DC-96B3-88DC81CE0894}"

-	ProjectSection(ProjectDependencies) = postProject

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}

-	EndProjectSection

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_ctypes_test", "_ctypes_test.vcproj", "{8CF334D9-4F82-42EB-97AF-83592C5AFD2F}"

-	ProjectSection(ProjectDependencies) = postProject

-		{F22F40F4-D318-40DC-96B3-88DC81CE0894} = {F22F40F4-D318-40DC-96B3-88DC81CE0894}

-	EndProjectSection

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_sqlite3", "_sqlite3.vcproj", "{2FF0A312-22F9-4C34-B070-842916DE27A9}"

-	ProjectSection(ProjectDependencies) = postProject

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}

-	EndProjectSection

-EndProject

-Global

-	GlobalSection(SolutionConfiguration) = preSolution

-		Debug = Debug

-		Release = Release

-		ReleaseAMD64 = ReleaseAMD64

-		ReleaseItanium = ReleaseItanium

-	EndGlobalSection

-	GlobalSection(ProjectConfiguration) = postSolution

-		{324F66C2-44D0-4D50-B979-F9DAE7FD36DB}.Debug.ActiveCfg = Debug|Win32

-		{324F66C2-44D0-4D50-B979-F9DAE7FD36DB}.Debug.Build.0 = Debug|Win32

-		{324F66C2-44D0-4D50-B979-F9DAE7FD36DB}.Release.ActiveCfg = Release|Win32

-		{324F66C2-44D0-4D50-B979-F9DAE7FD36DB}.Release.Build.0 = Release|Win32

-		{324F66C2-44D0-4D50-B979-F9DAE7FD36DB}.ReleaseAMD64.ActiveCfg = ReleaseAMD64|Win32

-		{324F66C2-44D0-4D50-B979-F9DAE7FD36DB}.ReleaseAMD64.Build.0 = ReleaseAMD64|Win32

-		{324F66C2-44D0-4D50-B979-F9DAE7FD36DB}.ReleaseItanium.ActiveCfg = ReleaseItanium|Win32

-		{324F66C2-44D0-4D50-B979-F9DAE7FD36DB}.ReleaseItanium.Build.0 = ReleaseItanium|Win32

-		{8E85BA54-8A47-4C8B-B72E-8E17579CC6D7}.Debug.ActiveCfg = Debug|Win32

-		{8E85BA54-8A47-4C8B-B72E-8E17579CC6D7}.Debug.Build.0 = Debug|Win32

-		{8E85BA54-8A47-4C8B-B72E-8E17579CC6D7}.Release.ActiveCfg = Release|Win32

-		{8E85BA54-8A47-4C8B-B72E-8E17579CC6D7}.Release.Build.0 = Release|Win32

-		{8E85BA54-8A47-4C8B-B72E-8E17579CC6D7}.ReleaseAMD64.ActiveCfg = ReleaseAMD64|Win32

-		{8E85BA54-8A47-4C8B-B72E-8E17579CC6D7}.ReleaseAMD64.Build.0 = ReleaseAMD64|Win32

-		{8E85BA54-8A47-4C8B-B72E-8E17579CC6D7}.ReleaseItanium.ActiveCfg = ReleaseItanium|Win32

-		{8E85BA54-8A47-4C8B-B72E-8E17579CC6D7}.ReleaseItanium.Build.0 = ReleaseItanium|Win32

-		{59CBF474-9E06-4C50-9142-C44A118BB447}.Debug.ActiveCfg = Debug|Win32

-		{59CBF474-9E06-4C50-9142-C44A118BB447}.Debug.Build.0 = Debug|Win32

-		{59CBF474-9E06-4C50-9142-C44A118BB447}.Release.ActiveCfg = Release|Win32

-		{59CBF474-9E06-4C50-9142-C44A118BB447}.Release.Build.0 = Release|Win32

-		{59CBF474-9E06-4C50-9142-C44A118BB447}.ReleaseAMD64.ActiveCfg = ReleaseAMD64|Win32

-		{59CBF474-9E06-4C50-9142-C44A118BB447}.ReleaseAMD64.Build.0 = ReleaseAMD64|Win32

-		{59CBF474-9E06-4C50-9142-C44A118BB447}.ReleaseItanium.ActiveCfg = ReleaseItanium|Win32

-		{59CBF474-9E06-4C50-9142-C44A118BB447}.ReleaseItanium.Build.0 = ReleaseItanium|Win32

-		{5B51DFF7-5DC0-41F8-8791-A4AB7114A151}.Debug.ActiveCfg = Debug|Win32

-		{5B51DFF7-5DC0-41F8-8791-A4AB7114A151}.Debug.Build.0 = Debug|Win32

-		{5B51DFF7-5DC0-41F8-8791-A4AB7114A151}.Release.ActiveCfg = Release|Win32

-		{5B51DFF7-5DC0-41F8-8791-A4AB7114A151}.Release.Build.0 = Release|Win32

-		{5B51DFF7-5DC0-41F8-8791-A4AB7114A151}.ReleaseAMD64.ActiveCfg = ReleaseAMD64|Win32

-		{5B51DFF7-5DC0-41F8-8791-A4AB7114A151}.ReleaseAMD64.Build.0 = ReleaseAMD64|Win32

-		{5B51DFF7-5DC0-41F8-8791-A4AB7114A151}.ReleaseItanium.ActiveCfg = ReleaseItanium|Win32

-		{5B51DFF7-5DC0-41F8-8791-A4AB7114A151}.ReleaseItanium.Build.0 = ReleaseItanium|Win32

-		{AC557788-6354-43F7-BE05-C9C8C59A344A}.Debug.ActiveCfg = Debug|Win32

-		{AC557788-6354-43F7-BE05-C9C8C59A344A}.Debug.Build.0 = Debug|Win32

-		{AC557788-6354-43F7-BE05-C9C8C59A344A}.Release.ActiveCfg = Release|Win32

-		{AC557788-6354-43F7-BE05-C9C8C59A344A}.Release.Build.0 = Release|Win32

-		{AC557788-6354-43F7-BE05-C9C8C59A344A}.ReleaseAMD64.ActiveCfg = ReleaseAMD64|Win32

-		{AC557788-6354-43F7-BE05-C9C8C59A344A}.ReleaseAMD64.Build.0 = ReleaseAMD64|Win32

-		{AC557788-6354-43F7-BE05-C9C8C59A344A}.ReleaseItanium.ActiveCfg = ReleaseItanium|Win32

-		{AC557788-6354-43F7-BE05-C9C8C59A344A}.ReleaseItanium.Build.0 = ReleaseItanium|Win32

-		{F0E0541E-F17D-430B-97C4-93ADF0DD284E}.Debug.ActiveCfg = Debug|Win32

-		{F0E0541E-F17D-430B-97C4-93ADF0DD284E}.Debug.Build.0 = Debug|Win32

-		{F0E0541E-F17D-430B-97C4-93ADF0DD284E}.Release.ActiveCfg = Release|Win32

-		{F0E0541E-F17D-430B-97C4-93ADF0DD284E}.Release.Build.0 = Release|Win32

-		{F0E0541E-F17D-430B-97C4-93ADF0DD284E}.ReleaseAMD64.ActiveCfg = Release|Win32

-		{F0E0541E-F17D-430B-97C4-93ADF0DD284E}.ReleaseAMD64.Build.0 = Release|Win32

-		{F0E0541E-F17D-430B-97C4-93ADF0DD284E}.ReleaseItanium.ActiveCfg = Release|Win32

-		{F0E0541E-F17D-430B-97C4-93ADF0DD284E}.ReleaseItanium.Build.0 = Release|Win32

-		{7E551393-3C43-47F8-9F3F-5BC368A6C487}.Debug.ActiveCfg = Debug|Win32

-		{7E551393-3C43-47F8-9F3F-5BC368A6C487}.Debug.Build.0 = Debug|Win32

-		{7E551393-3C43-47F8-9F3F-5BC368A6C487}.Release.ActiveCfg = Release|Win32

-		{7E551393-3C43-47F8-9F3F-5BC368A6C487}.Release.Build.0 = Release|Win32

-		{7E551393-3C43-47F8-9F3F-5BC368A6C487}.ReleaseAMD64.ActiveCfg = ReleaseAMD64|Win32

-		{7E551393-3C43-47F8-9F3F-5BC368A6C487}.ReleaseAMD64.Build.0 = ReleaseAMD64|Win32

-		{7E551393-3C43-47F8-9F3F-5BC368A6C487}.ReleaseItanium.ActiveCfg = ReleaseItanium|Win32

-		{7E551393-3C43-47F8-9F3F-5BC368A6C487}.ReleaseItanium.Build.0 = ReleaseItanium|Win32

-		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.Debug.ActiveCfg = Debug|Win32

-		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.Debug.Build.0 = Debug|Win32

-		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.Release.ActiveCfg = Release|Win32

-		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.Release.Build.0 = Release|Win32

-		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.ReleaseAMD64.ActiveCfg = ReleaseAMD64|Win32

-		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.ReleaseAMD64.Build.0 = ReleaseAMD64|Win32

-		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.ReleaseItanium.ActiveCfg = ReleaseItanium|Win32

-		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.ReleaseItanium.Build.0 = ReleaseItanium|Win32

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.Debug.ActiveCfg = Debug|Win32

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.Debug.Build.0 = Debug|Win32

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.Release.ActiveCfg = Release|Win32

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.Release.Build.0 = Release|Win32

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.ReleaseAMD64.ActiveCfg = ReleaseAMD64|Win32

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.ReleaseAMD64.Build.0 = ReleaseAMD64|Win32

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.ReleaseItanium.ActiveCfg = ReleaseItanium|Win32

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.ReleaseItanium.Build.0 = ReleaseItanium|Win32

-		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.Debug.ActiveCfg = Debug|Win32

-		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.Debug.Build.0 = Debug|Win32

-		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.Release.ActiveCfg = Release|Win32

-		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.Release.Build.0 = Release|Win32

-		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.ReleaseAMD64.ActiveCfg = ReleaseAMD64|Win32

-		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.ReleaseAMD64.Build.0 = ReleaseAMD64|Win32

-		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.ReleaseItanium.ActiveCfg = ReleaseItanium|Win32

-		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.ReleaseItanium.Build.0 = ReleaseItanium|Win32

-		{97239A56-DBC0-41D2-BC14-C87D9B97D63B}.Debug.ActiveCfg = Debug|Win32

-		{97239A56-DBC0-41D2-BC14-C87D9B97D63B}.Debug.Build.0 = Debug|Win32

-		{97239A56-DBC0-41D2-BC14-C87D9B97D63B}.Release.ActiveCfg = Release|Win32

-		{97239A56-DBC0-41D2-BC14-C87D9B97D63B}.Release.Build.0 = Release|Win32

-		{97239A56-DBC0-41D2-BC14-C87D9B97D63B}.ReleaseAMD64.ActiveCfg = ReleaseAMD64|Win32

-		{97239A56-DBC0-41D2-BC14-C87D9B97D63B}.ReleaseAMD64.Build.0 = ReleaseAMD64|Win32

-		{97239A56-DBC0-41D2-BC14-C87D9B97D63B}.ReleaseItanium.ActiveCfg = ReleaseItanium|Win32

-		{97239A56-DBC0-41D2-BC14-C87D9B97D63B}.ReleaseItanium.Build.0 = ReleaseItanium|Win32

-		{FA5FC7EB-C72F-415F-AE42-91DD605ABDDA}.Debug.ActiveCfg = Debug|Win32

-		{FA5FC7EB-C72F-415F-AE42-91DD605ABDDA}.Debug.Build.0 = Debug|Win32

-		{FA5FC7EB-C72F-415F-AE42-91DD605ABDDA}.Release.ActiveCfg = Release|Win32

-		{FA5FC7EB-C72F-415F-AE42-91DD605ABDDA}.Release.Build.0 = Release|Win32

-		{FA5FC7EB-C72F-415F-AE42-91DD605ABDDA}.ReleaseAMD64.ActiveCfg = ReleaseAMD64|Win32

-		{FA5FC7EB-C72F-415F-AE42-91DD605ABDDA}.ReleaseAMD64.Build.0 = ReleaseAMD64|Win32

-		{FA5FC7EB-C72F-415F-AE42-91DD605ABDDA}.ReleaseItanium.ActiveCfg = ReleaseItanium|Win32

-		{FA5FC7EB-C72F-415F-AE42-91DD605ABDDA}.ReleaseItanium.Build.0 = ReleaseItanium|Win32

-		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.Debug.ActiveCfg = Debug|Win32

-		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.Debug.Build.0 = Debug|Win32

-		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.Release.ActiveCfg = Release|Win32

-		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.Release.Build.0 = Release|Win32

-		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.ReleaseAMD64.ActiveCfg = Release|Win32

-		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.ReleaseItanium.ActiveCfg = Release|Win32

-		{51F35FAE-FB92-4B2C-9187-1542C065AD77}.Debug.ActiveCfg = Debug|Win32

-		{51F35FAE-FB92-4B2C-9187-1542C065AD77}.Debug.Build.0 = Debug|Win32

-		{51F35FAE-FB92-4B2C-9187-1542C065AD77}.Release.ActiveCfg = Release|Win32

-		{51F35FAE-FB92-4B2C-9187-1542C065AD77}.Release.Build.0 = Release|Win32

-		{51F35FAE-FB92-4B2C-9187-1542C065AD77}.ReleaseAMD64.ActiveCfg = ReleaseAMD64|Win32

-		{51F35FAE-FB92-4B2C-9187-1542C065AD77}.ReleaseAMD64.Build.0 = ReleaseAMD64|Win32

-		{51F35FAE-FB92-4B2C-9187-1542C065AD77}.ReleaseItanium.ActiveCfg = ReleaseItanium|Win32

-		{51F35FAE-FB92-4B2C-9187-1542C065AD77}.ReleaseItanium.Build.0 = ReleaseItanium|Win32

-		{1966DDE2-4AB7-4E4E-ACC9-C121E4D37F8E}.Debug.ActiveCfg = Debug|Win32

-		{1966DDE2-4AB7-4E4E-ACC9-C121E4D37F8E}.Debug.Build.0 = Debug|Win32

-		{1966DDE2-4AB7-4E4E-ACC9-C121E4D37F8E}.Release.ActiveCfg = Release|Win32

-		{1966DDE2-4AB7-4E4E-ACC9-C121E4D37F8E}.Release.Build.0 = Release|Win32

-		{1966DDE2-4AB7-4E4E-ACC9-C121E4D37F8E}.ReleaseAMD64.ActiveCfg = ReleaseAMD64|Win32

-		{1966DDE2-4AB7-4E4E-ACC9-C121E4D37F8E}.ReleaseAMD64.Build.0 = ReleaseAMD64|Win32

-		{1966DDE2-4AB7-4E4E-ACC9-C121E4D37F8E}.ReleaseItanium.ActiveCfg = ReleaseItanium|Win32

-		{1966DDE2-4AB7-4E4E-ACC9-C121E4D37F8E}.ReleaseItanium.Build.0 = ReleaseItanium|Win32

-		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.Debug.ActiveCfg = Debug|Win32

-		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.Debug.Build.0 = Debug|Win32

-		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.Release.ActiveCfg = Release|Win32

-		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.Release.Build.0 = Release|Win32

-		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.ReleaseAMD64.ActiveCfg = Release|Win32

-		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.ReleaseAMD64.Build.0 = Release|Win32

-		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.ReleaseItanium.ActiveCfg = Release|Win32

-		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.ReleaseItanium.Build.0 = Release|Win32

-		{2C0BEFB9-70E2-4F80-AC5B-4AB8EE023574}.Debug.ActiveCfg = Debug|Win32

-		{2C0BEFB9-70E2-4F80-AC5B-4AB8EE023574}.Debug.Build.0 = Debug|Win32

-		{2C0BEFB9-70E2-4F80-AC5B-4AB8EE023574}.Release.ActiveCfg = Release|Win32

-		{2C0BEFB9-70E2-4F80-AC5B-4AB8EE023574}.Release.Build.0 = Release|Win32

-		{2C0BEFB9-70E2-4F80-AC5B-4AB8EE023574}.ReleaseAMD64.ActiveCfg = ReleaseAMD64|Win32

-		{2C0BEFB9-70E2-4F80-AC5B-4AB8EE023574}.ReleaseAMD64.Build.0 = ReleaseAMD64|Win32

-		{2C0BEFB9-70E2-4F80-AC5B-4AB8EE023574}.ReleaseItanium.ActiveCfg = ReleaseItanium|Win32

-		{2C0BEFB9-70E2-4F80-AC5B-4AB8EE023574}.ReleaseItanium.Build.0 = ReleaseItanium|Win32

-		{F22F40F4-D318-40DC-96B3-88DC81CE0894}.Debug.ActiveCfg = Debug|Win32

-		{F22F40F4-D318-40DC-96B3-88DC81CE0894}.Debug.Build.0 = Debug|Win32

-		{F22F40F4-D318-40DC-96B3-88DC81CE0894}.Release.ActiveCfg = Release|Win32

-		{F22F40F4-D318-40DC-96B3-88DC81CE0894}.Release.Build.0 = Release|Win32

-		{F22F40F4-D318-40DC-96B3-88DC81CE0894}.ReleaseAMD64.ActiveCfg = ReleaseAMD64|Win32

-		{F22F40F4-D318-40DC-96B3-88DC81CE0894}.ReleaseAMD64.Build.0 = ReleaseAMD64|Win32

-		{F22F40F4-D318-40DC-96B3-88DC81CE0894}.ReleaseItanium.ActiveCfg = ReleaseItanium|Win32

-		{8CF334D9-4F82-42EB-97AF-83592C5AFD2F}.Debug.ActiveCfg = Debug|Win32

-		{8CF334D9-4F82-42EB-97AF-83592C5AFD2F}.Debug.Build.0 = Debug|Win32

-		{8CF334D9-4F82-42EB-97AF-83592C5AFD2F}.Release.ActiveCfg = Release|Win32

-		{8CF334D9-4F82-42EB-97AF-83592C5AFD2F}.Release.Build.0 = Release|Win32

-		{8CF334D9-4F82-42EB-97AF-83592C5AFD2F}.ReleaseAMD64.ActiveCfg = ReleaseAMD64|Win32

-		{8CF334D9-4F82-42EB-97AF-83592C5AFD2F}.ReleaseAMD64.Build.0 = ReleaseAMD64|Win32

-		{8CF334D9-4F82-42EB-97AF-83592C5AFD2F}.ReleaseItanium.ActiveCfg = ReleaseItanium|Win32

-		{2FF0A312-22F9-4C34-B070-842916DE27A9}.Debug.ActiveCfg = Debug|Win32

-		{2FF0A312-22F9-4C34-B070-842916DE27A9}.Debug.Build.0 = Debug|Win32

-		{2FF0A312-22F9-4C34-B070-842916DE27A9}.Release.ActiveCfg = Release|Win32

-		{2FF0A312-22F9-4C34-B070-842916DE27A9}.Release.Build.0 = Release|Win32

-		{2FF0A312-22F9-4C34-B070-842916DE27A9}.ReleaseAMD64.ActiveCfg = ReleaseAMD64|Win32

-		{2FF0A312-22F9-4C34-B070-842916DE27A9}.ReleaseAMD64.Build.0 = ReleaseAMD64|Win32

-		{2FF0A312-22F9-4C34-B070-842916DE27A9}.ReleaseItanium.ActiveCfg = ReleaseItanium|Win32

-		{2FF0A312-22F9-4C34-B070-842916DE27A9}.ReleaseItanium.Build.0 = ReleaseItanium|Win32

-	EndGlobalSection

-	GlobalSection(SolutionItems) = postSolution

-		..\Modules\getbuildinfo.c = ..\Modules\getbuildinfo.c

-		readme.txt = readme.txt

-	EndGlobalSection

-	GlobalSection(ExtensibilityGlobals) = postSolution

-	EndGlobalSection

-	GlobalSection(ExtensibilityAddIns) = postSolution

-	EndGlobalSection

-EndGlobal

diff --git a/PC/VS7.1/pyexpat.vcproj b/PC/VS7.1/pyexpat.vcproj
deleted file mode 100644
index e0739fa..0000000
--- a/PC/VS7.1/pyexpat.vcproj
+++ /dev/null
@@ -1,263 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="7.10"

-	Name="pyexpat"

-	SccProjectName="pyexpat"

-	SccLocalPath="..">

-	<Platforms>

-		<Platform

-			Name="Win32"/>

-	</Platforms>

-	<Configurations>

-		<Configuration

-			Name="Debug|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\x86-temp-debug\pyexpat"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE">

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="0"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC,..\..\Modules\expat"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;_DEBUG;HAVE_EXPAT_H;WIN32;_WINDOWS;XML_NS;XML_DTD;BYTEORDER=1234;XML_CONTEXT_BYTES=1024;XML_STATIC;HAVE_MEMMOVE"

-				RuntimeLibrary="3"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="odbccp32.lib"

-				OutputFile="./pyexpat_d.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./pyexpat_d.pdb"

-				SubSystem="2"

-				BaseAddress="0x1D100000"

-				ImportLibrary=".\./pyexpat_d.lib"

-				TargetMachine="1"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="Release|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\x86-temp-release\pyexpat"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE">

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC,..\..\Modules\expat"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;NDEBUG;WIN32;_WINDOWS;XML_NS;XML_DTD;BYTEORDER=1234;XML_CONTEXT_BYTES=1024;XML_STATIC;HAVE_MEMMOVE"

-				StringPooling="TRUE"

-				RuntimeLibrary="2"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="odbccp32.lib"

-				OutputFile="./pyexpat.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./pyexpat.pdb"

-				SubSystem="2"

-				BaseAddress="0x1D100000"

-				ImportLibrary=".\./pyexpat.lib"

-				TargetMachine="1"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="ReleaseItanium|Win32"

-			OutputDirectory="./."

-			IntermediateDirectory=".\ia64-temp-release\pyexpat"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE">

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalOptions=" /USECL:MS_ITANIUM /GS-"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC,..\..\Modules\expat"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;NDEBUG;WIN32;_WINDOWS;XML_NS;XML_DTD;BYTEORDER=1234;XML_CONTEXT_BYTES=1024;XML_STATIC;HAVE_MEMMOVE"

-				StringPooling="TRUE"

-				BasicRuntimeChecks="0"

-				RuntimeLibrary="2"

-				BufferSecurityCheck="FALSE"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				Detect64BitPortabilityProblems="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalOptions=" /MACHINE:IA64 /USELINK:MS_SDK"

-				AdditionalDependencies="odbccp32.lib"

-				OutputFile="./pyexpat.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./pyexpat.pdb"

-				SubSystem="2"

-				BaseAddress="0x1D100000"

-				ImportLibrary=".\./pyexpat.lib"

-				TargetMachine="0"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="ReleaseAMD64|Win32"

-			OutputDirectory="."

-			IntermediateDirectory="amd64-temp-release\pyexpat"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE">

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalOptions=" /USECL:MS_OPTERON  /GS-"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC,..\..\Modules\expat"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;NDEBUG;WIN32;_WINDOWS;XML_NS;XML_DTD;BYTEORDER=1234;XML_CONTEXT_BYTES=1024;XML_STATIC;HAVE_MEMMOVE"

-				StringPooling="TRUE"

-				BasicRuntimeChecks="0"

-				RuntimeLibrary="2"

-				BufferSecurityCheck="FALSE"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				Detect64BitPortabilityProblems="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalOptions=" /MACHINE:AMD64 /USELINK:MS_SDK"

-				AdditionalDependencies="odbccp32.lib"

-				OutputFile="./pyexpat.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./pyexpat.pdb"

-				SubSystem="2"

-				BaseAddress="0x1D100000"

-				ImportLibrary=".\./pyexpat.lib"

-				TargetMachine="0"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<File

-			RelativePath="..\..\Modules\pyexpat.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\expat\xmlparse.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\expat\xmlrole.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\expat\xmltok.c">

-		</File>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS7.1/python.build b/PC/VS7.1/python.build
deleted file mode 100644
index 171101d..0000000
--- a/PC/VS7.1/python.build
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0"?>
-<project>
- <target name="all" description="Build all targets.">
-   <solution configuration="release">
-     <projects>
-       <include name="make_versioninfo.vcproj" />
-     </projects>
-   </solution>
-   <exec program="make_versioninfo" output="pythonnt_rc.h" />
-
-   <solution configuration="release" solutionfile="pcbuild.sln">
-     <excludeprojects>
-       <include name="_tkinter.vcproj" />
-       <include name="bz2.vcproj" />
-       <include name="_sqlite3.vcproj" />
-       <include name="_ssl.vcproj" />
-     </excludeprojects>
-   </solution>
- </target>
-</project>
diff --git a/PC/VS7.1/python.iss b/PC/VS7.1/python.iss
deleted file mode 100644
index ca6a3c0..0000000
--- a/PC/VS7.1/python.iss
+++ /dev/null
@@ -1,341 +0,0 @@
-; Script generated by the Inno Setup Script Wizard.
-; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
-
-; This is the whole ball of wax for an Inno installer for Python.
-; To use, download Inno Setup from http://www.jrsoftware.org/isdl.htm/,
-; install it, and double-click on this file.  That launches the Inno
-; script compiler.  The GUI is extemely simple, and has only one button
-; you may not recognize instantly:  click it.  You're done.  It builds
-; the installer into PCBuild/Python-2.2a1.exe.  Size and speed of the
-; installer are competitive with the Wise installer; Inno uninstall
-; seems much quicker than Wise (but also feebler, and the uninstall
-; log is in some un(human)readable binary format).
-;
-; What's Done
-; -----------
-; All the usual Windows Python files are installed by this now.
-; All the usual Windows Python Start menu entries are created and
-; work fine.
-; .py, .pyw, .pyc and .pyo extensions are registered.
-;     PROBLEM:  Inno uninstall does not restore their previous registry
-;               associations (if any).  Wise did.  This will make life
-;               difficult for alpha (etc) testers.
-; The Python install is fully functional for "typical" uses.
-;
-; What's Not Done
-; ---------------
-; None of "Mark Hammond's" registry entries are written.
-; No installation of files is done into the system dir:
-;     The MS DLLs aren't handled at all by this yet.
-;     Python22.dll is unpacked into the main Python dir.
-;
-; Inno can't do different things on NT/2000 depending on whether the user
-; has Admin privileges, so I don't know how to "solve" either of those,
-; short of building two installers (one *requiring* Admin privs, the
-; other not doing anything that needs Admin privs).
-;
-; Inno has no concept of variables, so lots of lines in this file need
-; to be fiddled by hand across releases.  Simplest way out:  stick this
-; file in a giant triple-quoted r-string (note that backslashes are
-; required all over the place here -- forward slashes DON'T WORK in
-; Inno), and use %(yadda)s string interpolation to do substitutions; i.e.,
-; write a very simple Python program to *produce* this script.
-
-[Setup]
-AppName=Python and combined Win32 Extensions
-AppVerName=Python 2.2.2 and combined Win32 Extensions 150
-AppId=Python 2.2.2.150
-AppVersion=2.2.2.150
-AppCopyright=Python is Copyright © 2001 Python Software Foundation. Win32 Extensions are Copyright © 1996-2001 Greg Stein and Mark Hammond.
-
-; Default install dir; value of {app} later (unless user overrides).
-; {sd} = system root drive, probably "C:".
-DefaultDirName={sd}\Python22
-;DefaultDirName={pf}\Python
-
-; Start menu folder name; value of {group} later (unless user overrides).
-DefaultGroupName=Python 2.2
-
-; Point SourceDir to one above PCBuild = src.
-; means this script can run unchanged from anyone's CVS tree, no matter
-; what they called the top-level directories.
-SourceDir=.
-OutputDir=..
-OutputBaseFilename=Python-2.2.2-Win32-150-Setup
-
-AppPublisher=PythonLabs at Digital Creations
-AppPublisherURL=http://www.python.org
-AppSupportURL=http://www.python.org
-AppUpdatesURL=http://www.python.org
-
-AlwaysCreateUninstallIcon=true
-ChangesAssociations=true
-UninstallLogMode=new
-AllowNoIcons=true
-AdminPrivilegesRequired=true
-UninstallDisplayIcon={app}\pyc.ico
-WizardDebug=false
-
-; The fewer screens the better; leave these commented.
-
-Compression=bzip
-InfoBeforeFile=LICENSE.txt
-;InfoBeforeFile=Misc\NEWS
-
-; uncomment the following line if you want your installation to run on NT 3.51 too.
-; MinVersion=4,3.51
-
-[Types]
-Name: normal; Description: Select desired components; Flags: iscustom
-
-[Components]
-Name: main; Description: Python and Win32 Extensions; Types: normal
-Name: docs; Description: Python documentation (HTML); Types: normal
-Name: tk; Description: TCL/TK, tkinter, and Idle; Types: normal
-Name: tools; Description: Python utility scripts (Tools\); Types: normal
-Name: test; Description: Python test suite (Lib\test\); Types: normal
-
-[Tasks]
-Name: extensions; Description: Register file associations (.py, .pyw, .pyc, .pyo); Components: main; Check: IsAdminLoggedOn
-
-[Files]
-; Caution:  Using forward slashes instead screws up in amazing ways.
-; Unknown:  By the time Components (and other attrs) are added to these lines, they're
-; going to get awfully long.  But don't see a way to continue logical lines across
-; physical lines.
-
-Source: LICENSE.txt; DestDir: {app}; CopyMode: alwaysoverwrite
-Source: README.txt; DestDir: {app}; CopyMode: alwaysoverwrite
-Source: News.txt; DestDir: {app}; CopyMode: alwaysoverwrite
-Source: *.ico; DestDir: {app}; CopyMode: alwaysoverwrite; Components: main
-
-Source: python.exe; DestDir: {app}; CopyMode: alwaysoverwrite; Components: main
-Source: pythonw.exe; DestDir: {app}; CopyMode: alwaysoverwrite; Components: main
-Source: w9xpopen.exe; DestDir: {app}; CopyMode: alwaysoverwrite; Components: main
-
-
-Source: DLLs\tcl83.dll; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: tk
-Source: DLLs\tk83.dll; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: tk
-Source: tcl\*.*; DestDir: {app}\tcl; CopyMode: alwaysoverwrite; Components: tk; Flags: recursesubdirs
-
-Source: sysdir\python22.dll; DestDir: {sys}; CopyMode: alwaysskipifsameorolder; Components: main; Flags: sharedfile restartreplace
-Source: sysdir\PyWinTypes22.dll; DestDir: {sys}; CopyMode: alwaysskipifsameorolder; Components: main; Flags: restartreplace sharedfile
-Source: sysdir\pythoncom22.dll; DestDir: {sys}; CopyMode: alwaysskipifsameorolder; Components: main; Flags: restartreplace sharedfile
-
-Source: DLLs\_socket.pyd; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: main
-Source: libs\_socket.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: main
-
-Source: DLLs\_sre.pyd; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: main
-Source: libs\_sre.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: main
-
-Source: DLLs\_symtable.pyd; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: main
-Source: libs\_symtable.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: main
-
-Source: DLLs\_testcapi.pyd; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: main
-Source: libs\_testcapi.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: main
-
-Source: DLLs\_tkinter.pyd; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: tk
-Source: libs\_tkinter.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: tk
-
-Source: DLLs\mmap.pyd; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: main
-Source: libs\mmap.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: main
-
-Source: DLLs\parser.pyd; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: main
-Source: libs\parser.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: main
-
-Source: DLLs\pyexpat.pyd; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: main
-Source: libs\pyexpat.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: main
-
-Source: DLLs\select.pyd; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: main
-Source: libs\select.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: main
-
-Source: DLLs\unicodedata.pyd; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: main
-Source: libs\unicodedata.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: main
-
-Source: DLLs\winreg.pyd; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: main
-Source: libs\winreg.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: main
-
-Source: DLLs\winsound.pyd; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: main
-Source: libs\winsound.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: main
-
-Source: DLLs\zlib.pyd; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: main
-Source: libs\zlib.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: main
-
-Source: libs\python22.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: main
-
-Source: DLLs\expat.dll; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: main
-
-
-
-Source: Lib\*.py; DestDir: {app}\Lib; CopyMode: alwaysoverwrite; Components: main
-Source: Lib\compiler\*.*; DestDir: {app}\Lib\compiler; CopyMode: alwaysoverwrite; Components: main; Flags: recursesubdirs
-Source: Lib\distutils\*.*; DestDir: {app}\Lib\distutils; CopyMode: alwaysoverwrite; Components: main; Flags: recursesubdirs
-Source: Lib\email\*.*; DestDir: {app}\Lib\email; CopyMode: alwaysoverwrite; Components: main; Flags: recursesubdirs
-Source: Lib\encodings\*.*; DestDir: {app}\Lib\encodings; CopyMode: alwaysoverwrite; Components: main; Flags: recursesubdirs
-Source: Lib\hotshot\*.*; DestDir: {app}\Lib\hotshot; CopyMode: alwaysoverwrite; Components: main; Flags: recursesubdirs
-Source: Lib\lib-old\*.*; DestDir: {app}\Lib\lib-old; CopyMode: alwaysoverwrite; Components: main; Flags: recursesubdirs
-Source: Lib\xml\*.*; DestDir: {app}\Lib\xml; CopyMode: alwaysoverwrite; Components: main; Flags: recursesubdirs
-Source: Lib\hotshot\*.*; DestDir: {app}\Lib\hotshot; CopyMode: alwaysoverwrite; Components: main; Flags: recursesubdirs
-Source: Lib\test\*.*; DestDir: {app}\Lib\test; CopyMode: alwaysoverwrite; Components: test; Flags: recursesubdirs
-Source: Lib\tkinter\*.py; DestDir: {app}\Lib\tkinter; CopyMode: alwaysoverwrite; Components: tk; Flags: recursesubdirs
-
-Source: Lib\site-packages\README.txt; DestDir: {app}\Lib\site-packages; CopyMode: alwaysoverwrite; Components: main
-
-Source: Lib\site-packages\PyWin32.chm; DestDir: {app}\Lib\site-packages; CopyMode: alwaysoverwrite; Components: docs
-Source: Lib\site-packages\win32\*.*; DestDir: {app}\Lib\site-packages\win32; CopyMode: alwaysoverwrite; Components: main; Flags: recursesubdirs
-Source: Lib\site-packages\win32com\*.*; DestDir: {app}\Lib\site-packages\win32com; CopyMode: alwaysoverwrite; Components: main; Flags: recursesubdirs
-Source: Lib\site-packages\win32comext\*.*; DestDir: {app}\Lib\site-packages\win32comext; CopyMode: alwaysoverwrite; Components: main; Flags: recursesubdirs
-
-Source: include\*.h; DestDir: {app}\include; CopyMode: alwaysoverwrite; Components: main
-
-Source: Tools\idle\*.*; DestDir: {app}\Tools\idle; CopyMode: alwaysoverwrite; Components: tk; Flags: recursesubdirs
-
-Source: Tools\pynche\*.*; DestDir: {app}\Tools\pynche; CopyMode: alwaysoverwrite; Components: tools; Flags: recursesubdirs
-Source: Tools\scripts\*.*; DestDir: {app}\Tools\Scripts; CopyMode: alwaysoverwrite; Components: tools; Flags: recursesubdirs
-Source: Tools\webchecker\*.*; DestDir: {app}\Tools\webchecker; CopyMode: alwaysoverwrite; Components: tools; Flags: recursesubdirs
-Source: Tools\versioncheck\*.*; DestDir: {app}\Tools\versioncheck; CopyMode: alwaysoverwrite; Components: tools; Flags: recursesubdirs
-
-Source: Doc\*.*; DestDir: {app}\Doc; CopyMode: alwaysoverwrite; Flags: recursesubdirs; Components: docs
-
-
-[Icons]
-Name: {group}\Python (command line); Filename: {app}\python.exe; WorkingDir: {app}; Components: main
-Name: {group}\Python Manuals; Filename: {app}\Doc\index.html; WorkingDir: {app}; Components: docs
-Name: {group}\Win32 Extensions Help; Filename: {app}\Lib\site-packages\PyWin32.chm; WorkingDir: {app}\Lib\site-packages; Components: docs
-Name: {group}\Module Docs; Filename: {app}\pythonw.exe; WorkingDir: {app}; Parameters: """{app}\Tools\Scripts\pydoc.pyw"""; Components: tools
-Name: {group}\IDLE (Python GUI); Filename: {app}\pythonw.exe; WorkingDir: {app}; Parameters: """{app}\Tools\idle\idle.pyw"""; Components: tools
-
-[Registry]
-; Register .py
-Tasks: extensions; Root: HKCR; Subkey: .py; ValueType: string; ValueName: ; ValueData: Python File; Flags: uninsdeletevalue
-Tasks: extensions; Root: HKCR; Subkey: .py; ValueType: string; ValueName: Content Type; ValueData: text/plain; Flags: uninsdeletevalue
-Tasks: extensions; Root: HKCR; Subkey: Python File; ValueType: string; ValueName: ; ValueData: Python File; Flags: uninsdeletekey
-Tasks: extensions; Root: HKCR; Subkey: Python File\DefaultIcon; ValueType: string; ValueName: ; ValueData: {app}\Py.ico
-Tasks: extensions; Root: HKCR; Subkey: Python File\shell\open\command; ValueType: string; ValueName: ; ValueData: """{app}\python.exe"" ""%1"" %*"
-
-; Register .pyc
-Tasks: extensions; Root: HKCR; Subkey: .pyc; ValueType: string; ValueName: ; ValueData: Python CompiledFile; Flags: uninsdeletevalue
-Tasks: extensions; Root: HKCR; Subkey: Python CompiledFile; ValueType: string; ValueName: ; ValueData: Compiled Python File; Flags: uninsdeletekey
-Tasks: extensions; Root: HKCR; Subkey: Python CompiledFile\DefaultIcon; ValueType: string; ValueName: ; ValueData: {app}\pyc.ico
-Tasks: extensions; Root: HKCR; Subkey: Python CompiledFile\shell\open\command; ValueType: string; ValueName: ; ValueData: """{app}\python.exe"" ""%1"" %*"
-
-; Register .pyo
-Tasks: extensions; Root: HKCR; Subkey: .pyo; ValueType: string; ValueName: ; ValueData: Python CompiledFile; Flags: uninsdeletevalue
-
-; Register .pyw
-Tasks: extensions; Root: HKCR; Subkey: .pyw; ValueType: string; ValueName: ; ValueData: Python NoConFile; Flags: uninsdeletevalue
-Tasks: extensions; Root: HKCR; Subkey: .pyw; ValueType: string; ValueName: Content Type; ValueData: text/plain; Flags: uninsdeletevalue
-Tasks: extensions; Root: HKCR; Subkey: Python NoConFile; ValueType: string; ValueName: ; ValueData: Python File (no console); Flags: uninsdeletekey
-Tasks: extensions; Root: HKCR; Subkey: Python NoConFile\DefaultIcon; ValueType: string; ValueName: ; ValueData: {app}\Py.ico
-Tasks: extensions; Root: HKCR; Subkey: Python NoConFile\shell\open\command; ValueType: string; ValueName: ; ValueData: """{app}\pythonw.exe"" ""%1"" %*"
-
-
-; Python Registry Keys
-Root: HKLM; Subkey: SOFTWARE\Python; Flags: uninsdeletekeyifempty; Check: IsAdminLoggedOn
-Root: HKLM; Subkey: SOFTWARE\Python\PythonCore; Flags: uninsdeletekeyifempty
-Root: HKLM; Subkey: SOFTWARE\Python\PythonCore\2.2; Flags: uninsdeletekeyifempty
-Root: HKLM; Subkey: SOFTWARE\Python\PythonCore\2.2\PythonPath; ValueData: "{app}\Lib;{app}\DLLs"; Flags: uninsdeletekeyifempty
-Root: HKLM; Subkey: SOFTWARE\Python\PythonCore\2.2\PythonPath\win32; ValueData: "{app}\lib\site-packages\win32;{app}\lib\site-packages\win32\lib"; Flags: uninsdeletekey
-Root: HKLM; Subkey: SOFTWARE\Python\PythonCore\2.2\PythonPath\win32com; ValueData: C:\Python\lib\site-packages; Flags: uninsdeletekey
-Root: HKLM; Subkey: SOFTWARE\Python\PythonCore\2.2\Modules; Flags: uninsdeletekeyifempty
-Root: HKLM; Subkey: SOFTWARE\Python\PythonCore\2.2\Modules\pythoncom; ValueData: {sys}\pythoncom22.dll; Flags: uninsdeletekey
-Root: HKLM; Subkey: SOFTWARE\Python\PythonCore\2.2\Modules\pywintypes; ValueData: {sys}\PyWinTypes22.dll; Flags: uninsdeletekey
-Root: HKLM; Subkey: SOFTWARE\Python\PythonCore\2.2\InstallPath; ValueData: {app}; Flags: uninsdeletekeyifempty; ValueType: string
-Root: HKLM; Subkey: SOFTWARE\Python\PythonCore\2.2\InstallPath\InstallGroup; ValueData: {group}; Flags: uninsdeletekey
-Root: HKLM; Subkey: SOFTWARE\Python\PythonCore\2.2\Help; Flags: uninsdeletekeyifempty
-Root: HKLM; Subkey: SOFTWARE\Python\PythonCore\2.2\Help\Main Python Documentation; ValueType: string; ValueData: {app}\Doc\index.html; Flags: uninsdeletekey; Components: docs
-Root: HKLM; Subkey: SOFTWARE\Python\PythonCore\2.2\Help\Python Win32 Documentation; ValueType: string; ValueData: {app}\lib\site-packages\PyWin32.chm; Flags: uninsdeletekey; Components: docs
-
-[_ISTool]
-EnableISX=true
-
-
-[Code]
-Program Setup;
-
-Function IsAdminNotLoggedOn(): Boolean;
-begin
-  Result := Not IsAdminLoggedOn();
-end;
-
-begin
-end.
-
-
-
-
-[UninstallDelete]
-Name: {app}\Lib\compiler\*.pyc; Type: files
-Name: {app}\Lib\compiler\*.pyo; Type: files
-Name: {app}\Lib\compiler; Type: dirifempty
-Name: {app}\Lib\distutils\command\*.pyc; Type: files
-Name: {app}\Lib\distutils\command\*.pyo; Type: files
-Name: {app}\Lib\distutils\command; Type: dirifempty
-Name: {app}\Lib\distutils\*.pyc; Type: files
-Name: {app}\Lib\distutils\*.pyo; Type: files
-Name: {app}\Lib\distutils; Type: dirifempty
-Name: {app}\Lib\email\test\*.pyc; Type: files
-Name: {app}\Lib\email\test\*.pyo; Type: files
-Name: {app}\Lib\email\test; Type: dirifempty
-Name: {app}\Lib\email\*.pyc; Type: files
-Name: {app}\Lib\email\*.pyo; Type: files
-Name: {app}\Lib\email; Type: dirifempty
-Name: {app}\Lib\encodings\*.pyc; Type: files
-Name: {app}\Lib\encodings\*.pyo; Type: files
-Name: {app}\Lib\encodings; Type: dirifempty
-Name: {app}\Lib\hotshot\*.pyc; Type: files
-Name: {app}\Lib\hotshot\*.pyo; Type: files
-Name: {app}\Lib\hotshot; Type: dirifempty
-Name: {app}\Lib\lib-old\*.pyc; Type: files
-Name: {app}\Lib\lib-old\*.pyo; Type: files
-Name: {app}\Lib\lib-old; Type: dirifempty
-Name: {app}\Lib\tkinter\*.pyc; Type: files
-Name: {app}\Lib\tkinter\*.pyo; Type: files
-Name: {app}\Lib\tkinter; Type: dirifempty
-Name: {app}\Lib\test\*.pyc; Type: files
-Name: {app}\Lib\test\*.pyo; Type: files
-Name: {app}\Lib\test; Type: dirifempty
-Name: {app}\Lib\xml\dom\*.pyc; Type: files
-Name: {app}\Lib\xml\dom\*.pyo; Type: files
-Name: {app}\Lib\xml\dom; Type: dirifempty
-Name: {app}\Lib\xml\parsers\*.pyc; Type: files
-Name: {app}\Lib\xml\parsers\*.pyo; Type: files
-Name: {app}\Lib\xml\parsers; Type: dirifempty
-Name: {app}\Lib\xml\sax\*.pyc; Type: files
-Name: {app}\Lib\xml\sax\*.pyo; Type: files
-Name: {app}\Lib\xml\sax; Type: dirifempty
-Name: {app}\Lib\xml\*.pyc; Type: files
-Name: {app}\Lib\xml\*.pyo; Type: files
-Name: {app}\Lib\xml; Type: dirifempty
-
-Name: {app}\Lib\site-packages\win32; Type: filesandordirs
-Name: {app}\Lib\site-packages\win32com; Type: filesandordirs
-Name: {app}\Lib\site-packages\win32comext; Type: filesandordirs
-Name: {app}\Lib\site-packages\pythoncom.py*; Type: files
-Name: {app}\Lib\site-packages; Type: dirifempty
-
-Name: {app}\Lib\*.pyc; Type: files
-Name: {app}\Lib; Type: dirifempty
-
-Name: {app}\Tools\pynche\*.pyc; Type: files
-Name: {app}\Tools\pynche\*.pyo; Type: files
-Name: {app}\Tools\pynche; Type: dirifempty
-
-Name: {app}\Tools\idle\*.pyc; Type: files
-Name: {app}\Tools\idle\*.pyo; Type: files
-Name: {app}\Tools\idle; Type: dirifempty
-
-Name: {app}\Tools\scripts\*.pyc; Type: files
-Name: {app}\Tools\scripts\*.pyo; Type: files
-Name: {app}\Tools\scripts; Type: dirifempty
-
-Name: {app}\Tools\versioncheck\*.pyc; Type: files
-Name: {app}\Tools\versioncheck\*.pyo; Type: files
-Name: {app}\Tools\versioncheck; Type: dirifempty
-
-Name: {app}\Tools\webchecker\*.pyc; Type: files
-Name: {app}\Tools\webchecker\*.pyo; Type: files
-Name: {app}\Tools\webchecker; Type: dirifempty
-
-Name: {app}\Tools; Type: dirifempty
-
diff --git a/PC/VS7.1/python.vcproj b/PC/VS7.1/python.vcproj
deleted file mode 100644
index 80b4401..0000000
--- a/PC/VS7.1/python.vcproj
+++ /dev/null
@@ -1,274 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="7.10"

-	Name="python"

-	SccProjectName="python"

-	SccLocalPath="..">

-	<Platforms>

-		<Platform

-			Name="Win32"/>

-	</Platforms>

-	<Configurations>

-		<Configuration

-			Name="Release|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\x86-temp-release\python"

-			ConfigurationType="1"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE"

-			CharacterSet="2">

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC"

-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"

-				StringPooling="TRUE"

-				RuntimeLibrary="2"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="odbccp32.lib"

-				OutputFile=".\./python.exe"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./python.pdb"

-				SubSystem="1"

-				StackReserveSize="2000000"

-				BaseAddress="0x1d000000"

-				TargetMachine="1"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"

-				PreprocessorDefinitions="NDEBUG"

-				Culture="1033"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="Debug|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\x86-temp-debug\python"

-			ConfigurationType="1"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE"

-			CharacterSet="2">

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="0"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC"

-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"

-				RuntimeLibrary="3"

-				UsePrecompiledHeader="2"

-				BrowseInformation="1"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="odbccp32.lib"

-				OutputFile="./python_d.exe"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./python_d.pdb"

-				SubSystem="1"

-				StackReserveSize="2000000"

-				BaseAddress="0x1d000000"

-				TargetMachine="1"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"

-				PreprocessorDefinitions="_DEBUG"

-				Culture="1033"

-				AdditionalIncludeDirectories="..\..\Include"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="ReleaseItanium|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\ia64-temp-release\python"

-			ConfigurationType="1"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE"

-			CharacterSet="2">

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalOptions=" /USECL:MS_ITANIUM  /GS-"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC"

-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"

-				StringPooling="TRUE"

-				BasicRuntimeChecks="0"

-				RuntimeLibrary="2"

-				BufferSecurityCheck="FALSE"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				Detect64BitPortabilityProblems="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalOptions=" /MACHINE:IA64 /USELINK:MS_SDK /VSEXTCOMP_VERBOSE"

-				AdditionalDependencies="odbccp32.lib"

-				OutputFile=".\./python.exe"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./python.pdb"

-				SubSystem="1"

-				StackReserveSize="2000000"

-				BaseAddress="0x1d000000"

-				TargetMachine="0"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"

-				PreprocessorDefinitions="NDEBUG"

-				Culture="1033"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="ReleaseAMD64|Win32"

-			OutputDirectory="."

-			IntermediateDirectory="amd64-temp-release\python"

-			ConfigurationType="1"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE"

-			CharacterSet="2">

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalOptions=" /USECL:MS_OPTERON"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC"

-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"

-				StringPooling="TRUE"

-				BasicRuntimeChecks="0"

-				RuntimeLibrary="2"

-				BufferSecurityCheck="FALSE"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				Detect64BitPortabilityProblems="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalOptions=" /MACHINE:AMD64 /USELINK:MS_SDK"

-				AdditionalDependencies="odbccp32.lib"

-				OutputFile=".\./python.exe"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./python.pdb"

-				SubSystem="1"

-				StackReserveSize="2000000"

-				BaseAddress="0x1d000000"

-				TargetMachine="0"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"

-				PreprocessorDefinitions="NDEBUG"

-				Culture="1033"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<File

-			RelativePath="..\..\PC\pycon.ico">

-		</File>

-		<File

-			RelativePath="..\..\Modules\python.c">

-		</File>

-		<File

-			RelativePath="..\..\PC\python_exe.rc">

-		</File>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS7.1/python20.wse b/PC/VS7.1/python20.wse
deleted file mode 100644
index 2e7f6ad3..0000000
--- a/PC/VS7.1/python20.wse
+++ /dev/null
@@ -1,3117 +0,0 @@
-Document Type: WSE
-item: Global
-  Version=9.0
-  Title=Python 2.4a1
-  Flags=00010100
-  Languages=65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
-  Japanese Font Name=MS Gothic
-  Japanese Font Size=10
-  Start Gradient=0 255 0
-  End Gradient=0 128 0
-  Windows Flags=00000100000011010010010100001010
-  Log Pathname=%MAINDIR%\INSTALL.LOG
-  Message Font=MS Sans Serif
-  Font Size=8
-  Pages Modified=00010000011101000000000100000111
-  Extra Pages=00000000000000000000000010110010
-  Disk Filename=SETUP
-  Patch Flags=0000000000001001
-  Patch Threshold=85
-  Patch Memory=4000
-  MIF PDF Version=1.0
-  MIF SMS Version=2.0
-  EXE Filename=Python-2.4a1.exe
-  Dialogs Version=8
-  Version File=2.4a1
-  Version Description=Python Programming Language
-  Version Copyright=©2001-2007 Python Software Foundation
-  Version Company=Python Software Foundation
-  Crystal Format=10111100101100000010001001001001
-  Step View=&All
-  Variable Name1=_WISE_
-  Variable Description1=WISE root directory
-  Variable Default1=C:\Programme\Wise Installation System
-  Variable Flags1=00001000
-  Variable Name2=_TCLDIR_
-  Variable Description2=The directory in which the Tcl/Tk installation
-  Variable Description2=lives.  This must be a sibling of the Python
-  Variable Description2=directory.
-  Variable Default2=tcl84
-  Variable Flags2=00001000
-  Variable Name3=_DOC_
-  Variable Description3=The unpacked HTML doc directory.
-  Variable Default3=..\html
-  Variable Flags3=00001001
-  Variable Name4=_SYS_
-  Variable Description4=System directory (where to find MSVCRT.DLL)
-  Variable Default4=C:\Windows\System
-  Variable Values4=C:\Windows\System
-  Variable Values4=C:\WINNT\System32
-  Variable Values4=C:\Code\MSDLLs
-  Variable Values4=C:\Windows\System32
-  Variable Flags4=00000010
-  Variable Name5=_PYMAJOR_
-  Variable Description5=Python major version number; the 2 in 2.3.
-  Variable Default5=2
-  Variable Flags5=00001000
-  Variable Name6=_PYMINOR_
-  Variable Description6=Python minor version number; the 3 in 2.3
-  Variable Default6=3
-  Variable Flags6=00001000
-  Variable Name7=_DOADMIN_
-  Variable Description7=The initial value for %DOADMIN%.
-  Variable Description7=When 0, we never try to write under HKLM,
-  Variable Description7=and install the Python + MS runtime DLLs in
-  Variable Description7=the Python directory instead of the system dir.
-  Variable Default7=1
-  Variable Values7=1
-  Variable Values7=0
-  Variable Flags7=00001010
-  Variable Name8=_ALIASNAME_
-  Variable Flags8=00001000
-  Variable Name9=_ALIASPATH_
-  Variable Flags9=00001000
-  Variable Name10=_ALIASTYPE_
-  Variable Flags10=00001000
-end
-item: Set Variable
-  Variable=PYVER_STRING
-  Value=2.3
-end
-item: Remark
-end
-item: Remark
-  Text=When the version number changes, set the compiler
-end
-item: Remark
-  Text=vrbls _PYMAJOR_ and  _PYMINOR_.
-end
-item: Remark
-  Text=Nothing in the script below should need fiddling then.
-end
-item: Remark
-  Text=Other things that need fiddling:
-end
-item: Remark
-  Text=    PYVER_STRING above.
-end
-item: Remark
-  Text=    The "Title:" in the upper left corner of the GUI.
-end
-item: Remark
-  Text=    Build Settings and Version Resource on step 6 (Finish) of the Installation Expert
-end
-item: Remark
-  Text=        Be sure to select Steps->All or you may not see these!
-end
-item: Remark
-end
-item: Remark
-  Text=When the version of Tcl/Tk changes, the compiler vrbl
-end
-item: Remark
-  Text=_TCLDIR_ may also need to be changed.
-end
-item: Remark
-end
-item: Set Variable
-  Variable=APPTITLE
-  Value=Python %PYVER_STRING%
-end
-item: Remark
-  Text=PY_VERSION should be major.minor only; used to create the registry key; must match MS_DLL_ID in python_nt.rc
-end
-item: Set Variable
-  Variable=PY_VERSION
-  Value=%_PYMAJOR_%.%_PYMINOR_%
-end
-item: Remark
-  Text=GROUP is the Start menu group name; user can override.
-end
-item: Set Variable
-  Variable=GROUP
-  Value=Python %PY_VERSION%
-  Flags=10000000
-end
-item: Remark
-  Text=MAINDIR is the app directory; user can override.
-end
-item: Set Variable
-  Variable=MAINDIR
-  Value=Python%_PYMAJOR_%%_PYMINOR_%
-end
-item: Remark
-end
-item: Set Variable
-  Variable=DOADMIN
-  Value=%_DOADMIN_%
-end
-item: Remark
-  Text=Give non-admin users a chance to abort.
-end
-item: Check Configuration
-  Flags=10011111
-end
-item: Set Variable
-  Variable=DOADMIN
-  Value=0
-end
-item: Display Message
-  Title=Doing non-admin install
-  Text=The current login does not have Administrator Privileges on this machine.  Python will install its registry information into the per-user area only for the current login, instead of into the per-machine area for every account on this machine.  Some advanced uses of Python may not work as a result (for example, running a Python script as a service).
-  Text=
-  Text=If this is not what you want, please click Cancel to abort this installation, log on as an Administrator, and start the installation again.
-  Flags=00001000
-end
-item: End Block
-end
-item: Remark
-end
-item: Remark
-  Text=BEGIN WIZARD STUFF -----------------------------------------------------------------------------------------------------------------------------
-end
-item: Remark
-  Text=Note from Tim: the "stop" on the next line is actually "pause".
-end
-item: Open/Close INSTALL.LOG
-  Flags=00000001
-end
-item: Remark
-  Text=If the destination system does not have a writable Windows\System directory, system files will be written to the Windows\ directory
-end
-item: Check if File/Dir Exists
-  Pathname=%SYS%
-  Flags=10000100
-end
-item: Set Variable
-  Variable=SYS
-  Value=%WIN%
-end
-item: End Block
-end
-item: Check Configuration
-  Flags=10111011
-end
-item: Get Registry Key Value
-  Variable=COMMON
-  Key=SOFTWARE\Microsoft\Windows\CurrentVersion
-  Default=C:\Program Files\Common Files
-  Value Name=CommonFilesDir
-  Flags=00000100
-end
-item: Get Registry Key Value
-  Variable=PROGRAM_FILES
-  Key=SOFTWARE\Microsoft\Windows\CurrentVersion
-  Default=C:\Program Files
-  Value Name=ProgramFilesDir
-  Flags=00000100
-end
-item: Set Variable
-  Variable=EXPLORER
-  Value=1
-end
-item: End Block
-end
-item: Remark
-  Text=Note from Tim:  The Wizard hardcod "C:" at the start of the replacement text for MAINDIR.
-end
-item: Remark
-  Text=That's not appropriate if the system drive doesn't happen to be C:.
-end
-item: Remark
-  Text=I removed the "C:", and that did the right thing for two people who tested it on non-C: machines,
-end
-item: Remark
-  Text=but it's unclear whether it will always do the right thing.
-end
-item: Set Variable
-  Variable=MAINDIR
-  Value=\%MAINDIR%
-  Flags=00001100
-end
-item: Remark
-  Text=BACKUP is the variable that holds the path that all backup files will be copied to when overwritten
-end
-item: Set Variable
-  Variable=BACKUP
-  Value=%MAINDIR%\BACKUP
-  Flags=10000000
-end
-item: Remark
-  Text=DOBACKUP determines if a backup will be performed.  The possible values are A (do backup) or B (do not do backup)
-end
-item: Set Variable
-  Variable=DOBACKUP
-  Value=A
-end
-item: Remark
-  Text=BRANDING determines if the installation will be branded with a name and company.  By default, this is written to the INST directory (installation media).
-end
-item: Set Variable
-  Variable=BRANDING
-  Value=0
-end
-item: If/While Statement
-  Variable=BRANDING
-  Value=1
-end
-item: Read INI Value
-  Variable=NAME
-  Pathname=%INST%\CUSTDATA.INI
-  Section=Registration
-  Item=Name
-end
-item: Read INI Value
-  Variable=COMPANY
-  Pathname=%INST%\CUSTDATA.INI
-  Section=Registration
-  Item=Company
-end
-item: If/While Statement
-  Variable=NAME
-end
-item: Set Variable
-  Variable=DOBRAND
-  Value=1
-end
-item: Get System Information
-  Variable=NAME
-  Flags=00000110
-end
-item: Get System Information
-  Variable=COMPANY
-  Flags=00000111
-end
-item: End Block
-end
-item: End Block
-end
-item: Remark
-  Text=END WIZARD STUFF -----------------------------------------------------------------------------------------------------------------------------
-end
-item: Remark
-end
-item: Remark
-  Text=Set vrbls for the "Advanced Options" subdialog of Components.
-end
-item: Set Variable
-  Variable=SELECT_ADMIN
-  Value=A
-end
-item: If/While Statement
-  Variable=DOADMIN
-  Value=0
-end
-item: Set Variable
-  Variable=SELECT_ADMIN
-  Value=B
-end
-item: End Block
-end
-item: Remark
-end
-item: Remark
-  Text=TASKS values:
-end
-item: Remark
-  Text=A: Register file extensions
-end
-item: Remark
-  Text=B: Create Start Menu shortcuts
-end
-item: Set Variable
-  Variable=TASKS
-  Value=AB
-end
-item: Remark
-end
-item: Remark
-  Text=COMPONENTS values:
-end
-item: Remark
-  Text=A: interpreter and libraries
-end
-item: Remark
-  Text=B: Tcl/Tk
-end
-item: Remark
-  Text=C: docs
-end
-item: Remark
-  Text=D: tools
-end
-item: Remark
-  Text=E: test suite
-end
-item: Set Variable
-  Variable=COMPONENTS
-  Value=ABCDE
-end
-item: Remark
-end
-item: Remark
-  Text=March thru the user GUI.
-end
-item: Wizard Block
-  Direction Variable=DIRECTION
-  Display Variable=DISPLAY
-  Bitmap Pathname=.\installer.bmp
-  X Position=9
-  Y Position=10
-  Filler Color=11173759
-  Dialog=Select Destination Directory
-  Dialog=Backup Replaced Files
-  Dialog=Select Components
-  Dialog=Select Program Manager Group
-  Variable=
-  Variable=
-  Variable=
-  Variable=TASKS
-  Value=
-  Value=
-  Value=
-  Value=B
-  Compare=0
-  Compare=0
-  Compare=0
-  Compare=3
-  Flags=00000011
-end
-item: If/While Statement
-  Variable=DISPLAY
-  Value=Start Installation
-end
-item: Set Variable
-  Variable=SUMMARY
-  Value=Install directory:  %MAINDIR%%CRLF%
-end
-item: Remark
-end
-item: If/While Statement
-  Variable=SELECT_ADMIN
-  Value=A
-end
-item: Set Variable
-  Variable=SUMMARY
-  Value=%CRLF%Doing admin install.%CRLF%
-  Flags=00000001
-end
-item: Else Statement
-end
-item: Set Variable
-  Variable=SUMMARY
-  Value=%CRLF%Doing non-admin install.%CRLF%
-  Flags=00000001
-end
-item: End Block
-end
-item: Remark
-end
-item: If/While Statement
-  Variable=DOBACKUP
-  Value=A
-end
-item: Set Variable
-  Variable=SUMMARY
-  Value=%CRLF%Make backups, into %BACKUP%%CRLF%
-  Flags=00000001
-end
-item: Else Statement
-end
-item: Set Variable
-  Variable=SUMMARY
-  Value=%CRLF%Don't make backups.%CRLF%
-  Flags=00000001
-end
-item: End Block
-end
-item: Remark
-end
-item: Set Variable
-  Variable=SUMMARY
-  Value=%CRLF%Components:%CRLF%
-  Flags=00000001
-end
-item: If/While Statement
-  Variable=COMPONENTS
-  Value=A
-  Flags=00000010
-end
-item: Set Variable
-  Variable=SUMMARY
-  Value=    Python interpreter and libraries%CRLF%
-  Flags=00000001
-end
-item: End Block
-end
-item: If/While Statement
-  Variable=COMPONENTS
-  Value=B
-  Flags=00000010
-end
-item: Set Variable
-  Variable=SUMMARY
-  Value=    Tcl/Tk (Tkinter, IDLE, pydoc)%CRLF%
-  Flags=00000001
-end
-item: End Block
-end
-item: If/While Statement
-  Variable=COMPONENTS
-  Value=C
-  Flags=00000010
-end
-item: Set Variable
-  Variable=SUMMARY
-  Value=    Python documentation%CRLF%
-  Flags=00000001
-end
-item: End Block
-end
-item: If/While Statement
-  Variable=COMPONENTS
-  Value=D
-  Flags=00000010
-end
-item: Set Variable
-  Variable=SUMMARY
-  Value=    Tool and utility scripts%CRLF%
-  Flags=00000001
-end
-item: End Block
-end
-item: If/While Statement
-  Variable=COMPONENTS
-  Value=E
-  Flags=00000010
-end
-item: Set Variable
-  Variable=SUMMARY
-  Value=    Python test suite%CRLF%
-  Flags=00000001
-end
-item: End Block
-end
-item: Remark
-end
-item: If/While Statement
-  Variable=TASKS
-  Value=A
-  Flags=00000010
-end
-item: Set Variable
-  Variable=SUMMARY
-  Value=%CRLF%Register file extensions.%CRLF%
-  Flags=00000001
-end
-item: Else Statement
-end
-item: Set Variable
-  Variable=SUMMARY
-  Value=%CRLF%Don't register file extensions.%CRLF%
-  Flags=00000001
-end
-item: End Block
-end
-item: Remark
-end
-item: If/While Statement
-  Variable=TASKS
-  Value=B
-  Flags=00000010
-end
-item: Set Variable
-  Variable=SUMMARY
-  Value=%CRLF%Start Menu group:  %GROUP%%CRLF%
-  Flags=00000001
-end
-item: Else Statement
-end
-item: Set Variable
-  Variable=SUMMARY
-  Value=%CRLF%No Start Menu shortcuts.%CRLF%
-  Flags=00000001
-end
-item: End Block
-end
-item: End Block
-end
-item: Remark
-end
-item: Custom Dialog Set
-  Name=Select Destination Directory
-  Display Variable=DISPLAY
-  item: Dialog
-    Title=%APPTITLE% Installation
-    Title French=Installation de %APPTITLE%
-    Title German=Installation von %APPTITLE%
-    Title Spanish=Instalación de %APPTITLE%
-    Title Italian=Installazione di %APPTITLE%
-    Width=339
-    Height=280
-    Font Name=Helv
-    Font Size=8
-    item: Push Button
-      Rectangle=188 234 244 253
-      Variable=DIRECTION
-      Value=N
-      Create Flags=01010000000000010000000000000001
-      Text=&Next >
-      Text French=&Suite >
-      Text German=&Weiter >
-      Text Spanish=&Siguiente >
-      Text Italian=&Avanti >
-    end
-    item: Push Button
-      Rectangle=264 234 320 253
-      Action=3
-      Create Flags=01010000000000010000000000000000
-      Text=&Cancel
-      Text French=&Annuler
-      Text German=&Abbrechen
-      Text Spanish=&Cancelar
-      Text Italian=&Annulla
-    end
-    item: Static
-      Rectangle=10 225 320 226
-      Action=3
-      Create Flags=01010000000000000000000000000111
-    end
-    item: Static
-      Rectangle=108 11 323 33
-      Create Flags=01010000000000000000000000000000
-      Flags=0000000000000001
-      Name=Times New Roman
-      Font Style=-24 0 0 0 700 255 0 0 0 3 2 1 18
-      Text=Select Destination Directory
-      Text French=Sélectionner le répertoire de destination
-      Text German=Zielverzeichnis wählen
-      Text Spanish=Seleccione el directorio de destino
-      Text Italian=Selezionare Directory di destinazione
-    end
-    item: Listbox
-      Rectangle=108 58 321 219
-      Variable=MAINDIR
-      Enabled Color=00000000000000001111111111111111
-      Create Flags=01010000100000010000000101000001
-      Flags=0000110000001010
-      Text=%MAINDIR%
-      Text=
-    end
-    item: Static
-      Rectangle=108 40 313 58
-      Enabled Color=00000000000000001111111111111111
-      Create Flags=01010000000000000000000000000000
-      Text=Please select a directory for the %APPTITLE% files.
-    end
-  end
-  item: Dialog
-    Title=Select Destination Directory
-    Title French=Sélectionner le répertoire de destination
-    Title German=Zielverzeichnis wählen
-    Title Spanish=Seleccione el directorio de destino
-    Title Italian=Selezionare Directory di destinazione
-    Width=276
-    Height=216
-    Font Name=Helv
-    Font Size=8
-    item: Listbox
-      Rectangle=6 6 204 186
-      Variable=MAINDIR
-      Create Flags=01010000100000010000000101000000
-      Flags=0000110000100010
-      Text=%MAINDIR%
-      Text French=%MAINDIR%
-      Text German=%MAINDIR%
-      Text Spanish=%MAINDIR%
-      Text Italian=%MAINDIR%
-    end
-    item: Push Button
-      Rectangle=209 8 265 26
-      Create Flags=01010000000000010000000000000001
-      Text=OK
-      Text French=OK
-      Text German=OK
-      Text Spanish=Aceptar
-      Text Italian=OK
-    end
-    item: Push Button
-      Rectangle=209 31 265 50
-      Variable=MAINDIR
-      Value=%MAINDIR_SAVE%
-      Create Flags=01010000000000010000000000000000
-      Flags=0000000000000001
-      Text=Cancel
-      Text French=Annuler
-      Text German=Abbrechen
-      Text Spanish=Cancelar
-      Text Italian=Annulla
-    end
-  end
-end
-item: Custom Dialog Set
-  Name=Backup Replaced Files
-  Display Variable=DISPLAY
-  item: Dialog
-    Title=%APPTITLE% Installation
-    Title French=Fichiers de Sauvegarde Remplacés
-    Title German=Sicherungskopie von ersetzten Dateien erstellen
-    Title Portuguese=Ficheiros substituídos de segurança
-    Title Spanish=Copias de seguridad de los archivos reemplazados
-    Title Italian=Backup file sostituiti
-    Title Danish=Sikkerhedskopiering af erstattede filer
-    Title Dutch=Vervangen bestanden kopiëren
-    Title Norwegian=Sikkerhetskopiere erstattede filer
-    Title Swedish=Säkerhetskopiera utbytta filer
-    Width=350
-    Height=280
-    Font Name=Helv
-    Font Size=8
-    item: Push Button
-      Rectangle=188 234 244 251
-      Variable=DIRECTION
-      Value=N
-      Create Flags=01010000000000010000000000000001
-      Text=&Next >
-      Text French=&Suivant>
-      Text German=&Weiter>
-      Text Portuguese=&Próximo>
-      Text Spanish=&Siguiente >
-      Text Italian=&Avanti >
-      Text Danish=&Næste>
-      Text Dutch=&Volgende>
-      Text Norwegian=&Neste>
-      Text Swedish=&Nästa >
-    end
-    item: Push Button
-      Rectangle=131 234 188 251
-      Variable=DIRECTION
-      Value=B
-      Create Flags=01010000000000010000000000000000
-      Text=< &Back
-      Text French=<&Retour
-      Text German=<&Zurück
-      Text Portuguese=<&Retornar
-      Text Spanish=<&Retroceder
-      Text Italian=< &Indietro
-      Text Danish=<&Tilbage
-      Text Dutch=<&Terug
-      Text Norwegian=<&Tilbake
-      Text Swedish=< &Tillbaka
-    end
-    item: Push Button
-      Rectangle=278 234 330 251
-      Action=3
-      Create Flags=01010000000000010000000000000000
-      Text=Cancel
-      Text French=Annuler
-      Text German=Abbrechen
-      Text Portuguese=Cancelar
-      Text Spanish=Cancelar
-      Text Italian=Annulla
-      Text Danish=Annuller
-      Text Dutch=Annuleren
-      Text Norwegian=Avbryt
-      Text Swedish=Avbryt
-    end
-    item: Static
-      Rectangle=11 221 329 223
-      Action=3
-      Create Flags=01010000000000000000000000000111
-    end
-    item: Static
-      Rectangle=108 46 320 98
-      Create Flags=01010000000000000000000000000000
-      Text=This installation program can create backup copies of all files replaced during the installation. These files will be used when the software is uninstalled and a rollback is requested.  If backup copies are not created, you will only be able to uninstall the software and not roll the system back to a previous state.
-      Text=
-      Text=Do you want to create backups of replaced files?
-      Text French=Le programme d'installation peut créer des copies de sauvegarde de tous les fichiers remplacés pendant l'installation. Ces fichiers sont utilisés au cas où le logiciel est désinstallé et que l'on procède à la reprise du système. Si les copies de sauvegarde ne sont pas créées, on ne pourra que désinstaller le logiciel sans reprendre le système à un état précédent. Voulez-vous créer une sauvegarde des fichiers remplacés ?
-      Text German=Dieses Installationsprogramm kann Sicherungskopien von allen während der Installation ersetzten Dateien erstellen. Diese Dateien werden zur Rückgängigmachung der Installation und bei Anforderung eines Rollbacks verwendet. Ohne Sicherungskopien ist nur eine Rückgängigmachung der Installation möglich, nicht aber ein Rollback des Systems. Sicherungskopien der ersetzten Dateien erstellen?
-      Text Portuguese=Este programa de instalação pode criar cópias de segurança de todos os ficheiros substituídos durante a instalação. Estes ficheiros serão utilizados quando o programa for desinstalado  e for requisitada uma retomada. Se as cópias de segurança não forem criadas, só poderá desinstalar o programa e não pode retomar  um estado anterior do sistema. Deseja criar cópias de segurança dos ficheiros substituídos?
-      Text Spanish=Este programa de instalación puede crear copias de seguridad de todos los archivos reemplazados durante la instalación. Estos archivos se utilizarán cuando se desinstale el software y se solicite volver al estado anterior. Si no se crean copias de seguridad, únicamente podrá desinstalar el software y no podrá devolver el sistema al estado anterior. ¿Desea crear archivos de seguridad de los archivos reemplazados?
-      Text Italian=Questo programma di installazione può creare copie di backup di tutti i file sostituiti durante l’installazione. Questi file saranno usati quando il software sarà disinstallato e sarà richiesto un ritorno allo stato precedente. Se non crei le copie di backup, potrai solo disinstallare il software, ma non potrai riportare il sistema allo stato precedente. Vuoi creare i file di backup dei file sostituiti?
-      Text Danish=Dette installationsprogram kan oprette sikkerhedskopier af alle filer, som erstattes under installationen. Disse filer benyttes, når softwaren fjernes, og den tidligere systemkonfiguration genetableres. Hvis der ikke oprettes sikkerhedskopier, kan du kun fjerne den installerede software og ikke genetablere den tidligere systemkonfiguration. Vil du oprette sikkerhedskopier af filer, som erstattes?
-      Text Dutch=Dit installatieprogramma kan kopieën maken van alle bestanden die tijdens de installatie worden vervangen. Deze worden dan gebruikt als de software-installatie ongedaan wordt gemaakt en u het systeem wilt laten terugkeren naar de oorspronkelijke staat. Als er geen back-up kopieën worden gemaakt, kunt u de software enkel verwijderen maar het systeem niet in de oorspronkelijke staat terugbrengen. Wilt u een back-up maken van de vervangen bestanden?
-      Text Norwegian=Dette installasjonsprogrammet kan lage sikkerhetskopier av alle filer som blir erstattet under installasjonen. Disse filene vil tas i bruk når programvaren er avinstallert og det er behov for tilbakestilling. Hvis det ikke er laget sikkerhetskopier, kan du kun avinstallere programvaren og ikke stille systemet tilbake til tidligere status. Ønsker du å lage sikkerhetskopier av de filene som blir erstattet nå?
-      Text Swedish=Installationsprogrammet kan skapa säkerhetskopior av alla filer som byts ut under installationen. Dessa filer kan sedan användas när programvaran avinstalleras och du begär rollback. Om du då inte har några säkerhetskopior kan du bara avinstallera programvaran, inte återskapa systemet i dess tidigare skick. Vill du göra säkerhetskopior av de ersatta filerna?
-    end
-    item: Radio Button
-      Rectangle=141 106 265 136
-      Variable=DOBACKUP
-      Create Flags=01010000000000010000000000001001
-      Text=&Yes, make backups
-      Text=N&o, do not make backups
-      Text=
-      Text French=&Oui
-      Text French=N&on
-      Text French=
-      Text German=&Ja
-      Text German=N&ein
-      Text German=
-      Text Portuguese=&Sim
-      Text Portuguese=Nã&o
-      Text Portuguese=
-      Text Spanish=&Sí
-      Text Spanish=N&o
-      Text Spanish=
-      Text Italian=&Sì
-      Text Italian=N&o
-      Text Italian=
-      Text Danish=&Ja
-      Text Danish=&Nej
-      Text Danish=
-      Text Dutch=&Ja
-      Text Dutch=N&ee
-      Text Dutch=
-      Text Norwegian=&Ja
-      Text Norwegian=&Nei
-      Text Norwegian=
-      Text Swedish=&Ja
-      Text Swedish=N&ej
-      Text Swedish=
-    end
-    item: Static
-      Control Name=BACK2
-      Rectangle=108 173 320 208
-      Action=1
-      Create Flags=01010000000000000000000000000111
-      Text=Backup File Destination Directory
-      Text French=Répertoire de destination des fichiers de sauvegarde
-      Text German=Zielverzeichnis für die Sicherungsdatei
-      Text Portuguese=Directório de destino de ficheiro de segurança
-      Text Spanish=Directorio de Destino de los Archivos de Seguridad
-      Text Italian=Directory di destinazione dei file di backup
-      Text Danish=Destinationsbibliotek til sikkerhedskopier
-      Text Dutch=Doeldirectory backup-bestand
-      Text Norwegian=Målkatalog for sikkerhetskopier
-      Text Swedish=Katalog för säkerhetskopierade filer
-    end
-    item: Push Button
-      Control Name=BACK3
-      Rectangle=265 185 318 203
-      Variable=BACKUP_SAVE
-      Value=%BACKUP%
-      Destination Dialog=1
-      Action=2
-      Create Flags=01010000000000010000000000000000
-      Text=B&rowse...
-      Text French=P&arcourir
-      Text German=B&lättern...
-      Text Portuguese=P&rocurar
-      Text Spanish=V&isualizar...
-      Text Italian=Sfoglia...
-      Text Danish=&Gennemse...
-      Text Dutch=B&laderen...
-      Text Norwegian=Bla igjennom
-      Text Swedish=&Bläddra
-    end
-    item: Static
-      Control Name=BACK4
-      Rectangle=129 188 254 200
-      Destination Dialog=2
-      Create Flags=01010000000000000000000000000000
-      Text=%BACKUP%
-      Text French=%BACKUP%
-      Text German=%BACKUP%
-      Text Portuguese=%BACKUP%
-      Text Spanish=%BACKUP%
-      Text Italian=%BACKUP%
-      Text Danish=%BACKUP%
-      Text Dutch=%BACKUP%
-      Text Norwegian=%BACKUP%
-      Text Swedish=%BACKUP%
-    end
-    item: Static
-      Rectangle=108 11 323 36
-      Create Flags=01010000000000000000000000000000
-      Flags=0000000000000001
-      Name=Times New Roman
-      Font Style=-24 0 0 0 700 255 0 0 0 3 2 1 18
-      Text=Backup Replaced Files
-      Text French=Sélectionner les composants
-      Text German=Komponenten auswählen
-      Text Spanish=Seleccione componentes
-      Text Italian=Selezionare i componenti
-    end
-    item: If/While Statement
-      Variable=DOBACKUP
-      Value=B
-    end
-    item: Set Control Attribute
-      Control Name=BACK3
-      Operation=1
-    end
-    item: Set Control Attribute
-      Control Name=BACK4
-      Operation=1
-    end
-    item: Else Statement
-    end
-    item: Set Control Attribute
-      Control Name=BACK3
-    end
-    item: Set Control Attribute
-      Control Name=BACK4
-    end
-    item: End Block
-    end
-  end
-  item: Dialog
-    Title=Select Destination Directory
-    Title French=Choisissez le répertoire de destination
-    Title German=Zielverzeichnis wählen
-    Title Portuguese=Seleccionar Directório de Destino
-    Title Spanish=Seleccione el Directorio de Destino
-    Title Italian=Seleziona Directory di destinazione
-    Title Danish=Vælg Destinationsbibliotek
-    Title Dutch=Kies Doeldirectory
-    Title Norwegian=Velg målkatalog
-    Title Swedish=Välj destinationskalatog
-    Width=276
-    Height=216
-    Font Name=Helv
-    Font Size=8
-    item: Listbox
-      Rectangle=6 3 200 186
-      Variable=BACKUP
-      Create Flags=01010000100000010000000101000000
-      Flags=0000110000100010
-      Text=%BACKUP%
-      Text=
-      Text French=%BACKUP%
-      Text French=
-      Text German=%BACKUP%
-      Text German=
-      Text Portuguese=%BACKUP%
-      Text Portuguese=
-      Text Spanish=%BACKUP%
-      Text Spanish=
-      Text Italian=%BACKUP%
-      Text Italian=
-      Text Danish=%BACKUP%
-      Text Danish=
-      Text Dutch=%BACKUP%
-      Text Dutch=
-      Text Norwegian=%BACKUP%
-      Text Norwegian=
-      Text Swedish=%BACKUP%
-      Text Swedish=
-    end
-    item: Push Button
-      Rectangle=209 8 265 26
-      Create Flags=01010000000000010000000000000001
-      Text=OK
-      Text French=OK
-      Text German=OK
-      Text Portuguese=OK
-      Text Spanish=ACEPTAR
-      Text Italian=OK
-      Text Danish=OK
-      Text Dutch=OK
-      Text Norwegian=OK
-      Text Swedish=OK
-    end
-    item: Push Button
-      Rectangle=209 31 265 50
-      Variable=BACKUP
-      Value=%BACKUP_SAVE%
-      Create Flags=01010000000000010000000000000000
-      Flags=0000000000000001
-      Text=Cancel
-      Text French=Annuler
-      Text German=Abbrechen
-      Text Portuguese=Cancelar
-      Text Spanish=Cancelar
-      Text Italian=Annulla
-      Text Danish=Slet
-      Text Dutch=Annuleren
-      Text Norwegian=Avbryt
-      Text Swedish=Avbryt
-    end
-  end
-end
-item: Custom Dialog Set
-  Name=Select Components
-  Display Variable=DISPLAY
-  item: Dialog
-    Title=%APPTITLE% Installation
-    Title French=Installation de %APPTITLE%
-    Title German=Installation von %APPTITLE%
-    Title Spanish=Instalación de %APPTITLE%
-    Title Italian=Installazione di %APPTITLE%
-    Width=339
-    Height=280
-    Font Name=Helv
-    Font Size=8
-    item: Push Button
-      Rectangle=188 234 244 253
-      Variable=DIRECTION
-      Value=N
-      Create Flags=01010000000000010000000000000001
-      Text=&Next >
-      Text French=&Suite >
-      Text German=&Weiter >
-      Text Spanish=&Siguiente >
-      Text Italian=&Avanti >
-    end
-    item: Push Button
-      Rectangle=131 234 188 253
-      Variable=DIRECTION
-      Value=B
-      Create Flags=01010000000000010000000000000000
-      Text=< &Back
-      Text French=< &Retour
-      Text German=< &Zurück
-      Text Spanish=< &Atrás
-      Text Italian=< &Indietro
-    end
-    item: Push Button
-      Rectangle=264 234 320 253
-      Action=3
-      Create Flags=01010000000000010000000000000000
-      Text=&Cancel
-      Text French=&Annuler
-      Text German=&Abbrechen
-      Text Spanish=&Cancelar
-      Text Italian=&Annulla
-    end
-    item: Checkbox
-      Rectangle=108 66 313 156
-      Variable=COMPONENTS
-      Create Flags=01010000000000010000000000000011
-      Flags=0000000000000110
-      Text=Python interpreter and libraries
-      Text=Tcl/Tk (Tkinter, IDLE, pydoc)
-      Text=Python HTML docs
-      Text=Python utility scripts (Tools/)
-      Text=Python test suite (Lib/test/)
-      Text=
-      Text French=Python interpreter, library and IDLE
-      Text French=Python HTML docs
-      Text French=Python utility scripts (Tools/)
-      Text French=Python test suite (Lib/test/)
-      Text French=
-      Text German=Python interpreter, library and IDLE
-      Text German=Python HTML docs
-      Text German=Python utility scripts (Tools/)
-      Text German=Python test suite (Lib/test/)
-      Text German=
-      Text Spanish=Python interpreter, library and IDLE
-      Text Spanish=Python HTML docs
-      Text Spanish=Python utility scripts (Tools/)
-      Text Spanish=Python test suite (Lib/test/)
-      Text Spanish=
-      Text Italian=Python interpreter, library and IDLE
-      Text Italian=Python HTML docs
-      Text Italian=Python utility scripts (Tools/)
-      Text Italian=Python test suite (Lib/test/)
-      Text Italian=
-    end
-    item: Static
-      Rectangle=108 45 320 63
-      Create Flags=01010000000000000000000000000000
-      Text=Choose which components to install by checking the boxes below.
-      Text French=Choisissez les composants que vous voulez installer en cochant les cases ci-dessous.
-      Text German=Wählen Sie die zu installierenden Komponenten, indem Sie in die entsprechenden Kästchen klicken.
-      Text Spanish=Elija los componentes que desee instalar marcando los cuadros de abajo.
-      Text Italian=Scegliere quali componenti installare selezionando le caselle sottostanti.
-    end
-    item: Push Button
-      Rectangle=188 203 269 220
-      Destination Dialog=1
-      Action=2
-      Enabled Color=00000000000000000000000011111111
-      Create Flags=01010000000000010000000000000000
-      Text=Advanced Options ...
-    end
-    item: Static
-      Rectangle=10 225 320 226
-      Action=3
-      Create Flags=01010000000000000000000000000111
-    end
-    item: Static
-      Rectangle=108 10 323 43
-      Create Flags=01010000000000000000000000000000
-      Flags=0000000000000001
-      Name=Times New Roman
-      Font Style=-24 0 0 0 700 255 0 0 0 3 2 1 18
-      Text=Select Components
-      Text French=Sélectionner les composants
-      Text German=Komponenten auswählen
-      Text Spanish=Seleccione componentes
-      Text Italian=Selezionare i componenti
-    end
-    item: Static
-      Rectangle=251 180 311 193
-      Variable=COMPONENTS
-      Value=MAINDIR
-      Create Flags=01010000000000000000000000000010
-    end
-    item: Static
-      Rectangle=251 168 311 179
-      Variable=COMPONENTS
-      Create Flags=01010000000000000000000000000010
-    end
-    item: Static
-      Rectangle=123 168 234 181
-      Create Flags=01010000000000000000000000000000
-      Text=Disk Space Required:
-      Text French=Espace disque requis :
-      Text German=Notwendiger Speicherplatz:
-      Text Spanish=Espacio requerido en el disco:
-      Text Italian=Spazio su disco necessario:
-    end
-    item: Static
-      Rectangle=123 180 234 193
-      Create Flags=01010000000000000000000000000000
-      Text=Disk Space Remaining:
-      Text French=Espace disque disponible :
-      Text German=Verbleibender Speicherplatz:
-      Text Spanish=Espacio en disco disponible:
-      Text Italian=Spazio su disco disponibile:
-    end
-    item: Static
-      Rectangle=108 158 320 196
-      Action=1
-      Create Flags=01010000000000000000000000000111
-    end
-    item: If/While Statement
-      Variable=DLG_EVENT_TYPE
-      Value=VERIFY
-    end
-    item: Remark
-      Text=If they're installing Tcl/Tk, Tools, or the test suite, doesn't make much sense unless they're installing Python too.
-    end
-    item: If/While Statement
-      Variable=COMPONENTS
-      Value=BDE
-      Flags=00001010
-    end
-    item: If/While Statement
-      Variable=COMPONENTS
-      Value=A
-      Flags=00000011
-    end
-    item: Display Message
-      Title=Are you sure?
-      Text=Installing Tcl/Tk, Tools or the test suite doesn't make much sense unless you install the Python interpreter and libraries too.
-      Text=
-      Text=Click Yes if that's really what you want.
-      Flags=00101101
-    end
-    item: Remark
-      Text=Nothing -- just proceed to the next dialog.
-    end
-    item: Else Statement
-    end
-    item: Remark
-      Text=Return to the dialog.
-    end
-    item: Set Variable
-      Variable=DLG_EVENT_TYPE
-    end
-    item: End Block
-    end
-    item: End Block
-    end
-    item: End Block
-    end
-    item: End Block
-    end
-  end
-  item: Dialog
-    Title=Advanced Options
-    Width=339
-    Height=213
-    Font Name=Helv
-    Font Size=8
-    item: Radio Button
-      Control Name=ADMIN2
-      Rectangle=11 46 90 76
-      Variable=SELECT_ADMIN
-      Enabled Color=00000000000000001111111111111111
-      Create Flags=01010000000000010000000000001001
-      Text=Admin install
-      Text=Non-Admin installl
-      Text=
-    end
-    item: Push Button
-      Rectangle=188 170 244 189
-      Variable=DIRECTION
-      Value=N
-      Create Flags=01010000000000010000000000000001
-      Text=OK
-      Text French=&Suite >
-      Text German=&Weiter >
-      Text Spanish=&Siguiente >
-      Text Italian=&Avanti >
-    end
-    item: Static
-      Rectangle=5 3 326 83
-      Action=1
-      Enabled Color=00000000000000001111111111111111
-      Create Flags=01010000000000000000000000000111
-    end
-    item: Static
-      Control Name=ADMIN1
-      Rectangle=11 11 321 45
-      Enabled Color=00000000000000001111111111111111
-      Create Flags=01010000000000000000000000000000
-      Text=By default, the install records settings in the per-machine area of the registry (HKLM), and installs the Python and C runtime DLLs to %SYS32%.  Choose "Non-Admin install" if you would prefer settings made in the per-user registry (HKCU), and DLLs installed in %MAINDIR%.
-    end
-    item: Static
-      Rectangle=5 90 326 157
-      Action=1
-      Enabled Color=00000000000000001111111111111111
-      Create Flags=01010000000000000000000000000111
-    end
-    item: Checkbox
-      Rectangle=11 121 243 151
-      Variable=TASKS
-      Enabled Color=00000000000000001111111111111111
-      Create Flags=01010000000000010000000000000011
-      Text=Register file extensions (.py, .pyw, .pyc, .pyo)
-      Text=Create Start Menu shortcuts
-      Text=
-    end
-    item: Static
-      Rectangle=11 103 320 121
-      Enabled Color=00000000000000001111111111111111
-      Create Flags=01010000000000000000000000000000
-      Text=Choose tasks to perform by checking the boxes below.
-    end
-    item: If/While Statement
-      Variable=DLG_EVENT_TYPE
-      Value=INIT
-    end
-    item: If/While Statement
-      Variable=DOADMIN
-      Value=1
-    end
-    item: Set Control Attribute
-      Control Name=ADMIN2
-    end
-    item: Else Statement
-    end
-    item: Set Control Text
-      Control Name=ADMIN1
-      Control Text=This section is available only if logged in to an account with Administrator privileges.
-    end
-    item: Set Control Attribute
-      Control Name=ADMIN2
-      Operation=1
-    end
-    item: End Block
-    end
-    item: End Block
-    end
-  end
-end
-item: Custom Dialog Set
-  Name=Select Program Manager Group
-  Display Variable=DISPLAY
-  item: Dialog
-    Title=%APPTITLE% Installation
-    Title French=Installation de %APPTITLE%
-    Title German=Installation von %APPTITLE%
-    Title Spanish=Instalación de %APPTITLE%
-    Title Italian=Installazione di %APPTITLE%
-    Width=339
-    Height=280
-    Font Name=Helv
-    Font Size=8
-    item: Push Button
-      Rectangle=188 234 244 253
-      Variable=DIRECTION
-      Value=N
-      Create Flags=01010000000000010000000000000001
-      Text=&Next >
-      Text French=&Suite >
-      Text German=&Weiter >
-      Text Spanish=&Siguiente >
-      Text Italian=&Avanti >
-    end
-    item: Push Button
-      Rectangle=131 234 188 253
-      Variable=DIRECTION
-      Value=B
-      Create Flags=01010000000000010000000000000000
-      Flags=0000000000000001
-      Text=< &Back
-      Text French=< &Retour
-      Text German=< &Zurück
-      Text Spanish=< &Atrás
-      Text Italian=< &Indietro
-    end
-    item: Push Button
-      Rectangle=264 234 320 253
-      Action=3
-      Create Flags=01010000000000010000000000000000
-      Text=&Cancel
-      Text French=&Annuler
-      Text German=&Abbrechen
-      Text Spanish=&Cancelar
-      Text Italian=&Annulla
-    end
-    item: Static
-      Rectangle=10 225 320 226
-      Action=3
-      Create Flags=01010000000000000000000000000111
-    end
-    item: Static
-      Rectangle=108 10 323 53
-      Create Flags=01010000000000000000000000000000
-      Flags=0000000000000001
-      Name=Times New Roman
-      Font Style=-24 0 0 0 700 255 0 0 0 3 2 1 18
-      Text=Select Start Menu Group
-      Text French=Sélectionner le groupe du Gestionnaire de programme
-      Text German=Bestimmung der Programm-Managergruppe
-      Text Spanish=Seleccione grupo del Administrador de programas
-      Text Italian=Selezionare il gruppo ProgMan
-    end
-    item: Static
-      Rectangle=108 35 320 65
-      Create Flags=01010000000000000000000000000000
-      Text=Enter the name of the Start Menu program group to which to add the %APPTITLE% icons:
-      Text French=Entrez le nom du groupe du Gestionnaire de programme dans lequel vous souhaitez ajouter les icônes de %APPTITLE% :
-      Text German=Geben Sie den Namen der Programmgruppe ein, der das Symbol %APPTITLE% hinzugefügt werden soll:
-      Text Spanish=Escriba el nombre del grupo del Administrador de programas en el que desea agregar los iconos de %APPTITLE%:
-      Text Italian=Inserire il nome del gruppo Program Manager per aggiungere le icone %APPTITLE% a:
-    end
-    item: Combobox
-      Rectangle=108 56 320 219
-      Variable=GROUP
-      Create Flags=01010000001000010000001100000001
-      Flags=0000000000000001
-      Text=%GROUP%
-      Text=
-      Text French=%GROUP%
-      Text German=%GROUP%
-      Text Spanish=%GROUP%
-      Text Italian=%GROUP%
-    end
-  end
-end
-item: Custom Dialog Set
-  Name=Start Installation
-  Display Variable=DISPLAY
-  item: Dialog
-    Title=%APPTITLE% Installation
-    Title French=Installation de %APPTITLE%
-    Title German=Installation von %APPTITLE%
-    Title Spanish=Instalación de %APPTITLE%
-    Title Italian=Installazione di %APPTITLE%
-    Width=339
-    Height=280
-    Font Name=Helv
-    Font Size=8
-    item: Push Button
-      Rectangle=188 234 244 253
-      Variable=DIRECTION
-      Value=N
-      Create Flags=01010000000000010000000000000001
-      Text=&Next >
-      Text French=&Suite >
-      Text German=&Weiter >
-      Text Spanish=&Siguiente >
-      Text Italian=&Avanti >
-    end
-    item: Push Button
-      Rectangle=131 234 188 253
-      Variable=DIRECTION
-      Value=B
-      Create Flags=01010000000000010000000000000000
-      Text=< &Back
-      Text French=< &Retour
-      Text German=< &Zurück
-      Text Spanish=< &Atrás
-      Text Italian=< &Indietro
-    end
-    item: Push Button
-      Rectangle=264 234 320 253
-      Action=3
-      Create Flags=01010000000000010000000000000000
-      Text=&Cancel
-      Text French=&Annuler
-      Text German=&Abbrechen
-      Text Spanish=&Cancelar
-      Text Italian=&Annulla
-    end
-    item: Static
-      Rectangle=10 225 320 226
-      Action=3
-      Create Flags=01010000000000000000000000000111
-    end
-    item: Static
-      Rectangle=108 10 323 53
-      Create Flags=01010000000000000000000000000000
-      Flags=0000000000000001
-      Name=Times New Roman
-      Font Style=-24 0 0 0 700 255 0 0 0 3 2 1 18
-      Text=Ready to Install!
-      Text French=Prêt à installer !
-      Text German=Installationsbereit!
-      Text Spanish=¡Preparado para la instalación!
-      Text Italian=Pronto per l'installazione!
-    end
-    item: Static
-      Rectangle=108 40 320 62
-      Create Flags=01010000000000000000000000000000
-      Text=Click the Next button to install %APPTITLE%, or the Back button to change choices:
-      Text French=Vous êtes maintenant prêt à installer les fichiers %APPTITLE%.
-      Text French=
-      Text French=Cliquez sur le bouton Suite pour commencer l'installation ou sur le bouton Retour pour entrer les informations d'installation à nouveau.
-      Text German=Sie können %APPTITLE% nun installieren.
-      Text German=
-      Text German=Klicken Sie auf "Weiter", um mit der Installation zu beginnen. Klicken Sie auf "Zurück", um die Installationsinformationen neu einzugeben.
-      Text Spanish=Ya está listo para instalar %APPTITLE%.
-      Text Spanish=
-      Text Spanish=Presione el botón Siguiente para comenzar la instalación o presione Atrás para volver a ingresar la información para la instalación.
-      Text Italian=Ora è possibile installare %APPTITLE%.
-      Text Italian=
-      Text Italian=Premere il pulsante Avanti per avviare l'installazione o il pulsante Indietro per reinserire le informazioni di installazione.
-    end
-    item: Editbox
-      Rectangle=108 66 324 219
-      Help Context=16711681
-      Enabled Color=00000000000000001111111111111111
-      Create Flags=01010000100000000001100011000100
-      Text=%SUMMARY%
-    end
-  end
-end
-item: Remark
-end
-item: If/While Statement
-  Variable=DISPLAY
-  Value=Select Destination Directory
-end
-item: Remark
-  Text=User may have changed MAINDIR, so reset BACKUP to match.
-end
-item: Set Variable
-  Variable=BACKUP
-  Value=%MAINDIR%\BACKUP
-end
-item: End Block
-end
-item: Remark
-end
-item: End Block
-end
-item: Remark
-end
-item: Remark
-  Text=BEGIN WIZARD STUFF -----------------------------------------------------------------------------------------------------------------------------
-end
-item: Remark
-  Text=When the BACKUP feature is enabled, the BACKUPDIR is initialized
-end
-item: If/While Statement
-  Variable=DOBACKUP
-  Value=A
-end
-item: Set Variable
-  Variable=BACKUPDIR
-  Value=%BACKUP%
-end
-item: End Block
-end
-item: Remark
-  Text=The BRANDING information is written to the INI file on the installation media.
-end
-item: If/While Statement
-  Variable=BRANDING
-  Value=1
-end
-item: If/While Statement
-  Variable=DOBRAND
-  Value=1
-end
-item: Edit INI File
-  Pathname=%INST%\CUSTDATA.INI
-  Settings=[Registration]
-  Settings=NAME=%NAME%
-  Settings=COMPANY=%COMPANY%
-  Settings=
-end
-item: End Block
-end
-item: End Block
-end
-item: Remark
-  Text=Begin writing to the INSTALL.LOG
-end
-item: Open/Close INSTALL.LOG
-end
-item: Remark
-  Text=Check free disk space calculates free disk space as well as component sizes.
-end
-item: Remark
-  Text=It should be located before all Install File actions.
-end
-item: Check Disk Space
-  Component=COMPONENTS
-end
-item: Remark
-  Text=This include script allows uninstall support
-end
-item: Remark
-  Text=Note from Tim:  this is our own Uninstal.wse, a copy of Wise's except
-end
-item: Remark
-  Text=it writes to HKCU (instead of HKLM) if the user doesn't have admin privs.
-end
-item: Include Script
-  Pathname=.\Uninstal.wse
-end
-item: Remark
-  Text=Note from Tim: these seeming no-ops actually convert to short filenames.
-end
-item: Set Variable
-  Variable=COMMON
-  Value=%COMMON%
-  Flags=00010100
-end
-item: Set Variable
-  Variable=MAINDIR
-  Value=%MAINDIR%
-  Flags=00010100
-end
-item: Remark
-  Text=This IF/THEN/ELSE reads the correct registry entries for shortcut/icon placement
-end
-item: Check Configuration
-  Flags=10111011
-end
-item: Get Registry Key Value
-  Variable=STARTUPDIR
-  Key=Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
-  Default=%WIN%\Start Menu\Programs\StartUp
-  Value Name=StartUp
-  Flags=00000010
-end
-item: Get Registry Key Value
-  Variable=DESKTOPDIR
-  Key=Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
-  Default=%WIN%\Desktop
-  Value Name=Desktop
-  Flags=00000010
-end
-item: Get Registry Key Value
-  Variable=STARTMENUDIR
-  Key=Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
-  Default=%WIN%\Start Menu
-  Value Name=Start Menu
-  Flags=00000010
-end
-item: Get Registry Key Value
-  Variable=GROUPDIR
-  Key=Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
-  Default=%WIN%\Start Menu\Programs
-  Value Name=Programs
-  Flags=00000010
-end
-item: Get Registry Key Value
-  Variable=CSTARTUPDIR
-  Key=Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
-  Default=%STARTUPDIR%
-  Value Name=Common Startup
-  Flags=00000100
-end
-item: Get Registry Key Value
-  Variable=CDESKTOPDIR
-  Key=Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
-  Default=%DESKTOPDIR%
-  Value Name=Common Desktop
-  Flags=00000100
-end
-item: Get Registry Key Value
-  Variable=CSTARTMENUDIR
-  Key=Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
-  Default=%STARTMENUDIR%
-  Value Name=Common Start Menu
-  Flags=00000100
-end
-item: Get Registry Key Value
-  Variable=CGROUPDIR
-  Key=Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
-  Default=%GROUPDIR%
-  Value Name=Common Programs
-  Flags=00000100
-end
-item: Else Statement
-end
-item: Remark
-  Text=Note from Tim:  the Wizard left this block empty!
-end
-item: Remark
-  Text=Perhaps it's only relevant on Windows 3.1.
-end
-item: End Block
-end
-item: Remark
-  Text=END WIZARD STUFF -----------------------------------------------------------------------------------------------------------------------------
-end
-item: Remark
-end
-item: If/While Statement
-  Variable=SELECT_ADMIN
-  Value=B
-end
-item: Remark
-  Text=The user chose a non-admin install in "Advanced Options".
-end
-item: Remark
-  Text=This should come after the include of Uninstal.wse above, because
-end
-item: Remark
-  Text=writing uninstall info to HKCU is ineffective except under Win2K.
-end
-item: Set Variable
-  Variable=DOADMIN
-  Value=0
-end
-item: End Block
-end
-item: Remark
-end
-item: Set Variable
-  Variable=CGROUP_SAVE
-  Value=%GROUP%
-end
-item: If/While Statement
-  Variable=TASKS
-  Value=B
-  Flags=00000010
-end
-item: If/While Statement
-  Variable=DOADMIN
-  Value=1
-end
-item: Set Variable
-  Variable=GROUP
-  Value=%CGROUPDIR%\%GROUP%
-end
-item: Else Statement
-end
-item: Set Variable
-  Variable=GROUP
-  Value=%GROUPDIR%\%GROUP%
-end
-item: End Block
-end
-item: End Block
-end
-item: Remark
-end
-item: Remark
-  Text=Long section to install files.
-end
-item: Remark
-end
-item: If/While Statement
-  Variable=DOADMIN
-  Value=1
-end
-item: Set Variable
-  Variable=DLLDEST
-  Value=%SYS32%
-end
-item: Else Statement
-end
-item: Set Variable
-  Variable=DLLDEST
-  Value=%MAINDIR%
-end
-item: End Block
-end
-item: Remark
-end
-item: Remark
-  Text=Install the license even if they deselect everything <wink>.
-end
-item: Install File
-  Source=..\license
-  Destination=%MAINDIR%\LICENSE.txt
-  Flags=0000000000000010
-end
-item: Install File
-  Source=..\readme
-  Destination=%MAINDIR%\README.txt
-  Flags=0000000000000010
-end
-item: Install File
-  Source=..\misc\news
-  Destination=%MAINDIR%\NEWS.txt
-  Flags=0000000000000010
-end
-item: Remark
-  Text=Icons -- always install so that the uninstaller can use them for its own display.
-end
-item: Install File
-  Source=..\pc\pycon.ico
-  Destination=%MAINDIR%\pycon.ico
-  Flags=0000000010000010
-end
-item: Install File
-  Source=..\pc\pyc.ico
-  Destination=%MAINDIR%\pyc.ico
-  Flags=0000000010000010
-end
-item: Install File
-  Source=..\pc\py.ico
-  Destination=%MAINDIR%\py.ico
-  Flags=0000000010000010
-end
-item: Remark
-end
-item: Remark
-  Text=These arrange to (recursively!) delete all .pyc and .pyo files at uninstall time.
-end
-item: Remark
-  Text=This "does the right thing":  any directories left empty at the end are removed.
-end
-item: Add Text to INSTALL.LOG
-  Text=File Tree: %MAINDIR%\*.pyc
-end
-item: Add Text to INSTALL.LOG
-  Text=File Tree: %MAINDIR%\*.pyo
-end
-item: Remark
-end
-item: Remark
-  Text=A: interpreter and libraries
-end
-item: If/While Statement
-  Variable=COMPONENTS
-  Value=A
-  Flags=00000010
-end
-item: Remark
-  Text=Executables
-end
-item: Install File
-  Source=.\python.exe
-  Destination=%MAINDIR%\python.exe
-  Flags=0000000000000010
-end
-item: Install File
-  Source=.\pythonw.exe
-  Destination=%MAINDIR%\pythonw.exe
-  Flags=0000000000000010
-end
-item: Install File
-  Source=.\w9xpopen.exe
-  Destination=%MAINDIR%\w9xpopen.exe
-  Flags=0000000000000010
-end
-item: Remark
-end
-item: Remark
-  Text=Extension module DLLs (.pyd); keep in synch with libs directory next
-end
-item: Install File
-  Source=.\winreg.pyd
-  Destination=%MAINDIR%\DLLs\winreg.pyd
-  Description=Extension modules
-  Flags=0000000000000010
-end
-item: Install File
-  Source=.\_csv.pyd
-  Destination=%MAINDIR%\DLLs\_csv.pyd
-  Flags=0000000000000010
-end
-item: Install File
-  Source=.\_sre.pyd
-  Destination=%MAINDIR%\DLLs\_sre.pyd
-  Flags=0000000000000010
-end
-item: Install File
-  Source=.\_ssl.pyd
-  Destination=%MAINDIR%\DLLs\_ssl.pyd
-  Flags=0000000000000010
-end
-item: Install File
-  Source=.\_symtable.pyd
-  Destination=%MAINDIR%\DLLs\_symtable.pyd
-  Flags=0000000000000010
-end
-item: Install File
-  Source=.\_testcapi.pyd
-  Destination=%MAINDIR%\DLLs\_testcapi.pyd
-  Flags=0000000000000010
-end
-item: Install File
-  Source=.\_tkinter.pyd
-  Destination=%MAINDIR%\DLLs\_tkinter.pyd
-  Flags=0000000000000010
-end
-item: Install File
-  Source=.\_socket.pyd
-  Destination=%MAINDIR%\DLLs\_socket.pyd
-  Flags=0000000000000010
-end
-item: Install File
-  Source=.\bz2.pyd
-  Destination=%MAINDIR%\DLLs\bz2.pyd
-  Flags=0000000000000010
-end
-item: Install File
-  Source=.\datetime.pyd
-  Destination=%MAINDIR%\DLLs\datetime.pyd
-  Flags=0000000000000010
-end
-item: Install File
-  Source=.\mmap.pyd
-  Destination=%MAINDIR%\DLLs\mmap.pyd
-  Flags=0000000000000010
-end
-item: Install File
-  Source=.\parser.pyd
-  Destination=%MAINDIR%\DLLs\parser.pyd
-  Flags=0000000000000010
-end
-item: Install File
-  Source=.\pyexpat.pyd
-  Destination=%MAINDIR%\DLLs\pyexpat.pyd
-  Flags=0000000000000010
-end
-item: Install File
-  Source=.\select.pyd
-  Destination=%MAINDIR%\DLLs\select.pyd
-  Flags=0000000000000010
-end
-item: Install File
-  Source=.\unicodedata.pyd
-  Destination=%MAINDIR%\DLLs\unicodedata.pyd
-  Flags=0000000000000010
-end
-item: Install File
-  Source=.\winsound.pyd
-  Destination=%MAINDIR%\DLLs\winsound.pyd
-  Flags=0000000000000010
-end
-item: Install File
-  Source=.\zlib.pyd
-  Destination=%MAINDIR%\DLLs\zlib.pyd
-  Flags=0000000000000010
-end
-item: Remark
-end
-item: Remark
-  Text=Link libraries (.lib); keep in synch with DLLs above, except that the Python lib lives here.
-end
-item: Install File
-  Source=.\winreg.lib
-  Destination=%MAINDIR%\libs\winreg.lib
-  Description=Link library files
-  Flags=0000000000000010
-end
-item: Install File
-  Source=.\_csv.lib
-  Destination=%MAINDIR%\libs\_csv.lib
-  Flags=0000000000000010
-end
-item: Install File
-  Source=.\_sre.lib
-  Destination=%MAINDIR%\libs\_sre.lib
-  Flags=0000000000000010
-end
-item: Install File
-  Source=.\_ssl.lib
-  Destination=%MAINDIR%\libs\_ssl.lib
-  Flags=0000000000000010
-end
-item: Install File
-  Source=.\_symtable.lib
-  Destination=%MAINDIR%\libs\_symtable.lib
-  Flags=0000000000000010
-end
-item: Install File
-  Source=.\_testcapi.lib
-  Destination=%MAINDIR%\libs\_testcapi.lib
-  Flags=0000000000000010
-end
-item: Install File
-  Source=.\_tkinter.lib
-  Destination=%MAINDIR%\libs\_tkinter.lib
-  Description=Extension modules
-  Flags=0000000000000010
-end
-item: Install File
-  Source=.\_socket.lib
-  Destination=%MAINDIR%\libs\_socket.lib
-  Flags=0000000000000010
-end
-item: Install File
-  Source=.\bz2.lib
-  Destination=%MAINDIR%\libs\bz2.lib
-  Flags=0000000000000010
-end
-item: Install File
-  Source=.\datetime.lib
-  Destination=%MAINDIR%\libs\datetime.lib
-  Flags=0000000000000010
-end
-item: Install File
-  Source=.\mmap.lib
-  Destination=%MAINDIR%\libs\mmap.lib
-  Flags=0000000000000010
-end
-item: Install File
-  Source=.\parser.lib
-  Destination=%MAINDIR%\libs\parser.lib
-  Flags=0000000000000010
-end
-item: Install File
-  Source=.\pyexpat.lib
-  Destination=%MAINDIR%\libs\pyexpat.lib
-  Flags=0000000000000010
-end
-item: Install File
-  Source=.\select.lib
-  Destination=%MAINDIR%\libs\select.lib
-  Flags=0000000000000010
-end
-item: Install File
-  Source=.\unicodedata.lib
-  Destination=%MAINDIR%\libs\unicodedata.lib
-  Flags=0000000000000010
-end
-item: Install File
-  Source=.\winsound.lib
-  Destination=%MAINDIR%\libs\winsound.lib
-  Flags=0000000000000010
-end
-item: Install File
-  Source=.\zlib.lib
-  Destination=%MAINDIR%\libs\zlib.lib
-  Flags=0000000000000010
-end
-item: Remark
-end
-item: Install File
-  Source=.\python%_pymajor_%%_pyminor_%.lib
-  Destination=%MAINDIR%\libs\python%_PYMAJOR_%%_PYMINOR_%.lib
-  Flags=0000000000000010
-end
-item: Remark
-end
-item: Remark
-  Text=Main Python DLL
-end
-item: Remark
-  Text=Tell Wise it's OK to delete the Python DLL at uninstall time,
-end
-item: Remark
-  Text=despite that we (may) write it into a system directory.
-end
-item: Add Text to INSTALL.LOG
-  Text=Non-System File:
-end
-item: Install File
-  Source=.\python%_pymajor_%%_pyminor_%.dll
-  Destination=%DLLDEST%\python%_PYMAJOR_%%_PYMINOR_%.dll
-  Flags=0000000000000010
-end
-item: Remark
-end
-item: Remark
-  Text=Libraries (Lib/)
-end
-item: Install File
-  Source=..\lib\*.py
-  Destination=%MAINDIR%\Lib
-  Description=Library Modules
-  Flags=0000000000000010
-end
-item: Remark
-end
-item: Install File
-  Source=..\lib\compiler\*.py
-  Destination=%MAINDIR%\Lib\compiler
-  Description=Python compiler written in Python
-  Flags=0000000000000010
-end
-item: Remark
-end
-item: Install File
-  Source=..\lib\distutils\*.py
-  Destination=%MAINDIR%\Lib\distutils
-  Description=Distribution utility modules
-  Flags=0000000000000010
-end
-item: Install File
-  Source=..\lib\distutils\readme
-  Destination=%MAINDIR%\Lib\distutils\README.txt
-  Flags=0000000000000010
-end
-item: Install File
-  Source=..\lib\distutils\command\*.py
-  Destination=%MAINDIR%\Lib\distutils\command
-  Flags=0000000000000010
-end
-item: Install File
-  Source=..\lib\distutils\command\wininst.exe
-  Destination=%MAINDIR%\Lib\distutils\command\wininst.exe
-  Flags=0000000000000010
-end
-item: Install File
-  Source=..\lib\distutils\command\command_template
-  Destination=%MAINDIR%\Lib\distutils\command\command_template
-  Flags=0000000000000010
-end
-item: Remark
-end
-item: Install File
-  Source=..\lib\email\*.py
-  Destination=%MAINDIR%\Lib\email
-  Description=Library email package
-  Flags=0000000000000010
-end
-item: Install File
-  Source=..\lib\email\test\*.py
-  Destination=%MAINDIR%\Lib\email\test
-  Description=email tests
-  Flags=0000000000000010
-end
-item: Install File
-  Source=..\lib\email\test\data\*.txt
-  Destination=%MAINDIR%\Lib\email\test\data
-  Description=email test data
-  Flags=0000000000000010
-end
-item: Install File
-  Source=..\lib\email\test\data\*.gif
-  Destination=%MAINDIR%\Lib\email\test\data
-  Description=email test data
-  Flags=0000000000000010
-end
-item: Install File
-  Source=..\lib\email\test\data\*.au
-  Destination=%MAINDIR%\Lib\email\test\data
-  Description=email test data
-  Flags=0000000000000010
-end
-item: Remark
-end
-item: Install File
-  Source=..\lib\encodings\*.py
-  Destination=%MAINDIR%\Lib\encodings
-  Description=Unicode encoding tables
-  Flags=0000000000000010
-end
-item: Remark
-end
-item: Install File
-  Source=..\lib\hotshot\*.py
-  Destination=%MAINDIR%\Lib\hotshot
-  Description=Fast Python profiler
-  Flags=0000000000000010
-end
-item: Remark
-end
-item: Install File
-  Source=..\lib\lib-old\*.py
-  Destination=%MAINDIR%\Lib\lib-old
-  Description=Obsolete modules
-  Flags=0000000000000010
-end
-item: Remark
-end
-item: Install File
-  Source=..\lib\tkinter\*.py
-  Destination=%MAINDIR%\Lib\tkinter
-  Description=Tkinter related library modules
-  Flags=0000000000000010
-end
-item: Remark
-end
-item: Install File
-  Source=..\lib\logging\*.py
-  Destination=%MAINDIR%\Lib\logging
-  Description=Logging package
-  Flags=0000000000000010
-end
-item: Remark
-end
-item: Install File
-  Source=..\lib\site-packages\readme
-  Destination=%MAINDIR%\Lib\site-packages\README.txt
-  Description=Site packages
-  Flags=0000000000000010
-end
-item: Remark
-end
-item: Install File
-  Source=..\lib\xml\*.py
-  Destination=%MAINDIR%\Lib\xml
-  Description=XML support packages
-  Flags=0000000000000010
-end
-item: Install File
-  Source=..\lib\xml\dom\*.py
-  Destination=%MAINDIR%\Lib\xml\dom
-  Flags=0000000000000010
-end
-item: Install File
-  Source=..\lib\xml\parsers\*.py
-  Destination=%MAINDIR%\Lib\xml\parsers
-  Flags=0000000000000010
-end
-item: Install File
-  Source=..\lib\xml\sax\*.py
-  Destination=%MAINDIR%\Lib\xml\sax
-  Flags=0000000000000010
-end
-item: Remark
-end
-item: Remark
-  Text=C Include files
-end
-item: Install File
-  Source=..\include\*.h
-  Destination=%MAINDIR%\include
-  Description=Header files
-  Flags=0000000000000010
-end
-item: Install File
-  Source=..\pc\pyconfig.h
-  Destination=%MAINDIR%\include\pyconfig.h
-  Description=Header files (pyconfig.h)
-  Flags=0000000000000010
-end
-item: Remark
-end
-item: Remark
-  Text=Microsoft C runtime libraries
-end
-item: Install File
-  Source=%_SYS_%\MSVCIRT.DLL
-  Destination=%DLLDEST%\MSVCIRT.DLL
-  Description=Visual C++ Runtime DLLs
-  Flags=0000011000010011
-end
-item: Install File
-  Source=%_SYS_%\MSVCRT.DLL
-  Destination=%DLLDEST%\MSVCRT.DLL
-  Description=Visual C++ Runtime DLLs
-  Flags=0000011000010011
-end
-item: End Block
-end
-item: Remark
-end
-item: Remark
-  Text=B: Tcl/Tk (Tkinter, IDLE, pydoc)
-end
-item: If/While Statement
-  Variable=COMPONENTS
-  Value=B
-  Flags=00000010
-end
-item: Remark
-  Text=Tcl/Tk
-end
-item: Install File
-  Source=..\..\%_tcldir_%\bin\*.dll
-  Destination=%MAINDIR%\DLLs
-  Description=Tcl/Tk binaries and libraries
-  Flags=0000000000000010
-end
-item: Install File
-  Source=..\..\%_tcldir_%\lib\*.*
-  Destination=%MAINDIR%\tcl
-  Description=Tcl/Tk binaries and libraries
-  Flags=0000000100000010
-end
-item: Remark
-end
-item: Remark
-  Text=IDLE
-end
-item: Install File
-  Source=..\Lib\idlelib\*.py
-  Destination=%MAINDIR%\Lib\idlelib
-  Description=Integrated DeveLopment Environment for Python
-  Flags=0000000000000010
-end
-item: Install File
-  Source=..\Lib\idlelib\*.txt
-  Destination=%MAINDIR%\Lib\idlelib
-  Description=Integrated DeveLopment Environment for Python
-  Flags=0000000000000010
-end
-item: Install File
-  Source=..\Lib\idlelib\*.def
-  Destination=%MAINDIR%\Lib\idlelib
-  Description=Integrated DeveLopment Environment for Python
-  Flags=0000000000000010
-end
-item: Install File
-  Source=..\Lib\idlelib\Icons\*
-  Destination=%MAINDIR%\Lib\idlelib\Icons
-  Description=Integrated DeveLopment Environment for Python
-  Flags=0000000000000010
-end
-item: Install File
-  Source=..\Tools\scripts\idle
-  Destination=%MAINDIR%\Lib\idlelib\idle.pyw
-  Description=IDLE bootstrap script
-  Flags=0000000000000010
-end
-item: Remark
-end
-item: Remark
-  Text=Windows pydoc driver
-end
-item: Install File
-  Source=..\tools\scripts\*.pyw
-  Destination=%MAINDIR%\Tools\Scripts
-  Description=Windows pydoc driver
-  Flags=0000000000000010
-end
-item: End Block
-end
-item: Remark
-end
-item: Remark
-  Text=C: docs
-end
-item: If/While Statement
-  Variable=COMPONENTS
-  Value=C
-  Flags=00000010
-end
-item: Install File
-  Source=%_DOC_%\*.*
-  Destination=%MAINDIR%\Doc
-  Description=Python Documentation (HTML)
-  Flags=0000000100000010
-end
-item: End Block
-end
-item: Remark
-end
-item: Remark
-  Text=D: tools
-end
-item: If/While Statement
-  Variable=COMPONENTS
-  Value=D
-  Flags=00000010
-end
-item: Install File
-  Source=..\tools\scripts\*.py
-  Destination=%MAINDIR%\Tools\Scripts
-  Description=Utility Scripts
-  Flags=0000000000000010
-end
-item: Install File
-  Source=..\tools\scripts\*.doc
-  Destination=%MAINDIR%\Tools\Scripts
-  Description=Utility Scripts
-  Flags=0000000000000010
-end
-item: Install File
-  Source=..\tools\scripts\readme
-  Destination=%MAINDIR%\Tools\Scripts\README.txt
-  Description=Utility Scripts
-  Flags=0000000000000010
-end
-item: Remark
-end
-item: Install File
-  Source=..\tools\webchecker\*.py
-  Destination=%MAINDIR%\Tools\webchecker
-  Description=Web checker tool
-  Flags=0000000000000010
-end
-item: Install File
-  Source=..\tools\webchecker\readme
-  Destination=%MAINDIR%\Tools\webchecker\README.txt
-  Description=Web checker tool
-  Flags=0000000000000010
-end
-item: Remark
-end
-item: Install File
-  Source=..\tools\versioncheck\*.py
-  Destination=%MAINDIR%\Tools\versioncheck
-  Description=Version checker tool
-  Flags=0000000000000010
-end
-item: Install File
-  Source=..\tools\versioncheck\readme
-  Destination=%MAINDIR%\Tools\versioncheck\README.txt
-  Description=Version checker tool
-  Flags=0000000000000010
-end
-item: Remark
-end
-item: Install File
-  Source=..\tools\pynche\*.py
-  Destination=%MAINDIR%\Tools\pynche
-  Description=pynche color editor
-  Flags=0000000000000010
-end
-item: Install File
-  Source=..\tools\pynche\*.txt
-  Destination=%MAINDIR%\Tools\pynche
-  Description=pynche color editor
-  Flags=0000000000000010
-end
-item: Install File
-  Source=..\tools\pynche\x\*.txt
-  Destination=%MAINDIR%\Tools\pynche\X
-  Description=pynche color editor - X files
-  Flags=0000000000000010
-end
-item: Install File
-  Source=..\tools\pynche\readme
-  Destination=%MAINDIR%\Tools\pynche\README.txt
-  Description=pynche color editor - README
-  Flags=0000000100000010
-end
-item: Install File
-  Source=..\tools\pynche\pynche
-  Destination=%MAINDIR%\Tools\pynche\pynche.py
-  Description=pynche color editor - main
-  Flags=0000000100000010
-end
-item: Install File
-  Source=..\tools\pynche\pynche.pyw
-  Destination=%MAINDIR%\Tools\pynche\pynche.pyw
-  Description=pynche color editor - noconsole main
-  Flags=0000000100000010
-end
-item: Remark
-end
-item: Install File
-  Source=..\tools\i18n\*.py
-  Destination=%MAINDIR%\Tools\i18n
-  Description=Internationalization helpers
-  Flags=0000000000000010
-end
-item: End Block
-end
-item: Remark
-end
-item: Remark
-  Text=E: test suite
-end
-item: If/While Statement
-  Variable=COMPONENTS
-  Value=E
-  Flags=00000010
-end
-item: Install File
-  Source=..\lib\test\audiotest.au
-  Destination=%MAINDIR%\Lib\test\audiotest.au
-  Description=Python Test files
-  Flags=0000000000000010
-end
-item: Install File
-  Source=..\lib\test\*.uue
-  Destination=%MAINDIR%\Lib\test
-  Description=Python Test files
-  Flags=0000000000000010
-end
-item: Install File
-  Source=..\lib\test\*.py
-  Destination=%MAINDIR%\Lib\test
-  Description=Python Test files
-  Flags=0000000000000010
-end
-item: Install File
-  Source=..\lib\test\*.xml
-  Destination=%MAINDIR%\Lib\test
-  Description=Python Test files
-  Flags=0000000000000010
-end
-item: Install File
-  Source=..\lib\test\*.out
-  Destination=%MAINDIR%\Lib\test
-  Description=Python Test files
-  Flags=0000000000000010
-end
-item: Install File
-  Source=..\lib\test\*.bz2
-  Destination=%MAINDIR%\Lib\test
-  Description=Python Test files
-  Flags=0000000000000010
-end
-item: Install File
-  Source=..\lib\test\*.tar
-  Destination=%MAINDIR%\Lib\test
-  Description=Python Test files
-  Flags=0000000000000010
-end
-item: Install File
-  Source=..\lib\test\*.gz
-  Destination=%MAINDIR%\Lib\test
-  Description=Python Test files
-  Flags=0000000000000010
-end
-item: Install File
-  Source=..\lib\test\*.txt
-  Destination=%MAINDIR%\Lib\test
-  Description=Python Test files
-  Flags=0000000000000010
-end
-item: Remark
-end
-item: Install File
-  Source=..\lib\test\output\*.*
-  Destination=%MAINDIR%\Lib\test\output
-  Description=Python Test output files
-  Flags=0000000000000010
-end
-item: End Block
-end
-item: Remark
-end
-item: Remark
-  Text=DONE with file copying.
-end
-item: Remark
-  Text=The rest is registry and Start Menu fiddling.
-end
-item: Remark
-end
-item: If/While Statement
-  Variable=COMPONENTS
-  Value=A
-  Flags=00000010
-end
-item: If/While Statement
-  Variable=TASKS
-  Value=A
-  Flags=00000010
-end
-item: Remark
-  Text=Register file extensions.  As usual, Admin privs get in the way, but with a twist:
-end
-item: Remark
-  Text=You don't need admin privs to write to HKEY_CLASSES_ROOT *except* under Win2K.
-end
-item: Remark
-  Text=On Win2K, a user without Admin privs has to register extensions under HKCU\Software\CLASSES instead.
-end
-item: Remark
-  Text=But while you can *do* that under other flavors of Windows too, it has no useful effect except in Win2K.
-end
-item: Set Variable
-  Variable=USE_HKCR
-  Value=1
-end
-item: Check Configuration
-  Flags=11110010
-end
-item: If/While Statement
-  Variable=DOADMIN
-  Value=0
-end
-item: Set Variable
-  Variable=USE_HKCR
-  Value=0
-end
-item: End Block
-end
-item: End Block
-end
-item: If/While Statement
-  Variable=USE_HKCR
-  Value=1
-end
-item: Remark
-  Text=File types.
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Python.File
-  New Value=Python File
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Python.File\shell\open\command
-  New Value=%MAINDIR%\python.exe "%%1" %%*
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Python.File\DefaultIcon
-  New Value=%MAINDIR%\Py.ico
-end
-item: Remark
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Python.NoConFile
-  New Value=Python File (no console)
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Python.NoConFile\shell\open\command
-  New Value=%MAINDIR%\pythonw.exe "%%1" %%*
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Python.NoConFile\DefaultIcon
-  New Value=%MAINDIR%\Py.ico
-end
-item: Remark
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Python.CompiledFile
-  New Value=Compiled Python File
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Python.CompiledFile\shell\open\command
-  New Value=%MAINDIR%\python.exe "%%1" %%*
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Python.CompiledFile\DefaultIcon
-  New Value=%MAINDIR%\pyc.ico
-end
-item: Remark
-end
-item: Remark
-  Text=File extensions.
-end
-item: Edit Registry
-  Total Keys=1
-  Key=.py
-  New Value=Python.File
-end
-item: Edit Registry
-  Total Keys=1
-  Key=.py
-  New Value=text/plain
-  Value Name=Content Type
-end
-item: Remark
-end
-item: Edit Registry
-  Total Keys=1
-  Key=.pyw
-  New Value=Python.NoConFile
-end
-item: Edit Registry
-  Total Keys=1
-  Key=.pyw
-  New Value=text/plain
-  Value Name=Content Type
-end
-item: Remark
-end
-item: Edit Registry
-  Total Keys=1
-  Key=.pyc
-  New Value=Python.CompiledFile
-end
-item: Edit Registry
-  Total Keys=1
-  Key=.pyo
-  New Value=Python.CompiledFile
-end
-item: Else Statement
-end
-item: Remark
-  Text=File types.
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\CLASSES\Python.File
-  New Value=Python File
-  Root=1
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\CLASSES\Python.File\shell\open\command
-  New Value=%MAINDIR%\python.exe "%%1" %%*
-  Root=1
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\CLASSES\Python.File\DefaultIcon
-  New Value=%MAINDIR%\Py.ico
-  Root=1
-end
-item: Remark
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\CLASSES\Python.NoConFile
-  New Value=Python File (no console)
-  Root=1
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\CLASSES\Python.NoConFile\shell\open\command
-  New Value=%MAINDIR%\pythonw.exe "%%1" %%*
-  Root=1
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\CLASSES\Python.NoConFile\DefaultIcon
-  New Value=%MAINDIR%\Py.ico
-  Root=1
-end
-item: Remark
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\CLASSES\Python.CompiledFile
-  New Value=Compiled Python File
-  Root=1
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\CLASSES\Python.CompiledFile\shell\open\command
-  New Value=%MAINDIR%\python.exe "%%1" %%*
-  Root=1
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\CLASSES\Python.CompiledFile\DefaultIcon
-  New Value=%MAINDIR%\pyc.ico
-  Root=1
-end
-item: Remark
-end
-item: Remark
-  Text=File extensions.
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\CLASSES\.py
-  New Value=Python.File
-  Root=1
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\CLASSES\.py
-  New Value=text/plain
-  Value Name=Content Type
-  Root=1
-end
-item: Remark
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\CLASSES\.pyw
-  New Value=Python.NoConFile
-  Root=1
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\CLASSES\.pyw
-  New Value=text/plain
-  Value Name=Content Type
-  Root=1
-end
-item: Remark
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\CLASSES\.pyc
-  New Value=Python.CompiledFile
-  Root=1
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\CLASSES\.pyo
-  New Value=Python.CompiledFile
-  Root=1
-end
-item: End Block
-end
-item: Remark
-end
-item: Remark
-  Text=If we're installing IDLE, also set an Edit context menu action to use IDLE, for .py and .pyw files.
-end
-item: If/While Statement
-  Variable=COMPONENTS
-  Value=B
-  Flags=00000010
-end
-item: If/While Statement
-  Variable=USE_HKCR
-  Value=1
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Python.NoConFile\shell\Edit with IDLE\command
-  New Value=%MAINDIR%\pythonw.exe %MAINDIR%\Lib\idlelib\idle.pyw -n -e "%%1"
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Python.File\shell\Edit with IDLE\command
-  New Value=%MAINDIR%\pythonw.exe %MAINDIR%\Lib\idlelib\idle.pyw -n -e "%%1"
-end
-item: Else Statement
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\CLASSES\Python.NoConFile\shell\Edit with IDLE\command
-  New Value=%MAINDIR%\pythonw.exe %MAINDIR%\Lib\idlelib\idle.pyw -n -e "%%1"
-  Root=1
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\CLASSES\Python.File\shell\Edit with IDLE\command
-  New Value=%MAINDIR%\pythonw.exe %MAINDIR%\Lib\idlelib\idle.pyw -n -e "%%1"
-  Root=1
-end
-item: End Block
-end
-item: End Block
-end
-item: End Block
-end
-item: Remark
-end
-item: Remark
-  Text=Register Python paths.
-end
-item: Remark
-  Text=Write to HKLM for admin, else HKCU.  Keep these blocks otherwise identical!
-end
-item: If/While Statement
-  Variable=DOADMIN
-  Value=1
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\Python\PythonCore\CurrentVersion
-  Root=130
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\Python\PythonCore\%PY_VERSION%\InstallPath
-  New Value=%MAINDIR%
-  Root=2
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\Python\PythonCore\%PY_VERSION%\InstallPath\InstallGroup
-  New Value=%CGROUP_SAVE%
-  New Value=
-  Root=2
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\Python\PythonCore\%PY_VERSION%\PythonPath
-  New Value=%MAINDIR%\Lib;%MAINDIR%\DLLs
-  New Value=
-  Root=2
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\Python\PythonCore\%PY_VERSION%\Modules
-  Root=2
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\Microsoft\Windows\CurrentVersion\App Paths\Python.exe
-  New Value=%MAINDIR%\Python.exe
-  Root=2
-end
-item: Else Statement
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\Python\PythonCore\CurrentVersion
-  Root=129
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\Python\PythonCore\%PY_VERSION%\InstallPath
-  New Value=%MAINDIR%
-  Root=1
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\Python\PythonCore\%PY_VERSION%\InstallPath\InstallGroup
-  New Value=%CGROUP_SAVE%
-  New Value=
-  Root=1
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\Python\PythonCore\%PY_VERSION%\PythonPath
-  New Value=%MAINDIR%\Lib;%MAINDIR%\DLLs
-  New Value=
-  Root=1
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\Python\PythonCore\%PY_VERSION%\Modules
-  Root=1
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\Microsoft\Windows\CurrentVersion\App Paths\Python.exe
-  New Value=%MAINDIR%\Python.exe
-  Root=1
-end
-item: End Block
-end
-item: End Block
-end
-item: Remark
-end
-item: Remark
-  Text=Registry fiddling for docs.
-end
-item: Remark
-  Text=Write to HKLM for admin, else HKCU.  Keep these blocks otherwise identical!
-end
-item: If/While Statement
-  Variable=COMPONENTS
-  Value=C
-  Flags=00000010
-end
-item: If/While Statement
-  Variable=DOADMIN
-  Value=1
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\Python\PythonCore\%PY_VERSION%\Help\Main Python Documentation
-  New Value=%MAINDIR%\Doc\index.html
-  Root=2
-end
-item: Else Statement
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\Python\PythonCore\%PY_VERSION%\Help\Main Python Documentation
-  New Value=%MAINDIR%\Doc\index.html
-  Root=1
-end
-item: End Block
-end
-item: End Block
-end
-item: Remark
-end
-item: Remark
-  Text=Set the app publisher and URL entries for Win2K add/remove.
-end
-item: Remark
-  Text=It doesn't hurt on other systems.
-end
-item: Remark
-  Text=As usual, write to HKLM or HKCU depending on Admin privs.
-end
-item: Remark
-  Text=CAUTION:  If you set this info on the "Windows 2000" page (step 6) of the
-end
-item: Remark
-  Text=Installation Expert, it only shows up in the "If" block below.  Keep in synch!
-end
-item: If/While Statement
-  Variable=DOADMIN
-  Value=1
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\%APPTITLE%
-  New Value=http://www.python.org/
-  Value Name=HelpLink
-  Root=2
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\%APPTITLE%
-  New Value=PythonLabs at Zope Corporation
-  Value Name=Publisher
-  Root=2
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\%APPTITLE%
-  New Value=http://www.python.org/
-  Value Name=URLInfoAbout
-  Root=2
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\%APPTITLE%
-  New Value=%PYVER_STRING%
-  Value Name=DisplayVersion
-  Root=2
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\%APPTITLE%
-  New Value=%MAINDIR%\py.ico,-0
-  Value Name=DisplayIcon
-  Root=2
-end
-item: Else Statement
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\%APPTITLE%
-  New Value=http://www.python.org/
-  Value Name=HelpLink
-  Root=1
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\%APPTITLE%
-  New Value=PythonLabs at Zope Corporation
-  Value Name=Publisher
-  Root=1
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\%APPTITLE%
-  New Value=http://www.python.org/
-  Value Name=URLInfoAbout
-  Root=1
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\%APPTITLE%
-  New Value=%PYVER_STRING%
-  Value Name=DisplayVersion
-  Root=1
-end
-item: Edit Registry
-  Total Keys=1
-  Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\%APPTITLE%
-  New Value=%MAINDIR%\py.ico,-0
-  Value Name=DisplayIcon
-  Root=1
-end
-item: End Block
-end
-item: Remark
-end
-item: Remark
-  Text=Populate Start Menu group
-end
-item: If/While Statement
-  Variable=TASKS
-  Value=B
-  Flags=00000010
-end
-item: Remark
-  Text=Shortcut to installer no matter what.
-end
-item: Create Shortcut
-  Source=%MAINDIR%\unwise.exe
-  Destination=%GROUP%\Uninstall Python.lnk
-  Working Directory=%MAINDIR%
-  Key Type=1536
-  Flags=00000001
-end
-item: Remark
-end
-item: If/While Statement
-  Variable=COMPONENTS
-  Value=A
-  Flags=00000010
-end
-item: Create Shortcut
-  Source=%MAINDIR%\python.exe
-  Destination=%GROUP%\Python (command line).lnk
-  Working Directory=%MAINDIR%
-  Icon Pathname=%MAINDIR%\pycon.ico
-  Key Type=1536
-  Flags=00000001
-end
-item: End Block
-end
-item: Remark
-end
-item: If/While Statement
-  Variable=COMPONENTS
-  Value=B
-  Flags=00000010
-end
-item: Create Shortcut
-  Source=%MAINDIR%\pythonw.exe
-  Destination=%GROUP%\IDLE (Python GUI).lnk
-  Command Options="%MAINDIR%\Lib\idlelib\idle.pyw"
-  Working Directory=%MAINDIR%
-  Key Type=1536
-  Flags=00000001
-end
-item: Create Shortcut
-  Source=%MAINDIR%\pythonw.exe
-  Destination=%GROUP%\Module Docs.lnk
-  Command Options="%MAINDIR%\Tools\Scripts\pydocgui.pyw"
-  Working Directory=%MAINDIR%
-  Key Type=1536
-  Flags=00000001
-end
-item: End Block
-end
-item: Remark
-end
-item: If/While Statement
-  Variable=COMPONENTS
-  Value=C
-  Flags=00000010
-end
-item: Create Shortcut
-  Source=%MAINDIR%\Doc\index.html
-  Destination=%GROUP%\Python Manuals.lnk
-  Working Directory=%MAINDIR%
-  Key Type=1536
-  Flags=00000001
-end
-item: End Block
-end
-item: End Block
-end
-item: Remark
-end
-item: Remark
-  Text=I don't think we need this, but have always done it.
-end
-item: Self-Register OCXs/DLLs
-  Description=Updating System Configuration, Please Wait...
-end
-item: Remark
-end
-remarked item: Remark
-  Text=Don't enable "Delete in-use files".  Here's what happens:
-end
-remarked item: Remark
-  Text=Install Python; uninstall Python; install Python again.  Reboot the machine.
-end
-remarked item: Remark
-  Text=Now UNWISE.EXE is missing.  I think this is a Wise bug, but so it goes.
-end
-remarked item: Add Text to INSTALL.LOG
-  Text=Delete in-use files: On
-end
-item: Remark
-end
-item: Wizard Block
-  Direction Variable=DIRECTION
-  Display Variable=DISPLAY
-  Bitmap Pathname=.\installer.bmp
-  X Position=9
-  Y Position=10
-  Filler Color=11173759
-  Flags=00000011
-end
-item: Custom Dialog Set
-  Name=Finished
-  Display Variable=DISPLAY
-  item: Dialog
-    Title=%APPTITLE% Installation
-    Title French=Installation de %APPTITLE%
-    Title German=Installation von %APPTITLE%
-    Title Spanish=Instalación de %APPTITLE%
-    Title Italian=Installazione di %APPTITLE%
-    Width=339
-    Height=280
-    Font Name=Helv
-    Font Size=8
-    item: Push Button
-      Rectangle=188 234 244 253
-      Variable=DIRECTION
-      Value=N
-      Create Flags=01010000000000010000000000000001
-      Text=&Finish
-      Text French=&Fin
-      Text German=&Weiter
-      Text Spanish=&Terminar
-      Text Italian=&Fine
-    end
-    item: Push Button
-      Rectangle=264 234 320 253
-      Variable=DISABLED
-      Value=!
-      Action=3
-      Create Flags=01010000000000010000000000000000
-      Text=&Cancel
-      Text French=&Annuler
-      Text German=&Abbrechen
-      Text Spanish=&Cancelar
-      Text Italian=&Annulla
-    end
-    item: Static
-      Rectangle=108 10 323 48
-      Create Flags=01010000000000000000000000000000
-      Flags=0000000000000001
-      Name=Times New Roman
-      Font Style=-24 0 0 0 700 255 0 0 0 3 2 1 18
-      Text=Installation Completed!
-      Text French=Installation terminée !
-      Text German=Die Installation ist abgeschlossen!
-      Text Spanish=¡Instalación terminada!
-      Text Italian=Installazione completata!
-    end
-    item: Static
-      Rectangle=108 44 320 82
-      Create Flags=01010000000000000000000000000000
-      Text=%APPTITLE% has been successfully installed.
-      Text=
-      Text=Press the Finish button to exit this installation.
-      Text French=%APPTITLE% est maintenant installé.
-      Text French=
-      Text French=Cliquez sur le bouton Fin pour quitter l'installation.
-      Text German=%APPTITLE% wurde erfolgreich installiert.
-      Text German=
-      Text German=Klicken Sie auf "Weiter", um die Installation zu beenden.
-      Text Spanish=%APPTITLE% se ha instalado con éxito.
-      Text Spanish=
-      Text Spanish=Presione el botón Terminar para salir de esta instalación.
-      Text Italian=L'installazione %APPTITLE% è stata portata a termine con successo.
-      Text Italian=
-      Text Italian=Premere il pulsante Fine per uscire dall'installazione.
-    end
-    item: Static
-      Rectangle=10 225 320 226
-      Action=3
-      Create Flags=01010000000000000000000000000111
-    end
-    item: Static
-      Rectangle=106 105 312 210
-      Enabled Color=00000000000000001111111111111111
-      Create Flags=01010000000000000000000000000000
-      Text=Special Windows thanks to:
-      Text=
-      Text=Wise Solutions, for the use of InstallMaster 8.1.
-      Text=    http://www.wisesolutions.com/
-      Text=
-      Text=
-      Text=LettError, Erik van Blokland, for the Python for Windows graphic.
-      Text=    http://www.letterror.com/
-      Text=
-      Text=
-      Text=Mark Hammond, without whose years of freely shared Windows expertise, Python for Windows would still be Python for DOS.
-    end
-    item: Static
-      Rectangle=106 95 312 96
-      Action=3
-      Enabled Color=00000000000000001111111111111111
-      Create Flags=01010000000000000000000000001001
-    end
-  end
-end
-item: End Block
-end
-item: New Event
-  Name=Cancel
-end
-item: Remark
-  Text=This include script supports a rollback to preinstallation state if the user chooses to cancel before the installation is complete.
-end
-item: Include Script
-  Pathname=%_WISE_%\INCLUDE\rollback.wse
-end
diff --git a/PC/VS7.1/pythoncore.vcproj b/PC/VS7.1/pythoncore.vcproj
deleted file mode 100644
index 05c4184..0000000
--- a/PC/VS7.1/pythoncore.vcproj
+++ /dev/null
@@ -1,826 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="7.10"

-	Name="pythoncore"

-	ProjectGUID="{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA30}"

-	RootNamespace="pythoncore"

-	SccProjectName="pythoncore"

-	SccLocalPath="..">

-	<Platforms>

-		<Platform

-			Name="Win32"/>

-	</Platforms>

-	<Configurations>

-		<Configuration

-			Name="Release|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\x86-temp-release\pythoncore"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE">

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalOptions="/Zm200 "

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;NDEBUG;WIN32;_WINDOWS;USE_DL_EXPORT"

-				StringPooling="TRUE"

-				RuntimeLibrary="2"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="getbuildinfo.o"

-				OutputFile="./python33.dll"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				IgnoreDefaultLibraryNames="libc"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./python33.pdb"

-				SubSystem="2"

-				BaseAddress="0x1e000000"

-				ImportLibrary=".\./python33.lib"

-				TargetMachine="1"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"

-				Description="generate buildinfo"

-				CommandLine="make_buildinfo.exe $(ConfigurationName)"/>

-			<Tool

-				Name="VCResourceCompilerTool"

-				PreprocessorDefinitions="NDEBUG"

-				Culture="1033"

-				AdditionalIncludeDirectories="..\..\Include"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="Debug|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\x86-temp-debug\pythoncore"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE">

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalOptions="/Zm200 "

-				Optimization="0"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;_DEBUG;USE_DL_EXPORT;WIN32;_WINDOWS"

-				RuntimeLibrary="3"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="getbuildinfo.o"

-				OutputFile="./python33_d.dll"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				IgnoreDefaultLibraryNames="libc"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./python33_d.pdb"

-				SubSystem="2"

-				BaseAddress="0x1e000000"

-				ImportLibrary=".\./python33_d.lib"

-				TargetMachine="1"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"

-				Description="generate buildinfo"

-				CommandLine="make_buildinfo.exe $(ConfigurationName)"/>

-			<Tool

-				Name="VCResourceCompilerTool"

-				PreprocessorDefinitions="_DEBUG"

-				Culture="1033"

-				AdditionalIncludeDirectories="..\..\Include"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="ReleaseItanium|Win32"

-			OutputDirectory="./."

-			IntermediateDirectory=".\ia64-temp-release\pythoncore"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE">

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalOptions=" /USECL:MS_ITANIUM /GS-"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;NDEBUG;WIN32;_WINDOWS;USE_DL_EXPORT"

-				StringPooling="TRUE"

-				BasicRuntimeChecks="0"

-				RuntimeLibrary="2"

-				BufferSecurityCheck="FALSE"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				Detect64BitPortabilityProblems="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalOptions=" /MACHINE:IA64 /USELINK:MS_SDK"

-				AdditionalDependencies="getbuildinfo.o"

-				OutputFile="./python33.dll"

-				LinkIncremental="1"

-				SuppressStartupBanner="FALSE"

-				IgnoreDefaultLibraryNames="libc"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./python33.pdb"

-				SubSystem="2"

-				BaseAddress="0x1e000000"

-				ImportLibrary=".\./python33.lib"

-				TargetMachine="0"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"

-				Description="generate buildinfo"

-				CommandLine="make_buildinfo.exe $(ConfigurationName)"/>

-			<Tool

-				Name="VCResourceCompilerTool"

-				PreprocessorDefinitions="NDEBUG"

-				Culture="1033"

-				AdditionalIncludeDirectories="..\..\Include"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="ReleaseAMD64|Win32"

-			OutputDirectory="./."

-			IntermediateDirectory=".\amd64-temp-release\pythoncore"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE">

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalOptions="/Zm200  /USECL:MS_OPTERON /GS-"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;NDEBUG;WIN32;_WINDOWS;USE_DL_EXPORT"

-				StringPooling="TRUE"

-				BasicRuntimeChecks="0"

-				RuntimeLibrary="2"

-				BufferSecurityCheck="FALSE"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				Detect64BitPortabilityProblems="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalOptions=" /MACHINE:AMD64 /USELINK:MS_SDK"

-				AdditionalDependencies="getbuildinfo.o"

-				OutputFile="./python33.dll"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				IgnoreDefaultLibraryNames="libc"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./python33.pdb"

-				SubSystem="2"

-				BaseAddress="0x1e000000"

-				ImportLibrary=".\./python33.lib"

-				TargetMachine="0"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"

-				Description="generate buildinfo"

-				CommandLine="make_buildinfo.exe $(ConfigurationName)"/>

-			<Tool

-				Name="VCResourceCompilerTool"

-				PreprocessorDefinitions="NDEBUG"

-				Culture="1033"

-				AdditionalIncludeDirectories="..\..\Include"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<Filter

-			Name="_io"

-            Filter="">

-			<File

-				RelativePath="..\..\Modules\_io\fileio.c">

-			</File>

-			<File

-				RelativePath="..\..\Modules\_io\bytesio.c">

-			</File>

-			<File

-				RelativePath="..\..\Modules\_io\stringio.c">

-			</File>

-			<File

-			    RelativePath="..\..\Modules\_io\bufferedio.c">

-			</File>

-			<File

-				RelativePath="..\..\Modules\_io\iobase.c">

-			</File>

-			<File

-				RelativePath="..\..\Modules\_io\textio.c">

-			</File>

-			<File

-				RelativePath="..\..\Modules\_io\_iomodule.c">

-			</File>

-		</Filter>

-

-		<Filter

-			Name="zlib"

-			Filter="">

-			<File

-				RelativePath="..\..\Modules\zlib\adler32.c">

-			</File>

-			<File

-				RelativePath="..\..\Modules\zlib\compress.c">

-			</File>

-			<File

-				RelativePath="..\..\Modules\zlib\crc32.c">

-			</File>

-			<File

-				RelativePath="..\..\Modules\zlib\deflate.c">

-			</File>

-			<File

-				RelativePath="..\..\Modules\zlib\gzio.c">

-			</File>

-			<File

-				RelativePath="..\..\Modules\zlib\infback.c">

-			</File>

-			<File

-				RelativePath="..\..\Modules\zlib\inffast.c">

-			</File>

-			<File

-				RelativePath="..\..\Modules\zlib\inflate.c">

-			</File>

-			<File

-				RelativePath="..\..\Modules\zlib\inftrees.c">

-			</File>

-			<File

-				RelativePath="..\..\Modules\zlib\trees.c">

-			</File>

-			<File

-				RelativePath="..\..\Modules\zlib\uncompr.c">

-			</File>

-			<File

-				RelativePath="..\..\Modules\zlibmodule.c">

-				<FileConfiguration

-					Name="Release|Win32">

-					<Tool

-						Name="VCCLCompilerTool"

-						AdditionalIncludeDirectories="..\..\Modules\zlib"/>

-				</FileConfiguration>

-				<FileConfiguration

-					Name="Debug|Win32">

-					<Tool

-						Name="VCCLCompilerTool"

-						AdditionalIncludeDirectories="..\..\Modules\zlib"/>

-				</FileConfiguration>

-				<FileConfiguration

-					Name="ReleaseItanium|Win32">

-					<Tool

-						Name="VCCLCompilerTool"

-						AdditionalIncludeDirectories="..\..\Modules\zlib"/>

-				</FileConfiguration>

-				<FileConfiguration

-					Name="ReleaseAMD64|Win32">

-					<Tool

-						Name="VCCLCompilerTool"

-						AdditionalIncludeDirectories="..\..\Modules\zlib"/>

-				</FileConfiguration>

-			</File>

-			<File

-				RelativePath="..\..\Modules\zlib\zutil.c">

-			</File>

-		</Filter>

-		<File

-			RelativePath="..\..\Modules\_bisectmodule.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\cjkcodecs\_codecs_cn.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\cjkcodecs\_codecs_hk.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\cjkcodecs\_codecs_iso2022.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\cjkcodecs\_codecs_jp.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\cjkcodecs\_codecs_kr.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\cjkcodecs\_codecs_tw.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\_codecsmodule.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\_collectionsmodule.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\_csv.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\_datetimemodule.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\_functoolsmodule.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\_heapqmodule.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\_json.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\_localemodule.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\_lsprof.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\_math.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\_pickle.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\_randommodule.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\_sre.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\_struct.c">

-		</File>

-		<File

-			RelativePath="..\..\Pc\_subprocess.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\_time.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\_warnings.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\_weakref.c">

-		</File>

-		<File

-			RelativePath="..\..\Objects\abstract.c">

-		</File>

-		<File

-			RelativePath="..\..\Objects\accu.c">

-		</File>

-		<File

-			RelativePath="..\..\Parser\acceler.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\arraymodule.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\asdl.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\ast.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\atexitmodule.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\audioop.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\binascii.c">

-		</File>

-		<File

-			RelativePath="..\..\Parser\bitset.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\bltinmodule.c">

-		</File>

-		<File

-			RelativePath="..\..\Objects\boolobject.c">

-		</File>

-		<File

-			RelativePath="..\..\Objects\bytes_methods.c">

-		</File>

-		<File

-			RelativePath="..\..\Objects\bytearrayobject.c">

-		</File>

-		<File

-			RelativePath="..\..\Objects\bytesobject.c">

-		</File>

-		<File

-			RelativePath="..\..\Objects\capsule.c">

-		</File>

-		<File

-			RelativePath="..\..\Objects\cellobject.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\ceval.c">

-		</File>

-		<File

-			RelativePath="..\..\Objects\classobject.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\cmathmodule.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\codecs.c">

-		</File>

-		<File

-			RelativePath="..\..\Objects\codeobject.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\compile.c">

-		</File>

-		<File

-			RelativePath="..\..\Objects\complexobject.c">

-		</File>

-		<File

-			RelativePath="..\..\PC\config.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\dynamic_annotations.c">

-		</File>

-		<File

-			RelativePath="..\..\Objects\descrobject.c">

-		</File>

-		<File

-			RelativePath="..\..\Objects\dictobject.c">

-		</File>

-		<File

-			RelativePath="..\..\PC\dl_nt.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\dtoa.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\dynload_win.c">

-		</File>

-		<File

-			RelativePath="..\..\Objects\enumobject.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\errnomodule.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\errors.c">

-		</File>

-		<File

-			RelativePath="..\..\Objects\exceptions.c">

-		</File>

-		<File

-			RelativePath="..\..\Objects\fileobject.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\fileutils.c">

-		</File>

-		<File

-			RelativePath="..\..\Parser\firstsets.c">

-		</File>

-		<File

-			RelativePath="..\..\Objects\floatobject.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\formatter_unicode.c">

-		</File>

-		<File

-			RelativePath="..\..\Objects\frameobject.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\formatter_unicode.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\frozen.c">

-		</File>

-		<File

-			RelativePath="..\..\Objects\funcobject.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\future.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\gcmodule.c">

-		</File>

-		<File

-			RelativePath="..\..\Objects\genobject.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\getargs.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\getcompiler.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\getcopyright.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\getopt.c">

-		</File>

-		<File

-			RelativePath="..\..\PC\getpathp.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\getplatform.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\getversion.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\graminit.c">

-		</File>

-		<File

-			RelativePath="..\..\Parser\grammar.c">

-		</File>

-		<File

-			RelativePath="..\..\Parser\grammar1.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\import.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\importdl.c">

-		</File>

-		<File

-			RelativePath="..\..\Objects\iterobject.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\itertoolsmodule.c">

-		</File>

-		<File

-			RelativePath="..\..\Parser\listnode.c">

-		</File>

-		<File

-			RelativePath="..\..\Objects\listobject.c">

-		</File>

-		<File

-			RelativePath="..\..\Objects\longobject.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\main.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\marshal.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\mathmodule.c">

-		</File>

- 		<File

-			RelativePath="..\..\Modules\md5module.c">

-		</File>

-		<File

-			RelativePath="..\..\Parser\metagrammar.c">

-		</File>

-		<File

-			RelativePath="..\..\Objects\memoryobject.c">

-		</File>

-		<File

-			RelativePath="..\..\Objects\methodobject.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\mmapmodule.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\modsupport.c">

-		</File>

-		<File

-			RelativePath="..\..\Objects\moduleobject.c">

-		</File>

-		<File

-			RelativePath="..\..\PC\msvcrtmodule.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\cjkcodecs\multibytecodec.c">

-		</File>

-		<File

-			RelativePath="..\..\Parser\myreadline.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\mysnprintf.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\mystrtoul.c">

-		</File>

-		<File

-			RelativePath="..\..\Parser\node.c">

-		</File>

-		<File

-			RelativePath="..\..\Objects\object.c">

-		</File>

-		<File

-			RelativePath="..\..\Objects\obmalloc.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\operator.c">

-		</File>

-		<File

-			RelativePath="..\..\Parser\parser.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\parsermodule.c">

-		</File>

-		<File

-			RelativePath="..\..\Parser\parsetok.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\peephole.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\posixmodule.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\pyarena.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\pyctype.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\pyfpe.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\pymath.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\pystate.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\pystrcmp.c"

-			>

-		</File>

-		<File

-			RelativePath="..\..\Python\pystrtod.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\pytime.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\Python-ast.c">

-		</File>

-		<File

-			RelativePath="..\..\PC\python_nt.rc">

-		</File>

-		<File

-			RelativePath="..\..\Python\pythonrun.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\random.c">

-		</File>

-		<File

-			RelativePath="..\..\Objects\rangeobject.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\rotatingtree.c">

-		</File>

-		<File

-			RelativePath="..\..\Objects\setobject.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\sha256module.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\sha512module.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\sha1module.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\signalmodule.c">

-		</File>

-		<File

-			RelativePath="..\..\Objects\sliceobject.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\structmember.c">

-		</File>

-		<File

-			RelativePath="..\..\Objects\structseq.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\symtable.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\symtablemodule.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\sysmodule.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\thread.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\_threadmodule.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\timemodule.c">

-		</File>

-		<File

-			RelativePath="..\..\Parser\tokenizer.c">

-		</File>

-		<File

-			RelativePath="..\..\Python\traceback.c">

-		</File>

-		<File

-			RelativePath="..\..\Objects\tupleobject.c">

-		</File>

-		<File

-			RelativePath="..\..\Objects\typeobject.c">

-		</File>

-		<File

-			RelativePath="..\..\Objects\unicodectype.c">

-		</File>

-		<File

-			RelativePath="..\..\Objects\unicodeobject.c">

-		</File>

-		<File

-			RelativePath="..\..\Pc\winreg.c">

-		</File>

-		<File

-			RelativePath="..\..\Objects\weakrefobject.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\xxsubtype.c">

-		</File>

-		<File

-			RelativePath="..\..\Modules\zipimport.c">

-		</File>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS7.1/pythonw.vcproj b/PC/VS7.1/pythonw.vcproj
deleted file mode 100644
index 47d7f50..0000000
--- a/PC/VS7.1/pythonw.vcproj
+++ /dev/null
@@ -1,261 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="7.10"

-	Name="pythonw"

-	SccProjectName="pythonw"

-	SccLocalPath="..\..\pc">

-	<Platforms>

-		<Platform

-			Name="Win32"/>

-	</Platforms>

-	<Configurations>

-		<Configuration

-			Name="Debug|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\x86-temp-debug\pythonw"

-			ConfigurationType="1"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE">

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="0"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC"

-				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"

-				RuntimeLibrary="3"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				OutputFile="./pythonw_d.exe"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./pythonw_d.pdb"

-				SubSystem="2"

-				StackReserveSize="2000000"

-				BaseAddress="0x1d000000"

-				TargetMachine="1"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"

-				PreprocessorDefinitions="_DEBUG"

-				Culture="1033"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="Release|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\x86-temp-release\pythonw"

-			ConfigurationType="1"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE">

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC"

-				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"

-				StringPooling="TRUE"

-				RuntimeLibrary="2"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				OutputFile=".\./pythonw.exe"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./pythonw.pdb"

-				SubSystem="2"

-				StackReserveSize="2000000"

-				BaseAddress="0x1d000000"

-				TargetMachine="1"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"

-				PreprocessorDefinitions="NDEBUG"

-				Culture="1033"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="ReleaseItanium|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\ia64-temp-release\pythonw"

-			ConfigurationType="1"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE">

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalOptions=" /USECL:MS_ITANIUM /GS-"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC"

-				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"

-				StringPooling="TRUE"

-				BasicRuntimeChecks="0"

-				RuntimeLibrary="2"

-				BufferSecurityCheck="FALSE"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				Detect64BitPortabilityProblems="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalOptions=" /MACHINE:IA64 /USELINK:MS_SDK"

-				OutputFile=".\./pythonw.exe"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./pythonw.pdb"

-				SubSystem="2"

-				StackReserveSize="2000000"

-				BaseAddress="0x1d000000"

-				TargetMachine="0"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"

-				PreprocessorDefinitions="NDEBUG"

-				Culture="1033"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="ReleaseAMD64|Win32"

-			OutputDirectory="."

-			IntermediateDirectory="amd64-temp-release\pythonw"

-			ConfigurationType="1"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE">

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalOptions=" /USECL:MS_OPTERON"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC"

-				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"

-				StringPooling="TRUE"

-				BasicRuntimeChecks="0"

-				RuntimeLibrary="2"

-				BufferSecurityCheck="FALSE"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				Detect64BitPortabilityProblems="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalOptions=" /MACHINE:AMD64 /USELINK:MS_SDK"

-				OutputFile=".\./pythonw.exe"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./pythonw.pdb"

-				SubSystem="2"

-				StackReserveSize="2000000"

-				BaseAddress="0x1d000000"

-				TargetMachine="0"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"

-				PreprocessorDefinitions="NDEBUG"

-				Culture="1033"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<File

-			RelativePath="..\..\PC\python_exe.rc">

-		</File>

-		<File

-			RelativePath="..\..\PC\WinMain.c">

-		</File>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS7.1/readme.txt b/PC/VS7.1/readme.txt
deleted file mode 100644
index bfd8a70..0000000
--- a/PC/VS7.1/readme.txt
+++ /dev/null
@@ -1,337 +0,0 @@
-Building Python using VC++ 7.1
--------------------------------------
-This directory is used to build Python for Win32 platforms, e.g. Windows
-95, 98 and NT.  It requires Microsoft Visual C++ 7.1
-(a.k.a. Visual Studio .NET 2003).
-(For other Windows platforms and compilers, see ../PC/readme.txt.)
-
-All you need to do is open the workspace "pcbuild.sln" in MSVC++, select
-the Debug or Release setting (using "Solution Configuration" from
-the "Standard" toolbar"), and build the projects.
-
-The proper order to build subprojects:
-
-1) pythoncore (this builds the main Python DLL and library files,
-               python33.{dll, lib} in Release mode)
-              NOTE:  in previous releases, this subproject was
-              named after the release number, e.g. python20.
-
-2) python (this builds the main Python executable,
-           python.exe in Release mode)
-
-3) the other subprojects, as desired or needed (note:  you probably don't
-   want to build most of the other subprojects, unless you're building an
-   entire Python distribution from scratch, or specifically making changes
-   to the subsystems they implement, or are running a Python core buildbot
-   test slave; see SUBPROJECTS below)
-
-When using the Debug setting, the output files have a _d added to
-their name:  python33_d.dll, python_d.exe, parser_d.pyd, and so on.
-
-SUBPROJECTS
------------
-These subprojects should build out of the box.  Subprojects other than the
-main ones (pythoncore, python, pythonw) generally build a DLL (renamed to
-.pyd) from a specific module so that users don't have to load the code
-supporting that module unless they import the module.
-
-pythoncore
-    .dll and .lib
-python
-    .exe
-pythonw
-    pythonw.exe, a variant of python.exe that doesn't pop up a DOS box
-_socket
-    socketmodule.c
-_testcapi
-    tests of the Python C API, run via Lib/test/test_capi.py, and
-    implemented by module Modules/_testcapimodule.c
-pyexpat
-    Python wrapper for accelerated XML parsing, which incorporates stable
-    code from the Expat project:  http://sourceforge.net/projects/expat/
-select
-    selectmodule.c
-unicodedata
-    large tables of Unicode data
-winsound
-    play sounds (typically .wav files) under Windows
-
-The following subprojects will generally NOT build out of the box.  They
-wrap code Python doesn't control, and you'll need to download the base
-packages first and unpack them into siblings of PC's parent
-directory; for example, if this directory is ....\dist\trunk\PC\VS7.1,
-unpack into new subdirectories of dist\.
-
-_tkinter
-    Python wrapper for the Tk windowing system.  Requires building
-    Tcl/Tk first.  Following are instructions for Tcl/Tk 8.4.12.
-
-    Get source
-    ----------
-    In the dist directory, run
-    svn export http://svn.python.org/projects/external/tcl8.4.12
-    svn export http://svn.python.org/projects/external/tk8.4.12
-    svn export http://svn.python.org/projects/external/tix-8.4.0
-
-    Build Tcl first (done here w/ MSVC 7.1 on Windows XP)
-    ---------------
-    Use "Start -> All Programs -> Microsoft Visual Studio .NET 2003
-         -> Visual Studio .NET Tools -> Visual Studio .NET 2003 Command Prompt"
-    to get a shell window with the correct environment settings
-    cd dist\tcl8.4.12\win
-    nmake -f makefile.vc
-    nmake -f makefile.vc INSTALLDIR=..\..\tcltk install
-
-    XXX Should we compile with OPTS=threads?
-
-    Optional:  run tests, via
-        nmake -f makefile.vc test
-
-        On WinXP Pro, wholly up to date as of 30-Aug-2004:
-        all.tcl:        Total   10678   Passed  9969    Skipped 709     Failed  0
-        Sourced 129 Test Files.
-
-    Build Tk
-    --------
-    cd dist\tk8.4.12\win
-    nmake -f makefile.vc TCLDIR=..\..\tcl8.4.12
-    nmake -f makefile.vc TCLDIR=..\..\tcl8.4.12 INSTALLDIR=..\..\tcltk install
-
-    XXX Should we compile with OPTS=threads?
-
-    XXX Our installer copies a lot of stuff out of the Tcl/Tk install
-    XXX directory.  Is all of that really needed for Python use of Tcl/Tk?
-
-    Optional:  run tests, via
-        nmake -f makefile.vc TCLDIR=..\..\tcl8.4.12 test
-
-        On WinXP Pro, wholly up to date as of 30-Aug-2004:
-        all.tcl:        Total   8420    Passed  6826    Skipped 1581    Failed  13
-        Sourced 91 Test Files.
-        Files with failing tests: canvImg.test scrollbar.test textWind.test winWm.test
-
-   Built Tix
-   ---------
-   cd dist\tix-8.4.0\win
-   nmake -f python.mak
-   nmake -f python.mak install
-
-bz2
-    Python wrapper for the libbz2 compression library.  Homepage
-        http://sources.redhat.com/bzip2/
-    Download the source from the python.org copy into the dist
-    directory:
-
-    svn export http://svn.python.org/projects/external/bzip2-1.0.3
-
-    A custom pre-link step in the bz2 project settings should manage to
-    build bzip2-1.0.3\libbz2.lib by magic before bz2.pyd (or bz2_d.pyd) is
-    linked in VS7.1\.
-    However, the bz2 project is not smart enough to remove anything under
-    bzip2-1.0.3\ when you do a clean, so if you want to rebuild bzip2.lib
-    you need to clean up bzip2-1.0.3\ by hand.
-
-    The build step shouldn't yield any warnings or errors, and should end
-    by displaying 6 blocks each terminated with
-        FC: no differences encountered
-
-    All of this managed to build bzip2-1.0.3\libbz2.lib, which the Python
-    project links in.
-
-_sqlite3
-    Python wrapper for SQLite library.
-    
-    Get the source code through
-    
-    svn export http://svn.python.org/projects/external/sqlite-source-3.3.4
-    
-    To use the extension module in a Python build tree, copy sqlite3.dll into
-    the VS7.1 folder.
-
-_ssl
-    Python wrapper for the secure sockets library.
-
-    Get the source code through
-
-    svn export http://svn.python.org/projects/external/openssl-0.9.8a
-
-    Alternatively, get the latest version from http://www.openssl.org.
-    You can (theoretically) use any version of OpenSSL you like - the
-    build process will automatically select the latest version.
-
-    You must also install ActivePerl from
-        http://www.activestate.com/Products/ActivePerl/
-    as this is used by the OpenSSL build process.  Complain to them <wink>.
-
-    The MSVC project simply invokes build_ssl.py to perform
-    the build.  This Python script locates and builds your OpenSSL
-    installation, then invokes a simple makefile to build the final .pyd.
-
-    build_ssl.py attempts to catch the most common errors (such as not
-    being able to find OpenSSL sources, or not being able to find a Perl
-    that works with OpenSSL) and give a reasonable error message.
-    If you have a problem that doesn't seem to be handled correctly
-    (eg, you know you have ActivePerl but we can't find it), please take
-    a peek at build_ssl.py and suggest patches.  Note that build_ssl.py
-    should be able to be run directly from the command-line.
-
-    build_ssl.py/MSVC isn't clever enough to clean OpenSSL - you must do
-    this by hand.
-
-Building for Itanium
---------------------
-
-The project files support a ReleaseItanium configuration which creates
-Win64/Itanium binaries. For this to work, you need to install the Platform
-SDK, in particular the 64-bit support. This includes an Itanium compiler
-(future releases of the SDK likely include an AMD64 compiler as well).
-In addition, you need the Visual Studio plugin for external C compilers,
-from http://sf.net/projects/vsextcomp. The plugin will wrap cl.exe, to
-locate the proper target compiler, and convert compiler options
-accordingly. The project files require atleast version 0.9.
-
-Building for AMD64
-------------------
-
-The build process for the ReleaseAMD64 configuration is very similar
-to the Itanium configuration; make sure you use the latest version of
-vsextcomp.
-
-Building Python Using the free MS Toolkit Compiler
---------------------------------------------------
-
-The build process for Visual C++ can be used almost unchanged with the free MS
-Toolkit Compiler. This provides a way of building Python using freely
-available software.
-
-Note that Microsoft have withdrawn the free MS Toolkit Compiler, so this can
-no longer be considered a supported option. The instructions are still
-correct, but you need to already have a copy of the compiler in order to use
-them. Microsoft now supply Visual C++ 2008 Express Edition for free, but this
-is NOT compatible with Visual C++ 7.1 (it uses a different C runtime), and so
-cannot be used to build a version of Python compatible with the standard
-python.org build. If you are interested in using Visual C++ 2008 Express
-Edition, however, you should look at the PCBuild directory.
-
-Requirements
-
-    To build Python, the following tools are required:
-
-    * The Visual C++ Toolkit Compiler
-        no longer available for download - see above
-    * A recent Platform SDK
-        from http://www.microsoft.com/downloads/details.aspx?FamilyID=484269e2-3b89-47e3-8eb7-1f2be6d7123a
-    * The .NET 1.1 SDK
-        from http://www.microsoft.com/downloads/details.aspx?FamilyID=9b3a2ca6-3647-4070-9f41-a333c6b9181d
-
-    [Does anyone have better URLs for the last 2 of these?]
-
-    The toolkit compiler is needed as it is an optimising compiler (the
-    compiler supplied with the .NET SDK is a non-optimising version). The
-    platform SDK is needed to provide the Windows header files and libraries
-    (the Windows 2003 Server SP1 edition, typical install, is known to work -
-    other configurations or versions are probably fine as well). The .NET 1.1
-    SDK is needed because it contains a version of msvcrt.dll which links to
-    the msvcr71.dll CRT. Note that the .NET 2.0 SDK is NOT acceptable, as it
-    references msvcr80.dll.
-
-    All of the above items should be installed as normal.
-
-    If you intend to build the openssl (needed for the _ssl extension) you
-    will need the C runtime sources installed as part of the platform SDK.
-
-    In addition, you will need Nant, available from
-    http://nant.sourceforge.net. The 0.85 release candidate 3 version is known
-    to work. This is the latest released version at the time of writing. Later
-    "nightly build" versions are known NOT to work - it is not clear at
-    present whether future released versions will work.
-
-Setting up the environment
-
-    Start a platform SDK "build environment window" from the start menu. The
-    "Windows XP 32-bit retail" version is known to work.
-
-    Add the following directories to your PATH:
-        * The toolkit compiler directory
-        * The SDK "Win64" binaries directory
-	* The Nant directory
-    Add to your INCLUDE environment variable:
-        * The toolkit compiler INCLUDE directory
-    Add to your LIB environment variable:
-        * The toolkit compiler LIB directory
-	* The .NET SDK Visual Studio 2003 VC7\lib directory
-
-    The following commands should set things up as you need them:
-
-        rem Set these values according to where you installed the software
-        set TOOLKIT=C:\Program Files\Microsoft Visual C++ Toolkit 2003
-        set SDK=C:\Program Files\Microsoft Platform SDK
-        set NET=C:\Program Files\Microsoft Visual Studio .NET 2003
-        set NANT=C:\Utils\Nant
-
-        set PATH=%TOOLKIT%\bin;%PATH%;%SDK%\Bin\win64;%NANT%\bin
-        set INCLUDE=%TOOLKIT%\include;%INCLUDE%
-        set LIB=%TOOLKIT%\lib;%NET%\VC7\lib;%LIB%
-
-    The "win64" directory from the SDK is added to supply executables such as
-    "cvtres" and "lib", which are not available elsewhere. The versions in the
-    "win64" directory are 32-bit programs, so they are fine to use here.
-
-    That's it. To build Python (the core only, no binary extensions which
-    depend on external libraries) you just need to issue the command
-
-        nant -buildfile:python.build all
-
-    from within the VS7.1 directory.
-
-Extension modules
-
-    To build those extension modules which require external libraries
-    (_tkinter, bz2, _sqlite3, _ssl) you can follow the instructions
-    for the Visual Studio build above, with a few minor modifications. These
-    instructions have only been tested using the sources in the Python
-    subversion repository - building from original sources should work, but
-    has not been tested.
-
-    For each extension module you wish to build, you should remove the
-    associated include line from the excludeprojects section of pc.build.
-
-    The changes required are:
-
-    _tkinter
-        The tix makefile (tix-8.4.0\win\makefile.vc) must be modified to
-	remove references to TOOLS32. The relevant lines should be changed to
-	read:
-            cc32 = cl.exe
-            link32 = link.exe
-            include32 = 
-	The remainder of the build instructions will work as given.
-
-    bz2
-        No changes are needed
-
-    _sqlite3
-        No changes are needed. However, in order for the tests to succeed, a
-	copy of sqlite3.dll must be downloaded, and placed alongside
-	python.exe.
-
-    _ssl
-        The documented build process works as written. However, it needs a
-	copy of the file setargv.obj, which is not supplied in the platform
-	SDK. However, the sources are available (in the crt source code). To
-	build setargv.obj, proceed as follows:
-
-        Copy setargv.c, cruntime.h and internal.h from %SDK%\src\crt to a
-	temporary directory.
-	Compile using "cl /c /I. /MD /D_CRTBLD setargv.c"
-	Copy the resulting setargv.obj to somewhere on your LIB environment
-	(%SDK%\lib is a reasonable place).
-
-	With setargv.obj in place, the standard build process should work
-	fine.
-
-YOUR OWN EXTENSION DLLs
------------------------
-If you want to create your own extension module DLL, there's an example
-with easy-to-follow instructions in ../PC/example/; read the file
-readme.txt there first.
diff --git a/PC/VS7.1/rmpyc.py b/PC/VS7.1/rmpyc.py
deleted file mode 100644
index 43c8576..0000000
--- a/PC/VS7.1/rmpyc.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# Remove all the .pyc and .pyo files under ../Lib.
-
-
-def deltree(root):
-    import os
-    from os.path import join
-
-    npyc = npyo = 0
-    for root, dirs, files in os.walk(root):
-        for name in files:
-            delete = False
-            if name.endswith('.pyc'):
-                delete = True
-                npyc += 1
-            elif name.endswith('.pyo'):
-                delete = True
-                npyo += 1
-
-            if delete:
-                os.remove(join(root, name))
-
-    return npyc, npyo
-
-npyc, npyo = deltree("../Lib")
-print npyc, ".pyc deleted,", npyo, ".pyo deleted"
diff --git a/PC/VS7.1/rt.bat b/PC/VS7.1/rt.bat
deleted file mode 100755
index a910a79..0000000
--- a/PC/VS7.1/rt.bat
+++ /dev/null
@@ -1,52 +0,0 @@
-@echo off
-rem Run Tests.  Run the regression test suite.
-rem Usage:  rt [-d] [-O] [-q] regrtest_args
-rem -d   Run Debug build (python_d.exe).  Else release build.
-rem -O   Run python.exe or python_d.exe (see -d) with -O.
-rem -q   "quick" -- normally the tests are run twice, the first time
-rem      after deleting all the .py[co] files reachable from Lib/.
-rem      -q runs the tests just once, and without deleting .py[co] files.
-rem All leading instances of these switches are shifted off, and
-rem whatever remains is passed to regrtest.py.  For example,
-rem     rt -O -d -x test_thread
-rem runs
-rem     python_d -O ../../lib/test/regrtest.py -x test_thread
-rem twice, and
-rem     rt -q -g test_binascii
-rem runs
-rem     python_d ../../lib/test/regrtest.py -g test_binascii
-rem to generate the expected-output file for binascii quickly.
-rem
-rem Confusing:  if you want to pass a comma-separated list, like
-rem     -u network,largefile
-rem then you have to quote it on the rt line, like
-rem     rt -u "network,largefile"
-
-setlocal
-
-set exe=python
-set qmode=
-set dashO=
-PATH %PATH%;%~dp0..\..\..\tcltk\bin
-
-:CheckOpts
-if "%1"=="-O" (set dashO=-O)     & shift & goto CheckOpts
-if "%1"=="-q" (set qmode=yes)    & shift & goto CheckOpts
-if "%1"=="-d" (set exe=python_d) & shift & goto CheckOpts
-
-set cmd=%exe% %dashO% -E ../../lib/test/regrtest.py %1 %2 %3 %4 %5 %6 %7 %8 %9
-if defined qmode goto Qmode
-
-echo Deleting .pyc/.pyo files ...
-%exe% rmpyc.py
-
-echo on
-%cmd%
-@echo off
-
-echo About to run again without deleting .pyc/.pyo first:
-pause
-
-:Qmode
-echo on
-%cmd%
diff --git a/PC/VS7.1/select.vcproj b/PC/VS7.1/select.vcproj
deleted file mode 100644
index 8252d45..0000000
--- a/PC/VS7.1/select.vcproj
+++ /dev/null
@@ -1,258 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="7.10"

-	Name="select"

-	SccProjectName="select"

-	SccLocalPath="..">

-	<Platforms>

-		<Platform

-			Name="Win32"/>

-	</Platforms>

-	<Configurations>

-		<Configuration

-			Name="Release|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\x86-temp-release\select"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE">

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;NDEBUG;WIN32;_WINDOWS"

-				StringPooling="TRUE"

-				RuntimeLibrary="2"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib"

-				OutputFile="./select.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				IgnoreDefaultLibraryNames="libc"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./select.pdb"

-				SubSystem="2"

-				BaseAddress="0x1D110000"

-				ImportLibrary=".\./select.lib"

-				TargetMachine="1"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="Debug|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\x86-temp-debug\select"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE">

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="0"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;_DEBUG;WIN32;_WINDOWS"

-				RuntimeLibrary="3"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib"

-				OutputFile="./select_d.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				IgnoreDefaultLibraryNames="libc,msvcrt"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./select_d.pdb"

-				SubSystem="2"

-				BaseAddress="0x1D110000"

-				ImportLibrary=".\./select_d.lib"

-				TargetMachine="1"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="ReleaseItanium|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\ia64-temp-release\select"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE">

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalOptions=" /USECL:MS_ITANIUM /GS-"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;NDEBUG;WIN32;_WINDOWS"

-				StringPooling="TRUE"

-				BasicRuntimeChecks="0"

-				RuntimeLibrary="2"

-				BufferSecurityCheck="FALSE"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				Detect64BitPortabilityProblems="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalOptions=" /MACHINE:IA64 /USELINK:MS_SDK"

-				AdditionalDependencies="ws2_32.lib"

-				OutputFile="./select.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				IgnoreDefaultLibraryNames="libc"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./select.pdb"

-				SubSystem="2"

-				BaseAddress="0x1D110000"

-				ImportLibrary=".\./select.lib"

-				TargetMachine="0"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="ReleaseAMD64|Win32"

-			OutputDirectory="."

-			IntermediateDirectory="amd64-temp-release\select"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE">

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalOptions=" /USECL:MS_OPTERON"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;NDEBUG;WIN32;_WINDOWS"

-				StringPooling="TRUE"

-				BasicRuntimeChecks="0"

-				RuntimeLibrary="2"

-				BufferSecurityCheck="FALSE"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				Detect64BitPortabilityProblems="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalOptions=" /MACHINE:AMD64 /USELINK:MS_SDK"

-				AdditionalDependencies="ws2_32.lib"

-				OutputFile="./select.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				IgnoreDefaultLibraryNames="libc"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./select.pdb"

-				SubSystem="2"

-				BaseAddress="0x1D110000"

-				ImportLibrary=".\./select.lib"

-				TargetMachine="0"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<File

-			RelativePath="..\..\Modules\selectmodule.c">

-		</File>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS7.1/unicodedata.vcproj b/PC/VS7.1/unicodedata.vcproj
deleted file mode 100644
index 7f47f9b..0000000
--- a/PC/VS7.1/unicodedata.vcproj
+++ /dev/null
@@ -1,247 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="7.10"

-	Name="unicodedata"

-	SccProjectName="unicodedata"

-	SccLocalPath="..">

-	<Platforms>

-		<Platform

-			Name="Win32"/>

-	</Platforms>

-	<Configurations>

-		<Configuration

-			Name="Release|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\x86-temp-release\unicodedata"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE"

-			CharacterSet="2">

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;WIN32;NDEBUG;_WINDOWS;_USRDLL;MMAP_EXPORTS"

-				StringPooling="TRUE"

-				RuntimeLibrary="2"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				OutputFile="./unicodedata.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				ProgramDatabaseFile=".\./unicodedata.pdb"

-				BaseAddress="0x1D120000"

-				ImportLibrary=".\./unicodedata.lib"

-				TargetMachine="1"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="Debug|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\x86-temp-debug\unicodedata"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE"

-			CharacterSet="2">

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="0"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;WIN32;_DEBUG;_WINDOWS;_USRDLL;MMAP_EXPORTS"

-				BasicRuntimeChecks="3"

-				RuntimeLibrary="3"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				OutputFile="./unicodedata_d.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./unicodedata_d.pdb"

-				BaseAddress="0x1D120000"

-				ImportLibrary=".\./unicodedata_d.lib"

-				TargetMachine="1"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="ReleaseItanium|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\ia64-temp-release\unicodedata"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE"

-			CharacterSet="2">

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalOptions=" /USECL:MS_ITANIUM /GS-"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;WIN32;NDEBUG;_WINDOWS;_USRDLL;MMAP_EXPORTS"

-				StringPooling="TRUE"

-				BasicRuntimeChecks="0"

-				RuntimeLibrary="2"

-				BufferSecurityCheck="FALSE"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				Detect64BitPortabilityProblems="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalOptions=" /MACHINE:IA64 /USELINK:MS_SDK"

-				OutputFile="./unicodedata.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				ProgramDatabaseFile=".\./unicodedata.pdb"

-				BaseAddress="0x1D120000"

-				ImportLibrary=".\./unicodedata.lib"

-				TargetMachine="0"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="ReleaseAMD64|Win32"

-			OutputDirectory="."

-			IntermediateDirectory="amd64-temp-release\unicodedata"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE"

-			CharacterSet="2">

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalOptions=" /USECL:MS_OPTERON /GS-"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;WIN32;NDEBUG;_WINDOWS;_USRDLL;MMAP_EXPORTS"

-				StringPooling="TRUE"

-				BasicRuntimeChecks="0"

-				RuntimeLibrary="2"

-				BufferSecurityCheck="FALSE"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				Detect64BitPortabilityProblems="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalOptions=" /MACHINE:AMD64 /USELINK:MS_SDK"

-				OutputFile="./unicodedata.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				ProgramDatabaseFile=".\./unicodedata.pdb"

-				BaseAddress="0x1D120000"

-				ImportLibrary=".\./unicodedata.lib"

-				TargetMachine="0"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<File

-			RelativePath="..\..\Modules\unicodedata.c">

-		</File>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS7.1/w9xpopen.vcproj b/PC/VS7.1/w9xpopen.vcproj
deleted file mode 100644
index b9f3b4e..0000000
--- a/PC/VS7.1/w9xpopen.vcproj
+++ /dev/null
@@ -1,121 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="7.10"

-	Name="w9xpopen"

-	SccProjectName=""

-	SccLocalPath="">

-	<Platforms>

-		<Platform

-			Name="Win32"/>

-	</Platforms>

-	<Configurations>

-		<Configuration

-			Name="Debug|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\x86-temp-debug\w9xpopen"

-			ConfigurationType="1"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE"

-			CharacterSet="2">

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="0"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;WIN32;_DEBUG;_WINDOWS"

-				BasicRuntimeChecks="3"

-				RuntimeLibrary="3"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				DebugInformationFormat="3"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				OutputFile="./w9xpopen_d.exe"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./w9xpopen_d.pdb"

-				TargetMachine="1"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="Release|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\x86-temp-release\w9xpopen"

-			ConfigurationType="1"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE"

-			CharacterSet="2">

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;WIN32;NDEBUG;_WINDOWS"

-				StringPooling="TRUE"

-				RuntimeLibrary="2"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				OutputFile=".\./w9xpopen.exe"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				ProgramDatabaseFile=".\./w9xpopen.pdb"

-				TargetMachine="1"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<File

-			RelativePath="..\..\PC\w9xpopen.c">

-		</File>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS7.1/winsound.vcproj b/PC/VS7.1/winsound.vcproj
deleted file mode 100644
index bc4cf39..0000000
--- a/PC/VS7.1/winsound.vcproj
+++ /dev/null
@@ -1,251 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="7.10"

-	Name="winsound"

-	SccProjectName="winsound"

-	SccLocalPath="..\..\pc">

-	<Platforms>

-		<Platform

-			Name="Win32"/>

-	</Platforms>

-	<Configurations>

-		<Configuration

-			Name="Debug|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\x86-temp-debug\winsound"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE"

-			CharacterSet="2">

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="0"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;WIN32;_DEBUG;_WINDOWS;_USRDLL;WINSOUND_EXPORTS"

-				BasicRuntimeChecks="3"

-				RuntimeLibrary="3"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="winmm.lib"

-				OutputFile="./winsound_d.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				GenerateDebugInformation="TRUE"

-				ProgramDatabaseFile=".\./winsound_d.pdb"

-				BaseAddress="0x1D160000"

-				ImportLibrary=".\./winsound_d.lib"

-				TargetMachine="1"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="Release|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\x86-temp-release\winsound"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE"

-			CharacterSet="2">

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;WIN32;NDEBUG;_WINDOWS;_USRDLL;WINSOUND_EXPORTS"

-				StringPooling="TRUE"

-				RuntimeLibrary="2"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="winmm.lib"

-				OutputFile="./winsound.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				ProgramDatabaseFile=".\./winsound.pdb"

-				BaseAddress="0x1D160000"

-				ImportLibrary=".\./winsound.lib"

-				TargetMachine="1"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="ReleaseItanium|Win32"

-			OutputDirectory=".\."

-			IntermediateDirectory=".\ia64-temp-release\winsound"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE"

-			CharacterSet="2">

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalOptions=" /USECL:MS_ITANIUM /GS-"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;WIN32;NDEBUG;_WINDOWS;_USRDLL;WINSOUND_EXPORTS"

-				StringPooling="TRUE"

-				BasicRuntimeChecks="0"

-				RuntimeLibrary="2"

-				BufferSecurityCheck="FALSE"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				Detect64BitPortabilityProblems="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalOptions=" /MACHINE:IA64 /USELINK:MS_SDK"

-				AdditionalDependencies="winmm.lib"

-				OutputFile="./winsound.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				ProgramDatabaseFile=".\./winsound.pdb"

-				BaseAddress="0x1D160000"

-				ImportLibrary=".\./winsound.lib"

-				TargetMachine="0"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-		<Configuration

-			Name="ReleaseAMD64|Win32"

-			OutputDirectory="."

-			IntermediateDirectory="amd64-temp-release\winsound"

-			ConfigurationType="2"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="FALSE"

-			CharacterSet="2">

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalOptions=" /USECL:MS_OPTERON /GS-"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\Include,..\..\PC"

-				PreprocessorDefinitions="Py_BUILD_CORE_MODULE;WIN32;NDEBUG;_WINDOWS;_USRDLL;WINSOUND_EXPORTS"

-				StringPooling="TRUE"

-				BasicRuntimeChecks="0"

-				RuntimeLibrary="2"

-				BufferSecurityCheck="FALSE"

-				EnableFunctionLevelLinking="TRUE"

-				UsePrecompiledHeader="2"

-				WarningLevel="3"

-				SuppressStartupBanner="TRUE"

-				Detect64BitPortabilityProblems="TRUE"

-				DebugInformationFormat="3"

-				CompileAs="0"/>

-			<Tool

-				Name="VCCustomBuildTool"/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalOptions=" /MACHINE:AMD64 /USELINK:MS_SDK"

-				AdditionalDependencies="winmm.lib"

-				OutputFile="./winsound.pyd"

-				LinkIncremental="1"

-				SuppressStartupBanner="TRUE"

-				ProgramDatabaseFile=".\./winsound.pdb"

-				BaseAddress="0x1D160000"

-				ImportLibrary=".\./winsound.lib"

-				TargetMachine="0"/>

-			<Tool

-				Name="VCMIDLTool"/>

-			<Tool

-				Name="VCPostBuildEventTool"/>

-			<Tool

-				Name="VCPreBuildEventTool"/>

-			<Tool

-				Name="VCPreLinkEventTool"/>

-			<Tool

-				Name="VCResourceCompilerTool"/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"/>

-			<Tool

-				Name="VCWebDeploymentTool"/>

-			<Tool

-				Name="VCManagedWrapperGeneratorTool"/>

-			<Tool

-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<File

-			RelativePath="..\..\PC\winsound.c">

-		</File>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS8.0/_ctypes.vcproj b/PC/VS8.0/_ctypes.vcproj
deleted file mode 100644
index 8973233..0000000
--- a/PC/VS8.0/_ctypes.vcproj
+++ /dev/null
@@ -1,705 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="8.00"

-	Name="_ctypes"

-	ProjectGUID="{0E9791DB-593A-465F-98BC-681011311618}"

-	RootNamespace="_ctypes"

-	Keyword="Win32Proj"

-	TargetFrameworkVersion="196613"

-	>

-	<Platforms>

-		<Platform

-			Name="Win32"

-		/>

-		<Platform

-			Name="x64"

-		/>

-	</Platforms>

-	<ToolFiles>

-	</ToolFiles>

-	<Configurations>

-		<Configuration

-			Name="Debug|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd_d.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="..\..\Modules\_ctypes\libffi_msvc"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				BaseAddress="0x1D1A0000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Debug|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd_d.vsprops;.\x64.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="..\..\Modules\_ctypes\libffi_msvc"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				BaseAddress="0x1D1A0000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="..\..\Modules\_ctypes\libffi_msvc"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalOptions="/EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE"

-				SubSystem="0"

-				BaseAddress="0x1D1A0000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="..\..\Modules\_ctypes\libffi_msvc"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalOptions="/EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE"

-				SubSystem="0"

-				BaseAddress="0x1D1A0000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\pginstrument.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="..\..\Modules\_ctypes\libffi_msvc"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalOptions="/EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE"

-				SubSystem="0"

-				BaseAddress="0x1D1A0000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops;.\pginstrument.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="..\..\Modules\_ctypes\libffi_msvc"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalOptions="/EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE"

-				SubSystem="0"

-				BaseAddress="0x1D1A0000"

-				TargetMachine="17"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\pgupdate.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="..\..\Modules\_ctypes\libffi_msvc"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalOptions="/EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE"

-				SubSystem="0"

-				BaseAddress="0x1D1A0000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops;.\pgupdate.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="..\..\Modules\_ctypes\libffi_msvc"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalOptions="/EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE"

-				SubSystem="0"

-				BaseAddress="0x1D1A0000"

-				TargetMachine="17"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<Filter

-			Name="Header Files"

-			>

-			<File

-				RelativePath="..\..\Modules\_ctypes\ctypes.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_ctypes\ctypes_dlfcn.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_ctypes\libffi_msvc\ffi.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_ctypes\libffi_msvc\ffi_common.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_ctypes\libffi_msvc\fficonfig.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_ctypes\libffi_msvc\ffitarget.h"

-				>

-			</File>

-		</Filter>

-		<Filter

-			Name="Source Files"

-			>

-			<File

-				RelativePath="..\..\Modules\_ctypes\_ctypes.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_ctypes\callbacks.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_ctypes\callproc.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_ctypes\cfield.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_ctypes\libffi_msvc\ffi.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_ctypes\malloc_closure.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_ctypes\libffi_msvc\prep_cif.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_ctypes\stgdict.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_ctypes\libffi_msvc\win32.c"

-				>

-				<FileConfiguration

-					Name="Debug|x64"

-					ExcludedFromBuild="true"

-					>

-					<Tool

-						Name="VCCLCompilerTool"

-					/>

-				</FileConfiguration>

-				<FileConfiguration

-					Name="Release|x64"

-					ExcludedFromBuild="true"

-					>

-					<Tool

-						Name="VCCLCompilerTool"

-					/>

-				</FileConfiguration>

-				<FileConfiguration

-					Name="PGInstrument|x64"

-					ExcludedFromBuild="true"

-					>

-					<Tool

-						Name="VCCLCompilerTool"

-					/>

-				</FileConfiguration>

-				<FileConfiguration

-					Name="PGUpdate|x64"

-					ExcludedFromBuild="true"

-					>

-					<Tool

-						Name="VCCLCompilerTool"

-					/>

-				</FileConfiguration>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_ctypes\libffi_msvc\win64.asm"

-				>

-				<FileConfiguration

-					Name="Debug|Win32"

-					ExcludedFromBuild="true"

-					>

-					<Tool

-						Name="VCCustomBuildTool"

-					/>

-				</FileConfiguration>

-				<FileConfiguration

-					Name="Debug|x64"

-					>

-					<Tool

-						Name="VCCustomBuildTool"

-						CommandLine="ml64 /nologo /c /Zi /Fo &quot;$(IntDir)\win64.obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"

-						Outputs="$(IntDir)\win64.obj"

-					/>

-				</FileConfiguration>

-				<FileConfiguration

-					Name="Release|Win32"

-					ExcludedFromBuild="true"

-					>

-					<Tool

-						Name="VCCustomBuildTool"

-					/>

-				</FileConfiguration>

-				<FileConfiguration

-					Name="Release|x64"

-					>

-					<Tool

-						Name="VCCustomBuildTool"

-						CommandLine="ml64 /nologo /c /Fo &quot;$(IntDir)\win64.obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"

-						Outputs="$(IntDir)\win64.obj"

-					/>

-				</FileConfiguration>

-				<FileConfiguration

-					Name="PGInstrument|Win32"

-					ExcludedFromBuild="true"

-					>

-					<Tool

-						Name="VCCustomBuildTool"

-					/>

-				</FileConfiguration>

-				<FileConfiguration

-					Name="PGInstrument|x64"

-					>

-					<Tool

-						Name="VCCustomBuildTool"

-						CommandLine="ml64 /nologo /c /Fo &quot;$(IntDir)\win64.obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"

-						Outputs="$(IntDir)\win64.obj"

-					/>

-				</FileConfiguration>

-				<FileConfiguration

-					Name="PGUpdate|Win32"

-					ExcludedFromBuild="true"

-					>

-					<Tool

-						Name="VCCustomBuildTool"

-					/>

-				</FileConfiguration>

-				<FileConfiguration

-					Name="PGUpdate|x64"

-					>

-					<Tool

-						Name="VCCustomBuildTool"

-						CommandLine="ml64 /nologo /c /Fo &quot;$(IntDir)\win64.obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"

-						Outputs="$(IntDir)\win64.obj"

-					/>

-				</FileConfiguration>

-			</File>

-		</Filter>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS8.0/_ctypes_test.vcproj b/PC/VS8.0/_ctypes_test.vcproj
deleted file mode 100644
index 097241e..0000000
--- a/PC/VS8.0/_ctypes_test.vcproj
+++ /dev/null
@@ -1,521 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="8.00"

-	Name="_ctypes_test"

-	ProjectGUID="{9EC7190A-249F-4180-A900-548FDCF3055F}"

-	RootNamespace="_ctypes_test"

-	Keyword="Win32Proj"

-	TargetFrameworkVersion="196613"

-	>

-	<Platforms>

-		<Platform

-			Name="Win32"

-		/>

-		<Platform

-			Name="x64"

-		/>

-	</Platforms>

-	<ToolFiles>

-	</ToolFiles>

-	<Configurations>

-		<Configuration

-			Name="Debug|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd_d.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Debug|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd_d.vsprops;.\x64.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\pginstrument.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops;.\pginstrument.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				TargetMachine="17"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\pgupdate.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops;.\pgupdate.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				TargetMachine="17"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<Filter

-			Name="Header Files"

-			>

-			<File

-				RelativePath="..\..\Modules\_ctypes\_ctypes_test.h"

-				>

-			</File>

-		</Filter>

-		<Filter

-			Name="Source Files"

-			>

-			<File

-				RelativePath="..\..\Modules\_ctypes\_ctypes_test.c"

-				>

-			</File>

-		</Filter>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS8.0/_elementtree.vcproj b/PC/VS8.0/_elementtree.vcproj
deleted file mode 100644
index 457da72..0000000
--- a/PC/VS8.0/_elementtree.vcproj
+++ /dev/null
@@ -1,613 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="8.00"

-	Name="_elementtree"

-	ProjectGUID="{17E1E049-C309-4D79-843F-AE483C264AEA}"

-	RootNamespace="_elementtree"

-	Keyword="Win32Proj"

-	TargetFrameworkVersion="196613"

-	>

-	<Platforms>

-		<Platform

-			Name="Win32"

-		/>

-		<Platform

-			Name="x64"

-		/>

-	</Platforms>

-	<ToolFiles>

-	</ToolFiles>

-	<Configurations>

-		<Configuration

-			Name="Debug|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd_d.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="..\..\Modules\expat"

-				PreprocessorDefinitions="XML_NS;XML_DTD;BYTEORDER=1234;XML_CONTEXT_BYTES=1024;USE_PYEXPAT_CAPI;XML_STATIC;HAVE_MEMMOVE"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				BaseAddress="0x1D100000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Debug|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd_d.vsprops;.\x64.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="..\..\Modules\expat"

-				PreprocessorDefinitions="XML_NS;XML_DTD;BYTEORDER=1234;XML_CONTEXT_BYTES=1024;USE_PYEXPAT_CAPI;XML_STATIC;HAVE_MEMMOVE"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				BaseAddress="0x1D100000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="..\..\Modules\expat"

-				PreprocessorDefinitions="XML_NS;XML_DTD;BYTEORDER=1234;XML_CONTEXT_BYTES=1024;USE_PYEXPAT_CAPI;XML_STATIC;HAVE_MEMMOVE"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				BaseAddress="0x1D100000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="..\..\Modules\expat"

-				PreprocessorDefinitions="XML_NS;XML_DTD;BYTEORDER=1234;XML_CONTEXT_BYTES=1024;USE_PYEXPAT_CAPI;XML_STATIC;HAVE_MEMMOVE"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				BaseAddress="0x1D100000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\pginstrument.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="..\..\Modules\expat"

-				PreprocessorDefinitions="XML_NS;XML_DTD;BYTEORDER=1234;XML_CONTEXT_BYTES=1024;USE_PYEXPAT_CAPI;XML_STATIC;HAVE_MEMMOVE"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				BaseAddress="0x1D100000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops;.\pginstrument.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="..\..\Modules\expat"

-				PreprocessorDefinitions="XML_NS;XML_DTD;BYTEORDER=1234;XML_CONTEXT_BYTES=1024;USE_PYEXPAT_CAPI;XML_STATIC;HAVE_MEMMOVE"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				BaseAddress="0x1D100000"

-				TargetMachine="17"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\pgupdate.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="..\..\Modules\expat"

-				PreprocessorDefinitions="XML_NS;XML_DTD;BYTEORDER=1234;XML_CONTEXT_BYTES=1024;USE_PYEXPAT_CAPI;XML_STATIC;HAVE_MEMMOVE"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				BaseAddress="0x1D100000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops;.\pgupdate.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="..\..\Modules\expat"

-				PreprocessorDefinitions="XML_NS;XML_DTD;BYTEORDER=1234;XML_CONTEXT_BYTES=1024;USE_PYEXPAT_CAPI;XML_STATIC;HAVE_MEMMOVE"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				BaseAddress="0x1D100000"

-				TargetMachine="17"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<Filter

-			Name="Header Files"

-			>

-			<File

-				RelativePath="..\..\Modules\expat\ascii.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\expat\asciitab.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\expat\expat.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\expat\expat_config.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\expat\expat_external.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\expat\iasciitab.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\expat\internal.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\expat\latin1tab.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\expat\macconfig.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\expat\nametab.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\expat\pyexpatns.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\expat\utf8tab.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\expat\winconfig.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\expat\xmlrole.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\expat\xmltok.h"

-				>

-			</File>

-		</Filter>

-		<Filter

-			Name="Source Files"

-			>

-			<File

-				RelativePath="..\..\Modules\_elementtree.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\expat\xmlparse.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\expat\xmlrole.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\expat\xmltok.c"

-				>

-			</File>

-		</Filter>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS8.0/_hashlib.vcproj b/PC/VS8.0/_hashlib.vcproj
deleted file mode 100644
index f031e2e..0000000
--- a/PC/VS8.0/_hashlib.vcproj
+++ /dev/null
@@ -1,537 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="8.00"

-	Name="_hashlib"

-	ProjectGUID="{447F05A8-F581-4CAC-A466-5AC7936E207E}"

-	RootNamespace="_hashlib"

-	Keyword="Win32Proj"

-	TargetFrameworkVersion="196613"

-	>

-	<Platforms>

-		<Platform

-			Name="Win32"

-		/>

-		<Platform

-			Name="x64"

-		/>

-	</Platforms>

-	<ToolFiles>

-	</ToolFiles>

-	<Configurations>

-		<Configuration

-			Name="Debug|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd_d.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="$(opensslDir)\inc32"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-				CommandLine=""

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib $(opensslDir)\out32\libeay32.lib $(opensslDir)\out32\ssleay32.lib"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Debug|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd_d.vsprops;.\x64.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="$(opensslDir)\inc64"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-				CommandLine=""

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib $(opensslDir)\out64\libeay32.lib $(opensslDir)\out64\ssleay32.lib"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="$(opensslDir)\inc32"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-				CommandLine=""

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib $(opensslDir)\out32\libeay32.lib $(opensslDir)\out32\ssleay32.lib"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="$(opensslDir)\inc64"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-				CommandLine=""

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib $(opensslDir)\out64\libeay32.lib $(opensslDir)\out64\ssleay32.lib"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\pginstrument.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="$(opensslDir)\inc32"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-				CommandLine=""

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib $(opensslDir)\out32\libeay32.lib $(opensslDir)\out32\ssleay32.lib"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops;.\pginstrument.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="$(opensslDir)\inc64"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-				CommandLine=""

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib $(opensslDir)\out64\libeay32.lib $(opensslDir)\out64\ssleay32.lib"

-				TargetMachine="17"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\pgupdate.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="$(opensslDir)\inc32"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-				CommandLine=""

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib $(opensslDir)\out32\libeay32.lib $(opensslDir)\out32\ssleay32.lib"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops;.\pgupdate.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="$(opensslDir)\inc64"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-				CommandLine=""

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib $(opensslDir)\out64\libeay32.lib $(opensslDir)\out64\ssleay32.lib"

-				TargetMachine="17"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<Filter

-			Name="Source Files"

-			>

-			<File

-				RelativePath="..\..\Modules\_hashopenssl.c"

-				>

-			</File>

-		</Filter>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS8.0/_msi.vcproj b/PC/VS8.0/_msi.vcproj
deleted file mode 100644
index 99971c6..0000000
--- a/PC/VS8.0/_msi.vcproj
+++ /dev/null
@@ -1,529 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="8.00"

-	Name="_msi"

-	ProjectGUID="{31FFC478-7B4A-43E8-9954-8D03E2187E9C}"

-	RootNamespace="_msi"

-	Keyword="Win32Proj"

-	TargetFrameworkVersion="196613"

-	>

-	<Platforms>

-		<Platform

-			Name="Win32"

-		/>

-		<Platform

-			Name="x64"

-		/>

-	</Platforms>

-	<ToolFiles>

-	</ToolFiles>

-	<Configurations>

-		<Configuration

-			Name="Debug|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd_d.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="fci.lib msi.lib rpcrt4.lib"

-				BaseAddress="0x1D160000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Debug|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd_d.vsprops;.\x64.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="fci.lib msi.lib rpcrt4.lib"

-				BaseAddress="0x1D160000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="fci.lib msi.lib rpcrt4.lib"

-				BaseAddress="0x1D160000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="fci.lib msi.lib rpcrt4.lib"

-				BaseAddress="0x1D160000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\pginstrument.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="fci.lib msi.lib rpcrt4.lib"

-				BaseAddress="0x1D160000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops;.\pginstrument.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="fci.lib msi.lib rpcrt4.lib"

-				BaseAddress="0x1D160000"

-				TargetMachine="17"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\pgupdate.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="fci.lib msi.lib rpcrt4.lib"

-				BaseAddress="0x1D160000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops;.\pgupdate.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="fci.lib msi.lib rpcrt4.lib"

-				BaseAddress="0x1D160000"

-				TargetMachine="17"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<Filter

-			Name="Source Files"

-			>

-			<File

-				RelativePath="..\..\PC\_msi.c"

-				>

-			</File>

-		</Filter>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS8.0/_multiprocessing.vcproj b/PC/VS8.0/_multiprocessing.vcproj
deleted file mode 100644
index 8f1cafc..0000000
--- a/PC/VS8.0/_multiprocessing.vcproj
+++ /dev/null
@@ -1,545 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="8.00"

-	Name="_multiprocessing"

-	ProjectGUID="{9E48B300-37D1-11DD-8C41-005056C00008}"

-	RootNamespace="_multiprocessing"

-	Keyword="Win32Proj"

-	TargetFrameworkVersion="196613"

-	>

-	<Platforms>

-		<Platform

-			Name="Win32"

-		/>

-		<Platform

-			Name="x64"

-		/>

-	</Platforms>

-	<ToolFiles>

-	</ToolFiles>

-	<Configurations>

-		<Configuration

-			Name="Debug|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd_d.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib"

-				BaseAddress="0x1e1D0000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Debug|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd_d.vsprops;.\x64.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib"

-				BaseAddress="0x1e1D0000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib"

-				BaseAddress="0x1e1D0000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib"

-				BaseAddress="0x1e1D0000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\pginstrument.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib"

-				BaseAddress="0x1e1D0000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops;.\pginstrument.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib"

-				BaseAddress="0x1e1D0000"

-				TargetMachine="17"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\pgupdate.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib"

-				BaseAddress="0x1e1D0000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops;.\pgupdate.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib"

-				BaseAddress="0x1e1D0000"

-				TargetMachine="17"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<Filter

-			Name="Header Files"

-			>

-			<File

-				RelativePath="..\..\Modules\_multiprocessing\multiprocessing.h"

-				>

-			</File>

-		</Filter>

-		<Filter

-			Name="Source Files"

-			>

-			<File

-				RelativePath="..\..\Modules\_multiprocessing\multiprocessing.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_multiprocessing\semaphore.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_multiprocessing\win32_functions.c"

-				>

-			</File>

-		</Filter>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS8.0/_socket.vcproj b/PC/VS8.0/_socket.vcproj
deleted file mode 100644
index 8abd982..0000000
--- a/PC/VS8.0/_socket.vcproj
+++ /dev/null
@@ -1,537 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="8.00"

-	Name="_socket"

-	ProjectGUID="{86937F53-C189-40EF-8CE8-8759D8E7D480}"

-	RootNamespace="_socket"

-	Keyword="Win32Proj"

-	TargetFrameworkVersion="196613"

-	>

-	<Platforms>

-		<Platform

-			Name="Win32"

-		/>

-		<Platform

-			Name="x64"

-		/>

-	</Platforms>

-	<ToolFiles>

-	</ToolFiles>

-	<Configurations>

-		<Configuration

-			Name="Debug|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd_d.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib"

-				BaseAddress="0x1e1D0000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Debug|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd_d.vsprops;.\x64.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib"

-				BaseAddress="0x1e1D0000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib"

-				BaseAddress="0x1e1D0000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib"

-				BaseAddress="0x1e1D0000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\pginstrument.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib"

-				BaseAddress="0x1e1D0000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops;.\pginstrument.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib"

-				BaseAddress="0x1e1D0000"

-				TargetMachine="17"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\pgupdate.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib"

-				BaseAddress="0x1e1D0000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops;.\pgupdate.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib"

-				BaseAddress="0x1e1D0000"

-				TargetMachine="17"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<Filter

-			Name="Header Files"

-			>

-			<File

-				RelativePath="..\..\Modules\socketmodule.h"

-				>

-			</File>

-		</Filter>

-		<Filter

-			Name="Source Files"

-			>

-			<File

-				RelativePath="..\..\Modules\socketmodule.c"

-				>

-			</File>

-		</Filter>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS8.0/_sqlite3.vcproj b/PC/VS8.0/_sqlite3.vcproj
deleted file mode 100644
index 64f19f1..0000000
--- a/PC/VS8.0/_sqlite3.vcproj
+++ /dev/null
@@ -1,613 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="8.00"

-	Name="_sqlite3"

-	ProjectGUID="{13CECB97-4119-4316-9D42-8534019A5A44}"

-	RootNamespace="_sqlite3"

-	Keyword="Win32Proj"

-	TargetFrameworkVersion="196613"

-	>

-	<Platforms>

-		<Platform

-			Name="Win32"

-		/>

-		<Platform

-			Name="x64"

-		/>

-	</Platforms>

-	<ToolFiles>

-	</ToolFiles>

-	<Configurations>

-		<Configuration

-			Name="Debug|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd_d.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="..\..\..\sqlite-3.6.21"

-				PreprocessorDefinitions="MODULE_NAME=\&quot;sqlite3\&quot;"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				BaseAddress="0x1e180000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Debug|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd_d.vsprops;.\x64.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="..\..\..\sqlite-3.6.21"

-				PreprocessorDefinitions="MODULE_NAME=\&quot;sqlite3\&quot;"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				BaseAddress="0x1e180000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="..\..\..\sqlite-3.6.21"

-				PreprocessorDefinitions="MODULE_NAME=\&quot;sqlite3\&quot;"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				BaseAddress="0x1e180000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="..\..\..\sqlite-3.6.21"

-				PreprocessorDefinitions="MODULE_NAME=\&quot;sqlite3\&quot;"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				BaseAddress="0x1e180000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\pginstrument.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="..\..\..\sqlite-3.6.21"

-				PreprocessorDefinitions="MODULE_NAME=\&quot;sqlite3\&quot;"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				BaseAddress="0x1e180000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops;.\pginstrument.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="..\..\..\sqlite-3.6.21"

-				PreprocessorDefinitions="MODULE_NAME=\&quot;sqlite3\&quot;"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				BaseAddress="0x1e180000"

-				TargetMachine="17"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\pgupdate.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="..\..\..\sqlite-3.6.21"

-				PreprocessorDefinitions="MODULE_NAME=\&quot;sqlite3\&quot;"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				BaseAddress="0x1e180000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops;.\pgupdate.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="..\..\..\sqlite-3.6.21"

-				PreprocessorDefinitions="MODULE_NAME=\&quot;sqlite3\&quot;"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				BaseAddress="0x1e180000"

-				TargetMachine="17"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<Filter

-			Name="Header Files"

-			>

-			<File

-				RelativePath="..\..\Modules\_sqlite\cache.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_sqlite\connection.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_sqlite\cursor.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_sqlite\microprotocols.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_sqlite\module.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_sqlite\prepare_protocol.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_sqlite\row.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_sqlite\sqlitecompat.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_sqlite\statement.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_sqlite\util.h"

-				>

-			</File>

-		</Filter>

-		<Filter

-			Name="Source Files"

-			>

-			<File

-				RelativePath="..\..\Modules\_sqlite\cache.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_sqlite\connection.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_sqlite\cursor.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_sqlite\microprotocols.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_sqlite\module.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_sqlite\prepare_protocol.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_sqlite\row.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_sqlite\statement.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_sqlite\util.c"

-				>

-			</File>

-		</Filter>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS8.0/_ssl.vcproj b/PC/VS8.0/_ssl.vcproj
deleted file mode 100644
index d9267a4..0000000
--- a/PC/VS8.0/_ssl.vcproj
+++ /dev/null
@@ -1,537 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="8.00"

-	Name="_ssl"

-	ProjectGUID="{C6E20F84-3247-4AD6-B051-B073268F73BA}"

-	RootNamespace="_ssl"

-	Keyword="Win32Proj"

-	TargetFrameworkVersion="196613"

-	>

-	<Platforms>

-		<Platform

-			Name="Win32"

-		/>

-		<Platform

-			Name="x64"

-		/>

-	</Platforms>

-	<ToolFiles>

-	</ToolFiles>

-	<Configurations>

-		<Configuration

-			Name="Debug|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd_d.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="$(opensslDir)\inc32"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-				CommandLine=""

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib $(opensslDir)\out32\libeay32.lib $(opensslDir)\out32\ssleay32.lib"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Debug|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd_d.vsprops;.\x64.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="$(opensslDir)\inc64"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-				CommandLine=""

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib $(opensslDir)\out64\libeay32.lib $(opensslDir)\out64\ssleay32.lib"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="$(opensslDir)\inc32"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-				CommandLine=""

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib $(opensslDir)\out32\libeay32.lib $(opensslDir)\out32\ssleay32.lib"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="$(opensslDir)\inc64"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-				CommandLine=""

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib $(opensslDir)\out64\libeay32.lib $(opensslDir)\out64\ssleay32.lib"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\pginstrument.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="$(opensslDir)\inc32"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-				CommandLine=""

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib $(opensslDir)\out32\libeay32.lib $(opensslDir)\out32\ssleay32.lib"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops;.\pginstrument.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="$(opensslDir)\inc64"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-				CommandLine=""

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib $(opensslDir)\out64\libeay32.lib $(opensslDir)\out64\ssleay32.lib"

-				TargetMachine="17"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\pgupdate.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="$(opensslDir)\inc32"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-				CommandLine=""

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib $(opensslDir)\out32\libeay32.lib $(opensslDir)\out32\ssleay32.lib"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops;.\pgupdate.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="$(opensslDir)\inc64"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-				CommandLine=""

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib $(opensslDir)\out64\libeay32.lib $(opensslDir)\out64\ssleay32.lib"

-				TargetMachine="17"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<Filter

-			Name="Source Files"

-			>

-			<File

-				RelativePath="..\..\Modules\_ssl.c"

-				>

-			</File>

-		</Filter>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS8.0/_tkinter.vcproj b/PC/VS8.0/_tkinter.vcproj
deleted file mode 100644
index 9700bde..0000000
--- a/PC/VS8.0/_tkinter.vcproj
+++ /dev/null
@@ -1,541 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="8.00"

-	Name="_tkinter"

-	ProjectGUID="{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}"

-	RootNamespace="_tkinter"

-	Keyword="Win32Proj"

-	TargetFrameworkVersion="196613"

-	>

-	<Platforms>

-		<Platform

-			Name="Win32"

-		/>

-		<Platform

-			Name="x64"

-		/>

-	</Platforms>

-	<ToolFiles>

-	</ToolFiles>

-	<Configurations>

-		<Configuration

-			Name="Debug|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd_d.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="$(tcltkDir)\include"

-				PreprocessorDefinitions="WITH_APPINIT"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="$(tcltkLibDebug)"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Debug|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd_d.vsprops;.\x64.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="$(tcltk64Dir)\include"

-				PreprocessorDefinitions="WITH_APPINIT"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="$(tcltk64LibDebug)"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="$(tcltkDir)\include"

-				PreprocessorDefinitions="WITH_APPINIT"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="$(tcltkLib)"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="$(tcltk64Dir)\include"

-				PreprocessorDefinitions="WITH_APPINIT"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="$(tcltk64Lib)"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\pginstrument.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="$(tcltkDir)\include"

-				PreprocessorDefinitions="WITH_APPINIT"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="$(tcltkLib)"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops;.\pginstrument.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="$(tcltk64Dir)\include"

-				PreprocessorDefinitions="WITH_APPINIT"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="$(tcltk64Lib)"

-				TargetMachine="17"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\pgupdate.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="$(tcltkDir)\include"

-				PreprocessorDefinitions="WITH_APPINIT"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="$(tcltkLib)"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops;.\pgupdate.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="$(tcltk64Dir)\include"

-				PreprocessorDefinitions="WITH_APPINIT"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="$(tcltk64Lib)"

-				TargetMachine="17"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<Filter

-			Name="Source Files"

-			>

-			<File

-				RelativePath="..\..\Modules\_tkinter.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\tkappinit.c"

-				>

-			</File>

-		</Filter>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS8.0/bdist_wininst.vcproj b/PC/VS8.0/bdist_wininst.vcproj
deleted file mode 100644
index d11edf2..0000000
--- a/PC/VS8.0/bdist_wininst.vcproj
+++ /dev/null
@@ -1,270 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="8.00"

-	Name="bdist_wininst"

-	ProjectGUID="{EB1C19C1-1F18-421E-9735-CAEE69DC6A3C}"

-	RootNamespace="wininst"

-	TargetFrameworkVersion="131072"

-	>

-	<Platforms>

-		<Platform

-			Name="Win32"

-		/>

-		<Platform

-			Name="x64"

-		/>

-	</Platforms>

-	<ToolFiles>

-	</ToolFiles>

-	<Configurations>

-		<Configuration

-			Name="Release|Win32"

-			OutputDirectory="..\..\lib\distutils\command"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\release.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				PreprocessorDefinitions="NDEBUG"

-				MkTypLibCompatible="true"

-				SuppressStartupBanner="true"

-				TargetEnvironment="1"

-				TypeLibraryName=".\..\..\lib\distutils\command\wininst.tlb"

-				HeaderFileName=""

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="1"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\PC\bdist_wininst;..\..\Include;..\..\Modules\zlib"

-				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"

-				StringPooling="true"

-				RuntimeLibrary="0"

-				EnableFunctionLevelLinking="true"

-				WarningLevel="3"

-				SuppressStartupBanner="true"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-				PreprocessorDefinitions="NDEBUG"

-				Culture="0"

-				AdditionalIncludeDirectories="..\..\PC;..\..\PC\bdist_wininst;..\..\Include"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="comctl32.lib imagehlp.lib"

-				OutputFile="..\..\lib\distutils\command\wininst-8.0.exe"

-				LinkIncremental="1"

-				SuppressStartupBanner="true"

-				IgnoreDefaultLibraryNames="LIBC"

-				ProgramDatabaseFile="..\..\lib\distutils\command\wininst-8.0.pdb"

-				SubSystem="2"

-				RandomizedBaseAddress="1"

-				DataExecutionPrevention="0"

-				TargetMachine="1"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|x64"

-			OutputDirectory="$(PlatformName)\$(ConfigurationName)"

-			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\release.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				PreprocessorDefinitions="NDEBUG"

-				MkTypLibCompatible="true"

-				SuppressStartupBanner="true"

-				TargetEnvironment="3"

-				TypeLibraryName=".\..\..\lib\distutils\command\wininst.tlb"

-				HeaderFileName=""

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="1"

-				InlineFunctionExpansion="1"

-				AdditionalIncludeDirectories="..\..\PC\bdist_wininst;..\..\Include;..\..\Modules\zlib"

-				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"

-				StringPooling="true"

-				RuntimeLibrary="0"

-				EnableFunctionLevelLinking="true"

-				WarningLevel="3"

-				SuppressStartupBanner="true"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-				PreprocessorDefinitions="NDEBUG"

-				Culture="0"

-				AdditionalIncludeDirectories="..\..\PC;..\..\PC\bdist_wininst;..\..\Include"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="comctl32.lib imagehlp.lib"

-				OutputFile="..\..\lib\distutils\command\wininst-8.0-amd64.exe"

-				LinkIncremental="1"

-				SuppressStartupBanner="true"

-				IgnoreDefaultLibraryNames="LIBC"

-				ProgramDatabaseFile="..\..\lib\distutils\command\wininst-8.0-amd64.pdb"

-				SubSystem="2"

-				RandomizedBaseAddress="1"

-				DataExecutionPrevention="0"

-				TargetMachine="17"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<Filter

-			Name="Source Files"

-			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"

-			>

-			<File

-				RelativePath="..\..\PC\bdist_wininst\extract.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\PC\bdist_wininst\install.c"

-				>

-			</File>

-			<Filter

-				Name="zlib"

-				>

-				<File

-					RelativePath="..\..\Modules\zlib\adler32.c"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\zlib\crc32.c"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\zlib\inffast.c"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\zlib\inflate.c"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\zlib\inftrees.c"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\zlib\zutil.c"

-					>

-				</File>

-			</Filter>

-		</Filter>

-		<Filter

-			Name="Header Files"

-			Filter="h;hpp;hxx;hm;inl"

-			>

-			<File

-				RelativePath="..\..\PC\bdist_wininst\archive.h"

-				>

-			</File>

-		</Filter>

-		<Filter

-			Name="Resource Files"

-			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"

-			>

-			<File

-				RelativePath="..\..\PC\bdist_wininst\install.rc"

-				>

-			</File>

-			<File

-				RelativePath="..\..\PC\bdist_wininst\PythonPowered.bmp"

-				>

-			</File>

-		</Filter>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS8.0/build.bat b/PC/VS8.0/build.bat
deleted file mode 100644
index 9bc8186..0000000
--- a/PC/VS8.0/build.bat
+++ /dev/null
@@ -1,17 +0,0 @@
-@echo off
-rem A batch program to build or rebuild a particular configuration.
-rem just for convenience.
-
-setlocal
-set platf=Win32
-set conf=Release
-set build=/build
-
-:CheckOpts
-if "%1"=="-c" (set conf=%2)     & shift & shift & goto CheckOpts
-if "%1"=="-p" (set platf=%2) & shift & shift & goto CheckOpts
-if "%1"=="-r" (set build=/rebuild)    & shift & goto CheckOpts
-
-set cmd=devenv pcbuild.sln %build% "%conf%|%platf%"
-echo %cmd%
-%cmd%
diff --git a/PC/VS8.0/build_env.bat b/PC/VS8.0/build_env.bat
deleted file mode 100644
index 4c67ae3..0000000
--- a/PC/VS8.0/build_env.bat
+++ /dev/null
@@ -1 +0,0 @@
-@%comspec% /k env.bat %*
diff --git a/PC/VS8.0/build_pgo.bat b/PC/VS8.0/build_pgo.bat
deleted file mode 100644
index a37b5bf..0000000
--- a/PC/VS8.0/build_pgo.bat
+++ /dev/null
@@ -1,41 +0,0 @@
-@echo off
-rem A batch program to build PGO (Profile guided optimization) by first
-rem building instrumented binaries, then running the testsuite, and
-rem finally building the optimized code.
-rem Note, after the first instrumented run, one can just keep on
-rem building the PGUpdate configuration while developing.
-
-setlocal
-set platf=Win32
-
-rem use the performance testsuite.  This is quick and simple
-set job1=..\..\tools\pybench\pybench.py -n 1 -C 1 --with-gc
-set path1=..\..\tools\pybench
-
-rem or the whole testsuite for more thorough testing
-set job2=..\..\lib\test\regrtest.py
-set path2=..\..\lib
-
-set job=%job1%
-set clrpath=%path1%
-
-:CheckOpts
-if "%1"=="-p" (set platf=%2) & shift & shift & goto CheckOpts
-if "%1"=="-2" (set job=%job2%) & (set clrpath=%path2%) & shift & goto CheckOpts
-
-set PGI=%platf%-pgi
-set PGO=%platf%-pgo
-
-@echo on
-rem build the instrumented version
-call build -p %platf% -c PGInstrument
-
-rem remove .pyc files, .pgc files and execute the job
-%PGI%\python.exe rmpyc.py %clrpath%
-del %PGI%\*.pgc
-%PGI%\python.exe %job%
-
-rem finally build the optimized version
-if exist %PGO% del /s /q %PGO%
-call build -p %platf% -c PGUpdate
-
diff --git a/PC/VS8.0/build_ssl.bat b/PC/VS8.0/build_ssl.bat
deleted file mode 100644
index 357b08b..0000000
--- a/PC/VS8.0/build_ssl.bat
+++ /dev/null
@@ -1,12 +0,0 @@
-@echo off
-if not defined HOST_PYTHON (
-  if %1 EQU Debug (
-    set HOST_PYTHON=python_d.exe
-    if not exist python33_d.dll exit 1
-  ) ELSE (
-    set HOST_PYTHON=python.exe
-    if not exist python33.dll exit 1
-  )
-)
-%HOST_PYTHON% build_ssl.py %1 %2 %3
-
diff --git a/PC/VS8.0/build_ssl.py b/PC/VS8.0/build_ssl.py
deleted file mode 100644
index dc13ef5..0000000
--- a/PC/VS8.0/build_ssl.py
+++ /dev/null
@@ -1,277 +0,0 @@
-# Script for building the _ssl and _hashlib modules for Windows.
-# Uses Perl to setup the OpenSSL environment correctly
-# and build OpenSSL, then invokes a simple nmake session
-# for the actual _ssl.pyd and _hashlib.pyd DLLs.
-
-# THEORETICALLY, you can:
-# * Unpack the latest SSL release one level above your main Python source
-#   directory.  It is likely you will already find the zlib library and
-#   any other external packages there.
-# * Install ActivePerl and ensure it is somewhere on your path.
-# * Run this script from the PC/VS8.0 directory.
-#
-# it should configure and build SSL, then build the _ssl and _hashlib
-# Python extensions without intervention.
-
-# Modified by Christian Heimes
-# Now this script supports pre-generated makefiles and assembly files.
-# Developers don't need an installation of Perl anymore to build Python. A svn
-# checkout from our svn repository is enough.
-#
-# In Order to create the files in the case of an update you still need Perl.
-# Run build_ssl in this order:
-# python.exe build_ssl.py Release x64
-# python.exe build_ssl.py Release Win32
-
-import os, sys, re, shutil
-
-# Find all "foo.exe" files on the PATH.
-def find_all_on_path(filename, extras = None):
-    entries = os.environ["PATH"].split(os.pathsep)
-    ret = []
-    for p in entries:
-        fname = os.path.abspath(os.path.join(p, filename))
-        if os.path.isfile(fname) and fname not in ret:
-            ret.append(fname)
-    if extras:
-        for p in extras:
-            fname = os.path.abspath(os.path.join(p, filename))
-            if os.path.isfile(fname) and fname not in ret:
-                ret.append(fname)
-    return ret
-
-# Find a suitable Perl installation for OpenSSL.
-# cygwin perl does *not* work.  ActivePerl does.
-# Being a Perl dummy, the simplest way I can check is if the "Win32" package
-# is available.
-def find_working_perl(perls):
-    for perl in perls:
-        fh = os.popen('"%s" -e "use Win32;"' % perl)
-        fh.read()
-        rc = fh.close()
-        if rc:
-            continue
-        return perl
-    print("Can not find a suitable PERL:")
-    if perls:
-        print(" the following perl interpreters were found:")
-        for p in perls:
-            print(" ", p)
-        print(" None of these versions appear suitable for building OpenSSL")
-    else:
-        print(" NO perl interpreters were found on this machine at all!")
-    print(" Please install ActivePerl and ensure it appears on your path")
-    return None
-
-# Locate the best SSL directory given a few roots to look into.
-def find_best_ssl_dir(sources):
-    candidates = []
-    for s in sources:
-        try:
-            # note: do not abspath s; the build will fail if any
-            # higher up directory name has spaces in it.
-            fnames = os.listdir(s)
-        except os.error:
-            fnames = []
-        for fname in fnames:
-            fqn = os.path.join(s, fname)
-            if os.path.isdir(fqn) and fname.startswith("openssl-"):
-                candidates.append(fqn)
-    # Now we have all the candidates, locate the best.
-    best_parts = []
-    best_name = None
-    for c in candidates:
-        parts = re.split("[.-]", os.path.basename(c))[1:]
-        # eg - openssl-0.9.7-beta1 - ignore all "beta" or any other qualifiers
-        if len(parts) >= 4:
-            continue
-        if parts > best_parts:
-            best_parts = parts
-            best_name = c
-    if best_name is not None:
-        print("Found an SSL directory at '%s'" % (best_name,))
-    else:
-        print("Could not find an SSL directory in '%s'" % (sources,))
-    sys.stdout.flush()
-    return best_name
-
-def create_makefile64(makefile, m32):
-    """Create and fix makefile for 64bit
-
-    Replace 32 with 64bit directories
-    """
-    if not os.path.isfile(m32):
-        return
-    with open(m32) as fin:
-        with open(makefile, 'w') as fout:
-            for line in fin:
-                line = line.replace("=tmp32", "=tmp64")
-                line = line.replace("=out32", "=out64")
-                line = line.replace("=inc32", "=inc64")
-                # force 64 bit machine
-                line = line.replace("MKLIB=lib", "MKLIB=lib /MACHINE:X64")
-                line = line.replace("LFLAGS=", "LFLAGS=/MACHINE:X64 ")
-                # don't link against the lib on 64bit systems
-                line = line.replace("bufferoverflowu.lib", "")
-                fout.write(line)
-    os.unlink(m32)
-
-def fix_makefile(makefile):
-    """Fix some stuff in all makefiles
-    """
-    if not os.path.isfile(makefile):
-        return
-    with open(makefile) as fin:
-        lines = fin.readlines()
-    with open(makefile, 'w') as fout:
-        for line in lines:
-            if line.startswith("PERL="):
-                continue
-            if line.startswith("CP="):
-                line = "CP=copy\n"
-            if line.startswith("MKDIR="):
-                line = "MKDIR=mkdir\n"
-            if line.startswith("CFLAG="):
-                line = line.strip()
-                for algo in ("RC5", "MDC2", "IDEA"):
-                    noalgo = " -DOPENSSL_NO_%s" % algo
-                    if noalgo not in line:
-                        line = line + noalgo
-                line = line + '\n'
-            fout.write(line)
-
-def run_configure(configure, do_script):
-    print("perl Configure "+configure+" no-idea no-mdc2")
-    os.system("perl Configure "+configure+" no-idea no-mdc2")
-    print(do_script)
-    os.system(do_script)
-
-def cmp(f1, f2):
-    bufsize = 1024 * 8
-    with open(f1, 'rb') as fp1, open(f2, 'rb') as fp2:
-        while True:
-            b1 = fp1.read(bufsize)
-            b2 = fp2.read(bufsize)
-            if b1 != b2:
-                return False
-            if not b1:
-                return True
-
-def copy(src, dst):
-    if os.path.isfile(dst) and cmp(src, dst):
-        return
-    shutil.copy(src, dst)
-
-def main():
-    build_all = "-a" in sys.argv
-    if sys.argv[1] == "Release":
-        debug = False
-    elif sys.argv[1] == "Debug":
-        debug = True
-    else:
-        raise ValueError(str(sys.argv))
-
-    if sys.argv[2] == "Win32":
-        arch = "x86"
-        configure = "VC-WIN32"
-        do_script = "ms\\do_nasm"
-        makefile="ms\\nt.mak"
-        m32 = makefile
-        dirsuffix = "32"
-    elif sys.argv[2] == "x64":
-        arch="amd64"
-        configure = "VC-WIN64A"
-        do_script = "ms\\do_win64a"
-        makefile = "ms\\nt64.mak"
-        m32 = makefile.replace('64', '')
-        dirsuffix = "64"
-        #os.environ["VSEXTCOMP_USECL"] = "MS_OPTERON"
-    else:
-        raise ValueError(str(sys.argv))
-
-    make_flags = ""
-    if build_all:
-        make_flags = "-a"
-    # perl should be on the path, but we also look in "\perl" and "c:\\perl"
-    # as "well known" locations
-    perls = find_all_on_path("perl.exe", ["\\perl\\bin", "C:\\perl\\bin"])
-    perl = find_working_perl(perls)
-    if perl:
-        print("Found a working perl at '%s'" % (perl,))
-    else:
-        print("No Perl installation was found. Existing Makefiles are used.")
-    sys.stdout.flush()
-    # Look for SSL 3 levels up from PC/VS8.0 - ie, same place zlib etc all live.
-    ssl_dir = find_best_ssl_dir(("..\\..\\..",))
-    if ssl_dir is None:
-        sys.exit(1)
-
-    old_cd = os.getcwd()
-    try:
-        os.chdir(ssl_dir)
-        # rebuild makefile when we do the role over from 32 to 64 build
-        if arch == "amd64" and os.path.isfile(m32) and not os.path.isfile(makefile):
-            os.unlink(m32)
-
-        # If the ssl makefiles do not exist, we invoke Perl to generate them.
-        # Due to a bug in this script, the makefile sometimes ended up empty
-        # Force a regeneration if it is.
-        if not os.path.isfile(makefile) or os.path.getsize(makefile)==0:
-            if perl is None:
-                print("Perl is required to build the makefiles!")
-                sys.exit(1)
-
-            print("Creating the makefiles...")
-            sys.stdout.flush()
-            # Put our working Perl at the front of our path
-            os.environ["PATH"] = os.path.dirname(perl) + \
-                                          os.pathsep + \
-                                          os.environ["PATH"]
-            run_configure(configure, do_script)
-            if debug:
-                print("OpenSSL debug builds aren't supported.")
-            #if arch=="x86" and debug:
-            #    # the do_masm script in openssl doesn't generate a debug
-            #    # build makefile so we generate it here:
-            #    os.system("perl util\mk1mf.pl debug "+configure+" >"+makefile)
-
-            if arch == "amd64":
-                create_makefile64(makefile, m32)
-            fix_makefile(makefile)
-            copy(r"crypto\buildinf.h", r"crypto\buildinf_%s.h" % arch)
-            copy(r"crypto\opensslconf.h", r"crypto\opensslconf_%s.h" % arch)
-
-        # If the assembler files don't exist in tmpXX, copy them there
-        if perl is None and os.path.exists("asm"+dirsuffix):
-            if not os.path.exists("tmp"+dirsuffix):
-                os.mkdir("tmp"+dirsuffix)
-            for f in os.listdir("asm"+dirsuffix):
-                if not f.endswith(".asm"): continue
-                if os.path.isfile(r"tmp%s\%s" % (dirsuffix, f)): continue
-                shutil.copy(r"asm%s\%s" % (dirsuffix, f), "tmp"+dirsuffix)
-
-        # Now run make.
-        if arch == "amd64":
-            rc = os.system("ml64 -c -Foms\\uptable.obj ms\\uptable.asm")
-            if rc:
-                print("ml64 assembler has failed.")
-                sys.exit(rc)
-
-        copy(r"crypto\buildinf_%s.h" % arch, r"crypto\buildinf.h")
-        copy(r"crypto\opensslconf_%s.h" % arch, r"crypto\opensslconf.h")
-
-        #makeCommand = "nmake /nologo PERL=\"%s\" -f \"%s\"" %(perl, makefile)
-        makeCommand = "nmake /nologo -f \"%s\"" % makefile
-        print("Executing ssl makefiles:", makeCommand)
-        sys.stdout.flush()
-        rc = os.system(makeCommand)
-        if rc:
-            print("Executing "+makefile+" failed")
-            print(rc)
-            sys.exit(rc)
-    finally:
-        os.chdir(old_cd)
-    sys.exit(rc)
-
-if __name__=='__main__':
-    main()
diff --git a/PC/VS8.0/build_tkinter.py b/PC/VS8.0/build_tkinter.py
deleted file mode 100644
index ea59039..0000000
--- a/PC/VS8.0/build_tkinter.py
+++ /dev/null
@@ -1,85 +0,0 @@
-"""Script to compile the dependencies of _tkinter
-
-Copyright (c) 2007 by Christian Heimes <christian@cheimes.de>
-
-Licensed to PSF under a Contributor Agreement.
-"""
-
-import os
-import sys
-
-here = os.path.abspath(os.path.dirname(__file__))
-par = os.path.pardir
-
-if 1:
-    TCL = "tcl8.4.16"
-    TK = "tk8.4.16"
-    TIX = "tix-8.4.0"
-else:
-    TCL = "tcl8.5b3"
-    TK = "tcl8.5b3"
-    TIX = "Tix8.4.2"
-
-ROOT = os.path.abspath(os.path.join(here, par, par, par))
-# Windows 2000 compatibility: WINVER 0x0500
-# http://msdn2.microsoft.com/en-us/library/aa383745.aspx
-NMAKE = "nmake /nologo /f %s COMPILERFLAGS=-DWINVER=0x0500 %s %s"
-
-def nmake(makefile, command="", **kw):
-    defines = ' '.join(k+'='+v for k, v in kw.items())
-    cmd = NMAKE % (makefile, defines, command)
-    print("\n\n"+cmd+"\n")
-    if os.system(cmd) != 0:
-        raise RuntimeError(cmd)
-
-def build(platform, clean):
-    if platform == "Win32":
-        dest = os.path.join(ROOT, "tcltk")
-        machine = "X86"
-    elif platform == "x64":
-        dest = os.path.join(ROOT, "tcltk64")
-        machine = "X64"
-    else:
-        raise ValueError(platform)
-
-    # TCL
-    tcldir = os.path.join(ROOT, TCL)
-    if 1:
-        os.chdir(os.path.join(tcldir, "win"))
-        if clean:
-            nmake("makefile.vc", "clean")
-        nmake("makefile.vc")
-        nmake("makefile.vc", "install", INSTALLDIR=dest)
-
-    # TK
-    if 1:
-        os.chdir(os.path.join(ROOT, TK, "win"))
-        if clean:
-            nmake("makefile.vc", "clean", TCLDIR=tcldir)
-        nmake("makefile.vc", TCLDIR=tcldir)
-        nmake("makefile.vc", "install", TCLDIR=tcldir, INSTALLDIR=dest)
-
-    # TIX
-    if 1:
-        # python9.mak is available at http://svn.python.org
-        os.chdir(os.path.join(ROOT, TIX, "win"))
-        if clean:
-            nmake("python9.mak", "clean")
-        nmake("python9.mak", MACHINE=machine)
-        nmake("python9.mak", "install")
-
-def main():
-    if len(sys.argv) < 2 or sys.argv[1] not in ("Win32", "x64"):
-        print("%s Win32|x64" % sys.argv[0])
-        sys.exit(1)
-
-    if "-c" in sys.argv:
-        clean = True
-    else:
-        clean = False
-
-    build(sys.argv[1], clean)
-
-
-if __name__ == '__main__':
-    main()
diff --git a/PC/VS8.0/bz2.vcproj b/PC/VS8.0/bz2.vcproj
deleted file mode 100644
index 1f11979..0000000
--- a/PC/VS8.0/bz2.vcproj
+++ /dev/null
@@ -1,581 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="8.00"

-	Name="bz2"

-	ProjectGUID="{73FCD2BD-F133-46B7-8EC1-144CD82A59D5}"

-	RootNamespace="bz2"

-	Keyword="Win32Proj"

-	TargetFrameworkVersion="196613"

-	>

-	<Platforms>

-		<Platform

-			Name="Win32"

-		/>

-		<Platform

-			Name="x64"

-		/>

-	</Platforms>

-	<ToolFiles>

-	</ToolFiles>

-	<Configurations>

-		<Configuration

-			Name="Debug|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd_d.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="$(bz2Dir)"

-				PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				BaseAddress="0x1D170000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Debug|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd_d.vsprops;.\x64.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="$(bz2Dir)"

-				PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				BaseAddress="0x1D170000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="$(bz2Dir)"

-				PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				BaseAddress="0x1D170000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="$(bz2Dir)"

-				PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				BaseAddress="0x1D170000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\pginstrument.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="$(bz2Dir)"

-				PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				BaseAddress="0x1D170000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops;.\pginstrument.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="$(bz2Dir)"

-				PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				BaseAddress="0x1D170000"

-				TargetMachine="17"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\pgupdate.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="$(bz2Dir)"

-				PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				BaseAddress="0x1D170000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops;.\pgupdate.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="$(bz2Dir)"

-				PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				BaseAddress="0x1D170000"

-				TargetMachine="17"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<Filter

-			Name="Source Files"

-			>

-			<File

-				RelativePath="..\..\Modules\bz2module.c"

-				>

-			</File>

-		</Filter>

-		<Filter

-			Name="bzip2 1.0.6 Header Files"

-			>

-			<File

-				RelativePath="$(bz2Dir)\bzlib.h"

-				>

-			</File>

-			<File

-				RelativePath="$(bz2Dir)\bzlib_private.h"

-				>

-			</File>

-		</Filter>

-		<Filter

-			Name="bzip2 1.0.6 Source Files"

-			>

-			<File

-				RelativePath="$(bz2Dir)\blocksort.c"

-				>

-			</File>

-			<File

-				RelativePath="$(bz2Dir)\bzlib.c"

-				>

-			</File>

-			<File

-				RelativePath="$(bz2Dir)\compress.c"

-				>

-			</File>

-			<File

-				RelativePath="$(bz2Dir)\crctable.c"

-				>

-			</File>

-			<File

-				RelativePath="$(bz2Dir)\decompress.c"

-				>

-			</File>

-			<File

-				RelativePath="$(bz2Dir)\huffman.c"

-				>

-			</File>

-			<File

-				RelativePath="$(bz2Dir)\randtable.c"

-				>

-			</File>

-		</Filter>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS8.0/debug.vsprops b/PC/VS8.0/debug.vsprops
deleted file mode 100644
index bc643cb..0000000
--- a/PC/VS8.0/debug.vsprops
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioPropertySheet

-	ProjectType="Visual C++"

-	Version="8.00"

-	Name="debug"

-	>

-	<Tool

-		Name="VCCLCompilerTool"

-		PreprocessorDefinitions="_DEBUG"

-	/>

-	<UserMacro

-		Name="KillPythonExe"

-		Value="$(OutDir)\kill_python_d.exe"

-	/>

-</VisualStudioPropertySheet>

diff --git a/PC/VS8.0/env.bat b/PC/VS8.0/env.bat
deleted file mode 100644
index a4990a8..0000000
--- a/PC/VS8.0/env.bat
+++ /dev/null
@@ -1,5 +0,0 @@
-@echo off
-set VS8=%ProgramFiles%\Microsoft Visual Studio 8
-echo Build environments: x86, ia64, amd64, x86_amd64, x86_ia64
-echo.
-call "%VS8%\VC\vcvarsall.bat" %1
diff --git a/PC/VS8.0/field3.py b/PC/VS8.0/field3.py
deleted file mode 100644
index edcbe36..0000000
--- a/PC/VS8.0/field3.py
+++ /dev/null
@@ -1,35 +0,0 @@
-# An absurd workaround for the lack of arithmetic in MS's resource compiler.
-# After building Python, run this, then paste the output into the appropriate
-# part of PC\python_nt.rc.
-# Example output:
-#
-# * For 2.3a0,
-# * PY_MICRO_VERSION = 0
-# * PY_RELEASE_LEVEL = 'alpha' = 0xA
-# * PY_RELEASE_SERIAL = 1
-# *
-# * and 0*1000 + 10*10 + 1 = 101.
-# */
-# #define FIELD3 101
-
-import sys
-
-major, minor, micro, level, serial = sys.version_info
-levelnum = {'alpha': 0xA,
-            'beta': 0xB,
-            'candidate': 0xC,
-            'final': 0xF,
-           }[level]
-string = sys.version.split()[0] # like '2.3a0'
-
-print(" * For %s," % string)
-print(" * PY_MICRO_VERSION = %d" % micro)
-print(" * PY_RELEASE_LEVEL = %r = %s" % (level, hex(levelnum)))
-print(" * PY_RELEASE_SERIAL = %d" % serial)
-print(" *")
-
-field3 = micro * 1000 + levelnum * 10 + serial
-
-print(" * and %d*1000 + %d*10 + %d = %d" % (micro, levelnum, serial, field3))
-print(" */")
-print("#define FIELD3", field3)
diff --git a/PC/VS8.0/idle.bat b/PC/VS8.0/idle.bat
deleted file mode 100644
index 123e704..0000000
--- a/PC/VS8.0/idle.bat
+++ /dev/null
@@ -1,15 +0,0 @@
-@echo off
-rem start idle
-rem Usage:  idle [-d]
-rem -d   Run Debug build (python_d.exe).  Else release build.
-
-setlocal
-set exe=python
-PATH %PATH%;..\..\..\tcltk\bin
-
-if "%1"=="-d" (set exe=python_d) & shift
-
-set cmd=%exe% ../../Lib/idlelib/idle.py %1 %2 %3 %4 %5 %6 %7 %8 %9
-
-echo on
-%cmd%
diff --git a/PC/VS8.0/kill_python.c b/PC/VS8.0/kill_python.c
deleted file mode 100644
index bb323d3..0000000
--- a/PC/VS8.0/kill_python.c
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Helper program for killing lingering python[_d].exe processes before
- * building, thus attempting to avoid build failures due to files being
- * locked.
- */
-
-#include <windows.h>
-#include <wchar.h>
-#include <tlhelp32.h>
-#include <stdio.h>
-
-#pragma comment(lib, "psapi")
-
-#ifdef _DEBUG
-#define PYTHON_EXE          (L"python_d.exe")
-#define PYTHON_EXE_LEN      (12)
-#define KILL_PYTHON_EXE     (L"kill_python_d.exe")
-#define KILL_PYTHON_EXE_LEN (17)
-#else
-#define PYTHON_EXE          (L"python.exe")
-#define PYTHON_EXE_LEN      (10)
-#define KILL_PYTHON_EXE     (L"kill_python.exe")
-#define KILL_PYTHON_EXE_LEN (15)
-#endif
-
-int
-main(int argc, char **argv)
-{
-    HANDLE   hp, hsp, hsm; /* process, snapshot processes, snapshot modules */
-    DWORD    dac, our_pid;
-    size_t   len;
-    wchar_t  path[MAX_PATH+1];
-
-    MODULEENTRY32W  me;
-    PROCESSENTRY32W pe;
-
-    me.dwSize = sizeof(MODULEENTRY32W);
-    pe.dwSize = sizeof(PROCESSENTRY32W);
-
-    memset(path, 0, MAX_PATH+1);
-
-    our_pid = GetCurrentProcessId();
-
-    hsm = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, our_pid);
-    if (hsm == INVALID_HANDLE_VALUE) {
-        printf("CreateToolhelp32Snapshot[1] failed: %d\n", GetLastError());
-        return 1;
-    }
-
-    if (!Module32FirstW(hsm, &me)) {
-        printf("Module32FirstW[1] failed: %d\n", GetLastError());
-        CloseHandle(hsm);
-        return 1;
-    }
-
-    /*
-     * Enumerate over the modules for the current process in order to find
-     * kill_process[_d].exe, then take a note of the directory it lives in.
-     */
-    do {
-        if (_wcsnicmp(me.szModule, KILL_PYTHON_EXE, KILL_PYTHON_EXE_LEN))
-            continue;
-
-        len = wcsnlen_s(me.szExePath, MAX_PATH) - KILL_PYTHON_EXE_LEN;
-        wcsncpy_s(path, MAX_PATH+1, me.szExePath, len); 
-
-        break;
-
-    } while (Module32NextW(hsm, &me));
-
-    CloseHandle(hsm);
-
-    if (path == NULL) {
-        printf("failed to discern directory of running process\n");
-        return 1;
-    }
-
-    /*
-     * Take a snapshot of system processes.  Enumerate over the snapshot,
-     * looking for python processes.  When we find one, verify it lives
-     * in the same directory we live in.  If it does, kill it.  If we're
-     * unable to kill it, treat this as a fatal error and return 1.
-     * 
-     * The rationale behind this is that we're called at the start of the 
-     * build process on the basis that we'll take care of killing any
-     * running instances, such that the build won't encounter permission
-     * denied errors during linking. If we can't kill one of the processes,
-     * we can't provide this assurance, and the build shouldn't start.
-     */
-
-    hsp = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
-    if (hsp == INVALID_HANDLE_VALUE) {
-        printf("CreateToolhelp32Snapshot[2] failed: %d\n", GetLastError());
-        return 1;
-    }
-
-    if (!Process32FirstW(hsp, &pe)) {
-        printf("Process32FirstW failed: %d\n", GetLastError());
-        CloseHandle(hsp);
-        return 1;
-    }
-
-    dac = PROCESS_QUERY_INFORMATION | PROCESS_VM_READ | PROCESS_TERMINATE;
-    do {
-
-        /*
-         * XXX TODO: if we really wanted to be fancy, we could check the 
-         * modules for all processes (not just the python[_d].exe ones)
-         * and see if any of our DLLs are loaded (i.e. python33[_d].dll),
-         * as that would also inhibit our ability to rebuild the solution.
-         * Not worth loosing sleep over though; for now, a simple check 
-         * for just the python executable should be sufficient.
-         */
-
-        if (_wcsnicmp(pe.szExeFile, PYTHON_EXE, PYTHON_EXE_LEN))
-            /* This isn't a python process. */
-            continue;
-
-        /* It's a python process, so figure out which directory it's in... */
-        hsm = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, pe.th32ProcessID);
-        if (hsm == INVALID_HANDLE_VALUE)
-            /* 
-             * If our module snapshot fails (which will happen if we don't own
-             * the process), just ignore it and continue.  (It seems different
-             * versions of Windows return different values for GetLastError()
-             * in this situation; it's easier to just ignore it and move on vs.
-             * stopping the build for what could be a false positive.)
-             */
-             continue;
-
-        if (!Module32FirstW(hsm, &me)) {
-            printf("Module32FirstW[2] failed: %d\n", GetLastError());
-            CloseHandle(hsp);
-            CloseHandle(hsm);
-            return 1;
-        }
-
-        do {
-            if (_wcsnicmp(me.szModule, PYTHON_EXE, PYTHON_EXE_LEN))
-                /* Wrong module, we're looking for python[_d].exe... */
-                continue;
-
-            if (_wcsnicmp(path, me.szExePath, len))
-                /* Process doesn't live in our directory. */
-                break;
-
-            /* Python process residing in the right directory, kill it!  */
-            hp = OpenProcess(dac, FALSE, pe.th32ProcessID);
-            if (!hp) {
-                printf("OpenProcess failed: %d\n", GetLastError());
-                CloseHandle(hsp);
-                CloseHandle(hsm);
-                return 1;
-            }
-
-            if (!TerminateProcess(hp, 1)) {
-                printf("TerminateProcess failed: %d\n", GetLastError());
-                CloseHandle(hsp);
-                CloseHandle(hsm);
-                CloseHandle(hp);
-                return 1;
-            }
-
-            CloseHandle(hp);
-            break;
-
-        } while (Module32NextW(hsm, &me));
-
-        CloseHandle(hsm);
-
-    } while (Process32NextW(hsp, &pe));
-
-    CloseHandle(hsp);
-
-    return 0;
-}
-
-/* vi: set ts=8 sw=4 sts=4 expandtab */
diff --git a/PC/VS8.0/kill_python.vcproj b/PC/VS8.0/kill_python.vcproj
deleted file mode 100644
index e9be330..0000000
--- a/PC/VS8.0/kill_python.vcproj
+++ /dev/null
@@ -1,279 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="8.00"

-	Name="kill_python"

-	ProjectGUID="{6DE10744-E396-40A5-B4E2-1B69AA7C8D31}"

-	RootNamespace="kill_python"

-	Keyword="Win32Proj"

-	TargetFrameworkVersion="196613"

-	>

-	<Platforms>

-		<Platform

-			Name="Win32"

-		/>

-		<Platform

-			Name="x64"

-		/>

-	</Platforms>

-	<ToolFiles>

-	</ToolFiles>

-	<Configurations>

-		<Configuration

-			Name="Debug|Win32"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\debug.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				OutputFile="$(OutDir)\$(ProjectName)_d.exe"

-				SubSystem="1"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Debug|x64"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\debug.vsprops;.\x64.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				OutputFile="$(OutDir)\$(ProjectName)_d.exe"

-				SubSystem="1"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|Win32"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\release.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				SubSystem="1"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|x64"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\release.vsprops;.\x64.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				SubSystem="1"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<Filter

-			Name="Source Files"

-			>

-			<File

-				RelativePath=".\kill_python.c"

-				>

-			</File>

-		</Filter>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS8.0/make_buildinfo.c b/PC/VS8.0/make_buildinfo.c
deleted file mode 100644
index 8efa07a..0000000
--- a/PC/VS8.0/make_buildinfo.c
+++ /dev/null
@@ -1,116 +0,0 @@
-#include <windows.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <stdio.h>
-
-#define CMD_SIZE 500
-
-/* This file creates the getbuildinfo.o object, by first
-   invoking subwcrev.exe (if found), and then invoking cl.exe.
-   As a side effect, it might generate PCBuild\getbuildinfo2.c
-   also. If this isn't a subversion checkout, or subwcrev isn't
-   found, it compiles ..\\..\\Modules\\getbuildinfo.c instead.
-
-   Currently, subwcrev.exe is found from the registry entries
-   of TortoiseSVN.
-
-   No attempt is made to place getbuildinfo.o into the proper
-   binary directory. This isn't necessary, as this tool is
-   invoked as a pre-link step for pythoncore, so that overwrites
-   any previous getbuildinfo.o.
-
-   However, if a second argument is provided, this will be used
-   as a temporary directory where any getbuildinfo2.c and
-   getbuildinfo.o files are put.  This is useful if multiple
-   configurations are being built in parallel, to avoid them
-   trampling each other's files.
-
-*/
-
-int make_buildinfo2(const char *tmppath)
-{
-    struct _stat st;
-    HKEY hTortoise;
-    char command[CMD_SIZE+1];
-    DWORD type, size;
-    if (_stat(".svn", &st) < 0)
-        return 0;
-    /* Allow suppression of subwcrev.exe invocation if a no_subwcrev file is present. */
-    if (_stat("no_subwcrev", &st) == 0)
-        return 0;
-    if (RegOpenKey(HKEY_LOCAL_MACHINE, "Software\\TortoiseSVN", &hTortoise) != ERROR_SUCCESS &&
-        RegOpenKey(HKEY_CURRENT_USER, "Software\\TortoiseSVN", &hTortoise) != ERROR_SUCCESS)
-        /* Tortoise not installed */
-        return 0;
-    command[0] = '"';  /* quote the path to the executable */
-    size = sizeof(command) - 1;
-    if (RegQueryValueEx(hTortoise, "Directory", 0, &type, command+1, &size) != ERROR_SUCCESS ||
-        type != REG_SZ)
-        /* Registry corrupted */
-        return 0;
-    strcat_s(command, CMD_SIZE, "bin\\subwcrev.exe");
-    if (_stat(command+1, &st) < 0)
-        /* subwcrev.exe not part of the release */
-        return 0;
-    strcat_s(command, CMD_SIZE, "\" ..\\.. ..\\..\\Modules\\getbuildinfo.c ");
-    strcat_s(command, CMD_SIZE, tmppath);
-    strcat_s(command, CMD_SIZE, "getbuildinfo2.c");
-    puts(command); fflush(stdout);
-    if (system(command) < 0)
-        return 0;
-    return 1;
-}
-
-int main(int argc, char*argv[])
-{
-    char command[CMD_SIZE] = "cl.exe -c -D_WIN32 -DUSE_DL_EXPORT -D_WINDOWS -DWIN32 -D_WINDLL ";
-    char tmppath[CMD_SIZE] = "";
-    int do_unlink, result;
-    char *tmpdir = NULL;
-    if (argc <= 2 || argc > 3) {
-        fprintf(stderr, "make_buildinfo $(ConfigurationName) [tmpdir]\n");
-        return EXIT_FAILURE;
-    }
-    if (strcmp(argv[1], "Release") == 0) {
-        strcat_s(command, CMD_SIZE, "-MD ");
-    }
-    else if (strcmp(argv[1], "Debug") == 0) {
-        strcat_s(command, CMD_SIZE, "-D_DEBUG -MDd ");
-    }
-    else if (strcmp(argv[1], "ReleaseItanium") == 0) {
-        strcat_s(command, CMD_SIZE, "-MD /USECL:MS_ITANIUM ");
-    }
-    else if (strcmp(argv[1], "ReleaseAMD64") == 0) {
-        strcat_s(command, CMD_SIZE, "-MD ");
-        strcat_s(command, CMD_SIZE, "-MD /USECL:MS_OPTERON ");
-    }
-    else {
-        fprintf(stderr, "unsupported configuration %s\n", argv[1]);
-        return EXIT_FAILURE;
-    }
-    if (argc > 2) {
-        tmpdir = argv[2];
-        strcat_s(tmppath, _countof(tmppath), tmpdir);
-        strcat_s(tmppath, _countof(tmppath), "\\");
-    }
-
-    if ((do_unlink = make_buildinfo2(tmppath))) {
-        strcat_s(command, CMD_SIZE, tmppath);
-        strcat_s(command, CMD_SIZE, "getbuildinfo2.c -DSUBWCREV ");
-    } else
-        strcat_s(command, CMD_SIZE, "..\\..\\Modules\\getbuildinfo.c");
-    strcat_s(command, CMD_SIZE, " -Fo");
-    strcat_s(command, CMD_SIZE, tmppath);
-    strcat_s(command, CMD_SIZE, "getbuildinfo.o -I..\\..\\Include -I..\\..\\PC");
-    puts(command); fflush(stdout);
-    result = system(command);
-    if (do_unlink) {
-        command[0] = '\0';
-        strcat_s(command, CMD_SIZE, tmppath);
-        strcat_s(command, CMD_SIZE, "getbuildinfo2.c");
-        _unlink(command);
-    }
-    if (result < 0)
-        return EXIT_FAILURE;
-    return 0;
-}
diff --git a/PC/VS8.0/make_buildinfo.vcproj b/PC/VS8.0/make_buildinfo.vcproj
deleted file mode 100644
index fb5cccd..0000000
--- a/PC/VS8.0/make_buildinfo.vcproj
+++ /dev/null
@@ -1,101 +0,0 @@
-<?xml version="1.0" encoding="windows-1250"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="8.00"

-	Name="make_buildinfo"

-	ProjectGUID="{C73F0EC1-358B-4177-940F-0846AC8B04CD}"

-	RootNamespace="make_buildinfo"

-	Keyword="Win32Proj"

-	TargetFrameworkVersion="131072"

-	>

-	<Platforms>

-		<Platform

-			Name="Win32"

-		/>

-	</Platforms>

-	<ToolFiles>

-	</ToolFiles>

-	<Configurations>

-		<Configuration

-			Name="Release|Win32"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\release.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="0"

-				InlineFunctionExpansion="1"

-				PreprocessorDefinitions="_CONSOLE"

-				RuntimeLibrary="0"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				OutputFile="$(OutDir)/make_buildinfo.exe"

-				ProgramDatabaseFile="$(TargetDir)$(TargetName).pdb"

-				SubSystem="1"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<Filter

-			Name="Source Files"

-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"

-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"

-			>

-			<File

-				RelativePath=".\make_buildinfo.c"

-				>

-			</File>

-		</Filter>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS8.0/make_versioninfo.vcproj b/PC/VS8.0/make_versioninfo.vcproj
deleted file mode 100644
index 9dbf10d..0000000
--- a/PC/VS8.0/make_versioninfo.vcproj
+++ /dev/null
@@ -1,324 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="8.00"

-	Name="make_versioninfo"

-	ProjectGUID="{F0E0541E-F17D-430B-97C4-93ADF0DD284E}"

-	RootNamespace="make_versioninfo"

-	TargetFrameworkVersion="131072"

-	>

-	<Platforms>

-		<Platform

-			Name="Win32"

-		/>

-		<Platform

-			Name="x64"

-		/>

-	</Platforms>

-	<ToolFiles>

-	</ToolFiles>

-	<Configurations>

-		<Configuration

-			Name="Release|Win32"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\release.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			CharacterSet="2"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-				Description="Build PC/pythonnt_rc(_d).h"

-				CommandLine="cd $(SolutionDir)&#x0D;&#x0A;make_versioninfo.exe &gt; ..\..\PC\pythonnt_rc.h&#x0D;&#x0A;"

-				Outputs="$(SolutionDir)..\..\PC\pythonnt_rc.h"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				EnableIntrinsicFunctions="true"

-				AdditionalIncludeDirectories=""

-				PreprocessorDefinitions="_CONSOLE"

-				StringPooling="true"

-				RuntimeLibrary="2"

-				EnableFunctionLevelLinking="true"

-				CompileAs="0"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				OutputFile="$(SolutionDir)make_versioninfo.exe"

-				ProgramDatabaseFile="$(TargetDir)$(TargetName).pdb"

-				SubSystem="1"

-				BaseAddress="0x1d000000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-				CommandLine="cd $(SolutionDir)&#x0D;&#x0A;make_versioninfo.exe &gt; ..\..\PC\python_nt.h&#x0D;&#x0A;"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|x64"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\x64.vsprops;.\release.vsprops"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-				Description="Build PC/pythonnt_rc(_d).h"

-				CommandLine="cd $(SolutionDir)&#x0D;&#x0A;make_versioninfo.exe &gt; ..\..\PC\pythonnt_rc.h&#x0D;&#x0A;"

-				Outputs="$(SolutionDir)..\..\PC\pythonnt_rc.h"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				EnableIntrinsicFunctions="true"

-				PreprocessorDefinitions="_CONSOLE"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				OutputFile="$(SolutionDir)make_versioninfo.exe"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-				CommandLine="cd $(SolutionDir)&#x0D;&#x0A;make_versioninfo.exe &gt; ..\..\PC\python_nt.h&#x0D;&#x0A;"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Debug|Win32"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\debug.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-				Description="Build PC/pythonnt_rc(_d).h"

-				CommandLine="cd $(SolutionDir)&#x0D;&#x0A;make_versioninfo_d.exe &gt; ..\..\PC\pythonnt_rc_d.h&#x0D;&#x0A;"

-				Outputs="$(SolutionDir)..\..\PC\pythonnt_rc_d.h"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="0"

-				InlineFunctionExpansion="1"

-				EnableIntrinsicFunctions="false"

-				AdditionalIncludeDirectories=""

-				PreprocessorDefinitions="_CONSOLE"

-				StringPooling="true"

-				RuntimeLibrary="2"

-				EnableFunctionLevelLinking="true"

-				CompileAs="0"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				OutputFile="$(SolutionDir)make_versioninfo_d.exe"

-				ProgramDatabaseFile="$(TargetDir)$(TargetName).pdb"

-				SubSystem="1"

-				BaseAddress="0x1d000000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-				CommandLine="cd $(SolutionDir)&#x0D;&#x0A;make_versioninfo_d.exe &gt; ..\..\PC\python_nt_d.h&#x0D;&#x0A;"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Debug|x64"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\x64.vsprops;.\debug.vsprops"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-				Description="Build PC/pythonnt_rc(_d).h"

-				CommandLine="cd $(SolutionDir)&#x0D;&#x0A;make_versioninfo_d.exe &gt; ..\..\PC\pythonnt_rc_d.h&#x0D;&#x0A;"

-				Outputs="$(SolutionDir)..\..\PC\pythonnt_rc_d.h"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="0"

-				InlineFunctionExpansion="1"

-				EnableIntrinsicFunctions="false"

-				PreprocessorDefinitions="_CONSOLE"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				OutputFile="$(SolutionDir)make_versioninfo_d.exe"

-				TargetMachine="17"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-				CommandLine="cd $(SolutionDir)&#x0D;&#x0A;make_versioninfo_d.exe &gt; ..\..\PC\python_nt_d.h&#x0D;&#x0A;"

-			/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<Filter

-			Name="Source Files"

-			>

-			<File

-				RelativePath="..\..\PC\make_versioninfo.c"

-				>

-			</File>

-		</Filter>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS8.0/pcbuild.sln b/PC/VS8.0/pcbuild.sln
deleted file mode 100644
index 9aca4aa..0000000
--- a/PC/VS8.0/pcbuild.sln
+++ /dev/null
@@ -1,560 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 9.00

-# Visual Studio 2005

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "python", "python.vcproj", "{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}"

-	ProjectSection(ProjectDependencies) = postProject

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}

-		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058} = {E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}

-	EndProjectSection

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_versioninfo", "make_versioninfo.vcproj", "{F0E0541E-F17D-430B-97C4-93ADF0DD284E}"

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythoncore", "pythoncore.vcproj", "{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}"

-	ProjectSection(ProjectDependencies) = postProject

-		{F0E0541E-F17D-430B-97C4-93ADF0DD284E} = {F0E0541E-F17D-430B-97C4-93ADF0DD284E}

-		{6DE10744-E396-40A5-B4E2-1B69AA7C8D31} = {6DE10744-E396-40A5-B4E2-1B69AA7C8D31}

-		{C73F0EC1-358B-4177-940F-0846AC8B04CD} = {C73F0EC1-358B-4177-940F-0846AC8B04CD}

-	EndProjectSection

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythonw", "pythonw.vcproj", "{F4229CC3-873C-49AE-9729-DD308ED4CD4A}"

-	ProjectSection(ProjectDependencies) = postProject

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}

-	EndProjectSection

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "w9xpopen", "w9xpopen.vcproj", "{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}"

-	ProjectSection(ProjectDependencies) = postProject

-		{6DE10744-E396-40A5-B4E2-1B69AA7C8D31} = {6DE10744-E396-40A5-B4E2-1B69AA7C8D31}

-	EndProjectSection

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_buildinfo", "make_buildinfo.vcproj", "{C73F0EC1-358B-4177-940F-0846AC8B04CD}"

-EndProject

-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{553EC33E-9816-4996-A660-5D6186A0B0B3}"

-	ProjectSection(SolutionItems) = preProject

-		..\..\Modules\getbuildinfo.c = ..\..\Modules\getbuildinfo.c

-		readme.txt = readme.txt

-	EndProjectSection

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winsound", "winsound.vcproj", "{28B5D777-DDF2-4B6B-B34F-31D938813856}"

-	ProjectSection(ProjectDependencies) = postProject

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}

-	EndProjectSection

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_ctypes", "_ctypes.vcproj", "{0E9791DB-593A-465F-98BC-681011311618}"

-	ProjectSection(ProjectDependencies) = postProject

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}

-	EndProjectSection

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_ctypes_test", "_ctypes_test.vcproj", "{9EC7190A-249F-4180-A900-548FDCF3055F}"

-	ProjectSection(ProjectDependencies) = postProject

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}

-	EndProjectSection

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_elementtree", "_elementtree.vcproj", "{17E1E049-C309-4D79-843F-AE483C264AEA}"

-	ProjectSection(ProjectDependencies) = postProject

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}

-	EndProjectSection

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_msi", "_msi.vcproj", "{31FFC478-7B4A-43E8-9954-8D03E2187E9C}"

-	ProjectSection(ProjectDependencies) = postProject

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}

-	EndProjectSection

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_socket", "_socket.vcproj", "{86937F53-C189-40EF-8CE8-8759D8E7D480}"

-	ProjectSection(ProjectDependencies) = postProject

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}

-	EndProjectSection

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_sqlite3", "_sqlite3.vcproj", "{13CECB97-4119-4316-9D42-8534019A5A44}"

-	ProjectSection(ProjectDependencies) = postProject

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}

-		{A1A295E5-463C-437F-81CA-1F32367685DA} = {A1A295E5-463C-437F-81CA-1F32367685DA}

-	EndProjectSection

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_ssl", "_ssl.vcproj", "{C6E20F84-3247-4AD6-B051-B073268F73BA}"

-	ProjectSection(ProjectDependencies) = postProject

-		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9} = {B11D750F-CD1F-4A96-85CE-E69A5C5259F9}

-		{86937F53-C189-40EF-8CE8-8759D8E7D480} = {86937F53-C189-40EF-8CE8-8759D8E7D480}

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}

-		{E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0} = {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}

-	EndProjectSection

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_testcapi", "_testcapi.vcproj", "{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}"

-	ProjectSection(ProjectDependencies) = postProject

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}

-	EndProjectSection

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_tkinter", "_tkinter.vcproj", "{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}"

-	ProjectSection(ProjectDependencies) = postProject

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}

-	EndProjectSection

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bz2", "bz2.vcproj", "{73FCD2BD-F133-46B7-8EC1-144CD82A59D5}"

-	ProjectSection(ProjectDependencies) = postProject

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}

-	EndProjectSection

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "select", "select.vcproj", "{18CAE28C-B454-46C1-87A0-493D91D97F03}"

-	ProjectSection(ProjectDependencies) = postProject

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}

-	EndProjectSection

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unicodedata", "unicodedata.vcproj", "{ECC7CEAC-A5E5-458E-BB9E-2413CC847881}"

-	ProjectSection(ProjectDependencies) = postProject

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}

-	EndProjectSection

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pyexpat", "pyexpat.vcproj", "{D06B6426-4762-44CC-8BAD-D79052507F2F}"

-	ProjectSection(ProjectDependencies) = postProject

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}

-	EndProjectSection

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bdist_wininst", "bdist_wininst.vcproj", "{EB1C19C1-1F18-421E-9735-CAEE69DC6A3C}"

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_hashlib", "_hashlib.vcproj", "{447F05A8-F581-4CAC-A466-5AC7936E207E}"

-	ProjectSection(ProjectDependencies) = postProject

-		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9} = {B11D750F-CD1F-4A96-85CE-E69A5C5259F9}

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}

-		{E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0} = {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}

-	EndProjectSection

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sqlite3", "sqlite3.vcproj", "{A1A295E5-463C-437F-81CA-1F32367685DA}"

-	ProjectSection(ProjectDependencies) = postProject

-		{6DE10744-E396-40A5-B4E2-1B69AA7C8D31} = {6DE10744-E396-40A5-B4E2-1B69AA7C8D31}

-	EndProjectSection

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_multiprocessing", "_multiprocessing.vcproj", "{9E48B300-37D1-11DD-8C41-005056C00008}"

-	ProjectSection(ProjectDependencies) = postProject

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}

-	EndProjectSection

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ssl", "ssl.vcproj", "{E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}"

-	ProjectSection(ProjectDependencies) = postProject

-		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9} = {B11D750F-CD1F-4A96-85CE-E69A5C5259F9}

-	EndProjectSection

-EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "kill_python", "kill_python.vcproj", "{6DE10744-E396-40A5-B4E2-1B69AA7C8D31}"

-EndProject

-Global

-	GlobalSection(SolutionConfigurationPlatforms) = preSolution

-		Debug|Win32 = Debug|Win32

-		Debug|x64 = Debug|x64

-		PGInstrument|Win32 = PGInstrument|Win32

-		PGInstrument|x64 = PGInstrument|x64

-		PGUpdate|Win32 = PGUpdate|Win32

-		PGUpdate|x64 = PGUpdate|x64

-		Release|Win32 = Release|Win32

-		Release|x64 = Release|x64

-	EndGlobalSection

-	GlobalSection(ProjectConfigurationPlatforms) = postSolution

-		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.Debug|Win32.ActiveCfg = Debug|Win32

-		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.Debug|Win32.Build.0 = Debug|Win32

-		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.Debug|x64.ActiveCfg = Debug|x64

-		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.Debug|x64.Build.0 = Debug|x64

-		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32

-		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.PGInstrument|Win32.Build.0 = PGInstrument|Win32

-		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.PGInstrument|x64.ActiveCfg = PGInstrument|x64

-		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.PGInstrument|x64.Build.0 = PGInstrument|x64

-		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32

-		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.PGUpdate|Win32.Build.0 = PGUpdate|Win32

-		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.PGUpdate|x64.ActiveCfg = PGUpdate|x64

-		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.PGUpdate|x64.Build.0 = PGUpdate|x64

-		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.Release|Win32.ActiveCfg = Release|Win32

-		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.Release|Win32.Build.0 = Release|Win32

-		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.Release|x64.ActiveCfg = Release|x64

-		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.Release|x64.Build.0 = Release|x64

-		{F0E0541E-F17D-430B-97C4-93ADF0DD284E}.Debug|Win32.ActiveCfg = Debug|Win32

-		{F0E0541E-F17D-430B-97C4-93ADF0DD284E}.Debug|Win32.Build.0 = Debug|Win32

-		{F0E0541E-F17D-430B-97C4-93ADF0DD284E}.Debug|x64.ActiveCfg = Debug|Win32

-		{F0E0541E-F17D-430B-97C4-93ADF0DD284E}.Debug|x64.Build.0 = Debug|Win32

-		{F0E0541E-F17D-430B-97C4-93ADF0DD284E}.PGInstrument|Win32.ActiveCfg = Release|Win32

-		{F0E0541E-F17D-430B-97C4-93ADF0DD284E}.PGInstrument|Win32.Build.0 = Release|Win32

-		{F0E0541E-F17D-430B-97C4-93ADF0DD284E}.PGInstrument|x64.ActiveCfg = Release|Win32

-		{F0E0541E-F17D-430B-97C4-93ADF0DD284E}.PGInstrument|x64.Build.0 = Release|Win32

-		{F0E0541E-F17D-430B-97C4-93ADF0DD284E}.PGUpdate|Win32.ActiveCfg = Release|Win32

-		{F0E0541E-F17D-430B-97C4-93ADF0DD284E}.PGUpdate|Win32.Build.0 = Release|Win32

-		{F0E0541E-F17D-430B-97C4-93ADF0DD284E}.PGUpdate|x64.ActiveCfg = Release|Win32

-		{F0E0541E-F17D-430B-97C4-93ADF0DD284E}.PGUpdate|x64.Build.0 = Release|Win32

-		{F0E0541E-F17D-430B-97C4-93ADF0DD284E}.Release|Win32.ActiveCfg = Release|Win32

-		{F0E0541E-F17D-430B-97C4-93ADF0DD284E}.Release|Win32.Build.0 = Release|Win32

-		{F0E0541E-F17D-430B-97C4-93ADF0DD284E}.Release|x64.ActiveCfg = Release|Win32

-		{F0E0541E-F17D-430B-97C4-93ADF0DD284E}.Release|x64.Build.0 = Release|Win32

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.Debug|Win32.ActiveCfg = Debug|Win32

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.Debug|Win32.Build.0 = Debug|Win32

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.Debug|x64.ActiveCfg = Debug|x64

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.Debug|x64.Build.0 = Debug|x64

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.PGInstrument|Win32.Build.0 = PGInstrument|Win32

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.PGInstrument|x64.ActiveCfg = PGInstrument|x64

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.PGInstrument|x64.Build.0 = PGInstrument|x64

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.PGUpdate|Win32.Build.0 = PGUpdate|Win32

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.PGUpdate|x64.ActiveCfg = PGUpdate|x64

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.PGUpdate|x64.Build.0 = PGUpdate|x64

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.Release|Win32.ActiveCfg = Release|Win32

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.Release|Win32.Build.0 = Release|Win32

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.Release|x64.ActiveCfg = Release|x64

-		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.Release|x64.Build.0 = Release|x64

-		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.Debug|Win32.ActiveCfg = Debug|Win32

-		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.Debug|Win32.Build.0 = Debug|Win32

-		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.Debug|x64.ActiveCfg = Debug|x64

-		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.Debug|x64.Build.0 = Debug|x64

-		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32

-		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.PGInstrument|Win32.Build.0 = PGInstrument|Win32

-		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.PGInstrument|x64.ActiveCfg = PGInstrument|x64

-		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.PGInstrument|x64.Build.0 = PGInstrument|x64

-		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32

-		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.PGUpdate|Win32.Build.0 = PGUpdate|Win32

-		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.PGUpdate|x64.ActiveCfg = PGUpdate|x64

-		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.PGUpdate|x64.Build.0 = PGUpdate|x64

-		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.Release|Win32.ActiveCfg = Release|Win32

-		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.Release|Win32.Build.0 = Release|Win32

-		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.Release|x64.ActiveCfg = Release|x64

-		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.Release|x64.Build.0 = Release|x64

-		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.Debug|Win32.ActiveCfg = Debug|Win32

-		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.Debug|Win32.Build.0 = Debug|Win32

-		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.Debug|x64.ActiveCfg = Debug|x64

-		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.Debug|x64.Build.0 = Debug|x64

-		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32

-		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.PGInstrument|Win32.Build.0 = PGInstrument|Win32

-		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.PGInstrument|x64.ActiveCfg = PGInstrument|x64

-		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.PGInstrument|x64.Build.0 = PGInstrument|x64

-		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32

-		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.PGUpdate|Win32.Build.0 = PGUpdate|Win32

-		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.PGUpdate|x64.ActiveCfg = PGUpdate|x64

-		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.PGUpdate|x64.Build.0 = PGUpdate|x64

-		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.Release|Win32.ActiveCfg = Release|Win32

-		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.Release|Win32.Build.0 = Release|Win32

-		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.Release|x64.ActiveCfg = Release|x64

-		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.Release|x64.Build.0 = Release|x64

-		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.Debug|Win32.ActiveCfg = Release|Win32

-		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.Debug|Win32.Build.0 = Release|Win32

-		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.Debug|x64.ActiveCfg = Release|Win32

-		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.Debug|x64.Build.0 = Release|Win32

-		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.PGInstrument|Win32.ActiveCfg = Release|Win32

-		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.PGInstrument|Win32.Build.0 = Release|Win32

-		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.PGInstrument|x64.ActiveCfg = Release|Win32

-		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.PGInstrument|x64.Build.0 = Release|Win32

-		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.PGUpdate|Win32.ActiveCfg = Release|Win32

-		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.PGUpdate|Win32.Build.0 = Release|Win32

-		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.PGUpdate|x64.ActiveCfg = Release|Win32

-		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.PGUpdate|x64.Build.0 = Release|Win32

-		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.Release|Win32.ActiveCfg = Release|Win32

-		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.Release|Win32.Build.0 = Release|Win32

-		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.Release|x64.ActiveCfg = Release|Win32

-		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.Release|x64.Build.0 = Release|Win32

-		{28B5D777-DDF2-4B6B-B34F-31D938813856}.Debug|Win32.ActiveCfg = Debug|Win32

-		{28B5D777-DDF2-4B6B-B34F-31D938813856}.Debug|Win32.Build.0 = Debug|Win32

-		{28B5D777-DDF2-4B6B-B34F-31D938813856}.Debug|x64.ActiveCfg = Debug|x64

-		{28B5D777-DDF2-4B6B-B34F-31D938813856}.Debug|x64.Build.0 = Debug|x64

-		{28B5D777-DDF2-4B6B-B34F-31D938813856}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32

-		{28B5D777-DDF2-4B6B-B34F-31D938813856}.PGInstrument|Win32.Build.0 = PGInstrument|Win32

-		{28B5D777-DDF2-4B6B-B34F-31D938813856}.PGInstrument|x64.ActiveCfg = PGInstrument|x64

-		{28B5D777-DDF2-4B6B-B34F-31D938813856}.PGInstrument|x64.Build.0 = PGInstrument|x64

-		{28B5D777-DDF2-4B6B-B34F-31D938813856}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32

-		{28B5D777-DDF2-4B6B-B34F-31D938813856}.PGUpdate|Win32.Build.0 = PGUpdate|Win32

-		{28B5D777-DDF2-4B6B-B34F-31D938813856}.PGUpdate|x64.ActiveCfg = PGUpdate|x64

-		{28B5D777-DDF2-4B6B-B34F-31D938813856}.PGUpdate|x64.Build.0 = PGUpdate|x64

-		{28B5D777-DDF2-4B6B-B34F-31D938813856}.Release|Win32.ActiveCfg = Release|Win32

-		{28B5D777-DDF2-4B6B-B34F-31D938813856}.Release|Win32.Build.0 = Release|Win32

-		{28B5D777-DDF2-4B6B-B34F-31D938813856}.Release|x64.ActiveCfg = Release|x64

-		{28B5D777-DDF2-4B6B-B34F-31D938813856}.Release|x64.Build.0 = Release|x64

-		{0E9791DB-593A-465F-98BC-681011311618}.Debug|Win32.ActiveCfg = Debug|Win32

-		{0E9791DB-593A-465F-98BC-681011311618}.Debug|Win32.Build.0 = Debug|Win32

-		{0E9791DB-593A-465F-98BC-681011311618}.Debug|x64.ActiveCfg = Debug|x64

-		{0E9791DB-593A-465F-98BC-681011311618}.Debug|x64.Build.0 = Debug|x64

-		{0E9791DB-593A-465F-98BC-681011311618}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32

-		{0E9791DB-593A-465F-98BC-681011311618}.PGInstrument|Win32.Build.0 = PGInstrument|Win32

-		{0E9791DB-593A-465F-98BC-681011311618}.PGInstrument|x64.ActiveCfg = PGInstrument|x64

-		{0E9791DB-593A-465F-98BC-681011311618}.PGInstrument|x64.Build.0 = PGInstrument|x64

-		{0E9791DB-593A-465F-98BC-681011311618}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32

-		{0E9791DB-593A-465F-98BC-681011311618}.PGUpdate|Win32.Build.0 = PGUpdate|Win32

-		{0E9791DB-593A-465F-98BC-681011311618}.PGUpdate|x64.ActiveCfg = PGUpdate|x64

-		{0E9791DB-593A-465F-98BC-681011311618}.PGUpdate|x64.Build.0 = PGUpdate|x64

-		{0E9791DB-593A-465F-98BC-681011311618}.Release|Win32.ActiveCfg = Release|Win32

-		{0E9791DB-593A-465F-98BC-681011311618}.Release|Win32.Build.0 = Release|Win32

-		{0E9791DB-593A-465F-98BC-681011311618}.Release|x64.ActiveCfg = Release|x64

-		{0E9791DB-593A-465F-98BC-681011311618}.Release|x64.Build.0 = Release|x64

-		{9EC7190A-249F-4180-A900-548FDCF3055F}.Debug|Win32.ActiveCfg = Debug|Win32

-		{9EC7190A-249F-4180-A900-548FDCF3055F}.Debug|Win32.Build.0 = Debug|Win32

-		{9EC7190A-249F-4180-A900-548FDCF3055F}.Debug|x64.ActiveCfg = Debug|x64

-		{9EC7190A-249F-4180-A900-548FDCF3055F}.Debug|x64.Build.0 = Debug|x64

-		{9EC7190A-249F-4180-A900-548FDCF3055F}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32

-		{9EC7190A-249F-4180-A900-548FDCF3055F}.PGInstrument|Win32.Build.0 = PGInstrument|Win32

-		{9EC7190A-249F-4180-A900-548FDCF3055F}.PGInstrument|x64.ActiveCfg = PGInstrument|x64

-		{9EC7190A-249F-4180-A900-548FDCF3055F}.PGInstrument|x64.Build.0 = PGInstrument|x64

-		{9EC7190A-249F-4180-A900-548FDCF3055F}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32

-		{9EC7190A-249F-4180-A900-548FDCF3055F}.PGUpdate|Win32.Build.0 = PGUpdate|Win32

-		{9EC7190A-249F-4180-A900-548FDCF3055F}.PGUpdate|x64.ActiveCfg = PGUpdate|x64

-		{9EC7190A-249F-4180-A900-548FDCF3055F}.PGUpdate|x64.Build.0 = PGUpdate|x64

-		{9EC7190A-249F-4180-A900-548FDCF3055F}.Release|Win32.ActiveCfg = Release|Win32

-		{9EC7190A-249F-4180-A900-548FDCF3055F}.Release|Win32.Build.0 = Release|Win32

-		{9EC7190A-249F-4180-A900-548FDCF3055F}.Release|x64.ActiveCfg = Release|x64

-		{9EC7190A-249F-4180-A900-548FDCF3055F}.Release|x64.Build.0 = Release|x64

-		{17E1E049-C309-4D79-843F-AE483C264AEA}.Debug|Win32.ActiveCfg = Debug|Win32

-		{17E1E049-C309-4D79-843F-AE483C264AEA}.Debug|Win32.Build.0 = Debug|Win32

-		{17E1E049-C309-4D79-843F-AE483C264AEA}.Debug|x64.ActiveCfg = Debug|x64

-		{17E1E049-C309-4D79-843F-AE483C264AEA}.Debug|x64.Build.0 = Debug|x64

-		{17E1E049-C309-4D79-843F-AE483C264AEA}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32

-		{17E1E049-C309-4D79-843F-AE483C264AEA}.PGInstrument|Win32.Build.0 = PGInstrument|Win32

-		{17E1E049-C309-4D79-843F-AE483C264AEA}.PGInstrument|x64.ActiveCfg = PGInstrument|x64

-		{17E1E049-C309-4D79-843F-AE483C264AEA}.PGInstrument|x64.Build.0 = PGInstrument|x64

-		{17E1E049-C309-4D79-843F-AE483C264AEA}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32

-		{17E1E049-C309-4D79-843F-AE483C264AEA}.PGUpdate|Win32.Build.0 = PGUpdate|Win32

-		{17E1E049-C309-4D79-843F-AE483C264AEA}.PGUpdate|x64.ActiveCfg = PGUpdate|x64

-		{17E1E049-C309-4D79-843F-AE483C264AEA}.PGUpdate|x64.Build.0 = PGUpdate|x64

-		{17E1E049-C309-4D79-843F-AE483C264AEA}.Release|Win32.ActiveCfg = Release|Win32

-		{17E1E049-C309-4D79-843F-AE483C264AEA}.Release|Win32.Build.0 = Release|Win32

-		{17E1E049-C309-4D79-843F-AE483C264AEA}.Release|x64.ActiveCfg = Release|x64

-		{17E1E049-C309-4D79-843F-AE483C264AEA}.Release|x64.Build.0 = Release|x64

-		{31FFC478-7B4A-43E8-9954-8D03E2187E9C}.Debug|Win32.ActiveCfg = Debug|Win32

-		{31FFC478-7B4A-43E8-9954-8D03E2187E9C}.Debug|Win32.Build.0 = Debug|Win32

-		{31FFC478-7B4A-43E8-9954-8D03E2187E9C}.Debug|x64.ActiveCfg = Debug|x64

-		{31FFC478-7B4A-43E8-9954-8D03E2187E9C}.Debug|x64.Build.0 = Debug|x64

-		{31FFC478-7B4A-43E8-9954-8D03E2187E9C}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32

-		{31FFC478-7B4A-43E8-9954-8D03E2187E9C}.PGInstrument|Win32.Build.0 = PGInstrument|Win32

-		{31FFC478-7B4A-43E8-9954-8D03E2187E9C}.PGInstrument|x64.ActiveCfg = PGInstrument|x64

-		{31FFC478-7B4A-43E8-9954-8D03E2187E9C}.PGInstrument|x64.Build.0 = PGInstrument|x64

-		{31FFC478-7B4A-43E8-9954-8D03E2187E9C}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32

-		{31FFC478-7B4A-43E8-9954-8D03E2187E9C}.PGUpdate|Win32.Build.0 = PGUpdate|Win32

-		{31FFC478-7B4A-43E8-9954-8D03E2187E9C}.PGUpdate|x64.ActiveCfg = PGUpdate|x64

-		{31FFC478-7B4A-43E8-9954-8D03E2187E9C}.PGUpdate|x64.Build.0 = PGUpdate|x64

-		{31FFC478-7B4A-43E8-9954-8D03E2187E9C}.Release|Win32.ActiveCfg = Release|Win32

-		{31FFC478-7B4A-43E8-9954-8D03E2187E9C}.Release|Win32.Build.0 = Release|Win32

-		{31FFC478-7B4A-43E8-9954-8D03E2187E9C}.Release|x64.ActiveCfg = Release|x64

-		{31FFC478-7B4A-43E8-9954-8D03E2187E9C}.Release|x64.Build.0 = Release|x64

-		{86937F53-C189-40EF-8CE8-8759D8E7D480}.Debug|Win32.ActiveCfg = Debug|Win32

-		{86937F53-C189-40EF-8CE8-8759D8E7D480}.Debug|Win32.Build.0 = Debug|Win32

-		{86937F53-C189-40EF-8CE8-8759D8E7D480}.Debug|x64.ActiveCfg = Debug|x64

-		{86937F53-C189-40EF-8CE8-8759D8E7D480}.Debug|x64.Build.0 = Debug|x64

-		{86937F53-C189-40EF-8CE8-8759D8E7D480}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32

-		{86937F53-C189-40EF-8CE8-8759D8E7D480}.PGInstrument|Win32.Build.0 = PGInstrument|Win32

-		{86937F53-C189-40EF-8CE8-8759D8E7D480}.PGInstrument|x64.ActiveCfg = PGInstrument|x64

-		{86937F53-C189-40EF-8CE8-8759D8E7D480}.PGInstrument|x64.Build.0 = PGInstrument|x64

-		{86937F53-C189-40EF-8CE8-8759D8E7D480}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32

-		{86937F53-C189-40EF-8CE8-8759D8E7D480}.PGUpdate|Win32.Build.0 = PGUpdate|Win32

-		{86937F53-C189-40EF-8CE8-8759D8E7D480}.PGUpdate|x64.ActiveCfg = PGUpdate|x64

-		{86937F53-C189-40EF-8CE8-8759D8E7D480}.PGUpdate|x64.Build.0 = PGUpdate|x64

-		{86937F53-C189-40EF-8CE8-8759D8E7D480}.Release|Win32.ActiveCfg = Release|Win32

-		{86937F53-C189-40EF-8CE8-8759D8E7D480}.Release|Win32.Build.0 = Release|Win32

-		{86937F53-C189-40EF-8CE8-8759D8E7D480}.Release|x64.ActiveCfg = Release|x64

-		{86937F53-C189-40EF-8CE8-8759D8E7D480}.Release|x64.Build.0 = Release|x64

-		{13CECB97-4119-4316-9D42-8534019A5A44}.Debug|Win32.ActiveCfg = Debug|Win32

-		{13CECB97-4119-4316-9D42-8534019A5A44}.Debug|Win32.Build.0 = Debug|Win32

-		{13CECB97-4119-4316-9D42-8534019A5A44}.Debug|x64.ActiveCfg = Debug|x64

-		{13CECB97-4119-4316-9D42-8534019A5A44}.Debug|x64.Build.0 = Debug|x64

-		{13CECB97-4119-4316-9D42-8534019A5A44}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32

-		{13CECB97-4119-4316-9D42-8534019A5A44}.PGInstrument|Win32.Build.0 = PGInstrument|Win32

-		{13CECB97-4119-4316-9D42-8534019A5A44}.PGInstrument|x64.ActiveCfg = PGInstrument|x64

-		{13CECB97-4119-4316-9D42-8534019A5A44}.PGInstrument|x64.Build.0 = PGInstrument|x64

-		{13CECB97-4119-4316-9D42-8534019A5A44}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32

-		{13CECB97-4119-4316-9D42-8534019A5A44}.PGUpdate|Win32.Build.0 = PGUpdate|Win32

-		{13CECB97-4119-4316-9D42-8534019A5A44}.PGUpdate|x64.ActiveCfg = PGUpdate|x64

-		{13CECB97-4119-4316-9D42-8534019A5A44}.PGUpdate|x64.Build.0 = PGUpdate|x64

-		{13CECB97-4119-4316-9D42-8534019A5A44}.Release|Win32.ActiveCfg = Release|Win32

-		{13CECB97-4119-4316-9D42-8534019A5A44}.Release|Win32.Build.0 = Release|Win32

-		{13CECB97-4119-4316-9D42-8534019A5A44}.Release|x64.ActiveCfg = Release|x64

-		{13CECB97-4119-4316-9D42-8534019A5A44}.Release|x64.Build.0 = Release|x64

-		{C6E20F84-3247-4AD6-B051-B073268F73BA}.Debug|Win32.ActiveCfg = Debug|Win32

-		{C6E20F84-3247-4AD6-B051-B073268F73BA}.Debug|Win32.Build.0 = Debug|Win32

-		{C6E20F84-3247-4AD6-B051-B073268F73BA}.Debug|x64.ActiveCfg = Debug|x64

-		{C6E20F84-3247-4AD6-B051-B073268F73BA}.Debug|x64.Build.0 = Debug|x64

-		{C6E20F84-3247-4AD6-B051-B073268F73BA}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32

-		{C6E20F84-3247-4AD6-B051-B073268F73BA}.PGInstrument|Win32.Build.0 = PGInstrument|Win32

-		{C6E20F84-3247-4AD6-B051-B073268F73BA}.PGInstrument|x64.ActiveCfg = PGInstrument|x64

-		{C6E20F84-3247-4AD6-B051-B073268F73BA}.PGInstrument|x64.Build.0 = PGInstrument|x64

-		{C6E20F84-3247-4AD6-B051-B073268F73BA}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32

-		{C6E20F84-3247-4AD6-B051-B073268F73BA}.PGUpdate|Win32.Build.0 = PGUpdate|Win32

-		{C6E20F84-3247-4AD6-B051-B073268F73BA}.PGUpdate|x64.ActiveCfg = PGUpdate|x64

-		{C6E20F84-3247-4AD6-B051-B073268F73BA}.PGUpdate|x64.Build.0 = PGUpdate|x64

-		{C6E20F84-3247-4AD6-B051-B073268F73BA}.Release|Win32.ActiveCfg = Release|Win32

-		{C6E20F84-3247-4AD6-B051-B073268F73BA}.Release|Win32.Build.0 = Release|Win32

-		{C6E20F84-3247-4AD6-B051-B073268F73BA}.Release|x64.ActiveCfg = Release|x64

-		{C6E20F84-3247-4AD6-B051-B073268F73BA}.Release|x64.Build.0 = Release|x64

-		{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}.Debug|Win32.ActiveCfg = Debug|Win32

-		{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}.Debug|Win32.Build.0 = Debug|Win32

-		{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}.Debug|x64.ActiveCfg = Debug|x64

-		{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}.Debug|x64.Build.0 = Debug|x64

-		{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32

-		{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}.PGInstrument|Win32.Build.0 = PGInstrument|Win32

-		{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}.PGInstrument|x64.ActiveCfg = PGInstrument|x64

-		{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}.PGInstrument|x64.Build.0 = PGInstrument|x64

-		{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32

-		{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}.PGUpdate|Win32.Build.0 = PGUpdate|Win32

-		{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}.PGUpdate|x64.ActiveCfg = PGUpdate|x64

-		{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}.PGUpdate|x64.Build.0 = PGUpdate|x64

-		{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}.Release|Win32.ActiveCfg = Release|Win32

-		{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}.Release|Win32.Build.0 = Release|Win32

-		{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}.Release|x64.ActiveCfg = Release|x64

-		{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}.Release|x64.Build.0 = Release|x64

-		{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}.Debug|Win32.ActiveCfg = Debug|Win32

-		{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}.Debug|Win32.Build.0 = Debug|Win32

-		{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}.Debug|x64.ActiveCfg = Debug|x64

-		{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}.Debug|x64.Build.0 = Debug|x64

-		{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32

-		{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}.PGInstrument|Win32.Build.0 = PGInstrument|Win32

-		{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}.PGInstrument|x64.ActiveCfg = PGInstrument|x64

-		{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}.PGInstrument|x64.Build.0 = PGInstrument|x64

-		{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32

-		{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}.PGUpdate|Win32.Build.0 = PGUpdate|Win32

-		{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}.PGUpdate|x64.ActiveCfg = PGUpdate|x64

-		{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}.PGUpdate|x64.Build.0 = PGUpdate|x64

-		{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}.Release|Win32.ActiveCfg = Release|Win32

-		{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}.Release|Win32.Build.0 = Release|Win32

-		{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}.Release|x64.ActiveCfg = Release|x64

-		{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}.Release|x64.Build.0 = Release|x64

-		{73FCD2BD-F133-46B7-8EC1-144CD82A59D5}.Debug|Win32.ActiveCfg = Debug|Win32

-		{73FCD2BD-F133-46B7-8EC1-144CD82A59D5}.Debug|Win32.Build.0 = Debug|Win32

-		{73FCD2BD-F133-46B7-8EC1-144CD82A59D5}.Debug|x64.ActiveCfg = Debug|x64

-		{73FCD2BD-F133-46B7-8EC1-144CD82A59D5}.Debug|x64.Build.0 = Debug|x64

-		{73FCD2BD-F133-46B7-8EC1-144CD82A59D5}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32

-		{73FCD2BD-F133-46B7-8EC1-144CD82A59D5}.PGInstrument|Win32.Build.0 = PGInstrument|Win32

-		{73FCD2BD-F133-46B7-8EC1-144CD82A59D5}.PGInstrument|x64.ActiveCfg = PGInstrument|x64

-		{73FCD2BD-F133-46B7-8EC1-144CD82A59D5}.PGInstrument|x64.Build.0 = PGInstrument|x64

-		{73FCD2BD-F133-46B7-8EC1-144CD82A59D5}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32

-		{73FCD2BD-F133-46B7-8EC1-144CD82A59D5}.PGUpdate|Win32.Build.0 = PGUpdate|Win32

-		{73FCD2BD-F133-46B7-8EC1-144CD82A59D5}.PGUpdate|x64.ActiveCfg = PGUpdate|x64

-		{73FCD2BD-F133-46B7-8EC1-144CD82A59D5}.PGUpdate|x64.Build.0 = PGUpdate|x64

-		{73FCD2BD-F133-46B7-8EC1-144CD82A59D5}.Release|Win32.ActiveCfg = Release|Win32

-		{73FCD2BD-F133-46B7-8EC1-144CD82A59D5}.Release|Win32.Build.0 = Release|Win32

-		{73FCD2BD-F133-46B7-8EC1-144CD82A59D5}.Release|x64.ActiveCfg = Release|x64

-		{73FCD2BD-F133-46B7-8EC1-144CD82A59D5}.Release|x64.Build.0 = Release|x64

-		{18CAE28C-B454-46C1-87A0-493D91D97F03}.Debug|Win32.ActiveCfg = Debug|Win32

-		{18CAE28C-B454-46C1-87A0-493D91D97F03}.Debug|Win32.Build.0 = Debug|Win32

-		{18CAE28C-B454-46C1-87A0-493D91D97F03}.Debug|x64.ActiveCfg = Debug|x64

-		{18CAE28C-B454-46C1-87A0-493D91D97F03}.Debug|x64.Build.0 = Debug|x64

-		{18CAE28C-B454-46C1-87A0-493D91D97F03}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32

-		{18CAE28C-B454-46C1-87A0-493D91D97F03}.PGInstrument|Win32.Build.0 = PGInstrument|Win32

-		{18CAE28C-B454-46C1-87A0-493D91D97F03}.PGInstrument|x64.ActiveCfg = PGInstrument|x64

-		{18CAE28C-B454-46C1-87A0-493D91D97F03}.PGInstrument|x64.Build.0 = PGInstrument|x64

-		{18CAE28C-B454-46C1-87A0-493D91D97F03}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32

-		{18CAE28C-B454-46C1-87A0-493D91D97F03}.PGUpdate|Win32.Build.0 = PGUpdate|Win32

-		{18CAE28C-B454-46C1-87A0-493D91D97F03}.PGUpdate|x64.ActiveCfg = PGUpdate|x64

-		{18CAE28C-B454-46C1-87A0-493D91D97F03}.PGUpdate|x64.Build.0 = PGUpdate|x64

-		{18CAE28C-B454-46C1-87A0-493D91D97F03}.Release|Win32.ActiveCfg = Release|Win32

-		{18CAE28C-B454-46C1-87A0-493D91D97F03}.Release|Win32.Build.0 = Release|Win32

-		{18CAE28C-B454-46C1-87A0-493D91D97F03}.Release|x64.ActiveCfg = Release|x64

-		{18CAE28C-B454-46C1-87A0-493D91D97F03}.Release|x64.Build.0 = Release|x64

-		{ECC7CEAC-A5E5-458E-BB9E-2413CC847881}.Debug|Win32.ActiveCfg = Debug|Win32

-		{ECC7CEAC-A5E5-458E-BB9E-2413CC847881}.Debug|Win32.Build.0 = Debug|Win32

-		{ECC7CEAC-A5E5-458E-BB9E-2413CC847881}.Debug|x64.ActiveCfg = Debug|x64

-		{ECC7CEAC-A5E5-458E-BB9E-2413CC847881}.Debug|x64.Build.0 = Debug|x64

-		{ECC7CEAC-A5E5-458E-BB9E-2413CC847881}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32

-		{ECC7CEAC-A5E5-458E-BB9E-2413CC847881}.PGInstrument|Win32.Build.0 = PGInstrument|Win32

-		{ECC7CEAC-A5E5-458E-BB9E-2413CC847881}.PGInstrument|x64.ActiveCfg = PGInstrument|x64

-		{ECC7CEAC-A5E5-458E-BB9E-2413CC847881}.PGInstrument|x64.Build.0 = PGInstrument|x64

-		{ECC7CEAC-A5E5-458E-BB9E-2413CC847881}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32

-		{ECC7CEAC-A5E5-458E-BB9E-2413CC847881}.PGUpdate|Win32.Build.0 = PGUpdate|Win32

-		{ECC7CEAC-A5E5-458E-BB9E-2413CC847881}.PGUpdate|x64.ActiveCfg = PGUpdate|x64

-		{ECC7CEAC-A5E5-458E-BB9E-2413CC847881}.PGUpdate|x64.Build.0 = PGUpdate|x64

-		{ECC7CEAC-A5E5-458E-BB9E-2413CC847881}.Release|Win32.ActiveCfg = Release|Win32

-		{ECC7CEAC-A5E5-458E-BB9E-2413CC847881}.Release|Win32.Build.0 = Release|Win32

-		{ECC7CEAC-A5E5-458E-BB9E-2413CC847881}.Release|x64.ActiveCfg = Release|x64

-		{ECC7CEAC-A5E5-458E-BB9E-2413CC847881}.Release|x64.Build.0 = Release|x64

-		{D06B6426-4762-44CC-8BAD-D79052507F2F}.Debug|Win32.ActiveCfg = Debug|Win32

-		{D06B6426-4762-44CC-8BAD-D79052507F2F}.Debug|Win32.Build.0 = Debug|Win32

-		{D06B6426-4762-44CC-8BAD-D79052507F2F}.Debug|x64.ActiveCfg = Debug|x64

-		{D06B6426-4762-44CC-8BAD-D79052507F2F}.Debug|x64.Build.0 = Debug|x64

-		{D06B6426-4762-44CC-8BAD-D79052507F2F}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32

-		{D06B6426-4762-44CC-8BAD-D79052507F2F}.PGInstrument|Win32.Build.0 = PGInstrument|Win32

-		{D06B6426-4762-44CC-8BAD-D79052507F2F}.PGInstrument|x64.ActiveCfg = PGInstrument|x64

-		{D06B6426-4762-44CC-8BAD-D79052507F2F}.PGInstrument|x64.Build.0 = PGInstrument|x64

-		{D06B6426-4762-44CC-8BAD-D79052507F2F}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32

-		{D06B6426-4762-44CC-8BAD-D79052507F2F}.PGUpdate|Win32.Build.0 = PGUpdate|Win32

-		{D06B6426-4762-44CC-8BAD-D79052507F2F}.PGUpdate|x64.ActiveCfg = PGUpdate|x64

-		{D06B6426-4762-44CC-8BAD-D79052507F2F}.PGUpdate|x64.Build.0 = PGUpdate|x64

-		{D06B6426-4762-44CC-8BAD-D79052507F2F}.Release|Win32.ActiveCfg = Release|Win32

-		{D06B6426-4762-44CC-8BAD-D79052507F2F}.Release|Win32.Build.0 = Release|Win32

-		{D06B6426-4762-44CC-8BAD-D79052507F2F}.Release|x64.ActiveCfg = Release|x64

-		{D06B6426-4762-44CC-8BAD-D79052507F2F}.Release|x64.Build.0 = Release|x64

-		{EB1C19C1-1F18-421E-9735-CAEE69DC6A3C}.Debug|Win32.ActiveCfg = Release|Win32

-		{EB1C19C1-1F18-421E-9735-CAEE69DC6A3C}.Debug|x64.ActiveCfg = Release|x64

-		{EB1C19C1-1F18-421E-9735-CAEE69DC6A3C}.PGInstrument|Win32.ActiveCfg = Release|Win32

-		{EB1C19C1-1F18-421E-9735-CAEE69DC6A3C}.PGInstrument|x64.ActiveCfg = Release|x64

-		{EB1C19C1-1F18-421E-9735-CAEE69DC6A3C}.PGUpdate|Win32.ActiveCfg = Release|Win32

-		{EB1C19C1-1F18-421E-9735-CAEE69DC6A3C}.PGUpdate|x64.ActiveCfg = Release|x64

-		{EB1C19C1-1F18-421E-9735-CAEE69DC6A3C}.Release|Win32.ActiveCfg = Release|Win32

-		{EB1C19C1-1F18-421E-9735-CAEE69DC6A3C}.Release|x64.ActiveCfg = Release|x64

-		{447F05A8-F581-4CAC-A466-5AC7936E207E}.Debug|Win32.ActiveCfg = Debug|Win32

-		{447F05A8-F581-4CAC-A466-5AC7936E207E}.Debug|Win32.Build.0 = Debug|Win32

-		{447F05A8-F581-4CAC-A466-5AC7936E207E}.Debug|x64.ActiveCfg = Debug|x64

-		{447F05A8-F581-4CAC-A466-5AC7936E207E}.Debug|x64.Build.0 = Debug|x64

-		{447F05A8-F581-4CAC-A466-5AC7936E207E}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32

-		{447F05A8-F581-4CAC-A466-5AC7936E207E}.PGInstrument|Win32.Build.0 = PGInstrument|Win32

-		{447F05A8-F581-4CAC-A466-5AC7936E207E}.PGInstrument|x64.ActiveCfg = PGInstrument|x64

-		{447F05A8-F581-4CAC-A466-5AC7936E207E}.PGInstrument|x64.Build.0 = PGInstrument|x64

-		{447F05A8-F581-4CAC-A466-5AC7936E207E}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32

-		{447F05A8-F581-4CAC-A466-5AC7936E207E}.PGUpdate|Win32.Build.0 = PGUpdate|Win32

-		{447F05A8-F581-4CAC-A466-5AC7936E207E}.PGUpdate|x64.ActiveCfg = PGUpdate|x64

-		{447F05A8-F581-4CAC-A466-5AC7936E207E}.PGUpdate|x64.Build.0 = PGUpdate|x64

-		{447F05A8-F581-4CAC-A466-5AC7936E207E}.Release|Win32.ActiveCfg = Release|Win32

-		{447F05A8-F581-4CAC-A466-5AC7936E207E}.Release|Win32.Build.0 = Release|Win32

-		{447F05A8-F581-4CAC-A466-5AC7936E207E}.Release|x64.ActiveCfg = Release|x64

-		{447F05A8-F581-4CAC-A466-5AC7936E207E}.Release|x64.Build.0 = Release|x64

-		{A1A295E5-463C-437F-81CA-1F32367685DA}.Debug|Win32.ActiveCfg = Debug|Win32

-		{A1A295E5-463C-437F-81CA-1F32367685DA}.Debug|Win32.Build.0 = Debug|Win32

-		{A1A295E5-463C-437F-81CA-1F32367685DA}.Debug|x64.ActiveCfg = Debug|x64

-		{A1A295E5-463C-437F-81CA-1F32367685DA}.Debug|x64.Build.0 = Debug|x64

-		{A1A295E5-463C-437F-81CA-1F32367685DA}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32

-		{A1A295E5-463C-437F-81CA-1F32367685DA}.PGInstrument|Win32.Build.0 = PGInstrument|Win32

-		{A1A295E5-463C-437F-81CA-1F32367685DA}.PGInstrument|x64.ActiveCfg = PGInstrument|x64

-		{A1A295E5-463C-437F-81CA-1F32367685DA}.PGInstrument|x64.Build.0 = PGInstrument|x64

-		{A1A295E5-463C-437F-81CA-1F32367685DA}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32

-		{A1A295E5-463C-437F-81CA-1F32367685DA}.PGUpdate|Win32.Build.0 = PGUpdate|Win32

-		{A1A295E5-463C-437F-81CA-1F32367685DA}.PGUpdate|x64.ActiveCfg = PGUpdate|x64

-		{A1A295E5-463C-437F-81CA-1F32367685DA}.PGUpdate|x64.Build.0 = PGUpdate|x64

-		{A1A295E5-463C-437F-81CA-1F32367685DA}.Release|Win32.ActiveCfg = Release|Win32

-		{A1A295E5-463C-437F-81CA-1F32367685DA}.Release|Win32.Build.0 = Release|Win32

-		{A1A295E5-463C-437F-81CA-1F32367685DA}.Release|x64.ActiveCfg = Release|x64

-		{A1A295E5-463C-437F-81CA-1F32367685DA}.Release|x64.Build.0 = Release|x64

-		{9E48B300-37D1-11DD-8C41-005056C00008}.Debug|Win32.ActiveCfg = Debug|Win32

-		{9E48B300-37D1-11DD-8C41-005056C00008}.Debug|Win32.Build.0 = Debug|Win32

-		{9E48B300-37D1-11DD-8C41-005056C00008}.Debug|x64.ActiveCfg = Debug|x64

-		{9E48B300-37D1-11DD-8C41-005056C00008}.Debug|x64.Build.0 = Debug|x64

-		{9E48B300-37D1-11DD-8C41-005056C00008}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32

-		{9E48B300-37D1-11DD-8C41-005056C00008}.PGInstrument|Win32.Build.0 = PGInstrument|Win32

-		{9E48B300-37D1-11DD-8C41-005056C00008}.PGInstrument|x64.ActiveCfg = PGInstrument|x64

-		{9E48B300-37D1-11DD-8C41-005056C00008}.PGInstrument|x64.Build.0 = PGInstrument|x64

-		{9E48B300-37D1-11DD-8C41-005056C00008}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32

-		{9E48B300-37D1-11DD-8C41-005056C00008}.PGUpdate|Win32.Build.0 = PGUpdate|Win32

-		{9E48B300-37D1-11DD-8C41-005056C00008}.PGUpdate|x64.ActiveCfg = PGUpdate|x64

-		{9E48B300-37D1-11DD-8C41-005056C00008}.PGUpdate|x64.Build.0 = PGUpdate|x64

-		{9E48B300-37D1-11DD-8C41-005056C00008}.Release|Win32.ActiveCfg = Release|Win32

-		{9E48B300-37D1-11DD-8C41-005056C00008}.Release|Win32.Build.0 = Release|Win32

-		{9E48B300-37D1-11DD-8C41-005056C00008}.Release|x64.ActiveCfg = Release|x64

-		{9E48B300-37D1-11DD-8C41-005056C00008}.Release|x64.Build.0 = Release|x64

-		{E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.Debug|Win32.ActiveCfg = Debug|Win32

-		{E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.Debug|Win32.Build.0 = Debug|Win32

-		{E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.Debug|x64.ActiveCfg = Debug|x64

-		{E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.Debug|x64.Build.0 = Debug|x64

-		{E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32

-		{E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.PGInstrument|Win32.Build.0 = PGInstrument|Win32

-		{E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.PGInstrument|x64.ActiveCfg = PGInstrument|x64

-		{E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.PGInstrument|x64.Build.0 = PGInstrument|x64

-		{E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32

-		{E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.PGUpdate|Win32.Build.0 = PGUpdate|Win32

-		{E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.PGUpdate|x64.ActiveCfg = PGUpdate|x64

-		{E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.PGUpdate|x64.Build.0 = PGUpdate|x64

-		{E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.Release|Win32.ActiveCfg = Release|Win32

-		{E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.Release|Win32.Build.0 = Release|Win32

-		{E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.Release|x64.ActiveCfg = Release|x64

-		{E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.Release|x64.Build.0 = Release|x64

-		{6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.Debug|Win32.ActiveCfg = Debug|Win32

-		{6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.Debug|Win32.Build.0 = Debug|Win32

-		{6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.Debug|x64.ActiveCfg = Debug|x64

-		{6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.Debug|x64.Build.0 = Debug|x64

-		{6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.PGInstrument|Win32.ActiveCfg = Release|Win32

-		{6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.PGInstrument|Win32.Build.0 = Release|Win32

-		{6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.PGInstrument|x64.ActiveCfg = Release|x64

-		{6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.PGInstrument|x64.Build.0 = Release|x64

-		{6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.PGUpdate|Win32.ActiveCfg = Release|Win32

-		{6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.PGUpdate|Win32.Build.0 = Release|Win32

-		{6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.PGUpdate|x64.ActiveCfg = Release|x64

-		{6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.PGUpdate|x64.Build.0 = Release|x64

-		{6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.Release|Win32.ActiveCfg = Release|Win32

-		{6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.Release|Win32.Build.0 = Release|Win32

-		{6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.Release|x64.ActiveCfg = Release|x64

-		{6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.Release|x64.Build.0 = Release|x64

-	EndGlobalSection

-	GlobalSection(SolutionProperties) = preSolution

-		HideSolutionNode = FALSE

-	EndGlobalSection

-EndGlobal

diff --git a/PC/VS8.0/pginstrument.vsprops b/PC/VS8.0/pginstrument.vsprops
deleted file mode 100644
index 38c5f18..0000000
--- a/PC/VS8.0/pginstrument.vsprops
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioPropertySheet

-	ProjectType="Visual C++"

-	Version="8.00"

-	Name="pginstrument"

-	OutputDirectory="$(OutDirPGI)"

-	IntermediateDirectory="$(SolutionDir)$(PlatformName)-temp-pgi\$(ProjectName)\"

-	>

-	<Tool

-		Name="VCCLCompilerTool"

-		Optimization="2"

-		InlineFunctionExpansion="1"

-		EnableIntrinsicFunctions="false"

-		FavorSizeOrSpeed="2"

-		OmitFramePointers="true"

-		EnableFiberSafeOptimizations="false"

-		WholeProgramOptimization="true"

-		StringPooling="true"

-		ExceptionHandling="0"

-		BufferSecurityCheck="false"

-	/>

-	<Tool

-		Name="VCLinkerTool"

-		OptimizeReferences="2"

-		EnableCOMDATFolding="2"

-		LinkTimeCodeGeneration="2"

-		ProfileGuidedDatabase="$(SolutionDir)$(PlatformName)-pgi\$(TargetName).pgd"

-		ImportLibrary="$(OutDirPGI)\$(TargetName).lib"

-	/>

-	<UserMacro

-		Name="OutDirPGI"

-		Value="$(SolutionDir)$(PlatformName)-pgi\"

-	/>

-</VisualStudioPropertySheet>

diff --git a/PC/VS8.0/pgupdate.vsprops b/PC/VS8.0/pgupdate.vsprops
deleted file mode 100644
index 26cfc2d..0000000
--- a/PC/VS8.0/pgupdate.vsprops
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioPropertySheet

-	ProjectType="Visual C++"

-	Version="8.00"

-	Name="pgupdate"

-	OutputDirectory="$(SolutionDir)$(PlatformName)-pgo\"

-	InheritedPropertySheets="$(SolutionDir)\pginstrument.vsprops"

-	>

-	<Tool

-		Name="VCLinkerTool"

-		AdditionalManifestDependencies=""

-		LinkTimeCodeGeneration="4"

-	/>

-</VisualStudioPropertySheet>

diff --git a/PC/VS8.0/pyd.vsprops b/PC/VS8.0/pyd.vsprops
deleted file mode 100644
index 34c21e1..0000000
--- a/PC/VS8.0/pyd.vsprops
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioPropertySheet

-	ProjectType="Visual C++"

-	Version="8.00"

-	Name="pyd"

-	InheritedPropertySheets=".\pyproject.vsprops;.\release.vsprops"

-	>

-	<Tool

-		Name="VCCLCompilerTool"

-		PreprocessorDefinitions="Py_BUILD_CORE_MODULE"

-		RuntimeLibrary="2"

-	/>

-	<Tool

-		Name="VCLinkerTool"

-		OutputFile="$(OutDir)\$(ProjectName).pyd"

-		ProgramDatabaseFile="$(OutDir)\$(ProjectName).pdb"

-		ImportLibrary="$(OutDir)\$(TargetName).lib"

-		GenerateManifest="false"

-	/>

-	<Tool

-		Name="VCManifestTool"

-		EmbedManifest="false"

-	/>

-	<Tool

-		Name="VCPostBuildEventTool"

-		CommandLine=""

-	/>

-</VisualStudioPropertySheet>

diff --git a/PC/VS8.0/pyd_d.vsprops b/PC/VS8.0/pyd_d.vsprops
deleted file mode 100644
index 313a30b..0000000
--- a/PC/VS8.0/pyd_d.vsprops
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioPropertySheet

-	ProjectType="Visual C++"

-	Version="8.00"

-	Name="pyd_d"

-	InheritedPropertySheets=".\pyproject.vsprops;.\debug.vsprops"

-	>

-	<Tool

-		Name="VCCLCompilerTool"

-		Optimization="0"

-		InlineFunctionExpansion="0"

-		EnableIntrinsicFunctions="false"

-		PreprocessorDefinitions="Py_BUILD_CORE_MODULE"

-		RuntimeLibrary="3"

-	/>

-	<Tool

-		Name="VCLinkerTool"

-		OutputFile="$(OutDir)\$(ProjectName)_d.pyd"

-		LinkIncremental="1"

-		ProgramDatabaseFile="$(OutDir)\$(ProjectName)_d.pdb"

-		ImportLibrary="$(OutDir)\$(TargetName).lib"

-		GenerateManifest="false"

-	/>

-	<Tool

-		Name="VCManifestTool"

-		EmbedManifest="false"

-	/>

-	<Tool

-		Name="VCPostBuildEventTool"

-		CommandLine=""

-	/>

-	<UserMacro

-		Name="PythonExe"

-		Value="$(SolutionDir)python_d.exe"

-	/>

-</VisualStudioPropertySheet>

diff --git a/PC/VS8.0/pyexpat.vcproj b/PC/VS8.0/pyexpat.vcproj
deleted file mode 100644
index b59e4ec..0000000
--- a/PC/VS8.0/pyexpat.vcproj
+++ /dev/null
@@ -1,553 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="8.00"

-	Name="pyexpat"

-	ProjectGUID="{D06B6426-4762-44CC-8BAD-D79052507F2F}"

-	RootNamespace="pyexpat"

-	Keyword="Win32Proj"

-	TargetFrameworkVersion="196613"

-	>

-	<Platforms>

-		<Platform

-			Name="Win32"

-		/>

-		<Platform

-			Name="x64"

-		/>

-	</Platforms>

-	<ToolFiles>

-	</ToolFiles>

-	<Configurations>

-		<Configuration

-			Name="Debug|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd_d.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories=".\..\..\Modules\expat"

-				PreprocessorDefinitions="PYEXPAT_EXPORTS;HAVE_EXPAT_H;XML_NS;XML_DTD;BYTEORDER=1234;XML_CONTEXT_BYTES=1024;XML_STATIC;HAVE_MEMMOVE"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Debug|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd_d.vsprops;.\x64.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories=".\..\..\Modules\expat"

-				PreprocessorDefinitions="PYEXPAT_EXPORTS;HAVE_EXPAT_H;XML_NS;XML_DTD;BYTEORDER=1234;XML_CONTEXT_BYTES=1024;XML_STATIC;HAVE_MEMMOVE"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories=".\..\..\Modules\expat"

-				PreprocessorDefinitions="PYEXPAT_EXPORTS;HAVE_EXPAT_H;XML_NS;XML_DTD;BYTEORDER=1234;XML_CONTEXT_BYTES=1024;XML_STATIC;HAVE_MEMMOVE"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories=".\..\..\Modules\expat"

-				PreprocessorDefinitions="PYEXPAT_EXPORTS;HAVE_EXPAT_H;XML_NS;XML_DTD;BYTEORDER=1234;XML_CONTEXT_BYTES=1024;XML_STATIC;HAVE_MEMMOVE"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\pginstrument.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories=".\..\..\Modules\expat"

-				PreprocessorDefinitions="PYEXPAT_EXPORTS;HAVE_EXPAT_H;XML_NS;XML_DTD;BYTEORDER=1234;XML_CONTEXT_BYTES=1024;XML_STATIC;HAVE_MEMMOVE"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops;.\pginstrument.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories=".\..\..\Modules\expat"

-				PreprocessorDefinitions="PYEXPAT_EXPORTS;HAVE_EXPAT_H;XML_NS;XML_DTD;BYTEORDER=1234;XML_CONTEXT_BYTES=1024;XML_STATIC;HAVE_MEMMOVE"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				TargetMachine="17"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\pgupdate.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories=".\..\..\Modules\expat"

-				PreprocessorDefinitions="PYEXPAT_EXPORTS;HAVE_EXPAT_H;XML_NS;XML_DTD;BYTEORDER=1234;XML_CONTEXT_BYTES=1024;XML_STATIC;HAVE_MEMMOVE"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops;.\pgupdate.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories=".\..\..\Modules\expat"

-				PreprocessorDefinitions="PYEXPAT_EXPORTS;HAVE_EXPAT_H;XML_NS;XML_DTD;BYTEORDER=1234;XML_CONTEXT_BYTES=1024;XML_STATIC;HAVE_MEMMOVE"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				TargetMachine="17"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<Filter

-			Name="Header Files"

-			>

-			<File

-				RelativePath="..\..\Modules\expat\xmlrole.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\expat\xmltok.h"

-				>

-			</File>

-		</Filter>

-		<Filter

-			Name="Source Files"

-			>

-			<File

-				RelativePath="..\..\Modules\pyexpat.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\expat\xmlparse.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\expat\xmlrole.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\expat\xmltok.c"

-				>

-			</File>

-		</Filter>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS8.0/pyproject.vsprops b/PC/VS8.0/pyproject.vsprops
deleted file mode 100644
index 131bd3f..0000000
--- a/PC/VS8.0/pyproject.vsprops
+++ /dev/null
@@ -1,87 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioPropertySheet

-	ProjectType="Visual C++"

-	Version="8.00"

-	Name="pyproject"

-	OutputDirectory="$(SolutionDir)"

-	IntermediateDirectory="$(SolutionDir)$(PlatformName)-temp-$(ConfigurationName)\$(ProjectName)\"

-	>

-	<Tool

-		Name="VCCLCompilerTool"

-		Optimization="2"

-		InlineFunctionExpansion="1"

-		EnableIntrinsicFunctions="true"

-		AdditionalIncludeDirectories="..\..\Include; ..\..\PC"

-		PreprocessorDefinitions="_WIN32"

-		StringPooling="true"

-		ExceptionHandling="0"

-		RuntimeLibrary="0"

-		EnableFunctionLevelLinking="true"

-		WarningLevel="3"

-		DebugInformationFormat="3"

-		CompileAs="0"

-	/>

-	<Tool

-		Name="VCLinkerTool"

-		LinkIncremental="1"

-		AdditionalLibraryDirectories="$(OutDir)"

-		GenerateDebugInformation="true"

-		ProgramDatabaseFile="$(OutDir)$(TargetName).pdb"

-		SubSystem="2"

-		RandomizedBaseAddress="1"

-		DataExecutionPrevention="0"

-		TargetMachine="1"

-	/>

-	<Tool

-		Name="VCResourceCompilerTool"

-		AdditionalIncludeDirectories="..\..\PC;..\..\Include"

-	/>

-	<UserMacro

-		Name="PyDllName"

-		Value="python33"

-	/>

-	<UserMacro

-		Name="PythonExe"

-		Value="$(SolutionDir)\python.exe"

-	/>

-	<UserMacro

-		Name="externalsDir"

-		Value="..\..\.."

-	/>

-	<UserMacro

-		Name="sqlite3Dir"

-		Value="$(externalsDir)\sqlite-3.6.21"

-	/>

-	<UserMacro

-		Name="bz2Dir"

-		Value="$(externalsDir)\bzip2-1.0.6"

-	/>

-	<UserMacro

-		Name="opensslDir"

-		Value="$(externalsDir)\openssl-1.0.1e"

-	/>

-	<UserMacro

-		Name="tcltkDir"

-		Value="$(externalsDir)\tcltk"

-	/>

-	<UserMacro

-		Name="tcltk64Dir"

-		Value="$(externalsDir)\tcltk64"

-	/>

-	<UserMacro

-		Name="tcltkLib"

-		Value="$(tcltkDir)\lib\tcl85.lib $(tcltkDir)\lib\tk85.lib"

-	/>

-	<UserMacro

-		Name="tcltkLibDebug"

-		Value="$(tcltkDir)\lib\tcl85g.lib $(tcltkDir)\lib\tk85g.lib"

-	/>

-	<UserMacro

-		Name="tcltk64Lib"

-		Value="$(tcltk64Dir)\lib\tcl85.lib $(tcltk64Dir)\lib\tk85.lib"

-	/>

-	<UserMacro

-		Name="tcltk64LibDebug"

-		Value="$(tcltk64Dir)\lib\tcl85g.lib $(tcltk64Dir)\lib\tk85g.lib"

-	/>

-</VisualStudioPropertySheet>

diff --git a/PC/VS8.0/python.vcproj b/PC/VS8.0/python.vcproj
deleted file mode 100644
index 2f47c0e..0000000
--- a/PC/VS8.0/python.vcproj
+++ /dev/null
@@ -1,637 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="8.00"

-	Name="python"

-	ProjectGUID="{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}"

-	TargetFrameworkVersion="131072"

-	>

-	<Platforms>

-		<Platform

-			Name="Win32"

-		/>

-		<Platform

-			Name="x64"

-		/>

-	</Platforms>

-	<ToolFiles>

-	</ToolFiles>

-	<Configurations>

-		<Configuration

-			Name="Release|Win32"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\release.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			CharacterSet="2"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories=""

-				PreprocessorDefinitions="_CONSOLE"

-				StringPooling="true"

-				RuntimeLibrary="2"

-				EnableFunctionLevelLinking="true"

-				CompileAs="0"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-				PreprocessorDefinitions="NDEBUG"

-				Culture="1033"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				OutputFile="$(OutDir)\python.exe"

-				SubSystem="1"

-				StackReserveSize="2000000"

-				BaseAddress="0x1d000000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|x64"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\x64.vsprops;.\release.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			CharacterSet="2"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories=""

-				PreprocessorDefinitions="_CONSOLE"

-				StringPooling="true"

-				RuntimeLibrary="2"

-				EnableFunctionLevelLinking="true"

-				CompileAs="0"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-				PreprocessorDefinitions="NDEBUG"

-				Culture="1033"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				OutputFile="$(OutDir)\python.exe"

-				SubSystem="1"

-				StackReserveSize="2000000"

-				BaseAddress="0x1d000000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Debug|Win32"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\debug.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="0"

-				EnableIntrinsicFunctions="false"

-				AdditionalIncludeDirectories=""

-				PreprocessorDefinitions="_CONSOLE"

-				RuntimeLibrary="3"

-				BrowseInformation="1"

-				CompileAs="0"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-				PreprocessorDefinitions="_DEBUG"

-				Culture="1033"

-				AdditionalIncludeDirectories="..\..\Include"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				OutputFile="$(OutDir)\python_d.exe"

-				SubSystem="1"

-				StackReserveSize="2000000"

-				BaseAddress="0x1d000000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Debug|x64"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\x64.vsprops;.\debug.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			CharacterSet="2"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="0"

-				EnableIntrinsicFunctions="false"

-				AdditionalIncludeDirectories=""

-				PreprocessorDefinitions="_CONSOLE"

-				RuntimeLibrary="3"

-				BrowseInformation="1"

-				CompileAs="0"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-				PreprocessorDefinitions="_DEBUG"

-				Culture="1033"

-				AdditionalIncludeDirectories="..\..\Include"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				OutputFile="$(OutDir)\python_d.exe"

-				SubSystem="1"

-				StackReserveSize="2100000"

-				BaseAddress="0x1d000000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|Win32"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\release.vsprops;.\pginstrument.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			CharacterSet="2"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories=""

-				PreprocessorDefinitions="_CONSOLE"

-				StringPooling="true"

-				RuntimeLibrary="2"

-				EnableFunctionLevelLinking="true"

-				CompileAs="0"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-				PreprocessorDefinitions="NDEBUG"

-				Culture="1033"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				OutputFile="$(OutDir)\python.exe"

-				SubSystem="1"

-				StackReserveSize="2000000"

-				BaseAddress="0x1d000000"

-				ImportLibrary=""

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|x64"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\x64.vsprops;.\release.vsprops;.\pginstrument.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			CharacterSet="2"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories=""

-				PreprocessorDefinitions="_CONSOLE"

-				StringPooling="true"

-				RuntimeLibrary="2"

-				EnableFunctionLevelLinking="true"

-				CompileAs="0"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-				PreprocessorDefinitions="NDEBUG"

-				Culture="1033"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				OutputFile="$(OutDir)\python.exe"

-				SubSystem="1"

-				StackReserveSize="2000000"

-				BaseAddress="0x1d000000"

-				ImportLibrary=""

-				TargetMachine="17"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|Win32"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\release.vsprops;.\pgupdate.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			CharacterSet="2"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories=""

-				PreprocessorDefinitions="_CONSOLE"

-				StringPooling="true"

-				RuntimeLibrary="2"

-				EnableFunctionLevelLinking="true"

-				CompileAs="0"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-				PreprocessorDefinitions="NDEBUG"

-				Culture="1033"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				OutputFile="$(OutDir)\python.exe"

-				SubSystem="1"

-				StackReserveSize="2000000"

-				BaseAddress="0x1d000000"

-				ImportLibrary=""

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|x64"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\x64.vsprops;.\release.vsprops;.\pgupdate.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			CharacterSet="2"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories=""

-				PreprocessorDefinitions="_CONSOLE"

-				StringPooling="true"

-				RuntimeLibrary="2"

-				EnableFunctionLevelLinking="true"

-				CompileAs="0"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-				PreprocessorDefinitions="NDEBUG"

-				Culture="1033"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				OutputFile="$(OutDir)\python.exe"

-				SubSystem="1"

-				StackReserveSize="2000000"

-				BaseAddress="0x1d000000"

-				ImportLibrary=""

-				TargetMachine="17"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<Filter

-			Name="Resource Files"

-			>

-			<File

-				RelativePath="..\..\PC\pycon.ico"

-				>

-			</File>

-			<File

-				RelativePath="..\..\PC\python_exe.rc"

-				>

-			</File>

-		</Filter>

-		<Filter

-			Name="Source Files"

-			>

-			<File

-				RelativePath="..\..\Modules\python.c"

-				>

-			</File>

-		</Filter>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS8.0/pythoncore.vcproj b/PC/VS8.0/pythoncore.vcproj
deleted file mode 100644
index a75bb9d..0000000
--- a/PC/VS8.0/pythoncore.vcproj
+++ /dev/null
@@ -1,1921 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="8.00"

-	Name="pythoncore"

-	ProjectGUID="{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}"

-	RootNamespace="pythoncore"

-	TargetFrameworkVersion="131072"

-	>

-	<Platforms>

-		<Platform

-			Name="Win32"

-		/>

-		<Platform

-			Name="x64"

-		/>

-	</Platforms>

-	<ToolFiles>

-	</ToolFiles>

-	<Configurations>

-		<Configuration

-			Name="Release|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyproject.vsprops;.\release.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalOptions="/Zm200 "

-				AdditionalIncludeDirectories="..\..\Python;..\..\Modules\zlib"

-				PreprocessorDefinitions="_USRDLL;Py_BUILD_CORE;Py_ENABLE_SHARED;WIN32"

-				RuntimeLibrary="2"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-				PreprocessorDefinitions="NDEBUG"

-				Culture="1033"

-				AdditionalIncludeDirectories="..\..\Include"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-				Description="Generate build information..."

-				CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release $(IntDir)"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="$(IntDir)\getbuildinfo.o"

-				OutputFile="$(OutDir)\$(PyDllName).dll"

-				IgnoreDefaultLibraryNames="libc"

-				ProgramDatabaseFile="$(OutDir)$(PyDllName).pdb"

-				BaseAddress="0x1e000000"

-				ImportLibrary="$(OutDir)$(PyDllName).lib"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyproject.vsprops;.\x64.vsprops;.\release.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalOptions="/Zm200 "

-				AdditionalIncludeDirectories="..\..\Python;..\..\Modules\zlib"

-				PreprocessorDefinitions="_USRDLL;Py_BUILD_CORE;Py_ENABLE_SHARED;WIN32"

-				RuntimeLibrary="2"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-				PreprocessorDefinitions="NDEBUG"

-				Culture="1033"

-				AdditionalIncludeDirectories="..\..\Include"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-				Description="Generate build information..."

-				CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release $(IntDir)"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="$(IntDir)\getbuildinfo.o"

-				OutputFile="$(OutDir)\$(PyDllName).dll"

-				IgnoreDefaultLibraryNames="libc"

-				ProgramDatabaseFile="$(OutDir)$(PyDllName).pdb"

-				BaseAddress="0x1e000000"

-				ImportLibrary="$(OutDir)$(PyDllName).lib"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Debug|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyproject.vsprops;.\debug.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalOptions="/Zm200 "

-				Optimization="0"

-				InlineFunctionExpansion="0"

-				EnableIntrinsicFunctions="false"

-				AdditionalIncludeDirectories="..\..\Python;..\..\Modules\zlib"

-				PreprocessorDefinitions="_USRDLL;Py_BUILD_CORE;Py_ENABLE_SHARED;WIN32"

-				RuntimeLibrary="3"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-				PreprocessorDefinitions="_DEBUG"

-				Culture="1033"

-				AdditionalIncludeDirectories="..\..\Include"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-				Description="Generate build information..."

-				CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Debug $(IntDir)"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="$(IntDir)\getbuildinfo.o"

-				OutputFile="$(OutDir)\$(PyDllName)_d.dll"

-				IgnoreDefaultLibraryNames="libc"

-				ProgramDatabaseFile="$(OutDir)$(PyDllName)_d.pdb"

-				BaseAddress="0x1e000000"

-				ImportLibrary="$(OutDir)$(PyDllName)_d.lib"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Debug|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyproject.vsprops;.\x64.vsprops;.\debug.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalOptions="/Zm200 "

-				Optimization="0"

-				InlineFunctionExpansion="0"

-				EnableIntrinsicFunctions="false"

-				AdditionalIncludeDirectories="..\..\Python;..\..\Modules\zlib"

-				PreprocessorDefinitions="_USRDLL;Py_BUILD_CORE;Py_ENABLE_SHARED;WIN32"

-				RuntimeLibrary="3"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-				PreprocessorDefinitions="_DEBUG"

-				Culture="1033"

-				AdditionalIncludeDirectories="..\..\Include"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-				Description="Generate build information..."

-				CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Debug $(IntDir)"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="$(IntDir)\getbuildinfo.o"

-				OutputFile="$(OutDir)\$(PyDllName)_d.dll"

-				IgnoreDefaultLibraryNames="libc"

-				ProgramDatabaseFile="$(OutDir)$(PyDllName)_d.pdb"

-				BaseAddress="0x1e000000"

-				ImportLibrary="$(OutDir)$(PyDllName)_d.lib"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyproject.vsprops;.\release.vsprops;.\pginstrument.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalOptions="/Zm200 "

-				AdditionalIncludeDirectories="..\..\Python;..\..\Modules\zlib"

-				PreprocessorDefinitions="_USRDLL;Py_BUILD_CORE;Py_ENABLE_SHARED;WIN32"

-				RuntimeLibrary="2"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-				PreprocessorDefinitions="NDEBUG"

-				Culture="1033"

-				AdditionalIncludeDirectories="..\..\Include"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-				Description="Generate build information..."

-				CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release $(IntDir)"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="$(IntDir)\getbuildinfo.o"

-				OutputFile="$(OutDir)\$(PyDllName).dll"

-				IgnoreDefaultLibraryNames="libc"

-				ProgramDatabaseFile="$(OutDir)$(PyDllName).pdb"

-				BaseAddress="0x1e000000"

-				ImportLibrary="$(OutDirPGI)$(PyDllName).lib"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyproject.vsprops;.\x64.vsprops;.\release.vsprops;.\pginstrument.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalOptions="/Zm200 "

-				AdditionalIncludeDirectories="..\..\Python;..\..\Modules\zlib"

-				PreprocessorDefinitions="_USRDLL;Py_BUILD_CORE;Py_ENABLE_SHARED;WIN32"

-				RuntimeLibrary="2"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-				PreprocessorDefinitions="NDEBUG"

-				Culture="1033"

-				AdditionalIncludeDirectories="..\..\Include"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-				Description="Generate build information..."

-				CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release $(IntDir)"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="$(IntDir)\getbuildinfo.o"

-				OutputFile="$(OutDir)\$(PyDllName).dll"

-				IgnoreDefaultLibraryNames="libc"

-				ProgramDatabaseFile="$(OutDir)$(PyDllName).pdb"

-				BaseAddress="0x1e000000"

-				ImportLibrary="$(OutDirPGI)$(PyDllName).lib"

-				TargetMachine="17"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyproject.vsprops;.\release.vsprops;.\pgupdate.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalOptions="/Zm200 "

-				AdditionalIncludeDirectories="..\..\Python;..\..\Modules\zlib"

-				PreprocessorDefinitions="_USRDLL;Py_BUILD_CORE;Py_ENABLE_SHARED;WIN32"

-				RuntimeLibrary="2"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-				PreprocessorDefinitions="NDEBUG"

-				Culture="1033"

-				AdditionalIncludeDirectories="..\..\Include"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-				Description="Generate build information..."

-				CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release ($IntDir)"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="$(IntDir)\getbuildinfo.o"

-				OutputFile="$(OutDir)\$(PyDllName).dll"

-				IgnoreDefaultLibraryNames="libc"

-				ProgramDatabaseFile="$(OutDir)$(PyDllName).pdb"

-				BaseAddress="0x1e000000"

-				ImportLibrary="$(OutDirPGI)$(PyDllName).lib"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyproject.vsprops;.\x64.vsprops;.\release.vsprops;.\pgupdate.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalOptions="/Zm200 "

-				AdditionalIncludeDirectories="..\..\Python;..\..\Modules\zlib"

-				PreprocessorDefinitions="_USRDLL;Py_BUILD_CORE;Py_ENABLE_SHARED;WIN32"

-				RuntimeLibrary="2"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-				PreprocessorDefinitions="NDEBUG"

-				Culture="1033"

-				AdditionalIncludeDirectories="..\..\Include"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-				Description="Generate build information..."

-				CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release $(IntDir)"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="$(IntDir)\getbuildinfo.o"

-				OutputFile="$(OutDir)\$(PyDllName).dll"

-				IgnoreDefaultLibraryNames="libc"

-				ProgramDatabaseFile="$(OutDir)$(PyDllName).pdb"

-				BaseAddress="0x1e000000"

-				ImportLibrary="$(OutDirPGI)$(PyDllName).lib"

-				TargetMachine="17"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<Filter

-			Name="Include"

-			>

-			<File

-				RelativePath="..\..\Include\abstract.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\accu.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\asdl.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\ast.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\bitset.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\boolobject.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\bytes_methods.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\bytearrayobject.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\bytesobject.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\cellobject.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\ceval.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\classobject.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\code.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\codecs.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\compile.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\complexobject.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\datetime.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\descrobject.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\dictobject.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\dynamic_annotations.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\enumobject.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\errcode.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\eval.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\fileobject.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\fileutils.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\floatobject.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\formatter_unicode.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\frameobject.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\funcobject.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\genobject.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\graminit.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\grammar.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\import.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\intrcheck.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\iterobject.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\listobject.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\longintrepr.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\longobject.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\marshal.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\memoryobject.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\metagrammar.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\methodobject.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\modsupport.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\moduleobject.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\node.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\object.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\objimpl.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\opcode.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\osdefs.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\parsetok.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\patchlevel.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\pgen.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\pgenheaders.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\py_curses.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\pyarena.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\pycapsule.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\pyctype.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\pydebug.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\pyerrors.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\pyexpat.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\pyfpe.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\pygetopt.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\pymactoolbox.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\pymath.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\pytime.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\pymem.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\pyport.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\pystate.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\pystrcmp.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\pystrtod.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\dtoa.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\Python-ast.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\Python.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\pythonrun.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\pythread.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\rangeobject.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\setobject.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\sliceobject.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\structmember.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\structseq.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\symtable.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\sysmodule.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\timefuncs.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\token.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\traceback.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\tupleobject.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\ucnhash.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\unicodeobject.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Include\weakrefobject.h"

-				>

-			</File>

-		</Filter>

-		<Filter

-			Name="Modules"

-			>

-			<File

-				RelativePath="..\..\Modules\_bisectmodule.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_codecsmodule.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_collectionsmodule.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_csv.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_functoolsmodule.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_heapqmodule.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_json.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_localemodule.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_lsprof.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_math.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_math.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_pickle.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_randommodule.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_sre.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_struct.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_time.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_time.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_weakref.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\arraymodule.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\atexitmodule.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\audioop.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\binascii.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\cmathmodule.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_datetimemodule.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\errnomodule.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\gcmodule.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\itertoolsmodule.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\main.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\mathmodule.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\md5module.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\mmapmodule.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\operator.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\parsermodule.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\posixmodule.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\rotatingtree.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\rotatingtree.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\sha1module.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\sha256module.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\sha512module.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\signalmodule.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\symtablemodule.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\_threadmodule.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\timemodule.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\xxsubtype.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\zipimport.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\zlibmodule.c"

-				>

-			</File>

-			<Filter

-				Name="_io"

-				>

-				<File

-					RelativePath="..\..\Modules\_io\fileio.c"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\_io\bytesio.c"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\_io\stringio.c"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\_io\bufferedio.c"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\_io\iobase.c"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\_io\textio.c"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\_io\_iomodule.c"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\_io\_iomodule.h"

-					>

-				</File>

-			</Filter>

-			<Filter

-				Name="zlib"

-				>

-				<File

-					RelativePath="..\..\Modules\zlib\adler32.c"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\zlib\compress.c"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\zlib\crc32.c"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\zlib\crc32.h"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\zlib\deflate.c"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\zlib\deflate.h"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\zlib\gzio.c"

-					>

-					<FileConfiguration

-						Name="Release|Win32"

-						>

-						<Tool

-							Name="VCCLCompilerTool"

-							PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE"

-						/>

-					</FileConfiguration>

-					<FileConfiguration

-						Name="Release|Win64"

-						>

-						<Tool

-							Name="VCCLCompilerTool"

-							PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE"

-						/>

-					</FileConfiguration>

-					<FileConfiguration

-						Name="Debug|Win32"

-						>

-						<Tool

-							Name="VCCLCompilerTool"

-							PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE"

-						/>

-					</FileConfiguration>

-					<FileConfiguration

-						Name="Debug|Win64"

-						>

-						<Tool

-							Name="VCCLCompilerTool"

-							PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE"

-						/>

-					</FileConfiguration>

-					<FileConfiguration

-						Name="PGInstrument|Win32"

-						>

-						<Tool

-							Name="VCCLCompilerTool"

-							PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE"

-						/>

-					</FileConfiguration>

-					<FileConfiguration

-						Name="PGInstrument|Win64"

-						>

-						<Tool

-							Name="VCCLCompilerTool"

-							PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE"

-						/>

-					</FileConfiguration>

-					<FileConfiguration

-						Name="PGUpdate|Win32"

-						>

-						<Tool

-							Name="VCCLCompilerTool"

-							PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE"

-						/>

-					</FileConfiguration>

-					<FileConfiguration

-						Name="PGUpdate|Win64"

-						>

-						<Tool

-							Name="VCCLCompilerTool"

-							PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE"

-						/>

-					</FileConfiguration>

-				</File>

-				<File

-					RelativePath="..\..\Modules\zlib\infback.c"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\zlib\inffast.c"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\zlib\inffast.h"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\zlib\inffixed.h"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\zlib\inflate.c"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\zlib\inflate.h"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\zlib\inftrees.c"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\zlib\inftrees.h"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\zlib\trees.c"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\zlib\trees.h"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\zlib\uncompr.c"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\zlib\zconf.h"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\zlib\zconf.in.h"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\zlib\zlib.h"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\zlib\zutil.c"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\zlib\zutil.h"

-					>

-				</File>

-			</Filter>

-			<Filter

-				Name="cjkcodecs"

-				>

-				<File

-					RelativePath="..\..\Modules\cjkcodecs\_codecs_cn.c"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\cjkcodecs\_codecs_hk.c"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\cjkcodecs\_codecs_iso2022.c"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\cjkcodecs\_codecs_jp.c"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\cjkcodecs\_codecs_kr.c"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\cjkcodecs\_codecs_tw.c"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\cjkcodecs\alg_jisx0201.h"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\cjkcodecs\cjkcodecs.h"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\cjkcodecs\emu_jisx0213_2000.h"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\cjkcodecs\mappings_cn.h"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\cjkcodecs\mappings_hk.h"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\cjkcodecs\mappings_jisx0213_pair.h"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\cjkcodecs\mappings_jp.h"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\cjkcodecs\mappings_kr.h"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\cjkcodecs\mappings_tw.h"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\cjkcodecs\multibytecodec.c"

-					>

-				</File>

-				<File

-					RelativePath="..\..\Modules\cjkcodecs\multibytecodec.h"

-					>

-				</File>

-			</Filter>

-		</Filter>

-		<Filter

-			Name="Objects"

-			>

-			<File

-				RelativePath="..\..\Objects\abstract.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Objects\accu.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Objects\boolobject.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Objects\bytes_methods.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Objects\bytearrayobject.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Objects\bytesobject.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Objects\capsule.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Objects\cellobject.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Objects\classobject.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Objects\codeobject.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Objects\complexobject.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Objects\stringlib\count.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Objects\descrobject.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Objects\dictobject.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Objects\enumobject.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Objects\exceptions.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Objects\stringlib\fastsearch.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Objects\fileobject.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Objects\stringlib\find.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Objects\floatobject.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Objects\frameobject.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Objects\funcobject.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Objects\genobject.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Objects\iterobject.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Objects\listobject.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Objects\longobject.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Objects\memoryobject.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Objects\methodobject.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Objects\moduleobject.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Objects\object.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Objects\obmalloc.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Objects\stringlib\partition.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Objects\rangeobject.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Objects\setobject.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Objects\sliceobject.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Objects\stringlib\split.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Objects\structseq.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Objects\tupleobject.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Objects\typeobject.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Objects\unicodectype.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Objects\unicodeobject.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Objects\unicodetype_db.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Objects\weakrefobject.c"

-				>

-			</File>

-		</Filter>

-		<Filter

-			Name="Parser"

-			>

-			<File

-				RelativePath="..\..\Parser\acceler.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Parser\bitset.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Parser\firstsets.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Parser\grammar.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Parser\grammar1.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Parser\listnode.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Parser\metagrammar.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Parser\myreadline.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Parser\node.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Parser\parser.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Parser\parser.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Parser\parsetok.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Parser\tokenizer.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Parser\tokenizer.h"

-				>

-			</File>

-		</Filter>

-		<Filter

-			Name="PC"

-			>

-			<File

-				RelativePath="..\..\PC\_subprocess.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\PC\winreg.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\PC\config.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\PC\dl_nt.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\PC\errmap.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\PC\getpathp.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\PC\msvcrtmodule.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\PC\pyconfig.h"

-				>

-			</File>

-		</Filter>

-		<Filter

-			Name="Python"

-			>

-			<File

-				RelativePath="..\..\Python\_warnings.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\asdl.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\ast.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\bltinmodule.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\ceval.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\codecs.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\compile.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\dynamic_annotations.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\dynload_win.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\errors.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\fileutils.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\formatter_unicode.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\frozen.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\future.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\getargs.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\getcompiler.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\getcopyright.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\getopt.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\getplatform.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\getversion.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\graminit.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\import.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\importdl.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\importdl.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\marshal.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\modsupport.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\mysnprintf.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\mystrtoul.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\peephole.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\pyarena.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\pyctype.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\pyfpe.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\pymath.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\pytime.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\pystate.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\pystrcmp.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\pystrtod.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\dtoa.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\Python-ast.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\pythonrun.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\random.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\structmember.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\symtable.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\sysmodule.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\thread.c"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\thread_nt.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Python\traceback.c"

-				>

-			</File>

-		</Filter>

-		<Filter

-			Name="Resource Files"

-			>

-			<File

-				RelativePath="..\..\PC\python_nt.rc"

-				>

-			</File>

-		</Filter>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS8.0/pythonw.vcproj b/PC/VS8.0/pythonw.vcproj
deleted file mode 100644
index 5037b78..0000000
--- a/PC/VS8.0/pythonw.vcproj
+++ /dev/null
@@ -1,618 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="8.00"

-	Name="pythonw"

-	ProjectGUID="{F4229CC3-873C-49AE-9729-DD308ED4CD4A}"

-	TargetFrameworkVersion="131072"

-	>

-	<Platforms>

-		<Platform

-			Name="Win32"

-		/>

-		<Platform

-			Name="x64"

-		/>

-	</Platforms>

-	<ToolFiles>

-	</ToolFiles>

-	<Configurations>

-		<Configuration

-			Name="Debug|Win32"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\debug.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="0"

-				EnableIntrinsicFunctions="false"

-				AdditionalIncludeDirectories=""

-				PreprocessorDefinitions="_WINDOWS"

-				RuntimeLibrary="3"

-				CompileAs="0"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-				PreprocessorDefinitions="_DEBUG"

-				Culture="1033"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				OutputFile="$(OutDir)\pythonw_d.exe"

-				StackReserveSize="2000000"

-				BaseAddress="0x1d000000"

-				TargetMachine="1"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Debug|x64"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\x64.vsprops;.\debug.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="0"

-				EnableIntrinsicFunctions="false"

-				AdditionalIncludeDirectories=""

-				PreprocessorDefinitions="_WINDOWS"

-				RuntimeLibrary="3"

-				CompileAs="0"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-				PreprocessorDefinitions="_DEBUG"

-				Culture="1033"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				OutputFile="$(OutDir)\pythonw_d.exe"

-				StackReserveSize="2000000"

-				BaseAddress="0x1d000000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|Win32"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\release.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories=""

-				PreprocessorDefinitions="_WINDOWS"

-				StringPooling="true"

-				RuntimeLibrary="2"

-				EnableFunctionLevelLinking="true"

-				CompileAs="0"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-				PreprocessorDefinitions="NDEBUG"

-				Culture="1033"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				OutputFile="$(OutDir)\pythonw.exe"

-				StackReserveSize="2000000"

-				BaseAddress="0x1d000000"

-				TargetMachine="1"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|x64"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\x64.vsprops;.\release.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories=""

-				PreprocessorDefinitions="_WINDOWS"

-				StringPooling="true"

-				RuntimeLibrary="2"

-				EnableFunctionLevelLinking="true"

-				CompileAs="0"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-				PreprocessorDefinitions="NDEBUG"

-				Culture="1033"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				OutputFile="$(OutDir)\pythonw.exe"

-				StackReserveSize="2000000"

-				BaseAddress="0x1d000000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|Win32"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\release.vsprops;.\pginstrument.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories=""

-				PreprocessorDefinitions="_WINDOWS"

-				StringPooling="true"

-				RuntimeLibrary="2"

-				EnableFunctionLevelLinking="true"

-				CompileAs="0"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-				PreprocessorDefinitions="NDEBUG"

-				Culture="1033"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				OutputFile="$(OutDir)\pythonw.exe"

-				StackReserveSize="2000000"

-				BaseAddress="0x1d000000"

-				ImportLibrary=""

-				TargetMachine="1"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|x64"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\x64.vsprops;.\release.vsprops;.\pginstrument.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories=""

-				PreprocessorDefinitions="_WINDOWS"

-				StringPooling="true"

-				RuntimeLibrary="2"

-				EnableFunctionLevelLinking="true"

-				CompileAs="0"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-				PreprocessorDefinitions="NDEBUG"

-				Culture="1033"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				OutputFile="$(OutDir)\pythonw.exe"

-				StackReserveSize="2000000"

-				BaseAddress="0x1d000000"

-				ImportLibrary=""

-				TargetMachine="17"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|Win32"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\release.vsprops;.\pgupdate.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories=""

-				PreprocessorDefinitions="_WINDOWS"

-				StringPooling="true"

-				RuntimeLibrary="2"

-				EnableFunctionLevelLinking="true"

-				CompileAs="0"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-				PreprocessorDefinitions="NDEBUG"

-				Culture="1033"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				OutputFile="$(OutDir)\pythonw.exe"

-				StackReserveSize="2000000"

-				BaseAddress="0x1d000000"

-				ImportLibrary=""

-				TargetMachine="1"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|x64"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\x64.vsprops;.\release.vsprops;.\pgupdate.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories=""

-				PreprocessorDefinitions="_WINDOWS"

-				StringPooling="true"

-				RuntimeLibrary="2"

-				EnableFunctionLevelLinking="true"

-				CompileAs="0"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-				PreprocessorDefinitions="NDEBUG"

-				Culture="1033"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				OutputFile="$(OutDir)\pythonw.exe"

-				StackReserveSize="2000000"

-				BaseAddress="0x1d000000"

-				ImportLibrary=""

-				TargetMachine="17"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<Filter

-			Name="Resource Files"

-			>

-			<File

-				RelativePath="..\..\PC\python_exe.rc"

-				>

-			</File>

-		</Filter>

-		<Filter

-			Name="Source Files"

-			>

-			<File

-				RelativePath="..\..\PC\WinMain.c"

-				>

-			</File>

-		</Filter>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS8.0/release.vsprops b/PC/VS8.0/release.vsprops
deleted file mode 100644
index 08def90..0000000
--- a/PC/VS8.0/release.vsprops
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioPropertySheet

-	ProjectType="Visual C++"

-	Version="8.00"

-	Name="release"

-	>

-	<Tool

-		Name="VCCLCompilerTool"

-		PreprocessorDefinitions="NDEBUG"

-	/>

-	<UserMacro

-		Name="KillPythonExe"

-		Value="$(OutDir)\kill_python.exe"

-	/>	

-</VisualStudioPropertySheet>

diff --git a/PC/VS8.0/rmpyc.py b/PC/VS8.0/rmpyc.py
deleted file mode 100644
index 18e1705..0000000
--- a/PC/VS8.0/rmpyc.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# Remove all the .pyc and .pyo files under ../Lib.
-
-
-def deltree(root):
-    import os
-    from os.path import join
-
-    npyc = npyo = 0
-    for root, dirs, files in os.walk(root):
-        for name in files:
-            delete = False
-            if name.endswith('.pyc'):
-                delete = True
-                npyc += 1
-            elif name.endswith('.pyo'):
-                delete = True
-                npyo += 1
-
-            if delete:
-                os.remove(join(root, name))
-
-    return npyc, npyo
-
-npyc, npyo = deltree("../../Lib")
-print(npyc, ".pyc deleted,", npyo, ".pyo deleted")
diff --git a/PC/VS8.0/rt.bat b/PC/VS8.0/rt.bat
deleted file mode 100644
index 0429e19..0000000
--- a/PC/VS8.0/rt.bat
+++ /dev/null
@@ -1,52 +0,0 @@
-@echo off
-rem Run Tests.  Run the regression test suite.
-rem Usage:  rt [-d] [-O] [-q] regrtest_args
-rem -d   Run Debug build (python_d.exe).  Else release build.
-rem -O   Run python.exe or python_d.exe (see -d) with -O.
-rem -q   "quick" -- normally the tests are run twice, the first time
-rem      after deleting all the .py[co] files reachable from Lib/.
-rem      -q runs the tests just once, and without deleting .py[co] files.
-rem All leading instances of these switches are shifted off, and
-rem whatever remains is passed to regrtest.py.  For example,
-rem     rt -O -d -x test_thread
-rem runs
-rem     python_d -O ../lib/test/regrtest.py -x test_thread
-rem twice, and
-rem     rt -q -g test_binascii
-rem runs
-rem     python_d ../lib/test/regrtest.py -g test_binascii
-rem to generate the expected-output file for binascii quickly.
-rem
-rem Confusing:  if you want to pass a comma-separated list, like
-rem     -u network,largefile
-rem then you have to quote it on the rt line, like
-rem     rt -u "network,largefile"
-
-setlocal
-
-set exe=python
-set qmode=
-set dashO=
-PATH %PATH%;%~dp0..\..\..\tcltk\bin
-
-:CheckOpts
-if "%1"=="-O" (set dashO=-O)     & shift & goto CheckOpts
-if "%1"=="-q" (set qmode=yes)    & shift & goto CheckOpts
-if "%1"=="-d" (set exe=python_d) & shift & goto CheckOpts
-
-set cmd=%exe% %dashO% -E ../../lib/test/regrtest.py %1 %2 %3 %4 %5 %6 %7 %8 %9
-if defined qmode goto Qmode
-
-echo Deleting .pyc/.pyo files ...
-%exe% rmpyc.py
-
-echo on
-%cmd%
-@echo off
-
-echo About to run again without deleting .pyc/.pyo first:
-pause
-
-:Qmode
-echo on
-%cmd%
diff --git a/PC/VS8.0/select.vcproj b/PC/VS8.0/select.vcproj
deleted file mode 100644
index 671fc16..0000000
--- a/PC/VS8.0/select.vcproj
+++ /dev/null
@@ -1,537 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="8.00"

-	Name="select"

-	ProjectGUID="{18CAE28C-B454-46C1-87A0-493D91D97F03}"

-	RootNamespace="select"

-	Keyword="Win32Proj"

-	TargetFrameworkVersion="196613"

-	>

-	<Platforms>

-		<Platform

-			Name="Win32"

-		/>

-		<Platform

-			Name="x64"

-		/>

-	</Platforms>

-	<ToolFiles>

-	</ToolFiles>

-	<Configurations>

-		<Configuration

-			Name="Debug|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd_d.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib"

-				IgnoreDefaultLibraryNames="libc"

-				BaseAddress="0x1D110000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Debug|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd_d.vsprops;.\x64.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib"

-				IgnoreDefaultLibraryNames="libc"

-				BaseAddress="0x1D110000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib"

-				IgnoreDefaultLibraryNames="libc"

-				BaseAddress="0x1D110000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib"

-				IgnoreDefaultLibraryNames="libc"

-				BaseAddress="0x1D110000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\pginstrument.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib"

-				IgnoreDefaultLibraryNames="libc"

-				BaseAddress="0x1D110000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops;.\pginstrument.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib"

-				IgnoreDefaultLibraryNames="libc"

-				BaseAddress="0x1D110000"

-				TargetMachine="17"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\pgupdate.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib"

-				IgnoreDefaultLibraryNames="libc"

-				BaseAddress="0x1D110000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops;.\pgupdate.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib"

-				IgnoreDefaultLibraryNames="libc"

-				BaseAddress="0x1D110000"

-				TargetMachine="17"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<Filter

-			Name="Source Files"

-			>

-			<File

-				RelativePath="..\..\Modules\selectmodule.c"

-				>

-			</File>

-		</Filter>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS8.0/sqlite3.vcproj b/PC/VS8.0/sqlite3.vcproj
deleted file mode 100644
index 9afbe5d..0000000
--- a/PC/VS8.0/sqlite3.vcproj
+++ /dev/null
@@ -1,537 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="8.00"

-	Name="sqlite3"

-	ProjectGUID="{A1A295E5-463C-437F-81CA-1F32367685DA}"

-	RootNamespace="sqlite3"

-	Keyword="Win32Proj"

-	TargetFrameworkVersion="196613"

-	>

-	<Platforms>

-		<Platform

-			Name="Win32"

-		/>

-		<Platform

-			Name="x64"

-		/>

-	</Platforms>

-	<ToolFiles>

-	</ToolFiles>

-	<Configurations>

-		<Configuration

-			Name="Debug|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\sqlite3.vsprops;.\debug.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories=""

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				OutputFile="$(OutDir)\$(ProjectName)_d.dll"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Debug|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\sqlite3.vsprops;.\debug.vsprops;.\x64.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories=""

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				OutputFile="$(OutDir)\$(ProjectName)_d.dll"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\sqlite3.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories=""

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				OutputFile="$(OutDir)\$(ProjectName).dll"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\sqlite3.vsprops;.\x64.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories=""

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				OutputFile="$(OutDir)\$(ProjectName).dll"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\sqlite3.vsprops;.\pginstrument.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories="&quot;..\..\..\sqlite-3.6.21&quot;"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				OutputFile="$(OutDir)\$(ProjectName).dll"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\sqlite3.vsprops;.\x64.vsprops;.\pginstrument.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories=""

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\sqlite3.vsprops;.\pgupdate.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories=""

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				OutputFile="$(OutDir)\$(ProjectName).dll"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\sqlite3.vsprops;.\x64.vsprops;.\pgupdate.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				AdditionalIncludeDirectories=""

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<Filter

-			Name="Header Files"

-			>

-			<File

-				RelativePath="..\..\..\sqlite-3.6.21\sqlite3.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\..\sqlite-3.6.21\sqlite3ext.h"

-				>

-			</File>

-		</Filter>

-		<Filter

-			Name="Source Files"

-			>

-			<File

-				RelativePath="..\..\..\sqlite-3.6.21\sqlite3.c"

-				>

-			</File>

-		</Filter>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS8.0/sqlite3.vsprops b/PC/VS8.0/sqlite3.vsprops
deleted file mode 100644
index 8300328..0000000
--- a/PC/VS8.0/sqlite3.vsprops
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioPropertySheet

-	ProjectType="Visual C++"

-	Version="8.00"

-	Name="sqlite3"

-	InheritedPropertySheets=".\pyproject.vsprops"

-	>

-	<Tool

-		Name="VCCLCompilerTool"

-		AdditionalIncludeDirectories="..\..\..\sqlite-3.6.21"

-		PreprocessorDefinitions="SQLITE_API=__declspec(dllexport)"

-		WarningLevel="1"

-	/>

-</VisualStudioPropertySheet>

diff --git a/PC/VS8.0/ssl.vcproj b/PC/VS8.0/ssl.vcproj
deleted file mode 100644
index f0d635e..0000000
--- a/PC/VS8.0/ssl.vcproj
+++ /dev/null
@@ -1,189 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="8.00"

-	Name="ssl"

-	ProjectGUID="{E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}"

-	RootNamespace="ssl"

-	Keyword="MakeFileProj"

-	TargetFrameworkVersion="196613"

-	>

-	<Platforms>

-		<Platform

-			Name="Win32"

-		/>

-		<Platform

-			Name="x64"

-		/>

-	</Platforms>

-	<ToolFiles>

-	</ToolFiles>

-	<Configurations>

-		<Configuration

-			Name="Debug|Win32"

-			ConfigurationType="0"

-			InheritedPropertySheets=".\pyd_d.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCNMakeTool"

-				BuildCommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"

-				ReBuildCommandLine=""

-				CleanCommandLine=""

-				Output=""

-				PreprocessorDefinitions=""

-				IncludeSearchPath=""

-				ForcedIncludes=""

-				AssemblySearchPath=""

-				ForcedUsingAssemblies=""

-				CompileAsManaged=""

-			/>

-		</Configuration>

-		<Configuration

-			Name="Debug|x64"

-			ConfigurationType="0"

-			InheritedPropertySheets=".\pyd_d.vsprops;.\x64.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCNMakeTool"

-				BuildCommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"

-				ReBuildCommandLine=""

-				CleanCommandLine=""

-				Output=""

-				PreprocessorDefinitions=""

-				IncludeSearchPath=""

-				ForcedIncludes=""

-				AssemblySearchPath=""

-				ForcedUsingAssemblies=""

-				CompileAsManaged=""

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|Win32"

-			ConfigurationType="0"

-			InheritedPropertySheets=".\pyd.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCNMakeTool"

-				BuildCommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"

-				ReBuildCommandLine=""

-				CleanCommandLine=""

-				Output=""

-				PreprocessorDefinitions=""

-				IncludeSearchPath=""

-				ForcedIncludes=""

-				AssemblySearchPath=""

-				ForcedUsingAssemblies=""

-				CompileAsManaged=""

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|x64"

-			ConfigurationType="0"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCNMakeTool"

-				BuildCommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"

-				ReBuildCommandLine=""

-				CleanCommandLine=""

-				Output=""

-				PreprocessorDefinitions=""

-				IncludeSearchPath=""

-				ForcedIncludes=""

-				AssemblySearchPath=""

-				ForcedUsingAssemblies=""

-				CompileAsManaged=""

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|Win32"

-			ConfigurationType="0"

-			InheritedPropertySheets=".\pyd.vsprops;.\pginstrument.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCNMakeTool"

-				BuildCommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"

-				ReBuildCommandLine=""

-				CleanCommandLine=""

-				Output=""

-				PreprocessorDefinitions=""

-				IncludeSearchPath=""

-				ForcedIncludes=""

-				AssemblySearchPath=""

-				ForcedUsingAssemblies=""

-				CompileAsManaged=""

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|x64"

-			ConfigurationType="0"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops;.\pginstrument.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCNMakeTool"

-				BuildCommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"

-				ReBuildCommandLine=""

-				CleanCommandLine=""

-				Output=""

-				PreprocessorDefinitions=""

-				IncludeSearchPath=""

-				ForcedIncludes=""

-				AssemblySearchPath=""

-				ForcedUsingAssemblies=""

-				CompileAsManaged=""

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|Win32"

-			ConfigurationType="0"

-			InheritedPropertySheets=".\pyd.vsprops;.\pgupdate.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCNMakeTool"

-				BuildCommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"

-				ReBuildCommandLine=""

-				CleanCommandLine=""

-				Output=""

-				PreprocessorDefinitions=""

-				IncludeSearchPath=""

-				ForcedIncludes=""

-				AssemblySearchPath=""

-				ForcedUsingAssemblies=""

-				CompileAsManaged=""

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|x64"

-			ConfigurationType="0"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops;.\pgupdate.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCNMakeTool"

-				BuildCommandLine="cd &quot;$(SolutionDir)&quot;&#x0D;&#x0A;&quot;$(PythonExe)&quot; build_ssl.py Release $(PlatformName) -a&#x0D;&#x0A;"

-				ReBuildCommandLine=""

-				CleanCommandLine=""

-				Output=""

-				PreprocessorDefinitions=""

-				IncludeSearchPath=""

-				ForcedIncludes=""

-				AssemblySearchPath=""

-				ForcedUsingAssemblies=""

-				CompileAsManaged=""

-			/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS8.0/unicodedata.vcproj b/PC/VS8.0/unicodedata.vcproj
deleted file mode 100644
index 4cf7d23..0000000
--- a/PC/VS8.0/unicodedata.vcproj
+++ /dev/null
@@ -1,533 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="8.00"

-	Name="unicodedata"

-	ProjectGUID="{ECC7CEAC-A5E5-458E-BB9E-2413CC847881}"

-	RootNamespace="unicodedata"

-	Keyword="Win32Proj"

-	TargetFrameworkVersion="196613"

-	>

-	<Platforms>

-		<Platform

-			Name="Win32"

-		/>

-		<Platform

-			Name="x64"

-		/>

-	</Platforms>

-	<ToolFiles>

-	</ToolFiles>

-	<Configurations>

-		<Configuration

-			Name="Debug|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd_d.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				BaseAddress="0x1D120000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Debug|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd_d.vsprops;.\x64.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				BaseAddress="0x1D120000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				BaseAddress="0x1D120000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				BaseAddress="0x1D120000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\pginstrument.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				BaseAddress="0x1D120000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops;.\pginstrument.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				BaseAddress="0x1D120000"

-				TargetMachine="17"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\pgupdate.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				BaseAddress="0x1D120000"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops;.\pgupdate.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				BaseAddress="0x1D120000"

-				TargetMachine="17"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<Filter

-			Name="Header Files"

-			>

-			<File

-				RelativePath="..\..\Modules\unicodedata_db.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\Modules\unicodename_db.h"

-				>

-			</File>

-		</Filter>

-		<Filter

-			Name="Source Files"

-			>

-			<File

-				RelativePath="..\..\Modules\unicodedata.c"

-				>

-			</File>

-		</Filter>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS8.0/w9xpopen.vcproj b/PC/VS8.0/w9xpopen.vcproj
deleted file mode 100644
index e14d206..0000000
--- a/PC/VS8.0/w9xpopen.vcproj
+++ /dev/null
@@ -1,576 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="8.00"

-	Name="w9xpopen"

-	ProjectGUID="{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}"

-	RootNamespace="w9xpopen"

-	TargetFrameworkVersion="131072"

-	>

-	<Platforms>

-		<Platform

-			Name="Win32"

-		/>

-		<Platform

-			Name="x64"

-		/>

-	</Platforms>

-	<ToolFiles>

-	</ToolFiles>

-	<Configurations>

-		<Configuration

-			Name="Debug|Win32"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\debug.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="0"

-				BasicRuntimeChecks="3"

-				RuntimeLibrary="1"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				SubSystem="1"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Debug|x64"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\x64.vsprops;.\debug.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			CharacterSet="2"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="0"

-				BasicRuntimeChecks="3"

-				RuntimeLibrary="1"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				SubSystem="1"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|Win32"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\release.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			CharacterSet="2"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				StringPooling="true"

-				RuntimeLibrary="0"

-				EnableFunctionLevelLinking="true"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				GenerateDebugInformation="false"

-				SubSystem="1"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|x64"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\x64.vsprops;.\release.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			CharacterSet="2"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				StringPooling="true"

-				RuntimeLibrary="0"

-				EnableFunctionLevelLinking="true"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				GenerateDebugInformation="false"

-				SubSystem="1"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|Win32"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\release.vsprops;.\pginstrument.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			CharacterSet="2"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				StringPooling="true"

-				RuntimeLibrary="0"

-				EnableFunctionLevelLinking="true"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				GenerateDebugInformation="false"

-				SubSystem="1"

-				ImportLibrary=""

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|x64"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\x64.vsprops;.\release.vsprops;.\pginstrument.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			CharacterSet="2"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				StringPooling="true"

-				RuntimeLibrary="0"

-				EnableFunctionLevelLinking="true"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				GenerateDebugInformation="false"

-				SubSystem="1"

-				ImportLibrary=""

-				TargetMachine="17"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|Win32"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\release.vsprops;.\pgupdate.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			CharacterSet="2"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				StringPooling="true"

-				RuntimeLibrary="0"

-				EnableFunctionLevelLinking="true"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				GenerateDebugInformation="false"

-				SubSystem="1"

-				ImportLibrary=""

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|x64"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\x64.vsprops;.\release.vsprops;.\pgupdate.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			CharacterSet="2"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				StringPooling="true"

-				RuntimeLibrary="0"

-				EnableFunctionLevelLinking="true"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				GenerateDebugInformation="false"

-				SubSystem="1"

-				ImportLibrary=""

-				TargetMachine="17"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<Filter

-			Name="Source Files"

-			>

-			<File

-				RelativePath="..\..\PC\w9xpopen.c"

-				>

-			</File>

-		</Filter>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS8.0/winsound.vcproj b/PC/VS8.0/winsound.vcproj
deleted file mode 100644
index d379357..0000000
--- a/PC/VS8.0/winsound.vcproj
+++ /dev/null
@@ -1,523 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="8.00"

-	Name="winsound"

-	ProjectGUID="{28B5D777-DDF2-4B6B-B34F-31D938813856}"

-	RootNamespace="winsound"

-	Keyword="Win32Proj"

-	TargetFrameworkVersion="196613"

-	>

-	<Platforms>

-		<Platform

-			Name="Win32"

-		/>

-		<Platform

-			Name="x64"

-		/>

-	</Platforms>

-	<ToolFiles>

-	</ToolFiles>

-	<Configurations>

-		<Configuration

-			Name="Debug|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd_d.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="winmm.lib"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Debug|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd_d.vsprops;.\x64.vsprops"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="winmm.lib"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="winmm.lib"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="winmm.lib"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\pginstrument.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="winmm.lib"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops;.\pginstrument.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="winmm.lib"

-				TargetMachine="17"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|Win32"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\pgupdate.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="winmm.lib"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|x64"

-			ConfigurationType="2"

-			InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops;.\pgupdate.vsprops"

-			CharacterSet="0"

-			WholeProgramOptimization="1"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				AdditionalDependencies="winmm.lib"

-				TargetMachine="17"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<Filter

-			Name="Source Files"

-			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"

-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"

-			>

-			<File

-				RelativePath="..\..\PC\winsound.c"

-				>

-			</File>

-		</Filter>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/VS8.0/x64.vsprops b/PC/VS8.0/x64.vsprops
deleted file mode 100644
index 9f88d44..0000000
--- a/PC/VS8.0/x64.vsprops
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioPropertySheet

-	ProjectType="Visual C++"

-	Version="8.00"

-	Name="amd64"

-	OutputDirectory="$(SolutionDir)\amd64\"

-	IntermediateDirectory="$(SolutionDir)$(PlatformName)-temp-$(ConfigurationName)\$(ProjectName)\"

-	>

-	<Tool

-		Name="VCCLCompilerTool"

-		AdditionalOptions="/USECL:MS_OPTERON /GS-"

-		PreprocessorDefinitions="_WIN64;_M_X64"

-	/>

-	<Tool

-		Name="VCLinkerTool"

-		TargetMachine="17"

-	/>

-	<UserMacro

-		Name="PythonExe"

-		Value="$(HOST_PYTHON)"

-	/>

-</VisualStudioPropertySheet>

diff --git a/PC/VS9.0/_sqlite3.vcproj b/PC/VS9.0/_sqlite3.vcproj
index f7100f1..82c57ae 100644
--- a/PC/VS9.0/_sqlite3.vcproj
+++ b/PC/VS9.0/_sqlite3.vcproj
@@ -555,10 +555,6 @@
 				>

 			</File>

 			<File

-				RelativePath="..\..\Modules\_sqlite\sqlitecompat.h"

-				>

-			</File>

-			<File

 				RelativePath="..\..\Modules\_sqlite\statement.h"

 				>

 			</File>

diff --git a/PC/VS9.0/_ssl.vcproj b/PC/VS9.0/_ssl.vcproj
index 97aa294..b47dc27 100644
--- a/PC/VS9.0/_ssl.vcproj
+++ b/PC/VS9.0/_ssl.vcproj
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="Windows-1252"?>

 <VisualStudioProject

 	ProjectType="Visual C++"

-	Version="9.00"

+	Version="9,00"

 	Name="_ssl"

 	ProjectGUID="{C6E20F84-3247-4AD6-B051-B073268F73BA}"

 	RootNamespace="_ssl"

@@ -56,7 +56,7 @@
 			/>

 			<Tool

 				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib $(opensslDir)\out32\libeay32.lib $(opensslDir)\out32\ssleay32.lib"

+				AdditionalDependencies="ws2_32.lib crypt32.lib $(opensslDir)\out32\libeay32.lib $(opensslDir)\out32\ssleay32.lib"

 			/>

 			<Tool

 				Name="VCALinkTool"

@@ -118,7 +118,7 @@
 			/>

 			<Tool

 				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib $(opensslDir)\out64\libeay32.lib $(opensslDir)\out64\ssleay32.lib"

+				AdditionalDependencies="ws2_32.lib crypt32.lib $(opensslDir)\out64\libeay32.lib $(opensslDir)\out64\ssleay32.lib"

 			/>

 			<Tool

 				Name="VCALinkTool"

@@ -180,7 +180,7 @@
 			/>

 			<Tool

 				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib $(opensslDir)\out32\libeay32.lib $(opensslDir)\out32\ssleay32.lib"

+				AdditionalDependencies="ws2_32.lib crypt32.lib $(opensslDir)\out32\libeay32.lib $(opensslDir)\out32\ssleay32.lib"

 			/>

 			<Tool

 				Name="VCALinkTool"

@@ -243,7 +243,7 @@
 			/>

 			<Tool

 				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib $(opensslDir)\out64\libeay32.lib $(opensslDir)\out64\ssleay32.lib"

+				AdditionalDependencies="ws2_32.lib crypt32.lib $(opensslDir)\out64\libeay32.lib $(opensslDir)\out64\ssleay32.lib"

 			/>

 			<Tool

 				Name="VCALinkTool"

@@ -305,7 +305,7 @@
 			/>

 			<Tool

 				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib $(opensslDir)\out32\libeay32.lib $(opensslDir)\out32\ssleay32.lib"

+				AdditionalDependencies="ws2_32.lib crypt32.lib $(opensslDir)\out32\libeay32.lib $(opensslDir)\out32\ssleay32.lib"

 			/>

 			<Tool

 				Name="VCALinkTool"

@@ -368,7 +368,7 @@
 			/>

 			<Tool

 				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib $(opensslDir)\out64\libeay32.lib $(opensslDir)\out64\ssleay32.lib"

+				AdditionalDependencies="ws2_32.lib crypt32.lib $(opensslDir)\out64\libeay32.lib $(opensslDir)\out64\ssleay32.lib"

 				TargetMachine="17"

 			/>

 			<Tool

@@ -431,7 +431,7 @@
 			/>

 			<Tool

 				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib $(opensslDir)\out32\libeay32.lib $(opensslDir)\out32\ssleay32.lib"

+				AdditionalDependencies="ws2_32.lib crypt32.lib $(opensslDir)\out32\libeay32.lib $(opensslDir)\out32\ssleay32.lib"

 			/>

 			<Tool

 				Name="VCALinkTool"

@@ -494,7 +494,7 @@
 			/>

 			<Tool

 				Name="VCLinkerTool"

-				AdditionalDependencies="ws2_32.lib $(opensslDir)\out64\libeay32.lib $(opensslDir)\out64\ssleay32.lib"

+				AdditionalDependencies="ws2_32.lib crypt32.lib $(opensslDir)\out64\libeay32.lib $(opensslDir)\out64\ssleay32.lib"

 				TargetMachine="17"

 			/>

 			<Tool

diff --git a/PC/VS8.0/_testcapi.vcproj b/PC/VS9.0/_testimportmultiple.vcproj
similarity index 97%
rename from PC/VS8.0/_testcapi.vcproj
rename to PC/VS9.0/_testimportmultiple.vcproj
index 76ad2d8..14d910d 100644
--- a/PC/VS8.0/_testcapi.vcproj
+++ b/PC/VS9.0/_testimportmultiple.vcproj
@@ -1,10 +1,10 @@
 <?xml version="1.0" encoding="Windows-1252"?>

 <VisualStudioProject

 	ProjectType="Visual C++"

-	Version="8.00"

-	Name="_testcapi"

-	ProjectGUID="{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}"

-	RootNamespace="_testcapi"

+	Version="9.00"

+	Name="_testimportmultiple"

+	ProjectGUID="{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}"

+	RootNamespace="_testimportmultiple"

 	Keyword="Win32Proj"

 	TargetFrameworkVersion="196613"

 	>

@@ -511,7 +511,7 @@
 			Name="Source Files"

 			>

 			<File

-				RelativePath="..\..\Modules\_testcapimodule.c"

+				RelativePath="..\..\Modules\_testimportmultiple.c"

 				>

 			</File>

 		</Filter>

diff --git a/PC/VS9.0/kill_python.c b/PC/VS9.0/kill_python.c
index bb323d3..604731f 100644
--- a/PC/VS9.0/kill_python.c
+++ b/PC/VS9.0/kill_python.c
@@ -106,7 +106,7 @@
         /*
          * XXX TODO: if we really wanted to be fancy, we could check the 
          * modules for all processes (not just the python[_d].exe ones)
-         * and see if any of our DLLs are loaded (i.e. python33[_d].dll),
+         * and see if any of our DLLs are loaded (i.e. python34[_d].dll),
          * as that would also inhibit our ability to rebuild the solution.
          * Not worth loosing sleep over though; for now, a simple check 
          * for just the python executable should be sufficient.
diff --git a/PC/VS9.0/pcbuild.sln b/PC/VS9.0/pcbuild.sln
index 8f8cbb6..ba7f69c 100644
--- a/PC/VS9.0/pcbuild.sln
+++ b/PC/VS9.0/pcbuild.sln
@@ -20,11 +20,6 @@
 		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}

 	EndProjectSection

 EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "w9xpopen", "w9xpopen.vcproj", "{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}"

-	ProjectSection(ProjectDependencies) = postProject

-		{6DE10744-E396-40A5-B4E2-1B69AA7C8D31} = {6DE10744-E396-40A5-B4E2-1B69AA7C8D31}

-	EndProjectSection

-EndProject

 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_buildinfo", "make_buildinfo.vcproj", "{C73F0EC1-358B-4177-940F-0846AC8B04CD}"

 EndProject

 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{553EC33E-9816-4996-A660-5D6186A0B0B3}"

@@ -87,6 +82,11 @@
 		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}

 	EndProjectSection

 EndProject

+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_testimportmultiple", "_testimportmultiple.vcproj", "{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}"

+	ProjectSection(ProjectDependencies) = postProject

+		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}

+	EndProjectSection

+EndProject

 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_tkinter", "_tkinter.vcproj", "{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}"

 	ProjectSection(ProjectDependencies) = postProject

 		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}

@@ -420,6 +420,22 @@
 		{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}.Release|Win32.Build.0 = Release|Win32

 		{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}.Release|x64.ActiveCfg = Release|x64

 		{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}.Release|x64.Build.0 = Release|x64

+		{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.Debug|Win32.ActiveCfg = Debug|Win32

+		{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.Debug|Win32.Build.0 = Debug|Win32

+		{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.Debug|x64.ActiveCfg = Debug|x64

+		{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.Debug|x64.Build.0 = Debug|x64

+		{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32

+		{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.PGInstrument|Win32.Build.0 = PGInstrument|Win32

+		{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.PGInstrument|x64.ActiveCfg = PGInstrument|x64

+		{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.PGInstrument|x64.Build.0 = PGInstrument|x64

+		{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32

+		{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.PGUpdate|Win32.Build.0 = PGUpdate|Win32

+		{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.PGUpdate|x64.ActiveCfg = PGUpdate|x64

+		{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.PGUpdate|x64.Build.0 = PGUpdate|x64

+		{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.Release|Win32.ActiveCfg = Release|Win32

+		{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.Release|Win32.Build.0 = Release|Win32

+		{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.Release|x64.ActiveCfg = Release|x64

+		{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.Release|x64.Build.0 = Release|x64

 		{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}.Debug|Win32.ActiveCfg = Debug|Win32

 		{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}.Debug|Win32.Build.0 = Debug|Win32

 		{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}.Debug|x64.ActiveCfg = Debug|x64

@@ -651,6 +667,22 @@
 		{A2697BD3-28C1-4AEC-9106-8B748639FD16}.Release|Win32.Build.0 = Release|Win32

 		{A2697BD3-28C1-4AEC-9106-8B748639FD16}.Release|x64.ActiveCfg = Release|x64

 		{A2697BD3-28C1-4AEC-9106-8B748639FD16}.Release|x64.Build.0 = Release|x64

+		{04F37400-883C-42D7-AE28-6CF9953BF975}.Debug|Win32.ActiveCfg = Debug|Win32

+		{04F37400-883C-42D7-AE28-6CF9953BF975}.Debug|Win32.Build.0 = Debug|Win32

+		{04F37400-883C-42D7-AE28-6CF9953BF975}.Debug|x64.ActiveCfg = Debug|x64

+		{04F37400-883C-42D7-AE28-6CF9953BF975}.Debug|x64.Build.0 = Debug|x64

+		{04F37400-883C-42D7-AE28-6CF9953BF975}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32

+		{04F37400-883C-42D7-AE28-6CF9953BF975}.PGInstrument|Win32.Build.0 = PGInstrument|Win32

+		{04F37400-883C-42D7-AE28-6CF9953BF975}.PGInstrument|x64.ActiveCfg = PGInstrument|x64

+		{04F37400-883C-42D7-AE28-6CF9953BF975}.PGInstrument|x64.Build.0 = PGInstrument|x64

+		{04F37400-883C-42D7-AE28-6CF9953BF975}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32

+		{04F37400-883C-42D7-AE28-6CF9953BF975}.PGUpdate|Win32.Build.0 = PGUpdate|Win32

+		{04F37400-883C-42D7-AE28-6CF9953BF975}.PGUpdate|x64.ActiveCfg = PGUpdate|x64

+		{04F37400-883C-42D7-AE28-6CF9953BF975}.PGUpdate|x64.Build.0 = PGUpdate|x64

+		{04F37400-883C-42D7-AE28-6CF9953BF975}.Release|Win32.ActiveCfg = Release|Win32

+		{04F37400-883C-42D7-AE28-6CF9953BF975}.Release|Win32.Build.0 = Release|Win32

+		{04F37400-883C-42D7-AE28-6CF9953BF975}.Release|x64.ActiveCfg = Release|x64

+		{04F37400-883C-42D7-AE28-6CF9953BF975}.Release|x64.Build.0 = Release|x64

 	EndGlobalSection

 	GlobalSection(SolutionProperties) = preSolution

 		HideSolutionNode = FALSE

diff --git a/PC/VS9.0/pyproject.vsprops b/PC/VS9.0/pyproject.vsprops
index ff3759e..a909875 100644
--- a/PC/VS9.0/pyproject.vsprops
+++ b/PC/VS9.0/pyproject.vsprops
@@ -38,7 +38,7 @@
 	/>

 	<UserMacro

 		Name="PyDllName"

-		Value="python33"

+		Value="python34"

 	/>

 	<UserMacro

 		Name="PythonExe"

@@ -50,7 +50,7 @@
 	/>

 	<UserMacro

 		Name="sqlite3Dir"

-		Value="$(externalsDir)\sqlite-3.7.12"

+		Value="$(externalsDir)\sqlite-3.8.3.1"

 	/>

 	<UserMacro

 		Name="bz2Dir"

@@ -58,11 +58,11 @@
 	/>

 	<UserMacro

 		Name="lzmaDir"

-		Value="$(externalsDir)\xz-5.0.3"

+		Value="$(externalsDir)\xz-5.0.5"

 	/>

 	<UserMacro

 		Name="opensslDir"

-		Value="$(externalsDir)\openssl-1.0.1e"

+		Value="$(externalsDir)\openssl-1.0.1g"

 	/>

 	<UserMacro

 		Name="tcltkDir"

diff --git a/PC/VS9.0/pythoncore.vcproj b/PC/VS9.0/pythoncore.vcproj
index 9fb63ff..cf60470 100644
--- a/PC/VS9.0/pythoncore.vcproj
+++ b/PC/VS9.0/pythoncore.vcproj
@@ -1119,7 +1119,7 @@
 				>

 			</File>

 			<File

-				RelativePath="..\..\Modules\operator.c"

+				RelativePath="..\..\Modules\_operator.c"

 				>

 			</File>

 			<File

@@ -1155,6 +1155,22 @@
 				>

 			</File>

 			<File

+				RelativePath="..\..\Modules\sre.h"

+				>

+			</File>

+			<File

+				RelativePath="..\..\Modules\sre_constants.h"

+				>

+			</File>

+			<File

+				RelativePath="..\..\Modules\sre_lib.h"

+				>

+			</File>

+			<File

+				RelativePath="..\..\Modules\_stat.c"

+				>

+			</File>

+			<File

 				RelativePath="..\..\Modules\symtablemodule.c"

 				>

 			</File>

@@ -1242,74 +1258,6 @@
 					>

 				</File>

 				<File

-					RelativePath="..\..\Modules\zlib\gzio.c"

-					>

-					<FileConfiguration

-						Name="Release|Win32"

-						>

-						<Tool

-							Name="VCCLCompilerTool"

-							PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE"

-						/>

-					</FileConfiguration>

-					<FileConfiguration

-						Name="Release|Win64"

-						>

-						<Tool

-							Name="VCCLCompilerTool"

-							PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE"

-						/>

-					</FileConfiguration>

-					<FileConfiguration

-						Name="Debug|Win32"

-						>

-						<Tool

-							Name="VCCLCompilerTool"

-							PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE"

-						/>

-					</FileConfiguration>

-					<FileConfiguration

-						Name="Debug|Win64"

-						>

-						<Tool

-							Name="VCCLCompilerTool"

-							PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE"

-						/>

-					</FileConfiguration>

-					<FileConfiguration

-						Name="PGInstrument|Win32"

-						>

-						<Tool

-							Name="VCCLCompilerTool"

-							PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE"

-						/>

-					</FileConfiguration>

-					<FileConfiguration

-						Name="PGInstrument|Win64"

-						>

-						<Tool

-							Name="VCCLCompilerTool"

-							PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE"

-						/>

-					</FileConfiguration>

-					<FileConfiguration

-						Name="PGUpdate|Win32"

-						>

-						<Tool

-							Name="VCCLCompilerTool"

-							PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE"

-						/>

-					</FileConfiguration>

-					<FileConfiguration

-						Name="PGUpdate|Win64"

-						>

-						<Tool

-							Name="VCCLCompilerTool"

-							PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE"

-						/>

-					</FileConfiguration>

-				</File>

-				<File

 					RelativePath="..\..\Modules\zlib\infback.c"

 					>

 				</File>

@@ -1587,6 +1535,10 @@
 				>

 			</File>

 			<File

+				RelativePath="..\..\Objects\stringlib\replace.h"

+				>

+			</File>

+			<File

 				RelativePath="..\..\Objects\setobject.c"

 				>

 			</File>

diff --git a/PC/VS9.0/w9xpopen.vcproj b/PC/VS9.0/w9xpopen.vcproj
deleted file mode 100644
index 7a85b00..0000000
--- a/PC/VS9.0/w9xpopen.vcproj
+++ /dev/null
@@ -1,576 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>

-<VisualStudioProject

-	ProjectType="Visual C++"

-	Version="9.00"

-	Name="w9xpopen"

-	ProjectGUID="{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}"

-	RootNamespace="w9xpopen"

-	TargetFrameworkVersion="131072"

-	>

-	<Platforms>

-		<Platform

-			Name="Win32"

-		/>

-		<Platform

-			Name="x64"

-		/>

-	</Platforms>

-	<ToolFiles>

-	</ToolFiles>

-	<Configurations>

-		<Configuration

-			Name="Debug|Win32"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\debug.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			CharacterSet="0"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="0"

-				BasicRuntimeChecks="3"

-				RuntimeLibrary="1"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				SubSystem="1"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Debug|x64"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\x64.vsprops;.\debug.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			CharacterSet="2"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="0"

-				BasicRuntimeChecks="3"

-				RuntimeLibrary="1"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				SubSystem="1"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|Win32"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\release.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			CharacterSet="2"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				StringPooling="true"

-				RuntimeLibrary="0"

-				EnableFunctionLevelLinking="true"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				GenerateDebugInformation="false"

-				SubSystem="1"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="Release|x64"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\x64.vsprops;.\release.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			CharacterSet="2"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				StringPooling="true"

-				RuntimeLibrary="0"

-				EnableFunctionLevelLinking="true"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				GenerateDebugInformation="false"

-				SubSystem="1"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|Win32"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\release.vsprops;.\pginstrument.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			CharacterSet="2"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				StringPooling="true"

-				RuntimeLibrary="0"

-				EnableFunctionLevelLinking="true"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				GenerateDebugInformation="false"

-				SubSystem="1"

-				ImportLibrary=""

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGInstrument|x64"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\x64.vsprops;.\release.vsprops;.\pginstrument.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			CharacterSet="2"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				StringPooling="true"

-				RuntimeLibrary="0"

-				EnableFunctionLevelLinking="true"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				GenerateDebugInformation="false"

-				SubSystem="1"

-				ImportLibrary=""

-				TargetMachine="17"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|Win32"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\release.vsprops;.\pgupdate.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			CharacterSet="2"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				StringPooling="true"

-				RuntimeLibrary="0"

-				EnableFunctionLevelLinking="true"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				GenerateDebugInformation="false"

-				SubSystem="1"

-				ImportLibrary=""

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-		<Configuration

-			Name="PGUpdate|x64"

-			ConfigurationType="1"

-			InheritedPropertySheets=".\pyproject.vsprops;.\x64.vsprops;.\release.vsprops;.\pgupdate.vsprops"

-			UseOfMFC="0"

-			ATLMinimizesCRunTimeLibraryUsage="false"

-			CharacterSet="2"

-			>

-			<Tool

-				Name="VCPreBuildEventTool"

-			/>

-			<Tool

-				Name="VCCustomBuildTool"

-			/>

-			<Tool

-				Name="VCXMLDataGeneratorTool"

-			/>

-			<Tool

-				Name="VCWebServiceProxyGeneratorTool"

-			/>

-			<Tool

-				Name="VCMIDLTool"

-				TargetEnvironment="3"

-			/>

-			<Tool

-				Name="VCCLCompilerTool"

-				Optimization="2"

-				InlineFunctionExpansion="1"

-				StringPooling="true"

-				RuntimeLibrary="0"

-				EnableFunctionLevelLinking="true"

-			/>

-			<Tool

-				Name="VCManagedResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCResourceCompilerTool"

-			/>

-			<Tool

-				Name="VCPreLinkEventTool"

-			/>

-			<Tool

-				Name="VCLinkerTool"

-				GenerateDebugInformation="false"

-				SubSystem="1"

-				ImportLibrary=""

-				TargetMachine="17"

-			/>

-			<Tool

-				Name="VCALinkTool"

-			/>

-			<Tool

-				Name="VCManifestTool"

-			/>

-			<Tool

-				Name="VCXDCMakeTool"

-			/>

-			<Tool

-				Name="VCBscMakeTool"

-			/>

-			<Tool

-				Name="VCFxCopTool"

-			/>

-			<Tool

-				Name="VCAppVerifierTool"

-			/>

-			<Tool

-				Name="VCPostBuildEventTool"

-			/>

-		</Configuration>

-	</Configurations>

-	<References>

-	</References>

-	<Files>

-		<Filter

-			Name="Source Files"

-			>

-			<File

-				RelativePath="..\..\PC\w9xpopen.c"

-				>

-			</File>

-		</Filter>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

diff --git a/PC/_msi.c b/PC/_msi.c
index 0b5b94e..6a99b40 100644
--- a/PC/_msi.c
+++ b/PC/_msi.c
@@ -55,7 +55,7 @@
 
 static FNFCIOPEN(cb_open)
 {
-    int result = _open(pszFile, oflag, pmode);
+    int result = _open(pszFile, oflag | O_NOINHERIT, pmode);
     if (result == -1)
         *err = errno;
     return result;
@@ -63,7 +63,7 @@
 
 static FNFCIREAD(cb_read)
 {
-    UINT result = (UINT)_read(hf, memory, cb);
+    UINT result = (UINT)_read((int)hf, memory, cb);
     if (result != cb)
         *err = errno;
     return result;
@@ -71,7 +71,7 @@
 
 static FNFCIWRITE(cb_write)
 {
-    UINT result = (UINT)_write(hf, memory, cb);
+    UINT result = (UINT)_write((int)hf, memory, cb);
     if (result != cb)
         *err = errno;
     return result;
@@ -79,7 +79,7 @@
 
 static FNFCICLOSE(cb_close)
 {
-    int result = _close(hf);
+    int result = _close((int)hf);
     if (result != 0)
         *err = errno;
     return result;
@@ -87,7 +87,7 @@
 
 static FNFCISEEK(cb_seek)
 {
-    long result = (long)_lseek(hf, dist, seektype);
+    long result = (long)_lseek((int)hf, dist, seektype);
     if (result == -1)
         *err = errno;
     return result;
@@ -179,7 +179,7 @@
 
     CloseHandle(handle);
 
-    return _open(pszName, _O_RDONLY | _O_BINARY);
+    return _open(pszName, _O_RDONLY | _O_BINARY | O_NOINHERIT);
 }
 
 static PyObject* fcicreate(PyObject* obj, PyObject* args)
@@ -1030,40 +1030,40 @@
     PyModule_AddIntConstant(m, "MSIDBOPEN_TRANSACT", (int)MSIDBOPEN_TRANSACT);
     PyModule_AddIntConstant(m, "MSIDBOPEN_PATCHFILE", (int)MSIDBOPEN_PATCHFILE);
 
-    PyModule_AddIntConstant(m, "MSICOLINFO_NAMES", MSICOLINFO_NAMES);
-    PyModule_AddIntConstant(m, "MSICOLINFO_TYPES", MSICOLINFO_TYPES);
+    PyModule_AddIntMacro(m, MSICOLINFO_NAMES);
+    PyModule_AddIntMacro(m, MSICOLINFO_TYPES);
 
-    PyModule_AddIntConstant(m, "MSIMODIFY_SEEK", MSIMODIFY_SEEK);
-    PyModule_AddIntConstant(m, "MSIMODIFY_REFRESH", MSIMODIFY_REFRESH);
-    PyModule_AddIntConstant(m, "MSIMODIFY_INSERT", MSIMODIFY_INSERT);
-    PyModule_AddIntConstant(m, "MSIMODIFY_UPDATE", MSIMODIFY_UPDATE);
-    PyModule_AddIntConstant(m, "MSIMODIFY_ASSIGN", MSIMODIFY_ASSIGN);
-    PyModule_AddIntConstant(m, "MSIMODIFY_REPLACE", MSIMODIFY_REPLACE);
-    PyModule_AddIntConstant(m, "MSIMODIFY_MERGE", MSIMODIFY_MERGE);
-    PyModule_AddIntConstant(m, "MSIMODIFY_DELETE", MSIMODIFY_DELETE);
-    PyModule_AddIntConstant(m, "MSIMODIFY_INSERT_TEMPORARY", MSIMODIFY_INSERT_TEMPORARY);
-    PyModule_AddIntConstant(m, "MSIMODIFY_VALIDATE", MSIMODIFY_VALIDATE);
-    PyModule_AddIntConstant(m, "MSIMODIFY_VALIDATE_NEW", MSIMODIFY_VALIDATE_NEW);
-    PyModule_AddIntConstant(m, "MSIMODIFY_VALIDATE_FIELD", MSIMODIFY_VALIDATE_FIELD);
-    PyModule_AddIntConstant(m, "MSIMODIFY_VALIDATE_DELETE", MSIMODIFY_VALIDATE_DELETE);
+    PyModule_AddIntMacro(m, MSIMODIFY_SEEK);
+    PyModule_AddIntMacro(m, MSIMODIFY_REFRESH);
+    PyModule_AddIntMacro(m, MSIMODIFY_INSERT);
+    PyModule_AddIntMacro(m, MSIMODIFY_UPDATE);
+    PyModule_AddIntMacro(m, MSIMODIFY_ASSIGN);
+    PyModule_AddIntMacro(m, MSIMODIFY_REPLACE);
+    PyModule_AddIntMacro(m, MSIMODIFY_MERGE);
+    PyModule_AddIntMacro(m, MSIMODIFY_DELETE);
+    PyModule_AddIntMacro(m, MSIMODIFY_INSERT_TEMPORARY);
+    PyModule_AddIntMacro(m, MSIMODIFY_VALIDATE);
+    PyModule_AddIntMacro(m, MSIMODIFY_VALIDATE_NEW);
+    PyModule_AddIntMacro(m, MSIMODIFY_VALIDATE_FIELD);
+    PyModule_AddIntMacro(m, MSIMODIFY_VALIDATE_DELETE);
 
-    PyModule_AddIntConstant(m, "PID_CODEPAGE", PID_CODEPAGE);
-    PyModule_AddIntConstant(m, "PID_TITLE", PID_TITLE);
-    PyModule_AddIntConstant(m, "PID_SUBJECT", PID_SUBJECT);
-    PyModule_AddIntConstant(m, "PID_AUTHOR", PID_AUTHOR);
-    PyModule_AddIntConstant(m, "PID_KEYWORDS", PID_KEYWORDS);
-    PyModule_AddIntConstant(m, "PID_COMMENTS", PID_COMMENTS);
-    PyModule_AddIntConstant(m, "PID_TEMPLATE", PID_TEMPLATE);
-    PyModule_AddIntConstant(m, "PID_LASTAUTHOR", PID_LASTAUTHOR);
-    PyModule_AddIntConstant(m, "PID_REVNUMBER", PID_REVNUMBER);
-    PyModule_AddIntConstant(m, "PID_LASTPRINTED", PID_LASTPRINTED);
-    PyModule_AddIntConstant(m, "PID_CREATE_DTM", PID_CREATE_DTM);
-    PyModule_AddIntConstant(m, "PID_LASTSAVE_DTM", PID_LASTSAVE_DTM);
-    PyModule_AddIntConstant(m, "PID_PAGECOUNT", PID_PAGECOUNT);
-    PyModule_AddIntConstant(m, "PID_WORDCOUNT", PID_WORDCOUNT);
-    PyModule_AddIntConstant(m, "PID_CHARCOUNT", PID_CHARCOUNT);
-    PyModule_AddIntConstant(m, "PID_APPNAME", PID_APPNAME);
-    PyModule_AddIntConstant(m, "PID_SECURITY", PID_SECURITY);
+    PyModule_AddIntMacro(m, PID_CODEPAGE);
+    PyModule_AddIntMacro(m, PID_TITLE);
+    PyModule_AddIntMacro(m, PID_SUBJECT);
+    PyModule_AddIntMacro(m, PID_AUTHOR);
+    PyModule_AddIntMacro(m, PID_KEYWORDS);
+    PyModule_AddIntMacro(m, PID_COMMENTS);
+    PyModule_AddIntMacro(m, PID_TEMPLATE);
+    PyModule_AddIntMacro(m, PID_LASTAUTHOR);
+    PyModule_AddIntMacro(m, PID_REVNUMBER);
+    PyModule_AddIntMacro(m, PID_LASTPRINTED);
+    PyModule_AddIntMacro(m, PID_CREATE_DTM);
+    PyModule_AddIntMacro(m, PID_LASTSAVE_DTM);
+    PyModule_AddIntMacro(m, PID_PAGECOUNT);
+    PyModule_AddIntMacro(m, PID_WORDCOUNT);
+    PyModule_AddIntMacro(m, PID_CHARCOUNT);
+    PyModule_AddIntMacro(m, PID_APPNAME);
+    PyModule_AddIntMacro(m, PID_SECURITY);
 
     MSIError = PyErr_NewException ("_msi.MSIError", NULL, NULL);
     if (!MSIError)
diff --git a/PC/bdist_wininst/install.c b/PC/bdist_wininst/install.c
index c11d45d..a0232d2 100644
--- a/PC/bdist_wininst/install.c
+++ b/PC/bdist_wininst/install.c
@@ -743,7 +743,7 @@
     if (pathname == NULL || pathname[0] == '\0')
         return 2;
 
-    fh = open(pathname, _O_RDONLY);
+    fh = open(pathname, _O_RDONLY | O_NOINHERIT);
     if (-1 == fh) {
         fprintf(stderr, "Could not open postinstall-script %s\n",
             pathname);
@@ -1774,6 +1774,16 @@
 
     sprintf(buffer, "%s\\%s-wininst.log", dir, meta_name);
     logfile = fopen(buffer, "a");
+    if (!logfile) {
+        char error[1024];
+
+        sprintf(error, "Can't create \"%s\" (%s).\n\n"
+                "Try to execute the installer as administrator.",
+                buffer, strerror(errno));
+        MessageBox(GetFocus(), error, NULL, MB_OK | MB_ICONSTOP);
+        return FALSE;
+    }
+
     time(&ltime);
     now = localtime(&ltime);
     strftime(buffer, sizeof(buffer),
diff --git a/PC/config.c b/PC/config.c
index 57b5073..72c9381 100644
--- a/PC/config.c
+++ b/PC/config.c
@@ -13,11 +13,12 @@
 extern PyObject* PyInit_cmath(void);
 extern PyObject* PyInit_errno(void);
 extern PyObject* PyInit_faulthandler(void);
+extern PyObject* PyInit__tracemalloc(void);
 extern PyObject* PyInit_gc(void);
 extern PyObject* PyInit_math(void);
 extern PyObject* PyInit__md5(void);
 extern PyObject* PyInit_nt(void);
-extern PyObject* PyInit_operator(void);
+extern PyObject* PyInit__operator(void);
 extern PyObject* PyInit_signal(void);
 extern PyObject* PyInit__sha1(void);
 extern PyObject* PyInit__sha256(void);
@@ -64,6 +65,8 @@
 extern PyObject* PyInit_atexit(void);
 extern PyObject* _PyWarnings_Init(void);
 extern PyObject* PyInit__string(void);
+extern PyObject* PyInit__stat(void);
+extern PyObject* PyInit__opcode(void);
 
 /* tools/freeze/makeconfig.py marker for additional "extern" */
 /* -- ADDMODULE MARKER 1 -- */
@@ -87,7 +90,7 @@
     {"gc", PyInit_gc},
     {"math", PyInit_math},
     {"nt", PyInit_nt}, /* Use the NT os functions, not posix */
-    {"operator", PyInit_operator},
+    {"_operator", PyInit__operator},
     {"signal", PyInit_signal},
     {"_md5", PyInit__md5},
     {"_sha1", PyInit__sha1},
@@ -101,6 +104,7 @@
     {"msvcrt", PyInit_msvcrt},
     {"_locale", PyInit__locale},
 #endif
+    {"_tracemalloc", PyInit__tracemalloc},
     /* XXX Should _winapi go in a WIN32 block?  not WIN64? */
     {"_winapi", PyInit__winapi},
 
@@ -154,6 +158,8 @@
     {"_io", PyInit__io},
     {"_pickle", PyInit__pickle},
     {"atexit", PyInit_atexit},
+    {"_stat", PyInit__stat},
+    {"_opcode", PyInit__opcode},
 
     /* Sentinel */
     {0, 0}
diff --git a/PC/example_nt/example.vcproj b/PC/example_nt/example.vcproj
index fba00b6..df36341 100644
--- a/PC/example_nt/example.vcproj
+++ b/PC/example_nt/example.vcproj
@@ -39,7 +39,7 @@
 			<Tool

 				Name="VCLinkerTool"

 				AdditionalOptions="/export:initexample"

-				AdditionalDependencies="odbc32.lib odbccp32.lib python33.lib"

+				AdditionalDependencies="odbc32.lib odbccp32.lib python34.lib"

 				OutputFile=".\Release/example.pyd"

 				LinkIncremental="1"

 				SuppressStartupBanner="TRUE"

@@ -105,7 +105,7 @@
 			<Tool

 				Name="VCLinkerTool"

 				AdditionalOptions="/export:initexample"

-				AdditionalDependencies="odbc32.lib odbccp32.lib python33_d.lib"

+				AdditionalDependencies="odbc32.lib odbccp32.lib python34_d.lib"

 				OutputFile=".\Debug/example_d.pyd"

 				LinkIncremental="1"

 				SuppressStartupBanner="TRUE"

diff --git a/PC/getpathp.c b/PC/getpathp.c
index b5bf325..deb40e7 100644
--- a/PC/getpathp.c
+++ b/PC/getpathp.c
@@ -1,6 +1,6 @@
 
 /* Return the initial module search path. */
-/* Used by DOS, OS/2, Windows 3.1, Windows 95/98, Windows NT. */
+/* Used by DOS, Windows 3.1, Windows 95/98, Windows NT. */
 
 /* ----------------------------------------------------------------
    PATH RULES FOR WINDOWS:
@@ -245,9 +245,9 @@
     /* Tried to use sysget("winver") but here is too early :-( */
     versionLen = strlen(PyWin_DLLVersionString);
     /* Space for all the chars, plus one \0 */
-    keyBuf = keyBufPtr = malloc(sizeof(keyPrefix) +
-                                sizeof(WCHAR)*(versionLen-1) +
-                                sizeof(keySuffix));
+    keyBuf = keyBufPtr = PyMem_RawMalloc(sizeof(keyPrefix) +
+                                         sizeof(WCHAR)*(versionLen-1) +
+                                         sizeof(keySuffix));
     if (keyBuf==NULL) goto done;
 
     memcpy(keyBufPtr, keyPrefix, sizeof(keyPrefix)-sizeof(WCHAR));
@@ -271,7 +271,7 @@
     /* Allocate a temp array of char buffers, so we only need to loop
        reading the registry once
     */
-    ppPaths = malloc( sizeof(WCHAR *) * numKeys );
+    ppPaths = PyMem_RawMalloc( sizeof(WCHAR *) * numKeys );
     if (ppPaths==NULL) goto done;
     memset(ppPaths, 0, sizeof(WCHAR *) * numKeys);
     /* Loop over all subkeys, allocating a temp sub-buffer. */
@@ -293,7 +293,7 @@
         /* Find the value of the buffer size, malloc, then read it */
         RegQueryValueExW(subKey, NULL, 0, NULL, NULL, &reqdSize);
         if (reqdSize) {
-            ppPaths[index] = malloc(reqdSize);
+            ppPaths[index] = PyMem_RawMalloc(reqdSize);
             if (ppPaths[index]) {
                 RegQueryValueExW(subKey, NULL, 0, NULL,
                                 (LPBYTE)ppPaths[index],
@@ -308,7 +308,7 @@
     if (dataSize == 0) goto done;
 
     /* original datasize from RegQueryInfo doesn't include the \0 */
-    dataBuf = malloc((dataSize+1) * sizeof(WCHAR));
+    dataBuf = PyMem_RawMalloc((dataSize+1) * sizeof(WCHAR));
     if (dataBuf) {
         WCHAR *szCur = dataBuf;
         DWORD reqdSize = dataSize;
@@ -346,14 +346,13 @@
 done:
     /* Loop freeing my temp buffers */
     if (ppPaths) {
-        for(index=0;index<numKeys;index++)
-            if (ppPaths[index]) free(ppPaths[index]);
-        free(ppPaths);
+        for(index=0; index<numKeys; index++)
+            PyMem_RawFree(ppPaths[index]);
+        PyMem_RawFree(ppPaths);
     }
     if (newKey)
         RegCloseKey(newKey);
-    if (keyBuf)
-        free(keyBuf);
+    PyMem_RawFree(keyBuf);
     return retval;
 }
 #endif /* Py_ENABLE_SHARED */
@@ -434,7 +433,7 @@
         char * p = fgets(buffer, MAXPATHLEN*2, env_file);
         wchar_t tmpbuffer[MAXPATHLEN*2+1];
         PyObject * decoded;
-        int n;
+        size_t n;
 
         if (p == NULL)
             break;
@@ -616,7 +615,7 @@
     if (envpath != NULL)
         bufsz += wcslen(envpath) + 1;
 
-    module_search_path = buf = malloc(bufsz*sizeof(wchar_t));
+    module_search_path = buf = PyMem_RawMalloc(bufsz*sizeof(wchar_t));
     if (buf == NULL) {
         /* We can't exit, so print a warning and limp along */
         fprintf(stderr, "Can't malloc dynamic PYTHONPATH.\n");
@@ -629,10 +628,8 @@
             module_search_path = PYTHONPATH;
         }
 #ifdef MS_WINDOWS
-        if (machinepath)
-            free(machinepath);
-        if (userpath)
-            free(userpath);
+        PyMem_RawFree(machinepath);
+        PyMem_RawFree(userpath);
 #endif /* MS_WINDOWS */
         return;
     }
@@ -652,13 +649,13 @@
         wcscpy(buf, userpath);
         buf = wcschr(buf, L'\0');
         *buf++ = DELIM;
-        free(userpath);
+        PyMem_RawFree(userpath);
     }
     if (machinepath) {
         wcscpy(buf, machinepath);
         buf = wcschr(buf, L'\0');
         *buf++ = DELIM;
-        free(machinepath);
+        PyMem_RawFree(machinepath);
     }
     if (pythonhome == NULL) {
         if (!skipdefault) {
@@ -745,7 +742,7 @@
 Py_SetPath(const wchar_t *path)
 {
     if (module_search_path != NULL) {
-        free(module_search_path);
+        PyMem_RawFree(module_search_path);
         module_search_path = NULL;
     }
     if (path != NULL) {
@@ -753,10 +750,10 @@
         wchar_t *prog = Py_GetProgramName();
         wcsncpy(progpath, prog, MAXPATHLEN);
         prefix[0] = L'\0';
-        module_search_path = malloc((wcslen(path) + 1) * sizeof(wchar_t));
+        module_search_path = PyMem_RawMalloc((wcslen(path) + 1) * sizeof(wchar_t));
         if (module_search_path != NULL)
             wcscpy(module_search_path, path);
-	}
+    }
 }
 
 wchar_t *
diff --git a/PC/launcher.c b/PC/launcher.c
index 216a562..ee3cd44 100644
--- a/PC/launcher.c
+++ b/PC/launcher.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011-2012 Vinay Sajip.
+ * Copyright (C) 2011-2013 Vinay Sajip.
  * Licensed to PSF under a contributor agreement.
  *
  * Based on the work of:
@@ -18,7 +18,28 @@
 
 /* Build options. */
 #define SKIP_PREFIX
-/* #define SEARCH_PATH */
+#define SEARCH_PATH
+
+/* Error codes */
+
+#define RC_NO_STD_HANDLES   100
+#define RC_CREATE_PROCESS   101
+#define RC_BAD_VIRTUAL_PATH 102
+#define RC_NO_PYTHON        103
+#define RC_NO_MEMORY        104
+/*
+ * SCRIPT_WRAPPER is used to choose between two variants of an executable built
+ * from this source file. If not defined, the PEP 397 Python launcher is built;
+ * if defined, a script launcher of the type used by setuptools is built, which
+ * looks for a script name related to the executable name and runs that script
+ * with the appropriate Python interpreter.
+ *
+ * SCRIPT_WRAPPER should be undefined in the source, and defined in a VS project
+ * which builds the setuptools-style launcher.
+ */
+#if defined(SCRIPT_WRAPPER)
+#define RC_NO_SCRIPT        105
+#endif
 
 /* Just for now - static definition */
 
@@ -32,32 +53,6 @@
     return p;
 }
 
-/*
- * This function is here to simplify memory management
- * and to treat blank values as if they are absent.
- */
-static wchar_t * get_env(wchar_t * key)
-{
-    /* This is not thread-safe, just like getenv */
-    static wchar_t buf[256];
-    DWORD result = GetEnvironmentVariableW(key, buf, 256);
-
-    if (result > 255) {
-        /* Large environment variable. Accept some leakage */
-        wchar_t *buf2 = (wchar_t*)malloc(sizeof(wchar_t) * (result+1));
-        GetEnvironmentVariableW(key, buf2, result);
-        return buf2;
-    }
-
-    if (result == 0)
-        /* Either some error, e.g. ERROR_ENVVAR_NOT_FOUND,
-           or an empty environment variable. */
-        return NULL;
-
-    return buf;
-}
-
-
 static void
 debug(wchar_t * format, ...)
 {
@@ -100,11 +95,40 @@
 #if !defined(_WINDOWS)
     fwprintf(stderr, L"%s\n", message);
 #else
-    MessageBox(NULL, message, TEXT("Python Launcher is sorry to say ..."), MB_OK); 
+    MessageBox(NULL, message, TEXT("Python Launcher is sorry to say ..."),
+               MB_OK); 
 #endif
     ExitProcess(rc);
 }
 
+/*
+ * This function is here to simplify memory management
+ * and to treat blank values as if they are absent.
+ */
+static wchar_t * get_env(wchar_t * key)
+{
+    /* This is not thread-safe, just like getenv */
+    static wchar_t buf[BUFSIZE];
+    DWORD result = GetEnvironmentVariableW(key, buf, BUFSIZE);
+
+    if (result >= BUFSIZE) {
+        /* Large environment variable. Accept some leakage */
+        wchar_t *buf2 = (wchar_t*)malloc(sizeof(wchar_t) * (result+1));
+        if (buf2 = NULL) {
+            error(RC_NO_MEMORY, L"Could not allocate environment buffer");
+        }
+        GetEnvironmentVariableW(key, buf2, result);
+        return buf2;
+    }
+
+    if (result == 0)
+        /* Either some error, e.g. ERROR_ENVVAR_NOT_FOUND,
+           or an empty environment variable. */
+        return NULL;
+
+    return buf;
+}
+
 #if defined(_WINDOWS)
 
 #define PYTHON_EXECUTABLE L"pythonw.exe"
@@ -115,11 +139,6 @@
 
 #endif
 
-#define RC_NO_STD_HANDLES   100
-#define RC_CREATE_PROCESS   101
-#define RC_BAD_VIRTUAL_PATH 102
-#define RC_NO_PYTHON        103
-
 #define MAX_VERSION_SIZE    4
 
 typedef struct {
@@ -457,6 +476,51 @@
     return result;
 }
 
+#if defined(SCRIPT_WRAPPER)
+/*
+ * Check for a script located alongside the executable
+ */
+
+#if defined(_WINDOWS)
+#define SCRIPT_SUFFIX L"-script.pyw"
+#else
+#define SCRIPT_SUFFIX L"-script.py"
+#endif
+
+static wchar_t wrapped_script_path[MAX_PATH];
+
+/* Locate the script being wrapped.
+ *
+ * This code should store the name of the wrapped script in
+ * wrapped_script_path, or terminate the program with an error if there is no
+ * valid wrapped script file.
+ */
+static void
+locate_wrapped_script()
+{
+    wchar_t * p;
+    size_t plen;
+    DWORD attrs;
+
+    plen = GetModuleFileNameW(NULL, wrapped_script_path, MAX_PATH);
+    p = wcsrchr(wrapped_script_path, L'.');
+    if (p == NULL) {
+        debug(L"GetModuleFileNameW returned value has no extension: %s\n",
+              wrapped_script_path);
+        error(RC_NO_SCRIPT, L"Wrapper name '%s' is not valid.", wrapped_script_path);
+    }
+
+    wcsncpy_s(p, MAX_PATH - (p - wrapped_script_path) + 1, SCRIPT_SUFFIX, _TRUNCATE);
+    attrs = GetFileAttributesW(wrapped_script_path);
+    if (attrs == INVALID_FILE_ATTRIBUTES) {
+        debug(L"File '%s' non-existent\n", wrapped_script_path);
+        error(RC_NO_SCRIPT, L"Script file '%s' is not present.", wrapped_script_path);
+    }
+
+    debug(L"Using wrapped script file '%s'\n", wrapped_script_path);
+}
+#endif
+
 /*
  * Process creation code
  */
@@ -550,7 +614,7 @@
         error(RC_CREATE_PROCESS, L"Unable to create process using '%s'", cmdline);
     AssignProcessToJobObject(job, pi.hProcess);
     CloseHandle(pi.hThread);
-    WaitForSingleObject(pi.hProcess, INFINITE);
+    WaitForSingleObjectEx(pi.hProcess, INFINITE, FALSE);
     ok = GetExitCodeProcess(pi.hProcess, &rc);
     if (!ok)
         error(RC_CREATE_PROCESS, L"Failed to get exit code of process");
@@ -595,12 +659,17 @@
     }
 }
 
-static wchar_t * builtin_virtual_paths [] = {
-    L"/usr/bin/env python",
-    L"/usr/bin/python",
-    L"/usr/local/bin/python",
-    L"python",
-    NULL
+typedef struct {
+    wchar_t *shebang;
+    BOOL search;
+} SHEBANG;
+
+static SHEBANG builtin_virtual_paths [] = {
+    { L"/usr/bin/env python", TRUE },
+    { L"/usr/bin/python", FALSE },
+    { L"/usr/local/bin/python", FALSE },
+    { L"python", FALSE },
+    { NULL, FALSE },
 };
 
 /* For now, a static array of commands. */
@@ -776,10 +845,10 @@
 
 static BOOL
 parse_shebang(wchar_t * shebang_line, int nchars, wchar_t ** command,
-              wchar_t ** suffix)
+              wchar_t ** suffix, BOOL *search)
 {
     BOOL rc = FALSE;
-    wchar_t ** vpp;
+    SHEBANG * vpp;
     size_t plen;
     wchar_t * p;
     wchar_t zapped;
@@ -789,15 +858,17 @@
 
     *command = NULL;    /* failure return */
     *suffix = NULL;
+    *search = FALSE;
 
     if ((*shebang_line++ == L'#') && (*shebang_line++ == L'!')) {
         shebang_line = skip_whitespace(shebang_line);
         if (*shebang_line) {
             *command = shebang_line;
-            for (vpp = builtin_virtual_paths; *vpp; ++vpp) {
-                plen = wcslen(*vpp);
-                if (wcsncmp(shebang_line, *vpp, plen) == 0) {
+            for (vpp = builtin_virtual_paths; vpp->shebang; ++vpp) {
+                plen = wcslen(vpp->shebang);
+                if (wcsncmp(shebang_line, vpp->shebang, plen) == 0) {
                     rc = TRUE;
+                    *search = vpp->search;
                     /* We can do this because all builtin commands contain
                      * "python".
                      */
@@ -805,7 +876,7 @@
                     break;
                 }
             }
-            if (*vpp == NULL) {
+            if (vpp->shebang == NULL) {
                 /*
                  * Not found in builtins - look in customized commands.
                  *
@@ -856,7 +927,7 @@
 } BOM;
 
 /*
- * Strictly, we don't need to handle UTF-16 anf UTF-32, since Python itself
+ * Strictly, we don't need to handle UTF-16 and UTF-32, since Python itself
  * doesn't. Never mind, one day it might - there's no harm leaving it in.
  */
 static BOM BOMs[] = {
@@ -1012,8 +1083,10 @@
     int i, j, nchars = 0;
     int header_len;
     BOOL is_virt;
+    BOOL search;
     wchar_t * command;
     wchar_t * suffix;
+    COMMAND *cmd = NULL;
     INSTALLED_PYTHON * ip;
 
     if (rc == 0) {
@@ -1125,7 +1198,7 @@
             if (nchars > 0) {
                 shebang_line[--nchars] = L'\0';
                 is_virt = parse_shebang(shebang_line, nchars, &command,
-                                        &suffix);
+                                        &suffix, &search);
                 if (command != NULL) {
                     debug(L"parse_shebang: found command: %s\n", command);
                     if (!is_virt) {
@@ -1141,6 +1214,23 @@
                             error(RC_BAD_VIRTUAL_PATH, L"Unknown virtual \
 path '%s'", command);
                         command += 6;   /* skip past "python" */
+                        if (search && ((*command == L'\0') || isspace(*command))) {
+                            /* Command is eligible for path search, and there
+                             * is no version specification.
+                             */
+                            debug(L"searching PATH for python executable\n");
+                            cmd = find_on_path(L"python");
+                            debug(L"Python on path: %s\n", cmd ? cmd->value : L"<not found>");
+                            if (cmd) {
+                                debug(L"located python on PATH: %s\n", cmd->value);
+                                invoke_child(cmd->value, suffix, cmdline);
+                                /* Exit here, as we have found the command */
+                                return;
+                            }
+                            /* FALL THROUGH: No python found on PATH, so fall
+                             * back to locating the correct installed python.
+                             */
+                        }
                         if (*command && !validate_version(command))
                             error(RC_BAD_VIRTUAL_PATH, L"Invalid version \
 specification: '%s'.\nIn the first line of the script, 'python' needs to be \
@@ -1223,6 +1313,12 @@
     void * version_data;
     VS_FIXEDFILEINFO * file_info;
     UINT block_size;
+    int index;
+#if defined(SCRIPT_WRAPPER)
+    int newlen;
+    wchar_t * newcommand;
+    wchar_t * av[2];
+#endif
 
     wp = get_env(L"PYLAUNCH_DEBUG");
     if ((wp != NULL) && (*wp != L'\0'))
@@ -1271,8 +1367,8 @@
             if (!valid)
                 debug(L"GetFileVersionInfo failed: %X\n", GetLastError());
             else {
-                valid = VerQueryValueW(version_data, L"\\", &file_info,
-                                       &block_size);
+                valid = VerQueryValueW(version_data, L"\\",
+                                       (LPVOID *) &file_info, &block_size);
                 if (!valid)
                     debug(L"VerQueryValue failed: %X\n", GetLastError());
                 else {
@@ -1302,7 +1398,40 @@
     }
 
     command = skip_me(GetCommandLineW());
-    debug(L"Called with command line: %s", command);
+    debug(L"Called with command line: %s\n", command);
+
+#if defined(SCRIPT_WRAPPER)
+    /* The launcher is being used in "script wrapper" mode.
+     * There should therefore be a Python script named <exename>-script.py in
+     * the same directory as the launcher executable.
+     * Put the script name into argv as the first (script name) argument.
+     */
+
+    /* Get the wrapped script name - if the script is not present, this will
+     * terminate the program with an error.
+     */
+    locate_wrapped_script();
+
+    /* Add the wrapped script to the start of command */
+    newlen = wcslen(wrapped_script_path) + wcslen(command) + 2; /* ' ' + NUL */
+    newcommand = malloc(sizeof(wchar_t) * newlen);
+    if (!newcommand) {
+        error(RC_NO_MEMORY, L"Could not allocate new command line");
+    }
+    else {
+        wcscpy_s(newcommand, newlen, wrapped_script_path);
+        wcscat_s(newcommand, newlen, L" ");
+        wcscat_s(newcommand, newlen, command);
+        debug(L"Running wrapped script with command line '%s'\n", newcommand);
+        read_commands();
+        av[0] = wrapped_script_path;
+        av[1] = NULL;
+        maybe_handle_shebang(av, newcommand);
+        /* Returns if no shebang line - pass to default processing */
+        command = newcommand;
+        valid = FALSE;
+    }
+#else
     if (argc <= 1) {
         valid = FALSE;
         p = NULL;
@@ -1310,13 +1439,6 @@
     else {
         p = argv[1];
         plen = wcslen(p);
-        if (p[0] != L'-') {
-            read_commands();
-            maybe_handle_shebang(&argv[1], command);
-        }
-        /* No file with shebang, or an unrecognised shebang.
-         * Is the first arg a special version qualifier?
-         */
         valid = (*p == L'-') && validate_version(&p[1]);
         if (valid) {
             ip = locate_python(&p[1]);
@@ -1326,7 +1448,19 @@
             command += wcslen(p);
             command = skip_whitespace(command);
         }
+        else {
+            for (index = 1; index < argc; ++index) {
+                if (*argv[index] != L'-')
+                    break;
+            }
+            if (index < argc) {
+                read_commands();
+                maybe_handle_shebang(&argv[index], command);
+            }
+        }
     }
+#endif
+
     if (!valid) {
         ip = locate_python(L"");
         if (ip == NULL)
@@ -1344,7 +1478,7 @@
             fwprintf(stdout, L"\
 Python Launcher for Windows Version %s\n\n", version_text);
             fwprintf(stdout, L"\
-usage: %s [ launcher-arguments ] script [ script-arguments ]\n\n", argv[0]);
+usage: %s [ launcher-arguments ] [ python-arguments ] script [ script-arguments ]\n\n", argv[0]);
             fputws(L"\
 Launcher arguments:\n\n\
 -2     : Launch the latest Python 2.x version\n\
diff --git a/PC/msvcrtmodule.c b/PC/msvcrtmodule.c
index 04d2088..18dec6d 100644
--- a/PC/msvcrtmodule.c
+++ b/PC/msvcrtmodule.c
@@ -113,11 +113,12 @@
 static PyObject *
 msvcrt_open_osfhandle(PyObject *self, PyObject *args)
 {
-    long handle;
+    Py_intptr_t handle;
     int flags;
     int fd;
 
-    if (!PyArg_ParseTuple(args, "li:open_osfhandle", &handle, &flags))
+    if (!PyArg_ParseTuple(args, _Py_PARSE_INTPTR "i:open_osfhandle",
+                          &handle, &flags))
         return NULL;
 
     fd = _open_osfhandle(handle, flags);
diff --git a/PC/os2emx/Makefile b/PC/os2emx/Makefile
deleted file mode 100644
index 800610e..0000000
--- a/PC/os2emx/Makefile
+++ /dev/null
@@ -1,672 +0,0 @@
-#####################==================----------------
-#
-# Top-Level Makefile for Building Python 2.6 for OS/2 using GCC/EMX
-# Originally written by Andrew Zabolotny, <bit@eltech.ru> for Python 1.5.2
-# Modified by Andrew MacIntyre, <andymac@pcug.org.au> for Python 2.6
-#
-# This makefile was developed for use with [P]GCC/EMX compiler any
-# version and GNU Make.
-#
-# The output of the build is a largish Python26.DLL containing the
-# essential modules of Python and a small Python.exe program to start
-# the interpreter. When embedding Python within another program, only
-# Python26.DLL is needed. We also build python_s.a static library (which
-# can be converted into OMF (.lib) format using emxomf tool) and both
-# python.a and python.lib import libraries.  Then the optional 
-# extension modules, which are OS/2 DLLs renamed with a PYD file extension.
-#
-# Recommended build order:
-#   make depend		(if you have makedep)
-#   make all
-#   make lx		(if you have lxlite)
-#   make test		(optional)
-#
-#####################==================----------------
-
-# === Compilation mode: debug or release ===
-MODE=		optimize
-#MODE=		debug
-# === Assert() enabled ===
-ASSERTIONS=no
-#ASSERTIONS=yes
-# === Hard-wire installation location ===
-FIXED_PYHOME=no
-#FIXED_PYHOME=yes
-
-# === Optional modules ===
-# Do you have the InfoZip compression library installed?
-HAVE_ZLIB=	no
-# Do you have the Ultra Fast Crypt (UFC) library installed?
-HAVE_UFC=	no
-# Do you have the Tcl/Tk library installed?
-HAVE_TCLTK=	no
-# Do you have the GNU readline library installed?
-# NOTE: I'm using a modified version of Kai Uwe Rommel's port that 
-#       - is compiled with multithreading enabled
-#       - is linked statically
-#       I have had no success trying to use a DLL version, even when
-#       compiled with multithreading enabled.
-HAVE_GREADLINE=	no
-# Do you have the BSD DB library (v1.85) as included in the EMXBSD package?
-# NOTE: this library needs to be recompiled with a structure member
-#       renamed to avoid problems with the multithreaded errno support
-#       (there is a structure member called errno, used for shadowing the
-#       real errno, which conflicts with the errno redefinition of -Zmt)
-HAVE_BSDDB=	no
-# Do you have the ncurses library installed? EMX's BSD curses aren't enough! 
-HAVE_NCURSES=	no
-# Do you have the GDBM library installed?
-HAVE_GDBM=	no
-# Do you have the BZ2 compression library installed?
-HAVE_BZ2=	no
-# Do you have the OpenSSL libraries installed
-HAVE_OPENSSL=	no
-
-# === install locations ===
-# default value of PYTHONHOME
-LIB_DIR=C:/Python26
-# default is to have everything in or under PYTHONHOME
-EXE_DIR=$(LIB_DIR)
-DLL_DIR=$(EXE_DIR)
-
-
-# === The Tools ===
-CC=		gcc
-CFLAGS=		-Zmt -Wall $(INCLUDE)
-CFLAGS.LIB=	$(CFLAGS)
-LD=		gcc
-LDFLAGS=	-Zmt -Zcrtdll -L. -lgcc
-LDFLAGS.EXE=	$(LDFLAGS)
-LDFLAGS.DLL=	$(LDFLAGS) -Zdll
-LDFLAGS.A=	$(LDFLAGS) $(LIBS)
-ARFLAGS=	crs
-IMPLIB=		emximp
-EXPLIB=		emxexp
-EXEOPT=		emxbind
-PY_DEF=		-DPy_BUILD_CORE
-
-
-# adjust C compiler settings based on build options
-ifeq ($(MODE),debug)
-  CFLAGS+=	-g -O
-  LDFLAGS+=	-g
-else
-  CFLAGS+=	-s -O3 -fomit-frame-pointer -mprobe
-  LDFLAGS+=	-s
-endif
-CFLAGS+=	$(PY_DEF)
-ifeq ($(ASSERTIONS),no)
-  CFLAGS+=	-DNDEBUG
-endif
-ifeq ($(FIXED_PYHOME),yes)
-  CFLAGS+=	-DPREFIX=$(DQUOTE)$(LIB_DIR)$(DQUOTE)
-endif
-
-# We're using the OMF format since EMX's ld has a obscure bug
-# because of which it sometimes fails to build relocations
-# in .data segment that point to another .data locations
-# (except for the final linking if the .EXEs)
-OMF=		yes
-
-# if fork() support is required, the main executable must be linked with ld
-EXEOMF=		no
-
-# File extensions
-MODULE.EXT=	.pyd
-MODLIB.EXT=	.dll
-ifeq ($(OMF),yes)
-  O=		.obj
-  A=		.lib
-  AR=		emxomfar
-  CFLAGS+=	-Zomf
-  LDFLAGS+=	-Zomf
-  ifeq ($(MODE),debug)
-    ARFLAGS=	-p64 crs
-  else
-    ARFLAGS=	-p32 crs
-  endif
-else
-  O=		.o
-  A=		.a
-  AR=		ar
-endif
-
-
-# === Build time resource settings ===
-
-# EMX's default number of file handles is 40, which is sometimes insufficient
-# (the tempfile regression test tries to create 100 temporary files)
-NFILES=250
-
-# The default stack size for child threads is 64k bytes, which is
-# insufficient for some applications which do a lot of work in threads
-# (such as Zope, especially in conjunction with Plone).
-# Note that this setting is distinct from the stack size for the main
-# thread, which is set via the %.def rule below.
-# EMX documents that the thread stack size should be at least 32768 bytes;
-# for Zope/Plone at least 128k bytes is recommended.
-# Uncomment & adjust the next line to override the default stack size:
-#CFLAGS+=	-DTHREAD_STACK_SIZE=0x20000
-
-
-# === The environment ===
-
-# Source file paths
-SRCPATH=.;../../Python;../../Parser;../../Objects;../../Include;../../Modules
-# Python contains the central core, containing the builtins and interpreter.
-# Parser contains Python's Internal Parser and
-#   Standalone Parser Generator Program (Shares Some of Python's Modules)
-# Objects contains Python Object Types
-# Modules contains extension Modules (Built-In or as Separate DLLs)
-
-# Unix shells tend to use "$" as delimiter for variable names.
-# Test for this behaviour and set $(BUCK) variable correspondigly ...
-__TMP__:=$(shell echo $$$$)
-ifeq ($(__TMP__),$$$$)
-  BUCK=		$$
-  BRO=		(
-  BRC=		)
-else
-  BUCK=		\$$
-  BRO=		\(
-  BRC=		\)
-endif
-# Compute the "double quote" variable
-__TMP__:=$(shell echo "")
-ifeq ($(__TMP__),"")
-  DQUOTE=	"
-else
-  DQUOTE=	\"
-endif
-
-# Include paths
-#INCLUDE=	-I$(subst ;, -I, $(SRCPATH))
-INCLUDE=	-I. -I../../Include
-
-# Path to search for .c files
-vpath %.c .;..;$(SRCPATH)
-
-# Top of the package tree
-TOP=		../../
-
-# Directory for output files
-OUTBASE=	out/
-OUT=		$(OUTBASE)$(MODE)/
-
-# Additional libraries
-LIBS=		-lsocket
-
-# Utility macro: replacement for $^
-^^=		$(filter-out %$A,$^)
-# Use $(L^) to link with all libraries specified as dependencies
-L^=		$(addprefix -l,$(basename $(notdir $(filter %$A,$+))))
-
-# Build rules
-$(OUT)%$O: %.c
-	$(CC) $(CFLAGS.LIB) -c $< -o $@
-
-%.a:
-	$(LD) $(LDFLAGS.A) -o $@ $(^^) $(L^)
-
-%.dll:
-	$(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
-
-%.pyd: $(OUT)%module$O $(OUT)%_m.def
-	$(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(PYTHON.IMPLIB) $(LIBS)
-
-%.exe:
-	$(LD) $(LDFLAGS.EXE) -o $@ $(^^) $(L^)
-
-%_m.def:
-	@echo Creating .DEF file: $@
-	@echo LIBRARY $(notdir $*) INITINSTANCE TERMINSTANCE >$@
-        ifeq ($(DESCRIPTION.$(notdir $*)$(MODULE.EXT)),)
-	  @echo DESCRIPTION $(DQUOTE)Python standard module $(notdir $*)$(DQUOTE) >>$@
-        else
-	  @echo DESCRIPTION $(DQUOTE)$(DESCRIPTION.$(notdir $*)$(MODULE.EXT))$(DQUOTE) >>$@
-        endif
-	@echo DATA MULTIPLE NONSHARED >>$@
-	@echo EXPORTS >>$@
-	@echo 	init$(notdir $*) >>$@
-
-%.def:
-	@echo Creating .DEF file: $@
-	@echo NAME $(notdir $*) $(EXETYPE.$(notdir $*).exe) >$@
-	@echo DESCRIPTION $(DQUOTE)$(DESCRIPTION.$(notdir $*).exe)$(DQUOTE) >>$@
-	@echo STACKSIZE 2097152 >>$@
-
-# Output file names
-PYTHON_VER=	2.6
-PYTHON_LIB=	python33
-PYTHON.LIB=	$(PYTHON_LIB)_s$A
-PYTHON.IMPLIB=	$(PYTHON_LIB)$A
-ifeq ($(EXEOMF),yes)
-  PYTHON.EXEIMP=	$(PYTHON.IMPLIB)
-  LDMODE.EXE=		-Zomf
-else
-  PYTHON.EXEIMP=	$(PYTHON_LIB).a
-  LDMODE.EXE = 
-endif
-PYTHON.DLL=	$(PYTHON_LIB).dll
-PYTHON.DEF=	$(PYTHON_LIB).def
-PYTHON.EXE=	python.exe
-PYTHONPM.EXE=	pythonpm.exe
-PGEN.EXE=	pgen.exe
-LIBRARY=	$(PYTHON.LIB)
-LD_LIBRARY=	$(PYTHON.IMPLIB)
-
-# Additional executable parameters
-EXETYPE.$(PYTHON.EXE)=		WINDOWCOMPAT
-EXETYPE.$(PYTHONPM.EXE)=	WINDOWAPI
-EXETYPE.$(PGEN.EXE)=		WINDOWCOMPAT
-DESCRIPTION.$(PYTHON.EXE)=	Python object-oriented programming language interpreter for OS/2
-DESCRIPTION.$(PYTHONPM.EXE)=	$(DESCRIPTION.$(PYTHON.EXE))
-DESCRIPTION.$(PGEN.EXE)=	Python object-oriented programming language parser generator for OS/2
-
-# Module descriptions
-DESCRIPTION.zlib$(MODULE.EXT)=		Python Extension DLL for accessing the InfoZip compression library
-DESCRIPTION.crypt$(MODULE.EXT)=		Python Extension DLL implementing the crypt$(BRO)$(BRC) function
-DESCRIPTION._tkinter$(MODULE.EXT)=	Python Extension DLL for access to Tcl/Tk Environment
-DESCRIPTION.readline$(MODULE.EXT)=	Python Extension DLL for access to GNU ReadLine library
-DESCRIPTION._curses$(MODLIB.EXT)=	Python Extension DLL for access to ncurses library
-DESCRIPTION.pyexpat$(MODULE.EXT)=	Python Extension DLL for access to expat library
-DESCRIPTION.bz2$(MODULE.EXT)=		Python Extension DLL for accessing the bz2 compression library
-
-# Source files
-SRC.OS2EMX=	config.c dlfcn.c getpathp.c
-SRC.MAIN=	$(addprefix $(TOP), \
-		Modules/getbuildinfo.c \
-		Modules/main.c)
-SRC.MODULES=	$(addprefix $(TOP), \
-		Modules/gcmodule.c \
-		Modules/signalmodule.c \
-		Modules/posixmodule.c \
-		Modules/_threadmodule.c \
-		Modules/arraymodule.c \
-		Modules/binascii.c \
-		Modules/cmathmodule.c \
-		Modules/_codecsmodule.c \
-		Modules/collectionsmodule.c \
-		Modules/_csv.c \
-		Modules/datetimemodule.c \
-		Modules/errnomodule.c \
-		Modules/fcntlmodule.c \
-		Modules/_functoolsmodule.c \
-		Modules/_heapqmodule.c \
-		Modules/imageop.c \
-		Modules/itertoolsmodule.c \
-		Modules/_localemodule.c \
-		Modules/mathmodule.c \
-		Modules/operator.c \
-		Modules/_randommodule.c \
-		Modules/sha256module.c \
-		Modules/sha512module.c \
-		Modules/_sre.c \
-		Modules/_struct.c \
-		Modules/symtablemodule.c \
-		Modules/termios.c \
-		Modules/timemodule.c \
-		Modules/_weakref.c \
-		Modules/xxsubtype.c \
-		Modules/zipimport.c)
-SRC.PARSE1=	$(addprefix $(TOP), \
-		Parser/acceler.c \
-		Parser/grammar1.c \
-		Parser/listnode.c \
-		Parser/node.c \
-		Parser/parser.c \
-		Parser/parsetok.c \
-		Parser/bitset.c \
-		Parser/metagrammar.c)
-SRC.PARSE2=	$(addprefix $(TOP), \
-		Parser/tokenizer.c \
-		Parser/myreadline.c)
-SRC.PARSER=	$(SRC.PARSE1) \
-		$(SRC.PARSE2)
-SRC.PYTHON=	$(addprefix $(TOP), \
-		Python/Python-ast.c \
-		Python/asdl.c \
-		Python/ast.c \
-		Python/bltinmodule.c \
-		Python/exceptions.c \
-		Python/ceval.c \
-		Python/compile.c \
-		Python/codecs.c \
-		Python/dynamic_annotations.c \
-		Python/errors.c \
-		Python/frozen.c \
-		Python/frozenmain.c \
-		Python/future.c \
-		Python/getargs.c \
-		Python/getcompiler.c \
-		Python/getcopyright.c \
-		Python/getplatform.c \
-		Python/getversion.c \
-		Python/graminit.c \
-		Python/import.c \
-		Python/importdl.c \
-		Python/marshal.c \
-		Python/modsupport.c \
-		Python/mysnprintf.c \
-		Python/mystrtoul.c \
-		Python/pyarena.c \
-		Python/pyctype.c \
-		Python/pyfpe.c \
-		Python/pystate.c \
-		Python/pystrtod.c \
-		Python/pythonrun.c \
-		Python/structmember.c \
-		Python/symtable.c \
-		Python/sysmodule.c \
-		Python/traceback.c \
-		Python/getopt.c \
-		Python/dynload_shlib.c \
-		Python/thread.c)
-SRC.OBJECT=	$(addprefix $(TOP), \
-		Objects/abstract.c \
-		Objects/boolobject.c \
-		Objects/cellobject.c \
-		Objects/classobject.c \
-		Objects/cobject.c \
-		Objects/codeobject.c \
-		Objects/complexobject.c \
-		Objects/descrobject.c \
-		Objects/dictobject.c \
-		Objects/enumobject.c \
-		Objects/fileobject.c \
-		Objects/floatobject.c \
-		Objects/frameobject.c \
-		Objects/funcobject.c \
-		Objects/genobject.c \
-		Objects/iterobject.c \
-		Objects/listobject.c \
-		Objects/longobject.c \
-		Objects/methodobject.c \
-		Objects/moduleobject.c \
-		Objects/object.c \
-		Objects/obmalloc.c \
-		Objects/rangeobject.c \
-		Objects/setobject.c \
-		Objects/sliceobject.c \
-		Objects/stringobject.c \
-		Objects/structseq.c \
-		Objects/tupleobject.c \
-		Objects/typeobject.c \
-		Objects/unicodeobject.c \
-		Objects/unicodectype.c \
-		Objects/weakrefobject.c)
-
-SRC.LIB=	$(SRC.OS2EMX) \
-		$(SRC.MAIN) \
-		$(SRC.PARSER) \
-		$(SRC.OBJECT) \
-		$(SRC.PYTHON) \
-		$(SRC.MODULES)
-OBJ.LIB=	$(addprefix $(OUT),$(notdir $(SRC.LIB:.c=$O)))
-
-SRC.PGEN=	$(SRC.PARSE1) \
-		$(addprefix $(TOP), \
-		Objects/obmalloc.c) \
-		$(addprefix $(TOP), \
-		Python/mysnprintf.c) \
-		$(addprefix $(TOP), \
-		Parser/tokenizer_pgen.c \
-		Parser/pgenmain.c \
-		Parser/pgen.c \
-		Parser/printgrammar.c \
-		Parser/grammar.c \
-		Parser/firstsets.c) \
-
-OBJ.PGEN=	$(addprefix $(OUT),$(notdir $(SRC.PGEN:.c=$O)))
-
-SRC.EXE=	$(TOP)Modules/python.c
-SRC.PMEXE=	pythonpm.c
-
-# Python modules to be dynamically loaded that:
-#   1) have only single source file and require no extra libs
-#   2) use the standard module naming convention
-#      (the 'module' in ?????module.c is assumed)
-# - these can be built with implicit rules
-EASYEXTMODULES=	fpectl \
-		fpetest \
-		parser \
-		pwd \
-		select 
-
-# Python modules to be dynamically loaded that need explicit build rules
-#  (either multiple source files and/or non-standard module naming)
-#  (NOTE: use shortened names for modules affected by 8 char name limit)
-HARDEXTMODULES=	_socket \
-		_testcap \
-		unicoded
-
-# Python modules that are used as libraries and therefore must use
-# a .DLL extension
-LIBEXTMODULES=
-
-# Python external ($(MODULE.EXT)) modules - can be EASY or HARD
-ifeq ($(HAVE_ZLIB),yes)
-  HARDEXTMODULES+=	zlib
-endif
-ifeq ($(HAVE_UFC),yes)
-  HARDEXTMODULES+=	crypt
-endif
-ifeq ($(HAVE_TCLTK),yes)
-  HARDEXTMODULES+=	_tkinter
-  CFLAGS+=		-DHAS_DIRENT -I/TclTk80/include
-  TK_LIBS+=		-L/TclTk80/lib -ltcl80 -ltk80
-endif
-ifeq ($(HAVE_GREADLINE),yes)
-  HARDEXTMODULES+=	readline
-endif
-ifeq ($(HAVE_NCURSES),yes)
-  LIBEXTMODULES+=	_curses
-  HARDEXTMODULES+=	_curses_
-endif
-ifeq ($(HAVE_GDBM),yes)
-  HARDEXTMODULES+=	_gdbm _dbm
-endif
-ifeq ($(HAVE_BZ2),yes)
-  HARDEXTMODULES+=	bz2
-endif
-ifeq ($(HAVE_OPENSSL),yes)
-  HARDEXTMODULES+=	_ssl
-endif
-
-# Expat is now distributed with the Python source
-HARDEXTMODULES+=	pyexpat
-EXPAT.INC=	-I../../Modules/expat
-EXPAT.DEF=	-DHAVE_EXPAT_H -DXML_NS=1 -DXML_DTD=1 -DXML_BYTE_ORDER=12 \
-		-DXML_CONTENT_BYTES=1024 -DHAVE_MEMMOVE=1 -DHAVE_BCOPY=1
-EXPAT.SRC=	$(addprefix ../../Modules/expat/, \
-		xmlparse.c \
-		xmlrole.c \
-		xmltok.c)
-
-# all the external modules
-EXTERNDLLS=	$(addsuffix $(MODULE.EXT),$(patsubst %module,%,$(EASYEXTMODULES)))
-EXTERNDLLS+=	$(addsuffix $(MODULE.EXT),$(patsubst %module,%,$(HARDEXTMODULES)))
-EXTERNDLLS+=	$(addsuffix $(MODLIB.EXT),$(patsubst %module,%,$(LIBEXTMODULES)))
-
-# Targets
-all:  $(OUT) $(PYTHON.LIB) $(PYTHON.DEF) $(PYTHON.IMPLIB) $(PYTHON.DLL) \
-	python_noncore
-
-python_noncore:
-	make PY_DEF= $(PYTHON.EXE) $(PYTHONPM.EXE) $(PGEN.EXE) $(EXTERNDLLS)
-
-clean:
-	rm -f $(OUT)*
-	rm -f $(PYTHON.LIB) $(PYTHON.IMPLIB) $(PYTHON.EXEIMP) $(PYTHON.DLL) \
-	  $(PYTHON.EXE) $(PYTHONPM.EXE) $(PGEN.EXE) *$(MODULE.EXT) *.dll
-	find ../../Lib -name "*.py[co]" -exec rm {} ";"
-
-lx:
-	@echo Packing everything with lxLite...
-	lxlite $(PYTHON.DLL) $(PYTHON.EXE) $(PYTHONPM.EXE) $(PGEN.EXE)
-
-depend: $(OUTBASE)
-	makedep -f $(OUTBASE)python.dep -o $(BUCK)O -p $(BUCK)\(OUT\) \
-	  -r -c $(INCLUDE) $(SRC.LIB) $(SRC.PGEN)
-
-$(OUT): $(OUTBASE)
-
-$(OUT) $(OUTBASE):
-	mkdir.exe $@
-
-$(PYTHON.LIB): $(OBJ.LIB)
-	rm.exe -f $@
-	$(AR) $(ARFLAGS) $@ $^
-
-# the Python core DLL .def file needs to have a number of non-static
-# symbols that aren't part of the Python C API removed (commented out)
-# from the DLL export list.
-$(PYTHON.DEF): $(PYTHON.LIB)
-	@echo Creating .DEF file: $@
-	@echo LIBRARY $(PYTHON_LIB) INITINSTANCE TERMINSTANCE >$@
-	@echo DESCRIPTION $(DQUOTE)Python $(PYTHON_VER) Core DLL$(DQUOTE) >>$@
-	@echo PROTMODE >>$@
-	@echo DATA MULTIPLE NONSHARED >>$@
-	@echo EXPORTS >>$@
-	$(EXPLIB) -u $(PYTHON.LIB) |\
-	 sed -e "/^  .init.*/s/^ /; /" \
-		-e "/^  .pcre_.*/s/^ /; /" \
-		-e "/^  .array_methods/s/^ /; /" \
-		-e "/^  .fast_save_leave/s/^ /; /" \
-		-e "/^  .dlopen/s/^ /; /" \
-		-e "/^  .dlsym/s/^ /; /" \
-		-e "/^  .dlclose/s/^ /; /" \
-		-e "/^  .dlerror/s/^ /; /" \
-		-e "/^  ._Py_re_.*/s/^ /; /" \
-		-e "/^  ._Py_MD5.*/s/^ /; /" >>$@
-
-$(PYTHON.IMPLIB): $(PYTHON.DEF)
-	$(IMPLIB) -o $@ $^
-
-$(PYTHON.EXEIMP): $(PYTHON.DEF)
-	$(IMPLIB) -o $@ $^
-
-$(PYTHON.DLL): $(OUT)dllentry$O $(PYTHON.LIB) $(PYTHON.DEF)
-
-# Explicit make targets for the .EXEs to be able to use LD to link
-# (so that fork() will work if required)
-
-$(PYTHON.EXE): $(SRC.EXE) $(PYTHON.EXEIMP) $(OUT)python.def
-	$(CC) -Zmt $(LDMODE.EXE) -Zcrtdll -Wall $(INCLUDE) -L. -lgcc -o $@ $(SRC.EXE) $(PYTHON.EXEIMP) $(LIBS) $(OUT)python.def
-	$(EXEOPT) -aq $(PYTHON.EXE) -h$(NFILES)
-
-$(PYTHONPM.EXE): $(SRC.PMEXE) $(PYTHON.EXEIMP) $(OUT)pythonpm.def
-	$(CC) -Zmt $(LDMODE.EXE) -Zcrtdll -Wall $(INCLUDE) -L. -lgcc -o $@ $(SRC.PMEXE) $(PYTHON.EXEIMP) $(LIBS) $(OUT)pythonpm.def
-	$(EXEOPT) -aq $(PYTHONPM.EXE) -h$(NFILES)
-
-$(PGEN.EXE): $(OBJ.PGEN) $(OUT)pgen.def
-
-# Explicit building instructions for those external modules that require 
-# awkward handling (due e.g. to non-std naming, or multiple source files)
-# - standard modules
-
-_socket$(MODULE.EXT): $(OUT)socketmodule$O $(OUT)_socket_m.def $(PYTHON.IMPLIB)
-	$(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
-
-# _testcapi needs to be renamed to be useful
-_testcapi$(MODULE.EXT): $(OUT)_testcapimodule$O $(OUT)_testcapi_m.def $(PYTHON.IMPLIB)
-	$(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
-
-_testcap$(MODULE.EXT): _testcapi$(MODULE.EXT)
-	cp $^ $@
-
-# unicodedata needs to be renamed to be useful
-unicodedata$(MODULE.EXT): $(OUT)unicodedata$O $(OUT)unicodedata_m.def $(PYTHON.IMPLIB)
-	$(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) $(MODULE_LIBS)
-
-unicoded$(MODULE.EXT): unicodedata$(MODULE.EXT)
-	cp $^ $@
-
-crypt$(MODULE.EXT): $(OUT)cryptmodule$O $(OUT)crypt_m.def $(PYTHON.IMPLIB)
-	$(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) -lufc $(LIBS)
-
-# The _curses_panel module requires a couple of ncurses library entry
-# points, which are best exposed as exports from the _curses module DLL
-$(OUT)_curses_m.def:
-	@echo Creating .DEF file: $@
-	@echo LIBRARY $(notdir $*) INITINSTANCE TERMINSTANCE >$@
-	@echo DESCRIPTION $(DQUOTE)$(DESCRIPTION.$(notdir $*)$(MODLIB.EXT))$(DQUOTE) >>$@
-	@echo DATA MULTIPLE NONSHARED >>$@
-	@echo EXPORTS >>$@
-	@echo 	init_curses >>$@
-	@echo 	wnoutrefresh >>$@
-	@echo 	_nc_panelhook >>$@
-	@echo 	is_linetouched >>$@
-	@echo 	mvwin >>$@
-	@echo 	stdscr >>$@
-	@echo 	wtouchln >>$@
-
-$(OUT)_curses_panel_m.def:
-	@echo Creating .DEF file: $@
-	@echo LIBRARY $(notdir $*) INITINSTANCE TERMINSTANCE >$@
-	@echo DESCRIPTION $(DQUOTE)Python standard module $(notdir $*)$(DQUOTE) >>$@
-	@echo DATA MULTIPLE NONSHARED >>$@
-	@echo IMPORTS >>$@
-	@echo 	_curses.wnoutrefresh >>$@
-	@echo 	_curses._nc_panelhook >>$@
-	@echo 	_curses.is_linetouched >>$@
-	@echo 	_curses.mvwin >>$@
-	@echo 	_curses.stdscr >>$@
-	@echo 	_curses.wtouchln >>$@
-	@echo EXPORTS >>$@
-	@echo 	init_curses_panel >>$@
-
-_curses$(MODLIB.EXT): $(OUT)_cursesmodule$O $(OUT)_curses_m.def $(PYTHON.IMPLIB)
-	$(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lncurses
-
-# curses_panel needs to be renamed to be useful
-_curses_panel$(MODULE.EXT): $(OUT)_curses_panel$O $(OUT)_curses_panel_m.def $(PYTHON.IMPLIB)
-	$(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lpanel
-
-_curses_$(MODULE.EXT): _curses_panel$(MODULE.EXT)
-	cp $^ $@
-
-_dbm$(MODULE.EXT): $(OUT)_dbmmodule$O $(OUT)dbm_m.def $(PYTHON.IMPLIB)
-	$(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lgdbm
-
-_gdbm$(MODULE.EXT): $(OUT)_gdbmmodule$O $(OUT)gdbm_m.def $(PYTHON.IMPLIB)
-	$(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lgdbm
-
-
-# Expat is now distributed with Python, so use the included version
-$(OUT)pyexpat$O:	../../Modules/pyexpat.c
-	$(CC) $(CFLAGS) $(EXPAT.INC) -c -o $@ $^
-$(OUT)xmlparse$O:	../../Modules/expat/xmlparse.c
-	$(CC) $(CFLAGS) $(EXPAT.INC) $(EXPAT.DEF) -c -o $@ $^
-$(OUT)xmlrole$O:	../../Modules/expat/xmlrole.c
-	$(CC) $(CFLAGS) $(EXPAT.INC) $(EXPAT.DEF) -c -o $@ $^
-$(OUT)xmltok$O:	../../Modules/expat/xmltok.c
-	$(CC) $(CFLAGS) $(EXPAT.INC) $(EXPAT.DEF) -c -o $@ $^
-pyexpat$(MODULE.EXT): $(OUT)pyexpat$O $(OUT)xmlparse$O $(OUT)xmlrole$O \
-		$(OUT)xmltok$O $(OUT)pyexpat_m.def $(PYTHON.IMPLIB)
-	$(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
-
-readline$(MODULE.EXT): $(OUT)readline$O $(OUT)readline_m.def $(PYTHON.IMPLIB)
-	$(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lreadline -lncurses
-
-#_tkinter$(MODULE.EXT): $(OUT)_tkinter$O $(OUT)tclNotify$O $(OUT)tkappinit$O
-_tkinter$(MODULE.EXT): $(OUT)_tkinter$O $(OUT)tclNotify$O \
-		$(OUT)_tkinter_m.def $(PYTHON.IMPLIB)
-	$(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) $(TK_LIBS)
-
-zlib$(MODULE.EXT): $(OUT)zlibmodule$O $(OUT)zlib_m.def $(PYTHON.IMPLIB)
-	$(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lz
-
-bz2$(MODULE.EXT): $(OUT)bz2module$O $(OUT)bz2_m.def $(PYTHON.IMPLIB)
-	$(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lbz2
-
-_ssl$(MODULE.EXT): $(OUT)_ssl$O $(OUT)_ssl_m.def $(PYTHON.IMPLIB)
-	$(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lssl -lcrypto
-
-# the test target
-test:
-	-find ../../Lib -name "*.py[co]" -exec rm {} ";"
-	-./python -E ../../lib/test/regrtest.py -l -u "network"
-	./python -E ../../lib/test/regrtest.py -l -u "network"
-
--include $(OUTBASE)python.dep
diff --git a/PC/os2emx/README.os2emx b/PC/os2emx/README.os2emx
deleted file mode 100644
index 61cf6df..0000000
--- a/PC/os2emx/README.os2emx
+++ /dev/null
@@ -1,663 +0,0 @@
-This is a port of Python 2.6 to OS/2 using the EMX development tools
-=========================================================================
-
-What's new since the previous release
--------------------------------------
-
-Another day, another version...
-
-
-Licenses and info about Python and EMX
---------------------------------------
-
-Please read the file README.Python-2.6 included in this package for 
-information about Python 2.6.  This file is the README file from the 
-Python 2.6 source distribution available via http://www.python.org/ 
-and its mirrors.  The file LICENCE.Python-2.6 is the text of the Licence 
-from the Python 2.6 source distribution.
-
-Note that the EMX package that this package depends on is released under 
-the GNU General Public Licence.  Please refer to the documentation 
-accompanying the EMX Runtime libraries for more information about the 
-implications of this.  A copy of version 2 of the GPL is included as the 
-file COPYING.gpl2.
-
-Readline and GDBM are covered by the GNU General Public Licence.  I think 
-Eberhard Mattes' porting changes to BSD DB v1.85 are also GPL'ed (BSD DB 
-itself is BSD Licenced).  ncurses and expat appear to be covered by MIT 
-style licences - please refer to the source distributions for more detail.  
-zlib is distributable under a very free license.  GNU UFC is under the 
-GNU LGPL (see file COPYING.lib).
-
-My patches to the Python-2.x source distributions, and any other packages 
-used in this port, are placed in the public domain.
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the author be held liable for any damages arising from the 
-use of the software.
-
-I do hope however that it proves useful to someone.
-
-
-Other ports
------------
-
-There have been ports of previous versions of Python to OS/2.
-
-The best known would be that by Jeff Rush, most recently of version 
-1.5.2.  Jeff used IBM's Visual Age C++ (v3) for his ports, and his 
-patches have been included in the Python 2.6 source distribution.
-
-Andy Zabolotny implemented a port of Python v1.5.2 using the EMX 
-development tools.  His patches against the Python v1.5.2 source 
-distribution have become the core of this port, and without his efforts 
-this port wouldn't exist.  Andy's port also appears to have been 
-compiled with his port of gcc 2.95.2 to EMX, which I have but have 
-chosen not to use for the binary distribution of this port (see item 16 
-of the "YOU HAVE BEEN WARNED" section below).
-
-It is possible to have these earlier ports still usable after installing 
-this port - see the README.os2emx.multiple_versions file, contributed by
-Dr David Mertz, for a suggested approach to achieving this.
-
-
-Software requirements
----------------------
-
-This package requires the EMX Runtime package, available from the 
-Hobbes (http://hobbes.nmsu.edu/) and LEO (http://archiv.leo.org/) 
-archives of OS/2 software.  I have used EMX version 0.9d fix04 in 
-developing this port.
-
-My development system is running OS/2 v4 with fixpack 12.
-
-3rd party software which has been linked into dynamically loaded modules:
-- ncurses      (see http://dickey.his.com/ for more info, v5.2)
-- GNU Readline (Kai Uwe Rommel's port available from Hobbes or LEO, v2.1)
-- GNU GDBM     (Kai Uwe Rommel's port available from Hobbes or LEO, v1.7.3)
-- zlib         (derived from Hung-Chi Chu's port of v1.1.3, v1.1.4)
-- expat        (distributed with Python, v1.95.6)
-- GNU UFC      (Kai Uwe Rommel's port available from LEO, v2.0.4)
-
-
-About this port
----------------
-
-I have attempted to make this port as complete and functional as I can, 
-notwithstanding the issues in the "YOU HAVE BEEN WARNED" section below.
-
-Core components:
-
-Python.exe is linked as an a.out executable, ie using EMX method E1 
-to compile & link the executable.  This is so that fork() works (see 
-"YOU HAVE BEEN WARNED" item 1).
-
-Python26.dll is created as a normal OMF DLL, with an OMF import 
-library and module definition file.  There is also an a.out (.a) import 
-library to support linking the DLL to a.out executables.  The DLL 
-requires the EMX runtime DLLs.
-
-This port has been built with complete support for multithreading.
-
-Modules:
-
-With the exception of modules that have a significant code size, or are 
-not recommended or desired for normal use, the standard modules are now 
-built into the core DLL rather than configured as dynamically loadable 
-modules.  This is for both reasons of performance (startup time) and 
-memory use (lots of small DLLs fragment the address space).
-
-I haven't yet changed the building of Python's dynamically loadable 
-modules over to using the DistUtils.
-
-See "YOU HAVE BEEN WARNED" item 3 for notes about the fcntl module, and 
-"YOU HAVE BEEN WARNED" item 10 for notes about the pwd and grp modules.
-
-This port supports case sensitive module import semantics, matching 
-the Windows release.  This can be deactivated by setting the PYTHONCASEOK 
-environment variable (the value doesn't matter) - see "YOU HAVE BEEN WARNED" 
-item 12.
-
-Optional modules:
-
-Where I've been able to locate the required 3rd party packages already 
-ported to OS/2, I've built and included them.
-
-These include ncurses (_curses, _curses_panel),
-GNU GDBM (gdbm, dbm), zlib (zlib), GNU Readline (readline), and GNU UFC 
-(crypt).
-
-Expat is now included in the Python release sourceball, and the pyexpat 
-module is always built.
-
-I have built these modules statically linked against the 3rd party 
-libraries.  Unfortunately my attempts to use the dll version of GNU 
-readline have been a dismal failure, in that when the dynamically 
-linked readline module is active other modules immediately provoke a 
-core dump when imported.
-
-Only the BSD DB package (part of the BSD package distributed with EMX) 
-needs source modifications to be used for this port, pertaining to use 
-of errno with multithreading.
-
-The other packages, except for ncurses and zlib, needed Makefile changes 
-for multithreading support but no source changes.
-
-The _curses_panel module is a potential problem - see "YOU HAVE BEEN 
-WARNED" item 13.
-
-Upstream source patches:
-
-No updates to the Python 2.6 release have become available.
-
-Library and other distributed Python code:
-
-The Python standard library lives in the Lib directory.  All the standard 
-library code included with the Python 2.6 source distribution is included 
-in the binary archive, with the exception of the dos-8x3 and tkinter 
-subdirectories which have been omitted to reduce the size of the binary 
-archive - the dos-8x3 components are unnecessary duplicates and Tkinter 
-is not supported by this port (yet).  All the plat-* subdirectories in the 
-source distribution have also been omitted, except for the plat-os2emx 
-subdirectory.
-
-The Tools and Demo directories contain a collection of Python scripts.  
-To reduce the size of the binary archive, the Demo/sgi, Demo/Tix, 
-Demo/tkinter, Tools/audiopy and Tools/IDLE subdirectories have been 
-omitted as not being supported by this port.  The Misc directory has 
-also been omitted.
-
-All subdirectories omitted from the binary archive can be reconstituted 
-from the Python 2.6 source distribution, if desired.
-
-Support for building Python extensions:
-
-The Config subdirectory contains the files describing the configuration 
-of the interpreter and the Makefile, import libraries for the Python DLL, 
-and the module definition file used to create the Python DLL.  The 
-Include subdirectory contains all the standard Python header files 
-needed for building extensions.
-
-As I don't have the Visual Age C++ compiler, I've made no attempt to 
-have this port support extensions built with that compiler.
-
-
-Packaging
----------
-
-This port is packaged as follows:
-- python-2.6-os2emx-bin-03????.zip  (binaries, library modules)
-- python-2.6-os2emx-src-03????      (patches+makefiles for non-Python code)
-
-As all the Python specific patches for the port are now part of the 
-Python release tarball, only the patches and makefiles involved in 
-building external libraries for optional extensions are included in 
-the source archive.
-
-Documentation for the Python language, as well as the Python 2.6 
-source distibution, can be obtained from the Python website 
-(http://www.python.org/) or the Python project pages at Sourceforge 
-(http://sf.net/projects/python/).
-
-
-Installation
-------------
-
-Obtain and install, as per the included instructions, the EMX runtime 
-package.
-
-Unpack this archive, preserving the subdirectories, in the root directory 
-of the drive where you want Python to live.
-
-Add the Python directory (eg C:\Python26) to the PATH and LIBPATH 
-variables in CONFIG.SYS.
-
-You should then set the PYTHONHOME and PYTHONPATH environment variables 
-in CONFIG.SYS.
-
-PYTHONHOME should be set to Python's top level directory.  PYTHONPATH 
-should be set to the semicolon separated list of principal Python library 
-directories.
-I use:
-  SET PYTHONHOME=F:/Python26
-  SET PYTHONPATH=F:/Python26/Lib;F:/Python26/Lib/plat-os2emx;
-                 F:/Python26/Lib/lib-dynload;F:/Python26/Lib/site-packages
-
-NOTE!:  the PYTHONPATH setting above is linewrapped for this document - it 
-should all be on one line in CONFIG.SYS!
-
-If you wish to use the curses module, you should set the TERM and TERMINFO 
-environment variables appropriately.
-
-If you don't already have ncurses installed, I have included a copy of the 
-EMX subset of the Terminfo database included with the ncurses-5.2 source 
-distribution.  This can be used by setting the TERMINFO environment variable 
-to the path of the Terminfo subdirectory below the Python home directory.
-On my system this looks like:
-  SET TERMINFO=F:/Python26/Terminfo
-
-For the TERM environment variable, I would try one of the following:
-  SET TERM=ansi
-  SET TERM=os2
-  SET TERM=window
-
-You will have to reboot your system for these changes to CONFIG.SYS to take 
-effect.
-
-If you wish to compile all the included Python library modules to bytecode, 
-you can change into the Python home directory and run the COMPILEALL.CMD 
-batch file.
-
-You can execute the regression tests included with the Python 2.6 source 
-distribution by changing to the Python 2.6 home directory and executing the 
-REGRTEST.CMD batch file.  The following tests are known to fail at this 
-time:
-- test_mhlib (I don't know of any port of MH to OS/2);
-- test_strptime (see "YOU HAVE BEEN WARNED" item 22);
-- test_time (see "YOU HAVE BEEN WARNED" item 22);
-- test_posixpath (see "YOU HAVE BEEN WARNED" item 23).
-
-Note that some of the network related tests expect the loopback interface
-(interface "lo", with IP address 127.0.0.1) to be enabled, which from my
-experience is not the default configuration.  Additionally, test_popen2
-expects the "cat" utility (such as found in ports of the GNU tools) to
-be installed.
-
-
-Building from source
---------------------
-
-With the EMX port now checked into Python's CVS repository, the build 
-infrastructure is part of the Python release sourceball.
-
-Prerequisites
-
-First and foremost, you need an operational EMX development installation - 
-EMX v0.9d with fix04 (the latest at time of writing) & the gcc 2.8.1 
-compiler released by Eberhard Mattes is the recommended setup.
-
-If you have a different version of gcc installed, see "YOU HAVE BEEN 
-WARNED" item 16.
-
-Other items of software required:-
-
-- GNU make (I'm using v3.76.1)
-- rm, cp, mkdir from the GNU file utilities package
-- GNU find
-- GNU sed
-
-Procedure
-
-0. all changes mentioned apply to files in the PC/os2emx subdirectory 
-   of the Python release source tree.  make is also executed from this 
-   directory, so change into this directory before proceeding.
-
-1. decide if you need to change the location of the Python installation.
-   If you wish to do this, set the value of the Makefile variable LIB_DIR 
-   to the directory you wish to use for PYTHONHOME 
-   (eg /usr/local/lib/python2.6).
-
-   If you want Python to find its library without the PYTHONHOME 
-   environment variable set, set the value of the Makefile variable 
-   FIXED_PYHOME to "yes" (uncomment the appropriate line).
-
-2. If you wish the Python executables (python.exe, pythonpm.exe & pgen.exe) 
-   to be installed in a directory other than the PYTHONHOME directory, set 
-   the value of the Makefile variable EXE_DIR to the appropriate directory.
-
-3. If you wish the Python core DLL (python33.dll) to be installed in a 
-   directory other than the directory in which the Python executables are 
-   installed (by default, the PYTHONHOME directory), set the value of the 
-   Makefile variable DLL_DIR to the appropriate directory.  This DLL must 
-   be placed in a directory on the system's LIBPATH, or that gets set 
-   with BEGINLIBPATH or ENDLIBPATH.
-
-4. If you have installed any of the libraries that can be used to build 
-   optional Python modules, set the value of the relevant HAVE_<package> 
-   Makefile variable to "yes".  The Makefile currently supports:
-
-   library               Makefile variable
-   ........................................
-   zlib (1.1.4)          HAVE_ZLIB
-   GNU UltraFast Crypt   HAVE_UFC
-   Tcl/Tk                HAVE_TCLTK (not known to work)
-   GNU Readline          HAVE_GREADLINE
-   ncurses               HAVE_NCURSES
-   GNU gdbm              HAVE_GDBM
-   libbz2                HAVE_BZ2
-   OpenSSL               HAVE_OPENSSL
-
-   Please note that you need to check that what you have installed 
-   is compatible with Python's build options.  In particular, the 
-   BSD DB v1.85 library needs to be rebuilt with a source patch for 
-   multithread support (doesn't change the library's reentrant status 
-   but allows it to be linked to Python which is multithreaded).  
-   Widely available binary packages of other librarys & DLLs are 
-   not built/linked with multithread support.  Beware!
-
-   Also note that the Makefile currently expects any libraries to be 
-   found with the default library search path.  You may need to add 
-   -L switches to the LDFLAGS Makefile variable if you have installed 
-   libraries in directories not in the default search path (which can 
-   be controlled by the LIBRARY_PATH environment variable used by EMX).
-
-5. make
-
-   It is usually a good idea to redirect the stdout and stderr streams 
-   of the make process to log files, so that you can review any messages. 
-
-6. make test
-
-   This runs the Python regression tests, and completion is a sign of 
-   a usable build.  You should check the list of skipped modules to 
-   ensure that any optional modules you selected have been built; 
-   checking the list of failures against the list of known failures 
-   elsewhere in this document is also prudent.
-
-7. make install
-   >>>>>> NOT YET COMPLETE <<<<<< 
-
-8. change to a directory outside the Python source tree and start Python. 
-   Check the version and build date to confirm satisfactory installation.
-
-
-YOU HAVE BEEN WARNED!!
-----------------------
-
-I know about a number of nasties in this port.
-
-1.  Eberhard Mattes, author of EMX, writes in his documentation that fork() 
-is very inefficient in the OS/2 environment.  It also requires that the 
-executable be linked in a.out format rather than OMF.  Use the os.exec 
-and/or the os.spawn family of functions where possible.
-
-2.  In the absence of GNU Readline, terminating the interpreter requires a 
-control-Z (^Z) followed by a carriage return.  Jeff Rush documented this 
-problem in his Python 1.5.2 port.  With Readline, a control-D (^D) works 
-as per the standard Unix environment.
-
-3.  EMX only has a partial implementation of fcntl().  The fcntl module 
-in this port supports what EMX supports.  If fcntl is important to you, 
-please review the EMX C Library Reference (included in .INF format in the 
-EMXVIEW.ZIP archive as part of the complete EMX development tools suite).
-Because of other side-effects I have modified the test_fcntl.py test 
-script to deactivate the exercising of the missing functionality.
-
-4.  The readline module has been linked against ncurses rather than the 
-termcap library supplied with EMX.
-
-5.  I have configured this port to use "/" as the preferred path separator 
-character, rather than "\" ('\\'), in line with the convention supported 
-by EMX.  Backslashes are still supported of course, and still appear in 
-unexpected places due to outside sources that don't get normalised.
-
-6.  While the DistUtils components are now functional, other 
-packaging/binary handling tools and utilities such as those included in
-the Demo and Tools directories - freeze in particular - are unlikely to 
-work.  If you do get them going, I'd like to know about your success.
-
-7.  I haven't set out to support the [BEGIN|END]LIBPATH functionality 
-supported by one of the earlier ports (Rush's??).  If it works let me know.
-
-8. As a result of the limitations imposed by EMX's library routines, the 
-standard extension module pwd only synthesises a simple passwd database, 
-and the grp module cannot be supported at all.
-
-I have written pure Python substitutes for pwd and grp, which can process 
-real passwd and group files for those applications (such as MailMan) that 
-require more than EMX emulates.  I have placed pwd.py and grp.py in 
-Lib/plat-os2emx, which is usually before Lib/lib-dynload (which contains 
-pwd.pyd) in the PYTHONPATH.  If you have become attached to what pwd.pyd 
-supports, you can put Lib/lib-dynload before Lib/plat-os2emx in PYTHONPATH 
-or delete/rename pwd.py & grp.py.
-
-pwd.py & grp.py support locating their data files by looking in the 
-environment for them in the following sequence:
-pwd.py:  $ETC_PASSWD             (%ETC_PASSWD%)
-         $ETC/passwd             (%ETC%/passwd)
-         $PYTHONHOME/Etc/passwd  (%PYTHONHOME%/Etc/passwd)
-grp.py:  $ETC_GROUP              (%ETC_GROUP%)
-         $ETC/group              (%ETC%/group)
-         $PYTHONHOME/Etc/group   (%PYTHONHOME%/Etc/group)
-
-The ETC_PASSWD and ETC_GROUP environment variables are intended to allow 
-support for multiple passwd/grp files, where other applications may not 
-support as wide a variety of input variations (drive remappings, 
-separators etc).
-
-Both modules support using either the ":" character (Unix standard) or 
-";" (OS/2, DOS, Windows standard) field separator character, and pwd.py 
-implements the following drive letter conversions for the home_directory and 
-shell fields (for the ":" separator only):
-         $x  ->  x:
-         x;  ->  x:
-
-Example versions of passwd and group are in the Etc subdirectory.  The 
-regression tests (test_pwd and test_grp) will fail if valid password and 
-group files cannot be found, but should pass otherwise.
-
-Be aware that Python's pwd & group modules are for reading password and 
-group information only.
-
-11. EMX's termios routines don't support all of the functionality now 
-exposed by the termios module - refer to the EMX documentation to find 
-out what is supported.
-
-12. The case sensitive import semantics introduced in Python 2.1 for other 
-case insensitive but case preserving file/operating systems (Windows etc), 
-have been incorporated into this port, and are active by default.  Setting 
-the PYTHONCASEOK environment variable (to any value) reverts to the 
-previous (case insensitive) semantics.  This can be an issue with some 
-file management utilities that do not preserve the case of file and
-directory names.
-
-13. Because I am statically linking ncurses, the _curses_panel 
-module has potential problems arising from separate library data areas.
-To avoid this, I have configured the _curses_.pyd (imported as 
-"_curses_panel") to import the ncurses symbols it needs from _curses.dll 
-(which is the curses module, but with a .dll extension rather than .pyd 
-so that the dynamic loader can actually import the symbols from it as a 
-DLL).
-
-The site module (Lib/site.py) has code added to tweak BEGINLIBPATH so
-that _curses.dll is found when _curses_panel is imported.  If you have
-problems attempting to use the _curses_panel support please let me know,
-and I'll have another look at this.
-
-14. sys.platform reports "os2emx" instead of "os2".  os.name still 
-reports "os2".  This change was to make it easier to distinguish between 
-the VAC++ build (formerly maintained by Michael Muller) and the EMX build 
-(this port), principally for DistUtils.
-
-15. it appears that the %W substitution in the EMX strftime() routine has 
-an off-by-one bug.  strftime was listed as passing the regression tests 
-in previous releases, but this fact appears to have been an oversight in 
-the regression test suite.  To fix this really requires a portable 
-strftime routine - I'm looking into using one from FreeBSD, but its not 
-ready yet.
-
-16. I have successfully built this port with Andy Zabolotny's ports of 
-pgcc 2.95 and gcc 3.2.1, in addition to EM's gcc 2.8.1.
-
-I have not attempted to compile Python with any version of gcc prior to 
-v2.8.1.
-
-This release sees the default optimisation change to 
-"-O3 -fomit-frame-pointer -mprobe".  This works fine too for pgcc 2.95 
-but not for gcc 3.2.1.
-
-With gcc 3.2.1, -O3 causes 2 unexpected test failures: test_format and 
-test_unicode.  Both these tests pass if -O2 is instead of -O3 with this 
-compiler, and the performance difference is negligible (in contrast to 
-gcc 2.8.1 and pgcc 2.95, where the performance difference between the 
-2 optimisation settings approaches 10%).
-
-17.  os.spawnv() and os.spawnve() expose EMX's library routines rather 
-than use the emulation in os.py.
-
-In order to make use of some of the features this makes available in 
-the OS/2 environment, you should peruse the relevant EMX documentation 
-(EMXLIB.INF in the EMXVIEW.ZIP archive accompanying the EMX archives 
-on Hobbes or LEO).  Be aware that I have exposed all the "mode" options 
-supported by EMX, but there are combinations that either cannot be 
-practically used by/in Python or have the potential to compromise your 
-system's stability.
-
-18.  pythonpm.exe used to be just python.exe with the WINDOWAPI linker 
-option set in the pythonpm.def file.  In practice, this turns out to do 
-nothing useful.
-
-I have written a replacement which wraps the Python DLL in a genuine 
-Presentation Manager application.  This version actually runs the 
-Python interpreter in a separate thread from the PM shell, in order 
-that PythonPM has a functioning message queue as good PM apps should.
-In its current state, PythonPM's window is hidden.  It can be displayed, 
-although it will have no content as nothing is ever written to the 
-window.  Only the "hide" button is available.  Although the code 
-has support for shutting PythonPM down when the Python interpreter is 
-still busy (via the "control" menu), this is not well tested and given 
-comments I've come across in EMX documentation suggesting that the 
-thread killing operation has problems I would suggest caution in 
-relying on this capability.
-
-PythonPM processes commandline parameters normally.  The standard input, 
-output and error streams are only useful if redirected, as PythonPM's 
-window is not a console in any form and so cannot accept or display 
-anything.  This means that the -i option is ineffective.
-
-Because the Python thread doesn't create its own message queue, creating 
-PM Windows and performing most PM operations is not possible from within 
-this thread.  How this will affect supporting PM extensions (such as 
-Tkinter using a PM port of Tcl/Tk, or wxPython using the PM port of 
-WxWindows) is still being researched.
-
-Note that os.fork() _DOES_NOT_WORK_ in PythonPM - SYS3175s are the result 
-of trying.  os.spawnv() _does_ work.  PythonPM passes all regression tests 
-that the standard Python interpreter (python.exe) passes, with the exception 
-of test_fork1 and test_socket which both attempt to use os.fork().
-
-I very much want feedback on the performance, behaviour and utility of 
-PythonPM.  I would like to add a PM console capability to it, but that 
-will be a non-trivial effort.  I may be able to leverage the code in 
-Illya Vaes' Tcl/Tk port, which would make it easier.
-
-19.  os.chdir() uses EMX's _chdir2(), which supports changing both drive 
-and directory at once.  Similarly, os.getcwd() uses EMX's _getcwd() 
-which returns drive as well as path.
-
-20.  pyconfig.h is installed in the Include subdirectory with all 
-other include files.
-
-21.  the default build explicitly sets the number of file handles 
-available to a Python process to 250.  EMX default is 40, which is 
-insufficient for the tempfile regression test (test_tempfile) which 
-tries to create 100 temporary files.
-
-This setting can be overridden via the EMXOPT environment variable:
-  set EMXOPT=-h250
-is equivalent to the setting currently used.  The emxbind utility (if you 
-have it installed) can also be used to permanently change the setting in 
-python.exe - please refer to the EMX documentation for more information.
-
-22.  a pure python strptime module is now part of the Python standard
-library, superceding a platform specific extension module. This module
-leverages the strftime module, and as a result test_strptime fails
-due to the EMX strftime bug in item 20 above.
-
-23.  test_posixpath attempts to exercise various Posix path related
-functionality.  Most of the sub-tests pass, but the "ismount" and
-"samestat" subtests fail:
-- EMX provides not satisfactory mount point emulation, so "ismount"
-  cannot succeed;
-- EMX documents that successive stat() calls will produce different
-  results, so "samestat" cannot succeed.
-
-test_posixpath should skip these tests on EMX.
-
-24.  I have reports of BitTorrent not working.  It appears that the
-EMX select() emulation, possibly in concert with bugs in the TCP/IP
-stack, runs into problems under the stress imposed by this application.
-I think it suffices to say that BitTorrent is a fair stress test of a
-system's networking capability.
-
-25.  In the absence of an EMX implementation of the link() function, I've 
-implemented a crude Python emulation, in the file 
-Lib/plat-os2emx/_emx_link.py.  This is imported into the os module, and 
-becomes available as os.link() in the normal way.
-
-The emulation copies the source file in binary mode, and will fail if 
-disk space is exhausted. The call fails if the target already exists. 
-There are no guarantees to thread safety with this emulation - beware!
-
-The emulation was written to support a link() based file locking system 
-used in GNU Mailman.
-
-26.  AF_UNIX sockets, otherwise known as Unix domain sockets, are now
-supported.  Unfortunately, there are some traps arising from the
-implementation in IBM's TCP/IP stack:-
-- the path name must start with '\\socket\\' ('/socket/' won't work!),
-  with the length of the full path name less than 108 characters;
-- unlike Unix, the socket endpoints don't exist in the filesystem;
-- by default, sockets are in binary mode.
-
-27.  As of Python 2.4, the mpz, rotor and xreadlines modules have been 
-dropped from the Python source tree.
-
-28.  The subprocess module was added to the standard library relatively
-late in the 2.4 development cycle.  Unfortunately I haven't had the
-round tuits to adapt the module to the EMX environment yet, and
-test_subprocess has a number of failures as a result.
-
-29.  The default stack size for threads has been 64k.  This is proving
-insufficient for some codebases, such as Zope.  The thread stack size
-still defaults to 64k, but this can now be increased via the stack_size()
-function exposed by the threading & thread modules as well as by defining
-THREAD_STACK_SIZE to an appropriate value in the Makefile (which contains
-a commented out definition for 128kB thread stacks).  I have seen
-references to heavy Zope/Plone usage requiring 1MB thread stacks on
-FreeBSD and Linux, but doubt that for most likely usage on OS/2 that
-more than 256kB is necessary.  The size of the required stacks (main 
-and thread) can vary significantly depending on which version of gcc
-is used along with the compiler optimisations selected.  Note that the
-main thread stack size is set during linking and is currently 2MB.
-
-... probably other issues that I've not encountered, or don't remember :-(
-
-If you encounter other difficulties with this port, which can be 
-characterised as peculiar to this port rather than to the Python release,
-I would like to hear about them.  However I cannot promise to be able to do 
-anything to resolve such problems.  See the Contact section below...
-
-
-To do...
---------
-
-In no particular order of apparent importance or likelihood...
-
-- support Tkinter and/or alternative GUI (wxWindows??)
-
-
-Credits
--------
-
-In addition to people identified above, I'd like to thank:
-- the BDFL, Guido van Rossum, and crew for Python;
-- Dr David Mertz, for trying out a pre-release of this port;
-- the Python-list/comp.lang.python community;
-- John Poltorak, for input about pwd/grp.
-
-Contact
--------
-
-Constructive feedback, negative or positive, about this port is welcome 
-and should be addressed to me at the e-mail addresses below.
-
-I have a private mailing list for announcements of fixes & updates to 
-this port.  If you wish to receive such e-mail announcments, please send 
-me an e-mail requesting that you be added to this list.
-
-Andrew MacIntyre
-E-mail: andymac@bullseye.apana.org.au, or andymac@pcug.org.au
-Web:    http://www.andymac.org/
-
-28 January, 2008.
diff --git a/PC/os2emx/config.c b/PC/os2emx/config.c
deleted file mode 100644
index 5879110..0000000
--- a/PC/os2emx/config.c
+++ /dev/null
@@ -1,164 +0,0 @@
-/* -*- C -*- ***********************************************
-Copyright 1991-1995 by 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 names of Stichting Mathematisch
-Centrum or CWI or Corporation for National Research Initiatives or
-CNRI not be used in advertising or publicity pertaining to
-distribution of the software without specific, written prior
-permission.
-
-While CWI is the initial source for this software, a modified version
-is made available by the Corporation for National Research Initiatives
-(CNRI) at the Internet address ftp://ftp.python.org.
-
-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.
-
-******************************************************************/
-
-/* Module configuration */
-
-/* This file contains the table of built-in modules.
-   See init_builtin() in import.c. */
-
-#include "Python.h"
-
-extern void initos2();
-extern void initsignal();
-#ifdef WITH_THREAD
-extern void init_thread();
-#endif
-extern void init_codecs();
-extern void init_csv();
-extern void init_locale();
-extern void init_random();
-extern void init_sre();
-extern void init_symtable();
-extern void init_weakref();
-extern void initarray();
-extern void initbinascii();
-extern void initcollections();
-extern void initcmath();
-extern void initdatetime();
-extern void initdl();
-extern void initerrno();
-extern void initfcntl();
-extern void init_functools();
-extern void init_heapq();
-extern void initimageop();
-extern void inititertools();
-extern void initmath();
-extern void init_md5();
-extern void initoperator();
-extern void init_sha();
-extern void init_sha256();
-extern void init_sha512();
-extern void init_struct();
-extern void inittermios();
-extern void inittime();
-extern void initxxsubtype();
-extern void initzipimport();
-#if !HAVE_DYNAMIC_LOADING
-extern void init_curses();
-extern void init_curses_panel();
-extern void init_testcapi();
-extern void initbz2();
-extern void initfpectl();
-extern void initfpetest();
-extern void initparser();
-extern void initpwd();
-extern void initunicodedata();
-extern void initzlib();
-#ifdef USE_SOCKET
-extern void init_socket();
-extern void initselect();
-#endif
-#endif
-/* -- ADDMODULE MARKER 1 -- */
-
-extern void PyMarshal_Init();
-extern void initimp();
-extern void initgc();
-
-struct _inittab _PyImport_Inittab[] = {
-
-    {"os2", initos2},
-    {"signal", initsignal},
-#ifdef WITH_THREAD
-    {"_thread", init_thread},
-#endif
-    {"_codecs", init_codecs},
-    {"_csv", init_csv},
-    {"_locale", init_locale},
-    {"_random", init_random},
-    {"_sre", init_sre},
-    {"_symtable", init_symtable},
-    {"_weakref", init_weakref},
-    {"array", initarray},
-    {"binascii", initbinascii},
-    {"collections", initcollections},
-    {"cmath", initcmath},
-    {"datetime", initdatetime},
-    {"dl", initdl},
-    {"errno", initerrno},
-    {"fcntl", initfcntl},
-    {"_functools", init_functools},
-    {"_heapq", init_heapq},
-    {"imageop", initimageop},
-    {"itertools", inititertools},
-    {"math", initmath},
-    {"operator", initoperator},
-    {"_sha256", init_sha256},
-    {"_sha512", init_sha512},
-    {"_struct", init_struct},
-    {"termios", inittermios},
-    {"time", inittime},
-    {"xxsubtype", initxxsubtype},
-    {"zipimport", initzipimport},
-#if !HAVE_DYNAMIC_LOADING
-    {"_curses", init_curses},
-    {"_curses_panel", init_curses_panel},
-    {"_testcapi", init_testcapi},
-    {"bz2", initbz2},
-    {"fpectl", initfpectl},
-    {"fpetest", initfpetest},
-    {"parser", initparser},
-    {"pwd", initpwd},
-    {"unicodedata", initunicodedata},
-    {"zlib", initzlib},
-#ifdef USE_SOCKET
-    {"_socket", init_socket},
-    {"select", initselect},
-#endif
-#endif
-/* -- ADDMODULE MARKER 2 -- */
-
-    /* This module "lives in" with marshal.c */
-    {"marshal", PyMarshal_Init},
-
-    /* This lives it with import.c */
-    {"_imp", initimp},
-
-    /* These entries are here for sys.builtin_module_names */
-    {"builtins", NULL},
-    {"sys", NULL},
-
-    /* This lives in gcmodule.c */
-    {"gc", initgc},
-
-    /* Sentinel */
-    {0, 0}
-};
diff --git a/PC/os2emx/dlfcn.c b/PC/os2emx/dlfcn.c
deleted file mode 100644
index ebda9cd..0000000
--- a/PC/os2emx/dlfcn.c
+++ /dev/null
@@ -1,223 +0,0 @@
-/* -*- C -*- ***********************************************
-Copyright 1991-1995 by 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 names of Stichting Mathematisch
-Centrum or CWI or Corporation for National Research Initiatives or
-CNRI not be used in advertising or publicity pertaining to
-distribution of the software without specific, written prior
-permission.
-
-While CWI is the initial source for this software, a modified version
-is made available by the Corporation for National Research Initiatives
-(CNRI) at the Internet address ftp://ftp.python.org.
-
-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.
-
-******************************************************************/
-
-/* This library implements dlopen() - Unix-like dynamic linking
- * emulation functions for OS/2 using DosLoadModule() and company.
- */
-
-#define INCL_DOS
-#define INCL_DOSERRORS
-#define INCL_DOSSESMGR
-#define INCL_WINPROGRAMLIST
-#define INCL_WINFRAMEMGR
-#include <os2.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <malloc.h>
-
-typedef struct _track_rec {
-    char *name;
-    HMODULE handle;
-    void *id;
-    struct _track_rec *next;
-} tDLLchain, *DLLchain;
-
-static DLLchain dlload = NULL;  /* A simple chained list of DLL names */
-static char dlerr [256];        /* last error text string */
-static void *last_id;
-
-static DLLchain find_id(void *id)
-{
-    DLLchain tmp;
-
-    for (tmp = dlload; tmp; tmp = tmp->next)
-        if (id == tmp->id)
-            return tmp;
-
-    return NULL;
-}
-
-/* load a dynamic-link library and return handle */
-void *dlopen(char *filename, int flags)
-{
-    HMODULE hm;
-    DLLchain tmp;
-    char err[256];
-    char *errtxt;
-    int rc = 0, set_chain = 0;
-
-    for (tmp = dlload; tmp; tmp = tmp->next)
-        if (strnicmp(tmp->name, filename, 999) == 0)
-            break;
-
-    if (!tmp)
-    {
-        tmp = (DLLchain) malloc(sizeof(tDLLchain));
-        if (!tmp)
-            goto nomem;
-        tmp->name = strdup(filename);
-        tmp->next = dlload;
-        set_chain = 1;
-    }
-
-    switch (rc = DosLoadModule((PSZ)&err, sizeof(err), filename, &hm))
-    {
-        case NO_ERROR:
-            tmp->handle = hm;
-            if (set_chain)
-            {
-                do
-                    last_id++;
-                while ((last_id == 0) || (find_id(last_id)));
-                tmp->id = last_id;
-                dlload = tmp;
-            }
-            return tmp->id;
-        case ERROR_FILE_NOT_FOUND:
-        case ERROR_PATH_NOT_FOUND:
-            errtxt = "module `%s' not found";
-            break;
-        case ERROR_TOO_MANY_OPEN_FILES:
-        case ERROR_NOT_ENOUGH_MEMORY:
-        case ERROR_SHARING_BUFFER_EXCEEDED:
-nomem:
-            errtxt = "out of system resources";
-            break;
-        case ERROR_ACCESS_DENIED:
-            errtxt = "access denied";
-            break;
-        case ERROR_BAD_FORMAT:
-        case ERROR_INVALID_SEGMENT_NUMBER:
-        case ERROR_INVALID_ORDINAL:
-        case ERROR_INVALID_MODULETYPE:
-        case ERROR_INVALID_EXE_SIGNATURE:
-        case ERROR_EXE_MARKED_INVALID:
-        case ERROR_ITERATED_DATA_EXCEEDS_64K:
-        case ERROR_INVALID_MINALLOCSIZE:
-        case ERROR_INVALID_SEGDPL:
-        case ERROR_AUTODATASEG_EXCEEDS_64K:
-        case ERROR_RELOCSRC_CHAIN_EXCEEDS_SEGLIMIT:
-            errtxt = "invalid module format";
-            break;
-        case ERROR_INVALID_NAME:
-            errtxt = "filename doesn't match module name";
-            break;
-        case ERROR_SHARING_VIOLATION:
-        case ERROR_LOCK_VIOLATION:
-            errtxt = "sharing violation";
-            break;
-        case ERROR_INIT_ROUTINE_FAILED:
-            errtxt = "module initialization failed";
-            break;
-        default:
-            errtxt = "cause `%s', error code = %d";
-            break;
-    }
-    snprintf(dlerr, sizeof(dlerr), errtxt, &err, rc);
-    if (tmp)
-    {
-        if (tmp->name)
-            free(tmp->name);
-        free(tmp);
-    }
-    return 0;
-}
-
-/* return a pointer to the `symbol' in DLL */
-void *dlsym(void *handle, char *symbol)
-{
-    int rc = 0;
-    PFN addr;
-    char *errtxt;
-    int symord = 0;
-    DLLchain tmp = find_id(handle);
-
-    if (!tmp)
-        goto inv_handle;
-
-    if (*symbol == '#')
-        symord = atoi(symbol + 1);
-
-    switch (rc = DosQueryProcAddr(tmp->handle, symord, symbol, &addr))
-    {
-        case NO_ERROR:
-            return (void *)addr;
-        case ERROR_INVALID_HANDLE:
-inv_handle:
-            errtxt = "invalid module handle";
-            break;
-        case ERROR_PROC_NOT_FOUND:
-        case ERROR_INVALID_NAME:
-            errtxt = "no symbol `%s' in module";
-            break;
-        default:
-            errtxt = "symbol `%s', error code = %d";
-            break;
-    }
-    snprintf(dlerr, sizeof(dlerr), errtxt, symbol, rc);
-    return NULL;
-}
-
-/* free dynamically-linked library */
-int dlclose(void *handle)
-{
-    int rc;
-    DLLchain tmp = find_id(handle);
-
-    if (!tmp)
-        goto inv_handle;
-
-    switch (rc = DosFreeModule(tmp->handle))
-    {
-        case NO_ERROR:
-            free(tmp->name);
-            dlload = tmp->next;
-            free(tmp);
-            return 0;
-        case ERROR_INVALID_HANDLE:
-inv_handle:
-            strcpy(dlerr, "invalid module handle");
-            return -1;
-        case ERROR_INVALID_ACCESS:
-            strcpy(dlerr, "access denied");
-            return -1;
-        default:
-            return -1;
-    }
-}
-
-/* return a string describing last occurred dl error */
-char *dlerror()
-{
-    return dlerr;
-}
diff --git a/PC/os2emx/dlfcn.h b/PC/os2emx/dlfcn.h
deleted file mode 100644
index f73ae69..0000000
--- a/PC/os2emx/dlfcn.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -*- C -*- ***********************************************
-Copyright 1991-1995 by 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 names of Stichting Mathematisch
-Centrum or CWI or Corporation for National Research Initiatives or
-CNRI not be used in advertising or publicity pertaining to
-distribution of the software without specific, written prior
-permission.
-
-While CWI is the initial source for this software, a modified version
-is made available by the Corporation for National Research Initiatives
-(CNRI) at the Internet address ftp://ftp.python.org.
-
-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.
-
-******************************************************************/
-
-/* This library implements dlopen() - Unix-like dynamic linking
- * emulation functions for OS/2 using DosLoadModule() and company.
- */
-
-#ifndef _DLFCN_H
-#define _DLFCN_H
-
-/* load a dynamic-link library and return handle */
-void *dlopen(char *filename, int flags);
-
-/* return a pointer to the `symbol' in DLL */
-void *dlsym(void *handle, char *symbol);
-
-/* free dynamically-linked library */
-int dlclose(void *handle);
-
-/* return a string describing last occurred dl error */
-char *dlerror(void);
-
-#endif /* !_DLFCN_H */
diff --git a/PC/os2emx/dllentry.c b/PC/os2emx/dllentry.c
deleted file mode 100644
index 9ccca1c..0000000
--- a/PC/os2emx/dllentry.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * This is the entry point for the Python 2.3 core DLL.
- */
-
-#define NULL 0
-
-#define REF(s)  extern void s(); void *____ref_##s = &s;
-
-/* Make references to imported symbols to pull them from static library */
-REF(Py_Main);
-
-#include <signal.h>
-
-extern int _CRT_init(void);
-extern void _CRT_term(void);
-extern void __ctordtorInit(void);
-extern void __ctordtorTerm(void);
-
-unsigned long _DLL_InitTerm(unsigned long mod_handle, unsigned long flag)
-{
-    switch (flag)
-    {
-        case 0:
-            if (_CRT_init())
-                return 0;
-            __ctordtorInit();
-
-            /* Ignore fatal signals */
-            signal(SIGSEGV, SIG_IGN);
-            signal(SIGFPE, SIG_IGN);
-
-            return 1;
-
-        case 1:
-            __ctordtorTerm();
-            _CRT_term();
-            return 1;
-
-        default:
-            return 0;
-    }
-}
diff --git a/PC/os2emx/getpathp.c b/PC/os2emx/getpathp.c
deleted file mode 100644
index 0d73774..0000000
--- a/PC/os2emx/getpathp.c
+++ /dev/null
@@ -1,418 +0,0 @@
-
-/* Return the initial module search path. */
-/* This version used by OS/2+EMX */
-
-/* ----------------------------------------------------------------
-   PATH RULES FOR OS/2+EMX:
-   This describes how sys.path is formed on OS/2+EMX.  It describes the
-   functionality, not the implementation (ie, the order in which these
-   are actually fetched is different)
-
-   * Python always adds an empty entry at the start, which corresponds
-     to the current directory.
-
-   * If the PYTHONPATH env. var. exists, its entries are added next.
-
-   * We attempt to locate the "Python Home" - if the PYTHONHOME env var
-     is set, we believe it.  Otherwise, we use the path of our host .EXE's
-     to try and locate our "landmark" (lib\\os.py) and deduce our home.
-     - If we DO have a Python Home: The relevant sub-directories (Lib,
-       plat-win, etc) are based on the Python Home
-     - If we DO NOT have a Python Home, the core Python Path is
-       loaded from the registry.  This is the main PythonPath key,
-       and both HKLM and HKCU are combined to form the path)
-
-   * Iff - we can not locate the Python Home, and have not had a PYTHONPATH
-     specified (ie, we have _nothing_ we can assume is a good path), a
-     default path with relative entries is used (eg. .\Lib;.\plat-win, etc)
-
-
-  The end result of all this is:
-  * When running python.exe, or any other .exe in the main Python directory
-    (either an installed version, or directly from the PCbuild directory),
-    the core path is deduced.
-
-  * When Python is hosted in another exe (different directory, embedded via
-    COM, etc), the Python Home will not be deduced, so the core path from
-    the registry is used.  Other "application paths "in the registry are
-    always read.
-
-  * If Python can't find its home and there is no registry (eg, frozen
-    exe, some very strange installation setup) you get a path with
-    some default, but relative, paths.
-
-   ---------------------------------------------------------------- */
-
-
-#include "Python.h"
-#include "osdefs.h"
-
-#ifndef PYOS_OS2
-#error This file only compilable on OS/2
-#endif
-
-#define INCL_DOS
-#include <os2.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <string.h>
-
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-
-/* Search in some common locations for the associated Python libraries.
- *
- * Py_GetPath() tries to return a sensible Python module search path.
- *
- * The approach is an adaptation for Windows of the strategy used in
- * ../Modules/getpath.c; it uses the Windows Registry as one of its
- * information sources.
- */
-
-#ifndef LANDMARK
-#if defined(PYCC_GCC)
-#define LANDMARK "lib/os.py"
-#else
-#define LANDMARK "lib\\os.py"
-#endif
-#endif
-
-static char prefix[MAXPATHLEN+1];
-static char progpath[MAXPATHLEN+1];
-static char *module_search_path = NULL;
-
-
-static int
-is_sep(char ch) /* determine if "ch" is a separator character */
-{
-#ifdef ALTSEP
-    return ch == SEP || ch == ALTSEP;
-#else
-    return ch == SEP;
-#endif
-}
-
-/* assumes 'dir' null terminated in bounds.
- * Never writes beyond existing terminator.
- */
-static void
-reduce(char *dir)
-{
-    size_t i = strlen(dir);
-    while (i > 0 && !is_sep(dir[i]))
-        --i;
-    dir[i] = '\0';
-}
-
-static int
-exists(char *filename)
-{
-    struct stat buf;
-    return stat(filename, &buf) == 0;
-}
-
-/* Is module  (check for .pyc/.pyo too)
- * Assumes 'filename' MAXPATHLEN+1 bytes long -
- * may extend 'filename' by one character.
- */
-static int
-ismodule(char *filename)
-{
-    if (exists(filename))
-        return 1;
-
-    /* Check for the compiled version of prefix. */
-    if (strlen(filename) < MAXPATHLEN) {
-        strcat(filename, Py_OptimizeFlag ? "o" : "c");
-        if (exists(filename))
-            return 1;
-    }
-    return 0;
-}
-
-/* Add a path component, by appending stuff to buffer.
-   buffer must have at least MAXPATHLEN + 1 bytes allocated, and contain a
-   NUL-terminated string with no more than MAXPATHLEN characters (not counting
-   the trailing NUL).  It's a fatal error if it contains a string longer than
-   that (callers must be careful!).  If these requirements are met, it's
-   guaranteed that buffer will still be a NUL-terminated string with no more
-   than MAXPATHLEN characters at exit.  If stuff is too long, only as much of
-   stuff as fits will be appended.
-*/
-
-static void
-join(char *buffer, char *stuff)
-{
-    size_t n, k;
-    if (is_sep(stuff[0]))
-        n = 0;
-    else {
-        n = strlen(buffer);
-        if (n > 0 && !is_sep(buffer[n-1]) && n < MAXPATHLEN)
-            buffer[n++] = SEP;
-    }
-    if (n > MAXPATHLEN)
-        Py_FatalError("buffer overflow in getpathp.c's joinpath()");
-    k = strlen(stuff);
-    if (n + k > MAXPATHLEN)
-        k = MAXPATHLEN - n;
-    strncpy(buffer+n, stuff, k);
-    buffer[n+k] = '\0';
-}
-
-/* gotlandmark only called by search_for_prefix, which ensures
- * 'prefix' is null terminated in bounds.  join() ensures
- * 'landmark' can not overflow prefix if too long.
- */
-static int
-gotlandmark(char *landmark)
-{
-    int n, ok;
-
-    n = strlen(prefix);
-    join(prefix, landmark);
-    ok = ismodule(prefix);
-    prefix[n] = '\0';
-    return ok;
-}
-
-/* assumes argv0_path is MAXPATHLEN+1 bytes long, already \0 term'd.
- * assumption provided by only caller, calculate_path()
- */
-static int
-search_for_prefix(char *argv0_path, char *landmark)
-{
-    /* Search from argv0_path, until landmark is found */
-    strcpy(prefix, argv0_path);
-    do {
-        if (gotlandmark(landmark))
-            return 1;
-        reduce(prefix);
-    } while (prefix[0]);
-    return 0;
-}
-
-
-static void
-get_progpath(void)
-{
-    extern char *Py_GetProgramName(void);
-    char *path = getenv("PATH");
-    char *prog = Py_GetProgramName();
-
-    PPIB pib;
-    if ((DosGetInfoBlocks(NULL, &pib) == 0) &&
-        (DosQueryModuleName(pib->pib_hmte, sizeof(progpath), progpath) == 0))
-        return;
-
-    if (prog == NULL || *prog == '\0')
-        prog = "python";
-
-    /* If there is no slash in the argv0 path, then we have to
-     * assume python is on the user's $PATH, since there's no
-     * other way to find a directory to start the search from.  If
-     * $PATH isn't exported, you lose.
-     */
-#ifdef ALTSEP
-    if (strchr(prog, SEP) || strchr(prog, ALTSEP))
-#else
-    if (strchr(prog, SEP))
-#endif
-        strncpy(progpath, prog, MAXPATHLEN);
-    else if (path) {
-        while (1) {
-            char *delim = strchr(path, DELIM);
-
-            if (delim) {
-                size_t len = delim - path;
-                /* ensure we can't overwrite buffer */
-#if !defined(PYCC_GCC)
-                len = min(MAXPATHLEN,len);
-#else
-                len = MAXPATHLEN < len ? MAXPATHLEN : len;
-#endif
-                strncpy(progpath, path, len);
-                *(progpath + len) = '\0';
-            }
-            else
-                strncpy(progpath, path, MAXPATHLEN);
-
-            /* join() is safe for MAXPATHLEN+1 size buffer */
-            join(progpath, prog);
-            if (exists(progpath))
-                break;
-
-            if (!delim) {
-                progpath[0] = '\0';
-                break;
-            }
-            path = delim + 1;
-        }
-    }
-    else
-        progpath[0] = '\0';
-}
-
-static void
-calculate_path(void)
-{
-    char argv0_path[MAXPATHLEN+1];
-    char *buf;
-    size_t bufsz;
-    char *pythonhome = Py_GetPythonHome();
-    char *envpath = getenv("PYTHONPATH");
-    char zip_path[MAXPATHLEN+1];
-    size_t len;
-
-    get_progpath();
-    /* progpath guaranteed \0 terminated in MAXPATH+1 bytes. */
-    strcpy(argv0_path, progpath);
-    reduce(argv0_path);
-    if (pythonhome == NULL || *pythonhome == '\0') {
-        if (search_for_prefix(argv0_path, LANDMARK))
-            pythonhome = prefix;
-        else
-            pythonhome = NULL;
-    }
-    else
-        strncpy(prefix, pythonhome, MAXPATHLEN);
-
-    if (envpath && *envpath == '\0')
-        envpath = NULL;
-
-    /* Calculate zip archive path */
-    strncpy(zip_path, progpath, MAXPATHLEN);
-    zip_path[MAXPATHLEN] = '\0';
-    len = strlen(zip_path);
-    if (len > 4) {
-        zip_path[len-3] = 'z';  /* change ending to "zip" */
-        zip_path[len-2] = 'i';
-        zip_path[len-1] = 'p';
-    }
-    else {
-        zip_path[0] = 0;
-    }
-
-    /* We need to construct a path from the following parts.
-     * (1) the PYTHONPATH environment variable, if set;
-     * (2) the zip archive file path;
-     * (3) the PYTHONPATH config macro, with the leading "."
-     *     of each component replaced with pythonhome, if set;
-     * (4) the directory containing the executable (argv0_path).
-     * The length calculation calculates #3 first.
-     */
-
-    /* Calculate size of return buffer */
-    if (pythonhome != NULL) {
-        char *p;
-        bufsz = 1;
-        for (p = PYTHONPATH; *p; p++) {
-            if (*p == DELIM)
-                bufsz++; /* number of DELIM plus one */
-        }
-        bufsz *= strlen(pythonhome);
-    }
-    else
-        bufsz = 0;
-    bufsz += strlen(PYTHONPATH) + 1;
-    bufsz += strlen(argv0_path) + 1;
-    bufsz += strlen(zip_path) + 1;
-    if (envpath != NULL)
-        bufsz += strlen(envpath) + 1;
-
-    module_search_path = buf = malloc(bufsz);
-    if (buf == NULL) {
-        /* We can't exit, so print a warning and limp along */
-        fprintf(stderr, "Can't malloc dynamic PYTHONPATH.\n");
-        if (envpath) {
-            fprintf(stderr, "Using environment $PYTHONPATH.\n");
-            module_search_path = envpath;
-        }
-        else {
-            fprintf(stderr, "Using default static path.\n");
-            module_search_path = PYTHONPATH;
-        }
-        return;
-    }
-
-    if (envpath) {
-        strcpy(buf, envpath);
-        buf = strchr(buf, '\0');
-        *buf++ = DELIM;
-    }
-    if (zip_path[0]) {
-        strcpy(buf, zip_path);
-        buf = strchr(buf, '\0');
-        *buf++ = DELIM;
-    }
-
-    if (pythonhome == NULL) {
-        strcpy(buf, PYTHONPATH);
-        buf = strchr(buf, '\0');
-    }
-    else {
-        char *p = PYTHONPATH;
-        char *q;
-        size_t n;
-        for (;;) {
-            q = strchr(p, DELIM);
-            if (q == NULL)
-                n = strlen(p);
-            else
-                n = q-p;
-            if (p[0] == '.' && is_sep(p[1])) {
-                strcpy(buf, pythonhome);
-                buf = strchr(buf, '\0');
-                p++;
-                n--;
-            }
-            strncpy(buf, p, n);
-            buf += n;
-            if (q == NULL)
-                break;
-            *buf++ = DELIM;
-            p = q+1;
-        }
-    }
-    if (argv0_path) {
-        *buf++ = DELIM;
-        strcpy(buf, argv0_path);
-        buf = strchr(buf, '\0');
-    }
-    *buf = '\0';
-}
-
-
-/* External interface */
-
-char *
-Py_GetPath(void)
-{
-    if (!module_search_path)
-        calculate_path();
-    return module_search_path;
-}
-
-char *
-Py_GetPrefix(void)
-{
-    if (!module_search_path)
-        calculate_path();
-    return prefix;
-}
-
-char *
-Py_GetExecPrefix(void)
-{
-    return Py_GetPrefix();
-}
-
-char *
-Py_GetProgramFullPath(void)
-{
-    if (!module_search_path)
-        calculate_path();
-    return progpath;
-}
diff --git a/PC/os2emx/pyconfig.h b/PC/os2emx/pyconfig.h
deleted file mode 100644
index e56105a..0000000
--- a/PC/os2emx/pyconfig.h
+++ /dev/null
@@ -1,332 +0,0 @@
-#ifndef Py_CONFIG_H
-#define Py_CONFIG_H
-
-#error "PEP 11: OS/2 is now unsupported, code will be removed in Python 3.4"
-
-/* config.h.
- * At some time in the past, generated automatically by/from configure.
- * now maintained manually.
- */
-
-/* build environment */
-#define PLATFORM	"os2emx"
-#define COMPILER	"[EMX GCC " __VERSION__ "]"
-#define PYOS_OS2	1
-#define PYCC_GCC	1
-
-/* default location(s) */
-#ifndef PREFIX
-#define PREFIX		""
-#endif
-#ifndef PYTHONPATH
-#define PYTHONPATH	"./Lib;./Lib/plat-" PLATFORM \
-			";./Lib/lib-dynload;./Lib/site-packages"
-#endif
-
-/* Debugging */
-#ifndef Py_DEBUG
-/*#define Py_DEBUG 1*/
-#endif
-
-/* if building an extension or wrapper executable,
- * mark Python API symbols "extern" so that symbols
- * imported from the Python core DLL aren't duplicated.
- */
-#ifdef Py_BUILD_CORE
-#  define PyAPI_FUNC(RTYPE)	RTYPE
-#else
-#  define PyAPI_FUNC(RTYPE)	extern RTYPE
-#endif
-#define PyAPI_DATA(RTYPE)	extern RTYPE
-#define PyMODINIT_FUNC	void
-
-/* Use OS/2 flavour of threads */
-#define WITH_THREAD	1
-#define OS2_THREADS	1
-
-/* We want sockets */
-#define TCPIPV4		1
-#define USE_SOCKET	1
-#define socklen_t	int
-#define FD_SETSIZE	1024
-
-/* enable the Python object allocator */
-#define	WITH_PYMALLOC	1
-
-/* enable the GC module */
-#define WITH_CYCLE_GC	1
-
-/* Define if you want documentation strings in extension modules */
-#define WITH_DOC_STRINGS 1
-
-/* Unicode related */
-#define PY_UNICODE_TYPE	wchar_t
-#define Py_UNICODE_SIZE SIZEOF_SHORT
-
-/* EMX defines ssize_t */
-#define HAVE_SSIZE_T	1
-
-/* system capabilities */
-#define HAVE_TTYNAME	1
-#define HAVE_WAIT	1
-#define HAVE_GETEGID    1
-#define HAVE_GETEUID    1
-#define HAVE_GETGID     1
-#define HAVE_GETPPID    1
-#define HAVE_GETUID     1
-#define HAVE_OPENDIR    1
-#define HAVE_PIPE       1
-#define HAVE_POPEN      1
-#define HAVE_SYSTEM	1
-#define HAVE_TTYNAME	1
-#define HAVE_DYNAMIC_LOADING	1
-
-/* if port of GDBM installed, it includes NDBM emulation */
-#define HAVE_NDBM_H 1
-
-/* need this for spawnv code in posixmodule (cloned from WIN32 def'n) */
-typedef long intptr_t;
-
-/* we don't have tm_zone but do have the external array tzname */
-#define HAVE_TZNAME 1
-
-/* Define as the return type of signal handlers (int or void). */
-#define RETSIGTYPE void
-
-/* Define if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Define if you can safely include both <sys/time.h> and <time.h>. */
-#define TIME_WITH_SYS_TIME 1
-
-/* Define this if you have the type long long. */
-#define HAVE_LONG_LONG 1
-
-/* Define if your compiler supports function prototypes. */
-#define HAVE_PROTOTYPES 1
-
-/* Define if your compiler supports variable length function prototypes
- * (e.g. void fprintf(FILE *, char *, ...);) *and* <stdarg.h>.
- */
-#define HAVE_STDARG_PROTOTYPES 1
-
-/* Define if malloc(0) returns a NULL pointer. */
-#define MALLOC_ZERO_RETURNS_NULL 1
-
-/* Define to force use of thread-safe errno, h_errno, and other functions. */
-#define _REENTRANT 1
-
-/* Define if you can safely include both <sys/select.h> and <sys/time.h>
- * (which you can't on SCO ODT 3.0).
- */
-#define SYS_SELECT_WITH_SYS_TIME 1
-
-/* The number of bytes in an off_t. */
-#define SIZEOF_OFF_T 4
-
-/* The number of bytes in an time_t. */
-#define SIZEOF_TIME_T 4
-
-/* The number of bytes in a short. */
-#define SIZEOF_SHORT 2
-
-/* The number of bytes in a int. */
-#define SIZEOF_INT 4
-
-/* The number of bytes in a long. */
-#define SIZEOF_LONG 4
-
-/* The number of bytes in a long long. */
-#define SIZEOF_LONG_LONG 8
-
-/* The number of bytes in a void *. */
-#define SIZEOF_VOID_P 4
-
-/* The number of bytes in a size_t. */
-#define SIZEOF_SIZE_T 4
-
-/* Define if you have the alarm function. */
-#define HAVE_ALARM 1
-
-/* Define if you have the clock function. */
-#define HAVE_CLOCK 1
-
-/* Define if you have the dup2 function. */
-#define HAVE_DUP2 1
-
-/* Define if you have the execv function. */
-#define HAVE_EXECV 1
-
-/* Define if you have the spawnv function. */
-#define HAVE_SPAWNV 1
-
-/* Define if you have the flock function. */
-#define HAVE_FLOCK 1
-
-/* Define if you have the fork function. */
-#define HAVE_FORK 1
-
-/* Define if you have the fsync function. */
-#define HAVE_FSYNC 1
-
-/* Define if you have the ftime function. */
-#define HAVE_FTIME 1
-
-/* Define if you have the ftruncate function. */
-#define HAVE_FTRUNCATE 1
-
-/* Define if you have the getcwd function. */
-#define HAVE_GETCWD 1
-
-/* Define if you have the getpeername function. */
-#define HAVE_GETPEERNAME 1
-
-/* Define if you have the getpgrp function. */
-#define HAVE_GETPGRP 1
-
-/* Define if you have the getpid function. */
-#define HAVE_GETPID 1
-
-/* Define if you have the getpwent function. */
-#define HAVE_GETPWENT 1
-
-/* Define if you have the gettimeofday function. */
-#define HAVE_GETTIMEOFDAY 1
-
-/* Define if you have the getwd function. */
-#define HAVE_GETWD 1
-
-/* Define if you have the hypot function. */
-#define HAVE_HYPOT 1
-
-/* Define if you have the kill function. */
-#define HAVE_KILL 1
-
-/* Define if you have the memmove function. */
-#define HAVE_MEMMOVE 1
-
-/* Define if you have the mktime function. */
-#define HAVE_MKTIME 1
-
-/* Define if you have the pause function. */
-#define HAVE_PAUSE 1
-
-/* Define if you have the putenv function. */
-#define HAVE_PUTENV 1
-
-/* Define if you have the select function. */
-#define HAVE_SELECT 1
-
-/* Define if you have the setgid function. */
-#define HAVE_SETGID 1
-
-/* Define if you have the setlocale function. */
-#define HAVE_SETLOCALE 1
-
-/* Define if you have the setpgid function. */
-#define HAVE_SETPGID 1
-
-/* Define if you have the setuid function. */
-#define HAVE_SETUID 1
-
-/* Define if you have the setvbuf function. */
-#define HAVE_SETVBUF 1
-
-/* Define if you have the sigaction function. */
-#define HAVE_SIGACTION 1
-
-/* Define if you have the strerror function. */
-#define HAVE_STRERROR 1
-
-/* Define if you have the strftime function. */
-#define HAVE_STRFTIME 1
-
-/* Define if you have the tcgetpgrp function. */
-#define HAVE_TCGETPGRP 1
-
-/* Define if you have the tcsetpgrp function. */
-#define HAVE_TCSETPGRP 1
-
-/* Define if you have the tmpfile function.  */
-#define HAVE_TMPFILE 1
-
-/* Define if you have the times function. */
-#define HAVE_TIMES 1
-
-/* Define if you have the truncate function. */
-#define HAVE_TRUNCATE 1
-
-/* Define if you have the uname function. */
-#define HAVE_UNAME 1
-
-/* Define if you have the waitpid function. */
-#define HAVE_WAITPID 1
-
-/* Define if you have the <conio.h> header file. */
-#undef HAVE_CONIO_H
-
-/* Define if you have the <direct.h> header file. */
-#undef HAVE_DIRECT_H
-
-/* Define if you have the <dirent.h> header file. */
-#define HAVE_DIRENT_H 1
-
-/* Define if you have the <errno.h> header file. */
-#define HAVE_ERRNO_H 1
-
-/* Define if you have the <fcntl.h> header file. */
-#define HAVE_FCNTL_H 1
-
-/* Define if you have the <io.h> header file. */
-#undef HAVE_IO_H
-
-/* Define if you have the <ncurses.h> header file. */
-#define HAVE_NCURSES_H 1
-
-/* Define to 1 if you have the <process.h> header file. */
-#define HAVE_PROCESS_H 1
-
-/* Define if you have the <signal.h> header file. */
-#define HAVE_SIGNAL_H 1
-
-/* Define if you have the <sys/file.h> header file. */
-#define HAVE_SYS_FILE_H 1
-
-/* Define if you have the <sys/param.h> header file. */
-#define HAVE_SYS_PARAM_H 1
-
-/* Define if you have the <sys/select.h> header file. */
-#define HAVE_SYS_SELECT_H 1
-
-/* Define if you have the <sys/stat.h> header file. */
-#define HAVE_SYS_STAT_H 1
-
-/* Define if you have the <sys/time.h> header file. */
-#define HAVE_SYS_TIME_H 1
-
-/* Define if you have the <sys/times.h> header file. */
-#define HAVE_SYS_TIMES_H 1
-
-/* Define if you have the <sys/types.h> header file. */
-#define HAVE_SYS_TYPES_H 1
-
-/* Define if you have the <sys/un.h> header file. */
-#define HAVE_SYS_UN_H 1
-
-/* Define if you have the <sys/utsname.h> header file. */
-#define HAVE_SYS_UTSNAME_H 1
-
-/* Define if you have the <sys/wait.h> header file. */
-#define HAVE_SYS_WAIT_H 1
-
-/* Define if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Define if you have the <utime.h> header file. */
-#define HAVE_UTIME_H 1
-
-/* EMX has an snprintf(). */
-#define HAVE_SNPRINTF 1
-
-#endif /* !Py_CONFIG_H */
-
diff --git a/PC/os2emx/python33.def b/PC/os2emx/python33.def
deleted file mode 100644
index 256726b..0000000
--- a/PC/os2emx/python33.def
+++ /dev/null
@@ -1,1314 +0,0 @@
-LIBRARY python33 INITINSTANCE TERMINSTANCE 
-DESCRIPTION "Python 2.6 Core DLL" 
-PROTMODE 
-DATA MULTIPLE NONSHARED 
-EXPORTS 
-
-; From python33_s.lib(config)
-  "_PyImport_Inittab"
-
-; From python33_s.lib(dlfcn)
-;  "dlopen"
-;  "dlsym"
-;  "dlclose"
-;  "dlerror"
-
-; From python33_s.lib(getpathp)
-  "Py_GetProgramFullPath"
-  "Py_GetPrefix"
-  "Py_GetExecPrefix"
-  "Py_GetPath"
-
-; From python33_s.lib(getbuildinfo)
-  "Py_GetBuildInfo"
-  "_Py_svnversion"
-
-; From python33_s.lib(main)
-  "Py_Main"
-  "Py_GetArgcArgv"
-
-; From python33_s.lib(acceler)
-  "PyGrammar_AddAccelerators"
-  "PyGrammar_RemoveAccelerators"
-
-; From python33_s.lib(grammar1)
-  "PyGrammar_FindDFA"
-  "PyGrammar_LabelRepr"
-
-; From python33_s.lib(listnode)
-  "PyNode_ListTree"
-
-; From python33_s.lib(node)
-  "PyNode_New"
-  "PyNode_AddChild"
-  "PyNode_Free"
-
-; From python33_s.lib(parser)
-  "PyParser_AddToken"
-  "PyParser_New"
-  "PyParser_Delete"
-
-; From python33_s.lib(parsetok)
-  "PyParser_ParseString"
-  "PyParser_ParseStringFlagsFilename"
-  "PyParser_ParseFile"
-  "PyParser_ParseFileFlags"
-  "PyParser_ParseStringFlags"
-
-; From python33_s.lib(bitset)
-  "_Py_newbitset"
-  "_Py_delbitset"
-  "_Py_addbit"
-  "_Py_samebitset"
-  "_Py_mergebitset"
-
-; From python33_s.lib(metagrammar)
-  "_Py_meta_grammar"
-  "Py_meta_grammar"
-
-; From python33_s.lib(tokenizer)
-  "PyToken_OneChar"
-  "PyToken_TwoChars"
-  "PyToken_ThreeChars"
-  "PyTokenizer_FromString"
-  "PyTokenizer_Free"
-  "PyTokenizer_FromFile"
-  "PyTokenizer_Get"
-  "_PyParser_TokenNames"
-
-; From python33_s.lib(myreadline)
-  "_PyOS_ReadlineTState"
-  "PyOS_ReadlineFunctionPointer"
-  "PyOS_StdioReadline"
-  "PyOS_Readline"
-  "PyOS_InputHook"
-
-; From python33_s.lib(abstract)
-  "_PyObject_LengthHint"
-  "PyMapping_Size"
-  "PyObject_CallMethod"
-  "PyObject_GetItem"
-  "PySequence_GetItem"
-  "PyObject_SetItem"
-  "PySequence_SetItem"
-  "PyObject_DelItem"
-  "PySequence_DelItem"
-  "PyNumber_Multiply"
-  "PyNumber_InPlaceAdd"
-  "PyNumber_InPlaceMultiply"
-  "PyNumber_Int"
-  "PyNumber_Long"
-  "PyNumber_Float"
-  "PySequence_Concat"
-  "PySequence_Repeat"
-  "PySequence_InPlaceConcat"
-  "PySequence_InPlaceRepeat"
-  "PySequence_GetSlice"
-  "PySequence_SetSlice"
-  "PySequence_Tuple"
-  "PyObject_GetIter"
-  "PyIter_Next"
-  "PySequence_Fast"
-  "_PySequence_IterSearch"
-  "PyObject_CallFunction"
-  "_PyObject_CallFunction_SizeT"
-  "_PyObject_CallMethod_SizeT"
-  "PyObject_CallMethodObjArgs"
-  "PyObject_CallFunctionObjArgs"
-  "PyObject_Cmp"
-  "PyObject_Call"
-  "PyObject_CallObject"
-  "PyObject_Type"
-  "PyObject_Size"
-  "PyObject_Length"
-  "PyObject_DelItemString"
-  "PyObject_AsCharBuffer"
-  "PyObject_CheckReadBuffer"
-  "PyObject_AsReadBuffer"
-  "PyObject_AsWriteBuffer"
-  "PyNumber_Check"
-  "PyNumber_Add"
-  "PyNumber_Subtract"
-  "PyNumber_Divide"
-  "PyNumber_FloorDivide"
-  "PyNumber_TrueDivide"
-  "PyNumber_Remainder"
-  "PyNumber_Divmod"
-  "PyNumber_Power"
-  "PyNumber_Negative"
-  "PyNumber_Positive"
-  "PyNumber_Absolute"
-  "PyNumber_Invert"
-  "PyNumber_Lshift"
-  "PyNumber_Rshift"
-  "PyNumber_And"
-  "PyNumber_Xor"
-  "PyNumber_Or"
-  "PyNumber_Index"
-  "PyNumber_InPlaceSubtract"
-  "PyNumber_InPlaceDivide"
-  "PyNumber_InPlaceFloorDivide"
-  "PyNumber_InPlaceTrueDivide"
-  "PyNumber_InPlaceRemainder"
-  "PyNumber_InPlacePower"
-  "PyNumber_InPlaceLshift"
-  "PyNumber_InPlaceRshift"
-  "PyNumber_InPlaceAnd"
-  "PyNumber_InPlaceXor"
-  "PyNumber_InPlaceOr"
-  "PySequence_Check"
-  "PySequence_Size"
-  "PySequence_Length"
-  "PySequence_DelSlice"
-  "PySequence_List"
-  "PySequence_Count"
-  "PySequence_Contains"
-  "PySequence_In"
-  "PySequence_Index"
-  "PyMapping_Check"
-  "PyMapping_Length"
-  "PyMapping_HasKeyString"
-  "PyMapping_HasKey"
-  "PyMapping_GetItemString"
-  "PyMapping_SetItemString"
-  "PyObject_IsInstance"
-  "PyObject_IsSubclass"
-
-; From python33_s.lib(boolobject)
-  "PyBool_FromLong"
-  "PyBool_Type"
-  "_Py_ZeroStruct"
-  "_Py_TrueStruct"
-
-; From python33_s.lib(bufferobject)
-  "PyBuffer_FromObject"
-  "PyBuffer_FromReadWriteObject"
-  "PyBuffer_FromMemory"
-  "PyBuffer_FromReadWriteMemory"
-  "PyBuffer_New"
-  "PyBuffer_Type"
-
-; From python33_s.lib(cellobject)
-  "PyCell_New"
-  "PyCell_Get"
-  "PyCell_Set"
-  "PyCell_Type"
-
-; From python33_s.lib(classobject)
-  "PyClass_New"
-  "PyClass_IsSubclass"
-  "PyInstance_New"
-  "PyInstance_NewRaw"
-  "PyMethod_New"
-  "PyMethod_Function"
-  "PyMethod_Self"
-  "PyMethod_Class"
-  "_PyInstance_Lookup"
-  "PyMethod_Fini"
-  "PyClass_Type"
-  "PyInstance_Type"
-  "PyMethod_Type"
-
-; From python33_s.lib(capsule)
-  "PyCapsule_GetContext"
-  "PyCapsule_GetDestructor"
-  "PyCapsule_GetName"
-  "PyCapsule_GetPointer"
-  "PyCapsule_Import"
-  "PyCapsule_IsValid"
-  "PyCapsule_New"
-  "PyCapsule_SetContext"
-  "PyCapsule_SetDestructor"
-  "PyCapsule_SetName"
-  "PyCapsule_SetPointer"
-
-; From python33_s.lib(cobject)
-  "PyCObject_FromVoidPtr"
-  "PyCObject_FromVoidPtrAndDesc"
-  "PyCObject_AsVoidPtr"
-  "PyCObject_GetDesc"
-  "PyCObject_Import"
-  "PyCObject_SetVoidPtr"
-  "PyCObject_Type"
-
-; From python33_s.lib(codeobject)
-  "PyCode_New"
-  "PyCode_Addr2Line"
-  "PyCode_CheckLineNumber"
-  "PyCode_Type"
-
-; From python33_s.lib(complexobject)
-  "_Py_c_pow"
-  "_Py_c_sum"
-  "_Py_c_diff"
-  "_Py_c_neg"
-  "_Py_c_prod"
-  "_Py_c_quot"
-  "PyComplex_FromCComplex"
-  "PyComplex_FromDoubles"
-  "PyComplex_RealAsDouble"
-  "PyComplex_ImagAsDouble"
-  "PyComplex_AsCComplex"
-  "PyComplex_Type"
-
-; From python33_s.lib(descrobject)
-  "PyWrapper_New"
-  "PyDescr_NewMethod"
-  "PyDescr_NewClassMethod"
-  "PyDescr_NewMember"
-  "PyDescr_NewGetSet"
-  "PyDescr_NewWrapper"
-  "PyDictProxy_New"
-  "PyWrapperDescr_Type"
-  "PyProperty_Type"
-
-; From python33_s.lib(dictobject)
-  "PyDict_New"
-  "PyDict_GetItem"
-  "PyDict_SetItem"
-  "PyDict_DelItem"
-  "PyDict_Clear"
-  "PyDict_MergeFromSeq2"
-  "PyDict_Merge"
-  "PyDict_Keys"
-  "PyDict_Values"
-  "PyDict_Contains"
-  "PyDict_Next"
-  "PyDict_Items"
-  "PyDict_Size"
-  "PyDict_Copy"
-  "PyDict_Update"
-  "PyDict_GetItemString"
-  "PyDict_SetItemString"
-  "PyDict_DelItemString"
-  "PyDict_Type"
-  "PyDictIterKey_Type"
-  "PyDictIterValue_Type"
-  "PyDictIterItem_Type"
-
-; From python33_s.lib(enumobject)
-  "PyEnum_Type"
-  "PyReversed_Type"
-
-; From python33_s.lib(fileobject)
-  "PyFile_FromString"
-  "Py_UniversalNewlineFread"
-  "PyFile_GetLine"
-  "PyFile_SoftSpace"
-  "PyFile_WriteObject"
-  "PyFile_WriteString"
-  "PyObject_AsFileDescriptor"
-  "Py_UniversalNewlineFgets"
-  "PyFile_SetBufSize"
-  "PyFile_SetEncoding"
-  "PyFile_FromFile"
-  "PyFile_AsFile"
-  "PyFile_Name"
-  "PyFile_Type"
-
-; From python33_s.lib(floatobject)
-  "PyFloat_FromString"
-  "PyFloat_AsDouble"
-  "PyFloat_Fini"
-  "_PyFloat_Pack4"
-  "_PyFloat_Pack8"
-  "_PyFloat_Unpack4"
-  "_PyFloat_Unpack8"
-  "PyFloat_FromDouble"
-  "PyFloat_AsReprString"
-  "PyFloat_AsString"
-  "_PyFloat_Init"
-  "PyFloat_AsStringEx"
-  "PyFloat_Type"
-
-; From python33_s.lib(frameobject)
-  "PyFrame_New"
-  "PyFrame_FastToLocals"
-  "PyFrame_LocalsToFast"
-  "_PyFrame_Init"
-  "PyFrame_Fini"
-  "PyFrame_BlockSetup"
-  "PyFrame_BlockPop"
-  "PyFrame_Type"
-
-; From python33_s.lib(funcobject)
-  "PyFunction_New"
-  "PyFunction_GetCode"
-  "PyFunction_GetGlobals"
-  "PyFunction_GetModule"
-  "PyFunction_GetDefaults"
-  "PyFunction_SetDefaults"
-  "PyFunction_GetClosure"
-  "PyFunction_SetClosure"
-  "PyClassMethod_New"
-  "PyStaticMethod_New"
-  "PyFunction_Type"
-  "PyClassMethod_Type"
-  "PyStaticMethod_Type"
-
-; From python33_s.lib(genobject)
-  "PyGen_New"
-  "PyGen_NeedsFinalizing"
-  "PyGen_Type"
-
-; From python33_s.lib(intobject)
-  "PyInt_AsLong"
-  "PyInt_AsUnsignedLongMask"
-  "PyInt_AsUnsignedLongLongMask"
-  "PyInt_FromString"
-  "PyInt_AsSsize_t"
-  "PyInt_Fini"
-  "PyInt_FromUnicode"
-  "PyInt_FromLong"
-  "PyInt_FromSize_t"
-  "PyInt_FromSsize_t"
-  "PyInt_GetMax"
-  "_PyInt_Init"
-  "PyInt_Type"
-
-; From python33_s.lib(iterobject)
-  "PySeqIter_New"
-  "PyCallIter_New"
-  "PySeqIter_Type"
-  "PyCallIter_Type"
-
-; From python33_s.lib(listobject)
-  "PyList_New"
-  "PyList_Append"
-  "PyList_Size"
-  "PyList_GetItem"
-  "PyList_SetItem"
-  "PyList_Insert"
-  "PyList_GetSlice"
-  "PyList_SetSlice"
-  "PyList_Sort"
-  "PyList_Reverse"
-  "PyList_AsTuple"
-  "_PyList_Extend"
-  "PyList_Fini"
-  "PyList_Type"
-  "PyListIter_Type"
-  "PyListRevIter_Type"
-
-; From python33_s.lib(longobject)
-  "PyLong_FromDouble"
-  "PyLong_AsLong"
-  "_PyLong_AsSsize_t"
-  "PyLong_AsUnsignedLong"
-  "_PyLong_FromByteArray"
-  "_PyLong_AsByteArray"
-  "PyLong_AsDouble"
-  "PyLong_FromLongLong"
-  "PyLong_AsLongLong"
-  "PyLong_FromString"
-  "PyLong_FromLong"
-  "PyLong_FromUnsignedLong"
-  "PyLong_AsUnsignedLongMask"
-  "_PyLong_FromSize_t"
-  "_PyLong_FromSsize_t"
-  "_PyLong_AsScaledDouble"
-  "PyLong_FromVoidPtr"
-  "PyLong_AsVoidPtr"
-  "PyLong_FromUnsignedLongLong"
-  "PyLong_AsUnsignedLongLong"
-  "PyLong_AsUnsignedLongLongMask"
-  "PyLong_FromUnicode"
-  "_PyLong_Sign"
-  "_PyLong_NumBits"
-  "_PyLong_New"
-  "_PyLong_Copy"
-  "PyLong_Type"
-  "_PyLong_DigitValue"
-
-; From python33_s.lib(methodobject)
-  "PyCFunction_Call"
-  "Py_FindMethodInChain"
-  "PyCFunction_GetFunction"
-  "PyCFunction_GetSelf"
-  "PyCFunction_GetFlags"
-  "Py_FindMethod"
-  "PyCFunction_NewEx"
-  "PyCFunction_Fini"
-  "PyCFunction_New"
-  "PyCFunction_Type"
-
-; From python33_s.lib(moduleobject)
-  "PyModule_New"
-  "_PyModule_Clear"
-  "PyModule_GetDict"
-  "PyModule_GetName"
-  "PyModule_GetFilename"
-  "PyModule_Type"
-
-; From python33_s.lib(object)
-  "Py_DivisionWarningFlag"
-  "PyObject_Str"
-  "PyObject_Repr"
-  "_PyObject_Str"
-  "PyObject_Unicode"
-  "PyObject_GetAttr"
-  "PyObject_IsTrue"
-  "PyNumber_CoerceEx"
-  "PyObject_Compare"
-  "PyObject_RichCompare"
-  "_Py_HashDouble"
-  "PyObject_Hash"
-  "PyObject_SetAttr"
-  "PyObject_GenericGetAttr"
-  "PyObject_GenericSetAttr"
-  "PyCallable_Check"
-  "PyObject_Dir"
-  "PyMem_Malloc"
-  "PyMem_Realloc"
-  "PyMem_Free"
-  "PyObject_Print"
-  "_PyObject_Dump"
-  "PyObject_RichCompareBool"
-  "PyObject_GetAttrString"
-  "PyObject_SetAttrString"
-  "PyObject_HasAttrString"
-  "PyObject_HasAttr"
-  "_PyObject_GetDictPtr"
-  "PyObject_SelfIter"
-  "PyObject_Not"
-  "PyNumber_Coerce"
-  "Py_ReprEnter"
-  "Py_ReprLeave"
-  "_Py_HashPointer"
-  "Py_IncRef"
-  "Py_DecRef"
-  "_PyTrash_deposit_object"
-  "_PyTrash_destroy_chain"
-  "PyObject_Init"
-  "PyObject_InitVar"
-  "_PyObject_New"
-  "_PyObject_NewVar"
-  "_PyObject_Del"
-  "_Py_ReadyTypes"
-  "_Py_SwappedOp"
-  "_Py_NotImplementedStruct"
-  "_Py_NoneStruct"
-  "_Py_cobject_hack"
-  "_Py_abstract_hack"
-  "_PyTrash_delete_nesting"
-  "_PyTrash_delete_later"
-
-; From python33_s.lib(obmalloc)
-  "PyObject_Malloc"
-  "PyObject_Free"
-  "PyObject_Realloc"
-
-; From python33_s.lib(rangeobject)
-  "PyRange_Type"
-
-; From python33_s.lib(setobject)
-  "PySet_Pop"
-  "PySet_New"
-  "PyFrozenSet_New"
-  "PySet_Size"
-  "PySet_Clear"
-  "PySet_Contains"
-  "PySet_Discard"
-  "PySet_Add"
-  "_PySet_Next"
-  "_PySet_Update"
-  "PySet_Fini"
-  "PySet_Type"
-  "PyFrozenSet_Type"
-
-; From python33_s.lib(sliceobject)
-  "_PySlice_FromIndices"
-  "PySlice_GetIndices"
-  "PySlice_GetIndicesEx"
-  "PySlice_New"
-  "_Py_EllipsisObject"
-  "PySlice_Type"
-
-; From python33_s.lib(stringobject)
-  "PyString_FromStringAndSize"
-  "PyString_InternInPlace"
-  "PyString_FromString"
-  "PyString_FromFormatV"
-  "PyString_AsString"
-  "_PyString_Resize"
-  "PyString_FromFormat"
-  "PyString_AsDecodedString"
-  "PyString_AsEncodedString"
-  "PyString_DecodeEscape"
-  "PyString_Repr"
-  "PyString_AsStringAndSize"
-  "_PyString_FormatLong"
-  "PyString_Format"
-  "_Py_ReleaseInternedStrings"
-  "PyString_Size"
-  "PyString_Concat"
-  "PyString_ConcatAndDel"
-  "_PyString_Eq"
-  "PyString_InternImmortal"
-  "PyString_InternFromString"
-  "_PyString_Join"
-  "PyString_Decode"
-  "PyString_Encode"
-  "PyString_AsEncodedObject"
-  "PyString_AsDecodedObject"
-  "PyString_Fini"
-  "PyString_Type"
-  "PyBaseString_Type"
-
-; From python33_s.lib(structseq)
-  "PyStructSequence_InitType"
-  "PyStructSequence_New"
-  "PyStructSequence_UnnamedField"
-
-; From python33_s.lib(tupleobject)
-  "PyTuple_New"
-  "PyTuple_Pack"
-  "_PyTuple_Resize"
-  "PyTuple_Size"
-  "PyTuple_GetItem"
-  "PyTuple_SetItem"
-  "PyTuple_GetSlice"
-  "PyTuple_Fini"
-  "PyTuple_Type"
-  "PyTupleIter_Type"
-
-; From python33_s.lib(typeobject)
-  "PyType_IsSubtype"
-  "_PyType_Lookup"
-  "PyType_Ready"
-  "PyType_GenericAlloc"
-  "_PyObject_SlotCompare"
-  "PyType_GenericNew"
-  "PyType_Type"
-  "PyBaseObject_Type"
-  "PySuper_Type"
-
-; From python33_s.lib(unicodeobject)
-  "PyUnicodeUCS2_Resize"
-  "PyUnicodeUCS2_FromOrdinal"
-  "PyUnicodeUCS2_FromObject"
-  "PyUnicodeUCS2_FromEncodedObject"
-  "PyUnicodeUCS2_Decode"
-  "PyUnicodeUCS2_GetDefaultEncoding"
-  "PyUnicodeUCS2_DecodeUTF8"
-  "PyUnicodeUCS2_DecodeLatin1"
-  "PyUnicodeUCS2_DecodeASCII"
-  "PyUnicodeUCS2_AsEncodedString"
-  "PyUnicodeUCS2_AsUTF8String"
-  "PyUnicodeUCS2_AsLatin1String"
-  "PyUnicodeUCS2_AsASCIIString"
-  "PyUnicode_DecodeUTF7"
-  "PyUnicode_EncodeUTF7"
-  "PyUnicodeUCS2_DecodeUTF8Stateful"
-  "PyUnicodeUCS2_EncodeUTF8"
-  "PyUnicodeUCS2_DecodeUTF16Stateful"
-  "PyUnicodeUCS2_AsUTF16String"
-  "PyUnicodeUCS2_DecodeUnicodeEscape"
-  "PyUnicodeUCS2_DecodeRawUnicodeEscape"
-  "PyUnicodeUCS2_EncodeRawUnicodeEscape"
-  "_PyUnicode_DecodeUnicodeInternal"
-  "PyUnicodeUCS2_DecodeCharmap"
-  "PyUnicode_BuildEncodingMap"
-  "PyUnicodeUCS2_EncodeCharmap"
-  "PyUnicodeUCS2_TranslateCharmap"
-  "PyUnicodeUCS2_EncodeDecimal"
-  "PyUnicodeUCS2_Count"
-  "PyUnicodeUCS2_Find"
-  "PyUnicodeUCS2_Join"
-  "PyUnicodeUCS2_Splitlines"
-  "PyUnicodeUCS2_Compare"
-  "PyUnicodeUCS2_Contains"
-  "PyUnicodeUCS2_Concat"
-  "_PyUnicode_XStrip"
-  "PyUnicodeUCS2_Replace"
-  "PyUnicodeUCS2_Split"
-  "PyUnicodeUCS2_RSplit"
-  "PyUnicodeUCS2_Format"
-  "_PyUnicodeUCS2_Init"
-  "_PyUnicodeUCS2_Fini"
-  "PyUnicodeUCS2_FromUnicode"
-  "PyUnicodeUCS2_AsUnicode"
-  "PyUnicodeUCS2_GetSize"
-  "PyUnicodeUCS2_GetMax"
-  "_PyUnicodeUCS2_AsDefaultEncodedString"
-  "PyUnicodeUCS2_SetDefaultEncoding"
-  "PyUnicodeUCS2_Encode"
-  "PyUnicodeUCS2_AsEncodedObject"
-  "PyUnicodeUCS2_DecodeUTF16"
-  "PyUnicodeUCS2_EncodeUTF16"
-  "PyUnicodeUCS2_AsUnicodeEscapeString"
-  "PyUnicodeUCS2_EncodeUnicodeEscape"
-  "PyUnicodeUCS2_AsRawUnicodeEscapeString"
-  "PyUnicodeUCS2_EncodeLatin1"
-  "PyUnicodeUCS2_EncodeASCII"
-  "PyUnicodeUCS2_AsCharmapString"
-  "PyUnicodeUCS2_Partition"
-  "PyUnicodeUCS2_RPartition"
-  "PyUnicodeUCS2_Translate"
-  "PyUnicodeUCS2_Tailmatch"
-  "PyUnicode_AsDecodedObject"
-  "PyUnicode_Type"
-
-; From python33_s.lib(unicodectype)
-  "_PyUnicode_TypeRecords"
-  "_PyUnicodeUCS2_ToNumeric"
-  "_PyUnicodeUCS2_IsLowercase"
-  "_PyUnicodeUCS2_IsUppercase"
-  "_PyUnicodeUCS2_IsTitlecase"
-  "_PyUnicodeUCS2_IsWhitespace"
-  "_PyUnicodeUCS2_IsLinebreak"
-  "_PyUnicodeUCS2_ToLowercase"
-  "_PyUnicodeUCS2_ToUppercase"
-  "_PyUnicodeUCS2_ToTitlecase"
-  "_PyUnicodeUCS2_ToDecimalDigit"
-  "_PyUnicodeUCS2_ToDigit"
-  "_PyUnicodeUCS2_IsDecimalDigit"
-  "_PyUnicodeUCS2_IsDigit"
-  "_PyUnicodeUCS2_IsNumeric"
-  "_PyUnicodeUCS2_IsAlpha"
-
-; From python33_s.lib(weakrefobject)
-  "PyWeakref_NewRef"
-  "PyWeakref_NewProxy"
-  "PyObject_ClearWeakRefs"
-  "PyWeakref_GetObject"
-  "_PyWeakref_GetWeakrefCount"
-  "_PyWeakref_ClearRef"
-  "_PyWeakref_RefType"
-  "_PyWeakref_ProxyType"
-  "_PyWeakref_CallableProxyType"
-
-; From python33_s.lib(Python-ast)
-;  "init_ast"
-  "Module"
-  "Interactive"
-  "Expression"
-  "Suite"
-  "FunctionDef"
-  "ClassDef"
-  "Return"
-  "Delete"
-  "Assign"
-  "AugAssign"
-  "Print"
-  "For"
-  "While"
-  "If"
-  "With"
-  "Raise"
-  "TryExcept"
-  "TryFinally"
-  "Assert"
-  "Import"
-  "ImportFrom"
-  "Exec"
-  "Global"
-  "Expr"
-  "Pass"
-  "Break"
-  "Continue"
-  "BoolOp"
-  "BinOp"
-  "UnaryOp"
-  "Lambda"
-  "IfExp"
-  "Dict"
-  "ListComp"
-  "GeneratorExp"
-  "Yield"
-  "Compare"
-  "Call"
-  "Repr"
-  "Num"
-  "Str"
-  "Attribute"
-  "Subscript"
-  "Name"
-  "List"
-  "Tuple"
-  "Ellipsis"
-  "Slice"
-  "ExtSlice"
-  "Index"
-  "comprehension"
-  "excepthandler"
-  "arguments"
-  "keyword"
-  "alias"
-  "PyAST_mod2obj"
-
-; From python33_s.lib(asdl)
-  "asdl_seq_new"
-  "asdl_int_seq_new"
-
-; From python33_s.lib(ast)
-  "PyAST_FromNode"
-
-; From python33_s.lib(bltinmodule)
-  "_PyBuiltin_Init"
-  "Py_FileSystemDefaultEncoding"
-
-; From python33_s.lib(exceptions)
-  "PyUnicodeEncodeError_GetStart"
-  "PyUnicodeDecodeError_GetStart"
-  "PyUnicodeEncodeError_GetEnd"
-  "PyUnicodeDecodeError_GetEnd"
-  "_PyExc_Init"
-  "PyUnicodeDecodeError_Create"
-  "PyUnicodeEncodeError_Create"
-  "PyUnicodeTranslateError_Create"
-  "PyUnicodeEncodeError_GetEncoding"
-  "PyUnicodeDecodeError_GetEncoding"
-  "PyUnicodeEncodeError_GetObject"
-  "PyUnicodeDecodeError_GetObject"
-  "PyUnicodeTranslateError_GetObject"
-  "PyUnicodeTranslateError_GetStart"
-  "PyUnicodeEncodeError_SetStart"
-  "PyUnicodeDecodeError_SetStart"
-  "PyUnicodeTranslateError_SetStart"
-  "PyUnicodeTranslateError_GetEnd"
-  "PyUnicodeEncodeError_SetEnd"
-  "PyUnicodeDecodeError_SetEnd"
-  "PyUnicodeTranslateError_SetEnd"
-  "PyUnicodeEncodeError_GetReason"
-  "PyUnicodeDecodeError_GetReason"
-  "PyUnicodeTranslateError_GetReason"
-  "PyUnicodeEncodeError_SetReason"
-  "PyUnicodeDecodeError_SetReason"
-  "PyUnicodeTranslateError_SetReason"
-  "_PyExc_Fini"
-  "PyExc_BaseException"
-  "PyExc_Exception"
-  "PyExc_StandardError"
-  "PyExc_TypeError"
-  "PyExc_StopIteration"
-  "PyExc_GeneratorExit"
-  "PyExc_SystemExit"
-  "PyExc_KeyboardInterrupt"
-  "PyExc_ImportError"
-  "PyExc_EnvironmentError"
-  "PyExc_IOError"
-  "PyExc_OSError"
-  "PyExc_EOFError"
-  "PyExc_RuntimeError"
-  "PyExc_NotImplementedError"
-  "PyExc_NameError"
-  "PyExc_UnboundLocalError"
-  "PyExc_AttributeError"
-  "PyExc_IndexError"
-  "PyExc_SyntaxError"
-  "PyExc_IndentationError"
-  "PyExc_TabError"
-  "PyExc_LookupError"
-  "PyExc_KeyError"
-  "PyExc_ValueError"
-  "PyExc_UnicodeError"
-  "PyExc_UnicodeEncodeError"
-  "PyExc_UnicodeDecodeError"
-  "PyExc_UnicodeTranslateError"
-  "PyExc_AssertionError"
-  "PyExc_ArithmeticError"
-  "PyExc_FloatingPointError"
-  "PyExc_OverflowError"
-  "PyExc_ZeroDivisionError"
-  "PyExc_SystemError"
-  "PyExc_ReferenceError"
-  "PyExc_MemoryError"
-  "PyExc_Warning"
-  "PyExc_UserWarning"
-  "PyExc_DeprecationWarning"
-  "PyExc_PendingDeprecationWarning"
-  "PyExc_SyntaxWarning"
-  "PyExc_RuntimeWarning"
-  "PyExc_FutureWarning"
-  "PyExc_ImportWarning"
-  "PyExc_MemoryErrorInst"
-
-; From python33_s.lib(ceval)
-  "PyEval_EvalFrameEx"
-  "PyEval_CallObjectWithKeywords"
-  "PyEval_EvalCodeEx"
-  "PyEval_GetFrame"
-  "PyEval_CallObject"
-  "PyEval_SetProfile"
-  "PyEval_SetTrace"
-  "PyEval_GetBuiltins"
-  "PyEval_GetGlobals"
-  "PyEval_GetLocals"
-  "PyEval_GetRestricted"
-  "PyEval_MergeCompilerFlags"
-  "Py_FlushLine"
-  "Py_AddPendingCall"
-  "Py_MakePendingCalls"
-  "Py_SetRecursionLimit"
-  "Py_GetRecursionLimit"
-  "_Py_CheckRecursiveCall"
-  "PyEval_GetFuncName"
-  "PyEval_GetFuncDesc"
-  "PyEval_GetCallStats"
-  "PyEval_EvalFrame"
-  "PyEval_SaveThread"
-  "PyEval_RestoreThread"
-  "PyEval_ThreadsInitialized"
-  "PyEval_InitThreads"
-  "PyEval_AcquireLock"
-  "PyEval_ReleaseLock"
-  "PyEval_AcquireThread"
-  "PyEval_ReleaseThread"
-  "PyEval_ReInitThreads"
-  "_PyEval_SliceIndex"
-  "PyEval_EvalCode"
-  "_PyEval_CallTracing"
-  "_Py_CheckRecursionLimit"
-  "_Py_CheckInterval"
-  "_Py_Ticker"
-
-; From python33_s.lib(compile)
-  "_Py_Mangle"
-  "PyAST_Compile"
-  "PyNode_Compile"
-  "Py_OptimizeFlag"
-
-; From python33_s.lib(codecs)
-  "_PyCodec_Lookup"
-  "PyCodec_Encode"
-  "PyCodec_Decode"
-  "PyCodec_IgnoreErrors"
-  "PyCodec_ReplaceErrors"
-  "PyCodec_XMLCharRefReplaceErrors"
-  "PyCodec_BackslashReplaceErrors"
-  "PyCodec_Register"
-  "PyCodec_Encoder"
-  "PyCodec_Decoder"
-  "PyCodec_IncrementalEncoder"
-  "PyCodec_IncrementalDecoder"
-  "PyCodec_StreamReader"
-  "PyCodec_StreamWriter"
-  "PyCodec_RegisterError"
-  "PyCodec_LookupError"
-  "PyCodec_StrictErrors"
-
-; From python33_s.lib(errors)
-  "PyErr_SetNone"
-  "PyErr_SetString"
-  "PyErr_GivenExceptionMatches"
-  "PyErr_NormalizeException"
-  "PyErr_Fetch"
-  "PyErr_Clear"
-  "PyErr_NoMemory"
-  "PyErr_SetFromErrnoWithFilenameObject"
-  "PyErr_Format"
-  "PyErr_NewException"
-  "PyErr_WriteUnraisable"
-  "PyErr_SyntaxLocation"
-  "PyErr_ProgramText"
-  "PyErr_SetObject"
-  "PyErr_Occurred"
-  "PyErr_Restore"
-  "PyErr_ExceptionMatches"
-  "PyErr_BadArgument"
-  "PyErr_SetFromErrno"
-  "PyErr_SetFromErrnoWithFilename"
-  "PyErr_BadInternalCall"
-  "_PyErr_BadInternalCall"
-  "PyErr_Warn"
-  "PyErr_WarnExplicit"
-
-; From python33_s.lib(frozen)
-  "PyImport_FrozenModules"
-
-; From python33_s.lib(frozenmain)
-  "Py_FrozenMain"
-
-; From python33_s.lib(future)
-  "PyFuture_FromAST"
-
-; From python33_s.lib(getargs)
-  "PyArg_Parse"
-  "_PyArg_Parse_SizeT"
-  "PyArg_ParseTuple"
-  "_PyArg_ParseTuple_SizeT"
-  "PyArg_ParseTupleAndKeywords"
-  "_PyArg_ParseTupleAndKeywords_SizeT"
-  "PyArg_UnpackTuple"
-  "_PyArg_NoKeywords"
-  "PyArg_VaParse"
-  "PyArg_VaParseTupleAndKeywords"
-  "_PyArg_VaParse_SizeT"
-  "_PyArg_VaParseTupleAndKeywords_SizeT"
-
-; From python33_s.lib(getcompiler)
-  "Py_GetCompiler"
-
-; From python33_s.lib(getcopyright)
-  "Py_GetCopyright"
-
-; From python33_s.lib(getplatform)
-  "Py_GetPlatform"
-
-; From python33_s.lib(getversion)
-  "Py_GetVersion"
-
-; From python33_s.lib(graminit)
-  "_PyParser_Grammar"
-
-; From python33_s.lib(import)
-  "_PyImport_Init"
-  "_PyImportHooks_Init"
-  "PyImport_ImportModule"
-  "PyImport_Cleanup"
-  "_PyImport_FixupExtension"
-  "PyImport_AddModule"
-  "PyImport_ExecCodeModuleEx"
-  "PyImport_ImportFrozenModule"
-  "PyImport_ImportModuleEx"
-  "PyImport_ImportModuleLevel"
-  "PyImport_ReloadModule"
-  "PyImport_Import"
-;  "initimp"
-  "_PyImport_Fini"
-  "PyImport_GetMagicNumber"
-  "PyImport_ExecCodeModule"
-  "PyImport_GetModuleDict"
-  "_PyImport_FindModule"
-  "_PyImport_IsScript"
-  "_PyImport_ReInitLock"
-  "_PyImport_FindExtension"
-  "PyImport_AppendInittab"
-  "PyImport_ExtendInittab"
-  "PyImport_Inittab"
-  "_PyImport_Filetab"
-
-; From python33_s.lib(importdl)
-  "_PyImport_LoadDynamicModule"
-
-; From python33_s.lib(marshal)
-  "PyMarshal_ReadLongFromFile"
-  "PyMarshal_WriteObjectToString"
-  "PyMarshal_WriteLongToFile"
-  "PyMarshal_WriteObjectToFile"
-  "PyMarshal_ReadShortFromFile"
-  "PyMarshal_ReadObjectFromFile"
-  "PyMarshal_ReadLastObjectFromFile"
-  "PyMarshal_ReadObjectFromString"
-  "PyMarshal_Init"
-
-; From python33_s.lib(modsupport)
-  "Py_InitModule4"
-  "Py_BuildValue"
-  "_Py_BuildValue_SizeT"
-  "PyEval_CallFunction"
-  "PyEval_CallMethod"
-  "_Py_VaBuildValue_SizeT"
-  "Py_VaBuildValue"
-  "PyModule_AddObject"
-  "PyModule_AddIntConstant"
-  "PyModule_AddStringConstant"
-  "_Py_PackageContext"
-
-; From python33_s.lib(mysnprintf)
-  "PyOS_snprintf"
-  "PyOS_vsnprintf"
-
-; From python33_s.lib(mystrtoul)
-  "PyOS_strtoul"
-  "PyOS_strtol"
-
-; From python33_s.lib(pyarena)
-  "PyArena_New"
-  "PyArena_Free"
-  "PyArena_Malloc"
-  "PyArena_AddPyObject"
-
-; From python33_s.lib(pyfpe)
-  "PyFPE_dummy"
-
-; From python33_s.lib(pystate)
-  "PyInterpreterState_Clear"
-  "PyThreadState_Clear"
-  "_PyThread_CurrentFrames"
-  "PyGILState_Ensure"
-  "PyGILState_Release"
-  "PyInterpreterState_New"
-  "PyInterpreterState_Delete"
-  "PyThreadState_Delete"
-  "PyThreadState_New"
-  "PyThreadState_DeleteCurrent"
-  "PyThreadState_Get"
-  "PyThreadState_Swap"
-  "PyThreadState_GetDict"
-  "PyThreadState_SetAsyncExc"
-  "PyGILState_GetThisThreadState"
-  "PyInterpreterState_Head"
-  "PyInterpreterState_Next"
-  "PyInterpreterState_ThreadHead"
-  "PyThreadState_Next"
-  "_PyGILState_Init"
-  "_PyGILState_Fini"
-  "_PyThreadState_Current"
-  "_PyThreadState_GetFrame"
-
-; From python33_s.lib(pythonrun)
-  "Py_IgnoreEnvironmentFlag"
-  "Py_DebugFlag"
-  "Py_VerboseFlag"
-  "Py_NoSiteFlag"
-  "Py_InteractiveFlag"
-  "Py_FrozenFlag"
-  "Py_InitializeEx"
-  "Py_FatalError"
-  "Py_NewInterpreter"
-  "PyErr_Print"
-  "PyRun_InteractiveOneFlags"
-  "PyParser_ASTFromFile"
-  "PyRun_SimpleFileExFlags"
-  "PyRun_FileExFlags"
-  "Py_Exit"
-  "PyErr_PrintEx"
-  "PyErr_Display"
-  "Py_SetProgramName"
-  "Py_GetProgramName"
-  "Py_SetPythonHome"
-  "Py_GetPythonHome"
-  "Py_Initialize"
-  "Py_Finalize"
-  "Py_IsInitialized"
-  "Py_EndInterpreter"
-  "PyRun_AnyFileFlags"
-  "Py_FdIsInteractive"
-  "PyRun_InteractiveLoopFlags"
-  "PyRun_AnyFileExFlags"
-  "PyRun_SimpleStringFlags"
-  "PyRun_StringFlags"
-  "PyParser_ASTFromString"
-  "PyParser_SimpleParseStringFlags"
-  "PyParser_SimpleParseFileFlags"
-  "Py_CompileStringFlags"
-  "Py_SymtableString"
-  "Py_AtExit"
-  "PyOS_getsig"
-  "PyOS_setsig"
-  "PyParser_SetError"
-  "PyModule_GetWarningsModule"
-  "PyParser_SimpleParseStringFlagsFilename"
-  "PyParser_SimpleParseStringFilename"
-  "PyParser_SimpleParseFile"
-  "PyParser_SimpleParseString"
-  "PyRun_AnyFile"
-  "PyRun_AnyFileEx"
-  "PyRun_File"
-  "PyRun_FileEx"
-  "PyRun_FileFlags"
-  "PyRun_SimpleFile"
-  "PyRun_SimpleFileEx"
-  "PyRun_String"
-  "PyRun_SimpleString"
-  "Py_CompileString"
-  "PyRun_InteractiveOne"
-  "PyRun_InteractiveLoop"
-  "Py_UseClassExceptionsFlag"
-  "Py_UnicodeFlag"
-  "_Py_QnewFlag"
-
-; From python33_s.lib(structmember)
-  "PyMember_Get"
-  "PyMember_GetOne"
-  "PyMember_SetOne"
-  "PyMember_Set"
-
-; From python33_s.lib(symtable)
-  "PySymtable_Build"
-  "PySymtable_Free"
-  "PyST_GetScope"
-  "PySymtable_Lookup"
-  "PySTEntry_Type"
-
-; From python33_s.lib(sysmodule)
-  "_PySys_Init"
-  "PySys_WriteStderr"
-  "PySys_SetPath"
-  "PySys_SetArgv"
-  "PySys_WriteStdout"
-  "Py_SubversionRevision"
-  "Py_SubversionShortBranch"
-  "PySys_GetObject"
-  "PySys_SetObject"
-  "PySys_GetFile"
-  "PySys_ResetWarnOptions"
-  "PySys_AddWarnOption"
-
-; From python33_s.lib(traceback)
-  "PyTraceBack_Here"
-  "PyTraceBack_Print"
-  "PyTraceBack_Type"
-
-; From python33_s.lib(getopt)
-  "_PyOS_GetOpt"
-  "_PyOS_opterr"
-  "_PyOS_optind"
-  "_PyOS_optarg"
-
-; From python33_s.lib(dynload_shlib)
-  "_PyImport_DynLoadFiletab"
-  "_PyImport_GetDynLoadFunc"
-
-; From python33_s.lib(thread)
-  "PyThread_delete_key_value"
-  "PyThread_init_thread"
-  "PyThread_start_new_thread"
-  "PyThread_exit_thread"
-  "PyThread_get_thread_ident"
-  "PyThread_allocate_lock"
-  "PyThread_free_lock"
-  "PyThread_acquire_lock"
-  "PyThread_release_lock"
-  "PyThread_get_stacksize"
-  "PyThread_set_stacksize"
-  "PyThread_create_key"
-  "PyThread_delete_key"
-  "PyThread_set_key_value"
-  "PyThread_get_key_value"
-
-; From python33_s.lib(gcmodule)
-;  "initgc"
-  "_PyObject_GC_New"
-  "_PyObject_GC_NewVar"
-  "PyGC_Collect"
-  "_PyObject_GC_Resize"
-  "_PyObject_GC_Malloc"
-  "PyObject_GC_Track"
-  "PyObject_GC_UnTrack"
-  "PyObject_GC_Del"
-  "_PyGC_Dump"
-  "_PyObject_GC_Track"
-  "_PyObject_GC_UnTrack"
-  "_PyObject_GC_Del"
-  "_PyGC_generation0"
-
-; From python33_s.lib(signalmodule)
-;  "initsignal"
-  "PyErr_CheckSignals"
-  "PyErr_SetInterrupt"
-  "PyOS_FiniInterrupts"
-  "PyOS_InterruptOccurred"
-  "PyOS_InitInterrupts"
-  "PyOS_AfterFork"
-
-; From python33_s.lib(posixmodule)
-;  "initos2"
-
-; From python33_s.lib(_threadmodule)
-;  "init_thread"
-
-; From python33_s.lib(arraymodule)
-;  "initarray"
-;  "array_methods"
-
-; From python33_s.lib(binascii)
-;  "initbinascii"
-
-; From python33_s.lib(cmathmodule)
-;  "initcmath"
-
-; From python33_s.lib(_codecsmodule)
-;  "init_codecs"
-
-; From python33_s.lib(collectionsmodule)
-;  "initcollections"
-  "dequeiter_type"
-  "dequereviter_type"
-
-; From python33_s.lib(cPickle)
-;  "initcPickle"
-;  "fast_save_leave"
-
-; From python33_s.lib(_csv)
-;  "init_csv"
-
-; From python33_s.lib(datetimemodule)
-;  "initdatetime"
-
-; From python33_s.lib(dlmodule)
-;  "initdl"
-
-; From python33_s.lib(errnomodule)
-;  "initerrno"
-
-; From python33_s.lib(fcntlmodule)
-;  "initfcntl"
-
-; From python33_s.lib(_functoolsmodule)
-;  "init_functools"
-
-; From python33_s.lib(_heapqmodule)
-;  "init_heapq"
-
-; From python33_s.lib(imageop)
-;  "initimageop"
-
-; From python33_s.lib(itertoolsmodule)
-;  "inititertools"
-
-; From python33_s.lib(_localemodule)
-;  "init_locale"
-
-; From python33_s.lib(mathmodule)
-;  "initmath"
-
-; From python33_s.lib(md5)
-  "md5_finish"
-  "md5_init"
-  "md5_append"
-
-; From python33_s.lib(md5module)
-;  "init_md5"
-
-; From python33_s.lib(operator)
-;  "initoperator"
-
-; From python33_s.lib(_randommodule)
-;  "init_random"
-
-; From python33_s.lib(rgbimgmodule)
-;  "initrgbimg"
-
-; From python33_s.lib(shamodule)
-;  "init_sha"
-
-; From python33_s.lib(sha256module)
-;  "init_sha256"
-
-; From python33_s.lib(sha512module)
-;  "init_sha512"
-
-; From python33_s.lib(_sre)
-;  "init_sre"
-
-; From python33_s.lib(stropmodule)
-;  "initstrop"
-
-; From python33_s.lib(_struct)
-;  "init_struct"
-
-; From python33_s.lib(symtablemodule)
-;  "init_symtable"
-
-; From python33_s.lib(termios)
-;  "inittermios"
-
-; From python33_s.lib(timemodule)
-;  "inittime"
-  "_PyTime_DoubleToTimet"
-;  "inittimezone"
-
-; From python33_s.lib(timingmodule)
-;  "inittiming"
-
-; From python33_s.lib(_weakref)
-;  "init_weakref"
-
-; From python33_s.lib(xxsubtype)
-;  "initxxsubtype"
-
-; From python33_s.lib(zipimport)
-;  "initzipimport"
diff --git a/PC/os2emx/pythonpm.c b/PC/os2emx/pythonpm.c
deleted file mode 100644
index ba47f4b..0000000
--- a/PC/os2emx/pythonpm.c
+++ /dev/null
@@ -1,124 +0,0 @@
-/* OS/2 PM main program - creates a hidden window, and starts Python
- * interpreter in a separate thread, so that Python scripts can be
- * run in PM process space without a console Window.  The interpreter
- * is incorporated by linking in the Python DLL.
- *
- * As it stands, I don't think this is adequate for supporting Python
- * GUI modules, as the Python thread doesn't have its own message
- * queue - which is required of threads that want to create/use
- * PM windows.
- *
- * This code owes a lot to "OS/2 Presentation Manager Programming", by
- * Charles Petzold.
- *
- * Andrew MacIntyre <andymac@bullseye.apana.org.au>, August 2001.
- * Released under the terms of the Python 2.1.1 licence - see the LICENCE
- * file in the Python v2.1.1 (or later) source distribution.
- * Copyright assigned to the Python Software Foundation, 2001.
- */
-
-#define INCL_DOS
-#define INCL_WIN
-#include <os2.h>
-#include <process.h>
-
-#include "Python.h"
-
-/* use structure to pass command line to Python thread */
-typedef struct
-{
-    int argc;
-    char **argv;
-    HWND Frame;
-    int running;
-} arglist;
-
-/* make this a global to simplify access.
- * it should only be set from the Python thread, or by the code that
- * initiates the Python thread when the thread cannot be created.
- */
-int PythonRC;
-
-extern DL_EXPORT(int) Py_Main(int, char **);
-void PythonThread(void *);
-
-int
-main(int argc, char **argv)
-{
-    ULONG FrameFlags = FCF_TITLEBAR |
-                       FCF_SYSMENU |
-                       FCF_SIZEBORDER |
-                       FCF_HIDEBUTTON |
-                       FCF_SHELLPOSITION |
-                       FCF_TASKLIST;
-    HAB hab;
-    HMQ hmq;
-    HWND Client;
-    QMSG qmsg;
-    arglist args;
-    int python_tid;
-
-    /* init PM and create message queue */
-    hab = WinInitialize(0);
-    hmq = WinCreateMsgQueue(hab, 0);
-
-    /* create a (hidden) Window to house the window procedure */
-    args.Frame = WinCreateStdWindow(HWND_DESKTOP,
-                                    0,
-                                    &FrameFlags,
-                                    NULL,
-                                    "PythonPM",
-                                    0L,
-                                    0,
-                                    0,
-                                    &Client);
-
-    /* run Python interpreter in a thread */
-    args.argc = argc;
-    args.argv = argv;
-    args.running = 0;
-    if (-1 == (python_tid = _beginthread(PythonThread, NULL, 1024 * 1024, &args)))
-    {
-        /* couldn't start thread */
-        WinAlarm(HWND_DESKTOP, WA_ERROR);
-        PythonRC = 1;
-    }
-    else
-    {
-        /* process PM messages, until Python exits */
-        while (WinGetMsg(hab, &qmsg, NULLHANDLE, 0, 0))
-            WinDispatchMsg(hab, &qmsg);
-        if (args.running > 0)
-            DosKillThread(python_tid);
-    }
-
-    /* destroy window, shutdown message queue and PM */
-    WinDestroyWindow(args.Frame);
-    WinDestroyMsgQueue(hmq);
-    WinTerminate(hab);
-
-    return PythonRC;
-}
-
-void PythonThread(void *argl)
-{
-    HAB hab;
-    arglist *args;
-
-    /* PM initialisation */
-    hab = WinInitialize(0);
-
-    /* start Python */
-    args = (arglist *)argl;
-    args->running = 1;
-    PythonRC = Py_Main(args->argc, args->argv);
-
-    /* enter a critical section and send the termination message */
-    DosEnterCritSec();
-    args->running = 0;
-    WinPostMsg(args->Frame, WM_QUIT, NULL, NULL);
-
-    /* shutdown PM and terminate thread */
-    WinTerminate(hab);
-    _endthread();
-}
diff --git a/PC/os2vacpp/_tkinter.def b/PC/os2vacpp/_tkinter.def
deleted file mode 100644
index 49dab8d..0000000
--- a/PC/os2vacpp/_tkinter.def
+++ /dev/null
@@ -1,8 +0,0 @@
-LIBRARY        _TKINTER INITINSTANCE TERMINSTANCE
-DESCRIPTION    'Python Extension DLL v1.0 for Access to Tcl/Tk Environment'
-PROTMODE
-DATA           MULTIPLE NONSHARED
-
-EXPORTS
-               init_tkinter
-
diff --git a/PC/os2vacpp/config.c b/PC/os2vacpp/config.c
deleted file mode 100644
index b26b521..0000000
--- a/PC/os2vacpp/config.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/* -*- C -*- ***********************************************
-Copyright (c) 2000, BeOpen.com.
-Copyright (c) 1995-2000, Corporation for National Research Initiatives.
-Copyright (c) 1990-1995, Stichting Mathematisch Centrum.
-All rights reserved.
-
-See the file "Misc/COPYRIGHT" for information on usage and
-redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
-******************************************************************/
-
-/* Module configuration */
-
-/* This file contains the table of built-in modules.
-   See init_builtin() in import.c. */
-
-#include "Python.h"
-
-extern void initarray(void);
-extern void initaudioop(void);
-extern void initbinascii(void);
-extern void initcmath(void);
-extern void initerrno(void);
-extern void initimageop(void);
-extern void initmath(void);
-extern void initmd5(void);
-extern void initnt(void);
-extern void initos2(void);
-extern void initoperator(void);
-extern void initposix(void);
-extern void initrgbimg(void);
-extern void initsignal(void);
-extern void initselect(void);
-extern void init_socket(void);
-extern void initstruct(void);
-extern void inittime(void);
-extern void init_thread(void);
-extern void initpcre(void);
-#ifdef WIN32
-extern void initmsvcrt(void);
-#endif
-
-/* -- ADDMODULE MARKER 1 -- */
-
-extern void PyMarshal_Init(void);
-extern void initimp(void);
-
-struct _inittab _PyImport_Inittab[] = {
-
-        {"array", initarray},
-#ifdef M_I386
-        {"audioop", initaudioop},
-#endif
-        {"binascii", initbinascii},
-        {"cmath", initcmath},
-        {"errno", initerrno},
-//        {"imageop", initimageop},
-        {"math", initmath},
-        {"md5", initmd5},
-#if defined(MS_WINDOWS) || defined(__BORLANDC__) || defined(__WATCOMC__)
-        {"nt", initnt}, /* Use the NT os functions, not posix */
-#else
-#if defined(PYOS_OS2)
-        {"os2", initos2},
-#else
-        {"posix", initposix},
-#endif
-#endif
-        {"operator", initoperator},
-//        {"rgbimg", initrgbimg},
-        {"signal", initsignal},
-#ifdef USE_SOCKET
-        {"_socket", init_socket},
-        {"select", initselect},
-#endif
-        {"struct", initstruct},
-        {"time", inittime},
-#ifdef WITH_THREAD
-        {"_thread", init_thread},
-#endif
-        {"pcre", initpcre},
-#ifdef WIN32
-        {"msvcrt", initmsvcrt},
-#endif
-
-/* -- ADDMODULE MARKER 2 -- */
-
-        /* This module "lives in" with marshal.c */
-        {"marshal", PyMarshal_Init},
-
-        /* This lives it with import.c */
-        {"_imp", initimp},
-
-        /* These entries are here for sys.builtin_module_names */
-        {"builtins", NULL},
-        {"sys", NULL},
-
-        /* Sentinel */
-        {0, 0}
-};
diff --git a/PC/os2vacpp/getpathp.c b/PC/os2vacpp/getpathp.c
deleted file mode 100644
index 5bc2827..0000000
--- a/PC/os2vacpp/getpathp.c
+++ /dev/null
@@ -1,482 +0,0 @@
-
-/* Return the initial module search path. */
-/* Used by DOS, OS/2, Windows 3.1.  Works on NT too. */
-
-#include "Python.h"
-#include "osdefs.h"
-
-#ifdef MS_WIN32
-#include <windows.h>
-extern BOOL PyWin_IsWin32s(void);
-#endif
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <string.h>
-
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-
-/* Search in some common locations for the associated Python libraries.
- *
- * Two directories must be found, the platform independent directory
- * (prefix), containing the common .py and .pyc files, and the platform
- * dependent directory (exec_prefix), containing the shared library
- * modules.  Note that prefix and exec_prefix can be the same directory,
- * but for some installations, they are different.
- *
- * Py_GetPath() tries to return a sensible Python module search path.
- *
- * First, we look to see if the executable is in a subdirectory of
- * the Python build directory.  We calculate the full path of the
- * directory containing the executable as progpath.  We work backwards
- * along progpath and look for $dir/Modules/Setup.in, a distinctive
- * landmark.  If found, we use $dir/Lib as $root.  The returned
- * Python path is the compiled #define PYTHONPATH with all the initial
- * "./lib" replaced by $root.
- *
- * Otherwise, if there is a PYTHONPATH environment variable, we return that.
- *
- * Otherwise we try to find $progpath/lib/os.py, and if found, then
- * root is $progpath/lib, and we return Python path as compiled PYTHONPATH
- * with all "./lib" replaced by $root (as above).
- *
- */
-
-#ifndef LANDMARK
-#define LANDMARK "lib\\os.py"
-#endif
-
-static char prefix[MAXPATHLEN+1];
-static char exec_prefix[MAXPATHLEN+1];
-static char progpath[MAXPATHLEN+1];
-static char *module_search_path = NULL;
-
-
-static int
-is_sep(char ch) /* determine if "ch" is a separator character */
-{
-#ifdef ALTSEP
-    return ch == SEP || ch == ALTSEP;
-#else
-    return ch == SEP;
-#endif
-}
-
-
-static void
-reduce(char *dir)
-{
-    int i = strlen(dir);
-    while (i > 0 && !is_sep(dir[i]))
-        --i;
-    dir[i] = '\0';
-}
-
-
-static int
-exists(char *filename)
-{
-    struct stat buf;
-    return stat(filename, &buf) == 0;
-}
-
-
-/* Add a path component, by appending stuff to buffer.
-   buffer must have at least MAXPATHLEN + 1 bytes allocated, and contain a
-   NUL-terminated string with no more than MAXPATHLEN characters (not counting
-   the trailing NUL).  It's a fatal error if it contains a string longer than
-   that (callers must be careful!).  If these requirements are met, it's
-   guaranteed that buffer will still be a NUL-terminated string with no more
-   than MAXPATHLEN characters at exit.  If stuff is too long, only as much of
-   stuff as fits will be appended.
-*/
-static void
-join(char *buffer, char *stuff)
-{
-    int n, k;
-    if (is_sep(stuff[0]))
-        n = 0;
-    else {
-        n = strlen(buffer);
-        if (n > 0 && !is_sep(buffer[n-1]) && n < MAXPATHLEN)
-            buffer[n++] = SEP;
-    }
-    if (n > MAXPATHLEN)
-        Py_FatalError("buffer overflow in getpathp.c's joinpath()");
-    k = strlen(stuff);
-    if (n + k > MAXPATHLEN)
-        k = MAXPATHLEN - n;
-    strncpy(buffer+n, stuff, k);
-    buffer[n+k] = '\0';
-}
-
-
-static int
-search_for_prefix(char *argv0_path, char *landmark)
-{
-    int n;
-
-    /* Search from argv0_path, until root is found */
-    strcpy(prefix, argv0_path);
-    do {
-        n = strlen(prefix);
-        join(prefix, landmark);
-        if (exists(prefix)) {
-            prefix[n] = '\0';
-            return 1;
-        }
-        prefix[n] = '\0';
-        reduce(prefix);
-    } while (prefix[0]);
-    return 0;
-}
-
-#ifdef MS_WIN32
-#include "malloc.h" // for alloca - see comments below!
-extern const char *PyWin_DLLVersionString; // a string loaded from the DLL at startup.
-
-
-/* Load a PYTHONPATH value from the registry.
-   Load from either HKEY_LOCAL_MACHINE or HKEY_CURRENT_USER.
-
-   Returns NULL, or a pointer that should be freed.
-*/
-
-static char *
-getpythonregpath(HKEY keyBase, BOOL bWin32s)
-{
-    HKEY newKey = 0;
-    DWORD nameSize = 0;
-    DWORD dataSize = 0;
-    DWORD numEntries = 0;
-    LONG rc;
-    char *retval = NULL;
-    char *dataBuf;
-    const char keyPrefix[] = "Software\\Python\\PythonCore\\";
-    const char keySuffix[] = "\\PythonPath";
-    int versionLen;
-    char *keyBuf;
-
-    // Tried to use sysget("winver") but here is too early :-(
-    versionLen = strlen(PyWin_DLLVersionString);
-    // alloca == no free required, but memory only local to fn.
-    // also no heap fragmentation!  Am I being silly?
-    keyBuf = alloca(sizeof(keyPrefix)-1 + versionLen + sizeof(keySuffix)); // chars only, plus 1 NULL.
-    // lots of constants here for the compiler to optimize away :-)
-    memcpy(keyBuf, keyPrefix, sizeof(keyPrefix)-1);
-    memcpy(keyBuf+sizeof(keyPrefix)-1, PyWin_DLLVersionString, versionLen);
-    memcpy(keyBuf+sizeof(keyPrefix)-1+versionLen, keySuffix, sizeof(keySuffix)); // NULL comes with this one!
-
-    rc=RegOpenKey(keyBase,
-                  keyBuf,
-                  &newKey);
-    if (rc==ERROR_SUCCESS) {
-        RegQueryInfoKey(newKey, NULL, NULL, NULL, NULL, NULL, NULL,
-                        &numEntries, &nameSize, &dataSize, NULL, NULL);
-    }
-    if (bWin32s && numEntries==0 && dataSize==0) {
-        /* must hardcode for Win32s */
-        numEntries = 1;
-        dataSize = 511;
-    }
-    if (numEntries) {
-        /* Loop over all subkeys. */
-        /* Win32s doesnt know how many subkeys, so we do
-           it twice */
-        char keyBuf[MAX_PATH+1];
-        int index = 0;
-        int off = 0;
-        for(index=0;;index++) {
-            long reqdSize = 0;
-            DWORD rc = RegEnumKey(newKey,
-                                  index, keyBuf, MAX_PATH+1);
-            if (rc) break;
-            rc = RegQueryValue(newKey, keyBuf, NULL, &reqdSize);
-            if (rc) break;
-            if (bWin32s && reqdSize==0) reqdSize = 512;
-            dataSize += reqdSize + 1; /* 1 for the ";" */
-        }
-        dataBuf = malloc(dataSize+1);
-        if (dataBuf==NULL)
-            return NULL; /* pretty serious?  Raise error? */
-        /* Now loop over, grabbing the paths.
-           Subkeys before main library */
-        for(index=0;;index++) {
-            int adjust;
-            long reqdSize = dataSize;
-            DWORD rc = RegEnumKey(newKey,
-                                  index, keyBuf,MAX_PATH+1);
-            if (rc) break;
-            rc = RegQueryValue(newKey,
-                               keyBuf, dataBuf+off, &reqdSize);
-            if (rc) break;
-            if (reqdSize>1) {
-                /* If Nothing, or only '\0' copied. */
-                adjust = strlen(dataBuf+off);
-                dataSize -= adjust;
-                off += adjust;
-                dataBuf[off++] = ';';
-                dataBuf[off] = '\0';
-                dataSize--;
-            }
-        }
-        /* Additionally, win32s doesnt work as expected, so
-           the specific strlen() is required for 3.1. */
-        rc = RegQueryValue(newKey, "", dataBuf+off, &dataSize);
-        if (rc==ERROR_SUCCESS) {
-            if (strlen(dataBuf)==0)
-                free(dataBuf);
-            else
-                retval = dataBuf; /* caller will free */
-        }
-        else
-            free(dataBuf);
-    }
-
-    if (newKey)
-        RegCloseKey(newKey);
-    return retval;
-}
-#endif /* MS_WIN32 */
-
-static void
-get_progpath(void)
-{
-    extern char *Py_GetProgramName(void);
-    char *path = getenv("PATH");
-    char *prog = Py_GetProgramName();
-
-#ifdef MS_WIN32
-    if (GetModuleFileName(NULL, progpath, MAXPATHLEN))
-        return;
-#endif
-    if (prog == NULL || *prog == '\0')
-        prog = "python";
-
-    /* If there is no slash in the argv0 path, then we have to
-     * assume python is on the user's $PATH, since there's no
-     * other way to find a directory to start the search from.  If
-     * $PATH isn't exported, you lose.
-     */
-#ifdef ALTSEP
-    if (strchr(prog, SEP) || strchr(prog, ALTSEP))
-#else
-    if (strchr(prog, SEP))
-#endif
-        strcpy(progpath, prog);
-    else if (path) {
-        while (1) {
-            char *delim = strchr(path, DELIM);
-
-            if (delim) {
-                int len = delim - path;
-                strncpy(progpath, path, len);
-                *(progpath + len) = '\0';
-            }
-            else
-                strcpy(progpath, path);
-
-            join(progpath, prog);
-            if (exists(progpath))
-                break;
-
-            if (!delim) {
-                progpath[0] = '\0';
-                break;
-            }
-            path = delim + 1;
-        }
-    }
-    else
-        progpath[0] = '\0';
-}
-
-static void
-calculate_path(void)
-{
-    char argv0_path[MAXPATHLEN+1];
-    char *buf;
-    int bufsz;
-    char *pythonhome = Py_GetPythonHome();
-    char *envpath = Py_GETENV("PYTHONPATH");
-#ifdef MS_WIN32
-    char *machinepath, *userpath;
-
-    /* Are we running under Windows 3.1(1) Win32s? */
-    if (PyWin_IsWin32s()) {
-        /* Only CLASSES_ROOT is supported */
-        machinepath = getpythonregpath(HKEY_CLASSES_ROOT, TRUE);
-        userpath = NULL;
-    } else {
-        machinepath = getpythonregpath(HKEY_LOCAL_MACHINE, FALSE);
-        userpath = getpythonregpath(HKEY_CURRENT_USER, FALSE);
-    }
-#endif
-
-    get_progpath();
-    strcpy(argv0_path, progpath);
-    reduce(argv0_path);
-    if (pythonhome == NULL || *pythonhome == '\0') {
-        if (search_for_prefix(argv0_path, LANDMARK))
-            pythonhome = prefix;
-        else
-            pythonhome = NULL;
-    }
-    else {
-    char *delim;
-
-        strcpy(prefix, pythonhome);
-
-    /* Extract Any Optional Trailing EXEC_PREFIX */
-    /* e.g. PYTHONHOME=<prefix>:<exec_prefix>   */
-    delim = strchr(prefix, DELIM);
-    if (delim) {
-        *delim = '\0';
-        strcpy(exec_prefix, delim+1);
-    } else
-        strcpy(exec_prefix, EXEC_PREFIX);
-    }
-
-    if (envpath && *envpath == '\0')
-        envpath = NULL;
-
-    /* We need to construct a path from the following parts:
-       (1) the PYTHONPATH environment variable, if set;
-       (2) for Win32, the machinepath and userpath, if set;
-       (3) the PYTHONPATH config macro, with the leading "."
-           of each component replaced with pythonhome, if set;
-       (4) the directory containing the executable (argv0_path).
-       The length calculation calculates #3 first.
-    */
-
-    /* Calculate size of return buffer */
-    if (pythonhome != NULL) {
-        char *p;
-        bufsz = 1;
-        for (p = PYTHONPATH; *p; p++) {
-            if (*p == DELIM)
-                bufsz++; /* number of DELIM plus one */
-        }
-        bufsz *= strlen(pythonhome);
-    }
-    else
-        bufsz = 0;
-    bufsz += strlen(PYTHONPATH) + 1;
-    if (envpath != NULL)
-        bufsz += strlen(envpath) + 1;
-    bufsz += strlen(argv0_path) + 1;
-#ifdef MS_WIN32
-    if (machinepath)
-        bufsz += strlen(machinepath) + 1;
-    if (userpath)
-        bufsz += strlen(userpath) + 1;
-#endif
-
-    module_search_path = buf = malloc(bufsz);
-    if (buf == NULL) {
-        /* We can't exit, so print a warning and limp along */
-        fprintf(stderr, "Can't malloc dynamic PYTHONPATH.\n");
-        if (envpath) {
-            fprintf(stderr, "Using default static $PYTHONPATH.\n");
-            module_search_path = envpath;
-        }
-        else {
-            fprintf(stderr, "Using environment $PYTHONPATH.\n");
-            module_search_path = PYTHONPATH;
-        }
-        return;
-    }
-
-    if (envpath) {
-        strcpy(buf, envpath);
-        buf = strchr(buf, '\0');
-        *buf++ = DELIM;
-    }
-#ifdef MS_WIN32
-    if (machinepath) {
-        strcpy(buf, machinepath);
-        buf = strchr(buf, '\0');
-        *buf++ = DELIM;
-    }
-    if (userpath) {
-        strcpy(buf, userpath);
-        buf = strchr(buf, '\0');
-        *buf++ = DELIM;
-    }
-#endif
-    if (pythonhome == NULL) {
-        strcpy(buf, PYTHONPATH);
-        buf = strchr(buf, '\0');
-    }
-    else {
-        char *p = PYTHONPATH;
-        char *q;
-        int n;
-        for (;;) {
-            q = strchr(p, DELIM);
-            if (q == NULL)
-                n = strlen(p);
-            else
-                n = q-p;
-            if (p[0] == '.' && is_sep(p[1])) {
-                strcpy(buf, pythonhome);
-                buf = strchr(buf, '\0');
-                p++;
-                n--;
-            }
-            strncpy(buf, p, n);
-            buf += n;
-            if (q == NULL)
-                break;
-            *buf++ = DELIM;
-            p = q+1;
-        }
-    }
-    if (argv0_path) {
-        *buf++ = DELIM;
-        strcpy(buf, argv0_path);
-        buf = strchr(buf, '\0');
-    }
-    *buf = '\0';
-}
-
-
-/* External interface */
-
-char *
-Py_GetPath(void)
-{
-    if (!module_search_path)
-        calculate_path();
-
-    return module_search_path;
-}
-
-char *
-Py_GetPrefix(void)
-{
-    if (!module_search_path)
-        calculate_path();
-
-    return prefix;
-}
-
-char *
-Py_GetExecPrefix(void)
-{
-    if (!module_search_path)
-        calculate_path();
-
-    return exec_prefix;
-}
-
-char *
-Py_GetProgramFullPath(void)
-{
-    if (!module_search_path)
-        calculate_path();
-
-    return progpath;
-}
diff --git a/PC/os2vacpp/makefile b/PC/os2vacpp/makefile
deleted file mode 100644
index e2f0adc..0000000
--- a/PC/os2vacpp/makefile
+++ /dev/null
@@ -1,1549 +0,0 @@
-######################################################################
-#
-#          Top-Level Makefile for Building Python for OS/2
-#
-# This makefile was developed for use with IBM's VisualAge C/C++
-# for OS/2 compiler, version 3.0, with Fixpack 8 applied.  It uses
-# version 4.0 of the NMAKE tool that comes with that package.
-#
-# The output of the build is a largish Python23.DLL containing the
-# essential modules of Python and a small Python.exe program to start
-# the interpreter.  When embedding Python within another program, only
-# Python23.DLL is needed.
-#
-# These two binaries can be statically linked with the VisualAge C/C++
-# runtime library (producing larger binaries), or dynamically linked
-# to make smaller ones that require the compiler to be installed on
-# any system Python is used on.  Review the /Gd+ compiler option for
-# how to do this.
-#
-# NOTE: IBM's NMAKE 4.0 is rather dumb, requiring this makefile to
-#       be much more complicated than necessary.  I use OpusMAKE
-#       myself for a much more powerful MAKE tool but not everyone
-#       wishes to buy it.  However, as a result I didn't hook in
-#       the dependencies on the include files as NMAKE has no easy
-#       way to do this without explicitly spelling it all out.
-#
-# History (Most Recent First)
-#
-# 26-Sep-98 jrr Retested and adjusted for building w/Python 1.5.2a1
-# 20-Nov-97 jrr Cleaned Up for Applying to Distribution
-# 29-Oct-97 jrr Modified for Use with Python 1.5 Alpha 4
-# 03-Aug-96 jrr Original for Use with Python 1.4 Release
-#
-######################################################################
-
-###################
-# Places and Things
-###################
-PY_MODULES      = ..\..\Modules
-PY_OBJECTS      = ..\..\Objects
-PY_PARSER       = ..\..\Parser
-PY_PYTHON       = ..\..\Python
-PY_INCLUDE      = ..\..\Include
-PY_INCLUDES     = .;$(PY_INCLUDE);$(PY_MODULES);$(PY_OBJECTS);$(PY_PARSER);$(PY_PYTHON)
-
-# File to Collect Wordy Compiler Output re Errors
-ERRS		= make.out
-
-# Where to Find the IBM TCP/IP Socket Includes and Libraries
-OS2TCPIP        = C:\MPTN
-
-# Where to Find the Tcl/Tk Base Directory for Libs/Includes
-TCLTK		= D:\TclTk
-TCLBASE		= D:\Tcl7.6\OS2
-TKBASE		= D:\Tk4.2\OS2
-
-# Where to Put the .OBJ Files, To Keep Them Out of the Way
-PATHOBJ		= obj
-
-# Search Path for Include Files
-PROJINCLUDE	= .;$(TCLBASE);$(TKBASE);$(OS2TCPIP)\Include;$(PY_INCLUDES)
-
-# Place to Search for Sources re OpusMAKE Dependency Generator (Commercial)
-MKMF_SRCS	= $(PY_MODULES)\*.c $(PY_OBJECTS)\*.c $(PY_PARSER)\*.c $(PY_PYTHON)\*.c
-
-#.HDRPATH.c	:= $(PROJINCLUDE,;= ) $(.HDRPATH.c)
-#.PATH.c         = .;$(PY_MODULES);$(PY_OBJECTS);$(PY_PARSER);$(PY_PYTHON)
-OTHERLIBS	= so32dll.lib tcp32dll.lib # Tcl76.lib Tk42.lib
-
-#################
-# Inference Rules
-#################
-{$(PY_MODULES)\}.c{$(PATHOBJ)\}.obj:	# Compile C Code into a .OBJ File
-	@ Echo Compiling $<
-	@ $(CC) -c $(CFLAGS) -Fo$@ $< >>$(ERRS)
-
-{$(PY_OBJECTS)\}.c{$(PATHOBJ)\}.obj:	# Compile C Code into a .OBJ File
-	@ Echo Compiling $<
-	@ $(CC) -c $(CFLAGS) -Fo$@ $< >>$(ERRS)
-
-{$(PY_PARSER)\}.c{$(PATHOBJ)\}.obj:	# Compile C Code into a .OBJ File
-	@ Echo Compiling $<
-	@ $(CC) -c $(CFLAGS) -Fo$@ $< >>$(ERRS)
-
-{$(PY_PYTHON)\}.c{$(PATHOBJ)\}.obj:	# Compile C Code into a .OBJ File
-	@ Echo Compiling $<
-	@ $(CC) -c $(CFLAGS) -Fo$@ $< >>$(ERRS)
-
-.c{$(PATHOBJ)\}.obj:			# Compile C Code into a .OBJ File
-	@ Echo Compiling $<
-	@ $(CC) -c $(CFLAGS) -Fo$@ $< >>$(ERRS)
-
-###################
-# Python Subsystems
-###################
-
-# PYTHON is the central core, containing the builtins and interpreter.
-PYTHON		=                               \
-                  $(PATHOBJ)\BltinModule.obj    \
-                  $(PATHOBJ)\CEval.obj          \
-                  $(PATHOBJ)\Compile.obj        \
-                  $(PATHOBJ)\Errors.obj         \
-                  $(PATHOBJ)\Frozen.obj         \
-                  $(PATHOBJ)\Getargs.obj        \
-                  $(PATHOBJ)\GetCompiler.obj    \
-                  $(PATHOBJ)\GetCopyright.obj   \
-                  $(PATHOBJ)\GetMTime.obj       \
-                  $(PATHOBJ)\GetOpt.obj         \
-                  $(PATHOBJ)\GetPlatform.obj    \
-                  $(PATHOBJ)\GetVersion.obj     \
-                  $(PATHOBJ)\GramInit.obj       \
-                  $(PATHOBJ)\Import.obj         \
-                  $(PATHOBJ)\ImportDL.obj       \
-                  $(PATHOBJ)\Marshal.obj        \
-                  $(PATHOBJ)\ModSupport.obj     \
-                  $(PATHOBJ)\MyStrtoul.obj      \
-                  $(PATHOBJ)\PyState.obj        \
-                  $(PATHOBJ)\PythonRun.obj      \
-                  $(PATHOBJ)\StructMember.obj   \
-                  $(PATHOBJ)\SysModule.obj      \
-                  $(PATHOBJ)\Thread.obj         \
-                  $(PATHOBJ)\TraceBack.obj      \
-                  $(PATHOBJ)\FrozenMain.obj     \
-                  $(PATHOBJ)\exceptions.obj     \
-                  $(PATHOBJ)\symtable.obj       \
-                  $(PATHOBJ)\codecs.obj         \
-                  $(PATHOBJ)\future.obj         \
-                  $(PATHOBJ)\dynload_os2.obj    \
-                  $(PATHOBJ)\mysnprintf.obj     \
-                  $(PATHOBJ)\iterobject.obj
-
-# Python's Internal Parser
-PARSER		=                              \
-                  $(PATHOBJ)\Acceler.obj       \
-                  $(PATHOBJ)\Grammar1.obj      \
-                  $(PATHOBJ)\ListNode.obj      \
-                  $(PATHOBJ)\Node.obj          \
-                  $(PATHOBJ)\Parser.obj        \
-                  $(PATHOBJ)\ParseTok.obj      \
-                  $(PATHOBJ)\BitSet.obj        \
-                  $(PATHOBJ)\MetaGrammar.obj   \
-                  $(PATHOBJ)\Tokenizer.obj     \
-                  $(PATHOBJ)\MyReadline.obj
-
-# Python Object Types
-OBJECTS		=                              \
-                  $(PATHOBJ)\Abstract.obj      \
-                  $(PATHOBJ)\BoolObject.obj    \
-                  $(PATHOBJ)\BufferObject.obj  \
-                  $(PATHOBJ)\CellObject.obj    \
-                  $(PATHOBJ)\ClassObject.obj   \
-                  $(PATHOBJ)\CObject.obj       \
-                  $(PATHOBJ)\ComplexObject.obj \
-                  $(PATHOBJ)\DescrObject.obj   \
-                  $(PATHOBJ)\DictObject.obj    \
-                  $(PATHOBJ)\EnumObject.obj    \
-                  $(PATHOBJ)\FileObject.obj    \
-                  $(PATHOBJ)\FloatObject.obj   \
-                  $(PATHOBJ)\FrameObject.obj   \
-                  $(PATHOBJ)\FuncObject.obj    \
-                  $(PATHOBJ)\IterObject.obj    \
-                  $(PATHOBJ)\ListObject.obj    \
-                  $(PATHOBJ)\LongObject.obj    \
-                  $(PATHOBJ)\MethodObject.obj  \
-                  $(PATHOBJ)\ModuleObject.obj  \
-                  $(PATHOBJ)\Object.obj        \
-                  $(PATHOBJ)\ObMalloc.obj      \
-                  $(PATHOBJ)\RangeObject.obj   \
-                  $(PATHOBJ)\SliceObject.obj   \
-                  $(PATHOBJ)\StringObject.obj  \
-                  $(PATHOBJ)\StructSeq.obj     \
-                  $(PATHOBJ)\TupleObject.obj   \
-                  $(PATHOBJ)\TypeObject.obj    \
-                  $(PATHOBJ)\UnicodeObject.obj \
-                  $(PATHOBJ)\UnicodeCType.obj  \
-                  $(PATHOBJ)\WeakrefObject.obj
-
-# Extension Modules (Built-In or as Separate DLLs)
-MODULES		=                              \
-                  $(PATHOBJ)\ArrayModule.obj   \
-                  $(PATHOBJ)\BinAscii.obj      \
-                  $(PATHOBJ)\CMathModule.obj   \
-                  $(PATHOBJ)\ErrnoModule.obj   \
-                  $(PATHOBJ)\GCModule.obj      \
-                  $(PATHOBJ)\GetBuildInfo.obj  \
-                  $(PATHOBJ)\GetPathP.obj      \
-                  $(PATHOBJ)\Main.obj          \
-                  $(PATHOBJ)\MathModule.obj    \
-                  $(PATHOBJ)\MD5c.obj          \
-                  $(PATHOBJ)\MD5Module.obj     \
-                  $(PATHOBJ)\Operator.obj      \
-                  $(PATHOBJ)\PCREModule.obj    \
-                  $(PATHOBJ)\PyPCRE.obj        \
-                  $(PATHOBJ)\PosixModule.obj   \
-                  $(PATHOBJ)\RegexModule.obj   \
-                  $(PATHOBJ)\RegExpr.obj       \
-                  $(PATHOBJ)\SelectModule.obj  \
-                  $(PATHOBJ)\SignalModule.obj  \
-                  $(PATHOBJ)\SocketModule.obj  \
-                  $(PATHOBJ)\StropModule.obj   \
-                  $(PATHOBJ)\StructModule.obj  \
-                  $(PATHOBJ)\TimeModule.obj    \
-                  $(PATHOBJ)\ThreadModule.obj
-
-# Standalone Parser Generator Program (Shares Some of Python's Modules)
-PGEN            =                              \
-                  $(PATHOBJ)\PGen.obj          \
-                  $(PATHOBJ)\PGenMain.obj      \
-                  $(PATHOBJ)\MySNPrintf.obj    \
-                  $(PATHOBJ)\Tokenizer_Pgen.obj \
-                  $(PATHOBJ)\PrintGrammar.obj  \
-                  $(PATHOBJ)\Grammar.obj       \
-                  $(PATHOBJ)\FirstSets.obj
-
-##################
-# Macros and Flags
-##################
-_BASE		= /Q /W2 /I$(PROJINCLUDE)
-		# /Q   = Omit IBM Copyright
-		# /W2  = Show Warnings/Errors Only
-
-_GEN		= /G4 /Gm /Gd-
-		# /G4  = Generate Code for 486 (Use 386 for Debugger)
-		# /Gm  = Use Multithread Runtime
-		# /Gd  = Dynamically Load Runtime
-		# /Ms  = Use _System Calling Convention (vs _Optlink)
-		#        (to allow non-VAC++ code to call into Python23.dll)
-
-_OPT		= /O /Gl
-		# /O   = Enable Speed-Optimizations
-		# /Ol  = Pass Code Thru Intermediate Linker
-		# /Gu  = Advise Linker All Ext Data is ID'd
-		# /Gl  = Have Linker Remove Unused Fns
-
-_DBG		= /Wpro- /Ti- /DHAVE_CONFIG_H /DUSE_SOCKET
-                # /Wpro= Generate Compiler Warnings re Missing Prototypes
-		# /Ti  = Embed Debugger/Analyzer Recs
-		# /Tm  = Enable Debug Memory Fns
-		# /Tx  = Request Full Dump Upon Exception
-		# /DHAVE_CONFIG_H = Causes Use of CONFIG.H Settings
-                # /DUSE_SOCKET = Enables Building In of Socket API
-
-_OUT		= 
-		# /Fb  = Embed Browser Recs
-		# /Gh  = Generate Code for Profiler Hooks
-		# /Fl  = Output C/C++ Listing Files
-                # /Lf  = Provide Full (Detailed) Listing Files
-		# /Fm. = Output Linker Map File
-		# /Ft. = Output C++ Template Resolution Files
-
-_MAP		= /FmNoise\$(@R).map
-
-_DLL		= /Ge-
-_EXE		= /Ge
-		# /Ge = Create an EXE, not DLL
-
-CFLAGS		= $(_BASE) $(_GEN) $(_OPT) $(_DBG) $(_OUT) $(_EXE) /Ss
-
-###################
-# Primary Target(s)
-###################
-All:  obj noise PyCore.lib Python23.lib PGen.exe \
-      Python.exe PythonPM.exe Python23.dll # _tkinter.dll
-
-Modules: $(MODULES)
-Objects: $(OBJECTS)
-Parser:  $(PARSER)
-Python:  $(PYTHON)
-
-# Directory to Keep .OBJ Files Out of the Way
-obj:
-	@-mkdir obj >>NUL
-
-# Directory to Keep .MAP and Such Text Files Out of the Way
-noise:
-	@-mkdir noise >>NUL
-
-##############
-#
-##############
-
-# Python Extension DLL: Tcl/Tk Interface
-#_tkinter.dll: $(PATHOBJ)\_tkinter.obj Python23.lib _tkinter.def
-#	@ Echo Linking $@ As DLL
-#	@ $(CC) $(CFLAGS) /B"/NOE" $(_DLL) /Fe$@ $(_MAP) $** $(OTHERLIBS) >>$(ERRS)
-
-#$(PATHOBJ)\_tkinter.obj: $(PY_MODULES)\_tkinter.c
-#	@ Echo Compiling $**
-#	@ $(CC) -c $(CFLAGS) $(_DLL) -Fo$@ $** >>$(ERRS)
-
-# Object Library of All Essential Python Routines
-PyCore.lib: $(MODULES) $(OBJECTS) $(PARSER) $(PYTHON) $(PATHOBJ)\Config.obj
-	@ Echo Adding Updated Object Files to Link Library $@
-	@ ! ILIB $@ /NOLOGO /NOBACKUP -+$? ; >>$(ERRS)
-
-Python23.dll: $(PATHOBJ)\Compile.obj PyCore.lib Python.def
-	@ Echo Linking $@ As DLL
-	@ $(CC) $(CFLAGS) /B"/NOE" $(_DLL) /Fe$@ $(_MAP) $** $(OTHERLIBS) >>$(ERRS)
-#	@ Echo Compressing $@ with LxLite
-#	@ lxlite $@
-
-# IBM Linker Requires One Explicit .OBJ To Build a .DLL from a .LIB
-$(PATHOBJ)\Compile.obj: $(PY_PYTHON)\Compile.c
-	@ Echo Compiling $**
-	@ $(CC) -c $(CFLAGS) $(_DLL) -Fo$@ $** >>$(ERRS)
-
-# Import Library for Using the Python23.dll
-Python23.lib: Python.def
-	@ Echo Making $@
-	@ IMPLIB /NOLOGO /NOIGNORE $@ $** >>$(ERRS)
-	@ ILIB /NOLOGO /CONVFORMAT /NOEXTDICTIONARY /NOBROWSE /NOBACKUP $@; >>$(ERRS)
-
-# Small Command-Line Program to Start Interpreter in Python23.dll
-Python.exe: $(PATHOBJ)\Python.obj Python23.lib
-	@ Echo Linking $@ As EXE
-	@ $(CC) $(CFLAGS) $(_EXE) /B"/PM:VIO /STACK:360000" /Fe$@ $(_MAP) $** $(OTHERLIBS) >>$(ERRS)
-
-# Small PM-GUI Program to Start Interpreter in Python23.dll
-PythonPM.exe: $(PATHOBJ)\Python.obj Python23.lib
-	@ Echo Linking $@ As EXE
-	@ $(CC) $(CFLAGS) $(_EXE) /B"/PM:PM /STACK:360000" /Fe$@ $(_MAP) $** $(OTHERLIBS) >>$(ERRS)
-
-PGen.exe: $(PGEN) PyCore.lib
-	@ Echo Linking $@ As EXE
-	@ $(CC) $(CFLAGS) $(_EXE) /B"/STACK:360000" /Fe$@ $(_MAP) $** $(OTHERLIBS) >>$(ERRS)
-
-#######################
-# Miscellaneous Targets
-#######################
-
-# Remove Intermediate Targets but Leave Executable Binaries
-clean:
-	-- Del /Q $(PATHOBJ)\*.obj		>NUL 2>&1
-	-- Del /Q /Y Noise			>NUL 2>&1
-	-- Del /Q $(ERRS)			>NUL 2>&1
-
-# Remove All Targets, Including Final Binaries
-distclean: clean
-        -- Del /Q PyCore.lib Python23.lib       >NUL 2>&1
-        -- Del /Q Python23.dll Python.exe PGen.exe >NUL 2>&1
-
-release: Python.exe Python23.dll Python23.lib
-	-- @Echo Y | copy /U Python.exe   D:\EXEs
-	-- @Echo Y | copy /U Python23.dll D:\DLLs
-	-- @Echo Y | copy /U Python23.lib E:\Tau\Lib
-	-- @Echo Y | copy /U _tkinter.dll D:\Python
-
-test:
-        python ..\..\lib\test\regrtest.py
-
-# Update Dependencies on Targets (Uses OpusMAKE Commercial Product)
-depend:
-	D:\OpusMake\os2mkmf -c -s
-
-### OPUS MKMF:  Do not remove this line!  Generated dependencies follow.
-
-_tkinter.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h pyconfig.h \
-	 $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h \
-	 $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h $(PY_INCLUDE)\intobject.h \
-	 $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\pydebug.h \
-	 $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h \
-	 $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h \
-	 $(PY_INCLUDE)\sliceobject.h $(PY_INCLUDE)\stringobject.h \
-	 $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
-
-arraymodule.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
-	 $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \
-	 pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
-	 $(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h \
-	 $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h \
-	 $(PY_INCLUDE)\longobject.h $(PY_INCLUDE)\methodobject.h \
-	 $(PY_INCLUDE)\modsupport.h $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h \
-	 $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h \
-	 $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h \
-	 $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h \
-	 $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
-	 $(PY_INCLUDE)\tupleobject.h
-
-audioop.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h pyconfig.h \
-	 $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h \
-	 $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h $(PY_INCLUDE)\intobject.h \
-	 $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\mymath.h \
-	 $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h \
-	 $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h \
-	 $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h \
-	 $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
-	 $(PY_INCLUDE)\tupleobject.h
-
-binascii.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h pyconfig.h \
-	 $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h \
-	 $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h $(PY_INCLUDE)\intobject.h \
-	 $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\pydebug.h \
-	 $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h \
-	 $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h \
-	 $(PY_INCLUDE)\sliceobject.h $(PY_INCLUDE)\stringobject.h \
-	 $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
-
-cmathmodule.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
-	 $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \
-	 pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
-	 $(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h \
-	 $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h \
-	 $(PY_INCLUDE)\longobject.h $(PY_INCLUDE)\methodobject.h \
-	 $(PY_INCLUDE)\modsupport.h $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h \
-	 $(PY_INCLUDE)\mymath.h $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\object.h \
-	 $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h \
-	 $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h \
-	 $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
-	 $(PY_INCLUDE)\tupleobject.h
-
-cpickle.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h pyconfig.h \
-	 $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
-	 $(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h \
-	 $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h \
-	 $(PY_INCLUDE)\longobject.h $(PY_INCLUDE)\methodobject.h \
-	 $(PY_INCLUDE)\modsupport.h $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h \
-	 $(PY_INCLUDE)\mymath.h $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\object.h \
-	 $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h \
-	 $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h \
-	 $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
-	 $(PY_INCLUDE)\tupleobject.h
-
-cryptmodule.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
-	 $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \
-	 pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
-	 $(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h \
-	 $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h \
-	 $(PY_INCLUDE)\longobject.h $(PY_INCLUDE)\methodobject.h \
-	 $(PY_INCLUDE)\modsupport.h $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h \
-	 $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h \
-	 $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h \
-	 $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h \
-	 $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
-	 $(PY_INCLUDE)\tupleobject.h
-
-cursesmodule.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
-	 $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \
-	 pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
-	 $(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h \
-	 $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h \
-	 $(PY_INCLUDE)\longobject.h $(PY_INCLUDE)\methodobject.h \
-	 $(PY_INCLUDE)\modsupport.h $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h \
-	 $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h \
-	 $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h \
-	 $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h \
-	 $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
-	 $(PY_INCLUDE)\tupleobject.h
-
-_dbmmodule.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h pyconfig.h \
-	 $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h \
-	 $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h $(PY_INCLUDE)\intobject.h \
-	 $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\pydebug.h \
-	 $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h \
-	 $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h \
-	 $(PY_INCLUDE)\sliceobject.h $(PY_INCLUDE)\stringobject.h \
-	 $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
-
-errno.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h pyconfig.h \
-	 $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h \
-	 $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h $(PY_INCLUDE)\intobject.h \
-	 $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\pydebug.h \
-	 $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h \
-	 $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h \
-	 $(PY_INCLUDE)\sliceobject.h $(PY_INCLUDE)\stringobject.h \
-	 $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
-
-errnomodule.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
-	 $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \
-	 pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
-	 $(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h \
-	 $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h \
-	 $(PY_INCLUDE)\longobject.h $(PY_INCLUDE)\methodobject.h \
-	 $(PY_INCLUDE)\modsupport.h $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h \
-	 $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h \
-	 $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h \
-	 $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h \
-	 $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
-	 $(PY_INCLUDE)\tupleobject.h
-
-fcntlmodule.obj: $(PY_INCLUDE)\abstract.h $(OS2TCPIP)\Include\sys\ioctl.h $(PY_INCLUDE)\ceval.h \
-	 $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \
-	 pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
-	 $(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h \
-	 $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h \
-	 $(PY_INCLUDE)\longobject.h $(PY_INCLUDE)\methodobject.h \
-	 $(PY_INCLUDE)\modsupport.h $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h \
-	 $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h \
-	 $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h \
-	 $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h \
-	 $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
-	 $(PY_INCLUDE)\tupleobject.h
-
-fpectlmodule.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
-	 $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \
-	 pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
-	 $(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h \
-	 $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h \
-	 $(PY_INCLUDE)\longobject.h $(PY_INCLUDE)\methodobject.h \
-	 $(PY_INCLUDE)\modsupport.h $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h \
-	 $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h \
-	 $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h \
-	 $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h \
-	 $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
-	 $(PY_INCLUDE)\tupleobject.h
-
-fpetestmodule.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
-	 $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \
-	 pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
-	 $(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h \
-	 $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h \
-	 $(PY_INCLUDE)\longobject.h $(PY_INCLUDE)\methodobject.h \
-	 $(PY_INCLUDE)\modsupport.h $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h \
-	 $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h \
-	 $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h \
-	 $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h \
-	 $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
-	 $(PY_INCLUDE)\tupleobject.h
-
-_gdbmmodule.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h pyconfig.h \
-	 $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h \
-	 $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h $(PY_INCLUDE)\intobject.h \
-	 $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\pydebug.h \
-	 $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h \
-	 $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h \
-	 $(PY_INCLUDE)\sliceobject.h $(PY_INCLUDE)\stringobject.h \
-	 $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
-
-getbuildinfo.obj: pyconfig.h
-
-getpath.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h pyconfig.h \
-	 $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h \
-	 $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h $(PY_INCLUDE)\intobject.h \
-	 $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\osdefs.h \
-	 $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h \
-	 $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h \
-	 $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
-	 $(PY_INCLUDE)\tupleobject.h
-
-grpmodule.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h pyconfig.h \
-	 $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h \
-	 $(PY_INCLUDE)\funcobject.h $(OS2TCPIP)\Include\grp.h $(PY_INCLUDE)\import.h \
-	 $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h \
-	 $(PY_INCLUDE)\longobject.h $(PY_INCLUDE)\methodobject.h \
-	 $(PY_INCLUDE)\modsupport.h $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h \
-	 $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h \
-	 $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h \
-	 $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h \
-	 $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
-	 $(PY_INCLUDE)\tupleobject.h
-
-imageop.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h pyconfig.h \
-	 $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h \
-	 $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h $(PY_INCLUDE)\intobject.h \
-	 $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\pydebug.h \
-	 $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h \
-	 $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h \
-	 $(PY_INCLUDE)\sliceobject.h $(PY_INCLUDE)\stringobject.h \
-	 $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
-
-main.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h pyconfig.h \
-	 $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h \
-	 $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h $(PY_INCLUDE)\intobject.h \
-	 $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\pydebug.h \
-	 $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h \
-	 $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h \
-	 $(PY_INCLUDE)\sliceobject.h $(PY_INCLUDE)\stringobject.h \
-	 $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
-
-mathmodule.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h pyconfig.h \
-	 $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h \
-	 $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h $(PY_INCLUDE)\intobject.h \
-	 $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\mymath.h \
-	 $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h \
-	 $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h \
-	 $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h \
-	 $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
-	 $(PY_INCLUDE)\tupleobject.h
-
-mpzmodule.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
-	 $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \
-	 pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
-	 $(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h \
-	 $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h \
-	 $(PY_INCLUDE)\longintrepr.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\pydebug.h \
-	 $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h \
-	 $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h \
-	 $(PY_INCLUDE)\sliceobject.h $(PY_INCLUDE)\stringobject.h \
-	 $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
-
-nismodule.obj: $(PY_INCLUDE)\abstract.h $(OS2TCPIP)\Include\sys\time.h $(PY_INCLUDE)\ceval.h \
-	 $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \
-	 pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
-	 $(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h \
-	 $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h \
-	 $(PY_INCLUDE)\longobject.h $(PY_INCLUDE)\methodobject.h \
-	 $(PY_INCLUDE)\modsupport.h $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h \
-	 $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h \
-	 $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h \
-	 $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h \
-	 $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
-	 $(PY_INCLUDE)\tupleobject.h
-
-operator.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h pyconfig.h \
-	 $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h \
-	 $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h $(PY_INCLUDE)\intobject.h \
-	 $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\pydebug.h \
-	 $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h \
-	 $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h \
-	 $(PY_INCLUDE)\sliceobject.h $(PY_INCLUDE)\stringobject.h \
-	 $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
-
-parsermodule.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
-	 $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\compile.h \
-	 $(PY_INCLUDE)\complexobject.h pyconfig.h $(PY_INCLUDE)\dictobject.h \
-	 $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h \
-	 $(PY_INCLUDE)\graminit.h $(PY_INCLUDE)\import.h $(PY_INCLUDE)\intobject.h \
-	 $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\node.h $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h \
-	 $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h \
-	 $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h \
-	 $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\token.h \
-	 $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
-
-posix.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h pyconfig.h \
-	 $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h \
-	 $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h $(PY_INCLUDE)\intobject.h \
-	 $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\mytime.h $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h \
-	 $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h \
-	 $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h \
-	 $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
-	 $(PY_INCLUDE)\tupleobject.h
-
-posixmodule.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
-	 $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \
-	 pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
-	 $(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h \
-	 $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h \
-	 $(PY_INCLUDE)\longobject.h $(PY_INCLUDE)\methodobject.h \
-	 $(PY_INCLUDE)\modsupport.h $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h \
-	 $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\mytime.h $(PY_INCLUDE)\object.h \
-	 $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h \
-	 $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h \
-	 $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
-	 $(PY_INCLUDE)\tupleobject.h
-
-pwdmodule.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h pyconfig.h \
-	 $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h \
-	 $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h $(PY_INCLUDE)\intobject.h \
-	 $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h $(OS2TCPIP)\Include\pwd.h \
-	 $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h \
-	 $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h \
-	 $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
-	 $(PY_INCLUDE)\tupleobject.h
-
-readline.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h pyconfig.h \
-	 $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h \
-	 $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h $(PY_INCLUDE)\intobject.h \
-	 $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\pydebug.h \
-	 $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h \
-	 $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h \
-	 $(PY_INCLUDE)\sliceobject.h $(PY_INCLUDE)\stringobject.h \
-	 $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
-
-resource.obj: $(PY_INCLUDE)\abstract.h $(OS2TCPIP)\Include\sys\time.h $(PY_INCLUDE)\ceval.h \
-	 $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \
-	 pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
-	 $(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h \
-	 $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h \
-	 $(PY_INCLUDE)\longobject.h $(PY_INCLUDE)\methodobject.h \
-	 $(PY_INCLUDE)\modsupport.h $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h \
-	 $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h \
-	 $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h \
-	 $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h \
-	 $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
-	 $(PY_INCLUDE)\tupleobject.h
-
-selectmodule.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
-	 $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \
-	 pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
-	 $(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h \
-	 $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h \
-	 $(PY_INCLUDE)\longobject.h $(PY_INCLUDE)\methodobject.h \
-	 $(PY_INCLUDE)\modsupport.h $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h \
-	 $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\myselect.h $(PY_INCLUDE)\mytime.h \
-	 $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\pydebug.h \
-	 $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h \
-	 $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h \
-	 $(PY_INCLUDE)\sliceobject.h $(PY_INCLUDE)\stringobject.h \
-	 $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
-
-signalmodule.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
-	 $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \
-	 pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
-	 $(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h \
-	 $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h \
-	 $(PY_INCLUDE)\longobject.h $(PY_INCLUDE)\methodobject.h \
-	 $(PY_INCLUDE)\modsupport.h $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h \
-	 $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h \
-	 $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h \
-	 $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h \
-	 $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
-	 $(PY_INCLUDE)\tupleobject.h
-
-socketmodule.obj: $(PY_INCLUDE)\abstract.h $(OS2TCPIP)\Include\netinet\in.h \
-	 $(OS2TCPIP)\Include\sys\socket.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h pyconfig.h \
-	 $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h \
-	 $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h $(PY_INCLUDE)\intobject.h \
-	 $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\mytime.h $(OS2TCPIP)\Include\netdb.h $(PY_INCLUDE)\object.h \
-	 $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h \
-	 $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h \
-	 $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
-	 $(PY_INCLUDE)\tupleobject.h
-
-structmodule.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
-	 $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \
-	 pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
-	 $(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h \
-	 $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h \
-	 $(PY_INCLUDE)\longobject.h $(PY_INCLUDE)\methodobject.h \
-	 $(PY_INCLUDE)\modsupport.h $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h \
-	 $(PY_INCLUDE)\mymath.h $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\object.h \
-	 $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h \
-	 $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h \
-	 $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
-	 $(PY_INCLUDE)\tupleobject.h
-
-syslogmodule.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
-	 $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \
-	 pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
-	 $(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h \
-	 $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h \
-	 $(PY_INCLUDE)\longobject.h $(PY_INCLUDE)\methodobject.h \
-	 $(PY_INCLUDE)\modsupport.h $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h \
-	 $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h \
-	 $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h \
-	 $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h \
-	 $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(OS2TCPIP)\Include\syslog.h $(PY_INCLUDE)\sysmodule.h \
-	 $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
-
-termios.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h pyconfig.h \
-	 $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h \
-	 $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h $(PY_INCLUDE)\intobject.h \
-	 $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\pydebug.h \
-	 $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h \
-	 $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h \
-	 $(PY_INCLUDE)\sliceobject.h $(PY_INCLUDE)\stringobject.h \
-	 $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
-
-_threadmodule.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
-	 $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \
-	 pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
-	 $(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h \
-	 $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h \
-	 $(PY_INCLUDE)\longobject.h $(PY_INCLUDE)\methodobject.h \
-	 $(PY_INCLUDE)\modsupport.h $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h \
-	 $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h \
-	 $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h \
-	 $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h \
-	 $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\thread.h \
-	 $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
-
-timemodule.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h pyconfig.h \
-	 $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h \
-	 $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h $(PY_INCLUDE)\intobject.h \
-	 $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\mytime.h $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h \
-	 $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h \
-	 $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h \
-	 $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
-	 $(PY_INCLUDE)\tupleobject.h
-
-xxmodule.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h pyconfig.h \
-	 $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h \
-	 $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h $(PY_INCLUDE)\intobject.h \
-	 $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\pydebug.h \
-	 $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h \
-	 $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h \
-	 $(PY_INCLUDE)\sliceobject.h $(PY_INCLUDE)\stringobject.h \
-	 $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
-
-zlibmodule.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h pyconfig.h \
-	 $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h \
-	 $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h $(PY_INCLUDE)\intobject.h \
-	 $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\pydebug.h \
-	 $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h \
-	 $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h \
-	 $(PY_INCLUDE)\sliceobject.h $(PY_INCLUDE)\stringobject.h \
-	 $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
-
-abstract.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h pyconfig.h \
-	 $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h \
-	 $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h $(PY_INCLUDE)\intobject.h \
-	 $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\pydebug.h \
-	 $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h \
-	 $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h \
-	 $(PY_INCLUDE)\sliceobject.h $(PY_INCLUDE)\stringobject.h \
-	 $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
-
-classobject.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
-	 $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \
-	 pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
-	 $(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h \
-	 $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h \
-	 $(PY_INCLUDE)\longobject.h $(PY_INCLUDE)\methodobject.h \
-	 $(PY_INCLUDE)\modsupport.h $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h \
-	 $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h \
-	 $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h \
-	 $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h \
-	 $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\structmember.h \
-	 $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
-
-cobject.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h pyconfig.h \
-	 $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h \
-	 $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h $(PY_INCLUDE)\intobject.h \
-	 $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\pydebug.h \
-	 $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h \
-	 $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h \
-	 $(PY_INCLUDE)\sliceobject.h $(PY_INCLUDE)\stringobject.h \
-	 $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
-
-complexobject.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
-	 $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \
-	 pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
-	 $(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h \
-	 $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h \
-	 $(PY_INCLUDE)\longobject.h $(PY_INCLUDE)\methodobject.h \
-	 $(PY_INCLUDE)\modsupport.h $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h \
-	 $(PY_INCLUDE)\mymath.h $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\object.h \
-	 $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h \
-	 $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h \
-	 $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
-	 $(PY_INCLUDE)\tupleobject.h
-
-dictobject.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h pyconfig.h \
-	 $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h \
-	 $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h $(PY_INCLUDE)\intobject.h \
-	 $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\pydebug.h \
-	 $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h \
-	 $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h \
-	 $(PY_INCLUDE)\sliceobject.h $(PY_INCLUDE)\stringobject.h \
-	 $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
-
-fileobject.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h pyconfig.h \
-	 $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h \
-	 $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h $(PY_INCLUDE)\intobject.h \
-	 $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\pydebug.h \
-	 $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h \
-	 $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h \
-	 $(PY_INCLUDE)\sliceobject.h $(PY_INCLUDE)\stringobject.h \
-	 $(PY_INCLUDE)\structmember.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
-	 $(PY_INCLUDE)\tupleobject.h
-
-floatobject.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
-	 $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \
-	 pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
-	 $(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h \
-	 $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h \
-	 $(PY_INCLUDE)\longobject.h $(PY_INCLUDE)\methodobject.h \
-	 $(PY_INCLUDE)\modsupport.h $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h \
-	 $(PY_INCLUDE)\mymath.h $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\object.h \
-	 $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h \
-	 $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h \
-	 $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
-	 $(PY_INCLUDE)\tupleobject.h
-
-frameobject.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
-	 $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\compile.h \
-	 $(PY_INCLUDE)\complexobject.h pyconfig.h $(PY_INCLUDE)\dictobject.h \
-	 $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h \
-	 $(PY_INCLUDE)\frameobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h \
-	 $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h \
-	 $(PY_INCLUDE)\longobject.h $(PY_INCLUDE)\methodobject.h \
-	 $(PY_INCLUDE)\modsupport.h $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h \
-	 $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h \
-	 $(PY_INCLUDE)\opcode.h $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h \
-	 $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h \
-	 $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\structmember.h \
-	 $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
-
-funcobject.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\compile.h $(PY_INCLUDE)\complexobject.h \
-	 pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
-	 $(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h \
-	 $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h \
-	 $(PY_INCLUDE)\longobject.h $(PY_INCLUDE)\methodobject.h \
-	 $(PY_INCLUDE)\modsupport.h $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h \
-	 $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h \
-	 $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h \
-	 $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h \
-	 $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\structmember.h \
-	 $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
-
-listobject.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h pyconfig.h \
-	 $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h \
-	 $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h $(PY_INCLUDE)\intobject.h \
-	 $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\pydebug.h \
-	 $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h \
-	 $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h \
-	 $(PY_INCLUDE)\sliceobject.h $(PY_INCLUDE)\stringobject.h \
-	 $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
-
-longobject.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
-	 $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \
-	 pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
-	 $(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h \
-	 $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h \
-	 $(PY_INCLUDE)\longintrepr.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\mymath.h \
-	 $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h \
-	 $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h \
-	 $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h \
-	 $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
-	 $(PY_INCLUDE)\tupleobject.h
-
-methodobject.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
-	 $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \
-	 pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
-	 $(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h \
-	 $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h \
-	 $(PY_INCLUDE)\longobject.h $(PY_INCLUDE)\methodobject.h \
-	 $(PY_INCLUDE)\modsupport.h $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h \
-	 $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h \
-	 $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h \
-	 $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h \
-	 $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\token.h \
-	 $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
-
-moduleobject.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
-	 $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \
-	 pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
-	 $(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h \
-	 $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h \
-	 $(PY_INCLUDE)\longobject.h $(PY_INCLUDE)\methodobject.h \
-	 $(PY_INCLUDE)\modsupport.h $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h \
-	 $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h \
-	 $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h \
-	 $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h \
-	 $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
-	 $(PY_INCLUDE)\tupleobject.h
-
-object.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h pyconfig.h \
-	 $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h \
-	 $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h $(PY_INCLUDE)\intobject.h \
-	 $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\pydebug.h \
-	 $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h \
-	 $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h \
-	 $(PY_INCLUDE)\sliceobject.h $(PY_INCLUDE)\stringobject.h \
-	 $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
-
-rangeobject.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
-	 $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \
-	 pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
-	 $(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h \
-	 $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h \
-	 $(PY_INCLUDE)\longobject.h $(PY_INCLUDE)\methodobject.h \
-	 $(PY_INCLUDE)\modsupport.h $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h \
-	 $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h \
-	 $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h \
-	 $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h \
-	 $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
-	 $(PY_INCLUDE)\tupleobject.h
-
-sliceobject.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
-	 $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \
-	 pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
-	 $(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h \
-	 $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h \
-	 $(PY_INCLUDE)\longobject.h $(PY_INCLUDE)\methodobject.h \
-	 $(PY_INCLUDE)\modsupport.h $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h \
-	 $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h \
-	 $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h \
-	 $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h \
-	 $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
-	 $(PY_INCLUDE)\tupleobject.h
-
-stringobject.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
-	 $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \
-	 pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
-	 $(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h \
-	 $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h \
-	 $(PY_INCLUDE)\longobject.h $(PY_INCLUDE)\methodobject.h \
-	 $(PY_INCLUDE)\modsupport.h $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h \
-	 $(PY_INCLUDE)\mymath.h $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\object.h \
-	 $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h \
-	 $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h \
-	 $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
-	 $(PY_INCLUDE)\tupleobject.h
-
-tupleobject.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
-	 $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \
-	 pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
-	 $(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h \
-	 $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h \
-	 $(PY_INCLUDE)\longobject.h $(PY_INCLUDE)\methodobject.h \
-	 $(PY_INCLUDE)\modsupport.h $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h \
-	 $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h \
-	 $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h \
-	 $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h \
-	 $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
-	 $(PY_INCLUDE)\tupleobject.h
-
-typeobject.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h pyconfig.h \
-	 $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h \
-	 $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h $(PY_INCLUDE)\intobject.h \
-	 $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\pydebug.h \
-	 $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h \
-	 $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h \
-	 $(PY_INCLUDE)\sliceobject.h $(PY_INCLUDE)\stringobject.h \
-	 $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
-
-xxobject.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h pyconfig.h \
-	 $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h \
-	 $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h $(PY_INCLUDE)\intobject.h \
-	 $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\pydebug.h \
-	 $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h \
-	 $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h \
-	 $(PY_INCLUDE)\sliceobject.h $(PY_INCLUDE)\stringobject.h \
-	 $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
-
-acceler.obj: $(PY_INCLUDE)\bitset.h pyconfig.h $(PY_INCLUDE)\grammar.h \
-	 $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\node.h \
-	 $(PY_PARSER)\parser.h $(PY_INCLUDE)\pgenheaders.h $(PY_INCLUDE)\pydebug.h \
-	 $(PY_INCLUDE)\token.h
-
-bitset.obj: $(PY_INCLUDE)\bitset.h pyconfig.h $(PY_INCLUDE)\mymalloc.h \
-	 $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\pgenheaders.h $(PY_INCLUDE)\pydebug.h
-
-firstsets.obj: $(PY_INCLUDE)\bitset.h pyconfig.h $(PY_INCLUDE)\grammar.h \
-	 $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\pgenheaders.h \
-	 $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\token.h
-
-grammar.obj: $(PY_INCLUDE)\bitset.h pyconfig.h \
-	 $(PY_INCLUDE)\grammar.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\pgenheaders.h $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\token.h
-
-grammar1.obj: $(PY_INCLUDE)\bitset.h pyconfig.h \
-	 $(PY_INCLUDE)\grammar.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\pgenheaders.h $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\token.h
-
-intrcheck.obj: pyconfig.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\mymalloc.h \
-	 $(PY_INCLUDE)\myproto.h
-
-listnode.obj: pyconfig.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\node.h $(PY_INCLUDE)\pgenheaders.h $(PY_INCLUDE)\pydebug.h \
-	 $(PY_INCLUDE)\token.h
-
-metagrammar.obj: $(PY_INCLUDE)\bitset.h pyconfig.h $(PY_INCLUDE)\grammar.h \
-	 $(PY_INCLUDE)\metagrammar.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_PARSER)\pgen.h $(PY_INCLUDE)\pgenheaders.h $(PY_INCLUDE)\pydebug.h
-
-myreadline.obj: pyconfig.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\mymalloc.h \
-	 $(PY_INCLUDE)\myproto.h
-
-node.obj: pyconfig.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\node.h \
-	 $(PY_INCLUDE)\pgenheaders.h $(PY_INCLUDE)\pydebug.h
-
-parser.obj: $(PY_INCLUDE)\bitset.h pyconfig.h $(PY_INCLUDE)\errcode.h \
-	 $(PY_INCLUDE)\grammar.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\node.h $(PY_PARSER)\parser.h $(PY_INCLUDE)\pgenheaders.h \
-	 $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\token.h
-
-parsetok.obj: $(PY_INCLUDE)\bitset.h pyconfig.h $(PY_INCLUDE)\errcode.h \
-	 $(PY_INCLUDE)\grammar.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\node.h $(PY_PARSER)\parser.h $(PY_INCLUDE)\parsetok.h \
-	 $(PY_INCLUDE)\pgenheaders.h $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\token.h \
-	 $(PY_PARSER)\tokenizer.h
-
-pgen.obj: $(PY_INCLUDE)\bitset.h pyconfig.h $(PY_INCLUDE)\grammar.h \
-	 $(PY_INCLUDE)\metagrammar.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\node.h $(PY_PARSER)\pgen.h $(PY_INCLUDE)\pgenheaders.h \
-	 $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\token.h
-
-pgenmain.obj: $(PY_INCLUDE)\bitset.h pyconfig.h $(PY_INCLUDE)\grammar.h \
-	 $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\node.h \
-	 $(PY_INCLUDE)\parsetok.h $(PY_PARSER)\pgen.h $(PY_INCLUDE)\pgenheaders.h \
-	 $(PY_INCLUDE)\pydebug.h
-
-printgrammar.obj: $(PY_INCLUDE)\bitset.h pyconfig.h $(PY_INCLUDE)\grammar.h \
-	 $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\pgenheaders.h \
-	 $(PY_INCLUDE)\pydebug.h
-
-tokenizer.obj: pyconfig.h $(PY_INCLUDE)\errcode.h $(PY_INCLUDE)\mymalloc.h \
-	 $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\pgenheaders.h $(PY_INCLUDE)\pydebug.h \
-	 $(PY_INCLUDE)\token.h $(PY_PARSER)\tokenizer.h
-
-atof.obj: pyconfig.h
-
-bltinmodule.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
-	 $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\compile.h \
-	 $(PY_INCLUDE)\complexobject.h pyconfig.h $(PY_INCLUDE)\dictobject.h \
-	 $(PY_INCLUDE)\eval.h $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h \
-	 $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h $(PY_INCLUDE)\intobject.h \
-	 $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\mymath.h \
-	 $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\node.h $(PY_INCLUDE)\object.h \
-	 $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h \
-	 $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h \
-	 $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
-	 $(PY_INCLUDE)\tupleobject.h
-
-ceval.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\compile.h $(PY_INCLUDE)\complexobject.h \
-	 pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\eval.h \
-	 $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h \
-	 $(PY_INCLUDE)\frameobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h \
-	 $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h \
-	 $(PY_INCLUDE)\longobject.h $(PY_INCLUDE)\methodobject.h \
-	 $(PY_INCLUDE)\modsupport.h $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h \
-	 $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h \
-	 $(PY_INCLUDE)\opcode.h $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h \
-	 $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h \
-	 $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
-	 $(PY_INCLUDE)\tupleobject.h
-
-compile.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\compile.h $(PY_INCLUDE)\complexobject.h \
-	 pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
-	 $(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\graminit.h \
-	 $(PY_INCLUDE)\import.h $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h \
-	 $(PY_INCLUDE)\listobject.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\node.h $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h \
-	 $(PY_INCLUDE)\opcode.h $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h \
-	 $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h \
-	 $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\structmember.h \
-	 $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\token.h $(PY_INCLUDE)\traceback.h \
-	 $(PY_INCLUDE)\tupleobject.h
-
-errors.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h pyconfig.h \
-	 $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h \
-	 $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h $(PY_INCLUDE)\intobject.h \
-	 $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\pydebug.h \
-	 $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h \
-	 $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h \
-	 $(PY_INCLUDE)\sliceobject.h $(PY_INCLUDE)\stringobject.h \
-	 $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
-
-fmod.obj: pyconfig.h $(PY_INCLUDE)\mymath.h
-
-frozen.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h pyconfig.h \
-	 $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h \
-	 $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h $(PY_INCLUDE)\intobject.h \
-	 $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\pydebug.h \
-	 $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h \
-	 $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h \
-	 $(PY_INCLUDE)\sliceobject.h $(PY_INCLUDE)\stringobject.h \
-	 $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
-
-frozenmain.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h pyconfig.h \
-	 $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h \
-	 $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h $(PY_INCLUDE)\intobject.h \
-	 $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\pydebug.h \
-	 $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h \
-	 $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h \
-	 $(PY_INCLUDE)\sliceobject.h $(PY_INCLUDE)\stringobject.h \
-	 $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
-
-getargs.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h pyconfig.h \
-	 $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h \
-	 $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h $(PY_INCLUDE)\intobject.h \
-	 $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\pydebug.h \
-	 $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h \
-	 $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h \
-	 $(PY_INCLUDE)\sliceobject.h $(PY_INCLUDE)\stringobject.h \
-	 $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
-
-getcompiler.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
-	 $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \
-	 pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
-	 $(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h \
-	 $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h \
-	 $(PY_INCLUDE)\longobject.h $(PY_INCLUDE)\methodobject.h \
-	 $(PY_INCLUDE)\modsupport.h $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h \
-	 $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h \
-	 $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h \
-	 $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h \
-	 $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
-	 $(PY_INCLUDE)\tupleobject.h
-
-getcopyright.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
-	 $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \
-	 pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
-	 $(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h \
-	 $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h \
-	 $(PY_INCLUDE)\longobject.h $(PY_INCLUDE)\methodobject.h \
-	 $(PY_INCLUDE)\modsupport.h $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h \
-	 $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h \
-	 $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h \
-	 $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h \
-	 $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
-	 $(PY_INCLUDE)\tupleobject.h
-
-getplatform.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
-	 $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \
-	 pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
-	 $(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h \
-	 $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h \
-	 $(PY_INCLUDE)\longobject.h $(PY_INCLUDE)\methodobject.h \
-	 $(PY_INCLUDE)\modsupport.h $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h \
-	 $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h \
-	 $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h \
-	 $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h \
-	 $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
-	 $(PY_INCLUDE)\tupleobject.h
-
-getversion.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h pyconfig.h \
-	 $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h \
-	 $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h $(PY_INCLUDE)\intobject.h \
-	 $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\patchlevel.h \
-	 $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h \
-	 $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h \
-	 $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
-	 $(PY_INCLUDE)\tupleobject.h
-
-graminit.obj: $(PY_INCLUDE)\bitset.h pyconfig.h $(PY_INCLUDE)\grammar.h \
-	 $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\pgenheaders.h \
-	 $(PY_INCLUDE)\pydebug.h
-
-hypot.obj: pyconfig.h $(PY_INCLUDE)\mymath.h $(PY_INCLUDE)\myproto.h
-
-import.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\compile.h $(PY_INCLUDE)\complexobject.h \
-	 pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\errcode.h $(PY_INCLUDE)\eval.h \
-	 $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h \
-	 $(PY_INCLUDE)\import.h $(PY_PYTHON)\importdl.h $(PY_INCLUDE)\intobject.h \
-	 $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\marshal.h $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\node.h $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h \
-	 $(PY_INCLUDE)\osdefs.h $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h \
-	 $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h \
-	 $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\token.h \
-	 $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
-
-importdl.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h pyconfig.h \
-	 $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h \
-	 $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h $(PY_PYTHON)\importdl.h \
-	 $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h \
-	 $(PY_INCLUDE)\longobject.h $(PY_INCLUDE)\methodobject.h \
-	 $(PY_INCLUDE)\modsupport.h $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h \
-	 $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h \
-	 $(PY_INCLUDE)\osdefs.h $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h \
-	 $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h \
-	 $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
-	 $(PY_INCLUDE)\tupleobject.h
-
-marshal.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\compile.h $(PY_INCLUDE)\complexobject.h \
-	 pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
-	 $(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h \
-	 $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h \
-	 $(PY_INCLUDE)\longintrepr.h $(PY_INCLUDE)\longobject.h $(PY_INCLUDE)\marshal.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\pydebug.h \
-	 $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h \
-	 $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h \
-	 $(PY_INCLUDE)\sliceobject.h $(PY_INCLUDE)\stringobject.h \
-	 $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
-
-modsupport.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h pyconfig.h \
-	 $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h \
-	 $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h $(PY_INCLUDE)\intobject.h \
-	 $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\pydebug.h \
-	 $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h \
-	 $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h \
-	 $(PY_INCLUDE)\sliceobject.h $(PY_INCLUDE)\stringobject.h \
-	 $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
-
-mystrtoul.obj: pyconfig.h
-
-pyfpe.obj: pyconfig.h $(PY_INCLUDE)\pyfpe.h
-
-pystate.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h pyconfig.h \
-	 $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h \
-	 $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h $(PY_INCLUDE)\intobject.h \
-	 $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\pydebug.h \
-	 $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h \
-	 $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h \
-	 $(PY_INCLUDE)\sliceobject.h $(PY_INCLUDE)\stringobject.h \
-	 $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
-
-pythonrun.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\bitset.h $(PY_INCLUDE)\ceval.h \
-	 $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\compile.h \
-	 $(PY_INCLUDE)\complexobject.h pyconfig.h $(PY_INCLUDE)\dictobject.h \
-	 $(PY_INCLUDE)\errcode.h $(PY_INCLUDE)\eval.h $(PY_INCLUDE)\fileobject.h \
-	 $(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\grammar.h \
-	 $(PY_INCLUDE)\import.h $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h \
-	 $(PY_INCLUDE)\listobject.h $(PY_INCLUDE)\longobject.h $(PY_INCLUDE)\marshal.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\node.h $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h \
-	 $(PY_INCLUDE)\parsetok.h $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h \
-	 $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h \
-	 $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
-	 $(PY_INCLUDE)\tupleobject.h
-
-sigcheck.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h pyconfig.h \
-	 $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h \
-	 $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h $(PY_INCLUDE)\intobject.h \
-	 $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\pydebug.h \
-	 $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h $(PY_INCLUDE)\pystate.h \
-	 $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h \
-	 $(PY_INCLUDE)\sliceobject.h $(PY_INCLUDE)\stringobject.h \
-	 $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
-
-strdup.obj: pyconfig.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h
-
-strtod.obj: pyconfig.h
-
-structmember.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
-	 $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \
-	 pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
-	 $(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h \
-	 $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h \
-	 $(PY_INCLUDE)\longobject.h $(PY_INCLUDE)\methodobject.h \
-	 $(PY_INCLUDE)\modsupport.h $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h \
-	 $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h \
-	 $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h \
-	 $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h \
-	 $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\structmember.h \
-	 $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
-
-sysmodule.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h pyconfig.h \
-	 $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h \
-	 $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h $(PY_INCLUDE)\intobject.h \
-	 $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\osdefs.h \
-	 $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h \
-	 $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h \
-	 $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
-	 $(PY_INCLUDE)\tupleobject.h
-
-thread.obj: pyconfig.h $(PY_INCLUDE)\thread.h
-
-traceback.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-	 $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\compile.h $(PY_INCLUDE)\complexobject.h \
-	 pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
-	 $(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\frameobject.h \
-	 $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h $(PY_INCLUDE)\intobject.h \
-	 $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h $(PY_INCLUDE)\longobject.h \
-	 $(PY_INCLUDE)\methodobject.h $(PY_INCLUDE)\modsupport.h \
-	 $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
-	 $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h $(PY_INCLUDE)\osdefs.h \
-	 $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h \
-	 $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h \
-	 $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\structmember.h \
-	 $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
diff --git a/PC/os2vacpp/makefile.omk b/PC/os2vacpp/makefile.omk
deleted file mode 100644
index aa12c96..0000000
--- a/PC/os2vacpp/makefile.omk
+++ /dev/null
@@ -1,1047 +0,0 @@
-######################################################################
-#
-#          Top-Level Makefile for Building Python for OS/2
-#
-# This makefile was developed for use with IBM's VisualAge C/C++
-# for OS/2 compiler, version 3.0, with Fixpack 8 applied.  It uses
-# the commercial OpusMAKE tool.
-#
-# The output of the build is a largish Python15.DLL containing the
-# essential modules of Python and a small Python.exe program to start
-# the interpreter.  When embedding Python within another program, only
-# Python15.DLL is needed.
-#
-# These two binaries can be statically linked with the VisualAge C/C++
-# runtime library (producing larger binaries), or dynamically linked
-# to make smaller ones that require the compiler to be installed on
-# any system Python is used on.
-#
-# History (Most Recent First)
-#
-# 20-Nov-97 jrr Cleaned Up for Applying to Distribution
-# 29-Oct-97 jrr Modified for Use with Python 1.5 Alpha 4
-# 03-Aug-96 jrr Original for Use with Python 1.4 Release
-#
-######################################################################
-
-###################
-# Places and Things
-###################
-PY_MODULES      = ..\..\Modules
-PY_OBJECTS      = ..\..\Objects
-PY_PARSER       = ..\..\Parser
-PY_PYTHON       = ..\..\Python
-PY_INCLUDE      = ..\..\Include
-PY_INCLUDES     = .;$(PY_INCLUDE);$(PY_MODULES);$(PY_OBJECTS);$(PY_PARSER);$(PY_PYTHON)
-
-# Where to Find the IBM TCP/IP Socket Includes and Libraries
-OS2TCPIP        = C:\MPTN
-
-# Where to Put the .OBJ Files, To Keep Them Out of the Way
-.PATH.obj	= obj
-
-# Search Path for Include Files
-PROJINCLUDE	= .;$(OS2TCPIP)\Include;$(PY_INCLUDES)
-
-# Place to Search for Sources re OpusMAKE Dependency Generator (Commercial)
-MKMF_SRCS	= $(PY_MODULES)\*.c $(PY_OBJECTS)\*.c $(PY_PARSER)\*.c $(PY_PYTHON)\*.c
-
-.HDRPATH.c	:= $(PROJINCLUDE,;= ) $(.HDRPATH.c)
-.PATH.c         = .;$(PY_MODULES);$(PY_OBJECTS);$(PY_PARSER);$(PY_PYTHON)
-OTHERLIBS	= $(OS2TCPIP)\lib\so32dll.lib $(OS2TCPIP)\lib\tcp32dll.lib
-
-#################
-# Inference Rules
-#################
-
-
-###################
-# Python Subsystems
-###################
-
-# PYTHON is the central core, containing the builtins and interpreter.
-PYTHON		=                    \
-                  BltinModule.obj    \
-                  CEval.obj          \
-                  Compile.obj        \
-                  Errors.obj         \
-                  Frozen.obj         \
-                  Getargs.obj        \
-                  GetCompiler.obj    \
-                  GetCopyright.obj   \
-                  GetMTime.obj       \
-                  GetOpt.obj         \
-                  GetPlatform.obj    \
-                  GetVersion.obj     \
-                  GramInit.obj       \
-                  Import.obj         \
-                  ImportDL.obj       \
-                  Marshal.obj        \
-                  ModSupport.obj     \
-                  MyStrtoul.obj      \
-                  PyState.obj        \
-                  PythonRun.obj      \
-                  StructMember.obj   \
-                  SysModule.obj      \
-                  Thread.obj         \
-                  TraceBack.obj      \
-                  FrozenMain.obj
-
-# Omitted Python Elements (and Reason):
-  # atof.c          -- Implementation for Platforms w/o This Function
-  # dup2.c          -- Implementation for Platforms w/o This Function
-  # fmod.c          -- Implementation for Platforms w/o This Function
-  # getcwd.c        -- Implementation for Platforms w/o This Function
-  # hypot.c         -- Implementation for Platforms w/o This Function
-  # memmove.c       -- Implementation for Platforms w/o This Function
-  # strdup.c        -- Implementation for Platforms w/o This Function
-  # strerror.c      -- Implementation for Platforms w/o This Function
-  # strtod.c        -- Implementation for Platforms w/o This Function
-
-  # sigcheck.c      -- Primitive Signal Catcher (SignalModule.c Used Instead)
-  # pyfpe.c         -- Primitive FPE Catcher (Not Referenced by Anyone)
-  # frozenmain.c
-
-# Python's Internal Parser
-PARSER		=                   \
-                  Acceler.obj       \
-                  Grammar1.obj      \
-                  MyReadline.obj    \
-                  Node.obj          \
-                  Parser.obj        \
-                  ParseTok.obj      \
-                  Tokenizer.obj
-
-# Python Object Types
-OBJECTS		=                   \
-                  Abstract.obj      \
-                  ClassObject.obj   \
-                  CObject.obj       \
-                  ComplexObject.obj \
-                  DictObject.obj    \
-                  FileObject.obj    \
-                  FloatObject.obj   \
-                  FrameObject.obj   \
-                  FuncObject.obj    \
-                  ListObject.obj    \
-                  LongObject.obj    \
-                  MethodObject.obj  \
-                  ModuleObject.obj  \
-                  Object.obj        \
-                  RangeObject.obj   \
-                  SliceObject.obj   \
-                  StringObject.obj  \
-                  TupleObject.obj   \
-                  TypeObject.obj
-
-# Omitted Objects (and Reason):
-  # xxobject.c      -- Template to Create Your Own Object Types
-
-# Extension Modules (Built-In or as Separate DLLs)
-MODULES		=                   \
-                  ArrayModule.obj   \
-                  BinAscii.obj      \
-                  CMathModule.obj   \
-                  ErrnoModule.obj   \
-                  GetBuildInfo.obj  \
-                  GetPathP.obj      \
-                  Main.obj          \
-                  MathModule.obj    \
-                  MD5c.obj          \
-                  MD5Module.obj     \
-                  Operator.obj      \
-                  PosixModule.obj   \
-                  RegexModule.obj   \
-                  RegExpr.obj       \
-                  ReopModule.obj    \
-                  SelectModule.obj  \
-                  SignalModule.obj  \
-                  SocketModule.obj  \
-                  SoundEx.obj       \
-                  StropModule.obj   \
-                  StructModule.obj  \
-                  TimeModule.obj    \
-                  ThreadModule.obj
-
-# Omitted Modules (and Description/Reason):
-  #
-  # Multimedia:
-  # audioop.c       -- Various Compute Operations on Audio Samples
-
-  # Database:
-  # _dbmmodule.c    -- Wrapper of DBM Database API (Generic Flavor)
-  # _gdbmmodule.c   -- Wrapper of DBM Database API (GNU Flavor)
-
-  # Cryptography:
-  # cryptmodule.c   -- Simple Wrapper for crypt() Function
-
-#                  fcntlmodule.obj   \
-#                  fpectlmodule.obj  \
-#                  fpetestmodule.obj \
-# Unix-Specific    getpath.obj       \
-#                  grpmodule.obj     \
-#                  mpzmodule.obj     \
-#                  nismodule.obj     \
-#                  parsermodule.obj  \
-#                  pwdmodule.obj     \
-#                  readline.obj      \
-#                  resource.obj      \
-#                  syslogmodule.obj  \
-#                  termios.obj       \
-
-  # User Interface:
-#                  _tkinter.obj      \     
-#                  stdwinmodule.obj  \
-#                  cursesmodule.obj  \
-#                  tclNotify.obj     \
-#                  tkappinit.obj     \
-  # flmodule.c      -- Wrapper of FORMS Library (Screen Forms)
-
-  # zlibmodule.c    -- Wrapper of ZLib Compression API (GZip Format)
-  # puremodule.c    -- Wrapper of Purify Debugging API (Probably Non-OS/2)
-  # xxmodule.c      -- Template to Create Your Own Module
-
-#
-# Standalone Parser Generator Program (Shares Some of Python's Modules)
-PGEN            =                   \
-                  PGenMain.obj      \
-                  PGen.obj          \
-                  PrintGrammar.obj  \
-                  ListNode.obj      \
-                  Grammar.obj       \
-                  BitSet.obj        \
-                  FirstSets.obj     \
-                  MetaGrammar.obj
-
-# Omitted Parser Elements (and Reason):
-  # intrcheck.c     -- Not Referenced by Anyone (?)
-
-##################
-# Macros and Flags
-##################
-_BASE		= /Q /W2 /I$(PROJINCLUDE)
-		# /Q   = Omit IBM Copyright
-		# /W2  = Show Warnings/Errors Only
-		# /Fi  = Create Precompiled Headers
-		# /Si  = Utilize Precompiled Headers
-
-_GEN		= /G4 /Gm /Gd /B"/STACK:360000"
-		# /G4  = Generate Code for 486 (Use 386 for Debugger)
-		# /Gm  = Use Multithread Runtime
-		# /Gd  = Dynamically Load Runtime
-		# /Gs  = Remove Code for Stack Probes
-		# /Gx  = Remove C++ Exception-Handling Info
-		# /Tdp = Generate Code for C++ Templates
-		# /Rn  = Generate Code without a Runtime
-		# /B"/STACK:n" = Set Stack Size
-
-_OPT		= /O /Gl
-		# /O   = Enable Speed-Optimizations
-		# /Ol  = Pass Code Thru Intermediate Linker
-		# /Gu  = Advise Linker All Ext Data is ID'd
-		# /Gl  = Have Linker Remove Unused Fns
-
-_DBG		= /DHAVE_CONFIG_H /DUSE_SOCKET
-		# /Ti  = Embed Debugger/Analyzer Recs
-		# /Tm  = Enable Debug Memory Fns
-		# /Tx  = Request Full Dump Upon Exception
-		# /DDEBUG = Enable App-Internal Debugging Code
-                # /DUSE_SOCKET = 
-                # /DUSE_DL_EXPORT = 
-
-_OUT		= 
-		# /Fb  = Embed Browser Recs
-		# /Gh  = Generate Code for Profiler Hooks
-		# /Fl  = Output C/C++ Listing Files
-                # /Lf  = Provide Full (Detailed) Listing Files
-		# /Fm. = Output Linker Map File
-		# /Ft. = Output C++ Template Resolution Files
-
-_MAP		= /FmNoise\$(.TARGET,B,>.map)
-
-_DLL		= /Ge-
-_EXE		= /Ge
-		# /Ge = Create an EXE, not DLL
-
-CFLAGS		= $(_BASE) $(_GEN) $(_OPT) $(_DBG) $(_OUT) $(_EXE) /Ss
-CPPFLAGS	= $(_BASE) $(_GEN) $(_OPT) $(_DBG) $(_OUT) $(_EXE)
-
-###################
-# Primary Target(s)
-###################
-All:  obj noise PyCore.lib Python15.lib Python15.dll Python.exe PGen.exe
-
-##############
-#
-##############
-
-# Object Library of All Essential Python Routines
-PyCore.lib: $(MODULES) $(OBJECTS) $(PARSER) $(PYTHON) Config.obj
-        %do "%.lib"
-
-Python15.dll: Compile.obj PyCore.lib Python.def
-        %do "%.dll" CPPFLAGS+=/B"/NOE" CPPFLAGS+=$(_MAP)
-
-Compile.obj: Compile.c
-        %do ".c.obj" CFLAGS+=$(_DLL)
-
-# Import Library for Using the Python15.dll
-Python15.lib: Python.def
-        %do ".def.lib"
-
-# Small Program to Start Interpreter in Python15.dll
-Python.exe: Python.obj Python15.lib
-        %do "%.exe" CPPFLAGS+=$(_MAP)
-
-#Python.obj: Python.c
-#        %do ".c.obj" CFLAGS+=$(_EXE)
-
-PGen.exe: $(PGEN) PyCore.lib
-        %do "%.exe" CPPFLAGS+=$(_MAP)
-
-#######################
-# Miscellaneous Targets
-#######################
-
-# Remove Intermediate Targets but Leave Executable Binaries
-clean:
-	-- Del /Q $(.PATH.obj)\*.obj		>NUL 2>&1
-	-- Del /Q /Y Noise			>NUL 2>&1
-	-- Del /Q $(ERRS)			>NUL 2>&1
-
-# Remove All Targets, Including Final Binaries
-distclean: clean
-        -- Del /Q PyCore.lib Python15.lib       >NUL 2>&1
-        -- Del /Q Python15.dll Python.exe       >NUL 2>&1
-
-release: Python.exe Python15.dll Python15.lib
-	-- @Echo Y | copy /U $(.SOURCES,M"*.exe") D:\EXEs
-	-- @Echo Y | copy /U $(.SOURCES,M"*.dll") D:\DLLs
-	-- @Echo Y | copy /U $(.SOURCES,M"*.lib") E:\Tau\Lib
-
-test:
-        python ..\..\lib\test\regrtest.py
-
-# Update Dependencies on Targets (Uses OpusMAKE Commercial Product)
-depend:
-	D:\OpusMake\os2mkmf -c -s
-
-### OPUS MKMF:  Do not remove this line!  Generated dependencies follow.
-
-_tkinter.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 object.h objimpl.h pydebug.h pyerrors.h pyfpe.h pystate.h python.h \
-	 pythonrun.h rangeobject.h sliceobject.h stringobject.h sysmodule.h \
-	 traceback.h tupleobject.h
-
-arraymodule.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 object.h objimpl.h pydebug.h pyerrors.h pyfpe.h pystate.h python.h \
-	 pythonrun.h rangeobject.h sliceobject.h stringobject.h sysmodule.h \
-	 traceback.h tupleobject.h
-
-audioop.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h mymath.h \
-	 myproto.h object.h objimpl.h pydebug.h pyerrors.h pyfpe.h \
-	 pystate.h python.h pythonrun.h rangeobject.h sliceobject.h \
-	 stringobject.h sysmodule.h traceback.h tupleobject.h
-
-binascii.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 object.h objimpl.h pydebug.h pyerrors.h pyfpe.h pystate.h python.h \
-	 pythonrun.h rangeobject.h sliceobject.h stringobject.h sysmodule.h \
-	 traceback.h tupleobject.h
-
-cmathmodule.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h mymath.h \
-	 myproto.h object.h objimpl.h pydebug.h pyerrors.h pyfpe.h \
-	 pystate.h python.h pythonrun.h rangeobject.h sliceobject.h \
-	 stringobject.h sysmodule.h traceback.h tupleobject.h
-
-cpickle.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h \
-	 funcobject.h import.h intobject.h intrcheck.h listobject.h \
-	 longobject.h methodobject.h modsupport.h moduleobject.h mymalloc.h \
-	 mymath.h myproto.h object.h objimpl.h pydebug.h pyerrors.h pyfpe.h \
-	 pystate.h python.h pythonrun.h rangeobject.h sliceobject.h \
-	 stringobject.h sysmodule.h traceback.h tupleobject.h
-
-cryptmodule.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 object.h objimpl.h pydebug.h pyerrors.h pyfpe.h pystate.h python.h \
-	 pythonrun.h rangeobject.h sliceobject.h stringobject.h sysmodule.h \
-	 traceback.h tupleobject.h
-
-cursesmodule.obj: abstract.h ceval.h classobject.h cobject.h \
-	 complexobject.h pyconfig.h dictobject.h fileobject.h floatobject.h \
-	 funcobject.h import.h intobject.h intrcheck.h listobject.h \
-	 longobject.h methodobject.h modsupport.h moduleobject.h mymalloc.h \
-	 myproto.h object.h objimpl.h pydebug.h pyerrors.h pyfpe.h \
-	 pystate.h python.h pythonrun.h rangeobject.h sliceobject.h \
-	 stringobject.h sysmodule.h traceback.h tupleobject.h
-
-_dbmmodule.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 object.h objimpl.h pydebug.h pyerrors.h pyfpe.h pystate.h python.h \
-	 pythonrun.h rangeobject.h sliceobject.h stringobject.h sysmodule.h \
-	 traceback.h tupleobject.h
-
-errno.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 object.h objimpl.h pydebug.h pyerrors.h pyfpe.h pystate.h python.h \
-	 pythonrun.h rangeobject.h sliceobject.h stringobject.h sysmodule.h \
-	 traceback.h tupleobject.h
-
-errnomodule.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 object.h objimpl.h pydebug.h pyerrors.h pyfpe.h pystate.h python.h \
-	 pythonrun.h rangeobject.h sliceobject.h stringobject.h sysmodule.h \
-	 traceback.h tupleobject.h
-
-fcntlmodule.obj: abstract.h c:\mptn\include\sys\ioctl.h ceval.h \
-	 classobject.h cobject.h complexobject.h pyconfig.h dictobject.h \
-	 fileobject.h floatobject.h funcobject.h import.h intobject.h \
-	 intrcheck.h listobject.h longobject.h methodobject.h modsupport.h \
-	 moduleobject.h mymalloc.h myproto.h object.h objimpl.h pydebug.h \
-	 pyerrors.h pyfpe.h pystate.h python.h pythonrun.h rangeobject.h \
-	 sliceobject.h stringobject.h sysmodule.h traceback.h tupleobject.h
-
-fpectlmodule.obj: abstract.h ceval.h classobject.h cobject.h \
-	 complexobject.h pyconfig.h dictobject.h fileobject.h floatobject.h \
-	 funcobject.h import.h intobject.h intrcheck.h listobject.h \
-	 longobject.h methodobject.h modsupport.h moduleobject.h mymalloc.h \
-	 myproto.h object.h objimpl.h pydebug.h pyerrors.h pyfpe.h \
-	 pystate.h python.h pythonrun.h rangeobject.h sliceobject.h \
-	 stringobject.h sysmodule.h traceback.h tupleobject.h
-
-fpetestmodule.obj: abstract.h ceval.h classobject.h cobject.h \
-	 complexobject.h pyconfig.h dictobject.h fileobject.h floatobject.h \
-	 funcobject.h import.h intobject.h intrcheck.h listobject.h \
-	 longobject.h methodobject.h modsupport.h moduleobject.h mymalloc.h \
-	 myproto.h object.h objimpl.h pydebug.h pyerrors.h pyfpe.h \
-	 pystate.h python.h pythonrun.h rangeobject.h sliceobject.h \
-	 stringobject.h sysmodule.h traceback.h tupleobject.h
-
-_gdbmmodule.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 object.h objimpl.h pydebug.h pyerrors.h pyfpe.h pystate.h python.h \
-	 pythonrun.h rangeobject.h sliceobject.h stringobject.h sysmodule.h \
-	 traceback.h tupleobject.h
-
-getbuildinfo.obj: pyconfig.h
-
-getpath.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 object.h objimpl.h osdefs.h pydebug.h pyerrors.h pyfpe.h pystate.h \
-	 python.h pythonrun.h rangeobject.h sliceobject.h stringobject.h \
-	 sysmodule.h traceback.h tupleobject.h
-
-grpmodule.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 grp.h import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 object.h objimpl.h pydebug.h pyerrors.h pyfpe.h pystate.h python.h \
-	 pythonrun.h rangeobject.h sliceobject.h stringobject.h sysmodule.h \
-	 traceback.h tupleobject.h
-
-imageop.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 object.h objimpl.h pydebug.h pyerrors.h pyfpe.h pystate.h python.h \
-	 pythonrun.h rangeobject.h sliceobject.h stringobject.h sysmodule.h \
-	 traceback.h tupleobject.h
-
-main.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 object.h objimpl.h pydebug.h pyerrors.h pyfpe.h pystate.h python.h \
-	 pythonrun.h rangeobject.h sliceobject.h stringobject.h sysmodule.h \
-	 traceback.h tupleobject.h
-
-mathmodule.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h mymath.h \
-	 myproto.h object.h objimpl.h pydebug.h pyerrors.h pyfpe.h \
-	 pystate.h python.h pythonrun.h rangeobject.h sliceobject.h \
-	 stringobject.h sysmodule.h traceback.h tupleobject.h
-
-mpzmodule.obj: abstract.h ceval.h classobject.h cobject.h \
-	 complexobject.h pyconfig.h dictobject.h fileobject.h floatobject.h \
-	 funcobject.h import.h intobject.h intrcheck.h listobject.h \
-	 longintrepr.h longobject.h methodobject.h modsupport.h \
-	 moduleobject.h mymalloc.h myproto.h object.h objimpl.h pydebug.h \
-	 pyerrors.h pyfpe.h pystate.h python.h pythonrun.h rangeobject.h \
-	 sliceobject.h stringobject.h sysmodule.h traceback.h tupleobject.h
-
-nismodule.obj: abstract.h c:\mptn\include\sys\time.h ceval.h classobject.h \
-	 cobject.h complexobject.h pyconfig.h dictobject.h fileobject.h \
-	 floatobject.h funcobject.h import.h intobject.h intrcheck.h \
-	 listobject.h longobject.h methodobject.h modsupport.h \
-	 moduleobject.h mymalloc.h myproto.h object.h objimpl.h pydebug.h \
-	 pyerrors.h pyfpe.h pystate.h python.h pythonrun.h rangeobject.h \
-	 sliceobject.h stringobject.h sysmodule.h traceback.h tupleobject.h
-
-operator.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 object.h objimpl.h pydebug.h pyerrors.h pyfpe.h pystate.h python.h \
-	 pythonrun.h rangeobject.h sliceobject.h stringobject.h sysmodule.h \
-	 traceback.h tupleobject.h
-
-parsermodule.obj: abstract.h ceval.h classobject.h cobject.h compile.h \
-	 complexobject.h pyconfig.h dictobject.h fileobject.h floatobject.h \
-	 funcobject.h graminit.h import.h intobject.h intrcheck.h \
-	 listobject.h longobject.h methodobject.h modsupport.h \
-	 moduleobject.h mymalloc.h myproto.h node.h object.h objimpl.h \
-	 pydebug.h pyerrors.h pyfpe.h pystate.h python.h pythonrun.h \
-	 rangeobject.h sliceobject.h stringobject.h sysmodule.h token.h \
-	 traceback.h tupleobject.h
-
-posix.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 mytime.h object.h objimpl.h pydebug.h pyerrors.h pyfpe.h pystate.h \
-	 python.h pythonrun.h rangeobject.h sliceobject.h stringobject.h \
-	 sysmodule.h traceback.h tupleobject.h
-
-posixmodule.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 mytime.h object.h objimpl.h pydebug.h pyerrors.h pyfpe.h pystate.h \
-	 python.h pythonrun.h rangeobject.h sliceobject.h stringobject.h \
-	 sysmodule.h traceback.h tupleobject.h
-
-pwdmodule.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 object.h objimpl.h pwd.h pydebug.h pyerrors.h pyfpe.h pystate.h \
-	 python.h pythonrun.h rangeobject.h sliceobject.h stringobject.h \
-	 sysmodule.h traceback.h tupleobject.h
-
-readline.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 object.h objimpl.h pydebug.h pyerrors.h pyfpe.h pystate.h python.h \
-	 pythonrun.h rangeobject.h sliceobject.h stringobject.h sysmodule.h \
-	 traceback.h tupleobject.h
-
-resource.obj: abstract.h c:\mptn\include\sys\time.h ceval.h classobject.h \
-	 cobject.h complexobject.h pyconfig.h dictobject.h fileobject.h \
-	 floatobject.h funcobject.h import.h intobject.h intrcheck.h \
-	 listobject.h longobject.h methodobject.h modsupport.h \
-	 moduleobject.h mymalloc.h myproto.h object.h objimpl.h pydebug.h \
-	 pyerrors.h pyfpe.h pystate.h python.h pythonrun.h rangeobject.h \
-	 sliceobject.h stringobject.h sysmodule.h traceback.h tupleobject.h
-
-selectmodule.obj: abstract.h ceval.h classobject.h cobject.h \
-	 complexobject.h pyconfig.h dictobject.h fileobject.h floatobject.h \
-	 funcobject.h import.h intobject.h intrcheck.h listobject.h \
-	 longobject.h methodobject.h modsupport.h moduleobject.h mymalloc.h \
-	 myproto.h myselect.h mytime.h object.h objimpl.h pydebug.h \
-	 pyerrors.h pyfpe.h pystate.h python.h pythonrun.h rangeobject.h \
-	 sliceobject.h stringobject.h sysmodule.h traceback.h tupleobject.h
-
-signalmodule.obj: abstract.h ceval.h classobject.h cobject.h \
-	 complexobject.h pyconfig.h dictobject.h fileobject.h floatobject.h \
-	 funcobject.h import.h intobject.h intrcheck.h listobject.h \
-	 longobject.h methodobject.h modsupport.h moduleobject.h mymalloc.h \
-	 myproto.h object.h objimpl.h pydebug.h pyerrors.h pyfpe.h \
-	 pystate.h python.h pythonrun.h rangeobject.h sliceobject.h \
-	 stringobject.h sysmodule.h traceback.h tupleobject.h
-
-socketmodule.obj: abstract.h c:\mptn\include\netinet\in.h \
-	 c:\mptn\include\sys\socket.h ceval.h classobject.h cobject.h \
-	 complexobject.h pyconfig.h dictobject.h fileobject.h floatobject.h \
-	 funcobject.h import.h intobject.h intrcheck.h listobject.h \
-	 longobject.h methodobject.h modsupport.h moduleobject.h mymalloc.h \
-	 myproto.h mytime.h netdb.h object.h objimpl.h pydebug.h pyerrors.h \
-	 pyfpe.h pystate.h python.h pythonrun.h rangeobject.h sliceobject.h \
-	 stringobject.h sysmodule.h traceback.h tupleobject.h
-
-structmodule.obj: abstract.h ceval.h classobject.h cobject.h \
-	 complexobject.h pyconfig.h dictobject.h fileobject.h floatobject.h \
-	 funcobject.h import.h intobject.h intrcheck.h listobject.h \
-	 longobject.h methodobject.h modsupport.h moduleobject.h mymalloc.h \
-	 mymath.h myproto.h object.h objimpl.h pydebug.h pyerrors.h pyfpe.h \
-	 pystate.h python.h pythonrun.h rangeobject.h sliceobject.h \
-	 stringobject.h sysmodule.h traceback.h tupleobject.h
-
-syslogmodule.obj: abstract.h ceval.h classobject.h cobject.h \
-	 complexobject.h pyconfig.h dictobject.h fileobject.h floatobject.h \
-	 funcobject.h import.h intobject.h intrcheck.h listobject.h \
-	 longobject.h methodobject.h modsupport.h moduleobject.h mymalloc.h \
-	 myproto.h object.h objimpl.h pydebug.h pyerrors.h pyfpe.h \
-	 pystate.h python.h pythonrun.h rangeobject.h sliceobject.h \
-	 stringobject.h syslog.h sysmodule.h traceback.h tupleobject.h
-
-termios.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 object.h objimpl.h pydebug.h pyerrors.h pyfpe.h pystate.h python.h \
-	 pythonrun.h rangeobject.h sliceobject.h stringobject.h sysmodule.h \
-	 traceback.h tupleobject.h
-
-_threadmodule.obj: abstract.h ceval.h classobject.h cobject.h \
-	 complexobject.h pyconfig.h dictobject.h fileobject.h floatobject.h \
-	 funcobject.h import.h intobject.h intrcheck.h listobject.h \
-	 longobject.h methodobject.h modsupport.h moduleobject.h mymalloc.h \
-	 myproto.h object.h objimpl.h pydebug.h pyerrors.h pyfpe.h \
-	 pystate.h python.h pythonrun.h rangeobject.h sliceobject.h \
-	 stringobject.h sysmodule.h thread.h traceback.h tupleobject.h
-
-timemodule.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 mytime.h object.h objimpl.h pydebug.h pyerrors.h pyfpe.h pystate.h \
-	 python.h pythonrun.h rangeobject.h sliceobject.h stringobject.h \
-	 sysmodule.h traceback.h tupleobject.h
-
-xxmodule.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 object.h objimpl.h pydebug.h pyerrors.h pyfpe.h pystate.h python.h \
-	 pythonrun.h rangeobject.h sliceobject.h stringobject.h sysmodule.h \
-	 traceback.h tupleobject.h
-
-zlibmodule.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 object.h objimpl.h pydebug.h pyerrors.h pyfpe.h pystate.h python.h \
-	 pythonrun.h rangeobject.h sliceobject.h stringobject.h sysmodule.h \
-	 traceback.h tupleobject.h
-
-abstract.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 object.h objimpl.h pydebug.h pyerrors.h pyfpe.h pystate.h python.h \
-	 pythonrun.h rangeobject.h sliceobject.h stringobject.h sysmodule.h \
-	 traceback.h tupleobject.h
-
-classobject.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 object.h objimpl.h pydebug.h pyerrors.h pyfpe.h pystate.h python.h \
-	 pythonrun.h rangeobject.h sliceobject.h stringobject.h \
-	 structmember.h sysmodule.h traceback.h tupleobject.h
-
-cobject.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 object.h objimpl.h pydebug.h pyerrors.h pyfpe.h pystate.h python.h \
-	 pythonrun.h rangeobject.h sliceobject.h stringobject.h sysmodule.h \
-	 traceback.h tupleobject.h
-
-complexobject.obj: abstract.h ceval.h classobject.h cobject.h \
-	 complexobject.h pyconfig.h dictobject.h fileobject.h floatobject.h \
-	 funcobject.h import.h intobject.h intrcheck.h listobject.h \
-	 longobject.h methodobject.h modsupport.h moduleobject.h mymalloc.h \
-	 mymath.h myproto.h object.h objimpl.h pydebug.h pyerrors.h pyfpe.h \
-	 pystate.h python.h pythonrun.h rangeobject.h sliceobject.h \
-	 stringobject.h sysmodule.h traceback.h tupleobject.h
-
-dictobject.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 object.h objimpl.h pydebug.h pyerrors.h pyfpe.h pystate.h python.h \
-	 pythonrun.h rangeobject.h sliceobject.h stringobject.h sysmodule.h \
-	 traceback.h tupleobject.h
-
-fileobject.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 object.h objimpl.h pydebug.h pyerrors.h pyfpe.h pystate.h python.h \
-	 pythonrun.h rangeobject.h sliceobject.h stringobject.h \
-	 structmember.h sysmodule.h traceback.h tupleobject.h
-
-floatobject.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h mymath.h \
-	 myproto.h object.h objimpl.h pydebug.h pyerrors.h pyfpe.h \
-	 pystate.h python.h pythonrun.h rangeobject.h sliceobject.h \
-	 stringobject.h sysmodule.h traceback.h tupleobject.h
-
-frameobject.obj: abstract.h ceval.h classobject.h cobject.h compile.h \
-	 complexobject.h pyconfig.h dictobject.h fileobject.h floatobject.h \
-	 frameobject.h funcobject.h import.h intobject.h intrcheck.h \
-	 listobject.h longobject.h methodobject.h modsupport.h \
-	 moduleobject.h mymalloc.h myproto.h object.h objimpl.h opcode.h \
-	 pydebug.h pyerrors.h pyfpe.h pystate.h python.h pythonrun.h \
-	 rangeobject.h sliceobject.h stringobject.h structmember.h \
-	 sysmodule.h traceback.h tupleobject.h
-
-funcobject.obj: abstract.h ceval.h classobject.h cobject.h compile.h \
-	 complexobject.h pyconfig.h dictobject.h fileobject.h floatobject.h \
-	 funcobject.h import.h intobject.h intrcheck.h listobject.h \
-	 longobject.h methodobject.h modsupport.h moduleobject.h mymalloc.h \
-	 myproto.h object.h objimpl.h pydebug.h pyerrors.h pyfpe.h \
-	 pystate.h python.h pythonrun.h rangeobject.h sliceobject.h \
-	 stringobject.h structmember.h sysmodule.h traceback.h \
-	 tupleobject.h
-
-listobject.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 object.h objimpl.h pydebug.h pyerrors.h pyfpe.h pystate.h python.h \
-	 pythonrun.h rangeobject.h sliceobject.h stringobject.h sysmodule.h \
-	 traceback.h tupleobject.h
-
-longobject.obj: abstract.h ceval.h classobject.h cobject.h \
-	 complexobject.h pyconfig.h dictobject.h fileobject.h floatobject.h \
-	 funcobject.h import.h intobject.h intrcheck.h listobject.h \
-	 longintrepr.h longobject.h methodobject.h modsupport.h \
-	 moduleobject.h mymalloc.h mymath.h myproto.h object.h objimpl.h \
-	 pydebug.h pyerrors.h pyfpe.h pystate.h python.h pythonrun.h \
-	 rangeobject.h sliceobject.h stringobject.h sysmodule.h traceback.h \
-	 tupleobject.h
-
-methodobject.obj: abstract.h ceval.h classobject.h cobject.h \
-	 complexobject.h pyconfig.h dictobject.h fileobject.h floatobject.h \
-	 funcobject.h import.h intobject.h intrcheck.h listobject.h \
-	 longobject.h methodobject.h modsupport.h moduleobject.h mymalloc.h \
-	 myproto.h object.h objimpl.h pydebug.h pyerrors.h pyfpe.h \
-	 pystate.h python.h pythonrun.h rangeobject.h sliceobject.h \
-	 stringobject.h sysmodule.h token.h traceback.h tupleobject.h
-
-moduleobject.obj: abstract.h ceval.h classobject.h cobject.h \
-	 complexobject.h pyconfig.h dictobject.h fileobject.h floatobject.h \
-	 funcobject.h import.h intobject.h intrcheck.h listobject.h \
-	 longobject.h methodobject.h modsupport.h moduleobject.h mymalloc.h \
-	 myproto.h object.h objimpl.h pydebug.h pyerrors.h pyfpe.h \
-	 pystate.h python.h pythonrun.h rangeobject.h sliceobject.h \
-	 stringobject.h sysmodule.h traceback.h tupleobject.h
-
-object.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 object.h objimpl.h pydebug.h pyerrors.h pyfpe.h pystate.h python.h \
-	 pythonrun.h rangeobject.h sliceobject.h stringobject.h sysmodule.h \
-	 traceback.h tupleobject.h
-
-rangeobject.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 object.h objimpl.h pydebug.h pyerrors.h pyfpe.h pystate.h python.h \
-	 pythonrun.h rangeobject.h sliceobject.h stringobject.h sysmodule.h \
-	 traceback.h tupleobject.h
-
-sliceobject.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 object.h objimpl.h pydebug.h pyerrors.h pyfpe.h pystate.h python.h \
-	 pythonrun.h rangeobject.h sliceobject.h stringobject.h sysmodule.h \
-	 traceback.h tupleobject.h
-
-stringobject.obj: abstract.h ceval.h classobject.h cobject.h \
-	 complexobject.h pyconfig.h dictobject.h fileobject.h floatobject.h \
-	 funcobject.h import.h intobject.h intrcheck.h listobject.h \
-	 longobject.h methodobject.h modsupport.h moduleobject.h mymalloc.h \
-	 mymath.h myproto.h object.h objimpl.h pydebug.h pyerrors.h pyfpe.h \
-	 pystate.h python.h pythonrun.h rangeobject.h sliceobject.h \
-	 stringobject.h sysmodule.h traceback.h tupleobject.h
-
-tupleobject.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 object.h objimpl.h pydebug.h pyerrors.h pyfpe.h pystate.h python.h \
-	 pythonrun.h rangeobject.h sliceobject.h stringobject.h sysmodule.h \
-	 traceback.h tupleobject.h
-
-typeobject.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 object.h objimpl.h pydebug.h pyerrors.h pyfpe.h pystate.h python.h \
-	 pythonrun.h rangeobject.h sliceobject.h stringobject.h sysmodule.h \
-	 traceback.h tupleobject.h
-
-xxobject.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 object.h objimpl.h pydebug.h pyerrors.h pyfpe.h pystate.h python.h \
-	 pythonrun.h rangeobject.h sliceobject.h stringobject.h sysmodule.h \
-	 traceback.h tupleobject.h
-
-acceler.obj: bitset.h pyconfig.h grammar.h mymalloc.h myproto.h node.h \
-	 parser.h pgenheaders.h pydebug.h token.h
-
-bitset.obj: bitset.h pyconfig.h mymalloc.h myproto.h pgenheaders.h pydebug.h
-
-firstsets.obj: bitset.h pyconfig.h grammar.h mymalloc.h myproto.h \
-	 pgenheaders.h pydebug.h token.h
-
-grammar.obj: bitset.h pyconfig.h grammar.h mymalloc.h myproto.h \
-	 pgenheaders.h pydebug.h token.h
-
-grammar1.obj: bitset.h pyconfig.h grammar.h mymalloc.h myproto.h \
-	 pgenheaders.h pydebug.h token.h
-
-intrcheck.obj: pyconfig.h intrcheck.h mymalloc.h myproto.h
-
-listnode.obj: pyconfig.h mymalloc.h myproto.h node.h pgenheaders.h pydebug.h \
-	 token.h
-
-metagrammar.obj: bitset.h pyconfig.h grammar.h metagrammar.h mymalloc.h \
-	 myproto.h pgen.h pgenheaders.h pydebug.h
-
-myreadline.obj: pyconfig.h intrcheck.h mymalloc.h myproto.h
-
-node.obj: pyconfig.h mymalloc.h myproto.h node.h pgenheaders.h pydebug.h
-
-parser.obj: bitset.h pyconfig.h errcode.h grammar.h mymalloc.h \
-	 myproto.h node.h parser.h pgenheaders.h pydebug.h token.h
-
-parsetok.obj: bitset.h pyconfig.h errcode.h grammar.h mymalloc.h myproto.h \
-	 node.h parser.h parsetok.h pgenheaders.h pydebug.h token.h \
-	 tokenizer.h
-
-pgen.obj: bitset.h pyconfig.h grammar.h metagrammar.h mymalloc.h \
-	 myproto.h node.h pgen.h pgenheaders.h pydebug.h token.h
-
-pgenmain.obj: bitset.h pyconfig.h grammar.h mymalloc.h myproto.h node.h \
-	 parsetok.h pgen.h pgenheaders.h pydebug.h
-
-printgrammar.obj: bitset.h pyconfig.h grammar.h mymalloc.h myproto.h \
-	 pgenheaders.h pydebug.h
-
-tokenizer.obj: pyconfig.h errcode.h mymalloc.h myproto.h pgenheaders.h \
-	 pydebug.h token.h tokenizer.h
-
-atof.obj: pyconfig.h
-
-bltinmodule.obj: abstract.h ceval.h classobject.h cobject.h compile.h \
-	 complexobject.h pyconfig.h dictobject.h eval.h fileobject.h \
-	 floatobject.h funcobject.h import.h intobject.h intrcheck.h \
-	 listobject.h longobject.h methodobject.h modsupport.h \
-	 moduleobject.h mymalloc.h mymath.h myproto.h node.h object.h \
-	 objimpl.h pydebug.h pyerrors.h pyfpe.h pystate.h python.h \
-	 pythonrun.h rangeobject.h sliceobject.h stringobject.h sysmodule.h \
-	 traceback.h tupleobject.h
-
-ceval.obj: abstract.h ceval.h classobject.h cobject.h compile.h \
-	 complexobject.h pyconfig.h dictobject.h eval.h fileobject.h \
-	 floatobject.h frameobject.h funcobject.h import.h intobject.h \
-	 intrcheck.h listobject.h longobject.h methodobject.h modsupport.h \
-	 moduleobject.h mymalloc.h myproto.h object.h objimpl.h opcode.h \
-	 pydebug.h pyerrors.h pyfpe.h pystate.h python.h pythonrun.h \
-	 rangeobject.h sliceobject.h stringobject.h sysmodule.h traceback.h \
-	 tupleobject.h
-
-compile.obj: abstract.h ceval.h classobject.h cobject.h compile.h \
-	 complexobject.h pyconfig.h dictobject.h fileobject.h floatobject.h \
-	 funcobject.h graminit.h import.h intobject.h intrcheck.h \
-	 listobject.h longobject.h methodobject.h modsupport.h \
-	 moduleobject.h mymalloc.h myproto.h node.h object.h objimpl.h \
-	 opcode.h pydebug.h pyerrors.h pyfpe.h pystate.h python.h \
-	 pythonrun.h rangeobject.h sliceobject.h stringobject.h \
-	 structmember.h sysmodule.h token.h traceback.h tupleobject.h
-
-errors.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 object.h objimpl.h pydebug.h pyerrors.h pyfpe.h pystate.h python.h \
-	 pythonrun.h rangeobject.h sliceobject.h stringobject.h sysmodule.h \
-	 traceback.h tupleobject.h
-
-fmod.obj: pyconfig.h mymath.h
-
-frozen.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 object.h objimpl.h pydebug.h pyerrors.h pyfpe.h pystate.h python.h \
-	 pythonrun.h rangeobject.h sliceobject.h stringobject.h sysmodule.h \
-	 traceback.h tupleobject.h
-
-frozenmain.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 object.h objimpl.h pydebug.h pyerrors.h pyfpe.h pystate.h python.h \
-	 pythonrun.h rangeobject.h sliceobject.h stringobject.h sysmodule.h \
-	 traceback.h tupleobject.h
-
-getargs.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 object.h objimpl.h pydebug.h pyerrors.h pyfpe.h pystate.h python.h \
-	 pythonrun.h rangeobject.h sliceobject.h stringobject.h sysmodule.h \
-	 traceback.h tupleobject.h
-
-getcompiler.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 object.h objimpl.h pydebug.h pyerrors.h pyfpe.h pystate.h python.h \
-	 pythonrun.h rangeobject.h sliceobject.h stringobject.h sysmodule.h \
-	 traceback.h tupleobject.h
-
-getcopyright.obj: abstract.h ceval.h classobject.h cobject.h \
-	 complexobject.h pyconfig.h dictobject.h fileobject.h floatobject.h \
-	 funcobject.h import.h intobject.h intrcheck.h listobject.h \
-	 longobject.h methodobject.h modsupport.h moduleobject.h mymalloc.h \
-	 myproto.h object.h objimpl.h pydebug.h pyerrors.h pyfpe.h \
-	 pystate.h python.h pythonrun.h rangeobject.h sliceobject.h \
-	 stringobject.h sysmodule.h traceback.h tupleobject.h
-
-getplatform.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 object.h objimpl.h pydebug.h pyerrors.h pyfpe.h pystate.h python.h \
-	 pythonrun.h rangeobject.h sliceobject.h stringobject.h sysmodule.h \
-	 traceback.h tupleobject.h
-
-getversion.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 object.h objimpl.h patchlevel.h pydebug.h pyerrors.h pyfpe.h \
-	 pystate.h python.h pythonrun.h rangeobject.h sliceobject.h \
-	 stringobject.h sysmodule.h traceback.h tupleobject.h
-
-graminit.obj: bitset.h pyconfig.h grammar.h mymalloc.h myproto.h \
-	 pgenheaders.h pydebug.h
-
-hypot.obj: pyconfig.h mymath.h myproto.h
-
-import.obj: abstract.h ceval.h classobject.h cobject.h compile.h \
-	 complexobject.h pyconfig.h dictobject.h errcode.h eval.h \
-	 fileobject.h floatobject.h funcobject.h import.h importdl.h \
-	 intobject.h intrcheck.h listobject.h longobject.h marshal.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 node.h object.h objimpl.h osdefs.h pydebug.h pyerrors.h pyfpe.h \
-	 pystate.h python.h pythonrun.h rangeobject.h sliceobject.h \
-	 stringobject.h sysmodule.h token.h traceback.h tupleobject.h
-
-importdl.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h importdl.h intobject.h intrcheck.h listobject.h \
-	 longobject.h methodobject.h modsupport.h moduleobject.h mymalloc.h \
-	 myproto.h object.h objimpl.h osdefs.h pydebug.h pyerrors.h pyfpe.h \
-	 pystate.h python.h pythonrun.h rangeobject.h sliceobject.h \
-	 stringobject.h sysmodule.h traceback.h tupleobject.h
-
-marshal.obj: abstract.h ceval.h classobject.h cobject.h compile.h \
-	 complexobject.h pyconfig.h dictobject.h fileobject.h floatobject.h \
-	 funcobject.h import.h intobject.h intrcheck.h listobject.h \
-	 longintrepr.h longobject.h marshal.h methodobject.h modsupport.h \
-	 moduleobject.h mymalloc.h myproto.h object.h objimpl.h pydebug.h \
-	 pyerrors.h pyfpe.h pystate.h python.h pythonrun.h rangeobject.h \
-	 sliceobject.h stringobject.h sysmodule.h traceback.h tupleobject.h
-
-modsupport.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 object.h objimpl.h pydebug.h pyerrors.h pyfpe.h pystate.h python.h \
-	 pythonrun.h rangeobject.h sliceobject.h stringobject.h sysmodule.h \
-	 traceback.h tupleobject.h
-
-mystrtoul.obj: pyconfig.h
-
-pyfpe.obj: pyconfig.h pyfpe.h
-
-pystate.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 object.h objimpl.h pydebug.h pyerrors.h pyfpe.h pystate.h python.h \
-	 pythonrun.h rangeobject.h sliceobject.h stringobject.h sysmodule.h \
-	 traceback.h tupleobject.h
-
-pythonrun.obj: abstract.h bitset.h ceval.h classobject.h cobject.h \
-	 compile.h complexobject.h pyconfig.h dictobject.h errcode.h eval.h \
-	 fileobject.h floatobject.h funcobject.h grammar.h import.h \
-	 intobject.h intrcheck.h listobject.h longobject.h marshal.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 node.h object.h objimpl.h parsetok.h pydebug.h pyerrors.h pyfpe.h \
-	 pystate.h python.h pythonrun.h rangeobject.h sliceobject.h \
-	 stringobject.h sysmodule.h traceback.h tupleobject.h
-
-sigcheck.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 object.h objimpl.h pydebug.h pyerrors.h pyfpe.h pystate.h python.h \
-	 pythonrun.h rangeobject.h sliceobject.h stringobject.h sysmodule.h \
-	 traceback.h tupleobject.h
-
-strdup.obj: pyconfig.h mymalloc.h myproto.h
-
-strtod.obj: pyconfig.h
-
-structmember.obj: abstract.h ceval.h classobject.h cobject.h \
-	 complexobject.h pyconfig.h dictobject.h fileobject.h floatobject.h \
-	 funcobject.h import.h intobject.h intrcheck.h listobject.h \
-	 longobject.h methodobject.h modsupport.h moduleobject.h mymalloc.h \
-	 myproto.h object.h objimpl.h pydebug.h pyerrors.h pyfpe.h \
-	 pystate.h python.h pythonrun.h rangeobject.h sliceobject.h \
-	 stringobject.h structmember.h sysmodule.h traceback.h \
-	 tupleobject.h
-
-sysmodule.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
-	 import.h intobject.h intrcheck.h listobject.h longobject.h \
-	 methodobject.h modsupport.h moduleobject.h mymalloc.h myproto.h \
-	 object.h objimpl.h osdefs.h pydebug.h pyerrors.h pyfpe.h pystate.h \
-	 python.h pythonrun.h rangeobject.h sliceobject.h stringobject.h \
-	 sysmodule.h traceback.h tupleobject.h
-
-thread.obj: pyconfig.h thread.h
-
-traceback.obj: abstract.h ceval.h classobject.h cobject.h compile.h \
-	 complexobject.h pyconfig.h dictobject.h fileobject.h floatobject.h \
-	 frameobject.h funcobject.h import.h intobject.h intrcheck.h \
-	 listobject.h longobject.h methodobject.h modsupport.h \
-	 moduleobject.h mymalloc.h myproto.h object.h objimpl.h osdefs.h \
-	 pydebug.h pyerrors.h pyfpe.h pystate.h python.h pythonrun.h \
-	 rangeobject.h sliceobject.h stringobject.h structmember.h \
-	 sysmodule.h traceback.h tupleobject.h
diff --git a/PC/os2vacpp/pyconfig.h b/PC/os2vacpp/pyconfig.h
deleted file mode 100644
index 2765b44..0000000
--- a/PC/os2vacpp/pyconfig.h
+++ /dev/null
@@ -1,212 +0,0 @@
-#ifndef Py_CONFIG_H
-#define Py_CONFIG_H
-
-/**********************************************************************
- * pyconfig.h.  NOT Generated automatically by configure.
- *
- * This is a manually maintained version used for the IBM VisualAge
- * C/C++ compiler on the OS/2 platform.  It is a standard part of
- * the Python distribution.
- *
- * FILESYSTEM DEFINES:
- * The code specific to a particular way of naming files and
- * directory paths should be wrapped around one of the following
- * #defines:
- *
- *     DOSFILESYS   PCDOS-Style (for PCDOS, Windows and OS/2)
- *     MACFILESYS   Macintosh-Style
- *     UNIXFILESYS  Unix-Style
- *     AMIGAFILESYS AmigaDOS-Style
- * 
- * Because of the different compilers and operating systems in
- * use on the Intel platform, neither the compiler name nor
- * the operating system name is sufficient.
- *
- * OS/2 DEFINES:
- * The code specific to OS/2's Program API should be wrapped around
- *
- * __TOS_OS2__   Target Operating System, OS/2
- *
- * Any code specific to the compiler itself should be wrapped with
- *
- * __IBMC__      IBM C Compiler
- * __IBMCPP__    IBM C++ Compiler
- *
- * Note that since the VisualAge C/C++ compiler is also available
- * for the Windows platform, it may be necessary to use both a
- * __TOS_OS2__ and a __IBMC__ to select a very specific environment.
- *
- **********************************************************************/
-
-/*
- * Some systems require special declarations for data items imported
- * or exported from dynamic link libraries.  Note that the definition
- * of DL_IMPORT covers both cases.  Define USE_DL_IMPORT for the client
- * of a DLL.  Define USE_DL_EXPORT when making a DLL.
- */
-
-#include <io.h>
-
-/* Configuration Options for Finding Modules */
-#define PREFIX                 ""
-#define EXEC_PREFIX            ""
-
-/* Provide a default library so writers of extension modules
- * won't have to explicitly specify it anymore
- */
-#pragma library("Python24.lib")
-
-/***************************************************/
-/*    32-Bit IBM VisualAge C/C++ v3.0 for OS/2     */
-/*  (Convert Compiler Flags into Useful Switches)  */
-/***************************************************/
-#define PLATFORM    "os2"
-#define COMPILER    "[VisualAge C/C++]"
-#define PYOS_OS2    /* Define Indicator of Operating System */
-#define PYCC_VACPP  /* Define Indicator of C Compiler */
-
-  /* Platform Filesystem */
-#define PYTHONPATH  ".;.\\lib;.\\lib\\plat-win"
-#define DOSFILESYS  /* OS/2 Uses the DOS File Naming Conventions */
-/* #define IMPORT_8x3_NAMES (let's move up to long filenames) */
-
-  /* Platform CPU-Mode Dependencies */
-#define WORD_BIT                32 /* OS/2 is a 32-Bit Operating System */
-#define LONG_BIT                32
-#define SIZEOF_INT               4 /* Count of Bytes in an (int)            */
-#define SIZEOF_LONG              4 /* Count of Bytes in a (long)            */
-#define SIZEOF_VOID_P            4 /* Count of Bytes in a (void *)          */
-/* #define HAVE_LONG_LONG     1 */ /* VAC++ does not support (long long)    */
-/* #define SIZEOF_LONG_LONG   8 */ /* Count of Bytes in a (long long)       */
-
-/* unicode definines */
-#define PY_UNICODE_TYPE    wchar_t
-#define Py_UNICODE_SIZE SIZEOF_SHORT
-
-/* dynamic loading */
-#define HAVE_DYNAMIC_LOADING 1
-
-/* Define if type char is unsigned and you are not using gcc.  */
-#ifndef __CHAR_UNSIGNED__
-/* #undef __CHAR_UNSIGNED__ */
-#endif
-
-typedef int mode_t;
-typedef int uid_t;
-typedef int gid_t;
-typedef int pid_t;
-
-#if defined(__MULTI__)     /* If Compiler /Gt+ Multithread Option Enabled,  */
-  #define WITH_THREAD            1 /* Enable Threading Throughout Python    */
-  #define OS2_THREADS            1 /* And Use the OS/2 Flavor of Threads    */
-/* #define _REENTRANT 1 */ /* Use thread-safe errno, h_errno, and other fns */
-#endif
-
-  /* Compiler Runtime Library Capabilities */
-#include <ctype.h>
-#include <direct.h>
-/* #undef BAD_STATIC_FORWARD */ /* if compiler botches static fwd decls */
-
-#define STDC_HEADERS             1 /* VAC++ is an ANSI C Compiler           */
-#define HAVE_HYPOT               1 /* hypot()                               */
-#define HAVE_PUTENV              1 /* putenv()                              */
-/* #define VA_LIST_IS_ARRAY   1 */ /* if va_list is an array of some kind   */
-/* #define HAVE_CONIO_H       1 */ /* #include <conio.h>                    */
-#define HAVE_ERRNO_H             1 /* #include <errno.h>                    */
-#define HAVE_SYS_STAT_H          1 /* #include <sys/stat.h>                 */
-#define HAVE_SYS_TYPES_H         1 /* #include <sys/types.h>                */
-
-  /* Variable-Arguments/Prototypes */
-#define HAVE_PROTOTYPES          1 /* VAC++ supports C Function Prototypes  */
-#define HAVE_STDARG_PROTOTYPES   1 /* Our <stdarg.h> has prototypes         */
-
-  /* String/Memory/Locale Operations */
-#define HAVE_MEMMOVE             1 /* memmove()                             */
-#define HAVE_STRERROR            1 /* strerror()                            */
-#define HAVE_SETLOCALE           1 /* setlocale()                           */
-#define MALLOC_ZERO_RETURNS_NULL 1 /* Our malloc(0) returns a NULL ptr      */
-
-  /* Signal Handling */
-#define HAVE_SIGNAL_H            1 /* signal.h                              */
-#define RETSIGTYPE            void /* Return type of handlers (int or void) */
-/* #undef WANT_SIGFPE_HANDLER   */ /* Handle SIGFPE (see Include/pyfpe.h)   */
-/* #define HAVE_ALARM         1 */ /* alarm()                               */
-/* #define HAVE_SIGINTERRUPT  1 */ /* siginterrupt()                        */
-/* #define HAVE_SIGRELSE      1 */ /* sigrelse()                            */
-#define DONT_HAVE_SIG_ALARM      1
-#define DONT_HAVE_SIG_PAUSE      1
-
-  /* Clock/Time Support */
-#define HAVE_FTIME               1 /* We have ftime() in <sys/timeb.h>      */
-#define HAVE_CLOCK               1 /* clock()                               */
-#define HAVE_STRFTIME            1 /* strftime()                            */
-#define HAVE_MKTIME              1 /* mktime()                              */
-#define HAVE_TZNAME              1 /* No tm_zone but do have tzname[]       */
-#define HAVE_TIMES               1 /* #include <sys/times.h>                */
-#define HAVE_SYS_UTIME_H         1 /* #include <sys/utime.h>                */
-/* #define HAVE_UTIME_H       1 */ /* #include <utime.h>                    */
-#define HAVE_SYS_TIME_H          1 /* #include <sys/time.h>                 */
-/* #define TM_IN_SYS_TIME     1 */ /* <sys/time.h> declares struct tm       */
-#define HAVE_GETTIMEOFDAY        1 /* gettimeofday()                        */
-/* #define GETTIMEOFDAY_NO_TZ 1 */ /* gettimeofday() does not have 2nd arg  */
-/* #define HAVE_TIMEGM        1 */ /* timegm()                              */
-#define TIME_WITH_SYS_TIME       1 /* Mix <sys/time.h> and <time.h>         */
-#define SYS_SELECT_WITH_SYS_TIME 1 /* Mix <sys/select.h> and <sys/time.h>   */
-/* #define HAVE_ALTZONE       1 */ /* if <time.h> defines altzone           */
-
-  /* Network/Sockets Support */
-#define HAVE_SYS_SELECT_H       1 /* #include <sys/select.h>                */
-#define BSD_SELECT              1 /* Use BSD versus OS/2 form of select()   */
-#define HAVE_SELECT             1 /* select()                               */
-#define HAVE_GETPEERNAME        1 /* getpeername()                          */
-/* #undef HAVE_GETHOSTNAME_R 1 */ /* gethostname_r()                        */
-
-  /* File I/O */
-#define HAVE_DUP2                1 /* dup2()                                */
-#define HAVE_EXECV               1 /* execv()                               */
-#define HAVE_SETVBUF             1 /* setvbuf()                             */
-#define HAVE_GETCWD              1 /* getcwd()                              */
-#define HAVE_PIPE                1 /* pipe()     [OS/2-specific code added] */
-#define HAVE_IO_H                1 /* #include <io.h>                       */
-#define HAVE_FCNTL_H             1 /* #include <fcntl.h>                    */
-#define HAVE_DIRECT_H            1 /* #include <direct.h>                   */
-/* #define HAVE_FLOCK         1 */ /* flock()                               */
-/* #define HAVE_TRUNCATE      1 */ /* truncate()                            */
-/* #define HAVE_FTRUNCATE     1 */ /* ftruncate()                           */
-/* #define HAVE_LSTAT         1 */ /* lstat()                               */
-/* #define HAVE_DIRENT_H      1 */ /* #include <dirent.h>                   */
-/* #define HAVE_OPENDIR       1 */ /* opendir()                             */
-
-  /* Process Operations */
-#define HAVE_PROCESS_H           1 /* #include <process.h>                  */
-#define HAVE_GETPID              1 /* getpid()                              */
-#define HAVE_SYSTEM              1 /* system()                              */
-#define HAVE_WAIT                1 /* wait()                                */
-#define HAVE_KILL                1 /* kill()     [OS/2-specific code added] */
-#define HAVE_POPEN               1 /* popen()    [OS/2-specific code added] */
-/* #define HAVE_GETPPID       1 */ /* getppid()                             */
-/* #define HAVE_WAITPID       1 */ /* waitpid()                             */
-/* #define HAVE_FORK          1 */ /* fork()                                */
-
-  /* User/Group ID Queries */
-/* #define HAVE_GETEGID       1 */
-/* #define HAVE_GETEUID       1 */
-/* #define HAVE_GETGID        1 */
-/* #define HAVE_GETUID        1 */
-
-  /* Unix-Specific */
-/* #define HAVE_SYS_UN_H            1 /* #include <sys/un.h>                   */
-/* #define HAVE_SYS_UTSNAME_H 1 */ /* #include <sys/utsname.h>              */
-/* #define HAVE_SYS_WAIT_H    1 */ /* #include <sys/wait.h>                 */
-/* #define HAVE_UNISTD_H      1 */ /* #include <unistd.h>                   */
-/* #define HAVE_UNAME         1 */ /* uname ()                              */
-
-/* Define if you want documentation strings in extension modules */
-#define WITH_DOC_STRINGS 1
-
-#ifdef USE_DL_EXPORT
-  #define DL_IMPORT(RTYPE) RTYPE _System
-#endif
-
-#endif /* !Py_CONFIG_H */
-
diff --git a/PC/os2vacpp/python.def b/PC/os2vacpp/python.def
deleted file mode 100644
index a525c2a..0000000
--- a/PC/os2vacpp/python.def
+++ /dev/null
@@ -1,479 +0,0 @@
-LIBRARY        PYTHON24 INITINSTANCE TERMINSTANCE
-DESCRIPTION    'Python 2.4 Core DLL'
-PROTMODE
-DATA           MULTIPLE NONSHARED
-
-EXPORTS
-               ; Data
-               PyCFunction_Type
-               PyCapsule_Type
-               PyCObject_Type
-               PyClass_Type
-               PyCode_Type
-               PyComplex_Type
-               PyDict_Type
-               PyExc_ArithmeticError
-               PyExc_AssertionError
-               PyExc_AttributeError
-               PyExc_EOFError
-               PyExc_EnvironmentError
-               PyExc_Exception
-               PyExc_FloatingPointError
-               PyExc_IOError
-               PyExc_ImportError
-               PyExc_IndexError
-               PyExc_KeyError
-               PyExc_KeyboardInterrupt
-               PyExc_LookupError
-               PyExc_MemoryError
-               PyExc_MemoryErrorInst
-               PyExc_NameError
-               PyExc_OSError
-               PyExc_OverflowError
-               PyExc_RuntimeError
-               PyExc_SyntaxError
-               PyExc_SystemError
-               PyExc_SystemExit
-               PyExc_TypeError
-               PyExc_ValueError
-               PyExc_ZeroDivisionError
-               PyFile_Type
-               PyFloat_Type
-               PyFrame_Type
-               PyFunction_Type
-               PyImport_FrozenModules
-               PyImport_Inittab
-               PyInstance_Type
-               PyInt_Type
-               PyList_Type
-               PyLong_Type
-               PyMethod_Type
-               PyModule_Type
-               PyOS_InputHook
-               PyOS_ReadlineFunctionPointer
-               PyRange_Type
-               PySlice_Type
-               PyString_Type
-               PyTraceBack_Type
-               PyTuple_Type
-               PyType_Type
-               Py_DebugFlag
-               Py_FrozenFlag
-               Py_InteractiveFlag
-               Py_NoSiteFlag
-               Py_OptimizeFlag
-               Py_UseClassExceptionsFlag
-               Py_VerboseFlag
-               _PyImport_Filetab
-               _PyImport_Inittab
-               _PyParser_Grammar
-               _PyParser_TokenNames
-               _Py_EllipsisObject
-               _Py_NoneStruct
-               _Py_PackageContext
-               _Py_TrueStruct
-               _Py_ZeroStruct
-               _Py_abstract_hack
-               _Py_capsule_hack
-               _Py_re_syntax
-               _Py_re_syntax_table
-
-               ; Code
-               PyArg_Parse
-               PyArg_ParseTuple
-               PyArg_ParseTupleAndKeywords
-               PyArg_VaParse
-               PyCFunction_Fini
-               PyCFunction_GetFlags
-               PyCFunction_GetFunction
-               PyCFunction_GetSelf
-               PyCFunction_New
-               PyCapsule_GetContext
-               PyCapsule_GetDestructor
-               PyCapsule_GetName
-               PyCapsule_GetPointer
-               PyCapsule_Import
-               PyCapsule_IsValid
-               PyCapsule_New
-               PyCapsule_SetContext
-               PyCapsule_SetDestructor
-               PyCapsule_SetName
-               PyCapsule_SetPointer
-               PyCObject_AsVoidPtr
-               PyCObject_FromVoidPtrAndDesc
-               PyCObject_FromVoidPtr
-               PyCObject_GetDesc
-               PyCObject_Import
-               PyCallable_Check
-               PyClass_IsSubclass
-               PyClass_New
-               PyCode_Addr2Line
-               PyCode_New
-               PyComplex_AsCComplex
-               PyComplex_FromCComplex
-               PyComplex_FromDoubles
-               PyComplex_ImagAsDouble
-               PyComplex_RealAsDouble
-               PyDict_Clear
-               PyDict_DelItem
-               PyDict_DelItemString
-               PyDict_GetItem
-               PyDict_GetItemString
-               PyDict_Items
-               PyDict_Keys
-               PyDict_New
-               PyDict_Next
-               PyDict_SetItem
-               PyDict_SetItemString
-               PyDict_Size
-               PyDict_Values
-               PyErr_BadArgument
-               PyErr_BadInternalCall
-               PyErr_CheckSignals
-               PyErr_Clear
-               PyErr_ExceptionMatches
-               PyErr_Fetch
-               PyErr_Format
-               PyErr_GivenExceptionMatches
-               PyErr_NewException
-               PyErr_NoMemory
-               PyErr_NormalizeException
-               PyErr_Occurred
-               PyErr_Print
-               PyErr_PrintEx
-               PyErr_Restore
-               PyErr_SetFromErrno
-               PyErr_SetFromErrnoWithFilename
-               PyErr_SetInterrupt
-               PyErr_SetNone
-               PyErr_SetObject
-               PyErr_SetString
-               PyEval_AcquireLock
-               PyEval_AcquireThread
-               PyEval_CallFunction
-               PyEval_CallMethod
-               PyEval_CallObject
-               PyEval_CallObjectWithKeywords
-               PyEval_EvalCode
-               PyEval_GetBuiltins
-               PyEval_GetFrame
-               PyEval_GetGlobals
-               PyEval_GetLocals
-               PyEval_GetRestricted
-               PyEval_InitThreads
-               PyEval_ReleaseLock
-               PyEval_ReleaseThread
-               PyEval_RestoreThread
-               PyEval_SaveThread
-               PyFile_AsFile
-               PyFile_FromFile
-               PyFile_FromString
-               PyFile_GetLine
-               PyFile_Name
-               PyFile_SetBufSize
-               PyFile_SoftSpace
-               PyFile_WriteObject
-               PyFile_WriteString
-               PyFloat_AsDouble
-               PyFloat_AsString
-               PyFloat_Fini
-               PyFloat_FromDouble
-               PyFrame_BlockPop
-               PyFrame_BlockSetup
-               PyFrame_FastToLocals
-               PyFrame_Fini
-               PyFrame_LocalsToFast
-               PyFrame_New
-               PyFunction_GetCode
-               PyFunction_GetDefaults
-               PyFunction_GetGlobals
-               PyFunction_New
-               PyFunction_SetDefaults
-               PyGrammar_AddAccelerators
-               PyGrammar_FindDFA
-               PyGrammar_LabelRepr
-               PyGrammar_RemoveAccelerators
-               PyImport_AddModule
-               PyImport_AppendInittab
-               PyImport_Cleanup
-               PyImport_ExecCodeModule
-               PyImport_ExecCodeModuleEx
-               PyImport_ExtendInittab
-               PyImport_GetMagicNumber
-               PyImport_GetModuleDict
-               PyImport_Import
-               PyImport_ImportFrozenModule
-               PyImport_ImportModule
-               PyImport_ImportModuleEx
-               PyImport_ReloadModule
-               PyInstance_DoBinOp
-               PyInstance_New
-               PyInt_AsLong
-               PyInt_Fini
-               PyInt_FromLong
-               PyInt_GetMax
-               PyInterpreterState_Clear
-               PyInterpreterState_Delete
-               PyInterpreterState_New
-               PyList_Append
-               PyList_AsTuple
-               PyList_GetItem
-               PyList_GetSlice
-               PyList_Insert
-               PyList_New
-               PyList_Reverse
-               PyList_SetItem
-               PyList_SetSlice
-               PyList_Size
-               PyList_Sort
-               PyLong_AsDouble
-               PyLong_AsLong
-;               PyLong_AsLongLong
-               PyLong_AsUnsignedLong
-;               PyLong_AsUnsignedLongLong
-               PyLong_AsVoidPtr
-               PyLong_FromDouble
-               PyLong_FromLong
-;               PyLong_FromLongLong
-               PyLong_FromString
-               PyLong_FromUnsignedLong
-;               PyLong_FromUnsignedLongLong
-               PyLong_FromVoidPtr
-               PyMapping_Check
-               PyMapping_GetItemString
-               PyMapping_HasKey
-               PyMapping_HasKeyString
-               PyMapping_Length
-               PyMapping_SetItemString
-               PyMarshal_Init
-               PyMarshal_ReadLongFromFile
-               PyMarshal_ReadObjectFromFile
-               PyMarshal_ReadObjectFromString
-               PyMarshal_WriteLongToFile
-               PyMarshal_WriteObjectToFile
-               PyMarshal_WriteObjectToString
-               PyMem_Free
-               PyMem_Malloc
-               PyMem_Realloc
-               PyMethod_Class
-               PyMethod_Fini
-               PyMethod_Function
-               PyMethod_New
-               PyMethod_Self
-               PyModule_GetDict
-               PyModule_GetName
-               PyModule_New
-               PyNode_AddChild
-               PyNode_Compile
-               PyNode_Free
-;               PyNode_ListTree
-               PyNode_New
-               PyNumber_Absolute
-               PyNumber_Add
-               PyNumber_And
-               PyNumber_Check
-               PyNumber_Coerce
-               PyNumber_CoerceEx
-               PyNumber_Divide
-               PyNumber_Divmod
-               PyNumber_Float
-               PyNumber_Int
-               PyNumber_Invert
-               PyNumber_Long
-               PyNumber_Lshift
-               PyNumber_Multiply
-               PyNumber_Negative
-               PyNumber_Or
-               PyNumber_Positive
-               PyNumber_Power
-               PyNumber_Remainder
-               PyNumber_Rshift
-               PyNumber_Subtract
-               PyNumber_Xor
-               PyOS_AfterFork
-               PyOS_FiniInterrupts
-               PyOS_InitInterrupts
-               PyOS_InterruptOccurred
-               PyOS_Readline
-               PyOS_StdioReadline
-               PyOS_strtol
-               PyOS_strtoul
-               PyObject_CallFunction
-               PyObject_CallMethod
-               PyObject_CallObject
-               PyObject_Cmp
-               PyObject_Compare
-               PyObject_DelItem
-               PyObject_GetAttr
-               PyObject_GetAttrString
-               PyObject_GetItem
-               PyObject_HasAttr
-               PyObject_HasAttrString
-               PyObject_Hash
-               PyObject_IsTrue
-               PyObject_Length
-               PyObject_Not
-               PyObject_Print
-               PyObject_Repr
-               PyObject_SetAttr
-               PyObject_SetAttrString
-               PyObject_SetItem
-               PyObject_Str
-               PyObject_Type
-               PyParser_AddToken
-               PyParser_Delete
-               PyParser_New
-               PyParser_ParseFile
-               PyParser_ParseString
-               PyParser_SimpleParseFile
-               PyParser_SimpleParseString
-               PyRange_New
-               PyRun_AnyFile
-               PyRun_File
-               PyRun_InteractiveLoop
-               PyRun_InteractiveOne
-               PyRun_SimpleFile
-               PyRun_SimpleString
-               PyRun_String
-               PySequence_Check
-               PySequence_Concat
-               PySequence_Contains
-               PySequence_Count
-               PySequence_DelItem
-               PySequence_DelSlice
-               PySequence_GetItem
-               PySequence_GetSlice
-               PySequence_In
-               PySequence_Index
-               PySequence_Length
-               PySequence_List
-               PySequence_Repeat
-               PySequence_SetItem
-               PySequence_SetSlice
-               PySequence_Tuple
-               PySlice_GetIndices
-               PySlice_New
-               PyString_AsString
-               PyString_Concat
-               PyString_ConcatAndDel
-               PyString_Fini
-               PyString_Format
-               PyString_FromString
-               PyString_FromStringAndSize
-               PyString_InternFromString
-               PyString_InternInPlace
-               PyString_Size
-               PySys_GetFile
-               PySys_GetObject
-               PySys_SetArgv
-               PySys_SetObject
-               PySys_SetPath
-               PySys_WriteStderr
-               PySys_WriteStdout
-               PyThreadState_Clear
-               PyThreadState_Delete
-               PyThreadState_Get
-               PyThreadState_GetDict
-               PyThreadState_New
-               PyThreadState_Swap
-               PyThread_acquire_lock
-               PyThread_allocate_lock
-               PyThread_allocate_sema
-               PyThread_down_sema
-               PyThread_exit_thread
-               PyThread_free_lock
-               PyThread_free_sema
-               PyThread_get_thread_ident
-               PyThread_init_thread
-               PyThread_release_lock
-               PyThread_start_new_thread
-               PyThread_up_sema
-               PyToken_OneChar
-               PyToken_TwoChars
-               PyTokenizer_Free
-               PyTokenizer_FromFile
-               PyTokenizer_FromString
-               PyTokenizer_Get
-               PyTraceBack_Here
-               PyTraceBack_Print
-               PyTuple_Fini
-               PyTuple_GetItem
-               PyTuple_GetSlice
-               PyTuple_New
-               PyTuple_SetItem
-               PyTuple_Size
-               Py_AddPendingCall
-               Py_AtExit
-               Py_BuildValue
-               Py_CompileString
-               Py_EndInterpreter
-               Py_Exit
-               Py_FatalError
-               Py_FdIsInteractive
-               Py_Finalize
-               Py_FindMethod
-               Py_FindMethodInChain
-               Py_FlushLine
-               Py_Free
-               Py_GetArgcArgv
-               Py_GetBuildInfo
-               Py_GetCompiler
-               Py_GetCopyright
-               Py_GetExecPrefix
-               Py_GetPath
-               Py_GetPlatform
-               Py_GetPrefix
-               Py_GetProgramFullPath
-               Py_GetProgramName
-               Py_GetPythonHome
-               Py_GetVersion
-               Py_InitModule4
-               Py_Initialize
-               Py_IsInitialized
-               Py_Main
-               Py_MakePendingCalls
-               Py_Malloc
-               Py_NewInterpreter
-               Py_Realloc
-               Py_ReprEnter
-               Py_ReprLeave
-               Py_SetProgramName
-               Py_SetPythonHome
-               Py_VaBuildValue
-               _PyBuiltin_Fini_1
-               _PyBuiltin_Fini_2
-               _PyBuiltin_Init_1
-               _PyBuiltin_Init_2
-               _PyImport_FindExtension
-               _PyImport_Fini
-               _PyImport_FixupExtension
-               _PyImport_Init
-               _PyImport_LoadDynamicModule
-               _PyLong_New
-               _PyModule_Clear
-               _PyObject_New
-               _PyObject_NewVar
-               _PyString_Resize
-               _PySys_Init
-               _PyTuple_Resize
-               _Py_MD5Final
-               _Py_MD5Init
-               _Py_MD5Update
-;               _Py_addbit
-               _Py_c_diff
-               _Py_c_neg
-               _Py_c_pow
-               _Py_c_prod
-               _Py_c_quot
-               _Py_c_sum
-;               _Py_delbitset
-;               _Py_mergebitset
-;               _Py_meta_grammar
-;               _Py_newbitset
-;               _Py_samebitset
-               PyBuffer_Type
-               PyBuffer_FromObject
-               PyBuffer_FromMemory
-               PyBuffer_FromReadWriteMemory
-               PyBuffer_New
-
diff --git a/PC/os2vacpp/readme.txt b/PC/os2vacpp/readme.txt
deleted file mode 100644
index dc58604..0000000
--- a/PC/os2vacpp/readme.txt
+++ /dev/null
@@ -1,119 +0,0 @@
-IBM VisualAge C/C++ for OS/2
-============================
-
-To build Python for OS/2, change into ./os2vacpp and issue an 'NMAKE'
-command.  This will build a PYTHON15.DLL containing the set of Python
-modules listed in config.c and a small PYTHON.EXE to start the
-interpreter.
-
-By changing the C compiler flag /Gd- in the makefile to /Gd+, you can
-reduce the size of these by causing Python to dynamically link to the
-C runtime DLLs instead of including their bulk in your binaries. 
-However, this means that any system on which you run Python must have
-the VAC++ compiler installed in order to have those DLLs available.
-
-During the build process you may see a couple of harmless warnings:
-
-  From the C Compiler, "No function prototype given for XXX", which
-  comes from the use of K&R parameters within Python for portability.
-
-  From the ILIB librarian, "Module Not Found (XXX)", which comes
-  from its attempt to perform the (-+) operation, which removes and
-  then adds a .OBJ to the library.  The first time a build is done,
-  it obviously cannot remove what is not yet built.
-
-This build includes support for most Python functionality as well as
-TCP/IP sockets.  It omits the Posix ability to 'fork' a process but
-supports threads using OS/2 native capabilities.  I have tried to
-support everything possible but here are a few usage notes.
-
-
--- os.popen() Usage Warnings
-
-With respect to my implementation of popen() under OS/2:
-
-    import os
-
-    fd = os.popen("pkzip.exe -@ junk.zip", 'wb')
-    fd.write("file1.txt\n")
-    fd.write("file2.txt\n")
-    fd.write("file3.txt\n")
-    fd.write("\x1a")  # Should Not Be Necessary But Is
-    fd.close()
-
-There is a bug, either in the VAC++ compiler or OS/2 itself, where the
-simple closure of the write-side of a pipe -to- a process does not
-send an EOF to that process.  I find I must explicitly write a
-control-Z (EOF) before closing the pipe.  This is not a problem when
-using popen() in read mode.
-
-One other slight difference with my popen() is that I return None
-from the close(), instead of the Unix convention of the return code
-of the spawned program.  I could find no easy way to do this under
-OS/2.
-
-
--- BEGINLIBPATH/ENDLIBPATH
-
-With respect to environment variables, this OS/2 port supports the
-special-to-OS/2 magic names of 'BEGINLIBPATH' and 'ENDLIBPATH' to
-control where to load conventional DLLs from.  Those names are
-intercepted and converted to calls on the OS/2 kernel APIs and
-are inherited by child processes, whether Python-based or not.
-
-A few new attributes have been added to the os module:
-
-    os.meminstalled  # Count of Bytes of RAM Installed on Machine
-    os.memkernel     # Count of Bytes of RAM Reserved (Non-Swappable)
-    os.memvirtual    # Count of Bytes of Virtual RAM Possible
-    os.timeslice     # Duration of Scheduler Timeslice, in Milliseconds
-    os.maxpathlen    # Maximum Length of a Path Specification, in chars
-    os.maxnamelen    # Maximum Length of a Single Dir/File Name, in chars
-    os.version       # Version of OS/2 Being Run e.g. "4.00"
-    os.revision      # Revision of OS/2 Being Run (usually zero)
-    os.bootdrive     # Drive that System Booted From e.g. "C:"
-                     # (useful to find the CONFIG.SYS used to boot with)
-
-
--- Using Python as the Default OS/2 Batch Language
-
-Note that OS/2 supports the Unix technique of putting the special
-comment line at the time of scripts e.g. "#!/usr/bin/python" in
-a different syntactic form.  To do this, put your script into a file
-with a .CMD extension and added 'extproc' to the top as follows:
-
-    extproc C:\Python\Python.exe -x
-    import os
-    print "Hello from Python"
-
-The '-x' option tells Python to skip the first line of the file
-while processing the rest as normal Python source.
-
-
--- Suggested Environment Variable Setup
-
-With respect to the environment variables for Python, I use the
-following setup:
-
-    Set PYTHONHOME=E:\Tau\Projects\Python;D:\DLLs
-    Set PYTHONPATH=.;E:\Tau\Projects\Python\Lib; \
-                     E:\Tau\Projects\Python\Lib\plat-win
-
-The EXEC_PREFIX (optional second pathspec on PYTHONHOME) is where
-you put any Python extension DLLs you may create/obtain.  There
-are none provided with this release.
-
-
--- Contact Info
-
-Jeff Rush is no longer supporting the VACPP port :-(
-
-I don't have the VACPP compiler, so can't reliably maintain this port. 
-
-Anyone with VACPP who can contribute patches to keep this port buildable
-should upload them to the Python Patch Manager at Sourceforge and 
-assign them to me for review/checkin.
-
-Andrew MacIntyre
-aimacintyre at users.sourceforge.net
-August 18, 2002.
diff --git a/PC/pyconfig.h b/PC/pyconfig.h
index 0b96539..e1c1988 100644
--- a/PC/pyconfig.h
+++ b/PC/pyconfig.h
@@ -74,8 +74,6 @@
 #define DONT_HAVE_SIG_PAUSE
 #define LONG_BIT	32
 #define WORD_BIT 32
-#define PREFIX ""
-#define EXEC_PREFIX ""
 
 #define MS_WIN32 /* only support win32 and greater. */
 #define MS_WINDOWS
@@ -156,15 +154,9 @@
 #endif /* MS_WIN64 */
 
 /* set the version macros for the windows headers */
-#ifdef MS_WINX64
-/* 64 bit only runs on XP or greater */
+/* Python 3.4+ requires Windows XP or greater */
 #define Py_WINVER 0x0501 /* _WIN32_WINNT_WINXP */
 #define Py_NTDDI NTDDI_WINXP
-#else
-/* Python 2.6+ requires Windows 2000 or greater */
-#define Py_WINVER 0x0500 /* _WIN32_WINNT_WIN2K */
-#define Py_NTDDI NTDDI_WIN2KSP4
-#endif
 
 /* We only set these values when building Python - we don't want to force
    these values on extensions, as that will affect the prototypes and
@@ -199,8 +191,10 @@
 #define HAVE_SSIZE_T 1
 
 #if defined(MS_WIN32) && !defined(MS_WIN64)
-#ifdef _M_IX86
+#if defined(_M_IX86)
 #define COMPILER _Py_PASTE_VERSION("32 bit (Intel)")
+#elif defined(_M_ARM)
+#define COMPILER _Py_PASTE_VERSION("32 bit (ARM)")
 #else
 #define COMPILER _Py_PASTE_VERSION("32 bit (Unknown)")
 #endif
@@ -328,11 +322,11 @@
 			their Makefile (other compilers are generally
 			taken care of by distutils.) */
 #			if defined(_DEBUG)
-#				pragma comment(lib,"python33_d.lib")
+#				pragma comment(lib,"python34_d.lib")
 #			elif defined(Py_LIMITED_API)
 #				pragma comment(lib,"python3.lib")
 #			else
-#				pragma comment(lib,"python33.lib")
+#				pragma comment(lib,"python34.lib")
 #			endif /* _DEBUG */
 #		endif /* _MSC_VER */
 #	endif /* Py_BUILD_CORE */
@@ -396,7 +390,7 @@
 #else
 /* VC6, VS 2002 and eVC4 don't support the C99 LL suffix for 64-bit integer literals */
 #define Py_LL(x) x##I64
-#endif  /* _MSC_VER > 1200  */
+#endif  /* _MSC_VER > 1300  */
 #endif  /* _MSC_VER */
 
 #endif
@@ -442,6 +436,11 @@
 /* Define to 1 if you have the `copysign' function. */
 #define HAVE_COPYSIGN 1
 
+/* Define to 1 if you have the `round' function. */
+#if _MSC_VER >= 1800
+#define HAVE_ROUND 1
+#endif
+
 /* Define to 1 if you have the `isinf' macro. */
 #define HAVE_DECL_ISINF 1
 
@@ -731,6 +730,9 @@
 /* The size of `wchar_t', as computed by sizeof. */
 #define SIZEOF_WCHAR_T 2
 
+/* The size of `pid_t', as computed by sizeof. */
+#define SIZEOF_PID_T SIZEOF_INT
+
 /* Define if you have the dl library (-ldl).  */
 /* #undef HAVE_LIBDL */
 
diff --git a/PC/python.mk b/PC/python.mk
deleted file mode 100644
index a765106..0000000
--- a/PC/python.mk
+++ /dev/null
@@ -1,5 +0,0 @@
-project : n:\python\python-1.5.1\pc\wat_os2\pyth_os2.exe n:\python\python-1.&

-5.1\pc\wat_dos\pyth_dos.exe .SYMBOLIC

-

-!include n:\python\python-1.5.1\pc\wat_os2\pyth_os2.mk1

-!include n:\python\python-1.5.1\pc\wat_dos\pyth_dos.mk1

diff --git a/PC/python3.def b/PC/python3.def
index 966e6c9..37e454b 100644
--- a/PC/python3.def
+++ b/PC/python3.def
@@ -1,699 +1,701 @@
-; When changing this file, run python33gen.py
+; When changing this file, run python34gen.py
 LIBRARY	"python3"
 EXPORTS
-  PyArg_Parse=python33.PyArg_Parse
-  PyArg_ParseTuple=python33.PyArg_ParseTuple
-  PyArg_ParseTupleAndKeywords=python33.PyArg_ParseTupleAndKeywords
-  PyArg_UnpackTuple=python33.PyArg_UnpackTuple
-  PyArg_VaParse=python33.PyArg_VaParse
-  PyArg_VaParseTupleAndKeywords=python33.PyArg_VaParseTupleAndKeywords
-  PyArg_ValidateKeywordArguments=python33.PyArg_ValidateKeywordArguments
-  PyBaseObject_Type=python33.PyBaseObject_Type DATA
-  PyBool_FromLong=python33.PyBool_FromLong
-  PyBool_Type=python33.PyBool_Type DATA
-  PyByteArrayIter_Type=python33.PyByteArrayIter_Type DATA
-  PyByteArray_AsString=python33.PyByteArray_AsString
-  PyByteArray_Concat=python33.PyByteArray_Concat
-  PyByteArray_FromObject=python33.PyByteArray_FromObject
-  PyByteArray_FromStringAndSize=python33.PyByteArray_FromStringAndSize
-  PyByteArray_Resize=python33.PyByteArray_Resize
-  PyByteArray_Size=python33.PyByteArray_Size
-  PyByteArray_Type=python33.PyByteArray_Type DATA
-  PyBytesIter_Type=python33.PyBytesIter_Type DATA
-  PyBytes_AsString=python33.PyBytes_AsString
-  PyBytes_AsStringAndSize=python33.PyBytes_AsStringAndSize
-  PyBytes_Concat=python33.PyBytes_Concat
-  PyBytes_ConcatAndDel=python33.PyBytes_ConcatAndDel
-  PyBytes_DecodeEscape=python33.PyBytes_DecodeEscape
-  PyBytes_FromFormat=python33.PyBytes_FromFormat
-  PyBytes_FromFormatV=python33.PyBytes_FromFormatV
-  PyBytes_FromObject=python33.PyBytes_FromObject
-  PyBytes_FromString=python33.PyBytes_FromString
-  PyBytes_FromStringAndSize=python33.PyBytes_FromStringAndSize
-  PyBytes_Repr=python33.PyBytes_Repr
-  PyBytes_Size=python33.PyBytes_Size
-  PyBytes_Type=python33.PyBytes_Type DATA
-  PyCFunction_Call=python33.PyCFunction_Call
-  PyCFunction_ClearFreeList=python33.PyCFunction_ClearFreeList
-  PyCFunction_GetFlags=python33.PyCFunction_GetFlags
-  PyCFunction_GetFunction=python33.PyCFunction_GetFunction
-  PyCFunction_GetSelf=python33.PyCFunction_GetSelf
-  PyCFunction_NewEx=python33.PyCFunction_NewEx
-  PyCFunction_Type=python33.PyCFunction_Type DATA
-  PyCallIter_New=python33.PyCallIter_New
-  PyCallIter_Type=python33.PyCallIter_Type DATA
-  PyCallable_Check=python33.PyCallable_Check
-  PyCapsule_GetContext=python33.PyCapsule_GetContext
-  PyCapsule_GetDestructor=python33.PyCapsule_GetDestructor
-  PyCapsule_GetName=python33.PyCapsule_GetName
-  PyCapsule_GetPointer=python33.PyCapsule_GetPointer
-  PyCapsule_Import=python33.PyCapsule_Import
-  PyCapsule_IsValid=python33.PyCapsule_IsValid
-  PyCapsule_New=python33.PyCapsule_New
-  PyCapsule_SetContext=python33.PyCapsule_SetContext
-  PyCapsule_SetDestructor=python33.PyCapsule_SetDestructor
-  PyCapsule_SetName=python33.PyCapsule_SetName
-  PyCapsule_SetPointer=python33.PyCapsule_SetPointer
-  PyCapsule_Type=python33.PyCapsule_Type DATA
-  PyClassMethodDescr_Type=python33.PyClassMethodDescr_Type DATA
-  PyCodec_BackslashReplaceErrors=python33.PyCodec_BackslashReplaceErrors
-  PyCodec_Decode=python33.PyCodec_Decode
-  PyCodec_Decoder=python33.PyCodec_Decoder
-  PyCodec_Encode=python33.PyCodec_Encode
-  PyCodec_Encoder=python33.PyCodec_Encoder
-  PyCodec_IgnoreErrors=python33.PyCodec_IgnoreErrors
-  PyCodec_IncrementalDecoder=python33.PyCodec_IncrementalDecoder
-  PyCodec_IncrementalEncoder=python33.PyCodec_IncrementalEncoder
-  PyCodec_KnownEncoding=python33.PyCodec_KnownEncoding
-  PyCodec_LookupError=python33.PyCodec_LookupError
-  PyCodec_Register=python33.PyCodec_Register
-  PyCodec_RegisterError=python33.PyCodec_RegisterError
-  PyCodec_ReplaceErrors=python33.PyCodec_ReplaceErrors
-  PyCodec_StreamReader=python33.PyCodec_StreamReader
-  PyCodec_StreamWriter=python33.PyCodec_StreamWriter
-  PyCodec_StrictErrors=python33.PyCodec_StrictErrors
-  PyCodec_XMLCharRefReplaceErrors=python33.PyCodec_XMLCharRefReplaceErrors
-  PyComplex_FromDoubles=python33.PyComplex_FromDoubles
-  PyComplex_ImagAsDouble=python33.PyComplex_ImagAsDouble
-  PyComplex_RealAsDouble=python33.PyComplex_RealAsDouble
-  PyComplex_Type=python33.PyComplex_Type DATA
-  PyDescr_NewClassMethod=python33.PyDescr_NewClassMethod
-  PyDescr_NewGetSet=python33.PyDescr_NewGetSet
-  PyDescr_NewMember=python33.PyDescr_NewMember
-  PyDescr_NewMethod=python33.PyDescr_NewMethod
-  PyDictItems_Type=python33.PyDictItems_Type DATA
-  PyDictIterItem_Type=python33.PyDictIterItem_Type DATA
-  PyDictIterKey_Type=python33.PyDictIterKey_Type DATA
-  PyDictIterValue_Type=python33.PyDictIterValue_Type DATA
-  PyDictKeys_Type=python33.PyDictKeys_Type DATA
-  PyDictProxy_New=python33.PyDictProxy_New
-  PyDictProxy_Type=python33.PyDictProxy_Type DATA
-  PyDictValues_Type=python33.PyDictValues_Type DATA
-  PyDict_Clear=python33.PyDict_Clear
-  PyDict_Contains=python33.PyDict_Contains
-  PyDict_Copy=python33.PyDict_Copy
-  PyDict_DelItem=python33.PyDict_DelItem
-  PyDict_DelItemString=python33.PyDict_DelItemString
-  PyDict_GetItem=python33.PyDict_GetItem
-  PyDict_GetItemString=python33.PyDict_GetItemString
-  PyDict_GetItemWithError=python33.PyDict_GetItemWithError
-  PyDict_Items=python33.PyDict_Items
-  PyDict_Keys=python33.PyDict_Keys
-  PyDict_Merge=python33.PyDict_Merge
-  PyDict_MergeFromSeq2=python33.PyDict_MergeFromSeq2
-  PyDict_New=python33.PyDict_New
-  PyDict_Next=python33.PyDict_Next
-  PyDict_SetItem=python33.PyDict_SetItem
-  PyDict_SetItemString=python33.PyDict_SetItemString
-  PyDict_Size=python33.PyDict_Size
-  PyDict_Type=python33.PyDict_Type DATA
-  PyDict_Update=python33.PyDict_Update
-  PyDict_Values=python33.PyDict_Values
-  PyEllipsis_Type=python33.PyEllipsis_Type DATA
-  PyEnum_Type=python33.PyEnum_Type DATA
-  PyErr_BadArgument=python33.PyErr_BadArgument
-  PyErr_BadInternalCall=python33.PyErr_BadInternalCall
-  PyErr_CheckSignals=python33.PyErr_CheckSignals
-  PyErr_Clear=python33.PyErr_Clear
-  PyErr_Display=python33.PyErr_Display
-  PyErr_ExceptionMatches=python33.PyErr_ExceptionMatches
-  PyErr_Fetch=python33.PyErr_Fetch
-  PyErr_Format=python33.PyErr_Format
-  PyErr_GivenExceptionMatches=python33.PyErr_GivenExceptionMatches
-  PyErr_NewException=python33.PyErr_NewException
-  PyErr_NewExceptionWithDoc=python33.PyErr_NewExceptionWithDoc
-  PyErr_NoMemory=python33.PyErr_NoMemory
-  PyErr_NormalizeException=python33.PyErr_NormalizeException
-  PyErr_Occurred=python33.PyErr_Occurred
-  PyErr_Print=python33.PyErr_Print
-  PyErr_PrintEx=python33.PyErr_PrintEx
-  PyErr_ProgramText=python33.PyErr_ProgramText
-  PyErr_Restore=python33.PyErr_Restore
-  PyErr_SetFromErrno=python33.PyErr_SetFromErrno
-  PyErr_SetFromErrnoWithFilename=python33.PyErr_SetFromErrnoWithFilename
-  PyErr_SetFromErrnoWithFilenameObject=python33.PyErr_SetFromErrnoWithFilenameObject
-  PyErr_SetInterrupt=python33.PyErr_SetInterrupt
-  PyErr_SetNone=python33.PyErr_SetNone
-  PyErr_SetObject=python33.PyErr_SetObject
-  PyErr_SetString=python33.PyErr_SetString
-  PyErr_SyntaxLocation=python33.PyErr_SyntaxLocation
-  PyErr_WarnEx=python33.PyErr_WarnEx
-  PyErr_WarnExplicit=python33.PyErr_WarnExplicit
-  PyErr_WarnFormat=python33.PyErr_WarnFormat
-  PyErr_WriteUnraisable=python33.PyErr_WriteUnraisable
-  PyEval_AcquireLock=python33.PyEval_AcquireLock
-  PyEval_AcquireThread=python33.PyEval_AcquireThread
-  PyEval_CallFunction=python33.PyEval_CallFunction
-  PyEval_CallMethod=python33.PyEval_CallMethod
-  PyEval_CallObjectWithKeywords=python33.PyEval_CallObjectWithKeywords
-  PyEval_EvalCode=python33.PyEval_EvalCode
-  PyEval_EvalCodeEx=python33.PyEval_EvalCodeEx
-  PyEval_EvalFrame=python33.PyEval_EvalFrame
-  PyEval_EvalFrameEx=python33.PyEval_EvalFrameEx
-  PyEval_GetBuiltins=python33.PyEval_GetBuiltins
-  PyEval_GetCallStats=python33.PyEval_GetCallStats
-  PyEval_GetFrame=python33.PyEval_GetFrame
-  PyEval_GetFuncDesc=python33.PyEval_GetFuncDesc
-  PyEval_GetFuncName=python33.PyEval_GetFuncName
-  PyEval_GetGlobals=python33.PyEval_GetGlobals
-  PyEval_GetLocals=python33.PyEval_GetLocals
-  PyEval_InitThreads=python33.PyEval_InitThreads
-  PyEval_ReInitThreads=python33.PyEval_ReInitThreads
-  PyEval_ReleaseLock=python33.PyEval_ReleaseLock
-  PyEval_ReleaseThread=python33.PyEval_ReleaseThread
-  PyEval_RestoreThread=python33.PyEval_RestoreThread
-  PyEval_SaveThread=python33.PyEval_SaveThread
-  PyEval_ThreadsInitialized=python33.PyEval_ThreadsInitialized
-  PyExc_ArithmeticError=python33.PyExc_ArithmeticError DATA
-  PyExc_AssertionError=python33.PyExc_AssertionError DATA
-  PyExc_AttributeError=python33.PyExc_AttributeError DATA
-  PyExc_BaseException=python33.PyExc_BaseException DATA
-  PyExc_BufferError=python33.PyExc_BufferError DATA
-  PyExc_BytesWarning=python33.PyExc_BytesWarning DATA
-  PyExc_DeprecationWarning=python33.PyExc_DeprecationWarning DATA
-  PyExc_EOFError=python33.PyExc_EOFError DATA
-  PyExc_EnvironmentError=python33.PyExc_EnvironmentError DATA
-  PyExc_Exception=python33.PyExc_Exception DATA
-  PyExc_FloatingPointError=python33.PyExc_FloatingPointError DATA
-  PyExc_FutureWarning=python33.PyExc_FutureWarning DATA
-  PyExc_GeneratorExit=python33.PyExc_GeneratorExit DATA
-  PyExc_IOError=python33.PyExc_IOError DATA
-  PyExc_ImportError=python33.PyExc_ImportError DATA
-  PyExc_ImportWarning=python33.PyExc_ImportWarning DATA
-  PyExc_IndentationError=python33.PyExc_IndentationError DATA
-  PyExc_IndexError=python33.PyExc_IndexError DATA
-  PyExc_KeyError=python33.PyExc_KeyError DATA
-  PyExc_KeyboardInterrupt=python33.PyExc_KeyboardInterrupt DATA
-  PyExc_LookupError=python33.PyExc_LookupError DATA
-  PyExc_MemoryError=python33.PyExc_MemoryError DATA
-  PyExc_MemoryErrorInst=python33.PyExc_MemoryErrorInst DATA
-  PyExc_NameError=python33.PyExc_NameError DATA
-  PyExc_NotImplementedError=python33.PyExc_NotImplementedError DATA
-  PyExc_OSError=python33.PyExc_OSError DATA
-  PyExc_OverflowError=python33.PyExc_OverflowError DATA
-  PyExc_PendingDeprecationWarning=python33.PyExc_PendingDeprecationWarning DATA
-  PyExc_RecursionErrorInst=python33.PyExc_RecursionErrorInst DATA
-  PyExc_ReferenceError=python33.PyExc_ReferenceError DATA
-  PyExc_RuntimeError=python33.PyExc_RuntimeError DATA
-  PyExc_RuntimeWarning=python33.PyExc_RuntimeWarning DATA
-  PyExc_StopIteration=python33.PyExc_StopIteration DATA
-  PyExc_SyntaxError=python33.PyExc_SyntaxError DATA
-  PyExc_SyntaxWarning=python33.PyExc_SyntaxWarning DATA
-  PyExc_SystemError=python33.PyExc_SystemError DATA
-  PyExc_SystemExit=python33.PyExc_SystemExit DATA
-  PyExc_TabError=python33.PyExc_TabError DATA
-  PyExc_TypeError=python33.PyExc_TypeError DATA
-  PyExc_UnboundLocalError=python33.PyExc_UnboundLocalError DATA
-  PyExc_UnicodeDecodeError=python33.PyExc_UnicodeDecodeError DATA
-  PyExc_UnicodeEncodeError=python33.PyExc_UnicodeEncodeError DATA
-  PyExc_UnicodeError=python33.PyExc_UnicodeError DATA
-  PyExc_UnicodeTranslateError=python33.PyExc_UnicodeTranslateError DATA
-  PyExc_UnicodeWarning=python33.PyExc_UnicodeWarning DATA
-  PyExc_UserWarning=python33.PyExc_UserWarning DATA
-  PyExc_ValueError=python33.PyExc_ValueError DATA
-  PyExc_Warning=python33.PyExc_Warning DATA
-  PyExc_ZeroDivisionError=python33.PyExc_ZeroDivisionError DATA
-  PyException_GetCause=python33.PyException_GetCause
-  PyException_GetContext=python33.PyException_GetContext
-  PyException_GetTraceback=python33.PyException_GetTraceback
-  PyException_SetCause=python33.PyException_SetCause
-  PyException_SetContext=python33.PyException_SetContext
-  PyException_SetTraceback=python33.PyException_SetTraceback
-  PyFile_FromFd=python33.PyFile_FromFd
-  PyFile_GetLine=python33.PyFile_GetLine
-  PyFile_WriteObject=python33.PyFile_WriteObject
-  PyFile_WriteString=python33.PyFile_WriteString
-  PyFilter_Type=python33.PyFilter_Type DATA
-  PyFloat_AsDouble=python33.PyFloat_AsDouble
-  PyFloat_FromDouble=python33.PyFloat_FromDouble
-  PyFloat_FromString=python33.PyFloat_FromString
-  PyFloat_GetInfo=python33.PyFloat_GetInfo
-  PyFloat_GetMax=python33.PyFloat_GetMax
-  PyFloat_GetMin=python33.PyFloat_GetMin
-  PyFloat_Type=python33.PyFloat_Type DATA
-  PyFrozenSet_New=python33.PyFrozenSet_New
-  PyFrozenSet_Type=python33.PyFrozenSet_Type DATA
-  PyGC_Collect=python33.PyGC_Collect
-  PyGILState_Ensure=python33.PyGILState_Ensure
-  PyGILState_GetThisThreadState=python33.PyGILState_GetThisThreadState
-  PyGILState_Release=python33.PyGILState_Release
-  PyGetSetDescr_Type=python33.PyGetSetDescr_Type DATA
-  PyImport_AddModule=python33.PyImport_AddModule
-  PyImport_AppendInittab=python33.PyImport_AppendInittab
-  PyImport_Cleanup=python33.PyImport_Cleanup
-  PyImport_ExecCodeModule=python33.PyImport_ExecCodeModule
-  PyImport_ExecCodeModuleEx=python33.PyImport_ExecCodeModuleEx
-  PyImport_ExecCodeModuleWithPathnames=python33.PyImport_ExecCodeModuleWithPathnames
-  PyImport_GetImporter=python33.PyImport_GetImporter
-  PyImport_GetMagicNumber=python33.PyImport_GetMagicNumber
-  PyImport_GetMagicTag=python33.PyImport_GetMagicTag
-  PyImport_GetModuleDict=python33.PyImport_GetModuleDict
-  PyImport_Import=python33.PyImport_Import
-  PyImport_ImportFrozenModule=python33.PyImport_ImportFrozenModule
-  PyImport_ImportModule=python33.PyImport_ImportModule
-  PyImport_ImportModuleLevel=python33.PyImport_ImportModuleLevel
-  PyImport_ImportModuleNoBlock=python33.PyImport_ImportModuleNoBlock
-  PyImport_ReloadModule=python33.PyImport_ReloadModule
-  PyInterpreterState_Clear=python33.PyInterpreterState_Clear
-  PyInterpreterState_Delete=python33.PyInterpreterState_Delete
-  PyInterpreterState_New=python33.PyInterpreterState_New
-  PyIter_Next=python33.PyIter_Next
-  PyListIter_Type=python33.PyListIter_Type DATA
-  PyListRevIter_Type=python33.PyListRevIter_Type DATA
-  PyList_Append=python33.PyList_Append
-  PyList_AsTuple=python33.PyList_AsTuple
-  PyList_GetItem=python33.PyList_GetItem
-  PyList_GetSlice=python33.PyList_GetSlice
-  PyList_Insert=python33.PyList_Insert
-  PyList_New=python33.PyList_New
-  PyList_Reverse=python33.PyList_Reverse
-  PyList_SetItem=python33.PyList_SetItem
-  PyList_SetSlice=python33.PyList_SetSlice
-  PyList_Size=python33.PyList_Size
-  PyList_Sort=python33.PyList_Sort
-  PyList_Type=python33.PyList_Type DATA
-  PyLongRangeIter_Type=python33.PyLongRangeIter_Type DATA
-  PyLong_AsDouble=python33.PyLong_AsDouble
-  PyLong_AsLong=python33.PyLong_AsLong
-  PyLong_AsLongAndOverflow=python33.PyLong_AsLongAndOverflow
-  PyLong_AsLongLong=python33.PyLong_AsLongLong
-  PyLong_AsLongLongAndOverflow=python33.PyLong_AsLongLongAndOverflow
-  PyLong_AsSize_t=python33.PyLong_AsSize_t
-  PyLong_AsSsize_t=python33.PyLong_AsSsize_t
-  PyLong_AsUnsignedLong=python33.PyLong_AsUnsignedLong
-  PyLong_AsUnsignedLongLong=python33.PyLong_AsUnsignedLongLong
-  PyLong_AsUnsignedLongLongMask=python33.PyLong_AsUnsignedLongLongMask
-  PyLong_AsUnsignedLongMask=python33.PyLong_AsUnsignedLongMask
-  PyLong_AsVoidPtr=python33.PyLong_AsVoidPtr
-  PyLong_FromDouble=python33.PyLong_FromDouble
-  PyLong_FromLong=python33.PyLong_FromLong
-  PyLong_FromLongLong=python33.PyLong_FromLongLong
-  PyLong_FromSize_t=python33.PyLong_FromSize_t
-  PyLong_FromSsize_t=python33.PyLong_FromSsize_t
-  PyLong_FromString=python33.PyLong_FromString
-  PyLong_FromUnsignedLong=python33.PyLong_FromUnsignedLong
-  PyLong_FromUnsignedLongLong=python33.PyLong_FromUnsignedLongLong
-  PyLong_FromVoidPtr=python33.PyLong_FromVoidPtr
-  PyLong_GetInfo=python33.PyLong_GetInfo
-  PyLong_Type=python33.PyLong_Type DATA
-  PyMap_Type=python33.PyMap_Type DATA
-  PyMapping_Check=python33.PyMapping_Check
-  PyMapping_GetItemString=python33.PyMapping_GetItemString
-  PyMapping_HasKey=python33.PyMapping_HasKey
-  PyMapping_HasKeyString=python33.PyMapping_HasKeyString
-  PyMapping_Items=python33.PyMapping_Items
-  PyMapping_Keys=python33.PyMapping_Keys
-  PyMapping_Length=python33.PyMapping_Length
-  PyMapping_SetItemString=python33.PyMapping_SetItemString
-  PyMapping_Size=python33.PyMapping_Size
-  PyMapping_Values=python33.PyMapping_Values
-  PyMem_Free=python33.PyMem_Free
-  PyMem_Malloc=python33.PyMem_Malloc
-  PyMem_Realloc=python33.PyMem_Realloc
-  PyMemberDescr_Type=python33.PyMemberDescr_Type DATA
-  PyMemoryView_FromObject=python33.PyMemoryView_FromObject
-  PyMemoryView_GetContiguous=python33.PyMemoryView_GetContiguous
-  PyMemoryView_Type=python33.PyMemoryView_Type DATA
-  PyMethodDescr_Type=python33.PyMethodDescr_Type DATA
-  PyModule_AddIntConstant=python33.PyModule_AddIntConstant
-  PyModule_AddObject=python33.PyModule_AddObject
-  PyModule_AddStringConstant=python33.PyModule_AddStringConstant
-  PyModule_Create2=python33.PyModule_Create2
-  PyModule_GetDef=python33.PyModule_GetDef
-  PyModule_GetDict=python33.PyModule_GetDict
-  PyModule_GetFilename=python33.PyModule_GetFilename
-  PyModule_GetFilenameObject=python33.PyModule_GetFilenameObject
-  PyModule_GetName=python33.PyModule_GetName
-  PyModule_GetState=python33.PyModule_GetState
-  PyModule_New=python33.PyModule_New
-  PyModule_Type=python33.PyModule_Type DATA
-  PyNullImporter_Type=python33.PyNullImporter_Type DATA
-  PyNumber_Absolute=python33.PyNumber_Absolute
-  PyNumber_Add=python33.PyNumber_Add
-  PyNumber_And=python33.PyNumber_And
-  PyNumber_AsSsize_t=python33.PyNumber_AsSsize_t
-  PyNumber_Check=python33.PyNumber_Check
-  PyNumber_Divmod=python33.PyNumber_Divmod
-  PyNumber_Float=python33.PyNumber_Float
-  PyNumber_FloorDivide=python33.PyNumber_FloorDivide
-  PyNumber_InPlaceAdd=python33.PyNumber_InPlaceAdd
-  PyNumber_InPlaceAnd=python33.PyNumber_InPlaceAnd
-  PyNumber_InPlaceFloorDivide=python33.PyNumber_InPlaceFloorDivide
-  PyNumber_InPlaceLshift=python33.PyNumber_InPlaceLshift
-  PyNumber_InPlaceMultiply=python33.PyNumber_InPlaceMultiply
-  PyNumber_InPlaceOr=python33.PyNumber_InPlaceOr
-  PyNumber_InPlacePower=python33.PyNumber_InPlacePower
-  PyNumber_InPlaceRemainder=python33.PyNumber_InPlaceRemainder
-  PyNumber_InPlaceRshift=python33.PyNumber_InPlaceRshift
-  PyNumber_InPlaceSubtract=python33.PyNumber_InPlaceSubtract
-  PyNumber_InPlaceTrueDivide=python33.PyNumber_InPlaceTrueDivide
-  PyNumber_InPlaceXor=python33.PyNumber_InPlaceXor
-  PyNumber_Index=python33.PyNumber_Index
-  PyNumber_Invert=python33.PyNumber_Invert
-  PyNumber_Long=python33.PyNumber_Long
-  PyNumber_Lshift=python33.PyNumber_Lshift
-  PyNumber_Multiply=python33.PyNumber_Multiply
-  PyNumber_Negative=python33.PyNumber_Negative
-  PyNumber_Or=python33.PyNumber_Or
-  PyNumber_Positive=python33.PyNumber_Positive
-  PyNumber_Power=python33.PyNumber_Power
-  PyNumber_Remainder=python33.PyNumber_Remainder
-  PyNumber_Rshift=python33.PyNumber_Rshift
-  PyNumber_Subtract=python33.PyNumber_Subtract
-  PyNumber_ToBase=python33.PyNumber_ToBase
-  PyNumber_TrueDivide=python33.PyNumber_TrueDivide
-  PyNumber_Xor=python33.PyNumber_Xor
-  PyOS_AfterFork=python33.PyOS_AfterFork
-  PyOS_InitInterrupts=python33.PyOS_InitInterrupts
-  PyOS_InputHook=python33.PyOS_InputHook DATA
-  PyOS_InterruptOccurred=python33.PyOS_InterruptOccurred
-  PyOS_ReadlineFunctionPointer=python33.PyOS_ReadlineFunctionPointer DATA
-  PyOS_double_to_string=python33.PyOS_double_to_string
-  PyOS_getsig=python33.PyOS_getsig
-  PyOS_mystricmp=python33.PyOS_mystricmp
-  PyOS_mystrnicmp=python33.PyOS_mystrnicmp
-  PyOS_setsig=python33.PyOS_setsig
-  PyOS_snprintf=python33.PyOS_snprintf
-  PyOS_string_to_double=python33.PyOS_string_to_double
-  PyOS_strtol=python33.PyOS_strtol
-  PyOS_strtoul=python33.PyOS_strtoul
-  PyOS_vsnprintf=python33.PyOS_vsnprintf
-  PyObject_ASCII=python33.PyObject_ASCII
-  PyObject_AsCharBuffer=python33.PyObject_AsCharBuffer
-  PyObject_AsFileDescriptor=python33.PyObject_AsFileDescriptor
-  PyObject_AsReadBuffer=python33.PyObject_AsReadBuffer
-  PyObject_AsWriteBuffer=python33.PyObject_AsWriteBuffer
-  PyObject_Bytes=python33.PyObject_Bytes
-  PyObject_Call=python33.PyObject_Call
-  PyObject_CallFunction=python33.PyObject_CallFunction
-  PyObject_CallFunctionObjArgs=python33.PyObject_CallFunctionObjArgs
-  PyObject_CallMethod=python33.PyObject_CallMethod
-  PyObject_CallMethodObjArgs=python33.PyObject_CallMethodObjArgs
-  PyObject_CallObject=python33.PyObject_CallObject
-  PyObject_CheckReadBuffer=python33.PyObject_CheckReadBuffer
-  PyObject_ClearWeakRefs=python33.PyObject_ClearWeakRefs
-  PyObject_DelItem=python33.PyObject_DelItem
-  PyObject_DelItemString=python33.PyObject_DelItemString
-  PyObject_Dir=python33.PyObject_Dir
-  PyObject_Format=python33.PyObject_Format
-  PyObject_Free=python33.PyObject_Free
-  PyObject_GC_Del=python33.PyObject_GC_Del
-  PyObject_GC_Track=python33.PyObject_GC_Track
-  PyObject_GC_UnTrack=python33.PyObject_GC_UnTrack
-  PyObject_GenericGetAttr=python33.PyObject_GenericGetAttr
-  PyObject_GenericSetAttr=python33.PyObject_GenericSetAttr
-  PyObject_GetAttr=python33.PyObject_GetAttr
-  PyObject_GetAttrString=python33.PyObject_GetAttrString
-  PyObject_GetItem=python33.PyObject_GetItem
-  PyObject_GetIter=python33.PyObject_GetIter
-  PyObject_HasAttr=python33.PyObject_HasAttr
-  PyObject_HasAttrString=python33.PyObject_HasAttrString
-  PyObject_Hash=python33.PyObject_Hash
-  PyObject_HashNotImplemented=python33.PyObject_HashNotImplemented
-  PyObject_Init=python33.PyObject_Init
-  PyObject_InitVar=python33.PyObject_InitVar
-  PyObject_IsInstance=python33.PyObject_IsInstance
-  PyObject_IsSubclass=python33.PyObject_IsSubclass
-  PyObject_IsTrue=python33.PyObject_IsTrue
-  PyObject_Length=python33.PyObject_Length
-  PyObject_Malloc=python33.PyObject_Malloc
-  PyObject_Not=python33.PyObject_Not
-  PyObject_Realloc=python33.PyObject_Realloc
-  PyObject_Repr=python33.PyObject_Repr
-  PyObject_RichCompare=python33.PyObject_RichCompare
-  PyObject_RichCompareBool=python33.PyObject_RichCompareBool
-  PyObject_SelfIter=python33.PyObject_SelfIter
-  PyObject_SetAttr=python33.PyObject_SetAttr
-  PyObject_SetAttrString=python33.PyObject_SetAttrString
-  PyObject_SetItem=python33.PyObject_SetItem
-  PyObject_Size=python33.PyObject_Size
-  PyObject_Str=python33.PyObject_Str
-  PyObject_Type=python33.PyObject_Type DATA
-  PyParser_SimpleParseFileFlags=python33.PyParser_SimpleParseFileFlags
-  PyParser_SimpleParseStringFlags=python33.PyParser_SimpleParseStringFlags
-  PyProperty_Type=python33.PyProperty_Type DATA
-  PyRangeIter_Type=python33.PyRangeIter_Type DATA
-  PyRange_Type=python33.PyRange_Type DATA
-  PyReversed_Type=python33.PyReversed_Type DATA
-  PySeqIter_New=python33.PySeqIter_New
-  PySeqIter_Type=python33.PySeqIter_Type DATA
-  PySequence_Check=python33.PySequence_Check
-  PySequence_Concat=python33.PySequence_Concat
-  PySequence_Contains=python33.PySequence_Contains
-  PySequence_Count=python33.PySequence_Count
-  PySequence_DelItem=python33.PySequence_DelItem
-  PySequence_DelSlice=python33.PySequence_DelSlice
-  PySequence_Fast=python33.PySequence_Fast
-  PySequence_GetItem=python33.PySequence_GetItem
-  PySequence_GetSlice=python33.PySequence_GetSlice
-  PySequence_In=python33.PySequence_In
-  PySequence_InPlaceConcat=python33.PySequence_InPlaceConcat
-  PySequence_InPlaceRepeat=python33.PySequence_InPlaceRepeat
-  PySequence_Index=python33.PySequence_Index
-  PySequence_Length=python33.PySequence_Length
-  PySequence_List=python33.PySequence_List
-  PySequence_Repeat=python33.PySequence_Repeat
-  PySequence_SetItem=python33.PySequence_SetItem
-  PySequence_SetSlice=python33.PySequence_SetSlice
-  PySequence_Size=python33.PySequence_Size
-  PySequence_Tuple=python33.PySequence_Tuple
-  PySetIter_Type=python33.PySetIter_Type DATA
-  PySet_Add=python33.PySet_Add
-  PySet_Clear=python33.PySet_Clear
-  PySet_Contains=python33.PySet_Contains
-  PySet_Discard=python33.PySet_Discard
-  PySet_New=python33.PySet_New
-  PySet_Pop=python33.PySet_Pop
-  PySet_Size=python33.PySet_Size
-  PySet_Type=python33.PySet_Type DATA
-  PySlice_GetIndices=python33.PySlice_GetIndices
-  PySlice_GetIndicesEx=python33.PySlice_GetIndicesEx
-  PySlice_New=python33.PySlice_New
-  PySlice_Type=python33.PySlice_Type DATA
-  PySortWrapper_Type=python33.PySortWrapper_Type DATA
-  PyState_FindModule=python33.PyState_FindModule
-  PyState_AddModule=python33.PyState_AddModule
-  PyState_RemoveModule=python33.PyState_RemoveModule
-  PyStructSequence_GetItem=python33.PyStructSequence_GetItem
-  PyStructSequence_New=python33.PyStructSequence_New
-  PyStructSequence_NewType=python33.PyStructSequence_NewType
-  PyStructSequence_SetItem=python33.PyStructSequence_SetItem
-  PySuper_Type=python33.PySuper_Type DATA
-  PySys_AddWarnOption=python33.PySys_AddWarnOption
-  PySys_AddWarnOptionUnicode=python33.PySys_AddWarnOptionUnicode
-  PySys_FormatStderr=python33.PySys_FormatStderr
-  PySys_FormatStdout=python33.PySys_FormatStdout
-  PySys_GetObject=python33.PySys_GetObject
-  PySys_HasWarnOptions=python33.PySys_HasWarnOptions
-  PySys_ResetWarnOptions=python33.PySys_ResetWarnOptions
-  PySys_SetArgv=python33.PySys_SetArgv
-  PySys_SetArgvEx=python33.PySys_SetArgvEx
-  PySys_SetObject=python33.PySys_SetObject
-  PySys_SetPath=python33.PySys_SetPath
-  PySys_WriteStderr=python33.PySys_WriteStderr
-  PySys_WriteStdout=python33.PySys_WriteStdout
-  PyThreadState_Clear=python33.PyThreadState_Clear
-  PyThreadState_Delete=python33.PyThreadState_Delete
-  PyThreadState_DeleteCurrent=python33.PyThreadState_DeleteCurrent
-  PyThreadState_Get=python33.PyThreadState_Get
-  PyThreadState_GetDict=python33.PyThreadState_GetDict
-  PyThreadState_New=python33.PyThreadState_New
-  PyThreadState_SetAsyncExc=python33.PyThreadState_SetAsyncExc
-  PyThreadState_Swap=python33.PyThreadState_Swap
-  PyTraceBack_Here=python33.PyTraceBack_Here
-  PyTraceBack_Print=python33.PyTraceBack_Print
-  PyTraceBack_Type=python33.PyTraceBack_Type DATA
-  PyTupleIter_Type=python33.PyTupleIter_Type DATA
-  PyTuple_ClearFreeList=python33.PyTuple_ClearFreeList
-  PyTuple_GetItem=python33.PyTuple_GetItem
-  PyTuple_GetSlice=python33.PyTuple_GetSlice
-  PyTuple_New=python33.PyTuple_New
-  PyTuple_Pack=python33.PyTuple_Pack
-  PyTuple_SetItem=python33.PyTuple_SetItem
-  PyTuple_Size=python33.PyTuple_Size
-  PyTuple_Type=python33.PyTuple_Type DATA
-  PyType_ClearCache=python33.PyType_ClearCache
-  PyType_FromSpec=python33.PyType_FromSpec
-  PyType_FromSpecWithBases=python33.PyType_FromSpecWithBases
-  PyType_GenericAlloc=python33.PyType_GenericAlloc
-  PyType_GenericNew=python33.PyType_GenericNew
-  PyType_GetFlags=python33.PyType_GetFlags
-  PyType_IsSubtype=python33.PyType_IsSubtype
-  PyType_Modified=python33.PyType_Modified
-  PyType_Ready=python33.PyType_Ready
-  PyType_Type=python33.PyType_Type DATA
-  PyUnicodeDecodeError_Create=python33.PyUnicodeDecodeError_Create
-  PyUnicodeDecodeError_GetEncoding=python33.PyUnicodeDecodeError_GetEncoding
-  PyUnicodeDecodeError_GetEnd=python33.PyUnicodeDecodeError_GetEnd
-  PyUnicodeDecodeError_GetObject=python33.PyUnicodeDecodeError_GetObject
-  PyUnicodeDecodeError_GetReason=python33.PyUnicodeDecodeError_GetReason
-  PyUnicodeDecodeError_GetStart=python33.PyUnicodeDecodeError_GetStart
-  PyUnicodeDecodeError_SetEnd=python33.PyUnicodeDecodeError_SetEnd
-  PyUnicodeDecodeError_SetReason=python33.PyUnicodeDecodeError_SetReason
-  PyUnicodeDecodeError_SetStart=python33.PyUnicodeDecodeError_SetStart
-  PyUnicodeEncodeError_GetEncoding=python33.PyUnicodeEncodeError_GetEncoding
-  PyUnicodeEncodeError_GetEnd=python33.PyUnicodeEncodeError_GetEnd
-  PyUnicodeEncodeError_GetObject=python33.PyUnicodeEncodeError_GetObject
-  PyUnicodeEncodeError_GetReason=python33.PyUnicodeEncodeError_GetReason
-  PyUnicodeEncodeError_GetStart=python33.PyUnicodeEncodeError_GetStart
-  PyUnicodeEncodeError_SetEnd=python33.PyUnicodeEncodeError_SetEnd
-  PyUnicodeEncodeError_SetReason=python33.PyUnicodeEncodeError_SetReason
-  PyUnicodeEncodeError_SetStart=python33.PyUnicodeEncodeError_SetStart
-  PyUnicodeIter_Type=python33.PyUnicodeIter_Type DATA
-  PyUnicodeTranslateError_GetEnd=python33.PyUnicodeTranslateError_GetEnd
-  PyUnicodeTranslateError_GetObject=python33.PyUnicodeTranslateError_GetObject
-  PyUnicodeTranslateError_GetReason=python33.PyUnicodeTranslateError_GetReason
-  PyUnicodeTranslateError_GetStart=python33.PyUnicodeTranslateError_GetStart
-  PyUnicodeTranslateError_SetEnd=python33.PyUnicodeTranslateError_SetEnd
-  PyUnicodeTranslateError_SetReason=python33.PyUnicodeTranslateError_SetReason
-  PyUnicodeTranslateError_SetStart=python33.PyUnicodeTranslateError_SetStart
-  PyUnicode_Append=python33.PyUnicode_Append
-  PyUnicode_AppendAndDel=python33.PyUnicode_AppendAndDel
-  PyUnicode_AsASCIIString=python33.PyUnicode_AsASCIIString
-  PyUnicode_AsCharmapString=python33.PyUnicode_AsCharmapString
-  PyUnicode_AsDecodedObject=python33.PyUnicode_AsDecodedObject
-  PyUnicode_AsDecodedUnicode=python33.PyUnicode_AsDecodedUnicode
-  PyUnicode_AsEncodedObject=python33.PyUnicode_AsEncodedObject
-  PyUnicode_AsEncodedString=python33.PyUnicode_AsEncodedString
-  PyUnicode_AsEncodedUnicode=python33.PyUnicode_AsEncodedUnicode
-  PyUnicode_AsLatin1String=python33.PyUnicode_AsLatin1String
-  PyUnicode_AsRawUnicodeEscapeString=python33.PyUnicode_AsRawUnicodeEscapeString
-  PyUnicode_AsUTF16String=python33.PyUnicode_AsUTF16String
-  PyUnicode_AsUTF32String=python33.PyUnicode_AsUTF32String
-  PyUnicode_AsUTF8String=python33.PyUnicode_AsUTF8String
-  PyUnicode_AsUnicodeEscapeString=python33.PyUnicode_AsUnicodeEscapeString
-  PyUnicode_AsWideChar=python33.PyUnicode_AsWideChar
-  PyUnicode_ClearFreelist=python33.PyUnicode_ClearFreelist
-  PyUnicode_Compare=python33.PyUnicode_Compare
-  PyUnicode_Concat=python33.PyUnicode_Concat
-  PyUnicode_Contains=python33.PyUnicode_Contains
-  PyUnicode_Count=python33.PyUnicode_Count
-  PyUnicode_Decode=python33.PyUnicode_Decode
-  PyUnicode_DecodeASCII=python33.PyUnicode_DecodeASCII
-  PyUnicode_DecodeCharmap=python33.PyUnicode_DecodeCharmap
-  PyUnicode_DecodeFSDefault=python33.PyUnicode_DecodeFSDefault
-  PyUnicode_DecodeFSDefaultAndSize=python33.PyUnicode_DecodeFSDefaultAndSize
-  PyUnicode_DecodeLatin1=python33.PyUnicode_DecodeLatin1
-  PyUnicode_DecodeRawUnicodeEscape=python33.PyUnicode_DecodeRawUnicodeEscape
-  PyUnicode_DecodeUTF16=python33.PyUnicode_DecodeUTF16
-  PyUnicode_DecodeUTF16Stateful=python33.PyUnicode_DecodeUTF16Stateful
-  PyUnicode_DecodeUTF32=python33.PyUnicode_DecodeUTF32
-  PyUnicode_DecodeUTF32Stateful=python33.PyUnicode_DecodeUTF32Stateful
-  PyUnicode_DecodeUTF8=python33.PyUnicode_DecodeUTF8
-  PyUnicode_DecodeUTF8Stateful=python33.PyUnicode_DecodeUTF8Stateful
-  PyUnicode_DecodeUnicodeEscape=python33.PyUnicode_DecodeUnicodeEscape
-  PyUnicode_FSConverter=python33.PyUnicode_FSConverter
-  PyUnicode_FSDecoder=python33.PyUnicode_FSDecoder
-  PyUnicode_Find=python33.PyUnicode_Find
-  PyUnicode_Format=python33.PyUnicode_Format
-  PyUnicode_FromEncodedObject=python33.PyUnicode_FromEncodedObject
-  PyUnicode_FromFormat=python33.PyUnicode_FromFormat
-  PyUnicode_FromFormatV=python33.PyUnicode_FromFormatV
-  PyUnicode_FromObject=python33.PyUnicode_FromObject
-  PyUnicode_FromOrdinal=python33.PyUnicode_FromOrdinal
-  PyUnicode_FromString=python33.PyUnicode_FromString
-  PyUnicode_FromStringAndSize=python33.PyUnicode_FromStringAndSize
-  PyUnicode_FromWideChar=python33.PyUnicode_FromWideChar
-  PyUnicode_GetDefaultEncoding=python33.PyUnicode_GetDefaultEncoding
-  PyUnicode_GetSize=python33.PyUnicode_GetSize
-  PyUnicode_IsIdentifier=python33.PyUnicode_IsIdentifier
-  PyUnicode_Join=python33.PyUnicode_Join
-  PyUnicode_Partition=python33.PyUnicode_Partition
-  PyUnicode_RPartition=python33.PyUnicode_RPartition
-  PyUnicode_RSplit=python33.PyUnicode_RSplit
-  PyUnicode_Replace=python33.PyUnicode_Replace
-  PyUnicode_Resize=python33.PyUnicode_Resize
-  PyUnicode_RichCompare=python33.PyUnicode_RichCompare
-  PyUnicode_SetDefaultEncoding=python33.PyUnicode_SetDefaultEncoding
-  PyUnicode_Split=python33.PyUnicode_Split
-  PyUnicode_Splitlines=python33.PyUnicode_Splitlines
-  PyUnicode_Tailmatch=python33.PyUnicode_Tailmatch
-  PyUnicode_Translate=python33.PyUnicode_Translate
-  PyUnicode_BuildEncodingMap=python33.PyUnicode_BuildEncodingMap
-  PyUnicode_CompareWithASCIIString=python33.PyUnicode_CompareWithASCIIString
-  PyUnicode_DecodeUTF7=python33.PyUnicode_DecodeUTF7
-  PyUnicode_DecodeUTF7Stateful=python33.PyUnicode_DecodeUTF7Stateful
-  PyUnicode_EncodeFSDefault=python33.PyUnicode_EncodeFSDefault
-  PyUnicode_InternFromString=python33.PyUnicode_InternFromString
-  PyUnicode_InternImmortal=python33.PyUnicode_InternImmortal
-  PyUnicode_InternInPlace=python33.PyUnicode_InternInPlace
-  PyUnicode_Type=python33.PyUnicode_Type DATA
-  PyWeakref_GetObject=python33.PyWeakref_GetObject DATA
-  PyWeakref_NewProxy=python33.PyWeakref_NewProxy
-  PyWeakref_NewRef=python33.PyWeakref_NewRef
-  PyWrapperDescr_Type=python33.PyWrapperDescr_Type DATA
-  PyWrapper_New=python33.PyWrapper_New
-  PyZip_Type=python33.PyZip_Type DATA
-  Py_AddPendingCall=python33.Py_AddPendingCall
-  Py_AtExit=python33.Py_AtExit
-  Py_BuildValue=python33.Py_BuildValue
-  Py_CompileString=python33.Py_CompileString
-  Py_DecRef=python33.Py_DecRef
-  Py_EndInterpreter=python33.Py_EndInterpreter
-  Py_Exit=python33.Py_Exit
-  Py_FatalError=python33.Py_FatalError
-  Py_FileSystemDefaultEncoding=python33.Py_FileSystemDefaultEncoding DATA
-  Py_Finalize=python33.Py_Finalize
-  Py_GetBuildInfo=python33.Py_GetBuildInfo
-  Py_GetCompiler=python33.Py_GetCompiler
-  Py_GetCopyright=python33.Py_GetCopyright
-  Py_GetExecPrefix=python33.Py_GetExecPrefix
-  Py_GetPath=python33.Py_GetPath
-  Py_GetPlatform=python33.Py_GetPlatform
-  Py_GetPrefix=python33.Py_GetPrefix
-  Py_GetProgramFullPath=python33.Py_GetProgramFullPath
-  Py_GetProgramName=python33.Py_GetProgramName
-  Py_GetPythonHome=python33.Py_GetPythonHome
-  Py_GetRecursionLimit=python33.Py_GetRecursionLimit
-  Py_GetVersion=python33.Py_GetVersion
-  Py_HasFileSystemDefaultEncoding=python33.Py_HasFileSystemDefaultEncoding DATA
-  Py_IncRef=python33.Py_IncRef
-  Py_Initialize=python33.Py_Initialize
-  Py_InitializeEx=python33.Py_InitializeEx
-  Py_IsInitialized=python33.Py_IsInitialized
-  Py_Main=python33.Py_Main
-  Py_MakePendingCalls=python33.Py_MakePendingCalls
-  Py_NewInterpreter=python33.Py_NewInterpreter
-  Py_ReprEnter=python33.Py_ReprEnter
-  Py_ReprLeave=python33.Py_ReprLeave
-  Py_SetProgramName=python33.Py_SetProgramName
-  Py_SetPythonHome=python33.Py_SetPythonHome
-  Py_SetRecursionLimit=python33.Py_SetRecursionLimit
-  Py_SymtableString=python33.Py_SymtableString
-  Py_VaBuildValue=python33.Py_VaBuildValue
-  _PyErr_BadInternalCall=python33._PyErr_BadInternalCall
-  _PyObject_CallFunction_SizeT=python33._PyObject_CallFunction_SizeT
-  _PyObject_CallMethod_SizeT=python33._PyObject_CallMethod_SizeT
-  _PyObject_GC_Malloc=python33._PyObject_GC_Malloc
-  _PyObject_GC_New=python33._PyObject_GC_New
-  _PyObject_GC_NewVar=python33._PyObject_GC_NewVar
-  _PyObject_GC_Resize=python33._PyObject_GC_Resize
-  _PyObject_New=python33._PyObject_New
-  _PyObject_NewVar=python33._PyObject_NewVar
-  _PyState_AddModule=python33._PyState_AddModule
-  _PyThreadState_Init=python33._PyThreadState_Init
-  _PyThreadState_Prealloc=python33._PyThreadState_Prealloc
-  _PyTrash_delete_later=python33._PyTrash_delete_later DATA
-  _PyTrash_delete_nesting=python33._PyTrash_delete_nesting DATA
-  _PyTrash_deposit_object=python33._PyTrash_deposit_object
-  _PyTrash_destroy_chain=python33._PyTrash_destroy_chain
-  _PyWeakref_CallableProxyType=python33._PyWeakref_CallableProxyType DATA
-  _PyWeakref_ProxyType=python33._PyWeakref_ProxyType DATA
-  _PyWeakref_RefType=python33._PyWeakref_RefType DATA
-  _Py_BuildValue_SizeT=python33._Py_BuildValue_SizeT
-  _Py_CheckRecursionLimit=python33._Py_CheckRecursionLimit DATA
-  _Py_CheckRecursiveCall=python33._Py_CheckRecursiveCall
-  _Py_Dealloc=python33._Py_Dealloc
-  _Py_EllipsisObject=python33._Py_EllipsisObject DATA
-  _Py_FalseStruct=python33._Py_FalseStruct DATA
-  _Py_NoneStruct=python33._Py_NoneStruct DATA
-  _Py_NotImplementedStruct=python33._Py_NotImplementedStruct DATA
-  _Py_SwappedOp=python33._Py_SwappedOp DATA
-  _Py_TrueStruct=python33._Py_TrueStruct DATA
-  _Py_VaBuildValue_SizeT=python33._Py_VaBuildValue_SizeT
-  _PyArg_Parse_SizeT=python33._PyArg_Parse_SizeT
-  _PyArg_ParseTuple_SizeT=python33._PyArg_ParseTuple_SizeT
-  _PyArg_ParseTupleAndKeywords_SizeT=python33._PyArg_ParseTupleAndKeywords_SizeT
-  _PyArg_VaParse_SizeT=python33._PyArg_VaParse_SizeT
-  _PyArg_VaParseTupleAndKeywords_SizeT=python33._PyArg_VaParseTupleAndKeywords_SizeT
-  _Py_BuildValue_SizeT=python33._Py_BuildValue_SizeT
+  PyArg_Parse=python34.PyArg_Parse
+  PyArg_ParseTuple=python34.PyArg_ParseTuple
+  PyArg_ParseTupleAndKeywords=python34.PyArg_ParseTupleAndKeywords
+  PyArg_UnpackTuple=python34.PyArg_UnpackTuple
+  PyArg_VaParse=python34.PyArg_VaParse
+  PyArg_VaParseTupleAndKeywords=python34.PyArg_VaParseTupleAndKeywords
+  PyArg_ValidateKeywordArguments=python34.PyArg_ValidateKeywordArguments
+  PyBaseObject_Type=python34.PyBaseObject_Type DATA
+  PyBool_FromLong=python34.PyBool_FromLong
+  PyBool_Type=python34.PyBool_Type DATA
+  PyByteArrayIter_Type=python34.PyByteArrayIter_Type DATA
+  PyByteArray_AsString=python34.PyByteArray_AsString
+  PyByteArray_Concat=python34.PyByteArray_Concat
+  PyByteArray_FromObject=python34.PyByteArray_FromObject
+  PyByteArray_FromStringAndSize=python34.PyByteArray_FromStringAndSize
+  PyByteArray_Resize=python34.PyByteArray_Resize
+  PyByteArray_Size=python34.PyByteArray_Size
+  PyByteArray_Type=python34.PyByteArray_Type DATA
+  PyBytesIter_Type=python34.PyBytesIter_Type DATA
+  PyBytes_AsString=python34.PyBytes_AsString
+  PyBytes_AsStringAndSize=python34.PyBytes_AsStringAndSize
+  PyBytes_Concat=python34.PyBytes_Concat
+  PyBytes_ConcatAndDel=python34.PyBytes_ConcatAndDel
+  PyBytes_DecodeEscape=python34.PyBytes_DecodeEscape
+  PyBytes_FromFormat=python34.PyBytes_FromFormat
+  PyBytes_FromFormatV=python34.PyBytes_FromFormatV
+  PyBytes_FromObject=python34.PyBytes_FromObject
+  PyBytes_FromString=python34.PyBytes_FromString
+  PyBytes_FromStringAndSize=python34.PyBytes_FromStringAndSize
+  PyBytes_Repr=python34.PyBytes_Repr
+  PyBytes_Size=python34.PyBytes_Size
+  PyBytes_Type=python34.PyBytes_Type DATA
+  PyCFunction_Call=python34.PyCFunction_Call
+  PyCFunction_ClearFreeList=python34.PyCFunction_ClearFreeList
+  PyCFunction_GetFlags=python34.PyCFunction_GetFlags
+  PyCFunction_GetFunction=python34.PyCFunction_GetFunction
+  PyCFunction_GetSelf=python34.PyCFunction_GetSelf
+  PyCFunction_New=python34.PyCFunction_New
+  PyCFunction_NewEx=python34.PyCFunction_NewEx
+  PyCFunction_Type=python34.PyCFunction_Type DATA
+  PyCallIter_New=python34.PyCallIter_New
+  PyCallIter_Type=python34.PyCallIter_Type DATA
+  PyCallable_Check=python34.PyCallable_Check
+  PyCapsule_GetContext=python34.PyCapsule_GetContext
+  PyCapsule_GetDestructor=python34.PyCapsule_GetDestructor
+  PyCapsule_GetName=python34.PyCapsule_GetName
+  PyCapsule_GetPointer=python34.PyCapsule_GetPointer
+  PyCapsule_Import=python34.PyCapsule_Import
+  PyCapsule_IsValid=python34.PyCapsule_IsValid
+  PyCapsule_New=python34.PyCapsule_New
+  PyCapsule_SetContext=python34.PyCapsule_SetContext
+  PyCapsule_SetDestructor=python34.PyCapsule_SetDestructor
+  PyCapsule_SetName=python34.PyCapsule_SetName
+  PyCapsule_SetPointer=python34.PyCapsule_SetPointer
+  PyCapsule_Type=python34.PyCapsule_Type DATA
+  PyClassMethodDescr_Type=python34.PyClassMethodDescr_Type DATA
+  PyCodec_BackslashReplaceErrors=python34.PyCodec_BackslashReplaceErrors
+  PyCodec_Decode=python34.PyCodec_Decode
+  PyCodec_Decoder=python34.PyCodec_Decoder
+  PyCodec_Encode=python34.PyCodec_Encode
+  PyCodec_Encoder=python34.PyCodec_Encoder
+  PyCodec_IgnoreErrors=python34.PyCodec_IgnoreErrors
+  PyCodec_IncrementalDecoder=python34.PyCodec_IncrementalDecoder
+  PyCodec_IncrementalEncoder=python34.PyCodec_IncrementalEncoder
+  PyCodec_KnownEncoding=python34.PyCodec_KnownEncoding
+  PyCodec_LookupError=python34.PyCodec_LookupError
+  PyCodec_Register=python34.PyCodec_Register
+  PyCodec_RegisterError=python34.PyCodec_RegisterError
+  PyCodec_ReplaceErrors=python34.PyCodec_ReplaceErrors
+  PyCodec_StreamReader=python34.PyCodec_StreamReader
+  PyCodec_StreamWriter=python34.PyCodec_StreamWriter
+  PyCodec_StrictErrors=python34.PyCodec_StrictErrors
+  PyCodec_XMLCharRefReplaceErrors=python34.PyCodec_XMLCharRefReplaceErrors
+  PyComplex_FromDoubles=python34.PyComplex_FromDoubles
+  PyComplex_ImagAsDouble=python34.PyComplex_ImagAsDouble
+  PyComplex_RealAsDouble=python34.PyComplex_RealAsDouble
+  PyComplex_Type=python34.PyComplex_Type DATA
+  PyDescr_NewClassMethod=python34.PyDescr_NewClassMethod
+  PyDescr_NewGetSet=python34.PyDescr_NewGetSet
+  PyDescr_NewMember=python34.PyDescr_NewMember
+  PyDescr_NewMethod=python34.PyDescr_NewMethod
+  PyDictItems_Type=python34.PyDictItems_Type DATA
+  PyDictIterItem_Type=python34.PyDictIterItem_Type DATA
+  PyDictIterKey_Type=python34.PyDictIterKey_Type DATA
+  PyDictIterValue_Type=python34.PyDictIterValue_Type DATA
+  PyDictKeys_Type=python34.PyDictKeys_Type DATA
+  PyDictProxy_New=python34.PyDictProxy_New
+  PyDictProxy_Type=python34.PyDictProxy_Type DATA
+  PyDictValues_Type=python34.PyDictValues_Type DATA
+  PyDict_Clear=python34.PyDict_Clear
+  PyDict_Contains=python34.PyDict_Contains
+  PyDict_Copy=python34.PyDict_Copy
+  PyDict_DelItem=python34.PyDict_DelItem
+  PyDict_DelItemString=python34.PyDict_DelItemString
+  PyDict_GetItem=python34.PyDict_GetItem
+  PyDict_GetItemString=python34.PyDict_GetItemString
+  PyDict_GetItemWithError=python34.PyDict_GetItemWithError
+  PyDict_Items=python34.PyDict_Items
+  PyDict_Keys=python34.PyDict_Keys
+  PyDict_Merge=python34.PyDict_Merge
+  PyDict_MergeFromSeq2=python34.PyDict_MergeFromSeq2
+  PyDict_New=python34.PyDict_New
+  PyDict_Next=python34.PyDict_Next
+  PyDict_SetItem=python34.PyDict_SetItem
+  PyDict_SetItemString=python34.PyDict_SetItemString
+  PyDict_Size=python34.PyDict_Size
+  PyDict_Type=python34.PyDict_Type DATA
+  PyDict_Update=python34.PyDict_Update
+  PyDict_Values=python34.PyDict_Values
+  PyEllipsis_Type=python34.PyEllipsis_Type DATA
+  PyEnum_Type=python34.PyEnum_Type DATA
+  PyErr_BadArgument=python34.PyErr_BadArgument
+  PyErr_BadInternalCall=python34.PyErr_BadInternalCall
+  PyErr_CheckSignals=python34.PyErr_CheckSignals
+  PyErr_Clear=python34.PyErr_Clear
+  PyErr_Display=python34.PyErr_Display
+  PyErr_ExceptionMatches=python34.PyErr_ExceptionMatches
+  PyErr_Fetch=python34.PyErr_Fetch
+  PyErr_Format=python34.PyErr_Format
+  PyErr_GivenExceptionMatches=python34.PyErr_GivenExceptionMatches
+  PyErr_NewException=python34.PyErr_NewException
+  PyErr_NewExceptionWithDoc=python34.PyErr_NewExceptionWithDoc
+  PyErr_NoMemory=python34.PyErr_NoMemory
+  PyErr_NormalizeException=python34.PyErr_NormalizeException
+  PyErr_Occurred=python34.PyErr_Occurred
+  PyErr_Print=python34.PyErr_Print
+  PyErr_PrintEx=python34.PyErr_PrintEx
+  PyErr_ProgramText=python34.PyErr_ProgramText
+  PyErr_Restore=python34.PyErr_Restore
+  PyErr_SetFromErrno=python34.PyErr_SetFromErrno
+  PyErr_SetFromErrnoWithFilename=python34.PyErr_SetFromErrnoWithFilename
+  PyErr_SetFromErrnoWithFilenameObject=python34.PyErr_SetFromErrnoWithFilenameObject
+  PyErr_SetInterrupt=python34.PyErr_SetInterrupt
+  PyErr_SetNone=python34.PyErr_SetNone
+  PyErr_SetObject=python34.PyErr_SetObject
+  PyErr_SetString=python34.PyErr_SetString
+  PyErr_SyntaxLocation=python34.PyErr_SyntaxLocation
+  PyErr_WarnEx=python34.PyErr_WarnEx
+  PyErr_WarnExplicit=python34.PyErr_WarnExplicit
+  PyErr_WarnFormat=python34.PyErr_WarnFormat
+  PyErr_WriteUnraisable=python34.PyErr_WriteUnraisable
+  PyEval_AcquireLock=python34.PyEval_AcquireLock
+  PyEval_AcquireThread=python34.PyEval_AcquireThread
+  PyEval_CallFunction=python34.PyEval_CallFunction
+  PyEval_CallMethod=python34.PyEval_CallMethod
+  PyEval_CallObjectWithKeywords=python34.PyEval_CallObjectWithKeywords
+  PyEval_EvalCode=python34.PyEval_EvalCode
+  PyEval_EvalCodeEx=python34.PyEval_EvalCodeEx
+  PyEval_EvalFrame=python34.PyEval_EvalFrame
+  PyEval_EvalFrameEx=python34.PyEval_EvalFrameEx
+  PyEval_GetBuiltins=python34.PyEval_GetBuiltins
+  PyEval_GetCallStats=python34.PyEval_GetCallStats
+  PyEval_GetFrame=python34.PyEval_GetFrame
+  PyEval_GetFuncDesc=python34.PyEval_GetFuncDesc
+  PyEval_GetFuncName=python34.PyEval_GetFuncName
+  PyEval_GetGlobals=python34.PyEval_GetGlobals
+  PyEval_GetLocals=python34.PyEval_GetLocals
+  PyEval_InitThreads=python34.PyEval_InitThreads
+  PyEval_ReInitThreads=python34.PyEval_ReInitThreads
+  PyEval_ReleaseLock=python34.PyEval_ReleaseLock
+  PyEval_ReleaseThread=python34.PyEval_ReleaseThread
+  PyEval_RestoreThread=python34.PyEval_RestoreThread
+  PyEval_SaveThread=python34.PyEval_SaveThread
+  PyEval_ThreadsInitialized=python34.PyEval_ThreadsInitialized
+  PyExc_ArithmeticError=python34.PyExc_ArithmeticError DATA
+  PyExc_AssertionError=python34.PyExc_AssertionError DATA
+  PyExc_AttributeError=python34.PyExc_AttributeError DATA
+  PyExc_BaseException=python34.PyExc_BaseException DATA
+  PyExc_BufferError=python34.PyExc_BufferError DATA
+  PyExc_BytesWarning=python34.PyExc_BytesWarning DATA
+  PyExc_DeprecationWarning=python34.PyExc_DeprecationWarning DATA
+  PyExc_EOFError=python34.PyExc_EOFError DATA
+  PyExc_EnvironmentError=python34.PyExc_EnvironmentError DATA
+  PyExc_Exception=python34.PyExc_Exception DATA
+  PyExc_FloatingPointError=python34.PyExc_FloatingPointError DATA
+  PyExc_FutureWarning=python34.PyExc_FutureWarning DATA
+  PyExc_GeneratorExit=python34.PyExc_GeneratorExit DATA
+  PyExc_IOError=python34.PyExc_IOError DATA
+  PyExc_ImportError=python34.PyExc_ImportError DATA
+  PyExc_ImportWarning=python34.PyExc_ImportWarning DATA
+  PyExc_IndentationError=python34.PyExc_IndentationError DATA
+  PyExc_IndexError=python34.PyExc_IndexError DATA
+  PyExc_KeyError=python34.PyExc_KeyError DATA
+  PyExc_KeyboardInterrupt=python34.PyExc_KeyboardInterrupt DATA
+  PyExc_LookupError=python34.PyExc_LookupError DATA
+  PyExc_MemoryError=python34.PyExc_MemoryError DATA
+  PyExc_MemoryErrorInst=python34.PyExc_MemoryErrorInst DATA
+  PyExc_NameError=python34.PyExc_NameError DATA
+  PyExc_NotImplementedError=python34.PyExc_NotImplementedError DATA
+  PyExc_OSError=python34.PyExc_OSError DATA
+  PyExc_OverflowError=python34.PyExc_OverflowError DATA
+  PyExc_PendingDeprecationWarning=python34.PyExc_PendingDeprecationWarning DATA
+  PyExc_RecursionErrorInst=python34.PyExc_RecursionErrorInst DATA
+  PyExc_ReferenceError=python34.PyExc_ReferenceError DATA
+  PyExc_RuntimeError=python34.PyExc_RuntimeError DATA
+  PyExc_RuntimeWarning=python34.PyExc_RuntimeWarning DATA
+  PyExc_StopIteration=python34.PyExc_StopIteration DATA
+  PyExc_SyntaxError=python34.PyExc_SyntaxError DATA
+  PyExc_SyntaxWarning=python34.PyExc_SyntaxWarning DATA
+  PyExc_SystemError=python34.PyExc_SystemError DATA
+  PyExc_SystemExit=python34.PyExc_SystemExit DATA
+  PyExc_TabError=python34.PyExc_TabError DATA
+  PyExc_TypeError=python34.PyExc_TypeError DATA
+  PyExc_UnboundLocalError=python34.PyExc_UnboundLocalError DATA
+  PyExc_UnicodeDecodeError=python34.PyExc_UnicodeDecodeError DATA
+  PyExc_UnicodeEncodeError=python34.PyExc_UnicodeEncodeError DATA
+  PyExc_UnicodeError=python34.PyExc_UnicodeError DATA
+  PyExc_UnicodeTranslateError=python34.PyExc_UnicodeTranslateError DATA
+  PyExc_UnicodeWarning=python34.PyExc_UnicodeWarning DATA
+  PyExc_UserWarning=python34.PyExc_UserWarning DATA
+  PyExc_ValueError=python34.PyExc_ValueError DATA
+  PyExc_Warning=python34.PyExc_Warning DATA
+  PyExc_ZeroDivisionError=python34.PyExc_ZeroDivisionError DATA
+  PyException_GetCause=python34.PyException_GetCause
+  PyException_GetContext=python34.PyException_GetContext
+  PyException_GetTraceback=python34.PyException_GetTraceback
+  PyException_SetCause=python34.PyException_SetCause
+  PyException_SetContext=python34.PyException_SetContext
+  PyException_SetTraceback=python34.PyException_SetTraceback
+  PyFile_FromFd=python34.PyFile_FromFd
+  PyFile_GetLine=python34.PyFile_GetLine
+  PyFile_WriteObject=python34.PyFile_WriteObject
+  PyFile_WriteString=python34.PyFile_WriteString
+  PyFilter_Type=python34.PyFilter_Type DATA
+  PyFloat_AsDouble=python34.PyFloat_AsDouble
+  PyFloat_FromDouble=python34.PyFloat_FromDouble
+  PyFloat_FromString=python34.PyFloat_FromString
+  PyFloat_GetInfo=python34.PyFloat_GetInfo
+  PyFloat_GetMax=python34.PyFloat_GetMax
+  PyFloat_GetMin=python34.PyFloat_GetMin
+  PyFloat_Type=python34.PyFloat_Type DATA
+  PyFrozenSet_New=python34.PyFrozenSet_New
+  PyFrozenSet_Type=python34.PyFrozenSet_Type DATA
+  PyGC_Collect=python34.PyGC_Collect
+  PyGILState_Ensure=python34.PyGILState_Ensure
+  PyGILState_GetThisThreadState=python34.PyGILState_GetThisThreadState
+  PyGILState_Release=python34.PyGILState_Release
+  PyGetSetDescr_Type=python34.PyGetSetDescr_Type DATA
+  PyImport_AddModule=python34.PyImport_AddModule
+  PyImport_AppendInittab=python34.PyImport_AppendInittab
+  PyImport_Cleanup=python34.PyImport_Cleanup
+  PyImport_ExecCodeModule=python34.PyImport_ExecCodeModule
+  PyImport_ExecCodeModuleEx=python34.PyImport_ExecCodeModuleEx
+  PyImport_ExecCodeModuleWithPathnames=python34.PyImport_ExecCodeModuleWithPathnames
+  PyImport_GetImporter=python34.PyImport_GetImporter
+  PyImport_GetMagicNumber=python34.PyImport_GetMagicNumber
+  PyImport_GetMagicTag=python34.PyImport_GetMagicTag
+  PyImport_GetModuleDict=python34.PyImport_GetModuleDict
+  PyImport_Import=python34.PyImport_Import
+  PyImport_ImportFrozenModule=python34.PyImport_ImportFrozenModule
+  PyImport_ImportModule=python34.PyImport_ImportModule
+  PyImport_ImportModuleLevel=python34.PyImport_ImportModuleLevel
+  PyImport_ImportModuleNoBlock=python34.PyImport_ImportModuleNoBlock
+  PyImport_ReloadModule=python34.PyImport_ReloadModule
+  PyInterpreterState_Clear=python34.PyInterpreterState_Clear
+  PyInterpreterState_Delete=python34.PyInterpreterState_Delete
+  PyInterpreterState_New=python34.PyInterpreterState_New
+  PyIter_Next=python34.PyIter_Next
+  PyListIter_Type=python34.PyListIter_Type DATA
+  PyListRevIter_Type=python34.PyListRevIter_Type DATA
+  PyList_Append=python34.PyList_Append
+  PyList_AsTuple=python34.PyList_AsTuple
+  PyList_GetItem=python34.PyList_GetItem
+  PyList_GetSlice=python34.PyList_GetSlice
+  PyList_Insert=python34.PyList_Insert
+  PyList_New=python34.PyList_New
+  PyList_Reverse=python34.PyList_Reverse
+  PyList_SetItem=python34.PyList_SetItem
+  PyList_SetSlice=python34.PyList_SetSlice
+  PyList_Size=python34.PyList_Size
+  PyList_Sort=python34.PyList_Sort
+  PyList_Type=python34.PyList_Type DATA
+  PyLongRangeIter_Type=python34.PyLongRangeIter_Type DATA
+  PyLong_AsDouble=python34.PyLong_AsDouble
+  PyLong_AsLong=python34.PyLong_AsLong
+  PyLong_AsLongAndOverflow=python34.PyLong_AsLongAndOverflow
+  PyLong_AsLongLong=python34.PyLong_AsLongLong
+  PyLong_AsLongLongAndOverflow=python34.PyLong_AsLongLongAndOverflow
+  PyLong_AsSize_t=python34.PyLong_AsSize_t
+  PyLong_AsSsize_t=python34.PyLong_AsSsize_t
+  PyLong_AsUnsignedLong=python34.PyLong_AsUnsignedLong
+  PyLong_AsUnsignedLongLong=python34.PyLong_AsUnsignedLongLong
+  PyLong_AsUnsignedLongLongMask=python34.PyLong_AsUnsignedLongLongMask
+  PyLong_AsUnsignedLongMask=python34.PyLong_AsUnsignedLongMask
+  PyLong_AsVoidPtr=python34.PyLong_AsVoidPtr
+  PyLong_FromDouble=python34.PyLong_FromDouble
+  PyLong_FromLong=python34.PyLong_FromLong
+  PyLong_FromLongLong=python34.PyLong_FromLongLong
+  PyLong_FromSize_t=python34.PyLong_FromSize_t
+  PyLong_FromSsize_t=python34.PyLong_FromSsize_t
+  PyLong_FromString=python34.PyLong_FromString
+  PyLong_FromUnsignedLong=python34.PyLong_FromUnsignedLong
+  PyLong_FromUnsignedLongLong=python34.PyLong_FromUnsignedLongLong
+  PyLong_FromVoidPtr=python34.PyLong_FromVoidPtr
+  PyLong_GetInfo=python34.PyLong_GetInfo
+  PyLong_Type=python34.PyLong_Type DATA
+  PyMap_Type=python34.PyMap_Type DATA
+  PyMapping_Check=python34.PyMapping_Check
+  PyMapping_GetItemString=python34.PyMapping_GetItemString
+  PyMapping_HasKey=python34.PyMapping_HasKey
+  PyMapping_HasKeyString=python34.PyMapping_HasKeyString
+  PyMapping_Items=python34.PyMapping_Items
+  PyMapping_Keys=python34.PyMapping_Keys
+  PyMapping_Length=python34.PyMapping_Length
+  PyMapping_SetItemString=python34.PyMapping_SetItemString
+  PyMapping_Size=python34.PyMapping_Size
+  PyMapping_Values=python34.PyMapping_Values
+  PyMem_Free=python34.PyMem_Free
+  PyMem_Malloc=python34.PyMem_Malloc
+  PyMem_Realloc=python34.PyMem_Realloc
+  PyMemberDescr_Type=python34.PyMemberDescr_Type DATA
+  PyMemoryView_FromObject=python34.PyMemoryView_FromObject
+  PyMemoryView_GetContiguous=python34.PyMemoryView_GetContiguous
+  PyMemoryView_Type=python34.PyMemoryView_Type DATA
+  PyMethodDescr_Type=python34.PyMethodDescr_Type DATA
+  PyModule_AddIntConstant=python34.PyModule_AddIntConstant
+  PyModule_AddObject=python34.PyModule_AddObject
+  PyModule_AddStringConstant=python34.PyModule_AddStringConstant
+  PyModule_Create2=python34.PyModule_Create2
+  PyModule_GetDef=python34.PyModule_GetDef
+  PyModule_GetDict=python34.PyModule_GetDict
+  PyModule_GetFilename=python34.PyModule_GetFilename
+  PyModule_GetFilenameObject=python34.PyModule_GetFilenameObject
+  PyModule_GetName=python34.PyModule_GetName
+  PyModule_GetState=python34.PyModule_GetState
+  PyModule_New=python34.PyModule_New
+  PyModule_Type=python34.PyModule_Type DATA
+  PyNullImporter_Type=python34.PyNullImporter_Type DATA
+  PyNumber_Absolute=python34.PyNumber_Absolute
+  PyNumber_Add=python34.PyNumber_Add
+  PyNumber_And=python34.PyNumber_And
+  PyNumber_AsSsize_t=python34.PyNumber_AsSsize_t
+  PyNumber_Check=python34.PyNumber_Check
+  PyNumber_Divmod=python34.PyNumber_Divmod
+  PyNumber_Float=python34.PyNumber_Float
+  PyNumber_FloorDivide=python34.PyNumber_FloorDivide
+  PyNumber_InPlaceAdd=python34.PyNumber_InPlaceAdd
+  PyNumber_InPlaceAnd=python34.PyNumber_InPlaceAnd
+  PyNumber_InPlaceFloorDivide=python34.PyNumber_InPlaceFloorDivide
+  PyNumber_InPlaceLshift=python34.PyNumber_InPlaceLshift
+  PyNumber_InPlaceMultiply=python34.PyNumber_InPlaceMultiply
+  PyNumber_InPlaceOr=python34.PyNumber_InPlaceOr
+  PyNumber_InPlacePower=python34.PyNumber_InPlacePower
+  PyNumber_InPlaceRemainder=python34.PyNumber_InPlaceRemainder
+  PyNumber_InPlaceRshift=python34.PyNumber_InPlaceRshift
+  PyNumber_InPlaceSubtract=python34.PyNumber_InPlaceSubtract
+  PyNumber_InPlaceTrueDivide=python34.PyNumber_InPlaceTrueDivide
+  PyNumber_InPlaceXor=python34.PyNumber_InPlaceXor
+  PyNumber_Index=python34.PyNumber_Index
+  PyNumber_Invert=python34.PyNumber_Invert
+  PyNumber_Long=python34.PyNumber_Long
+  PyNumber_Lshift=python34.PyNumber_Lshift
+  PyNumber_Multiply=python34.PyNumber_Multiply
+  PyNumber_Negative=python34.PyNumber_Negative
+  PyNumber_Or=python34.PyNumber_Or
+  PyNumber_Positive=python34.PyNumber_Positive
+  PyNumber_Power=python34.PyNumber_Power
+  PyNumber_Remainder=python34.PyNumber_Remainder
+  PyNumber_Rshift=python34.PyNumber_Rshift
+  PyNumber_Subtract=python34.PyNumber_Subtract
+  PyNumber_ToBase=python34.PyNumber_ToBase
+  PyNumber_TrueDivide=python34.PyNumber_TrueDivide
+  PyNumber_Xor=python34.PyNumber_Xor
+  PyOS_AfterFork=python34.PyOS_AfterFork
+  PyOS_InitInterrupts=python34.PyOS_InitInterrupts
+  PyOS_InputHook=python34.PyOS_InputHook DATA
+  PyOS_InterruptOccurred=python34.PyOS_InterruptOccurred
+  PyOS_ReadlineFunctionPointer=python34.PyOS_ReadlineFunctionPointer DATA
+  PyOS_double_to_string=python34.PyOS_double_to_string
+  PyOS_getsig=python34.PyOS_getsig
+  PyOS_mystricmp=python34.PyOS_mystricmp
+  PyOS_mystrnicmp=python34.PyOS_mystrnicmp
+  PyOS_setsig=python34.PyOS_setsig
+  PyOS_snprintf=python34.PyOS_snprintf
+  PyOS_string_to_double=python34.PyOS_string_to_double
+  PyOS_strtol=python34.PyOS_strtol
+  PyOS_strtoul=python34.PyOS_strtoul
+  PyOS_vsnprintf=python34.PyOS_vsnprintf
+  PyObject_ASCII=python34.PyObject_ASCII
+  PyObject_AsCharBuffer=python34.PyObject_AsCharBuffer
+  PyObject_AsFileDescriptor=python34.PyObject_AsFileDescriptor
+  PyObject_AsReadBuffer=python34.PyObject_AsReadBuffer
+  PyObject_AsWriteBuffer=python34.PyObject_AsWriteBuffer
+  PyObject_Bytes=python34.PyObject_Bytes
+  PyObject_Call=python34.PyObject_Call
+  PyObject_CallFunction=python34.PyObject_CallFunction
+  PyObject_CallFunctionObjArgs=python34.PyObject_CallFunctionObjArgs
+  PyObject_CallMethod=python34.PyObject_CallMethod
+  PyObject_CallMethodObjArgs=python34.PyObject_CallMethodObjArgs
+  PyObject_CallObject=python34.PyObject_CallObject
+  PyObject_CheckReadBuffer=python34.PyObject_CheckReadBuffer
+  PyObject_ClearWeakRefs=python34.PyObject_ClearWeakRefs
+  PyObject_DelItem=python34.PyObject_DelItem
+  PyObject_DelItemString=python34.PyObject_DelItemString
+  PyObject_Dir=python34.PyObject_Dir
+  PyObject_Format=python34.PyObject_Format
+  PyObject_Free=python34.PyObject_Free
+  PyObject_GC_Del=python34.PyObject_GC_Del
+  PyObject_GC_Track=python34.PyObject_GC_Track
+  PyObject_GC_UnTrack=python34.PyObject_GC_UnTrack
+  PyObject_GenericGetAttr=python34.PyObject_GenericGetAttr
+  PyObject_GenericSetAttr=python34.PyObject_GenericSetAttr
+  PyObject_GetAttr=python34.PyObject_GetAttr
+  PyObject_GetAttrString=python34.PyObject_GetAttrString
+  PyObject_GetItem=python34.PyObject_GetItem
+  PyObject_GetIter=python34.PyObject_GetIter
+  PyObject_HasAttr=python34.PyObject_HasAttr
+  PyObject_HasAttrString=python34.PyObject_HasAttrString
+  PyObject_Hash=python34.PyObject_Hash
+  PyObject_HashNotImplemented=python34.PyObject_HashNotImplemented
+  PyObject_Init=python34.PyObject_Init
+  PyObject_InitVar=python34.PyObject_InitVar
+  PyObject_IsInstance=python34.PyObject_IsInstance
+  PyObject_IsSubclass=python34.PyObject_IsSubclass
+  PyObject_IsTrue=python34.PyObject_IsTrue
+  PyObject_Length=python34.PyObject_Length
+  PyObject_Malloc=python34.PyObject_Malloc
+  PyObject_Not=python34.PyObject_Not
+  PyObject_Realloc=python34.PyObject_Realloc
+  PyObject_Repr=python34.PyObject_Repr
+  PyObject_RichCompare=python34.PyObject_RichCompare
+  PyObject_RichCompareBool=python34.PyObject_RichCompareBool
+  PyObject_SelfIter=python34.PyObject_SelfIter
+  PyObject_SetAttr=python34.PyObject_SetAttr
+  PyObject_SetAttrString=python34.PyObject_SetAttrString
+  PyObject_SetItem=python34.PyObject_SetItem
+  PyObject_Size=python34.PyObject_Size
+  PyObject_Str=python34.PyObject_Str
+  PyObject_Type=python34.PyObject_Type DATA
+  PyParser_SimpleParseFileFlags=python34.PyParser_SimpleParseFileFlags
+  PyParser_SimpleParseStringFlags=python34.PyParser_SimpleParseStringFlags
+  PyProperty_Type=python34.PyProperty_Type DATA
+  PyRangeIter_Type=python34.PyRangeIter_Type DATA
+  PyRange_Type=python34.PyRange_Type DATA
+  PyReversed_Type=python34.PyReversed_Type DATA
+  PySeqIter_New=python34.PySeqIter_New
+  PySeqIter_Type=python34.PySeqIter_Type DATA
+  PySequence_Check=python34.PySequence_Check
+  PySequence_Concat=python34.PySequence_Concat
+  PySequence_Contains=python34.PySequence_Contains
+  PySequence_Count=python34.PySequence_Count
+  PySequence_DelItem=python34.PySequence_DelItem
+  PySequence_DelSlice=python34.PySequence_DelSlice
+  PySequence_Fast=python34.PySequence_Fast
+  PySequence_GetItem=python34.PySequence_GetItem
+  PySequence_GetSlice=python34.PySequence_GetSlice
+  PySequence_In=python34.PySequence_In
+  PySequence_InPlaceConcat=python34.PySequence_InPlaceConcat
+  PySequence_InPlaceRepeat=python34.PySequence_InPlaceRepeat
+  PySequence_Index=python34.PySequence_Index
+  PySequence_Length=python34.PySequence_Length
+  PySequence_List=python34.PySequence_List
+  PySequence_Repeat=python34.PySequence_Repeat
+  PySequence_SetItem=python34.PySequence_SetItem
+  PySequence_SetSlice=python34.PySequence_SetSlice
+  PySequence_Size=python34.PySequence_Size
+  PySequence_Tuple=python34.PySequence_Tuple
+  PySetIter_Type=python34.PySetIter_Type DATA
+  PySet_Add=python34.PySet_Add
+  PySet_Clear=python34.PySet_Clear
+  PySet_Contains=python34.PySet_Contains
+  PySet_Discard=python34.PySet_Discard
+  PySet_New=python34.PySet_New
+  PySet_Pop=python34.PySet_Pop
+  PySet_Size=python34.PySet_Size
+  PySet_Type=python34.PySet_Type DATA
+  PySlice_GetIndices=python34.PySlice_GetIndices
+  PySlice_GetIndicesEx=python34.PySlice_GetIndicesEx
+  PySlice_New=python34.PySlice_New
+  PySlice_Type=python34.PySlice_Type DATA
+  PySortWrapper_Type=python34.PySortWrapper_Type DATA
+  PyState_FindModule=python34.PyState_FindModule
+  PyState_AddModule=python34.PyState_AddModule
+  PyState_RemoveModule=python34.PyState_RemoveModule
+  PyStructSequence_GetItem=python34.PyStructSequence_GetItem
+  PyStructSequence_New=python34.PyStructSequence_New
+  PyStructSequence_NewType=python34.PyStructSequence_NewType
+  PyStructSequence_SetItem=python34.PyStructSequence_SetItem
+  PySuper_Type=python34.PySuper_Type DATA
+  PySys_AddWarnOption=python34.PySys_AddWarnOption
+  PySys_AddWarnOptionUnicode=python34.PySys_AddWarnOptionUnicode
+  PySys_FormatStderr=python34.PySys_FormatStderr
+  PySys_FormatStdout=python34.PySys_FormatStdout
+  PySys_GetObject=python34.PySys_GetObject
+  PySys_HasWarnOptions=python34.PySys_HasWarnOptions
+  PySys_ResetWarnOptions=python34.PySys_ResetWarnOptions
+  PySys_SetArgv=python34.PySys_SetArgv
+  PySys_SetArgvEx=python34.PySys_SetArgvEx
+  PySys_SetObject=python34.PySys_SetObject
+  PySys_SetPath=python34.PySys_SetPath
+  PySys_WriteStderr=python34.PySys_WriteStderr
+  PySys_WriteStdout=python34.PySys_WriteStdout
+  PyThreadState_Clear=python34.PyThreadState_Clear
+  PyThreadState_Delete=python34.PyThreadState_Delete
+  PyThreadState_DeleteCurrent=python34.PyThreadState_DeleteCurrent
+  PyThreadState_Get=python34.PyThreadState_Get
+  PyThreadState_GetDict=python34.PyThreadState_GetDict
+  PyThreadState_New=python34.PyThreadState_New
+  PyThreadState_SetAsyncExc=python34.PyThreadState_SetAsyncExc
+  PyThreadState_Swap=python34.PyThreadState_Swap
+  PyTraceBack_Here=python34.PyTraceBack_Here
+  PyTraceBack_Print=python34.PyTraceBack_Print
+  PyTraceBack_Type=python34.PyTraceBack_Type DATA
+  PyTupleIter_Type=python34.PyTupleIter_Type DATA
+  PyTuple_ClearFreeList=python34.PyTuple_ClearFreeList
+  PyTuple_GetItem=python34.PyTuple_GetItem
+  PyTuple_GetSlice=python34.PyTuple_GetSlice
+  PyTuple_New=python34.PyTuple_New
+  PyTuple_Pack=python34.PyTuple_Pack
+  PyTuple_SetItem=python34.PyTuple_SetItem
+  PyTuple_Size=python34.PyTuple_Size
+  PyTuple_Type=python34.PyTuple_Type DATA
+  PyType_ClearCache=python34.PyType_ClearCache
+  PyType_FromSpec=python34.PyType_FromSpec
+  PyType_FromSpecWithBases=python34.PyType_FromSpecWithBases
+  PyType_GenericAlloc=python34.PyType_GenericAlloc
+  PyType_GenericNew=python34.PyType_GenericNew
+  PyType_GetFlags=python34.PyType_GetFlags
+  PyType_GetSlot=python34.PyType_GetSlot
+  PyType_IsSubtype=python34.PyType_IsSubtype
+  PyType_Modified=python34.PyType_Modified
+  PyType_Ready=python34.PyType_Ready
+  PyType_Type=python34.PyType_Type DATA
+  PyUnicodeDecodeError_Create=python34.PyUnicodeDecodeError_Create
+  PyUnicodeDecodeError_GetEncoding=python34.PyUnicodeDecodeError_GetEncoding
+  PyUnicodeDecodeError_GetEnd=python34.PyUnicodeDecodeError_GetEnd
+  PyUnicodeDecodeError_GetObject=python34.PyUnicodeDecodeError_GetObject
+  PyUnicodeDecodeError_GetReason=python34.PyUnicodeDecodeError_GetReason
+  PyUnicodeDecodeError_GetStart=python34.PyUnicodeDecodeError_GetStart
+  PyUnicodeDecodeError_SetEnd=python34.PyUnicodeDecodeError_SetEnd
+  PyUnicodeDecodeError_SetReason=python34.PyUnicodeDecodeError_SetReason
+  PyUnicodeDecodeError_SetStart=python34.PyUnicodeDecodeError_SetStart
+  PyUnicodeEncodeError_GetEncoding=python34.PyUnicodeEncodeError_GetEncoding
+  PyUnicodeEncodeError_GetEnd=python34.PyUnicodeEncodeError_GetEnd
+  PyUnicodeEncodeError_GetObject=python34.PyUnicodeEncodeError_GetObject
+  PyUnicodeEncodeError_GetReason=python34.PyUnicodeEncodeError_GetReason
+  PyUnicodeEncodeError_GetStart=python34.PyUnicodeEncodeError_GetStart
+  PyUnicodeEncodeError_SetEnd=python34.PyUnicodeEncodeError_SetEnd
+  PyUnicodeEncodeError_SetReason=python34.PyUnicodeEncodeError_SetReason
+  PyUnicodeEncodeError_SetStart=python34.PyUnicodeEncodeError_SetStart
+  PyUnicodeIter_Type=python34.PyUnicodeIter_Type DATA
+  PyUnicodeTranslateError_GetEnd=python34.PyUnicodeTranslateError_GetEnd
+  PyUnicodeTranslateError_GetObject=python34.PyUnicodeTranslateError_GetObject
+  PyUnicodeTranslateError_GetReason=python34.PyUnicodeTranslateError_GetReason
+  PyUnicodeTranslateError_GetStart=python34.PyUnicodeTranslateError_GetStart
+  PyUnicodeTranslateError_SetEnd=python34.PyUnicodeTranslateError_SetEnd
+  PyUnicodeTranslateError_SetReason=python34.PyUnicodeTranslateError_SetReason
+  PyUnicodeTranslateError_SetStart=python34.PyUnicodeTranslateError_SetStart
+  PyUnicode_Append=python34.PyUnicode_Append
+  PyUnicode_AppendAndDel=python34.PyUnicode_AppendAndDel
+  PyUnicode_AsASCIIString=python34.PyUnicode_AsASCIIString
+  PyUnicode_AsCharmapString=python34.PyUnicode_AsCharmapString
+  PyUnicode_AsDecodedObject=python34.PyUnicode_AsDecodedObject
+  PyUnicode_AsDecodedUnicode=python34.PyUnicode_AsDecodedUnicode
+  PyUnicode_AsEncodedObject=python34.PyUnicode_AsEncodedObject
+  PyUnicode_AsEncodedString=python34.PyUnicode_AsEncodedString
+  PyUnicode_AsEncodedUnicode=python34.PyUnicode_AsEncodedUnicode
+  PyUnicode_AsLatin1String=python34.PyUnicode_AsLatin1String
+  PyUnicode_AsRawUnicodeEscapeString=python34.PyUnicode_AsRawUnicodeEscapeString
+  PyUnicode_AsUTF16String=python34.PyUnicode_AsUTF16String
+  PyUnicode_AsUTF32String=python34.PyUnicode_AsUTF32String
+  PyUnicode_AsUTF8String=python34.PyUnicode_AsUTF8String
+  PyUnicode_AsUnicodeEscapeString=python34.PyUnicode_AsUnicodeEscapeString
+  PyUnicode_AsWideChar=python34.PyUnicode_AsWideChar
+  PyUnicode_ClearFreelist=python34.PyUnicode_ClearFreelist
+  PyUnicode_Compare=python34.PyUnicode_Compare
+  PyUnicode_Concat=python34.PyUnicode_Concat
+  PyUnicode_Contains=python34.PyUnicode_Contains
+  PyUnicode_Count=python34.PyUnicode_Count
+  PyUnicode_Decode=python34.PyUnicode_Decode
+  PyUnicode_DecodeASCII=python34.PyUnicode_DecodeASCII
+  PyUnicode_DecodeCharmap=python34.PyUnicode_DecodeCharmap
+  PyUnicode_DecodeFSDefault=python34.PyUnicode_DecodeFSDefault
+  PyUnicode_DecodeFSDefaultAndSize=python34.PyUnicode_DecodeFSDefaultAndSize
+  PyUnicode_DecodeLatin1=python34.PyUnicode_DecodeLatin1
+  PyUnicode_DecodeRawUnicodeEscape=python34.PyUnicode_DecodeRawUnicodeEscape
+  PyUnicode_DecodeUTF16=python34.PyUnicode_DecodeUTF16
+  PyUnicode_DecodeUTF16Stateful=python34.PyUnicode_DecodeUTF16Stateful
+  PyUnicode_DecodeUTF32=python34.PyUnicode_DecodeUTF32
+  PyUnicode_DecodeUTF32Stateful=python34.PyUnicode_DecodeUTF32Stateful
+  PyUnicode_DecodeUTF8=python34.PyUnicode_DecodeUTF8
+  PyUnicode_DecodeUTF8Stateful=python34.PyUnicode_DecodeUTF8Stateful
+  PyUnicode_DecodeUnicodeEscape=python34.PyUnicode_DecodeUnicodeEscape
+  PyUnicode_FSConverter=python34.PyUnicode_FSConverter
+  PyUnicode_FSDecoder=python34.PyUnicode_FSDecoder
+  PyUnicode_Find=python34.PyUnicode_Find
+  PyUnicode_Format=python34.PyUnicode_Format
+  PyUnicode_FromEncodedObject=python34.PyUnicode_FromEncodedObject
+  PyUnicode_FromFormat=python34.PyUnicode_FromFormat
+  PyUnicode_FromFormatV=python34.PyUnicode_FromFormatV
+  PyUnicode_FromObject=python34.PyUnicode_FromObject
+  PyUnicode_FromOrdinal=python34.PyUnicode_FromOrdinal
+  PyUnicode_FromString=python34.PyUnicode_FromString
+  PyUnicode_FromStringAndSize=python34.PyUnicode_FromStringAndSize
+  PyUnicode_FromWideChar=python34.PyUnicode_FromWideChar
+  PyUnicode_GetDefaultEncoding=python34.PyUnicode_GetDefaultEncoding
+  PyUnicode_GetSize=python34.PyUnicode_GetSize
+  PyUnicode_IsIdentifier=python34.PyUnicode_IsIdentifier
+  PyUnicode_Join=python34.PyUnicode_Join
+  PyUnicode_Partition=python34.PyUnicode_Partition
+  PyUnicode_RPartition=python34.PyUnicode_RPartition
+  PyUnicode_RSplit=python34.PyUnicode_RSplit
+  PyUnicode_Replace=python34.PyUnicode_Replace
+  PyUnicode_Resize=python34.PyUnicode_Resize
+  PyUnicode_RichCompare=python34.PyUnicode_RichCompare
+  PyUnicode_SetDefaultEncoding=python34.PyUnicode_SetDefaultEncoding
+  PyUnicode_Split=python34.PyUnicode_Split
+  PyUnicode_Splitlines=python34.PyUnicode_Splitlines
+  PyUnicode_Tailmatch=python34.PyUnicode_Tailmatch
+  PyUnicode_Translate=python34.PyUnicode_Translate
+  PyUnicode_BuildEncodingMap=python34.PyUnicode_BuildEncodingMap
+  PyUnicode_CompareWithASCIIString=python34.PyUnicode_CompareWithASCIIString
+  PyUnicode_DecodeUTF7=python34.PyUnicode_DecodeUTF7
+  PyUnicode_DecodeUTF7Stateful=python34.PyUnicode_DecodeUTF7Stateful
+  PyUnicode_EncodeFSDefault=python34.PyUnicode_EncodeFSDefault
+  PyUnicode_InternFromString=python34.PyUnicode_InternFromString
+  PyUnicode_InternImmortal=python34.PyUnicode_InternImmortal
+  PyUnicode_InternInPlace=python34.PyUnicode_InternInPlace
+  PyUnicode_Type=python34.PyUnicode_Type DATA
+  PyWeakref_GetObject=python34.PyWeakref_GetObject DATA
+  PyWeakref_NewProxy=python34.PyWeakref_NewProxy
+  PyWeakref_NewRef=python34.PyWeakref_NewRef
+  PyWrapperDescr_Type=python34.PyWrapperDescr_Type DATA
+  PyWrapper_New=python34.PyWrapper_New
+  PyZip_Type=python34.PyZip_Type DATA
+  Py_AddPendingCall=python34.Py_AddPendingCall
+  Py_AtExit=python34.Py_AtExit
+  Py_BuildValue=python34.Py_BuildValue
+  Py_CompileString=python34.Py_CompileString
+  Py_DecRef=python34.Py_DecRef
+  Py_EndInterpreter=python34.Py_EndInterpreter
+  Py_Exit=python34.Py_Exit
+  Py_FatalError=python34.Py_FatalError
+  Py_FileSystemDefaultEncoding=python34.Py_FileSystemDefaultEncoding DATA
+  Py_Finalize=python34.Py_Finalize
+  Py_GetBuildInfo=python34.Py_GetBuildInfo
+  Py_GetCompiler=python34.Py_GetCompiler
+  Py_GetCopyright=python34.Py_GetCopyright
+  Py_GetExecPrefix=python34.Py_GetExecPrefix
+  Py_GetPath=python34.Py_GetPath
+  Py_GetPlatform=python34.Py_GetPlatform
+  Py_GetPrefix=python34.Py_GetPrefix
+  Py_GetProgramFullPath=python34.Py_GetProgramFullPath
+  Py_GetProgramName=python34.Py_GetProgramName
+  Py_GetPythonHome=python34.Py_GetPythonHome
+  Py_GetRecursionLimit=python34.Py_GetRecursionLimit
+  Py_GetVersion=python34.Py_GetVersion
+  Py_HasFileSystemDefaultEncoding=python34.Py_HasFileSystemDefaultEncoding DATA
+  Py_IncRef=python34.Py_IncRef
+  Py_Initialize=python34.Py_Initialize
+  Py_InitializeEx=python34.Py_InitializeEx
+  Py_IsInitialized=python34.Py_IsInitialized
+  Py_Main=python34.Py_Main
+  Py_MakePendingCalls=python34.Py_MakePendingCalls
+  Py_NewInterpreter=python34.Py_NewInterpreter
+  Py_ReprEnter=python34.Py_ReprEnter
+  Py_ReprLeave=python34.Py_ReprLeave
+  Py_SetProgramName=python34.Py_SetProgramName
+  Py_SetPythonHome=python34.Py_SetPythonHome
+  Py_SetRecursionLimit=python34.Py_SetRecursionLimit
+  Py_SymtableString=python34.Py_SymtableString
+  Py_VaBuildValue=python34.Py_VaBuildValue
+  _PyErr_BadInternalCall=python34._PyErr_BadInternalCall
+  _PyObject_CallFunction_SizeT=python34._PyObject_CallFunction_SizeT
+  _PyObject_CallMethod_SizeT=python34._PyObject_CallMethod_SizeT
+  _PyObject_GC_Malloc=python34._PyObject_GC_Malloc
+  _PyObject_GC_New=python34._PyObject_GC_New
+  _PyObject_GC_NewVar=python34._PyObject_GC_NewVar
+  _PyObject_GC_Resize=python34._PyObject_GC_Resize
+  _PyObject_New=python34._PyObject_New
+  _PyObject_NewVar=python34._PyObject_NewVar
+  _PyState_AddModule=python34._PyState_AddModule
+  _PyThreadState_Init=python34._PyThreadState_Init
+  _PyThreadState_Prealloc=python34._PyThreadState_Prealloc
+  _PyTrash_delete_later=python34._PyTrash_delete_later DATA
+  _PyTrash_delete_nesting=python34._PyTrash_delete_nesting DATA
+  _PyTrash_deposit_object=python34._PyTrash_deposit_object
+  _PyTrash_destroy_chain=python34._PyTrash_destroy_chain
+  _PyWeakref_CallableProxyType=python34._PyWeakref_CallableProxyType DATA
+  _PyWeakref_ProxyType=python34._PyWeakref_ProxyType DATA
+  _PyWeakref_RefType=python34._PyWeakref_RefType DATA
+  _Py_BuildValue_SizeT=python34._Py_BuildValue_SizeT
+  _Py_CheckRecursionLimit=python34._Py_CheckRecursionLimit DATA
+  _Py_CheckRecursiveCall=python34._Py_CheckRecursiveCall
+  _Py_Dealloc=python34._Py_Dealloc
+  _Py_EllipsisObject=python34._Py_EllipsisObject DATA
+  _Py_FalseStruct=python34._Py_FalseStruct DATA
+  _Py_NoneStruct=python34._Py_NoneStruct DATA
+  _Py_NotImplementedStruct=python34._Py_NotImplementedStruct DATA
+  _Py_SwappedOp=python34._Py_SwappedOp DATA
+  _Py_TrueStruct=python34._Py_TrueStruct DATA
+  _Py_VaBuildValue_SizeT=python34._Py_VaBuildValue_SizeT
+  _PyArg_Parse_SizeT=python34._PyArg_Parse_SizeT
+  _PyArg_ParseTuple_SizeT=python34._PyArg_ParseTuple_SizeT
+  _PyArg_ParseTupleAndKeywords_SizeT=python34._PyArg_ParseTupleAndKeywords_SizeT
+  _PyArg_VaParse_SizeT=python34._PyArg_VaParse_SizeT
+  _PyArg_VaParseTupleAndKeywords_SizeT=python34._PyArg_VaParseTupleAndKeywords_SizeT
+  _Py_BuildValue_SizeT=python34._Py_BuildValue_SizeT
diff --git a/PC/python3.mak b/PC/python3.mak
index 9cf1807..fb8e7aa 100644
--- a/PC/python3.mak
+++ b/PC/python3.mak
@@ -1,14 +1,14 @@
-$(OutDir)python3.dll:	python3.def $(OutDir)python33stub.lib
-	cl /LD /Fe$(OutDir)python3.dll python3dll.c python3.def $(OutDir)python33stub.lib
+$(OutDir)python3.dll:	python3.def $(OutDir)python34stub.lib
+	cl /LD /Fe$(OutDir)python3.dll python3dll.c python3.def $(OutDir)python34stub.lib
 
-$(OutDir)python33stub.lib:	python33stub.def
-	lib /def:python33stub.def /out:$(OutDir)python33stub.lib /MACHINE:$(MACHINE)
+$(OutDir)python34stub.lib:	python34stub.def
+	lib /def:python34stub.def /out:$(OutDir)python34stub.lib /MACHINE:$(MACHINE)
 
 clean:
 	IF EXIST $(OutDir)python3.dll del $(OutDir)python3.dll
 	IF EXIST $(OutDir)python3.lib del $(OutDir)python3.lib
-	IF EXIST $(OutDir)python33stub.lib del $(OutDir)python33stub.lib
+	IF EXIST $(OutDir)python34stub.lib del $(OutDir)python34stub.lib
 	IF EXIST $(OutDir)python3.exp del $(OutDir)python3.exp
-	IF EXIST $(OutDir)python33stub.exp del $(OutDir)python33stub.exp
+	IF EXIST $(OutDir)python34stub.exp del $(OutDir)python34stub.exp
 
 rebuild: clean $(OutDir)python3.dll
diff --git a/PC/python33gen.py b/PC/python34gen.py
similarity index 77%
rename from PC/python33gen.py
rename to PC/python34gen.py
index 21b9f56..180ce11 100644
--- a/PC/python33gen.py
+++ b/PC/python34gen.py
@@ -1,9 +1,9 @@
-# Generate python33stub.def out of python3.def
+# Generate python34stub.def out of python3.def
 # The regular import library cannot be used,
 # since it doesn't provide the right symbols for
 # data forwarding
-out = open("python33stub.def", "w")
-out.write('LIBRARY "python33"\n')
+out = open("python34stub.def", "w")
+out.write('LIBRARY "python34"\n')
 out.write('EXPORTS\n')
 
 inp = open("python3.def")
@@ -14,7 +14,7 @@
 assert line.strip()=='EXPORTS'
 
 for line in inp:
-    # SYM1=python33.SYM2[ DATA]
+    # SYM1=python34.SYM2[ DATA]
     head, tail = line.split('.')
     if 'DATA' in tail:
         symbol, tail = tail.split(' ')
diff --git a/PC/python33stub.def b/PC/python34stub.def
similarity index 99%
rename from PC/python33stub.def
rename to PC/python34stub.def
index db1a546..3074cf3 100644
--- a/PC/python33stub.def
+++ b/PC/python34stub.def
@@ -1,4 +1,4 @@
-LIBRARY "python33"
+LIBRARY "python34"
 EXPORTS
 PyArg_Parse
 PyArg_ParseTuple
@@ -37,6 +37,7 @@
 PyCFunction_GetFlags
 PyCFunction_GetFunction
 PyCFunction_GetSelf
+PyCFunction_New
 PyCFunction_NewEx
 PyCFunction_Type
 PyCallIter_New
@@ -517,6 +518,7 @@
 PyType_GenericAlloc
 PyType_GenericNew
 PyType_GetFlags
+PyType_GetSlot
 PyType_IsSubtype
 PyType_Modified
 PyType_Ready
diff --git a/PC/readme.txt b/PC/readme.txt
index fdc09ab..60f231e 100644
--- a/PC/readme.txt
+++ b/PC/readme.txt
@@ -79,19 +79,6 @@
 The subdirectories VC6, VS7.1 and VS8.0 contain legacy support older
 versions of Microsoft Visual Studio. See PCbuild/readme.txt.
 
-EMX development tools for OS/2
-==============================
-
-See os2emx/readme.txt. This platform is maintained by Andrew MacIntyre.
-
-IBM VisualAge C/C++ for OS/2
-============================
-
-See os2vacpp/readme.txt.  This platform is supported by Jeff Rush.
-
-NOTE: Support for os2vacpp may be dropped in the near future. Please move
-      to EMX.
-
 Note for Windows 3.x and DOS users
 ==================================
 
diff --git a/PC/w9xpopen.c b/PC/w9xpopen.c
deleted file mode 100644
index b3978dd..0000000
--- a/PC/w9xpopen.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * w9xpopen.c
- *
- * Serves as an intermediate stub Win32 console application to
- * avoid a hanging pipe when redirecting 16-bit console based
- * programs (including MS-DOS console based programs and batch
- * files) on Window 95 and Windows 98.
- *
- * This program is to be launched with redirected standard
- * handles. It will launch the command line specified 16-bit
- * console based application in the same console, forwarding
- * its own redirected standard handles to the 16-bit child.
-
- * AKA solution to the problem described in KB: Q150956.
- */    
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <stdio.h>
-#include <stdlib.h>  /* for malloc and its friends */
-
-const char *usage =
-"This program is used by Python's os.popen function\n"
-"to work around a limitation in Windows 95/98.  It is\n"
-"not designed to be used as a stand-alone program.";
-
-int main(int argc, char *argv[])
-{
-    BOOL bRet;
-    STARTUPINFO si;
-    PROCESS_INFORMATION pi;
-    DWORD exit_code=0;
-    size_t cmdlen = 0;
-    int i;
-    char *cmdline, *cmdlinefill;
-
-    if (argc < 2) {
-        if (GetFileType(GetStdHandle(STD_INPUT_HANDLE))==FILE_TYPE_CHAR)
-            /* Attached to a console, and therefore not executed by Python
-               Display a message box for the inquisitive user
-            */
-            MessageBox(NULL, usage, argv[0], MB_OK);
-        else {
-            /* Eeek - executed by Python, but args are screwed!
-               Write an error message to stdout so there is at
-               least some clue for the end user when it appears
-               in their output.
-               A message box would be hidden and blocks the app.
-             */
-            fprintf(stdout, "Internal popen error - no args specified\n%s\n", usage);
-        }
-        return 1;
-    }
-    /* Build up the command-line from the args.
-       Args with a space are quoted, existing quotes are escaped.
-       To keep things simple calculating the buffer size, we assume
-       every character is a quote - ie, we allocate double what we need
-       in the worst case.  As this is only double the command line passed
-       to us, there is a good chance this is reasonably small, so the total 
-       allocation will almost always be < 512 bytes.
-    */
-    for (i=1;i<argc;i++)
-        cmdlen += strlen(argv[i])*2 + 3; /* one space, maybe 2 quotes */
-    cmdline = cmdlinefill = (char *)malloc(cmdlen+1);
-    if (cmdline == NULL)
-        return -1;
-    for (i=1;i<argc;i++) {
-        const char *arglook;
-        int bQuote = strchr(argv[i], ' ') != NULL;
-        if (bQuote)
-            *cmdlinefill++ = '"';
-        /* escape quotes */
-        for (arglook=argv[i];*arglook;arglook++) {
-            if (*arglook=='"')
-                *cmdlinefill++ = '\\';
-            *cmdlinefill++ = *arglook;
-        }
-        if (bQuote)
-            *cmdlinefill++ = '"';
-        *cmdlinefill++ = ' ';
-    }
-    *cmdlinefill = '\0';
-
-    /* Make child process use this app's standard files. */
-    ZeroMemory(&si, sizeof si);
-    si.cb = sizeof si;
-    si.dwFlags = STARTF_USESTDHANDLES;
-    si.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
-    si.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
-    si.hStdError = GetStdHandle(STD_ERROR_HANDLE);
-
-    bRet = CreateProcess(
-        NULL, cmdline,
-        NULL, NULL,
-        TRUE, 0,
-        NULL, NULL,
-        &si, &pi
-        );
-
-    free(cmdline);
-
-    if (bRet) {
-        if (WaitForSingleObject(pi.hProcess, INFINITE) != WAIT_FAILED) {
-	    GetExitCodeProcess(pi.hProcess, &exit_code);
-	}
-        CloseHandle(pi.hProcess);
-        CloseHandle(pi.hThread);
-        return exit_code;
-    }
-
-    return 1;
-}
diff --git a/PC/winreg.c b/PC/winreg.c
index 3347eb7..63c437e 100644
--- a/PC/winreg.c
+++ b/PC/winreg.c
@@ -871,8 +871,10 @@
         /* ALSO handle ALL unknown data types here.  Even if we can't
            support it natively, we should handle the bits. */
         default:
-            if (value == Py_None)
+            if (value == Py_None) {
                 *retDataSize = 0;
+                *retDataBuf = NULL;
+            }
             else {
                 Py_buffer view;
 
@@ -937,14 +939,14 @@
                 wchar_t *data = (wchar_t *)retDataBuf;
                 int len = retDataSize / 2;
                 int s = countStrings(data, len);
-                wchar_t **str = (wchar_t **)malloc(sizeof(wchar_t *)*s);
+                wchar_t **str = (wchar_t **)PyMem_Malloc(sizeof(wchar_t *)*s);
                 if (str == NULL)
                     return PyErr_NoMemory();
 
                 fixupMultiSZ(str, data, len);
                 obData = PyList_New(s);
                 if (obData == NULL) {
-                    free(str);
+                    PyMem_Free(str);
                     return NULL;
                 }
                 for (index = 0; index < s; index++)
@@ -954,14 +956,14 @@
                         PyErr_SetString(PyExc_OverflowError,
                             "registry string is too long for a Python string");
                         Py_DECREF(obData);
-                        free(str);
+                        PyMem_Free(str);
                         return NULL;
                     }
                     PyList_SetItem(obData,
                                    index,
                                    PyUnicode_FromWideChar(str[index], len));
                 }
-                free(str);
+                PyMem_Free(str);
 
                 break;
             }
@@ -1796,9 +1798,9 @@
     if (PyDict_SetItemString(d, "HKEYType",
                              (PyObject *)&PyHKEY_Type) != 0)
         return NULL;
-    Py_INCREF(PyExc_WindowsError);
+    Py_INCREF(PyExc_OSError);
     if (PyDict_SetItemString(d, "error",
-                             PyExc_WindowsError) != 0)
+                             PyExc_OSError) != 0)
         return NULL;
 
     /* Add the relevant constants */
diff --git a/PCbuild/w9xpopen.vcxproj b/PCbuild/_overlapped.vcxproj
similarity index 65%
rename from PCbuild/w9xpopen.vcxproj
rename to PCbuild/_overlapped.vcxproj
index d1afe22..d0ee72f 100644
--- a/PCbuild/w9xpopen.vcxproj
+++ b/PCbuild/_overlapped.vcxproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
@@ -35,104 +35,95 @@
     </ProjectConfiguration>
   </ItemGroup>
   <PropertyGroup Label="Globals">
-    <ProjectGuid>{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}</ProjectGuid>
-    <RootNamespace>w9xpopen</RootNamespace>
+    <ProjectGuid>{EB6E69DD-04BF-4543-9B92-49FAABCEAC2E}</ProjectGuid>
+    <RootNamespace>_overlapped</RootNamespace>
+    <Keyword>Win32Proj</Keyword>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='PGUpdate|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>NotSet</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='PGInstrument|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>NotSet</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>NotSet</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
     <CharacterSet>NotSet</CharacterSet>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='PGUpdate|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>NotSet</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='PGInstrument|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>NotSet</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>NotSet</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>NotSet</CharacterSet>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <ImportGroup Label="ExtensionSettings">
   </ImportGroup>
   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='PGUpdate|Win32'" Label="PropertySheets">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="pyproject.props" />
-    <Import Project="release.props" />
+    <Import Project="pyd.props" />
     <Import Project="pgupdate.props" />
   </ImportGroup>
   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='PGInstrument|Win32'" Label="PropertySheets">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="pyproject.props" />
-    <Import Project="release.props" />
+    <Import Project="pyd.props" />
     <Import Project="pginstrument.props" />
   </ImportGroup>
   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="pyproject.props" />
-    <Import Project="release.props" />
+    <Import Project="pyd.props" />
   </ImportGroup>
   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="pyproject.props" />
-    <Import Project="debug.props" />
+    <Import Project="pyd_d.props" />
   </ImportGroup>
   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='PGUpdate|x64'" Label="PropertySheets">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="pyproject.props" />
+    <Import Project="pyd.props" />
     <Import Project="x64.props" />
-    <Import Project="release.props" />
     <Import Project="pgupdate.props" />
   </ImportGroup>
   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='PGInstrument|x64'" Label="PropertySheets">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="pyproject.props" />
+    <Import Project="pyd.props" />
     <Import Project="x64.props" />
-    <Import Project="release.props" />
     <Import Project="pginstrument.props" />
   </ImportGroup>
   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="pyproject.props" />
+    <Import Project="pyd.props" />
     <Import Project="x64.props" />
-    <Import Project="release.props" />
   </ImportGroup>
   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="pyproject.props" />
+    <Import Project="pyd_d.props" />
     <Import Project="x64.props" />
-    <Import Project="debug.props" />
   </ImportGroup>
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup>
-    <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
     <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
     <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
     <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
@@ -159,127 +150,83 @@
     <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
-    </ClCompile>
     <Link>
-      <SubSystem>Console</SubSystem>
+      <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <IgnoreSpecificDefaultLibraries>libc;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+      <BaseAddress>0x1D110000</BaseAddress>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <Midl>
       <TargetEnvironment>X64</TargetEnvironment>
     </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
-    </ClCompile>
     <Link>
-      <SubSystem>Console</SubSystem>
+      <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <IgnoreSpecificDefaultLibraries>libc;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+      <BaseAddress>0x1D110000</BaseAddress>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <Optimization>MaxSpeed</Optimization>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-    </ClCompile>
     <Link>
-      <GenerateDebugInformation>false</GenerateDebugInformation>
-      <SubSystem>Console</SubSystem>
+      <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <IgnoreSpecificDefaultLibraries>libc;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+      <BaseAddress>0x1D110000</BaseAddress>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <Midl>
       <TargetEnvironment>X64</TargetEnvironment>
     </Midl>
-    <ClCompile>
-      <Optimization>MaxSpeed</Optimization>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-    </ClCompile>
     <Link>
-      <GenerateDebugInformation>false</GenerateDebugInformation>
-      <SubSystem>Console</SubSystem>
+      <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <IgnoreSpecificDefaultLibraries>libc;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+      <BaseAddress>0x1D110000</BaseAddress>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='PGInstrument|Win32'">
-    <ClCompile>
-      <Optimization>MaxSpeed</Optimization>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-    </ClCompile>
     <Link>
-      <GenerateDebugInformation>false</GenerateDebugInformation>
-      <SubSystem>Console</SubSystem>
-      <ImportLibrary>
-      </ImportLibrary>
+      <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <IgnoreSpecificDefaultLibraries>libc;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+      <BaseAddress>0x1D110000</BaseAddress>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='PGInstrument|x64'">
     <Midl>
       <TargetEnvironment>X64</TargetEnvironment>
     </Midl>
-    <ClCompile>
-      <Optimization>MaxSpeed</Optimization>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-    </ClCompile>
     <Link>
-      <GenerateDebugInformation>false</GenerateDebugInformation>
-      <SubSystem>Console</SubSystem>
-      <ImportLibrary>
-      </ImportLibrary>
+      <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <IgnoreSpecificDefaultLibraries>libc;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+      <BaseAddress>0x1D110000</BaseAddress>
       <TargetMachine>MachineX64</TargetMachine>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='PGUpdate|Win32'">
-    <ClCompile>
-      <Optimization>MaxSpeed</Optimization>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-    </ClCompile>
     <Link>
-      <GenerateDebugInformation>false</GenerateDebugInformation>
-      <SubSystem>Console</SubSystem>
-      <ImportLibrary>
-      </ImportLibrary>
+      <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <IgnoreSpecificDefaultLibraries>libc;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+      <BaseAddress>0x1D110000</BaseAddress>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='PGUpdate|x64'">
     <Midl>
       <TargetEnvironment>X64</TargetEnvironment>
     </Midl>
-    <ClCompile>
-      <Optimization>MaxSpeed</Optimization>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-    </ClCompile>
     <Link>
-      <GenerateDebugInformation>false</GenerateDebugInformation>
-      <SubSystem>Console</SubSystem>
-      <ImportLibrary>
-      </ImportLibrary>
+      <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <IgnoreSpecificDefaultLibraries>libc;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+      <BaseAddress>0x1D110000</BaseAddress>
       <TargetMachine>MachineX64</TargetMachine>
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
-    <ClCompile Include="..\PC\w9xpopen.c" />
+    <ClCompile Include="..\Modules\overlapped.c" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="pythoncore.vcxproj">
+      <Project>{cf7ac3d1-e2df-41d2-bea6-1e2556cdea26}</Project>
+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+    </ProjectReference>
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
diff --git a/PCbuild/w9xpopen.vcxproj.filters b/PCbuild/_overlapped.vcxproj.filters
similarity index 73%
rename from PCbuild/w9xpopen.vcxproj.filters
rename to PCbuild/_overlapped.vcxproj.filters
index dec67ad..78de895 100644
--- a/PCbuild/w9xpopen.vcxproj.filters
+++ b/PCbuild/_overlapped.vcxproj.filters
@@ -2,11 +2,11 @@
 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup>
     <Filter Include="Source Files">
-      <UniqueIdentifier>{abc2dffd-3f2a-47bd-b89b-0314c99ef21e}</UniqueIdentifier>
+      <UniqueIdentifier>{6f67c8db-7de7-4714-a967-2b0d4bc71f2e}</UniqueIdentifier>
     </Filter>
   </ItemGroup>
   <ItemGroup>
-    <ClCompile Include="..\PC\w9xpopen.c">
+    <ClCompile Include="..\Modules\overlapped.c">
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>
diff --git a/PCbuild/_sqlite3.vcxproj b/PCbuild/_sqlite3.vcxproj
index 392dad1..ed35d5b 100644
--- a/PCbuild/_sqlite3.vcxproj
+++ b/PCbuild/_sqlite3.vcxproj
@@ -243,7 +243,6 @@
     <ClInclude Include="..\Modules\_sqlite\module.h" />
     <ClInclude Include="..\Modules\_sqlite\prepare_protocol.h" />
     <ClInclude Include="..\Modules\_sqlite\row.h" />
-    <ClInclude Include="..\Modules\_sqlite\sqlitecompat.h" />
     <ClInclude Include="..\Modules\_sqlite\statement.h" />
     <ClInclude Include="..\Modules\_sqlite\util.h" />
   </ItemGroup>
diff --git a/PCbuild/_sqlite3.vcxproj.filters b/PCbuild/_sqlite3.vcxproj.filters
index 88e5fdb..dce77c9 100644
--- a/PCbuild/_sqlite3.vcxproj.filters
+++ b/PCbuild/_sqlite3.vcxproj.filters
@@ -30,9 +30,6 @@
     <ClInclude Include="..\Modules\_sqlite\row.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="..\Modules\_sqlite\sqlitecompat.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="..\Modules\_sqlite\statement.h">
       <Filter>Header Files</Filter>
     </ClInclude>
diff --git a/PCbuild/_ssl.vcxproj b/PCbuild/_ssl.vcxproj
index ae71d19..7378794 100644
--- a/PCbuild/_ssl.vcxproj
+++ b/PCbuild/_ssl.vcxproj
@@ -158,7 +158,7 @@
       </Command>
     </PreLinkEvent>
     <Link>
-      <AdditionalDependencies>ws2_32.lib;$(opensslDir)\out32\libeay32.lib;$(opensslDir)\out32\ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>ws2_32.lib;crypt32.lib;$(opensslDir)\out32\libeay32.lib;$(opensslDir)\out32\ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@@ -173,7 +173,7 @@
       </Command>
     </PreLinkEvent>
     <Link>
-      <AdditionalDependencies>ws2_32.lib;$(opensslDir)\out64\libeay32.lib;$(opensslDir)\out64\ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>ws2_32.lib;crypt32.lib;$(opensslDir)\out64\libeay32.lib;$(opensslDir)\out64\ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -185,7 +185,7 @@
       </Command>
     </PreLinkEvent>
     <Link>
-      <AdditionalDependencies>ws2_32.lib;$(opensslDir)\out32\libeay32.lib;$(opensslDir)\out32\ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>ws2_32.lib;crypt32.lib;$(opensslDir)\out32\libeay32.lib;$(opensslDir)\out32\ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@@ -200,7 +200,7 @@
       </Command>
     </PreLinkEvent>
     <Link>
-      <AdditionalDependencies>ws2_32.lib;$(opensslDir)\out64\libeay32.lib;$(opensslDir)\out64\ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>ws2_32.lib;crypt32.lib;$(opensslDir)\out64\libeay32.lib;$(opensslDir)\out64\ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='PGInstrument|Win32'">
@@ -212,7 +212,7 @@
       </Command>
     </PreLinkEvent>
     <Link>
-      <AdditionalDependencies>ws2_32.lib;$(opensslDir)\out32\libeay32.lib;$(opensslDir)\out32\ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>ws2_32.lib;crypt32.lib;$(opensslDir)\out32\libeay32.lib;$(opensslDir)\out32\ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='PGInstrument|x64'">
@@ -227,7 +227,7 @@
       </Command>
     </PreLinkEvent>
     <Link>
-      <AdditionalDependencies>ws2_32.lib;$(opensslDir)\out64\libeay32.lib;$(opensslDir)\out64\ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>ws2_32.lib;crypt32.lib;$(opensslDir)\out64\libeay32.lib;$(opensslDir)\out64\ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <TargetMachine>MachineX64</TargetMachine>
     </Link>
   </ItemDefinitionGroup>
@@ -240,7 +240,7 @@
       </Command>
     </PreLinkEvent>
     <Link>
-      <AdditionalDependencies>ws2_32.lib;$(opensslDir)\out32\libeay32.lib;$(opensslDir)\out32\ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>ws2_32.lib;crypt32.lib;$(opensslDir)\out32\libeay32.lib;$(opensslDir)\out32\ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='PGUpdate|x64'">
@@ -255,7 +255,7 @@
       </Command>
     </PreLinkEvent>
     <Link>
-      <AdditionalDependencies>ws2_32.lib;$(opensslDir)\out64\libeay32.lib;$(opensslDir)\out64\ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>ws2_32.lib;crypt32.lib;$(opensslDir)\out64\libeay32.lib;$(opensslDir)\out64\ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <TargetMachine>MachineX64</TargetMachine>
     </Link>
   </ItemDefinitionGroup>
diff --git a/PCbuild/_testembed.vcxproj b/PCbuild/_testembed.vcxproj
new file mode 100644
index 0000000..83c7ad2
--- /dev/null
+++ b/PCbuild/_testembed.vcxproj
@@ -0,0 +1,161 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{6DAC66D9-E703-4624-BE03-49112AB5AA62}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <RootNamespace>_testembed</RootNamespace>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="pyproject.props" />
+    <Import Project="debug.props" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="pyproject.props" />
+    <Import Project="debug.props" />
+    <Import Project="x64.props" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="pyproject.props" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="pyproject.props" />
+    <Import Project="x64.props" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <LinkIncremental>false</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <LinkIncremental>false</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <LinkIncremental>false</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <LinkIncremental>false</LinkIncremental>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClCompile Include="..\Modules\_testembed.c" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="pythoncore.vcxproj">
+      <Project>{cf7ac3d1-e2df-41d2-bea6-1e2556cdea26}</Project>
+      <Private>true</Private>
+      <ReferenceOutputAssembly>true</ReferenceOutputAssembly>
+      <CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
+      <LinkLibraryDependencies>true</LinkLibraryDependencies>
+      <UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file
diff --git a/PCbuild/_testembed.vcxproj.filters b/PCbuild/_testembed.vcxproj.filters
new file mode 100644
index 0000000..dea54d4
--- /dev/null
+++ b/PCbuild/_testembed.vcxproj.filters
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="Resource Files">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\Modules\_testembed.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/PCbuild/w9xpopen.vcxproj b/PCbuild/_testimportmultiple.vcxproj
similarity index 65%
copy from PCbuild/w9xpopen.vcxproj
copy to PCbuild/_testimportmultiple.vcxproj
index d1afe22..84984ff 100644
--- a/PCbuild/w9xpopen.vcxproj
+++ b/PCbuild/_testimportmultiple.vcxproj
@@ -35,104 +35,95 @@
     </ProjectConfiguration>
   </ItemGroup>
   <PropertyGroup Label="Globals">
-    <ProjectGuid>{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}</ProjectGuid>
-    <RootNamespace>w9xpopen</RootNamespace>
+    <ProjectGuid>{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}</ProjectGuid>
+    <RootNamespace>_testimportmultiple</RootNamespace>
+    <Keyword>Win32Proj</Keyword>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='PGUpdate|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>NotSet</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='PGInstrument|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>NotSet</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>NotSet</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
     <CharacterSet>NotSet</CharacterSet>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='PGUpdate|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>NotSet</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='PGInstrument|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>NotSet</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>NotSet</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>NotSet</CharacterSet>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <ImportGroup Label="ExtensionSettings">
   </ImportGroup>
   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='PGUpdate|Win32'" Label="PropertySheets">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="pyproject.props" />
-    <Import Project="release.props" />
+    <Import Project="pyd.props" />
     <Import Project="pgupdate.props" />
   </ImportGroup>
   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='PGInstrument|Win32'" Label="PropertySheets">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="pyproject.props" />
-    <Import Project="release.props" />
+    <Import Project="pyd.props" />
     <Import Project="pginstrument.props" />
   </ImportGroup>
   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="pyproject.props" />
-    <Import Project="release.props" />
+    <Import Project="pyd.props" />
   </ImportGroup>
   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="pyproject.props" />
-    <Import Project="debug.props" />
+    <Import Project="pyd_d.props" />
   </ImportGroup>
   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='PGUpdate|x64'" Label="PropertySheets">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="pyproject.props" />
+    <Import Project="pyd.props" />
     <Import Project="x64.props" />
-    <Import Project="release.props" />
     <Import Project="pgupdate.props" />
   </ImportGroup>
   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='PGInstrument|x64'" Label="PropertySheets">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="pyproject.props" />
+    <Import Project="pyd.props" />
     <Import Project="x64.props" />
-    <Import Project="release.props" />
     <Import Project="pginstrument.props" />
   </ImportGroup>
   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="pyproject.props" />
+    <Import Project="pyd.props" />
     <Import Project="x64.props" />
-    <Import Project="release.props" />
   </ImportGroup>
   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="pyproject.props" />
+    <Import Project="pyd_d.props" />
     <Import Project="x64.props" />
-    <Import Project="debug.props" />
   </ImportGroup>
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup>
-    <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
     <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
     <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
     <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
@@ -159,129 +150,69 @@
     <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
-    </ClCompile>
     <Link>
-      <SubSystem>Console</SubSystem>
+      <BaseAddress>0x1e1F0000</BaseAddress>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <Midl>
       <TargetEnvironment>X64</TargetEnvironment>
     </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
-    </ClCompile>
     <Link>
-      <SubSystem>Console</SubSystem>
+      <BaseAddress>0x1e1F0000</BaseAddress>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <Optimization>MaxSpeed</Optimization>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-    </ClCompile>
     <Link>
-      <GenerateDebugInformation>false</GenerateDebugInformation>
-      <SubSystem>Console</SubSystem>
+      <BaseAddress>0x1e1F0000</BaseAddress>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <Midl>
       <TargetEnvironment>X64</TargetEnvironment>
     </Midl>
-    <ClCompile>
-      <Optimization>MaxSpeed</Optimization>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-    </ClCompile>
     <Link>
-      <GenerateDebugInformation>false</GenerateDebugInformation>
-      <SubSystem>Console</SubSystem>
+      <BaseAddress>0x1e1F0000</BaseAddress>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='PGInstrument|Win32'">
-    <ClCompile>
-      <Optimization>MaxSpeed</Optimization>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-    </ClCompile>
     <Link>
-      <GenerateDebugInformation>false</GenerateDebugInformation>
-      <SubSystem>Console</SubSystem>
-      <ImportLibrary>
-      </ImportLibrary>
+      <BaseAddress>0x1e1F0000</BaseAddress>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='PGInstrument|x64'">
     <Midl>
       <TargetEnvironment>X64</TargetEnvironment>
     </Midl>
-    <ClCompile>
-      <Optimization>MaxSpeed</Optimization>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-    </ClCompile>
     <Link>
-      <GenerateDebugInformation>false</GenerateDebugInformation>
-      <SubSystem>Console</SubSystem>
-      <ImportLibrary>
-      </ImportLibrary>
+      <BaseAddress>0x1e1F0000</BaseAddress>
       <TargetMachine>MachineX64</TargetMachine>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='PGUpdate|Win32'">
-    <ClCompile>
-      <Optimization>MaxSpeed</Optimization>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-    </ClCompile>
     <Link>
-      <GenerateDebugInformation>false</GenerateDebugInformation>
-      <SubSystem>Console</SubSystem>
-      <ImportLibrary>
-      </ImportLibrary>
+      <BaseAddress>0x1e1F0000</BaseAddress>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='PGUpdate|x64'">
     <Midl>
       <TargetEnvironment>X64</TargetEnvironment>
     </Midl>
-    <ClCompile>
-      <Optimization>MaxSpeed</Optimization>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-    </ClCompile>
     <Link>
-      <GenerateDebugInformation>false</GenerateDebugInformation>
-      <SubSystem>Console</SubSystem>
-      <ImportLibrary>
-      </ImportLibrary>
+      <BaseAddress>0x1e1F0000</BaseAddress>
       <TargetMachine>MachineX64</TargetMachine>
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
-    <ClCompile Include="..\PC\w9xpopen.c" />
+    <ClCompile Include="..\Modules\_testimportmultiple.c" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="pythoncore.vcxproj">
+      <Project>{cf7ac3d1-e2df-41d2-bea6-1e2556cdea26}</Project>
+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+    </ProjectReference>
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/PCbuild/w9xpopen.vcxproj.filters b/PCbuild/_testimportmultiple.vcxproj.filters
similarity index 72%
copy from PCbuild/w9xpopen.vcxproj.filters
copy to PCbuild/_testimportmultiple.vcxproj.filters
index dec67ad..db0d0a6 100644
--- a/PCbuild/w9xpopen.vcxproj.filters
+++ b/PCbuild/_testimportmultiple.vcxproj.filters
@@ -2,12 +2,12 @@
 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup>
     <Filter Include="Source Files">
-      <UniqueIdentifier>{abc2dffd-3f2a-47bd-b89b-0314c99ef21e}</UniqueIdentifier>
+      <UniqueIdentifier>{1ec38ad9-1abf-4b80-8628-ac43ccba324b}</UniqueIdentifier>
     </Filter>
   </ItemGroup>
   <ItemGroup>
-    <ClCompile Include="..\PC\w9xpopen.c">
+    <ClCompile Include="..\Modules\_testimportmultiple.c">
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/PCbuild/build_ssl.bat b/PCbuild/build_ssl.bat
index 357b08b..805d77a 100644
--- a/PCbuild/build_ssl.bat
+++ b/PCbuild/build_ssl.bat
@@ -2,10 +2,10 @@
 if not defined HOST_PYTHON (
   if %1 EQU Debug (
     set HOST_PYTHON=python_d.exe
-    if not exist python33_d.dll exit 1
+    if not exist python34_d.dll exit 1
   ) ELSE (
     set HOST_PYTHON=python.exe
-    if not exist python33.dll exit 1
+    if not exist python34.dll exit 1
   )
 )
 %HOST_PYTHON% build_ssl.py %1 %2 %3
diff --git a/PCbuild/build_ssl.py b/PCbuild/build_ssl.py
index 5a7a89e..3cb4f62 100644
--- a/PCbuild/build_ssl.py
+++ b/PCbuild/build_ssl.py
@@ -24,6 +24,7 @@
 # python.exe build_ssl.py Release Win32
 
 import os, sys, re, shutil
+import subprocess
 
 # Find all "foo.exe" files on the PATH.
 def find_all_on_path(filename, extras = None):
@@ -46,29 +47,28 @@
 # is available.
 def find_working_perl(perls):
     for perl in perls:
-        fh = os.popen('"%s" -e "use Win32;"' % perl)
-        fh.read()
-        rc = fh.close()
-        if rc:
+        try:
+            subprocess.check_output([perl, "-e", "use Win32;"])
+        except subprocess.CalledProcessError:
             continue
-        return perl
-    print("Can not find a suitable PERL:")
+        else:
+            return perl
+
     if perls:
-        print(" the following perl interpreters were found:")
+        print("The following perl interpreters were found:")
         for p in perls:
             print(" ", p)
         print(" None of these versions appear suitable for building OpenSSL")
     else:
-        print(" NO perl interpreters were found on this machine at all!")
+        print("NO perl interpreters were found on this machine at all!")
     print(" Please install ActivePerl and ensure it appears on your path")
-    return None
 
 # Fetch SSL directory from VC properties
 def get_ssl_dir():
     propfile = (os.path.join(os.path.dirname(__file__), 'pyproject.props'))
-    with open(propfile) as f:
+    with open(propfile, encoding='utf-8-sig') as f:
         m = re.search('openssl-([^<]+)<', f.read())
-        return "..\..\openssl-"+m.group(1)
+        return "..\externals\openssl-"+m.group(1)
 
 
 def create_makefile64(makefile, m32):
@@ -182,6 +182,17 @@
     if ssl_dir is None:
         sys.exit(1)
 
+    # add our copy of NASM to PATH.  It will be on the same level as openssl
+    for dir in os.listdir(os.path.join(ssl_dir, os.pardir)):
+        if dir.startswith('nasm'):
+            nasm_dir = os.path.join(ssl_dir, os.pardir, dir)
+            nasm_dir = os.path.abspath(nasm_dir)
+            os.environ['PATH'] += os.pathsep.join(['', nasm_dir])
+            break
+    else:
+        print('NASM was not found, make sure it is on PATH')
+
+
     old_cd = os.getcwd()
     try:
         os.chdir(ssl_dir)
diff --git a/PCbuild/build_tkinter.py b/PCbuild/build_tkinter.py
index 4196cf3..c807e7b 100644
--- a/PCbuild/build_tkinter.py
+++ b/PCbuild/build_tkinter.py
@@ -11,16 +11,12 @@
 here = os.path.abspath(os.path.dirname(__file__))
 par = os.path.pardir
 
-TCL = "tcl8.5.11"
-TK = "tk8.5.11"
-TIX = "tix-8.4.3.x"
+TCL = "tcl8.6.1"
+TK = "tk8.6.1"
+TIX = "tix-8.4.3.3"
 
 ROOT = os.path.abspath(os.path.join(here, par, par))
-# Windows 2000 compatibility: WINVER 0x0500
-# http://msdn2.microsoft.com/en-us/library/aa383745.aspx
-NMAKE = ('nmake /nologo /f %s '
-    'COMPILERFLAGS=\"-DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -DNTDDI_VERSION=NTDDI_WIN2KSP4\" '
-    '%s %s')
+NMAKE = ('nmake /nologo /f %s %s %s')
 
 def nmake(makefile, command="", **kw):
     defines = ' '.join(k+'='+str(v) for k, v in kw.items())
diff --git a/PCbuild/kill_python.c b/PCbuild/kill_python.c
index bb323d3..604731f 100644
--- a/PCbuild/kill_python.c
+++ b/PCbuild/kill_python.c
@@ -106,7 +106,7 @@
         /*
          * XXX TODO: if we really wanted to be fancy, we could check the 
          * modules for all processes (not just the python[_d].exe ones)
-         * and see if any of our DLLs are loaded (i.e. python33[_d].dll),
+         * and see if any of our DLLs are loaded (i.e. python34[_d].dll),
          * as that would also inhibit our ability to rebuild the solution.
          * Not worth loosing sleep over though; for now, a simple check 
          * for just the python executable should be sufficient.
diff --git a/PCbuild/pcbuild.sln b/PCbuild/pcbuild.sln
index d6a022f..a346e10 100644
--- a/PCbuild/pcbuild.sln
+++ b/PCbuild/pcbuild.sln
@@ -14,8 +14,6 @@
 EndProject

 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythonw", "pythonw.vcxproj", "{F4229CC3-873C-49AE-9729-DD308ED4CD4A}"

 EndProject

-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "w9xpopen", "w9xpopen.vcxproj", "{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}"

-EndProject

 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_buildinfo", "make_buildinfo.vcxproj", "{C73F0EC1-358B-4177-940F-0846AC8B04CD}"

 EndProject

 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winsound", "winsound.vcxproj", "{28B5D777-DDF2-4B6B-B34F-31D938813856}"

@@ -38,6 +36,8 @@
 EndProject

 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_testcapi", "_testcapi.vcxproj", "{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}"

 EndProject

+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_testimportmultiple", "_testimportmultiple.vcxproj", "{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}"

+EndProject

 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_tkinter", "_tkinter.vcxproj", "{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}"

 EndProject

 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_bz2", "_bz2.vcxproj", "{73FCD2BD-F133-46B7-8EC1-144CD82A59D5}"

@@ -74,6 +74,10 @@
 EndProject

 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_freeze_importlib", "_freeze_importlib.vcxproj", "{19C0C13F-47CA-4432-AFF3-799A296A4DDC}"

 EndProject

+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_overlapped", "_overlapped.vcxproj", "{EB6E69DD-04BF-4543-9B92-49FAABCEAC2E}"

+EndProject

+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_testembed", "_testembed.vcxproj", "{6DAC66D9-E703-4624-BE03-49112AB5AA62}"

+EndProject

 Global

 	GlobalSection(SolutionConfigurationPlatforms) = preSolution

 		Debug|Win32 = Debug|Win32

@@ -150,22 +154,6 @@
 		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.Release|Win32.Build.0 = Release|Win32

 		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.Release|x64.ActiveCfg = Release|x64

 		{F4229CC3-873C-49AE-9729-DD308ED4CD4A}.Release|x64.Build.0 = Release|x64

-		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.Debug|Win32.ActiveCfg = Debug|Win32

-		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.Debug|Win32.Build.0 = Debug|Win32

-		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.Debug|x64.ActiveCfg = Debug|x64

-		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.Debug|x64.Build.0 = Debug|x64

-		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32

-		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.PGInstrument|Win32.Build.0 = PGInstrument|Win32

-		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.PGInstrument|x64.ActiveCfg = PGInstrument|x64

-		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.PGInstrument|x64.Build.0 = PGInstrument|x64

-		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32

-		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.PGUpdate|Win32.Build.0 = PGUpdate|Win32

-		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.PGUpdate|x64.ActiveCfg = PGUpdate|x64

-		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.PGUpdate|x64.Build.0 = PGUpdate|x64

-		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.Release|Win32.ActiveCfg = Release|Win32

-		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.Release|Win32.Build.0 = Release|Win32

-		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.Release|x64.ActiveCfg = Release|x64

-		{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.Release|x64.Build.0 = Release|x64

 		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.Debug|Win32.ActiveCfg = Release|Win32

 		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.Debug|Win32.Build.0 = Release|Win32

 		{C73F0EC1-358B-4177-940F-0846AC8B04CD}.Debug|x64.ActiveCfg = Release|Win32

@@ -342,6 +330,22 @@
 		{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}.Release|Win32.Build.0 = Release|Win32

 		{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}.Release|x64.ActiveCfg = Release|x64

 		{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}.Release|x64.Build.0 = Release|x64

+		{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.Debug|Win32.ActiveCfg = Debug|Win32

+		{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.Debug|Win32.Build.0 = Debug|Win32

+		{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.Debug|x64.ActiveCfg = Debug|x64

+		{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.Debug|x64.Build.0 = Debug|x64

+		{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32

+		{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.PGInstrument|Win32.Build.0 = PGInstrument|Win32

+		{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.PGInstrument|x64.ActiveCfg = PGInstrument|x64

+		{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.PGInstrument|x64.Build.0 = PGInstrument|x64

+		{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32

+		{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.PGUpdate|Win32.Build.0 = PGUpdate|Win32

+		{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.PGUpdate|x64.ActiveCfg = PGUpdate|x64

+		{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.PGUpdate|x64.Build.0 = PGUpdate|x64

+		{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.Release|Win32.ActiveCfg = Release|Win32

+		{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.Release|Win32.Build.0 = Release|Win32

+		{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.Release|x64.ActiveCfg = Release|x64

+		{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.Release|x64.Build.0 = Release|x64

 		{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}.Debug|Win32.ActiveCfg = Debug|Win32

 		{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}.Debug|Win32.Build.0 = Debug|Win32

 		{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}.Debug|x64.ActiveCfg = Debug|x64

@@ -611,6 +615,36 @@
 		{19C0C13F-47CA-4432-AFF3-799A296A4DDC}.PGUpdate|x64.ActiveCfg = Release|Win32

 		{19C0C13F-47CA-4432-AFF3-799A296A4DDC}.Release|Win32.ActiveCfg = Release|Win32

 		{19C0C13F-47CA-4432-AFF3-799A296A4DDC}.Release|x64.ActiveCfg = Release|x64

+		{EB6E69DD-04BF-4543-9B92-49FAABCEAC2E}.Debug|Win32.ActiveCfg = Debug|Win32

+		{EB6E69DD-04BF-4543-9B92-49FAABCEAC2E}.Debug|Win32.Build.0 = Debug|Win32

+		{EB6E69DD-04BF-4543-9B92-49FAABCEAC2E}.Debug|x64.ActiveCfg = Debug|x64

+		{EB6E69DD-04BF-4543-9B92-49FAABCEAC2E}.Debug|x64.Build.0 = Debug|x64

+		{EB6E69DD-04BF-4543-9B92-49FAABCEAC2E}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32

+		{EB6E69DD-04BF-4543-9B92-49FAABCEAC2E}.PGInstrument|Win32.Build.0 = PGInstrument|Win32

+		{EB6E69DD-04BF-4543-9B92-49FAABCEAC2E}.PGInstrument|x64.ActiveCfg = PGInstrument|x64

+		{EB6E69DD-04BF-4543-9B92-49FAABCEAC2E}.PGInstrument|x64.Build.0 = PGInstrument|x64

+		{EB6E69DD-04BF-4543-9B92-49FAABCEAC2E}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32

+		{EB6E69DD-04BF-4543-9B92-49FAABCEAC2E}.PGUpdate|Win32.Build.0 = PGUpdate|Win32

+		{EB6E69DD-04BF-4543-9B92-49FAABCEAC2E}.PGUpdate|x64.ActiveCfg = PGUpdate|x64

+		{EB6E69DD-04BF-4543-9B92-49FAABCEAC2E}.PGUpdate|x64.Build.0 = PGUpdate|x64

+		{EB6E69DD-04BF-4543-9B92-49FAABCEAC2E}.Release|Win32.ActiveCfg = Release|Win32

+		{EB6E69DD-04BF-4543-9B92-49FAABCEAC2E}.Release|Win32.Build.0 = Release|Win32

+		{EB6E69DD-04BF-4543-9B92-49FAABCEAC2E}.Release|x64.ActiveCfg = Release|x64

+		{EB6E69DD-04BF-4543-9B92-49FAABCEAC2E}.Release|x64.Build.0 = Release|x64

+		{6DAC66D9-E703-4624-BE03-49112AB5AA62}.Debug|Win32.ActiveCfg = Debug|Win32

+		{6DAC66D9-E703-4624-BE03-49112AB5AA62}.Debug|Win32.Build.0 = Debug|Win32

+		{6DAC66D9-E703-4624-BE03-49112AB5AA62}.Debug|x64.ActiveCfg = Debug|x64

+		{6DAC66D9-E703-4624-BE03-49112AB5AA62}.Debug|x64.Build.0 = Debug|x64

+		{6DAC66D9-E703-4624-BE03-49112AB5AA62}.PGInstrument|Win32.ActiveCfg = Release|Win32

+		{6DAC66D9-E703-4624-BE03-49112AB5AA62}.PGInstrument|x64.ActiveCfg = Release|x64

+		{6DAC66D9-E703-4624-BE03-49112AB5AA62}.PGUpdate|Win32.ActiveCfg = Release|Win32

+		{6DAC66D9-E703-4624-BE03-49112AB5AA62}.PGUpdate|Win32.Build.0 = Release|Win32

+		{6DAC66D9-E703-4624-BE03-49112AB5AA62}.PGUpdate|x64.ActiveCfg = Release|x64

+		{6DAC66D9-E703-4624-BE03-49112AB5AA62}.PGUpdate|x64.Build.0 = Release|x64

+		{6DAC66D9-E703-4624-BE03-49112AB5AA62}.Release|Win32.ActiveCfg = Release|Win32

+		{6DAC66D9-E703-4624-BE03-49112AB5AA62}.Release|Win32.Build.0 = Release|Win32

+		{6DAC66D9-E703-4624-BE03-49112AB5AA62}.Release|x64.ActiveCfg = Release|x64

+		{6DAC66D9-E703-4624-BE03-49112AB5AA62}.Release|x64.Build.0 = Release|x64

 	EndGlobalSection

 	GlobalSection(SolutionProperties) = preSolution

 		HideSolutionNode = FALSE

diff --git a/PCbuild/pyproject.props b/PCbuild/pyproject.props
index 8155231..e8f3138 100644
--- a/PCbuild/pyproject.props
+++ b/PCbuild/pyproject.props
@@ -13,20 +13,20 @@
     <IntDir>$(SolutionDir)$(PlatformName)-temp-$(Configuration)\$(ProjectName)\</IntDir>
   </PropertyGroup>
   <PropertyGroup Label="UserMacros">
-    <PyDllName>python33$(PyDebugExt)</PyDllName>
+    <PyDllName>python34$(PyDebugExt)</PyDllName>
     <PythonExe>$(OutDir)python$(PyDebugExt).exe</PythonExe>
     <KillPythonExe>$(OutDir)kill_python$(PyDebugExt).exe</KillPythonExe>
-    <externalsDir>..\..</externalsDir>
-    <sqlite3Dir>$(externalsDir)\sqlite-3.7.12</sqlite3Dir>
+    <externalsDir>..\externals</externalsDir>
+    <sqlite3Dir>$(externalsDir)\sqlite-3.8.3.1</sqlite3Dir>
     <bz2Dir>$(externalsDir)\bzip2-1.0.6</bz2Dir>
-    <lzmaDir>$(externalsDir)\xz-5.0.3</lzmaDir>
-    <opensslDir>$(externalsDir)\openssl-1.0.1e</opensslDir>
+    <lzmaDir>$(externalsDir)\xz-5.0.5</lzmaDir>
+    <opensslDir>$(externalsDir)\openssl-1.0.1l</opensslDir>
     <tcltkDir>$(externalsDir)\tcltk</tcltkDir>
     <tcltk64Dir>$(externalsDir)\tcltk64</tcltk64Dir>
-    <tcltkLib>$(tcltkDir)\lib\tcl85.lib;$(tcltkDir)\lib\tk85.lib</tcltkLib>
-    <tcltkLibDebug>$(tcltkDir)\lib\tcl85g.lib;$(tcltkDir)\lib\tk85g.lib</tcltkLibDebug>
-    <tcltk64Lib>$(tcltk64Dir)\lib\tcl85.lib;$(tcltk64Dir)\lib\tk85.lib</tcltk64Lib>
-    <tcltk64LibDebug>$(tcltk64Dir)\lib\tcl85g.lib;$(tcltk64Dir)\lib\tk85g.lib</tcltk64LibDebug>
+    <tcltkLib>$(tcltkDir)\lib\tcl86t.lib;$(tcltkDir)\lib\tk86t.lib</tcltkLib>
+    <tcltkLibDebug>$(tcltkDir)\lib\tcl86tg.lib;$(tcltkDir)\lib\tk86tg.lib</tcltkLibDebug>
+    <tcltk64Lib>$(tcltk64Dir)\lib\tcl86t.lib;$(tcltk64Dir)\lib\tk86t.lib</tcltk64Lib>
+    <tcltk64LibDebug>$(tcltk64Dir)\lib\tcl86tg.lib;$(tcltk64Dir)\lib\tk86tg.lib</tcltk64LibDebug>
   </PropertyGroup>
   <ItemDefinitionGroup>
     <ClCompile>
@@ -49,9 +49,8 @@
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <ProgramDatabaseFile>$(OutDir)$(TargetName).pdb</ProgramDatabaseFile>
       <SubSystem>Windows</SubSystem>
-      <RandomizedBaseAddress>false</RandomizedBaseAddress>
-      <DataExecutionPrevention>
-      </DataExecutionPrevention>
+      <RandomizedBaseAddress>true</RandomizedBaseAddress>
+      <DataExecutionPrevention>true</DataExecutionPrevention>
       <TargetMachine>MachineX86</TargetMachine>
     </Link>
     <ResourceCompile>
diff --git a/PCbuild/python.vcxproj b/PCbuild/python.vcxproj
index d0a9de0..bd12624 100644
--- a/PCbuild/python.vcxproj
+++ b/PCbuild/python.vcxproj
@@ -243,7 +243,7 @@
     <Link>
       <OutputFile>$(OutDir)python_d.exe</OutputFile>
       <SubSystem>Console</SubSystem>
-      <StackReserveSize>2100000</StackReserveSize>
+      <StackReserveSize>4194304</StackReserveSize>
       <BaseAddress>0x1d000000</BaseAddress>
     </Link>
   </ItemDefinitionGroup>
@@ -357,12 +357,8 @@
       <Project>{cf7ac3d1-e2df-41d2-bea6-1e2556cdea26}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </ProjectReference>
-    <ProjectReference Include="w9xpopen.vcxproj">
-      <Project>{e9e0a1f6-0009-4e8c-b8f8-1b8f5d49a058}</Project>
-      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
-    </ProjectReference>
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj
index 8b5c42f..6021cd7 100644
--- a/PCbuild/pythoncore.vcxproj
+++ b/PCbuild/pythoncore.vcxproj
@@ -173,7 +173,7 @@
     </ResourceCompile>
     <PreLinkEvent>
       <Message>Generate build information...</Message>
-      <Command>"$(SolutionDir)make_buildinfo.exe" Release "$(IntDir)"</Command>
+      <Command>"$(SolutionDir)make_buildinfo.exe" Release "$(IntDir)\"</Command>
     </PreLinkEvent>
     <Link>
       <AdditionalDependencies>$(IntDir)getbuildinfo.o;%(AdditionalDependencies)</AdditionalDependencies>
@@ -184,7 +184,7 @@
     <PreBuildEvent>
       <Command>$(KillPythonExe)
 IF %ERRORLEVEL% NEQ 0 (
-    echo kill_python: warning: could not kill running Pythons, exit code %ERRORLEVEL%
+    echo kill_python: war^ning: could not kill running Pythons, exit code %ERRORLEVEL%
     exit /b 0
 )</Command>
     </PreBuildEvent>
@@ -209,7 +209,7 @@
     </ResourceCompile>
     <PreLinkEvent>
       <Message>Generate build information...</Message>
-      <Command>"$(SolutionDir)make_buildinfo.exe" Release "$(IntDir)"</Command>
+      <Command>"$(SolutionDir)make_buildinfo.exe" Release "$(IntDir)\"</Command>
     </PreLinkEvent>
     <Link>
       <AdditionalDependencies>$(IntDir)getbuildinfo.o;%(AdditionalDependencies)</AdditionalDependencies>
@@ -219,7 +219,7 @@
     <PreBuildEvent>
       <Command>$(KillPythonExe)
 IF %ERRORLEVEL% NEQ 0 (
-    echo kill_python: warning: could not kill running Pythons, exit code %ERRORLEVEL%
+    echo kill_python: war^ning: could not kill running Pythons, exit code %ERRORLEVEL%
     exit /b 0
 )</Command>
     </PreBuildEvent>
@@ -254,7 +254,7 @@
     <PreBuildEvent>
       <Command>$(KillPythonExe)
 IF %ERRORLEVEL% NEQ 0 (
-    echo kill_python: warning: could not kill running Pythons, exit code %ERRORLEVEL%
+    echo kill_python: war^ning: could not kill running Pythons, exit code %ERRORLEVEL%
     exit /b 0
 )</Command>
     </PreBuildEvent>
@@ -292,7 +292,7 @@
     <PreBuildEvent>
       <Command>$(KillPythonExe)
 IF %ERRORLEVEL% NEQ 0 (
-    echo kill_python: warning: could not kill running Pythons, exit code %ERRORLEVEL%
+    echo kill_python: war^ning: could not kill running Pythons, exit code %ERRORLEVEL%
     exit /b 0
 )</Command>
     </PreBuildEvent>
@@ -314,7 +314,7 @@
     </ResourceCompile>
     <PreLinkEvent>
       <Message>Generate build information...</Message>
-      <Command>"$(SolutionDir)make_buildinfo.exe" Release "$(IntDir)"</Command>
+      <Command>"$(SolutionDir)make_buildinfo.exe" Release "$(IntDir)\"</Command>
     </PreLinkEvent>
     <Link>
       <AdditionalDependencies>$(IntDir)getbuildinfo.o;%(AdditionalDependencies)</AdditionalDependencies>
@@ -325,7 +325,7 @@
     <PreBuildEvent>
       <Command>$(KillPythonExe)
 IF %ERRORLEVEL% NEQ 0 (
-    echo kill_python: warning: could not kill running Pythons, exit code %ERRORLEVEL%
+    echo kill_python: war^ning: could not kill running Pythons, exit code %ERRORLEVEL%
     exit /b 0
 )</Command>
     </PreBuildEvent>
@@ -350,7 +350,7 @@
     </ResourceCompile>
     <PreLinkEvent>
       <Message>Generate build information...</Message>
-      <Command>"$(SolutionDir)make_buildinfo.exe" Release "$(IntDir)"</Command>
+      <Command>"$(SolutionDir)make_buildinfo.exe" Release "$(IntDir)\"</Command>
     </PreLinkEvent>
     <Link>
       <AdditionalDependencies>$(IntDir)getbuildinfo.o;%(AdditionalDependencies)</AdditionalDependencies>
@@ -361,7 +361,7 @@
     <PreBuildEvent>
       <Command>$(KillPythonExe)
 IF %ERRORLEVEL% NEQ 0 (
-    echo kill_python: warning: could not kill running Pythons, exit code %ERRORLEVEL%
+    echo kill_python: war^ning: could not kill running Pythons, exit code %ERRORLEVEL%
     exit /b 0
 )</Command>
     </PreBuildEvent>
@@ -383,7 +383,7 @@
     </ResourceCompile>
     <PreLinkEvent>
       <Message>Generate build information...</Message>
-      <Command>"$(SolutionDir)make_buildinfo.exe" Release "$(IntDir)"</Command>
+      <Command>"$(SolutionDir)make_buildinfo.exe" Release "$(IntDir)\"</Command>
     </PreLinkEvent>
     <Link>
       <AdditionalDependencies>$(IntDir)getbuildinfo.o;%(AdditionalDependencies)</AdditionalDependencies>
@@ -394,7 +394,7 @@
     <PreBuildEvent>
       <Command>$(KillPythonExe)
 IF %ERRORLEVEL% NEQ 0 (
-    echo kill_python: warning: could not kill running Pythons, exit code %ERRORLEVEL%
+    echo kill_python: war^ning: could not kill running Pythons, exit code %ERRORLEVEL%
     exit /b 0
 )</Command>
     </PreBuildEvent>
@@ -419,7 +419,7 @@
     </ResourceCompile>
     <PreLinkEvent>
       <Message>Generate build information...</Message>
-      <Command>"$(SolutionDir)make_buildinfo.exe" Release "$(IntDir)"</Command>
+      <Command>"$(SolutionDir)make_buildinfo.exe" Release "$(IntDir)\"</Command>
     </PreLinkEvent>
     <Link>
       <AdditionalDependencies>$(IntDir)getbuildinfo.o;%(AdditionalDependencies)</AdditionalDependencies>
@@ -430,7 +430,7 @@
     <PreBuildEvent>
       <Command>$(KillPythonExe)
 IF %ERRORLEVEL% NEQ 0 (
-    echo kill_python: warning: could not kill running Pythons, exit code %ERRORLEVEL%
+    echo kill_python: war^ning: could not kill running Pythons, exit code %ERRORLEVEL%
     exit /b 0
 )</Command>
     </PreBuildEvent>
@@ -492,6 +492,7 @@
     <ClInclude Include="..\Include\patchlevel.h" />
     <ClInclude Include="..\Include\pgen.h" />
     <ClInclude Include="..\Include\pgenheaders.h" />
+    <ClInclude Include="..\Include\pyhash.h" />
     <ClInclude Include="..\Include\py_curses.h" />
     <ClInclude Include="..\Include\pyarena.h" />
     <ClInclude Include="..\Include\pycapsule.h" />
@@ -528,7 +529,11 @@
     <ClInclude Include="..\Include\unicodeobject.h" />
     <ClInclude Include="..\Include\weakrefobject.h" />
     <ClInclude Include="..\Modules\_math.h" />
+    <ClInclude Include="..\Modules\hashtable.h" />
     <ClInclude Include="..\Modules\rotatingtree.h" />
+    <ClInclude Include="..\Modules\sre.h" />
+    <ClInclude Include="..\Modules\sre_constants.h" />
+    <ClInclude Include="..\Modules\sre_lib.h" />
     <ClInclude Include="..\Modules\_io\_iomodule.h" />
     <ClInclude Include="..\Modules\zlib\crc32.h" />
     <ClInclude Include="..\Modules\zlib\deflate.h" />
@@ -555,6 +560,7 @@
     <ClInclude Include="..\Objects\stringlib\fastsearch.h" />
     <ClInclude Include="..\Objects\stringlib\find.h" />
     <ClInclude Include="..\Objects\stringlib\partition.h" />
+    <ClInclude Include="..\Objects\stringlib\replace.h" />
     <ClInclude Include="..\Objects\stringlib\split.h" />
     <ClInclude Include="..\Objects\unicodetype_db.h" />
     <ClInclude Include="..\Parser\parser.h" />
@@ -580,6 +586,7 @@
     <ClCompile Include="..\Modules\_pickle.c" />
     <ClCompile Include="..\Modules\_randommodule.c" />
     <ClCompile Include="..\Modules\_sre.c" />
+    <ClCompile Include="..\Modules\_stat.c" />
     <ClCompile Include="..\Modules\_struct.c" />
     <ClCompile Include="..\Modules\_weakref.c" />
     <ClCompile Include="..\Modules\arraymodule.c" />
@@ -591,12 +598,14 @@
     <ClCompile Include="..\Modules\errnomodule.c" />
     <ClCompile Include="..\Modules\faulthandler.c" />
     <ClCompile Include="..\Modules\gcmodule.c" />
+    <ClCompile Include="..\Modules\hashtable.c" />
     <ClCompile Include="..\Modules\itertoolsmodule.c" />
     <ClCompile Include="..\Modules\main.c" />
     <ClCompile Include="..\Modules\mathmodule.c" />
     <ClCompile Include="..\Modules\md5module.c" />
     <ClCompile Include="..\Modules\mmapmodule.c" />
-    <ClCompile Include="..\Modules\operator.c" />
+    <ClCompile Include="..\Modules\_opcode.c" />
+    <ClCompile Include="..\Modules\_operator.c" />
     <ClCompile Include="..\Modules\parsermodule.c" />
     <ClCompile Include="..\Modules\posixmodule.c" />
     <ClCompile Include="..\Modules\rotatingtree.c" />
@@ -606,6 +615,7 @@
     <ClCompile Include="..\Modules\signalmodule.c" />
     <ClCompile Include="..\Modules\symtablemodule.c" />
     <ClCompile Include="..\Modules\_threadmodule.c" />
+    <ClCompile Include="..\Modules\_tracemalloc.c" />
     <ClCompile Include="..\Modules\timemodule.c" />
     <ClCompile Include="..\Modules\xxsubtype.c" />
     <ClCompile Include="..\Modules\zipimport.c" />
@@ -691,6 +701,7 @@
     <ClCompile Include="..\PC\dl_nt.c" />
     <ClCompile Include="..\PC\getpathp.c" />
     <ClCompile Include="..\PC\msvcrtmodule.c" />
+    <ClCompile Include="..\Python\pyhash.c" />
     <ClCompile Include="..\Python\random.c" />
     <ClCompile Include="..\Python\_warnings.c" />
     <ClCompile Include="..\Python\asdl.c" />
@@ -757,4 +768,4 @@
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters
index 5647feb..8c65247 100644
--- a/PCbuild/pythoncore.vcxproj.filters
+++ b/PCbuild/pythoncore.vcxproj.filters
@@ -300,6 +300,15 @@
     <ClInclude Include="..\Modules\rotatingtree.h">
       <Filter>Modules</Filter>
     </ClInclude>
+    <ClInclude Include="..\Modules\sre.h">
+      <Filter>Modules</Filter>
+    </ClInclude>
+    <ClInclude Include="..\Modules\sre_constants.h">
+      <Filter>Modules</Filter>
+    </ClInclude>
+    <ClInclude Include="..\Modules\sre_lib.h">
+      <Filter>Modules</Filter>
+    </ClInclude>
     <ClInclude Include="..\Modules\_io\_iomodule.h">
       <Filter>Modules\_io</Filter>
     </ClInclude>
@@ -378,6 +387,9 @@
     <ClInclude Include="..\Objects\stringlib\partition.h">
       <Filter>Objects</Filter>
     </ClInclude>
+    <ClInclude Include="..\Objects\stringlib\replace.h">
+      <Filter>Objects</Filter>
+    </ClInclude>
     <ClInclude Include="..\Objects\stringlib\split.h">
       <Filter>Objects</Filter>
     </ClInclude>
@@ -408,9 +420,15 @@
     <ClInclude Include="..\Python\ceval_gil.h">
       <Filter>Python</Filter>
     </ClInclude>
+    <ClInclude Include="..\Include\pyhash.h">
+      <Filter>Include</Filter>
+    </ClInclude>
     <ClInclude Include="..\Include\namespaceobject.h">
       <Filter>Include</Filter>
     </ClInclude>
+    <ClInclude Include="..\Modules\hashtable.h">
+      <Filter>Modules</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\Modules\_bisectmodule.c">
@@ -500,7 +518,7 @@
     <ClCompile Include="..\Modules\mmapmodule.c">
       <Filter>Modules</Filter>
     </ClCompile>
-    <ClCompile Include="..\Modules\operator.c">
+    <ClCompile Include="..\Modules\_operator.c">
       <Filter>Modules</Filter>
     </ClCompile>
     <ClCompile Include="..\Modules\parsermodule.c">
@@ -917,9 +935,24 @@
     <ClCompile Include="..\Modules\_winapi.c">
       <Filter>PC</Filter>
     </ClCompile>
+    <ClCompile Include="..\Modules\_stat.c">
+      <Filter>Modules</Filter>
+    </ClCompile>
+    <ClCompile Include="..\Python\pyhash.c">
+      <Filter>Python</Filter>
+    </ClCompile>
     <ClCompile Include="..\Objects\namespaceobject.c">
       <Filter>Objects</Filter>
     </ClCompile>
+    <ClCompile Include="..\Modules\_opcode.c">
+      <Filter>Modules</Filter>
+    </ClCompile>
+    <ClCompile Include="..\Modules\_tracemalloc.c">
+      <Filter>Modules</Filter>
+    </ClCompile>
+    <ClCompile Include="..\Modules\hashtable.c">
+      <Filter>Modules</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ResourceCompile Include="..\PC\python_nt.rc">
diff --git a/PCbuild/readme.txt b/PCbuild/readme.txt
index 6f07689..018bdf0 100644
--- a/PCbuild/readme.txt
+++ b/PCbuild/readme.txt
@@ -1,200 +1,267 @@
-Building Python using VC++ 10.0
--------------------------------
+Building Python using Microsoft Visual C++
+------------------------------------------
 
-This directory is used to build Python for Win32 and x64 platforms, e.g.
-Windows XP, Vista and Windows Server 2008.  In order to build 32-bit
-debug and release executables, Microsoft Visual C++ 2010 Express Edition is
-required at the very least.  In order to build 64-bit debug and release
-executables, Visual Studio 2010 Standard Edition is required at the very
-least.  In order to build all of the above, as well as generate release builds
-that make use of Profile Guided Optimisation (PG0), Visual Studio 2010
-Professional Edition is required at the very least.  The official Python
-releases are built with this version of Visual Studio.
+This directory is used to build CPython for Microsoft Windows NT version
+5.1 or higher (Windows XP, Windows Server 2003, or later) on 32 and 64
+bit platforms.  Using this directory requires an installation of
+Microsoft Visual C++ 2010 (MSVC 10.0) of any edition.  The specific
+requirements are as follows:
 
-For other Windows platforms and compilers, see ../PC/readme.txt.
+Visual C++ 2010 Express Edition
+    Required for building 32-bit Debug and Release configuration builds.
+    The Python build solution pcbuild.sln makes use of Solution Folders,
+    which this edition does not support.  Any time pcbuild.sln is opened
+    or reloaded by Visual C++, a warning about Solution Folders will be
+    displayed which can be safely dismissed with no impact on your
+    ability to build Python.
+Visual Studio 2010 Professional Edition
+    Required for building 64-bit Debug and Release configuration builds
+Visual Studio 2010 Premium Edition
+    Required for building Release configuration builds that make use of
+    Profile Guided Optimization (PGO), on either platform.
 
-All you need to do is open the workspace "pcbuild.sln" in Visual Studio,
-select the desired combination of configuration and platform and eventually
-build the solution. Unless you are going to debug a problem in the core or
-you are going to create an optimized build you want to select "Release" as
-configuration.
+Installing Service Pack 1 for Visual Studio 2010 is highly recommended
+to avoid LNK1123 errors.
 
-The PCbuild directory is compatible with all versions of Visual Studio from
-VS C++ Express Edition over the standard edition up to the professional
-edition. However the express edition does not support features like solution
-folders or profile guided optimization (PGO). The missing bits and pieces
-won't stop you from building Python.
+All you need to do to build is open the solution "pcbuild.sln" in Visual
+Studio, select the desired combination of configuration and platform,
+then build with "Build Solution" or the F7 keyboard shortcut.  You can
+also build from the command line using the "build.bat" script in this
+directory.  The solution is configured to build the projects in the
+correct order.
 
-The solution is configured to build the projects in the correct order. "Build
-Solution" or F7 takes care of dependencies except for x64 builds. To make
-cross compiling x64 builds on a 32bit OS possible the x64 builds require a
-32bit version of Python.
+The solution currently supports two platforms.  The Win32 platform is
+used to build standard x86-compatible 32-bit binaries, output into this
+directory.  The x64 platform is used for building 64-bit AMD64 (aka
+x86_64 or EM64T) binaries, output into the amd64 sub-directory which
+will be created if it doesn't already exist.  The Itanium (IA-64)
+platform is no longer supported.  See the "Building for AMD64" section
+below for more information about 64-bit builds.
 
-NOTE:
-   You probably don't want to build most of the other subprojects, unless
-   you're building an entire Python distribution from scratch, or
-   specifically making changes to the subsystems they implement, or are
-   running a Python core buildbot test slave; see SUBPROJECTS below)
+Four configuration options are supported by the solution:
+Debug
+    Used to build Python with extra debugging capabilities, equivalent
+    to using ./configure --with-pydebug on UNIX.  All binaries built
+    using this configuration have "_d" added to their name:
+    python34_d.dll, python_d.exe, parser_d.pyd, and so on.  Both the
+    build and rt (run test) batch files in this directory accept a -d
+    option for debug builds.  If you are building Python to help with
+    development of CPython, you will most likely use this configuration.
+PGInstrument, PGUpdate
+    Used to build Python in Release configuration using PGO, which
+    requires Premium Edition of Visual Studio.  See the "Profile
+    Guided Optimization" section below for more information.  Build
+    output from each of these configurations lands in its own
+    sub-directory of this directory.  The official Python releases are
+    built using these configurations.
+Release
+    Used to build Python as it is meant to be used in production
+    settings, though without PGO.
 
-When using the Debug setting, the output files have a _d added to
-their name:  python33_d.dll, python_d.exe, parser_d.pyd, and so on. Both
-the build and rt batch files accept a -d option for debug builds.
-
-The 32bit builds end up in the solution folder PCbuild while the x64 builds
-land in the amd64 subfolder. The PGI and PGO builds for profile guided
-optimization end up in their own folders, too.
 
 Legacy support
 --------------
 
 You can find build directories for older versions of Visual Studio and
-Visual C++ in the PC directory. The legacy build directories are no longer
-actively maintained and may not work out of the box.
+Visual C++ in the PC directory. The legacy build directories are no
+longer actively maintained and may not work out of the box.
 
-PC/VC6/
-    Visual C++ 6.0
-PC/VS7.1/
-    Visual Studio 2003 (7.1)
-PC/VS8.0/
-    Visual Studio 2005 (8.0)
-PC/VS9.0/
-    Visual Studio 2008 (9.0)
+Currently, the only legacy build directory is PC\VS9.0, for Visual
+Studio 2008 (9.0).
 
 
-C RUNTIME
+C Runtime
 ---------
 
-Visual Studio 2010 uses version 10 of the C runtime (MSVCRT10).  The executables
-no longer use the "Side by Side" assemblies used in previous versions of the
-compiler.  This simplifies distribution of applications.
-The run time libraries are available under the VC/Redist folder of your visual studio
-distribution. For more info, see the Readme in the VC/Redist folder.
+Visual Studio 2010 uses version 10 of the C runtime (MSVCRT10).  The
+executables no longer use the "Side by Side" assemblies used in previous
+versions of the compiler.  This simplifies distribution of applications.
 
-SUBPROJECTS
------------
-These subprojects should build out of the box.  Subprojects other than the
-main ones (pythoncore, python, pythonw) generally build a DLL (renamed to
-.pyd) from a specific module so that users don't have to load the code
-supporting that module unless they import the module.
+The run time libraries are available under the VC/Redist folder of your
+Visual Studio distribution. For more info, see the Readme in the
+VC/Redist folder.
 
+
+Sub-Projects
+------------
+
+The CPython project is split up into several smaller sub-projects which
+are managed by the pcbuild.sln solution file.  Each sub-project is
+represented by a .vcxproj and a .vcxproj.filters file starting with the
+name of the sub-project.  These sub-projects fall into a few general
+categories:
+
+The following sub-projects represent the bare minimum required to build
+a functioning CPython interpreter.  If nothing else builds but these,
+you'll have a very limited but usable python.exe:
 pythoncore
     .dll and .lib
 python
     .exe
+kill_python
+    kill_python.exe, a small program designed to kill any instances of
+    python(_d).exe that are running and live in the build output
+    directory; this is meant to avoid build issues due to locked files
+make_buildinfo, make_versioninfo
+    helpers to provide necessary information to the build process
+
+These sub-projects provide extra executables that are useful for running
+CPython in different ways:
 pythonw
-    pythonw.exe, a variant of python.exe that doesn't pop up a DOS box
+    pythonw.exe, a variant of python.exe that doesn't open a Command
+    Prompt window
+pylauncher
+    py.exe, the Python Launcher for Windows, see
+        http://docs.python.org/3/using/windows.html#launcher
+pywlauncher
+    pyw.exe, a variant of py.exe that doesn't open a Command Prompt
+    window
+_testembed
+    _testembed.exe, a small program that embeds Python for testing
+    purposes, used by test_capi.py
+
+These are miscellaneous sub-projects that don't really fit the other
+categories.  By default, these projects do not build in Debug
+configuration:
+_freeze_importlib
+    _freeze_importlib.exe, used to regenerate Python\importlib.h after
+    changes have been made to Lib\importlib\_bootstrap.py
+bdist_wininst
+    ..\Lib\distutils\command\wininst-10.0[-amd64].exe, the base
+    executable used by the distutils bdist_wininst command
+python3dll
+    python3.dll, the PEP 384 Stable ABI dll
+xxlimited
+    builds an example module that makes use of the PEP 384 Stable ABI,
+    see Modules\xxlimited.c
+
+The following sub-projects are for individual modules of the standard
+library which are implemented in C; each one builds a DLL (renamed to
+.pyd) of the same name as the project:
+_ctypes
+_ctypes_test
+_decimal
+_elementtree
+_hashlib
+_msi
+_multiprocessing
+_overlapped
 _socket
-    socketmodule.c
 _testcapi
-    tests of the Python C API, run via Lib/test/test_capi.py, and
-    implemented by module Modules/_testcapimodule.c
 _testbuffer
-    buffer protocol tests, run via Lib/test/test_buffer.py, and
-    implemented by module Modules/_testbuffer.c
+_testimportmultiple
 pyexpat
-    Python wrapper for accelerated XML parsing, which incorporates stable
-    code from the Expat project:  http://sourceforge.net/projects/expat/
 select
-    selectmodule.c
 unicodedata
-    large tables of Unicode data
 winsound
-    play sounds (typically .wav files) under Windows
 
-Python-controlled subprojects that wrap external projects:
-_sqlite3
-    Wraps SQLite 3.7.12, which is currently built by sqlite3.vcxproj.
-_tkinter
-    Wraps the Tk windowing system.  Unlike _sqlite3, there's no
-    corresponding tcltk.vcxproj-type project that builds Tcl/Tk from vcxproj's
-    within our pcbuild.sln, which means this module expects to find a
-    pre-built Tcl/Tk in either ..\..\tcltk for 32-bit or ..\..\tcltk64 for
-    64-bit (relative to this directory).  See below for instructions to build
-    Tcl/Tk.
+The following Python-controlled sub-projects wrap external projects.
+Note that these external libraries are not necessary for a working
+interpreter, but they do implement several major features.  See the
+"Getting External Sources" section below for additional information
+about getting the source for building these libraries.  The sub-projects
+are:
 _bz2
-    Python wrapper for the libbzip2 compression library.  Homepage
+    Python wrapper for version 1.0.6 of the libbzip2 compression library
+    Homepage:
         http://www.bzip.org/
-    Download the source from the python.org copy into the dist
-    directory:
-
-    svn export http://svn.python.org/projects/external/bzip2-1.0.6
-
-    ** NOTE: if you use the Tools\buildbot\external(-amd64).bat approach for
-    obtaining external sources then you don't need to manually get the source
-    above via subversion. **
 _lzma
-    Python wrapper for the liblzma compression library.
-
-    Download the pre-built Windows binaries from http://tukaani.org/xz/, and
-    extract to ..\xz-5.0.3. If you are using a more recent version of liblzma,
-    it will be necessary to rename the directory from xz-<VERSION> to xz-5.0.3.
-
+    Python wrapper for the liblzma compression library, using pre-built
+    binaries of XZ Utils version 5.0.5
+    Homepage:
+        http://tukaani.org/xz/
 _ssl
-    Python wrapper for the secure sockets library.
+    Python wrapper for version 1.0.1j of the OpenSSL secure sockets
+    library, which is built by ssl.vcxproj
+    Homepage:
+        http://www.openssl.org/
 
-    Get the source code through
+    Building OpenSSL requires nasm.exe (the Netwide Assembler), version
+    2.10 or newer from
+        http://www.nasm.us/
+    to be somewhere on your PATH.  More recent versions of OpenSSL may
+    need a later version of NASM. If OpenSSL's self tests don't pass,
+    you should first try to update NASM and do a full rebuild of
+    OpenSSL.  If you use the Tools\buildbot\external(-amd64).bat method
+    for getting sources, it also downloads a version of NASM which the
+    ssl build script will add to PATH.
 
-    svn export http://svn.python.org/projects/external/openssl-1.0.1e
-
-    ** NOTE: if you use the Tools\buildbot\external(-amd64).bat approach for
-    obtaining external sources then you don't need to manually get the source
-    above via subversion. **
-
-    Alternatively, get the latest version from http://www.openssl.org.
-    You can (theoretically) use any version of OpenSSL you like - the
-    build process will automatically select the latest version.
-
-    You must install the NASM assembler 2.10 or newer from
-        http://nasm.sf.net
-    for x86 builds.  Put nasm.exe anywhere in your PATH. More recent
-    versions of OpenSSL may need a later version of NASM. If OpenSSL's self
-    tests don't pass, you should first try to update NASM and do a full
-    rebuild of OpenSSL.
-
-    You can also install ActivePerl from
+    If you like to use the official sources instead of the files from
+    python.org's subversion repository, Perl is required to build the
+    necessary makefiles and assembly files.  ActivePerl is available
+    from
         http://www.activestate.com/activeperl/
-    if you like to use the official sources instead of the files from
-    python's subversion repository. The svn version contains pre-build
-    makefiles and assembly files.
+    The svn.python.org version contains pre-built makefiles and assembly
+    files.
 
-    The build process makes sure that no patented algorithms are included.
-    For now RC5, MDC2 and IDEA are excluded from the build. You may have
-    to manually remove $(OBJ_D)\i_*.obj from ms\nt.mak if the build process
-    complains about missing files or forbidden IDEA. Again the files provided
-    in the subversion repository are already fixed.
+    The build process makes sure that no patented algorithms are
+    included.  For now RC5, MDC2 and IDEA are excluded from the build.
+    You may have to manually remove $(OBJ_D)\i_*.obj from ms\nt.mak if
+    using official sources; the svn.python.org-hosted version is already
+    fixed.
 
-    The MSVC project simply invokes PCBuild/build_ssl.py to perform
-    the build.  This Python script locates and builds your OpenSSL
-    installation, then invokes a simple makefile to build the final .pyd.
+    The ssl.vcxproj sub-project simply invokes PCbuild/build_ssl.py,
+    which locates and builds OpenSSL.
 
     build_ssl.py attempts to catch the most common errors (such as not
     being able to find OpenSSL sources, or not being able to find a Perl
-    that works with OpenSSL) and give a reasonable error message.
-    If you have a problem that doesn't seem to be handled correctly
-    (eg, you know you have ActivePerl but we can't find it), please take
-    a peek at build_ssl.py and suggest patches.  Note that build_ssl.py
+    that works with OpenSSL) and give a reasonable error message.  If
+    you have a problem that doesn't seem to be handled correctly (e.g.,
+    you know you have ActivePerl but we can't find it), please take a
+    peek at build_ssl.py and suggest patches.  Note that build_ssl.py
     should be able to be run directly from the command-line.
 
-    build_ssl.py/MSVC isn't clever enough to clean OpenSSL - you must do
-    this by hand.
+    The ssl sub-project does not have the ability to clean the OpenSSL
+    build; if you need to rebuild, you'll have to clean it by hand.
+_sqlite3
+    Wraps SQLite 3.8.3.1, which is itself built by sqlite3.vcxproj
+    Homepage:
+        http://www.sqlite.org/
+_tkinter
+    Wraps version 8.6.1 of the Tk windowing system.
+    Homepage:
+        http://www.tcl.tk/
 
-The subprojects above wrap external projects Python doesn't control, and as
-such, a little more work is required in order to download the relevant source
-files for each project before they can be built.  The buildbots do this each
-time they're built, so the easiest approach is to run either external.bat or
-external-amd64.bat in the ..\Tools\buildbot directory from ..\, i.e.:
+    Unlike the other external libraries listed above, Tk must be built
+    separately before the _tkinter module can be built. This means that
+    a pre-built Tcl/Tk installation is expected in ..\externals\tcltk
+    (tcltk64 for 64-bit) relative to this directory.  See "Getting
+    External Sources" below for the easiest method to ensure Tcl/Tk is
+    built.
 
-    C:\..\svn.python.org\projects\python\trunk\PCbuild>cd ..
-    C:\..\svn.python.org\projects\python\trunk>Tools\buildbot\external.bat
 
-This extracts all the external subprojects from http://svn.python.org/external
-via Subversion (so you'll need an svn.exe on your PATH) and places them in
-..\.. (relative to this directory).  The external(-amd64).bat scripts will
-also build a debug build of Tcl/Tk; there aren't any equivalent batch files
-for building release versions of Tcl/Tk lying around in the Tools\buildbot
-directory.  If you need to build a release version of Tcl/Tk it isn't hard
-though, take a look at the relevant external(-amd64).bat file and find the
-two nmake lines, then call each one without the 'DEBUG=1' parameter, i.e.:
+Getting External Sources
+------------------------
+
+The last category of sub-projects listed above wrap external projects
+Python doesn't control, and as such a little more work is required in
+order to download the relevant source files for each project before they
+can be built.  The buildbots must ensure that all libraries are present
+before building, so the easiest approach is to run either external.bat
+or external-amd64.bat (depending on platform) in the ..\Tools\buildbot
+directory from ..\, i.e.:
+
+    C:\python\cpython\PCbuild>cd ..
+    C:\python\cpython>Tools\buildbot\external.bat
+
+This extracts all the external sub-projects from
+    http://svn.python.org/projects/external
+via Subversion (so you'll need an svn.exe on your PATH) and places them
+in ..\externals (relative to this directory).
+
+It is also possible to download sources from each project's homepage,
+though you may have to change the names of some folders in order to make
+things work.  For instance, if you were to download a version 5.0.7 of
+XZ Utils, you would need to extract the archive into ..\externals\xz-5.0.5
+anyway, since that is where the solution is set to look for xz.  The
+same is true for all other external projects.
+
+The external(-amd64).bat scripts will also build a debug build of
+Tcl/Tk, but there aren't any equivalent batch files for building release
+versions of Tcl/Tk currently available.  If you need to build a release
+version of Tcl/Tk, just take a look at the relevant external(-amd64).bat
+file and find the two nmake lines, then call each one without the
+'DEBUG=1' parameter, i.e.:
 
 The external-amd64.bat file contains this for tcl:
     nmake -f makefile.vc DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 clean all install
@@ -202,89 +269,53 @@
 So for a release build, you'd call it as:
     nmake -f makefile.vc MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 clean all install
 
-    XXX Should we compile with OPTS=threads?
-    XXX Our installer copies a lot of stuff out of the Tcl/Tk install
-    XXX directory.  Is all of that really needed for Python use of Tcl/Tk?
+Note that the above command is called from within ..\externals\tcl-8.6.1.0\win
+(relative to this directory); don't forget to build Tk as well as Tcl!
 
-This will be cleaned up in the future; ideally Tcl/Tk will be brought into our
-pcbuild.sln as custom .vcxproj files, just as we've recently done with the
-sqlite3.vcxproj file, which will remove the need for Tcl/Tk to be built
-separately via a batch file.
+This will be cleaned up in the future; http://bugs.python.org/issue15968
+tracks adding a new tcltk.vcxproj file that will build Tcl/Tk and Tix
+the same way the other external projects listed above are built.
 
-XXX trent.nelson 02-Apr-08:
-    Having the external subprojects in ..\.. relative to this directory is a
-    bit of a nuisance when you're working on py3k and trunk in parallel and
-    your directory layout mimics that of Python's subversion layout, e.g.:
-
-        C:\..\svn.python.org\projects\python\trunk
-        C:\..\svn.python.org\projects\python\branches\py3k
-        C:\..\svn.python.org\projects\python\branches\release25-maint
-
-    I'd like to change things so that external subprojects are fetched from
-    ..\external instead of ..\.., then provide some helper scripts or batch
-    files that would set up a new ..\external directory with svn checkouts of
-    the relevant branches in http://svn.python.org/projects/external/, or
-    alternatively, use junctions to link ..\external with a pre-existing
-    externals directory being used by another branch.  i.e. if I'm usually
-    working on trunk (and have previously created trunk\external via the
-    provided batch file), and want to do some work on py3k, I'd set up a
-    junction as follows (using the directory structure above as an example):
-
-        C:\..\python\trunk\external <- already exists and has built versions
-                                       of the external subprojects
-
-        C:\..\python\branches\py3k>linkd.exe external ..\..\trunk\external
-        Link created at: external
-
-    Only a slight tweak would be needed to the buildbots such that bots
-    building trunk and py3k could make use of the same facility.  (2.5.x
-    builds need to be kept separate as they're using Visual Studio 7.1.)
-/XXX trent.nelson 02-Apr-08
-
-Building for Itanium
---------------------
-
-Official support for Itanium builds have been dropped from the build. Please
-contact us and provide patches if you are interested in Itanium builds.
 
 Building for AMD64
 ------------------
 
-The build process for AMD64 / x64 is very similar to standard builds. You just
-have to set x64 as platform. In addition, the HOST_PYTHON environment variable
-must point to a Python interpreter (at least 2.4), to support cross-compilation.
+The build process for AMD64 / x64 is very similar to standard builds,
+you just have to set x64 as platform. In addition, the HOST_PYTHON
+environment variable must point to a Python interpreter (at least 2.4),
+to support cross-compilation from Win32.  Note that Visual Studio
+requires Professional Edition or better in order to build 64-bit
+binaries.
 
-Building Python Using the free MS Toolkit Compiler
---------------------------------------------------
-
-Microsoft has withdrawn the free MS Toolkit Compiler, so this can no longer
-be considered a supported option. Instead you can use the free VS C++ Express
-Edition.
 
 Profile Guided Optimization
 ---------------------------
 
 The solution has two configurations for PGO. The PGInstrument
-configuration must be build first. The PGInstrument binaries are
-linked against a profiling library and contain extra debug
-information. The PGUpdate configuration takes the profiling data and
-generates optimized binaries.
+configuration must be built first. The PGInstrument binaries are linked
+against a profiling library and contain extra debug information. The
+PGUpdate configuration takes the profiling data and generates optimized
+binaries.
 
-The build_pgo.bat script automates the creation of optimized binaries. It
-creates the PGI files, runs the unit test suite or PyBench with the PGI
-python and finally creates the optimized files.
+The build_pgo.bat script automates the creation of optimized binaries.
+It creates the PGI files, runs the unit test suite or PyBench with the
+PGI python, and finally creates the optimized files.
 
-http://msdn.microsoft.com/en-us/library/e7k32f4k(VS.100).aspx
+See
+    http://msdn.microsoft.com/en-us/library/e7k32f4k(VS.100).aspx
+for more on this topic.
+
 
 Static library
 --------------
 
-The solution has no configuration for static libraries. However it is easy
-it build a static library instead of a DLL. You simply have to set the
-"Configuration Type" to "Static Library (.lib)" and alter the preprocessor
-macro "Py_ENABLE_SHARED" to "Py_NO_ENABLE_SHARED". You may also have to
-change the "Runtime Library" from "Multi-threaded DLL (/MD)" to
-"Multi-threaded (/MT)".
+The solution has no configuration for static libraries. However it is
+easy to build a static library instead of a DLL. You simply have to set
+the "Configuration Type" to "Static Library (.lib)" and alter the
+preprocessor macro "Py_ENABLE_SHARED" to "Py_NO_ENABLE_SHARED". You may
+also have to change the "Runtime Library" from "Multi-threaded DLL
+(/MD)" to "Multi-threaded (/MT)".
+
 
 Visual Studio properties
 ------------------------
@@ -293,6 +324,7 @@
 (*.props). The properties can be viewed and altered in the Property
 Manager (View -> Other Windows -> Property Manager).
 
+The property files used are (+-- = "also imports"):
  * debug (debug macro: _DEBUG)
  * pginstrument (PGO)
  * pgupdate (PGO)
@@ -305,15 +337,18 @@
     +-- pyproject
  * pyproject (base settings for all projects, user macros like PyDllName)
  * release (release macro: NDEBUG)
+ * sqlite3 (used only by sqlite3.vcxproj)
  * x64 (AMD64 / x64 platform specific settings)
 
-The pyproject propertyfile defines _WIN32 and x64 defines _WIN64 and _M_X64
-although the macros are set by the compiler, too. The GUI doesn't always know
-about the macros and confuse the user with false information.
+The pyproject property file defines _WIN32 and x64 defines _WIN64 and
+_M_X64 although the macros are set by the compiler, too. The GUI doesn't
+always know about the macros and confuse the user with false
+information.
 
-YOUR OWN EXTENSION DLLs
+
+Your Own Extension DLLs
 -----------------------
 
-If you want to create your own extension module DLL, there's an example
-with easy-to-follow instructions in ../PC/example/; read the file
-readme.txt there first.
+If you want to create your own extension module DLL (.pyd), there's an
+example with easy-to-follow instructions in ..\PC\example\; read the
+file readme.txt there first.
diff --git a/PCbuild/rt.bat b/PCbuild/rt.bat
index 7129e20..e569238 100644
--- a/PCbuild/rt.bat
+++ b/PCbuild/rt.bat
@@ -38,7 +38,7 @@
 if "%1"=="-d" (set suffix=_d)    & shift & goto CheckOpts
 if "%1"=="-x64" (set prefix=amd64) & (set tcltk=tcltk64) & shift & goto CheckOpts
 
-PATH %PATH%;%~dp0..\..\%tcltk%\bin
+PATH %PATH%;%~dp0..\externals\%tcltk%\bin
 set exe=%prefix%\python%suffix%
 set cmd=%exe% %dashO% -Wd -E -bb ../lib/test/regrtest.py %1 %2 %3 %4 %5 %6 %7 %8 %9
 if defined qmode goto Qmode
diff --git a/PCbuild/xxlimited.vcxproj b/PCbuild/xxlimited.vcxproj
index 26bc20d..abf41f9 100644
--- a/PCbuild/xxlimited.vcxproj
+++ b/PCbuild/xxlimited.vcxproj
@@ -120,7 +120,7 @@
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <ClCompile>
-      <PreprocessorDefinitions>NDEBUG;_WIN32;_WINDLL;Py_LIMITED_API</PreprocessorDefinitions>
+      <PreprocessorDefinitions>NDEBUG;_WIN32;_WINDLL;Py_LIMITED_API=0x03040000</PreprocessorDefinitions>
     </ClCompile>
     <Link>
       <AdditionalDependencies>wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies>
@@ -140,7 +140,7 @@
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='PGInstrument|Win32'">
     <ClCompile>
-      <PreprocessorDefinitions>Py_LIMITED_API;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>Py_LIMITED_API=0x03040000;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
     <Link>
       <AdditionalDependencies>wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies>
@@ -161,7 +161,7 @@
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='PGUpdate|Win32'">
     <ClCompile>
-      <PreprocessorDefinitions>Py_LIMITED_API;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>Py_LIMITED_API=0x03040000;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
     <Link>
       <AdditionalDependencies>wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies>
@@ -183,11 +183,6 @@
   <ItemGroup>
     <ClCompile Include="..\Modules\xxlimited.c" />
   </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="pythoncore.vcxproj">
-      <Project>{cf7ac3d1-e2df-41d2-bea6-1e2556cdea26}</Project>
-    </ProjectReference>
-  </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
diff --git a/Parser/Python.asdl b/Parser/Python.asdl
index c24d840..debd89e 100644
--- a/Parser/Python.asdl
+++ b/Parser/Python.asdl
@@ -1,4 +1,4 @@
--- ASDL's five builtin types are identifier, int, string, bytes, object
+-- ASDL's six builtin types are identifier, int, string, bytes, object, singleton
 
 module Python
 {
@@ -69,8 +69,8 @@
          | Num(object n) -- a number as a PyObject.
          | Str(string s) -- need to specify raw, unicode, etc?
          | Bytes(bytes s)
+         | NameConstant(singleton value)
          | Ellipsis
-         -- other literals? bools?
 
          -- the following expression can appear in assignment context
          | Attribute(expr value, identifier attr, expr_context ctx)
@@ -103,11 +103,11 @@
     excepthandler = ExceptHandler(expr? type, identifier? name, stmt* body)
                     attributes (int lineno, int col_offset)
 
-    arguments = (arg* args, identifier? vararg, expr? varargannotation,
-                     arg* kwonlyargs, identifier? kwarg,
-                     expr? kwargannotation, expr* defaults,
-                     expr* kw_defaults)
+    arguments = (arg* args, arg? vararg, arg* kwonlyargs, expr* kw_defaults,
+                 arg? kwarg, expr* defaults)
+
     arg = (identifier arg, expr? annotation)
+           attributes (int lineno, int col_offset)
 
     -- keyword arguments supplied to call
     keyword = (identifier arg, expr value)
diff --git a/Parser/asdl.py b/Parser/asdl.py
index 08aa05b..fc1b16c 100644
--- a/Parser/asdl.py
+++ b/Parser/asdl.py
@@ -16,8 +16,9 @@
 
 import spark
 
-def output(string):
-    sys.stdout.write(string + "\n")
+def output(*strings):
+    for s in strings:
+        sys.stdout.write(str(s) + "\n")
 
 
 class Token(object):
@@ -158,11 +159,19 @@
                                   msg="expected attributes, found %s" % id)
         return Sum(sum, attributes)
 
-    def p_product(self, info):
+    def p_product_0(self, info):
         " product ::= ( fields ) "
         _0, fields, _1 = info
         return Product(fields)
 
+    def p_product_1(self, info):
+        " product ::= ( fields ) Id ( fields ) "
+        _0, fields, _1, id, _2, attributes, _3 = info
+        if id.value != "attributes":
+            raise ASDLSyntaxError(id.lineno,
+                                  msg="expected attributes, found %s" % id)
+        return Product(fields, attributes)
+
     def p_sum_0(self, constructor):
         " sum ::= constructor "
         return [constructor[0]]
@@ -222,7 +231,7 @@
         " field ::= Id ? "
         return Field(type[0], opt=True)
 
-builtin_types = ("identifier", "string", "bytes", "int", "object")
+builtin_types = ("identifier", "string", "bytes", "int", "object", "singleton")
 
 # below is a collection of classes to capture the AST of an AST :-)
 # not sure if any of the methods are useful yet, but I'm adding them
@@ -289,11 +298,15 @@
             return "Sum(%s, %s)" % (self.types, self.attributes)
 
 class Product(AST):
-    def __init__(self, fields):
+    def __init__(self, fields, attributes=None):
         self.fields = fields
+        self.attributes = attributes or []
 
     def __repr__(self):
-        return "Product(%s)" % self.fields
+        if self.attributes is None:
+            return "Product(%s)" % self.fields
+        else:
+            return "Product(%s, %s)" % (self.fields, self.attributes)
 
 class VisitorBase(object):
 
@@ -385,7 +398,11 @@
     scanner = ASDLScanner()
     parser = ASDLParser()
 
-    buf = open(file).read()
+    f = open(file)
+    try:
+        buf = f.read()
+    finally:
+        f.close()
     tokens = scanner.tokenize(buf)
     try:
         return parser.parse(tokens)
@@ -416,4 +433,4 @@
             output("Check failed")
         else:
             for dfn in mod.dfns:
-                output(dfn.type)
+                output(dfn.name, dfn.value)
diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py
index 4b84e0f..d6086e6 100755
--- a/Parser/asdl_c.py
+++ b/Parser/asdl_c.py
@@ -209,6 +209,11 @@
         self.emit("struct _%(name)s {" % locals(), depth)
         for f in product.fields:
             self.visit(f, depth + 1)
+        for field in product.attributes:
+            # rudimentary attribute handling
+            type = str(field.type)
+            assert type in asdl.builtin_types, type
+            self.emit("%s %s;" % (type, field.name), depth + 1);
         self.emit("};", depth)
         self.emit("", depth)
 
@@ -493,7 +498,11 @@
 
     def visitField(self, field, name, sum=None, prod=None, depth=0):
         ctype = get_c_type(field.type)
-        self.emit("if (_PyObject_HasAttrId(obj, &PyId_%s)) {" % field.name, depth)
+        if field.opt:
+            check = "exists_not_none(obj, &PyId_%s)" % (field.name,)
+        else:
+            check = "_PyObject_HasAttrId(obj, &PyId_%s)" % (field.name,)
+        self.emit("if (%s) {" % (check,), depth, reflow=False)
         self.emit("int res;", depth+1)
         if field.seq:
             self.emit("Py_ssize_t len;", depth+1)
@@ -510,9 +519,9 @@
             self.emit("}", depth+1)
             self.emit("len = PyList_GET_SIZE(tmp);", depth+1)
             if self.isSimpleType(field):
-                self.emit("%s = asdl_int_seq_new(len, arena);" % field.name, depth+1)
+                self.emit("%s = _Py_asdl_int_seq_new(len, arena);" % field.name, depth+1)
             else:
-                self.emit("%s = asdl_seq_new(len, arena);" % field.name, depth+1)
+                self.emit("%s = _Py_asdl_seq_new(len, arena);" % field.name, depth+1)
             self.emit("if (%s == NULL) goto failed;" % field.name, depth+1)
             self.emit("for (i = 0; i < len; i++) {", depth+1)
             self.emit("%s value;" % ctype, depth+2)
@@ -558,6 +567,13 @@
     def visitProduct(self, prod, name):
         self.emit("static PyTypeObject *%s_type;" % name, 0)
         self.emit("static PyObject* ast2obj_%s(void*);" % name, 0)
+        if prod.attributes:
+            for a in prod.attributes:
+                self.emit_identifier(a.name)
+            self.emit("static char *%s_attributes[] = {" % name, 0)
+            for a in prod.attributes:
+                self.emit('"%s",' % a.name, 1)
+            self.emit("};", 0)
         if prod.fields:
             for f in prod.fields:
                 self.emit_identifier(f.name)
@@ -819,6 +835,7 @@
     Py_INCREF((PyObject*)o);
     return (PyObject*)o;
 }
+#define ast2obj_singleton ast2obj_object
 #define ast2obj_identifier ast2obj_object
 #define ast2obj_string ast2obj_object
 #define ast2obj_bytes ast2obj_object
@@ -830,6 +847,17 @@
 
 /* Conversion Python -> AST */
 
+static int obj2ast_singleton(PyObject *obj, PyObject** out, PyArena* arena)
+{
+    if (obj != Py_None && obj != Py_True && obj != Py_False) {
+        PyErr_SetString(PyExc_ValueError,
+                        "AST singleton must be True, False, or None");
+        return 1;
+    }
+    *out = obj;
+    return 0;
+}
+
 static int obj2ast_object(PyObject* obj, PyObject** out, PyArena* arena)
 {
     if (obj == Py_None)
@@ -904,6 +932,19 @@
     return 0;
 }
 
+static int exists_not_none(PyObject *obj, _Py_Identifier *id)
+{
+    int isnone;
+    PyObject *attr = _PyObject_GetAttrId(obj, id);
+    if (!attr) {
+        PyErr_Clear();
+        return 0;
+    }
+    isnone = attr == Py_None;
+    Py_DECREF(attr);
+    return !isnone;
+}
+
 """, 0, reflow=False)
 
         self.emit("static int init_types(void)",0)
@@ -925,6 +966,11 @@
         self.emit('%s_type = make_type("%s", &AST_type, %s, %d);' %
                         (name, name, fields, len(prod.fields)), 1)
         self.emit("if (!%s_type) return 0;" % name, 1)
+        if prod.attributes:
+            self.emit("if (!add_attributes(%s_type, %s_attributes, %d)) return 0;" %
+                            (name, name, len(prod.attributes)), 1)
+        else:
+            self.emit("if (!add_attributes(%s_type, NULL, 0)) return 0;" % name, 1)
 
     def visitSum(self, sum, name):
         self.emit('%s_type = make_type("%s", &AST_type, NULL, 0);' %
@@ -968,7 +1014,7 @@
         self.emit("if (!m) return NULL;", 1)
         self.emit("d = PyModule_GetDict(m);", 1)
         self.emit('if (PyDict_SetItemString(d, "AST", (PyObject*)&AST_type) < 0) return NULL;', 1)
-        self.emit('if (PyModule_AddIntConstant(m, "PyCF_ONLY_AST", PyCF_ONLY_AST) < 0)', 1)
+        self.emit('if (PyModule_AddIntMacro(m, PyCF_ONLY_AST) < 0)', 1)
         self.emit("return NULL;", 2)
         for dfn in mod.dfns:
             self.visit(dfn)
@@ -1080,6 +1126,12 @@
         self.emit("if (!result) return NULL;", 1)
         for field in prod.fields:
             self.visitField(field, name, 1, True)
+        for a in prod.attributes:
+            self.emit("value = ast2obj_%s(o->%s);" % (a.type, a.name), 1)
+            self.emit("if (!value) goto failed;", 1)
+            self.emit('if (_PyObject_SetAttrId(result, &PyId_%s, value) < 0)' % a.name, 1)
+            self.emit('goto failed;', 2)
+            self.emit('Py_DECREF(value);', 1)
         self.func_end()
 
     def visitConstructor(self, cons, enum, name):
@@ -1142,7 +1194,8 @@
     CODE = """
 PyObject* PyAST_mod2obj(mod_ty t)
 {
-    init_types();
+    if (!init_types())
+        return NULL;
     return ast2obj_mod(t);
 }
 
@@ -1160,7 +1213,8 @@
 
     assert(0 <= mode && mode <= 2);
 
-    init_types();
+    if (!init_types())
+        return NULL;
 
     isinstance = PyObject_IsInstance(ast, req_type[mode]);
     if (isinstance == -1)
@@ -1178,7 +1232,8 @@
 
 int PyAST_Check(PyObject* obj)
 {
-    init_types();
+    if (!init_types())
+        return -1;
     return PyObject_IsInstance(obj, (PyObject*)&AST_type);
 }
 """
diff --git a/Parser/grammar.c b/Parser/grammar.c
index f2a25ca..b598294 100644
--- a/Parser/grammar.c
+++ b/Parser/grammar.c
@@ -29,7 +29,7 @@
 }
 
 dfa *
-adddfa(grammar *g, int type, char *name)
+adddfa(grammar *g, int type, const char *name)
 {
     dfa *d;
 
@@ -63,7 +63,7 @@
     s->s_upper = 0;
     s->s_accel = NULL;
     s->s_accept = 0;
-    return s - d->d_state;
+    return Py_SAFE_DOWNCAST(s - d->d_state, Py_intptr_t, int);
 }
 
 void
@@ -85,7 +85,7 @@
 }
 
 int
-addlabel(labellist *ll, int type, char *str)
+addlabel(labellist *ll, int type, const char *str)
 {
     int i;
     label *lb;
@@ -105,13 +105,13 @@
     if (Py_DebugFlag)
         printf("Label @ %8p, %d: %s\n", ll, ll->ll_nlabels,
                PyGrammar_LabelRepr(lb));
-    return lb - ll->ll_label;
+    return Py_SAFE_DOWNCAST(lb - ll->ll_label, Py_intptr_t, int);
 }
 
 /* Same, but rather dies than adds */
 
 int
-findlabel(labellist *ll, int type, char *str)
+findlabel(labellist *ll, int type, const char *str)
 {
     int i;
 
diff --git a/Parser/grammar1.c b/Parser/grammar1.c
index 440ba44..30a6f07 100644
--- a/Parser/grammar1.c
+++ b/Parser/grammar1.c
@@ -9,9 +9,9 @@
 /* Return the DFA for the given type */
 
 dfa *
-PyGrammar_FindDFA(grammar *g, register int type)
+PyGrammar_FindDFA(grammar *g, int type)
 {
-    register dfa *d;
+    dfa *d;
 #if 1
     /* Massive speed-up */
     d = &g->g_dfa[type - NT_OFFSET];
@@ -19,7 +19,7 @@
     return d;
 #else
     /* Old, slow version */
-    register int i;
+    int i;
 
     for (i = g->g_ndfas, d = g->g_dfa; --i >= 0; d++) {
         if (d->d_type == type)
@@ -30,7 +30,7 @@
 #endif
 }
 
-char *
+const char *
 PyGrammar_LabelRepr(label *lb)
 {
     static char buf[100];
diff --git a/Parser/myreadline.c b/Parser/myreadline.c
index 9f1fc1e..28c7b6d 100644
--- a/Parser/myreadline.c
+++ b/Parser/myreadline.c
@@ -15,10 +15,6 @@
 #include "windows.h"
 #endif /* MS_WINDOWS */
 
-#ifdef __VMS
-extern char* vms__StdioReadline(FILE *sys_stdin, FILE *sys_stdout, char *prompt);
-#endif
-
 
 PyThreadState* _PyOS_ReadlineTState;
 
@@ -68,7 +64,7 @@
         */
         if (GetLastError()==ERROR_OPERATION_ABORTED) {
             hInterruptEvent = _PyOS_SigintEvent();
-            switch (WaitForSingleObject(hInterruptEvent, 10)) {
+            switch (WaitForSingleObjectEx(hInterruptEvent, 10, FALSE)) {
             case WAIT_OBJECT_0:
                 ResetEvent(hInterruptEvent);
                 return 1; /* Interrupt */
@@ -109,22 +105,26 @@
 /* Readline implementation using fgets() */
 
 char *
-PyOS_StdioReadline(FILE *sys_stdin, FILE *sys_stdout, char *prompt)
+PyOS_StdioReadline(FILE *sys_stdin, FILE *sys_stdout, const char *prompt)
 {
     size_t n;
     char *p, *pr;
+
     n = 100;
-    if ((p = (char *)PyMem_MALLOC(n)) == NULL)
+    p = (char *)PyMem_RawMalloc(n);
+    if (p == NULL)
         return NULL;
+
     fflush(sys_stdout);
     if (prompt)
         fprintf(stderr, "%s", prompt);
     fflush(stderr);
+
     switch (my_fgets(p, (int)n, sys_stdin)) {
     case 0: /* Normal case */
         break;
     case 1: /* Interrupt */
-        PyMem_FREE(p);
+        PyMem_RawFree(p);
         return NULL;
     case -1: /* EOF */
     case -2: /* Error */
@@ -136,13 +136,13 @@
     while (n > 0 && p[n-1] != '\n') {
         size_t incr = n+2;
         if (incr > INT_MAX) {
-            PyMem_FREE(p);
+            PyMem_RawFree(p);
             PyErr_SetString(PyExc_OverflowError, "input line too long");
             return NULL;
         }
-        pr = (char *)PyMem_REALLOC(p, n + incr);
+        pr = (char *)PyMem_RawRealloc(p, n + incr);
         if (pr == NULL) {
-            PyMem_FREE(p);
+            PyMem_RawFree(p);
             PyErr_NoMemory();
             return NULL;
         }
@@ -151,9 +151,9 @@
             break;
         n += strlen(p+n);
     }
-    pr = (char *)PyMem_REALLOC(p, n+1);
+    pr = (char *)PyMem_RawRealloc(p, n+1);
     if (pr == NULL) {
-        PyMem_FREE(p);
+        PyMem_RawFree(p);
         PyErr_NoMemory();
         return NULL;
     }
@@ -166,15 +166,16 @@
 
    Note: Python expects in return a buffer allocated with PyMem_Malloc. */
 
-char *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, char *);
+char *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, const char *);
 
 
 /* Interface used by tokenizer.c and bltinmodule.c */
 
 char *
-PyOS_Readline(FILE *sys_stdin, FILE *sys_stdout, char *prompt)
+PyOS_Readline(FILE *sys_stdin, FILE *sys_stdout, const char *prompt)
 {
-    char *rv;
+    char *rv, *res;
+    size_t len;
 
     if (_PyOS_ReadlineTState == PyThreadState_GET()) {
         PyErr_SetString(PyExc_RuntimeError,
@@ -184,11 +185,7 @@
 
 
     if (PyOS_ReadlineFunctionPointer == NULL) {
-#ifdef __VMS
-        PyOS_ReadlineFunctionPointer = vms__StdioReadline;
-#else
         PyOS_ReadlineFunctionPointer = PyOS_StdioReadline;
-#endif
     }
 
 #ifdef WITH_THREAD
@@ -221,5 +218,14 @@
 
     _PyOS_ReadlineTState = NULL;
 
-    return rv;
+    if (rv == NULL)
+        return NULL;
+
+    len = strlen(rv) + 1;
+    res = PyMem_Malloc(len);
+    if (res != NULL)
+        memcpy(res, rv, len);
+    PyMem_RawFree(rv);
+
+    return res;
 }
diff --git a/Parser/node.c b/Parser/node.c
index 1e4f0da..564bd91 100644
--- a/Parser/node.c
+++ b/Parser/node.c
@@ -76,7 +76,7 @@
 
 
 int
-PyNode_AddChild(register node *n1, int type, char *str, int lineno, int col_offset)
+PyNode_AddChild(node *n1, int type, char *str, int lineno, int col_offset)
 {
     const int nch = n1->n_nchildren;
     int current_capacity;
@@ -91,7 +91,7 @@
     if (current_capacity < 0 || required_capacity < 0)
         return E_OVERFLOW;
     if (current_capacity < required_capacity) {
-        if (required_capacity > PY_SIZE_MAX / sizeof(node)) {
+        if ((size_t)required_capacity > PY_SIZE_MAX / sizeof(node)) {
             return E_NOMEM;
         }
         n = n1->n_child;
diff --git a/Parser/parser.c b/Parser/parser.c
index b505fe0..56ec514 100644
--- a/Parser/parser.c
+++ b/Parser/parser.c
@@ -35,9 +35,9 @@
 #define s_empty(s) ((s)->s_top == &(s)->s_base[MAXSTACK])
 
 static int
-s_push(register stack *s, dfa *d, node *parent)
+s_push(stack *s, dfa *d, node *parent)
 {
-    register stackentry *top;
+    stackentry *top;
     if (s->s_top == s->s_base) {
         fprintf(stderr, "s_push: parser stack overflow\n");
         return E_NOMEM;
@@ -52,7 +52,7 @@
 #ifdef Py_DEBUG
 
 static void
-s_pop(register stack *s)
+s_pop(stack *s)
 {
     if (s_empty(s))
         Py_FatalError("s_pop: parser stack underflow -- FATAL");
@@ -105,7 +105,7 @@
 /* PARSER STACK OPERATIONS */
 
 static int
-shift(register stack *s, int type, char *str, int newstate, int lineno, int col_offset)
+shift(stack *s, int type, char *str, int newstate, int lineno, int col_offset)
 {
     int err;
     assert(!s_empty(s));
@@ -117,10 +117,10 @@
 }
 
 static int
-push(register stack *s, int type, dfa *d, int newstate, int lineno, int col_offset)
+push(stack *s, int type, dfa *d, int newstate, int lineno, int col_offset)
 {
     int err;
-    register node *n;
+    node *n;
     n = s->s_top->s_parent;
     assert(!s_empty(s));
     err = PyNode_AddChild(n, type, (char *)NULL, lineno, col_offset);
@@ -134,15 +134,15 @@
 /* PARSER PROPER */
 
 static int
-classify(parser_state *ps, int type, char *str)
+classify(parser_state *ps, int type, const char *str)
 {
     grammar *g = ps->p_grammar;
-    register int n = g->g_ll.ll_nlabels;
+    int n = g->g_ll.ll_nlabels;
 
     if (type == NAME) {
-        register char *s = str;
-        register label *l = g->g_ll.ll_label;
-        register int i;
+        const char *s = str;
+        label *l = g->g_ll.ll_label;
+        int i;
         for (i = n; i > 0; i--, l++) {
             if (l->lb_type != NAME || l->lb_str == NULL ||
                 l->lb_str[0] != s[0] ||
@@ -165,8 +165,8 @@
     }
 
     {
-        register label *l = g->g_ll.ll_label;
-        register int i;
+        label *l = g->g_ll.ll_label;
+        int i;
         for (i = n; i > 0; i--, l++) {
             if (l->lb_type == type && l->lb_str == NULL) {
                 D(printf("It's a token we know\n"));
@@ -225,10 +225,10 @@
 #endif /* future keyword */
 
 int
-PyParser_AddToken(register parser_state *ps, register int type, char *str,
+PyParser_AddToken(parser_state *ps, int type, char *str,
                   int lineno, int col_offset, int *expected_ret)
 {
-    register int ilabel;
+    int ilabel;
     int err;
 
     D(printf("Token %s/'%s' ... ", _PyParser_TokenNames[type], str));
@@ -241,15 +241,15 @@
     /* Loop until the token is shifted or an error occurred */
     for (;;) {
         /* Fetch the current dfa and state */
-        register dfa *d = ps->p_stack.s_top->s_dfa;
-        register state *s = &d->d_state[ps->p_stack.s_top->s_state];
+        dfa *d = ps->p_stack.s_top->s_dfa;
+        state *s = &d->d_state[ps->p_stack.s_top->s_state];
 
         D(printf(" DFA '%s', state %d:",
             d->d_name, ps->p_stack.s_top->s_state));
 
         /* Check accelerator */
         if (s->s_lower <= ilabel && ilabel < s->s_upper) {
-            register int x = s->s_accel[ilabel - s->s_lower];
+            int x = s->s_accel[ilabel - s->s_lower];
             if (x != -1) {
                 if (x & (1<<7)) {
                     /* Push non-terminal */
diff --git a/Parser/parsetok.c b/Parser/parsetok.c
index 7beb735..629dee5 100644
--- a/Parser/parsetok.c
+++ b/Parser/parsetok.c
@@ -13,7 +13,7 @@
 
 /* Forward */
 static node *parsetok(struct tok_state *, grammar *, int, perrdetail *, int *);
-static int initerr(perrdetail *err_ret, const char* filename);
+static int initerr(perrdetail *err_ret, PyObject * filename);
 
 /* Parse input coming from a string.  Return error code, print some errors. */
 node *
@@ -41,9 +41,9 @@
 }
 
 node *
-PyParser_ParseStringFlagsFilenameEx(const char *s, const char *filename,
-                          grammar *g, int start,
-                          perrdetail *err_ret, int *flags)
+PyParser_ParseStringObject(const char *s, PyObject *filename,
+                           grammar *g, int start,
+                           perrdetail *err_ret, int *flags)
 {
     struct tok_state *tok;
     int exec_input = start == file_input;
@@ -67,11 +67,35 @@
     return parsetok(tok, g, start, err_ret, flags);
 }
 
+node *
+PyParser_ParseStringFlagsFilenameEx(const char *s, const char *filename_str,
+                          grammar *g, int start,
+                          perrdetail *err_ret, int *flags)
+{
+    node *n;
+    PyObject *filename = NULL;
+#ifndef PGEN
+    if (filename_str != NULL) {
+        filename = PyUnicode_DecodeFSDefault(filename_str);
+        if (filename == NULL) {
+            err_ret->error = E_ERROR;
+            return NULL;
+        }
+    }
+#endif
+    n = PyParser_ParseStringObject(s, filename, g, start, err_ret, flags);
+#ifndef PGEN
+    Py_XDECREF(filename);
+#endif
+    return n;
+}
+
 /* Parse input coming from a file.  Return error code, print some errors. */
 
 node *
 PyParser_ParseFile(FILE *fp, const char *filename, grammar *g, int start,
-                   char *ps1, char *ps2, perrdetail *err_ret)
+                   const char *ps1, const char *ps2,
+                   perrdetail *err_ret)
 {
     return PyParser_ParseFileFlags(fp, filename, NULL,
                                    g, start, ps1, ps2, err_ret, 0);
@@ -80,7 +104,8 @@
 node *
 PyParser_ParseFileFlags(FILE *fp, const char *filename, const char *enc,
                         grammar *g, int start,
-                        char *ps1, char *ps2, perrdetail *err_ret, int flags)
+                        const char *ps1, const char *ps2,
+                        perrdetail *err_ret, int flags)
 {
     int iflags = flags;
     return PyParser_ParseFileFlagsEx(fp, filename, enc, g, start, ps1,
@@ -88,16 +113,17 @@
 }
 
 node *
-PyParser_ParseFileFlagsEx(FILE *fp, const char *filename,
-                          const char *enc, grammar *g, int start,
-                          char *ps1, char *ps2, perrdetail *err_ret, int *flags)
+PyParser_ParseFileObject(FILE *fp, PyObject *filename,
+                         const char *enc, grammar *g, int start,
+                         const char *ps1, const char *ps2,
+                         perrdetail *err_ret, int *flags)
 {
     struct tok_state *tok;
 
     if (initerr(err_ret, filename) < 0)
         return NULL;
 
-    if ((tok = PyTokenizer_FromFile(fp, (char *)enc, ps1, ps2)) == NULL) {
+    if ((tok = PyTokenizer_FromFile(fp, enc, ps1, ps2)) == NULL) {
         err_ret->error = E_NOMEM;
         return NULL;
     }
@@ -108,6 +134,31 @@
     return parsetok(tok, g, start, err_ret, flags);
 }
 
+node *
+PyParser_ParseFileFlagsEx(FILE *fp, const char *filename,
+                          const char *enc, grammar *g, int start,
+                          const char *ps1, const char *ps2,
+                          perrdetail *err_ret, int *flags)
+{
+    node *n;
+    PyObject *fileobj = NULL;
+#ifndef PGEN
+    if (filename != NULL) {
+        fileobj = PyUnicode_DecodeFSDefault(filename);
+        if (fileobj == NULL) {
+            err_ret->error = E_ERROR;
+            return NULL;
+        }
+    }
+#endif
+    n = PyParser_ParseFileObject(fp, fileobj, enc, g,
+                                 start, ps1, ps2, err_ret, flags);
+#ifndef PGEN
+    Py_XDECREF(fileobj);
+#endif
+    return n;
+}
+
 #ifdef PY_PARSER_REQUIRES_FUTURE_KEYWORD
 #if 0
 static char with_msg[] =
@@ -138,7 +189,6 @@
     int started = 0;
 
     if ((ps = PyParser_New(g, start)) == NULL) {
-        fprintf(stderr, "no mem for new parser\n");
         err_ret->error = E_NOMEM;
         PyTokenizer_Free(tok);
         return NULL;
@@ -178,7 +228,6 @@
         len = b - a; /* XXX this may compute NULL - NULL */
         str = (char *) PyObject_MALLOC(len + 1);
         if (str == NULL) {
-            fprintf(stderr, "no mem for next token\n");
             err_ret->error = E_NOMEM;
             break;
         }
@@ -205,7 +254,8 @@
         }
 #endif
         if (a >= tok->line_start)
-            col_offset = a - tok->line_start;
+            col_offset = Py_SAFE_DOWNCAST(a - tok->line_start,
+                                          Py_intptr_t, int);
         else
             col_offset = -1;
 
@@ -308,7 +358,7 @@
 }
 
 static int
-initerr(perrdetail *err_ret, const char *filename)
+initerr(perrdetail *err_ret, PyObject *filename)
 {
     err_ret->error = E_OK;
     err_ret->lineno = 0;
@@ -317,13 +367,16 @@
     err_ret->token = -1;
     err_ret->expected = -1;
 #ifndef PGEN
-    if (filename)
-        err_ret->filename = PyUnicode_DecodeFSDefault(filename);
-    else
+    if (filename) {
+        Py_INCREF(filename);
+        err_ret->filename = filename;
+    }
+    else {
         err_ret->filename = PyUnicode_FromString("<string>");
-    if (err_ret->filename == NULL) {
-        err_ret->error = E_ERROR;
-        return -1;
+        if (err_ret->filename == NULL) {
+            err_ret->error = E_ERROR;
+            return -1;
+        }
     }
 #endif
     return 0;
diff --git a/Parser/pgenmain.c b/Parser/pgenmain.c
index 52b8380..017a4f9 100644
--- a/Parser/pgenmain.c
+++ b/Parser/pgenmain.c
@@ -113,6 +113,7 @@
         Py_Exit(1);
     }
     g = pgen(n);
+    PyNode_Free(n);
     if (g == NULL) {
         printf("Bad grammar.\n");
         Py_Exit(1);
@@ -137,7 +138,7 @@
 /* No-nonsense my_readline() for tokenizer.c */
 
 char *
-PyOS_Readline(FILE *sys_stdin, FILE *sys_stdout, char *prompt)
+PyOS_Readline(FILE *sys_stdin, FILE *sys_stdout, const char *prompt)
 {
     size_t n = 1000;
     char *p = (char *)PyMem_MALLOC(n);
diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c
index 660c0f0..22accd1 100644
--- a/Parser/tokenizer.c
+++ b/Parser/tokenizer.c
@@ -31,7 +31,7 @@
                || c == '_'\
                || (c >= 128))
 
-extern char *PyOS_Readline(FILE *, FILE *, char *);
+extern char *PyOS_Readline(FILE *, FILE *, const char *);
 /* Return malloc'ed string including trailing \n;
    empty malloc'ed string for EOF;
    NULL if interrupted */
@@ -47,7 +47,7 @@
 
 /* Token names */
 
-char *_PyParser_TokenNames[] = {
+const char *_PyParser_TokenNames[] = {
     "ENDMARKER",
     "NAME",
     "NUMBER",
@@ -691,7 +691,8 @@
 
 static char *
 translate_newlines(const char *s, int exec_input, struct tok_state *tok) {
-    int skip_next_lf = 0, needed_length = strlen(s) + 2, final_length;
+    int skip_next_lf = 0;
+    size_t needed_length = strlen(s) + 2, final_length;
     char *buf, *current;
     char c = '\0';
     buf = PyMem_MALLOC(needed_length);
@@ -799,7 +800,7 @@
     struct tok_state *tok = tok_new();
     if (tok == NULL)
         return NULL;
-    str = (char *)decode_str(str, exec_input, tok);
+    str = decode_str(str, exec_input, tok);
     if (str == NULL) {
         PyTokenizer_Free(tok);
         return NULL;
@@ -842,7 +843,8 @@
 /* Set up tokenizer for file */
 
 struct tok_state *
-PyTokenizer_FromFile(FILE *fp, char* enc, char *ps1, char *ps2)
+PyTokenizer_FromFile(FILE *fp, const char* enc,
+                     const char *ps1, const char *ps2)
 {
     struct tok_state *tok = tok_new();
     if (tok == NULL)
@@ -893,7 +895,7 @@
 /* Get next char, updating state; error code goes into tok->done */
 
 static int
-tok_nextc(register struct tok_state *tok)
+tok_nextc(struct tok_state *tok)
 {
     for (;;) {
         if (tok->cur != tok->inp) {
@@ -1090,7 +1092,7 @@
 /* Back-up one character */
 
 static void
-tok_backup(register struct tok_state *tok, register int c)
+tok_backup(struct tok_state *tok, int c)
 {
     if (c != EOF) {
         if (--tok->cur < tok->buf)
@@ -1320,9 +1322,9 @@
 /* Get next token, after space stripping etc. */
 
 static int
-tok_get(register struct tok_state *tok, char **p_start, char **p_end)
+tok_get(struct tok_state *tok, char **p_start, char **p_end)
 {
-    register int c;
+    int c;
     int blankline, nonascii;
 
     *p_start = *p_end = NULL;
@@ -1332,8 +1334,8 @@
 
     /* Get indentation level */
     if (tok->atbol) {
-        register int col = 0;
-        register int altcol = 0;
+        int col = 0;
+        int altcol = 0;
         tok->atbol = 0;
         for (;;) {
             c = tok_nextc(tok);
@@ -1595,15 +1597,24 @@
                     } while (isdigit(c));
                 }
                 if (c == 'e' || c == 'E') {
-        exponent:
+                    int e;
+                  exponent:
+                    e = c;
                     /* Exponent part */
                     c = tok_nextc(tok);
-                    if (c == '+' || c == '-')
+                    if (c == '+' || c == '-') {
                         c = tok_nextc(tok);
-                    if (!isdigit(c)) {
-                        tok->done = E_TOKEN;
+                        if (!isdigit(c)) {
+                            tok->done = E_TOKEN;
+                            tok_backup(tok, c);
+                            return ERRORTOKEN;
+                        }
+                    } else if (!isdigit(c)) {
                         tok_backup(tok, c);
-                        return ERRORTOKEN;
+                        tok_backup(tok, e);
+                        *p_start = tok->start;
+                        *p_end = tok->cur;
+                        return NUMBER;
                     }
                     do {
                         c = tok_nextc(tok);
@@ -1749,10 +1760,15 @@
     FILE *fp;
     char *p_start =NULL , *p_end =NULL , *encoding = NULL;
 
+#ifndef PGEN
+    fd = _Py_dup(fd);
+#else
     fd = dup(fd);
+#endif
     if (fd < 0) {
         return NULL;
     }
+
     fp = fdopen(fd, "r");
     if (fp == NULL) {
         return NULL;
diff --git a/Parser/tokenizer.h b/Parser/tokenizer.h
index ed1f3aa..1ce6eeb 100644
--- a/Parser/tokenizer.h
+++ b/Parser/tokenizer.h
@@ -35,7 +35,7 @@
     int indstack[MAXINDENT];            /* Stack of indents */
     int atbol;          /* Nonzero if at begin of new line */
     int pendin;         /* Pending indents (if > 0) or dedents (if < 0) */
-    char *prompt, *nextprompt;          /* For interactive prompting */
+    const char *prompt, *nextprompt;          /* For interactive prompting */
     int lineno;         /* Current line number */
     int level;          /* () [] {} Parentheses nesting level */
             /* Used to allow free continuations inside them */
@@ -69,8 +69,8 @@
 
 extern struct tok_state *PyTokenizer_FromString(const char *, int);
 extern struct tok_state *PyTokenizer_FromUTF8(const char *, int);
-extern struct tok_state *PyTokenizer_FromFile(FILE *, char*,
-                                              char *, char *);
+extern struct tok_state *PyTokenizer_FromFile(FILE *, const char*,
+                                              const char *, const char *);
 extern void PyTokenizer_Free(struct tok_state *);
 extern int PyTokenizer_Get(struct tok_state *, char **, char **);
 extern char * PyTokenizer_RestoreEncoding(struct tok_state* tok,
diff --git a/Python/Python-ast.c b/Python/Python-ast.c
index 8543b66..44fdafc 100644
--- a/Python/Python-ast.c
+++ b/Python/Python-ast.c
@@ -271,6 +271,10 @@
 static char *Bytes_fields[]={
     "s",
 };
+static PyTypeObject *NameConstant_type;
+static char *NameConstant_fields[]={
+    "value",
+};
 static PyTypeObject *Ellipsis_type;
 static PyTypeObject *Attribute_type;
 _Py_IDENTIFIER(attr);
@@ -408,24 +412,24 @@
 static PyTypeObject *arguments_type;
 static PyObject* ast2obj_arguments(void*);
 _Py_IDENTIFIER(vararg);
-_Py_IDENTIFIER(varargannotation);
 _Py_IDENTIFIER(kwonlyargs);
-_Py_IDENTIFIER(kwarg);
-_Py_IDENTIFIER(kwargannotation);
-_Py_IDENTIFIER(defaults);
 _Py_IDENTIFIER(kw_defaults);
+_Py_IDENTIFIER(kwarg);
+_Py_IDENTIFIER(defaults);
 static char *arguments_fields[]={
     "args",
     "vararg",
-    "varargannotation",
     "kwonlyargs",
-    "kwarg",
-    "kwargannotation",
-    "defaults",
     "kw_defaults",
+    "kwarg",
+    "defaults",
 };
 static PyTypeObject *arg_type;
 static PyObject* ast2obj_arg(void*);
+static char *arg_attributes[] = {
+    "lineno",
+    "col_offset",
+};
 _Py_IDENTIFIER(arg);
 _Py_IDENTIFIER(annotation);
 static char *arg_fields[]={
@@ -673,6 +677,7 @@
     Py_INCREF((PyObject*)o);
     return (PyObject*)o;
 }
+#define ast2obj_singleton ast2obj_object
 #define ast2obj_identifier ast2obj_object
 #define ast2obj_string ast2obj_object
 #define ast2obj_bytes ast2obj_object
@@ -684,6 +689,17 @@
 
 /* Conversion Python -> AST */
 
+static int obj2ast_singleton(PyObject *obj, PyObject** out, PyArena* arena)
+{
+    if (obj != Py_None && obj != Py_True && obj != Py_False) {
+        PyErr_SetString(PyExc_ValueError,
+                        "AST singleton must be True, False, or None");
+        return 1;
+    }
+    *out = obj;
+    return 0;
+}
+
 static int obj2ast_object(PyObject* obj, PyObject** out, PyArena* arena)
 {
     if (obj == Py_None)
@@ -758,6 +774,19 @@
     return 0;
 }
 
+static int exists_not_none(PyObject *obj, _Py_Identifier *id)
+{
+    int isnone;
+    PyObject *attr = _PyObject_GetAttrId(obj, id);
+    if (!attr) {
+        PyErr_Clear();
+        return 0;
+    }
+    isnone = attr == Py_None;
+    Py_DECREF(attr);
+    return !isnone;
+}
+
 
 static int init_types(void)
 {
@@ -862,6 +891,9 @@
     if (!Str_type) return 0;
     Bytes_type = make_type("Bytes", expr_type, Bytes_fields, 1);
     if (!Bytes_type) return 0;
+    NameConstant_type = make_type("NameConstant", expr_type,
+                                  NameConstant_fields, 1);
+    if (!NameConstant_type) return 0;
     Ellipsis_type = make_type("Ellipsis", expr_type, NULL, 0);
     if (!Ellipsis_type) return 0;
     Attribute_type = make_type("Attribute", expr_type, Attribute_fields, 3);
@@ -1039,6 +1071,7 @@
     comprehension_type = make_type("comprehension", &AST_type,
                                    comprehension_fields, 3);
     if (!comprehension_type) return 0;
+    if (!add_attributes(comprehension_type, NULL, 0)) return 0;
     excepthandler_type = make_type("excepthandler", &AST_type, NULL, 0);
     if (!excepthandler_type) return 0;
     if (!add_attributes(excepthandler_type, excepthandler_attributes, 2))
@@ -1046,16 +1079,21 @@
     ExceptHandler_type = make_type("ExceptHandler", excepthandler_type,
                                    ExceptHandler_fields, 3);
     if (!ExceptHandler_type) return 0;
-    arguments_type = make_type("arguments", &AST_type, arguments_fields, 8);
+    arguments_type = make_type("arguments", &AST_type, arguments_fields, 6);
     if (!arguments_type) return 0;
+    if (!add_attributes(arguments_type, NULL, 0)) return 0;
     arg_type = make_type("arg", &AST_type, arg_fields, 2);
     if (!arg_type) return 0;
+    if (!add_attributes(arg_type, arg_attributes, 2)) return 0;
     keyword_type = make_type("keyword", &AST_type, keyword_fields, 2);
     if (!keyword_type) return 0;
+    if (!add_attributes(keyword_type, NULL, 0)) return 0;
     alias_type = make_type("alias", &AST_type, alias_fields, 2);
     if (!alias_type) return 0;
+    if (!add_attributes(alias_type, NULL, 0)) return 0;
     withitem_type = make_type("withitem", &AST_type, withitem_fields, 2);
     if (!withitem_type) return 0;
+    if (!add_attributes(withitem_type, NULL, 0)) return 0;
     initialized = 1;
     return 1;
 }
@@ -1923,6 +1961,25 @@
 }
 
 expr_ty
+NameConstant(singleton value, int lineno, int col_offset, PyArena *arena)
+{
+    expr_ty p;
+    if (!value) {
+        PyErr_SetString(PyExc_ValueError,
+                        "field value is required for NameConstant");
+        return NULL;
+    }
+    p = (expr_ty)PyArena_Malloc(arena, sizeof(*p));
+    if (!p)
+        return NULL;
+    p->kind = NameConstant_kind;
+    p->v.NameConstant.value = value;
+    p->lineno = lineno;
+    p->col_offset = col_offset;
+    return p;
+}
+
+expr_ty
 Ellipsis(int lineno, int col_offset, PyArena *arena)
 {
     expr_ty p;
@@ -2177,9 +2234,8 @@
 }
 
 arguments_ty
-arguments(asdl_seq * args, identifier vararg, expr_ty varargannotation,
-          asdl_seq * kwonlyargs, identifier kwarg, expr_ty kwargannotation,
-          asdl_seq * defaults, asdl_seq * kw_defaults, PyArena *arena)
+arguments(asdl_seq * args, arg_ty vararg, asdl_seq * kwonlyargs, asdl_seq *
+          kw_defaults, arg_ty kwarg, asdl_seq * defaults, PyArena *arena)
 {
     arguments_ty p;
     p = (arguments_ty)PyArena_Malloc(arena, sizeof(*p));
@@ -2187,12 +2243,10 @@
         return NULL;
     p->args = args;
     p->vararg = vararg;
-    p->varargannotation = varargannotation;
     p->kwonlyargs = kwonlyargs;
-    p->kwarg = kwarg;
-    p->kwargannotation = kwargannotation;
-    p->defaults = defaults;
     p->kw_defaults = kw_defaults;
+    p->kwarg = kwarg;
+    p->defaults = defaults;
     return p;
 }
 
@@ -2943,6 +2997,15 @@
             goto failed;
         Py_DECREF(value);
         break;
+    case NameConstant_kind:
+        result = PyType_GenericNew(NameConstant_type, NULL, NULL);
+        if (!result) goto failed;
+        value = ast2obj_singleton(o->v.NameConstant.value);
+        if (!value) goto failed;
+        if (_PyObject_SetAttrId(result, &PyId_value, value) == -1)
+            goto failed;
+        Py_DECREF(value);
+        break;
     case Ellipsis_kind:
         result = PyType_GenericNew(Ellipsis_type, NULL, NULL);
         if (!result) goto failed;
@@ -3361,29 +3424,24 @@
     if (_PyObject_SetAttrId(result, &PyId_args, value) == -1)
         goto failed;
     Py_DECREF(value);
-    value = ast2obj_identifier(o->vararg);
+    value = ast2obj_arg(o->vararg);
     if (!value) goto failed;
     if (_PyObject_SetAttrId(result, &PyId_vararg, value) == -1)
         goto failed;
     Py_DECREF(value);
-    value = ast2obj_expr(o->varargannotation);
-    if (!value) goto failed;
-    if (_PyObject_SetAttrId(result, &PyId_varargannotation, value) == -1)
-        goto failed;
-    Py_DECREF(value);
     value = ast2obj_list(o->kwonlyargs, ast2obj_arg);
     if (!value) goto failed;
     if (_PyObject_SetAttrId(result, &PyId_kwonlyargs, value) == -1)
         goto failed;
     Py_DECREF(value);
-    value = ast2obj_identifier(o->kwarg);
+    value = ast2obj_list(o->kw_defaults, ast2obj_expr);
     if (!value) goto failed;
-    if (_PyObject_SetAttrId(result, &PyId_kwarg, value) == -1)
+    if (_PyObject_SetAttrId(result, &PyId_kw_defaults, value) == -1)
         goto failed;
     Py_DECREF(value);
-    value = ast2obj_expr(o->kwargannotation);
+    value = ast2obj_arg(o->kwarg);
     if (!value) goto failed;
-    if (_PyObject_SetAttrId(result, &PyId_kwargannotation, value) == -1)
+    if (_PyObject_SetAttrId(result, &PyId_kwarg, value) == -1)
         goto failed;
     Py_DECREF(value);
     value = ast2obj_list(o->defaults, ast2obj_expr);
@@ -3391,11 +3449,6 @@
     if (_PyObject_SetAttrId(result, &PyId_defaults, value) == -1)
         goto failed;
     Py_DECREF(value);
-    value = ast2obj_list(o->kw_defaults, ast2obj_expr);
-    if (!value) goto failed;
-    if (_PyObject_SetAttrId(result, &PyId_kw_defaults, value) == -1)
-        goto failed;
-    Py_DECREF(value);
     return result;
 failed:
     Py_XDECREF(value);
@@ -3425,6 +3478,16 @@
     if (_PyObject_SetAttrId(result, &PyId_annotation, value) == -1)
         goto failed;
     Py_DECREF(value);
+    value = ast2obj_int(o->lineno);
+    if (!value) goto failed;
+    if (_PyObject_SetAttrId(result, &PyId_lineno, value) < 0)
+        goto failed;
+    Py_DECREF(value);
+    value = ast2obj_int(o->col_offset);
+    if (!value) goto failed;
+    if (_PyObject_SetAttrId(result, &PyId_col_offset, value) < 0)
+        goto failed;
+    Py_DECREF(value);
     return result;
 failed:
     Py_XDECREF(value);
@@ -3549,7 +3612,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            body = asdl_seq_new(len, arena);
+            body = _Py_asdl_seq_new(len, arena);
             if (body == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 stmt_ty value;
@@ -3584,7 +3647,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            body = asdl_seq_new(len, arena);
+            body = _Py_asdl_seq_new(len, arena);
             if (body == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 stmt_ty value;
@@ -3641,7 +3704,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            body = asdl_seq_new(len, arena);
+            body = _Py_asdl_seq_new(len, arena);
             if (body == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 stmt_ty value;
@@ -3744,7 +3807,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            body = asdl_seq_new(len, arena);
+            body = _Py_asdl_seq_new(len, arena);
             if (body == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 stmt_ty value;
@@ -3768,7 +3831,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            decorator_list = asdl_seq_new(len, arena);
+            decorator_list = _Py_asdl_seq_new(len, arena);
             if (decorator_list == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 expr_ty value;
@@ -3781,7 +3844,7 @@
             PyErr_SetString(PyExc_TypeError, "required field \"decorator_list\" missing from FunctionDef");
             return 1;
         }
-        if (_PyObject_HasAttrId(obj, &PyId_returns)) {
+        if (exists_not_none(obj, &PyId_returns)) {
             int res;
             tmp = _PyObject_GetAttrId(obj, &PyId_returns);
             if (tmp == NULL) goto failed;
@@ -3831,7 +3894,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            bases = asdl_seq_new(len, arena);
+            bases = _Py_asdl_seq_new(len, arena);
             if (bases == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 expr_ty value;
@@ -3855,7 +3918,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            keywords = asdl_seq_new(len, arena);
+            keywords = _Py_asdl_seq_new(len, arena);
             if (keywords == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 keyword_ty value;
@@ -3868,7 +3931,7 @@
             PyErr_SetString(PyExc_TypeError, "required field \"keywords\" missing from ClassDef");
             return 1;
         }
-        if (_PyObject_HasAttrId(obj, &PyId_starargs)) {
+        if (exists_not_none(obj, &PyId_starargs)) {
             int res;
             tmp = _PyObject_GetAttrId(obj, &PyId_starargs);
             if (tmp == NULL) goto failed;
@@ -3878,7 +3941,7 @@
         } else {
             starargs = NULL;
         }
-        if (_PyObject_HasAttrId(obj, &PyId_kwargs)) {
+        if (exists_not_none(obj, &PyId_kwargs)) {
             int res;
             tmp = _PyObject_GetAttrId(obj, &PyId_kwargs);
             if (tmp == NULL) goto failed;
@@ -3899,7 +3962,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            body = asdl_seq_new(len, arena);
+            body = _Py_asdl_seq_new(len, arena);
             if (body == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 stmt_ty value;
@@ -3923,7 +3986,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            decorator_list = asdl_seq_new(len, arena);
+            decorator_list = _Py_asdl_seq_new(len, arena);
             if (decorator_list == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 expr_ty value;
@@ -3948,7 +4011,7 @@
     if (isinstance) {
         expr_ty value;
 
-        if (_PyObject_HasAttrId(obj, &PyId_value)) {
+        if (exists_not_none(obj, &PyId_value)) {
             int res;
             tmp = _PyObject_GetAttrId(obj, &PyId_value);
             if (tmp == NULL) goto failed;
@@ -3980,7 +4043,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            targets = asdl_seq_new(len, arena);
+            targets = _Py_asdl_seq_new(len, arena);
             if (targets == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 expr_ty value;
@@ -4016,7 +4079,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            targets = asdl_seq_new(len, arena);
+            targets = _Py_asdl_seq_new(len, arena);
             if (targets == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 expr_ty value;
@@ -4133,7 +4196,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            body = asdl_seq_new(len, arena);
+            body = _Py_asdl_seq_new(len, arena);
             if (body == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 stmt_ty value;
@@ -4157,7 +4220,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            orelse = asdl_seq_new(len, arena);
+            orelse = _Py_asdl_seq_new(len, arena);
             if (orelse == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 stmt_ty value;
@@ -4205,7 +4268,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            body = asdl_seq_new(len, arena);
+            body = _Py_asdl_seq_new(len, arena);
             if (body == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 stmt_ty value;
@@ -4229,7 +4292,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            orelse = asdl_seq_new(len, arena);
+            orelse = _Py_asdl_seq_new(len, arena);
             if (orelse == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 stmt_ty value;
@@ -4277,7 +4340,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            body = asdl_seq_new(len, arena);
+            body = _Py_asdl_seq_new(len, arena);
             if (body == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 stmt_ty value;
@@ -4301,7 +4364,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            orelse = asdl_seq_new(len, arena);
+            orelse = _Py_asdl_seq_new(len, arena);
             if (orelse == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 stmt_ty value;
@@ -4337,7 +4400,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            items = asdl_seq_new(len, arena);
+            items = _Py_asdl_seq_new(len, arena);
             if (items == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 withitem_ty value;
@@ -4361,7 +4424,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            body = asdl_seq_new(len, arena);
+            body = _Py_asdl_seq_new(len, arena);
             if (body == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 stmt_ty value;
@@ -4386,7 +4449,7 @@
         expr_ty exc;
         expr_ty cause;
 
-        if (_PyObject_HasAttrId(obj, &PyId_exc)) {
+        if (exists_not_none(obj, &PyId_exc)) {
             int res;
             tmp = _PyObject_GetAttrId(obj, &PyId_exc);
             if (tmp == NULL) goto failed;
@@ -4396,7 +4459,7 @@
         } else {
             exc = NULL;
         }
-        if (_PyObject_HasAttrId(obj, &PyId_cause)) {
+        if (exists_not_none(obj, &PyId_cause)) {
             int res;
             tmp = _PyObject_GetAttrId(obj, &PyId_cause);
             if (tmp == NULL) goto failed;
@@ -4431,7 +4494,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            body = asdl_seq_new(len, arena);
+            body = _Py_asdl_seq_new(len, arena);
             if (body == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 stmt_ty value;
@@ -4455,7 +4518,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            handlers = asdl_seq_new(len, arena);
+            handlers = _Py_asdl_seq_new(len, arena);
             if (handlers == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 excepthandler_ty value;
@@ -4479,7 +4542,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            orelse = asdl_seq_new(len, arena);
+            orelse = _Py_asdl_seq_new(len, arena);
             if (orelse == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 stmt_ty value;
@@ -4503,7 +4566,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            finalbody = asdl_seq_new(len, arena);
+            finalbody = _Py_asdl_seq_new(len, arena);
             if (finalbody == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 stmt_ty value;
@@ -4540,7 +4603,7 @@
             PyErr_SetString(PyExc_TypeError, "required field \"test\" missing from Assert");
             return 1;
         }
-        if (_PyObject_HasAttrId(obj, &PyId_msg)) {
+        if (exists_not_none(obj, &PyId_msg)) {
             int res;
             tmp = _PyObject_GetAttrId(obj, &PyId_msg);
             if (tmp == NULL) goto failed;
@@ -4572,7 +4635,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            names = asdl_seq_new(len, arena);
+            names = _Py_asdl_seq_new(len, arena);
             if (names == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 alias_ty value;
@@ -4598,7 +4661,7 @@
         asdl_seq* names;
         int level;
 
-        if (_PyObject_HasAttrId(obj, &PyId_module)) {
+        if (exists_not_none(obj, &PyId_module)) {
             int res;
             tmp = _PyObject_GetAttrId(obj, &PyId_module);
             if (tmp == NULL) goto failed;
@@ -4619,7 +4682,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            names = asdl_seq_new(len, arena);
+            names = _Py_asdl_seq_new(len, arena);
             if (names == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 alias_ty value;
@@ -4632,7 +4695,7 @@
             PyErr_SetString(PyExc_TypeError, "required field \"names\" missing from ImportFrom");
             return 1;
         }
-        if (_PyObject_HasAttrId(obj, &PyId_level)) {
+        if (exists_not_none(obj, &PyId_level)) {
             int res;
             tmp = _PyObject_GetAttrId(obj, &PyId_level);
             if (tmp == NULL) goto failed;
@@ -4664,7 +4727,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            names = asdl_seq_new(len, arena);
+            names = _Py_asdl_seq_new(len, arena);
             if (names == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 identifier value;
@@ -4699,7 +4762,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            names = asdl_seq_new(len, arena);
+            names = _Py_asdl_seq_new(len, arena);
             if (names == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 identifier value;
@@ -4840,7 +4903,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            values = asdl_seq_new(len, arena);
+            values = _Py_asdl_seq_new(len, arena);
             if (values == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 expr_ty value;
@@ -5036,7 +5099,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            keys = asdl_seq_new(len, arena);
+            keys = _Py_asdl_seq_new(len, arena);
             if (keys == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 expr_ty value;
@@ -5060,7 +5123,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            values = asdl_seq_new(len, arena);
+            values = _Py_asdl_seq_new(len, arena);
             if (values == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 expr_ty value;
@@ -5095,7 +5158,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            elts = asdl_seq_new(len, arena);
+            elts = _Py_asdl_seq_new(len, arena);
             if (elts == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 expr_ty value;
@@ -5142,7 +5205,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            generators = asdl_seq_new(len, arena);
+            generators = _Py_asdl_seq_new(len, arena);
             if (generators == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 comprehension_ty value;
@@ -5189,7 +5252,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            generators = asdl_seq_new(len, arena);
+            generators = _Py_asdl_seq_new(len, arena);
             if (generators == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 comprehension_ty value;
@@ -5248,7 +5311,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            generators = asdl_seq_new(len, arena);
+            generators = _Py_asdl_seq_new(len, arena);
             if (generators == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 comprehension_ty value;
@@ -5295,7 +5358,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            generators = asdl_seq_new(len, arena);
+            generators = _Py_asdl_seq_new(len, arena);
             if (generators == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 comprehension_ty value;
@@ -5319,7 +5382,7 @@
     if (isinstance) {
         expr_ty value;
 
-        if (_PyObject_HasAttrId(obj, &PyId_value)) {
+        if (exists_not_none(obj, &PyId_value)) {
             int res;
             tmp = _PyObject_GetAttrId(obj, &PyId_value);
             if (tmp == NULL) goto failed;
@@ -5386,7 +5449,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            ops = asdl_int_seq_new(len, arena);
+            ops = _Py_asdl_int_seq_new(len, arena);
             if (ops == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 cmpop_ty value;
@@ -5410,7 +5473,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            comparators = asdl_seq_new(len, arena);
+            comparators = _Py_asdl_seq_new(len, arena);
             if (comparators == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 expr_ty value;
@@ -5460,7 +5523,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            args = asdl_seq_new(len, arena);
+            args = _Py_asdl_seq_new(len, arena);
             if (args == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 expr_ty value;
@@ -5484,7 +5547,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            keywords = asdl_seq_new(len, arena);
+            keywords = _Py_asdl_seq_new(len, arena);
             if (keywords == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 keyword_ty value;
@@ -5497,7 +5560,7 @@
             PyErr_SetString(PyExc_TypeError, "required field \"keywords\" missing from Call");
             return 1;
         }
-        if (_PyObject_HasAttrId(obj, &PyId_starargs)) {
+        if (exists_not_none(obj, &PyId_starargs)) {
             int res;
             tmp = _PyObject_GetAttrId(obj, &PyId_starargs);
             if (tmp == NULL) goto failed;
@@ -5507,7 +5570,7 @@
         } else {
             starargs = NULL;
         }
-        if (_PyObject_HasAttrId(obj, &PyId_kwargs)) {
+        if (exists_not_none(obj, &PyId_kwargs)) {
             int res;
             tmp = _PyObject_GetAttrId(obj, &PyId_kwargs);
             if (tmp == NULL) goto failed;
@@ -5588,6 +5651,28 @@
         if (*out == NULL) goto failed;
         return 0;
     }
+    isinstance = PyObject_IsInstance(obj, (PyObject*)NameConstant_type);
+    if (isinstance == -1) {
+        return 1;
+    }
+    if (isinstance) {
+        singleton value;
+
+        if (_PyObject_HasAttrId(obj, &PyId_value)) {
+            int res;
+            tmp = _PyObject_GetAttrId(obj, &PyId_value);
+            if (tmp == NULL) goto failed;
+            res = obj2ast_singleton(tmp, &value, arena);
+            if (res != 0) goto failed;
+            Py_CLEAR(tmp);
+        } else {
+            PyErr_SetString(PyExc_TypeError, "required field \"value\" missing from NameConstant");
+            return 1;
+        }
+        *out = NameConstant(value, lineno, col_offset, arena);
+        if (*out == NULL) goto failed;
+        return 0;
+    }
     isinstance = PyObject_IsInstance(obj, (PyObject*)Ellipsis_type);
     if (isinstance == -1) {
         return 1;
@@ -5777,7 +5862,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            elts = asdl_seq_new(len, arena);
+            elts = _Py_asdl_seq_new(len, arena);
             if (elts == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 expr_ty value;
@@ -5824,7 +5909,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            elts = asdl_seq_new(len, arena);
+            elts = _Py_asdl_seq_new(len, arena);
             if (elts == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 expr_ty value;
@@ -5937,7 +6022,7 @@
         expr_ty upper;
         expr_ty step;
 
-        if (_PyObject_HasAttrId(obj, &PyId_lower)) {
+        if (exists_not_none(obj, &PyId_lower)) {
             int res;
             tmp = _PyObject_GetAttrId(obj, &PyId_lower);
             if (tmp == NULL) goto failed;
@@ -5947,7 +6032,7 @@
         } else {
             lower = NULL;
         }
-        if (_PyObject_HasAttrId(obj, &PyId_upper)) {
+        if (exists_not_none(obj, &PyId_upper)) {
             int res;
             tmp = _PyObject_GetAttrId(obj, &PyId_upper);
             if (tmp == NULL) goto failed;
@@ -5957,7 +6042,7 @@
         } else {
             upper = NULL;
         }
-        if (_PyObject_HasAttrId(obj, &PyId_step)) {
+        if (exists_not_none(obj, &PyId_step)) {
             int res;
             tmp = _PyObject_GetAttrId(obj, &PyId_step);
             if (tmp == NULL) goto failed;
@@ -5989,7 +6074,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            dims = asdl_seq_new(len, arena);
+            dims = _Py_asdl_seq_new(len, arena);
             if (dims == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 slice_ty value;
@@ -6340,7 +6425,7 @@
             goto failed;
         }
         len = PyList_GET_SIZE(tmp);
-        ifs = asdl_seq_new(len, arena);
+        ifs = _Py_asdl_seq_new(len, arena);
         if (ifs == NULL) goto failed;
         for (i = 0; i < len; i++) {
             expr_ty value;
@@ -6404,7 +6489,7 @@
         identifier name;
         asdl_seq* body;
 
-        if (_PyObject_HasAttrId(obj, &PyId_type)) {
+        if (exists_not_none(obj, &PyId_type)) {
             int res;
             tmp = _PyObject_GetAttrId(obj, &PyId_type);
             if (tmp == NULL) goto failed;
@@ -6414,7 +6499,7 @@
         } else {
             type = NULL;
         }
-        if (_PyObject_HasAttrId(obj, &PyId_name)) {
+        if (exists_not_none(obj, &PyId_name)) {
             int res;
             tmp = _PyObject_GetAttrId(obj, &PyId_name);
             if (tmp == NULL) goto failed;
@@ -6435,7 +6520,7 @@
                 goto failed;
             }
             len = PyList_GET_SIZE(tmp);
-            body = asdl_seq_new(len, arena);
+            body = _Py_asdl_seq_new(len, arena);
             if (body == NULL) goto failed;
             for (i = 0; i < len; i++) {
                 stmt_ty value;
@@ -6464,13 +6549,11 @@
 {
     PyObject* tmp = NULL;
     asdl_seq* args;
-    identifier vararg;
-    expr_ty varargannotation;
+    arg_ty vararg;
     asdl_seq* kwonlyargs;
-    identifier kwarg;
-    expr_ty kwargannotation;
-    asdl_seq* defaults;
     asdl_seq* kw_defaults;
+    arg_ty kwarg;
+    asdl_seq* defaults;
 
     if (_PyObject_HasAttrId(obj, &PyId_args)) {
         int res;
@@ -6483,7 +6566,7 @@
             goto failed;
         }
         len = PyList_GET_SIZE(tmp);
-        args = asdl_seq_new(len, arena);
+        args = _Py_asdl_seq_new(len, arena);
         if (args == NULL) goto failed;
         for (i = 0; i < len; i++) {
             arg_ty value;
@@ -6496,26 +6579,16 @@
         PyErr_SetString(PyExc_TypeError, "required field \"args\" missing from arguments");
         return 1;
     }
-    if (_PyObject_HasAttrId(obj, &PyId_vararg)) {
+    if (exists_not_none(obj, &PyId_vararg)) {
         int res;
         tmp = _PyObject_GetAttrId(obj, &PyId_vararg);
         if (tmp == NULL) goto failed;
-        res = obj2ast_identifier(tmp, &vararg, arena);
+        res = obj2ast_arg(tmp, &vararg, arena);
         if (res != 0) goto failed;
         Py_CLEAR(tmp);
     } else {
         vararg = NULL;
     }
-    if (_PyObject_HasAttrId(obj, &PyId_varargannotation)) {
-        int res;
-        tmp = _PyObject_GetAttrId(obj, &PyId_varargannotation);
-        if (tmp == NULL) goto failed;
-        res = obj2ast_expr(tmp, &varargannotation, arena);
-        if (res != 0) goto failed;
-        Py_CLEAR(tmp);
-    } else {
-        varargannotation = NULL;
-    }
     if (_PyObject_HasAttrId(obj, &PyId_kwonlyargs)) {
         int res;
         Py_ssize_t len;
@@ -6527,7 +6600,7 @@
             goto failed;
         }
         len = PyList_GET_SIZE(tmp);
-        kwonlyargs = asdl_seq_new(len, arena);
+        kwonlyargs = _Py_asdl_seq_new(len, arena);
         if (kwonlyargs == NULL) goto failed;
         for (i = 0; i < len; i++) {
             arg_ty value;
@@ -6540,50 +6613,6 @@
         PyErr_SetString(PyExc_TypeError, "required field \"kwonlyargs\" missing from arguments");
         return 1;
     }
-    if (_PyObject_HasAttrId(obj, &PyId_kwarg)) {
-        int res;
-        tmp = _PyObject_GetAttrId(obj, &PyId_kwarg);
-        if (tmp == NULL) goto failed;
-        res = obj2ast_identifier(tmp, &kwarg, arena);
-        if (res != 0) goto failed;
-        Py_CLEAR(tmp);
-    } else {
-        kwarg = NULL;
-    }
-    if (_PyObject_HasAttrId(obj, &PyId_kwargannotation)) {
-        int res;
-        tmp = _PyObject_GetAttrId(obj, &PyId_kwargannotation);
-        if (tmp == NULL) goto failed;
-        res = obj2ast_expr(tmp, &kwargannotation, arena);
-        if (res != 0) goto failed;
-        Py_CLEAR(tmp);
-    } else {
-        kwargannotation = NULL;
-    }
-    if (_PyObject_HasAttrId(obj, &PyId_defaults)) {
-        int res;
-        Py_ssize_t len;
-        Py_ssize_t i;
-        tmp = _PyObject_GetAttrId(obj, &PyId_defaults);
-        if (tmp == NULL) goto failed;
-        if (!PyList_Check(tmp)) {
-            PyErr_Format(PyExc_TypeError, "arguments field \"defaults\" must be a list, not a %.200s", tmp->ob_type->tp_name);
-            goto failed;
-        }
-        len = PyList_GET_SIZE(tmp);
-        defaults = asdl_seq_new(len, arena);
-        if (defaults == NULL) goto failed;
-        for (i = 0; i < len; i++) {
-            expr_ty value;
-            res = obj2ast_expr(PyList_GET_ITEM(tmp, i), &value, arena);
-            if (res != 0) goto failed;
-            asdl_seq_SET(defaults, i, value);
-        }
-        Py_CLEAR(tmp);
-    } else {
-        PyErr_SetString(PyExc_TypeError, "required field \"defaults\" missing from arguments");
-        return 1;
-    }
     if (_PyObject_HasAttrId(obj, &PyId_kw_defaults)) {
         int res;
         Py_ssize_t len;
@@ -6595,7 +6624,7 @@
             goto failed;
         }
         len = PyList_GET_SIZE(tmp);
-        kw_defaults = asdl_seq_new(len, arena);
+        kw_defaults = _Py_asdl_seq_new(len, arena);
         if (kw_defaults == NULL) goto failed;
         for (i = 0; i < len; i++) {
             expr_ty value;
@@ -6608,8 +6637,42 @@
         PyErr_SetString(PyExc_TypeError, "required field \"kw_defaults\" missing from arguments");
         return 1;
     }
-    *out = arguments(args, vararg, varargannotation, kwonlyargs, kwarg,
-                     kwargannotation, defaults, kw_defaults, arena);
+    if (exists_not_none(obj, &PyId_kwarg)) {
+        int res;
+        tmp = _PyObject_GetAttrId(obj, &PyId_kwarg);
+        if (tmp == NULL) goto failed;
+        res = obj2ast_arg(tmp, &kwarg, arena);
+        if (res != 0) goto failed;
+        Py_CLEAR(tmp);
+    } else {
+        kwarg = NULL;
+    }
+    if (_PyObject_HasAttrId(obj, &PyId_defaults)) {
+        int res;
+        Py_ssize_t len;
+        Py_ssize_t i;
+        tmp = _PyObject_GetAttrId(obj, &PyId_defaults);
+        if (tmp == NULL) goto failed;
+        if (!PyList_Check(tmp)) {
+            PyErr_Format(PyExc_TypeError, "arguments field \"defaults\" must be a list, not a %.200s", tmp->ob_type->tp_name);
+            goto failed;
+        }
+        len = PyList_GET_SIZE(tmp);
+        defaults = _Py_asdl_seq_new(len, arena);
+        if (defaults == NULL) goto failed;
+        for (i = 0; i < len; i++) {
+            expr_ty value;
+            res = obj2ast_expr(PyList_GET_ITEM(tmp, i), &value, arena);
+            if (res != 0) goto failed;
+            asdl_seq_SET(defaults, i, value);
+        }
+        Py_CLEAR(tmp);
+    } else {
+        PyErr_SetString(PyExc_TypeError, "required field \"defaults\" missing from arguments");
+        return 1;
+    }
+    *out = arguments(args, vararg, kwonlyargs, kw_defaults, kwarg, defaults,
+                     arena);
     return 0;
 failed:
     Py_XDECREF(tmp);
@@ -6634,7 +6697,7 @@
         PyErr_SetString(PyExc_TypeError, "required field \"arg\" missing from arg");
         return 1;
     }
-    if (_PyObject_HasAttrId(obj, &PyId_annotation)) {
+    if (exists_not_none(obj, &PyId_annotation)) {
         int res;
         tmp = _PyObject_GetAttrId(obj, &PyId_annotation);
         if (tmp == NULL) goto failed;
@@ -6705,7 +6768,7 @@
         PyErr_SetString(PyExc_TypeError, "required field \"name\" missing from alias");
         return 1;
     }
-    if (_PyObject_HasAttrId(obj, &PyId_asname)) {
+    if (exists_not_none(obj, &PyId_asname)) {
         int res;
         tmp = _PyObject_GetAttrId(obj, &PyId_asname);
         if (tmp == NULL) goto failed;
@@ -6740,7 +6803,7 @@
         PyErr_SetString(PyExc_TypeError, "required field \"context_expr\" missing from withitem");
         return 1;
     }
-    if (_PyObject_HasAttrId(obj, &PyId_optional_vars)) {
+    if (exists_not_none(obj, &PyId_optional_vars)) {
         int res;
         tmp = _PyObject_GetAttrId(obj, &PyId_optional_vars);
         if (tmp == NULL) goto failed;
@@ -6770,7 +6833,7 @@
     if (!m) return NULL;
     d = PyModule_GetDict(m);
     if (PyDict_SetItemString(d, "AST", (PyObject*)&AST_type) < 0) return NULL;
-    if (PyModule_AddIntConstant(m, "PyCF_ONLY_AST", PyCF_ONLY_AST) < 0)
+    if (PyModule_AddIntMacro(m, PyCF_ONLY_AST) < 0)
         return NULL;
     if (PyDict_SetItemString(d, "mod", (PyObject*)mod_type) < 0) return NULL;
     if (PyDict_SetItemString(d, "Module", (PyObject*)Module_type) < 0) return
@@ -6850,6 +6913,8 @@
     if (PyDict_SetItemString(d, "Str", (PyObject*)Str_type) < 0) return NULL;
     if (PyDict_SetItemString(d, "Bytes", (PyObject*)Bytes_type) < 0) return
         NULL;
+    if (PyDict_SetItemString(d, "NameConstant", (PyObject*)NameConstant_type) <
+        0) return NULL;
     if (PyDict_SetItemString(d, "Ellipsis", (PyObject*)Ellipsis_type) < 0)
         return NULL;
     if (PyDict_SetItemString(d, "Attribute", (PyObject*)Attribute_type) < 0)
@@ -6949,7 +7014,8 @@
 
 PyObject* PyAST_mod2obj(mod_ty t)
 {
-    init_types();
+    if (!init_types())
+        return NULL;
     return ast2obj_mod(t);
 }
 
@@ -6967,7 +7033,8 @@
 
     assert(0 <= mode && mode <= 2);
 
-    init_types();
+    if (!init_types())
+        return NULL;
 
     isinstance = PyObject_IsInstance(ast, req_type[mode]);
     if (isinstance == -1)
@@ -6985,7 +7052,8 @@
 
 int PyAST_Check(PyObject* obj)
 {
-    init_types();
+    if (!init_types())
+        return -1;
     return PyObject_IsInstance(obj, (PyObject*)&AST_type);
 }
 
diff --git a/Python/_warnings.c b/Python/_warnings.c
index f33e477..bef5647 100644
--- a/Python/_warnings.c
+++ b/Python/_warnings.c
@@ -12,7 +12,10 @@
 static PyObject *_filters;  /* List */
 static PyObject *_once_registry;  /* Dict */
 static PyObject *_default_action; /* String */
+static long _filters_version;
 
+_Py_IDENTIFIER(argv);
+_Py_IDENTIFIER(stderr);
 
 static int
 check_matched(PyObject *obj, PyObject *arg)
@@ -99,7 +102,7 @@
 
 
 /* The item is a borrowed reference. */
-static const char *
+static PyObject*
 get_filter(PyObject *category, PyObject *text, Py_ssize_t lineno,
            PyObject *module, PyObject **item)
 {
@@ -144,21 +147,28 @@
         ln_obj = PyTuple_GET_ITEM(tmp_item, 4);
 
         good_msg = check_matched(msg, text);
+        if (good_msg == -1)
+            return NULL;
+
         good_mod = check_matched(mod, module);
+        if (good_mod == -1)
+            return NULL;
+
         is_subclass = PyObject_IsSubclass(category, cat);
+        if (is_subclass == -1)
+            return NULL;
+
         ln = PyLong_AsSsize_t(ln_obj);
-        if (good_msg == -1 || good_mod == -1 || is_subclass == -1 ||
-            (ln == -1 && PyErr_Occurred()))
+        if (ln == -1 && PyErr_Occurred())
             return NULL;
 
         if (good_msg && is_subclass && good_mod && (ln == 0 || lineno == ln))
-            return _PyUnicode_AsString(action);
+            return action;
     }
 
     action = get_default_action();
-    if (action != NULL) {
-        return _PyUnicode_AsString(action);
-    }
+    if (action != NULL)
+        return action;
 
     PyErr_SetString(PyExc_ValueError,
                     MODULE_NAME ".defaultaction not found");
@@ -169,16 +179,33 @@
 static int
 already_warned(PyObject *registry, PyObject *key, int should_set)
 {
-    PyObject *already_warned;
+    PyObject *version_obj, *already_warned;
+    _Py_IDENTIFIER(version);
 
     if (key == NULL)
         return -1;
 
-    already_warned = PyDict_GetItem(registry, key);
-    if (already_warned != NULL) {
-        int rc = PyObject_IsTrue(already_warned);
-        if (rc != 0)
-            return rc;
+    version_obj = _PyDict_GetItemId(registry, &PyId_version);
+    if (version_obj == NULL
+        || !PyLong_CheckExact(version_obj)
+        || PyLong_AsLong(version_obj) != _filters_version) {
+        PyDict_Clear(registry);
+        version_obj = PyLong_FromLong(_filters_version);
+        if (version_obj == NULL)
+            return -1;
+        if (_PyDict_SetItemId(registry, &PyId_version, version_obj) < 0) {
+            Py_DECREF(version_obj);
+            return -1;
+        }
+        Py_DECREF(version_obj);
+    }
+    else {
+        already_warned = PyDict_GetItem(registry, key);
+        if (already_warned != NULL) {
+            int rc = PyObject_IsTrue(already_warned);
+            if (rc != 0)
+                return rc;
+        }
     }
 
     /* This warning wasn't found in the registry, set it. */
@@ -192,23 +219,26 @@
 normalize_module(PyObject *filename)
 {
     PyObject *module;
-    const char *mod_str;
+    int kind;
+    void *data;
     Py_ssize_t len;
 
-    int rc = PyObject_IsTrue(filename);
-    if (rc == -1)
-        return NULL;
-    else if (rc == 0)
-        return PyUnicode_FromString("<unknown>");
-
-    mod_str = _PyUnicode_AsString(filename);
-    if (mod_str == NULL)
-        return NULL;
     len = PyUnicode_GetLength(filename);
     if (len < 0)
         return NULL;
+
+    if (len == 0)
+        return PyUnicode_FromString("<unknown>");
+
+    kind = PyUnicode_KIND(filename);
+    data = PyUnicode_DATA(filename);
+
+    /* if filename.endswith(".py"): */
     if (len >= 3 &&
-        strncmp(mod_str + (len - 3), ".py", 3) == 0) {
+        PyUnicode_READ(kind, data, len-3) == '.' &&
+        PyUnicode_READ(kind, data, len-2) == 'p' &&
+        PyUnicode_READ(kind, data, len-1) == 'y')
+    {
         module = PyUnicode_Substring(filename, 0, len-3);
     }
     else {
@@ -253,39 +283,63 @@
 
     name = _PyObject_GetAttrId(category, &PyId___name__);
     if (name == NULL)  /* XXX Can an object lack a '__name__' attribute? */
-        return;
+        goto error;
 
-    f_stderr = PySys_GetObject("stderr");
+    f_stderr = _PySys_GetObjectId(&PyId_stderr);
     if (f_stderr == NULL) {
         fprintf(stderr, "lost sys.stderr\n");
-        Py_DECREF(name);
-        return;
+        goto error;
     }
 
     /* Print "filename:lineno: category: text\n" */
-    PyFile_WriteObject(filename, f_stderr, Py_PRINT_RAW);
-    PyFile_WriteString(lineno_str, f_stderr);
-    PyFile_WriteObject(name, f_stderr, Py_PRINT_RAW);
-    PyFile_WriteString(": ", f_stderr);
-    PyFile_WriteObject(text, f_stderr, Py_PRINT_RAW);
-    PyFile_WriteString("\n", f_stderr);
-    Py_XDECREF(name);
+    if (PyFile_WriteObject(filename, f_stderr, Py_PRINT_RAW) < 0)
+        goto error;
+    if (PyFile_WriteString(lineno_str, f_stderr) < 0)
+        goto error;
+    if (PyFile_WriteObject(name, f_stderr, Py_PRINT_RAW) < 0)
+        goto error;
+    if (PyFile_WriteString(": ", f_stderr) < 0)
+        goto error;
+    if (PyFile_WriteObject(text, f_stderr, Py_PRINT_RAW) < 0)
+        goto error;
+    if (PyFile_WriteString("\n", f_stderr) < 0)
+        goto error;
+    Py_CLEAR(name);
 
     /* Print "  source_line\n" */
     if (sourceline) {
-        char *source_line_str = _PyUnicode_AsString(sourceline);
-        if (source_line_str == NULL)
-                return;
-        while (*source_line_str == ' ' || *source_line_str == '\t' ||
-                *source_line_str == '\014')
-            source_line_str++;
+        int kind;
+        void *data;
+        Py_ssize_t i, len;
+        Py_UCS4 ch;
+        PyObject *truncated;
 
-        PyFile_WriteString(source_line_str, f_stderr);
+        if (PyUnicode_READY(sourceline) < 1)
+            goto error;
+
+        kind = PyUnicode_KIND(sourceline);
+        data = PyUnicode_DATA(sourceline);
+        len = PyUnicode_GET_LENGTH(sourceline);
+        for (i=0; i<len; i++) {
+            ch = PyUnicode_READ(kind, data, i);
+            if (ch != ' ' && ch != '\t' && ch != '\014')
+                break;
+        }
+
+        truncated = PyUnicode_Substring(sourceline, i, len);
+        if (truncated == NULL)
+            goto error;
+
+        PyFile_WriteObject(sourceline, f_stderr, Py_PRINT_RAW);
+        Py_DECREF(truncated);
         PyFile_WriteString("\n", f_stderr);
     }
-    else
-        if (_Py_DisplaySourceLine(f_stderr, filename, lineno, 2) < 0)
-                return;
+    else {
+        _Py_DisplaySourceLine(f_stderr, filename, lineno, 2);
+    }
+
+error:
+    Py_XDECREF(name);
     PyErr_Clear();
 }
 
@@ -296,9 +350,16 @@
 {
     PyObject *key = NULL, *text = NULL, *result = NULL, *lineno_obj = NULL;
     PyObject *item = Py_None;
-    const char *action;
+    PyObject *action;
     int rc;
 
+    /* module can be None if a warning is emitted late during Python shutdown.
+       In this case, the Python warnings module was probably unloaded, filters
+       are no more available to choose as action. It is safer to ignore the
+       warning and do nothing. */
+    if (module == Py_None)
+        Py_RETURN_NONE;
+
     if (registry && !PyDict_Check(registry) && (registry != Py_None)) {
         PyErr_SetString(PyExc_TypeError, "'registry' must be a dict");
         return NULL;
@@ -354,7 +415,7 @@
     if (action == NULL)
         goto cleanup;
 
-    if (strcmp(action, "error") == 0) {
+    if (PyUnicode_CompareWithASCIIString(action, "error") == 0) {
         PyErr_SetObject(category, message);
         goto cleanup;
     }
@@ -362,13 +423,13 @@
     /* Store in the registry that we've been here, *except* when the action
        is "always". */
     rc = 0;
-    if (strcmp(action, "always") != 0) {
+    if (PyUnicode_CompareWithASCIIString(action, "always") != 0) {
         if (registry != NULL && registry != Py_None &&
                 PyDict_SetItem(registry, key, Py_True) < 0)
             goto cleanup;
-        else if (strcmp(action, "ignore") == 0)
+        else if (PyUnicode_CompareWithASCIIString(action, "ignore") == 0)
             goto return_none;
-        else if (strcmp(action, "once") == 0) {
+        else if (PyUnicode_CompareWithASCIIString(action, "once") == 0) {
             if (registry == NULL || registry == Py_None) {
                 registry = get_once_registry();
                 if (registry == NULL)
@@ -377,24 +438,15 @@
             /* _once_registry[(text, category)] = 1 */
             rc = update_registry(registry, text, category, 0);
         }
-        else if (strcmp(action, "module") == 0) {
+        else if (PyUnicode_CompareWithASCIIString(action, "module") == 0) {
             /* registry[(text, category, 0)] = 1 */
             if (registry != NULL && registry != Py_None)
                 rc = update_registry(registry, text, category, 0);
         }
-        else if (strcmp(action, "default") != 0) {
-            PyObject *to_str = PyObject_Str(item);
-            const char *err_str = "???";
-
-            if (to_str != NULL) {
-                err_str = _PyUnicode_AsString(to_str);
-                if (err_str == NULL)
-                        goto cleanup;
-            }
+        else if (PyUnicode_CompareWithASCIIString(action, "default") != 0) {
             PyErr_Format(PyExc_RuntimeError,
-                        "Unrecognized action (%s) in warnings.filters:\n %s",
-                        action, err_str);
-            Py_XDECREF(to_str);
+                        "Unrecognized action (%R) in warnings.filters:\n %R",
+                        action, item);
             goto cleanup;
         }
     }
@@ -528,13 +580,12 @@
             Py_INCREF(*filename);
     }
     else {
-        const char *module_str = _PyUnicode_AsString(*module);
         *filename = NULL;
-        if (module_str == NULL)
-                goto handle_error;
-        if (strcmp(module_str, "__main__") == 0) {
-            PyObject *argv = PySys_GetObject("argv");
-            if (argv != NULL && PyList_Size(argv) > 0) {
+        if (*module != Py_None && PyUnicode_CompareWithASCIIString(*module, "__main__") == 0) {
+            PyObject *argv = _PySys_GetObjectId(&PyId_argv);
+            /* PyList_Check() is needed because sys.argv is set to None during
+               Python finalization */
+            if (argv != NULL && PyList_Check(argv) && PyList_Size(argv) > 0) {
                 int is_true;
                 *filename = PyList_GetItem(argv, 0);
                 Py_INCREF(*filename);
@@ -554,8 +605,8 @@
             else {
                 /* embedded interpreters don't have sys.argv, see bug #839151 */
                 *filename = PyUnicode_FromString("__main__");
-                    if (*filename == NULL)
-                        goto handle_error;
+                if (*filename == NULL)
+                    goto handle_error;
             }
         }
         if (*filename == NULL) {
@@ -649,7 +700,7 @@
     PyObject *registry = NULL;
     PyObject *module_globals = NULL;
 
-    if (!PyArg_ParseTupleAndKeywords(args, kwds, "OOOi|OOO:warn_explicit",
+    if (!PyArg_ParseTupleAndKeywords(args, kwds, "OOUi|OOO:warn_explicit",
                 kwd_list, &message, &category, &filename, &lineno, &module,
                 &registry, &module_globals))
         return NULL;
@@ -707,14 +758,21 @@
 
         /* Handle the warning. */
         returned = warn_explicit(category, message, filename, lineno, module,
-                            registry, source_line);
+                                 registry, source_line);
         Py_DECREF(source_list);
         return returned;
     }
 
  standard_call:
     return warn_explicit(category, message, filename, lineno, module,
-                                registry, NULL);
+                         registry, NULL);
+}
+
+static PyObject *
+warnings_filters_mutated(PyObject *self, PyObject *args)
+{
+    _filters_version++;
+    Py_RETURN_NONE;
 }
 
 
@@ -786,11 +844,26 @@
 
 /* Warning with explicit origin */
 int
+PyErr_WarnExplicitObject(PyObject *category, PyObject *message,
+                         PyObject *filename, int lineno,
+                         PyObject *module, PyObject *registry)
+{
+    PyObject *res;
+    if (category == NULL)
+        category = PyExc_RuntimeWarning;
+    res = warn_explicit(category, message, filename, lineno,
+                        module, registry, NULL);
+    if (res == NULL)
+        return -1;
+    Py_DECREF(res);
+    return 0;
+}
+
+int
 PyErr_WarnExplicit(PyObject *category, const char *text,
                    const char *filename_str, int lineno,
                    const char *module_str, PyObject *registry)
 {
-    PyObject *res;
     PyObject *message = PyUnicode_FromString(text);
     PyObject *filename = PyUnicode_DecodeFSDefault(filename_str);
     PyObject *module = NULL;
@@ -800,18 +873,12 @@
         goto exit;
     if (module_str != NULL) {
         module = PyUnicode_FromString(module_str);
-            if (module == NULL)
-                goto exit;
+        if (module == NULL)
+            goto exit;
     }
 
-    if (category == NULL)
-        category = PyExc_RuntimeWarning;
-    res = warn_explicit(category, message, filename, lineno, module, registry,
-                        NULL);
-    if (res == NULL)
-        goto exit;
-    Py_DECREF(res);
-    ret = 0;
+    ret = PyErr_WarnExplicitObject(category, message, filename, lineno,
+                                   module, registry);
 
  exit:
     Py_XDECREF(message);
@@ -820,6 +887,49 @@
     return ret;
 }
 
+int
+PyErr_WarnExplicitFormat(PyObject *category,
+                         const char *filename_str, int lineno,
+                         const char *module_str, PyObject *registry,
+                         const char *format, ...)
+{
+    PyObject *message;
+    PyObject *module = NULL;
+    PyObject *filename = PyUnicode_DecodeFSDefault(filename_str);
+    int ret = -1;
+    va_list vargs;
+
+    if (filename == NULL)
+        goto exit;
+    if (module_str != NULL) {
+        module = PyUnicode_FromString(module_str);
+        if (module == NULL)
+            goto exit;
+    }
+
+#ifdef HAVE_STDARG_PROTOTYPES
+    va_start(vargs, format);
+#else
+    va_start(vargs);
+#endif
+    message = PyUnicode_FromFormatV(format, vargs);
+    if (message != NULL) {
+        PyObject *res;
+        res = warn_explicit(category, message, filename, lineno,
+                            module, registry, NULL);
+        Py_DECREF(message);
+        if (res != NULL) {
+            Py_DECREF(res);
+            ret = 0;
+        }
+    }
+    va_end(vargs);
+exit:
+    Py_XDECREF(module);
+    Py_XDECREF(filename);
+    return ret;
+}
+
 
 PyDoc_STRVAR(warn_doc,
 "Issue a warning, or maybe ignore it or raise an exception.");
@@ -832,6 +942,8 @@
         warn_doc},
     {"warn_explicit", (PyCFunction)warnings_warn_explicit,
         METH_VARARGS | METH_KEYWORDS, warn_explicit_doc},
+    {"_filters_mutated", (PyCFunction)warnings_filters_mutated, METH_NOARGS,
+        NULL},
     /* XXX(brett.cannon): add showwarning? */
     /* XXX(brett.cannon): Reasonable to add formatwarning? */
     {NULL, NULL}                /* sentinel */
@@ -984,5 +1096,7 @@
     Py_INCREF(_default_action);
     if (PyModule_AddObject(m, "_defaultaction", _default_action) < 0)
         return NULL;
+
+    _filters_version = 0;
     return m;
 }
diff --git a/Python/asdl.c b/Python/asdl.c
index e7e3280..74fa941 100644
--- a/Python/asdl.c
+++ b/Python/asdl.c
@@ -2,7 +2,7 @@
 #include "asdl.h"
 
 asdl_seq *
-asdl_seq_new(Py_ssize_t size, PyArena *arena)
+_Py_asdl_seq_new(Py_ssize_t size, PyArena *arena)
 {
     asdl_seq *seq = NULL;
     size_t n = (size ? (sizeof(void *) * (size - 1)) : 0);
@@ -33,7 +33,7 @@
 }
 
 asdl_int_seq *
-asdl_int_seq_new(Py_ssize_t size, PyArena *arena)
+_Py_asdl_int_seq_new(Py_ssize_t size, PyArena *arena)
 {
     asdl_int_seq *seq = NULL;
     size_t n = (size ? (sizeof(void *) * (size - 1)) : 0);
diff --git a/Python/ast.c b/Python/ast.c
index 9a0b064..d50cb80 100644
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -109,22 +109,14 @@
 {
     if (!validate_args(args->args))
         return 0;
-    if (args->varargannotation) {
-        if (!args->vararg) {
-            PyErr_SetString(PyExc_ValueError, "varargannotation but no vararg on arguments");
-            return 0;
-        }
-        if (!validate_expr(args->varargannotation, Load))
+    if (args->vararg && args->vararg->annotation
+        && !validate_expr(args->vararg->annotation, Load)) {
             return 0;
     }
     if (!validate_args(args->kwonlyargs))
         return 0;
-    if (args->kwargannotation) {
-        if (!args->kwarg) {
-            PyErr_SetString(PyExc_ValueError, "kwargannotation but no kwarg on arguments");
-            return 0;
-        }
-        if (!validate_expr(args->kwargannotation, Load))
+    if (args->kwarg && args->kwarg->annotation 
+        && !validate_expr(args->kwarg->annotation, Load)) {
             return 0;
     }
     if (asdl_seq_LEN(args->defaults) > asdl_seq_LEN(args->args)) {
@@ -282,6 +274,7 @@
         return validate_exprs(exp->v.Tuple.elts, ctx, 0);
     /* These last cases don't have any checking. */
     case Name_kind:
+    case NameConstant_kind:
     case Ellipsis_kind:
         return 1;
     default:
@@ -498,7 +491,7 @@
 struct compiling {
     char *c_encoding; /* source encoding */
     PyArena *c_arena; /* arena for allocating memeory */
-    const char *c_filename; /* filename */
+    PyObject *c_filename; /* filename */
     PyObject *c_normalize; /* Normalization function from unicodedata. */
     PyObject *c_normalize_args; /* Normalization argument tuple. */
 };
@@ -567,7 +560,10 @@
         id = id2;
     }
     PyUnicode_InternInPlace(&id);
-    PyArena_AddPyObject(c->c_arena, id);
+    if (PyArena_AddPyObject(c->c_arena, id) < 0) {
+        Py_DECREF(id);
+        return NULL;
+    }
     return id;
 }
 
@@ -577,24 +573,13 @@
 ast_error(struct compiling *c, const node *n, const char *errmsg)
 {
     PyObject *value, *errstr, *loc, *tmp;
-    PyObject *filename_obj;
 
-    loc = PyErr_ProgramText(c->c_filename, LINENO(n));
+    loc = PyErr_ProgramTextObject(c->c_filename, LINENO(n));
     if (!loc) {
         Py_INCREF(Py_None);
         loc = Py_None;
     }
-    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;
-    }
-    tmp = Py_BuildValue("(NiiN)", filename_obj, LINENO(n), n->n_col_offset, loc);
+    tmp = Py_BuildValue("(OiiN)", c->c_filename, LINENO(n), n->n_col_offset, loc);
     if (!tmp)
         return 0;
     errstr = PyUnicode_FromString(errmsg);
@@ -677,8 +662,8 @@
 */
 
 mod_ty
-PyAST_FromNode(const node *n, PyCompilerFlags *flags, const char *filename,
-               PyArena *arena)
+PyAST_FromNodeObject(const node *n, PyCompilerFlags *flags,
+                     PyObject *filename, PyArena *arena)
 {
     int i, j, k, num;
     asdl_seq *stmts = NULL;
@@ -688,6 +673,7 @@
     mod_ty res = NULL;
 
     c.c_arena = arena;
+    /* borrowed reference */
     c.c_filename = filename;
     c.c_normalize = c.c_normalize_args = NULL;
     if (flags && flags->cf_flags & PyCF_SOURCE_IS_UTF8) {
@@ -710,7 +696,7 @@
     k = 0;
     switch (TYPE(n)) {
         case file_input:
-            stmts = asdl_seq_new(num_stmts(n), arena);
+            stmts = _Py_asdl_seq_new(num_stmts(n), arena);
             if (!stmts)
                 goto out;
             for (i = 0; i < NCH(n) - 1; i++) {
@@ -750,7 +736,7 @@
         }
         case single_input:
             if (TYPE(CHILD(n, 0)) == NEWLINE) {
-                stmts = asdl_seq_new(1, arena);
+                stmts = _Py_asdl_seq_new(1, arena);
                 if (!stmts)
                     goto out;
                 asdl_seq_SET(stmts, 0, Pass(n->n_lineno, n->n_col_offset,
@@ -762,7 +748,7 @@
             else {
                 n = CHILD(n, 0);
                 num = num_stmts(n);
-                stmts = asdl_seq_new(num, arena);
+                stmts = _Py_asdl_seq_new(num, arena);
                 if (!stmts)
                     goto out;
                 if (num == 1) {
@@ -801,6 +787,21 @@
     return res;
 }
 
+mod_ty
+PyAST_FromNode(const node *n, PyCompilerFlags *flags, const char *filename_str,
+               PyArena *arena)
+{
+    mod_ty mod;
+    PyObject *filename;
+    filename = PyUnicode_DecodeFSDefault(filename_str);
+    if (filename == NULL)
+        return NULL;
+    mod = PyAST_FromNodeObject(n, flags, filename, arena);
+    Py_DECREF(filename);
+    return mod;
+
+}
+
 /* Return the AST repr. of the operator represented as syntax (|, ^, etc.)
 */
 
@@ -903,7 +904,7 @@
             break;
         case Name_kind:
             if (ctx == Store) {
-                if (forbidden_name(c, e->v.Name.id, n, 1))
+                if (forbidden_name(c, e->v.Name.id, n, 0))
                     return 0; /* forbidden_name() calls ast_error() */
             }
             e->v.Name.ctx = ctx;
@@ -955,6 +956,9 @@
         case Bytes_kind:
             expr_name = "literal";
             break;
+        case NameConstant_kind:
+            expr_name = "keyword";
+            break;
         case Ellipsis_kind:
             expr_name = "Ellipsis";
             break;
@@ -1095,7 +1099,7 @@
     int i;
     assert(TYPE(n) == testlist || TYPE(n) == testlist_star_expr || TYPE(n) == testlist_comp);
 
-    seq = asdl_seq_new((NCH(n) + 1) / 2, c->c_arena);
+    seq = _Py_asdl_seq_new((NCH(n) + 1) / 2, c->c_arena);
     if (!seq)
         return NULL;
 
@@ -1119,6 +1123,7 @@
     identifier name;
     expr_ty annotation = NULL;
     node *ch;
+    arg_ty ret;
 
     assert(TYPE(n) == tfpdef || TYPE(n) == vfpdef);
     ch = CHILD(n, 0);
@@ -1134,7 +1139,12 @@
             return NULL;
     }
 
-    return arg(name, annotation, c->c_arena);
+    ret = arg(name, annotation, c->c_arena);
+    if (!ret)
+        return NULL;
+    ret->lineno = LINENO(n);
+    ret->col_offset = n->n_col_offset;
+    return ret;
 }
 
 /* returns -1 if failed to handle keyword only arguments
@@ -1192,6 +1202,8 @@
                 arg = arg(argname, annotation, c->c_arena);
                 if (!arg)
                     goto error;
+                arg->lineno = LINENO(ch);
+                arg->col_offset = ch->n_col_offset;
                 asdl_seq_SET(kwonlyargs, j++, arg);
                 i += 2; /* the name and the comma */
                 break;
@@ -1230,15 +1242,13 @@
     int i, j, k, nposargs = 0, nkwonlyargs = 0;
     int nposdefaults = 0, found_default = 0;
     asdl_seq *posargs, *posdefaults, *kwonlyargs, *kwdefaults;
-    identifier vararg = NULL, kwarg = NULL;
+    arg_ty vararg = NULL, kwarg = NULL;
     arg_ty arg;
-    expr_ty varargannotation = NULL, kwargannotation = NULL;
     node *ch;
 
     if (TYPE(n) == parameters) {
         if (NCH(n) == 2) /* () as argument list */
-            return arguments(NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                             NULL, c->c_arena);
+            return arguments(NULL, NULL, NULL, NULL, NULL, NULL, c->c_arena);
         n = CHILD(n, 1);
     }
     assert(TYPE(n) == typedargslist || TYPE(n) == varargslist);
@@ -1270,22 +1280,22 @@
         if (TYPE(ch) == DOUBLESTAR) break;
         if (TYPE(ch) == tfpdef || TYPE(ch) == vfpdef) nkwonlyargs++;
     }
-    posargs = (nposargs ? asdl_seq_new(nposargs, c->c_arena) : NULL);
+    posargs = (nposargs ? _Py_asdl_seq_new(nposargs, c->c_arena) : NULL);
     if (!posargs && nposargs)
         return NULL;
     kwonlyargs = (nkwonlyargs ?
-                   asdl_seq_new(nkwonlyargs, c->c_arena) : NULL);
+                   _Py_asdl_seq_new(nkwonlyargs, c->c_arena) : NULL);
     if (!kwonlyargs && nkwonlyargs)
         return NULL;
     posdefaults = (nposdefaults ?
-                    asdl_seq_new(nposdefaults, c->c_arena) : NULL);
+                    _Py_asdl_seq_new(nposdefaults, c->c_arena) : NULL);
     if (!posdefaults && nposdefaults)
         return NULL;
     /* The length of kwonlyargs and kwdefaults are same
        since we set NULL as default for keyword only argument w/o default
        - we have sequence data structure, but no dictionary */
     kwdefaults = (nkwonlyargs ?
-                   asdl_seq_new(nkwonlyargs, c->c_arena) : NULL);
+                   _Py_asdl_seq_new(nkwonlyargs, c->c_arena) : NULL);
     if (!kwdefaults && nkwonlyargs)
         return NULL;
 
@@ -1344,17 +1354,10 @@
                     i = res; /* res has new position to process */
                 }
                 else {
-                    vararg = NEW_IDENTIFIER(CHILD(ch, 0));
+                    vararg = ast_for_arg(c, ch);
                     if (!vararg)
                         return NULL;
-                    if (forbidden_name(c, vararg, CHILD(ch, 0), 0))
-                        return NULL;
-                    if (NCH(ch) > 1) {
-                        /* there is an annotation on the vararg */
-                        varargannotation = ast_for_expr(c, CHILD(ch, 2));
-                        if (!varargannotation)
-                            return NULL;
-                    }
+
                     i += 3;
                     if (i < NCH(n) && (TYPE(CHILD(n, i)) == tfpdef
                                     || TYPE(CHILD(n, i)) == vfpdef)) {
@@ -1369,17 +1372,9 @@
             case DOUBLESTAR:
                 ch = CHILD(n, i+1);  /* tfpdef */
                 assert(TYPE(ch) == tfpdef || TYPE(ch) == vfpdef);
-                kwarg = NEW_IDENTIFIER(CHILD(ch, 0));
+                kwarg = ast_for_arg(c, ch);
                 if (!kwarg)
                     return NULL;
-                if (NCH(ch) > 1) {
-                    /* there is an annotation on the kwarg */
-                    kwargannotation = ast_for_expr(c, CHILD(ch, 2));
-                    if (!kwargannotation)
-                        return NULL;
-                }
-                if (forbidden_name(c, kwarg, CHILD(ch, 0), 0))
-                    return NULL;
                 i += 3;
                 break;
             default:
@@ -1389,8 +1384,7 @@
                 return NULL;
         }
     }
-    return arguments(posargs, vararg, varargannotation, kwonlyargs, kwarg,
-                    kwargannotation, posdefaults, kwdefaults, c->c_arena);
+    return arguments(posargs, vararg, kwonlyargs, kwdefaults, kwarg, posdefaults, c->c_arena);
 }
 
 static expr_ty
@@ -1469,7 +1463,7 @@
     int i;
 
     REQ(n, decorators);
-    decorator_seq = asdl_seq_new(NCH(n), c->c_arena);
+    decorator_seq = _Py_asdl_seq_new(NCH(n), c->c_arena);
     if (!decorator_seq)
         return NULL;
 
@@ -1555,8 +1549,7 @@
     expr_ty expression;
 
     if (NCH(n) == 3) {
-        args = arguments(NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                         NULL, c->c_arena);
+        args = arguments(NULL, NULL, NULL, NULL, NULL, NULL, c->c_arena);
         if (!args)
             return NULL;
         expression = ast_for_expr(c, CHILD(n, 2));
@@ -1666,7 +1659,7 @@
     if (n_fors == -1)
         return NULL;
 
-    comps = asdl_seq_new(n_fors, c->c_arena);
+    comps = _Py_asdl_seq_new(n_fors, c->c_arena);
     if (!comps)
         return NULL;
 
@@ -1707,7 +1700,7 @@
             if (n_ifs == -1)
                 return NULL;
 
-            ifs = asdl_seq_new(n_ifs, c->c_arena);
+            ifs = _Py_asdl_seq_new(n_ifs, c->c_arena);
             if (!ifs)
                 return NULL;
 
@@ -1819,11 +1812,21 @@
 
     switch (TYPE(ch)) {
     case NAME: {
-        /* All names start in Load context, but may later be
-           changed. */
-        PyObject *name = NEW_IDENTIFIER(ch);
+        PyObject *name;
+        const char *s = STR(ch);
+        size_t len = strlen(s);
+        if (len >= 4 && len <= 5) {
+            if (!strcmp(s, "None"))
+                return NameConstant(Py_None, LINENO(n), n->n_col_offset, c->c_arena);
+            if (!strcmp(s, "True"))
+                return NameConstant(Py_True, LINENO(n), n->n_col_offset, c->c_arena);
+            if (!strcmp(s, "False"))
+                return NameConstant(Py_False, LINENO(n), n->n_col_offset, c->c_arena);
+        }
+        name = new_identifier(s, c);
         if (!name)
             return NULL;
+        /* All names start in Load context, but may later be changed. */
         return Name(name, Load, LINENO(n), n->n_col_offset, c->c_arena);
     }
     case STRING: {
@@ -1848,12 +1851,15 @@
                 }
                 ast_error(c, n, buf);
                 Py_DECREF(type);
-                Py_DECREF(value);
+                Py_XDECREF(value);
                 Py_XDECREF(tback);
             }
             return NULL;
         }
-        PyArena_AddPyObject(c->c_arena, str);
+        if (PyArena_AddPyObject(c->c_arena, str) < 0) {
+            Py_DECREF(str);
+            return NULL;
+        }
         if (bytesmode)
             return Bytes(str, LINENO(n), n->n_col_offset, c->c_arena);
         else
@@ -1864,7 +1870,10 @@
         if (!pynum)
             return NULL;
 
-        PyArena_AddPyObject(c->c_arena, pynum);
+        if (PyArena_AddPyObject(c->c_arena, pynum) < 0) {
+            Py_DECREF(pynum);
+            return NULL;
+        }
         return Num(pynum, LINENO(n), n->n_col_offset, c->c_arena);
     }
     case ELLIPSIS: /* Ellipsis */
@@ -1913,7 +1922,7 @@
             /* it's a simple set */
             asdl_seq *elts;
             size = (NCH(ch) + 1) / 2; /* +1 in case no trailing comma */
-            elts = asdl_seq_new(size, c->c_arena);
+            elts = _Py_asdl_seq_new(size, c->c_arena);
             if (!elts)
                 return NULL;
             for (i = 0; i < NCH(ch); i += 2) {
@@ -1932,11 +1941,11 @@
         } else {
             /* it's a dict */
             size = (NCH(ch) + 1) / 4; /* +1 in case no trailing comma */
-            keys = asdl_seq_new(size, c->c_arena);
+            keys = _Py_asdl_seq_new(size, c->c_arena);
             if (!keys)
                 return NULL;
 
-            values = asdl_seq_new(size, c->c_arena);
+            values = _Py_asdl_seq_new(size, c->c_arena);
             if (!values)
                 return NULL;
 
@@ -2096,7 +2105,7 @@
         else
             return ast_for_call(c, CHILD(n, 1), left_expr);
     }
-    else if (TYPE(CHILD(n, 0)) == DOT ) {
+    else if (TYPE(CHILD(n, 0)) == DOT) {
         PyObject *attr_id = NEW_IDENTIFIER(CHILD(n, 1));
         if (!attr_id)
             return NULL;
@@ -2124,7 +2133,7 @@
             expr_ty e;
             int simple = 1;
             asdl_seq *slices, *elts;
-            slices = asdl_seq_new((NCH(n) + 1) / 2, c->c_arena);
+            slices = _Py_asdl_seq_new((NCH(n) + 1) / 2, c->c_arena);
             if (!slices)
                 return NULL;
             for (j = 0; j < NCH(n); j += 2) {
@@ -2140,7 +2149,7 @@
                                  Load, LINENO(n), n->n_col_offset, c->c_arena);
             }
             /* extract Index values and put them in a Tuple */
-            elts = asdl_seq_new(asdl_seq_LEN(slices), c->c_arena);
+            elts = _Py_asdl_seq_new(asdl_seq_LEN(slices), c->c_arena);
             if (!elts)
                 return NULL;
             for (j = 0; j < asdl_seq_LEN(slices); ++j) {
@@ -2210,10 +2219,7 @@
         expr_ty f = ast_for_expr(c, CHILD(n, NCH(n) - 1));
         if (!f)
             return NULL;
-        tmp = BinOp(e, Pow, f, LINENO(n), n->n_col_offset, c->c_arena);
-        if (!tmp)
-            return NULL;
-        e = tmp;
+        e = BinOp(e, Pow, f, LINENO(n), n->n_col_offset, c->c_arena);
     }
     return e;
 }
@@ -2275,7 +2281,7 @@
                 n = CHILD(n, 0);
                 goto loop;
             }
-            seq = asdl_seq_new((NCH(n) + 1) / 2, c->c_arena);
+            seq = _Py_asdl_seq_new((NCH(n) + 1) / 2, c->c_arena);
             if (!seq)
                 return NULL;
             for (i = 0; i < NCH(n); i += 2) {
@@ -2311,10 +2317,10 @@
                 expr_ty expression;
                 asdl_int_seq *ops;
                 asdl_seq *cmps;
-                ops = asdl_int_seq_new(NCH(n) / 2, c->c_arena);
+                ops = _Py_asdl_int_seq_new(NCH(n) / 2, c->c_arena);
                 if (!ops)
                     return NULL;
-                cmps = asdl_seq_new(NCH(n) / 2, c->c_arena);
+                cmps = _Py_asdl_seq_new(NCH(n) / 2, c->c_arena);
                 if (!cmps) {
                     return NULL;
                 }
@@ -2440,10 +2446,10 @@
         return NULL;
     }
 
-    args = asdl_seq_new(nargs + ngens, c->c_arena);
+    args = _Py_asdl_seq_new(nargs + ngens, c->c_arena);
     if (!args)
         return NULL;
-    keywords = asdl_seq_new(nkeywords, c->c_arena);
+    keywords = _Py_asdl_seq_new(nkeywords, c->c_arena);
     if (!keywords)
         return NULL;
     nargs = 0;
@@ -2620,7 +2626,7 @@
 
         /* a normal assignment */
         REQ(CHILD(n, 1), EQUAL);
-        targets = asdl_seq_new(NCH(n) / 2, c->c_arena);
+        targets = _Py_asdl_seq_new(NCH(n) / 2, c->c_arena);
         if (!targets)
             return NULL;
         for (i = 0; i < NCH(n) - 2; i += 2) {
@@ -2661,7 +2667,7 @@
 
     REQ(n, exprlist);
 
-    seq = asdl_seq_new((NCH(n) + 1) / 2, c->c_arena);
+    seq = _Py_asdl_seq_new((NCH(n) + 1) / 2, c->c_arena);
     if (!seq)
         return NULL;
     for (i = 0; i < NCH(n); i += 2) {
@@ -2846,13 +2852,19 @@
                     return NULL;
                 str = uni;
                 PyUnicode_InternInPlace(&str);
-                PyArena_AddPyObject(c->c_arena, str);
+                if (PyArena_AddPyObject(c->c_arena, str) < 0) {
+                    Py_DECREF(str);
+                    return NULL;
+                }
                 return alias(str, NULL, c->c_arena);
             }
             break;
         case STAR:
             str = PyUnicode_InternFromString("*");
-            PyArena_AddPyObject(c->c_arena, str);
+            if (PyArena_AddPyObject(c->c_arena, str) < 0) {
+                Py_DECREF(str);
+                return NULL;
+            }
             return alias(str, NULL, c->c_arena);
         default:
             PyErr_Format(PyExc_SystemError,
@@ -2885,7 +2897,7 @@
     if (TYPE(n) == import_name) {
         n = CHILD(n, 1);
         REQ(n, dotted_as_names);
-        aliases = asdl_seq_new((NCH(n) + 1) / 2, c->c_arena);
+        aliases = _Py_asdl_seq_new((NCH(n) + 1) / 2, c->c_arena);
         if (!aliases)
                 return NULL;
         for (i = 0; i < NCH(n); i += 2) {
@@ -2947,7 +2959,7 @@
             return NULL;
         }
 
-        aliases = asdl_seq_new((n_children + 1) / 2, c->c_arena);
+        aliases = _Py_asdl_seq_new((n_children + 1) / 2, c->c_arena);
         if (!aliases)
             return NULL;
 
@@ -2986,7 +2998,7 @@
     int i;
 
     REQ(n, global_stmt);
-    s = asdl_seq_new(NCH(n) / 2, c->c_arena);
+    s = _Py_asdl_seq_new(NCH(n) / 2, c->c_arena);
     if (!s)
         return NULL;
     for (i = 1; i < NCH(n); i += 2) {
@@ -3007,7 +3019,7 @@
     int i;
 
     REQ(n, nonlocal_stmt);
-    s = asdl_seq_new(NCH(n) / 2, c->c_arena);
+    s = _Py_asdl_seq_new(NCH(n) / 2, c->c_arena);
     if (!s)
         return NULL;
     for (i = 1; i < NCH(n); i += 2) {
@@ -3060,7 +3072,7 @@
     REQ(n, suite);
 
     total = num_stmts(n);
-    seq = asdl_seq_new(total, c->c_arena);
+    seq = _Py_asdl_seq_new(total, c->c_arena);
     if (!seq)
         return NULL;
     if (TYPE(CHILD(n, 0)) == simple_stmt) {
@@ -3179,7 +3191,7 @@
         if (has_else) {
             asdl_seq *suite_seq2;
 
-            orelse = asdl_seq_new(1, c->c_arena);
+            orelse = _Py_asdl_seq_new(1, c->c_arena);
             if (!orelse)
                 return NULL;
             expression = ast_for_expr(c, CHILD(n, NCH(n) - 6));
@@ -3203,7 +3215,7 @@
 
         for (i = 0; i < n_elif; i++) {
             int off = 5 + (n_elif - i - 1) * 4;
-            asdl_seq *newobj = asdl_seq_new(1, c->c_arena);
+            asdl_seq *newobj = _Py_asdl_seq_new(1, c->c_arena);
             if (!newobj)
                 return NULL;
             expression = ast_for_expr(c, CHILD(n, off));
@@ -3415,7 +3427,7 @@
     if (n_except > 0) {
         int i;
         /* process except statements to create a try ... except */
-        handlers = asdl_seq_new(n_except, c->c_arena);
+        handlers = _Py_asdl_seq_new(n_except, c->c_arena);
         if (handlers == NULL)
             return NULL;
 
@@ -3466,7 +3478,7 @@
     REQ(n, with_stmt);
 
     n_items = (NCH(n) - 2) / 2;
-    items = asdl_seq_new(n_items, c->c_arena);
+    items = _Py_asdl_seq_new(n_items, c->c_arena);
     if (!items)
         return NULL;
     for (i = 1; i < NCH(n) - 2; i += 2) {
@@ -3632,18 +3644,16 @@
     end = s + strlen(s) - 1;
     imflag = *end == 'j' || *end == 'J';
     if (s[0] == '0') {
-        x = (long) PyOS_strtoul((char *)s, (char **)&end, 0);
+        x = (long) PyOS_strtoul(s, (char **)&end, 0);
         if (x < 0 && errno == 0) {
-            return PyLong_FromString((char *)s,
-                                     (char **)0,
-                                     0);
+            return PyLong_FromString(s, (char **)0, 0);
         }
     }
     else
-        x = PyOS_strtol((char *)s, (char **)&end, 0);
+        x = PyOS_strtol(s, (char **)&end, 0);
     if (*end == '\0') {
         if (errno != 0)
-            return PyLong_FromString((char *)s, (char **)0, 0);
+            return PyLong_FromString(s, (char **)0, 0);
         return PyLong_FromLong(x);
     }
     /* XXX Huge floats may silently fail */
@@ -3666,8 +3676,8 @@
 static PyObject *
 decode_utf8(struct compiling *c, const char **sPtr, const char *end)
 {
-    char *s, *t;
-    t = s = (char *)*sPtr;
+    const char *s, *t;
+    t = s = *sPtr;
     /* while (s < end && *s != '\\') s++; */ /* inefficient for u".." */
     while (s < end && (*s & 0x80)) s++;
     *sPtr = s;
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index c94daea..4b4f979 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -32,8 +32,19 @@
 int Py_HasFileSystemDefaultEncoding = 0;
 #endif
 
+_Py_IDENTIFIER(__builtins__);
+_Py_IDENTIFIER(__dict__);
+_Py_IDENTIFIER(__prepare__);
+_Py_IDENTIFIER(__round__);
+_Py_IDENTIFIER(encoding);
+_Py_IDENTIFIER(errors);
 _Py_IDENTIFIER(fileno);
 _Py_IDENTIFIER(flush);
+_Py_IDENTIFIER(metaclass);
+_Py_IDENTIFIER(sort);
+_Py_IDENTIFIER(stdin);
+_Py_IDENTIFIER(stdout);
+_Py_IDENTIFIER(stderr);
 
 static PyObject *
 builtin___build_class__(PyObject *self, PyObject *args, PyObject *kwds)
@@ -42,7 +53,6 @@
     PyObject *cls = NULL;
     Py_ssize_t nargs;
     int isclass;
-    _Py_IDENTIFIER(__prepare__);
 
     assert(args != NULL);
     if (!PyTuple_Check(args)) {
@@ -57,6 +67,11 @@
         return NULL;
     }
     func = PyTuple_GET_ITEM(args, 0); /* Better be callable */
+    if (!PyFunction_Check(func)) {
+        PyErr_SetString(PyExc_TypeError,
+                        "__build_class__: func must be a function");
+        return NULL;
+    }
     name = PyTuple_GET_ITEM(args, 1);
     if (!PyUnicode_Check(name)) {
         PyErr_SetString(PyExc_TypeError,
@@ -77,10 +92,10 @@
             Py_DECREF(bases);
             return NULL;
         }
-        meta = PyDict_GetItemString(mkw, "metaclass");
+        meta = _PyDict_GetItemId(mkw, &PyId_metaclass);
         if (meta != NULL) {
             Py_INCREF(meta);
-            if (PyDict_DelItemString(mkw, "metaclass") < 0) {
+            if (_PyDict_DelItemId(mkw, &PyId_metaclass) < 0) {
                 Py_DECREF(meta);
                 Py_DECREF(mkw);
                 Py_DECREF(bases);
@@ -155,7 +170,9 @@
         Py_DECREF(bases);
         return NULL;
     }
-    cell = PyObject_CallFunctionObjArgs(func, ns, NULL);
+    cell = PyEval_EvalCodeEx(PyFunction_GET_CODE(func), PyFunction_GET_GLOBALS(func), ns,
+                             NULL, 0, NULL, 0, NULL, 0, NULL,
+                             PyFunction_GET_CLOSURE(func));
     if (cell != NULL) {
         PyObject *margs;
         margs = PyTuple_Pack(3, name, bases, ns);
@@ -333,7 +350,11 @@
 PyDoc_STRVAR(bin_doc,
 "bin(number) -> string\n\
 \n\
-Return the binary representation of an integer.");
+Return the binary representation of an integer.\n\
+\n\
+   >>> bin(2796202)\n\
+   '0b1010101010101010101010'\n\
+");
 
 
 static PyObject *
@@ -538,10 +559,10 @@
 Return a Unicode string of one character with ordinal i; 0 <= i <= 0x10ffff.");
 
 
-static char *
-source_as_string(PyObject *cmd, char *funcname, char *what, PyCompilerFlags *cf)
+static const char *
+source_as_string(PyObject *cmd, const char *funcname, const char *what, PyCompilerFlags *cf, Py_buffer *view)
 {
-    char *str;
+    const char *str;
     Py_ssize_t size;
 
     if (PyUnicode_Check(cmd)) {
@@ -550,19 +571,21 @@
         if (str == NULL)
             return NULL;
     }
-    else if (!PyObject_CheckReadBuffer(cmd)) {
+    else if (PyObject_GetBuffer(cmd, view, PyBUF_SIMPLE) == 0) {
+        str = (const char *)view->buf;
+        size = view->len;
+    }
+    else {
         PyErr_Format(PyExc_TypeError,
           "%s() arg 1 must be a %s object",
           funcname, what);
         return NULL;
     }
-    else if (PyObject_AsReadBuffer(cmd, (const void **)&str, &size) < 0) {
-        return NULL;
-    }
 
     if (strlen(str) != size) {
         PyErr_SetString(PyExc_TypeError,
                         "source code string cannot contain null bytes");
+        PyBuffer_Release(view);
         return NULL;
     }
     return str;
@@ -571,9 +594,9 @@
 static PyObject *
 builtin_compile(PyObject *self, PyObject *args, PyObject *kwds)
 {
-    char *str;
-    PyObject *filename_obj;
-    char *filename;
+    Py_buffer view = {NULL, NULL};
+    const char *str;
+    PyObject *filename;
     char *startstr;
     int mode = -1;
     int dont_inherit = 0;
@@ -589,12 +612,11 @@
 
     if (!PyArg_ParseTupleAndKeywords(args, kwds, "OO&s|iii:compile",  kwlist,
                                      &cmd,
-                                     PyUnicode_FSConverter, &filename_obj,
+                                     PyUnicode_FSDecoder, &filename,
                                      &startstr, &supplied_flags,
                                      &dont_inherit, &optimize))
         return NULL;
 
-    filename = PyBytes_AS_STRING(filename_obj);
     cf.cf_flags = supplied_flags | PyCF_SOURCE_IS_UTF8;
 
     if (supplied_flags &
@@ -652,24 +674,25 @@
                 PyArena_Free(arena);
                 goto error;
             }
-            result = (PyObject*)PyAST_CompileEx(mod, filename,
-                                                &cf, optimize, arena);
+            result = (PyObject*)PyAST_CompileObject(mod, filename,
+                                                    &cf, optimize, arena);
             PyArena_Free(arena);
         }
         goto finally;
     }
 
-    str = source_as_string(cmd, "compile", "string, bytes, AST or code", &cf);
+    str = source_as_string(cmd, "compile", "string, bytes or AST", &cf, &view);
     if (str == NULL)
         goto error;
 
-    result = Py_CompileStringExFlags(str, filename, start[mode], &cf, optimize);
+    result = Py_CompileStringObject(str, filename, start[mode], &cf, optimize);
+    PyBuffer_Release(&view);
     goto finally;
 
 error:
     result = NULL;
 finally:
-    Py_DECREF(filename_obj);
+    Py_DECREF(filename);
     return result;
 }
 
@@ -733,7 +756,8 @@
 {
     PyObject *cmd, *result, *tmp = NULL;
     PyObject *globals = Py_None, *locals = Py_None;
-    char *str;
+    Py_buffer view = {NULL, NULL};
+    const char *str;
     PyCompilerFlags cf;
 
     if (!PyArg_UnpackTuple(args, "eval", 1, 3, &cmd, &globals, &locals))
@@ -750,8 +774,11 @@
     }
     if (globals == Py_None) {
         globals = PyEval_GetGlobals();
-        if (locals == Py_None)
+        if (locals == Py_None) {
             locals = PyEval_GetLocals();
+            if (locals == NULL)
+                return NULL;
+        }
     }
     else if (locals == Py_None)
         locals = globals;
@@ -763,9 +790,9 @@
         return NULL;
     }
 
-    if (PyDict_GetItemString(globals, "__builtins__") == NULL) {
-        if (PyDict_SetItemString(globals, "__builtins__",
-                                 PyEval_GetBuiltins()) != 0)
+    if (_PyDict_GetItemId(globals, &PyId___builtins__) == NULL) {
+        if (_PyDict_SetItemId(globals, &PyId___builtins__,
+                              PyEval_GetBuiltins()) != 0)
             return NULL;
     }
 
@@ -779,7 +806,7 @@
     }
 
     cf.cf_flags = PyCF_SOURCE_IS_UTF8;
-    str = source_as_string(cmd, "eval", "string, bytes or code", &cf);
+    str = source_as_string(cmd, "eval", "string, bytes or code", &cf, &view);
     if (str == NULL)
         return NULL;
 
@@ -788,6 +815,7 @@
 
     (void)PyEval_MergeCompilerFlags(&cf);
     result = PyRun_StringFlags(str, Py_eval_input, globals, locals, &cf);
+    PyBuffer_Release(&view);
     Py_XDECREF(tmp);
     return result;
 }
@@ -815,6 +843,8 @@
         globals = PyEval_GetGlobals();
         if (locals == Py_None) {
             locals = PyEval_GetLocals();
+            if (locals == NULL)
+                return NULL;
         }
         if (!globals || !locals) {
             PyErr_SetString(PyExc_SystemError,
@@ -836,9 +866,9 @@
             locals->ob_type->tp_name);
         return NULL;
     }
-    if (PyDict_GetItemString(globals, "__builtins__") == NULL) {
-        if (PyDict_SetItemString(globals, "__builtins__",
-                                 PyEval_GetBuiltins()) != 0)
+    if (_PyDict_GetItemId(globals, &PyId___builtins__) == NULL) {
+        if (_PyDict_SetItemId(globals, &PyId___builtins__,
+                              PyEval_GetBuiltins()) != 0)
             return NULL;
     }
 
@@ -852,11 +882,12 @@
         v = PyEval_EvalCode(prog, globals, locals);
     }
     else {
-        char *str;
+        Py_buffer view = {NULL, NULL};
+        const char *str;
         PyCompilerFlags cf;
         cf.cf_flags = PyCF_SOURCE_IS_UTF8;
         str = source_as_string(prog, "exec",
-                                     "string, bytes or code", &cf);
+                                     "string, bytes or code", &cf, &view);
         if (str == NULL)
             return NULL;
         if (PyEval_MergeCompilerFlags(&cf))
@@ -864,6 +895,7 @@
                                   locals, &cf);
         else
             v = PyRun_String(str, Py_file_input, globals, locals);
+        PyBuffer_Release(&view);
     }
     if (v == NULL)
         return NULL;
@@ -1256,7 +1288,11 @@
 PyDoc_STRVAR(hex_doc,
 "hex(number) -> string\n\
 \n\
-Return the hexadecimal representation of an integer.");
+Return the hexadecimal representation of an integer.\n\
+\n\
+   >>> hex(3735928559)\n\
+   '0xdeadbeef'\n\
+");
 
 
 static PyObject *
@@ -1297,9 +1333,9 @@
 }
 
 PyDoc_STRVAR(len_doc,
-"len(object) -> integer\n\
+"len(object)\n\
 \n\
-Return the number of items of a sequence or mapping.");
+Return the number of items of a sequence or collection.");
 
 
 static PyObject *
@@ -1322,26 +1358,35 @@
 min_max(PyObject *args, PyObject *kwds, int op)
 {
     PyObject *v, *it, *item, *val, *maxitem, *maxval, *keyfunc=NULL;
+    PyObject *emptytuple, *defaultval = NULL;
+    static char *kwlist[] = {"key", "default", NULL};
     const char *name = op == Py_LT ? "min" : "max";
+    const int positional = PyTuple_Size(args) > 1;
+    int ret;
 
-    if (PyTuple_Size(args) > 1)
+    if (positional)
         v = args;
-    else if (!PyArg_UnpackTuple(args, (char *)name, 1, 1, &v))
+    else if (!PyArg_UnpackTuple(args, name, 1, 1, &v))
         return NULL;
 
-    if (kwds != NULL && PyDict_Check(kwds) && PyDict_Size(kwds)) {
-        keyfunc = PyDict_GetItemString(kwds, "key");
-        if (PyDict_Size(kwds)!=1  ||  keyfunc == NULL) {
-            PyErr_Format(PyExc_TypeError,
-                "%s() got an unexpected keyword argument", name);
-            return NULL;
-        }
-        Py_INCREF(keyfunc);
+    emptytuple = PyTuple_New(0);
+    if (emptytuple == NULL)
+        return NULL;
+    ret = PyArg_ParseTupleAndKeywords(emptytuple, kwds, "|$OO", kwlist,
+                                      &keyfunc, &defaultval);
+    Py_DECREF(emptytuple);
+    if (!ret)
+        return NULL;
+
+    if (positional && defaultval != NULL) {
+        PyErr_Format(PyExc_TypeError,
+                        "Cannot specify a default for %s() with multiple "
+                        "positional arguments", name);
+        return NULL;
     }
 
     it = PyObject_GetIter(v);
     if (it == NULL) {
-        Py_XDECREF(keyfunc);
         return NULL;
     }
 
@@ -1385,14 +1430,18 @@
     if (PyErr_Occurred())
         goto Fail_it;
     if (maxval == NULL) {
-        PyErr_Format(PyExc_ValueError,
-                     "%s() arg is an empty sequence", name);
         assert(maxitem == NULL);
+        if (defaultval != NULL) {
+            Py_INCREF(defaultval);
+            maxitem = defaultval;
+        } else {
+            PyErr_Format(PyExc_ValueError,
+                         "%s() arg is an empty sequence", name);
+        }
     }
     else
         Py_DECREF(maxval);
     Py_DECREF(it);
-    Py_XDECREF(keyfunc);
     return maxitem;
 
 Fail_it_item_and_val:
@@ -1403,7 +1452,6 @@
     Py_XDECREF(maxval);
     Py_XDECREF(maxitem);
     Py_DECREF(it);
-    Py_XDECREF(keyfunc);
     return NULL;
 }
 
@@ -1414,10 +1462,12 @@
 }
 
 PyDoc_STRVAR(min_doc,
-"min(iterable[, key=func]) -> value\n\
-min(a, b, c, ...[, key=func]) -> value\n\
+"min(iterable, *[, default=obj, key=func]) -> value\n\
+min(arg1, arg2, *args, *[, key=func]) -> value\n\
 \n\
-With a single iterable argument, return its smallest item.\n\
+With a single iterable argument, return its smallest item. The\n\
+default keyword-only argument specifies an object to return if\n\
+the provided iterable is empty.\n\
 With two or more arguments, return the smallest argument.");
 
 
@@ -1428,10 +1478,12 @@
 }
 
 PyDoc_STRVAR(max_doc,
-"max(iterable[, key=func]) -> value\n\
-max(a, b, c, ...[, key=func]) -> value\n\
+"max(iterable, *[, default=obj, key=func]) -> value\n\
+max(arg1, arg2, *args, *[, key=func]) -> value\n\
 \n\
-With a single iterable argument, return its largest item.\n\
+With a single iterable argument, return its biggest item. The\n\
+default keyword-only argument specifies an object to return if\n\
+the provided iterable is empty.\n\
 With two or more arguments, return the largest argument.");
 
 
@@ -1444,7 +1496,11 @@
 PyDoc_STRVAR(oct_doc,
 "oct(number) -> string\n\
 \n\
-Return the octal representation of an integer.");
+Return the octal representation of an integer.\n\
+\n\
+   >>> oct(342391)\n\
+   '0o1234567'\n\
+");
 
 
 static PyObject *
@@ -1530,7 +1586,12 @@
                                      kwlist, &sep, &end, &file, &flush))
         return NULL;
     if (file == NULL || file == Py_None) {
-        file = PySys_GetObject("stdout");
+        file = _PySys_GetObjectId(&PyId_stdout);
+        if (file == NULL) {
+            PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
+            return NULL;
+        }
+
         /* sys.stdout may be None when FILE* stdout isn't connected */
         if (file == Py_None)
             Py_RETURN_NONE;
@@ -1584,7 +1645,7 @@
         if (do_flush == -1)
             return NULL;
         else if (do_flush) {
-            tmp = PyObject_CallMethod(file, "flush", "");
+            tmp = _PyObject_CallMethodId(file, &PyId_flush, "");
             if (tmp == NULL)
                 return NULL;
             else
@@ -1610,9 +1671,9 @@
 builtin_input(PyObject *self, PyObject *args)
 {
     PyObject *promptarg = NULL;
-    PyObject *fin = PySys_GetObject("stdin");
-    PyObject *fout = PySys_GetObject("stdout");
-    PyObject *ferr = PySys_GetObject("stderr");
+    PyObject *fin = _PySys_GetObjectId(&PyId_stdin);
+    PyObject *fout = _PySys_GetObjectId(&PyId_stdout);
+    PyObject *ferr = _PySys_GetObjectId(&PyId_stderr);
     PyObject *tmp;
     long fd;
     int tty;
@@ -1683,8 +1744,6 @@
         char *stdin_encoding_str, *stdin_errors_str;
         PyObject *result;
         size_t len;
-        _Py_IDENTIFIER(encoding);
-        _Py_IDENTIFIER(errors);
 
         stdin_encoding = _PyObject_GetAttrId(fin, &PyId_encoding);
         stdin_errors = _PyObject_GetAttrId(fin, &PyId_errors);
@@ -1810,10 +1869,9 @@
 static PyObject *
 builtin_round(PyObject *self, PyObject *args, PyObject *kwds)
 {
-    static PyObject *round_str = NULL;
     PyObject *ndigits = NULL;
     static char *kwlist[] = {"number", "ndigits", 0};
-    PyObject *number, *round;
+    PyObject *number, *round, *result;
 
     if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O:round",
                                      kwlist, &number, &ndigits))
@@ -1824,24 +1882,21 @@
             return NULL;
     }
 
-    if (round_str == NULL) {
-        round_str = PyUnicode_InternFromString("__round__");
-        if (round_str == NULL)
-            return NULL;
-    }
-
-    round = _PyType_Lookup(Py_TYPE(number), round_str);
+    round = _PyObject_LookupSpecial(number, &PyId___round__);
     if (round == NULL) {
-        PyErr_Format(PyExc_TypeError,
-                     "type %.100s doesn't define __round__ method",
-                     Py_TYPE(number)->tp_name);
+        if (!PyErr_Occurred())
+            PyErr_Format(PyExc_TypeError,
+                         "type %.100s doesn't define __round__ method",
+                         Py_TYPE(number)->tp_name);
         return NULL;
     }
 
     if (ndigits == NULL)
-        return PyObject_CallFunction(round, "O", number);
+        result = PyObject_CallFunctionObjArgs(round, NULL);
     else
-        return PyObject_CallFunction(round, "OO", number, ndigits);
+        result = PyObject_CallFunctionObjArgs(round, ndigits, NULL);
+    Py_DECREF(round);
+    return result;
 }
 
 PyDoc_STRVAR(round_doc,
@@ -1859,7 +1914,6 @@
     PyObject *callable;
     static char *kwlist[] = {"iterable", "key", "reverse", 0};
     int reverse;
-    _Py_IDENTIFIER(sort);
 
     /* args 1-3 should match listsort in Objects/listobject.c */
     if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|Oi:sorted",
@@ -1907,16 +1961,11 @@
         return NULL;
     if (v == NULL) {
         d = PyEval_GetLocals();
-        if (d == NULL) {
-            if (!PyErr_Occurred())
-                PyErr_SetString(PyExc_SystemError,
-                                "vars(): no locals!?");
-        }
-        else
-            Py_INCREF(d);
+        if (d == NULL)
+            return NULL;
+        Py_INCREF(d);
     }
     else {
-        _Py_IDENTIFIER(__dict__);
         d = _PyObject_GetAttrId(v, &PyId___dict__);
         if (d == NULL) {
             PyErr_SetString(PyExc_TypeError,
@@ -2413,6 +2462,12 @@
 _PyBuiltin_Init(void)
 {
     PyObject *mod, *dict, *debug;
+
+    if (PyType_Ready(&PyFilter_Type) < 0 ||
+        PyType_Ready(&PyMap_Type) < 0 ||
+        PyType_Ready(&PyZip_Type) < 0)
+        return NULL;
+
     mod = PyModule_Create(&builtinsmodule);
     if (mod == NULL)
         return NULL;
diff --git a/Python/ceval.c b/Python/ceval.c
index 2b16191..7656b8e 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -37,7 +37,7 @@
 static void
 ppc_getcounter(uint64 *v)
 {
-    register unsigned long tbu, tb, tbu2;
+    unsigned long tbu, tb, tbu2;
 
   loop:
     asm volatile ("mftbu %0" : "=r" (tbu) );
@@ -65,9 +65,11 @@
    even in 64-bit mode, we need to use "a" and "d" for the lower and upper
    32-bit pieces of the result. */
 
-#define READ_TIMESTAMP(val) \
-    __asm__ __volatile__("rdtsc" : \
-                         "=a" (((int*)&(val))[0]), "=d" (((int*)&(val))[1]));
+#define READ_TIMESTAMP(val) do {                        \
+    unsigned int h, l;                                  \
+    __asm__ __volatile__("rdtsc" : "=a" (l), "=d" (h)); \
+    (val) = ((uint64)l) | (((uint64)h) << 32);          \
+    } while(0)
 
 
 #else
@@ -123,13 +125,16 @@
 static int lltrace;
 static int prtrace(PyObject *, char *);
 #endif
-static int call_trace(Py_tracefunc, PyObject *, PyFrameObject *,
+static int call_trace(Py_tracefunc, PyObject *,
+                      PyThreadState *, PyFrameObject *,
                       int, PyObject *);
 static int call_trace_protected(Py_tracefunc, PyObject *,
-                                PyFrameObject *, int, PyObject *);
-static void call_exc_trace(Py_tracefunc, PyObject *, PyFrameObject *);
+                                PyThreadState *, PyFrameObject *,
+                                int, PyObject *);
+static void call_exc_trace(Py_tracefunc, PyObject *,
+                           PyThreadState *, PyFrameObject *);
 static int maybe_call_line_trace(Py_tracefunc, PyObject *,
-                                 PyFrameObject *, int *, int *, int *);
+                                 PyThreadState *, PyFrameObject *, int *, int *, int *);
 
 static PyObject * cmp_outcome(int, PyObject *, PyObject *);
 static PyObject * import_from(PyObject *, PyObject *);
@@ -142,8 +147,6 @@
 
 #define NAME_ERROR_MSG \
     "name '%.200s' is not defined"
-#define GLOBAL_NAME_ERROR_MSG \
-    "global name '%.200s' is not defined"
 #define UNBOUNDLOCAL_ERROR_MSG \
     "local variable '%.200s' referenced before assignment"
 #define UNBOUNDFREE_ERROR_MSG \
@@ -364,29 +367,28 @@
     drop_gil(tstate);
 }
 
-/* This function is called from PyOS_AfterFork to ensure that newly
-   created child processes don't hold locks referring to threads which
-   are not running in the child process.  (This could also be done using
-   pthread_atfork mechanism, at least for the pthreads implementation.) */
+/* This function is called from PyOS_AfterFork to destroy all threads which are
+ * not running in the child process, and clear internal locks which might be
+ * held by those threads. (This could also be done using pthread_atfork
+ * mechanism, at least for the pthreads implementation.) */
 
 void
 PyEval_ReInitThreads(void)
 {
     _Py_IDENTIFIER(_after_fork);
     PyObject *threading, *result;
-    PyThreadState *tstate = PyThreadState_GET();
+    PyThreadState *current_tstate = PyThreadState_GET();
 
     if (!gil_created())
         return;
     recreate_gil();
     pending_lock = PyThread_allocate_lock();
-    take_gil(tstate);
+    take_gil(current_tstate);
     main_thread = PyThread_get_thread_ident();
 
     /* Update the threading module with the new state.
      */
-    tstate = PyThreadState_GET();
-    threading = PyMapping_GetItemString(tstate->interp->modules,
+    threading = PyMapping_GetItemString(current_tstate->interp->modules,
                                         "threading");
     if (threading == NULL) {
         /* threading not imported */
@@ -399,6 +401,9 @@
     else
         Py_DECREF(result);
     Py_DECREF(threading);
+
+    /* Destroy all threads except the current one */
+    _PyThreadState_DeleteExcept(current_tstate);
 }
 
 #else
@@ -742,7 +747,6 @@
 enum why_code {
         WHY_NOT =       0x0001, /* No error */
         WHY_EXCEPTION = 0x0002, /* Exception occurred */
-        WHY_RERAISE =   0x0004, /* Exception re-raised by 'finally' */
         WHY_RETURN =    0x0008, /* 'return' statement */
         WHY_BREAK =     0x0010, /* 'break' statement */
         WHY_CONTINUE =  0x0020, /* 'continue' statement */
@@ -753,7 +757,7 @@
 static void save_exc_state(PyThreadState *, PyFrameObject *);
 static void swap_exc_state(PyThreadState *, PyFrameObject *);
 static void restore_and_clear_exc_state(PyThreadState *, PyFrameObject *);
-static enum why_code do_raise(PyObject *, PyObject *);
+static int do_raise(PyObject *, PyObject *);
 static int unpack_iterable(PyObject *, int, int, PyObject **);
 
 /* Records whether tracing is on for any thread.  Counts the number of
@@ -793,18 +797,12 @@
 #ifdef DXPAIRS
     int lastopcode = 0;
 #endif
-    register PyObject **stack_pointer;  /* Next free slot in value stack */
-    register unsigned char *next_instr;
-    register int opcode;        /* Current opcode */
-    register int oparg;         /* Current opcode argument, if any */
-    register enum why_code why; /* Reason for block stack unwind */
-    register int err;           /* Error status -- nonzero if error */
-    register PyObject *x;       /* Result object -- NULL if error */
-    register PyObject *v;       /* Temporary objects popped off stack */
-    register PyObject *w;
-    register PyObject *u;
-    register PyObject *t;
-    register PyObject **fastlocals, **freevars;
+    PyObject **stack_pointer;  /* Next free slot in value stack */
+    unsigned char *next_instr;
+    int opcode;        /* Current opcode */
+    int oparg;         /* Current opcode argument, if any */
+    enum why_code why; /* Reason for block stack unwind */
+    PyObject **fastlocals, **freevars;
     PyObject *retval = NULL;            /* Return value */
     PyThreadState *tstate = PyThreadState_GET();
     PyCodeObject *co;
@@ -1143,7 +1141,7 @@
                whenever an exception is detected. */
             if (call_trace_protected(tstate->c_tracefunc,
                                      tstate->c_traceobj,
-                                     f, PyTrace_CALL, Py_None)) {
+                                     tstate, f, PyTrace_CALL, Py_None)) {
                 /* Trace function raised an error */
                 goto exit_eval_frame;
             }
@@ -1153,7 +1151,7 @@
                return itself and isn't called for "line" events */
             if (call_trace_protected(tstate->c_profilefunc,
                                      tstate->c_profileobj,
-                                     f, PyTrace_CALL, Py_None)) {
+                                     tstate, f, PyTrace_CALL, Py_None)) {
                 /* Profile function raised an error */
                 goto exit_eval_frame;
             }
@@ -1189,9 +1187,10 @@
     stack_pointer = f->f_stacktop;
     assert(stack_pointer != NULL);
     f->f_stacktop = NULL;       /* remains NULL unless yield suspends frame */
+    f->f_executing = 1;
 
-    if (co->co_flags & CO_GENERATOR && !throwflag) {
-        if (f->f_exc_type != NULL && f->f_exc_type != Py_None) {
+    if (co->co_flags & CO_GENERATOR) {
+        if (!throwflag && f->f_exc_type != NULL && f->f_exc_type != Py_None) {
             /* We were in an except handler when we left,
                restore the exception state which was put aside
                (see YIELD_VALUE). */
@@ -1206,14 +1205,16 @@
 #endif
 
     why = WHY_NOT;
-    err = 0;
-    x = Py_None;        /* Not a reference, just anything non-NULL */
-    w = NULL;
 
-    if (throwflag) { /* support for generator.throw() */
-        why = WHY_EXCEPTION;
-        goto on_error;
-    }
+    if (throwflag) /* support for generator.throw() */
+        goto error;
+
+#ifdef Py_DEBUG
+    /* PyEval_EvalFrameEx() must not be called with an exception set,
+       because it may clear it (directly or indirectly) and so the
+       caller looses its exception */
+    assert(!PyErr_Occurred());
+#endif
 
     for (;;) {
 #ifdef WITH_TSC
@@ -1235,6 +1236,7 @@
 #endif
         assert(stack_pointer >= f->f_valuestack); /* else underflow */
         assert(STACK_LEVEL() <= co->co_stacksize);  /* else overflow */
+        assert(!PyErr_Occurred());
 
         /* Do periodic things.  Doing this every time through
            the loop would add too much overhead, so we do it
@@ -1250,15 +1252,12 @@
                    a try: finally: block uninterruptible. */
                 goto fast_next_opcode;
             }
-            tstate->tick_counter++;
 #ifdef WITH_TSC
             ticked = 1;
 #endif
             if (_Py_atomic_load_relaxed(&pendingcalls_to_do)) {
-                if (Py_MakePendingCalls() < 0) {
-                    why = WHY_EXCEPTION;
-                    goto on_error;
-                }
+                if (Py_MakePendingCalls() < 0)
+                    goto error;
             }
 #ifdef WITH_THREAD
             if (_Py_atomic_load_relaxed(&gil_drop_request)) {
@@ -1270,19 +1269,25 @@
                 /* Other threads may run now */
 
                 take_gil(tstate);
+
+                /* Check if we should make a quick exit. */
+                if (_Py_Finalizing && _Py_Finalizing != tstate) {
+                    drop_gil(tstate);
+                    PyThread_exit_thread();
+                }
+
                 if (PyThreadState_Swap(tstate) != NULL)
                     Py_FatalError("ceval: orphan tstate");
             }
 #endif
             /* Check for asynchronous exceptions. */
             if (tstate->async_exc != NULL) {
-                x = tstate->async_exc;
+                PyObject *exc = tstate->async_exc;
                 tstate->async_exc = NULL;
                 UNSIGNAL_ASYNC_EXC();
-                PyErr_SetNone(x);
-                Py_DECREF(x);
-                why = WHY_EXCEPTION;
-                goto on_error;
+                PyErr_SetNone(exc);
+                Py_DECREF(exc);
+                goto error;
             }
         }
 
@@ -1293,24 +1298,24 @@
 
         if (_Py_TracingPossible &&
             tstate->c_tracefunc != NULL && !tstate->tracing) {
+            int err;
             /* see maybe_call_line_trace
                for expository comments */
             f->f_stacktop = stack_pointer;
 
             err = maybe_call_line_trace(tstate->c_tracefunc,
                                         tstate->c_traceobj,
-                                        f, &instr_lb, &instr_ub,
-                                        &instr_prev);
+                                        tstate, f,
+                                        &instr_lb, &instr_ub, &instr_prev);
             /* Reload possibly changed frame fields */
             JUMPTO(f->f_lasti);
             if (f->f_stacktop != NULL) {
                 stack_pointer = f->f_stacktop;
                 f->f_stacktop = NULL;
             }
-            if (err) {
+            if (err)
                 /* trace function raised an exception */
-                goto on_error;
-            }
+                goto error;
         }
 
         /* Extract opcode and argument */
@@ -1357,87 +1362,99 @@
         TARGET(NOP)
             FAST_DISPATCH();
 
-        TARGET(LOAD_FAST)
-            x = GETLOCAL(oparg);
-            if (x != NULL) {
-                Py_INCREF(x);
-                PUSH(x);
-                FAST_DISPATCH();
+        TARGET(LOAD_FAST) {
+            PyObject *value = GETLOCAL(oparg);
+            if (value == NULL) {
+                format_exc_check_arg(PyExc_UnboundLocalError,
+                                     UNBOUNDLOCAL_ERROR_MSG,
+                                     PyTuple_GetItem(co->co_varnames, oparg));
+                goto error;
             }
-            format_exc_check_arg(PyExc_UnboundLocalError,
-                UNBOUNDLOCAL_ERROR_MSG,
-                PyTuple_GetItem(co->co_varnames, oparg));
-            break;
-
-        TARGET(LOAD_CONST)
-            x = GETITEM(consts, oparg);
-            Py_INCREF(x);
-            PUSH(x);
+            Py_INCREF(value);
+            PUSH(value);
             FAST_DISPATCH();
+        }
+
+        TARGET(LOAD_CONST) {
+            PyObject *value = GETITEM(consts, oparg);
+            Py_INCREF(value);
+            PUSH(value);
+            FAST_DISPATCH();
+        }
 
         PREDICTED_WITH_ARG(STORE_FAST);
-        TARGET(STORE_FAST)
-            v = POP();
-            SETLOCAL(oparg, v);
+        TARGET(STORE_FAST) {
+            PyObject *value = POP();
+            SETLOCAL(oparg, value);
             FAST_DISPATCH();
+        }
 
-        TARGET(POP_TOP)
-            v = POP();
-            Py_DECREF(v);
+        TARGET(POP_TOP) {
+            PyObject *value = POP();
+            Py_DECREF(value);
             FAST_DISPATCH();
+        }
 
-        TARGET(ROT_TWO)
-            v = TOP();
-            w = SECOND();
-            SET_TOP(w);
-            SET_SECOND(v);
+        TARGET(ROT_TWO) {
+            PyObject *top = TOP();
+            PyObject *second = SECOND();
+            SET_TOP(second);
+            SET_SECOND(top);
             FAST_DISPATCH();
+        }
 
-        TARGET(ROT_THREE)
-            v = TOP();
-            w = SECOND();
-            x = THIRD();
-            SET_TOP(w);
-            SET_SECOND(x);
-            SET_THIRD(v);
+        TARGET(ROT_THREE) {
+            PyObject *top = TOP();
+            PyObject *second = SECOND();
+            PyObject *third = THIRD();
+            SET_TOP(second);
+            SET_SECOND(third);
+            SET_THIRD(top);
             FAST_DISPATCH();
+        }
 
-        TARGET(DUP_TOP)
-            v = TOP();
-            Py_INCREF(v);
-            PUSH(v);
+        TARGET(DUP_TOP) {
+            PyObject *top = TOP();
+            Py_INCREF(top);
+            PUSH(top);
             FAST_DISPATCH();
+        }
 
-        TARGET(DUP_TOP_TWO)
-            x = TOP();
-            Py_INCREF(x);
-            w = SECOND();
-            Py_INCREF(w);
+        TARGET(DUP_TOP_TWO) {
+            PyObject *top = TOP();
+            PyObject *second = SECOND();
+            Py_INCREF(top);
+            Py_INCREF(second);
             STACKADJ(2);
-            SET_TOP(x);
-            SET_SECOND(w);
+            SET_TOP(top);
+            SET_SECOND(second);
             FAST_DISPATCH();
+        }
 
-        TARGET(UNARY_POSITIVE)
-            v = TOP();
-            x = PyNumber_Positive(v);
-            Py_DECREF(v);
-            SET_TOP(x);
-            if (x != NULL) DISPATCH();
-            break;
+        TARGET(UNARY_POSITIVE) {
+            PyObject *value = TOP();
+            PyObject *res = PyNumber_Positive(value);
+            Py_DECREF(value);
+            SET_TOP(res);
+            if (res == NULL)
+                goto error;
+            DISPATCH();
+        }
 
-        TARGET(UNARY_NEGATIVE)
-            v = TOP();
-            x = PyNumber_Negative(v);
-            Py_DECREF(v);
-            SET_TOP(x);
-            if (x != NULL) DISPATCH();
-            break;
+        TARGET(UNARY_NEGATIVE) {
+            PyObject *value = TOP();
+            PyObject *res = PyNumber_Negative(value);
+            Py_DECREF(value);
+            SET_TOP(res);
+            if (res == NULL)
+                goto error;
+            DISPATCH();
+        }
 
-        TARGET(UNARY_NOT)
-            v = TOP();
-            err = PyObject_IsTrue(v);
-            Py_DECREF(v);
+        TARGET(UNARY_NOT) {
+            PyObject *value = TOP();
+            int err = PyObject_IsTrue(value);
+            Py_DECREF(value);
             if (err == 0) {
                 Py_INCREF(Py_True);
                 SET_TOP(Py_True);
@@ -1450,416 +1467,464 @@
                 DISPATCH();
             }
             STACKADJ(-1);
-            break;
+            goto error;
+        }
 
-        TARGET(UNARY_INVERT)
-            v = TOP();
-            x = PyNumber_Invert(v);
-            Py_DECREF(v);
-            SET_TOP(x);
-            if (x != NULL) DISPATCH();
-            break;
+        TARGET(UNARY_INVERT) {
+            PyObject *value = TOP();
+            PyObject *res = PyNumber_Invert(value);
+            Py_DECREF(value);
+            SET_TOP(res);
+            if (res == NULL)
+                goto error;
+            DISPATCH();
+        }
 
-        TARGET(BINARY_POWER)
-            w = POP();
-            v = TOP();
-            x = PyNumber_Power(v, w, Py_None);
-            Py_DECREF(v);
-            Py_DECREF(w);
-            SET_TOP(x);
-            if (x != NULL) DISPATCH();
-            break;
+        TARGET(BINARY_POWER) {
+            PyObject *exp = POP();
+            PyObject *base = TOP();
+            PyObject *res = PyNumber_Power(base, exp, Py_None);
+            Py_DECREF(base);
+            Py_DECREF(exp);
+            SET_TOP(res);
+            if (res == NULL)
+                goto error;
+            DISPATCH();
+        }
 
-        TARGET(BINARY_MULTIPLY)
-            w = POP();
-            v = TOP();
-            x = PyNumber_Multiply(v, w);
-            Py_DECREF(v);
-            Py_DECREF(w);
-            SET_TOP(x);
-            if (x != NULL) DISPATCH();
-            break;
+        TARGET(BINARY_MULTIPLY) {
+            PyObject *right = POP();
+            PyObject *left = TOP();
+            PyObject *res = PyNumber_Multiply(left, right);
+            Py_DECREF(left);
+            Py_DECREF(right);
+            SET_TOP(res);
+            if (res == NULL)
+                goto error;
+            DISPATCH();
+        }
 
-        TARGET(BINARY_TRUE_DIVIDE)
-            w = POP();
-            v = TOP();
-            x = PyNumber_TrueDivide(v, w);
-            Py_DECREF(v);
-            Py_DECREF(w);
-            SET_TOP(x);
-            if (x != NULL) DISPATCH();
-            break;
+        TARGET(BINARY_TRUE_DIVIDE) {
+            PyObject *divisor = POP();
+            PyObject *dividend = TOP();
+            PyObject *quotient = PyNumber_TrueDivide(dividend, divisor);
+            Py_DECREF(dividend);
+            Py_DECREF(divisor);
+            SET_TOP(quotient);
+            if (quotient == NULL)
+                goto error;
+            DISPATCH();
+        }
 
-        TARGET(BINARY_FLOOR_DIVIDE)
-            w = POP();
-            v = TOP();
-            x = PyNumber_FloorDivide(v, w);
-            Py_DECREF(v);
-            Py_DECREF(w);
-            SET_TOP(x);
-            if (x != NULL) DISPATCH();
-            break;
+        TARGET(BINARY_FLOOR_DIVIDE) {
+            PyObject *divisor = POP();
+            PyObject *dividend = TOP();
+            PyObject *quotient = PyNumber_FloorDivide(dividend, divisor);
+            Py_DECREF(dividend);
+            Py_DECREF(divisor);
+            SET_TOP(quotient);
+            if (quotient == NULL)
+                goto error;
+            DISPATCH();
+        }
 
-        TARGET(BINARY_MODULO)
-            w = POP();
-            v = TOP();
-            if (PyUnicode_CheckExact(v))
-                x = PyUnicode_Format(v, w);
-            else
-                x = PyNumber_Remainder(v, w);
-            Py_DECREF(v);
-            Py_DECREF(w);
-            SET_TOP(x);
-            if (x != NULL) DISPATCH();
-            break;
+        TARGET(BINARY_MODULO) {
+            PyObject *divisor = POP();
+            PyObject *dividend = TOP();
+            PyObject *res = PyUnicode_CheckExact(dividend) ?
+                PyUnicode_Format(dividend, divisor) :
+                PyNumber_Remainder(dividend, divisor);
+            Py_DECREF(divisor);
+            Py_DECREF(dividend);
+            SET_TOP(res);
+            if (res == NULL)
+                goto error;
+            DISPATCH();
+        }
 
-        TARGET(BINARY_ADD)
-            w = POP();
-            v = TOP();
-            if (PyUnicode_CheckExact(v) &&
-                     PyUnicode_CheckExact(w)) {
-                x = unicode_concatenate(v, w, f, next_instr);
+        TARGET(BINARY_ADD) {
+            PyObject *right = POP();
+            PyObject *left = TOP();
+            PyObject *sum;
+            if (PyUnicode_CheckExact(left) &&
+                     PyUnicode_CheckExact(right)) {
+                sum = unicode_concatenate(left, right, f, next_instr);
                 /* unicode_concatenate consumed the ref to v */
-                goto skip_decref_vx;
             }
             else {
-                x = PyNumber_Add(v, w);
+                sum = PyNumber_Add(left, right);
+                Py_DECREF(left);
             }
+            Py_DECREF(right);
+            SET_TOP(sum);
+            if (sum == NULL)
+                goto error;
+            DISPATCH();
+        }
+
+        TARGET(BINARY_SUBTRACT) {
+            PyObject *right = POP();
+            PyObject *left = TOP();
+            PyObject *diff = PyNumber_Subtract(left, right);
+            Py_DECREF(right);
+            Py_DECREF(left);
+            SET_TOP(diff);
+            if (diff == NULL)
+                goto error;
+            DISPATCH();
+        }
+
+        TARGET(BINARY_SUBSCR) {
+            PyObject *sub = POP();
+            PyObject *container = TOP();
+            PyObject *res = PyObject_GetItem(container, sub);
+            Py_DECREF(container);
+            Py_DECREF(sub);
+            SET_TOP(res);
+            if (res == NULL)
+                goto error;
+            DISPATCH();
+        }
+
+        TARGET(BINARY_LSHIFT) {
+            PyObject *right = POP();
+            PyObject *left = TOP();
+            PyObject *res = PyNumber_Lshift(left, right);
+            Py_DECREF(left);
+            Py_DECREF(right);
+            SET_TOP(res);
+            if (res == NULL)
+                goto error;
+            DISPATCH();
+        }
+
+        TARGET(BINARY_RSHIFT) {
+            PyObject *right = POP();
+            PyObject *left = TOP();
+            PyObject *res = PyNumber_Rshift(left, right);
+            Py_DECREF(left);
+            Py_DECREF(right);
+            SET_TOP(res);
+            if (res == NULL)
+                goto error;
+            DISPATCH();
+        }
+
+        TARGET(BINARY_AND) {
+            PyObject *right = POP();
+            PyObject *left = TOP();
+            PyObject *res = PyNumber_And(left, right);
+            Py_DECREF(left);
+            Py_DECREF(right);
+            SET_TOP(res);
+            if (res == NULL)
+                goto error;
+            DISPATCH();
+        }
+
+        TARGET(BINARY_XOR) {
+            PyObject *right = POP();
+            PyObject *left = TOP();
+            PyObject *res = PyNumber_Xor(left, right);
+            Py_DECREF(left);
+            Py_DECREF(right);
+            SET_TOP(res);
+            if (res == NULL)
+                goto error;
+            DISPATCH();
+        }
+
+        TARGET(BINARY_OR) {
+            PyObject *right = POP();
+            PyObject *left = TOP();
+            PyObject *res = PyNumber_Or(left, right);
+            Py_DECREF(left);
+            Py_DECREF(right);
+            SET_TOP(res);
+            if (res == NULL)
+                goto error;
+            DISPATCH();
+        }
+
+        TARGET(LIST_APPEND) {
+            PyObject *v = POP();
+            PyObject *list = PEEK(oparg);
+            int err;
+            err = PyList_Append(list, v);
             Py_DECREF(v);
-          skip_decref_vx:
-            Py_DECREF(w);
-            SET_TOP(x);
-            if (x != NULL) DISPATCH();
-            break;
+            if (err != 0)
+                goto error;
+            PREDICT(JUMP_ABSOLUTE);
+            DISPATCH();
+        }
 
-        TARGET(BINARY_SUBTRACT)
-            w = POP();
-            v = TOP();
-            x = PyNumber_Subtract(v, w);
+        TARGET(SET_ADD) {
+            PyObject *v = POP();
+            PyObject *set = stack_pointer[-oparg];
+            int err;
+            err = PySet_Add(set, v);
             Py_DECREF(v);
-            Py_DECREF(w);
-            SET_TOP(x);
-            if (x != NULL) DISPATCH();
-            break;
+            if (err != 0)
+                goto error;
+            PREDICT(JUMP_ABSOLUTE);
+            DISPATCH();
+        }
 
-        TARGET(BINARY_SUBSCR)
-            w = POP();
-            v = TOP();
-            x = PyObject_GetItem(v, w);
-            Py_DECREF(v);
-            Py_DECREF(w);
-            SET_TOP(x);
-            if (x != NULL) DISPATCH();
-            break;
+        TARGET(INPLACE_POWER) {
+            PyObject *exp = POP();
+            PyObject *base = TOP();
+            PyObject *res = PyNumber_InPlacePower(base, exp, Py_None);
+            Py_DECREF(base);
+            Py_DECREF(exp);
+            SET_TOP(res);
+            if (res == NULL)
+                goto error;
+            DISPATCH();
+        }
 
-        TARGET(BINARY_LSHIFT)
-            w = POP();
-            v = TOP();
-            x = PyNumber_Lshift(v, w);
-            Py_DECREF(v);
-            Py_DECREF(w);
-            SET_TOP(x);
-            if (x != NULL) DISPATCH();
-            break;
+        TARGET(INPLACE_MULTIPLY) {
+            PyObject *right = POP();
+            PyObject *left = TOP();
+            PyObject *res = PyNumber_InPlaceMultiply(left, right);
+            Py_DECREF(left);
+            Py_DECREF(right);
+            SET_TOP(res);
+            if (res == NULL)
+                goto error;
+            DISPATCH();
+        }
 
-        TARGET(BINARY_RSHIFT)
-            w = POP();
-            v = TOP();
-            x = PyNumber_Rshift(v, w);
-            Py_DECREF(v);
-            Py_DECREF(w);
-            SET_TOP(x);
-            if (x != NULL) DISPATCH();
-            break;
+        TARGET(INPLACE_TRUE_DIVIDE) {
+            PyObject *divisor = POP();
+            PyObject *dividend = TOP();
+            PyObject *quotient = PyNumber_InPlaceTrueDivide(dividend, divisor);
+            Py_DECREF(dividend);
+            Py_DECREF(divisor);
+            SET_TOP(quotient);
+            if (quotient == NULL)
+                goto error;
+            DISPATCH();
+        }
 
-        TARGET(BINARY_AND)
-            w = POP();
-            v = TOP();
-            x = PyNumber_And(v, w);
-            Py_DECREF(v);
-            Py_DECREF(w);
-            SET_TOP(x);
-            if (x != NULL) DISPATCH();
-            break;
+        TARGET(INPLACE_FLOOR_DIVIDE) {
+            PyObject *divisor = POP();
+            PyObject *dividend = TOP();
+            PyObject *quotient = PyNumber_InPlaceFloorDivide(dividend, divisor);
+            Py_DECREF(dividend);
+            Py_DECREF(divisor);
+            SET_TOP(quotient);
+            if (quotient == NULL)
+                goto error;
+            DISPATCH();
+        }
 
-        TARGET(BINARY_XOR)
-            w = POP();
-            v = TOP();
-            x = PyNumber_Xor(v, w);
-            Py_DECREF(v);
-            Py_DECREF(w);
-            SET_TOP(x);
-            if (x != NULL) DISPATCH();
-            break;
+        TARGET(INPLACE_MODULO) {
+            PyObject *right = POP();
+            PyObject *left = TOP();
+            PyObject *mod = PyNumber_InPlaceRemainder(left, right);
+            Py_DECREF(left);
+            Py_DECREF(right);
+            SET_TOP(mod);
+            if (mod == NULL)
+                goto error;
+            DISPATCH();
+        }
 
-        TARGET(BINARY_OR)
-            w = POP();
-            v = TOP();
-            x = PyNumber_Or(v, w);
-            Py_DECREF(v);
-            Py_DECREF(w);
-            SET_TOP(x);
-            if (x != NULL) DISPATCH();
-            break;
-
-        TARGET(LIST_APPEND)
-            w = POP();
-            v = PEEK(oparg);
-            err = PyList_Append(v, w);
-            Py_DECREF(w);
-            if (err == 0) {
-                PREDICT(JUMP_ABSOLUTE);
-                DISPATCH();
-            }
-            break;
-
-        TARGET(SET_ADD)
-            w = POP();
-            v = stack_pointer[-oparg];
-            err = PySet_Add(v, w);
-            Py_DECREF(w);
-            if (err == 0) {
-                PREDICT(JUMP_ABSOLUTE);
-                DISPATCH();
-            }
-            break;
-
-        TARGET(INPLACE_POWER)
-            w = POP();
-            v = TOP();
-            x = PyNumber_InPlacePower(v, w, Py_None);
-            Py_DECREF(v);
-            Py_DECREF(w);
-            SET_TOP(x);
-            if (x != NULL) DISPATCH();
-            break;
-
-        TARGET(INPLACE_MULTIPLY)
-            w = POP();
-            v = TOP();
-            x = PyNumber_InPlaceMultiply(v, w);
-            Py_DECREF(v);
-            Py_DECREF(w);
-            SET_TOP(x);
-            if (x != NULL) DISPATCH();
-            break;
-
-        TARGET(INPLACE_TRUE_DIVIDE)
-            w = POP();
-            v = TOP();
-            x = PyNumber_InPlaceTrueDivide(v, w);
-            Py_DECREF(v);
-            Py_DECREF(w);
-            SET_TOP(x);
-            if (x != NULL) DISPATCH();
-            break;
-
-        TARGET(INPLACE_FLOOR_DIVIDE)
-            w = POP();
-            v = TOP();
-            x = PyNumber_InPlaceFloorDivide(v, w);
-            Py_DECREF(v);
-            Py_DECREF(w);
-            SET_TOP(x);
-            if (x != NULL) DISPATCH();
-            break;
-
-        TARGET(INPLACE_MODULO)
-            w = POP();
-            v = TOP();
-            x = PyNumber_InPlaceRemainder(v, w);
-            Py_DECREF(v);
-            Py_DECREF(w);
-            SET_TOP(x);
-            if (x != NULL) DISPATCH();
-            break;
-
-        TARGET(INPLACE_ADD)
-            w = POP();
-            v = TOP();
-            if (PyUnicode_CheckExact(v) &&
-                     PyUnicode_CheckExact(w)) {
-                x = unicode_concatenate(v, w, f, next_instr);
+        TARGET(INPLACE_ADD) {
+            PyObject *right = POP();
+            PyObject *left = TOP();
+            PyObject *sum;
+            if (PyUnicode_CheckExact(left) && PyUnicode_CheckExact(right)) {
+                sum = unicode_concatenate(left, right, f, next_instr);
                 /* unicode_concatenate consumed the ref to v */
-                goto skip_decref_v;
             }
             else {
-                x = PyNumber_InPlaceAdd(v, w);
+                sum = PyNumber_InPlaceAdd(left, right);
+                Py_DECREF(left);
             }
-            Py_DECREF(v);
-          skip_decref_v:
-            Py_DECREF(w);
-            SET_TOP(x);
-            if (x != NULL) DISPATCH();
-            break;
+            Py_DECREF(right);
+            SET_TOP(sum);
+            if (sum == NULL)
+                goto error;
+            DISPATCH();
+        }
 
-        TARGET(INPLACE_SUBTRACT)
-            w = POP();
-            v = TOP();
-            x = PyNumber_InPlaceSubtract(v, w);
-            Py_DECREF(v);
-            Py_DECREF(w);
-            SET_TOP(x);
-            if (x != NULL) DISPATCH();
-            break;
+        TARGET(INPLACE_SUBTRACT) {
+            PyObject *right = POP();
+            PyObject *left = TOP();
+            PyObject *diff = PyNumber_InPlaceSubtract(left, right);
+            Py_DECREF(left);
+            Py_DECREF(right);
+            SET_TOP(diff);
+            if (diff == NULL)
+                goto error;
+            DISPATCH();
+        }
 
-        TARGET(INPLACE_LSHIFT)
-            w = POP();
-            v = TOP();
-            x = PyNumber_InPlaceLshift(v, w);
-            Py_DECREF(v);
-            Py_DECREF(w);
-            SET_TOP(x);
-            if (x != NULL) DISPATCH();
-            break;
+        TARGET(INPLACE_LSHIFT) {
+            PyObject *right = POP();
+            PyObject *left = TOP();
+            PyObject *res = PyNumber_InPlaceLshift(left, right);
+            Py_DECREF(left);
+            Py_DECREF(right);
+            SET_TOP(res);
+            if (res == NULL)
+                goto error;
+            DISPATCH();
+        }
 
-        TARGET(INPLACE_RSHIFT)
-            w = POP();
-            v = TOP();
-            x = PyNumber_InPlaceRshift(v, w);
-            Py_DECREF(v);
-            Py_DECREF(w);
-            SET_TOP(x);
-            if (x != NULL) DISPATCH();
-            break;
+        TARGET(INPLACE_RSHIFT) {
+            PyObject *right = POP();
+            PyObject *left = TOP();
+            PyObject *res = PyNumber_InPlaceRshift(left, right);
+            Py_DECREF(left);
+            Py_DECREF(right);
+            SET_TOP(res);
+            if (res == NULL)
+                goto error;
+            DISPATCH();
+        }
 
-        TARGET(INPLACE_AND)
-            w = POP();
-            v = TOP();
-            x = PyNumber_InPlaceAnd(v, w);
-            Py_DECREF(v);
-            Py_DECREF(w);
-            SET_TOP(x);
-            if (x != NULL) DISPATCH();
-            break;
+        TARGET(INPLACE_AND) {
+            PyObject *right = POP();
+            PyObject *left = TOP();
+            PyObject *res = PyNumber_InPlaceAnd(left, right);
+            Py_DECREF(left);
+            Py_DECREF(right);
+            SET_TOP(res);
+            if (res == NULL)
+                goto error;
+            DISPATCH();
+        }
 
-        TARGET(INPLACE_XOR)
-            w = POP();
-            v = TOP();
-            x = PyNumber_InPlaceXor(v, w);
-            Py_DECREF(v);
-            Py_DECREF(w);
-            SET_TOP(x);
-            if (x != NULL) DISPATCH();
-            break;
+        TARGET(INPLACE_XOR) {
+            PyObject *right = POP();
+            PyObject *left = TOP();
+            PyObject *res = PyNumber_InPlaceXor(left, right);
+            Py_DECREF(left);
+            Py_DECREF(right);
+            SET_TOP(res);
+            if (res == NULL)
+                goto error;
+            DISPATCH();
+        }
 
-        TARGET(INPLACE_OR)
-            w = POP();
-            v = TOP();
-            x = PyNumber_InPlaceOr(v, w);
-            Py_DECREF(v);
-            Py_DECREF(w);
-            SET_TOP(x);
-            if (x != NULL) DISPATCH();
-            break;
+        TARGET(INPLACE_OR) {
+            PyObject *right = POP();
+            PyObject *left = TOP();
+            PyObject *res = PyNumber_InPlaceOr(left, right);
+            Py_DECREF(left);
+            Py_DECREF(right);
+            SET_TOP(res);
+            if (res == NULL)
+                goto error;
+            DISPATCH();
+        }
 
-        TARGET(STORE_SUBSCR)
-            w = TOP();
-            v = SECOND();
-            u = THIRD();
+        TARGET(STORE_SUBSCR) {
+            PyObject *sub = TOP();
+            PyObject *container = SECOND();
+            PyObject *v = THIRD();
+            int err;
             STACKADJ(-3);
             /* v[w] = u */
-            err = PyObject_SetItem(v, w, u);
-            Py_DECREF(u);
+            err = PyObject_SetItem(container, sub, v);
             Py_DECREF(v);
-            Py_DECREF(w);
-            if (err == 0) DISPATCH();
-            break;
+            Py_DECREF(container);
+            Py_DECREF(sub);
+            if (err != 0)
+                goto error;
+            DISPATCH();
+        }
 
-        TARGET(DELETE_SUBSCR)
-            w = TOP();
-            v = SECOND();
+        TARGET(DELETE_SUBSCR) {
+            PyObject *sub = TOP();
+            PyObject *container = SECOND();
+            int err;
             STACKADJ(-2);
             /* del v[w] */
-            err = PyObject_DelItem(v, w);
-            Py_DECREF(v);
-            Py_DECREF(w);
-            if (err == 0) DISPATCH();
-            break;
+            err = PyObject_DelItem(container, sub);
+            Py_DECREF(container);
+            Py_DECREF(sub);
+            if (err != 0)
+                goto error;
+            DISPATCH();
+        }
 
-        TARGET(PRINT_EXPR)
-            v = POP();
-            w = PySys_GetObject("displayhook");
-            if (w == NULL) {
+        TARGET(PRINT_EXPR) {
+            _Py_IDENTIFIER(displayhook);
+            PyObject *value = POP();
+            PyObject *hook = _PySys_GetObjectId(&PyId_displayhook);
+            PyObject *res;
+            if (hook == NULL) {
                 PyErr_SetString(PyExc_RuntimeError,
                                 "lost sys.displayhook");
-                err = -1;
-                x = NULL;
+                Py_DECREF(value);
+                goto error;
             }
-            if (err == 0) {
-                x = PyTuple_Pack(1, v);
-                if (x == NULL)
-                    err = -1;
-            }
-            if (err == 0) {
-                w = PyEval_CallObject(w, x);
-                Py_XDECREF(w);
-                if (w == NULL)
-                    err = -1;
-            }
-            Py_DECREF(v);
-            Py_XDECREF(x);
-            break;
+            res = PyObject_CallFunctionObjArgs(hook, value, NULL);
+            Py_DECREF(value);
+            if (res == NULL)
+                goto error;
+            Py_DECREF(res);
+            DISPATCH();
+        }
 
 #ifdef CASE_TOO_BIG
         default: switch (opcode) {
 #endif
-        TARGET(RAISE_VARARGS)
-            v = w = NULL;
+        TARGET(RAISE_VARARGS) {
+            PyObject *cause = NULL, *exc = NULL;
             switch (oparg) {
             case 2:
-                v = POP(); /* cause */
+                cause = POP(); /* cause */
             case 1:
-                w = POP(); /* exc */
+                exc = POP(); /* exc */
             case 0: /* Fallthrough */
-                why = do_raise(w, v);
+                if (do_raise(exc, cause)) {
+                    why = WHY_EXCEPTION;
+                    goto fast_block_end;
+                }
                 break;
             default:
                 PyErr_SetString(PyExc_SystemError,
                            "bad RAISE_VARARGS oparg");
-                why = WHY_EXCEPTION;
                 break;
             }
-            break;
+            goto error;
+        }
 
-        TARGET(STORE_LOCALS)
-            x = POP();
-            v = f->f_locals;
-            Py_XDECREF(v);
-            f->f_locals = x;
-            DISPATCH();
-
-        TARGET(RETURN_VALUE)
+        TARGET(RETURN_VALUE) {
             retval = POP();
             why = WHY_RETURN;
             goto fast_block_end;
+        }
 
-        TARGET(YIELD_FROM)
-            u = POP();
-            x = TOP();
-            /* send u to x */
-            if (PyGen_CheckExact(x)) {
-                retval = _PyGen_Send((PyGenObject *)x, u);
+        TARGET(YIELD_FROM) {
+            PyObject *v = POP();
+            PyObject *reciever = TOP();
+            int err;
+            if (PyGen_CheckExact(reciever)) {
+                retval = _PyGen_Send((PyGenObject *)reciever, v);
             } else {
                 _Py_IDENTIFIER(send);
-                if (u == Py_None)
-                    retval = Py_TYPE(x)->tp_iternext(x);
+                if (v == Py_None)
+                    retval = Py_TYPE(reciever)->tp_iternext(reciever);
                 else
-                    retval = _PyObject_CallMethodId(x, &PyId_send, "O", u);
+                    retval = _PyObject_CallMethodIdObjArgs(reciever, &PyId_send, v, NULL);
             }
-            Py_DECREF(u);
-            if (!retval) {
+            Py_DECREF(v);
+            if (retval == NULL) {
                 PyObject *val;
-                x = POP(); /* Remove iter from stack */
-                Py_DECREF(x);
+                if (tstate->c_tracefunc != NULL
+                        && PyErr_ExceptionMatches(PyExc_StopIteration))
+                    call_exc_trace(tstate->c_tracefunc, tstate->c_traceobj, tstate, f);
                 err = _PyGen_FetchStopIterationValue(&val);
-                if (err < 0) {
-                    x = NULL;
-                    break;
-                }
-                x = val;
-                PUSH(x);
-                continue;
+                if (err < 0)
+                    goto error;
+                Py_DECREF(reciever);
+                SET_TOP(val);
+                DISPATCH();
             }
             /* x remains on stack, retval is value to be yielded */
             f->f_stacktop = stack_pointer;
@@ -1867,39 +1932,38 @@
             /* and repeat... */
             f->f_lasti--;
             goto fast_yield;
+        }
 
-        TARGET(YIELD_VALUE)
+        TARGET(YIELD_VALUE) {
             retval = POP();
             f->f_stacktop = stack_pointer;
             why = WHY_YIELD;
             goto fast_yield;
+        }
 
-        TARGET(POP_EXCEPT)
-            {
-                PyTryBlock *b = PyFrame_BlockPop(f);
-                if (b->b_type != EXCEPT_HANDLER) {
-                    PyErr_SetString(PyExc_SystemError,
-                        "popped block is not an except handler");
-                    why = WHY_EXCEPTION;
-                    break;
-                }
-                UNWIND_EXCEPT_HANDLER(b);
+        TARGET(POP_EXCEPT) {
+            PyTryBlock *b = PyFrame_BlockPop(f);
+            if (b->b_type != EXCEPT_HANDLER) {
+                PyErr_SetString(PyExc_SystemError,
+                                "popped block is not an except handler");
+                goto error;
             }
+            UNWIND_EXCEPT_HANDLER(b);
             DISPATCH();
+        }
 
-        TARGET(POP_BLOCK)
-            {
-                PyTryBlock *b = PyFrame_BlockPop(f);
-                UNWIND_BLOCK(b);
-            }
+        TARGET(POP_BLOCK) {
+            PyTryBlock *b = PyFrame_BlockPop(f);
+            UNWIND_BLOCK(b);
             DISPATCH();
+        }
 
         PREDICTED(END_FINALLY);
-        TARGET(END_FINALLY)
-            v = POP();
-            if (PyLong_Check(v)) {
-                why = (enum why_code) PyLong_AS_LONG(v);
-                assert(why != WHY_YIELD);
+        TARGET(END_FINALLY) {
+            PyObject *status = POP();
+            if (PyLong_Check(status)) {
+                why = (enum why_code) PyLong_AS_LONG(status);
+                assert(why != WHY_YIELD && why != WHY_EXCEPTION);
                 if (why == WHY_RETURN ||
                     why == WHY_CONTINUE)
                     retval = POP();
@@ -1912,248 +1976,280 @@
                     assert(b->b_type == EXCEPT_HANDLER);
                     UNWIND_EXCEPT_HANDLER(b);
                     why = WHY_NOT;
+                    Py_DECREF(status);
+                    DISPATCH();
                 }
+                Py_DECREF(status);
+                goto fast_block_end;
             }
-            else if (PyExceptionClass_Check(v)) {
-                w = POP();
-                u = POP();
-                PyErr_Restore(v, w, u);
-                why = WHY_RERAISE;
-                break;
+            else if (PyExceptionClass_Check(status)) {
+                PyObject *exc = POP();
+                PyObject *tb = POP();
+                PyErr_Restore(status, exc, tb);
+                why = WHY_EXCEPTION;
+                goto fast_block_end;
             }
-            else if (v != Py_None) {
+            else if (status != Py_None) {
                 PyErr_SetString(PyExc_SystemError,
                     "'finally' pops bad exception");
-                why = WHY_EXCEPTION;
+                Py_DECREF(status);
+                goto error;
             }
-            Py_DECREF(v);
-            break;
+            Py_DECREF(status);
+            DISPATCH();
+        }
 
-        TARGET(LOAD_BUILD_CLASS)
-        {
+        TARGET(LOAD_BUILD_CLASS) {
             _Py_IDENTIFIER(__build_class__);
 
+            PyObject *bc;
             if (PyDict_CheckExact(f->f_builtins)) {
-                x = _PyDict_GetItemId(f->f_builtins, &PyId___build_class__);
-                if (x == NULL) {
+                bc = _PyDict_GetItemId(f->f_builtins, &PyId___build_class__);
+                if (bc == NULL) {
                     PyErr_SetString(PyExc_NameError,
                                     "__build_class__ not found");
-                    break;
+                    goto error;
                 }
-                Py_INCREF(x);
+                Py_INCREF(bc);
             }
             else {
                 PyObject *build_class_str = _PyUnicode_FromId(&PyId___build_class__);
                 if (build_class_str == NULL)
                     break;
-                x = PyObject_GetItem(f->f_builtins, build_class_str);
-                if (x == NULL) {
+                bc = PyObject_GetItem(f->f_builtins, build_class_str);
+                if (bc == NULL) {
                     if (PyErr_ExceptionMatches(PyExc_KeyError))
                         PyErr_SetString(PyExc_NameError,
                                         "__build_class__ not found");
-                    break;
+                    goto error;
                 }
             }
-            PUSH(x);
-            break;
+            PUSH(bc);
+            DISPATCH();
         }
 
-        TARGET(STORE_NAME)
-            w = GETITEM(names, oparg);
-            v = POP();
-            if ((x = f->f_locals) != NULL) {
-                if (PyDict_CheckExact(x))
-                    err = PyDict_SetItem(x, w, v);
-                else
-                    err = PyObject_SetItem(x, w, v);
+        TARGET(STORE_NAME) {
+            PyObject *name = GETITEM(names, oparg);
+            PyObject *v = POP();
+            PyObject *ns = f->f_locals;
+            int err;
+            if (ns == NULL) {
+                PyErr_Format(PyExc_SystemError,
+                             "no locals found when storing %R", name);
                 Py_DECREF(v);
-                if (err == 0) DISPATCH();
-                break;
+                goto error;
             }
-            PyErr_Format(PyExc_SystemError,
-                         "no locals found when storing %R", w);
-            break;
+            if (PyDict_CheckExact(ns))
+                err = PyDict_SetItem(ns, name, v);
+            else
+                err = PyObject_SetItem(ns, name, v);
+            Py_DECREF(v);
+            if (err != 0)
+                goto error;
+            DISPATCH();
+        }
 
-        TARGET(DELETE_NAME)
-            w = GETITEM(names, oparg);
-            if ((x = f->f_locals) != NULL) {
-                if ((err = PyObject_DelItem(x, w)) != 0)
-                    format_exc_check_arg(PyExc_NameError,
-                                         NAME_ERROR_MSG,
-                                         w);
-                break;
+        TARGET(DELETE_NAME) {
+            PyObject *name = GETITEM(names, oparg);
+            PyObject *ns = f->f_locals;
+            int err;
+            if (ns == NULL) {
+                PyErr_Format(PyExc_SystemError,
+                             "no locals when deleting %R", name);
+                goto error;
             }
-            PyErr_Format(PyExc_SystemError,
-                         "no locals when deleting %R", w);
-            break;
+            err = PyObject_DelItem(ns, name);
+            if (err != 0) {
+                format_exc_check_arg(PyExc_NameError,
+                                     NAME_ERROR_MSG,
+                                     name);
+                goto error;
+            }
+            DISPATCH();
+        }
 
         PREDICTED_WITH_ARG(UNPACK_SEQUENCE);
-        TARGET(UNPACK_SEQUENCE)
-            v = POP();
-            if (PyTuple_CheckExact(v) &&
-                PyTuple_GET_SIZE(v) == oparg) {
-                PyObject **items = \
-                    ((PyTupleObject *)v)->ob_item;
+        TARGET(UNPACK_SEQUENCE) {
+            PyObject *seq = POP(), *item, **items;
+            if (PyTuple_CheckExact(seq) &&
+                PyTuple_GET_SIZE(seq) == oparg) {
+                items = ((PyTupleObject *)seq)->ob_item;
                 while (oparg--) {
-                    w = items[oparg];
-                    Py_INCREF(w);
-                    PUSH(w);
+                    item = items[oparg];
+                    Py_INCREF(item);
+                    PUSH(item);
                 }
-                Py_DECREF(v);
-                DISPATCH();
-            } else if (PyList_CheckExact(v) &&
-                       PyList_GET_SIZE(v) == oparg) {
-                PyObject **items = \
-                    ((PyListObject *)v)->ob_item;
+            } else if (PyList_CheckExact(seq) &&
+                       PyList_GET_SIZE(seq) == oparg) {
+                items = ((PyListObject *)seq)->ob_item;
                 while (oparg--) {
-                    w = items[oparg];
-                    Py_INCREF(w);
-                    PUSH(w);
+                    item = items[oparg];
+                    Py_INCREF(item);
+                    PUSH(item);
                 }
-            } else if (unpack_iterable(v, oparg, -1,
+            } else if (unpack_iterable(seq, oparg, -1,
                                        stack_pointer + oparg)) {
                 STACKADJ(oparg);
             } else {
                 /* unpack_iterable() raised an exception */
-                why = WHY_EXCEPTION;
+                Py_DECREF(seq);
+                goto error;
             }
-            Py_DECREF(v);
-            break;
+            Py_DECREF(seq);
+            DISPATCH();
+        }
 
-        TARGET(UNPACK_EX)
-        {
+        TARGET(UNPACK_EX) {
             int totalargs = 1 + (oparg & 0xFF) + (oparg >> 8);
-            v = POP();
+            PyObject *seq = POP();
 
-            if (unpack_iterable(v, oparg & 0xFF, oparg >> 8,
+            if (unpack_iterable(seq, oparg & 0xFF, oparg >> 8,
                                 stack_pointer + totalargs)) {
                 stack_pointer += totalargs;
             } else {
-                why = WHY_EXCEPTION;
+                Py_DECREF(seq);
+                goto error;
             }
-            Py_DECREF(v);
-            break;
+            Py_DECREF(seq);
+            DISPATCH();
         }
 
-        TARGET(STORE_ATTR)
-            w = GETITEM(names, oparg);
-            v = TOP();
-            u = SECOND();
+        TARGET(STORE_ATTR) {
+            PyObject *name = GETITEM(names, oparg);
+            PyObject *owner = TOP();
+            PyObject *v = SECOND();
+            int err;
             STACKADJ(-2);
-            err = PyObject_SetAttr(v, w, u); /* v.w = u */
+            err = PyObject_SetAttr(owner, name, v);
             Py_DECREF(v);
-            Py_DECREF(u);
-            if (err == 0) DISPATCH();
-            break;
+            Py_DECREF(owner);
+            if (err != 0)
+                goto error;
+            DISPATCH();
+        }
 
-        TARGET(DELETE_ATTR)
-            w = GETITEM(names, oparg);
-            v = POP();
-            err = PyObject_SetAttr(v, w, (PyObject *)NULL);
-                                            /* del v.w */
+        TARGET(DELETE_ATTR) {
+            PyObject *name = GETITEM(names, oparg);
+            PyObject *owner = POP();
+            int err;
+            err = PyObject_SetAttr(owner, name, (PyObject *)NULL);
+            Py_DECREF(owner);
+            if (err != 0)
+                goto error;
+            DISPATCH();
+        }
+
+        TARGET(STORE_GLOBAL) {
+            PyObject *name = GETITEM(names, oparg);
+            PyObject *v = POP();
+            int err;
+            err = PyDict_SetItem(f->f_globals, name, v);
             Py_DECREF(v);
-            break;
+            if (err != 0)
+                goto error;
+            DISPATCH();
+        }
 
-        TARGET(STORE_GLOBAL)
-            w = GETITEM(names, oparg);
-            v = POP();
-            err = PyDict_SetItem(f->f_globals, w, v);
-            Py_DECREF(v);
-            if (err == 0) DISPATCH();
-            break;
-
-        TARGET(DELETE_GLOBAL)
-            w = GETITEM(names, oparg);
-            if ((err = PyDict_DelItem(f->f_globals, w)) != 0)
+        TARGET(DELETE_GLOBAL) {
+            PyObject *name = GETITEM(names, oparg);
+            int err;
+            err = PyDict_DelItem(f->f_globals, name);
+            if (err != 0) {
                 format_exc_check_arg(
-                    PyExc_NameError, GLOBAL_NAME_ERROR_MSG, w);
-            break;
-
-        TARGET(LOAD_NAME)
-            w = GETITEM(names, oparg);
-            if ((v = f->f_locals) == NULL) {
-                PyErr_Format(PyExc_SystemError,
-                             "no locals when loading %R", w);
-                why = WHY_EXCEPTION;
-                break;
+                    PyExc_NameError, NAME_ERROR_MSG, name);
+                goto error;
             }
-            if (PyDict_CheckExact(v)) {
-                x = PyDict_GetItem(v, w);
-                Py_XINCREF(x);
+            DISPATCH();
+        }
+
+        TARGET(LOAD_NAME) {
+            PyObject *name = GETITEM(names, oparg);
+            PyObject *locals = f->f_locals;
+            PyObject *v;
+            if (locals == NULL) {
+                PyErr_Format(PyExc_SystemError,
+                             "no locals when loading %R", name);
+                goto error;
+            }
+            if (PyDict_CheckExact(locals)) {
+                v = PyDict_GetItem(locals, name);
+                Py_XINCREF(v);
             }
             else {
-                x = PyObject_GetItem(v, w);
-                if (x == NULL && _PyErr_OCCURRED()) {
-                    if (!PyErr_ExceptionMatches(
-                                    PyExc_KeyError))
-                        break;
+                v = PyObject_GetItem(locals, name);
+                if (v == NULL && _PyErr_OCCURRED()) {
+                    if (!PyErr_ExceptionMatches(PyExc_KeyError))
+                        goto error;
                     PyErr_Clear();
                 }
             }
-            if (x == NULL) {
-                x = PyDict_GetItem(f->f_globals, w);
-                Py_XINCREF(x);
-                if (x == NULL) {
+            if (v == NULL) {
+                v = PyDict_GetItem(f->f_globals, name);
+                Py_XINCREF(v);
+                if (v == NULL) {
                     if (PyDict_CheckExact(f->f_builtins)) {
-                        x = PyDict_GetItem(f->f_builtins, w);
-                        if (x == NULL) {
+                        v = PyDict_GetItem(f->f_builtins, name);
+                        if (v == NULL) {
                             format_exc_check_arg(
                                         PyExc_NameError,
-                                        NAME_ERROR_MSG, w);
-                            break;
+                                        NAME_ERROR_MSG, name);
+                            goto error;
                         }
-                        Py_INCREF(x);
+                        Py_INCREF(v);
                     }
                     else {
-                        x = PyObject_GetItem(f->f_builtins, w);
-                        if (x == NULL) {
+                        v = PyObject_GetItem(f->f_builtins, name);
+                        if (v == NULL) {
                             if (PyErr_ExceptionMatches(PyExc_KeyError))
                                 format_exc_check_arg(
                                             PyExc_NameError,
-                                            NAME_ERROR_MSG, w);
-                            break;
+                                            NAME_ERROR_MSG, name);
+                            goto error;
                         }
                     }
                 }
             }
-            PUSH(x);
+            PUSH(v);
             DISPATCH();
+        }
 
-        TARGET(LOAD_GLOBAL)
-            w = GETITEM(names, oparg);
+        TARGET(LOAD_GLOBAL) {
+            PyObject *name = GETITEM(names, oparg);
+            PyObject *v;
             if (PyDict_CheckExact(f->f_globals)
                 && PyDict_CheckExact(f->f_builtins)) {
-                x = _PyDict_LoadGlobal((PyDictObject *)f->f_globals,
+                v = _PyDict_LoadGlobal((PyDictObject *)f->f_globals,
                                        (PyDictObject *)f->f_builtins,
-                                       w);
-                if (x == NULL) {
+                                       name);
+                if (v == NULL) {
                     if (!_PyErr_OCCURRED())
                         format_exc_check_arg(PyExc_NameError,
-                                             GLOBAL_NAME_ERROR_MSG, w);
-                    break;
+                                             NAME_ERROR_MSG, name);
+                    goto error;
                 }
-                Py_INCREF(x);
+                Py_INCREF(v);
             }
             else {
                 /* Slow-path if globals or builtins is not a dict */
-                x = PyObject_GetItem(f->f_globals, w);
-                if (x == NULL) {
-                    x = PyObject_GetItem(f->f_builtins, w);
-                    if (x == NULL) {
+                v = PyObject_GetItem(f->f_globals, name);
+                if (v == NULL) {
+                    v = PyObject_GetItem(f->f_builtins, name);
+                    if (v == NULL) {
                         if (PyErr_ExceptionMatches(PyExc_KeyError))
                             format_exc_check_arg(
                                         PyExc_NameError,
-                                        GLOBAL_NAME_ERROR_MSG, w);
-                        break;
+                                        NAME_ERROR_MSG, name);
+                        goto error;
                     }
                 }
             }
-            PUSH(x);
+            PUSH(v);
             DISPATCH();
+        }
 
-        TARGET(DELETE_FAST)
-            x = GETLOCAL(oparg);
-            if (x != NULL) {
+        TARGET(DELETE_FAST) {
+            PyObject *v = GETLOCAL(oparg);
+            if (v != NULL) {
                 SETLOCAL(oparg, NULL);
                 DISPATCH();
             }
@@ -2162,252 +2258,312 @@
                 UNBOUNDLOCAL_ERROR_MSG,
                 PyTuple_GetItem(co->co_varnames, oparg)
                 );
-            break;
+            goto error;
+        }
 
-        TARGET(DELETE_DEREF)
-            x = freevars[oparg];
-            if (PyCell_GET(x) != NULL) {
-                PyCell_Set(x, NULL);
+        TARGET(DELETE_DEREF) {
+            PyObject *cell = freevars[oparg];
+            if (PyCell_GET(cell) != NULL) {
+                PyCell_Set(cell, NULL);
                 DISPATCH();
             }
-            err = -1;
             format_exc_unbound(co, oparg);
-            break;
+            goto error;
+        }
 
-        TARGET(LOAD_CLOSURE)
-            x = freevars[oparg];
-            Py_INCREF(x);
-            PUSH(x);
-            if (x != NULL) DISPATCH();
-            break;
-
-        TARGET(LOAD_DEREF)
-            x = freevars[oparg];
-            w = PyCell_Get(x);
-            if (w != NULL) {
-                PUSH(w);
-                DISPATCH();
-            }
-            err = -1;
-            format_exc_unbound(co, oparg);
-            break;
-
-        TARGET(STORE_DEREF)
-            w = POP();
-            x = freevars[oparg];
-            PyCell_Set(x, w);
-            Py_DECREF(w);
+        TARGET(LOAD_CLOSURE) {
+            PyObject *cell = freevars[oparg];
+            Py_INCREF(cell);
+            PUSH(cell);
             DISPATCH();
+        }
 
-        TARGET(BUILD_TUPLE)
-            x = PyTuple_New(oparg);
-            if (x != NULL) {
-                for (; --oparg >= 0;) {
-                    w = POP();
-                    PyTuple_SET_ITEM(x, oparg, w);
-                }
-                PUSH(x);
-                DISPATCH();
+        TARGET(LOAD_CLASSDEREF) {
+            PyObject *name, *value, *locals = f->f_locals;
+            Py_ssize_t idx;
+            assert(locals);
+            assert(oparg >= PyTuple_GET_SIZE(co->co_cellvars));
+            idx = oparg - PyTuple_GET_SIZE(co->co_cellvars);
+            assert(idx >= 0 && idx < PyTuple_GET_SIZE(co->co_freevars));
+            name = PyTuple_GET_ITEM(co->co_freevars, idx);
+            if (PyDict_CheckExact(locals)) {
+                value = PyDict_GetItem(locals, name);
+                Py_XINCREF(value);
             }
-            break;
-
-        TARGET(BUILD_LIST)
-            x =  PyList_New(oparg);
-            if (x != NULL) {
-                for (; --oparg >= 0;) {
-                    w = POP();
-                    PyList_SET_ITEM(x, oparg, w);
+            else {
+                value = PyObject_GetItem(locals, name);
+                if (value == NULL && PyErr_Occurred()) {
+                    if (!PyErr_ExceptionMatches(PyExc_KeyError))
+                        goto error;
+                    PyErr_Clear();
                 }
-                PUSH(x);
-                DISPATCH();
             }
-            break;
-
-        TARGET(BUILD_SET)
-            x = PySet_New(NULL);
-            if (x != NULL) {
-                for (; --oparg >= 0;) {
-                    w = POP();
-                    if (err == 0)
-                        err = PySet_Add(x, w);
-                    Py_DECREF(w);
+            if (!value) {
+                PyObject *cell = freevars[oparg];
+                value = PyCell_GET(cell);
+                if (value == NULL) {
+                    format_exc_unbound(co, oparg);
+                    goto error;
                 }
-                if (err != 0) {
-                    Py_DECREF(x);
-                    break;
-                }
-                PUSH(x);
-                DISPATCH();
+                Py_INCREF(value);
             }
-            break;
+            PUSH(value);
+            DISPATCH();
+        }
 
-        TARGET(BUILD_MAP)
-            x = _PyDict_NewPresized((Py_ssize_t)oparg);
-            PUSH(x);
-            if (x != NULL) DISPATCH();
-            break;
-
-        TARGET(STORE_MAP)
-            w = TOP();     /* key */
-            u = SECOND();  /* value */
-            v = THIRD();   /* dict */
-            STACKADJ(-2);
-            assert (PyDict_CheckExact(v));
-            err = PyDict_SetItem(v, w, u);  /* v[w] = u */
-            Py_DECREF(u);
-            Py_DECREF(w);
-            if (err == 0) DISPATCH();
-            break;
-
-        TARGET(MAP_ADD)
-            w = TOP();     /* key */
-            u = SECOND();  /* value */
-            STACKADJ(-2);
-            v = stack_pointer[-oparg];  /* dict */
-            assert (PyDict_CheckExact(v));
-            err = PyDict_SetItem(v, w, u);  /* v[w] = u */
-            Py_DECREF(u);
-            Py_DECREF(w);
-            if (err == 0) {
-                PREDICT(JUMP_ABSOLUTE);
-                DISPATCH();
+        TARGET(LOAD_DEREF) {
+            PyObject *cell = freevars[oparg];
+            PyObject *value = PyCell_GET(cell);
+            if (value == NULL) {
+                format_exc_unbound(co, oparg);
+                goto error;
             }
-            break;
+            Py_INCREF(value);
+            PUSH(value);
+            DISPATCH();
+        }
 
-        TARGET(LOAD_ATTR)
-            w = GETITEM(names, oparg);
-            v = TOP();
-            x = PyObject_GetAttr(v, w);
+        TARGET(STORE_DEREF) {
+            PyObject *v = POP();
+            PyObject *cell = freevars[oparg];
+            PyCell_Set(cell, v);
             Py_DECREF(v);
-            SET_TOP(x);
-            if (x != NULL) DISPATCH();
-            break;
+            DISPATCH();
+        }
 
-        TARGET(COMPARE_OP)
-            w = POP();
-            v = TOP();
-            x = cmp_outcome(oparg, v, w);
-            Py_DECREF(v);
-            Py_DECREF(w);
-            SET_TOP(x);
-            if (x == NULL) break;
+        TARGET(BUILD_TUPLE) {
+            PyObject *tup = PyTuple_New(oparg);
+            if (tup == NULL)
+                goto error;
+            while (--oparg >= 0) {
+                PyObject *item = POP();
+                PyTuple_SET_ITEM(tup, oparg, item);
+            }
+            PUSH(tup);
+            DISPATCH();
+        }
+
+        TARGET(BUILD_LIST) {
+            PyObject *list =  PyList_New(oparg);
+            if (list == NULL)
+                goto error;
+            while (--oparg >= 0) {
+                PyObject *item = POP();
+                PyList_SET_ITEM(list, oparg, item);
+            }
+            PUSH(list);
+            DISPATCH();
+        }
+
+        TARGET(BUILD_SET) {
+            PyObject *set = PySet_New(NULL);
+            int err = 0;
+            if (set == NULL)
+                goto error;
+            while (--oparg >= 0) {
+                PyObject *item = POP();
+                if (err == 0)
+                    err = PySet_Add(set, item);
+                Py_DECREF(item);
+            }
+            if (err != 0) {
+                Py_DECREF(set);
+                goto error;
+            }
+            PUSH(set);
+            DISPATCH();
+        }
+
+        TARGET(BUILD_MAP) {
+            PyObject *map = _PyDict_NewPresized((Py_ssize_t)oparg);
+            if (map == NULL)
+                goto error;
+            PUSH(map);
+            DISPATCH();
+        }
+
+        TARGET(STORE_MAP) {
+            PyObject *key = TOP();
+            PyObject *value = SECOND();
+            PyObject *map = THIRD();
+            int err;
+            STACKADJ(-2);
+            assert(PyDict_CheckExact(map));
+            err = PyDict_SetItem(map, key, value);
+            Py_DECREF(value);
+            Py_DECREF(key);
+            if (err != 0)
+                goto error;
+            DISPATCH();
+        }
+
+        TARGET(MAP_ADD) {
+            PyObject *key = TOP();
+            PyObject *value = SECOND();
+            PyObject *map;
+            int err;
+            STACKADJ(-2);
+            map = stack_pointer[-oparg];  /* dict */
+            assert(PyDict_CheckExact(map));
+            err = PyDict_SetItem(map, key, value);  /* v[w] = u */
+            Py_DECREF(value);
+            Py_DECREF(key);
+            if (err != 0)
+                goto error;
+            PREDICT(JUMP_ABSOLUTE);
+            DISPATCH();
+        }
+
+        TARGET(LOAD_ATTR) {
+            PyObject *name = GETITEM(names, oparg);
+            PyObject *owner = TOP();
+            PyObject *res = PyObject_GetAttr(owner, name);
+            Py_DECREF(owner);
+            SET_TOP(res);
+            if (res == NULL)
+                goto error;
+            DISPATCH();
+        }
+
+        TARGET(COMPARE_OP) {
+            PyObject *right = POP();
+            PyObject *left = TOP();
+            PyObject *res = cmp_outcome(oparg, left, right);
+            Py_DECREF(left);
+            Py_DECREF(right);
+            SET_TOP(res);
+            if (res == NULL)
+                goto error;
             PREDICT(POP_JUMP_IF_FALSE);
             PREDICT(POP_JUMP_IF_TRUE);
             DISPATCH();
-
-        TARGET(IMPORT_NAME)
-        {
-            _Py_IDENTIFIER(__import__);
-            w = GETITEM(names, oparg);
-            x = _PyDict_GetItemId(f->f_builtins, &PyId___import__);
-            if (x == NULL) {
-                PyErr_SetString(PyExc_ImportError,
-                                "__import__ not found");
-                break;
-            }
-            Py_INCREF(x);
-            v = POP();
-            u = TOP();
-            if (PyLong_AsLong(u) != -1 || PyErr_Occurred())
-                w = PyTuple_Pack(5,
-                            w,
-                            f->f_globals,
-                            f->f_locals == NULL ?
-                                  Py_None : f->f_locals,
-                            v,
-                            u);
-            else
-                w = PyTuple_Pack(4,
-                            w,
-                            f->f_globals,
-                            f->f_locals == NULL ?
-                                  Py_None : f->f_locals,
-                            v);
-            Py_DECREF(v);
-            Py_DECREF(u);
-            if (w == NULL) {
-                u = POP();
-                Py_DECREF(x);
-                x = NULL;
-                break;
-            }
-            READ_TIMESTAMP(intr0);
-            v = x;
-            x = PyEval_CallObject(v, w);
-            Py_DECREF(v);
-            READ_TIMESTAMP(intr1);
-            Py_DECREF(w);
-            SET_TOP(x);
-            if (x != NULL) DISPATCH();
-            break;
         }
 
-        TARGET(IMPORT_STAR)
-            v = POP();
-            PyFrame_FastToLocals(f);
-            if ((x = f->f_locals) == NULL) {
+        TARGET(IMPORT_NAME) {
+            _Py_IDENTIFIER(__import__);
+            PyObject *name = GETITEM(names, oparg);
+            PyObject *func = _PyDict_GetItemId(f->f_builtins, &PyId___import__);
+            PyObject *from, *level, *args, *res;
+            if (func == NULL) {
+                PyErr_SetString(PyExc_ImportError,
+                                "__import__ not found");
+                goto error;
+            }
+            Py_INCREF(func);
+            from = POP();
+            level = TOP();
+            if (PyLong_AsLong(level) != -1 || PyErr_Occurred())
+                args = PyTuple_Pack(5,
+                            name,
+                            f->f_globals,
+                            f->f_locals == NULL ?
+                                  Py_None : f->f_locals,
+                            from,
+                            level);
+            else
+                args = PyTuple_Pack(4,
+                            name,
+                            f->f_globals,
+                            f->f_locals == NULL ?
+                                  Py_None : f->f_locals,
+                            from);
+            Py_DECREF(level);
+            Py_DECREF(from);
+            if (args == NULL) {
+                Py_DECREF(func);
+                STACKADJ(-1);
+                goto error;
+            }
+            READ_TIMESTAMP(intr0);
+            res = PyEval_CallObject(func, args);
+            READ_TIMESTAMP(intr1);
+            Py_DECREF(args);
+            Py_DECREF(func);
+            SET_TOP(res);
+            if (res == NULL)
+                goto error;
+            DISPATCH();
+        }
+
+        TARGET(IMPORT_STAR) {
+            PyObject *from = POP(), *locals;
+            int err;
+            if (PyFrame_FastToLocalsWithError(f) < 0)
+                goto error;
+
+            locals = f->f_locals;
+            if (locals == NULL) {
                 PyErr_SetString(PyExc_SystemError,
                     "no locals found during 'import *'");
-                break;
+                goto error;
             }
             READ_TIMESTAMP(intr0);
-            err = import_all_from(x, v);
+            err = import_all_from(locals, from);
             READ_TIMESTAMP(intr1);
             PyFrame_LocalsToFast(f, 0);
-            Py_DECREF(v);
-            if (err == 0) DISPATCH();
-            break;
+            Py_DECREF(from);
+            if (err != 0)
+                goto error;
+            DISPATCH();
+        }
 
-        TARGET(IMPORT_FROM)
-            w = GETITEM(names, oparg);
-            v = TOP();
+        TARGET(IMPORT_FROM) {
+            PyObject *name = GETITEM(names, oparg);
+            PyObject *from = TOP();
+            PyObject *res;
             READ_TIMESTAMP(intr0);
-            x = import_from(v, w);
+            res = import_from(from, name);
             READ_TIMESTAMP(intr1);
-            PUSH(x);
-            if (x != NULL) DISPATCH();
-            break;
+            PUSH(res);
+            if (res == NULL)
+                goto error;
+            DISPATCH();
+        }
 
-        TARGET(JUMP_FORWARD)
+        TARGET(JUMP_FORWARD) {
             JUMPBY(oparg);
             FAST_DISPATCH();
+        }
 
         PREDICTED_WITH_ARG(POP_JUMP_IF_FALSE);
-        TARGET(POP_JUMP_IF_FALSE)
-            w = POP();
-            if (w == Py_True) {
-                Py_DECREF(w);
+        TARGET(POP_JUMP_IF_FALSE) {
+            PyObject *cond = POP();
+            int err;
+            if (cond == Py_True) {
+                Py_DECREF(cond);
                 FAST_DISPATCH();
             }
-            if (w == Py_False) {
-                Py_DECREF(w);
+            if (cond == Py_False) {
+                Py_DECREF(cond);
                 JUMPTO(oparg);
                 FAST_DISPATCH();
             }
-            err = PyObject_IsTrue(w);
-            Py_DECREF(w);
+            err = PyObject_IsTrue(cond);
+            Py_DECREF(cond);
             if (err > 0)
                 err = 0;
             else if (err == 0)
                 JUMPTO(oparg);
             else
-                break;
+                goto error;
             DISPATCH();
+        }
 
         PREDICTED_WITH_ARG(POP_JUMP_IF_TRUE);
-        TARGET(POP_JUMP_IF_TRUE)
-            w = POP();
-            if (w == Py_False) {
-                Py_DECREF(w);
+        TARGET(POP_JUMP_IF_TRUE) {
+            PyObject *cond = POP();
+            int err;
+            if (cond == Py_False) {
+                Py_DECREF(cond);
                 FAST_DISPATCH();
             }
-            if (w == Py_True) {
-                Py_DECREF(w);
+            if (cond == Py_True) {
+                Py_DECREF(cond);
                 JUMPTO(oparg);
                 FAST_DISPATCH();
             }
-            err = PyObject_IsTrue(w);
-            Py_DECREF(w);
+            err = PyObject_IsTrue(cond);
+            Py_DECREF(cond);
             if (err > 0) {
                 err = 0;
                 JUMPTO(oparg);
@@ -2415,58 +2571,63 @@
             else if (err == 0)
                 ;
             else
-                break;
+                goto error;
             DISPATCH();
+        }
 
-        TARGET(JUMP_IF_FALSE_OR_POP)
-            w = TOP();
-            if (w == Py_True) {
+        TARGET(JUMP_IF_FALSE_OR_POP) {
+            PyObject *cond = TOP();
+            int err;
+            if (cond == Py_True) {
                 STACKADJ(-1);
-                Py_DECREF(w);
+                Py_DECREF(cond);
                 FAST_DISPATCH();
             }
-            if (w == Py_False) {
+            if (cond == Py_False) {
                 JUMPTO(oparg);
                 FAST_DISPATCH();
             }
-            err = PyObject_IsTrue(w);
+            err = PyObject_IsTrue(cond);
             if (err > 0) {
                 STACKADJ(-1);
-                Py_DECREF(w);
+                Py_DECREF(cond);
                 err = 0;
             }
             else if (err == 0)
                 JUMPTO(oparg);
             else
-                break;
+                goto error;
             DISPATCH();
+        }
 
-        TARGET(JUMP_IF_TRUE_OR_POP)
-            w = TOP();
-            if (w == Py_False) {
+        TARGET(JUMP_IF_TRUE_OR_POP) {
+            PyObject *cond = TOP();
+            int err;
+            if (cond == Py_False) {
                 STACKADJ(-1);
-                Py_DECREF(w);
+                Py_DECREF(cond);
                 FAST_DISPATCH();
             }
-            if (w == Py_True) {
+            if (cond == Py_True) {
                 JUMPTO(oparg);
                 FAST_DISPATCH();
             }
-            err = PyObject_IsTrue(w);
+            err = PyObject_IsTrue(cond);
             if (err > 0) {
                 err = 0;
                 JUMPTO(oparg);
             }
             else if (err == 0) {
                 STACKADJ(-1);
-                Py_DECREF(w);
+                Py_DECREF(cond);
             }
             else
-                break;
+                goto error;
             DISPATCH();
+        }
 
         PREDICTED_WITH_ARG(JUMP_ABSOLUTE);
-        TARGET(JUMP_ABSOLUTE)
+        TARGET(JUMP_ABSOLUTE) {
             JUMPTO(oparg);
 #if FAST_LOOPS
             /* Enabling this path speeds-up all while and for-loops by bypassing
@@ -2480,60 +2641,62 @@
 #else
             DISPATCH();
 #endif
+        }
 
-        TARGET(GET_ITER)
+        TARGET(GET_ITER) {
             /* before: [obj]; after [getiter(obj)] */
-            v = TOP();
-            x = PyObject_GetIter(v);
-            Py_DECREF(v);
-            if (x != NULL) {
-                SET_TOP(x);
-                PREDICT(FOR_ITER);
-                DISPATCH();
-            }
-            STACKADJ(-1);
-            break;
+            PyObject *iterable = TOP();
+            PyObject *iter = PyObject_GetIter(iterable);
+            Py_DECREF(iterable);
+            SET_TOP(iter);
+            if (iter == NULL)
+                goto error;
+            PREDICT(FOR_ITER);
+            DISPATCH();
+        }
 
         PREDICTED_WITH_ARG(FOR_ITER);
-        TARGET(FOR_ITER)
+        TARGET(FOR_ITER) {
             /* before: [iter]; after: [iter, iter()] *or* [] */
-            v = TOP();
-            x = (*v->ob_type->tp_iternext)(v);
-            if (x != NULL) {
-                PUSH(x);
+            PyObject *iter = TOP();
+            PyObject *next = (*iter->ob_type->tp_iternext)(iter);
+            if (next != NULL) {
+                PUSH(next);
                 PREDICT(STORE_FAST);
                 PREDICT(UNPACK_SEQUENCE);
                 DISPATCH();
             }
             if (PyErr_Occurred()) {
-                if (!PyErr_ExceptionMatches(
-                                PyExc_StopIteration))
-                    break;
+                if (!PyErr_ExceptionMatches(PyExc_StopIteration))
+                    goto error;
+                else if (tstate->c_tracefunc != NULL)
+                    call_exc_trace(tstate->c_tracefunc, tstate->c_traceobj, tstate, f);
                 PyErr_Clear();
             }
             /* iterator ended normally */
-            x = v = POP();
-            Py_DECREF(v);
+            STACKADJ(-1);
+            Py_DECREF(iter);
             JUMPBY(oparg);
             DISPATCH();
+        }
 
-        TARGET(BREAK_LOOP)
+        TARGET(BREAK_LOOP) {
             why = WHY_BREAK;
             goto fast_block_end;
+        }
 
-        TARGET(CONTINUE_LOOP)
+        TARGET(CONTINUE_LOOP) {
             retval = PyLong_FromLong(oparg);
-            if (!retval) {
-                x = NULL;
-                break;
-            }
+            if (retval == NULL)
+                goto error;
             why = WHY_CONTINUE;
             goto fast_block_end;
+        }
 
         TARGET_WITH_IMPL(SETUP_LOOP, _setup_finally)
         TARGET_WITH_IMPL(SETUP_EXCEPT, _setup_finally)
         TARGET(SETUP_FINALLY)
-        _setup_finally:
+        _setup_finally: {
             /* NOTE: If you add any new block-setup opcodes that
                are not try/except/finally handlers, you may need
                to update the PyGen_NeedsFinalizing() function.
@@ -2542,37 +2705,35 @@
             PyFrame_BlockSetup(f, opcode, INSTR_OFFSET() + oparg,
                                STACK_LEVEL());
             DISPATCH();
+        }
 
-        TARGET(SETUP_WITH)
-        {
+        TARGET(SETUP_WITH) {
             _Py_IDENTIFIER(__exit__);
             _Py_IDENTIFIER(__enter__);
-            w = TOP();
-            x = special_lookup(w, &PyId___exit__);
-            if (!x)
-                break;
-            SET_TOP(x);
-            u = special_lookup(w, &PyId___enter__);
-            Py_DECREF(w);
-            if (!u) {
-                x = NULL;
-                break;
-            }
-            x = PyObject_CallFunctionObjArgs(u, NULL);
-            Py_DECREF(u);
-            if (!x)
-                break;
+            PyObject *mgr = TOP();
+            PyObject *exit = special_lookup(mgr, &PyId___exit__), *enter;
+            PyObject *res;
+            if (exit == NULL)
+                goto error;
+            SET_TOP(exit);
+            enter = special_lookup(mgr, &PyId___enter__);
+            Py_DECREF(mgr);
+            if (enter == NULL)
+                goto error;
+            res = PyObject_CallFunctionObjArgs(enter, NULL);
+            Py_DECREF(enter);
+            if (res == NULL)
+                goto error;
             /* Setup the finally block before pushing the result
                of __enter__ on the stack. */
             PyFrame_BlockSetup(f, SETUP_FINALLY, INSTR_OFFSET() + oparg,
                                STACK_LEVEL());
 
-            PUSH(x);
+            PUSH(res);
             DISPATCH();
         }
 
-        TARGET(WITH_CLEANUP)
-        {
+        TARGET(WITH_CLEANUP) {
             /* At the top of the stack are 1-6 values indicating
                how/why we entered the finally clause:
                - TOP = None
@@ -2599,42 +2760,42 @@
             */
 
             PyObject *exit_func;
-            u = TOP();
-            if (u == Py_None) {
+            PyObject *exc = TOP(), *val = Py_None, *tb = Py_None, *res;
+            int err;
+            if (exc == Py_None) {
                 (void)POP();
                 exit_func = TOP();
-                SET_TOP(u);
-                v = w = Py_None;
+                SET_TOP(exc);
             }
-            else if (PyLong_Check(u)) {
-                (void)POP();
-                switch(PyLong_AsLong(u)) {
+            else if (PyLong_Check(exc)) {
+                STACKADJ(-1);
+                switch (PyLong_AsLong(exc)) {
                 case WHY_RETURN:
                 case WHY_CONTINUE:
                     /* Retval in TOP. */
                     exit_func = SECOND();
                     SET_SECOND(TOP());
-                    SET_TOP(u);
+                    SET_TOP(exc);
                     break;
                 default:
                     exit_func = TOP();
-                    SET_TOP(u);
+                    SET_TOP(exc);
                     break;
                 }
-                u = v = w = Py_None;
+                exc = Py_None;
             }
             else {
-                PyObject *tp, *exc, *tb;
+                PyObject *tp2, *exc2, *tb2;
                 PyTryBlock *block;
-                v = SECOND();
-                w = THIRD();
-                tp = FOURTH();
-                exc = PEEK(5);
-                tb = PEEK(6);
+                val = SECOND();
+                tb = THIRD();
+                tp2 = FOURTH();
+                exc2 = PEEK(5);
+                tb2 = PEEK(6);
                 exit_func = PEEK(7);
-                SET_VALUE(7, tb);
-                SET_VALUE(6, exc);
-                SET_VALUE(5, tp);
+                SET_VALUE(7, tb2);
+                SET_VALUE(6, exc2);
+                SET_VALUE(5, tp2);
                 /* UNWIND_EXCEPT_HANDLER will pop this off. */
                 SET_FOURTH(NULL);
                 /* We just shifted the stack down, so we have
@@ -2645,56 +2806,53 @@
                 block->b_level--;
             }
             /* XXX Not the fastest way to call it... */
-            x = PyObject_CallFunctionObjArgs(exit_func, u, v, w,
-                                             NULL);
+            res = PyObject_CallFunctionObjArgs(exit_func, exc, val, tb, NULL);
             Py_DECREF(exit_func);
-            if (x == NULL)
-                break; /* Go to error exit */
+            if (res == NULL)
+                goto error;
 
-            if (u != Py_None)
-                err = PyObject_IsTrue(x);
+            if (exc != Py_None)
+                err = PyObject_IsTrue(res);
             else
                 err = 0;
-            Py_DECREF(x);
+            Py_DECREF(res);
 
             if (err < 0)
-                break; /* Go to error exit */
+                goto error;
             else if (err > 0) {
                 err = 0;
                 /* There was an exception and a True return */
                 PUSH(PyLong_FromLong((long) WHY_SILENCED));
             }
             PREDICT(END_FINALLY);
-            break;
+            DISPATCH();
         }
 
-        TARGET(CALL_FUNCTION)
-        {
-            PyObject **sp;
+        TARGET(CALL_FUNCTION) {
+            PyObject **sp, *res;
             PCALL(PCALL_ALL);
             sp = stack_pointer;
 #ifdef WITH_TSC
-            x = call_function(&sp, oparg, &intr0, &intr1);
+            res = call_function(&sp, oparg, &intr0, &intr1);
 #else
-            x = call_function(&sp, oparg);
+            res = call_function(&sp, oparg);
 #endif
             stack_pointer = sp;
-            PUSH(x);
-            if (x != NULL)
-                DISPATCH();
-            break;
+            PUSH(res);
+            if (res == NULL)
+                goto error;
+            DISPATCH();
         }
 
         TARGET_WITH_IMPL(CALL_FUNCTION_VAR, _call_function_var_kw)
         TARGET_WITH_IMPL(CALL_FUNCTION_KW, _call_function_var_kw)
         TARGET(CALL_FUNCTION_VAR_KW)
-        _call_function_var_kw:
-        {
+        _call_function_var_kw: {
             int na = oparg & 0xff;
             int nk = (oparg>>8) & 0xff;
             int flags = (opcode - CALL_FUNCTION) & 3;
             int n = na + 2 * nk;
-            PyObject **pfunc, *func, **sp;
+            PyObject **pfunc, *func, **sp, *res;
             PCALL(PCALL_ALL);
             if (flags & CALL_FLAG_VAR)
                 n++;
@@ -2717,137 +2875,156 @@
                 Py_INCREF(func);
             sp = stack_pointer;
             READ_TIMESTAMP(intr0);
-            x = ext_do_call(func, &sp, flags, na, nk);
+            res = ext_do_call(func, &sp, flags, na, nk);
             READ_TIMESTAMP(intr1);
             stack_pointer = sp;
             Py_DECREF(func);
 
             while (stack_pointer > pfunc) {
-                w = POP();
-                Py_DECREF(w);
+                PyObject *o = POP();
+                Py_DECREF(o);
             }
-            PUSH(x);
-            if (x != NULL)
-                DISPATCH();
-            break;
+            PUSH(res);
+            if (res == NULL)
+                goto error;
+            DISPATCH();
         }
 
         TARGET_WITH_IMPL(MAKE_CLOSURE, _make_function)
         TARGET(MAKE_FUNCTION)
-        _make_function:
-        {
+        _make_function: {
             int posdefaults = oparg & 0xff;
             int kwdefaults = (oparg>>8) & 0xff;
             int num_annotations = (oparg >> 16) & 0x7fff;
 
-            w = POP(); /* qualname */
-            v = POP(); /* code object */
-            x = PyFunction_NewWithQualName(v, f->f_globals, w);
-            Py_DECREF(v);
-            Py_DECREF(w);
+            PyObject *qualname = POP(); /* qualname */
+            PyObject *code = POP(); /* code object */
+            PyObject *func = PyFunction_NewWithQualName(code, f->f_globals, qualname);
+            Py_DECREF(code);
+            Py_DECREF(qualname);
 
-            if (x != NULL && opcode == MAKE_CLOSURE) {
-                v = POP();
-                if (PyFunction_SetClosure(x, v) != 0) {
+            if (func == NULL)
+                goto error;
+
+            if (opcode == MAKE_CLOSURE) {
+                PyObject *closure = POP();
+                if (PyFunction_SetClosure(func, closure) != 0) {
                     /* Can't happen unless bytecode is corrupt. */
-                    why = WHY_EXCEPTION;
+                    Py_DECREF(func);
+                    Py_DECREF(closure);
+                    goto error;
                 }
-                Py_DECREF(v);
+                Py_DECREF(closure);
             }
 
-            if (x != NULL && num_annotations > 0) {
+            if (num_annotations > 0) {
                 Py_ssize_t name_ix;
-                u = POP(); /* names of args with annotations */
-                v = PyDict_New();
-                if (v == NULL) {
-                    Py_DECREF(x);
-                    x = NULL;
-                    break;
+                PyObject *names = POP(); /* names of args with annotations */
+                PyObject *anns = PyDict_New();
+                if (anns == NULL) {
+                    Py_DECREF(func);
+                    goto error;
                 }
-                name_ix = PyTuple_Size(u);
+                name_ix = PyTuple_Size(names);
                 assert(num_annotations == name_ix+1);
                 while (name_ix > 0) {
+                    PyObject *name, *value;
+                    int err;
                     --name_ix;
-                    t = PyTuple_GET_ITEM(u, name_ix);
-                    w = POP();
-                    /* XXX(nnorwitz): check for errors */
-                    PyDict_SetItem(v, t, w);
-                    Py_DECREF(w);
+                    name = PyTuple_GET_ITEM(names, name_ix);
+                    value = POP();
+                    err = PyDict_SetItem(anns, name, value);
+                    Py_DECREF(value);
+                    if (err != 0) {
+                        Py_DECREF(anns);
+                        Py_DECREF(func);
+                        goto error;
+                    }
                 }
 
-                if (PyFunction_SetAnnotations(x, v) != 0) {
+                if (PyFunction_SetAnnotations(func, anns) != 0) {
                     /* Can't happen unless
                        PyFunction_SetAnnotations changes. */
-                    why = WHY_EXCEPTION;
+                    Py_DECREF(anns);
+                    Py_DECREF(func);
+                    goto error;
                 }
-                Py_DECREF(v);
-                Py_DECREF(u);
+                Py_DECREF(anns);
+                Py_DECREF(names);
             }
 
             /* XXX Maybe this should be a separate opcode? */
-            if (x != NULL && posdefaults > 0) {
-                v = PyTuple_New(posdefaults);
-                if (v == NULL) {
-                    Py_DECREF(x);
-                    x = NULL;
-                    break;
-                }
-                while (--posdefaults >= 0) {
-                    w = POP();
-                    PyTuple_SET_ITEM(v, posdefaults, w);
-                }
-                if (PyFunction_SetDefaults(x, v) != 0) {
-                    /* Can't happen unless
-                       PyFunction_SetDefaults changes. */
-                    why = WHY_EXCEPTION;
-                }
-                Py_DECREF(v);
-            }
-            if (x != NULL && kwdefaults > 0) {
-                v = PyDict_New();
-                if (v == NULL) {
-                    Py_DECREF(x);
-                    x = NULL;
-                    break;
+            if (kwdefaults > 0) {
+                PyObject *defs = PyDict_New();
+                if (defs == NULL) {
+                    Py_DECREF(func);
+                    goto error;
                 }
                 while (--kwdefaults >= 0) {
-                    w = POP(); /* default value */
-                    u = POP(); /* kw only arg name */
-                    /* XXX(nnorwitz): check for errors */
-                    PyDict_SetItem(v, u, w);
-                    Py_DECREF(w);
-                    Py_DECREF(u);
+                    PyObject *v = POP(); /* default value */
+                    PyObject *key = POP(); /* kw only arg name */
+                    int err = PyDict_SetItem(defs, key, v);
+                    Py_DECREF(v);
+                    Py_DECREF(key);
+                    if (err != 0) {
+                        Py_DECREF(defs);
+                        Py_DECREF(func);
+                        goto error;
+                    }
                 }
-                if (PyFunction_SetKwDefaults(x, v) != 0) {
+                if (PyFunction_SetKwDefaults(func, defs) != 0) {
                     /* Can't happen unless
                        PyFunction_SetKwDefaults changes. */
-                    why = WHY_EXCEPTION;
+                    Py_DECREF(func);
+                    Py_DECREF(defs);
+                    goto error;
                 }
-                Py_DECREF(v);
+                Py_DECREF(defs);
             }
-            PUSH(x);
-            break;
+            if (posdefaults > 0) {
+                PyObject *defs = PyTuple_New(posdefaults);
+                if (defs == NULL) {
+                    Py_DECREF(func);
+                    goto error;
+                }
+                while (--posdefaults >= 0)
+                    PyTuple_SET_ITEM(defs, posdefaults, POP());
+                if (PyFunction_SetDefaults(func, defs) != 0) {
+                    /* Can't happen unless
+                       PyFunction_SetDefaults changes. */
+                    Py_DECREF(defs);
+                    Py_DECREF(func);
+                    goto error;
+                }
+                Py_DECREF(defs);
+            }
+            PUSH(func);
+            DISPATCH();
         }
 
-        TARGET(BUILD_SLICE)
+        TARGET(BUILD_SLICE) {
+            PyObject *start, *stop, *step, *slice;
             if (oparg == 3)
-                w = POP();
+                step = POP();
             else
-                w = NULL;
-            v = POP();
-            u = TOP();
-            x = PySlice_New(u, v, w);
-            Py_DECREF(u);
-            Py_DECREF(v);
-            Py_XDECREF(w);
-            SET_TOP(x);
-            if (x != NULL) DISPATCH();
-            break;
+                step = NULL;
+            stop = POP();
+            start = TOP();
+            slice = PySlice_New(start, stop, step);
+            Py_DECREF(start);
+            Py_DECREF(stop);
+            Py_XDECREF(step);
+            SET_TOP(slice);
+            if (slice == NULL)
+                goto error;
+            DISPATCH();
+        }
 
-        TARGET(EXTENDED_ARG)
+        TARGET(EXTENDED_ARG) {
             opcode = NEXTOP();
             oparg = oparg<<16 | NEXTARG();
             goto dispatch_opcode;
+        }
 
 #if USE_COMPUTED_GOTOS
         _unknown_opcode:
@@ -2858,8 +3035,7 @@
                 PyFrame_GetLineNumber(f),
                 opcode);
             PyErr_SetString(PyExc_SystemError, "unknown opcode");
-            why = WHY_EXCEPTION;
-            break;
+            goto error;
 
 #ifdef CASE_TOO_BIG
         }
@@ -2867,71 +3043,36 @@
 
         } /* switch */
 
-        on_error:
+        /* This should never be reached. Every opcode should end with DISPATCH()
+           or goto error. */
+        assert(0);
 
+error:
         READ_TIMESTAMP(inst1);
 
-        /* Quickly continue if no error occurred */
+        assert(why == WHY_NOT);
+        why = WHY_EXCEPTION;
 
-        if (why == WHY_NOT) {
-            if (err == 0 && x != NULL) {
-#ifdef CHECKEXC
-                /* This check is expensive! */
-                if (PyErr_Occurred())
-                    fprintf(stderr,
-                        "XXX undetected error\n");
-                else {
-#endif
-                    READ_TIMESTAMP(loop1);
-                    continue; /* Normal, fast path */
-#ifdef CHECKEXC
-                }
-#endif
-            }
-            why = WHY_EXCEPTION;
-            x = Py_None;
-            err = 0;
-        }
-
-        /* Double-check exception status */
-
-        if (why == WHY_EXCEPTION || why == WHY_RERAISE) {
-            if (!PyErr_Occurred()) {
-                PyErr_SetString(PyExc_SystemError,
-                    "error return without exception set");
-                why = WHY_EXCEPTION;
-            }
-        }
-#ifdef CHECKEXC
-        else {
-            /* This check is expensive! */
-            if (PyErr_Occurred()) {
-                char buf[128];
-                sprintf(buf, "Stack unwind with exception "
-                    "set and why=%d", why);
-                Py_FatalError(buf);
-            }
-        }
+        /* Double-check exception status. */
+#ifdef NDEBUG
+        if (!PyErr_Occurred())
+            PyErr_SetString(PyExc_SystemError,
+                            "error return without exception set");
+#else
+        assert(PyErr_Occurred());
 #endif
 
-        /* Log traceback info if this is a real exception */
+        /* Log traceback info. */
+        PyTraceBack_Here(f);
 
-        if (why == WHY_EXCEPTION) {
-            PyTraceBack_Here(f);
-
-            if (tstate->c_tracefunc != NULL)
-                call_exc_trace(tstate->c_tracefunc,
-                               tstate->c_traceobj, f);
-        }
-
-        /* For the rest, treat WHY_RERAISE as WHY_EXCEPTION */
-
-        if (why == WHY_RERAISE)
-            why = WHY_EXCEPTION;
-
-        /* Unwind stacks if a (pseudo) exception occurred */
+        if (tstate->c_tracefunc != NULL)
+            call_exc_trace(tstate->c_tracefunc, tstate->c_traceobj,
+                           tstate, f);
 
 fast_block_end:
+        assert(why != WHY_NOT);
+
+        /* Unwind stacks if a (pseudo) exception occurred */
         while (why != WHY_NOT && f->f_iblock > 0) {
             /* Peek at the current block. */
             PyTryBlock *b = &f->f_blockstack[f->f_iblock - 1];
@@ -2978,7 +3119,10 @@
                    Python main loop. */
                 PyErr_NormalizeException(
                     &exc, &val, &tb);
-                PyException_SetTraceback(val, tb);
+                if (tb != NULL)
+                    PyException_SetTraceback(val, tb);
+                else
+                    PyException_SetTraceback(val, Py_None);
                 Py_INCREF(exc);
                 tstate->exc_type = exc;
                 Py_INCREF(val);
@@ -3010,20 +3154,26 @@
             break;
         READ_TIMESTAMP(loop1);
 
+        assert(!PyErr_Occurred());
+
     } /* main loop */
 
     assert(why != WHY_YIELD);
     /* Pop remaining stack entries. */
     while (!EMPTY()) {
-        v = POP();
-        Py_XDECREF(v);
+        PyObject *o = POP();
+        Py_XDECREF(o);
     }
 
     if (why != WHY_RETURN)
         retval = NULL;
 
+    assert((retval != NULL && !PyErr_Occurred())
+            || (retval == NULL && PyErr_Occurred()));
+
 fast_yield:
-    if (co->co_flags & CO_GENERATOR && (why == WHY_YIELD || why == WHY_RETURN)) {
+    if (co->co_flags & CO_GENERATOR) {
+
         /* The purpose of this block is to put aside the generator's exception
            state and restore that of the calling frame. If the current
            exception state is from the caller, we clear the exception values
@@ -3046,26 +3196,27 @@
     if (tstate->use_tracing) {
         if (tstate->c_tracefunc) {
             if (why == WHY_RETURN || why == WHY_YIELD) {
-                if (call_trace(tstate->c_tracefunc,
-                               tstate->c_traceobj, f,
+                if (call_trace(tstate->c_tracefunc, tstate->c_traceobj,
+                               tstate, f,
                                PyTrace_RETURN, retval)) {
                     Py_CLEAR(retval);
                     why = WHY_EXCEPTION;
                 }
             }
             else if (why == WHY_EXCEPTION) {
-                call_trace_protected(tstate->c_tracefunc,
-                                     tstate->c_traceobj, f,
+                call_trace_protected(tstate->c_tracefunc, tstate->c_traceobj,
+                                     tstate, f,
                                      PyTrace_RETURN, NULL);
             }
         }
         if (tstate->c_profilefunc) {
             if (why == WHY_EXCEPTION)
                 call_trace_protected(tstate->c_profilefunc,
-                                     tstate->c_profileobj, f,
+                                     tstate->c_profileobj,
+                                     tstate, f,
                                      PyTrace_RETURN, NULL);
-            else if (call_trace(tstate->c_profilefunc,
-                                tstate->c_profileobj, f,
+            else if (call_trace(tstate->c_profilefunc, tstate->c_profileobj,
+                                tstate, f,
                                 PyTrace_RETURN, retval)) {
                 Py_CLEAR(retval);
                 /* why = WHY_EXCEPTION; */
@@ -3076,6 +3227,7 @@
     /* pop frame */
 exit_eval_frame:
     Py_LeaveRecursiveCall();
+    f->f_executing = 0;
     tstate->frame = f->f_back;
 
     return retval;
@@ -3241,9 +3393,9 @@
            PyObject **defs, int defcount, PyObject *kwdefs, PyObject *closure)
 {
     PyCodeObject* co = (PyCodeObject*)_co;
-    register PyFrameObject *f;
-    register PyObject *retval = NULL;
-    register PyObject **fastlocals, **freevars;
+    PyFrameObject *f;
+    PyObject *retval = NULL;
+    PyObject **fastlocals, **freevars;
     PyThreadState *tstate = PyThreadState_GET();
     PyObject *x, *u;
     int total_args = co->co_argcount + co->co_kwonlyargcount;
@@ -3519,7 +3671,7 @@
 
 /* Logic for the raise statement (too complicated for inlining).
    This *consumes* a reference count to each of its arguments. */
-static enum why_code
+static int
 do_raise(PyObject *exc, PyObject *cause)
 {
     PyObject *type = NULL, *value = NULL;
@@ -3534,13 +3686,13 @@
         if (type == Py_None) {
             PyErr_SetString(PyExc_RuntimeError,
                             "No active exception to reraise");
-            return WHY_EXCEPTION;
-            }
+            return 0;
+        }
         Py_XINCREF(type);
         Py_XINCREF(value);
         Py_XINCREF(tb);
         PyErr_Restore(type, value, tb);
-        return WHY_RERAISE;
+        return 1;
     }
 
     /* We support the following forms of raise:
@@ -3603,13 +3755,13 @@
     /* PyErr_SetObject incref's its arguments */
     Py_XDECREF(value);
     Py_XDECREF(type);
-    return WHY_EXCEPTION;
+    return 0;
 
 raise_error:
     Py_XDECREF(value);
     Py_XDECREF(type);
     Py_XDECREF(cause);
-    return WHY_EXCEPTION;
+    return 0;
 }
 
 /* Iterate v argcnt times and store the results on the stack (via decreasing
@@ -3706,40 +3858,43 @@
 #endif
 
 static void
-call_exc_trace(Py_tracefunc func, PyObject *self, PyFrameObject *f)
+call_exc_trace(Py_tracefunc func, PyObject *self,
+               PyThreadState *tstate, PyFrameObject *f)
 {
-    PyObject *type, *value, *traceback, *arg;
+    PyObject *type, *value, *traceback, *orig_traceback, *arg;
     int err;
-    PyErr_Fetch(&type, &value, &traceback);
+    PyErr_Fetch(&type, &value, &orig_traceback);
     if (value == NULL) {
         value = Py_None;
         Py_INCREF(value);
     }
-    PyErr_NormalizeException(&type, &value, &traceback);
+    PyErr_NormalizeException(&type, &value, &orig_traceback);
+    traceback = (orig_traceback != NULL) ? orig_traceback : Py_None;
     arg = PyTuple_Pack(3, type, value, traceback);
     if (arg == NULL) {
-        PyErr_Restore(type, value, traceback);
+        PyErr_Restore(type, value, orig_traceback);
         return;
     }
-    err = call_trace(func, self, f, PyTrace_EXCEPTION, arg);
+    err = call_trace(func, self, tstate, f, PyTrace_EXCEPTION, arg);
     Py_DECREF(arg);
     if (err == 0)
-        PyErr_Restore(type, value, traceback);
+        PyErr_Restore(type, value, orig_traceback);
     else {
         Py_XDECREF(type);
         Py_XDECREF(value);
-        Py_XDECREF(traceback);
+        Py_XDECREF(orig_traceback);
     }
 }
 
 static int
-call_trace_protected(Py_tracefunc func, PyObject *obj, PyFrameObject *frame,
+call_trace_protected(Py_tracefunc func, PyObject *obj,
+                     PyThreadState *tstate, PyFrameObject *frame,
                      int what, PyObject *arg)
 {
     PyObject *type, *value, *traceback;
     int err;
     PyErr_Fetch(&type, &value, &traceback);
-    err = call_trace(func, obj, frame, what, arg);
+    err = call_trace(func, obj, tstate, frame, what, arg);
     if (err == 0)
     {
         PyErr_Restore(type, value, traceback);
@@ -3754,10 +3909,10 @@
 }
 
 static int
-call_trace(Py_tracefunc func, PyObject *obj, PyFrameObject *frame,
+call_trace(Py_tracefunc func, PyObject *obj,
+           PyThreadState *tstate, PyFrameObject *frame,
            int what, PyObject *arg)
 {
-    register PyThreadState *tstate = frame->f_tstate;
     int result;
     if (tstate->tracing)
         return 0;
@@ -3773,8 +3928,7 @@
 PyObject *
 _PyEval_CallTracing(PyObject *func, PyObject *args)
 {
-    PyFrameObject *frame = PyEval_GetFrame();
-    PyThreadState *tstate = frame->f_tstate;
+    PyThreadState *tstate = PyThreadState_GET();
     int save_tracing = tstate->tracing;
     int save_use_tracing = tstate->use_tracing;
     PyObject *result;
@@ -3791,8 +3945,8 @@
 /* See Objects/lnotab_notes.txt for a description of how tracing works. */
 static int
 maybe_call_line_trace(Py_tracefunc func, PyObject *obj,
-                      PyFrameObject *frame, int *instr_lb, int *instr_ub,
-                      int *instr_prev)
+                      PyThreadState *tstate, PyFrameObject *frame,
+                      int *instr_lb, int *instr_ub, int *instr_prev)
 {
     int result = 0;
     int line = frame->f_lineno;
@@ -3812,7 +3966,7 @@
        number and call the trace function. */
     if (frame->f_lasti == *instr_lb || frame->f_lasti < *instr_prev) {
         frame->f_lineno = line;
-        result = call_trace(func, obj, frame, PyTrace_LINE, Py_None);
+        result = call_trace(func, obj, tstate, frame, PyTrace_LINE, Py_None);
     }
     *instr_prev = frame->f_lasti;
     return result;
@@ -3868,9 +4022,15 @@
 PyEval_GetLocals(void)
 {
     PyFrameObject *current_frame = PyEval_GetFrame();
-    if (current_frame == NULL)
+    if (current_frame == NULL) {
+        PyErr_SetString(PyExc_SystemError, "frame does not exist");
         return NULL;
-    PyFrame_FastToLocals(current_frame);
+    }
+
+    if (PyFrame_FastToLocalsWithError(current_frame) < 0)
+        return NULL;
+
+    assert(current_frame->f_locals != NULL);
     return current_frame->f_locals;
 }
 
@@ -3880,8 +4040,9 @@
     PyFrameObject *current_frame = PyEval_GetFrame();
     if (current_frame == NULL)
         return NULL;
-    else
-        return current_frame->f_globals;
+
+    assert(current_frame->f_globals != NULL);
+    return current_frame->f_globals;
 }
 
 PyFrameObject *
@@ -3923,6 +4084,13 @@
 {
     PyObject *result;
 
+#ifdef Py_DEBUG
+    /* PyEval_CallObjectWithKeywords() must not be called with an exception
+       set, because it may clear it (directly or indirectly)
+       and so the caller looses its exception */
+    assert(!PyErr_Occurred());
+#endif
+
     if (arg == NULL) {
         arg = PyTuple_New(0);
         if (arg == NULL)
@@ -3945,6 +4113,9 @@
 
     result = PyObject_Call(func, arg, kw);
     Py_DECREF(arg);
+
+    assert((result != NULL && !PyErr_Occurred())
+           || (result == NULL && PyErr_Occurred()));
     return result;
 }
 
@@ -3991,10 +4162,9 @@
 
 #define C_TRACE(x, call) \
 if (tstate->use_tracing && tstate->c_profilefunc) { \
-    if (call_trace(tstate->c_profilefunc, \
-        tstate->c_profileobj, \
-        tstate->frame, PyTrace_C_CALL, \
-        func)) { \
+    if (call_trace(tstate->c_profilefunc, tstate->c_profileobj, \
+        tstate, tstate->frame, \
+        PyTrace_C_CALL, func)) { \
         x = NULL; \
     } \
     else { \
@@ -4003,14 +4173,14 @@
             if (x == NULL) { \
                 call_trace_protected(tstate->c_profilefunc, \
                     tstate->c_profileobj, \
-                    tstate->frame, PyTrace_C_EXCEPTION, \
-                    func); \
+                    tstate, tstate->frame, \
+                    PyTrace_C_EXCEPTION, func); \
                 /* XXX should pass (type, value, tb) */ \
             } else { \
                 if (call_trace(tstate->c_profilefunc, \
                     tstate->c_profileobj, \
-                    tstate->frame, PyTrace_C_RETURN, \
-                    func)) { \
+                    tstate, tstate->frame, \
+                    PyTrace_C_RETURN, func)) { \
                     Py_DECREF(x); \
                     x = NULL; \
                 } \
@@ -4062,10 +4232,15 @@
         else {
             PyObject *callargs;
             callargs = load_args(pp_stack, na);
-            READ_TIMESTAMP(*pintr0);
-            C_TRACE(x, PyCFunction_Call(func,callargs,NULL));
-            READ_TIMESTAMP(*pintr1);
-            Py_XDECREF(callargs);
+            if (callargs != NULL) {
+                READ_TIMESTAMP(*pintr0);
+                C_TRACE(x, PyCFunction_Call(func,callargs,NULL));
+                READ_TIMESTAMP(*pintr1);
+                Py_XDECREF(callargs);
+            }
+            else {
+                x = NULL;
+            }
         }
     } else {
         if (PyMethod_Check(func) && PyMethod_GET_SELF(func) != NULL) {
@@ -4090,6 +4265,8 @@
         READ_TIMESTAMP(*pintr1);
         Py_DECREF(func);
     }
+    assert((x != NULL && !PyErr_Occurred())
+           || (x == NULL && PyErr_Occurred()));
 
     /* Clear the stack of the function object.  Also removes
        the arguments in case they weren't consumed already
@@ -4100,6 +4277,9 @@
         Py_DECREF(w);
         PCALL(PCALL_POP);
     }
+
+    assert((x != NULL && !PyErr_Occurred())
+           || (x == NULL && PyErr_Occurred()));
     return x;
 }
 
@@ -4383,6 +4563,8 @@
     Py_XDECREF(callargs);
     Py_XDECREF(kwdict);
     Py_XDECREF(stararg);
+    assert((result != NULL && !PyErr_Occurred())
+           || (result == NULL && PyErr_Occurred()));
     return result;
 }
 
@@ -4421,7 +4603,7 @@
                          "BaseException is not allowed"
 
 static PyObject *
-cmp_outcome(int op, register PyObject *v, register PyObject *w)
+cmp_outcome(int op, PyObject *v, PyObject *w)
 {
     int res = 0;
     switch (op) {
@@ -4479,7 +4661,7 @@
 
     x = PyObject_GetAttr(v, name);
     if (x == NULL && PyErr_ExceptionMatches(PyExc_AttributeError)) {
-        PyErr_Format(PyExc_ImportError, "cannot import name %S", name);
+        PyErr_Format(PyExc_ImportError, "cannot import name %R", name);
     }
     return x;
 }
diff --git a/Python/codecs.c b/Python/codecs.c
index ea33c49..6849c0f 100644
--- a/Python/codecs.c
+++ b/Python/codecs.c
@@ -53,7 +53,7 @@
 static
 PyObject *normalizestring(const char *string)
 {
-    register size_t i;
+    size_t i;
     size_t len = strlen(string);
     char *p;
     PyObject *v;
@@ -65,9 +65,9 @@
 
     p = PyMem_Malloc(len + 1);
     if (p == NULL)
-        return NULL;
+        return PyErr_NoMemory();
     for (i = 0; i < len; i++) {
-        register char ch = string[i];
+        char ch = string[i];
         if (ch == ' ')
             ch = '-';
         else
@@ -185,6 +185,32 @@
     return NULL;
 }
 
+int _PyCodec_Forget(const char *encoding)
+{
+    PyInterpreterState *interp;
+    PyObject *v;
+    int result;
+
+    interp = PyThreadState_GET()->interp;
+    if (interp->codec_search_path == NULL) {
+        return -1;
+    }
+
+    /* Convert the encoding to a normalized Python string: all
+       characters are converted to lower case, spaces and hyphens are
+       replaced with underscores. */
+    v = normalizestring(encoding);
+    if (v == NULL) {
+        return -1;
+    }
+
+    /* Drop the named codec from the internal cache */
+    result = PyDict_DelItem(interp->codec_search_cache, v);
+    Py_DECREF(v);
+
+    return result;
+}
+
 /* Codec registry encoding check API. */
 
 int PyCodec_KnownEncoding(const char *encoding)
@@ -360,6 +386,22 @@
     return codec_getstreamcodec(encoding, stream, errors, 3);
 }
 
+/* Helper that tries to ensure the reported exception chain indicates the
+ * codec that was invoked to trigger the failure without changing the type
+ * of the exception raised.
+ */
+static void
+wrap_codec_error(const char *operation,
+                 const char *encoding)
+{
+    /* TrySetFromCause will replace the active exception with a suitably
+     * updated clone if it can, otherwise it will leave the original
+     * exception alone.
+     */
+    _PyErr_TrySetFromCause("%s with '%s' codec failed",
+                           operation, encoding);
+}
+
 /* Encode an object (e.g. an Unicode object) using the given encoding
    and return the resulting encoded object (usually a Python string).
 
@@ -379,8 +421,10 @@
         goto onError;
 
     result = PyEval_CallObject(encoder, args);
-    if (result == NULL)
+    if (result == NULL) {
+        wrap_codec_error("encoding", encoding);
         goto onError;
+    }
 
     if (!PyTuple_Check(result) ||
         PyTuple_GET_SIZE(result) != 2) {
@@ -423,8 +467,10 @@
         goto onError;
 
     result = PyEval_CallObject(decoder,args);
-    if (result == NULL)
+    if (result == NULL) {
+        wrap_codec_error("decoding", encoding);
         goto onError;
+    }
     if (!PyTuple_Check(result) ||
         PyTuple_GET_SIZE(result) != 2) {
         PyErr_SetString(PyExc_TypeError,
@@ -589,7 +635,7 @@
         return -1;
     }
     return PyDict_SetItemString(interp->codec_error_registry,
-                                (char *)name, error);
+                                name, error);
 }
 
 /* Lookup the error handling callback function registered under the
@@ -605,7 +651,7 @@
 
     if (name==NULL)
         name = "strict";
-    handler = PyDict_GetItemString(interp->codec_error_registry, (char *)name);
+    handler = PyDict_GetItemString(interp->codec_error_registry, name);
     if (!handler)
         PyErr_Format(PyExc_LookupError, "unknown error handler name '%.400s'", name);
     else
@@ -848,8 +894,10 @@
                 ressize += 1+1+2;
         }
         res = PyUnicode_New(ressize, 127);
-        if (res==NULL)
+        if (res == NULL) {
+            Py_DECREF(object);
             return NULL;
+        }
         for (i = start, outp = PyUnicode_1BYTE_DATA(res);
             i < end; ++i) {
             c = PyUnicode_READ_CHAR(object, i);
@@ -885,6 +933,65 @@
     }
 }
 
+#define ENC_UTF8        0
+#define ENC_UTF16BE     1
+#define ENC_UTF16LE     2
+#define ENC_UTF32BE     3
+#define ENC_UTF32LE     4
+
+static int
+get_standard_encoding(const char *encoding, int *bytelength)
+{
+    if (Py_TOLOWER(encoding[0]) == 'u' &&
+        Py_TOLOWER(encoding[1]) == 't' &&
+        Py_TOLOWER(encoding[2]) == 'f') {
+        encoding += 3;
+        if (*encoding == '-' || *encoding == '_' )
+            encoding++;
+        if (encoding[0] == '1' && encoding[1] == '6') {
+            encoding += 2;
+            *bytelength = 2;
+            if (*encoding == '\0') {
+#ifdef WORDS_BIGENDIAN
+                return ENC_UTF16BE;
+#else
+                return ENC_UTF16LE;
+#endif
+            }
+            if (*encoding == '-' || *encoding == '_' )
+                encoding++;
+            if (Py_TOLOWER(encoding[1]) == 'e' && encoding[2] == '\0') {
+                if (Py_TOLOWER(encoding[0]) == 'b')
+                    return ENC_UTF16BE;
+                if (Py_TOLOWER(encoding[0]) == 'l')
+                    return ENC_UTF16LE;
+            }
+        }
+        else if (encoding[0] == '3' && encoding[1] == '2') {
+            encoding += 2;
+            *bytelength = 4;
+            if (*encoding == '\0') {
+#ifdef WORDS_BIGENDIAN
+                return ENC_UTF32BE;
+#else
+                return ENC_UTF32LE;
+#endif
+            }
+            if (*encoding == '-' || *encoding == '_' )
+                encoding++;
+            if (Py_TOLOWER(encoding[1]) == 'e' && encoding[2] == '\0') {
+                if (Py_TOLOWER(encoding[0]) == 'b')
+                    return ENC_UTF32BE;
+                if (Py_TOLOWER(encoding[0]) == 'l')
+                    return ENC_UTF32LE;
+            }
+        }
+    }
+    /* utf-8 */
+    *bytelength = 3;
+    return ENC_UTF8;
+}
+
 /* This handler is declared static until someone demonstrates
    a need to call it directly. */
 static PyObject *
@@ -892,37 +999,79 @@
 {
     PyObject *restuple;
     PyObject *object;
+    PyObject *encode;
+    char *encoding;
+    int code;
+    int bytelength;
     Py_ssize_t i;
     Py_ssize_t start;
     Py_ssize_t end;
     PyObject *res;
     if (PyObject_IsInstance(exc, PyExc_UnicodeEncodeError)) {
-        char *outp;
+        unsigned char *outp;
         if (PyUnicodeEncodeError_GetStart(exc, &start))
             return NULL;
         if (PyUnicodeEncodeError_GetEnd(exc, &end))
             return NULL;
         if (!(object = PyUnicodeEncodeError_GetObject(exc)))
             return NULL;
-        res = PyBytes_FromStringAndSize(NULL, 3*(end-start));
+        if (!(encode = PyUnicodeEncodeError_GetEncoding(exc))) {
+            Py_DECREF(object);
+            return NULL;
+        }
+        if (!(encoding = PyUnicode_AsUTF8(encode))) {
+            Py_DECREF(object);
+            Py_DECREF(encode);
+            return NULL;
+        }
+        code = get_standard_encoding(encoding, &bytelength);
+        Py_DECREF(encode);
+
+        if (end - start > PY_SSIZE_T_MAX / bytelength)
+            end = start + PY_SSIZE_T_MAX / bytelength;
+        res = PyBytes_FromStringAndSize(NULL, bytelength*(end-start));
         if (!res) {
             Py_DECREF(object);
             return NULL;
         }
-        outp = PyBytes_AsString(res);
+        outp = (unsigned char*)PyBytes_AsString(res);
         for (i = start; i < end; i++) {
             /* object is guaranteed to be "ready" */
             Py_UCS4 ch = PyUnicode_READ_CHAR(object, i);
-            if (ch < 0xd800 || ch > 0xdfff) {
+            if (!Py_UNICODE_IS_SURROGATE(ch)) {
                 /* Not a surrogate, fail with original exception */
                 PyErr_SetObject(PyExceptionInstance_Class(exc), exc);
                 Py_DECREF(res);
                 Py_DECREF(object);
                 return NULL;
             }
-            *outp++ = (char)(0xe0 | (ch >> 12));
-            *outp++ = (char)(0x80 | ((ch >> 6) & 0x3f));
-            *outp++ = (char)(0x80 | (ch & 0x3f));
+            switch (code) {
+            case ENC_UTF8:
+                *outp++ = (unsigned char)(0xe0 | (ch >> 12));
+                *outp++ = (unsigned char)(0x80 | ((ch >> 6) & 0x3f));
+                *outp++ = (unsigned char)(0x80 | (ch & 0x3f));
+                break;
+            case ENC_UTF16LE:
+                *outp++ = (unsigned char) ch;
+                *outp++ = (unsigned char)(ch >> 8);
+                break;
+            case ENC_UTF16BE:
+                *outp++ = (unsigned char)(ch >> 8);
+                *outp++ = (unsigned char) ch;
+                break;
+            case ENC_UTF32LE:
+                *outp++ = (unsigned char) ch;
+                *outp++ = (unsigned char)(ch >> 8);
+                *outp++ = (unsigned char)(ch >> 16);
+                *outp++ = (unsigned char)(ch >> 24);
+                break;
+            case ENC_UTF32BE:
+                *outp++ = (unsigned char)(ch >> 24);
+                *outp++ = (unsigned char)(ch >> 16);
+                *outp++ = (unsigned char)(ch >> 8);
+                *outp++ = (unsigned char) ch;
+                break;
+            }
         }
         restuple = Py_BuildValue("(On)", res, end);
         Py_DECREF(res);
@@ -934,34 +1083,64 @@
         Py_UCS4 ch = 0;
         if (PyUnicodeDecodeError_GetStart(exc, &start))
             return NULL;
+        if (PyUnicodeDecodeError_GetEnd(exc, &end))
+            return NULL;
         if (!(object = PyUnicodeDecodeError_GetObject(exc)))
             return NULL;
         if (!(p = (unsigned char*)PyBytes_AsString(object))) {
             Py_DECREF(object);
             return NULL;
         }
+        if (!(encode = PyUnicodeDecodeError_GetEncoding(exc))) {
+            Py_DECREF(object);
+            return NULL;
+        }
+        if (!(encoding = PyUnicode_AsUTF8(encode))) {
+            Py_DECREF(object);
+            Py_DECREF(encode);
+            return NULL;
+        }
+        code = get_standard_encoding(encoding, &bytelength);
+        Py_DECREF(encode);
+
         /* Try decoding a single surrogate character. If
            there are more, let the codec call us again. */
         p += start;
-        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);
-            if (ch < 0xd800 || ch > 0xdfff)
-                /* it's not a surrogate - fail */
-                ch = 0;
+        if (PyBytes_GET_SIZE(object) - start >= bytelength) {
+            switch (code) {
+            case ENC_UTF8:
+                if ((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);
+                }
+                break;
+            case ENC_UTF16LE:
+                ch = p[1] << 8 | p[0];
+                break;
+            case ENC_UTF16BE:
+                ch = p[0] << 8 | p[1];
+                break;
+            case ENC_UTF32LE:
+                ch = (p[3] << 24) | (p[2] << 16) | (p[1] << 8) | p[0];
+                break;
+            case ENC_UTF32BE:
+                ch = (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
+                break;
+            }
         }
+
         Py_DECREF(object);
-        if (ch == 0) {
+        if (!Py_UNICODE_IS_SURROGATE(ch)) {
+            /* it's not a surrogate - fail */
             PyErr_SetObject(PyExceptionInstance_Class(exc), exc);
             return NULL;
         }
         res = PyUnicode_FromOrdinal(ch);
         if (res == NULL)
             return NULL;
-        return Py_BuildValue("(Nn)", res, start+3);
+        return Py_BuildValue("(Nn)", res, start + bytelength);
     }
     else {
         wrong_exception_type(exc);
@@ -1178,7 +1357,7 @@
 
     if (interp->codec_error_registry) {
         for (i = 0; i < Py_ARRAY_LENGTH(methods); ++i) {
-            PyObject *func = PyCFunction_New(&methods[i].def, NULL);
+            PyObject *func = PyCFunction_NewEx(&methods[i].def, NULL, NULL);
             int res;
             if (!func)
                 Py_FatalError("can't initialize codec error registry");
diff --git a/Python/compile.c b/Python/compile.c
index 6d66255..b07c156 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -94,6 +94,7 @@
     COMPILER_SCOPE_MODULE,
     COMPILER_SCOPE_CLASS,
     COMPILER_SCOPE_FUNCTION,
+    COMPILER_SCOPE_LAMBDA,
     COMPILER_SCOPE_COMPREHENSION,
 };
 
@@ -119,8 +120,8 @@
 
     PyObject *u_private;        /* for private name mangling */
 
-    int u_argcount;        /* number of arguments for block */
-    int u_kwonlyargcount; /* number of keyword only arguments for block */
+    Py_ssize_t u_argcount;        /* number of arguments for block */
+    Py_ssize_t u_kwonlyargcount; /* number of keyword only arguments for block */
     /* Pointer to the most recently allocated block.  By following b_list
        members, you can reach all early allocated blocks. */
     basicblock *u_blocks;
@@ -149,8 +150,7 @@
 */
 
 struct compiler {
-    const char *c_filename;
-    PyObject *c_filename_obj;
+    PyObject *c_filename;
     struct symtable *c_st;
     PyFutureFeatures *c_future; /* pointer to module's __future__ */
     PyCompilerFlags *c_flags;
@@ -170,7 +170,7 @@
 static int compiler_next_instr(struct compiler *, basicblock *);
 static int compiler_addop(struct compiler *, int);
 static int compiler_addop_o(struct compiler *, int, PyObject *, PyObject *);
-static int compiler_addop_i(struct compiler *, int, int);
+static int compiler_addop_i(struct compiler *, int, Py_ssize_t);
 static int compiler_addop_j(struct compiler *, int, basicblock *, int);
 static basicblock *compiler_use_new_block(struct compiler *);
 static int compiler_error(struct compiler *, const char *);
@@ -195,12 +195,13 @@
 static int expr_constant(struct compiler *, expr_ty);
 
 static int compiler_with(struct compiler *, stmt_ty, int);
-static int compiler_call_helper(struct compiler *c, int n,
+static int compiler_call_helper(struct compiler *c, Py_ssize_t n,
                                 asdl_seq *args,
                                 asdl_seq *keywords,
                                 expr_ty starargs,
                                 expr_ty kwargs);
 static int compiler_try_except(struct compiler *, stmt_ty);
+static int compiler_set_qualname(struct compiler *);
 
 static PyCodeObject *assemble(struct compiler *, int addNone);
 static PyObject *__doc__;
@@ -288,8 +289,8 @@
 }
 
 PyCodeObject *
-PyAST_CompileEx(mod_ty mod, const char *filename, PyCompilerFlags *flags,
-                int optimize, PyArena *arena)
+PyAST_CompileObject(mod_ty mod, PyObject *filename, PyCompilerFlags *flags,
+                   int optimize, PyArena *arena)
 {
     struct compiler c;
     PyCodeObject *co = NULL;
@@ -304,12 +305,10 @@
 
     if (!compiler_init(&c))
         return NULL;
+    Py_INCREF(filename);
     c.c_filename = filename;
-    c.c_filename_obj = PyUnicode_DecodeFSDefault(filename);
-    if (!c.c_filename_obj)
-        goto finally;
     c.c_arena = arena;
-    c.c_future = PyFuture_FromAST(mod, filename);
+    c.c_future = PyFuture_FromASTObject(mod, filename);
     if (c.c_future == NULL)
         goto finally;
     if (!flags) {
@@ -323,7 +322,7 @@
     c.c_optimize = (optimize == -1) ? Py_OptimizeFlag : optimize;
     c.c_nestlevel = 0;
 
-    c.c_st = PySymtable_Build(mod, filename, c.c_future);
+    c.c_st = PySymtable_BuildObject(mod, filename, c.c_future);
     if (c.c_st == NULL) {
         if (!PyErr_Occurred())
             PyErr_SetString(PyExc_SystemError, "no symtable");
@@ -339,6 +338,21 @@
 }
 
 PyCodeObject *
+PyAST_CompileEx(mod_ty mod, const char *filename_str, PyCompilerFlags *flags,
+                int optimize, PyArena *arena)
+{
+    PyObject *filename;
+    PyCodeObject *co;
+    filename = PyUnicode_DecodeFSDefault(filename_str);
+    if (filename == NULL)
+        return NULL;
+    co = PyAST_CompileObject(mod, filename, flags, optimize, arena);
+    Py_DECREF(filename);
+    return co;
+
+}
+
+PyCodeObject *
 PyNode_Compile(struct _node *n, const char *filename)
 {
     PyCodeObject *co = NULL;
@@ -360,8 +374,7 @@
         PySymtable_Free(c->c_st);
     if (c->c_future)
         PyObject_Free(c->c_future);
-    if (c->c_filename_obj)
-        Py_DECREF(c->c_filename_obj);
+    Py_XDECREF(c->c_filename);
     Py_DECREF(c->c_stack);
 }
 
@@ -375,7 +388,7 @@
 
     n = PyList_Size(list);
     for (i = 0; i < n; i++) {
-        v = PyLong_FromLong(i);
+        v = PyLong_FromSsize_t(i);
         if (!v) {
             Py_DECREF(dict);
             return NULL;
@@ -403,7 +416,7 @@
 */
 
 static PyObject *
-dictbytype(PyObject *src, int scope_type, int flag, int offset)
+dictbytype(PyObject *src, int scope_type, int flag, Py_ssize_t offset)
 {
     Py_ssize_t i = offset, scope, num_keys, key_i;
     PyObject *k, *v, *dest = PyDict_New();
@@ -437,7 +450,7 @@
         scope = (vi >> SCOPE_OFFSET) & SCOPE_MASK;
 
         if (scope == scope_type || vi & flag) {
-            PyObject *tuple, *item = PyLong_FromLong(i);
+            PyObject *tuple, *item = PyLong_FromSsize_t(i);
             if (item == NULL) {
                 Py_DECREF(sorted_keys);
                 Py_DECREF(dest);
@@ -535,6 +548,37 @@
         compiler_unit_free(u);
         return 0;
     }
+    if (u->u_ste->ste_needs_class_closure) {
+        /* Cook up a implicit __class__ cell. */
+        _Py_IDENTIFIER(__class__);
+        PyObject *tuple, *name, *zero;
+        int res;
+        assert(u->u_scope_type == COMPILER_SCOPE_CLASS);
+        assert(PyDict_Size(u->u_cellvars) == 0);
+        name = _PyUnicode_FromId(&PyId___class__);
+        if (!name) {
+            compiler_unit_free(u);
+            return 0;
+        }
+        tuple = PyTuple_Pack(2, name, Py_TYPE(name));
+        if (!tuple) {
+            compiler_unit_free(u);
+            return 0;
+        }
+        zero = PyLong_FromLong(0);
+        if (!zero) {
+            Py_DECREF(tuple);
+            compiler_unit_free(u);
+            return 0;
+        }
+        res = PyDict_SetItem(u->u_cellvars, tuple, zero);
+        Py_DECREF(tuple);
+        Py_DECREF(zero);
+        if (res < 0) {
+            compiler_unit_free(u);
+            return 0;
+        }
+    }
 
     u->u_freevars = dictbytype(u->u_ste->ste_symbols, FREE, DEF_FREE_CLASS,
                                PyDict_Size(u->u_cellvars));
@@ -580,13 +624,18 @@
     if (compiler_use_new_block(c) == NULL)
         return 0;
 
+    if (u->u_scope_type != COMPILER_SCOPE_MODULE) {
+        if (!compiler_set_qualname(c))
+            return 0;
+    }
+
     return 1;
 }
 
 static void
 compiler_exit_scope(struct compiler *c)
 {
-    int n;
+    Py_ssize_t n;
     PyObject *capsule;
 
     c->c_nestlevel--;
@@ -607,57 +656,77 @@
 
 }
 
-static PyObject *
-compiler_scope_qualname(struct compiler *c)
+static int
+compiler_set_qualname(struct compiler *c)
 {
-    Py_ssize_t stack_size, i;
     _Py_static_string(dot, ".");
-    _Py_static_string(locals, "<locals>");
-    struct compiler_unit *u;
-    PyObject *capsule, *name, *seq, *dot_str, *locals_str;
+    _Py_static_string(dot_locals, ".<locals>");
+    Py_ssize_t stack_size;
+    struct compiler_unit *u = c->u;
+    PyObject *name, *base, *dot_str, *dot_locals_str;
 
-    u = c->u;
-    if (u->u_qualname != NULL) {
-        Py_INCREF(u->u_qualname);
-        return u->u_qualname;
-    }
-
-    seq = PyList_New(0);
-    if (seq == NULL)
-        return NULL;
-
+    base = NULL;
     stack_size = PyList_GET_SIZE(c->c_stack);
-    for (i = 0; i < stack_size; i++) {
-        capsule = PyList_GET_ITEM(c->c_stack, i);
-        u = (struct compiler_unit *)PyCapsule_GetPointer(capsule, COMPILER_CAPSULE_NAME_COMPILER_UNIT);
-        assert(u);
-        if (u->u_scope_type == COMPILER_SCOPE_MODULE)
-            continue;
-        if (PyList_Append(seq, u->u_name))
-            goto _error;
-        if (u->u_scope_type == COMPILER_SCOPE_FUNCTION) {
-            locals_str = _PyUnicode_FromId(&locals);
-            if (locals_str == NULL)
-                goto _error;
-            if (PyList_Append(seq, locals_str))
-                goto _error;
+    assert(stack_size >= 1);
+    if (stack_size > 1) {
+        int scope, force_global = 0;
+        struct compiler_unit *parent;
+        PyObject *mangled, *capsule;
+
+        capsule = PyList_GET_ITEM(c->c_stack, stack_size - 1);
+        parent = (struct compiler_unit *)PyCapsule_GetPointer(capsule, COMPILER_CAPSULE_NAME_COMPILER_UNIT);
+        assert(parent);
+
+        if (u->u_scope_type == COMPILER_SCOPE_FUNCTION || u->u_scope_type == COMPILER_SCOPE_CLASS) {
+            assert(u->u_name);
+            mangled = _Py_Mangle(parent->u_private, u->u_name);
+            if (!mangled)
+                return 0;
+            scope = PyST_GetScope(parent->u_ste, mangled);
+            Py_DECREF(mangled);
+            assert(scope != GLOBAL_IMPLICIT);
+            if (scope == GLOBAL_EXPLICIT)
+                force_global = 1;
+        }
+
+        if (!force_global) {
+            if (parent->u_scope_type == COMPILER_SCOPE_FUNCTION
+                || parent->u_scope_type == COMPILER_SCOPE_LAMBDA) {
+                dot_locals_str = _PyUnicode_FromId(&dot_locals);
+                if (dot_locals_str == NULL)
+                    return 0;
+                base = PyUnicode_Concat(parent->u_qualname, dot_locals_str);
+                if (base == NULL)
+                    return 0;
+            }
+            else {
+                Py_INCREF(parent->u_qualname);
+                base = parent->u_qualname;
+            }
         }
     }
-    u = c->u;
-    if (PyList_Append(seq, u->u_name))
-        goto _error;
-    dot_str = _PyUnicode_FromId(&dot);
-    if (dot_str == NULL)
-        goto _error;
-    name = PyUnicode_Join(dot_str, seq);
-    Py_DECREF(seq);
-    u->u_qualname = name;
-    Py_XINCREF(name);
-    return name;
 
-_error:
-    Py_XDECREF(seq);
-    return NULL;
+    if (base != NULL) {
+        dot_str = _PyUnicode_FromId(&dot);
+        if (dot_str == NULL) {
+            Py_DECREF(base);
+            return 0;
+        }
+        name = PyUnicode_Concat(base, dot_str);
+        Py_DECREF(base);
+        if (name == NULL)
+            return 0;
+        PyUnicode_Append(&name, u->u_name);
+        if (name == NULL)
+            return 0;
+    }
+    else {
+        Py_INCREF(u->u_name);
+        name = u->u_name;
+    }
+    u->u_qualname = name;
+
+    return 1;
 }
 
 /* Allocate a new block and return a pointer to it.
@@ -784,8 +853,8 @@
     b->b_instr[off].i_lineno = c->u->u_lineno;
 }
 
-static int
-opcode_stack_effect(int opcode, int oparg)
+int
+PyCompile_OpcodeStackEffect(int opcode, int oparg)
 {
     switch (opcode) {
         case POP_TOP:
@@ -862,8 +931,6 @@
             return 7;
         case WITH_CLEANUP:
             return -1; /* XXX Sometimes more */
-        case STORE_LOCALS:
-            return -1;
         case RETURN_VALUE:
             return -1;
         case IMPORT_STAR:
@@ -970,17 +1037,16 @@
         case LOAD_CLOSURE:
             return 1;
         case LOAD_DEREF:
+        case LOAD_CLASSDEREF:
             return 1;
         case STORE_DEREF:
             return -1;
         case DELETE_DEREF:
             return 0;
         default:
-            fprintf(stderr, "opcode = %d\n", opcode);
-            Py_FatalError("opcode_stack_effect()");
-
+            return PY_INVALID_STACK_EFFECT;
     }
-    return 0; /* not reachable */
+    return PY_INVALID_STACK_EFFECT; /* not reachable */
 }
 
 /* Add an opcode with no argument.
@@ -1006,7 +1072,7 @@
     return 1;
 }
 
-static int
+static Py_ssize_t
 compiler_add_o(struct compiler *c, PyObject *dict, PyObject *o)
 {
     PyObject *t, *v;
@@ -1060,7 +1126,7 @@
         if (PyErr_Occurred())
             return -1;
         arg = PyDict_Size(dict);
-        v = PyLong_FromLong(arg);
+        v = PyLong_FromSsize_t(arg);
         if (!v) {
             Py_DECREF(t);
             return -1;
@@ -1082,7 +1148,7 @@
 compiler_addop_o(struct compiler *c, int opcode, PyObject *dict,
                      PyObject *o)
 {
-    int arg = compiler_add_o(c, dict, o);
+    Py_ssize_t arg = compiler_add_o(c, dict, o);
     if (arg < 0)
         return 0;
     return compiler_addop_i(c, opcode, arg);
@@ -1092,7 +1158,7 @@
 compiler_addop_name(struct compiler *c, int opcode, PyObject *dict,
                     PyObject *o)
 {
-    int arg;
+    Py_ssize_t arg;
     PyObject *mangled = _Py_Mangle(c->u->u_private, o);
     if (!mangled)
         return 0;
@@ -1108,16 +1174,22 @@
 */
 
 static int
-compiler_addop_i(struct compiler *c, int opcode, int oparg)
+compiler_addop_i(struct compiler *c, int opcode, Py_ssize_t oparg)
 {
     struct instr *i;
     int off;
+
+    /* Integer arguments are limit to 16-bit. There is an extension for 32-bit
+       integer arguments. */
+    assert((-2147483647-1) <= oparg);
+    assert(oparg <= 2147483647);
+
     off = compiler_next_instr(c, c->u->u_curblock);
     if (off < 0)
         return 0;
     i = &c->u->u_curblock->b_instr[off];
     i->i_opcode = opcode;
-    i->i_oparg = oparg;
+    i->i_oparg = Py_SAFE_DOWNCAST(oparg, Py_ssize_t, int);
     i->i_hasarg = 1;
     compiler_set_lineno(c, off);
     return 1;
@@ -1330,19 +1402,22 @@
 static int
 get_ref_type(struct compiler *c, PyObject *name)
 {
-    int scope = PyST_GetScope(c->u->u_ste, name);
+    int scope;
+    if (c->u->u_scope_type == COMPILER_SCOPE_CLASS &&
+        !PyUnicode_CompareWithASCIIString(name, "__class__"))
+        return CELL;
+    scope = PyST_GetScope(c->u->u_ste, name);
     if (scope == 0) {
         char buf[350];
         PyOS_snprintf(buf, sizeof(buf),
-                      "unknown scope for %.100s in %.100s(%s) in %s\n"
+                      "unknown scope for %.100s in %.100s(%s)\n"
                       "symbols: %s\nlocals: %s\nglobals: %s",
-                      PyBytes_AS_STRING(name),
-                      PyBytes_AS_STRING(c->u->u_name),
-                      PyObject_REPR(c->u->u_ste->ste_id),
-                      c->c_filename,
-                      PyObject_REPR(c->u->u_ste->ste_symbols),
-                      PyObject_REPR(c->u->u_varnames),
-                      PyObject_REPR(c->u->u_names)
+                      PyUnicode_AsUTF8(name),
+                      PyUnicode_AsUTF8(c->u->u_name),
+                      PyUnicode_AsUTF8(PyObject_Repr(c->u->u_ste->ste_id)),
+                      PyUnicode_AsUTF8(PyObject_Repr(c->u->u_ste->ste_symbols)),
+                      PyUnicode_AsUTF8(PyObject_Repr(c->u->u_varnames)),
+                      PyUnicode_AsUTF8(PyObject_Repr(c->u->u_names))
         );
         Py_FatalError(buf);
     }
@@ -1365,9 +1440,9 @@
 }
 
 static int
-compiler_make_closure(struct compiler *c, PyCodeObject *co, int args, PyObject *qualname)
+compiler_make_closure(struct compiler *c, PyCodeObject *co, Py_ssize_t args, PyObject *qualname)
 {
-    int i, free = PyCode_GetNumFree(co);
+    Py_ssize_t i, free = PyCode_GetNumFree(co);
     if (qualname == NULL)
         qualname = co->co_name;
 
@@ -1399,11 +1474,11 @@
             fprintf(stderr,
                 "lookup %s in %s %d %d\n"
                 "freevars of %s: %s\n",
-                PyObject_REPR(name),
-                PyBytes_AS_STRING(c->u->u_name),
+                PyUnicode_AsUTF8(PyObject_Repr(name)),
+                PyUnicode_AsUTF8(c->u->u_name),
                 reftype, arg,
-                _PyUnicode_AsString(co->co_name),
-                PyObject_REPR(co->co_freevars));
+                PyUnicode_AsUTF8(co->co_name),
+                PyUnicode_AsUTF8(PyObject_Repr(co->co_freevars)));
             Py_FatalError("compiler_make_closure()");
         }
         ADDOP_I(c, LOAD_CLOSURE, arg);
@@ -1457,9 +1532,16 @@
     expr_ty annotation, PyObject *names)
 {
     if (annotation) {
+        PyObject *mangled;
         VISIT(c, expr, annotation);
-        if (PyList_Append(names, id))
+        mangled = _Py_Mangle(c->u->u_private, id);
+        if (!mangled)
             return -1;
+        if (PyList_Append(names, mangled) < 0) {
+            Py_DECREF(mangled);
+            return -1;
+        }
+        Py_DECREF(mangled);
     }
     return 0;
 }
@@ -1494,22 +1576,22 @@
        */
     static identifier return_str;
     PyObject *names;
-    int len;
+    Py_ssize_t len;
     names = PyList_New(0);
     if (!names)
         return -1;
 
     if (compiler_visit_argannotations(c, args->args, names))
         goto error;
-    if (args->varargannotation &&
-        compiler_visit_argannotation(c, args->vararg,
-                                     args->varargannotation, names))
+    if (args->vararg && args->vararg->annotation &&
+        compiler_visit_argannotation(c, args->vararg->arg,
+                                     args->vararg->annotation, names))
         goto error;
     if (compiler_visit_argannotations(c, args->kwonlyargs, names))
         goto error;
-    if (args->kwargannotation &&
-        compiler_visit_argannotation(c, args->kwarg,
-                                     args->kwargannotation, names))
+    if (args->kwarg && args->kwarg->annotation &&
+        compiler_visit_argannotation(c, args->kwarg->arg,
+                                     args->kwarg->annotation, names))
         goto error;
 
     if (!return_str) {
@@ -1531,7 +1613,7 @@
     if (len) {
         /* convert names to a tuple and place on stack */
         PyObject *elt;
-        int i;
+        Py_ssize_t i;
         PyObject *s = PyTuple_New(len);
         if (!s)
             goto error;
@@ -1545,7 +1627,9 @@
         len++; /* include the just-pushed tuple */
     }
     Py_DECREF(names);
-    return len;
+
+    /* We just checked that len <= 65535, see above */
+    return Py_SAFE_DOWNCAST(len, Py_ssize_t, int);
 
 error:
     Py_DECREF(names);
@@ -1561,13 +1645,16 @@
     expr_ty returns = s->v.FunctionDef.returns;
     asdl_seq* decos = s->v.FunctionDef.decorator_list;
     stmt_ty st;
-    int i, n, docstring, kw_default_count = 0, arglength;
+    Py_ssize_t i, n, arglength;
+    int docstring, kw_default_count = 0;
     int num_annotations;
 
     assert(s->kind == FunctionDef_kind);
 
     if (!compiler_decorators(c, decos))
         return 0;
+    if (args->defaults)
+        VISIT_SEQ(c, expr, args->defaults);
     if (args->kwonlyargs) {
         int res = compiler_visit_kwonlydefaults(c, args->kwonlyargs,
                                                 args->kw_defaults);
@@ -1575,8 +1662,6 @@
             return 0;
         kw_default_count = res;
     }
-    if (args->defaults)
-        VISIT_SEQ(c, expr, args->defaults);
     num_annotations = compiler_visit_annotations(c, args, returns);
     if (num_annotations < 0)
         return 0;
@@ -1605,9 +1690,10 @@
         VISIT_IN_SCOPE(c, stmt, st);
     }
     co = assemble(c, 1);
-    qualname = compiler_scope_qualname(c);
+    qualname = c->u->u_qualname;
+    Py_INCREF(qualname);
     compiler_exit_scope(c);
-    if (qualname == NULL || co == NULL) {
+    if (co == NULL) {
         Py_XDECREF(qualname);
         Py_XDECREF(co);
         return 0;
@@ -1661,12 +1747,6 @@
         Py_INCREF(s->v.ClassDef.name);
         Py_XDECREF(c->u->u_private);
         c->u->u_private = s->v.ClassDef.name;
-        /* force it to have one mandatory argument */
-        c->u->u_argcount = 1;
-        /* load the first argument (__locals__) ... */
-        ADDOP_I(c, LOAD_FAST, 0);
-        /* ... and store it into f_locals */
-        ADDOP_IN_SCOPE(c, STORE_LOCALS);
         /* load (global) __name__ ... */
         str = PyUnicode_InternFromString("__name__");
         if (!str || !compiler_nameop(c, str, Load)) {
@@ -1683,14 +1763,8 @@
             return 0;
         }
         Py_DECREF(str);
-        /* store the __qualname__ */
-        str = compiler_scope_qualname(c);
-        if (!str) {
-            compiler_exit_scope(c);
-            return 0;
-        }
-        ADDOP_O(c, LOAD_CONST, str, consts);
-        Py_DECREF(str);
+        assert(c->u->u_qualname);
+        ADDOP_O(c, LOAD_CONST, c->u->u_qualname, consts);
         str = PyUnicode_InternFromString("__qualname__");
         if (!str || !compiler_nameop(c, str, Store)) {
             Py_XDECREF(str);
@@ -1703,24 +1777,28 @@
             compiler_exit_scope(c);
             return 0;
         }
-        /* return the (empty) __class__ cell */
-        str = PyUnicode_InternFromString("__class__");
-        if (str == NULL) {
-            compiler_exit_scope(c);
-            return 0;
-        }
-        i = compiler_lookup_arg(c->u->u_cellvars, str);
-        Py_DECREF(str);
-        if (i == -1) {
-            /* This happens when nobody references the cell */
-            PyErr_Clear();
-            /* Return None */
-            ADDOP_O(c, LOAD_CONST, Py_None, consts);
-        }
-        else {
+        if (c->u->u_ste->ste_needs_class_closure) {
+            /* return the (empty) __class__ cell */
+            str = PyUnicode_InternFromString("__class__");
+            if (str == NULL) {
+                compiler_exit_scope(c);
+                return 0;
+            }
+            i = compiler_lookup_arg(c->u->u_cellvars, str);
+            Py_DECREF(str);
+            if (i < 0) {
+                compiler_exit_scope(c);
+                return 0;
+            }
+            assert(i == 0);
             /* Return the cell where to store __class__ */
             ADDOP_I(c, LOAD_CLOSURE, i);
         }
+        else {
+            assert(PyDict_Size(c->u->u_cellvars) == 0);
+            /* This happens when nobody references the cell. Return None. */
+            ADDOP_O(c, LOAD_CONST, Py_None, consts);
+        }
         ADDOP_IN_SCOPE(c, RETURN_VALUE);
         /* create the code object */
         co = assemble(c, 1);
@@ -1787,7 +1865,8 @@
     PyCodeObject *co;
     PyObject *qualname;
     static identifier name;
-    int kw_default_count = 0, arglength;
+    int kw_default_count = 0;
+    Py_ssize_t arglength;
     arguments_ty args = e->v.Lambda.args;
     assert(e->kind == Lambda_kind);
 
@@ -1797,15 +1876,15 @@
             return 0;
     }
 
+    if (args->defaults)
+        VISIT_SEQ(c, expr, args->defaults);
     if (args->kwonlyargs) {
         int res = compiler_visit_kwonlydefaults(c, args->kwonlyargs,
                                                 args->kw_defaults);
         if (res < 0) return 0;
         kw_default_count = res;
     }
-    if (args->defaults)
-        VISIT_SEQ(c, expr, args->defaults);
-    if (!compiler_enter_scope(c, name, COMPILER_SCOPE_FUNCTION,
+    if (!compiler_enter_scope(c, name, COMPILER_SCOPE_LAMBDA,
                               (void *)e, e->lineno))
         return 0;
 
@@ -1824,9 +1903,10 @@
         ADDOP_IN_SCOPE(c, RETURN_VALUE);
     }
     co = assemble(c, 1);
-    qualname = compiler_scope_qualname(c);
+    qualname = c->u->u_qualname;
+    Py_INCREF(qualname);
     compiler_exit_scope(c);
-    if (qualname == NULL || co == NULL)
+    if (co == NULL)
         return 0;
 
     arglength = asdl_seq_LEN(args->defaults);
@@ -1949,10 +2029,9 @@
        if there is no else clause ?
     */
 
-    if (constant == -1) {
+    if (constant == -1)
         compiler_use_next_block(c, anchor);
-        ADDOP(c, POP_BLOCK);
-    }
+    ADDOP(c, POP_BLOCK);
     compiler_pop_fblock(c, LOOP, loop);
     if (orelse != NULL) /* what if orelse is just pass? */
         VISIT_SEQ(c, stmt, s->v.While.orelse);
@@ -2097,7 +2176,7 @@
 compiler_try_except(struct compiler *c, stmt_ty s)
 {
     basicblock *body, *orelse, *except, *end;
-    int i, n;
+    Py_ssize_t i, n;
 
     body = compiler_new_block(c);
     except = compiler_new_block(c);
@@ -2263,7 +2342,7 @@
        module names.
        XXX Perhaps change the representation to make this case simpler?
      */
-    int i, n = asdl_seq_LEN(s->v.Import.names);
+    Py_ssize_t i, n = asdl_seq_LEN(s->v.Import.names);
 
     for (i = 0; i < n; i++) {
         alias_ty alias = (alias_ty)asdl_seq_GET(s->v.Import.names, i);
@@ -2288,8 +2367,11 @@
             identifier tmp = alias->name;
             Py_ssize_t dot = PyUnicode_FindChar(
                 alias->name, '.', 0, PyUnicode_GET_LENGTH(alias->name), 1);
-            if (dot != -1)
+            if (dot != -1) {
                 tmp = PyUnicode_Substring(alias->name, 0, dot);
+                if (tmp == NULL)
+                    return 0;
+            }
             r = compiler_nameop(c, tmp, Store);
             if (dot != -1) {
                 Py_DECREF(tmp);
@@ -2304,7 +2386,7 @@
 static int
 compiler_from_import(struct compiler *c, stmt_ty s)
 {
-    int i, n = asdl_seq_LEN(s->v.ImportFrom.names);
+    Py_ssize_t i, n = asdl_seq_LEN(s->v.ImportFrom.names);
 
     PyObject *names = PyTuple_New(n);
     PyObject *level;
@@ -2380,6 +2462,7 @@
 {
     static PyObject *assertion_error = NULL;
     basicblock *end;
+    PyObject* msg;
 
     if (c->c_optimize)
         return 1;
@@ -2390,11 +2473,17 @@
     }
     if (s->v.Assert.test->kind == Tuple_kind &&
         asdl_seq_LEN(s->v.Assert.test->v.Tuple.elts) > 0) {
-        const char* msg =
-            "assertion is always true, perhaps remove parentheses?";
-        if (PyErr_WarnExplicit(PyExc_SyntaxWarning, msg, c->c_filename,
-                               c->u->u_lineno, NULL, NULL) == -1)
+        msg = PyUnicode_FromString("assertion is always true, "
+                                   "perhaps remove parentheses?");
+        if (msg == NULL)
             return 0;
+        if (PyErr_WarnExplicitObject(PyExc_SyntaxWarning, msg,
+                                     c->c_filename, c->u->u_lineno,
+                                     NULL, NULL) == -1) {
+            Py_DECREF(msg);
+            return 0;
+        }
+        Py_DECREF(msg);
     }
     VISIT(c, expr, s->v.Assert.test);
     end = compiler_new_block(c);
@@ -2414,7 +2503,7 @@
 static int
 compiler_visit_stmt(struct compiler *c, stmt_ty s)
 {
-    int i, n;
+    Py_ssize_t i, n;
 
     /* Always assign a lineno to the next instruction for a stmt. */
     c->u->u_lineno = s->lineno;
@@ -2462,12 +2551,12 @@
         if (s->v.Raise.exc) {
             VISIT(c, expr, s->v.Raise.exc);
             n++;
-        if (s->v.Raise.cause) {
-        VISIT(c, expr, s->v.Raise.cause);
-        n++;
+            if (s->v.Raise.cause) {
+                VISIT(c, expr, s->v.Raise.cause);
+                n++;
+            }
         }
-        }
-        ADDOP_I(c, RAISE_VARARGS, n);
+        ADDOP_I(c, RAISE_VARARGS, (int)n);
         break;
     case Try_kind:
         return compiler_try(c, s);
@@ -2627,7 +2716,8 @@
 static int
 compiler_nameop(struct compiler *c, identifier name, expr_context_ty ctx)
 {
-    int op, scope, arg;
+    int op, scope;
+    Py_ssize_t arg;
     enum { OP_FAST, OP_GLOBAL, OP_DEREF, OP_NAME } optype;
 
     PyObject *dict = c->u->u_names;
@@ -2638,6 +2728,10 @@
     if (!mangled)
         return 0;
 
+    assert(PyUnicode_CompareWithASCIIString(name, "None") &&
+           PyUnicode_CompareWithASCIIString(name, "True") &&
+           PyUnicode_CompareWithASCIIString(name, "False"));
+
     op = 0;
     optype = OP_NAME;
     scope = PyST_GetScope(c->u->u_ste, mangled);
@@ -2673,7 +2767,9 @@
     switch (optype) {
     case OP_DEREF:
         switch (ctx) {
-        case Load: op = LOAD_DEREF; break;
+        case Load:
+            op = (c->u->u_ste->ste_type == ClassBlock) ? LOAD_CLASSDEREF : LOAD_DEREF;
+            break;
         case Store: op = STORE_DEREF; break;
         case AugLoad:
         case AugStore:
@@ -2747,7 +2843,8 @@
 compiler_boolop(struct compiler *c, expr_ty e)
 {
     basicblock *end;
-    int jumpi, i, n;
+    int jumpi;
+    Py_ssize_t i, n;
     asdl_seq *s;
 
     assert(e->kind == BoolOp_kind);
@@ -2773,7 +2870,7 @@
 static int
 compiler_list(struct compiler *c, expr_ty e)
 {
-    int n = asdl_seq_LEN(e->v.List.elts);
+    Py_ssize_t n = asdl_seq_LEN(e->v.List.elts);
     if (e->v.List.ctx == Store) {
         int i, seen_star = 0;
         for (i = 0; i < n; i++) {
@@ -2806,7 +2903,7 @@
 static int
 compiler_tuple(struct compiler *c, expr_ty e)
 {
-    int n = asdl_seq_LEN(e->v.Tuple.elts);
+    Py_ssize_t n = asdl_seq_LEN(e->v.Tuple.elts);
     if (e->v.Tuple.ctx == Store) {
         int i, seen_star = 0;
         for (i = 0; i < n; i++) {
@@ -2839,7 +2936,7 @@
 static int
 compiler_compare(struct compiler *c, expr_ty e)
 {
-    int i, n;
+    Py_ssize_t i, n;
     basicblock *cleanup = NULL;
 
     /* XXX the logic can be cleaned up for 1 or multiple comparisons */
@@ -2895,11 +2992,11 @@
 /* shared code between compiler_call and compiler_class */
 static int
 compiler_call_helper(struct compiler *c,
-                     int n, /* Args already pushed */
-             asdl_seq *args,
-             asdl_seq *keywords,
-             expr_ty starargs,
-             expr_ty kwargs)
+                     Py_ssize_t n, /* Args already pushed */
+                     asdl_seq *args,
+                     asdl_seq *keywords,
+                     expr_ty starargs,
+                     expr_ty kwargs)
 {
     int code = 0;
 
@@ -2960,7 +3057,7 @@
 
     comprehension_ty gen;
     basicblock *start, *anchor, *skip, *if_cleanup;
-    int i, n;
+    Py_ssize_t i, n;
 
     start = compiler_new_block(c);
     skip = compiler_new_block(c);
@@ -3085,9 +3182,10 @@
     }
 
     co = assemble(c, 1);
-    qualname = compiler_scope_qualname(c);
+    qualname = c->u->u_qualname;
+    Py_INCREF(qualname);
     compiler_exit_scope(c);
-    if (qualname == NULL || co == NULL)
+    if (co == NULL)
         goto error;
 
     if (!compiler_make_closure(c, co, 0, qualname))
@@ -3197,12 +3295,18 @@
     case Name_kind:
         /* optimize away names that can't be reassigned */
         id = PyUnicode_AsUTF8(e->v.Name.id);
-        if (strcmp(id, "True") == 0) return 1;
-        if (strcmp(id, "False") == 0) return 0;
-        if (strcmp(id, "None") == 0) return 0;
-        if (strcmp(id, "__debug__") == 0)
-            return ! c->c_optimize;
-        /* fall through */
+        if (id && strcmp(id, "__debug__") == 0)
+            return !c->c_optimize;
+        return -1;
+    case NameConstant_kind: {
+        PyObject *o = e->v.NameConstant.value;
+        if (o == Py_None)
+            return 0;
+        else if (o == Py_True)
+            return 1;
+        else if (o == Py_False)
+            return 0;
+    }
     default:
         return -1;
     }
@@ -3292,7 +3396,7 @@
 static int
 compiler_visit_expr(struct compiler *c, expr_ty e)
 {
-    int i, n;
+    Py_ssize_t i, n;
 
     /* If expr e has a different line number than the last expr/stmt,
        set a new line number for the next instruction.
@@ -3321,6 +3425,8 @@
         return compiler_ifexp(c, e);
     case Dict_kind:
         n = asdl_seq_LEN(e->v.Dict.values);
+        /* BUILD_MAP parameter is only used to preallocate the dictionary,
+           it doesn't need to be exact */
         ADDOP_I(c, BUILD_MAP, (n>0xFFFF ? 0xFFFF : n));
         for (i = 0; i < n; i++) {
             VISIT(c, expr,
@@ -3378,6 +3484,9 @@
     case Ellipsis_kind:
         ADDOP_O(c, LOAD_CONST, Py_Ellipsis, consts);
         break;
+    case NameConstant_kind:
+        ADDOP_O(c, LOAD_CONST, e->v.NameConstant.value, consts);
+        break;
     /* The following exprs can be assignment targets. */
     case Attribute_kind:
         if (e->v.Attribute.ctx != AugStore)
@@ -3547,12 +3656,12 @@
     PyObject *loc;
     PyObject *u = NULL, *v = NULL;
 
-    loc = PyErr_ProgramText(c->c_filename, c->u->u_lineno);
+    loc = PyErr_ProgramTextObject(c->c_filename, c->u->u_lineno);
     if (!loc) {
         Py_INCREF(Py_None);
         loc = Py_None;
     }
-    u = Py_BuildValue("(OiiO)", c->c_filename_obj, c->u->u_lineno,
+    u = Py_BuildValue("(OiiO)", c->c_filename, c->u->u_lineno,
                       c->u->u_col_offset, loc);
     if (!u)
         goto exit;
@@ -3665,7 +3774,7 @@
     case ExtSlice_kind:
         kindname = "extended slice";
         if (ctx != AugStore) {
-            int i, n = asdl_seq_LEN(s->v.ExtSlice.dims);
+            Py_ssize_t i, n = asdl_seq_LEN(s->v.ExtSlice.dims);
             for (i = 0; i < n; i++) {
                 slice_ty sub = (slice_ty)asdl_seq_GET(
                     s->v.ExtSlice.dims, i);
@@ -3724,7 +3833,7 @@
 static int
 stackdepth_walk(struct compiler *c, basicblock *b, int depth, int maxdepth)
 {
-    int i, target_depth;
+    int i, target_depth, effect;
     struct instr *instr;
     if (b->b_seen || b->b_startdepth >= depth)
         return maxdepth;
@@ -3732,7 +3841,13 @@
     b->b_startdepth = depth;
     for (i = 0; i < b->b_iused; i++) {
         instr = &b->b_instr[i];
-        depth += opcode_stack_effect(instr->i_opcode, instr->i_oparg);
+        effect = PyCompile_OpcodeStackEffect(instr->i_opcode, instr->i_oparg);
+        if (effect == PY_INVALID_STACK_EFFECT) {
+            fprintf(stderr, "opcode = %d\n", instr->i_opcode);
+            Py_FatalError("PyCompile_OpcodeStackEffect()");
+        }
+        depth += effect;
+
         if (depth > maxdepth)
             maxdepth = depth;
         assert(depth >= 0); /* invalid code or bug in stackdepth() */
@@ -3740,12 +3855,16 @@
             target_depth = depth;
             if (instr->i_opcode == FOR_ITER) {
                 target_depth = depth-2;
-            } else if (instr->i_opcode == SETUP_FINALLY ||
-                       instr->i_opcode == SETUP_EXCEPT) {
+            }
+            else if (instr->i_opcode == SETUP_FINALLY ||
+                     instr->i_opcode == SETUP_EXCEPT) {
                 target_depth = depth+3;
                 if (target_depth > maxdepth)
                     maxdepth = target_depth;
             }
+            else if (instr->i_opcode == JUMP_IF_TRUE_OR_POP ||
+                     instr->i_opcode == JUMP_IF_FALSE_OR_POP)
+                depth = depth - 1;
             maxdepth = stackdepth_walk(c, instr->i_target,
                                        target_depth, maxdepth);
             if (instr->i_opcode == JUMP_ABSOLUTE ||
@@ -3790,7 +3909,7 @@
     a->a_lnotab = PyBytes_FromStringAndSize(NULL, DEFAULT_LNOTAB_SIZE);
     if (!a->a_lnotab)
         return 0;
-    if (nblocks > PY_SIZE_MAX / sizeof(basicblock *)) {
+    if ((size_t)nblocks > PY_SIZE_MAX / sizeof(basicblock *)) {
         PyErr_NoMemory();
         return 0;
     }
@@ -3843,7 +3962,7 @@
 assemble_lnotab(struct assembler *a, struct instr *i)
 {
     int d_bytecode, d_lineno;
-    int len;
+    Py_ssize_t len;
     unsigned char *lnotab;
 
     d_bytecode = a->a_offset - a->a_lineno_off;
@@ -4034,7 +4153,7 @@
 }
 
 static PyObject *
-dict_keys_inorder(PyObject *dict, int offset)
+dict_keys_inorder(PyObject *dict, Py_ssize_t offset)
 {
     PyObject *tuple, *k, *v;
     Py_ssize_t i, pos = 0, size = PyDict_Size(dict);
@@ -4059,10 +4178,10 @@
 compute_code_flags(struct compiler *c)
 {
     PySTEntryObject *ste = c->u->u_ste;
-    int flags = 0, n;
-    if (ste->ste_type != ModuleBlock)
-        flags |= CO_NEWLOCALS;
+    int flags = 0;
+    Py_ssize_t n;
     if (ste->ste_type == FunctionBlock) {
+        flags |= CO_NEWLOCALS;
         if (!ste->ste_unoptimized)
             flags |= CO_OPTIMIZED;
         if (ste->ste_nested)
@@ -4084,9 +4203,9 @@
     if (n == 0) {
         n = PyDict_Size(c->u->u_cellvars);
         if (n < 0)
-        return -1;
+            return -1;
         if (n == 0) {
-        flags |= CO_NOFREE;
+            flags |= CO_NOFREE;
         }
     }
 
@@ -4105,7 +4224,10 @@
     PyObject *freevars = NULL;
     PyObject *cellvars = NULL;
     PyObject *bytecode = NULL;
-    int nlocals, flags;
+    Py_ssize_t nlocals;
+    int nlocals_int;
+    int flags;
+    int argcount, kwonlyargcount;
 
     tmp = dict_keys_inorder(c->u->u_consts, 0);
     if (!tmp)
@@ -4124,7 +4246,11 @@
     freevars = dict_keys_inorder(c->u->u_freevars, PyTuple_Size(cellvars));
     if (!freevars)
         goto error;
+
     nlocals = PyDict_Size(c->u->u_varnames);
+    assert(nlocals < INT_MAX);
+    nlocals_int = Py_SAFE_DOWNCAST(nlocals, Py_ssize_t, int);
+
     flags = compute_code_flags(c);
     if (flags < 0)
         goto error;
@@ -4139,11 +4265,13 @@
     Py_DECREF(consts);
     consts = tmp;
 
-    co = PyCode_New(c->u->u_argcount, c->u->u_kwonlyargcount,
-                    nlocals, stackdepth(c), flags,
+    argcount = Py_SAFE_DOWNCAST(c->u->u_argcount, Py_ssize_t, int);
+    kwonlyargcount = Py_SAFE_DOWNCAST(c->u->u_kwonlyargcount, Py_ssize_t, int);
+    co = PyCode_New(argcount, kwonlyargcount,
+                    nlocals_int, stackdepth(c), flags,
                     bytecode, consts, names, varnames,
                     freevars, cellvars,
-                    c->c_filename_obj, c->u->u_name,
+                    c->c_filename, c->u->u_name,
                     c->u->u_firstlineno,
                     a->a_lnotab);
  error:
@@ -4259,4 +4387,3 @@
     return PyAST_CompileEx(mod, filename, flags, -1, arena);
 }
 
-
diff --git a/Python/condvar.h b/Python/condvar.h
index 19474ef..ef818c4 100644
--- a/Python/condvar.h
+++ b/Python/condvar.h
@@ -241,7 +241,7 @@
      * but we are safe because we are using a semaphore wich has an internal
      * count.
      */
-    wait = WaitForSingleObject(cv->sem, ms);
+    wait = WaitForSingleObjectEx(cv->sem, ms, FALSE);
     PyMUTEX_LOCK(cs);
     if (wait != WAIT_OBJECT_0)
         --cv->waiting;
diff --git a/Python/dynload_aix.c b/Python/dynload_aix.c
index f40a0be..5ac30ed 100644
--- a/Python/dynload_aix.c
+++ b/Python/dynload_aix.c
@@ -30,11 +30,11 @@
 static int
 aix_getoldmodules(void **modlistptr)
 {
-    register ModulePtr       modptr, prevmodptr;
-    register struct ld_info  *ldiptr;
-    register char            *ldibuf;
-    register int             errflag, bufsize = 1024;
-    register unsigned int    offset;
+    ModulePtr       modptr, prevmodptr;
+    struct ld_info  *ldiptr;
+    char            *ldibuf;
+    int             errflag, bufsize = 1024;
+    unsigned int    offset;
     char *progname = Py_GetProgramName();
 
     /*
@@ -106,7 +106,7 @@
     char *message[1024], errbuf[1024];
     PyObject *pathname_ob = NULL;
     PyObject *errbuf_ob = NULL;
-    register int i,j;
+    int i,j;
 
     struct errtab {
         int errNo;
diff --git a/Python/dynload_os2.c b/Python/dynload_os2.c
deleted file mode 100644
index 0e1b907..0000000
--- a/Python/dynload_os2.c
+++ /dev/null
@@ -1,42 +0,0 @@
-
-/* Support for dynamic loading of extension modules */
-
-#define  INCL_DOSERRORS
-#define  INCL_DOSMODULEMGR
-#include <os2.h>
-
-#include "Python.h"
-#include "importdl.h"
-
-
-const char *_PyImport_DynLoadFiletab[] = {".pyd", ".dll", NULL};
-
-dl_funcptr _PyImport_GetDynLoadFunc(const char *shortname,
-                                    const char *pathname, FILE *fp)
-{
-    dl_funcptr p;
-    APIRET  rc;
-    HMODULE hDLL;
-    char failreason[256];
-    char funcname[258];
-
-    rc = DosLoadModule(failreason,
-                       sizeof(failreason),
-                       pathname,
-                       &hDLL);
-
-    if (rc != NO_ERROR) {
-        char errBuf[256];
-        PyOS_snprintf(errBuf, sizeof(errBuf),
-                      "DLL load failed, rc = %d: %.200s",
-                      rc, failreason);
-        PyErr_SetString(PyExc_ImportError, errBuf);
-        return NULL;
-    }
-
-    PyOS_snprintf(funcname, sizeof(funcname), "PyInit_%.200s", shortname);
-    rc = DosQueryProcAddr(hDLL, 0L, funcname, &p);
-    if (rc != NO_ERROR)
-        p = NULL; /* Signify Failure to Acquire Entrypoint */
-    return p;
-}
diff --git a/Python/dynload_shlib.c b/Python/dynload_shlib.c
index 75544ed..5cd1efd 100644
--- a/Python/dynload_shlib.c
+++ b/Python/dynload_shlib.c
@@ -18,10 +18,6 @@
 
 #ifdef HAVE_DLFCN_H
 #include <dlfcn.h>
-#else
-#if defined(PYOS_OS2) && defined(PYCC_GCC)
-#include "dlfcn.h"
-#endif
 #endif
 
 #if (defined(__OpenBSD__) || defined(__NetBSD__)) && !defined(__ELF__)
@@ -40,30 +36,16 @@
 #ifdef __CYGWIN__
     ".dll",
 #else  /* !__CYGWIN__ */
-#if defined(PYOS_OS2) && defined(PYCC_GCC)
-    ".pyd",
-    ".dll",
-#else  /* !(defined(PYOS_OS2) && defined(PYCC_GCC)) */
-#ifdef __VMS
-    ".exe",
-    ".EXE",
-#else  /* !__VMS */
     "." SOABI ".so",
     ".abi" PYTHON_ABI_STRING ".so",
     ".so",
-#endif  /* __VMS */
-#endif  /* defined(PYOS_OS2) && defined(PYCC_GCC) */
 #endif  /* __CYGWIN__ */
     NULL,
 };
 
 static struct {
     dev_t dev;
-#ifdef __VMS
-    ino_t ino[3];
-#else
     ino_t ino;
-#endif
     void *handle;
 } handles[128];
 static int nhandles = 0;
@@ -104,47 +86,39 @@
         }
         if (nhandles < 128) {
             handles[nhandles].dev = statb.st_dev;
-#ifdef __VMS
-            handles[nhandles].ino[0] = statb.st_ino[0];
-            handles[nhandles].ino[1] = statb.st_ino[1];
-            handles[nhandles].ino[2] = statb.st_ino[2];
-#else
             handles[nhandles].ino = statb.st_ino;
-#endif
         }
     }
 
-#if !(defined(PYOS_OS2) && defined(PYCC_GCC))
     dlopenflags = PyThreadState_GET()->interp->dlopenflags;
-#endif
-
-#ifdef __VMS
-    /* VMS currently don't allow a pathname, use a logical name instead */
-    /* Concatenate 'python_module_' and shortname */
-    /* so "import vms.bar" will use the logical python_module_bar */
-    /* As C module use only one name space this is probably not a */
-    /* important limitation */
-    PyOS_snprintf(pathbuf, sizeof(pathbuf), "python_module_%-.200s",
-                  shortname);
-    pathname = pathbuf;
-#endif
 
     handle = dlopen(pathname, dlopenflags);
 
     if (handle == NULL) {
-        PyObject *mod_name = NULL;
-        PyObject *path = NULL;
-        PyObject *error_ob = NULL;
+        PyObject *mod_name;
+        PyObject *path;
+        PyObject *error_ob;
         const char *error = dlerror();
         if (error == NULL)
             error = "unknown dlopen() error";
         error_ob = PyUnicode_FromString(error);
-        path = PyUnicode_FromString(pathname);
+        if (error_ob == NULL)
+            return NULL;
         mod_name = PyUnicode_FromString(shortname);
+        if (mod_name == NULL) {
+            Py_DECREF(error_ob);
+            return NULL;
+        }
+        path = PyUnicode_FromString(pathname);
+        if (path == NULL) {
+            Py_DECREF(error_ob);
+            Py_DECREF(mod_name);
+            return NULL;
+        }
         PyErr_SetImportError(error_ob, mod_name, path);
-        Py_XDECREF(error_ob);
-        Py_XDECREF(path);
-        Py_XDECREF(mod_name);
+        Py_DECREF(error_ob);
+        Py_DECREF(mod_name);
+        Py_DECREF(path);
         return NULL;
     }
     if (fp != NULL && nhandles < 128)
diff --git a/Python/errors.c b/Python/errors.c
index 626b16e..a980481 100644
--- a/Python/errors.c
+++ b/Python/errors.c
@@ -20,6 +20,9 @@
 extern "C" {
 #endif
 
+_Py_IDENTIFIER(builtins);
+_Py_IDENTIFIER(stderr);
+
 
 void
 PyErr_Restore(PyObject *type, PyObject *value, PyObject *traceback)
@@ -71,6 +74,11 @@
         if (value == NULL || !PyExceptionInstance_Check(value)) {
             /* We must normalize the value right now */
             PyObject *args, *fixed_value;
+#ifdef Py_DEBUG
+            /* in debug mode, PyEval_EvalFrameEx() fails with an assertion
+               error if an exception is set when it is called */
+            PyErr_Clear();
+#endif
             if (value == NULL || value == Py_None)
                 args = PyTuple_New(0);
             else if (PyTuple_Check(value)) {
@@ -112,6 +120,20 @@
     PyErr_Restore(exception, value, tb);
 }
 
+/* Set a key error with the specified argument, wrapping it in a
+ * tuple automatically so that tuple keys are not unpacked as the
+ * exception arguments. */
+void
+_PyErr_SetKeyError(PyObject *arg)
+{
+    PyObject *tup;
+    tup = PyTuple_Pack(1, arg);
+    if (!tup)
+        return; /* caller will expect error to be set anyway */
+    PyErr_SetObject(PyExc_KeyError, tup);
+    Py_DECREF(tup);
+}
+
 void
 PyErr_SetNone(PyObject *exception)
 {
@@ -227,12 +249,21 @@
        value will be an instance.
     */
     if (PyExceptionClass_Check(type)) {
+        int is_subclass;
+        if (inclass) {
+            is_subclass = PyObject_IsSubclass(inclass, type);
+            if (is_subclass < 0)
+                goto finally;
+        }
+        else
+            is_subclass = 0;
+
         /* if the value was not an instance, or is not an instance
            whose class is (or is derived from) type, then use the
            value as an argument to instantiation of the type
            class.
         */
-        if (!inclass || !PyObject_IsSubclass(inclass, type)) {
+        if (!inclass || !is_subclass) {
             PyObject *args, *res;
 
             if (value == Py_None)
@@ -353,6 +384,30 @@
     Py_XDECREF(oldtraceback);
 }
 
+/* Like PyErr_Restore(), but if an exception is already set,
+   set the context associated with it.
+ */
+void
+_PyErr_ChainExceptions(PyObject *exc, PyObject *val, PyObject *tb)
+{
+    if (exc == NULL)
+        return;
+
+    if (PyErr_Occurred()) {
+        PyObject *exc2, *val2, *tb2;
+        PyErr_Fetch(&exc2, &val2, &tb2);
+        PyErr_NormalizeException(&exc, &val, &tb);
+        Py_DECREF(exc);
+        Py_XDECREF(tb);
+        PyErr_NormalizeException(&exc2, &val2, &tb2);
+        PyException_SetContext(val2, val);
+        PyErr_Restore(exc2, val2, tb2);
+    }
+    else {
+        PyErr_Restore(exc, val, tb);
+    }
+}
+
 /* Convenience functions to set a type error exception and return 0 */
 
 int
@@ -366,6 +421,12 @@
 PyObject *
 PyErr_NoMemory(void)
 {
+    if (Py_TYPE(PyExc_MemoryError) == NULL) {
+        /* PyErr_NoMemory() has been called before PyExc_MemoryError has been
+           initialized by _PyExc_Init() */
+        Py_FatalError("Out of memory and PyExc_MemoryError is not "
+                      "initialized yet");
+    }
     PyErr_SetNone(PyExc_MemoryError);
     return NULL;
 }
@@ -373,6 +434,12 @@
 PyObject *
 PyErr_SetFromErrnoWithFilenameObject(PyObject *exc, PyObject *filenameObject)
 {
+    return PyErr_SetFromErrnoWithFilenameObjects(exc, filenameObject, NULL);
+}
+
+PyObject *
+PyErr_SetFromErrnoWithFilenameObjects(PyObject *exc, PyObject *filenameObject, PyObject *filenameObject2)
+{
     PyObject *message;
     PyObject *v, *args;
     int i = errno;
@@ -443,10 +510,15 @@
         return NULL;
     }
 
-    if (filenameObject != NULL)
-        args = Py_BuildValue("(iOO)", i, message, filenameObject);
-    else
+    if (filenameObject != NULL) {
+        if (filenameObject2 != NULL)
+            args = Py_BuildValue("(iOOiO)", i, message, filenameObject, 0, filenameObject2);
+        else
+            args = Py_BuildValue("(iOO)", i, message, filenameObject);
+    } else {
+        assert(filenameObject2 == NULL);
         args = Py_BuildValue("(iO)", i, message);
+    }
     Py_DECREF(message);
 
     if (args != NULL) {
@@ -463,12 +535,11 @@
     return NULL;
 }
 
-
 PyObject *
 PyErr_SetFromErrnoWithFilename(PyObject *exc, const char *filename)
 {
     PyObject *name = filename ? PyUnicode_DecodeFSDefault(filename) : NULL;
-    PyObject *result = PyErr_SetFromErrnoWithFilenameObject(exc, name);
+    PyObject *result = PyErr_SetFromErrnoWithFilenameObjects(exc, name, NULL);
     Py_XDECREF(name);
     return result;
 }
@@ -480,7 +551,7 @@
     PyObject *name = filename ?
                      PyUnicode_FromUnicode(filename, wcslen(filename)) :
              NULL;
-    PyObject *result = PyErr_SetFromErrnoWithFilenameObject(exc, name);
+    PyObject *result = PyErr_SetFromErrnoWithFilenameObjects(exc, name, NULL);
     Py_XDECREF(name);
     return result;
 }
@@ -489,7 +560,7 @@
 PyObject *
 PyErr_SetFromErrno(PyObject *exc)
 {
-    return PyErr_SetFromErrnoWithFilenameObject(exc, NULL);
+    return PyErr_SetFromErrnoWithFilenameObjects(exc, NULL, NULL);
 }
 
 #ifdef MS_WINDOWS
@@ -499,6 +570,16 @@
     int ierr,
     PyObject *filenameObject)
 {
+    return PyErr_SetExcFromWindowsErrWithFilenameObjects(exc, ierr,
+        filenameObject, NULL);
+}
+
+PyObject *PyErr_SetExcFromWindowsErrWithFilenameObjects(
+    PyObject *exc,
+    int ierr,
+    PyObject *filenameObject,
+    PyObject *filenameObject2)
+{
     int len;
     WCHAR *s_buf = NULL; /* Free via LocalFree */
     PyObject *message;
@@ -534,11 +615,15 @@
         return NULL;
     }
 
-    if (filenameObject == NULL)
-        filenameObject = Py_None;
-    /* This is the constructor signature for passing a Windows error code.
+    if (filenameObject == NULL) {
+        assert(filenameObject2 == NULL);
+        filenameObject = filenameObject2 = Py_None;
+    }
+    else if (filenameObject2 == NULL)
+        filenameObject2 = Py_None;
+    /* This is the constructor signature for OSError.
        The POSIX translation will be figured out by the constructor. */
-    args = Py_BuildValue("(iOOi)", 0, message, filenameObject, err);
+    args = Py_BuildValue("(iOOiO)", 0, message, filenameObject, err, filenameObject2);
     Py_DECREF(message);
 
     if (args != NULL) {
@@ -559,9 +644,10 @@
     const char *filename)
 {
     PyObject *name = filename ? PyUnicode_DecodeFSDefault(filename) : NULL;
-    PyObject *ret = PyErr_SetExcFromWindowsErrWithFilenameObject(exc,
+    PyObject *ret = PyErr_SetExcFromWindowsErrWithFilenameObjects(exc,
                                                                  ierr,
-                                                                 name);
+                                                                 name,
+                                                                 NULL);
     Py_XDECREF(name);
     return ret;
 }
@@ -574,9 +660,10 @@
     PyObject *name = filename ?
                      PyUnicode_FromUnicode(filename, wcslen(filename)) :
              NULL;
-    PyObject *ret = PyErr_SetExcFromWindowsErrWithFilenameObject(exc,
+    PyObject *ret = PyErr_SetExcFromWindowsErrWithFilenameObjects(exc,
                                                                  ierr,
-                                                                 name);
+                                                                 name,
+                                                                 NULL);
     Py_XDECREF(name);
     return ret;
 }
@@ -588,17 +675,18 @@
 
 PyObject *PyErr_SetFromWindowsErr(int ierr)
 {
-    return PyErr_SetExcFromWindowsErrWithFilename(PyExc_WindowsError,
+    return PyErr_SetExcFromWindowsErrWithFilename(PyExc_OSError,
                                                   ierr, NULL);
 }
+
 PyObject *PyErr_SetFromWindowsErrWithFilename(
     int ierr,
     const char *filename)
 {
     PyObject *name = filename ? PyUnicode_DecodeFSDefault(filename) : NULL;
-    PyObject *result = PyErr_SetExcFromWindowsErrWithFilenameObject(
-                                                  PyExc_WindowsError,
-                                                  ierr, name);
+    PyObject *result = PyErr_SetExcFromWindowsErrWithFilenameObjects(
+                                                  PyExc_OSError,
+                                                  ierr, name, NULL);
     Py_XDECREF(name);
     return result;
 }
@@ -610,9 +698,9 @@
     PyObject *name = filename ?
                      PyUnicode_FromUnicode(filename, wcslen(filename)) :
              NULL;
-    PyObject *result = PyErr_SetExcFromWindowsErrWithFilenameObject(
-                                                  PyExc_WindowsError,
-                                                  ierr, name);
+    PyObject *result = PyErr_SetExcFromWindowsErrWithFilenameObjects(
+                                                  PyExc_OSError,
+                                                  ierr, name, NULL);
     Py_XDECREF(name);
     return result;
 }
@@ -646,8 +734,11 @@
 
     Py_INCREF(msg);
     PyTuple_SET_ITEM(args, 0, msg);
-    PyDict_SetItemString(kwargs, "name", name);
-    PyDict_SetItemString(kwargs, "path", path);
+
+    if (PyDict_SetItemString(kwargs, "name", name) < 0)
+        return NULL;
+    if (PyDict_SetItemString(kwargs, "path", path) < 0)
+        return NULL;
 
     error = PyObject_Call(PyExc_ImportError, args, kwargs);
     if (error != NULL) {
@@ -675,6 +766,7 @@
 void
 PyErr_BadInternalCall(void)
 {
+    assert(0 && "bad argument to internal function");
     PyErr_Format(PyExc_SystemError,
                  "bad argument to internal function");
 }
@@ -694,6 +786,12 @@
     va_start(vargs);
 #endif
 
+#ifdef Py_DEBUG
+    /* in debug mode, PyEval_EvalFrameEx() fails with an assertion error
+       if an exception is set when it is called */
+    PyErr_Clear();
+#endif
+
     string = PyUnicode_FromFormatV(format, vargs);
     PyErr_SetObject(exception, string);
     Py_XDECREF(string);
@@ -795,60 +893,84 @@
 {
     _Py_IDENTIFIER(__module__);
     PyObject *f, *t, *v, *tb;
-    PyErr_Fetch(&t, &v, &tb);
-    f = PySys_GetObject("stderr");
-    if (f != NULL && f != Py_None) {
-        PyFile_WriteString("Exception ", f);
-        if (t) {
-            PyObject* moduleName;
-            char* className;
-            assert(PyExceptionClass_Check(t));
-            className = PyExceptionClass_Name(t);
-            if (className != NULL) {
-                char *dot = strrchr(className, '.');
-                if (dot != NULL)
-                    className = dot+1;
-            }
+    PyObject *moduleName = NULL;
+    char* className;
 
-            moduleName = _PyObject_GetAttrId(t, &PyId___module__);
-            if (moduleName == NULL)
-                PyFile_WriteString("<unknown>", f);
-            else {
-                char* modstr = _PyUnicode_AsString(moduleName);
-                if (modstr &&
-                    strcmp(modstr, "builtins") != 0)
-                {
-                    PyFile_WriteString(modstr, f);
-                    PyFile_WriteString(".", f);
-                }
-            }
-            if (className == NULL)
-                PyFile_WriteString("<unknown>", f);
-            else
-                PyFile_WriteString(className, f);
-            if (v && v != Py_None) {
-                PyFile_WriteString(": ", f);
-                PyFile_WriteObject(v, f, 0);
-            }
-            Py_XDECREF(moduleName);
-        }
-        if (obj) {
-            PyFile_WriteString(" in ", f);
-            PyFile_WriteObject(obj, f, 0);
-        }
-        PyFile_WriteString(" ignored\n", f);
-        PyErr_Clear(); /* Just in case */
+    PyErr_Fetch(&t, &v, &tb);
+
+    f = _PySys_GetObjectId(&PyId_stderr);
+    if (f == NULL || f == Py_None)
+        goto done;
+
+    if (obj) {
+        if (PyFile_WriteString("Exception ignored in: ", f) < 0)
+            goto done;
+        if (PyFile_WriteObject(obj, f, 0) < 0)
+            goto done;
+        if (PyFile_WriteString("\n", f) < 0)
+            goto done;
     }
+
+    if (PyTraceBack_Print(tb, f) < 0)
+        goto done;
+
+    if (!t)
+        goto done;
+
+    assert(PyExceptionClass_Check(t));
+    className = PyExceptionClass_Name(t);
+    if (className != NULL) {
+        char *dot = strrchr(className, '.');
+        if (dot != NULL)
+            className = dot+1;
+    }
+
+    moduleName = _PyObject_GetAttrId(t, &PyId___module__);
+    if (moduleName == NULL) {
+        PyErr_Clear();
+        if (PyFile_WriteString("<unknown>", f) < 0)
+            goto done;
+    }
+    else {
+        if (_PyUnicode_CompareWithId(moduleName, &PyId_builtins) != 0) {
+            if (PyFile_WriteObject(moduleName, f, Py_PRINT_RAW) < 0)
+                goto done;
+            if (PyFile_WriteString(".", f) < 0)
+                goto done;
+        }
+    }
+    if (className == NULL) {
+        if (PyFile_WriteString("<unknown>", f) < 0)
+            goto done;
+    }
+    else {
+        if (PyFile_WriteString(className, f) < 0)
+            goto done;
+    }
+
+    if (v && v != Py_None) {
+        if (PyFile_WriteString(": ", f) < 0)
+            goto done;
+        if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0)
+            goto done;
+    }
+    if (PyFile_WriteString("\n", f) < 0)
+        goto done;
+
+done:
+    Py_XDECREF(moduleName);
     Py_XDECREF(t);
     Py_XDECREF(v);
     Py_XDECREF(tb);
+    PyErr_Clear(); /* Just in case */
 }
 
 extern PyObject *PyModule_GetWarningsModule(void);
 
 
 void
-PyErr_SyntaxLocation(const char *filename, int lineno) {
+PyErr_SyntaxLocation(const char *filename, int lineno)
+{
     PyErr_SyntaxLocationEx(filename, lineno, -1);
 }
 
@@ -858,7 +980,7 @@
    to make printing of exceptions believe it is a syntax error. */
 
 void
-PyErr_SyntaxLocationEx(const char *filename, int lineno, int col_offset)
+PyErr_SyntaxLocationObject(PyObject *filename, int lineno, int col_offset)
 {
     PyObject *exc, *v, *tb, *tmp;
     _Py_IDENTIFIER(filename);
@@ -892,16 +1014,10 @@
         }
     }
     if (filename != NULL) {
-        tmp = PyUnicode_DecodeFSDefault(filename);
-        if (tmp == NULL)
+        if (_PyObject_SetAttrId(v, &PyId_filename, filename))
             PyErr_Clear();
-        else {
-            if (_PyObject_SetAttrId(v, &PyId_filename, tmp))
-                PyErr_Clear();
-            Py_DECREF(tmp);
-        }
 
-        tmp = PyErr_ProgramText(filename, lineno);
+        tmp = PyErr_ProgramTextObject(filename, lineno);
         if (tmp) {
             if (_PyObject_SetAttrId(v, &PyId_text, tmp))
                 PyErr_Clear();
@@ -931,22 +1047,33 @@
     PyErr_Restore(exc, v, tb);
 }
 
+void
+PyErr_SyntaxLocationEx(const char *filename, int lineno, int col_offset)
+{
+    PyObject *fileobj;
+    if (filename != NULL) {
+        fileobj = PyUnicode_DecodeFSDefault(filename);
+        if (fileobj == NULL)
+            PyErr_Clear();
+    }
+    else
+        fileobj = NULL;
+    PyErr_SyntaxLocationObject(fileobj, lineno, col_offset);
+    Py_XDECREF(fileobj);
+}
+
 /* Attempt to load the line of text that the exception refers to.  If it
    fails, it will return NULL but will not set an exception.
 
    XXX The functionality of this function is quite similar to the
    functionality in tb_displayline() in traceback.c. */
 
-PyObject *
-PyErr_ProgramText(const char *filename, int lineno)
+static PyObject *
+err_programtext(FILE *fp, int lineno)
 {
-    FILE *fp;
     int i;
     char linebuf[1000];
 
-    if (filename == NULL || *filename == '\0' || lineno <= 0)
-        return NULL;
-    fp = fopen(filename, "r" PY_STDIOTEXTMODE);
     if (fp == NULL)
         return NULL;
     for (i = 0; i < lineno; i++) {
@@ -977,6 +1104,26 @@
     return NULL;
 }
 
+PyObject *
+PyErr_ProgramText(const char *filename, int lineno)
+{
+    FILE *fp;
+    if (filename == NULL || *filename == '\0' || lineno <= 0)
+        return NULL;
+    fp = _Py_fopen(filename, "r" PY_STDIOTEXTMODE);
+    return err_programtext(fp, lineno);
+}
+
+PyObject *
+PyErr_ProgramTextObject(PyObject *filename, int lineno)
+{
+    FILE *fp;
+    if (filename == NULL || lineno <= 0)
+        return NULL;
+    fp = _Py_fopen_obj(filename, "r" PY_STDIOTEXTMODE);
+    return err_programtext(fp, lineno);
+}
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/Python/fileutils.c b/Python/fileutils.c
index 5c66ecf..901a746 100644
--- a/Python/fileutils.c
+++ b/Python/fileutils.c
@@ -10,20 +10,39 @@
 #include <langinfo.h>
 #endif
 
+#ifdef HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
+
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
+
 #ifdef __APPLE__
 extern wchar_t* _Py_DecodeUTF8_surrogateescape(const char *s, Py_ssize_t size);
 #endif
 
+#ifdef O_CLOEXEC
+/* Does open() support the O_CLOEXEC flag? Possible values:
+
+   -1: unknown
+    0: open() ignores O_CLOEXEC flag, ex: Linux kernel older than 2.6.23
+    1: open() supports O_CLOEXEC flag, close-on-exec is set
+
+   The flag is used by _Py_open(), io.FileIO and os.open() */
+int _Py_open_cloexec_works = -1;
+#endif
+
 PyObject *
 _Py_device_encoding(int fd)
 {
-#if defined(MS_WINDOWS) || defined(MS_WIN64)
+#if defined(MS_WINDOWS)
     UINT cp;
 #endif
     if (!_PyVerify_fd(fd) || !isatty(fd)) {
         Py_RETURN_NONE;
     }
-#if defined(MS_WINDOWS) || defined(MS_WIN64)
+#if defined(MS_WINDOWS)
     if (fd == 0)
         cp = GetConsoleCP();
     else if (fd == 1 || fd == 2)
@@ -61,7 +80,7 @@
    workaround is also enabled on error, for example if getting the locale
    failed.
 
-   Values of locale_is_ascii:
+   Values of force_ascii:
 
        1: the workaround is used: _Py_wchar2char() uses
           encode_ascii_surrogateescape() and _Py_char2wchar() uses
@@ -205,7 +224,7 @@
 
     if (argsize > PY_SSIZE_T_MAX/sizeof(wchar_t))
         return NULL;
-    res = PyMem_Malloc(argsize*sizeof(wchar_t));
+    res = PyMem_RawMalloc(argsize*sizeof(wchar_t));
     if (!res)
         return NULL;
 
@@ -233,7 +252,7 @@
    Use _Py_wchar2char() to encode the character string back to a byte string.
 
    Return a pointer to a newly allocated wide character string (use
-   PyMem_Free() to free the memory) and write the number of written wide
+   PyMem_RawFree() to free the memory) and write the number of written wide
    characters excluding the null character into *size if size is not NULL, or
    NULL on error (decoding or memory allocation error). If size is not NULL,
    *size is set to (size_t)-1 on memory error and (size_t)-2 on decoding
@@ -258,9 +277,9 @@
     wchar_t *res;
     size_t argsize;
     size_t count;
+#ifdef HAVE_MBRTOWC
     unsigned char *in;
     wchar_t *out;
-#ifdef HAVE_MBRTOWC
     mbstate_t mbs;
 #endif
 
@@ -292,7 +311,7 @@
         argsize += 1;
         if (argsize > PY_SSIZE_T_MAX/sizeof(wchar_t))
             goto oom;
-        res = (wchar_t *)PyMem_Malloc(argsize*sizeof(wchar_t));
+        res = (wchar_t *)PyMem_RawMalloc(argsize*sizeof(wchar_t));
         if (!res)
             goto oom;
         count = mbstowcs(res, arg, argsize);
@@ -301,7 +320,7 @@
             /* Only use the result if it contains no
                surrogate characters. */
             for (tmp = res; *tmp != 0 &&
-                         (*tmp < 0xd800 || *tmp > 0xdfff); tmp++)
+                         !Py_UNICODE_IS_SURROGATE(*tmp); tmp++)
                 ;
             if (*tmp == 0) {
                 if (size != NULL)
@@ -309,7 +328,7 @@
                 return res;
             }
         }
-        PyMem_Free(res);
+        PyMem_RawFree(res);
     }
     /* Conversion failed. Fall back to escaping with surrogateescape. */
 #ifdef HAVE_MBRTOWC
@@ -320,7 +339,7 @@
     argsize = strlen(arg) + 1;
     if (argsize > PY_SSIZE_T_MAX/sizeof(wchar_t))
         goto oom;
-    res = (wchar_t*)PyMem_Malloc(argsize*sizeof(wchar_t));
+    res = (wchar_t*)PyMem_RawMalloc(argsize*sizeof(wchar_t));
     if (!res)
         goto oom;
     in = (unsigned char*)arg;
@@ -336,7 +355,7 @@
                since we provide everything that we have -
                unless there is a bug in the C library, or I
                misunderstood how mbrtowc works. */
-            PyMem_Free(res);
+            PyMem_RawFree(res);
             if (size != NULL)
                 *size = (size_t)-2;
             return NULL;
@@ -349,7 +368,7 @@
             memset(&mbs, 0, sizeof mbs);
             continue;
         }
-        if (*out >= 0xd800 && *out <= 0xdfff) {
+        if (Py_UNICODE_IS_SURROGATE(*out)) {
             /* Surrogate character.  Escape the original
                byte sequence with surrogateescape. */
             argsize -= converted;
@@ -558,14 +577,235 @@
 
 #endif
 
-/* Open a file. Use _wfopen() on Windows, encode the path to the locale
-   encoding and use fopen() otherwise. */
+static int
+get_inheritable(int fd, int raise)
+{
+#ifdef MS_WINDOWS
+    HANDLE handle;
+    DWORD flags;
 
+    if (!_PyVerify_fd(fd)) {
+        if (raise)
+            PyErr_SetFromErrno(PyExc_OSError);
+        return -1;
+    }
+
+    handle = (HANDLE)_get_osfhandle(fd);
+    if (handle == INVALID_HANDLE_VALUE) {
+        if (raise)
+            PyErr_SetFromWindowsErr(0);
+        return -1;
+    }
+
+    if (!GetHandleInformation(handle, &flags)) {
+        if (raise)
+            PyErr_SetFromWindowsErr(0);
+        return -1;
+    }
+
+    return (flags & HANDLE_FLAG_INHERIT);
+#else
+    int flags;
+
+    flags = fcntl(fd, F_GETFD, 0);
+    if (flags == -1) {
+        if (raise)
+            PyErr_SetFromErrno(PyExc_OSError);
+        return -1;
+    }
+    return !(flags & FD_CLOEXEC);
+#endif
+}
+
+/* Get the inheritable flag of the specified file descriptor.
+   Return 1 if the file descriptor can be inherited, 0 if it cannot,
+   raise an exception and return -1 on error. */
+int
+_Py_get_inheritable(int fd)
+{
+    return get_inheritable(fd, 1);
+}
+
+static int
+set_inheritable(int fd, int inheritable, int raise, int *atomic_flag_works)
+{
+#ifdef MS_WINDOWS
+    HANDLE handle;
+    DWORD flags;
+#else
+#if defined(HAVE_SYS_IOCTL_H) && defined(FIOCLEX) && defined(FIONCLEX)
+    static int ioctl_works = -1;
+    int request;
+    int err;
+#endif
+    int flags;
+    int res;
+#endif
+
+    /* atomic_flag_works can only be used to make the file descriptor
+       non-inheritable */
+    assert(!(atomic_flag_works != NULL && inheritable));
+
+    if (atomic_flag_works != NULL && !inheritable) {
+        if (*atomic_flag_works == -1) {
+            int inheritable = get_inheritable(fd, raise);
+            if (inheritable == -1)
+                return -1;
+            *atomic_flag_works = !inheritable;
+        }
+
+        if (*atomic_flag_works)
+            return 0;
+    }
+
+#ifdef MS_WINDOWS
+    if (!_PyVerify_fd(fd)) {
+        if (raise)
+            PyErr_SetFromErrno(PyExc_OSError);
+        return -1;
+    }
+
+    handle = (HANDLE)_get_osfhandle(fd);
+    if (handle == INVALID_HANDLE_VALUE) {
+        if (raise)
+            PyErr_SetFromWindowsErr(0);
+        return -1;
+    }
+
+    if (inheritable)
+        flags = HANDLE_FLAG_INHERIT;
+    else
+        flags = 0;
+    if (!SetHandleInformation(handle, HANDLE_FLAG_INHERIT, flags)) {
+        if (raise)
+            PyErr_SetFromWindowsErr(0);
+        return -1;
+    }
+    return 0;
+
+#else
+
+#if defined(HAVE_SYS_IOCTL_H) && defined(FIOCLEX) && defined(FIONCLEX)
+    if (ioctl_works != 0) {
+        /* fast-path: ioctl() only requires one syscall */
+        if (inheritable)
+            request = FIONCLEX;
+        else
+            request = FIOCLEX;
+        err = ioctl(fd, request, NULL);
+        if (!err) {
+            ioctl_works = 1;
+            return 0;
+        }
+
+        if (errno != ENOTTY) {
+            if (raise)
+                PyErr_SetFromErrno(PyExc_OSError);
+            return -1;
+        }
+        else {
+            /* Issue #22258: Here, ENOTTY means "Inappropriate ioctl for
+               device". The ioctl is declared but not supported by the kernel.
+               Remember that ioctl() doesn't work. It is the case on
+               Illumos-based OS for example. */
+            ioctl_works = 0;
+        }
+        /* fallback to fcntl() if ioctl() does not work */
+    }
+#endif
+
+    /* slow-path: fcntl() requires two syscalls */
+    flags = fcntl(fd, F_GETFD);
+    if (flags < 0) {
+        if (raise)
+            PyErr_SetFromErrno(PyExc_OSError);
+        return -1;
+    }
+
+    if (inheritable)
+        flags &= ~FD_CLOEXEC;
+    else
+        flags |= FD_CLOEXEC;
+    res = fcntl(fd, F_SETFD, flags);
+    if (res < 0) {
+        if (raise)
+            PyErr_SetFromErrno(PyExc_OSError);
+        return -1;
+    }
+    return 0;
+#endif
+}
+
+/* Make the file descriptor non-inheritable.
+   Return 0 on success, set errno and return -1 on error. */
+static int
+make_non_inheritable(int fd)
+{
+    return set_inheritable(fd, 0, 0, NULL);
+}
+
+/* Set the inheritable flag of the specified file descriptor.
+   On success: return 0, on error: raise an exception if raise is nonzero
+   and return -1.
+
+   If atomic_flag_works is not NULL:
+
+    * if *atomic_flag_works==-1, check if the inheritable is set on the file
+      descriptor: if yes, set *atomic_flag_works to 1, otherwise set to 0 and
+      set the inheritable flag
+    * if *atomic_flag_works==1: do nothing
+    * if *atomic_flag_works==0: set inheritable flag to False
+
+   Set atomic_flag_works to NULL if no atomic flag was used to create the
+   file descriptor.
+
+   atomic_flag_works can only be used to make a file descriptor
+   non-inheritable: atomic_flag_works must be NULL if inheritable=1. */
+int
+_Py_set_inheritable(int fd, int inheritable, int *atomic_flag_works)
+{
+    return set_inheritable(fd, inheritable, 1, atomic_flag_works);
+}
+
+/* Open a file with the specified flags (wrapper to open() function).
+   The file descriptor is created non-inheritable. */
+int
+_Py_open(const char *pathname, int flags)
+{
+    int fd;
+#ifdef MS_WINDOWS
+    fd = open(pathname, flags | O_NOINHERIT);
+    if (fd < 0)
+        return fd;
+#else
+
+    int *atomic_flag_works;
+#ifdef O_CLOEXEC
+    atomic_flag_works = &_Py_open_cloexec_works;
+    flags |= O_CLOEXEC;
+#else
+    atomic_flag_works = NULL;
+#endif
+    fd = open(pathname, flags);
+    if (fd < 0)
+        return fd;
+
+    if (set_inheritable(fd, 0, 0, atomic_flag_works) < 0) {
+        close(fd);
+        return -1;
+    }
+#endif   /* !MS_WINDOWS */
+    return fd;
+}
+
+/* Open a file. Use _wfopen() on Windows, encode the path to the locale
+   encoding and use fopen() otherwise. The file descriptor is created
+   non-inheritable. */
 FILE *
 _Py_wfopen(const wchar_t *path, const wchar_t *mode)
 {
-#ifndef MS_WINDOWS
     FILE *f;
+#ifndef MS_WINDOWS
     char *cpath;
     char cmode[10];
     size_t r;
@@ -579,21 +819,42 @@
         return NULL;
     f = fopen(cpath, cmode);
     PyMem_Free(cpath);
-    return f;
 #else
-    return _wfopen(path, mode);
+    f = _wfopen(path, mode);
 #endif
+    if (f == NULL)
+        return NULL;
+    if (make_non_inheritable(fileno(f)) < 0) {
+        fclose(f);
+        return NULL;
+    }
+    return f;
 }
 
-/* Call _wfopen() on Windows, or encode the path to the filesystem encoding and
-   call fopen() otherwise.
+/* Wrapper to fopen(). The file descriptor is created non-inheritable. */
+FILE*
+_Py_fopen(const char *pathname, const char *mode)
+{
+    FILE *f = fopen(pathname, mode);
+    if (f == NULL)
+        return NULL;
+    if (make_non_inheritable(fileno(f)) < 0) {
+        fclose(f);
+        return NULL;
+    }
+    return f;
+}
+
+/* Open a file. Call _wfopen() on Windows, or encode the path to the filesystem
+   encoding and call fopen() otherwise. The file descriptor is created
+   non-inheritable.
 
    Return the new file object on success, or NULL if the file cannot be open or
-   (if PyErr_Occurred()) on unicode error */
-
+   (if PyErr_Occurred()) on unicode error. */
 FILE*
-_Py_fopen(PyObject *path, const char *mode)
+_Py_fopen_obj(PyObject *path, const char *mode)
 {
+    FILE *f;
 #ifdef MS_WINDOWS
     wchar_t *wpath;
     wchar_t wmode[10];
@@ -613,16 +874,21 @@
     if (usize == 0)
         return NULL;
 
-    return _wfopen(wpath, wmode);
+    f = _wfopen(wpath, wmode);
 #else
-    FILE *f;
     PyObject *bytes;
     if (!PyUnicode_FSConverter(path, &bytes))
         return NULL;
     f = fopen(PyBytes_AS_STRING(bytes), mode);
     Py_DECREF(bytes);
-    return f;
 #endif
+    if (f == NULL)
+        return NULL;
+    if (make_non_inheritable(fileno(f)) < 0) {
+        fclose(f);
+        return NULL;
+    }
+    return f;
 }
 
 #ifdef HAVE_READLINK
@@ -659,12 +925,12 @@
         return -1;
     }
     if (bufsiz <= r1) {
-        PyMem_Free(wbuf);
+        PyMem_RawFree(wbuf);
         errno = EINVAL;
         return -1;
     }
     wcsncpy(buf, wbuf, bufsiz);
-    PyMem_Free(wbuf);
+    PyMem_RawFree(wbuf);
     return (int)r1;
 }
 #endif
@@ -700,12 +966,12 @@
         return NULL;
     }
     if (resolved_path_size <= r) {
-        PyMem_Free(wresolved_path);
+        PyMem_RawFree(wresolved_path);
         errno = EINVAL;
         return NULL;
     }
     wcsncpy(resolved_path, wresolved_path, resolved_path_size);
-    PyMem_Free(wresolved_path);
+    PyMem_RawFree(wresolved_path);
     return resolved_path;
 }
 #endif
@@ -718,7 +984,8 @@
 _Py_wgetcwd(wchar_t *buf, size_t size)
 {
 #ifdef MS_WINDOWS
-    return _wgetcwd(buf, size);
+    int isize = (int)Py_MIN(size, INT_MAX);
+    return _wgetcwd(buf, isize);
 #else
     char fname[MAXPATHLEN];
     wchar_t *wname;
@@ -730,12 +997,81 @@
     if (wname == NULL)
         return NULL;
     if (size <= len) {
-        PyMem_Free(wname);
+        PyMem_RawFree(wname);
         return NULL;
     }
     wcsncpy(buf, wname, size);
-    PyMem_Free(wname);
+    PyMem_RawFree(wname);
     return buf;
 #endif
 }
 
+/* Duplicate a file descriptor. The new file descriptor is created as
+   non-inheritable. Return a new file descriptor on success, raise an OSError
+   exception and return -1 on error.
+
+   The GIL is released to call dup(). The caller must hold the GIL. */
+int
+_Py_dup(int fd)
+{
+#ifdef MS_WINDOWS
+    HANDLE handle;
+    DWORD ftype;
+#endif
+
+    if (!_PyVerify_fd(fd)) {
+        PyErr_SetFromErrno(PyExc_OSError);
+        return -1;
+    }
+
+#ifdef MS_WINDOWS
+    handle = (HANDLE)_get_osfhandle(fd);
+    if (handle == INVALID_HANDLE_VALUE) {
+        PyErr_SetFromWindowsErr(0);
+        return -1;
+    }
+
+    /* get the file type, ignore the error if it failed */
+    ftype = GetFileType(handle);
+
+    Py_BEGIN_ALLOW_THREADS
+    fd = dup(fd);
+    Py_END_ALLOW_THREADS
+    if (fd < 0) {
+        PyErr_SetFromErrno(PyExc_OSError);
+        return -1;
+    }
+
+    /* Character files like console cannot be make non-inheritable */
+    if (ftype != FILE_TYPE_CHAR) {
+        if (_Py_set_inheritable(fd, 0, NULL) < 0) {
+            close(fd);
+            return -1;
+        }
+    }
+#elif defined(HAVE_FCNTL_H) && defined(F_DUPFD_CLOEXEC)
+    Py_BEGIN_ALLOW_THREADS
+    fd = fcntl(fd, F_DUPFD_CLOEXEC, 0);
+    Py_END_ALLOW_THREADS
+    if (fd < 0) {
+        PyErr_SetFromErrno(PyExc_OSError);
+        return -1;
+    }
+
+#else
+    Py_BEGIN_ALLOW_THREADS
+    fd = dup(fd);
+    Py_END_ALLOW_THREADS
+    if (fd < 0) {
+        PyErr_SetFromErrno(PyExc_OSError);
+        return -1;
+    }
+
+    if (_Py_set_inheritable(fd, 0, NULL) < 0) {
+        close(fd);
+        return -1;
+    }
+#endif
+    return fd;
+}
+
diff --git a/Python/formatter_unicode.c b/Python/formatter_unicode.c
index a6516dc..e3a8149 100644
--- a/Python/formatter_unicode.c
+++ b/Python/formatter_unicode.c
@@ -156,8 +156,9 @@
 
     Py_ssize_t consumed;
     int align_specified = 0;
+    int fill_char_specified = 0;
 
-    format->fill_char = '\0';
+    format->fill_char = ' ';
     format->align = default_align;
     format->alternate = 0;
     format->sign = '\0';
@@ -171,6 +172,7 @@
     if (end-pos >= 2 && is_alignment_token(READ_spec(pos+1))) {
         format->align = READ_spec(pos+1);
         format->fill_char = READ_spec(pos);
+        fill_char_specified = 1;
         align_specified = 1;
         pos += 2;
     }
@@ -194,7 +196,7 @@
     }
 
     /* The special case for 0-padding (backwards compat) */
-    if (format->fill_char == '\0' && end-pos >= 1 && READ_spec(pos) == '0') {
+    if (!fill_char_specified && end-pos >= 1 && READ_spec(pos) == '0') {
         format->fill_char = '0';
         if (!align_specified) {
             format->align = '=';
@@ -315,7 +317,7 @@
 
 /* Do the padding, and return a pointer to where the caller-supplied
    content goes. */
-static Py_ssize_t
+static int
 fill_padding(_PyUnicodeWriter *writer,
              Py_ssize_t nchars,
              Py_UCS4 fill_char, Py_ssize_t n_lpadding,
@@ -556,7 +558,7 @@
 {
     /* Used to keep track of digits, decimal, and remainder. */
     Py_ssize_t d_pos = d_start;
-    const enum PyUnicode_Kind kind = writer->kind;
+    const unsigned int kind = writer->kind;
     const void *data = writer->data;
     Py_ssize_t r;
 
@@ -757,7 +759,8 @@
         goto done;
     }
 
-    if (format->width == -1 && format->precision == -1) {
+    if ((format->width == -1 || format->width <= len)
+        && (format->precision == -1 || format->precision >= len)) {
         /* Fast path */
         return _PyUnicodeWriter_WriteStr(writer, value);
     }
@@ -770,18 +773,20 @@
 
     calc_padding(len, format->width, format->align, &lpad, &rpad, &total);
 
-    maxchar = _PyUnicode_FindMaxChar(value, 0, len);
+    maxchar = writer->maxchar;
     if (lpad != 0 || rpad != 0)
         maxchar = Py_MAX(maxchar, format->fill_char);
+    if (PyUnicode_MAX_CHAR_VALUE(value) > maxchar) {
+        Py_UCS4 valmaxchar = _PyUnicode_FindMaxChar(value, 0, len);
+        maxchar = Py_MAX(maxchar, valmaxchar);
+    }
 
     /* allocate the resulting string */
     if (_PyUnicodeWriter_Prepare(writer, total, maxchar) == -1)
         goto done;
 
     /* Write into that space. First the padding. */
-    result = fill_padding(writer, len,
-                          format->fill_char=='\0'?' ':format->fill_char,
-                          lpad, rpad);
+    result = fill_padding(writer, len, format->fill_char, lpad, rpad);
     if (result == -1)
         goto done;
 
@@ -951,8 +956,7 @@
     /* Populate the memory. */
     result = fill_number(writer, &spec,
                          tmp, inumeric_chars, inumeric_chars + n_digits,
-                         tmp, prefix,
-                         format->fill_char == '\0' ? ' ' : format->fill_char,
+                         tmp, prefix, format->fill_char,
                          &locale, format->type == 'X');
 
 done:
@@ -977,8 +981,7 @@
     Py_ssize_t n_total;
     int has_decimal;
     double val;
-    Py_ssize_t precision;
-    Py_ssize_t default_precision = 6;
+    int precision, default_precision = 6;
     Py_UCS4 type = format->type;
     int add_pct = 0;
     Py_ssize_t index;
@@ -1049,24 +1052,24 @@
         n_digits += 1;
     }
 
-    /* Since there is no unicode version of PyOS_double_to_string,
-       just use the 8 bit version and then convert to unicode. */
-    unicode_tmp = _PyUnicode_FromASCII(buf, n_digits);
-    PyMem_Free(buf);
-    if (unicode_tmp == NULL)
-        goto done;
-
     if (format->sign != '+' && format->sign != ' '
         && format->width == -1
         && format->type != 'n'
         && !format->thousands_separators)
     {
         /* Fast path */
-        result = _PyUnicodeWriter_WriteStr(writer, unicode_tmp);
-        Py_DECREF(unicode_tmp);
+        result = _PyUnicodeWriter_WriteASCIIString(writer, buf, n_digits);
+        PyMem_Free(buf);
         return result;
     }
 
+    /* Since there is no unicode version of PyOS_double_to_string,
+       just use the 8 bit version and then convert to unicode. */
+    unicode_tmp = _PyUnicode_FromASCII(buf, n_digits);
+    PyMem_Free(buf);
+    if (unicode_tmp == NULL)
+        goto done;
+
     /* Is a sign character present in the output?  If so, remember it
        and skip it */
     index = 0;
@@ -1100,8 +1103,7 @@
     /* Populate the memory. */
     result = fill_number(writer, &spec,
                          unicode_tmp, index, index + n_digits,
-                         NULL, 0,
-                         format->fill_char == '\0' ? ' ' : format->fill_char,
+                         NULL, 0, format->fill_char,
                          &locale, 0);
 
 done:
@@ -1133,8 +1135,7 @@
     Py_ssize_t n_im_total;
     int re_has_decimal;
     int im_has_decimal;
-    int precision;
-    Py_ssize_t default_precision = 6;
+    int precision, default_precision = 6;
     Py_UCS4 type = format->type;
     Py_ssize_t i_re;
     Py_ssize_t i_im;
@@ -1308,8 +1309,7 @@
     /* Populate the memory. First, the padding. */
     result = fill_padding(writer,
                           n_re_total + n_im_total + 1 + add_parens * 2,
-                          format->fill_char=='\0' ? ' ' : format->fill_char,
-                          lpad, rpad);
+                          format->fill_char, lpad, rpad);
     if (result == -1)
         goto done;
 
diff --git a/Python/frozen.c b/Python/frozen.c
index 25fdc17..9bc662b 100644
--- a/Python/frozen.c
+++ b/Python/frozen.c
@@ -28,7 +28,7 @@
 
 #define SIZE (int)sizeof(M___hello__)
 
-static struct _frozen _PyImport_FrozenModules[] = {
+static const struct _frozen _PyImport_FrozenModules[] = {
     /* importlib */
     {"_frozen_importlib", _Py_M__importlib, (int)sizeof(_Py_M__importlib)},
     /* Test module */
@@ -42,4 +42,4 @@
 /* Embedding apps may change this pointer to point to their favorite
    collection of frozen modules: */
 
-struct _frozen *PyImport_FrozenModules = _PyImport_FrozenModules;
+const struct _frozen *PyImport_FrozenModules = _PyImport_FrozenModules;
diff --git a/Python/frozenmain.c b/Python/frozenmain.c
index 8b1f2d4..55d05fc 100644
--- a/Python/frozenmain.c
+++ b/Python/frozenmain.c
@@ -16,19 +16,19 @@
 Py_FrozenMain(int argc, char **argv)
 {
     char *p;
-    int i, n, sts;
+    int i, n, sts = 1;
     int inspect = 0;
     int unbuffered = 0;
-    char *oldloc;
-    wchar_t **argv_copy;
+    char *oldloc = NULL;
+    wchar_t **argv_copy = NULL;
     /* We need a second copies, as Python might modify the first one. */
-    wchar_t **argv_copy2;
+    wchar_t **argv_copy2 = NULL;
 
-    argv_copy = PyMem_Malloc(sizeof(wchar_t*)*argc);
-    argv_copy2 = PyMem_Malloc(sizeof(wchar_t*)*argc);
+    argv_copy = PyMem_RawMalloc(sizeof(wchar_t*) * argc);
+    argv_copy2 = PyMem_RawMalloc(sizeof(wchar_t*) * argc);
     if (!argv_copy || !argv_copy2) {
         fprintf(stderr, "out of memory\n");
-        return 1;
+        goto error;
     }
 
     Py_FrozenFlag = 1; /* Suppress errors from getpath.c */
@@ -44,32 +44,26 @@
         setbuf(stderr, (char *)NULL);
     }
 
-    oldloc = setlocale(LC_ALL, NULL);
+    oldloc = _PyMem_RawStrdup(setlocale(LC_ALL, NULL));
+    if (!oldloc) {
+        fprintf(stderr, "out of memory\n");
+        goto error;
+    }
+
     setlocale(LC_ALL, "");
     for (i = 0; i < argc; i++) {
-#ifdef HAVE_BROKEN_MBSTOWCS
-        size_t argsize = strlen(argv[i]);
-#else
-        size_t argsize = mbstowcs(NULL, argv[i], 0);
-#endif
-        size_t count;
-        if (argsize == (size_t)-1) {
-            fprintf(stderr, "Could not convert argument %d to string\n", i);
-            return 1;
-        }
-        argv_copy[i] = PyMem_Malloc((argsize+1)*sizeof(wchar_t));
+        argv_copy[i] = _Py_char2wchar(argv[i], NULL);
         argv_copy2[i] = argv_copy[i];
         if (!argv_copy[i]) {
-            fprintf(stderr, "out of memory\n");
-            return 1;
-        }
-        count = mbstowcs(argv_copy[i], argv[i], argsize+1);
-        if (count == (size_t)-1) {
-            fprintf(stderr, "Could not convert argument %d to string\n", i);
-            return 1;
+            fprintf(stderr, "Unable to decode the command line argument #%i\n",
+                            i + 1);
+            argc = i;
+            goto error;
         }
     }
     setlocale(LC_ALL, oldloc);
+    PyMem_RawFree(oldloc);
+    oldloc = NULL;
 
 #ifdef MS_WINDOWS
     PyInitFrozenExtensions();
@@ -103,10 +97,14 @@
     PyWinFreeze_ExeTerm();
 #endif
     Py_Finalize();
-    for (i = 0; i < argc; i++) {
-        PyMem_Free(argv_copy2[i]);
+
+error:
+    PyMem_RawFree(argv_copy);
+    if (argv_copy2) {
+        for (i = 0; i < argc; i++)
+            PyMem_RawFree(argv_copy2[i]);
+        PyMem_RawFree(argv_copy2);
     }
-    PyMem_Free(argv_copy);
-    PyMem_Free(argv_copy2);
+    PyMem_RawFree(oldloc);
     return sts;
 }
diff --git a/Python/future.c b/Python/future.c
index d24ae41..81eab54 100644
--- a/Python/future.c
+++ b/Python/future.c
@@ -11,7 +11,7 @@
 "from __future__ imports must occur at the beginning of the file"
 
 static int
-future_check_features(PyFutureFeatures *ff, stmt_ty s, const char *filename)
+future_check_features(PyFutureFeatures *ff, stmt_ty s, PyObject *filename)
 {
     int i;
     asdl_seq *names;
@@ -43,12 +43,12 @@
         } else if (strcmp(feature, "braces") == 0) {
             PyErr_SetString(PyExc_SyntaxError,
                             "not a chance");
-            PyErr_SyntaxLocationEx(filename, s->lineno, s->col_offset);
+            PyErr_SyntaxLocationObject(filename, s->lineno, s->col_offset);
             return 0;
         } else {
             PyErr_Format(PyExc_SyntaxError,
                          UNDEFINED_FUTURE_FEATURE, feature);
-            PyErr_SyntaxLocationEx(filename, s->lineno, s->col_offset);
+            PyErr_SyntaxLocationObject(filename, s->lineno, s->col_offset);
             return 0;
         }
     }
@@ -56,13 +56,17 @@
 }
 
 static int
-future_parse(PyFutureFeatures *ff, mod_ty mod, const char *filename)
+future_parse(PyFutureFeatures *ff, mod_ty mod, PyObject *filename)
 {
-    int i, found_docstring = 0, done = 0, prev_line = 0;
+    int i, done = 0, prev_line = 0;
+    stmt_ty first;
 
     if (!(mod->kind == Module_kind || mod->kind == Interactive_kind))
         return 1;
 
+    if (asdl_seq_LEN(mod->v.Module.body) == 0)
+        return 1;
+
     /* A subsequent pass will detect future imports that don't
        appear at the beginning of the file.  There's one case,
        however, that is easier to handle here: A series of imports
@@ -71,8 +75,13 @@
        but is preceded by a regular import.
     */
 
+    i = 0;
+    first = (stmt_ty)asdl_seq_GET(mod->v.Module.body, i);
+    if (first->kind == Expr_kind && first->v.Expr.value->kind == Str_kind)
+        i++;
 
-    for (i = 0; i < asdl_seq_LEN(mod->v.Module.body); i++) {
+
+    for (; i < asdl_seq_LEN(mod->v.Module.body); i++) {
         stmt_ty s = (stmt_ty)asdl_seq_GET(mod->v.Module.body, i);
 
         if (done && s->lineno > prev_line)
@@ -92,32 +101,27 @@
                 if (done) {
                     PyErr_SetString(PyExc_SyntaxError,
                                     ERR_LATE_FUTURE);
-                    PyErr_SyntaxLocationEx(filename, s->lineno, s->col_offset);
+                    PyErr_SyntaxLocationObject(filename, s->lineno, s->col_offset);
                     return 0;
                 }
                 if (!future_check_features(ff, s, filename))
                     return 0;
                 ff->ff_lineno = s->lineno;
             }
-            else
+            else {
                 done = 1;
+            }
         }
-        else if (s->kind == Expr_kind && !found_docstring) {
-            expr_ty e = s->v.Expr.value;
-            if (e->kind != Str_kind)
-                done = 1;
-            else
-                found_docstring = 1;
-        }
-        else
+        else {
             done = 1;
+        }
     }
     return 1;
 }
 
 
 PyFutureFeatures *
-PyFuture_FromAST(mod_ty mod, const char *filename)
+PyFuture_FromASTObject(mod_ty mod, PyObject *filename)
 {
     PyFutureFeatures *ff;
 
@@ -135,3 +139,18 @@
     }
     return ff;
 }
+
+
+PyFutureFeatures *
+PyFuture_FromAST(mod_ty mod, const char *filename_str)
+{
+    PyFutureFeatures *ff;
+    PyObject *filename;
+
+    filename = PyUnicode_DecodeFSDefault(filename_str);
+    if (filename == NULL)
+        return NULL;
+    ff = PyFuture_FromASTObject(mod, filename);
+    Py_DECREF(filename);
+    return ff;
+}
diff --git a/Python/getargs.c b/Python/getargs.c
index ae931b9..3f47b21 100644
--- a/Python/getargs.c
+++ b/Python/getargs.c
@@ -46,14 +46,16 @@
 } freelistentry_t;
 
 typedef struct {
-  int first_available;
   freelistentry_t *entries;
+  int first_available;
+  int entries_malloced;
 } freelist_t;
 
+#define STATIC_FREELIST_ENTRIES 8
 
 /* Forward */
 static int vgetargs1(PyObject *, const char *, va_list *, int);
-static void seterror(int, const char *, int *, const char *, const char *);
+static void seterror(Py_ssize_t, const char *, int *, const char *, const char *);
 static char *convertitem(PyObject *, const char **, va_list *, int, int *,
                          char *, size_t, freelist_t *);
 static char *converttuple(PyObject *, const char **, va_list *, int,
@@ -187,7 +189,8 @@
                                               freelist->entries[index].item);
       }
     }
-    PyMem_FREE(freelist->entries);
+    if (freelist->entries_malloced)
+        PyMem_FREE(freelist->entries);
     return retval;
 }
 
@@ -206,8 +209,13 @@
     const char *formatsave = format;
     Py_ssize_t i, len;
     char *msg;
-    freelist_t freelist = {0, NULL};
     int compat = flags & FLAG_COMPAT;
+    freelistentry_t static_entries[STATIC_FREELIST_ENTRIES];
+    freelist_t freelist;
+
+    freelist.entries = static_entries;
+    freelist.first_available = 0;
+    freelist.entries_malloced = 0;
 
     assert(compat || (args != (PyObject*)NULL));
     flags = flags & ~FLAG_COMPAT;
@@ -240,15 +248,15 @@
             message = format;
             endfmt = 1;
             break;
+        case '|':
+            if (level == 0)
+                min = max;
+            break;
         default:
             if (level == 0) {
-                if (c == 'O')
-                    max++;
-                else if (Py_ISALPHA(Py_CHARMASK(c))) {
+                if (Py_ISALPHA(Py_CHARMASK(c)))
                     if (c != 'e') /* skip encoded */
                         max++;
-                } else if (c == '|')
-                    min = max;
             }
             break;
         }
@@ -262,10 +270,13 @@
 
     format = formatsave;
 
-    freelist.entries = PyMem_NEW(freelistentry_t, max);
-    if (freelist.entries == NULL) {
-        PyErr_NoMemory();
-        return 0;
+    if (max > STATIC_FREELIST_ENTRIES) {
+        freelist.entries = PyMem_NEW(freelistentry_t, max);
+        if (freelist.entries == NULL) {
+            PyErr_NoMemory();
+            return 0;
+        }
+        freelist.entries_malloced = 1;
     }
 
     if (compat) {
@@ -350,7 +361,7 @@
 
 
 static void
-seterror(int iarg, const char *msg, int *levels, const char *fname,
+seterror(Py_ssize_t iarg, const char *msg, int *levels, const char *fname,
          const char *message)
 {
     char buf[512];
@@ -366,10 +377,10 @@
         }
         if (iarg != 0) {
             PyOS_snprintf(p, sizeof(buf) - (p - buf),
-                          "argument %d", iarg);
+                          "argument %" PY_FORMAT_SIZE_T "d", iarg);
             i = 0;
             p += strlen(p);
-            while (levels[i] > 0 && i < 32 && (int)(p-buf) < 220) {
+            while (i < 32 && levels[i] > 0 && (int)(p-buf) < 220) {
                 PyOS_snprintf(p, sizeof(buf) - (p - buf),
                               ", item %d", levels[i]-1);
                 p += strlen(p);
@@ -414,6 +425,7 @@
     int n = 0;
     const char *format = *p_format;
     int i;
+    Py_ssize_t len;
 
     for (;;) {
         int c = *format++;
@@ -443,12 +455,20 @@
         return msgbuf;
     }
 
-    if ((i = PySequence_Size(arg)) != n) {
+    len = PySequence_Size(arg);
+    if (len != n) {
         levels[0] = 0;
-        PyOS_snprintf(msgbuf, bufsize,
-                      toplevel ? "expected %d arguments, not %d" :
-                     "must be sequence of length %d, not %d",
-                  n, i);
+        if (toplevel) {
+            PyOS_snprintf(msgbuf, bufsize,
+                          "expected %d arguments, not %" PY_FORMAT_SIZE_T "d",
+                          n, len);
+        }
+        else {
+            PyOS_snprintf(msgbuf, bufsize,
+                          "must be sequence of length %d, "
+                          "not %" PY_FORMAT_SIZE_T "d",
+                          n, len);
+        }
         return msgbuf;
     }
 
@@ -563,7 +583,7 @@
                 "size does not fit in an int"); \
             return converterr("", arg, msgbuf, bufsize); \
         } \
-        *q=s; \
+        *q = (int)s; \
     }
 #define BUFFER_LEN      ((flags & FLAG_SIZE_T) ? *q2:*q)
 #define RETURN_ERR_OCCURRED return msgbuf
@@ -829,7 +849,7 @@
     /* XXX WAAAAH!  's', 'y', 'z', 'u', 'Z', 'e', 'w' codes all
        need to be cleaned up! */
 
-    case 'y': {/* any buffer-like object, but not PyUnicode */
+    case 'y': {/* any bytes-like object */
         void **p = (void **)va_arg(*p_va, char **);
         char *buf;
         Py_ssize_t count;
@@ -860,8 +880,8 @@
         break;
     }
 
-    case 's': /* text string */
-    case 'z': /* text string or None */
+    case 's': /* text string or bytes-like object */
+    case 'z': /* text string, bytes-like object or None */
     {
         if (*format == '*') {
             /* "s*" or "z*" */
@@ -877,7 +897,7 @@
                                       arg, msgbuf, bufsize);
                 PyBuffer_FillInfo(p, arg, sarg, len, 1, 0);
             }
-            else { /* any buffer-like object */
+            else { /* any bytes-like object */
                 char *buf;
                 if (getbuffer(arg, p, &buf) < 0)
                     return converterr(buf, arg, msgbuf, bufsize);
@@ -888,7 +908,7 @@
                     arg, msgbuf, bufsize);
             }
             format++;
-        } else if (*format == '#') { /* any buffer-like object */
+        } else if (*format == '#') { /* a string or read-only bytes-like object */
             /* "s#" or "z#" */
             void **p = (void **)va_arg(*p_va, char **);
             FETCH_SIZE;
@@ -906,7 +926,7 @@
                 *p = sarg;
                 STORE_SIZE(len);
             }
-            else { /* any buffer-like object */
+            else { /* read-only bytes-like object */
                 /* XXX Really? */
                 char *buf;
                 Py_ssize_t count = convertbuffer(arg, p, &buf);
@@ -947,7 +967,7 @@
     {
         Py_UNICODE **p = va_arg(*p_va, Py_UNICODE **);
 
-        if (*format == '#') { /* any buffer-like object */
+        if (*format == '#') {
             /* "s#" or "Z#" */
             FETCH_SIZE;
 
@@ -1419,9 +1439,15 @@
     const char *fname, *msg, *custom_msg, *keyword;
     int min = INT_MAX;
     int max = INT_MAX;
-    int i, len, nargs, nkeywords;
+    int i, len;
+    Py_ssize_t nargs, nkeywords;
     PyObject *current_arg;
-    freelist_t freelist = {0, NULL};
+    freelistentry_t static_entries[STATIC_FREELIST_ENTRIES];
+    freelist_t freelist;
+
+    freelist.entries = static_entries;
+    freelist.first_available = 0;
+    freelist.entries_malloced = 0;
 
     assert(args != NULL && PyTuple_Check(args));
     assert(keywords == NULL || PyDict_Check(keywords));
@@ -1445,17 +1471,20 @@
     for (len=0; kwlist[len]; len++)
         continue;
 
-    freelist.entries = PyMem_NEW(freelistentry_t, len);
-    if (freelist.entries == NULL) {
-        PyErr_NoMemory();
-        return 0;
+    if (len > STATIC_FREELIST_ENTRIES) {
+        freelist.entries = PyMem_NEW(freelistentry_t, len);
+        if (freelist.entries == NULL) {
+            PyErr_NoMemory();
+            return 0;
+        }
+        freelist.entries_malloced = 1;
     }
 
     nargs = PyTuple_GET_SIZE(args);
     nkeywords = (keywords == NULL) ? 0 : PyDict_Size(keywords);
     if (nargs + nkeywords > len) {
         PyErr_Format(PyExc_TypeError,
-                     "%s%s takes at most %d argument%s (%d given)",
+                     "%s%s takes at most %d argument%s (%zd given)",
                      (fname == NULL) ? "function" : fname,
                      (fname == NULL) ? "" : "()",
                      len,
@@ -1574,20 +1603,15 @@
         Py_ssize_t pos = 0;
         while (PyDict_Next(keywords, &pos, &key, &value)) {
             int match = 0;
-            char *ks;
             if (!PyUnicode_Check(key)) {
                 PyErr_SetString(PyExc_TypeError,
                                 "keywords must be strings");
                 return cleanreturn(0, &freelist);
             }
-            /* check that _PyUnicode_AsString() result is not NULL */
-            ks = _PyUnicode_AsString(key);
-            if (ks != NULL) {
-                for (i = 0; i < len; i++) {
-                    if (!strcmp(ks, kwlist[i])) {
-                        match = 1;
-                        break;
-                    }
+            for (i = 0; i < len; i++) {
+                if (!PyUnicode_CompareWithASCIIString(key, kwlist[i])) {
+                    match = 1;
+                    break;
                 }
             }
             if (!match) {
@@ -1789,7 +1813,7 @@
 
 /* For type constructors that don't take keyword args
  *
- * Sets a TypeError and returns 0 if the kwds dict is
+ * Sets a TypeError and returns 0 if the args/kwargs is
  * not empty, returns 1 otherwise
  */
 int
@@ -1808,6 +1832,25 @@
                     funcname);
     return 0;
 }
+
+
+int
+_PyArg_NoPositional(const char *funcname, PyObject *args)
+{
+    if (args == NULL)
+        return 1;
+    if (!PyTuple_CheckExact(args)) {
+        PyErr_BadInternalCall();
+        return 0;
+    }
+    if (PyTuple_GET_SIZE(args) == 0)
+        return 1;
+
+    PyErr_Format(PyExc_TypeError, "%s does not take positional arguments",
+                    funcname);
+    return 0;
+}
+
 #ifdef __cplusplus
 };
 #endif
diff --git a/Python/getcwd.c b/Python/getcwd.c
deleted file mode 100644
index 4bedbd1..0000000
--- a/Python/getcwd.c
+++ /dev/null
@@ -1,83 +0,0 @@
-
-/* Two PD getcwd() implementations.
-   Author: Guido van Rossum, CWI Amsterdam, Jan 1991, <guido@cwi.nl>. */
-
-#include <stdio.h>
-#include <errno.h>
-
-#ifdef HAVE_GETWD
-
-/* Version for BSD systems -- use getwd() */
-
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-
-#ifndef MAXPATHLEN
-#if defined(PATH_MAX) && PATH_MAX > 1024
-#define MAXPATHLEN PATH_MAX
-#else
-#define MAXPATHLEN 1024
-#endif
-#endif
-
-extern char *getwd(char *);
-
-char *
-getcwd(char *buf, int size)
-{
-    char localbuf[MAXPATHLEN+1];
-    char *ret;
-
-    if (size <= 0) {
-        errno = EINVAL;
-        return NULL;
-    }
-    ret = getwd(localbuf);
-    if (ret != NULL && strlen(localbuf) >= (size_t)size) {
-        errno = ERANGE;
-        return NULL;
-    }
-    if (ret == NULL) {
-        errno = EACCES; /* Most likely error */
-        return NULL;
-    }
-    strncpy(buf, localbuf, size);
-    return buf;
-}
-
-#else /* !HAVE_GETWD */
-
-/* Version for really old UNIX systems -- use pipe from pwd */
-
-#ifndef PWD_CMD
-#define PWD_CMD "/bin/pwd"
-#endif
-
-char *
-getcwd(char *buf, int size)
-{
-    FILE *fp;
-    char *p;
-    int sts;
-    if (size <= 0) {
-        errno = EINVAL;
-        return NULL;
-    }
-    if ((fp = popen(PWD_CMD, "r")) == NULL)
-        return NULL;
-    if (fgets(buf, size, fp) == NULL || (sts = pclose(fp)) != 0) {
-        errno = EACCES; /* Most likely error */
-        return NULL;
-    }
-    for (p = buf; *p != '\n'; p++) {
-        if (*p == '\0') {
-            errno = ERANGE;
-            return NULL;
-        }
-    }
-    *p = '\0';
-    return buf;
-}
-
-#endif /* !HAVE_GETWD */
diff --git a/Python/import.c b/Python/import.c
index 26f82cf..7ee7ed9 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -19,22 +19,11 @@
 extern "C" {
 #endif
 
-#ifdef MS_WINDOWS
-/* for stat.st_mode */
-typedef unsigned short mode_t;
-/* for _mkdir */
-#include <direct.h>
-#endif
-
-
 #define CACHEDIR "__pycache__"
 
 /* See _PyImport_FixupExtensionObject() below */
 static PyObject *extensions = NULL;
 
-/* Function from Parser/tokenizer.c */
-extern char * PyTokenizer_FindEncodingFilename(int, PyObject *);
-
 /* This table is defined in config.c: */
 extern struct _inittab _PyImport_Inittab[];
 
@@ -42,14 +31,31 @@
 
 static PyObject *initstr = NULL;
 
+/*[clinic input]
+module _imp
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=9c332475d8686284]*/
+
+/*[python input]
+class fs_unicode_converter(CConverter):
+    type = 'PyObject *'
+    converter = 'PyUnicode_FSDecoder'
+
+[python start generated code]*/
+/*[python end generated code: output=da39a3ee5e6b4b0d input=9d6786230166006e]*/
+
 /* Initialize things */
 
 void
 _PyImport_Init(void)
 {
+    PyInterpreterState *interp = PyThreadState_Get()->interp;
     initstr = PyUnicode_InternFromString("__init__");
     if (initstr == NULL)
         Py_FatalError("Can't initialize import variables");
+    interp->builtins_copy = PyDict_Copy(interp->builtins);
+    if (interp->builtins_copy == NULL)
+        Py_FatalError("Can't backup builtins dict");
 }
 
 void
@@ -93,8 +99,10 @@
     int err = 0;
 
     path_hooks = PySys_GetObject("path_hooks");
-    if (path_hooks == NULL)
+    if (path_hooks == NULL) {
+        PyErr_SetString(PyExc_RuntimeError, "unable to get sys.path_hooks");
         goto error;
+    }
 
     if (Py_VerboseFlag)
         PySys_WriteStderr("# installing zipimport hook\n");
@@ -204,8 +212,11 @@
     if (import_lock_level > 1) {
         /* Forked as a side effect of import */
         long me = PyThread_get_thread_ident();
-        PyThread_acquire_lock(import_lock, 0);
-        /* XXX: can the previous line fail? */
+        /* The following could fail if the lock is already held, but forking as
+           a side-effect of an import is a) rare, b) nuts, and c) difficult to
+           do thanks to the lock only being held when doing individual module
+           locks per import. */
+        PyThread_acquire_lock(import_lock, NOWAIT_LOCK);
         import_lock_thread = me;
         import_lock_level--;
     } else {
@@ -216,8 +227,37 @@
 
 #endif
 
+/*[clinic input]
+_imp.lock_held
+
+Return True if the import lock is currently held, else False.
+
+On platforms without threads, return False.
+[clinic start generated code]*/
+
+PyDoc_STRVAR(_imp_lock_held__doc__,
+"lock_held($module, /)\n"
+"--\n"
+"\n"
+"Return True if the import lock is currently held, else False.\n"
+"\n"
+"On platforms without threads, return False.");
+
+#define _IMP_LOCK_HELD_METHODDEF    \
+    {"lock_held", (PyCFunction)_imp_lock_held, METH_NOARGS, _imp_lock_held__doc__},
+
 static PyObject *
-imp_lock_held(PyObject *self, PyObject *noargs)
+_imp_lock_held_impl(PyModuleDef *module);
+
+static PyObject *
+_imp_lock_held(PyModuleDef *module, PyObject *Py_UNUSED(ignored))
+{
+    return _imp_lock_held_impl(module);
+}
+
+static PyObject *
+_imp_lock_held_impl(PyModuleDef *module)
+/*[clinic end generated code: output=dae65674966baa65 input=9b088f9b217d9bdf]*/
 {
 #ifdef WITH_THREAD
     return PyBool_FromLong(import_lock_thread != -1);
@@ -226,8 +266,39 @@
 #endif
 }
 
+/*[clinic input]
+_imp.acquire_lock
+
+Acquires the interpreter's import lock for the current thread.
+
+This lock should be used by import hooks to ensure thread-safety when importing
+modules. On platforms without threads, this function does nothing.
+[clinic start generated code]*/
+
+PyDoc_STRVAR(_imp_acquire_lock__doc__,
+"acquire_lock($module, /)\n"
+"--\n"
+"\n"
+"Acquires the interpreter\'s import lock for the current thread.\n"
+"\n"
+"This lock should be used by import hooks to ensure thread-safety when importing\n"
+"modules. On platforms without threads, this function does nothing.");
+
+#define _IMP_ACQUIRE_LOCK_METHODDEF    \
+    {"acquire_lock", (PyCFunction)_imp_acquire_lock, METH_NOARGS, _imp_acquire_lock__doc__},
+
 static PyObject *
-imp_acquire_lock(PyObject *self, PyObject *noargs)
+_imp_acquire_lock_impl(PyModuleDef *module);
+
+static PyObject *
+_imp_acquire_lock(PyModuleDef *module, PyObject *Py_UNUSED(ignored))
+{
+    return _imp_acquire_lock_impl(module);
+}
+
+static PyObject *
+_imp_acquire_lock_impl(PyModuleDef *module)
+/*[clinic end generated code: output=478f1fa089fdb9a4 input=4a2d4381866d5fdc]*/
 {
 #ifdef WITH_THREAD
     _PyImport_AcquireLock();
@@ -236,8 +307,37 @@
     return Py_None;
 }
 
+/*[clinic input]
+_imp.release_lock
+
+Release the interpreter's import lock.
+
+On platforms without threads, this function does nothing.
+[clinic start generated code]*/
+
+PyDoc_STRVAR(_imp_release_lock__doc__,
+"release_lock($module, /)\n"
+"--\n"
+"\n"
+"Release the interpreter\'s import lock.\n"
+"\n"
+"On platforms without threads, this function does nothing.");
+
+#define _IMP_RELEASE_LOCK_METHODDEF    \
+    {"release_lock", (PyCFunction)_imp_release_lock, METH_NOARGS, _imp_release_lock__doc__},
+
 static PyObject *
-imp_release_lock(PyObject *self, PyObject *noargs)
+_imp_release_lock_impl(PyModuleDef *module);
+
+static PyObject *
+_imp_release_lock(PyModuleDef *module, PyObject *Py_UNUSED(ignored))
+{
+    return _imp_release_lock_impl(module);
+}
+
+static PyObject *
+_imp_release_lock_impl(PyModuleDef *module)
+/*[clinic end generated code: output=36c77a6832fdafd4 input=934fb11516dd778b]*/
 {
 #ifdef WITH_THREAD
     if (_PyImport_ReleaseLock() < 0) {
@@ -279,6 +379,7 @@
     "path", "argv", "ps1", "ps2",
     "last_type", "last_value", "last_traceback",
     "path_hooks", "path_importer_cache", "meta_path",
+    "__interactivehook__",
     /* misc stuff */
     "flags", "float_info",
     NULL
@@ -291,16 +392,17 @@
     NULL
 };
 
-
 /* Un-initialize things, as good as we can */
 
 void
 PyImport_Cleanup(void)
 {
-    Py_ssize_t pos, ndone;
+    Py_ssize_t pos;
     PyObject *key, *value, *dict;
     PyInterpreterState *interp = PyThreadState_GET()->interp;
     PyObject *modules = interp->modules;
+    PyObject *weaklist = NULL;
+    char **p;
 
     if (modules == NULL)
         return; /* Already done */
@@ -311,114 +413,129 @@
        deleted *last* of all, they would come too late in the normal
        destruction order.  Sigh. */
 
-    value = PyDict_GetItemString(modules, "builtins");
-    if (value != NULL && PyModule_Check(value)) {
-        dict = PyModule_GetDict(value);
+    /* XXX Perhaps these precautions are obsolete. Who knows? */
+
+    if (Py_VerboseFlag)
+        PySys_WriteStderr("# clear builtins._\n");
+    PyDict_SetItemString(interp->builtins, "_", Py_None);
+
+    for (p = sys_deletes; *p != NULL; p++) {
         if (Py_VerboseFlag)
-            PySys_WriteStderr("# clear builtins._\n");
-        PyDict_SetItemString(dict, "_", Py_None);
+            PySys_WriteStderr("# clear sys.%s\n", *p);
+        PyDict_SetItemString(interp->sysdict, *p, Py_None);
     }
-    value = PyDict_GetItemString(modules, "sys");
-    if (value != NULL && PyModule_Check(value)) {
-        char **p;
-        PyObject *v;
-        dict = PyModule_GetDict(value);
-        for (p = sys_deletes; *p != NULL; p++) {
-            if (Py_VerboseFlag)
-                PySys_WriteStderr("# clear sys.%s\n", *p);
-            PyDict_SetItemString(dict, *p, Py_None);
-        }
-        for (p = sys_files; *p != NULL; p+=2) {
-            if (Py_VerboseFlag)
-                PySys_WriteStderr("# restore sys.%s\n", *p);
-            v = PyDict_GetItemString(dict, *(p+1));
-            if (v == NULL)
-                v = Py_None;
-            PyDict_SetItemString(dict, *p, v);
+    for (p = sys_files; *p != NULL; p+=2) {
+        if (Py_VerboseFlag)
+            PySys_WriteStderr("# restore sys.%s\n", *p);
+        value = PyDict_GetItemString(interp->sysdict, *(p+1));
+        if (value == NULL)
+            value = Py_None;
+        PyDict_SetItemString(interp->sysdict, *p, value);
+    }
+
+    /* We prepare a list which will receive (name, weakref) tuples of
+       modules when they are removed from sys.modules.  The name is used
+       for diagnosis messages (in verbose mode), while the weakref helps
+       detect those modules which have been held alive. */
+    weaklist = PyList_New(0);
+    if (weaklist == NULL)
+        PyErr_Clear();
+
+#define STORE_MODULE_WEAKREF(name, mod) \
+    if (weaklist != NULL) { \
+        PyObject *wr = PyWeakref_NewRef(mod, NULL); \
+        if (name && wr) { \
+            PyObject *tup = PyTuple_Pack(2, name, wr); \
+            PyList_Append(weaklist, tup); \
+            Py_XDECREF(tup); \
+        } \
+        Py_XDECREF(wr); \
+        if (PyErr_Occurred()) \
+            PyErr_Clear(); \
+    }
+
+    /* Remove all modules from sys.modules, hoping that garbage collection
+       can reclaim most of them. */
+    pos = 0;
+    while (PyDict_Next(modules, &pos, &key, &value)) {
+        if (PyModule_Check(value)) {
+            if (Py_VerboseFlag && PyUnicode_Check(key))
+                PySys_FormatStderr("# cleanup[2] removing %U\n", key);
+            STORE_MODULE_WEAKREF(key, value);
+            PyDict_SetItem(modules, key, Py_None);
         }
     }
 
-    /* First, delete __main__ */
-    value = PyDict_GetItemString(modules, "__main__");
-    if (value != NULL && PyModule_Check(value)) {
-        if (Py_VerboseFlag)
-            PySys_WriteStderr("# cleanup __main__\n");
-        _PyModule_Clear(value);
-        PyDict_SetItemString(modules, "__main__", Py_None);
-    }
+    /* Clear the modules dict. */
+    PyDict_Clear(modules);
+    /* Restore the original builtins dict, to ensure that any
+       user data gets cleared. */
+    dict = PyDict_Copy(interp->builtins);
+    if (dict == NULL)
+        PyErr_Clear();
+    PyDict_Clear(interp->builtins);
+    if (PyDict_Update(interp->builtins, interp->builtins_copy))
+        PyErr_Clear();
+    Py_XDECREF(dict);
+    /* Clear module dict copies stored in the interpreter state */
+    _PyState_ClearModules();
+    /* Collect references */
+    _PyGC_CollectNoFail();
+    /* Dump GC stats before it's too late, since it uses the warnings
+       machinery. */
+    _PyGC_DumpShutdownStats();
 
-    /* The special treatment of "builtins" here is because even
+    /* Now, if there are any modules left alive, clear their globals to
+       minimize potential leaks.  All C extension modules actually end
+       up here, since they are kept alive in the interpreter state.
+
+       The special treatment of "builtins" here is because even
        when it's not referenced as a module, its dictionary is
        referenced by almost every module's __builtins__.  Since
        deleting a module clears its dictionary (even if there are
        references left to it), we need to delete the "builtins"
        module last.  Likewise, we don't delete sys until the very
-       end because it is implicitly referenced (e.g. by print).
-
-       Also note that we 'delete' modules by replacing their entry
-       in the modules dict with None, rather than really deleting
-       them; this avoids a rehash of the modules dictionary and
-       also marks them as "non existent" so they won't be
-       re-imported. */
-
-    /* Next, repeatedly delete modules with a reference count of
-       one (skipping builtins and sys) and delete them */
-    do {
-        ndone = 0;
-        pos = 0;
-        while (PyDict_Next(modules, &pos, &key, &value)) {
-            if (value->ob_refcnt != 1)
+       end because it is implicitly referenced (e.g. by print). */
+    if (weaklist != NULL) {
+        Py_ssize_t i, n;
+        n = PyList_GET_SIZE(weaklist);
+        for (i = 0; i < n; i++) {
+            PyObject *tup = PyList_GET_ITEM(weaklist, i);
+            PyObject *name = PyTuple_GET_ITEM(tup, 0);
+            PyObject *mod = PyWeakref_GET_OBJECT(PyTuple_GET_ITEM(tup, 1));
+            if (mod == Py_None)
                 continue;
-            if (PyUnicode_Check(key) && PyModule_Check(value)) {
-                if (PyUnicode_CompareWithASCIIString(key, "builtins") == 0)
-                    continue;
-                if (PyUnicode_CompareWithASCIIString(key, "sys") == 0)
-                    continue;
-                if (Py_VerboseFlag)
-                    PySys_FormatStderr(
-                        "# cleanup[1] %U\n", key);
-                _PyModule_Clear(value);
-                PyDict_SetItem(modules, key, Py_None);
-                ndone++;
-            }
+            assert(PyModule_Check(mod));
+            dict = PyModule_GetDict(mod);
+            if (dict == interp->builtins || dict == interp->sysdict)
+                continue;
+            Py_INCREF(mod);
+            if (Py_VerboseFlag && PyUnicode_Check(name))
+                PySys_FormatStderr("# cleanup[3] wiping %U\n", name);
+            _PyModule_Clear(mod);
+            Py_DECREF(mod);
         }
-    } while (ndone > 0);
-
-    /* Next, delete all modules (still skipping builtins and sys) */
-    pos = 0;
-    while (PyDict_Next(modules, &pos, &key, &value)) {
-        if (PyUnicode_Check(key) && PyModule_Check(value)) {
-            if (PyUnicode_CompareWithASCIIString(key, "builtins") == 0)
-                continue;
-            if (PyUnicode_CompareWithASCIIString(key, "sys") == 0)
-                continue;
-            if (Py_VerboseFlag)
-                PySys_FormatStderr("# cleanup[2] %U\n", key);
-            _PyModule_Clear(value);
-            PyDict_SetItem(modules, key, Py_None);
-        }
+        Py_DECREF(weaklist);
     }
 
     /* Next, delete sys and builtins (in that order) */
-    value = PyDict_GetItemString(modules, "sys");
-    if (value != NULL && PyModule_Check(value)) {
-        if (Py_VerboseFlag)
-            PySys_WriteStderr("# cleanup sys\n");
-        _PyModule_Clear(value);
-        PyDict_SetItemString(modules, "sys", Py_None);
-    }
-    value = PyDict_GetItemString(modules, "builtins");
-    if (value != NULL && PyModule_Check(value)) {
-        if (Py_VerboseFlag)
-            PySys_WriteStderr("# cleanup builtins\n");
-        _PyModule_Clear(value);
-        PyDict_SetItemString(modules, "builtins", Py_None);
-    }
+    if (Py_VerboseFlag)
+        PySys_FormatStderr("# cleanup[3] wiping sys\n");
+    _PyModule_ClearDict(interp->sysdict);
+    if (Py_VerboseFlag)
+        PySys_FormatStderr("# cleanup[3] wiping builtins\n");
+    _PyModule_ClearDict(interp->builtins);
 
-    /* Finally, clear and delete the modules directory */
-    PyDict_Clear(modules);
+    /* Clear and delete the modules directory.  Actual modules will
+       still be there only if imported during the execution of some
+       destructor. */
     interp->modules = NULL;
     Py_DECREF(modules);
+
+    /* Once more */
+    _PyGC_CollectNoFail();
+
+#undef STORE_MODULE_WEAKREF
 }
 
 
@@ -450,12 +567,12 @@
 
 /* Magic for extension modules (built-in as well as dynamically
    loaded).  To prevent initializing an extension module more than
-   once, we keep a static dictionary 'extensions' keyed by module name
-   (for built-in modules) or by filename (for dynamically loaded
-   modules), containing these modules.  A copy of the module's
-   dictionary is stored by calling _PyImport_FixupExtensionObject()
-   immediately after the module initialization function succeeds.  A
-   copy can be retrieved from there by calling
+   once, we keep a static dictionary 'extensions' keyed by the tuple
+   (module name, module name)  (for built-in modules) or by
+   (filename, module name) (for dynamically loaded modules), containing these
+   modules.  A copy of the module's dictionary is stored by calling
+   _PyImport_FixupExtensionObject() immediately after the module initialization
+   function succeeds.  A copy can be retrieved from there by calling
    _PyImport_FindExtensionObject().
 
    Modules which do support multiple initialization set their m_size
@@ -468,8 +585,9 @@
 _PyImport_FixupExtensionObject(PyObject *mod, PyObject *name,
                                PyObject *filename)
 {
-    PyObject *modules, *dict;
+    PyObject *modules, *dict, *key;
     struct PyModuleDef *def;
+    int res;
     if (extensions == NULL) {
         extensions = PyDict_New();
         if (extensions == NULL)
@@ -505,12 +623,18 @@
         if (def->m_base.m_copy == NULL)
             return -1;
     }
-    PyDict_SetItem(extensions, filename, (PyObject*)def);
+    key = PyTuple_Pack(2, filename, name);
+    if (key == NULL)
+        return -1;
+    res = PyDict_SetItem(extensions, key, (PyObject *)def);
+    Py_DECREF(key);
+    if (res < 0)
+        return -1;
     return 0;
 }
 
 int
-_PyImport_FixupBuiltin(PyObject *mod, char *name)
+_PyImport_FixupBuiltin(PyObject *mod, const char *name)
 {
     int res;
     PyObject *nameobj;
@@ -525,11 +649,15 @@
 PyObject *
 _PyImport_FindExtensionObject(PyObject *name, PyObject *filename)
 {
-    PyObject *mod, *mdict;
+    PyObject *mod, *mdict, *key;
     PyModuleDef* def;
     if (extensions == NULL)
         return NULL;
-    def = (PyModuleDef*)PyDict_GetItem(extensions, filename);
+    key = PyTuple_Pack(2, filename, name);
+    if (key == NULL)
+        return NULL;
+    def = (PyModuleDef *)PyDict_GetItem(extensions, key);
+    Py_DECREF(key);
     if (def == NULL)
         return NULL;
     if (def->m_size == -1) {
@@ -645,22 +773,23 @@
  * interface.  The other two exist primarily for backward compatibility.
  */
 PyObject *
-PyImport_ExecCodeModule(char *name, PyObject *co)
+PyImport_ExecCodeModule(const char *name, PyObject *co)
 {
     return PyImport_ExecCodeModuleWithPathnames(
         name, co, (char *)NULL, (char *)NULL);
 }
 
 PyObject *
-PyImport_ExecCodeModuleEx(char *name, PyObject *co, char *pathname)
+PyImport_ExecCodeModuleEx(const char *name, PyObject *co, const char *pathname)
 {
     return PyImport_ExecCodeModuleWithPathnames(
         name, co, pathname, (char *)NULL);
 }
 
 PyObject *
-PyImport_ExecCodeModuleWithPathnames(char *name, PyObject *co, char *pathname,
-                                     char *cpathname)
+PyImport_ExecCodeModuleWithPathnames(const char *name, PyObject *co,
+                                     const char *pathname,
+                                     const char *cpathname)
 {
     PyObject *m = NULL;
     PyObject *nameobj, *pathobj = NULL, *cpathobj = NULL;
@@ -691,7 +820,7 @@
                           "no interpreter!");
         }
 
-        pathobj = _PyObject_CallMethodObjIdArgs(interp->importlib,
+        pathobj = _PyObject_CallMethodIdObjArgs(interp->importlib,
                                                 &PyId__get_sourcefile, cpathobj,
                                                 NULL);
         if (pathobj == NULL)
@@ -708,12 +837,10 @@
     return m;
 }
 
-PyObject*
-PyImport_ExecCodeModuleObject(PyObject *name, PyObject *co, PyObject *pathname,
-                              PyObject *cpathname)
+static PyObject *
+module_dict_for_exec(PyObject *name)
 {
-    PyObject *modules = PyImport_GetModuleDict();
-    PyObject *m, *d, *v;
+    PyObject *m, *d = NULL;
 
     m = PyImport_AddModuleObject(name);
     if (m == NULL)
@@ -723,31 +850,26 @@
     d = PyModule_GetDict(m);
     if (PyDict_GetItemString(d, "__builtins__") == NULL) {
         if (PyDict_SetItemString(d, "__builtins__",
-                                 PyEval_GetBuiltins()) != 0)
-            goto error;
+                                 PyEval_GetBuiltins()) != 0) {
+            remove_module(name);
+            return NULL;
+        }
     }
-    if (pathname != NULL) {
-        v = pathname;
-    }
-    else {
-        v = ((PyCodeObject *)co)->co_filename;
-    }
-    Py_INCREF(v);
-    if (PyDict_SetItemString(d, "__file__", v) != 0)
-        PyErr_Clear(); /* Not important enough to report */
-    Py_DECREF(v);
 
-    /* Remember the pyc path name as the __cached__ attribute. */
-    if (cpathname != NULL)
-        v = cpathname;
-    else
-        v = Py_None;
-    if (PyDict_SetItemString(d, "__cached__", v) != 0)
-        PyErr_Clear(); /* Not important enough to report */
+    return d;  /* Return a borrowed reference. */
+}
 
-    v = PyEval_EvalCode(co, d, d);
-    if (v == NULL)
-        goto error;
+static PyObject *
+exec_code_in_module(PyObject *name, PyObject *module_dict, PyObject *code_object)
+{
+    PyObject *modules = PyImport_GetModuleDict();
+    PyObject *v, *m;
+
+    v = PyEval_EvalCode(code_object, module_dict, module_dict);
+    if (v == NULL) {
+        remove_module(name);
+        return NULL;
+    }
     Py_DECREF(v);
 
     if ((m = PyDict_GetItem(modules, name)) == NULL) {
@@ -760,10 +882,32 @@
     Py_INCREF(m);
 
     return m;
+}
 
-  error:
-    remove_module(name);
-    return NULL;
+PyObject*
+PyImport_ExecCodeModuleObject(PyObject *name, PyObject *co, PyObject *pathname,
+                              PyObject *cpathname)
+{
+    PyObject *d, *res;
+    PyInterpreterState *interp = PyThreadState_GET()->interp;
+    _Py_IDENTIFIER(_fix_up_module);
+
+    d = module_dict_for_exec(name);
+    if (d == NULL) {
+        return NULL;
+    }
+
+    if (pathname == NULL) {
+        pathname = ((PyCodeObject *)co)->co_filename;
+    }
+    res = _PyObject_CallMethodIdObjArgs(interp->importlib,
+                                        &PyId__fix_up_module,
+                                        d, name, pathname, cpathname, NULL);
+    if (res != NULL) {
+        Py_DECREF(res);
+        res = exec_code_in_module(name, d, co);
+    }
+    return res;
 }
 
 
@@ -805,35 +949,66 @@
     Py_DECREF(oldname);
 }
 
+/*[clinic input]
+_imp._fix_co_filename
+
+    code: object(type="PyCodeObject *", subclass_of="&PyCode_Type")
+        Code object to change.
+
+    path: unicode
+        File path to use.
+    /
+
+Changes code.co_filename to specify the passed-in file path.
+[clinic start generated code]*/
+
+PyDoc_STRVAR(_imp__fix_co_filename__doc__,
+"_fix_co_filename($module, code, path, /)\n"
+"--\n"
+"\n"
+"Changes code.co_filename to specify the passed-in file path.\n"
+"\n"
+"  code\n"
+"    Code object to change.\n"
+"  path\n"
+"    File path to use.");
+
+#define _IMP__FIX_CO_FILENAME_METHODDEF    \
+    {"_fix_co_filename", (PyCFunction)_imp__fix_co_filename, METH_VARARGS, _imp__fix_co_filename__doc__},
+
 static PyObject *
-imp_fix_co_filename(PyObject *self, PyObject *args)
+_imp__fix_co_filename_impl(PyModuleDef *module, PyCodeObject *code, PyObject *path);
+
+static PyObject *
+_imp__fix_co_filename(PyModuleDef *module, PyObject *args)
 {
-    PyObject *co;
-    PyObject *file_path;
+    PyObject *return_value = NULL;
+    PyCodeObject *code;
+    PyObject *path;
 
-    if (!PyArg_ParseTuple(args, "OO:_fix_co_filename", &co, &file_path))
-        return NULL;
+    if (!PyArg_ParseTuple(args,
+        "O!U:_fix_co_filename",
+        &PyCode_Type, &code, &path))
+        goto exit;
+    return_value = _imp__fix_co_filename_impl(module, code, path);
 
-    if (!PyCode_Check(co)) {
-        PyErr_SetString(PyExc_TypeError,
-                        "first argument must be a code object");
-        return NULL;
-    }
+exit:
+    return return_value;
+}
 
-    if (!PyUnicode_Check(file_path)) {
-        PyErr_SetString(PyExc_TypeError,
-                        "second argument must be a string");
-        return NULL;
-    }
+static PyObject *
+_imp__fix_co_filename_impl(PyModuleDef *module, PyCodeObject *code, PyObject *path)
+/*[clinic end generated code: output=6b4b1edeb0d55c5d input=895ba50e78b82f05]*/
 
-    update_compiled_module((PyCodeObject*)co, file_path);
+{
+    update_compiled_module(code, path);
 
     Py_RETURN_NONE;
 }
 
 
 /* Forward */
-static struct _frozen * find_frozen(PyObject *);
+static const struct _frozen * find_frozen(PyObject *);
 
 
 /* Helper to test for built-in module */
@@ -915,11 +1090,11 @@
 PyImport_GetImporter(PyObject *path) {
     PyObject *importer=NULL, *path_importer_cache=NULL, *path_hooks=NULL;
 
-    if ((path_importer_cache = PySys_GetObject("path_importer_cache"))) {
-        if ((path_hooks = PySys_GetObject("path_hooks"))) {
-            importer = get_path_importer(path_importer_cache,
-                                         path_hooks, path);
-        }
+    path_importer_cache = PySys_GetObject("path_importer_cache");
+    path_hooks = PySys_GetObject("path_hooks");
+    if (path_importer_cache != NULL && path_hooks != NULL) {
+        importer = get_path_importer(path_importer_cache,
+                                     path_hooks, path);
     }
     Py_XINCREF(importer); /* get_path_importer returns a borrowed reference */
     return importer;
@@ -936,8 +1111,12 @@
 init_builtin(PyObject *name)
 {
     struct _inittab *p;
+    PyObject *mod;
 
-    if (_PyImport_FindExtensionObject(name, name) != NULL)
+    mod = _PyImport_FindExtensionObject(name, name);
+    if (PyErr_Occurred())
+        return -1;
+    if (mod != NULL)
         return 1;
 
     for (p = PyImport_Inittab; p->name != NULL; p++) {
@@ -970,10 +1149,10 @@
 
 /* Frozen modules */
 
-static struct _frozen *
+static const struct _frozen *
 find_frozen(PyObject *name)
 {
-    struct _frozen *p;
+    const struct _frozen *p;
 
     if (name == NULL)
         return NULL;
@@ -990,7 +1169,7 @@
 static PyObject *
 get_frozen_object(PyObject *name)
 {
-    struct _frozen *p = find_frozen(name);
+    const struct _frozen *p = find_frozen(name);
     int size;
 
     if (p == NULL) {
@@ -1008,13 +1187,13 @@
     size = p->size;
     if (size < 0)
         size = -size;
-    return PyMarshal_ReadObjectFromString((char *)p->code, size);
+    return PyMarshal_ReadObjectFromString((const char *)p->code, size);
 }
 
 static PyObject *
 is_frozen_package(PyObject *name)
 {
-    struct _frozen *p = find_frozen(name);
+    const struct _frozen *p = find_frozen(name);
     int size;
 
     if (p == NULL) {
@@ -1041,8 +1220,8 @@
 int
 PyImport_ImportFrozenModuleObject(PyObject *name)
 {
-    struct _frozen *p;
-    PyObject *co, *m, *path;
+    const struct _frozen *p;
+    PyObject *co, *m, *d;
     int ispackage;
     int size;
 
@@ -1060,7 +1239,7 @@
     ispackage = (size < 0);
     if (ispackage)
         size = -size;
-    co = PyMarshal_ReadObjectFromString((char *)p->code, size);
+    co = PyMarshal_ReadObjectFromString((const char *)p->code, size);
     if (co == NULL)
         return -1;
     if (!PyCode_Check(co)) {
@@ -1070,29 +1249,27 @@
         goto err_return;
     }
     if (ispackage) {
-        /* Set __path__ to the package name */
-        PyObject *d, *l;
+        /* Set __path__ to the empty list */
+        PyObject *l;
         int err;
         m = PyImport_AddModuleObject(name);
         if (m == NULL)
             goto err_return;
         d = PyModule_GetDict(m);
-        l = PyList_New(1);
+        l = PyList_New(0);
         if (l == NULL) {
             goto err_return;
         }
-        Py_INCREF(name);
-        PyList_SET_ITEM(l, 0, name);
         err = PyDict_SetItemString(d, "__path__", l);
         Py_DECREF(l);
         if (err != 0)
             goto err_return;
     }
-    path = PyUnicode_FromString("<frozen>");
-    if (path == NULL)
+    d = module_dict_for_exec(name);
+    if (d == NULL) {
         goto err_return;
-    m = PyImport_ExecCodeModuleObject(name, co, path, NULL);
-    Py_DECREF(path);
+    }
+    m = exec_code_in_module(name, d, co);
     if (m == NULL)
         goto err_return;
     Py_DECREF(co);
@@ -1104,7 +1281,7 @@
 }
 
 int
-PyImport_ImportFrozenModule(char *name)
+PyImport_ImportFrozenModule(const char *name)
 {
     PyObject *nameobj;
     int ret;
@@ -1218,7 +1395,8 @@
                                  int level)
 {
     _Py_IDENTIFIER(__import__);
-    _Py_IDENTIFIER(__initializing__);
+    _Py_IDENTIFIER(__spec__);
+    _Py_IDENTIFIER(_initializing);
     _Py_IDENTIFIER(__package__);
     _Py_IDENTIFIER(__path__);
     _Py_IDENTIFIER(__name__);
@@ -1354,7 +1532,11 @@
                 goto error;
             }
         }
+
         base = PyUnicode_Substring(package, 0, last_dot);
+        if (base == NULL)
+            goto error;
+
         if (PyUnicode_GET_LENGTH(name) > 0) {
             PyObject *borrowed_dot, *seq = NULL;
 
@@ -1408,16 +1590,21 @@
         goto error_with_unlock;
     }
     else if (mod != NULL) {
-        PyObject *value;
+        PyObject *value = NULL;
+        PyObject *spec;
         int initializing = 0;
 
         Py_INCREF(mod);
         /* Optimization: only call _bootstrap._lock_unlock_module() if
-           __initializing__ is true.
-           NOTE: because of this, __initializing__ must be set *before*
+           __spec__._initializing is true.
+           NOTE: because of this, initializing must be set *before*
            stuffing the new module in sys.modules.
          */
-        value = _PyObject_GetAttrId(mod, &PyId___initializing__);
+        spec = _PyObject_GetAttrId(mod, &PyId___spec__);
+        if (spec != NULL) {
+            value = _PyObject_GetAttrId(spec, &PyId__initializing);
+            Py_DECREF(spec);
+        }
         if (value == NULL)
             PyErr_Clear();
         else {
@@ -1428,7 +1615,7 @@
         }
         if (initializing > 0) {
             /* _bootstrap._lock_unlock_module() releases the import lock */
-            value = _PyObject_CallMethodObjIdArgs(interp->importlib,
+            value = _PyObject_CallMethodIdObjArgs(interp->importlib,
                                             &PyId__lock_unlock_module, abs_name,
                                             NULL);
             if (value == NULL)
@@ -1446,7 +1633,7 @@
     }
     else {
         /* _bootstrap._find_and_load() releases the import lock */
-        mod = _PyObject_CallMethodObjIdArgs(interp->importlib,
+        mod = _PyObject_CallMethodIdObjArgs(interp->importlib,
                                             &PyId__find_and_load, abs_name,
                                             builtins_import, NULL);
         if (mod == NULL) {
@@ -1515,7 +1702,7 @@
         }
     }
     else {
-        final_mod = _PyObject_CallMethodObjIdArgs(interp->importlib,
+        final_mod = _PyObject_CallMethodIdObjArgs(interp->importlib,
                                                   &PyId__handle_fromlist, mod,
                                                   fromlist, builtins_import,
                                                   NULL);
@@ -1667,8 +1854,33 @@
     return r;
 }
 
+/*[clinic input]
+_imp.extension_suffixes
+
+Returns the list of file suffixes used to identify extension modules.
+[clinic start generated code]*/
+
+PyDoc_STRVAR(_imp_extension_suffixes__doc__,
+"extension_suffixes($module, /)\n"
+"--\n"
+"\n"
+"Returns the list of file suffixes used to identify extension modules.");
+
+#define _IMP_EXTENSION_SUFFIXES_METHODDEF    \
+    {"extension_suffixes", (PyCFunction)_imp_extension_suffixes, METH_NOARGS, _imp_extension_suffixes__doc__},
+
 static PyObject *
-imp_extension_suffixes(PyObject *self, PyObject *noargs)
+_imp_extension_suffixes_impl(PyModuleDef *module);
+
+static PyObject *
+_imp_extension_suffixes(PyModuleDef *module, PyObject *Py_UNUSED(ignored))
+{
+    return _imp_extension_suffixes_impl(module);
+}
+
+static PyObject *
+_imp_extension_suffixes_impl(PyModuleDef *module)
+/*[clinic end generated code: output=bb30a2438167798c input=ecdeeecfcb6f839e]*/
 {
     PyObject *list;
     const char *suffix;
@@ -1696,14 +1908,50 @@
     return list;
 }
 
+/*[clinic input]
+_imp.init_builtin
+
+    name: unicode
+    /
+
+Initializes a built-in module.
+[clinic start generated code]*/
+
+PyDoc_STRVAR(_imp_init_builtin__doc__,
+"init_builtin($module, name, /)\n"
+"--\n"
+"\n"
+"Initializes a built-in module.");
+
+#define _IMP_INIT_BUILTIN_METHODDEF    \
+    {"init_builtin", (PyCFunction)_imp_init_builtin, METH_VARARGS, _imp_init_builtin__doc__},
+
 static PyObject *
-imp_init_builtin(PyObject *self, PyObject *args)
+_imp_init_builtin_impl(PyModuleDef *module, PyObject *name);
+
+static PyObject *
+_imp_init_builtin(PyModuleDef *module, PyObject *args)
 {
+    PyObject *return_value = NULL;
     PyObject *name;
+
+    if (!PyArg_ParseTuple(args,
+        "U:init_builtin",
+        &name))
+        goto exit;
+    return_value = _imp_init_builtin_impl(module, name);
+
+exit:
+    return return_value;
+}
+
+static PyObject *
+_imp_init_builtin_impl(PyModuleDef *module, PyObject *name)
+/*[clinic end generated code: output=a0244948a43f8e26 input=f934d2231ec52a2e]*/
+{
     int ret;
     PyObject *m;
-    if (!PyArg_ParseTuple(args, "U:init_builtin", &name))
-        return NULL;
+
     ret = init_builtin(name);
     if (ret < 0)
         return NULL;
@@ -1716,14 +1964,50 @@
     return m;
 }
 
+/*[clinic input]
+_imp.init_frozen
+
+    name: unicode
+    /
+
+Initializes a frozen module.
+[clinic start generated code]*/
+
+PyDoc_STRVAR(_imp_init_frozen__doc__,
+"init_frozen($module, name, /)\n"
+"--\n"
+"\n"
+"Initializes a frozen module.");
+
+#define _IMP_INIT_FROZEN_METHODDEF    \
+    {"init_frozen", (PyCFunction)_imp_init_frozen, METH_VARARGS, _imp_init_frozen__doc__},
+
 static PyObject *
-imp_init_frozen(PyObject *self, PyObject *args)
+_imp_init_frozen_impl(PyModuleDef *module, PyObject *name);
+
+static PyObject *
+_imp_init_frozen(PyModuleDef *module, PyObject *args)
 {
+    PyObject *return_value = NULL;
     PyObject *name;
+
+    if (!PyArg_ParseTuple(args,
+        "U:init_frozen",
+        &name))
+        goto exit;
+    return_value = _imp_init_frozen_impl(module, name);
+
+exit:
+    return return_value;
+}
+
+static PyObject *
+_imp_init_frozen_impl(PyModuleDef *module, PyObject *name)
+/*[clinic end generated code: output=e4bc2bff296f8f22 input=13019adfc04f3fb3]*/
+{
     int ret;
     PyObject *m;
-    if (!PyArg_ParseTuple(args, "U:init_frozen", &name))
-        return NULL;
+
     ret = PyImport_ImportFrozenModuleObject(name);
     if (ret < 0)
         return NULL;
@@ -1736,61 +2020,239 @@
     return m;
 }
 
+/*[clinic input]
+_imp.get_frozen_object
+
+    name: unicode
+    /
+
+Create a code object for a frozen module.
+[clinic start generated code]*/
+
+PyDoc_STRVAR(_imp_get_frozen_object__doc__,
+"get_frozen_object($module, name, /)\n"
+"--\n"
+"\n"
+"Create a code object for a frozen module.");
+
+#define _IMP_GET_FROZEN_OBJECT_METHODDEF    \
+    {"get_frozen_object", (PyCFunction)_imp_get_frozen_object, METH_VARARGS, _imp_get_frozen_object__doc__},
+
 static PyObject *
-imp_get_frozen_object(PyObject *self, PyObject *args)
+_imp_get_frozen_object_impl(PyModuleDef *module, PyObject *name);
+
+static PyObject *
+_imp_get_frozen_object(PyModuleDef *module, PyObject *args)
 {
+    PyObject *return_value = NULL;
     PyObject *name;
 
-    if (!PyArg_ParseTuple(args, "U:get_frozen_object", &name))
-        return NULL;
+    if (!PyArg_ParseTuple(args,
+        "U:get_frozen_object",
+        &name))
+        goto exit;
+    return_value = _imp_get_frozen_object_impl(module, name);
+
+exit:
+    return return_value;
+}
+
+static PyObject *
+_imp_get_frozen_object_impl(PyModuleDef *module, PyObject *name)
+/*[clinic end generated code: output=4089ec702a9d70c5 input=ed689bc05358fdbd]*/
+{
     return get_frozen_object(name);
 }
 
+/*[clinic input]
+_imp.is_frozen_package
+
+    name: unicode
+    /
+
+Returns True if the module name is of a frozen package.
+[clinic start generated code]*/
+
+PyDoc_STRVAR(_imp_is_frozen_package__doc__,
+"is_frozen_package($module, name, /)\n"
+"--\n"
+"\n"
+"Returns True if the module name is of a frozen package.");
+
+#define _IMP_IS_FROZEN_PACKAGE_METHODDEF    \
+    {"is_frozen_package", (PyCFunction)_imp_is_frozen_package, METH_VARARGS, _imp_is_frozen_package__doc__},
+
 static PyObject *
-imp_is_frozen_package(PyObject *self, PyObject *args)
+_imp_is_frozen_package_impl(PyModuleDef *module, PyObject *name);
+
+static PyObject *
+_imp_is_frozen_package(PyModuleDef *module, PyObject *args)
 {
+    PyObject *return_value = NULL;
     PyObject *name;
 
-    if (!PyArg_ParseTuple(args, "U:is_frozen_package", &name))
-        return NULL;
+    if (!PyArg_ParseTuple(args,
+        "U:is_frozen_package",
+        &name))
+        goto exit;
+    return_value = _imp_is_frozen_package_impl(module, name);
+
+exit:
+    return return_value;
+}
+
+static PyObject *
+_imp_is_frozen_package_impl(PyModuleDef *module, PyObject *name)
+/*[clinic end generated code: output=86aab14dcd4b959b input=81b6cdecd080fbb8]*/
+{
     return is_frozen_package(name);
 }
 
+/*[clinic input]
+_imp.is_builtin
+
+    name: unicode
+    /
+
+Returns True if the module name corresponds to a built-in module.
+[clinic start generated code]*/
+
+PyDoc_STRVAR(_imp_is_builtin__doc__,
+"is_builtin($module, name, /)\n"
+"--\n"
+"\n"
+"Returns True if the module name corresponds to a built-in module.");
+
+#define _IMP_IS_BUILTIN_METHODDEF    \
+    {"is_builtin", (PyCFunction)_imp_is_builtin, METH_VARARGS, _imp_is_builtin__doc__},
+
 static PyObject *
-imp_is_builtin(PyObject *self, PyObject *args)
+_imp_is_builtin_impl(PyModuleDef *module, PyObject *name);
+
+static PyObject *
+_imp_is_builtin(PyModuleDef *module, PyObject *args)
 {
+    PyObject *return_value = NULL;
     PyObject *name;
-    if (!PyArg_ParseTuple(args, "U:is_builtin", &name))
-        return NULL;
-    return PyLong_FromLong(is_builtin(name));
+
+    if (!PyArg_ParseTuple(args,
+        "U:is_builtin",
+        &name))
+        goto exit;
+    return_value = _imp_is_builtin_impl(module, name);
+
+exit:
+    return return_value;
 }
 
 static PyObject *
-imp_is_frozen(PyObject *self, PyObject *args)
+_imp_is_builtin_impl(PyModuleDef *module, PyObject *name)
+/*[clinic end generated code: output=d5847f8cac50946e input=86befdac021dd1c7]*/
 {
+    return PyLong_FromLong(is_builtin(name));
+}
+
+/*[clinic input]
+_imp.is_frozen
+
+    name: unicode
+    /
+
+Returns True if the module name corresponds to a frozen module.
+[clinic start generated code]*/
+
+PyDoc_STRVAR(_imp_is_frozen__doc__,
+"is_frozen($module, name, /)\n"
+"--\n"
+"\n"
+"Returns True if the module name corresponds to a frozen module.");
+
+#define _IMP_IS_FROZEN_METHODDEF    \
+    {"is_frozen", (PyCFunction)_imp_is_frozen, METH_VARARGS, _imp_is_frozen__doc__},
+
+static PyObject *
+_imp_is_frozen_impl(PyModuleDef *module, PyObject *name);
+
+static PyObject *
+_imp_is_frozen(PyModuleDef *module, PyObject *args)
+{
+    PyObject *return_value = NULL;
     PyObject *name;
-    struct _frozen *p;
-    if (!PyArg_ParseTuple(args, "U:is_frozen", &name))
-        return NULL;
+
+    if (!PyArg_ParseTuple(args,
+        "U:is_frozen",
+        &name))
+        goto exit;
+    return_value = _imp_is_frozen_impl(module, name);
+
+exit:
+    return return_value;
+}
+
+static PyObject *
+_imp_is_frozen_impl(PyModuleDef *module, PyObject *name)
+/*[clinic end generated code: output=6691af884ba4987d input=7301dbca1897d66b]*/
+{
+    const struct _frozen *p;
+
     p = find_frozen(name);
     return PyBool_FromLong((long) (p == NULL ? 0 : p->size));
 }
 
 #ifdef HAVE_DYNAMIC_LOADING
 
+/*[clinic input]
+_imp.load_dynamic
+
+    name: unicode
+    path: fs_unicode
+    file: object = NULL
+    /
+
+Loads an extension module.
+[clinic start generated code]*/
+
+PyDoc_STRVAR(_imp_load_dynamic__doc__,
+"load_dynamic($module, name, path, file=None, /)\n"
+"--\n"
+"\n"
+"Loads an extension module.");
+
+#define _IMP_LOAD_DYNAMIC_METHODDEF    \
+    {"load_dynamic", (PyCFunction)_imp_load_dynamic, METH_VARARGS, _imp_load_dynamic__doc__},
+
 static PyObject *
-imp_load_dynamic(PyObject *self, PyObject *args)
+_imp_load_dynamic_impl(PyModuleDef *module, PyObject *name, PyObject *path, PyObject *file);
+
+static PyObject *
+_imp_load_dynamic(PyModuleDef *module, PyObject *args)
 {
-    PyObject *name, *pathname, *fob = NULL, *mod;
+    PyObject *return_value = NULL;
+    PyObject *name;
+    PyObject *path;
+    PyObject *file = NULL;
+
+    if (!PyArg_ParseTuple(args,
+        "UO&|O:load_dynamic",
+        &name, PyUnicode_FSDecoder, &path, &file))
+        goto exit;
+    return_value = _imp_load_dynamic_impl(module, name, path, file);
+
+exit:
+    return return_value;
+}
+
+static PyObject *
+_imp_load_dynamic_impl(PyModuleDef *module, PyObject *name, PyObject *path, PyObject *file)
+/*[clinic end generated code: output=81d11a1fbd1ea0a8 input=af64f06e4bad3526]*/
+{
+    PyObject *mod;
     FILE *fp;
 
-    if (!PyArg_ParseTuple(args, "UO&|O:load_dynamic",
-                          &name, PyUnicode_FSDecoder, &pathname, &fob))
-        return NULL;
-    if (fob != NULL) {
-        fp = _Py_fopen(pathname, "r");
+    if (file != NULL) {
+        fp = _Py_fopen_obj(path, "r");
         if (fp == NULL) {
-            Py_DECREF(pathname);
+            Py_DECREF(path);
             if (!PyErr_Occurred())
                 PyErr_SetFromErrno(PyExc_IOError);
             return NULL;
@@ -1798,8 +2260,8 @@
     }
     else
         fp = NULL;
-    mod = _PyImport_LoadDynamicModule(name, pathname, fp);
-    Py_DECREF(pathname);
+    mod = _PyImport_LoadDynamicModule(name, path, fp);
+    Py_DECREF(path);
     if (fp)
         fclose(fp);
     return mod;
@@ -1807,50 +2269,33 @@
 
 #endif /* HAVE_DYNAMIC_LOADING */
 
+/*[clinic input]
+dump buffer
+[clinic start generated code]*/
 
-/* Doc strings */
+#ifndef _IMP_LOAD_DYNAMIC_METHODDEF
+    #define _IMP_LOAD_DYNAMIC_METHODDEF
+#endif /* !defined(_IMP_LOAD_DYNAMIC_METHODDEF) */
+/*[clinic end generated code: output=d07c1d4a343a9579 input=524ce2e021e4eba6]*/
+
 
 PyDoc_STRVAR(doc_imp,
 "(Extremely) low-level import machinery bits as used by importlib and imp.");
 
-PyDoc_STRVAR(doc_extension_suffixes,
-"extension_suffixes() -> list of strings\n\
-Returns the list of file suffixes used to identify extension modules.");
-
-PyDoc_STRVAR(doc_lock_held,
-"lock_held() -> boolean\n\
-Return True if the import lock is currently held, else False.\n\
-On platforms without threads, return False.");
-
-PyDoc_STRVAR(doc_acquire_lock,
-"acquire_lock() -> None\n\
-Acquires the interpreter's import lock for the current thread.\n\
-This lock should be used by import hooks to ensure thread-safety\n\
-when importing modules.\n\
-On platforms without threads, this function does nothing.");
-
-PyDoc_STRVAR(doc_release_lock,
-"release_lock() -> None\n\
-Release the interpreter's import lock.\n\
-On platforms without threads, this function does nothing.");
-
 static PyMethodDef imp_methods[] = {
-    {"extension_suffixes", imp_extension_suffixes, METH_NOARGS,
-        doc_extension_suffixes},
-    {"lock_held",        imp_lock_held,    METH_NOARGS,  doc_lock_held},
-    {"acquire_lock", imp_acquire_lock, METH_NOARGS,  doc_acquire_lock},
-    {"release_lock", imp_release_lock, METH_NOARGS,  doc_release_lock},
-    {"get_frozen_object",       imp_get_frozen_object,  METH_VARARGS},
-    {"is_frozen_package",   imp_is_frozen_package,  METH_VARARGS},
-    {"init_builtin",            imp_init_builtin,       METH_VARARGS},
-    {"init_frozen",             imp_init_frozen,        METH_VARARGS},
-    {"is_builtin",              imp_is_builtin,         METH_VARARGS},
-    {"is_frozen",               imp_is_frozen,          METH_VARARGS},
-#ifdef HAVE_DYNAMIC_LOADING
-    {"load_dynamic",            imp_load_dynamic,       METH_VARARGS},
-#endif
-    {"_fix_co_filename",        imp_fix_co_filename,    METH_VARARGS},
-    {NULL,                      NULL}           /* sentinel */
+    _IMP_EXTENSION_SUFFIXES_METHODDEF
+    _IMP_LOCK_HELD_METHODDEF
+    _IMP_ACQUIRE_LOCK_METHODDEF
+    _IMP_RELEASE_LOCK_METHODDEF
+    _IMP_GET_FROZEN_OBJECT_METHODDEF
+    _IMP_IS_FROZEN_PACKAGE_METHODDEF
+    _IMP_INIT_BUILTIN_METHODDEF
+    _IMP_INIT_FROZEN_METHODDEF
+    _IMP_IS_BUILTIN_METHODDEF
+    _IMP_IS_FROZEN_METHODDEF
+    _IMP_LOAD_DYNAMIC_METHODDEF
+    _IMP__FIX_CO_FILENAME_METHODDEF
+    {NULL, NULL}  /* sentinel */
 };
 
 
@@ -1940,3 +2385,4 @@
 #ifdef __cplusplus
 }
 #endif
+
diff --git a/Python/importdl.c b/Python/importdl.c
index 0ea954c..b60f1c7 100644
--- a/Python/importdl.c
+++ b/Python/importdl.c
@@ -77,6 +77,8 @@
         PyObject *msg = PyUnicode_FromFormat("dynamic module does not define "
                                              "init function (PyInit_%s)",
                                              shortname);
+        if (msg == NULL)
+            goto error;
         PyErr_SetImportError(msg, name, path);
         Py_DECREF(msg);
         goto error;
diff --git a/Python/importdl.h b/Python/importdl.h
index 6b9cf75..6a51a91 100644
--- a/Python/importdl.h
+++ b/Python/importdl.h
@@ -18,13 +18,8 @@
 #include <windows.h>
 typedef FARPROC dl_funcptr;
 #else
-#if defined(PYOS_OS2) && !defined(PYCC_GCC)
-#include <os2def.h>
-typedef int (* APIENTRY dl_funcptr)();
-#else
 typedef void (*dl_funcptr)(void);
 #endif
-#endif
 
 
 #ifdef __cplusplus
diff --git a/Python/importlib.h b/Python/importlib.h
index cb6afc5..ef8bf27 100644
--- a/Python/importlib.h
+++ b/Python/importlib.h
@@ -1,1202 +1,915 @@
 /* Auto-generated by Modules/_freeze_importlib.c */
-unsigned char _Py_M__importlib[] = {
-    99,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,
-    0,64,0,0,0,115,206,3,0,0,100,0,0,90,0,0,
-    100,131,0,90,1,0,100,4,0,100,5,0,132,0,0,90,
+const unsigned char _Py_M__importlib[] = {
+    99,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,
+    0,64,0,0,0,115,228,4,0,0,100,0,0,90,0,0,
+    100,163,0,90,1,0,100,4,0,100,5,0,132,0,0,90,
     2,0,100,6,0,100,7,0,132,0,0,90,3,0,100,8,
     0,100,9,0,132,0,0,90,4,0,100,10,0,100,11,0,
     132,0,0,90,5,0,100,12,0,100,13,0,132,0,0,90,
     6,0,100,14,0,100,15,0,132,0,0,90,7,0,100,16,
     0,100,17,0,132,0,0,90,8,0,100,18,0,100,19,0,
-    132,0,0,90,9,0,100,20,0,100,21,0,100,22,0,132,
-    1,0,90,10,0,100,23,0,100,24,0,132,0,0,90,11,
-    0,101,12,0,101,11,0,106,13,0,131,1,0,90,14,0,
-    100,25,0,100,26,0,132,0,0,90,15,0,105,0,0,90,
-    16,0,105,0,0,90,17,0,71,100,27,0,100,28,0,132,
-    0,0,100,28,0,101,18,0,131,3,0,90,19,0,71,100,
-    29,0,100,30,0,132,0,0,100,30,0,131,2,0,90,20,
-    0,71,100,31,0,100,32,0,132,0,0,100,32,0,131,2,
-    0,90,21,0,100,33,0,100,34,0,132,0,0,90,22,0,
-    100,35,0,100,36,0,132,0,0,90,23,0,100,37,0,100,
-    38,0,132,0,0,90,24,0,100,39,0,101,25,0,100,40,
-    0,131,1,0,100,41,0,62,66,101,25,0,100,42,0,131,
-    1,0,100,43,0,62,66,90,26,0,101,27,0,100,44,0,
-    100,45,0,132,0,0,101,28,0,100,46,0,100,47,0,100,
-    48,0,131,3,0,68,131,1,0,131,1,0,90,29,0,100,
-    49,0,90,30,0,100,50,0,103,1,0,90,31,0,100,51,
-    0,103,1,0,90,32,0,100,52,0,103,1,0,90,33,0,
-    100,130,0,100,53,0,100,54,0,132,1,0,90,35,0,100,
-    55,0,100,56,0,132,0,0,90,36,0,100,57,0,100,58,
-    0,132,0,0,90,37,0,100,59,0,100,60,0,100,61,0,
-    100,62,0,132,0,1,90,38,0,100,63,0,100,64,0,132,
-    0,0,90,39,0,100,65,0,100,66,0,132,0,0,90,40,
-    0,100,67,0,100,68,0,132,0,0,90,41,0,100,69,0,
-    100,70,0,132,0,0,90,42,0,100,71,0,100,72,0,132,
-    0,0,90,43,0,100,73,0,100,74,0,132,0,0,90,44,
-    0,100,75,0,100,76,0,132,0,0,90,45,0,71,100,77,
-    0,100,78,0,132,0,0,100,78,0,131,2,0,90,46,0,
-    71,100,79,0,100,80,0,132,0,0,100,80,0,131,2,0,
-    90,47,0,71,100,81,0,100,82,0,132,0,0,100,82,0,
-    131,2,0,90,48,0,71,100,83,0,100,84,0,132,0,0,
-    100,84,0,131,2,0,90,49,0,71,100,85,0,100,86,0,
-    132,0,0,100,86,0,101,49,0,131,3,0,90,50,0,71,
-    100,87,0,100,88,0,132,0,0,100,88,0,131,2,0,90,
-    51,0,71,100,89,0,100,90,0,132,0,0,100,90,0,101,
-    51,0,101,50,0,131,4,0,90,52,0,71,100,91,0,100,
-    92,0,132,0,0,100,92,0,101,51,0,101,49,0,131,4,
-    0,90,53,0,103,0,0,90,54,0,71,100,93,0,100,94,
-    0,132,0,0,100,94,0,131,2,0,90,55,0,71,100,95,
-    0,100,96,0,132,0,0,100,96,0,131,2,0,90,56,0,
-    71,100,97,0,100,98,0,132,0,0,100,98,0,131,2,0,
-    90,57,0,71,100,99,0,100,100,0,132,0,0,100,100,0,
-    131,2,0,90,58,0,71,100,101,0,100,102,0,132,0,0,
-    100,102,0,131,2,0,90,59,0,71,100,103,0,100,104,0,
-    132,0,0,100,104,0,131,2,0,90,60,0,100,105,0,100,
-    106,0,132,0,0,90,61,0,100,107,0,100,108,0,132,0,
-    0,90,62,0,100,109,0,100,110,0,132,0,0,90,63,0,
-    100,111,0,90,64,0,100,112,0,100,113,0,132,0,0,90,
-    65,0,100,114,0,100,115,0,132,0,0,90,66,0,100,130,
-    0,100,46,0,100,116,0,100,117,0,132,2,0,90,67,0,
-    100,118,0,100,119,0,132,0,0,90,68,0,100,120,0,100,
-    121,0,132,0,0,90,69,0,100,122,0,100,123,0,132,0,
-    0,90,70,0,100,130,0,100,130,0,102,0,0,100,46,0,
-    100,124,0,100,125,0,132,4,0,90,71,0,100,126,0,100,
-    127,0,132,0,0,90,72,0,100,128,0,100,129,0,132,0,
-    0,90,73,0,100,130,0,83,40,132,0,0,0,117,83,1,
-    0,0,67,111,114,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,
-    10,10,84,104,105,115,32,109,111,100,117,108,101,32,105,115,
-    32,78,79,84,32,109,101,97,110,116,32,116,111,32,98,101,
-    32,100,105,114,101,99,116,108,121,32,105,109,112,111,114,116,
-    101,100,33,32,73,116,32,104,97,115,32,98,101,101,110,32,
-    100,101,115,105,103,110,101,100,32,115,117,99,104,10,116,104,
-    97,116,32,105,116,32,99,97,110,32,98,101,32,98,111,111,
-    116,115,116,114,97,112,112,101,100,32,105,110,116,111,32,80,
-    121,116,104,111,110,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,32,65,115,10,115,117,99,104,32,105,
-    116,32,114,101,113,117,105,114,101,115,32,116,104,101,32,105,
-    110,106,101,99,116,105,111,110,32,111,102,32,115,112,101,99,
-    105,102,105,99,32,109,111,100,117,108,101,115,32,97,110,100,
-    32,97,116,116,114,105,98,117,116,101,115,32,105,110,32,111,
-    114,100,101,114,32,116,111,10,119,111,114,107,46,32,79,110,
-    101,32,115,104,111,117,108,100,32,117,115,101,32,105,109,112,
-    111,114,116,108,105,98,32,97,115,32,116,104,101,32,112,117,
-    98,108,105,99,45,102,97,99,105,110,103,32,118,101,114,115,
-    105,111,110,32,111,102,32,116,104,105,115,32,109,111,100,117,
-    108,101,46,10,10,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,99,0,0,0,0,0,0,0,0,1,0,0,0,
-    2,0,0,0,67,0,0,0,115,49,0,0,0,116,0,0,
-    106,1,0,106,2,0,116,3,0,131,1,0,114,33,0,100,
-    1,0,100,2,0,132,0,0,125,0,0,110,12,0,100,3,
-    0,100,2,0,132,0,0,125,0,0,124,0,0,83,40,4,
-    0,0,0,78,99,0,0,0,0,0,0,0,0,0,0,0,
-    0,2,0,0,0,83,0,0,0,115,13,0,0,0,100,1,
-    0,116,0,0,106,1,0,107,6,0,83,40,2,0,0,0,
-    117,53,0,0,0,84,114,117,101,32,105,102,32,102,105,108,
-    101,110,97,109,101,115,32,109,117,115,116,32,98,101,32,99,
-    104,101,99,107,101,100,32,99,97,115,101,45,105,110,115,101,
-    110,115,105,116,105,118,101,108,121,46,115,12,0,0,0,80,
-    89,84,72,79,78,67,65,83,69,79,75,40,2,0,0,0,
-    117,3,0,0,0,95,111,115,117,7,0,0,0,101,110,118,
-    105,114,111,110,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,95,114,101,108,97,120,
-    95,99,97,115,101,34,0,0,0,115,2,0,0,0,0,2,
-    117,37,0,0,0,95,109,97,107,101,95,114,101,108,97,120,
-    95,99,97,115,101,46,60,108,111,99,97,108,115,62,46,95,
-    114,101,108,97,120,95,99,97,115,101,99,0,0,0,0,0,
-    0,0,0,0,0,0,0,1,0,0,0,83,0,0,0,115,
-    4,0,0,0,100,1,0,83,40,2,0,0,0,117,53,0,
-    0,0,84,114,117,101,32,105,102,32,102,105,108,101,110,97,
-    109,101,115,32,109,117,115,116,32,98,101,32,99,104,101,99,
-    107,101,100,32,99,97,115,101,45,105,110,115,101,110,115,105,
-    116,105,118,101,108,121,46,70,40,1,0,0,0,117,5,0,
-    0,0,70,97,108,115,101,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,95,114,101,
-    108,97,120,95,99,97,115,101,38,0,0,0,115,2,0,0,
-    0,0,2,40,4,0,0,0,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,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,40,1,0,0,
-    0,117,11,0,0,0,95,114,101,108,97,120,95,99,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,16,0,
-    0,0,95,109,97,107,101,95,114,101,108,97,120,95,99,97,
-    115,101,32,0,0,0,115,8,0,0,0,0,1,18,1,15,
-    4,12,3,117,16,0,0,0,95,109,97,107,101,95,114,101,
-    108,97,120,95,99,97,115,101,99,1,0,0,0,0,0,0,
-    0,2,0,0,0,3,0,0,0,67,0,0,0,115,108,0,
-    0,0,116,0,0,124,0,0,131,1,0,125,0,0,103,0,
-    0,125,1,0,124,1,0,106,1,0,124,0,0,100,1,0,
-    64,131,1,0,1,124,1,0,106,1,0,124,0,0,100,2,
-    0,63,100,1,0,64,131,1,0,1,124,1,0,106,1,0,
-    124,0,0,100,3,0,63,100,1,0,64,131,1,0,1,124,
-    1,0,106,1,0,124,0,0,100,4,0,63,100,1,0,64,
-    131,1,0,1,116,2,0,124,1,0,131,1,0,83,40,5,
-    0,0,0,117,111,0,0,0,67,111,110,118,101,114,116,32,
-    97,32,51,50,45,98,105,116,32,105,110,116,101,103,101,114,
-    32,116,111,32,108,105,116,116,108,101,45,101,110,100,105,97,
-    110,46,10,10,32,32,32,32,88,88,88,32,84,101,109,112,
-    111,114,97,114,121,32,117,110,116,105,108,32,109,97,114,115,
-    104,97,108,39,115,32,108,111,110,103,32,102,117,110,99,116,
-    105,111,110,115,32,97,114,101,32,101,120,112,111,115,101,100,
-    46,10,10,32,32,32,32,105,255,0,0,0,105,8,0,0,
-    0,105,16,0,0,0,105,24,0,0,0,40,3,0,0,0,
-    117,3,0,0,0,105,110,116,117,6,0,0,0,97,112,112,
-    101,110,100,117,9,0,0,0,98,121,116,101,97,114,114,97,
-    121,40,2,0,0,0,117,1,0,0,0,120,117,9,0,0,
-    0,105,110,116,95,98,121,116,101,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,7,0,0,0,95,119,95,108,111,
-    110,103,45,0,0,0,115,14,0,0,0,0,6,12,1,6,
-    1,17,1,21,1,21,1,21,1,117,7,0,0,0,95,119,
-    95,108,111,110,103,99,1,0,0,0,0,0,0,0,2,0,
-    0,0,3,0,0,0,67,0,0,0,115,68,0,0,0,124,
-    0,0,100,1,0,25,125,1,0,124,1,0,124,0,0,100,
-    2,0,25,100,3,0,62,79,125,1,0,124,1,0,124,0,
-    0,100,4,0,25,100,5,0,62,79,125,1,0,124,1,0,
-    124,0,0,100,6,0,25,100,7,0,62,79,125,1,0,124,
-    1,0,83,40,8,0,0,0,117,115,0,0,0,67,111,110,
-    118,101,114,116,32,52,32,98,121,116,101,115,32,105,110,32,
-    108,105,116,116,108,101,45,101,110,100,105,97,110,32,116,111,
-    32,97,110,32,105,110,116,101,103,101,114,46,10,10,32,32,
-    32,32,88,88,88,32,84,101,109,112,111,114,97,114,121,32,
-    117,110,116,105,108,32,109,97,114,115,104,97,108,39,115,32,
-    108,111,110,103,32,102,117,110,99,116,105,111,110,32,97,114,
-    101,32,101,120,112,111,115,101,100,46,10,10,32,32,32,32,
-    105,0,0,0,0,105,1,0,0,0,105,8,0,0,0,105,
-    2,0,0,0,105,16,0,0,0,105,3,0,0,0,105,24,
-    0,0,0,40,0,0,0,0,40,2,0,0,0,117,9,0,
-    0,0,105,110,116,95,98,121,116,101,115,117,1,0,0,0,
-    120,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,114,95,108,111,110,103,61,0,0,0,115,10,0,
-    0,0,0,6,10,1,18,1,18,1,18,1,117,7,0,0,
-    0,95,114,95,108,111,110,103,99,0,0,0,0,0,0,0,
-    0,3,0,0,0,4,0,0,0,71,0,0,0,115,103,0,
-    0,0,103,0,0,125,1,0,120,71,0,124,0,0,68,93,
-    63,0,125,2,0,124,2,0,115,31,0,113,13,0,110,0,
-    0,124,1,0,106,0,0,124,2,0,131,1,0,1,124,2,
-    0,100,4,0,25,116,1,0,107,7,0,114,13,0,124,1,
-    0,106,0,0,116,2,0,131,1,0,1,113,13,0,113,13,
-    0,87,100,2,0,106,3,0,124,1,0,100,3,0,100,5,
-    0,133,2,0,25,131,1,0,83,40,6,0,0,0,117,31,
-    0,0,0,82,101,112,108,97,99,101,109,101,110,116,32,102,
-    111,114,32,111,115,46,112,97,116,104,46,106,111,105,110,40,
-    41,46,105,1,0,0,0,117,0,0,0,0,78,105,255,255,
-    255,255,105,255,255,255,255,40,4,0,0,0,117,6,0,0,
-    0,97,112,112,101,110,100,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,4,0,0,0,106,111,105,
-    110,40,3,0,0,0,117,10,0,0,0,112,97,116,104,95,
-    112,97,114,116,115,117,9,0,0,0,110,101,119,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,10,0,0,0,95,112,97,
-    116,104,95,106,111,105,110,74,0,0,0,115,16,0,0,0,
-    0,2,6,1,13,1,6,1,6,1,13,1,16,1,20,1,
-    117,10,0,0,0,95,112,97,116,104,95,106,111,105,110,99,
-    1,0,0,0,0,0,0,0,6,0,0,0,3,0,0,0,
-    67,0,0,0,115,85,0,0,0,120,48,0,116,0,0,124,
-    0,0,131,1,0,68,93,28,0,125,1,0,124,1,0,116,
-    1,0,107,6,0,114,13,0,124,1,0,125,2,0,80,113,
-    13,0,113,13,0,87,116,2,0,125,2,0,124,0,0,106,
-    3,0,124,2,0,131,1,0,92,3,0,125,3,0,125,4,
-    0,125,5,0,124,3,0,124,5,0,102,2,0,83,40,1,
-    0,0,0,117,32,0,0,0,82,101,112,108,97,99,101,109,
-    101,110,116,32,102,111,114,32,111,115,46,112,97,116,104,46,
-    115,112,108,105,116,40,41,46,40,4,0,0,0,117,8,0,
-    0,0,114,101,118,101,114,115,101,100,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,10,0,0,0,
-    114,112,97,114,116,105,116,105,111,110,40,6,0,0,0,117,
-    4,0,0,0,112,97,116,104,117,1,0,0,0,120,117,3,
-    0,0,0,115,101,112,117,5,0,0,0,102,114,111,110,116,
-    117,1,0,0,0,95,117,4,0,0,0,116,97,105,108,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,115,112,108,105,116,86,0,0,0,115,
-    14,0,0,0,0,2,19,1,12,1,6,1,8,2,6,1,
-    24,1,117,11,0,0,0,95,112,97,116,104,95,115,112,108,
-    105,116,99,2,0,0,0,0,0,0,0,3,0,0,0,11,
-    0,0,0,67,0,0,0,115,61,0,0,0,121,19,0,116,
-    0,0,106,1,0,124,0,0,131,1,0,125,2,0,87,110,
-    22,0,4,116,2,0,107,10,0,114,43,0,1,1,1,100,
-    2,0,83,89,110,1,0,88,124,2,0,106,4,0,100,1,
-    0,64,124,1,0,107,2,0,83,40,3,0,0,0,117,49,
-    0,0,0,84,101,115,116,32,119,104,101,116,104,101,114,32,
-    116,104,101,32,112,97,116,104,32,105,115,32,116,104,101,32,
-    115,112,101,99,105,102,105,101,100,32,109,111,100,101,32,116,
-    121,112,101,46,105,0,240,0,0,70,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,79,83,69,114,114,111,114,117,5,0,0,
-    0,70,97,108,115,101,117,7,0,0,0,115,116,95,109,111,
-    100,101,40,3,0,0,0,117,4,0,0,0,112,97,116,104,
-    117,4,0,0,0,109,111,100,101,117,9,0,0,0,115,116,
-    97,116,95,105,110,102,111,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,112,97,116,104,95,105,115,
-    95,109,111,100,101,95,116,121,112,101,98,0,0,0,115,10,
-    0,0,0,0,2,3,1,19,1,13,1,9,1,117,18,0,
-    0,0,95,112,97,116,104,95,105,115,95,109,111,100,101,95,
-    116,121,112,101,99,1,0,0,0,0,0,0,0,1,0,0,
+    132,0,0,90,9,0,100,20,0,100,21,0,132,0,0,90,
+    10,0,100,22,0,100,23,0,100,24,0,132,1,0,90,11,
+    0,100,25,0,100,26,0,132,0,0,90,12,0,100,27,0,
+    100,28,0,132,0,0,90,13,0,101,14,0,101,12,0,106,
+    15,0,131,1,0,90,16,0,71,100,29,0,100,30,0,132,
+    0,0,100,30,0,131,2,0,90,17,0,105,0,0,90,18,
+    0,105,0,0,90,19,0,71,100,31,0,100,32,0,132,0,
+    0,100,32,0,101,20,0,131,3,0,90,21,0,71,100,33,
+    0,100,34,0,132,0,0,100,34,0,131,2,0,90,22,0,
+    71,100,35,0,100,36,0,132,0,0,100,36,0,131,2,0,
+    90,23,0,71,100,37,0,100,38,0,132,0,0,100,38,0,
+    131,2,0,90,24,0,100,39,0,100,40,0,132,0,0,90,
+    25,0,100,41,0,100,42,0,132,0,0,90,26,0,100,43,
+    0,100,44,0,132,0,0,90,27,0,100,45,0,106,28,0,
+    100,46,0,100,47,0,131,2,0,100,48,0,23,90,29,0,
+    101,30,0,106,31,0,101,29,0,100,47,0,131,2,0,90,
+    32,0,100,49,0,90,33,0,100,50,0,103,1,0,90,34,
+    0,100,51,0,103,1,0,90,35,0,100,52,0,103,1,0,
+    90,36,0,100,53,0,100,54,0,100,55,0,132,1,0,90,
+    37,0,100,56,0,100,57,0,132,0,0,90,38,0,100,58,
+    0,100,59,0,132,0,0,90,39,0,100,60,0,100,61,0,
+    132,0,0,90,40,0,100,62,0,100,63,0,100,64,0,100,
+    65,0,132,0,1,90,41,0,100,66,0,100,67,0,132,0,
+    0,90,42,0,100,68,0,100,69,0,132,0,0,90,43,0,
+    100,70,0,100,71,0,132,0,0,90,44,0,100,72,0,100,
+    73,0,132,0,0,90,45,0,100,74,0,100,75,0,132,0,
+    0,90,46,0,100,53,0,100,53,0,100,53,0,100,76,0,
+    100,77,0,132,3,0,90,47,0,100,53,0,100,53,0,100,
+    53,0,100,78,0,100,79,0,132,3,0,90,48,0,100,80,
+    0,100,80,0,100,81,0,100,82,0,132,2,0,90,49,0,
+    100,83,0,100,84,0,132,0,0,90,50,0,100,85,0,100,
+    86,0,132,0,0,90,51,0,71,100,87,0,100,88,0,132,
+    0,0,100,88,0,131,2,0,90,52,0,71,100,89,0,100,
+    90,0,132,0,0,100,90,0,131,2,0,90,53,0,100,91,
+    0,100,53,0,100,92,0,100,53,0,100,93,0,100,94,0,
+    132,0,2,90,54,0,101,55,0,131,0,0,90,56,0,100,
+    53,0,100,95,0,100,53,0,100,96,0,101,56,0,100,97,
+    0,100,98,0,132,1,2,90,57,0,100,53,0,100,53,0,
+    100,99,0,100,100,0,132,2,0,90,58,0,71,100,101,0,
+    100,102,0,132,0,0,100,102,0,131,2,0,90,59,0,100,
+    53,0,100,103,0,100,104,0,132,1,0,90,60,0,71,100,
+    105,0,100,106,0,132,0,0,100,106,0,131,2,0,90,61,
+    0,71,100,107,0,100,108,0,132,0,0,100,108,0,131,2,
+    0,90,62,0,71,100,109,0,100,110,0,132,0,0,100,110,
+    0,131,2,0,90,63,0,71,100,111,0,100,112,0,132,0,
+    0,100,112,0,131,2,0,90,64,0,71,100,113,0,100,114,
+    0,132,0,0,100,114,0,101,64,0,131,3,0,90,65,0,
+    71,100,115,0,100,116,0,132,0,0,100,116,0,131,2,0,
+    90,66,0,71,100,117,0,100,118,0,132,0,0,100,118,0,
+    101,66,0,101,65,0,131,4,0,90,67,0,71,100,119,0,
+    100,120,0,132,0,0,100,120,0,101,66,0,101,64,0,131,
+    4,0,90,68,0,103,0,0,90,69,0,71,100,121,0,100,
+    122,0,132,0,0,100,122,0,131,2,0,90,70,0,71,100,
+    123,0,100,124,0,132,0,0,100,124,0,131,2,0,90,71,
+    0,71,100,125,0,100,126,0,132,0,0,100,126,0,131,2,
+    0,90,72,0,71,100,127,0,100,128,0,132,0,0,100,128,
+    0,131,2,0,90,73,0,71,100,129,0,100,130,0,132,0,
+    0,100,130,0,131,2,0,90,74,0,71,100,131,0,100,132,
+    0,132,0,0,100,132,0,131,2,0,90,75,0,100,133,0,
+    100,134,0,132,0,0,90,76,0,100,135,0,100,136,0,132,
+    0,0,90,77,0,100,53,0,100,137,0,100,138,0,132,1,
+    0,90,78,0,100,139,0,100,140,0,132,0,0,90,79,0,
+    100,141,0,90,80,0,101,80,0,100,142,0,23,90,81,0,
+    100,143,0,100,144,0,132,0,0,90,82,0,100,145,0,100,
+    146,0,132,0,0,90,83,0,100,53,0,100,80,0,100,147,
+    0,100,148,0,132,2,0,90,84,0,100,149,0,100,150,0,
+    132,0,0,90,85,0,100,151,0,100,152,0,132,0,0,90,
+    86,0,100,153,0,100,154,0,132,0,0,90,87,0,100,53,
+    0,100,53,0,102,0,0,100,80,0,100,155,0,100,156,0,
+    132,4,0,90,88,0,100,157,0,100,158,0,132,0,0,90,
+    89,0,100,159,0,100,160,0,132,0,0,90,90,0,100,161,
+    0,100,162,0,132,0,0,90,91,0,100,53,0,83,41,164,
+    97,83,1,0,0,67,111,114,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,10,10,84,104,105,115,32,109,111,100,117,108,101,
+    32,105,115,32,78,79,84,32,109,101,97,110,116,32,116,111,
+    32,98,101,32,100,105,114,101,99,116,108,121,32,105,109,112,
+    111,114,116,101,100,33,32,73,116,32,104,97,115,32,98,101,
+    101,110,32,100,101,115,105,103,110,101,100,32,115,117,99,104,
+    10,116,104,97,116,32,105,116,32,99,97,110,32,98,101,32,
+    98,111,111,116,115,116,114,97,112,112,101,100,32,105,110,116,
+    111,32,80,121,116,104,111,110,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,32,65,115,10,115,117,99,
+    104,32,105,116,32,114,101,113,117,105,114,101,115,32,116,104,
+    101,32,105,110,106,101,99,116,105,111,110,32,111,102,32,115,
+    112,101,99,105,102,105,99,32,109,111,100,117,108,101,115,32,
+    97,110,100,32,97,116,116,114,105,98,117,116,101,115,32,105,
+    110,32,111,114,100,101,114,32,116,111,10,119,111,114,107,46,
+    32,79,110,101,32,115,104,111,117,108,100,32,117,115,101,32,
+    105,109,112,111,114,116,108,105,98,32,97,115,32,116,104,101,
+    32,112,117,98,108,105,99,45,102,97,99,105,110,103,32,118,
+    101,114,115,105,111,110,32,111,102,32,116,104,105,115,32,109,
+    111,100,117,108,101,46,10,10,218,3,119,105,110,218,6,99,
+    121,103,119,105,110,218,6,100,97,114,119,105,110,99,0,0,
+    0,0,0,0,0,0,1,0,0,0,2,0,0,0,67,0,
+    0,0,115,49,0,0,0,116,0,0,106,1,0,106,2,0,
+    116,3,0,131,1,0,114,33,0,100,1,0,100,2,0,132,
+    0,0,125,0,0,110,12,0,100,3,0,100,2,0,132,0,
+    0,125,0,0,124,0,0,83,41,4,78,99,0,0,0,0,
+    0,0,0,0,0,0,0,0,2,0,0,0,83,0,0,0,
+    115,13,0,0,0,100,1,0,116,0,0,106,1,0,107,6,
+    0,83,41,2,122,53,84,114,117,101,32,105,102,32,102,105,
+    108,101,110,97,109,101,115,32,109,117,115,116,32,98,101,32,
+    99,104,101,99,107,101,100,32,99,97,115,101,45,105,110,115,
+    101,110,115,105,116,105,118,101,108,121,46,115,12,0,0,0,
+    80,89,84,72,79,78,67,65,83,69,79,75,41,2,218,3,
+    95,111,115,90,7,101,110,118,105,114,111,110,169,0,114,4,
+    0,0,0,114,4,0,0,0,250,29,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,218,11,95,114,101,108,97,120,95,
+    99,97,115,101,30,0,0,0,115,2,0,0,0,0,2,122,
+    37,95,109,97,107,101,95,114,101,108,97,120,95,99,97,115,
+    101,46,60,108,111,99,97,108,115,62,46,95,114,101,108,97,
+    120,95,99,97,115,101,99,0,0,0,0,0,0,0,0,0,
+    0,0,0,1,0,0,0,83,0,0,0,115,4,0,0,0,
+    100,1,0,83,41,2,122,53,84,114,117,101,32,105,102,32,
+    102,105,108,101,110,97,109,101,115,32,109,117,115,116,32,98,
+    101,32,99,104,101,99,107,101,100,32,99,97,115,101,45,105,
+    110,115,101,110,115,105,116,105,118,101,108,121,46,70,114,4,
+    0,0,0,114,4,0,0,0,114,4,0,0,0,114,4,0,
+    0,0,114,5,0,0,0,114,6,0,0,0,34,0,0,0,
+    115,2,0,0,0,0,2,41,4,218,3,115,121,115,218,8,
+    112,108,97,116,102,111,114,109,218,10,115,116,97,114,116,115,
+    119,105,116,104,218,27,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,41,1,114,6,0,0,0,114,4,0,0,0,114,4,0,
+    0,0,114,5,0,0,0,218,16,95,109,97,107,101,95,114,
+    101,108,97,120,95,99,97,115,101,28,0,0,0,115,8,0,
+    0,0,0,1,18,1,15,4,12,3,114,11,0,0,0,99,
+    1,0,0,0,0,0,0,0,1,0,0,0,3,0,0,0,
+    67,0,0,0,115,26,0,0,0,116,0,0,124,0,0,131,
+    1,0,100,1,0,64,106,1,0,100,2,0,100,3,0,131,
+    2,0,83,41,4,122,42,67,111,110,118,101,114,116,32,97,
+    32,51,50,45,98,105,116,32,105,110,116,101,103,101,114,32,
+    116,111,32,108,105,116,116,108,101,45,101,110,100,105,97,110,
+    46,108,3,0,0,0,255,127,255,127,3,0,233,4,0,0,
+    0,218,6,108,105,116,116,108,101,41,2,218,3,105,110,116,
+    218,8,116,111,95,98,121,116,101,115,41,1,218,1,120,114,
+    4,0,0,0,114,4,0,0,0,114,5,0,0,0,218,7,
+    95,119,95,108,111,110,103,40,0,0,0,115,2,0,0,0,
+    0,2,114,17,0,0,0,99,1,0,0,0,0,0,0,0,
+    1,0,0,0,3,0,0,0,67,0,0,0,115,16,0,0,
+    0,116,0,0,106,1,0,124,0,0,100,1,0,131,2,0,
+    83,41,2,122,47,67,111,110,118,101,114,116,32,52,32,98,
+    121,116,101,115,32,105,110,32,108,105,116,116,108,101,45,101,
+    110,100,105,97,110,32,116,111,32,97,110,32,105,110,116,101,
+    103,101,114,46,114,13,0,0,0,41,2,114,14,0,0,0,
+    218,10,102,114,111,109,95,98,121,116,101,115,41,1,90,9,
+    105,110,116,95,98,121,116,101,115,114,4,0,0,0,114,4,
+    0,0,0,114,5,0,0,0,218,7,95,114,95,108,111,110,
+    103,45,0,0,0,115,2,0,0,0,0,2,114,19,0,0,
+    0,99,0,0,0,0,0,0,0,0,1,0,0,0,3,0,
+    0,0,71,0,0,0,115,26,0,0,0,116,0,0,106,1,
+    0,100,1,0,100,2,0,132,0,0,124,0,0,68,131,1,
+    0,131,1,0,83,41,3,122,31,82,101,112,108,97,99,101,
+    109,101,110,116,32,102,111,114,32,111,115,46,112,97,116,104,
+    46,106,111,105,110,40,41,46,99,1,0,0,0,0,0,0,
+    0,2,0,0,0,4,0,0,0,83,0,0,0,115,37,0,
+    0,0,103,0,0,124,0,0,93,27,0,125,1,0,124,1,
+    0,114,6,0,124,1,0,106,0,0,116,1,0,131,1,0,
+    145,2,0,113,6,0,83,114,4,0,0,0,41,2,218,6,
+    114,115,116,114,105,112,218,15,112,97,116,104,95,115,101,112,
+    97,114,97,116,111,114,115,41,2,218,2,46,48,218,4,112,
+    97,114,116,114,4,0,0,0,114,4,0,0,0,114,5,0,
+    0,0,250,10,60,108,105,115,116,99,111,109,112,62,52,0,
+    0,0,115,2,0,0,0,9,1,122,30,95,112,97,116,104,
+    95,106,111,105,110,46,60,108,111,99,97,108,115,62,46,60,
+    108,105,115,116,99,111,109,112,62,41,2,218,8,112,97,116,
+    104,95,115,101,112,218,4,106,111,105,110,41,1,218,10,112,
+    97,116,104,95,112,97,114,116,115,114,4,0,0,0,114,4,
+    0,0,0,114,5,0,0,0,218,10,95,112,97,116,104,95,
+    106,111,105,110,50,0,0,0,115,4,0,0,0,0,2,15,
+    1,114,28,0,0,0,99,1,0,0,0,0,0,0,0,5,
+    0,0,0,5,0,0,0,67,0,0,0,115,134,0,0,0,
+    116,0,0,116,1,0,131,1,0,100,1,0,107,2,0,114,
+    52,0,124,0,0,106,2,0,116,3,0,131,1,0,92,3,
+    0,125,1,0,125,2,0,125,3,0,124,1,0,124,3,0,
+    102,2,0,83,120,69,0,116,4,0,124,0,0,131,1,0,
+    68,93,55,0,125,4,0,124,4,0,116,1,0,107,6,0,
+    114,65,0,124,0,0,106,5,0,124,4,0,100,2,0,100,
+    1,0,131,1,1,92,2,0,125,1,0,125,3,0,124,1,
+    0,124,3,0,102,2,0,83,113,65,0,87,100,3,0,124,
+    0,0,102,2,0,83,41,4,122,32,82,101,112,108,97,99,
+    101,109,101,110,116,32,102,111,114,32,111,115,46,112,97,116,
+    104,46,115,112,108,105,116,40,41,46,233,1,0,0,0,90,
+    8,109,97,120,115,112,108,105,116,218,0,41,6,218,3,108,
+    101,110,114,21,0,0,0,218,10,114,112,97,114,116,105,116,
+    105,111,110,114,25,0,0,0,218,8,114,101,118,101,114,115,
+    101,100,218,6,114,115,112,108,105,116,41,5,218,4,112,97,
+    116,104,90,5,102,114,111,110,116,218,1,95,218,4,116,97,
+    105,108,114,16,0,0,0,114,4,0,0,0,114,4,0,0,
+    0,114,5,0,0,0,218,11,95,112,97,116,104,95,115,112,
+    108,105,116,56,0,0,0,115,16,0,0,0,0,2,18,1,
+    24,1,10,1,19,1,12,1,27,1,14,1,114,38,0,0,
+    0,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,116,0,0,106,1,
+    0,124,0,0,131,1,0,83,41,1,122,126,83,116,97,116,
+    32,116,104,101,32,112,97,116,104,46,10,10,32,32,32,32,
+    77,97,100,101,32,97,32,115,101,112,97,114,97,116,101,32,
+    102,117,110,99,116,105,111,110,32,116,111,32,109,97,107,101,
+    32,105,116,32,101,97,115,105,101,114,32,116,111,32,111,118,
+    101,114,114,105,100,101,32,105,110,32,101,120,112,101,114,105,
+    109,101,110,116,115,10,32,32,32,32,40,101,46,103,46,32,
+    99,97,99,104,101,32,115,116,97,116,32,114,101,115,117,108,
+    116,115,41,46,10,10,32,32,32,32,41,2,114,3,0,0,
+    0,90,4,115,116,97,116,41,1,114,35,0,0,0,114,4,
+    0,0,0,114,4,0,0,0,114,5,0,0,0,218,10,95,
+    112,97,116,104,95,115,116,97,116,68,0,0,0,115,2,0,
+    0,0,0,7,114,39,0,0,0,99,2,0,0,0,0,0,
+    0,0,3,0,0,0,11,0,0,0,67,0,0,0,115,58,
+    0,0,0,121,16,0,116,0,0,124,0,0,131,1,0,125,
+    2,0,87,110,22,0,4,116,1,0,107,10,0,114,40,0,
+    1,1,1,100,1,0,83,89,110,1,0,88,124,2,0,106,
+    2,0,100,2,0,64,124,1,0,107,2,0,83,41,3,122,
+    49,84,101,115,116,32,119,104,101,116,104,101,114,32,116,104,
+    101,32,112,97,116,104,32,105,115,32,116,104,101,32,115,112,
+    101,99,105,102,105,101,100,32,109,111,100,101,32,116,121,112,
+    101,46,70,105,0,240,0,0,41,3,114,39,0,0,0,218,
+    7,79,83,69,114,114,111,114,218,7,115,116,95,109,111,100,
+    101,41,3,114,35,0,0,0,218,4,109,111,100,101,90,9,
+    115,116,97,116,95,105,110,102,111,114,4,0,0,0,114,4,
+    0,0,0,114,5,0,0,0,218,18,95,112,97,116,104,95,
+    105,115,95,109,111,100,101,95,116,121,112,101,78,0,0,0,
+    115,10,0,0,0,0,2,3,1,16,1,13,1,9,1,114,
+    43,0,0,0,99,1,0,0,0,0,0,0,0,1,0,0,
     0,3,0,0,0,67,0,0,0,115,13,0,0,0,116,0,
-    0,124,0,0,100,1,0,131,2,0,83,40,2,0,0,0,
-    117,31,0,0,0,82,101,112,108,97,99,101,109,101,110,116,
-    32,102,111,114,32,111,115,46,112,97,116,104,46,105,115,102,
-    105,108,101,46,105,0,128,0,0,40,1,0,0,0,117,18,
-    0,0,0,95,112,97,116,104,95,105,115,95,109,111,100,101,
-    95,116,121,112,101,40,1,0,0,0,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,
-    12,0,0,0,95,112,97,116,104,95,105,115,102,105,108,101,
-    108,0,0,0,115,2,0,0,0,0,2,117,12,0,0,0,
-    95,112,97,116,104,95,105,115,102,105,108,101,99,1,0,0,
-    0,0,0,0,0,1,0,0,0,3,0,0,0,67,0,0,
-    0,115,34,0,0,0,124,0,0,115,21,0,116,0,0,106,
-    1,0,131,0,0,125,0,0,110,0,0,116,2,0,124,0,
-    0,100,1,0,131,2,0,83,40,2,0,0,0,117,30,0,
-    0,0,82,101,112,108,97,99,101,109,101,110,116,32,102,111,
-    114,32,111,115,46,112,97,116,104,46,105,115,100,105,114,46,
-    105,0,64,0,0,40,3,0,0,0,117,3,0,0,0,95,
-    111,115,117,6,0,0,0,103,101,116,99,119,100,117,18,0,
-    0,0,95,112,97,116,104,95,105,115,95,109,111,100,101,95,
-    116,121,112,101,40,1,0,0,0,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,95,112,97,116,104,95,105,115,100,105,114,114,0,
-    0,0,115,6,0,0,0,0,2,6,1,15,1,117,11,0,
-    0,0,95,112,97,116,104,95,105,115,100,105,114,105,182,1,
-    0,0,99,3,0,0,0,0,0,0,0,6,0,0,0,17,
-    0,0,0,67,0,0,0,115,192,0,0,0,100,1,0,106,
-    0,0,124,0,0,116,1,0,124,0,0,131,1,0,131,2,
-    0,125,3,0,116,2,0,106,3,0,124,3,0,116,2,0,
-    106,4,0,116,2,0,106,5,0,66,116,2,0,106,6,0,
-    66,124,2,0,100,2,0,64,131,3,0,125,4,0,121,60,
-    0,116,7,0,106,8,0,124,4,0,100,3,0,131,2,0,
-    143,20,0,125,5,0,124,5,0,106,9,0,124,1,0,131,
-    1,0,1,87,100,4,0,81,88,116,2,0,106,10,0,124,
-    3,0,124,0,0,131,2,0,1,87,110,59,0,4,116,11,
-    0,107,10,0,114,187,0,1,1,1,121,17,0,116,2,0,
-    106,12,0,124,3,0,131,1,0,1,87,110,18,0,4,116,
-    11,0,107,10,0,114,179,0,1,1,1,89,110,1,0,88,
-    130,0,0,89,110,1,0,88,100,4,0,83,40,5,0,0,
-    0,117,162,0,0,0,66,101,115,116,45,101,102,102,111,114,
-    116,32,102,117,110,99,116,105,111,110,32,116,111,32,119,114,
-    105,116,101,32,100,97,116,97,32,116,111,32,97,32,112,97,
-    116,104,32,97,116,111,109,105,99,97,108,108,121,46,10,32,
-    32,32,32,66,101,32,112,114,101,112,97,114,101,100,32,116,
-    111,32,104,97,110,100,108,101,32,97,32,70,105,108,101,69,
-    120,105,115,116,115,69,114,114,111,114,32,105,102,32,99,111,
-    110,99,117,114,114,101,110,116,32,119,114,105,116,105,110,103,
-    32,111,102,32,116,104,101,10,32,32,32,32,116,101,109,112,
-    111,114,97,114,121,32,102,105,108,101,32,105,115,32,97,116,
-    116,101,109,112,116,101,100,46,117,5,0,0,0,123,125,46,
-    123,125,105,182,1,0,0,117,2,0,0,0,119,98,78,40,
-    13,0,0,0,117,6,0,0,0,102,111,114,109,97,116,117,
-    2,0,0,0,105,100,117,3,0,0,0,95,111,115,117,4,
-    0,0,0,111,112,101,110,117,6,0,0,0,79,95,69,88,
-    67,76,117,7,0,0,0,79,95,67,82,69,65,84,117,8,
-    0,0,0,79,95,87,82,79,78,76,89,117,3,0,0,0,
-    95,105,111,117,6,0,0,0,70,105,108,101,73,79,117,5,
-    0,0,0,119,114,105,116,101,117,7,0,0,0,114,101,112,
-    108,97,99,101,117,7,0,0,0,79,83,69,114,114,111,114,
-    117,6,0,0,0,117,110,108,105,110,107,40,6,0,0,0,
-    117,4,0,0,0,112,97,116,104,117,4,0,0,0,100,97,
-    116,97,117,4,0,0,0,109,111,100,101,117,8,0,0,0,
-    112,97,116,104,95,116,109,112,117,2,0,0,0,102,100,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,13,0,0,0,95,119,114,105,116,101,95,
-    97,116,111,109,105,99,121,0,0,0,115,26,0,0,0,0,
-    5,24,1,9,1,33,1,3,3,21,1,19,1,20,1,13,
-    1,3,1,17,1,13,1,5,1,117,13,0,0,0,95,119,
-    114,105,116,101,95,97,116,111,109,105,99,99,2,0,0,0,
-    0,0,0,0,3,0,0,0,7,0,0,0,67,0,0,0,
-    115,95,0,0,0,120,69,0,100,1,0,100,2,0,100,3,
-    0,100,4,0,103,4,0,68,93,49,0,125,2,0,116,0,
-    0,124,1,0,124,2,0,131,2,0,114,19,0,116,1,0,
-    124,0,0,124,2,0,116,2,0,124,1,0,124,2,0,131,
-    2,0,131,3,0,1,113,19,0,113,19,0,87,124,0,0,
-    106,3,0,106,4,0,124,1,0,106,3,0,131,1,0,1,
-    100,5,0,83,40,6,0,0,0,117,47,0,0,0,83,105,
-    109,112,108,101,32,115,117,98,115,116,105,116,117,116,101,32,
-    102,111,114,32,102,117,110,99,116,111,111,108,115,46,117,112,
-    100,97,116,101,95,119,114,97,112,112,101,114,46,117,10,0,
-    0,0,95,95,109,111,100,117,108,101,95,95,117,8,0,0,
-    0,95,95,110,97,109,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,78,40,5,0,0,0,117,7,0,0,
-    0,104,97,115,97,116,116,114,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,100,105,99,116,95,95,117,6,0,
-    0,0,117,112,100,97,116,101,40,3,0,0,0,117,3,0,
-    0,0,110,101,119,117,3,0,0,0,111,108,100,117,7,0,
-    0,0,114,101,112,108,97,99,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,5,0,0,0,95,119,114,97,112,143,
-    0,0,0,115,8,0,0,0,0,2,25,1,15,1,32,1,
-    117,5,0,0,0,95,119,114,97,112,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,116,1,0,131,1,0,124,0,0,
-    131,1,0,83,40,1,0,0,0,117,75,0,0,0,67,114,
-    101,97,116,101,32,97,32,110,101,119,32,109,111,100,117,108,
-    101,46,10,10,32,32,32,32,84,104,101,32,109,111,100,117,
-    108,101,32,105,115,32,110,111,116,32,101,110,116,101,114,101,
-    100,32,105,110,116,111,32,115,121,115,46,109,111,100,117,108,
-    101,115,46,10,10,32,32,32,32,40,2,0,0,0,117,4,
-    0,0,0,116,121,112,101,117,3,0,0,0,95,105,111,40,
-    1,0,0,0,117,4,0,0,0,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,110,101,
-    119,95,109,111,100,117,108,101,154,0,0,0,115,2,0,0,
-    0,0,6,117,10,0,0,0,110,101,119,95,109,111,100,117,
-    108,101,99,1,0,0,0,0,0,0,0,1,0,0,0,1,
-    0,0,0,66,0,0,0,115,20,0,0,0,124,0,0,69,
-    101,0,0,90,1,0,100,0,0,90,2,0,100,1,0,83,
-    40,2,0,0,0,117,14,0,0,0,95,68,101,97,100,108,
-    111,99,107,69,114,114,111,114,78,40,3,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,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,68,101,97,100,108,111,99,107,69,114,114,111,114,171,0,
-    0,0,115,2,0,0,0,16,1,117,14,0,0,0,95,68,
-    101,97,100,108,111,99,107,69,114,114,111,114,99,1,0,0,
-    0,0,0,0,0,1,0,0,0,2,0,0,0,66,0,0,
-    0,115,86,0,0,0,124,0,0,69,101,0,0,90,1,0,
+    0,124,0,0,100,1,0,131,2,0,83,41,2,122,31,82,
+    101,112,108,97,99,101,109,101,110,116,32,102,111,114,32,111,
+    115,46,112,97,116,104,46,105,115,102,105,108,101,46,105,0,
+    128,0,0,41,1,114,43,0,0,0,41,1,114,35,0,0,
+    0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,
+    218,12,95,112,97,116,104,95,105,115,102,105,108,101,87,0,
+    0,0,115,2,0,0,0,0,2,114,44,0,0,0,99,1,
+    0,0,0,0,0,0,0,1,0,0,0,3,0,0,0,67,
+    0,0,0,115,34,0,0,0,124,0,0,115,21,0,116,0,
+    0,106,1,0,131,0,0,125,0,0,110,0,0,116,2,0,
+    124,0,0,100,1,0,131,2,0,83,41,2,122,30,82,101,
+    112,108,97,99,101,109,101,110,116,32,102,111,114,32,111,115,
+    46,112,97,116,104,46,105,115,100,105,114,46,105,0,64,0,
+    0,41,3,114,3,0,0,0,218,6,103,101,116,99,119,100,
+    114,43,0,0,0,41,1,114,35,0,0,0,114,4,0,0,
+    0,114,4,0,0,0,114,5,0,0,0,218,11,95,112,97,
+    116,104,95,105,115,100,105,114,92,0,0,0,115,6,0,0,
+    0,0,2,6,1,15,1,114,46,0,0,0,105,182,1,0,
+    0,99,3,0,0,0,0,0,0,0,6,0,0,0,17,0,
+    0,0,67,0,0,0,115,192,0,0,0,100,1,0,106,0,
+    0,124,0,0,116,1,0,124,0,0,131,1,0,131,2,0,
+    125,3,0,116,2,0,106,3,0,124,3,0,116,2,0,106,
+    4,0,116,2,0,106,5,0,66,116,2,0,106,6,0,66,
+    124,2,0,100,2,0,64,131,3,0,125,4,0,121,60,0,
+    116,7,0,106,8,0,124,4,0,100,3,0,131,2,0,143,
+    20,0,125,5,0,124,5,0,106,9,0,124,1,0,131,1,
+    0,1,87,100,4,0,81,88,116,2,0,106,10,0,124,3,
+    0,124,0,0,131,2,0,1,87,110,59,0,4,116,11,0,
+    107,10,0,114,187,0,1,1,1,121,17,0,116,2,0,106,
+    12,0,124,3,0,131,1,0,1,87,110,18,0,4,116,11,
+    0,107,10,0,114,179,0,1,1,1,89,110,1,0,88,130,
+    0,0,89,110,1,0,88,100,4,0,83,41,5,122,162,66,
+    101,115,116,45,101,102,102,111,114,116,32,102,117,110,99,116,
+    105,111,110,32,116,111,32,119,114,105,116,101,32,100,97,116,
+    97,32,116,111,32,97,32,112,97,116,104,32,97,116,111,109,
+    105,99,97,108,108,121,46,10,32,32,32,32,66,101,32,112,
+    114,101,112,97,114,101,100,32,116,111,32,104,97,110,100,108,
+    101,32,97,32,70,105,108,101,69,120,105,115,116,115,69,114,
+    114,111,114,32,105,102,32,99,111,110,99,117,114,114,101,110,
+    116,32,119,114,105,116,105,110,103,32,111,102,32,116,104,101,
+    10,32,32,32,32,116,101,109,112,111,114,97,114,121,32,102,
+    105,108,101,32,105,115,32,97,116,116,101,109,112,116,101,100,
+    46,122,5,123,125,46,123,125,105,182,1,0,0,90,2,119,
+    98,78,41,13,218,6,102,111,114,109,97,116,218,2,105,100,
+    114,3,0,0,0,90,4,111,112,101,110,90,6,79,95,69,
+    88,67,76,90,7,79,95,67,82,69,65,84,90,8,79,95,
+    87,82,79,78,76,89,218,3,95,105,111,218,6,70,105,108,
+    101,73,79,218,5,119,114,105,116,101,218,7,114,101,112,108,
+    97,99,101,114,40,0,0,0,90,6,117,110,108,105,110,107,
+    41,6,114,35,0,0,0,218,4,100,97,116,97,114,42,0,
+    0,0,90,8,112,97,116,104,95,116,109,112,90,2,102,100,
+    218,4,102,105,108,101,114,4,0,0,0,114,4,0,0,0,
+    114,5,0,0,0,218,13,95,119,114,105,116,101,95,97,116,
+    111,109,105,99,99,0,0,0,115,26,0,0,0,0,5,24,
+    1,9,1,33,1,3,3,21,1,19,1,20,1,13,1,3,
+    1,17,1,13,1,5,1,114,55,0,0,0,99,2,0,0,
+    0,0,0,0,0,3,0,0,0,7,0,0,0,67,0,0,
+    0,115,95,0,0,0,120,69,0,100,1,0,100,2,0,100,
+    3,0,100,4,0,103,4,0,68,93,49,0,125,2,0,116,
+    0,0,124,1,0,124,2,0,131,2,0,114,19,0,116,1,
+    0,124,0,0,124,2,0,116,2,0,124,1,0,124,2,0,
+    131,2,0,131,3,0,1,113,19,0,113,19,0,87,124,0,
+    0,106,3,0,106,4,0,124,1,0,106,3,0,131,1,0,
+    1,100,5,0,83,41,6,122,47,83,105,109,112,108,101,32,
+    115,117,98,115,116,105,116,117,116,101,32,102,111,114,32,102,
+    117,110,99,116,111,111,108,115,46,117,112,100,97,116,101,95,
+    119,114,97,112,112,101,114,46,218,10,95,95,109,111,100,117,
+    108,101,95,95,218,8,95,95,110,97,109,101,95,95,218,12,
+    95,95,113,117,97,108,110,97,109,101,95,95,218,7,95,95,
+    100,111,99,95,95,78,41,5,218,7,104,97,115,97,116,116,
+    114,218,7,115,101,116,97,116,116,114,218,7,103,101,116,97,
+    116,116,114,218,8,95,95,100,105,99,116,95,95,218,6,117,
+    112,100,97,116,101,41,3,90,3,110,101,119,90,3,111,108,
+    100,114,52,0,0,0,114,4,0,0,0,114,4,0,0,0,
+    114,5,0,0,0,218,5,95,119,114,97,112,121,0,0,0,
+    115,8,0,0,0,0,2,25,1,15,1,32,1,114,65,0,
+    0,0,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,116,
+    1,0,131,1,0,124,0,0,131,1,0,83,41,1,78,41,
+    2,218,4,116,121,112,101,114,7,0,0,0,41,1,218,4,
+    110,97,109,101,114,4,0,0,0,114,4,0,0,0,114,5,
+    0,0,0,218,11,95,110,101,119,95,109,111,100,117,108,101,
+    129,0,0,0,115,2,0,0,0,0,1,114,68,0,0,0,
+    99,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,
+    0,64,0,0,0,115,58,0,0,0,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,132,0,0,90,6,0,
-    100,8,0,100,9,0,132,0,0,90,7,0,100,10,0,100,
-    11,0,132,0,0,90,8,0,100,12,0,83,40,13,0,0,
-    0,117,11,0,0,0,95,77,111,100,117,108,101,76,111,99,
-    107,117,169,0,0,0,65,32,114,101,99,117,114,115,105,118,
-    101,32,108,111,99,107,32,105,109,112,108,101,109,101,110,116,
-    97,116,105,111,110,32,119,104,105,99,104,32,105,115,32,97,
-    98,108,101,32,116,111,32,100,101,116,101,99,116,32,100,101,
-    97,100,108,111,99,107,115,10,32,32,32,32,40,101,46,103,
-    46,32,116,104,114,101,97,100,32,49,32,116,114,121,105,110,
-    103,32,116,111,32,116,97,107,101,32,108,111,99,107,115,32,
-    65,32,116,104,101,110,32,66,44,32,97,110,100,32,116,104,
-    114,101,97,100,32,50,32,116,114,121,105,110,103,32,116,111,
-    10,32,32,32,32,116,97,107,101,32,108,111,99,107,115,32,
-    66,32,116,104,101,110,32,65,41,46,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,70,0,0,0,116,0,0,106,1,0,131,
-    0,0,124,0,0,95,2,0,116,0,0,106,1,0,131,0,
-    0,124,0,0,95,3,0,124,1,0,124,0,0,95,4,0,
-    100,0,0,124,0,0,95,6,0,100,1,0,124,0,0,95,
-    7,0,100,1,0,124,0,0,95,8,0,100,0,0,83,40,
-    2,0,0,0,78,105,0,0,0,0,40,9,0,0,0,117,
-    7,0,0,0,95,116,104,114,101,97,100,117,13,0,0,0,
-    97,108,108,111,99,97,116,101,95,108,111,99,107,117,4,0,
-    0,0,108,111,99,107,117,6,0,0,0,119,97,107,101,117,
-    112,117,4,0,0,0,110,97,109,101,117,4,0,0,0,78,
-    111,110,101,117,5,0,0,0,111,119,110,101,114,117,5,0,
-    0,0,99,111,117,110,116,117,7,0,0,0,119,97,105,116,
-    101,114,115,40,2,0,0,0,117,4,0,0,0,115,101,108,
-    102,117,4,0,0,0,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,95,95,105,110,105,
-    116,95,95,181,0,0,0,115,12,0,0,0,0,1,15,1,
-    15,1,9,1,9,1,9,1,117,20,0,0,0,95,77,111,
-    100,117,108,101,76,111,99,107,46,95,95,105,110,105,116,95,
-    95,99,1,0,0,0,0,0,0,0,4,0,0,0,2,0,
-    0,0,67,0,0,0,115,87,0,0,0,116,0,0,106,1,
-    0,131,0,0,125,1,0,124,0,0,106,2,0,125,2,0,
-    120,59,0,116,3,0,106,4,0,124,2,0,131,1,0,125,
-    3,0,124,3,0,100,0,0,107,8,0,114,55,0,100,1,
-    0,83,124,3,0,106,2,0,125,2,0,124,2,0,124,1,
-    0,107,2,0,114,24,0,100,2,0,83,113,24,0,100,0,
-    0,83,40,3,0,0,0,78,70,84,40,8,0,0,0,117,
-    7,0,0,0,95,116,104,114,101,97,100,117,9,0,0,0,
-    103,101,116,95,105,100,101,110,116,117,5,0,0,0,111,119,
-    110,101,114,117,12,0,0,0,95,98,108,111,99,107,105,110,
-    103,95,111,110,117,3,0,0,0,103,101,116,117,4,0,0,
-    0,78,111,110,101,117,5,0,0,0,70,97,108,115,101,117,
-    4,0,0,0,84,114,117,101,40,4,0,0,0,117,4,0,
-    0,0,115,101,108,102,117,2,0,0,0,109,101,117,3,0,
-    0,0,116,105,100,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,12,0,0,0,104,
-    97,115,95,100,101,97,100,108,111,99,107,189,0,0,0,115,
-    18,0,0,0,0,2,12,1,9,1,3,1,15,1,12,1,
-    4,1,9,1,12,1,117,24,0,0,0,95,77,111,100,117,
-    108,101,76,111,99,107,46,104,97,115,95,100,101,97,100,108,
-    111,99,107,99,1,0,0,0,0,0,0,0,2,0,0,0,
-    17,0,0,0,67,0,0,0,115,214,0,0,0,116,0,0,
-    106,1,0,131,0,0,125,1,0,124,0,0,116,2,0,124,
-    1,0,60,122,177,0,120,170,0,124,0,0,106,3,0,143,
-    130,0,1,124,0,0,106,4,0,100,1,0,107,2,0,115,
-    68,0,124,0,0,106,5,0,124,1,0,107,2,0,114,96,
-    0,124,1,0,124,0,0,95,5,0,124,0,0,4,106,4,
-    0,100,2,0,55,2,95,4,0,100,5,0,83,124,0,0,
-    106,7,0,131,0,0,114,127,0,116,8,0,100,3,0,124,
-    0,0,22,131,1,0,130,1,0,110,0,0,124,0,0,106,
-    9,0,106,10,0,100,6,0,131,1,0,114,163,0,124,0,
-    0,4,106,12,0,100,2,0,55,2,95,12,0,110,0,0,
-    87,100,4,0,81,88,124,0,0,106,9,0,106,10,0,131,
-    0,0,1,124,0,0,106,9,0,106,13,0,131,0,0,1,
-    113,28,0,87,100,4,0,116,2,0,124,1,0,61,88,100,
-    4,0,83,40,7,0,0,0,117,185,0,0,0,10,32,32,
-    32,32,32,32,32,32,65,99,113,117,105,114,101,32,116,104,
-    101,32,109,111,100,117,108,101,32,108,111,99,107,46,32,32,
-    73,102,32,97,32,112,111,116,101,110,116,105,97,108,32,100,
-    101,97,100,108,111,99,107,32,105,115,32,100,101,116,101,99,
-    116,101,100,44,10,32,32,32,32,32,32,32,32,97,32,95,
-    68,101,97,100,108,111,99,107,69,114,114,111,114,32,105,115,
-    32,114,97,105,115,101,100,46,10,32,32,32,32,32,32,32,
-    32,79,116,104,101,114,119,105,115,101,44,32,116,104,101,32,
-    108,111,99,107,32,105,115,32,97,108,119,97,121,115,32,97,
-    99,113,117,105,114,101,100,32,97,110,100,32,84,114,117,101,
-    32,105,115,32,114,101,116,117,114,110,101,100,46,10,32,32,
-    32,32,32,32,32,32,105,0,0,0,0,105,1,0,0,0,
-    117,23,0,0,0,100,101,97,100,108,111,99,107,32,100,101,
-    116,101,99,116,101,100,32,98,121,32,37,114,78,84,70,40,
-    14,0,0,0,117,7,0,0,0,95,116,104,114,101,97,100,
-    117,9,0,0,0,103,101,116,95,105,100,101,110,116,117,12,
-    0,0,0,95,98,108,111,99,107,105,110,103,95,111,110,117,
-    4,0,0,0,108,111,99,107,117,5,0,0,0,99,111,117,
-    110,116,117,5,0,0,0,111,119,110,101,114,117,4,0,0,
-    0,84,114,117,101,117,12,0,0,0,104,97,115,95,100,101,
-    97,100,108,111,99,107,117,14,0,0,0,95,68,101,97,100,
-    108,111,99,107,69,114,114,111,114,117,6,0,0,0,119,97,
-    107,101,117,112,117,7,0,0,0,97,99,113,117,105,114,101,
-    117,5,0,0,0,70,97,108,115,101,117,7,0,0,0,119,
-    97,105,116,101,114,115,117,7,0,0,0,114,101,108,101,97,
-    115,101,40,2,0,0,0,117,4,0,0,0,115,101,108,102,
-    117,3,0,0,0,116,105,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,7,0,0,0,97,99,113,117,105,114,101,
-    201,0,0,0,115,32,0,0,0,0,6,12,1,10,1,3,
-    1,3,1,10,1,30,1,9,1,15,1,4,1,12,1,19,
-    1,18,1,24,2,13,1,20,2,117,19,0,0,0,95,77,
-    111,100,117,108,101,76,111,99,107,46,97,99,113,117,105,114,
-    101,99,1,0,0,0,0,0,0,0,2,0,0,0,10,0,
-    0,0,67,0,0,0,115,165,0,0,0,116,0,0,106,1,
-    0,131,0,0,125,1,0,124,0,0,106,2,0,143,138,0,
-    1,124,0,0,106,3,0,124,1,0,107,3,0,114,52,0,
-    116,4,0,100,1,0,131,1,0,130,1,0,110,0,0,124,
-    0,0,106,5,0,100,2,0,107,4,0,115,73,0,116,6,
-    0,130,1,0,124,0,0,4,106,5,0,100,3,0,56,2,
-    95,5,0,124,0,0,106,5,0,100,2,0,107,2,0,114,
-    155,0,100,0,0,124,0,0,95,3,0,124,0,0,106,8,
-    0,114,155,0,124,0,0,4,106,8,0,100,3,0,56,2,
-    95,8,0,124,0,0,106,9,0,106,10,0,131,0,0,1,
-    113,155,0,110,0,0,87,100,0,0,81,88,100,0,0,83,
-    40,4,0,0,0,78,117,31,0,0,0,99,97,110,110,111,
-    116,32,114,101,108,101,97,115,101,32,117,110,45,97,99,113,
-    117,105,114,101,100,32,108,111,99,107,105,0,0,0,0,105,
-    1,0,0,0,40,11,0,0,0,117,7,0,0,0,95,116,
-    104,114,101,97,100,117,9,0,0,0,103,101,116,95,105,100,
-    101,110,116,117,4,0,0,0,108,111,99,107,117,5,0,0,
-    0,111,119,110,101,114,117,12,0,0,0,82,117,110,116,105,
-    109,101,69,114,114,111,114,117,5,0,0,0,99,111,117,110,
-    116,117,14,0,0,0,65,115,115,101,114,116,105,111,110,69,
-    114,114,111,114,117,4,0,0,0,78,111,110,101,117,7,0,
-    0,0,119,97,105,116,101,114,115,117,6,0,0,0,119,97,
-    107,101,117,112,117,7,0,0,0,114,101,108,101,97,115,101,
-    40,2,0,0,0,117,4,0,0,0,115,101,108,102,117,3,
-    0,0,0,116,105,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,7,0,0,0,114,101,108,101,97,115,101,226,0,
-    0,0,115,22,0,0,0,0,1,12,1,10,1,15,1,15,
-    1,21,1,15,1,15,1,9,1,9,1,15,1,117,19,0,
-    0,0,95,77,111,100,117,108,101,76,111,99,107,46,114,101,
-    108,101,97,115,101,99,1,0,0,0,0,0,0,0,1,0,
-    0,0,4,0,0,0,67,0,0,0,115,23,0,0,0,100,
-    1,0,124,0,0,106,0,0,116,1,0,124,0,0,131,1,
-    0,102,2,0,22,83,40,2,0,0,0,78,117,21,0,0,
-    0,95,77,111,100,117,108,101,76,111,99,107,40,37,114,41,
-    32,97,116,32,37,100,40,2,0,0,0,117,4,0,0,0,
-    110,97,109,101,117,2,0,0,0,105,100,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,239,0,0,0,115,2,0,0,0,0,1,117,20,0,
-    0,0,95,77,111,100,117,108,101,76,111,99,107,46,95,95,
-    114,101,112,114,95,95,78,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,12,0,0,0,104,97,115,95,100,101,97,100,108,
-    111,99,107,117,7,0,0,0,97,99,113,117,105,114,101,117,
-    7,0,0,0,114,101,108,101,97,115,101,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,11,0,0,0,95,77,111,
-    100,117,108,101,76,111,99,107,175,0,0,0,115,12,0,0,
-    0,16,4,6,2,12,8,12,12,12,25,12,13,117,11,0,
-    0,0,95,77,111,100,117,108,101,76,111,99,107,99,1,0,
-    0,0,0,0,0,0,1,0,0,0,2,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,100,6,0,100,7,0,132,0,0,90,6,
-    0,100,8,0,100,9,0,132,0,0,90,7,0,100,10,0,
-    83,40,11,0,0,0,117,16,0,0,0,95,68,117,109,109,
-    121,77,111,100,117,108,101,76,111,99,107,117,86,0,0,0,
-    65,32,115,105,109,112,108,101,32,95,77,111,100,117,108,101,
-    76,111,99,107,32,101,113,117,105,118,97,108,101,110,116,32,
-    102,111,114,32,80,121,116,104,111,110,32,98,117,105,108,100,
-    115,32,119,105,116,104,111,117,116,10,32,32,32,32,109,117,
-    108,116,105,45,116,104,114,101,97,100,105,110,103,32,115,117,
-    112,112,111,114,116,46,99,2,0,0,0,0,0,0,0,2,
+    100,8,0,83,41,9,218,13,95,77,97,110,97,103,101,82,
+    101,108,111,97,100,122,63,77,97,110,97,103,101,115,32,116,
+    104,101,32,112,111,115,115,105,98,108,101,32,99,108,101,97,
+    110,45,117,112,32,111,102,32,115,121,115,46,109,111,100,117,
+    108,101,115,32,102,111,114,32,108,111,97,100,95,109,111,100,
+    117,108,101,40,41,46,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,1,0,124,0,0,95,0,0,100,0,0,83,41,1,78,
+    41,1,218,5,95,110,97,109,101,41,2,218,4,115,101,108,
+    102,114,67,0,0,0,114,4,0,0,0,114,4,0,0,0,
+    114,5,0,0,0,218,8,95,95,105,110,105,116,95,95,141,
+    0,0,0,115,2,0,0,0,0,1,122,22,95,77,97,110,
+    97,103,101,82,101,108,111,97,100,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,25,0,0,0,124,0,0,106,
+    0,0,116,1,0,106,2,0,107,6,0,124,0,0,95,3,
+    0,100,0,0,83,41,1,78,41,4,114,70,0,0,0,114,
+    7,0,0,0,218,7,109,111,100,117,108,101,115,218,10,95,
+    105,115,95,114,101,108,111,97,100,41,1,114,71,0,0,0,
+    114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,218,
+    9,95,95,101,110,116,101,114,95,95,144,0,0,0,115,2,
+    0,0,0,0,1,122,23,95,77,97,110,97,103,101,82,101,
+    108,111,97,100,46,95,95,101,110,116,101,114,95,95,99,1,
+    0,0,0,0,0,0,0,2,0,0,0,11,0,0,0,71,
+    0,0,0,115,80,0,0,0,116,0,0,100,1,0,100,2,
+    0,132,0,0,124,1,0,68,131,1,0,131,1,0,114,76,
+    0,124,0,0,106,1,0,12,114,76,0,121,17,0,116,2,
+    0,106,3,0,124,0,0,106,4,0,61,87,113,76,0,4,
+    116,5,0,107,10,0,114,72,0,1,1,1,89,113,76,0,
+    88,110,0,0,100,0,0,83,41,3,78,99,1,0,0,0,
+    0,0,0,0,2,0,0,0,3,0,0,0,115,0,0,0,
+    115,27,0,0,0,124,0,0,93,17,0,125,1,0,124,1,
+    0,100,0,0,107,9,0,86,1,113,3,0,100,0,0,83,
+    41,1,78,114,4,0,0,0,41,2,114,22,0,0,0,218,
+    3,97,114,103,114,4,0,0,0,114,4,0,0,0,114,5,
+    0,0,0,250,9,60,103,101,110,101,120,112,114,62,148,0,
+    0,0,115,2,0,0,0,6,0,122,41,95,77,97,110,97,
+    103,101,82,101,108,111,97,100,46,95,95,101,120,105,116,95,
+    95,46,60,108,111,99,97,108,115,62,46,60,103,101,110,101,
+    120,112,114,62,41,6,218,3,97,110,121,114,74,0,0,0,
+    114,7,0,0,0,114,73,0,0,0,114,70,0,0,0,218,
+    8,75,101,121,69,114,114,111,114,41,2,114,71,0,0,0,
+    218,4,97,114,103,115,114,4,0,0,0,114,4,0,0,0,
+    114,5,0,0,0,218,8,95,95,101,120,105,116,95,95,147,
+    0,0,0,115,10,0,0,0,0,1,35,1,3,1,17,1,
+    13,1,122,22,95,77,97,110,97,103,101,82,101,108,111,97,
+    100,46,95,95,101,120,105,116,95,95,78,41,7,114,57,0,
+    0,0,114,56,0,0,0,114,58,0,0,0,114,59,0,0,
+    0,114,72,0,0,0,114,75,0,0,0,114,81,0,0,0,
+    114,4,0,0,0,114,4,0,0,0,114,4,0,0,0,114,
+    5,0,0,0,114,69,0,0,0,137,0,0,0,115,8,0,
+    0,0,12,2,6,2,12,3,12,3,114,69,0,0,0,99,
+    0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,
+    64,0,0,0,115,16,0,0,0,101,0,0,90,1,0,100,
+    0,0,90,2,0,100,1,0,83,41,2,218,14,95,68,101,
+    97,100,108,111,99,107,69,114,114,111,114,78,41,3,114,57,
+    0,0,0,114,56,0,0,0,114,58,0,0,0,114,4,0,
+    0,0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,
+    0,114,82,0,0,0,162,0,0,0,115,2,0,0,0,12,
+    1,114,82,0,0,0,99,0,0,0,0,0,0,0,0,0,
+    0,0,0,2,0,0,0,64,0,0,0,115,82,0,0,0,
+    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,
+    132,0,0,90,6,0,100,8,0,100,9,0,132,0,0,90,
+    7,0,100,10,0,100,11,0,132,0,0,90,8,0,100,12,
+    0,83,41,13,218,11,95,77,111,100,117,108,101,76,111,99,
+    107,122,169,65,32,114,101,99,117,114,115,105,118,101,32,108,
+    111,99,107,32,105,109,112,108,101,109,101,110,116,97,116,105,
+    111,110,32,119,104,105,99,104,32,105,115,32,97,98,108,101,
+    32,116,111,32,100,101,116,101,99,116,32,100,101,97,100,108,
+    111,99,107,115,10,32,32,32,32,40,101,46,103,46,32,116,
+    104,114,101,97,100,32,49,32,116,114,121,105,110,103,32,116,
+    111,32,116,97,107,101,32,108,111,99,107,115,32,65,32,116,
+    104,101,110,32,66,44,32,97,110,100,32,116,104,114,101,97,
+    100,32,50,32,116,114,121,105,110,103,32,116,111,10,32,32,
+    32,32,116,97,107,101,32,108,111,99,107,115,32,66,32,116,
+    104,101,110,32,65,41,46,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,70,0,0,0,116,0,0,106,1,0,131,0,0,124,
+    0,0,95,2,0,116,0,0,106,1,0,131,0,0,124,0,
+    0,95,3,0,124,1,0,124,0,0,95,4,0,100,0,0,
+    124,0,0,95,5,0,100,1,0,124,0,0,95,6,0,100,
+    1,0,124,0,0,95,7,0,100,0,0,83,41,2,78,233,
+    0,0,0,0,41,8,218,7,95,116,104,114,101,97,100,90,
+    13,97,108,108,111,99,97,116,101,95,108,111,99,107,218,4,
+    108,111,99,107,218,6,119,97,107,101,117,112,114,67,0,0,
+    0,218,5,111,119,110,101,114,218,5,99,111,117,110,116,218,
+    7,119,97,105,116,101,114,115,41,2,114,71,0,0,0,114,
+    67,0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,
+    0,0,0,114,72,0,0,0,172,0,0,0,115,12,0,0,
+    0,0,1,15,1,15,1,9,1,9,1,9,1,122,20,95,
+    77,111,100,117,108,101,76,111,99,107,46,95,95,105,110,105,
+    116,95,95,99,1,0,0,0,0,0,0,0,4,0,0,0,
+    2,0,0,0,67,0,0,0,115,88,0,0,0,116,0,0,
+    106,1,0,131,0,0,125,1,0,124,0,0,106,2,0,125,
+    2,0,120,60,0,116,3,0,106,4,0,124,2,0,131,1,
+    0,125,3,0,124,3,0,100,0,0,107,8,0,114,55,0,
+    100,1,0,83,124,3,0,106,2,0,125,2,0,124,2,0,
+    124,1,0,107,2,0,114,24,0,100,2,0,83,113,24,0,
+    87,100,0,0,83,41,3,78,70,84,41,5,114,85,0,0,
+    0,218,9,103,101,116,95,105,100,101,110,116,114,88,0,0,
+    0,218,12,95,98,108,111,99,107,105,110,103,95,111,110,218,
+    3,103,101,116,41,4,114,71,0,0,0,218,2,109,101,218,
+    3,116,105,100,114,86,0,0,0,114,4,0,0,0,114,4,
+    0,0,0,114,5,0,0,0,218,12,104,97,115,95,100,101,
+    97,100,108,111,99,107,180,0,0,0,115,18,0,0,0,0,
+    2,12,1,9,1,3,1,15,1,12,1,4,1,9,1,12,
+    1,122,24,95,77,111,100,117,108,101,76,111,99,107,46,104,
+    97,115,95,100,101,97,100,108,111,99,107,99,1,0,0,0,
+    0,0,0,0,2,0,0,0,16,0,0,0,67,0,0,0,
+    115,215,0,0,0,116,0,0,106,1,0,131,0,0,125,1,
+    0,124,0,0,116,2,0,124,1,0,60,122,178,0,120,171,
+    0,124,0,0,106,3,0,143,130,0,1,124,0,0,106,4,
+    0,100,1,0,107,2,0,115,68,0,124,0,0,106,5,0,
+    124,1,0,107,2,0,114,96,0,124,1,0,124,0,0,95,
+    5,0,124,0,0,4,106,4,0,100,2,0,55,2,95,4,
+    0,100,3,0,83,124,0,0,106,6,0,131,0,0,114,127,
+    0,116,7,0,100,4,0,124,0,0,22,131,1,0,130,1,
+    0,110,0,0,124,0,0,106,8,0,106,9,0,100,5,0,
+    131,1,0,114,163,0,124,0,0,4,106,10,0,100,2,0,
+    55,2,95,10,0,110,0,0,87,100,6,0,81,88,124,0,
+    0,106,8,0,106,9,0,131,0,0,1,124,0,0,106,8,
+    0,106,11,0,131,0,0,1,113,28,0,87,87,100,6,0,
+    116,2,0,124,1,0,61,88,100,6,0,83,41,7,122,185,
+    10,32,32,32,32,32,32,32,32,65,99,113,117,105,114,101,
+    32,116,104,101,32,109,111,100,117,108,101,32,108,111,99,107,
+    46,32,32,73,102,32,97,32,112,111,116,101,110,116,105,97,
+    108,32,100,101,97,100,108,111,99,107,32,105,115,32,100,101,
+    116,101,99,116,101,100,44,10,32,32,32,32,32,32,32,32,
+    97,32,95,68,101,97,100,108,111,99,107,69,114,114,111,114,
+    32,105,115,32,114,97,105,115,101,100,46,10,32,32,32,32,
+    32,32,32,32,79,116,104,101,114,119,105,115,101,44,32,116,
+    104,101,32,108,111,99,107,32,105,115,32,97,108,119,97,121,
+    115,32,97,99,113,117,105,114,101,100,32,97,110,100,32,84,
+    114,117,101,32,105,115,32,114,101,116,117,114,110,101,100,46,
+    10,32,32,32,32,32,32,32,32,114,84,0,0,0,114,29,
+    0,0,0,84,122,23,100,101,97,100,108,111,99,107,32,100,
+    101,116,101,99,116,101,100,32,98,121,32,37,114,70,78,41,
+    12,114,85,0,0,0,114,91,0,0,0,114,92,0,0,0,
+    114,86,0,0,0,114,89,0,0,0,114,88,0,0,0,114,
+    96,0,0,0,114,82,0,0,0,114,87,0,0,0,218,7,
+    97,99,113,117,105,114,101,114,90,0,0,0,218,7,114,101,
+    108,101,97,115,101,41,2,114,71,0,0,0,114,95,0,0,
+    0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,
+    114,97,0,0,0,192,0,0,0,115,32,0,0,0,0,6,
+    12,1,10,1,3,1,3,1,10,1,30,1,9,1,15,1,
+    4,1,12,1,19,1,18,1,24,2,13,1,21,2,122,19,
+    95,77,111,100,117,108,101,76,111,99,107,46,97,99,113,117,
+    105,114,101,99,1,0,0,0,0,0,0,0,2,0,0,0,
+    10,0,0,0,67,0,0,0,115,165,0,0,0,116,0,0,
+    106,1,0,131,0,0,125,1,0,124,0,0,106,2,0,143,
+    138,0,1,124,0,0,106,3,0,124,1,0,107,3,0,114,
+    52,0,116,4,0,100,1,0,131,1,0,130,1,0,110,0,
+    0,124,0,0,106,5,0,100,2,0,107,4,0,115,73,0,
+    116,6,0,130,1,0,124,0,0,4,106,5,0,100,3,0,
+    56,2,95,5,0,124,0,0,106,5,0,100,2,0,107,2,
+    0,114,155,0,100,0,0,124,0,0,95,3,0,124,0,0,
+    106,7,0,114,155,0,124,0,0,4,106,7,0,100,3,0,
+    56,2,95,7,0,124,0,0,106,8,0,106,9,0,131,0,
+    0,1,113,155,0,110,0,0,87,100,0,0,81,88,100,0,
+    0,83,41,4,78,122,31,99,97,110,110,111,116,32,114,101,
+    108,101,97,115,101,32,117,110,45,97,99,113,117,105,114,101,
+    100,32,108,111,99,107,114,84,0,0,0,114,29,0,0,0,
+    41,10,114,85,0,0,0,114,91,0,0,0,114,86,0,0,
+    0,114,88,0,0,0,218,12,82,117,110,116,105,109,101,69,
+    114,114,111,114,114,89,0,0,0,218,14,65,115,115,101,114,
+    116,105,111,110,69,114,114,111,114,114,90,0,0,0,114,87,
+    0,0,0,114,98,0,0,0,41,2,114,71,0,0,0,114,
+    95,0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,
+    0,0,0,114,98,0,0,0,217,0,0,0,115,22,0,0,
+    0,0,1,12,1,10,1,15,1,15,1,21,1,15,1,15,
+    1,9,1,9,1,15,1,122,19,95,77,111,100,117,108,101,
+    76,111,99,107,46,114,101,108,101,97,115,101,99,1,0,0,
+    0,0,0,0,0,1,0,0,0,4,0,0,0,67,0,0,
+    0,115,25,0,0,0,100,1,0,106,0,0,124,0,0,106,
+    1,0,116,2,0,124,0,0,131,1,0,131,2,0,83,41,
+    2,78,122,23,95,77,111,100,117,108,101,76,111,99,107,40,
+    123,33,114,125,41,32,97,116,32,123,125,41,3,114,47,0,
+    0,0,114,67,0,0,0,114,48,0,0,0,41,1,114,71,
+    0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0,
+    0,0,218,8,95,95,114,101,112,114,95,95,230,0,0,0,
+    115,2,0,0,0,0,1,122,20,95,77,111,100,117,108,101,
+    76,111,99,107,46,95,95,114,101,112,114,95,95,78,41,9,
+    114,57,0,0,0,114,56,0,0,0,114,58,0,0,0,114,
+    59,0,0,0,114,72,0,0,0,114,96,0,0,0,114,97,
+    0,0,0,114,98,0,0,0,114,101,0,0,0,114,4,0,
+    0,0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,
+    0,114,83,0,0,0,166,0,0,0,115,12,0,0,0,12,
+    4,6,2,12,8,12,12,12,25,12,13,114,83,0,0,0,
+    99,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,
+    0,64,0,0,0,115,70,0,0,0,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,132,0,0,90,6,0,
+    100,8,0,100,9,0,132,0,0,90,7,0,100,10,0,83,
+    41,11,218,16,95,68,117,109,109,121,77,111,100,117,108,101,
+    76,111,99,107,122,86,65,32,115,105,109,112,108,101,32,95,
+    77,111,100,117,108,101,76,111,99,107,32,101,113,117,105,118,
+    97,108,101,110,116,32,102,111,114,32,80,121,116,104,111,110,
+    32,98,117,105,108,100,115,32,119,105,116,104,111,117,116,10,
+    32,32,32,32,109,117,108,116,105,45,116,104,114,101,97,100,
+    105,110,103,32,115,117,112,112,111,114,116,46,99,2,0,0,
+    0,0,0,0,0,2,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,100,
+    1,0,124,0,0,95,1,0,100,0,0,83,41,2,78,114,
+    84,0,0,0,41,2,114,67,0,0,0,114,89,0,0,0,
+    41,2,114,71,0,0,0,114,67,0,0,0,114,4,0,0,
+    0,114,4,0,0,0,114,5,0,0,0,114,72,0,0,0,
+    238,0,0,0,115,4,0,0,0,0,1,9,1,122,25,95,
+    68,117,109,109,121,77,111,100,117,108,101,76,111,99,107,46,
+    95,95,105,110,105,116,95,95,99,1,0,0,0,0,0,0,
+    0,1,0,0,0,3,0,0,0,67,0,0,0,115,19,0,
+    0,0,124,0,0,4,106,0,0,100,1,0,55,2,95,0,
+    0,100,2,0,83,41,3,78,114,29,0,0,0,84,41,1,
+    114,89,0,0,0,41,1,114,71,0,0,0,114,4,0,0,
+    0,114,4,0,0,0,114,5,0,0,0,114,97,0,0,0,
+    242,0,0,0,115,4,0,0,0,0,1,15,1,122,24,95,
+    68,117,109,109,121,77,111,100,117,108,101,76,111,99,107,46,
+    97,99,113,117,105,114,101,99,1,0,0,0,0,0,0,0,
+    1,0,0,0,3,0,0,0,67,0,0,0,115,49,0,0,
+    0,124,0,0,106,0,0,100,1,0,107,2,0,114,30,0,
+    116,1,0,100,2,0,131,1,0,130,1,0,110,0,0,124,
+    0,0,4,106,0,0,100,3,0,56,2,95,0,0,100,0,
+    0,83,41,4,78,114,84,0,0,0,122,31,99,97,110,110,
+    111,116,32,114,101,108,101,97,115,101,32,117,110,45,97,99,
+    113,117,105,114,101,100,32,108,111,99,107,114,29,0,0,0,
+    41,2,114,89,0,0,0,114,99,0,0,0,41,1,114,71,
+    0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0,
+    0,0,114,98,0,0,0,246,0,0,0,115,6,0,0,0,
+    0,1,15,1,15,1,122,24,95,68,117,109,109,121,77,111,
+    100,117,108,101,76,111,99,107,46,114,101,108,101,97,115,101,
+    99,1,0,0,0,0,0,0,0,1,0,0,0,4,0,0,
+    0,67,0,0,0,115,25,0,0,0,100,1,0,106,0,0,
+    124,0,0,106,1,0,116,2,0,124,0,0,131,1,0,131,
+    2,0,83,41,2,78,122,28,95,68,117,109,109,121,77,111,
+    100,117,108,101,76,111,99,107,40,123,33,114,125,41,32,97,
+    116,32,123,125,41,3,114,47,0,0,0,114,67,0,0,0,
+    114,48,0,0,0,41,1,114,71,0,0,0,114,4,0,0,
+    0,114,4,0,0,0,114,5,0,0,0,114,101,0,0,0,
+    251,0,0,0,115,2,0,0,0,0,1,122,25,95,68,117,
+    109,109,121,77,111,100,117,108,101,76,111,99,107,46,95,95,
+    114,101,112,114,95,95,78,41,8,114,57,0,0,0,114,56,
+    0,0,0,114,58,0,0,0,114,59,0,0,0,114,72,0,
+    0,0,114,97,0,0,0,114,98,0,0,0,114,101,0,0,
+    0,114,4,0,0,0,114,4,0,0,0,114,4,0,0,0,
+    114,5,0,0,0,114,102,0,0,0,234,0,0,0,115,10,
+    0,0,0,12,2,6,2,12,4,12,4,12,5,114,102,0,
+    0,0,99,0,0,0,0,0,0,0,0,0,0,0,0,2,
+    0,0,0,64,0,0,0,115,52,0,0,0,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,83,
+    41,8,218,18,95,77,111,100,117,108,101,76,111,99,107,77,
+    97,110,97,103,101,114,99,2,0,0,0,0,0,0,0,2,
     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,100,1,0,124,0,0,95,
-    1,0,100,0,0,83,40,2,0,0,0,78,105,0,0,0,
-    0,40,2,0,0,0,117,4,0,0,0,110,97,109,101,117,
-    5,0,0,0,99,111,117,110,116,40,2,0,0,0,117,4,
-    0,0,0,115,101,108,102,117,4,0,0,0,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,95,95,105,110,105,116,95,95,247,0,0,0,115,4,0,
-    0,0,0,1,9,1,117,25,0,0,0,95,68,117,109,109,
-    121,77,111,100,117,108,101,76,111,99,107,46,95,95,105,110,
-    105,116,95,95,99,1,0,0,0,0,0,0,0,1,0,0,
-    0,3,0,0,0,67,0,0,0,115,19,0,0,0,124,0,
-    0,4,106,0,0,100,1,0,55,2,95,0,0,100,2,0,
-    83,40,3,0,0,0,78,105,1,0,0,0,84,40,2,0,
-    0,0,117,5,0,0,0,99,111,117,110,116,117,4,0,0,
-    0,84,114,117,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,97,99,113,117,105,114,101,251,0,0,0,115,
-    4,0,0,0,0,1,15,1,117,24,0,0,0,95,68,117,
-    109,109,121,77,111,100,117,108,101,76,111,99,107,46,97,99,
-    113,117,105,114,101,99,1,0,0,0,0,0,0,0,1,0,
-    0,0,3,0,0,0,67,0,0,0,115,49,0,0,0,124,
-    0,0,106,0,0,100,1,0,107,2,0,114,30,0,116,1,
-    0,100,2,0,131,1,0,130,1,0,110,0,0,124,0,0,
-    4,106,0,0,100,3,0,56,2,95,0,0,100,0,0,83,
-    40,4,0,0,0,78,105,0,0,0,0,117,31,0,0,0,
-    99,97,110,110,111,116,32,114,101,108,101,97,115,101,32,117,
-    110,45,97,99,113,117,105,114,101,100,32,108,111,99,107,105,
-    1,0,0,0,40,2,0,0,0,117,5,0,0,0,99,111,
-    117,110,116,117,12,0,0,0,82,117,110,116,105,109,101,69,
-    114,114,111,114,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,114,101,108,101,97,115,101,255,0,0,0,115,6,
-    0,0,0,0,1,15,1,15,1,117,24,0,0,0,95,68,
-    117,109,109,121,77,111,100,117,108,101,76,111,99,107,46,114,
-    101,108,101,97,115,101,99,1,0,0,0,0,0,0,0,1,
-    0,0,0,4,0,0,0,67,0,0,0,115,23,0,0,0,
-    100,1,0,124,0,0,106,0,0,116,1,0,124,0,0,131,
-    1,0,102,2,0,22,83,40,2,0,0,0,78,117,26,0,
-    0,0,95,68,117,109,109,121,77,111,100,117,108,101,76,111,
-    99,107,40,37,114,41,32,97,116,32,37,100,40,2,0,0,
-    0,117,4,0,0,0,110,97,109,101,117,2,0,0,0,105,
-    100,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,4,1,0,0,115,2,0,0,
-    0,0,1,117,25,0,0,0,95,68,117,109,109,121,77,111,
-    100,117,108,101,76,111,99,107,46,95,95,114,101,112,114,95,
-    95,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,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,7,0,
-    0,0,97,99,113,117,105,114,101,117,7,0,0,0,114,101,
-    108,101,97,115,101,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,16,0,0,0,95,68,117,109,109,121,77,111,100,
-    117,108,101,76,111,99,107,243,0,0,0,115,10,0,0,0,
-    16,2,6,2,12,4,12,4,12,5,117,16,0,0,0,95,
-    68,117,109,109,121,77,111,100,117,108,101,76,111,99,107,99,
-    1,0,0,0,0,0,0,0,3,0,0,0,11,0,0,0,
-    3,0,0,0,115,142,0,0,0,100,3,0,125,1,0,121,
-    17,0,116,1,0,136,0,0,25,131,0,0,125,1,0,87,
-    110,18,0,4,116,2,0,107,10,0,114,43,0,1,1,1,
-    89,110,1,0,88,124,1,0,100,3,0,107,8,0,114,138,
-    0,116,3,0,100,3,0,107,8,0,114,83,0,116,4,0,
-    136,0,0,131,1,0,125,1,0,110,12,0,116,5,0,136,
-    0,0,131,1,0,125,1,0,135,0,0,102,1,0,100,1,
-    0,100,2,0,134,0,0,125,2,0,116,6,0,106,7,0,
-    124,1,0,124,2,0,131,2,0,116,1,0,136,0,0,60,
-    110,0,0,124,1,0,83,40,4,0,0,0,117,109,0,0,
-    0,71,101,116,32,111,114,32,99,114,101,97,116,101,32,116,
-    104,101,32,109,111,100,117,108,101,32,108,111,99,107,32,102,
-    111,114,32,97,32,103,105,118,101,110,32,109,111,100,117,108,
-    101,32,110,97,109,101,46,10,10,32,32,32,32,83,104,111,
-    117,108,100,32,111,110,108,121,32,98,101,32,99,97,108,108,
-    101,100,32,119,105,116,104,32,116,104,101,32,105,109,112,111,
-    114,116,32,108,111,99,107,32,116,97,107,101,110,46,99,1,
-    0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,19,
-    0,0,0,115,11,0,0,0,116,0,0,136,0,0,61,100,
-    0,0,83,40,1,0,0,0,78,40,1,0,0,0,117,13,
-    0,0,0,95,109,111,100,117,108,101,95,108,111,99,107,115,
-    40,1,0,0,0,117,1,0,0,0,95,40,1,0,0,0,
-    117,4,0,0,0,110,97,109,101,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,2,0,0,0,99,98,24,1,0,0,115,2,0,0,0,
-    0,1,117,28,0,0,0,95,103,101,116,95,109,111,100,117,
-    108,101,95,108,111,99,107,46,60,108,111,99,97,108,115,62,
-    46,99,98,78,40,8,0,0,0,117,4,0,0,0,78,111,
-    110,101,117,13,0,0,0,95,109,111,100,117,108,101,95,108,
-    111,99,107,115,117,8,0,0,0,75,101,121,69,114,114,111,
-    114,117,7,0,0,0,95,116,104,114,101,97,100,117,16,0,
-    0,0,95,68,117,109,109,121,77,111,100,117,108,101,76,111,
-    99,107,117,11,0,0,0,95,77,111,100,117,108,101,76,111,
-    99,107,117,8,0,0,0,95,119,101,97,107,114,101,102,117,
-    3,0,0,0,114,101,102,40,3,0,0,0,117,4,0,0,
-    0,110,97,109,101,117,4,0,0,0,108,111,99,107,117,2,
-    0,0,0,99,98,40,0,0,0,0,40,1,0,0,0,117,
-    4,0,0,0,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,16,0,0,0,95,
-    103,101,116,95,109,111,100,117,108,101,95,108,111,99,107,10,
-    1,0,0,115,24,0,0,0,0,4,6,1,3,1,17,1,
-    13,1,5,1,12,1,12,1,15,2,12,1,18,2,25,1,
-    117,16,0,0,0,95,103,101,116,95,109,111,100,117,108,101,
-    95,108,111,99,107,99,1,0,0,0,0,0,0,0,2,0,
-    0,0,11,0,0,0,67,0,0,0,115,71,0,0,0,116,
-    0,0,124,0,0,131,1,0,125,1,0,116,1,0,106,2,
-    0,131,0,0,1,121,14,0,124,1,0,106,3,0,131,0,
-    0,1,87,110,18,0,4,116,4,0,107,10,0,114,56,0,
-    1,1,1,89,110,11,0,88,124,1,0,106,5,0,131,0,
-    0,1,100,1,0,83,40,2,0,0,0,117,21,1,0,0,
-    82,101,108,101,97,115,101,32,116,104,101,32,103,108,111,98,
-    97,108,32,105,109,112,111,114,116,32,108,111,99,107,44,32,
-    97,110,100,32,97,99,113,117,105,114,101,115,32,116,104,101,
-    110,32,114,101,108,101,97,115,101,32,116,104,101,10,32,32,
-    32,32,109,111,100,117,108,101,32,108,111,99,107,32,102,111,
-    114,32,97,32,103,105,118,101,110,32,109,111,100,117,108,101,
-    32,110,97,109,101,46,10,32,32,32,32,84,104,105,115,32,
-    105,115,32,117,115,101,100,32,116,111,32,101,110,115,117,114,
-    101,32,97,32,109,111,100,117,108,101,32,105,115,32,99,111,
-    109,112,108,101,116,101,108,121,32,105,110,105,116,105,97,108,
-    105,122,101,100,44,32,105,110,32,116,104,101,10,32,32,32,
-    32,101,118,101,110,116,32,105,116,32,105,115,32,98,101,105,
-    110,103,32,105,109,112,111,114,116,101,100,32,98,121,32,97,
-    110,111,116,104,101,114,32,116,104,114,101,97,100,46,10,10,
+    124,1,0,124,0,0,95,0,0,100,0,0,124,0,0,95,
+    1,0,100,0,0,83,41,1,78,41,2,114,70,0,0,0,
+    218,5,95,108,111,99,107,41,2,114,71,0,0,0,114,67,
+    0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0,
+    0,0,114,72,0,0,0,1,1,0,0,115,4,0,0,0,
+    0,1,9,1,122,27,95,77,111,100,117,108,101,76,111,99,
+    107,77,97,110,97,103,101,114,46,95,95,105,110,105,116,95,
+    95,99,1,0,0,0,0,0,0,0,1,0,0,0,10,0,
+    0,0,67,0,0,0,115,53,0,0,0,122,22,0,116,0,
+    0,124,0,0,106,1,0,131,1,0,124,0,0,95,2,0,
+    87,100,0,0,116,3,0,106,4,0,131,0,0,1,88,124,
+    0,0,106,2,0,106,5,0,131,0,0,1,100,0,0,83,
+    41,1,78,41,6,218,16,95,103,101,116,95,109,111,100,117,
+    108,101,95,108,111,99,107,114,70,0,0,0,114,104,0,0,
+    0,218,4,95,105,109,112,218,12,114,101,108,101,97,115,101,
+    95,108,111,99,107,114,97,0,0,0,41,1,114,71,0,0,
+    0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,
+    114,75,0,0,0,5,1,0,0,115,8,0,0,0,0,1,
+    3,1,22,2,11,1,122,28,95,77,111,100,117,108,101,76,
+    111,99,107,77,97,110,97,103,101,114,46,95,95,101,110,116,
+    101,114,95,95,99,1,0,0,0,0,0,0,0,3,0,0,
+    0,1,0,0,0,79,0,0,0,115,17,0,0,0,124,0,
+    0,106,0,0,106,1,0,131,0,0,1,100,0,0,83,41,
+    1,78,41,2,114,104,0,0,0,114,98,0,0,0,41,3,
+    114,71,0,0,0,114,80,0,0,0,218,6,107,119,97,114,
+    103,115,114,4,0,0,0,114,4,0,0,0,114,5,0,0,
+    0,114,81,0,0,0,12,1,0,0,115,2,0,0,0,0,
+    1,122,27,95,77,111,100,117,108,101,76,111,99,107,77,97,
+    110,97,103,101,114,46,95,95,101,120,105,116,95,95,78,41,
+    6,114,57,0,0,0,114,56,0,0,0,114,58,0,0,0,
+    114,72,0,0,0,114,75,0,0,0,114,81,0,0,0,114,
+    4,0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,
+    0,0,0,114,103,0,0,0,255,0,0,0,115,6,0,0,
+    0,12,2,12,4,12,7,114,103,0,0,0,99,1,0,0,
+    0,0,0,0,0,3,0,0,0,11,0,0,0,3,0,0,
+    0,115,142,0,0,0,100,1,0,125,1,0,121,17,0,116,
+    0,0,136,0,0,25,131,0,0,125,1,0,87,110,18,0,
+    4,116,1,0,107,10,0,114,43,0,1,1,1,89,110,1,
+    0,88,124,1,0,100,1,0,107,8,0,114,138,0,116,2,
+    0,100,1,0,107,8,0,114,83,0,116,3,0,136,0,0,
+    131,1,0,125,1,0,110,12,0,116,4,0,136,0,0,131,
+    1,0,125,1,0,135,0,0,102,1,0,100,2,0,100,3,
+    0,134,0,0,125,2,0,116,5,0,106,6,0,124,1,0,
+    124,2,0,131,2,0,116,0,0,136,0,0,60,110,0,0,
+    124,1,0,83,41,4,122,109,71,101,116,32,111,114,32,99,
+    114,101,97,116,101,32,116,104,101,32,109,111,100,117,108,101,
+    32,108,111,99,107,32,102,111,114,32,97,32,103,105,118,101,
+    110,32,109,111,100,117,108,101,32,110,97,109,101,46,10,10,
     32,32,32,32,83,104,111,117,108,100,32,111,110,108,121,32,
     98,101,32,99,97,108,108,101,100,32,119,105,116,104,32,116,
     104,101,32,105,109,112,111,114,116,32,108,111,99,107,32,116,
-    97,107,101,110,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,14,0,0,0,95,68,101,97,100,
-    108,111,99,107,69,114,114,111,114,117,7,0,0,0,114,101,
-    108,101,97,115,101,40,2,0,0,0,117,4,0,0,0,110,
-    97,109,101,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,19,0,0,0,95,108,111,
-    99,107,95,117,110,108,111,99,107,95,109,111,100,117,108,101,
-    29,1,0,0,115,14,0,0,0,0,7,12,1,10,1,3,
-    1,14,1,13,3,5,2,117,19,0,0,0,95,108,111,99,
-    107,95,117,110,108,111,99,107,95,109,111,100,117,108,101,99,
-    1,0,0,0,0,0,0,0,3,0,0,0,3,0,0,0,
-    79,0,0,0,115,13,0,0,0,124,0,0,124,1,0,124,
-    2,0,142,0,0,83,40,1,0,0,0,117,46,1,0,0,
-    114,101,109,111,118,101,95,105,109,112,111,114,116,108,105,98,
-    95,102,114,97,109,101,115,32,105,110,32,105,109,112,111,114,
-    116,46,99,32,119,105,108,108,32,97,108,119,97,121,115,32,
-    114,101,109,111,118,101,32,115,101,113,117,101,110,99,101,115,
-    10,32,32,32,32,111,102,32,105,109,112,111,114,116,108,105,
-    98,32,102,114,97,109,101,115,32,116,104,97,116,32,101,110,
-    100,32,119,105,116,104,32,97,32,99,97,108,108,32,116,111,
-    32,116,104,105,115,32,102,117,110,99,116,105,111,110,10,10,
-    32,32,32,32,85,115,101,32,105,116,32,105,110,115,116,101,
-    97,100,32,111,102,32,97,32,110,111,114,109,97,108,32,99,
-    97,108,108,32,105,110,32,112,108,97,99,101,115,32,119,104,
-    101,114,101,32,105,110,99,108,117,100,105,110,103,32,116,104,
-    101,32,105,109,112,111,114,116,108,105,98,10,32,32,32,32,
-    102,114,97,109,101,115,32,105,110,116,114,111,100,117,99,101,
-    115,32,117,110,119,97,110,116,101,100,32,110,111,105,115,101,
-    32,105,110,116,111,32,116,104,101,32,116,114,97,99,101,98,
-    97,99,107,32,40,101,46,103,46,32,119,104,101,110,32,101,
-    120,101,99,117,116,105,110,103,10,32,32,32,32,109,111,100,
-    117,108,101,32,99,111,100,101,41,10,32,32,32,32,40,0,
-    0,0,0,40,3,0,0,0,117,1,0,0,0,102,117,4,
-    0,0,0,97,114,103,115,117,4,0,0,0,107,119,100,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,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,49,1,0,0,115,2,
-    0,0,0,0,8,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,105,158,12,0,0,117,1,0,0,0,13,105,16,
-    0,0,0,117,1,0,0,0,10,105,24,0,0,0,99,1,
-    0,0,0,0,0,0,0,2,0,0,0,3,0,0,0,99,
-    0,0,0,115,29,0,0,0,124,0,0,93,19,0,125,1,
-    0,116,0,0,124,1,0,63,100,0,0,64,86,1,113,3,
-    0,100,1,0,83,40,2,0,0,0,105,255,0,0,0,78,
-    40,1,0,0,0,117,17,0,0,0,95,82,65,87,95,77,
-    65,71,73,67,95,78,85,77,66,69,82,40,2,0,0,0,
-    117,2,0,0,0,46,48,117,1,0,0,0,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,150,1,0,0,115,2,0,0,0,
-    6,0,117,9,0,0,0,60,103,101,110,101,120,112,114,62,
-    105,0,0,0,0,105,25,0,0,0,105,8,0,0,0,117,
-    11,0,0,0,95,95,112,121,99,97,99,104,101,95,95,117,
-    3,0,0,0,46,112,121,117,4,0,0,0,46,112,121,99,
-    117,4,0,0,0,46,112,121,111,99,2,0,0,0,0,0,
-    0,0,11,0,0,0,6,0,0,0,67,0,0,0,115,180,
-    0,0,0,124,1,0,100,5,0,107,8,0,114,25,0,116,
-    1,0,106,2,0,106,3,0,12,110,3,0,124,1,0,125,
-    2,0,124,2,0,114,46,0,116,4,0,125,3,0,110,6,
-    0,116,5,0,125,3,0,116,6,0,124,0,0,131,1,0,
-    92,2,0,125,4,0,125,5,0,124,5,0,106,7,0,100,
-    1,0,131,1,0,92,3,0,125,6,0,125,7,0,125,8,
-    0,116,1,0,106,8,0,106,9,0,125,9,0,124,9,0,
-    100,5,0,107,8,0,114,133,0,116,10,0,100,2,0,131,
-    1,0,130,1,0,110,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,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,46,112,121,99,47,46,112,121,111,32,
-    102,105,108,101,46,10,10,32,32,32,32,84,104,101,32,46,
-    112,121,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,32,
-    116,104,101,10,32,32,32,32,46,112,121,99,47,46,112,121,
-    111,32,102,105,108,101,32,99,97,108,99,117,108,97,116,101,
-    100,32,97,115,32,105,102,32,116,104,101,32,46,112,121,32,
-    102,105,108,101,32,119,101,114,101,32,105,109,112,111,114,116,
-    101,100,46,32,32,84,104,101,32,101,120,116,101,110,115,105,
-    111,110,10,32,32,32,32,119,105,108,108,32,98,101,32,46,
-    112,121,99,32,117,110,108,101,115,115,32,115,121,115,46,102,
-    108,97,103,115,46,111,112,116,105,109,105,122,101,32,105,115,
-    32,110,111,110,45,122,101,114,111,44,32,116,104,101,110,32,
-    105,116,32,119,105,108,108,32,98,101,32,46,112,121,111,46,
-    10,10,32,32,32,32,73,102,32,100,101,98,117,103,95,111,
-    118,101,114,114,105,100,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,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,
+    97,107,101,110,46,78,99,1,0,0,0,0,0,0,0,1,
+    0,0,0,2,0,0,0,19,0,0,0,115,11,0,0,0,
+    116,0,0,136,0,0,61,100,0,0,83,41,1,78,41,1,
+    218,13,95,109,111,100,117,108,101,95,108,111,99,107,115,41,
+    1,114,36,0,0,0,41,1,114,67,0,0,0,114,4,0,
+    0,0,114,5,0,0,0,218,2,99,98,32,1,0,0,115,
+    2,0,0,0,0,1,122,28,95,103,101,116,95,109,111,100,
+    117,108,101,95,108,111,99,107,46,60,108,111,99,97,108,115,
+    62,46,99,98,41,7,114,109,0,0,0,114,79,0,0,0,
+    114,85,0,0,0,114,102,0,0,0,114,83,0,0,0,218,
+    8,95,119,101,97,107,114,101,102,90,3,114,101,102,41,3,
+    114,67,0,0,0,114,86,0,0,0,114,110,0,0,0,114,
+    4,0,0,0,41,1,114,67,0,0,0,114,5,0,0,0,
+    114,105,0,0,0,18,1,0,0,115,24,0,0,0,0,4,
+    6,1,3,1,17,1,13,1,5,1,12,1,12,1,15,2,
+    12,1,18,2,25,1,114,105,0,0,0,99,1,0,0,0,
+    0,0,0,0,2,0,0,0,11,0,0,0,67,0,0,0,
+    115,71,0,0,0,116,0,0,124,0,0,131,1,0,125,1,
+    0,116,1,0,106,2,0,131,0,0,1,121,14,0,124,1,
+    0,106,3,0,131,0,0,1,87,110,18,0,4,116,4,0,
+    107,10,0,114,56,0,1,1,1,89,110,11,0,88,124,1,
+    0,106,5,0,131,0,0,1,100,1,0,83,41,2,97,21,
+    1,0,0,82,101,108,101,97,115,101,32,116,104,101,32,103,
+    108,111,98,97,108,32,105,109,112,111,114,116,32,108,111,99,
+    107,44,32,97,110,100,32,97,99,113,117,105,114,101,115,32,
+    116,104,101,110,32,114,101,108,101,97,115,101,32,116,104,101,
+    10,32,32,32,32,109,111,100,117,108,101,32,108,111,99,107,
+    32,102,111,114,32,97,32,103,105,118,101,110,32,109,111,100,
+    117,108,101,32,110,97,109,101,46,10,32,32,32,32,84,104,
+    105,115,32,105,115,32,117,115,101,100,32,116,111,32,101,110,
+    115,117,114,101,32,97,32,109,111,100,117,108,101,32,105,115,
+    32,99,111,109,112,108,101,116,101,108,121,32,105,110,105,116,
+    105,97,108,105,122,101,100,44,32,105,110,32,116,104,101,10,
+    32,32,32,32,101,118,101,110,116,32,105,116,32,105,115,32,
+    98,101,105,110,103,32,105,109,112,111,114,116,101,100,32,98,
+    121,32,97,110,111,116,104,101,114,32,116,104,114,101,97,100,
+    46,10,10,32,32,32,32,83,104,111,117,108,100,32,111,110,
+    108,121,32,98,101,32,99,97,108,108,101,100,32,119,105,116,
+    104,32,116,104,101,32,105,109,112,111,114,116,32,108,111,99,
+    107,32,116,97,107,101,110,46,78,41,6,114,105,0,0,0,
+    114,106,0,0,0,114,107,0,0,0,114,97,0,0,0,114,
+    82,0,0,0,114,98,0,0,0,41,2,114,67,0,0,0,
+    114,86,0,0,0,114,4,0,0,0,114,4,0,0,0,114,
+    5,0,0,0,218,19,95,108,111,99,107,95,117,110,108,111,
+    99,107,95,109,111,100,117,108,101,37,1,0,0,115,14,0,
+    0,0,0,7,12,1,10,1,3,1,14,1,13,3,5,2,
+    114,112,0,0,0,99,1,0,0,0,0,0,0,0,3,0,
+    0,0,3,0,0,0,79,0,0,0,115,13,0,0,0,124,
+    0,0,124,1,0,124,2,0,142,0,0,83,41,1,97,46,
+    1,0,0,114,101,109,111,118,101,95,105,109,112,111,114,116,
+    108,105,98,95,102,114,97,109,101,115,32,105,110,32,105,109,
+    112,111,114,116,46,99,32,119,105,108,108,32,97,108,119,97,
+    121,115,32,114,101,109,111,118,101,32,115,101,113,117,101,110,
+    99,101,115,10,32,32,32,32,111,102,32,105,109,112,111,114,
+    116,108,105,98,32,102,114,97,109,101,115,32,116,104,97,116,
+    32,101,110,100,32,119,105,116,104,32,97,32,99,97,108,108,
+    32,116,111,32,116,104,105,115,32,102,117,110,99,116,105,111,
+    110,10,10,32,32,32,32,85,115,101,32,105,116,32,105,110,
+    115,116,101,97,100,32,111,102,32,97,32,110,111,114,109,97,
+    108,32,99,97,108,108,32,105,110,32,112,108,97,99,101,115,
+    32,119,104,101,114,101,32,105,110,99,108,117,100,105,110,103,
+    32,116,104,101,32,105,109,112,111,114,116,108,105,98,10,32,
+    32,32,32,102,114,97,109,101,115,32,105,110,116,114,111,100,
+    117,99,101,115,32,117,110,119,97,110,116,101,100,32,110,111,
+    105,115,101,32,105,110,116,111,32,116,104,101,32,116,114,97,
+    99,101,98,97,99,107,32,40,101,46,103,46,32,119,104,101,
+    110,32,101,120,101,99,117,116,105,110,103,10,32,32,32,32,
+    109,111,100,117,108,101,32,99,111,100,101,41,10,32,32,32,
+    32,114,4,0,0,0,41,3,218,1,102,114,80,0,0,0,
+    90,4,107,119,100,115,114,4,0,0,0,114,4,0,0,0,
+    114,5,0,0,0,218,25,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,
+    57,1,0,0,115,2,0,0,0,0,8,114,114,0,0,0,
+    105,238,12,0,0,233,2,0,0,0,114,13,0,0,0,115,
+    2,0,0,0,13,10,90,11,95,95,112,121,99,97,99,104,
+    101,95,95,122,3,46,112,121,122,4,46,112,121,99,122,4,
+    46,112,121,111,78,99,2,0,0,0,0,0,0,0,11,0,
+    0,0,6,0,0,0,67,0,0,0,115,192,0,0,0,124,
+    1,0,100,1,0,107,8,0,114,25,0,116,0,0,106,1,
+    0,106,2,0,12,110,3,0,124,1,0,125,2,0,124,2,
+    0,114,46,0,116,3,0,125,3,0,110,6,0,116,4,0,
+    125,3,0,116,5,0,124,0,0,131,1,0,92,2,0,125,
+    4,0,125,5,0,124,5,0,106,6,0,100,2,0,131,1,
+    0,92,3,0,125,6,0,125,7,0,125,8,0,116,0,0,
+    106,7,0,106,8,0,125,9,0,124,9,0,100,1,0,107,
+    8,0,114,133,0,116,9,0,100,3,0,131,1,0,130,1,
+    0,110,0,0,100,4,0,106,10,0,124,6,0,114,151,0,
+    124,6,0,110,3,0,124,8,0,124,7,0,124,9,0,124,
+    3,0,100,5,0,25,103,4,0,131,1,0,125,10,0,116,
+    11,0,124,4,0,116,12,0,124,10,0,131,3,0,83,41,
+    6,97,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,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,
+    97,116,104,32,116,111,32,105,116,115,32,46,112,121,99,47,
+    46,112,121,111,32,102,105,108,101,46,10,10,32,32,32,32,
+    84,104,101,32,46,112,121,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,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,124,0,0,100,6,0,100,9,0,133,
-    2,0,25,125,4,0,89,110,1,0,88,116,7,0,124,4,
-    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,2,0,0,0,112,
-    121,78,105,253,255,255,255,105,255,255,255,255,105,255,255,255,
-    255,40,8,0,0,0,117,3,0,0,0,108,101,110,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,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,95,112,97,116,104,95,105,115,102,105,108,101,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,1,3,1,16,1,19,1,21,1,117,
-    15,0,0,0,95,103,101,116,95,115,111,117,114,99,101,102,
-    105,108,101,117,9,0,0,0,118,101,114,98,111,115,105,116,
-    121,105,1,0,0,0,99,1,0,0,0,1,0,0,0,3,
-    0,0,0,4,0,0,0,71,0,0,0,115,81,0,0,0,
-    116,0,0,106,1,0,106,2,0,124,1,0,107,5,0,114,
-    77,0,124,0,0,106,3,0,100,6,0,131,1,0,115,46,
-    0,100,3,0,124,0,0,23,125,0,0,110,0,0,116,4,
-    0,124,0,0,106,5,0,124,2,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,3,0,0,0,117,7,0,0,0,109,101,
-    115,115,97,103,101,117,9,0,0,0,118,101,114,98,111,115,
-    105,116,121,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,228,1,0,
-    0,115,8,0,0,0,0,2,18,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,
-    238,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,236,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,18,0,0,0,115,101,116,95,
-    108,111,97,100,101,114,95,119,114,97,112,112,101,114,251,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,
-    249,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,22,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,4,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,
+    104,32,116,111,32,116,104,101,10,32,32,32,32,46,112,121,
+    99,47,46,112,121,111,32,102,105,108,101,32,99,97,108,99,
+    117,108,97,116,101,100,32,97,115,32,105,102,32,116,104,101,
+    32,46,112,121,32,102,105,108,101,32,119,101,114,101,32,105,
+    109,112,111,114,116,101,100,46,32,32,84,104,101,32,101,120,
+    116,101,110,115,105,111,110,10,32,32,32,32,119,105,108,108,
+    32,98,101,32,46,112,121,99,32,117,110,108,101,115,115,32,
+    115,121,115,46,102,108,97,103,115,46,111,112,116,105,109,105,
+    122,101,32,105,115,32,110,111,110,45,122,101,114,111,44,32,
+    116,104,101,110,32,105,116,32,119,105,108,108,32,98,101,32,
+    46,112,121,111,46,10,10,32,32,32,32,73,102,32,100,101,
+    98,117,103,95,111,118,101,114,114,105,100,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,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,78,218,1,46,122,36,
+    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,114,30,0,0,0,114,84,0,0,0,41,13,
+    114,7,0,0,0,218,5,102,108,97,103,115,218,8,111,112,
+    116,105,109,105,122,101,218,23,68,69,66,85,71,95,66,89,
+    84,69,67,79,68,69,95,83,85,70,70,73,88,69,83,218,
+    27,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,114,38,0,0,
+    0,114,32,0,0,0,218,14,105,109,112,108,101,109,101,110,
+    116,97,116,105,111,110,218,9,99,97,99,104,101,95,116,97,
+    103,218,19,78,111,116,73,109,112,108,101,109,101,110,116,101,
+    100,69,114,114,111,114,114,26,0,0,0,114,28,0,0,0,
+    218,8,95,80,89,67,65,67,72,69,41,11,114,35,0,0,
+    0,90,14,100,101,98,117,103,95,111,118,101,114,114,105,100,
+    101,218,5,100,101,98,117,103,218,8,115,117,102,102,105,120,
+    101,115,218,4,104,101,97,100,114,37,0,0,0,218,4,98,
+    97,115,101,218,3,115,101,112,218,4,114,101,115,116,90,3,
+    116,97,103,218,8,102,105,108,101,110,97,109,101,114,4,0,
+    0,0,114,4,0,0,0,114,5,0,0,0,218,17,99,97,
+    99,104,101,95,102,114,111,109,95,115,111,117,114,99,101,181,
+    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,43,1,114,132,
+    0,0,0,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,1,0,107,8,0,114,33,0,116,
+    3,0,100,2,0,131,1,0,130,1,0,110,0,0,116,4,
+    0,124,0,0,131,1,0,92,2,0,125,1,0,125,2,0,
+    116,4,0,124,1,0,131,1,0,92,2,0,125,1,0,125,
+    3,0,124,3,0,116,5,0,107,3,0,114,108,0,116,6,
+    0,100,3,0,106,7,0,116,5,0,124,0,0,131,2,0,
+    131,1,0,130,1,0,110,0,0,124,2,0,106,8,0,100,
+    4,0,131,1,0,100,5,0,107,3,0,114,153,0,116,6,
+    0,100,6,0,106,7,0,124,2,0,131,1,0,131,1,0,
+    130,1,0,110,0,0,124,2,0,106,9,0,100,4,0,131,
+    1,0,100,7,0,25,125,4,0,116,10,0,124,1,0,124,
+    4,0,116,11,0,100,7,0,25,23,131,2,0,83,41,8,
+    97,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,78,122,
+    36,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,122,37,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,114,116,0,0,
+    0,114,115,0,0,0,122,28,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,114,84,0,0,0,41,12,114,7,0,0,0,
+    114,121,0,0,0,114,122,0,0,0,114,123,0,0,0,114,
+    38,0,0,0,114,124,0,0,0,218,10,86,97,108,117,101,
+    69,114,114,111,114,114,47,0,0,0,114,89,0,0,0,218,
+    9,112,97,114,116,105,116,105,111,110,114,28,0,0,0,218,
+    15,83,79,85,82,67,69,95,83,85,70,70,73,88,69,83,
+    41,5,114,35,0,0,0,114,127,0,0,0,90,16,112,121,
+    99,97,99,104,101,95,102,105,108,101,110,97,109,101,90,7,
+    112,121,99,97,99,104,101,90,13,98,97,115,101,95,102,105,
+    108,101,110,97,109,101,114,4,0,0,0,114,4,0,0,0,
+    114,5,0,0,0,218,17,115,111,117,114,99,101,95,102,114,
+    111,109,95,99,97,99,104,101,208,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,114,136,0,0,0,99,1,
+    0,0,0,0,0,0,0,5,0,0,0,12,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,2,0,83,124,0,
+    0,106,1,0,100,3,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,2,0,131,0,0,100,7,0,100,8,0,133,2,0,25,
+    100,6,0,107,3,0,114,85,0,124,0,0,83,121,16,0,
+    116,3,0,124,0,0,131,1,0,125,4,0,87,110,40,0,
+    4,116,4,0,116,5,0,102,2,0,107,10,0,114,143,0,
+    1,1,1,124,0,0,100,2,0,100,9,0,133,2,0,25,
+    125,4,0,89,110,1,0,88,116,6,0,124,4,0,131,1,
+    0,114,160,0,124,4,0,83,124,0,0,83,41,10,122,188,
+    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,114,84,0,0,
+    0,78,114,116,0,0,0,233,3,0,0,0,114,29,0,0,
+    0,90,2,112,121,233,253,255,255,255,233,255,255,255,255,114,
+    139,0,0,0,41,7,114,31,0,0,0,114,32,0,0,0,
+    218,5,108,111,119,101,114,114,136,0,0,0,114,123,0,0,
+    0,114,133,0,0,0,114,44,0,0,0,41,5,218,13,98,
+    121,116,101,99,111,100,101,95,112,97,116,104,114,130,0,0,
+    0,114,36,0,0,0,90,9,101,120,116,101,110,115,105,111,
+    110,218,11,115,111,117,114,99,101,95,112,97,116,104,114,4,
+    0,0,0,114,4,0,0,0,114,5,0,0,0,218,15,95,
+    103,101,116,95,115,111,117,114,99,101,102,105,108,101,231,1,
+    0,0,115,20,0,0,0,0,7,18,1,4,1,24,1,35,
+    1,4,1,3,1,16,1,19,1,21,1,114,143,0,0,0,
+    99,1,0,0,0,0,0,0,0,2,0,0,0,11,0,0,
+    0,67,0,0,0,115,60,0,0,0,121,19,0,116,0,0,
+    124,0,0,131,1,0,106,1,0,125,1,0,87,110,24,0,
+    4,116,2,0,107,10,0,114,45,0,1,1,1,100,1,0,
+    125,1,0,89,110,1,0,88,124,1,0,100,2,0,79,125,
+    1,0,124,1,0,83,41,3,122,51,67,97,108,99,117,108,
+    97,116,101,32,116,104,101,32,109,111,100,101,32,112,101,114,
+    109,105,115,115,105,111,110,115,32,102,111,114,32,97,32,98,
+    121,116,101,99,111,100,101,32,102,105,108,101,46,105,182,1,
+    0,0,233,128,0,0,0,41,3,114,39,0,0,0,114,41,
+    0,0,0,114,40,0,0,0,41,2,114,35,0,0,0,114,
+    42,0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,
+    0,0,0,218,10,95,99,97,108,99,95,109,111,100,101,250,
+    1,0,0,115,12,0,0,0,0,2,3,1,19,1,13,1,
+    11,3,10,1,114,145,0,0,0,218,9,118,101,114,98,111,
+    115,105,116,121,114,29,0,0,0,99,1,0,0,0,1,0,
+    0,0,3,0,0,0,4,0,0,0,71,0,0,0,115,81,
+    0,0,0,116,0,0,106,1,0,106,2,0,124,1,0,107,
+    5,0,114,77,0,124,0,0,106,3,0,100,6,0,131,1,
+    0,115,46,0,100,3,0,124,0,0,23,125,0,0,110,0,
+    0,116,4,0,124,0,0,106,5,0,124,2,0,140,0,0,
+    100,4,0,116,0,0,106,6,0,131,1,1,1,110,0,0,
+    100,5,0,83,41,7,122,61,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,250,1,35,250,7,105,109,112,111,114,116,
+    32,122,2,35,32,114,54,0,0,0,78,41,2,114,147,0,
+    0,0,114,148,0,0,0,41,7,114,7,0,0,0,114,117,
+    0,0,0,218,7,118,101,114,98,111,115,101,114,9,0,0,
+    0,218,5,112,114,105,110,116,114,47,0,0,0,218,6,115,
+    116,100,101,114,114,41,3,218,7,109,101,115,115,97,103,101,
+    114,146,0,0,0,114,80,0,0,0,114,4,0,0,0,114,
+    4,0,0,0,114,5,0,0,0,218,16,95,118,101,114,98,
+    111,115,101,95,109,101,115,115,97,103,101,6,2,0,0,115,
+    8,0,0,0,0,2,18,1,15,1,13,1,114,153,0,0,
+    0,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,1,0,135,0,
+    0,102,1,0,100,2,0,100,3,0,134,1,0,125,1,0,
+    116,0,0,124,1,0,136,0,0,131,2,0,1,124,1,0,
+    83,41,4,122,252,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,
@@ -1212,2518 +925,2975 @@
     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,67,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,59,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,79,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,77,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,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,90,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,88,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,99,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,
-    125,2,0,0,115,2,0,0,0,0,2,117,27,0,0,0,
+    32,78,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,0,0,125,1,
+    0,110,40,0,124,0,0,106,0,0,124,1,0,107,3,0,
+    114,64,0,116,1,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,41,
+    3,78,122,23,108,111,97,100,101,114,32,99,97,110,110,111,
+    116,32,104,97,110,100,108,101,32,37,115,114,67,0,0,0,
+    41,2,114,67,0,0,0,218,11,73,109,112,111,114,116,69,
+    114,114,111,114,41,4,114,71,0,0,0,114,67,0,0,0,
+    114,80,0,0,0,114,108,0,0,0,41,1,218,6,109,101,
+    116,104,111,100,114,4,0,0,0,114,5,0,0,0,218,19,
+    95,99,104,101,99,107,95,110,97,109,101,95,119,114,97,112,
+    112,101,114,22,2,0,0,115,10,0,0,0,0,1,12,1,
+    12,1,15,1,25,1,122,40,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,
+    41,1,114,65,0,0,0,41,2,114,155,0,0,0,114,156,
+    0,0,0,114,4,0,0,0,41,1,114,155,0,0,0,114,
+    5,0,0,0,218,11,95,99,104,101,99,107,95,110,97,109,
+    101,14,2,0,0,115,6,0,0,0,0,8,21,6,13,1,
+    114,157,0,0,0,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,41,3,122,49,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,41,3,78,122,29,
+    123,33,114,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,114,67,0,
+    0,0,41,4,114,7,0,0,0,218,20,98,117,105,108,116,
+    105,110,95,109,111,100,117,108,101,95,110,97,109,101,115,114,
+    154,0,0,0,114,47,0,0,0,41,2,114,71,0,0,0,
+    218,8,102,117,108,108,110,97,109,101,41,1,218,3,102,120,
+    110,114,4,0,0,0,114,5,0,0,0,218,25,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,34,2,0,0,115,8,0,0,0,0,
+    1,15,1,18,1,12,1,122,52,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,41,1,114,
+    65,0,0,0,41,2,114,160,0,0,0,114,161,0,0,0,
+    114,4,0,0,0,41,1,114,160,0,0,0,114,5,0,0,
+    0,218,17,95,114,101,113,117,105,114,101,115,95,98,117,105,
+    108,116,105,110,32,2,0,0,115,6,0,0,0,0,2,18,
+    5,13,1,114,162,0,0,0,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,41,3,122,47,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,41,3,78,122,
+    27,123,33,114,125,32,105,115,32,110,111,116,32,97,32,102,
+    114,111,122,101,110,32,109,111,100,117,108,101,114,67,0,0,
+    0,41,4,114,106,0,0,0,218,9,105,115,95,102,114,111,
+    122,101,110,114,154,0,0,0,114,47,0,0,0,41,2,114,
+    71,0,0,0,114,159,0,0,0,41,1,114,160,0,0,0,
+    114,4,0,0,0,114,5,0,0,0,218,24,95,114,101,113,
+    117,105,114,101,115,95,102,114,111,122,101,110,95,119,114,97,
+    112,112,101,114,45,2,0,0,115,8,0,0,0,0,1,15,
+    1,18,1,12,1,122,50,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,41,1,114,65,0,0,0,
+    41,2,114,160,0,0,0,114,164,0,0,0,114,4,0,0,
+    0,41,1,114,160,0,0,0,114,5,0,0,0,218,16,95,
+    114,101,113,117,105,114,101,115,95,102,114,111,122,101,110,43,
+    2,0,0,115,6,0,0,0,0,2,18,5,13,1,114,165,
+    0,0,0,99,2,0,0,0,0,0,0,0,5,0,0,0,
+    4,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,1,0,107,8,0,114,83,0,116,1,
+    0,124,3,0,131,1,0,114,83,0,100,2,0,125,4,0,
+    116,2,0,106,3,0,124,4,0,106,4,0,124,3,0,100,
+    3,0,25,131,1,0,116,5,0,131,2,0,1,110,0,0,
+    124,2,0,83,41,4,122,155,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,10,10,
+    32,32,32,32,84,104,105,115,32,109,101,116,104,111,100,32,
+    105,115,32,100,101,112,114,101,99,97,116,101,100,32,105,110,
+    32,102,97,118,111,114,32,111,102,32,102,105,110,100,101,114,
+    46,102,105,110,100,95,115,112,101,99,40,41,46,10,10,32,
+    32,32,32,78,122,44,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,114,84,0,0,0,41,6,218,11,102,105,110,100,95,
+    108,111,97,100,101,114,114,31,0,0,0,218,9,95,119,97,
+    114,110,105,110,103,115,218,4,119,97,114,110,114,47,0,0,
+    0,218,13,73,109,112,111,114,116,87,97,114,110,105,110,103,
+    41,5,114,71,0,0,0,114,159,0,0,0,218,6,108,111,
+    97,100,101,114,218,8,112,111,114,116,105,111,110,115,218,3,
+    109,115,103,114,4,0,0,0,114,4,0,0,0,114,5,0,
+    0,0,218,17,95,102,105,110,100,95,109,111,100,117,108,101,
+    95,115,104,105,109,54,2,0,0,115,10,0,0,0,0,10,
+    21,1,24,1,6,1,32,1,114,173,0,0,0,99,2,0,
+    0,0,0,0,0,0,5,0,0,0,3,0,0,0,67,0,
+    0,0,115,93,0,0,0,116,0,0,124,1,0,124,0,0,
+    131,2,0,125,2,0,116,1,0,124,2,0,131,1,0,125,
+    3,0,124,1,0,116,2,0,106,3,0,107,6,0,114,79,
+    0,116,2,0,106,3,0,124,1,0,25,125,4,0,124,3,
+    0,106,4,0,124,4,0,131,1,0,1,116,2,0,106,3,
+    0,124,1,0,25,83,124,3,0,106,5,0,131,0,0,83,
+    100,1,0,83,41,2,122,128,76,111,97,100,32,116,104,101,
+    32,115,112,101,99,105,102,105,101,100,32,109,111,100,117,108,
+    101,32,105,110,116,111,32,115,121,115,46,109,111,100,117,108,
+    101,115,32,97,110,100,32,114,101,116,117,114,110,32,105,116,
+    46,10,10,32,32,32,32,84,104,105,115,32,109,101,116,104,
+    111,100,32,105,115,32,100,101,112,114,101,99,97,116,101,100,
+    46,32,32,85,115,101,32,108,111,97,100,101,114,46,101,120,
+    101,99,95,109,111,100,117,108,101,32,105,110,115,116,101,97,
+    100,46,10,10,32,32,32,32,78,41,6,218,16,115,112,101,
+    99,95,102,114,111,109,95,108,111,97,100,101,114,218,12,95,
+    83,112,101,99,77,101,116,104,111,100,115,114,7,0,0,0,
+    114,73,0,0,0,218,4,101,120,101,99,218,4,108,111,97,
+    100,41,5,114,71,0,0,0,114,159,0,0,0,218,4,115,
+    112,101,99,218,7,109,101,116,104,111,100,115,218,6,109,111,
+    100,117,108,101,114,4,0,0,0,114,4,0,0,0,114,5,
+    0,0,0,218,17,95,108,111,97,100,95,109,111,100,117,108,
+    101,95,115,104,105,109,71,2,0,0,115,14,0,0,0,0,
+    6,15,1,12,1,15,1,13,1,13,1,11,2,114,181,0,
+    0,0,99,4,0,0,0,0,0,0,0,11,0,0,0,19,
+    0,0,0,67,0,0,0,115,243,1,0,0,105,0,0,125,
+    4,0,124,2,0,100,1,0,107,9,0,114,31,0,124,2,
+    0,124,4,0,100,2,0,60,110,6,0,100,3,0,125,2,
+    0,124,3,0,100,1,0,107,9,0,114,62,0,124,3,0,
+    124,4,0,100,4,0,60,110,0,0,124,0,0,100,1,0,
+    100,5,0,133,2,0,25,125,5,0,124,0,0,100,5,0,
+    100,6,0,133,2,0,25,125,6,0,124,0,0,100,6,0,
+    100,7,0,133,2,0,25,125,7,0,124,5,0,116,0,0,
+    107,3,0,114,168,0,100,8,0,106,1,0,124,2,0,124,
+    5,0,131,2,0,125,8,0,116,2,0,124,8,0,131,1,
+    0,1,116,3,0,124,8,0,124,4,0,141,1,0,130,1,
+    0,110,116,0,116,4,0,124,6,0,131,1,0,100,5,0,
+    107,3,0,114,226,0,100,9,0,106,1,0,124,2,0,131,
+    1,0,125,8,0,116,2,0,124,8,0,131,1,0,1,116,
+    5,0,124,8,0,131,1,0,130,1,0,110,58,0,116,4,
+    0,124,7,0,131,1,0,100,5,0,107,3,0,114,28,1,
+    100,10,0,106,1,0,124,2,0,131,1,0,125,8,0,116,
+    2,0,124,8,0,131,1,0,1,116,5,0,124,8,0,131,
+    1,0,130,1,0,110,0,0,124,1,0,100,1,0,107,9,
+    0,114,229,1,121,20,0,116,6,0,124,1,0,100,11,0,
+    25,131,1,0,125,9,0,87,110,18,0,4,116,7,0,107,
+    10,0,114,80,1,1,1,1,89,110,62,0,88,116,8,0,
+    124,6,0,131,1,0,124,9,0,107,3,0,114,142,1,100,
+    12,0,106,1,0,124,2,0,131,1,0,125,8,0,116,2,
+    0,124,8,0,131,1,0,1,116,3,0,124,8,0,124,4,
+    0,141,1,0,130,1,0,110,0,0,121,18,0,124,1,0,
+    100,13,0,25,100,14,0,64,125,10,0,87,110,18,0,4,
+    116,7,0,107,10,0,114,180,1,1,1,1,89,113,229,1,
+    88,116,8,0,124,7,0,131,1,0,124,10,0,107,3,0,
+    114,229,1,116,3,0,100,12,0,106,1,0,124,2,0,131,
+    1,0,124,4,0,141,1,0,130,1,0,113,229,1,110,0,
+    0,124,0,0,100,7,0,100,1,0,133,2,0,25,83,41,
+    15,97,122,1,0,0,86,97,108,105,100,97,116,101,32,116,
+    104,101,32,104,101,97,100,101,114,32,111,102,32,116,104,101,
+    32,112,97,115,115,101,100,45,105,110,32,98,121,116,101,99,
+    111,100,101,32,97,103,97,105,110,115,116,32,115,111,117,114,
+    99,101,95,115,116,97,116,115,32,40,105,102,10,32,32,32,
+    32,103,105,118,101,110,41,32,97,110,100,32,114,101,116,117,
+    114,110,105,110,103,32,116,104,101,32,98,121,116,101,99,111,
+    100,101,32,116,104,97,116,32,99,97,110,32,98,101,32,99,
+    111,109,112,105,108,101,100,32,98,121,32,99,111,109,112,105,
+    108,101,40,41,46,10,10,32,32,32,32,65,108,108,32,111,
+    116,104,101,114,32,97,114,103,117,109,101,110,116,115,32,97,
+    114,101,32,117,115,101,100,32,116,111,32,101,110,104,97,110,
+    99,101,32,101,114,114,111,114,32,114,101,112,111,114,116,105,
+    110,103,46,10,10,32,32,32,32,73,109,112,111,114,116,69,
+    114,114,111,114,32,105,115,32,114,97,105,115,101,100,32,119,
+    104,101,110,32,116,104,101,32,109,97,103,105,99,32,110,117,
+    109,98,101,114,32,105,115,32,105,110,99,111,114,114,101,99,
+    116,32,111,114,32,116,104,101,32,98,121,116,101,99,111,100,
+    101,32,105,115,10,32,32,32,32,102,111,117,110,100,32,116,
+    111,32,98,101,32,115,116,97,108,101,46,32,69,79,70,69,
+    114,114,111,114,32,105,115,32,114,97,105,115,101,100,32,119,
+    104,101,110,32,116,104,101,32,100,97,116,97,32,105,115,32,
+    102,111,117,110,100,32,116,111,32,98,101,10,32,32,32,32,
+    116,114,117,110,99,97,116,101,100,46,10,10,32,32,32,32,
+    78,114,67,0,0,0,122,10,60,98,121,116,101,99,111,100,
+    101,62,114,35,0,0,0,114,12,0,0,0,233,8,0,0,
+    0,233,12,0,0,0,122,30,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,122,43,114,101,97,99,104,101,100,32,
+    69,79,70,32,119,104,105,108,101,32,114,101,97,100,105,110,
+    103,32,116,105,109,101,115,116,97,109,112,32,105,110,32,123,
+    33,114,125,122,48,114,101,97,99,104,101,100,32,69,79,70,
+    32,119,104,105,108,101,32,114,101,97,100,105,110,103,32,115,
+    105,122,101,32,111,102,32,115,111,117,114,99,101,32,105,110,
+    32,123,33,114,125,218,5,109,116,105,109,101,122,26,98,121,
+    116,101,99,111,100,101,32,105,115,32,115,116,97,108,101,32,
+    102,111,114,32,123,33,114,125,218,4,115,105,122,101,108,3,
+    0,0,0,255,127,255,127,3,0,41,9,218,12,77,65,71,
+    73,67,95,78,85,77,66,69,82,114,47,0,0,0,114,153,
+    0,0,0,114,154,0,0,0,114,31,0,0,0,218,8,69,
+    79,70,69,114,114,111,114,114,14,0,0,0,114,79,0,0,
+    0,114,19,0,0,0,41,11,114,53,0,0,0,218,12,115,
+    111,117,114,99,101,95,115,116,97,116,115,114,67,0,0,0,
+    114,35,0,0,0,90,11,101,120,99,95,100,101,116,97,105,
+    108,115,90,5,109,97,103,105,99,90,13,114,97,119,95,116,
+    105,109,101,115,116,97,109,112,90,8,114,97,119,95,115,105,
+    122,101,114,152,0,0,0,218,12,115,111,117,114,99,101,95,
+    109,116,105,109,101,218,11,115,111,117,114,99,101,95,115,105,
+    122,101,114,4,0,0,0,114,4,0,0,0,114,5,0,0,
+    0,218,25,95,118,97,108,105,100,97,116,101,95,98,121,116,
+    101,99,111,100,101,95,104,101,97,100,101,114,87,2,0,0,
+    115,76,0,0,0,0,11,6,1,12,1,13,3,6,1,12,
+    1,13,1,16,1,16,1,16,1,12,1,18,1,10,1,18,
+    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,18,1,3,1,18,1,13,1,5,2,18,1,15,1,15,
+    1,114,191,0,0,0,99,4,0,0,0,0,0,0,0,5,
+    0,0,0,6,0,0,0,67,0,0,0,115,115,0,0,0,
+    116,0,0,106,1,0,124,0,0,131,1,0,125,4,0,116,
+    2,0,124,4,0,116,3,0,131,2,0,114,78,0,116,4,
+    0,100,1,0,124,2,0,131,2,0,1,124,3,0,100,2,
+    0,107,9,0,114,74,0,116,5,0,106,6,0,124,4,0,
+    124,3,0,131,2,0,1,110,0,0,124,4,0,83,116,7,
+    0,100,3,0,106,8,0,124,2,0,131,1,0,100,4,0,
+    124,1,0,100,5,0,124,2,0,131,1,2,130,1,0,100,
+    2,0,83,41,6,122,60,67,111,109,112,105,108,101,32,98,
+    121,116,101,99,111,100,101,32,97,115,32,114,101,116,117,114,
+    110,101,100,32,98,121,32,95,118,97,108,105,100,97,116,101,
+    95,98,121,116,101,99,111,100,101,95,104,101,97,100,101,114,
+    40,41,46,122,21,99,111,100,101,32,111,98,106,101,99,116,
+    32,102,114,111,109,32,123,33,114,125,78,122,23,78,111,110,
+    45,99,111,100,101,32,111,98,106,101,99,116,32,105,110,32,
+    123,33,114,125,114,67,0,0,0,114,35,0,0,0,41,9,
+    218,7,109,97,114,115,104,97,108,90,5,108,111,97,100,115,
+    218,10,105,115,105,110,115,116,97,110,99,101,218,10,95,99,
+    111,100,101,95,116,121,112,101,114,153,0,0,0,114,106,0,
+    0,0,90,16,95,102,105,120,95,99,111,95,102,105,108,101,
+    110,97,109,101,114,154,0,0,0,114,47,0,0,0,41,5,
+    114,53,0,0,0,114,67,0,0,0,114,141,0,0,0,114,
+    142,0,0,0,218,4,99,111,100,101,114,4,0,0,0,114,
+    4,0,0,0,114,5,0,0,0,218,17,95,99,111,109,112,
+    105,108,101,95,98,121,116,101,99,111,100,101,142,2,0,0,
+    115,16,0,0,0,0,2,15,1,15,1,13,1,12,1,19,
+    1,4,2,18,1,114,196,0,0,0,114,84,0,0,0,99,
+    3,0,0,0,0,0,0,0,4,0,0,0,3,0,0,0,
+    67,0,0,0,115,76,0,0,0,116,0,0,116,1,0,131,
+    1,0,125,3,0,124,3,0,106,2,0,116,3,0,124,1,
+    0,131,1,0,131,1,0,1,124,3,0,106,2,0,116,3,
+    0,124,2,0,131,1,0,131,1,0,1,124,3,0,106,2,
+    0,116,4,0,106,5,0,124,0,0,131,1,0,131,1,0,
+    1,124,3,0,83,41,1,122,80,67,111,109,112,105,108,101,
+    32,97,32,99,111,100,101,32,111,98,106,101,99,116,32,105,
+    110,116,111,32,98,121,116,101,99,111,100,101,32,102,111,114,
+    32,119,114,105,116,105,110,103,32,111,117,116,32,116,111,32,
+    97,32,98,121,116,101,45,99,111,109,112,105,108,101,100,10,
+    32,32,32,32,102,105,108,101,46,41,6,218,9,98,121,116,
+    101,97,114,114,97,121,114,186,0,0,0,218,6,101,120,116,
+    101,110,100,114,17,0,0,0,114,192,0,0,0,90,5,100,
+    117,109,112,115,41,4,114,195,0,0,0,114,184,0,0,0,
+    114,190,0,0,0,114,53,0,0,0,114,4,0,0,0,114,
+    4,0,0,0,114,5,0,0,0,218,17,95,99,111,100,101,
+    95,116,111,95,98,121,116,101,99,111,100,101,154,2,0,0,
+    115,10,0,0,0,0,3,12,1,19,1,19,1,22,1,114,
+    199,0,0,0,99,1,0,0,0,0,0,0,0,5,0,0,
+    0,4,0,0,0,67,0,0,0,115,89,0,0,0,100,1,
+    0,100,2,0,108,0,0,125,1,0,116,1,0,106,2,0,
+    124,0,0,131,1,0,106,3,0,125,2,0,124,1,0,106,
+    4,0,124,2,0,131,1,0,125,3,0,116,1,0,106,5,
+    0,100,2,0,100,3,0,131,2,0,125,4,0,124,4,0,
+    106,6,0,124,0,0,106,6,0,124,3,0,100,1,0,25,
+    131,1,0,131,1,0,83,41,4,122,121,68,101,99,111,100,
+    101,32,98,121,116,101,115,32,114,101,112,114,101,115,101,110,
+    116,105,110,103,32,115,111,117,114,99,101,32,99,111,100,101,
+    32,97,110,100,32,114,101,116,117,114,110,32,116,104,101,32,
+    115,116,114,105,110,103,46,10,10,32,32,32,32,85,110,105,
+    118,101,114,115,97,108,32,110,101,119,108,105,110,101,32,115,
+    117,112,112,111,114,116,32,105,115,32,117,115,101,100,32,105,
+    110,32,116,104,101,32,100,101,99,111,100,105,110,103,46,10,
+    32,32,32,32,114,84,0,0,0,78,84,41,7,218,8,116,
+    111,107,101,110,105,122,101,114,49,0,0,0,90,7,66,121,
+    116,101,115,73,79,90,8,114,101,97,100,108,105,110,101,90,
+    15,100,101,116,101,99,116,95,101,110,99,111,100,105,110,103,
+    90,25,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,218,6,100,101,99,
+    111,100,101,41,5,218,12,115,111,117,114,99,101,95,98,121,
+    116,101,115,114,200,0,0,0,90,21,115,111,117,114,99,101,
+    95,98,121,116,101,115,95,114,101,97,100,108,105,110,101,218,
+    8,101,110,99,111,100,105,110,103,90,15,110,101,119,108,105,
+    110,101,95,100,101,99,111,100,101,114,114,4,0,0,0,114,
+    4,0,0,0,114,5,0,0,0,218,13,100,101,99,111,100,
+    101,95,115,111,117,114,99,101,164,2,0,0,115,10,0,0,
+    0,0,5,12,1,18,1,15,1,18,1,114,204,0,0,0,
+    99,1,0,0,0,0,0,0,0,5,0,0,0,35,0,0,
+    0,67,0,0,0,115,15,1,0,0,116,0,0,124,0,0,
+    100,1,0,100,0,0,131,3,0,125,1,0,116,1,0,124,
+    1,0,100,2,0,131,2,0,114,74,0,121,17,0,124,1,
+    0,106,2,0,124,0,0,131,1,0,83,87,113,74,0,4,
+    116,3,0,107,10,0,114,70,0,1,1,1,89,113,74,0,
+    88,110,0,0,121,13,0,124,0,0,106,4,0,125,2,0,
+    87,110,18,0,4,116,5,0,107,10,0,114,107,0,1,1,
+    1,89,110,29,0,88,124,2,0,100,0,0,107,9,0,114,
+    136,0,116,6,0,124,2,0,131,1,0,106,2,0,131,0,
+    0,83,121,13,0,124,0,0,106,7,0,125,3,0,87,110,
+    24,0,4,116,5,0,107,10,0,114,175,0,1,1,1,100,
+    3,0,125,3,0,89,110,1,0,88,121,13,0,124,0,0,
+    106,8,0,125,4,0,87,110,59,0,4,116,5,0,107,10,
+    0,114,250,0,1,1,1,124,1,0,100,0,0,107,8,0,
+    114,230,0,100,4,0,106,9,0,124,3,0,131,1,0,83,
+    100,5,0,106,9,0,124,3,0,124,1,0,131,2,0,83,
+    89,110,17,0,88,100,6,0,106,9,0,124,3,0,124,4,
+    0,131,2,0,83,100,0,0,83,41,7,78,218,10,95,95,
+    108,111,97,100,101,114,95,95,218,11,109,111,100,117,108,101,
+    95,114,101,112,114,250,1,63,122,13,60,109,111,100,117,108,
+    101,32,123,33,114,125,62,122,20,60,109,111,100,117,108,101,
+    32,123,33,114,125,32,40,123,33,114,125,41,62,122,23,60,
+    109,111,100,117,108,101,32,123,33,114,125,32,102,114,111,109,
+    32,123,33,114,125,62,41,10,114,62,0,0,0,114,60,0,
+    0,0,114,206,0,0,0,218,9,69,120,99,101,112,116,105,
+    111,110,218,8,95,95,115,112,101,99,95,95,218,14,65,116,
+    116,114,105,98,117,116,101,69,114,114,111,114,114,175,0,0,
+    0,114,57,0,0,0,218,8,95,95,102,105,108,101,95,95,
+    114,47,0,0,0,41,5,114,180,0,0,0,114,170,0,0,
+    0,114,178,0,0,0,114,67,0,0,0,114,131,0,0,0,
+    114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,218,
+    12,95,109,111,100,117,108,101,95,114,101,112,114,178,2,0,
+    0,115,46,0,0,0,0,2,18,1,15,4,3,1,17,1,
+    13,1,8,1,3,1,13,1,13,1,5,2,12,1,16,4,
+    3,1,13,1,13,1,11,1,3,1,13,1,13,1,12,1,
+    13,2,21,2,114,212,0,0,0,99,0,0,0,0,0,0,
+    0,0,0,0,0,0,2,0,0,0,64,0,0,0,115,52,
+    0,0,0,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,83,41,8,218,17,95,105,110,115,116,
+    97,108,108,101,100,95,115,97,102,101,108,121,99,2,0,0,
+    0,0,0,0,0,2,0,0,0,2,0,0,0,67,0,0,
+    0,115,25,0,0,0,124,1,0,124,0,0,95,0,0,124,
+    1,0,106,1,0,124,0,0,95,2,0,100,0,0,83,41,
+    1,78,41,3,218,7,95,109,111,100,117,108,101,114,209,0,
+    0,0,218,5,95,115,112,101,99,41,2,114,71,0,0,0,
+    114,180,0,0,0,114,4,0,0,0,114,4,0,0,0,114,
+    5,0,0,0,114,72,0,0,0,216,2,0,0,115,4,0,
+    0,0,0,1,9,1,122,26,95,105,110,115,116,97,108,108,
+    101,100,95,115,97,102,101,108,121,46,95,95,105,110,105,116,
+    95,95,99,1,0,0,0,0,0,0,0,1,0,0,0,3,
+    0,0,0,67,0,0,0,115,38,0,0,0,100,1,0,124,
+    0,0,106,0,0,95,1,0,124,0,0,106,2,0,116,3,
+    0,106,4,0,124,0,0,106,0,0,106,5,0,60,100,0,
+    0,83,41,2,78,84,41,6,114,215,0,0,0,218,13,95,
+    105,110,105,116,105,97,108,105,122,105,110,103,114,214,0,0,
+    0,114,7,0,0,0,114,73,0,0,0,114,67,0,0,0,
+    41,1,114,71,0,0,0,114,4,0,0,0,114,4,0,0,
+    0,114,5,0,0,0,114,75,0,0,0,220,2,0,0,115,
+    4,0,0,0,0,4,12,1,122,27,95,105,110,115,116,97,
+    108,108,101,100,95,115,97,102,101,108,121,46,95,95,101,110,
+    116,101,114,95,95,99,1,0,0,0,0,0,0,0,3,0,
+    0,0,17,0,0,0,71,0,0,0,115,121,0,0,0,122,
+    101,0,124,0,0,106,0,0,125,2,0,116,1,0,100,1,
+    0,100,2,0,132,0,0,124,1,0,68,131,1,0,131,1,
+    0,114,78,0,121,17,0,116,2,0,106,3,0,124,2,0,
+    106,4,0,61,87,113,100,0,4,116,5,0,107,10,0,114,
+    74,0,1,1,1,89,113,100,0,88,110,22,0,116,6,0,
+    100,3,0,124,2,0,106,4,0,124,2,0,106,7,0,131,
+    3,0,1,87,100,0,0,100,4,0,124,0,0,106,0,0,
+    95,8,0,88,100,0,0,83,41,5,78,99,1,0,0,0,
+    0,0,0,0,2,0,0,0,3,0,0,0,115,0,0,0,
+    115,27,0,0,0,124,0,0,93,17,0,125,1,0,124,1,
+    0,100,0,0,107,9,0,86,1,113,3,0,100,0,0,83,
+    41,1,78,114,4,0,0,0,41,2,114,22,0,0,0,114,
+    76,0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,
+    0,0,0,114,77,0,0,0,230,2,0,0,115,2,0,0,
+    0,6,0,122,45,95,105,110,115,116,97,108,108,101,100,95,
+    115,97,102,101,108,121,46,95,95,101,120,105,116,95,95,46,
+    60,108,111,99,97,108,115,62,46,60,103,101,110,101,120,112,
+    114,62,122,18,105,109,112,111,114,116,32,123,33,114,125,32,
+    35,32,123,33,114,125,70,41,9,114,215,0,0,0,114,78,
+    0,0,0,114,7,0,0,0,114,73,0,0,0,114,67,0,
+    0,0,114,79,0,0,0,114,153,0,0,0,114,170,0,0,
+    0,114,216,0,0,0,41,3,114,71,0,0,0,114,80,0,
+    0,0,114,178,0,0,0,114,4,0,0,0,114,4,0,0,
+    0,114,5,0,0,0,114,81,0,0,0,227,2,0,0,115,
+    18,0,0,0,0,1,3,1,9,1,25,1,3,1,17,1,
+    13,1,8,2,26,2,122,26,95,105,110,115,116,97,108,108,
+    101,100,95,115,97,102,101,108,121,46,95,95,101,120,105,116,
+    95,95,78,41,6,114,57,0,0,0,114,56,0,0,0,114,
+    58,0,0,0,114,72,0,0,0,114,75,0,0,0,114,81,
+    0,0,0,114,4,0,0,0,114,4,0,0,0,114,4,0,
+    0,0,114,5,0,0,0,114,213,0,0,0,214,2,0,0,
+    115,6,0,0,0,12,2,12,4,12,7,114,213,0,0,0,
+    99,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,
+    0,64,0,0,0,115,172,0,0,0,101,0,0,90,1,0,
+    100,0,0,90,2,0,100,1,0,90,3,0,100,2,0,100,
+    3,0,100,4,0,100,3,0,100,5,0,100,3,0,100,6,
+    0,100,7,0,132,0,3,90,4,0,100,8,0,100,9,0,
+    132,0,0,90,5,0,100,10,0,100,11,0,132,0,0,90,
+    6,0,101,7,0,100,12,0,100,13,0,132,0,0,131,1,
+    0,90,8,0,101,8,0,106,9,0,100,14,0,100,13,0,
+    132,0,0,131,1,0,90,8,0,101,7,0,100,15,0,100,
+    16,0,132,0,0,131,1,0,90,10,0,101,7,0,100,17,
+    0,100,18,0,132,0,0,131,1,0,90,11,0,101,11,0,
+    106,9,0,100,19,0,100,18,0,132,0,0,131,1,0,90,
+    11,0,100,3,0,83,41,20,218,10,77,111,100,117,108,101,
+    83,112,101,99,97,208,5,0,0,84,104,101,32,115,112,101,
+    99,105,102,105,99,97,116,105,111,110,32,102,111,114,32,97,
+    32,109,111,100,117,108,101,44,32,117,115,101,100,32,102,111,
+    114,32,108,111,97,100,105,110,103,46,10,10,32,32,32,32,
+    65,32,109,111,100,117,108,101,39,115,32,115,112,101,99,32,
+    105,115,32,116,104,101,32,115,111,117,114,99,101,32,102,111,
+    114,32,105,110,102,111,114,109,97,116,105,111,110,32,97,98,
+    111,117,116,32,116,104,101,32,109,111,100,117,108,101,46,32,
+    32,70,111,114,10,32,32,32,32,100,97,116,97,32,97,115,
+    115,111,99,105,97,116,101,100,32,119,105,116,104,32,116,104,
+    101,32,109,111,100,117,108,101,44,32,105,110,99,108,117,100,
+    105,110,103,32,115,111,117,114,99,101,44,32,117,115,101,32,
+    116,104,101,32,115,112,101,99,39,115,10,32,32,32,32,108,
+    111,97,100,101,114,46,10,10,32,32,32,32,96,110,97,109,
+    101,96,32,105,115,32,116,104,101,32,97,98,115,111,108,117,
+    116,101,32,110,97,109,101,32,111,102,32,116,104,101,32,109,
+    111,100,117,108,101,46,32,32,96,108,111,97,100,101,114,96,
+    32,105,115,32,116,104,101,32,108,111,97,100,101,114,10,32,
+    32,32,32,116,111,32,117,115,101,32,119,104,101,110,32,108,
+    111,97,100,105,110,103,32,116,104,101,32,109,111,100,117,108,
+    101,46,32,32,96,112,97,114,101,110,116,96,32,105,115,32,
+    116,104,101,32,110,97,109,101,32,111,102,32,116,104,101,10,
+    32,32,32,32,112,97,99,107,97,103,101,32,116,104,101,32,
+    109,111,100,117,108,101,32,105,115,32,105,110,46,32,32,84,
+    104,101,32,112,97,114,101,110,116,32,105,115,32,100,101,114,
+    105,118,101,100,32,102,114,111,109,32,116,104,101,32,110,97,
+    109,101,46,10,10,32,32,32,32,96,105,115,95,112,97,99,
+    107,97,103,101,96,32,100,101,116,101,114,109,105,110,101,115,
+    32,105,102,32,116,104,101,32,109,111,100,117,108,101,32,105,
+    115,32,99,111,110,115,105,100,101,114,101,100,32,97,32,112,
+    97,99,107,97,103,101,32,111,114,10,32,32,32,32,110,111,
+    116,46,32,32,79,110,32,109,111,100,117,108,101,115,32,116,
+    104,105,115,32,105,115,32,114,101,102,108,101,99,116,101,100,
+    32,98,121,32,116,104,101,32,96,95,95,112,97,116,104,95,
+    95,96,32,97,116,116,114,105,98,117,116,101,46,10,10,32,
+    32,32,32,96,111,114,105,103,105,110,96,32,105,115,32,116,
+    104,101,32,115,112,101,99,105,102,105,99,32,108,111,99,97,
+    116,105,111,110,32,117,115,101,100,32,98,121,32,116,104,101,
+    32,108,111,97,100,101,114,32,102,114,111,109,32,119,104,105,
+    99,104,32,116,111,10,32,32,32,32,108,111,97,100,32,116,
+    104,101,32,109,111,100,117,108,101,44,32,105,102,32,116,104,
+    97,116,32,105,110,102,111,114,109,97,116,105,111,110,32,105,
+    115,32,97,118,97,105,108,97,98,108,101,46,32,32,87,104,
+    101,110,32,102,105,108,101,110,97,109,101,32,105,115,10,32,
+    32,32,32,115,101,116,44,32,111,114,105,103,105,110,32,119,
+    105,108,108,32,109,97,116,99,104,46,10,10,32,32,32,32,
+    96,104,97,115,95,108,111,99,97,116,105,111,110,96,32,105,
+    110,100,105,99,97,116,101,115,32,116,104,97,116,32,97,32,
+    115,112,101,99,39,115,32,34,111,114,105,103,105,110,34,32,
+    114,101,102,108,101,99,116,115,32,97,32,108,111,99,97,116,
+    105,111,110,46,10,32,32,32,32,87,104,101,110,32,116,104,
+    105,115,32,105,115,32,84,114,117,101,44,32,96,95,95,102,
+    105,108,101,95,95,96,32,97,116,116,114,105,98,117,116,101,
+    32,111,102,32,116,104,101,32,109,111,100,117,108,101,32,105,
+    115,32,115,101,116,46,10,10,32,32,32,32,96,99,97,99,
+    104,101,100,96,32,105,115,32,116,104,101,32,108,111,99,97,
+    116,105,111,110,32,111,102,32,116,104,101,32,99,97,99,104,
+    101,100,32,98,121,116,101,99,111,100,101,32,102,105,108,101,
+    44,32,105,102,32,97,110,121,46,32,32,73,116,10,32,32,
+    32,32,99,111,114,114,101,115,112,111,110,100,115,32,116,111,
+    32,116,104,101,32,96,95,95,99,97,99,104,101,100,95,95,
+    96,32,97,116,116,114,105,98,117,116,101,46,10,10,32,32,
+    32,32,96,115,117,98,109,111,100,117,108,101,95,115,101,97,
+    114,99,104,95,108,111,99,97,116,105,111,110,115,96,32,105,
+    115,32,116,104,101,32,115,101,113,117,101,110,99,101,32,111,
+    102,32,112,97,116,104,32,101,110,116,114,105,101,115,32,116,
+    111,10,32,32,32,32,115,101,97,114,99,104,32,119,104,101,
+    110,32,105,109,112,111,114,116,105,110,103,32,115,117,98,109,
+    111,100,117,108,101,115,46,32,32,73,102,32,115,101,116,44,
+    32,105,115,95,112,97,99,107,97,103,101,32,115,104,111,117,
+    108,100,32,98,101,10,32,32,32,32,84,114,117,101,45,45,
+    97,110,100,32,70,97,108,115,101,32,111,116,104,101,114,119,
+    105,115,101,46,10,10,32,32,32,32,80,97,99,107,97,103,
+    101,115,32,97,114,101,32,115,105,109,112,108,121,32,109,111,
+    100,117,108,101,115,32,116,104,97,116,32,40,109,97,121,41,
+    32,104,97,118,101,32,115,117,98,109,111,100,117,108,101,115,
+    46,32,32,73,102,32,97,32,115,112,101,99,10,32,32,32,
+    32,104,97,115,32,97,32,110,111,110,45,78,111,110,101,32,
+    118,97,108,117,101,32,105,110,32,96,115,117,98,109,111,100,
+    117,108,101,95,115,101,97,114,99,104,95,108,111,99,97,116,
+    105,111,110,115,96,44,32,116,104,101,32,105,109,112,111,114,
+    116,10,32,32,32,32,115,121,115,116,101,109,32,119,105,108,
+    108,32,99,111,110,115,105,100,101,114,32,109,111,100,117,108,
+    101,115,32,108,111,97,100,101,100,32,102,114,111,109,32,116,
+    104,101,32,115,112,101,99,32,97,115,32,112,97,99,107,97,
+    103,101,115,46,10,10,32,32,32,32,79,110,108,121,32,102,
+    105,110,100,101,114,115,32,40,115,101,101,32,105,109,112,111,
+    114,116,108,105,98,46,97,98,99,46,77,101,116,97,80,97,
+    116,104,70,105,110,100,101,114,32,97,110,100,10,32,32,32,
+    32,105,109,112,111,114,116,108,105,98,46,97,98,99,46,80,
+    97,116,104,69,110,116,114,121,70,105,110,100,101,114,41,32,
+    115,104,111,117,108,100,32,109,111,100,105,102,121,32,77,111,
+    100,117,108,101,83,112,101,99,32,105,110,115,116,97,110,99,
+    101,115,46,10,10,32,32,32,32,218,6,111,114,105,103,105,
+    110,78,218,12,108,111,97,100,101,114,95,115,116,97,116,101,
+    218,10,105,115,95,112,97,99,107,97,103,101,99,3,0,0,
+    0,3,0,0,0,6,0,0,0,2,0,0,0,67,0,0,
+    0,115,79,0,0,0,124,1,0,124,0,0,95,0,0,124,
+    2,0,124,0,0,95,1,0,124,3,0,124,0,0,95,2,
+    0,124,4,0,124,0,0,95,3,0,124,5,0,114,48,0,
+    103,0,0,110,3,0,100,0,0,124,0,0,95,4,0,100,
+    1,0,124,0,0,95,5,0,100,0,0,124,0,0,95,6,
+    0,100,0,0,83,41,2,78,70,41,7,114,67,0,0,0,
+    114,170,0,0,0,114,218,0,0,0,114,219,0,0,0,218,
+    26,115,117,98,109,111,100,117,108,101,95,115,101,97,114,99,
+    104,95,108,111,99,97,116,105,111,110,115,218,13,95,115,101,
+    116,95,102,105,108,101,97,116,116,114,218,7,95,99,97,99,
+    104,101,100,41,6,114,71,0,0,0,114,67,0,0,0,114,
+    170,0,0,0,114,218,0,0,0,114,219,0,0,0,114,220,
+    0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0,
+    0,0,114,72,0,0,0,22,3,0,0,115,14,0,0,0,
+    0,2,9,1,9,1,9,1,9,1,21,3,9,1,122,19,
+    77,111,100,117,108,101,83,112,101,99,46,95,95,105,110,105,
+    116,95,95,99,1,0,0,0,0,0,0,0,2,0,0,0,
+    4,0,0,0,67,0,0,0,115,153,0,0,0,100,1,0,
+    106,0,0,124,0,0,106,1,0,131,1,0,100,2,0,106,
+    0,0,124,0,0,106,2,0,131,1,0,103,2,0,125,1,
+    0,124,0,0,106,3,0,100,0,0,107,9,0,114,79,0,
+    124,1,0,106,4,0,100,3,0,106,0,0,124,0,0,106,
+    3,0,131,1,0,131,1,0,1,110,0,0,124,0,0,106,
+    5,0,100,0,0,107,9,0,114,122,0,124,1,0,106,4,
+    0,100,4,0,106,0,0,124,0,0,106,5,0,131,1,0,
+    131,1,0,1,110,0,0,100,5,0,106,0,0,124,0,0,
+    106,6,0,106,7,0,100,6,0,106,8,0,124,1,0,131,
+    1,0,131,2,0,83,41,7,78,122,9,110,97,109,101,61,
+    123,33,114,125,122,11,108,111,97,100,101,114,61,123,33,114,
+    125,122,11,111,114,105,103,105,110,61,123,33,114,125,122,29,
+    115,117,98,109,111,100,117,108,101,95,115,101,97,114,99,104,
+    95,108,111,99,97,116,105,111,110,115,61,123,125,122,6,123,
+    125,40,123,125,41,122,2,44,32,41,9,114,47,0,0,0,
+    114,67,0,0,0,114,170,0,0,0,114,218,0,0,0,218,
+    6,97,112,112,101,110,100,114,221,0,0,0,218,9,95,95,
+    99,108,97,115,115,95,95,114,57,0,0,0,114,26,0,0,
+    0,41,2,114,71,0,0,0,114,80,0,0,0,114,4,0,
+    0,0,114,4,0,0,0,114,5,0,0,0,114,101,0,0,
+    0,34,3,0,0,115,16,0,0,0,0,1,15,1,21,1,
+    15,1,28,1,15,1,12,1,16,1,122,19,77,111,100,117,
+    108,101,83,112,101,99,46,95,95,114,101,112,114,95,95,99,
+    2,0,0,0,0,0,0,0,3,0,0,0,11,0,0,0,
+    67,0,0,0,115,145,0,0,0,124,0,0,106,0,0,125,
+    2,0,121,107,0,124,0,0,106,1,0,124,1,0,106,1,
+    0,107,2,0,111,114,0,124,0,0,106,2,0,124,1,0,
+    106,2,0,107,2,0,111,114,0,124,0,0,106,3,0,124,
+    1,0,106,3,0,107,2,0,111,114,0,124,2,0,124,1,
+    0,106,0,0,107,2,0,111,114,0,124,0,0,106,4,0,
+    124,1,0,106,4,0,107,2,0,111,114,0,124,0,0,106,
+    5,0,124,1,0,106,5,0,107,2,0,83,87,110,22,0,
+    4,116,6,0,107,10,0,114,140,0,1,1,1,100,1,0,
+    83,89,110,1,0,88,100,0,0,83,41,2,78,70,41,7,
+    114,221,0,0,0,114,67,0,0,0,114,170,0,0,0,114,
+    218,0,0,0,218,6,99,97,99,104,101,100,218,12,104,97,
+    115,95,108,111,99,97,116,105,111,110,114,210,0,0,0,41,
+    3,114,71,0,0,0,218,5,111,116,104,101,114,218,4,115,
+    109,115,108,114,4,0,0,0,114,4,0,0,0,114,5,0,
+    0,0,218,6,95,95,101,113,95,95,44,3,0,0,115,20,
+    0,0,0,0,1,9,1,3,1,18,1,18,1,18,1,15,
+    1,18,1,20,1,13,1,122,17,77,111,100,117,108,101,83,
+    112,101,99,46,95,95,101,113,95,95,99,1,0,0,0,0,
+    0,0,0,2,0,0,0,11,0,0,0,67,0,0,0,115,
+    158,0,0,0,124,0,0,106,0,0,100,0,0,107,8,0,
+    114,151,0,124,0,0,106,1,0,100,0,0,107,9,0,114,
+    151,0,124,0,0,106,2,0,114,151,0,124,0,0,106,1,
+    0,125,1,0,124,1,0,106,3,0,116,4,0,116,5,0,
+    131,1,0,131,1,0,114,112,0,121,19,0,116,6,0,124,
+    1,0,131,1,0,124,0,0,95,0,0,87,113,145,0,4,
+    116,7,0,107,10,0,114,108,0,1,1,1,89,113,145,0,
+    88,113,148,0,124,1,0,106,3,0,116,4,0,116,8,0,
+    131,1,0,131,1,0,114,148,0,124,1,0,124,0,0,95,
+    0,0,113,148,0,113,151,0,110,0,0,124,0,0,106,0,
+    0,83,41,1,78,41,9,114,223,0,0,0,114,218,0,0,
+    0,114,222,0,0,0,218,8,101,110,100,115,119,105,116,104,
+    218,5,116,117,112,108,101,114,135,0,0,0,114,132,0,0,
+    0,114,123,0,0,0,218,17,66,89,84,69,67,79,68,69,
+    95,83,85,70,70,73,88,69,83,41,2,114,71,0,0,0,
+    114,131,0,0,0,114,4,0,0,0,114,4,0,0,0,114,
+    5,0,0,0,114,226,0,0,0,56,3,0,0,115,22,0,
+    0,0,0,2,15,1,24,1,9,1,21,1,3,1,19,1,
+    13,1,8,1,21,1,18,1,122,17,77,111,100,117,108,101,
+    83,112,101,99,46,99,97,99,104,101,100,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,1,0,124,0,0,95,0,0,100,0,
+    0,83,41,1,78,41,1,114,223,0,0,0,41,2,114,71,
+    0,0,0,114,226,0,0,0,114,4,0,0,0,114,4,0,
+    0,0,114,5,0,0,0,114,226,0,0,0,70,3,0,0,
+    115,2,0,0,0,0,2,99,1,0,0,0,0,0,0,0,
+    1,0,0,0,2,0,0,0,67,0,0,0,115,46,0,0,
+    0,124,0,0,106,0,0,100,1,0,107,8,0,114,35,0,
+    124,0,0,106,1,0,106,2,0,100,2,0,131,1,0,100,
+    3,0,25,83,124,0,0,106,1,0,83,100,1,0,83,41,
+    4,122,32,84,104,101,32,110,97,109,101,32,111,102,32,116,
+    104,101,32,109,111,100,117,108,101,39,115,32,112,97,114,101,
+    110,116,46,78,114,116,0,0,0,114,84,0,0,0,41,3,
+    114,221,0,0,0,114,67,0,0,0,114,32,0,0,0,41,
+    1,114,71,0,0,0,114,4,0,0,0,114,4,0,0,0,
+    114,5,0,0,0,218,6,112,97,114,101,110,116,74,3,0,
+    0,115,6,0,0,0,0,3,15,1,20,2,122,17,77,111,
+    100,117,108,101,83,112,101,99,46,112,97,114,101,110,116,99,
+    1,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,
+    67,0,0,0,115,7,0,0,0,124,0,0,106,0,0,83,
+    41,1,78,41,1,114,222,0,0,0,41,1,114,71,0,0,
+    0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,
+    114,227,0,0,0,82,3,0,0,115,2,0,0,0,0,2,
+    122,23,77,111,100,117,108,101,83,112,101,99,46,104,97,115,
+    95,108,111,99,97,116,105,111,110,99,2,0,0,0,0,0,
+    0,0,2,0,0,0,2,0,0,0,67,0,0,0,115,19,
+    0,0,0,116,0,0,124,1,0,131,1,0,124,0,0,95,
+    1,0,100,0,0,83,41,1,78,41,2,218,4,98,111,111,
+    108,114,222,0,0,0,41,2,114,71,0,0,0,218,5,118,
+    97,108,117,101,114,4,0,0,0,114,4,0,0,0,114,5,
+    0,0,0,114,227,0,0,0,86,3,0,0,115,2,0,0,
+    0,0,2,41,12,114,57,0,0,0,114,56,0,0,0,114,
+    58,0,0,0,114,59,0,0,0,114,72,0,0,0,114,101,
+    0,0,0,114,230,0,0,0,218,8,112,114,111,112,101,114,
+    116,121,114,226,0,0,0,218,6,115,101,116,116,101,114,114,
+    234,0,0,0,114,227,0,0,0,114,4,0,0,0,114,4,
+    0,0,0,114,4,0,0,0,114,5,0,0,0,114,217,0,
+    0,0,241,2,0,0,115,20,0,0,0,12,35,6,2,15,
+    1,15,11,12,10,12,12,18,14,21,4,18,8,18,4,114,
+    217,0,0,0,114,218,0,0,0,114,220,0,0,0,99,2,
+    0,0,0,2,0,0,0,5,0,0,0,15,0,0,0,67,
+    0,0,0,115,193,0,0,0,116,0,0,124,1,0,100,1,
+    0,131,2,0,114,83,0,124,3,0,100,2,0,107,8,0,
+    114,43,0,116,1,0,124,0,0,100,3,0,124,1,0,131,
+    1,1,83,124,3,0,114,55,0,103,0,0,110,3,0,100,
+    2,0,125,4,0,116,1,0,124,0,0,100,3,0,124,1,
+    0,100,4,0,124,4,0,131,1,2,83,124,3,0,100,2,
+    0,107,8,0,114,168,0,116,0,0,124,1,0,100,5,0,
+    131,2,0,114,159,0,121,19,0,124,1,0,106,2,0,124,
+    0,0,131,1,0,125,3,0,87,113,165,0,4,116,3,0,
+    107,10,0,114,155,0,1,1,1,100,2,0,125,3,0,89,
+    113,165,0,88,113,168,0,100,6,0,125,3,0,110,0,0,
+    116,4,0,124,0,0,124,1,0,100,7,0,124,2,0,100,
+    5,0,124,3,0,131,2,2,83,41,8,122,53,82,101,116,
+    117,114,110,32,97,32,109,111,100,117,108,101,32,115,112,101,
+    99,32,98,97,115,101,100,32,111,110,32,118,97,114,105,111,
+    117,115,32,108,111,97,100,101,114,32,109,101,116,104,111,100,
+    115,46,218,12,103,101,116,95,102,105,108,101,110,97,109,101,
+    78,114,170,0,0,0,114,221,0,0,0,114,220,0,0,0,
+    70,114,218,0,0,0,41,5,114,60,0,0,0,218,23,115,
+    112,101,99,95,102,114,111,109,95,102,105,108,101,95,108,111,
+    99,97,116,105,111,110,114,220,0,0,0,114,154,0,0,0,
+    114,217,0,0,0,41,5,114,67,0,0,0,114,170,0,0,
+    0,114,218,0,0,0,114,220,0,0,0,90,6,115,101,97,
+    114,99,104,114,4,0,0,0,114,4,0,0,0,114,5,0,
+    0,0,114,174,0,0,0,91,3,0,0,115,28,0,0,0,
+    0,2,15,1,12,1,16,1,18,1,15,1,7,2,12,1,
+    15,1,3,1,19,1,13,1,14,3,9,2,114,174,0,0,
+    0,114,170,0,0,0,114,221,0,0,0,99,2,0,0,0,
+    2,0,0,0,9,0,0,0,19,0,0,0,67,0,0,0,
+    115,110,1,0,0,124,1,0,100,1,0,107,8,0,114,79,
+    0,100,2,0,125,1,0,116,0,0,124,2,0,100,3,0,
+    131,2,0,114,79,0,121,19,0,124,2,0,106,1,0,124,
+    0,0,131,1,0,125,1,0,87,113,76,0,4,116,2,0,
+    107,10,0,114,72,0,1,1,1,89,113,76,0,88,113,79,
+    0,110,0,0,116,3,0,124,0,0,124,2,0,100,4,0,
+    124,1,0,131,2,1,125,4,0,100,5,0,124,4,0,95,
+    4,0,124,2,0,100,1,0,107,8,0,114,203,0,120,79,
+    0,116,5,0,131,0,0,68,93,61,0,92,2,0,125,5,
+    0,125,6,0,124,1,0,106,6,0,116,7,0,124,6,0,
+    131,1,0,131,1,0,114,131,0,124,5,0,124,0,0,124,
+    1,0,131,2,0,125,2,0,124,2,0,124,4,0,95,8,
+    0,80,113,131,0,113,131,0,87,100,1,0,83,110,0,0,
+    124,3,0,116,9,0,107,8,0,114,38,1,116,0,0,124,
+    2,0,100,6,0,131,2,0,114,47,1,121,19,0,124,2,
+    0,106,10,0,124,0,0,131,1,0,125,7,0,87,110,18,
+    0,4,116,2,0,107,10,0,114,13,1,1,1,1,89,113,
+    35,1,88,124,7,0,114,35,1,103,0,0,124,4,0,95,
+    11,0,113,35,1,113,47,1,110,9,0,124,3,0,124,4,
+    0,95,11,0,124,4,0,106,11,0,103,0,0,107,2,0,
+    114,106,1,124,1,0,114,106,1,116,12,0,124,1,0,131,
+    1,0,100,7,0,25,125,8,0,124,4,0,106,11,0,106,
+    13,0,124,8,0,131,1,0,1,113,106,1,110,0,0,124,
+    4,0,83,41,8,97,61,1,0,0,82,101,116,117,114,110,
+    32,97,32,109,111,100,117,108,101,32,115,112,101,99,32,98,
+    97,115,101,100,32,111,110,32,97,32,102,105,108,101,32,108,
+    111,99,97,116,105,111,110,46,10,10,32,32,32,32,84,111,
+    32,105,110,100,105,99,97,116,101,32,116,104,97,116,32,116,
+    104,101,32,109,111,100,117,108,101,32,105,115,32,97,32,112,
+    97,99,107,97,103,101,44,32,115,101,116,10,32,32,32,32,
+    115,117,98,109,111,100,117,108,101,95,115,101,97,114,99,104,
+    95,108,111,99,97,116,105,111,110,115,32,116,111,32,97,32,
+    108,105,115,116,32,111,102,32,100,105,114,101,99,116,111,114,
+    121,32,112,97,116,104,115,46,32,32,65,110,10,32,32,32,
+    32,101,109,112,116,121,32,108,105,115,116,32,105,115,32,115,
+    117,102,102,105,99,105,101,110,116,44,32,116,104,111,117,103,
+    104,32,105,116,115,32,110,111,116,32,111,116,104,101,114,119,
+    105,115,101,32,117,115,101,102,117,108,32,116,111,32,116,104,
+    101,10,32,32,32,32,105,109,112,111,114,116,32,115,121,115,
+    116,101,109,46,10,10,32,32,32,32,84,104,101,32,108,111,
+    97,100,101,114,32,109,117,115,116,32,116,97,107,101,32,97,
+    32,115,112,101,99,32,97,115,32,105,116,115,32,111,110,108,
+    121,32,95,95,105,110,105,116,95,95,40,41,32,97,114,103,
+    46,10,10,32,32,32,32,78,122,9,60,117,110,107,110,111,
+    119,110,62,114,239,0,0,0,114,218,0,0,0,84,114,220,
+    0,0,0,114,84,0,0,0,41,14,114,60,0,0,0,114,
+    239,0,0,0,114,154,0,0,0,114,217,0,0,0,114,222,
+    0,0,0,218,27,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,
+    114,231,0,0,0,114,232,0,0,0,114,170,0,0,0,218,
+    9,95,80,79,80,85,76,65,84,69,114,220,0,0,0,114,
+    221,0,0,0,114,38,0,0,0,114,224,0,0,0,41,9,
+    114,67,0,0,0,218,8,108,111,99,97,116,105,111,110,114,
+    170,0,0,0,114,221,0,0,0,114,178,0,0,0,218,12,
+    108,111,97,100,101,114,95,99,108,97,115,115,114,126,0,0,
+    0,114,220,0,0,0,90,7,100,105,114,110,97,109,101,114,
+    4,0,0,0,114,4,0,0,0,114,5,0,0,0,114,240,
+    0,0,0,116,3,0,0,115,60,0,0,0,0,12,12,4,
+    6,1,15,2,3,1,19,1,13,1,11,8,21,1,9,3,
+    12,1,22,1,21,1,15,1,9,1,8,2,7,3,12,2,
+    15,1,3,1,19,1,13,1,5,2,6,1,18,2,9,1,
+    15,1,6,1,16,1,22,2,114,240,0,0,0,99,3,0,
+    0,0,0,0,0,0,8,0,0,0,53,0,0,0,67,0,
+    0,0,115,124,1,0,0,121,13,0,124,0,0,106,0,0,
+    125,3,0,87,110,18,0,4,116,1,0,107,10,0,114,33,
+    0,1,1,1,89,110,17,0,88,124,3,0,100,0,0,107,
+    9,0,114,50,0,124,3,0,83,124,0,0,106,2,0,125,
+    4,0,124,1,0,100,0,0,107,8,0,114,108,0,121,13,
+    0,124,0,0,106,3,0,125,1,0,87,113,108,0,4,116,
+    1,0,107,10,0,114,104,0,1,1,1,89,113,108,0,88,
+    110,0,0,121,13,0,124,0,0,106,4,0,125,5,0,87,
+    110,24,0,4,116,1,0,107,10,0,114,147,0,1,1,1,
+    100,0,0,125,5,0,89,110,1,0,88,124,2,0,100,0,
+    0,107,8,0,114,224,0,124,5,0,100,0,0,107,8,0,
+    114,215,0,121,13,0,124,1,0,106,5,0,125,2,0,87,
+    113,221,0,4,116,1,0,107,10,0,114,211,0,1,1,1,
+    100,0,0,125,2,0,89,113,221,0,88,113,224,0,124,5,
+    0,125,2,0,110,0,0,121,13,0,124,0,0,106,6,0,
+    125,6,0,87,110,24,0,4,116,1,0,107,10,0,114,7,
+    1,1,1,1,100,0,0,125,6,0,89,110,1,0,88,121,
+    19,0,116,7,0,124,0,0,106,8,0,131,1,0,125,7,
+    0,87,110,24,0,4,116,1,0,107,10,0,114,53,1,1,
+    1,1,100,0,0,125,7,0,89,110,1,0,88,116,9,0,
+    124,4,0,124,1,0,100,1,0,124,2,0,131,2,1,125,
+    3,0,124,5,0,100,0,0,107,8,0,114,93,1,100,2,
+    0,110,3,0,100,3,0,124,3,0,95,10,0,124,6,0,
+    124,3,0,95,11,0,124,7,0,124,3,0,95,12,0,124,
+    3,0,83,41,4,78,114,218,0,0,0,70,84,41,13,114,
+    209,0,0,0,114,210,0,0,0,114,57,0,0,0,114,205,
+    0,0,0,114,211,0,0,0,90,7,95,79,82,73,71,73,
+    78,218,10,95,95,99,97,99,104,101,100,95,95,218,4,108,
+    105,115,116,218,8,95,95,112,97,116,104,95,95,114,217,0,
+    0,0,114,222,0,0,0,114,226,0,0,0,114,221,0,0,
+    0,41,8,114,180,0,0,0,114,170,0,0,0,114,218,0,
+    0,0,114,178,0,0,0,114,67,0,0,0,114,243,0,0,
+    0,114,226,0,0,0,114,221,0,0,0,114,4,0,0,0,
+    114,4,0,0,0,114,5,0,0,0,218,17,95,115,112,101,
+    99,95,102,114,111,109,95,109,111,100,117,108,101,180,3,0,
+    0,115,72,0,0,0,0,2,3,1,13,1,13,1,5,2,
+    12,1,4,2,9,1,12,1,3,1,13,1,13,2,8,1,
+    3,1,13,1,13,1,11,1,12,1,12,1,3,1,13,1,
+    13,1,14,2,9,1,3,1,13,1,13,1,11,1,3,1,
+    19,1,13,1,11,2,21,1,27,1,9,1,9,1,114,248,
+    0,0,0,99,0,0,0,0,0,0,0,0,0,0,0,0,
+    6,0,0,0,64,0,0,0,115,142,0,0,0,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,100,10,0,100,11,0,132,0,2,90,6,0,100,
+    12,0,100,13,0,132,0,0,90,7,0,100,14,0,100,15,
+    0,132,0,0,90,8,0,100,16,0,100,17,0,132,0,0,
+    90,9,0,100,18,0,100,19,0,132,0,0,90,10,0,100,
+    20,0,100,21,0,132,0,0,90,11,0,100,22,0,100,23,
+    0,132,0,0,90,12,0,100,24,0,83,41,25,114,175,0,
+    0,0,122,77,67,111,110,118,101,110,105,101,110,99,101,32,
+    119,114,97,112,112,101,114,32,97,114,111,117,110,100,32,115,
+    112,101,99,32,111,98,106,101,99,116,115,32,116,111,32,112,
+    114,111,118,105,100,101,32,115,112,101,99,45,115,112,101,99,
+    105,102,105,99,10,32,32,32,32,109,101,116,104,111,100,115,
+    46,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,1,0,124,0,
+    0,95,0,0,100,0,0,83,41,1,78,41,1,114,178,0,
+    0,0,41,2,114,71,0,0,0,114,178,0,0,0,114,4,
+    0,0,0,114,4,0,0,0,114,5,0,0,0,114,72,0,
+    0,0,232,3,0,0,115,2,0,0,0,0,1,122,21,95,
+    83,112,101,99,77,101,116,104,111,100,115,46,95,95,105,110,
+    105,116,95,95,99,1,0,0,0,0,0,0,0,3,0,0,
+    0,3,0,0,0,67,0,0,0,115,158,0,0,0,124,0,
+    0,106,0,0,125,1,0,124,1,0,106,1,0,100,1,0,
+    107,8,0,114,30,0,100,2,0,110,6,0,124,1,0,106,
+    1,0,125,2,0,124,1,0,106,2,0,100,1,0,107,8,
+    0,114,104,0,124,1,0,106,3,0,100,1,0,107,8,0,
+    114,82,0,100,3,0,106,4,0,124,2,0,131,1,0,83,
+    100,4,0,106,4,0,124,2,0,124,1,0,106,3,0,131,
+    2,0,83,110,50,0,124,1,0,106,5,0,114,132,0,100,
+    5,0,106,4,0,124,2,0,124,1,0,106,2,0,131,2,
+    0,83,100,6,0,106,4,0,124,1,0,106,1,0,124,1,
+    0,106,2,0,131,2,0,83,100,1,0,83,41,7,122,38,
+    82,101,116,117,114,110,32,116,104,101,32,114,101,112,114,32,
+    116,111,32,117,115,101,32,102,111,114,32,116,104,101,32,109,
+    111,100,117,108,101,46,78,114,207,0,0,0,122,13,60,109,
+    111,100,117,108,101,32,123,33,114,125,62,122,20,60,109,111,
+    100,117,108,101,32,123,33,114,125,32,40,123,33,114,125,41,
+    62,122,23,60,109,111,100,117,108,101,32,123,33,114,125,32,
+    102,114,111,109,32,123,33,114,125,62,122,18,60,109,111,100,
+    117,108,101,32,123,33,114,125,32,40,123,125,41,62,41,6,
+    114,178,0,0,0,114,67,0,0,0,114,218,0,0,0,114,
+    170,0,0,0,114,47,0,0,0,114,227,0,0,0,41,3,
+    114,71,0,0,0,114,178,0,0,0,114,67,0,0,0,114,
+    4,0,0,0,114,4,0,0,0,114,5,0,0,0,114,206,
+    0,0,0,235,3,0,0,115,18,0,0,0,0,3,9,1,
+    30,1,15,1,15,1,13,2,22,2,9,1,19,2,122,24,
+    95,83,112,101,99,77,101,116,104,111,100,115,46,109,111,100,
+    117,108,101,95,114,101,112,114,218,9,95,111,118,101,114,114,
+    105,100,101,70,218,11,95,102,111,114,99,101,95,110,97,109,
+    101,84,99,2,0,0,0,2,0,0,0,6,0,0,0,59,
+    0,0,0,67,0,0,0,115,75,2,0,0,124,0,0,106,
+    0,0,125,4,0,124,2,0,115,45,0,124,3,0,115,45,
+    0,116,1,0,124,1,0,100,1,0,100,2,0,131,3,0,
+    100,2,0,107,8,0,114,85,0,121,16,0,124,4,0,106,
+    2,0,124,1,0,95,3,0,87,113,85,0,4,116,4,0,
+    107,10,0,114,81,0,1,1,1,89,113,85,0,88,110,0,
+    0,124,2,0,115,115,0,116,1,0,124,1,0,100,3,0,
+    100,2,0,131,3,0,100,2,0,107,8,0,114,221,0,124,
+    4,0,106,5,0,125,5,0,124,5,0,100,2,0,107,8,
+    0,114,184,0,124,4,0,106,6,0,100,2,0,107,9,0,
+    114,184,0,116,7,0,106,8,0,116,7,0,131,1,0,125,
+    5,0,124,4,0,106,6,0,124,5,0,95,9,0,113,184,
+    0,110,0,0,121,13,0,124,5,0,124,1,0,95,10,0,
+    87,113,221,0,4,116,4,0,107,10,0,114,217,0,1,1,
+    1,89,113,221,0,88,110,0,0,124,2,0,115,251,0,116,
+    1,0,124,1,0,100,4,0,100,2,0,131,3,0,100,2,
+    0,107,8,0,114,35,1,121,16,0,124,4,0,106,11,0,
+    124,1,0,95,12,0,87,113,35,1,4,116,4,0,107,10,
+    0,114,31,1,1,1,1,89,113,35,1,88,110,0,0,121,
+    13,0,124,4,0,124,1,0,95,13,0,87,110,18,0,4,
+    116,4,0,107,10,0,114,68,1,1,1,1,89,110,1,0,
+    88,124,2,0,115,99,1,116,1,0,124,1,0,100,5,0,
+    100,2,0,131,3,0,100,2,0,107,8,0,114,157,1,124,
+    4,0,106,6,0,100,2,0,107,9,0,114,157,1,121,16,
+    0,124,4,0,106,6,0,124,1,0,95,14,0,87,113,154,
+    1,4,116,4,0,107,10,0,114,150,1,1,1,1,89,113,
+    154,1,88,113,157,1,110,0,0,124,4,0,106,15,0,114,
+    71,2,124,2,0,115,196,1,116,1,0,124,1,0,100,6,
+    0,100,2,0,131,3,0,100,2,0,107,8,0,114,236,1,
+    121,16,0,124,4,0,106,16,0,124,1,0,95,17,0,87,
+    113,236,1,4,116,4,0,107,10,0,114,232,1,1,1,1,
+    89,113,236,1,88,110,0,0,124,2,0,115,10,2,116,1,
+    0,124,1,0,100,7,0,100,2,0,131,3,0,100,2,0,
+    107,8,0,114,71,2,124,4,0,106,18,0,100,2,0,107,
+    9,0,114,68,2,121,16,0,124,4,0,106,18,0,124,1,
+    0,95,19,0,87,113,65,2,4,116,4,0,107,10,0,114,
+    61,2,1,1,1,89,113,65,2,88,113,68,2,113,71,2,
+    110,0,0,100,2,0,83,41,8,97,29,2,0,0,83,101,
+    116,32,116,104,101,32,109,111,100,117,108,101,39,115,32,97,
+    116,116,114,105,98,117,116,101,115,46,10,10,32,32,32,32,
+    32,32,32,32,65,108,108,32,109,105,115,115,105,110,103,32,
+    105,109,112,111,114,116,45,114,101,108,97,116,101,100,32,109,
+    111,100,117,108,101,32,97,116,116,114,105,98,117,116,101,115,
+    32,119,105,108,108,32,98,101,32,115,101,116,46,32,32,72,
+    101,114,101,10,32,32,32,32,32,32,32,32,105,115,32,104,
+    111,119,32,116,104,101,32,115,112,101,99,32,97,116,116,114,
+    105,98,117,116,101,115,32,109,97,112,32,111,110,116,111,32,
+    116,104,101,32,109,111,100,117,108,101,58,10,10,32,32,32,
+    32,32,32,32,32,115,112,101,99,46,110,97,109,101,32,45,
+    62,32,109,111,100,117,108,101,46,95,95,110,97,109,101,95,
+    95,10,32,32,32,32,32,32,32,32,115,112,101,99,46,108,
+    111,97,100,101,114,32,45,62,32,109,111,100,117,108,101,46,
+    95,95,108,111,97,100,101,114,95,95,10,32,32,32,32,32,
+    32,32,32,115,112,101,99,46,112,97,114,101,110,116,32,45,
+    62,32,109,111,100,117,108,101,46,95,95,112,97,99,107,97,
+    103,101,95,95,10,32,32,32,32,32,32,32,32,115,112,101,
+    99,32,45,62,32,109,111,100,117,108,101,46,95,95,115,112,
+    101,99,95,95,10,10,32,32,32,32,32,32,32,32,79,112,
+    116,105,111,110,97,108,58,10,32,32,32,32,32,32,32,32,
+    115,112,101,99,46,111,114,105,103,105,110,32,45,62,32,109,
+    111,100,117,108,101,46,95,95,102,105,108,101,95,95,32,40,
+    105,102,32,115,112,101,99,46,115,101,116,95,102,105,108,101,
+    97,116,116,114,32,105,115,32,116,114,117,101,41,10,32,32,
+    32,32,32,32,32,32,115,112,101,99,46,99,97,99,104,101,
+    100,32,45,62,32,109,111,100,117,108,101,46,95,95,99,97,
+    99,104,101,100,95,95,32,40,105,102,32,95,95,102,105,108,
+    101,95,95,32,97,108,115,111,32,115,101,116,41,10,32,32,
+    32,32,32,32,32,32,115,112,101,99,46,115,117,98,109,111,
+    100,117,108,101,95,115,101,97,114,99,104,95,108,111,99,97,
+    116,105,111,110,115,32,45,62,32,109,111,100,117,108,101,46,
+    95,95,112,97,116,104,95,95,32,40,105,102,32,115,101,116,
+    41,10,10,32,32,32,32,32,32,32,32,114,57,0,0,0,
+    78,114,205,0,0,0,218,11,95,95,112,97,99,107,97,103,
+    101,95,95,114,247,0,0,0,114,211,0,0,0,114,245,0,
+    0,0,41,20,114,178,0,0,0,114,62,0,0,0,114,67,
+    0,0,0,114,57,0,0,0,114,210,0,0,0,114,170,0,
+    0,0,114,221,0,0,0,218,16,95,78,97,109,101,115,112,
+    97,99,101,76,111,97,100,101,114,218,7,95,95,110,101,119,
+    95,95,218,5,95,112,97,116,104,114,205,0,0,0,114,234,
+    0,0,0,114,251,0,0,0,114,209,0,0,0,114,247,0,
+    0,0,114,227,0,0,0,114,218,0,0,0,114,211,0,0,
+    0,114,226,0,0,0,114,245,0,0,0,41,6,114,71,0,
+    0,0,114,180,0,0,0,114,249,0,0,0,114,250,0,0,
+    0,114,178,0,0,0,114,170,0,0,0,114,4,0,0,0,
+    114,4,0,0,0,114,5,0,0,0,218,17,105,110,105,116,
+    95,109,111,100,117,108,101,95,97,116,116,114,115,251,3,0,
+    0,115,88,0,0,0,0,17,9,6,12,1,24,1,3,1,
+    16,1,13,1,8,3,30,1,9,1,12,2,15,1,15,1,
+    18,1,3,1,13,1,13,1,8,3,30,1,3,1,16,1,
+    13,1,8,3,3,1,13,1,13,1,5,3,30,1,15,1,
+    3,1,16,1,13,1,11,2,9,2,30,1,3,1,16,1,
+    13,1,8,3,30,1,15,1,3,1,16,1,13,1,122,30,
+    95,83,112,101,99,77,101,116,104,111,100,115,46,105,110,105,
+    116,95,109,111,100,117,108,101,95,97,116,116,114,115,99,1,
+    0,0,0,0,0,0,0,3,0,0,0,3,0,0,0,67,
+    0,0,0,115,101,0,0,0,124,0,0,106,0,0,125,1,
+    0,116,1,0,124,1,0,106,2,0,100,1,0,131,2,0,
+    114,48,0,124,1,0,106,2,0,106,3,0,124,1,0,131,
+    1,0,125,2,0,110,6,0,100,2,0,125,2,0,124,2,
+    0,100,2,0,107,8,0,114,84,0,116,4,0,124,1,0,
+    106,5,0,131,1,0,125,2,0,110,0,0,124,0,0,106,
+    6,0,124,2,0,131,1,0,1,124,2,0,83,41,3,122,
+    153,82,101,116,117,114,110,32,97,32,110,101,119,32,109,111,
+    100,117,108,101,32,116,111,32,98,101,32,108,111,97,100,101,
+    100,46,10,10,32,32,32,32,32,32,32,32,84,104,101,32,
+    105,109,112,111,114,116,45,114,101,108,97,116,101,100,32,109,
+    111,100,117,108,101,32,97,116,116,114,105,98,117,116,101,115,
+    32,97,114,101,32,97,108,115,111,32,115,101,116,32,119,105,
+    116,104,32,116,104,101,10,32,32,32,32,32,32,32,32,97,
+    112,112,114,111,112,114,105,97,116,101,32,118,97,108,117,101,
+    115,32,102,114,111,109,32,116,104,101,32,115,112,101,99,46,
+    10,10,32,32,32,32,32,32,32,32,218,13,99,114,101,97,
+    116,101,95,109,111,100,117,108,101,78,41,7,114,178,0,0,
+    0,114,60,0,0,0,114,170,0,0,0,114,0,1,0,0,
+    114,68,0,0,0,114,67,0,0,0,114,255,0,0,0,41,
+    3,114,71,0,0,0,114,178,0,0,0,114,180,0,0,0,
+    114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,218,
+    6,99,114,101,97,116,101,75,4,0,0,115,16,0,0,0,
+    0,7,9,2,18,3,21,2,6,1,12,4,18,1,13,1,
+    122,19,95,83,112,101,99,77,101,116,104,111,100,115,46,99,
+    114,101,97,116,101,99,2,0,0,0,0,0,0,0,2,0,
+    0,0,2,0,0,0,67,0,0,0,115,23,0,0,0,124,
+    0,0,106,0,0,106,1,0,106,2,0,124,1,0,131,1,
+    0,1,100,1,0,83,41,2,122,189,68,111,32,101,118,101,
+    114,121,116,104,105,110,103,32,110,101,99,101,115,115,97,114,
+    121,32,116,111,32,101,120,101,99,117,116,101,32,116,104,101,
+    32,109,111,100,117,108,101,46,10,10,32,32,32,32,32,32,
+    32,32,84,104,101,32,110,97,109,101,115,112,97,99,101,32,
+    111,102,32,96,109,111,100,117,108,101,96,32,105,115,32,117,
+    115,101,100,32,97,115,32,116,104,101,32,116,97,114,103,101,
+    116,32,111,102,32,101,120,101,99,117,116,105,111,110,46,10,
+    32,32,32,32,32,32,32,32,84,104,105,115,32,109,101,116,
+    104,111,100,32,117,115,101,115,32,116,104,101,32,108,111,97,
+    100,101,114,39,115,32,96,101,120,101,99,95,109,111,100,117,
+    108,101,40,41,96,32,109,101,116,104,111,100,46,10,10,32,
+    32,32,32,32,32,32,32,78,41,3,114,178,0,0,0,114,
+    170,0,0,0,218,11,101,120,101,99,95,109,111,100,117,108,
+    101,41,2,114,71,0,0,0,114,180,0,0,0,114,4,0,
+    0,0,114,4,0,0,0,114,5,0,0,0,218,5,95,101,
+    120,101,99,98,4,0,0,115,2,0,0,0,0,7,122,18,
+    95,83,112,101,99,77,101,116,104,111,100,115,46,95,101,120,
+    101,99,99,2,0,0,0,0,0,0,0,4,0,0,0,11,
+    0,0,0,67,0,0,0,115,17,1,0,0,124,0,0,106,
+    0,0,106,1,0,125,2,0,116,2,0,106,3,0,131,0,
+    0,1,116,4,0,124,2,0,131,1,0,143,226,0,1,116,
+    5,0,106,6,0,106,7,0,124,2,0,131,1,0,124,1,
+    0,107,9,0,114,95,0,100,1,0,106,8,0,124,2,0,
+    131,1,0,125,3,0,116,9,0,124,3,0,100,2,0,124,
+    2,0,131,1,1,130,1,0,110,0,0,124,0,0,106,0,
+    0,106,10,0,100,3,0,107,8,0,114,181,0,124,0,0,
+    106,0,0,106,11,0,100,3,0,107,8,0,114,158,0,116,
+    9,0,100,4,0,100,2,0,124,0,0,106,0,0,106,1,
+    0,131,1,1,130,1,0,110,0,0,124,0,0,106,12,0,
+    124,1,0,100,5,0,100,6,0,131,1,1,1,124,1,0,
+    83,124,0,0,106,12,0,124,1,0,100,5,0,100,6,0,
+    131,1,1,1,116,13,0,124,0,0,106,0,0,106,10,0,
+    100,7,0,131,2,0,115,243,0,124,0,0,106,0,0,106,
+    10,0,106,14,0,124,2,0,131,1,0,1,110,13,0,124,
+    0,0,106,15,0,124,1,0,131,1,0,1,87,100,3,0,
+    81,88,116,5,0,106,6,0,124,2,0,25,83,41,8,122,
+    51,69,120,101,99,117,116,101,32,116,104,101,32,115,112,101,
+    99,32,105,110,32,97,110,32,101,120,105,115,116,105,110,103,
+    32,109,111,100,117,108,101,39,115,32,110,97,109,101,115,112,
+    97,99,101,46,122,30,109,111,100,117,108,101,32,123,33,114,
+    125,32,110,111,116,32,105,110,32,115,121,115,46,109,111,100,
+    117,108,101,115,114,67,0,0,0,78,122,14,109,105,115,115,
+    105,110,103,32,108,111,97,100,101,114,114,249,0,0,0,84,
+    114,2,1,0,0,41,16,114,178,0,0,0,114,67,0,0,
+    0,114,106,0,0,0,218,12,97,99,113,117,105,114,101,95,
+    108,111,99,107,114,103,0,0,0,114,7,0,0,0,114,73,
+    0,0,0,114,93,0,0,0,114,47,0,0,0,114,154,0,
+    0,0,114,170,0,0,0,114,221,0,0,0,114,255,0,0,
+    0,114,60,0,0,0,218,11,108,111,97,100,95,109,111,100,
+    117,108,101,114,3,1,0,0,41,4,114,71,0,0,0,114,
+    180,0,0,0,114,67,0,0,0,114,172,0,0,0,114,4,
+    0,0,0,114,4,0,0,0,114,5,0,0,0,114,176,0,
+    0,0,108,4,0,0,115,32,0,0,0,0,2,12,1,10,
+    1,13,1,24,1,15,1,21,1,18,1,18,1,27,2,19,
+    1,4,1,19,1,21,4,22,2,19,1,122,17,95,83,112,
+    101,99,77,101,116,104,111,100,115,46,101,120,101,99,99,1,
+    0,0,0,0,0,0,0,3,0,0,0,27,0,0,0,67,
+    0,0,0,115,24,1,0,0,124,0,0,106,0,0,125,1,
+    0,124,1,0,106,1,0,106,2,0,124,1,0,106,3,0,
+    131,1,0,1,116,4,0,106,5,0,124,1,0,106,3,0,
+    25,125,2,0,116,6,0,124,2,0,100,1,0,100,0,0,
+    131,3,0,100,0,0,107,8,0,114,108,0,121,16,0,124,
+    1,0,106,1,0,124,2,0,95,7,0,87,113,108,0,4,
+    116,8,0,107,10,0,114,104,0,1,1,1,89,113,108,0,
+    88,110,0,0,116,6,0,124,2,0,100,2,0,100,0,0,
+    131,3,0,100,0,0,107,8,0,114,215,0,121,59,0,124,
+    2,0,106,9,0,124,2,0,95,10,0,116,11,0,124,2,
+    0,100,3,0,131,2,0,115,190,0,124,1,0,106,3,0,
+    106,12,0,100,4,0,131,1,0,100,5,0,25,124,2,0,
+    95,10,0,110,0,0,87,113,215,0,4,116,8,0,107,10,
+    0,114,211,0,1,1,1,89,113,215,0,88,110,0,0,116,
+    6,0,124,2,0,100,6,0,100,0,0,131,3,0,100,0,
+    0,107,8,0,114,20,1,121,13,0,124,1,0,124,2,0,
+    95,13,0,87,113,20,1,4,116,8,0,107,10,0,114,16,
+    1,1,1,1,89,113,20,1,88,110,0,0,124,2,0,83,
+    41,7,78,114,205,0,0,0,114,251,0,0,0,114,247,0,
+    0,0,114,116,0,0,0,114,84,0,0,0,114,209,0,0,
+    0,41,14,114,178,0,0,0,114,170,0,0,0,114,5,1,
+    0,0,114,67,0,0,0,114,7,0,0,0,114,73,0,0,
+    0,114,62,0,0,0,114,205,0,0,0,114,210,0,0,0,
+    114,57,0,0,0,114,251,0,0,0,114,60,0,0,0,114,
+    32,0,0,0,114,209,0,0,0,41,3,114,71,0,0,0,
+    114,178,0,0,0,114,180,0,0,0,114,4,0,0,0,114,
+    4,0,0,0,114,5,0,0,0,218,25,95,108,111,97,100,
+    95,98,97,99,107,119,97,114,100,95,99,111,109,112,97,116,
+    105,98,108,101,132,4,0,0,115,42,0,0,0,0,4,9,
+    1,19,2,16,1,24,1,3,1,16,1,13,1,8,1,24,
+    1,3,4,12,1,15,1,32,1,13,1,8,1,24,1,3,
+    1,13,1,13,1,8,1,122,38,95,83,112,101,99,77,101,
+    116,104,111,100,115,46,95,108,111,97,100,95,98,97,99,107,
+    119,97,114,100,95,99,111,109,112,97,116,105,98,108,101,99,
+    1,0,0,0,0,0,0,0,2,0,0,0,11,0,0,0,
+    67,0,0,0,115,179,0,0,0,124,0,0,106,0,0,106,
+    1,0,100,0,0,107,9,0,114,52,0,116,2,0,124,0,
+    0,106,0,0,106,1,0,100,1,0,131,2,0,115,52,0,
+    124,0,0,106,3,0,131,0,0,83,110,0,0,124,0,0,
+    106,4,0,131,0,0,125,1,0,116,5,0,124,1,0,131,
+    1,0,143,84,0,1,124,0,0,106,0,0,106,1,0,100,
+    0,0,107,8,0,114,143,0,124,0,0,106,0,0,106,6,
+    0,100,0,0,107,8,0,114,156,0,116,7,0,100,2,0,
+    100,3,0,124,0,0,106,0,0,106,8,0,131,1,1,130,
+    1,0,113,156,0,110,13,0,124,0,0,106,9,0,124,1,
+    0,131,1,0,1,87,100,0,0,81,88,116,10,0,106,11,
+    0,124,0,0,106,0,0,106,8,0,25,83,41,4,78,114,
+    2,1,0,0,122,14,109,105,115,115,105,110,103,32,108,111,
+    97,100,101,114,114,67,0,0,0,41,12,114,178,0,0,0,
+    114,170,0,0,0,114,60,0,0,0,114,6,1,0,0,114,
+    1,1,0,0,114,213,0,0,0,114,221,0,0,0,114,154,
+    0,0,0,114,67,0,0,0,114,3,1,0,0,114,7,0,
+    0,0,114,73,0,0,0,41,2,114,71,0,0,0,114,180,
+    0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0,
+    0,0,218,14,95,108,111,97,100,95,117,110,108,111,99,107,
+    101,100,162,4,0,0,115,20,0,0,0,0,2,18,2,21,
+    1,13,2,12,1,13,1,18,1,18,1,30,3,19,5,122,
+    27,95,83,112,101,99,77,101,116,104,111,100,115,46,95,108,
+    111,97,100,95,117,110,108,111,99,107,101,100,99,1,0,0,
+    0,0,0,0,0,1,0,0,0,8,0,0,0,67,0,0,
+    0,115,49,0,0,0,116,0,0,106,1,0,131,0,0,1,
+    116,2,0,124,0,0,106,3,0,106,4,0,131,1,0,143,
+    15,0,1,124,0,0,106,5,0,131,0,0,83,87,100,1,
+    0,81,88,100,1,0,83,41,2,122,207,82,101,116,117,114,
+    110,32,97,32,110,101,119,32,109,111,100,117,108,101,32,111,
+    98,106,101,99,116,44,32,108,111,97,100,101,100,32,98,121,
+    32,116,104,101,32,115,112,101,99,39,115,32,108,111,97,100,
+    101,114,46,10,10,32,32,32,32,32,32,32,32,84,104,101,
+    32,109,111,100,117,108,101,32,105,115,32,110,111,116,32,97,
+    100,100,101,100,32,116,111,32,105,116,115,32,112,97,114,101,
+    110,116,46,10,10,32,32,32,32,32,32,32,32,73,102,32,
+    97,32,109,111,100,117,108,101,32,105,115,32,97,108,114,101,
+    97,100,121,32,105,110,32,115,121,115,46,109,111,100,117,108,
+    101,115,44,32,116,104,97,116,32,101,120,105,115,116,105,110,
+    103,32,109,111,100,117,108,101,32,103,101,116,115,10,32,32,
+    32,32,32,32,32,32,99,108,111,98,98,101,114,101,100,46,
+    10,10,32,32,32,32,32,32,32,32,78,41,6,114,106,0,
+    0,0,114,4,1,0,0,114,103,0,0,0,114,178,0,0,
+    0,114,67,0,0,0,114,7,1,0,0,41,1,114,71,0,
+    0,0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,
+    0,114,177,0,0,0,185,4,0,0,115,6,0,0,0,0,
+    9,10,1,19,1,122,17,95,83,112,101,99,77,101,116,104,
+    111,100,115,46,108,111,97,100,78,41,13,114,57,0,0,0,
+    114,56,0,0,0,114,58,0,0,0,114,59,0,0,0,114,
+    72,0,0,0,114,206,0,0,0,114,255,0,0,0,114,1,
+    1,0,0,114,3,1,0,0,114,176,0,0,0,114,6,1,
+    0,0,114,7,1,0,0,114,177,0,0,0,114,4,0,0,
+    0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,
+    114,175,0,0,0,225,3,0,0,115,20,0,0,0,12,3,
+    6,4,12,3,12,16,24,80,12,23,12,10,12,24,12,30,
+    12,23,114,175,0,0,0,99,4,0,0,0,0,0,0,0,
+    6,0,0,0,11,0,0,0,67,0,0,0,115,201,0,0,
+    0,124,0,0,106,0,0,100,1,0,131,1,0,125,4,0,
+    124,0,0,106,0,0,100,2,0,131,1,0,125,5,0,124,
+    4,0,115,102,0,124,5,0,114,54,0,124,5,0,106,1,
+    0,125,4,0,113,102,0,124,2,0,124,3,0,107,2,0,
+    114,84,0,116,2,0,124,1,0,124,2,0,131,2,0,125,
+    4,0,113,102,0,116,3,0,124,1,0,124,2,0,131,2,
+    0,125,4,0,110,0,0,124,5,0,115,132,0,116,4,0,
+    124,1,0,124,2,0,100,3,0,124,4,0,131,2,1,125,
+    5,0,110,0,0,121,44,0,124,5,0,124,0,0,100,2,
+    0,60,124,4,0,124,0,0,100,1,0,60,124,2,0,124,
+    0,0,100,4,0,60,124,3,0,124,0,0,100,5,0,60,
+    87,110,18,0,4,116,5,0,107,10,0,114,196,0,1,1,
+    1,89,110,1,0,88,100,0,0,83,41,6,78,114,205,0,
+    0,0,114,209,0,0,0,114,170,0,0,0,114,211,0,0,
+    0,114,245,0,0,0,41,6,114,93,0,0,0,114,170,0,
+    0,0,218,20,83,111,117,114,99,101,108,101,115,115,70,105,
+    108,101,76,111,97,100,101,114,218,16,83,111,117,114,99,101,
+    70,105,108,101,76,111,97,100,101,114,114,240,0,0,0,114,
+    208,0,0,0,41,6,90,2,110,115,114,67,0,0,0,90,
+    8,112,97,116,104,110,97,109,101,90,9,99,112,97,116,104,
+    110,97,109,101,114,170,0,0,0,114,178,0,0,0,114,4,
+    0,0,0,114,4,0,0,0,114,5,0,0,0,218,14,95,
+    102,105,120,95,117,112,95,109,111,100,117,108,101,199,4,0,
+    0,115,34,0,0,0,0,2,15,1,15,1,6,1,6,1,
+    12,1,12,1,18,2,18,1,6,1,24,1,3,1,10,1,
+    10,1,10,1,14,1,13,2,114,10,1,0,0,99,0,0,
+    0,0,0,0,0,0,0,0,0,0,5,0,0,0,64,0,
+    0,0,115,181,0,0,0,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,6,0,100,4,
+    0,100,4,0,100,5,0,100,6,0,132,2,0,131,1,0,
+    90,7,0,101,6,0,100,4,0,100,7,0,100,8,0,132,
+    1,0,131,1,0,90,8,0,101,6,0,101,9,0,100,9,
+    0,100,10,0,132,0,0,131,1,0,131,1,0,90,10,0,
+    101,6,0,101,9,0,100,11,0,100,12,0,132,0,0,131,
+    1,0,131,1,0,90,11,0,101,6,0,101,9,0,100,13,
+    0,100,14,0,132,0,0,131,1,0,131,1,0,90,12,0,
+    101,6,0,101,9,0,100,15,0,100,16,0,132,0,0,131,
+    1,0,131,1,0,90,13,0,100,4,0,83,41,17,218,15,
+    66,117,105,108,116,105,110,73,109,112,111,114,116,101,114,122,
+    144,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,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,41,2,122,115,82,
+    101,116,117,114,110,32,114,101,112,114,32,102,111,114,32,116,
+    104,101,32,109,111,100,117,108,101,46,10,10,32,32,32,32,
+    32,32,32,32,84,104,101,32,109,101,116,104,111,100,32,105,
+    115,32,100,101,112,114,101,99,97,116,101,100,46,32,32,84,
+    104,101,32,105,109,112,111,114,116,32,109,97,99,104,105,110,
+    101,114,121,32,100,111,101,115,32,116,104,101,32,106,111,98,
+    32,105,116,115,101,108,102,46,10,10,32,32,32,32,32,32,
+    32,32,122,24,60,109,111,100,117,108,101,32,123,33,114,125,
+    32,40,98,117,105,108,116,45,105,110,41,62,41,2,114,47,
+    0,0,0,114,57,0,0,0,41,1,114,180,0,0,0,114,
+    4,0,0,0,114,4,0,0,0,114,5,0,0,0,114,206,
+    0,0,0,233,4,0,0,115,2,0,0,0,0,7,122,27,
     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,11,0,
-    0,0,102,105,110,100,95,109,111,100,117,108,101,129,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,140,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,154,
-    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,
+    109,111,100,117,108,101,95,114,101,112,114,78,99,4,0,0,
+    0,0,0,0,0,4,0,0,0,5,0,0,0,67,0,0,
+    0,115,58,0,0,0,124,2,0,100,0,0,107,9,0,114,
+    16,0,100,0,0,83,116,0,0,106,1,0,124,1,0,131,
+    1,0,114,50,0,116,2,0,124,1,0,124,0,0,100,1,
+    0,100,2,0,131,2,1,83,100,0,0,83,100,0,0,83,
+    41,3,78,114,218,0,0,0,122,8,98,117,105,108,116,45,
+    105,110,41,3,114,106,0,0,0,90,10,105,115,95,98,117,
+    105,108,116,105,110,114,174,0,0,0,41,4,218,3,99,108,
+    115,114,159,0,0,0,114,35,0,0,0,218,6,116,97,114,
+    103,101,116,114,4,0,0,0,114,4,0,0,0,114,5,0,
+    0,0,218,9,102,105,110,100,95,115,112,101,99,242,4,0,
+    0,115,10,0,0,0,0,2,12,1,4,1,15,1,19,2,
+    122,25,66,117,105,108,116,105,110,73,109,112,111,114,116,101,
+    114,46,102,105,110,100,95,115,112,101,99,99,3,0,0,0,
+    0,0,0,0,4,0,0,0,3,0,0,0,67,0,0,0,
+    115,41,0,0,0,124,0,0,106,0,0,124,1,0,124,2,
+    0,131,2,0,125,3,0,124,3,0,100,1,0,107,9,0,
+    114,37,0,124,3,0,106,1,0,83,100,1,0,83,41,2,
+    122,175,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,84,104,105,115,32,109,101,116,104,111,100,32,105,
+    115,32,100,101,112,114,101,99,97,116,101,100,46,32,32,85,
+    115,101,32,102,105,110,100,95,115,112,101,99,40,41,32,105,
+    110,115,116,101,97,100,46,10,10,32,32,32,32,32,32,32,
+    32,78,41,2,114,14,1,0,0,114,170,0,0,0,41,4,
+    114,12,1,0,0,114,159,0,0,0,114,35,0,0,0,114,
+    178,0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,
+    0,0,0,218,11,102,105,110,100,95,109,111,100,117,108,101,
+    251,4,0,0,115,4,0,0,0,0,9,18,1,122,27,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,10,0,0,0,67,0,0,0,115,
+    59,0,0,0,116,0,0,124,1,0,131,1,0,143,23,0,
+    1,116,1,0,116,2,0,106,3,0,124,1,0,131,2,0,
+    125,2,0,87,100,1,0,81,88,124,0,0,124,2,0,95,
+    4,0,100,2,0,124,2,0,95,5,0,124,2,0,83,41,
+    3,122,23,76,111,97,100,32,97,32,98,117,105,108,116,45,
+    105,110,32,109,111,100,117,108,101,46,78,114,30,0,0,0,
+    41,6,114,69,0,0,0,114,114,0,0,0,114,106,0,0,
+    0,90,12,105,110,105,116,95,98,117,105,108,116,105,110,114,
+    205,0,0,0,114,251,0,0,0,41,3,114,12,1,0,0,
+    114,159,0,0,0,114,180,0,0,0,114,4,0,0,0,114,
+    4,0,0,0,114,5,0,0,0,114,5,1,0,0,7,5,
+    0,0,115,10,0,0,0,0,6,13,1,24,1,9,1,9,
+    1,122,27,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,41,2,122,57,
+    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,114,4,0,0,0,41,
+    2,114,12,1,0,0,114,159,0,0,0,114,4,0,0,0,
+    114,4,0,0,0,114,5,0,0,0,218,8,103,101,116,95,
+    99,111,100,101,19,5,0,0,115,2,0,0,0,0,4,122,
+    24,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,41,2,122,56,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,114,4,0,0,0,41,2,114,12,1,0,0,
+    114,159,0,0,0,114,4,0,0,0,114,4,0,0,0,114,
+    5,0,0,0,218,10,103,101,116,95,115,111,117,114,99,101,
+    25,5,0,0,115,2,0,0,0,0,4,122,26,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,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,160,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,166,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,116,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,182,2,
-    0,0,115,2,0,0,0,0,2,117,26,0,0,0,70,114,
+    0,100,1,0,83,41,2,122,52,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,114,4,
+    0,0,0,41,2,114,12,1,0,0,114,159,0,0,0,114,
+    4,0,0,0,114,4,0,0,0,114,5,0,0,0,114,220,
+    0,0,0,31,5,0,0,115,2,0,0,0,0,4,122,26,
+    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,41,14,114,57,0,0,
+    0,114,56,0,0,0,114,58,0,0,0,114,59,0,0,0,
+    218,12,115,116,97,116,105,99,109,101,116,104,111,100,114,206,
+    0,0,0,218,11,99,108,97,115,115,109,101,116,104,111,100,
+    114,14,1,0,0,114,15,1,0,0,114,162,0,0,0,114,
+    5,1,0,0,114,16,1,0,0,114,17,1,0,0,114,220,
+    0,0,0,114,4,0,0,0,114,4,0,0,0,114,4,0,
+    0,0,114,5,0,0,0,114,11,1,0,0,224,4,0,0,
+    115,28,0,0,0,12,7,6,2,18,9,3,1,21,8,3,
+    1,18,11,3,1,21,11,3,1,21,5,3,1,21,5,3,
+    1,114,11,1,0,0,99,0,0,0,0,0,0,0,0,0,
+    0,0,0,5,0,0,0,64,0,0,0,115,193,0,0,0,
+    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,6,0,100,4,0,100,4,0,100,5,0,
+    100,6,0,132,2,0,131,1,0,90,7,0,101,6,0,100,
+    4,0,100,7,0,100,8,0,132,1,0,131,1,0,90,8,
+    0,101,4,0,100,9,0,100,10,0,132,0,0,131,1,0,
+    90,9,0,101,6,0,100,11,0,100,12,0,132,0,0,131,
+    1,0,90,10,0,101,6,0,101,11,0,100,13,0,100,14,
+    0,132,0,0,131,1,0,131,1,0,90,12,0,101,6,0,
+    101,11,0,100,15,0,100,16,0,132,0,0,131,1,0,131,
+    1,0,90,13,0,101,6,0,101,11,0,100,17,0,100,18,
+    0,132,0,0,131,1,0,131,1,0,90,14,0,100,4,0,
+    83,41,19,218,14,70,114,111,122,101,110,73,109,112,111,114,
+    116,101,114,122,142,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,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,41,2,122,
+    115,82,101,116,117,114,110,32,114,101,112,114,32,102,111,114,
+    32,116,104,101,32,109,111,100,117,108,101,46,10,10,32,32,
+    32,32,32,32,32,32,84,104,101,32,109,101,116,104,111,100,
+    32,105,115,32,100,101,112,114,101,99,97,116,101,100,46,32,
+    32,84,104,101,32,105,109,112,111,114,116,32,109,97,99,104,
+    105,110,101,114,121,32,100,111,101,115,32,116,104,101,32,106,
+    111,98,32,105,116,115,101,108,102,46,10,10,32,32,32,32,
+    32,32,32,32,122,22,60,109,111,100,117,108,101,32,123,33,
+    114,125,32,40,102,114,111,122,101,110,41,62,41,2,114,47,
+    0,0,0,114,57,0,0,0,41,1,218,1,109,114,4,0,
+    0,0,114,4,0,0,0,114,5,0,0,0,114,206,0,0,
+    0,47,5,0,0,115,2,0,0,0,0,7,122,26,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,186,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,191,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,208,2,0,0,115,
-    2,0,0,0,0,4,117,23,0,0,0,70,114,111,122,101,
+    117,108,101,95,114,101,112,114,78,99,4,0,0,0,0,0,
+    0,0,4,0,0,0,5,0,0,0,67,0,0,0,115,42,
+    0,0,0,116,0,0,106,1,0,124,1,0,131,1,0,114,
+    34,0,116,2,0,124,1,0,124,0,0,100,1,0,100,2,
+    0,131,2,1,83,100,0,0,83,100,0,0,83,41,3,78,
+    114,218,0,0,0,90,6,102,114,111,122,101,110,41,3,114,
+    106,0,0,0,114,163,0,0,0,114,174,0,0,0,41,4,
+    114,12,1,0,0,114,159,0,0,0,114,35,0,0,0,114,
+    13,1,0,0,114,4,0,0,0,114,4,0,0,0,114,5,
+    0,0,0,114,14,1,0,0,56,5,0,0,115,6,0,0,
+    0,0,2,15,1,19,2,122,24,70,114,111,122,101,110,73,
+    109,112,111,114,116,101,114,46,102,105,110,100,95,115,112,101,
+    99,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,41,2,122,93,70,105,110,100,32,97,32,102,114,111,
+    122,101,110,32,109,111,100,117,108,101,46,10,10,32,32,32,
+    32,32,32,32,32,84,104,105,115,32,109,101,116,104,111,100,
+    32,105,115,32,100,101,112,114,101,99,97,116,101,100,46,32,
+    32,85,115,101,32,102,105,110,100,95,115,112,101,99,40,41,
+    32,105,110,115,116,101,97,100,46,10,10,32,32,32,32,32,
+    32,32,32,78,41,2,114,106,0,0,0,114,163,0,0,0,
+    41,3,114,12,1,0,0,114,159,0,0,0,114,35,0,0,
+    0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,
+    114,15,1,0,0,63,5,0,0,115,2,0,0,0,0,7,
+    122,26,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,1,0,0,
+    0,0,0,0,0,3,0,0,0,4,0,0,0,67,0,0,
+    0,115,95,0,0,0,124,0,0,106,0,0,106,1,0,125,
+    1,0,116,2,0,106,3,0,124,1,0,131,1,0,115,57,
+    0,116,4,0,100,1,0,106,5,0,124,1,0,131,1,0,
+    100,2,0,124,1,0,131,1,1,130,1,0,110,0,0,116,
+    6,0,116,2,0,106,7,0,124,1,0,131,2,0,125,2,
+    0,116,8,0,124,2,0,124,0,0,106,9,0,131,2,0,
+    1,100,0,0,83,41,3,78,122,27,123,33,114,125,32,105,
+    115,32,110,111,116,32,97,32,102,114,111,122,101,110,32,109,
+    111,100,117,108,101,114,67,0,0,0,41,10,114,209,0,0,
+    0,114,67,0,0,0,114,106,0,0,0,114,163,0,0,0,
+    114,154,0,0,0,114,47,0,0,0,114,114,0,0,0,218,
+    17,103,101,116,95,102,114,111,122,101,110,95,111,98,106,101,
+    99,116,114,176,0,0,0,114,63,0,0,0,41,3,114,180,
+    0,0,0,114,67,0,0,0,114,195,0,0,0,114,4,0,
+    0,0,114,4,0,0,0,114,5,0,0,0,114,2,1,0,
+    0,72,5,0,0,115,12,0,0,0,0,2,12,1,15,1,
+    18,1,12,1,18,1,122,26,70,114,111,122,101,110,73,109,
+    112,111,114,116,101,114,46,101,120,101,99,95,109,111,100,117,
+    108,101,99,2,0,0,0,0,0,0,0,2,0,0,0,3,
+    0,0,0,67,0,0,0,115,13,0,0,0,116,0,0,124,
+    0,0,124,1,0,131,2,0,83,41,1,122,95,76,111,97,
+    100,32,97,32,102,114,111,122,101,110,32,109,111,100,117,108,
+    101,46,10,10,32,32,32,32,32,32,32,32,84,104,105,115,
+    32,109,101,116,104,111,100,32,105,115,32,100,101,112,114,101,
+    99,97,116,101,100,46,32,32,85,115,101,32,101,120,101,99,
+    95,109,111,100,117,108,101,40,41,32,105,110,115,116,101,97,
+    100,46,10,10,32,32,32,32,32,32,32,32,41,1,114,181,
+    0,0,0,41,2,114,12,1,0,0,114,159,0,0,0,114,
+    4,0,0,0,114,4,0,0,0,114,5,0,0,0,114,5,
+    1,0,0,81,5,0,0,115,2,0,0,0,0,7,122,26,
+    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,41,1,122,45,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,41,2,114,106,0,0,0,114,22,1,0,0,41,2,
+    114,12,1,0,0,114,159,0,0,0,114,4,0,0,0,114,
+    4,0,0,0,114,5,0,0,0,114,16,1,0,0,90,5,
+    0,0,115,2,0,0,0,0,4,122,23,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,214,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,220,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,173,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,
+    41,2,122,54,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,114,4,0,0,0,
+    41,2,114,12,1,0,0,114,159,0,0,0,114,4,0,0,
+    0,114,4,0,0,0,114,5,0,0,0,114,17,1,0,0,
+    96,5,0,0,115,2,0,0,0,0,4,122,25,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,41,1,122,
+    46,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,41,
+    2,114,106,0,0,0,90,17,105,115,95,102,114,111,122,101,
+    110,95,112,97,99,107,97,103,101,41,2,114,12,1,0,0,
+    114,159,0,0,0,114,4,0,0,0,114,4,0,0,0,114,
+    5,0,0,0,114,220,0,0,0,102,5,0,0,115,2,0,
+    0,0,0,4,122,25,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,41,
+    15,114,57,0,0,0,114,56,0,0,0,114,58,0,0,0,
+    114,59,0,0,0,114,18,1,0,0,114,206,0,0,0,114,
+    19,1,0,0,114,14,1,0,0,114,15,1,0,0,114,2,
+    1,0,0,114,5,1,0,0,114,165,0,0,0,114,16,1,
+    0,0,114,17,1,0,0,114,220,0,0,0,114,4,0,0,
+    0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,
+    114,20,1,0,0,38,5,0,0,115,28,0,0,0,12,7,
+    6,2,18,9,3,1,21,6,3,1,18,8,18,9,18,9,
+    3,1,21,5,3,1,21,5,3,1,114,20,1,0,0,99,
+    0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,
+    64,0,0,0,115,121,0,0,0,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,4,0,90,6,0,101,7,0,
+    100,5,0,100,6,0,132,0,0,131,1,0,90,8,0,101,
+    7,0,100,7,0,100,8,0,132,0,0,131,1,0,90,9,
+    0,101,7,0,100,9,0,100,9,0,100,10,0,100,11,0,
+    132,2,0,131,1,0,90,10,0,101,7,0,100,9,0,100,
+    12,0,100,13,0,132,1,0,131,1,0,90,11,0,100,9,
+    0,83,41,14,218,21,87,105,110,100,111,119,115,82,101,103,
+    105,115,116,114,121,70,105,110,100,101,114,122,62,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,122,59,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,122,65,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,70,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,240,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,247,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,
+    89,110,1,0,88,100,0,0,83,41,1,78,41,5,218,7,
+    95,119,105,110,114,101,103,90,7,79,112,101,110,75,101,121,
+    90,17,72,75,69,89,95,67,85,82,82,69,78,84,95,85,
+    83,69,82,114,40,0,0,0,90,18,72,75,69,89,95,76,
+    79,67,65,76,95,77,65,67,72,73,78,69,41,2,114,12,
+    1,0,0,218,3,107,101,121,114,4,0,0,0,114,4,0,
+    0,0,114,5,0,0,0,218,14,95,111,112,101,110,95,114,
+    101,103,105,115,116,114,121,121,5,0,0,115,8,0,0,0,
+    0,2,3,1,23,1,13,1,122,36,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,41,5,78,114,159,0,0,0,90,11,
+    115,121,115,95,118,101,114,115,105,111,110,114,137,0,0,0,
+    114,30,0,0,0,41,10,218,11,68,69,66,85,71,95,66,
+    85,73,76,68,218,18,82,69,71,73,83,84,82,89,95,75,
+    69,89,95,68,69,66,85,71,218,12,82,69,71,73,83,84,
+    82,89,95,75,69,89,114,47,0,0,0,114,7,0,0,0,
+    218,7,118,101,114,115,105,111,110,114,26,1,0,0,114,24,
+    1,0,0,90,10,81,117,101,114,121,86,97,108,117,101,114,
+    40,0,0,0,41,6,114,12,1,0,0,114,159,0,0,0,
+    90,12,114,101,103,105,115,116,114,121,95,107,101,121,114,25,
+    1,0,0,90,4,104,107,101,121,218,8,102,105,108,101,112,
+    97,116,104,114,4,0,0,0,114,4,0,0,0,114,5,0,
+    0,0,218,16,95,115,101,97,114,99,104,95,114,101,103,105,
+    115,116,114,121,128,5,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,122,38,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,78,99,4,0,0,
+    0,0,0,0,0,8,0,0,0,14,0,0,0,67,0,0,
+    0,115,155,0,0,0,124,0,0,106,0,0,124,1,0,131,
+    1,0,125,4,0,124,4,0,100,0,0,107,8,0,114,31,
+    0,100,0,0,83,121,14,0,116,1,0,124,4,0,131,1,
+    0,1,87,110,22,0,4,116,2,0,107,10,0,114,69,0,
+    1,1,1,100,0,0,83,89,110,1,0,88,120,78,0,116,
+    3,0,131,0,0,68,93,67,0,92,2,0,125,5,0,125,
+    6,0,124,4,0,106,4,0,116,5,0,124,6,0,131,1,
+    0,131,1,0,114,80,0,116,6,0,124,1,0,124,5,0,
+    124,1,0,124,4,0,131,2,0,100,1,0,124,4,0,131,
+    2,1,125,7,0,124,7,0,83,113,80,0,87,100,0,0,
+    83,41,2,78,114,218,0,0,0,41,7,114,32,1,0,0,
+    114,39,0,0,0,114,40,0,0,0,114,241,0,0,0,114,
+    231,0,0,0,114,232,0,0,0,114,174,0,0,0,41,8,
+    114,12,1,0,0,114,159,0,0,0,114,35,0,0,0,114,
+    13,1,0,0,114,31,1,0,0,114,170,0,0,0,114,126,
+    0,0,0,114,178,0,0,0,114,4,0,0,0,114,4,0,
+    0,0,114,5,0,0,0,114,14,1,0,0,143,5,0,0,
+    115,24,0,0,0,0,2,15,1,12,1,4,1,3,1,14,
+    1,13,1,9,1,22,1,21,1,21,1,9,1,122,31,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,6,0,
-    0,0,12,0,0,0,67,0,0,0,115,137,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,57,0,116,5,0,131,0,
-    0,68,93,46,0,92,2,0,125,4,0,125,5,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,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,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,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,
-    6,3,0,0,115,20,0,0,0,0,3,15,1,12,1,4,
-    1,3,1,17,1,13,1,9,1,22,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,
-    227,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,26,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,208,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,115,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,
-    131,1,0,1,116,3,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,
-    4,0,124,6,0,131,1,0,100,2,0,107,3,0,114,173,
-    0,100,8,0,106,1,0,124,1,0,131,1,0,125,9,0,
-    116,2,0,124,9,0,131,1,0,1,116,5,0,124,9,0,
-    131,1,0,130,1,0,110,58,0,116,4,0,124,7,0,131,
-    1,0,100,2,0,107,3,0,114,231,0,100,9,0,106,1,
-    0,124,1,0,131,1,0,125,9,0,116,2,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,194,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,27,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,98,1,100,11,0,106,1,0,
-    124,1,0,131,1,0,125,9,0,116,2,0,124,9,0,131,
-    1,0,1,116,3,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,136,1,1,1,1,
-    89,113,194,1,88,116,9,0,124,7,0,131,1,0,124,11,
-    0,107,3,0,114,194,1,116,3,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,194,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,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,73,109,112,
-    111,114,116,69,114,114,111,114,117,3,0,0,0,108,101,110,
-    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,34,3,0,0,115,68,0,0,0,0,7,16,1,16,1,
-    16,1,12,1,18,1,10,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,80,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,21,3,0,0,115,10,0,0,0,16,3,6,2,12,8,
-    12,46,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,106,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,112,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,124,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,134,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,
+    110,100,101,114,46,102,105,110,100,95,115,112,101,99,99,3,
+    0,0,0,0,0,0,0,4,0,0,0,3,0,0,0,67,
+    0,0,0,115,45,0,0,0,124,0,0,106,0,0,124,1,
+    0,124,2,0,131,2,0,125,3,0,124,3,0,100,1,0,
+    107,9,0,114,37,0,124,3,0,106,1,0,83,100,1,0,
+    83,100,1,0,83,41,2,122,108,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,10,10,32,32,32,
+    32,32,32,32,32,84,104,105,115,32,109,101,116,104,111,100,
+    32,105,115,32,100,101,112,114,101,99,97,116,101,100,46,32,
+    32,85,115,101,32,101,120,101,99,95,109,111,100,117,108,101,
+    40,41,32,105,110,115,116,101,97,100,46,10,10,32,32,32,
+    32,32,32,32,32,78,41,2,114,14,1,0,0,114,170,0,
+    0,0,41,4,114,12,1,0,0,114,159,0,0,0,114,35,
+    0,0,0,114,178,0,0,0,114,4,0,0,0,114,4,0,
+    0,0,114,5,0,0,0,114,15,1,0,0,158,5,0,0,
+    115,8,0,0,0,0,7,18,1,12,1,7,2,122,33,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,
+    41,12,114,57,0,0,0,114,56,0,0,0,114,58,0,0,
+    0,114,59,0,0,0,114,29,1,0,0,114,28,1,0,0,
+    114,27,1,0,0,114,19,1,0,0,114,26,1,0,0,114,
+    32,1,0,0,114,14,1,0,0,114,15,1,0,0,114,4,
+    0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0,
+    0,0,114,23,1,0,0,109,5,0,0,115,20,0,0,0,
+    12,2,6,3,6,3,6,2,6,2,18,7,18,15,3,1,
+    21,14,3,1,114,23,1,0,0,99,0,0,0,0,0,0,
+    0,0,0,0,0,0,2,0,0,0,64,0,0,0,115,52,
+    0,0,0,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,83,41,7,218,13,95,76,111,97,100,
+    101,114,66,97,115,105,99,115,122,83,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,41,
+    6,122,141,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,
+    114,29,0,0,0,114,116,0,0,0,114,84,0,0,0,114,
+    115,0,0,0,114,72,0,0,0,41,4,114,38,0,0,0,
+    114,239,0,0,0,114,34,0,0,0,114,32,0,0,0,41,
+    5,114,71,0,0,0,114,159,0,0,0,114,131,0,0,0,
+    90,13,102,105,108,101,110,97,109,101,95,98,97,115,101,90,
+    9,116,97,105,108,95,110,97,109,101,114,4,0,0,0,114,
+    4,0,0,0,114,5,0,0,0,114,220,0,0,0,177,5,
+    0,0,115,8,0,0,0,0,3,25,1,22,1,19,1,122,
+    24,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,2,0,0,0,0,0,
+    0,0,3,0,0,0,4,0,0,0,67,0,0,0,115,80,
+    0,0,0,124,0,0,106,0,0,124,1,0,106,1,0,131,
+    1,0,125,2,0,124,2,0,100,1,0,107,8,0,114,57,
+    0,116,2,0,100,2,0,106,3,0,124,1,0,106,1,0,
+    131,1,0,131,1,0,130,1,0,110,0,0,116,4,0,116,
+    5,0,124,2,0,124,1,0,106,6,0,131,3,0,1,100,
+    1,0,83,41,3,122,19,69,120,101,99,117,116,101,32,116,
+    104,101,32,109,111,100,117,108,101,46,78,122,52,99,97,110,
+    110,111,116,32,108,111,97,100,32,109,111,100,117,108,101,32,
+    123,33,114,125,32,119,104,101,110,32,103,101,116,95,99,111,
+    100,101,40,41,32,114,101,116,117,114,110,115,32,78,111,110,
+    101,41,7,114,16,1,0,0,114,57,0,0,0,114,154,0,
+    0,0,114,47,0,0,0,114,114,0,0,0,114,176,0,0,
+    0,114,63,0,0,0,41,3,114,71,0,0,0,114,180,0,
+    0,0,114,195,0,0,0,114,4,0,0,0,114,4,0,0,
+    0,114,5,0,0,0,114,2,1,0,0,185,5,0,0,115,
+    10,0,0,0,0,2,18,1,12,1,9,1,18,1,122,25,
+    95,76,111,97,100,101,114,66,97,115,105,99,115,46,101,120,
+    101,99,95,109,111,100,117,108,101,78,41,8,114,57,0,0,
+    0,114,56,0,0,0,114,58,0,0,0,114,59,0,0,0,
+    114,220,0,0,0,114,2,1,0,0,114,181,0,0,0,114,
+    5,1,0,0,114,4,0,0,0,114,4,0,0,0,114,4,
+    0,0,0,114,5,0,0,0,114,33,1,0,0,172,5,0,
+    0,115,8,0,0,0,12,3,6,2,12,8,12,8,114,33,
+    1,0,0,99,0,0,0,0,0,0,0,0,0,0,0,0,
+    4,0,0,0,64,0,0,0,115,106,0,0,0,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,18,0,100,13,0,100,14,
+    0,132,0,1,90,8,0,100,15,0,100,16,0,132,0,0,
+    90,9,0,100,17,0,83,41,19,218,12,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,41,2,122,178,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,
+    10,32,32,32,32,32,32,32,32,82,97,105,115,101,115,32,
+    73,79,69,114,114,111,114,32,119,104,101,110,32,116,104,101,
+    32,112,97,116,104,32,99,97,110,110,111,116,32,98,101,32,
+    104,97,110,100,108,101,100,46,10,32,32,32,32,32,32,32,
+    32,78,41,1,218,7,73,79,69,114,114,111,114,41,2,114,
+    71,0,0,0,114,35,0,0,0,114,4,0,0,0,114,4,
+    0,0,0,114,5,0,0,0,218,10,112,97,116,104,95,109,
+    116,105,109,101,198,5,0,0,115,2,0,0,0,0,6,122,
+    23,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,41,2,97,170,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,82,
+    97,105,115,101,115,32,73,79,69,114,114,111,114,32,119,104,
+    101,110,32,116,104,101,32,112,97,116,104,32,99,97,110,110,
+    111,116,32,98,101,32,104,97,110,100,108,101,100,46,10,32,
+    32,32,32,32,32,32,32,114,184,0,0,0,41,1,114,36,
+    1,0,0,41,2,114,71,0,0,0,114,35,0,0,0,114,
+    4,0,0,0,114,4,0,0,0,114,5,0,0,0,218,10,
+    112,97,116,104,95,115,116,97,116,115,206,5,0,0,115,2,
+    0,0,0,0,11,122,23,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,41,1,122,228,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,
+    41,1,218,8,115,101,116,95,100,97,116,97,41,4,114,71,
+    0,0,0,114,142,0,0,0,90,10,99,97,99,104,101,95,
+    112,97,116,104,114,53,0,0,0,114,4,0,0,0,114,4,
+    0,0,0,114,5,0,0,0,218,15,95,99,97,99,104,101,
+    95,98,121,116,101,99,111,100,101,219,5,0,0,115,2,0,
+    0,0,0,8,122,28,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,4,0,0,0,100,1,0,83,
+    41,2,122,150,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,32,32,32,32,32,32,32,32,78,114,4,0,0,0,
+    41,3,114,71,0,0,0,114,35,0,0,0,114,53,0,0,
+    0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,
+    114,38,1,0,0,229,5,0,0,115,0,0,0,0,122,21,
+    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,5,0,
+    0,0,16,0,0,0,67,0,0,0,115,105,0,0,0,124,
+    0,0,106,0,0,124,1,0,131,1,0,125,2,0,121,19,
+    0,124,0,0,106,1,0,124,2,0,131,1,0,125,3,0,
+    87,110,58,0,4,116,2,0,107,10,0,114,94,0,1,125,
+    4,0,1,122,26,0,116,3,0,100,1,0,100,2,0,124,
+    1,0,131,1,1,124,4,0,130,2,0,87,89,100,3,0,
+    100,3,0,125,4,0,126,4,0,88,110,1,0,88,116,4,
+    0,124,3,0,131,1,0,83,41,4,122,52,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,143,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,165,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,227,
-    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,104,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,
+    122,39,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,114,67,0,0,0,78,41,
+    5,114,239,0,0,0,218,8,103,101,116,95,100,97,116,97,
+    114,40,0,0,0,114,154,0,0,0,114,204,0,0,0,41,
+    5,114,71,0,0,0,114,159,0,0,0,114,35,0,0,0,
+    114,202,0,0,0,218,3,101,120,99,114,4,0,0,0,114,
+    4,0,0,0,114,5,0,0,0,114,17,1,0,0,236,5,
+    0,0,115,14,0,0,0,0,2,15,1,3,1,19,1,18,
+    1,9,1,31,1,122,23,83,111,117,114,99,101,76,111,97,
+    100,101,114,46,103,101,116,95,115,111,117,114,99,101,218,9,
+    95,111,112,116,105,109,105,122,101,114,29,0,0,0,99,3,
+    0,0,0,1,0,0,0,4,0,0,0,9,0,0,0,67,
+    0,0,0,115,31,0,0,0,116,0,0,116,1,0,124,1,
+    0,124,2,0,100,1,0,100,2,0,100,3,0,100,4,0,
+    124,3,0,131,4,2,83,41,5,122,130,82,101,116,117,114,
+    110,32,116,104,101,32,99,111,100,101,32,111,98,106,101,99,
+    116,32,99,111,109,112,105,108,101,100,32,102,114,111,109,32,
+    115,111,117,114,99,101,46,10,10,32,32,32,32,32,32,32,
+    32,84,104,101,32,39,100,97,116,97,39,32,97,114,103,117,
+    109,101,110,116,32,99,97,110,32,98,101,32,97,110,121,32,
+    111,98,106,101,99,116,32,116,121,112,101,32,116,104,97,116,
+    32,99,111,109,112,105,108,101,40,41,32,115,117,112,112,111,
+    114,116,115,46,10,32,32,32,32,32,32,32,32,114,176,0,
+    0,0,218,12,100,111,110,116,95,105,110,104,101,114,105,116,
+    84,114,118,0,0,0,41,2,114,114,0,0,0,218,7,99,
+    111,109,112,105,108,101,41,4,114,71,0,0,0,114,53,0,
+    0,0,114,35,0,0,0,114,42,1,0,0,114,4,0,0,
+    0,114,4,0,0,0,114,5,0,0,0,218,14,115,111,117,
+    114,99,101,95,116,111,95,99,111,100,101,246,5,0,0,115,
+    4,0,0,0,0,5,18,1,122,27,83,111,117,114,99,101,
+    76,111,97,100,101,114,46,115,111,117,114,99,101,95,116,111,
+    95,99,111,100,101,99,2,0,0,0,0,0,0,0,10,0,
+    0,0,43,0,0,0,67,0,0,0,115,177,1,0,0,124,
+    0,0,106,0,0,124,1,0,131,1,0,125,2,0,100,1,
+    0,125,3,0,121,16,0,116,1,0,124,2,0,131,1,0,
+    125,4,0,87,110,24,0,4,116,2,0,107,10,0,114,63,
+    0,1,1,1,100,1,0,125,4,0,89,110,202,0,88,121,
+    19,0,124,0,0,106,3,0,124,2,0,131,1,0,125,5,
+    0,87,110,18,0,4,116,4,0,107,10,0,114,103,0,1,
+    1,1,89,110,162,0,88,116,5,0,124,5,0,100,2,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,106,0,88,121,
+    34,0,116,8,0,124,6,0,100,3,0,124,5,0,100,4,
+    0,124,1,0,100,5,0,124,4,0,131,1,3,125,7,0,
+    87,110,24,0,4,116,9,0,116,10,0,102,2,0,107,10,
+    0,114,220,0,1,1,1,89,110,45,0,88,116,11,0,100,
+    6,0,124,4,0,124,2,0,131,3,0,1,116,12,0,124,
+    7,0,100,4,0,124,1,0,100,7,0,124,4,0,100,8,
+    0,124,2,0,131,1,3,83,124,0,0,106,6,0,124,2,
+    0,131,1,0,125,8,0,124,0,0,106,13,0,124,8,0,
+    124,2,0,131,2,0,125,9,0,116,11,0,100,9,0,124,
+    2,0,131,2,0,1,116,14,0,106,15,0,12,114,173,1,
+    124,4,0,100,1,0,107,9,0,114,173,1,124,3,0,100,
+    1,0,107,9,0,114,173,1,116,16,0,124,9,0,124,3,
+    0,116,17,0,124,8,0,131,1,0,131,3,0,125,6,0,
+    121,36,0,124,0,0,106,18,0,124,2,0,124,4,0,124,
+    6,0,131,3,0,1,116,11,0,100,10,0,124,4,0,131,
+    2,0,1,87,113,173,1,4,116,2,0,107,10,0,114,169,
+    1,1,1,1,89,113,173,1,88,110,0,0,124,9,0,83,
+    41,11,122,190,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,78,114,184,0,0,0,114,188,0,0,0,114,67,0,
+    0,0,114,35,0,0,0,122,13,123,125,32,109,97,116,99,
+    104,101,115,32,123,125,114,141,0,0,0,114,142,0,0,0,
+    122,19,99,111,100,101,32,111,98,106,101,99,116,32,102,114,
+    111,109,32,123,125,122,10,119,114,111,116,101,32,123,33,114,
+    125,41,19,114,239,0,0,0,114,132,0,0,0,114,123,0,
+    0,0,114,37,1,0,0,114,35,1,0,0,114,14,0,0,
+    0,114,40,1,0,0,114,40,0,0,0,114,191,0,0,0,
+    114,154,0,0,0,114,187,0,0,0,114,153,0,0,0,114,
+    196,0,0,0,114,45,1,0,0,114,7,0,0,0,218,19,
+    100,111,110,116,95,119,114,105,116,101,95,98,121,116,101,99,
+    111,100,101,114,199,0,0,0,114,31,0,0,0,114,39,1,
+    0,0,41,10,114,71,0,0,0,114,159,0,0,0,114,142,
+    0,0,0,114,189,0,0,0,114,141,0,0,0,218,2,115,
+    116,114,53,0,0,0,218,10,98,121,116,101,115,95,100,97,
+    116,97,114,202,0,0,0,90,11,99,111,100,101,95,111,98,
+    106,101,99,116,114,4,0,0,0,114,4,0,0,0,114,5,
+    0,0,0,114,16,1,0,0,254,5,0,0,115,78,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,9,1,12,1,13,1,19,1,5,2,9,1,7,
+    1,15,1,6,1,7,1,15,1,18,1,13,1,22,1,12,
+    1,9,1,15,1,3,1,19,1,17,1,13,1,8,1,122,
+    21,83,111,117,114,99,101,76,111,97,100,101,114,46,103,101,
+    116,95,99,111,100,101,78,114,139,0,0,0,41,10,114,57,
+    0,0,0,114,56,0,0,0,114,58,0,0,0,114,36,1,
+    0,0,114,37,1,0,0,114,39,1,0,0,114,38,1,0,
+    0,114,17,1,0,0,114,45,1,0,0,114,16,1,0,0,
+    114,4,0,0,0,114,4,0,0,0,114,4,0,0,0,114,
+    5,0,0,0,114,34,1,0,0,196,5,0,0,115,14,0,
+    0,0,12,2,12,8,12,13,12,10,12,7,12,10,18,8,
+    114,34,1,0,0,99,0,0,0,0,0,0,0,0,0,0,
+    0,0,4,0,0,0,0,0,0,0,115,112,0,0,0,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,132,
+    0,0,90,6,0,101,7,0,135,0,0,102,1,0,100,8,
+    0,100,9,0,134,0,0,131,1,0,90,8,0,101,7,0,
+    100,10,0,100,11,0,132,0,0,131,1,0,90,9,0,100,
+    12,0,100,13,0,132,0,0,90,10,0,135,0,0,83,41,
+    14,218,10,70,105,108,101,76,111,97,100,101,114,122,103,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,41,2,122,75,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,41,2,114,67,0,0,0,114,35,0,
+    0,0,41,3,114,71,0,0,0,114,159,0,0,0,114,35,
+    0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0,
+    0,0,114,72,0,0,0,55,6,0,0,115,4,0,0,0,
+    0,3,9,1,122,19,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,2,0,0,0,67,0,0,0,115,34,
+    0,0,0,124,0,0,106,0,0,124,1,0,106,0,0,107,
+    2,0,111,33,0,124,0,0,106,1,0,124,1,0,106,1,
+    0,107,2,0,83,41,1,78,41,2,114,225,0,0,0,114,
+    63,0,0,0,41,2,114,71,0,0,0,114,228,0,0,0,
+    114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,114,
+    230,0,0,0,61,6,0,0,115,4,0,0,0,0,1,18,
+    1,122,17,70,105,108,101,76,111,97,100,101,114,46,95,95,
+    101,113,95,95,99,1,0,0,0,0,0,0,0,1,0,0,
+    0,3,0,0,0,67,0,0,0,115,26,0,0,0,116,0,
+    0,124,0,0,106,1,0,131,1,0,116,0,0,124,0,0,
+    106,2,0,131,1,0,65,83,41,1,78,41,3,218,4,104,
+    97,115,104,114,67,0,0,0,114,35,0,0,0,41,1,114,
+    71,0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,
+    0,0,0,218,8,95,95,104,97,115,104,95,95,65,6,0,
+    0,115,2,0,0,0,0,1,122,19,70,105,108,101,76,111,
+    97,100,101,114,46,95,95,104,97,115,104,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,41,1,122,
+    100,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,10,10,32,32,32,
+    32,32,32,32,32,84,104,105,115,32,109,101,116,104,111,100,
+    32,105,115,32,100,101,112,114,101,99,97,116,101,100,46,32,
+    32,85,115,101,32,101,120,101,99,95,109,111,100,117,108,101,
+    40,41,32,105,110,115,116,101,97,100,46,10,10,32,32,32,
+    32,32,32,32,32,41,3,218,5,115,117,112,101,114,114,49,
+    1,0,0,114,5,1,0,0,41,2,114,71,0,0,0,114,
+    159,0,0,0,41,1,114,225,0,0,0,114,4,0,0,0,
+    114,5,0,0,0,114,5,1,0,0,68,6,0,0,115,2,
+    0,0,0,0,10,122,22,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,41,1,
+    122,58,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,41,1,114,35,
+    0,0,0,41,2,114,71,0,0,0,114,159,0,0,0,114,
+    4,0,0,0,114,4,0,0,0,114,5,0,0,0,114,239,
+    0,0,0,80,6,0,0,115,2,0,0,0,0,3,122,23,
+    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,41,3,122,39,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,218,1,114,78,41,3,114,49,0,0,0,
+    114,50,0,0,0,90,4,114,101,97,100,41,3,114,71,0,
+    0,0,114,35,0,0,0,114,54,0,0,0,114,4,0,0,
+    0,114,4,0,0,0,114,5,0,0,0,114,40,1,0,0,
+    85,6,0,0,115,4,0,0,0,0,2,21,1,122,19,70,
+    105,108,101,76,111,97,100,101,114,46,103,101,116,95,100,97,
+    116,97,41,11,114,57,0,0,0,114,56,0,0,0,114,58,
+    0,0,0,114,59,0,0,0,114,72,0,0,0,114,230,0,
+    0,0,114,51,1,0,0,114,157,0,0,0,114,5,1,0,
+    0,114,239,0,0,0,114,40,1,0,0,114,4,0,0,0,
+    114,4,0,0,0,41,1,114,225,0,0,0,114,5,0,0,
+    0,114,49,1,0,0,50,6,0,0,115,14,0,0,0,12,
+    3,6,2,12,6,12,4,12,3,24,12,18,5,114,49,1,
+    0,0,99,0,0,0,0,0,0,0,0,0,0,0,0,4,
+    0,0,0,64,0,0,0,115,64,0,0,0,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,243,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,249,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,0,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,5,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,238,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,112,97,116,104,
-    95,115,116,97,116,115,15,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,20,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,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,31,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,
+    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,41,11,114,9,
+    1,0,0,122,62,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,36,0,0,0,116,0,0,
+    124,1,0,131,1,0,125,2,0,105,2,0,124,2,0,106,
+    1,0,100,1,0,54,124,2,0,106,2,0,100,2,0,54,
+    83,41,3,122,33,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,114,184,0,0,0,114,185,0,0,0,
+    41,3,114,39,0,0,0,218,8,115,116,95,109,116,105,109,
+    101,90,7,115,116,95,115,105,122,101,41,3,114,71,0,0,
+    0,114,35,0,0,0,114,47,1,0,0,114,4,0,0,0,
+    114,4,0,0,0,114,5,0,0,0,114,37,1,0,0,95,
+    6,0,0,115,4,0,0,0,0,2,12,1,122,27,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,5,0,0,0,67,0,0,0,115,34,
+    0,0,0,116,0,0,124,1,0,131,1,0,125,4,0,124,
+    0,0,106,1,0,124,2,0,124,3,0,100,1,0,124,4,
+    0,131,2,1,83,41,2,78,218,5,95,109,111,100,101,41,
+    2,114,145,0,0,0,114,38,1,0,0,41,5,114,71,0,
+    0,0,114,142,0,0,0,114,141,0,0,0,114,53,0,0,
+    0,114,42,0,0,0,114,4,0,0,0,114,4,0,0,0,
+    114,5,0,0,0,114,39,1,0,0,100,6,0,0,115,4,
+    0,0,0,0,2,12,1,122,32,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,114,55,1,0,0,105,182,
+    1,0,0,99,3,0,0,0,1,0,0,0,9,0,0,0,
+    17,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,41,4,122,27,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,122,27,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,122,
+    12,99,114,101,97,116,101,100,32,123,33,114,125,41,11,114,
+    38,0,0,0,114,46,0,0,0,114,224,0,0,0,114,33,
+    0,0,0,114,28,0,0,0,114,3,0,0,0,90,5,109,
+    107,100,105,114,218,15,70,105,108,101,69,120,105,115,116,115,
+    69,114,114,111,114,114,40,0,0,0,114,153,0,0,0,114,
+    55,0,0,0,41,9,114,71,0,0,0,114,35,0,0,0,
+    114,53,0,0,0,114,55,1,0,0,114,234,0,0,0,114,
+    131,0,0,0,114,27,0,0,0,114,23,0,0,0,114,41,
+    1,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0,
+    0,0,114,38,1,0,0,105,6,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,122,25,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,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,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,
-    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,16,0,0,0,83,111,117,114,99,101,70,105,108,101,76,
-    111,97,100,101,114,11,4,0,0,115,8,0,0,0,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,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,132,0,0,90,6,0,100,
-    8,0,83,40,9,0,0,0,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,45,0,0,0,76,111,97,100,101,114,32,119,104,105,
-    99,104,32,104,97,110,100,108,101,115,32,115,111,117,114,99,
-    101,108,101,115,115,32,102,105,108,101,32,105,109,112,111,114,
-    116,115,46,99,2,0,0,0,0,0,0,0,2,0,0,0,
-    4,0,0,0,67,0,0,0,115,19,0,0,0,124,0,0,
-    106,0,0,124,1,0,100,1,0,100,2,0,131,1,1,83,
-    40,3,0,0,0,78,117,10,0,0,0,115,111,117,114,99,
-    101,108,101,115,115,84,40,2,0,0,0,117,12,0,0,0,
-    95,108,111,97,100,95,109,111,100,117,108,101,117,4,0,0,
-    0,84,114,117,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,64,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,0,0,
-    0,0,0,0,0,6,0,0,0,6,0,0,0,67,0,0,
-    0,115,138,0,0,0,124,0,0,106,0,0,124,1,0,131,
-    1,0,125,2,0,124,0,0,106,1,0,124,2,0,131,1,
-    0,125,3,0,124,0,0,106,2,0,124,1,0,124,3,0,
-    124,2,0,100,0,0,131,4,0,125,4,0,116,4,0,106,
-    5,0,124,4,0,131,1,0,125,5,0,116,6,0,124,5,
-    0,116,7,0,131,2,0,114,101,0,116,8,0,100,1,0,
-    124,2,0,131,2,0,1,124,5,0,83,116,9,0,100,2,
-    0,106,10,0,124,2,0,131,1,0,100,3,0,124,1,0,
-    100,4,0,124,2,0,131,1,2,130,1,0,100,0,0,83,
-    40,5,0,0,0,78,117,21,0,0,0,99,111,100,101,32,
-    111,98,106,101,99,116,32,102,114,111,109,32,123,33,114,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,40,11,0,0,
-    0,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,
-    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,4,0,0,0,78,111,110,
-    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,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,73,
-    109,112,111,114,116,69,114,114,111,114,117,6,0,0,0,102,
-    111,114,109,97,116,40,6,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,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,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,67,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,
+    97,78,41,7,114,57,0,0,0,114,56,0,0,0,114,58,
+    0,0,0,114,59,0,0,0,114,37,1,0,0,114,39,1,
+    0,0,114,38,1,0,0,114,4,0,0,0,114,4,0,0,
+    0,114,4,0,0,0,114,5,0,0,0,114,9,1,0,0,
+    91,6,0,0,115,8,0,0,0,12,2,6,2,12,5,12,
+    5,114,9,1,0,0,99,0,0,0,0,0,0,0,0,0,
+    0,0,0,2,0,0,0,64,0,0,0,115,46,0,0,0,
+    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,41,7,
+    114,8,1,0,0,122,45,76,111,97,100,101,114,32,119,104,
+    105,99,104,32,104,97,110,100,108,101,115,32,115,111,117,114,
+    99,101,108,101,115,115,32,102,105,108,101,32,105,109,112,111,
+    114,116,115,46,99,2,0,0,0,0,0,0,0,5,0,0,
+    0,6,0,0,0,67,0,0,0,115,76,0,0,0,124,0,
+    0,106,0,0,124,1,0,131,1,0,125,2,0,124,0,0,
+    106,1,0,124,2,0,131,1,0,125,3,0,116,2,0,124,
+    3,0,100,1,0,124,1,0,100,2,0,124,2,0,131,1,
+    2,125,4,0,116,3,0,124,4,0,100,1,0,124,1,0,
+    100,3,0,124,2,0,131,1,2,83,41,4,78,114,67,0,
+    0,0,114,35,0,0,0,114,141,0,0,0,41,4,114,239,
+    0,0,0,114,40,1,0,0,114,191,0,0,0,114,196,0,
+    0,0,41,5,114,71,0,0,0,114,159,0,0,0,114,35,
+    0,0,0,114,53,0,0,0,114,48,1,0,0,114,4,0,
+    0,0,114,4,0,0,0,114,5,0,0,0,114,16,1,0,
+    0,138,6,0,0,115,8,0,0,0,0,1,15,1,15,1,
+    24,1,122,29,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,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,39,0,0,0,82,101,116,117,114,110,32,
-    78,111,110,101,32,97,115,32,116,104,101,114,101,32,105,115,
-    32,110,111,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,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,103,101,116,95,115,
-    111,117,114,99,101,79,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,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,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,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,
-    20,0,0,0,83,111,117,114,99,101,108,101,115,115,70,105,
-    108,101,76,111,97,100,101,114,60,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,0,5,
-    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,90,
-    3,0,100,2,0,100,3,0,132,0,0,90,4,0,101,5,
-    0,101,6,0,101,7,0,100,4,0,100,5,0,132,0,0,
-    131,1,0,131,1,0,131,1,0,90,8,0,100,6,0,100,
-    7,0,132,0,0,90,9,0,100,8,0,100,9,0,132,0,
-    0,90,10,0,100,10,0,100,11,0,132,0,0,90,11,0,
-    100,12,0,83,40,13,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,93,0,0,0,76,111,97,100,101,114,32,102,111,114,
-    32,101,120,116,101,110,115,105,111,110,32,109,111,100,117,108,
-    101,115,46,10,10,32,32,32,32,84,104,101,32,99,111,110,
-    115,116,114,117,99,116,111,114,32,105,115,32,100,101,115,105,
-    103,110,101,100,32,116,111,32,119,111,114,107,32,119,105,116,
-    104,32,70,105,108,101,70,105,110,100,101,114,46,10,10,32,
-    32,32,32,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,
-    0,0,83,40,1,0,0,0,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,4,
-    0,0,0,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,96,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,0,0,
-    4,0,0,0,10,0,0,0,67,0,0,0,115,175,0,0,
-    0,124,1,0,116,0,0,106,1,0,107,6,0,125,2,0,
-    121,107,0,116,2,0,116,3,0,106,4,0,124,1,0,124,
-    0,0,106,5,0,131,3,0,125,3,0,116,6,0,100,1,
-    0,124,0,0,106,5,0,131,2,0,1,124,0,0,106,7,
-    0,124,1,0,131,1,0,114,117,0,116,8,0,124,3,0,
-    100,2,0,131,2,0,12,114,117,0,116,9,0,124,0,0,
-    106,5,0,131,1,0,100,3,0,25,103,1,0,124,3,0,
-    95,10,0,110,0,0,124,3,0,83,87,110,46,0,1,1,
-    1,124,2,0,12,114,163,0,124,1,0,116,0,0,106,1,
-    0,107,6,0,114,163,0,116,0,0,106,1,0,124,1,0,
-    61,110,0,0,130,0,0,89,110,1,0,88,100,4,0,83,
-    40,5,0,0,0,117,25,0,0,0,76,111,97,100,32,97,
-    110,32,101,120,116,101,110,115,105,111,110,32,109,111,100,117,
-    108,101,46,117,33,0,0,0,101,120,116,101,110,115,105,111,
-    110,32,109,111,100,117,108,101,32,108,111,97,100,101,100,32,
-    102,114,111,109,32,123,33,114,125,117,8,0,0,0,95,95,
-    112,97,116,104,95,95,105,0,0,0,0,78,40,11,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,108,111,97,100,95,100,121,110,97,109,105,99,117,4,0,
-    0,0,112,97,116,104,117,16,0,0,0,95,118,101,114,98,
-    111,115,101,95,109,101,115,115,97,103,101,117,10,0,0,0,
-    105,115,95,112,97,99,107,97,103,101,117,7,0,0,0,104,
-    97,115,97,116,116,114,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,40,4,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,9,
-    0,0,0,105,115,95,114,101,108,111,97,100,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,100,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,111,97,
-    100,95,109,111,100,117,108,101,99,2,0,0,0,0,0,0,
-    0,2,0,0,0,4,0,0,0,3,0,0,0,115,48,0,
-    0,0,116,0,0,124,0,0,106,1,0,131,1,0,100,1,
-    0,25,137,0,0,116,2,0,135,0,0,102,1,0,100,2,
-    0,100,3,0,134,0,0,116,3,0,68,131,1,0,131,1,
-    0,83,40,4,0,0,0,117,49,0,0,0,82,101,116,117,
-    114,110,32,84,114,117,101,32,105,102,32,116,104,101,32,101,
-    120,116,101,110,115,105,111,110,32,109,111,100,117,108,101,32,
-    105,115,32,97,32,112,97,99,107,97,103,101,46,105,1,0,
-    0,0,99,1,0,0,0,0,0,0,0,2,0,0,0,4,
-    0,0,0,51,0,0,0,115,31,0,0,0,124,0,0,93,
-    21,0,125,1,0,136,0,0,100,0,0,124,1,0,23,107,
-    2,0,86,1,113,3,0,100,1,0,83,40,2,0,0,0,
-    117,8,0,0,0,95,95,105,110,105,116,95,95,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,
-    9,0,0,0,102,105,108,101,95,110,97,109,101,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,121,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,101,120,
-    112,114,62,40,4,0,0,0,117,11,0,0,0,95,112,97,
-    116,104,95,115,112,108,105,116,117,4,0,0,0,112,97,116,
-    104,117,3,0,0,0,97,110,121,117,18,0,0,0,69,88,
-    84,69,78,83,73,79,78,95,83,85,70,70,73,88,69,83,
-    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,1,0,0,0,117,9,0,0,0,102,105,108,101,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,118,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,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,63,0,0,0,82,101,
-    116,117,114,110,32,78,111,110,101,32,97,115,32,97,110,32,
-    101,120,116,101,110,115,105,111,110,32,109,111,100,117,108,101,
-    32,99,97,110,110,111,116,32,99,114,101,97,116,101,32,97,
-    32,99,111,100,101,32,111,98,106,101,99,116,46,78,40,1,
-    0,0,0,117,4,0,0,0,78,111,110,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,8,0,0,0,103,101,116,95,99,111,100,101,
-    124,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,0,0,
-    0,115,4,0,0,0,100,1,0,83,40,2,0,0,0,117,
-    53,0,0,0,82,101,116,117,114,110,32,78,111,110,101,32,
+    0,0,67,0,0,0,115,4,0,0,0,100,1,0,83,41,
+    2,122,39,82,101,116,117,114,110,32,78,111,110,101,32,97,
+    115,32,116,104,101,114,101,32,105,115,32,110,111,32,115,111,
+    117,114,99,101,32,99,111,100,101,46,78,114,4,0,0,0,
+    41,2,114,71,0,0,0,114,159,0,0,0,114,4,0,0,
+    0,114,4,0,0,0,114,5,0,0,0,114,17,1,0,0,
+    144,6,0,0,115,2,0,0,0,0,2,122,31,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,41,6,114,
+    57,0,0,0,114,56,0,0,0,114,58,0,0,0,114,59,
+    0,0,0,114,16,1,0,0,114,17,1,0,0,114,4,0,
+    0,0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,
+    0,114,8,1,0,0,134,6,0,0,115,6,0,0,0,12,
+    2,6,2,12,6,114,8,1,0,0,99,0,0,0,0,0,
+    0,0,0,0,0,0,0,3,0,0,0,64,0,0,0,115,
+    130,0,0,0,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,132,0,0,90,6,0,101,7,0,100,8,0,
+    100,9,0,132,0,0,131,1,0,90,8,0,100,10,0,100,
+    11,0,132,0,0,90,9,0,100,12,0,100,13,0,132,0,
+    0,90,10,0,100,14,0,100,15,0,132,0,0,90,11,0,
+    101,7,0,100,16,0,100,17,0,132,0,0,131,1,0,90,
+    12,0,100,18,0,83,41,19,218,19,69,120,116,101,110,115,
+    105,111,110,70,105,108,101,76,111,97,100,101,114,122,93,76,
+    111,97,100,101,114,32,102,111,114,32,101,120,116,101,110,115,
+    105,111,110,32,109,111,100,117,108,101,115,46,10,10,32,32,
+    32,32,84,104,101,32,99,111,110,115,116,114,117,99,116,111,
+    114,32,105,115,32,100,101,115,105,103,110,101,100,32,116,111,
+    32,119,111,114,107,32,119,105,116,104,32,70,105,108,101,70,
+    105,110,100,101,114,46,10,10,32,32,32,32,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,0,0,83,41,1,78,41,
+    2,114,67,0,0,0,114,35,0,0,0,41,3,114,71,0,
+    0,0,114,67,0,0,0,114,35,0,0,0,114,4,0,0,
+    0,114,4,0,0,0,114,5,0,0,0,114,72,0,0,0,
+    161,6,0,0,115,4,0,0,0,0,1,9,1,122,28,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,0,0,2,0,0,0,2,0,0,0,67,0,0,0,
+    115,34,0,0,0,124,0,0,106,0,0,124,1,0,106,0,
+    0,107,2,0,111,33,0,124,0,0,106,1,0,124,1,0,
+    106,1,0,107,2,0,83,41,1,78,41,2,114,225,0,0,
+    0,114,63,0,0,0,41,2,114,71,0,0,0,114,228,0,
+    0,0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,
+    0,114,230,0,0,0,165,6,0,0,115,4,0,0,0,0,
+    1,18,1,122,26,69,120,116,101,110,115,105,111,110,70,105,
+    108,101,76,111,97,100,101,114,46,95,95,101,113,95,95,99,
+    1,0,0,0,0,0,0,0,1,0,0,0,3,0,0,0,
+    67,0,0,0,115,26,0,0,0,116,0,0,124,0,0,106,
+    1,0,131,1,0,116,0,0,124,0,0,106,2,0,131,1,
+    0,65,83,41,1,78,41,3,114,50,1,0,0,114,67,0,
+    0,0,114,35,0,0,0,41,1,114,71,0,0,0,114,4,
+    0,0,0,114,4,0,0,0,114,5,0,0,0,114,51,1,
+    0,0,169,6,0,0,115,2,0,0,0,0,1,122,28,69,
+    120,116,101,110,115,105,111,110,70,105,108,101,76,111,97,100,
+    101,114,46,95,95,104,97,115,104,95,95,99,2,0,0,0,
+    0,0,0,0,4,0,0,0,11,0,0,0,67,0,0,0,
+    115,183,0,0,0,116,0,0,124,1,0,131,1,0,143,29,
+    0,1,116,1,0,116,2,0,106,3,0,124,1,0,124,0,
+    0,106,4,0,131,3,0,125,2,0,87,100,1,0,81,88,
+    116,5,0,100,2,0,124,0,0,106,4,0,131,2,0,1,
+    124,0,0,106,6,0,124,1,0,131,1,0,125,3,0,124,
+    3,0,114,124,0,116,7,0,124,2,0,100,3,0,131,2,
+    0,12,114,124,0,116,8,0,124,0,0,106,4,0,131,1,
+    0,100,4,0,25,103,1,0,124,2,0,95,9,0,110,0,
+    0,124,0,0,124,2,0,95,10,0,124,2,0,106,11,0,
+    124,2,0,95,12,0,124,3,0,115,179,0,124,2,0,106,
+    12,0,106,13,0,100,5,0,131,1,0,100,4,0,25,124,
+    2,0,95,12,0,110,0,0,124,2,0,83,41,6,122,25,
+    76,111,97,100,32,97,110,32,101,120,116,101,110,115,105,111,
+    110,32,109,111,100,117,108,101,46,78,122,33,101,120,116,101,
+    110,115,105,111,110,32,109,111,100,117,108,101,32,108,111,97,
+    100,101,100,32,102,114,111,109,32,123,33,114,125,114,247,0,
+    0,0,114,84,0,0,0,114,116,0,0,0,41,14,114,69,
+    0,0,0,114,114,0,0,0,114,106,0,0,0,90,12,108,
+    111,97,100,95,100,121,110,97,109,105,99,114,35,0,0,0,
+    114,153,0,0,0,114,220,0,0,0,114,60,0,0,0,114,
+    38,0,0,0,114,247,0,0,0,114,205,0,0,0,114,57,
+    0,0,0,114,251,0,0,0,114,32,0,0,0,41,4,114,
+    71,0,0,0,114,159,0,0,0,114,180,0,0,0,114,220,
+    0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0,
+    0,0,114,5,1,0,0,172,6,0,0,115,24,0,0,0,
+    0,5,13,1,9,1,21,1,16,1,15,1,22,1,28,1,
+    9,1,12,1,6,1,28,1,122,31,69,120,116,101,110,115,
+    105,111,110,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,4,0,0,0,3,0,0,0,115,48,
+    0,0,0,116,0,0,124,0,0,106,1,0,131,1,0,100,
+    1,0,25,137,0,0,116,2,0,135,0,0,102,1,0,100,
+    2,0,100,3,0,134,0,0,116,3,0,68,131,1,0,131,
+    1,0,83,41,4,122,49,82,101,116,117,114,110,32,84,114,
+    117,101,32,105,102,32,116,104,101,32,101,120,116,101,110,115,
+    105,111,110,32,109,111,100,117,108,101,32,105,115,32,97,32,
+    112,97,99,107,97,103,101,46,114,29,0,0,0,99,1,0,
+    0,0,0,0,0,0,2,0,0,0,4,0,0,0,51,0,
+    0,0,115,31,0,0,0,124,0,0,93,21,0,125,1,0,
+    136,0,0,100,0,0,124,1,0,23,107,2,0,86,1,113,
+    3,0,100,1,0,83,41,2,114,72,0,0,0,78,114,4,
+    0,0,0,41,2,114,22,0,0,0,218,6,115,117,102,102,
+    105,120,41,1,218,9,102,105,108,101,95,110,97,109,101,114,
+    4,0,0,0,114,5,0,0,0,114,77,0,0,0,193,6,
+    0,0,115,2,0,0,0,6,1,122,49,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,101,120,112,114,62,41,4,114,38,
+    0,0,0,114,35,0,0,0,114,78,0,0,0,218,18,69,
+    88,84,69,78,83,73,79,78,95,83,85,70,70,73,88,69,
+    83,41,2,114,71,0,0,0,114,159,0,0,0,114,4,0,
+    0,0,41,1,114,59,1,0,0,114,5,0,0,0,114,220,
+    0,0,0,190,6,0,0,115,6,0,0,0,0,2,19,1,
+    18,1,122,30,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,0,2,0,0,0,1,
+    0,0,0,67,0,0,0,115,4,0,0,0,100,1,0,83,
+    41,2,122,63,82,101,116,117,114,110,32,78,111,110,101,32,
+    97,115,32,97,110,32,101,120,116,101,110,115,105,111,110,32,
+    109,111,100,117,108,101,32,99,97,110,110,111,116,32,99,114,
+    101,97,116,101,32,97,32,99,111,100,101,32,111,98,106,101,
+    99,116,46,78,114,4,0,0,0,41,2,114,71,0,0,0,
+    114,159,0,0,0,114,4,0,0,0,114,4,0,0,0,114,
+    5,0,0,0,114,16,1,0,0,196,6,0,0,115,2,0,
+    0,0,0,2,122,28,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,0,0,0,115,4,0,0,0,100,1,0,83,
+    41,2,122,53,82,101,116,117,114,110,32,78,111,110,101,32,
     97,115,32,101,120,116,101,110,115,105,111,110,32,109,111,100,
     117,108,101,115,32,104,97,118,101,32,110,111,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,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,103,101,116,95,115,111,117,114,99,101,128,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,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,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,11,0,0,0,108,111,97,100,
-    95,109,111,100,117,108,101,117,10,0,0,0,105,115,95,112,
-    97,99,107,97,103,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,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,19,0,0,0,69,120,116,101,110,115,105,111,110,
-    70,105,108,101,76,111,97,100,101,114,88,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,0,0,
-    0,0,0,0,1,0,0,0,2,0,0,0,66,0,0,0,
-    115,134,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,132,0,0,90,6,0,100,
-    8,0,100,9,0,132,0,0,90,7,0,100,10,0,100,11,
-    0,132,0,0,90,8,0,100,12,0,100,13,0,132,0,0,
-    90,9,0,100,14,0,100,15,0,132,0,0,90,10,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,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,100,117,
-    108,101,32,110,97,109,101,10,32,32,32,32,116,111,32,102,
-    105,110,100,32,105,116,115,32,112,97,114,101,110,116,32,109,
-    111,100,117,108,101,44,32,97,110,100,32,102,114,111,109,32,
-    116,104,101,114,101,32,105,116,32,108,111,111,107,115,32,117,
-    112,32,116,104,101,32,112,97,114,101,110,116,39,115,10,32,
-    32,32,32,95,95,112,97,116,104,95,95,46,32,32,87,104,
-    101,110,32,116,104,105,115,32,99,104,97,110,103,101,115,44,
-    32,116,104,101,32,109,111,100,117,108,101,39,115,32,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,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,140,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,146,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,156,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,160,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,172,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,175,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,8,0,0,0,95,95,114,101,112,114,
-    95,95,178,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,181,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,
+    114,99,101,32,99,111,100,101,46,78,114,4,0,0,0,41,
+    2,114,71,0,0,0,114,159,0,0,0,114,4,0,0,0,
+    114,4,0,0,0,114,5,0,0,0,114,17,1,0,0,200,
+    6,0,0,115,2,0,0,0,0,2,122,30,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,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,41,1,122,58,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,41,1,114,35,0,0,0,
+    41,2,114,71,0,0,0,114,159,0,0,0,114,4,0,0,
+    0,114,4,0,0,0,114,5,0,0,0,114,239,0,0,0,
+    204,6,0,0,115,2,0,0,0,0,3,122,32,69,120,116,
+    101,110,115,105,111,110,70,105,108,101,76,111,97,100,101,114,
+    46,103,101,116,95,102,105,108,101,110,97,109,101,78,41,13,
+    114,57,0,0,0,114,56,0,0,0,114,58,0,0,0,114,
+    59,0,0,0,114,72,0,0,0,114,230,0,0,0,114,51,
+    1,0,0,114,157,0,0,0,114,5,1,0,0,114,220,0,
+    0,0,114,16,1,0,0,114,17,1,0,0,114,239,0,0,
+    0,114,4,0,0,0,114,4,0,0,0,114,4,0,0,0,
+    114,5,0,0,0,114,57,1,0,0,153,6,0,0,115,18,
+    0,0,0,12,6,6,2,12,4,12,4,12,3,18,18,12,
+    6,12,4,12,4,114,57,1,0,0,99,0,0,0,0,0,
+    0,0,0,0,0,0,0,2,0,0,0,64,0,0,0,115,
+    130,0,0,0,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,132,0,0,90,6,0,100,8,0,100,9,0,
+    132,0,0,90,7,0,100,10,0,100,11,0,132,0,0,90,
+    8,0,100,12,0,100,13,0,132,0,0,90,9,0,100,14,
+    0,100,15,0,132,0,0,90,10,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,41,21,218,14,95,78,97,109,101,115,
+    112,97,99,101,80,97,116,104,97,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,100,117,108,101,32,110,97,109,101,10,32,32,32,
+    32,116,111,32,102,105,110,100,32,105,116,115,32,112,97,114,
+    101,110,116,32,109,111,100,117,108,101,44,32,97,110,100,32,
+    102,114,111,109,32,116,104,101,114,101,32,105,116,32,108,111,
+    111,107,115,32,117,112,32,116,104,101,32,112,97,114,101,110,
+    116,39,115,10,32,32,32,32,95,95,112,97,116,104,95,95,
+    46,32,32,87,104,101,110,32,116,104,105,115,32,99,104,97,
+    110,103,101,115,44,32,116,104,101,32,109,111,100,117,108,101,
+    39,115,32,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,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,41,1,78,41,6,114,70,0,0,0,114,254,0,0,0,
+    114,232,0,0,0,218,16,95,103,101,116,95,112,97,114,101,
+    110,116,95,112,97,116,104,218,17,95,108,97,115,116,95,112,
+    97,114,101,110,116,95,112,97,116,104,218,12,95,112,97,116,
+    104,95,102,105,110,100,101,114,41,4,114,71,0,0,0,114,
+    67,0,0,0,114,35,0,0,0,218,11,112,97,116,104,95,
+    102,105,110,100,101,114,114,4,0,0,0,114,4,0,0,0,
+    114,5,0,0,0,114,72,0,0,0,217,6,0,0,115,8,
+    0,0,0,0,1,9,1,9,1,21,1,122,23,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,41,7,122,62,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,114,116,0,0,0,114,30,0,0,0,114,
+    7,0,0,0,114,35,0,0,0,114,247,0,0,0,41,2,
+    122,3,115,121,115,122,4,112,97,116,104,41,2,114,70,0,
+    0,0,114,32,0,0,0,41,4,114,71,0,0,0,114,234,
+    0,0,0,218,3,100,111,116,114,94,0,0,0,114,4,0,
+    0,0,114,4,0,0,0,114,5,0,0,0,218,23,95,102,
+    105,110,100,95,112,97,114,101,110,116,95,112,97,116,104,95,
+    110,97,109,101,115,223,6,0,0,115,8,0,0,0,0,2,
+    27,1,12,2,4,3,122,38,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,41,1,
+    78,41,4,114,67,1,0,0,114,62,0,0,0,114,7,0,
+    0,0,114,73,0,0,0,41,3,114,71,0,0,0,90,18,
+    112,97,114,101,110,116,95,109,111,100,117,108,101,95,110,97,
+    109,101,90,14,112,97,116,104,95,97,116,116,114,95,110,97,
+    109,101,114,4,0,0,0,114,4,0,0,0,114,5,0,0,
+    0,114,62,1,0,0,233,6,0,0,115,4,0,0,0,0,
+    1,18,1,122,31,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,3,0,0,
+    0,3,0,0,0,67,0,0,0,115,127,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,120,0,124,
+    0,0,106,3,0,124,0,0,106,4,0,124,1,0,131,2,
+    0,125,2,0,124,2,0,100,0,0,107,9,0,114,108,0,
+    124,2,0,106,5,0,100,0,0,107,8,0,114,108,0,124,
+    2,0,106,6,0,114,108,0,124,2,0,106,6,0,124,0,
+    0,95,7,0,113,108,0,110,0,0,124,1,0,124,0,0,
+    95,2,0,110,0,0,124,0,0,106,7,0,83,41,1,78,
+    41,8,114,232,0,0,0,114,62,1,0,0,114,63,1,0,
+    0,114,64,1,0,0,114,70,0,0,0,114,170,0,0,0,
+    114,221,0,0,0,114,254,0,0,0,41,3,114,71,0,0,
+    0,90,11,112,97,114,101,110,116,95,112,97,116,104,114,178,
+    0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0,
+    0,0,218,12,95,114,101,99,97,108,99,117,108,97,116,101,
+    237,6,0,0,115,16,0,0,0,0,2,18,1,15,1,21,
+    3,27,1,9,1,18,1,12,1,122,27,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,
+    41,1,78,41,2,218,4,105,116,101,114,114,68,1,0,0,
+    41,1,114,71,0,0,0,114,4,0,0,0,114,4,0,0,
+    0,114,5,0,0,0,218,8,95,95,105,116,101,114,95,95,
+    250,6,0,0,115,2,0,0,0,0,1,122,23,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,41,1,
+    78,41,2,114,31,0,0,0,114,68,1,0,0,41,1,114,
+    71,0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,
+    0,0,0,218,7,95,95,108,101,110,95,95,253,6,0,0,
+    115,2,0,0,0,0,1,122,22,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,41,2,78,122,20,95,78,
+    97,109,101,115,112,97,99,101,80,97,116,104,40,123,33,114,
+    125,41,41,2,114,47,0,0,0,114,254,0,0,0,41,1,
+    114,71,0,0,0,114,4,0,0,0,114,4,0,0,0,114,
+    5,0,0,0,114,101,0,0,0,0,7,0,0,115,2,0,
+    0,0,0,1,122,23,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,41,1,78,41,1,114,68,1,0,
+    0,41,2,114,71,0,0,0,218,4,105,116,101,109,114,4,
+    0,0,0,114,4,0,0,0,114,5,0,0,0,218,12,95,
+    95,99,111,110,116,97,105,110,115,95,95,3,7,0,0,115,
+    2,0,0,0,0,1,122,27,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,41,1,78,41,2,114,254,0,0,0,114,224,0,0,0,
+    41,2,114,71,0,0,0,114,72,1,0,0,114,4,0,0,
+    0,114,4,0,0,0,114,5,0,0,0,114,224,0,0,0,
+    6,7,0,0,115,2,0,0,0,0,1,122,21,95,78,97,
+    109,101,115,112,97,99,101,80,97,116,104,46,97,112,112,101,
+    110,100,78,41,13,114,57,0,0,0,114,56,0,0,0,114,
+    58,0,0,0,114,59,0,0,0,114,72,0,0,0,114,67,
+    1,0,0,114,62,1,0,0,114,68,1,0,0,114,70,1,
+    0,0,114,71,1,0,0,114,101,0,0,0,114,73,1,0,
+    0,114,224,0,0,0,114,4,0,0,0,114,4,0,0,0,
+    114,4,0,0,0,114,5,0,0,0,114,61,1,0,0,210,
+    6,0,0,115,20,0,0,0,12,5,6,2,12,6,12,10,
+    12,4,12,13,12,3,12,3,12,3,12,3,114,61,1,0,
+    0,99,0,0,0,0,0,0,0,0,0,0,0,0,3,0,
+    0,0,64,0,0,0,115,106,0,0,0,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,100,5,0,100,6,0,132,0,0,90,6,
+    0,100,7,0,100,8,0,132,0,0,90,7,0,100,9,0,
+    100,10,0,132,0,0,90,8,0,100,11,0,100,12,0,132,
+    0,0,90,9,0,100,13,0,100,14,0,132,0,0,90,10,
+    0,100,15,0,83,41,16,114,252,0,0,0,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,41,
+    1,78,41,2,114,61,1,0,0,114,254,0,0,0,41,4,
+    114,71,0,0,0,114,67,0,0,0,114,35,0,0,0,114,
+    65,1,0,0,114,4,0,0,0,114,4,0,0,0,114,5,
+    0,0,0,114,72,0,0,0,12,7,0,0,115,2,0,0,
+    0,0,1,122,25,95,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,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,184,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,133,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,189,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,192,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,
+    0,0,0,115,16,0,0,0,100,1,0,106,0,0,124,1,
+    0,106,1,0,131,1,0,83,41,2,122,115,82,101,116,117,
+    114,110,32,114,101,112,114,32,102,111,114,32,116,104,101,32,
+    109,111,100,117,108,101,46,10,10,32,32,32,32,32,32,32,
+    32,84,104,101,32,109,101,116,104,111,100,32,105,115,32,100,
+    101,112,114,101,99,97,116,101,100,46,32,32,84,104,101,32,
+    105,109,112,111,114,116,32,109,97,99,104,105,110,101,114,121,
+    32,100,111,101,115,32,116,104,101,32,106,111,98,32,105,116,
+    115,101,108,102,46,10,10,32,32,32,32,32,32,32,32,122,
+    25,60,109,111,100,117,108,101,32,123,33,114,125,32,40,110,
+    97,109,101,115,112,97,99,101,41,62,41,2,114,47,0,0,
+    0,114,57,0,0,0,41,2,114,12,1,0,0,114,180,0,
+    0,0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,
+    0,114,206,0,0,0,15,7,0,0,115,2,0,0,0,0,
+    7,122,28,95,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,196,4,0,0,
-    115,6,0,0,0,0,3,16,1,12,1,117,27,0,0,0,
+    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,41,2,78,
+    84,114,4,0,0,0,41,2,114,71,0,0,0,114,159,0,
+    0,0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,
+    0,114,220,0,0,0,24,7,0,0,115,2,0,0,0,0,
+    1,122,27,95,78,97,109,101,115,112,97,99,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,0,2,0,0,0,1,0,0,0,67,
+    0,0,0,115,4,0,0,0,100,1,0,83,41,2,78,114,
+    30,0,0,0,114,4,0,0,0,41,2,114,71,0,0,0,
+    114,159,0,0,0,114,4,0,0,0,114,4,0,0,0,114,
+    5,0,0,0,114,17,1,0,0,27,7,0,0,115,2,0,
+    0,0,0,1,122,27,95,78,97,109,101,115,112,97,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,2,0,0,0,6,0,
+    0,0,67,0,0,0,115,22,0,0,0,116,0,0,100,1,
+    0,100,2,0,100,3,0,100,4,0,100,5,0,131,3,1,
+    83,41,6,78,114,30,0,0,0,122,8,60,115,116,114,105,
+    110,103,62,114,176,0,0,0,114,43,1,0,0,84,41,1,
+    114,44,1,0,0,41,2,114,71,0,0,0,114,159,0,0,
+    0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,
+    114,16,1,0,0,30,7,0,0,115,2,0,0,0,0,1,
+    122,25,95,78,97,109,101,115,112,97,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,1,0,0,0,67,0,0,0,
+    115,4,0,0,0,100,0,0,83,41,1,78,114,4,0,0,
+    0,41,2,114,71,0,0,0,114,180,0,0,0,114,4,0,
+    0,0,114,4,0,0,0,114,5,0,0,0,114,2,1,0,
+    0,33,7,0,0,115,2,0,0,0,0,1,122,28,95,78,
+    97,109,101,115,112,97,99,101,76,111,97,100,101,114,46,101,
+    120,101,99,95,109,111,100,117,108,101,99,2,0,0,0,0,
+    0,0,0,2,0,0,0,3,0,0,0,67,0,0,0,115,
+    29,0,0,0,116,0,0,100,1,0,124,0,0,106,1,0,
+    131,2,0,1,116,2,0,124,0,0,124,1,0,131,2,0,
+    83,41,2,122,98,76,111,97,100,32,97,32,110,97,109,101,
+    115,112,97,99,101,32,109,111,100,117,108,101,46,10,10,32,
+    32,32,32,32,32,32,32,84,104,105,115,32,109,101,116,104,
+    111,100,32,105,115,32,100,101,112,114,101,99,97,116,101,100,
+    46,32,32,85,115,101,32,101,120,101,99,95,109,111,100,117,
+    108,101,40,41,32,105,110,115,116,101,97,100,46,10,10,32,
+    32,32,32,32,32,32,32,122,38,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,41,
+    3,114,153,0,0,0,114,254,0,0,0,114,181,0,0,0,
+    41,2,114,71,0,0,0,114,159,0,0,0,114,4,0,0,
+    0,114,4,0,0,0,114,5,0,0,0,114,5,1,0,0,
+    36,7,0,0,115,4,0,0,0,0,7,16,1,122,28,95,
     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,188,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,210,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,218,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,235,
-    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,
+    108,111,97,100,95,109,111,100,117,108,101,78,41,11,114,57,
+    0,0,0,114,56,0,0,0,114,58,0,0,0,114,72,0,
+    0,0,114,19,1,0,0,114,206,0,0,0,114,220,0,0,
+    0,114,17,1,0,0,114,16,1,0,0,114,2,1,0,0,
+    114,5,1,0,0,114,4,0,0,0,114,4,0,0,0,114,
+    4,0,0,0,114,5,0,0,0,114,252,0,0,0,11,7,
+    0,0,115,14,0,0,0,12,1,12,3,18,9,12,3,12,
+    3,12,3,12,3,114,252,0,0,0,99,0,0,0,0,0,
+    0,0,0,0,0,0,0,5,0,0,0,64,0,0,0,115,
+    160,0,0,0,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,10,0,100,11,0,100,12,0,132,1,0,131,1,0,
+    90,9,0,101,4,0,100,10,0,100,10,0,100,13,0,100,
+    14,0,132,2,0,131,1,0,90,10,0,101,4,0,100,10,
+    0,100,15,0,100,16,0,132,1,0,131,1,0,90,11,0,
+    100,10,0,83,41,17,218,10,80,97,116,104,70,105,110,100,
+    101,114,122,62,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,41,3,122,125,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,218,17,105,110,118,97,108,105,100,
+    97,116,101,95,99,97,99,104,101,115,78,41,5,114,7,0,
+    0,0,218,19,112,97,116,104,95,105,109,112,111,114,116,101,
+    114,95,99,97,99,104,101,218,6,118,97,108,117,101,115,114,
+    60,0,0,0,114,75,1,0,0,41,2,114,12,1,0,0,
+    218,6,102,105,110,100,101,114,114,4,0,0,0,114,4,0,
+    0,0,114,5,0,0,0,114,75,1,0,0,53,7,0,0,
+    115,6,0,0,0,0,4,22,1,15,1,122,28,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,41,3,122,113,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,122,23,115,121,115,46,112,97,116,104,
+    95,104,111,111,107,115,32,105,115,32,101,109,112,116,121,78,
+    41,6,114,7,0,0,0,218,10,112,97,116,104,95,104,111,
+    111,107,115,114,167,0,0,0,114,168,0,0,0,114,169,0,
+    0,0,114,154,0,0,0,41,3,114,12,1,0,0,114,35,
+    0,0,0,90,4,104,111,111,107,114,4,0,0,0,114,4,
+    0,0,0,114,5,0,0,0,218,11,95,112,97,116,104,95,
+    104,111,111,107,115,61,7,0,0,115,16,0,0,0,0,7,
+    9,1,19,1,16,1,3,1,14,1,13,1,12,2,122,22,
+    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,97,0,0,0,
+    124,1,0,100,1,0,107,2,0,114,27,0,116,0,0,106,
+    1,0,131,0,0,125,1,0,110,0,0,121,17,0,116,2,
+    0,106,3,0,124,1,0,25,125,2,0,87,110,46,0,4,
+    116,4,0,107,10,0,114,92,0,1,1,1,124,0,0,106,
+    5,0,124,1,0,131,1,0,125,2,0,124,2,0,116,2,
+    0,106,3,0,124,1,0,60,89,110,1,0,88,124,2,0,
+    83,41,2,122,210,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,114,30,0,0,0,41,6,114,3,
+    0,0,0,114,45,0,0,0,114,7,0,0,0,114,76,1,
+    0,0,114,79,0,0,0,114,80,1,0,0,41,3,114,12,
+    1,0,0,114,35,0,0,0,114,78,1,0,0,114,4,0,
+    0,0,114,4,0,0,0,114,5,0,0,0,218,20,95,112,
+    97,116,104,95,105,109,112,111,114,116,101,114,95,99,97,99,
+    104,101,78,7,0,0,115,16,0,0,0,0,8,12,1,15,
+    1,3,1,17,1,13,1,15,1,18,1,122,31,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,252,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,23,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,206,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,154,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,50,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,32,97,110,100,32,116,104,101,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,10,32,32,32,32,32,32,32,32,114,101,99,
-    111,103,110,105,122,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,56,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,14,0,0,0,108,111,97,
-    100,101,114,95,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,50,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,64,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,216,1,0,0,100,
-    8,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,9,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,10,0,125,2,0,113,45,1,110,0,0,120,120,0,124,
-    0,0,106,15,0,68,93,109,0,92,2,0,125,8,0,125,
-    9,0,116,13,0,124,0,0,106,4,0,124,3,0,124,8,
-    0,23,131,2,0,125,11,0,116,18,0,100,5,0,106,19,
-    0,124,11,0,131,1,0,100,6,0,100,2,0,131,1,1,
-    1,124,6,0,124,8,0,23,124,5,0,107,6,0,114,55,
-    1,116,16,0,124,11,0,131,1,0,114,164,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,206,1,116,18,0,
-    100,7,0,106,19,0,124,7,0,131,1,0,131,1,0,1,
-    100,11,0,124,7,0,103,1,0,102,2,0,83,100,11,0,
-    103,0,0,102,2,0,83,40,12,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,117,9,0,0,0,
-    116,114,121,105,110,103,32,123,125,117,9,0,0,0,118,101,
-    114,98,111,115,105,116,121,117,25,0,0,0,112,111,115,115,
-    105,98,108,101,32,110,97,109,101,115,112,97,99,101,32,102,
-    111,114,32,123,125,70,105,255,255,255,255,84,78,40,21,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,16,0,0,0,95,118,101,114,98,
-    111,115,101,95,109,101,115,115,97,103,101,117,6,0,0,0,
-    102,111,114,109,97,116,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,
-    70,5,0,0,115,66,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,22,1,25,1,16,
-    1,12,1,26,1,6,1,19,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,143,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,114,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,155,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,
+    0,0,0,0,0,6,0,0,0,3,0,0,0,67,0,0,
+    0,115,113,0,0,0,116,0,0,124,2,0,100,1,0,131,
+    2,0,114,39,0,124,2,0,106,1,0,124,1,0,131,1,
+    0,92,2,0,125,3,0,125,4,0,110,21,0,124,2,0,
+    106,2,0,124,1,0,131,1,0,125,3,0,103,0,0,125,
+    4,0,124,3,0,100,0,0,107,9,0,114,85,0,116,3,
+    0,124,1,0,124,3,0,131,2,0,83,116,4,0,124,1,
+    0,100,0,0,131,2,0,125,5,0,124,4,0,124,5,0,
+    95,5,0,124,5,0,83,41,2,78,114,166,0,0,0,41,
+    6,114,60,0,0,0,114,166,0,0,0,114,15,1,0,0,
+    114,174,0,0,0,114,217,0,0,0,114,221,0,0,0,41,
+    6,114,12,1,0,0,114,159,0,0,0,114,78,1,0,0,
+    114,170,0,0,0,114,171,0,0,0,114,178,0,0,0,114,
+    4,0,0,0,114,4,0,0,0,114,5,0,0,0,218,16,
+    95,108,101,103,97,99,121,95,103,101,116,95,115,112,101,99,
+    95,7,0,0,115,18,0,0,0,0,4,15,1,24,2,15,
+    1,6,1,12,1,13,1,15,1,9,1,122,27,80,97,116,
+    104,70,105,110,100,101,114,46,95,108,101,103,97,99,121,95,
+    103,101,116,95,115,112,101,99,78,99,4,0,0,0,0,0,
+    0,0,9,0,0,0,5,0,0,0,67,0,0,0,115,252,
+    0,0,0,103,0,0,125,4,0,120,239,0,124,2,0,68,
+    93,203,0,125,5,0,116,0,0,124,5,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,5,0,131,1,0,125,6,0,
+    124,6,0,100,1,0,107,9,0,114,13,0,116,4,0,124,
+    6,0,100,2,0,131,2,0,114,109,0,124,6,0,106,5,
+    0,124,1,0,124,3,0,131,2,0,125,7,0,110,18,0,
+    124,0,0,106,6,0,124,1,0,124,6,0,131,2,0,125,
+    7,0,124,7,0,100,1,0,107,8,0,114,145,0,113,13,
+    0,110,0,0,124,7,0,106,7,0,100,1,0,107,9,0,
+    114,164,0,124,7,0,83,124,7,0,106,8,0,125,8,0,
+    124,8,0,100,1,0,107,8,0,114,200,0,116,9,0,100,
+    3,0,131,1,0,130,1,0,110,0,0,124,4,0,106,10,
+    0,124,8,0,131,1,0,1,113,13,0,113,13,0,87,116,
+    11,0,124,1,0,100,1,0,131,2,0,125,7,0,124,4,
+    0,124,7,0,95,8,0,124,7,0,83,100,1,0,83,41,
+    4,122,63,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,78,114,14,1,0,0,122,19,115,112,101,99,32,109,
+    105,115,115,105,110,103,32,108,111,97,100,101,114,41,12,114,
+    193,0,0,0,218,3,115,116,114,218,5,98,121,116,101,115,
+    114,81,1,0,0,114,60,0,0,0,114,14,1,0,0,114,
+    82,1,0,0,114,170,0,0,0,114,221,0,0,0,114,154,
+    0,0,0,114,198,0,0,0,114,217,0,0,0,41,9,114,
+    12,1,0,0,114,159,0,0,0,114,35,0,0,0,114,13,
+    1,0,0,218,14,110,97,109,101,115,112,97,99,101,95,112,
+    97,116,104,90,5,101,110,116,114,121,114,78,1,0,0,114,
+    178,0,0,0,114,171,0,0,0,114,4,0,0,0,114,4,
+    0,0,0,114,5,0,0,0,218,9,95,103,101,116,95,115,
+    112,101,99,110,7,0,0,115,40,0,0,0,0,5,6,1,
+    13,1,21,1,6,1,15,1,12,1,15,1,21,2,18,1,
+    12,1,6,1,15,1,4,1,9,1,12,1,15,5,20,2,
+    15,1,9,1,122,20,80,97,116,104,70,105,110,100,101,114,
+    46,95,103,101,116,95,115,112,101,99,99,4,0,0,0,0,
+    0,0,0,6,0,0,0,4,0,0,0,67,0,0,0,115,
+    143,0,0,0,124,2,0,100,1,0,107,8,0,114,24,0,
+    116,0,0,106,1,0,125,2,0,110,0,0,124,0,0,106,
+    2,0,124,1,0,124,2,0,124,3,0,131,3,0,125,4,
+    0,124,4,0,100,1,0,107,8,0,114,61,0,100,1,0,
+    83,124,4,0,106,3,0,100,1,0,107,8,0,114,135,0,
+    124,4,0,106,4,0,125,5,0,124,5,0,114,128,0,100,
+    2,0,124,4,0,95,5,0,116,6,0,124,1,0,124,5,
+    0,124,0,0,106,2,0,131,3,0,124,4,0,95,4,0,
+    124,4,0,83,100,1,0,83,110,4,0,124,4,0,83,100,
+    1,0,83,41,3,122,98,102,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,90,9,110,97,109,101,
+    115,112,97,99,101,41,7,114,7,0,0,0,114,35,0,0,
+    0,114,86,1,0,0,114,170,0,0,0,114,221,0,0,0,
+    114,218,0,0,0,114,61,1,0,0,41,6,114,12,1,0,
+    0,114,159,0,0,0,114,35,0,0,0,114,13,1,0,0,
+    114,178,0,0,0,114,85,1,0,0,114,4,0,0,0,114,
+    4,0,0,0,114,5,0,0,0,114,14,1,0,0,142,7,
+    0,0,115,26,0,0,0,0,4,12,1,12,1,21,1,12,
+    1,4,1,15,1,9,1,6,3,9,1,24,1,4,2,7,
+    2,122,20,80,97,116,104,70,105,110,100,101,114,46,102,105,
+    110,100,95,115,112,101,99,99,3,0,0,0,0,0,0,0,
+    4,0,0,0,3,0,0,0,67,0,0,0,115,41,0,0,
+    0,124,0,0,106,0,0,124,1,0,124,2,0,131,2,0,
+    125,3,0,124,3,0,100,1,0,107,8,0,114,34,0,100,
+    1,0,83,124,3,0,106,1,0,83,41,2,122,170,102,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,
+    10,10,32,32,32,32,32,32,32,32,84,104,105,115,32,109,
+    101,116,104,111,100,32,105,115,32,100,101,112,114,101,99,97,
+    116,101,100,46,32,32,85,115,101,32,102,105,110,100,95,115,
+    112,101,99,40,41,32,105,110,115,116,101,97,100,46,10,10,
+    32,32,32,32,32,32,32,32,78,41,2,114,14,1,0,0,
+    114,170,0,0,0,41,4,114,12,1,0,0,114,159,0,0,
+    0,114,35,0,0,0,114,178,0,0,0,114,4,0,0,0,
+    114,4,0,0,0,114,5,0,0,0,114,15,1,0,0,164,
+    7,0,0,115,8,0,0,0,0,8,18,1,12,1,4,1,
+    122,22,80,97,116,104,70,105,110,100,101,114,46,102,105,110,
+    100,95,109,111,100,117,108,101,41,12,114,57,0,0,0,114,
+    56,0,0,0,114,58,0,0,0,114,59,0,0,0,114,19,
+    1,0,0,114,75,1,0,0,114,80,1,0,0,114,81,1,
+    0,0,114,82,1,0,0,114,86,1,0,0,114,14,1,0,
+    0,114,15,1,0,0,114,4,0,0,0,114,4,0,0,0,
+    114,4,0,0,0,114,5,0,0,0,114,74,1,0,0,49,
+    7,0,0,115,22,0,0,0,12,2,6,2,18,8,18,17,
+    18,17,18,15,3,1,18,31,3,1,21,21,3,1,114,74,
+    1,0,0,99,0,0,0,0,0,0,0,0,0,0,0,0,
+    3,0,0,0,64,0,0,0,115,133,0,0,0,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,100,10,0,100,11,0,100,12,0,132,1,
+    0,90,10,0,100,13,0,100,14,0,132,0,0,90,11,0,
+    101,12,0,100,15,0,100,16,0,132,0,0,131,1,0,90,
+    13,0,100,17,0,100,18,0,132,0,0,90,14,0,100,10,
+    0,83,41,19,218,10,70,105,108,101,70,105,110,100,101,114,
+    122,172,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,41,7,122,154,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,50,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,32,97,110,100,32,
+    116,104,101,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,10,32,32,32,
+    32,32,32,32,32,114,101,99,111,103,110,105,122,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,41,1,78,114,4,0,0,0,41,2,114,
+    22,0,0,0,114,58,1,0,0,41,1,114,170,0,0,0,
+    114,4,0,0,0,114,5,0,0,0,114,77,0,0,0,193,
+    7,0,0,115,2,0,0,0,6,0,122,38,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,114,116,0,0,0,114,29,0,0,0,78,114,139,0,
+    0,0,41,7,114,198,0,0,0,218,8,95,108,111,97,100,
+    101,114,115,114,35,0,0,0,218,11,95,112,97,116,104,95,
+    109,116,105,109,101,218,3,115,101,116,218,11,95,112,97,116,
+    104,95,99,97,99,104,101,218,19,95,114,101,108,97,120,101,
+    100,95,112,97,116,104,95,99,97,99,104,101,41,5,114,71,
+    0,0,0,114,35,0,0,0,218,14,108,111,97,100,101,114,
+    95,100,101,116,97,105,108,115,90,7,108,111,97,100,101,114,
+    115,114,126,0,0,0,114,4,0,0,0,41,1,114,170,0,
+    0,0,114,5,0,0,0,114,72,0,0,0,187,7,0,0,
+    115,16,0,0,0,0,4,6,1,19,1,36,1,9,2,15,
+    1,9,1,12,1,122,19,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,41,4,122,31,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,114,29,0,0,0,78,114,139,0,0,0,41,
+    1,114,89,1,0,0,41,1,114,71,0,0,0,114,4,0,
+    0,0,114,4,0,0,0,114,5,0,0,0,114,75,1,0,
+    0,201,7,0,0,115,2,0,0,0,0,2,122,28,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,3,0,0,0,2,0,0,0,67,0,0,0,115,
+    59,0,0,0,124,0,0,106,0,0,124,1,0,131,1,0,
+    125,2,0,124,2,0,100,1,0,107,8,0,114,37,0,100,
+    1,0,103,0,0,102,2,0,83,124,2,0,106,1,0,124,
+    2,0,106,2,0,112,55,0,103,0,0,102,2,0,83,41,
+    2,122,197,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,
+    10,10,32,32,32,32,32,32,32,32,84,104,105,115,32,109,
+    101,116,104,111,100,32,105,115,32,100,101,112,114,101,99,97,
+    116,101,100,46,32,32,85,115,101,32,102,105,110,100,95,115,
+    112,101,99,40,41,32,105,110,115,116,101,97,100,46,10,10,
+    32,32,32,32,32,32,32,32,78,41,3,114,14,1,0,0,
+    114,170,0,0,0,114,221,0,0,0,41,3,114,71,0,0,
+    0,114,159,0,0,0,114,178,0,0,0,114,4,0,0,0,
+    114,4,0,0,0,114,5,0,0,0,114,166,0,0,0,207,
+    7,0,0,115,8,0,0,0,0,7,15,1,12,1,10,1,
+    122,22,70,105,108,101,70,105,110,100,101,114,46,102,105,110,
+    100,95,108,111,97,100,101,114,99,6,0,0,0,0,0,0,
+    0,7,0,0,0,7,0,0,0,67,0,0,0,115,40,0,
+    0,0,124,1,0,124,2,0,124,3,0,131,2,0,125,6,
+    0,116,0,0,124,2,0,124,3,0,100,1,0,124,6,0,
+    100,2,0,124,4,0,131,2,2,83,41,3,78,114,170,0,
+    0,0,114,221,0,0,0,41,1,114,240,0,0,0,41,7,
+    114,71,0,0,0,114,244,0,0,0,114,159,0,0,0,114,
+    35,0,0,0,114,229,0,0,0,114,13,1,0,0,114,170,
+    0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0,
+    0,0,114,86,1,0,0,219,7,0,0,115,6,0,0,0,
+    0,1,15,1,18,1,122,20,70,105,108,101,70,105,110,100,
+    101,114,46,95,103,101,116,95,115,112,101,99,78,99,3,0,
+    0,0,0,0,0,0,14,0,0,0,15,0,0,0,67,0,
+    0,0,115,240,1,0,0,100,1,0,125,3,0,124,1,0,
+    106,0,0,100,2,0,131,1,0,100,3,0,25,125,4,0,
+    121,34,0,116,1,0,124,0,0,106,2,0,112,49,0,116,
+    3,0,106,4,0,131,0,0,131,1,0,106,5,0,125,5,
+    0,87,110,24,0,4,116,6,0,107,10,0,114,85,0,1,
+    1,1,100,10,0,125,5,0,89,110,1,0,88,124,5,0,
+    124,0,0,106,7,0,107,3,0,114,123,0,124,0,0,106,
+    8,0,131,0,0,1,124,5,0,124,0,0,95,7,0,110,
+    0,0,116,9,0,131,0,0,114,156,0,124,0,0,106,10,
+    0,125,6,0,124,4,0,106,11,0,131,0,0,125,7,0,
+    110,15,0,124,0,0,106,12,0,125,6,0,124,4,0,125,
+    7,0,124,7,0,124,6,0,107,6,0,114,51,1,116,13,
+    0,124,0,0,106,2,0,124,4,0,131,2,0,125,8,0,
+    120,103,0,124,0,0,106,14,0,68,93,77,0,92,2,0,
+    125,9,0,125,10,0,100,5,0,124,9,0,23,125,11,0,
+    116,13,0,124,8,0,124,11,0,131,2,0,125,12,0,116,
+    15,0,124,12,0,131,1,0,114,211,0,124,0,0,106,16,
+    0,124,10,0,124,1,0,124,12,0,124,8,0,103,1,0,
+    124,2,0,131,5,0,83,113,211,0,87,116,17,0,124,8,
+    0,131,1,0,125,3,0,110,0,0,120,126,0,124,0,0,
+    106,14,0,68,93,115,0,92,2,0,125,9,0,125,10,0,
+    116,13,0,124,0,0,106,2,0,124,4,0,124,9,0,23,
+    131,2,0,125,12,0,116,18,0,100,6,0,106,19,0,124,
+    12,0,131,1,0,100,7,0,100,3,0,131,1,1,1,124,
+    7,0,124,9,0,23,124,6,0,107,6,0,114,61,1,116,
+    15,0,124,12,0,131,1,0,114,176,1,124,0,0,106,16,
+    0,124,10,0,124,1,0,124,12,0,100,8,0,124,2,0,
+    131,5,0,83,113,61,1,113,61,1,87,124,3,0,114,236,
+    1,116,18,0,100,9,0,106,19,0,124,8,0,131,1,0,
+    131,1,0,1,116,20,0,124,1,0,100,8,0,131,2,0,
+    125,13,0,124,8,0,103,1,0,124,13,0,95,21,0,124,
+    13,0,83,100,8,0,83,41,11,122,125,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,70,114,116,0,0,0,114,115,
+    0,0,0,114,29,0,0,0,114,72,0,0,0,122,9,116,
+    114,121,105,110,103,32,123,125,114,146,0,0,0,78,122,25,
+    112,111,115,115,105,98,108,101,32,110,97,109,101,115,112,97,
+    99,101,32,102,111,114,32,123,125,114,139,0,0,0,41,22,
+    114,32,0,0,0,114,39,0,0,0,114,35,0,0,0,114,
+    3,0,0,0,114,45,0,0,0,114,54,1,0,0,114,40,
+    0,0,0,114,89,1,0,0,218,11,95,102,105,108,108,95,
+    99,97,99,104,101,114,6,0,0,0,114,92,1,0,0,114,
+    140,0,0,0,114,91,1,0,0,114,28,0,0,0,114,88,
+    1,0,0,114,44,0,0,0,114,86,1,0,0,114,46,0,
+    0,0,114,153,0,0,0,114,47,0,0,0,114,217,0,0,
+    0,114,221,0,0,0,41,14,114,71,0,0,0,114,159,0,
+    0,0,114,13,1,0,0,90,12,105,115,95,110,97,109,101,
+    115,112,97,99,101,90,11,116,97,105,108,95,109,111,100,117,
+    108,101,114,184,0,0,0,90,5,99,97,99,104,101,90,12,
+    99,97,99,104,101,95,109,111,100,117,108,101,90,9,98,97,
+    115,101,95,112,97,116,104,114,58,1,0,0,114,244,0,0,
+    0,90,13,105,110,105,116,95,102,105,108,101,110,97,109,101,
+    90,9,102,117,108,108,95,112,97,116,104,114,178,0,0,0,
+    114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,114,
+    14,1,0,0,224,7,0,0,115,68,0,0,0,0,3,6,
+    1,19,1,3,1,34,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,22,
+    1,10,1,15,1,12,1,32,4,15,2,22,1,22,1,25,
+    1,16,1,12,1,32,1,6,1,19,1,15,1,12,1,4,
+    1,122,20,70,105,108,101,70,105,110,100,101,114,46,102,105,
+    110,100,95,115,112,101,99,99,1,0,0,0,0,0,0,0,
+    9,0,0,0,13,0,0,0,67,0,0,0,115,14,1,0,
+    0,124,0,0,106,0,0,125,1,0,121,31,0,116,1,0,
+    106,2,0,124,1,0,112,33,0,116,1,0,106,3,0,131,
+    0,0,131,1,0,125,2,0,87,110,33,0,4,116,4,0,
+    116,5,0,116,6,0,102,3,0,107,10,0,114,75,0,1,
+    1,1,103,0,0,125,2,0,89,110,1,0,88,116,7,0,
+    106,8,0,106,9,0,100,1,0,131,1,0,115,112,0,116,
+    10,0,124,2,0,131,1,0,124,0,0,95,11,0,110,111,
+    0,116,10,0,131,0,0,125,3,0,120,90,0,124,2,0,
+    68,93,82,0,125,4,0,124,4,0,106,12,0,100,2,0,
+    131,1,0,92,3,0,125,5,0,125,6,0,125,7,0,124,
+    6,0,114,191,0,100,3,0,106,13,0,124,5,0,124,7,
+    0,106,14,0,131,0,0,131,2,0,125,8,0,110,6,0,
+    124,5,0,125,8,0,124,3,0,106,15,0,124,8,0,131,
+    1,0,1,113,128,0,87,124,3,0,124,0,0,95,11,0,
+    116,7,0,106,8,0,106,9,0,116,16,0,131,1,0,114,
+    10,1,100,4,0,100,5,0,132,0,0,124,2,0,68,131,
+    1,0,124,0,0,95,17,0,110,0,0,100,6,0,83,41,
+    7,122,68,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,114,0,0,0,0,114,116,0,0,
+    0,122,5,123,125,46,123,125,99,1,0,0,0,0,0,0,
+    0,2,0,0,0,3,0,0,0,83,0,0,0,115,28,0,
+    0,0,104,0,0,124,0,0,93,18,0,125,1,0,124,1,
+    0,106,0,0,131,0,0,146,2,0,113,6,0,83,114,4,
+    0,0,0,41,1,114,140,0,0,0,41,2,114,22,0,0,
+    0,90,2,102,110,114,4,0,0,0,114,4,0,0,0,114,
+    5,0,0,0,250,9,60,115,101,116,99,111,109,112,62,42,
+    8,0,0,115,2,0,0,0,9,0,122,41,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,115,101,116,
+    99,111,109,112,62,78,41,18,114,35,0,0,0,114,3,0,
+    0,0,90,7,108,105,115,116,100,105,114,114,45,0,0,0,
+    218,17,70,105,108,101,78,111,116,70,111,117,110,100,69,114,
+    114,111,114,218,15,80,101,114,109,105,115,115,105,111,110,69,
+    114,114,111,114,218,18,78,111,116,65,68,105,114,101,99,116,
+    111,114,121,69,114,114,111,114,114,7,0,0,0,114,8,0,
+    0,0,114,9,0,0,0,114,90,1,0,0,114,91,1,0,
+    0,114,134,0,0,0,114,47,0,0,0,114,140,0,0,0,
+    218,3,97,100,100,114,10,0,0,0,114,92,1,0,0,41,
+    9,114,71,0,0,0,114,35,0,0,0,90,8,99,111,110,
+    116,101,110,116,115,90,21,108,111,119,101,114,95,115,117,102,
+    102,105,120,95,99,111,110,116,101,110,116,115,114,72,1,0,
+    0,114,67,0,0,0,114,66,1,0,0,114,58,1,0,0,
+    90,8,110,101,119,95,110,97,109,101,114,4,0,0,0,114,
+    4,0,0,0,114,5,0,0,0,114,94,1,0,0,13,8,
+    0,0,115,34,0,0,0,0,2,9,1,3,1,31,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,122,22,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,41,3,97,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,41,3,122,45,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,122,30,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,114,35,0,0,0,41,2,114,
+    46,0,0,0,114,154,0,0,0,41,1,114,35,0,0,0,
+    41,2,114,12,1,0,0,114,93,1,0,0,114,4,0,0,
+    0,114,5,0,0,0,218,24,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,145,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,163,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,41,5,0,0,115,16,0,0,
-    0,16,7,6,2,12,14,12,4,6,2,12,44,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,9,0,0,0,95,95,101,110,116,101,
-    114,95,95,173,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,177,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,169,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,182,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,191,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,
+    54,8,0,0,115,6,0,0,0,0,2,12,1,21,1,122,
+    54,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,114,4,0,0,0,41,3,114,12,
+    1,0,0,114,93,1,0,0,114,100,1,0,0,114,4,0,
+    0,0,41,2,114,12,1,0,0,114,93,1,0,0,114,5,
+    0,0,0,218,9,112,97,116,104,95,104,111,111,107,44,8,
+    0,0,115,4,0,0,0,0,10,21,6,122,20,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,16,0,0,0,100,1,0,106,0,
+    0,124,0,0,106,1,0,131,1,0,83,41,2,78,122,16,
+    70,105,108,101,70,105,110,100,101,114,40,123,33,114,125,41,
+    41,2,114,47,0,0,0,114,35,0,0,0,41,1,114,71,
+    0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0,
+    0,0,114,101,0,0,0,62,8,0,0,115,2,0,0,0,
+    0,1,122,19,70,105,108,101,70,105,110,100,101,114,46,95,
+    95,114,101,112,114,95,95,41,15,114,57,0,0,0,114,56,
+    0,0,0,114,58,0,0,0,114,59,0,0,0,114,72,0,
+    0,0,114,75,1,0,0,114,173,0,0,0,114,15,1,0,
+    0,114,166,0,0,0,114,86,1,0,0,114,14,1,0,0,
+    114,94,1,0,0,114,19,1,0,0,114,101,1,0,0,114,
+    101,0,0,0,114,4,0,0,0,114,4,0,0,0,114,4,
+    0,0,0,114,5,0,0,0,114,87,1,0,0,178,7,0,
+    0,115,20,0,0,0,12,7,6,2,12,14,12,4,6,2,
+    12,12,12,5,15,45,12,31,18,18,114,87,1,0,0,99,
+    0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,
+    64,0,0,0,115,46,0,0,0,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,41,7,218,18,95,73,109,112,111,
+    114,116,76,111,99,107,67,111,110,116,101,120,116,122,36,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,41,2,122,24,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,41,2,114,106,0,0,0,114,
+    4,1,0,0,41,1,114,71,0,0,0,114,4,0,0,0,
+    114,4,0,0,0,114,5,0,0,0,114,75,0,0,0,72,
+    8,0,0,115,2,0,0,0,0,2,122,28,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,
+    41,2,122,60,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,41,2,114,106,0,0,0,114,107,0,0,0,41,4,114,
+    71,0,0,0,90,8,101,120,99,95,116,121,112,101,90,9,
+    101,120,99,95,118,97,108,117,101,90,13,101,120,99,95,116,
+    114,97,99,101,98,97,99,107,114,4,0,0,0,114,4,0,
+    0,0,114,5,0,0,0,114,81,0,0,0,76,8,0,0,
+    115,2,0,0,0,0,2,122,27,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,41,6,114,57,0,0,0,114,56,0,0,
+    0,114,58,0,0,0,114,59,0,0,0,114,75,0,0,0,
+    114,81,0,0,0,114,4,0,0,0,114,4,0,0,0,114,
+    4,0,0,0,114,5,0,0,0,114,102,1,0,0,68,8,
+    0,0,115,6,0,0,0,12,2,6,2,12,4,114,102,1,
+    0,0,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,41,6,122,50,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,114,116,0,
+    0,0,114,29,0,0,0,122,50,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,114,84,0,0,0,
+    122,5,123,125,46,123,125,41,4,114,34,0,0,0,114,31,
+    0,0,0,114,133,0,0,0,114,47,0,0,0,41,5,114,
+    67,0,0,0,218,7,112,97,99,107,97,103,101,218,5,108,
+    101,118,101,108,90,4,98,105,116,115,114,128,0,0,0,114,
+    4,0,0,0,114,4,0,0,0,114,5,0,0,0,218,13,
+    95,114,101,115,111,108,118,101,95,110,97,109,101,81,8,0,
+    0,115,10,0,0,0,0,2,22,1,18,1,15,1,10,1,
+    114,105,1,0,0,99,3,0,0,0,0,0,0,0,4,0,
+    0,0,3,0,0,0,67,0,0,0,115,47,0,0,0,124,
+    0,0,106,0,0,124,1,0,124,2,0,131,2,0,125,3,
+    0,124,3,0,100,0,0,107,8,0,114,34,0,100,0,0,
+    83,116,1,0,124,1,0,124,3,0,131,2,0,83,41,1,
+    78,41,2,114,15,1,0,0,114,174,0,0,0,41,4,114,
+    78,1,0,0,114,67,0,0,0,114,35,0,0,0,114,170,
+    0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0,
+    0,0,218,17,95,102,105,110,100,95,115,112,101,99,95,108,
+    101,103,97,99,121,90,8,0,0,115,8,0,0,0,0,3,
+    18,1,12,1,4,1,114,106,1,0,0,99,3,0,0,0,
+    0,0,0,0,9,0,0,0,26,0,0,0,67,0,0,0,
+    115,34,1,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,124,0,0,116,0,0,106,5,0,107,6,0,125,3,0,
+    120,240,0,116,0,0,106,1,0,68,93,225,0,125,4,0,
+    116,6,0,131,0,0,143,93,0,1,121,13,0,124,4,0,
+    106,7,0,125,5,0,87,110,54,0,4,116,8,0,107,10,
+    0,114,138,0,1,1,1,116,9,0,124,4,0,124,0,0,
+    124,1,0,131,3,0,125,6,0,124,6,0,100,2,0,107,
+    8,0,114,134,0,119,53,0,110,0,0,89,110,19,0,88,
+    124,5,0,124,0,0,124,1,0,124,2,0,131,3,0,125,
+    6,0,87,100,2,0,81,88,124,6,0,100,2,0,107,9,
+    0,114,53,0,124,3,0,12,114,15,1,124,0,0,116,0,
+    0,106,5,0,107,6,0,114,15,1,116,0,0,106,5,0,
+    124,0,0,25,125,7,0,121,13,0,124,7,0,106,10,0,
+    125,8,0,87,110,22,0,4,116,8,0,107,10,0,114,247,
+    0,1,1,1,124,6,0,83,89,113,19,1,88,124,8,0,
+    100,2,0,107,8,0,114,8,1,124,6,0,83,124,8,0,
+    83,113,22,1,124,6,0,83,113,53,0,113,53,0,87,100,
+    2,0,83,100,2,0,83,41,3,122,23,70,105,110,100,32,
+    97,32,109,111,100,117,108,101,39,115,32,108,111,97,100,101,
+    114,46,122,22,115,121,115,46,109,101,116,97,95,112,97,116,
+    104,32,105,115,32,101,109,112,116,121,78,41,11,114,7,0,
+    0,0,218,9,109,101,116,97,95,112,97,116,104,114,167,0,
+    0,0,114,168,0,0,0,114,169,0,0,0,114,73,0,0,
+    0,114,102,1,0,0,114,14,1,0,0,114,210,0,0,0,
+    114,106,1,0,0,114,209,0,0,0,41,9,114,67,0,0,
+    0,114,35,0,0,0,114,13,1,0,0,90,9,105,115,95,
+    114,101,108,111,97,100,114,78,1,0,0,114,14,1,0,0,
+    114,178,0,0,0,114,180,0,0,0,114,209,0,0,0,114,
+    4,0,0,0,114,4,0,0,0,114,5,0,0,0,218,10,
+    95,102,105,110,100,95,115,112,101,99,99,8,0,0,115,48,
+    0,0,0,0,2,9,1,19,4,15,1,16,1,10,1,3,
+    1,13,1,13,1,18,1,12,1,11,2,24,1,12,2,22,
+    1,13,1,3,1,13,1,13,4,9,2,12,1,4,2,7,
+    2,11,2,114,108,1,0,0,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,
@@ -3737,446 +3907,336 @@
     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,208,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,227,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,
+    100,7,0,83,41,8,122,28,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,122,31,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,114,84,0,0,0,122,18,108,101,118,101,
+    108,32,109,117,115,116,32,98,101,32,62,61,32,48,122,31,
+    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,122,
+    61,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,122,17,
+    69,109,112,116,121,32,109,111,100,117,108,101,32,110,97,109,
+    101,78,41,9,114,193,0,0,0,114,83,1,0,0,218,9,
+    84,121,112,101,69,114,114,111,114,114,47,0,0,0,114,66,
+    0,0,0,114,133,0,0,0,114,7,0,0,0,114,73,0,
+    0,0,218,11,83,121,115,116,101,109,69,114,114,111,114,41,
+    4,114,67,0,0,0,114,103,1,0,0,114,104,1,0,0,
+    114,172,0,0,0,114,4,0,0,0,114,4,0,0,0,114,
+    5,0,0,0,218,13,95,115,97,110,105,116,121,95,99,104,
+    101,99,107,139,8,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,114,111,1,0,0,122,16,78,111,32,109,111,
+    100,117,108,101,32,110,97,109,101,100,32,122,4,123,33,114,
+    125,99,2,0,0,0,0,0,0,0,8,0,0,0,12,0,
+    0,0,67,0,0,0,115,52,1,0,0,100,0,0,125,2,
+    0,124,0,0,106,0,0,100,1,0,131,1,0,100,2,0,
+    25,125,3,0,124,3,0,114,178,0,124,3,0,116,1,0,
+    106,2,0,107,7,0,114,62,0,116,3,0,124,1,0,124,
+    3,0,131,2,0,1,110,0,0,124,0,0,116,1,0,106,
+    2,0,107,6,0,114,88,0,116,1,0,106,2,0,124,0,
+    0,25,83,116,1,0,106,2,0,124,3,0,25,125,4,0,
+    121,13,0,124,4,0,106,4,0,125,2,0,87,113,178,0,
+    4,116,5,0,107,10,0,114,174,0,1,1,1,116,6,0,
+    100,3,0,23,106,7,0,124,0,0,124,3,0,131,2,0,
+    125,5,0,116,8,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,9,0,
+    124,0,0,124,2,0,131,2,0,125,6,0,124,6,0,100,
+    0,0,107,8,0,114,235,0,116,8,0,116,6,0,106,7,
+    0,124,0,0,131,1,0,100,4,0,124,0,0,131,1,1,
+    130,1,0,110,18,0,116,10,0,124,6,0,131,1,0,106,
+    11,0,131,0,0,125,7,0,124,3,0,114,48,1,116,1,
+    0,106,2,0,124,3,0,25,125,4,0,116,12,0,124,4,
+    0,124,0,0,106,0,0,100,1,0,131,1,0,100,5,0,
+    25,124,7,0,131,3,0,1,110,0,0,124,7,0,83,41,
+    6,78,114,116,0,0,0,114,84,0,0,0,122,23,59,32,
+    123,33,114,125,32,105,115,32,110,111,116,32,97,32,112,97,
+    99,107,97,103,101,114,67,0,0,0,114,115,0,0,0,41,
+    13,114,32,0,0,0,114,7,0,0,0,114,73,0,0,0,
+    114,114,0,0,0,114,247,0,0,0,114,210,0,0,0,218,
+    8,95,69,82,82,95,77,83,71,114,47,0,0,0,114,154,
+    0,0,0,114,108,1,0,0,114,175,0,0,0,114,7,1,
+    0,0,114,61,0,0,0,41,8,114,67,0,0,0,218,7,
+    105,109,112,111,114,116,95,114,35,0,0,0,114,234,0,0,
+    0,90,13,112,97,114,101,110,116,95,109,111,100,117,108,101,
+    114,172,0,0,0,114,178,0,0,0,114,180,0,0,0,114,
+    4,0,0,0,114,4,0,0,0,114,5,0,0,0,218,23,
     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,21,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,34,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,58,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,92,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,95,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,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,107,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,118,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,
+    110,108,111,99,107,101,100,159,8,0,0,115,42,0,0,0,
+    0,1,6,1,19,1,6,1,15,1,16,2,15,1,11,1,
+    13,1,3,1,13,1,13,1,22,1,26,1,15,1,12,1,
+    30,2,18,1,6,2,13,1,32,1,114,114,1,0,0,99,
+    2,0,0,0,0,0,0,0,2,0,0,0,10,0,0,0,
+    67,0,0,0,115,36,0,0,0,116,0,0,124,0,0,131,
+    1,0,143,18,0,1,116,1,0,124,0,0,124,1,0,131,
+    2,0,83,87,100,1,0,81,88,100,1,0,83,41,2,122,
+    54,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,41,2,114,103,0,0,0,114,
+    114,1,0,0,41,2,114,67,0,0,0,114,113,1,0,0,
+    114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,218,
+    14,95,102,105,110,100,95,97,110,100,95,108,111,97,100,186,
+    8,0,0,115,4,0,0,0,0,2,13,1,114,115,1,0,
+    0,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,2,0,107,8,0,114,158,0,116,2,0,106,8,
+    0,131,0,0,1,100,3,0,106,9,0,124,0,0,131,1,
+    0,125,4,0,116,10,0,124,4,0,100,4,0,124,0,0,
+    131,1,1,130,1,0,110,0,0,116,11,0,124,0,0,131,
+    1,0,1,124,3,0,83,41,5,97,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,
+    114,84,0,0,0,78,122,40,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,
+    114,67,0,0,0,41,12,114,111,1,0,0,114,105,1,0,
+    0,114,106,0,0,0,114,4,1,0,0,114,7,0,0,0,
+    114,73,0,0,0,114,115,1,0,0,218,11,95,103,99,100,
+    95,105,109,112,111,114,116,114,107,0,0,0,114,47,0,0,
+    0,114,154,0,0,0,114,112,0,0,0,41,5,114,67,0,
+    0,0,114,103,1,0,0,114,104,1,0,0,114,180,0,0,
+    0,114,152,0,0,0,114,4,0,0,0,114,4,0,0,0,
+    114,5,0,0,0,114,116,1,0,0,192,8,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,114,
+    116,1,0,0,99,3,0,0,0,0,0,0,0,6,0,0,
+    0,17,0,0,0,67,0,0,0,115,1,1,0,0,116,0,
+    0,124,0,0,100,1,0,131,2,0,114,253,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,161,0,124,1,0,68,93,150,
+    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,246,0,4,116,8,0,
+    107,10,0,114,242,0,1,125,5,0,1,122,53,0,116,9,
+    0,124,5,0,131,1,0,106,10,0,116,11,0,131,1,0,
+    114,221,0,124,5,0,106,12,0,124,4,0,107,2,0,114,
+    221,0,119,96,0,113,221,0,110,0,0,130,0,0,87,89,
+    100,5,0,100,5,0,125,5,0,126,5,0,88,113,246,0,
+    88,113,96,0,113,96,0,87,110,0,0,124,0,0,83,41,
+    6,122,238,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,114,247,0,0,0,250,1,42,218,7,95,95,97,108,108,
+    95,95,122,5,123,125,46,123,125,78,41,13,114,60,0,0,
+    0,114,246,0,0,0,218,6,114,101,109,111,118,101,114,198,
+    0,0,0,114,118,1,0,0,114,47,0,0,0,114,57,0,
+    0,0,114,114,0,0,0,114,154,0,0,0,114,83,1,0,
+    0,114,9,0,0,0,218,15,95,69,82,82,95,77,83,71,
+    95,80,82,69,70,73,88,114,67,0,0,0,41,6,114,180,
+    0,0,0,218,8,102,114,111,109,108,105,115,116,114,113,1,
+    0,0,114,16,0,0,0,90,9,102,114,111,109,95,110,97,
+    109,101,114,41,1,0,0,114,4,0,0,0,114,4,0,0,
+    0,114,5,0,0,0,218,16,95,104,97,110,100,108,101,95,
+    102,114,111,109,108,105,115,116,216,8,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,4,21,1,15,1,9,
+    1,32,1,114,122,1,0,0,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,2,0,107,8,0,114,74,0,124,0,0,
+    100,3,0,25,125,1,0,100,4,0,124,0,0,107,7,0,
+    114,74,0,124,1,0,106,1,0,100,5,0,131,1,0,100,
+    6,0,25,125,1,0,113,74,0,110,0,0,124,1,0,83,
+    41,7,122,167,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,114,251,0,0,0,
+    78,114,57,0,0,0,114,247,0,0,0,114,116,0,0,0,
+    114,84,0,0,0,41,2,114,93,0,0,0,114,32,0,0,
+    0,41,2,218,7,103,108,111,98,97,108,115,114,103,1,0,
+    0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,
+    218,17,95,99,97,108,99,95,95,95,112,97,99,107,97,103,
+    101,95,95,248,8,0,0,115,12,0,0,0,0,7,15,1,
+    12,1,10,1,12,1,25,1,114,124,1,0,0,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,41,1,
+    122,95,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,41,46,10,32,32,32,
+    32,41,7,114,57,1,0,0,114,106,0,0,0,218,18,101,
+    120,116,101,110,115,105,111,110,95,115,117,102,102,105,120,101,
+    115,114,9,1,0,0,114,135,0,0,0,114,8,1,0,0,
+    114,233,0,0,0,41,3,90,10,101,120,116,101,110,115,105,
+    111,110,115,90,6,115,111,117,114,99,101,90,8,98,121,116,
+    101,99,111,100,101,114,4,0,0,0,114,4,0,0,0,114,
+    5,0,0,0,114,241,0,0,0,7,9,0,0,115,8,0,
+    0,0,0,5,18,1,12,1,12,1,114,241,0,0,0,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,2,0,107,9,0,114,45,0,
+    124,1,0,110,3,0,105,0,0,125,6,0,116,1,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,2,0,100,3,0,131,1,0,100,1,0,25,131,
+    1,0,83,124,0,0,115,132,0,124,5,0,83,116,3,0,
+    124,0,0,131,1,0,116,3,0,124,0,0,106,2,0,100,
+    3,0,131,1,0,100,1,0,25,131,1,0,24,125,8,0,
+    116,4,0,106,5,0,124,5,0,106,6,0,100,2,0,116,
+    3,0,124,5,0,106,6,0,131,1,0,124,8,0,24,133,
+    2,0,25,25,83,110,16,0,116,7,0,124,5,0,124,3,
+    0,116,0,0,131,3,0,83,100,2,0,83,41,4,97,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,114,84,0,0,0,78,114,
+    116,0,0,0,41,8,114,116,1,0,0,114,124,1,0,0,
+    114,134,0,0,0,114,31,0,0,0,114,7,0,0,0,114,
+    73,0,0,0,114,57,0,0,0,114,122,1,0,0,41,9,
+    114,67,0,0,0,114,123,1,0,0,218,6,108,111,99,97,
+    108,115,114,121,1,0,0,114,104,1,0,0,114,180,0,0,
+    0,90,8,103,108,111,98,97,108,115,95,114,103,1,0,0,
+    90,7,99,117,116,95,111,102,102,114,4,0,0,0,114,4,
+    0,0,0,114,5,0,0,0,218,10,95,95,105,109,112,111,
+    114,116,95,95,18,9,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,114,127,1,0,0,99,1,0,0,
+    0,0,0,0,0,3,0,0,0,3,0,0,0,67,0,0,
+    0,115,68,0,0,0,116,0,0,106,1,0,124,0,0,131,
+    1,0,125,1,0,124,1,0,100,0,0,107,8,0,114,46,
+    0,116,2,0,100,1,0,124,0,0,23,131,1,0,130,1,
+    0,110,0,0,116,3,0,124,1,0,131,1,0,125,2,0,
+    124,2,0,106,4,0,131,0,0,83,41,2,78,122,25,110,
+    111,32,98,117,105,108,116,45,105,110,32,109,111,100,117,108,
+    101,32,110,97,109,101,100,32,41,5,114,11,1,0,0,114,
+    14,1,0,0,114,154,0,0,0,114,175,0,0,0,114,7,
+    1,0,0,41,3,114,67,0,0,0,114,178,0,0,0,114,
+    179,0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,
+    0,0,0,218,18,95,98,117,105,108,116,105,110,95,102,114,
+    111,109,95,110,97,109,101,53,9,0,0,115,10,0,0,0,
+    0,1,15,1,12,1,19,1,12,1,114,128,1,0,0,99,
+    2,0,0,0,0,0,0,0,19,0,0,0,12,0,0,0,
+    67,0,0,0,115,232,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,
+    116,7,0,116,1,0,131,1,0,125,2,0,120,138,0,116,
+    1,0,106,8,0,106,9,0,131,0,0,68,93,121,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,124,3,0,116,1,0,106,11,0,
+    107,6,0,114,118,0,116,12,0,125,5,0,110,27,0,116,
+    0,0,106,13,0,124,3,0,131,1,0,114,67,0,116,14,
+    0,125,5,0,110,3,0,113,67,0,116,15,0,124,4,0,
+    124,5,0,131,2,0,125,6,0,116,16,0,124,6,0,131,
+    1,0,125,7,0,124,7,0,106,17,0,124,4,0,131,1,
+    0,1,113,67,0,113,67,0,87,116,1,0,106,8,0,116,
+    18,0,25,125,8,0,120,73,0,100,26,0,68,93,65,0,
+    125,9,0,124,9,0,116,1,0,106,8,0,107,7,0,114,
+    248,0,116,19,0,124,9,0,131,1,0,125,10,0,110,13,
+    0,116,1,0,106,8,0,124,9,0,25,125,10,0,116,20,
+    0,124,8,0,124,9,0,124,10,0,131,3,0,1,113,212,
+    0,87,100,5,0,100,6,0,103,1,0,102,2,0,100,7,
+    0,100,8,0,100,6,0,103,2,0,102,2,0,102,2,0,
+    125,11,0,120,146,0,124,11,0,68,93,126,0,92,2,0,
+    125,12,0,125,13,0,116,21,0,100,9,0,100,10,0,132,
+    0,0,124,13,0,68,131,1,0,131,1,0,115,108,1,116,
+    22,0,130,1,0,124,13,0,100,11,0,25,125,14,0,124,
+    12,0,116,1,0,106,8,0,107,6,0,114,150,1,116,1,
+    0,106,8,0,124,12,0,25,125,15,0,80,113,65,1,121,
+    17,0,116,19,0,124,12,0,131,1,0,125,15,0,80,87,
+    113,65,1,4,116,23,0,107,10,0,114,190,1,1,1,1,
+    119,65,1,89,113,65,1,88,113,65,1,87,116,23,0,100,
+    12,0,131,1,0,130,1,0,116,20,0,124,8,0,100,13,
+    0,124,15,0,131,3,0,1,116,20,0,124,8,0,100,14,
+    0,124,14,0,131,3,0,1,116,20,0,124,8,0,100,15,
+    0,100,16,0,106,24,0,124,13,0,131,1,0,131,3,0,
+    1,121,16,0,116,19,0,100,17,0,131,1,0,125,16,0,
+    87,110,24,0,4,116,23,0,107,10,0,114,50,2,1,1,
+    1,100,18,0,125,16,0,89,110,1,0,88,116,20,0,124,
+    8,0,100,17,0,124,16,0,131,3,0,1,116,19,0,100,
+    19,0,131,1,0,125,17,0,116,20,0,124,8,0,100,19,
+    0,124,17,0,131,3,0,1,124,12,0,100,7,0,107,2,
+    0,114,138,2,116,19,0,100,20,0,131,1,0,125,18,0,
+    116,20,0,124,8,0,100,21,0,124,18,0,131,3,0,1,
+    110,0,0,116,20,0,124,8,0,100,22,0,116,25,0,131,
+    0,0,131,3,0,1,116,26,0,106,27,0,116,0,0,106,
+    28,0,131,0,0,131,1,0,1,124,12,0,100,7,0,107,
+    2,0,114,228,2,116,29,0,106,30,0,100,23,0,131,1,
+    0,1,100,24,0,116,26,0,107,6,0,114,228,2,100,25,
+    0,116,31,0,95,32,0,113,228,2,110,0,0,100,18,0,
+    83,41,27,122,250,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,
@@ -4191,103 +4251,60 @@
     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,191,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,154,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,
+    97,115,115,101,100,32,105,110,46,10,10,32,32,32,32,114,
+    49,0,0,0,114,167,0,0,0,218,8,98,117,105,108,116,
+    105,110,115,114,192,0,0,0,90,5,112,111,115,105,120,250,
+    1,47,218,2,110,116,250,1,92,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,41,2,114,29,0,0,0,78,41,1,114,31,
+    0,0,0,41,2,114,22,0,0,0,114,129,0,0,0,114,
+    4,0,0,0,114,4,0,0,0,114,5,0,0,0,114,77,
+    0,0,0,105,9,0,0,115,2,0,0,0,6,0,122,25,
+    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,114,84,0,0,0,122,30,
+    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,114,3,
+    0,0,0,114,25,0,0,0,114,21,0,0,0,114,30,0,
+    0,0,114,85,0,0,0,78,114,111,0,0,0,90,6,119,
+    105,110,114,101,103,114,24,1,0,0,114,6,0,0,0,122,
+    4,46,112,121,119,122,6,95,100,46,112,121,100,84,41,4,
+    122,3,95,105,111,122,9,95,119,97,114,110,105,110,103,115,
+    122,8,98,117,105,108,116,105,110,115,122,7,109,97,114,115,
+    104,97,108,41,33,114,106,0,0,0,114,7,0,0,0,114,
+    117,0,0,0,114,118,0,0,0,114,120,0,0,0,114,233,
+    0,0,0,114,119,0,0,0,114,66,0,0,0,114,73,0,
+    0,0,218,5,105,116,101,109,115,114,193,0,0,0,114,158,
+    0,0,0,114,11,1,0,0,114,163,0,0,0,114,20,1,
+    0,0,114,248,0,0,0,114,175,0,0,0,114,255,0,0,
+    0,114,57,0,0,0,114,128,1,0,0,114,61,0,0,0,
+    218,3,97,108,108,114,100,0,0,0,114,154,0,0,0,114,
+    26,0,0,0,114,11,0,0,0,114,60,1,0,0,114,198,
+    0,0,0,114,125,1,0,0,114,135,0,0,0,114,224,0,
+    0,0,114,23,1,0,0,114,27,1,0,0,41,19,218,10,
+    115,121,115,95,109,111,100,117,108,101,218,11,95,105,109,112,
+    95,109,111,100,117,108,101,90,11,109,111,100,117,108,101,95,
+    116,121,112,101,114,67,0,0,0,114,180,0,0,0,114,170,
+    0,0,0,114,178,0,0,0,114,179,0,0,0,90,11,115,
+    101,108,102,95,109,111,100,117,108,101,90,12,98,117,105,108,
+    116,105,110,95,110,97,109,101,90,14,98,117,105,108,116,105,
+    110,95,109,111,100,117,108,101,90,10,111,115,95,100,101,116,
+    97,105,108,115,90,10,98,117,105,108,116,105,110,95,111,115,
+    114,21,0,0,0,114,25,0,0,0,90,9,111,115,95,109,
+    111,100,117,108,101,90,13,116,104,114,101,97,100,95,109,111,
+    100,117,108,101,90,14,119,101,97,107,114,101,102,95,109,111,
+    100,117,108,101,90,13,119,105,110,114,101,103,95,109,111,100,
+    117,108,101,114,4,0,0,0,114,4,0,0,0,114,5,0,
+    0,0,218,6,95,115,101,116,117,112,61,9,0,0,115,108,
+    0,0,0,0,9,6,1,6,2,12,1,9,2,6,3,12,
+    1,28,1,15,1,15,1,9,1,15,1,9,2,3,1,15,
+    1,12,1,20,3,13,1,13,1,15,1,15,2,13,1,20,
+    3,33,1,19,2,31,1,10,1,15,1,13,1,4,2,3,
+    1,12,1,5,1,13,1,12,2,12,1,16,1,16,1,25,
+    3,3,1,16,1,13,2,11,1,16,3,12,1,16,3,12,
+    1,12,1,19,3,19,1,19,1,12,1,13,1,12,1,114,
+    137,1,0,0,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,
@@ -4297,134 +4314,63 @@
     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,233,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,19,18,8,12,13,12,11,12,55,
-    12,18,12,11,12,11,12,17,19,57,19,54,19,50,19,83,
-    22,134,19,29,25,49,25,25,6,3,19,45,19,55,19,18,
-    19,91,19,128,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,
+    0,1,100,2,0,83,41,3,122,50,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,114,131,1,0,
+    0,78,41,15,114,137,1,0,0,114,241,0,0,0,114,7,
+    0,0,0,114,79,1,0,0,114,198,0,0,0,114,87,1,
+    0,0,114,101,1,0,0,114,107,1,0,0,114,224,0,0,
+    0,114,11,1,0,0,114,20,1,0,0,114,3,0,0,0,
+    114,57,0,0,0,114,23,1,0,0,114,74,1,0,0,41,
+    3,114,135,1,0,0,114,136,1,0,0,90,17,115,117,112,
+    112,111,114,116,101,100,95,108,111,97,100,101,114,115,114,4,
+    0,0,0,114,4,0,0,0,114,5,0,0,0,218,8,95,
+    105,110,115,116,97,108,108,148,9,0,0,115,16,0,0,0,
+    0,2,13,1,9,1,28,1,16,1,16,1,15,1,19,1,
+    114,138,1,0,0,41,3,122,3,119,105,110,114,1,0,0,
+    0,114,2,0,0,0,41,92,114,59,0,0,0,114,10,0,
+    0,0,114,11,0,0,0,114,17,0,0,0,114,19,0,0,
+    0,114,28,0,0,0,114,38,0,0,0,114,39,0,0,0,
+    114,43,0,0,0,114,44,0,0,0,114,46,0,0,0,114,
+    55,0,0,0,114,65,0,0,0,114,68,0,0,0,114,66,
+    0,0,0,218,8,95,95,99,111,100,101,95,95,114,194,0,
+    0,0,114,69,0,0,0,114,109,0,0,0,114,92,0,0,
+    0,114,99,0,0,0,114,82,0,0,0,114,83,0,0,0,
+    114,102,0,0,0,114,103,0,0,0,114,105,0,0,0,114,
+    112,0,0,0,114,114,0,0,0,114,15,0,0,0,114,186,
+    0,0,0,114,14,0,0,0,114,18,0,0,0,90,17,95,
+    82,65,87,95,77,65,71,73,67,95,78,85,77,66,69,82,
+    114,124,0,0,0,114,135,0,0,0,114,119,0,0,0,114,
+    120,0,0,0,114,132,0,0,0,114,136,0,0,0,114,143,
+    0,0,0,114,145,0,0,0,114,153,0,0,0,114,157,0,
+    0,0,114,162,0,0,0,114,165,0,0,0,114,173,0,0,
+    0,114,181,0,0,0,114,191,0,0,0,114,196,0,0,0,
+    114,199,0,0,0,114,204,0,0,0,114,212,0,0,0,114,
+    213,0,0,0,114,217,0,0,0,114,174,0,0,0,218,6,
+    111,98,106,101,99,116,114,242,0,0,0,114,240,0,0,0,
+    114,248,0,0,0,114,175,0,0,0,114,10,1,0,0,114,
+    11,1,0,0,114,20,1,0,0,114,23,1,0,0,114,33,
+    1,0,0,114,34,1,0,0,114,49,1,0,0,114,9,1,
+    0,0,114,8,1,0,0,114,60,1,0,0,114,57,1,0,
+    0,114,61,1,0,0,114,252,0,0,0,114,74,1,0,0,
+    114,87,1,0,0,114,102,1,0,0,114,105,1,0,0,114,
+    106,1,0,0,114,108,1,0,0,114,111,1,0,0,114,120,
+    1,0,0,114,112,1,0,0,114,114,1,0,0,114,115,1,
+    0,0,114,116,1,0,0,114,122,1,0,0,114,124,1,0,
+    0,114,241,0,0,0,114,127,1,0,0,114,128,1,0,0,
+    114,137,1,0,0,114,138,1,0,0,114,4,0,0,0,114,
+    4,0,0,0,114,4,0,0,0,114,5,0,0,0,218,8,
+    60,109,111,100,117,108,101,62,8,0,0,0,115,170,0,0,
+    0,6,17,6,3,12,12,12,5,12,5,12,6,12,12,12,
+    10,12,9,12,5,12,7,15,22,12,8,12,4,15,4,19,
+    20,6,2,6,3,22,4,19,68,19,21,19,19,12,19,12,
+    20,12,114,22,1,18,2,6,2,9,2,9,1,9,2,15,
+    27,12,23,12,19,12,12,18,8,12,18,12,11,12,11,12,
+    17,12,16,21,55,21,12,18,10,12,14,12,36,19,27,19,
+    106,24,22,9,3,12,1,15,63,18,45,19,230,15,25,19,
+    70,19,71,19,63,19,24,22,110,19,41,25,43,25,16,6,
+    3,19,57,19,57,19,38,19,129,19,146,19,13,12,9,12,
+    9,15,40,12,17,6,1,10,2,12,27,12,6,18,24,12,
+    32,12,15,12,11,24,35,12,8,12,87,
 };
diff --git a/Python/marshal.c b/Python/marshal.c
index cc17329..6f0ee5e 100644
--- a/Python/marshal.c
+++ b/Python/marshal.c
@@ -1,8 +1,10 @@
 
 /* Write Python objects to files and read them back.
-   This is intended for writing and reading compiled Python code only;
-   a true persistent storage facility would be much harder, since
-   it would have to take circular links and sharing into account. */
+   This is primarily intended for writing and reading compiled Python code,
+   even though dicts, lists, sets and frozensets, not commonly seen in
+   code objects, are supported.
+   Version 3 of this protocol properly supports circular links
+   and sharing. */
 
 #define PY_SSIZE_T_CLEAN
 
@@ -31,16 +33,14 @@
 #define TYPE_STOPITER           'S'
 #define TYPE_ELLIPSIS           '.'
 #define TYPE_INT                'i'
-/* TYPE_INT64 is deprecated. It is not
-   generated anymore, and support for reading it
-   will be removed in Python 3.4. */
-#define TYPE_INT64              'I'
 #define TYPE_FLOAT              'f'
 #define TYPE_BINARY_FLOAT       'g'
 #define TYPE_COMPLEX            'x'
 #define TYPE_BINARY_COMPLEX     'y'
 #define TYPE_LONG               'l'
 #define TYPE_STRING             's'
+#define TYPE_INTERNED           't'
+#define TYPE_REF                'r'
 #define TYPE_TUPLE              '('
 #define TYPE_LIST               '['
 #define TYPE_DICT               '{'
@@ -49,6 +49,13 @@
 #define TYPE_UNKNOWN            '?'
 #define TYPE_SET                '<'
 #define TYPE_FROZENSET          '>'
+#define FLAG_REF                '\x80' /* with a type, add obj to index */
+
+#define TYPE_ASCII              'a'
+#define TYPE_ASCII_INTERNED     'A'
+#define TYPE_SMALL_TUPLE        ')'
+#define TYPE_SHORT_ASCII        'z'
+#define TYPE_SHORT_ASCII_INTERNED 'Z'
 
 #define WFERR_OK 0
 #define WFERR_UNMARSHALLABLE 1
@@ -65,15 +72,18 @@
     PyObject *current_filename;
     char *ptr;
     char *end;
+    char *buf;
+    Py_ssize_t buf_size;
+    PyObject *refs; /* dict on marshal, list on unmarshal */
     int version;
 } WFILE;
 
 #define w_byte(c, p) if (((p)->fp)) putc((c), (p)->fp); \
                       else if ((p)->ptr != (p)->end) *(p)->ptr++ = (c); \
-                           else w_more(c, p)
+                           else w_more((c), p)
 
 static void
-w_more(int c, WFILE *p)
+w_more(char c, WFILE *p)
 {
     Py_ssize_t size, newsize;
     if (p->str == NULL)
@@ -90,7 +100,7 @@
         p->ptr = PyBytes_AS_STRING((PyBytesObject *)p->str) + size;
         p->end =
             PyBytes_AS_STRING((PyBytesObject *)p->str) + newsize;
-        *p->ptr++ = Py_SAFE_DOWNCAST(c, int, char);
+        *p->ptr++ = c;
     }
 }
 
@@ -146,6 +156,13 @@
         w_string(s, n, p);
 }
 
+static void
+w_short_pstring(const char *s, Py_ssize_t n, WFILE *p)
+{
+    w_byte(Py_SAFE_DOWNCAST(n, Py_ssize_t, unsigned char), p);
+    w_string(s, n, p);
+}
+
 /* We assume that Python ints 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. */
@@ -158,13 +175,17 @@
 #endif
 #define PyLong_MARSHAL_RATIO (PyLong_SHIFT / PyLong_MARSHAL_SHIFT)
 
+#define W_TYPE(t, p) do { \
+    w_byte((t) | flag, (p)); \
+} while(0)
+
 static void
-w_PyLong(const PyLongObject *ob, WFILE *p)
+w_PyLong(const PyLongObject *ob, char flag, WFILE *p)
 {
     Py_ssize_t i, j, n, l;
     digit d;
 
-    w_byte(TYPE_LONG, p);
+    W_TYPE(TYPE_LONG, p);
     if (Py_SIZE(ob) == 0) {
         w_long((long)0, p);
         return;
@@ -201,10 +222,64 @@
     } while (d != 0);
 }
 
+static int
+w_ref(PyObject *v, char *flag, WFILE *p)
+{
+    PyObject *id;
+    PyObject *idx;
+
+    if (p->version < 3 || p->refs == NULL)
+        return 0; /* not writing object references */
+
+    /* if it has only one reference, it definitely isn't shared */
+    if (Py_REFCNT(v) == 1)
+        return 0;
+
+    id = PyLong_FromVoidPtr((void*)v);
+    if (id == NULL)
+        goto err;
+    idx = PyDict_GetItem(p->refs, id);
+    if (idx != NULL) {
+        /* write the reference index to the stream */
+        long w = PyLong_AsLong(idx);
+        Py_DECREF(id);
+        if (w == -1 && PyErr_Occurred()) {
+            goto err;
+        }
+        /* we don't store "long" indices in the dict */
+        assert(0 <= w && w <= 0x7fffffff);
+        w_byte(TYPE_REF, p);
+        w_long(w, p);
+        return 1;
+    } else {
+        int ok;
+        Py_ssize_t s = PyDict_Size(p->refs);
+        /* we don't support long indices */
+        if (s >= 0x7fffffff) {
+            PyErr_SetString(PyExc_ValueError, "too many objects");
+            goto err;
+        }
+        idx = PyLong_FromSsize_t(s);
+        ok = idx && PyDict_SetItem(p->refs, id, idx) == 0;
+        Py_DECREF(id);
+        Py_XDECREF(idx);
+        if (!ok)
+            goto err;
+        *flag |= FLAG_REF;
+        return 0;
+    }
+err:
+    p->error = WFERR_UNMARSHALLABLE;
+    return 1;
+}
+
+static void
+w_complex_object(PyObject *v, char flag, WFILE *p);
+
 static void
 w_object(PyObject *v, WFILE *p)
 {
-    Py_ssize_t i, n;
+    char flag = '\0';
 
     p->depth++;
 
@@ -229,24 +304,35 @@
     else if (v == Py_True) {
         w_byte(TYPE_TRUE, p);
     }
-    else if (PyLong_CheckExact(v)) {
+    else if (!w_ref(v, &flag, p))
+        w_complex_object(v, flag, p);
+
+    p->depth--;
+}
+
+static void
+w_complex_object(PyObject *v, char flag, WFILE *p)
+{
+    Py_ssize_t i, n;
+
+    if (PyLong_CheckExact(v)) {
         long x = PyLong_AsLong(v);
         if ((x == -1)  && PyErr_Occurred()) {
             PyLongObject *ob = (PyLongObject *)v;
             PyErr_Clear();
-            w_PyLong(ob, p);
+            w_PyLong(ob, flag, p);
         }
         else {
 #if SIZEOF_LONG > 4
             long y = Py_ARITHMETIC_RIGHT_SHIFT(long, x, 31);
             if (y && y != -1) {
                 /* Too large for TYPE_INT */
-                w_PyLong((PyLongObject*)v, p);
+                w_PyLong((PyLongObject*)v, flag, p);
             }
             else
 #endif
             {
-                w_byte(TYPE_INT, p);
+                W_TYPE(TYPE_INT, p);
                 w_long(x, p);
             }
         }
@@ -259,7 +345,7 @@
                 p->error = WFERR_UNMARSHALLABLE;
                 return;
             }
-            w_byte(TYPE_BINARY_FLOAT, p);
+            W_TYPE(TYPE_BINARY_FLOAT, p);
             w_string((char*)buf, 8, p);
         }
         else {
@@ -270,7 +356,7 @@
                 return;
             }
             n = strlen(buf);
-            w_byte(TYPE_FLOAT, p);
+            W_TYPE(TYPE_FLOAT, p);
             w_byte((int)n, p);
             w_string(buf, n, p);
             PyMem_Free(buf);
@@ -284,7 +370,7 @@
                 p->error = WFERR_UNMARSHALLABLE;
                 return;
             }
-            w_byte(TYPE_BINARY_COMPLEX, p);
+            W_TYPE(TYPE_BINARY_COMPLEX, p);
             w_string((char*)buf, 8, p);
             if (_PyFloat_Pack8(PyComplex_ImagAsDouble(v),
                                buf, 1) < 0) {
@@ -295,7 +381,7 @@
         }
         else {
             char *buf;
-            w_byte(TYPE_COMPLEX, p);
+            W_TYPE(TYPE_COMPLEX, p);
             buf = PyOS_double_to_string(PyComplex_RealAsDouble(v),
                                         'g', 17, 0, NULL);
             if (!buf) {
@@ -319,31 +405,61 @@
         }
     }
     else if (PyBytes_CheckExact(v)) {
-        w_byte(TYPE_STRING, p);
+        W_TYPE(TYPE_STRING, p);
         w_pstring(PyBytes_AS_STRING(v), PyBytes_GET_SIZE(v), p);
     }
     else if (PyUnicode_CheckExact(v)) {
-        PyObject *utf8;
-        utf8 = PyUnicode_AsEncodedString(v, "utf8", "surrogatepass");
-        if (utf8 == NULL) {
-            p->depth--;
-            p->error = WFERR_UNMARSHALLABLE;
-            return;
+        if (p->version >= 4 && PyUnicode_IS_ASCII(v)) {
+            int is_short = PyUnicode_GET_LENGTH(v) < 256;
+            if (is_short) {
+                if (PyUnicode_CHECK_INTERNED(v))
+                    W_TYPE(TYPE_SHORT_ASCII_INTERNED, p);
+                else
+                    W_TYPE(TYPE_SHORT_ASCII, p);
+                w_short_pstring((char *) PyUnicode_1BYTE_DATA(v),
+                                PyUnicode_GET_LENGTH(v), p);
+            }
+            else {
+                if (PyUnicode_CHECK_INTERNED(v))
+                    W_TYPE(TYPE_ASCII_INTERNED, p);
+                else
+                    W_TYPE(TYPE_ASCII, p);
+                w_pstring((char *) PyUnicode_1BYTE_DATA(v),
+                          PyUnicode_GET_LENGTH(v), p);
+            }
         }
-        w_byte(TYPE_UNICODE, p);
-        w_pstring(PyBytes_AS_STRING(utf8), PyBytes_GET_SIZE(utf8), p);
-        Py_DECREF(utf8);
+        else {
+            PyObject *utf8;
+            utf8 = PyUnicode_AsEncodedString(v, "utf8", "surrogatepass");
+            if (utf8 == NULL) {
+                p->depth--;
+                p->error = WFERR_UNMARSHALLABLE;
+                return;
+            }
+            if (p->version >= 3 &&  PyUnicode_CHECK_INTERNED(v))
+                W_TYPE(TYPE_INTERNED, p);
+            else
+                W_TYPE(TYPE_UNICODE, p);
+            w_pstring(PyBytes_AS_STRING(utf8), PyBytes_GET_SIZE(utf8), p);
+            Py_DECREF(utf8);
+        }
     }
     else if (PyTuple_CheckExact(v)) {
-        w_byte(TYPE_TUPLE, p);
         n = PyTuple_Size(v);
-        W_SIZE(n, p);
+        if (p->version >= 4 && n < 256) {
+            W_TYPE(TYPE_SMALL_TUPLE, p);
+            w_byte((unsigned char)n, p);
+        }
+        else {
+            W_TYPE(TYPE_TUPLE, p);
+            W_SIZE(n, p);
+        }
         for (i = 0; i < n; i++) {
             w_object(PyTuple_GET_ITEM(v, i), p);
         }
     }
     else if (PyList_CheckExact(v)) {
-        w_byte(TYPE_LIST, p);
+        W_TYPE(TYPE_LIST, p);
         n = PyList_GET_SIZE(v);
         W_SIZE(n, p);
         for (i = 0; i < n; i++) {
@@ -353,7 +469,7 @@
     else if (PyDict_CheckExact(v)) {
         Py_ssize_t pos;
         PyObject *key, *value;
-        w_byte(TYPE_DICT, p);
+        W_TYPE(TYPE_DICT, p);
         /* This one is NULL object terminated! */
         pos = 0;
         while (PyDict_Next(v, &pos, &key, &value)) {
@@ -366,9 +482,9 @@
         PyObject *value, *it;
 
         if (PyObject_TypeCheck(v, &PySet_Type))
-            w_byte(TYPE_SET, p);
+            W_TYPE(TYPE_SET, p);
         else
-            w_byte(TYPE_FROZENSET, p);
+            W_TYPE(TYPE_FROZENSET, p);
         n = PyObject_Size(v);
         if (n == -1) {
             p->depth--;
@@ -395,7 +511,7 @@
     }
     else if (PyCode_Check(v)) {
         PyCodeObject *co = (PyCodeObject *)v;
-        w_byte(TYPE_CODE, p);
+        W_TYPE(TYPE_CODE, p);
         w_long(co->co_argcount, p);
         w_long(co->co_kwonlyargcount, p);
         w_long(co->co_nlocals, p);
@@ -413,7 +529,7 @@
         w_object(co->co_lnotab, p);
     }
     else if (PyObject_CheckBuffer(v)) {
-        /* Write unknown buffer-style objects as a string */
+        /* Write unknown bytes-like objects as a byte string */
         Py_buffer view;
         if (PyObject_GetBuffer(v, &view, PyBUF_SIMPLE) != 0) {
             w_byte(TYPE_UNKNOWN, p);
@@ -421,15 +537,14 @@
             p->error = WFERR_UNMARSHALLABLE;
             return;
         }
-        w_byte(TYPE_STRING, p);
+        W_TYPE(TYPE_STRING, p);
         w_pstring(view.buf, view.len, p);
         PyBuffer_Release(&view);
     }
     else {
-        w_byte(TYPE_UNKNOWN, p);
+        W_TYPE(TYPE_UNKNOWN, p);
         p->error = WFERR_UNMARSHALLABLE;
     }
-    p->depth--;
 }
 
 /* version currently has no effect for writing ints. */
@@ -440,6 +555,7 @@
     wf.fp = fp;
     wf.error = WFERR_OK;
     wf.depth = 0;
+    wf.refs = NULL;
     wf.version = version;
     w_long(x, &wf);
 }
@@ -451,81 +567,107 @@
     wf.fp = fp;
     wf.error = WFERR_OK;
     wf.depth = 0;
+    if (version >= 3) {
+        if ((wf.refs = PyDict_New()) == NULL)
+            return; /* caller mush check PyErr_Occurred() */
+    } else
+        wf.refs = NULL;
     wf.version = version;
     w_object(x, &wf);
+    Py_XDECREF(wf.refs);
 }
 
 typedef WFILE RFILE; /* Same struct with different invariants */
 
-#define rs_byte(p) (((p)->ptr < (p)->end) ? (unsigned char)*(p)->ptr++ : EOF)
-
-static Py_ssize_t
-r_string(char *s, Py_ssize_t n, RFILE *p)
+static char *
+r_string(Py_ssize_t n, RFILE *p)
 {
-    char *ptr;
-    Py_ssize_t read, left;
+    Py_ssize_t read = -1;
+
+    if (p->ptr != NULL) {
+        /* Fast path for loads() */
+        char *res = p->ptr;
+        Py_ssize_t left = p->end - p->ptr;
+        if (left < n) {
+            PyErr_SetString(PyExc_EOFError,
+                            "marshal data too short");
+            return NULL;
+        }
+        p->ptr += n;
+        return res;
+    }
+    if (p->buf == NULL) {
+        p->buf = PyMem_MALLOC(n);
+        if (p->buf == NULL) {
+            PyErr_NoMemory();
+            return NULL;
+        }
+        p->buf_size = n;
+    }
+    else if (p->buf_size < n) {
+        p->buf = PyMem_REALLOC(p->buf, n);
+        if (p->buf == NULL) {
+            PyErr_NoMemory();
+            return NULL;
+        }
+        p->buf_size = n;
+    }
 
     if (!p->readable) {
-        if (p->fp != NULL)
-            /* The result fits into int because it must be <=n. */
-            read = fread(s, 1, n, p->fp);
-        else {
-            left = p->end - p->ptr;
-            read = (left < n) ? left : n;
-            memcpy(s, p->ptr, read);
-            p->ptr += read;
-        }
+        assert(p->fp != NULL);
+        read = fread(p->buf, 1, n, p->fp);
     }
     else {
-        _Py_IDENTIFIER(read);
+        _Py_IDENTIFIER(readinto);
+        PyObject *res, *mview;
+        Py_buffer buf;
 
-        PyObject *data = _PyObject_CallMethodId(p->readable, &PyId_read, "n", n);
-        read = 0;
-        if (data != NULL) {
-            if (!PyBytes_Check(data)) {
-                PyErr_Format(PyExc_TypeError,
-                             "f.read() returned not bytes but %.100s",
-                             data->ob_type->tp_name);
-            }
-            else {
-                read = PyBytes_GET_SIZE(data);
-                if (read > 0) {
-                    if (read > n) {
-                        PyErr_Format(PyExc_ValueError,
-                                    "read() returned too much data: "
-                                    "%zd bytes requested, %zd returned",
-                                    n, read);
-                        read = -1;
-                    }
-                    else {
-                        ptr = PyBytes_AS_STRING(data);
-                        memcpy(s, ptr, read);
-                    }
-                }
-            }
-            Py_DECREF(data);
+        if (PyBuffer_FillInfo(&buf, NULL, p->buf, n, 0, PyBUF_CONTIG) == -1)
+            return NULL;
+        mview = PyMemoryView_FromBuffer(&buf);
+        if (mview == NULL)
+            return NULL;
+
+        res = _PyObject_CallMethodId(p->readable, &PyId_readinto, "N", mview);
+        if (res != NULL) {
+            read = PyNumber_AsSsize_t(res, PyExc_ValueError);
+            Py_DECREF(res);
         }
     }
-    if (!PyErr_Occurred() && (read < n)) {
-        PyErr_SetString(PyExc_EOFError, "EOF read where not expected");
+    if (read != n) {
+        if (!PyErr_Occurred()) {
+            if (read > n)
+                PyErr_Format(PyExc_ValueError,
+                             "read() returned too much data: "
+                             "%zd bytes requested, %zd returned",
+                             n, read);
+            else
+                PyErr_SetString(PyExc_EOFError,
+                                "EOF read where not expected");
+        }
+        return NULL;
     }
-    return read;
+    return p->buf;
 }
 
-
 static int
 r_byte(RFILE *p)
 {
     int c = EOF;
-    unsigned char ch;
-    Py_ssize_t n;
 
-    if (!p->readable)
-        c = p->fp ? getc(p->fp) : rs_byte(p);
+    if (p->ptr != NULL) {
+        if (p->ptr < p->end)
+            c = (unsigned char) *p->ptr++;
+        return c;
+    }
+    if (!p->readable) {
+        assert(p->fp);
+        c = getc(p->fp);
+    }
     else {
-        n = r_string((char *) &ch, 1, p);
-        if (n > 0)
-            c = ch;
+        char *ptr = r_string(1, p);
+        if (ptr != NULL)
+            c = *(unsigned char *) ptr;
     }
     return c;
 }
@@ -533,69 +675,37 @@
 static int
 r_short(RFILE *p)
 {
-    register short x;
-    unsigned char buffer[2];
+    short x = -1;
+    unsigned char *buffer;
 
-    r_string((char *) buffer, 2, p);
-    x = buffer[0];
-    x |= buffer[1] << 8;
-    /* Sign-extension, in case short greater than 16 bits */
-    x |= -(x & 0x8000);
+    buffer = (unsigned char *) r_string(2, p);
+    if (buffer != NULL) {
+        x = buffer[0];
+        x |= buffer[1] << 8;
+        /* Sign-extension, in case short greater than 16 bits */
+        x |= -(x & 0x8000);
+    }
     return x;
 }
 
 static long
 r_long(RFILE *p)
 {
-    register long x;
-    unsigned char buffer[4];
+    long x = -1;
+    unsigned char *buffer;
 
-    r_string((char *) buffer, 4, p);
-    x = buffer[0];
-    x |= (long)buffer[1] << 8;
-    x |= (long)buffer[2] << 16;
-    x |= (long)buffer[3] << 24;
+    buffer = (unsigned char *) r_string(4, p);
+    if (buffer != NULL) {
+        x = buffer[0];
+        x |= (long)buffer[1] << 8;
+        x |= (long)buffer[2] << 16;
+        x |= (long)buffer[3] << 24;
 #if SIZEOF_LONG > 4
-    /* Sign extension for 64-bit machines */
-    x |= -(x & 0x80000000L);
-#endif
-    return x;
-}
-
-/* r_long64 deals with the TYPE_INT64 code.  On a machine with
-   sizeof(long) > 4, it returns a Python int object, else a Python long
-   object.  Note that w_long64 writes out TYPE_INT if 32 bits is enough,
-   so there's no inefficiency here in returning a PyLong on 32-bit boxes
-   for everything written via TYPE_INT64 (i.e., if an int is written via
-   TYPE_INT64, it *needs* more than 32 bits).
-*/
-static PyObject *
-r_long64(RFILE *p)
-{
-    PyObject *result = NULL;
-    long lo4 = r_long(p);
-    long hi4 = r_long(p);
-
-    if (!PyErr_Occurred()) {
-#if SIZEOF_LONG > 4
-        long x = (hi4 << 32) | (lo4 & 0xFFFFFFFFL);
-        result = PyLong_FromLong(x);
-#else
-        unsigned char buf[8];
-        int one = 1;
-        int is_little_endian = (int)*(char*)&one;
-        if (is_little_endian) {
-            memcpy(buf, &lo4, 4);
-            memcpy(buf+4, &hi4, 4);
-        }
-        else {
-            memcpy(buf, &hi4, 4);
-            memcpy(buf+4, &lo4, 4);
-        }
-        result = _PyLong_FromByteArray(buf, 8, is_little_endian, 1);
+        /* Sign extension for 64-bit machines */
+        x |= -(x & 0x80000000L);
 #endif
     }
-    return result;
+    return x;
 }
 
 static PyObject *
@@ -622,25 +732,31 @@
     ob = _PyLong_New(size);
     if (ob == NULL)
         return NULL;
+
     Py_SIZE(ob) = n > 0 ? size : -size;
 
     for (i = 0; i < size-1; i++) {
         d = 0;
         for (j=0; j < PyLong_MARSHAL_RATIO; j++) {
             md = r_short(p);
-            if (PyErr_Occurred())
-                break;
+            if (PyErr_Occurred()) {
+                Py_DECREF(ob);
+                return NULL;
+            }
             if (md < 0 || md > PyLong_MARSHAL_BASE)
                 goto bad_digit;
             d += (digit)md << j*PyLong_MARSHAL_SHIFT;
         }
         ob->ob_digit[i] = d;
     }
+
     d = 0;
     for (j=0; j < shorts_in_top_digit; j++) {
         md = r_short(p);
-        if (PyErr_Occurred())
-            break;
+        if (PyErr_Occurred()) {
+            Py_DECREF(ob);
+            return NULL;
+        }
         if (md < 0 || md > PyLong_MARSHAL_BASE)
             goto bad_digit;
         /* topmost marshal digit should be nonzero */
@@ -667,6 +783,59 @@
     return NULL;
 }
 
+/* allocate the reflist index for a new object. Return -1 on failure */
+static Py_ssize_t
+r_ref_reserve(int flag, RFILE *p)
+{
+    if (flag) { /* currently only FLAG_REF is defined */
+        Py_ssize_t idx = PyList_GET_SIZE(p->refs);
+        if (idx >= 0x7ffffffe) {
+            PyErr_SetString(PyExc_ValueError, "bad marshal data (index list too large)");
+            return -1;
+        }
+        if (PyList_Append(p->refs, Py_None) < 0)
+            return -1;
+        return idx;
+    } else
+        return 0;
+}
+
+/* insert the new object 'o' to the reflist at previously
+ * allocated index 'idx'.
+ * 'o' can be NULL, in which case nothing is done.
+ * if 'o' was non-NULL, and the function succeeds, 'o' is returned.
+ * if 'o' was non-NULL, and the function fails, 'o' is released and
+ * NULL returned. This simplifies error checking at the call site since
+ * a single test for NULL for the function result is enough.
+ */
+static PyObject *
+r_ref_insert(PyObject *o, Py_ssize_t idx, int flag, RFILE *p)
+{
+    if (o != NULL && flag) { /* currently only FLAG_REF is defined */
+        PyObject *tmp = PyList_GET_ITEM(p->refs, idx);
+        Py_INCREF(o);
+        PyList_SET_ITEM(p->refs, idx, o);
+        Py_DECREF(tmp);
+    }
+    return o;
+}
+
+/* combination of both above, used when an object can be
+ * created whenever it is seen in the file, as opposed to
+ * after having loaded its sub-objects.
+ */
+static PyObject *
+r_ref(PyObject *o, int flag, RFILE *p)
+{
+    assert(flag & FLAG_REF);
+    if (o == NULL)
+        return NULL;
+    if (PyList_Append(p->refs, o) < 0) {
+        Py_DECREF(o); /* release the new object */
+        return NULL;
+    }
+    return o;
+}
 
 static PyObject *
 r_object(RFILE *p)
@@ -674,9 +843,17 @@
     /* NULL is a valid return value, it does not necessarily means that
        an exception is set. */
     PyObject *v, *v2;
+    Py_ssize_t idx = 0;
     long i, n;
-    int type = r_byte(p);
-    PyObject *retval;
+    int type, code = r_byte(p);
+    int flag, is_interned = 0;
+    PyObject *retval = NULL;
+
+    if (code == EOF) {
+        PyErr_SetString(PyExc_EOFError,
+                        "EOF read where object expected");
+        return NULL;
+    }
 
     p->depth++;
 
@@ -686,16 +863,17 @@
         return NULL;
     }
 
+    flag = code & FLAG_REF;
+    type = code & ~FLAG_REF;
+
+#define R_REF(O) do{\
+    if (flag) \
+        O = r_ref(O, flag, p);\
+} while (0)
+
     switch (type) {
 
-    case EOF:
-        PyErr_SetString(PyExc_EOFError,
-                        "EOF read where object expected");
-        retval = NULL;
-        break;
-
     case TYPE_NULL:
-        retval = NULL;
         break;
 
     case TYPE_NONE:
@@ -726,67 +904,66 @@
     case TYPE_INT:
         n = r_long(p);
         retval = PyErr_Occurred() ? NULL : PyLong_FromLong(n);
-        break;
-
-    case TYPE_INT64:
-        retval = r_long64(p);
+        R_REF(retval);
         break;
 
     case TYPE_LONG:
         retval = r_PyLong(p);
+        R_REF(retval);
         break;
 
     case TYPE_FLOAT:
         {
-            char buf[256];
+            char buf[256], *ptr;
             double dx;
-            retval = NULL;
             n = r_byte(p);
             if (n == EOF) {
                 PyErr_SetString(PyExc_EOFError,
                     "EOF read where object expected");
                 break;
             }
-            if (r_string(buf, n, p) != n)
+            ptr = r_string(n, p);
+            if (ptr == NULL)
                 break;
+            memcpy(buf, ptr, n);
             buf[n] = '\0';
             dx = PyOS_string_to_double(buf, NULL, NULL);
             if (dx == -1.0 && PyErr_Occurred())
                 break;
             retval = PyFloat_FromDouble(dx);
+            R_REF(retval);
             break;
         }
 
     case TYPE_BINARY_FLOAT:
         {
-            unsigned char buf[8];
+            unsigned char *buf;
             double x;
-            if (r_string((char*)buf, 8, p) != 8) {
-                retval = NULL;
+            buf = (unsigned char *) r_string(8, p);
+            if (buf == NULL)
                 break;
-            }
             x = _PyFloat_Unpack8(buf, 1);
-            if (x == -1.0 && PyErr_Occurred()) {
-                retval = NULL;
+            if (x == -1.0 && PyErr_Occurred())
                 break;
-            }
             retval = PyFloat_FromDouble(x);
+            R_REF(retval);
             break;
         }
 
     case TYPE_COMPLEX:
         {
-            char buf[256];
+            char buf[256], *ptr;
             Py_complex c;
-            retval = NULL;
             n = r_byte(p);
             if (n == EOF) {
                 PyErr_SetString(PyExc_EOFError,
                     "EOF read where object expected");
                 break;
             }
-            if (r_string(buf, n, p) != n)
+            ptr = r_string(n, p);
+            if (ptr == NULL)
                 break;
+            memcpy(buf, ptr, n);
             buf[n] = '\0';
             c.real = PyOS_string_to_double(buf, NULL, NULL);
             if (c.real == -1.0 && PyErr_Occurred())
@@ -797,112 +974,151 @@
                     "EOF read where object expected");
                 break;
             }
-            if (r_string(buf, n, p) != n)
+            ptr = r_string(n, p);
+            if (ptr == NULL)
                 break;
+            memcpy(buf, ptr, n);
             buf[n] = '\0';
             c.imag = PyOS_string_to_double(buf, NULL, NULL);
             if (c.imag == -1.0 && PyErr_Occurred())
                 break;
             retval = PyComplex_FromCComplex(c);
+            R_REF(retval);
             break;
         }
 
     case TYPE_BINARY_COMPLEX:
         {
-            unsigned char buf[8];
+            unsigned char *buf;
             Py_complex c;
-            if (r_string((char*)buf, 8, p) != 8) {
-                retval = NULL;
+            buf = (unsigned char *) r_string(8, p);
+            if (buf == NULL)
                 break;
-            }
             c.real = _PyFloat_Unpack8(buf, 1);
-            if (c.real == -1.0 && PyErr_Occurred()) {
-                retval = NULL;
+            if (c.real == -1.0 && PyErr_Occurred())
                 break;
-            }
-            if (r_string((char*)buf, 8, p) != 8) {
-                retval = NULL;
+            buf = (unsigned char *) r_string(8, p);
+            if (buf == NULL)
                 break;
-            }
             c.imag = _PyFloat_Unpack8(buf, 1);
-            if (c.imag == -1.0 && PyErr_Occurred()) {
-                retval = NULL;
+            if (c.imag == -1.0 && PyErr_Occurred())
                 break;
-            }
             retval = PyComplex_FromCComplex(c);
+            R_REF(retval);
             break;
         }
 
     case TYPE_STRING:
-        n = r_long(p);
-        if (PyErr_Occurred()) {
-            retval = NULL;
+        {
+            char *ptr;
+            n = r_long(p);
+            if (PyErr_Occurred())
+                break;
+            if (n < 0 || n > SIZE32_MAX) {
+                PyErr_SetString(PyExc_ValueError, "bad marshal data (string size out of range)");
+                break;
+            }
+            v = PyBytes_FromStringAndSize((char *)NULL, n);
+            if (v == NULL)
+                break;
+            ptr = r_string(n, p);
+            if (ptr == NULL) {
+                Py_DECREF(v);
+                break;
+            }
+            memcpy(PyBytes_AS_STRING(v), ptr, n);
+            retval = v;
+            R_REF(retval);
             break;
         }
-        if (n < 0 || n > SIZE32_MAX) {
-            PyErr_SetString(PyExc_ValueError, "bad marshal data (string size out of range)");
-            retval = NULL;
-            break;
-        }
-        v = PyBytes_FromStringAndSize((char *)NULL, n);
-        if (v == NULL) {
-            retval = NULL;
-            break;
-        }
-        if (r_string(PyBytes_AS_STRING(v), n, p) != n) {
-            Py_DECREF(v);
-            retval = NULL;
-            break;
-        }
-        retval = v;
-        break;
 
+    case TYPE_ASCII_INTERNED:
+        is_interned = 1;
+    case TYPE_ASCII:
+        n = r_long(p);
+        if (PyErr_Occurred())
+            break;
+        if (n < 0 || n > SIZE32_MAX) {
+            PyErr_SetString(PyExc_ValueError, "bad marshal data (unicode size out of range)");
+            break;
+        }
+        goto _read_ascii;
+
+    case TYPE_SHORT_ASCII_INTERNED:
+        is_interned = 1;
+    case TYPE_SHORT_ASCII:
+        n = r_byte(p);
+        if (n == EOF) {
+            PyErr_SetString(PyExc_EOFError,
+                "EOF read where object expected");
+            break;
+        }
+    _read_ascii:
+        {
+            char *ptr;
+            ptr = r_string(n, p);
+            if (ptr == NULL)
+                break;
+            v = PyUnicode_FromKindAndData(PyUnicode_1BYTE_KIND, ptr, n);
+            if (v == NULL)
+                break;
+            if (is_interned)
+                PyUnicode_InternInPlace(&v);
+            retval = v;
+            R_REF(retval);
+            break;
+        }
+
+    case TYPE_INTERNED:
+        is_interned = 1;
     case TYPE_UNICODE:
         {
         char *buffer;
 
         n = r_long(p);
-        if (PyErr_Occurred()) {
-            retval = NULL;
+        if (PyErr_Occurred())
             break;
-        }
         if (n < 0 || n > SIZE32_MAX) {
             PyErr_SetString(PyExc_ValueError, "bad marshal data (unicode size out of range)");
-            retval = NULL;
             break;
         }
-        buffer = PyMem_NEW(char, n);
-        if (buffer == NULL) {
-            retval = PyErr_NoMemory();
-            break;
+        if (n != 0) {
+            buffer = r_string(n, p);
+            if (buffer == NULL)
+                break;
+            v = PyUnicode_DecodeUTF8(buffer, n, "surrogatepass");
         }
-        if (r_string(buffer, n, p) != n) {
-            PyMem_DEL(buffer);
-            retval = NULL;
-            break;
+        else {
+            v = PyUnicode_New(0, 0);
         }
-        v = PyUnicode_DecodeUTF8(buffer, n, "surrogatepass");
-        PyMem_DEL(buffer);
+        if (v == NULL)
+            break;
+        if (is_interned)
+            PyUnicode_InternInPlace(&v);
         retval = v;
+        R_REF(retval);
         break;
         }
 
+    case TYPE_SMALL_TUPLE:
+        n = (unsigned char) r_byte(p);
+        if (PyErr_Occurred())
+            break;
+        goto _read_tuple;
     case TYPE_TUPLE:
         n = r_long(p);
-        if (PyErr_Occurred()) {
-            retval = NULL;
+        if (PyErr_Occurred())
             break;
-        }
         if (n < 0 || n > SIZE32_MAX) {
             PyErr_SetString(PyExc_ValueError, "bad marshal data (tuple size out of range)");
-            retval = NULL;
             break;
         }
+    _read_tuple:
         v = PyTuple_New(n);
-        if (v == NULL) {
-            retval = NULL;
+        R_REF(v);
+        if (v == NULL)
             break;
-        }
+
         for (i = 0; i < n; i++) {
             v2 = r_object(p);
             if ( v2 == NULL ) {
@@ -920,20 +1136,16 @@
 
     case TYPE_LIST:
         n = r_long(p);
-        if (PyErr_Occurred()) {
-            retval = NULL;
+        if (PyErr_Occurred())
             break;
-        }
         if (n < 0 || n > SIZE32_MAX) {
             PyErr_SetString(PyExc_ValueError, "bad marshal data (list size out of range)");
-            retval = NULL;
             break;
         }
         v = PyList_New(n);
-        if (v == NULL) {
-            retval = NULL;
+        R_REF(v);
+        if (v == NULL)
             break;
-        }
         for (i = 0; i < n; i++) {
             v2 = r_object(p);
             if ( v2 == NULL ) {
@@ -951,20 +1163,26 @@
 
     case TYPE_DICT:
         v = PyDict_New();
-        if (v == NULL) {
-            retval = NULL;
+        R_REF(v);
+        if (v == NULL)
             break;
-        }
         for (;;) {
             PyObject *key, *val;
             key = r_object(p);
             if (key == NULL)
                 break;
             val = r_object(p);
-            if (val != NULL)
-                PyDict_SetItem(v, key, val);
+            if (val == NULL) {
+                Py_DECREF(key);
+                break;
+            }
+            if (PyDict_SetItem(v, key, val) < 0) {
+                Py_DECREF(key);
+                Py_DECREF(val);
+                break;
+            }
             Py_DECREF(key);
-            Py_XDECREF(val);
+            Py_DECREF(val);
         }
         if (PyErr_Occurred()) {
             Py_DECREF(v);
@@ -976,20 +1194,26 @@
     case TYPE_SET:
     case TYPE_FROZENSET:
         n = r_long(p);
-        if (PyErr_Occurred()) {
-            retval = NULL;
+        if (PyErr_Occurred())
             break;
-        }
         if (n < 0 || n > SIZE32_MAX) {
             PyErr_SetString(PyExc_ValueError, "bad marshal data (set size out of range)");
-            retval = NULL;
             break;
         }
         v = (type == TYPE_SET) ? PySet_New(NULL) : PyFrozenSet_New(NULL);
-        if (v == NULL) {
-            retval = NULL;
-            break;
+        if (type == TYPE_SET) {
+            R_REF(v);
+        } else {
+            /* must use delayed registration of frozensets because they must
+             * be init with a refcount of 1
+             */
+            idx = r_ref_reserve(flag, p);
+            if (idx < 0)
+                Py_CLEAR(v); /* signal error */
         }
+        if (v == NULL)
+            break;
+
         for (i = 0; i < n; i++) {
             v2 = r_object(p);
             if ( v2 == NULL ) {
@@ -1008,6 +1232,8 @@
             }
             Py_DECREF(v2);
         }
+        if (type != TYPE_SET)
+            v = r_ref_insert(v, idx, flag, p);
         retval = v;
         break;
 
@@ -1029,6 +1255,10 @@
             int firstlineno;
             PyObject *lnotab = NULL;
 
+            idx = r_ref_reserve(flag, p);
+            if (idx < 0)
+                break;
+
             v = NULL;
 
             /* XXX ignore long->int overflows for now */
@@ -1084,6 +1314,8 @@
             if (name == NULL)
                 goto code_error;
             firstlineno = (int)r_long(p);
+            if (firstlineno == -1 && PyErr_Occurred())
+                break;
             lnotab = r_object(p);
             if (lnotab == NULL)
                 goto code_error;
@@ -1094,6 +1326,7 @@
                             code, consts, names, varnames,
                             freevars, cellvars, filename, name,
                             firstlineno, lnotab);
+            v = r_ref_insert(v, idx, flag, p);
 
           code_error:
             Py_XDECREF(code);
@@ -1109,11 +1342,27 @@
         retval = v;
         break;
 
+    case TYPE_REF:
+        n = r_long(p);
+        if (n < 0 || n >= PyList_GET_SIZE(p->refs)) {
+            if (n == -1 && PyErr_Occurred())
+                break;
+            PyErr_SetString(PyExc_ValueError, "bad marshal data (invalid reference)");
+            break;
+        }
+        v = PyList_GET_ITEM(p->refs, n);
+        if (v == Py_None) {
+            PyErr_SetString(PyExc_ValueError, "bad marshal data (invalid reference)");
+            break;
+        }
+        Py_INCREF(v);
+        retval = v;
+        break;
+
     default:
         /* Bogus data got written, which isn't ideal.
            This will let you keep working and recover. */
         PyErr_SetString(PyExc_ValueError, "bad marshal data (unknown type code)");
-        retval = NULL;
         break;
 
     }
@@ -1139,23 +1388,33 @@
 PyMarshal_ReadShortFromFile(FILE *fp)
 {
     RFILE rf;
+    int res;
     assert(fp);
     rf.readable = NULL;
     rf.fp = fp;
     rf.current_filename = NULL;
     rf.end = rf.ptr = NULL;
-    return r_short(&rf);
+    rf.buf = NULL;
+    res = r_short(&rf);
+    if (rf.buf != NULL)
+        PyMem_FREE(rf.buf);
+    return res;
 }
 
 long
 PyMarshal_ReadLongFromFile(FILE *fp)
 {
     RFILE rf;
+    long res;
     rf.fp = fp;
     rf.readable = NULL;
     rf.current_filename = NULL;
     rf.ptr = rf.end = NULL;
-    return r_long(&rf);
+    rf.buf = NULL;
+    res = r_long(&rf);
+    if (rf.buf != NULL)
+        PyMem_FREE(rf.buf);
+    return res;
 }
 
 #ifdef HAVE_FSTAT
@@ -1214,22 +1473,36 @@
     rf.current_filename = NULL;
     rf.depth = 0;
     rf.ptr = rf.end = NULL;
+    rf.buf = NULL;
+    rf.refs = PyList_New(0);
+    if (rf.refs == NULL)
+        return NULL;
     result = r_object(&rf);
+    Py_DECREF(rf.refs);
+    if (rf.buf != NULL)
+        PyMem_FREE(rf.buf);
     return result;
 }
 
 PyObject *
-PyMarshal_ReadObjectFromString(char *str, Py_ssize_t len)
+PyMarshal_ReadObjectFromString(const char *str, Py_ssize_t len)
 {
     RFILE rf;
     PyObject *result;
     rf.fp = NULL;
     rf.readable = NULL;
     rf.current_filename = NULL;
-    rf.ptr = str;
-    rf.end = str + len;
+    rf.ptr = (char *)str;
+    rf.end = (char *)str + len;
+    rf.buf = NULL;
     rf.depth = 0;
+    rf.refs = PyList_New(0);
+    if (rf.refs == NULL)
+        return NULL;
     result = r_object(&rf);
+    Py_DECREF(rf.refs);
+    if (rf.buf != NULL)
+        PyMem_FREE(rf.buf);
     return result;
 }
 
@@ -1248,7 +1521,15 @@
     wf.error = WFERR_OK;
     wf.depth = 0;
     wf.version = version;
+    if (version >= 3) {
+        if ((wf.refs = PyDict_New()) == NULL) {
+            Py_DECREF(wf.str);
+            return NULL;
+        }
+    } else
+        wf.refs = NULL;
     w_object(x, &wf);
+    Py_XDECREF(wf.refs);
     if (wf.str != NULL) {
         char *base = PyBytes_AS_STRING((PyBytesObject *)wf.str);
         if (wf.ptr - base > PY_SSIZE_T_MAX) {
@@ -1320,6 +1601,8 @@
      * Make a call to the read method, but read zero bytes.
      * This is to ensure that the object passed in at least
      * has a read method which returns bytes.
+     * This can be removed if we guarantee good error handling
+     * for r_string()
      */
     data = _PyObject_CallMethodId(f, &PyId_read, "i", 0);
     if (data == NULL)
@@ -1335,7 +1618,15 @@
         rf.fp = NULL;
         rf.readable = f;
         rf.current_filename = NULL;
-        result = read_object(&rf);
+        rf.ptr = rf.end = NULL;
+        rf.buf = NULL;
+        if ((rf.refs = PyList_New(0)) != NULL) {
+            result = read_object(&rf);
+            Py_DECREF(rf.refs);
+            if (rf.buf != NULL)
+                PyMem_FREE(rf.buf);
+        } else
+            result = NULL;
     }
     Py_DECREF(data);
     return result;
@@ -1392,8 +1683,11 @@
     rf.ptr = s;
     rf.end = s + n;
     rf.depth = 0;
+    if ((rf.refs = PyList_New(0)) == NULL)
+        return NULL;
     result = read_object(&rf);
     PyBuffer_Release(&p);
+    Py_DECREF(rf.refs);
     return result;
 }
 
@@ -1433,6 +1727,7 @@
 version -- indicates the format that the module uses. Version 0 is the\n\
     historical format, version 1 shares interned strings and version 2\n\
     uses a binary format for floating point numbers.\n\
+    Version 3 shares common object references (New in version 3.4).\n\
 \n\
 Functions:\n\
 \n\
diff --git a/Python/modsupport.c b/Python/modsupport.c
index 428914f..6c938dd 100644
--- a/Python/modsupport.c
+++ b/Python/modsupport.c
@@ -161,7 +161,17 @@
     /* Note that we can't bail immediately on error as this will leak
        refcounts on any 'N' arguments. */
     for (i = 0; i < n; i++) {
-        PyObject *w = do_mkvalue(p_format, p_va, flags);
+        PyObject *w;
+
+        if (itemfailed) {
+            PyObject *exception, *value, *tb;
+            PyErr_Fetch(&exception, &value, &tb);
+            w = do_mkvalue(p_format, p_va, flags);
+            PyErr_Restore(exception, value, tb);
+        }
+        else {
+            w = do_mkvalue(p_format, p_va, flags);
+        }
         if (w == NULL) {
             itemfailed = 1;
             Py_INCREF(Py_None);
diff --git a/Python/mystrtoul.c b/Python/mystrtoul.c
index 8a54cbf..98429d4 100644
--- a/Python/mystrtoul.c
+++ b/Python/mystrtoul.c
@@ -92,11 +92,11 @@
 **              exceptions - we don't check for them.
 */
 unsigned long
-PyOS_strtoul(register char *str, char **ptr, int base)
+PyOS_strtoul(const char *str, char **ptr, int base)
 {
-    register unsigned long result = 0; /* return value of the function */
-    register int c;             /* current input character */
-    register int ovlimit;       /* required digits to overflow */
+    unsigned long result = 0; /* return value of the function */
+    int c;             /* current input character */
+    int ovlimit;       /* required digits to overflow */
 
     /* skip leading white space */
     while (*str && Py_ISSPACE(Py_CHARMASK(*str)))
@@ -111,7 +111,7 @@
                 /* there must be at least one digit after 0x */
                 if (_PyLong_DigitValue[Py_CHARMASK(str[1])] >= 16) {
                     if (ptr)
-                        *ptr = str;
+                        *ptr = (char *)str;
                     return 0;
                 }
                 ++str;
@@ -120,7 +120,7 @@
                 /* there must be at least one digit after 0o */
                 if (_PyLong_DigitValue[Py_CHARMASK(str[1])] >= 8) {
                     if (ptr)
-                        *ptr = str;
+                        *ptr = (char *)str;
                     return 0;
                 }
                 ++str;
@@ -129,7 +129,7 @@
                 /* there must be at least one digit after 0b */
                 if (_PyLong_DigitValue[Py_CHARMASK(str[1])] >= 2) {
                     if (ptr)
-                        *ptr = str;
+                        *ptr = (char *)str;
                     return 0;
                 }
                 ++str;
@@ -141,7 +141,7 @@
                 while (Py_ISSPACE(Py_CHARMASK(*str)))
                     ++str;
                 if (ptr)
-                    *ptr = str;
+                    *ptr = (char *)str;
                 return 0;
             }
         }
@@ -157,7 +157,7 @@
                 /* there must be at least one digit after 0x */
                 if (_PyLong_DigitValue[Py_CHARMASK(str[1])] >= 16) {
                     if (ptr)
-                        *ptr = str;
+                        *ptr = (char *)str;
                     return 0;
                 }
                 ++str;
@@ -171,7 +171,7 @@
                 /* there must be at least one digit after 0o */
                 if (_PyLong_DigitValue[Py_CHARMASK(str[1])] >= 8) {
                     if (ptr)
-                        *ptr = str;
+                        *ptr = (char *)str;
                     return 0;
                 }
                 ++str;
@@ -185,7 +185,7 @@
                 /* there must be at least one digit after 0b */
                 if (_PyLong_DigitValue[Py_CHARMASK(str[1])] >= 2) {
                     if (ptr)
-                        *ptr = str;
+                        *ptr = (char *)str;
                     return 0;
                 }
                 ++str;
@@ -197,7 +197,7 @@
     /* catch silly bases */
     if (base < 2 || base > 36) {
         if (ptr)
-            *ptr = str;
+            *ptr = (char *)str;
         return 0;
     }
 
@@ -213,7 +213,7 @@
         if (ovlimit > 0) /* no overflow check required */
             result = result * base + c;
         else { /* requires overflow check */
-            register unsigned long temp_result;
+            unsigned long temp_result;
 
             if (ovlimit < 0) /* guaranteed overflow */
                 goto overflowed;
@@ -239,7 +239,7 @@
 
     /* set pointer to point to the last character scanned */
     if (ptr)
-        *ptr = str;
+        *ptr = (char *)str;
 
     return result;
 
@@ -248,7 +248,7 @@
         /* spool through remaining digit characters */
         while (_PyLong_DigitValue[Py_CHARMASK(*str)] < base)
             ++str;
-        *ptr = str;
+        *ptr = (char *)str;
     }
     errno = ERANGE;
     return (unsigned long)-1;
@@ -260,7 +260,7 @@
 #define PY_ABS_LONG_MIN         (0-(unsigned long)LONG_MIN)
 
 long
-PyOS_strtol(char *str, char **ptr, int base)
+PyOS_strtol(const char *str, char **ptr, int base)
 {
     long result;
     unsigned long uresult;
diff --git a/Python/opcode_targets.h b/Python/opcode_targets.h
index 2d6bcda..f90a17a 100644
--- a/Python/opcode_targets.h
+++ b/Python/opcode_targets.h
@@ -68,7 +68,7 @@
     &&TARGET_BINARY_OR,
     &&TARGET_INPLACE_POWER,
     &&TARGET_GET_ITER,
-    &&TARGET_STORE_LOCALS,
+    &&_unknown_opcode,
     &&TARGET_PRINT_EXPR,
     &&TARGET_LOAD_BUILD_CLASS,
     &&TARGET_YIELD_FROM,
@@ -147,7 +147,7 @@
     &&TARGET_LIST_APPEND,
     &&TARGET_SET_ADD,
     &&TARGET_MAP_ADD,
-    &&_unknown_opcode,
+    &&TARGET_LOAD_CLASSDEREF,
     &&_unknown_opcode,
     &&_unknown_opcode,
     &&_unknown_opcode,
diff --git a/Python/peephole.c b/Python/peephole.c
index 5d53677..4185462 100644
--- a/Python/peephole.c
+++ b/Python/peephole.c
@@ -275,6 +275,7 @@
     len_consts = PyList_GET_SIZE(consts);
     if (PyList_Append(consts, newconst)) {
         Py_DECREF(newconst);
+        PyErr_Clear();
         return 0;
     }
     Py_DECREF(newconst);
@@ -327,37 +328,6 @@
     return blocks;
 }
 
-/* Helper to replace LOAD_NAME None/True/False with LOAD_CONST
-   Returns: 0 if no change, 1 if change, -1 if error */
-static int
-load_global(unsigned char *codestr, Py_ssize_t i, char *name, PyObject *consts)
-{
-    Py_ssize_t j;
-    PyObject *obj;
-    if (name == NULL)
-        return 0;
-    if (strcmp(name, "None") == 0)
-        obj = Py_None;
-    else if (strcmp(name, "True") == 0)
-        obj = Py_True;
-    else if (strcmp(name, "False") == 0)
-        obj = Py_False;
-    else
-        return 0;
-    for (j = 0; j < PyList_GET_SIZE(consts); j++) {
-        if (PyList_GET_ITEM(consts, j) == obj)
-            break;
-    }
-    if (j == PyList_GET_SIZE(consts)) {
-        if (PyList_Append(consts, obj) < 0)
-            return -1;
-    }
-    assert(PyList_GET_ITEM(consts, j) == obj);
-    codestr[i] = LOAD_CONST;
-    SETARG(codestr, i, j);
-    return 1;
-}
-
 /* Perform basic peephole optimizations to components of a code object.
    The consts object should still be in list form to allow new constants
    to be appended.
@@ -392,7 +362,6 @@
     Py_ssize_t const_stack_size = 0;
     int in_consts = 0;  /* whether we are in a LOAD_CONST sequence */
     unsigned int *blocks = NULL;
-    char *name;
 
     /* Bail out if an exception is set */
     if (PyErr_Occurred())
@@ -413,8 +382,10 @@
 
     /* Make a modifiable copy of the code string */
     codestr = (unsigned char *)PyMem_Malloc(codelen);
-    if (codestr == NULL)
+    if (codestr == NULL) {
+        PyErr_NoMemory();
         goto exitError;
+    }
     codestr = (unsigned char *)memcpy(codestr,
                                       PyBytes_AS_STRING(code), codelen);
 
@@ -428,8 +399,10 @@
 
     /* Mapping to new jump targets after NOPs are removed */
     addrmap = (int *)PyMem_Malloc(codelen * sizeof(int));
-    if (addrmap == NULL)
+    if (addrmap == NULL) {
+        PyErr_NoMemory();
         goto exitError;
+    }
 
     blocks = markblocks(codestr, codelen);
     if (blocks == NULL)
@@ -475,20 +448,6 @@
                 codestr[i+3] = NOP;
                 break;
 
-                /* Replace LOAD_GLOBAL/LOAD_NAME None/True/False
-                   with LOAD_CONST None/True/False */
-            case LOAD_NAME:
-            case LOAD_GLOBAL:
-                j = GETARG(codestr, i);
-                name = _PyUnicode_AsString(PyTuple_GET_ITEM(names, j));
-                h = load_global(codestr, i, name, consts);
-                if (h < 0)
-                    goto exitError;
-                else if (h == 0)
-                    continue;
-                CONST_STACK_PUSH_OP(i);
-                break;
-
                 /* Skip over LOAD_CONST trueconst
                    POP_JUMP_IF_FALSE xx. This improves
                    "while 1" performance. */
diff --git a/Python/pyarena.c b/Python/pyarena.c
index 02a31d8..103603f 100644
--- a/Python/pyarena.c
+++ b/Python/pyarena.c
@@ -77,7 +77,7 @@
 {
     /* Allocate header and block as one unit.
        ab_mem points just past header. */
-    block *b = (block *)malloc(sizeof(block) + size);
+    block *b = (block *)PyMem_Malloc(sizeof(block) + size);
     if (!b)
         return NULL;
     b->ab_size = size;
@@ -92,7 +92,7 @@
 block_free(block *b) {
     while (b) {
         block *next = b->ab_next;
-        free(b);
+        PyMem_Free(b);
         b = next;
     }
 }
@@ -127,20 +127,20 @@
 PyArena *
 PyArena_New()
 {
-    PyArena* arena = (PyArena *)malloc(sizeof(PyArena));
+    PyArena* arena = (PyArena *)PyMem_Malloc(sizeof(PyArena));
     if (!arena)
         return (PyArena*)PyErr_NoMemory();
 
     arena->a_head = block_new(DEFAULT_BLOCK_SIZE);
     arena->a_cur = arena->a_head;
     if (!arena->a_head) {
-        free((void *)arena);
+        PyMem_Free((void *)arena);
         return (PyArena*)PyErr_NoMemory();
     }
     arena->a_objects = PyList_New(0);
     if (!arena->a_objects) {
         block_free(arena->a_head);
-        free((void *)arena);
+        PyMem_Free((void *)arena);
         return (PyArena*)PyErr_NoMemory();
     }
 #if defined(Py_DEBUG)
@@ -173,7 +173,7 @@
     */
 
     Py_DECREF(arena->a_objects);
-    free(arena);
+    PyMem_Free(arena);
 }
 
 void *
diff --git a/Python/pyhash.c b/Python/pyhash.c
new file mode 100644
index 0000000..97cb547
--- /dev/null
+++ b/Python/pyhash.c
@@ -0,0 +1,427 @@
+/* Set of hash utility functions to help maintaining the invariant that
+    if a==b then hash(a)==hash(b)
+
+   All the utility functions (_Py_Hash*()) return "-1" to signify an error.
+*/
+#include "Python.h"
+
+#ifdef __APPLE__
+#  include <libkern/OSByteOrder.h>
+#elif defined(HAVE_LE64TOH) && defined(HAVE_ENDIAN_H)
+#  include <endian.h>
+#elif defined(HAVE_LE64TOH) && defined(HAVE_SYS_ENDIAN_H)
+#  include <sys/endian.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_Py_HashSecret_t _Py_HashSecret;
+
+#if Py_HASH_ALGORITHM == Py_HASH_EXTERNAL
+extern PyHash_FuncDef PyHash_Func;
+#else
+static PyHash_FuncDef PyHash_Func;
+#endif
+
+/* Count _Py_HashBytes() calls */
+#ifdef Py_HASH_STATS
+#define Py_HASH_STATS_MAX 32
+static Py_ssize_t hashstats[Py_HASH_STATS_MAX + 1] = {0};
+#endif
+
+/* For numeric types, the hash of a number x is based on the reduction
+   of x modulo the prime P = 2**_PyHASH_BITS - 1.  It's designed so that
+   hash(x) == hash(y) whenever x and y are numerically equal, even if
+   x and y have different types.
+
+   A quick summary of the hashing strategy:
+
+   (1) First define the 'reduction of x modulo P' for any rational
+   number x; this is a standard extension of the usual notion of
+   reduction modulo P for integers.  If x == p/q (written in lowest
+   terms), the reduction is interpreted as the reduction of p times
+   the inverse of the reduction of q, all modulo P; if q is exactly
+   divisible by P then define the reduction to be infinity.  So we've
+   got a well-defined map
+
+      reduce : { rational numbers } -> { 0, 1, 2, ..., P-1, infinity }.
+
+   (2) Now for a rational number x, define hash(x) by:
+
+      reduce(x)   if x >= 0
+      -reduce(-x) if x < 0
+
+   If the result of the reduction is infinity (this is impossible for
+   integers, floats and Decimals) then use the predefined hash value
+   _PyHASH_INF for x >= 0, or -_PyHASH_INF for x < 0, instead.
+   _PyHASH_INF, -_PyHASH_INF and _PyHASH_NAN are also used for the
+   hashes of float and Decimal infinities and nans.
+
+   A selling point for the above strategy is that it makes it possible
+   to compute hashes of decimal and binary floating-point numbers
+   efficiently, even if the exponent of the binary or decimal number
+   is large.  The key point is that
+
+      reduce(x * y) == reduce(x) * reduce(y) (modulo _PyHASH_MODULUS)
+
+   provided that {reduce(x), reduce(y)} != {0, infinity}.  The reduction of a
+   binary or decimal float is never infinity, since the denominator is a power
+   of 2 (for binary) or a divisor of a power of 10 (for decimal).  So we have,
+   for nonnegative x,
+
+      reduce(x * 2**e) == reduce(x) * reduce(2**e) % _PyHASH_MODULUS
+
+      reduce(x * 10**e) == reduce(x) * reduce(10**e) % _PyHASH_MODULUS
+
+   and reduce(10**e) can be computed efficiently by the usual modular
+   exponentiation algorithm.  For reduce(2**e) it's even better: since
+   P is of the form 2**n-1, reduce(2**e) is 2**(e mod n), and multiplication
+   by 2**(e mod n) modulo 2**n-1 just amounts to a rotation of bits.
+
+   */
+
+Py_hash_t
+_Py_HashDouble(double v)
+{
+    int e, sign;
+    double m;
+    Py_uhash_t x, y;
+
+    if (!Py_IS_FINITE(v)) {
+        if (Py_IS_INFINITY(v))
+            return v > 0 ? _PyHASH_INF : -_PyHASH_INF;
+        else
+            return _PyHASH_NAN;
+    }
+
+    m = frexp(v, &e);
+
+    sign = 1;
+    if (m < 0) {
+        sign = -1;
+        m = -m;
+    }
+
+    /* process 28 bits at a time;  this should work well both for binary
+       and hexadecimal floating point. */
+    x = 0;
+    while (m) {
+        x = ((x << 28) & _PyHASH_MODULUS) | x >> (_PyHASH_BITS - 28);
+        m *= 268435456.0;  /* 2**28 */
+        e -= 28;
+        y = (Py_uhash_t)m;  /* pull out integer part */
+        m -= y;
+        x += y;
+        if (x >= _PyHASH_MODULUS)
+            x -= _PyHASH_MODULUS;
+    }
+
+    /* adjust for the exponent;  first reduce it modulo _PyHASH_BITS */
+    e = e >= 0 ? e % _PyHASH_BITS : _PyHASH_BITS-1-((-1-e) % _PyHASH_BITS);
+    x = ((x << e) & _PyHASH_MODULUS) | x >> (_PyHASH_BITS - e);
+
+    x = x * sign;
+    if (x == (Py_uhash_t)-1)
+        x = (Py_uhash_t)-2;
+    return (Py_hash_t)x;
+}
+
+Py_hash_t
+_Py_HashPointer(void *p)
+{
+    Py_hash_t x;
+    size_t y = (size_t)p;
+    /* bottom 3 or 4 bits are likely to be 0; rotate y by 4 to avoid
+       excessive hash collisions for dicts and sets */
+    y = (y >> 4) | (y << (8 * SIZEOF_VOID_P - 4));
+    x = (Py_hash_t)y;
+    if (x == -1)
+        x = -2;
+    return x;
+}
+
+Py_hash_t
+_Py_HashBytes(const void *src, Py_ssize_t len)
+{
+    Py_hash_t x;
+    /*
+      We make the hash of the empty string be 0, rather than using
+      (prefix ^ suffix), since this slightly obfuscates the hash secret
+    */
+    if (len == 0) {
+        return 0;
+    }
+
+#ifdef Py_HASH_STATS
+    hashstats[(len <= Py_HASH_STATS_MAX) ? len : 0]++;
+#endif
+
+#if Py_HASH_CUTOFF > 0
+    if (len < Py_HASH_CUTOFF) {
+        /* Optimize hashing of very small strings with inline DJBX33A. */
+        Py_uhash_t hash;
+        const unsigned char *p = src;
+        hash = 5381; /* DJBX33A starts with 5381 */
+
+        switch(len) {
+            /* ((hash << 5) + hash) + *p == hash * 33 + *p */
+            case 7: hash = ((hash << 5) + hash) + *p++; /* fallthrough */
+            case 6: hash = ((hash << 5) + hash) + *p++; /* fallthrough */
+            case 5: hash = ((hash << 5) + hash) + *p++; /* fallthrough */
+            case 4: hash = ((hash << 5) + hash) + *p++; /* fallthrough */
+            case 3: hash = ((hash << 5) + hash) + *p++; /* fallthrough */
+            case 2: hash = ((hash << 5) + hash) + *p++; /* fallthrough */
+            case 1: hash = ((hash << 5) + hash) + *p++; break;
+            default:
+                assert(0);
+        }
+        hash ^= len;
+        hash ^= (Py_uhash_t) _Py_HashSecret.djbx33a.suffix;
+        x = (Py_hash_t)hash;
+    }
+    else
+#endif /* Py_HASH_CUTOFF */
+        x = PyHash_Func.hash(src, len);
+
+    if (x == -1)
+        return -2;
+    return x;
+}
+
+void
+_PyHash_Fini(void)
+{
+#ifdef Py_HASH_STATS
+    int i;
+    Py_ssize_t total = 0;
+    char *fmt = "%2i %8" PY_FORMAT_SIZE_T "d %8" PY_FORMAT_SIZE_T "d\n";
+
+    fprintf(stderr, "len   calls    total\n");
+    for (i = 1; i <= Py_HASH_STATS_MAX; i++) {
+        total += hashstats[i];
+        fprintf(stderr, fmt, i, hashstats[i], total);
+    }
+    total += hashstats[0];
+    fprintf(stderr, ">  %8" PY_FORMAT_SIZE_T "d %8" PY_FORMAT_SIZE_T "d\n",
+            hashstats[0], total);
+#endif
+}
+
+PyHash_FuncDef *
+PyHash_GetFuncDef(void)
+{
+    return &PyHash_Func;
+}
+
+/* Optimized memcpy() for Windows */
+#ifdef _MSC_VER
+#  if SIZEOF_PY_UHASH_T == 4
+#    define PY_UHASH_CPY(dst, src) do {                                    \
+       dst[0] = src[0]; dst[1] = src[1]; dst[2] = src[2]; dst[3] = src[3]; \
+       } while(0)
+#  elif SIZEOF_PY_UHASH_T == 8
+#    define PY_UHASH_CPY(dst, src) do {                                    \
+       dst[0] = src[0]; dst[1] = src[1]; dst[2] = src[2]; dst[3] = src[3]; \
+       dst[4] = src[4]; dst[5] = src[5]; dst[6] = src[6]; dst[7] = src[7]; \
+       } while(0)
+#  else
+#    error SIZEOF_PY_UHASH_T must be 4 or 8
+#  endif /* SIZEOF_PY_UHASH_T */
+#else /* not Windows */
+#  define PY_UHASH_CPY(dst, src) memcpy(dst, src, SIZEOF_PY_UHASH_T)
+#endif /* _MSC_VER */
+
+
+#if Py_HASH_ALGORITHM == Py_HASH_FNV
+/* **************************************************************************
+ * Modified Fowler-Noll-Vo (FNV) hash function
+ */
+static Py_hash_t
+fnv(const void *src, Py_ssize_t len)
+{
+    const unsigned char *p = src;
+    Py_uhash_t x;
+    Py_ssize_t remainder, blocks;
+    union {
+        Py_uhash_t value;
+        unsigned char bytes[SIZEOF_PY_UHASH_T];
+    } block;
+
+#ifdef Py_DEBUG
+    assert(_Py_HashSecret_Initialized);
+#endif
+    remainder = len % SIZEOF_PY_UHASH_T;
+    if (remainder == 0) {
+        /* Process at least one block byte by byte to reduce hash collisions
+         * for strings with common prefixes. */
+        remainder = SIZEOF_PY_UHASH_T;
+    }
+    blocks = (len - remainder) / SIZEOF_PY_UHASH_T;
+
+    x = (Py_uhash_t) _Py_HashSecret.fnv.prefix;
+    x ^= (Py_uhash_t) *p << 7;
+    while (blocks--) {
+        PY_UHASH_CPY(block.bytes, p);
+        x = (_PyHASH_MULTIPLIER * x) ^ block.value;
+        p += SIZEOF_PY_UHASH_T;
+    }
+    /* add remainder */
+    for (; remainder > 0; remainder--)
+        x = (_PyHASH_MULTIPLIER * x) ^ (Py_uhash_t) *p++;
+    x ^= (Py_uhash_t) len;
+    x ^= (Py_uhash_t) _Py_HashSecret.fnv.suffix;
+    if (x == -1) {
+        x = -2;
+    }
+    return x;
+}
+
+static PyHash_FuncDef PyHash_Func = {fnv, "fnv", 8 * SIZEOF_PY_HASH_T,
+                                     16 * SIZEOF_PY_HASH_T};
+
+#endif /* Py_HASH_ALGORITHM == Py_HASH_FNV */
+
+
+#if Py_HASH_ALGORITHM == Py_HASH_SIPHASH24
+/* **************************************************************************
+ <MIT License>
+ Copyright (c) 2013  Marek Majkowski <marek@popcount.org>
+
+ 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.
+ </MIT License>
+
+ Original location:
+    https://github.com/majek/csiphash/
+
+ Solution inspired by code from:
+    Samuel Neves (supercop/crypto_auth/siphash24/little)
+    djb (supercop/crypto_auth/siphash24/little2)
+    Jean-Philippe Aumasson (https://131002.net/siphash/siphash24.c)
+
+ Modified for Python by Christian Heimes:
+    - C89 / MSVC compatibility
+    - PY_UINT64_T, PY_UINT32_T and PY_UINT8_T
+    - _rotl64() on Windows
+    - letoh64() fallback
+*/
+
+typedef unsigned char PY_UINT8_T;
+
+/* byte swap little endian to host endian
+ * Endian conversion not only ensures that the hash function returns the same
+ * value on all platforms. It is also required to for a good dispersion of
+ * the hash values' least significant bits.
+ */
+#if PY_LITTLE_ENDIAN
+#  define _le64toh(x) ((PY_UINT64_T)(x))
+#elif defined(__APPLE__)
+#  define _le64toh(x) OSSwapLittleToHostInt64(x)
+#elif defined(HAVE_LETOH64)
+#  define _le64toh(x) le64toh(x)
+#else
+#  define _le64toh(x) (((PY_UINT64_T)(x) << 56) | \
+                      (((PY_UINT64_T)(x) << 40) & 0xff000000000000ULL) | \
+                      (((PY_UINT64_T)(x) << 24) & 0xff0000000000ULL) | \
+                      (((PY_UINT64_T)(x) << 8)  & 0xff00000000ULL) | \
+                      (((PY_UINT64_T)(x) >> 8)  & 0xff000000ULL) | \
+                      (((PY_UINT64_T)(x) >> 24) & 0xff0000ULL) | \
+                      (((PY_UINT64_T)(x) >> 40) & 0xff00ULL) | \
+                      ((PY_UINT64_T)(x)  >> 56))
+#endif
+
+
+#ifdef _MSC_VER
+#  define ROTATE(x, b)  _rotl64(x, b)
+#else
+#  define ROTATE(x, b) (PY_UINT64_T)( ((x) << (b)) | ( (x) >> (64 - (b))) )
+#endif
+
+#define HALF_ROUND(a,b,c,d,s,t)         \
+    a += b; c += d;             \
+    b = ROTATE(b, s) ^ a;           \
+    d = ROTATE(d, t) ^ c;           \
+    a = ROTATE(a, 32);
+
+#define DOUBLE_ROUND(v0,v1,v2,v3)       \
+    HALF_ROUND(v0,v1,v2,v3,13,16);      \
+    HALF_ROUND(v2,v1,v0,v3,17,21);      \
+    HALF_ROUND(v0,v1,v2,v3,13,16);      \
+    HALF_ROUND(v2,v1,v0,v3,17,21);
+
+
+static Py_hash_t
+siphash24(const void *src, Py_ssize_t src_sz) {
+    PY_UINT64_T k0 = _le64toh(_Py_HashSecret.siphash.k0);
+    PY_UINT64_T k1 = _le64toh(_Py_HashSecret.siphash.k1);
+    PY_UINT64_T b = (PY_UINT64_T)src_sz << 56;
+    const PY_UINT64_T *in = (PY_UINT64_T*)src;
+
+    PY_UINT64_T v0 = k0 ^ 0x736f6d6570736575ULL;
+    PY_UINT64_T v1 = k1 ^ 0x646f72616e646f6dULL;
+    PY_UINT64_T v2 = k0 ^ 0x6c7967656e657261ULL;
+    PY_UINT64_T v3 = k1 ^ 0x7465646279746573ULL;
+
+    PY_UINT64_T t;
+    PY_UINT8_T *pt;
+    PY_UINT8_T *m;
+
+    while (src_sz >= 8) {
+        PY_UINT64_T mi = _le64toh(*in);
+        in += 1;
+        src_sz -= 8;
+        v3 ^= mi;
+        DOUBLE_ROUND(v0,v1,v2,v3);
+        v0 ^= mi;
+    }
+
+    t = 0;
+    pt = (PY_UINT8_T *)&t;
+    m = (PY_UINT8_T *)in;
+    switch (src_sz) {
+        case 7: pt[6] = m[6];
+        case 6: pt[5] = m[5];
+        case 5: pt[4] = m[4];
+        case 4: Py_MEMCPY(pt, m, sizeof(PY_UINT32_T)); break;
+        case 3: pt[2] = m[2];
+        case 2: pt[1] = m[1];
+        case 1: pt[0] = m[0];
+    }
+    b |= _le64toh(t);
+
+    v3 ^= b;
+    DOUBLE_ROUND(v0,v1,v2,v3);
+    v0 ^= b;
+    v2 ^= 0xff;
+    DOUBLE_ROUND(v0,v1,v2,v3);
+    DOUBLE_ROUND(v0,v1,v2,v3);
+
+    /* modified */
+    t = (v0 ^ v1) ^ (v2 ^ v3);
+    return (Py_hash_t)t;
+}
+
+static PyHash_FuncDef PyHash_Func = {siphash24, "siphash24", 64, 128};
+
+#endif /* Py_HASH_ALGORITHM == Py_HASH_SIPHASH24 */
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/Python/pystate.c b/Python/pystate.c
index 772aa53..2ac2fd5 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -6,11 +6,11 @@
 /* --------------------------------------------------------------------------
 CAUTION
 
-Always use malloc() and free() directly in this file.  A number of these
-functions are advertised as safe to call when the GIL isn't held, and in
-a debug build Python redirects (e.g.) PyMem_NEW (etc) to Python's debugging
-obmalloc functions.  Those aren't thread-safe (they rely on the GIL to avoid
-the expense of doing their own locking).
+Always use PyMem_RawMalloc() and PyMem_RawFree() directly in this file.  A
+number of these functions are advertised as safe to call when the GIL isn't
+held, and in a debug build Python redirects (e.g.) PyMem_NEW (etc) to Python's
+debugging obmalloc functions.  Those aren't thread-safe (they rely on the GIL
+to avoid the expense of doing their own locking).
 -------------------------------------------------------------------------- */
 
 #ifdef HAVE_DLOPEN
@@ -60,7 +60,7 @@
 PyInterpreterState_New(void)
 {
     PyInterpreterState *interp = (PyInterpreterState *)
-                                 malloc(sizeof(PyInterpreterState));
+                                 PyMem_RawMalloc(sizeof(PyInterpreterState));
 
     if (interp != NULL) {
         HEAD_INIT();
@@ -72,6 +72,7 @@
         interp->modules_by_index = NULL;
         interp->sysdict = NULL;
         interp->builtins = NULL;
+        interp->builtins_copy = NULL;
         interp->tstate_head = NULL;
         interp->codec_search_path = NULL;
         interp->codec_search_cache = NULL;
@@ -115,6 +116,7 @@
     Py_CLEAR(interp->modules_by_index);
     Py_CLEAR(interp->sysdict);
     Py_CLEAR(interp->builtins);
+    Py_CLEAR(interp->builtins_copy);
     Py_CLEAR(interp->importlib);
 }
 
@@ -148,7 +150,7 @@
         Py_FatalError("PyInterpreterState_Delete: remaining threads");
     *p = interp->next;
     HEAD_UNLOCK();
-    free(interp);
+    PyMem_RawFree(interp);
 #ifdef WITH_THREAD
     if (interp_head == NULL && head_mutex != NULL) {
         PyThread_free_lock(head_mutex);
@@ -168,7 +170,7 @@
 static PyThreadState *
 new_threadstate(PyInterpreterState *interp, int init)
 {
-    PyThreadState *tstate = (PyThreadState *)malloc(sizeof(PyThreadState));
+    PyThreadState *tstate = (PyThreadState *)PyMem_RawMalloc(sizeof(PyThreadState));
 
     if (_PyThreadState_GetFrame == NULL)
         _PyThreadState_GetFrame = threadstate_getframe;
@@ -182,7 +184,6 @@
         tstate->recursion_critical = 0;
         tstate->tracing = 0;
         tstate->use_tracing = 0;
-        tstate->tick_counter = 0;
         tstate->gilstate_counter = 0;
         tstate->async_exc = NULL;
 #ifdef WITH_THREAD
@@ -208,12 +209,17 @@
 
         tstate->trash_delete_nesting = 0;
         tstate->trash_delete_later = NULL;
+        tstate->on_delete = NULL;
+        tstate->on_delete_data = NULL;
 
         if (init)
             _PyThreadState_Init(tstate);
 
         HEAD_LOCK();
+        tstate->prev = NULL;
         tstate->next = interp->tstate_head;
+        if (tstate->next)
+            tstate->next->prev = tstate;
         interp->tstate_head = tstate;
         HEAD_UNLOCK();
     }
@@ -317,6 +323,31 @@
     return PyList_SetItem(state->modules_by_index, index, Py_None);
 }
 
+/* used by import.c:PyImport_Cleanup */
+void
+_PyState_ClearModules(void)
+{
+    PyInterpreterState *state = PyThreadState_GET()->interp;
+    if (state->modules_by_index) {
+        Py_ssize_t i;
+        for (i = 0; i < PyList_GET_SIZE(state->modules_by_index); i++) {
+            PyObject *m = PyList_GET_ITEM(state->modules_by_index, i);
+            if (PyModule_Check(m)) {
+                /* cleanup the saved copy of module dicts */
+                PyModuleDef *md = PyModule_GetDef(m);
+                if (md)
+                    Py_CLEAR(md->m_base.m_copy);
+            }
+        }
+        /* Setting modules_by_index to NULL could be dangerous, so we
+           clear the list instead. */
+        if (PyList_SetSlice(state->modules_by_index,
+                            0, PyList_GET_SIZE(state->modules_by_index),
+                            NULL))
+            PyErr_WriteUnraisable(state->modules_by_index);
+    }
+}
+
 void
 PyThreadState_Clear(PyThreadState *tstate)
 {
@@ -349,37 +380,23 @@
 tstate_delete_common(PyThreadState *tstate)
 {
     PyInterpreterState *interp;
-    PyThreadState **p;
-    PyThreadState *prev_p = NULL;
     if (tstate == NULL)
         Py_FatalError("PyThreadState_Delete: NULL tstate");
     interp = tstate->interp;
     if (interp == NULL)
         Py_FatalError("PyThreadState_Delete: NULL interp");
     HEAD_LOCK();
-    for (p = &interp->tstate_head; ; p = &(*p)->next) {
-        if (*p == NULL)
-            Py_FatalError(
-                "PyThreadState_Delete: invalid tstate");
-        if (*p == tstate)
-            break;
-        /* Sanity check.  These states should never happen but if
-         * they do we must abort.  Otherwise we'll end up spinning in
-         * in a tight loop with the lock held.  A similar check is done
-         * in thread.c find_key().  */
-        if (*p == prev_p)
-            Py_FatalError(
-                "PyThreadState_Delete: small circular list(!)"
-                " and tstate not found.");
-        prev_p = *p;
-        if ((*p)->next == interp->tstate_head)
-            Py_FatalError(
-                "PyThreadState_Delete: circular list(!) and"
-                " tstate not found.");
-    }
-    *p = tstate->next;
+    if (tstate->prev)
+        tstate->prev->next = tstate->next;
+    else
+        interp->tstate_head = tstate->next;
+    if (tstate->next)
+        tstate->next->prev = tstate->prev;
     HEAD_UNLOCK();
-    free(tstate);
+    if (tstate->on_delete != NULL) {
+        tstate->on_delete(tstate->on_delete_data);
+    }
+    PyMem_RawFree(tstate);
 }
 
 
@@ -414,6 +431,43 @@
 #endif /* WITH_THREAD */
 
 
+/*
+ * Delete all thread states except the one passed as argument.
+ * Note that, if there is a current thread state, it *must* be the one
+ * passed as argument.  Also, this won't touch any other interpreters
+ * than the current one, since we don't know which thread state should
+ * be kept in those other interpreteres.
+ */
+void
+_PyThreadState_DeleteExcept(PyThreadState *tstate)
+{
+    PyInterpreterState *interp = tstate->interp;
+    PyThreadState *p, *next, *garbage;
+    HEAD_LOCK();
+    /* Remove all thread states, except tstate, from the linked list of
+       thread states.  This will allow calling PyThreadState_Clear()
+       without holding the lock. */
+    garbage = interp->tstate_head;
+    if (garbage == tstate)
+        garbage = tstate->next;
+    if (tstate->prev)
+        tstate->prev->next = tstate->next;
+    if (tstate->next)
+        tstate->next->prev = tstate->prev;
+    tstate->prev = tstate->next = NULL;
+    interp->tstate_head = tstate;
+    HEAD_UNLOCK();
+    /* Clear and deallocate all stale thread states.  Even if this
+       executes Python code, we should be safe since it executes
+       in the current thread, not one of the stale threads. */
+    for (p = garbage; p; p = next) {
+        next = p->next;
+        PyThreadState_Clear(p);
+        PyMem_RawFree(p);
+    }
+}
+
+
 PyThreadState *
 PyThreadState_Get(void)
 {
@@ -671,18 +725,18 @@
 
        The only situation where you can legitimately have more than one
        thread state for an OS level thread is when there are multiple
-       interpreters, when:
+       interpreters.
 
-           a) You shouldn't really be using the PyGILState_ APIs anyway,
-          and:
+       You shouldn't really be using the PyGILState_ APIs anyway (see issues
+       #10915 and #15751).
 
-           b) The slightly odd way PyThread_set_key_value works (see
-          comments by its implementation) means that the first thread
-          state created for that given OS level thread will "win",
-          which seems reasonable behaviour.
+       The first thread state created for that given OS level thread will
+       "win", which seems reasonable behaviour.
     */
-    if (PyThread_set_key_value(autoTLSkey, (void *)tstate) < 0)
-        Py_FatalError("Couldn't create autoTLSkey mapping");
+    if (PyThread_get_key_value(autoTLSkey) == NULL) {
+        if (PyThread_set_key_value(autoTLSkey, (void *)tstate) < 0)
+            Py_FatalError("Couldn't create autoTLSkey mapping");
+    }
 
     /* PyGILState_Release must not try to delete this thread state. */
     tstate->gilstate_counter = 1;
@@ -697,6 +751,15 @@
     return (PyThreadState *)PyThread_get_key_value(autoTLSkey);
 }
 
+int
+PyGILState_Check(void)
+{
+    /* can't use PyThreadState_Get() since it will assert that it has the GIL */
+    PyThreadState *tstate = (PyThreadState*)_Py_atomic_load_relaxed(
+        &_PyThreadState_Current);
+    return tstate && (tstate == PyGILState_GetThisThreadState());
+}
+
 PyGILState_STATE
 PyGILState_Ensure(void)
 {
@@ -710,6 +773,11 @@
     assert(autoInterpreterState); /* Py_Initialize() hasn't been called! */
     tcur = (PyThreadState *)PyThread_get_key_value(autoTLSkey);
     if (tcur == NULL) {
+        /* At startup, Python has no concrete GIL. If PyGILState_Ensure() is
+           called from a new thread for the first time, we need the create the
+           GIL. */
+        PyEval_InitThreads();
+
         /* Create a new thread state for this thread */
         tcur = PyThreadState_New(autoInterpreterState);
         if (tcur == NULL)
diff --git a/Python/pystrtod.c b/Python/pystrtod.c
index 4ab8f08..209c908 100644
--- a/Python/pystrtod.c
+++ b/Python/pystrtod.c
@@ -164,7 +164,7 @@
 _PyOS_ascii_strtod(const char *nptr, char **endptr)
 {
     char *fail_pos;
-    double val = -1.0;
+    double val;
     struct lconv *locale_data;
     const char *decimal_point;
     size_t decimal_point_len;
@@ -325,7 +325,7 @@
 
    On overflow (e.g., when trying to convert '1e500' on an IEEE 754 machine),
    if overflow_exception is NULL then +-Py_HUGE_VAL is returned, and no Python
-   exception is raised.  Otherwise, overflow_exception should point to a
+   exception is raised.  Otherwise, overflow_exception should point to
    a Python exception, this exception will be raised, -1.0 will be returned,
    and *endptr will point just past the end of the converted value.
 
@@ -923,7 +923,7 @@
 
 static char *
 format_float_short(double d, char format_code,
-                   int mode, Py_ssize_t precision,
+                   int mode, int precision,
                    int always_add_sign, int add_dot_0_if_integer,
                    int use_alt_formatting, char **float_strings, int *type)
 {
@@ -1059,7 +1059,7 @@
     /* if using an exponent, reset decimal point position to 1 and adjust
        exponent accordingly.*/
     if (use_exp) {
-        exp = decpt - 1;
+        exp = (int)decpt - 1;
         decpt = 1;
     }
     /* ensure vdigits_start < decpt <= vdigits_end, or vdigits_start <
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 91d56b7..0327830 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -35,12 +35,46 @@
 #define PATH_MAX MAXPATHLEN
 #endif
 
+#ifdef __gnu_hurd__
+#define PATH_MAX MAXPATHLEN
+#endif
+
+_Py_IDENTIFIER(builtins);
+_Py_IDENTIFIER(excepthook);
+_Py_IDENTIFIER(flush);
+_Py_IDENTIFIER(last_traceback);
+_Py_IDENTIFIER(last_type);
+_Py_IDENTIFIER(last_value);
+_Py_IDENTIFIER(name);
+_Py_IDENTIFIER(ps1);
+_Py_IDENTIFIER(ps2);
+_Py_IDENTIFIER(stdin);
+_Py_IDENTIFIER(stdout);
+_Py_IDENTIFIER(stderr);
+_Py_static_string(PyId_string, "<string>");
+
+#ifdef Py_REF_DEBUG
+static
+void _print_total_refs(void) {
+    PyObject *xoptions, *value;
+    _Py_IDENTIFIER(showrefcount);
+
+    xoptions = PySys_GetXOptions();
+    if (xoptions == NULL)
+        return;
+    value = _PyDict_GetItemId(xoptions, &PyId_showrefcount);
+    if (value == Py_True)
+        fprintf(stderr,
+                "[%" PY_FORMAT_SIZE_T "d refs, "
+                "%" PY_FORMAT_SIZE_T "d blocks]\n",
+                _Py_GetRefTotal(), _Py_GetAllocatedBlocks());
+}
+#endif
+
 #ifndef Py_REF_DEBUG
 #define PRINT_TOTAL_REFS()
 #else /* Py_REF_DEBUG */
-#define PRINT_TOTAL_REFS() fprintf(stderr,                              \
-                   "[%" PY_FORMAT_SIZE_T "d refs]\n",                   \
-                   _Py_GetRefTotal())
+#define PRINT_TOTAL_REFS() _print_total_refs()
 #endif
 
 #ifdef __cplusplus
@@ -57,7 +91,7 @@
 static void initsite(void);
 static int initstdio(void);
 static void flush_io(void);
-static PyObject *run_mod(mod_ty, const char *, PyObject *, PyObject *,
+static PyObject *run_mod(mod_ty, PyObject *, PyObject *, PyObject *,
                           PyCompilerFlags *, PyArena *);
 static PyObject *run_pyc_file(FILE *, const char *, PyObject *, PyObject *,
                               PyCompilerFlags *);
@@ -68,11 +102,15 @@
 static void wait_for_thread_shutdown(void);
 static void call_ll_exitfuncs(void);
 extern int _PyUnicode_Init(void);
+extern int _PyStructSequence_Init(void);
 extern void _PyUnicode_Fini(void);
 extern int _PyLong_Init(void);
 extern void PyLong_Fini(void);
 extern int _PyFaulthandler_Init(void);
 extern void _PyFaulthandler_Fini(void);
+extern void _PyHash_Fini(void);
+extern int _PyTraceMalloc_Init(void);
+extern int _PyTraceMalloc_Fini(void);
 
 #ifdef WITH_THREAD
 extern void _PyGILState_Init(PyInterpreterState *, PyThreadState *);
@@ -93,6 +131,7 @@
 int Py_NoUserSiteDirectory = 0; /* for -s and site.py */
 int Py_UnbufferedStdioFlag = 0; /* Unbuffered binary std{in,out,err} */
 int Py_HashRandomizationFlag = 0; /* for -R and PYTHONHASHSEED */
+int Py_IsolatedFlag = 0; /* for -I, isolate from user's env */
 
 PyThreadState *_Py_Finalizing = NULL;
 
@@ -118,6 +157,45 @@
     return initialized;
 }
 
+/* Helper to allow an embedding application to override the normal
+ * mechanism that attempts to figure out an appropriate IO encoding
+ */
+
+static char *_Py_StandardStreamEncoding = NULL;
+static char *_Py_StandardStreamErrors = NULL;
+
+int
+Py_SetStandardStreamEncoding(const char *encoding, const char *errors)
+{
+    if (Py_IsInitialized()) {
+        /* This is too late to have any effect */
+        return -1;
+    }
+    /* Can't call PyErr_NoMemory() on errors, as Python hasn't been
+     * initialised yet.
+     *
+     * However, the raw memory allocators are initialised appropriately
+     * as C static variables, so _PyMem_RawStrdup is OK even though
+     * Py_Initialize hasn't been called yet.
+     */
+    if (encoding) {
+        _Py_StandardStreamEncoding = _PyMem_RawStrdup(encoding);
+        if (!_Py_StandardStreamEncoding) {
+            return -2;
+        }
+    }
+    if (errors) {
+        _Py_StandardStreamErrors = _PyMem_RawStrdup(errors);
+        if (!_Py_StandardStreamErrors) {
+            if (_Py_StandardStreamEncoding) {
+                PyMem_RawFree(_Py_StandardStreamEncoding);
+            }
+            return -3;
+        }
+    }
+    return 0;
+}
+
 /* Global initializations.  Can be undone by Py_Finalize().  Don't
    call this twice without an intervening Py_Finalize() call.  When
    initializations fail, a fatal error is issued and the function does
@@ -146,7 +224,6 @@
 {
     char *name_utf8, *name_str;
     PyObject *codec, *name = NULL;
-    _Py_IDENTIFIER(name);
 
     codec = _PyCodec_Lookup(encoding);
     if (!codec)
@@ -160,7 +237,7 @@
     name_utf8 = _PyUnicode_AsString(name);
     if (name_utf8 == NULL)
         goto error;
-    name_str = strdup(name_utf8);
+    name_str = _PyMem_RawStrdup(name_utf8);
     Py_DECREF(name);
     if (name_str == NULL) {
         PyErr_NoMemory();
@@ -313,7 +390,8 @@
     if (!PyByteArray_Init())
         Py_FatalError("Py_Initialize: can't init bytearray");
 
-    _PyFloat_Init();
+    if (!_PyFloat_Init())
+        Py_FatalError("Py_Initialize: can't init float");
 
     interp->modules = PyDict_New();
     if (interp->modules == NULL)
@@ -322,6 +400,8 @@
     /* Init Unicode implementation; relies on the codec registry */
     if (_PyUnicode_Init() < 0)
         Py_FatalError("Py_Initialize: can't initialize unicode");
+    if (_PyStructSequence_Init() < 0)
+        Py_FatalError("Py_Initialize: can't initialize structseq");
 
     bimod = _PyBuiltin_Init();
     if (bimod == NULL)
@@ -352,7 +432,7 @@
     pstderr = PyFile_NewStdPrinter(fileno(stderr));
     if (pstderr == NULL)
         Py_FatalError("Py_Initialize: can't set preliminary stderr");
-    PySys_SetObject("stderr", pstderr);
+    _PySys_SetObjectId(&PyId_stderr, pstderr);
     PySys_SetObject("__stderr__", pstderr);
     Py_DECREF(pstderr);
 
@@ -380,6 +460,9 @@
     if (install_sigs)
         initsigs(); /* Signal handling stuff, including initintr() */
 
+    if (_PyTraceMalloc_Init() < 0)
+        Py_FatalError("Py_Initialize: can't initialize tracemalloc");
+
     initmain(interp); /* Module __main__ */
     if (initstdio() < 0)
         Py_FatalError(
@@ -437,10 +520,9 @@
 static void
 flush_std_files(void)
 {
-    PyObject *fout = PySys_GetObject("stdout");
-    PyObject *ferr = PySys_GetObject("stderr");
+    PyObject *fout = _PySys_GetObjectId(&PyId_stdout);
+    PyObject *ferr = _PySys_GetObjectId(&PyId_stderr);
     PyObject *tmp;
-    _Py_IDENTIFIER(flush);
 
     if (fout != NULL && fout != Py_None && !file_is_closed(fout)) {
         tmp = _PyObject_CallMethodId(fout, &PyId_flush, "");
@@ -530,10 +612,6 @@
     while (PyGC_Collect() > 0)
         /* nothing */;
 #endif
-    /* We run this while most interpreter state is still alive, so that
-       debug information can be printed out */
-    _PyGC_Fini();
-
     /* Destroy all modules */
     PyImport_Cleanup();
 
@@ -559,6 +637,10 @@
     PyGC_Collect();
 #endif
 
+    /* Disable tracemalloc after all Python objects have been destroyed,
+       so it is possible to use tracemalloc in objects destructor. */
+    _PyTraceMalloc_Fini();
+
     /* Destroy the database used by _PyImport_{Fixup,Find}Extension */
     _PyImport_Fini();
 
@@ -572,6 +654,8 @@
 #ifdef COUNT_ALLOCS
     dump_counts(stdout);
 #endif
+    /* dump hash stats */
+    _PyHash_Fini();
 
     PRINT_TOTAL_REFS();
 
@@ -596,11 +680,6 @@
 
     _PyExc_Fini();
 
-    /* Cleanup auto-thread-state */
-#ifdef WITH_THREAD
-    _PyGILState_Fini();
-#endif /* WITH_THREAD */
-
     /* Sundry finalizers */
     PyMethod_Fini();
     PyFrame_Fini();
@@ -614,17 +693,15 @@
     PyFloat_Fini();
     PyDict_Fini();
     PySlice_Fini();
+    _PyGC_Fini();
+    _PyRandom_Fini();
 
     /* Cleanup Unicode implementation */
     _PyUnicode_Fini();
 
-    /* Delete current thread. After this, many C API calls become crashy. */
-    PyThreadState_Swap(NULL);
-    PyInterpreterState_Delete(interp);
-
     /* reset file system default encoding */
     if (!Py_HasFileSystemDefaultEncoding && Py_FileSystemDefaultEncoding) {
-        free((char*)Py_FileSystemDefaultEncoding);
+        PyMem_RawFree((char*)Py_FileSystemDefaultEncoding);
         Py_FileSystemDefaultEncoding = NULL;
     }
 
@@ -636,6 +713,15 @@
 
     PyGrammar_RemoveAccelerators(&_PyParser_Grammar);
 
+    /* Cleanup auto-thread-state */
+#ifdef WITH_THREAD
+    _PyGILState_Fini();
+#endif /* WITH_THREAD */
+
+    /* Delete current thread. After this, many C API calls become crashy. */
+    PyThreadState_Swap(NULL);
+    PyInterpreterState_Delete(interp);
+
 #ifdef Py_TRACE_REFS
     /* Display addresses (& refcnts) of all objects still alive.
      * An address can be used to find the repr of the object, printed
@@ -718,7 +804,7 @@
         pstderr = PyFile_NewStdPrinter(fileno(stderr));
         if (pstderr == NULL)
             Py_FatalError("Py_Initialize: can't set preliminary stderr");
-        PySys_SetObject("stderr", pstderr);
+        _PySys_SetObjectId(&PyId_stderr, pstderr);
         PySys_SetObject("__stderr__", pstderr);
         Py_DECREF(pstderr);
 
@@ -773,6 +859,9 @@
         Py_FatalError("Py_EndInterpreter: thread is not current");
     if (tstate->frame != NULL)
         Py_FatalError("Py_EndInterpreter: thread still has a frame");
+
+    wait_for_thread_shutdown();
+
     if (tstate != interp->tstate_head || tstate->next != NULL)
         Py_FatalError("Py_EndInterpreter: not the last thread");
 
@@ -802,7 +891,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)
@@ -832,7 +921,7 @@
 static void
 initmain(PyInterpreterState *interp)
 {
-    PyObject *m, *d;
+    PyObject *m, *d, *loader;
     m = PyImport_AddModule("__main__");
     if (m == NULL)
         Py_FatalError("can't create __main__ module");
@@ -853,7 +942,8 @@
      * be set if __main__ gets further initialized later in the startup
      * process.
      */
-    if (PyDict_GetItemString(d, "__loader__") == NULL) {
+    loader = PyDict_GetItemString(d, "__loader__");
+    if (loader == NULL || loader == Py_None) {
         PyObject *loader = PyObject_GetAttrString(interp->importlib,
                                                   "BuiltinImporter");
         if (loader == NULL) {
@@ -903,6 +993,7 @@
     PyObject *m;
     m = PyImport_ImportModule("site");
     if (m == NULL) {
+        fprintf(stderr, "Failed to import the site module\n");
         PyErr_Print();
         Py_Finalize();
         exit(1);
@@ -925,7 +1016,6 @@
     _Py_IDENTIFIER(open);
     _Py_IDENTIFIER(isatty);
     _Py_IDENTIFIER(TextIOWrapper);
-    _Py_IDENTIFIER(name);
     _Py_IDENTIFIER(mode);
 
     /* stdin is always opened in buffered mode, first because it shouldn't
@@ -1035,7 +1125,7 @@
     PyObject *std = NULL;
     int status = 0, fd;
     PyObject * encoding_attr;
-    char *encoding = NULL, *errors;
+    char *pythonioencoding = NULL, *encoding, *errors;
 
     /* Hack to avoid a nasty recursion issue when Python is invoked
        in verbose mode: pre-import the Latin-1 and UTF-8 codecs */
@@ -1067,14 +1157,28 @@
     }
     Py_DECREF(wrapper);
 
-    encoding = Py_GETENV("PYTHONIOENCODING");
-    errors = NULL;
-    if (encoding) {
-        encoding = strdup(encoding);
-        errors = strchr(encoding, ':');
-        if (errors) {
-            *errors = '\0';
-            errors++;
+    encoding = _Py_StandardStreamEncoding;
+    errors = _Py_StandardStreamErrors;
+    if (!encoding || !errors) {
+        pythonioencoding = Py_GETENV("PYTHONIOENCODING");
+        if (pythonioencoding) {
+            char *err;
+            pythonioencoding = _PyMem_Strdup(pythonioencoding);
+            if (pythonioencoding == NULL) {
+                PyErr_NoMemory();
+                goto error;
+            }
+            err = strchr(pythonioencoding, ':');
+            if (err) {
+                *err = '\0';
+                err++;
+                if (*err && !errors) {
+                    errors = err;
+                }
+            }
+            if (*pythonioencoding && !encoding) {
+                encoding = pythonioencoding;
+            }
         }
     }
 
@@ -1094,7 +1198,7 @@
             goto error;
     } /* if (fd < 0) */
     PySys_SetObject("__stdin__", std);
-    PySys_SetObject("stdin", std);
+    _PySys_SetObjectId(&PyId_stdin, std);
     Py_DECREF(std);
 
     /* Set sys.stdout */
@@ -1109,7 +1213,7 @@
             goto error;
     } /* if (fd < 0) */
     PySys_SetObject("__stdout__", std);
-    PySys_SetObject("stdout", std);
+    _PySys_SetObjectId(&PyId_stdout, std);
     Py_DECREF(std);
 
 #if 1 /* Disable this if you have trouble debugging bootstrap stuff */
@@ -1129,18 +1233,24 @@
        when import.c tries to write to stderr in verbose mode. */
     encoding_attr = PyObject_GetAttrString(std, "encoding");
     if (encoding_attr != NULL) {
-        const char * encoding;
-        encoding = _PyUnicode_AsString(encoding_attr);
-        if (encoding != NULL) {
-            PyObject *codec_info = _PyCodec_Lookup(encoding);
+        const char * std_encoding;
+        std_encoding = _PyUnicode_AsString(encoding_attr);
+        if (std_encoding != NULL) {
+            PyObject *codec_info = _PyCodec_Lookup(std_encoding);
             Py_XDECREF(codec_info);
         }
         Py_DECREF(encoding_attr);
     }
     PyErr_Clear();  /* Not a fatal error if codec isn't available */
 
-    PySys_SetObject("__stderr__", std);
-    PySys_SetObject("stderr", std);
+    if (PySys_SetObject("__stderr__", std) < 0) {
+        Py_DECREF(std);
+        goto error;
+    }
+    if (_PySys_SetObjectId(&PyId_stderr, std) < 0) {
+        Py_DECREF(std);
+        goto error;
+    }
     Py_DECREF(std);
 #endif
 
@@ -1149,8 +1259,16 @@
         status = -1;
     }
 
-    if (encoding)
-        free(encoding);
+    /* We won't need them anymore. */
+    if (_Py_StandardStreamEncoding) {
+        PyMem_RawFree(_Py_StandardStreamEncoding);
+        _Py_StandardStreamEncoding = NULL;
+    }
+    if (_Py_StandardStreamErrors) {
+        PyMem_RawFree(_Py_StandardStreamErrors);
+        _Py_StandardStreamErrors = NULL;
+    }
+    PyMem_Free(pythonioencoding);
     Py_XDECREF(bimod);
     Py_XDECREF(iomod);
     return status;
@@ -1175,36 +1293,47 @@
 }
 
 int
-PyRun_InteractiveLoopFlags(FILE *fp, const char *filename, PyCompilerFlags *flags)
+PyRun_InteractiveLoopFlags(FILE *fp, const char *filename_str, PyCompilerFlags *flags)
 {
-    PyObject *v;
-    int ret;
+    PyObject *filename, *v;
+    int ret, err;
     PyCompilerFlags local_flags;
 
+    filename = PyUnicode_DecodeFSDefault(filename_str);
+    if (filename == NULL) {
+        PyErr_Print();
+        return -1;
+    }
+
     if (flags == NULL) {
         flags = &local_flags;
         local_flags.cf_flags = 0;
     }
-    v = PySys_GetObject("ps1");
+    v = _PySys_GetObjectId(&PyId_ps1);
     if (v == NULL) {
-        PySys_SetObject("ps1", v = PyUnicode_FromString(">>> "));
+        _PySys_SetObjectId(&PyId_ps1, v = PyUnicode_FromString(">>> "));
         Py_XDECREF(v);
     }
-    v = PySys_GetObject("ps2");
+    v = _PySys_GetObjectId(&PyId_ps2);
     if (v == NULL) {
-        PySys_SetObject("ps2", v = PyUnicode_FromString("... "));
+        _PySys_SetObjectId(&PyId_ps2, v = PyUnicode_FromString("... "));
         Py_XDECREF(v);
     }
+    err = -1;
     for (;;) {
-        ret = PyRun_InteractiveOneFlags(fp, filename, flags);
+        ret = PyRun_InteractiveOneObject(fp, filename, flags);
         PRINT_TOTAL_REFS();
-        if (ret == E_EOF)
-            return 0;
+        if (ret == E_EOF) {
+            err = 0;
+            break;
+        }
         /*
         if (ret == E_NOMEM)
-            return -1;
+            break;
         */
     }
+    Py_DECREF(filename);
+    return err;
 }
 
 /* compute parser flags based on compiler flags */
@@ -1232,18 +1361,25 @@
 #endif
 
 int
-PyRun_InteractiveOneFlags(FILE *fp, const char *filename, PyCompilerFlags *flags)
+PyRun_InteractiveOneObject(FILE *fp, PyObject *filename, PyCompilerFlags *flags)
 {
-    PyObject *m, *d, *v, *w, *oenc = NULL;
+    PyObject *m, *d, *v, *w, *oenc = NULL, *mod_name;
     mod_ty mod;
     PyArena *arena;
     char *ps1 = "", *ps2 = "", *enc = NULL;
     int errcode = 0;
     _Py_IDENTIFIER(encoding);
+    _Py_IDENTIFIER(__main__);
+
+    mod_name = _PyUnicode_FromId(&PyId___main__); /* borrowed */
+    if (mod_name == NULL) {
+        PyErr_Print();
+        return -1;
+    }
 
     if (fp == stdin) {
         /* Fetch encoding from sys.stdin if possible. */
-        v = PySys_GetObject("stdin");
+        v = _PySys_GetObjectId(&PyId_stdin);
         if (v && v != Py_None) {
             oenc = _PyObject_GetAttrId(v, &PyId_encoding);
             if (oenc)
@@ -1252,7 +1388,7 @@
                 PyErr_Clear();
         }
     }
-    v = PySys_GetObject("ps1");
+    v = _PySys_GetObjectId(&PyId_ps1);
     if (v != NULL) {
         v = PyObject_Str(v);
         if (v == NULL)
@@ -1265,7 +1401,7 @@
             }
         }
     }
-    w = PySys_GetObject("ps2");
+    w = _PySys_GetObjectId(&PyId_ps2);
     if (w != NULL) {
         w = PyObject_Str(w);
         if (w == NULL)
@@ -1285,9 +1421,9 @@
         Py_XDECREF(oenc);
         return -1;
     }
-    mod = PyParser_ASTFromFile(fp, filename, enc,
-                               Py_single_input, ps1, ps2,
-                               flags, &errcode, arena);
+    mod = PyParser_ASTFromFileObject(fp, filename, enc,
+                                     Py_single_input, ps1, ps2,
+                                     flags, &errcode, arena);
     Py_XDECREF(v);
     Py_XDECREF(w);
     Py_XDECREF(oenc);
@@ -1300,7 +1436,7 @@
         PyErr_Print();
         return -1;
     }
-    m = PyImport_AddModule("__main__");
+    m = PyImport_AddModuleObject(mod_name);
     if (m == NULL) {
         PyArena_Free(arena);
         return -1;
@@ -1308,15 +1444,33 @@
     d = PyModule_GetDict(m);
     v = run_mod(mod, filename, d, d, flags, arena);
     PyArena_Free(arena);
-    flush_io();
     if (v == NULL) {
         PyErr_Print();
+        flush_io();
         return -1;
     }
     Py_DECREF(v);
+    flush_io();
     return 0;
 }
 
+int
+PyRun_InteractiveOneFlags(FILE *fp, const char *filename_str, PyCompilerFlags *flags)
+{
+    PyObject *filename;
+    int res;
+
+    filename = PyUnicode_DecodeFSDefault(filename_str);
+    if (filename == NULL) {
+        PyErr_Print();
+        return -1;
+    }
+    res = PyRun_InteractiveOneObject(fp, filename, flags);
+    Py_DECREF(filename);
+    return res;
+}
+
+
 /* Check whether a file maybe a pyc file: Look at the extension,
    the file type, and, if we may close it, at the first few bytes. */
 
@@ -1357,8 +1511,8 @@
     return 0;
 }
 
-int
-static set_main_loader(PyObject *d, const char *filename, const char *loader_name)
+static int
+set_main_loader(PyObject *d, const char *filename, const char *loader_name)
 {
     PyInterpreterState *interp;
     PyThreadState *tstate;
@@ -1425,7 +1579,7 @@
         /* Try to run a pyc file. First, re-open in binary */
         if (closeit)
             fclose(fp);
-        if ((pyc_fp = fopen(filename, "rb")) == NULL) {
+        if ((pyc_fp = _Py_fopen(filename, "rb")) == NULL) {
             fprintf(stderr, "python: Can't reopen .pyc file\n");
             goto done;
         }
@@ -1484,8 +1638,8 @@
 }
 
 static int
-parse_syntax_error(PyObject *err, PyObject **message, const char **filename,
-                   int *lineno, int *offset, const char **text)
+parse_syntax_error(PyObject *err, PyObject **message, PyObject **filename,
+                   int *lineno, int *offset, PyObject **text)
 {
     long hold;
     PyObject *v;
@@ -1496,6 +1650,7 @@
     _Py_IDENTIFIER(text);
 
     *message = NULL;
+    *filename = NULL;
 
     /* new style errors.  `err' is an instance */
     *message = _PyObject_GetAttrId(err, &PyId_msg);
@@ -1507,13 +1662,13 @@
         goto finally;
     if (v == Py_None) {
         Py_DECREF(v);
-        *filename = NULL;
+        *filename = _PyUnicode_FromId(&PyId_string);
+        if (*filename == NULL)
+            goto finally;
+        Py_INCREF(*filename);
     }
     else {
-        *filename = _PyUnicode_AsString(v);
-        Py_DECREF(v);
-        if (!*filename)
-            goto finally;
+        *filename = v;
     }
 
     v = _PyObject_GetAttrId(err, &PyId_lineno);
@@ -1547,15 +1702,13 @@
         *text = NULL;
     }
     else {
-        *text = _PyUnicode_AsString(v);
-        Py_DECREF(v);
-        if (!*text)
-            goto finally;
+        *text = v;
     }
     return 1;
 
 finally:
     Py_XDECREF(*message);
+    Py_XDECREF(*filename);
     return 0;
 }
 
@@ -1566,9 +1719,15 @@
 }
 
 static void
-print_error_text(PyObject *f, int offset, const char *text)
+print_error_text(PyObject *f, int offset, PyObject *text_obj)
 {
+    char *text;
     char *nl;
+
+    text = _PyUnicode_AsString(text_obj);
+    if (text == NULL)
+        return;
+
     if (offset >= 0) {
         if (offset > 0 && offset == strlen(text) && text[offset - 1] == '\n')
             offset--;
@@ -1627,7 +1786,12 @@
     if (PyLong_Check(value))
         exitcode = (int)PyLong_AsLong(value);
     else {
-        PyObject *sys_stderr = PySys_GetObject("stderr");
+        PyObject *sys_stderr = _PySys_GetObjectId(&PyId_stderr);
+        /* We clear the exception here to avoid triggering the assertion
+         * in PyObject_Str that ensures it won't silently lose exception
+         * details.
+         */
+        PyErr_Clear();
         if (sys_stderr != NULL && sys_stderr != Py_None) {
             PyFile_WriteObject(value, sys_stderr, Py_PRINT_RAW);
         } else {
@@ -1670,11 +1834,11 @@
         return;
     /* Now we know v != NULL too */
     if (set_sys_last_vars) {
-        PySys_SetObject("last_type", exception);
-        PySys_SetObject("last_value", v);
-        PySys_SetObject("last_traceback", tb);
+        _PySys_SetObjectId(&PyId_last_type, exception);
+        _PySys_SetObjectId(&PyId_last_value, v);
+        _PySys_SetObjectId(&PyId_last_traceback, tb);
     }
-    hook = PySys_GetObject("excepthook");
+    hook = _PySys_GetObjectId(&PyId_excepthook);
     if (hook) {
         PyObject *args = PyTuple_Pack(3, exception, v, tb);
         PyObject *result = PyEval_CallObject(hook, args);
@@ -1724,9 +1888,11 @@
     _Py_IDENTIFIER(print_file_and_line);
 
     if (!PyExceptionInstance_Check(value)) {
-        PyFile_WriteString("TypeError: print_exception(): Exception expected for value, ", f);
-        PyFile_WriteString(Py_TYPE(value)->tp_name, f);
-        PyFile_WriteString(" found\n", f);
+        err = PyFile_WriteString("TypeError: print_exception(): Exception expected for value, ", f);
+        err += PyFile_WriteString(Py_TYPE(value)->tp_name, f);
+        err += PyFile_WriteString(" found\n", f);
+        if (err)
+            PyErr_Clear();
         return;
     }
 
@@ -1739,27 +1905,30 @@
     if (err == 0 &&
         _PyObject_HasAttrId(value, &PyId_print_file_and_line))
     {
-        PyObject *message;
-        const char *filename, *text;
+        PyObject *message, *filename, *text;
         int lineno, offset;
         if (!parse_syntax_error(value, &message, &filename,
                                 &lineno, &offset, &text))
             PyErr_Clear();
         else {
-            char buf[10];
-            PyFile_WriteString("  File \"", f);
-            if (filename == NULL)
-                PyFile_WriteString("<string>", f);
-            else
-                PyFile_WriteString(filename, f);
-            PyFile_WriteString("\", line ", f);
-            PyOS_snprintf(buf, sizeof(buf), "%d", lineno);
-            PyFile_WriteString(buf, f);
-            PyFile_WriteString("\n", f);
-            if (text != NULL)
-                print_error_text(f, offset, text);
+            PyObject *line;
+
             Py_DECREF(value);
             value = message;
+
+            line = PyUnicode_FromFormat("  File \"%U\", line %d\n",
+                                          filename, lineno);
+            Py_DECREF(filename);
+            if (line != NULL) {
+                PyFile_WriteObject(line, f, Py_PRINT_RAW);
+                Py_DECREF(line);
+            }
+
+            if (text != NULL) {
+                print_error_text(f, offset, text);
+                Py_DECREF(text);
+            }
+
             /* Can't be bothered to check all those
                PyFile_WriteString() calls */
             if (PyErr_Occurred())
@@ -1788,10 +1957,9 @@
             err = PyFile_WriteString("<unknown>", f);
         }
         else {
-            char* modstr = _PyUnicode_AsString(moduleName);
-            if (modstr && strcmp(modstr, "builtins"))
+            if (_PyUnicode_CompareWithId(moduleName, &PyId_builtins) != 0)
             {
-                err = PyFile_WriteString(modstr, f);
+                err = PyFile_WriteObject(moduleName, f, Py_PRINT_RAW);
                 err += PyFile_WriteString(".", f);
             }
             Py_DECREF(moduleName);
@@ -1884,7 +2052,7 @@
 PyErr_Display(PyObject *exception, PyObject *value, PyObject *tb)
 {
     PyObject *seen;
-    PyObject *f = PySys_GetObject("stderr");
+    PyObject *f = _PySys_GetObjectId(&PyId_stderr);
     if (PyExceptionInstance_Check(value)
         && tb != NULL && PyTraceBack_Check(tb)) {
         /* Put the traceback on the exception, otherwise it won't get
@@ -1920,37 +2088,54 @@
 {
     PyObject *ret = NULL;
     mod_ty mod;
-    PyArena *arena = PyArena_New();
+    PyArena *arena;
+    PyObject *filename;
+
+    filename = _PyUnicode_FromId(&PyId_string); /* borrowed */
+    if (filename == NULL)
+        return NULL;
+
+    arena = PyArena_New();
     if (arena == NULL)
         return NULL;
 
-    mod = PyParser_ASTFromString(str, "<string>", start, flags, arena);
+    mod = PyParser_ASTFromStringObject(str, filename, start, flags, arena);
     if (mod != NULL)
-        ret = run_mod(mod, "<string>", globals, locals, flags, arena);
+        ret = run_mod(mod, filename, globals, locals, flags, arena);
     PyArena_Free(arena);
     return ret;
 }
 
 PyObject *
-PyRun_FileExFlags(FILE *fp, const char *filename, int start, PyObject *globals,
+PyRun_FileExFlags(FILE *fp, const char *filename_str, int start, PyObject *globals,
                   PyObject *locals, int closeit, PyCompilerFlags *flags)
 {
-    PyObject *ret;
+    PyObject *ret = NULL;
     mod_ty mod;
-    PyArena *arena = PyArena_New();
-    if (arena == NULL)
-        return NULL;
+    PyArena *arena = NULL;
+    PyObject *filename;
 
-    mod = PyParser_ASTFromFile(fp, filename, NULL, start, 0, 0,
-                               flags, NULL, arena);
+    filename = PyUnicode_DecodeFSDefault(filename_str);
+    if (filename == NULL)
+        goto exit;
+
+    arena = PyArena_New();
+    if (arena == NULL)
+        goto exit;
+
+    mod = PyParser_ASTFromFileObject(fp, filename, NULL, start, 0, 0,
+                                     flags, NULL, arena);
     if (closeit)
         fclose(fp);
     if (mod == NULL) {
-        PyArena_Free(arena);
-        return NULL;
+        goto exit;
     }
     ret = run_mod(mod, filename, globals, locals, flags, arena);
-    PyArena_Free(arena);
+
+exit:
+    Py_XDECREF(filename);
+    if (arena != NULL)
+        PyArena_Free(arena);
     return ret;
 }
 
@@ -1959,12 +2144,11 @@
 {
     PyObject *f, *r;
     PyObject *type, *value, *traceback;
-    _Py_IDENTIFIER(flush);
 
     /* Save the current exception */
     PyErr_Fetch(&type, &value, &traceback);
 
-    f = PySys_GetObject("stderr");
+    f = _PySys_GetObjectId(&PyId_stderr);
     if (f != NULL) {
         r = _PyObject_CallMethodId(f, &PyId_flush, "");
         if (r)
@@ -1972,7 +2156,7 @@
         else
             PyErr_Clear();
     }
-    f = PySys_GetObject("stdout");
+    f = _PySys_GetObjectId(&PyId_stdout);
     if (f != NULL) {
         r = _PyObject_CallMethodId(f, &PyId_flush, "");
         if (r)
@@ -1985,12 +2169,12 @@
 }
 
 static PyObject *
-run_mod(mod_ty mod, const char *filename, PyObject *globals, PyObject *locals,
-         PyCompilerFlags *flags, PyArena *arena)
+run_mod(mod_ty mod, PyObject *filename, PyObject *globals, PyObject *locals,
+            PyCompilerFlags *flags, PyArena *arena)
 {
     PyCodeObject *co;
     PyObject *v;
-    co = PyAST_Compile(mod, filename, flags, arena);
+    co = PyAST_CompileObject(mod, filename, flags, -1, arena);
     if (co == NULL)
         return NULL;
     v = PyEval_EvalCode((PyObject*)co, globals, locals);
@@ -2032,8 +2216,8 @@
 }
 
 PyObject *
-Py_CompileStringExFlags(const char *str, const char *filename, int start,
-                        PyCompilerFlags *flags, int optimize)
+Py_CompileStringObject(const char *str, PyObject *filename, int start,
+                       PyCompilerFlags *flags, int optimize)
 {
     PyCodeObject *co;
     mod_ty mod;
@@ -2041,7 +2225,7 @@
     if (arena == NULL)
         return NULL;
 
-    mod = PyParser_ASTFromString(str, filename, start, flags, arena);
+    mod = PyParser_ASTFromStringObject(str, filename, start, flags, arena);
     if (mod == NULL) {
         PyArena_Free(arena);
         return NULL;
@@ -2051,11 +2235,24 @@
         PyArena_Free(arena);
         return result;
     }
-    co = PyAST_CompileEx(mod, filename, flags, optimize, arena);
+    co = PyAST_CompileObject(mod, filename, flags, optimize, arena);
     PyArena_Free(arena);
     return (PyObject *)co;
 }
 
+PyObject *
+Py_CompileStringExFlags(const char *str, const char *filename_str, int start,
+                        PyCompilerFlags *flags, int optimize)
+{
+    PyObject *filename, *co;
+    filename = PyUnicode_DecodeFSDefault(filename_str);
+    if (filename == NULL)
+        return NULL;
+    co = Py_CompileStringObject(str, filename, start, flags, optimize);
+    Py_DECREF(filename);
+    return co;
+}
+
 /* For use in Py_LIMITED_API */
 #undef Py_CompileString
 PyObject *
@@ -2065,46 +2262,62 @@
 }
 
 struct symtable *
-Py_SymtableString(const char *str, const char *filename, int start)
+Py_SymtableStringObject(const char *str, PyObject *filename, int start)
 {
     struct symtable *st;
     mod_ty mod;
     PyCompilerFlags flags;
-    PyArena *arena = PyArena_New();
+    PyArena *arena;
+
+    arena = PyArena_New();
     if (arena == NULL)
         return NULL;
 
     flags.cf_flags = 0;
-    mod = PyParser_ASTFromString(str, filename, start, &flags, arena);
+    mod = PyParser_ASTFromStringObject(str, filename, start, &flags, arena);
     if (mod == NULL) {
         PyArena_Free(arena);
         return NULL;
     }
-    st = PySymtable_Build(mod, filename, 0);
+    st = PySymtable_BuildObject(mod, filename, 0);
     PyArena_Free(arena);
     return st;
 }
 
+struct symtable *
+Py_SymtableString(const char *str, const char *filename_str, int start)
+{
+    PyObject *filename;
+    struct symtable *st;
+
+    filename = PyUnicode_DecodeFSDefault(filename_str);
+    if (filename == NULL)
+        return NULL;
+    st = Py_SymtableStringObject(str, filename, start);
+    Py_DECREF(filename);
+    return st;
+}
+
 /* Preferred access to parser is through AST. */
 mod_ty
-PyParser_ASTFromString(const char *s, const char *filename, int start,
-                       PyCompilerFlags *flags, PyArena *arena)
+PyParser_ASTFromStringObject(const char *s, PyObject *filename, int start,
+                             PyCompilerFlags *flags, PyArena *arena)
 {
     mod_ty mod;
     PyCompilerFlags localflags;
     perrdetail err;
     int iflags = PARSER_FLAGS(flags);
 
-    node *n = PyParser_ParseStringFlagsFilenameEx(s, filename,
-                                    &_PyParser_Grammar, start, &err,
-                                    &iflags);
+    node *n = PyParser_ParseStringObject(s, filename,
+                                         &_PyParser_Grammar, start, &err,
+                                         &iflags);
     if (flags == NULL) {
         localflags.cf_flags = 0;
         flags = &localflags;
     }
     if (n) {
         flags->cf_flags |= iflags & PyCF_MASK;
-        mod = PyAST_FromNode(n, flags, filename, arena);
+        mod = PyAST_FromNodeObject(n, flags, filename, arena);
         PyNode_Free(n);
     }
     else {
@@ -2116,26 +2329,40 @@
 }
 
 mod_ty
-PyParser_ASTFromFile(FILE *fp, const char *filename, const char* enc,
-                     int start, char *ps1,
-                     char *ps2, PyCompilerFlags *flags, int *errcode,
-                     PyArena *arena)
+PyParser_ASTFromString(const char *s, const char *filename_str, int start,
+                       PyCompilerFlags *flags, PyArena *arena)
+{
+    PyObject *filename;
+    mod_ty mod;
+    filename = PyUnicode_DecodeFSDefault(filename_str);
+    if (filename == NULL)
+        return NULL;
+    mod = PyParser_ASTFromStringObject(s, filename, start, flags, arena);
+    Py_DECREF(filename);
+    return mod;
+}
+
+mod_ty
+PyParser_ASTFromFileObject(FILE *fp, PyObject *filename, const char* enc,
+                           int start, char *ps1,
+                           char *ps2, PyCompilerFlags *flags, int *errcode,
+                           PyArena *arena)
 {
     mod_ty mod;
     PyCompilerFlags localflags;
     perrdetail err;
     int iflags = PARSER_FLAGS(flags);
 
-    node *n = PyParser_ParseFileFlagsEx(fp, filename, enc,
-                                      &_PyParser_Grammar,
-                            start, ps1, ps2, &err, &iflags);
+    node *n = PyParser_ParseFileObject(fp, filename, enc,
+                                       &_PyParser_Grammar,
+                                       start, ps1, ps2, &err, &iflags);
     if (flags == NULL) {
         localflags.cf_flags = 0;
         flags = &localflags;
     }
     if (n) {
         flags->cf_flags |= iflags & PyCF_MASK;
-        mod = PyAST_FromNode(n, flags, filename, arena);
+        mod = PyAST_FromNodeObject(n, flags, filename, arena);
         PyNode_Free(n);
     }
     else {
@@ -2148,6 +2375,23 @@
     return mod;
 }
 
+mod_ty
+PyParser_ASTFromFile(FILE *fp, const char *filename_str, const char* enc,
+                     int start, char *ps1,
+                     char *ps2, PyCompilerFlags *flags, int *errcode,
+                     PyArena *arena)
+{
+    mod_ty mod;
+    PyObject *filename;
+    filename = PyUnicode_DecodeFSDefault(filename_str);
+    if (filename == NULL)
+        return NULL;
+    mod = PyParser_ASTFromFileObject(fp, filename, enc, start, ps1, ps2,
+                                     flags, errcode, arena);
+    Py_DECREF(filename);
+    return mod;
+}
+
 /* Simplified interface to parsefile -- return node or set exception */
 
 node *
@@ -2484,6 +2728,9 @@
     PyOS_setsig(SIGXFSZ, SIG_IGN);
 #endif
     PyOS_InitInterrupts(); /* May imply initsignal() */
+    if (PyErr_Occurred()) {
+        Py_FatalError("Py_Initialize: can't import signal");
+    }
 }
 
 
diff --git a/Python/pytime.c b/Python/pytime.c
index beeab87..de6a41f 100644
--- a/Python/pytime.c
+++ b/Python/pytime.c
@@ -152,7 +152,7 @@
 
 static int
 _PyTime_ObjectToDenominator(PyObject *obj, time_t *sec, long *numerator,
-                            double denominator)
+                            double denominator, _PyTime_round_t round)
 {
     assert(denominator <= LONG_MAX);
     if (PyFloat_Check(obj)) {
@@ -167,6 +167,20 @@
             intpart -= 1.0;
         }
 
+        floatpart *= denominator;
+        if (round == _PyTime_ROUND_UP) {
+            if (intpart >= 0) {
+                floatpart = ceil(floatpart);
+                if (floatpart >= denominator) {
+                    floatpart = 0.0;
+                    intpart += 1.0;
+                }
+            }
+            else {
+                floatpart = floor(floatpart);
+            }
+        }
+
         *sec = (time_t)intpart;
         err = intpart - (double)*sec;
         if (err <= -1.0 || err >= 1.0) {
@@ -174,7 +188,6 @@
             return -1;
         }
 
-        floatpart *= denominator;
         *numerator = (long)floatpart;
         return 0;
     }
@@ -188,12 +201,18 @@
 }
 
 int
-_PyTime_ObjectToTime_t(PyObject *obj, time_t *sec)
+_PyTime_ObjectToTime_t(PyObject *obj, time_t *sec, _PyTime_round_t round)
 {
     if (PyFloat_Check(obj)) {
         double d, intpart, err;
 
         d = PyFloat_AsDouble(obj);
+        if (round == _PyTime_ROUND_UP) {
+            if (d >= 0)
+                d = ceil(d);
+            else
+                d = floor(d);
+        }
         (void)modf(d, &intpart);
 
         *sec = (time_t)intpart;
@@ -213,15 +232,17 @@
 }
 
 int
-_PyTime_ObjectToTimespec(PyObject *obj, time_t *sec, long *nsec)
+_PyTime_ObjectToTimespec(PyObject *obj, time_t *sec, long *nsec,
+                         _PyTime_round_t round)
 {
-    return _PyTime_ObjectToDenominator(obj, sec, nsec, 1e9);
+    return _PyTime_ObjectToDenominator(obj, sec, nsec, 1e9, round);
 }
 
 int
-_PyTime_ObjectToTimeval(PyObject *obj, time_t *sec, long *usec)
+_PyTime_ObjectToTimeval(PyObject *obj, time_t *sec, long *usec,
+                        _PyTime_round_t round)
 {
-    return _PyTime_ObjectToDenominator(obj, sec, usec, 1e6);
+    return _PyTime_ObjectToDenominator(obj, sec, usec, 1e6, round);
 }
 
 void
diff --git a/Python/random.c b/Python/random.c
index 337be86..93d300d 100644
--- a/Python/random.c
+++ b/Python/random.c
@@ -3,6 +3,9 @@
 #include <windows.h>
 #else
 #include <fcntl.h>
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
 #endif
 
 #ifdef Py_DEBUG
@@ -12,43 +15,14 @@
 #endif
 
 #ifdef MS_WINDOWS
-typedef BOOL (WINAPI *CRYPTACQUIRECONTEXTA)(HCRYPTPROV *phProv,\
-              LPCSTR pszContainer, LPCSTR pszProvider, DWORD dwProvType,\
-              DWORD dwFlags );
-typedef BOOL (WINAPI *CRYPTGENRANDOM)(HCRYPTPROV hProv, DWORD dwLen,\
-              BYTE *pbBuffer );
-
-static CRYPTGENRANDOM pCryptGenRandom = NULL;
-/* This handle is never explicitly released. Instead, the operating
-   system will release it when the process terminates. */
 static HCRYPTPROV hCryptProv = 0;
 
 static int
 win32_urandom_init(int raise)
 {
-    HINSTANCE hAdvAPI32 = NULL;
-    CRYPTACQUIRECONTEXTA pCryptAcquireContext = NULL;
-
-    /* Obtain handle to the DLL containing CryptoAPI. This should not fail. */
-    hAdvAPI32 = GetModuleHandle("advapi32.dll");
-    if(hAdvAPI32 == NULL)
-        goto error;
-
-    /* Obtain pointers to the CryptoAPI functions. This will fail on some early
-       versions of Win95. */
-    pCryptAcquireContext = (CRYPTACQUIRECONTEXTA)GetProcAddress(
-                               hAdvAPI32, "CryptAcquireContextA");
-    if (pCryptAcquireContext == NULL)
-        goto error;
-
-    pCryptGenRandom = (CRYPTGENRANDOM)GetProcAddress(hAdvAPI32,
-                                                     "CryptGenRandom");
-    if (pCryptGenRandom == NULL)
-        goto error;
-
     /* Acquire context */
-    if (! pCryptAcquireContext(&hCryptProv, NULL, NULL,
-                               PROV_RSA_FULL, CRYPT_VERIFYCONTEXT))
+    if (!CryptAcquireContext(&hCryptProv, NULL, NULL,
+                             PROV_RSA_FULL, CRYPT_VERIFYCONTEXT))
         goto error;
 
     return 0;
@@ -62,7 +36,7 @@
 }
 
 /* Fill buffer with size pseudo-random bytes generated by the Windows CryptoGen
-   API. Return 0 on success, or -1 on error. */
+   API. Return 0 on success, or raise an exception and return -1 on error. */
 static int
 win32_urandom(unsigned char *buffer, Py_ssize_t size, int raise)
 {
@@ -77,7 +51,7 @@
     while (size > 0)
     {
         chunk = size > INT_MAX ? INT_MAX : size;
-        if (!pCryptGenRandom(hCryptProv, chunk, buffer))
+        if (!CryptGenRandom(hCryptProv, (DWORD)chunk, buffer))
         {
             /* CryptGenRandom() failed */
             if (raise)
@@ -92,43 +66,52 @@
     }
     return 0;
 }
-#endif /* MS_WINDOWS */
 
+#elif HAVE_GETENTROPY
+/* Fill buffer with size pseudo-random bytes generated by getentropy().
+   Return 0 on success, or raise an exception and return -1 on error.
 
-#ifdef __VMS
-/* Use openssl random routine */
-#include <openssl/rand.h>
+   If fatal is nonzero, call Py_FatalError() instead of raising an exception
+   on error. */
 static int
-vms_urandom(unsigned char *buffer, Py_ssize_t size, int raise)
+py_getentropy(unsigned char *buffer, Py_ssize_t size, int fatal)
 {
-    if (RAND_pseudo_bytes(buffer, size) < 0) {
-        if (raise) {
-            PyErr_Format(PyExc_ValueError,
-                         "RAND_pseudo_bytes");
-        } else {
-            Py_FatalError("Failed to initialize the randomized hash "
-                          "secret using RAND_pseudo_bytes");
+    while (size > 0) {
+        Py_ssize_t len = Py_MIN(size, 256);
+        int res = getentropy(buffer, len);
+        if (res < 0) {
+            if (fatal) {
+                Py_FatalError("getentropy() failed");
+            }
+            else {
+                PyErr_SetFromErrno(PyExc_OSError);
+                return -1;
+            }
         }
-        return -1;
+        buffer += len;
+        size -= len;
     }
     return 0;
 }
-#endif /* __VMS */
 
-
-#if !defined(MS_WINDOWS) && !defined(__VMS)
+#else
+static struct {
+    int fd;
+    dev_t st_dev;
+    ino_t st_ino;
+} urandom_cache = { -1 };
 
 /* Read size bytes from /dev/urandom into buffer.
    Call Py_FatalError() on error. */
 static void
-dev_urandom_noraise(char *buffer, Py_ssize_t size)
+dev_urandom_noraise(unsigned char *buffer, Py_ssize_t size)
 {
     int fd;
     Py_ssize_t n;
 
     assert (0 < size);
 
-    fd = open("/dev/urandom", O_RDONLY);
+    fd = _Py_open("/dev/urandom", O_RDONLY);
     if (fd < 0)
         Py_FatalError("Failed to open /dev/urandom");
 
@@ -156,22 +139,56 @@
 {
     int fd;
     Py_ssize_t n;
+    struct stat st;
 
     if (size <= 0)
         return 0;
 
-    Py_BEGIN_ALLOW_THREADS
-    fd = open("/dev/urandom", O_RDONLY);
-    Py_END_ALLOW_THREADS
-    if (fd < 0)
-    {
-        if (errno == ENOENT || errno == ENXIO ||
-            errno == ENODEV || errno == EACCES)
-            PyErr_SetString(PyExc_NotImplementedError,
-                            "/dev/urandom (or equivalent) not found");
-        else
-            PyErr_SetFromErrno(PyExc_OSError);
-        return -1;
+    if (urandom_cache.fd >= 0) {
+        /* Does the fd point to the same thing as before? (issue #21207) */
+        if (fstat(urandom_cache.fd, &st)
+            || st.st_dev != urandom_cache.st_dev
+            || st.st_ino != urandom_cache.st_ino) {
+            /* Something changed: forget the cached fd (but don't close it,
+               since it probably points to something important for some
+               third-party code). */
+            urandom_cache.fd = -1;
+        }
+    }
+    if (urandom_cache.fd >= 0)
+        fd = urandom_cache.fd;
+    else {
+        Py_BEGIN_ALLOW_THREADS
+        fd = _Py_open("/dev/urandom", O_RDONLY);
+        Py_END_ALLOW_THREADS
+        if (fd < 0)
+        {
+            if (errno == ENOENT || errno == ENXIO ||
+                errno == ENODEV || errno == EACCES)
+                PyErr_SetString(PyExc_NotImplementedError,
+                                "/dev/urandom (or equivalent) not found");
+            else
+                PyErr_SetFromErrno(PyExc_OSError);
+            return -1;
+        }
+        if (urandom_cache.fd >= 0) {
+            /* urandom_fd was initialized by another thread while we were
+               not holding the GIL, keep it. */
+            close(fd);
+            fd = urandom_cache.fd;
+        }
+        else {
+            if (fstat(fd, &st)) {
+                PyErr_SetFromErrno(PyExc_OSError);
+                close(fd);
+                return -1;
+            }
+            else {
+                urandom_cache.fd = fd;
+                urandom_cache.st_dev = st.st_dev;
+                urandom_cache.st_ino = st.st_ino;
+            }
+        }
     }
 
     Py_BEGIN_ALLOW_THREADS
@@ -195,13 +212,21 @@
             PyErr_Format(PyExc_RuntimeError,
                          "Failed to read %zi bytes from /dev/urandom",
                          size);
-        close(fd);
         return -1;
     }
-    close(fd);
     return 0;
 }
-#endif /* !defined(MS_WINDOWS) && !defined(__VMS) */
+
+static void
+dev_urandom_close(void)
+{
+    if (urandom_cache.fd >= 0) {
+        close(urandom_cache.fd);
+        urandom_cache.fd = -1;
+    }
+}
+
+#endif /* HAVE_GETENTROPY */
 
 /* Fill buffer with pseudo-random bytes generated by a linear congruent
    generator (LCG):
@@ -225,7 +250,7 @@
 }
 
 /* Fill buffer with size pseudo-random bytes from the operating system random
-   number generator (RNG). It is suitable for for most cryptographic purposes
+   number generator (RNG). It is suitable for most cryptographic purposes
    except long living private keys for asymmetric encryption.
 
    Return 0 on success, raise an exception and return -1 on error. */
@@ -242,12 +267,10 @@
 
 #ifdef MS_WINDOWS
     return win32_urandom((unsigned char *)buffer, size, 1);
+#elif HAVE_GETENTROPY
+    return py_getentropy(buffer, size, 0);
 #else
-# ifdef __VMS
-    return vms_urandom((unsigned char *)buffer, size, 1);
-# else
     return dev_urandom_python((char*)buffer, size);
-# endif
 #endif
 }
 
@@ -255,8 +278,9 @@
 _PyRandom_Init(void)
 {
     char *env;
-    void *secret = &_Py_HashSecret;
+    unsigned char *secret = (unsigned char *)&_Py_HashSecret.uc;
     Py_ssize_t secret_size = sizeof(_Py_HashSecret_t);
+    assert(secret_size == sizeof(_Py_HashSecret.uc));
 
     if (_Py_HashSecret_Initialized)
         return;
@@ -284,18 +308,31 @@
             memset(secret, 0, secret_size);
         }
         else {
-            lcg_urandom(seed, (unsigned char*)secret, secret_size);
+            lcg_urandom(seed, secret, secret_size);
         }
     }
     else {
 #ifdef MS_WINDOWS
-        (void)win32_urandom((unsigned char *)secret, secret_size, 0);
-#else /* #ifdef MS_WINDOWS */
-# ifdef __VMS
-        vms_urandom((unsigned char *)secret, secret_size, 0);
-# else
-        dev_urandom_noraise((char*)secret, secret_size);
-# endif
+        (void)win32_urandom(secret, secret_size, 0);
+#elif HAVE_GETENTROPY
+        (void)py_getentropy(secret, secret_size, 1);
+#else
+        dev_urandom_noraise(secret, secret_size);
 #endif
     }
 }
+
+void
+_PyRandom_Fini(void)
+{
+#ifdef MS_WINDOWS
+    if (hCryptProv) {
+        CryptReleaseContext(hCryptProv, 0);
+        hCryptProv = 0;
+    }
+#elif HAVE_GETENTROPY
+    /* nothing to clean */
+#else
+    dev_urandom_close();
+#endif
+}
diff --git a/Python/strdup.c b/Python/strdup.c
index 20187e0..769d3db 100644
--- a/Python/strdup.c
+++ b/Python/strdup.c
@@ -6,7 +6,7 @@
 strdup(const char *str)
 {
 	if (str != NULL) {
-		register char *copy = malloc(strlen(str) + 1);
+		char *copy = malloc(strlen(str) + 1);
 		if (copy != NULL)
 			return strcpy(copy, str);
 	}
diff --git a/Python/symtable.c b/Python/symtable.c
index 1e13b790..da164aa 100644
--- a/Python/symtable.c
+++ b/Python/symtable.c
@@ -37,24 +37,14 @@
     ste->ste_table = st;
     ste->ste_id = k; /* ste owns reference to k */
 
-    ste->ste_name = name;
     Py_INCREF(name);
+    ste->ste_name = name;
 
     ste->ste_symbols = NULL;
     ste->ste_varnames = NULL;
     ste->ste_children = NULL;
 
-    ste->ste_symbols = PyDict_New();
-    if (ste->ste_symbols == NULL)
-        goto fail;
-
-    ste->ste_varnames = PyList_New(0);
-    if (ste->ste_varnames == NULL)
-        goto fail;
-
-    ste->ste_children = PyList_New(0);
-    if (ste->ste_children == NULL)
-        goto fail;
+    ste->ste_directives = NULL;
 
     ste->ste_type = block;
     ste->ste_unoptimized = 0;
@@ -75,6 +65,15 @@
     ste->ste_child_free = 0;
     ste->ste_generator = 0;
     ste->ste_returns_value = 0;
+    ste->ste_needs_class_closure = 0;
+
+    ste->ste_symbols = PyDict_New();
+    ste->ste_varnames = PyList_New(0);
+    ste->ste_children = PyList_New(0);
+    if (ste->ste_symbols == NULL
+        || ste->ste_varnames == NULL
+        || ste->ste_children == NULL)
+        goto fail;
 
     if (PyDict_SetItem(st->st_blocks, ste->ste_id, (PyObject *)ste) < 0)
         goto fail;
@@ -102,6 +101,7 @@
     Py_XDECREF(ste->ste_symbols);
     Py_XDECREF(ste->ste_varnames);
     Py_XDECREF(ste->ste_children);
+    Py_XDECREF(ste->ste_directives);
     PyObject_Del(ste);
 }
 
@@ -188,7 +188,7 @@
 
 static identifier top = NULL, lambda = NULL, genexpr = NULL,
     listcomp = NULL, setcomp = NULL, dictcomp = NULL,
-    __class__ = NULL, __locals__ = NULL;
+    __class__ = NULL;
 
 #define GET_IDENTIFIER(VAR) \
     ((VAR) ? (VAR) : ((VAR) = PyUnicode_InternFromString(# VAR)))
@@ -233,7 +233,7 @@
 #define COMPILER_STACK_FRAME_SCALE 3
 
 struct symtable *
-PySymtable_Build(mod_ty mod, const char *filename, PyFutureFeatures *future)
+PySymtable_BuildObject(mod_ty mod, PyObject *filename, PyFutureFeatures *future)
 {
     struct symtable *st = symtable_new();
     asdl_seq *seq;
@@ -242,7 +242,12 @@
     int recursion_limit = Py_GetRecursionLimit();
 
     if (st == NULL)
-        return st;
+        return NULL;
+    if (filename == NULL) {
+        PySymtable_Free(st);
+        return NULL;
+    }
+    Py_INCREF(filename);
     st->st_filename = filename;
     st->st_future = future;
 
@@ -306,9 +311,23 @@
     return NULL;
 }
 
+struct symtable *
+PySymtable_Build(mod_ty mod, const char *filename_str, PyFutureFeatures *future)
+{
+    PyObject *filename;
+    struct symtable *st;
+    filename = PyUnicode_DecodeFSDefault(filename_str);
+    if (filename == NULL)
+        return NULL;
+    st = PySymtable_BuildObject(mod, filename, future);
+    Py_DECREF(filename);
+    return st;
+}
+
 void
 PySymtable_Free(struct symtable *st)
 {
+    Py_XDECREF(st->st_filename);
     Py_XDECREF(st->st_blocks);
     Py_XDECREF(st->st_stack);
     PyMem_Free((void *)st);
@@ -346,6 +365,24 @@
     return (PyLong_AS_LONG(v) >> SCOPE_OFFSET) & SCOPE_MASK;
 }
 
+static int
+error_at_directive(PySTEntryObject *ste, PyObject *name)
+{
+    Py_ssize_t i;
+    PyObject *data;
+    assert(ste->ste_directives);
+    for (i = 0; ; i++) {
+        data = PyList_GET_ITEM(ste->ste_directives, i);
+        assert(PyTuple_CheckExact(data));
+        if (PyTuple_GET_ITEM(data, 0) == name)
+            break;
+    }
+    PyErr_SyntaxLocationObject(ste->ste_table->st_filename,
+                               PyLong_AsLong(PyTuple_GET_ITEM(data, 1)),
+                               PyLong_AsLong(PyTuple_GET_ITEM(data, 2)));
+    return 0;
+}
+
 
 /* Analyze raw symbol information to determine scope of each name.
 
@@ -420,16 +457,13 @@
             PyErr_Format(PyExc_SyntaxError,
                         "name '%U' is parameter and global",
                         name);
-            PyErr_SyntaxLocationEx(ste->ste_table->st_filename,
-                                   ste->ste_lineno, ste->ste_col_offset);
-
-            return 0;
+            return error_at_directive(ste, name);
         }
         if (flags & DEF_NONLOCAL) {
             PyErr_Format(PyExc_SyntaxError,
                          "name '%U' is nonlocal and global",
                          name);
-            return 0;
+            return error_at_directive(ste, name);
         }
         SET_SCOPE(scopes, name, GLOBAL_EXPLICIT);
         if (PySet_Add(global, name) < 0)
@@ -443,19 +477,19 @@
             PyErr_Format(PyExc_SyntaxError,
                          "name '%U' is parameter and nonlocal",
                          name);
-            return 0;
+            return error_at_directive(ste, name);
         }
         if (!bound) {
             PyErr_Format(PyExc_SyntaxError,
                          "nonlocal declaration not allowed at module level");
-            return 0;
+            return error_at_directive(ste, name);
         }
         if (!PySet_Contains(bound, name)) {
             PyErr_Format(PyExc_SyntaxError,
                          "no binding for nonlocal '%U' found",
                          name);
 
-            return 0;
+            return error_at_directive(ste, name);
         }
         SET_SCOPE(scopes, name, FREE);
         ste->ste_free = 1;
@@ -500,13 +534,10 @@
 
    Note that the current block's free variables are included in free.
    That's safe because no name can be free and local in the same scope.
-
-   The 'restricted' argument may be set to a string to restrict the analysis
-   to the one variable whose name equals that string (e.g. "__class__").
 */
 
 static int
-analyze_cells(PyObject *scopes, PyObject *free, const char *restricted)
+analyze_cells(PyObject *scopes, PyObject *free)
 {
     PyObject *name, *v, *v_cell;
     int success = 0;
@@ -523,9 +554,6 @@
             continue;
         if (!PySet_Contains(free, name))
             continue;
-        if (restricted != NULL &&
-            PyUnicode_CompareWithASCIIString(name, restricted))
-            continue;
         /* Replace LOCAL with CELL for this name, and remove
            from free. It is safe to replace the value of name
            in the dict, because it will not cause a resize.
@@ -541,6 +569,20 @@
     return success;
 }
 
+static int
+drop_class_free(PySTEntryObject *ste, PyObject *free)
+{
+    int res;
+    if (!GET_IDENTIFIER(__class__))
+        return 0;
+    res = PySet_Discard(free, __class__);
+    if (res < 0)
+        return 0;
+    if (res)
+        ste->ste_needs_class_closure = 1;
+    return 1;
+}
+
 /* Check for illegal statements in unoptimized namespaces */
 static int
 check_unoptimized(const PySTEntryObject* ste) {
@@ -564,8 +606,9 @@
         break;
     }
 
-    PyErr_SyntaxLocationEx(ste->ste_table->st_filename, ste->ste_opt_lineno,
-                           ste->ste_opt_col_offset);
+    PyErr_SyntaxLocationObject(ste->ste_table->st_filename,
+                               ste->ste_opt_lineno,
+                               ste->ste_opt_col_offset);
     return 0;
 }
 
@@ -771,7 +814,6 @@
         /* Special-case __class__ */
         if (!GET_IDENTIFIER(__class__))
             goto error;
-        assert(PySet_Contains(local, __class__) == 1);
         if (PySet_Add(newbound, __class__) < 0)
             goto error;
     }
@@ -804,11 +846,9 @@
     Py_DECREF(temp);
 
     /* Check if any local variables must be converted to cell variables */
-    if (ste->ste_type == FunctionBlock && !analyze_cells(scopes, newfree,
-                                                         NULL))
+    if (ste->ste_type == FunctionBlock && !analyze_cells(scopes, newfree))
         goto error;
-    else if (ste->ste_type == ClassBlock && !analyze_cells(scopes, newfree,
-                                                           "__class__"))
+    else if (ste->ste_type == ClassBlock && !drop_class_free(ste, newfree))
         goto error;
     /* Records the results of the analysis in the symbol table entry */
     if (!update_symbols(ste->ste_symbols, scopes, bound, newfree,
@@ -899,15 +939,20 @@
 static int
 symtable_warn(struct symtable *st, char *msg, int lineno)
 {
-    if (PyErr_WarnExplicit(PyExc_SyntaxWarning, msg, st->st_filename,
-                           lineno, NULL, NULL) < 0)     {
+    PyObject *message = PyUnicode_FromString(msg);
+    if (message == NULL)
+        return 0;
+    if (PyErr_WarnExplicitObject(PyExc_SyntaxWarning, message, st->st_filename,
+                                 lineno, NULL, NULL) < 0)     {
+        Py_DECREF(message);
         if (PyErr_ExceptionMatches(PyExc_SyntaxWarning)) {
             PyErr_SetString(PyExc_SyntaxError, msg);
-            PyErr_SyntaxLocationEx(st->st_filename, st->st_cur->ste_lineno,
-                                   st->st_cur->ste_col_offset);
+            PyErr_SyntaxLocationObject(st->st_filename, st->st_cur->ste_lineno,
+                                       st->st_cur->ste_col_offset);
         }
         return 0;
     }
+    Py_DECREF(message);
     return 1;
 }
 
@@ -990,9 +1035,9 @@
         if ((flag & DEF_PARAM) && (val & DEF_PARAM)) {
             /* Is it better to use 'mangled' or 'name' here? */
             PyErr_Format(PyExc_SyntaxError, DUPLICATE_ARGUMENT, name);
-            PyErr_SyntaxLocationEx(st->st_filename,
-                                   st->st_cur->ste_lineno,
-                                   st->st_cur->ste_col_offset);
+            PyErr_SyntaxLocationObject(st->st_filename,
+                                       st->st_cur->ste_lineno,
+                                       st->st_cur->ste_col_offset);
             goto error;
         }
         val |= flag;
@@ -1102,6 +1147,25 @@
 
 
 static int
+symtable_record_directive(struct symtable *st, identifier name, stmt_ty s)
+{
+    PyObject *data;
+    int res;
+    if (!st->st_cur->ste_directives) {
+        st->st_cur->ste_directives = PyList_New(0);
+        if (!st->st_cur->ste_directives)
+            return 0;
+    }
+    data = Py_BuildValue("(Oii)", name, s->lineno, s->col_offset);
+    if (!data)
+        return 0;
+    res = PyList_Append(st->st_cur->ste_directives, data);
+    Py_DECREF(data);
+    return res == 0;
+}
+
+
+static int
 symtable_visit_stmt(struct symtable *st, stmt_ty s)
 {
     if (++st->recursion_depth > st->recursion_limit) {
@@ -1146,13 +1210,6 @@
         if (!symtable_enter_block(st, s->v.ClassDef.name, ClassBlock,
                                   (void *)s, s->lineno, s->col_offset))
             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);
-            VISIT_QUIT(st, 0);
-        }
         tmp = st->st_private;
         st->st_private = s->v.ClassDef.name;
         VISIT_SEQ(st, stmt, s->v.ClassDef.body);
@@ -1240,14 +1297,7 @@
         asdl_seq *seq = s->v.Global.names;
         for (i = 0; i < asdl_seq_LEN(seq); i++) {
             identifier name = (identifier)asdl_seq_GET(seq, i);
-            long cur;
-            if (st->st_cur->ste_type == ClassBlock &&
-                !PyUnicode_CompareWithASCIIString(name, "__class__")) {
-                PyErr_SetString(PyExc_SyntaxError, "cannot make __class__ global");
-                PyErr_SyntaxLocationEx(st->st_filename, s->lineno, s->col_offset);
-                return 0;
-            }
-            cur = symtable_lookup(st, name);
+            long cur = symtable_lookup(st, name);
             if (cur < 0)
                 VISIT_QUIT(st, 0);
             if (cur & (DEF_LOCAL | USE)) {
@@ -1268,6 +1318,8 @@
             }
             if (!symtable_add_def(st, name, DEF_GLOBAL))
                 VISIT_QUIT(st, 0);
+            if (!symtable_record_directive(st, name, s))
+                VISIT_QUIT(st, 0);
         }
         break;
     }
@@ -1297,6 +1349,8 @@
             }
             if (!symtable_add_def(st, name, DEF_NONLOCAL))
                 VISIT_QUIT(st, 0);
+            if (!symtable_record_directive(st, name, s))
+                VISIT_QUIT(st, 0);
         }
         break;
     }
@@ -1407,6 +1461,7 @@
     case Str_kind:
     case Bytes_kind:
     case Ellipsis_kind:
+    case NameConstant_kind:
         /* Nothing to do here. */
         break;
     /* The following exprs can be assignment targets. */
@@ -1499,10 +1554,10 @@
 
     if (a->args && !symtable_visit_argannotations(st, a->args))
         return 0;
-    if (a->varargannotation)
-        VISIT(st, expr, a->varargannotation);
-    if (a->kwargannotation)
-        VISIT(st, expr, a->kwargannotation);
+    if (a->vararg && a->vararg->annotation)
+        VISIT(st, expr, a->vararg->annotation);
+    if (a->kwarg && a->kwarg->annotation)
+        VISIT(st, expr, a->kwarg->annotation);
     if (a->kwonlyargs && !symtable_visit_argannotations(st, a->kwonlyargs))
         return 0;
     if (s->v.FunctionDef.returns)
@@ -1521,12 +1576,12 @@
     if (a->kwonlyargs && !symtable_visit_params(st, a->kwonlyargs))
         return 0;
     if (a->vararg) {
-        if (!symtable_add_def(st, a->vararg, DEF_PARAM))
+        if (!symtable_add_def(st, a->vararg->arg, DEF_PARAM))
             return 0;
         st->st_cur->ste_varargs = 1;
     }
     if (a->kwarg) {
-        if (!symtable_add_def(st, a->kwarg, DEF_PARAM))
+        if (!symtable_add_def(st, a->kwarg->arg, DEF_PARAM))
             return 0;
         st->st_cur->ste_varkeywords = 1;
     }
@@ -1587,7 +1642,7 @@
             int lineno = st->st_cur->ste_lineno;
             int col_offset = st->st_cur->ste_col_offset;
             PyErr_SetString(PyExc_SyntaxError, IMPORT_STAR_WARNING);
-            PyErr_SyntaxLocationEx(st->st_filename, lineno, col_offset);
+            PyErr_SyntaxLocationObject(st->st_filename, lineno, col_offset);
             Py_DECREF(store_name);
             return 0;
         }
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 2f700e6..290eec1 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -32,15 +32,31 @@
 extern const char *PyWin_DLLVersionString;
 #endif
 
-#ifdef __VMS
-#include <unixlib.h>
-#endif
-
 #ifdef HAVE_LANGINFO_H
 #include <locale.h>
 #include <langinfo.h>
 #endif
 
+_Py_IDENTIFIER(_);
+_Py_IDENTIFIER(__sizeof__);
+_Py_IDENTIFIER(buffer);
+_Py_IDENTIFIER(builtins);
+_Py_IDENTIFIER(encoding);
+_Py_IDENTIFIER(path);
+_Py_IDENTIFIER(stdout);
+_Py_IDENTIFIER(stderr);
+_Py_IDENTIFIER(write);
+
+PyObject *
+_PySys_GetObjectId(_Py_Identifier *key)
+{
+    PyThreadState *tstate = PyThreadState_GET();
+    PyObject *sd = tstate->interp->sysdict;
+    if (sd == NULL)
+        return NULL;
+    return _PyDict_GetItemId(sd, key);
+}
+
 PyObject *
 PySys_GetObject(const char *name)
 {
@@ -52,6 +68,21 @@
 }
 
 int
+_PySys_SetObjectId(_Py_Identifier *key, PyObject *v)
+{
+    PyThreadState *tstate = PyThreadState_GET();
+    PyObject *sd = tstate->interp->sysdict;
+    if (v == NULL) {
+        if (_PyDict_GetItemId(sd, key) == NULL)
+            return 0;
+        else
+            return _PyDict_DelItemId(sd, key);
+    }
+    else
+        return _PyDict_SetItemId(sd, key, v);
+}
+
+int
 PySys_SetObject(const char *name, PyObject *v)
 {
     PyThreadState *tstate = PyThreadState_GET();
@@ -79,8 +110,6 @@
     PyObject *encoded, *escaped_str, *repr_str, *buffer, *result;
     char *stdout_encoding_str;
     int ret;
-    _Py_IDENTIFIER(encoding);
-    _Py_IDENTIFIER(buffer);
 
     stdout_encoding = _PyObject_GetAttrId(outf, &PyId_encoding);
     if (stdout_encoding == NULL)
@@ -101,7 +130,6 @@
 
     buffer = _PyObject_GetAttrId(outf, &PyId_buffer);
     if (buffer) {
-        _Py_IDENTIFIER(write);
         result = _PyObject_CallMethodId(buffer, &PyId_write, "(O)", encoded);
         Py_DECREF(buffer);
         Py_DECREF(encoded);
@@ -137,10 +165,11 @@
     PyObject *outf;
     PyInterpreterState *interp = PyThreadState_GET()->interp;
     PyObject *modules = interp->modules;
-    PyObject *builtins = PyDict_GetItemString(modules, "builtins");
+    PyObject *builtins;
+    static PyObject *newline = NULL;
     int err;
-    _Py_IDENTIFIER(_);
 
+    builtins = _PyDict_GetItemId(modules, &PyId_builtins);
     if (builtins == NULL) {
         PyErr_SetString(PyExc_RuntimeError, "lost builtins module");
         return NULL;
@@ -155,7 +184,7 @@
     }
     if (_PyObject_SetAttrId(builtins, &PyId__, Py_None) != 0)
         return NULL;
-    outf = PySys_GetObject("stdout");
+    outf = _PySys_GetObjectId(&PyId_stdout);
     if (outf == NULL || outf == Py_None) {
         PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
         return NULL;
@@ -173,7 +202,12 @@
             return NULL;
         }
     }
-    if (PyFile_WriteString("\n", outf) != 0)
+    if (newline == NULL) {
+        newline = PyUnicode_FromString("\n");
+        if (newline == NULL)
+            return NULL;
+    }
+    if (PyFile_WriteObject(newline, outf, Py_PRINT_RAW) != 0)
         return NULL;
     if (_PyObject_SetAttrId(builtins, &PyId__, o) != 0)
         return NULL;
@@ -329,15 +363,19 @@
 
 
 static PyObject *
-call_trampoline(PyThreadState *tstate, PyObject* callback,
+call_trampoline(PyObject* callback,
                 PyFrameObject *frame, int what, PyObject *arg)
 {
-    PyObject *args = PyTuple_New(3);
+    PyObject *args;
     PyObject *whatstr;
     PyObject *result;
 
+    args = PyTuple_New(3);
     if (args == NULL)
         return NULL;
+    if (PyFrame_FastToLocalsWithError(frame) < 0)
+        return NULL;
+
     Py_INCREF(frame);
     whatstr = whatstrings[what];
     Py_INCREF(whatstr);
@@ -349,7 +387,6 @@
     PyTuple_SET_ITEM(args, 2, arg);
 
     /* call the Python-level function */
-    PyFrame_FastToLocals(frame);
     result = PyEval_CallObject(callback, args);
     PyFrame_LocalsToFast(frame, 1);
     if (result == NULL)
@@ -364,12 +401,11 @@
 profile_trampoline(PyObject *self, PyFrameObject *frame,
                    int what, PyObject *arg)
 {
-    PyThreadState *tstate = frame->f_tstate;
     PyObject *result;
 
     if (arg == NULL)
         arg = Py_None;
-    result = call_trampoline(tstate, self, frame, what, arg);
+    result = call_trampoline(self, frame, what, arg);
     if (result == NULL) {
         PyEval_SetProfile(NULL, NULL);
         return -1;
@@ -382,7 +418,6 @@
 trace_trampoline(PyObject *self, PyFrameObject *frame,
                  int what, PyObject *arg)
 {
-    PyThreadState *tstate = frame->f_tstate;
     PyObject *callback;
     PyObject *result;
 
@@ -392,7 +427,7 @@
         callback = frame->f_trace;
     if (callback == NULL)
         return 0;
-    result = call_trampoline(tstate, callback, frame, what, arg);
+    result = call_trampoline(callback, frame, what, arg);
     if (result == NULL) {
         PyEval_SetTrace(NULL, NULL);
         Py_CLEAR(frame->f_trace);
@@ -616,7 +651,7 @@
 "hash_info\n\
 \n\
 A struct sequence providing parameters used for computing\n\
-numeric hashes.  The attributes are read only.");
+hashes. The attributes are read only.");
 
 static PyStructSequence_Field hash_info_fields[] = {
     {"width", "width of the type used for hashing, in bits"},
@@ -625,6 +660,11 @@
     {"inf", "value to be used for hash of a positive infinity"},
     {"nan", "value to be used for hash of a nan"},
     {"imag", "multiplier used for the imaginary part of a complex number"},
+    {"algorithm", "name of the algorithm for hashing of str, bytes and "
+                  "memoryviews"},
+    {"hash_bits", "internal output size of hash algorithm"},
+    {"seed_bits", "seed size of hash algorithm"},
+    {"cutoff", "small string optimization cutoff"},
     {NULL, NULL}
 };
 
@@ -632,7 +672,7 @@
     "sys.hash_info",
     hash_info_doc,
     hash_info_fields,
-    5,
+    9,
 };
 
 static PyObject *
@@ -640,9 +680,11 @@
 {
     PyObject *hash_info;
     int field = 0;
+    PyHash_FuncDef *hashfunc;
     hash_info = PyStructSequence_New(&Hash_InfoType);
     if (hash_info == NULL)
         return NULL;
+    hashfunc = PyHash_GetFuncDef();
     PyStructSequence_SET_ITEM(hash_info, field++,
                               PyLong_FromLong(8*sizeof(Py_hash_t)));
     PyStructSequence_SET_ITEM(hash_info, field++,
@@ -653,6 +695,14 @@
                               PyLong_FromLong(_PyHASH_NAN));
     PyStructSequence_SET_ITEM(hash_info, field++,
                               PyLong_FromLong(_PyHASH_IMAG));
+    PyStructSequence_SET_ITEM(hash_info, field++,
+                              PyUnicode_FromString(hashfunc->name));
+    PyStructSequence_SET_ITEM(hash_info, field++,
+                              PyLong_FromLong(hashfunc->hash_bits));
+    PyStructSequence_SET_ITEM(hash_info, field++,
+                              PyLong_FromLong(hashfunc->seed_bits));
+    PyStructSequence_SET_ITEM(hash_info, field++,
+                              PyLong_FromLong(Py_HASH_CUTOFF));
     if (PyErr_Occurred()) {
         Py_CLEAR(hash_info);
         return NULL;
@@ -777,7 +827,7 @@
 interpreter loads extension modules.  Among other things, this will enable\n\
 a lazy resolving of symbols when importing a module, if called as\n\
 sys.setdlopenflags(0).  To share symbols across extension modules, call as\n\
-sys.setdlopenflags(ctypes.RTLD_GLOBAL).  Symbolic names for the flag modules\n\
+sys.setdlopenflags(os.RTLD_GLOBAL).  Symbolic names for the flag modules\n\
 can be found in the os module (RTLD_xxx constants, e.g. os.RTLD_LAZY).");
 
 static PyObject *
@@ -793,7 +843,7 @@
 "getdlopenflags() -> int\n\
 \n\
 Return the current value of the flags that are used for dlopen calls.\n\
-The flag constants are defined in the ctypes and DLFCN modules.");
+The flag constants are defined in the os module.");
 
 #endif  /* HAVE_DLOPEN */
 
@@ -813,30 +863,16 @@
 }
 #endif /* USE_MALLOPT */
 
-static PyObject *
-sys_getsizeof(PyObject *self, PyObject *args, PyObject *kwds)
+size_t
+_PySys_GetSizeOf(PyObject *o)
 {
     PyObject *res = NULL;
-    static PyObject *gc_head_size = NULL;
-    static char *kwlist[] = {"object", "default", 0};
-    PyObject *o, *dflt = NULL;
     PyObject *method;
-    _Py_IDENTIFIER(__sizeof__);
-
-    if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O:getsizeof",
-                                     kwlist, &o, &dflt))
-        return NULL;
-
-    /* Initialize static variable for GC head size */
-    if (gc_head_size == NULL) {
-        gc_head_size = PyLong_FromSsize_t(sizeof(PyGC_Head));
-        if (gc_head_size == NULL)
-            return NULL;
-    }
+    Py_ssize_t size;
 
     /* Make sure the type is initialized. float gets initialized late */
     if (PyType_Ready(Py_TYPE(o)) < 0)
-        return NULL;
+        return (size_t)-1;
 
     method = _PyObject_LookupSpecial(o, &PyId___sizeof__);
     if (method == NULL) {
@@ -850,24 +886,50 @@
         Py_DECREF(method);
     }
 
-    /* Has a default value been given */
-    if ((res == NULL) && (dflt != NULL) &&
-        PyErr_ExceptionMatches(PyExc_TypeError))
-    {
-        PyErr_Clear();
-        Py_INCREF(dflt);
-        return dflt;
+    if (res == NULL)
+        return (size_t)-1;
+
+    size = PyLong_AsSsize_t(res);
+    Py_DECREF(res);
+    if (size == -1 && PyErr_Occurred())
+        return (size_t)-1;
+
+    if (size < 0) {
+        PyErr_SetString(PyExc_ValueError, "__sizeof__() should return >= 0");
+        return (size_t)-1;
     }
-    else if (res == NULL)
-        return res;
 
     /* add gc_head size */
-    if (PyObject_IS_GC(o)) {
-        PyObject *tmp = res;
-        res = PyNumber_Add(tmp, gc_head_size);
-        Py_DECREF(tmp);
+    if (PyObject_IS_GC(o))
+        return ((size_t)size) + sizeof(PyGC_Head);
+    return (size_t)size;
+}
+
+static PyObject *
+sys_getsizeof(PyObject *self, PyObject *args, PyObject *kwds)
+{
+    static char *kwlist[] = {"object", "default", 0};
+    size_t size;
+    PyObject *o, *dflt = NULL;
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O:getsizeof",
+                                     kwlist, &o, &dflt))
+        return NULL;
+
+    size = _PySys_GetSizeOf(o);
+
+    if (size == (size_t)-1 && PyErr_Occurred()) {
+        /* Has a default value been given */
+        if (dflt != NULL && PyErr_ExceptionMatches(PyExc_TypeError)) {
+            PyErr_Clear();
+            Py_INCREF(dflt);
+            return dflt;
+        }
+        else
+            return NULL;
     }
-    return res;
+
+    return PyLong_FromSize_t(size);
 }
 
 PyDoc_STRVAR(getsizeof_doc,
@@ -897,6 +959,19 @@
 reference as an argument to getrefcount()."
 );
 
+static PyObject *
+sys_getallocatedblocks(PyObject *self)
+{
+    return PyLong_FromSsize_t(_Py_GetAllocatedBlocks());
+}
+
+PyDoc_STRVAR(getallocatedblocks_doc,
+"getallocatedblocks() -> integer\n\
+\n\
+Return the number of memory blocks currently allocated, regardless of their\n\
+size."
+);
+
 #ifdef COUNT_ALLOCS
 static PyObject *
 sys_getcounts(PyObject *self)
@@ -1065,6 +1140,8 @@
     {"getdlopenflags", (PyCFunction)sys_getdlopenflags, METH_NOARGS,
      getdlopenflags_doc},
 #endif
+    {"getallocatedblocks", (PyCFunction)sys_getallocatedblocks, METH_NOARGS,
+      getallocatedblocks_doc},
 #ifdef COUNT_ALLOCS
     {"getcounts",       (PyCFunction)sys_getcounts, METH_NOARGS},
 #endif
@@ -1117,7 +1194,7 @@
     {"settrace",        sys_settrace, METH_O, settrace_doc},
     {"gettrace",        sys_gettrace, METH_NOARGS, gettrace_doc},
     {"call_tracing", sys_call_tracing, METH_VARARGS, call_tracing_doc},
-    {"_debugmallocstats", sys_debugmallocstats, METH_VARARGS,
+    {"_debugmallocstats", sys_debugmallocstats, METH_NOARGS,
      debugmallocstats_doc},
     {NULL,              NULL}           /* sentinel */
 };
@@ -1286,11 +1363,12 @@
 executable -- absolute path of the executable binary of the Python interpreter\n\
 float_info -- a struct sequence with information about the float implementation.\n\
 float_repr_style -- string indicating the style of repr() output for floats\n\
+hash_info -- a struct sequence with information about the hash algorithm.\n\
 hexversion -- version information encoded as a single integer\n\
 implementation -- Python implementation information.\n\
 int_info -- a struct sequence with information about the int implementation.\n\
 maxsize -- the largest supported length of containers.\n\
-maxunicode -- the value of the largest Unicode codepoint\n\
+maxunicode -- the value of the largest Unicode code point\n\
 platform -- platform identifier\n\
 prefix -- prefix used to find the Python library\n\
 thread_info -- a struct sequence with information about the thread implementation.\n\
@@ -1352,14 +1430,12 @@
     {"no_site",                 "-S"},
     {"ignore_environment",      "-E"},
     {"verbose",                 "-v"},
-#ifdef RISCOS
-    {"riscos_wimp",             "???"},
-#endif
     /* {"unbuffered",                   "-u"}, */
     /* {"skip_first",                   "-x"}, */
     {"bytes_warning",           "-b"},
     {"quiet",                   "-q"},
     {"hash_randomization",      "-R"},
+    {"isolated",                "-I"},
     {0}
 };
 
@@ -1367,11 +1443,7 @@
     "sys.flags",        /* name */
     flags__doc__,       /* doc */
     flags_fields,       /* fields */
-#ifdef RISCOS
     13
-#else
-    12
-#endif
 };
 
 static PyObject*
@@ -1396,14 +1468,12 @@
     SetFlag(Py_NoSiteFlag);
     SetFlag(Py_IgnoreEnvironmentFlag);
     SetFlag(Py_VerboseFlag);
-#ifdef RISCOS
-    SetFlag(Py_RISCOSWimpFlag);
-#endif
     /* SetFlag(saw_unbuffered_flag); */
     /* SetFlag(skipfirstline); */
     SetFlag(Py_BytesWarningFlag);
     SetFlag(Py_QuietFlag);
     SetFlag(Py_HashRandomizationFlag);
+    SetFlag(Py_IsolatedFlag);
 #undef SetFlag
 
     if (PyErr_Occurred()) {
@@ -1489,7 +1559,7 @@
 #define STRIFY(name) QUOTE(name)
 #define MAJOR STRIFY(PY_MAJOR_VERSION)
 #define MINOR STRIFY(PY_MINOR_VERSION)
-#define TAG NAME "-" MAJOR MINOR;
+#define TAG NAME "-" MAJOR MINOR
 const char *_PySys_ImplCacheTag = TAG;
 #undef NAME
 #undef QUOTE
@@ -1564,18 +1634,34 @@
 PyObject *
 _PySys_Init(void)
 {
-    PyObject *m, *v, *sysdict, *version_info;
-    char *s;
+    PyObject *m, *sysdict, *version_info;
+    int res;
 
     m = PyModule_Create(&sysmodule);
     if (m == NULL)
         return NULL;
     sysdict = PyModule_GetDict(m);
-#define SET_SYS_FROM_STRING(key, value)                 \
-    v = value;                                          \
-    if (v != NULL)                                      \
-        PyDict_SetItemString(sysdict, key, v);          \
-    Py_XDECREF(v)
+#define SET_SYS_FROM_STRING_BORROW(key, value)             \
+    do {                                                   \
+        PyObject *v = (value);                             \
+        if (v == NULL)                                     \
+            return NULL;                                   \
+        res = PyDict_SetItemString(sysdict, key, v);       \
+        if (res < 0) {                                     \
+            return NULL;                                   \
+        }                                                  \
+    } while (0)
+#define SET_SYS_FROM_STRING(key, value)                    \
+    do {                                                   \
+        PyObject *v = (value);                             \
+        if (v == NULL)                                     \
+            return NULL;                                   \
+        res = PyDict_SetItemString(sysdict, key, v);       \
+        Py_DECREF(v);                                      \
+        if (res < 0) {                                     \
+            return NULL;                                   \
+        }                                                  \
+    } while (0)
 
     /* Check that stdin is not a directory
     Using shell redirection, you can redirect stdin to a directory,
@@ -1597,10 +1683,10 @@
 
     /* stdin/stdout/stderr are now set by pythonrun.c */
 
-    PyDict_SetItemString(sysdict, "__displayhook__",
-                         PyDict_GetItemString(sysdict, "displayhook"));
-    PyDict_SetItemString(sysdict, "__excepthook__",
-                         PyDict_GetItemString(sysdict, "excepthook"));
+    SET_SYS_FROM_STRING_BORROW("__displayhook__",
+                               PyDict_GetItemString(sysdict, "displayhook"));
+    SET_SYS_FROM_STRING_BORROW("__excepthook__",
+                               PyDict_GetItemString(sysdict, "excepthook"));
     SET_SYS_FROM_STRING("version",
                          PyUnicode_FromString(Py_GetVersion()));
     SET_SYS_FROM_STRING("hexversion",
@@ -1634,28 +1720,24 @@
     SET_SYS_FROM_STRING("int_info",
                         PyLong_GetInfo());
     /* initialize hash_info */
-    if (Hash_InfoType.tp_name == 0)
-        PyStructSequence_InitType(&Hash_InfoType, &hash_info_desc);
+    if (Hash_InfoType.tp_name == NULL) {
+        if (PyStructSequence_InitType2(&Hash_InfoType, &hash_info_desc) < 0)
+            return NULL;
+    }
     SET_SYS_FROM_STRING("hash_info",
                         get_hash_info());
     SET_SYS_FROM_STRING("maxunicode",
                         PyLong_FromLong(0x10FFFF));
     SET_SYS_FROM_STRING("builtin_module_names",
                         list_builtin_module_names());
-    {
-        /* Assumes that longs are at least 2 bytes long.
-           Should be safe! */
-        unsigned long number = 1;
-        char *value;
+#if PY_BIG_ENDIAN
+    SET_SYS_FROM_STRING("byteorder",
+                        PyUnicode_FromString("big"));
+#else
+    SET_SYS_FROM_STRING("byteorder",
+                        PyUnicode_FromString("little"));
+#endif
 
-        s = (char *) &number;
-        if (s[0] == 0)
-            value = "big";
-        else
-            value = "little";
-        SET_SYS_FROM_STRING("byteorder",
-                            PyUnicode_FromString(value));
-    }
 #ifdef MS_COREDLL
     SET_SYS_FROM_STRING("dllhandle",
                         PyLong_FromVoidPtr(PyWin_DLLhModule));
@@ -1668,47 +1750,59 @@
 #endif
     if (warnoptions == NULL) {
         warnoptions = PyList_New(0);
+        if (warnoptions == NULL)
+            return NULL;
     }
     else {
         Py_INCREF(warnoptions);
     }
-    if (warnoptions != NULL) {
-        PyDict_SetItemString(sysdict, "warnoptions", warnoptions);
-    }
+    SET_SYS_FROM_STRING_BORROW("warnoptions", warnoptions);
 
-    v = get_xoptions();
-    if (v != NULL) {
-        PyDict_SetItemString(sysdict, "_xoptions", v);
-    }
+    SET_SYS_FROM_STRING_BORROW("_xoptions", get_xoptions());
 
     /* version_info */
-    if (VersionInfoType.tp_name == 0)
-        PyStructSequence_InitType(&VersionInfoType, &version_info_desc);
+    if (VersionInfoType.tp_name == NULL) {
+        if (PyStructSequence_InitType2(&VersionInfoType,
+                                       &version_info_desc) < 0)
+            return NULL;
+    }
     version_info = make_version_info();
     SET_SYS_FROM_STRING("version_info", version_info);
     /* prevent user from creating new instances */
     VersionInfoType.tp_init = NULL;
     VersionInfoType.tp_new = NULL;
+    res = PyDict_DelItemString(VersionInfoType.tp_dict, "__new__");
+    if (res < 0 && PyErr_ExceptionMatches(PyExc_KeyError))
+        PyErr_Clear();
 
     /* implementation */
     SET_SYS_FROM_STRING("implementation", make_impl_info(version_info));
 
     /* flags */
-    if (FlagsType.tp_name == 0)
-        PyStructSequence_InitType(&FlagsType, &flags_desc);
+    if (FlagsType.tp_name == 0) {
+        if (PyStructSequence_InitType2(&FlagsType, &flags_desc) < 0)
+            return NULL;
+    }
     SET_SYS_FROM_STRING("flags", make_flags());
     /* prevent user from creating new instances */
     FlagsType.tp_init = NULL;
     FlagsType.tp_new = NULL;
-
+    res = PyDict_DelItemString(FlagsType.tp_dict, "__new__");
+    if (res < 0 && PyErr_ExceptionMatches(PyExc_KeyError))
+        PyErr_Clear();
 
 #if defined(MS_WINDOWS)
     /* getwindowsversion */
     if (WindowsVersionType.tp_name == 0)
-        PyStructSequence_InitType(&WindowsVersionType, &windows_version_desc);
+        if (PyStructSequence_InitType2(&WindowsVersionType,
+                                       &windows_version_desc) < 0)
+            return NULL;
     /* prevent user from creating new instances */
     WindowsVersionType.tp_init = NULL;
     WindowsVersionType.tp_new = NULL;
+    res = PyDict_DelItemString(WindowsVersionType.tp_dict, "__new__");
+    if (res < 0 && PyErr_ExceptionMatches(PyExc_KeyError))
+        PyErr_Clear();
 #endif
 
     /* float repr style: 0.03 (short) vs 0.029999999999999999 (legacy) */
@@ -1725,6 +1819,7 @@
 #endif
 
 #undef SET_SYS_FROM_STRING
+#undef SET_SYS_FROM_STRING_BORROW
     if (PyErr_Occurred())
         return NULL;
     return m;
@@ -1769,7 +1864,7 @@
     PyObject *v;
     if ((v = makepathobject(path, DELIM)) == NULL)
         Py_FatalError("can't create sys.path");
-    if (PySys_SetObject("path", v) != 0)
+    if (_PySys_SetObjectId(&PyId_path, v) != 0)
         Py_FatalError("can't assign sys.path");
     Py_DECREF(v);
 }
@@ -1788,22 +1883,7 @@
     if (av != NULL) {
         int i;
         for (i = 0; i < argc; i++) {
-#ifdef __VMS
-            PyObject *v;
-
-            /* argv[0] is the script pathname if known */
-            if (i == 0) {
-                char* fn = decc$translate_vms(argv[0]);
-                if ((fn == (char *)0) || fn == (char *)-1)
-                    v = PyUnicode_FromString(argv[0]);
-                else
-                    v = PyUnicode_FromString(
-                        decc$translate_vms(argv[0]));
-            } else
-                v = PyUnicode_FromString(argv[i]);
-#else
             PyObject *v = PyUnicode_FromWideChar(argv[i], -1);
-#endif
             if (v == NULL) {
                 Py_DECREF(av);
                 av = NULL;
@@ -1838,7 +1918,7 @@
     wchar_t fullpath[MAX_PATH];
 #endif
 
-    path = PySys_GetObject("path");
+    path = _PySys_GetObjectId(&PyId_path);
     if (path == NULL)
         return;
 
@@ -1937,7 +2017,7 @@
 void
 PySys_SetArgv(int argc, wchar_t **argv)
 {
-    PySys_SetArgvEx(argc, argv, 1);
+    PySys_SetArgvEx(argc, argv, Py_IsolatedFlag == 0);
 }
 
 /* Reimplementation of PyFile_WriteString() no calling indirectly
@@ -1948,7 +2028,6 @@
 {
     PyObject *writer = NULL, *args = NULL, *result = NULL;
     int err;
-    _Py_IDENTIFIER(write);
 
     if (file == NULL)
         return -1;
@@ -2025,7 +2104,7 @@
  */
 
 static void
-sys_write(char *name, FILE *fp, const char *format, va_list va)
+sys_write(_Py_Identifier *key, FILE *fp, const char *format, va_list va)
 {
     PyObject *file;
     PyObject *error_type, *error_value, *error_traceback;
@@ -2033,7 +2112,7 @@
     int written;
 
     PyErr_Fetch(&error_type, &error_value, &error_traceback);
-    file = PySys_GetObject(name);
+    file = _PySys_GetObjectId(key);
     written = PyOS_vsnprintf(buffer, sizeof(buffer), format, va);
     if (sys_pyfile_write(buffer, file) != 0) {
         PyErr_Clear();
@@ -2053,7 +2132,7 @@
     va_list va;
 
     va_start(va, format);
-    sys_write("stdout", stdout, format, va);
+    sys_write(&PyId_stdout, stdout, format, va);
     va_end(va);
 }
 
@@ -2063,19 +2142,19 @@
     va_list va;
 
     va_start(va, format);
-    sys_write("stderr", stderr, format, va);
+    sys_write(&PyId_stderr, stderr, format, va);
     va_end(va);
 }
 
 static void
-sys_format(char *name, FILE *fp, const char *format, va_list va)
+sys_format(_Py_Identifier *key, FILE *fp, const char *format, va_list va)
 {
     PyObject *file, *message;
     PyObject *error_type, *error_value, *error_traceback;
     char *utf8;
 
     PyErr_Fetch(&error_type, &error_value, &error_traceback);
-    file = PySys_GetObject(name);
+    file = _PySys_GetObjectId(key);
     message = PyUnicode_FromFormatV(format, va);
     if (message != NULL) {
         if (sys_pyfile_write_unicode(message, file) != 0) {
@@ -2095,7 +2174,7 @@
     va_list va;
 
     va_start(va, format);
-    sys_format("stdout", stdout, format, va);
+    sys_format(&PyId_stdout, stdout, format, va);
     va_end(va);
 }
 
@@ -2105,6 +2184,6 @@
     va_list va;
 
     va_start(va, format);
-    sys_format("stderr", stderr, format, va);
+    sys_format(&PyId_stderr, stderr, format, va);
     va_end(va);
 }
diff --git a/Python/thread.c b/Python/thread.c
index e55d342..4e695ae 100644
--- a/Python/thread.c
+++ b/Python/thread.c
@@ -91,10 +91,6 @@
 #include "thread_nt.h"
 #endif
 
-#ifdef OS2_THREADS
-#define PYTHREAD_NAME "os2"
-#include "thread_os2.h"
-#endif
 
 /*
 #ifdef FOOBAR_THREADS
@@ -209,7 +205,7 @@
  * segfaults.  Now we lock the whole routine.
  */
 static struct key *
-find_key(int key, void *value)
+find_key(int set_value, int key, void *value)
 {
     struct key *p, *prev_p;
     long id = PyThread_get_thread_ident();
@@ -219,10 +215,13 @@
     PyThread_acquire_lock(keymutex, 1);
     prev_p = NULL;
     for (p = keyhead; p != NULL; p = p->next) {
-        if (p->id == id && p->key == key)
+        if (p->id == id && p->key == key) {
+            if (set_value)
+                p->value = value;
             goto Done;
+        }
         /* Sanity check.  These states should never happen but if
-         * they do we must abort.  Otherwise we'll end up spinning in
+         * they do we must abort.  Otherwise we'll end up spinning
          * in a tight loop with the lock held.  A similar check is done
          * in pystate.c tstate_delete_common().  */
         if (p == prev_p)
@@ -231,11 +230,11 @@
         if (p->next == keyhead)
             Py_FatalError("tls find_key: circular list(!)");
     }
-    if (value == NULL) {
+    if (!set_value && value == NULL) {
         assert(p == NULL);
         goto Done;
     }
-    p = (struct key *)malloc(sizeof(struct key));
+    p = (struct key *)PyMem_RawMalloc(sizeof(struct key));
     if (p != NULL) {
         p->id = id;
         p->key = key;
@@ -274,7 +273,7 @@
     while ((p = *q) != NULL) {
         if (p->key == key) {
             *q = p->next;
-            free((void *)p);
+            PyMem_RawFree((void *)p);
             /* NB This does *not* free p->value! */
         }
         else
@@ -283,19 +282,12 @@
     PyThread_release_lock(keymutex);
 }
 
-/* Confusing:  If the current thread has an association for key,
- * value is ignored, and 0 is returned.  Else an attempt is made to create
- * an association of key to value for the current thread.  0 is returned
- * if that succeeds, but -1 is returned if there's not enough memory
- * to create the association.  value must not be NULL.
- */
 int
 PyThread_set_key_value(int key, void *value)
 {
     struct key *p;
 
-    assert(value != NULL);
-    p = find_key(key, value);
+    p = find_key(1, key, value);
     if (p == NULL)
         return -1;
     else
@@ -308,7 +300,7 @@
 void *
 PyThread_get_key_value(int key)
 {
-    struct key *p = find_key(key, NULL);
+    struct key *p = find_key(0, key, NULL);
 
     if (p == NULL)
         return NULL;
@@ -328,7 +320,7 @@
     while ((p = *q) != NULL) {
         if (p->key == key && p->id == id) {
             *q = p->next;
-            free((void *)p);
+            PyMem_RawFree((void *)p);
             /* NB This does *not* free p->value! */
             break;
         }
@@ -361,7 +353,7 @@
     while ((p = *q) != NULL) {
         if (p->id != id) {
             *q = p->next;
-            free((void *)p);
+            PyMem_RawFree((void *)p);
             /* NB This does *not* free p->value! */
         }
         else
@@ -403,8 +395,10 @@
     int len;
 #endif
 
-    if (ThreadInfoType.tp_name == 0)
-        PyStructSequence_InitType(&ThreadInfoType, &threadinfo_desc);
+    if (ThreadInfoType.tp_name == 0) {
+        if (PyStructSequence_InitType2(&ThreadInfoType, &threadinfo_desc) < 0)
+            return NULL;
+    }
 
     threadinfo = PyStructSequence_New(&ThreadInfoType);
     if (threadinfo == NULL)
diff --git a/Python/thread_nt.h b/Python/thread_nt.h
index b157fc5..84452cd 100644
--- a/Python/thread_nt.h
+++ b/Python/thread_nt.h
@@ -34,7 +34,7 @@
 PNRMUTEX
 AllocNonRecursiveMutex()
 {
-    PNRMUTEX m = (PNRMUTEX)malloc(sizeof(NRMUTEX));
+    PNRMUTEX m = (PNRMUTEX)PyMem_RawMalloc(sizeof(NRMUTEX));
     if (!m)
         return NULL;
     if (PyCOND_INIT(&m->cv))
@@ -46,7 +46,7 @@
     m->locked = 0;
     return m;
 fail:
-    free(m);
+    PyMem_RawFree(m);
     return NULL;
 }
 
@@ -56,7 +56,7 @@
     if (mutex) {
         PyCOND_FINI(&mutex->cv);
         PyMUTEX_FINI(&mutex->cs);
-        free(mutex);
+        PyMem_RawFree(mutex);
     }
 }
 
@@ -107,7 +107,7 @@
     result = PyCOND_SIGNAL(&mutex->cv);
     result &= PyMUTEX_UNLOCK(&mutex->cs);
     return result;
-}    
+}
 
 #else /* if ! _PY_USE_CV_LOCKS */
 
@@ -130,7 +130,7 @@
 DWORD
 EnterNonRecursiveMutex(PNRMUTEX mutex, DWORD milliseconds)
 {
-    return WaitForSingleObject(mutex, milliseconds);
+    return WaitForSingleObjectEx(mutex, milliseconds, FALSE);
 }
 
 BOOL
@@ -389,20 +389,11 @@
     TlsFree(key);
 }
 
-/* We must be careful to emulate the strange semantics implemented in thread.c,
- * where the value is only set if it hasn't been set before.
- */
 int
 PyThread_set_key_value(int key, void *value)
 {
     BOOL ok;
-    void *oldvalue;
 
-    assert(value != NULL);
-    oldvalue = TlsGetValue(key);
-    if (oldvalue != NULL)
-        /* ignore value if already set */
-        return 0;
     ok = TlsSetValue(key, value);
     if (!ok)
         return -1;
diff --git a/Python/thread_os2.h b/Python/thread_os2.h
deleted file mode 100644
index 1b264b5..0000000
--- a/Python/thread_os2.h
+++ /dev/null
@@ -1,267 +0,0 @@
-/* This code implemented by cvale@netcom.com */
-
-#define INCL_DOSPROCESS
-#define INCL_DOSSEMAPHORES
-#include "os2.h"
-#include "limits.h"
-
-#include "process.h"
-
-#if defined(PYCC_GCC)
-#include <sys/builtin.h>
-#include <sys/fmutex.h>
-#else
-long PyThread_get_thread_ident(void);
-#endif
-
-/* default thread stack size of 64kB */
-#if !defined(THREAD_STACK_SIZE)
-#define THREAD_STACK_SIZE       0x10000
-#endif
-
-#define OS2_STACKSIZE(x)        (x ? x : THREAD_STACK_SIZE)
-
-/*
- * Initialization of the C package, should not be needed.
- */
-static void
-PyThread__init_thread(void)
-{
-}
-
-/*
- * Thread support.
- */
-long
-PyThread_start_new_thread(void (*func)(void *), void *arg)
-{
-    int thread_id;
-
-    thread_id = _beginthread(func,
-                            NULL,
-                            OS2_STACKSIZE(_pythread_stacksize),
-                            arg);
-
-    if (thread_id == -1) {
-        dprintf(("_beginthread failed. return %ld\n", errno));
-    }
-
-    return thread_id;
-}
-
-long
-PyThread_get_thread_ident(void)
-{
-#if !defined(PYCC_GCC)
-    PPIB pib;
-    PTIB tib;
-#endif
-
-    if (!initialized)
-        PyThread_init_thread();
-
-#if defined(PYCC_GCC)
-    return _gettid();
-#else
-    DosGetInfoBlocks(&tib, &pib);
-    return tib->tib_ptib2->tib2_ultid;
-#endif
-}
-
-void
-PyThread_exit_thread(void)
-{
-    dprintf(("%ld: PyThread_exit_thread called\n",
-             PyThread_get_thread_ident()));
-    if (!initialized)
-        exit(0);
-    _endthread();
-}
-
-/*
- * Lock support.  This is implemented with an event semaphore and critical
- * sections to make it behave more like a posix mutex than its OS/2
- * counterparts.
- */
-
-typedef struct os2_lock_t {
-    int is_set;
-    HEV changed;
-} *type_os2_lock;
-
-PyThread_type_lock
-PyThread_allocate_lock(void)
-{
-#if defined(PYCC_GCC)
-    _fmutex *sem = malloc(sizeof(_fmutex));
-    if (!initialized)
-        PyThread_init_thread();
-    dprintf(("%ld: PyThread_allocate_lock() -> %lx\n",
-             PyThread_get_thread_ident(),
-             (long)sem));
-    if (_fmutex_create(sem, 0)) {
-        free(sem);
-        sem = NULL;
-    }
-    return (PyThread_type_lock)sem;
-#else
-    APIRET rc;
-    type_os2_lock lock = (type_os2_lock)malloc(sizeof(struct os2_lock_t));
-
-    dprintf(("PyThread_allocate_lock called\n"));
-    if (!initialized)
-        PyThread_init_thread();
-
-    lock->is_set = 0;
-
-    DosCreateEventSem(NULL, &lock->changed, 0, 0);
-
-    dprintf(("%ld: PyThread_allocate_lock() -> %p\n",
-             PyThread_get_thread_ident(),
-             lock->changed));
-
-    return (PyThread_type_lock)lock;
-#endif
-}
-
-void
-PyThread_free_lock(PyThread_type_lock aLock)
-{
-#if !defined(PYCC_GCC)
-    type_os2_lock lock = (type_os2_lock)aLock;
-#endif
-
-    dprintf(("%ld: PyThread_free_lock(%p) called\n",
-             PyThread_get_thread_ident(),aLock));
-
-#if defined(PYCC_GCC)
-    if (aLock) {
-        _fmutex_close((_fmutex *)aLock);
-        free((_fmutex *)aLock);
-    }
-#else
-    DosCloseEventSem(lock->changed);
-    free(aLock);
-#endif
-}
-
-/*
- * Return 1 on success if the lock was acquired
- *
- * and 0 if the lock was not acquired.
- */
-int
-PyThread_acquire_lock(PyThread_type_lock aLock, int waitflag)
-{
-#if !defined(PYCC_GCC)
-    int   done = 0;
-    ULONG count;
-    PID   pid = 0;
-    TID   tid = 0;
-    type_os2_lock lock = (type_os2_lock)aLock;
-#endif
-
-    dprintf(("%ld: PyThread_acquire_lock(%p, %d) called\n",
-             PyThread_get_thread_ident(),
-             aLock,
-             waitflag));
-
-#if defined(PYCC_GCC)
-    /* always successful if the lock doesn't exist */
-    if (aLock &&
-        _fmutex_request((_fmutex *)aLock, waitflag ? 0 : _FMR_NOWAIT))
-        return 0;
-#else
-    while (!done) {
-        /* if the lock is currently set, we have to wait for
-         * the state to change
-         */
-        if (lock->is_set) {
-            if (!waitflag)
-                return 0;
-            DosWaitEventSem(lock->changed, SEM_INDEFINITE_WAIT);
-        }
-
-        /* enter a critical section and try to get the semaphore.  If
-         * it is still locked, we will try again.
-         */
-        if (DosEnterCritSec())
-            return 0;
-
-        if (!lock->is_set) {
-            lock->is_set = 1;
-            DosResetEventSem(lock->changed, &count);
-            done = 1;
-        }
-
-        DosExitCritSec();
-    }
-#endif
-
-    return 1;
-}
-
-void
-PyThread_release_lock(PyThread_type_lock aLock)
-{
-#if !defined(PYCC_GCC)
-    type_os2_lock lock = (type_os2_lock)aLock;
-#endif
-
-    dprintf(("%ld: PyThread_release_lock(%p) called\n",
-             PyThread_get_thread_ident(),
-             aLock));
-
-#if defined(PYCC_GCC)
-    if (aLock)
-        _fmutex_release((_fmutex *)aLock);
-#else
-    if (!lock->is_set) {
-        dprintf(("%ld: Could not PyThread_release_lock(%p) error: %l\n",
-                 PyThread_get_thread_ident(),
-                 aLock,
-                 GetLastError()));
-        return;
-    }
-
-    if (DosEnterCritSec()) {
-        dprintf(("%ld: Could not PyThread_release_lock(%p) error: %l\n",
-                 PyThread_get_thread_ident(),
-                 aLock,
-                 GetLastError()));
-        return;
-    }
-
-    lock->is_set = 0;
-    DosPostEventSem(lock->changed);
-
-    DosExitCritSec();
-#endif
-}
-
-/* minimum/maximum thread stack sizes supported */
-#define THREAD_MIN_STACKSIZE    0x8000          /* 32kB */
-#define THREAD_MAX_STACKSIZE    0x2000000       /* 32MB */
-
-/* set the thread stack size.
- * Return 0 if size is valid, -1 otherwise.
- */
-static int
-_pythread_os2_set_stacksize(size_t size)
-{
-    /* set to default */
-    if (size == 0) {
-        _pythread_stacksize = 0;
-        return 0;
-    }
-
-    /* valid range? */
-    if (size >= THREAD_MIN_STACKSIZE && size < THREAD_MAX_STACKSIZE) {
-        _pythread_stacksize = size;
-        return 0;
-    }
-
-    return -1;
-}
-
-#define THREAD_SET_STACKSIZE(x) _pythread_os2_set_stacksize(x)
diff --git a/Python/thread_pth.h b/Python/thread_pth.h
deleted file mode 100644
index 5704266..0000000
--- a/Python/thread_pth.h
+++ /dev/null
@@ -1,177 +0,0 @@
-
-/* GNU pth threads interface
-   http://www.gnu.org/software/pth
-   2000-05-03 Andy Dustman <andy@dustman.net>
-
-   Adapted from Posix threads interface
-   12 May 1997 -- david arnold <davida@pobox.com>
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include <pth.h>
-
-/* A pth mutex isn't sufficient to model the Python lock type
- * because pth mutexes can be acquired multiple times by the
- * same thread.
- *
- * The pth_lock struct implements a Python lock as a "locked?" bit
- * and a <condition, mutex> pair.  In general, if the bit can be acquired
- * instantly, it is, else the pair is used to block the thread until the
- * bit is cleared.
- */
-
-typedef struct {
-    char             locked; /* 0=unlocked, 1=locked */
-    /* a <cond, mutex> pair to handle an acquire of a locked lock */
-    pth_cond_t   lock_released;
-    pth_mutex_t  mut;
-} pth_lock;
-
-#define CHECK_STATUS(name)  if (status == -1) { printf("%d ", status); perror(name); error = 1; }
-
-pth_attr_t PyThread_attr;
-
-/*
- * Initialization.
- */
-
-static void PyThread__init_thread(void)
-{
-    pth_init();
-    PyThread_attr = pth_attr_new();
-    pth_attr_set(PyThread_attr, PTH_ATTR_STACK_SIZE, 1<<18);
-    pth_attr_set(PyThread_attr, PTH_ATTR_JOINABLE, FALSE);
-}
-
-/*
- * Thread support.
- */
-
-
-long PyThread_start_new_thread(void (*func)(void *), void *arg)
-{
-    pth_t th;
-    dprintf(("PyThread_start_new_thread called\n"));
-    if (!initialized)
-        PyThread_init_thread();
-
-    th = pth_spawn(PyThread_attr,
-                             (void* (*)(void *))func,
-                             (void *)arg
-                             );
-
-    return th;
-}
-
-long PyThread_get_thread_ident(void)
-{
-    volatile pth_t threadid;
-    if (!initialized)
-        PyThread_init_thread();
-    threadid = pth_self();
-    return (long) threadid;
-}
-
-void PyThread_exit_thread(void)
-{
-    dprintf(("PyThread_exit_thread called\n"));
-    if (!initialized) {
-        exit(0);
-    }
-}
-
-/*
- * Lock support.
- */
-PyThread_type_lock PyThread_allocate_lock(void)
-{
-    pth_lock *lock;
-    int status, error = 0;
-
-    dprintf(("PyThread_allocate_lock called\n"));
-    if (!initialized)
-        PyThread_init_thread();
-
-    lock = (pth_lock *) malloc(sizeof(pth_lock));
-    memset((void *)lock, '\0', sizeof(pth_lock));
-    if (lock) {
-        lock->locked = 0;
-        status = pth_mutex_init(&lock->mut);
-        CHECK_STATUS("pth_mutex_init");
-        status = pth_cond_init(&lock->lock_released);
-        CHECK_STATUS("pth_cond_init");
-        if (error) {
-            free((void *)lock);
-            lock = NULL;
-        }
-    }
-    dprintf(("PyThread_allocate_lock() -> %p\n", lock));
-    return (PyThread_type_lock) lock;
-}
-
-void PyThread_free_lock(PyThread_type_lock lock)
-{
-    pth_lock *thelock = (pth_lock *)lock;
-
-    dprintf(("PyThread_free_lock(%p) called\n", lock));
-
-    free((void *)thelock);
-}
-
-int PyThread_acquire_lock(PyThread_type_lock lock, int waitflag)
-{
-    int success;
-    pth_lock *thelock = (pth_lock *)lock;
-    int status, error = 0;
-
-    dprintf(("PyThread_acquire_lock(%p, %d) called\n", lock, waitflag));
-
-    status = pth_mutex_acquire(&thelock->mut, !waitflag, NULL);
-    CHECK_STATUS("pth_mutex_acquire[1]");
-    success = thelock->locked == 0;
-    if (success) thelock->locked = 1;
-    status = pth_mutex_release( &thelock->mut );
-    CHECK_STATUS("pth_mutex_release[1]");
-
-    if ( !success && waitflag ) {
-        /* continue trying until we get the lock */
-
-        /* mut must be locked by me -- part of the condition
-         * protocol */
-        status = pth_mutex_acquire( &thelock->mut, !waitflag, NULL );
-        CHECK_STATUS("pth_mutex_acquire[2]");
-        while ( thelock->locked ) {
-            status = pth_cond_await(&thelock->lock_released,
-                                    &thelock->mut, NULL);
-            CHECK_STATUS("pth_cond_await");
-        }
-        thelock->locked = 1;
-        status = pth_mutex_release( &thelock->mut );
-        CHECK_STATUS("pth_mutex_release[2]");
-        success = 1;
-    }
-    if (error) success = 0;
-    dprintf(("PyThread_acquire_lock(%p, %d) -> %d\n", lock, waitflag, success));
-    return success;
-}
-
-void PyThread_release_lock(PyThread_type_lock lock)
-{
-    pth_lock *thelock = (pth_lock *)lock;
-    int status, error = 0;
-
-    dprintf(("PyThread_release_lock(%p) called\n", lock));
-
-    status = pth_mutex_acquire( &thelock->mut, 0, NULL );
-    CHECK_STATUS("pth_mutex_acquire[3]");
-
-    thelock->locked = 0;
-
-    status = pth_mutex_release( &thelock->mut );
-    CHECK_STATUS("pth_mutex_release[3]");
-
-    /* wake up someone (anyone, if any) waiting on the lock */
-    status = pth_cond_notify( &thelock->lock_released, 0 );
-    CHECK_STATUS("pth_cond_notify");
-}
diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h
index e90ae7e..d9f7c76 100644
--- a/Python/thread_pthread.h
+++ b/Python/thread_pthread.h
@@ -282,14 +282,14 @@
     if (!initialized)
         PyThread_init_thread();
 
-    lock = (sem_t *)malloc(sizeof(sem_t));
+    lock = (sem_t *)PyMem_RawMalloc(sizeof(sem_t));
 
     if (lock) {
         status = sem_init(lock,0,1);
         CHECK_STATUS("sem_init");
 
         if (error) {
-            free((void *)lock);
+            PyMem_RawFree((void *)lock);
             lock = NULL;
         }
     }
@@ -313,7 +313,7 @@
     status = sem_destroy(thelock);
     CHECK_STATUS("sem_destroy");
 
-    free((void *)thelock);
+    PyMem_RawFree((void *)thelock);
 }
 
 /*
@@ -410,7 +410,7 @@
     if (!initialized)
         PyThread_init_thread();
 
-    lock = (pthread_lock *) malloc(sizeof(pthread_lock));
+    lock = (pthread_lock *) PyMem_RawMalloc(sizeof(pthread_lock));
     if (lock) {
         memset((void *)lock, '\0', sizeof(pthread_lock));
         lock->locked = 0;
@@ -430,7 +430,7 @@
         CHECK_STATUS("pthread_cond_init");
 
         if (error) {
-            free((void *)lock);
+            PyMem_RawFree((void *)lock);
             lock = 0;
         }
     }
@@ -457,7 +457,7 @@
     status = pthread_mutex_destroy( &thelock->mut );
     CHECK_STATUS("pthread_mutex_destroy");
 
-    free((void *)thelock);
+    PyMem_RawFree((void *)thelock);
 }
 
 PyLockStatus
@@ -627,9 +627,6 @@
 PyThread_set_key_value(int key, void *value)
 {
     int fail;
-    void *oldValue = pthread_getspecific(key);
-    if (oldValue != NULL)
-        return 0;
     fail = pthread_setspecific(key, value);
     return fail ? -1 : 0;
 }
diff --git a/Python/traceback.c b/Python/traceback.c
index 74075c9..c2aba52 100644
--- a/Python/traceback.c
+++ b/Python/traceback.c
@@ -13,7 +13,7 @@
 
 #define OFF(x) offsetof(PyTracebackObject, x)
 
-#define PUTS(fd, str) write(fd, str, strlen(str))
+#define PUTS(fd, str) write(fd, str, (int)strlen(str))
 #define MAX_STRING_LENGTH 500
 #define MAX_FRAME_DEPTH 100
 #define MAX_NTHREADS 100
@@ -21,6 +21,11 @@
 /* Function from Parser/tokenizer.c */
 extern char * PyTokenizer_FindEncodingFilename(int, PyObject *);
 
+_Py_IDENTIFIER(TextIOWrapper);
+_Py_IDENTIFIER(close);
+_Py_IDENTIFIER(open);
+_Py_IDENTIFIER(path);
+
 static PyObject *
 tb_dir(PyTracebackObject *self)
 {
@@ -137,6 +142,39 @@
     return 0;
 }
 
+/* Insert a frame into the traceback for (funcname, filename, lineno). */
+void _PyTraceback_Add(char *funcname, char *filename, int lineno)
+{
+    PyObject *globals = NULL;
+    PyCodeObject *code = NULL;
+    PyFrameObject *frame = NULL;
+    PyObject *exception, *value, *tb;
+
+    /* Save and clear the current exception. Python functions must not be
+       called with an exception set. Calling Python functions happens when
+       the codec of the filesystem encoding is implemented in pure Python. */
+    PyErr_Fetch(&exception, &value, &tb);
+
+    globals = PyDict_New();
+    if (!globals)
+        goto done;
+    code = PyCode_NewEmpty(filename, funcname, lineno);
+    if (!code)
+        goto done;
+    frame = PyFrame_New(PyThreadState_Get(), code, globals, NULL);
+    if (!frame)
+        goto done;
+    frame->f_lineno = lineno;
+
+    PyErr_Restore(exception, value, tb);
+    PyTraceBack_Here(frame);
+
+done:
+    Py_XDECREF(globals);
+    Py_XDECREF(code);
+    Py_XDECREF(frame);
+}
+
 static PyObject *
 _Py_FindSourceFile(PyObject *filename, char* namebuf, size_t namelen, PyObject *io)
 {
@@ -152,7 +190,6 @@
     const char* filepath;
     Py_ssize_t len;
     PyObject* result;
-    _Py_IDENTIFIER(open);
 
     filebytes = PyUnicode_EncodeFSDefault(filename);
     if (filebytes == NULL) {
@@ -169,7 +206,7 @@
         tail++;
     taillen = strlen(tail);
 
-    syspath = PySys_GetObject("path");
+    syspath = _PySys_GetObjectId(&PyId_path);
     if (syspath == NULL || !PyList_Check(syspath))
         goto error;
     npath = PyList_Size(syspath);
@@ -232,9 +269,6 @@
     char buf[MAXPATHLEN+1];
     int kind;
     void *data;
-    _Py_IDENTIFIER(close);
-    _Py_IDENTIFIER(open);
-    _Py_IDENTIFIER(TextIOWrapper);
 
     /* open the file */
     if (filename == NULL)
@@ -246,10 +280,12 @@
     binary = _PyObject_CallMethodId(io, &PyId_open, "Os", filename, "rb");
 
     if (binary == NULL) {
+        PyErr_Clear();
+
         binary = _Py_FindSourceFile(filename, buf, sizeof(buf), io);
         if (binary == NULL) {
             Py_DECREF(io);
-            return 0;
+            return -1;
         }
     }
 
@@ -261,6 +297,8 @@
         return 0;
     }
     found_encoding = PyTokenizer_FindEncodingFilename(fd, filename);
+    if (found_encoding == NULL)
+        PyErr_Clear();
     encoding = (found_encoding != NULL) ? found_encoding : "utf-8";
     /* Reset position */
     if (lseek(fd, 0, SEEK_SET) == (off_t)-1) {
@@ -284,6 +322,7 @@
         Py_XDECREF(lineobj);
         lineobj = PyFile_GetLine(fob, -1);
         if (!lineobj) {
+            PyErr_Clear();
             err = -1;
             break;
         }
@@ -469,13 +508,13 @@
     write(fd, buffer, len);
 }
 
-/* Format an integer in range [0; 0xffffffff] to hexdecimal of 'width' digits,
+/* Format an integer in range [0; 0xffffffff] to hexadecimal of 'width' digits,
    and write it into the file fd.
 
    This function is signal safe. */
 
 static void
-dump_hexadecimal(int width, unsigned long value, int fd)
+dump_hexadecimal(int fd, unsigned long value, int width)
 {
     int len;
     char buffer[sizeof(unsigned long) * 2 + 1];
@@ -542,15 +581,15 @@
         }
         else if (ch < 0xff) {
             PUTS(fd, "\\x");
-            dump_hexadecimal(2, ch, fd);
+            dump_hexadecimal(fd, ch, 2);
         }
         else if (ch < 0xffff) {
             PUTS(fd, "\\u");
-            dump_hexadecimal(4, ch, fd);
+            dump_hexadecimal(fd, ch, 4);
         }
         else {
             PUTS(fd, "\\U");
-            dump_hexadecimal(8, ch, fd);
+            dump_hexadecimal(fd, ch, 8);
         }
     }
     if (truncated)
@@ -601,7 +640,7 @@
     unsigned int depth;
 
     if (write_header)
-        PUTS(fd, "Traceback (most recent call first):\n");
+        PUTS(fd, "Stack (most recent call first):\n");
 
     frame = _PyThreadState_GetFrame(tstate);
     if (frame == NULL)
@@ -639,8 +678,8 @@
         PUTS(fd, "Current thread 0x");
     else
         PUTS(fd, "Thread 0x");
-    dump_hexadecimal(sizeof(long)*2, (unsigned long)tstate->thread_id, fd);
-    PUTS(fd, ":\n");
+    dump_hexadecimal(fd, (unsigned long)tstate->thread_id, sizeof(long)*2);
+    PUTS(fd, " (most recent call first):\n");
 }
 
 const char*
diff --git a/README b/README
index 69df880..10e71bd 100644
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-This is Python version 3.3.6
+This is Python version 3.4.2
 ============================
 
 Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
@@ -52,9 +52,9 @@
 ----------
 
 We try to have a comprehensive overview of the changes in the "What's New in
-Python 3.3" document, found at
+Python 3.4" document, found at
 
-    http://docs.python.org/3.3/whatsnew/3.3.html
+    http://docs.python.org/3.4/whatsnew/3.4.html
 
 For a more detailed change log, read Misc/NEWS (though this file, too, is
 incomplete, and also doesn't list anything merged in from the 2.7 release under
@@ -67,9 +67,9 @@
 Documentation
 -------------
 
-Documentation for Python 3.3 is online, updated daily:
+Documentation for Python 3.4 is online, updated daily:
 
-    http://docs.python.org/3.3/
+    http://docs.python.org/3.4/
 
 It can also be downloaded in many formats for faster access.  The documentation
 is downloadable in HTML, PDF, and reStructuredText formats; the latter version
@@ -94,7 +94,7 @@
 A source-to-source translation tool, "2to3", can take care of the mundane task
 of converting large amounts of source code.  It is not a complete solution but
 is complemented by the deprecation warnings in 2.6.  See
-http://docs.python.org/3.3/library/2to3.html for more information.
+http://docs.python.org/3.4/library/2to3.html for more information.
 
 
 Testing
@@ -132,7 +132,7 @@
 Install that version using "make install".  Install all other versions using
 "make altinstall".
 
-For example, if you want to install Python 2.6, 2.7 and 3.3 with 2.7 being the
+For example, if you want to install Python 2.6, 2.7 and 3.4 with 2.7 being the
 primary version, you would execute "make install" in your 2.7 build directory
 and "make altinstall" in the others.
 
@@ -168,7 +168,7 @@
 Release Schedule
 ----------------
 
-See PEP 398 for release details: http://www.python.org/dev/peps/pep-0398/
+See PEP 429 for release details: http://www.python.org/dev/peps/pep-0429/
 
 
 Copyright and License Information
diff --git a/Tools/buildbot/external-amd64.bat b/Tools/buildbot/external-amd64.bat
index d2ff255..acd454e 100644
--- a/Tools/buildbot/external-amd64.bat
+++ b/Tools/buildbot/external-amd64.bat
@@ -4,18 +4,25 @@
 call "Tools\buildbot\external-common.bat"
 call "%VS100COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64
 
-if not exist tcltk64\bin\tcl85g.dll (
-    cd tcl-8.5.11.0\win
-    nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 clean all
-    nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 install
+if not exist tcltk64\bin\tcl86tg.dll (
+    cd tcl-8.6.1.0\win
+    nmake -f makefile.vc OPTS=symbols MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 clean core shell dlls
+    nmake -f makefile.vc OPTS=symbols MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 install-binaries install-libraries
     cd ..\..
 )
 
-if not exist tcltk64\bin\tk85g.dll (
-    cd tk-8.5.11.0\win    
-    nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 OPTS=noxp DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 TCLDIR=..\..\tcl-8.5.11.0 clean
-    nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 OPTS=noxp DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 TCLDIR=..\..\tcl-8.5.11.0 all
-    nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 OPTS=noxp DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 TCLDIR=..\..\tcl-8.5.11.0 install
+if not exist tcltk64\bin\tk86tg.dll (
+    cd tk-8.6.1.0\win
+    nmake -f makefile.vc OPTS=symbols MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 TCLDIR=..\..\tcl-8.6.1.0 clean
+    nmake -f makefile.vc OPTS=symbols MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 TCLDIR=..\..\tcl-8.6.1.0 all
+    nmake -f makefile.vc OPTS=symbols MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 TCLDIR=..\..\tcl-8.6.1.0 install-binaries install-libraries
     cd ..\..
 )
 
+if not exist tcltk64\lib\tix8.4.3\tix84g.dll (
+    cd tix-8.4.3.4\win
+    nmake -f python.mak DEBUG=1 MACHINE=AMD64 TCL_DIR=..\..\tcl-8.6.1.0 TK_DIR=..\..\tk-8.6.1.0 INSTALL_DIR=..\..\tcltk64 clean
+    nmake -f python.mak DEBUG=1 MACHINE=AMD64 TCL_DIR=..\..\tcl-8.6.1.0 TK_DIR=..\..\tk-8.6.1.0 INSTALL_DIR=..\..\tcltk64 all
+    nmake -f python.mak DEBUG=1 MACHINE=AMD64 TCL_DIR=..\..\tcl-8.6.1.0 TK_DIR=..\..\tk-8.6.1.0 INSTALL_DIR=..\..\tcltk64 install
+    cd ..\..
+)
diff --git a/Tools/buildbot/external-common.bat b/Tools/buildbot/external-common.bat
index c6278b2..b49b498 100644
--- a/Tools/buildbot/external-common.bat
+++ b/Tools/buildbot/external-common.bat
@@ -1,48 +1,54 @@
 @rem Common file shared between external.bat and external-amd64.bat.  Responsible for
 @rem fetching external components into the root\.. buildbot directories.
 
-cd ..
+if "%SVNROOT%"=="" set SVNROOT=http://svn.python.org/projects/external/
+
+if not exist externals mkdir externals
+cd externals
 @rem XXX: If you need to force the buildbots to start from a fresh environment, uncomment
 @rem the following, check it in, then check it out, comment it out, then check it back in.
 @rem if exist bzip2-1.0.6 rd /s/q bzip2-1.0.6
 @rem if exist tcltk rd /s/q tcltk
 @rem if exist tcltk64 rd /s/q tcltk64
-@rem if exist tcl8.4.12 rd /s/q tcl8.4.12
-@rem if exist tcl8.4.16 rd /s/q tcl8.4.16
-@rem if exist tcl-8.4.18.1 rd /s/q tcl-8.4.18.1
-@rem if exist tk8.4.12 rd /s/q tk8.4.12
-@rem if exist tk8.4.16 rd /s/q tk8.4.16
-@rem if exist tk-8.4.18.1 rd /s/q tk-8.4.18.1
+@rem if exist tcl-8.6.1.0 rd /s/q tcl-8.6.1.0
+@rem if exist tk-8.6.1.0 rd /s/q tk-8.6.1.0
+@rem if exist tix-8.4.3.4 rd /s/q tix-8.4.3.4
 @rem if exist db-4.4.20 rd /s/q db-4.4.20
-@rem if exist openssl-1.0.1e rd /s/q openssl-1.0.1e
-@rem if exist sqlite-3.7.12 rd /s/q sqlite-3.7.12    
+@rem if exist openssl-1.0.1l rd /s/q openssl-1.0.1l
+@rem if exist sqlite-3.7.12 rd /s/q sqlite-3.7.12
 
 @rem bzip
 if not exist bzip2-1.0.6 (
    rd /s/q bzip2-1.0.5
-  svn export http://svn.python.org/projects/external/bzip2-1.0.6
+  svn export %SVNROOT%bzip2-1.0.6
 )
 
+@rem NASM, for OpenSSL build
+@rem if exist nasm-2.11.06 rd /s/q nasm-2.11.06
+if not exist nasm-2.11.06 svn export %SVNROOT%nasm-2.11.06
+
 @rem OpenSSL
-if not exist openssl-1.0.1e (
-    rd /s/q openssl-1.0.1d
-    svn export http://svn.python.org/projects/external/openssl-1.0.1e
+if not exist openssl-1.0.1l (
+    rd /s/q openssl-1.0.1j
+    svn export %SVNROOT%openssl-1.0.1l
 )
 
 @rem tcl/tk
-if not exist tcl-8.5.11.0 (
-   rd /s/q tcltk tcltk64
-   svn export http://svn.python.org/projects/external/tcl-8.5.11.0
+if not exist tcl-8.6.1.0 (
+   rd /s/q tcltk tcltk64 tcl-8.5.11.0 tk-8.5.11.0
+   svn export %SVNROOT%tcl-8.6.1.0
 )
-if not exist tk-8.5.11.0 svn export http://svn.python.org/projects/external/tk-8.5.11.0
+if not exist tk-8.6.1.0 svn export %SVNROOT%tk-8.6.1.0
+if not exist tix-8.4.3.4 svn export %SVNROOT%tix-8.4.3.4
 
 @rem sqlite3
-if not exist sqlite-3.7.12 (
-  rd /s/q sqlite-source-3.7.4
-  svn export http://svn.python.org/projects/external/sqlite-3.7.12
+if not exist sqlite-3.8.3.1 (
+  rd /s/q sqlite-source-3.8.1
+  svn export %SVNROOT%sqlite-3.8.3.1
 )
 
 @rem lzma
-if not exist xz-5.0.3 (
-  svn export http://svn.python.org/projects/external/xz-5.0.3
+if not exist xz-5.0.5 (
+  rd /s/q xz-5.0.3
+  svn export %SVNROOT%xz-5.0.5
 )
diff --git a/Tools/buildbot/external.bat b/Tools/buildbot/external.bat
index ed5c10e..3877d8d 100644
--- a/Tools/buildbot/external.bat
+++ b/Tools/buildbot/external.bat
@@ -4,18 +4,26 @@
 call "Tools\buildbot\external-common.bat"
 call "%VS100COMNTOOLS%\vsvars32.bat"
 
-if not exist tcltk\bin\tcl85g.dll (
+if not exist tcltk\bin\tcl86tg.dll (
     @rem all and install need to be separate invocations, otherwise nmakehlp is not found on install
-    cd tcl-8.5.11.0\win
-    nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 DEBUG=1 INSTALLDIR=..\..\tcltk clean all 
-    nmake -f makefile.vc DEBUG=1 INSTALLDIR=..\..\tcltk install
+    cd tcl-8.6.1.0\win
+    nmake -f makefile.vc OPTS=symbols INSTALLDIR=..\..\tcltk clean core shell dlls
+    nmake -f makefile.vc OPTS=symbols INSTALLDIR=..\..\tcltk install-binaries install-libraries
     cd ..\..
 )
 
-if not exist tcltk\bin\tk85g.dll (
-    cd tk-8.5.11.0\win
-    nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 OPTS=noxp DEBUG=1 INSTALLDIR=..\..\tcltk TCLDIR=..\..\tcl-8.5.11.0 clean
-    nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 OPTS=noxp DEBUG=1 INSTALLDIR=..\..\tcltk TCLDIR=..\..\tcl-8.5.11.0 all
-    nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 OPTS=noxp DEBUG=1 INSTALLDIR=..\..\tcltk TCLDIR=..\..\tcl-8.5.11.0 install
+if not exist tcltk\bin\tk86tg.dll (
+    cd tk-8.6.1.0\win
+    nmake -f makefile.vc OPTS=symbols INSTALLDIR=..\..\tcltk TCLDIR=..\..\tcl-8.6.1.0 clean
+    nmake -f makefile.vc OPTS=symbols INSTALLDIR=..\..\tcltk TCLDIR=..\..\tcl-8.6.1.0 all
+    nmake -f makefile.vc OPTS=symbols INSTALLDIR=..\..\tcltk TCLDIR=..\..\tcl-8.6.1.0 install-binaries install-libraries
+    cd ..\..
+)
+
+if not exist tcltk\lib\tix8.4.3\tix84g.dll (
+    cd tix-8.4.3.4\win
+    nmake -f python.mak DEBUG=1 MACHINE=IX86 TCL_DIR=..\..\tcl-8.6.1.0 TK_DIR=..\..\tk-8.6.1.0 INSTALL_DIR=..\..\tcltk clean
+    nmake -f python.mak DEBUG=1 MACHINE=IX86 TCL_DIR=..\..\tcl-8.6.1.0 TK_DIR=..\..\tk-8.6.1.0 INSTALL_DIR=..\..\tcltk all
+    nmake -f python.mak DEBUG=1 MACHINE=IX86 TCL_DIR=..\..\tcl-8.6.1.0 TK_DIR=..\..\tk-8.6.1.0 INSTALL_DIR=..\..\tcltk install
     cd ..\..
 )
diff --git a/Tools/buildbot/test-amd64.bat b/Tools/buildbot/test-amd64.bat
index 1bf124c..de64f25 100644
--- a/Tools/buildbot/test-amd64.bat
+++ b/Tools/buildbot/test-amd64.bat
@@ -1,3 +1,3 @@
 @rem Used by the buildbot "test" step.
 cd PCbuild
-call rt.bat -d -q -x64 -uall -rwW -n %1 %2 %3 %4 %5 %6 %7 %8 %9
+call rt.bat -d -q -x64 -uall -rwW -n --timeout=3600 %1 %2 %3 %4 %5 %6 %7 %8 %9
diff --git a/Tools/buildbot/test.bat b/Tools/buildbot/test.bat
index 4f4c6aa..4e4db10 100644
--- a/Tools/buildbot/test.bat
+++ b/Tools/buildbot/test.bat
@@ -1,3 +1,3 @@
 @rem Used by the buildbot "test" step.
 cd PCbuild
-call rt.bat -d -q -uall -rwW -n %1 %2 %3 %4 %5 %6 %7 %8 %9
+call rt.bat -d -q -uall -rwW -n --timeout=3600 %1 %2 %3 %4 %5 %6 %7 %8 %9
diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py
new file mode 100755
index 0000000..65bad51
--- /dev/null
+++ b/Tools/clinic/clinic.py
@@ -0,0 +1,4197 @@
+#!/usr/bin/env python3
+#
+# Argument Clinic
+# Copyright 2012-2013 by Larry Hastings.
+# Licensed to the PSF under a contributor agreement.
+#
+
+import abc
+import ast
+import atexit
+import collections
+import contextlib
+import copy
+import cpp
+import functools
+import hashlib
+import inspect
+import io
+import itertools
+import os
+import pprint
+import re
+import shlex
+import string
+import sys
+import tempfile
+import textwrap
+import traceback
+import uuid
+
+# TODO:
+#
+# soon:
+#
+# * allow mixing any two of {positional-only, positional-or-keyword,
+#   keyword-only}
+#       * dict constructor uses positional-only and keyword-only
+#       * max and min use positional only with an optional group
+#         and keyword-only
+#
+
+version = '1'
+
+_empty = inspect._empty
+_void = inspect._void
+
+NoneType = type(None)
+
+class Unspecified:
+    def __repr__(self):
+        return '<Unspecified>'
+
+unspecified = Unspecified()
+
+
+class Null:
+    def __repr__(self):
+        return '<Null>'
+
+NULL = Null()
+
+
+class Unknown:
+    def __repr__(self):
+        return '<Unknown>'
+
+unknown = Unknown()
+
+
+def _text_accumulator():
+    text = []
+    def output():
+        s = ''.join(text)
+        text.clear()
+        return s
+    return text, text.append, output
+
+
+def text_accumulator():
+    """
+    Creates a simple text accumulator / joiner.
+
+    Returns a pair of callables:
+        append, output
+    "append" appends a string to the accumulator.
+    "output" returns the contents of the accumulator
+       joined together (''.join(accumulator)) and
+       empties the accumulator.
+    """
+    text, append, output = _text_accumulator()
+    return append, output
+
+
+def warn_or_fail(fail=False, *args, filename=None, line_number=None):
+    joined = " ".join([str(a) for a in args])
+    add, output = text_accumulator()
+    if fail:
+        add("Error")
+    else:
+        add("Warning")
+    if clinic:
+        if filename is None:
+            filename = clinic.filename
+        if getattr(clinic, 'block_parser', None) and (line_number is None):
+            line_number = clinic.block_parser.line_number
+    if filename is not None:
+        add(' in file "' + filename + '"')
+    if line_number is not None:
+        add(" on line " + str(line_number))
+    add(':\n')
+    add(joined)
+    print(output())
+    if fail:
+        sys.exit(-1)
+
+
+def warn(*args, filename=None, line_number=None):
+    return warn_or_fail(False, *args, filename=filename, line_number=line_number)
+
+def fail(*args, filename=None, line_number=None):
+    return warn_or_fail(True, *args, filename=filename, line_number=line_number)
+
+
+def quoted_for_c_string(s):
+    for old, new in (
+        ('\\', '\\\\'), # must be first!
+        ('"', '\\"'),
+        ("'", "\\'"),
+        ):
+        s = s.replace(old, new)
+    return s
+
+def c_repr(s):
+    return '"' + s + '"'
+
+
+is_legal_c_identifier = re.compile('^[A-Za-z_][A-Za-z0-9_]*$').match
+
+def is_legal_py_identifier(s):
+    return all(is_legal_c_identifier(field) for field in s.split('.'))
+
+# identifiers that are okay in Python but aren't a good idea in C.
+# so if they're used Argument Clinic will add "_value" to the end
+# of the name in C.
+c_keywords = set("""
+asm auto break case char const continue default do double
+else enum extern float for goto if inline int long
+register return short signed sizeof static struct switch
+typedef typeof union unsigned void volatile while
+""".strip().split())
+
+def ensure_legal_c_identifier(s):
+    # for now, just complain if what we're given isn't legal
+    if not is_legal_c_identifier(s):
+        fail("Illegal C identifier: {}".format(s))
+    # but if we picked a C keyword, pick something else
+    if s in c_keywords:
+        return s + "_value"
+    return s
+
+def rstrip_lines(s):
+    text, add, output = _text_accumulator()
+    for line in s.split('\n'):
+        add(line.rstrip())
+        add('\n')
+    text.pop()
+    return output()
+
+def linear_format(s, **kwargs):
+    """
+    Perform str.format-like substitution, except:
+      * The strings substituted must be on lines by
+        themselves.  (This line is the "source line".)
+      * If the substitution text is empty, the source line
+        is removed in the output.
+      * If the field is not recognized, the original line
+        is passed unmodified through to the output.
+      * If the substitution text is not empty:
+          * Each line of the substituted text is indented
+            by the indent of the source line.
+          * A newline will be added to the end.
+    """
+
+    add, output = text_accumulator()
+    for line in s.split('\n'):
+        indent, curly, trailing = line.partition('{')
+        if not curly:
+            add(line)
+            add('\n')
+            continue
+
+        name, curl, trailing = trailing.partition('}')
+        if not curly or name not in kwargs:
+            add(line)
+            add('\n')
+            continue
+
+        if trailing:
+            fail("Text found after {" + name + "} block marker!  It must be on a line by itself.")
+        if indent.strip():
+            fail("Non-whitespace characters found before {" + name + "} block marker!  It must be on a line by itself.")
+
+        value = kwargs[name]
+        if not value:
+            continue
+
+        value = textwrap.indent(rstrip_lines(value), indent)
+        add(value)
+        add('\n')
+
+    return output()[:-1]
+
+def indent_all_lines(s, prefix):
+    """
+    Returns 's', with 'prefix' prepended to all lines.
+
+    If the last line is empty, prefix is not prepended
+    to it.  (If s is blank, returns s unchanged.)
+
+    (textwrap.indent only adds to non-blank lines.)
+    """
+    split = s.split('\n')
+    last = split.pop()
+    final = []
+    for line in split:
+        final.append(prefix)
+        final.append(line)
+        final.append('\n')
+    if last:
+        final.append(prefix)
+        final.append(last)
+    return ''.join(final)
+
+def suffix_all_lines(s, suffix):
+    """
+    Returns 's', with 'suffix' appended to all lines.
+
+    If the last line is empty, suffix is not appended
+    to it.  (If s is blank, returns s unchanged.)
+    """
+    split = s.split('\n')
+    last = split.pop()
+    final = []
+    for line in split:
+        final.append(line)
+        final.append(suffix)
+        final.append('\n')
+    if last:
+        final.append(last)
+        final.append(suffix)
+    return ''.join(final)
+
+
+def version_splitter(s):
+    """Splits a version string into a tuple of integers.
+
+    The following ASCII characters are allowed, and employ
+    the following conversions:
+        a -> -3
+        b -> -2
+        c -> -1
+    (This permits Python-style version strings such as "1.4b3".)
+    """
+    version = []
+    accumulator = []
+    def flush():
+        if not accumulator:
+            raise ValueError('Unsupported version string: ' + repr(s))
+        version.append(int(''.join(accumulator)))
+        accumulator.clear()
+
+    for c in s:
+        if c.isdigit():
+            accumulator.append(c)
+        elif c == '.':
+            flush()
+        elif c in 'abc':
+            flush()
+            version.append('abc'.index(c) - 3)
+        else:
+            raise ValueError('Illegal character ' + repr(c) + ' in version string ' + repr(s))
+    flush()
+    return tuple(version)
+
+def version_comparitor(version1, version2):
+    iterator = itertools.zip_longest(version_splitter(version1), version_splitter(version2), fillvalue=0)
+    for i, (a, b) in enumerate(iterator):
+        if a < b:
+            return -1
+        if a > b:
+            return 1
+    return 0
+
+
+class CRenderData:
+    def __init__(self):
+
+        # The C statements to declare variables.
+        # Should be full lines with \n eol characters.
+        self.declarations = []
+
+        # The C statements required to initialize the variables before the parse call.
+        # Should be full lines with \n eol characters.
+        self.initializers = []
+
+        # The C statements needed to dynamically modify the values
+        # parsed by the parse call, before calling the impl.
+        self.modifications = []
+
+        # The entries for the "keywords" array for PyArg_ParseTuple.
+        # Should be individual strings representing the names.
+        self.keywords = []
+
+        # The "format units" for PyArg_ParseTuple.
+        # Should be individual strings that will get
+        self.format_units = []
+
+        # The varargs arguments for PyArg_ParseTuple.
+        self.parse_arguments = []
+
+        # The parameter declarations for the impl function.
+        self.impl_parameters = []
+
+        # The arguments to the impl function at the time it's called.
+        self.impl_arguments = []
+
+        # For return converters: the name of the variable that
+        # should receive the value returned by the impl.
+        self.return_value = "return_value"
+
+        # For return converters: the code to convert the return
+        # value from the parse function.  This is also where
+        # you should check the _return_value for errors, and
+        # "goto exit" if there are any.
+        self.return_conversion = []
+
+        # The C statements required to clean up after the impl call.
+        self.cleanup = []
+
+
+class FormatCounterFormatter(string.Formatter):
+    """
+    This counts how many instances of each formatter
+    "replacement string" appear in the format string.
+
+    e.g. after evaluating "string {a}, {b}, {c}, {a}"
+         the counts dict would now look like
+         {'a': 2, 'b': 1, 'c': 1}
+    """
+    def __init__(self):
+        self.counts = collections.Counter()
+
+    def get_value(self, key, args, kwargs):
+        self.counts[key] += 1
+        return ''
+
+class Language(metaclass=abc.ABCMeta):
+
+    start_line = ""
+    body_prefix = ""
+    stop_line = ""
+    checksum_line = ""
+
+    def __init__(self, filename):
+        pass
+
+    @abc.abstractmethod
+    def render(self, clinic, signatures):
+        pass
+
+    def parse_line(self, line):
+        pass
+
+    def validate(self):
+        def assert_only_one(attr, *additional_fields):
+            """
+            Ensures that the string found at getattr(self, attr)
+            contains exactly one formatter replacement string for
+            each valid field.  The list of valid fields is
+            ['dsl_name'] extended by additional_fields.
+
+            e.g.
+                self.fmt = "{dsl_name} {a} {b}"
+
+                # this passes
+                self.assert_only_one('fmt', 'a', 'b')
+
+                # this fails, the format string has a {b} in it
+                self.assert_only_one('fmt', 'a')
+
+                # this fails, the format string doesn't have a {c} in it
+                self.assert_only_one('fmt', 'a', 'b', 'c')
+
+                # this fails, the format string has two {a}s in it,
+                # it must contain exactly one
+                self.fmt2 = '{dsl_name} {a} {a}'
+                self.assert_only_one('fmt2', 'a')
+
+            """
+            fields = ['dsl_name']
+            fields.extend(additional_fields)
+            line = getattr(self, attr)
+            fcf = FormatCounterFormatter()
+            fcf.format(line)
+            def local_fail(should_be_there_but_isnt):
+                if should_be_there_but_isnt:
+                    fail("{} {} must contain {{{}}} exactly once!".format(
+                        self.__class__.__name__, attr, name))
+                else:
+                    fail("{} {} must not contain {{{}}}!".format(
+                        self.__class__.__name__, attr, name))
+
+            for name, count in fcf.counts.items():
+                if name in fields:
+                    if count > 1:
+                        local_fail(True)
+                else:
+                    local_fail(False)
+            for name in fields:
+                if fcf.counts.get(name) != 1:
+                    local_fail(True)
+
+        assert_only_one('start_line')
+        assert_only_one('stop_line')
+
+        field = "arguments" if "{arguments}" in self.checksum_line else "checksum"
+        assert_only_one('checksum_line', field)
+
+
+
+class PythonLanguage(Language):
+
+    language      = 'Python'
+    start_line    = "#/*[{dsl_name} input]"
+    body_prefix   = "#"
+    stop_line     = "#[{dsl_name} start generated code]*/"
+    checksum_line = "#/*[{dsl_name} end generated code: {arguments}]*/"
+
+
+def permute_left_option_groups(l):
+    """
+    Given [1, 2, 3], should yield:
+       ()
+       (3,)
+       (2, 3)
+       (1, 2, 3)
+    """
+    yield tuple()
+    accumulator = []
+    for group in reversed(l):
+        accumulator = list(group) + accumulator
+        yield tuple(accumulator)
+
+
+def permute_right_option_groups(l):
+    """
+    Given [1, 2, 3], should yield:
+      ()
+      (1,)
+      (1, 2)
+      (1, 2, 3)
+    """
+    yield tuple()
+    accumulator = []
+    for group in l:
+        accumulator.extend(group)
+        yield tuple(accumulator)
+
+
+def permute_optional_groups(left, required, right):
+    """
+    Generator function that computes the set of acceptable
+    argument lists for the provided iterables of
+    argument groups.  (Actually it generates a tuple of tuples.)
+
+    Algorithm: prefer left options over right options.
+
+    If required is empty, left must also be empty.
+    """
+    required = tuple(required)
+    result = []
+
+    if not required:
+        assert not left
+
+    accumulator = []
+    counts = set()
+    for r in permute_right_option_groups(right):
+        for l in permute_left_option_groups(left):
+            t = l + required + r
+            if len(t) in counts:
+                continue
+            counts.add(len(t))
+            accumulator.append(t)
+
+    accumulator.sort(key=len)
+    return tuple(accumulator)
+
+
+def strip_leading_and_trailing_blank_lines(s):
+    lines = s.rstrip().split('\n')
+    while lines:
+        line = lines[0]
+        if line.strip():
+            break
+        del lines[0]
+    return '\n'.join(lines)
+
+@functools.lru_cache()
+def normalize_snippet(s, *, indent=0):
+    """
+    Reformats s:
+        * removes leading and trailing blank lines
+        * ensures that it does not end with a newline
+        * dedents so the first nonwhite character on any line is at column "indent"
+    """
+    s = strip_leading_and_trailing_blank_lines(s)
+    s = textwrap.dedent(s)
+    if indent:
+        s = textwrap.indent(s, ' ' * indent)
+    return s
+
+
+class CLanguage(Language):
+
+    body_prefix   = "#"
+    language      = 'C'
+    start_line    = "/*[{dsl_name} input]"
+    body_prefix   = ""
+    stop_line     = "[{dsl_name} start generated code]*/"
+    checksum_line = "/*[{dsl_name} end generated code: {arguments}]*/"
+
+    def __init__(self, filename):
+        super().__init__(filename)
+        self.cpp = cpp.Monitor(filename)
+        self.cpp.fail = fail
+
+    def parse_line(self, line):
+        self.cpp.writeline(line)
+
+    def render(self, clinic, signatures):
+        function = None
+        for o in signatures:
+            if isinstance(o, Function):
+                if function:
+                    fail("You may specify at most one function per block.\nFound a block containing at least two:\n\t" + repr(function) + " and " + repr(o))
+                function = o
+        return self.render_function(clinic, function)
+
+    def docstring_for_c_string(self, f):
+        text, add, output = _text_accumulator()
+        # turn docstring into a properly quoted C string
+        for line in f.docstring.split('\n'):
+            add('"')
+            add(quoted_for_c_string(line))
+            add('\\n"\n')
+
+        text.pop()
+        add('"')
+        return ''.join(text)
+
+    def output_templates(self, f):
+        parameters = list(f.parameters.values())
+        assert parameters
+        assert isinstance(parameters[0].converter, self_converter)
+        del parameters[0]
+        converters = [p.converter for p in parameters]
+
+        has_option_groups = parameters and (parameters[0].group or parameters[-1].group)
+        default_return_converter = (not f.return_converter or
+            f.return_converter.type == 'PyObject *')
+
+        positional = parameters and (parameters[-1].kind == inspect.Parameter.POSITIONAL_ONLY)
+        all_boring_objects = False # yes, this will be false if there are 0 parameters, it's fine
+        first_optional = len(parameters)
+        for i, p in enumerate(parameters):
+            c = p.converter
+            if type(c) != object_converter:
+                break
+            if c.format_unit != 'O':
+                break
+            if p.default is not unspecified:
+                first_optional = min(first_optional, i)
+        else:
+            all_boring_objects = True
+
+        new_or_init = f.kind in (METHOD_NEW, METHOD_INIT)
+
+        meth_o = (len(parameters) == 1 and
+              parameters[0].kind == inspect.Parameter.POSITIONAL_ONLY and
+              not converters[0].is_optional() and
+              isinstance(converters[0], object_converter) and
+              converters[0].format_unit == 'O' and
+              not new_or_init)
+
+        # we have to set these things before we're done:
+        #
+        # docstring_prototype
+        # docstring_definition
+        # impl_prototype
+        # methoddef_define
+        # parser_prototype
+        # parser_definition
+        # impl_definition
+        # cpp_if
+        # cpp_endif
+        # methoddef_ifndef
+
+        return_value_declaration = "PyObject *return_value = NULL;"
+
+        methoddef_define = normalize_snippet("""
+            #define {methoddef_name}    \\
+                {{"{name}", (PyCFunction){c_basename}, {methoddef_flags}, {c_basename}__doc__}},
+            """)
+        if new_or_init and not f.docstring:
+            docstring_prototype = docstring_definition = ''
+        else:
+            docstring_prototype = normalize_snippet("""
+                PyDoc_VAR({c_basename}__doc__);
+                """)
+            docstring_definition = normalize_snippet("""
+                PyDoc_STRVAR({c_basename}__doc__,
+                {docstring});
+                """)
+        impl_definition = normalize_snippet("""
+            static {impl_return_type}
+            {c_basename}_impl({impl_parameters})
+            """)
+        impl_prototype = parser_prototype = parser_definition = None
+
+        parser_prototype_keyword = normalize_snippet("""
+            static PyObject *
+            {c_basename}({self_type}{self_name}, PyObject *args, PyObject *kwargs)
+            """)
+
+        parser_prototype_varargs = normalize_snippet("""
+            static PyObject *
+            {c_basename}({self_type}{self_name}, PyObject *args)
+            """)
+
+        # parser_body_fields remembers the fields passed in to the
+        # previous call to parser_body. this is used for an awful hack.
+        parser_body_fields = ()
+        def parser_body(prototype, *fields):
+            nonlocal parser_body_fields
+            add, output = text_accumulator()
+            add(prototype)
+            parser_body_fields = fields
+
+            fields = list(fields)
+            fields.insert(0, normalize_snippet("""
+                {{
+                    {return_value_declaration}
+                    {declarations}
+                    {initializers}
+                """) + "\n")
+            # just imagine--your code is here in the middle
+            fields.append(normalize_snippet("""
+                    {modifications}
+                    {return_value} = {c_basename}_impl({impl_arguments});
+                    {return_conversion}
+
+                {exit_label}
+                    {cleanup}
+                    return return_value;
+                }}
+                """))
+            for field in fields:
+                add('\n')
+                add(field)
+            return output()
+
+        def insert_keywords(s):
+            return linear_format(s, declarations="static char *_keywords[] = {{{keywords}, NULL}};\n{declarations}")
+
+        if not parameters:
+            # no parameters, METH_NOARGS
+
+            flags = "METH_NOARGS"
+
+            parser_prototype = normalize_snippet("""
+                static PyObject *
+                {c_basename}({self_type}{self_name}, PyObject *Py_UNUSED(ignored))
+                """)
+            parser_definition = parser_prototype
+
+            if default_return_converter:
+                parser_definition = parser_prototype + '\n' + normalize_snippet("""
+                    {{
+                        return {c_basename}_impl({impl_arguments});
+                    }}
+                    """)
+            else:
+                parser_definition = parser_body(parser_prototype)
+
+        elif meth_o:
+            flags = "METH_O"
+
+            meth_o_prototype = normalize_snippet("""
+                static PyObject *
+                {c_basename}({impl_parameters})
+                """)
+
+            if default_return_converter:
+                # maps perfectly to METH_O, doesn't need a return converter.
+                # so we skip making a parse function
+                # and call directly into the impl function.
+                impl_prototype = parser_prototype = parser_definition = ''
+                impl_definition = meth_o_prototype
+            else:
+                # SLIGHT HACK
+                # use impl_parameters for the parser here!
+                parser_prototype = meth_o_prototype
+                parser_definition = parser_body(parser_prototype)
+
+        elif has_option_groups:
+            # positional parameters with option groups
+            # (we have to generate lots of PyArg_ParseTuple calls
+            #  in a big switch statement)
+
+            flags = "METH_VARARGS"
+            parser_prototype = parser_prototype_varargs
+
+            parser_definition = parser_body(parser_prototype, '    {option_group_parsing}')
+
+        elif positional and all_boring_objects:
+            # positional-only, but no option groups,
+            # and nothing but normal objects:
+            # PyArg_UnpackTuple!
+
+            flags = "METH_VARARGS"
+            parser_prototype = parser_prototype_varargs
+
+            parser_definition = parser_body(parser_prototype, normalize_snippet("""
+                if (!PyArg_UnpackTuple(args, "{name}",
+                    {unpack_min}, {unpack_max},
+                    {parse_arguments}))
+                    goto exit;
+                """, indent=4))
+
+        elif positional:
+            # positional-only, but no option groups
+            # we only need one call to PyArg_ParseTuple
+
+            flags = "METH_VARARGS"
+            parser_prototype = parser_prototype_varargs
+
+            parser_definition = parser_body(parser_prototype, normalize_snippet("""
+                if (!PyArg_ParseTuple(args,
+                    "{format_units}:{name}",
+                    {parse_arguments}))
+                    goto exit;
+                """, indent=4))
+
+        else:
+            # positional-or-keyword arguments
+            flags = "METH_VARARGS|METH_KEYWORDS"
+
+            parser_prototype = parser_prototype_keyword
+
+            body = normalize_snippet("""
+                if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+                    "{format_units}:{name}", _keywords,
+                    {parse_arguments}))
+                    goto exit;
+            """, indent=4)
+            parser_definition = parser_body(parser_prototype, normalize_snippet("""
+                if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+                    "{format_units}:{name}", _keywords,
+                    {parse_arguments}))
+                    goto exit;
+                """, indent=4))
+            parser_definition = insert_keywords(parser_definition)
+
+
+        if new_or_init:
+            methoddef_define = ''
+
+            if f.kind == METHOD_NEW:
+                parser_prototype = parser_prototype_keyword
+            else:
+                return_value_declaration = "int return_value = -1;"
+                parser_prototype = normalize_snippet("""
+                    static int
+                    {c_basename}({self_type}{self_name}, PyObject *args, PyObject *kwargs)
+                    """)
+
+            fields = list(parser_body_fields)
+            parses_positional = 'METH_NOARGS' not in flags
+            parses_keywords = 'METH_KEYWORDS' in flags
+            if parses_keywords:
+                assert parses_positional
+
+            if not parses_keywords:
+                fields.insert(0, normalize_snippet("""
+                    if ({self_type_check}!_PyArg_NoKeywords("{name}", kwargs))
+                        goto exit;
+                    """, indent=4))
+                if not parses_positional:
+                    fields.insert(0, normalize_snippet("""
+                        if ({self_type_check}!_PyArg_NoPositional("{name}", args))
+                            goto exit;
+                        """, indent=4))
+
+            parser_definition = parser_body(parser_prototype, *fields)
+            if parses_keywords:
+                parser_definition = insert_keywords(parser_definition)
+
+
+        if f.methoddef_flags:
+            flags += '|' + f.methoddef_flags
+
+        methoddef_define = methoddef_define.replace('{methoddef_flags}', flags)
+
+        methoddef_ifndef = ''
+        conditional = self.cpp.condition()
+        if not conditional:
+            cpp_if = cpp_endif = ''
+        else:
+            cpp_if = "#if " + conditional
+            cpp_endif = "#endif /* " + conditional + " */"
+
+            if methoddef_define:
+                methoddef_ifndef = normalize_snippet("""
+                    #ifndef {methoddef_name}
+                        #define {methoddef_name}
+                    #endif /* !defined({methoddef_name}) */
+                    """)
+
+
+        # add ';' to the end of parser_prototype and impl_prototype
+        # (they mustn't be None, but they could be an empty string.)
+        assert parser_prototype is not None
+        if parser_prototype:
+            assert not parser_prototype.endswith(';')
+            parser_prototype += ';'
+
+        if impl_prototype is None:
+            impl_prototype = impl_definition
+        if impl_prototype:
+            impl_prototype += ";"
+
+        parser_definition = parser_definition.replace("{return_value_declaration}", return_value_declaration)
+
+        d = {
+            "docstring_prototype" : docstring_prototype,
+            "docstring_definition" : docstring_definition,
+            "impl_prototype" : impl_prototype,
+            "methoddef_define" : methoddef_define,
+            "parser_prototype" : parser_prototype,
+            "parser_definition" : parser_definition,
+            "impl_definition" : impl_definition,
+            "cpp_if" : cpp_if,
+            "cpp_endif" : cpp_endif,
+            "methoddef_ifndef" : methoddef_ifndef,
+        }
+
+        # make sure we didn't forget to assign something,
+        # and wrap each non-empty value in \n's
+        d2 = {}
+        for name, value in d.items():
+            assert value is not None, "got a None value for template " + repr(name)
+            if value:
+                value = '\n' + value + '\n'
+            d2[name] = value
+        return d2
+
+    @staticmethod
+    def group_to_variable_name(group):
+        adjective = "left_" if group < 0 else "right_"
+        return "group_" + adjective + str(abs(group))
+
+    def render_option_group_parsing(self, f, template_dict):
+        # positional only, grouped, optional arguments!
+        # can be optional on the left or right.
+        # here's an example:
+        #
+        # [ [ [ A1 A2 ] B1 B2 B3 ] C1 C2 ] D1 D2 D3 [ E1 E2 E3 [ F1 F2 F3 ] ]
+        #
+        # Here group D are required, and all other groups are optional.
+        # (Group D's "group" is actually None.)
+        # We can figure out which sets of arguments we have based on
+        # how many arguments are in the tuple.
+        #
+        # Note that you need to count up on both sides.  For example,
+        # you could have groups C+D, or C+D+E, or C+D+E+F.
+        #
+        # What if the number of arguments leads us to an ambiguous result?
+        # Clinic prefers groups on the left.  So in the above example,
+        # five arguments would map to B+C, not C+D.
+
+        add, output = text_accumulator()
+        parameters = list(f.parameters.values())
+        if isinstance(parameters[0].converter, self_converter):
+            del parameters[0]
+
+        groups = []
+        group = None
+        left = []
+        right = []
+        required = []
+        last = unspecified
+
+        for p in parameters:
+            group_id = p.group
+            if group_id != last:
+                last = group_id
+                group = []
+                if group_id < 0:
+                    left.append(group)
+                elif group_id == 0:
+                    group = required
+                else:
+                    right.append(group)
+            group.append(p)
+
+        count_min = sys.maxsize
+        count_max = -1
+
+        add("switch (PyTuple_GET_SIZE(args)) {{\n")
+        for subset in permute_optional_groups(left, required, right):
+            count = len(subset)
+            count_min = min(count_min, count)
+            count_max = max(count_max, count)
+
+            if count == 0:
+                add("""    case 0:
+        break;
+""")
+                continue
+
+            group_ids = {p.group for p in subset}  # eliminate duplicates
+            d = {}
+            d['count'] = count
+            d['name'] = f.name
+            d['groups'] = sorted(group_ids)
+            d['format_units'] = "".join(p.converter.format_unit for p in subset)
+
+            parse_arguments = []
+            for p in subset:
+                p.converter.parse_argument(parse_arguments)
+            d['parse_arguments'] = ", ".join(parse_arguments)
+
+            group_ids.discard(0)
+            lines = [self.group_to_variable_name(g) + " = 1;" for g in group_ids]
+            lines = "\n".join(lines)
+
+            s = """
+    case {count}:
+        if (!PyArg_ParseTuple(args, "{format_units}:{name}", {parse_arguments}))
+            goto exit;
+        {group_booleans}
+        break;
+"""[1:]
+            s = linear_format(s, group_booleans=lines)
+            s = s.format_map(d)
+            add(s)
+
+        add("    default:\n")
+        s = '        PyErr_SetString(PyExc_TypeError, "{} requires {} to {} arguments");\n'
+        add(s.format(f.full_name, count_min, count_max))
+        add('        goto exit;\n')
+        add("}}")
+        template_dict['option_group_parsing'] = output()
+
+    def render_function(self, clinic, f):
+        if not f:
+            return ""
+
+        add, output = text_accumulator()
+        data = CRenderData()
+
+        assert f.parameters, "We should always have a 'self' at this point!"
+        parameters = f.render_parameters
+        converters = [p.converter for p in parameters]
+
+        templates = self.output_templates(f)
+
+        f_self = parameters[0]
+        selfless = parameters[1:]
+        assert isinstance(f_self.converter, self_converter), "No self parameter in " + repr(f.full_name) + "!"
+
+        last_group = 0
+        first_optional = len(selfless)
+        positional = selfless and selfless[-1].kind == inspect.Parameter.POSITIONAL_ONLY
+        new_or_init = f.kind in (METHOD_NEW, METHOD_INIT)
+        default_return_converter = (not f.return_converter or
+            f.return_converter.type == 'PyObject *')
+        has_option_groups = False
+
+        # offset i by -1 because first_optional needs to ignore self
+        for i, p in enumerate(parameters, -1):
+            c = p.converter
+
+            if (i != -1) and (p.default is not unspecified):
+                first_optional = min(first_optional, i)
+
+            # insert group variable
+            group = p.group
+            if last_group != group:
+                last_group = group
+                if group:
+                    group_name = self.group_to_variable_name(group)
+                    data.impl_arguments.append(group_name)
+                    data.declarations.append("int " + group_name + " = 0;")
+                    data.impl_parameters.append("int " + group_name)
+                    has_option_groups = True
+
+            c.render(p, data)
+
+        if has_option_groups and (not positional):
+            fail("You cannot use optional groups ('[' and ']')\nunless all parameters are positional-only ('/').")
+
+        # HACK
+        # when we're METH_O, but have a custom return converter,
+        # we use "impl_parameters" for the parsing function
+        # because that works better.  but that means we must
+        # suppress actually declaring the impl's parameters
+        # as variables in the parsing function.  but since it's
+        # METH_O, we have exactly one anyway, so we know exactly
+        # where it is.
+        if ("METH_O" in templates['methoddef_define'] and
+            not default_return_converter):
+            data.declarations.pop(0)
+
+        template_dict = {}
+
+        full_name = f.full_name
+        template_dict['full_name'] = full_name
+
+        if new_or_init:
+            name = f.cls.name
+        else:
+            name = f.name
+
+        template_dict['name'] = name
+
+        if f.c_basename:
+            c_basename = f.c_basename
+        else:
+            fields = full_name.split(".")
+            if fields[-1] == '__new__':
+                fields.pop()
+            c_basename = "_".join(fields)
+
+        template_dict['c_basename'] = c_basename
+
+        methoddef_name = "{}_METHODDEF".format(c_basename.upper())
+        template_dict['methoddef_name'] = methoddef_name
+
+        template_dict['docstring'] = self.docstring_for_c_string(f)
+
+        template_dict['self_name'] = template_dict['self_type'] = template_dict['self_type_check'] = ''
+        f_self.converter.set_template_dict(template_dict)
+
+        f.return_converter.render(f, data)
+        template_dict['impl_return_type'] = f.return_converter.type
+
+        template_dict['declarations'] = "\n".join(data.declarations)
+        template_dict['initializers'] = "\n\n".join(data.initializers)
+        template_dict['modifications'] = '\n\n'.join(data.modifications)
+        template_dict['keywords'] = '"' + '", "'.join(data.keywords) + '"'
+        template_dict['format_units'] = ''.join(data.format_units)
+        template_dict['parse_arguments'] = ', '.join(data.parse_arguments)
+        template_dict['impl_parameters'] = ", ".join(data.impl_parameters)
+        template_dict['impl_arguments'] = ", ".join(data.impl_arguments)
+        template_dict['return_conversion'] = "".join(data.return_conversion).rstrip()
+        template_dict['cleanup'] = "".join(data.cleanup)
+        template_dict['return_value'] = data.return_value
+
+        # used by unpack tuple code generator
+        ignore_self = -1 if isinstance(converters[0], self_converter) else 0
+        unpack_min = first_optional
+        unpack_max = len(selfless)
+        template_dict['unpack_min'] = str(unpack_min)
+        template_dict['unpack_max'] = str(unpack_max)
+
+        if has_option_groups:
+            self.render_option_group_parsing(f, template_dict)
+
+        for name, destination in clinic.field_destinations.items():
+            template = templates[name]
+            if has_option_groups:
+                template = linear_format(template,
+                        option_group_parsing=template_dict['option_group_parsing'])
+            template = linear_format(template,
+                declarations=template_dict['declarations'],
+                return_conversion=template_dict['return_conversion'],
+                initializers=template_dict['initializers'],
+                modifications=template_dict['modifications'],
+                cleanup=template_dict['cleanup'],
+                )
+
+            # Only generate the "exit:" label
+            # if we have any gotos
+            need_exit_label = "goto exit;" in template
+            template = linear_format(template,
+                exit_label="exit:" if need_exit_label else ''
+                )
+
+            s = template.format_map(template_dict)
+
+            if clinic.line_prefix:
+                s = indent_all_lines(s, clinic.line_prefix)
+            if clinic.line_suffix:
+                s = suffix_all_lines(s, clinic.line_suffix)
+
+            destination.append(s)
+
+        return clinic.get_destination('block').dump()
+
+
+
+
+@contextlib.contextmanager
+def OverrideStdioWith(stdout):
+    saved_stdout = sys.stdout
+    sys.stdout = stdout
+    try:
+        yield
+    finally:
+        assert sys.stdout is stdout
+        sys.stdout = saved_stdout
+
+
+def create_regex(before, after, word=True, whole_line=True):
+    """Create an re object for matching marker lines."""
+    group_re = "\w+" if word else ".+"
+    pattern = r'{}({}){}'
+    if whole_line:
+        pattern = '^' + pattern + '$'
+    pattern = pattern.format(re.escape(before), group_re, re.escape(after))
+    return re.compile(pattern)
+
+
+class Block:
+    r"""
+    Represents a single block of text embedded in
+    another file.  If dsl_name is None, the block represents
+    verbatim text, raw original text from the file, in
+    which case "input" will be the only non-false member.
+    If dsl_name is not None, the block represents a Clinic
+    block.
+
+    input is always str, with embedded \n characters.
+    input represents the original text from the file;
+    if it's a Clinic block, it is the original text with
+    the body_prefix and redundant leading whitespace removed.
+
+    dsl_name is either str or None.  If str, it's the text
+    found on the start line of the block between the square
+    brackets.
+
+    signatures is either list or None.  If it's a list,
+    it may only contain clinic.Module, clinic.Class, and
+    clinic.Function objects.  At the moment it should
+    contain at most one of each.
+
+    output is either str or None.  If str, it's the output
+    from this block, with embedded '\n' characters.
+
+    indent is either str or None.  It's the leading whitespace
+    that was found on every line of input.  (If body_prefix is
+    not empty, this is the indent *after* removing the
+    body_prefix.)
+
+    preindent is either str or None.  It's the whitespace that
+    was found in front of every line of input *before* the
+    "body_prefix" (see the Language object).  If body_prefix
+    is empty, preindent must always be empty too.
+
+    To illustrate indent and preindent: Assume that '_'
+    represents whitespace.  If the block processed was in a
+    Python file, and looked like this:
+      ____#/*[python]
+      ____#__for a in range(20):
+      ____#____print(a)
+      ____#[python]*/
+    "preindent" would be "____" and "indent" would be "__".
+
+    """
+    def __init__(self, input, dsl_name=None, signatures=None, output=None, indent='', preindent=''):
+        assert isinstance(input, str)
+        self.input = input
+        self.dsl_name = dsl_name
+        self.signatures = signatures or []
+        self.output = output
+        self.indent = indent
+        self.preindent = preindent
+
+    def __repr__(self):
+        dsl_name = self.dsl_name or "text"
+        def summarize(s):
+            s = repr(s)
+            if len(s) > 30:
+                return s[:26] + "..." + s[0]
+            return s
+        return "".join((
+            "<Block ", dsl_name, " input=", summarize(self.input), " output=", summarize(self.output), ">"))
+
+
+class BlockParser:
+    """
+    Block-oriented parser for Argument Clinic.
+    Iterator, yields Block objects.
+    """
+
+    def __init__(self, input, language, *, verify=True):
+        """
+        "input" should be a str object
+        with embedded \n characters.
+
+        "language" should be a Language object.
+        """
+        language.validate()
+
+        self.input = collections.deque(reversed(input.splitlines(keepends=True)))
+        self.block_start_line_number = self.line_number = 0
+
+        self.language = language
+        before, _, after = language.start_line.partition('{dsl_name}')
+        assert _ == '{dsl_name}'
+        self.find_start_re = create_regex(before, after, whole_line=False)
+        self.start_re = create_regex(before, after)
+        self.verify = verify
+        self.last_checksum_re = None
+        self.last_dsl_name = None
+        self.dsl_name = None
+        self.first_block = True
+
+    def __iter__(self):
+        return self
+
+    def __next__(self):
+        while True:
+            if not self.input:
+                raise StopIteration
+
+            if self.dsl_name:
+                return_value = self.parse_clinic_block(self.dsl_name)
+                self.dsl_name = None
+                self.first_block = False
+                return return_value
+            block = self.parse_verbatim_block()
+            if self.first_block and not block.input:
+                continue
+            self.first_block = False
+            return block
+
+
+    def is_start_line(self, line):
+        match = self.start_re.match(line.lstrip())
+        return match.group(1) if match else None
+
+    def _line(self):
+        self.line_number += 1
+        line = self.input.pop()
+        self.language.parse_line(line)
+        return line
+
+    def parse_verbatim_block(self):
+        add, output = text_accumulator()
+        self.block_start_line_number = self.line_number
+
+        while self.input:
+            line = self._line()
+            dsl_name = self.is_start_line(line)
+            if dsl_name:
+                self.dsl_name = dsl_name
+                break
+            add(line)
+
+        return Block(output())
+
+    def parse_clinic_block(self, dsl_name):
+        input_add, input_output = text_accumulator()
+        self.block_start_line_number = self.line_number + 1
+        stop_line = self.language.stop_line.format(dsl_name=dsl_name)
+        body_prefix = self.language.body_prefix.format(dsl_name=dsl_name)
+
+        def is_stop_line(line):
+            # make sure to recognize stop line even if it
+            # doesn't end with EOL (it could be the very end of the file)
+            if not line.startswith(stop_line):
+                return False
+            remainder = line[len(stop_line):]
+            return (not remainder) or remainder.isspace()
+
+        # consume body of program
+        while self.input:
+            line = self._line()
+            if is_stop_line(line) or self.is_start_line(line):
+                break
+            if body_prefix:
+                line = line.lstrip()
+                assert line.startswith(body_prefix)
+                line = line[len(body_prefix):]
+            input_add(line)
+
+        # consume output and checksum line, if present.
+        if self.last_dsl_name == dsl_name:
+            checksum_re = self.last_checksum_re
+        else:
+            before, _, after = self.language.checksum_line.format(dsl_name=dsl_name, arguments='{arguments}').partition('{arguments}')
+            assert _ == '{arguments}'
+            checksum_re = create_regex(before, after, word=False)
+            self.last_dsl_name = dsl_name
+            self.last_checksum_re = checksum_re
+
+        # scan forward for checksum line
+        output_add, output_output = text_accumulator()
+        arguments = None
+        while self.input:
+            line = self._line()
+            match = checksum_re.match(line.lstrip())
+            arguments = match.group(1) if match else None
+            if arguments:
+                break
+            output_add(line)
+            if self.is_start_line(line):
+                break
+
+        output = output_output()
+        if arguments:
+            d = {}
+            for field in shlex.split(arguments):
+                name, equals, value = field.partition('=')
+                if not equals:
+                    fail("Mangled Argument Clinic marker line: {!r}".format(line))
+                d[name.strip()] = value.strip()
+
+            if self.verify:
+                if 'input' in d:
+                    checksum = d['output']
+                    input_checksum = d['input']
+                else:
+                    checksum = d['checksum']
+                    input_checksum = None
+
+                computed = compute_checksum(output, len(checksum))
+                if checksum != computed:
+                    fail("Checksum mismatch!\nExpected: {}\nComputed: {}\n"
+                         "Suggested fix: remove all generated code including "
+                         "the end marker,\n"
+                         "or use the '-f' option."
+                        .format(checksum, computed))
+        else:
+            # put back output
+            output_lines = output.splitlines(keepends=True)
+            self.line_number -= len(output_lines)
+            self.input.extend(reversed(output_lines))
+            output = None
+
+        return Block(input_output(), dsl_name, output=output)
+
+
+class BlockPrinter:
+
+    def __init__(self, language, f=None):
+        self.language = language
+        self.f = f or io.StringIO()
+
+    def print_block(self, block):
+        input = block.input
+        output = block.output
+        dsl_name = block.dsl_name
+        write = self.f.write
+
+        assert not ((dsl_name == None) ^ (output == None)), "you must specify dsl_name and output together, dsl_name " + repr(dsl_name)
+
+        if not dsl_name:
+            write(input)
+            return
+
+        write(self.language.start_line.format(dsl_name=dsl_name))
+        write("\n")
+
+        body_prefix = self.language.body_prefix.format(dsl_name=dsl_name)
+        if not body_prefix:
+            write(input)
+        else:
+            for line in input.split('\n'):
+                write(body_prefix)
+                write(line)
+                write("\n")
+
+        write(self.language.stop_line.format(dsl_name=dsl_name))
+        write("\n")
+
+        input = ''.join(block.input)
+        output = ''.join(block.output)
+        if output:
+            if not output.endswith('\n'):
+                output += '\n'
+            write(output)
+
+        arguments="output={} input={}".format(compute_checksum(output, 16), compute_checksum(input, 16))
+        write(self.language.checksum_line.format(dsl_name=dsl_name, arguments=arguments))
+        write("\n")
+
+    def write(self, text):
+        self.f.write(text)
+
+
+class Destination:
+    def __init__(self, name, type, clinic, *args):
+        self.name = name
+        self.type = type
+        self.clinic = clinic
+        valid_types = ('buffer', 'file', 'suppress', 'two-pass')
+        if type not in valid_types:
+            fail("Invalid destination type " + repr(type) + " for " + name + " , must be " + ', '.join(valid_types))
+        extra_arguments = 1 if type == "file" else 0
+        if len(args) < extra_arguments:
+            fail("Not enough arguments for destination " + name + " new " + type)
+        if len(args) > extra_arguments:
+            fail("Too many arguments for destination " + name + " new " + type)
+        if type =='file':
+            d = {}
+            filename = clinic.filename
+            d['path'] = filename
+            dirname, basename = os.path.split(filename)
+            if not dirname:
+                dirname = '.'
+            d['dirname'] = dirname
+            d['basename'] = basename
+            d['basename_root'], d['basename_extension'] = os.path.splitext(filename)
+            self.filename = args[0].format_map(d)
+        if type == 'two-pass':
+            self.id = None
+
+        self.text, self.append, self._dump = _text_accumulator()
+
+    def __repr__(self):
+        if self.type == 'file':
+            file_repr = " " + repr(self.filename)
+        else:
+            file_repr = ''
+        return "".join(("<Destination ", self.name, " ", self.type, file_repr, ">"))
+
+    def clear(self):
+        if self.type != 'buffer':
+            fail("Can't clear destination" + self.name + " , it's not of type buffer")
+        self.text.clear()
+
+    def dump(self):
+        if self.type == 'two-pass':
+            if self.id is None:
+                self.id = str(uuid.uuid4())
+                return self.id
+            fail("You can only dump a two-pass buffer exactly once!")
+        return self._dump()
+
+
+# maps strings to Language objects.
+# "languages" maps the name of the language ("C", "Python").
+# "extensions" maps the file extension ("c", "py").
+languages = { 'C': CLanguage, 'Python': PythonLanguage }
+extensions = { name: CLanguage for name in "c cc cpp cxx h hh hpp hxx".split() }
+extensions['py'] = PythonLanguage
+
+
+# maps strings to callables.
+# these callables must be of the form:
+#   def foo(name, default, *, ...)
+# The callable may have any number of keyword-only parameters.
+# The callable must return a CConverter object.
+# The callable should not call builtins.print.
+converters = {}
+
+# maps strings to callables.
+# these callables follow the same rules as those for "converters" above.
+# note however that they will never be called with keyword-only parameters.
+legacy_converters = {}
+
+
+# maps strings to callables.
+# these callables must be of the form:
+#   def foo(*, ...)
+# The callable may have any number of keyword-only parameters.
+# The callable must return a CConverter object.
+# The callable should not call builtins.print.
+return_converters = {}
+
+clinic = None
+class Clinic:
+
+    presets_text = """
+preset block
+everything block
+docstring_prototype suppress
+parser_prototype suppress
+cpp_if suppress
+cpp_endif suppress
+methoddef_ifndef buffer
+
+preset original
+everything block
+docstring_prototype suppress
+parser_prototype suppress
+cpp_if suppress
+cpp_endif suppress
+methoddef_ifndef buffer
+
+preset file
+everything file
+docstring_prototype suppress
+parser_prototype suppress
+impl_definition block
+
+preset buffer
+everything buffer
+docstring_prototype suppress
+impl_prototype suppress
+parser_prototype suppress
+impl_definition block
+
+preset partial-buffer
+everything buffer
+docstring_prototype block
+impl_prototype suppress
+methoddef_define block
+parser_prototype block
+impl_definition block
+
+preset two-pass
+everything buffer
+docstring_prototype two-pass
+impl_prototype suppress
+methoddef_define two-pass
+parser_prototype two-pass
+impl_definition block
+
+"""
+
+    def __init__(self, language, printer=None, *, force=False, verify=True, filename=None):
+        # maps strings to Parser objects.
+        # (instantiated from the "parsers" global.)
+        self.parsers = {}
+        self.language = language
+        if printer:
+            fail("Custom printers are broken right now")
+        self.printer = printer or BlockPrinter(language)
+        self.verify = verify
+        self.force = force
+        self.filename = filename
+        self.modules = collections.OrderedDict()
+        self.classes = collections.OrderedDict()
+        self.functions = []
+
+        self.line_prefix = self.line_suffix = ''
+
+        self.destinations = {}
+        self.add_destination("block", "buffer")
+        self.add_destination("suppress", "suppress")
+        self.add_destination("buffer", "buffer")
+        self.add_destination("two-pass", "two-pass")
+        if filename:
+            self.add_destination("file", "file", "{dirname}/clinic/{basename}.h")
+
+        d = self.destinations.get
+        self.field_destinations = collections.OrderedDict((
+            ('cpp_if', d('suppress')),
+            ('docstring_prototype', d('suppress')),
+            ('docstring_definition', d('block')),
+            ('methoddef_define', d('block')),
+            ('impl_prototype', d('block')),
+            ('parser_prototype', d('suppress')),
+            ('parser_definition', d('block')),
+            ('cpp_endif', d('suppress')),
+            ('methoddef_ifndef', d('buffer')),
+            ('impl_definition', d('block')),
+        ))
+
+        self.field_destinations_stack = []
+
+        self.presets = {}
+        preset = None
+        for line in self.presets_text.strip().split('\n'):
+            line = line.strip()
+            if not line:
+                continue
+            name, value = line.split()
+            if name == 'preset':
+                self.presets[value] = preset = collections.OrderedDict()
+                continue
+
+            destination = self.get_destination(value)
+
+            if name == 'everything':
+                for name in self.field_destinations:
+                    preset[name] = destination
+                continue
+
+            assert name in self.field_destinations
+            preset[name] = destination
+
+        global clinic
+        clinic = self
+
+    def get_destination(self, name, default=unspecified):
+        d = self.destinations.get(name)
+        if not d:
+            if default is not unspecified:
+                return default
+            fail("Destination does not exist: " + repr(name))
+        return d
+
+    def add_destination(self, name, type, *args):
+        if name in self.destinations:
+            fail("Destination already exists: " + repr(name))
+        self.destinations[name] = Destination(name, type, self, *args)
+
+    def parse(self, input):
+        printer = self.printer
+        self.block_parser = BlockParser(input, self.language, verify=self.verify)
+        for block in self.block_parser:
+            dsl_name = block.dsl_name
+            if dsl_name:
+                if dsl_name not in self.parsers:
+                    assert dsl_name in parsers, "No parser to handle {!r} block.".format(dsl_name)
+                    self.parsers[dsl_name] = parsers[dsl_name](self)
+                parser = self.parsers[dsl_name]
+                try:
+                    parser.parse(block)
+                except Exception:
+                    fail('Exception raised during parsing:\n' +
+                         traceback.format_exc().rstrip())
+            printer.print_block(block)
+
+        second_pass_replacements = {}
+
+        for name, destination in self.destinations.items():
+            if destination.type == 'suppress':
+                continue
+            output = destination._dump()
+
+            if destination.type == 'two-pass':
+                if destination.id:
+                    second_pass_replacements[destination.id] = output
+                elif output:
+                    fail("Two-pass buffer " + repr(name) + " not empty at end of file!")
+                continue
+
+            if output:
+
+                block = Block("", dsl_name="clinic", output=output)
+
+                if destination.type == 'buffer':
+                    block.input = "dump " + name + "\n"
+                    warn("Destination buffer " + repr(name) + " not empty at end of file, emptying.")
+                    printer.write("\n")
+                    printer.print_block(block)
+                    continue
+
+                if destination.type == 'file':
+                    try:
+                        dirname = os.path.dirname(destination.filename)
+                        try:
+                            os.makedirs(dirname)
+                        except FileExistsError:
+                            if not os.path.isdir(dirname):
+                                fail("Can't write to destination {}, "
+                                     "can't make directory {}!".format(
+                                        destination.filename, dirname))
+                        if self.verify:
+                            with open(destination.filename, "rt") as f:
+                                parser_2 = BlockParser(f.read(), language=self.language)
+                                blocks = list(parser_2)
+                                if (len(blocks) != 1) or (blocks[0].input != 'preserve\n'):
+                                    fail("Modified destination file " + repr(destination.filename) + ", not overwriting!")
+                    except FileNotFoundError:
+                        pass
+
+                    block.input = 'preserve\n'
+                    printer_2 = BlockPrinter(self.language)
+                    printer_2.print_block(block)
+                    with open(destination.filename, "wt") as f:
+                        f.write(printer_2.f.getvalue())
+                    continue
+        text = printer.f.getvalue()
+
+        if second_pass_replacements:
+            printer_2 = BlockPrinter(self.language)
+            parser_2 = BlockParser(text, self.language)
+            changed = False
+            for block in parser_2:
+                if block.dsl_name:
+                    for id, replacement in second_pass_replacements.items():
+                        if id in block.output:
+                            changed = True
+                            block.output = block.output.replace(id, replacement)
+                printer_2.print_block(block)
+            if changed:
+                text = printer_2.f.getvalue()
+
+        return text
+
+
+    def _module_and_class(self, fields):
+        """
+        fields should be an iterable of field names.
+        returns a tuple of (module, class).
+        the module object could actually be self (a clinic object).
+        this function is only ever used to find the parent of where
+        a new class/module should go.
+        """
+        in_classes = False
+        parent = module = self
+        cls = None
+        so_far = []
+
+        for field in fields:
+            so_far.append(field)
+            if not in_classes:
+                child = parent.modules.get(field)
+                if child:
+                    parent = module = child
+                    continue
+                in_classes = True
+            if not hasattr(parent, 'classes'):
+                return module, cls
+            child = parent.classes.get(field)
+            if not child:
+                fail('Parent class or module ' + '.'.join(so_far) + " does not exist.")
+            cls = parent = child
+
+        return module, cls
+
+
+def parse_file(filename, *, force=False, verify=True, output=None, encoding='utf-8'):
+    extension = os.path.splitext(filename)[1][1:]
+    if not extension:
+        fail("Can't extract file type for file " + repr(filename))
+
+    try:
+        language = extensions[extension](filename)
+    except KeyError:
+        fail("Can't identify file type for file " + repr(filename))
+
+    with open(filename, 'r', encoding=encoding) as f:
+        raw = f.read()
+
+    # exit quickly if there are no clinic markers in the file
+    find_start_re = BlockParser("", language).find_start_re
+    if not find_start_re.search(raw):
+        return
+
+    clinic = Clinic(language, force=force, verify=verify, filename=filename)
+    cooked = clinic.parse(raw)
+    if (cooked == raw) and not force:
+        return
+
+    directory = os.path.dirname(filename) or '.'
+
+    with tempfile.TemporaryDirectory(prefix="clinic", dir=directory) as tmpdir:
+        bytes = cooked.encode(encoding)
+        tmpfilename = os.path.join(tmpdir, os.path.basename(filename))
+        with open(tmpfilename, "wb") as f:
+            f.write(bytes)
+        os.replace(tmpfilename, output or filename)
+
+
+def compute_checksum(input, length=None):
+    input = input or ''
+    s = hashlib.sha1(input.encode('utf-8')).hexdigest()
+    if length:
+        s = s[:length]
+    return s
+
+
+
+
+class PythonParser:
+    def __init__(self, clinic):
+        pass
+
+    def parse(self, block):
+        s = io.StringIO()
+        with OverrideStdioWith(s):
+            exec(block.input)
+        block.output = s.getvalue()
+
+
+class Module:
+    def __init__(self, name, module=None):
+        self.name = name
+        self.module = self.parent = module
+
+        self.modules = collections.OrderedDict()
+        self.classes = collections.OrderedDict()
+        self.functions = []
+
+    def __repr__(self):
+        return "<clinic.Module " + repr(self.name) + " at " + str(id(self)) + ">"
+
+class Class:
+    def __init__(self, name, module=None, cls=None, typedef=None, type_object=None):
+        self.name = name
+        self.module = module
+        self.cls = cls
+        self.typedef = typedef
+        self.type_object = type_object
+        self.parent = cls or module
+
+        self.classes = collections.OrderedDict()
+        self.functions = []
+
+    def __repr__(self):
+        return "<clinic.Class " + repr(self.name) + " at " + str(id(self)) + ">"
+
+unsupported_special_methods = set("""
+
+__abs__
+__add__
+__and__
+__bytes__
+__call__
+__complex__
+__delitem__
+__divmod__
+__eq__
+__float__
+__floordiv__
+__ge__
+__getattr__
+__getattribute__
+__getitem__
+__gt__
+__hash__
+__iadd__
+__iand__
+__idivmod__
+__ifloordiv__
+__ilshift__
+__imod__
+__imul__
+__index__
+__int__
+__invert__
+__ior__
+__ipow__
+__irshift__
+__isub__
+__iter__
+__itruediv__
+__ixor__
+__le__
+__len__
+__lshift__
+__lt__
+__mod__
+__mul__
+__neg__
+__new__
+__next__
+__or__
+__pos__
+__pow__
+__radd__
+__rand__
+__rdivmod__
+__repr__
+__rfloordiv__
+__rlshift__
+__rmod__
+__rmul__
+__ror__
+__round__
+__rpow__
+__rrshift__
+__rshift__
+__rsub__
+__rtruediv__
+__rxor__
+__setattr__
+__setitem__
+__str__
+__sub__
+__truediv__
+__xor__
+
+""".strip().split())
+
+
+INVALID, CALLABLE, STATIC_METHOD, CLASS_METHOD, METHOD_INIT, METHOD_NEW = """
+INVALID, CALLABLE, STATIC_METHOD, CLASS_METHOD, METHOD_INIT, METHOD_NEW
+""".replace(",", "").strip().split()
+
+class Function:
+    """
+    Mutable duck type for inspect.Function.
+
+    docstring - a str containing
+        * embedded line breaks
+        * text outdented to the left margin
+        * no trailing whitespace.
+        It will always be true that
+            (not docstring) or ((not docstring[0].isspace()) and (docstring.rstrip() == docstring))
+    """
+
+    def __init__(self, parameters=None, *, name,
+                 module, cls=None, c_basename=None,
+                 full_name=None,
+                 return_converter, return_annotation=_empty,
+                 docstring=None, kind=CALLABLE, coexist=False,
+                 docstring_only=False):
+        self.parameters = parameters or collections.OrderedDict()
+        self.return_annotation = return_annotation
+        self.name = name
+        self.full_name = full_name
+        self.module = module
+        self.cls = cls
+        self.parent = cls or module
+        self.c_basename = c_basename
+        self.return_converter = return_converter
+        self.docstring = docstring or ''
+        self.kind = kind
+        self.coexist = coexist
+        self.self_converter = None
+        # docstring_only means "don't generate a machine-readable
+        # signature, just a normal docstring".  it's True for
+        # functions with optional groups because we can't represent
+        # those accurately with inspect.Signature in 3.4.
+        self.docstring_only = docstring_only
+
+        self.rendered_parameters = None
+
+    __render_parameters__ = None
+    @property
+    def render_parameters(self):
+        if not self.__render_parameters__:
+            self.__render_parameters__ = l = []
+            for p in self.parameters.values():
+                p = p.copy()
+                p.converter.pre_render()
+                l.append(p)
+        return self.__render_parameters__
+
+    @property
+    def methoddef_flags(self):
+        if self.kind in (METHOD_INIT, METHOD_NEW):
+            return None
+        flags = []
+        if self.kind == CLASS_METHOD:
+            flags.append('METH_CLASS')
+        elif self.kind == STATIC_METHOD:
+            flags.append('METH_STATIC')
+        else:
+            assert self.kind == CALLABLE, "unknown kind: " + repr(self.kind)
+        if self.coexist:
+            flags.append('METH_COEXIST')
+        return '|'.join(flags)
+
+    def __repr__(self):
+        return '<clinic.Function ' + self.name + '>'
+
+    def copy(self, **overrides):
+        kwargs = {
+            'name': self.name, 'module': self.module, 'parameters': self.parameters,
+            'cls': self.cls, 'c_basename': self.c_basename,
+            'full_name': self.full_name,
+            'return_converter': self.return_converter, 'return_annotation': self.return_annotation,
+            'docstring': self.docstring, 'kind': self.kind, 'coexist': self.coexist,
+            'docstring_only': self.docstring_only,
+            }
+        kwargs.update(overrides)
+        f = Function(**kwargs)
+
+        parameters = collections.OrderedDict()
+        for name, value in f.parameters.items():
+            value = value.copy(function=f)
+            parameters[name] = value
+        f.parameters = parameters
+        return f
+
+
+class Parameter:
+    """
+    Mutable duck type of inspect.Parameter.
+    """
+
+    def __init__(self, name, kind, *, default=_empty,
+                 function, converter, annotation=_empty,
+                 docstring=None, group=0):
+        self.name = name
+        self.kind = kind
+        self.default = default
+        self.function = function
+        self.converter = converter
+        self.annotation = annotation
+        self.docstring = docstring or ''
+        self.group = group
+
+    def __repr__(self):
+        return '<clinic.Parameter ' + self.name + '>'
+
+    def is_keyword_only(self):
+        return self.kind == inspect.Parameter.KEYWORD_ONLY
+
+    def is_positional_only(self):
+        return self.kind == inspect.Parameter.POSITIONAL_ONLY
+
+    def copy(self, **overrides):
+        kwargs = {
+            'name': self.name, 'kind': self.kind, 'default':self.default,
+                 'function': self.function, 'converter': self.converter, 'annotation': self.annotation,
+                 'docstring': self.docstring, 'group': self.group,
+            }
+        kwargs.update(overrides)
+        if 'converter' not in overrides:
+            converter = copy.copy(self.converter)
+            converter.function = kwargs['function']
+            kwargs['converter'] = converter
+        return Parameter(**kwargs)
+
+
+
+class LandMine:
+    # try to access any
+    def __init__(self, message):
+        self.__message__ = message
+
+    def __repr__(self):
+        return '<LandMine ' + repr(self.__message__) + ">"
+
+    def __getattribute__(self, name):
+        if name in ('__repr__', '__message__'):
+            return super().__getattribute__(name)
+        # raise RuntimeError(repr(name))
+        fail("Stepped on a land mine, trying to access attribute " + repr(name) + ":\n" + self.__message__)
+
+
+def add_c_converter(f, name=None):
+    if not name:
+        name = f.__name__
+        if not name.endswith('_converter'):
+            return f
+        name = name[:-len('_converter')]
+    converters[name] = f
+    return f
+
+def add_default_legacy_c_converter(cls):
+    # automatically add converter for default format unit
+    # (but without stomping on the existing one if it's already
+    # set, in case you subclass)
+    if ((cls.format_unit not in ('O&', '')) and
+        (cls.format_unit not in legacy_converters)):
+        legacy_converters[cls.format_unit] = cls
+    return cls
+
+def add_legacy_c_converter(format_unit, **kwargs):
+    """
+    Adds a legacy converter.
+    """
+    def closure(f):
+        if not kwargs:
+            added_f = f
+        else:
+            added_f = functools.partial(f, **kwargs)
+        if format_unit:
+            legacy_converters[format_unit] = added_f
+        return f
+    return closure
+
+class CConverterAutoRegister(type):
+    def __init__(cls, name, bases, classdict):
+        add_c_converter(cls)
+        add_default_legacy_c_converter(cls)
+
+class CConverter(metaclass=CConverterAutoRegister):
+    """
+    For the init function, self, name, function, and default
+    must be keyword-or-positional parameters.  All other
+    parameters must be keyword-only.
+    """
+
+    # The C name to use for this variable.
+    name = None
+
+    # The Python name to use for this variable.
+    py_name = None
+
+    # The C type to use for this variable.
+    # 'type' should be a Python string specifying the type, e.g. "int".
+    # If this is a pointer type, the type string should end with ' *'.
+    type = None
+
+    # The Python default value for this parameter, as a Python value.
+    # Or the magic value "unspecified" if there is no default.
+    # Or the magic value "unknown" if this value is a cannot be evaluated
+    # at Argument-Clinic-preprocessing time (but is presumed to be valid
+    # at runtime).
+    default = unspecified
+
+    # If not None, default must be isinstance() of this type.
+    # (You can also specify a tuple of types.)
+    default_type = None
+
+    # "default" converted into a C value, as a string.
+    # Or None if there is no default.
+    c_default = None
+
+    # "default" converted into a Python value, as a string.
+    # Or None if there is no default.
+    py_default = None
+
+    # The default value used to initialize the C variable when
+    # there is no default, but not specifying a default may
+    # result in an "uninitialized variable" warning.  This can
+    # easily happen when using option groups--although
+    # properly-written code won't actually use the variable,
+    # the variable does get passed in to the _impl.  (Ah, if
+    # only dataflow analysis could inline the static function!)
+    #
+    # This value is specified as a string.
+    # Every non-abstract subclass should supply a valid value.
+    c_ignored_default = 'NULL'
+
+    # The C converter *function* to be used, if any.
+    # (If this is not None, format_unit must be 'O&'.)
+    converter = None
+
+    # Should Argument Clinic add a '&' before the name of
+    # the variable when passing it into the _impl function?
+    impl_by_reference = False
+
+    # Should Argument Clinic add a '&' before the name of
+    # the variable when passing it into PyArg_ParseTuple (AndKeywords)?
+    parse_by_reference = True
+
+    #############################################################
+    #############################################################
+    ## You shouldn't need to read anything below this point to ##
+    ## write your own converter functions.                     ##
+    #############################################################
+    #############################################################
+
+    # The "format unit" to specify for this variable when
+    # parsing arguments using PyArg_ParseTuple (AndKeywords).
+    # Custom converters should always use the default value of 'O&'.
+    format_unit = 'O&'
+
+    # What encoding do we want for this variable?  Only used
+    # by format units starting with 'e'.
+    encoding = None
+
+    # Should this object be required to be a subclass of a specific type?
+    # If not None, should be a string representing a pointer to a
+    # PyTypeObject (e.g. "&PyUnicode_Type").
+    # Only used by the 'O!' format unit (and the "object" converter).
+    subclass_of = None
+
+    # Do we want an adjacent '_length' variable for this variable?
+    # Only used by format units ending with '#'.
+    length = False
+
+    # Should we show this parameter in the generated
+    # __text_signature__? This is *almost* always True.
+    # (It's only False for __new__, __init__, and METH_STATIC functions.)
+    show_in_signature = True
+
+    # Overrides the name used in a text signature.
+    # The name used for a "self" parameter must be one of
+    # self, type, or module; however users can set their own.
+    # This lets the self_converter overrule the user-settable
+    # name, *just* for the text signature.
+    # Only set by self_converter.
+    signature_name = None
+
+    # keep in sync with self_converter.__init__!
+    def __init__(self, name, py_name, function, default=unspecified, *, c_default=None, py_default=None, annotation=unspecified, **kwargs):
+        self.name = name
+        self.py_name = py_name
+
+        if default is not unspecified:
+            if self.default_type and not isinstance(default, (self.default_type, Unknown)):
+                if isinstance(self.default_type, type):
+                    types_str = self.default_type.__name__
+                else:
+                    types_str = ', '.join((cls.__name__ for cls in self.default_type))
+                fail("{}: default value {!r} for field {} is not of type {}".format(
+                    self.__class__.__name__, default, name, types_str))
+            self.default = default
+
+        if c_default:
+            self.c_default = c_default
+        if py_default:
+            self.py_default = py_default
+
+        if annotation != unspecified:
+            fail("The 'annotation' parameter is not currently permitted.")
+
+        # this is deliberate, to prevent you from caching information
+        # about the function in the init.
+        # (that breaks if we get cloned.)
+        # so after this change we will noisily fail.
+        self.function = LandMine("Don't access members of self.function inside converter_init!")
+        self.converter_init(**kwargs)
+        self.function = function
+
+    def converter_init(self):
+        pass
+
+    def is_optional(self):
+        return (self.default is not unspecified)
+
+    def _render_self(self, parameter, data):
+        self.parameter = parameter
+        original_name = self.name
+        name = ensure_legal_c_identifier(original_name)
+
+        # impl_arguments
+        s = ("&" if self.impl_by_reference else "") + name
+        data.impl_arguments.append(s)
+        if self.length:
+            data.impl_arguments.append(self.length_name())
+
+        # impl_parameters
+        data.impl_parameters.append(self.simple_declaration(by_reference=self.impl_by_reference))
+        if self.length:
+            data.impl_parameters.append("Py_ssize_clean_t " + self.length_name())
+
+    def _render_non_self(self, parameter, data):
+        self.parameter = parameter
+        original_name = self.name
+        name = ensure_legal_c_identifier(original_name)
+
+        # declarations
+        d = self.declaration()
+        data.declarations.append(d)
+
+        # initializers
+        initializers = self.initialize()
+        if initializers:
+            data.initializers.append('/* initializers for ' + name + ' */\n' + initializers.rstrip())
+
+        # modifications
+        modifications = self.modify()
+        if modifications:
+            data.modifications.append('/* modifications for ' + name + ' */\n' + modifications.rstrip())
+
+        # keywords
+        data.keywords.append(parameter.name)
+
+        # format_units
+        if self.is_optional() and '|' not in data.format_units:
+            data.format_units.append('|')
+        if parameter.is_keyword_only() and '$' not in data.format_units:
+            data.format_units.append('$')
+        data.format_units.append(self.format_unit)
+
+        # parse_arguments
+        self.parse_argument(data.parse_arguments)
+
+        # cleanup
+        cleanup = self.cleanup()
+        if cleanup:
+            data.cleanup.append('/* Cleanup for ' + name + ' */\n' + cleanup.rstrip() + "\n")
+
+    def render(self, parameter, data):
+        """
+        parameter is a clinic.Parameter instance.
+        data is a CRenderData instance.
+        """
+        self._render_self(parameter, data)
+        self._render_non_self(parameter, data)
+
+    def length_name(self):
+        """Computes the name of the associated "length" variable."""
+        if not self.length:
+            return None
+        return ensure_legal_c_identifier(self.name) + "_length"
+
+    # Why is this one broken out separately?
+    # For "positional-only" function parsing,
+    # which generates a bunch of PyArg_ParseTuple calls.
+    def parse_argument(self, list):
+        assert not (self.converter and self.encoding)
+        if self.format_unit == 'O&':
+            assert self.converter
+            list.append(self.converter)
+
+        if self.encoding:
+            list.append(c_repr(self.encoding))
+        elif self.subclass_of:
+            list.append(self.subclass_of)
+
+        legal_name = ensure_legal_c_identifier(self.name)
+        s = ("&" if self.parse_by_reference else "") + legal_name
+        list.append(s)
+
+        if self.length:
+            list.append("&" + self.length_name())
+
+    #
+    # All the functions after here are intended as extension points.
+    #
+
+    def simple_declaration(self, by_reference=False):
+        """
+        Computes the basic declaration of the variable.
+        Used in computing the prototype declaration and the
+        variable declaration.
+        """
+        prototype = [self.type]
+        if by_reference or not self.type.endswith('*'):
+            prototype.append(" ")
+        if by_reference:
+            prototype.append('*')
+        prototype.append(ensure_legal_c_identifier(self.name))
+        return "".join(prototype)
+
+    def declaration(self):
+        """
+        The C statement to declare this variable.
+        """
+        declaration = [self.simple_declaration()]
+        default = self.c_default
+        if not default and self.parameter.group:
+            default = self.c_ignored_default
+        if default:
+            declaration.append(" = ")
+            declaration.append(default)
+        declaration.append(";")
+        if self.length:
+            declaration.append('\nPy_ssize_clean_t ')
+            declaration.append(self.length_name())
+            declaration.append(';')
+        s = "".join(declaration)
+        # double up curly-braces, this string will be used
+        # as part of a format_map() template later
+        s = s.replace("{", "{{")
+        s = s.replace("}", "}}")
+        return s
+
+    def initialize(self):
+        """
+        The C statements required to set up this variable before parsing.
+        Returns a string containing this code indented at column 0.
+        If no initialization is necessary, returns an empty string.
+        """
+        return ""
+
+    def modify(self):
+        """
+        The C statements required to modify this variable after parsing.
+        Returns a string containing this code indented at column 0.
+        If no initialization is necessary, returns an empty string.
+        """
+        return ""
+
+    def cleanup(self):
+        """
+        The C statements required to clean up after this variable.
+        Returns a string containing this code indented at column 0.
+        If no cleanup is necessary, returns an empty string.
+        """
+        return ""
+
+    def pre_render(self):
+        """
+        A second initialization function, like converter_init,
+        called just before rendering.
+        You are permitted to examine self.function here.
+        """
+        pass
+
+
+class bool_converter(CConverter):
+    type = 'int'
+    default_type = bool
+    format_unit = 'p'
+    c_ignored_default = '0'
+
+    def converter_init(self):
+        if self.default is not unspecified:
+            self.default = bool(self.default)
+            self.c_default = str(int(self.default))
+
+class char_converter(CConverter):
+    type = 'char'
+    default_type = str
+    format_unit = 'c'
+    c_ignored_default = "'\0'"
+
+    def converter_init(self):
+        if isinstance(self.default, str) and (len(self.default) != 1):
+            fail("char_converter: illegal default value " + repr(self.default))
+
+
+@add_legacy_c_converter('B', bitwise=True)
+class unsigned_char_converter(CConverter):
+    type = 'unsigned char'
+    default_type = int
+    format_unit = 'b'
+    c_ignored_default = "'\0'"
+
+    def converter_init(self, *, bitwise=False):
+        if bitwise:
+            self.format_unit = 'B'
+
+class byte_converter(unsigned_char_converter): pass
+
+class short_converter(CConverter):
+    type = 'short'
+    default_type = int
+    format_unit = 'h'
+    c_ignored_default = "0"
+
+class unsigned_short_converter(CConverter):
+    type = 'unsigned short'
+    default_type = int
+    format_unit = 'H'
+    c_ignored_default = "0"
+
+    def converter_init(self, *, bitwise=False):
+        if not bitwise:
+            fail("Unsigned shorts must be bitwise (for now).")
+
+@add_legacy_c_converter('C', types='str')
+class int_converter(CConverter):
+    type = 'int'
+    default_type = int
+    format_unit = 'i'
+    c_ignored_default = "0"
+
+    def converter_init(self, *, types='int'):
+        if types == 'str':
+            self.format_unit = 'C'
+        elif types != 'int':
+            fail("int_converter: illegal 'types' argument")
+
+class unsigned_int_converter(CConverter):
+    type = 'unsigned int'
+    default_type = int
+    format_unit = 'I'
+    c_ignored_default = "0"
+
+    def converter_init(self, *, bitwise=False):
+        if not bitwise:
+            fail("Unsigned ints must be bitwise (for now).")
+
+class long_converter(CConverter):
+    type = 'long'
+    default_type = int
+    format_unit = 'l'
+    c_ignored_default = "0"
+
+class unsigned_long_converter(CConverter):
+    type = 'unsigned long'
+    default_type = int
+    format_unit = 'k'
+    c_ignored_default = "0"
+
+    def converter_init(self, *, bitwise=False):
+        if not bitwise:
+            fail("Unsigned longs must be bitwise (for now).")
+
+class PY_LONG_LONG_converter(CConverter):
+    type = 'PY_LONG_LONG'
+    default_type = int
+    format_unit = 'L'
+    c_ignored_default = "0"
+
+class unsigned_PY_LONG_LONG_converter(CConverter):
+    type = 'unsigned PY_LONG_LONG'
+    default_type = int
+    format_unit = 'K'
+    c_ignored_default = "0"
+
+    def converter_init(self, *, bitwise=False):
+        if not bitwise:
+            fail("Unsigned PY_LONG_LONGs must be bitwise (for now).")
+
+class Py_ssize_t_converter(CConverter):
+    type = 'Py_ssize_t'
+    default_type = int
+    format_unit = 'n'
+    c_ignored_default = "0"
+
+
+class float_converter(CConverter):
+    type = 'float'
+    default_type = float
+    format_unit = 'f'
+    c_ignored_default = "0.0"
+
+class double_converter(CConverter):
+    type = 'double'
+    default_type = float
+    format_unit = 'd'
+    c_ignored_default = "0.0"
+
+
+class Py_complex_converter(CConverter):
+    type = 'Py_complex'
+    default_type = complex
+    format_unit = 'D'
+    c_ignored_default = "{0.0, 0.0}"
+
+
+class object_converter(CConverter):
+    type = 'PyObject *'
+    format_unit = 'O'
+
+    def converter_init(self, *, converter=None, type=None, subclass_of=None):
+        if converter:
+            if subclass_of:
+                fail("object: Cannot pass in both 'converter' and 'subclass_of'")
+            self.format_unit = 'O&'
+            self.converter = converter
+        elif subclass_of:
+            self.format_unit = 'O!'
+            self.subclass_of = subclass_of
+
+        if type is not None:
+            self.type = type
+
+
+@add_legacy_c_converter('s#', length=True)
+@add_legacy_c_converter('y', types="bytes")
+@add_legacy_c_converter('y#', types="bytes", length=True)
+@add_legacy_c_converter('z', nullable=True)
+@add_legacy_c_converter('z#', nullable=True, length=True)
+class str_converter(CConverter):
+    type = 'const char *'
+    default_type = (str, Null, NoneType)
+    format_unit = 's'
+
+    def converter_init(self, *, encoding=None, types="str",
+        length=False, nullable=False, zeroes=False):
+
+        types = set(types.strip().split())
+        bytes_type = set(("bytes",))
+        str_type = set(("str",))
+        all_3_type = set(("bytearray",)) | bytes_type | str_type
+        is_bytes = types == bytes_type
+        is_str = types == str_type
+        is_all_3 = types == all_3_type
+
+        self.length = bool(length)
+        format_unit = None
+
+        if encoding:
+            self.encoding = encoding
+
+            if is_str and not (length or zeroes or nullable):
+                format_unit = 'es'
+            elif is_all_3 and not (length or zeroes or nullable):
+                format_unit = 'et'
+            elif is_str and length and zeroes and not nullable:
+                format_unit = 'es#'
+            elif is_all_3 and length and not (nullable or zeroes):
+                format_unit = 'et#'
+
+            if format_unit.endswith('#'):
+                fail("Sorry: code using format unit ", repr(format_unit), "probably doesn't work properly yet.\nGive Larry your test case and he'll it.")
+                # TODO set pointer to NULL
+                # TODO add cleanup for buffer
+                pass
+
+        else:
+            if zeroes:
+                fail("str_converter: illegal combination of arguments (zeroes is only legal with an encoding)")
+
+            if is_bytes and not (nullable or length):
+                format_unit = 'y'
+            elif is_bytes and length and not nullable:
+                format_unit = 'y#'
+            elif is_str and not (nullable or length):
+                format_unit = 's'
+            elif is_str and length and not nullable:
+                format_unit = 's#'
+            elif is_str and nullable  and not length:
+                format_unit = 'z'
+            elif is_str and nullable and length:
+                format_unit = 'z#'
+
+        if not format_unit:
+            fail("str_converter: illegal combination of arguments")
+        self.format_unit = format_unit
+
+
+class PyBytesObject_converter(CConverter):
+    type = 'PyBytesObject *'
+    format_unit = 'S'
+
+class PyByteArrayObject_converter(CConverter):
+    type = 'PyByteArrayObject *'
+    format_unit = 'Y'
+
+class unicode_converter(CConverter):
+    type = 'PyObject *'
+    default_type = (str, Null, NoneType)
+    format_unit = 'U'
+
+@add_legacy_c_converter('u#', length=True)
+@add_legacy_c_converter('Z', nullable=True)
+@add_legacy_c_converter('Z#', nullable=True, length=True)
+class Py_UNICODE_converter(CConverter):
+    type = 'Py_UNICODE *'
+    default_type = (str, Null, NoneType)
+    format_unit = 'u'
+
+    def converter_init(self, *, nullable=False, length=False):
+        format_unit = 'Z' if nullable else 'u'
+        if length:
+            format_unit += '#'
+            self.length = True
+        self.format_unit = format_unit
+
+#
+# We define three string conventions for buffer types in the 'types' argument:
+#  'buffer' : any object supporting the buffer interface
+#  'rwbuffer': any object supporting the buffer interface, but must be writeable
+#  'robuffer': any object supporting the buffer interface, but must not be writeable
+#
+@add_legacy_c_converter('s*', types='str bytes bytearray buffer')
+@add_legacy_c_converter('z*', types='str bytes bytearray buffer', nullable=True)
+@add_legacy_c_converter('w*', types='bytearray rwbuffer')
+class Py_buffer_converter(CConverter):
+    type = 'Py_buffer'
+    format_unit = 'y*'
+    impl_by_reference = True
+    c_ignored_default = "{NULL, NULL}"
+
+    def converter_init(self, *, types='bytes bytearray buffer', nullable=False):
+        if self.default not in (unspecified, None):
+            fail("The only legal default value for Py_buffer is None.")
+        self.c_default = self.c_ignored_default
+        types = set(types.strip().split())
+        bytes_type = set(('bytes',))
+        bytearray_type = set(('bytearray',))
+        buffer_type = set(('buffer',))
+        rwbuffer_type = set(('rwbuffer',))
+        robuffer_type = set(('robuffer',))
+        str_type = set(('str',))
+        bytes_bytearray_buffer_type = bytes_type | bytearray_type | buffer_type
+
+        format_unit = None
+        if types == (str_type | bytes_bytearray_buffer_type):
+            format_unit = 's*' if not nullable else 'z*'
+        else:
+            if nullable:
+                fail('Py_buffer_converter: illegal combination of arguments (nullable=True)')
+            elif types == (bytes_bytearray_buffer_type):
+                format_unit = 'y*'
+            elif types == (bytearray_type | rwbuffer_type):
+                format_unit = 'w*'
+        if not format_unit:
+            fail("Py_buffer_converter: illegal combination of arguments")
+
+        self.format_unit = format_unit
+
+    def cleanup(self):
+        name = ensure_legal_c_identifier(self.name)
+        return "".join(["if (", name, ".obj)\n   PyBuffer_Release(&", name, ");\n"])
+
+
+def correct_name_for_self(f):
+    if f.kind in (CALLABLE, METHOD_INIT):
+        if f.cls:
+            return "PyObject *", "self"
+        return "PyModuleDef *", "module"
+    if f.kind == STATIC_METHOD:
+        return "void *", "null"
+    if f.kind in (CLASS_METHOD, METHOD_NEW):
+        return "PyTypeObject *", "type"
+    raise RuntimeError("Unhandled type of function f: " + repr(f.kind))
+
+def required_type_for_self_for_parser(f):
+    type, _ = correct_name_for_self(f)
+    if f.kind in (METHOD_INIT, METHOD_NEW, STATIC_METHOD, CLASS_METHOD):
+        return type
+    return None
+
+
+class self_converter(CConverter):
+    """
+    A special-case converter:
+    this is the default converter used for "self".
+    """
+    type = None
+    format_unit = ''
+
+    def converter_init(self, *, type=None):
+        self.specified_type = type
+
+    def pre_render(self):
+        f = self.function
+        default_type, default_name = correct_name_for_self(f)
+        self.signature_name = default_name
+        self.type = self.specified_type or self.type or default_type
+
+        kind = self.function.kind
+        new_or_init = kind in (METHOD_NEW, METHOD_INIT)
+
+        if (kind == STATIC_METHOD) or new_or_init:
+            self.show_in_signature = False
+
+    # tp_new (METHOD_NEW) functions are of type newfunc:
+    #     typedef PyObject *(*newfunc)(struct _typeobject *, PyObject *, PyObject *);
+    # PyTypeObject is a typedef for struct _typeobject.
+    #
+    # tp_init (METHOD_INIT) functions are of type initproc:
+    #     typedef int (*initproc)(PyObject *, PyObject *, PyObject *);
+    #
+    # All other functions generated by Argument Clinic are stored in
+    # PyMethodDef structures, in the ml_meth slot, which is of type PyCFunction:
+    #     typedef PyObject *(*PyCFunction)(PyObject *, PyObject *);
+    # However!  We habitually cast these functions to PyCFunction,
+    # since functions that accept keyword arguments don't fit this signature
+    # but are stored there anyway.  So strict type equality isn't important
+    # for these functions.
+    #
+    # So:
+    #
+    # * The name of the first parameter to the impl and the parsing function will always
+    #   be self.name.
+    #
+    # * The type of the first parameter to the impl will always be of self.type.
+    #
+    # * If the function is neither tp_new (METHOD_NEW) nor tp_init (METHOD_INIT):
+    #   * The type of the first parameter to the parsing function is also self.type.
+    #     This means that if you step into the parsing function, your "self" parameter
+    #     is of the correct type, which may make debugging more pleasant.
+    #
+    # * Else if the function is tp_new (METHOD_NEW):
+    #   * The type of the first parameter to the parsing function is "PyTypeObject *",
+    #     so the type signature of the function call is an exact match.
+    #   * If self.type != "PyTypeObject *", we cast the first parameter to self.type
+    #     in the impl call.
+    #
+    # * Else if the function is tp_init (METHOD_INIT):
+    #   * The type of the first parameter to the parsing function is "PyObject *",
+    #     so the type signature of the function call is an exact match.
+    #   * If self.type != "PyObject *", we cast the first parameter to self.type
+    #     in the impl call.
+
+    @property
+    def parser_type(self):
+        return required_type_for_self_for_parser(self.function) or self.type
+
+    def render(self, parameter, data):
+        """
+        parameter is a clinic.Parameter instance.
+        data is a CRenderData instance.
+        """
+        if self.function.kind == STATIC_METHOD:
+            return
+
+        self._render_self(parameter, data)
+
+        if self.type != self.parser_type:
+            # insert cast to impl_argument[0], aka self.
+            # we know we're in the first slot in all the CRenderData lists,
+            # because we render parameters in order, and self is always first.
+            assert len(data.impl_arguments) == 1
+            assert data.impl_arguments[0] == self.name
+            data.impl_arguments[0] = '(' + self.type + ")" + data.impl_arguments[0]
+
+    def set_template_dict(self, template_dict):
+        template_dict['self_name'] = self.name
+        template_dict['self_type'] = self.parser_type
+        kind = self.function.kind
+        cls = self.function.cls
+
+        if ((kind in (METHOD_NEW, METHOD_INIT)) and cls and cls.typedef):
+            if kind == METHOD_NEW:
+                passed_in_type = self.name
+            else:
+                passed_in_type = 'Py_TYPE({})'.format(self.name)
+
+            line = '({passed_in_type} == {type_object}) &&\n        '
+            d = {
+                'type_object': self.function.cls.type_object,
+                'passed_in_type': passed_in_type
+                }
+            template_dict['self_type_check'] = line.format_map(d)
+
+
+
+def add_c_return_converter(f, name=None):
+    if not name:
+        name = f.__name__
+        if not name.endswith('_return_converter'):
+            return f
+        name = name[:-len('_return_converter')]
+    return_converters[name] = f
+    return f
+
+
+class CReturnConverterAutoRegister(type):
+    def __init__(cls, name, bases, classdict):
+        add_c_return_converter(cls)
+
+class CReturnConverter(metaclass=CReturnConverterAutoRegister):
+
+    # The C type to use for this variable.
+    # 'type' should be a Python string specifying the type, e.g. "int".
+    # If this is a pointer type, the type string should end with ' *'.
+    type = 'PyObject *'
+
+    # The Python default value for this parameter, as a Python value.
+    # Or the magic value "unspecified" if there is no default.
+    default = None
+
+    def __init__(self, *, py_default=None, **kwargs):
+        self.py_default = py_default
+        try:
+            self.return_converter_init(**kwargs)
+        except TypeError as e:
+            s = ', '.join(name + '=' + repr(value) for name, value in kwargs.items())
+            sys.exit(self.__class__.__name__ + '(' + s + ')\n' + str(e))
+
+    def return_converter_init(self):
+        pass
+
+    def declare(self, data, name="_return_value"):
+        line = []
+        add = line.append
+        add(self.type)
+        if not self.type.endswith('*'):
+            add(' ')
+        add(name + ';')
+        data.declarations.append(''.join(line))
+        data.return_value = name
+
+    def err_occurred_if(self, expr, data):
+        data.return_conversion.append('if (({}) && PyErr_Occurred())\n    goto exit;\n'.format(expr))
+
+    def err_occurred_if_null_pointer(self, variable, data):
+        data.return_conversion.append('if ({} == NULL)\n    goto exit;\n'.format(variable))
+
+    def render(self, function, data):
+        """
+        function is a clinic.Function instance.
+        data is a CRenderData instance.
+        """
+        pass
+
+add_c_return_converter(CReturnConverter, 'object')
+
+class NoneType_return_converter(CReturnConverter):
+    def render(self, function, data):
+        self.declare(data)
+        data.return_conversion.append('''
+if (_return_value != Py_None)
+    goto exit;
+return_value = Py_None;
+Py_INCREF(Py_None);
+'''.strip())
+
+class bool_return_converter(CReturnConverter):
+    type = 'int'
+
+    def render(self, function, data):
+        self.declare(data)
+        self.err_occurred_if("_return_value == -1", data)
+        data.return_conversion.append('return_value = PyBool_FromLong((long)_return_value);\n')
+
+class long_return_converter(CReturnConverter):
+    type = 'long'
+    conversion_fn = 'PyLong_FromLong'
+    cast = ''
+
+    def render(self, function, data):
+        self.declare(data)
+        self.err_occurred_if("_return_value == -1", data)
+        data.return_conversion.append(
+            ''.join(('return_value = ', self.conversion_fn, '(', self.cast, '_return_value);\n')))
+
+class int_return_converter(long_return_converter):
+    type = 'int'
+    cast = '(long)'
+
+class init_return_converter(long_return_converter):
+    """
+    Special return converter for __init__ functions.
+    """
+    type = 'int'
+    cast = '(long)'
+
+    def render(self, function, data):
+        pass
+
+class unsigned_long_return_converter(long_return_converter):
+    type = 'unsigned long'
+    conversion_fn = 'PyLong_FromUnsignedLong'
+
+class unsigned_int_return_converter(unsigned_long_return_converter):
+    type = 'unsigned int'
+    cast = '(unsigned long)'
+
+class Py_ssize_t_return_converter(long_return_converter):
+    type = 'Py_ssize_t'
+    conversion_fn = 'PyLong_FromSsize_t'
+
+class size_t_return_converter(long_return_converter):
+    type = 'size_t'
+    conversion_fn = 'PyLong_FromSize_t'
+
+
+class double_return_converter(CReturnConverter):
+    type = 'double'
+    cast = ''
+
+    def render(self, function, data):
+        self.declare(data)
+        self.err_occurred_if("_return_value == -1.0", data)
+        data.return_conversion.append(
+            'return_value = PyFloat_FromDouble(' + self.cast + '_return_value);\n')
+
+class float_return_converter(double_return_converter):
+    type = 'float'
+    cast = '(double)'
+
+
+class DecodeFSDefault_return_converter(CReturnConverter):
+    type = 'char *'
+
+    def render(self, function, data):
+        self.declare(data)
+        self.err_occurred_if_null_pointer("_return_value", data)
+        data.return_conversion.append(
+            'return_value = PyUnicode_DecodeFSDefault(_return_value);\n')
+
+
+class IndentStack:
+    def __init__(self):
+        self.indents = []
+        self.margin = None
+
+    def _ensure(self):
+        if not self.indents:
+            fail('IndentStack expected indents, but none are defined.')
+
+    def measure(self, line):
+        """
+        Returns the length of the line's margin.
+        """
+        if '\t' in line:
+            fail('Tab characters are illegal in the Argument Clinic DSL.')
+        stripped = line.lstrip()
+        if not len(stripped):
+            # we can't tell anything from an empty line
+            # so just pretend it's indented like our current indent
+            self._ensure()
+            return self.indents[-1]
+        return len(line) - len(stripped)
+
+    def infer(self, line):
+        """
+        Infer what is now the current margin based on this line.
+        Returns:
+            1 if we have indented (or this is the first margin)
+            0 if the margin has not changed
+           -N if we have dedented N times
+        """
+        indent = self.measure(line)
+        margin = ' ' * indent
+        if not self.indents:
+            self.indents.append(indent)
+            self.margin = margin
+            return 1
+        current = self.indents[-1]
+        if indent == current:
+            return 0
+        if indent > current:
+            self.indents.append(indent)
+            self.margin = margin
+            return 1
+        # indent < current
+        if indent not in self.indents:
+            fail("Illegal outdent.")
+        outdent_count = 0
+        while indent != current:
+            self.indents.pop()
+            current = self.indents[-1]
+            outdent_count -= 1
+        self.margin = margin
+        return outdent_count
+
+    @property
+    def depth(self):
+        """
+        Returns how many margins are currently defined.
+        """
+        return len(self.indents)
+
+    def indent(self, line):
+        """
+        Indents a line by the currently defined margin.
+        """
+        return self.margin + line
+
+    def dedent(self, line):
+        """
+        Dedents a line by the currently defined margin.
+        (The inverse of 'indent'.)
+        """
+        margin = self.margin
+        indent = self.indents[-1]
+        if not line.startswith(margin):
+            fail('Cannot dedent, line does not start with the previous margin:')
+        return line[indent:]
+
+
+class DSLParser:
+    def __init__(self, clinic):
+        self.clinic = clinic
+
+        self.directives = {}
+        for name in dir(self):
+            # functions that start with directive_ are added to directives
+            _, s, key = name.partition("directive_")
+            if s:
+                self.directives[key] = getattr(self, name)
+
+            # functions that start with at_ are too, with an @ in front
+            _, s, key = name.partition("at_")
+            if s:
+                self.directives['@' + key] = getattr(self, name)
+
+        self.reset()
+
+    def reset(self):
+        self.function = None
+        self.state = self.state_dsl_start
+        self.parameter_indent = None
+        self.keyword_only = False
+        self.group = 0
+        self.parameter_state = self.ps_start
+        self.seen_positional_with_default = False
+        self.indent = IndentStack()
+        self.kind = CALLABLE
+        self.coexist = False
+        self.parameter_continuation = ''
+        self.preserve_output = False
+
+    def directive_version(self, required):
+        global version
+        if version_comparitor(version, required) < 0:
+            fail("Insufficient Clinic version!\n  Version: " + version + "\n  Required: " + required)
+
+    def directive_module(self, name):
+        fields = name.split('.')
+        new = fields.pop()
+        module, cls = self.clinic._module_and_class(fields)
+        if cls:
+            fail("Can't nest a module inside a class!")
+
+        if name in module.classes:
+            fail("Already defined module " + repr(name) + "!")
+
+        m = Module(name, module)
+        module.modules[name] = m
+        self.block.signatures.append(m)
+
+    def directive_class(self, name, typedef, type_object):
+        fields = name.split('.')
+        in_classes = False
+        parent = self
+        name = fields.pop()
+        so_far = []
+        module, cls = self.clinic._module_and_class(fields)
+
+        parent = cls or module
+        if name in parent.classes:
+            fail("Already defined class " + repr(name) + "!")
+
+        c = Class(name, module, cls, typedef, type_object)
+        parent.classes[name] = c
+        self.block.signatures.append(c)
+
+    def directive_set(self, name, value):
+        if name not in ("line_prefix", "line_suffix"):
+            fail("unknown variable", repr(name))
+
+        value = value.format_map({
+            'block comment start': '/*',
+            'block comment end': '*/',
+            })
+
+        self.clinic.__dict__[name] = value
+
+    def directive_destination(self, name, command, *args):
+        if command == 'new':
+            self.clinic.add_destination(name, *args)
+            return
+
+        if command == 'clear':
+            self.clinic.get_destination(name).clear()
+        fail("unknown destination command", repr(command))
+
+
+    def directive_output(self, field, destination=''):
+        fd = self.clinic.field_destinations
+
+        if field == "preset":
+            preset = self.clinic.presets.get(destination)
+            if not preset:
+                fail("Unknown preset " + repr(destination) + "!")
+            fd.update(preset)
+            return
+
+        if field == "push":
+            self.clinic.field_destinations_stack.append(fd.copy())
+            return
+
+        if field == "pop":
+            if not self.clinic.field_destinations_stack:
+                fail("Can't 'output pop', stack is empty!")
+            previous_fd = self.clinic.field_destinations_stack.pop()
+            fd.update(previous_fd)
+            return
+
+        # secret command for debugging!
+        if field == "print":
+            self.block.output.append(pprint.pformat(fd))
+            self.block.output.append('\n')
+            return
+
+        d = self.clinic.get_destination(destination)
+
+        if field == "everything":
+            for name in list(fd):
+                fd[name] = d
+            return
+
+        if field not in fd:
+            fail("Invalid field " + repr(field) + ", must be one of:\n  preset push pop print everything " + " ".join(fd))
+        fd[field] = d
+
+    def directive_dump(self, name):
+        self.block.output.append(self.clinic.get_destination(name).dump())
+
+    def directive_print(self, *args):
+        self.block.output.append(' '.join(args))
+        self.block.output.append('\n')
+
+    def directive_preserve(self):
+        if self.preserve_output:
+            fail("Can't have preserve twice in one block!")
+        self.preserve_output = True
+
+    def at_classmethod(self):
+        if self.kind is not CALLABLE:
+            fail("Can't set @classmethod, function is not a normal callable")
+        self.kind = CLASS_METHOD
+
+    def at_staticmethod(self):
+        if self.kind is not CALLABLE:
+            fail("Can't set @staticmethod, function is not a normal callable")
+        self.kind = STATIC_METHOD
+
+    def at_coexist(self):
+        if self.coexist:
+            fail("Called @coexist twice!")
+        self.coexist = True
+
+    def parse(self, block):
+        self.reset()
+        self.block = block
+        self.saved_output = self.block.output
+        block.output = []
+        block_start = self.clinic.block_parser.line_number
+        lines = block.input.split('\n')
+        for line_number, line in enumerate(lines, self.clinic.block_parser.block_start_line_number):
+            if '\t' in line:
+                fail('Tab characters are illegal in the Clinic DSL.\n\t' + repr(line), line_number=block_start)
+            self.state(line)
+
+        self.next(self.state_terminal)
+        self.state(None)
+
+        block.output.extend(self.clinic.language.render(clinic, block.signatures))
+
+        if self.preserve_output:
+            if block.output:
+                fail("'preserve' only works for blocks that don't produce any output!")
+            block.output = self.saved_output
+
+    @staticmethod
+    def ignore_line(line):
+        # ignore comment-only lines
+        if line.lstrip().startswith('#'):
+            return True
+
+        # Ignore empty lines too
+        # (but not in docstring sections!)
+        if not line.strip():
+            return True
+
+        return False
+
+    @staticmethod
+    def calculate_indent(line):
+        return len(line) - len(line.strip())
+
+    def next(self, state, line=None):
+        # real_print(self.state.__name__, "->", state.__name__, ", line=", line)
+        self.state = state
+        if line is not None:
+            self.state(line)
+
+    def state_dsl_start(self, line):
+        # self.block = self.ClinicOutputBlock(self)
+        if self.ignore_line(line):
+            return
+
+        # is it a directive?
+        fields = shlex.split(line)
+        directive_name = fields[0]
+        directive = self.directives.get(directive_name, None)
+        if directive:
+            try:
+                directive(*fields[1:])
+            except TypeError as e:
+                fail(str(e))
+            return
+
+        self.next(self.state_modulename_name, line)
+
+    def state_modulename_name(self, line):
+        # looking for declaration, which establishes the leftmost column
+        # line should be
+        #     modulename.fnname [as c_basename] [-> return annotation]
+        # square brackets denote optional syntax.
+        #
+        # alternatively:
+        #     modulename.fnname [as c_basename] = modulename.existing_fn_name
+        # clones the parameters and return converter from that
+        # function.  you can't modify them.  you must enter a
+        # new docstring.
+        #
+        # (but we might find a directive first!)
+        #
+        # this line is permitted to start with whitespace.
+        # we'll call this number of spaces F (for "function").
+
+        if not line.strip():
+            return
+
+        self.indent.infer(line)
+
+        # are we cloning?
+        before, equals, existing = line.rpartition('=')
+        if equals:
+            full_name, _, c_basename = before.partition(' as ')
+            full_name = full_name.strip()
+            c_basename = c_basename.strip()
+            existing = existing.strip()
+            if (is_legal_py_identifier(full_name) and
+                (not c_basename or is_legal_c_identifier(c_basename)) and
+                is_legal_py_identifier(existing)):
+                # we're cloning!
+                fields = [x.strip() for x in existing.split('.')]
+                function_name = fields.pop()
+                module, cls = self.clinic._module_and_class(fields)
+
+                for existing_function in (cls or module).functions:
+                    if existing_function.name == function_name:
+                        break
+                else:
+                    existing_function = None
+                if not existing_function:
+                    print("class", cls, "module", module, "existing", existing)
+                    print("cls. functions", cls.functions)
+                    fail("Couldn't find existing function " + repr(existing) + "!")
+
+                fields = [x.strip() for x in full_name.split('.')]
+                function_name = fields.pop()
+                module, cls = self.clinic._module_and_class(fields)
+
+                if not (existing_function.kind == self.kind and existing_function.coexist == self.coexist):
+                    fail("'kind' of function and cloned function don't match!  (@classmethod/@staticmethod/@coexist)")
+                self.function = existing_function.copy(name=function_name, full_name=full_name, module=module, cls=cls, c_basename=c_basename, docstring='')
+
+                self.block.signatures.append(self.function)
+                (cls or module).functions.append(self.function)
+                self.next(self.state_function_docstring)
+                return
+
+        line, _, returns = line.partition('->')
+
+        full_name, _, c_basename = line.partition(' as ')
+        full_name = full_name.strip()
+        c_basename = c_basename.strip() or None
+
+        if not is_legal_py_identifier(full_name):
+            fail("Illegal function name: {}".format(full_name))
+        if c_basename and not is_legal_c_identifier(c_basename):
+            fail("Illegal C basename: {}".format(c_basename))
+
+        return_converter = None
+        if returns:
+            ast_input = "def x() -> {}: pass".format(returns)
+            module = None
+            try:
+                module = ast.parse(ast_input)
+            except SyntaxError:
+                pass
+            if not module:
+                fail("Badly-formed annotation for " + full_name + ": " + returns)
+            try:
+                name, legacy, kwargs = self.parse_converter(module.body[0].returns)
+                if legacy:
+                    fail("Legacy converter {!r} not allowed as a return converter"
+                         .format(name))
+                if name not in return_converters:
+                    fail("No available return converter called " + repr(name))
+                return_converter = return_converters[name](**kwargs)
+            except ValueError:
+                fail("Badly-formed annotation for " + full_name + ": " + returns)
+
+        fields = [x.strip() for x in full_name.split('.')]
+        function_name = fields.pop()
+        module, cls = self.clinic._module_and_class(fields)
+
+        fields = full_name.split('.')
+        if fields[-1] == '__new__':
+            if (self.kind != CLASS_METHOD) or (not cls):
+                fail("__new__ must be a class method!")
+            self.kind = METHOD_NEW
+        elif fields[-1] == '__init__':
+            if (self.kind != CALLABLE) or (not cls):
+                fail("__init__ must be a normal method, not a class or static method!")
+            self.kind = METHOD_INIT
+            if not return_converter:
+                return_converter = init_return_converter()
+        elif fields[-1] in unsupported_special_methods:
+            fail(fields[-1] + " is a special method and cannot be converted to Argument Clinic!  (Yet.)")
+
+        if not return_converter:
+            return_converter = CReturnConverter()
+
+        if not module:
+            fail("Undefined module used in declaration of " + repr(full_name.strip()) + ".")
+        self.function = Function(name=function_name, full_name=full_name, module=module, cls=cls, c_basename=c_basename,
+                                 return_converter=return_converter, kind=self.kind, coexist=self.coexist)
+        self.block.signatures.append(self.function)
+
+        # insert a self converter automatically
+        type, name = correct_name_for_self(self.function)
+        kwargs = {}
+        if cls and type == "PyObject *":
+            kwargs['type'] = cls.typedef
+        sc = self.function.self_converter = self_converter(name, name, self.function, **kwargs)
+        p_self = Parameter(sc.name, inspect.Parameter.POSITIONAL_ONLY, function=self.function, converter=sc)
+        self.function.parameters[sc.name] = p_self
+
+        (cls or module).functions.append(self.function)
+        self.next(self.state_parameters_start)
+
+    # Now entering the parameters section.  The rules, formally stated:
+    #
+    #   * All lines must be indented with spaces only.
+    #   * The first line must be a parameter declaration.
+    #   * The first line must be indented.
+    #       * This first line establishes the indent for parameters.
+    #       * We'll call this number of spaces P (for "parameter").
+    #   * Thenceforth:
+    #       * Lines indented with P spaces specify a parameter.
+    #       * Lines indented with > P spaces are docstrings for the previous
+    #         parameter.
+    #           * We'll call this number of spaces D (for "docstring").
+    #           * All subsequent lines indented with >= D spaces are stored as
+    #             part of the per-parameter docstring.
+    #           * All lines will have the first D spaces of the indent stripped
+    #             before they are stored.
+    #           * It's illegal to have a line starting with a number of spaces X
+    #             such that P < X < D.
+    #       * A line with < P spaces is the first line of the function
+    #         docstring, which ends processing for parameters and per-parameter
+    #         docstrings.
+    #           * The first line of the function docstring must be at the same
+    #             indent as the function declaration.
+    #       * It's illegal to have any line in the parameters section starting
+    #         with X spaces such that F < X < P.  (As before, F is the indent
+    #         of the function declaration.)
+    #
+    # Also, currently Argument Clinic places the following restrictions on groups:
+    #   * Each group must contain at least one parameter.
+    #   * Each group may contain at most one group, which must be the furthest
+    #     thing in the group from the required parameters.  (The nested group
+    #     must be the first in the group when it's before the required
+    #     parameters, and the last thing in the group when after the required
+    #     parameters.)
+    #   * There may be at most one (top-level) group to the left or right of
+    #     the required parameters.
+    #   * You must specify a slash, and it must be after all parameters.
+    #     (In other words: either all parameters are positional-only,
+    #      or none are.)
+    #
+    #  Said another way:
+    #   * Each group must contain at least one parameter.
+    #   * All left square brackets before the required parameters must be
+    #     consecutive.  (You can't have a left square bracket followed
+    #     by a parameter, then another left square bracket.  You can't
+    #     have a left square bracket, a parameter, a right square bracket,
+    #     and then a left square bracket.)
+    #   * All right square brackets after the required parameters must be
+    #     consecutive.
+    #
+    # These rules are enforced with a single state variable:
+    # "parameter_state".  (Previously the code was a miasma of ifs and
+    # separate boolean state variables.)  The states are:
+    #
+    #  [ [ a, b, ] c, ] d, e, f=3, [ g, h, [ i ] ] /   <- line
+    # 01   2          3       4    5           6   7   <- state transitions
+    #
+    # 0: ps_start.  before we've seen anything.  legal transitions are to 1 or 3.
+    # 1: ps_left_square_before.  left square brackets before required parameters.
+    # 2: ps_group_before.  in a group, before required parameters.
+    # 3: ps_required.  required parameters, positional-or-keyword or positional-only
+    #     (we don't know yet).  (renumber left groups!)
+    # 4: ps_optional.  positional-or-keyword or positional-only parameters that
+    #    now must have default values.
+    # 5: ps_group_after.  in a group, after required parameters.
+    # 6: ps_right_square_after.  right square brackets after required parameters.
+    # 7: ps_seen_slash.  seen slash.
+    ps_start, ps_left_square_before, ps_group_before, ps_required, \
+    ps_optional, ps_group_after, ps_right_square_after, ps_seen_slash = range(8)
+
+    def state_parameters_start(self, line):
+        if self.ignore_line(line):
+            return
+
+        # if this line is not indented, we have no parameters
+        if not self.indent.infer(line):
+            return self.next(self.state_function_docstring, line)
+
+        self.parameter_continuation = ''
+        return self.next(self.state_parameter, line)
+
+
+    def to_required(self):
+        """
+        Transition to the "required" parameter state.
+        """
+        if self.parameter_state != self.ps_required:
+            self.parameter_state = self.ps_required
+            for p in self.function.parameters.values():
+                p.group = -p.group
+
+    def state_parameter(self, line):
+        if self.parameter_continuation:
+            line = self.parameter_continuation + ' ' + line.lstrip()
+            self.parameter_continuation = ''
+
+        if self.ignore_line(line):
+            return
+
+        assert self.indent.depth == 2
+        indent = self.indent.infer(line)
+        if indent == -1:
+            # we outdented, must be to definition column
+            return self.next(self.state_function_docstring, line)
+
+        if indent == 1:
+            # we indented, must be to new parameter docstring column
+            return self.next(self.state_parameter_docstring_start, line)
+
+        line = line.rstrip()
+        if line.endswith('\\'):
+            self.parameter_continuation = line[:-1]
+            return
+
+        line = line.lstrip()
+
+        if line in ('*', '/', '[', ']'):
+            self.parse_special_symbol(line)
+            return
+
+        if self.parameter_state in (self.ps_start, self.ps_required):
+            self.to_required()
+        elif self.parameter_state == self.ps_left_square_before:
+            self.parameter_state = self.ps_group_before
+        elif self.parameter_state == self.ps_group_before:
+            if not self.group:
+                self.to_required()
+        elif self.parameter_state in (self.ps_group_after, self.ps_optional):
+            pass
+        else:
+            fail("Function " + self.function.name + " has an unsupported group configuration. (Unexpected state " + str(self.parameter_state) + ".a)")
+
+        # handle "as" for  parameters too
+        c_name = None
+        name, have_as_token, trailing = line.partition(' as ')
+        if have_as_token:
+            name = name.strip()
+            if ' ' not in name:
+                fields = trailing.strip().split(' ')
+                if not fields:
+                    fail("Invalid 'as' clause!")
+                c_name = fields[0]
+                if c_name.endswith(':'):
+                    name += ':'
+                    c_name = c_name[:-1]
+                fields[0] = name
+                line = ' '.join(fields)
+
+        base, equals, default = line.rpartition('=')
+        if not equals:
+            base = default
+            default = None
+
+        module = None
+        try:
+            ast_input = "def x({}): pass".format(base)
+            module = ast.parse(ast_input)
+        except SyntaxError:
+            try:
+                # the last = was probably inside a function call, like
+                #   i: int(nullable=True)
+                # so assume there was no actual default value.
+                default = None
+                ast_input = "def x({}): pass".format(line)
+                module = ast.parse(ast_input)
+            except SyntaxError:
+                pass
+        if not module:
+            fail("Function " + self.function.name + " has an invalid parameter declaration:\n\t" + line)
+
+        function_args = module.body[0].args
+        parameter = function_args.args[0]
+
+        parameter_name = parameter.arg
+        name, legacy, kwargs = self.parse_converter(parameter.annotation)
+
+        if not default:
+            if self.parameter_state == self.ps_optional:
+                fail("Can't have a parameter without a default (" + repr(parameter_name) + ")\nafter a parameter with a default!")
+            value = unspecified
+            if 'py_default' in kwargs:
+                fail("You can't specify py_default without specifying a default value!")
+        else:
+            if self.parameter_state == self.ps_required:
+                self.parameter_state = self.ps_optional
+            default = default.strip()
+            bad = False
+            ast_input = "x = {}".format(default)
+            bad = False
+            try:
+                module = ast.parse(ast_input)
+
+                if 'c_default' not in kwargs:
+                    # we can only represent very simple data values in C.
+                    # detect whether default is okay, via a blacklist
+                    # of disallowed ast nodes.
+                    class DetectBadNodes(ast.NodeVisitor):
+                        bad = False
+                        def bad_node(self, node):
+                            self.bad = True
+
+                        # inline function call
+                        visit_Call = bad_node
+                        # inline if statement ("x = 3 if y else z")
+                        visit_IfExp = bad_node
+
+                        # comprehensions and generator expressions
+                        visit_ListComp = visit_SetComp = bad_node
+                        visit_DictComp = visit_GeneratorExp = bad_node
+
+                        # literals for advanced types
+                        visit_Dict = visit_Set = bad_node
+                        visit_List = visit_Tuple = bad_node
+
+                        # "starred": "a = [1, 2, 3]; *a"
+                        visit_Starred = bad_node
+
+                        # allow ellipsis, for now
+                        # visit_Ellipsis = bad_node
+
+                    blacklist = DetectBadNodes()
+                    blacklist.visit(module)
+                    bad = blacklist.bad
+                else:
+                    # if they specify a c_default, we can be more lenient about the default value.
+                    # but at least make an attempt at ensuring it's a valid expression.
+                    try:
+                        value = eval(default)
+                        if value == unspecified:
+                            fail("'unspecified' is not a legal default value!")
+                    except NameError:
+                        pass # probably a named constant
+                    except Exception as e:
+                        fail("Malformed expression given as default value\n"
+                             "{!r} caused {!r}".format(default, e))
+                if bad:
+                    fail("Unsupported expression as default value: " + repr(default))
+
+                expr = module.body[0].value
+                # mild hack: explicitly support NULL as a default value
+                if isinstance(expr, ast.Name) and expr.id == 'NULL':
+                    value = NULL
+                    py_default = 'None'
+                    c_default = "NULL"
+                elif (isinstance(expr, ast.BinOp) or
+                    (isinstance(expr, ast.UnaryOp) and not isinstance(expr.operand, ast.Num))):
+                    c_default = kwargs.get("c_default")
+                    if not (isinstance(c_default, str) and c_default):
+                        fail("When you specify an expression (" + repr(default) + ") as your default value,\nyou MUST specify a valid c_default.")
+                    py_default = default
+                    value = unknown
+                elif isinstance(expr, ast.Attribute):
+                    a = []
+                    n = expr
+                    while isinstance(n, ast.Attribute):
+                        a.append(n.attr)
+                        n = n.value
+                    if not isinstance(n, ast.Name):
+                        fail("Unsupported default value " + repr(default) + " (looked like a Python constant)")
+                    a.append(n.id)
+                    py_default = ".".join(reversed(a))
+
+                    c_default = kwargs.get("c_default")
+                    if not (isinstance(c_default, str) and c_default):
+                        fail("When you specify a named constant (" + repr(py_default) + ") as your default value,\nyou MUST specify a valid c_default.")
+
+                    try:
+                        value = eval(py_default)
+                    except NameError:
+                        value = unknown
+                else:
+                    value = ast.literal_eval(expr)
+                    py_default = repr(value)
+                    if isinstance(value, (bool, None.__class__)):
+                        c_default = "Py_" + py_default
+                    elif isinstance(value, str):
+                        c_default = c_repr(value)
+                    else:
+                        c_default = py_default
+
+            except SyntaxError as e:
+                fail("Syntax error: " + repr(e.text))
+            except (ValueError, AttributeError):
+                value = unknown
+                c_default = kwargs.get("c_default")
+                py_default = default
+                if not (isinstance(c_default, str) and c_default):
+                    fail("When you specify a named constant (" + repr(py_default) + ") as your default value,\nyou MUST specify a valid c_default.")
+
+            kwargs.setdefault('c_default', c_default)
+            kwargs.setdefault('py_default', py_default)
+
+        dict = legacy_converters if legacy else converters
+        legacy_str = "legacy " if legacy else ""
+        if name not in dict:
+            fail('{} is not a valid {}converter'.format(name, legacy_str))
+        # if you use a c_name for the parameter, we just give that name to the converter
+        # but the parameter object gets the python name
+        converter = dict[name](c_name or parameter_name, parameter_name, self.function, value, **kwargs)
+
+        kind = inspect.Parameter.KEYWORD_ONLY if self.keyword_only else inspect.Parameter.POSITIONAL_OR_KEYWORD
+
+        if isinstance(converter, self_converter):
+            if len(self.function.parameters) == 1:
+                if (self.parameter_state != self.ps_required):
+                    fail("A 'self' parameter cannot be marked optional.")
+                if value is not unspecified:
+                    fail("A 'self' parameter cannot have a default value.")
+                if self.group:
+                    fail("A 'self' parameter cannot be in an optional group.")
+                kind = inspect.Parameter.POSITIONAL_ONLY
+                self.parameter_state = self.ps_start
+                self.function.parameters.clear()
+            else:
+                fail("A 'self' parameter, if specified, must be the very first thing in the parameter block.")
+
+        p = Parameter(parameter_name, kind, function=self.function, converter=converter, default=value, group=self.group)
+
+        if parameter_name in self.function.parameters:
+            fail("You can't have two parameters named " + repr(parameter_name) + "!")
+        self.function.parameters[parameter_name] = p
+
+    def parse_converter(self, annotation):
+        if isinstance(annotation, ast.Str):
+            return annotation.s, True, {}
+
+        if isinstance(annotation, ast.Name):
+            return annotation.id, False, {}
+
+        if not isinstance(annotation, ast.Call):
+            fail("Annotations must be either a name, a function call, or a string.")
+
+        name = annotation.func.id
+        kwargs = {node.arg: ast.literal_eval(node.value) for node in annotation.keywords}
+        return name, False, kwargs
+
+    def parse_special_symbol(self, symbol):
+        if self.parameter_state == self.ps_seen_slash:
+            fail("Function " + self.function.name + " specifies " + symbol + " after /, which is unsupported.")
+
+        if symbol == '*':
+            if self.keyword_only:
+                fail("Function " + self.function.name + " uses '*' more than once.")
+            self.keyword_only = True
+        elif symbol == '[':
+            if self.parameter_state in (self.ps_start, self.ps_left_square_before):
+                self.parameter_state = self.ps_left_square_before
+            elif self.parameter_state in (self.ps_required, self.ps_group_after):
+                self.parameter_state = self.ps_group_after
+            else:
+                fail("Function " + self.function.name + " has an unsupported group configuration. (Unexpected state " + str(self.parameter_state) + ".b)")
+            self.group += 1
+            self.function.docstring_only = True
+        elif symbol == ']':
+            if not self.group:
+                fail("Function " + self.function.name + " has a ] without a matching [.")
+            if not any(p.group == self.group for p in self.function.parameters.values()):
+                fail("Function " + self.function.name + " has an empty group.\nAll groups must contain at least one parameter.")
+            self.group -= 1
+            if self.parameter_state in (self.ps_left_square_before, self.ps_group_before):
+                self.parameter_state = self.ps_group_before
+            elif self.parameter_state in (self.ps_group_after, self.ps_right_square_after):
+                self.parameter_state = self.ps_right_square_after
+            else:
+                fail("Function " + self.function.name + " has an unsupported group configuration. (Unexpected state " + str(self.parameter_state) + ".c)")
+        elif symbol == '/':
+            # ps_required and ps_optional are allowed here, that allows positional-only without option groups
+            # to work (and have default values!)
+            if (self.parameter_state not in (self.ps_required, self.ps_optional, self.ps_right_square_after, self.ps_group_before)) or self.group:
+                fail("Function " + self.function.name + " has an unsupported group configuration. (Unexpected state " + str(self.parameter_state) + ".d)")
+            if self.keyword_only:
+                fail("Function " + self.function.name + " mixes keyword-only and positional-only parameters, which is unsupported.")
+            self.parameter_state = self.ps_seen_slash
+            # fixup preceding parameters
+            for p in self.function.parameters.values():
+                if (p.kind != inspect.Parameter.POSITIONAL_OR_KEYWORD and not isinstance(p.converter, self_converter)):
+                    fail("Function " + self.function.name + " mixes keyword-only and positional-only parameters, which is unsupported.")
+                p.kind = inspect.Parameter.POSITIONAL_ONLY
+
+    def state_parameter_docstring_start(self, line):
+        self.parameter_docstring_indent = len(self.indent.margin)
+        assert self.indent.depth == 3
+        return self.next(self.state_parameter_docstring, line)
+
+    # every line of the docstring must start with at least F spaces,
+    # where F > P.
+    # these F spaces will be stripped.
+    def state_parameter_docstring(self, line):
+        stripped = line.strip()
+        if stripped.startswith('#'):
+            return
+
+        indent = self.indent.measure(line)
+        if indent < self.parameter_docstring_indent:
+            self.indent.infer(line)
+            assert self.indent.depth < 3
+            if self.indent.depth == 2:
+                # back to a parameter
+                return self.next(self.state_parameter, line)
+            assert self.indent.depth == 1
+            return self.next(self.state_function_docstring, line)
+
+        assert self.function.parameters
+        last_parameter = next(reversed(list(self.function.parameters.values())))
+
+        new_docstring = last_parameter.docstring
+
+        if new_docstring:
+            new_docstring += '\n'
+        if stripped:
+            new_docstring += self.indent.dedent(line)
+
+        last_parameter.docstring = new_docstring
+
+    # the final stanza of the DSL is the docstring.
+    def state_function_docstring(self, line):
+        if self.group:
+            fail("Function " + self.function.name + " has a ] without a matching [.")
+
+        stripped = line.strip()
+        if stripped.startswith('#'):
+            return
+
+        new_docstring = self.function.docstring
+        if new_docstring:
+            new_docstring += "\n"
+        if stripped:
+            line = self.indent.dedent(line).rstrip()
+        else:
+            line = ''
+        new_docstring += line
+        self.function.docstring = new_docstring
+
+    def format_docstring(self):
+        f = self.function
+
+        new_or_init = f.kind in (METHOD_NEW, METHOD_INIT)
+        if new_or_init and not f.docstring:
+            # don't render a docstring at all, no signature, nothing.
+            return f.docstring
+
+        text, add, output = _text_accumulator()
+        parameters = f.render_parameters
+
+        ##
+        ## docstring first line
+        ##
+
+        if new_or_init:
+            # classes get *just* the name of the class
+            # not __new__, not __init__, and not module.classname
+            assert f.cls
+            add(f.cls.name)
+        else:
+            add(f.name)
+        add('(')
+
+        # populate "right_bracket_count" field for every parameter
+        assert parameters, "We should always have a self parameter. " + repr(f)
+        assert isinstance(parameters[0].converter, self_converter)
+        parameters[0].right_bracket_count = 0
+        parameters_after_self = parameters[1:]
+        if parameters_after_self:
+            # for now, the only way Clinic supports positional-only parameters
+            # is if all of them are positional-only...
+            #
+            # ... except for self!  self is always positional-only.
+
+            positional_only_parameters = [p.kind == inspect.Parameter.POSITIONAL_ONLY for p in parameters_after_self]
+            if parameters_after_self[0].kind == inspect.Parameter.POSITIONAL_ONLY:
+                assert all(positional_only_parameters)
+                for p in parameters:
+                    p.right_bracket_count = abs(p.group)
+            else:
+                # don't put any right brackets around non-positional-only parameters, ever.
+                for p in parameters_after_self:
+                    p.right_bracket_count = 0
+
+        right_bracket_count = 0
+
+        def fix_right_bracket_count(desired):
+            nonlocal right_bracket_count
+            s = ''
+            while right_bracket_count < desired:
+                s += '['
+                right_bracket_count += 1
+            while right_bracket_count > desired:
+                s += ']'
+                right_bracket_count -= 1
+            return s
+
+        need_slash = False
+        added_slash = False
+        need_a_trailing_slash = False
+
+        # we only need a trailing slash:
+        #   * if this is not a "docstring_only" signature
+        #   * and if the last *shown* parameter is
+        #     positional only
+        if not f.docstring_only:
+            for p in reversed(parameters):
+                if not p.converter.show_in_signature:
+                    continue
+                if p.is_positional_only():
+                    need_a_trailing_slash = True
+                break
+
+
+        added_star = False
+
+        first_parameter = True
+        last_p = parameters[-1]
+        line_length = len(''.join(text))
+        indent = " " * line_length
+        def add_parameter(text):
+            nonlocal line_length
+            nonlocal first_parameter
+            if first_parameter:
+                s = text
+                first_parameter = False
+            else:
+                s = ' ' + text
+                if line_length + len(s) >= 72:
+                    add('\n')
+                    add(indent)
+                    line_length = len(indent)
+                    s = text
+            line_length += len(s)
+            add(s)
+
+        for p in parameters:
+            if not p.converter.show_in_signature:
+                continue
+            assert p.name
+
+            is_self = isinstance(p.converter, self_converter)
+            if is_self and f.docstring_only:
+                # this isn't a real machine-parsable signature,
+                # so let's not print the "self" parameter
+                continue
+
+            if p.is_positional_only():
+                need_slash = not f.docstring_only
+            elif need_slash and not (added_slash or p.is_positional_only()):
+                added_slash = True
+                add_parameter('/,')
+
+            if p.is_keyword_only() and not added_star:
+                added_star = True
+                add_parameter('*,')
+
+            p_add, p_output = text_accumulator()
+            p_add(fix_right_bracket_count(p.right_bracket_count))
+
+            if isinstance(p.converter, self_converter):
+                # annotate first parameter as being a "self".
+                #
+                # if inspect.Signature gets this function,
+                # and it's already bound, the self parameter
+                # will be stripped off.
+                #
+                # if it's not bound, it should be marked
+                # as positional-only.
+                #
+                # note: we don't print "self" for __init__,
+                # because this isn't actually the signature
+                # for __init__.  (it can't be, __init__ doesn't
+                # have a docstring.)  if this is an __init__
+                # (or __new__), then this signature is for
+                # calling the class to construct a new instance.
+                p_add('$')
+
+            name = p.converter.signature_name or p.name
+            p_add(name)
+
+            if p.converter.is_optional():
+                p_add('=')
+                value = p.converter.py_default
+                if not value:
+                    value = repr(p.converter.default)
+                p_add(value)
+
+            if (p != last_p) or need_a_trailing_slash:
+                p_add(',')
+
+            add_parameter(p_output())
+
+        add(fix_right_bracket_count(0))
+        if need_a_trailing_slash:
+            add_parameter('/')
+        add(')')
+
+        # PEP 8 says:
+        #
+        #     The Python standard library will not use function annotations
+        #     as that would result in a premature commitment to a particular
+        #     annotation style. Instead, the annotations are left for users
+        #     to discover and experiment with useful annotation styles.
+        #
+        # therefore this is commented out:
+        #
+        # if f.return_converter.py_default:
+        #     add(' -> ')
+        #     add(f.return_converter.py_default)
+
+        if not f.docstring_only:
+            add("\n--\n")
+
+        docstring_first_line = output()
+
+        # now fix up the places where the brackets look wrong
+        docstring_first_line = docstring_first_line.replace(', ]', ',] ')
+
+        # okay.  now we're officially building the "parameters" section.
+        # create substitution text for {parameters}
+        spacer_line = False
+        for p in parameters:
+            if not p.docstring.strip():
+                continue
+            if spacer_line:
+                add('\n')
+            else:
+                spacer_line = True
+            add("  ")
+            add(p.name)
+            add('\n')
+            add(textwrap.indent(rstrip_lines(p.docstring.rstrip()), "    "))
+        parameters = output()
+        if parameters:
+            parameters += '\n'
+
+        ##
+        ## docstring body
+        ##
+
+        docstring = f.docstring.rstrip()
+        lines = [line.rstrip() for line in docstring.split('\n')]
+
+        # Enforce the summary line!
+        # The first line of a docstring should be a summary of the function.
+        # It should fit on one line (80 columns? 79 maybe?) and be a paragraph
+        # by itself.
+        #
+        # Argument Clinic enforces the following rule:
+        #  * either the docstring is empty,
+        #  * or it must have a summary line.
+        #
+        # Guido said Clinic should enforce this:
+        # http://mail.python.org/pipermail/python-dev/2013-June/127110.html
+
+        if len(lines) >= 2:
+            if lines[1]:
+                fail("Docstring for " + f.full_name + " does not have a summary line!\n" +
+                    "Every non-blank function docstring must start with\n" +
+                    "a single line summary followed by an empty line.")
+        elif len(lines) == 1:
+            # the docstring is only one line right now--the summary line.
+            # add an empty line after the summary line so we have space
+            # between it and the {parameters} we're about to add.
+            lines.append('')
+
+        parameters_marker_count = len(docstring.split('{parameters}')) - 1
+        if parameters_marker_count > 1:
+            fail('You may not specify {parameters} more than once in a docstring!')
+
+        if not parameters_marker_count:
+            # insert after summary line
+            lines.insert(2, '{parameters}')
+
+        # insert at front of docstring
+        lines.insert(0, docstring_first_line)
+
+        docstring = "\n".join(lines)
+
+        add(docstring)
+        docstring = output()
+
+        docstring = linear_format(docstring, parameters=parameters)
+        docstring = docstring.rstrip()
+
+        return docstring
+
+    def state_terminal(self, line):
+        """
+        Called when processing the block is done.
+        """
+        assert not line
+
+        if not self.function:
+            return
+
+        if self.keyword_only:
+            values = self.function.parameters.values()
+            if not values:
+                no_parameter_after_star = True
+            else:
+                last_parameter = next(reversed(list(values)))
+                no_parameter_after_star = last_parameter.kind != inspect.Parameter.KEYWORD_ONLY
+            if no_parameter_after_star:
+                fail("Function " + self.function.name + " specifies '*' without any parameters afterwards.")
+
+        # remove trailing whitespace from all parameter docstrings
+        for name, value in self.function.parameters.items():
+            if not value:
+                continue
+            value.docstring = value.docstring.rstrip()
+
+        self.function.docstring = self.format_docstring()
+
+
+
+
+# maps strings to callables.
+# the callable should return an object
+# that implements the clinic parser
+# interface (__init__ and parse).
+#
+# example parsers:
+#   "clinic", handles the Clinic DSL
+#   "python", handles running Python code
+#
+parsers = {'clinic' : DSLParser, 'python': PythonParser}
+
+
+clinic = None
+
+
+def main(argv):
+    import sys
+
+    if sys.version_info.major < 3 or sys.version_info.minor < 3:
+        sys.exit("Error: clinic.py requires Python 3.3 or greater.")
+
+    import argparse
+    cmdline = argparse.ArgumentParser()
+    cmdline.add_argument("-f", "--force", action='store_true')
+    cmdline.add_argument("-o", "--output", type=str)
+    cmdline.add_argument("-v", "--verbose", action='store_true')
+    cmdline.add_argument("--converters", action='store_true')
+    cmdline.add_argument("--make", action='store_true')
+    cmdline.add_argument("filename", type=str, nargs="*")
+    ns = cmdline.parse_args(argv)
+
+    if ns.converters:
+        if ns.filename:
+            print("Usage error: can't specify --converters and a filename at the same time.")
+            print()
+            cmdline.print_usage()
+            sys.exit(-1)
+        converters = []
+        return_converters = []
+        ignored = set("""
+            add_c_converter
+            add_c_return_converter
+            add_default_legacy_c_converter
+            add_legacy_c_converter
+            """.strip().split())
+        module = globals()
+        for name in module:
+            for suffix, ids in (
+                ("_return_converter", return_converters),
+                ("_converter", converters),
+            ):
+                if name in ignored:
+                    continue
+                if name.endswith(suffix):
+                    ids.append((name, name[:-len(suffix)]))
+                    break
+        print()
+
+        print("Legacy converters:")
+        legacy = sorted(legacy_converters)
+        print('    ' + ' '.join(c for c in legacy if c[0].isupper()))
+        print('    ' + ' '.join(c for c in legacy if c[0].islower()))
+        print()
+
+        for title, attribute, ids in (
+            ("Converters", 'converter_init', converters),
+            ("Return converters", 'return_converter_init', return_converters),
+        ):
+            print(title + ":")
+            longest = -1
+            for name, short_name in ids:
+                longest = max(longest, len(short_name))
+            for name, short_name in sorted(ids, key=lambda x: x[1].lower()):
+                cls = module[name]
+                callable = getattr(cls, attribute, None)
+                if not callable:
+                    continue
+                signature = inspect.signature(callable)
+                parameters = []
+                for parameter_name, parameter in signature.parameters.items():
+                    if parameter.kind == inspect.Parameter.KEYWORD_ONLY:
+                        if parameter.default != inspect.Parameter.empty:
+                            s = '{}={!r}'.format(parameter_name, parameter.default)
+                        else:
+                            s = parameter_name
+                        parameters.append(s)
+                print('    {}({})'.format(short_name, ', '.join(parameters)))
+            print()
+        print("All converters also accept (c_default=None, py_default=None, annotation=None).")
+        print("All return converters also accept (py_default=None).")
+        sys.exit(0)
+
+    if ns.make:
+        if ns.output or ns.filename:
+            print("Usage error: can't use -o or filenames with --make.")
+            print()
+            cmdline.print_usage()
+            sys.exit(-1)
+        for root, dirs, files in os.walk('.'):
+            for rcs_dir in ('.svn', '.git', '.hg', 'build'):
+                if rcs_dir in dirs:
+                    dirs.remove(rcs_dir)
+            for filename in files:
+                if not (filename.endswith('.c') or filename.endswith('.h')):
+                    continue
+                path = os.path.join(root, filename)
+                if ns.verbose:
+                    print(path)
+                parse_file(path, force=ns.force, verify=not ns.force)
+        return
+
+    if not ns.filename:
+        cmdline.print_usage()
+        sys.exit(-1)
+
+    if ns.output and len(ns.filename) > 1:
+        print("Usage error: can't use -o with multiple filenames.")
+        print()
+        cmdline.print_usage()
+        sys.exit(-1)
+
+    for filename in ns.filename:
+        if ns.verbose:
+            print(filename)
+        parse_file(filename, output=ns.output, force=ns.force, verify=not ns.force)
+
+
+if __name__ == "__main__":
+    sys.exit(main(sys.argv[1:]))
diff --git a/Tools/clinic/clinic_test.py b/Tools/clinic/clinic_test.py
new file mode 100644
index 0000000..cd21000
--- /dev/null
+++ b/Tools/clinic/clinic_test.py
@@ -0,0 +1,801 @@
+# Argument Clinic
+# Copyright 2012-2013 by Larry Hastings.
+# Licensed to the PSF under a contributor agreement.
+#
+
+import builtins
+import clinic
+from clinic import DSLParser
+import collections
+import inspect
+from test import support
+import sys
+import unittest
+from unittest import TestCase
+
+
+class FakeConverter:
+    def __init__(self, name, args):
+        self.name = name
+        self.args = args
+
+
+class FakeConverterFactory:
+    def __init__(self, name):
+        self.name = name
+
+    def __call__(self, name, default, **kwargs):
+        return FakeConverter(self.name, kwargs)
+
+
+class FakeConvertersDict:
+    def __init__(self):
+        self.used_converters = {}
+
+    def get(self, name, default):
+        return self.used_converters.setdefault(name, FakeConverterFactory(name))
+
+clinic.Clinic.presets_text = ''
+c = clinic.Clinic(language='C')
+
+class FakeClinic:
+    def __init__(self):
+        self.converters = FakeConvertersDict()
+        self.legacy_converters = FakeConvertersDict()
+        self.language = clinic.CLanguage(None)
+        self.filename = None
+        self.block_parser = clinic.BlockParser('', self.language)
+        self.modules = collections.OrderedDict()
+        self.classes = collections.OrderedDict()
+        clinic.clinic = self
+        self.name = "FakeClinic"
+        self.line_prefix = self.line_suffix = ''
+        self.destinations = {}
+        self.add_destination("block", "buffer")
+        self.add_destination("file", "buffer")
+        self.add_destination("suppress", "suppress")
+        d = self.destinations.get
+        self.field_destinations = collections.OrderedDict((
+            ('docstring_prototype', d('suppress')),
+            ('docstring_definition', d('block')),
+            ('methoddef_define', d('block')),
+            ('impl_prototype', d('block')),
+            ('parser_prototype', d('suppress')),
+            ('parser_definition', d('block')),
+            ('impl_definition', d('block')),
+        ))
+
+    def get_destination(self, name):
+        d = self.destinations.get(name)
+        if not d:
+            sys.exit("Destination does not exist: " + repr(name))
+        return d
+
+    def add_destination(self, name, type, *args):
+        if name in self.destinations:
+            sys.exit("Destination already exists: " + repr(name))
+        self.destinations[name] = clinic.Destination(name, type, self, *args)
+
+    def is_directive(self, name):
+        return name == "module"
+
+    def directive(self, name, args):
+        self.called_directives[name] = args
+
+    _module_and_class = clinic.Clinic._module_and_class
+
+class ClinicWholeFileTest(TestCase):
+    def test_eol(self):
+        # regression test:
+        # clinic's block parser didn't recognize
+        # the "end line" for the block if it
+        # didn't end in "\n" (as in, the last)
+        # byte of the file was '/'.
+        # so it woudl spit out an end line for you.
+        # and since you really already had one,
+        # the last line of the block got corrupted.
+        c = clinic.Clinic(clinic.CLanguage(None))
+        raw = "/*[clinic]\nfoo\n[clinic]*/"
+        cooked = c.parse(raw).splitlines()
+        end_line = cooked[2].rstrip()
+        # this test is redundant, it's just here explicitly to catch
+        # the regression test so we don't forget what it looked like
+        self.assertNotEqual(end_line, "[clinic]*/[clinic]*/")
+        self.assertEqual(end_line, "[clinic]*/")
+
+
+
+class ClinicGroupPermuterTest(TestCase):
+    def _test(self, l, m, r, output):
+        computed = clinic.permute_optional_groups(l, m, r)
+        self.assertEqual(output, computed)
+
+    def test_range(self):
+        self._test([['start']], ['stop'], [['step']],
+          (
+            ('stop',),
+            ('start', 'stop',),
+            ('start', 'stop', 'step',),
+          ))
+
+    def test_add_window(self):
+        self._test([['x', 'y']], ['ch'], [['attr']],
+          (
+            ('ch',),
+            ('ch', 'attr'),
+            ('x', 'y', 'ch',),
+            ('x', 'y', 'ch', 'attr'),
+          ))
+
+    def test_ludicrous(self):
+        self._test([['a1', 'a2', 'a3'], ['b1', 'b2']], ['c1'], [['d1', 'd2'], ['e1', 'e2', 'e3']],
+          (
+          ('c1',),
+          ('b1', 'b2', 'c1'),
+          ('b1', 'b2', 'c1', 'd1', 'd2'),
+          ('a1', 'a2', 'a3', 'b1', 'b2', 'c1'),
+          ('a1', 'a2', 'a3', 'b1', 'b2', 'c1', 'd1', 'd2'),
+          ('a1', 'a2', 'a3', 'b1', 'b2', 'c1', 'd1', 'd2', 'e1', 'e2', 'e3'),
+          ))
+
+    def test_right_only(self):
+        self._test([], [], [['a'],['b'],['c']],
+          (
+          (),
+          ('a',),
+          ('a', 'b'),
+          ('a', 'b', 'c')
+          ))
+
+    def test_have_left_options_but_required_is_empty(self):
+        def fn():
+            clinic.permute_optional_groups(['a'], [], [])
+        self.assertRaises(AssertionError, fn)
+
+
+class ClinicLinearFormatTest(TestCase):
+    def _test(self, input, output, **kwargs):
+        computed = clinic.linear_format(input, **kwargs)
+        self.assertEqual(output, computed)
+
+    def test_empty_strings(self):
+        self._test('', '')
+
+    def test_solo_newline(self):
+        self._test('\n', '\n')
+
+    def test_no_substitution(self):
+        self._test("""
+          abc
+          """, """
+          abc
+          """)
+
+    def test_empty_substitution(self):
+        self._test("""
+          abc
+          {name}
+          def
+          """, """
+          abc
+          def
+          """, name='')
+
+    def test_single_line_substitution(self):
+        self._test("""
+          abc
+          {name}
+          def
+          """, """
+          abc
+          GARGLE
+          def
+          """, name='GARGLE')
+
+    def test_multiline_substitution(self):
+        self._test("""
+          abc
+          {name}
+          def
+          """, """
+          abc
+          bingle
+          bungle
+
+          def
+          """, name='bingle\nbungle\n')
+
+class InertParser:
+    def __init__(self, clinic):
+        pass
+
+    def parse(self, block):
+        pass
+
+class CopyParser:
+    def __init__(self, clinic):
+        pass
+
+    def parse(self, block):
+        block.output = block.input
+
+
+class ClinicBlockParserTest(TestCase):
+    def _test(self, input, output):
+        language = clinic.CLanguage(None)
+
+        blocks = list(clinic.BlockParser(input, language))
+        writer = clinic.BlockPrinter(language)
+        for block in blocks:
+            writer.print_block(block)
+        output = writer.f.getvalue()
+        assert output == input, "output != input!\n\noutput " + repr(output) + "\n\n input " + repr(input)
+
+    def round_trip(self, input):
+        return self._test(input, input)
+
+    def test_round_trip_1(self):
+        self.round_trip("""
+    verbatim text here
+    lah dee dah
+""")
+    def test_round_trip_2(self):
+        self.round_trip("""
+    verbatim text here
+    lah dee dah
+/*[inert]
+abc
+[inert]*/
+def
+/*[inert checksum: 7b18d017f89f61cf17d47f92749ea6930a3f1deb]*/
+xyz
+""")
+
+    def _test_clinic(self, input, output):
+        language = clinic.CLanguage(None)
+        c = clinic.Clinic(language)
+        c.parsers['inert'] = InertParser(c)
+        c.parsers['copy'] = CopyParser(c)
+        computed = c.parse(input)
+        self.assertEqual(output, computed)
+
+    def test_clinic_1(self):
+        self._test_clinic("""
+    verbatim text here
+    lah dee dah
+/*[copy input]
+def
+[copy start generated code]*/
+abc
+/*[copy end generated code: output=03cfd743661f0797 input=7b18d017f89f61cf]*/
+xyz
+""", """
+    verbatim text here
+    lah dee dah
+/*[copy input]
+def
+[copy start generated code]*/
+def
+/*[copy end generated code: output=7b18d017f89f61cf input=7b18d017f89f61cf]*/
+xyz
+""")
+
+
+class ClinicParserTest(TestCase):
+    def test_trivial(self):
+        parser = DSLParser(FakeClinic())
+        block = clinic.Block("module os\nos.access")
+        parser.parse(block)
+        module, function = block.signatures
+        self.assertEqual("access", function.name)
+        self.assertEqual("os", module.name)
+
+    def test_ignore_line(self):
+        block = self.parse("#\nmodule os\nos.access")
+        module, function = block.signatures
+        self.assertEqual("access", function.name)
+        self.assertEqual("os", module.name)
+
+    def test_param(self):
+        function = self.parse_function("module os\nos.access\n   path: int")
+        self.assertEqual("access", function.name)
+        self.assertEqual(2, len(function.parameters))
+        p = function.parameters['path']
+        self.assertEqual('path', p.name)
+        self.assertIsInstance(p.converter, clinic.int_converter)
+
+    def test_param_default(self):
+        function = self.parse_function("module os\nos.access\n    follow_symlinks: bool = True")
+        p = function.parameters['follow_symlinks']
+        self.assertEqual(True, p.default)
+
+    def test_param_with_continuations(self):
+        function = self.parse_function("module os\nos.access\n    follow_symlinks: \\\n   bool \\\n   =\\\n    True")
+        p = function.parameters['follow_symlinks']
+        self.assertEqual(True, p.default)
+
+    def test_param_default_expression(self):
+        function = self.parse_function("module os\nos.access\n    follow_symlinks: int(c_default='MAXSIZE') = sys.maxsize")
+        p = function.parameters['follow_symlinks']
+        self.assertEqual(sys.maxsize, p.default)
+        self.assertEqual("MAXSIZE", p.converter.c_default)
+
+        s = self.parse_function_should_fail("module os\nos.access\n    follow_symlinks: int = sys.maxsize")
+        self.assertEqual(s, "Error on line 0:\nWhen you specify a named constant ('sys.maxsize') as your default value,\nyou MUST specify a valid c_default.\n")
+
+    def test_param_no_docstring(self):
+        function = self.parse_function("""
+module os
+os.access
+    follow_symlinks: bool = True
+    something_else: str = ''""")
+        p = function.parameters['follow_symlinks']
+        self.assertEqual(3, len(function.parameters))
+        self.assertIsInstance(function.parameters['something_else'].converter, clinic.str_converter)
+
+    def test_param_default_parameters_out_of_order(self):
+        s = self.parse_function_should_fail("""
+module os
+os.access
+    follow_symlinks: bool = True
+    something_else: str""")
+        self.assertEqual(s, """Error on line 0:
+Can't have a parameter without a default ('something_else')
+after a parameter with a default!
+""")
+
+    def disabled_test_converter_arguments(self):
+        function = self.parse_function("module os\nos.access\n    path: path_t(allow_fd=1)")
+        p = function.parameters['path']
+        self.assertEqual(1, p.converter.args['allow_fd'])
+
+    def test_function_docstring(self):
+        function = self.parse_function("""
+module os
+os.stat as os_stat_fn
+
+   path: str
+       Path to be examined
+
+Perform a stat system call on the given path.""")
+        self.assertEqual("""
+stat($module, /, path)
+--
+
+Perform a stat system call on the given path.
+
+  path
+    Path to be examined
+""".strip(), function.docstring)
+
+    def test_explicit_parameters_in_docstring(self):
+        function = self.parse_function("""
+module foo
+foo.bar
+  x: int
+     Documentation for x.
+  y: int
+
+This is the documentation for foo.
+
+Okay, we're done here.
+""")
+        self.assertEqual("""
+bar($module, /, x, y)
+--
+
+This is the documentation for foo.
+
+  x
+    Documentation for x.
+
+Okay, we're done here.
+""".strip(), function.docstring)
+
+    def test_parser_regression_special_character_in_parameter_column_of_docstring_first_line(self):
+        function = self.parse_function("""
+module os
+os.stat
+    path: str
+This/used to break Clinic!
+""")
+        self.assertEqual("stat($module, /, path)\n--\n\nThis/used to break Clinic!", function.docstring)
+
+    def test_c_name(self):
+        function = self.parse_function("module os\nos.stat as os_stat_fn")
+        self.assertEqual("os_stat_fn", function.c_basename)
+
+    def test_return_converter(self):
+        function = self.parse_function("module os\nos.stat -> int")
+        self.assertIsInstance(function.return_converter, clinic.int_return_converter)
+
+    def test_star(self):
+        function = self.parse_function("module os\nos.access\n    *\n    follow_symlinks: bool = True")
+        p = function.parameters['follow_symlinks']
+        self.assertEqual(inspect.Parameter.KEYWORD_ONLY, p.kind)
+        self.assertEqual(0, p.group)
+
+    def test_group(self):
+        function = self.parse_function("module window\nwindow.border\n [\n ls : int\n ]\n /\n")
+        p = function.parameters['ls']
+        self.assertEqual(1, p.group)
+
+    def test_left_group(self):
+        function = self.parse_function("""
+module curses
+curses.addch
+   [
+   y: int
+     Y-coordinate.
+   x: int
+     X-coordinate.
+   ]
+   ch: char
+     Character to add.
+   [
+   attr: long
+     Attributes for the character.
+   ]
+   /
+""")
+        for name, group in (
+            ('y', -1), ('x', -1),
+            ('ch', 0),
+            ('attr', 1),
+            ):
+            p = function.parameters[name]
+            self.assertEqual(p.group, group)
+            self.assertEqual(p.kind, inspect.Parameter.POSITIONAL_ONLY)
+        self.assertEqual(function.docstring.strip(), """
+addch([y, x,] ch, [attr])
+
+
+  y
+    Y-coordinate.
+  x
+    X-coordinate.
+  ch
+    Character to add.
+  attr
+    Attributes for the character.
+            """.strip())
+
+    def test_nested_groups(self):
+        function = self.parse_function("""
+module curses
+curses.imaginary
+   [
+   [
+   y1: int
+     Y-coordinate.
+   y2: int
+     Y-coordinate.
+   ]
+   x1: int
+     X-coordinate.
+   x2: int
+     X-coordinate.
+   ]
+   ch: char
+     Character to add.
+   [
+   attr1: long
+     Attributes for the character.
+   attr2: long
+     Attributes for the character.
+   attr3: long
+     Attributes for the character.
+   [
+   attr4: long
+     Attributes for the character.
+   attr5: long
+     Attributes for the character.
+   attr6: long
+     Attributes for the character.
+   ]
+   ]
+   /
+""")
+        for name, group in (
+            ('y1', -2), ('y2', -2),
+            ('x1', -1), ('x2', -1),
+            ('ch', 0),
+            ('attr1', 1), ('attr2', 1), ('attr3', 1),
+            ('attr4', 2), ('attr5', 2), ('attr6', 2),
+            ):
+            p = function.parameters[name]
+            self.assertEqual(p.group, group)
+            self.assertEqual(p.kind, inspect.Parameter.POSITIONAL_ONLY)
+
+        self.assertEqual(function.docstring.strip(), """
+imaginary([[y1, y2,] x1, x2,] ch, [attr1, attr2, attr3, [attr4, attr5,
+          attr6]])
+
+
+  y1
+    Y-coordinate.
+  y2
+    Y-coordinate.
+  x1
+    X-coordinate.
+  x2
+    X-coordinate.
+  ch
+    Character to add.
+  attr1
+    Attributes for the character.
+  attr2
+    Attributes for the character.
+  attr3
+    Attributes for the character.
+  attr4
+    Attributes for the character.
+  attr5
+    Attributes for the character.
+  attr6
+    Attributes for the character.
+                """.strip())
+
+    def parse_function_should_fail(self, s):
+        with support.captured_stdout() as stdout:
+            with self.assertRaises(SystemExit):
+                self.parse_function(s)
+        return stdout.getvalue()
+
+    def test_disallowed_grouping__two_top_groups_on_left(self):
+        s = self.parse_function_should_fail("""
+module foo
+foo.two_top_groups_on_left
+    [
+    group1 : int
+    ]
+    [
+    group2 : int
+    ]
+    param: int
+            """)
+        self.assertEqual(s,
+            ('Error on line 0:\n'
+            'Function two_top_groups_on_left has an unsupported group configuration. (Unexpected state 2.b)\n'))
+
+    def test_disallowed_grouping__two_top_groups_on_right(self):
+        self.parse_function_should_fail("""
+module foo
+foo.two_top_groups_on_right
+    param: int
+    [
+    group1 : int
+    ]
+    [
+    group2 : int
+    ]
+            """)
+
+    def test_disallowed_grouping__parameter_after_group_on_right(self):
+        self.parse_function_should_fail("""
+module foo
+foo.parameter_after_group_on_right
+    param: int
+    [
+    [
+    group1 : int
+    ]
+    group2 : int
+    ]
+            """)
+
+    def test_disallowed_grouping__group_after_parameter_on_left(self):
+        self.parse_function_should_fail("""
+module foo
+foo.group_after_parameter_on_left
+    [
+    group2 : int
+    [
+    group1 : int
+    ]
+    ]
+    param: int
+            """)
+
+    def test_disallowed_grouping__empty_group_on_left(self):
+        self.parse_function_should_fail("""
+module foo
+foo.empty_group
+    [
+    [
+    ]
+    group2 : int
+    ]
+    param: int
+            """)
+
+    def test_disallowed_grouping__empty_group_on_right(self):
+        self.parse_function_should_fail("""
+module foo
+foo.empty_group
+    param: int
+    [
+    [
+    ]
+    group2 : int
+    ]
+            """)
+
+    def test_no_parameters(self):
+        function = self.parse_function("""
+module foo
+foo.bar
+
+Docstring
+
+""")
+        self.assertEqual("bar($module, /)\n--\n\nDocstring", function.docstring)
+        self.assertEqual(1, len(function.parameters)) # self!
+
+    def test_init_with_no_parameters(self):
+        function = self.parse_function("""
+module foo
+class foo.Bar "unused" "notneeded"
+foo.Bar.__init__
+
+Docstring
+
+""", signatures_in_block=3, function_index=2)
+        # self is not in the signature
+        self.assertEqual("Bar()\n--\n\nDocstring", function.docstring)
+        # but it *is* a parameter
+        self.assertEqual(1, len(function.parameters))
+
+    def test_illegal_module_line(self):
+        self.parse_function_should_fail("""
+module foo
+foo.bar => int
+    /
+""")
+
+    def test_illegal_c_basename(self):
+        self.parse_function_should_fail("""
+module foo
+foo.bar as 935
+    /
+""")
+
+    def test_single_star(self):
+        self.parse_function_should_fail("""
+module foo
+foo.bar
+    *
+    *
+""")
+
+    def test_parameters_required_after_star_without_initial_parameters_or_docstring(self):
+        self.parse_function_should_fail("""
+module foo
+foo.bar
+    *
+""")
+
+    def test_parameters_required_after_star_without_initial_parameters_with_docstring(self):
+        self.parse_function_should_fail("""
+module foo
+foo.bar
+    *
+Docstring here.
+""")
+
+    def test_parameters_required_after_star_with_initial_parameters_without_docstring(self):
+        self.parse_function_should_fail("""
+module foo
+foo.bar
+    this: int
+    *
+""")
+
+    def test_parameters_required_after_star_with_initial_parameters_and_docstring(self):
+        self.parse_function_should_fail("""
+module foo
+foo.bar
+    this: int
+    *
+Docstring.
+""")
+
+    def test_single_slash(self):
+        self.parse_function_should_fail("""
+module foo
+foo.bar
+    /
+    /
+""")
+
+    def test_mix_star_and_slash(self):
+        self.parse_function_should_fail("""
+module foo
+foo.bar
+   x: int
+   y: int
+   *
+   z: int
+   /
+""")
+
+    def test_parameters_not_permitted_after_slash_for_now(self):
+        self.parse_function_should_fail("""
+module foo
+foo.bar
+    /
+    x: int
+""")
+
+    def test_function_not_at_column_0(self):
+        function = self.parse_function("""
+  module foo
+  foo.bar
+    x: int
+      Nested docstring here, goeth.
+    *
+    y: str
+  Not at column 0!
+""")
+        self.assertEqual("""
+bar($module, /, x, *, y)
+--
+
+Not at column 0!
+
+  x
+    Nested docstring here, goeth.
+""".strip(), function.docstring)
+
+    def test_parser_regression_special_character_in_parameter_column_of_docstring_first_line(self):
+        function = self.parse_function("""
+module os
+os.stat
+    path: str
+This/used to break Clinic!
+""")
+        self.assertEqual("stat($module, /, path)\n--\n\nThis/used to break Clinic!", function.docstring)
+
+    def test_directive(self):
+        c = FakeClinic()
+        parser = DSLParser(c)
+        parser.flag = False
+        parser.directives['setflag'] = lambda : setattr(parser, 'flag', True)
+        block = clinic.Block("setflag")
+        parser.parse(block)
+        self.assertTrue(parser.flag)
+
+    def test_legacy_converters(self):
+        block = self.parse('module os\nos.access\n   path: "s"')
+        module, function = block.signatures
+        self.assertIsInstance((function.parameters['path']).converter, clinic.str_converter)
+
+    def parse(self, text):
+        c = FakeClinic()
+        parser = DSLParser(c)
+        block = clinic.Block(text)
+        parser.parse(block)
+        return block
+
+    def parse_function(self, text, signatures_in_block=2, function_index=1):
+        block = self.parse(text)
+        s = block.signatures
+        self.assertEqual(len(s), signatures_in_block)
+        assert isinstance(s[0], clinic.Module)
+        assert isinstance(s[function_index], clinic.Function)
+        return s[function_index]
+
+    def test_scaffolding(self):
+        # test repr on special values
+        self.assertEqual(repr(clinic.unspecified), '<Unspecified>')
+        self.assertEqual(repr(clinic.NULL), '<Null>')
+
+        # test that fail fails
+        with support.captured_stdout() as stdout:
+            with self.assertRaises(SystemExit):
+                clinic.fail('The igloos are melting!', filename='clown.txt', line_number=69)
+        self.assertEqual(stdout.getvalue(), 'Error in file "clown.txt" on line 69:\nThe igloos are melting!\n')
+
+
+if __name__ == "__main__":
+    unittest.main()
diff --git a/Tools/clinic/cpp.py b/Tools/clinic/cpp.py
new file mode 100644
index 0000000..e099590
--- /dev/null
+++ b/Tools/clinic/cpp.py
@@ -0,0 +1,191 @@
+import re
+import sys
+
+def negate(condition):
+    """
+    Returns a CPP conditional that is the opposite of the conditional passed in.
+    """
+    if condition.startswith('!'):
+        return condition[1:]
+    return "!" + condition
+
+class Monitor:
+    """
+    A simple C preprocessor that scans C source and computes, line by line,
+    what the current C preprocessor #if state is.
+
+    Doesn't handle everything--for example, if you have /* inside a C string,
+    without a matching */ (also inside a C string), or with a */ inside a C
+    string but on another line and with preprocessor macros in between...
+    the parser will get lost.
+
+    Anyway this implementation seems to work well enough for the CPython sources.
+    """
+
+    is_a_simple_defined = re.compile(r'^defined\s*\(\s*[A-Za-z0-9_]+\s*\)$').match
+
+    def __init__(self, filename=None, *, verbose=False):
+        self.stack = []
+        self.in_comment = False
+        self.continuation = None
+        self.line_number = 0
+        self.filename = filename
+        self.verbose = verbose
+
+    def __repr__(self):
+        return ''.join((
+            '<Monitor ',
+            str(id(self)),
+            " line=", str(self.line_number),
+            " condition=", repr(self.condition()),
+            ">"))
+
+    def status(self):
+        return str(self.line_number).rjust(4) + ": " + self.condition()
+
+    def condition(self):
+        """
+        Returns the current preprocessor state, as a single #if condition.
+        """
+        return " && ".join(condition for token, condition in self.stack)
+
+    def fail(self, *a):
+        if self.filename:
+            filename = " " + self.filename
+        else:
+            filename = ''
+        print("Error at" + filename, "line", self.line_number, ":")
+        print("   ", ' '.join(str(x) for x in a))
+        sys.exit(-1)
+
+    def close(self):
+        if self.stack:
+            self.fail("Ended file while still in a preprocessor conditional block!")
+
+    def write(self, s):
+        for line in s.split("\n"):
+            self.writeline(line)
+
+    def writeline(self, line):
+        self.line_number += 1
+        line = line.strip()
+
+        def pop_stack():
+            if not self.stack:
+                self.fail("#" + token + " without matching #if / #ifdef / #ifndef!")
+            return self.stack.pop()
+
+        if self.continuation:
+            line = self.continuation + line
+            self.continuation = None
+
+        if not line:
+            return
+
+        if line.endswith('\\'):
+            self.continuation = line[:-1].rstrip() + " "
+            return
+
+        # we have to ignore preprocessor commands inside comments
+        #
+        # we also have to handle this:
+        #     /* start
+        #     ...
+        #     */   /*    <-- tricky!
+        #     ...
+        #     */
+        # and this:
+        #     /* start
+        #     ...
+        #     */   /* also tricky! */
+        if self.in_comment:
+            if '*/' in line:
+                # snip out the comment and continue
+                #
+                # GCC allows
+                #    /* comment
+                #    */ #include <stdio.h>
+                # maybe other compilers too?
+                _, _, line = line.partition('*/')
+                self.in_comment = False
+
+        while True:
+            if '/*' in line:
+                if self.in_comment:
+                    self.fail("Nested block comment!")
+
+                before, _, remainder = line.partition('/*')
+                comment, comment_ends, after = remainder.partition('*/')
+                if comment_ends:
+                    # snip out the comment
+                    line = before.rstrip() + ' ' + after.lstrip()
+                    continue
+                # comment continues to eol
+                self.in_comment = True
+                line = before.rstrip()
+            break
+
+        # we actually have some // comments
+        # (but block comments take precedence)
+        before, line_comment, comment = line.partition('//')
+        if line_comment:
+            line = before.rstrip()
+
+        if not line.startswith('#'):
+            return
+
+        line = line[1:].lstrip()
+        assert line
+
+        fields = line.split()
+        token = fields[0].lower()
+        condition = ' '.join(fields[1:]).strip()
+
+        if_tokens = {'if', 'ifdef', 'ifndef'}
+        all_tokens = if_tokens | {'elif', 'else', 'endif'}
+
+        if token not in all_tokens:
+            return
+
+        # cheat a little here, to reuse the implementation of if
+        if token == 'elif':
+            pop_stack()
+            token = 'if'
+
+        if token in if_tokens:
+            if not condition:
+                self.fail("Invalid format for #" + token + " line: no argument!")
+            if token == 'if':
+                if not self.is_a_simple_defined(condition):
+                    condition = "(" + condition + ")"
+            else:
+                fields = condition.split()
+                if len(fields) != 1:
+                    self.fail("Invalid format for #" + token + " line: should be exactly one argument!")
+                symbol = fields[0]
+                condition = 'defined(' + symbol + ')'
+                if token == 'ifndef':
+                    condition = '!' + condition
+
+            self.stack.append(("if", condition))
+            if self.verbose:
+                print(self.status())
+            return
+
+        previous_token, previous_condition = pop_stack()
+
+        if token == 'else':
+            self.stack.append(('else', negate(previous_condition)))
+        elif token == 'endif':
+            pass
+        if self.verbose:
+            print(self.status())
+
+if __name__ == '__main__':
+    for filename in sys.argv[1:]:
+        with open(filename, "rt") as f:
+            cpp = Monitor(filename, verbose=True)
+            print()
+            print(filename)
+            for line_number, line in enumerate(f.read().split('\n'), 1):
+                cpp.writeline(line)
diff --git a/Tools/freeze/bkfile.py b/Tools/freeze/bkfile.py
index 0e895f2..58246fa 100644
--- a/Tools/freeze/bkfile.py
+++ b/Tools/freeze/bkfile.py
@@ -7,11 +7,11 @@
         self.__backup = file + '~'
         try:
             os.unlink(self.__backup)
-        except os.error:
+        except OSError:
             pass
         try:
             os.rename(file, self.__backup)
-        except os.error:
+        except OSError:
             self.__backup = None
         self.__file = _orig_open(file, mode, bufsize)
         self.closed = self.__file.closed
diff --git a/Tools/freeze/freeze.py b/Tools/freeze/freeze.py
index a41267a..e0c6c2c 100755
--- a/Tools/freeze/freeze.py
+++ b/Tools/freeze/freeze.py
@@ -125,7 +125,7 @@
     # default the exclude list for each platform
     if win: exclude = exclude + [
         'dos', 'dospath', 'mac', 'macpath', 'macfs', 'MACFS', 'posix',
-        'os2', 'ce',
+        'ce',
         ]
 
     fail_import = exclude[:]
@@ -219,6 +219,7 @@
 
     # locations derived from options
     version = sys.version[:3]
+    flagged_version = version + sys.abiflags
     if win:
         extensions_c = 'frozen_extensions.c'
     if ishome:
@@ -233,10 +234,11 @@
             frozendllmain_c = os.path.join(exec_prefix, 'Pc\\frozen_dllmain.c')
     else:
         binlib = os.path.join(exec_prefix,
-                              'lib', 'python%s' % version, 'config')
-        incldir = os.path.join(prefix, 'include', 'python%s' % version)
+                              'lib', 'python%s' % version,
+                              'config-%s' % flagged_version)
+        incldir = os.path.join(prefix, 'include', 'python%s' % flagged_version)
         config_h_dir = os.path.join(exec_prefix, 'include',
-                                    'python%s' % version)
+                                    'python%s' % flagged_version)
         config_c_in = os.path.join(binlib, 'config.c.in')
         frozenmain_c = os.path.join(binlib, 'frozenmain.c')
         makefile_in = os.path.join(binlib, 'Makefile')
@@ -311,7 +313,7 @@
         try:
             os.mkdir(odir)
             print("Created output directory", odir)
-        except os.error as msg:
+        except OSError as msg:
             usage('%s: mkdir failed (%s)' % (odir, str(msg)))
     base = ''
     if odir:
@@ -363,6 +365,10 @@
         else:
             mf.load_file(mod)
 
+    # Alias "importlib._bootstrap" to "_frozen_importlib" so that the
+    # import machinery can bootstrap.
+    mf.modules["_frozen_importlib"] = mf.modules["importlib._bootstrap"]
+
     # Add the main script as either __main__, or the actual module name.
     if python_entry_is_main:
         mf.run_script(scriptfile)
@@ -455,7 +461,7 @@
 
     cflags = ['$(OPT)']
     cppflags = defines + includes
-    libs = [os.path.join(binlib, 'libpython$(VERSION).a')]
+    libs = [os.path.join(binlib, '$(LDLIBRARY)')]
 
     somevars = {}
     if os.path.exists(makefile_in):
diff --git a/Tools/freeze/makeconfig.py b/Tools/freeze/makeconfig.py
index 018992c..fabaace 100644
--- a/Tools/freeze/makeconfig.py
+++ b/Tools/freeze/makeconfig.py
@@ -3,7 +3,7 @@
 
 # Write the config.c file
 
-never = ['marshal', 'imp', '_ast', '__main__', 'builtins',
+never = ['marshal', '_imp', '_ast', '__main__', 'builtins',
          'sys', 'gc', '_warnings']
 
 def makeconfig(infp, outfp, modules, with_ifdef=0):
diff --git a/Tools/freeze/test/Makefile b/Tools/freeze/test/Makefile
new file mode 100644
index 0000000..1679f72
--- /dev/null
+++ b/Tools/freeze/test/Makefile
@@ -0,0 +1,11 @@
+# Makefile to test freeze
+# set PYTHON to path of Python interpreter to test
+PYTHON=python
+# set OUTDIR to the temp directory for freeze
+OUTDIR=outdir
+
+test:
+	$(PYTHON) ../freeze.py -o $(OUTDIR) ok.py
+	make -C $(OUTDIR)
+	$(OUTDIR)/ok
+	
diff --git a/Tools/freeze/test/ok.py b/Tools/freeze/test/ok.py
new file mode 100644
index 0000000..e15e0b4
--- /dev/null
+++ b/Tools/freeze/test/ok.py
@@ -0,0 +1,2 @@
+import sys
+sys.exit(0)
diff --git a/Tools/gdb/libpython.py b/Tools/gdb/libpython.py
index 1c2c3cb..2ad22e2 100755
--- a/Tools/gdb/libpython.py
+++ b/Tools/gdb/libpython.py
@@ -939,21 +939,26 @@
 class PySetObjectPtr(PyObjectPtr):
     _typename = 'PySetObject'
 
+    @classmethod
+    def _dummy_key(self):
+        return gdb.lookup_global_symbol('_PySet_Dummy').value()
+
+    def __iter__(self):
+        dummy_ptr = self._dummy_key()
+        table = self.field('table')
+        for i in safe_range(self.field('mask') + 1):
+            setentry = table[i]
+            key = setentry['key']
+            if key != 0 and key != dummy_ptr:
+                yield PyObjectPtr.from_pyobject_ptr(key)
+
     def proxyval(self, visited):
         # Guard against infinite loops:
         if self.as_address() in visited:
             return ProxyAlreadyVisited('%s(...)' % self.safe_tp_name())
         visited.add(self.as_address())
 
-        members = []
-        table = self.field('table')
-        for i in safe_range(self.field('mask')+1):
-            setentry = table[i]
-            key = setentry['key']
-            if key != 0:
-                key_proxy = PyObjectPtr.from_pyobject_ptr(key).proxyval(visited)
-                if key_proxy != '<dummy key>':
-                    members.append(key_proxy)
+        members = (key.proxyval(visited) for key in self)
         if self.safe_tp_name() == 'frozenset':
             return frozenset(members)
         else:
@@ -982,18 +987,11 @@
 
         out.write('{')
         first = True
-        table = self.field('table')
-        for i in safe_range(self.field('mask')+1):
-            setentry = table[i]
-            key = setentry['key']
-            if key != 0:
-                pyop_key = PyObjectPtr.from_pyobject_ptr(key)
-                key_proxy = pyop_key.proxyval(visited) # FIXME!
-                if key_proxy != '<dummy key>':
-                    if not first:
-                        out.write(', ')
-                    first = False
-                    pyop_key.write_repr(out, visited)
+        for key in self:
+            if not first:
+                out.write(', ')
+            first = False
+            key.write_repr(out, visited)
         out.write('}')
 
         if tp_name != 'set':
@@ -1177,7 +1175,9 @@
         # Convert the int code points to unicode characters, and generate a
         # local unicode instance.
         # This splits surrogate pairs if sizeof(Py_UNICODE) is 2 here (in gdb).
-        result = u''.join([_unichr(ucs) for ucs in Py_UNICODEs])
+        result = u''.join([
+            (_unichr(ucs) if ucs <= 0x10ffff else '\ufffd')
+            for ucs in Py_UNICODEs])
         return result
 
     def write_repr(self, out, visited):
diff --git a/Tools/i18n/makelocalealias.py b/Tools/i18n/makelocalealias.py
index 8b92ae1..10887ce 100755
--- a/Tools/i18n/makelocalealias.py
+++ b/Tools/i18n/makelocalealias.py
@@ -7,6 +7,7 @@
 
 """
 import locale
+import sys
 
 # Location of the alias file
 LOCALE_ALIAS = '/usr/share/X11/locale/locale.alias'
@@ -65,9 +66,35 @@
                   (k, olddata[k], data[k]))
         # Additions are not mentioned
 
+def optimize(data):
+    locale_alias = locale.locale_alias
+    locale.locale_alias = data.copy()
+    for k, v in data.items():
+        del locale.locale_alias[k]
+        if locale.normalize(k) != v:
+            locale.locale_alias[k] = v
+    newdata = locale.locale_alias
+    errors = check(data)
+    locale.locale_alias = locale_alias
+    if errors:
+        sys.exit(1)
+    return newdata
+
+def check(data):
+    # Check that all alias definitions from the X11 file
+    # are actually mapped to the correct alias locales.
+    errors = 0
+    for k, v in data.items():
+        if locale.normalize(k) != v:
+            print('ERROR: %a -> %a != %a' % (k, locale.normalize(k), v),
+                  file=sys.stderr)
+            errors += 1
+    return errors
+
 if __name__ == '__main__':
     data = locale.locale_alias.copy()
     data.update(parse(LOCALE_ALIAS))
+    data = optimize(data)
     print_differences(data, locale.locale_alias)
     print()
     print('locale_alias = {')
diff --git a/Tools/i18n/msgfmt.py b/Tools/i18n/msgfmt.py
index cd90691..b0751a1 100755
--- a/Tools/i18n/msgfmt.py
+++ b/Tools/i18n/msgfmt.py
@@ -218,7 +218,7 @@
         if opt in ('-h', '--help'):
             usage(0)
         elif opt in ('-V', '--version'):
-            print("msgfmt.py", __version__, file=sys.stderr)
+            print("msgfmt.py", __version__)
             sys.exit(0)
         elif opt in ('-o', '--output-file'):
             outfile = arg
diff --git a/Tools/importbench/importbench.py b/Tools/importbench/importbench.py
index 714c0e4..635dd56 100644
--- a/Tools/importbench/importbench.py
+++ b/Tools/importbench/importbench.py
@@ -46,8 +46,7 @@
     module.__package__ = ''
     with util.uncache(name):
         sys.modules[name] = module
-        for result in bench(name, repeat=repeat, seconds=seconds):
-            yield result
+        yield from bench(name, repeat=repeat, seconds=seconds)
 
 
 def builtin_mod(seconds, repeat):
@@ -56,9 +55,8 @@
     if name in sys.modules:
         del sys.modules[name]
     # Relying on built-in importer being implicit.
-    for result in bench(name, lambda: sys.modules.pop(name), repeat=repeat,
-                        seconds=seconds):
-        yield result
+    yield from bench(name, lambda: sys.modules.pop(name), repeat=repeat,
+                     seconds=seconds)
 
 
 def source_wo_bytecode(seconds, repeat):
@@ -73,9 +71,8 @@
             loader = (importlib.machinery.SourceFileLoader,
                       importlib.machinery.SOURCE_SUFFIXES, True)
             sys.path_hooks.append(importlib.machinery.FileFinder.path_hook(loader))
-            for result in bench(name, lambda: sys.modules.pop(name), repeat=repeat,
-                                seconds=seconds):
-                yield result
+            yield from bench(name, lambda: sys.modules.pop(name), repeat=repeat,
+                             seconds=seconds)
     finally:
         sys.dont_write_bytecode = False
 
@@ -89,9 +86,8 @@
             os.unlink(bytecode_path)
         sys.dont_write_bytecode = True
         try:
-            for result in bench(name, lambda: sys.modules.pop(name),
-                                repeat=repeat, seconds=seconds):
-                yield result
+            yield from bench(name, lambda: sys.modules.pop(name),
+                             repeat=repeat, seconds=seconds)
         finally:
             sys.dont_write_bytecode = False
 
@@ -127,8 +123,7 @@
         def cleanup():
             sys.modules.pop(name)
             os.unlink(imp.cache_from_source(module.__file__))
-        for result in bench(name, cleanup, repeat=repeat, seconds=seconds):
-            yield result
+        yield from bench(name, cleanup, repeat=repeat, seconds=seconds)
 
     writing_bytecode_benchmark.__doc__ = (
                                 writing_bytecode_benchmark.__doc__.format(name))
@@ -148,9 +143,8 @@
         sys.path_hooks.append(importlib.machinery.FileFinder.path_hook(loader))
         py_compile.compile(mapping[name])
         assert os.path.exists(imp.cache_from_source(mapping[name]))
-        for result in bench(name, lambda: sys.modules.pop(name), repeat=repeat,
-                            seconds=seconds):
-            yield result
+        yield from bench(name, lambda: sys.modules.pop(name), repeat=repeat,
+                         seconds=seconds)
 
 
 def _using_bytecode(module):
@@ -158,9 +152,8 @@
     def using_bytecode_benchmark(seconds, repeat):
         """Source w/ bytecode: {}"""
         py_compile.compile(module.__file__)
-        for result in bench(name, lambda: sys.modules.pop(name), repeat=repeat,
-                            seconds=seconds):
-            yield result
+        yield from bench(name, lambda: sys.modules.pop(name), repeat=repeat,
+                         seconds=seconds)
 
     using_bytecode_benchmark.__doc__ = (
                                 using_bytecode_benchmark.__doc__.format(name))
diff --git a/Tools/iobench/iobench.py b/Tools/iobench/iobench.py
index 530bc79..712e584 100644
--- a/Tools/iobench/iobench.py
+++ b/Tools/iobench/iobench.py
@@ -24,6 +24,8 @@
     try:
         return open(fn, mode, encoding=encoding or TEXT_ENCODING)
     except TypeError:
+        if 'r' in mode:
+            mode += 'U' # 'U' mode is needed only in Python 2.x
         return open(fn, mode)
 
 def get_file_sizes():
@@ -380,7 +382,7 @@
             f.write(os.urandom(size))
     # Text files
     chunk = []
-    with text_open(__file__, "rU", encoding='utf8') as f:
+    with text_open(__file__, "r", encoding='utf8') as f:
         for line in f:
             if line.startswith("# <iobench text chunk marker>"):
                 break
diff --git a/Tools/msi/msi.py b/Tools/msi/msi.py
index 5ed025d..b48f09a 100644
--- a/Tools/msi/msi.py
+++ b/Tools/msi/msi.py
@@ -99,7 +99,9 @@
     '_multiprocessing.pyd',
     '_lzma.pyd',
     '_decimal.pyd',
-    '_testbuffer.pyd'
+    '_testbuffer.pyd',
+    '_testimportmultiple.pyd',
+    '_overlapped.pyd',
 ]
 
 # Well-known component UUIDs
@@ -119,6 +121,7 @@
     "31":"{4afcba0b-13e4-47c3-bebe-477428b46913}",
     "32":"{3ff95315-1096-4d31-bd86-601d5438ad5e}",
     "33":"{f7581ca4-d368-4eea-8f82-d48c64c4f047}",
+    "34":"{7A0C5812-2583-40D9-BCBB-CD7485F11377}",
     } [major+minor]
 
 # Compute the name that Sphinx gives to the docfile
@@ -417,6 +420,8 @@
 
     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()"'
+    updatepipargs = r'-m ensurepip -U --default-pip'
+    removepipargs = r'-B -m ensurepip._uninstall'
     # See "CustomAction Table"
     add_data(db, "CustomAction", [
         # msidbCustomActionTypeFirstSequence + msidbCustomActionTypeTextData + msidbCustomActionTypeProperty
@@ -430,9 +435,13 @@
         ("SetLauncherDirToWindows", 307, "LAUNCHERDIR", "[WindowsFolder]"),
         # msidbCustomActionTypeExe + msidbCustomActionTypeSourceFile
         # See "Custom Action Type 18"
-        ("CompilePyc", 18, "python.exe", compileargs),
-        ("CompilePyo", 18, "python.exe", "-O "+compileargs),
-        ("CompileGrammar", 18, "python.exe", lib2to3args),
+        # msidbCustomActionTypeInScript (1024); run during actual installation
+        # msidbCustomActionTypeNoImpersonate (2048); run action in system account, not user account
+        ("CompilePyc", 18+1024+2048, "python.exe", compileargs),
+        ("CompilePyo", 18+1024+2048, "python.exe", "-O "+compileargs),
+        ("CompileGrammar", 18+1024+2048, "python.exe", lib2to3args),
+        ("UpdatePip", 18+1024+2048, "python.exe", updatepipargs),
+        ("RemovePip", 18+1024+2048, "python.exe", removepipargs),
         ])
 
     # UI Sequences, see "InstallUISequence Table", "Using a Sequence Table"
@@ -459,7 +468,7 @@
 
     # Prepend TARGETDIR to the system path, and remove it on uninstall.
     add_data(db, "Environment",
-             [("PathAddition", "=-*Path", "[TARGETDIR];[~]", "REGISTRY.path")])
+             [("PathAddition", "=-*Path", "[TARGETDIR];[TARGETDIR]Scripts;[~]", "REGISTRY.path")])
 
     # Execute Sequences
     add_data(db, "InstallExecuteSequence",
@@ -469,17 +478,20 @@
              ("SetLauncherDirToWindows", 'LAUNCHERDIR="" and ' + sys32cond, 753),
              ("SetLauncherDirToTarget", 'LAUNCHERDIR="" and not ' + sys32cond, 754),
              ("UpdateEditIDLE", None, 1050),
-             ("CompilePyc", "COMPILEALL", 6800),
-             ("CompilePyo", "COMPILEALL", 6801),
-             ("CompileGrammar", "COMPILEALL", 6802),
+             # run command if install state of pip changes to INSTALLSTATE_LOCAL
+             # run after InstallFiles
+             ("UpdatePip", "&pip_feature=3", 4001),
+             # remove pip when state changes to INSTALLSTATE_ABSENT
+             # run before RemoveFiles
+             ("RemovePip", "&pip_feature=2", 3499),
+             ("CompilePyc", "COMPILEALL", 4002),
+             ("CompilePyo", "COMPILEALL", 4003),
+             ("CompileGrammar", "COMPILEALL", 4004),
             ])
     add_data(db, "AdminExecuteSequence",
             [("InitialTargetDir", 'TARGETDIR=""', 750),
              ("SetDLLDirToTarget", 'DLLDIR=""', 751),
              ("SetLauncherDirToTarget", 'LAUNCHERDIR=""', 752),
-             ("CompilePyc", "COMPILEALL", 6800),
-             ("CompilePyo", "COMPILEALL", 6801),
-             ("CompileGrammar", "COMPILEALL", 6802),
             ])
 
     #####################################################################
@@ -748,7 +760,8 @@
     advanced = PyDialog(db, "AdvancedDlg", x, y, w, h, modal, title,
                         "CompilePyc", "Ok", "Ok")
     advanced.title("Advanced Options for [ProductName]")
-    # A radio group with two options: allusers, justme
+
+    # A checkbox whether to build pyc files
     advanced.checkbox("CompilePyc", 135, 60, 230, 50, 3,
                       "COMPILEALL", "Compile .py files to byte code after installation", "Ok")
 
@@ -845,7 +858,8 @@
     # (i.e. additional Python libraries) need to follow the parent feature.
     # Features that have no advertisement trigger (e.g. the test suite)
     # must not support advertisement
-    global default_feature, tcltk, htmlfiles, tools, testsuite, ext_feature, private_crt, prepend_path
+    global default_feature, tcltk, htmlfiles, tools, testsuite
+    global ext_feature, private_crt, prepend_path, pip_feature
     default_feature = Feature(db, "DefaultFeature", "Python",
                               "Python Interpreter and Libraries",
                               1, directory = "TARGETDIR")
@@ -867,8 +881,14 @@
     tools = Feature(db, "Tools", "Utility Scripts",
                     "Python utility scripts (Tools/)", 9,
                     parent = default_feature, attributes=2)
+    # pip installation isn't enabled by default until a clean uninstall procedure
+    # becomes possible
+    pip_feature = Feature(db, "pip_feature", "pip",
+                    "Install (or upgrade from an earlier version) pip, "
+                    "a tool for installing and managing Python packages.", 11,
+                    parent = default_feature, attributes=2|8)
     testsuite = Feature(db, "Testsuite", "Test suite",
-                        "Python test suite (Lib/test/)", 11,
+                        "Python test suite (Lib/test/)", 13,
                         parent = default_feature, attributes=2|8)
     # prepend_path is an additional feature which is to be off by default.
     # Since the default level for the above features is 1, this needs to be
@@ -876,7 +896,7 @@
     prepend_path = Feature(db, "PrependPath", "Add python.exe to Path",
                         "Prepend [TARGETDIR] to the system Path variable. "
                         "This allows you to type 'python' into a command "
-                        "prompt without needing the full path.", 13,
+                        "prompt without needing the full path.", 15,
                         parent = default_feature, attributes=2|8,
                         level=2)
 
@@ -954,8 +974,6 @@
     # Add all executables, icons, text files into the TARGETDIR component
     root = PyDirectory(db, cab, None, srcdir, "TARGETDIR", "SourceDir")
     default_feature.set_current()
-    if not msilib.Win64:
-        root.add_file("%s/w9xpopen.exe" % PCBUILD)
     root.add_file("README.txt", src="README")
     root.add_file("NEWS.txt", src="Misc/NEWS")
     generate_license()
@@ -1140,7 +1158,7 @@
     for f in ['i18n', 'pynche', 'Scripts']:
         lib = PyDirectory(db, cab, tooldir, f, f, "%s|%s" % (tooldir.make_short(f), f))
         lib.glob("*.py")
-        lib.glob("*.pyw", exclude=['pydocgui.pyw'])
+        lib.glob("*.pyw")
         lib.remove_pyc()
         lib.glob("*.txt")
         if f == "pynche":
@@ -1152,9 +1170,6 @@
             lib.add_file("2to3.py", src="2to3")
             lib.add_file("pydoc3.py", src="pydoc3")
             lib.add_file("pyvenv.py", src="pyvenv")
-            if have_tcl:
-                lib.start_component("pydocgui.pyw", tcltk, keyfile="pydocgui.pyw")
-                lib.add_file("pydocgui.pyw")
     # Add documentation
     htmlfiles.set_current()
     lib = PyDirectory(db, cab, root, "Doc", "Doc", "DOC|Doc")
@@ -1185,6 +1200,8 @@
                "Documentation"),
               ("REGISTRY.path", msilib.gen_uuid(), "TARGETDIR", registry_component, None,
               None),
+              ("REGISTRY.ensurepip", msilib.gen_uuid(), "TARGETDIR", registry_component, "EnsurePipRun",
+              None),
               ("REGISTRY.def", msilib.gen_uuid(), "TARGETDIR", registry_component,
                None, None)] + tcldata)
     # See "FeatureComponents Table".
@@ -1202,6 +1219,7 @@
              [(default_feature.id, "REGISTRY"),
               (htmlfiles.id, "REGISTRY.doc"),
               (prepend_path.id, "REGISTRY.path"),
+              (pip_feature.id, "REGISTRY.ensurepip"),
               (ext_feature.id, "REGISTRY.def")] +
               tcldata
               )
@@ -1269,6 +1287,10 @@
               "{60254CA5-953B-11CF-8C96-00AA00B8708C}", "REGISTRY.def"),
             ])
 
+    # PATHEXT
+    add_data(db, "Environment",
+             [("PathExtAddition", "=-*PathExt", "[~];.PY", "REGISTRY.def")])
+
     # Registry keys
     prefix = r"Software\%sPython\PythonCore\%s" % (testprefix, short_version)
     add_data(db, "Registry",
@@ -1284,7 +1306,9 @@
                "", r"[TARGETDIR]Python.exe", "REGISTRY.def"),
               ("DisplayIcon", -1,
                r"Software\Microsoft\Windows\CurrentVersion\Uninstall\%s" % product_code,
-               "DisplayIcon", "[TARGETDIR]python.exe", "REGISTRY")
+               "DisplayIcon", "[TARGETDIR]python.exe", "REGISTRY"),
+              # Fake registry entry to allow installer to track whether ensurepip has been run
+              ("EnsurePipRun", -1, prefix+r"\EnsurePipRun", "", "#1", "REGISTRY.ensurepip"),
               ])
     # Shortcuts, see "Shortcut Table"
     add_data(db, "Directory",
@@ -1293,27 +1317,38 @@
     add_data(db, "RemoveFile",
              [("MenuDir", "TARGETDIR", None, "MenuDir", 2)])
     tcltkshortcuts = []
+    if msilib.Win64:
+        bitted = "64 bit"
+    else:
+        bitted = "32 bit"
     if have_tcl:
         tcltkshortcuts = [
-              ("IDLE", "MenuDir", "IDLE|IDLE (Python GUI)", "pythonw.exe",
-               tcltk.id, r'"[TARGETDIR]Lib\idlelib\idle.pyw"', None, None, "python_icon.exe", 0, None, "TARGETDIR"),
-              ("PyDoc", "MenuDir", "MODDOCS|Module Docs", "pythonw.exe",
-               tcltk.id, r'"[TARGETDIR]Tools\scripts\pydocgui.pyw"', None, None, "python_icon.exe", 0, None, "TARGETDIR"),
+              ("IDLE", "MenuDir",
+               "IDLE|IDLE (Python "+short_version+" GUI - "+bitted+")",
+               "pythonw.exe", tcltk.id, r'"[TARGETDIR]Lib\idlelib\idle.pyw"',
+               None, None, "python_icon.exe", 0, None, "TARGETDIR"),
               ]
     add_data(db, "Shortcut",
              tcltkshortcuts +
              [# Advertised shortcuts: targets are features, not files
-              ("Python", "MenuDir", "PYTHON|Python (command line)", "python.exe",
-               default_feature.id, None, None, None, "python_icon.exe", 2, None, "TARGETDIR"),
+              ("Python", "MenuDir",
+               "PYTHON|Python "+short_version+" (command line - "+bitted+")",
+               "python.exe", default_feature.id, None, None, None,
+               "python_icon.exe", 2, None, "TARGETDIR"),
               # Advertising the Manual breaks on (some?) Win98, and the shortcut lacks an
               # icon first.
               #("Manual", "MenuDir", "MANUAL|Python Manuals", "documentation",
               # htmlfiles.id, None, None, None, None, None, None, None),
               ## Non-advertised shortcuts: must be associated with a registry component
-              ("Manual", "MenuDir", "MANUAL|Python Manuals", "REGISTRY.doc",
-               "[#%s]" % docfile, None,
-               None, None, None, None, None, None),
-              ("Uninstall", "MenuDir", "UNINST|Uninstall Python", "REGISTRY",
+              ("Manual", "MenuDir", "MANUAL|Python "+short_version+" Manuals",
+               "REGISTRY.doc", "[#%s]" % docfile,
+               None, None, None, None, None, None, None),
+              ("PyDoc", "MenuDir",
+               "MODDOCS|Python "+short_version+" Docs Server (pydoc - "+
+               bitted+")", "python.exe", default_feature.id, r'-m pydoc -b',
+               None, None, "python_icon.exe", 0, None, "TARGETDIR"),
+              ("Uninstall", "MenuDir", "UNINST|Uninstall Python "+
+               short_version+" ("+bitted+")", "REGISTRY",
                SystemFolderName+"msiexec",  "/x%s" % product_code,
                None, None, None, None, None, None),
               ])
diff --git a/Tools/parser/unparse.py b/Tools/parser/unparse.py
index b55e2c6..837cd81 100644
--- a/Tools/parser/unparse.py
+++ b/Tools/parser/unparse.py
@@ -307,6 +307,9 @@
     def _Name(self, t):
         self.write(t.id)
 
+    def _NameConstant(self, t):
+        self.write(repr(t.value))
+
     def _Num(self, t):
         # Substitute overflowing decimal literal for AST infinities.
         self.write(repr(t.n).replace("inf", INFSTR))
@@ -515,10 +518,10 @@
             else: self.write(", ")
             self.write("*")
             if t.vararg:
-                self.write(t.vararg)
-                if t.varargannotation:
+                self.write(t.vararg.arg)
+                if t.vararg.annotation:
                     self.write(": ")
-                    self.dispatch(t.varargannotation)
+                    self.dispatch(t.vararg.annotation)
 
         # keyword-only arguments
         if t.kwonlyargs:
@@ -534,10 +537,10 @@
         if t.kwarg:
             if first:first = False
             else: self.write(", ")
-            self.write("**"+t.kwarg)
-            if t.kwargannotation:
+            self.write("**"+t.kwarg.arg)
+            if t.kwarg.annotation:
                 self.write(": ")
-                self.dispatch(t.kwargannotation)
+                self.dispatch(t.kwarg.annotation)
 
     def _keyword(self, t):
         self.write(t.arg)
diff --git a/Tools/scripts/README b/Tools/scripts/README
index d65d1fd..c6b2282 100644
--- a/Tools/scripts/README
+++ b/Tools/scripts/README
@@ -2,64 +2,68 @@
 useful while building, extending or managing Python.  Some (e.g., dutree or lll)
 are also generally useful UNIX tools.
 
-2to3                    Main script for running the 2to3 conversion tool
-analyze_dxp.py          Analyzes the result of sys.getdxp()
-byext.py                Print lines/words/chars stats of files by extension
-byteyears.py            Print product of a file's size and age
-checkpyc.py             Check presence and validity of ".pyc" files
-cleanfuture.py          Fix redundant Python __future__ statements
-combinerefs.py          A helper for analyzing PYTHONDUMPREFS output
-copytime.py             Copy one file's atime and mtime to another
-crlf.py                 Change CRLF line endings to LF (Windows to Unix)
-db2pickle.py            Dump a database file to a pickle
-diff.py                 Print file diffs in context, unified, or ndiff formats
-dutree.py               Format du(1) output as a tree sorted by size
-eptags.py               Create Emacs TAGS file for Python modules
-find_recursionlimit.py  Find the maximum recursion limit on this machine
-finddiv.py              A grep-like tool that looks for division operators
-findlinksto.py          Recursively find symbolic links to a given path prefix
-findnocoding.py         Find source files which need an encoding declaration
-fixcid.py               Massive identifier substitution on C source files
-fixdiv.py               Tool to fix division operators.
-fixheader.py            Add some cpp magic to a C include file
-fixnotice.py            Fix the copyright notice in source files
-fixps.py                Fix Python scripts' first line (if #!)
-ftpmirror.py            FTP mirror script
-google.py               Open a webbrowser with Google
-gprof2html.py           Transform gprof(1) output into useful HTML
-h2py.py                 Translate #define's into Python assignments
-highlight.py            Python syntax highlighting with HTML output
-idle3                   Main program to start IDLE
-ifdef.py                Remove #if(n)def groups from C sources
-lfcr.py                 Change LF line endings to CRLF (Unix to Windows)
-linktree.py             Make a copy of a tree with links to original files
-lll.py                  Find and list symbolic links in current directory
-mailerdaemon.py         Parse error messages from mailer daemons (Sjoerd&Jack)
-make_ctype.py           Generate ctype.h replacement in stringobject.c
-md5sum.py               Print MD5 checksums of argument files
-mkreal.py               Turn a symbolic link into a real file or directory
-ndiff.py                Intelligent diff between text files (Tim Peters)
-nm2def.py               Create a template for PC/python_nt.def (Marc Lemburg)
-objgraph.py             Print object graph from nm output on a library
-parseentities.py        Utility for parsing HTML entity definitions
-patchcheck.py           Perform common checks and cleanup before committing
-pathfix.py              Change #!/usr/local/bin/python into something else
-pdeps.py                Print dependencies between Python modules
-pickle2db.py            Load a pickle generated by db2pickle.py to a database
-pindent.py              Indent Python code, giving block-closing comments
-ptags.py                Create vi tags file for Python modules
-pydoc3                  Python documentation browser
-pysource.py             Find Python source files
-redemo.py               Basic regular expression demonstration facility
-reindent.py             Change .py files to use 4-space indents
-reindent-rst.py         Fix-up reStructuredText file whitespace
-rgrep.py                Reverse grep through a file (useful for big logfiles)
-run_tests.py            Run the test suite with more sensible default options
-serve.py                Small wsgiref-based web server, used in make serve in Doc
-suff.py                 Sort a list of files by suffix
-svneol.py               Set svn:eol-style on all files in directory
-texi2html.py            Convert GNU texinfo files into HTML
-treesync.py             Synchronize source trees (very idiosyncratic)
-untabify.py             Replace tabs with spaces in argument files
-win_add2path.py         Add Python to the search path on Windows
-which.py                Find a program in $PATH
+2to3                      Main script for running the 2to3 conversion tool
+abitype.py                Converts a C file to use the PEP 384 type definition API
+analyze_dxp.py            Analyzes the result of sys.getdxp()
+byext.py                  Print lines/words/chars stats of files by extension
+byteyears.py              Print product of a file's size and age
+checkpyc.py               Check presence and validity of ".pyc" files
+cleanfuture.py            Fix redundant Python __future__ statements
+combinerefs.py            A helper for analyzing PYTHONDUMPREFS output
+copytime.py               Copy one file's atime and mtime to another
+crlf.py                   Change CRLF line endings to LF (Windows to Unix)
+db2pickle.py              Dump a database file to a pickle
+diff.py                   Print file diffs in context, unified, or ndiff formats
+dutree.py                 Format du(1) output as a tree sorted by size
+eptags.py                 Create Emacs TAGS file for Python modules
+finddiv.py                A grep-like tool that looks for division operators
+findlinksto.py            Recursively find symbolic links to a given path prefix
+findnocoding.py           Find source files which need an encoding declaration
+find_recursionlimit.py    Find the maximum recursion limit on this machine
+find-uname.py             Look for the given arguments in the sets of all Unicode names
+fixcid.py                 Massive identifier substitution on C source files
+fixdiv.py                 Tool to fix division operators.
+fixheader.py              Add some cpp magic to a C include file
+fixnotice.py              Fix the copyright notice in source files
+fixps.py                  Fix Python scripts' first line (if #!)
+ftpmirror.py              FTP mirror script
+get-remote-certificate.py Fetch the certificate that the server(s) are providing in PEM form
+google.py                 Open a webbrowser with Google
+gprof2html.py             Transform gprof(1) output into useful HTML
+h2py.py                   Translate #define's into Python assignments
+highlight.py              Python syntax highlighting with HTML output
+idle3                     Main program to start IDLE
+ifdef.py                  Remove #if(n)def groups from C sources
+import_diagnostics.py     Miscellaneous diagnostics for the import system
+lfcr.py                   Change LF line endings to CRLF (Unix to Windows)
+linktree.py               Make a copy of a tree with links to original files
+lll.py                    Find and list symbolic links in current directory
+mailerdaemon.py           Parse error messages from mailer daemons (Sjoerd&Jack)
+make_ctype.py             Generate ctype.h replacement in stringobject.c
+md5sum.py                 Print MD5 checksums of argument files
+mkreal.py                 Turn a symbolic link into a real file or directory
+ndiff.py                  Intelligent diff between text files (Tim Peters)
+nm2def.py                 Create a template for PC/python_nt.def (Marc Lemburg)
+objgraph.py               Print object graph from nm output on a library
+parseentities.py          Utility for parsing HTML entity definitions
+parse_html5_entities.py   Utility for parsing HTML5 entity definitions
+patchcheck.py             Perform common checks and cleanup before committing
+pathfix.py                Change #!/usr/local/bin/python into something else
+pdeps.py                  Print dependencies between Python modules
+pickle2db.py              Load a pickle generated by db2pickle.py to a database
+pindent.py                Indent Python code, giving block-closing comments
+ptags.py                  Create vi tags file for Python modules
+pydoc3                    Python documentation browser
+pysource.py               Find Python source files
+reindent.py               Change .py files to use 4-space indents
+reindent-rst.py           Fix-up reStructuredText file whitespace
+rgrep.py                  Reverse grep through a file (useful for big logfiles)
+run_tests.py              Run the test suite with more sensible default options
+serve.py                  Small wsgiref-based web server, used in make serve in Doc
+suff.py                   Sort a list of files by suffix
+svneol.py                 Set svn:eol-style on all files in directory
+texi2html.py              Convert GNU texinfo files into HTML
+treesync.py               Synchronize source trees (very idiosyncratic)
+untabify.py               Replace tabs with spaces in argument files
+which.py                  Find a program in $PATH
+win_add2path.py           Add Python to the search path on Windows
diff --git a/Tools/scripts/byext.py b/Tools/scripts/byext.py
index b79ff37..736a441 100755
--- a/Tools/scripts/byext.py
+++ b/Tools/scripts/byext.py
@@ -25,7 +25,7 @@
         self.addstats("<dir>", "dirs", 1)
         try:
             names = os.listdir(dir)
-        except os.error as err:
+        except OSError as err:
             sys.stderr.write("Can't list %s: %s\n" % (dir, err))
             self.addstats("<dir>", "unlistable", 1)
             return
diff --git a/Tools/scripts/byteyears.py b/Tools/scripts/byteyears.py
index 490b37f..f58c346 100755
--- a/Tools/scripts/byteyears.py
+++ b/Tools/scripts/byteyears.py
@@ -43,7 +43,7 @@
     for filename in sys.argv[1:]:
         try:
             st = statfunc(filename)
-        except os.error as msg:
+        except OSError as msg:
             sys.stderr.write("can't stat %r: %r\n" % (filename, msg))
             status = 1
             st = ()
diff --git a/Tools/scripts/checkpip.py b/Tools/scripts/checkpip.py
new file mode 100755
index 0000000..8a64eda
--- /dev/null
+++ b/Tools/scripts/checkpip.py
@@ -0,0 +1,32 @@
+#!/usr/bin/env python3
+"""
+Checks that the version of the projects bundled in ensurepip are the latest
+versions available.
+"""
+import ensurepip
+import json
+import urllib.request
+import sys
+
+
+def main():
+    outofdate = False
+
+    for project, version in ensurepip._PROJECTS:
+        data = json.loads(urllib.request.urlopen(
+            "https://pypi.python.org/pypi/{}/json".format(project),
+            cadefault=True,
+        ).read().decode("utf8"))
+        upstream_version = data["info"]["version"]
+
+        if version != upstream_version:
+            outofdate = True
+            print("The latest version of {} on PyPI is {}, but ensurepip "
+                  "has {}".format(project, upstream_version, version))
+
+    if outofdate:
+        sys.exit(1)
+
+
+if __name__ == "__main__":
+    main()
diff --git a/Tools/scripts/checkpyc.py b/Tools/scripts/checkpyc.py
index d4fdce2..bbaa3d1 100755
--- a/Tools/scripts/checkpyc.py
+++ b/Tools/scripts/checkpyc.py
@@ -5,11 +5,11 @@
 import sys
 import os
 from stat import ST_MTIME
-import imp
+import importlib.util
 
 # PEP 3147 compatibility (PYC Repository Directories)
-cache_from_source = (imp.cache_from_source if hasattr(imp, 'get_tag') else
-                     lambda path: path + 'c')
+cache_from_source = (importlib.util.cache_from_source if sys.implementation.cache_tag
+                     else lambda path: path + 'c')
 
 
 def main():
@@ -18,13 +18,13 @@
         silent = (sys.argv[1] == '-s')
     else:
         verbose = silent = False
-    MAGIC = imp.get_magic()
+    MAGIC = importlib.util.MAGIC_NUMBER
     if not silent:
         print('Using MAGIC word', repr(MAGIC))
     for dirname in sys.path:
         try:
             names = os.listdir(dirname)
-        except os.error:
+        except OSError:
             print('Cannot list directory', repr(dirname))
             continue
         if not silent:
@@ -34,7 +34,7 @@
                 name = os.path.join(dirname, name)
                 try:
                     st = os.stat(name)
-                except os.error:
+                except OSError:
                     print('Cannot stat', repr(name))
                     continue
                 if verbose:
diff --git a/Tools/scripts/copytime.py b/Tools/scripts/copytime.py
index e0220b5..715683f 100755
--- a/Tools/scripts/copytime.py
+++ b/Tools/scripts/copytime.py
@@ -13,12 +13,12 @@
     file1, file2 = sys.argv[1], sys.argv[2]
     try:
         stat1 = os.stat(file1)
-    except os.error:
+    except OSError:
         sys.stderr.write(file1 + ': cannot stat\n')
         sys.exit(1)
     try:
         os.utime(file2, (stat1[ST_ATIME], stat1[ST_MTIME]))
-    except os.error:
+    except OSError:
         sys.stderr.write(file2 + ': cannot change time\n')
         sys.exit(2)
 
diff --git a/Tools/scripts/diff.py b/Tools/scripts/diff.py
index f9b14bf..8be527f 100755
--- a/Tools/scripts/diff.py
+++ b/Tools/scripts/diff.py
@@ -38,9 +38,9 @@
 
     fromdate = file_mtime(fromfile)
     todate = file_mtime(tofile)
-    with open(fromfile, 'U') as ff:
+    with open(fromfile) as ff:
         fromlines = ff.readlines()
-    with open(tofile, 'U') as tf:
+    with open(tofile) as tf:
         tolines = tf.readlines()
 
     if options.u:
diff --git a/Tools/scripts/finddiv.py b/Tools/scripts/finddiv.py
index f24a702..a705f56 100755
--- a/Tools/scripts/finddiv.py
+++ b/Tools/scripts/finddiv.py
@@ -70,7 +70,7 @@
 def processdir(dir, listnames):
     try:
         names = os.listdir(dir)
-    except os.error as msg:
+    except OSError as msg:
         sys.stderr.write("Can't list directory: %s\n" % dir)
         return 1
     files = []
diff --git a/Tools/scripts/findlinksto.py b/Tools/scripts/findlinksto.py
index b4c09ef..b924f27 100755
--- a/Tools/scripts/findlinksto.py
+++ b/Tools/scripts/findlinksto.py
@@ -36,7 +36,7 @@
             linkto = os.readlink(name)
             if prog.search(linkto) is not None:
                 print(name, '->', linkto)
-        except os.error:
+        except OSError:
             pass
 
 if __name__ == '__main__':
diff --git a/Tools/scripts/fixcid.py b/Tools/scripts/fixcid.py
index 87e2a09..1e4c428 100755
--- a/Tools/scripts/fixcid.py
+++ b/Tools/scripts/fixcid.py
@@ -97,7 +97,7 @@
     bad = 0
     try:
         names = os.listdir(dirname)
-    except os.error as msg:
+    except OSError as msg:
         err(dirname + ': cannot list directory: ' + str(msg) + '\n')
         return 1
     names.sort()
@@ -175,17 +175,17 @@
     try:
         statbuf = os.stat(filename)
         os.chmod(tempname, statbuf[ST_MODE] & 0o7777)
-    except os.error as msg:
+    except OSError as msg:
         err(tempname + ': warning: chmod failed (' + str(msg) + ')\n')
     # Then make a backup of the original file as filename~
     try:
         os.rename(filename, filename + '~')
-    except os.error as msg:
+    except OSError as msg:
         err(filename + ': warning: backup failed (' + str(msg) + ')\n')
     # Now move the temp file to the original file
     try:
         os.rename(tempname, filename)
-    except os.error as msg:
+    except OSError as msg:
         err(filename + ': rename failed (' + str(msg) + ')\n')
         return 1
     # Return success
diff --git a/Tools/scripts/gprof2html.py b/Tools/scripts/gprof2html.py
index ad82835..4ca705c 100755
--- a/Tools/scripts/gprof2html.py
+++ b/Tools/scripts/gprof2html.py
@@ -2,7 +2,11 @@
 
 """Transform gprof(1) output into useful HTML."""
 
-import re, os, sys, cgi, webbrowser
+import html
+import os
+import re
+import sys
+import webbrowser
 
 header = """\
 <html>
@@ -22,7 +26,7 @@
 def add_escapes(filename):
     with open(filename) as fp:
         for line in fp:
-            yield cgi.escape(line)
+            yield html.escape(line)
 
 
 def main():
diff --git a/Tools/scripts/highlight.py b/Tools/scripts/highlight.py
index aff5cae..66ad868 100755
--- a/Tools/scripts/highlight.py
+++ b/Tools/scripts/highlight.py
@@ -3,11 +3,12 @@
 
 __author__ = 'Raymond Hettinger'
 
-import keyword, tokenize, cgi, re, functools
-try:
-    import builtins
-except ImportError:
-    import __builtin__ as builtins
+import builtins
+import functools
+import html as html_module
+import keyword
+import re
+import tokenize
 
 #### Analyze Python Source #################################
 
@@ -101,7 +102,7 @@
     for kind, text in classified_text:
         if kind:
             result.append('<span class="%s">' % kind)
-        result.append(cgi.escape(text))
+        result.append(html_module.escape(text))
         if kind:
             result.append('</span>')
     result.append(closer)
@@ -140,7 +141,7 @@
     'Create a complete HTML page with colorized source code'
     css_str = '\n'.join(['%s %s' % item for item in css.items()])
     result = html_highlight(classified_text)
-    title = cgi.escape(title)
+    title = html_module.escape(title)
     return html.format(title=title, css=css_str, body=result)
 
 #### LaTeX Output ##########################################
@@ -193,7 +194,11 @@
 
 
 if __name__ == '__main__':
-    import sys, argparse, webbrowser, os, textwrap
+    import argparse
+    import os.path
+    import sys
+    import textwrap
+    import webbrowser
 
     parser = argparse.ArgumentParser(
             description = 'Add syntax highlighting to Python source code',
diff --git a/Tools/scripts/linktree.py b/Tools/scripts/linktree.py
index 982f480..e83f198 100755
--- a/Tools/scripts/linktree.py
+++ b/Tools/scripts/linktree.py
@@ -32,13 +32,13 @@
         return 1
     try:
         os.mkdir(newtree, 0o777)
-    except os.error as msg:
+    except OSError as msg:
         print(newtree + ': cannot mkdir:', msg)
         return 1
     linkname = os.path.join(newtree, link)
     try:
         os.symlink(os.path.join(os.pardir, oldtree), linkname)
-    except os.error as msg:
+    except OSError as msg:
         if not link_may_fail:
             print(linkname + ': cannot symlink:', msg)
             return 1
@@ -51,7 +51,7 @@
     if debug: print('linknames', (old, new, link))
     try:
         names = os.listdir(old)
-    except os.error as msg:
+    except OSError as msg:
         print(old + ': warning: cannot listdir:', msg)
         return
     for name in names:
diff --git a/Tools/scripts/md5sum.py b/Tools/scripts/md5sum.py
index 521960c..9cf4bdc 100755
--- a/Tools/scripts/md5sum.py
+++ b/Tools/scripts/md5sum.py
@@ -9,7 +9,7 @@
 rmode = 'rb'
 
 usage = """
-usage: sum5 [-b] [-t] [-l] [-s bufsize] [file ...]
+usage: md5sum.py [-b] [-t] [-l] [-s bufsize] [file ...]
 -b        : read files in binary mode (default)
 -t        : read files in text mode (you almost certainly don't want this!)
 -l        : print last pathname component only
@@ -17,6 +17,7 @@
 file ...  : files to sum; '-' or no files means stdin
 """ % bufsize
 
+import io
 import sys
 import os
 import getopt
@@ -24,7 +25,7 @@
 
 def sum(*files):
     sts = 0
-    if files and isinstance(files[-1], file):
+    if files and isinstance(files[-1], io.IOBase):
         out, files = files[-1], files[:-1]
     else:
         out = sys.stdout
@@ -53,12 +54,14 @@
     return sts
 
 def printsumfp(fp, filename, out=sys.stdout):
-    m = md5.new()
+    m = md5()
     try:
         while 1:
             data = fp.read(bufsize)
             if not data:
                 break
+            if isinstance(data, str):
+                data = data.encode(fp.encoding)
             m.update(data)
     except IOError as msg:
         sys.stderr.write('%s: I/O error: %s\n' % (filename, msg))
diff --git a/Tools/scripts/ndiff.py b/Tools/scripts/ndiff.py
index 2422091..c6d09b8 100755
--- a/Tools/scripts/ndiff.py
+++ b/Tools/scripts/ndiff.py
@@ -60,7 +60,7 @@
 # couldn't be opened
 def fopen(fname):
     try:
-        return open(fname, 'U')
+        return open(fname)
     except IOError as detail:
         return fail("couldn't open " + fname + ": " + str(detail))
 
diff --git a/Tools/scripts/parse_html5_entities.py b/Tools/scripts/parse_html5_entities.py
new file mode 100755
index 0000000..c011328
--- /dev/null
+++ b/Tools/scripts/parse_html5_entities.py
@@ -0,0 +1,105 @@
+#!/usr/bin/env python3
+"""
+Utility for parsing HTML5 entity definitions available from:
+
+    http://dev.w3.org/html5/spec/entities.json
+
+Written by Ezio Melotti and Iuliia Proskurnia.
+
+"""
+
+import os
+import sys
+import json
+from urllib.request import urlopen
+from html.entities import html5
+
+entities_url = 'http://dev.w3.org/html5/spec/entities.json'
+
+def get_json(url):
+    """Download the json file from the url and returns a decoded object."""
+    with urlopen(url) as f:
+        data = f.read().decode('utf-8')
+    return json.loads(data)
+
+def create_dict(entities):
+    """Create the html5 dict from the decoded json object."""
+    new_html5 = {}
+    for name, value in entities.items():
+        new_html5[name.lstrip('&')] = value['characters']
+    return new_html5
+
+def compare_dicts(old, new):
+    """Compare the old and new dicts and print the differences."""
+    added = new.keys() - old.keys()
+    if added:
+        print('{} entitie(s) have been added:'.format(len(added)))
+        for name in sorted(added):
+            print('  {!r}: {!r}'.format(name, new[name]))
+    removed = old.keys() - new.keys()
+    if removed:
+        print('{} entitie(s) have been removed:'.format(len(removed)))
+        for name in sorted(removed):
+            print('  {!r}: {!r}'.format(name, old[name]))
+    changed = set()
+    for name in (old.keys() & new.keys()):
+        if old[name] != new[name]:
+            changed.add((name, old[name], new[name]))
+    if changed:
+        print('{} entitie(s) have been modified:'.format(len(changed)))
+        for item in sorted(changed):
+            print('  {!r}: {!r} -> {!r}'.format(*item))
+
+def write_items(entities, file=sys.stdout):
+    """Write the items of the dictionary in the specified file."""
+    # The keys in the generated dictionary should be sorted
+    # in a case-insensitive way, however, when two keys are equal,
+    # the uppercase version should come first so that the result
+    # looks like: ['Aacute', 'aacute', 'Aacute;', 'aacute;', ...]
+    # To do this we first sort in a case-sensitive way (so all the
+    # uppercase chars come first) and then sort with key=str.lower.
+    # Since the sorting is stable the uppercase keys will eventually
+    # be before their equivalent lowercase version.
+    keys = sorted(entities.keys())
+    keys = sorted(keys, key=str.lower)
+    print('html5 = {', file=file)
+    for name in keys:
+        print('    {!r}: {!a},'.format(name, entities[name]), file=file)
+    print('}', file=file)
+
+
+if __name__ == '__main__':
+    # without args print a diff between html.entities.html5 and new_html5
+    # with --create print the new html5 dict
+    # with --patch patch the Lib/html/entities.py file
+    new_html5 = create_dict(get_json(entities_url))
+    if '--create' in sys.argv:
+        print('# map the HTML5 named character references to the '
+              'equivalent Unicode character(s)')
+        print('# Generated by {}.  Do not edit manually.'.format(__file__))
+        write_items(new_html5)
+    elif '--patch' in sys.argv:
+        fname = 'Lib/html/entities.py'
+        temp_fname = fname + '.temp'
+        with open(fname) as f1, open(temp_fname, 'w') as f2:
+            skip = False
+            for line in f1:
+                if line.startswith('html5 = {'):
+                    write_items(new_html5, file=f2)
+                    skip = True
+                    continue
+                if skip:
+                    # skip the old items until the }
+                    if line.startswith('}'):
+                        skip = False
+                    continue
+                f2.write(line)
+        os.remove(fname)
+        os.rename(temp_fname, fname)
+    else:
+        if html5 == new_html5:
+            print('The current dictionary is updated.')
+        else:
+            compare_dicts(html5, new_html5)
+            print('Run "./python {0} --patch" to update Lib/html/entities.html '
+                  'or "./python {0} --create" to see the generated ' 'dictionary.'.format(__file__))
diff --git a/Tools/scripts/patchcheck.py b/Tools/scripts/patchcheck.py
index 6f9821b..1b51520 100755
--- a/Tools/scripts/patchcheck.py
+++ b/Tools/scripts/patchcheck.py
@@ -152,7 +152,8 @@
     file_paths = changed_files()
     python_files = [fn for fn in file_paths if fn.endswith('.py')]
     c_files = [fn for fn in file_paths if fn.endswith(('.c', '.h'))]
-    doc_files = [fn for fn in file_paths if fn.startswith('Doc')]
+    doc_files = [fn for fn in file_paths if fn.startswith('Doc') and
+                 fn.endswith(('.rst', '.inc'))]
     misc_files = {os.path.join('Misc', 'ACKS'), os.path.join('Misc', 'NEWS')}\
             & set(file_paths)
     # PEP 8 whitespace rules enforcement.
diff --git a/Tools/scripts/pathfix.py b/Tools/scripts/pathfix.py
index 13ca866..22432d1 100755
--- a/Tools/scripts/pathfix.py
+++ b/Tools/scripts/pathfix.py
@@ -73,7 +73,7 @@
     bad = 0
     try:
         names = os.listdir(dirname)
-    except os.error as msg:
+    except OSError as msg:
         err('%s: cannot list directory: %r\n' % (dirname, msg))
         return 1
     names.sort()
@@ -131,24 +131,24 @@
         mtime = statbuf.st_mtime
         atime = statbuf.st_atime
         os.chmod(tempname, statbuf[ST_MODE] & 0o7777)
-    except os.error as msg:
+    except OSError as msg:
         err('%s: warning: chmod failed (%r)\n' % (tempname, msg))
     # Then make a backup of the original file as filename~
     try:
         os.rename(filename, filename + '~')
-    except os.error as msg:
+    except OSError as msg:
         err('%s: warning: backup failed (%r)\n' % (filename, msg))
     # Now move the temp file to the original file
     try:
         os.rename(tempname, filename)
-    except os.error as msg:
+    except OSError as msg:
         err('%s: rename failed (%r)\n' % (filename, msg))
         return 1
     if preserve_timestamps:
         if atime and mtime:
             try:
                 os.utime(filename, (atime, mtime))
-            except os.error as msg:
+            except OSError as msg:
                 err('%s: reset of timestamp failed (%r)\n' % (filename, msg))
                 return 1
     # Return success
diff --git a/Tools/scripts/pindent.py b/Tools/scripts/pindent.py
index 2872dc0..3333420 100755
--- a/Tools/scripts/pindent.py
+++ b/Tools/scripts/pindent.py
@@ -376,13 +376,13 @@
     if os.path.lexists(backup):
         try:
             os.remove(backup)
-        except os.error:
+        except OSError:
             print("Can't remove backup %r" % (backup,), file=sys.stderr)
         # end try
     # end if
     try:
         os.rename(filename, backup)
-    except os.error:
+    except OSError:
         print("Can't rename %r to %r" % (filename, backup), file=sys.stderr)
     # end try
 # end def make_backup
diff --git a/Tools/scripts/pydocgui.pyw b/Tools/scripts/pydocgui.pyw
deleted file mode 100644
index 8e9a3d6..0000000
--- a/Tools/scripts/pydocgui.pyw
+++ /dev/null
@@ -1,7 +0,0 @@
-# Note:  this file must not be named pydoc.pyw, lest it just end up
-# importing itself (Python began allowing import of .pyw files
-# between 2.2a1 and 2.2a2).
-import pydoc
-
-if __name__ == '__main__':
-   pydoc.gui()
diff --git a/Tools/scripts/reindent.py b/Tools/scripts/reindent.py
index 4a916ea..18424de 100755
--- a/Tools/scripts/reindent.py
+++ b/Tools/scripts/reindent.py
@@ -52,8 +52,8 @@
 recurse = False
 dryrun = False
 makebackup = True
+# A specified newline to be used in the output (set by --newline option)
 spec_newline = None
-"""A specified newline to be used in the output (set by --newline option)"""
 
 
 def usage(msg=None):
diff --git a/Tools/scripts/treesync.py b/Tools/scripts/treesync.py
index b2649c4..652d394 100755
--- a/Tools/scripts/treesync.py
+++ b/Tools/scripts/treesync.py
@@ -78,7 +78,7 @@
         print("creating slave directory", slave)
         try:
             os.mkdir(slave)
-        except os.error as msg:
+        except OSError as msg:
             print("can't make slave directory", slave, ":", msg)
             return
         else:
diff --git a/Tools/scripts/untabify.py b/Tools/scripts/untabify.py
index 4b67c15..861c83c 100755
--- a/Tools/scripts/untabify.py
+++ b/Tools/scripts/untabify.py
@@ -39,11 +39,11 @@
     backup = filename + "~"
     try:
         os.unlink(backup)
-    except os.error:
+    except OSError:
         pass
     try:
         os.rename(filename, backup)
-    except os.error:
+    except OSError:
         pass
     with open(filename, "w", encoding=encoding) as f:
         f.write(newtext)
diff --git a/Tools/scripts/which.py b/Tools/scripts/which.py
index 4fc37a0..df54ce0 100755
--- a/Tools/scripts/which.py
+++ b/Tools/scripts/which.py
@@ -29,7 +29,7 @@
             filename = os.path.join(dir, prog)
             try:
                 st = os.stat(filename)
-            except os.error:
+            except OSError:
                 continue
             if not S_ISREG(st[ST_MODE]):
                 msg(filename + ': not a disk file')
diff --git a/Tools/scripts/win_add2path.py b/Tools/scripts/win_add2path.py
index 9259b44..c85bea5 100644
--- a/Tools/scripts/win_add2path.py
+++ b/Tools/scripts/win_add2path.py
@@ -30,7 +30,7 @@
     with winreg.CreateKey(HKCU, ENV) as key:
         try:
             envpath = winreg.QueryValueEx(key, PATH)[0]
-        except WindowsError:
+        except OSError:
             envpath = DEFAULT
 
         paths = [envpath]
diff --git a/Tools/ssl/make_ssl_data.py b/Tools/ssl/make_ssl_data.py
index 10244d1..3fb4985 100755
--- a/Tools/ssl/make_ssl_data.py
+++ b/Tools/ssl/make_ssl_data.py
@@ -5,8 +5,7 @@
 `library` and `reason` mnemnonics to a more recent OpenSSL version.
 
 It takes two arguments:
-- the path to the OpenSSL include files' directory
-  (e.g. openssl-1.0.1-beta3/include/openssl/)
+- the path to the OpenSSL source tree (e.g. git checkout)
 - the path to the C file to be generated
   (probably Modules/_ssl_data.h)
 """
@@ -15,9 +14,10 @@
 import os
 import re
 import sys
+import _ssl
 
 
-def parse_error_codes(h_file, prefix):
+def parse_error_codes(h_file, prefix, libcode):
     pat = re.compile(r"#define\W+(%s([\w]+))\W+(\d+)\b" % re.escape(prefix))
     codes = []
     with open(h_file, "r", encoding="latin1") as f:
@@ -26,7 +26,8 @@
             if match:
                 code, name, num = match.groups()
                 num = int(num)
-                codes.append((code, name, num))
+                # e.g. ("SSL_R_BAD_DATA", ("ERR_LIB_SSL", "BAD_DATA", 390))
+                codes.append((code, (libcode, name, num)))
     return codes
 
 if __name__ == "__main__":
@@ -34,12 +35,32 @@
     outfile = sys.argv[2]
     use_stdout = outfile == '-'
     f = sys.stdout if use_stdout else open(outfile, "w")
-    error_libraries = (
-        # (library code, mnemonic, error prefix, header file)
-        ('ERR_LIB_PEM', 'PEM', 'PEM_R_', 'pem.h'),
-        ('ERR_LIB_SSL', 'SSL', 'SSL_R_', 'ssl.h'),
-        ('ERR_LIB_X509', 'X509', 'X509_R_', 'x509.h'),
-        )
+    error_libraries = {
+        # mnemonic -> (library code, error prefix, header file)
+        'PEM': ('ERR_LIB_PEM', 'PEM_R_', 'crypto/pem/pem.h'),
+        'SSL': ('ERR_LIB_SSL', 'SSL_R_', 'ssl/ssl.h'),
+        'X509': ('ERR_LIB_X509', 'X509_R_', 'crypto/x509/x509.h'),
+        }
+
+    # Read codes from libraries
+    new_codes = []
+    for libcode, prefix, h_file in sorted(error_libraries.values()):
+        new_codes += parse_error_codes(os.path.join(openssl_inc, h_file),
+                                       prefix, libcode)
+    new_code_nums = set((libcode, num)
+                        for (code, (libcode, name, num)) in new_codes)
+
+    # Merge with existing codes (in case some old codes disappeared).
+    codes = {}
+    for errname, (libnum, errnum) in _ssl.err_names_to_codes.items():
+        lib = error_libraries[_ssl.lib_codes_to_names[libnum]]
+        libcode = lib[0]              # e.g. ERR_LIB_PEM
+        errcode = lib[1] + errname    # e.g. SSL_R_BAD_SSL_SESSION_ID_LENGTH
+        # Only keep it if the numeric codes weren't reused
+        if (libcode, errnum) not in new_code_nums:
+            codes[errcode] = libcode, errname, errnum
+    codes.update(dict(new_codes))
+
     def w(l):
         f.write(l + "\n")
     w("/* File generated by Tools/ssl/make_ssl_data.py */")
@@ -47,21 +68,19 @@
     w("")
 
     w("static struct py_ssl_library_code library_codes[] = {")
-    for libcode, mnemo, _, _ in error_libraries:
+    for mnemo, (libcode, _, _) in sorted(error_libraries.items()):
         w('    {"%s", %s},' % (mnemo, libcode))
     w('    { NULL }')
     w('};')
     w("")
 
     w("static struct py_ssl_error_code error_codes[] = {")
-    for libcode, _, prefix, h_file in error_libraries:
-        codes = parse_error_codes(os.path.join(openssl_inc, h_file), prefix)
-        for code, name, num in sorted(codes):
-            w('  #ifdef %s' % (code))
-            w('    {"%s", %s, %s},' % (name, libcode, code))
-            w('  #else')
-            w('    {"%s", %s, %d},' % (name, libcode, num))
-            w('  #endif')
+    for errcode, (libcode, name, num) in sorted(codes.items()):
+        w('  #ifdef %s' % (errcode))
+        w('    {"%s", %s, %s},' % (name, libcode, errcode))
+        w('  #else')
+        w('    {"%s", %s, %d},' % (name, libcode, num))
+        w('  #endif')
     w('    { NULL }')
     w('};')
     if not use_stdout:
diff --git a/Tools/ssl/test_multiple_versions.py b/Tools/ssl/test_multiple_versions.py
new file mode 100644
index 0000000..dd57dcf
--- /dev/null
+++ b/Tools/ssl/test_multiple_versions.py
@@ -0,0 +1,241 @@
+#./python
+"""Run Python tests with multiple installations of OpenSSL
+
+The script
+
+  (1) downloads OpenSSL tar bundle
+  (2) extracts it to ../openssl/src/openssl-VERSION/
+  (3) compiles OpenSSL
+  (4) installs OpenSSL into ../openssl/VERSION/
+  (5) forces a recompilation of Python modules using the
+      header and library files from ../openssl/VERSION/
+  (6) runs Python's test suite
+
+The script must be run with Python's build directory as current working
+directory:
+
+    ./python Tools/ssl/test_multiple_versions.py
+
+The script uses LD_RUN_PATH, LD_LIBRARY_PATH, CPPFLAGS and LDFLAGS to bend
+search paths for header files and shared libraries. It's known to work on
+Linux with GCC 4.x.
+
+(c) 2013 Christian Heimes <christian@python.org>
+"""
+import logging
+import os
+import tarfile
+import shutil
+import subprocess
+import sys
+from urllib.request import urlopen
+
+log = logging.getLogger("multissl")
+
+OPENSSL_VERSIONS = [
+    "0.9.7m", "0.9.8i", "0.9.8l", "0.9.8m", "0.9.8y", "1.0.0k", "1.0.1e"
+]
+FULL_TESTS = [
+    "test_asyncio", "test_ftplib", "test_hashlib", "test_httplib",
+    "test_imaplib", "test_nntplib", "test_poplib", "test_smtplib",
+    "test_smtpnet", "test_urllib2_localnet", "test_venv"
+]
+MINIMAL_TESTS = ["test_ssl", "test_hashlib"]
+CADEFAULT = True
+HERE = os.path.abspath(os.getcwd())
+DEST_DIR = os.path.abspath(os.path.join(HERE, os.pardir, "openssl"))
+
+
+class BuildSSL:
+    url_template = "https://www.openssl.org/source/openssl-{}.tar.gz"
+
+    module_files = ["Modules/_ssl.c",
+                    "Modules/socketmodule.c",
+                    "Modules/_hashopenssl.c"]
+
+    def __init__(self, version, openssl_compile_args=(), destdir=DEST_DIR):
+        self._check_python_builddir()
+        self.version = version
+        self.openssl_compile_args = openssl_compile_args
+        # installation directory
+        self.install_dir = os.path.join(destdir, version)
+        # source file
+        self.src_file = os.path.join(destdir, "src",
+                                     "openssl-{}.tar.gz".format(version))
+        # build directory (removed after install)
+        self.build_dir = os.path.join(destdir, "src",
+                                      "openssl-{}".format(version))
+
+    @property
+    def openssl_cli(self):
+        """openssl CLI binary"""
+        return os.path.join(self.install_dir, "bin", "openssl")
+
+    @property
+    def openssl_version(self):
+        """output of 'bin/openssl version'"""
+        env = os.environ.copy()
+        env["LD_LIBRARY_PATH"] = self.lib_dir
+        cmd = [self.openssl_cli, "version"]
+        return self._subprocess_output(cmd, env=env)
+
+    @property
+    def pyssl_version(self):
+        """Value of ssl.OPENSSL_VERSION"""
+        env = os.environ.copy()
+        env["LD_LIBRARY_PATH"] = self.lib_dir
+        cmd = ["./python", "-c", "import ssl; print(ssl.OPENSSL_VERSION)"]
+        return self._subprocess_output(cmd, env=env)
+
+    @property
+    def include_dir(self):
+        return os.path.join(self.install_dir, "include")
+
+    @property
+    def lib_dir(self):
+        return os.path.join(self.install_dir, "lib")
+
+    @property
+    def has_openssl(self):
+        return os.path.isfile(self.openssl_cli)
+
+    @property
+    def has_src(self):
+        return os.path.isfile(self.src_file)
+
+    def _subprocess_call(self, cmd, stdout=subprocess.DEVNULL, env=None,
+                         **kwargs):
+        log.debug("Call '{}'".format(" ".join(cmd)))
+        return subprocess.check_call(cmd, stdout=stdout, env=env, **kwargs)
+
+    def _subprocess_output(self, cmd, env=None, **kwargs):
+        log.debug("Call '{}'".format(" ".join(cmd)))
+        out = subprocess.check_output(cmd, env=env)
+        return out.strip().decode("utf-8")
+
+    def _check_python_builddir(self):
+        if not os.path.isfile("python") or not os.path.isfile("setup.py"):
+            raise ValueError("Script must be run in Python build directory")
+
+    def _download_openssl(self):
+        """Download OpenSSL source dist"""
+        src_dir = os.path.dirname(self.src_file)
+        if not os.path.isdir(src_dir):
+            os.makedirs(src_dir)
+        url = self.url_template.format(self.version)
+        log.info("Downloading OpenSSL from {}".format(url))
+        req = urlopen(url, cadefault=CADEFAULT)
+        # KISS, read all, write all
+        data = req.read()
+        log.info("Storing {}".format(self.src_file))
+        with open(self.src_file, "wb") as f:
+            f.write(data)
+
+    def _unpack_openssl(self):
+        """Unpack tar.gz bundle"""
+        # cleanup
+        if os.path.isdir(self.build_dir):
+            shutil.rmtree(self.build_dir)
+        os.makedirs(self.build_dir)
+
+        tf = tarfile.open(self.src_file)
+        base = "openssl-{}/".format(self.version)
+        # force extraction into build dir
+        members = tf.getmembers()
+        for member in members:
+            if not member.name.startswith(base):
+                raise ValueError(member.name)
+            member.name = member.name[len(base):]
+        log.info("Unpacking files to {}".format(self.build_dir))
+        tf.extractall(self.build_dir, members)
+
+    def _build_openssl(self):
+        """Now build openssl"""
+        log.info("Running build in {}".format(self.install_dir))
+        cwd = self.build_dir
+        cmd = ["./config", "shared", "--prefix={}".format(self.install_dir)]
+        cmd.extend(self.openssl_compile_args)
+        self._subprocess_call(cmd, cwd=cwd)
+        self._subprocess_call(["make"], cwd=cwd)
+
+    def _install_openssl(self, remove=True):
+        self._subprocess_call(["make", "install"], cwd=self.build_dir)
+        if remove:
+            shutil.rmtree(self.build_dir)
+
+    def install_openssl(self):
+        if not self.has_openssl:
+            if not self.has_src:
+                self._download_openssl()
+            else:
+                log.debug("Already has src {}".format(self.src_file))
+            self._unpack_openssl()
+            self._build_openssl()
+            self._install_openssl()
+        else:
+            log.info("Already has installation {}".format(self.install_dir))
+        # validate installation
+        version = self.openssl_version
+        if self.version not in version:
+            raise ValueError(version)
+
+    def touch_pymods(self):
+        # force a rebuild of all modules that use OpenSSL APIs
+        for fname in self.module_files:
+            os.utime(fname)
+
+    def recompile_pymods(self):
+        log.info("Using OpenSSL build from {}".format(self.build_dir))
+        # overwrite header and library search paths
+        env = os.environ.copy()
+        env["CPPFLAGS"] = "-I{}".format(self.include_dir)
+        env["LDFLAGS"] = "-L{}".format(self.lib_dir)
+        # set rpath
+        env["LD_RUN_PATH"] = self.lib_dir
+
+        log.info("Rebuilding Python modules")
+        self.touch_pymods()
+        cmd = ["./python", "setup.py", "build"]
+        self._subprocess_call(cmd, env=env)
+
+    def check_pyssl(self):
+        version = self.pyssl_version
+        if self.version not in version:
+            raise ValueError(version)
+
+    def run_pytests(self, *args):
+        cmd = ["./python", "-m", "test"]
+        cmd.extend(args)
+        self._subprocess_call(cmd, stdout=None)
+
+    def run_python_tests(self, *args):
+        self.recompile_pymods()
+        self.check_pyssl()
+        self.run_pytests(*args)
+
+
+def main(*args):
+    builders = []
+    for version in OPENSSL_VERSIONS:
+        if version in ("0.9.8i", "0.9.8l"):
+            openssl_compile_args = ("no-asm",)
+        else:
+            openssl_compile_args = ()
+        builder = BuildSSL(version, openssl_compile_args)
+        builder.install_openssl()
+        builders.append(builder)
+
+    for builder in builders:
+        builder.run_python_tests(*args)
+    # final touch
+    builder.touch_pymods()
+
+
+if __name__ == "__main__":
+    logging.basicConfig(level=logging.INFO,
+                        format="*** %(levelname)s %(message)s")
+    args = sys.argv[1:]
+    if not args:
+        args = ["-unetwork", "-v"]
+        args.extend(FULL_TESTS)
+    main(*args)
diff --git a/Tools/stringbench/stringbench.py b/Tools/stringbench/stringbench.py
index 142b3ca..5abc25a 100644
--- a/Tools/stringbench/stringbench.py
+++ b/Tools/stringbench/stringbench.py
@@ -808,7 +808,7 @@
 programmers report substantial productivity gains and feel the language
 encourages the development of higher quality, more maintainable code.
 
-Python runs on Windows, Linux/Unix, Mac OS X, OS/2, Amiga, Palm
+Python runs on Windows, Linux/Unix, Mac OS X, Amiga, Palm
 Handhelds, and Nokia mobile phones. Python has also been ported to the
 Java and .NET virtual machines.
 
diff --git a/Tools/unicode/gencodec.py b/Tools/unicode/gencodec.py
index f5a1af3..98b3975 100644
--- a/Tools/unicode/gencodec.py
+++ b/Tools/unicode/gencodec.py
@@ -34,7 +34,7 @@
 # Standard undefined Unicode code point
 UNI_UNDEFINED = chr(0xFFFE)
 
-# Placeholder for a missing codepoint
+# Placeholder for a missing code point
 MISSING_CODE = -1
 
 mapRE = re.compile('((?:0x[0-9a-fA-F]+\+?)+)'
@@ -290,27 +290,27 @@
 
 class Codec(codecs.Codec):
 
-    def encode(self,input,errors='strict'):
-        return codecs.charmap_encode(input,errors,encoding_%s)
+    def encode(self, input, errors='strict'):
+        return codecs.charmap_encode(input, errors, encoding_%s)
 
-    def decode(self,input,errors='strict'):
-        return codecs.charmap_decode(input,errors,decoding_%s)
+    def decode(self, input, errors='strict'):
+        return codecs.charmap_decode(input, errors, decoding_%s)
 ''' % (encodingname, name, suffix, suffix)]
     l.append('''\
 class IncrementalEncoder(codecs.IncrementalEncoder):
     def encode(self, input, final=False):
-        return codecs.charmap_encode(input,self.errors,encoding_%s)[0]
+        return codecs.charmap_encode(input, self.errors, encoding_%s)[0]
 
 class IncrementalDecoder(codecs.IncrementalDecoder):
     def decode(self, input, final=False):
-        return codecs.charmap_decode(input,self.errors,decoding_%s)[0]''' %
+        return codecs.charmap_decode(input, self.errors, decoding_%s)[0]''' %
         (suffix, suffix))
 
     l.append('''
-class StreamWriter(Codec,codecs.StreamWriter):
+class StreamWriter(Codec, codecs.StreamWriter):
     pass
 
-class StreamReader(Codec,codecs.StreamReader):
+class StreamReader(Codec, codecs.StreamReader):
     pass
 
 ### encodings module API
@@ -343,7 +343,7 @@
     if decoding_table_code:
         l.append('''
 ### Encoding table
-encoding_table=codecs.charmap_build(decoding_table)
+encoding_table = codecs.charmap_build(decoding_table)
 ''')
     else:
         l.append('''
diff --git a/Tools/unicode/makeunicodedata.py b/Tools/unicode/makeunicodedata.py
index bc3d0cb..7636a95 100644
--- a/Tools/unicode/makeunicodedata.py
+++ b/Tools/unicode/makeunicodedata.py
@@ -37,7 +37,12 @@
 VERSION = "3.2"
 
 # The Unicode Database
-UNIDATA_VERSION = "6.1.0"
+# --------------------
+# When changing UCD version please update
+#   * Doc/library/stdtypes.rst, and
+#   * Doc/library/unicodedata.rst
+#   * Doc/reference/lexical_analysis.rst (two occurrences)
+UNIDATA_VERSION = "6.3.0"
 UNICODE_DATA = "UnicodeData%s.txt"
 COMPOSITION_EXCLUSIONS = "CompositionExclusions%s.txt"
 EASTASIAN_WIDTH = "EastAsianWidth%s.txt"
@@ -68,7 +73,7 @@
 
 BIDIRECTIONAL_NAMES = [ "", "L", "LRE", "LRO", "R", "AL", "RLE", "RLO",
     "PDF", "EN", "ES", "ET", "AN", "CS", "NSM", "BN", "B", "S", "WS",
-    "ON" ]
+    "ON", "LRI", "RLI", "FSI", "PDI" ]
 
 EASTASIANWIDTH_NAMES = [ "F", "H", "W", "Na", "A", "N" ]
 
@@ -552,7 +557,7 @@
     print("/* Returns 1 for Unicode characters having the bidirectional", file=fp)
     print(" * type 'WS', 'B' or 'S' or the category 'Zs', 0 otherwise.", file=fp)
     print(" */", file=fp)
-    print('int _PyUnicode_IsWhitespace(register const Py_UCS4 ch)', file=fp)
+    print('int _PyUnicode_IsWhitespace(const Py_UCS4 ch)', file=fp)
     print('{', file=fp)
     print('    switch (ch) {', file=fp)
 
@@ -570,7 +575,7 @@
     print(" * property 'BK', 'CR', 'LF' or 'NL' or having bidirectional", file=fp)
     print(" * type 'B', 0 otherwise.", file=fp)
     print(" */", file=fp)
-    print('int _PyUnicode_IsLinebreak(register const Py_UCS4 ch)', file=fp)
+    print('int _PyUnicode_IsLinebreak(const Py_UCS4 ch)', file=fp)
     print('{', file=fp)
     print('    switch (ch) {', file=fp)
     for codepoint in sorted(linebreaks):
diff --git a/Tools/unicode/python-mappings/CP273.TXT b/Tools/unicode/python-mappings/CP273.TXT
new file mode 100644
index 0000000..7bb5e18
--- /dev/null
+++ b/Tools/unicode/python-mappings/CP273.TXT
@@ -0,0 +1,258 @@
+0x00	0x0000	#NULL (NUL)
+0x01	0x0001	#START OF HEADING (SOH)
+0x02	0x0002	#START OF TEXT (STX)
+0x03	0x0003	#END OF TEXT (ETX)
+0x04	0x009C	#STRING TERMINATOR (ST)
+0x05	0x0009	#CHARACTER TABULATION (HT)
+0x06	0x0086	#START OF SELECTED AREA (SSA)
+0x07	0x007F	#DELETE (DEL)
+0x08	0x0097	#END OF GUARDED AREA (EPA)
+0x09	0x008D	#REVERSE LINE FEED (RI)
+0x0A	0x008E	#SINGLE-SHIFT TWO (SS2)
+0x0B	0x000B	#LINE TABULATION (VT)
+0x0C	0x000C	#FORM FEED (FF)
+0x0D	0x000D	#CARRIAGE RETURN (CR)
+0x0E	0x000E	#SHIFT OUT (SO)
+0x0F	0x000F	#SHIFT IN (SI)
+0x10	0x0010	#DATALINK ESCAPE (DLE)
+0x11	0x0011	#DEVICE CONTROL ONE (DC1)
+0x12	0x0012	#DEVICE CONTROL TWO (DC2)
+0x13	0x0013	#DEVICE CONTROL THREE (DC3)
+0x14	0x009D	#OPERATING SYSTEM COMMAND (OSC)
+0x15	0x0085	#NEXT LINE (NEL)
+0x16	0x0008	#BACKSPACE (BS)
+0x17	0x0087	#END OF SELECTED AREA (ESA)
+0x18	0x0018	#CANCEL (CAN)
+0x19	0x0019	#END OF MEDIUM (EM)
+0x1A	0x0092	#PRIVATE USE TWO (PU2)
+0x1B	0x008F	#SINGLE-SHIFT THREE (SS3)
+0x1C	0x001C	#FILE SEPARATOR (IS4)
+0x1D	0x001D	#GROUP SEPARATOR (IS3)
+0x1E	0x001E	#RECORD SEPARATOR (IS2)
+0x1F	0x001F	#UNIT SEPARATOR (IS1)
+0x20	0x0080	#PADDING CHARACTER (PAD)
+0x21	0x0081	#HIGH OCTET PRESET (HOP)
+0x22	0x0082	#BREAK PERMITTED HERE (BPH)
+0x23	0x0083	#NO BREAK HERE (NBH)
+0x24	0x0084	#INDEX (IND)
+0x25	0x000A	#LINE FEED (LF)
+0x26	0x0017	#END OF TRANSMISSION BLOCK (ETB)
+0x27	0x001B	#ESCAPE (ESC)
+0x28	0x0088	#CHARACTER TABULATION SET (HTS)
+0x29	0x0089	#CHARACTER TABULATION WITH JUSTIFICATION (HTJ)
+0x2A	0x008A	#LINE TABULATION SET (VTS)
+0x2B	0x008B	#PARTIAL LINE FORWARD (PLD)
+0x2C	0x008C	#PARTIAL LINE BACKWARD (PLU)
+0x2D	0x0005	#ENQUIRY (ENQ)
+0x2E	0x0006	#ACKNOWLEDGE (ACK)
+0x2F	0x0007	#BELL (BEL)
+0x30	0x0090	#DEVICE CONTROL STRING (DCS)
+0x31	0x0091	#PRIVATE USE ONE (PU1)
+0x32	0x0016	#SYNCHRONOUS IDLE (SYN)
+0x33	0x0093	#SET TRANSMIT STATE (STS)
+0x34	0x0094	#CANCEL CHARACTER (CCH)
+0x35	0x0095	#MESSAGE WAITING (MW)
+0x36	0x0096	#START OF GUARDED AREA (SPA)
+0x37	0x0004	#END OF TRANSMISSION (EOT)
+0x38	0x0098	#START OF STRING (SOS)
+0x39	0x0099	#SINGLE GRAPHIC CHARACTER INTRODUCER (SGCI)
+0x3A	0x009A	#SINGLE CHARACTER INTRODUCER (SCI)
+0x3B	0x009B	#CONTROL SEQUENCE INTRODUCER (CSI)
+0x3C	0x0014	#DEVICE CONTROL FOUR (DC4)
+0x3D	0x0015	#NEGATIVE ACKNOWLEDGE (NAK)
+0x3E	0x009E	#PRIVACY MESSAGE (PM)
+0x3F	0x001A	#SUBSTITUTE (SUB)
+0x40	0x0020	#SPACE
+0x41	0x00A0	#NO-BREAK SPACE
+0x42	0x00E2	#LATIN SMALL LETTER A WITH CIRCUMFLEX
+0x43	0x007B	#LEFT CURLY BRACKET
+0x44	0x00E0	#LATIN SMALL LETTER A WITH GRAVE
+0x45	0x00E1	#LATIN SMALL LETTER A WITH ACUTE
+0x46	0x00E3	#LATIN SMALL LETTER A WITH TILDE
+0x47	0x00E5	#LATIN SMALL LETTER A WITH RING ABOVE
+0x48	0x00E7	#LATIN SMALL LETTER C WITH CEDILLA
+0x49	0x00F1	#LATIN SMALL LETTER N WITH TILDE
+0x4A	0x00C4	#LATIN CAPITAL LETTER A WITH DIAERESIS
+0x4B	0x002E	#FULL STOP
+0x4C	0x003C	#LESS-THAN SIGN
+0x4D	0x0028	#LEFT PARENTHESIS
+0x4E	0x002B	#PLUS SIGN
+0x4F	0x0021	#EXCLAMATION MARK
+0x50	0x0026	#AMPERSAND
+0x51	0x00E9	#LATIN SMALL LETTER E WITH ACUTE
+0x52	0x00EA	#LATIN SMALL LETTER E WITH CIRCUMFLEX
+0x53	0x00EB	#LATIN SMALL LETTER E WITH DIAERESIS
+0x54	0x00E8	#LATIN SMALL LETTER E WITH GRAVE
+0x55	0x00ED	#LATIN SMALL LETTER I WITH ACUTE
+0x56	0x00EE	#LATIN SMALL LETTER I WITH CIRCUMFLEX
+0x57	0x00EF	#LATIN SMALL LETTER I WITH DIAERESIS
+0x58	0x00EC	#LATIN SMALL LETTER I WITH GRAVE
+0x59	0x007E	#TILDE
+0x5A	0x00DC	#LATIN CAPITAL LETTER U WITH DIAERESIS
+0x5B	0x0024	#DOLLAR SIGN
+0x5C	0x002A	#ASTERISK
+0x5D	0x0029	#RIGHT PARENTHESIS
+0x5E	0x003B	#SEMICOLON
+0x5F	0x005E	#CIRCUMFLEX ACCENT
+0x60	0x002D	#HYPHEN-MINUS
+0x61	0x002F	#SOLIDUS
+0x62	0x00C2	#LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+0x63	0x005B	#LEFT SQUARE BRACKET
+0x64	0x00C0	#LATIN CAPITAL LETTER A WITH GRAVE
+0x65	0x00C1	#LATIN CAPITAL LETTER A WITH ACUTE
+0x66	0x00C3	#LATIN CAPITAL LETTER A WITH TILDE
+0x67	0x00C5	#LATIN CAPITAL LETTER A WITH RING ABOVE
+0x68	0x00C7	#LATIN CAPITAL LETTER C WITH CEDILLA
+0x69	0x00D1	#LATIN CAPITAL LETTER N WITH TILDE
+0x6A	0x00F6	#LATIN SMALL LETTER O WITH DIAERESIS
+0x6B	0x002C	#COMMA
+0x6C	0x0025	#PERCENT SIGN
+0x6D	0x005F	#LOW LINE
+0x6E	0x003E	#GREATER-THAN SIGN
+0x6F	0x003F	#QUESTION MARK
+0x70	0x00F8	#LATIN SMALL LETTER O WITH STROKE
+0x71	0x00C9	#LATIN CAPITAL LETTER E WITH ACUTE
+0x72	0x00CA	#LATIN CAPITAL LETTER E WITH CIRCUMFLEX
+0x73	0x00CB	#LATIN CAPITAL LETTER E WITH DIAERESIS
+0x74	0x00C8	#LATIN CAPITAL LETTER E WITH GRAVE
+0x75	0x00CD	#LATIN CAPITAL LETTER I WITH ACUTE
+0x76	0x00CE	#LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+0x77	0x00CF	#LATIN CAPITAL LETTER I WITH DIAERESIS
+0x78	0x00CC	#LATIN CAPITAL LETTER I WITH GRAVE
+0x79	0x0060	#GRAVE ACCENT
+0x7A	0x003A	#COLON
+0x7B	0x0023	#NUMBER SIGN
+0x7C	0x00A7	#SECTION SIGN
+0x7D	0x0027	#APOSTROPHE
+0x7E	0x003D	#EQUALS SIGN
+0x7F	0x0022	#QUOTATION MARK
+0x80	0x00D8	#LATIN CAPITAL LETTER O WITH STROKE
+0x81	0x0061	#LATIN SMALL LETTER A
+0x82	0x0062	#LATIN SMALL LETTER B
+0x83	0x0063	#LATIN SMALL LETTER C
+0x84	0x0064	#LATIN SMALL LETTER D
+0x85	0x0065	#LATIN SMALL LETTER E
+0x86	0x0066	#LATIN SMALL LETTER F
+0x87	0x0067	#LATIN SMALL LETTER G
+0x88	0x0068	#LATIN SMALL LETTER H
+0x89	0x0069	#LATIN SMALL LETTER I
+0x8A	0x00AB	#LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+0x8B	0x00BB	#RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+0x8C	0x00F0	#LATIN SMALL LETTER ETH (Icelandic)
+0x8D	0x00FD	#LATIN SMALL LETTER Y WITH ACUTE
+0x8E	0x00FE	#LATIN SMALL LETTER THORN (Icelandic)
+0x8F	0x00B1	#PLUS-MINUS SIGN
+0x90	0x00B0	#DEGREE SIGN
+0x91	0x006A	#LATIN SMALL LETTER J
+0x92	0x006B	#LATIN SMALL LETTER K
+0x93	0x006C	#LATIN SMALL LETTER L
+0x94	0x006D	#LATIN SMALL LETTER M
+0x95	0x006E	#LATIN SMALL LETTER N
+0x96	0x006F	#LATIN SMALL LETTER O
+0x97	0x0070	#LATIN SMALL LETTER P
+0x98	0x0071	#LATIN SMALL LETTER Q
+0x99	0x0072	#LATIN SMALL LETTER R
+0x9A	0x00AA	#FEMININE ORDINAL INDICATOR
+0x9B	0x00BA	#MASCULINE ORDINAL INDICATOR
+0x9C	0x00E6	#LATIN SMALL LETTER AE
+0x9D	0x00B8	#CEDILLA
+0x9E	0x00C6	#LATIN CAPITAL LETTER AE
+0x9F	0x00A4	#CURRENCY SIGN
+0xA0	0x00B5	#MICRO SIGN
+0xA1	0x00DF	#LATIN SMALL LETTER SHARP S (German)
+0xA2	0x0073	#LATIN SMALL LETTER S
+0xA3	0x0074	#LATIN SMALL LETTER T
+0xA4	0x0075	#LATIN SMALL LETTER U
+0xA5	0x0076	#LATIN SMALL LETTER V
+0xA6	0x0077	#LATIN SMALL LETTER W
+0xA7	0x0078	#LATIN SMALL LETTER X
+0xA8	0x0079	#LATIN SMALL LETTER Y
+0xA9	0x007A	#LATIN SMALL LETTER Z
+0xAA	0x00A1	#INVERTED EXCLAMATION MARK
+0xAB	0x00BF	#INVERTED QUESTION MARK
+0xAC	0x00D0	#LATIN CAPITAL LETTER ETH (Icelandic)
+0xAD	0x00DD	#LATIN CAPITAL LETTER Y WITH ACUTE
+0xAE	0x00DE	#LATIN CAPITAL LETTER THORN (Icelandic)
+0xAF	0x00AE	#REGISTERED SIGN
+0xB0	0x00A2	#CENT SIGN
+0xB1	0x00A3	#POUND SIGN
+0xB2	0x00A5	#YEN SIGN
+0xB3	0x00B7	#MIDDLE DOT
+0xB4	0x00A9	#COPYRIGHT SIGN
+0xB5	0x0040	#COMMERCIAL AT
+0xB6	0x00B6	#PILCROW SIGN
+0xB7	0x00BC	#VULGAR FRACTION ONE QUARTER
+0xB8	0x00BD	#VULGAR FRACTION ONE HALF
+0xB9	0x00BE	#VULGAR FRACTION THREE QUARTERS
+0xBA	0x00AC	#NOT SIGN
+0xBB	0x007C	#VERTICAL LINE
+0xBC	0x203E	#OVERLINE
+0xBD	0x00A8	#DIAERESIS
+0xBE	0x00B4	#ACUTE ACCENT
+0xBF	0x00D7	#MULTIPLICATION SIGN
+0xC0	0x00E4	#LATIN SMALL LETTER A WITH DIAERESIS
+0xC1	0x0041	#LATIN CAPITAL LETTER A
+0xC2	0x0042	#LATIN CAPITAL LETTER B
+0xC3	0x0043	#LATIN CAPITAL LETTER C
+0xC4	0x0044	#LATIN CAPITAL LETTER D
+0xC5	0x0045	#LATIN CAPITAL LETTER E
+0xC6	0x0046	#LATIN CAPITAL LETTER F
+0xC7	0x0047	#LATIN CAPITAL LETTER G
+0xC8	0x0048	#LATIN CAPITAL LETTER H
+0xC9	0x0049	#LATIN CAPITAL LETTER I
+0xCA	0x00AD	#SOFT HYPHEN
+0xCB	0x00F4	#LATIN SMALL LETTER O WITH CIRCUMFLEX
+0xCC	0x00A6	#BROKEN BAR
+0xCD	0x00F2	#LATIN SMALL LETTER O WITH GRAVE
+0xCE	0x00F3	#LATIN SMALL LETTER O WITH ACUTE
+0xCF	0x00F5	#LATIN SMALL LETTER O WITH TILDE
+0xD0	0x00FC	#LATIN SMALL LETTER U WITH DIAERESIS
+0xD1	0x004A	#LATIN CAPITAL LETTER J
+0xD2	0x004B	#LATIN CAPITAL LETTER K
+0xD3	0x004C	#LATIN CAPITAL LETTER L
+0xD4	0x004D	#LATIN CAPITAL LETTER M
+0xD5	0x004E	#LATIN CAPITAL LETTER N
+0xD6	0x004F	#LATIN CAPITAL LETTER O
+0xD7	0x0050	#LATIN CAPITAL LETTER P
+0xD8	0x0051	#LATIN CAPITAL LETTER Q
+0xD9	0x0052	#LATIN CAPITAL LETTER R
+0xDA	0x00B9	#SUPERSCRIPT ONE
+0xDB	0x00FB	#LATIN SMALL LETTER U WITH CIRCUMFLEX
+0xDC	0x007D	#RIGHT CURLY BRACKET
+0xDD	0x00F9	#LATIN SMALL LETTER U WITH GRAVE
+0xDE	0x00FA	#LATIN SMALL LETTER U WITH ACUTE
+0xDF	0x00FF	#LATIN SMALL LETTER Y WITH DIAERESIS
+0xE0	0x00D6	#LATIN CAPITAL LETTER O WITH DIAERESIS
+0xE1	0x00F7	#DIVISION SIGN
+0xE2	0x0053	#LATIN CAPITAL LETTER S
+0xE3	0x0054	#LATIN CAPITAL LETTER T
+0xE4	0x0055	#LATIN CAPITAL LETTER U
+0xE5	0x0056	#LATIN CAPITAL LETTER V
+0xE6	0x0057	#LATIN CAPITAL LETTER W
+0xE7	0x0058	#LATIN CAPITAL LETTER X
+0xE8	0x0059	#LATIN CAPITAL LETTER Y
+0xE9	0x005A	#LATIN CAPITAL LETTER Z
+0xEA	0x00B2	#SUPERSCRIPT TWO
+0xEB	0x00D4	#LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+0xEC	0x005C	#REVERSE SOLIDUS
+0xED	0x00D2	#LATIN CAPITAL LETTER O WITH GRAVE
+0xEE	0x00D3	#LATIN CAPITAL LETTER O WITH ACUTE
+0xEF	0x00D5	#LATIN CAPITAL LETTER O WITH TILDE
+0xF0	0x0030	#DIGIT ZERO
+0xF1	0x0031	#DIGIT ONE
+0xF2	0x0032	#DIGIT TWO
+0xF3	0x0033	#DIGIT THREE
+0xF4	0x0034	#DIGIT FOUR
+0xF5	0x0035	#DIGIT FIVE
+0xF6	0x0036	#DIGIT SIX
+0xF7	0x0037	#DIGIT SEVEN
+0xF8	0x0038	#DIGIT EIGHT
+0xF9	0x0039	#DIGIT NINE
+0xFA	0x00B3	#SUPERSCRIPT THREE
+0xFB	0x00DB	#LATIN CAPITAL LETTER U WITH CIRCUMFLEX
+0xFC	0x005D	#RIGHT SQUARE BRACKET
+0xFD	0x00D9	#LATIN CAPITAL LETTER U WITH GRAVE
+0xFE	0x00DA	#LATIN CAPITAL LETTER U WITH ACUTE
+0xFF	0x009F	#APPLICATION PROGRAM COMMAND (APC)
+
+ 	  	 
diff --git a/config.guess b/config.guess
index b79252d..1f5c50c 100755
--- a/config.guess
+++ b/config.guess
@@ -1,8 +1,8 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright 1992-2013 Free Software Foundation, Inc.
+#   Copyright 1992-2014 Free Software Foundation, Inc.
 
-timestamp='2013-06-10'
+timestamp='2014-03-23'
 
 # 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
@@ -50,7 +50,7 @@
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright 1992-2013 Free Software Foundation, Inc.
+Copyright 1992-2014 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."
@@ -149,7 +149,7 @@
 	LIBC=gnu
 	#endif
 	EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
 	;;
 esac
 
@@ -826,7 +826,7 @@
     *:MINGW*:*)
 	echo ${UNAME_MACHINE}-pc-mingw32
 	exit ;;
-    i*:MSYS*:*)
+    *:MSYS*:*)
 	echo ${UNAME_MACHINE}-pc-msys
 	exit ;;
     i*:windows32*:*)
@@ -969,10 +969,10 @@
 	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
 	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
 	;;
-    or1k:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+    openrisc*:Linux:*:*)
+	echo or1k-unknown-linux-${LIBC}
 	exit ;;
-    or32:Linux:*:*)
+    or32:Linux:*:* | or1k*:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     padre:Linux:*:*)
@@ -1260,16 +1260,26 @@
 	if test "$UNAME_PROCESSOR" = unknown ; then
 	    UNAME_PROCESSOR=powerpc
 	fi
-	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
-	    if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
-		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
-		grep IS_64BIT_ARCH >/dev/null
-	    then
-		case $UNAME_PROCESSOR in
-		    i386) UNAME_PROCESSOR=x86_64 ;;
-		    powerpc) UNAME_PROCESSOR=powerpc64 ;;
-		esac
+	if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
+	    if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+		if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+		    (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+		    grep IS_64BIT_ARCH >/dev/null
+		then
+		    case $UNAME_PROCESSOR in
+			i386) UNAME_PROCESSOR=x86_64 ;;
+			powerpc) UNAME_PROCESSOR=powerpc64 ;;
+		    esac
+		fi
 	    fi
+	elif test "$UNAME_PROCESSOR" = i386 ; then
+	    # Avoid executing cc on OS X 10.9, as it ships with a stub
+	    # that puts up a graphical alert prompting to install
+	    # developer tools.  Any system running Mac OS X 10.7 or
+	    # later (Darwin 11 and later) is required to have a 64-bit
+	    # processor. This is not true of the ARM version of Darwin
+	    # that Apple uses in portable devices.
+	    UNAME_PROCESSOR=x86_64
 	fi
 	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
 	exit ;;
@@ -1361,154 +1371,6 @@
 	exit ;;
 esac
 
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
-  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
-     I don't know....  */
-  printf ("mips-sony-bsd\n"); exit (0);
-#else
-#include <sys/param.h>
-  printf ("m68k-sony-newsos%s\n",
-#ifdef NEWSOS4
-	"4"
-#else
-	""
-#endif
-	); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
-  printf ("arm-acorn-riscix\n"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
-  printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
-  int version;
-  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
-  if (version < 4)
-    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
-  else
-    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
-  exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
-  printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
-  printf ("ns32k-encore-mach\n"); exit (0);
-#else
-  printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
-  printf ("i386-pc-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
-  printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
-  printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
-    struct utsname un;
-
-    uname(&un);
-
-    if (strncmp(un.version, "V2", 2) == 0) {
-	printf ("i386-sequent-ptx2\n"); exit (0);
-    }
-    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
-	printf ("i386-sequent-ptx1\n"); exit (0);
-    }
-    printf ("i386-sequent-ptx\n"); exit (0);
-
-#endif
-
-#if defined (vax)
-# if !defined (ultrix)
-#  include <sys/param.h>
-#  if defined (BSD)
-#   if BSD == 43
-      printf ("vax-dec-bsd4.3\n"); exit (0);
-#   else
-#    if BSD == 199006
-      printf ("vax-dec-bsd4.3reno\n"); exit (0);
-#    else
-      printf ("vax-dec-bsd\n"); exit (0);
-#    endif
-#   endif
-#  else
-    printf ("vax-dec-bsd\n"); exit (0);
-#  endif
-# else
-    printf ("vax-dec-ultrix\n"); exit (0);
-# endif
-#endif
-
-#if defined (alliant) && defined (i860)
-  printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
-  exit (1);
-}
-EOF
-
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
-	{ echo "$SYSTEM_NAME"; exit; }
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
-    case `getsysinfo -f cpu_type` in
-    c1*)
-	echo c1-convex-bsd
-	exit ;;
-    c2*)
-	if getsysinfo -f scalar_acc
-	then echo c32-convex-bsd
-	else echo c2-convex-bsd
-	fi
-	exit ;;
-    c34*)
-	echo c34-convex-bsd
-	exit ;;
-    c38*)
-	echo c38-convex-bsd
-	exit ;;
-    c4*)
-	echo c4-convex-bsd
-	exit ;;
-    esac
-fi
-
 cat >&2 <<EOF
 $0: unable to guess system type
 
diff --git a/config.sub b/config.sub
index 9633db7..d654d03 100755
--- a/config.sub
+++ b/config.sub
@@ -1,8 +1,8 @@
 #! /bin/sh
 # Configuration validation subroutine script.
-#   Copyright 1992-2013 Free Software Foundation, Inc.
+#   Copyright 1992-2014 Free Software Foundation, Inc.
 
-timestamp='2013-08-10'
+timestamp='2014-05-01'
 
 # 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
@@ -68,7 +68,7 @@
 version="\
 GNU config.sub ($timestamp)
 
-Copyright 1992-2013 Free Software Foundation, Inc.
+Copyright 1992-2014 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."
@@ -265,6 +265,7 @@
 	| hexagon \
 	| i370 | i860 | i960 | ia64 \
 	| ip2k | iq2000 \
+	| k1om \
 	| le32 | le64 \
 	| lm32 \
 	| m32c | m32r | m32rle | m68000 | m68k | m88k \
@@ -282,8 +283,10 @@
 	| mips64vr5900 | mips64vr5900el \
 	| mipsisa32 | mipsisa32el \
 	| mipsisa32r2 | mipsisa32r2el \
+	| mipsisa32r6 | mipsisa32r6el \
 	| mipsisa64 | mipsisa64el \
 	| mipsisa64r2 | mipsisa64r2el \
+	| mipsisa64r6 | mipsisa64r6el \
 	| mipsisa64sb1 | mipsisa64sb1el \
 	| mipsisa64sr71k | mipsisa64sr71kel \
 	| mipsr5900 | mipsr5900el \
@@ -295,8 +298,7 @@
 	| nds32 | nds32le | nds32be \
 	| nios | nios2 | nios2eb | nios2el \
 	| ns16k | ns32k \
-	| open8 \
-	| or1k | or32 \
+	| open8 | or1k | or1knd | or32 \
 	| pdp10 | pdp11 | pj | pjl \
 	| powerpc | powerpc64 | powerpc64le | powerpcle \
 	| pyramid \
@@ -324,7 +326,7 @@
 	c6x)
 		basic_machine=tic6x-unknown
 		;;
-	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
+	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
 		basic_machine=$basic_machine-unknown
 		os=-none
 		;;
@@ -381,6 +383,7 @@
 	| hexagon-* \
 	| i*86-* | i860-* | i960-* | ia64-* \
 	| ip2k-* | iq2000-* \
+	| k1om-* \
 	| le32-* | le64-* \
 	| lm32-* \
 	| m32c-* | m32r-* | m32rle-* \
@@ -400,8 +403,10 @@
 	| mips64vr5900-* | mips64vr5900el-* \
 	| mipsisa32-* | mipsisa32el-* \
 	| mipsisa32r2-* | mipsisa32r2el-* \
+	| mipsisa32r6-* | mipsisa32r6el-* \
 	| mipsisa64-* | mipsisa64el-* \
 	| mipsisa64r2-* | mipsisa64r2el-* \
+	| mipsisa64r6-* | mipsisa64r6el-* \
 	| mipsisa64sb1-* | mipsisa64sb1el-* \
 	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
 	| mipsr5900-* | mipsr5900el-* \
@@ -413,6 +418,7 @@
 	| nios-* | nios2-* | nios2eb-* | nios2el-* \
 	| none-* | np1-* | ns16k-* | ns32k-* \
 	| open8-* \
+	| or1k*-* \
 	| orion-* \
 	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
 	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
@@ -1374,7 +1380,7 @@
 	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
 	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
 	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
-	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
+	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
 	# Remember, each alternative MUST END IN *, to match a version number.
 		;;
 	-qnx*)
@@ -1592,9 +1598,6 @@
 	mips*-*)
 		os=-elf
 		;;
-	or1k-*)
-		os=-elf
-		;;
 	or32-*)
 		os=-coff
 		;;
diff --git a/configure b/configure
index c278c8e..274af7e 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for python 3.3.
+# Generated by GNU Autoconf 2.69 for python 3.4.
 #
 # Report bugs to <http://bugs.python.org/>.
 #
@@ -580,8 +580,8 @@
 # Identity of this package.
 PACKAGE_NAME='python'
 PACKAGE_TARNAME='python'
-PACKAGE_VERSION='3.3'
-PACKAGE_STRING='python 3.3'
+PACKAGE_VERSION='3.4'
+PACKAGE_STRING='python 3.4'
 PACKAGE_BUGREPORT='http://bugs.python.org/'
 PACKAGE_URL=''
 
@@ -623,8 +623,11 @@
 #endif"
 
 ac_subst_vars='LTLIBOBJS
+ENSUREPIP
 SRCDIRS
 THREADHEADERS
+LIBPL
+PY_ENABLE_SHARED
 EXT_SUFFIX
 SOABI
 LIBC
@@ -647,6 +650,8 @@
 TCLTK_LIBS
 TCLTK_INCLUDES
 LIBFFI_INCLUDEDIR
+PKG_CONFIG_LIBDIR
+PKG_CONFIG_PATH
 PKG_CONFIG
 SHLIBS
 CFLAGSFORSHARED
@@ -659,6 +664,7 @@
 LIBTOOL_CRUFT
 OTHER_LIBTOOL_OPT
 UNIVERSAL_ARCH_FLAGS
+CFLAGS_NODIST
 BASECFLAGS
 OPT
 ABIFLAGS
@@ -710,6 +716,7 @@
 MACHDEP
 FRAMEWORKINSTALLAPPSPREFIX
 FRAMEWORKUNIXTOOLSPREFIX
+FRAMEWORKPYTHONW
 FRAMEWORKALTINSTALLLAST
 FRAMEWORKALTINSTALLFIRST
 FRAMEWORKINSTALLLAST
@@ -790,6 +797,7 @@
 enable_shared
 enable_profiling
 with_pydebug
+with_hash_algorithm
 with_libs
 with_system_expat
 with_system_ffi
@@ -811,6 +819,7 @@
 with_libc
 enable_big_digits
 with_computed_gotos
+with_ensurepip
 '
       ac_precious_vars='build_alias
 host_alias
@@ -821,7 +830,10 @@
 LDFLAGS
 LIBS
 CPPFLAGS
-CPP'
+CPP
+PKG_CONFIG
+PKG_CONFIG_PATH
+PKG_CONFIG_LIBDIR'
 
 
 # Initialize some variables set by options.
@@ -1362,7 +1374,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures python 3.3 to adapt to many kinds of systems.
+\`configure' configures python 3.4 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1427,7 +1439,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of python 3.3:";;
+     short | recursive ) echo "Configuration of python 3.4:";;
    esac
   cat <<\_ACEOF
 
@@ -1453,7 +1465,7 @@
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
   --with-universal-archs=ARCH
                           select architectures for universal build ("32-bit",
-                          "64-bit", "3-way", "intel" or "all")
+                          "64-bit", "3-way", "intel", "intel-32", or "all")
   --with-framework-name=FRAMEWORK
                           specify an alternate name of the framework built
                           with --enable-framework
@@ -1463,6 +1475,8 @@
                           compiler
   --with-suffix=.exe      set executable suffix
   --with-pydebug          build with Py_DEBUG defined
+  --with-hash-algorithm=[fnv|siphash24]
+                          select hash algorithm
   --with-libs='lib1 ...'  link against additional libs
   --with-system-expat     build pyexpat module using an installed expat
                           library
@@ -1492,6 +1506,8 @@
   --with(out)-computed-gotos
                           Use computed gotos in evaluation loop (enabled by
                           default on supported compilers)
+  --with(out)-ensurepip=[=upgrade]
+                          "install" or "upgrade" using bundled pip
 
 Some influential environment variables:
   MACHDEP     name for machine-dependent library files
@@ -1503,6 +1519,11 @@
   CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
               you have headers in a nonstandard directory <include dir>
   CPP         C preprocessor
+  PKG_CONFIG  path to pkg-config utility
+  PKG_CONFIG_PATH
+              directories to add to pkg-config's search path
+  PKG_CONFIG_LIBDIR
+              path overriding pkg-config's built-in search path
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
@@ -1570,7 +1591,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-python configure 3.3
+python configure 3.4
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2409,7 +2430,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by python $as_me 3.3, which was
+It was created by python $as_me 3.4, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2939,6 +2960,9 @@
 
 
 
+# pybuilddir.txt will be created by --generate-posix-vars in the Makefile
+rm -f pybuilddir.txt
+
 if test "$cross_compiling" = yes; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python interpreter for cross build" >&5
 $as_echo_n "checking for python interpreter for cross build... " >&6; }
@@ -2979,7 +3003,7 @@
 mv confdefs.h.new confdefs.h
 
 
-VERSION=3.3
+VERSION=3.4
 
 # Version number of Python's own shared library file.
 
@@ -3035,7 +3059,7 @@
 		# Locate the best usable SDK, see Mac/README.txt for more
 		# information
 		enableval="`/usr/bin/xcodebuild -version -sdk macosx Path 2>/dev/null`"
-		if test -z "${enableval}"
+		if ! ( echo $enableval | grep -E '\.sdk' 1>/dev/null )
 		then
 			enableval=/Developer/SDKs/MacOSX10.4u.sdk
 			if test ! -d "${enableval}"
@@ -3078,6 +3102,7 @@
 
 
 
+ARCH_RUN_32BIT=""
 
 # For backward compatibility reasons we prefer to select '32-bit' if available,
 # otherwise use 'intel'
@@ -3086,7 +3111,7 @@
 then
 	if test -n "${UNIVERSALSDK}"
 	then
-		if test -z "`/usr/bin/file "${UNIVERSALSDK}/usr/lib/libSystem.dylib" | grep ppc`"
+		if test -z "`/usr/bin/file -L "${UNIVERSALSDK}/usr/lib/libSystem.dylib" | grep ppc`"
 		then
 			UNIVERSAL_ARCHS="intel"
 		fi
@@ -3100,19 +3125,18 @@
 # Check whether --with-universal-archs was given.
 if test "${with_universal_archs+set}" = set; then :
   withval=$with_universal_archs;
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $withval" >&5
-$as_echo "$withval" >&6; }
 	UNIVERSAL_ARCHS="$withval"
 
-else
-
- 	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${UNIVERSAL_ARCHS}" >&5
-$as_echo "${UNIVERSAL_ARCHS}" >&6; }
-
 fi
 
-
-
+if test -n "${UNIVERSALSDK}"
+then
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${UNIVERSAL_ARCHS}" >&5
+$as_echo "${UNIVERSAL_ARCHS}" >&6; }
+else
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
 
 # Check whether --with-framework-name was given.
@@ -3147,6 +3171,7 @@
 		FRAMEWORKINSTALLLAST=
 		FRAMEWORKALTINSTALLFIRST=
 		FRAMEWORKALTINSTALLLAST=
+		FRAMEWORKPYTHONW=
 		if test "x${prefix}" = "xNONE"; then
 			FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
 		else
@@ -3161,6 +3186,7 @@
 		FRAMEWORKALTINSTALLFIRST="frameworkinstallstructure "
 		FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools"
 		FRAMEWORKALTINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkaltinstallunixtools"
+		FRAMEWORKPYTHONW="frameworkpythonw"
 		FRAMEWORKINSTALLAPPSPREFIX="/Applications"
 
 		if test "x${prefix}" = "xNONE" ; then
@@ -3228,6 +3254,7 @@
 	FRAMEWORKINSTALLLAST=
 	FRAMEWORKALTINSTALLFIRST=
 	FRAMEWORKALTINSTALLLAST=
+	FRAMEWORKPYTHONW=
 	if test "x${prefix}" = "xNONE" ; then
 		FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
 	else
@@ -3250,6 +3277,7 @@
 
 
 
+
 ##AC_ARG_WITH(dyld,
 ##            AS_HELP_STRING([--with-dyld],
 ##                           [Use (OpenStep|Rhapsody) dynamic linker]))
@@ -3431,6 +3459,21 @@
 
 fi
 
+# On HP-UX mbstate_t requires _INCLUDE__STDC_A1_SOURCE
+case $ac_sys_system in
+  hp*|HP*)
+    define_stdc_a1=yes;;
+  *)
+    define_stdc_a1=no;;
+esac
+
+if test $define_stdc_a1 = yes
+then
+
+$as_echo "#define _INCLUDE__STDC_A1_SOURCE 1" >>confdefs.h
+
+fi
+
 #
 # SGI compilers allow the specification of the both the ABI and the
 # ISA on the command line.  Depending on the values of these switches,
@@ -4801,16 +4844,16 @@
 fi
 if test "$preset_cxx" != "$CXX"
 then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
+        { $as_echo "$as_me:${as_lineno-$LINENO}:
 
   By default, distutils will build C++ extension modules with \"$CXX\".
   If this is not intended, then set CXX on the configure command line.
   " >&5
-$as_echo "$as_me: WARNING:
+$as_echo "$as_me:
 
   By default, distutils will build C++ extension modules with \"$CXX\".
   If this is not intended, then set CXX on the configure command line.
-  " >&2;}
+  " >&6;}
 fi
 
 
@@ -5584,6 +5627,7 @@
 
 # Other platforms follow
 if test $enable_shared = "yes"; then
+  PY_ENABLE_SHARED=1
 
 $as_echo "#define Py_ENABLE_SHARED 1" >>confdefs.h
 
@@ -5632,7 +5676,7 @@
     Darwin*)
     	LDLIBRARY='libpython$(LDVERSION).dylib'
 	BLDLIBRARY='-L. -lpython$(LDVERSION)'
-	RUNSHARED='DYLD_LIBRARY_PATH=`pwd`${DYLD_LIBRARY_PATH:+:${DYLD_LIBRARY_PATH}}'
+	RUNSHARED=DYLD_LIBRARY_PATH=`pwd`${DYLD_LIBRARY_PATH:+:${DYLD_LIBRARY_PATH}}
 	;;
     AIX*)
 	LDLIBRARY='libpython$(LDVERSION).so'
@@ -5641,6 +5685,7 @@
 
   esac
 else # shared is disabled
+  PY_ENABLE_SHARED=0
   case $ac_sys_system in
     CYGWIN*)
           BLDLIBRARY='$(LIBRARY)'
@@ -6261,6 +6306,7 @@
 
 
 
+
 # The -arch flags for universal builds on OSX
 UNIVERSAL_ARCH_FLAGS=
 
@@ -6381,6 +6427,49 @@
       BASECFLAGS="$BASECFLAGS -Wno-unused-result"
     fi
 
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Werror=declaration-after-statement" >&5
+$as_echo_n "checking for -Werror=declaration-after-statement... " >&6; }
+     ac_save_cc="$CC"
+     CC="$CC -Werror=declaration-after-statement"
+     save_CFLAGS="$CFLAGS"
+     if ${ac_cv_declaration_after_statement_warning+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+           ac_cv_declaration_after_statement_warning=yes
+
+else
+
+           ac_cv_declaration_after_statement_warning=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+     CFLAGS="$save_CFLAGS"
+     CC="$ac_save_cc"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_declaration_after_statement_warning" >&5
+$as_echo "$ac_cv_declaration_after_statement_warning" >&6; }
+
+    if test $ac_cv_declaration_after_statement_warning = yes
+    then
+      CFLAGS_NODIST="$CFLAGS_NODIST -Werror=declaration-after-statement"
+    fi
+
     # if using gcc on alpha, use -mieee to get (near) full IEEE 754
     # support.  Without this, treatment of subnormals doesn't follow
     # the standard.
@@ -6394,113 +6483,130 @@
 	SCO_SV*)
 	    BASECFLAGS="$BASECFLAGS -m486 -DSCO5"
 	    ;;
-	# is there any other compiler on Darwin besides gcc?
-	Darwin*)
-	    # -Wno-long-double, -no-cpp-precomp, and -mno-fused-madd
-	    # used to be here, but non-Apple gcc doesn't accept them.
-            if test "${CC}" = gcc
-	    then
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which compiler should be used" >&5
+
+    # is there any other compiler on Darwin besides gcc?
+    Darwin*)
+        # -Wno-long-double, -no-cpp-precomp, and -mno-fused-madd
+        # used to be here, but non-Apple gcc doesn't accept them.
+        if test "${CC}" = gcc
+        then
+            { $as_echo "$as_me:${as_lineno-$LINENO}: checking which compiler should be used" >&5
 $as_echo_n "checking which compiler should be used... " >&6; }
-		case "${UNIVERSALSDK}" in
-		*/MacOSX10.4u.sdk)
-			# Build using 10.4 SDK, force usage of gcc when the
-			# compiler is gcc, otherwise the user will get very
-			# confusing error messages when building on OSX 10.6
-			CC=gcc-4.0
-			CPP=cpp-4.0
-			;;
-		esac
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+            case "${UNIVERSALSDK}" in
+            */MacOSX10.4u.sdk)
+                # Build using 10.4 SDK, force usage of gcc when the
+                # compiler is gcc, otherwise the user will get very
+                # confusing error messages when building on OSX 10.6
+                CC=gcc-4.0
+                CPP=cpp-4.0
+                ;;
+            esac
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
 $as_echo "$CC" >&6; }
-	    fi
+        fi
 
+        if test "${enable_universalsdk}"
+        then
+            case "$UNIVERSAL_ARCHS" in
+            32-bit)
+               UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386"
+               LIPO_32BIT_FLAGS=""
+               ARCH_RUN_32BIT=""
+               ;;
+            64-bit)
+               UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64"
+               LIPO_32BIT_FLAGS=""
+               ARCH_RUN_32BIT="true"
+               ;;
+            all)
+               UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch ppc64 -arch x86_64"
+               LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
+               ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
+               ;;
+            intel)
+               UNIVERSAL_ARCH_FLAGS="-arch i386 -arch x86_64"
+               LIPO_32BIT_FLAGS="-extract i386"
+               ARCH_RUN_32BIT="/usr/bin/arch -i386"
+               ;;
+            intel-32)
+               UNIVERSAL_ARCH_FLAGS="-arch i386"
+               LIPO_32BIT_FLAGS=""
+               ARCH_RUN_32BIT=""
+               ;;
+            3-way)
+               UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch x86_64"
+               LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
+               ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
+               ;;
+            *)
+               as_fn_error $? "proper usage is --with-universal-arch=32-bit|64-bit|all|intel|3-way" "$LINENO" 5
+               ;;
+            esac
 
-	    if test "${enable_universalsdk}"; then
-		UNIVERSAL_ARCH_FLAGS=""
-	        if test "$UNIVERSAL_ARCHS" = "32-bit" ; then
-		   UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386"
-		   ARCH_RUN_32BIT=""
-		   LIPO_32BIT_FLAGS=""
-	         elif test "$UNIVERSAL_ARCHS" = "64-bit" ; then
-		   UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64"
-		   LIPO_32BIT_FLAGS=""
-		   ARCH_RUN_32BIT="true"
+            CFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${CFLAGS}"
+            LDFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${LDFLAGS}"
+            if test "${UNIVERSALSDK}" != "/"
+            then
+                CPPFLAGS="-isysroot ${UNIVERSALSDK} ${CPPFLAGS}"
+            fi
+        fi
 
-	         elif test "$UNIVERSAL_ARCHS" = "all" ; then
-		   UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch ppc64 -arch x86_64"
-		   LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
-		   ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
+        # Calculate an appropriate deployment target for this build:
+        # The deployment target value is used explicitly to enable certain
+        # features are enabled (such as builtin libedit support for readline)
+        # through the use of Apple's Availabiliy Macros and is used as a
+        # component of the string returned by distutils.get_platform().
+        #
+        # Use the value from:
+        # 1. the MACOSX_DEPLOYMENT_TARGET environment variable if specified
+        # 2. the operating system version of the build machine if >= 10.6
+        # 3. If running on OS X 10.3 through 10.5, use the legacy tests
+        #       below to pick either 10.3, 10.4, or 10.5 as the target.
+        # 4. If we are running on OS X 10.2 or earlier, good luck!
 
-	         elif test "$UNIVERSAL_ARCHS" = "intel" ; then
-		   UNIVERSAL_ARCH_FLAGS="-arch i386 -arch x86_64"
-		   LIPO_32BIT_FLAGS="-extract i386"
-		   ARCH_RUN_32BIT="/usr/bin/arch -i386"
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking which MACOSX_DEPLOYMENT_TARGET to use" >&5
+$as_echo_n "checking which MACOSX_DEPLOYMENT_TARGET to use... " >&6; }
+        cur_target_major=`sw_vers -productVersion | \
+                sed 's/\([0-9]*\)\.\([0-9]*\).*/\1/'`
+        cur_target_minor=`sw_vers -productVersion | \
+                sed 's/\([0-9]*\)\.\([0-9]*\).*/\2/'`
+        cur_target="${cur_target_major}.${cur_target_minor}"
+        if test ${cur_target_major} -eq 10 && \
+           test ${cur_target_minor} -ge 3 && \
+           test ${cur_target_minor} -le 5
+        then
+            # OS X 10.3 through 10.5
+            cur_target=10.3
+            if test ${enable_universalsdk}
+            then
+                case "$UNIVERSAL_ARCHS" in
+                all|3-way|intel|64-bit)
+                    # These configurations were first supported in 10.5
+                    cur_target='10.5'
+                    ;;
+                esac
+            else
+                if test `/usr/bin/arch` = "i386"
+                then
+                    # 10.4 was the first release to support Intel archs
+                    cur_target="10.4"
+                fi
+            fi
+        fi
+        CONFIGURE_MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET-${cur_target}}
 
-	         elif test "$UNIVERSAL_ARCHS" = "3-way" ; then
-		   UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch x86_64"
-		   LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
-		   ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
+        # Make sure that MACOSX_DEPLOYMENT_TARGET is set in the
+        # environment with a value that is the same as what we'll use
+        # in the Makefile to ensure that we'll get the same compiler
+        # environment during configure and build time.
+        MACOSX_DEPLOYMENT_TARGET="$CONFIGURE_MACOSX_DEPLOYMENT_TARGET"
+        export MACOSX_DEPLOYMENT_TARGET
+        EXPORT_MACOSX_DEPLOYMENT_TARGET=''
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MACOSX_DEPLOYMENT_TARGET" >&5
+$as_echo "$MACOSX_DEPLOYMENT_TARGET" >&6; }
 
-		 else
-	           as_fn_error $? "proper usage is --with-universal-arch=32-bit|64-bit|all|intel|3-way" "$LINENO" 5
-
-		 fi
-
-
-		CFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${CFLAGS}"
-		if test "${UNIVERSALSDK}" != "/"
-		then
-			CFLAGS="-isysroot ${UNIVERSALSDK} ${CFLAGS}"
-			LDFLAGS="-isysroot ${UNIVERSALSDK} ${LDFLAGS}"
-			CPPFLAGS="-isysroot ${UNIVERSALSDK} ${CPPFLAGS}"
-		fi
-	    fi
-
-	    # Calculate the right deployment target for this build.
-	    #
-	    cur_target=`sw_vers -productVersion | sed 's/\(10\.[0-9]*\).*/\1/'`
-	    if test ${cur_target} '>' 10.2 && \
-	       test ${cur_target} '<' 10.6
-	    then
-		    cur_target=10.3
-		    if test ${enable_universalsdk}; then
-			    if test "${UNIVERSAL_ARCHS}" = "all"; then
-				    # Ensure that the default platform for a
-				    # 4-way universal build is OSX 10.5,
-				    # that's the first OS release where
-				    # 4-way builds make sense.
-				    cur_target='10.5'
-
-			    elif test "${UNIVERSAL_ARCHS}" = "3-way"; then
-				    cur_target='10.5'
-
-			    elif test "${UNIVERSAL_ARCHS}" = "intel"; then
-				    cur_target='10.5'
-
-			    elif test "${UNIVERSAL_ARCHS}" = "64-bit"; then
-				    cur_target='10.5'
-			    fi
-		    else
-			    if test `/usr/bin/arch` = "i386"; then
-				    # On Intel macs default to a deployment
-				    # target of 10.4, that's the first OSX
-				    # release with Intel support.
-				    cur_target="10.4"
-			    fi
-		    fi
-	    fi
-	    CONFIGURE_MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET-${cur_target}}
-
-	    # Make sure that MACOSX_DEPLOYMENT_TARGET is set in the
-	    # environment with a value that is the same as what we'll use
-	    # in the Makefile to ensure that we'll get the same compiler
-	    # environment during configure and build time.
-	    MACOSX_DEPLOYMENT_TARGET="$CONFIGURE_MACOSX_DEPLOYMENT_TARGET"
-	    export MACOSX_DEPLOYMENT_TARGET
-	    EXPORT_MACOSX_DEPLOYMENT_TARGET=''
-
-	    ;;
+        # end of Darwin* tests
+        ;;
     esac
     ;;
 
@@ -6527,44 +6633,6 @@
 	BASECFLAGS="$BASECFLAGS $ac_arch_flags"
 fi
 
-# Check whether GCC supports PyArg_ParseTuple format
-if test "$GCC" = "yes"
-then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc supports ParseTuple __format__" >&5
-$as_echo_n "checking whether gcc supports ParseTuple __format__... " >&6; }
-  save_CFLAGS=$CFLAGS
-  CFLAGS="$CFLAGS -Werror -Wformat"
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-    void f(char*,...)__attribute((format(PyArg_ParseTuple, 1, 2)));
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-
-$as_echo "#define HAVE_ATTRIBUTE_FORMAT_PARSETUPLE 1" >>confdefs.h
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-else
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  CFLAGS=$save_CFLAGS
-fi
-
 # On some compilers, pthreads are available without further options
 # (e.g. MacOS X). On some of these systems, the compiler will not
 # complain if unaccepted options are passed (e.g. gcc on Mac OS X).
@@ -6922,11 +6990,9 @@
 
 fi
 
-ac_save_cppflags="$CPPFLAGS"
-CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
-for ac_header in asm/types.h conio.h curses.h direct.h dlfcn.h errno.h \
+for ac_header in 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 \
@@ -6936,7 +7002,8 @@
 sys/stat.h sys/syscall.h sys/sys_domain.h sys/termio.h sys/time.h \
 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 alloca.h
+bluetooth/bluetooth.h linux/tipc.h spawn.h util.h alloca.h endian.h \
+sys/endian.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -6949,7 +7016,6 @@
 
 done
 
-CPPFLAGS=$ac_save_cppflags
 ac_header_dirent=no
 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
   as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
@@ -7186,26 +7252,6 @@
 done
 
 
-
-# On Solaris, term.h requires curses.h
-for ac_header in term.h
-do :
-  ac_fn_c_check_header_compile "$LINENO" "term.h" "ac_cv_header_term_h" "
-#ifdef HAVE_CURSES_H
-#include <curses.h>
-#endif
-
-"
-if test "x$ac_cv_header_term_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_TERM_H 1
-_ACEOF
-
-fi
-
-done
-
-
 # On Linux, netlink.h requires asm/types.h
 for ac_header in linux/netlink.h
 do :
@@ -7229,7 +7275,7 @@
 
 
 # On Linux, can.h and can/raw.h require sys/socket.h
-for ac_header in linux/can.h linux/can/raw.h
+for ac_header in linux/can.h linux/can/raw.h linux/can/bcm.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "
@@ -7310,6 +7356,43 @@
 
 fi
 
+# byte swapping
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for le64toh" >&5
+$as_echo_n "checking for le64toh... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_ENDIAN_H
+#include <endian.h>
+#elif defined(HAVE_SYS_ENDIAN_H)
+#include <sys/endian.h>
+#endif
+
+int
+main ()
+{
+
+   le64toh(1)
+  ;
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_has_le64toh=yes
+else
+  ac_cv_has_le64toh=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_has_le64toh" >&5
+$as_echo "$ac_cv_has_le64toh" >&6; }
+if test "$ac_cv_has_le64toh" = "yes"; then
+
+$as_echo "#define HAVE_HTOLE64 1" >>confdefs.h
+
+fi
+
 # Enabling LFS on Solaris (2.6 to 9) with gcc 2.95 triggers a bug in
 # the system headers: If _XOPEN_SOURCE and _LARGEFILE_SOURCE are
 # defined, but the compiler does not support pragma redefine_extname,
@@ -8276,7 +8359,6 @@
 esac
 
 
-ARCH_RUN_32BIT=""
 
 case $ac_sys_system/$ac_sys_release in
   Darwin/[01567]\..*)
@@ -8348,14 +8430,12 @@
     		;;
     	esac
 
-	#ARCH_RUN_32BIT="true"
     fi
 
     LIBTOOL_CRUFT=$LIBTOOL_CRUFT" -lSystem -lSystemStubs -arch_only ${MACOSX_DEFAULT_ARCH}"
     LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
     LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
 esac
-
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-framework" >&5
 $as_echo_n "checking for --enable-framework... " >&6; }
 if test "$enable_framework"
@@ -8481,15 +8561,14 @@
 		# Use -undefined dynamic_lookup whenever possible (10.3 and later).
 		# This allows an extension to be used in any Python
 
-		if test ${MACOSX_DEPLOYMENT_TARGET} '>' 10.2
+		dep_target_major=`echo ${MACOSX_DEPLOYMENT_TARGET} | \
+				sed 's/\([0-9]*\)\.\([0-9]*\).*/\1/'`
+		dep_target_minor=`echo ${MACOSX_DEPLOYMENT_TARGET} | \
+				sed 's/\([0-9]*\)\.\([0-9]*\).*/\2/'`
+		if test ${dep_target_major} -eq 10 && \
+		   test ${dep_target_minor} -le 2
 		then
-			if test "${enable_universalsdk}"; then
-				LDFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${LDFLAGS}"
-			fi
-			LDSHARED='$(CC) -bundle -undefined dynamic_lookup'
-			LDCXXSHARED='$(CXX) -bundle -undefined dynamic_lookup'
-			BLDSHARED="$LDSHARED"
-		else
+			# building for OS X 10.0 through 10.2
 			LDSHARED='$(CC) -bundle'
 			LDCXXSHARED='$(CXX) -bundle'
 			if test "$enable_framework" ; then
@@ -8503,6 +8582,11 @@
 				LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
 				LDCXXSHARED="$LDCXXSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
 			fi
+		else
+			# building for OS X 10.3 and later
+			LDSHARED='$(CC) -bundle -undefined dynamic_lookup'
+			LDCXXSHARED='$(CXX) -bundle -undefined dynamic_lookup'
+			BLDSHARED="$LDSHARED"
 		fi
 		;;
 	Linux*|GNU*|QNX*)
@@ -8613,6 +8697,12 @@
 	# -u libsys_s pulls in all symbols in libsys
 	Darwin/*)
 		LINKFORSHARED="$extra_undefs -framework CoreFoundation"
+
+		# Issue #18075: the default maximum stack size (8MBytes) is too
+		# small for the default recursion limit. Increase the stack size
+		# to ensure that tests don't crash
+		LINKFORSHARED="-Wl,-stack_size,1000000 $LINKFORSHARED"
+
 		if test "$enable_framework"
 		then
 			LINKFORSHARED="$LINKFORSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
@@ -8823,6 +8913,48 @@
 
 fi
 	# Dynamic linking for HP-UX
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RAND_egd in -lcrypto" >&5
+$as_echo_n "checking for RAND_egd in -lcrypto... " >&6; }
+if ${ac_cv_lib_crypto_RAND_egd+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcrypto  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char RAND_egd ();
+int
+main ()
+{
+return RAND_egd ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_crypto_RAND_egd=yes
+else
+  ac_cv_lib_crypto_RAND_egd=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_RAND_egd" >&5
+$as_echo "$ac_cv_lib_crypto_RAND_egd" >&6; }
+if test "x$ac_cv_lib_crypto_RAND_egd" = xyes; then :
+
+$as_echo "#define HAVE_RAND_EGD 1" >>confdefs.h
+
+fi
+
 
 # only check for sem_init if thread support is requested
 if test "$with_threads" = "yes" -o -z "$with_threads"; then
@@ -8967,6 +9099,79 @@
 	*) ;;
 esac
 
+# check for systems that require aligned memory access
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking aligned memory access is required" >&5
+$as_echo_n "checking aligned memory access is required... " >&6; }
+if test "$cross_compiling" = yes; then :
+  aligned_required=yes
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int main()
+{
+    char s[16];
+    int i, *p1, *p2;
+    for (i=0; i < 16; i++)
+        s[i] = i;
+    p1 = (int*)(s+1);
+    p2 = (int*)(s+2);
+    if (*p1 == *p2)
+        return 1;
+    return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  aligned_required=no
+else
+  aligned_required=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+if test "$aligned_required" = yes ; then
+
+$as_echo "#define HAVE_ALIGNED_REQUIRED 1" >>confdefs.h
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $aligned_required" >&5
+$as_echo "$aligned_required" >&6; }
+
+
+# str, bytes and memoryview hash algorithm
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-hash-algorithm" >&5
+$as_echo_n "checking for --with-hash-algorithm... " >&6; }
+
+# Check whether --with-hash_algorithm was given.
+if test "${with_hash_algorithm+set}" = set; then :
+  withval=$with_hash_algorithm;
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $withval" >&5
+$as_echo "$withval" >&6; }
+case "$withval" in
+    siphash24)
+        $as_echo "#define Py_HASH_ALGORITHM 1" >>confdefs.h
+
+        ;;
+    fnv)
+        $as_echo "#define Py_HASH_ALGORITHM 2" >>confdefs.h
+
+        ;;
+    *)
+        as_fn_error $? "unknown hash algorithm '$withval'" "$LINENO" 5
+        ;;
+esac
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: default" >&5
+$as_echo "default" >&6; }
+fi
+
+
 # Most SVR4 platforms (e.g. Solaris) need -lsocket and -lnsl.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for t_open in -lnsl" >&5
 $as_echo_n "checking for t_open in -lnsl... " >&6; }
@@ -9065,7 +9270,15 @@
 fi
 
 
-if test -n "$ac_tool_prefix"; then
+
+
+
+
+
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+	if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -9163,6 +9376,20 @@
   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
 fi
 
+fi
+if test -n "$PKG_CONFIG"; then
+	_pkg_min_version=0.9.0
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+	else
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+		PKG_CONFIG=""
+	fi
+fi
 
 # Check for use of the system expat library
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-system-expat" >&5
@@ -10308,9 +10535,9 @@
 
 # checks for library functions
 for ac_func in alarm accept4 setitimer getitimer bind_textdomain_codeset chown \
- clock confstr ctermid execv faccessat fchmod fchmodat fchown fchownat \
+ clock confstr ctermid dup3 execv faccessat fchmod fchmodat fchown fchownat \
  fexecve fdopendir fork fpathconf fstatat ftime ftruncate futimesat \
- futimens futimes gai_strerror \
+ futimens futimes gai_strerror getentropy \
  getgrouplist getgroups getlogin getloadavg getpeername getpgid getpid \
  getpriority getresuid getresgid getpwent getspnam getspent getsid getwd \
  if_nameindex \
@@ -10328,7 +10555,7 @@
  sigtimedwait sigwait sigwaitinfo snprintf strftime strlcpy symlinkat sync \
  sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \
  truncate uname unlinkat unsetenv utimensat utimes waitid waitpid wait3 wait4 \
- wcscoll wcsftime wcsxfrm writev _getpty
+ wcscoll wcsftime wcsxfrm wmemcmp writev _getpty
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -10581,6 +10808,35 @@
 
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for prlimit" >&5
+$as_echo_n "checking for prlimit... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <sys/time.h>
+#include <sys/resource.h>
+
+int
+main ()
+{
+void *x=prlimit
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+$as_echo "#define HAVE_PRLIMIT 1" >>confdefs.h
+
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 # On some systems (eg. FreeBSD 5), we would find a definition of the
 # functions ctermid_r, setgroups in the library, but no prototype
 # (e.g. because we use _XOPEN_SOURCE). See whether we can take their
@@ -11412,19 +11668,6 @@
 
 fi
 
-ac_fn_c_check_func "$LINENO" "getcwd" "ac_cv_func_getcwd"
-if test "x$ac_cv_func_getcwd" = xyes; then :
-  $as_echo "#define HAVE_GETCWD 1" >>confdefs.h
-
-else
-  case " $LIBOBJS " in
-  *" getcwd.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS getcwd.$ac_objext"
- ;;
-esac
-
-fi
-
 ac_fn_c_check_func "$LINENO" "strdup" "ac_cv_func_strdup"
 if test "x$ac_cv_func_strdup" = xyes; then :
   $as_echo "#define HAVE_STRDUP 1" >>confdefs.h
@@ -13778,6 +14021,10 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDVERSION" >&5
 $as_echo "$LDVERSION" >&6; }
 
+
+LIBPL="${prefix}/lib/python${VERSION}/config-${LDVERSION}"
+
+
 # Check whether right shifting a negative integer extends the sign bit
 # or fills with zeros (like the Cray J90, according to Tim Peters).
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether right shift extends the sign bit" >&5
@@ -14499,8 +14746,43 @@
 
 fi
 
+# first curses header check
 ac_save_cppflags="$CPPFLAGS"
 CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
+
+for ac_header in curses.h ncurses.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+# On Solaris, term.h requires curses.h
+for ac_header in term.h
+do :
+  ac_fn_c_check_header_compile "$LINENO" "term.h" "ac_cv_header_term_h" "
+#ifdef HAVE_CURSES_H
+#include <curses.h>
+#endif
+
+"
+if test "x$ac_cv_header_term_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_TERM_H 1
+_ACEOF
+
+fi
+
+done
+
+
 # On HP/UX 11.0, mvwdelch is a block with a return statement
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mvwdelch is an expression" >&5
 $as_echo_n "checking whether mvwdelch is an expression... " >&6; }
@@ -15185,8 +15467,33 @@
     esac
 fi
 
+# ensurepip option
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ensurepip" >&5
+$as_echo_n "checking for ensurepip... " >&6; }
+
+# Check whether --with-ensurepip was given.
+if test "${with_ensurepip+set}" = set; then :
+  withval=$with_ensurepip;
+else
+  with_ensurepip=upgrade
+fi
+
+case $with_ensurepip in #(
+  yes|upgrade) :
+    ENSUREPIP=upgrade ;; #(
+  install) :
+    ENSUREPIP=install ;; #(
+  no) :
+    ENSUREPIP=no ;; #(
+  *) :
+    as_fn_error $? "--with-ensurepip=upgrade|install|no" "$LINENO" 5 ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ENSUREPIP" >&5
+$as_echo "$ENSUREPIP" >&6; }
+
+
 # generate output files
-ac_config_files="$ac_config_files Makefile.pre Modules/Setup.config Misc/python.pc"
+ac_config_files="$ac_config_files Makefile.pre Modules/Setup.config Misc/python.pc Misc/python-config.sh"
 
 ac_config_files="$ac_config_files Modules/ld_so_aix"
 
@@ -15697,7 +16004,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by python $as_me 3.3, which was
+This file was extended by python $as_me 3.4, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -15759,7 +16066,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-python config.status 3.3
+python config.status 3.4
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
@@ -15890,6 +16197,7 @@
     "Makefile.pre") CONFIG_FILES="$CONFIG_FILES Makefile.pre" ;;
     "Modules/Setup.config") CONFIG_FILES="$CONFIG_FILES Modules/Setup.config" ;;
     "Misc/python.pc") CONFIG_FILES="$CONFIG_FILES Misc/python.pc" ;;
+    "Misc/python-config.sh") CONFIG_FILES="$CONFIG_FILES Misc/python-config.sh" ;;
     "Modules/ld_so_aix") CONFIG_FILES="$CONFIG_FILES Modules/ld_so_aix" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
diff --git a/configure.ac b/configure.ac
index 0e67f03..a0d0afa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,7 +3,7 @@
 dnl ***********************************************
 
 # Set VERSION so we only need to edit in one place (i.e., here)
-m4_define(PYTHON_VERSION, 3.3)
+m4_define(PYTHON_VERSION, 3.4)
 
 AC_PREREQ(2.65)
 
@@ -53,6 +53,9 @@
 AC_SUBST(build)
 AC_SUBST(host)
 
+# pybuilddir.txt will be created by --generate-posix-vars in the Makefile
+rm -f pybuilddir.txt
+
 if test "$cross_compiling" = yes; then
     AC_MSG_CHECKING([for python interpreter for cross build])
     if test -z "$PYTHON_FOR_BUILD"; then
@@ -152,7 +155,7 @@
 		# Locate the best usable SDK, see Mac/README.txt for more
 		# information
 		enableval="`/usr/bin/xcodebuild -version -sdk macosx Path 2>/dev/null`"
-		if test -z "${enableval}"
+		if ! ( echo $enableval | grep -E '\.sdk' 1>/dev/null )
 		then
 			enableval=/Developer/SDKs/MacOSX10.4u.sdk
 			if test ! -d "${enableval}"
@@ -189,6 +192,7 @@
 AC_SUBST(UNIVERSALSDK)
 
 AC_SUBST(ARCH_RUN_32BIT)
+ARCH_RUN_32BIT=""
 
 # For backward compatibility reasons we prefer to select '32-bit' if available,
 # otherwise use 'intel'
@@ -197,7 +201,7 @@
 then
 	if test -n "${UNIVERSALSDK}"
 	then
-		if test -z "`/usr/bin/file "${UNIVERSALSDK}/usr/lib/libSystem.dylib" | grep ppc`"
+		if test -z "`/usr/bin/file -L "${UNIVERSALSDK}/usr/lib/libSystem.dylib" | grep ppc`"
 		then
 			UNIVERSAL_ARCHS="intel"
 		fi
@@ -207,16 +211,17 @@
 AC_SUBST(LIPO_32BIT_FLAGS)
 AC_MSG_CHECKING(for --with-universal-archs)
 AC_ARG_WITH(universal-archs,
-    AS_HELP_STRING([--with-universal-archs=ARCH], [select architectures for universal build ("32-bit", "64-bit", "3-way", "intel" or "all")]),
+    AS_HELP_STRING([--with-universal-archs=ARCH], [select architectures for universal build ("32-bit", "64-bit", "3-way", "intel", "intel-32", or "all")]),
 [
-	AC_MSG_RESULT($withval)
 	UNIVERSAL_ARCHS="$withval"
 ],
-[
- 	AC_MSG_RESULT(${UNIVERSAL_ARCHS})
-])
-
-
+[])
+if test -n "${UNIVERSALSDK}"
+then
+	AC_MSG_RESULT(${UNIVERSAL_ARCHS})
+else
+	AC_MSG_RESULT(no)
+fi
 
 AC_ARG_WITH(framework-name,
               AS_HELP_STRING([--with-framework-name=FRAMEWORK],
@@ -248,6 +253,7 @@
 		FRAMEWORKINSTALLLAST=
 		FRAMEWORKALTINSTALLFIRST=
 		FRAMEWORKALTINSTALLLAST=
+		FRAMEWORKPYTHONW=
 		if test "x${prefix}" = "xNONE"; then
 			FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
 		else
@@ -262,6 +268,7 @@
 		FRAMEWORKALTINSTALLFIRST="frameworkinstallstructure "
 		FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools"
 		FRAMEWORKALTINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkaltinstallunixtools"
+		FRAMEWORKPYTHONW="frameworkpythonw"
 		FRAMEWORKINSTALLAPPSPREFIX="/Applications"
 
 		if test "x${prefix}" = "xNONE" ; then
@@ -323,6 +330,7 @@
 	FRAMEWORKINSTALLLAST=
 	FRAMEWORKALTINSTALLFIRST=
 	FRAMEWORKALTINSTALLLAST=
+	FRAMEWORKPYTHONW=
 	if test "x${prefix}" = "xNONE" ; then
 		FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
 	else
@@ -340,6 +348,7 @@
 AC_SUBST(FRAMEWORKINSTALLLAST)
 AC_SUBST(FRAMEWORKALTINSTALLFIRST)
 AC_SUBST(FRAMEWORKALTINSTALLLAST)
+AC_SUBST(FRAMEWORKPYTHONW)
 AC_SUBST(FRAMEWORKUNIXTOOLSPREFIX)
 AC_SUBST(FRAMEWORKINSTALLAPPSPREFIX)
 
@@ -516,6 +525,19 @@
   AC_DEFINE(_POSIX_C_SOURCE, 200809L, Define to activate features from IEEE Stds 1003.1-2008)
 fi
 
+# On HP-UX mbstate_t requires _INCLUDE__STDC_A1_SOURCE
+case $ac_sys_system in
+  hp*|HP*)
+    define_stdc_a1=yes;;
+  *)
+    define_stdc_a1=no;;
+esac
+
+if test $define_stdc_a1 = yes
+then
+  AC_DEFINE(_INCLUDE__STDC_A1_SOURCE, 1, Define to include mbstate_t for mbrtowc)
+fi
+
 #
 # SGI compilers allow the specification of the both the ABI and the
 # ISA on the command line.  Depending on the values of these switches,
@@ -691,7 +713,7 @@
 fi
 if test "$preset_cxx" != "$CXX"
 then
-        AC_MSG_WARN([
+        AC_MSG_NOTICE([
 
   By default, distutils will build C++ extension modules with "$CXX".
   If this is not intended, then set CXX on the configure command line.
@@ -917,6 +939,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*)
@@ -963,7 +986,7 @@
     Darwin*)
     	LDLIBRARY='libpython$(LDVERSION).dylib'
 	BLDLIBRARY='-L. -lpython$(LDVERSION)'
-	RUNSHARED='DYLD_LIBRARY_PATH=`pwd`${DYLD_LIBRARY_PATH:+:${DYLD_LIBRARY_PATH}}'
+	RUNSHARED=DYLD_LIBRARY_PATH=`pwd`${DYLD_LIBRARY_PATH:+:${DYLD_LIBRARY_PATH}}
 	;;
     AIX*)
 	LDLIBRARY='libpython$(LDVERSION).so'
@@ -972,6 +995,7 @@
 
   esac
 else # shared is disabled
+  PY_ENABLE_SHARED=0
   case $ac_sys_system in
     CYGWIN*)
           BLDLIBRARY='$(LIBRARY)'
@@ -1117,6 +1141,7 @@
 fi
 
 AC_SUBST(BASECFLAGS)
+AC_SUBST(CFLAGS_NODIST)
 
 # The -arch flags for universal builds on OSX
 UNIVERSAL_ARCH_FLAGS=
@@ -1182,6 +1207,28 @@
       BASECFLAGS="$BASECFLAGS -Wno-unused-result"
     fi
 
+    AC_MSG_CHECKING(for -Werror=declaration-after-statement)
+     ac_save_cc="$CC"
+     CC="$CC -Werror=declaration-after-statement"
+     save_CFLAGS="$CFLAGS"
+     AC_CACHE_VAL(ac_cv_declaration_after_statement_warning,
+       AC_COMPILE_IFELSE(
+         [
+	   AC_LANG_PROGRAM([[]], [[]])
+	 ],[
+           ac_cv_declaration_after_statement_warning=yes
+	 ],[
+           ac_cv_declaration_after_statement_warning=no
+	 ]))
+     CFLAGS="$save_CFLAGS"
+     CC="$ac_save_cc"
+    AC_MSG_RESULT($ac_cv_declaration_after_statement_warning)
+
+    if test $ac_cv_declaration_after_statement_warning = yes
+    then
+      CFLAGS_NODIST="$CFLAGS_NODIST -Werror=declaration-after-statement"
+    fi
+
     # if using gcc on alpha, use -mieee to get (near) full IEEE 754
     # support.  Without this, treatment of subnormals doesn't follow
     # the standard.
@@ -1195,111 +1242,126 @@
 	SCO_SV*)
 	    BASECFLAGS="$BASECFLAGS -m486 -DSCO5"
 	    ;;
-	# is there any other compiler on Darwin besides gcc?
-	Darwin*)
-	    # -Wno-long-double, -no-cpp-precomp, and -mno-fused-madd
-	    # used to be here, but non-Apple gcc doesn't accept them.
-            if test "${CC}" = gcc
-	    then
-		AC_MSG_CHECKING(which compiler should be used)
-		case "${UNIVERSALSDK}" in
-		*/MacOSX10.4u.sdk)
-			# Build using 10.4 SDK, force usage of gcc when the 
-			# compiler is gcc, otherwise the user will get very
-			# confusing error messages when building on OSX 10.6
-			CC=gcc-4.0
-			CPP=cpp-4.0
-			;;
-		esac
-		AC_MSG_RESULT($CC)
-	    fi
 
+    # is there any other compiler on Darwin besides gcc?
+    Darwin*)
+        # -Wno-long-double, -no-cpp-precomp, and -mno-fused-madd
+        # used to be here, but non-Apple gcc doesn't accept them.
+        if test "${CC}" = gcc
+        then
+            AC_MSG_CHECKING(which compiler should be used)
+            case "${UNIVERSALSDK}" in
+            */MacOSX10.4u.sdk)
+                # Build using 10.4 SDK, force usage of gcc when the
+                # compiler is gcc, otherwise the user will get very
+                # confusing error messages when building on OSX 10.6
+                CC=gcc-4.0
+                CPP=cpp-4.0
+                ;;
+            esac
+            AC_MSG_RESULT($CC)
+        fi
 
-	    if test "${enable_universalsdk}"; then
-		UNIVERSAL_ARCH_FLAGS=""
-	        if test "$UNIVERSAL_ARCHS" = "32-bit" ; then
-		   UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386"
-		   ARCH_RUN_32BIT=""
-		   LIPO_32BIT_FLAGS=""
-	         elif test "$UNIVERSAL_ARCHS" = "64-bit" ; then
-		   UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64"
-		   LIPO_32BIT_FLAGS=""
-		   ARCH_RUN_32BIT="true"
+        if test "${enable_universalsdk}"
+        then
+            case "$UNIVERSAL_ARCHS" in
+            32-bit)
+               UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386"
+               LIPO_32BIT_FLAGS=""
+               ARCH_RUN_32BIT=""
+               ;;
+            64-bit)
+               UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64"
+               LIPO_32BIT_FLAGS=""
+               ARCH_RUN_32BIT="true"
+               ;;
+            all)
+               UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch ppc64 -arch x86_64"
+               LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
+               ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
+               ;;
+            intel)
+               UNIVERSAL_ARCH_FLAGS="-arch i386 -arch x86_64"
+               LIPO_32BIT_FLAGS="-extract i386"
+               ARCH_RUN_32BIT="/usr/bin/arch -i386"
+               ;;
+            intel-32)
+               UNIVERSAL_ARCH_FLAGS="-arch i386"
+               LIPO_32BIT_FLAGS=""
+               ARCH_RUN_32BIT=""
+               ;;
+            3-way)
+               UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch x86_64"
+               LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
+               ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
+               ;;
+            *)
+               AC_MSG_ERROR([proper usage is --with-universal-arch=32-bit|64-bit|all|intel|3-way])
+               ;;
+            esac
 
-	         elif test "$UNIVERSAL_ARCHS" = "all" ; then
-		   UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch ppc64 -arch x86_64"
-		   LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
-		   ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
+            CFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${CFLAGS}"
+            LDFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${LDFLAGS}"
+            if test "${UNIVERSALSDK}" != "/"
+            then
+                CPPFLAGS="-isysroot ${UNIVERSALSDK} ${CPPFLAGS}"
+            fi
+        fi
 
-	         elif test "$UNIVERSAL_ARCHS" = "intel" ; then
-		   UNIVERSAL_ARCH_FLAGS="-arch i386 -arch x86_64"
-		   LIPO_32BIT_FLAGS="-extract i386"
-		   ARCH_RUN_32BIT="/usr/bin/arch -i386"
+        # Calculate an appropriate deployment target for this build:
+        # The deployment target value is used explicitly to enable certain
+        # features are enabled (such as builtin libedit support for readline)
+        # through the use of Apple's Availabiliy Macros and is used as a
+        # component of the string returned by distutils.get_platform().
+        #
+        # Use the value from:
+        # 1. the MACOSX_DEPLOYMENT_TARGET environment variable if specified
+        # 2. the operating system version of the build machine if >= 10.6
+        # 3. If running on OS X 10.3 through 10.5, use the legacy tests
+        #       below to pick either 10.3, 10.4, or 10.5 as the target.
+        # 4. If we are running on OS X 10.2 or earlier, good luck!
 
-	         elif test "$UNIVERSAL_ARCHS" = "3-way" ; then
-		   UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch x86_64"
-		   LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
-		   ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
+        AC_MSG_CHECKING(which MACOSX_DEPLOYMENT_TARGET to use)
+        cur_target_major=`sw_vers -productVersion | \
+                sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
+        cur_target_minor=`sw_vers -productVersion | \
+                sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
+        cur_target="${cur_target_major}.${cur_target_minor}"
+        if test ${cur_target_major} -eq 10 && \
+           test ${cur_target_minor} -ge 3 && \
+           test ${cur_target_minor} -le 5
+        then
+            # OS X 10.3 through 10.5
+            cur_target=10.3
+            if test ${enable_universalsdk}
+            then
+                case "$UNIVERSAL_ARCHS" in
+                all|3-way|intel|64-bit)
+                    # These configurations were first supported in 10.5
+                    cur_target='10.5'
+                    ;;
+                esac
+            else
+                if test `/usr/bin/arch` = "i386"
+                then
+                    # 10.4 was the first release to support Intel archs
+                    cur_target="10.4"
+                fi
+            fi
+        fi
+        CONFIGURE_MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET-${cur_target}}
 
-		 else
-	           AC_MSG_ERROR([proper usage is --with-universal-arch=32-bit|64-bit|all|intel|3-way])
+        # Make sure that MACOSX_DEPLOYMENT_TARGET is set in the
+        # environment with a value that is the same as what we'll use
+        # in the Makefile to ensure that we'll get the same compiler
+        # environment during configure and build time.
+        MACOSX_DEPLOYMENT_TARGET="$CONFIGURE_MACOSX_DEPLOYMENT_TARGET"
+        export MACOSX_DEPLOYMENT_TARGET
+        EXPORT_MACOSX_DEPLOYMENT_TARGET=''
+        AC_MSG_RESULT($MACOSX_DEPLOYMENT_TARGET)
 
-		 fi
-
-
-		CFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${CFLAGS}"
-		if test "${UNIVERSALSDK}" != "/"
-		then
-			CFLAGS="-isysroot ${UNIVERSALSDK} ${CFLAGS}"
-			LDFLAGS="-isysroot ${UNIVERSALSDK} ${LDFLAGS}"
-			CPPFLAGS="-isysroot ${UNIVERSALSDK} ${CPPFLAGS}"
-		fi
-	    fi
-
-	    # Calculate the right deployment target for this build.
-	    #
-	    cur_target=`sw_vers -productVersion | sed 's/\(10\.[[0-9]]*\).*/\1/'`
-	    if test ${cur_target} '>' 10.2 && \
-	       test ${cur_target} '<' 10.6
-	    then
-		    cur_target=10.3
-		    if test ${enable_universalsdk}; then
-			    if test "${UNIVERSAL_ARCHS}" = "all"; then
-				    # Ensure that the default platform for a 
-				    # 4-way universal build is OSX 10.5, 
-				    # that's the first OS release where 
-				    # 4-way builds make sense.
-				    cur_target='10.5'
-
-			    elif test "${UNIVERSAL_ARCHS}" = "3-way"; then
-				    cur_target='10.5'
-
-			    elif test "${UNIVERSAL_ARCHS}" = "intel"; then
-				    cur_target='10.5'
-
-			    elif test "${UNIVERSAL_ARCHS}" = "64-bit"; then
-				    cur_target='10.5'
-			    fi
-		    else
-			    if test `/usr/bin/arch` = "i386"; then
-				    # On Intel macs default to a deployment
-				    # target of 10.4, that's the first OSX
-				    # release with Intel support.
-				    cur_target="10.4"
-			    fi
-		    fi
-	    fi
-	    CONFIGURE_MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET-${cur_target}}
-	    
-	    # Make sure that MACOSX_DEPLOYMENT_TARGET is set in the 
-	    # environment with a value that is the same as what we'll use
-	    # in the Makefile to ensure that we'll get the same compiler
-	    # environment during configure and build time.
-	    MACOSX_DEPLOYMENT_TARGET="$CONFIGURE_MACOSX_DEPLOYMENT_TARGET"
-	    export MACOSX_DEPLOYMENT_TARGET
-	    EXPORT_MACOSX_DEPLOYMENT_TARGET=''
-
-	    ;;
+        # end of Darwin* tests
+        ;;
     esac
     ;;
 
@@ -1326,24 +1388,6 @@
 	BASECFLAGS="$BASECFLAGS $ac_arch_flags"
 fi
 
-# Check whether GCC supports PyArg_ParseTuple format
-if test "$GCC" = "yes"
-then
-  AC_MSG_CHECKING(whether gcc supports ParseTuple __format__)
-  save_CFLAGS=$CFLAGS
-  CFLAGS="$CFLAGS -Werror -Wformat"
-  AC_COMPILE_IFELSE([
-    AC_LANG_PROGRAM([[void f(char*,...)__attribute((format(PyArg_ParseTuple, 1, 2)));]], [[]])
-  ],[
-    AC_DEFINE(HAVE_ATTRIBUTE_FORMAT_PARSETUPLE, 1,
-      [Define if GCC supports __attribute__((format(PyArg_ParseTuple, 2, 3)))])
-    AC_MSG_RESULT(yes)
-  ],[
-    AC_MSG_RESULT(no)
-  ])
-  CFLAGS=$save_CFLAGS
-fi
-
 # On some compilers, pthreads are available without further options
 # (e.g. MacOS X). On some of these systems, the compiler will not
 # complain if unaccepted options are passed (e.g. gcc on Mac OS X).
@@ -1512,11 +1556,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 \
@@ -1526,8 +1568,8 @@
 sys/stat.h sys/syscall.h sys/sys_domain.h sys/termio.h sys/time.h \
 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 alloca.h)
-CPPFLAGS=$ac_save_cppflags
+bluetooth/bluetooth.h linux/tipc.h spawn.h util.h alloca.h endian.h \
+sys/endian.h)
 AC_HEADER_DIRENT
 AC_HEADER_MAJOR
 
@@ -1547,14 +1589,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
@@ -1566,7 +1600,7 @@
 ])
 
 # On Linux, can.h and can/raw.h require sys/socket.h
-AC_CHECK_HEADERS(linux/can.h linux/can/raw.h,,,[
+AC_CHECK_HEADERS(linux/can.h linux/can/raw.h linux/can/bcm.h,,,[
 #ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 #endif
@@ -1597,6 +1631,22 @@
     AC_DEFINE(HAVE_MAKEDEV, 1, [Define this if you have the makedev macro.])
 fi
 
+# byte swapping
+AC_MSG_CHECKING(for le64toh)
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#ifdef HAVE_ENDIAN_H
+#include <endian.h>
+#elif defined(HAVE_SYS_ENDIAN_H)
+#include <sys/endian.h>
+#endif
+]], [[
+   le64toh(1) ]])
+],[ac_cv_has_le64toh=yes],[ac_cv_has_le64toh=no])
+AC_MSG_RESULT($ac_cv_has_le64toh)
+if test "$ac_cv_has_le64toh" = "yes"; then
+    AC_DEFINE(HAVE_HTOLE64, 1, [Define this if you have le64toh()])
+fi
+
 # Enabling LFS on Solaris (2.6 to 9) with gcc 2.95 triggers a bug in
 # the system headers: If _XOPEN_SOURCE and _LARGEFILE_SOURCE are
 # defined, but the compiler does not support pragma redefine_extname,
@@ -1798,7 +1848,6 @@
 esac
 
 
-ARCH_RUN_32BIT=""
 AC_SUBST(LIBTOOL_CRUFT)
 case $ac_sys_system/$ac_sys_release in
   Darwin/@<:@01567@:>@\..*) 
@@ -1855,14 +1904,12 @@
     		;;
     	esac
 
-	#ARCH_RUN_32BIT="true"
     fi
 
     LIBTOOL_CRUFT=$LIBTOOL_CRUFT" -lSystem -lSystemStubs -arch_only ${MACOSX_DEFAULT_ARCH}"
     LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
     LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
 esac
-
 AC_MSG_CHECKING(for --enable-framework)
 if test "$enable_framework"
 then
@@ -1980,15 +2027,14 @@
 		# Use -undefined dynamic_lookup whenever possible (10.3 and later).
 		# This allows an extension to be used in any Python
 
-		if test ${MACOSX_DEPLOYMENT_TARGET} '>' 10.2
+		dep_target_major=`echo ${MACOSX_DEPLOYMENT_TARGET} | \
+				sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
+		dep_target_minor=`echo ${MACOSX_DEPLOYMENT_TARGET} | \
+				sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
+		if test ${dep_target_major} -eq 10 && \
+		   test ${dep_target_minor} -le 2
 		then
-			if test "${enable_universalsdk}"; then
-				LDFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${LDFLAGS}"
-			fi
-			LDSHARED='$(CC) -bundle -undefined dynamic_lookup'
-			LDCXXSHARED='$(CXX) -bundle -undefined dynamic_lookup'
-			BLDSHARED="$LDSHARED"
-		else
+			# building for OS X 10.0 through 10.2
 			LDSHARED='$(CC) -bundle'
 			LDCXXSHARED='$(CXX) -bundle'
 			if test "$enable_framework" ; then
@@ -2002,6 +2048,11 @@
 				LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
 				LDCXXSHARED="$LDCXXSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
 			fi
+		else
+			# building for OS X 10.3 and later
+			LDSHARED='$(CC) -bundle -undefined dynamic_lookup'
+			LDCXXSHARED='$(CXX) -bundle -undefined dynamic_lookup'
+			BLDSHARED="$LDSHARED"
 		fi
 		;;
 	Linux*|GNU*|QNX*)
@@ -2108,6 +2159,12 @@
 	# -u libsys_s pulls in all symbols in libsys
 	Darwin/*) 
 		LINKFORSHARED="$extra_undefs -framework CoreFoundation"
+
+		# Issue #18075: the default maximum stack size (8MBytes) is too
+		# small for the default recursion limit. Increase the stack size
+		# to ensure that tests don't crash
+		LINKFORSHARED="-Wl,-stack_size,1000000 $LINKFORSHARED"
+
 		if test "$enable_framework"
 		then
 			LINKFORSHARED="$LINKFORSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
@@ -2181,6 +2238,9 @@
 AC_CHECK_LIB(sendfile, sendfile)
 AC_CHECK_LIB(dl, dlopen)	# Dynamic linking for SunOS/Solaris and SYSV
 AC_CHECK_LIB(dld, shl_load)	# Dynamic linking for HP-UX
+AC_CHECK_LIB(crypto, RAND_egd,
+             AC_DEFINE(HAVE_RAND_EGD, 1,
+             [Define if the libcrypto has RAND_egd]))
 
 # only check for sem_init if thread support is requested
 if test "$with_threads" = "yes" -o -z "$with_threads"; then
@@ -2212,6 +2272,59 @@
 	*) ;;
 esac
 
+# check for systems that require aligned memory access
+AC_MSG_CHECKING(aligned memory access is required)
+AC_TRY_RUN([
+int main()
+{
+    char s[16];
+    int i, *p1, *p2;
+    for (i=0; i < 16; i++)
+        s[i] = i;
+    p1 = (int*)(s+1);
+    p2 = (int*)(s+2);
+    if (*p1 == *p2)
+        return 1;
+    return 0;
+}
+              ],
+     [aligned_required=no],
+     [aligned_required=yes],
+     [aligned_required=yes])
+
+if test "$aligned_required" = yes ; then
+  AC_DEFINE([HAVE_ALIGNED_REQUIRED], [1],
+    [Define if aligned memory access is required])
+fi
+AC_MSG_RESULT($aligned_required)
+
+
+# str, bytes and memoryview hash algorithm
+AH_TEMPLATE(Py_HASH_ALGORITHM,
+  [Define hash algorithm for str, bytes and memoryview.
+   SipHash24: 1, FNV: 2, externally defined: 0])
+
+AC_MSG_CHECKING(for --with-hash-algorithm)
+dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
+AC_ARG_WITH(hash_algorithm,
+            AS_HELP_STRING([--with-hash-algorithm=@<:@fnv|siphash24@:>@],
+                           [select hash algorithm]),
+[
+AC_MSG_RESULT($withval)
+case "$withval" in
+    siphash24)
+        AC_DEFINE(Py_HASH_ALGORITHM, 1)
+        ;;
+    fnv)
+        AC_DEFINE(Py_HASH_ALGORITHM, 2)
+        ;;
+    *)
+        AC_MSG_ERROR([unknown hash algorithm '$withval'])
+        ;;
+esac
+],
+[AC_MSG_RESULT(default)])
+
 # Most SVR4 platforms (e.g. Solaris) need -lsocket and -lnsl.
 AC_CHECK_LIB(nsl, t_open, [LIBS="-lnsl $LIBS"]) # SVR4
 AC_CHECK_LIB(socket, socket, [LIBS="-lsocket $LIBS"], [], $LIBS) # SVR4 sockets
@@ -2225,7 +2338,7 @@
 ],
 [AC_MSG_RESULT(no)])
 
-AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+PKG_PROG_PKG_CONFIG
 
 # Check for use of the system expat library
 AC_MSG_CHECKING(for --with-system-expat)
@@ -2823,9 +2936,9 @@
 
 # checks for library functions
 AC_CHECK_FUNCS(alarm accept4 setitimer getitimer bind_textdomain_codeset chown \
- clock confstr ctermid execv faccessat fchmod fchmodat fchown fchownat \
+ clock confstr ctermid dup3 execv faccessat fchmod fchmodat fchown fchownat \
  fexecve fdopendir fork fpathconf fstatat ftime ftruncate futimesat \
- futimens futimes gai_strerror \
+ futimens futimes gai_strerror getentropy \
  getgrouplist getgroups getlogin getloadavg getpeername getpgid getpid \
  getpriority getresuid getresgid getpwent getspnam getspent getsid getwd \
  if_nameindex \
@@ -2843,7 +2956,7 @@
  sigtimedwait sigwait sigwaitinfo snprintf strftime strlcpy symlinkat sync \
  sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \
  truncate uname unlinkat unsetenv utimensat utimes waitid waitpid wait3 wait4 \
- wcscoll wcsftime wcsxfrm writev _getpty)
+ wcscoll wcsftime wcsxfrm wmemcmp writev _getpty)
 
 AC_CHECK_DECL(dirfd,
     AC_DEFINE(HAVE_DIRFD, 1,
@@ -2910,6 +3023,16 @@
    AC_MSG_RESULT(yes)],
   [AC_MSG_RESULT(no)
 ])
+AC_MSG_CHECKING(for prlimit)
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <sys/time.h>
+#include <sys/resource.h>
+    ]], [[void *x=prlimit]])],
+  [AC_DEFINE(HAVE_PRLIMIT, 1, Define if you have the 'prlimit' functions.)
+   AC_MSG_RESULT(yes)],
+  [AC_MSG_RESULT(no)
+])
+
 # On some systems (eg. FreeBSD 5), we would find a definition of the
 # functions ctermid_r, setgroups in the library, but no prototype
 # (e.g. because we use _XOPEN_SOURCE). See whether we can take their
@@ -3110,7 +3233,7 @@
 # check for long file support functions
 AC_CHECK_FUNCS(fseek64 fseeko fstatvfs ftell64 ftello statvfs)
 
-AC_REPLACE_FUNCS(dup2 getcwd strdup)
+AC_REPLACE_FUNCS(dup2 strdup)
 AC_CHECK_FUNCS(getpgrp, 
   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]], [[getpgrp(0);]])],
     [AC_DEFINE(GETPGRP_HAVE_ARG, 1, [Define if getpgrp() must be called as getpgrp(0).])],
@@ -3983,6 +4106,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}"
+AC_SUBST(LIBPL)
+
 # 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)
@@ -4272,8 +4400,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,
@@ -4661,8 +4800,23 @@
     esac
 fi
 
+# ensurepip option
+AC_MSG_CHECKING(for ensurepip)
+AC_ARG_WITH(ensurepip,
+    [AS_HELP_STRING([--with(out)-ensurepip=@<:@=upgrade@:>@],
+        ["install" or "upgrade" using bundled pip])],
+    [],
+    [with_ensurepip=upgrade])
+AS_CASE($with_ensurepip,
+    [yes|upgrade],[ENSUREPIP=upgrade],
+    [install],[ENSUREPIP=install],
+    [no],[ENSUREPIP=no],
+    [AC_MSG_ERROR([--with-ensurepip=upgrade|install|no])])
+AC_MSG_RESULT($ENSUREPIP)
+AC_SUBST(ENSUREPIP)
+
 # 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
 
diff --git a/pyconfig.h.in b/pyconfig.h.in
index 0020300..85490c8 100644
--- a/pyconfig.h.in
+++ b/pyconfig.h.in
@@ -49,6 +49,9 @@
 /* Define to 1 if you have the `alarm' function. */
 #undef HAVE_ALARM
 
+/* Define if aligned memory access is required */
+#undef HAVE_ALIGNED_REQUIRED
+
 /* Define to 1 if you have the <alloca.h> header file. */
 #undef HAVE_ALLOCA_H
 
@@ -64,9 +67,6 @@
 /* Define to 1 if you have the `atanh' function. */
 #undef HAVE_ATANH
 
-/* Define if GCC supports __attribute__((format(PyArg_ParseTuple, 2, 3))) */
-#undef HAVE_ATTRIBUTE_FORMAT_PARSETUPLE
-
 /* Define to 1 if you have the `bind_textdomain_codeset' function. */
 #undef HAVE_BIND_TEXTDOMAIN_CODESET
 
@@ -196,9 +196,15 @@
 /* Define to 1 if you have the `dup2' function. */
 #undef HAVE_DUP2
 
+/* Define to 1 if you have the `dup3' function. */
+#undef HAVE_DUP3
+
 /* Defined when any dynamic module loading is enabled. */
 #undef HAVE_DYNAMIC_LOADING
 
+/* Define to 1 if you have the <endian.h> header file. */
+#undef HAVE_ENDIAN_H
+
 /* Define if you have the 'epoll' functions. */
 #undef HAVE_EPOLL
 
@@ -320,12 +326,12 @@
 /* Define if you have the getaddrinfo function. */
 #undef HAVE_GETADDRINFO
 
-/* Define to 1 if you have the `getcwd' function. */
-#undef HAVE_GETCWD
-
 /* Define this if you have flockfile(), getc_unlocked(), and funlockfile() */
 #undef HAVE_GETC_UNLOCKED
 
+/* Define to 1 if you have the `getentropy' function. */
+#undef HAVE_GETENTROPY
+
 /* Define to 1 if you have the `getgrouplist' function. */
 #undef HAVE_GETGROUPLIST
 
@@ -411,6 +417,9 @@
 /* Define if you have the 'hstrerror' function. */
 #undef HAVE_HSTRERROR
 
+/* Define this if you have le64toh() */
+#undef HAVE_HTOLE64
+
 /* Define to 1 if you have the `hypot' function. */
 #undef HAVE_HYPOT
 
@@ -504,6 +513,9 @@
 /* Define to 1 if you have the `linkat' function. */
 #undef HAVE_LINKAT
 
+/* Define to 1 if you have the <linux/can/bcm.h> header file. */
+#undef HAVE_LINUX_CAN_BCM_H
+
 /* Define to 1 if you have the <linux/can.h> header file. */
 #undef HAVE_LINUX_CAN_H
 
@@ -627,6 +639,9 @@
 /* Define to 1 if you have the `pread' function. */
 #undef HAVE_PREAD
 
+/* Define if you have the 'prlimit' functions. */
+#undef HAVE_PRLIMIT
+
 /* Define to 1 if you have the <process.h> header file. */
 #undef HAVE_PROCESS_H
 
@@ -660,6 +675,9 @@
 /* Define to 1 if you have the `pwrite' function. */
 #undef HAVE_PWRITE
 
+/* Define if the libcrypto has RAND_egd */
+#undef HAVE_RAND_EGD
+
 /* Define to 1 if you have the `readlink' function. */
 #undef HAVE_READLINK
 
@@ -924,6 +942,9 @@
    */
 #undef HAVE_SYS_DIR_H
 
+/* Define to 1 if you have the <sys/endian.h> header file. */
+#undef HAVE_SYS_ENDIAN_H
+
 /* Define to 1 if you have the <sys/epoll.h> header file. */
 #undef HAVE_SYS_EPOLL_H
 
@@ -1121,6 +1142,9 @@
 /* Define to 1 if you have the `wcsxfrm' function. */
 #undef HAVE_WCSXFRM
 
+/* Define to 1 if you have the `wmemcmp' function. */
+#undef HAVE_WMEMCMP
+
 /* Define if tzset() actually switches the local timezone in a meaningful way.
    */
 #undef HAVE_WORKING_TZSET
@@ -1187,6 +1211,10 @@
 /* Defined if Python is built as a shared library. */
 #undef Py_ENABLE_SHARED
 
+/* Define hash algorithm for str, bytes and memoryview. SipHash24: 1, FNV: 2,
+   externally defined: 0 */
+#undef Py_HASH_ALGORITHM
+
 /* assume C89 semantics that RETSIGTYPE is always void */
 #undef RETSIGTYPE
 
@@ -1360,6 +1388,9 @@
 /* Define on Linux to activate all library features */
 #undef _GNU_SOURCE
 
+/* Define to include mbstate_t for mbrtowc */
+#undef _INCLUDE__STDC_A1_SOURCE
+
 /* This must be defined on some systems to enable large file support. */
 #undef _LARGEFILE_SOURCE
 
diff --git a/setup.py b/setup.py
index d594e02..2779658 100644
--- a/setup.py
+++ b/setup.py
@@ -1,8 +1,10 @@
 # Autodetecting setup.py script for building the Python extensions
 #
 
-import sys, os, imp, re, optparse
+import sys, os, importlib.machinery, re, optparse
 from glob import glob
+import importlib._bootstrap
+import importlib.util
 import sysconfig
 
 from distutils import log
@@ -17,6 +19,12 @@
 
 cross_compiling = "_PYTHON_HOST_PLATFORM" in os.environ
 
+# Add special CFLAGS reserved for building the interpreter and the stdlib
+# modules (Issue #21121).
+cflags = sysconfig.get_config_var('CFLAGS')
+py_cflags_nodist = sysconfig.get_config_var('PY_CFLAGS_NODIST')
+sysconfig.get_config_vars()['CFLAGS'] = cflags + ' ' + py_cflags_nodist
+
 def get_platform():
     # cross build
     if "_PYTHON_HOST_PLATFORM" in os.environ:
@@ -244,7 +252,7 @@
 
         build_ext.build_extensions(self)
 
-        longest = max([len(e.name) for e in self.extensions])
+        longest = max([len(e.name) for e in self.extensions], default=0)
         if self.failed:
             longest = max(longest, max([len(name) for name in self.failed]))
 
@@ -259,8 +267,9 @@
 
         if missing:
             print()
-            print("Python build finished, but the necessary bits to build "
-                   "these modules were not found:")
+            print("Python build finished successfully!")
+            print("The necessary bits to build these optional modules were not "
+                  "found:")
             print_three_column(missing)
             print("To find the necessary bits, look in setup.py in"
                   " detect_modules() for the module's name.")
@@ -325,8 +334,11 @@
         if cross_compiling:
             return
 
+        loader = importlib.machinery.ExtensionFileLoader(ext.name, ext_filename)
+        spec = importlib.util.spec_from_file_location(ext.name, ext_filename,
+                                                      loader=loader)
         try:
-            imp.load_dynamic(ext.name, ext_filename)
+            importlib._bootstrap._SpecMethods(spec).load()
         except ImportError as why:
             self.failed.append(ext.name)
             self.announce('*** WARNING: renaming "%s" since importing it'
@@ -588,10 +600,14 @@
                                depends=['testcapi_long.h']) )
         # Python PEP-3118 (buffer protocol) test module
         exts.append( Extension('_testbuffer', ['_testbuffer.c']) )
+        # Test loading multiple modules from one compiled file (http://bugs.python.org/issue16421)
+        exts.append( Extension('_testimportmultiple', ['_testimportmultiple.c']) )
         # profiler (_lsprof is for cProfile.py)
         exts.append( Extension('_lsprof', ['_lsprof.c', 'rotatingtree.c']) )
         # static Unicode character database
         exts.append( Extension('unicodedata', ['unicodedata.c']) )
+        # _opcode module
+        exts.append( Extension('_opcode', ['_opcode.c']) )
 
         # Modules with some UNIX dependencies -- on by default:
         # (If you have a really backward UNIX, select and socket may not be
@@ -687,7 +703,9 @@
         if host_platform == 'darwin':
             os_release = int(os.uname()[2].split('.')[0])
             dep_target = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET')
-            if dep_target and dep_target.split('.') < ['10', '5']:
+            if (dep_target and
+                    (tuple(int(n) for n in dep_target.split('.')[0:2])
+                        < (10, 5) ) ):
                 os_release = 8
             if os_release < 9:
                 # MacOSX 10.4 has a broken readline. Don't try to build
@@ -784,10 +802,10 @@
                     for line in incfile:
                         m = openssl_ver_re.match(line)
                         if m:
-                            openssl_ver = eval(m.group(1))
+                            openssl_ver = int(m.group(1), 16)
+                            break
             except IOError as msg:
                 print("IOError while reading opensshv.h:", msg)
-                pass
 
         #print('openssl_ver = 0x%08x' % openssl_ver)
         min_openssl_ver = 0x00907000
@@ -1012,8 +1030,16 @@
             if db_setup_debug:
                 print("bsddb using BerkeleyDB lib:", db_ver, dblib)
                 print("bsddb lib dir:", dblib_dir, " inc dir:", db_incdir)
-            db_incs = [db_incdir]
             dblibs = [dblib]
+            # Only add the found library and include directories if they aren't
+            # already being searched. This avoids an explicit runtime library
+            # dependency.
+            if db_incdir in inc_dirs:
+                db_incs = None
+            else:
+                db_incs = [db_incdir]
+            if dblib_dir[0] in lib_dirs:
+                dblib_dir = None
         else:
             if db_setup_debug: print("db: no appropriate library found")
             db_incs = None
@@ -1124,6 +1150,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,
@@ -1192,7 +1221,7 @@
                                 libraries = gdbm_libs)
                             break
                 elif cand == "bdb":
-                    if db_incs is not None:
+                    if dblibs:
                         if dbm_setup_debug: print("building dbm using bdb")
                         dbmext = Extension('_dbm', ['_dbmmodule.c'],
                                            library_dirs=dblib_dir,
@@ -1508,10 +1537,6 @@
 
         if host_platform == 'darwin':
             exts.append(
-                       Extension('_gestalt', ['_gestalt.c'],
-                       extra_link_args=['-framework', 'Carbon'])
-                       )
-            exts.append(
                        Extension('_scproxy', ['_scproxy.c'],
                        extra_link_args=[
                            '-framework', 'SystemConfiguration',
@@ -1532,7 +1557,7 @@
 
         if 'd' not in sys.abiflags:
             ext = Extension('xxlimited', ['xxlimited.c'],
-                            define_macros=[('Py_LIMITED_API', 1)])
+                            define_macros=[('Py_LIMITED_API', '0x03040000')])
             self.extensions.append(ext)
 
         return missing
@@ -2155,7 +2180,7 @@
 programmable interface.
 
 The Python implementation is portable: it runs on many brands of UNIX,
-on Windows, DOS, OS/2, Mac, Amiga... If your favorite system isn't
+on Windows, DOS, Mac, Amiga... If your favorite system isn't
 listed here, it may still be supported, if there's a C compiler for
 it. Ask around on comp.lang.python -- or just try compiling Python
 yourself.